From ba9334dc8d52e3dbbf504bff909e53e2a7f0f048 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Mon, 25 Oct 2021 17:55:46 +0200 Subject: [PATCH] Built motion from commit 89a9065d.|2.5.37 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/safe-template.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1152 files changed, 1152 insertions(+), 1152 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ea3fe9c..50cbe5f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-25T15:20:47.223Z", + "time": "2021-10-25T15:38:19.758Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index b5be928..406a983 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-25T15:20:47.223Z", + "time": "2021-10-25T15:38:19.758Z", "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 7960ffc..6508c14 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 _0xd21f=['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[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','action','STRING','integration','motionbar','jscripty','bot','script'];(function(_0x529ec9,_0x402017){var _0x101902=function(_0x33c6fa){while(--_0x33c6fa){_0x529ec9['push'](_0x529ec9['shift']());}};_0x101902(++_0x402017);}(_0xd21f,0xf7));var _0xfd21=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0xd21f[_0x14915a];return _0x2f683c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfd21('0x0')],'get':function(_0x87ddb1){return this['getDataValue'](_0xfd21('0x1'));}},'action':{'type':Sequelize[_0xfd21('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xfd21('0x3'),_0xfd21('0x4'),_0xfd21('0x5'),'urlForward','browser',_0xfd21('0x6'),_0xfd21('0x7')]],'msg':_0xfd21('0x8')}},'comment':_0xfd21('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xfd21('0x9')},'data2':{'type':Sequelize[_0xfd21('0x2')](0x1000),'comment':_0xfd21('0xa')},'data3':{'type':Sequelize[_0xfd21('0x2')](0x1000),'comment':_0xfd21('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xfd21('0xc')},'data5':{'type':Sequelize[_0xfd21('0x2')](0x1000),'comments':_0xfd21('0xd')},'data6':{'type':Sequelize[_0xfd21('0x2')],'comments':_0xfd21('0xe')},'data7':{'type':Sequelize[_0xfd21('0xf')],'comments':_0xfd21('0x10')}}; \ No newline at end of file +var _0xcafc=['exports','action','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize'];(function(_0x544687,_0x52bc78){var _0x2799a6=function(_0x4d5f90){while(--_0x4d5f90){_0x544687['push'](_0x544687['shift']());}};_0x2799a6(++_0x52bc78);}(_0xcafc,0x77));var _0xccaf=function(_0x4adff0,_0x45a31b){_0x4adff0=_0x4adff0-0x0;var _0x56a86f=_0xcafc[_0x4adff0];return _0x56a86f;};'use strict';var Sequelize=require(_0xccaf('0x0'));module[_0xccaf('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5f4660){return this['getDataValue'](_0xccaf('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration','motionbar',_0xccaf('0x3'),_0xccaf('0x4'),_0xccaf('0x5'),_0xccaf('0x6'),_0xccaf('0x7')]],'msg':_0xccaf('0x8')}},'comment':_0xccaf('0x8')},'data1':{'type':Sequelize[_0xccaf('0x9')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0xccaf('0x9')](0x1000),'comment':_0xccaf('0xa')},'data3':{'type':Sequelize[_0xccaf('0x9')](0x1000),'comment':_0xccaf('0xb')},'data4':{'type':Sequelize[_0xccaf('0x9')](0x1000),'comments':_0xccaf('0xc')},'data5':{'type':Sequelize[_0xccaf('0x9')](0x1000),'comments':_0xccaf('0xd')},'data6':{'type':Sequelize['STRING'],'comments':_0xccaf('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8ee4346..7841af6 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 _0x3163=['params','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','Action','catch','find'];(function(_0x1e1908,_0x4ba2ee){var _0x20415f=function(_0x5f522c){while(--_0x5f522c){_0x1e1908['push'](_0x1e1908['shift']());}};_0x20415f(++_0x4ba2ee);}(_0x3163,0x1b9));var _0x3316=function(_0x553af4,_0x507dfa){_0x553af4=_0x553af4-0x0;var _0x3f5730=_0x3163[_0x553af4];return _0x3f5730;};'use strict';var emlformat=require(_0x3316('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3316('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3316('0x2'));var moment=require(_0x3316('0x3'));var BPromise=require(_0x3316('0x4'));var Mustache=require('mustache');var util=require(_0x3316('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3316('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3316('0x7'));var squel=require(_0x3316('0x8'));var crypto=require(_0x3316('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3316('0x6'));var querystring=require(_0x3316('0xa'));var Papa=require(_0x3316('0xb'));var Redis=require(_0x3316('0xc'));var authService=require(_0x3316('0xd'));var qs=require(_0x3316('0xe'));var as=require(_0x3316('0xf'));var hardwareService=require(_0x3316('0x10'));var logger=require(_0x3316('0x11'))(_0x3316('0x12'));var utils=require(_0x3316('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3316('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8247cf,_0x58a594){_0x58a594=_0x58a594||0xcc;return function(_0x1e354f){if(_0x1e354f){return _0x8247cf[_0x3316('0x15')](_0x58a594);}return _0x8247cf[_0x3316('0x16')](_0x58a594)[_0x3316('0x17')]();};}function respondWithResult(_0x50c5c1,_0x4c4432){_0x4c4432=_0x4c4432||0xc8;return function(_0x1c7291){if(_0x1c7291){return _0x50c5c1['status'](_0x4c4432)[_0x3316('0x18')](_0x1c7291);}};}function respondWithFilteredResult(_0x4f0820,_0x51c08b){return function(_0x316bf8){if(_0x316bf8){var _0x13ff75=typeof _0x51c08b['offset']===_0x3316('0x19')&&typeof _0x51c08b[_0x3316('0x1a')]==='undefined';var _0x286f35=_0x316bf8[_0x3316('0x1b')];var _0x4ad80b=_0x13ff75?0x0:_0x51c08b[_0x3316('0x1c')];var _0x440058=_0x13ff75?_0x316bf8['count']:_0x51c08b[_0x3316('0x1c')]+_0x51c08b[_0x3316('0x1a')];var _0x54a407;if(_0x440058>=_0x286f35){_0x440058=_0x286f35;_0x54a407=0xc8;}else{_0x54a407=0xce;}_0x4f0820[_0x3316('0x16')](_0x54a407);return _0x4f0820['set'](_0x3316('0x1d'),_0x4ad80b+'-'+_0x440058+'/'+_0x286f35)[_0x3316('0x18')](_0x316bf8);}return null;};}function patchUpdates(_0x5658ca){return function(_0x4bf5f7){try{jsonpatch[_0x3316('0x1e')](_0x4bf5f7,_0x5658ca,!![]);}catch(_0x4d50d9){return BPromise[_0x3316('0x1f')](_0x4d50d9);}return _0x4bf5f7[_0x3316('0x20')]();};}function saveUpdates(_0x386320,_0x1a8e38){return function(_0x142280){if(_0x142280){return _0x142280[_0x3316('0x21')](_0x386320)[_0x3316('0x22')](function(_0x416acc){return _0x416acc;});}return null;};}function removeEntity(_0x32697b,_0x2f0502){return function(_0x223c31){if(_0x223c31){return _0x223c31[_0x3316('0x23')]()[_0x3316('0x22')](function(){_0x32697b[_0x3316('0x16')](0xcc)[_0x3316('0x17')]();});}};}function handleEntityNotFound(_0x23e46e,_0x9c6db8){return function(_0x2c9387){if(!_0x2c9387){_0x23e46e[_0x3316('0x15')](0x194);}return _0x2c9387;};}function handleError(_0x5d8070,_0x53ef3f){_0x53ef3f=_0x53ef3f||0x1f4;return function(_0x245ddc){logger[_0x3316('0x24')](_0x245ddc[_0x3316('0x25')]);if(_0x245ddc[_0x3316('0x26')]){delete _0x245ddc[_0x3316('0x26')];}_0x5d8070[_0x3316('0x16')](_0x53ef3f)['send'](_0x245ddc);};}exports['update']=function(_0x50aee0,_0x3cd2c9){if(_0x50aee0[_0x3316('0x27')]['id']){delete _0x50aee0[_0x3316('0x27')]['id'];}return db[_0x3316('0x28')]['find']({'where':{'id':_0x50aee0['params']['id']}})['then'](handleEntityNotFound(_0x3cd2c9,null))[_0x3316('0x22')](saveUpdates(_0x50aee0[_0x3316('0x27')],null))[_0x3316('0x22')](respondWithResult(_0x3cd2c9,null))[_0x3316('0x29')](handleError(_0x3cd2c9,null));};exports[_0x3316('0x23')]=function(_0x5a6f97,_0x3ba31c){return db[_0x3316('0x28')][_0x3316('0x2a')]({'where':{'id':_0x5a6f97[_0x3316('0x2b')]['id']}})[_0x3316('0x22')](handleEntityNotFound(_0x3ba31c,null))['then'](removeEntity(_0x3ba31c,null))[_0x3316('0x29')](handleError(_0x3ba31c,null));}; \ No newline at end of file +var _0xe148=['destroy','end','error','stack','name','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0xe148,0x154));var _0x8e14=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0xe148[_0x3337b6];return _0x568270;};'use strict';var emlformat=require(_0x8e14('0x0'));var rimraf=require(_0x8e14('0x1'));var zipdir=require(_0x8e14('0x2'));var jsonpatch=require(_0x8e14('0x3'));var rp=require('request-promise');var moment=require(_0x8e14('0x4'));var BPromise=require(_0x8e14('0x5'));var Mustache=require(_0x8e14('0x6'));var util=require(_0x8e14('0x7'));var path=require(_0x8e14('0x8'));var sox=require(_0x8e14('0x9'));var csv=require(_0x8e14('0xa'));var ejs=require(_0x8e14('0xb'));var fs=require('fs');var fs_extra=require(_0x8e14('0xc'));var _=require(_0x8e14('0xd'));var squel=require(_0x8e14('0xe'));var crypto=require('crypto');var jsforce=require(_0x8e14('0xf'));var deskjs=require(_0x8e14('0x10'));var toCsv=require(_0x8e14('0xa'));var querystring=require(_0x8e14('0x11'));var Papa=require('papaparse');var Redis=require(_0x8e14('0x12'));var authService=require(_0x8e14('0x13'));var qs=require(_0x8e14('0x14'));var as=require(_0x8e14('0x15'));var hardwareService=require(_0x8e14('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8e14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e14('0x18'))['db'];function respondWithStatusCode(_0x9822ed,_0x54dd69){_0x54dd69=_0x54dd69||0xcc;return function(_0x12531f){if(_0x12531f){return _0x9822ed[_0x8e14('0x19')](_0x54dd69);}return _0x9822ed[_0x8e14('0x1a')](_0x54dd69)['end']();};}function respondWithResult(_0x3eb9f0,_0x33a487){_0x33a487=_0x33a487||0xc8;return function(_0x3fd829){if(_0x3fd829){return _0x3eb9f0[_0x8e14('0x1a')](_0x33a487)[_0x8e14('0x1b')](_0x3fd829);}};}function respondWithFilteredResult(_0x1424f3,_0x1ab0b8){return function(_0x38704a){if(_0x38704a){var _0x47e33b=typeof _0x1ab0b8[_0x8e14('0x1c')]==='undefined'&&typeof _0x1ab0b8['limit']===_0x8e14('0x1d');var _0x54fdeb=_0x38704a[_0x8e14('0x1e')];var _0x56f940=_0x47e33b?0x0:_0x1ab0b8[_0x8e14('0x1c')];var _0x395992=_0x47e33b?_0x38704a[_0x8e14('0x1e')]:_0x1ab0b8['offset']+_0x1ab0b8['limit'];var _0x4b7391;if(_0x395992>=_0x54fdeb){_0x395992=_0x54fdeb;_0x4b7391=0xc8;}else{_0x4b7391=0xce;}_0x1424f3['status'](_0x4b7391);return _0x1424f3[_0x8e14('0x1f')](_0x8e14('0x20'),_0x56f940+'-'+_0x395992+'/'+_0x54fdeb)[_0x8e14('0x1b')](_0x38704a);}return null;};}function patchUpdates(_0x396e60){return function(_0x51f713){try{jsonpatch[_0x8e14('0x21')](_0x51f713,_0x396e60,!![]);}catch(_0x570897){return BPromise['reject'](_0x570897);}return _0x51f713[_0x8e14('0x22')]();};}function saveUpdates(_0x3da4fe,_0x188861){return function(_0x56c1f9){if(_0x56c1f9){return _0x56c1f9[_0x8e14('0x23')](_0x3da4fe)['then'](function(_0x3c1b99){return _0x3c1b99;});}return null;};}function removeEntity(_0x5caaf7,_0x1d7c30){return function(_0x408e34){if(_0x408e34){return _0x408e34[_0x8e14('0x24')]()['then'](function(){_0x5caaf7[_0x8e14('0x1a')](0xcc)[_0x8e14('0x25')]();});}};}function handleEntityNotFound(_0x38af3c,_0x4e1e5d){return function(_0x52a5d2){if(!_0x52a5d2){_0x38af3c[_0x8e14('0x19')](0x194);}return _0x52a5d2;};}function handleError(_0x1cb9a7,_0x308ceb){_0x308ceb=_0x308ceb||0x1f4;return function(_0x32217e){logger[_0x8e14('0x26')](_0x32217e[_0x8e14('0x27')]);if(_0x32217e[_0x8e14('0x28')]){delete _0x32217e[_0x8e14('0x28')];}_0x1cb9a7[_0x8e14('0x1a')](_0x308ceb)['send'](_0x32217e);};}exports['update']=function(_0x1051ef,_0x419f5d){if(_0x1051ef[_0x8e14('0x29')]['id']){delete _0x1051ef['body']['id'];}return db[_0x8e14('0x2a')][_0x8e14('0x2b')]({'where':{'id':_0x1051ef[_0x8e14('0x2c')]['id']}})[_0x8e14('0x2d')](handleEntityNotFound(_0x419f5d,null))[_0x8e14('0x2d')](saveUpdates(_0x1051ef[_0x8e14('0x29')],null))[_0x8e14('0x2d')](respondWithResult(_0x419f5d,null))['catch'](handleError(_0x419f5d,null));};exports[_0x8e14('0x24')]=function(_0xe4d69e,_0x482820){return db[_0x8e14('0x2a')][_0x8e14('0x2b')]({'where':{'id':_0xe4d69e[_0x8e14('0x2c')]['id']}})[_0x8e14('0x2d')](handleEntityNotFound(_0x482820,null))[_0x8e14('0x2d')](removeEntity(_0x482820,null))[_0x8e14('0x2e')](handleError(_0x482820,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 4c02a55..8119d33 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 _0xd35a=['define','Action','lodash','api','moment','bluebird','request-promise','path','exports'];(function(_0x15ccae,_0xecc32a){var _0x186890=function(_0x45b89a){while(--_0x45b89a){_0x15ccae['push'](_0x15ccae['shift']());}};_0x186890(++_0xecc32a);}(_0xd35a,0xa4));var _0xad35=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xd35a[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require(_0xad35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xad35('0x1'));var moment=require(_0xad35('0x2'));var BPromise=require(_0xad35('0x3'));var rp=require(_0xad35('0x4'));var fs=require('fs');var path=require(_0xad35('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xad35('0x6')]=function(_0x3dabf4,_0x27e4af){return _0x3dabf4[_0xad35('0x7')](_0xad35('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd95d=['util','../../config/logger','api','rimraf','../../config/environment','./action.attributes','exports','tools_actions','lodash'];(function(_0xd298bc,_0x21e904){var _0x507d3e=function(_0x4b73ca){while(--_0x4b73ca){_0xd298bc['push'](_0xd298bc['shift']());}};_0x507d3e(++_0x21e904);}(_0xd95d,0xf2));var _0xdd95=function(_0x19715b,_0x499c92){_0x19715b=_0x19715b-0x0;var _0x199419=_0xd95d[_0x19715b];return _0x199419;};'use strict';var _=require(_0xdd95('0x0'));var util=require(_0xdd95('0x1'));var logger=require(_0xdd95('0x2'))(_0xdd95('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd95('0x4'));var config=require(_0xdd95('0x5'));var attributes=require(_0xdd95('0x6'));module[_0xdd95('0x7')]=function(_0x4bb3b9,_0x2b0b3e){return _0x4bb3b9['define']('Action',attributes,{'tableName':_0xdd95('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index f868ffe..32ec395 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x41eecb,_0x40ef45){var _0x295c0a=function(_0x317815){while(--_0x317815){_0x41eecb['push'](_0x41eecb['shift']());}};_0x295c0a(++_0x40ef45);}(_0x326f,0xd1));var _0xf326=function(_0x1574c6,_0x5ba5b8){_0x1574c6=_0x1574c6-0x0;var _0x151bbf=_0x326f[_0x1574c6];return _0x151bbf;};'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')]('Action,\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')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1bf30a,_0x2a1ef6){var _0x1f4ca2=function(_0x5f54be){while(--_0x5f54be){_0x1bf30a['push'](_0x1bf30a['shift']());}};_0x1f4ca2(++_0x2a1ef6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 27f1a99..f2f3562 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 _0x336e=['../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b595f,_0x552dcc){var _0x42eb1f=function(_0x1a2791){while(--_0x1a2791){_0x1b595f['push'](_0x1b595f['shift']());}};_0x42eb1f(++_0x552dcc);}(_0x336e,0x6a));var _0xe336=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x336e[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require(_0xe336('0x0'));var path=require(_0xe336('0x1'));var timeout=require(_0xe336('0x2'));var express=require(_0xe336('0x3'));var router=express[_0xe336('0x4')]();var fs_extra=require(_0xe336('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe336('0x6'));var config=require(_0xe336('0x7'));var controller=require(_0xe336('0x8'));router[_0xe336('0x9')]('/:id',auth[_0xe336('0xa')](),controller[_0xe336('0xb')]);router[_0xe336('0xc')](_0xe336('0xd'),auth[_0xe336('0xa')](),controller[_0xe336('0xe')]);module[_0xe336('0xf')]=router; \ No newline at end of file +var _0x0fdd=['/:id','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x117f9c,_0x1018b0){var _0x2b1eb0=function(_0x41d639){while(--_0x41d639){_0x117f9c['push'](_0x117f9c['shift']());}};_0x2b1eb0(++_0x1018b0);}(_0x0fdd,0x1e6));var _0xd0fd=function(_0x44d097,_0x45fc55){_0x44d097=_0x44d097-0x0;var _0x985024=_0x0fdd[_0x44d097];return _0x985024;};'use strict';var multer=require(_0xd0fd('0x0'));var util=require(_0xd0fd('0x1'));var path=require('path');var timeout=require(_0xd0fd('0x2'));var express=require(_0xd0fd('0x3'));var router=express['Router']();var fs_extra=require(_0xd0fd('0x4'));var auth=require(_0xd0fd('0x5'));var interaction=require(_0xd0fd('0x6'));var config=require('../../config/environment');var controller=require(_0xd0fd('0x7'));router['put'](_0xd0fd('0x8'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0xa')]);router['delete']('/:id',auth[_0xd0fd('0x9')](),controller[_0xd0fd('0xb')]);module[_0xd0fd('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d9ec942..e92f1ee 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 _0x71ab=['TEXT','exports','STRING'];(function(_0x176241,_0x1b99e1){var _0x3c13c9=function(_0x26d79c){while(--_0x26d79c){_0x176241['push'](_0x176241['shift']());}};_0x3c13c9(++_0x1b99e1);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xfdbd[_0x50e40b];return _0x2608b7;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e0adb83..5f761d4 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 _0x9cb3=['run','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','Sequelize','AnalyticMetric','output','fullPath','randomstring','generate','custom','AnalyticExtractedReport','create','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','countTable','SELECT'];(function(_0x4bdb73,_0x2e6916){var _0x56a18a=function(_0x5984b7){while(--_0x5984b7){_0x4bdb73['push'](_0x4bdb73['shift']());}};_0x56a18a(++_0x2e6916);}(_0x9cb3,0x1e6));var _0x39cb=function(_0x3e63c6,_0x2c3160){_0x3e63c6=_0x3e63c6-0x0;var _0x5216af=_0x9cb3[_0x3e63c6];return _0x5216af;};'use strict';var emlformat=require(_0x39cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39cb('0x1'));var jsonpatch=require(_0x39cb('0x2'));var rp=require(_0x39cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x39cb('0x4'));var util=require(_0x39cb('0x5'));var path=require(_0x39cb('0x6'));var sox=require(_0x39cb('0x7'));var csv=require(_0x39cb('0x8'));var ejs=require(_0x39cb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39cb('0xa'));var squel=require('squel');var crypto=require(_0x39cb('0xb'));var jsforce=require(_0x39cb('0xc'));var deskjs=require(_0x39cb('0xd'));var toCsv=require(_0x39cb('0x8'));var querystring=require(_0x39cb('0xe'));var Papa=require(_0x39cb('0xf'));var Redis=require('ioredis');var authService=require(_0x39cb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x39cb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x39cb('0x12'));var config=require(_0x39cb('0x13'));var licenseUtil=require(_0x39cb('0x14'));var db=require(_0x39cb('0x15'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x11c5f0,_0x4d6294){_0x4d6294=_0x4d6294||0xcc;return function(_0x10f2ae){if(_0x10f2ae){return _0x11c5f0[_0x39cb('0x16')](_0x4d6294);}return _0x11c5f0[_0x39cb('0x17')](_0x4d6294)[_0x39cb('0x18')]();};}function respondWithResult(_0x48aff9,_0x26eac8){_0x26eac8=_0x26eac8||0xc8;return function(_0x145090){if(_0x145090){return _0x48aff9[_0x39cb('0x17')](_0x26eac8)[_0x39cb('0x19')](_0x145090);}};}function respondWithFilteredResult(_0x59fbf9,_0x51a6a2){return function(_0x2e5d6a){if(_0x2e5d6a){var _0x507bf7=typeof _0x51a6a2[_0x39cb('0x1a')]===_0x39cb('0x1b')&&typeof _0x51a6a2[_0x39cb('0x1c')]==='undefined';var _0x1a0deb=_0x2e5d6a[_0x39cb('0x1d')];var _0x56eff8=_0x507bf7?0x0:_0x51a6a2[_0x39cb('0x1a')];var _0x11fbcb=_0x507bf7?_0x2e5d6a[_0x39cb('0x1d')]:_0x51a6a2[_0x39cb('0x1a')]+_0x51a6a2[_0x39cb('0x1c')];var _0x15b1d3;if(_0x11fbcb>=_0x1a0deb){_0x11fbcb=_0x1a0deb;_0x15b1d3=0xc8;}else{_0x15b1d3=0xce;}_0x59fbf9[_0x39cb('0x17')](_0x15b1d3);return _0x59fbf9['set'](_0x39cb('0x1e'),_0x56eff8+'-'+_0x11fbcb+'/'+_0x1a0deb)['json'](_0x2e5d6a);}return null;};}function patchUpdates(_0x368157){return function(_0x1f4c33){try{jsonpatch[_0x39cb('0x1f')](_0x1f4c33,_0x368157,!![]);}catch(_0x4b512f){return BPromise[_0x39cb('0x20')](_0x4b512f);}return _0x1f4c33[_0x39cb('0x21')]();};}function saveUpdates(_0x48d1e2,_0x37f6e5){return function(_0x27a5c3){if(_0x27a5c3){return _0x27a5c3[_0x39cb('0x22')](_0x48d1e2)[_0x39cb('0x23')](function(_0x5c6e01){return _0x5c6e01;});}return null;};}function removeEntity(_0x868a3a,_0x4e7bb2){return function(_0x2ba6e4){if(_0x2ba6e4){return _0x2ba6e4['destroy']()[_0x39cb('0x23')](function(){var _0x145a49=_0x2ba6e4[_0x39cb('0x24')]({'plain':!![]});var _0x413209=_0x39cb('0x25');return db[_0x39cb('0x26')][_0x39cb('0x27')]({'where':{'type':_0x413209,'resourceId':_0x145a49['id']}})['then'](function(){return _0x2ba6e4;});})[_0x39cb('0x23')](function(){_0x868a3a[_0x39cb('0x17')](0xcc)[_0x39cb('0x18')]();});}};}function handleEntityNotFound(_0x103fa1,_0x2a234f){return function(_0x28e751){if(!_0x28e751){_0x103fa1[_0x39cb('0x16')](0x194);}return _0x28e751;};}function handleError(_0x50c86a,_0x7fa8ec){_0x7fa8ec=_0x7fa8ec||0x1f4;return function(_0x396bcc){logger[_0x39cb('0x28')](_0x396bcc[_0x39cb('0x29')]);if(_0x396bcc[_0x39cb('0x2a')]){delete _0x396bcc[_0x39cb('0x2a')];}_0x50c86a[_0x39cb('0x17')](_0x7fa8ec)[_0x39cb('0x2b')](_0x396bcc);};}exports[_0x39cb('0x2c')]=function(_0x4020a7,_0x3fe8bc){var _0x2de0da={},_0x9f3523={},_0x500309={'count':0x0,'rows':[]};var _0x408ee1=_[_0x39cb('0x2d')](db[_0x39cb('0x2e')][_0x39cb('0x2f')],function(_0x520ab8){return{'name':_0x520ab8[_0x39cb('0x30')],'type':_0x520ab8['type'][_0x39cb('0x31')]};});_0x9f3523[_0x39cb('0x32')]=_[_0x39cb('0x2d')](_0x408ee1,_0x39cb('0x2a'));_0x9f3523[_0x39cb('0x33')]=_[_0x39cb('0x34')](_0x4020a7['query']);_0x9f3523[_0x39cb('0x35')]=_['intersection'](_0x9f3523[_0x39cb('0x32')],_0x9f3523[_0x39cb('0x33')]);_0x2de0da[_0x39cb('0x36')]=_[_0x39cb('0x37')](_0x9f3523[_0x39cb('0x32')],qs[_0x39cb('0x38')](_0x4020a7[_0x39cb('0x33')][_0x39cb('0x38')]));_0x2de0da['attributes']=_0x2de0da[_0x39cb('0x36')][_0x39cb('0x39')]?_0x2de0da[_0x39cb('0x36')]:_0x9f3523[_0x39cb('0x32')];if(!_0x4020a7[_0x39cb('0x33')][_0x39cb('0x3a')](_0x39cb('0x3b'))){_0x2de0da[_0x39cb('0x1c')]=qs[_0x39cb('0x1c')](_0x4020a7[_0x39cb('0x33')]['limit']);_0x2de0da[_0x39cb('0x1a')]=qs[_0x39cb('0x1a')](_0x4020a7['query'][_0x39cb('0x1a')]);}_0x2de0da[_0x39cb('0x3c')]=qs[_0x39cb('0x3d')](_0x4020a7[_0x39cb('0x33')][_0x39cb('0x3d')]);_0x2de0da['where']=qs[_0x39cb('0x35')](_['pick'](_0x4020a7[_0x39cb('0x33')],_0x9f3523[_0x39cb('0x35')]),_0x408ee1);if(_0x4020a7[_0x39cb('0x33')][_0x39cb('0x3e')]){_0x2de0da[_0x39cb('0x3f')]=_[_0x39cb('0x40')](_0x2de0da['where'],{'$or':_['map'](_0x408ee1,function(_0x4353dd){if(_0x4353dd[_0x39cb('0x41')]!==_0x39cb('0x42')){var _0x2fa9c9={};_0x2fa9c9[_0x4353dd[_0x39cb('0x2a')]]={'$like':'%'+_0x4020a7[_0x39cb('0x33')]['filter']+'%'};return _0x2fa9c9;}})});}_0x2de0da=_[_0x39cb('0x40')]({},_0x2de0da,_0x4020a7[_0x39cb('0x43')]);var _0x5031da={'where':_0x2de0da['where']};return db[_0x39cb('0x2e')]['count'](_0x5031da)[_0x39cb('0x23')](function(_0x577a64){_0x500309[_0x39cb('0x1d')]=_0x577a64;if(_0x4020a7[_0x39cb('0x33')]['includeAll']){_0x2de0da['include']=[{'all':!![]}];}return db[_0x39cb('0x2e')][_0x39cb('0x44')](_0x2de0da);})[_0x39cb('0x23')](function(_0x36041d){_0x500309[_0x39cb('0x45')]=_0x36041d;return _0x500309;})[_0x39cb('0x23')](respondWithFilteredResult(_0x3fe8bc,_0x2de0da))[_0x39cb('0x46')](handleError(_0x3fe8bc,null));};exports[_0x39cb('0x47')]=function(_0x6f5ab6,_0x2e255b){var _0x50d3d9={'raw':![],'where':{'id':_0x6f5ab6[_0x39cb('0x48')]['id']}},_0x587300={};_0x587300[_0x39cb('0x32')]=_[_0x39cb('0x34')](db[_0x39cb('0x2e')]['rawAttributes']);_0x587300['query']=_[_0x39cb('0x34')](_0x6f5ab6['query']);_0x587300[_0x39cb('0x35')]=_['intersection'](_0x587300[_0x39cb('0x32')],_0x587300[_0x39cb('0x33')]);_0x50d3d9[_0x39cb('0x36')]=_[_0x39cb('0x37')](_0x587300[_0x39cb('0x32')],qs[_0x39cb('0x38')](_0x6f5ab6[_0x39cb('0x33')][_0x39cb('0x38')]));_0x50d3d9[_0x39cb('0x36')]=_0x50d3d9[_0x39cb('0x36')][_0x39cb('0x39')]?_0x50d3d9[_0x39cb('0x36')]:_0x587300[_0x39cb('0x32')];if(_0x6f5ab6[_0x39cb('0x33')]['includeAll']){_0x50d3d9[_0x39cb('0x49')]=[{'all':!![]}];}_0x50d3d9=_[_0x39cb('0x40')]({},_0x50d3d9,_0x6f5ab6[_0x39cb('0x43')]);return db[_0x39cb('0x2e')]['find'](_0x50d3d9)[_0x39cb('0x23')](handleEntityNotFound(_0x2e255b,null))[_0x39cb('0x23')](respondWithResult(_0x2e255b,null))[_0x39cb('0x46')](handleError(_0x2e255b,null));};exports['create']=function(_0x5ee620,_0x61cad3){return db[_0x39cb('0x2e')]['create'](_0x5ee620[_0x39cb('0x4a')],{})['then'](function(_0x551951){var _0x4a5fd3=_0x5ee620[_0x39cb('0x4b')][_0x39cb('0x24')]({'plain':!![]});if(!_0x4a5fd3)throw new Error(_0x39cb('0x4c'));if(_0x4a5fd3['role']===_0x39cb('0x4b')){var _0x52b3ad=_0x551951[_0x39cb('0x24')]({'plain':!![]});var _0x46dc53=_0x39cb('0x4d');return db[_0x39cb('0x4e')][_0x39cb('0x4f')]({'where':{'name':_0x46dc53,'userProfileId':_0x4a5fd3[_0x39cb('0x50')]},'raw':!![]})[_0x39cb('0x23')](function(_0xeac64f){if(_0xeac64f&&_0xeac64f[_0x39cb('0x51')]===0x0){return db[_0x39cb('0x26')]['create']({'name':_0x52b3ad[_0x39cb('0x2a')],'resourceId':_0x52b3ad['id'],'type':'CustomReports','sectionId':_0xeac64f['id']},{})[_0x39cb('0x23')](function(){return _0x551951;});}else{return _0x551951;}})['catch'](function(_0x20ee7d){logger[_0x39cb('0x28')](_0x39cb('0x52'),_0x20ee7d);throw _0x20ee7d;});}return _0x551951;})[_0x39cb('0x23')](respondWithResult(_0x61cad3,0xc9))[_0x39cb('0x46')](handleError(_0x61cad3,null));};exports[_0x39cb('0x22')]=function(_0x23136b,_0x7c2e0d){if(_0x23136b[_0x39cb('0x4a')]['id']){delete _0x23136b['body']['id'];}return db[_0x39cb('0x2e')]['find']({'where':{'id':_0x23136b['params']['id']}})['then'](handleEntityNotFound(_0x7c2e0d,null))[_0x39cb('0x23')](saveUpdates(_0x23136b[_0x39cb('0x4a')],null))[_0x39cb('0x23')](respondWithResult(_0x7c2e0d,null))[_0x39cb('0x46')](handleError(_0x7c2e0d,null));};exports[_0x39cb('0x27')]=function(_0x1a4f5f,_0x5706ca){return db[_0x39cb('0x2e')]['find']({'where':{'id':_0x1a4f5f[_0x39cb('0x48')]['id']}})[_0x39cb('0x23')](handleEntityNotFound(_0x5706ca,null))[_0x39cb('0x23')](removeEntity(_0x5706ca,null))[_0x39cb('0x46')](handleError(_0x5706ca,null));};exports['preview']=function(_0x52c3e2,_0x342040){var _0x445b75=0xa;var _0x457867=[_0x39cb('0x53'),_0x39cb('0x54'),_0x39cb('0x55'),_0x39cb('0x56')];var _0x2bc14b={'SUM':'SUM(%s)','COUNT':_0x39cb('0x57'),'COUNT DISTINCT':_0x39cb('0x58'),'MAX':_0x39cb('0x59'),'MIN':_0x39cb('0x5a'),'AVG':_0x39cb('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x39cb('0x5c'),'GROUP_CONCAT DESC':_0x39cb('0x5d')};var _0xc26764={'SEC_TO_TIME':_0x39cb('0x5e'),'DATE':_0x39cb('0x5f'),'HOUR':_0x39cb('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4ba485=function(_0x12a13c){return!_[_0x39cb('0x61')]([_0x39cb('0x62'),_0x39cb('0x63'),_0x39cb('0x64'),_0x39cb('0x65')],_0x12a13c);};var _0x26bb84=function(_0xdfb141){if(!_0xdfb141||!_0xdfb141[_0x39cb('0x66')][_0x39cb('0x39')]){return'';}for(var _0x41454b='(',_0x155dfd=0x0;_0x155dfd<_0xdfb141[_0x39cb('0x66')][_0x39cb('0x39')];_0x155dfd+=0x1){_0x155dfd>0x0&&(_0x41454b+='\x20'+_0xdfb141[_0x39cb('0x67')]+'\x20');_0x41454b+=_0xdfb141[_0x39cb('0x66')][_0x155dfd]['group']?_0x26bb84(_0xdfb141[_0x39cb('0x66')][_0x155dfd][_0x39cb('0x68')]):_0xdfb141[_0x39cb('0x66')][_0x155dfd][_0x39cb('0x69')]+'\x20'+_0xdfb141[_0x39cb('0x66')][_0x155dfd][_0x39cb('0x6a')]+(_0x4ba485(_0xdfb141[_0x39cb('0x66')][_0x155dfd][_0x39cb('0x6a')])?'\x20'+_0xdfb141[_0x39cb('0x66')][_0x155dfd][_0x39cb('0x6b')]:'');}return _0x41454b+')';};var _0x1061de={'where':{'id':_0x52c3e2['params']['id']}},_0x336968,_0x2085c4,_0x307c37,_0x413a6a,_0x4a7832;_0x1061de=_['merge']({},_0x1061de,_0x52c3e2[_0x39cb('0x43')]);return db[_0x39cb('0x2e')][_0x39cb('0x4f')](_0x1061de)[_0x39cb('0x23')](function(_0x24f5fb){if(_0x24f5fb){_0x336968=_0x24f5fb;return _0x24f5fb[_0x39cb('0x6c')]();}return null;})[_0x39cb('0x23')](function(_0x5b1dbb){if(_0x5b1dbb){if(!_0x5b1dbb[_0x39cb('0x39')]){throw new db['Sequelize'][(_0x39cb('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2085c4=_0x5b1dbb;return db['AnalyticMetric'][_0x39cb('0x44')]({'raw':!![]});}return null;})['then'](function(_0x5d8109){if(_0x5d8109){_0x307c37=_[_0x39cb('0x6e')](_0x5d8109,'id');var _0x23b31f;var _0x4731ad=squel[_0x39cb('0x6f')]();_0x4731ad[_0x39cb('0x70')](_0x336968[_0x39cb('0x71')]);for(var _0x1fbd00=0x0;_0x1fbd00<_0x2085c4[_0x39cb('0x39')];_0x1fbd00+=0x1){_0x23b31f=_0x2085c4[_0x1fbd00]['MetricId']?_0x307c37[_0x2085c4[_0x1fbd00][_0x39cb('0x72')]][_0x39cb('0x73')]:_0x2085c4[_0x1fbd00][_0x39cb('0x69')];_0x23b31f=_0x2085c4[_0x1fbd00][_0x39cb('0x74')]?_[_0x39cb('0x75')](_0x2bc14b[_0x2085c4[_0x1fbd00]['function']],'%s',_0x23b31f):_0x23b31f;_0x23b31f=_0x2085c4[_0x1fbd00][_0x39cb('0x76')]?_[_0x39cb('0x75')](_0xc26764[_0x2085c4[_0x1fbd00]['format']],'%s',_0x23b31f):_0x23b31f;if(_0x2085c4[_0x1fbd00][_0x39cb('0x77')]){_0x4731ad[_0x39cb('0x68')](_0x23b31f);}_0x2085c4[_0x1fbd00][_0x39cb('0x78')]&&_0x4731ad[_0x39cb('0x3c')](_0x23b31f,_0x2085c4[_0x1fbd00][_0x39cb('0x78')]===_0x39cb('0x79')?![]:!![]);_0x4731ad[_0x39cb('0x69')](_0x23b31f,_0x2085c4[_0x1fbd00][_0x39cb('0x7a')]||_0x23b31f);}if(_0x336968[_0x39cb('0x7b')]){_0x336968[_0x39cb('0x7b')]=JSON[_0x39cb('0x7c')](_0x336968['joins']);for(var _0x3f2c66=0x0;_0x3f2c66<_0x336968[_0x39cb('0x7b')]['length'];_0x3f2c66+=0x1){if(_0x336968[_0x39cb('0x7b')][_0x3f2c66][_0x39cb('0x41')]&&_[_0x39cb('0x61')](_0x457867,_0x336968[_0x39cb('0x7b')][_0x3f2c66][_0x39cb('0x41')])&&_0x336968[_0x39cb('0x7b')][_0x3f2c66][_0x39cb('0x7d')]&&_0x336968['joins'][_0x3f2c66][_0x39cb('0x7e')]&&_0x336968[_0x39cb('0x7b')][_0x3f2c66][_0x39cb('0x7f')]){_0x4731ad[_0x336968[_0x39cb('0x7b')][_0x3f2c66]['type']](_0x336968['joins'][_0x3f2c66][_0x39cb('0x7e')],null,util[_0x39cb('0x76')](_0x39cb('0x80'),_0x336968[_0x39cb('0x71')],_0x336968[_0x39cb('0x7b')][_0x3f2c66][_0x39cb('0x7d')],_0x336968[_0x39cb('0x7b')][_0x3f2c66][_0x39cb('0x7e')],_0x336968[_0x39cb('0x7b')][_0x3f2c66]['foreignKey']));}}}if(_0x336968[_0x39cb('0x81')]){_0x336968[_0x39cb('0x81')]=JSON['parse'](_0x336968[_0x39cb('0x81')]);_0x4731ad[_0x39cb('0x3f')](_0x26bb84(_0x336968['conditions'][_0x39cb('0x68')]));}_0x4a7832=_0x4731ad[_0x39cb('0x82')]();_0x4731ad[_0x39cb('0x1c')](_0x445b75);_0x4731ad['offset'](0x0);logger[_0x39cb('0x83')](_0x39cb('0x84'),_0x4731ad[_0x39cb('0x85')]());return dbH[_0x39cb('0x86')][_0x39cb('0x33')](_0x4731ad[_0x39cb('0x85')](),{'type':dbH[_0x39cb('0x86')][_0x39cb('0x87')]['SELECT']});}})[_0x39cb('0x23')](respondWithResult(_0x342040,null))['catch'](handleError(_0x342040,null));};function runReport(_0x479263,_0x86e22b,_0x5e97a0){var _0x1ca64b=_0x86e22b[_0x39cb('0x2a')];var _0x50c369=0xa;var _0x34080f=[_0x39cb('0x53'),_0x39cb('0x54'),'right_join','cross_join'];var _0x3e7d0a={'SUM':'SUM(%s)','COUNT':_0x39cb('0x57'),'COUNT DISTINCT':_0x39cb('0x58'),'MAX':_0x39cb('0x59'),'MIN':_0x39cb('0x5a'),'AVG':_0x39cb('0x5b'),'GROUP_CONCAT':_0x39cb('0x88'),'GROUP_CONCAT ASC':_0x39cb('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5427ed={'SEC_TO_TIME':_0x39cb('0x5e'),'DATE':_0x39cb('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x39cb('0x89')};var _0x29a6a9=function(_0x34562e){return!_[_0x39cb('0x61')]([_0x39cb('0x62'),_0x39cb('0x63'),_0x39cb('0x64'),_0x39cb('0x65')],_0x34562e);};var _0xd20ef=function(_0x4824f2){if(!_0x4824f2||!_0x4824f2[_0x39cb('0x66')][_0x39cb('0x39')]){return'';}for(var _0x561ca0='(',_0x436985=0x0;_0x436985<_0x4824f2['rules'][_0x39cb('0x39')];_0x436985+=0x1){_0x436985>0x0&&(_0x561ca0+='\x20'+_0x4824f2[_0x39cb('0x67')]+'\x20');_0x561ca0+=_0x4824f2[_0x39cb('0x66')][_0x436985][_0x39cb('0x68')]?_0xd20ef(_0x4824f2[_0x39cb('0x66')][_0x436985][_0x39cb('0x68')]):_0x4824f2[_0x39cb('0x66')][_0x436985][_0x39cb('0x69')]+'\x20'+_0x4824f2['rules'][_0x436985][_0x39cb('0x6a')]+(_0x29a6a9(_0x4824f2[_0x39cb('0x66')][_0x436985][_0x39cb('0x6a')])?'\x20'+_0x4824f2[_0x39cb('0x66')][_0x436985][_0x39cb('0x6b')]:'');}return _0x561ca0+')';};var _0x2c032a={'where':{'id':_0x479263['id']}},_0x30b412,_0x5acd3a,_0xfd303,_0x11b2ef,_0x2567e6;_0x2c032a=_[_0x39cb('0x40')]({},_0x2c032a,_0x5e97a0);return db[_0x39cb('0x2e')][_0x39cb('0x4f')](_0x2c032a)[_0x39cb('0x23')](function(_0x1c3410){if(_0x1c3410){_0x30b412=_0x1c3410;return _0x1c3410['getFields']();}return null;})['then'](function(_0x540ad6){if(_0x540ad6){if(!_0x540ad6['length']){throw new db[(_0x39cb('0x8a'))][(_0x39cb('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5acd3a=_0x540ad6;return db[_0x39cb('0x8b')][_0x39cb('0x44')]({'raw':!![]});}return null;})[_0x39cb('0x23')](function(_0x4b00f4){if(_0x4b00f4){_0xfd303=_[_0x39cb('0x6e')](_0x4b00f4,'id');var _0x5d17af;var _0x38dd95=squel[_0x39cb('0x6f')]();_0x38dd95['from'](_0x30b412[_0x39cb('0x71')]);for(var _0x126f2f=0x0;_0x126f2f<_0x5acd3a[_0x39cb('0x39')];_0x126f2f+=0x1){_0x5d17af=_0x5acd3a[_0x126f2f][_0x39cb('0x72')]?_0xfd303[_0x5acd3a[_0x126f2f][_0x39cb('0x72')]]['metric']:_0x5acd3a[_0x126f2f][_0x39cb('0x69')];_0x5d17af=_0x5acd3a[_0x126f2f]['function']?_[_0x39cb('0x75')](_0x3e7d0a[_0x5acd3a[_0x126f2f][_0x39cb('0x74')]],'%s',_0x5d17af):_0x5d17af;_0x5d17af=_0x5acd3a[_0x126f2f][_0x39cb('0x76')]?_[_0x39cb('0x75')](_0x5427ed[_0x5acd3a[_0x126f2f][_0x39cb('0x76')]],'%s',_0x5d17af):_0x5d17af;if(_0x5acd3a[_0x126f2f][_0x39cb('0x77')]){_0x38dd95['group'](_0x5d17af);}_0x5acd3a[_0x126f2f][_0x39cb('0x78')]&&_0x38dd95[_0x39cb('0x3c')](_0x5d17af,_0x5acd3a[_0x126f2f][_0x39cb('0x78')]===_0x39cb('0x79')?![]:!![]);_0x38dd95[_0x39cb('0x69')](_0x5d17af,_0x5acd3a[_0x126f2f][_0x39cb('0x7a')]||_0x5d17af);}if(_0x30b412[_0x39cb('0x7b')]){_0x30b412[_0x39cb('0x7b')]=JSON[_0x39cb('0x7c')](_0x30b412['joins']);for(var _0x50ef59=0x0;_0x50ef59<_0x30b412[_0x39cb('0x7b')]['length'];_0x50ef59+=0x1){if(_0x30b412['joins'][_0x50ef59][_0x39cb('0x41')]&&_[_0x39cb('0x61')](_0x34080f,_0x30b412[_0x39cb('0x7b')][_0x50ef59]['type'])&&_0x30b412['joins'][_0x50ef59][_0x39cb('0x7d')]&&_0x30b412[_0x39cb('0x7b')][_0x50ef59][_0x39cb('0x7e')]&&_0x30b412[_0x39cb('0x7b')][_0x50ef59]['foreignKey']){_0x38dd95[_0x30b412[_0x39cb('0x7b')][_0x50ef59][_0x39cb('0x41')]](_0x30b412[_0x39cb('0x7b')][_0x50ef59][_0x39cb('0x7e')],null,util[_0x39cb('0x76')]('%s.%s\x20=\x20%s.%s',_0x30b412[_0x39cb('0x71')],_0x30b412[_0x39cb('0x7b')][_0x50ef59]['parentKey'],_0x30b412[_0x39cb('0x7b')][_0x50ef59][_0x39cb('0x7e')],_0x30b412['joins'][_0x50ef59][_0x39cb('0x7f')]));}}}if(_0x30b412['conditions']){_0x30b412['conditions']=JSON[_0x39cb('0x7c')](_0x30b412[_0x39cb('0x81')]);_0x38dd95[_0x39cb('0x3f')](_0xd20ef(_0x30b412[_0x39cb('0x81')][_0x39cb('0x68')]));}_0x2567e6=_0x38dd95[_0x39cb('0x82')]();_0x38dd95[_0x39cb('0x1c')](_0x50c369);_0x38dd95[_0x39cb('0x1a')](0x0);return;}})[_0x39cb('0x23')](function(){if(_0x86e22b[_0x39cb('0x8c')]==='web'){return null;}var _0x7fc060=_[_0x39cb('0x40')](_0x86e22b,{'name':_0x86e22b[_0x39cb('0x8d')]||_0x86e22b['name']||_0x30b412[_0x39cb('0x2a')],'basename':_0x1ca64b,'savename':util['format']('%s-%s.%s',_0x86e22b[_0x39cb('0x2a')]||_0x30b412[_0x39cb('0x2a')],require(_0x39cb('0x8e'))[_0x39cb('0x8f')](0x4),_0x86e22b[_0x39cb('0x8c')]||'csv'),'reportId':_0x30b412['id'],'reportType':_0x39cb('0x90')});return db[_0x39cb('0x91')][_0x39cb('0x92')](_0x7fc060,{'raw':!![]});})[_0x39cb('0x23')](function(_0x16b0a5){if(_0x30b412[_0x39cb('0x71')]===_0x39cb('0x93')){_0x2567e6[_0x39cb('0x3f')](_0x30b412[_0x39cb('0x71')]+_0x39cb('0x94'),_0x86e22b[_0x39cb('0x95')],_0x86e22b[_0x39cb('0x96')]);}else{_0x2567e6[_0x39cb('0x3f')](_0x30b412[_0x39cb('0x71')]+_0x39cb('0x97'),_0x86e22b[_0x39cb('0x95')],_0x86e22b[_0x39cb('0x96')]);}if(_0x16b0a5){logger[_0x39cb('0x98')]('Run\x20Query:',_0x2567e6['toString']());require('child_process')[_0x39cb('0x99')](path[_0x39cb('0x53')](__dirname,_0x39cb('0x9a'),_0x16b0a5[_0x39cb('0x8c')]),[_0x16b0a5['id'],_0x2567e6[_0x39cb('0x85')](),path[_0x39cb('0x53')](__dirname,_0x39cb('0x9b'),_0x16b0a5['savename']),_0x1ca64b]);return _0x16b0a5;}else{var _0x30cf82=squel[_0x39cb('0x6f')]();_0x30cf82[_0x39cb('0x70')]('('+_0x2567e6[_0x39cb('0x85')]()+')',_0x39cb('0x9c'));_0x30cf82[_0x39cb('0x69')]('COUNT(*)',_0x39cb('0x1d'));_0x2567e6[_0x39cb('0x1c')](_0x86e22b[_0x39cb('0x1c')]||_0x50c369);_0x2567e6[_0x39cb('0x1a')](_0x86e22b[_0x39cb('0x1a')]||0x0);return dbH[_0x39cb('0x86')][_0x39cb('0x33')](_0x30cf82['toString'](),{'type':dbH[_0x39cb('0x86')][_0x39cb('0x87')][_0x39cb('0x9d')]})[_0x39cb('0x23')](function(_0x10f9ef){if(!_0x10f9ef[_0x39cb('0x39')]){_0x11b2ef=0x0;}else{_0x11b2ef=_0x10f9ef[0x0][_0x39cb('0x1d')]||0x0;}return dbH[_0x39cb('0x86')][_0x39cb('0x33')](_0x2567e6[_0x39cb('0x85')](),{'type':dbH[_0x39cb('0x86')][_0x39cb('0x87')][_0x39cb('0x9d')]});})[_0x39cb('0x23')](function(_0x1c237b){return{'rows':_0x1c237b||[],'count':_0x11b2ef};});}});}exports[_0x39cb('0x9e')]=function(_0x3e859d,_0x3bb893){return runReport(_0x3e859d[_0x39cb('0x48')],_0x3e859d['query'],_0x3e859d['options'])[_0x39cb('0x23')](respondWithResult(_0x3bb893,null))[_0x39cb('0x46')](handleError(_0x3bb893,null));};exports['runReport']=runReport;exports['query']=function(_0x54ad08,_0xe40559){var _0x4a976f=0xa;var _0x326634=['join',_0x39cb('0x54'),'right_join',_0x39cb('0x56')];var _0xf321b8={'SUM':'SUM(%s)','COUNT':_0x39cb('0x57'),'COUNT DISTINCT':_0x39cb('0x58'),'MAX':_0x39cb('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x39cb('0x88'),'GROUP_CONCAT ASC':_0x39cb('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x17efbe={'SEC_TO_TIME':_0x39cb('0x5e'),'DATE':_0x39cb('0x5f'),'HOUR':_0x39cb('0x60'),'ROUND':_0x39cb('0x9f'),'UNIX_TIMESTAMP':_0x39cb('0x89')};var _0x2d0a7f=function(_0x1a9dd3){return!_[_0x39cb('0x61')]([_0x39cb('0x62'),_0x39cb('0x63'),_0x39cb('0x64'),_0x39cb('0x65')],_0x1a9dd3);};var _0x525544=function(_0x5c1094){if(!_0x5c1094||!_0x5c1094[_0x39cb('0x66')][_0x39cb('0x39')]){return'';}for(var _0x550dc6='(',_0x3bd09b=0x0;_0x3bd09b<_0x5c1094['rules'][_0x39cb('0x39')];_0x3bd09b+=0x1){_0x3bd09b>0x0&&(_0x550dc6+='\x20'+_0x5c1094['operator']+'\x20');_0x550dc6+=_0x5c1094['rules'][_0x3bd09b][_0x39cb('0x68')]?_0x525544(_0x5c1094[_0x39cb('0x66')][_0x3bd09b][_0x39cb('0x68')]):_0x5c1094[_0x39cb('0x66')][_0x3bd09b][_0x39cb('0x69')]+'\x20'+_0x5c1094[_0x39cb('0x66')][_0x3bd09b][_0x39cb('0x6a')]+(_0x2d0a7f(_0x5c1094[_0x39cb('0x66')][_0x3bd09b]['condition'])?'\x20'+_0x5c1094[_0x39cb('0x66')][_0x3bd09b]['value']:'');}return _0x550dc6+')';};var _0x5b5725={'where':{'id':_0x54ad08[_0x39cb('0x48')]['id']}},_0x3fa61c,_0x49cfc2,_0x5ae3e3,_0x11f328,_0xcc81ea;_0x5b5725=_[_0x39cb('0x40')]({},_0x5b5725,_0x54ad08[_0x39cb('0x43')]);return db['AnalyticCustomReport'][_0x39cb('0x4f')](_0x5b5725)[_0x39cb('0x23')](function(_0x384c22){if(_0x384c22){_0x3fa61c=_0x384c22;return _0x384c22[_0x39cb('0x6c')]();}return null;})[_0x39cb('0x23')](function(_0x1b4977){if(_0x1b4977){if(!_0x1b4977[_0x39cb('0x39')]){throw new db['Sequelize'][(_0x39cb('0x6d'))](_0x39cb('0xa0'),0x193);}_0x49cfc2=_0x1b4977;return db['AnalyticMetric'][_0x39cb('0x44')]({'raw':!![]});}return null;})[_0x39cb('0x23')](function(_0x4cca8d){if(_0x4cca8d){_0x5ae3e3=_[_0x39cb('0x6e')](_0x4cca8d,'id');var _0x165e46;var _0x4fdff9=squel[_0x39cb('0x6f')]();_0x4fdff9[_0x39cb('0x70')](_0x3fa61c[_0x39cb('0x71')]);for(var _0x2323d3=0x0;_0x2323d3<_0x49cfc2[_0x39cb('0x39')];_0x2323d3+=0x1){_0x165e46=_0x49cfc2[_0x2323d3]['MetricId']?_0x5ae3e3[_0x49cfc2[_0x2323d3]['MetricId']][_0x39cb('0x73')]:_0x49cfc2[_0x2323d3][_0x39cb('0x69')];_0x165e46=_0x49cfc2[_0x2323d3]['function']?_[_0x39cb('0x75')](_0xf321b8[_0x49cfc2[_0x2323d3][_0x39cb('0x74')]],'%s',_0x165e46):_0x165e46;_0x165e46=_0x49cfc2[_0x2323d3][_0x39cb('0x76')]?_[_0x39cb('0x75')](_0x17efbe[_0x49cfc2[_0x2323d3]['format']],'%s',_0x165e46):_0x165e46;if(_0x49cfc2[_0x2323d3]['groupBy']){_0x4fdff9['group'](_0x165e46);}_0x49cfc2[_0x2323d3][_0x39cb('0x78')]&&_0x4fdff9[_0x39cb('0x3c')](_0x165e46,_0x49cfc2[_0x2323d3]['orderBy']===_0x39cb('0x79')?![]:!![]);_0x4fdff9['field'](_0x165e46,_0x49cfc2[_0x2323d3][_0x39cb('0x7a')]||_0x165e46);}if(_0x3fa61c[_0x39cb('0x7b')]){_0x3fa61c[_0x39cb('0x7b')]=JSON[_0x39cb('0x7c')](_0x3fa61c[_0x39cb('0x7b')]);for(var _0x2d2dd9=0x0;_0x2d2dd9<_0x3fa61c[_0x39cb('0x7b')][_0x39cb('0x39')];_0x2d2dd9+=0x1){if(_0x3fa61c['joins'][_0x2d2dd9][_0x39cb('0x41')]&&_[_0x39cb('0x61')](_0x326634,_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9]['type'])&&_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9][_0x39cb('0x7d')]&&_0x3fa61c['joins'][_0x2d2dd9][_0x39cb('0x7e')]&&_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9]['foreignKey']){_0x4fdff9[_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9][_0x39cb('0x41')]](_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9][_0x39cb('0x7e')],null,util['format'](_0x39cb('0x80'),_0x3fa61c['table'],_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9][_0x39cb('0x7d')],_0x3fa61c['joins'][_0x2d2dd9][_0x39cb('0x7e')],_0x3fa61c[_0x39cb('0x7b')][_0x2d2dd9][_0x39cb('0x7f')]));}}}if(_0x3fa61c[_0x39cb('0x81')]){_0x3fa61c[_0x39cb('0x81')]=JSON[_0x39cb('0x7c')](_0x3fa61c[_0x39cb('0x81')]);_0x4fdff9[_0x39cb('0x3f')](_0x525544(_0x3fa61c['conditions'][_0x39cb('0x68')]));}_0xcc81ea=_0x4fdff9[_0x39cb('0x82')]();_0x4fdff9['limit'](_0x4a976f);_0x4fdff9['offset'](0x0);logger[_0x39cb('0x83')](_0x39cb('0x84'),_0x4fdff9['toString']());return dbH[_0x39cb('0x86')]['query'](_0x4fdff9[_0x39cb('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x39cb('0x9d')]});}})['then'](function(){return{'sql':_0xcc81ea[_0x39cb('0x85')]()};})[_0x39cb('0x23')](respondWithResult(_0xe40559,null))[_0x39cb('0x46')](handleError(_0xe40559,null));}; \ No newline at end of file +var _0xa7e2=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','Please\x20insert\x20at\x20least\x20one\x20field','findAll','select','from','table','MetricId','function','format','replace','groupBy','orderBy','order','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','AVG(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','operator','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','metric','DESC','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','%s.%s\x20=\x20%s.%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','CustomReports','UserProfileResource','end','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','include','rows','show','params','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports'];(function(_0x49b2fc,_0x19f6c9){var _0x35a17c=function(_0x51a2cc){while(--_0x51a2cc){_0x49b2fc['push'](_0x49b2fc['shift']());}};_0x35a17c(++_0x19f6c9);}(_0xa7e2,0x1b1));var _0x2a7e=function(_0x213288,_0x1e992c){_0x213288=_0x213288-0x0;var _0x2a52ab=_0xa7e2[_0x213288];return _0x2a52ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a7e('0x0'));var jsonpatch=require(_0x2a7e('0x1'));var rp=require(_0x2a7e('0x2'));var moment=require(_0x2a7e('0x3'));var BPromise=require(_0x2a7e('0x4'));var Mustache=require(_0x2a7e('0x5'));var util=require('util');var path=require(_0x2a7e('0x6'));var sox=require(_0x2a7e('0x7'));var csv=require(_0x2a7e('0x8'));var ejs=require(_0x2a7e('0x9'));var fs=require('fs');var fs_extra=require(_0x2a7e('0xa'));var _=require(_0x2a7e('0xb'));var squel=require(_0x2a7e('0xc'));var crypto=require(_0x2a7e('0xd'));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('ioredis');var authService=require(_0x2a7e('0xe'));var qs=require(_0x2a7e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a7e('0x10'));var logger=require(_0x2a7e('0x11'))(_0x2a7e('0x12'));var utils=require(_0x2a7e('0x13'));var config=require(_0x2a7e('0x14'));var licenseUtil=require(_0x2a7e('0x15'));var db=require(_0x2a7e('0x16'))['db'];var dbH=require('../../mysqldb')[_0x2a7e('0x17')];function respondWithStatusCode(_0x314217,_0xcc52bf){_0xcc52bf=_0xcc52bf||0xcc;return function(_0x5f1665){if(_0x5f1665){return _0x314217[_0x2a7e('0x18')](_0xcc52bf);}return _0x314217['status'](_0xcc52bf)['end']();};}function respondWithResult(_0x5488ce,_0x196efb){_0x196efb=_0x196efb||0xc8;return function(_0x45668a){if(_0x45668a){return _0x5488ce[_0x2a7e('0x19')](_0x196efb)[_0x2a7e('0x1a')](_0x45668a);}};}function respondWithFilteredResult(_0x5ef852,_0x40889b){return function(_0x44a7dc){if(_0x44a7dc){var _0x453a91=typeof _0x40889b['offset']===_0x2a7e('0x1b')&&typeof _0x40889b[_0x2a7e('0x1c')]===_0x2a7e('0x1b');var _0x1de596=_0x44a7dc[_0x2a7e('0x1d')];var _0x3de742=_0x453a91?0x0:_0x40889b[_0x2a7e('0x1e')];var _0xa72b21=_0x453a91?_0x44a7dc[_0x2a7e('0x1d')]:_0x40889b['offset']+_0x40889b[_0x2a7e('0x1c')];var _0x4670c2;if(_0xa72b21>=_0x1de596){_0xa72b21=_0x1de596;_0x4670c2=0xc8;}else{_0x4670c2=0xce;}_0x5ef852[_0x2a7e('0x19')](_0x4670c2);return _0x5ef852[_0x2a7e('0x1f')]('Content-Range',_0x3de742+'-'+_0xa72b21+'/'+_0x1de596)[_0x2a7e('0x1a')](_0x44a7dc);}return null;};}function patchUpdates(_0x50e153){return function(_0x203f17){try{jsonpatch[_0x2a7e('0x20')](_0x203f17,_0x50e153,!![]);}catch(_0x46753f){return BPromise[_0x2a7e('0x21')](_0x46753f);}return _0x203f17[_0x2a7e('0x22')]();};}function saveUpdates(_0x1576ba,_0x166bf9){return function(_0x1f850e){if(_0x1f850e){return _0x1f850e[_0x2a7e('0x23')](_0x1576ba)['then'](function(_0x5be304){return _0x5be304;});}return null;};}function removeEntity(_0x1ba640,_0x590ca4){return function(_0x3e8b62){if(_0x3e8b62){return _0x3e8b62['destroy']()[_0x2a7e('0x24')](function(){var _0x116182=_0x3e8b62[_0x2a7e('0x25')]({'plain':!![]});var _0x216a04=_0x2a7e('0x26');return db[_0x2a7e('0x27')]['destroy']({'where':{'type':_0x216a04,'resourceId':_0x116182['id']}})[_0x2a7e('0x24')](function(){return _0x3e8b62;});})[_0x2a7e('0x24')](function(){_0x1ba640[_0x2a7e('0x19')](0xcc)[_0x2a7e('0x28')]();});}};}function handleEntityNotFound(_0x6f8cbb,_0x3cf665){return function(_0x14bd6b){if(!_0x14bd6b){_0x6f8cbb['sendStatus'](0x194);}return _0x14bd6b;};}function handleError(_0x15f181,_0x3fd5bc){_0x3fd5bc=_0x3fd5bc||0x1f4;return function(_0x978a4c){logger[_0x2a7e('0x29')](_0x978a4c[_0x2a7e('0x2a')]);if(_0x978a4c[_0x2a7e('0x2b')]){delete _0x978a4c['name'];}_0x15f181[_0x2a7e('0x19')](_0x3fd5bc)[_0x2a7e('0x2c')](_0x978a4c);};}exports['index']=function(_0x5c7eea,_0x415871){var _0x274df5={},_0x315a01={},_0xc12df6={'count':0x0,'rows':[]};var _0x35d1eb=_[_0x2a7e('0x2d')](db[_0x2a7e('0x2e')][_0x2a7e('0x2f')],function(_0x222b3d){return{'name':_0x222b3d[_0x2a7e('0x30')],'type':_0x222b3d[_0x2a7e('0x31')][_0x2a7e('0x32')]};});_0x315a01[_0x2a7e('0x33')]=_[_0x2a7e('0x2d')](_0x35d1eb,'name');_0x315a01[_0x2a7e('0x34')]=_[_0x2a7e('0x35')](_0x5c7eea['query']);_0x315a01[_0x2a7e('0x36')]=_[_0x2a7e('0x37')](_0x315a01[_0x2a7e('0x33')],_0x315a01[_0x2a7e('0x34')]);_0x274df5[_0x2a7e('0x38')]=_[_0x2a7e('0x37')](_0x315a01[_0x2a7e('0x33')],qs[_0x2a7e('0x39')](_0x5c7eea[_0x2a7e('0x34')][_0x2a7e('0x39')]));_0x274df5[_0x2a7e('0x38')]=_0x274df5[_0x2a7e('0x38')][_0x2a7e('0x3a')]?_0x274df5[_0x2a7e('0x38')]:_0x315a01[_0x2a7e('0x33')];if(!_0x5c7eea[_0x2a7e('0x34')][_0x2a7e('0x3b')](_0x2a7e('0x3c'))){_0x274df5[_0x2a7e('0x1c')]=qs['limit'](_0x5c7eea[_0x2a7e('0x34')][_0x2a7e('0x1c')]);_0x274df5[_0x2a7e('0x1e')]=qs[_0x2a7e('0x1e')](_0x5c7eea['query'][_0x2a7e('0x1e')]);}_0x274df5['order']=qs['sort'](_0x5c7eea[_0x2a7e('0x34')]['sort']);_0x274df5[_0x2a7e('0x3d')]=qs[_0x2a7e('0x36')](_['pick'](_0x5c7eea[_0x2a7e('0x34')],_0x315a01[_0x2a7e('0x36')]),_0x35d1eb);if(_0x5c7eea[_0x2a7e('0x34')][_0x2a7e('0x3e')]){_0x274df5['where']=_[_0x2a7e('0x3f')](_0x274df5['where'],{'$or':_[_0x2a7e('0x2d')](_0x35d1eb,function(_0x3aa418){if(_0x3aa418[_0x2a7e('0x31')]!==_0x2a7e('0x40')){var _0x11f82e={};_0x11f82e[_0x3aa418[_0x2a7e('0x2b')]]={'$like':'%'+_0x5c7eea[_0x2a7e('0x34')][_0x2a7e('0x3e')]+'%'};return _0x11f82e;}})});}_0x274df5=_[_0x2a7e('0x3f')]({},_0x274df5,_0x5c7eea['options']);var _0x11adea={'where':_0x274df5[_0x2a7e('0x3d')]};return db['AnalyticCustomReport'][_0x2a7e('0x1d')](_0x11adea)[_0x2a7e('0x24')](function(_0x2a8e6a){_0xc12df6[_0x2a7e('0x1d')]=_0x2a8e6a;if(_0x5c7eea[_0x2a7e('0x34')]['includeAll']){_0x274df5[_0x2a7e('0x41')]=[{'all':!![]}];}return db[_0x2a7e('0x2e')]['findAll'](_0x274df5);})[_0x2a7e('0x24')](function(_0x4c2a21){_0xc12df6[_0x2a7e('0x42')]=_0x4c2a21;return _0xc12df6;})['then'](respondWithFilteredResult(_0x415871,_0x274df5))['catch'](handleError(_0x415871,null));};exports[_0x2a7e('0x43')]=function(_0x202c91,_0x49826e){var _0x139a15={'raw':![],'where':{'id':_0x202c91[_0x2a7e('0x44')]['id']}},_0x307530={};_0x307530[_0x2a7e('0x33')]=_['keys'](db['AnalyticCustomReport'][_0x2a7e('0x2f')]);_0x307530[_0x2a7e('0x34')]=_['keys'](_0x202c91['query']);_0x307530['filters']=_[_0x2a7e('0x37')](_0x307530[_0x2a7e('0x33')],_0x307530[_0x2a7e('0x34')]);_0x139a15['attributes']=_[_0x2a7e('0x37')](_0x307530[_0x2a7e('0x33')],qs['fields'](_0x202c91[_0x2a7e('0x34')][_0x2a7e('0x39')]));_0x139a15['attributes']=_0x139a15[_0x2a7e('0x38')]['length']?_0x139a15['attributes']:_0x307530[_0x2a7e('0x33')];if(_0x202c91[_0x2a7e('0x34')][_0x2a7e('0x45')]){_0x139a15[_0x2a7e('0x41')]=[{'all':!![]}];}_0x139a15=_[_0x2a7e('0x3f')]({},_0x139a15,_0x202c91['options']);return db['AnalyticCustomReport'][_0x2a7e('0x46')](_0x139a15)[_0x2a7e('0x24')](handleEntityNotFound(_0x49826e,null))['then'](respondWithResult(_0x49826e,null))[_0x2a7e('0x47')](handleError(_0x49826e,null));};exports[_0x2a7e('0x48')]=function(_0x5b9542,_0x4310b4){return db[_0x2a7e('0x2e')]['create'](_0x5b9542['body'],{})[_0x2a7e('0x24')](function(_0x25c332){var _0x573e15=_0x5b9542[_0x2a7e('0x49')][_0x2a7e('0x25')]({'plain':!![]});if(!_0x573e15)throw new Error(_0x2a7e('0x4a'));if(_0x573e15[_0x2a7e('0x4b')]===_0x2a7e('0x49')){var _0x41ad10=_0x25c332[_0x2a7e('0x25')]({'plain':!![]});var _0x4c5070=_0x2a7e('0x4c');return db[_0x2a7e('0x4d')]['find']({'where':{'name':_0x4c5070,'userProfileId':_0x573e15['userProfileId']},'raw':!![]})[_0x2a7e('0x24')](function(_0x26be1c){if(_0x26be1c&&_0x26be1c[_0x2a7e('0x4e')]===0x0){return db[_0x2a7e('0x27')][_0x2a7e('0x48')]({'name':_0x41ad10[_0x2a7e('0x2b')],'resourceId':_0x41ad10['id'],'type':_0x2a7e('0x26'),'sectionId':_0x26be1c['id']},{})['then'](function(){return _0x25c332;});}else{return _0x25c332;}})[_0x2a7e('0x47')](function(_0x1b2df1){logger[_0x2a7e('0x29')](_0x2a7e('0x4f'),_0x1b2df1);throw _0x1b2df1;});}return _0x25c332;})[_0x2a7e('0x24')](respondWithResult(_0x4310b4,0xc9))[_0x2a7e('0x47')](handleError(_0x4310b4,null));};exports[_0x2a7e('0x23')]=function(_0x20e06f,_0x4caea4){if(_0x20e06f[_0x2a7e('0x50')]['id']){delete _0x20e06f[_0x2a7e('0x50')]['id'];}return db[_0x2a7e('0x2e')]['find']({'where':{'id':_0x20e06f[_0x2a7e('0x44')]['id']}})[_0x2a7e('0x24')](handleEntityNotFound(_0x4caea4,null))[_0x2a7e('0x24')](saveUpdates(_0x20e06f['body'],null))[_0x2a7e('0x24')](respondWithResult(_0x4caea4,null))[_0x2a7e('0x47')](handleError(_0x4caea4,null));};exports['destroy']=function(_0x1fded3,_0x10cdff){return db[_0x2a7e('0x2e')][_0x2a7e('0x46')]({'where':{'id':_0x1fded3[_0x2a7e('0x44')]['id']}})['then'](handleEntityNotFound(_0x10cdff,null))[_0x2a7e('0x24')](removeEntity(_0x10cdff,null))['catch'](handleError(_0x10cdff,null));};exports[_0x2a7e('0x51')]=function(_0x40e6c1,_0x2896a6){var _0x179170=0xa;var _0x214900=[_0x2a7e('0x52'),'left_join',_0x2a7e('0x53'),_0x2a7e('0x54')];var _0x185a53={'SUM':_0x2a7e('0x55'),'COUNT':_0x2a7e('0x56'),'COUNT DISTINCT':_0x2a7e('0x57'),'MAX':_0x2a7e('0x58'),'MIN':_0x2a7e('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2a7e('0x5a'),'GROUP_CONCAT ASC':_0x2a7e('0x5b'),'GROUP_CONCAT DESC':_0x2a7e('0x5c')};var _0xa073cf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2a7e('0x5d'),'HOUR':_0x2a7e('0x5e'),'ROUND':_0x2a7e('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1dacf8=function(_0x528979){return!_['includes']([_0x2a7e('0x60'),_0x2a7e('0x61'),_0x2a7e('0x62'),_0x2a7e('0x63')],_0x528979);};var _0xed5221=function(_0x576475){if(!_0x576475||!_0x576475[_0x2a7e('0x64')][_0x2a7e('0x3a')]){return'';}for(var _0x358f4a='(',_0x37b7b3=0x0;_0x37b7b3<_0x576475[_0x2a7e('0x64')]['length'];_0x37b7b3+=0x1){_0x37b7b3>0x0&&(_0x358f4a+='\x20'+_0x576475['operator']+'\x20');_0x358f4a+=_0x576475['rules'][_0x37b7b3][_0x2a7e('0x65')]?_0xed5221(_0x576475[_0x2a7e('0x64')][_0x37b7b3][_0x2a7e('0x65')]):_0x576475[_0x2a7e('0x64')][_0x37b7b3][_0x2a7e('0x66')]+'\x20'+_0x576475[_0x2a7e('0x64')][_0x37b7b3]['condition']+(_0x1dacf8(_0x576475[_0x2a7e('0x64')][_0x37b7b3][_0x2a7e('0x67')])?'\x20'+_0x576475['rules'][_0x37b7b3][_0x2a7e('0x68')]:'');}return _0x358f4a+')';};var _0x4f521a={'where':{'id':_0x40e6c1[_0x2a7e('0x44')]['id']}},_0x2588c2,_0x1ccc7a,_0xc485bb,_0x1527b7,_0x5e4464;_0x4f521a=_[_0x2a7e('0x3f')]({},_0x4f521a,_0x40e6c1[_0x2a7e('0x69')]);return db[_0x2a7e('0x2e')][_0x2a7e('0x46')](_0x4f521a)[_0x2a7e('0x24')](function(_0xe66183){if(_0xe66183){_0x2588c2=_0xe66183;return _0xe66183[_0x2a7e('0x6a')]();}return null;})[_0x2a7e('0x24')](function(_0x3080ce){if(_0x3080ce){if(!_0x3080ce[_0x2a7e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0x2a7e('0x6b'),0x193);}_0x1ccc7a=_0x3080ce;return db['AnalyticMetric'][_0x2a7e('0x6c')]({'raw':!![]});}return null;})[_0x2a7e('0x24')](function(_0xa0df9a){if(_0xa0df9a){_0xc485bb=_['keyBy'](_0xa0df9a,'id');var _0x5ea182;var _0x517fd8=squel[_0x2a7e('0x6d')]();_0x517fd8[_0x2a7e('0x6e')](_0x2588c2[_0x2a7e('0x6f')]);for(var _0x3f6d80=0x0;_0x3f6d80<_0x1ccc7a[_0x2a7e('0x3a')];_0x3f6d80+=0x1){_0x5ea182=_0x1ccc7a[_0x3f6d80][_0x2a7e('0x70')]?_0xc485bb[_0x1ccc7a[_0x3f6d80][_0x2a7e('0x70')]]['metric']:_0x1ccc7a[_0x3f6d80]['field'];_0x5ea182=_0x1ccc7a[_0x3f6d80][_0x2a7e('0x71')]?_['replace'](_0x185a53[_0x1ccc7a[_0x3f6d80]['function']],'%s',_0x5ea182):_0x5ea182;_0x5ea182=_0x1ccc7a[_0x3f6d80][_0x2a7e('0x72')]?_[_0x2a7e('0x73')](_0xa073cf[_0x1ccc7a[_0x3f6d80][_0x2a7e('0x72')]],'%s',_0x5ea182):_0x5ea182;if(_0x1ccc7a[_0x3f6d80][_0x2a7e('0x74')]){_0x517fd8[_0x2a7e('0x65')](_0x5ea182);}_0x1ccc7a[_0x3f6d80][_0x2a7e('0x75')]&&_0x517fd8[_0x2a7e('0x76')](_0x5ea182,_0x1ccc7a[_0x3f6d80][_0x2a7e('0x75')]==='DESC'?![]:!![]);_0x517fd8[_0x2a7e('0x66')](_0x5ea182,_0x1ccc7a[_0x3f6d80][_0x2a7e('0x77')]||_0x5ea182);}if(_0x2588c2[_0x2a7e('0x78')]){_0x2588c2[_0x2a7e('0x78')]=JSON[_0x2a7e('0x79')](_0x2588c2[_0x2a7e('0x78')]);for(var _0x404990=0x0;_0x404990<_0x2588c2['joins'][_0x2a7e('0x3a')];_0x404990+=0x1){if(_0x2588c2[_0x2a7e('0x78')][_0x404990][_0x2a7e('0x31')]&&_[_0x2a7e('0x7a')](_0x214900,_0x2588c2['joins'][_0x404990][_0x2a7e('0x31')])&&_0x2588c2['joins'][_0x404990][_0x2a7e('0x7b')]&&_0x2588c2[_0x2a7e('0x78')][_0x404990][_0x2a7e('0x7c')]&&_0x2588c2['joins'][_0x404990][_0x2a7e('0x7d')]){_0x517fd8[_0x2588c2['joins'][_0x404990][_0x2a7e('0x31')]](_0x2588c2['joins'][_0x404990][_0x2a7e('0x7c')],null,util[_0x2a7e('0x72')]('%s.%s\x20=\x20%s.%s',_0x2588c2[_0x2a7e('0x6f')],_0x2588c2[_0x2a7e('0x78')][_0x404990]['parentKey'],_0x2588c2['joins'][_0x404990][_0x2a7e('0x7c')],_0x2588c2[_0x2a7e('0x78')][_0x404990][_0x2a7e('0x7d')]));}}}if(_0x2588c2[_0x2a7e('0x7e')]){_0x2588c2[_0x2a7e('0x7e')]=JSON[_0x2a7e('0x79')](_0x2588c2['conditions']);_0x517fd8['where'](_0xed5221(_0x2588c2[_0x2a7e('0x7e')][_0x2a7e('0x65')]));}_0x5e4464=_0x517fd8[_0x2a7e('0x7f')]();_0x517fd8[_0x2a7e('0x1c')](_0x179170);_0x517fd8[_0x2a7e('0x1e')](0x0);logger[_0x2a7e('0x80')](_0x2a7e('0x81'),_0x517fd8['toString']());return dbH[_0x2a7e('0x82')]['query'](_0x517fd8[_0x2a7e('0x83')](),{'type':dbH[_0x2a7e('0x82')][_0x2a7e('0x84')][_0x2a7e('0x85')]});}})['then'](respondWithResult(_0x2896a6,null))[_0x2a7e('0x47')](handleError(_0x2896a6,null));};function runReport(_0x3b87e0,_0x2a0a18,_0x181de6){var _0x564d2f=_0x2a0a18[_0x2a7e('0x2b')];var _0x4e5af6=0xa;var _0xda8342=[_0x2a7e('0x52'),_0x2a7e('0x86'),'right_join',_0x2a7e('0x54')];var _0x22b7ad={'SUM':_0x2a7e('0x55'),'COUNT':_0x2a7e('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2a7e('0x58'),'MIN':_0x2a7e('0x59'),'AVG':_0x2a7e('0x87'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2a7e('0x5b'),'GROUP_CONCAT DESC':_0x2a7e('0x5c')};var _0x3cfdc0={'SEC_TO_TIME':_0x2a7e('0x88'),'DATE':'DATE(%s)','HOUR':_0x2a7e('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2a7e('0x89')};var _0x588d63=function(_0x2fc369){return!_[_0x2a7e('0x7a')]([_0x2a7e('0x60'),_0x2a7e('0x61'),'IS\x20EMPTY',_0x2a7e('0x63')],_0x2fc369);};var _0x233082=function(_0x412e28){if(!_0x412e28||!_0x412e28[_0x2a7e('0x64')][_0x2a7e('0x3a')]){return'';}for(var _0x3a0998='(',_0x19df8f=0x0;_0x19df8f<_0x412e28['rules']['length'];_0x19df8f+=0x1){_0x19df8f>0x0&&(_0x3a0998+='\x20'+_0x412e28[_0x2a7e('0x8a')]+'\x20');_0x3a0998+=_0x412e28[_0x2a7e('0x64')][_0x19df8f][_0x2a7e('0x65')]?_0x233082(_0x412e28[_0x2a7e('0x64')][_0x19df8f]['group']):_0x412e28['rules'][_0x19df8f][_0x2a7e('0x66')]+'\x20'+_0x412e28[_0x2a7e('0x64')][_0x19df8f][_0x2a7e('0x67')]+(_0x588d63(_0x412e28['rules'][_0x19df8f][_0x2a7e('0x67')])?'\x20'+_0x412e28[_0x2a7e('0x64')][_0x19df8f][_0x2a7e('0x68')]:'');}return _0x3a0998+')';};var _0x34e5fb={'where':{'id':_0x3b87e0['id']}},_0x18e5d1,_0x313ac6,_0x39248c,_0x5ef2f1,_0x4b413d;_0x34e5fb=_['merge']({},_0x34e5fb,_0x181de6);return db['AnalyticCustomReport'][_0x2a7e('0x46')](_0x34e5fb)['then'](function(_0x21ba3c){if(_0x21ba3c){_0x18e5d1=_0x21ba3c;return _0x21ba3c['getFields']();}return null;})[_0x2a7e('0x24')](function(_0x15e324){if(_0x15e324){if(!_0x15e324[_0x2a7e('0x3a')]){throw new db[(_0x2a7e('0x8b'))][(_0x2a7e('0x8c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x313ac6=_0x15e324;return db[_0x2a7e('0x8d')][_0x2a7e('0x6c')]({'raw':!![]});}return null;})[_0x2a7e('0x24')](function(_0x3bf80d){if(_0x3bf80d){_0x39248c=_[_0x2a7e('0x8e')](_0x3bf80d,'id');var _0x5c9e1b;var _0x458b08=squel['select']();_0x458b08[_0x2a7e('0x6e')](_0x18e5d1['table']);for(var _0x8b564=0x0;_0x8b564<_0x313ac6[_0x2a7e('0x3a')];_0x8b564+=0x1){_0x5c9e1b=_0x313ac6[_0x8b564][_0x2a7e('0x70')]?_0x39248c[_0x313ac6[_0x8b564][_0x2a7e('0x70')]][_0x2a7e('0x8f')]:_0x313ac6[_0x8b564][_0x2a7e('0x66')];_0x5c9e1b=_0x313ac6[_0x8b564][_0x2a7e('0x71')]?_[_0x2a7e('0x73')](_0x22b7ad[_0x313ac6[_0x8b564][_0x2a7e('0x71')]],'%s',_0x5c9e1b):_0x5c9e1b;_0x5c9e1b=_0x313ac6[_0x8b564][_0x2a7e('0x72')]?_['replace'](_0x3cfdc0[_0x313ac6[_0x8b564]['format']],'%s',_0x5c9e1b):_0x5c9e1b;if(_0x313ac6[_0x8b564][_0x2a7e('0x74')]){_0x458b08[_0x2a7e('0x65')](_0x5c9e1b);}_0x313ac6[_0x8b564][_0x2a7e('0x75')]&&_0x458b08[_0x2a7e('0x76')](_0x5c9e1b,_0x313ac6[_0x8b564][_0x2a7e('0x75')]===_0x2a7e('0x90')?![]:!![]);_0x458b08['field'](_0x5c9e1b,_0x313ac6[_0x8b564]['alias']||_0x5c9e1b);}if(_0x18e5d1[_0x2a7e('0x78')]){_0x18e5d1['joins']=JSON[_0x2a7e('0x79')](_0x18e5d1[_0x2a7e('0x78')]);for(var _0x4fa329=0x0;_0x4fa329<_0x18e5d1['joins']['length'];_0x4fa329+=0x1){if(_0x18e5d1['joins'][_0x4fa329]['type']&&_[_0x2a7e('0x7a')](_0xda8342,_0x18e5d1[_0x2a7e('0x78')][_0x4fa329]['type'])&&_0x18e5d1[_0x2a7e('0x78')][_0x4fa329][_0x2a7e('0x7b')]&&_0x18e5d1[_0x2a7e('0x78')][_0x4fa329][_0x2a7e('0x7c')]&&_0x18e5d1['joins'][_0x4fa329][_0x2a7e('0x7d')]){_0x458b08[_0x18e5d1[_0x2a7e('0x78')][_0x4fa329]['type']](_0x18e5d1[_0x2a7e('0x78')][_0x4fa329][_0x2a7e('0x7c')],null,util[_0x2a7e('0x72')]('%s.%s\x20=\x20%s.%s',_0x18e5d1[_0x2a7e('0x6f')],_0x18e5d1[_0x2a7e('0x78')][_0x4fa329][_0x2a7e('0x7b')],_0x18e5d1[_0x2a7e('0x78')][_0x4fa329][_0x2a7e('0x7c')],_0x18e5d1[_0x2a7e('0x78')][_0x4fa329]['foreignKey']));}}}if(_0x18e5d1[_0x2a7e('0x7e')]){_0x18e5d1[_0x2a7e('0x7e')]=JSON[_0x2a7e('0x79')](_0x18e5d1[_0x2a7e('0x7e')]);_0x458b08[_0x2a7e('0x3d')](_0x233082(_0x18e5d1[_0x2a7e('0x7e')][_0x2a7e('0x65')]));}_0x4b413d=_0x458b08[_0x2a7e('0x7f')]();_0x458b08[_0x2a7e('0x1c')](_0x4e5af6);_0x458b08[_0x2a7e('0x1e')](0x0);return;}})[_0x2a7e('0x24')](function(){if(_0x2a0a18['output']===_0x2a7e('0x91')){return null;}var _0x2db2ba=_[_0x2a7e('0x3f')](_0x2a0a18,{'name':_0x2a0a18[_0x2a7e('0x92')]||_0x2a0a18[_0x2a7e('0x2b')]||_0x18e5d1[_0x2a7e('0x2b')],'basename':_0x564d2f,'savename':util[_0x2a7e('0x72')](_0x2a7e('0x93'),_0x2a0a18[_0x2a7e('0x2b')]||_0x18e5d1['name'],require(_0x2a7e('0x94'))[_0x2a7e('0x95')](0x4),_0x2a0a18[_0x2a7e('0x96')]||_0x2a7e('0x97')),'reportId':_0x18e5d1['id'],'reportType':_0x2a7e('0x98')});return db[_0x2a7e('0x99')]['create'](_0x2db2ba,{'raw':!![]});})[_0x2a7e('0x24')](function(_0x44e2d7){if(_0x18e5d1['table']===_0x2a7e('0x9a')){_0x4b413d['where'](_0x18e5d1[_0x2a7e('0x6f')]+_0x2a7e('0x9b'),_0x2a0a18[_0x2a7e('0x9c')],_0x2a0a18[_0x2a7e('0x9d')]);}else{_0x4b413d['where'](_0x18e5d1['table']+_0x2a7e('0x9e'),_0x2a0a18[_0x2a7e('0x9c')],_0x2a0a18[_0x2a7e('0x9d')]);}if(_0x44e2d7){logger['info'](_0x2a7e('0x9f'),_0x4b413d[_0x2a7e('0x83')]());require(_0x2a7e('0xa0'))[_0x2a7e('0xa1')](path[_0x2a7e('0x52')](__dirname,_0x2a7e('0xa2'),_0x44e2d7[_0x2a7e('0x96')]),[_0x44e2d7['id'],_0x4b413d[_0x2a7e('0x83')](),path[_0x2a7e('0x52')](__dirname,_0x2a7e('0xa3'),_0x44e2d7[_0x2a7e('0xa4')]),_0x564d2f]);return _0x44e2d7;}else{var _0x29fd30=squel['select']();_0x29fd30['from']('('+_0x4b413d[_0x2a7e('0x83')]()+')',_0x2a7e('0xa5'));_0x29fd30[_0x2a7e('0x66')](_0x2a7e('0xa6'),_0x2a7e('0x1d'));_0x4b413d[_0x2a7e('0x1c')](_0x2a0a18['limit']||_0x4e5af6);_0x4b413d[_0x2a7e('0x1e')](_0x2a0a18['offset']||0x0);return dbH[_0x2a7e('0x82')]['query'](_0x29fd30['toString'](),{'type':dbH[_0x2a7e('0x82')]['QueryTypes'][_0x2a7e('0x85')]})[_0x2a7e('0x24')](function(_0x5d859d){if(!_0x5d859d['length']){_0x5ef2f1=0x0;}else{_0x5ef2f1=_0x5d859d[0x0]['count']||0x0;}return dbH[_0x2a7e('0x82')][_0x2a7e('0x34')](_0x4b413d[_0x2a7e('0x83')](),{'type':dbH[_0x2a7e('0x82')][_0x2a7e('0x84')][_0x2a7e('0x85')]});})['then'](function(_0x1195a2){return{'rows':_0x1195a2||[],'count':_0x5ef2f1};});}});}exports[_0x2a7e('0xa7')]=function(_0x5aeb20,_0x5bbf99){return runReport(_0x5aeb20[_0x2a7e('0x44')],_0x5aeb20['query'],_0x5aeb20[_0x2a7e('0x69')])['then'](respondWithResult(_0x5bbf99,null))['catch'](handleError(_0x5bbf99,null));};exports[_0x2a7e('0xa8')]=runReport;exports[_0x2a7e('0x34')]=function(_0x265d7f,_0x2893ae){var _0x5874aa=0xa;var _0xeecf55=['join',_0x2a7e('0x86'),_0x2a7e('0x53'),_0x2a7e('0x54')];var _0x39b1c1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2a7e('0x57'),'MAX':_0x2a7e('0x58'),'MIN':'MIN(%s)','AVG':_0x2a7e('0x87'),'GROUP_CONCAT':_0x2a7e('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2a7e('0x5c')};var _0x2b5a68={'SEC_TO_TIME':_0x2a7e('0x88'),'DATE':_0x2a7e('0x5d'),'HOUR':_0x2a7e('0x5e'),'ROUND':_0x2a7e('0x5f'),'UNIX_TIMESTAMP':_0x2a7e('0x89')};var _0x1dcac9=function(_0x273af2){return!_['includes']([_0x2a7e('0x60'),'IS\x20NOT\x20NULL',_0x2a7e('0x62'),'IS\x20NOT\x20EMPTY'],_0x273af2);};var _0x506b1c=function(_0x2c2fc2){if(!_0x2c2fc2||!_0x2c2fc2[_0x2a7e('0x64')][_0x2a7e('0x3a')]){return'';}for(var _0x1142b4='(',_0x3ec828=0x0;_0x3ec828<_0x2c2fc2[_0x2a7e('0x64')][_0x2a7e('0x3a')];_0x3ec828+=0x1){_0x3ec828>0x0&&(_0x1142b4+='\x20'+_0x2c2fc2[_0x2a7e('0x8a')]+'\x20');_0x1142b4+=_0x2c2fc2[_0x2a7e('0x64')][_0x3ec828]['group']?_0x506b1c(_0x2c2fc2[_0x2a7e('0x64')][_0x3ec828][_0x2a7e('0x65')]):_0x2c2fc2[_0x2a7e('0x64')][_0x3ec828][_0x2a7e('0x66')]+'\x20'+_0x2c2fc2[_0x2a7e('0x64')][_0x3ec828][_0x2a7e('0x67')]+(_0x1dcac9(_0x2c2fc2[_0x2a7e('0x64')][_0x3ec828][_0x2a7e('0x67')])?'\x20'+_0x2c2fc2['rules'][_0x3ec828][_0x2a7e('0x68')]:'');}return _0x1142b4+')';};var _0x2eb072={'where':{'id':_0x265d7f[_0x2a7e('0x44')]['id']}},_0x1e3d26,_0x5947b0,_0x26f32a,_0x19b15f,_0x23dd66;_0x2eb072=_[_0x2a7e('0x3f')]({},_0x2eb072,_0x265d7f[_0x2a7e('0x69')]);return db['AnalyticCustomReport']['find'](_0x2eb072)['then'](function(_0x40fd9b){if(_0x40fd9b){_0x1e3d26=_0x40fd9b;return _0x40fd9b[_0x2a7e('0x6a')]();}return null;})[_0x2a7e('0x24')](function(_0x1a7c3c){if(_0x1a7c3c){if(!_0x1a7c3c['length']){throw new db[(_0x2a7e('0x8b'))][(_0x2a7e('0x8c'))](_0x2a7e('0x6b'),0x193);}_0x5947b0=_0x1a7c3c;return db[_0x2a7e('0x8d')]['findAll']({'raw':!![]});}return null;})[_0x2a7e('0x24')](function(_0x482171){if(_0x482171){_0x26f32a=_[_0x2a7e('0x8e')](_0x482171,'id');var _0x3cbded;var _0x599851=squel[_0x2a7e('0x6d')]();_0x599851[_0x2a7e('0x6e')](_0x1e3d26[_0x2a7e('0x6f')]);for(var _0xfb7774=0x0;_0xfb7774<_0x5947b0[_0x2a7e('0x3a')];_0xfb7774+=0x1){_0x3cbded=_0x5947b0[_0xfb7774][_0x2a7e('0x70')]?_0x26f32a[_0x5947b0[_0xfb7774][_0x2a7e('0x70')]]['metric']:_0x5947b0[_0xfb7774][_0x2a7e('0x66')];_0x3cbded=_0x5947b0[_0xfb7774][_0x2a7e('0x71')]?_[_0x2a7e('0x73')](_0x39b1c1[_0x5947b0[_0xfb7774]['function']],'%s',_0x3cbded):_0x3cbded;_0x3cbded=_0x5947b0[_0xfb7774][_0x2a7e('0x72')]?_['replace'](_0x2b5a68[_0x5947b0[_0xfb7774]['format']],'%s',_0x3cbded):_0x3cbded;if(_0x5947b0[_0xfb7774]['groupBy']){_0x599851[_0x2a7e('0x65')](_0x3cbded);}_0x5947b0[_0xfb7774][_0x2a7e('0x75')]&&_0x599851['order'](_0x3cbded,_0x5947b0[_0xfb7774][_0x2a7e('0x75')]===_0x2a7e('0x90')?![]:!![]);_0x599851['field'](_0x3cbded,_0x5947b0[_0xfb7774][_0x2a7e('0x77')]||_0x3cbded);}if(_0x1e3d26[_0x2a7e('0x78')]){_0x1e3d26['joins']=JSON[_0x2a7e('0x79')](_0x1e3d26[_0x2a7e('0x78')]);for(var _0x1e1b18=0x0;_0x1e1b18<_0x1e3d26[_0x2a7e('0x78')][_0x2a7e('0x3a')];_0x1e1b18+=0x1){if(_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18][_0x2a7e('0x31')]&&_[_0x2a7e('0x7a')](_0xeecf55,_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18]['type'])&&_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18][_0x2a7e('0x7b')]&&_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18]['foreignTable']&&_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18][_0x2a7e('0x7d')]){_0x599851[_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18][_0x2a7e('0x31')]](_0x1e3d26[_0x2a7e('0x78')][_0x1e1b18][_0x2a7e('0x7c')],null,util[_0x2a7e('0x72')](_0x2a7e('0xa9'),_0x1e3d26['table'],_0x1e3d26['joins'][_0x1e1b18]['parentKey'],_0x1e3d26['joins'][_0x1e1b18][_0x2a7e('0x7c')],_0x1e3d26['joins'][_0x1e1b18][_0x2a7e('0x7d')]));}}}if(_0x1e3d26[_0x2a7e('0x7e')]){_0x1e3d26['conditions']=JSON[_0x2a7e('0x79')](_0x1e3d26[_0x2a7e('0x7e')]);_0x599851[_0x2a7e('0x3d')](_0x506b1c(_0x1e3d26[_0x2a7e('0x7e')][_0x2a7e('0x65')]));}_0x23dd66=_0x599851[_0x2a7e('0x7f')]();_0x599851['limit'](_0x5874aa);_0x599851[_0x2a7e('0x1e')](0x0);logger[_0x2a7e('0x80')](_0x2a7e('0x81'),_0x599851[_0x2a7e('0x83')]());return dbH[_0x2a7e('0x82')][_0x2a7e('0x34')](_0x599851[_0x2a7e('0x83')](),{'type':dbH['sequelize'][_0x2a7e('0x84')][_0x2a7e('0x85')]});}})[_0x2a7e('0x24')](function(){return{'sql':_0x23dd66[_0x2a7e('0x83')]()};})[_0x2a7e('0x24')](respondWithResult(_0x2893ae,null))[_0x2a7e('0x47')](handleError(_0x2893ae,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index bd7e387..f4a3571 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 _0x8d6a=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','util','../../config/logger','api','moment','bluebird'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x8d6a,0x13a));var _0xa8d6=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8d6a[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require(_0xa8d6('0x0'));var logger=require(_0xa8d6('0x1'))(_0xa8d6('0x2'));var moment=require(_0xa8d6('0x3'));var BPromise=require(_0xa8d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8d6('0x5'));var rimraf=require(_0xa8d6('0x6'));var config=require('../../config/environment');var attributes=require(_0xa8d6('0x7'));module[_0xa8d6('0x8')]=function(_0x27805b,_0x4cfad4){return _0x27805b[_0xa8d6('0x9')](_0xa8d6('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe372=['api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','../../config/logger'];(function(_0x2b794f,_0x3bce37){var _0x36fe17=function(_0x190305){while(--_0x190305){_0x2b794f['push'](_0x2b794f['shift']());}};_0x36fe17(++_0x3bce37);}(_0xe372,0x15c));var _0x2e37=function(_0x4cd7fd,_0x315a81){_0x4cd7fd=_0x4cd7fd-0x0;var _0x11157d=_0xe372[_0x4cd7fd];return _0x11157d;};'use strict';var _=require(_0x2e37('0x0'));var util=require('util');var logger=require(_0x2e37('0x1'))(_0x2e37('0x2'));var moment=require('moment');var BPromise=require(_0x2e37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e37('0x4'));var rimraf=require(_0x2e37('0x5'));var config=require(_0x2e37('0x6'));var attributes=require(_0x2e37('0x7'));module[_0x2e37('0x8')]=function(_0x5a6eb6,_0x39919f){return _0x5a6eb6['define']('AnalyticCustomReport',attributes,{'tableName':_0x2e37('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 72d63b9..2f44056 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 _0x5ac3=['../../config/utils','../../config/logger','rpc','jayson/promise','http','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0x512be3,_0x21d085){var _0x3aa63f=function(_0x4a3cee){while(--_0x4a3cee){_0x512be3['push'](_0x512be3['shift']());}};_0x3aa63f(++_0x21d085);}(_0x5ac3,0x152));var _0x35ac=function(_0x3f9aa0,_0x478ec3){_0x3f9aa0=_0x3f9aa0-0x0;var _0x4a82c0=_0x5ac3[_0x3f9aa0];return _0x4a82c0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x35ac('0x0'));var BPromise=require('bluebird');var rs=require(_0x35ac('0x1'));var fs=require('fs');var Redis=require(_0x35ac('0x2'));var db=require(_0x35ac('0x3'))['db'];var utils=require(_0x35ac('0x4'));var logger=require(_0x35ac('0x5'))(_0x35ac('0x6'));var config=require('../../config/environment');var jayson=require(_0x35ac('0x7'));var client=jayson['client'][_0x35ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2eb2ee,_0xf58dc4,_0x147ba0){return new BPromise(function(_0x54802d,_0x1bd88e){return client['request'](_0x2eb2ee,_0x147ba0)['then'](function(_0x133b86){logger['info'](_0x35ac('0x9'),_0xf58dc4,'request\x20sent');logger[_0x35ac('0xa')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xf58dc4,_0x35ac('0xb'),JSON['stringify'](_0x133b86));if(_0x133b86[_0x35ac('0xc')]){if(_0x133b86[_0x35ac('0xc')][_0x35ac('0xd')]===0x1f4){logger['error'](_0x35ac('0x9'),_0xf58dc4,_0x133b86[_0x35ac('0xc')][_0x35ac('0xe')]);return _0x1bd88e(_0x133b86[_0x35ac('0xc')]['message']);}logger['error'](_0x35ac('0x9'),_0xf58dc4,_0x133b86[_0x35ac('0xc')][_0x35ac('0xe')]);return _0x54802d(_0x133b86[_0x35ac('0xc')][_0x35ac('0xe')]);}else{logger[_0x35ac('0xf')](_0x35ac('0x9'),_0xf58dc4,_0x35ac('0xb'));_0x54802d(_0x133b86[_0x35ac('0x10')][_0x35ac('0xe')]);}})[_0x35ac('0x11')](function(_0x174002){logger[_0x35ac('0xc')](_0x35ac('0x9'),_0xf58dc4,_0x174002);_0x1bd88e(_0x174002);});});} \ No newline at end of file +var _0xb3bf=['AnalyticCustomReport,\x20%s,\x20%s','result','lodash','moment','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x73353,_0x22fdcd){var _0x486c82=function(_0x136f20){while(--_0x136f20){_0x73353['push'](_0x73353['shift']());}};_0x486c82(++_0x22fdcd);}(_0xb3bf,0x1a0));var _0xfb3b=function(_0x29b01f,_0x13e8bb){_0x29b01f=_0x29b01f-0x0;var _0xf7d6c3=_0xb3bf[_0x29b01f];return _0xf7d6c3;};'use strict';var _=require(_0xfb3b('0x0'));var util=require('util');var moment=require(_0xfb3b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb3b('0x2'));var logger=require('../../config/logger')(_0xfb3b('0x3'));var config=require('../../config/environment');var jayson=require(_0xfb3b('0x4'));var client=jayson[_0xfb3b('0x5')][_0xfb3b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x52c0fc,_0x3752da,_0x2736cc){return new BPromise(function(_0x17afff,_0x105cfd){return client[_0xfb3b('0x7')](_0x52c0fc,_0x2736cc)[_0xfb3b('0x8')](function(_0x5e3a3b){logger[_0xfb3b('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3752da,_0xfb3b('0xa'));logger[_0xfb3b('0xb')](_0xfb3b('0xc'),_0x3752da,'request\x20sent',JSON['stringify'](_0x5e3a3b));if(_0x5e3a3b[_0xfb3b('0xd')]){if(_0x5e3a3b[_0xfb3b('0xd')][_0xfb3b('0xe')]===0x1f4){logger[_0xfb3b('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3752da,_0x5e3a3b[_0xfb3b('0xd')][_0xfb3b('0xf')]);return _0x105cfd(_0x5e3a3b['error']['message']);}logger[_0xfb3b('0xd')](_0xfb3b('0x10'),_0x3752da,_0x5e3a3b[_0xfb3b('0xd')][_0xfb3b('0xf')]);return _0x17afff(_0x5e3a3b[_0xfb3b('0xd')][_0xfb3b('0xf')]);}else{logger[_0xfb3b('0x9')](_0xfb3b('0x10'),_0x3752da,_0xfb3b('0xa'));_0x17afff(_0x5e3a3b[_0xfb3b('0x11')][_0xfb3b('0xf')]);}})['catch'](function(_0x4b8695){logger[_0xfb3b('0xd')](_0xfb3b('0x10'),_0x3752da,_0x4b8695);_0x105cfd(_0x4b8695);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 06a820a..9d9765a 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 _0x26ea=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','post','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x247090,_0x15a925){var _0x3b824b=function(_0x55d70a){while(--_0x55d70a){_0x247090['push'](_0x247090['shift']());}};_0x3b824b(++_0x15a925);}(_0x26ea,0x123));var _0xa26e=function(_0x5a80d0,_0x15c5a7){_0x5a80d0=_0x5a80d0-0x0;var _0x425502=_0x26ea[_0x5a80d0];return _0x425502;};'use strict';var multer=require(_0xa26e('0x0'));var util=require(_0xa26e('0x1'));var path=require('path');var timeout=require(_0xa26e('0x2'));var express=require(_0xa26e('0x3'));var router=express[_0xa26e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa26e('0x5'));var interaction=require(_0xa26e('0x6'));var config=require(_0xa26e('0x7'));var controller=require(_0xa26e('0x8'));router['get']('/',auth[_0xa26e('0x9')](),controller['index']);router[_0xa26e('0xa')](_0xa26e('0xb'),auth[_0xa26e('0x9')](),controller[_0xa26e('0xc')]);router['get'](_0xa26e('0xd'),auth[_0xa26e('0x9')](),controller[_0xa26e('0xe')]);router['get'](_0xa26e('0xf'),auth[_0xa26e('0x9')](),controller['run']);router[_0xa26e('0xa')]('/:id/query',auth[_0xa26e('0x9')](),controller['query']);router[_0xa26e('0x10')]('/',auth[_0xa26e('0x9')](),controller['create']);router['put'](_0xa26e('0xb'),auth['isAuthenticated'](),controller[_0xa26e('0x11')]);router[_0xa26e('0x12')]('/:id',auth[_0xa26e('0x9')](),controller[_0xa26e('0x13')]);module[_0xa26e('0x14')]=router; \ No newline at end of file +var _0x4044=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','destroy','path','connect-timeout','express','Router','fs-extra'];(function(_0x19d4c4,_0xc43826){var _0xfbd70b=function(_0x1e970f){while(--_0x1e970f){_0x19d4c4['push'](_0x19d4c4['shift']());}};_0xfbd70b(++_0xc43826);}(_0x4044,0x85));var _0x4404=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4044[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4404('0x0'));var timeout=require(_0x4404('0x1'));var express=require(_0x4404('0x2'));var router=express[_0x4404('0x3')]();var fs_extra=require(_0x4404('0x4'));var auth=require(_0x4404('0x5'));var interaction=require(_0x4404('0x6'));var config=require(_0x4404('0x7'));var controller=require(_0x4404('0x8'));router[_0x4404('0x9')]('/',auth['isAuthenticated'](),controller[_0x4404('0xa')]);router['get'](_0x4404('0xb'),auth[_0x4404('0xc')](),controller['show']);router[_0x4404('0x9')](_0x4404('0xd'),auth[_0x4404('0xc')](),controller[_0x4404('0xe')]);router['get'](_0x4404('0xf'),auth['isAuthenticated'](),controller[_0x4404('0x10')]);router[_0x4404('0x9')](_0x4404('0x11'),auth['isAuthenticated'](),controller[_0x4404('0x12')]);router[_0x4404('0x13')]('/',auth[_0x4404('0xc')](),controller[_0x4404('0x14')]);router[_0x4404('0x15')](_0x4404('0xb'),auth[_0x4404('0xc')](),controller['update']);router['delete'](_0x4404('0xb'),auth[_0x4404('0xc')](),controller[_0x4404('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5c9e1e2..72e5ed9 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 _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0xf2ca[_0x507965];return _0x3608fc;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x144ce4,_0x1c3e3c){_0x144ce4=_0x144ce4-0x0;var _0x16d2cb=_0x8ef6[_0x144ce4];return _0x16d2cb;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0bf738d..2bf9cf6 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x375bc4,_0x3cdab5){var _0x1b7fcd=function(_0x32b5ea){while(--_0x32b5ea){_0x375bc4['push'](_0x375bc4['shift']());}};_0x1b7fcd(++_0x3cdab5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x5fc3[_0x22431e];return _0xd978e9;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6d38[_0x3ab9ee];return _0x82ee88;};'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 diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5d949ba..28fd837 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 _0x9fcc=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9fcc,0xc6));var _0xc9fc=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9fcc[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xc9fc('0x0'));var util=require(_0xc9fc('0x1'));var logger=require('../../config/logger')(_0xc9fc('0x2'));var moment=require(_0xc9fc('0x3'));var BPromise=require(_0xc9fc('0x4'));var rp=require(_0xc9fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9fc('0x6'));var config=require(_0xc9fc('0x7'));var attributes=require(_0xc9fc('0x8'));module['exports']=function(_0x43df25,_0x14070b){return _0x43df25[_0xc9fc('0x9')](_0xc9fc('0xa'),attributes,{'tableName':_0xc9fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50bc=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','moment','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x197278,_0x58da69){var _0x4bbdbe=function(_0x5103d0){while(--_0x5103d0){_0x197278['push'](_0x197278['shift']());}};_0x4bbdbe(++_0x58da69);}(_0x50bc,0xdf));var _0xc50b=function(_0x46e3b8,_0x551a29){_0x46e3b8=_0x46e3b8-0x0;var _0x528812=_0x50bc[_0x46e3b8];return _0x528812;};'use strict';var _=require(_0xc50b('0x0'));var util=require(_0xc50b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc50b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc50b('0x3'));var config=require(_0xc50b('0x4'));var attributes=require(_0xc50b('0x5'));module[_0xc50b('0x6')]=function(_0x4cdfe3,_0x1267af){return _0x4cdfe3[_0xc50b('0x7')](_0xc50b('0x8'),attributes,{'tableName':_0xc50b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index e996de7..7667931 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 _0x4f9d=['rpc','../../config/environment','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x4f9d,0x149));var _0xd4f9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4f9d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd4f9('0x0'));var util=require(_0xd4f9('0x1'));var moment=require('moment');var BPromise=require(_0xd4f9('0x2'));var rs=require(_0xd4f9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4f9('0x4'))['db'];var utils=require(_0xd4f9('0x5'));var logger=require(_0xd4f9('0x6'))(_0xd4f9('0x7'));var config=require(_0xd4f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd4f9('0x9')][_0xd4f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249574,_0xe0509c,_0x282cdc){return new BPromise(function(_0x3a0001,_0x56831a){return client[_0xd4f9('0xb')](_0x249574,_0x282cdc)[_0xd4f9('0xc')](function(_0x3c1b40){logger['info'](_0xd4f9('0xd'),_0xe0509c,_0xd4f9('0xe'));logger['debug'](_0xd4f9('0xf'),_0xe0509c,'request\x20sent',JSON[_0xd4f9('0x10')](_0x3c1b40));if(_0x3c1b40[_0xd4f9('0x11')]){if(_0x3c1b40['error']['code']===0x1f4){logger[_0xd4f9('0x11')](_0xd4f9('0xd'),_0xe0509c,_0x3c1b40[_0xd4f9('0x11')]['message']);return _0x56831a(_0x3c1b40['error'][_0xd4f9('0x12')]);}logger[_0xd4f9('0x11')](_0xd4f9('0xd'),_0xe0509c,_0x3c1b40[_0xd4f9('0x11')]['message']);return _0x3a0001(_0x3c1b40[_0xd4f9('0x11')][_0xd4f9('0x12')]);}else{logger[_0xd4f9('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe0509c,_0xd4f9('0xe'));_0x3a0001(_0x3c1b40['result']['message']);}})[_0xd4f9('0x14')](function(_0xd83f77){logger['error'](_0xd4f9('0xd'),_0xe0509c,_0xd83f77);_0x56831a(_0xd83f77);});});} \ No newline at end of file +var _0xb0bd=['../../config/environment','client','request','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x23c038,_0x5c18fe){var _0x23cfe2=function(_0x47d5a5){while(--_0x47d5a5){_0x23c038['push'](_0x23c038['shift']());}};_0x23cfe2(++_0x5c18fe);}(_0xb0bd,0x1ec));var _0xdb0b=function(_0x43f00b,_0x27f6a2){_0x43f00b=_0x43f00b-0x0;var _0x577a91=_0xb0bd[_0x43f00b];return _0x577a91;};'use strict';var _=require(_0xdb0b('0x0'));var util=require(_0xdb0b('0x1'));var moment=require('moment');var BPromise=require(_0xdb0b('0x2'));var rs=require(_0xdb0b('0x3'));var fs=require('fs');var Redis=require(_0xdb0b('0x4'));var db=require(_0xdb0b('0x5'))['db'];var utils=require(_0xdb0b('0x6'));var logger=require('../../config/logger')(_0xdb0b('0x7'));var config=require(_0xdb0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1b28,_0xf154b2,_0x29224c){return new BPromise(function(_0x4d02c6,_0x16dfa3){return client[_0xdb0b('0xa')](_0x5c1b28,_0x29224c)[_0xdb0b('0xb')](function(_0x5f0d03){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0xf154b2,_0xdb0b('0xc'));logger[_0xdb0b('0xd')](_0xdb0b('0xe'),_0xf154b2,'request\x20sent',JSON[_0xdb0b('0xf')](_0x5f0d03));if(_0x5f0d03[_0xdb0b('0x10')]){if(_0x5f0d03['error'][_0xdb0b('0x11')]===0x1f4){logger[_0xdb0b('0x10')](_0xdb0b('0x12'),_0xf154b2,_0x5f0d03[_0xdb0b('0x10')][_0xdb0b('0x13')]);return _0x16dfa3(_0x5f0d03[_0xdb0b('0x10')][_0xdb0b('0x13')]);}logger[_0xdb0b('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xf154b2,_0x5f0d03[_0xdb0b('0x10')][_0xdb0b('0x13')]);return _0x4d02c6(_0x5f0d03[_0xdb0b('0x10')][_0xdb0b('0x13')]);}else{logger['info'](_0xdb0b('0x12'),_0xf154b2,_0xdb0b('0xc'));_0x4d02c6(_0x5f0d03['result'][_0xdb0b('0x13')]);}})['catch'](function(_0x455ebb){logger[_0xdb0b('0x10')](_0xdb0b('0x12'),_0xf154b2,_0x455ebb);_0x16dfa3(_0x455ebb);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index ebd7eb4..040d0e3 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 _0x2554=['get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x27ac58,_0x475d58){var _0x591974=function(_0x554c71){while(--_0x554c71){_0x27ac58['push'](_0x27ac58['shift']());}};_0x591974(++_0x475d58);}(_0x2554,0xfb));var _0x4255=function(_0x5b7c5d,_0x442955){_0x5b7c5d=_0x5b7c5d-0x0;var _0x191dd7=_0x2554[_0x5b7c5d];return _0x191dd7;};'use strict';var multer=require(_0x4255('0x0'));var util=require(_0x4255('0x1'));var path=require(_0x4255('0x2'));var timeout=require(_0x4255('0x3'));var express=require(_0x4255('0x4'));var router=express[_0x4255('0x5')]();var fs_extra=require(_0x4255('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4255('0x7'));var config=require(_0x4255('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x4255('0x9')]('/',auth[_0x4255('0xa')](),controller['index']);router[_0x4255('0x9')](_0x4255('0xb'),auth['isAuthenticated'](),controller[_0x4255('0xc')]);router[_0x4255('0x9')](_0x4255('0xd'),auth[_0x4255('0xa')](),controller[_0x4255('0xe')]);router['get'](_0x4255('0xf'),auth[_0x4255('0xa')](),controller[_0x4255('0x10')]);router[_0x4255('0x9')](_0x4255('0x11'),auth['isAuthenticated'](),controller[_0x4255('0x12')]);router[_0x4255('0x13')]('/',auth['isAuthenticated'](),controller[_0x4255('0x14')]);router[_0x4255('0x15')](_0x4255('0xb'),auth[_0x4255('0xa')](),controller[_0x4255('0x16')]);router[_0x4255('0x17')](_0x4255('0xb'),auth['isAuthenticated'](),controller[_0x4255('0x18')]);module[_0x4255('0x19')]=router; \ No newline at end of file +var _0x273b=['run','/:id/query','query','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x273b,0xb8));var _0xb273=function(_0x36d4e6,_0x2e1e91){_0x36d4e6=_0x36d4e6-0x0;var _0xccb596=_0x273b[_0x36d4e6];return _0xccb596;};'use strict';var multer=require('multer');var util=require(_0xb273('0x0'));var path=require(_0xb273('0x1'));var timeout=require(_0xb273('0x2'));var express=require('express');var router=express[_0xb273('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb273('0x4'));var interaction=require(_0xb273('0x5'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xb273('0x6')]('/',auth[_0xb273('0x7')](),controller[_0xb273('0x8')]);router[_0xb273('0x6')](_0xb273('0x9'),auth[_0xb273('0x7')](),controller[_0xb273('0xa')]);router[_0xb273('0x6')](_0xb273('0xb'),auth[_0xb273('0x7')](),controller[_0xb273('0xc')]);router[_0xb273('0x6')](_0xb273('0xd'),auth[_0xb273('0x7')](),controller[_0xb273('0xe')]);router[_0xb273('0x6')](_0xb273('0xf'),auth[_0xb273('0x7')](),controller[_0xb273('0x10')]);router['post']('/',auth[_0xb273('0x7')](),controller[_0xb273('0x11')]);router[_0xb273('0x12')](_0xb273('0x9'),auth[_0xb273('0x7')](),controller[_0xb273('0x13')]);router['delete'](_0xb273('0x9'),auth[_0xb273('0x7')](),controller[_0xb273('0x14')]);module[_0xb273('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0ad31f5..177efe6 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 _0x59e1=['ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x2986f9,_0x2cf971){var _0x13cde9=function(_0x2868d7){while(--_0x2868d7){_0x2986f9['push'](_0x2986f9['shift']());}};_0x13cde9(++_0x2cf971);}(_0x59e1,0xa5));var _0x159e=function(_0x3f8f01,_0x1603c2){_0x3f8f01=_0x3f8f01-0x0;var _0xb825cf=_0x59e1[_0x3f8f01];return _0xb825cf;};'use strict';var Sequelize=require(_0x159e('0x0'));var moment=require(_0x159e('0x1'));module[_0x159e('0x2')]={'name':{'type':Sequelize[_0x159e('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x159e('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x159e('0x4')](_0x159e('0x5'),_0x159e('0x6'),_0x159e('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x159e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x159e('0x8')]},'endDate':{'type':Sequelize[_0x159e('0x8')]},'status':{'type':Sequelize[_0x159e('0x3')],'defaultValue':_0x159e('0x9')},'type':{'type':Sequelize['ENUM'](_0x159e('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x159e('0xa')},'reportId':{'type':Sequelize[_0x159e('0xb')](0xb)[_0x159e('0xc')]},'reportType':{'type':Sequelize[_0x159e('0x3')]}}; \ No newline at end of file +var _0xc449=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xc449,0x81));var _0x9c44=function(_0x31ebc6,_0x51c1a9){_0x31ebc6=_0x31ebc6-0x0;var _0x27baca=_0xc449[_0x31ebc6];return _0x27baca;};'use strict';var Sequelize=require(_0x9c44('0x0'));var moment=require(_0x9c44('0x1'));module[_0x9c44('0x2')]={'name':{'type':Sequelize[_0x9c44('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9c44('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x9c44('0x4')](_0x9c44('0x5'),_0x9c44('0x6'),_0x9c44('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x9c44('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9c44('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x9c44('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x9c44('0x9'),_0x9c44('0xa')),'allowNull':![],'defaultValue':_0x9c44('0x9')},'reportId':{'type':Sequelize[_0x9c44('0xb')](0xb)[_0x9c44('0xc')]},'reportType':{'type':Sequelize[_0x9c44('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7c5ffcf..0f5c19f 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 _0x4684=['rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','update','body','download','basename','savename','output','existsSync','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','toLowerCase','eml-format'];(function(_0x45dbab,_0x37bb50){var _0x15ca6d=function(_0x19181d){while(--_0x19181d){_0x45dbab['push'](_0x45dbab['shift']());}};_0x15ca6d(++_0x37bb50);}(_0x4684,0xb9));var _0x4468=function(_0x121d9e,_0x11b966){_0x121d9e=_0x121d9e-0x0;var _0x5df466=_0x4684[_0x121d9e];return _0x5df466;};'use strict';var emlformat=require(_0x4468('0x0'));var rimraf=require(_0x4468('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4468('0x2'));var moment=require(_0x4468('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4468('0x4'));var path=require(_0x4468('0x5'));var sox=require(_0x4468('0x6'));var csv=require(_0x4468('0x7'));var ejs=require(_0x4468('0x8'));var fs=require('fs');var fs_extra=require(_0x4468('0x9'));var _=require(_0x4468('0xa'));var squel=require(_0x4468('0xb'));var crypto=require(_0x4468('0xc'));var jsforce=require(_0x4468('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4468('0x7'));var querystring=require(_0x4468('0xe'));var Papa=require(_0x4468('0xf'));var Redis=require(_0x4468('0x10'));var authService=require(_0x4468('0x11'));var qs=require(_0x4468('0x12'));var as=require(_0x4468('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4468('0x14'));var utils=require(_0x4468('0x15'));var config=require(_0x4468('0x16'));var licenseUtil=require(_0x4468('0x17'));var db=require(_0x4468('0x18'))['db'];function respondWithStatusCode(_0x361955,_0x154fc0){_0x154fc0=_0x154fc0||0xcc;return function(_0x200ed6){if(_0x200ed6){return _0x361955[_0x4468('0x19')](_0x154fc0);}return _0x361955[_0x4468('0x1a')](_0x154fc0)['end']();};}function respondWithResult(_0x1a20d0,_0xa91e14){_0xa91e14=_0xa91e14||0xc8;return function(_0x1fdea2){if(_0x1fdea2){return _0x1a20d0[_0x4468('0x1a')](_0xa91e14)['json'](_0x1fdea2);}};}function respondWithFilteredResult(_0x3fa018,_0x3e41a9){return function(_0x5a20a0){if(_0x5a20a0){var _0x21016e=typeof _0x3e41a9[_0x4468('0x1b')]===_0x4468('0x1c')&&typeof _0x3e41a9['limit']===_0x4468('0x1c');var _0x23e4a5=_0x5a20a0[_0x4468('0x1d')];var _0x5b27f1=_0x21016e?0x0:_0x3e41a9['offset'];var _0x2fe625=_0x21016e?_0x5a20a0[_0x4468('0x1d')]:_0x3e41a9['offset']+_0x3e41a9[_0x4468('0x1e')];var _0x5bbb27;if(_0x2fe625>=_0x23e4a5){_0x2fe625=_0x23e4a5;_0x5bbb27=0xc8;}else{_0x5bbb27=0xce;}_0x3fa018['status'](_0x5bbb27);return _0x3fa018[_0x4468('0x1f')](_0x4468('0x20'),_0x5b27f1+'-'+_0x2fe625+'/'+_0x23e4a5)['json'](_0x5a20a0);}return null;};}function patchUpdates(_0x5e1acb){return function(_0x56e20d){try{jsonpatch['apply'](_0x56e20d,_0x5e1acb,!![]);}catch(_0x30f207){return BPromise['reject'](_0x30f207);}return _0x56e20d[_0x4468('0x21')]();};}function saveUpdates(_0x1fd6d9,_0xdd03a3){return function(_0x1f259a){if(_0x1f259a){return _0x1f259a['update'](_0x1fd6d9)[_0x4468('0x22')](function(_0x5f578f){return _0x5f578f;});}return null;};}function removeEntity(_0x4cd194,_0xadf95d){return function(_0x2c1b87){if(_0x2c1b87){return _0x2c1b87[_0x4468('0x23')]()['then'](function(){var _0x3026b4=_0x2c1b87[_0x4468('0x24')]({'plain':!![]});var _0x3c3667=_0x4468('0x25');return db[_0x4468('0x26')][_0x4468('0x23')]({'where':{'type':_0x3c3667,'resourceId':_0x3026b4['id']}})[_0x4468('0x22')](function(){return _0x2c1b87;});})[_0x4468('0x22')](function(){_0x4cd194[_0x4468('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40e310,_0x572622){return function(_0x269cd8){if(!_0x269cd8){_0x40e310[_0x4468('0x19')](0x194);}return _0x269cd8;};}function handleError(_0x17ceed,_0x132735){_0x132735=_0x132735||0x1f4;return function(_0x1c7e5e){logger[_0x4468('0x27')](_0x1c7e5e[_0x4468('0x28')]);if(_0x1c7e5e['name']){delete _0x1c7e5e[_0x4468('0x29')];}_0x17ceed[_0x4468('0x1a')](_0x132735)[_0x4468('0x2a')](_0x1c7e5e);};}exports[_0x4468('0x2b')]=function(_0x33bdcd,_0x14320d){var _0x31517b={},_0x5c6690={},_0x15b2cf={'count':0x0,'rows':[]};var _0x50549b=_[_0x4468('0x2c')](db[_0x4468('0x2d')]['rawAttributes'],function(_0x2325fb){return{'name':_0x2325fb[_0x4468('0x2e')],'type':_0x2325fb['type'][_0x4468('0x2f')]};});_0x5c6690[_0x4468('0x30')]=_['map'](_0x50549b,_0x4468('0x29'));_0x5c6690[_0x4468('0x31')]=_['keys'](_0x33bdcd[_0x4468('0x31')]);_0x5c6690['filters']=_[_0x4468('0x32')](_0x5c6690[_0x4468('0x30')],_0x5c6690[_0x4468('0x31')]);_0x31517b[_0x4468('0x33')]=_[_0x4468('0x32')](_0x5c6690[_0x4468('0x30')],qs[_0x4468('0x34')](_0x33bdcd[_0x4468('0x31')][_0x4468('0x34')]));_0x31517b['attributes']=_0x31517b['attributes'][_0x4468('0x35')]?_0x31517b[_0x4468('0x33')]:_0x5c6690['model'];if(!_0x33bdcd['query']['hasOwnProperty']('nolimit')){_0x31517b[_0x4468('0x1e')]=qs[_0x4468('0x1e')](_0x33bdcd[_0x4468('0x31')][_0x4468('0x1e')]);_0x31517b[_0x4468('0x1b')]=qs['offset'](_0x33bdcd[_0x4468('0x31')]['offset']);}_0x31517b[_0x4468('0x36')]=qs['sort'](_0x33bdcd[_0x4468('0x31')][_0x4468('0x37')]);_0x31517b[_0x4468('0x38')]=qs[_0x4468('0x39')](_['pick'](_0x33bdcd[_0x4468('0x31')],_0x5c6690[_0x4468('0x39')]),_0x50549b);if(_0x33bdcd['query']['filter']){_0x31517b[_0x4468('0x38')]=_['merge'](_0x31517b[_0x4468('0x38')],{'$or':_[_0x4468('0x2c')](_0x50549b,function(_0x30d511){if(_0x30d511[_0x4468('0x3a')]!==_0x4468('0x3b')){var _0xdaf48e={};_0xdaf48e[_0x30d511[_0x4468('0x29')]]={'$like':'%'+_0x33bdcd[_0x4468('0x31')]['filter']+'%'};return _0xdaf48e;}})});}_0x31517b=_['merge']({},_0x31517b,_0x33bdcd[_0x4468('0x3c')]);var _0x2e922b={'where':_0x31517b[_0x4468('0x38')]};return db[_0x4468('0x2d')]['count'](_0x2e922b)[_0x4468('0x22')](function(_0x1d9bcc){_0x15b2cf['count']=_0x1d9bcc;if(_0x33bdcd[_0x4468('0x31')][_0x4468('0x3d')]){_0x31517b[_0x4468('0x3e')]=[{'all':!![]}];}return db[_0x4468('0x2d')][_0x4468('0x3f')](_0x31517b);})[_0x4468('0x22')](function(_0x14084e){_0x15b2cf[_0x4468('0x40')]=_0x14084e;return _0x15b2cf;})['then'](respondWithFilteredResult(_0x14320d,_0x31517b))[_0x4468('0x41')](handleError(_0x14320d,null));};exports[_0x4468('0x42')]=function(_0x2ff1ee,_0x552ab0){var _0x4a40f8={'raw':!![],'where':{'id':_0x2ff1ee[_0x4468('0x43')]['id']}},_0x91ef15={};_0x91ef15[_0x4468('0x30')]=_[_0x4468('0x44')](db['AnalyticExtractedReport'][_0x4468('0x45')]);_0x91ef15[_0x4468('0x31')]=_[_0x4468('0x44')](_0x2ff1ee[_0x4468('0x31')]);_0x91ef15[_0x4468('0x39')]=_[_0x4468('0x32')](_0x91ef15[_0x4468('0x30')],_0x91ef15['query']);_0x4a40f8['attributes']=_[_0x4468('0x32')](_0x91ef15[_0x4468('0x30')],qs[_0x4468('0x34')](_0x2ff1ee['query']['fields']));_0x4a40f8[_0x4468('0x33')]=_0x4a40f8[_0x4468('0x33')][_0x4468('0x35')]?_0x4a40f8[_0x4468('0x33')]:_0x91ef15[_0x4468('0x30')];if(_0x2ff1ee[_0x4468('0x31')][_0x4468('0x3d')]){_0x4a40f8[_0x4468('0x3e')]=[{'all':!![]}];}_0x4a40f8=_[_0x4468('0x46')]({},_0x4a40f8,_0x2ff1ee[_0x4468('0x3c')]);return db[_0x4468('0x2d')][_0x4468('0x47')](_0x4a40f8)[_0x4468('0x22')](handleEntityNotFound(_0x552ab0,null))[_0x4468('0x22')](respondWithResult(_0x552ab0,null))[_0x4468('0x41')](handleError(_0x552ab0,null));};exports[_0x4468('0x48')]=function(_0x50e4ee,_0x1a2a0b){return db[_0x4468('0x2d')]['create'](_0x50e4ee['body'],{})[_0x4468('0x22')](function(_0x3ade26){var _0x2b747f=_0x50e4ee['user'][_0x4468('0x24')]({'plain':!![]});if(!_0x2b747f)throw new Error(_0x4468('0x49'));if(_0x2b747f['role']===_0x4468('0x4a')){var _0x2e755b=_0x3ade26['get']({'plain':!![]});var _0x4be420=_0x4468('0x25');return db[_0x4468('0x4b')][_0x4468('0x47')]({'where':{'name':_0x4be420,'userProfileId':_0x2b747f['userProfileId']},'raw':!![]})['then'](function(_0x57f567){if(_0x57f567&&_0x57f567[_0x4468('0x4c')]===0x0){return db[_0x4468('0x26')]['create']({'name':_0x2e755b[_0x4468('0x29')],'resourceId':_0x2e755b['id'],'type':_0x57f567['name'],'sectionId':_0x57f567['id']},{})[_0x4468('0x22')](function(){return _0x3ade26;});}else{return _0x3ade26;}})[_0x4468('0x41')](function(_0x45a25c){logger[_0x4468('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45a25c);throw _0x45a25c;});}return _0x3ade26;})[_0x4468('0x22')](respondWithResult(_0x1a2a0b,0xc9))[_0x4468('0x41')](handleError(_0x1a2a0b,null));};exports[_0x4468('0x4d')]=function(_0x353e6c,_0x5ace41){if(_0x353e6c['body']['id']){delete _0x353e6c[_0x4468('0x4e')]['id'];}return db[_0x4468('0x2d')][_0x4468('0x47')]({'where':{'id':_0x353e6c[_0x4468('0x43')]['id']}})[_0x4468('0x22')](handleEntityNotFound(_0x5ace41,null))['then'](saveUpdates(_0x353e6c['body'],null))['then'](respondWithResult(_0x5ace41,null))[_0x4468('0x41')](handleError(_0x5ace41,null));};exports['destroy']=function(_0xc8db99,_0xf77e47){return db[_0x4468('0x2d')]['find']({'where':{'id':_0xc8db99[_0x4468('0x43')]['id']}})[_0x4468('0x22')](handleEntityNotFound(_0xf77e47,null))[_0x4468('0x22')](removeEntity(_0xf77e47,null))[_0x4468('0x41')](handleError(_0xf77e47,null));};exports[_0x4468('0x4f')]=function(_0x35e7a0,_0x5c5d75,_0x574827){return db['AnalyticExtractedReport'][_0x4468('0x47')]({'where':{'id':_0x35e7a0['params']['id']},'attributes':['name',_0x4468('0x50'),_0x4468('0x51'),_0x4468('0x52')],'raw':!![]})[_0x4468('0x22')](handleEntityNotFound(_0x5c5d75,null))[_0x4468('0x22')](function(_0x545b14){if(_0x545b14){if(!fs[_0x4468('0x53')](path['join'](config[_0x4468('0x54')],'server/files/reports',_0x545b14['savename']))){throw new db[(_0x4468('0x55'))][(_0x4468('0x56'))](_0x4468('0x57'));}if(_0x35e7a0[_0x4468('0x31')][_0x4468('0x58')]){return _0x5c5d75['sendStatus'](0xc8);}return _0x5c5d75[_0x4468('0x4f')](path[_0x4468('0x59')](config['root'],'server/files/reports',_0x545b14['savename']),util[_0x4468('0x5a')](_0x4468('0x5b'),_0x545b14['basename']||_0x545b14['name'],_0x545b14[_0x4468('0x52')][_0x4468('0x5c')]()));}})['catch'](handleError(_0x5c5d75,null));}; \ No newline at end of file +var _0x0f2e=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x1e4f12,_0x26b86d){var _0x214e9f=function(_0x4f722e){while(--_0x4f722e){_0x1e4f12['push'](_0x1e4f12['shift']());}};_0x214e9f(++_0x26b86d);}(_0x0f2e,0x1a1));var _0xe0f2=function(_0x257e65,_0x3f4a68){_0x257e65=_0x257e65-0x0;var _0x3eef2f=_0x0f2e[_0x257e65];return _0x3eef2f;};'use strict';var emlformat=require(_0xe0f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0f2('0x1'));var jsonpatch=require(_0xe0f2('0x2'));var rp=require('request-promise');var moment=require(_0xe0f2('0x3'));var BPromise=require(_0xe0f2('0x4'));var Mustache=require(_0xe0f2('0x5'));var util=require(_0xe0f2('0x6'));var path=require(_0xe0f2('0x7'));var sox=require(_0xe0f2('0x8'));var csv=require(_0xe0f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0f2('0xa'));var _=require(_0xe0f2('0xb'));var squel=require('squel');var crypto=require(_0xe0f2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe0f2('0xd'));var Papa=require(_0xe0f2('0xe'));var Redis=require(_0xe0f2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe0f2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0f2('0x11'))(_0xe0f2('0x12'));var utils=require(_0xe0f2('0x13'));var config=require(_0xe0f2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0f2('0x15'))['db'];function respondWithStatusCode(_0x2af6c9,_0x1e8bd5){_0x1e8bd5=_0x1e8bd5||0xcc;return function(_0x55889e){if(_0x55889e){return _0x2af6c9[_0xe0f2('0x16')](_0x1e8bd5);}return _0x2af6c9['status'](_0x1e8bd5)[_0xe0f2('0x17')]();};}function respondWithResult(_0x2c0631,_0x20efbb){_0x20efbb=_0x20efbb||0xc8;return function(_0x1aa648){if(_0x1aa648){return _0x2c0631[_0xe0f2('0x18')](_0x20efbb)[_0xe0f2('0x19')](_0x1aa648);}};}function respondWithFilteredResult(_0x1d0597,_0x5ce536){return function(_0x1ae5f9){if(_0x1ae5f9){var _0x522c34=typeof _0x5ce536[_0xe0f2('0x1a')]==='undefined'&&typeof _0x5ce536[_0xe0f2('0x1b')]===_0xe0f2('0x1c');var _0x48457c=_0x1ae5f9[_0xe0f2('0x1d')];var _0x18f15c=_0x522c34?0x0:_0x5ce536[_0xe0f2('0x1a')];var _0x5b4c43=_0x522c34?_0x1ae5f9['count']:_0x5ce536[_0xe0f2('0x1a')]+_0x5ce536[_0xe0f2('0x1b')];var _0x1cd786;if(_0x5b4c43>=_0x48457c){_0x5b4c43=_0x48457c;_0x1cd786=0xc8;}else{_0x1cd786=0xce;}_0x1d0597[_0xe0f2('0x18')](_0x1cd786);return _0x1d0597['set'](_0xe0f2('0x1e'),_0x18f15c+'-'+_0x5b4c43+'/'+_0x48457c)[_0xe0f2('0x19')](_0x1ae5f9);}return null;};}function patchUpdates(_0x4e050f){return function(_0x5f5a9d){try{jsonpatch[_0xe0f2('0x1f')](_0x5f5a9d,_0x4e050f,!![]);}catch(_0x348232){return BPromise[_0xe0f2('0x20')](_0x348232);}return _0x5f5a9d[_0xe0f2('0x21')]();};}function saveUpdates(_0xd4d7c0,_0x188254){return function(_0x435442){if(_0x435442){return _0x435442['update'](_0xd4d7c0)[_0xe0f2('0x22')](function(_0x36085b){return _0x36085b;});}return null;};}function removeEntity(_0x3ae322,_0x50009d){return function(_0x541fce){if(_0x541fce){return _0x541fce['destroy']()[_0xe0f2('0x22')](function(){var _0x20c8b5=_0x541fce[_0xe0f2('0x23')]({'plain':!![]});var _0x32daa0=_0xe0f2('0x24');return db[_0xe0f2('0x25')][_0xe0f2('0x26')]({'where':{'type':_0x32daa0,'resourceId':_0x20c8b5['id']}})[_0xe0f2('0x22')](function(){return _0x541fce;});})[_0xe0f2('0x22')](function(){_0x3ae322[_0xe0f2('0x18')](0xcc)[_0xe0f2('0x17')]();});}};}function handleEntityNotFound(_0x5f2085,_0x31c13e){return function(_0x20d170){if(!_0x20d170){_0x5f2085['sendStatus'](0x194);}return _0x20d170;};}function handleError(_0x1e58e8,_0x40ecf0){_0x40ecf0=_0x40ecf0||0x1f4;return function(_0x1291ff){logger['error'](_0x1291ff[_0xe0f2('0x27')]);if(_0x1291ff[_0xe0f2('0x28')]){delete _0x1291ff['name'];}_0x1e58e8['status'](_0x40ecf0)[_0xe0f2('0x29')](_0x1291ff);};}exports[_0xe0f2('0x2a')]=function(_0x37f327,_0x2846f3){var _0x57dfad={},_0x4fe840={},_0x9246da={'count':0x0,'rows':[]};var _0x2b9aa0=_['map'](db[_0xe0f2('0x2b')][_0xe0f2('0x2c')],function(_0x6baac9){return{'name':_0x6baac9[_0xe0f2('0x2d')],'type':_0x6baac9[_0xe0f2('0x2e')]['key']};});_0x4fe840[_0xe0f2('0x2f')]=_['map'](_0x2b9aa0,_0xe0f2('0x28'));_0x4fe840[_0xe0f2('0x30')]=_[_0xe0f2('0x31')](_0x37f327[_0xe0f2('0x30')]);_0x4fe840[_0xe0f2('0x32')]=_[_0xe0f2('0x33')](_0x4fe840[_0xe0f2('0x2f')],_0x4fe840[_0xe0f2('0x30')]);_0x57dfad[_0xe0f2('0x34')]=_[_0xe0f2('0x33')](_0x4fe840[_0xe0f2('0x2f')],qs['fields'](_0x37f327[_0xe0f2('0x30')][_0xe0f2('0x35')]));_0x57dfad[_0xe0f2('0x34')]=_0x57dfad[_0xe0f2('0x34')]['length']?_0x57dfad[_0xe0f2('0x34')]:_0x4fe840[_0xe0f2('0x2f')];if(!_0x37f327[_0xe0f2('0x30')][_0xe0f2('0x36')](_0xe0f2('0x37'))){_0x57dfad['limit']=qs[_0xe0f2('0x1b')](_0x37f327['query']['limit']);_0x57dfad[_0xe0f2('0x1a')]=qs[_0xe0f2('0x1a')](_0x37f327[_0xe0f2('0x30')]['offset']);}_0x57dfad[_0xe0f2('0x38')]=qs['sort'](_0x37f327[_0xe0f2('0x30')][_0xe0f2('0x39')]);_0x57dfad[_0xe0f2('0x3a')]=qs[_0xe0f2('0x32')](_[_0xe0f2('0x3b')](_0x37f327['query'],_0x4fe840[_0xe0f2('0x32')]),_0x2b9aa0);if(_0x37f327[_0xe0f2('0x30')][_0xe0f2('0x3c')]){_0x57dfad[_0xe0f2('0x3a')]=_['merge'](_0x57dfad['where'],{'$or':_[_0xe0f2('0x3d')](_0x2b9aa0,function(_0x3d0b39){if(_0x3d0b39['type']!==_0xe0f2('0x3e')){var _0x392ad1={};_0x392ad1[_0x3d0b39[_0xe0f2('0x28')]]={'$like':'%'+_0x37f327[_0xe0f2('0x30')][_0xe0f2('0x3c')]+'%'};return _0x392ad1;}})});}_0x57dfad=_[_0xe0f2('0x3f')]({},_0x57dfad,_0x37f327[_0xe0f2('0x40')]);var _0x180e0d={'where':_0x57dfad['where']};return db[_0xe0f2('0x2b')][_0xe0f2('0x1d')](_0x180e0d)[_0xe0f2('0x22')](function(_0x201b35){_0x9246da['count']=_0x201b35;if(_0x37f327[_0xe0f2('0x30')][_0xe0f2('0x41')]){_0x57dfad[_0xe0f2('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xe0f2('0x43')](_0x57dfad);})['then'](function(_0x28d345){_0x9246da[_0xe0f2('0x44')]=_0x28d345;return _0x9246da;})[_0xe0f2('0x22')](respondWithFilteredResult(_0x2846f3,_0x57dfad))[_0xe0f2('0x45')](handleError(_0x2846f3,null));};exports['show']=function(_0x385f7e,_0x4f0efc){var _0x95ed68={'raw':!![],'where':{'id':_0x385f7e[_0xe0f2('0x46')]['id']}},_0x5276cb={};_0x5276cb[_0xe0f2('0x2f')]=_[_0xe0f2('0x31')](db[_0xe0f2('0x2b')][_0xe0f2('0x2c')]);_0x5276cb[_0xe0f2('0x30')]=_['keys'](_0x385f7e[_0xe0f2('0x30')]);_0x5276cb[_0xe0f2('0x32')]=_['intersection'](_0x5276cb[_0xe0f2('0x2f')],_0x5276cb[_0xe0f2('0x30')]);_0x95ed68[_0xe0f2('0x34')]=_['intersection'](_0x5276cb[_0xe0f2('0x2f')],qs[_0xe0f2('0x35')](_0x385f7e[_0xe0f2('0x30')][_0xe0f2('0x35')]));_0x95ed68[_0xe0f2('0x34')]=_0x95ed68['attributes'][_0xe0f2('0x47')]?_0x95ed68[_0xe0f2('0x34')]:_0x5276cb[_0xe0f2('0x2f')];if(_0x385f7e[_0xe0f2('0x30')][_0xe0f2('0x41')]){_0x95ed68['include']=[{'all':!![]}];}_0x95ed68=_[_0xe0f2('0x3f')]({},_0x95ed68,_0x385f7e['options']);return db[_0xe0f2('0x2b')][_0xe0f2('0x48')](_0x95ed68)[_0xe0f2('0x22')](handleEntityNotFound(_0x4f0efc,null))[_0xe0f2('0x22')](respondWithResult(_0x4f0efc,null))['catch'](handleError(_0x4f0efc,null));};exports['create']=function(_0x555bf5,_0x1d493c){return db[_0xe0f2('0x2b')][_0xe0f2('0x49')](_0x555bf5[_0xe0f2('0x4a')],{})['then'](function(_0x90a66f){var _0x43dea4=_0x555bf5[_0xe0f2('0x4b')][_0xe0f2('0x23')]({'plain':!![]});if(!_0x43dea4)throw new Error(_0xe0f2('0x4c'));if(_0x43dea4[_0xe0f2('0x4d')]===_0xe0f2('0x4b')){var _0x3a3fe0=_0x90a66f[_0xe0f2('0x23')]({'plain':!![]});var _0x5f31c9=_0xe0f2('0x24');return db[_0xe0f2('0x4e')][_0xe0f2('0x48')]({'where':{'name':_0x5f31c9,'userProfileId':_0x43dea4['userProfileId']},'raw':!![]})[_0xe0f2('0x22')](function(_0xb8e4d6){if(_0xb8e4d6&&_0xb8e4d6['autoAssociation']===0x0){return db[_0xe0f2('0x25')][_0xe0f2('0x49')]({'name':_0x3a3fe0[_0xe0f2('0x28')],'resourceId':_0x3a3fe0['id'],'type':_0xb8e4d6['name'],'sectionId':_0xb8e4d6['id']},{})['then'](function(){return _0x90a66f;});}else{return _0x90a66f;}})[_0xe0f2('0x45')](function(_0x4d1ec7){logger[_0xe0f2('0x4f')](_0xe0f2('0x50'),_0x4d1ec7);throw _0x4d1ec7;});}return _0x90a66f;})['then'](respondWithResult(_0x1d493c,0xc9))[_0xe0f2('0x45')](handleError(_0x1d493c,null));};exports['update']=function(_0x5b141e,_0x419f6e){if(_0x5b141e[_0xe0f2('0x4a')]['id']){delete _0x5b141e[_0xe0f2('0x4a')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5b141e['params']['id']}})['then'](handleEntityNotFound(_0x419f6e,null))[_0xe0f2('0x22')](saveUpdates(_0x5b141e[_0xe0f2('0x4a')],null))[_0xe0f2('0x22')](respondWithResult(_0x419f6e,null))[_0xe0f2('0x45')](handleError(_0x419f6e,null));};exports['destroy']=function(_0x3ae0ad,_0x63772d){return db[_0xe0f2('0x2b')]['find']({'where':{'id':_0x3ae0ad['params']['id']}})['then'](handleEntityNotFound(_0x63772d,null))[_0xe0f2('0x22')](removeEntity(_0x63772d,null))[_0xe0f2('0x45')](handleError(_0x63772d,null));};exports[_0xe0f2('0x51')]=function(_0x5130eb,_0x4cbd9a,_0x25fce5){return db[_0xe0f2('0x2b')]['find']({'where':{'id':_0x5130eb[_0xe0f2('0x46')]['id']},'attributes':[_0xe0f2('0x28'),_0xe0f2('0x52'),_0xe0f2('0x53'),_0xe0f2('0x54')],'raw':!![]})[_0xe0f2('0x22')](handleEntityNotFound(_0x4cbd9a,null))['then'](function(_0x1f3846){if(_0x1f3846){if(!fs[_0xe0f2('0x55')](path[_0xe0f2('0x56')](config[_0xe0f2('0x57')],_0xe0f2('0x58'),_0x1f3846[_0xe0f2('0x53')]))){throw new db[(_0xe0f2('0x59'))]['ValidationError'](_0xe0f2('0x5a'));}if(_0x5130eb['query'][_0xe0f2('0x5b')]){return _0x4cbd9a[_0xe0f2('0x16')](0xc8);}return _0x4cbd9a['download'](path[_0xe0f2('0x56')](config['root'],_0xe0f2('0x58'),_0x1f3846[_0xe0f2('0x53')]),util[_0xe0f2('0x5c')](_0xe0f2('0x5d'),_0x1f3846[_0xe0f2('0x52')]||_0x1f3846[_0xe0f2('0x28')],_0x1f3846[_0xe0f2('0x54')]['toLowerCase']()));}})[_0xe0f2('0x45')](handleError(_0x4cbd9a,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index acbe02e..7241e35 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 _0x5917=['api','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','util','../../config/logger'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x5917,0x18e));var _0x7591=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5917[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x7591('0x0'));var logger=require(_0x7591('0x1'))(_0x7591('0x2'));var moment=require('moment');var BPromise=require(_0x7591('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7591('0x4'));var rimraf=require(_0x7591('0x5'));var config=require(_0x7591('0x6'));var attributes=require(_0x7591('0x7'));module[_0x7591('0x8')]=function(_0x66b88f,_0x15eb08){return _0x66b88f['define'](_0x7591('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b6a=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x95753a,_0x2c9f65){var _0x585b0d=function(_0x1f41b1){while(--_0x1f41b1){_0x95753a['push'](_0x95753a['shift']());}};_0x585b0d(++_0x2c9f65);}(_0x7b6a,0x1a6));var _0xa7b6=function(_0xccfcb3,_0x1e9652){_0xccfcb3=_0xccfcb3-0x0;var _0x5e4051=_0x7b6a[_0xccfcb3];return _0x5e4051;};'use strict';var _=require(_0xa7b6('0x0'));var util=require(_0xa7b6('0x1'));var logger=require('../../config/logger')(_0xa7b6('0x2'));var moment=require(_0xa7b6('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7b6('0x4'));var fs=require('fs');var path=require(_0xa7b6('0x5'));var rimraf=require(_0xa7b6('0x6'));var config=require(_0xa7b6('0x7'));var attributes=require(_0xa7b6('0x8'));module[_0xa7b6('0x9')]=function(_0x5bad9d,_0x24d32a){return _0x5bad9d[_0xa7b6('0xa')](_0xa7b6('0xb'),attributes,{'tableName':_0xa7b6('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 15672ac..22955d9 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 _0x64a9=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x31bcd4,_0x551324){var _0x50b2a3=function(_0x1c0a90){while(--_0x1c0a90){_0x31bcd4['push'](_0x31bcd4['shift']());}};_0x50b2a3(++_0x551324);}(_0x64a9,0xce));var _0x964a=function(_0x128cac,_0x5bed99){_0x128cac=_0x128cac-0x0;var _0x4bc54a=_0x64a9[_0x128cac];return _0x4bc54a;};'use strict';var _=require(_0x964a('0x0'));var util=require('util');var moment=require(_0x964a('0x1'));var BPromise=require(_0x964a('0x2'));var rs=require(_0x964a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x964a('0x4'))['db'];var utils=require(_0x964a('0x5'));var logger=require(_0x964a('0x6'))(_0x964a('0x7'));var config=require(_0x964a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x964a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x81c103,_0x2d85af,_0x1e0f52){return new BPromise(function(_0x5120b9,_0x2e0000){return client[_0x964a('0xa')](_0x81c103,_0x1e0f52)[_0x964a('0xb')](function(_0x426af9){logger[_0x964a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d85af,_0x964a('0xd'));logger[_0x964a('0xe')](_0x964a('0xf'),_0x2d85af,_0x964a('0xd'),JSON[_0x964a('0x10')](_0x426af9));if(_0x426af9[_0x964a('0x11')]){if(_0x426af9[_0x964a('0x11')][_0x964a('0x12')]===0x1f4){logger[_0x964a('0x11')](_0x964a('0x13'),_0x2d85af,_0x426af9[_0x964a('0x11')][_0x964a('0x14')]);return _0x2e0000(_0x426af9[_0x964a('0x11')][_0x964a('0x14')]);}logger[_0x964a('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d85af,_0x426af9[_0x964a('0x11')][_0x964a('0x14')]);return _0x5120b9(_0x426af9[_0x964a('0x11')][_0x964a('0x14')]);}else{logger[_0x964a('0xc')](_0x964a('0x13'),_0x2d85af,_0x964a('0xd'));_0x5120b9(_0x426af9[_0x964a('0x15')]['message']);}})['catch'](function(_0x1ef031){logger[_0x964a('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d85af,_0x1ef031);_0x2e0000(_0x1ef031);});});} \ No newline at end of file +var _0x8d58=['message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xfe4b0c,_0xe48c2){var _0x2a298a=function(_0x58b408){while(--_0x58b408){_0xfe4b0c['push'](_0xfe4b0c['shift']());}};_0x2a298a(++_0xe48c2);}(_0x8d58,0x12e));var _0x88d5=function(_0x3835de,_0x285920){_0x3835de=_0x3835de-0x0;var _0x5d82e8=_0x8d58[_0x3835de];return _0x5d82e8;};'use strict';var _=require('lodash');var util=require(_0x88d5('0x0'));var moment=require(_0x88d5('0x1'));var BPromise=require(_0x88d5('0x2'));var rs=require(_0x88d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x88d5('0x4'));var logger=require(_0x88d5('0x5'))('rpc');var config=require(_0x88d5('0x6'));var jayson=require(_0x88d5('0x7'));var client=jayson[_0x88d5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x376651,_0xd508f9,_0x3edbbd){return new BPromise(function(_0x5eb692,_0x1bc067){return client[_0x88d5('0x9')](_0x376651,_0x3edbbd)['then'](function(_0x5260ea){logger[_0x88d5('0xa')](_0x88d5('0xb'),_0xd508f9,'request\x20sent');logger[_0x88d5('0xc')](_0x88d5('0xd'),_0xd508f9,_0x88d5('0xe'),JSON[_0x88d5('0xf')](_0x5260ea));if(_0x5260ea[_0x88d5('0x10')]){if(_0x5260ea['error'][_0x88d5('0x11')]===0x1f4){logger[_0x88d5('0x10')](_0x88d5('0xb'),_0xd508f9,_0x5260ea[_0x88d5('0x10')]['message']);return _0x1bc067(_0x5260ea[_0x88d5('0x10')][_0x88d5('0x12')]);}logger[_0x88d5('0x10')](_0x88d5('0xb'),_0xd508f9,_0x5260ea[_0x88d5('0x10')]['message']);return _0x5eb692(_0x5260ea[_0x88d5('0x10')][_0x88d5('0x12')]);}else{logger[_0x88d5('0xa')](_0x88d5('0xb'),_0xd508f9,'request\x20sent');_0x5eb692(_0x5260ea[_0x88d5('0x13')][_0x88d5('0x12')]);}})['catch'](function(_0x3a3fc7){logger[_0x88d5('0x10')](_0x88d5('0xb'),_0xd508f9,_0x3a3fc7);_0x1bc067(_0x3a3fc7);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 9ae9b76..cf73601 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 _0xf870=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','put','update','destroy'];(function(_0x20215a,_0x5e25ba){var _0x51f408=function(_0x2fcfb0){while(--_0x2fcfb0){_0x20215a['push'](_0x20215a['shift']());}};_0x51f408(++_0x5e25ba);}(_0xf870,0x169));var _0x0f87=function(_0xbdbe55,_0x3f70e2){_0xbdbe55=_0xbdbe55-0x0;var _0x3e2de2=_0xf870[_0xbdbe55];return _0x3e2de2;};'use strict';var multer=require('multer');var util=require(_0x0f87('0x0'));var path=require(_0x0f87('0x1'));var timeout=require(_0x0f87('0x2'));var express=require('express');var router=express[_0x0f87('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0f87('0x4'));var interaction=require(_0x0f87('0x5'));var config=require('../../config/environment');var controller=require(_0x0f87('0x6'));router[_0x0f87('0x7')]('/',auth[_0x0f87('0x8')](),controller[_0x0f87('0x9')]);router[_0x0f87('0x7')](_0x0f87('0xa'),auth[_0x0f87('0x8')](),controller[_0x0f87('0xb')]);router[_0x0f87('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x0f87('0xc')]);router[_0x0f87('0xd')]('/',auth[_0x0f87('0x8')](),controller['create']);router[_0x0f87('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0f87('0xf')]);router['delete'](_0x0f87('0xa'),auth[_0x0f87('0x8')](),controller[_0x0f87('0x10')]);module[_0x0f87('0x11')]=router; \ No newline at end of file +var _0x3916=['../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','download','post','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x495fdc,_0x5f4863){var _0x59acc6=function(_0x8f2072){while(--_0x8f2072){_0x495fdc['push'](_0x495fdc['shift']());}};_0x59acc6(++_0x5f4863);}(_0x3916,0x1ae));var _0x6391=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x3916[_0xa60623];return _0x4a6487;};'use strict';var multer=require(_0x6391('0x0'));var util=require(_0x6391('0x1'));var path=require(_0x6391('0x2'));var timeout=require(_0x6391('0x3'));var express=require(_0x6391('0x4'));var router=express['Router']();var fs_extra=require(_0x6391('0x5'));var auth=require(_0x6391('0x6'));var interaction=require(_0x6391('0x7'));var config=require('../../config/environment');var controller=require(_0x6391('0x8'));router[_0x6391('0x9')]('/',auth['isAuthenticated'](),controller[_0x6391('0xa')]);router[_0x6391('0x9')](_0x6391('0xb'),auth[_0x6391('0xc')](),controller['show']);router[_0x6391('0x9')](_0x6391('0xd'),auth[_0x6391('0xc')](),controller[_0x6391('0xe')]);router[_0x6391('0xf')]('/',auth[_0x6391('0xc')](),controller['create']);router[_0x6391('0x10')](_0x6391('0xb'),auth[_0x6391('0xc')](),controller['update']);router[_0x6391('0x11')](_0x6391('0xb'),auth[_0x6391('0xc')](),controller['destroy']);module[_0x6391('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c4e6c37..4f66b9e 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 _0x3dc7=['STRING','exports','TEXT'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3dc7,0xdf));var _0x73dc=function(_0xb64816,_0x494c98){_0xb64816=_0xb64816-0x0;var _0x550d9b=_0x3dc7[_0xb64816];return _0x550d9b;};'use strict';var Sequelize=require('sequelize');module[_0x73dc('0x0')]={'field':{'type':Sequelize[_0x73dc('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x73dc('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x73dc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x84db=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x450fa0,_0x5b14fc){var _0x26f1fe=function(_0x522c2a){while(--_0x522c2a){_0x450fa0['push'](_0x450fa0['shift']());}};_0x26f1fe(++_0x5b14fc);}(_0x84db,0x194));var _0xb84d=function(_0x426481,_0x51d87d){_0x426481=_0x426481-0x0;var _0x2707fe=_0x84db[_0x426481];return _0x2707fe;};'use strict';var Sequelize=require(_0xb84d('0x0'));module[_0xb84d('0x1')]={'field':{'type':Sequelize[_0xb84d('0x2')]},'alias':{'type':Sequelize[_0xb84d('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xb84d('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb84d('0x3')]},'custom':{'type':Sequelize[_0xb84d('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index e49ba74..afca21a 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 _0x6334=['json','undefined','count','offset','limit','status','set','save','update','then','destroy','sendStatus','error','name','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','intersection','fields','attributes','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','filters','length','find','create','body','params','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end'];(function(_0x581eb1,_0x570ab5){var _0x56a9bf=function(_0x6ec440){while(--_0x6ec440){_0x581eb1['push'](_0x581eb1['shift']());}};_0x56a9bf(++_0x570ab5);}(_0x6334,0x123));var _0x4633=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x6334[_0x2706da];return _0x3ba87e;};'use strict';var emlformat=require(_0x4633('0x0'));var rimraf=require(_0x4633('0x1'));var zipdir=require(_0x4633('0x2'));var jsonpatch=require(_0x4633('0x3'));var rp=require(_0x4633('0x4'));var moment=require(_0x4633('0x5'));var BPromise=require(_0x4633('0x6'));var Mustache=require(_0x4633('0x7'));var util=require(_0x4633('0x8'));var path=require(_0x4633('0x9'));var sox=require(_0x4633('0xa'));var csv=require(_0x4633('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4633('0xc'));var _=require(_0x4633('0xd'));var squel=require(_0x4633('0xe'));var crypto=require(_0x4633('0xf'));var jsforce=require(_0x4633('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4633('0xb'));var querystring=require('querystring');var Papa=require(_0x4633('0x11'));var Redis=require(_0x4633('0x12'));var authService=require(_0x4633('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4633('0x14'));var hardwareService=require(_0x4633('0x15'));var logger=require(_0x4633('0x16'))(_0x4633('0x17'));var utils=require(_0x4633('0x18'));var config=require(_0x4633('0x19'));var licenseUtil=require(_0x4633('0x1a'));var db=require(_0x4633('0x1b'))['db'];function respondWithStatusCode(_0x1ee38a,_0x462235){_0x462235=_0x462235||0xcc;return function(_0x406bcc){if(_0x406bcc){return _0x1ee38a['sendStatus'](_0x462235);}return _0x1ee38a['status'](_0x462235)[_0x4633('0x1c')]();};}function respondWithResult(_0x309518,_0x298a8f){_0x298a8f=_0x298a8f||0xc8;return function(_0x261151){if(_0x261151){return _0x309518['status'](_0x298a8f)[_0x4633('0x1d')](_0x261151);}};}function respondWithFilteredResult(_0x3a95f0,_0x23f5e9){return function(_0xa44c6b){if(_0xa44c6b){var _0x157f3e=typeof _0x23f5e9['offset']===_0x4633('0x1e')&&typeof _0x23f5e9['limit']===_0x4633('0x1e');var _0x3e6e26=_0xa44c6b[_0x4633('0x1f')];var _0x2a479b=_0x157f3e?0x0:_0x23f5e9[_0x4633('0x20')];var _0x4bd049=_0x157f3e?_0xa44c6b[_0x4633('0x1f')]:_0x23f5e9[_0x4633('0x20')]+_0x23f5e9[_0x4633('0x21')];var _0x2ad178;if(_0x4bd049>=_0x3e6e26){_0x4bd049=_0x3e6e26;_0x2ad178=0xc8;}else{_0x2ad178=0xce;}_0x3a95f0[_0x4633('0x22')](_0x2ad178);return _0x3a95f0[_0x4633('0x23')]('Content-Range',_0x2a479b+'-'+_0x4bd049+'/'+_0x3e6e26)['json'](_0xa44c6b);}return null;};}function patchUpdates(_0x2442e4){return function(_0x1301f1){try{jsonpatch['apply'](_0x1301f1,_0x2442e4,!![]);}catch(_0x4ad509){return BPromise['reject'](_0x4ad509);}return _0x1301f1[_0x4633('0x24')]();};}function saveUpdates(_0x57b671,_0x25c0e6){return function(_0x172e9d){if(_0x172e9d){return _0x172e9d[_0x4633('0x25')](_0x57b671)[_0x4633('0x26')](function(_0x5f4d3a){return _0x5f4d3a;});}return null;};}function removeEntity(_0x1b274c,_0x1d2974){return function(_0x58a7c8){if(_0x58a7c8){return _0x58a7c8[_0x4633('0x27')]()[_0x4633('0x26')](function(){_0x1b274c[_0x4633('0x22')](0xcc)[_0x4633('0x1c')]();});}};}function handleEntityNotFound(_0x20a25d,_0x219423){return function(_0x4641b2){if(!_0x4641b2){_0x20a25d[_0x4633('0x28')](0x194);}return _0x4641b2;};}function handleError(_0xab99f7,_0x42e775){_0x42e775=_0x42e775||0x1f4;return function(_0x3131b8){logger[_0x4633('0x29')](_0x3131b8['stack']);if(_0x3131b8[_0x4633('0x2a')]){delete _0x3131b8[_0x4633('0x2a')];}_0xab99f7[_0x4633('0x22')](_0x42e775)['send'](_0x3131b8);};}exports['index']=function(_0x18503a,_0x369b62){var _0x3e71a3={},_0x1d2e78={},_0x3f2dcf={'count':0x0,'rows':[]};var _0x2d7f3e=_[_0x4633('0x2b')](db[_0x4633('0x2c')][_0x4633('0x2d')],function(_0x121329){return{'name':_0x121329['fieldName'],'type':_0x121329['type'][_0x4633('0x2e')]};});_0x1d2e78[_0x4633('0x2f')]=_['map'](_0x2d7f3e,_0x4633('0x2a'));_0x1d2e78[_0x4633('0x30')]=_[_0x4633('0x31')](_0x18503a['query']);_0x1d2e78['filters']=_[_0x4633('0x32')](_0x1d2e78[_0x4633('0x2f')],_0x1d2e78[_0x4633('0x30')]);_0x3e71a3['attributes']=_['intersection'](_0x1d2e78[_0x4633('0x2f')],qs['fields'](_0x18503a[_0x4633('0x30')][_0x4633('0x33')]));_0x3e71a3[_0x4633('0x34')]=_0x3e71a3[_0x4633('0x34')]['length']?_0x3e71a3[_0x4633('0x34')]:_0x1d2e78[_0x4633('0x2f')];if(!_0x18503a[_0x4633('0x30')]['hasOwnProperty']('nolimit')){_0x3e71a3['limit']=qs[_0x4633('0x21')](_0x18503a[_0x4633('0x30')]['limit']);_0x3e71a3[_0x4633('0x20')]=qs[_0x4633('0x20')](_0x18503a[_0x4633('0x30')]['offset']);}_0x3e71a3[_0x4633('0x35')]=qs[_0x4633('0x36')](_0x18503a[_0x4633('0x30')][_0x4633('0x36')]);_0x3e71a3[_0x4633('0x37')]=qs['filters'](_[_0x4633('0x38')](_0x18503a[_0x4633('0x30')],_0x1d2e78['filters']),_0x2d7f3e);if(_0x18503a[_0x4633('0x30')][_0x4633('0x39')]){_0x3e71a3[_0x4633('0x37')]=_['merge'](_0x3e71a3['where'],{'$or':_[_0x4633('0x2b')](_0x2d7f3e,function(_0x1b8100){if(_0x1b8100[_0x4633('0x3a')]!==_0x4633('0x3b')){var _0x22b833={};_0x22b833[_0x1b8100[_0x4633('0x2a')]]={'$like':'%'+_0x18503a[_0x4633('0x30')][_0x4633('0x39')]+'%'};return _0x22b833;}})});}_0x3e71a3=_[_0x4633('0x3c')]({},_0x3e71a3,_0x18503a[_0x4633('0x3d')]);var _0x8f193c={'where':_0x3e71a3['where']};return db[_0x4633('0x2c')][_0x4633('0x1f')](_0x8f193c)[_0x4633('0x26')](function(_0x16bddb){_0x3f2dcf['count']=_0x16bddb;if(_0x18503a[_0x4633('0x30')][_0x4633('0x3e')]){_0x3e71a3[_0x4633('0x3f')]=[{'all':!![]}];}return db[_0x4633('0x2c')]['findAll'](_0x3e71a3);})[_0x4633('0x26')](function(_0x2ed5eb){_0x3f2dcf[_0x4633('0x40')]=_0x2ed5eb;return _0x3f2dcf;})[_0x4633('0x26')](respondWithFilteredResult(_0x369b62,_0x3e71a3))[_0x4633('0x41')](handleError(_0x369b62,null));};exports[_0x4633('0x42')]=function(_0x52cc7f,_0x3fa696){var _0x57bda7={'raw':![],'where':{'id':_0x52cc7f['params']['id']}},_0x464f8a={};_0x464f8a[_0x4633('0x2f')]=_[_0x4633('0x31')](db[_0x4633('0x2c')][_0x4633('0x2d')]);_0x464f8a[_0x4633('0x30')]=_['keys'](_0x52cc7f[_0x4633('0x30')]);_0x464f8a[_0x4633('0x43')]=_[_0x4633('0x32')](_0x464f8a['model'],_0x464f8a[_0x4633('0x30')]);_0x57bda7[_0x4633('0x34')]=_['intersection'](_0x464f8a[_0x4633('0x2f')],qs[_0x4633('0x33')](_0x52cc7f[_0x4633('0x30')][_0x4633('0x33')]));_0x57bda7['attributes']=_0x57bda7['attributes'][_0x4633('0x44')]?_0x57bda7[_0x4633('0x34')]:_0x464f8a['model'];if(_0x52cc7f[_0x4633('0x30')][_0x4633('0x3e')]){_0x57bda7['include']=[{'all':!![]}];}_0x57bda7=_[_0x4633('0x3c')]({},_0x57bda7,_0x52cc7f['options']);return db[_0x4633('0x2c')][_0x4633('0x45')](_0x57bda7)[_0x4633('0x26')](handleEntityNotFound(_0x3fa696,null))[_0x4633('0x26')](respondWithResult(_0x3fa696,null))[_0x4633('0x41')](handleError(_0x3fa696,null));};exports[_0x4633('0x46')]=function(_0x1b0ef5,_0x1557ec){return db[_0x4633('0x2c')][_0x4633('0x46')](_0x1b0ef5[_0x4633('0x47')],{})[_0x4633('0x26')](respondWithResult(_0x1557ec,0xc9))[_0x4633('0x41')](handleError(_0x1557ec,null));};exports['bulkCreate']=function(_0x383666,_0x134bf4){return db['AnalyticFieldReport']['bulkCreate'](_0x383666[_0x4633('0x47')],{'raw':![],'individualHooks':!![]})[_0x4633('0x26')](respondWithResult(_0x134bf4,0xc9))[_0x4633('0x41')](handleError(_0x134bf4,null));};exports[_0x4633('0x25')]=function(_0x4debed,_0x41f311){if(_0x4debed['body']['id']){delete _0x4debed['body']['id'];}return db[_0x4633('0x2c')][_0x4633('0x45')]({'where':{'id':_0x4debed['params']['id']}})[_0x4633('0x26')](handleEntityNotFound(_0x41f311,null))['then'](saveUpdates(_0x4debed[_0x4633('0x47')],null))[_0x4633('0x26')](respondWithResult(_0x41f311,null))['catch'](handleError(_0x41f311,null));};exports[_0x4633('0x27')]=function(_0xe9cf3c,_0x3c56b7){return db[_0x4633('0x2c')][_0x4633('0x45')]({'where':{'id':_0xe9cf3c[_0x4633('0x48')]['id']}})[_0x4633('0x26')](handleEntityNotFound(_0x3c56b7,null))[_0x4633('0x26')](removeEntity(_0x3c56b7,null))['catch'](handleError(_0x3c56b7,null));};exports[_0x4633('0x49')]=function(_0x49a5c1,_0x32c828){return db[_0x4633('0x2c')][_0x4633('0x27')]({'where':{'id':_0x49a5c1[_0x4633('0x30')][_0x4633('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x4633('0x26')](respondWithResult(_0x32c828,0xcc))[_0x4633('0x41')](handleError(_0x32c828,null));};exports[_0x4633('0x4b')]=function(_0x3b317e,_0x533db1,_0x40eacb){return db['AnalyticCustomReport'][_0x4633('0x4c')]({'where':{'id':_0x3b317e[_0x4633('0x48')]['id']}})[_0x4633('0x26')](handleEntityNotFound(_0x533db1,null))[_0x4633('0x26')](function(_0x2982d6){if(_0x2982d6){return db[_0x4633('0x4d')][_0x4633('0x4e')](function(_0xc998d8){return db[_0x4633('0x2c')][_0x4633('0x27')]({'where':{'CustomReportId':_0x3b317e['params']['id']},'transaction':_0xc998d8})[_0x4633('0x26')](function(_0x3acdaa){var _0x53d223=_[_0x4633('0x2b')](_0x3b317e[_0x4633('0x47')],function(_0x581b98){delete _0x581b98['id'];_0x581b98[_0x4633('0x4f')]=_0x3b317e[_0x4633('0x48')]['id'];return _0x581b98;});return db[_0x4633('0x2c')]['bulkCreate'](_0x53d223,{'transaction':_0xc998d8});});})[_0x4633('0x26')](function(){return db[_0x4633('0x2c')]['findAll']({'where':{'CustomReportId':_0x3b317e[_0x4633('0x48')]['id']}});});}})[_0x4633('0x26')](respondWithResult(_0x533db1,null))['catch'](handleError(_0x533db1,null));}; \ No newline at end of file +var _0xcd1c=['mustache','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','VIRTUAL','options','includeAll','include','AnalyticFieldReport','findAll','then','rows','show','params','find','catch','bulkCreate','body','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xfa24eb,_0x12cfd7){var _0x21c723=function(_0x2ca760){while(--_0x2ca760){_0xfa24eb['push'](_0xfa24eb['shift']());}};_0x21c723(++_0x12cfd7);}(_0xcd1c,0x12a));var _0xccd1=function(_0x5c77d9,_0x310fac){_0x5c77d9=_0x5c77d9-0x0;var _0x114cdd=_0xcd1c[_0x5c77d9];return _0x114cdd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccd1('0x0'));var zipdir=require(_0xccd1('0x1'));var jsonpatch=require(_0xccd1('0x2'));var rp=require(_0xccd1('0x3'));var moment=require(_0xccd1('0x4'));var BPromise=require(_0xccd1('0x5'));var Mustache=require(_0xccd1('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xccd1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccd1('0x8'));var _=require(_0xccd1('0x9'));var squel=require(_0xccd1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xccd1('0xb'));var toCsv=require('to-csv');var querystring=require(_0xccd1('0xc'));var Papa=require(_0xccd1('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xccd1('0xe'));var as=require(_0xccd1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccd1('0x10'))('api');var utils=require(_0xccd1('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4826b1,_0x334ddc){_0x334ddc=_0x334ddc||0xcc;return function(_0x40abb7){if(_0x40abb7){return _0x4826b1[_0xccd1('0x12')](_0x334ddc);}return _0x4826b1['status'](_0x334ddc)[_0xccd1('0x13')]();};}function respondWithResult(_0x2a2328,_0xce673a){_0xce673a=_0xce673a||0xc8;return function(_0x2fcefe){if(_0x2fcefe){return _0x2a2328[_0xccd1('0x14')](_0xce673a)['json'](_0x2fcefe);}};}function respondWithFilteredResult(_0x55ae1e,_0x29c80e){return function(_0x429212){if(_0x429212){var _0x477623=typeof _0x29c80e[_0xccd1('0x15')]===_0xccd1('0x16')&&typeof _0x29c80e[_0xccd1('0x17')]===_0xccd1('0x16');var _0x251042=_0x429212[_0xccd1('0x18')];var _0x272df3=_0x477623?0x0:_0x29c80e[_0xccd1('0x15')];var _0xc45bc4=_0x477623?_0x429212[_0xccd1('0x18')]:_0x29c80e[_0xccd1('0x15')]+_0x29c80e[_0xccd1('0x17')];var _0x18459c;if(_0xc45bc4>=_0x251042){_0xc45bc4=_0x251042;_0x18459c=0xc8;}else{_0x18459c=0xce;}_0x55ae1e[_0xccd1('0x14')](_0x18459c);return _0x55ae1e[_0xccd1('0x19')](_0xccd1('0x1a'),_0x272df3+'-'+_0xc45bc4+'/'+_0x251042)['json'](_0x429212);}return null;};}function patchUpdates(_0x2b4555){return function(_0x4e0f6e){try{jsonpatch[_0xccd1('0x1b')](_0x4e0f6e,_0x2b4555,!![]);}catch(_0x90efed){return BPromise['reject'](_0x90efed);}return _0x4e0f6e[_0xccd1('0x1c')]();};}function saveUpdates(_0x13cc41,_0xb9b12e){return function(_0x3ba7ca){if(_0x3ba7ca){return _0x3ba7ca[_0xccd1('0x1d')](_0x13cc41)['then'](function(_0x3031f3){return _0x3031f3;});}return null;};}function removeEntity(_0xa7bfac,_0x39df39){return function(_0x182f10){if(_0x182f10){return _0x182f10[_0xccd1('0x1e')]()['then'](function(){_0xa7bfac['status'](0xcc)[_0xccd1('0x13')]();});}};}function handleEntityNotFound(_0x260f98,_0x262db9){return function(_0x1bda8e){if(!_0x1bda8e){_0x260f98[_0xccd1('0x12')](0x194);}return _0x1bda8e;};}function handleError(_0xeb5c3f,_0xa5f347){_0xa5f347=_0xa5f347||0x1f4;return function(_0x38280c){logger[_0xccd1('0x1f')](_0x38280c[_0xccd1('0x20')]);if(_0x38280c[_0xccd1('0x21')]){delete _0x38280c['name'];}_0xeb5c3f['status'](_0xa5f347)[_0xccd1('0x22')](_0x38280c);};}exports[_0xccd1('0x23')]=function(_0x486e09,_0x24dbe2){var _0x2a7cf5={},_0x1f3e97={},_0x2725f7={'count':0x0,'rows':[]};var _0x448dee=_['map'](db['AnalyticFieldReport'][_0xccd1('0x24')],function(_0xed29e9){return{'name':_0xed29e9[_0xccd1('0x25')],'type':_0xed29e9['type'][_0xccd1('0x26')]};});_0x1f3e97[_0xccd1('0x27')]=_['map'](_0x448dee,_0xccd1('0x21'));_0x1f3e97[_0xccd1('0x28')]=_[_0xccd1('0x29')](_0x486e09[_0xccd1('0x28')]);_0x1f3e97[_0xccd1('0x2a')]=_[_0xccd1('0x2b')](_0x1f3e97[_0xccd1('0x27')],_0x1f3e97[_0xccd1('0x28')]);_0x2a7cf5[_0xccd1('0x2c')]=_[_0xccd1('0x2b')](_0x1f3e97[_0xccd1('0x27')],qs['fields'](_0x486e09[_0xccd1('0x28')][_0xccd1('0x2d')]));_0x2a7cf5[_0xccd1('0x2c')]=_0x2a7cf5[_0xccd1('0x2c')][_0xccd1('0x2e')]?_0x2a7cf5[_0xccd1('0x2c')]:_0x1f3e97[_0xccd1('0x27')];if(!_0x486e09[_0xccd1('0x28')]['hasOwnProperty'](_0xccd1('0x2f'))){_0x2a7cf5['limit']=qs[_0xccd1('0x17')](_0x486e09[_0xccd1('0x28')][_0xccd1('0x17')]);_0x2a7cf5[_0xccd1('0x15')]=qs[_0xccd1('0x15')](_0x486e09[_0xccd1('0x28')]['offset']);}_0x2a7cf5[_0xccd1('0x30')]=qs['sort'](_0x486e09[_0xccd1('0x28')][_0xccd1('0x31')]);_0x2a7cf5['where']=qs[_0xccd1('0x2a')](_[_0xccd1('0x32')](_0x486e09[_0xccd1('0x28')],_0x1f3e97[_0xccd1('0x2a')]),_0x448dee);if(_0x486e09[_0xccd1('0x28')][_0xccd1('0x33')]){_0x2a7cf5['where']=_[_0xccd1('0x34')](_0x2a7cf5[_0xccd1('0x35')],{'$or':_[_0xccd1('0x36')](_0x448dee,function(_0x5d169e){if(_0x5d169e['type']!==_0xccd1('0x37')){var _0xc3c936={};_0xc3c936[_0x5d169e[_0xccd1('0x21')]]={'$like':'%'+_0x486e09[_0xccd1('0x28')][_0xccd1('0x33')]+'%'};return _0xc3c936;}})});}_0x2a7cf5=_[_0xccd1('0x34')]({},_0x2a7cf5,_0x486e09[_0xccd1('0x38')]);var _0x17f491={'where':_0x2a7cf5[_0xccd1('0x35')]};return db['AnalyticFieldReport'][_0xccd1('0x18')](_0x17f491)['then'](function(_0x253e4d){_0x2725f7['count']=_0x253e4d;if(_0x486e09[_0xccd1('0x28')][_0xccd1('0x39')]){_0x2a7cf5[_0xccd1('0x3a')]=[{'all':!![]}];}return db[_0xccd1('0x3b')][_0xccd1('0x3c')](_0x2a7cf5);})[_0xccd1('0x3d')](function(_0x13e441){_0x2725f7[_0xccd1('0x3e')]=_0x13e441;return _0x2725f7;})['then'](respondWithFilteredResult(_0x24dbe2,_0x2a7cf5))['catch'](handleError(_0x24dbe2,null));};exports[_0xccd1('0x3f')]=function(_0x521e4e,_0x35adb4){var _0x45d722={'raw':![],'where':{'id':_0x521e4e[_0xccd1('0x40')]['id']}},_0x21f64a={};_0x21f64a[_0xccd1('0x27')]=_[_0xccd1('0x29')](db[_0xccd1('0x3b')][_0xccd1('0x24')]);_0x21f64a[_0xccd1('0x28')]=_[_0xccd1('0x29')](_0x521e4e[_0xccd1('0x28')]);_0x21f64a[_0xccd1('0x2a')]=_['intersection'](_0x21f64a[_0xccd1('0x27')],_0x21f64a[_0xccd1('0x28')]);_0x45d722[_0xccd1('0x2c')]=_['intersection'](_0x21f64a['model'],qs[_0xccd1('0x2d')](_0x521e4e[_0xccd1('0x28')][_0xccd1('0x2d')]));_0x45d722[_0xccd1('0x2c')]=_0x45d722[_0xccd1('0x2c')][_0xccd1('0x2e')]?_0x45d722['attributes']:_0x21f64a['model'];if(_0x521e4e['query'][_0xccd1('0x39')]){_0x45d722['include']=[{'all':!![]}];}_0x45d722=_[_0xccd1('0x34')]({},_0x45d722,_0x521e4e[_0xccd1('0x38')]);return db[_0xccd1('0x3b')][_0xccd1('0x41')](_0x45d722)[_0xccd1('0x3d')](handleEntityNotFound(_0x35adb4,null))[_0xccd1('0x3d')](respondWithResult(_0x35adb4,null))[_0xccd1('0x42')](handleError(_0x35adb4,null));};exports['create']=function(_0x310e85,_0x3d5066){return db[_0xccd1('0x3b')]['create'](_0x310e85['body'],{})[_0xccd1('0x3d')](respondWithResult(_0x3d5066,0xc9))[_0xccd1('0x42')](handleError(_0x3d5066,null));};exports[_0xccd1('0x43')]=function(_0x3f0280,_0x15fe6c){return db['AnalyticFieldReport'][_0xccd1('0x43')](_0x3f0280[_0xccd1('0x44')],{'raw':![],'individualHooks':!![]})[_0xccd1('0x3d')](respondWithResult(_0x15fe6c,0xc9))[_0xccd1('0x42')](handleError(_0x15fe6c,null));};exports[_0xccd1('0x1d')]=function(_0x272bdb,_0x5d66d1){if(_0x272bdb[_0xccd1('0x44')]['id']){delete _0x272bdb[_0xccd1('0x44')]['id'];}return db[_0xccd1('0x3b')][_0xccd1('0x41')]({'where':{'id':_0x272bdb[_0xccd1('0x40')]['id']}})[_0xccd1('0x3d')](handleEntityNotFound(_0x5d66d1,null))[_0xccd1('0x3d')](saveUpdates(_0x272bdb[_0xccd1('0x44')],null))[_0xccd1('0x3d')](respondWithResult(_0x5d66d1,null))[_0xccd1('0x42')](handleError(_0x5d66d1,null));};exports['destroy']=function(_0x3ba7a9,_0x1321c0){return db[_0xccd1('0x3b')]['find']({'where':{'id':_0x3ba7a9[_0xccd1('0x40')]['id']}})[_0xccd1('0x3d')](handleEntityNotFound(_0x1321c0,null))[_0xccd1('0x3d')](removeEntity(_0x1321c0,null))[_0xccd1('0x42')](handleError(_0x1321c0,null));};exports['bulkDestroy']=function(_0x104e6b,_0x5bcb6c){return db[_0xccd1('0x3b')][_0xccd1('0x1e')]({'where':{'id':_0x104e6b['query'][_0xccd1('0x45')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5bcb6c,0xcc))[_0xccd1('0x42')](handleError(_0x5bcb6c,null));};exports[_0xccd1('0x46')]=function(_0x167f99,_0x1f7552,_0x4ea950){return db[_0xccd1('0x47')][_0xccd1('0x48')]({'where':{'id':_0x167f99['params']['id']}})[_0xccd1('0x3d')](handleEntityNotFound(_0x1f7552,null))[_0xccd1('0x3d')](function(_0x5c3d3d){if(_0x5c3d3d){return db[_0xccd1('0x49')][_0xccd1('0x4a')](function(_0x2080e0){return db[_0xccd1('0x3b')][_0xccd1('0x1e')]({'where':{'CustomReportId':_0x167f99['params']['id']},'transaction':_0x2080e0})[_0xccd1('0x3d')](function(_0x4ccab8){var _0x338de2=_['map'](_0x167f99[_0xccd1('0x44')],function(_0x3a5a41){delete _0x3a5a41['id'];_0x3a5a41[_0xccd1('0x4b')]=_0x167f99[_0xccd1('0x40')]['id'];return _0x3a5a41;});return db[_0xccd1('0x3b')]['bulkCreate'](_0x338de2,{'transaction':_0x2080e0});});})[_0xccd1('0x3d')](function(){return db['AnalyticFieldReport'][_0xccd1('0x3c')]({'where':{'CustomReportId':_0x167f99['params']['id']}});});}})[_0xccd1('0x3d')](respondWithResult(_0x1f7552,null))['catch'](handleError(_0x1f7552,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 825e18d..6dcf650 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 _0xd936=['path','../../config/environment','define','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xb6c75c,_0x47da1a){var _0x32fbff=function(_0x140bab){while(--_0x140bab){_0xb6c75c['push'](_0xb6c75c['shift']());}};_0x32fbff(++_0x47da1a);}(_0xd936,0x1bc));var _0x6d93=function(_0x3eb432,_0x46e801){_0x3eb432=_0x3eb432-0x0;var _0x5a657e=_0xd936[_0x3eb432];return _0x5a657e;};'use strict';var _=require(_0x6d93('0x0'));var util=require(_0x6d93('0x1'));var logger=require(_0x6d93('0x2'))('api');var moment=require(_0x6d93('0x3'));var BPromise=require(_0x6d93('0x4'));var rp=require(_0x6d93('0x5'));var fs=require('fs');var path=require(_0x6d93('0x6'));var rimraf=require('rimraf');var config=require(_0x6d93('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x319276,_0x4ef127){return _0x319276[_0x6d93('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x6d93('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9326=['api','moment','bluebird','request-promise','rimraf','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x9326,0x13c));var _0x6932=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x9326[_0x14363e];return _0x17c56d;};'use strict';var _=require(_0x6932('0x0'));var util=require(_0x6932('0x1'));var logger=require(_0x6932('0x2'))(_0x6932('0x3'));var moment=require(_0x6932('0x4'));var BPromise=require(_0x6932('0x5'));var rp=require(_0x6932('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6932('0x7'));var config=require('../../config/environment');var attributes=require(_0x6932('0x8'));module['exports']=function(_0x3dbfcb,_0x5e6ccb){return _0x3dbfcb[_0x6932('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x6932('0xa'),'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 f832e2b..441b7e5 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 _0xc385=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0xa8e95e,_0x5ee625){var _0x229cde=function(_0x4cf3dc){while(--_0x4cf3dc){_0xa8e95e['push'](_0xa8e95e['shift']());}};_0x229cde(++_0x5ee625);}(_0xc385,0x190));var _0x5c38=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xc385[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0x5c38('0x0'));var util=require(_0x5c38('0x1'));var moment=require(_0x5c38('0x2'));var BPromise=require(_0x5c38('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c38('0x4'));var db=require(_0x5c38('0x5'))['db'];var utils=require(_0x5c38('0x6'));var logger=require(_0x5c38('0x7'))(_0x5c38('0x8'));var config=require(_0x5c38('0x9'));var jayson=require(_0x5c38('0xa'));var client=jayson[_0x5c38('0xb')][_0x5c38('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x286171,_0x580a1c,_0x4d8031){return new BPromise(function(_0xc8e89c,_0x5dc383){return client['request'](_0x286171,_0x4d8031)['then'](function(_0x3c16fb){logger[_0x5c38('0xd')](_0x5c38('0xe'),_0x580a1c,_0x5c38('0xf'));logger[_0x5c38('0x10')](_0x5c38('0x11'),_0x580a1c,_0x5c38('0xf'),JSON[_0x5c38('0x12')](_0x3c16fb));if(_0x3c16fb['error']){if(_0x3c16fb[_0x5c38('0x13')][_0x5c38('0x14')]===0x1f4){logger[_0x5c38('0x13')](_0x5c38('0xe'),_0x580a1c,_0x3c16fb[_0x5c38('0x13')]['message']);return _0x5dc383(_0x3c16fb[_0x5c38('0x13')][_0x5c38('0x15')]);}logger[_0x5c38('0x13')](_0x5c38('0xe'),_0x580a1c,_0x3c16fb['error'][_0x5c38('0x15')]);return _0xc8e89c(_0x3c16fb['error'][_0x5c38('0x15')]);}else{logger[_0x5c38('0xd')](_0x5c38('0xe'),_0x580a1c,_0x5c38('0xf'));_0xc8e89c(_0x3c16fb[_0x5c38('0x16')]['message']);}})['catch'](function(_0x5bcbe9){logger[_0x5c38('0x13')](_0x5c38('0xe'),_0x580a1c,_0x5bcbe9);_0x5dc383(_0x5bcbe9);});});} \ No newline at end of file +var _0xe214=['moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x382275,_0x18b723){var _0x2ad906=function(_0x374a96){while(--_0x374a96){_0x382275['push'](_0x382275['shift']());}};_0x2ad906(++_0x18b723);}(_0xe214,0x1cd));var _0x4e21=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe214[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4e21('0x0'));var util=require('util');var moment=require(_0x4e21('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e21('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e21('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e21('0x4'));var config=require('../../config/environment');var jayson=require(_0x4e21('0x5'));var client=jayson[_0x4e21('0x6')][_0x4e21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ee780,_0x5f1a4e,_0x13e69b){return new BPromise(function(_0x39ed7f,_0x56f2c4){return client[_0x4e21('0x8')](_0x4ee780,_0x13e69b)[_0x4e21('0x9')](function(_0x247e59){logger[_0x4e21('0xa')](_0x4e21('0xb'),_0x5f1a4e,_0x4e21('0xc'));logger[_0x4e21('0xd')](_0x4e21('0xe'),_0x5f1a4e,_0x4e21('0xc'),JSON[_0x4e21('0xf')](_0x247e59));if(_0x247e59[_0x4e21('0x10')]){if(_0x247e59[_0x4e21('0x10')][_0x4e21('0x11')]===0x1f4){logger[_0x4e21('0x10')](_0x4e21('0xb'),_0x5f1a4e,_0x247e59[_0x4e21('0x10')]['message']);return _0x56f2c4(_0x247e59[_0x4e21('0x10')][_0x4e21('0x12')]);}logger[_0x4e21('0x10')](_0x4e21('0xb'),_0x5f1a4e,_0x247e59[_0x4e21('0x10')]['message']);return _0x39ed7f(_0x247e59['error'][_0x4e21('0x12')]);}else{logger[_0x4e21('0xa')](_0x4e21('0xb'),_0x5f1a4e,_0x4e21('0xc'));_0x39ed7f(_0x247e59[_0x4e21('0x13')][_0x4e21('0x12')]);}})[_0x4e21('0x14')](function(_0x4a5ea3){logger[_0x4e21('0x10')](_0x4e21('0xb'),_0x5f1a4e,_0x4a5ea3);_0x56f2c4(_0x4a5ea3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index dc8ea11..81da8db 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(_0x339472,_0x1f0a55){var _0x312791=function(_0x633144){while(--_0x633144){_0x339472['push'](_0x339472['shift']());}};_0x312791(++_0x1f0a55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x217478,_0x51d949){var _0x29e384=function(_0x5458f7){while(--_0x5458f7){_0x217478['push'](_0x217478['shift']());}};_0x29e384(++_0x51d949);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 298d4ea..bf3a858 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 _0x2f8b=['sequelize','exports','name','STRING','TEXT'];(function(_0x4efdd5,_0x4c765e){var _0x1d3347=function(_0x212c95){while(--_0x212c95){_0x4efdd5['push'](_0x4efdd5['shift']());}};_0x1d3347(++_0x4c765e);}(_0x2f8b,0x96));var _0xb2f8=function(_0x3e57a2,_0xcbf14c){_0x3e57a2=_0x3e57a2-0x0;var _0x80fc27=_0x2f8b[_0x3e57a2];return _0x80fc27;};'use strict';var Sequelize=require(_0xb2f8('0x0'));module[_0xb2f8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb2f8('0x2')},'table':{'type':Sequelize[_0xb2f8('0x3')]},'metric':{'type':Sequelize[_0xb2f8('0x4')]},'description':{'type':Sequelize[_0xb2f8('0x3')]}}; \ No newline at end of file +var _0x55ea=['TEXT','sequelize','exports','STRING'];(function(_0x1f5857,_0x43b0b7){var _0x1d752a=function(_0x3c638f){while(--_0x3c638f){_0x1f5857['push'](_0x1f5857['shift']());}};_0x1d752a(++_0x43b0b7);}(_0x55ea,0xc9));var _0xa55e=function(_0x3270fd,_0x404d6f){_0x3270fd=_0x3270fd-0x0;var _0x4ccb51=_0x55ea[_0x3270fd];return _0x4ccb51;};'use strict';var Sequelize=require(_0xa55e('0x0'));module[_0xa55e('0x1')]={'name':{'type':Sequelize[_0xa55e('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa55e('0x2')]},'metric':{'type':Sequelize[_0xa55e('0x3')]},'description':{'type':Sequelize[_0xa55e('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3eaf6c1..1eb0969 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x57f704,_0xd57914){var _0x245950=function(_0x143dcc){while(--_0x143dcc){_0x57f704['push'](_0x57f704['shift']());}};_0x245950(++_0xd57914);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x00bb[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','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','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x4edad9,_0x189573){var _0x1baea3=function(_0x538aa7){while(--_0x538aa7){_0x4edad9['push'](_0x4edad9['shift']());}};_0x1baea3(++_0x189573);}(_0x98a8,0x12c));var _0x898a=function(_0x4042b1,_0x243e9b){_0x4042b1=_0x4042b1-0x0;var _0x49f148=_0x98a8[_0x4042b1];return _0x49f148;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 7d9f1f6..0892012 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 _0xd47f=['analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x1d30c7,_0x6572b4){var _0x7e2cc4=function(_0x40bc3e){while(--_0x40bc3e){_0x1d30c7['push'](_0x1d30c7['shift']());}};_0x7e2cc4(++_0x6572b4);}(_0xd47f,0x1bd));var _0xfd47=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xd47f[_0x37cc52];return _0x2b4a90;};'use strict';var _=require(_0xfd47('0x0'));var util=require('util');var logger=require(_0xfd47('0x1'))(_0xfd47('0x2'));var moment=require(_0xfd47('0x3'));var BPromise=require(_0xfd47('0x4'));var rp=require(_0xfd47('0x5'));var fs=require('fs');var path=require(_0xfd47('0x6'));var rimraf=require(_0xfd47('0x7'));var config=require(_0xfd47('0x8'));var attributes=require(_0xfd47('0x9'));module[_0xfd47('0xa')]=function(_0x29f81d,_0x2103a0){return _0x29f81d['define']('AnalyticMetric',attributes,{'tableName':_0xfd47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8506=['util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4e952e,_0x269cc1){var _0x1b7ae8=function(_0x56f658){while(--_0x56f658){_0x4e952e['push'](_0x4e952e['shift']());}};_0x1b7ae8(++_0x269cc1);}(_0x8506,0xe8));var _0x6850=function(_0x32e544,_0x42a898){_0x32e544=_0x32e544-0x0;var _0x49adb2=_0x8506[_0x32e544];return _0x49adb2;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var logger=require('../../config/logger')(_0x6850('0x1'));var moment=require('moment');var BPromise=require(_0x6850('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6850('0x3'));var rimraf=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var attributes=require('./analyticMetric.attributes');module[_0x6850('0x6')]=function(_0x372f0b,_0x232459){return _0x372f0b[_0x6850('0x7')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 fd74977..d0f4456 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 _0x795b=['http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x3654ec,_0x5b6680){var _0x61e402=function(_0x5842f6){while(--_0x5842f6){_0x3654ec['push'](_0x3654ec['shift']());}};_0x61e402(++_0x5b6680);}(_0x795b,0xe7));var _0xb795=function(_0x313d23,_0xa2f488){_0x313d23=_0x313d23-0x0;var _0x51ab84=_0x795b[_0x313d23];return _0x51ab84;};'use strict';var _=require(_0xb795('0x0'));var util=require(_0xb795('0x1'));var moment=require(_0xb795('0x2'));var BPromise=require(_0xb795('0x3'));var rs=require(_0xb795('0x4'));var fs=require('fs');var Redis=require(_0xb795('0x5'));var db=require(_0xb795('0x6'))['db'];var utils=require(_0xb795('0x7'));var logger=require(_0xb795('0x8'))('rpc');var config=require(_0xb795('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb795('0xa')][_0xb795('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2bd2,_0x24034f,_0x28f3b9){return new BPromise(function(_0x5a045f,_0x4df1bc){return client[_0xb795('0xc')](_0x2e2bd2,_0x28f3b9)[_0xb795('0xd')](function(_0x5f35e1){logger['info'](_0xb795('0xe'),_0x24034f,_0xb795('0xf'));logger['debug'](_0xb795('0x10'),_0x24034f,_0xb795('0xf'),JSON[_0xb795('0x11')](_0x5f35e1));if(_0x5f35e1[_0xb795('0x12')]){if(_0x5f35e1[_0xb795('0x12')]['code']===0x1f4){logger[_0xb795('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x24034f,_0x5f35e1[_0xb795('0x12')]['message']);return _0x4df1bc(_0x5f35e1[_0xb795('0x12')][_0xb795('0x13')]);}logger['error'](_0xb795('0xe'),_0x24034f,_0x5f35e1[_0xb795('0x12')][_0xb795('0x13')]);return _0x5a045f(_0x5f35e1[_0xb795('0x12')][_0xb795('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x24034f,_0xb795('0xf'));_0x5a045f(_0x5f35e1[_0xb795('0x14')][_0xb795('0x13')]);}})[_0xb795('0x15')](function(_0x33f74d){logger[_0xb795('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x24034f,_0x33f74d);_0x4df1bc(_0x33f74d);});});} \ No newline at end of file +var _0xc71b=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x5ded49,_0x5dcb71){var _0x2dc83a=function(_0x3392e6){while(--_0x3392e6){_0x5ded49['push'](_0x5ded49['shift']());}};_0x2dc83a(++_0x5dcb71);}(_0xc71b,0x1c1));var _0xbc71=function(_0x182946,_0x4f7c7f){_0x182946=_0x182946-0x0;var _0x5507ef=_0xc71b[_0x182946];return _0x5507ef;};'use strict';var _=require('lodash');var util=require(_0xbc71('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc71('0x1'));var fs=require('fs');var Redis=require(_0xbc71('0x2'));var db=require(_0xbc71('0x3'))['db'];var utils=require(_0xbc71('0x4'));var logger=require(_0xbc71('0x5'))(_0xbc71('0x6'));var config=require('../../config/environment');var jayson=require(_0xbc71('0x7'));var client=jayson[_0xbc71('0x8')][_0xbc71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a9e00,_0x1871cd,_0x4777f4){return new BPromise(function(_0x5ea3a9,_0x87306b){return client[_0xbc71('0xa')](_0x1a9e00,_0x4777f4)[_0xbc71('0xb')](function(_0x28f84e){logger[_0xbc71('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1871cd,_0xbc71('0xd'));logger[_0xbc71('0xe')](_0xbc71('0xf'),_0x1871cd,_0xbc71('0xd'),JSON[_0xbc71('0x10')](_0x28f84e));if(_0x28f84e[_0xbc71('0x11')]){if(_0x28f84e[_0xbc71('0x11')][_0xbc71('0x12')]===0x1f4){logger['error'](_0xbc71('0x13'),_0x1871cd,_0x28f84e[_0xbc71('0x11')][_0xbc71('0x14')]);return _0x87306b(_0x28f84e[_0xbc71('0x11')]['message']);}logger[_0xbc71('0x11')](_0xbc71('0x13'),_0x1871cd,_0x28f84e[_0xbc71('0x11')]['message']);return _0x5ea3a9(_0x28f84e[_0xbc71('0x11')][_0xbc71('0x14')]);}else{logger[_0xbc71('0xc')](_0xbc71('0x13'),_0x1871cd,_0xbc71('0xd'));_0x5ea3a9(_0x28f84e['result'][_0xbc71('0x14')]);}})[_0xbc71('0x15')](function(_0x448f45){logger[_0xbc71('0x11')](_0xbc71('0x13'),_0x1871cd,_0x448f45);_0x87306b(_0x448f45);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index add7172..d3cb09d 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 _0x5075=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','isAuthenticated','show','post','put','/:id','update'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x5075,0x73));var _0x5507=function(_0x333159,_0x68262e){_0x333159=_0x333159-0x0;var _0x2e29ac=_0x5075[_0x333159];return _0x2e29ac;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5507('0xa')]);router[_0x5507('0xb')]('/:id',auth[_0x5507('0xc')](),controller[_0x5507('0xd')]);router[_0x5507('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xc')](),controller[_0x5507('0x11')]);router['delete'](_0x5507('0x10'),auth[_0x5507('0xc')](),controller['destroy']);module[_0x5507('0x12')]=router; \ No newline at end of file +var _0xaab2=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xaab2,0xca));var _0x2aab=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xaab2[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0x2aab('0x0'));var path=require(_0x2aab('0x1'));var timeout=require(_0x2aab('0x2'));var express=require('express');var router=express[_0x2aab('0x3')]();var fs_extra=require(_0x2aab('0x4'));var auth=require(_0x2aab('0x5'));var interaction=require(_0x2aab('0x6'));var config=require(_0x2aab('0x7'));var controller=require('./analyticMetric.controller');router[_0x2aab('0x8')]('/',auth['isAuthenticated'](),controller[_0x2aab('0x9')]);router[_0x2aab('0x8')](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['show']);router[_0x2aab('0xc')]('/',auth[_0x2aab('0xb')](),controller[_0x2aab('0xd')]);router[_0x2aab('0xe')](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['update']);router['delete'](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['destroy']);module[_0x2aab('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 4d4f6c0..766ce8e 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 _0x4a04=['TEXT'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4a04,0x18c));var _0x44a0=function(_0x1ff575,_0xdba21f){_0x1ff575=_0x1ff575-0x0;var _0x48fc9e=_0x4a04[_0x1ff575];return _0x48fc9e;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x44a0('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x5c4c=['exports'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x5c4c,0x95));var _0xc5c4=function(_0x2cc5ce,_0x412c36){_0x2cc5ce=_0x2cc5ce-0x0;var _0x6b6dfd=_0x5c4c[_0x2cc5ce];return _0x6b6dfd;};'use strict';var Sequelize=require('sequelize');module[_0xc5c4('0x0')]={'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 5dfcef5..a875e34 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 _0xa073=['limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','name','merge','include','findAll','rows','catch','show','params','length','includeAll','options','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x412cba,_0x130ac8){var _0x43f622=function(_0x2c3921){while(--_0x2c3921){_0x412cba['push'](_0x412cba['shift']());}};_0x43f622(++_0x130ac8);}(_0xa073,0x79));var _0x3a07=function(_0x55ce48,_0x41e622){_0x55ce48=_0x55ce48-0x0;var _0x7deb49=_0xa073[_0x55ce48];return _0x7deb49;};'use strict';var emlformat=require(_0x3a07('0x0'));var rimraf=require(_0x3a07('0x1'));var zipdir=require(_0x3a07('0x2'));var jsonpatch=require(_0x3a07('0x3'));var rp=require(_0x3a07('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3a07('0x5'));var util=require(_0x3a07('0x6'));var path=require(_0x3a07('0x7'));var sox=require(_0x3a07('0x8'));var csv=require(_0x3a07('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a07('0xa'));var _=require(_0x3a07('0xb'));var squel=require(_0x3a07('0xc'));var crypto=require(_0x3a07('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3a07('0x9'));var querystring=require(_0x3a07('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a07('0xf'));var as=require(_0x3a07('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3a07('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3a07('0x12'));var db=require(_0x3a07('0x13'))['db'];function respondWithStatusCode(_0x1e77a2,_0x103a89){_0x103a89=_0x103a89||0xcc;return function(_0x1d150e){if(_0x1d150e){return _0x1e77a2[_0x3a07('0x14')](_0x103a89);}return _0x1e77a2[_0x3a07('0x15')](_0x103a89)['end']();};}function respondWithResult(_0xf3249c,_0x3b37c6){_0x3b37c6=_0x3b37c6||0xc8;return function(_0x1204c5){if(_0x1204c5){return _0xf3249c[_0x3a07('0x15')](_0x3b37c6)[_0x3a07('0x16')](_0x1204c5);}};}function respondWithFilteredResult(_0x40a6d0,_0x25eb0e){return function(_0xcf4b3c){if(_0xcf4b3c){var _0xc04fc5=typeof _0x25eb0e[_0x3a07('0x17')]===_0x3a07('0x18')&&typeof _0x25eb0e[_0x3a07('0x19')]===_0x3a07('0x18');var _0x101312=_0xcf4b3c[_0x3a07('0x1a')];var _0x29144c=_0xc04fc5?0x0:_0x25eb0e[_0x3a07('0x17')];var _0x301cbd=_0xc04fc5?_0xcf4b3c[_0x3a07('0x1a')]:_0x25eb0e[_0x3a07('0x17')]+_0x25eb0e[_0x3a07('0x19')];var _0x36b518;if(_0x301cbd>=_0x101312){_0x301cbd=_0x101312;_0x36b518=0xc8;}else{_0x36b518=0xce;}_0x40a6d0['status'](_0x36b518);return _0x40a6d0[_0x3a07('0x1b')](_0x3a07('0x1c'),_0x29144c+'-'+_0x301cbd+'/'+_0x101312)['json'](_0xcf4b3c);}return null;};}function patchUpdates(_0x2b519c){return function(_0x518735){try{jsonpatch[_0x3a07('0x1d')](_0x518735,_0x2b519c,!![]);}catch(_0x10f022){return BPromise[_0x3a07('0x1e')](_0x10f022);}return _0x518735[_0x3a07('0x1f')]();};}function saveUpdates(_0x3e02fe,_0x1b8f23){return function(_0x4b9837){if(_0x4b9837){return _0x4b9837['update'](_0x3e02fe)[_0x3a07('0x20')](function(_0x151761){return _0x151761;});}return null;};}function removeEntity(_0x109273,_0x5d0814){return function(_0x5b0f40){if(_0x5b0f40){return _0x5b0f40[_0x3a07('0x21')]()[_0x3a07('0x20')](function(){_0x109273['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xecb427,_0x199425){return function(_0x4c077b){if(!_0x4c077b){_0xecb427[_0x3a07('0x14')](0x194);}return _0x4c077b;};}function handleError(_0x56371c,_0x1e313c){_0x1e313c=_0x1e313c||0x1f4;return function(_0x38ab22){logger[_0x3a07('0x22')](_0x38ab22[_0x3a07('0x23')]);if(_0x38ab22['name']){delete _0x38ab22['name'];}_0x56371c[_0x3a07('0x15')](_0x1e313c)[_0x3a07('0x24')](_0x38ab22);};}exports[_0x3a07('0x25')]=function(_0x5b7f5e,_0x1ee41a){var _0x466143={},_0x47d24b={},_0x3bf101={'count':0x0,'rows':[]};var _0x2b6f2b=_[_0x3a07('0x26')](db[_0x3a07('0x27')][_0x3a07('0x28')],function(_0x2b98d6){return{'name':_0x2b98d6[_0x3a07('0x29')],'type':_0x2b98d6[_0x3a07('0x2a')][_0x3a07('0x2b')]};});_0x47d24b['model']=_['map'](_0x2b6f2b,'name');_0x47d24b[_0x3a07('0x2c')]=_[_0x3a07('0x2d')](_0x5b7f5e[_0x3a07('0x2c')]);_0x47d24b[_0x3a07('0x2e')]=_['intersection'](_0x47d24b[_0x3a07('0x2f')],_0x47d24b[_0x3a07('0x2c')]);_0x466143[_0x3a07('0x30')]=_[_0x3a07('0x31')](_0x47d24b[_0x3a07('0x2f')],qs['fields'](_0x5b7f5e[_0x3a07('0x2c')][_0x3a07('0x32')]));_0x466143[_0x3a07('0x30')]=_0x466143[_0x3a07('0x30')]['length']?_0x466143[_0x3a07('0x30')]:_0x47d24b[_0x3a07('0x2f')];if(!_0x5b7f5e[_0x3a07('0x2c')]['hasOwnProperty'](_0x3a07('0x33'))){_0x466143['limit']=qs[_0x3a07('0x19')](_0x5b7f5e[_0x3a07('0x2c')]['limit']);_0x466143[_0x3a07('0x17')]=qs[_0x3a07('0x17')](_0x5b7f5e[_0x3a07('0x2c')][_0x3a07('0x17')]);}_0x466143[_0x3a07('0x34')]=qs[_0x3a07('0x35')](_0x5b7f5e[_0x3a07('0x2c')]['sort']);_0x466143[_0x3a07('0x36')]=qs[_0x3a07('0x2e')](_[_0x3a07('0x37')](_0x5b7f5e[_0x3a07('0x2c')],_0x47d24b[_0x3a07('0x2e')]),_0x2b6f2b);if(_0x5b7f5e[_0x3a07('0x2c')][_0x3a07('0x38')]){_0x466143['where']=_['merge'](_0x466143['where'],{'$or':_[_0x3a07('0x26')](_0x2b6f2b,function(_0x2d2da4){if(_0x2d2da4['type']!==_0x3a07('0x39')){var _0x380aaf={};_0x380aaf[_0x2d2da4[_0x3a07('0x3a')]]={'$like':'%'+_0x5b7f5e['query']['filter']+'%'};return _0x380aaf;}})});}_0x466143=_[_0x3a07('0x3b')]({},_0x466143,_0x5b7f5e['options']);var _0x59bc14={'where':_0x466143[_0x3a07('0x36')]};return db[_0x3a07('0x27')][_0x3a07('0x1a')](_0x59bc14)[_0x3a07('0x20')](function(_0x5b398c){_0x3bf101[_0x3a07('0x1a')]=_0x5b398c;if(_0x5b7f5e[_0x3a07('0x2c')]['includeAll']){_0x466143[_0x3a07('0x3c')]=[{'all':!![]}];}return db[_0x3a07('0x27')][_0x3a07('0x3d')](_0x466143);})[_0x3a07('0x20')](function(_0x1dd042){_0x3bf101[_0x3a07('0x3e')]=_0x1dd042;return _0x3bf101;})[_0x3a07('0x20')](respondWithFilteredResult(_0x1ee41a,_0x466143))[_0x3a07('0x3f')](handleError(_0x1ee41a,null));};exports[_0x3a07('0x40')]=function(_0x3fcd41,_0x183cec){var _0x4b93f5={'raw':!![],'where':{'id':_0x3fcd41[_0x3a07('0x41')]['id']}},_0x39face={};_0x39face[_0x3a07('0x2f')]=_[_0x3a07('0x2d')](db[_0x3a07('0x27')]['rawAttributes']);_0x39face[_0x3a07('0x2c')]=_['keys'](_0x3fcd41[_0x3a07('0x2c')]);_0x39face[_0x3a07('0x2e')]=_['intersection'](_0x39face[_0x3a07('0x2f')],_0x39face[_0x3a07('0x2c')]);_0x4b93f5[_0x3a07('0x30')]=_['intersection'](_0x39face['model'],qs['fields'](_0x3fcd41[_0x3a07('0x2c')][_0x3a07('0x32')]));_0x4b93f5['attributes']=_0x4b93f5[_0x3a07('0x30')][_0x3a07('0x42')]?_0x4b93f5[_0x3a07('0x30')]:_0x39face[_0x3a07('0x2f')];if(_0x3fcd41[_0x3a07('0x2c')][_0x3a07('0x43')]){_0x4b93f5[_0x3a07('0x3c')]=[{'all':!![]}];}_0x4b93f5=_[_0x3a07('0x3b')]({},_0x4b93f5,_0x3fcd41[_0x3a07('0x44')]);return db[_0x3a07('0x27')]['find'](_0x4b93f5)[_0x3a07('0x20')](handleEntityNotFound(_0x183cec,null))['then'](respondWithResult(_0x183cec,null))[_0x3a07('0x3f')](handleError(_0x183cec,null));};exports[_0x3a07('0x45')]=function(_0x1e0d6e,_0x232424){return db[_0x3a07('0x27')][_0x3a07('0x45')](_0x1e0d6e[_0x3a07('0x46')],{})[_0x3a07('0x20')](respondWithResult(_0x232424,0xc9))[_0x3a07('0x3f')](handleError(_0x232424,null));};exports[_0x3a07('0x47')]=function(_0x49e047,_0x2bac7a){if(_0x49e047['body']['id']){delete _0x49e047[_0x3a07('0x46')]['id'];}return db[_0x3a07('0x27')][_0x3a07('0x48')]({'where':{'id':_0x49e047[_0x3a07('0x41')]['id']}})[_0x3a07('0x20')](handleEntityNotFound(_0x2bac7a,null))[_0x3a07('0x20')](saveUpdates(_0x49e047[_0x3a07('0x46')],null))['then'](respondWithResult(_0x2bac7a,null))['catch'](handleError(_0x2bac7a,null));};exports[_0x3a07('0x21')]=function(_0x31eacd,_0x2430ab){return db['AnalyticTreeReport'][_0x3a07('0x48')]({'where':{'id':_0x31eacd[_0x3a07('0x41')]['id']}})[_0x3a07('0x20')](handleEntityNotFound(_0x2430ab,null))[_0x3a07('0x20')](removeEntity(_0x2430ab,null))['catch'](handleError(_0x2430ab,null));}; \ No newline at end of file +var _0xd1b5=['filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1b7171,_0x533d9a){var _0x3c3db2=function(_0x4d7038){while(--_0x4d7038){_0x1b7171['push'](_0x1b7171['shift']());}};_0x3c3db2(++_0x533d9a);}(_0xd1b5,0x9c));var _0x5d1b=function(_0x22a46a,_0x588f9a){_0x22a46a=_0x22a46a-0x0;var _0x3c835b=_0xd1b5[_0x22a46a];return _0x3c835b;};'use strict';var emlformat=require(_0x5d1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d1b('0x1'));var jsonpatch=require(_0x5d1b('0x2'));var rp=require(_0x5d1b('0x3'));var moment=require(_0x5d1b('0x4'));var BPromise=require(_0x5d1b('0x5'));var Mustache=require(_0x5d1b('0x6'));var util=require(_0x5d1b('0x7'));var path=require(_0x5d1b('0x8'));var sox=require('sox');var csv=require(_0x5d1b('0x9'));var ejs=require(_0x5d1b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5d1b('0xb'));var jsforce=require(_0x5d1b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5d1b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d1b('0xd'));var authService=require(_0x5d1b('0xe'));var qs=require(_0x5d1b('0xf'));var as=require(_0x5d1b('0x10'));var hardwareService=require(_0x5d1b('0x11'));var logger=require(_0x5d1b('0x12'))('api');var utils=require(_0x5d1b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5d1b('0x14'))['db'];function respondWithStatusCode(_0x53aaa6,_0x11bb15){_0x11bb15=_0x11bb15||0xcc;return function(_0x4e8be8){if(_0x4e8be8){return _0x53aaa6[_0x5d1b('0x15')](_0x11bb15);}return _0x53aaa6[_0x5d1b('0x16')](_0x11bb15)['end']();};}function respondWithResult(_0x471380,_0x2fb68f){_0x2fb68f=_0x2fb68f||0xc8;return function(_0xf83ceb){if(_0xf83ceb){return _0x471380[_0x5d1b('0x16')](_0x2fb68f)['json'](_0xf83ceb);}};}function respondWithFilteredResult(_0x282db9,_0x3b2706){return function(_0x25a955){if(_0x25a955){var _0x457b52=typeof _0x3b2706[_0x5d1b('0x17')]===_0x5d1b('0x18')&&typeof _0x3b2706[_0x5d1b('0x19')]===_0x5d1b('0x18');var _0x20ef35=_0x25a955[_0x5d1b('0x1a')];var _0x4b32dc=_0x457b52?0x0:_0x3b2706[_0x5d1b('0x17')];var _0x33829e=_0x457b52?_0x25a955[_0x5d1b('0x1a')]:_0x3b2706[_0x5d1b('0x17')]+_0x3b2706[_0x5d1b('0x19')];var _0x103b13;if(_0x33829e>=_0x20ef35){_0x33829e=_0x20ef35;_0x103b13=0xc8;}else{_0x103b13=0xce;}_0x282db9[_0x5d1b('0x16')](_0x103b13);return _0x282db9['set'](_0x5d1b('0x1b'),_0x4b32dc+'-'+_0x33829e+'/'+_0x20ef35)[_0x5d1b('0x1c')](_0x25a955);}return null;};}function patchUpdates(_0x54c220){return function(_0x187934){try{jsonpatch[_0x5d1b('0x1d')](_0x187934,_0x54c220,!![]);}catch(_0x2ebe0b){return BPromise['reject'](_0x2ebe0b);}return _0x187934[_0x5d1b('0x1e')]();};}function saveUpdates(_0x3c450b,_0x145947){return function(_0x53deb6){if(_0x53deb6){return _0x53deb6[_0x5d1b('0x1f')](_0x3c450b)[_0x5d1b('0x20')](function(_0x419629){return _0x419629;});}return null;};}function removeEntity(_0x4ff46c,_0x3668c5){return function(_0x4bd1b1){if(_0x4bd1b1){return _0x4bd1b1[_0x5d1b('0x21')]()[_0x5d1b('0x20')](function(){_0x4ff46c['status'](0xcc)[_0x5d1b('0x22')]();});}};}function handleEntityNotFound(_0xb9f671,_0x1d554e){return function(_0x53c458){if(!_0x53c458){_0xb9f671['sendStatus'](0x194);}return _0x53c458;};}function handleError(_0x1a19f8,_0x27fa84){_0x27fa84=_0x27fa84||0x1f4;return function(_0xa40889){logger[_0x5d1b('0x23')](_0xa40889[_0x5d1b('0x24')]);if(_0xa40889['name']){delete _0xa40889[_0x5d1b('0x25')];}_0x1a19f8[_0x5d1b('0x16')](_0x27fa84)[_0x5d1b('0x26')](_0xa40889);};}exports[_0x5d1b('0x27')]=function(_0xa712b8,_0x578eaf){var _0x4d5221={},_0x5779a9={},_0x497e27={'count':0x0,'rows':[]};var _0x1d9b03=_[_0x5d1b('0x28')](db[_0x5d1b('0x29')][_0x5d1b('0x2a')],function(_0x54430c){return{'name':_0x54430c[_0x5d1b('0x2b')],'type':_0x54430c[_0x5d1b('0x2c')]['key']};});_0x5779a9[_0x5d1b('0x2d')]=_[_0x5d1b('0x28')](_0x1d9b03,_0x5d1b('0x25'));_0x5779a9[_0x5d1b('0x2e')]=_[_0x5d1b('0x2f')](_0xa712b8['query']);_0x5779a9['filters']=_[_0x5d1b('0x30')](_0x5779a9[_0x5d1b('0x2d')],_0x5779a9[_0x5d1b('0x2e')]);_0x4d5221[_0x5d1b('0x31')]=_[_0x5d1b('0x30')](_0x5779a9[_0x5d1b('0x2d')],qs[_0x5d1b('0x32')](_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x32')]));_0x4d5221[_0x5d1b('0x31')]=_0x4d5221[_0x5d1b('0x31')][_0x5d1b('0x33')]?_0x4d5221['attributes']:_0x5779a9[_0x5d1b('0x2d')];if(!_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x34')](_0x5d1b('0x35'))){_0x4d5221[_0x5d1b('0x19')]=qs['limit'](_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x19')]);_0x4d5221[_0x5d1b('0x17')]=qs['offset'](_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x17')]);}_0x4d5221[_0x5d1b('0x36')]=qs[_0x5d1b('0x37')](_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x37')]);_0x4d5221[_0x5d1b('0x38')]=qs['filters'](_['pick'](_0xa712b8[_0x5d1b('0x2e')],_0x5779a9[_0x5d1b('0x39')]),_0x1d9b03);if(_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x3a')]){_0x4d5221[_0x5d1b('0x38')]=_[_0x5d1b('0x3b')](_0x4d5221['where'],{'$or':_[_0x5d1b('0x28')](_0x1d9b03,function(_0x3c4503){if(_0x3c4503[_0x5d1b('0x2c')]!==_0x5d1b('0x3c')){var _0x15964c={};_0x15964c[_0x3c4503[_0x5d1b('0x25')]]={'$like':'%'+_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x3a')]+'%'};return _0x15964c;}})});}_0x4d5221=_['merge']({},_0x4d5221,_0xa712b8[_0x5d1b('0x3d')]);var _0x2ccace={'where':_0x4d5221['where']};return db[_0x5d1b('0x29')][_0x5d1b('0x1a')](_0x2ccace)[_0x5d1b('0x20')](function(_0x438a19){_0x497e27[_0x5d1b('0x1a')]=_0x438a19;if(_0xa712b8[_0x5d1b('0x2e')][_0x5d1b('0x3e')]){_0x4d5221['include']=[{'all':!![]}];}return db[_0x5d1b('0x29')]['findAll'](_0x4d5221);})[_0x5d1b('0x20')](function(_0x161638){_0x497e27[_0x5d1b('0x3f')]=_0x161638;return _0x497e27;})[_0x5d1b('0x20')](respondWithFilteredResult(_0x578eaf,_0x4d5221))[_0x5d1b('0x40')](handleError(_0x578eaf,null));};exports[_0x5d1b('0x41')]=function(_0xb40fdc,_0xf34b18){var _0x4d5711={'raw':!![],'where':{'id':_0xb40fdc[_0x5d1b('0x42')]['id']}},_0x1350d0={};_0x1350d0[_0x5d1b('0x2d')]=_[_0x5d1b('0x2f')](db[_0x5d1b('0x29')][_0x5d1b('0x2a')]);_0x1350d0[_0x5d1b('0x2e')]=_[_0x5d1b('0x2f')](_0xb40fdc[_0x5d1b('0x2e')]);_0x1350d0[_0x5d1b('0x39')]=_[_0x5d1b('0x30')](_0x1350d0['model'],_0x1350d0[_0x5d1b('0x2e')]);_0x4d5711[_0x5d1b('0x31')]=_[_0x5d1b('0x30')](_0x1350d0[_0x5d1b('0x2d')],qs[_0x5d1b('0x32')](_0xb40fdc[_0x5d1b('0x2e')][_0x5d1b('0x32')]));_0x4d5711['attributes']=_0x4d5711[_0x5d1b('0x31')][_0x5d1b('0x33')]?_0x4d5711[_0x5d1b('0x31')]:_0x1350d0['model'];if(_0xb40fdc[_0x5d1b('0x2e')][_0x5d1b('0x3e')]){_0x4d5711[_0x5d1b('0x43')]=[{'all':!![]}];}_0x4d5711=_[_0x5d1b('0x3b')]({},_0x4d5711,_0xb40fdc[_0x5d1b('0x3d')]);return db[_0x5d1b('0x29')]['find'](_0x4d5711)[_0x5d1b('0x20')](handleEntityNotFound(_0xf34b18,null))[_0x5d1b('0x20')](respondWithResult(_0xf34b18,null))[_0x5d1b('0x40')](handleError(_0xf34b18,null));};exports[_0x5d1b('0x44')]=function(_0x13ed4c,_0x3776dd){return db[_0x5d1b('0x29')][_0x5d1b('0x44')](_0x13ed4c[_0x5d1b('0x45')],{})[_0x5d1b('0x20')](respondWithResult(_0x3776dd,0xc9))['catch'](handleError(_0x3776dd,null));};exports[_0x5d1b('0x1f')]=function(_0x5bb09c,_0x5137ba){if(_0x5bb09c[_0x5d1b('0x45')]['id']){delete _0x5bb09c[_0x5d1b('0x45')]['id'];}return db[_0x5d1b('0x29')][_0x5d1b('0x46')]({'where':{'id':_0x5bb09c[_0x5d1b('0x42')]['id']}})[_0x5d1b('0x20')](handleEntityNotFound(_0x5137ba,null))[_0x5d1b('0x20')](saveUpdates(_0x5bb09c[_0x5d1b('0x45')],null))[_0x5d1b('0x20')](respondWithResult(_0x5137ba,null))[_0x5d1b('0x40')](handleError(_0x5137ba,null));};exports[_0x5d1b('0x21')]=function(_0x229beb,_0x19ae31){return db['AnalyticTreeReport'][_0x5d1b('0x46')]({'where':{'id':_0x229beb['params']['id']}})[_0x5d1b('0x20')](handleEntityNotFound(_0x19ae31,null))['then'](removeEntity(_0x19ae31,null))[_0x5d1b('0x40')](handleError(_0x19ae31,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index a9129ed..0a6c9f3 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 _0x5c0f=['analytics_report_trees','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5c0f,0x1e5));var _0xf5c0=function(_0x16c966,_0x3ce14b){_0x16c966=_0x16c966-0x0;var _0x1376b5=_0x5c0f[_0x16c966];return _0x1376b5;};'use strict';var _=require(_0xf5c0('0x0'));var util=require(_0xf5c0('0x1'));var logger=require(_0xf5c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf5c0('0x3'));var rp=require(_0xf5c0('0x4'));var fs=require('fs');var path=require(_0xf5c0('0x5'));var rimraf=require('rimraf');var config=require(_0xf5c0('0x6'));var attributes=require(_0xf5c0('0x7'));module[_0xf5c0('0x8')]=function(_0x3f03d0,_0x5e7fe7){return _0x3f03d0[_0xf5c0('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xf5c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d83=['bluebird','path','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger'];(function(_0x1d20e5,_0x3d4f74){var _0x14c8d3=function(_0x368a35){while(--_0x368a35){_0x1d20e5['push'](_0x1d20e5['shift']());}};_0x14c8d3(++_0x3d4f74);}(_0x8d83,0x115));var _0x38d8=function(_0x446acc,_0x2a6393){_0x446acc=_0x446acc-0x0;var _0x1aed7a=_0x8d83[_0x446acc];return _0x1aed7a;};'use strict';var _=require(_0x38d8('0x0'));var util=require('util');var logger=require(_0x38d8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x38d8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38d8('0x3'));var rimraf=require('rimraf');var config=require(_0x38d8('0x4'));var attributes=require(_0x38d8('0x5'));module['exports']=function(_0x367ec7,_0x14c574){return _0x367ec7[_0x38d8('0x6')](_0x38d8('0x7'),attributes,{'tableName':_0x38d8('0x8'),'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 3895724..252bef2 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5bee77,_0x583987){var _0x544fe1=function(_0x2ccf09){while(--_0x2ccf09){_0x5bee77['push'](_0x5bee77['shift']());}};_0x544fe1(++_0x583987);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1cb553,_0x4ec6c2){_0x1cb553=_0x1cb553-0x0;var _0xa9c515=_0x5f2f[_0x1cb553];return _0xa9c515;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x260c12,_0x4dba7f){var _0x2419d1=function(_0x3cefde){while(--_0x3cefde){_0x260c12['push'](_0x260c12['shift']());}};_0x2419d1(++_0x4dba7f);}(_0x1261,0x144));var _0x1126=function(_0x59522a,_0x14d1e5){_0x59522a=_0x59522a-0x0;var _0x30f09d=_0x1261[_0x59522a];return _0x30f09d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e6c5f35..6c4af74 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 _0xbc0e=['post','create','put','update','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show'];(function(_0x365ce1,_0x211aa3){var _0x29473c=function(_0x2fa576){while(--_0x2fa576){_0x365ce1['push'](_0x365ce1['shift']());}};_0x29473c(++_0x211aa3);}(_0xbc0e,0x15c));var _0xebc0=function(_0x27e911,_0x4c232a){_0x27e911=_0x27e911-0x0;var _0x521b22=_0xbc0e[_0x27e911];return _0x521b22;};'use strict';var multer=require('multer');var util=require(_0xebc0('0x0'));var path=require(_0xebc0('0x1'));var timeout=require(_0xebc0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xebc0('0x3'));var auth=require(_0xebc0('0x4'));var interaction=require(_0xebc0('0x5'));var config=require(_0xebc0('0x6'));var controller=require(_0xebc0('0x7'));router['get']('/',auth[_0xebc0('0x8')](),controller[_0xebc0('0x9')]);router['get'](_0xebc0('0xa'),auth['isAuthenticated'](),controller[_0xebc0('0xb')]);router[_0xebc0('0xc')]('/',auth['isAuthenticated'](),controller[_0xebc0('0xd')]);router[_0xebc0('0xe')](_0xebc0('0xa'),auth[_0xebc0('0x8')](),controller[_0xebc0('0xf')]);router['delete']('/:id',auth[_0xebc0('0x8')](),controller[_0xebc0('0x10')]);module[_0xebc0('0x11')]=router; \ No newline at end of file +var _0x5422=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x5422,0xd0));var _0x2542=function(_0x9117ad,_0x386be4){_0x9117ad=_0x9117ad-0x0;var _0x540f0c=_0x5422[_0x9117ad];return _0x540f0c;};'use strict';var multer=require(_0x2542('0x0'));var util=require(_0x2542('0x1'));var path=require(_0x2542('0x2'));var timeout=require(_0x2542('0x3'));var express=require('express');var router=express[_0x2542('0x4')]();var fs_extra=require(_0x2542('0x5'));var auth=require(_0x2542('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2542('0x7'));var controller=require(_0x2542('0x8'));router['get']('/',auth[_0x2542('0x9')](),controller[_0x2542('0xa')]);router[_0x2542('0xb')](_0x2542('0xc'),auth['isAuthenticated'](),controller[_0x2542('0xd')]);router[_0x2542('0xe')]('/',auth[_0x2542('0x9')](),controller[_0x2542('0xf')]);router[_0x2542('0x10')]('/:id',auth[_0x2542('0x9')](),controller[_0x2542('0x11')]);router[_0x2542('0x12')](_0x2542('0xc'),auth['isAuthenticated'](),controller[_0x2542('0x13')]);module[_0x2542('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 7a29771..8b4fbdb 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 _0x48d0=['STRING','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x48d0,0xd3));var _0x048d=function(_0x6607e1,_0x198de0){_0x6607e1=_0x6607e1-0x0;var _0x51b598=_0x48d0[_0x6607e1];return _0x51b598;};'use strict';var Sequelize=require(_0x048d('0x0'));module[_0x048d('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x048d('0x2')]},'type':{'type':Sequelize[_0x048d('0x2')]}}; \ No newline at end of file +var _0xe80c=['exports','STRING'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xe80c,0x1c2));var _0xce80=function(_0x5d0e83,_0x48726d){_0x5d0e83=_0x5d0e83-0x0;var _0x421a85=_0xe80c[_0x5d0e83];return _0x421a85;};'use strict';var Sequelize=require('sequelize');module[_0xce80('0x0')]={'name':{'type':Sequelize[_0xce80('0x1')]},'basename':{'type':Sequelize[_0xce80('0x1')]},'type':{'type':Sequelize[_0xce80('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 33ed9c3..b7d3c84 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 _0xc675=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','findAll','rows','catch','params','include','find','clone','body','omit','createdAt','updatedAt','create','originalname','basename','file','filename','mimetype','download','ChatOfflineMessageId','root','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','error','name','send','map','rawAttributes'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0xc675,0x136));var _0x5c67=function(_0x4f765c,_0x141454){_0x4f765c=_0x4f765c-0x0;var _0x6309ba=_0xc675[_0x4f765c];return _0x6309ba;};'use strict';var emlformat=require(_0x5c67('0x0'));var rimraf=require(_0x5c67('0x1'));var zipdir=require(_0x5c67('0x2'));var jsonpatch=require(_0x5c67('0x3'));var rp=require(_0x5c67('0x4'));var moment=require(_0x5c67('0x5'));var BPromise=require(_0x5c67('0x6'));var Mustache=require(_0x5c67('0x7'));var util=require(_0x5c67('0x8'));var path=require(_0x5c67('0x9'));var sox=require('sox');var csv=require(_0x5c67('0xa'));var ejs=require(_0x5c67('0xb'));var fs=require('fs');var fs_extra=require(_0x5c67('0xc'));var _=require(_0x5c67('0xd'));var squel=require(_0x5c67('0xe'));var crypto=require(_0x5c67('0xf'));var jsforce=require(_0x5c67('0x10'));var deskjs=require(_0x5c67('0x11'));var toCsv=require(_0x5c67('0xa'));var querystring=require(_0x5c67('0x12'));var Papa=require(_0x5c67('0x13'));var Redis=require(_0x5c67('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c67('0x15'));var hardwareService=require(_0x5c67('0x16'));var logger=require(_0x5c67('0x17'))(_0x5c67('0x18'));var utils=require(_0x5c67('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5c67('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17a6f5,_0x175106){_0x175106=_0x175106||0xcc;return function(_0x5f369c){if(_0x5f369c){return _0x17a6f5[_0x5c67('0x1b')](_0x175106);}return _0x17a6f5[_0x5c67('0x1c')](_0x175106)[_0x5c67('0x1d')]();};}function respondWithResult(_0x54d8e0,_0x15720f){_0x15720f=_0x15720f||0xc8;return function(_0x73cb21){if(_0x73cb21){return _0x54d8e0[_0x5c67('0x1c')](_0x15720f)[_0x5c67('0x1e')](_0x73cb21);}};}function respondWithFilteredResult(_0x63a09e,_0x575022){return function(_0x40bbcd){if(_0x40bbcd){var _0x3e05a2=typeof _0x575022[_0x5c67('0x1f')]==='undefined'&&typeof _0x575022['limit']===_0x5c67('0x20');var _0x1b0e68=_0x40bbcd['count'];var _0x3a70e3=_0x3e05a2?0x0:_0x575022[_0x5c67('0x1f')];var _0x7798d4=_0x3e05a2?_0x40bbcd[_0x5c67('0x21')]:_0x575022[_0x5c67('0x1f')]+_0x575022[_0x5c67('0x22')];var _0x10c363;if(_0x7798d4>=_0x1b0e68){_0x7798d4=_0x1b0e68;_0x10c363=0xc8;}else{_0x10c363=0xce;}_0x63a09e[_0x5c67('0x1c')](_0x10c363);return _0x63a09e['set']('Content-Range',_0x3a70e3+'-'+_0x7798d4+'/'+_0x1b0e68)[_0x5c67('0x1e')](_0x40bbcd);}return null;};}function patchUpdates(_0xa1d0ad){return function(_0x4dead3){try{jsonpatch[_0x5c67('0x23')](_0x4dead3,_0xa1d0ad,!![]);}catch(_0xde872c){return BPromise[_0x5c67('0x24')](_0xde872c);}return _0x4dead3[_0x5c67('0x25')]();};}function saveUpdates(_0x4ff14f,_0xf857bb){return function(_0x5cde35){if(_0x5cde35){return _0x5cde35[_0x5c67('0x26')](_0x4ff14f)['then'](function(_0xfb6fb9){return _0xfb6fb9;});}return null;};}function removeEntity(_0x3286d2,_0x46af14){return function(_0x3eadb2){if(_0x3eadb2){return _0x3eadb2[_0x5c67('0x27')]()[_0x5c67('0x28')](function(){_0x3286d2[_0x5c67('0x1c')](0xcc)[_0x5c67('0x1d')]();});}};}function handleEntityNotFound(_0x5e7300,_0x4ede8d){return function(_0x2c2c4c){if(!_0x2c2c4c){_0x5e7300[_0x5c67('0x1b')](0x194);}return _0x2c2c4c;};}function handleError(_0x248b6d,_0x121d01){_0x121d01=_0x121d01||0x1f4;return function(_0x38cdc3){logger[_0x5c67('0x29')](_0x38cdc3['stack']);if(_0x38cdc3['name']){delete _0x38cdc3[_0x5c67('0x2a')];}_0x248b6d[_0x5c67('0x1c')](_0x121d01)[_0x5c67('0x2b')](_0x38cdc3);};}exports['index']=function(_0xe8b79,_0x2ab374){var _0x48cecb={},_0x2688f4={},_0x11de85={'count':0x0,'rows':[]};var _0x112895=_[_0x5c67('0x2c')](db['Attachment'][_0x5c67('0x2d')],function(_0x2ace7a){return{'name':_0x2ace7a[_0x5c67('0x2e')],'type':_0x2ace7a[_0x5c67('0x2f')][_0x5c67('0x30')]};});_0x2688f4[_0x5c67('0x31')]=_[_0x5c67('0x2c')](_0x112895,_0x5c67('0x2a'));_0x2688f4[_0x5c67('0x32')]=_[_0x5c67('0x33')](_0xe8b79['query']);_0x2688f4[_0x5c67('0x34')]=_[_0x5c67('0x35')](_0x2688f4['model'],_0x2688f4[_0x5c67('0x32')]);_0x48cecb['attributes']=_[_0x5c67('0x35')](_0x2688f4[_0x5c67('0x31')],qs[_0x5c67('0x36')](_0xe8b79[_0x5c67('0x32')]['fields']));_0x48cecb[_0x5c67('0x37')]=_0x48cecb[_0x5c67('0x37')][_0x5c67('0x38')]?_0x48cecb[_0x5c67('0x37')]:_0x2688f4[_0x5c67('0x31')];if(!_0xe8b79[_0x5c67('0x32')]['hasOwnProperty'](_0x5c67('0x39'))){_0x48cecb[_0x5c67('0x22')]=qs[_0x5c67('0x22')](_0xe8b79[_0x5c67('0x32')][_0x5c67('0x22')]);_0x48cecb[_0x5c67('0x1f')]=qs[_0x5c67('0x1f')](_0xe8b79[_0x5c67('0x32')]['offset']);}_0x48cecb[_0x5c67('0x3a')]=qs[_0x5c67('0x3b')](_0xe8b79[_0x5c67('0x32')]['sort']);_0x48cecb[_0x5c67('0x3c')]=qs[_0x5c67('0x34')](_[_0x5c67('0x3d')](_0xe8b79['query'],_0x2688f4['filters']),_0x112895);if(_0xe8b79['query'][_0x5c67('0x3e')]){_0x48cecb['where']=_[_0x5c67('0x3f')](_0x48cecb[_0x5c67('0x3c')],{'$or':_[_0x5c67('0x2c')](_0x112895,function(_0x39f4fc){if(_0x39f4fc[_0x5c67('0x2f')]!==_0x5c67('0x40')){var _0x3bfb40={};_0x3bfb40[_0x39f4fc[_0x5c67('0x2a')]]={'$like':'%'+_0xe8b79['query']['filter']+'%'};return _0x3bfb40;}})});}_0x48cecb=_[_0x5c67('0x3f')]({},_0x48cecb,_0xe8b79[_0x5c67('0x41')]);var _0x52f97f={'where':_0x48cecb[_0x5c67('0x3c')]};return db[_0x5c67('0x42')][_0x5c67('0x21')](_0x52f97f)['then'](function(_0x596794){_0x11de85[_0x5c67('0x21')]=_0x596794;if(_0xe8b79[_0x5c67('0x32')][_0x5c67('0x43')]){_0x48cecb['include']=[{'all':!![]}];}return db['Attachment'][_0x5c67('0x44')](_0x48cecb);})[_0x5c67('0x28')](function(_0x521055){_0x11de85[_0x5c67('0x45')]=_0x521055;return _0x11de85;})[_0x5c67('0x28')](respondWithFilteredResult(_0x2ab374,_0x48cecb))[_0x5c67('0x46')](handleError(_0x2ab374,null));};exports['show']=function(_0x2b7f3a,_0x4cac81){var _0x1f033f={'raw':!![],'where':{'id':_0x2b7f3a[_0x5c67('0x47')]['id']}},_0x1e9a5f={};_0x1e9a5f['model']=_[_0x5c67('0x33')](db[_0x5c67('0x42')]['rawAttributes']);_0x1e9a5f[_0x5c67('0x32')]=_[_0x5c67('0x33')](_0x2b7f3a['query']);_0x1e9a5f[_0x5c67('0x34')]=_[_0x5c67('0x35')](_0x1e9a5f[_0x5c67('0x31')],_0x1e9a5f[_0x5c67('0x32')]);_0x1f033f[_0x5c67('0x37')]=_[_0x5c67('0x35')](_0x1e9a5f[_0x5c67('0x31')],qs[_0x5c67('0x36')](_0x2b7f3a[_0x5c67('0x32')]['fields']));_0x1f033f['attributes']=_0x1f033f[_0x5c67('0x37')]['length']?_0x1f033f['attributes']:_0x1e9a5f[_0x5c67('0x31')];if(_0x2b7f3a['query'][_0x5c67('0x43')]){_0x1f033f[_0x5c67('0x48')]=[{'all':!![]}];}_0x1f033f=_[_0x5c67('0x3f')]({},_0x1f033f,_0x2b7f3a[_0x5c67('0x41')]);return db[_0x5c67('0x42')][_0x5c67('0x49')](_0x1f033f)['then'](handleEntityNotFound(_0x4cac81,null))[_0x5c67('0x28')](respondWithResult(_0x4cac81,null))[_0x5c67('0x46')](handleError(_0x4cac81,null));};exports[_0x5c67('0x4a')]=function(_0x476762,_0x247b92){var _0x43729c={'where':{'id':_0x476762[_0x5c67('0x47')]['id']}},_0x5785a1={};_0x5785a1[_0x5c67('0x31')]=_[_0x5c67('0x33')](db['Attachment'][_0x5c67('0x2d')]);_0x43729c[_0x5c67('0x37')]=_[_0x5c67('0x35')](_0x5785a1['model'],qs[_0x5c67('0x36')](_0x476762[_0x5c67('0x32')]['fields']));_0x43729c[_0x5c67('0x37')]=_0x43729c[_0x5c67('0x37')][_0x5c67('0x38')]?_0x43729c[_0x5c67('0x37')]:_0x5785a1[_0x5c67('0x31')];if(_0x476762['query']['includeAll']){_0x43729c[_0x5c67('0x48')]=[{'all':!![]}];}_0x43729c=_[_0x5c67('0x3f')]({},_0x43729c,_0x476762[_0x5c67('0x41')]);return db[_0x5c67('0x42')]['find'](_0x43729c)['then'](handleEntityNotFound(_0x247b92,null))[_0x5c67('0x28')](function(_0x5ddfd2){if(_0x5ddfd2){var _0x5e1937=_0x5ddfd2['get']({'plain':!![]});_0x5e1937=qs['omit'](_0x5e1937,['id','createdAt','updatedAt']);_0x476762[_0x5c67('0x4b')]=_[_0x5c67('0x4c')](_0x476762['body'],['id',_0x5c67('0x4d'),_0x5c67('0x4e')]);return db[_0x5c67('0x42')][_0x5c67('0x4f')](_[_0x5c67('0x3f')](_0x5e1937,_0x476762[_0x5c67('0x4b')]),{'include':_0x476762[_0x5c67('0x32')][_0x5c67('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x247b92,0xc9))[_0x5c67('0x46')](handleError(_0x247b92,null));};exports['update']=function(_0x9cd64b,_0xea65d7){if(_0x9cd64b[_0x5c67('0x4b')]['id']){delete _0x9cd64b[_0x5c67('0x4b')]['id'];}return db['Attachment'][_0x5c67('0x49')]({'where':{'id':_0x9cd64b[_0x5c67('0x47')]['id']}})[_0x5c67('0x28')](handleEntityNotFound(_0xea65d7,null))['then'](saveUpdates(_0x9cd64b[_0x5c67('0x4b')],null))[_0x5c67('0x28')](respondWithResult(_0xea65d7,null))[_0x5c67('0x46')](handleError(_0xea65d7,null));};exports[_0x5c67('0x27')]=function(_0x3444e5,_0x5c9564){return db[_0x5c67('0x42')][_0x5c67('0x49')]({'where':{'id':_0x3444e5[_0x5c67('0x47')]['id']}})[_0x5c67('0x28')](handleEntityNotFound(_0x5c9564,null))[_0x5c67('0x28')](removeEntity(_0x5c9564,null))[_0x5c67('0x46')](handleError(_0x5c9564,null));};exports['create']=function(_0xabbd37,_0x57bee9,_0x30b726){_0xabbd37[_0x5c67('0x4b')][_0x5c67('0x2a')]=_0xabbd37['file'][_0x5c67('0x50')];_0xabbd37[_0x5c67('0x4b')][_0x5c67('0x51')]=_0xabbd37[_0x5c67('0x52')][_0x5c67('0x53')];_0xabbd37['body'][_0x5c67('0x2f')]=_0xabbd37[_0x5c67('0x52')][_0x5c67('0x54')];return db[_0x5c67('0x42')][_0x5c67('0x4f')](_0xabbd37[_0x5c67('0x4b')])[_0x5c67('0x28')](respondWithResult(_0x57bee9,0xc9))['catch'](handleError(_0x57bee9,null));};exports[_0x5c67('0x55')]=function(_0x47aefa,_0x5eecb0,_0x17887a){return db[_0x5c67('0x42')]['findOne']({'where':{'id':_0x47aefa[_0x5c67('0x47')]['id']},'raw':!![]})[_0x5c67('0x28')](handleEntityNotFound(_0x5eecb0,null))['then'](function(_0x3a9b50){if(_0x3a9b50){var _0x5ab560=_0x3a9b50[_0x5c67('0x56')]!==null;var _0x1dbf67=path['join'](config[_0x5c67('0x57')],'server/files/attachments/');if(_0x5ab560){_0x1dbf67=path[_0x5c67('0x58')](_0x1dbf67,'offline-chat/');}var _0x315b79=path[_0x5c67('0x58')](_0x1dbf67,_0x3a9b50[_0x5c67('0x51')]);return _0x5eecb0[_0x5c67('0x55')](_0x315b79);}})[_0x5c67('0x46')](handleError(_0x5eecb0,null));}; \ No newline at end of file +var _0xe259=['eml-format','rimraf','request-promise','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','end','error','name','send','Attachment','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','clone','createdAt','body','omit','updatedAt','create','destroy','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/'];(function(_0x1f69fd,_0x36e470){var _0x5b0d76=function(_0x1f109e){while(--_0x1f109e){_0x1f69fd['push'](_0x1f69fd['shift']());}};_0x5b0d76(++_0x36e470);}(_0xe259,0x1f2));var _0x9e25=function(_0x1835cb,_0x2d22a6){_0x1835cb=_0x1835cb-0x0;var _0x3d3ff2=_0xe259[_0x1835cb];return _0x3d3ff2;};'use strict';var emlformat=require(_0x9e25('0x0'));var rimraf=require(_0x9e25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e25('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9e25('0x3'));var util=require(_0x9e25('0x4'));var path=require(_0x9e25('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e25('0x6'));var fs=require('fs');var fs_extra=require(_0x9e25('0x7'));var _=require('lodash');var squel=require(_0x9e25('0x8'));var crypto=require(_0x9e25('0x9'));var jsforce=require(_0x9e25('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9e25('0xb'));var querystring=require(_0x9e25('0xc'));var Papa=require(_0x9e25('0xd'));var Redis=require('ioredis');var authService=require(_0x9e25('0xe'));var qs=require(_0x9e25('0xf'));var as=require(_0x9e25('0x10'));var hardwareService=require(_0x9e25('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x9e25('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9e25('0x13'));var db=require(_0x9e25('0x14'))['db'];function respondWithStatusCode(_0xab72b2,_0x5d6993){_0x5d6993=_0x5d6993||0xcc;return function(_0x136a7b){if(_0x136a7b){return _0xab72b2[_0x9e25('0x15')](_0x5d6993);}return _0xab72b2['status'](_0x5d6993)['end']();};}function respondWithResult(_0x5a3d39,_0x1c4f09){_0x1c4f09=_0x1c4f09||0xc8;return function(_0x5219f0){if(_0x5219f0){return _0x5a3d39[_0x9e25('0x16')](_0x1c4f09)[_0x9e25('0x17')](_0x5219f0);}};}function respondWithFilteredResult(_0x402e2d,_0x34947b){return function(_0x7b1256){if(_0x7b1256){var _0x6be5aa=typeof _0x34947b['offset']===_0x9e25('0x18')&&typeof _0x34947b[_0x9e25('0x19')]===_0x9e25('0x18');var _0x2ba6f3=_0x7b1256['count'];var _0x34ed17=_0x6be5aa?0x0:_0x34947b[_0x9e25('0x1a')];var _0x3b4b8c=_0x6be5aa?_0x7b1256[_0x9e25('0x1b')]:_0x34947b[_0x9e25('0x1a')]+_0x34947b[_0x9e25('0x19')];var _0x43ca93;if(_0x3b4b8c>=_0x2ba6f3){_0x3b4b8c=_0x2ba6f3;_0x43ca93=0xc8;}else{_0x43ca93=0xce;}_0x402e2d[_0x9e25('0x16')](_0x43ca93);return _0x402e2d['set'](_0x9e25('0x1c'),_0x34ed17+'-'+_0x3b4b8c+'/'+_0x2ba6f3)[_0x9e25('0x17')](_0x7b1256);}return null;};}function patchUpdates(_0xea7833){return function(_0x3167d8){try{jsonpatch[_0x9e25('0x1d')](_0x3167d8,_0xea7833,!![]);}catch(_0x13d0a1){return BPromise['reject'](_0x13d0a1);}return _0x3167d8[_0x9e25('0x1e')]();};}function saveUpdates(_0x4387e9,_0x260998){return function(_0x2dd380){if(_0x2dd380){return _0x2dd380[_0x9e25('0x1f')](_0x4387e9)[_0x9e25('0x20')](function(_0x2b8c43){return _0x2b8c43;});}return null;};}function removeEntity(_0xf6e12d,_0x2bbd62){return function(_0x1dd7c7){if(_0x1dd7c7){return _0x1dd7c7['destroy']()['then'](function(){_0xf6e12d[_0x9e25('0x16')](0xcc)[_0x9e25('0x21')]();});}};}function handleEntityNotFound(_0x5d7bdf,_0x585e68){return function(_0x64220e){if(!_0x64220e){_0x5d7bdf[_0x9e25('0x15')](0x194);}return _0x64220e;};}function handleError(_0x399cc8,_0x59fa8b){_0x59fa8b=_0x59fa8b||0x1f4;return function(_0x3e3856){logger[_0x9e25('0x22')](_0x3e3856['stack']);if(_0x3e3856[_0x9e25('0x23')]){delete _0x3e3856[_0x9e25('0x23')];}_0x399cc8['status'](_0x59fa8b)[_0x9e25('0x24')](_0x3e3856);};}exports['index']=function(_0xf1db0,_0x55d9db){var _0x383f85={},_0x1fe343={},_0x9465a7={'count':0x0,'rows':[]};var _0x3c0b31=_['map'](db[_0x9e25('0x25')]['rawAttributes'],function(_0x5863e8){return{'name':_0x5863e8['fieldName'],'type':_0x5863e8[_0x9e25('0x26')][_0x9e25('0x27')]};});_0x1fe343['model']=_[_0x9e25('0x28')](_0x3c0b31,_0x9e25('0x23'));_0x1fe343[_0x9e25('0x29')]=_[_0x9e25('0x2a')](_0xf1db0[_0x9e25('0x29')]);_0x1fe343[_0x9e25('0x2b')]=_[_0x9e25('0x2c')](_0x1fe343['model'],_0x1fe343[_0x9e25('0x29')]);_0x383f85[_0x9e25('0x2d')]=_[_0x9e25('0x2c')](_0x1fe343['model'],qs[_0x9e25('0x2e')](_0xf1db0[_0x9e25('0x29')][_0x9e25('0x2e')]));_0x383f85[_0x9e25('0x2d')]=_0x383f85[_0x9e25('0x2d')][_0x9e25('0x2f')]?_0x383f85[_0x9e25('0x2d')]:_0x1fe343[_0x9e25('0x30')];if(!_0xf1db0['query'][_0x9e25('0x31')]('nolimit')){_0x383f85['limit']=qs[_0x9e25('0x19')](_0xf1db0['query'][_0x9e25('0x19')]);_0x383f85[_0x9e25('0x1a')]=qs[_0x9e25('0x1a')](_0xf1db0['query'][_0x9e25('0x1a')]);}_0x383f85[_0x9e25('0x32')]=qs[_0x9e25('0x33')](_0xf1db0[_0x9e25('0x29')][_0x9e25('0x33')]);_0x383f85[_0x9e25('0x34')]=qs[_0x9e25('0x2b')](_[_0x9e25('0x35')](_0xf1db0[_0x9e25('0x29')],_0x1fe343[_0x9e25('0x2b')]),_0x3c0b31);if(_0xf1db0[_0x9e25('0x29')][_0x9e25('0x36')]){_0x383f85[_0x9e25('0x34')]=_[_0x9e25('0x37')](_0x383f85[_0x9e25('0x34')],{'$or':_[_0x9e25('0x28')](_0x3c0b31,function(_0x3c88dd){if(_0x3c88dd[_0x9e25('0x26')]!==_0x9e25('0x38')){var _0x1dc539={};_0x1dc539[_0x3c88dd['name']]={'$like':'%'+_0xf1db0[_0x9e25('0x29')][_0x9e25('0x36')]+'%'};return _0x1dc539;}})});}_0x383f85=_[_0x9e25('0x37')]({},_0x383f85,_0xf1db0[_0x9e25('0x39')]);var _0x4a8288={'where':_0x383f85[_0x9e25('0x34')]};return db[_0x9e25('0x25')]['count'](_0x4a8288)['then'](function(_0x4c4ccf){_0x9465a7[_0x9e25('0x1b')]=_0x4c4ccf;if(_0xf1db0[_0x9e25('0x29')][_0x9e25('0x3a')]){_0x383f85[_0x9e25('0x3b')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x383f85);})[_0x9e25('0x20')](function(_0x1ace51){_0x9465a7[_0x9e25('0x3c')]=_0x1ace51;return _0x9465a7;})[_0x9e25('0x20')](respondWithFilteredResult(_0x55d9db,_0x383f85))[_0x9e25('0x3d')](handleError(_0x55d9db,null));};exports[_0x9e25('0x3e')]=function(_0x527820,_0x13444a){var _0x599beb={'raw':!![],'where':{'id':_0x527820[_0x9e25('0x3f')]['id']}},_0x17610e={};_0x17610e[_0x9e25('0x30')]=_[_0x9e25('0x2a')](db[_0x9e25('0x25')][_0x9e25('0x40')]);_0x17610e['query']=_[_0x9e25('0x2a')](_0x527820['query']);_0x17610e[_0x9e25('0x2b')]=_[_0x9e25('0x2c')](_0x17610e[_0x9e25('0x30')],_0x17610e['query']);_0x599beb[_0x9e25('0x2d')]=_['intersection'](_0x17610e[_0x9e25('0x30')],qs[_0x9e25('0x2e')](_0x527820[_0x9e25('0x29')][_0x9e25('0x2e')]));_0x599beb[_0x9e25('0x2d')]=_0x599beb['attributes'][_0x9e25('0x2f')]?_0x599beb[_0x9e25('0x2d')]:_0x17610e[_0x9e25('0x30')];if(_0x527820['query'][_0x9e25('0x3a')]){_0x599beb['include']=[{'all':!![]}];}_0x599beb=_[_0x9e25('0x37')]({},_0x599beb,_0x527820[_0x9e25('0x39')]);return db['Attachment'][_0x9e25('0x41')](_0x599beb)[_0x9e25('0x20')](handleEntityNotFound(_0x13444a,null))['then'](respondWithResult(_0x13444a,null))[_0x9e25('0x3d')](handleError(_0x13444a,null));};exports[_0x9e25('0x42')]=function(_0x54e955,_0x209779){var _0x37b600={'where':{'id':_0x54e955[_0x9e25('0x3f')]['id']}},_0x2e9b25={};_0x2e9b25[_0x9e25('0x30')]=_['keys'](db[_0x9e25('0x25')][_0x9e25('0x40')]);_0x37b600[_0x9e25('0x2d')]=_['intersection'](_0x2e9b25[_0x9e25('0x30')],qs[_0x9e25('0x2e')](_0x54e955[_0x9e25('0x29')][_0x9e25('0x2e')]));_0x37b600[_0x9e25('0x2d')]=_0x37b600['attributes'][_0x9e25('0x2f')]?_0x37b600['attributes']:_0x2e9b25['model'];if(_0x54e955['query'][_0x9e25('0x3a')]){_0x37b600[_0x9e25('0x3b')]=[{'all':!![]}];}_0x37b600=_[_0x9e25('0x37')]({},_0x37b600,_0x54e955[_0x9e25('0x39')]);return db['Attachment'][_0x9e25('0x41')](_0x37b600)[_0x9e25('0x20')](handleEntityNotFound(_0x209779,null))[_0x9e25('0x20')](function(_0x479e42){if(_0x479e42){var _0xb21b48=_0x479e42['get']({'plain':!![]});_0xb21b48=qs['omit'](_0xb21b48,['id',_0x9e25('0x43'),'updatedAt']);_0x54e955[_0x9e25('0x44')]=_[_0x9e25('0x45')](_0x54e955['body'],['id',_0x9e25('0x43'),_0x9e25('0x46')]);return db[_0x9e25('0x25')][_0x9e25('0x47')](_['merge'](_0xb21b48,_0x54e955['body']),{'include':_0x54e955[_0x9e25('0x29')][_0x9e25('0x3a')]?[{'all':!![]}]:undefined});}})[_0x9e25('0x20')](respondWithResult(_0x209779,0xc9))['catch'](handleError(_0x209779,null));};exports[_0x9e25('0x1f')]=function(_0x9e83f3,_0x1184a3){if(_0x9e83f3[_0x9e25('0x44')]['id']){delete _0x9e83f3[_0x9e25('0x44')]['id'];}return db['Attachment'][_0x9e25('0x41')]({'where':{'id':_0x9e83f3[_0x9e25('0x3f')]['id']}})[_0x9e25('0x20')](handleEntityNotFound(_0x1184a3,null))[_0x9e25('0x20')](saveUpdates(_0x9e83f3['body'],null))[_0x9e25('0x20')](respondWithResult(_0x1184a3,null))[_0x9e25('0x3d')](handleError(_0x1184a3,null));};exports[_0x9e25('0x48')]=function(_0x421fb9,_0x36702a){return db[_0x9e25('0x25')]['find']({'where':{'id':_0x421fb9[_0x9e25('0x3f')]['id']}})[_0x9e25('0x20')](handleEntityNotFound(_0x36702a,null))['then'](removeEntity(_0x36702a,null))[_0x9e25('0x3d')](handleError(_0x36702a,null));};exports['create']=function(_0x88d6f5,_0x440fc0,_0x31d6cb){_0x88d6f5[_0x9e25('0x44')]['name']=_0x88d6f5[_0x9e25('0x49')][_0x9e25('0x4a')];_0x88d6f5[_0x9e25('0x44')][_0x9e25('0x4b')]=_0x88d6f5[_0x9e25('0x49')][_0x9e25('0x4c')];_0x88d6f5[_0x9e25('0x44')]['type']=_0x88d6f5[_0x9e25('0x49')][_0x9e25('0x4d')];return db[_0x9e25('0x25')][_0x9e25('0x47')](_0x88d6f5[_0x9e25('0x44')])[_0x9e25('0x20')](respondWithResult(_0x440fc0,0xc9))[_0x9e25('0x3d')](handleError(_0x440fc0,null));};exports[_0x9e25('0x4e')]=function(_0x2509aa,_0x3b091a,_0x3e6310){return db[_0x9e25('0x25')]['findOne']({'where':{'id':_0x2509aa[_0x9e25('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b091a,null))['then'](function(_0x11d916){if(_0x11d916){var _0x12f607=_0x11d916[_0x9e25('0x4f')]!==null;var _0x252fa6=path[_0x9e25('0x50')](config[_0x9e25('0x51')],_0x9e25('0x52'));if(_0x12f607){_0x252fa6=path['join'](_0x252fa6,'offline-chat/');}var _0xa350f7=path[_0x9e25('0x50')](_0x252fa6,_0x11d916[_0x9e25('0x4b')]);return _0x3b091a[_0x9e25('0x4e')](_0xa350f7);}})[_0x9e25('0x3d')](handleError(_0x3b091a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index ddf1389..9fd6e37 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 _0xc98e=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','Attachment'];(function(_0x515cff,_0x4fb356){var _0x128bf4=function(_0x2805c1){while(--_0x2805c1){_0x515cff['push'](_0x515cff['shift']());}};_0x128bf4(++_0x4fb356);}(_0xc98e,0x172));var _0xec98=function(_0x486cc1,_0xa22270){_0x486cc1=_0x486cc1-0x0;var _0x510c05=_0xc98e[_0x486cc1];return _0x510c05;};'use strict';var _=require(_0xec98('0x0'));var util=require(_0xec98('0x1'));var logger=require(_0xec98('0x2'))('api');var moment=require(_0xec98('0x3'));var BPromise=require(_0xec98('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec98('0x5'));var rimraf=require('rimraf');var config=require(_0xec98('0x6'));var attributes=require('./attachment.attributes');module[_0xec98('0x7')]=function(_0x2f5415,_0x3197b1){return _0x2f5415[_0xec98('0x8')](_0xec98('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa256=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','attachments'];(function(_0xf3fb4e,_0x1f8665){var _0x561bdb=function(_0x2a538c){while(--_0x2a538c){_0xf3fb4e['push'](_0xf3fb4e['shift']());}};_0x561bdb(++_0x1f8665);}(_0xa256,0x1c2));var _0x6a25=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xa256[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x6a25('0x0'));var util=require('util');var logger=require(_0x6a25('0x1'))(_0x6a25('0x2'));var moment=require(_0x6a25('0x3'));var BPromise=require(_0x6a25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a25('0x5'));var rimraf=require(_0x6a25('0x6'));var config=require(_0x6a25('0x7'));var attributes=require(_0x6a25('0x8'));module['exports']=function(_0x3111e3,_0x296057){return _0x3111e3['define']('Attachment',attributes,{'tableName':_0x6a25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index d3b53cf..9bc12ae 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 _0xfaa4=['http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x53b105,_0x398d9a){var _0xd09f06=function(_0x1c7a78){while(--_0x1c7a78){_0x53b105['push'](_0x53b105['shift']());}};_0xd09f06(++_0x398d9a);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x8d5984,_0x666b0a){_0x8d5984=_0x8d5984-0x0;var _0x22a5e3=_0xfaa4[_0x8d5984];return _0x22a5e3;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var moment=require(_0x4faa('0x2'));var BPromise=require(_0x4faa('0x3'));var rs=require(_0x4faa('0x4'));var fs=require('fs');var Redis=require(_0x4faa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4faa('0x6'));var logger=require(_0x4faa('0x7'))(_0x4faa('0x8'));var config=require(_0x4faa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4faa('0xa')][_0x4faa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa46a7d,_0x504f83,_0x528871){return new BPromise(function(_0x5d476f,_0x159843){return client[_0x4faa('0xc')](_0xa46a7d,_0x528871)[_0x4faa('0xd')](function(_0x4dd4d4){logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,_0x4faa('0x10'));logger[_0x4faa('0x11')](_0x4faa('0x12'),_0x504f83,'request\x20sent',JSON['stringify'](_0x4dd4d4));if(_0x4dd4d4[_0x4faa('0x13')]){if(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x14')]===0x1f4){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x159843(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);}logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x5d476f(_0x4dd4d4['error'][_0x4faa('0x15')]);}else{logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,'request\x20sent');_0x5d476f(_0x4dd4d4[_0x4faa('0x16')][_0x4faa('0x15')]);}})[_0x4faa('0x17')](function(_0x536a2b){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x536a2b);_0x159843(_0x536a2b);});});}exports['CreateAttachment']=function(_0x5d8c8a){var _0x5444d9=this;return new Promise(function(_0x33592d,_0x361cdc){return db[_0x4faa('0x18')][_0x4faa('0x19')](_0x5d8c8a['body'],{'raw':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![]})[_0x4faa('0xd')](function(_0x492417){logger[_0x4faa('0xe')]('CreateAttachment',_0x5d8c8a);logger['debug'](_0x4faa('0x1c'),_0x5d8c8a,JSON['stringify'](_0x492417));_0x33592d(_0x492417);})['catch'](function(_0x14683b){logger[_0x4faa('0x13')](_0x4faa('0x1c'),_0x14683b[_0x4faa('0x15')],_0x5d8c8a);_0x361cdc(_0x5444d9[_0x4faa('0x13')](0x1f4,_0x14683b[_0x4faa('0x15')]));});});}; \ No newline at end of file +var _0x7dc2=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27dc('0x0'));var BPromise=require(_0x27dc('0x1'));var rs=require(_0x27dc('0x2'));var fs=require('fs');var Redis=require(_0x27dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27dc('0x4'));var logger=require(_0x27dc('0x5'))('rpc');var config=require(_0x27dc('0x6'));var jayson=require(_0x27dc('0x7'));var client=jayson['client'][_0x27dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2e10,_0x95bbb6,_0x3b3eee){return new BPromise(function(_0x5181ab,_0x45aa07){return client[_0x27dc('0x9')](_0x4d2e10,_0x3b3eee)[_0x27dc('0xa')](function(_0x242997){logger['info'](_0x27dc('0xb'),_0x95bbb6,'request\x20sent');logger[_0x27dc('0xc')](_0x27dc('0xd'),_0x95bbb6,_0x27dc('0xe'),JSON['stringify'](_0x242997));if(_0x242997['error']){if(_0x242997[_0x27dc('0xf')][_0x27dc('0x10')]===0x1f4){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x242997['error'][_0x27dc('0x11')]);return _0x45aa07(_0x242997['error'][_0x27dc('0x11')]);}logger['error'](_0x27dc('0xb'),_0x95bbb6,_0x242997[_0x27dc('0xf')][_0x27dc('0x11')]);return _0x5181ab(_0x242997[_0x27dc('0xf')]['message']);}else{logger[_0x27dc('0x12')](_0x27dc('0xb'),_0x95bbb6,_0x27dc('0xe'));_0x5181ab(_0x242997[_0x27dc('0x13')][_0x27dc('0x11')]);}})['catch'](function(_0x3ff8f8){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x3ff8f8);_0x45aa07(_0x3ff8f8);});});}exports[_0x27dc('0x14')]=function(_0x5d308b){var _0x5ecb19=this;return new Promise(function(_0x1ff9a2,_0x225b2c){return db[_0x27dc('0x15')][_0x27dc('0x16')](_0x5d308b[_0x27dc('0x17')],{'raw':_0x5d308b[_0x27dc('0x18')]?_0x5d308b[_0x27dc('0x18')][_0x27dc('0x19')]===undefined?!![]:![]:!![]})[_0x27dc('0xa')](function(_0x5064d5){logger[_0x27dc('0x12')](_0x27dc('0x14'),_0x5d308b);logger['debug'](_0x27dc('0x14'),_0x5d308b,JSON['stringify'](_0x5064d5));_0x1ff9a2(_0x5064d5);})['catch'](function(_0x2843b1){logger['error'](_0x27dc('0x14'),_0x2843b1['message'],_0x5d308b);_0x225b2c(_0x5ecb19['error'](0x1f4,_0x2843b1[_0x27dc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 17f43c1..dc5692c 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x0b0e[_0x3712e2];return _0x1faff4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4688af,_0x435cbf){var _0x5ecf35=function(_0x3ea7c4){while(--_0x3ea7c4){_0x4688af['push'](_0x4688af['shift']());}};_0x5ecf35(++_0x435cbf);}(_0x2032,0xd9));var _0x2203=function(_0x3ce311,_0x4c308b){_0x3ce311=_0x3ce311-0x0;var _0x781c6e=_0x2032[_0x3ce311];return _0x781c6e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ae2edd7..ba2c983 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 _0xd0d3=['findOne','allowedLoginAttempts','then','User','map','emails','value','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','email','authenticate','clientID','clientSecret','secret','callbackURL','Setting'];(function(_0x1ea75b,_0x520276){var _0x483add=function(_0x20a190){while(--_0x20a190){_0x1ea75b['push'](_0x1ea75b['shift']());}};_0x483add(++_0x520276);}(_0xd0d3,0x7d));var _0x3d0d=function(_0x28225e,_0x427533){_0x28225e=_0x28225e-0x0;var _0x72aa04=_0xd0d3[_0x28225e];return _0x72aa04;};'use strict';var _=require(_0x3d0d('0x0'));var passport=require(_0x3d0d('0x1'));var GoogleStrategy=require(_0x3d0d('0x2'))[_0x3d0d('0x3')];var moment=require(_0x3d0d('0x4'));var db=require(_0x3d0d('0x5'))['db'];var config=require(_0x3d0d('0x6'));var signToken=require(_0x3d0d('0x7'))[_0x3d0d('0x8')];var utils=require(_0x3d0d('0x9'));exports[_0x3d0d('0xa')]=passport['authenticate'](_0x3d0d('0xb'),{'failureRedirect':'/login','scope':['profile',_0x3d0d('0xc')],'session':![]});exports['callback']=passport[_0x3d0d('0xd')](_0x3d0d('0xb'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x3d0d('0xb')]?config['google'][_0x3d0d('0xe')]:'id','clientSecret':config[_0x3d0d('0xb')]?config[_0x3d0d('0xb')][_0x3d0d('0xf')]:_0x3d0d('0x10'),'callbackURL':config[_0x3d0d('0xb')]?config[_0x3d0d('0xb')][_0x3d0d('0x11')]:''},function(_0x5545ae,_0x4b6102,_0x6ac923,_0x57fd83){var _0x44f776,_0x20a151;return db[_0x3d0d('0x12')][_0x3d0d('0x13')]({'where':{'id':0x1},'attributes':[_0x3d0d('0x14'),'blockDuration'],'raw':!![]})[_0x3d0d('0x15')](function(_0x188a6f){_0x44f776=_0x188a6f;return db[_0x3d0d('0x16')]['find']({'where':{'email':_[_0x3d0d('0x17')](_0x6ac923[_0x3d0d('0x18')],_0x3d0d('0x19')),'role':{'$or':['admin',_0x3d0d('0x1a'),_0x3d0d('0x1b')]}}});})[_0x3d0d('0x15')](function(_0x229b03){_0x20a151=_0x229b03;if(_0x20a151){if(_0x20a151['disabled']){return _0x57fd83(_0x3d0d('0x1c'));}else if(_0x44f776[_0x3d0d('0x1d')]>0x0){if(_0x20a151[_0x3d0d('0x1e')]){if(moment(_0x20a151[_0x3d0d('0x1f')])[_0x3d0d('0x20')](_0x44f776[_0x3d0d('0x1d')],_0x3d0d('0x21'))>moment()){return _0x57fd83('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x20a151,0x0,![],null)[_0x3d0d('0x15')](function(){return utils[_0x3d0d('0x22')](_0x20a151);})['then'](function(){return _0x57fd83(null,_0x20a151);});}}else{return utils[_0x3d0d('0x22')](_0x20a151)['then'](function(){return _0x57fd83(null,_0x20a151);});}}else{return utils[_0x3d0d('0x22')](_0x20a151)[_0x3d0d('0x15')](function(){return _0x57fd83(null,_0x20a151);});}}return _0x57fd83(_0x3d0d('0x1c'));})[_0x3d0d('0x23')](function(_0x1f90fa){_0x57fd83(_0x1f90fa);});})); \ No newline at end of file +var _0x6bf2=['moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','use','clientID','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x6bf2,0x183));var _0x26bf=function(_0x9f4e39,_0x570664){_0x9f4e39=_0x9f4e39-0x0;var _0x59ab98=_0x6bf2[_0x9f4e39];return _0x59ab98;};'use strict';var _=require(_0x26bf('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x26bf('0x1'))[_0x26bf('0x2')];var moment=require(_0x26bf('0x3'));var db=require(_0x26bf('0x4'))['db'];var config=require(_0x26bf('0x5'));var signToken=require(_0x26bf('0x6'))[_0x26bf('0x7')];var utils=require(_0x26bf('0x8'));exports[_0x26bf('0x9')]=passport[_0x26bf('0xa')](_0x26bf('0xb'),{'failureRedirect':_0x26bf('0xc'),'scope':[_0x26bf('0xd'),_0x26bf('0xe')],'session':![]});exports['callback']=passport[_0x26bf('0xa')](_0x26bf('0xb'),{'failureRedirect':_0x26bf('0xc'),'session':![]});passport[_0x26bf('0xf')](new GoogleStrategy({'clientID':config['google']?config[_0x26bf('0xb')][_0x26bf('0x10')]:'id','clientSecret':config[_0x26bf('0xb')]?config[_0x26bf('0xb')][_0x26bf('0x11')]:_0x26bf('0x12'),'callbackURL':config['google']?config[_0x26bf('0xb')][_0x26bf('0x13')]:''},function(_0x4f0b79,_0x3572ea,_0x5be91f,_0x56c3dd){var _0x81dd84,_0x529840;return db['Setting'][_0x26bf('0x14')]({'where':{'id':0x1},'attributes':[_0x26bf('0x15'),_0x26bf('0x16')],'raw':!![]})[_0x26bf('0x17')](function(_0x40ddef){_0x81dd84=_0x40ddef;return db[_0x26bf('0x18')][_0x26bf('0x19')]({'where':{'email':_[_0x26bf('0x1a')](_0x5be91f[_0x26bf('0x1b')],_0x26bf('0x1c')),'role':{'$or':[_0x26bf('0x1d'),_0x26bf('0x1e'),_0x26bf('0x1f')]}}});})[_0x26bf('0x17')](function(_0xe033da){_0x529840=_0xe033da;if(_0x529840){if(_0x529840[_0x26bf('0x20')]){return _0x56c3dd(_0x26bf('0x21'));}else if(_0x81dd84[_0x26bf('0x16')]>0x0){if(_0x529840[_0x26bf('0x22')]){if(moment(_0x529840['blockedAt'])[_0x26bf('0x23')](_0x81dd84['blockDuration'],'minutes')>moment()){return _0x56c3dd(_0x26bf('0x21'));}else{return utils[_0x26bf('0x24')](_0x529840,0x0,![],null)[_0x26bf('0x17')](function(){return utils['getLicense'](_0x529840);})[_0x26bf('0x17')](function(){return _0x56c3dd(null,_0x529840);});}}else{return utils[_0x26bf('0x25')](_0x529840)[_0x26bf('0x17')](function(){return _0x56c3dd(null,_0x529840);});}}else{return utils[_0x26bf('0x25')](_0x529840)[_0x26bf('0x17')](function(){return _0x56c3dd(null,_0x529840);});}}return _0x56c3dd(_0x26bf('0x21'));})[_0x26bf('0x26')](function(_0x335073){_0x56c3dd(_0x335073);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index dcc647e..60647c6 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 _0xae1c=['isMiddleware','setTokenCookie','exports','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x322c16,_0x1ce3cc){var _0x14617c=function(_0x115f91){while(--_0x115f91){_0x322c16['push'](_0x322c16['shift']());}};_0x14617c(++_0x1ce3cc);}(_0xae1c,0xff));var _0xcae1=function(_0x551826,_0x1f0659){_0x551826=_0x551826-0x0;var _0x24067d=_0xae1c[_0x551826];return _0x24067d;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xcae1('0x0'));var authService=require(_0xcae1('0x1'));router[_0xcae1('0x2')]('/',controller[_0xcae1('0x3')]);router[_0xcae1('0x2')](_0xcae1('0x4'),controller[_0xcae1('0x5')],authService[_0xcae1('0x6')],userController[_0xcae1('0x3')],authService[_0xcae1('0x7')]);module[_0xcae1('0x8')]=router; \ No newline at end of file +var _0x4085=['login','/callback','callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x27a1e0,_0x3ff2cb){var _0x1ca624=function(_0x435802){while(--_0x435802){_0x27a1e0['push'](_0x27a1e0['shift']());}};_0x1ca624(++_0x3ff2cb);}(_0x4085,0x199));var _0x5408=function(_0x258b07,_0x33d07f){_0x258b07=_0x258b07-0x0;var _0xe14d95=_0x4085[_0x258b07];return _0xe14d95;};'use strict';var express=require(_0x5408('0x0'));var passport=require(_0x5408('0x1'));var router=express[_0x5408('0x2')]();var controller=require(_0x5408('0x3'));var userController=require(_0x5408('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x5408('0x5')]);router['get'](_0x5408('0x6'),controller[_0x5408('0x7')],authService[_0x5408('0x8')],userController[_0x5408('0x5')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d57ae7a..bee45fa 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 _0x2621=['stringify','status','send','login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','catch','getLicense','MailAccount','find','email','MailServerOut','service','Smtp','host','port','secure','authentication','auth','pass','format','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x29e02c,_0x45969e){var _0x381c0b=function(_0x5808ee){while(--_0x5808ee){_0x29e02c['push'](_0x29e02c['shift']());}};_0x381c0b(++_0x45969e);}(_0x2621,0x1d2));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x1262('0x0'));var passport=require(_0x1262('0x1'));var LocalStrategy=require(_0x1262('0x2'))[_0x1262('0x3')];var jayson=require(_0x1262('0x4'));var _=require(_0x1262('0x5'));var rs=require(_0x1262('0x6'));var moment=require(_0x1262('0x7'));var db=require(_0x1262('0x8'))['db'];var authService=require(_0x1262('0x9'));var utils=require(_0x1262('0xa'));var client=jayson[_0x1262('0xb')][_0x1262('0xc')]({'port':0x232b});function localAuthenticate(_0x16075c,_0x4d4535,_0x4ca884,_0x52af34){var _0xaa3c86,_0x491949;return db[_0x1262('0xd')][_0x1262('0xe')]({'where':{'id':0x1},'attributes':[_0x1262('0xf'),'blockDuration'],'raw':!![]})[_0x1262('0x10')](function(_0x5e690d){_0xaa3c86=_0x5e690d;return _0x16075c[_0x1262('0xe')]({'attributes':['id',_0x1262('0x11'),'password','salt',_0x1262('0x12'),_0x1262('0x13'),_0x1262('0x14'),_0x1262('0x15'),_0x1262('0x16')],'where':{'name':_0x4d4535,'role':{'$or':[_0x1262('0x17'),'user',_0x1262('0x18')]}}});})[_0x1262('0x10')](function(_0x1e5837){if(!_0x1e5837||_0x1e5837&&_0x1e5837['name']!==_0x4d4535){throw new Error(_0x1262('0x19'));}else{_0x491949=_0x1e5837;return _0x491949;}})[_0x1262('0x10')](function(){_0x491949['authenticate'](_0x4ca884,function(_0x58df0c,_0x2d93a2){var _0x4435c7=_0x491949['loginAttempts']+0x1;if(_0x58df0c){return _0x52af34(_0x58df0c);}else if(!_0x2d93a2){if(_0x491949[_0x1262('0x13')]){return _0x52af34(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xaa3c86[_0x1262('0xf')]>0x0){if(_0x491949[_0x1262('0x14')]){if(_0xaa3c86[_0x1262('0x1a')]>0x0){if(moment(_0x491949[_0x1262('0x15')])[_0x1262('0x1b')](_0xaa3c86[_0x1262('0x1a')],_0x1262('0x1c'))>moment()){return _0x52af34(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x491949,_0x4435c7,![],null)['then'](function(){return _0x52af34(null,![],{'message':_0x1262('0x19')});});}}else{return _0x52af34(null,![],{'message':_0x1262('0x19')});}}else{if(_0x4435c7>=_0xaa3c86['allowedLoginAttempts']){return utils['clearBlockUser'](_0x491949,0x0,!![],moment())[_0x1262('0x10')](function(){return _0x52af34(null,![],{'message':_0x1262('0x19')});});}else{return utils['clearBlockUser'](_0x491949,_0x4435c7,![],null)[_0x1262('0x10')](function(){return _0x52af34(null,![],{'message':_0x1262('0x19')});});}}}else{return _0x52af34(null,![],{'message':_0x1262('0x19')});}}else{if(_0x491949['disabled']){return _0x52af34(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xaa3c86[_0x1262('0xf')]>0x0){if(_0x491949['blocked']){if(_0xaa3c86['blockDuration']>0x0){if(moment(_0x491949['blockedAt'])[_0x1262('0x1b')](_0xaa3c86['blockDuration'],'minutes')>moment()){return _0x52af34(null,![],{'message':_0x1262('0x19')});}else{return utils[_0x1262('0x1d')](_0x491949,0x0,![],null)['then'](function(){return utils['getLicense'](_0x491949);})[_0x1262('0x10')](function(){return _0x52af34(null,_0x491949);});}}else{return _0x52af34(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x491949,0x0,![],null)[_0x1262('0x10')](function(){return utils['getLicense'](_0x491949);})[_0x1262('0x10')](function(){return _0x52af34(null,_0x491949);})[_0x1262('0x1e')](function(_0x167db1){return _0x52af34(null,![],_0x167db1);});}}else{if(_0x491949[_0x1262('0x14')]){return _0x52af34(null,![],{'message':_0x1262('0x19')});}else{return utils[_0x1262('0x1f')](_0x491949)[_0x1262('0x10')](function(){return _0x52af34(null,_0x491949);});}}}});})[_0x1262('0x1e')](function(_0x39a53b){return _0x52af34(null,![],_0x39a53b);});}function sendServiceMail(_0x144086){return db[_0x1262('0x20')][_0x1262('0x21')]({'where':{'service':!![]},'attributes':['id',_0x1262('0x11'),_0x1262('0x22')],'include':[{'model':db[_0x1262('0x23')],'as':'Smtp'}]})[_0x1262('0x10')](function(_0x179b32){if(!_0x179b32){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x28d936={'tls':{'rejectUnauthorized':![]}};if(_0x179b32['Smtp'][_0x1262('0x24')]){_0x28d936[_0x1262('0x24')]=_0x179b32[_0x1262('0x25')][_0x1262('0x24')];}else{_0x28d936[_0x1262('0x26')]=_0x179b32[_0x1262('0x25')][_0x1262('0x26')];_0x28d936[_0x1262('0x27')]=_0x179b32[_0x1262('0x25')]['port'];_0x28d936[_0x1262('0x28')]=_0x179b32[_0x1262('0x25')]['secure'];}if(_0x179b32[_0x1262('0x25')][_0x1262('0x29')]){_0x28d936[_0x1262('0x2a')]={'user':_0x179b32[_0x1262('0x25')]['user'],'pass':_0x179b32[_0x1262('0x25')][_0x1262('0x2b')]};}var _0x12fd63={'account':_0x28d936,'message':_['merge']({'from':util[_0x1262('0x2c')]('\x22%s\x22\x20<%s>',_0x179b32['name'],_0x179b32['email']||_0x179b32[_0x1262('0x25')][_0x1262('0x2d')])},_0x144086)};return client[_0x1262('0x2e')]('SendMail',_0x12fd63);})['then'](function(_0xb4275e){if(_0xb4275e[_0x1262('0x2f')]){throw new Error(util[_0x1262('0x2c')](_0x1262('0x30'),_0xb4275e[_0x1262('0x2f')][_0x1262('0x31')]||JSON[_0x1262('0x32')](_0xb4275e[_0x1262('0x2f')])));}return!![];});}function handleError(_0x5f2d39,_0x562aad,_0x2f82af){return _0x5f2d39[_0x1262('0x33')](_0x562aad||0x1f4)[_0x1262('0x34')]({'message':_0x2f82af?_0x2f82af['message']||_0x2f82af:''});}exports[_0x1262('0x35')]=function(_0x5bf401,_0x2c480d,_0x507604){passport['authenticate']('local',function(_0x4736cc,_0x309be3,_0x4f1093){var _0x42625d=_0x4736cc||_0x4f1093;if(_0x42625d){return handleError(_0x2c480d,0x191,_0x42625d);}if(!_0x309be3){return handleError(_0x2c480d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1a4670={'payload':{'id':_0x309be3['id'],'role':_0x309be3[_0x1262('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1a4670)[_0x1262('0x10')](function(_0x5ba952){_0x2c480d[_0x1262('0x36')]({'id':_0x309be3['id'],'token':_0x5ba952,'statusCall':'','isAlreadyLogged':_0x309be3[_0x1262('0x37')]});});}})(_0x5bf401,_0x2c480d,_0x507604);};exports[_0x1262('0x38')]=function(_0x5927fb,_0x5eaa10,_0x4a279a){if(!_0x5927fb[_0x1262('0x39')][_0x1262('0x22')]){return handleError(_0x5eaa10,0x1f4,{'message':_0x1262('0x3a')});}var _0x2cc762=rs[_0x1262('0x3b')]();_0x5927fb[_0x1262('0x39')][_0x1262('0x22')]=_0x5927fb[_0x1262('0x39')][_0x1262('0x22')][_0x1262('0x3c')]()[_0x1262('0x3d')]();var _0x3732dd;return db[_0x1262('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x596616){_0x3732dd=_0x596616;return db['User'][_0x1262('0x21')]({'where':{'email':_0x5927fb[_0x1262('0x39')]['email']}});})['then'](function(_0x3748ae){if(!_0x3748ae){throw new Error(_0x1262('0x3e'));}if(_0x3748ae[_0x1262('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3748ae[_0x1262('0x14')]){if(moment(_0x3748ae[_0x1262('0x15')])[_0x1262('0x1b')](_0x3732dd[_0x1262('0x1a')],_0x1262('0x1c'))>moment()){throw new Error(_0x1262('0x3f'));}else{_0x3748ae[_0x1262('0x14')]=![];_0x3748ae['blockedAt']=null;}}_0x3748ae[_0x1262('0x40')]=_0x2cc762;_0x3748ae[_0x1262('0x41')]=Date[_0x1262('0x42')]()+0x36ee80;return _0x3748ae[_0x1262('0x43')]();})[_0x1262('0x10')](function(){return sendServiceMail({'to':_0x5927fb[_0x1262('0x39')][_0x1262('0x22')],'subject':_0x1262('0x44'),'text':_0x1262('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x1262('0x46')+_0x5927fb[_0x1262('0x47')][_0x1262('0x26')]+_0x1262('0x48')+_0x2cc762+'\x0a\x0a'+_0x1262('0x49')});})[_0x1262('0x10')](function(){_0x5eaa10['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x1262('0x1e')](function(_0x1823e3){return handleError(_0x5eaa10,0x1f4,_0x1823e3);});};exports[_0x1262('0x4a')]=function(_0x61deec,_0x3079c2,_0xd36893){return db[_0x1262('0x4b')][_0x1262('0x21')]({'where':{'resetPasswordToken':_0x61deec[_0x1262('0x4c')]['token'],'resetPasswordExpires':{'$gt':Date[_0x1262('0x42')]()}}})[_0x1262('0x10')](function(_0x510453){if(!_0x510453){throw new Error(_0x1262('0x4d'));}return db[_0x1262('0xd')][_0x1262('0xe')]({'attributes':['id',_0x1262('0x4e'),_0x1262('0x4f'),_0x1262('0x50')]})['then'](function(_0x5bee66){if(_0x5bee66[_0x1262('0x4e')])authService['validatePasswordPattern'](_0x61deec[_0x1262('0x39')][_0x1262('0x51')]);if(!_0x5bee66['enforcePasswordHistory']||!_0x510453[_0x1262('0x52')])return _0x510453;authService[_0x1262('0x53')](_0x61deec[_0x1262('0x39')][_0x1262('0x51')],_0x510453[_0x1262('0x52')],_0x5bee66[_0x1262('0x50')]);return _0x510453;})[_0x1262('0x10')](function(){_0x510453[_0x1262('0x51')]=_0x61deec[_0x1262('0x39')][_0x1262('0x51')];_0x510453[_0x1262('0x40')]=null;_0x510453[_0x1262('0x41')]=null;return _0x510453[_0x1262('0x43')]();});})[_0x1262('0x10')](function(){_0x3079c2[_0x1262('0x33')](0xc8)['send']({'message':_0x1262('0x54')});})['catch'](function(_0x47e097){return handleError(_0x3079c2,0x1f4,_0x47e097);});};passport[_0x1262('0x55')](new LocalStrategy({'usernameField':_0x1262('0x11'),'passwordField':_0x1262('0x51')},function(_0xc71f2a,_0x497abd,_0x5a2cc4){return localAuthenticate(db[_0x1262('0x4b')],_0xc71f2a,_0x497abd,_0x5a2cc4);})); \ No newline at end of file +var _0x3fcc=['json','online','body','Email\x20parameter\x20is\x20missing','generate','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x3e18bf,_0x387f5e){var _0x1022e5=function(_0x242ec4){while(--_0x242ec4){_0x3e18bf['push'](_0x3e18bf['shift']());}};_0x1022e5(++_0x387f5e);}(_0x3fcc,0x104));var _0xc3fc=function(_0x1275d5,_0x1a724b){_0x1275d5=_0x1275d5-0x0;var _0x5639de=_0x3fcc[_0x1275d5];return _0x5639de;};'use strict';var util=require(_0xc3fc('0x0'));var passport=require(_0xc3fc('0x1'));var LocalStrategy=require(_0xc3fc('0x2'))[_0xc3fc('0x3')];var jayson=require(_0xc3fc('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xc3fc('0x5'));var db=require(_0xc3fc('0x6'))['db'];var authService=require(_0xc3fc('0x7'));var utils=require(_0xc3fc('0x8'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x1837b1,_0x26ca92,_0x57b904,_0x5187cf){var _0x422824,_0x2b61ea;return db[_0xc3fc('0x9')][_0xc3fc('0xa')]({'where':{'id':0x1},'attributes':[_0xc3fc('0xb'),'blockDuration'],'raw':!![]})[_0xc3fc('0xc')](function(_0x57bd8a){_0x422824=_0x57bd8a;return _0x1837b1['findOne']({'attributes':['id',_0xc3fc('0xd'),_0xc3fc('0xe'),_0xc3fc('0xf'),_0xc3fc('0x10'),_0xc3fc('0x11'),_0xc3fc('0x12'),'blockedAt',_0xc3fc('0x13')],'where':{'name':_0x26ca92,'role':{'$or':[_0xc3fc('0x14'),'user','agent']}}});})[_0xc3fc('0xc')](function(_0x375dfd){if(!_0x375dfd||_0x375dfd&&_0x375dfd['name']!==_0x26ca92){throw new Error(_0xc3fc('0x15'));}else{_0x2b61ea=_0x375dfd;return _0x2b61ea;}})[_0xc3fc('0xc')](function(){_0x2b61ea[_0xc3fc('0x16')](_0x57b904,function(_0x5c42d1,_0x3a12c8){var _0x3e7d3c=_0x2b61ea[_0xc3fc('0x13')]+0x1;if(_0x5c42d1){return _0x5187cf(_0x5c42d1);}else if(!_0x3a12c8){if(_0x2b61ea['disabled']){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}else if(_0x422824['allowedLoginAttempts']>0x0){if(_0x2b61ea[_0xc3fc('0x12')]){if(_0x422824[_0xc3fc('0x17')]>0x0){if(moment(_0x2b61ea[_0xc3fc('0x18')])[_0xc3fc('0x19')](_0x422824[_0xc3fc('0x17')],_0xc3fc('0x1a'))>moment()){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}else{return utils['clearBlockUser'](_0x2b61ea,_0x3e7d3c,![],null)['then'](function(){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});});}}else{return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}}else{if(_0x3e7d3c>=_0x422824[_0xc3fc('0xb')]){return utils[_0xc3fc('0x1b')](_0x2b61ea,0x0,!![],moment())['then'](function(){return _0x5187cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2b61ea,_0x3e7d3c,![],null)[_0xc3fc('0xc')](function(){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});});}}}else{return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}}else{if(_0x2b61ea[_0xc3fc('0x11')]){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}else if(_0x422824[_0xc3fc('0xb')]>0x0){if(_0x2b61ea[_0xc3fc('0x12')]){if(_0x422824[_0xc3fc('0x17')]>0x0){if(moment(_0x2b61ea['blockedAt'])[_0xc3fc('0x19')](_0x422824[_0xc3fc('0x17')],'minutes')>moment()){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}else{return utils['clearBlockUser'](_0x2b61ea,0x0,![],null)[_0xc3fc('0xc')](function(){return utils[_0xc3fc('0x1c')](_0x2b61ea);})['then'](function(){return _0x5187cf(null,_0x2b61ea);});}}else{return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}}else{return utils['clearBlockUser'](_0x2b61ea,0x0,![],null)[_0xc3fc('0xc')](function(){return utils[_0xc3fc('0x1c')](_0x2b61ea);})['then'](function(){return _0x5187cf(null,_0x2b61ea);})[_0xc3fc('0x1d')](function(_0x337a33){return _0x5187cf(null,![],_0x337a33);});}}else{if(_0x2b61ea[_0xc3fc('0x12')]){return _0x5187cf(null,![],{'message':_0xc3fc('0x15')});}else{return utils[_0xc3fc('0x1c')](_0x2b61ea)['then'](function(){return _0x5187cf(null,_0x2b61ea);});}}}});})[_0xc3fc('0x1d')](function(_0x46693c){return _0x5187cf(null,![],_0x46693c);});}function sendServiceMail(_0x2407b0){return db[_0xc3fc('0x1e')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xc3fc('0x1f')],'include':[{'model':db[_0xc3fc('0x20')],'as':_0xc3fc('0x21')}]})[_0xc3fc('0xc')](function(_0x17b6e9){if(!_0x17b6e9){throw new Error(_0xc3fc('0x22'));}var _0x30ef9b={'tls':{'rejectUnauthorized':![]}};if(_0x17b6e9[_0xc3fc('0x21')][_0xc3fc('0x23')]){_0x30ef9b[_0xc3fc('0x23')]=_0x17b6e9[_0xc3fc('0x21')]['service'];}else{_0x30ef9b[_0xc3fc('0x24')]=_0x17b6e9[_0xc3fc('0x21')]['host'];_0x30ef9b['port']=_0x17b6e9['Smtp']['port'];_0x30ef9b['secure']=_0x17b6e9['Smtp'][_0xc3fc('0x25')];}if(_0x17b6e9[_0xc3fc('0x21')]['authentication']){_0x30ef9b['auth']={'user':_0x17b6e9['Smtp']['user'],'pass':_0x17b6e9[_0xc3fc('0x21')]['pass']};}var _0x3ce1a9={'account':_0x30ef9b,'message':_['merge']({'from':util[_0xc3fc('0x26')]('\x22%s\x22\x20<%s>',_0x17b6e9[_0xc3fc('0xd')],_0x17b6e9[_0xc3fc('0x1f')]||_0x17b6e9[_0xc3fc('0x21')][_0xc3fc('0x27')])},_0x2407b0)};return client[_0xc3fc('0x28')](_0xc3fc('0x29'),_0x3ce1a9);})[_0xc3fc('0xc')](function(_0xe12d99){if(_0xe12d99[_0xc3fc('0x2a')]){throw new Error(util[_0xc3fc('0x26')](_0xc3fc('0x2b'),_0xe12d99[_0xc3fc('0x2a')][_0xc3fc('0x2c')]||JSON[_0xc3fc('0x2d')](_0xe12d99[_0xc3fc('0x2a')])));}return!![];});}function handleError(_0x445432,_0x1b1709,_0x1aedf9){return _0x445432[_0xc3fc('0x2e')](_0x1b1709||0x1f4)[_0xc3fc('0x2f')]({'message':_0x1aedf9?_0x1aedf9['message']||_0x1aedf9:''});}exports[_0xc3fc('0x30')]=function(_0x3b319b,_0x2135da,_0x3253d7){passport[_0xc3fc('0x16')](_0xc3fc('0x31'),function(_0x31ceb0,_0x4598af,_0x2f71cf){var _0x593bc0=_0x31ceb0||_0x2f71cf;if(_0x593bc0){return handleError(_0x2135da,0x191,_0x593bc0);}if(!_0x4598af){return handleError(_0x2135da,0x194,{'message':_0xc3fc('0x32')});}else{var _0x45594c={'payload':{'id':_0x4598af['id'],'role':_0x4598af[_0xc3fc('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xc3fc('0x33')](_0x45594c)[_0xc3fc('0xc')](function(_0x52c384){_0x2135da[_0xc3fc('0x34')]({'id':_0x4598af['id'],'token':_0x52c384,'statusCall':'','isAlreadyLogged':_0x4598af[_0xc3fc('0x35')]});});}})(_0x3b319b,_0x2135da,_0x3253d7);};exports['forgot']=function(_0x9ddf95,_0x235f77,_0x303f4e){if(!_0x9ddf95[_0xc3fc('0x36')]['email']){return handleError(_0x235f77,0x1f4,{'message':_0xc3fc('0x37')});}var _0x5845c0=rs[_0xc3fc('0x38')]();_0x9ddf95['body']['email']=_0x9ddf95[_0xc3fc('0x36')][_0xc3fc('0x1f')]['trim']()['toLowerCase']();var _0x2a05fe;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc3fc('0xb'),'blockDuration'],'raw':!![]})[_0xc3fc('0xc')](function(_0x3bb04d){_0x2a05fe=_0x3bb04d;return db[_0xc3fc('0x39')][_0xc3fc('0x3a')]({'where':{'email':_0x9ddf95['body'][_0xc3fc('0x1f')]}});})[_0xc3fc('0xc')](function(_0x5a3a07){if(!_0x5a3a07){throw new Error(_0xc3fc('0x3b'));}if(_0x5a3a07[_0xc3fc('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5a3a07[_0xc3fc('0x12')]){if(moment(_0x5a3a07['blockedAt'])['add'](_0x2a05fe[_0xc3fc('0x17')],'minutes')>moment()){throw new Error(_0xc3fc('0x3c'));}else{_0x5a3a07[_0xc3fc('0x12')]=![];_0x5a3a07['blockedAt']=null;}}_0x5a3a07[_0xc3fc('0x3d')]=_0x5845c0;_0x5a3a07[_0xc3fc('0x3e')]=Date[_0xc3fc('0x3f')]()+0x36ee80;return _0x5a3a07[_0xc3fc('0x40')]();})[_0xc3fc('0xc')](function(){return sendServiceMail({'to':_0x9ddf95[_0xc3fc('0x36')]['email'],'subject':_0xc3fc('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc3fc('0x42')+_0xc3fc('0x43')+_0x9ddf95['headers'][_0xc3fc('0x24')]+_0xc3fc('0x44')+_0x5845c0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc3fc('0xc')](function(){_0x235f77[_0xc3fc('0x2e')](0xc8)[_0xc3fc('0x2f')]({'message':_0xc3fc('0x45')});})[_0xc3fc('0x1d')](function(_0x1b5f09){return handleError(_0x235f77,0x1f4,_0x1b5f09);});};exports[_0xc3fc('0x46')]=function(_0x3c810f,_0x404e00,_0x377818){return db[_0xc3fc('0x39')][_0xc3fc('0x3a')]({'where':{'resetPasswordToken':_0x3c810f['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc3fc('0x3f')]()}}})[_0xc3fc('0xc')](function(_0x23ae93){if(!_0x23ae93){throw new Error(_0xc3fc('0x47'));}return db[_0xc3fc('0x9')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xc3fc('0x48')]})['then'](function(_0x360be1){if(_0x360be1['securePassword'])authService[_0xc3fc('0x49')](_0x3c810f['body'][_0xc3fc('0xe')]);if(!_0x360be1[_0xc3fc('0x4a')]||!_0x23ae93[_0xc3fc('0x4b')])return _0x23ae93;authService['validatePasswordHistory'](_0x3c810f[_0xc3fc('0x36')]['password'],_0x23ae93['previousPasswords'],_0x360be1[_0xc3fc('0x48')]);return _0x23ae93;})[_0xc3fc('0xc')](function(){_0x23ae93[_0xc3fc('0xe')]=_0x3c810f['body'][_0xc3fc('0xe')];_0x23ae93[_0xc3fc('0x3d')]=null;_0x23ae93[_0xc3fc('0x3e')]=null;return _0x23ae93[_0xc3fc('0x40')]();});})[_0xc3fc('0xc')](function(){_0x404e00[_0xc3fc('0x2e')](0xc8)[_0xc3fc('0x2f')]({'message':_0xc3fc('0x4c')});})['catch'](function(_0x200961){return handleError(_0x404e00,0x1f4,_0x200961);});};passport[_0xc3fc('0x4d')](new LocalStrategy({'usernameField':_0xc3fc('0xd'),'passwordField':_0xc3fc('0xe')},function(_0x2e8340,_0x9a6a42,_0x342076){return localAuthenticate(db[_0xc3fc('0x39')],_0x2e8340,_0x9a6a42,_0x342076);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 483b301..e89ecc6 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 _0x2eb9=['express','Router','./authLocal.controller','login','/forgot','forgot','post','/reset/:token','exports'];(function(_0x1e5c30,_0x4d434f){var _0xb206fc=function(_0x3299fe){while(--_0x3299fe){_0x1e5c30['push'](_0x1e5c30['shift']());}};_0xb206fc(++_0x4d434f);}(_0x2eb9,0x1ef));var _0x92eb=function(_0x2749ac,_0x4b8b85){_0x2749ac=_0x2749ac-0x0;var _0x23ebf4=_0x2eb9[_0x2749ac];return _0x23ebf4;};'use strict';var express=require(_0x92eb('0x0'));var router=express[_0x92eb('0x1')]();var controller=require(_0x92eb('0x2'));router['post']('/',controller[_0x92eb('0x3')]);router['post'](_0x92eb('0x4'),controller[_0x92eb('0x5')]);router[_0x92eb('0x6')](_0x92eb('0x7'),controller['reset']);module[_0x92eb('0x8')]=router; \ No newline at end of file +var _0xe87c=['login','/forgot','forgot','/reset/:token','reset','express','./authLocal.controller','post'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0xe87c,0xa5));var _0xce87=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xe87c[_0x403c20];return _0x2b271a;};'use strict';var express=require(_0xce87('0x0'));var router=express['Router']();var controller=require(_0xce87('0x1'));router[_0xce87('0x2')]('/',controller[_0xce87('0x3')]);router[_0xce87('0x2')](_0xce87('0x4'),controller[_0xce87('0x5')]);router[_0xce87('0x2')](_0xce87('0x6'),controller[_0xce87('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 55b4b09..bf948bb 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 _0x5744=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x51c5d7,_0x5149c8){var _0x703339=function(_0x445da8){while(--_0x445da8){_0x51c5d7['push'](_0x51c5d7['shift']());}};_0x703339(++_0x5149c8);}(_0x5744,0x160));var _0x4574=function(_0xb642df,_0x4f5260){_0xb642df=_0xb642df-0x0;var _0x29b81d=_0x5744[_0xb642df];return _0x29b81d;};'use strict';var Sequelize=require(_0x4574('0x0'));module[_0x4574('0x1')]={'name':{'type':Sequelize[_0x4574('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4574('0x2')]},'description':{'type':Sequelize[_0x4574('0x2')]},'status':{'type':Sequelize[_0x4574('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4574('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x27fe=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x4b7c58,_0xc8fca3){var _0x5dfd7b=function(_0x1efb14){while(--_0x1efb14){_0x4b7c58['push'](_0x4b7c58['shift']());}};_0x5dfd7b(++_0xc8fca3);}(_0x27fe,0xb5));var _0xe27f=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x27fe[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0xe27f('0x0'));module[_0xe27f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe27f('0x2')]},'description':{'type':Sequelize[_0xe27f('0x2')]},'status':{'type':Sequelize[_0xe27f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe27f('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 60f7cf8..503e3b0 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 _0x8415=['body','destroy','addConditions','Condition','ids','getConditions','findOne','pick','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','json','reject','save','update','then','error','stack','name','index','map','Automation','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8415,0x108));var _0x5841=function(_0x145d19,_0x14ad83){_0x145d19=_0x145d19-0x0;var _0x1bcf43=_0x8415[_0x145d19];return _0x1bcf43;};'use strict';var emlformat=require(_0x5841('0x0'));var rimraf=require(_0x5841('0x1'));var zipdir=require(_0x5841('0x2'));var jsonpatch=require(_0x5841('0x3'));var rp=require('request-promise');var moment=require(_0x5841('0x4'));var BPromise=require(_0x5841('0x5'));var Mustache=require(_0x5841('0x6'));var util=require(_0x5841('0x7'));var path=require('path');var sox=require(_0x5841('0x8'));var csv=require(_0x5841('0x9'));var ejs=require(_0x5841('0xa'));var fs=require('fs');var fs_extra=require(_0x5841('0xb'));var _=require(_0x5841('0xc'));var squel=require('squel');var crypto=require(_0x5841('0xd'));var jsforce=require(_0x5841('0xe'));var deskjs=require(_0x5841('0xf'));var toCsv=require(_0x5841('0x9'));var querystring=require(_0x5841('0x10'));var Papa=require('papaparse');var Redis=require(_0x5841('0x11'));var authService=require(_0x5841('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5841('0x13'));var hardwareService=require(_0x5841('0x14'));var logger=require('../../config/logger')(_0x5841('0x15'));var utils=require(_0x5841('0x16'));var config=require(_0x5841('0x17'));var licenseUtil=require(_0x5841('0x18'));var db=require(_0x5841('0x19'))['db'];function respondWithStatusCode(_0xe89d69,_0xe5332e){_0xe5332e=_0xe5332e||0xcc;return function(_0x154c8a){if(_0x154c8a){return _0xe89d69[_0x5841('0x1a')](_0xe5332e);}return _0xe89d69['status'](_0xe5332e)[_0x5841('0x1b')]();};}function respondWithResult(_0x45f254,_0x3b6e7d){_0x3b6e7d=_0x3b6e7d||0xc8;return function(_0x54bcb8){if(_0x54bcb8){return _0x45f254[_0x5841('0x1c')](_0x3b6e7d)['json'](_0x54bcb8);}};}function respondWithFilteredResult(_0x4473f9,_0x538335){return function(_0x3caca4){if(_0x3caca4){var _0x32a2ad=typeof _0x538335[_0x5841('0x1d')]==='undefined'&&typeof _0x538335[_0x5841('0x1e')]===_0x5841('0x1f');var _0xa4107f=_0x3caca4[_0x5841('0x20')];var _0x150f75=_0x32a2ad?0x0:_0x538335[_0x5841('0x1d')];var _0x375670=_0x32a2ad?_0x3caca4['count']:_0x538335[_0x5841('0x1d')]+_0x538335[_0x5841('0x1e')];var _0x5007f;if(_0x375670>=_0xa4107f){_0x375670=_0xa4107f;_0x5007f=0xc8;}else{_0x5007f=0xce;}_0x4473f9['status'](_0x5007f);return _0x4473f9['set']('Content-Range',_0x150f75+'-'+_0x375670+'/'+_0xa4107f)[_0x5841('0x21')](_0x3caca4);}return null;};}function patchUpdates(_0x259d91){return function(_0x2abcd7){try{jsonpatch['apply'](_0x2abcd7,_0x259d91,!![]);}catch(_0x2b2bce){return BPromise[_0x5841('0x22')](_0x2b2bce);}return _0x2abcd7[_0x5841('0x23')]();};}function saveUpdates(_0x323f4f,_0x409b3d){return function(_0x42cf15){if(_0x42cf15){return _0x42cf15[_0x5841('0x24')](_0x323f4f)[_0x5841('0x25')](function(_0x8e429){return _0x8e429;});}return null;};}function removeEntity(_0x5c0939,_0x181ff1){return function(_0x1459e7){if(_0x1459e7){return _0x1459e7['destroy']()[_0x5841('0x25')](function(){_0x5c0939[_0x5841('0x1c')](0xcc)[_0x5841('0x1b')]();});}};}function handleEntityNotFound(_0x89af4d,_0x4214d8){return function(_0x562432){if(!_0x562432){_0x89af4d[_0x5841('0x1a')](0x194);}return _0x562432;};}function handleError(_0x1be039,_0x44032c){_0x44032c=_0x44032c||0x1f4;return function(_0x5dc553){logger[_0x5841('0x26')](_0x5dc553[_0x5841('0x27')]);if(_0x5dc553[_0x5841('0x28')]){delete _0x5dc553[_0x5841('0x28')];}_0x1be039[_0x5841('0x1c')](_0x44032c)['send'](_0x5dc553);};}exports[_0x5841('0x29')]=function(_0x2a7339,_0x412a48){var _0x2eff37={},_0x543048={},_0xe4bab={'count':0x0,'rows':[]};var _0x2fe704=_[_0x5841('0x2a')](db[_0x5841('0x2b')]['rawAttributes'],function(_0x2e25b5){return{'name':_0x2e25b5[_0x5841('0x2c')],'type':_0x2e25b5[_0x5841('0x2d')][_0x5841('0x2e')]};});_0x543048[_0x5841('0x2f')]=_[_0x5841('0x2a')](_0x2fe704,_0x5841('0x28'));_0x543048['query']=_[_0x5841('0x30')](_0x2a7339[_0x5841('0x31')]);_0x543048['filters']=_[_0x5841('0x32')](_0x543048['model'],_0x543048[_0x5841('0x31')]);_0x2eff37[_0x5841('0x33')]=_['intersection'](_0x543048[_0x5841('0x2f')],qs[_0x5841('0x34')](_0x2a7339[_0x5841('0x31')][_0x5841('0x34')]));_0x2eff37['attributes']=_0x2eff37['attributes'][_0x5841('0x35')]?_0x2eff37[_0x5841('0x33')]:_0x543048[_0x5841('0x2f')];if(!_0x2a7339[_0x5841('0x31')][_0x5841('0x36')](_0x5841('0x37'))){_0x2eff37[_0x5841('0x1e')]=qs[_0x5841('0x1e')](_0x2a7339[_0x5841('0x31')]['limit']);_0x2eff37[_0x5841('0x1d')]=qs[_0x5841('0x1d')](_0x2a7339[_0x5841('0x31')][_0x5841('0x1d')]);}_0x2eff37[_0x5841('0x38')]=qs[_0x5841('0x39')](_0x2a7339[_0x5841('0x31')][_0x5841('0x39')]);_0x2eff37[_0x5841('0x3a')]=qs['filters'](_['pick'](_0x2a7339['query'],_0x543048[_0x5841('0x3b')]),_0x2fe704);if(_0x2a7339['query'][_0x5841('0x3c')]){_0x2eff37[_0x5841('0x3a')]=_[_0x5841('0x3d')](_0x2eff37[_0x5841('0x3a')],{'$or':_['map'](_0x2fe704,function(_0x2bc678){if(_0x2bc678['type']!=='VIRTUAL'){var _0x321097={};_0x321097[_0x2bc678[_0x5841('0x28')]]={'$like':'%'+_0x2a7339[_0x5841('0x31')][_0x5841('0x3c')]+'%'};return _0x321097;}})});}_0x2eff37=_['merge']({},_0x2eff37,_0x2a7339[_0x5841('0x3e')]);var _0x1474f1={'where':_0x2eff37[_0x5841('0x3a')]};return db[_0x5841('0x2b')][_0x5841('0x20')](_0x1474f1)[_0x5841('0x25')](function(_0x31de5c){_0xe4bab[_0x5841('0x20')]=_0x31de5c;if(_0x2a7339['query'][_0x5841('0x3f')]){_0x2eff37[_0x5841('0x40')]=[{'all':!![]}];}return db[_0x5841('0x2b')][_0x5841('0x41')](_0x2eff37);})[_0x5841('0x25')](function(_0x210923){_0xe4bab['rows']=_0x210923;return _0xe4bab;})[_0x5841('0x25')](respondWithFilteredResult(_0x412a48,_0x2eff37))[_0x5841('0x42')](handleError(_0x412a48,null));};exports[_0x5841('0x43')]=function(_0x4c2d04,_0x24fddb){var _0xc803a={'raw':![],'where':{'id':_0x4c2d04[_0x5841('0x44')]['id']}},_0x242832={};_0x242832[_0x5841('0x2f')]=_[_0x5841('0x30')](db[_0x5841('0x2b')][_0x5841('0x45')]);_0x242832[_0x5841('0x31')]=_[_0x5841('0x30')](_0x4c2d04[_0x5841('0x31')]);_0x242832[_0x5841('0x3b')]=_[_0x5841('0x32')](_0x242832['model'],_0x242832['query']);_0xc803a['attributes']=_[_0x5841('0x32')](_0x242832['model'],qs[_0x5841('0x34')](_0x4c2d04[_0x5841('0x31')][_0x5841('0x34')]));_0xc803a[_0x5841('0x33')]=_0xc803a[_0x5841('0x33')][_0x5841('0x35')]?_0xc803a[_0x5841('0x33')]:_0x242832[_0x5841('0x2f')];if(_0x4c2d04[_0x5841('0x31')][_0x5841('0x3f')]){_0xc803a[_0x5841('0x40')]=[{'all':!![]}];}_0xc803a=_['merge']({},_0xc803a,_0x4c2d04['options']);return db[_0x5841('0x2b')][_0x5841('0x46')](_0xc803a)[_0x5841('0x25')](handleEntityNotFound(_0x24fddb,null))['then'](respondWithResult(_0x24fddb,null))[_0x5841('0x42')](handleError(_0x24fddb,null));};exports[_0x5841('0x47')]=function(_0x5f1c0c,_0x3cac41){return db[_0x5841('0x2b')][_0x5841('0x47')](_0x5f1c0c[_0x5841('0x48')],{})[_0x5841('0x25')](respondWithResult(_0x3cac41,0xc9))[_0x5841('0x42')](handleError(_0x3cac41,null));};exports[_0x5841('0x24')]=function(_0x2a7e51,_0x2d051b){if(_0x2a7e51[_0x5841('0x48')]['id']){delete _0x2a7e51[_0x5841('0x48')]['id'];}return db[_0x5841('0x2b')][_0x5841('0x46')]({'where':{'id':_0x2a7e51['params']['id']}})[_0x5841('0x25')](handleEntityNotFound(_0x2d051b,null))[_0x5841('0x25')](saveUpdates(_0x2a7e51[_0x5841('0x48')],null))[_0x5841('0x25')](respondWithResult(_0x2d051b,null))[_0x5841('0x42')](handleError(_0x2d051b,null));};exports[_0x5841('0x49')]=function(_0x48f97d,_0x1b9455){return db[_0x5841('0x2b')][_0x5841('0x46')]({'where':{'id':_0x48f97d[_0x5841('0x44')]['id']}})[_0x5841('0x25')](handleEntityNotFound(_0x1b9455,null))[_0x5841('0x25')](removeEntity(_0x1b9455,null))['catch'](handleError(_0x1b9455,null));};exports[_0x5841('0x4a')]=function(_0x3f8496,_0x4d2173,_0x446604){return db[_0x5841('0x4b')][_0x5841('0x46')]({'where':{'id':_0x3f8496[_0x5841('0x44')]['id']}})[_0x5841('0x25')](handleEntityNotFound(_0x4d2173,null))[_0x5841('0x25')](function(_0x3d857e){if(_0x3d857e){return _0x3d857e[_0x5841('0x4a')](_0x3f8496[_0x5841('0x48')][_0x5841('0x4c')],_['omit'](_0x3f8496[_0x5841('0x48')],[_0x5841('0x4c'),'id'])||{});}})[_0x5841('0x25')](respondWithResult(_0x4d2173,null))[_0x5841('0x42')](handleError(_0x4d2173,null));};exports[_0x5841('0x4d')]=function(_0x4d4de1,_0x43bc6c,_0x2b1a8b){var _0x25bc4c={};var _0x16d94f={};var _0x55bf66;var _0x257581;return db[_0x5841('0x2b')][_0x5841('0x4e')]({'where':{'id':_0x4d4de1[_0x5841('0x44')]['id']}})[_0x5841('0x25')](handleEntityNotFound(_0x43bc6c,null))[_0x5841('0x25')](function(_0x2bd5c0){if(_0x2bd5c0){_0x55bf66=_0x2bd5c0;_0x16d94f[_0x5841('0x2f')]=_[_0x5841('0x30')](db['Condition']['rawAttributes']);_0x16d94f[_0x5841('0x31')]=_[_0x5841('0x30')](_0x4d4de1[_0x5841('0x31')]);_0x16d94f[_0x5841('0x3b')]=_[_0x5841('0x32')](_0x16d94f[_0x5841('0x2f')],_0x16d94f[_0x5841('0x31')]);_0x25bc4c[_0x5841('0x33')]=_[_0x5841('0x32')](_0x16d94f['model'],qs[_0x5841('0x34')](_0x4d4de1['query'][_0x5841('0x34')]));_0x25bc4c['attributes']=_0x25bc4c[_0x5841('0x33')][_0x5841('0x35')]?_0x25bc4c['attributes']:_0x16d94f[_0x5841('0x2f')];_0x25bc4c[_0x5841('0x38')]=qs[_0x5841('0x39')](_0x4d4de1[_0x5841('0x31')][_0x5841('0x39')]);_0x25bc4c[_0x5841('0x3a')]=qs[_0x5841('0x3b')](_[_0x5841('0x4f')](_0x4d4de1[_0x5841('0x31')],_0x16d94f[_0x5841('0x3b')]));if(_0x4d4de1[_0x5841('0x31')][_0x5841('0x3c')]){_0x25bc4c['where']=_[_0x5841('0x3d')](_0x25bc4c['where'],{'$or':_[_0x5841('0x2a')](_0x25bc4c[_0x5841('0x33')],function(_0x500eab){var _0x4f5d1d={};_0x4f5d1d[_0x500eab]={'$like':'%'+_0x4d4de1['query'][_0x5841('0x3c')]+'%'};return _0x4f5d1d;})});}_0x25bc4c=_[_0x5841('0x3d')]({},_0x25bc4c,_0x4d4de1[_0x5841('0x3e')]);return _0x55bf66[_0x5841('0x4d')](_0x25bc4c);}})[_0x5841('0x25')](function(_0xafa96a){if(_0xafa96a){_0x257581=_0xafa96a[_0x5841('0x35')];if(!_0x4d4de1['query'][_0x5841('0x36')](_0x5841('0x37'))){_0x25bc4c[_0x5841('0x1e')]=qs['limit'](_0x4d4de1[_0x5841('0x31')]['limit']);_0x25bc4c['offset']=qs[_0x5841('0x1d')](_0x4d4de1[_0x5841('0x31')][_0x5841('0x1d')]);}return _0x55bf66[_0x5841('0x4d')](_0x25bc4c);}})[_0x5841('0x25')](function(_0x4125bd){if(_0x4125bd){return _0x4125bd?{'count':_0x257581,'rows':_0x4125bd}:null;}})[_0x5841('0x25')](respondWithResult(_0x43bc6c,null))[_0x5841('0x42')](handleError(_0x43bc6c,null));};exports[_0x5841('0x50')]=function(_0x3ff683,_0x18e9de,_0x28577e){return db[_0x5841('0x51')][_0x5841('0x46')]({'where':{'id':_0x3ff683[_0x5841('0x44')]['id']}})['then'](handleEntityNotFound(_0x18e9de,null))['then'](function(_0x23daeb){if(_0x23daeb){return _0x23daeb[_0x5841('0x50')](_0x3ff683['body']['ids'],_[_0x5841('0x52')](_0x3ff683[_0x5841('0x48')],[_0x5841('0x4c'),'id'])||{});}})[_0x5841('0x25')](respondWithResult(_0x18e9de,null))[_0x5841('0x42')](handleError(_0x18e9de,null));};exports[_0x5841('0x53')]=function(_0x28cc37,_0x14985d,_0x53c8e0){var _0x566791={};var _0x14ced0={};var _0x477b2b;var _0xac9e92;return db[_0x5841('0x2b')][_0x5841('0x4e')]({'where':{'id':_0x28cc37[_0x5841('0x44')]['id']}})['then'](handleEntityNotFound(_0x14985d,null))[_0x5841('0x25')](function(_0x11bda8){if(_0x11bda8){_0x477b2b=_0x11bda8;_0x14ced0[_0x5841('0x2f')]=_[_0x5841('0x30')](db['Action'][_0x5841('0x45')]);_0x14ced0['query']=_[_0x5841('0x30')](_0x28cc37['query']);_0x14ced0[_0x5841('0x3b')]=_['intersection'](_0x14ced0[_0x5841('0x2f')],_0x14ced0[_0x5841('0x31')]);_0x566791[_0x5841('0x33')]=_['intersection'](_0x14ced0[_0x5841('0x2f')],qs[_0x5841('0x34')](_0x28cc37[_0x5841('0x31')][_0x5841('0x34')]));_0x566791[_0x5841('0x33')]=_0x566791[_0x5841('0x33')][_0x5841('0x35')]?_0x566791['attributes']:_0x14ced0[_0x5841('0x2f')];_0x566791['order']=qs['sort'](_0x28cc37[_0x5841('0x31')][_0x5841('0x39')]);_0x566791[_0x5841('0x3a')]=qs['filters'](_[_0x5841('0x4f')](_0x28cc37['query'],_0x14ced0[_0x5841('0x3b')]));if(_0x28cc37[_0x5841('0x31')]['filter']){_0x566791['where']=_[_0x5841('0x3d')](_0x566791[_0x5841('0x3a')],{'$or':_[_0x5841('0x2a')](_0x566791[_0x5841('0x33')],function(_0x450bab){var _0x5ed71c={};_0x5ed71c[_0x450bab]={'$like':'%'+_0x28cc37[_0x5841('0x31')][_0x5841('0x3c')]+'%'};return _0x5ed71c;})});}_0x566791=_[_0x5841('0x3d')]({},_0x566791,_0x28cc37[_0x5841('0x3e')]);return _0x477b2b[_0x5841('0x53')](_0x566791);}})['then'](function(_0x39e93a){if(_0x39e93a){_0xac9e92=_0x39e93a[_0x5841('0x35')];if(!_0x28cc37[_0x5841('0x31')]['hasOwnProperty'](_0x5841('0x37'))){_0x566791[_0x5841('0x1e')]=qs[_0x5841('0x1e')](_0x28cc37[_0x5841('0x31')][_0x5841('0x1e')]);_0x566791[_0x5841('0x1d')]=qs[_0x5841('0x1d')](_0x28cc37[_0x5841('0x31')][_0x5841('0x1d')]);}return _0x477b2b[_0x5841('0x53')](_0x566791);}})[_0x5841('0x25')](function(_0x2abed5){if(_0x2abed5){return _0x2abed5?{'count':_0xac9e92,'rows':_0x2abed5}:null;}})[_0x5841('0x25')](respondWithResult(_0x14985d,null))[_0x5841('0x42')](handleError(_0x14985d,null));}; \ No newline at end of file +var _0xe74f=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','find','create','body','addConditions','omit','getConditions','findOne','Condition','nolimit','addActions','ids','getActions','Action','length','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','map','Automation','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x3727ae,_0x165f88){var _0x1c3f01=function(_0x5cd5a5){while(--_0x5cd5a5){_0x3727ae['push'](_0x3727ae['shift']());}};_0x1c3f01(++_0x165f88);}(_0xe74f,0x1c5));var _0xfe74=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0xe74f[_0x2c3a88];return _0x4a7925;};'use strict';var emlformat=require(_0xfe74('0x0'));var rimraf=require(_0xfe74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe74('0x2'));var rp=require(_0xfe74('0x3'));var moment=require(_0xfe74('0x4'));var BPromise=require(_0xfe74('0x5'));var Mustache=require(_0xfe74('0x6'));var util=require(_0xfe74('0x7'));var path=require(_0xfe74('0x8'));var sox=require(_0xfe74('0x9'));var csv=require(_0xfe74('0xa'));var ejs=require(_0xfe74('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe74('0xc'));var squel=require(_0xfe74('0xd'));var crypto=require(_0xfe74('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe74('0xa'));var querystring=require(_0xfe74('0xf'));var Papa=require(_0xfe74('0x10'));var Redis=require(_0xfe74('0x11'));var authService=require(_0xfe74('0x12'));var qs=require(_0xfe74('0x13'));var as=require(_0xfe74('0x14'));var hardwareService=require(_0xfe74('0x15'));var logger=require('../../config/logger')(_0xfe74('0x16'));var utils=require('../../config/utils');var config=require(_0xfe74('0x17'));var licenseUtil=require(_0xfe74('0x18'));var db=require(_0xfe74('0x19'))['db'];function respondWithStatusCode(_0x1849d4,_0x1daa41){_0x1daa41=_0x1daa41||0xcc;return function(_0x376c50){if(_0x376c50){return _0x1849d4[_0xfe74('0x1a')](_0x1daa41);}return _0x1849d4[_0xfe74('0x1b')](_0x1daa41)[_0xfe74('0x1c')]();};}function respondWithResult(_0x1075c6,_0x3a1ed3){_0x3a1ed3=_0x3a1ed3||0xc8;return function(_0x11fd5e){if(_0x11fd5e){return _0x1075c6[_0xfe74('0x1b')](_0x3a1ed3)[_0xfe74('0x1d')](_0x11fd5e);}};}function respondWithFilteredResult(_0x34c7ec,_0x12d10a){return function(_0x186f10){if(_0x186f10){var _0x9039d5=typeof _0x12d10a[_0xfe74('0x1e')]===_0xfe74('0x1f')&&typeof _0x12d10a[_0xfe74('0x20')]===_0xfe74('0x1f');var _0x237936=_0x186f10[_0xfe74('0x21')];var _0x571e40=_0x9039d5?0x0:_0x12d10a[_0xfe74('0x1e')];var _0x206ac4=_0x9039d5?_0x186f10['count']:_0x12d10a[_0xfe74('0x1e')]+_0x12d10a['limit'];var _0x4ce449;if(_0x206ac4>=_0x237936){_0x206ac4=_0x237936;_0x4ce449=0xc8;}else{_0x4ce449=0xce;}_0x34c7ec[_0xfe74('0x1b')](_0x4ce449);return _0x34c7ec[_0xfe74('0x22')]('Content-Range',_0x571e40+'-'+_0x206ac4+'/'+_0x237936)['json'](_0x186f10);}return null;};}function patchUpdates(_0x20b927){return function(_0x398a7b){try{jsonpatch[_0xfe74('0x23')](_0x398a7b,_0x20b927,!![]);}catch(_0x46c5d3){return BPromise['reject'](_0x46c5d3);}return _0x398a7b[_0xfe74('0x24')]();};}function saveUpdates(_0x185c3d,_0x40ad77){return function(_0x3225a2){if(_0x3225a2){return _0x3225a2[_0xfe74('0x25')](_0x185c3d)[_0xfe74('0x26')](function(_0x17212a){return _0x17212a;});}return null;};}function removeEntity(_0x30c6e6,_0x54cfad){return function(_0x5252c2){if(_0x5252c2){return _0x5252c2[_0xfe74('0x27')]()[_0xfe74('0x26')](function(){_0x30c6e6[_0xfe74('0x1b')](0xcc)[_0xfe74('0x1c')]();});}};}function handleEntityNotFound(_0x4d118f,_0x1b767c){return function(_0x476c52){if(!_0x476c52){_0x4d118f[_0xfe74('0x1a')](0x194);}return _0x476c52;};}function handleError(_0x242c21,_0x21d30){_0x21d30=_0x21d30||0x1f4;return function(_0x3876dd){logger[_0xfe74('0x28')](_0x3876dd[_0xfe74('0x29')]);if(_0x3876dd[_0xfe74('0x2a')]){delete _0x3876dd[_0xfe74('0x2a')];}_0x242c21['status'](_0x21d30)[_0xfe74('0x2b')](_0x3876dd);};}exports['index']=function(_0x11084e,_0x4443ea){var _0x122c9f={},_0x816eee={},_0x847faf={'count':0x0,'rows':[]};var _0x18a5e4=_[_0xfe74('0x2c')](db[_0xfe74('0x2d')][_0xfe74('0x2e')],function(_0x253444){return{'name':_0x253444[_0xfe74('0x2f')],'type':_0x253444['type'][_0xfe74('0x30')]};});_0x816eee[_0xfe74('0x31')]=_['map'](_0x18a5e4,_0xfe74('0x2a'));_0x816eee[_0xfe74('0x32')]=_[_0xfe74('0x33')](_0x11084e[_0xfe74('0x32')]);_0x816eee[_0xfe74('0x34')]=_[_0xfe74('0x35')](_0x816eee[_0xfe74('0x31')],_0x816eee[_0xfe74('0x32')]);_0x122c9f['attributes']=_[_0xfe74('0x35')](_0x816eee['model'],qs[_0xfe74('0x36')](_0x11084e[_0xfe74('0x32')][_0xfe74('0x36')]));_0x122c9f[_0xfe74('0x37')]=_0x122c9f[_0xfe74('0x37')]['length']?_0x122c9f[_0xfe74('0x37')]:_0x816eee[_0xfe74('0x31')];if(!_0x11084e[_0xfe74('0x32')][_0xfe74('0x38')]('nolimit')){_0x122c9f['limit']=qs[_0xfe74('0x20')](_0x11084e[_0xfe74('0x32')]['limit']);_0x122c9f[_0xfe74('0x1e')]=qs[_0xfe74('0x1e')](_0x11084e[_0xfe74('0x32')][_0xfe74('0x1e')]);}_0x122c9f[_0xfe74('0x39')]=qs[_0xfe74('0x3a')](_0x11084e['query'][_0xfe74('0x3a')]);_0x122c9f[_0xfe74('0x3b')]=qs[_0xfe74('0x34')](_[_0xfe74('0x3c')](_0x11084e[_0xfe74('0x32')],_0x816eee[_0xfe74('0x34')]),_0x18a5e4);if(_0x11084e[_0xfe74('0x32')][_0xfe74('0x3d')]){_0x122c9f[_0xfe74('0x3b')]=_[_0xfe74('0x3e')](_0x122c9f['where'],{'$or':_['map'](_0x18a5e4,function(_0x4c00b9){if(_0x4c00b9[_0xfe74('0x3f')]!==_0xfe74('0x40')){var _0x5bd16d={};_0x5bd16d[_0x4c00b9[_0xfe74('0x2a')]]={'$like':'%'+_0x11084e[_0xfe74('0x32')][_0xfe74('0x3d')]+'%'};return _0x5bd16d;}})});}_0x122c9f=_[_0xfe74('0x3e')]({},_0x122c9f,_0x11084e[_0xfe74('0x41')]);var _0x4299e3={'where':_0x122c9f[_0xfe74('0x3b')]};return db[_0xfe74('0x2d')][_0xfe74('0x21')](_0x4299e3)['then'](function(_0x12bd5a){_0x847faf[_0xfe74('0x21')]=_0x12bd5a;if(_0x11084e[_0xfe74('0x32')]['includeAll']){_0x122c9f[_0xfe74('0x42')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x122c9f);})[_0xfe74('0x26')](function(_0x52ed2f){_0x847faf[_0xfe74('0x43')]=_0x52ed2f;return _0x847faf;})[_0xfe74('0x26')](respondWithFilteredResult(_0x4443ea,_0x122c9f))[_0xfe74('0x44')](handleError(_0x4443ea,null));};exports[_0xfe74('0x45')]=function(_0x6aaef5,_0x33b05e){var _0x51817d={'raw':![],'where':{'id':_0x6aaef5[_0xfe74('0x46')]['id']}},_0x3488cd={};_0x3488cd['model']=_[_0xfe74('0x33')](db[_0xfe74('0x2d')][_0xfe74('0x2e')]);_0x3488cd[_0xfe74('0x32')]=_[_0xfe74('0x33')](_0x6aaef5[_0xfe74('0x32')]);_0x3488cd[_0xfe74('0x34')]=_[_0xfe74('0x35')](_0x3488cd['model'],_0x3488cd[_0xfe74('0x32')]);_0x51817d[_0xfe74('0x37')]=_[_0xfe74('0x35')](_0x3488cd[_0xfe74('0x31')],qs[_0xfe74('0x36')](_0x6aaef5[_0xfe74('0x32')][_0xfe74('0x36')]));_0x51817d[_0xfe74('0x37')]=_0x51817d['attributes']['length']?_0x51817d[_0xfe74('0x37')]:_0x3488cd[_0xfe74('0x31')];if(_0x6aaef5[_0xfe74('0x32')]['includeAll']){_0x51817d['include']=[{'all':!![]}];}_0x51817d=_[_0xfe74('0x3e')]({},_0x51817d,_0x6aaef5[_0xfe74('0x41')]);return db[_0xfe74('0x2d')][_0xfe74('0x47')](_0x51817d)['then'](handleEntityNotFound(_0x33b05e,null))[_0xfe74('0x26')](respondWithResult(_0x33b05e,null))[_0xfe74('0x44')](handleError(_0x33b05e,null));};exports[_0xfe74('0x48')]=function(_0x9a0925,_0x1d231a){return db[_0xfe74('0x2d')][_0xfe74('0x48')](_0x9a0925[_0xfe74('0x49')],{})[_0xfe74('0x26')](respondWithResult(_0x1d231a,0xc9))[_0xfe74('0x44')](handleError(_0x1d231a,null));};exports[_0xfe74('0x25')]=function(_0x5360fd,_0x693de){if(_0x5360fd[_0xfe74('0x49')]['id']){delete _0x5360fd[_0xfe74('0x49')]['id'];}return db[_0xfe74('0x2d')]['find']({'where':{'id':_0x5360fd[_0xfe74('0x46')]['id']}})['then'](handleEntityNotFound(_0x693de,null))['then'](saveUpdates(_0x5360fd[_0xfe74('0x49')],null))[_0xfe74('0x26')](respondWithResult(_0x693de,null))[_0xfe74('0x44')](handleError(_0x693de,null));};exports[_0xfe74('0x27')]=function(_0x16b72f,_0x1d1672){return db[_0xfe74('0x2d')][_0xfe74('0x47')]({'where':{'id':_0x16b72f[_0xfe74('0x46')]['id']}})[_0xfe74('0x26')](handleEntityNotFound(_0x1d1672,null))[_0xfe74('0x26')](removeEntity(_0x1d1672,null))[_0xfe74('0x44')](handleError(_0x1d1672,null));};exports[_0xfe74('0x4a')]=function(_0x319ef8,_0x76b685,_0x334f23){return db['Condition']['find']({'where':{'id':_0x319ef8[_0xfe74('0x46')]['id']}})[_0xfe74('0x26')](handleEntityNotFound(_0x76b685,null))[_0xfe74('0x26')](function(_0x5c8f7a){if(_0x5c8f7a){return _0x5c8f7a['addConditions'](_0x319ef8[_0xfe74('0x49')]['ids'],_[_0xfe74('0x4b')](_0x319ef8[_0xfe74('0x49')],['ids','id'])||{});}})[_0xfe74('0x26')](respondWithResult(_0x76b685,null))[_0xfe74('0x44')](handleError(_0x76b685,null));};exports[_0xfe74('0x4c')]=function(_0x2618db,_0x4bd555,_0x39f84a){var _0x1ac670={};var _0xf08697={};var _0x560782;var _0x205d7a;return db[_0xfe74('0x2d')][_0xfe74('0x4d')]({'where':{'id':_0x2618db[_0xfe74('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bd555,null))[_0xfe74('0x26')](function(_0x53f1d0){if(_0x53f1d0){_0x560782=_0x53f1d0;_0xf08697[_0xfe74('0x31')]=_[_0xfe74('0x33')](db[_0xfe74('0x4e')][_0xfe74('0x2e')]);_0xf08697[_0xfe74('0x32')]=_[_0xfe74('0x33')](_0x2618db[_0xfe74('0x32')]);_0xf08697[_0xfe74('0x34')]=_[_0xfe74('0x35')](_0xf08697['model'],_0xf08697[_0xfe74('0x32')]);_0x1ac670['attributes']=_[_0xfe74('0x35')](_0xf08697[_0xfe74('0x31')],qs[_0xfe74('0x36')](_0x2618db[_0xfe74('0x32')][_0xfe74('0x36')]));_0x1ac670[_0xfe74('0x37')]=_0x1ac670['attributes']['length']?_0x1ac670[_0xfe74('0x37')]:_0xf08697['model'];_0x1ac670['order']=qs[_0xfe74('0x3a')](_0x2618db[_0xfe74('0x32')]['sort']);_0x1ac670[_0xfe74('0x3b')]=qs[_0xfe74('0x34')](_['pick'](_0x2618db[_0xfe74('0x32')],_0xf08697[_0xfe74('0x34')]));if(_0x2618db[_0xfe74('0x32')][_0xfe74('0x3d')]){_0x1ac670[_0xfe74('0x3b')]=_[_0xfe74('0x3e')](_0x1ac670['where'],{'$or':_[_0xfe74('0x2c')](_0x1ac670[_0xfe74('0x37')],function(_0x304d12){var _0x48859a={};_0x48859a[_0x304d12]={'$like':'%'+_0x2618db[_0xfe74('0x32')][_0xfe74('0x3d')]+'%'};return _0x48859a;})});}_0x1ac670=_['merge']({},_0x1ac670,_0x2618db[_0xfe74('0x41')]);return _0x560782[_0xfe74('0x4c')](_0x1ac670);}})[_0xfe74('0x26')](function(_0x56dc6b){if(_0x56dc6b){_0x205d7a=_0x56dc6b['length'];if(!_0x2618db['query']['hasOwnProperty'](_0xfe74('0x4f'))){_0x1ac670['limit']=qs[_0xfe74('0x20')](_0x2618db['query'][_0xfe74('0x20')]);_0x1ac670['offset']=qs[_0xfe74('0x1e')](_0x2618db[_0xfe74('0x32')][_0xfe74('0x1e')]);}return _0x560782[_0xfe74('0x4c')](_0x1ac670);}})[_0xfe74('0x26')](function(_0x3bad4d){if(_0x3bad4d){return _0x3bad4d?{'count':_0x205d7a,'rows':_0x3bad4d}:null;}})[_0xfe74('0x26')](respondWithResult(_0x4bd555,null))['catch'](handleError(_0x4bd555,null));};exports[_0xfe74('0x50')]=function(_0x363163,_0x103c68,_0x1f6bb4){return db['Action'][_0xfe74('0x47')]({'where':{'id':_0x363163[_0xfe74('0x46')]['id']}})['then'](handleEntityNotFound(_0x103c68,null))[_0xfe74('0x26')](function(_0x712b4a){if(_0x712b4a){return _0x712b4a[_0xfe74('0x50')](_0x363163['body'][_0xfe74('0x51')],_[_0xfe74('0x4b')](_0x363163[_0xfe74('0x49')],[_0xfe74('0x51'),'id'])||{});}})[_0xfe74('0x26')](respondWithResult(_0x103c68,null))[_0xfe74('0x44')](handleError(_0x103c68,null));};exports[_0xfe74('0x52')]=function(_0x5aa622,_0x24f498,_0xc9e1b7){var _0x56b536={};var _0x2778b6={};var _0x2d4510;var _0x43d3a9;return db['Automation'][_0xfe74('0x4d')]({'where':{'id':_0x5aa622[_0xfe74('0x46')]['id']}})[_0xfe74('0x26')](handleEntityNotFound(_0x24f498,null))[_0xfe74('0x26')](function(_0x6bf3bc){if(_0x6bf3bc){_0x2d4510=_0x6bf3bc;_0x2778b6[_0xfe74('0x31')]=_[_0xfe74('0x33')](db[_0xfe74('0x53')]['rawAttributes']);_0x2778b6[_0xfe74('0x32')]=_[_0xfe74('0x33')](_0x5aa622[_0xfe74('0x32')]);_0x2778b6[_0xfe74('0x34')]=_[_0xfe74('0x35')](_0x2778b6[_0xfe74('0x31')],_0x2778b6['query']);_0x56b536[_0xfe74('0x37')]=_[_0xfe74('0x35')](_0x2778b6[_0xfe74('0x31')],qs['fields'](_0x5aa622[_0xfe74('0x32')][_0xfe74('0x36')]));_0x56b536[_0xfe74('0x37')]=_0x56b536[_0xfe74('0x37')][_0xfe74('0x54')]?_0x56b536[_0xfe74('0x37')]:_0x2778b6[_0xfe74('0x31')];_0x56b536[_0xfe74('0x39')]=qs[_0xfe74('0x3a')](_0x5aa622[_0xfe74('0x32')]['sort']);_0x56b536['where']=qs[_0xfe74('0x34')](_[_0xfe74('0x3c')](_0x5aa622[_0xfe74('0x32')],_0x2778b6[_0xfe74('0x34')]));if(_0x5aa622['query'][_0xfe74('0x3d')]){_0x56b536[_0xfe74('0x3b')]=_[_0xfe74('0x3e')](_0x56b536['where'],{'$or':_[_0xfe74('0x2c')](_0x56b536[_0xfe74('0x37')],function(_0x50706f){var _0x16ae7e={};_0x16ae7e[_0x50706f]={'$like':'%'+_0x5aa622[_0xfe74('0x32')][_0xfe74('0x3d')]+'%'};return _0x16ae7e;})});}_0x56b536=_[_0xfe74('0x3e')]({},_0x56b536,_0x5aa622[_0xfe74('0x41')]);return _0x2d4510[_0xfe74('0x52')](_0x56b536);}})['then'](function(_0x1acc0b){if(_0x1acc0b){_0x43d3a9=_0x1acc0b[_0xfe74('0x54')];if(!_0x5aa622[_0xfe74('0x32')][_0xfe74('0x38')]('nolimit')){_0x56b536[_0xfe74('0x20')]=qs['limit'](_0x5aa622['query'][_0xfe74('0x20')]);_0x56b536[_0xfe74('0x1e')]=qs[_0xfe74('0x1e')](_0x5aa622[_0xfe74('0x32')][_0xfe74('0x1e')]);}return _0x2d4510[_0xfe74('0x52')](_0x56b536);}})[_0xfe74('0x26')](function(_0x3314e9){if(_0x3314e9){return _0x3314e9?{'count':_0x43d3a9,'rows':_0x3314e9}:null;}})[_0xfe74('0x26')](respondWithResult(_0x24f498,null))[_0xfe74('0x44')](handleError(_0x24f498,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index fac334f..53727ae 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 _0x9b4e=['rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xef59a,_0x182f27){var _0x15a149=function(_0x593626){while(--_0x593626){_0xef59a['push'](_0xef59a['shift']());}};_0x15a149(++_0x182f27);}(_0x9b4e,0xad));var _0xe9b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b4e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe9b4('0x0'));var util=require('util');var logger=require(_0xe9b4('0x1'))(_0xe9b4('0x2'));var moment=require(_0xe9b4('0x3'));var BPromise=require(_0xe9b4('0x4'));var rp=require(_0xe9b4('0x5'));var fs=require('fs');var path=require(_0xe9b4('0x6'));var rimraf=require(_0xe9b4('0x7'));var config=require('../../config/environment');var attributes=require(_0xe9b4('0x8'));module[_0xe9b4('0x9')]=function(_0x1fb6ce,_0x44c8c8){return _0x1fb6ce['define'](_0xe9b4('0xa'),attributes,{'tableName':_0xe9b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75aa=['rimraf','exports','Automation','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x401942,_0x2fa788){var _0x423e42=function(_0x51b116){while(--_0x51b116){_0x401942['push'](_0x401942['shift']());}};_0x423e42(++_0x2fa788);}(_0x75aa,0x139));var _0xa75a=function(_0x2e84ce,_0x5407ae){_0x2e84ce=_0x2e84ce-0x0;var _0x32ee7f=_0x75aa[_0x2e84ce];return _0x32ee7f;};'use strict';var _=require(_0xa75a('0x0'));var util=require(_0xa75a('0x1'));var logger=require('../../config/logger')(_0xa75a('0x2'));var moment=require(_0xa75a('0x3'));var BPromise=require(_0xa75a('0x4'));var rp=require(_0xa75a('0x5'));var fs=require('fs');var path=require(_0xa75a('0x6'));var rimraf=require(_0xa75a('0x7'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xa75a('0x8')]=function(_0x31ee6b,_0x3b5023){return _0x31ee6b['define'](_0xa75a('0x9'),attributes,{'tableName':'tools_automations','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 5055d06..0917002 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 _0xe61c=['debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x4ce6fe,_0xb0dad){var _0x5491d2=function(_0xb8154){while(--_0xb8154){_0x4ce6fe['push'](_0x4ce6fe['shift']());}};_0x5491d2(++_0xb0dad);}(_0xe61c,0xee));var _0xce61=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xe61c[_0x3b16e1];return _0x311d1b;};'use strict';var _=require(_0xce61('0x0'));var util=require('util');var moment=require(_0xce61('0x1'));var BPromise=require(_0xce61('0x2'));var rs=require(_0xce61('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce61('0x4'));var logger=require('../../config/logger')(_0xce61('0x5'));var config=require(_0xce61('0x6'));var jayson=require(_0xce61('0x7'));var client=jayson[_0xce61('0x8')][_0xce61('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x310203,_0x24528e,_0x5f1d02){return new BPromise(function(_0x2fad37,_0x4b52c3){return client[_0xce61('0xa')](_0x310203,_0x5f1d02)[_0xce61('0xb')](function(_0xa1a028){logger[_0xce61('0xc')](_0xce61('0xd'),_0x24528e,'request\x20sent');logger[_0xce61('0xe')](_0xce61('0xf'),_0x24528e,'request\x20sent',JSON[_0xce61('0x10')](_0xa1a028));if(_0xa1a028[_0xce61('0x11')]){if(_0xa1a028['error'][_0xce61('0x12')]===0x1f4){logger['error'](_0xce61('0xd'),_0x24528e,_0xa1a028[_0xce61('0x11')]['message']);return _0x4b52c3(_0xa1a028[_0xce61('0x11')]['message']);}logger[_0xce61('0x11')]('Automation,\x20%s,\x20%s',_0x24528e,_0xa1a028[_0xce61('0x11')][_0xce61('0x13')]);return _0x2fad37(_0xa1a028[_0xce61('0x11')][_0xce61('0x13')]);}else{logger[_0xce61('0xc')]('Automation,\x20%s,\x20%s',_0x24528e,'request\x20sent');_0x2fad37(_0xa1a028[_0xce61('0x14')]['message']);}})['catch'](function(_0x1977f6){logger[_0xce61('0x11')](_0xce61('0xd'),_0x24528e,_0x1977f6);_0x4b52c3(_0x1977f6);});});} \ No newline at end of file +var _0xe0dd=['../../config/utils','../../config/logger','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe0dd,0x163));var _0xde0d=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xe0dd[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323200,_0x3ce23c,_0x33a644){return new BPromise(function(_0x570b78,_0x25f0fe){return client['request'](_0x323200,_0x33a644)[_0xde0d('0xa')](function(_0x5e6588){logger[_0xde0d('0xb')](_0xde0d('0xc'),_0x3ce23c,_0xde0d('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3ce23c,'request\x20sent',JSON[_0xde0d('0xe')](_0x5e6588));if(_0x5e6588[_0xde0d('0xf')]){if(_0x5e6588[_0xde0d('0xf')]['code']===0x1f4){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x25f0fe(_0x5e6588[_0xde0d('0xf')][_0xde0d('0x10')]);}logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x570b78(_0x5e6588['error'][_0xde0d('0x10')]);}else{logger['info'](_0xde0d('0xc'),_0x3ce23c,'request\x20sent');_0x570b78(_0x5e6588[_0xde0d('0x11')][_0xde0d('0x10')]);}})[_0xde0d('0x12')](function(_0x228666){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x228666);_0x25f0fe(_0x228666);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e18897a..8a02079 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 _0xc6ab=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','getActions','create','post','addConditions','/:id/actions','delete','exports','multer','util','path','connect-timeout'];(function(_0xc11001,_0xf90c85){var _0x528b55=function(_0x32a305){while(--_0x32a305){_0xc11001['push'](_0xc11001['shift']());}};_0x528b55(++_0xf90c85);}(_0xc6ab,0x96));var _0xbc6a=function(_0x7f2071,_0x318f67){_0x7f2071=_0x7f2071-0x0;var _0x22e7ab=_0xc6ab[_0x7f2071];return _0x22e7ab;};'use strict';var multer=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var path=require(_0xbc6a('0x2'));var timeout=require(_0xbc6a('0x3'));var express=require(_0xbc6a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbc6a('0x5'));var interaction=require(_0xbc6a('0x6'));var config=require(_0xbc6a('0x7'));var controller=require(_0xbc6a('0x8'));router[_0xbc6a('0x9')]('/',auth['isAuthenticated'](),controller[_0xbc6a('0xa')]);router[_0xbc6a('0x9')](_0xbc6a('0xb'),auth[_0xbc6a('0xc')](),controller[_0xbc6a('0xd')]);router['get']('/:id/conditions',auth[_0xbc6a('0xc')](),controller[_0xbc6a('0xe')]);router['get']('/:id/actions',auth[_0xbc6a('0xc')](),controller[_0xbc6a('0xf')]);router['post']('/',auth[_0xbc6a('0xc')](),controller[_0xbc6a('0x10')]);router[_0xbc6a('0x11')]('/:id/conditions',auth[_0xbc6a('0xc')](),controller[_0xbc6a('0x12')]);router[_0xbc6a('0x11')](_0xbc6a('0x13'),auth['isAuthenticated'](),controller['addActions']);router['put'](_0xbc6a('0xb'),auth[_0xbc6a('0xc')](),controller['update']);router[_0xbc6a('0x14')]('/:id',auth[_0xbc6a('0xc')](),controller['destroy']);module[_0xbc6a('0x15')]=router; \ No newline at end of file +var _0x7bb8=['isAuthenticated','index','show','get','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','/:id','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller'];(function(_0x1270a5,_0x117ef4){var _0x521963=function(_0x27d58c){while(--_0x27d58c){_0x1270a5['push'](_0x1270a5['shift']());}};_0x521963(++_0x117ef4);}(_0x7bb8,0xe8));var _0x87bb=function(_0x3877e3,_0x12756f){_0x3877e3=_0x3877e3-0x0;var _0x4364f8=_0x7bb8[_0x3877e3];return _0x4364f8;};'use strict';var multer=require('multer');var util=require(_0x87bb('0x0'));var path=require(_0x87bb('0x1'));var timeout=require(_0x87bb('0x2'));var express=require(_0x87bb('0x3'));var router=express['Router']();var fs_extra=require(_0x87bb('0x4'));var auth=require(_0x87bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x87bb('0x6'));var controller=require(_0x87bb('0x7'));router['get']('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x9')]);router['get']('/:id',auth[_0x87bb('0x8')](),controller[_0x87bb('0xa')]);router[_0x87bb('0xb')]('/:id/conditions',auth[_0x87bb('0x8')](),controller[_0x87bb('0xc')]);router[_0x87bb('0xb')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0xe')]);router[_0x87bb('0xf')]('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x10')]);router[_0x87bb('0xf')](_0x87bb('0x11'),auth[_0x87bb('0x8')](),controller['addConditions']);router[_0x87bb('0xf')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0x12')]);router[_0x87bb('0x13')](_0x87bb('0x14'),auth['isAuthenticated'](),controller[_0x87bb('0x15')]);router[_0x87bb('0x16')](_0x87bb('0x14'),auth[_0x87bb('0x8')](),controller['destroy']);module[_0x87bb('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 f7d5bae..b604fa9 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 _0x4b6f=['BOOLEAN','Active/Disactive\x20Campaign','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr'];(function(_0x3230f7,_0x247f63){var _0x2c9b13=function(_0x39932b){while(--_0x39932b){_0x3230f7['push'](_0x3230f7['shift']());}};_0x2c9b13(++_0x247f63);}(_0x4b6f,0xea));var _0xf4b6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4b6f[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xf4b6('0x0'));module['exports']={'name':{'type':Sequelize[_0xf4b6('0x1')],'unique':_0xf4b6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf4b6('0x3')),'allowNull':![],'defaultValue':_0xf4b6('0x3')},'description':{'type':Sequelize[_0xf4b6('0x1')]},'active':{'type':Sequelize[_0xf4b6('0x4')],'defaultValue':0x0,'comment':_0xf4b6('0x5')},'limitCalls':{'type':Sequelize[_0xf4b6('0x6')](0x4)[_0xf4b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4b6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4b6('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'comment':_0xf4b6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4b6('0xe')},'dialTimezone':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':_0xf4b6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xf4b6('0x10')](_0xf4b6('0x11'),_0xf4b6('0x12'),_0xf4b6('0x13')),'defaultValue':_0xf4b6('0x11')},'dialAMDActive':{'type':Sequelize[_0xf4b6('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf4b6('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4b6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4b6('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4b6('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4b6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4b6('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf4b6('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4b6('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4b6('0x10')](_0xf4b6('0x1a'),_0xf4b6('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4b6('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x2343=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','ASC','Cut\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\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)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0x2343,0xef));var _0x3234=function(_0xbc3542,_0x4de021){_0xbc3542=_0xbc3542-0x0;var _0x1c88ff=_0x2343[_0xbc3542];return _0x1c88ff;};'use strict';var Sequelize=require(_0x3234('0x0'));module[_0x3234('0x1')]={'name':{'type':Sequelize[_0x3234('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3234('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x3234('0x4')},'description':{'type':Sequelize[_0x3234('0x2')]},'active':{'type':Sequelize[_0x3234('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3234('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'defaultValue':0x3,'comment':_0x3234('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3234('0xe')},'dialTimezone':{'type':Sequelize[_0x3234('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3234('0x2')],'defaultValue':_0x3234('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x3234('0x3')]('always','never',_0x3234('0x10')),'defaultValue':_0x3234('0x11')},'dialAMDActive':{'type':Sequelize[_0x3234('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3234('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3234('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x3234('0x6')](0x9)[_0x3234('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3234('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3234('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3234('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3234('0x6')](0x9)[_0x3234('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3234('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x3234('0x6')](0x9)[_0x3234('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3234('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3234('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3234('0x6')](0x9)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3234('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3234('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3234('0x6')](0x9)[_0x3234('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3234('0x3')](_0x3234('0x19'),_0x3234('0x1a')),'defaultValue':_0x3234('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3234('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3234('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x3234('0x6')](0x3)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3234('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3234('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3234('0x6')](0x5)[_0x3234('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3234('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ba0b91a..8d72e1f 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 _0x681f=['ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','addBlackLists','push','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','get','UserProfileResource','destroy','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','attributes','fields','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','intersection','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','error','update','getHoppers','findOne','CmHopper','nolimit','order','sort','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','insert','into','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x5e4d20,_0x1a4d7a){var _0x583d44=function(_0x5cac77){while(--_0x5cac77){_0x5e4d20['push'](_0x5e4d20['shift']());}};_0x583d44(++_0x1a4d7a);}(_0x681f,0x11d));var _0xf681=function(_0x2335e6,_0x1bade8){_0x2335e6=_0x2335e6-0x0;var _0x370a50=_0x681f[_0x2335e6];return _0x370a50;};'use strict';var emlformat=require(_0xf681('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf681('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf681('0x2'));var moment=require(_0xf681('0x3'));var BPromise=require(_0xf681('0x4'));var Mustache=require(_0xf681('0x5'));var util=require(_0xf681('0x6'));var path=require(_0xf681('0x7'));var sox=require(_0xf681('0x8'));var csv=require(_0xf681('0x9'));var ejs=require(_0xf681('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf681('0xb'));var crypto=require(_0xf681('0xc'));var jsforce=require(_0xf681('0xd'));var deskjs=require(_0xf681('0xe'));var toCsv=require(_0xf681('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf681('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf681('0x10'));var hardwareService=require(_0xf681('0x11'));var logger=require(_0xf681('0x12'))(_0xf681('0x13'));var utils=require(_0xf681('0x14'));var config=require(_0xf681('0x15'));var licenseUtil=require(_0xf681('0x16'));var db=require(_0xf681('0x17'))['db'];function respondWithStatusCode(_0x5ea3ce,_0x282ada){_0x282ada=_0x282ada||0xcc;return function(_0x45e617){if(_0x45e617){return _0x5ea3ce[_0xf681('0x18')](_0x282ada);}return _0x5ea3ce['status'](_0x282ada)['end']();};}function respondWithResult(_0x4cebe5,_0x47cc39){_0x47cc39=_0x47cc39||0xc8;return function(_0x2f9342){if(_0x2f9342){return _0x4cebe5[_0xf681('0x19')](_0x47cc39)['json'](_0x2f9342);}};}function respondWithFilteredResult(_0x2244f0,_0x539520){return function(_0x406e93){if(_0x406e93){var _0x41f1ac=typeof _0x539520[_0xf681('0x1a')]===_0xf681('0x1b')&&typeof _0x539520[_0xf681('0x1c')]===_0xf681('0x1b');var _0x361858=_0x406e93[_0xf681('0x1d')];var _0x328d58=_0x41f1ac?0x0:_0x539520[_0xf681('0x1a')];var _0x1c356d=_0x41f1ac?_0x406e93[_0xf681('0x1d')]:_0x539520['offset']+_0x539520['limit'];var _0x1e6a2f;if(_0x1c356d>=_0x361858){_0x1c356d=_0x361858;_0x1e6a2f=0xc8;}else{_0x1e6a2f=0xce;}_0x2244f0[_0xf681('0x19')](_0x1e6a2f);return _0x2244f0[_0xf681('0x1e')](_0xf681('0x1f'),_0x328d58+'-'+_0x1c356d+'/'+_0x361858)[_0xf681('0x20')](_0x406e93);}return null;};}function patchUpdates(_0x44930b){return function(_0x18ba2b){try{jsonpatch['apply'](_0x18ba2b,_0x44930b,!![]);}catch(_0x4dd404){return BPromise[_0xf681('0x21')](_0x4dd404);}return _0x18ba2b[_0xf681('0x22')]();};}function saveUpdates(_0xa2044b,_0x181f8f){return function(_0x59ea01){if(_0x59ea01){return _0x59ea01['update'](_0xa2044b)[_0xf681('0x23')](function(_0x578587){return _0x578587;});}return null;};}function removeEntity(_0x5e34b5,_0x57af55){return function(_0x407f52){if(_0x407f52){return _0x407f52['destroy']()[_0xf681('0x23')](function(){var _0x2b1316=_0x407f52[_0xf681('0x24')]({'plain':!![]});var _0x276b1c='IvrCampaigns';return db[_0xf681('0x25')][_0xf681('0x26')]({'where':{'type':_0x276b1c,'resourceId':_0x2b1316['id']}})[_0xf681('0x23')](function(){return _0x407f52;});})[_0xf681('0x23')](function(){_0x5e34b5[_0xf681('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17bc71,_0x4b3b26){return function(_0x5a9327){if(!_0x5a9327){_0x17bc71[_0xf681('0x18')](0x194);}return _0x5a9327;};}function handleError(_0x3f4af8,_0x2e80f6){_0x2e80f6=_0x2e80f6||0x1f4;return function(_0x1d4f57){logger['error'](_0x1d4f57[_0xf681('0x27')]);if(_0x1d4f57['name']){delete _0x1d4f57['name'];}_0x3f4af8[_0xf681('0x19')](_0x2e80f6)[_0xf681('0x28')](_0x1d4f57);};}exports[_0xf681('0x29')]=function(_0x4a7831,_0x12f9e5){var _0x4d82c1={},_0x1b7ce0={},_0x56d46b={'count':0x0,'rows':[]};var _0x22afa2=_[_0xf681('0x2a')](db['Campaign'][_0xf681('0x2b')],function(_0x1a21fa){return{'name':_0x1a21fa['fieldName'],'type':_0x1a21fa[_0xf681('0x2c')][_0xf681('0x2d')]};});_0x1b7ce0[_0xf681('0x2e')]=_[_0xf681('0x2a')](_0x22afa2,_0xf681('0x2f'));_0x1b7ce0[_0xf681('0x30')]=_[_0xf681('0x31')](_0x4a7831[_0xf681('0x30')]);_0x1b7ce0[_0xf681('0x32')]=_['intersection'](_0x1b7ce0[_0xf681('0x2e')],_0x1b7ce0[_0xf681('0x30')]);_0x4d82c1[_0xf681('0x33')]=_['intersection'](_0x1b7ce0[_0xf681('0x2e')],qs[_0xf681('0x34')](_0x4a7831[_0xf681('0x30')][_0xf681('0x34')]));_0x4d82c1['attributes']=_0x4d82c1['attributes']['length']?_0x4d82c1[_0xf681('0x33')]:_0x1b7ce0['model'];if(!_0x4a7831['query'][_0xf681('0x35')]('nolimit')){_0x4d82c1[_0xf681('0x1c')]=qs['limit'](_0x4a7831[_0xf681('0x30')][_0xf681('0x1c')]);_0x4d82c1[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x4a7831[_0xf681('0x30')][_0xf681('0x1a')]);}_0x4d82c1['order']=qs['sort'](_0x4a7831['query']['sort']);_0x4d82c1[_0xf681('0x36')]=qs[_0xf681('0x32')](_[_0xf681('0x37')](_0x4a7831[_0xf681('0x30')],_0x1b7ce0['filters']),_0x22afa2);if(_0x4a7831[_0xf681('0x30')][_0xf681('0x38')]){_0x4d82c1[_0xf681('0x36')]=_[_0xf681('0x39')](_0x4d82c1[_0xf681('0x36')],{'$or':_['map'](_0x22afa2,function(_0xb3e3aa){if(_0xb3e3aa[_0xf681('0x2c')]!==_0xf681('0x3a')){var _0x121a5c={};_0x121a5c[_0xb3e3aa[_0xf681('0x2f')]]={'$like':'%'+_0x4a7831[_0xf681('0x30')][_0xf681('0x38')]+'%'};return _0x121a5c;}})});}_0x4d82c1=_['merge']({},_0x4d82c1,_0x4a7831[_0xf681('0x3b')]);var _0x5e0ecc={'where':_0x4d82c1[_0xf681('0x36')]};return db[_0xf681('0x3c')][_0xf681('0x1d')](_0x5e0ecc)[_0xf681('0x23')](function(_0x6a4110){_0x56d46b['count']=_0x6a4110;if(_0x4a7831[_0xf681('0x30')][_0xf681('0x3d')]){_0x4d82c1[_0xf681('0x3e')]=[{'all':!![]}];}return db[_0xf681('0x3c')][_0xf681('0x3f')](_0x4d82c1);})[_0xf681('0x23')](function(_0x1431bc){_0x56d46b[_0xf681('0x40')]=_0x1431bc;return _0x56d46b;})[_0xf681('0x23')](respondWithFilteredResult(_0x12f9e5,_0x4d82c1))[_0xf681('0x41')](handleError(_0x12f9e5,null));};exports[_0xf681('0x42')]=function(_0x283280,_0x319257){var _0x331e59={'raw':![],'where':{'id':_0x283280['params']['id']}},_0xf425c1={};_0xf425c1[_0xf681('0x2e')]=_['keys'](db[_0xf681('0x3c')][_0xf681('0x2b')]);_0xf425c1['query']=_[_0xf681('0x31')](_0x283280[_0xf681('0x30')]);_0xf425c1['filters']=_['intersection'](_0xf425c1[_0xf681('0x2e')],_0xf425c1[_0xf681('0x30')]);_0x331e59[_0xf681('0x33')]=_[_0xf681('0x43')](_0xf425c1[_0xf681('0x2e')],qs[_0xf681('0x34')](_0x283280[_0xf681('0x30')][_0xf681('0x34')]));_0x331e59[_0xf681('0x33')]=_0x331e59[_0xf681('0x33')][_0xf681('0x44')]?_0x331e59[_0xf681('0x33')]:_0xf425c1[_0xf681('0x2e')];if(_0x283280[_0xf681('0x30')][_0xf681('0x3d')]){_0x331e59[_0xf681('0x3e')]=[{'all':!![]}];}_0x331e59=_['merge']({},_0x331e59,_0x283280['options']);return db[_0xf681('0x3c')][_0xf681('0x45')](_0x331e59)[_0xf681('0x23')](handleEntityNotFound(_0x319257,null))[_0xf681('0x23')](respondWithResult(_0x319257,null))['catch'](handleError(_0x319257,null));};exports['create']=function(_0x3d6628,_0x53a9b9){return db['Campaign']['create'](_0x3d6628[_0xf681('0x46')],{})[_0xf681('0x23')](function(_0x35a724){var _0x1bbe85=_0x3d6628[_0xf681('0x47')][_0xf681('0x24')]({'plain':!![]});if(!_0x1bbe85)throw new Error(_0xf681('0x48'));if(_0x1bbe85[_0xf681('0x49')]===_0xf681('0x47')){var _0x11a146=_0x35a724['get']({'plain':!![]});var _0x128f11='IvrCampaigns';return db[_0xf681('0x4a')][_0xf681('0x45')]({'where':{'name':_0x128f11,'userProfileId':_0x1bbe85[_0xf681('0x4b')]},'raw':!![]})[_0xf681('0x23')](function(_0x4b1beb){if(_0x4b1beb&&_0x4b1beb[_0xf681('0x4c')]===0x0){return db[_0xf681('0x25')][_0xf681('0x4d')]({'name':_0x11a146['name'],'resourceId':_0x11a146['id'],'type':_0x4b1beb[_0xf681('0x2f')],'sectionId':_0x4b1beb['id']},{})[_0xf681('0x23')](function(){return _0x35a724;});}else{return _0x35a724;}})[_0xf681('0x41')](function(_0x3699c3){logger['error'](_0xf681('0x4e'),_0x3699c3);throw _0x3699c3;});}return _0x35a724;})['then'](respondWithResult(_0x53a9b9,0xc9))[_0xf681('0x41')](handleError(_0x53a9b9,null));};exports[_0xf681('0x4f')]=function(_0x56a613,_0x3129e7){var _0x3e59f0={'where':{'id':_0x56a613[_0xf681('0x50')]['id']}},_0x6983d7={};_0x6983d7[_0xf681('0x2e')]=_[_0xf681('0x31')](db[_0xf681('0x3c')][_0xf681('0x2b')]);_0x3e59f0[_0xf681('0x33')]=_[_0xf681('0x43')](_0x6983d7[_0xf681('0x2e')],qs[_0xf681('0x34')](_0x56a613[_0xf681('0x30')][_0xf681('0x34')]));_0x3e59f0['attributes']=_0x3e59f0[_0xf681('0x33')][_0xf681('0x44')]?_0x3e59f0['attributes']:_0x6983d7['model'];if(_0x56a613[_0xf681('0x30')][_0xf681('0x3d')]){_0x3e59f0[_0xf681('0x3e')]=[{'all':!![]}];}_0x3e59f0=_['merge']({},_0x3e59f0,_0x56a613['options']);return db[_0xf681('0x3c')][_0xf681('0x45')](_0x3e59f0)['then'](handleEntityNotFound(_0x3129e7,null))[_0xf681('0x23')](function(_0x375f3f){if(_0x375f3f){var _0x1f1615=_0x375f3f['get']({'plain':!![]});_0x1f1615=qs[_0xf681('0x51')](_0x1f1615,['id',_0xf681('0x52'),_0xf681('0x53')]);_0x56a613[_0xf681('0x46')]=_[_0xf681('0x51')](_0x56a613[_0xf681('0x46')],['id',_0xf681('0x52'),_0xf681('0x53')]);return db['Campaign'][_0xf681('0x4d')](_[_0xf681('0x39')](_0x1f1615,_0x56a613['body']),{'include':_0x56a613[_0xf681('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0xf681('0x23')](function(_0x92547){var _0x3cede1=_0x56a613[_0xf681('0x47')][_0xf681('0x24')]({'plain':!![]});if(!_0x3cede1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cede1['role']===_0xf681('0x47')){var _0x237618=_0x92547['get']({'plain':!![]});var _0x3af096='IvrCampaigns';return db[_0xf681('0x4a')]['find']({'where':{'name':_0x3af096,'userProfileId':_0x3cede1[_0xf681('0x4b')]},'raw':!![]})['then'](function(_0xa79621){if(_0xa79621&&_0xa79621['autoAssociation']===0x0){return db[_0xf681('0x25')][_0xf681('0x4d')]({'name':_0x237618[_0xf681('0x2f')],'resourceId':_0x237618['id'],'type':_0xa79621[_0xf681('0x2f')],'sectionId':_0xa79621['id']},{})[_0xf681('0x23')](function(){return _0x92547;});}else{return _0x92547;}})['catch'](function(_0x30d302){logger[_0xf681('0x54')](_0xf681('0x4e'),_0x30d302);throw _0x30d302;});}return _0x92547;});}})[_0xf681('0x23')](respondWithResult(_0x3129e7,0xc9))[_0xf681('0x41')](handleError(_0x3129e7,null));};exports[_0xf681('0x55')]=function(_0x206bf2,_0x43c239){if(_0x206bf2[_0xf681('0x46')]['id']){delete _0x206bf2['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x206bf2['params']['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x43c239,null))[_0xf681('0x23')](saveUpdates(_0x206bf2[_0xf681('0x46')],null))['then'](respondWithResult(_0x43c239,null))[_0xf681('0x41')](handleError(_0x43c239,null));};exports[_0xf681('0x26')]=function(_0x55cbea,_0xdd7bf2){return db['Campaign'][_0xf681('0x45')]({'where':{'id':_0x55cbea[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0xdd7bf2,null))[_0xf681('0x23')](removeEntity(_0xdd7bf2,null))[_0xf681('0x41')](handleError(_0xdd7bf2,null));};exports[_0xf681('0x56')]=function(_0x481e3b,_0x3e6da7,_0xdf11e9){var _0x38c9e1={'raw':!![],'where':{}};var _0x54fec3={};var _0x42cc6c={'count':0x0,'rows':[]};return db[_0xf681('0x3c')][_0xf681('0x57')]({'where':{'id':_0x481e3b[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x3e6da7,null))[_0xf681('0x23')](function(_0x449197){if(_0x449197){_0x54fec3[_0xf681('0x2e')]=_[_0xf681('0x31')](db[_0xf681('0x58')][_0xf681('0x2b')]);_0x54fec3[_0xf681('0x30')]=_['keys'](_0x481e3b['query']);_0x54fec3['filters']=_['intersection'](_0x54fec3[_0xf681('0x2e')],_0x54fec3[_0xf681('0x30')]);_0x38c9e1[_0xf681('0x33')]=_[_0xf681('0x43')](_0x54fec3['model'],qs[_0xf681('0x34')](_0x481e3b['query'][_0xf681('0x34')]));_0x38c9e1['attributes']=_0x38c9e1[_0xf681('0x33')]['length']?_0x38c9e1['attributes']:_0x54fec3[_0xf681('0x2e')];if(!_0x481e3b[_0xf681('0x30')][_0xf681('0x35')](_0xf681('0x59'))){_0x38c9e1[_0xf681('0x1c')]=qs['limit'](_0x481e3b[_0xf681('0x30')]['limit']);_0x38c9e1[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x481e3b[_0xf681('0x30')][_0xf681('0x1a')]);}_0x38c9e1[_0xf681('0x5a')]=qs[_0xf681('0x5b')](_0x481e3b['query'][_0xf681('0x5b')]);_0x38c9e1['where']=qs[_0xf681('0x32')](_[_0xf681('0x37')](_0x481e3b[_0xf681('0x30')],_0x54fec3[_0xf681('0x32')]));_0x38c9e1['where'][_0xf681('0x5c')]=_0x449197['id'];if(_0x481e3b[_0xf681('0x30')][_0xf681('0x38')]){_0x38c9e1['where']=_[_0xf681('0x39')](_0x38c9e1[_0xf681('0x36')],{'$or':_[_0xf681('0x2a')](_0x38c9e1[_0xf681('0x33')],function(_0x33983b){var _0x3457ae={};_0x3457ae[_0x33983b]={'$like':'%'+_0x481e3b['query']['filter']+'%'};return _0x3457ae;})});}_0x38c9e1=_['merge']({},_0x38c9e1,_0x481e3b['options']);return db['CmHopper'][_0xf681('0x1d')]({'where':_0x38c9e1[_0xf681('0x36')]})['then'](function(_0x52200b){_0x42cc6c[_0xf681('0x1d')]=_0x52200b;if(_0x481e3b[_0xf681('0x30')][_0xf681('0x3d')]){_0x38c9e1[_0xf681('0x3e')]=[{'all':!![]}];}return db[_0xf681('0x58')][_0xf681('0x3f')](_0x38c9e1);})[_0xf681('0x23')](function(_0x16e63f){_0x42cc6c['rows']=_0x16e63f;return _0x42cc6c;});}})[_0xf681('0x23')](respondWithFilteredResult(_0x3e6da7,_0x38c9e1))[_0xf681('0x41')](handleError(_0x3e6da7,null));};exports[_0xf681('0x5d')]=function(_0x3e5e38,_0x51542c,_0x39a75f){var _0x3da40b={'raw':!![],'where':{}};var _0x2df8fd={};var _0x58a613={'count':0x0,'rows':[]};return db[_0xf681('0x3c')][_0xf681('0x57')]({'where':{'id':_0x3e5e38[_0xf681('0x50')]['id']}})['then'](handleEntityNotFound(_0x51542c,null))[_0xf681('0x23')](function(_0x47e087){if(_0x47e087){_0x2df8fd['model']=_[_0xf681('0x31')](db[_0xf681('0x5e')][_0xf681('0x2b')]);_0x2df8fd[_0xf681('0x30')]=_[_0xf681('0x31')](_0x3e5e38[_0xf681('0x30')]);_0x2df8fd['filters']=_['intersection'](_0x2df8fd[_0xf681('0x2e')],_0x2df8fd[_0xf681('0x30')]);_0x3da40b[_0xf681('0x33')]=_[_0xf681('0x43')](_0x2df8fd['model'],qs[_0xf681('0x34')](_0x3e5e38[_0xf681('0x30')][_0xf681('0x34')]));_0x3da40b[_0xf681('0x33')]=_0x3da40b[_0xf681('0x33')]['length']?_0x3da40b[_0xf681('0x33')]:_0x2df8fd[_0xf681('0x2e')];if(!_0x3e5e38[_0xf681('0x30')]['hasOwnProperty'](_0xf681('0x59'))){_0x3da40b[_0xf681('0x1c')]=qs[_0xf681('0x1c')](_0x3e5e38['query']['limit']);_0x3da40b[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x3e5e38['query'][_0xf681('0x1a')]);}_0x3da40b[_0xf681('0x5a')]=qs[_0xf681('0x5b')](_0x3e5e38['query'][_0xf681('0x5b')]);_0x3da40b[_0xf681('0x36')]=qs[_0xf681('0x32')](_[_0xf681('0x37')](_0x3e5e38[_0xf681('0x30')],_0x2df8fd[_0xf681('0x32')]));_0x3da40b['where'][_0xf681('0x5c')]=_0x47e087['id'];if(_0x3e5e38[_0xf681('0x30')]['filter']){_0x3da40b[_0xf681('0x36')]=_['merge'](_0x3da40b['where'],{'$or':_['map'](_0x3da40b[_0xf681('0x33')],function(_0x1c2e59){var _0x2304a0={};_0x2304a0[_0x1c2e59]={'$like':'%'+_0x3e5e38[_0xf681('0x30')][_0xf681('0x38')]+'%'};return _0x2304a0;})});}_0x3da40b=_[_0xf681('0x39')]({},_0x3da40b,_0x3e5e38[_0xf681('0x3b')]);return db['CmHopperHistory'][_0xf681('0x1d')]({'where':_0x3da40b[_0xf681('0x36')]})[_0xf681('0x23')](function(_0x4e9638){_0x58a613[_0xf681('0x1d')]=_0x4e9638;if(_0x3e5e38[_0xf681('0x30')]['includeAll']){_0x3da40b[_0xf681('0x3e')]=[{'all':!![]}];}return db[_0xf681('0x5e')][_0xf681('0x3f')](_0x3da40b);})[_0xf681('0x23')](function(_0x298b2c){_0x58a613[_0xf681('0x40')]=_0x298b2c;return _0x58a613;});}})[_0xf681('0x23')](respondWithFilteredResult(_0x51542c,_0x3da40b))[_0xf681('0x41')](handleError(_0x51542c,null));};exports[_0xf681('0x5f')]=function(_0x3fcafb,_0x119437,_0x1f7105){var _0xde3039={'raw':!![],'where':{}};var _0x2658cf={};var _0x4f36d9={'count':0x0,'rows':[]};return db[_0xf681('0x3c')][_0xf681('0x57')]({'where':{'id':_0x3fcafb['params']['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x119437,null))[_0xf681('0x23')](function(_0x3e1c12){if(_0x3e1c12){_0x2658cf[_0xf681('0x2e')]=_[_0xf681('0x31')](db[_0xf681('0x60')]['rawAttributes']);_0x2658cf['query']=_[_0xf681('0x31')](_0x3fcafb[_0xf681('0x30')]);_0x2658cf[_0xf681('0x32')]=_[_0xf681('0x43')](_0x2658cf[_0xf681('0x2e')],_0x2658cf['query']);_0xde3039[_0xf681('0x33')]=_[_0xf681('0x43')](_0x2658cf['model'],qs['fields'](_0x3fcafb[_0xf681('0x30')][_0xf681('0x34')]));_0xde3039[_0xf681('0x33')]=_0xde3039['attributes'][_0xf681('0x44')]?_0xde3039['attributes']:_0x2658cf[_0xf681('0x2e')];if(!_0x3fcafb['query']['hasOwnProperty'](_0xf681('0x59'))){_0xde3039[_0xf681('0x1c')]=qs['limit'](_0x3fcafb[_0xf681('0x30')]['limit']);_0xde3039[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x3fcafb['query']['offset']);}_0xde3039['order']=qs[_0xf681('0x5b')](_0x3fcafb[_0xf681('0x30')]['sort']);_0xde3039[_0xf681('0x36')]=qs['filters'](_[_0xf681('0x37')](_0x3fcafb[_0xf681('0x30')],_0x2658cf[_0xf681('0x32')]));_0xde3039[_0xf681('0x36')][_0xf681('0x5c')]=_0x3e1c12['id'];if(_0x3fcafb[_0xf681('0x30')][_0xf681('0x38')]){_0xde3039[_0xf681('0x36')]=_[_0xf681('0x39')](_0xde3039[_0xf681('0x36')],{'$or':_[_0xf681('0x2a')](_0xde3039[_0xf681('0x33')],function(_0x35f55e){var _0x463e4a={};_0x463e4a[_0x35f55e]={'$like':'%'+_0x3fcafb[_0xf681('0x30')][_0xf681('0x38')]+'%'};return _0x463e4a;})});}_0xde3039=_[_0xf681('0x39')]({},_0xde3039,_0x3fcafb[_0xf681('0x3b')]);return db['CmHopperFinal'][_0xf681('0x1d')]({'where':_0xde3039[_0xf681('0x36')]})[_0xf681('0x23')](function(_0x4f0299){_0x4f36d9[_0xf681('0x1d')]=_0x4f0299;if(_0x3fcafb[_0xf681('0x30')][_0xf681('0x3d')]){_0xde3039[_0xf681('0x3e')]=[{'all':!![]}];}return db[_0xf681('0x60')][_0xf681('0x3f')](_0xde3039);})['then'](function(_0xf3f066){_0x4f36d9['rows']=_0xf3f066;return _0x4f36d9;});}})[_0xf681('0x23')](respondWithFilteredResult(_0x119437,_0xde3039))[_0xf681('0x41')](handleError(_0x119437,null));};exports['getHopperBlacks']=function(_0x30f16f,_0x262f17,_0xf1a03b){var _0x12090d={'raw':!![],'where':{}};var _0x42ed47={};var _0x13e0c2={'count':0x0,'rows':[]};return db[_0xf681('0x3c')][_0xf681('0x57')]({'where':{'id':_0x30f16f[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x262f17,null))[_0xf681('0x23')](function(_0x363e13){if(_0x363e13){_0x42ed47[_0xf681('0x2e')]=_[_0xf681('0x31')](db[_0xf681('0x61')]['rawAttributes']);_0x42ed47[_0xf681('0x30')]=_[_0xf681('0x31')](_0x30f16f[_0xf681('0x30')]);_0x42ed47[_0xf681('0x32')]=_['intersection'](_0x42ed47[_0xf681('0x2e')],_0x42ed47[_0xf681('0x30')]);_0x12090d['attributes']=_[_0xf681('0x43')](_0x42ed47[_0xf681('0x2e')],qs['fields'](_0x30f16f[_0xf681('0x30')][_0xf681('0x34')]));_0x12090d[_0xf681('0x33')]=_0x12090d[_0xf681('0x33')][_0xf681('0x44')]?_0x12090d[_0xf681('0x33')]:_0x42ed47[_0xf681('0x2e')];if(!_0x30f16f['query']['hasOwnProperty'](_0xf681('0x59'))){_0x12090d[_0xf681('0x1c')]=qs[_0xf681('0x1c')](_0x30f16f['query'][_0xf681('0x1c')]);_0x12090d[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x30f16f[_0xf681('0x30')]['offset']);}_0x12090d['order']=qs[_0xf681('0x5b')](_0x30f16f[_0xf681('0x30')][_0xf681('0x5b')]);_0x12090d[_0xf681('0x36')]=qs[_0xf681('0x32')](_[_0xf681('0x37')](_0x30f16f['query'],_0x42ed47[_0xf681('0x32')]));_0x12090d[_0xf681('0x36')]['CampaignId']=_0x363e13['id'];if(_0x30f16f['query']['filter']){_0x12090d['where']=_[_0xf681('0x39')](_0x12090d[_0xf681('0x36')],{'$or':_[_0xf681('0x2a')](_0x12090d[_0xf681('0x33')],function(_0x2458c5){var _0x1f1771={};_0x1f1771[_0x2458c5]={'$like':'%'+_0x30f16f[_0xf681('0x30')][_0xf681('0x38')]+'%'};return _0x1f1771;})});}_0x12090d=_[_0xf681('0x39')]({},_0x12090d,_0x30f16f[_0xf681('0x3b')]);return db[_0xf681('0x61')][_0xf681('0x1d')]({'where':_0x12090d[_0xf681('0x36')]})['then'](function(_0xb9a2d1){_0x13e0c2['count']=_0xb9a2d1;if(_0x30f16f['query']['includeAll']){_0x12090d[_0xf681('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf681('0x3f')](_0x12090d);})[_0xf681('0x23')](function(_0x164be){_0x13e0c2[_0xf681('0x40')]=_0x164be;return _0x13e0c2;});}})['then'](respondWithFilteredResult(_0x262f17,_0x12090d))[_0xf681('0x41')](handleError(_0x262f17,null));};exports['getLists']=function(_0x323545,_0x4f9e2a,_0x1939f5){var _0x5860cb={};var _0x5f4044={};var _0x2fb63a;var _0xce3eb4;return db[_0xf681('0x3c')][_0xf681('0x57')]({'where':{'id':_0x323545[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x4f9e2a,null))[_0xf681('0x23')](function(_0x109601){if(_0x109601){_0x2fb63a=_0x109601;_0x5f4044[_0xf681('0x2e')]=_[_0xf681('0x31')](db['CmList'][_0xf681('0x2b')]);_0x5f4044[_0xf681('0x30')]=_[_0xf681('0x31')](_0x323545[_0xf681('0x30')]);_0x5f4044[_0xf681('0x32')]=_['intersection'](_0x5f4044[_0xf681('0x2e')],_0x5f4044[_0xf681('0x30')]);_0x5860cb[_0xf681('0x33')]=_['intersection'](_0x5f4044[_0xf681('0x2e')],qs[_0xf681('0x34')](_0x323545[_0xf681('0x30')][_0xf681('0x34')]));_0x5860cb[_0xf681('0x33')]=_0x5860cb[_0xf681('0x33')]['length']?_0x5860cb[_0xf681('0x33')]:_0x5f4044[_0xf681('0x2e')];_0x5860cb[_0xf681('0x5a')]=qs[_0xf681('0x5b')](_0x323545['query'][_0xf681('0x5b')]);_0x5860cb[_0xf681('0x36')]=qs[_0xf681('0x32')](_[_0xf681('0x37')](_0x323545[_0xf681('0x30')],_0x5f4044[_0xf681('0x32')]));if(_0x323545[_0xf681('0x30')][_0xf681('0x38')]){_0x5860cb['where']=_[_0xf681('0x39')](_0x5860cb['where'],{'$or':_[_0xf681('0x2a')](_0x5860cb[_0xf681('0x33')],function(_0xd76ff8){var _0xe729fe={};_0xe729fe[_0xd76ff8]={'$like':'%'+_0x323545[_0xf681('0x30')][_0xf681('0x38')]+'%'};return _0xe729fe;})});}_0x5860cb=_[_0xf681('0x39')]({},_0x5860cb,_0x323545['options']);return _0x2fb63a['getLists'](_0x5860cb);}})['then'](function(_0x2ce75a){if(_0x2ce75a){_0xce3eb4=_0x2ce75a[_0xf681('0x44')];if(!_0x323545['query'][_0xf681('0x35')](_0xf681('0x59'))){_0x5860cb[_0xf681('0x1c')]=qs['limit'](_0x323545['query'][_0xf681('0x1c')]);_0x5860cb[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x323545[_0xf681('0x30')]['offset']);}return _0x2fb63a[_0xf681('0x62')](_0x5860cb);}})[_0xf681('0x23')](function(_0x5f105e){if(_0x5f105e){return _0x5f105e?{'count':_0xce3eb4,'rows':_0x5f105e}:null;}})['then'](respondWithResult(_0x4f9e2a,null))[_0xf681('0x41')](handleError(_0x4f9e2a,null));};exports[_0xf681('0x63')]=function(_0xd4b629,_0x50d6df,_0x2549f0){var _0x424468,_0x6e68e6;return db[_0xf681('0x3c')][_0xf681('0x45')]({'where':{'id':_0xd4b629[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x50d6df,null))[_0xf681('0x23')](function(_0x3d5251){if(_0x3d5251){_0x6e68e6=_0x3d5251;return _0x3d5251[_0xf681('0x63')](_0xd4b629['body'][_0xf681('0x64')],_[_0xf681('0x51')](_0xd4b629[_0xf681('0x46')],[_0xf681('0x64'),'id'])||{});}return null;})[_0xf681('0x65')](function(_0x57704e){var _0x5b33e2;_0x424468=_0x57704e||[];var _0x49fee8=[];if(_0x57704e){for(var _0xa7ca28=0x0;_0xa7ca28<_0x57704e[_0xf681('0x44')];_0xa7ca28+=0x1){var _0x67875f=_0x57704e[_0xa7ca28]['get']({'plain':!![]});_0x6e68e6['dialCheckDuplicateType']=_0xd4b629[_0xf681('0x46')]['dialCheckDuplicateType']?_0xd4b629[_0xf681('0x46')]['dialCheckDuplicateType']:_0x6e68e6['dialCheckDuplicateType'];switch(_0x6e68e6['dialCheckDuplicateType']){case'always':_0x5b33e2=squel[_0xf681('0x66')]()[_0xf681('0x67')](_0xf681('0x68'))[_0xf681('0x69')]([_0xf681('0x6a'),_0xf681('0x6b'),_0xf681('0x6c'),_0xf681('0x6d'),_0xf681('0x5c'),_0xf681('0x52'),'updatedAt'],squel[_0xf681('0x6e')]()['field'](_0xf681('0x6a'),_0xf681('0x6a'))[_0xf681('0x6f')]('NOW()',_0xf681('0x6b'))[_0xf681('0x6f')]('id',_0xf681('0x6c'))[_0xf681('0x6f')](_0x67875f[_0xf681('0x70')][_0xf681('0x71')](),'ListId')[_0xf681('0x6f')](_0xd4b629[_0xf681('0x50')]['id'][_0xf681('0x71')](),_0xf681('0x5c'))[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x52'))[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x53'))[_0xf681('0x73')](_0xf681('0x74'))['where'](_0xf681('0x75'))['where'](_0xf681('0x76'),_0x67875f['CmListId'][_0xf681('0x71')]())[_0xf681('0x36')](_0xf681('0x77'))[_0xf681('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf681('0x6e')]()['field'](_0xf681('0x78'))[_0xf681('0x73')](_0xf681('0x79'))[_0xf681('0x36')](_0xf681('0x7a'),_0xd4b629[_0xf681('0x50')]['id'][_0xf681('0x71')]()))[_0xf681('0x36')](_0xf681('0x7b'),squel[_0xf681('0x6e')]()[_0xf681('0x6f')](_0xf681('0x7c'))[_0xf681('0x73')](_0xf681('0x68'))[_0xf681('0x36')](_0xf681('0x7a'),_0xd4b629[_0xf681('0x50')]['id']['toString']())))[_0xf681('0x71')]();break;case'onlyIfOpen':_0x5b33e2=squel[_0xf681('0x66')]()[_0xf681('0x67')](_0xf681('0x68'))[_0xf681('0x69')]([_0xf681('0x6a'),_0xf681('0x6b'),_0xf681('0x6c'),'ListId',_0xf681('0x5c'),_0xf681('0x52'),'updatedAt'],squel['select']()[_0xf681('0x6f')](_0xf681('0x6a'),_0xf681('0x6a'))[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x6b'))[_0xf681('0x6f')]('id',_0xf681('0x6c'))['field'](_0x67875f['CmListId'][_0xf681('0x71')](),_0xf681('0x6d'))['field'](_0xd4b629[_0xf681('0x50')]['id'][_0xf681('0x71')](),'CampaignId')[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x52'))[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x53'))[_0xf681('0x73')](_0xf681('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0xf681('0x36')](_0xf681('0x76'),_0x67875f[_0xf681('0x70')][_0xf681('0x71')]())['where'](_0xf681('0x77'))['where'](_0xf681('0x7b'),squel[_0xf681('0x6e')]()[_0xf681('0x6f')](_0xf681('0x7c'))[_0xf681('0x73')]('cm_hopper')['where'](_0xf681('0x7a'),_0xd4b629[_0xf681('0x50')]['id'][_0xf681('0x71')]())))[_0xf681('0x71')]();break;default:_0x5b33e2=squel[_0xf681('0x66')]()[_0xf681('0x67')](_0xf681('0x68'))['fromQuery']([_0xf681('0x6a'),_0xf681('0x6b'),_0xf681('0x6c'),_0xf681('0x6d'),_0xf681('0x5c'),_0xf681('0x52'),_0xf681('0x53')],squel[_0xf681('0x6e')]()['field']('phone',_0xf681('0x6a'))[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x6b'))['field']('id',_0xf681('0x6c'))['field'](_0x67875f['CmListId'][_0xf681('0x71')](),_0xf681('0x6d'))[_0xf681('0x6f')](_0xd4b629['params']['id'][_0xf681('0x71')](),'CampaignId')[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x52'))[_0xf681('0x6f')]('NOW()',_0xf681('0x53'))['from'](_0xf681('0x74'))[_0xf681('0x36')](_0xf681('0x75'))[_0xf681('0x36')]('ListId\x20=\x20?',_0x67875f[_0xf681('0x70')][_0xf681('0x71')]())[_0xf681('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xf681('0x71')]();}_0x49fee8['push'](db[_0xf681('0x7d')][_0xf681('0x30')](_0x5b33e2));}return BPromise[_0xf681('0x7e')](_0x49fee8);}})[_0xf681('0x23')](function(){return _0x424468;})['then'](respondWithResult(_0x50d6df,null))[_0xf681('0x41')](handleError(_0x50d6df,null));};exports[_0xf681('0x7f')]=function(_0x3309ff,_0x118a02,_0xc866c8){return db[_0xf681('0x3c')]['find']({'where':{'id':_0x3309ff[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x118a02,null))[_0xf681('0x23')](function(_0x135552){if(_0x135552){return _0x135552[_0xf681('0x7f')](_0x3309ff[_0xf681('0x30')][_0xf681('0x64')]);}})[_0xf681('0x23')](function(_0x5a6193){if(_0x5a6193){return db[_0xf681('0x58')][_0xf681('0x26')]({'where':{'ListId':_0x3309ff['query']['ids'],'CampaignId':_0x3309ff[_0xf681('0x50')]['id']}})[_0xf681('0x23')](function(){return _0x5a6193;});}})['then'](respondWithStatusCode(_0x118a02,null))['catch'](handleError(_0x118a02,null));};exports[_0xf681('0x80')]=function(_0x284aea,_0xa08416,_0x514948){var _0x1d2cf0={};var _0x3f0baf={};var _0x35d718;var _0xd59b77;return db['Campaign'][_0xf681('0x57')]({'where':{'id':_0x284aea[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0xa08416,null))[_0xf681('0x23')](function(_0x2a0fe6){if(_0x2a0fe6){_0x35d718=_0x2a0fe6;_0x3f0baf[_0xf681('0x2e')]=_[_0xf681('0x31')](db['CmList'][_0xf681('0x2b')]);_0x3f0baf[_0xf681('0x30')]=_['keys'](_0x284aea['query']);_0x3f0baf['filters']=_[_0xf681('0x43')](_0x3f0baf[_0xf681('0x2e')],_0x3f0baf[_0xf681('0x30')]);_0x1d2cf0['attributes']=_[_0xf681('0x43')](_0x3f0baf[_0xf681('0x2e')],qs[_0xf681('0x34')](_0x284aea[_0xf681('0x30')]['fields']));_0x1d2cf0[_0xf681('0x33')]=_0x1d2cf0[_0xf681('0x33')]['length']?_0x1d2cf0['attributes']:_0x3f0baf[_0xf681('0x2e')];_0x1d2cf0[_0xf681('0x5a')]=qs[_0xf681('0x5b')](_0x284aea[_0xf681('0x30')][_0xf681('0x5b')]);_0x1d2cf0['where']=qs[_0xf681('0x32')](_[_0xf681('0x37')](_0x284aea[_0xf681('0x30')],_0x3f0baf[_0xf681('0x32')]));if(_0x284aea[_0xf681('0x30')]['filter']){_0x1d2cf0[_0xf681('0x36')]=_[_0xf681('0x39')](_0x1d2cf0[_0xf681('0x36')],{'$or':_['map'](_0x1d2cf0['attributes'],function(_0x5492ee){var _0x83fc6e={};_0x83fc6e[_0x5492ee]={'$like':'%'+_0x284aea[_0xf681('0x30')][_0xf681('0x38')]+'%'};return _0x83fc6e;})});}_0x1d2cf0=_['merge']({},_0x1d2cf0,_0x284aea[_0xf681('0x3b')]);return _0x35d718[_0xf681('0x80')](_0x1d2cf0);}})['then'](function(_0x3ed825){if(_0x3ed825){_0xd59b77=_0x3ed825[_0xf681('0x44')];if(!_0x284aea['query'][_0xf681('0x35')](_0xf681('0x59'))){_0x1d2cf0[_0xf681('0x1c')]=qs[_0xf681('0x1c')](_0x284aea[_0xf681('0x30')][_0xf681('0x1c')]);_0x1d2cf0[_0xf681('0x1a')]=qs['offset'](_0x284aea[_0xf681('0x30')][_0xf681('0x1a')]);}return _0x35d718[_0xf681('0x80')](_0x1d2cf0);}})['then'](function(_0x3d40d1){if(_0x3d40d1){return _0x3d40d1?{'count':_0xd59b77,'rows':_0x3d40d1}:null;}})[_0xf681('0x23')](respondWithResult(_0xa08416,null))['catch'](handleError(_0xa08416,null));};exports[_0xf681('0x81')]=function(_0x272551,_0x13964b,_0x4a3082){var _0x21c0d5,_0x3fcbac;return db[_0xf681('0x3c')][_0xf681('0x45')]({'where':{'id':_0x272551[_0xf681('0x50')]['id']}})[_0xf681('0x23')](handleEntityNotFound(_0x13964b,null))['then'](function(_0x986c8c){if(_0x986c8c){_0x3fcbac=_0x986c8c;return _0x986c8c[_0xf681('0x81')](_0x272551['body'][_0xf681('0x64')],_[_0xf681('0x51')](_0x272551[_0xf681('0x46')],['ids','id'])||{});}return null;})['spread'](function(_0xfd9f10){var _0x1ac0a8;_0x21c0d5=_0xfd9f10||[];var _0x14a257=[];if(_0xfd9f10){for(var _0x3a3b0b=0x0;_0x3a3b0b<_0xfd9f10[_0xf681('0x44')];_0x3a3b0b+=0x1){var _0x5cc90c=_0xfd9f10[_0x3a3b0b][_0xf681('0x24')]({'plain':!![]});_0x1ac0a8=squel[_0xf681('0x66')]()[_0xf681('0x67')]('cm_hopper_black')[_0xf681('0x69')]([_0xf681('0x6a'),_0xf681('0x6c'),_0xf681('0x6d'),_0xf681('0x5c'),_0xf681('0x52'),_0xf681('0x53')],squel[_0xf681('0x6e')]()['field'](_0xf681('0x6a'),'phone')[_0xf681('0x6f')]('id',_0xf681('0x6c'))[_0xf681('0x6f')](_0x5cc90c[_0xf681('0x70')][_0xf681('0x71')](),_0xf681('0x6d'))[_0xf681('0x6f')](_0x272551[_0xf681('0x50')]['id'][_0xf681('0x71')](),_0xf681('0x5c'))[_0xf681('0x6f')](_0xf681('0x72'),'createdAt')[_0xf681('0x6f')](_0xf681('0x72'),_0xf681('0x53'))[_0xf681('0x73')](_0xf681('0x74'))[_0xf681('0x36')]('deletedAt\x20IS\x20NULL')[_0xf681('0x36')](_0xf681('0x76'),_0x5cc90c[_0xf681('0x70')][_0xf681('0x71')]())[_0xf681('0x36')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x14a257[_0xf681('0x82')](db[_0xf681('0x7d')][_0xf681('0x30')](_0x1ac0a8));}return BPromise[_0xf681('0x7e')](_0x14a257);}})['then'](function(){return _0x21c0d5;})[_0xf681('0x23')](respondWithResult(_0x13964b,null))['catch'](handleError(_0x13964b,null));};exports['removeBlackLists']=function(_0x2b8e29,_0x8aec40,_0xd4d3d6){return db[_0xf681('0x3c')][_0xf681('0x45')]({'where':{'id':_0x2b8e29[_0xf681('0x50')]['id']}})['then'](handleEntityNotFound(_0x8aec40,null))[_0xf681('0x23')](function(_0x148a9f){if(_0x148a9f){return _0x148a9f['removeBlackLists'](_0x2b8e29[_0xf681('0x30')][_0xf681('0x64')]);}})[_0xf681('0x23')](function(_0x24c60b){if(_0x24c60b){return db[_0xf681('0x61')][_0xf681('0x26')]({'where':{'ListId':_0x2b8e29[_0xf681('0x30')]['ids'],'CampaignId':_0x2b8e29['params']['id']}})[_0xf681('0x23')](function(){return _0x24c60b;});}})[_0xf681('0x23')](respondWithStatusCode(_0x8aec40,null))['catch'](handleError(_0x8aec40,null));}; \ No newline at end of file +var _0xb208=['reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','Campaign','findAll','rows','catch','show','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','role','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','into','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_hopper','deletedAt\x20IS\x20NULL','push','sequelize','removeLists','addBlackLists','cm_hopper_black','all','removeBlackLists','rimraf','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/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x241e3b,_0x1271e8){var _0x25d44c=function(_0x448ed5){while(--_0x448ed5){_0x241e3b['push'](_0x241e3b['shift']());}};_0x25d44c(++_0x1271e8);}(_0xb208,0x68));var _0x8b20=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb208[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b20('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b20('0x1'));var rp=require('request-promise');var moment=require(_0x8b20('0x2'));var BPromise=require(_0x8b20('0x3'));var Mustache=require(_0x8b20('0x4'));var util=require(_0x8b20('0x5'));var path=require(_0x8b20('0x6'));var sox=require(_0x8b20('0x7'));var csv=require(_0x8b20('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b20('0x9'));var _=require(_0x8b20('0xa'));var squel=require(_0x8b20('0xb'));var crypto=require(_0x8b20('0xc'));var jsforce=require(_0x8b20('0xd'));var deskjs=require(_0x8b20('0xe'));var toCsv=require(_0x8b20('0x8'));var querystring=require(_0x8b20('0xf'));var Papa=require(_0x8b20('0x10'));var Redis=require(_0x8b20('0x11'));var authService=require(_0x8b20('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b20('0x13'));var logger=require(_0x8b20('0x14'))(_0x8b20('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b20('0x16'));var db=require(_0x8b20('0x17'))['db'];function respondWithStatusCode(_0x3a7d91,_0x3c601e){_0x3c601e=_0x3c601e||0xcc;return function(_0x103f68){if(_0x103f68){return _0x3a7d91['sendStatus'](_0x3c601e);}return _0x3a7d91[_0x8b20('0x18')](_0x3c601e)['end']();};}function respondWithResult(_0x39917d,_0xfd7644){_0xfd7644=_0xfd7644||0xc8;return function(_0x29bb46){if(_0x29bb46){return _0x39917d[_0x8b20('0x18')](_0xfd7644)[_0x8b20('0x19')](_0x29bb46);}};}function respondWithFilteredResult(_0xffc459,_0x51093e){return function(_0x798ea3){if(_0x798ea3){var _0x2e69f9=typeof _0x51093e[_0x8b20('0x1a')]===_0x8b20('0x1b')&&typeof _0x51093e[_0x8b20('0x1c')]==='undefined';var _0x35d57a=_0x798ea3[_0x8b20('0x1d')];var _0x146627=_0x2e69f9?0x0:_0x51093e[_0x8b20('0x1a')];var _0x1dd675=_0x2e69f9?_0x798ea3['count']:_0x51093e['offset']+_0x51093e[_0x8b20('0x1c')];var _0x1ed24a;if(_0x1dd675>=_0x35d57a){_0x1dd675=_0x35d57a;_0x1ed24a=0xc8;}else{_0x1ed24a=0xce;}_0xffc459['status'](_0x1ed24a);return _0xffc459[_0x8b20('0x1e')](_0x8b20('0x1f'),_0x146627+'-'+_0x1dd675+'/'+_0x35d57a)[_0x8b20('0x19')](_0x798ea3);}return null;};}function patchUpdates(_0x165b5a){return function(_0x333dd8){try{jsonpatch['apply'](_0x333dd8,_0x165b5a,!![]);}catch(_0x44c740){return BPromise[_0x8b20('0x20')](_0x44c740);}return _0x333dd8[_0x8b20('0x21')]();};}function saveUpdates(_0x3375a0,_0x3d82a2){return function(_0x45dffe){if(_0x45dffe){return _0x45dffe[_0x8b20('0x22')](_0x3375a0)[_0x8b20('0x23')](function(_0x248392){return _0x248392;});}return null;};}function removeEntity(_0x43259a,_0xc7f0fa){return function(_0x43009f){if(_0x43009f){return _0x43009f[_0x8b20('0x24')]()['then'](function(){var _0x16f08a=_0x43009f[_0x8b20('0x25')]({'plain':!![]});var _0x281a75=_0x8b20('0x26');return db[_0x8b20('0x27')][_0x8b20('0x24')]({'where':{'type':_0x281a75,'resourceId':_0x16f08a['id']}})[_0x8b20('0x23')](function(){return _0x43009f;});})[_0x8b20('0x23')](function(){_0x43259a[_0x8b20('0x18')](0xcc)[_0x8b20('0x28')]();});}};}function handleEntityNotFound(_0x1761d7,_0x5ec100){return function(_0x2a6c47){if(!_0x2a6c47){_0x1761d7[_0x8b20('0x29')](0x194);}return _0x2a6c47;};}function handleError(_0x424188,_0xaec7a5){_0xaec7a5=_0xaec7a5||0x1f4;return function(_0x5cfa64){logger[_0x8b20('0x2a')](_0x5cfa64[_0x8b20('0x2b')]);if(_0x5cfa64[_0x8b20('0x2c')]){delete _0x5cfa64[_0x8b20('0x2c')];}_0x424188[_0x8b20('0x18')](_0xaec7a5)['send'](_0x5cfa64);};}exports[_0x8b20('0x2d')]=function(_0x2be7d3,_0x33f0b1){var _0x380132={},_0x2a95b8={},_0x18f176={'count':0x0,'rows':[]};var _0x36aacf=_['map'](db['Campaign'][_0x8b20('0x2e')],function(_0x141506){return{'name':_0x141506['fieldName'],'type':_0x141506[_0x8b20('0x2f')][_0x8b20('0x30')]};});_0x2a95b8[_0x8b20('0x31')]=_[_0x8b20('0x32')](_0x36aacf,_0x8b20('0x2c'));_0x2a95b8[_0x8b20('0x33')]=_[_0x8b20('0x34')](_0x2be7d3[_0x8b20('0x33')]);_0x2a95b8['filters']=_[_0x8b20('0x35')](_0x2a95b8[_0x8b20('0x31')],_0x2a95b8['query']);_0x380132['attributes']=_['intersection'](_0x2a95b8[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0x2be7d3[_0x8b20('0x33')][_0x8b20('0x36')]));_0x380132[_0x8b20('0x37')]=_0x380132[_0x8b20('0x37')][_0x8b20('0x38')]?_0x380132[_0x8b20('0x37')]:_0x2a95b8[_0x8b20('0x31')];if(!_0x2be7d3[_0x8b20('0x33')][_0x8b20('0x39')](_0x8b20('0x3a'))){_0x380132['limit']=qs[_0x8b20('0x1c')](_0x2be7d3['query'][_0x8b20('0x1c')]);_0x380132['offset']=qs['offset'](_0x2be7d3['query'][_0x8b20('0x1a')]);}_0x380132[_0x8b20('0x3b')]=qs[_0x8b20('0x3c')](_0x2be7d3['query'][_0x8b20('0x3c')]);_0x380132[_0x8b20('0x3d')]=qs[_0x8b20('0x3e')](_[_0x8b20('0x3f')](_0x2be7d3[_0x8b20('0x33')],_0x2a95b8[_0x8b20('0x3e')]),_0x36aacf);if(_0x2be7d3['query']['filter']){_0x380132[_0x8b20('0x3d')]=_[_0x8b20('0x40')](_0x380132[_0x8b20('0x3d')],{'$or':_['map'](_0x36aacf,function(_0x4cec3f){if(_0x4cec3f[_0x8b20('0x2f')]!==_0x8b20('0x41')){var _0x5ceeaa={};_0x5ceeaa[_0x4cec3f[_0x8b20('0x2c')]]={'$like':'%'+_0x2be7d3[_0x8b20('0x33')][_0x8b20('0x42')]+'%'};return _0x5ceeaa;}})});}_0x380132=_[_0x8b20('0x40')]({},_0x380132,_0x2be7d3[_0x8b20('0x43')]);var _0x326913={'where':_0x380132[_0x8b20('0x3d')]};return db['Campaign']['count'](_0x326913)['then'](function(_0x8e42f9){_0x18f176[_0x8b20('0x1d')]=_0x8e42f9;if(_0x2be7d3['query'][_0x8b20('0x44')]){_0x380132[_0x8b20('0x45')]=[{'all':!![]}];}return db[_0x8b20('0x46')][_0x8b20('0x47')](_0x380132);})['then'](function(_0x715a2e){_0x18f176[_0x8b20('0x48')]=_0x715a2e;return _0x18f176;})[_0x8b20('0x23')](respondWithFilteredResult(_0x33f0b1,_0x380132))[_0x8b20('0x49')](handleError(_0x33f0b1,null));};exports[_0x8b20('0x4a')]=function(_0xcfffbc,_0x182db4){var _0x2292de={'raw':![],'where':{'id':_0xcfffbc['params']['id']}},_0x4db01e={};_0x4db01e[_0x8b20('0x31')]=_[_0x8b20('0x34')](db[_0x8b20('0x46')][_0x8b20('0x2e')]);_0x4db01e[_0x8b20('0x33')]=_[_0x8b20('0x34')](_0xcfffbc[_0x8b20('0x33')]);_0x4db01e[_0x8b20('0x3e')]=_['intersection'](_0x4db01e[_0x8b20('0x31')],_0x4db01e[_0x8b20('0x33')]);_0x2292de['attributes']=_['intersection'](_0x4db01e[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0xcfffbc['query'][_0x8b20('0x36')]));_0x2292de[_0x8b20('0x37')]=_0x2292de[_0x8b20('0x37')]['length']?_0x2292de[_0x8b20('0x37')]:_0x4db01e[_0x8b20('0x31')];if(_0xcfffbc[_0x8b20('0x33')][_0x8b20('0x44')]){_0x2292de[_0x8b20('0x45')]=[{'all':!![]}];}_0x2292de=_['merge']({},_0x2292de,_0xcfffbc[_0x8b20('0x43')]);return db[_0x8b20('0x46')][_0x8b20('0x4b')](_0x2292de)['then'](handleEntityNotFound(_0x182db4,null))[_0x8b20('0x23')](respondWithResult(_0x182db4,null))[_0x8b20('0x49')](handleError(_0x182db4,null));};exports['create']=function(_0x51564b,_0x2bbb66){return db['Campaign']['create'](_0x51564b['body'],{})[_0x8b20('0x23')](function(_0x5262d0){var _0x4b3919=_0x51564b['user'][_0x8b20('0x25')]({'plain':!![]});if(!_0x4b3919)throw new Error(_0x8b20('0x4c'));if(_0x4b3919['role']===_0x8b20('0x4d')){var _0xe71e97=_0x5262d0[_0x8b20('0x25')]({'plain':!![]});var _0x4967e6='IvrCampaigns';return db[_0x8b20('0x4e')]['find']({'where':{'name':_0x4967e6,'userProfileId':_0x4b3919[_0x8b20('0x4f')]},'raw':!![]})[_0x8b20('0x23')](function(_0x29f79e){if(_0x29f79e&&_0x29f79e[_0x8b20('0x50')]===0x0){return db[_0x8b20('0x27')][_0x8b20('0x51')]({'name':_0xe71e97[_0x8b20('0x2c')],'resourceId':_0xe71e97['id'],'type':_0x29f79e[_0x8b20('0x2c')],'sectionId':_0x29f79e['id']},{})[_0x8b20('0x23')](function(){return _0x5262d0;});}else{return _0x5262d0;}})[_0x8b20('0x49')](function(_0x52517e){logger[_0x8b20('0x2a')](_0x8b20('0x52'),_0x52517e);throw _0x52517e;});}return _0x5262d0;})[_0x8b20('0x23')](respondWithResult(_0x2bbb66,0xc9))['catch'](handleError(_0x2bbb66,null));};exports[_0x8b20('0x53')]=function(_0x18f56e,_0x237baf){var _0x58ac5e={'where':{'id':_0x18f56e[_0x8b20('0x54')]['id']}},_0x4d2838={};_0x4d2838['model']=_['keys'](db['Campaign'][_0x8b20('0x2e')]);_0x58ac5e[_0x8b20('0x37')]=_[_0x8b20('0x35')](_0x4d2838[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0x18f56e[_0x8b20('0x33')]['fields']));_0x58ac5e[_0x8b20('0x37')]=_0x58ac5e['attributes'][_0x8b20('0x38')]?_0x58ac5e['attributes']:_0x4d2838[_0x8b20('0x31')];if(_0x18f56e['query'][_0x8b20('0x44')]){_0x58ac5e[_0x8b20('0x45')]=[{'all':!![]}];}_0x58ac5e=_[_0x8b20('0x40')]({},_0x58ac5e,_0x18f56e[_0x8b20('0x43')]);return db['Campaign'][_0x8b20('0x4b')](_0x58ac5e)[_0x8b20('0x23')](handleEntityNotFound(_0x237baf,null))[_0x8b20('0x23')](function(_0x1e5f27){if(_0x1e5f27){var _0x18c2ee=_0x1e5f27[_0x8b20('0x25')]({'plain':!![]});_0x18c2ee=qs[_0x8b20('0x55')](_0x18c2ee,['id',_0x8b20('0x56'),'updatedAt']);_0x18f56e['body']=_[_0x8b20('0x55')](_0x18f56e['body'],['id',_0x8b20('0x56'),_0x8b20('0x57')]);return db[_0x8b20('0x46')][_0x8b20('0x51')](_[_0x8b20('0x40')](_0x18c2ee,_0x18f56e[_0x8b20('0x58')]),{'include':_0x18f56e[_0x8b20('0x33')][_0x8b20('0x44')]?[{'all':!![]}]:undefined})[_0x8b20('0x23')](function(_0x1a8af8){var _0x3ef649=_0x18f56e[_0x8b20('0x4d')]['get']({'plain':!![]});if(!_0x3ef649)throw new Error(_0x8b20('0x4c'));if(_0x3ef649[_0x8b20('0x59')]==='user'){var _0x3997c3=_0x1a8af8[_0x8b20('0x25')]({'plain':!![]});var _0x17932f=_0x8b20('0x26');return db[_0x8b20('0x4e')][_0x8b20('0x4b')]({'where':{'name':_0x17932f,'userProfileId':_0x3ef649['userProfileId']},'raw':!![]})['then'](function(_0x2ad0f8){if(_0x2ad0f8&&_0x2ad0f8['autoAssociation']===0x0){return db[_0x8b20('0x27')][_0x8b20('0x51')]({'name':_0x3997c3[_0x8b20('0x2c')],'resourceId':_0x3997c3['id'],'type':_0x2ad0f8[_0x8b20('0x2c')],'sectionId':_0x2ad0f8['id']},{})['then'](function(){return _0x1a8af8;});}else{return _0x1a8af8;}})[_0x8b20('0x49')](function(_0xf95add){logger[_0x8b20('0x2a')](_0x8b20('0x52'),_0xf95add);throw _0xf95add;});}return _0x1a8af8;});}})[_0x8b20('0x23')](respondWithResult(_0x237baf,0xc9))['catch'](handleError(_0x237baf,null));};exports[_0x8b20('0x22')]=function(_0x5b1ab5,_0x2eca03){if(_0x5b1ab5[_0x8b20('0x58')]['id']){delete _0x5b1ab5['body']['id'];}return db[_0x8b20('0x46')][_0x8b20('0x4b')]({'where':{'id':_0x5b1ab5['params']['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x2eca03,null))[_0x8b20('0x23')](saveUpdates(_0x5b1ab5[_0x8b20('0x58')],null))[_0x8b20('0x23')](respondWithResult(_0x2eca03,null))['catch'](handleError(_0x2eca03,null));};exports[_0x8b20('0x24')]=function(_0x33a590,_0x14791b){return db['Campaign'][_0x8b20('0x4b')]({'where':{'id':_0x33a590[_0x8b20('0x54')]['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x14791b,null))['then'](removeEntity(_0x14791b,null))[_0x8b20('0x49')](handleError(_0x14791b,null));};exports[_0x8b20('0x5a')]=function(_0x2754fa,_0xa90596,_0x229147){var _0x254d73={'raw':!![],'where':{}};var _0x420a5f={};var _0x4a09a4={'count':0x0,'rows':[]};return db['Campaign'][_0x8b20('0x5b')]({'where':{'id':_0x2754fa['params']['id']}})['then'](handleEntityNotFound(_0xa90596,null))[_0x8b20('0x23')](function(_0x3f21f0){if(_0x3f21f0){_0x420a5f[_0x8b20('0x31')]=_['keys'](db[_0x8b20('0x5c')]['rawAttributes']);_0x420a5f[_0x8b20('0x33')]=_[_0x8b20('0x34')](_0x2754fa[_0x8b20('0x33')]);_0x420a5f[_0x8b20('0x3e')]=_[_0x8b20('0x35')](_0x420a5f[_0x8b20('0x31')],_0x420a5f[_0x8b20('0x33')]);_0x254d73[_0x8b20('0x37')]=_[_0x8b20('0x35')](_0x420a5f['model'],qs[_0x8b20('0x36')](_0x2754fa[_0x8b20('0x33')][_0x8b20('0x36')]));_0x254d73[_0x8b20('0x37')]=_0x254d73['attributes']['length']?_0x254d73[_0x8b20('0x37')]:_0x420a5f[_0x8b20('0x31')];if(!_0x2754fa[_0x8b20('0x33')][_0x8b20('0x39')](_0x8b20('0x3a'))){_0x254d73[_0x8b20('0x1c')]=qs['limit'](_0x2754fa[_0x8b20('0x33')][_0x8b20('0x1c')]);_0x254d73[_0x8b20('0x1a')]=qs[_0x8b20('0x1a')](_0x2754fa['query'][_0x8b20('0x1a')]);}_0x254d73[_0x8b20('0x3b')]=qs['sort'](_0x2754fa[_0x8b20('0x33')][_0x8b20('0x3c')]);_0x254d73[_0x8b20('0x3d')]=qs['filters'](_[_0x8b20('0x3f')](_0x2754fa[_0x8b20('0x33')],_0x420a5f[_0x8b20('0x3e')]));_0x254d73[_0x8b20('0x3d')][_0x8b20('0x5d')]=_0x3f21f0['id'];if(_0x2754fa[_0x8b20('0x33')][_0x8b20('0x42')]){_0x254d73['where']=_[_0x8b20('0x40')](_0x254d73[_0x8b20('0x3d')],{'$or':_[_0x8b20('0x32')](_0x254d73[_0x8b20('0x37')],function(_0x7cf504){var _0x139131={};_0x139131[_0x7cf504]={'$like':'%'+_0x2754fa[_0x8b20('0x33')][_0x8b20('0x42')]+'%'};return _0x139131;})});}_0x254d73=_[_0x8b20('0x40')]({},_0x254d73,_0x2754fa[_0x8b20('0x43')]);return db[_0x8b20('0x5c')][_0x8b20('0x1d')]({'where':_0x254d73[_0x8b20('0x3d')]})[_0x8b20('0x23')](function(_0xc8835f){_0x4a09a4['count']=_0xc8835f;if(_0x2754fa[_0x8b20('0x33')][_0x8b20('0x44')]){_0x254d73[_0x8b20('0x45')]=[{'all':!![]}];}return db[_0x8b20('0x5c')][_0x8b20('0x47')](_0x254d73);})[_0x8b20('0x23')](function(_0x530bab){_0x4a09a4[_0x8b20('0x48')]=_0x530bab;return _0x4a09a4;});}})[_0x8b20('0x23')](respondWithFilteredResult(_0xa90596,_0x254d73))[_0x8b20('0x49')](handleError(_0xa90596,null));};exports[_0x8b20('0x5e')]=function(_0x5cb302,_0xf8ce1f,_0x1c0867){var _0x3a3d89={'raw':!![],'where':{}};var _0x57b89b={};var _0x3f8df6={'count':0x0,'rows':[]};return db[_0x8b20('0x46')][_0x8b20('0x5b')]({'where':{'id':_0x5cb302['params']['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0xf8ce1f,null))[_0x8b20('0x23')](function(_0x33b56b){if(_0x33b56b){_0x57b89b[_0x8b20('0x31')]=_[_0x8b20('0x34')](db[_0x8b20('0x5f')]['rawAttributes']);_0x57b89b[_0x8b20('0x33')]=_[_0x8b20('0x34')](_0x5cb302[_0x8b20('0x33')]);_0x57b89b['filters']=_[_0x8b20('0x35')](_0x57b89b['model'],_0x57b89b['query']);_0x3a3d89['attributes']=_['intersection'](_0x57b89b[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0x5cb302['query'][_0x8b20('0x36')]));_0x3a3d89[_0x8b20('0x37')]=_0x3a3d89['attributes'][_0x8b20('0x38')]?_0x3a3d89[_0x8b20('0x37')]:_0x57b89b[_0x8b20('0x31')];if(!_0x5cb302[_0x8b20('0x33')][_0x8b20('0x39')](_0x8b20('0x3a'))){_0x3a3d89[_0x8b20('0x1c')]=qs[_0x8b20('0x1c')](_0x5cb302[_0x8b20('0x33')]['limit']);_0x3a3d89['offset']=qs[_0x8b20('0x1a')](_0x5cb302['query'][_0x8b20('0x1a')]);}_0x3a3d89['order']=qs[_0x8b20('0x3c')](_0x5cb302[_0x8b20('0x33')][_0x8b20('0x3c')]);_0x3a3d89[_0x8b20('0x3d')]=qs[_0x8b20('0x3e')](_[_0x8b20('0x3f')](_0x5cb302['query'],_0x57b89b['filters']));_0x3a3d89[_0x8b20('0x3d')][_0x8b20('0x5d')]=_0x33b56b['id'];if(_0x5cb302[_0x8b20('0x33')]['filter']){_0x3a3d89[_0x8b20('0x3d')]=_[_0x8b20('0x40')](_0x3a3d89[_0x8b20('0x3d')],{'$or':_['map'](_0x3a3d89[_0x8b20('0x37')],function(_0x282e64){var _0x472aba={};_0x472aba[_0x282e64]={'$like':'%'+_0x5cb302[_0x8b20('0x33')][_0x8b20('0x42')]+'%'};return _0x472aba;})});}_0x3a3d89=_['merge']({},_0x3a3d89,_0x5cb302[_0x8b20('0x43')]);return db[_0x8b20('0x5f')]['count']({'where':_0x3a3d89[_0x8b20('0x3d')]})[_0x8b20('0x23')](function(_0x5e0307){_0x3f8df6[_0x8b20('0x1d')]=_0x5e0307;if(_0x5cb302['query'][_0x8b20('0x44')]){_0x3a3d89['include']=[{'all':!![]}];}return db[_0x8b20('0x5f')]['findAll'](_0x3a3d89);})[_0x8b20('0x23')](function(_0x26afb0){_0x3f8df6[_0x8b20('0x48')]=_0x26afb0;return _0x3f8df6;});}})[_0x8b20('0x23')](respondWithFilteredResult(_0xf8ce1f,_0x3a3d89))[_0x8b20('0x49')](handleError(_0xf8ce1f,null));};exports[_0x8b20('0x60')]=function(_0x31b497,_0x3a154a,_0x4d9a95){var _0x3b9080={'raw':!![],'where':{}};var _0x374ce7={};var _0x57ec47={'count':0x0,'rows':[]};return db[_0x8b20('0x46')]['findOne']({'where':{'id':_0x31b497['params']['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x3a154a,null))['then'](function(_0x50a78e){if(_0x50a78e){_0x374ce7[_0x8b20('0x31')]=_[_0x8b20('0x34')](db[_0x8b20('0x61')][_0x8b20('0x2e')]);_0x374ce7['query']=_[_0x8b20('0x34')](_0x31b497[_0x8b20('0x33')]);_0x374ce7[_0x8b20('0x3e')]=_['intersection'](_0x374ce7[_0x8b20('0x31')],_0x374ce7[_0x8b20('0x33')]);_0x3b9080['attributes']=_[_0x8b20('0x35')](_0x374ce7[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0x31b497[_0x8b20('0x33')][_0x8b20('0x36')]));_0x3b9080[_0x8b20('0x37')]=_0x3b9080[_0x8b20('0x37')][_0x8b20('0x38')]?_0x3b9080['attributes']:_0x374ce7[_0x8b20('0x31')];if(!_0x31b497[_0x8b20('0x33')][_0x8b20('0x39')](_0x8b20('0x3a'))){_0x3b9080[_0x8b20('0x1c')]=qs['limit'](_0x31b497[_0x8b20('0x33')][_0x8b20('0x1c')]);_0x3b9080[_0x8b20('0x1a')]=qs['offset'](_0x31b497['query'][_0x8b20('0x1a')]);}_0x3b9080['order']=qs[_0x8b20('0x3c')](_0x31b497[_0x8b20('0x33')][_0x8b20('0x3c')]);_0x3b9080[_0x8b20('0x3d')]=qs['filters'](_[_0x8b20('0x3f')](_0x31b497[_0x8b20('0x33')],_0x374ce7[_0x8b20('0x3e')]));_0x3b9080[_0x8b20('0x3d')][_0x8b20('0x5d')]=_0x50a78e['id'];if(_0x31b497[_0x8b20('0x33')]['filter']){_0x3b9080[_0x8b20('0x3d')]=_[_0x8b20('0x40')](_0x3b9080[_0x8b20('0x3d')],{'$or':_['map'](_0x3b9080[_0x8b20('0x37')],function(_0x455f57){var _0x702469={};_0x702469[_0x455f57]={'$like':'%'+_0x31b497[_0x8b20('0x33')]['filter']+'%'};return _0x702469;})});}_0x3b9080=_[_0x8b20('0x40')]({},_0x3b9080,_0x31b497[_0x8b20('0x43')]);return db[_0x8b20('0x61')][_0x8b20('0x1d')]({'where':_0x3b9080[_0x8b20('0x3d')]})[_0x8b20('0x23')](function(_0x4f8596){_0x57ec47[_0x8b20('0x1d')]=_0x4f8596;if(_0x31b497['query'][_0x8b20('0x44')]){_0x3b9080[_0x8b20('0x45')]=[{'all':!![]}];}return db[_0x8b20('0x61')]['findAll'](_0x3b9080);})[_0x8b20('0x23')](function(_0x218e20){_0x57ec47['rows']=_0x218e20;return _0x57ec47;});}})[_0x8b20('0x23')](respondWithFilteredResult(_0x3a154a,_0x3b9080))[_0x8b20('0x49')](handleError(_0x3a154a,null));};exports[_0x8b20('0x62')]=function(_0x367b55,_0x201627,_0x3be031){var _0x10fc3c={'raw':!![],'where':{}};var _0x566c71={};var _0x39974c={'count':0x0,'rows':[]};return db[_0x8b20('0x46')][_0x8b20('0x5b')]({'where':{'id':_0x367b55[_0x8b20('0x54')]['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x201627,null))[_0x8b20('0x23')](function(_0x4e635d){if(_0x4e635d){_0x566c71[_0x8b20('0x31')]=_[_0x8b20('0x34')](db[_0x8b20('0x63')]['rawAttributes']);_0x566c71['query']=_[_0x8b20('0x34')](_0x367b55['query']);_0x566c71['filters']=_[_0x8b20('0x35')](_0x566c71[_0x8b20('0x31')],_0x566c71[_0x8b20('0x33')]);_0x10fc3c[_0x8b20('0x37')]=_[_0x8b20('0x35')](_0x566c71[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0x367b55[_0x8b20('0x33')][_0x8b20('0x36')]));_0x10fc3c[_0x8b20('0x37')]=_0x10fc3c[_0x8b20('0x37')][_0x8b20('0x38')]?_0x10fc3c[_0x8b20('0x37')]:_0x566c71[_0x8b20('0x31')];if(!_0x367b55[_0x8b20('0x33')][_0x8b20('0x39')](_0x8b20('0x3a'))){_0x10fc3c[_0x8b20('0x1c')]=qs[_0x8b20('0x1c')](_0x367b55[_0x8b20('0x33')][_0x8b20('0x1c')]);_0x10fc3c[_0x8b20('0x1a')]=qs[_0x8b20('0x1a')](_0x367b55[_0x8b20('0x33')]['offset']);}_0x10fc3c[_0x8b20('0x3b')]=qs['sort'](_0x367b55[_0x8b20('0x33')][_0x8b20('0x3c')]);_0x10fc3c['where']=qs['filters'](_[_0x8b20('0x3f')](_0x367b55[_0x8b20('0x33')],_0x566c71[_0x8b20('0x3e')]));_0x10fc3c[_0x8b20('0x3d')][_0x8b20('0x5d')]=_0x4e635d['id'];if(_0x367b55[_0x8b20('0x33')][_0x8b20('0x42')]){_0x10fc3c[_0x8b20('0x3d')]=_[_0x8b20('0x40')](_0x10fc3c[_0x8b20('0x3d')],{'$or':_[_0x8b20('0x32')](_0x10fc3c[_0x8b20('0x37')],function(_0x160a92){var _0x28b4de={};_0x28b4de[_0x160a92]={'$like':'%'+_0x367b55[_0x8b20('0x33')]['filter']+'%'};return _0x28b4de;})});}_0x10fc3c=_[_0x8b20('0x40')]({},_0x10fc3c,_0x367b55['options']);return db['CmHopperBlack'][_0x8b20('0x1d')]({'where':_0x10fc3c[_0x8b20('0x3d')]})[_0x8b20('0x23')](function(_0x7168ae){_0x39974c['count']=_0x7168ae;if(_0x367b55[_0x8b20('0x33')]['includeAll']){_0x10fc3c['include']=[{'all':!![]}];}return db[_0x8b20('0x63')]['findAll'](_0x10fc3c);})[_0x8b20('0x23')](function(_0x40f86e){_0x39974c['rows']=_0x40f86e;return _0x39974c;});}})['then'](respondWithFilteredResult(_0x201627,_0x10fc3c))[_0x8b20('0x49')](handleError(_0x201627,null));};exports[_0x8b20('0x64')]=function(_0x4b7784,_0x311893,_0x31c908){var _0x82e71d={};var _0x3cef2d={};var _0x23e3f3;var _0x3801d1;return db[_0x8b20('0x46')][_0x8b20('0x5b')]({'where':{'id':_0x4b7784['params']['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x311893,null))[_0x8b20('0x23')](function(_0x48aeda){if(_0x48aeda){_0x23e3f3=_0x48aeda;_0x3cef2d[_0x8b20('0x31')]=_[_0x8b20('0x34')](db[_0x8b20('0x65')][_0x8b20('0x2e')]);_0x3cef2d['query']=_[_0x8b20('0x34')](_0x4b7784[_0x8b20('0x33')]);_0x3cef2d[_0x8b20('0x3e')]=_['intersection'](_0x3cef2d['model'],_0x3cef2d[_0x8b20('0x33')]);_0x82e71d['attributes']=_[_0x8b20('0x35')](_0x3cef2d['model'],qs[_0x8b20('0x36')](_0x4b7784[_0x8b20('0x33')][_0x8b20('0x36')]));_0x82e71d[_0x8b20('0x37')]=_0x82e71d[_0x8b20('0x37')][_0x8b20('0x38')]?_0x82e71d['attributes']:_0x3cef2d[_0x8b20('0x31')];_0x82e71d[_0x8b20('0x3b')]=qs[_0x8b20('0x3c')](_0x4b7784[_0x8b20('0x33')][_0x8b20('0x3c')]);_0x82e71d[_0x8b20('0x3d')]=qs['filters'](_[_0x8b20('0x3f')](_0x4b7784[_0x8b20('0x33')],_0x3cef2d[_0x8b20('0x3e')]));if(_0x4b7784[_0x8b20('0x33')][_0x8b20('0x42')]){_0x82e71d[_0x8b20('0x3d')]=_[_0x8b20('0x40')](_0x82e71d[_0x8b20('0x3d')],{'$or':_[_0x8b20('0x32')](_0x82e71d[_0x8b20('0x37')],function(_0x4178a7){var _0x414582={};_0x414582[_0x4178a7]={'$like':'%'+_0x4b7784[_0x8b20('0x33')]['filter']+'%'};return _0x414582;})});}_0x82e71d=_[_0x8b20('0x40')]({},_0x82e71d,_0x4b7784[_0x8b20('0x43')]);return _0x23e3f3['getLists'](_0x82e71d);}})['then'](function(_0x1b8837){if(_0x1b8837){_0x3801d1=_0x1b8837[_0x8b20('0x38')];if(!_0x4b7784['query']['hasOwnProperty'](_0x8b20('0x3a'))){_0x82e71d[_0x8b20('0x1c')]=qs['limit'](_0x4b7784[_0x8b20('0x33')][_0x8b20('0x1c')]);_0x82e71d[_0x8b20('0x1a')]=qs[_0x8b20('0x1a')](_0x4b7784['query'][_0x8b20('0x1a')]);}return _0x23e3f3[_0x8b20('0x64')](_0x82e71d);}})[_0x8b20('0x23')](function(_0x51091e){if(_0x51091e){return _0x51091e?{'count':_0x3801d1,'rows':_0x51091e}:null;}})['then'](respondWithResult(_0x311893,null))[_0x8b20('0x49')](handleError(_0x311893,null));};exports[_0x8b20('0x66')]=function(_0x42f3e4,_0x234b6e,_0x2853ac){var _0x27c030,_0x591b97;return db[_0x8b20('0x46')]['find']({'where':{'id':_0x42f3e4[_0x8b20('0x54')]['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x234b6e,null))[_0x8b20('0x23')](function(_0x2f5675){if(_0x2f5675){_0x591b97=_0x2f5675;return _0x2f5675[_0x8b20('0x66')](_0x42f3e4[_0x8b20('0x58')][_0x8b20('0x67')],_[_0x8b20('0x55')](_0x42f3e4[_0x8b20('0x58')],[_0x8b20('0x67'),'id'])||{});}return null;})[_0x8b20('0x68')](function(_0x4b83f5){var _0x2836a6;_0x27c030=_0x4b83f5||[];var _0x44c96e=[];if(_0x4b83f5){for(var _0x1fd2b3=0x0;_0x1fd2b3<_0x4b83f5[_0x8b20('0x38')];_0x1fd2b3+=0x1){var _0x58e50c=_0x4b83f5[_0x1fd2b3][_0x8b20('0x25')]({'plain':!![]});_0x591b97[_0x8b20('0x69')]=_0x42f3e4['body'][_0x8b20('0x69')]?_0x42f3e4[_0x8b20('0x58')][_0x8b20('0x69')]:_0x591b97['dialCheckDuplicateType'];switch(_0x591b97['dialCheckDuplicateType']){case'always':_0x2836a6=squel['insert']()[_0x8b20('0x6a')]('cm_hopper')[_0x8b20('0x6b')]([_0x8b20('0x6c'),_0x8b20('0x6d'),_0x8b20('0x6e'),_0x8b20('0x6f'),_0x8b20('0x5d'),_0x8b20('0x56'),_0x8b20('0x57')],squel['select']()[_0x8b20('0x70')](_0x8b20('0x6c'),_0x8b20('0x6c'))[_0x8b20('0x70')](_0x8b20('0x71'),_0x8b20('0x6d'))[_0x8b20('0x70')]('id',_0x8b20('0x6e'))[_0x8b20('0x70')](_0x58e50c[_0x8b20('0x72')][_0x8b20('0x73')](),_0x8b20('0x6f'))[_0x8b20('0x70')](_0x42f3e4['params']['id'][_0x8b20('0x73')](),_0x8b20('0x5d'))[_0x8b20('0x70')]('NOW()','createdAt')['field'](_0x8b20('0x71'),'updatedAt')['from'](_0x8b20('0x74'))[_0x8b20('0x3d')]('deletedAt\x20IS\x20NULL')[_0x8b20('0x3d')](_0x8b20('0x75'),_0x58e50c[_0x8b20('0x72')]['toString']())['where'](_0x8b20('0x76'))['where'](_0x8b20('0x77'),squel[_0x8b20('0x78')]()[_0x8b20('0x70')](_0x8b20('0x79'))[_0x8b20('0x7a')]('cm_hopper_final')[_0x8b20('0x3d')](_0x8b20('0x7b'),_0x42f3e4[_0x8b20('0x54')]['id'][_0x8b20('0x73')]()))[_0x8b20('0x3d')](_0x8b20('0x77'),squel[_0x8b20('0x78')]()[_0x8b20('0x70')](_0x8b20('0x7c'))['from']('cm_hopper')[_0x8b20('0x3d')](_0x8b20('0x7b'),_0x42f3e4[_0x8b20('0x54')]['id'][_0x8b20('0x73')]())))[_0x8b20('0x73')]();break;case _0x8b20('0x7d'):_0x2836a6=squel[_0x8b20('0x7e')]()[_0x8b20('0x6a')](_0x8b20('0x7f'))[_0x8b20('0x6b')]([_0x8b20('0x6c'),'scheduledAt',_0x8b20('0x6e'),'ListId',_0x8b20('0x5d'),_0x8b20('0x56'),_0x8b20('0x57')],squel['select']()[_0x8b20('0x70')](_0x8b20('0x6c'),_0x8b20('0x6c'))[_0x8b20('0x70')](_0x8b20('0x71'),_0x8b20('0x6d'))[_0x8b20('0x70')]('id',_0x8b20('0x6e'))[_0x8b20('0x70')](_0x58e50c['CmListId'][_0x8b20('0x73')](),_0x8b20('0x6f'))[_0x8b20('0x70')](_0x42f3e4[_0x8b20('0x54')]['id']['toString'](),_0x8b20('0x5d'))[_0x8b20('0x70')]('NOW()',_0x8b20('0x56'))[_0x8b20('0x70')]('NOW()',_0x8b20('0x57'))[_0x8b20('0x7a')](_0x8b20('0x74'))[_0x8b20('0x3d')](_0x8b20('0x80'))[_0x8b20('0x3d')](_0x8b20('0x75'),_0x58e50c[_0x8b20('0x72')][_0x8b20('0x73')]())[_0x8b20('0x3d')](_0x8b20('0x76'))[_0x8b20('0x3d')](_0x8b20('0x77'),squel['select']()['field'](_0x8b20('0x7c'))[_0x8b20('0x7a')](_0x8b20('0x7f'))[_0x8b20('0x3d')]('CampaignId\x20=\x20?',_0x42f3e4[_0x8b20('0x54')]['id'][_0x8b20('0x73')]())))['toString']();break;default:_0x2836a6=squel[_0x8b20('0x7e')]()[_0x8b20('0x6a')](_0x8b20('0x7f'))['fromQuery']([_0x8b20('0x6c'),_0x8b20('0x6d'),_0x8b20('0x6e'),_0x8b20('0x6f'),_0x8b20('0x5d'),_0x8b20('0x56'),_0x8b20('0x57')],squel['select']()[_0x8b20('0x70')](_0x8b20('0x6c'),_0x8b20('0x6c'))[_0x8b20('0x70')]('NOW()',_0x8b20('0x6d'))[_0x8b20('0x70')]('id',_0x8b20('0x6e'))[_0x8b20('0x70')](_0x58e50c['CmListId'][_0x8b20('0x73')](),'ListId')[_0x8b20('0x70')](_0x42f3e4[_0x8b20('0x54')]['id'][_0x8b20('0x73')](),_0x8b20('0x5d'))[_0x8b20('0x70')]('NOW()',_0x8b20('0x56'))['field'](_0x8b20('0x71'),_0x8b20('0x57'))[_0x8b20('0x7a')](_0x8b20('0x74'))[_0x8b20('0x3d')](_0x8b20('0x80'))[_0x8b20('0x3d')](_0x8b20('0x75'),_0x58e50c[_0x8b20('0x72')][_0x8b20('0x73')]())[_0x8b20('0x3d')](_0x8b20('0x76')))[_0x8b20('0x73')]();}_0x44c96e[_0x8b20('0x81')](db[_0x8b20('0x82')][_0x8b20('0x33')](_0x2836a6));}return BPromise['all'](_0x44c96e);}})[_0x8b20('0x23')](function(){return _0x27c030;})[_0x8b20('0x23')](respondWithResult(_0x234b6e,null))[_0x8b20('0x49')](handleError(_0x234b6e,null));};exports[_0x8b20('0x83')]=function(_0x23f1a1,_0x56c60d,_0x3ca32b){return db['Campaign'][_0x8b20('0x4b')]({'where':{'id':_0x23f1a1[_0x8b20('0x54')]['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x56c60d,null))[_0x8b20('0x23')](function(_0x4ebcdf){if(_0x4ebcdf){return _0x4ebcdf[_0x8b20('0x83')](_0x23f1a1[_0x8b20('0x33')][_0x8b20('0x67')]);}})['then'](function(_0x32874e){if(_0x32874e){return db[_0x8b20('0x5c')][_0x8b20('0x24')]({'where':{'ListId':_0x23f1a1[_0x8b20('0x33')][_0x8b20('0x67')],'CampaignId':_0x23f1a1[_0x8b20('0x54')]['id']}})[_0x8b20('0x23')](function(){return _0x32874e;});}})[_0x8b20('0x23')](respondWithStatusCode(_0x56c60d,null))[_0x8b20('0x49')](handleError(_0x56c60d,null));};exports['getBlackLists']=function(_0x34dd87,_0x317ece,_0x1615da){var _0x419c4d={};var _0x28433f={};var _0x23df08;var _0xc10aca;return db[_0x8b20('0x46')][_0x8b20('0x5b')]({'where':{'id':_0x34dd87['params']['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x317ece,null))['then'](function(_0x4b2ba8){if(_0x4b2ba8){_0x23df08=_0x4b2ba8;_0x28433f['model']=_[_0x8b20('0x34')](db[_0x8b20('0x65')][_0x8b20('0x2e')]);_0x28433f[_0x8b20('0x33')]=_[_0x8b20('0x34')](_0x34dd87[_0x8b20('0x33')]);_0x28433f[_0x8b20('0x3e')]=_['intersection'](_0x28433f[_0x8b20('0x31')],_0x28433f[_0x8b20('0x33')]);_0x419c4d[_0x8b20('0x37')]=_[_0x8b20('0x35')](_0x28433f[_0x8b20('0x31')],qs[_0x8b20('0x36')](_0x34dd87[_0x8b20('0x33')][_0x8b20('0x36')]));_0x419c4d[_0x8b20('0x37')]=_0x419c4d['attributes'][_0x8b20('0x38')]?_0x419c4d[_0x8b20('0x37')]:_0x28433f[_0x8b20('0x31')];_0x419c4d['order']=qs['sort'](_0x34dd87['query'][_0x8b20('0x3c')]);_0x419c4d[_0x8b20('0x3d')]=qs[_0x8b20('0x3e')](_[_0x8b20('0x3f')](_0x34dd87[_0x8b20('0x33')],_0x28433f[_0x8b20('0x3e')]));if(_0x34dd87[_0x8b20('0x33')][_0x8b20('0x42')]){_0x419c4d[_0x8b20('0x3d')]=_[_0x8b20('0x40')](_0x419c4d['where'],{'$or':_['map'](_0x419c4d[_0x8b20('0x37')],function(_0x1cbf12){var _0x4ccdc7={};_0x4ccdc7[_0x1cbf12]={'$like':'%'+_0x34dd87['query']['filter']+'%'};return _0x4ccdc7;})});}_0x419c4d=_['merge']({},_0x419c4d,_0x34dd87[_0x8b20('0x43')]);return _0x23df08['getBlackLists'](_0x419c4d);}})['then'](function(_0x5ca2cd){if(_0x5ca2cd){_0xc10aca=_0x5ca2cd['length'];if(!_0x34dd87[_0x8b20('0x33')][_0x8b20('0x39')](_0x8b20('0x3a'))){_0x419c4d[_0x8b20('0x1c')]=qs[_0x8b20('0x1c')](_0x34dd87[_0x8b20('0x33')]['limit']);_0x419c4d['offset']=qs['offset'](_0x34dd87[_0x8b20('0x33')]['offset']);}return _0x23df08['getBlackLists'](_0x419c4d);}})['then'](function(_0x3d191e){if(_0x3d191e){return _0x3d191e?{'count':_0xc10aca,'rows':_0x3d191e}:null;}})[_0x8b20('0x23')](respondWithResult(_0x317ece,null))['catch'](handleError(_0x317ece,null));};exports['addBlackLists']=function(_0x346829,_0x20155b,_0x576066){var _0x392a19,_0x1cc718;return db[_0x8b20('0x46')][_0x8b20('0x4b')]({'where':{'id':_0x346829[_0x8b20('0x54')]['id']}})['then'](handleEntityNotFound(_0x20155b,null))[_0x8b20('0x23')](function(_0x34b827){if(_0x34b827){_0x1cc718=_0x34b827;return _0x34b827[_0x8b20('0x84')](_0x346829[_0x8b20('0x58')][_0x8b20('0x67')],_[_0x8b20('0x55')](_0x346829[_0x8b20('0x58')],[_0x8b20('0x67'),'id'])||{});}return null;})[_0x8b20('0x68')](function(_0x33b6d1){var _0x2d4ea2;_0x392a19=_0x33b6d1||[];var _0x2e314b=[];if(_0x33b6d1){for(var _0x38d485=0x0;_0x38d485<_0x33b6d1[_0x8b20('0x38')];_0x38d485+=0x1){var _0x3b8dab=_0x33b6d1[_0x38d485][_0x8b20('0x25')]({'plain':!![]});_0x2d4ea2=squel['insert']()['into'](_0x8b20('0x85'))[_0x8b20('0x6b')]([_0x8b20('0x6c'),_0x8b20('0x6e'),_0x8b20('0x6f'),_0x8b20('0x5d'),_0x8b20('0x56'),_0x8b20('0x57')],squel[_0x8b20('0x78')]()[_0x8b20('0x70')](_0x8b20('0x6c'),_0x8b20('0x6c'))[_0x8b20('0x70')]('id',_0x8b20('0x6e'))['field'](_0x3b8dab['CmListId']['toString'](),_0x8b20('0x6f'))[_0x8b20('0x70')](_0x346829[_0x8b20('0x54')]['id']['toString'](),'CampaignId')['field'](_0x8b20('0x71'),_0x8b20('0x56'))[_0x8b20('0x70')](_0x8b20('0x71'),_0x8b20('0x57'))['from'](_0x8b20('0x74'))[_0x8b20('0x3d')](_0x8b20('0x80'))[_0x8b20('0x3d')](_0x8b20('0x75'),_0x3b8dab['CmListId'][_0x8b20('0x73')]())[_0x8b20('0x3d')](_0x8b20('0x76')))['toString']();_0x2e314b['push'](db[_0x8b20('0x82')][_0x8b20('0x33')](_0x2d4ea2));}return BPromise[_0x8b20('0x86')](_0x2e314b);}})[_0x8b20('0x23')](function(){return _0x392a19;})[_0x8b20('0x23')](respondWithResult(_0x20155b,null))[_0x8b20('0x49')](handleError(_0x20155b,null));};exports[_0x8b20('0x87')]=function(_0x407988,_0x3a9f5a,_0x135ae0){return db[_0x8b20('0x46')][_0x8b20('0x4b')]({'where':{'id':_0x407988[_0x8b20('0x54')]['id']}})[_0x8b20('0x23')](handleEntityNotFound(_0x3a9f5a,null))[_0x8b20('0x23')](function(_0x411ea0){if(_0x411ea0){return _0x411ea0['removeBlackLists'](_0x407988[_0x8b20('0x33')][_0x8b20('0x67')]);}})[_0x8b20('0x23')](function(_0x1a8bd3){if(_0x1a8bd3){return db['CmHopperBlack'][_0x8b20('0x24')]({'where':{'ListId':_0x407988['query'][_0x8b20('0x67')],'CampaignId':_0x407988['params']['id']}})[_0x8b20('0x23')](function(){return _0x1a8bd3;});}})[_0x8b20('0x23')](respondWithStatusCode(_0x3a9f5a,null))[_0x8b20('0x49')](handleError(_0x3a9f5a,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 7d1ba4b..f6cc9a3 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(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_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 +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 301168c..b5af137 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 _0xf3dc=['debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','limit','map','include','model','attributes'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0xf3dc[_0x57014b];return _0x2b258a;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var moment=require(_0xcf3d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf3d('0x3'));var fs=require('fs');var Redis=require(_0xcf3d('0x4'));var db=require(_0xcf3d('0x5'))['db'];var utils=require(_0xcf3d('0x6'));var logger=require(_0xcf3d('0x7'))(_0xcf3d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3427,_0x5bc3d6,_0x1a69de){return new BPromise(function(_0x10d808,_0x1c815e){return client[_0xcf3d('0x9')](_0x4e3427,_0x1a69de)[_0xcf3d('0xa')](function(_0x27c49c){logger[_0xcf3d('0xb')](_0xcf3d('0xc'),_0x5bc3d6,_0xcf3d('0xd'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x5bc3d6,'request\x20sent',JSON[_0xcf3d('0xe')](_0x27c49c));if(_0x27c49c['error']){if(_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x10')]===0x1f4){logger[_0xcf3d('0xf')](_0xcf3d('0xc'),_0x5bc3d6,_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x11')]);return _0x1c815e(_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x11')]);}logger[_0xcf3d('0xf')]('Campaign,\x20%s,\x20%s',_0x5bc3d6,_0x27c49c['error'][_0xcf3d('0x11')]);return _0x10d808(_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x11')]);}else{logger[_0xcf3d('0xb')](_0xcf3d('0xc'),_0x5bc3d6,_0xcf3d('0xd'));_0x10d808(_0x27c49c[_0xcf3d('0x12')][_0xcf3d('0x11')]);}})[_0xcf3d('0x13')](function(_0x88c2de){logger['error']('Campaign,\x20%s,\x20%s',_0x5bc3d6,_0x88c2de);_0x1c815e(_0x88c2de);});});}exports[_0xcf3d('0x14')]=function(_0x22fd74){var _0x5e4351=this;return new Promise(function(_0x3272e3,_0x15f80a){return db[_0xcf3d('0x15')][_0xcf3d('0x16')]({'raw':_0x22fd74[_0xcf3d('0x17')]?_0x22fd74['options']['raw']===undefined?!![]:![]:!![],'where':_0x22fd74['options']?_0x22fd74['options'][_0xcf3d('0x18')]||null:null,'attributes':_0x22fd74[_0xcf3d('0x17')]?_0x22fd74[_0xcf3d('0x17')]['attributes']||null:null,'limit':_0x22fd74['options']?_0x22fd74[_0xcf3d('0x17')][_0xcf3d('0x19')]||null:null,'include':_0x22fd74[_0xcf3d('0x17')]?_0x22fd74[_0xcf3d('0x17')]['include']?_[_0xcf3d('0x1a')](_0x22fd74[_0xcf3d('0x17')][_0xcf3d('0x1b')],function(_0x78a3c7){return{'model':db[_0x78a3c7[_0xcf3d('0x1c')]],'as':_0x78a3c7['as'],'attributes':_0x78a3c7[_0xcf3d('0x1d')],'include':_0x78a3c7['include']?_['map'](_0x78a3c7['include'],function(_0x2f49f0){return{'model':db[_0x2f49f0[_0xcf3d('0x1c')]],'as':_0x2f49f0['as'],'attributes':_0x2f49f0[_0xcf3d('0x1d')],'include':_0x2f49f0[_0xcf3d('0x1b')]?_[_0xcf3d('0x1a')](_0x2f49f0[_0xcf3d('0x1b')],function(_0xa32d3c){return{'model':db[_0xa32d3c[_0xcf3d('0x1c')]],'as':_0xa32d3c['as'],'attributes':_0xa32d3c[_0xcf3d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcf3d('0xa')](function(_0x2a2d66){logger[_0xcf3d('0xb')](_0xcf3d('0x14'),_0x22fd74);logger[_0xcf3d('0x1e')](_0xcf3d('0x14'),_0x22fd74,JSON['stringify'](_0x2a2d66));_0x3272e3(_0x2a2d66);})[_0xcf3d('0x13')](function(_0x45a224){logger['error'](_0xcf3d('0x14'),_0x45a224[_0xcf3d('0x11')],_0x22fd74);_0x15f80a(_0x5e4351[_0xcf3d('0xf')](0x1f4,_0x45a224[_0xcf3d('0x11')]));});});}; \ No newline at end of file +var _0xbec5=['request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','result','GetCampaign','findAll','options','raw','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xbec5,0xe5));var _0x5bec=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xbec5[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a427,_0x38456e,_0x406e65){return new BPromise(function(_0x43d96e,_0x302aae){return client[_0x5bec('0xb')](_0x28a427,_0x406e65)[_0x5bec('0xc')](function(_0x4d0d29){logger[_0x5bec('0xd')]('Campaign,\x20%s,\x20%s',_0x38456e,_0x5bec('0xe'));logger[_0x5bec('0xf')](_0x5bec('0x10'),_0x38456e,'request\x20sent',JSON[_0x5bec('0x11')](_0x4d0d29));if(_0x4d0d29[_0x5bec('0x12')]){if(_0x4d0d29[_0x5bec('0x12')]['code']===0x1f4){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29['error'][_0x5bec('0x14')]);return _0x302aae(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);return _0x43d96e(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}else{logger[_0x5bec('0xd')](_0x5bec('0x13'),_0x38456e,_0x5bec('0xe'));_0x43d96e(_0x4d0d29[_0x5bec('0x15')]['message']);}})['catch'](function(_0x15af9b){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x15af9b);_0x302aae(_0x15af9b);});});}exports[_0x5bec('0x16')]=function(_0x5cd7ae){var _0x5295f0=this;return new Promise(function(_0x3cd354,_0x6c0d35){return db['Campaign'][_0x5bec('0x17')]({'raw':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae[_0x5bec('0x18')][_0x5bec('0x19')]===undefined?!![]:![]:!![],'where':_0x5cd7ae['options']?_0x5cd7ae[_0x5bec('0x18')]['where']||null:null,'attributes':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae[_0x5bec('0x18')][_0x5bec('0x1a')]||null:null,'limit':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae[_0x5bec('0x18')]['limit']||null:null,'include':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae['options'][_0x5bec('0x1b')]?_[_0x5bec('0x1c')](_0x5cd7ae['options'][_0x5bec('0x1b')],function(_0xbef70b){return{'model':db[_0xbef70b['model']],'as':_0xbef70b['as'],'attributes':_0xbef70b[_0x5bec('0x1a')],'include':_0xbef70b[_0x5bec('0x1b')]?_[_0x5bec('0x1c')](_0xbef70b[_0x5bec('0x1b')],function(_0x226d55){return{'model':db[_0x226d55[_0x5bec('0x1d')]],'as':_0x226d55['as'],'attributes':_0x226d55[_0x5bec('0x1a')],'include':_0x226d55['include']?_['map'](_0x226d55['include'],function(_0x2961bd){return{'model':db[_0x2961bd[_0x5bec('0x1d')]],'as':_0x2961bd['as'],'attributes':_0x2961bd[_0x5bec('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3b2c){logger[_0x5bec('0xd')]('GetCampaign',_0x5cd7ae);logger[_0x5bec('0xf')](_0x5bec('0x16'),_0x5cd7ae,JSON['stringify'](_0x2b3b2c));_0x3cd354(_0x2b3b2c);})['catch'](function(_0x3575e7){logger[_0x5bec('0x12')](_0x5bec('0x16'),_0x3575e7[_0x5bec('0x14')],_0x5cd7ae);_0x6c0d35(_0x5295f0[_0x5bec('0x12')](0x1f4,_0x3575e7[_0x5bec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 82aa5a5..d8e175e 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 _0xb763=['removeLists','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','destroy','delete'];(function(_0x4d650f,_0x11a132){var _0x3184ab=function(_0x34eed0){while(--_0x34eed0){_0x4d650f['push'](_0x4d650f['shift']());}};_0x3184ab(++_0x11a132);}(_0xb763,0x155));var _0x3b76=function(_0x205664,_0x5daa7d){_0x205664=_0x205664-0x0;var _0x2de619=_0xb763[_0x205664];return _0x2de619;};'use strict';var multer=require(_0x3b76('0x0'));var util=require(_0x3b76('0x1'));var path=require(_0x3b76('0x2'));var timeout=require(_0x3b76('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3b76('0x4'));var auth=require(_0x3b76('0x5'));var interaction=require(_0x3b76('0x6'));var config=require(_0x3b76('0x7'));var controller=require(_0x3b76('0x8'));router[_0x3b76('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3b76('0x9')](_0x3b76('0xa'),auth[_0x3b76('0xb')](),controller['show']);router[_0x3b76('0x9')](_0x3b76('0xc'),auth[_0x3b76('0xb')](),controller[_0x3b76('0xd')]);router[_0x3b76('0x9')](_0x3b76('0xe'),auth[_0x3b76('0xb')](),controller['getHopperHistories']);router[_0x3b76('0x9')](_0x3b76('0xf'),auth[_0x3b76('0xb')](),controller[_0x3b76('0x10')]);router[_0x3b76('0x9')](_0x3b76('0x11'),auth[_0x3b76('0xb')](),controller[_0x3b76('0x12')]);router[_0x3b76('0x9')]('/:id/lists',auth[_0x3b76('0xb')](),controller[_0x3b76('0x13')]);router[_0x3b76('0x9')](_0x3b76('0x14'),auth['isAuthenticated'](),controller[_0x3b76('0x15')]);router['post']('/',auth[_0x3b76('0xb')](),controller[_0x3b76('0x16')]);router[_0x3b76('0x17')](_0x3b76('0x18'),auth['isAuthenticated'](),controller[_0x3b76('0x19')]);router['post'](_0x3b76('0x1a'),auth[_0x3b76('0xb')](),controller[_0x3b76('0x1b')]);router['post'](_0x3b76('0x14'),auth[_0x3b76('0xb')](),controller[_0x3b76('0x1c')]);router[_0x3b76('0x1d')](_0x3b76('0xa'),auth[_0x3b76('0xb')](),controller[_0x3b76('0x1e')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3b76('0x1f')]);router[_0x3b76('0x20')](_0x3b76('0x1a'),auth['isAuthenticated'](),controller[_0x3b76('0x21')]);router[_0x3b76('0x20')]('/:id/blacklists',auth[_0x3b76('0xb')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0xa920=['removeLists','removeBlackLists','multer','path','express','Router','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','/:id/blacklists','create','post','/:id/clone','addLists','addBlackLists','put','update','delete'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa920,0x110));var _0x0a92=function(_0x2a792c,_0x38afcc){_0x2a792c=_0x2a792c-0x0;var _0x583637=_0xa920[_0x2a792c];return _0x583637;};'use strict';var multer=require(_0x0a92('0x0'));var util=require('util');var path=require(_0x0a92('0x1'));var timeout=require('connect-timeout');var express=require(_0x0a92('0x2'));var router=express[_0x0a92('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0a92('0x4'));var controller=require(_0x0a92('0x5'));router['get']('/',auth[_0x0a92('0x6')](),controller[_0x0a92('0x7')]);router[_0x0a92('0x8')](_0x0a92('0x9'),auth[_0x0a92('0x6')](),controller[_0x0a92('0xa')]);router[_0x0a92('0x8')]('/:id/hoppers',auth[_0x0a92('0x6')](),controller['getHoppers']);router[_0x0a92('0x8')](_0x0a92('0xb'),auth[_0x0a92('0x6')](),controller[_0x0a92('0xc')]);router[_0x0a92('0x8')](_0x0a92('0xd'),auth[_0x0a92('0x6')](),controller['getHopperFinals']);router[_0x0a92('0x8')](_0x0a92('0xe'),auth[_0x0a92('0x6')](),controller['getHopperBlacks']);router[_0x0a92('0x8')](_0x0a92('0xf'),auth['isAuthenticated'](),controller['getLists']);router[_0x0a92('0x8')](_0x0a92('0x10'),auth[_0x0a92('0x6')](),controller['getBlackLists']);router['post']('/',auth[_0x0a92('0x6')](),controller[_0x0a92('0x11')]);router[_0x0a92('0x12')](_0x0a92('0x13'),auth[_0x0a92('0x6')](),controller['clone']);router[_0x0a92('0x12')](_0x0a92('0xf'),auth['isAuthenticated'](),controller[_0x0a92('0x14')]);router[_0x0a92('0x12')](_0x0a92('0x10'),auth[_0x0a92('0x6')](),controller[_0x0a92('0x15')]);router[_0x0a92('0x16')](_0x0a92('0x9'),auth['isAuthenticated'](),controller[_0x0a92('0x17')]);router[_0x0a92('0x18')](_0x0a92('0x9'),auth[_0x0a92('0x6')](),controller['destroy']);router[_0x0a92('0x18')](_0x0a92('0xf'),auth['isAuthenticated'](),controller[_0x0a92('0x19')]);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x0a92('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9e4a27d..63e14d5 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 _0xaad7=['getDataValue','key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0xa7163a,_0x25b4df){var _0x2b68b7=function(_0xa5995c){while(--_0xa5995c){_0xa7163a['push'](_0xa7163a['shift']());}};_0x2b68b7(++_0x25b4df);}(_0xaad7,0x1f3));var _0x7aad=function(_0x5caffa,_0x4bf8f8){_0x5caffa=_0x5caffa-0x0;var _0x5c59c4=_0xaad7[_0x5caffa];return _0x5c59c4;};'use strict';var Sequelize=require(_0x7aad('0x0'));module[_0x7aad('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7aad('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7aad('0x3')]},'name':{'type':Sequelize[_0x7aad('0x4')],'get':function(){return this[_0x7aad('0x5')](_0x7aad('0x6'));}}}; \ No newline at end of file +var _0x3583=['STRING','TEXT','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x5bbaf4,_0x276060){var _0x3fba22=function(_0x169b10){while(--_0x169b10){_0x5bbaf4['push'](_0x5bbaf4['shift']());}};_0x3fba22(++_0x276060);}(_0x3583,0x64));var _0x3358=function(_0x19a0b4,_0x15c470){_0x19a0b4=_0x19a0b4-0x0;var _0x137f7e=_0x3583[_0x19a0b4];return _0x137f7e;};'use strict';var Sequelize=require(_0x3358('0x0'));module[_0x3358('0x1')]={'key':{'type':Sequelize[_0x3358('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x3358('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x3358('0x2')]},'name':{'type':Sequelize[_0x3358('0x4')],'get':function(){return this[_0x3358('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b957f5e..0b22bd6 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 _0x2738=['rows','catch','params','include','body','find','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','update','destroy','then','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll'];(function(_0x535beb,_0x140701){var _0x2cc3c7=function(_0x48b883){while(--_0x48b883){_0x535beb['push'](_0x535beb['shift']());}};_0x2cc3c7(++_0x140701);}(_0x2738,0x172));var _0x8273=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x2738[_0x1a9204];return _0x17ca68;};'use strict';var emlformat=require(_0x8273('0x0'));var rimraf=require(_0x8273('0x1'));var zipdir=require(_0x8273('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8273('0x3'));var moment=require(_0x8273('0x4'));var BPromise=require(_0x8273('0x5'));var Mustache=require(_0x8273('0x6'));var util=require('util');var path=require(_0x8273('0x7'));var sox=require(_0x8273('0x8'));var csv=require(_0x8273('0x9'));var ejs=require(_0x8273('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8273('0xb'));var squel=require(_0x8273('0xc'));var crypto=require(_0x8273('0xd'));var jsforce=require(_0x8273('0xe'));var deskjs=require(_0x8273('0xf'));var toCsv=require(_0x8273('0x9'));var querystring=require(_0x8273('0x10'));var Papa=require(_0x8273('0x11'));var Redis=require(_0x8273('0x12'));var authService=require(_0x8273('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8273('0x14'));var utils=require(_0x8273('0x15'));var config=require(_0x8273('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8273('0x17'))['db'];function respondWithStatusCode(_0x16d1e0,_0xff9145){_0xff9145=_0xff9145||0xcc;return function(_0x437cf3){if(_0x437cf3){return _0x16d1e0[_0x8273('0x18')](_0xff9145);}return _0x16d1e0['status'](_0xff9145)['end']();};}function respondWithResult(_0x35881e,_0x48bc4c){_0x48bc4c=_0x48bc4c||0xc8;return function(_0x14b0e5){if(_0x14b0e5){return _0x35881e[_0x8273('0x19')](_0x48bc4c)['json'](_0x14b0e5);}};}function respondWithFilteredResult(_0x2fa9aa,_0x5d681d){return function(_0xe54643){if(_0xe54643){var _0x565c30=typeof _0x5d681d['offset']===_0x8273('0x1a')&&typeof _0x5d681d[_0x8273('0x1b')]===_0x8273('0x1a');var _0x3fa117=_0xe54643['count'];var _0x19a7e9=_0x565c30?0x0:_0x5d681d['offset'];var _0x2cd81b=_0x565c30?_0xe54643[_0x8273('0x1c')]:_0x5d681d[_0x8273('0x1d')]+_0x5d681d['limit'];var _0x1742bd;if(_0x2cd81b>=_0x3fa117){_0x2cd81b=_0x3fa117;_0x1742bd=0xc8;}else{_0x1742bd=0xce;}_0x2fa9aa[_0x8273('0x19')](_0x1742bd);return _0x2fa9aa['set'](_0x8273('0x1e'),_0x19a7e9+'-'+_0x2cd81b+'/'+_0x3fa117)[_0x8273('0x1f')](_0xe54643);}return null;};}function patchUpdates(_0x5da216){return function(_0x48c396){try{jsonpatch[_0x8273('0x20')](_0x48c396,_0x5da216,!![]);}catch(_0x4ca507){return BPromise['reject'](_0x4ca507);}return _0x48c396['save']();};}function saveUpdates(_0x255b69,_0x39a75b){return function(_0xf99cbb){if(_0xf99cbb){return _0xf99cbb[_0x8273('0x21')](_0x255b69)['then'](function(_0x24ff02){return _0x24ff02;});}return null;};}function removeEntity(_0x4e5a60,_0x30dbc8){return function(_0x29da7b){if(_0x29da7b){return _0x29da7b[_0x8273('0x22')]()[_0x8273('0x23')](function(){var _0x3a9c52=_0x29da7b['get']({'plain':!![]});var _0x33319a=_0x8273('0x24');return db[_0x8273('0x25')][_0x8273('0x22')]({'where':{'type':_0x33319a,'resourceId':_0x3a9c52['id']}})[_0x8273('0x23')](function(){return _0x29da7b;});})['then'](function(){_0x4e5a60[_0x8273('0x19')](0xcc)[_0x8273('0x26')]();});}};}function handleEntityNotFound(_0x176ff8,_0x57f873){return function(_0x5c0410){if(!_0x5c0410){_0x176ff8[_0x8273('0x18')](0x194);}return _0x5c0410;};}function handleError(_0x1beb13,_0x5d100b){_0x5d100b=_0x5d100b||0x1f4;return function(_0x513f1b){logger[_0x8273('0x27')](_0x513f1b['stack']);if(_0x513f1b[_0x8273('0x28')]){delete _0x513f1b[_0x8273('0x28')];}_0x1beb13[_0x8273('0x19')](_0x5d100b)[_0x8273('0x29')](_0x513f1b);};}exports[_0x8273('0x2a')]=function(_0xc7c64e,_0x310ebd){var _0x41e4ca={},_0x6296c7={},_0xcc9ee0={'count':0x0,'rows':[]};var _0x4c2d0b=_[_0x8273('0x2b')](db[_0x8273('0x2c')][_0x8273('0x2d')],function(_0x309bc1){return{'name':_0x309bc1[_0x8273('0x2e')],'type':_0x309bc1[_0x8273('0x2f')]['key']};});_0x6296c7[_0x8273('0x30')]=_[_0x8273('0x2b')](_0x4c2d0b,_0x8273('0x28'));_0x6296c7[_0x8273('0x31')]=_[_0x8273('0x32')](_0xc7c64e[_0x8273('0x31')]);_0x6296c7[_0x8273('0x33')]=_[_0x8273('0x34')](_0x6296c7[_0x8273('0x30')],_0x6296c7[_0x8273('0x31')]);_0x41e4ca['attributes']=_[_0x8273('0x34')](_0x6296c7['model'],qs[_0x8273('0x35')](_0xc7c64e['query']['fields']));_0x41e4ca[_0x8273('0x36')]=_0x41e4ca[_0x8273('0x36')][_0x8273('0x37')]?_0x41e4ca[_0x8273('0x36')]:_0x6296c7[_0x8273('0x30')];if(!_0xc7c64e['query']['hasOwnProperty'](_0x8273('0x38'))){_0x41e4ca[_0x8273('0x1b')]=qs['limit'](_0xc7c64e[_0x8273('0x31')][_0x8273('0x1b')]);_0x41e4ca[_0x8273('0x1d')]=qs['offset'](_0xc7c64e[_0x8273('0x31')]['offset']);}_0x41e4ca['order']=qs[_0x8273('0x39')](_0xc7c64e['query'][_0x8273('0x39')]);_0x41e4ca['where']=qs['filters'](_[_0x8273('0x3a')](_0xc7c64e['query'],_0x6296c7[_0x8273('0x33')]),_0x4c2d0b);if(_0xc7c64e[_0x8273('0x31')][_0x8273('0x3b')]){_0x41e4ca[_0x8273('0x3c')]=_[_0x8273('0x3d')](_0x41e4ca[_0x8273('0x3c')],{'$or':[{'key':{'$like':'%'+_0xc7c64e[_0x8273('0x31')][_0x8273('0x3b')]+'%'}},{'value':{'$like':'%'+_0xc7c64e['query'][_0x8273('0x3b')]+'%'}}]});}_0x41e4ca=_[_0x8273('0x3d')]({},_0x41e4ca,_0xc7c64e[_0x8273('0x3e')]);var _0x186116={'where':_0x41e4ca[_0x8273('0x3c')]};return db['CannedAnswer'][_0x8273('0x1c')](_0x186116)[_0x8273('0x23')](function(_0x568397){_0xcc9ee0[_0x8273('0x1c')]=_0x568397;if(_0xc7c64e[_0x8273('0x31')][_0x8273('0x3f')]){_0x41e4ca['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8273('0x40')](_0x41e4ca);})[_0x8273('0x23')](function(_0x3c8efc){_0xcc9ee0[_0x8273('0x41')]=_0x3c8efc;return _0xcc9ee0;})[_0x8273('0x23')](respondWithFilteredResult(_0x310ebd,_0x41e4ca))[_0x8273('0x42')](handleError(_0x310ebd,null));};exports['show']=function(_0x9246d8,_0x5809b4){var _0x5e018d={'raw':!![],'where':{'id':_0x9246d8[_0x8273('0x43')]['id']}},_0x372d84={};_0x372d84[_0x8273('0x30')]=_[_0x8273('0x32')](db[_0x8273('0x2c')][_0x8273('0x2d')]);_0x372d84['query']=_[_0x8273('0x32')](_0x9246d8[_0x8273('0x31')]);_0x372d84[_0x8273('0x33')]=_[_0x8273('0x34')](_0x372d84[_0x8273('0x30')],_0x372d84[_0x8273('0x31')]);_0x5e018d['attributes']=_['intersection'](_0x372d84[_0x8273('0x30')],qs[_0x8273('0x35')](_0x9246d8[_0x8273('0x31')]['fields']));_0x5e018d[_0x8273('0x36')]=_0x5e018d[_0x8273('0x36')][_0x8273('0x37')]?_0x5e018d['attributes']:_0x372d84[_0x8273('0x30')];if(_0x9246d8[_0x8273('0x31')][_0x8273('0x3f')]){_0x5e018d[_0x8273('0x44')]=[{'all':!![]}];}_0x5e018d=_[_0x8273('0x3d')]({},_0x5e018d,_0x9246d8[_0x8273('0x3e')]);return db[_0x8273('0x2c')]['find'](_0x5e018d)['then'](handleEntityNotFound(_0x5809b4,null))[_0x8273('0x23')](respondWithResult(_0x5809b4,null))[_0x8273('0x42')](handleError(_0x5809b4,null));};exports[_0x8273('0x21')]=function(_0x96025b,_0x6188e6){if(_0x96025b[_0x8273('0x45')]['id']){delete _0x96025b['body']['id'];}return db[_0x8273('0x2c')]['find']({'where':{'id':_0x96025b[_0x8273('0x43')]['id']}})[_0x8273('0x23')](handleEntityNotFound(_0x6188e6,null))['then'](saveUpdates(_0x96025b[_0x8273('0x45')],null))[_0x8273('0x23')](respondWithResult(_0x6188e6,null))[_0x8273('0x42')](handleError(_0x6188e6,null));};exports['destroy']=function(_0x18818e,_0x2be66f){return db[_0x8273('0x2c')][_0x8273('0x46')]({'where':{'id':_0x18818e[_0x8273('0x43')]['id']}})[_0x8273('0x23')](handleEntityNotFound(_0x2be66f,null))[_0x8273('0x23')](removeEntity(_0x2be66f,null))[_0x8273('0x42')](handleError(_0x2be66f,null));};exports['create']=function(_0x2f2075,_0x26f94f){var _0x3b18d1={'key':_0x2f2075[_0x8273('0x45')][_0x8273('0x47')]};if(_0x2f2075[_0x8273('0x45')][_0x8273('0x48')]){_0x3b18d1[_0x8273('0x48')]=_0x2f2075[_0x8273('0x45')][_0x8273('0x48')];}else if(_0x2f2075[_0x8273('0x45')][_0x8273('0x49')]){_0x3b18d1[_0x8273('0x49')]=_0x2f2075[_0x8273('0x45')][_0x8273('0x49')];}else if(_0x2f2075[_0x8273('0x45')][_0x8273('0x4a')]){_0x3b18d1['OpenchannelAccountId']=_0x2f2075[_0x8273('0x45')][_0x8273('0x4a')];}else if(_0x2f2075[_0x8273('0x45')]['ChatWebsiteId']){_0x3b18d1['ChatWebsiteId']=_0x2f2075[_0x8273('0x45')][_0x8273('0x4b')];}return db[_0x8273('0x2c')]['find']({'where':_0x3b18d1})['then'](function(_0xb68f1c){if(_0xb68f1c){throw new db[(_0x8273('0x4c'))][(_0x8273('0x4d'))](_0x8273('0x4e'));}return db[_0x8273('0x2c')]['create'](_0x2f2075['body']);})['then'](function(_0x37c58c){var _0x1bfa09=_0x2f2075[_0x8273('0x4f')]['get']({'plain':!![]});if(!_0x1bfa09)throw new Error(_0x8273('0x50'));if(_0x1bfa09['role']===_0x8273('0x4f')){var _0x17dbbe=_0x37c58c[_0x8273('0x51')]({'plain':!![]});return db[_0x8273('0x52')][_0x8273('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x1bfa09[_0x8273('0x53')]},'raw':!![]})['then'](function(_0x276160){if(_0x276160&&_0x276160[_0x8273('0x54')]===0x0){return db[_0x8273('0x25')][_0x8273('0x55')]({'name':_0x17dbbe[_0x8273('0x28')],'resourceId':_0x17dbbe['id'],'type':_0x276160['name'],'sectionId':_0x276160['id']},{})[_0x8273('0x23')](function(){return _0x37c58c;});}else{return _0x37c58c;}})[_0x8273('0x42')](function(_0x251cbf){logger[_0x8273('0x27')](_0x8273('0x56'),_0x251cbf);throw _0x251cbf;});}return _0x37c58c;})[_0x8273('0x23')](respondWithResult(_0x26f94f,0xc9))[_0x8273('0x42')](handleError(_0x26f94f,null));}; \ No newline at end of file +var _0x2d4f=['request-promise','moment','util','path','sox','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','name','index','CannedAnswer','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','role','UserProfileSection','userProfileId','create','error','eml-format','rimraf','zip-dir'];(function(_0x2b19b0,_0x8dc78f){var _0x589ccc=function(_0x43c058){while(--_0x43c058){_0x2b19b0['push'](_0x2b19b0['shift']());}};_0x589ccc(++_0x8dc78f);}(_0x2d4f,0x161));var _0xf2d4=function(_0x569fda,_0x4a16c7){_0x569fda=_0x569fda-0x0;var _0x5d31f9=_0x2d4f[_0x569fda];return _0x5d31f9;};'use strict';var emlformat=require(_0xf2d4('0x0'));var rimraf=require(_0xf2d4('0x1'));var zipdir=require(_0xf2d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2d4('0x3'));var moment=require(_0xf2d4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf2d4('0x5'));var path=require(_0xf2d4('0x6'));var sox=require(_0xf2d4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2d4('0x8'));var _=require(_0xf2d4('0x9'));var squel=require(_0xf2d4('0xa'));var crypto=require(_0xf2d4('0xb'));var jsforce=require(_0xf2d4('0xc'));var deskjs=require(_0xf2d4('0xd'));var toCsv=require(_0xf2d4('0xe'));var querystring=require(_0xf2d4('0xf'));var Papa=require('papaparse');var Redis=require(_0xf2d4('0x10'));var authService=require(_0xf2d4('0x11'));var qs=require(_0xf2d4('0x12'));var as=require(_0xf2d4('0x13'));var hardwareService=require(_0xf2d4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf2d4('0x15'));var config=require(_0xf2d4('0x16'));var licenseUtil=require(_0xf2d4('0x17'));var db=require(_0xf2d4('0x18'))['db'];function respondWithStatusCode(_0x53f2e0,_0x2fecfd){_0x2fecfd=_0x2fecfd||0xcc;return function(_0x44436a){if(_0x44436a){return _0x53f2e0[_0xf2d4('0x19')](_0x2fecfd);}return _0x53f2e0['status'](_0x2fecfd)[_0xf2d4('0x1a')]();};}function respondWithResult(_0x389194,_0x1f08d7){_0x1f08d7=_0x1f08d7||0xc8;return function(_0x165049){if(_0x165049){return _0x389194[_0xf2d4('0x1b')](_0x1f08d7)[_0xf2d4('0x1c')](_0x165049);}};}function respondWithFilteredResult(_0x3895b3,_0x573ecb){return function(_0x13711d){if(_0x13711d){var _0x5d1934=typeof _0x573ecb[_0xf2d4('0x1d')]==='undefined'&&typeof _0x573ecb['limit']===_0xf2d4('0x1e');var _0x39e344=_0x13711d['count'];var _0x53fcae=_0x5d1934?0x0:_0x573ecb[_0xf2d4('0x1d')];var _0x17274d=_0x5d1934?_0x13711d['count']:_0x573ecb[_0xf2d4('0x1d')]+_0x573ecb[_0xf2d4('0x1f')];var _0x385b14;if(_0x17274d>=_0x39e344){_0x17274d=_0x39e344;_0x385b14=0xc8;}else{_0x385b14=0xce;}_0x3895b3['status'](_0x385b14);return _0x3895b3[_0xf2d4('0x20')](_0xf2d4('0x21'),_0x53fcae+'-'+_0x17274d+'/'+_0x39e344)[_0xf2d4('0x1c')](_0x13711d);}return null;};}function patchUpdates(_0x397bcd){return function(_0x8069be){try{jsonpatch[_0xf2d4('0x22')](_0x8069be,_0x397bcd,!![]);}catch(_0x915ed3){return BPromise[_0xf2d4('0x23')](_0x915ed3);}return _0x8069be[_0xf2d4('0x24')]();};}function saveUpdates(_0x34069b,_0x368dad){return function(_0x53739f){if(_0x53739f){return _0x53739f[_0xf2d4('0x25')](_0x34069b)[_0xf2d4('0x26')](function(_0x17aba6){return _0x17aba6;});}return null;};}function removeEntity(_0x4eac30,_0x309fde){return function(_0x273098){if(_0x273098){return _0x273098[_0xf2d4('0x27')]()[_0xf2d4('0x26')](function(){var _0x3d847d=_0x273098[_0xf2d4('0x28')]({'plain':!![]});var _0x2dcde8=_0xf2d4('0x29');return db[_0xf2d4('0x2a')][_0xf2d4('0x27')]({'where':{'type':_0x2dcde8,'resourceId':_0x3d847d['id']}})[_0xf2d4('0x26')](function(){return _0x273098;});})[_0xf2d4('0x26')](function(){_0x4eac30[_0xf2d4('0x1b')](0xcc)[_0xf2d4('0x1a')]();});}};}function handleEntityNotFound(_0x4242e2,_0x2563df){return function(_0xf2ae7){if(!_0xf2ae7){_0x4242e2[_0xf2d4('0x19')](0x194);}return _0xf2ae7;};}function handleError(_0x1c5930,_0x1d797b){_0x1d797b=_0x1d797b||0x1f4;return function(_0x205151){logger['error'](_0x205151['stack']);if(_0x205151[_0xf2d4('0x2b')]){delete _0x205151[_0xf2d4('0x2b')];}_0x1c5930[_0xf2d4('0x1b')](_0x1d797b)['send'](_0x205151);};}exports[_0xf2d4('0x2c')]=function(_0x239061,_0x1903df){var _0x504adb={},_0x3f1853={},_0x2cf17b={'count':0x0,'rows':[]};var _0x497658=_['map'](db[_0xf2d4('0x2d')]['rawAttributes'],function(_0x5113c9){return{'name':_0x5113c9[_0xf2d4('0x2e')],'type':_0x5113c9[_0xf2d4('0x2f')][_0xf2d4('0x30')]};});_0x3f1853['model']=_['map'](_0x497658,_0xf2d4('0x2b'));_0x3f1853[_0xf2d4('0x31')]=_[_0xf2d4('0x32')](_0x239061[_0xf2d4('0x31')]);_0x3f1853['filters']=_[_0xf2d4('0x33')](_0x3f1853[_0xf2d4('0x34')],_0x3f1853[_0xf2d4('0x31')]);_0x504adb[_0xf2d4('0x35')]=_[_0xf2d4('0x33')](_0x3f1853[_0xf2d4('0x34')],qs[_0xf2d4('0x36')](_0x239061[_0xf2d4('0x31')][_0xf2d4('0x36')]));_0x504adb[_0xf2d4('0x35')]=_0x504adb['attributes'][_0xf2d4('0x37')]?_0x504adb[_0xf2d4('0x35')]:_0x3f1853[_0xf2d4('0x34')];if(!_0x239061[_0xf2d4('0x31')][_0xf2d4('0x38')](_0xf2d4('0x39'))){_0x504adb['limit']=qs[_0xf2d4('0x1f')](_0x239061[_0xf2d4('0x31')][_0xf2d4('0x1f')]);_0x504adb[_0xf2d4('0x1d')]=qs[_0xf2d4('0x1d')](_0x239061[_0xf2d4('0x31')][_0xf2d4('0x1d')]);}_0x504adb[_0xf2d4('0x3a')]=qs[_0xf2d4('0x3b')](_0x239061[_0xf2d4('0x31')][_0xf2d4('0x3b')]);_0x504adb[_0xf2d4('0x3c')]=qs[_0xf2d4('0x3d')](_[_0xf2d4('0x3e')](_0x239061[_0xf2d4('0x31')],_0x3f1853[_0xf2d4('0x3d')]),_0x497658);if(_0x239061[_0xf2d4('0x31')][_0xf2d4('0x3f')]){_0x504adb[_0xf2d4('0x3c')]=_['merge'](_0x504adb['where'],{'$or':[{'key':{'$like':'%'+_0x239061['query'][_0xf2d4('0x3f')]+'%'}},{'value':{'$like':'%'+_0x239061[_0xf2d4('0x31')][_0xf2d4('0x3f')]+'%'}}]});}_0x504adb=_['merge']({},_0x504adb,_0x239061[_0xf2d4('0x40')]);var _0x55073b={'where':_0x504adb[_0xf2d4('0x3c')]};return db[_0xf2d4('0x2d')]['count'](_0x55073b)[_0xf2d4('0x26')](function(_0x46b3d5){_0x2cf17b[_0xf2d4('0x41')]=_0x46b3d5;if(_0x239061[_0xf2d4('0x31')][_0xf2d4('0x42')]){_0x504adb[_0xf2d4('0x43')]=[{'all':!![]}];}return db[_0xf2d4('0x2d')][_0xf2d4('0x44')](_0x504adb);})[_0xf2d4('0x26')](function(_0xc0111a){_0x2cf17b[_0xf2d4('0x45')]=_0xc0111a;return _0x2cf17b;})['then'](respondWithFilteredResult(_0x1903df,_0x504adb))[_0xf2d4('0x46')](handleError(_0x1903df,null));};exports[_0xf2d4('0x47')]=function(_0x3fbfec,_0xdd4636){var _0x274231={'raw':!![],'where':{'id':_0x3fbfec[_0xf2d4('0x48')]['id']}},_0x69f950={};_0x69f950['model']=_['keys'](db[_0xf2d4('0x2d')][_0xf2d4('0x49')]);_0x69f950[_0xf2d4('0x31')]=_[_0xf2d4('0x32')](_0x3fbfec[_0xf2d4('0x31')]);_0x69f950[_0xf2d4('0x3d')]=_[_0xf2d4('0x33')](_0x69f950[_0xf2d4('0x34')],_0x69f950['query']);_0x274231[_0xf2d4('0x35')]=_[_0xf2d4('0x33')](_0x69f950[_0xf2d4('0x34')],qs['fields'](_0x3fbfec[_0xf2d4('0x31')][_0xf2d4('0x36')]));_0x274231[_0xf2d4('0x35')]=_0x274231[_0xf2d4('0x35')][_0xf2d4('0x37')]?_0x274231[_0xf2d4('0x35')]:_0x69f950[_0xf2d4('0x34')];if(_0x3fbfec['query']['includeAll']){_0x274231[_0xf2d4('0x43')]=[{'all':!![]}];}_0x274231=_[_0xf2d4('0x4a')]({},_0x274231,_0x3fbfec['options']);return db[_0xf2d4('0x2d')][_0xf2d4('0x4b')](_0x274231)['then'](handleEntityNotFound(_0xdd4636,null))[_0xf2d4('0x26')](respondWithResult(_0xdd4636,null))[_0xf2d4('0x46')](handleError(_0xdd4636,null));};exports[_0xf2d4('0x25')]=function(_0x54004c,_0x389ef2){if(_0x54004c[_0xf2d4('0x4c')]['id']){delete _0x54004c[_0xf2d4('0x4c')]['id'];}return db[_0xf2d4('0x2d')][_0xf2d4('0x4b')]({'where':{'id':_0x54004c[_0xf2d4('0x48')]['id']}})[_0xf2d4('0x26')](handleEntityNotFound(_0x389ef2,null))[_0xf2d4('0x26')](saveUpdates(_0x54004c[_0xf2d4('0x4c')],null))[_0xf2d4('0x26')](respondWithResult(_0x389ef2,null))['catch'](handleError(_0x389ef2,null));};exports[_0xf2d4('0x27')]=function(_0x256e0d,_0x571246){return db[_0xf2d4('0x2d')][_0xf2d4('0x4b')]({'where':{'id':_0x256e0d['params']['id']}})['then'](handleEntityNotFound(_0x571246,null))['then'](removeEntity(_0x571246,null))[_0xf2d4('0x46')](handleError(_0x571246,null));};exports['create']=function(_0x14e56b,_0x57f59c){var _0x3ae884={'key':_0x14e56b['body'][_0xf2d4('0x30')]};if(_0x14e56b[_0xf2d4('0x4c')][_0xf2d4('0x4d')]){_0x3ae884[_0xf2d4('0x4d')]=_0x14e56b[_0xf2d4('0x4c')][_0xf2d4('0x4d')];}else if(_0x14e56b[_0xf2d4('0x4c')][_0xf2d4('0x4e')]){_0x3ae884[_0xf2d4('0x4e')]=_0x14e56b[_0xf2d4('0x4c')][_0xf2d4('0x4e')];}else if(_0x14e56b[_0xf2d4('0x4c')]['OpenchannelAccountId']){_0x3ae884[_0xf2d4('0x4f')]=_0x14e56b[_0xf2d4('0x4c')]['OpenchannelAccountId'];}else if(_0x14e56b[_0xf2d4('0x4c')][_0xf2d4('0x50')]){_0x3ae884[_0xf2d4('0x50')]=_0x14e56b[_0xf2d4('0x4c')][_0xf2d4('0x50')];}return db['CannedAnswer'][_0xf2d4('0x4b')]({'where':_0x3ae884})['then'](function(_0x460ed3){if(_0x460ed3){throw new db[(_0xf2d4('0x51'))][(_0xf2d4('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf2d4('0x2d')]['create'](_0x14e56b['body']);})[_0xf2d4('0x26')](function(_0x5a1c66){var _0xb50fb=_0x14e56b[_0xf2d4('0x53')][_0xf2d4('0x28')]({'plain':!![]});if(!_0xb50fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb50fb[_0xf2d4('0x54')]===_0xf2d4('0x53')){var _0x3eb725=_0x5a1c66[_0xf2d4('0x28')]({'plain':!![]});return db[_0xf2d4('0x55')]['find']({'where':{'name':_0xf2d4('0x29'),'userProfileId':_0xb50fb[_0xf2d4('0x56')]},'raw':!![]})[_0xf2d4('0x26')](function(_0x4adb03){if(_0x4adb03&&_0x4adb03['autoAssociation']===0x0){return db[_0xf2d4('0x2a')][_0xf2d4('0x57')]({'name':_0x3eb725['name'],'resourceId':_0x3eb725['id'],'type':_0x4adb03[_0xf2d4('0x2b')],'sectionId':_0x4adb03['id']},{})[_0xf2d4('0x26')](function(){return _0x5a1c66;});}else{return _0x5a1c66;}})[_0xf2d4('0x46')](function(_0x5c2461){logger[_0xf2d4('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c2461);throw _0x5c2461;});}return _0x5a1c66;})[_0xf2d4('0x26')](respondWithResult(_0x57f59c,0xc9))[_0xf2d4('0x46')](handleError(_0x57f59c,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 4fe7a06..6088582 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 _0x180f=['bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x3cef7b,_0x5873d1){var _0x1d5f5b=function(_0x51c49a){while(--_0x51c49a){_0x3cef7b['push'](_0x3cef7b['shift']());}};_0x1d5f5b(++_0x5873d1);}(_0x180f,0x1a1));var _0xf180=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0x180f[_0x252328];return _0xaa85b7;};'use strict';var _=require(_0xf180('0x0'));var util=require('util');var logger=require(_0xf180('0x1'))(_0xf180('0x2'));var moment=require('moment');var BPromise=require(_0xf180('0x3'));var rp=require(_0xf180('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf180('0x5'));var attributes=require(_0xf180('0x6'));module[_0xf180('0x7')]=function(_0x4cc132,_0x36adff){return _0x4cc132[_0xf180('0x8')]('CannedAnswer',attributes,{'tableName':_0xf180('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf180('0xa'),'collate':_0xf180('0xb')});}; \ No newline at end of file +var _0x7114=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x36fae1,_0x31cbd8){var _0x3fd93a=function(_0x2c3f41){while(--_0x2c3f41){_0x36fae1['push'](_0x36fae1['shift']());}};_0x3fd93a(++_0x31cbd8);}(_0x7114,0xd2));var _0x4711=function(_0x9a730e,_0x35c6c2){_0x9a730e=_0x9a730e-0x0;var _0x192606=_0x7114[_0x9a730e];return _0x192606;};'use strict';var _=require(_0x4711('0x0'));var util=require(_0x4711('0x1'));var logger=require(_0x4711('0x2'))('api');var moment=require(_0x4711('0x3'));var BPromise=require(_0x4711('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4711('0x5'));var rimraf=require(_0x4711('0x6'));var config=require(_0x4711('0x7'));var attributes=require(_0x4711('0x8'));module[_0x4711('0x9')]=function(_0x43574d,_0x4096d9){return _0x43574d[_0x4711('0xa')]('CannedAnswer',attributes,{'tableName':_0x4711('0xb'),'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 b75dda4..cf3558f 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(_0x466ef1,_0x3d778a){var _0x4ab41e=function(_0x5e75de){while(--_0x5e75de){_0x466ef1['push'](_0x466ef1['shift']());}};_0x4ab41e(++_0x3d778a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x5d9483,_0x4d6b47){var _0x52f9ce=function(_0x2eaed8){while(--_0x2eaed8){_0x5d9483['push'](_0x5d9483['shift']());}};_0x52f9ce(++_0x4d6b47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 f53991d..04e524f 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 _0x42b4=['path','connect-timeout','express','Router','./cannedAnswer.controller','get','index','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x42b4,0xde));var _0x442b=function(_0xbef9c,_0x3f90a9){_0xbef9c=_0xbef9c-0x0;var _0x123135=_0x42b4[_0xbef9c];return _0x123135;};'use strict';var multer=require(_0x442b('0x0'));var util=require(_0x442b('0x1'));var path=require(_0x442b('0x2'));var timeout=require(_0x442b('0x3'));var express=require(_0x442b('0x4'));var router=express[_0x442b('0x5')]();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(_0x442b('0x6'));router[_0x442b('0x7')]('/',auth['isAuthenticated'](),controller[_0x442b('0x8')]);router[_0x442b('0x7')](_0x442b('0x9'),auth[_0x442b('0xa')](),controller['show']);router['post']('/',auth[_0x442b('0xa')](),controller['create']);router[_0x442b('0xb')](_0x442b('0x9'),auth[_0x442b('0xa')](),controller[_0x442b('0xc')]);router[_0x442b('0xd')](_0x442b('0x9'),auth[_0x442b('0xa')](),controller[_0x442b('0xe')]);module[_0x442b('0xf')]=router; \ No newline at end of file +var _0x3d82=['isAuthenticated','index','show','post','put','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x3d82,0x185));var _0x23d8=function(_0x2656b6,_0x469eb1){_0x2656b6=_0x2656b6-0x0;var _0x1c707d=_0x3d82[_0x2656b6];return _0x1c707d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23d8('0x0'));var timeout=require(_0x23d8('0x1'));var express=require(_0x23d8('0x2'));var router=express[_0x23d8('0x3')]();var fs_extra=require(_0x23d8('0x4'));var auth=require(_0x23d8('0x5'));var interaction=require(_0x23d8('0x6'));var config=require(_0x23d8('0x7'));var controller=require(_0x23d8('0x8'));router[_0x23d8('0x9')]('/',auth[_0x23d8('0xa')](),controller[_0x23d8('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x23d8('0xc')]);router[_0x23d8('0xd')]('/',auth[_0x23d8('0xa')](),controller['create']);router[_0x23d8('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x23d8('0xf')](_0x23d8('0x10'),auth[_0x23d8('0xa')](),controller[_0x23d8('0x11')]);module[_0x23d8('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 b5c97e8..b4d938a 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 _0x564a=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x534e1b,_0x3cae00){var _0x3ecc42=function(_0x5566e6){while(--_0x5566e6){_0x534e1b['push'](_0x534e1b['shift']());}};_0x3ecc42(++_0x3cae00);}(_0x564a,0x183));var _0xa564=function(_0x3e13a7,_0x4ceb4a){_0x3e13a7=_0x3e13a7-0x0;var _0x184524=_0x564a[_0x3e13a7];return _0x184524;};'use strict';var Sequelize=require(_0xa564('0x0'));module[_0xa564('0x1')]={'calldate':{'type':Sequelize[_0xa564('0x2')],'allowNull':![],'defaultValue':_0xa564('0x3')},'clid':{'type':Sequelize[_0xa564('0x4')]},'src':{'type':Sequelize[_0xa564('0x4')]},'dst':{'type':Sequelize[_0xa564('0x4')]},'dcontext':{'type':Sequelize[_0xa564('0x4')]},'channel':{'type':Sequelize[_0xa564('0x4')]},'dstchannel':{'type':Sequelize[_0xa564('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xa564('0x4')]},'duration':{'type':Sequelize[_0xa564('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa564('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa564('0x4')]},'amaflags':{'type':Sequelize[_0xa564('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa564('0x4')]},'userfield':{'type':Sequelize[_0xa564('0x4')]},'uniqueid':{'type':Sequelize[_0xa564('0x4')]},'linkedid':{'type':Sequelize[_0xa564('0x4')]},'sequence':{'type':Sequelize[_0xa564('0x4')]},'peeraccount':{'type':Sequelize[_0xa564('0x4')]},'type':{'type':Sequelize[_0xa564('0x4')]},'tag':{'type':Sequelize[_0xa564('0x4')]}}; \ No newline at end of file +var _0x8c1a=['INTEGER','sequelize','1970-01-01\x2000:00:01','STRING'];(function(_0x1b64e5,_0xceeb8f){var _0x2fc87a=function(_0x1ecf52){while(--_0x1ecf52){_0x1b64e5['push'](_0x1b64e5['shift']());}};_0x2fc87a(++_0xceeb8f);}(_0x8c1a,0x1ad));var _0xa8c1=function(_0x458ed6,_0x504646){_0x458ed6=_0x458ed6-0x0;var _0xa5dfd9=_0x8c1a[_0x458ed6];return _0xa5dfd9;};'use strict';var Sequelize=require(_0xa8c1('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xa8c1('0x1')},'clid':{'type':Sequelize[_0xa8c1('0x2')]},'src':{'type':Sequelize[_0xa8c1('0x2')]},'dst':{'type':Sequelize[_0xa8c1('0x2')]},'dcontext':{'type':Sequelize[_0xa8c1('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xa8c1('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xa8c1('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa8c1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xa8c1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa8c1('0x2')]},'userfield':{'type':Sequelize[_0xa8c1('0x2')]},'uniqueid':{'type':Sequelize[_0xa8c1('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xa8c1('0x2')]},'type':{'type':Sequelize[_0xa8c1('0x2')]},'tag':{'type':Sequelize[_0xa8c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 683f33b..3689cb9 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 _0xef17=['key','map','intersection','model','attributes','fields','length','query','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','offset','json','apply','reject','save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName'];(function(_0x593542,_0x289172){var _0x16adda=function(_0x22c58e){while(--_0x22c58e){_0x593542['push'](_0x593542['shift']());}};_0x16adda(++_0x289172);}(_0xef17,0x136));var _0x7ef1=function(_0x2ab240,_0x3a109c){_0x2ab240=_0x2ab240-0x0;var _0x269ce1=_0xef17[_0x2ab240];return _0x269ce1;};'use strict';var emlformat=require(_0x7ef1('0x0'));var rimraf=require(_0x7ef1('0x1'));var zipdir=require(_0x7ef1('0x2'));var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ef1('0xc'));var deskjs=require(_0x7ef1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ef1('0xe'));var Papa=require(_0x7ef1('0xf'));var Redis=require(_0x7ef1('0x10'));var authService=require(_0x7ef1('0x11'));var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7ef1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122c8a,_0x51e226){_0x51e226=_0x51e226||0xcc;return function(_0x36ddf9){if(_0x36ddf9){return _0x122c8a[_0x7ef1('0x16')](_0x51e226);}return _0x122c8a[_0x7ef1('0x17')](_0x51e226)[_0x7ef1('0x18')]();};}function respondWithResult(_0x39ea9c,_0x317125){_0x317125=_0x317125||0xc8;return function(_0x26e9fb){if(_0x26e9fb){return _0x39ea9c[_0x7ef1('0x17')](_0x317125)['json'](_0x26e9fb);}};}function respondWithFilteredResult(_0x4de80f,_0x267f0e){return function(_0x5d0499){if(_0x5d0499){var _0x20b843=typeof _0x267f0e[_0x7ef1('0x19')]==='undefined'&&typeof _0x267f0e['limit']==='undefined';var _0x300645=_0x5d0499['count'];var _0x3a5835=_0x20b843?0x0:_0x267f0e['offset'];var _0x5a7b2b=_0x20b843?_0x5d0499['count']:_0x267f0e[_0x7ef1('0x19')]+_0x267f0e['limit'];var _0x38c5a7;if(_0x5a7b2b>=_0x300645){_0x5a7b2b=_0x300645;_0x38c5a7=0xc8;}else{_0x38c5a7=0xce;}_0x4de80f[_0x7ef1('0x17')](_0x38c5a7);return _0x4de80f['set']('Content-Range',_0x3a5835+'-'+_0x5a7b2b+'/'+_0x300645)[_0x7ef1('0x1a')](_0x5d0499);}return null;};}function patchUpdates(_0x5490b9){return function(_0x458459){try{jsonpatch[_0x7ef1('0x1b')](_0x458459,_0x5490b9,!![]);}catch(_0x2f8164){return BPromise[_0x7ef1('0x1c')](_0x2f8164);}return _0x458459[_0x7ef1('0x1d')]();};}function saveUpdates(_0xf24942,_0x20887b){return function(_0xd71594){if(_0xd71594){return _0xd71594['update'](_0xf24942)[_0x7ef1('0x1e')](function(_0x3b118f){return _0x3b118f;});}return null;};}function removeEntity(_0x3f26fb,_0x3324d4){return function(_0x31b5bf){if(_0x31b5bf){return _0x31b5bf[_0x7ef1('0x1f')]()[_0x7ef1('0x1e')](function(){_0x3f26fb[_0x7ef1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1ace,_0x33e008){return function(_0x12ef5a){if(!_0x12ef5a){_0x4b1ace[_0x7ef1('0x16')](0x194);}return _0x12ef5a;};}function handleError(_0xcfce5e,_0x19c2c2){_0x19c2c2=_0x19c2c2||0x1f4;return function(_0x4cfa16){logger[_0x7ef1('0x20')](_0x4cfa16[_0x7ef1('0x21')]);if(_0x4cfa16[_0x7ef1('0x22')]){delete _0x4cfa16[_0x7ef1('0x22')];}_0xcfce5e[_0x7ef1('0x17')](_0x19c2c2)[_0x7ef1('0x23')](_0x4cfa16);};}exports[_0x7ef1('0x24')]=function(_0x58e7ee,_0x2e8f1b){var _0x4b0380={},_0x3306b0={},_0x2546bf={'count':0x0,'rows':[]};var _0x4b5fde=_['map'](db[_0x7ef1('0x25')][_0x7ef1('0x26')],function(_0x5ab3a5){return{'name':_0x5ab3a5[_0x7ef1('0x27')],'type':_0x5ab3a5['type'][_0x7ef1('0x28')]};});_0x3306b0['model']=_[_0x7ef1('0x29')](_0x4b5fde,_0x7ef1('0x22'));_0x3306b0['query']=_['keys'](_0x58e7ee['query']);_0x3306b0['filters']=_[_0x7ef1('0x2a')](_0x3306b0[_0x7ef1('0x2b')],_0x3306b0['query']);_0x4b0380[_0x7ef1('0x2c')]=_['intersection'](_0x3306b0['model'],qs[_0x7ef1('0x2d')](_0x58e7ee['query'][_0x7ef1('0x2d')]));_0x4b0380[_0x7ef1('0x2c')]=_0x4b0380[_0x7ef1('0x2c')][_0x7ef1('0x2e')]?_0x4b0380['attributes']:_0x3306b0[_0x7ef1('0x2b')];if(!_0x58e7ee[_0x7ef1('0x2f')]['hasOwnProperty']('nolimit')){_0x4b0380['limit']=qs['limit'](_0x58e7ee[_0x7ef1('0x2f')]['limit']);_0x4b0380[_0x7ef1('0x19')]=qs[_0x7ef1('0x19')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x19')]);}_0x4b0380[_0x7ef1('0x30')]=qs[_0x7ef1('0x31')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x31')]);_0x4b0380[_0x7ef1('0x32')]=qs[_0x7ef1('0x33')](_[_0x7ef1('0x34')](_0x58e7ee['query'],_0x3306b0[_0x7ef1('0x33')]),_0x4b5fde);if(_0x58e7ee[_0x7ef1('0x2f')]['filter']){_0x4b0380[_0x7ef1('0x32')]=_[_0x7ef1('0x35')](_0x4b0380[_0x7ef1('0x32')],{'$or':_[_0x7ef1('0x29')](_0x4b5fde,function(_0x8ef5b3){if(_0x8ef5b3['type']!==_0x7ef1('0x36')){var _0x1ccbfb={};_0x1ccbfb[_0x8ef5b3[_0x7ef1('0x22')]]={'$like':'%'+_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x37')]+'%'};return _0x1ccbfb;}})});}_0x4b0380=_[_0x7ef1('0x35')]({},_0x4b0380,_0x58e7ee[_0x7ef1('0x38')]);var _0x238aa7={'where':_0x4b0380[_0x7ef1('0x32')]};return db[_0x7ef1('0x25')][_0x7ef1('0x39')](_0x238aa7)[_0x7ef1('0x1e')](function(_0x2da912){_0x2546bf[_0x7ef1('0x39')]=_0x2da912;if(_0x58e7ee[_0x7ef1('0x2f')]['includeAll']){_0x4b0380[_0x7ef1('0x3a')]=[{'all':!![]}];}return db[_0x7ef1('0x25')][_0x7ef1('0x3b')](_0x4b0380);})[_0x7ef1('0x1e')](function(_0x3889d7){_0x2546bf[_0x7ef1('0x3c')]=_0x3889d7;return _0x2546bf;})[_0x7ef1('0x1e')](respondWithFilteredResult(_0x2e8f1b,_0x4b0380))[_0x7ef1('0x3d')](handleError(_0x2e8f1b,null));};exports[_0x7ef1('0x3e')]=function(_0x1cff0b,_0x3e5ecd){var _0x374bf5={'raw':!![],'where':{'id':_0x1cff0b['params']['id']}},_0x2fb6c4={};_0x2fb6c4[_0x7ef1('0x2b')]=_[_0x7ef1('0x3f')](db[_0x7ef1('0x25')][_0x7ef1('0x26')]);_0x2fb6c4[_0x7ef1('0x2f')]=_[_0x7ef1('0x3f')](_0x1cff0b['query']);_0x2fb6c4[_0x7ef1('0x33')]=_[_0x7ef1('0x2a')](_0x2fb6c4[_0x7ef1('0x2b')],_0x2fb6c4[_0x7ef1('0x2f')]);_0x374bf5[_0x7ef1('0x2c')]=_[_0x7ef1('0x2a')](_0x2fb6c4['model'],qs[_0x7ef1('0x2d')](_0x1cff0b[_0x7ef1('0x2f')][_0x7ef1('0x2d')]));_0x374bf5[_0x7ef1('0x2c')]=_0x374bf5['attributes'][_0x7ef1('0x2e')]?_0x374bf5['attributes']:_0x2fb6c4['model'];if(_0x1cff0b[_0x7ef1('0x2f')]['includeAll']){_0x374bf5[_0x7ef1('0x3a')]=[{'all':!![]}];}_0x374bf5=_['merge']({},_0x374bf5,_0x1cff0b[_0x7ef1('0x38')]);return db[_0x7ef1('0x25')][_0x7ef1('0x40')](_0x374bf5)[_0x7ef1('0x1e')](handleEntityNotFound(_0x3e5ecd,null))[_0x7ef1('0x1e')](respondWithResult(_0x3e5ecd,null))[_0x7ef1('0x3d')](handleError(_0x3e5ecd,null));};exports[_0x7ef1('0x41')]=function(_0x106096,_0x49e089){return db['Cdr'][_0x7ef1('0x41')](_0x106096[_0x7ef1('0x42')],{})['then'](respondWithResult(_0x49e089,0xc9))[_0x7ef1('0x3d')](handleError(_0x49e089,null));};exports[_0x7ef1('0x43')]=function(_0xd06ca9,_0x5ce876){if(_0xd06ca9['body']['id']){delete _0xd06ca9[_0x7ef1('0x42')]['id'];}return db['Cdr']['find']({'where':{'id':_0xd06ca9[_0x7ef1('0x44')]['id']}})[_0x7ef1('0x1e')](handleEntityNotFound(_0x5ce876,null))[_0x7ef1('0x1e')](saveUpdates(_0xd06ca9[_0x7ef1('0x42')],null))[_0x7ef1('0x1e')](respondWithResult(_0x5ce876,null))['catch'](handleError(_0x5ce876,null));};exports[_0x7ef1('0x1f')]=function(_0x4e425b,_0x350dde){return db['Cdr'][_0x7ef1('0x40')]({'where':{'id':_0x4e425b['params']['id']}})['then'](handleEntityNotFound(_0x350dde,null))[_0x7ef1('0x1e')](removeEntity(_0x350dde,null))['catch'](handleError(_0x350dde,null));};exports[_0x7ef1('0x45')]=function(_0x30a4ce,_0x54a0bb){return db[_0x7ef1('0x25')][_0x7ef1('0x45')]()[_0x7ef1('0x1e')](respondWithResult(_0x54a0bb,null))['catch'](handleError(_0x54a0bb,null));}; \ No newline at end of file +var _0x3eea=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x555d62,_0x39d807){_0x555d62=_0x555d62-0x0;var _0xaf9e44=_0x3eea[_0x555d62];return _0xaf9e44;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x2a')](_0x3fa094,'name');_0x78e581[_0xa3ee('0x31')]=_['keys'](_0x59c6f9[_0xa3ee('0x31')]);_0x78e581[_0xa3ee('0x32')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x33')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x4abf49[_0xa3ee('0x33')]=_0x4abf49['attributes'][_0xa3ee('0x35')]?_0x4abf49[_0xa3ee('0x33')]:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x36')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x31')]['limit']);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x37')]=qs[_0xa3ee('0x38')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x38')]);_0x4abf49[_0xa3ee('0x39')]=qs[_0xa3ee('0x32')](_[_0xa3ee('0x3a')](_0x59c6f9[_0xa3ee('0x31')],_0x78e581[_0xa3ee('0x32')]),_0x3fa094);if(_0x59c6f9['query'][_0xa3ee('0x3b')]){_0x4abf49[_0xa3ee('0x39')]=_[_0xa3ee('0x3c')](_0x4abf49[_0xa3ee('0x39')],{'$or':_['map'](_0x3fa094,function(_0x257627){if(_0x257627[_0xa3ee('0x2e')]!==_0xa3ee('0x3d')){var _0x5b95e3={};_0x5b95e3[_0x257627[_0xa3ee('0x27')]]={'$like':'%'+_0x59c6f9[_0xa3ee('0x31')]['filter']+'%'};return _0x5b95e3;}})});}_0x4abf49=_[_0xa3ee('0x3c')]({},_0x4abf49,_0x59c6f9[_0xa3ee('0x3e')]);var _0x4ef99a={'where':_0x4abf49[_0xa3ee('0x39')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x4ef99a)[_0xa3ee('0x23')](function(_0x1f0023){_0x481358[_0xa3ee('0x1c')]=_0x1f0023;if(_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x4abf49[_0xa3ee('0x40')]=[{'all':!![]}];}return db[_0xa3ee('0x2b')][_0xa3ee('0x41')](_0x4abf49);})['then'](function(_0x5aa4b3){_0x481358['rows']=_0x5aa4b3;return _0x481358;})[_0xa3ee('0x23')](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x42')](handleError(_0x5ba571,null));};exports['show']=function(_0xca106f,_0x425f69){var _0x279834={'raw':!![],'where':{'id':_0xca106f[_0xa3ee('0x43')]['id']}},_0x55f47f={};_0x55f47f['model']=_[_0xa3ee('0x44')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x55f47f[_0xa3ee('0x31')]=_[_0xa3ee('0x44')](_0xca106f[_0xa3ee('0x31')]);_0x55f47f[_0xa3ee('0x32')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],_0x55f47f[_0xa3ee('0x31')]);_0x279834[_0xa3ee('0x33')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x279834[_0xa3ee('0x33')]=_0x279834[_0xa3ee('0x33')]['length']?_0x279834[_0xa3ee('0x33')]:_0x55f47f[_0xa3ee('0x30')];if(_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x279834['include']=[{'all':!![]}];}_0x279834=_[_0xa3ee('0x3c')]({},_0x279834,_0xca106f['options']);return db[_0xa3ee('0x2b')][_0xa3ee('0x46')](_0x279834)[_0xa3ee('0x23')](handleEntityNotFound(_0x425f69,null))[_0xa3ee('0x23')](respondWithResult(_0x425f69,null))[_0xa3ee('0x42')](handleError(_0x425f69,null));};exports[_0xa3ee('0x47')]=function(_0xd723ad,_0xbb0148){return db[_0xa3ee('0x2b')][_0xa3ee('0x47')](_0xd723ad['body'],{})[_0xa3ee('0x23')](respondWithResult(_0xbb0148,0xc9))['catch'](handleError(_0xbb0148,null));};exports['update']=function(_0xaad29c,_0x2f7171){if(_0xaad29c[_0xa3ee('0x48')]['id']){delete _0xaad29c[_0xa3ee('0x48')]['id'];}return db[_0xa3ee('0x2b')][_0xa3ee('0x46')]({'where':{'id':_0xaad29c[_0xa3ee('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f7171,null))[_0xa3ee('0x23')](saveUpdates(_0xaad29c[_0xa3ee('0x48')],null))['then'](respondWithResult(_0x2f7171,null))[_0xa3ee('0x42')](handleError(_0x2f7171,null));};exports[_0xa3ee('0x24')]=function(_0x2f1db4,_0x5ec981){return db['Cdr'][_0xa3ee('0x46')]({'where':{'id':_0x2f1db4[_0xa3ee('0x43')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x5ec981,null))[_0xa3ee('0x23')](removeEntity(_0x5ec981,null))[_0xa3ee('0x42')](handleError(_0x5ec981,null));};exports['describe']=function(_0x55678e,_0x15b55e){return db[_0xa3ee('0x2b')]['describe']()[_0xa3ee('0x23')](respondWithResult(_0x15b55e,null))[_0xa3ee('0x42')](handleError(_0x15b55e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2f2ca5c..713c8a8 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x37df68,_0x528d67){var _0x1060d2=function(_0x21c861){while(--_0x21c861){_0x37df68['push'](_0x37df68['shift']());}};_0x1060d2(++_0x528d67);}(_0x7a54,0x106));var _0x47a5=function(_0x300d33,_0x5de136){_0x300d33=_0x300d33-0x0;var _0x1163bc=_0x7a54[_0x300d33];return _0x1163bc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x491698,_0x4da08e){var _0x8428b=function(_0x406128){while(--_0x406128){_0x491698['push'](_0x491698['shift']());}};_0x8428b(++_0x4da08e);}(_0x7a54,0x106));var _0x47a5=function(_0x47b745,_0x582faa){_0x47b745=_0x47b745-0x0;var _0x40933c=_0x7a54[_0x47b745];return _0x40933c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index caed66c..04db32c 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 _0x99dd=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xa8bf4a,_0x4f018d){var _0x3e39ae=function(_0xfa9b14){while(--_0xfa9b14){_0xa8bf4a['push'](_0xa8bf4a['shift']());}};_0x3e39ae(++_0x4f018d);}(_0x99dd,0x101));var _0xd99d=function(_0x11a7db,_0x2826ad){_0x11a7db=_0x11a7db-0x0;var _0x520c3c=_0x99dd[_0x11a7db];return _0x520c3c;};'use strict';var _=require(_0xd99d('0x0'));var util=require('util');var moment=require(_0xd99d('0x1'));var BPromise=require(_0xd99d('0x2'));var rs=require(_0xd99d('0x3'));var fs=require('fs');var Redis=require(_0xd99d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd99d('0x5'));var logger=require(_0xd99d('0x6'))(_0xd99d('0x7'));var config=require('../../config/environment');var jayson=require(_0xd99d('0x8'));var client=jayson[_0xd99d('0x9')][_0xd99d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4764f4,_0x448f3f,_0xf8b82f){return new BPromise(function(_0x1e725f,_0x4741fe){return client[_0xd99d('0xb')](_0x4764f4,_0xf8b82f)[_0xd99d('0xc')](function(_0x23d247){logger[_0xd99d('0xd')]('Cdr,\x20%s,\x20%s',_0x448f3f,_0xd99d('0xe'));logger['debug'](_0xd99d('0xf'),_0x448f3f,_0xd99d('0xe'),JSON[_0xd99d('0x10')](_0x23d247));if(_0x23d247['error']){if(_0x23d247[_0xd99d('0x11')][_0xd99d('0x12')]===0x1f4){logger['error'](_0xd99d('0x13'),_0x448f3f,_0x23d247[_0xd99d('0x11')][_0xd99d('0x14')]);return _0x4741fe(_0x23d247['error'][_0xd99d('0x14')]);}logger[_0xd99d('0x11')](_0xd99d('0x13'),_0x448f3f,_0x23d247[_0xd99d('0x11')][_0xd99d('0x14')]);return _0x1e725f(_0x23d247[_0xd99d('0x11')][_0xd99d('0x14')]);}else{logger[_0xd99d('0xd')](_0xd99d('0x13'),_0x448f3f,_0xd99d('0xe'));_0x1e725f(_0x23d247['result'][_0xd99d('0x14')]);}})[_0xd99d('0x15')](function(_0x5a3470){logger[_0xd99d('0x11')]('Cdr,\x20%s,\x20%s',_0x448f3f,_0x5a3470);_0x4741fe(_0x5a3470);});});} \ No newline at end of file +var _0x70c8=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x70c8,0x15b));var _0x870c=function(_0x430bbf,_0x2bc407){_0x430bbf=_0x430bbf-0x0;var _0x4bed0b=_0x70c8[_0x430bbf];return _0x4bed0b;};'use strict';var _=require(_0x870c('0x0'));var util=require(_0x870c('0x1'));var moment=require(_0x870c('0x2'));var BPromise=require('bluebird');var rs=require(_0x870c('0x3'));var fs=require('fs');var Redis=require(_0x870c('0x4'));var db=require(_0x870c('0x5'))['db'];var utils=require(_0x870c('0x6'));var logger=require(_0x870c('0x7'))(_0x870c('0x8'));var config=require(_0x870c('0x9'));var jayson=require(_0x870c('0xa'));var client=jayson[_0x870c('0xb')][_0x870c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x429b8b,_0x439f5e,_0x8849e){return new BPromise(function(_0x3b744c,_0x1a64b6){return client[_0x870c('0xd')](_0x429b8b,_0x8849e)['then'](function(_0x4e18a0){logger[_0x870c('0xe')]('Cdr,\x20%s,\x20%s',_0x439f5e,_0x870c('0xf'));logger['debug'](_0x870c('0x10'),_0x439f5e,_0x870c('0xf'),JSON['stringify'](_0x4e18a0));if(_0x4e18a0['error']){if(_0x4e18a0[_0x870c('0x11')][_0x870c('0x12')]===0x1f4){logger[_0x870c('0x11')](_0x870c('0x13'),_0x439f5e,_0x4e18a0['error'][_0x870c('0x14')]);return _0x1a64b6(_0x4e18a0['error'][_0x870c('0x14')]);}logger[_0x870c('0x11')](_0x870c('0x13'),_0x439f5e,_0x4e18a0[_0x870c('0x11')][_0x870c('0x14')]);return _0x3b744c(_0x4e18a0[_0x870c('0x11')]['message']);}else{logger['info'](_0x870c('0x13'),_0x439f5e,_0x870c('0xf'));_0x3b744c(_0x4e18a0[_0x870c('0x15')][_0x870c('0x14')]);}})[_0x870c('0x16')](function(_0x18f7f9){logger['error'](_0x870c('0x13'),_0x439f5e,_0x18f7f9);_0x1a64b6(_0x18f7f9);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 28c9ee8..688e125 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2126fa,_0x1864e3){var _0x3e638e=function(_0x275ebc){while(--_0x275ebc){_0x2126fa['push'](_0x2126fa['shift']());}};_0x3e638e(++_0x1864e3);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e9155,_0x38e9d2){_0x3e9155=_0x3e9155-0x0;var _0x5de67a=_0xb10b[_0x3e9155];return _0x5de67a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_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('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index b3157b0..c22a9c6 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 _0xae7d=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x261f66,_0x2233ec){var _0x5cfaa7=function(_0x3e19d7){while(--_0x3e19d7){_0x261f66['push'](_0x261f66['shift']());}};_0x5cfaa7(++_0x2233ec);}(_0xae7d,0x149));var _0xdae7=function(_0x311dbb,_0x2caaa8){_0x311dbb=_0x311dbb-0x0;var _0x5b1eed=_0xae7d[_0x311dbb];return _0x5b1eed;};'use strict';var Sequelize=require(_0xdae7('0x0'));module[_0xdae7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdae7('0x2')],'allowNull':![],'defaultValue':_0xdae7('0x3')},'appdata':{'type':Sequelize[_0xdae7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdae7('0x5')}}; \ No newline at end of file +var _0x2bc9=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2bc9,0x133));var _0x92bc=function(_0x5f5c59,_0x169b7c){_0x5f5c59=_0x5f5c59-0x0;var _0x5a5f48=_0x2bc9[_0x5f5c59];return _0x5a5f48;};'use strict';var Sequelize=require(_0x92bc('0x0'));module[_0x92bc('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x92bc('0x2')],'allowNull':![],'defaultValue':_0x92bc('0x3')},'appdata':{'type':Sequelize[_0x92bc('0x4')]()},'description':{'type':Sequelize[_0x92bc('0x2')]},'interval':{'type':Sequelize[_0x92bc('0x2')],'defaultValue':_0x92bc('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c0e543a..417b52d 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 _0xf972=['limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','show','keys','rawAttributes','query','intersection','attributes','model','fields','includeAll','include','options','ChatApplication','find','body','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x150e01,_0x2506b0){var _0x10fe1f=function(_0x4f1dbe){while(--_0x4f1dbe){_0x150e01['push'](_0x150e01['shift']());}};_0x10fe1f(++_0x2506b0);}(_0xf972,0x171));var _0x2f97=function(_0x271f87,_0x530ea2){_0x271f87=_0x271f87-0x0;var _0x448f19=_0xf972[_0x271f87];return _0x448f19;};'use strict';var emlformat=require(_0x2f97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f97('0x1'));var jsonpatch=require(_0x2f97('0x2'));var rp=require(_0x2f97('0x3'));var moment=require('moment');var BPromise=require(_0x2f97('0x4'));var Mustache=require(_0x2f97('0x5'));var util=require('util');var path=require(_0x2f97('0x6'));var sox=require(_0x2f97('0x7'));var csv=require(_0x2f97('0x8'));var ejs=require(_0x2f97('0x9'));var fs=require('fs');var fs_extra=require(_0x2f97('0xa'));var _=require(_0x2f97('0xb'));var squel=require(_0x2f97('0xc'));var crypto=require(_0x2f97('0xd'));var jsforce=require(_0x2f97('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f97('0xf'));var Papa=require(_0x2f97('0x10'));var Redis=require(_0x2f97('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2f97('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f97('0x13'))(_0x2f97('0x14'));var utils=require(_0x2f97('0x15'));var config=require(_0x2f97('0x16'));var licenseUtil=require(_0x2f97('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc41dff,_0x2c3c6b){_0x2c3c6b=_0x2c3c6b||0xcc;return function(_0x417c8f){if(_0x417c8f){return _0xc41dff[_0x2f97('0x18')](_0x2c3c6b);}return _0xc41dff[_0x2f97('0x19')](_0x2c3c6b)[_0x2f97('0x1a')]();};}function respondWithResult(_0x576850,_0x5559b8){_0x5559b8=_0x5559b8||0xc8;return function(_0x317314){if(_0x317314){return _0x576850[_0x2f97('0x19')](_0x5559b8)[_0x2f97('0x1b')](_0x317314);}};}function respondWithFilteredResult(_0x4d2cc7,_0x1de2b7){return function(_0x17df46){if(_0x17df46){var _0x2ffb8b=typeof _0x1de2b7[_0x2f97('0x1c')]===_0x2f97('0x1d')&&typeof _0x1de2b7[_0x2f97('0x1e')]==='undefined';var _0x12bf09=_0x17df46[_0x2f97('0x1f')];var _0x1e97f2=_0x2ffb8b?0x0:_0x1de2b7['offset'];var _0x52e1ab=_0x2ffb8b?_0x17df46['count']:_0x1de2b7[_0x2f97('0x1c')]+_0x1de2b7[_0x2f97('0x1e')];var _0x51c962;if(_0x52e1ab>=_0x12bf09){_0x52e1ab=_0x12bf09;_0x51c962=0xc8;}else{_0x51c962=0xce;}_0x4d2cc7[_0x2f97('0x19')](_0x51c962);return _0x4d2cc7['set'](_0x2f97('0x20'),_0x1e97f2+'-'+_0x52e1ab+'/'+_0x12bf09)['json'](_0x17df46);}return null;};}function patchUpdates(_0x51a45a){return function(_0x29e4a4){try{jsonpatch[_0x2f97('0x21')](_0x29e4a4,_0x51a45a,!![]);}catch(_0x1f6389){return BPromise['reject'](_0x1f6389);}return _0x29e4a4[_0x2f97('0x22')]();};}function saveUpdates(_0x54ab48,_0x39a332){return function(_0x55cef3){if(_0x55cef3){return _0x55cef3[_0x2f97('0x23')](_0x54ab48)[_0x2f97('0x24')](function(_0x460bc8){return _0x460bc8;});}return null;};}function removeEntity(_0x58941a,_0x5ac20c){return function(_0x10c1c1){if(_0x10c1c1){return _0x10c1c1[_0x2f97('0x25')]()[_0x2f97('0x24')](function(){_0x58941a[_0x2f97('0x19')](0xcc)[_0x2f97('0x1a')]();});}};}function handleEntityNotFound(_0x44a8fc,_0x1bad85){return function(_0x21d9d0){if(!_0x21d9d0){_0x44a8fc[_0x2f97('0x18')](0x194);}return _0x21d9d0;};}function handleError(_0x4713fe,_0x1c08d5){_0x1c08d5=_0x1c08d5||0x1f4;return function(_0x4a037d){logger[_0x2f97('0x26')](_0x4a037d[_0x2f97('0x27')]);if(_0x4a037d[_0x2f97('0x28')]){delete _0x4a037d['name'];}_0x4713fe['status'](_0x1c08d5)['send'](_0x4a037d);};}exports[_0x2f97('0x29')]=function(_0x222522,_0xa136bf){var _0x56cb81={'raw':!![],'where':{'id':_0x222522['params']['id']}},_0x480e26={};_0x480e26['model']=_[_0x2f97('0x2a')](db['ChatApplication'][_0x2f97('0x2b')]);_0x480e26['query']=_[_0x2f97('0x2a')](_0x222522[_0x2f97('0x2c')]);_0x480e26['filters']=_[_0x2f97('0x2d')](_0x480e26['model'],_0x480e26[_0x2f97('0x2c')]);_0x56cb81[_0x2f97('0x2e')]=_[_0x2f97('0x2d')](_0x480e26[_0x2f97('0x2f')],qs['fields'](_0x222522[_0x2f97('0x2c')][_0x2f97('0x30')]));_0x56cb81['attributes']=_0x56cb81[_0x2f97('0x2e')]['length']?_0x56cb81['attributes']:_0x480e26[_0x2f97('0x2f')];if(_0x222522[_0x2f97('0x2c')][_0x2f97('0x31')]){_0x56cb81[_0x2f97('0x32')]=[{'all':!![]}];}_0x56cb81=_['merge']({},_0x56cb81,_0x222522[_0x2f97('0x33')]);return db[_0x2f97('0x34')][_0x2f97('0x35')](_0x56cb81)[_0x2f97('0x24')](handleEntityNotFound(_0xa136bf,null))[_0x2f97('0x24')](respondWithResult(_0xa136bf,null))['catch'](handleError(_0xa136bf,null));};exports['update']=function(_0x32b589,_0x265613){if(_0x32b589[_0x2f97('0x36')]['id']){delete _0x32b589[_0x2f97('0x36')]['id'];}return db[_0x2f97('0x34')][_0x2f97('0x35')]({'where':{'id':_0x32b589[_0x2f97('0x37')]['id']}})[_0x2f97('0x24')](handleEntityNotFound(_0x265613,null))[_0x2f97('0x24')](saveUpdates(_0x32b589['body'],null))[_0x2f97('0x24')](respondWithResult(_0x265613,null))[_0x2f97('0x38')](handleError(_0x265613,null));};exports['destroy']=function(_0x9b1322,_0x2b0785){return db[_0x2f97('0x34')][_0x2f97('0x35')]({'where':{'id':_0x9b1322[_0x2f97('0x37')]['id']}})[_0x2f97('0x24')](handleEntityNotFound(_0x2b0785,null))['then'](removeEntity(_0x2b0785,null))[_0x2f97('0x38')](handleError(_0x2b0785,null));}; \ No newline at end of file +var _0x340c=['util','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','attributes','intersection','fields','include','merge','options','find','catch','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x322b4c,_0x5f00e5){var _0x5bdec4=function(_0x4da977){while(--_0x4da977){_0x322b4c['push'](_0x322b4c['shift']());}};_0x5bdec4(++_0x5f00e5);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc340('0x0'));var rimraf=require(_0xc340('0x1'));var zipdir=require(_0xc340('0x2'));var jsonpatch=require(_0xc340('0x3'));var rp=require('request-promise');var moment=require(_0xc340('0x4'));var BPromise=require(_0xc340('0x5'));var Mustache=require(_0xc340('0x6'));var util=require(_0xc340('0x7'));var path=require('path');var sox=require(_0xc340('0x8'));var csv=require(_0xc340('0x9'));var ejs=require(_0xc340('0xa'));var fs=require('fs');var fs_extra=require(_0xc340('0xb'));var _=require(_0xc340('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc340('0xd'));var toCsv=require(_0xc340('0x9'));var querystring=require('querystring');var Papa=require(_0xc340('0xe'));var Redis=require(_0xc340('0xf'));var authService=require(_0xc340('0x10'));var qs=require(_0xc340('0x11'));var as=require(_0xc340('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc340('0x13'))(_0xc340('0x14'));var utils=require(_0xc340('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc340('0x16'));var db=require(_0xc340('0x17'))['db'];function respondWithStatusCode(_0x3a88f0,_0x1a9f98){_0x1a9f98=_0x1a9f98||0xcc;return function(_0x2eae5f){if(_0x2eae5f){return _0x3a88f0['sendStatus'](_0x1a9f98);}return _0x3a88f0[_0xc340('0x18')](_0x1a9f98)[_0xc340('0x19')]();};}function respondWithResult(_0x340563,_0x10b317){_0x10b317=_0x10b317||0xc8;return function(_0x2f257b){if(_0x2f257b){return _0x340563['status'](_0x10b317)[_0xc340('0x1a')](_0x2f257b);}};}function respondWithFilteredResult(_0xff4069,_0x2609b2){return function(_0x27f7f1){if(_0x27f7f1){var _0x3576b7=typeof _0x2609b2['offset']===_0xc340('0x1b')&&typeof _0x2609b2[_0xc340('0x1c')]===_0xc340('0x1b');var _0x20913f=_0x27f7f1[_0xc340('0x1d')];var _0x51efe9=_0x3576b7?0x0:_0x2609b2[_0xc340('0x1e')];var _0x32286c=_0x3576b7?_0x27f7f1[_0xc340('0x1d')]:_0x2609b2['offset']+_0x2609b2['limit'];var _0x53c24c;if(_0x32286c>=_0x20913f){_0x32286c=_0x20913f;_0x53c24c=0xc8;}else{_0x53c24c=0xce;}_0xff4069[_0xc340('0x18')](_0x53c24c);return _0xff4069[_0xc340('0x1f')]('Content-Range',_0x51efe9+'-'+_0x32286c+'/'+_0x20913f)['json'](_0x27f7f1);}return null;};}function patchUpdates(_0x22e6ee){return function(_0x4a73af){try{jsonpatch[_0xc340('0x20')](_0x4a73af,_0x22e6ee,!![]);}catch(_0x450b05){return BPromise[_0xc340('0x21')](_0x450b05);}return _0x4a73af[_0xc340('0x22')]();};}function saveUpdates(_0x415f75,_0x435c28){return function(_0xe1a519){if(_0xe1a519){return _0xe1a519[_0xc340('0x23')](_0x415f75)[_0xc340('0x24')](function(_0x2bb7dc){return _0x2bb7dc;});}return null;};}function removeEntity(_0x5ac403,_0x10543e){return function(_0x250dbd){if(_0x250dbd){return _0x250dbd['destroy']()[_0xc340('0x24')](function(){_0x5ac403['status'](0xcc)[_0xc340('0x19')]();});}};}function handleEntityNotFound(_0x7852b1,_0x36ea03){return function(_0x57a615){if(!_0x57a615){_0x7852b1[_0xc340('0x25')](0x194);}return _0x57a615;};}function handleError(_0x1f0359,_0x33b1b5){_0x33b1b5=_0x33b1b5||0x1f4;return function(_0x183bfa){logger[_0xc340('0x26')](_0x183bfa[_0xc340('0x27')]);if(_0x183bfa[_0xc340('0x28')]){delete _0x183bfa['name'];}_0x1f0359['status'](_0x33b1b5)[_0xc340('0x29')](_0x183bfa);};}exports[_0xc340('0x2a')]=function(_0x34dd53,_0x17a567){var _0xa26821={'raw':!![],'where':{'id':_0x34dd53['params']['id']}},_0xf81b45={};_0xf81b45[_0xc340('0x2b')]=_[_0xc340('0x2c')](db[_0xc340('0x2d')][_0xc340('0x2e')]);_0xf81b45[_0xc340('0x2f')]=_[_0xc340('0x2c')](_0x34dd53[_0xc340('0x2f')]);_0xf81b45['filters']=_['intersection'](_0xf81b45[_0xc340('0x2b')],_0xf81b45[_0xc340('0x2f')]);_0xa26821[_0xc340('0x30')]=_[_0xc340('0x31')](_0xf81b45[_0xc340('0x2b')],qs[_0xc340('0x32')](_0x34dd53[_0xc340('0x2f')]['fields']));_0xa26821[_0xc340('0x30')]=_0xa26821[_0xc340('0x30')]['length']?_0xa26821[_0xc340('0x30')]:_0xf81b45[_0xc340('0x2b')];if(_0x34dd53[_0xc340('0x2f')]['includeAll']){_0xa26821[_0xc340('0x33')]=[{'all':!![]}];}_0xa26821=_[_0xc340('0x34')]({},_0xa26821,_0x34dd53[_0xc340('0x35')]);return db['ChatApplication'][_0xc340('0x36')](_0xa26821)[_0xc340('0x24')](handleEntityNotFound(_0x17a567,null))['then'](respondWithResult(_0x17a567,null))[_0xc340('0x37')](handleError(_0x17a567,null));};exports['update']=function(_0x309f2d,_0xe21856){if(_0x309f2d[_0xc340('0x38')]['id']){delete _0x309f2d['body']['id'];}return db[_0xc340('0x2d')][_0xc340('0x36')]({'where':{'id':_0x309f2d['params']['id']}})[_0xc340('0x24')](handleEntityNotFound(_0xe21856,null))[_0xc340('0x24')](saveUpdates(_0x309f2d[_0xc340('0x38')],null))[_0xc340('0x24')](respondWithResult(_0xe21856,null))[_0xc340('0x37')](handleError(_0xe21856,null));};exports[_0xc340('0x39')]=function(_0x1c37bb,_0x4ff8f8){return db[_0xc340('0x2d')][_0xc340('0x36')]({'where':{'id':_0x1c37bb[_0xc340('0x3a')]['id']}})[_0xc340('0x24')](handleEntityNotFound(_0x4ff8f8,null))[_0xc340('0x24')](removeEntity(_0x4ff8f8,null))[_0xc340('0x37')](handleError(_0x4ff8f8,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 06f5b11..635ab79 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 _0x7764=['moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatApplication','chat_applications','lodash','util','../../config/logger','api'];(function(_0x3dc587,_0x2ebc6c){var _0x29f93a=function(_0x5ab3d4){while(--_0x5ab3d4){_0x3dc587['push'](_0x3dc587['shift']());}};_0x29f93a(++_0x2ebc6c);}(_0x7764,0xa4));var _0x4776=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x7764[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var logger=require(_0x4776('0x2'))(_0x4776('0x3'));var moment=require(_0x4776('0x4'));var BPromise=require(_0x4776('0x5'));var rp=require(_0x4776('0x6'));var fs=require('fs');var path=require(_0x4776('0x7'));var rimraf=require(_0x4776('0x8'));var config=require(_0x4776('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0xc431bf,_0x3eff9c){return _0xc431bf['define'](_0x4776('0xa'),attributes,{'tableName':_0x4776('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x24ab=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x39e6cd,_0x1336d3){var _0x95a708=function(_0x1aaa68){while(--_0x1aaa68){_0x39e6cd['push'](_0x39e6cd['shift']());}};_0x95a708(++_0x1336d3);}(_0x24ab,0x13c));var _0xb24a=function(_0x571977,_0x93e567){_0x571977=_0x571977-0x0;var _0x217f4=_0x24ab[_0x571977];return _0x217f4;};'use strict';var _=require(_0xb24a('0x0'));var util=require('util');var logger=require(_0xb24a('0x1'))('api');var moment=require(_0xb24a('0x2'));var BPromise=require('bluebird');var rp=require(_0xb24a('0x3'));var fs=require('fs');var path=require(_0xb24a('0x4'));var rimraf=require(_0xb24a('0x5'));var config=require(_0xb24a('0x6'));var attributes=require(_0xb24a('0x7'));module[_0xb24a('0x8')]=function(_0x2cf1bc,_0x48acab){return _0x2cf1bc[_0xb24a('0x9')](_0xb24a('0xa'),attributes,{'tableName':_0xb24a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb24a('0xc'),'collate':_0xb24a('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index e2a9b57..46b583e 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 _0x86c6=['request','request\x20sent','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x86c6,0x16a));var _0x686c=function(_0x4465e5,_0x5dd37d){_0x4465e5=_0x4465e5-0x0;var _0x5dc02e=_0x86c6[_0x4465e5];return _0x5dc02e;};'use strict';var _=require(_0x686c('0x0'));var util=require(_0x686c('0x1'));var moment=require(_0x686c('0x2'));var BPromise=require(_0x686c('0x3'));var rs=require(_0x686c('0x4'));var fs=require('fs');var Redis=require(_0x686c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x686c('0x6'));var logger=require(_0x686c('0x7'))('rpc');var config=require(_0x686c('0x8'));var jayson=require(_0x686c('0x9'));var client=jayson[_0x686c('0xa')][_0x686c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd3688c,_0x51bf5b,_0x2aa4f3){return new BPromise(function(_0x502dba,_0x5ba453){return client[_0x686c('0xc')](_0xd3688c,_0x2aa4f3)['then'](function(_0x141a07){logger['info']('ChatApplication,\x20%s,\x20%s',_0x51bf5b,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x51bf5b,_0x686c('0xd'),JSON[_0x686c('0xe')](_0x141a07));if(_0x141a07[_0x686c('0xf')]){if(_0x141a07[_0x686c('0xf')][_0x686c('0x10')]===0x1f4){logger[_0x686c('0xf')](_0x686c('0x11'),_0x51bf5b,_0x141a07['error'][_0x686c('0x12')]);return _0x5ba453(_0x141a07['error']['message']);}logger['error'](_0x686c('0x11'),_0x51bf5b,_0x141a07[_0x686c('0xf')]['message']);return _0x502dba(_0x141a07['error']['message']);}else{logger[_0x686c('0x13')](_0x686c('0x11'),_0x51bf5b,_0x686c('0xd'));_0x502dba(_0x141a07[_0x686c('0x14')][_0x686c('0x12')]);}})[_0x686c('0x15')](function(_0x384d75){logger[_0x686c('0xf')](_0x686c('0x11'),_0x51bf5b,_0x384d75);_0x5ba453(_0x384d75);});});} \ No newline at end of file +var _0xdbd9=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xdbd9,0xbe));var _0x9dbd=function(_0x1093eb,_0x1104ae){_0x1093eb=_0x1093eb-0x0;var _0x131050=_0xdbd9[_0x1093eb];return _0x131050;};'use strict';var _=require('lodash');var util=require(_0x9dbd('0x0'));var moment=require('moment');var BPromise=require(_0x9dbd('0x1'));var rs=require(_0x9dbd('0x2'));var fs=require('fs');var Redis=require(_0x9dbd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dbd('0x4'));var logger=require(_0x9dbd('0x5'))(_0x9dbd('0x6'));var config=require(_0x9dbd('0x7'));var jayson=require(_0x9dbd('0x8'));var client=jayson['client'][_0x9dbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3913e6,_0x14e6b8,_0x3e0342){return new BPromise(function(_0x80d624,_0x498cf0){return client[_0x9dbd('0xa')](_0x3913e6,_0x3e0342)[_0x9dbd('0xb')](function(_0x1306ff){logger[_0x9dbd('0xc')](_0x9dbd('0xd'),_0x14e6b8,_0x9dbd('0xe'));logger[_0x9dbd('0xf')](_0x9dbd('0x10'),_0x14e6b8,_0x9dbd('0xe'),JSON[_0x9dbd('0x11')](_0x1306ff));if(_0x1306ff[_0x9dbd('0x12')]){if(_0x1306ff[_0x9dbd('0x12')]['code']===0x1f4){logger[_0x9dbd('0x12')](_0x9dbd('0xd'),_0x14e6b8,_0x1306ff[_0x9dbd('0x12')][_0x9dbd('0x13')]);return _0x498cf0(_0x1306ff[_0x9dbd('0x12')][_0x9dbd('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x14e6b8,_0x1306ff[_0x9dbd('0x12')][_0x9dbd('0x13')]);return _0x80d624(_0x1306ff['error'][_0x9dbd('0x13')]);}else{logger[_0x9dbd('0xc')](_0x9dbd('0xd'),_0x14e6b8,'request\x20sent');_0x80d624(_0x1306ff['result'][_0x9dbd('0x13')]);}})[_0x9dbd('0x14')](function(_0xd8097e){logger[_0x9dbd('0x12')](_0x9dbd('0xd'),_0x14e6b8,_0xd8097e);_0x498cf0(_0xd8097e);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 76b6d69..78cec00 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 _0xd229=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer'];(function(_0x3dd51f,_0x1339bf){var _0x212b0b=function(_0x57e824){while(--_0x57e824){_0x3dd51f['push'](_0x3dd51f['shift']());}};_0x212b0b(++_0x1339bf);}(_0xd229,0x1cf));var _0x9d22=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0xd229[_0x10c16d];return _0x5896f4;};'use strict';var multer=require(_0x9d22('0x0'));var util=require(_0x9d22('0x1'));var path=require(_0x9d22('0x2'));var timeout=require(_0x9d22('0x3'));var express=require(_0x9d22('0x4'));var router=express['Router']();var fs_extra=require(_0x9d22('0x5'));var auth=require(_0x9d22('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d22('0x7'));var controller=require(_0x9d22('0x8'));router['get'](_0x9d22('0x9'),auth[_0x9d22('0xa')](),controller[_0x9d22('0xb')]);router[_0x9d22('0xc')](_0x9d22('0x9'),auth[_0x9d22('0xa')](),controller[_0x9d22('0xd')]);router[_0x9d22('0xe')](_0x9d22('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9d22('0xf')]=router; \ No newline at end of file +var _0x5cde=['../../components/interaction/service','../../config/environment','get','isAuthenticated','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5883d0,_0x117938){var _0x27ab52=function(_0x14023c){while(--_0x14023c){_0x5883d0['push'](_0x5883d0['shift']());}};_0x27ab52(++_0x117938);}(_0x5cde,0x1d9));var _0xe5cd=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x5cde[_0x599e60];return _0x468e19;};'use strict';var multer=require(_0xe5cd('0x0'));var util=require(_0xe5cd('0x1'));var path=require(_0xe5cd('0x2'));var timeout=require(_0xe5cd('0x3'));var express=require('express');var router=express[_0xe5cd('0x4')]();var fs_extra=require(_0xe5cd('0x5'));var auth=require(_0xe5cd('0x6'));var interaction=require(_0xe5cd('0x7'));var config=require(_0xe5cd('0x8'));var controller=require('./chatApplication.controller');router[_0xe5cd('0x9')]('/:id',auth[_0xe5cd('0xa')](),controller['show']);router[_0xe5cd('0xb')]('/:id',auth[_0xe5cd('0xa')](),controller[_0xe5cd('0xc')]);router[_0xe5cd('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe5cd('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 8bec35c..091525a 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 _0x3157=['sequelize','exports','STRING'];(function(_0x1ff2a7,_0x4eec4d){var _0x2dce96=function(_0xd8c449){while(--_0xd8c449){_0x1ff2a7['push'](_0x1ff2a7['shift']());}};_0x2dce96(++_0x4eec4d);}(_0x3157,0x198));var _0x7315=function(_0xf12623,_0x3b8281){_0xf12623=_0xf12623-0x0;var _0x4397e9=_0x3157[_0xf12623];return _0x4397e9;};'use strict';var Sequelize=require(_0x7315('0x0'));module[_0x7315('0x1')]={'name':{'type':Sequelize[_0x7315('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7315('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4b24=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b24,0x8a));var _0x44b2=function(_0x31e48f,_0x319a31){_0x31e48f=_0x31e48f-0x0;var _0x36d6c2=_0x4b24[_0x31e48f];return _0x36d6c2;};'use strict';var Sequelize=require(_0x44b2('0x0'));module[_0x44b2('0x1')]={'name':{'type':Sequelize[_0x44b2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x44b2('0x2')]},'write':{'type':Sequelize[_0x44b2('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 398d182..c1d20b7 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 _0x2e8c=['user','toInteger','find','addMembers','omit','getMembers','rawAttributes','hasOwnProperty','removeMembers','ids','addMessage','getMessages','findOne','$gte','split','format','eml-format','rimraf','zip-dir','request-promise','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','show','params','create','body','describe','ChatInternalMessage'];(function(_0x1842e0,_0x52b7ed){var _0x53ec86=function(_0x1a5422){while(--_0x1a5422){_0x1842e0['push'](_0x1842e0['shift']());}};_0x53ec86(++_0x52b7ed);}(_0x2e8c,0x72));var _0xc2e8=function(_0x9131c7,_0x4615a5){_0x9131c7=_0x9131c7-0x0;var _0x72a014=_0x2e8c[_0x9131c7];return _0x72a014;};'use strict';var emlformat=require(_0xc2e8('0x0'));var rimraf=require(_0xc2e8('0x1'));var zipdir=require(_0xc2e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc2e8('0x4'));var util=require('util');var path=require(_0xc2e8('0x5'));var sox=require('sox');var csv=require(_0xc2e8('0x6'));var ejs=require(_0xc2e8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2e8('0x8'));var squel=require('squel');var crypto=require(_0xc2e8('0x9'));var jsforce=require(_0xc2e8('0xa'));var deskjs=require(_0xc2e8('0xb'));var toCsv=require(_0xc2e8('0x6'));var querystring=require(_0xc2e8('0xc'));var Papa=require(_0xc2e8('0xd'));var Redis=require(_0xc2e8('0xe'));var authService=require(_0xc2e8('0xf'));var qs=require(_0xc2e8('0x10'));var as=require(_0xc2e8('0x11'));var hardwareService=require(_0xc2e8('0x12'));var logger=require(_0xc2e8('0x13'))(_0xc2e8('0x14'));var utils=require(_0xc2e8('0x15'));var config=require(_0xc2e8('0x16'));var licenseUtil=require(_0xc2e8('0x17'));var db=require(_0xc2e8('0x18'))['db'];config[_0xc2e8('0x19')]=_[_0xc2e8('0x1a')](config[_0xc2e8('0x19')],{'host':_0xc2e8('0x1b'),'port':0x18eb});var socket=require(_0xc2e8('0x1c'))(new Redis(config['redis']));require(_0xc2e8('0x1d'))[_0xc2e8('0x1e')](socket);function respondWithStatusCode(_0x3e665e,_0x17d397){_0x17d397=_0x17d397||0xcc;return function(_0x4594e4){if(_0x4594e4){return _0x3e665e['sendStatus'](_0x17d397);}return _0x3e665e[_0xc2e8('0x1f')](_0x17d397)[_0xc2e8('0x20')]();};}function respondWithResult(_0x35a0f8,_0x2fd9a9){_0x2fd9a9=_0x2fd9a9||0xc8;return function(_0x35b595){if(_0x35b595){return _0x35a0f8[_0xc2e8('0x1f')](_0x2fd9a9)[_0xc2e8('0x21')](_0x35b595);}};}function respondWithFilteredResult(_0x4fe9dd,_0x48a91c){return function(_0x4580f3){if(_0x4580f3){var _0x41544d=typeof _0x48a91c['offset']===_0xc2e8('0x22')&&typeof _0x48a91c['limit']===_0xc2e8('0x22');var _0x115cfa=_0x4580f3[_0xc2e8('0x23')];var _0x396a17=_0x41544d?0x0:_0x48a91c[_0xc2e8('0x24')];var _0x399fa7=_0x41544d?_0x4580f3[_0xc2e8('0x23')]:_0x48a91c['offset']+_0x48a91c['limit'];var _0x2ad568;if(_0x399fa7>=_0x115cfa){_0x399fa7=_0x115cfa;_0x2ad568=0xc8;}else{_0x2ad568=0xce;}_0x4fe9dd[_0xc2e8('0x1f')](_0x2ad568);return _0x4fe9dd[_0xc2e8('0x25')](_0xc2e8('0x26'),_0x396a17+'-'+_0x399fa7+'/'+_0x115cfa)[_0xc2e8('0x21')](_0x4580f3);}return null;};}function patchUpdates(_0xa170b1){return function(_0x5b0196){try{jsonpatch[_0xc2e8('0x27')](_0x5b0196,_0xa170b1,!![]);}catch(_0x3ba06c){return BPromise[_0xc2e8('0x28')](_0x3ba06c);}return _0x5b0196[_0xc2e8('0x29')]();};}function saveUpdates(_0x2a3c4d,_0x430cb9){return function(_0x5d7a69){if(_0x5d7a69){return _0x5d7a69[_0xc2e8('0x2a')](_0x2a3c4d)[_0xc2e8('0x2b')](function(_0x14d620){return _0x14d620;});}return null;};}function removeEntity(_0x36a3db,_0x5af782){return function(_0x4d768a){if(_0x4d768a){return _0x4d768a[_0xc2e8('0x2c')]()[_0xc2e8('0x2b')](function(){_0x36a3db[_0xc2e8('0x1f')](0xcc)[_0xc2e8('0x20')]();});}};}function handleEntityNotFound(_0x4b21f7,_0x298f78){return function(_0x4bbfed){if(!_0x4bbfed){_0x4b21f7['sendStatus'](0x194);}return _0x4bbfed;};}function handleError(_0x2e0f65,_0x428ff9){_0x428ff9=_0x428ff9||0x1f4;return function(_0x2caecf){logger[_0xc2e8('0x2d')](_0x2caecf[_0xc2e8('0x2e')]);if(_0x2caecf['name']){delete _0x2caecf[_0xc2e8('0x2f')];}_0x2e0f65['status'](_0x428ff9)[_0xc2e8('0x30')](_0x2caecf);};}exports['index']=function(_0x57952b,_0x421acc){var _0x146c54={},_0x17598c={},_0x2a902d={'count':0x0,'rows':[]};var _0x45b958=_[_0xc2e8('0x31')](db['ChatGroup']['rawAttributes'],function(_0x85c3ce){return{'name':_0x85c3ce[_0xc2e8('0x32')],'type':_0x85c3ce[_0xc2e8('0x33')][_0xc2e8('0x34')]};});_0x17598c[_0xc2e8('0x35')]=_[_0xc2e8('0x31')](_0x45b958,'name');_0x17598c['query']=_[_0xc2e8('0x36')](_0x57952b['query']);_0x17598c[_0xc2e8('0x37')]=_[_0xc2e8('0x38')](_0x17598c[_0xc2e8('0x35')],_0x17598c['query']);_0x146c54[_0xc2e8('0x39')]=_['intersection'](_0x17598c[_0xc2e8('0x35')],qs[_0xc2e8('0x3a')](_0x57952b[_0xc2e8('0x3b')][_0xc2e8('0x3a')]));_0x146c54[_0xc2e8('0x39')]=_0x146c54['attributes'][_0xc2e8('0x3c')]?_0x146c54[_0xc2e8('0x39')]:_0x17598c[_0xc2e8('0x35')];if(!_0x57952b['query']['hasOwnProperty'](_0xc2e8('0x3d'))){_0x146c54[_0xc2e8('0x3e')]=qs['limit'](_0x57952b['query'][_0xc2e8('0x3e')]);_0x146c54['offset']=qs[_0xc2e8('0x24')](_0x57952b['query']['offset']);}_0x146c54[_0xc2e8('0x3f')]=qs[_0xc2e8('0x40')](_0x57952b['query'][_0xc2e8('0x40')]);_0x146c54[_0xc2e8('0x41')]=qs[_0xc2e8('0x37')](_[_0xc2e8('0x42')](_0x57952b[_0xc2e8('0x3b')],_0x17598c[_0xc2e8('0x37')]),_0x45b958);if(_0x57952b[_0xc2e8('0x3b')][_0xc2e8('0x43')]){_0x146c54['where']=_[_0xc2e8('0x44')](_0x146c54[_0xc2e8('0x41')],{'$or':_[_0xc2e8('0x31')](_0x45b958,function(_0xa69c89){if(_0xa69c89['type']!==_0xc2e8('0x45')){var _0x212ce1={};_0x212ce1[_0xa69c89['name']]={'$like':'%'+_0x57952b['query'][_0xc2e8('0x43')]+'%'};return _0x212ce1;}})});}_0x146c54=_['merge']({},_0x146c54,_0x57952b[_0xc2e8('0x46')]);var _0x1ba340={'where':_0x146c54[_0xc2e8('0x41')]};return db[_0xc2e8('0x47')][_0xc2e8('0x23')](_0x1ba340)[_0xc2e8('0x2b')](function(_0x2444ee){_0x2a902d[_0xc2e8('0x23')]=_0x2444ee;if(_0x57952b[_0xc2e8('0x3b')][_0xc2e8('0x48')]){_0x146c54[_0xc2e8('0x49')]=[{'all':!![]}];}return db[_0xc2e8('0x47')]['findAll'](_0x146c54);})[_0xc2e8('0x2b')](function(_0x45beaa){_0x2a902d[_0xc2e8('0x4a')]=_0x45beaa;return _0x2a902d;})[_0xc2e8('0x2b')](respondWithFilteredResult(_0x421acc,_0x146c54))[_0xc2e8('0x4b')](handleError(_0x421acc,null));};exports[_0xc2e8('0x4c')]=function(_0x2c5303,_0x3a4361){var _0x47d534={'raw':!![],'where':{'id':_0x2c5303[_0xc2e8('0x4d')]['id']}},_0x1dfe26={};_0x1dfe26[_0xc2e8('0x35')]=_[_0xc2e8('0x36')](db[_0xc2e8('0x47')]['rawAttributes']);_0x1dfe26[_0xc2e8('0x3b')]=_['keys'](_0x2c5303[_0xc2e8('0x3b')]);_0x1dfe26[_0xc2e8('0x37')]=_[_0xc2e8('0x38')](_0x1dfe26[_0xc2e8('0x35')],_0x1dfe26[_0xc2e8('0x3b')]);_0x47d534[_0xc2e8('0x39')]=_[_0xc2e8('0x38')](_0x1dfe26[_0xc2e8('0x35')],qs[_0xc2e8('0x3a')](_0x2c5303[_0xc2e8('0x3b')][_0xc2e8('0x3a')]));_0x47d534['attributes']=_0x47d534[_0xc2e8('0x39')][_0xc2e8('0x3c')]?_0x47d534[_0xc2e8('0x39')]:_0x1dfe26[_0xc2e8('0x35')];if(_0x2c5303['query']['includeAll']){_0x47d534['include']=[{'all':!![]}];}_0x47d534=_['merge']({},_0x47d534,_0x2c5303[_0xc2e8('0x46')]);return db['ChatGroup']['find'](_0x47d534)[_0xc2e8('0x2b')](handleEntityNotFound(_0x3a4361,null))[_0xc2e8('0x2b')](respondWithResult(_0x3a4361,null))[_0xc2e8('0x4b')](handleError(_0x3a4361,null));};exports[_0xc2e8('0x4e')]=function(_0x203274,_0x79cf54){return db[_0xc2e8('0x47')][_0xc2e8('0x4e')](_0x203274[_0xc2e8('0x4f')],{})[_0xc2e8('0x2b')](respondWithResult(_0x79cf54,0xc9))[_0xc2e8('0x4b')](handleError(_0x79cf54,null));};exports[_0xc2e8('0x2a')]=function(_0x300bd9,_0x55ee74){if(_0x300bd9[_0xc2e8('0x4f')]['id']){delete _0x300bd9[_0xc2e8('0x4f')]['id'];}return db[_0xc2e8('0x47')]['find']({'where':{'id':_0x300bd9[_0xc2e8('0x4d')]['id']}})[_0xc2e8('0x2b')](handleEntityNotFound(_0x55ee74,null))[_0xc2e8('0x2b')](saveUpdates(_0x300bd9[_0xc2e8('0x4f')],null))[_0xc2e8('0x2b')](respondWithResult(_0x55ee74,null))[_0xc2e8('0x4b')](handleError(_0x55ee74,null));};exports[_0xc2e8('0x2c')]=function(_0x541fb8,_0x2e873b){return db[_0xc2e8('0x47')]['find']({'where':{'id':_0x541fb8[_0xc2e8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2e873b,null))[_0xc2e8('0x2b')](removeEntity(_0x2e873b,null))[_0xc2e8('0x4b')](handleError(_0x2e873b,null));};exports[_0xc2e8('0x50')]=function(_0x439d01,_0x273182){return db[_0xc2e8('0x47')][_0xc2e8('0x50')]()['then'](respondWithResult(_0x273182,null))[_0xc2e8('0x4b')](handleError(_0x273182,null));};exports['getUnread']=function(_0x38004d,_0xba2d01,_0x1d7321){return db[_0xc2e8('0x51')][_0xc2e8('0x23')]({'where':{'ChatGroupId':_0x38004d[_0xc2e8('0x4d')]['id'],'ToId':_0x38004d[_0xc2e8('0x52')]['id'],'read':![]}})[_0xc2e8('0x2b')](function(_0x1a9af7){return{'id':_[_0xc2e8('0x53')](_0x38004d['params']['id']),'count':_0x1a9af7};})[_0xc2e8('0x2b')](respondWithResult(_0xba2d01,null))[_0xc2e8('0x4b')](handleError(_0xba2d01,null));};exports['addMembers']=function(_0x2c015a,_0x4aadd2,_0x13e3d6){return db[_0xc2e8('0x47')][_0xc2e8('0x54')]({'where':{'id':_0x2c015a['params']['id']}})[_0xc2e8('0x2b')](handleEntityNotFound(_0x4aadd2,null))[_0xc2e8('0x2b')](function(_0xc506ff){if(_0xc506ff){return _0xc506ff[_0xc2e8('0x55')](_0x2c015a[_0xc2e8('0x4f')]['ids'],_[_0xc2e8('0x56')](_0x2c015a[_0xc2e8('0x4f')],['ids','id'])||{});}})[_0xc2e8('0x2b')](respondWithResult(_0x4aadd2,null))[_0xc2e8('0x4b')](handleError(_0x4aadd2,null));};exports[_0xc2e8('0x57')]=function(_0xafbf9e,_0xf3d597,_0x1e30da){var _0x546051={};var _0x1dbfed={};var _0x524b8f;var _0x16f13e;return db[_0xc2e8('0x47')]['findOne']({'where':{'id':_0xafbf9e[_0xc2e8('0x4d')]['id']}})[_0xc2e8('0x2b')](handleEntityNotFound(_0xf3d597,null))['then'](function(_0x646de1){if(_0x646de1){_0x524b8f=_0x646de1;_0x1dbfed[_0xc2e8('0x35')]=_[_0xc2e8('0x36')](db['User'][_0xc2e8('0x58')]);_0x1dbfed[_0xc2e8('0x3b')]=_[_0xc2e8('0x36')](_0xafbf9e[_0xc2e8('0x3b')]);_0x1dbfed[_0xc2e8('0x37')]=_['intersection'](_0x1dbfed[_0xc2e8('0x35')],_0x1dbfed['query']);_0x546051[_0xc2e8('0x39')]=_['intersection'](_0x1dbfed[_0xc2e8('0x35')],qs[_0xc2e8('0x3a')](_0xafbf9e[_0xc2e8('0x3b')][_0xc2e8('0x3a')]));_0x546051[_0xc2e8('0x39')]=_0x546051[_0xc2e8('0x39')][_0xc2e8('0x3c')]?_0x546051[_0xc2e8('0x39')]:_0x1dbfed[_0xc2e8('0x35')];_0x546051[_0xc2e8('0x3f')]=qs[_0xc2e8('0x40')](_0xafbf9e[_0xc2e8('0x3b')][_0xc2e8('0x40')]);_0x546051['where']=qs[_0xc2e8('0x37')](_[_0xc2e8('0x42')](_0xafbf9e[_0xc2e8('0x3b')],_0x1dbfed[_0xc2e8('0x37')]));if(_0xafbf9e[_0xc2e8('0x3b')]['filter']){_0x546051[_0xc2e8('0x41')]=_[_0xc2e8('0x44')](_0x546051[_0xc2e8('0x41')],{'$or':_[_0xc2e8('0x31')](_0x546051[_0xc2e8('0x39')],function(_0x185da7){var _0x170cea={};_0x170cea[_0x185da7]={'$like':'%'+_0xafbf9e['query']['filter']+'%'};return _0x170cea;})});}_0x546051=_['merge']({},_0x546051,_0xafbf9e[_0xc2e8('0x46')]);return _0x524b8f[_0xc2e8('0x57')](_0x546051);}})[_0xc2e8('0x2b')](function(_0x3f7136){if(_0x3f7136){_0x16f13e=_0x3f7136[_0xc2e8('0x3c')];if(!_0xafbf9e[_0xc2e8('0x3b')][_0xc2e8('0x59')](_0xc2e8('0x3d'))){_0x546051['limit']=qs[_0xc2e8('0x3e')](_0xafbf9e[_0xc2e8('0x3b')][_0xc2e8('0x3e')]);_0x546051[_0xc2e8('0x24')]=qs[_0xc2e8('0x24')](_0xafbf9e[_0xc2e8('0x3b')][_0xc2e8('0x24')]);}return _0x524b8f[_0xc2e8('0x57')](_0x546051);}})[_0xc2e8('0x2b')](function(_0x34c513){if(_0x34c513){return _0x34c513?{'count':_0x16f13e,'rows':_0x34c513}:null;}})['then'](respondWithResult(_0xf3d597,null))[_0xc2e8('0x4b')](handleError(_0xf3d597,null));};exports[_0xc2e8('0x5a')]=function(_0x3825b7,_0x4f3e51,_0x419c8b){return db[_0xc2e8('0x47')][_0xc2e8('0x54')]({'where':{'id':_0x3825b7[_0xc2e8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f3e51,null))[_0xc2e8('0x2b')](function(_0xab67e4){if(_0xab67e4){return _0xab67e4[_0xc2e8('0x5a')](_0x3825b7['query'][_0xc2e8('0x5b')]);}})[_0xc2e8('0x2b')](respondWithStatusCode(_0x4f3e51,null))[_0xc2e8('0x4b')](handleError(_0x4f3e51,null));};exports[_0xc2e8('0x5c')]=function(_0x564f91,_0x37fc55,_0x40d990){if(_0x564f91['body']['id']){delete _0x564f91[_0xc2e8('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x564f91[_0xc2e8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37fc55,null))[_0xc2e8('0x2b')](function(_0x1b40df){if(_0x1b40df){_0x564f91[_0xc2e8('0x4f')]['ChatGroupId']=_0x1b40df['id'];return db[_0xc2e8('0x51')][_0xc2e8('0x4e')](_0x564f91['body']);}})[_0xc2e8('0x2b')](respondWithResult(_0x37fc55,null))[_0xc2e8('0x4b')](handleError(_0x37fc55,null));};exports[_0xc2e8('0x5d')]=function(_0xc71d67,_0x595d42,_0x298d39){var _0x2a65f3={};var _0x1f7838={};var _0x491f3a;var _0x574ceb;return db[_0xc2e8('0x47')][_0xc2e8('0x5e')]({'where':{'id':_0xc71d67[_0xc2e8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x595d42,null))[_0xc2e8('0x2b')](function(_0x30e4e1){if(_0x30e4e1){_0x491f3a=_0x30e4e1;_0x1f7838[_0xc2e8('0x35')]=_[_0xc2e8('0x36')](db['ChatInternalMessage'][_0xc2e8('0x58')]);_0x1f7838[_0xc2e8('0x3b')]=_[_0xc2e8('0x36')](_0xc71d67['query']);_0x1f7838['filters']=_[_0xc2e8('0x38')](_0x1f7838[_0xc2e8('0x35')],_0x1f7838[_0xc2e8('0x3b')]);_0x2a65f3[_0xc2e8('0x39')]=_['intersection'](_0x1f7838[_0xc2e8('0x35')],qs[_0xc2e8('0x3a')](_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x3a')]));_0x2a65f3[_0xc2e8('0x39')]=_0x2a65f3[_0xc2e8('0x39')][_0xc2e8('0x3c')]?_0x2a65f3[_0xc2e8('0x39')]:_0x1f7838[_0xc2e8('0x35')];_0x2a65f3[_0xc2e8('0x3f')]=qs['sort'](_0xc71d67['query'][_0xc2e8('0x40')]);_0x2a65f3[_0xc2e8('0x41')]=qs[_0xc2e8('0x37')](_[_0xc2e8('0x42')](_0xc71d67[_0xc2e8('0x3b')],_0x1f7838[_0xc2e8('0x37')]));if(_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x43')]){_0x2a65f3[_0xc2e8('0x41')]=_['merge'](_0x2a65f3[_0xc2e8('0x41')],{'$or':_['map'](_0x2a65f3[_0xc2e8('0x39')],function(_0x1afb30){var _0x1a4002={};_0x1a4002[_0x1afb30]={'$like':'%'+_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x43')]+'%'};return _0x1a4002;})});}if(_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x5f')]){var _0x436dbc=_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x5f')][_0xc2e8('0x60')](',');var _0x42de83={};_0x42de83[_0x436dbc[0x0]]={'$gte':moment(_0x436dbc[0x1])[_0xc2e8('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2a65f3[_0xc2e8('0x41')]=_['merge'](_0x2a65f3[_0xc2e8('0x41')],_0x42de83);}_0x2a65f3=_[_0xc2e8('0x44')]({},_0x2a65f3,_0xc71d67[_0xc2e8('0x46')]);return _0x491f3a['getMessages'](_0x2a65f3);}})[_0xc2e8('0x2b')](function(_0x2f1692){if(_0x2f1692){_0x574ceb=_0x2f1692[_0xc2e8('0x3c')];if(!_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x59')](_0xc2e8('0x3d'))){_0x2a65f3[_0xc2e8('0x3e')]=qs['limit'](_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x3e')]);_0x2a65f3[_0xc2e8('0x24')]=qs[_0xc2e8('0x24')](_0xc71d67[_0xc2e8('0x3b')][_0xc2e8('0x24')]);}return _0x491f3a['getMessages'](_0x2a65f3);}})[_0xc2e8('0x2b')](function(_0x45ab3b){if(_0x45ab3b){return _0x45ab3b?{'count':_0x574ceb,'rows':_0x45ab3b}:null;}})['then'](respondWithResult(_0x595d42,null))[_0xc2e8('0x4b')](handleError(_0x595d42,null));}; \ No newline at end of file +var _0xae83=['ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','catch','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x4d4f61,_0x56d7a7){var _0x297414=function(_0x30d055){while(--_0x30d055){_0x4d4f61['push'](_0x4d4f61['shift']());}};_0x297414(++_0x56d7a7);}(_0xae83,0x1dc));var _0x3ae8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae83[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3ae8('0x0'));var rimraf=require(_0x3ae8('0x1'));var zipdir=require(_0x3ae8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ae8('0x3'));var moment=require(_0x3ae8('0x4'));var BPromise=require(_0x3ae8('0x5'));var Mustache=require(_0x3ae8('0x6'));var util=require(_0x3ae8('0x7'));var path=require('path');var sox=require(_0x3ae8('0x8'));var csv=require(_0x3ae8('0x9'));var ejs=require(_0x3ae8('0xa'));var fs=require('fs');var fs_extra=require(_0x3ae8('0xb'));var _=require(_0x3ae8('0xc'));var squel=require(_0x3ae8('0xd'));var crypto=require(_0x3ae8('0xe'));var jsforce=require(_0x3ae8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3ae8('0x9'));var querystring=require(_0x3ae8('0x10'));var Papa=require(_0x3ae8('0x11'));var Redis=require(_0x3ae8('0x12'));var authService=require(_0x3ae8('0x13'));var qs=require(_0x3ae8('0x14'));var as=require(_0x3ae8('0x15'));var hardwareService=require(_0x3ae8('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3ae8('0x17'));var licenseUtil=require(_0x3ae8('0x18'));var db=require(_0x3ae8('0x19'))['db'];config[_0x3ae8('0x1a')]=_[_0x3ae8('0x1b')](config[_0x3ae8('0x1a')],{'host':_0x3ae8('0x1c'),'port':0x18eb});var socket=require(_0x3ae8('0x1d'))(new Redis(config[_0x3ae8('0x1a')]));require(_0x3ae8('0x1e'))[_0x3ae8('0x1f')](socket);function respondWithStatusCode(_0x116119,_0x3d4a8f){_0x3d4a8f=_0x3d4a8f||0xcc;return function(_0x55ec5d){if(_0x55ec5d){return _0x116119[_0x3ae8('0x20')](_0x3d4a8f);}return _0x116119[_0x3ae8('0x21')](_0x3d4a8f)[_0x3ae8('0x22')]();};}function respondWithResult(_0x2c420d,_0x332fc9){_0x332fc9=_0x332fc9||0xc8;return function(_0x7d6ed3){if(_0x7d6ed3){return _0x2c420d[_0x3ae8('0x21')](_0x332fc9)[_0x3ae8('0x23')](_0x7d6ed3);}};}function respondWithFilteredResult(_0xaae84c,_0x439c9c){return function(_0x324552){if(_0x324552){var _0x1a9fd0=typeof _0x439c9c[_0x3ae8('0x24')]===_0x3ae8('0x25')&&typeof _0x439c9c[_0x3ae8('0x26')]===_0x3ae8('0x25');var _0x12d73c=_0x324552[_0x3ae8('0x27')];var _0x137609=_0x1a9fd0?0x0:_0x439c9c[_0x3ae8('0x24')];var _0x590aa8=_0x1a9fd0?_0x324552[_0x3ae8('0x27')]:_0x439c9c[_0x3ae8('0x24')]+_0x439c9c[_0x3ae8('0x26')];var _0x446dac;if(_0x590aa8>=_0x12d73c){_0x590aa8=_0x12d73c;_0x446dac=0xc8;}else{_0x446dac=0xce;}_0xaae84c[_0x3ae8('0x21')](_0x446dac);return _0xaae84c[_0x3ae8('0x28')](_0x3ae8('0x29'),_0x137609+'-'+_0x590aa8+'/'+_0x12d73c)[_0x3ae8('0x23')](_0x324552);}return null;};}function patchUpdates(_0x44ecde){return function(_0x46cc0a){try{jsonpatch[_0x3ae8('0x2a')](_0x46cc0a,_0x44ecde,!![]);}catch(_0x43663c){return BPromise[_0x3ae8('0x2b')](_0x43663c);}return _0x46cc0a[_0x3ae8('0x2c')]();};}function saveUpdates(_0x524b2f,_0x142d34){return function(_0x507989){if(_0x507989){return _0x507989[_0x3ae8('0x2d')](_0x524b2f)['then'](function(_0x2fc18f){return _0x2fc18f;});}return null;};}function removeEntity(_0x3638b9,_0x5b073d){return function(_0x2de804){if(_0x2de804){return _0x2de804[_0x3ae8('0x2e')]()[_0x3ae8('0x2f')](function(){_0x3638b9['status'](0xcc)[_0x3ae8('0x22')]();});}};}function handleEntityNotFound(_0x46b3ab,_0x1bfbde){return function(_0xe225e3){if(!_0xe225e3){_0x46b3ab[_0x3ae8('0x20')](0x194);}return _0xe225e3;};}function handleError(_0x5795fa,_0x44b30d){_0x44b30d=_0x44b30d||0x1f4;return function(_0x1c7f30){logger[_0x3ae8('0x30')](_0x1c7f30[_0x3ae8('0x31')]);if(_0x1c7f30[_0x3ae8('0x32')]){delete _0x1c7f30[_0x3ae8('0x32')];}_0x5795fa[_0x3ae8('0x21')](_0x44b30d)[_0x3ae8('0x33')](_0x1c7f30);};}exports[_0x3ae8('0x34')]=function(_0x3c70f7,_0x4284c3){var _0x5fc7fa={},_0x291b52={},_0x4f4958={'count':0x0,'rows':[]};var _0x1773e8=_[_0x3ae8('0x35')](db[_0x3ae8('0x36')][_0x3ae8('0x37')],function(_0x333f47){return{'name':_0x333f47[_0x3ae8('0x38')],'type':_0x333f47[_0x3ae8('0x39')][_0x3ae8('0x3a')]};});_0x291b52[_0x3ae8('0x3b')]=_['map'](_0x1773e8,_0x3ae8('0x32'));_0x291b52[_0x3ae8('0x3c')]=_[_0x3ae8('0x3d')](_0x3c70f7[_0x3ae8('0x3c')]);_0x291b52[_0x3ae8('0x3e')]=_[_0x3ae8('0x3f')](_0x291b52[_0x3ae8('0x3b')],_0x291b52[_0x3ae8('0x3c')]);_0x5fc7fa[_0x3ae8('0x40')]=_[_0x3ae8('0x3f')](_0x291b52[_0x3ae8('0x3b')],qs[_0x3ae8('0x41')](_0x3c70f7[_0x3ae8('0x3c')][_0x3ae8('0x41')]));_0x5fc7fa[_0x3ae8('0x40')]=_0x5fc7fa[_0x3ae8('0x40')][_0x3ae8('0x42')]?_0x5fc7fa['attributes']:_0x291b52['model'];if(!_0x3c70f7[_0x3ae8('0x3c')]['hasOwnProperty'](_0x3ae8('0x43'))){_0x5fc7fa[_0x3ae8('0x26')]=qs[_0x3ae8('0x26')](_0x3c70f7[_0x3ae8('0x3c')][_0x3ae8('0x26')]);_0x5fc7fa[_0x3ae8('0x24')]=qs[_0x3ae8('0x24')](_0x3c70f7[_0x3ae8('0x3c')][_0x3ae8('0x24')]);}_0x5fc7fa[_0x3ae8('0x44')]=qs[_0x3ae8('0x45')](_0x3c70f7[_0x3ae8('0x3c')][_0x3ae8('0x45')]);_0x5fc7fa[_0x3ae8('0x46')]=qs['filters'](_[_0x3ae8('0x47')](_0x3c70f7[_0x3ae8('0x3c')],_0x291b52['filters']),_0x1773e8);if(_0x3c70f7[_0x3ae8('0x3c')]['filter']){_0x5fc7fa[_0x3ae8('0x46')]=_['merge'](_0x5fc7fa[_0x3ae8('0x46')],{'$or':_[_0x3ae8('0x35')](_0x1773e8,function(_0x666a85){if(_0x666a85[_0x3ae8('0x39')]!==_0x3ae8('0x48')){var _0x22b92b={};_0x22b92b[_0x666a85[_0x3ae8('0x32')]]={'$like':'%'+_0x3c70f7[_0x3ae8('0x3c')][_0x3ae8('0x49')]+'%'};return _0x22b92b;}})});}_0x5fc7fa=_[_0x3ae8('0x4a')]({},_0x5fc7fa,_0x3c70f7[_0x3ae8('0x4b')]);var _0x56fca5={'where':_0x5fc7fa[_0x3ae8('0x46')]};return db[_0x3ae8('0x36')][_0x3ae8('0x27')](_0x56fca5)[_0x3ae8('0x2f')](function(_0x2c760e){_0x4f4958['count']=_0x2c760e;if(_0x3c70f7['query'][_0x3ae8('0x4c')]){_0x5fc7fa[_0x3ae8('0x4d')]=[{'all':!![]}];}return db['ChatGroup'][_0x3ae8('0x4e')](_0x5fc7fa);})['then'](function(_0x517ce2){_0x4f4958[_0x3ae8('0x4f')]=_0x517ce2;return _0x4f4958;})[_0x3ae8('0x2f')](respondWithFilteredResult(_0x4284c3,_0x5fc7fa))['catch'](handleError(_0x4284c3,null));};exports[_0x3ae8('0x50')]=function(_0x93b9dc,_0x5c99fa){var _0x385d8c={'raw':!![],'where':{'id':_0x93b9dc[_0x3ae8('0x51')]['id']}},_0x14ac38={};_0x14ac38[_0x3ae8('0x3b')]=_[_0x3ae8('0x3d')](db[_0x3ae8('0x36')]['rawAttributes']);_0x14ac38[_0x3ae8('0x3c')]=_[_0x3ae8('0x3d')](_0x93b9dc[_0x3ae8('0x3c')]);_0x14ac38[_0x3ae8('0x3e')]=_[_0x3ae8('0x3f')](_0x14ac38['model'],_0x14ac38[_0x3ae8('0x3c')]);_0x385d8c[_0x3ae8('0x40')]=_[_0x3ae8('0x3f')](_0x14ac38[_0x3ae8('0x3b')],qs[_0x3ae8('0x41')](_0x93b9dc[_0x3ae8('0x3c')][_0x3ae8('0x41')]));_0x385d8c[_0x3ae8('0x40')]=_0x385d8c[_0x3ae8('0x40')][_0x3ae8('0x42')]?_0x385d8c[_0x3ae8('0x40')]:_0x14ac38[_0x3ae8('0x3b')];if(_0x93b9dc[_0x3ae8('0x3c')][_0x3ae8('0x4c')]){_0x385d8c[_0x3ae8('0x4d')]=[{'all':!![]}];}_0x385d8c=_[_0x3ae8('0x4a')]({},_0x385d8c,_0x93b9dc[_0x3ae8('0x4b')]);return db[_0x3ae8('0x36')][_0x3ae8('0x52')](_0x385d8c)[_0x3ae8('0x2f')](handleEntityNotFound(_0x5c99fa,null))[_0x3ae8('0x2f')](respondWithResult(_0x5c99fa,null))['catch'](handleError(_0x5c99fa,null));};exports[_0x3ae8('0x53')]=function(_0x3d2fc1,_0x37291c){return db['ChatGroup'][_0x3ae8('0x53')](_0x3d2fc1['body'],{})['then'](respondWithResult(_0x37291c,0xc9))[_0x3ae8('0x54')](handleError(_0x37291c,null));};exports['update']=function(_0x3ca2a4,_0x254452){if(_0x3ca2a4['body']['id']){delete _0x3ca2a4[_0x3ae8('0x55')]['id'];}return db[_0x3ae8('0x36')][_0x3ae8('0x52')]({'where':{'id':_0x3ca2a4[_0x3ae8('0x51')]['id']}})[_0x3ae8('0x2f')](handleEntityNotFound(_0x254452,null))[_0x3ae8('0x2f')](saveUpdates(_0x3ca2a4[_0x3ae8('0x55')],null))['then'](respondWithResult(_0x254452,null))[_0x3ae8('0x54')](handleError(_0x254452,null));};exports[_0x3ae8('0x2e')]=function(_0x45c281,_0x4308b8){return db['ChatGroup']['find']({'where':{'id':_0x45c281[_0x3ae8('0x51')]['id']}})[_0x3ae8('0x2f')](handleEntityNotFound(_0x4308b8,null))[_0x3ae8('0x2f')](removeEntity(_0x4308b8,null))[_0x3ae8('0x54')](handleError(_0x4308b8,null));};exports[_0x3ae8('0x56')]=function(_0x3c144c,_0x35cd88){return db[_0x3ae8('0x36')][_0x3ae8('0x56')]()[_0x3ae8('0x2f')](respondWithResult(_0x35cd88,null))[_0x3ae8('0x54')](handleError(_0x35cd88,null));};exports[_0x3ae8('0x57')]=function(_0x471360,_0x9101b5,_0x13e9e3){return db['ChatInternalMessage'][_0x3ae8('0x27')]({'where':{'ChatGroupId':_0x471360[_0x3ae8('0x51')]['id'],'ToId':_0x471360[_0x3ae8('0x58')]['id'],'read':![]}})[_0x3ae8('0x2f')](function(_0x57706e){return{'id':_[_0x3ae8('0x59')](_0x471360['params']['id']),'count':_0x57706e};})[_0x3ae8('0x2f')](respondWithResult(_0x9101b5,null))['catch'](handleError(_0x9101b5,null));};exports[_0x3ae8('0x5a')]=function(_0x40c084,_0x5903a9,_0x4a3db4){return db[_0x3ae8('0x36')][_0x3ae8('0x52')]({'where':{'id':_0x40c084[_0x3ae8('0x51')]['id']}})[_0x3ae8('0x2f')](handleEntityNotFound(_0x5903a9,null))['then'](function(_0x174d5e){if(_0x174d5e){return _0x174d5e[_0x3ae8('0x5a')](_0x40c084[_0x3ae8('0x55')][_0x3ae8('0x5b')],_[_0x3ae8('0x5c')](_0x40c084[_0x3ae8('0x55')],[_0x3ae8('0x5b'),'id'])||{});}})[_0x3ae8('0x2f')](respondWithResult(_0x5903a9,null))[_0x3ae8('0x54')](handleError(_0x5903a9,null));};exports[_0x3ae8('0x5d')]=function(_0x407d3a,_0x54f80d,_0x3424de){var _0x7f81eb={};var _0x4bf21f={};var _0x111383;var _0x1f60d8;return db[_0x3ae8('0x36')][_0x3ae8('0x5e')]({'where':{'id':_0x407d3a[_0x3ae8('0x51')]['id']}})[_0x3ae8('0x2f')](handleEntityNotFound(_0x54f80d,null))[_0x3ae8('0x2f')](function(_0x21a016){if(_0x21a016){_0x111383=_0x21a016;_0x4bf21f['model']=_['keys'](db[_0x3ae8('0x5f')][_0x3ae8('0x37')]);_0x4bf21f[_0x3ae8('0x3c')]=_[_0x3ae8('0x3d')](_0x407d3a[_0x3ae8('0x3c')]);_0x4bf21f[_0x3ae8('0x3e')]=_[_0x3ae8('0x3f')](_0x4bf21f[_0x3ae8('0x3b')],_0x4bf21f[_0x3ae8('0x3c')]);_0x7f81eb[_0x3ae8('0x40')]=_[_0x3ae8('0x3f')](_0x4bf21f['model'],qs[_0x3ae8('0x41')](_0x407d3a[_0x3ae8('0x3c')]['fields']));_0x7f81eb[_0x3ae8('0x40')]=_0x7f81eb[_0x3ae8('0x40')]['length']?_0x7f81eb['attributes']:_0x4bf21f[_0x3ae8('0x3b')];_0x7f81eb['order']=qs[_0x3ae8('0x45')](_0x407d3a[_0x3ae8('0x3c')][_0x3ae8('0x45')]);_0x7f81eb['where']=qs[_0x3ae8('0x3e')](_[_0x3ae8('0x47')](_0x407d3a[_0x3ae8('0x3c')],_0x4bf21f['filters']));if(_0x407d3a[_0x3ae8('0x3c')][_0x3ae8('0x49')]){_0x7f81eb['where']=_[_0x3ae8('0x4a')](_0x7f81eb['where'],{'$or':_['map'](_0x7f81eb[_0x3ae8('0x40')],function(_0x43069d){var _0x57c38f={};_0x57c38f[_0x43069d]={'$like':'%'+_0x407d3a['query'][_0x3ae8('0x49')]+'%'};return _0x57c38f;})});}_0x7f81eb=_['merge']({},_0x7f81eb,_0x407d3a[_0x3ae8('0x4b')]);return _0x111383['getMembers'](_0x7f81eb);}})[_0x3ae8('0x2f')](function(_0x3bafd2){if(_0x3bafd2){_0x1f60d8=_0x3bafd2[_0x3ae8('0x42')];if(!_0x407d3a[_0x3ae8('0x3c')][_0x3ae8('0x60')]('nolimit')){_0x7f81eb['limit']=qs['limit'](_0x407d3a[_0x3ae8('0x3c')][_0x3ae8('0x26')]);_0x7f81eb[_0x3ae8('0x24')]=qs[_0x3ae8('0x24')](_0x407d3a[_0x3ae8('0x3c')][_0x3ae8('0x24')]);}return _0x111383[_0x3ae8('0x5d')](_0x7f81eb);}})[_0x3ae8('0x2f')](function(_0x6c8665){if(_0x6c8665){return _0x6c8665?{'count':_0x1f60d8,'rows':_0x6c8665}:null;}})[_0x3ae8('0x2f')](respondWithResult(_0x54f80d,null))[_0x3ae8('0x54')](handleError(_0x54f80d,null));};exports['removeMembers']=function(_0xd2d770,_0x41aefd,_0x53f281){return db[_0x3ae8('0x36')][_0x3ae8('0x52')]({'where':{'id':_0xd2d770[_0x3ae8('0x51')]['id']}})['then'](handleEntityNotFound(_0x41aefd,null))[_0x3ae8('0x2f')](function(_0x33ec52){if(_0x33ec52){return _0x33ec52[_0x3ae8('0x61')](_0xd2d770[_0x3ae8('0x3c')][_0x3ae8('0x5b')]);}})[_0x3ae8('0x2f')](respondWithStatusCode(_0x41aefd,null))['catch'](handleError(_0x41aefd,null));};exports[_0x3ae8('0x62')]=function(_0x158d0a,_0x141d74,_0x5b50b3){if(_0x158d0a[_0x3ae8('0x55')]['id']){delete _0x158d0a[_0x3ae8('0x55')]['id'];}return db['ChatGroup'][_0x3ae8('0x52')]({'where':{'id':_0x158d0a['params']['id']}})[_0x3ae8('0x2f')](handleEntityNotFound(_0x141d74,null))[_0x3ae8('0x2f')](function(_0x37bb2c){if(_0x37bb2c){_0x158d0a['body'][_0x3ae8('0x63')]=_0x37bb2c['id'];return db[_0x3ae8('0x64')][_0x3ae8('0x53')](_0x158d0a[_0x3ae8('0x55')]);}})['then'](respondWithResult(_0x141d74,null))[_0x3ae8('0x54')](handleError(_0x141d74,null));};exports[_0x3ae8('0x65')]=function(_0x3c7f9a,_0x288924,_0x127e47){var _0x1a65a3={};var _0x63bcbe={};var _0x4dc1e6;var _0x24edf4;return db[_0x3ae8('0x36')][_0x3ae8('0x5e')]({'where':{'id':_0x3c7f9a['params']['id']}})[_0x3ae8('0x2f')](handleEntityNotFound(_0x288924,null))['then'](function(_0x16da85){if(_0x16da85){_0x4dc1e6=_0x16da85;_0x63bcbe[_0x3ae8('0x3b')]=_[_0x3ae8('0x3d')](db[_0x3ae8('0x64')][_0x3ae8('0x37')]);_0x63bcbe[_0x3ae8('0x3c')]=_[_0x3ae8('0x3d')](_0x3c7f9a['query']);_0x63bcbe[_0x3ae8('0x3e')]=_['intersection'](_0x63bcbe['model'],_0x63bcbe[_0x3ae8('0x3c')]);_0x1a65a3['attributes']=_[_0x3ae8('0x3f')](_0x63bcbe[_0x3ae8('0x3b')],qs[_0x3ae8('0x41')](_0x3c7f9a[_0x3ae8('0x3c')][_0x3ae8('0x41')]));_0x1a65a3[_0x3ae8('0x40')]=_0x1a65a3[_0x3ae8('0x40')][_0x3ae8('0x42')]?_0x1a65a3[_0x3ae8('0x40')]:_0x63bcbe[_0x3ae8('0x3b')];_0x1a65a3[_0x3ae8('0x44')]=qs['sort'](_0x3c7f9a['query']['sort']);_0x1a65a3[_0x3ae8('0x46')]=qs['filters'](_[_0x3ae8('0x47')](_0x3c7f9a['query'],_0x63bcbe['filters']));if(_0x3c7f9a['query']['filter']){_0x1a65a3[_0x3ae8('0x46')]=_[_0x3ae8('0x4a')](_0x1a65a3[_0x3ae8('0x46')],{'$or':_[_0x3ae8('0x35')](_0x1a65a3[_0x3ae8('0x40')],function(_0xeb57fd){var _0x1589ac={};_0x1589ac[_0xeb57fd]={'$like':'%'+_0x3c7f9a['query'][_0x3ae8('0x49')]+'%'};return _0x1589ac;})});}if(_0x3c7f9a['query'][_0x3ae8('0x66')]){var _0x1d6daa=_0x3c7f9a['query'][_0x3ae8('0x66')][_0x3ae8('0x67')](',');var _0x2bf3f2={};_0x2bf3f2[_0x1d6daa[0x0]]={'$gte':moment(_0x1d6daa[0x1])[_0x3ae8('0x68')](_0x3ae8('0x69'))};_0x1a65a3[_0x3ae8('0x46')]=_[_0x3ae8('0x4a')](_0x1a65a3[_0x3ae8('0x46')],_0x2bf3f2);}_0x1a65a3=_[_0x3ae8('0x4a')]({},_0x1a65a3,_0x3c7f9a[_0x3ae8('0x4b')]);return _0x4dc1e6[_0x3ae8('0x65')](_0x1a65a3);}})[_0x3ae8('0x2f')](function(_0x3e56dc){if(_0x3e56dc){_0x24edf4=_0x3e56dc[_0x3ae8('0x42')];if(!_0x3c7f9a[_0x3ae8('0x3c')][_0x3ae8('0x60')]('nolimit')){_0x1a65a3['limit']=qs['limit'](_0x3c7f9a[_0x3ae8('0x3c')][_0x3ae8('0x26')]);_0x1a65a3[_0x3ae8('0x24')]=qs[_0x3ae8('0x24')](_0x3c7f9a['query'][_0x3ae8('0x24')]);}return _0x4dc1e6[_0x3ae8('0x65')](_0x1a65a3);}})[_0x3ae8('0x2f')](function(_0x3920fd){if(_0x3920fd){return _0x3920fd?{'count':_0x24edf4,'rows':_0x3920fd}:null;}})['then'](respondWithResult(_0x288924,null))['catch'](handleError(_0x288924,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d12d1a6..d759610 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 _0x8ce1=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x845fcc,_0x518cfb){var _0x3a0e79=function(_0x240732){while(--_0x240732){_0x845fcc['push'](_0x845fcc['shift']());}};_0x3a0e79(++_0x518cfb);}(_0x8ce1,0x152));var _0x18ce=function(_0x2b41ec,_0xa3d92){_0x2b41ec=_0x2b41ec-0x0;var _0x51a7d1=_0x8ce1[_0x2b41ec];return _0x51a7d1;};'use strict';var EventEmitter=require(_0x18ce('0x0'));var ChatGroup=require(_0x18ce('0x1'))['db'][_0x18ce('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x18ce('0x3')](0x0);var events={'afterCreate':_0x18ce('0x4'),'afterUpdate':_0x18ce('0x5'),'afterDestroy':_0x18ce('0x6')};function emitEvent(_0x5e10bb){return function(_0x194532,_0xcffe1d,_0x37947f){ChatGroupEvents[_0x18ce('0x7')](_0x5e10bb+':'+_0x194532['id'],_0x194532);ChatGroupEvents['emit'](_0x5e10bb,_0x194532);_0x37947f(null);};}for(var e in events){if(events[_0x18ce('0x8')](e)){var event=events[e];ChatGroup[_0x18ce('0x9')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x943d=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x421446,_0x19af26){var _0x40e2a6=function(_0x254616){while(--_0x254616){_0x421446['push'](_0x421446['shift']());}};_0x40e2a6(++_0x19af26);}(_0x943d,0x155));var _0xd943=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x943d[_0x13cab0];return _0x38804f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xd943('0x0'))['db'][_0xd943('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd943('0x2')](0x0);var events={'afterCreate':_0xd943('0x3'),'afterUpdate':_0xd943('0x4'),'afterDestroy':_0xd943('0x5')};function emitEvent(_0x21052e){return function(_0x3cbb0d,_0xf6c0e3,_0xd005c7){ChatGroupEvents[_0xd943('0x6')](_0x21052e+':'+_0x3cbb0d['id'],_0x3cbb0d);ChatGroupEvents[_0xd943('0x6')](_0x21052e,_0x3cbb0d);_0xd005c7(null);};}for(var e in events){if(events[_0xd943('0x7')](e)){var event=events[e];ChatGroup[_0xd943('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 2e9d03b..9702eea 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 _0x4e15=['ChatGroup','chat_groups','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x4dc20f,_0xcd0e35){var _0x3cf77d=function(_0x4ef817){while(--_0x4ef817){_0x4dc20f['push'](_0x4dc20f['shift']());}};_0x3cf77d(++_0xcd0e35);}(_0x4e15,0x7a));var _0x54e1=function(_0x4b24b0,_0x28a711){_0x4b24b0=_0x4b24b0-0x0;var _0x54ee61=_0x4e15[_0x4b24b0];return _0x54ee61;};'use strict';var _=require(_0x54e1('0x0'));var util=require('util');var logger=require(_0x54e1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x54e1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54e1('0x3'));var rimraf=require(_0x54e1('0x4'));var config=require(_0x54e1('0x5'));var attributes=require(_0x54e1('0x6'));module[_0x54e1('0x7')]=function(_0x1f1f8a,_0x1b35a1){return _0x1f1f8a['define'](_0x54e1('0x8'),attributes,{'tableName':_0x54e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc416=['moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger'];(function(_0xa9ca2e,_0x43ccf0){var _0xa8ed67=function(_0x277256){while(--_0x277256){_0xa9ca2e['push'](_0xa9ca2e['shift']());}};_0xa8ed67(++_0x43ccf0);}(_0xc416,0xf9));var _0x6c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc416[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c41('0x0'));var util=require(_0x6c41('0x1'));var logger=require(_0x6c41('0x2'))('api');var moment=require(_0x6c41('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c41('0x4'));var fs=require('fs');var path=require(_0x6c41('0x5'));var rimraf=require(_0x6c41('0x6'));var config=require(_0x6c41('0x7'));var attributes=require(_0x6c41('0x8'));module[_0x6c41('0x9')]=function(_0x3aba3b,_0x438b71){return _0x3aba3b[_0x6c41('0xa')]('ChatGroup',attributes,{'tableName':_0x6c41('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 38adeb6..7034c0b 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 _0x34e7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x17f4db,_0x16282e){var _0xfc7c36=function(_0x1f3de8){while(--_0x1f3de8){_0x17f4db['push'](_0x17f4db['shift']());}};_0xfc7c36(++_0x16282e);}(_0x34e7,0x164));var _0x734e=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x34e7[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var moment=require(_0x734e('0x2'));var BPromise=require(_0x734e('0x3'));var rs=require(_0x734e('0x4'));var fs=require('fs');var Redis=require(_0x734e('0x5'));var db=require(_0x734e('0x6'))['db'];var utils=require(_0x734e('0x7'));var logger=require(_0x734e('0x8'))(_0x734e('0x9'));var config=require(_0x734e('0xa'));var jayson=require(_0x734e('0xb'));var client=jayson[_0x734e('0xc')][_0x734e('0xd')]({'port':0x232a});config['redis']=_[_0x734e('0xe')](config[_0x734e('0xf')],{'host':_0x734e('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x734e('0xf')]));require('./chatGroup.socket')[_0x734e('0x11')](socket);function respondWithRpcPromise(_0x436f6b,_0x3eee26,_0x4161e2){return new BPromise(function(_0x37350f,_0x3d117e){return client['request'](_0x436f6b,_0x4161e2)['then'](function(_0xaabf6b){logger[_0x734e('0x12')](_0x734e('0x13'),_0x3eee26,_0x734e('0x14'));logger['debug'](_0x734e('0x15'),_0x3eee26,_0x734e('0x14'),JSON['stringify'](_0xaabf6b));if(_0xaabf6b[_0x734e('0x16')]){if(_0xaabf6b[_0x734e('0x16')][_0x734e('0x17')]===0x1f4){logger[_0x734e('0x16')](_0x734e('0x13'),_0x3eee26,_0xaabf6b['error'][_0x734e('0x18')]);return _0x3d117e(_0xaabf6b[_0x734e('0x16')][_0x734e('0x18')]);}logger['error'](_0x734e('0x13'),_0x3eee26,_0xaabf6b['error'][_0x734e('0x18')]);return _0x37350f(_0xaabf6b[_0x734e('0x16')]['message']);}else{logger[_0x734e('0x12')]('ChatGroup,\x20%s,\x20%s',_0x3eee26,_0x734e('0x14'));_0x37350f(_0xaabf6b['result'][_0x734e('0x18')]);}})[_0x734e('0x19')](function(_0x207a8f){logger[_0x734e('0x16')](_0x734e('0x13'),_0x3eee26,_0x207a8f);_0x3d117e(_0x207a8f);});});} \ No newline at end of file +var _0x55ca=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','code','error','message','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x55ca,0x126));var _0xa55c=function(_0x160cd5,_0x19c58e){_0x160cd5=_0x160cd5-0x0;var _0x366763=_0x55ca[_0x160cd5];return _0x366763;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});config[_0xa55c('0xa')]=_['defaults'](config[_0xa55c('0xa')],{'host':_0xa55c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0xa')]));require(_0xa55c('0xc'))['register'](socket);function respondWithRpcPromise(_0x5849ad,_0x473d0e,_0x20c76a){return new BPromise(function(_0x381d07,_0x5d8e5a){return client[_0xa55c('0xd')](_0x5849ad,_0x20c76a)[_0xa55c('0xe')](function(_0x508342){logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x473d0e,_0xa55c('0x11'),JSON['stringify'](_0x508342));if(_0x508342['error']){if(_0x508342['error'][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x5d8e5a(_0x508342[_0xa55c('0x13')]['message']);}logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x381d07(_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);}else{logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));_0x381d07(_0x508342['result'][_0xa55c('0x14')]);}})[_0xa55c('0x15')](function(_0x461284){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x461284);_0x5d8e5a(_0x461284);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 597a76f..bb871ca 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 _0xdefe=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xdefe,0x19e));var _0xedef=function(_0x34dc,_0x523f6f){_0x34dc=_0x34dc-0x0;var _0x5041a4=_0xdefe[_0x34dc];return _0x5041a4;};'use strict';var ChatGroupEvents=require(_0xedef('0x0'));var events=['save',_0xedef('0x1'),_0xedef('0x2')];function createListener(_0x1ca8b3,_0xedbb04){return function(_0x31ef44){_0xedbb04[_0xedef('0x3')](_0x1ca8b3,_0x31ef44);};}function removeListener(_0x489fd2,_0x4b5acd){return function(){ChatGroupEvents[_0xedef('0x4')](_0x489fd2,_0x4b5acd);};}exports[_0xedef('0x5')]=function(_0x3f2065){for(var _0x5e6739=0x0,_0x1396e0=events[_0xedef('0x6')];_0x5e6739<_0x1396e0;_0x5e6739++){var _0x2a49f3=events[_0x5e6739];var _0x77cdd7=createListener(_0xedef('0x7')+_0x2a49f3,_0x3f2065);ChatGroupEvents['on'](_0x2a49f3,_0x77cdd7);}}; \ No newline at end of file +var _0x5b8a=['register','length','./chatGroup.events','remove','update','emit'];(function(_0x1a637c,_0x245b0c){var _0x113850=function(_0x110af7){while(--_0x110af7){_0x1a637c['push'](_0x1a637c['shift']());}};_0x113850(++_0x245b0c);}(_0x5b8a,0x1ee));var _0xa5b8=function(_0x47a736,_0x18b803){_0x47a736=_0x47a736-0x0;var _0x18ea3b=_0x5b8a[_0x47a736];return _0x18ea3b;};'use strict';var ChatGroupEvents=require(_0xa5b8('0x0'));var events=['save',_0xa5b8('0x1'),_0xa5b8('0x2')];function createListener(_0xdedccd,_0x53ee8c){return function(_0x11da0b){_0x53ee8c[_0xa5b8('0x3')](_0xdedccd,_0x11da0b);};}function removeListener(_0x1da5d7,_0x306576){return function(){ChatGroupEvents['removeListener'](_0x1da5d7,_0x306576);};}exports[_0xa5b8('0x4')]=function(_0x5e820d){for(var _0x4ebd57=0x0,_0x1918b0=events[_0xa5b8('0x5')];_0x4ebd57<_0x1918b0;_0x4ebd57++){var _0x3317f1=events[_0x4ebd57];var _0x5d4697=createListener('chatGroup:'+_0x3317f1,_0x5e820d);ChatGroupEvents['on'](_0x3317f1,_0x5d4697);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 55e0b88..4c1acdc 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 _0x221a=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put','/:id','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x3ecc40,_0x4dfcc5){var _0x1db938=function(_0x2df31a){while(--_0x2df31a){_0x3ecc40['push'](_0x3ecc40['shift']());}};_0x1db938(++_0x4dfcc5);}(_0x221a,0x13c));var _0xa221=function(_0x5ea326,_0x3d52fa){_0x5ea326=_0x5ea326-0x0;var _0x48cf87=_0x221a[_0x5ea326];return _0x48cf87;};'use strict';var multer=require('multer');var util=require(_0xa221('0x0'));var path=require(_0xa221('0x1'));var timeout=require(_0xa221('0x2'));var express=require(_0xa221('0x3'));var router=express['Router']();var fs_extra=require(_0xa221('0x4'));var auth=require(_0xa221('0x5'));var interaction=require(_0xa221('0x6'));var config=require(_0xa221('0x7'));var controller=require(_0xa221('0x8'));router[_0xa221('0x9')]('/',auth['isAuthenticated'](),controller[_0xa221('0xa')]);router[_0xa221('0x9')](_0xa221('0xb'),auth[_0xa221('0xc')](),controller[_0xa221('0xd')]);router[_0xa221('0x9')]('/:id',auth[_0xa221('0xc')](),controller[_0xa221('0xe')]);router[_0xa221('0x9')](_0xa221('0xf'),auth[_0xa221('0xc')](),controller[_0xa221('0x10')]);router[_0xa221('0x9')](_0xa221('0x11'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xa221('0x12'),auth[_0xa221('0xc')](),controller[_0xa221('0x13')]);router[_0xa221('0x14')]('/',auth['isAuthenticated'](),controller[_0xa221('0x15')]);router['post'](_0xa221('0x11'),auth['isAuthenticated'](),controller[_0xa221('0x16')]);router['post'](_0xa221('0x12'),auth[_0xa221('0xc')](),controller['addMessage']);router[_0xa221('0x17')](_0xa221('0x18'),auth[_0xa221('0xc')](),controller[_0xa221('0x19')]);router[_0xa221('0x1a')](_0xa221('0x18'),auth[_0xa221('0xc')](),controller[_0xa221('0x1b')]);router[_0xa221('0x1a')](_0xa221('0x11'),auth[_0xa221('0xc')](),controller[_0xa221('0x1c')]);module[_0xa221('0x1d')]=router; \ No newline at end of file +var _0x5b42=['connect-timeout','Router','fs-extra','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','describe','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','addMessage','update','/:id','delete','removeMembers','exports','multer','util','path'];(function(_0xb533a0,_0x1e58e3){var _0x33cc13=function(_0xaf52cc){while(--_0xaf52cc){_0xb533a0['push'](_0xb533a0['shift']());}};_0x33cc13(++_0x1e58e3);}(_0x5b42,0xf7));var _0x25b4=function(_0x1ffe06,_0x3bb0df){_0x1ffe06=_0x1ffe06-0x0;var _0x1d7f00=_0x5b42[_0x1ffe06];return _0x1d7f00;};'use strict';var multer=require(_0x25b4('0x0'));var util=require(_0x25b4('0x1'));var path=require(_0x25b4('0x2'));var timeout=require(_0x25b4('0x3'));var express=require('express');var router=express[_0x25b4('0x4')]();var fs_extra=require(_0x25b4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x25b4('0x6'));var controller=require(_0x25b4('0x7'));router[_0x25b4('0x8')]('/',auth['isAuthenticated'](),controller[_0x25b4('0x9')]);router[_0x25b4('0x8')]('/describe',auth[_0x25b4('0xa')](),controller[_0x25b4('0xb')]);router['get']('/:id',auth[_0x25b4('0xa')](),controller['show']);router[_0x25b4('0x8')](_0x25b4('0xc'),auth['isAuthenticated'](),controller[_0x25b4('0xd')]);router[_0x25b4('0x8')](_0x25b4('0xe'),auth[_0x25b4('0xa')](),controller[_0x25b4('0xf')]);router[_0x25b4('0x8')](_0x25b4('0x10'),auth['isAuthenticated'](),controller[_0x25b4('0x11')]);router['post']('/',auth[_0x25b4('0xa')](),controller[_0x25b4('0x12')]);router['post'](_0x25b4('0xe'),auth[_0x25b4('0xa')](),controller['addMembers']);router['post'](_0x25b4('0x10'),auth[_0x25b4('0xa')](),controller[_0x25b4('0x13')]);router['put']('/:id',auth[_0x25b4('0xa')](),controller[_0x25b4('0x14')]);router['delete'](_0x25b4('0x15'),auth[_0x25b4('0xa')](),controller['destroy']);router[_0x25b4('0x16')](_0x25b4('0xe'),auth['isAuthenticated'](),controller[_0x25b4('0x17')]);module[_0x25b4('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4a8119e..76d9955 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 _0x4fc2=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','long','DATE','ENUM','sequelize','exports'];(function(_0x369a49,_0x515d2c){var _0x3affa4=function(_0x3e2521){while(--_0x3e2521){_0x369a49['push'](_0x369a49['shift']());}};_0x3affa4(++_0x515d2c);}(_0x4fc2,0x111));var _0x24fc=function(_0x7199c0,_0x5aef22){_0x7199c0=_0x7199c0-0x0;var _0x4da511=_0x4fc2[_0x7199c0];return _0x4da511;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'closed':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x24fc('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x24fc('0x4'),_0x24fc('0x5')),'defaultValue':_0x24fc('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x24fc('0x6')]},'mailTranscript':{'type':Sequelize[_0x24fc('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x24fc('0x7')]},'secondDisposition':{'type':Sequelize[_0x24fc('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x24fc('0x7')]},'browserName':{'type':Sequelize[_0x24fc('0x7')]},'browserVersion':{'type':Sequelize[_0x24fc('0x7')]},'osName':{'type':Sequelize[_0x24fc('0x7')]},'osVersion':{'type':Sequelize[_0x24fc('0x7')]},'deviceModel':{'type':Sequelize[_0x24fc('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x24fc('0x7')]},'referer':{'type':Sequelize[_0x24fc('0x6')]},'customerIp':{'type':Sequelize[_0x24fc('0x7')]},'formData':{'type':Sequelize[_0x24fc('0x6')](_0x24fc('0x8'))},'read1stAt':{'type':Sequelize[_0x24fc('0x9')]},'lastMsgAt':{'type':Sequelize[_0x24fc('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x24fc('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x24fc('0x7')]},'customerPort':{'type':Sequelize[_0x24fc('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc902=['ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x2af9ce,_0x5cadb6){var _0x434c96=function(_0x2c4368){while(--_0x2c4368){_0x2af9ce['push'](_0x2af9ce['shift']());}};_0x434c96(++_0x5cadb6);}(_0xc902,0x15c));var _0x2c90=function(_0xb944ef,_0x152285){_0xb944ef=_0xb944ef-0x0;var _0x563383=_0xc902[_0xb944ef];return _0x563383;};'use strict';var Sequelize=require(_0x2c90('0x0'));module[_0x2c90('0x1')]={'closed':{'type':Sequelize[_0x2c90('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2c90('0x3')]},'ratingType':{'type':Sequelize[_0x2c90('0x4')](_0x2c90('0x5'),'thumb'),'defaultValue':_0x2c90('0x5')},'ratingMessage':{'type':Sequelize[_0x2c90('0x6')]},'pathTranscript':{'type':Sequelize[_0x2c90('0x6')]},'mailTranscript':{'type':Sequelize[_0x2c90('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2c90('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2c90('0x7')]},'note':{'type':Sequelize[_0x2c90('0x7')]},'browserName':{'type':Sequelize[_0x2c90('0x7')]},'browserVersion':{'type':Sequelize[_0x2c90('0x7')]},'osName':{'type':Sequelize[_0x2c90('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x2c90('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x2c90('0x6')]},'customerIp':{'type':Sequelize[_0x2c90('0x7')]},'formData':{'type':Sequelize[_0x2c90('0x6')](_0x2c90('0x9'))},'read1stAt':{'type':Sequelize[_0x2c90('0x8')]},'lastMsgAt':{'type':Sequelize[_0x2c90('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2c90('0x4')]('in',_0x2c90('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2c90('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x2c90('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 39a2bbe..5df2b17 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 _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x14a0,0x8e));var _0x014a=function(_0x5cd80b,_0x583f0b){_0x5cd80b=_0x5cd80b-0x0;var _0x5f3b60=_0x14a0[_0x5cd80b];return _0x5f3b60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));}; \ No newline at end of file +var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','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?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','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','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.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.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17e7e0,_0x244dd8){var _0x2d9c36=function(_0xaa8b87){while(--_0xaa8b87){_0x17e7e0['push'](_0x17e7e0['shift']());}};_0x2d9c36(++_0x244dd8);}(_0x66fa,0x117));var _0xa66f=function(_0x42cdb1,_0x1db457){_0x42cdb1=_0x42cdb1-0x0;var _0x241c48=_0x66fa[_0x42cdb1];return _0x241c48;};'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 pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 1ed085b..0fdb39b 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 _0xef02=['setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0x2d17b1,_0x3b399a){var _0x3e84fb=function(_0x15b688){while(--_0x15b688){_0x2d17b1['push'](_0x2d17b1['shift']());}};_0x3e84fb(++_0x3b399a);}(_0xef02,0x186));var _0x2ef0=function(_0x3d2012,_0x3d02b9){_0x3d2012=_0x3d2012-0x0;var _0x53d542=_0xef02[_0x3d2012];return _0x53d542;};'use strict';var EventEmitter=require(_0x2ef0('0x0'));var ChatInteraction=require(_0x2ef0('0x1'))['db'][_0x2ef0('0x2')];var ChatMessage=require(_0x2ef0('0x1'))['db'][_0x2ef0('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2ef0('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2ef0('0x5'),'afterDestroy':_0x2ef0('0x6')};function emitEvent(_0x5574cd){return function(_0x326a66,_0x459bec,_0x178f0d){_0x326a66[_0x2ef0('0x7')]({'attributes':['id'],'raw':!![]})[_0x2ef0('0x8')](function(_0x3366b8){_0x326a66[_0x2ef0('0x9')]('Users',_0x3366b8[_0x2ef0('0xa')](function(_0xcd153e){return{'id':_0xcd153e['id']};}));return ChatMessage[_0x2ef0('0xb')]({'where':{'ChatInteractionId':_0x326a66['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2ef0('0x8')](function(_0x10de0e){_0x326a66[_0x2ef0('0x9')](_0x2ef0('0xc'),_0x10de0e[_0x2ef0('0xd')]);ChatInteractionEvents[_0x2ef0('0xe')](_0x5574cd+':'+_0x326a66['id'],_0x326a66);ChatInteractionEvents[_0x2ef0('0xe')](_0x5574cd,_0x326a66);_0x178f0d(null);})[_0x2ef0('0xf')](_0x178f0d(null));};}for(var e in events){if(events[_0x2ef0('0x10')](e)){var event=events[e];ChatInteraction[_0x2ef0('0x11')](e,emitEvent(event));}}module[_0x2ef0('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x2de2=['length','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0xfbdf56,_0x3e2e22){var _0x2e3349=function(_0x3d7799){while(--_0x3d7799){_0xfbdf56['push'](_0xfbdf56['shift']());}};_0x2e3349(++_0x3e2e22);}(_0x2de2,0xf2));var _0x22de=function(_0x14fe4b,_0x2b7277){_0x14fe4b=_0x14fe4b-0x0;var _0x394321=_0x2de2[_0x14fe4b];return _0x394321;};'use strict';var EventEmitter=require(_0x22de('0x0'));var ChatInteraction=require(_0x22de('0x1'))['db'][_0x22de('0x2')];var ChatMessage=require(_0x22de('0x1'))['db'][_0x22de('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x22de('0x4'),'afterUpdate':_0x22de('0x5'),'afterDestroy':_0x22de('0x6')};function emitEvent(_0x3f9efe){return function(_0x535445,_0x5a38f6,_0x28b682){_0x535445['getUsers']({'attributes':['id'],'raw':!![]})[_0x22de('0x7')](function(_0x43bbe5){_0x535445[_0x22de('0x8')](_0x22de('0x9'),_0x43bbe5[_0x22de('0xa')](function(_0x784c4b){return{'id':_0x784c4b['id']};}));return ChatMessage[_0x22de('0xb')]({'where':{'ChatInteractionId':_0x535445['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24cca9){_0x535445[_0x22de('0x8')](_0x22de('0xc'),_0x24cca9[_0x22de('0xd')]);ChatInteractionEvents['emit'](_0x3f9efe+':'+_0x535445['id'],_0x535445);ChatInteractionEvents['emit'](_0x3f9efe,_0x535445);_0x28b682(null);})['catch'](_0x28b682(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x22de('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f3e9d39..7c32326 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 _0x97d2=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','./chatInteraction.attributes','exports','define'];(function(_0x294aa5,_0x44fe19){var _0x2b1805=function(_0x3870fd){while(--_0x3870fd){_0x294aa5['push'](_0x294aa5['shift']());}};_0x2b1805(++_0x44fe19);}(_0x97d2,0x1a9));var _0x297d=function(_0x457733,_0x46139e){_0x457733=_0x457733-0x0;var _0x20e988=_0x97d2[_0x457733];return _0x20e988;};'use strict';var _=require('lodash');var util=require(_0x297d('0x0'));var logger=require(_0x297d('0x1'))('api');var moment=require(_0x297d('0x2'));var BPromise=require(_0x297d('0x3'));var rp=require(_0x297d('0x4'));var fs=require('fs');var path=require(_0x297d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x297d('0x6'));module[_0x297d('0x7')]=function(_0x19c814,_0x437cae){return _0x19c814[_0x297d('0x8')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c32f9,_0x25621a,_0x34745f){if(_0x2c32f9[_0x297d('0x9')]('closed')){_0x2c32f9[_0x297d('0xa')]=moment()['format'](_0x297d('0xb'));}_0x34745f(null,_0x2c32f9);}},'charset':_0x297d('0xc'),'collate':_0x297d('0xd')});}; \ No newline at end of file +var _0x3d7d=['lodash','util','../../config/logger','moment','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3d7d,0xf0));var _0xd3d7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3d7d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd3d7('0x0'));var util=require(_0xd3d7('0x1'));var logger=require(_0xd3d7('0x2'))('api');var moment=require(_0xd3d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd3d7('0x4'));var config=require('../../config/environment');var attributes=require(_0xd3d7('0x5'));module['exports']=function(_0x340903,_0xde5eb1){return _0x340903[_0xd3d7('0x6')](_0xd3d7('0x7'),attributes,{'tableName':_0xd3d7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2802e9,_0x4e9959,_0x2720b4){if(_0x2802e9[_0xd3d7('0x9')](_0xd3d7('0xa'))){_0x2802e9[_0xd3d7('0xb')]=moment()[_0xd3d7('0xc')](_0xd3d7('0xd'));}_0x2720b4(null,_0x2802e9);}},'charset':'utf8mb4','collate':_0xd3d7('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index d66f865..a19b966 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 _0x9d16=['omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','ChatInteraction','body','options','attributes','UpdateChatInteraction','debug','stringify','catch','AddTagsToChatInteraction','find','where','addTags','ids'];(function(_0x4ff42f,_0x1ef0f5){var _0x2ae260=function(_0x4d8857){while(--_0x4d8857){_0x4ff42f['push'](_0x4ff42f['shift']());}};_0x2ae260(++_0x1ef0f5);}(_0x9d16,0x1bb));var _0x69d1=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x9d16[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x69d1('0x0'));var util=require(_0x69d1('0x1'));var moment=require('moment');var BPromise=require(_0x69d1('0x2'));var rs=require(_0x69d1('0x3'));var fs=require('fs');var Redis=require(_0x69d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x69d1('0x5'));var logger=require(_0x69d1('0x6'))(_0x69d1('0x7'));var config=require(_0x69d1('0x8'));var jayson=require(_0x69d1('0x9'));var client=jayson[_0x69d1('0xa')][_0x69d1('0xb')]({'port':0x232a});config[_0x69d1('0xc')]=_[_0x69d1('0xd')](config[_0x69d1('0xc')],{'host':_0x69d1('0xe'),'port':0x18eb});var socket=require(_0x69d1('0xf'))(new Redis(config[_0x69d1('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xbcfdab,_0x47fdb4,_0x23804c){return new BPromise(function(_0xdae482,_0x116918){return client[_0x69d1('0x10')](_0xbcfdab,_0x23804c)[_0x69d1('0x11')](function(_0x1789c8){logger[_0x69d1('0x12')](_0x69d1('0x13'),_0x47fdb4,_0x69d1('0x14'));logger['debug'](_0x69d1('0x15'),_0x47fdb4,_0x69d1('0x14'),JSON['stringify'](_0x1789c8));if(_0x1789c8[_0x69d1('0x16')]){if(_0x1789c8['error']['code']===0x1f4){logger[_0x69d1('0x16')](_0x69d1('0x13'),_0x47fdb4,_0x1789c8[_0x69d1('0x16')][_0x69d1('0x17')]);return _0x116918(_0x1789c8[_0x69d1('0x16')]['message']);}logger[_0x69d1('0x16')](_0x69d1('0x13'),_0x47fdb4,_0x1789c8[_0x69d1('0x16')][_0x69d1('0x17')]);return _0xdae482(_0x1789c8[_0x69d1('0x16')][_0x69d1('0x17')]);}else{logger[_0x69d1('0x12')](_0x69d1('0x13'),_0x47fdb4,_0x69d1('0x14'));_0xdae482(_0x1789c8['result'][_0x69d1('0x17')]);}})['catch'](function(_0x41be06){logger[_0x69d1('0x16')](_0x69d1('0x13'),_0x47fdb4,_0x41be06);_0x116918(_0x41be06);});});}exports['UpdateChatInteraction']=function(_0x481bdd){var _0x542d42=this;return new Promise(function(_0x5bf6c0,_0x11904b){return db[_0x69d1('0x18')]['update'](_0x481bdd[_0x69d1('0x19')],{'raw':_0x481bdd[_0x69d1('0x1a')]?_0x481bdd[_0x69d1('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x481bdd[_0x69d1('0x1a')]?_0x481bdd[_0x69d1('0x1a')]['where']||null:null,'attributes':_0x481bdd['options']?_0x481bdd[_0x69d1('0x1a')][_0x69d1('0x1b')]||null:null,'limit':_0x481bdd[_0x69d1('0x1a')]?_0x481bdd[_0x69d1('0x1a')]['limit']||null:null})[_0x69d1('0x11')](function(_0x343600){logger[_0x69d1('0x12')](_0x69d1('0x1c'),_0x481bdd);logger[_0x69d1('0x1d')](_0x69d1('0x1c'),_0x481bdd,JSON[_0x69d1('0x1e')](_0x343600));_0x5bf6c0(_0x343600);})[_0x69d1('0x1f')](function(_0x39b07b){logger[_0x69d1('0x16')](_0x69d1('0x1c'),_0x39b07b['message'],_0x481bdd);_0x11904b(_0x542d42[_0x69d1('0x16')](0x1f4,_0x39b07b[_0x69d1('0x17')]));});});};exports[_0x69d1('0x20')]=function(_0x4068fe){return new Promise(function(_0x1a4ba9,_0x547343){return db[_0x69d1('0x18')][_0x69d1('0x21')]({'where':_0x4068fe[_0x69d1('0x1a')]?_0x4068fe['options'][_0x69d1('0x22')]||null:null})['then'](function(_0x171ee0){if(_0x171ee0){return _0x171ee0[_0x69d1('0x23')](_0x4068fe[_0x69d1('0x19')][_0x69d1('0x24')],_[_0x69d1('0x25')](_0x4068fe['body'],['ids','id'])||{});}})[_0x69d1('0x26')](function(_0x281fbc){logger[_0x69d1('0x12')](_0x69d1('0x27'),_0x4068fe);logger[_0x69d1('0x1d')](_0x69d1('0x27'),_0x4068fe,JSON[_0x69d1('0x1e')](_0x281fbc));_0x1a4ba9(_0x281fbc);})['catch'](function(_0x25376e){logger[_0x69d1('0x16')]('AddTags',_0x25376e['message'],_0x4068fe);_0x547343(_this[_0x69d1('0x16')](0x1f4,_0x25376e['message']));});});}; \ No newline at end of file +var _0x2b70=['moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','options','raw','where','attributes','then','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','omit','body','spread','AddTags','lodash','util'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x2b70,0x116));var _0x02b7=function(_0x30726a,_0x5cef0c){_0x30726a=_0x30726a-0x0;var _0x471bd2=_0x2b70[_0x30726a];return _0x471bd2;};'use strict';var _=require(_0x02b7('0x0'));var util=require(_0x02b7('0x1'));var moment=require(_0x02b7('0x2'));var BPromise=require(_0x02b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x02b7('0x5'));var config=require(_0x02b7('0x6'));var jayson=require(_0x02b7('0x7'));var client=jayson[_0x02b7('0x8')][_0x02b7('0x9')]({'port':0x232a});config[_0x02b7('0xa')]=_[_0x02b7('0xb')](config[_0x02b7('0xa')],{'host':_0x02b7('0xc'),'port':0x18eb});var socket=require(_0x02b7('0xd'))(new Redis(config['redis']));require(_0x02b7('0xe'))[_0x02b7('0xf')](socket);function respondWithRpcPromise(_0x6de1fd,_0x132ea9,_0x275075){return new BPromise(function(_0x574f5f,_0x47d7aa){return client['request'](_0x6de1fd,_0x275075)['then'](function(_0x1880f6){logger[_0x02b7('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x132ea9,_0x02b7('0x11'));logger[_0x02b7('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x132ea9,_0x02b7('0x11'),JSON['stringify'](_0x1880f6));if(_0x1880f6[_0x02b7('0x13')]){if(_0x1880f6['error'][_0x02b7('0x14')]===0x1f4){logger[_0x02b7('0x13')](_0x02b7('0x15'),_0x132ea9,_0x1880f6[_0x02b7('0x13')][_0x02b7('0x16')]);return _0x47d7aa(_0x1880f6[_0x02b7('0x13')][_0x02b7('0x16')]);}logger[_0x02b7('0x13')](_0x02b7('0x15'),_0x132ea9,_0x1880f6[_0x02b7('0x13')][_0x02b7('0x16')]);return _0x574f5f(_0x1880f6[_0x02b7('0x13')][_0x02b7('0x16')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x132ea9,_0x02b7('0x11'));_0x574f5f(_0x1880f6[_0x02b7('0x17')]['message']);}})[_0x02b7('0x18')](function(_0x415db7){logger[_0x02b7('0x13')](_0x02b7('0x15'),_0x132ea9,_0x415db7);_0x47d7aa(_0x415db7);});});}exports['UpdateChatInteraction']=function(_0x149308){var _0x560d5d=this;return new Promise(function(_0x58b679,_0x49b838){return db[_0x02b7('0x19')][_0x02b7('0x1a')](_0x149308['body'],{'raw':_0x149308[_0x02b7('0x1b')]?_0x149308['options'][_0x02b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149308[_0x02b7('0x1b')]?_0x149308['options'][_0x02b7('0x1d')]||null:null,'attributes':_0x149308[_0x02b7('0x1b')]?_0x149308[_0x02b7('0x1b')][_0x02b7('0x1e')]||null:null,'limit':_0x149308[_0x02b7('0x1b')]?_0x149308['options']['limit']||null:null})[_0x02b7('0x1f')](function(_0x2f9cb7){logger[_0x02b7('0x10')](_0x02b7('0x20'),_0x149308);logger[_0x02b7('0x12')]('UpdateChatInteraction',_0x149308,JSON['stringify'](_0x2f9cb7));_0x58b679(_0x2f9cb7);})[_0x02b7('0x18')](function(_0x2749b5){logger[_0x02b7('0x13')]('UpdateChatInteraction',_0x2749b5[_0x02b7('0x16')],_0x149308);_0x49b838(_0x560d5d[_0x02b7('0x13')](0x1f4,_0x2749b5['message']));});});};exports[_0x02b7('0x21')]=function(_0x248fdf){return new Promise(function(_0x4724ab,_0x45d0ac){return db[_0x02b7('0x19')][_0x02b7('0x22')]({'where':_0x248fdf[_0x02b7('0x1b')]?_0x248fdf['options'][_0x02b7('0x1d')]||null:null})[_0x02b7('0x1f')](function(_0x55aed3){if(_0x55aed3){return _0x55aed3[_0x02b7('0x23')](_0x248fdf['body']['ids'],_[_0x02b7('0x24')](_0x248fdf[_0x02b7('0x25')],['ids','id'])||{});}})[_0x02b7('0x26')](function(_0x57512b){logger[_0x02b7('0x10')](_0x02b7('0x27'),_0x248fdf);logger[_0x02b7('0x12')](_0x02b7('0x27'),_0x248fdf,JSON['stringify'](_0x57512b));_0x4724ab(_0x57512b);})[_0x02b7('0x18')](function(_0x2ecdd5){logger['error'](_0x02b7('0x27'),_0x2ecdd5[_0x02b7('0x16')],_0x248fdf);_0x45d0ac(_this['error'](0x1f4,_0x2ecdd5['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 6444e2a..c378027 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 _0x4fdb=['removeListener','length','./chatInteraction.events','save','remove','update','emit'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x47aa2a,_0x2e3c84){_0x47aa2a=_0x47aa2a-0x0;var _0x39c43e=_0x4fdb[_0x47aa2a];return _0x39c43e;};'use strict';var ChatInteractionEvents=require(_0xb4fd('0x0'));var events=[_0xb4fd('0x1'),_0xb4fd('0x2'),_0xb4fd('0x3')];function createListener(_0x3b399e,_0xafe34b){return function(_0x260a35){_0xafe34b[_0xb4fd('0x4')](_0x3b399e,_0x260a35);};}function removeListener(_0x1c0b08,_0x5b73bb){return function(){ChatInteractionEvents[_0xb4fd('0x5')](_0x1c0b08,_0x5b73bb);};}exports['register']=function(_0x14052b){for(var _0x5d8b39=0x0,_0x53273f=events[_0xb4fd('0x6')];_0x5d8b39<_0x53273f;_0x5d8b39++){var _0x3af8e3=events[_0x5d8b39];var _0x1151b5=createListener('chatInteraction:'+_0x3af8e3,_0x14052b);ChatInteractionEvents['on'](_0x3af8e3,_0x1151b5);}}; \ No newline at end of file +var _0x924d=['register','length','chatInteraction:','./chatInteraction.events','save','emit'];(function(_0x1d031e,_0x3fe2d6){var _0x4c089d=function(_0x22cba2){while(--_0x22cba2){_0x1d031e['push'](_0x1d031e['shift']());}};_0x4c089d(++_0x3fe2d6);}(_0x924d,0x19b));var _0xd924=function(_0x46723d,_0x3d6bd5){_0x46723d=_0x46723d-0x0;var _0x5e2b3a=_0x924d[_0x46723d];return _0x5e2b3a;};'use strict';var ChatInteractionEvents=require(_0xd924('0x0'));var events=[_0xd924('0x1'),'remove','update'];function createListener(_0x5a15db,_0x169e1e){return function(_0xe09267){_0x169e1e[_0xd924('0x2')](_0x5a15db,_0xe09267);};}function removeListener(_0x1fb0a7,_0x784b02){return function(){ChatInteractionEvents['removeListener'](_0x1fb0a7,_0x784b02);};}exports[_0xd924('0x3')]=function(_0x1996b3){for(var _0x11453b=0x0,_0x45a043=events[_0xd924('0x4')];_0x11453b<_0x45a043;_0x11453b++){var _0x2cf231=events[_0x11453b];var _0x3a93fd=createListener(_0xd924('0x5')+_0x2cf231,_0x1996b3);ChatInteractionEvents['on'](_0x2cf231,_0x3a93fd);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 2d40e9d..68a18ab 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 _0x64f1=['close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close'];(function(_0x43f552,_0x42808c){var _0x17911b=function(_0x4407a7){while(--_0x4407a7){_0x43f552['push'](_0x43f552['shift']());}};_0x17911b(++_0x42808c);}(_0x64f1,0x7a));var _0x164f=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x64f1[_0x4c0622];return _0x1799d8;};'use strict';var multer=require(_0x164f('0x0'));var util=require(_0x164f('0x1'));var path=require(_0x164f('0x2'));var timeout=require(_0x164f('0x3'));var express=require(_0x164f('0x4'));var router=express[_0x164f('0x5')]();var fs_extra=require(_0x164f('0x6'));var auth=require(_0x164f('0x7'));var interaction=require(_0x164f('0x8'));var config=require(_0x164f('0x9'));var controller=require(_0x164f('0xa'));router['get']('/',auth[_0x164f('0xb')](),controller['index']);router[_0x164f('0xc')](_0x164f('0xd'),auth[_0x164f('0xb')](),controller[_0x164f('0xe')]);router[_0x164f('0xc')](_0x164f('0xf'),auth[_0x164f('0x10')](),controller[_0x164f('0x11')]);router[_0x164f('0xc')](_0x164f('0x12'),auth[_0x164f('0x10')](),controller[_0x164f('0x13')]);router['get'](_0x164f('0x14'),auth[_0x164f('0xb')](),controller['getMessages']);router[_0x164f('0xc')](_0x164f('0x15'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x164f('0x16'),auth['isAuthenticated'](),controller[_0x164f('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x164f('0x18')]);router[_0x164f('0x19')](_0x164f('0x1a'),auth[_0x164f('0xb')](),controller[_0x164f('0x1b')]);var upload=multer({'storage':multer[_0x164f('0x1c')]({'destination':function(_0x1bf52a,_0x2e5eac,_0x5ab682){_0x5ab682(null,path['join'](config[_0x164f('0x1d')],_0x164f('0x1e')));},'filename':function(_0x497174,_0x25a51a,_0x5c0ed5){_0x5c0ed5(null,util['format'](_0x164f('0x1f'),Date[_0x164f('0x20')](),_0x25a51a[_0x164f('0x21')][_0x164f('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x164f('0x19')](_0x164f('0x23'),upload['single'](_0x164f('0x24')),controller[_0x164f('0x25')]);router[_0x164f('0x19')](_0x164f('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x164f('0x26')]);router['post'](_0x164f('0x27'),auth[_0x164f('0xb')](),interaction['tracked'](_0x164f('0x28'),_0x164f('0x29')),controller[_0x164f('0x2a')]);router[_0x164f('0x2b')]('/:id',auth[_0x164f('0xb')](),interaction[_0x164f('0x2c')]('chat',_0x164f('0x2d')),controller[_0x164f('0x2e')]);router[_0x164f('0x2b')](_0x164f('0x2f'),controller[_0x164f('0x30')]);router[_0x164f('0x2b')](_0x164f('0x31'),auth['isChatInteractionAuthorized'](),controller[_0x164f('0x32')]);router[_0x164f('0x2b')](_0x164f('0x33'),controller[_0x164f('0x34')]);router[_0x164f('0x35')](_0x164f('0xf'),auth[_0x164f('0xb')](),interaction[_0x164f('0x2c')](_0x164f('0x28'),_0x164f('0x36')),controller[_0x164f('0x37')]);router[_0x164f('0x35')](_0x164f('0x27'),auth[_0x164f('0xb')](),controller[_0x164f('0x38')]);module[_0x164f('0x39')]=router; \ No newline at end of file +var _0xe4f5=['/:id/custom_update','customUpdate','put','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','diskStorage','join','root','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update'];(function(_0x3655be,_0x560849){var _0xb167af=function(_0x2d6ad6){while(--_0x2d6ad6){_0x3655be['push'](_0x3655be['shift']());}};_0xb167af(++_0x560849);}(_0xe4f5,0x74));var _0x5e4f=function(_0x27a1f1,_0x3e3025){_0x27a1f1=_0x27a1f1-0x0;var _0x11ce5d=_0xe4f5[_0x27a1f1];return _0x11ce5d;};'use strict';var multer=require('multer');var util=require(_0x5e4f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5e4f('0x1'));var router=express[_0x5e4f('0x2')]();var fs_extra=require(_0x5e4f('0x3'));var auth=require(_0x5e4f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5e4f('0x5'));var controller=require(_0x5e4f('0x6'));router['get']('/',auth[_0x5e4f('0x7')](),controller[_0x5e4f('0x8')]);router[_0x5e4f('0x9')](_0x5e4f('0xa'),auth[_0x5e4f('0x7')](),controller[_0x5e4f('0xb')]);router[_0x5e4f('0x9')](_0x5e4f('0xc'),auth[_0x5e4f('0xd')](),controller[_0x5e4f('0xe')]);router[_0x5e4f('0x9')](_0x5e4f('0xf'),auth[_0x5e4f('0xd')](),controller['attachmentDownload']);router['get'](_0x5e4f('0x10'),auth['isAuthenticated'](),controller[_0x5e4f('0x11')]);router[_0x5e4f('0x9')](_0x5e4f('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x5e4f('0x9')](_0x5e4f('0x13'),auth['isAuthenticated'](),controller[_0x5e4f('0x14')]);router[_0x5e4f('0x15')]('/',auth[_0x5e4f('0x7')](),controller[_0x5e4f('0x16')]);router[_0x5e4f('0x15')]('/:id/vidaoo',auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x5e4f('0x17')]({'destination':function(_0x5e1716,_0x234c05,_0x3e34a7){_0x3e34a7(null,path[_0x5e4f('0x18')](config[_0x5e4f('0x19')],'server/files/attachments/'));},'filename':function(_0x13cb56,_0x19609c,_0x2242c4){_0x2242c4(null,util[_0x5e4f('0x1a')]('%s-%s',Date[_0x5e4f('0x1b')](),_0x19609c[_0x5e4f('0x1c')][_0x5e4f('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5e4f('0x15')](_0x5e4f('0x1e'),upload['single'](_0x5e4f('0x1f')),controller[_0x5e4f('0x20')]);router[_0x5e4f('0x15')](_0x5e4f('0x10'),auth[_0x5e4f('0xd')](),controller['addMessage']);router[_0x5e4f('0x15')](_0x5e4f('0x21'),auth[_0x5e4f('0x7')](),interaction[_0x5e4f('0x22')](_0x5e4f('0x23'),_0x5e4f('0x24')),controller[_0x5e4f('0x25')]);router['put'](_0x5e4f('0xc'),auth[_0x5e4f('0x7')](),interaction[_0x5e4f('0x22')]('chat',_0x5e4f('0x26')),controller[_0x5e4f('0x27')]);router['put'](_0x5e4f('0x28'),controller[_0x5e4f('0x29')]);router[_0x5e4f('0x2a')](_0x5e4f('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x5e4f('0x2c')]);router[_0x5e4f('0x2a')](_0x5e4f('0x2d'),controller[_0x5e4f('0x2e')]);router[_0x5e4f('0x2f')](_0x5e4f('0xc'),auth[_0x5e4f('0x7')](),interaction[_0x5e4f('0x22')]('chat',_0x5e4f('0x30')),controller[_0x5e4f('0x31')]);router[_0x5e4f('0x2f')](_0x5e4f('0x21'),auth[_0x5e4f('0x7')](),controller[_0x5e4f('0x32')]);module[_0x5e4f('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 beb5280..7d984eb 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 _0x8133=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x399ad9,_0x496ab5){var _0x23e9b4=function(_0x99d67d){while(--_0x99d67d){_0x399ad9['push'](_0x399ad9['shift']());}};_0x23e9b4(++_0x496ab5);}(_0x8133,0xee));var _0x3813=function(_0x50acaa,_0x4f9bbf){_0x50acaa=_0x50acaa-0x0;var _0x3174f3=_0x8133[_0x50acaa];return _0x3174f3;};'use strict';var Sequelize=require(_0x3813('0x0'));module[_0x3813('0x1')]={'body':{'type':Sequelize[_0x3813('0x2')](_0x3813('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3813('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3813('0x5')]}}; \ No newline at end of file +var _0x84c6=['BOOLEAN','sequelize','TEXT','medium'];(function(_0x1fa562,_0x5147c5){var _0xeab6df=function(_0x30a171){while(--_0x30a171){_0x1fa562['push'](_0x1fa562['shift']());}};_0xeab6df(++_0x5147c5);}(_0x84c6,0x121));var _0x684c=function(_0x4e5ded,_0x3897b){_0x4e5ded=_0x4e5ded-0x0;var _0x1e2999=_0x84c6[_0x4e5ded];return _0x1e2999;};'use strict';var Sequelize=require(_0x684c('0x0'));module['exports']={'body':{'type':Sequelize[_0x684c('0x1')](_0x684c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x684c('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9b82a82..6920bb2 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 _0xf23f=['./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','params','length','options','find','create','body','update','describe','get','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','agent','FromId','ToId','read','sort','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x31ae95,_0x31413e){var _0x2284c8=function(_0x3d03f1){while(--_0x3d03f1){_0x31ae95['push'](_0x31ae95['shift']());}};_0x2284c8(++_0x31413e);}(_0xf23f,0x129));var _0xff23=function(_0x8b4966,_0x1f4ec3){_0x8b4966=_0x8b4966-0x0;var _0x4e3470=_0xf23f[_0x8b4966];return _0x4e3470;};'use strict';var emlformat=require(_0xff23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff23('0x1'));var jsonpatch=require(_0xff23('0x2'));var rp=require(_0xff23('0x3'));var moment=require(_0xff23('0x4'));var BPromise=require(_0xff23('0x5'));var Mustache=require(_0xff23('0x6'));var util=require(_0xff23('0x7'));var path=require('path');var sox=require(_0xff23('0x8'));var csv=require(_0xff23('0x9'));var ejs=require(_0xff23('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff23('0xb'));var squel=require('squel');var crypto=require(_0xff23('0xc'));var jsforce=require(_0xff23('0xd'));var deskjs=require(_0xff23('0xe'));var toCsv=require(_0xff23('0x9'));var querystring=require(_0xff23('0xf'));var Papa=require('papaparse');var Redis=require(_0xff23('0x10'));var authService=require(_0xff23('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff23('0x12'));var logger=require(_0xff23('0x13'))(_0xff23('0x14'));var utils=require('../../config/utils');var config=require(_0xff23('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xff23('0x16'))['db'];config[_0xff23('0x17')]=_[_0xff23('0x18')](config[_0xff23('0x17')],{'host':_0xff23('0x19'),'port':0x18eb});var socket=require(_0xff23('0x1a'))(new Redis(config['redis']));require(_0xff23('0x1b'))['register'](socket);function respondWithStatusCode(_0x1d568b,_0x35ff9d){_0x35ff9d=_0x35ff9d||0xcc;return function(_0x9164b0){if(_0x9164b0){return _0x1d568b[_0xff23('0x1c')](_0x35ff9d);}return _0x1d568b[_0xff23('0x1d')](_0x35ff9d)[_0xff23('0x1e')]();};}function respondWithResult(_0x394c1f,_0x3a4e34){_0x3a4e34=_0x3a4e34||0xc8;return function(_0x220f95){if(_0x220f95){return _0x394c1f[_0xff23('0x1d')](_0x3a4e34)['json'](_0x220f95);}};}function respondWithFilteredResult(_0x1feaef,_0x1499b0){return function(_0x125c1a){if(_0x125c1a){var _0x493ab3=typeof _0x1499b0[_0xff23('0x1f')]===_0xff23('0x20')&&typeof _0x1499b0[_0xff23('0x21')]==='undefined';var _0xe4dd43=_0x125c1a['count'];var _0x352f5b=_0x493ab3?0x0:_0x1499b0['offset'];var _0x3ac3a0=_0x493ab3?_0x125c1a[_0xff23('0x22')]:_0x1499b0[_0xff23('0x1f')]+_0x1499b0[_0xff23('0x21')];var _0x1ff397;if(_0x3ac3a0>=_0xe4dd43){_0x3ac3a0=_0xe4dd43;_0x1ff397=0xc8;}else{_0x1ff397=0xce;}_0x1feaef['status'](_0x1ff397);return _0x1feaef[_0xff23('0x23')]('Content-Range',_0x352f5b+'-'+_0x3ac3a0+'/'+_0xe4dd43)[_0xff23('0x24')](_0x125c1a);}return null;};}function patchUpdates(_0x2e16a3){return function(_0x5170ab){try{jsonpatch[_0xff23('0x25')](_0x5170ab,_0x2e16a3,!![]);}catch(_0x1bb3fe){return BPromise['reject'](_0x1bb3fe);}return _0x5170ab[_0xff23('0x26')]();};}function saveUpdates(_0x343fb6,_0x10fe0f){return function(_0x1b2abb){if(_0x1b2abb){return _0x1b2abb['update'](_0x343fb6)[_0xff23('0x27')](function(_0x48fec1){return _0x48fec1;});}return null;};}function removeEntity(_0x5b23d0,_0x2359e5){return function(_0x5a6632){if(_0x5a6632){return _0x5a6632[_0xff23('0x28')]()['then'](function(){_0x5b23d0[_0xff23('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd93a9,_0xc0fea2){return function(_0x4886fb){if(!_0x4886fb){_0xcd93a9[_0xff23('0x1c')](0x194);}return _0x4886fb;};}function handleError(_0x4a8584,_0x45682f){_0x45682f=_0x45682f||0x1f4;return function(_0x483173){logger[_0xff23('0x29')](_0x483173[_0xff23('0x2a')]);if(_0x483173[_0xff23('0x2b')]){delete _0x483173[_0xff23('0x2b')];}_0x4a8584[_0xff23('0x1d')](_0x45682f)[_0xff23('0x2c')](_0x483173);};}exports[_0xff23('0x2d')]=function(_0x3f9e71,_0x4e0e4f){var _0x2a1a39={},_0x2fc15c={},_0x45f4ad={'count':0x0,'rows':[]};var _0x48e686=_[_0xff23('0x2e')](db[_0xff23('0x2f')][_0xff23('0x30')],function(_0x364cf0){return{'name':_0x364cf0['fieldName'],'type':_0x364cf0[_0xff23('0x31')]['key']};});_0x2fc15c[_0xff23('0x32')]=_[_0xff23('0x2e')](_0x48e686,_0xff23('0x2b'));_0x2fc15c[_0xff23('0x33')]=_[_0xff23('0x34')](_0x3f9e71[_0xff23('0x33')]);_0x2fc15c[_0xff23('0x35')]=_[_0xff23('0x36')](_0x2fc15c['model'],_0x2fc15c[_0xff23('0x33')]);_0x2a1a39['attributes']=_[_0xff23('0x36')](_0x2fc15c[_0xff23('0x32')],qs[_0xff23('0x37')](_0x3f9e71[_0xff23('0x33')][_0xff23('0x37')]));_0x2a1a39[_0xff23('0x38')]=_0x2a1a39[_0xff23('0x38')]['length']?_0x2a1a39[_0xff23('0x38')]:_0x2fc15c['model'];if(!_0x3f9e71[_0xff23('0x33')][_0xff23('0x39')](_0xff23('0x3a'))){_0x2a1a39[_0xff23('0x21')]=qs[_0xff23('0x21')](_0x3f9e71[_0xff23('0x33')]['limit']);_0x2a1a39['offset']=qs['offset'](_0x3f9e71['query'][_0xff23('0x1f')]);}_0x2a1a39['order']=qs['sort'](_0x3f9e71[_0xff23('0x33')]['sort']);_0x2a1a39['where']=qs[_0xff23('0x35')](_[_0xff23('0x3b')](_0x3f9e71[_0xff23('0x33')],_0x2fc15c['filters']),_0x48e686);if(_0x3f9e71[_0xff23('0x33')][_0xff23('0x3c')]){_0x2a1a39[_0xff23('0x3d')]=_[_0xff23('0x3e')](_0x2a1a39[_0xff23('0x3d')],{'$or':_[_0xff23('0x2e')](_0x48e686,function(_0x2a673c){if(_0x2a673c['type']!==_0xff23('0x3f')){var _0x1f99e9={};_0x1f99e9[_0x2a673c[_0xff23('0x2b')]]={'$like':'%'+_0x3f9e71[_0xff23('0x33')][_0xff23('0x3c')]+'%'};return _0x1f99e9;}})});}_0x2a1a39=_[_0xff23('0x3e')]({},_0x2a1a39,_0x3f9e71['options']);var _0x3a0c62={'where':_0x2a1a39[_0xff23('0x3d')]};return db[_0xff23('0x2f')][_0xff23('0x22')](_0x3a0c62)['then'](function(_0x219c50){_0x45f4ad[_0xff23('0x22')]=_0x219c50;if(_0x3f9e71[_0xff23('0x33')]['includeAll']){_0x2a1a39[_0xff23('0x40')]=[{'all':!![]}];}return db[_0xff23('0x2f')][_0xff23('0x41')](_0x2a1a39);})[_0xff23('0x27')](function(_0x282b5b){_0x45f4ad[_0xff23('0x42')]=_0x282b5b;return _0x45f4ad;})[_0xff23('0x27')](respondWithFilteredResult(_0x4e0e4f,_0x2a1a39))[_0xff23('0x43')](handleError(_0x4e0e4f,null));};exports['show']=function(_0x577d93,_0x13e275){var _0x344d7d={'raw':!![],'where':{'id':_0x577d93[_0xff23('0x44')]['id']}},_0x2e87af={};_0x2e87af[_0xff23('0x32')]=_[_0xff23('0x34')](db[_0xff23('0x2f')][_0xff23('0x30')]);_0x2e87af[_0xff23('0x33')]=_[_0xff23('0x34')](_0x577d93[_0xff23('0x33')]);_0x2e87af[_0xff23('0x35')]=_['intersection'](_0x2e87af[_0xff23('0x32')],_0x2e87af['query']);_0x344d7d[_0xff23('0x38')]=_[_0xff23('0x36')](_0x2e87af['model'],qs['fields'](_0x577d93[_0xff23('0x33')][_0xff23('0x37')]));_0x344d7d[_0xff23('0x38')]=_0x344d7d[_0xff23('0x38')][_0xff23('0x45')]?_0x344d7d[_0xff23('0x38')]:_0x2e87af['model'];if(_0x577d93['query']['includeAll']){_0x344d7d[_0xff23('0x40')]=[{'all':!![]}];}_0x344d7d=_[_0xff23('0x3e')]({},_0x344d7d,_0x577d93[_0xff23('0x46')]);return db[_0xff23('0x2f')][_0xff23('0x47')](_0x344d7d)[_0xff23('0x27')](handleEntityNotFound(_0x13e275,null))['then'](respondWithResult(_0x13e275,null))['catch'](handleError(_0x13e275,null));};exports['create']=function(_0x2df1e8,_0x442638){return db[_0xff23('0x2f')][_0xff23('0x48')](_0x2df1e8[_0xff23('0x49')],{})[_0xff23('0x27')](respondWithResult(_0x442638,0xc9))[_0xff23('0x43')](handleError(_0x442638,null));};exports[_0xff23('0x4a')]=function(_0x27001c,_0x3ddbd9){if(_0x27001c[_0xff23('0x49')]['id']){delete _0x27001c[_0xff23('0x49')]['id'];}return db[_0xff23('0x2f')][_0xff23('0x47')]({'where':{'id':_0x27001c[_0xff23('0x44')]['id']}})[_0xff23('0x27')](handleEntityNotFound(_0x3ddbd9,null))[_0xff23('0x27')](saveUpdates(_0x27001c['body'],null))[_0xff23('0x27')](respondWithResult(_0x3ddbd9,null))[_0xff23('0x43')](handleError(_0x3ddbd9,null));};exports[_0xff23('0x28')]=function(_0x3c0526,_0x4751a0){return db['ChatInternalMessage']['find']({'where':{'id':_0x3c0526[_0xff23('0x44')]['id']}})[_0xff23('0x27')](handleEntityNotFound(_0x4751a0,null))['then'](removeEntity(_0x4751a0,null))[_0xff23('0x43')](handleError(_0x4751a0,null));};exports[_0xff23('0x4b')]=function(_0x58fc5b,_0x402e40){return db[_0xff23('0x2f')][_0xff23('0x4b')]()[_0xff23('0x27')](respondWithResult(_0x402e40,null))['catch'](handleError(_0x402e40,null));};function wrapUser(_0x5aecd9){return function(_0x5c8199){var _0x50cd74=_0x5aecd9[_0xff23('0x4c')]({'plain':!![]});_0x50cd74[_0xff23('0x4d')]=[];if(_0x5c8199){_0x50cd74['lastMessageAt']=_0x5c8199[_0xff23('0x4e')];_0x50cd74['lastMessage']=_0x5c8199;}else{_0x50cd74['lastMessageAt']=moment(0x0)[_0xff23('0x4f')](_0xff23('0x50'));_0x50cd74['lastMessage']={};}return _0x50cd74;};}exports[_0xff23('0x51')]=function(_0x38c1c2,_0x27bb85,_0x2bc3e4){var _0x245393=[];return db['User'][_0xff23('0x41')]({'where':{'role':['agent',_0xff23('0x52'),_0xff23('0x53')]},'attributes':['id',_0xff23('0x54'),_0xff23('0x2b'),_0xff23('0x55'),_0xff23('0x56'),_0xff23('0x57'),'online',_0xff23('0x58'),_0xff23('0x59'),_0xff23('0x5a')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xff23('0x5b'),'attributes':['id',_0xff23('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xff23('0x27')](function(_0x7533ab){if(_0x7533ab){var _0xdecca8=_0x38c1c2[_0xff23('0x53')][_0xff23('0x4c')]({'plain':!![]});if(!_0xdecca8)throw new Error(_0xff23('0x5c'));if(_0xdecca8[_0xff23('0x55')]===_0xff23('0x53')){return db[_0xff23('0x5d')]['find']({'where':{'name':_0xff23('0x5e'),'userProfileId':_0xdecca8[_0xff23('0x5f')]},'raw':!![]})['then'](function(_0x5ca968){if(_0x5ca968){if(_0x5ca968[_0xff23('0x60')]===0x0){return db[_0xff23('0x61')][_0xff23('0x41')]({'where':{'sectionId':_0x5ca968['id']},'raw':!![]})[_0xff23('0x27')](function(_0x566477){var _0x21e8af=[];if(_[_0xff23('0x62')](_0x566477)){_0x21e8af=_[_0xff23('0x3c')](_0x7533ab,function(_0x29ca38){if(_0x29ca38['role']!=='agent'){return _0x29ca38;}});return _0x21e8af;}else{for(var _0x517618=0x0;_0x517618<_0x7533ab[_0xff23('0x45')];_0x517618++){var _0x24a2c4=_0x7533ab[_0x517618];if(_0x24a2c4['role']==='agent'){var _0x1c7da3=_[_0xff23('0x47')](_0x566477,function(_0xd995a5){return _0xd995a5[_0xff23('0x63')]===_0x24a2c4['id'];});if(_0x1c7da3)_0x21e8af[_0xff23('0x64')](_0x24a2c4);}else{_0x21e8af[_0xff23('0x64')](_0x24a2c4);}}return _0x21e8af;}});}else{return _0x7533ab;}}else{var _0x2441e8=_[_0xff23('0x3c')](_0x7533ab,function(_0x39d9d5){if(_0x39d9d5[_0xff23('0x55')]!==_0xff23('0x65')){return _0x39d9d5;}});return _0x2441e8;}});}else{return _0x7533ab;}}})[_0xff23('0x27')](function(_0x4a5152){var _0x15d88d=[];if(_0x4a5152){_0x245393=_0x4a5152;for(var _0x4af679=0x0;_0x4af679<_0x4a5152[_0xff23('0x45')];_0x4af679+=0x1){_0x245393[_0x4af679][_0xff23('0x4d')]=[];_0x15d88d[_0xff23('0x64')](db[_0xff23('0x2f')][_0xff23('0x47')]({'where':{'FromId':[_0x38c1c2[_0xff23('0x53')]['id'],_0x4a5152[_0x4af679]['id']],'ToId':[_0x38c1c2['user']['id'],_0x4a5152[_0x4af679]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xff23('0x66'),_0xff23('0x67'),_0xff23('0x68'),_0xff23('0x49')],'order':qs[_0xff23('0x69')](_0xff23('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xff23('0x27')](wrapUser(_0x4a5152[_0x4af679])));}return BPromise[_0xff23('0x6b')](_0x15d88d);}return[];})[_0xff23('0x27')](function(_0x10788a){return{'rows':_0x10788a,'count':_0x10788a[_0xff23('0x45')]};})[_0xff23('0x27')](respondWithResult(_0x27bb85,null))[_0xff23('0x43')](handleError(_0x27bb85,null));}; \ No newline at end of file +var _0x7523=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','options','find','create','body','update','describe','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','role','userpic','lastLoginAt','VoiceQueues','get','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','error','name','send','ChatInternalMessage','type','key','model','map','keys'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x7523,0xa5));var _0x3752=function(_0xac2a37,_0x91c8c1){_0xac2a37=_0xac2a37-0x0;var _0x4268b1=_0x7523[_0xac2a37];return _0x4268b1;};'use strict';var emlformat=require(_0x3752('0x0'));var rimraf=require(_0x3752('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3752('0x2'));var rp=require(_0x3752('0x3'));var moment=require('moment');var BPromise=require(_0x3752('0x4'));var Mustache=require(_0x3752('0x5'));var util=require('util');var path=require(_0x3752('0x6'));var sox=require(_0x3752('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3752('0x8'));var _=require(_0x3752('0x9'));var squel=require(_0x3752('0xa'));var crypto=require(_0x3752('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3752('0xc'));var querystring=require(_0x3752('0xd'));var Papa=require(_0x3752('0xe'));var Redis=require(_0x3752('0xf'));var authService=require(_0x3752('0x10'));var qs=require(_0x3752('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3752('0x12'));var logger=require(_0x3752('0x13'))(_0x3752('0x14'));var utils=require(_0x3752('0x15'));var config=require(_0x3752('0x16'));var licenseUtil=require(_0x3752('0x17'));var db=require(_0x3752('0x18'))['db'];config[_0x3752('0x19')]=_[_0x3752('0x1a')](config[_0x3752('0x19')],{'host':_0x3752('0x1b'),'port':0x18eb});var socket=require(_0x3752('0x1c'))(new Redis(config[_0x3752('0x19')]));require(_0x3752('0x1d'))[_0x3752('0x1e')](socket);function respondWithStatusCode(_0x1a688a,_0x4c68e3){_0x4c68e3=_0x4c68e3||0xcc;return function(_0xc77217){if(_0xc77217){return _0x1a688a[_0x3752('0x1f')](_0x4c68e3);}return _0x1a688a['status'](_0x4c68e3)['end']();};}function respondWithResult(_0x3e85f0,_0x4cea05){_0x4cea05=_0x4cea05||0xc8;return function(_0x565ccb){if(_0x565ccb){return _0x3e85f0[_0x3752('0x20')](_0x4cea05)[_0x3752('0x21')](_0x565ccb);}};}function respondWithFilteredResult(_0x23dd48,_0x4941ac){return function(_0x2a52ff){if(_0x2a52ff){var _0x1c5471=typeof _0x4941ac['offset']==='undefined'&&typeof _0x4941ac[_0x3752('0x22')]===_0x3752('0x23');var _0x57d469=_0x2a52ff[_0x3752('0x24')];var _0x1bf5a3=_0x1c5471?0x0:_0x4941ac['offset'];var _0x1fe9aa=_0x1c5471?_0x2a52ff['count']:_0x4941ac[_0x3752('0x25')]+_0x4941ac[_0x3752('0x22')];var _0x4a3181;if(_0x1fe9aa>=_0x57d469){_0x1fe9aa=_0x57d469;_0x4a3181=0xc8;}else{_0x4a3181=0xce;}_0x23dd48['status'](_0x4a3181);return _0x23dd48[_0x3752('0x26')](_0x3752('0x27'),_0x1bf5a3+'-'+_0x1fe9aa+'/'+_0x57d469)[_0x3752('0x21')](_0x2a52ff);}return null;};}function patchUpdates(_0x42b57f){return function(_0x2a9ac1){try{jsonpatch[_0x3752('0x28')](_0x2a9ac1,_0x42b57f,!![]);}catch(_0x215faf){return BPromise[_0x3752('0x29')](_0x215faf);}return _0x2a9ac1['save']();};}function saveUpdates(_0x37e410,_0x40a6a1){return function(_0xb0ba48){if(_0xb0ba48){return _0xb0ba48['update'](_0x37e410)[_0x3752('0x2a')](function(_0x4b00e7){return _0x4b00e7;});}return null;};}function removeEntity(_0x3f48c2,_0x346428){return function(_0x4a39a0){if(_0x4a39a0){return _0x4a39a0[_0x3752('0x2b')]()['then'](function(){_0x3f48c2[_0x3752('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1adbe1,_0x524c25){return function(_0x39275a){if(!_0x39275a){_0x1adbe1[_0x3752('0x1f')](0x194);}return _0x39275a;};}function handleError(_0x2c41f3,_0x122db6){_0x122db6=_0x122db6||0x1f4;return function(_0x33f568){logger[_0x3752('0x2c')](_0x33f568['stack']);if(_0x33f568[_0x3752('0x2d')]){delete _0x33f568[_0x3752('0x2d')];}_0x2c41f3['status'](_0x122db6)[_0x3752('0x2e')](_0x33f568);};}exports['index']=function(_0x387e4e,_0x3cd88b){var _0x3c846a={},_0x5a1ef5={},_0x32e79c={'count':0x0,'rows':[]};var _0x539510=_['map'](db[_0x3752('0x2f')]['rawAttributes'],function(_0x426062){return{'name':_0x426062['fieldName'],'type':_0x426062[_0x3752('0x30')][_0x3752('0x31')]};});_0x5a1ef5[_0x3752('0x32')]=_[_0x3752('0x33')](_0x539510,'name');_0x5a1ef5['query']=_[_0x3752('0x34')](_0x387e4e[_0x3752('0x35')]);_0x5a1ef5[_0x3752('0x36')]=_[_0x3752('0x37')](_0x5a1ef5[_0x3752('0x32')],_0x5a1ef5[_0x3752('0x35')]);_0x3c846a[_0x3752('0x38')]=_[_0x3752('0x37')](_0x5a1ef5[_0x3752('0x32')],qs['fields'](_0x387e4e[_0x3752('0x35')][_0x3752('0x39')]));_0x3c846a[_0x3752('0x38')]=_0x3c846a['attributes'][_0x3752('0x3a')]?_0x3c846a[_0x3752('0x38')]:_0x5a1ef5[_0x3752('0x32')];if(!_0x387e4e['query'][_0x3752('0x3b')](_0x3752('0x3c'))){_0x3c846a[_0x3752('0x22')]=qs[_0x3752('0x22')](_0x387e4e[_0x3752('0x35')][_0x3752('0x22')]);_0x3c846a['offset']=qs['offset'](_0x387e4e[_0x3752('0x35')][_0x3752('0x25')]);}_0x3c846a[_0x3752('0x3d')]=qs[_0x3752('0x3e')](_0x387e4e[_0x3752('0x35')][_0x3752('0x3e')]);_0x3c846a['where']=qs[_0x3752('0x36')](_['pick'](_0x387e4e[_0x3752('0x35')],_0x5a1ef5[_0x3752('0x36')]),_0x539510);if(_0x387e4e[_0x3752('0x35')][_0x3752('0x3f')]){_0x3c846a[_0x3752('0x40')]=_[_0x3752('0x41')](_0x3c846a[_0x3752('0x40')],{'$or':_[_0x3752('0x33')](_0x539510,function(_0x10f18f){if(_0x10f18f['type']!==_0x3752('0x42')){var _0x2f52c0={};_0x2f52c0[_0x10f18f[_0x3752('0x2d')]]={'$like':'%'+_0x387e4e[_0x3752('0x35')][_0x3752('0x3f')]+'%'};return _0x2f52c0;}})});}_0x3c846a=_['merge']({},_0x3c846a,_0x387e4e['options']);var _0x65a81e={'where':_0x3c846a['where']};return db[_0x3752('0x2f')]['count'](_0x65a81e)['then'](function(_0x52ad32){_0x32e79c['count']=_0x52ad32;if(_0x387e4e[_0x3752('0x35')][_0x3752('0x43')]){_0x3c846a[_0x3752('0x44')]=[{'all':!![]}];}return db[_0x3752('0x2f')]['findAll'](_0x3c846a);})['then'](function(_0x503dfc){_0x32e79c['rows']=_0x503dfc;return _0x32e79c;})[_0x3752('0x2a')](respondWithFilteredResult(_0x3cd88b,_0x3c846a))[_0x3752('0x45')](handleError(_0x3cd88b,null));};exports[_0x3752('0x46')]=function(_0x5d640b,_0x173d8f){var _0x1b4746={'raw':!![],'where':{'id':_0x5d640b[_0x3752('0x47')]['id']}},_0x27e4f0={};_0x27e4f0[_0x3752('0x32')]=_['keys'](db[_0x3752('0x2f')][_0x3752('0x48')]);_0x27e4f0[_0x3752('0x35')]=_[_0x3752('0x34')](_0x5d640b[_0x3752('0x35')]);_0x27e4f0[_0x3752('0x36')]=_[_0x3752('0x37')](_0x27e4f0[_0x3752('0x32')],_0x27e4f0[_0x3752('0x35')]);_0x1b4746['attributes']=_[_0x3752('0x37')](_0x27e4f0[_0x3752('0x32')],qs[_0x3752('0x39')](_0x5d640b[_0x3752('0x35')][_0x3752('0x39')]));_0x1b4746[_0x3752('0x38')]=_0x1b4746[_0x3752('0x38')]['length']?_0x1b4746[_0x3752('0x38')]:_0x27e4f0[_0x3752('0x32')];if(_0x5d640b[_0x3752('0x35')]['includeAll']){_0x1b4746[_0x3752('0x44')]=[{'all':!![]}];}_0x1b4746=_[_0x3752('0x41')]({},_0x1b4746,_0x5d640b[_0x3752('0x49')]);return db[_0x3752('0x2f')][_0x3752('0x4a')](_0x1b4746)[_0x3752('0x2a')](handleEntityNotFound(_0x173d8f,null))[_0x3752('0x2a')](respondWithResult(_0x173d8f,null))[_0x3752('0x45')](handleError(_0x173d8f,null));};exports['create']=function(_0x26ff76,_0x1c8c3a){return db[_0x3752('0x2f')][_0x3752('0x4b')](_0x26ff76[_0x3752('0x4c')],{})[_0x3752('0x2a')](respondWithResult(_0x1c8c3a,0xc9))[_0x3752('0x45')](handleError(_0x1c8c3a,null));};exports[_0x3752('0x4d')]=function(_0x440463,_0x59a5da){if(_0x440463[_0x3752('0x4c')]['id']){delete _0x440463['body']['id'];}return db[_0x3752('0x2f')][_0x3752('0x4a')]({'where':{'id':_0x440463[_0x3752('0x47')]['id']}})[_0x3752('0x2a')](handleEntityNotFound(_0x59a5da,null))['then'](saveUpdates(_0x440463[_0x3752('0x4c')],null))['then'](respondWithResult(_0x59a5da,null))['catch'](handleError(_0x59a5da,null));};exports[_0x3752('0x2b')]=function(_0x486d44,_0x45fc00){return db[_0x3752('0x2f')][_0x3752('0x4a')]({'where':{'id':_0x486d44[_0x3752('0x47')]['id']}})['then'](handleEntityNotFound(_0x45fc00,null))[_0x3752('0x2a')](removeEntity(_0x45fc00,null))[_0x3752('0x45')](handleError(_0x45fc00,null));};exports[_0x3752('0x4e')]=function(_0xcbc546,_0x465f4d){return db[_0x3752('0x2f')]['describe']()[_0x3752('0x2a')](respondWithResult(_0x465f4d,null))[_0x3752('0x45')](handleError(_0x465f4d,null));};function wrapUser(_0x2e93b5){return function(_0x10b1df){var _0x570377=_0x2e93b5['get']({'plain':!![]});_0x570377['messages']=[];if(_0x10b1df){_0x570377[_0x3752('0x4f')]=_0x10b1df[_0x3752('0x50')];_0x570377[_0x3752('0x51')]=_0x10b1df;}else{_0x570377['lastMessageAt']=moment(0x0)[_0x3752('0x52')](_0x3752('0x53'));_0x570377[_0x3752('0x51')]={};}return _0x570377;};}exports[_0x3752('0x54')]=function(_0x7c43c9,_0x3437be,_0x554a9b){var _0xe83c01=[];return db[_0x3752('0x55')][_0x3752('0x56')]({'where':{'role':['agent',_0x3752('0x57'),_0x3752('0x58')]},'attributes':['id',_0x3752('0x59'),_0x3752('0x2d'),_0x3752('0x5a'),_0x3752('0x5b'),'internal','online',_0x3752('0x5c'),'allowmessenger','showWebBar'],'order':qs[_0x3752('0x3e')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x3752('0x5d'),'attributes':['id',_0x3752('0x2d'),_0x3752('0x30')],'through':{'attributes':[]}}]})[_0x3752('0x2a')](function(_0x23dd5f){if(_0x23dd5f){var _0x2ac91a=_0x7c43c9[_0x3752('0x58')][_0x3752('0x5e')]({'plain':!![]});if(!_0x2ac91a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ac91a['role']===_0x3752('0x58')){return db[_0x3752('0x5f')]['find']({'where':{'name':_0x3752('0x60'),'userProfileId':_0x2ac91a[_0x3752('0x61')]},'raw':!![]})[_0x3752('0x2a')](function(_0xb39e79){if(_0xb39e79){if(_0xb39e79['autoAssociation']===0x0){return db[_0x3752('0x62')][_0x3752('0x56')]({'where':{'sectionId':_0xb39e79['id']},'raw':!![]})['then'](function(_0x385a49){var _0x487d39=[];if(_[_0x3752('0x63')](_0x385a49)){_0x487d39=_[_0x3752('0x3f')](_0x23dd5f,function(_0x1632ff){if(_0x1632ff[_0x3752('0x5a')]!==_0x3752('0x64')){return _0x1632ff;}});return _0x487d39;}else{for(var _0x16d2a8=0x0;_0x16d2a8<_0x23dd5f[_0x3752('0x3a')];_0x16d2a8++){var _0x23d8d4=_0x23dd5f[_0x16d2a8];if(_0x23d8d4['role']===_0x3752('0x64')){var _0x902c40=_['find'](_0x385a49,function(_0x4b534e){return _0x4b534e[_0x3752('0x65')]===_0x23d8d4['id'];});if(_0x902c40)_0x487d39[_0x3752('0x66')](_0x23d8d4);}else{_0x487d39[_0x3752('0x66')](_0x23d8d4);}}return _0x487d39;}});}else{return _0x23dd5f;}}else{var _0x42f16a=_[_0x3752('0x3f')](_0x23dd5f,function(_0x1feb6e){if(_0x1feb6e[_0x3752('0x5a')]!=='agent'){return _0x1feb6e;}});return _0x42f16a;}});}else{return _0x23dd5f;}}})['then'](function(_0x198651){var _0x42a610=[];if(_0x198651){_0xe83c01=_0x198651;for(var _0x34741e=0x0;_0x34741e<_0x198651[_0x3752('0x3a')];_0x34741e+=0x1){_0xe83c01[_0x34741e][_0x3752('0x67')]=[];_0x42a610[_0x3752('0x66')](db[_0x3752('0x2f')][_0x3752('0x4a')]({'where':{'FromId':[_0x7c43c9[_0x3752('0x58')]['id'],_0x198651[_0x34741e]['id']],'ToId':[_0x7c43c9[_0x3752('0x58')]['id'],_0x198651[_0x34741e]['id']],'ChatGroupId':null},'attributes':['id',_0x3752('0x50'),_0x3752('0x68'),_0x3752('0x69'),_0x3752('0x6a'),_0x3752('0x4c')],'order':qs[_0x3752('0x3e')](_0x3752('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3752('0x2a')](wrapUser(_0x198651[_0x34741e])));}return BPromise[_0x3752('0x6c')](_0x42a610);}return[];})[_0x3752('0x2a')](function(_0x148d28){return{'rows':_0x148d28,'count':_0x148d28[_0x3752('0x3a')]};})[_0x3752('0x2a')](respondWithResult(_0x3437be,null))['catch'](handleError(_0x3437be,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index cff22f7..96b7b42 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 _0x9b2a=['events','ChatInternalMessage','setMaxListeners','remove','emit','hook'];(function(_0x4bd698,_0x21a4ec){var _0x267e29=function(_0x26712c){while(--_0x26712c){_0x4bd698['push'](_0x4bd698['shift']());}};_0x267e29(++_0x21a4ec);}(_0x9b2a,0x8a));var _0xa9b2=function(_0x357137,_0x8a3d07){_0x357137=_0x357137-0x0;var _0x12e8e9=_0x9b2a[_0x357137];return _0x12e8e9;};'use strict';var EventEmitter=require(_0xa9b2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xa9b2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa9b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa9b2('0x3')};function emitEvent(_0x261777){return function(_0x541435,_0x565621,_0x40a3b5){ChatInternalMessageEvents[_0xa9b2('0x4')](_0x261777+':'+_0x541435['id'],_0x541435);ChatInternalMessageEvents[_0xa9b2('0x4')](_0x261777,_0x541435);_0x40a3b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xa9b2('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x6b9f=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','remove'];(function(_0x1c3f30,_0x207ff3){var _0x3dfd9b=function(_0x44edec){while(--_0x44edec){_0x1c3f30['push'](_0x1c3f30['shift']());}};_0x3dfd9b(++_0x207ff3);}(_0x6b9f,0x1db));var _0xf6b9=function(_0x407cb4,_0x422087){_0x407cb4=_0x407cb4-0x0;var _0x3fcb75=_0x6b9f[_0x407cb4];return _0x3fcb75;};'use strict';var EventEmitter=require(_0xf6b9('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xf6b9('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf6b9('0x2')](0x0);var events={'afterCreate':_0xf6b9('0x3'),'afterUpdate':'update','afterDestroy':_0xf6b9('0x4')};function emitEvent(_0x4e18eb){return function(_0x4aafd1,_0x510e04,_0x57a20c){ChatInternalMessageEvents['emit'](_0x4e18eb+':'+_0x4aafd1['id'],_0x4aafd1);ChatInternalMessageEvents['emit'](_0x4e18eb,_0x4aafd1);_0x57a20c(null);};}for(var e in events){if(events[_0xf6b9('0x5')](e)){var event=events[e];ChatInternalMessage[_0xf6b9('0x6')](e,emitEvent(event));}}module[_0xf6b9('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 77267de..4d75173 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 _0xb942=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0xb942,0x109));var _0x2b94=function(_0x351aad,_0x146763){_0x351aad=_0x351aad-0x0;var _0x3f4ef4=_0xb942[_0x351aad];return _0x3f4ef4;};'use strict';var _=require(_0x2b94('0x0'));var util=require('util');var logger=require(_0x2b94('0x1'))('api');var moment=require(_0x2b94('0x2'));var BPromise=require(_0x2b94('0x3'));var rp=require(_0x2b94('0x4'));var fs=require('fs');var path=require(_0x2b94('0x5'));var rimraf=require(_0x2b94('0x6'));var config=require(_0x2b94('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x2b94('0x8')]=function(_0x2e408f,_0xcc215c){return _0x2e408f[_0x2b94('0x9')](_0x2b94('0xa'),attributes,{'tableName':_0x2b94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2b94('0xc')});}; \ No newline at end of file +var _0xe40e=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3282b5,_0x4125ae){var _0x37d176=function(_0x504367){while(--_0x504367){_0x3282b5['push'](_0x3282b5['shift']());}};_0x37d176(++_0x4125ae);}(_0xe40e,0xea));var _0xee40=function(_0x587629,_0x563439){_0x587629=_0x587629-0x0;var _0x3eb026=_0xe40e[_0x587629];return _0x3eb026;};'use strict';var _=require(_0xee40('0x0'));var util=require(_0xee40('0x1'));var logger=require(_0xee40('0x2'))('api');var moment=require(_0xee40('0x3'));var BPromise=require(_0xee40('0x4'));var rp=require(_0xee40('0x5'));var fs=require('fs');var path=require(_0xee40('0x6'));var rimraf=require(_0xee40('0x7'));var config=require(_0xee40('0x8'));var attributes=require(_0xee40('0x9'));module[_0xee40('0xa')]=function(_0x214989,_0x40791a){return _0x214989['define'](_0xee40('0xb'),attributes,{'tableName':_0xee40('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee40('0xd'),'collate':_0xee40('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index de9b971..ade3052 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 _0x6590=['socket.io-emitter','./chatInternalMessage.socket','register','request','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6590,0xa5));var _0x0659=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x6590[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x0659('0x0'));var util=require(_0x0659('0x1'));var moment=require(_0x0659('0x2'));var BPromise=require('bluebird');var rs=require(_0x0659('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0659('0x4'))['db'];var utils=require(_0x0659('0x5'));var logger=require(_0x0659('0x6'))(_0x0659('0x7'));var config=require(_0x0659('0x8'));var jayson=require(_0x0659('0x9'));var client=jayson[_0x0659('0xa')][_0x0659('0xb')]({'port':0x232a});config[_0x0659('0xc')]=_[_0x0659('0xd')](config[_0x0659('0xc')],{'host':_0x0659('0xe'),'port':0x18eb});var socket=require(_0x0659('0xf'))(new Redis(config[_0x0659('0xc')]));require(_0x0659('0x10'))[_0x0659('0x11')](socket);function respondWithRpcPromise(_0x1d8a19,_0x4c10cc,_0x2f7384){return new BPromise(function(_0x5674bd,_0x583b99){return client[_0x0659('0x12')](_0x1d8a19,_0x2f7384)['then'](function(_0x29da37){logger[_0x0659('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c10cc,'request\x20sent');logger[_0x0659('0x14')](_0x0659('0x15'),_0x4c10cc,_0x0659('0x16'),JSON[_0x0659('0x17')](_0x29da37));if(_0x29da37['error']){if(_0x29da37[_0x0659('0x18')][_0x0659('0x19')]===0x1f4){logger[_0x0659('0x18')](_0x0659('0x1a'),_0x4c10cc,_0x29da37[_0x0659('0x18')]['message']);return _0x583b99(_0x29da37[_0x0659('0x18')][_0x0659('0x1b')]);}logger['error'](_0x0659('0x1a'),_0x4c10cc,_0x29da37[_0x0659('0x18')][_0x0659('0x1b')]);return _0x5674bd(_0x29da37[_0x0659('0x18')][_0x0659('0x1b')]);}else{logger[_0x0659('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c10cc,_0x0659('0x16'));_0x5674bd(_0x29da37[_0x0659('0x1c')]['message']);}})[_0x0659('0x1d')](function(_0x14c3a4){logger['error'](_0x0659('0x1a'),_0x4c10cc,_0x14c3a4);_0x583b99(_0x14c3a4);});});} \ No newline at end of file +var _0x49e5=['socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x5d83eb,_0x31658c){var _0x3babd4=function(_0x266981){while(--_0x266981){_0x5d83eb['push'](_0x5d83eb['shift']());}};_0x3babd4(++_0x31658c);}(_0x49e5,0x196));var _0x549e=function(_0x4032d4,_0x4f09aa){_0x4032d4=_0x4032d4-0x0;var _0x40f143=_0x49e5[_0x4032d4];return _0x40f143;};'use strict';var _=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var moment=require(_0x549e('0x2'));var BPromise=require(_0x549e('0x3'));var rs=require(_0x549e('0x4'));var fs=require('fs');var Redis=require(_0x549e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x549e('0x6'));var logger=require(_0x549e('0x7'))(_0x549e('0x8'));var config=require(_0x549e('0x9'));var jayson=require(_0x549e('0xa'));var client=jayson['client'][_0x549e('0xb')]({'port':0x232a});config[_0x549e('0xc')]=_[_0x549e('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x549e('0xe'))(new Redis(config['redis']));require(_0x549e('0xf'))['register'](socket);function respondWithRpcPromise(_0x193ab6,_0x59c271,_0x25d3a7){return new BPromise(function(_0x3d28a9,_0x5826ec){return client['request'](_0x193ab6,_0x25d3a7)[_0x549e('0x10')](function(_0x486fe2){logger[_0x549e('0x11')](_0x549e('0x12'),_0x59c271,'request\x20sent');logger[_0x549e('0x13')](_0x549e('0x14'),_0x59c271,_0x549e('0x15'),JSON[_0x549e('0x16')](_0x486fe2));if(_0x486fe2['error']){if(_0x486fe2[_0x549e('0x17')][_0x549e('0x18')]===0x1f4){logger[_0x549e('0x17')](_0x549e('0x12'),_0x59c271,_0x486fe2[_0x549e('0x17')]['message']);return _0x5826ec(_0x486fe2[_0x549e('0x17')][_0x549e('0x19')]);}logger[_0x549e('0x17')](_0x549e('0x12'),_0x59c271,_0x486fe2[_0x549e('0x17')][_0x549e('0x19')]);return _0x3d28a9(_0x486fe2[_0x549e('0x17')]['message']);}else{logger[_0x549e('0x11')](_0x549e('0x12'),_0x59c271,_0x549e('0x15'));_0x3d28a9(_0x486fe2[_0x549e('0x1a')][_0x549e('0x19')]);}})[_0x549e('0x1b')](function(_0x598f70){logger['error'](_0x549e('0x12'),_0x59c271,_0x598f70);_0x5826ec(_0x598f70);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 6bfad90..a73e041 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 _0xe296=['removeListener','length','./chatInternalMessage.events','remove'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xe296,0x7a));var _0x6e29=function(_0x105953,_0x15b1d1){_0x105953=_0x105953-0x0;var _0x401196=_0xe296[_0x105953];return _0x401196;};'use strict';var ChatInternalMessageEvents=require(_0x6e29('0x0'));var events=['save',_0x6e29('0x1'),'update'];function createListener(_0x514233,_0x222150){return function(_0x585663){_0x222150['emit'](_0x514233,_0x585663);};}function removeListener(_0x270d8f,_0x5da018){return function(){ChatInternalMessageEvents[_0x6e29('0x2')](_0x270d8f,_0x5da018);};}exports['register']=function(_0x2250a8){for(var _0x2a168a=0x0,_0x279b10=events[_0x6e29('0x3')];_0x2a168a<_0x279b10;_0x2a168a++){var _0x424b06=events[_0x2a168a];var _0x22ad3e=createListener('chatInternalMessage:'+_0x424b06,_0x2250a8);ChatInternalMessageEvents['on'](_0x424b06,_0x22ad3e);}}; \ No newline at end of file +var _0xcf26=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener','register','length'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xcf26,0x1e9));var _0x6cf2=function(_0x2c9f51,_0x2eec01){_0x2c9f51=_0x2c9f51-0x0;var _0x12abf9=_0xcf26[_0x2c9f51];return _0x12abf9;};'use strict';var ChatInternalMessageEvents=require(_0x6cf2('0x0'));var events=[_0x6cf2('0x1'),_0x6cf2('0x2'),_0x6cf2('0x3')];function createListener(_0x375590,_0x1d0e06){return function(_0x360140){_0x1d0e06['emit'](_0x375590,_0x360140);};}function removeListener(_0x54eb34,_0x1e7846){return function(){ChatInternalMessageEvents[_0x6cf2('0x4')](_0x54eb34,_0x1e7846);};}exports[_0x6cf2('0x5')]=function(_0x380cad){for(var _0x151480=0x0,_0x904bbd=events[_0x6cf2('0x6')];_0x151480<_0x904bbd;_0x151480++){var _0x2af339=events[_0x151480];var _0x376c3c=createListener(_0x6cf2('0x7')+_0x2af339,_0x380cad);ChatInternalMessageEvents['on'](_0x2af339,_0x376c3c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 5adc0b9..9a26d83 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 _0x4f7c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x1f83dc,_0x3e322b){var _0x5427fa=function(_0x42c079){while(--_0x42c079){_0x1f83dc['push'](_0x1f83dc['shift']());}};_0x5427fa(++_0x3e322b);}(_0x4f7c,0x114));var _0xc4f7=function(_0x387738,_0x2d338a){_0x387738=_0x387738-0x0;var _0x913de0=_0x4f7c[_0x387738];return _0x913de0;};'use strict';var multer=require(_0xc4f7('0x0'));var util=require(_0xc4f7('0x1'));var path=require(_0xc4f7('0x2'));var timeout=require(_0xc4f7('0x3'));var express=require(_0xc4f7('0x4'));var router=express[_0xc4f7('0x5')]();var fs_extra=require(_0xc4f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc4f7('0x7'));var config=require(_0xc4f7('0x8'));var controller=require(_0xc4f7('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc4f7('0xa')]('/describe',auth[_0xc4f7('0xb')](),controller[_0xc4f7('0xc')]);router[_0xc4f7('0xa')](_0xc4f7('0xd'),auth[_0xc4f7('0xb')](),controller[_0xc4f7('0xe')]);router['get'](_0xc4f7('0xf'),auth[_0xc4f7('0xb')](),controller[_0xc4f7('0x10')]);router[_0xc4f7('0x11')]('/',auth['isAuthenticated'](),controller[_0xc4f7('0x12')]);router['put']('/:id',controller[_0xc4f7('0x13')]);router[_0xc4f7('0x14')](_0xc4f7('0xf'),auth[_0xc4f7('0xb')](),controller[_0xc4f7('0x15')]);module[_0xc4f7('0x16')]=router; \ No newline at end of file +var _0x462a=['/users','getUsers','show','post','/:id','update','delete','destroy','util','path','connect-timeout','express','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x4c7b7a,_0x334615){var _0x3f680d=function(_0x1cfada){while(--_0x1cfada){_0x4c7b7a['push'](_0x4c7b7a['shift']());}};_0x3f680d(++_0x334615);}(_0x462a,0xe0));var _0xa462=function(_0x2b3c9d,_0x1c8c0c){_0x2b3c9d=_0x2b3c9d-0x0;var _0x4b8037=_0x462a[_0x2b3c9d];return _0x4b8037;};'use strict';var multer=require('multer');var util=require(_0xa462('0x0'));var path=require(_0xa462('0x1'));var timeout=require(_0xa462('0x2'));var express=require(_0xa462('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa462('0x4'));var config=require('../../config/environment');var controller=require(_0xa462('0x5'));router['get']('/',auth[_0xa462('0x6')](),controller[_0xa462('0x7')]);router[_0xa462('0x8')](_0xa462('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa462('0xa'),auth[_0xa462('0x6')](),controller[_0xa462('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa462('0xc')]);router[_0xa462('0xd')]('/',auth[_0xa462('0x6')](),controller['create']);router['put'](_0xa462('0xe'),controller[_0xa462('0xf')]);router[_0xa462('0x10')]('/:id',auth[_0xa462('0x6')](),controller[_0xa462('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 9a5fd83..9661bcc 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 _0x3f72=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0xf5ac5f,_0x463168){var _0x3e70df=function(_0x3e8cdd){while(--_0x3e8cdd){_0xf5ac5f['push'](_0xf5ac5f['shift']());}};_0x3e70df(++_0x463168);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x23f7('0x0'));module[_0x23f7('0x1')]={'body':{'type':Sequelize[_0x23f7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x23f7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x23f7('0x4')]('in',_0x23f7('0x5')),'defaultValue':_0x23f7('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x23f7('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x23f7('0x2')]}}; \ No newline at end of file +var _0x9ffd=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2d9592,_0x42959b){_0x2d9592=_0x2d9592-0x0;var _0x2bc946=_0x9ffd[_0x2d9592];return _0x2bc946;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'body':{'type':Sequelize[_0xd9ff('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9ff('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9ff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9ff('0x4')]('in',_0xd9ff('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xd9ff('0x6')]},'providerName':{'type':Sequelize[_0xd9ff('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index c8dfb85..a09077e 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 _0xa5a9=['accept','chat','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','QueryTypes','SELECT','fullname','internal','reject','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','filters','model','attributes','intersection','length','hasOwnProperty','query','order','sort','where','filter','merge','include','findAll','rows','catch','show','params','keys','fields','includeAll','create','update','body','find','describe','chat-interactions'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xa5a9,0x1c7));var _0x9a5a=function(_0x301b5a,_0xfb349a){_0x301b5a=_0x301b5a-0x0;var _0x18badb=_0xa5a9[_0x301b5a];return _0x18badb;};'use strict';var emlformat=require(_0x9a5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a5a('0x1'));var jsonpatch=require(_0x9a5a('0x2'));var rp=require(_0x9a5a('0x3'));var moment=require(_0x9a5a('0x4'));var BPromise=require(_0x9a5a('0x5'));var Mustache=require('mustache');var util=require(_0x9a5a('0x6'));var path=require('path');var sox=require(_0x9a5a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a5a('0x8'));var _=require(_0x9a5a('0x9'));var squel=require(_0x9a5a('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a5a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9a5a('0xc'));var querystring=require(_0x9a5a('0xd'));var Papa=require(_0x9a5a('0xe'));var Redis=require(_0x9a5a('0xf'));var authService=require(_0x9a5a('0x10'));var qs=require(_0x9a5a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a5a('0x12'));var logger=require(_0x9a5a('0x13'))(_0x9a5a('0x14'));var utils=require(_0x9a5a('0x15'));var config=require(_0x9a5a('0x16'));var licenseUtil=require(_0x9a5a('0x17'));var db=require(_0x9a5a('0x18'))['db'];config[_0x9a5a('0x19')]=_[_0x9a5a('0x1a')](config[_0x9a5a('0x19')],{'host':_0x9a5a('0x1b'),'port':0x18eb});var socket=require(_0x9a5a('0x1c'))(new Redis(config['redis']));require(_0x9a5a('0x1d'))[_0x9a5a('0x1e')](socket);var jayson=require(_0x9a5a('0x1f'));var client=jayson['client'][_0x9a5a('0x20')]({'port':0x232c});var client9002=jayson[_0x9a5a('0x21')][_0x9a5a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x551a3c,_0x3726d6,_0x5356de,_0x51d984){return new BPromise(function(_0x5e97fb,_0x259192){var _0x238080=_0x51d984||client;return _0x238080[_0x9a5a('0x22')](_0x551a3c,_0x5356de)[_0x9a5a('0x23')](function(_0x4f7e21){logger[_0x9a5a('0x24')](_0x9a5a('0x25'),_0x3726d6,_0x9a5a('0x26'));logger[_0x9a5a('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3726d6,_0x9a5a('0x26'),JSON['stringify'](_0x4f7e21));if(_0x4f7e21[_0x9a5a('0x28')]){if(_0x4f7e21[_0x9a5a('0x28')][_0x9a5a('0x29')]===0x1f4){logger[_0x9a5a('0x28')](_0x9a5a('0x25'),_0x3726d6,_0x4f7e21[_0x9a5a('0x28')]['message']);return _0x259192(_0x4f7e21[_0x9a5a('0x28')][_0x9a5a('0x2a')]);}logger[_0x9a5a('0x28')]('ChatMessage,\x20%s,\x20%s',_0x3726d6,_0x4f7e21[_0x9a5a('0x28')][_0x9a5a('0x2a')]);return _0x5e97fb(_0x4f7e21[_0x9a5a('0x28')][_0x9a5a('0x2a')]);}else{logger[_0x9a5a('0x24')](_0x9a5a('0x25'),_0x3726d6,'request\x20sent');_0x5e97fb(_0x4f7e21[_0x9a5a('0x2b')][_0x9a5a('0x2a')]);}})['catch'](function(_0x4a9104){logger[_0x9a5a('0x28')](_0x9a5a('0x25'),_0x3726d6,_0x4a9104);_0x259192(_0x4a9104);});});}function respondWithStatusCode(_0x521a97,_0x388dff){_0x388dff=_0x388dff||0xcc;return function(_0xef11aa){if(_0xef11aa){return _0x521a97[_0x9a5a('0x2c')](_0x388dff);}return _0x521a97[_0x9a5a('0x2d')](_0x388dff)['end']();};}function respondWithResult(_0x29342f,_0x214168){_0x214168=_0x214168||0xc8;return function(_0x3e1fca){if(_0x3e1fca){return _0x29342f[_0x9a5a('0x2d')](_0x214168)[_0x9a5a('0x2e')](_0x3e1fca);}};}function respondWithFilteredResult(_0x4274d7,_0x3c7954){return function(_0x2f9aa9){if(_0x2f9aa9){var _0x54b921=typeof _0x3c7954[_0x9a5a('0x2f')]==='undefined'&&typeof _0x3c7954[_0x9a5a('0x30')]===_0x9a5a('0x31');var _0x2b96cf=_0x2f9aa9[_0x9a5a('0x32')];var _0xd351fa=_0x54b921?0x0:_0x3c7954['offset'];var _0x1f0d7f=_0x54b921?_0x2f9aa9[_0x9a5a('0x32')]:_0x3c7954['offset']+_0x3c7954[_0x9a5a('0x30')];var _0x4171bd;if(_0x1f0d7f>=_0x2b96cf){_0x1f0d7f=_0x2b96cf;_0x4171bd=0xc8;}else{_0x4171bd=0xce;}_0x4274d7['status'](_0x4171bd);return _0x4274d7[_0x9a5a('0x33')](_0x9a5a('0x34'),_0xd351fa+'-'+_0x1f0d7f+'/'+_0x2b96cf)[_0x9a5a('0x2e')](_0x2f9aa9);}return null;};}function patchUpdates(_0x46c4f0){return function(_0x36a93b){try{jsonpatch[_0x9a5a('0x35')](_0x36a93b,_0x46c4f0,!![]);}catch(_0x1b7ad4){return BPromise['reject'](_0x1b7ad4);}return _0x36a93b['save']();};}function saveUpdates(_0x43b93d,_0x47d31b){return function(_0x4614ce){if(_0x4614ce){return _0x4614ce['update'](_0x43b93d)[_0x9a5a('0x23')](function(_0x2e1abf){return _0x2e1abf;});}return null;};}function removeEntity(_0x41bb2a,_0x55c402){return function(_0x2dabad){if(_0x2dabad){return _0x2dabad[_0x9a5a('0x36')]()['then'](function(){_0x41bb2a['status'](0xcc)[_0x9a5a('0x37')]();});}};}function handleEntityNotFound(_0x2b8814,_0x4a6937){return function(_0x65c32e){if(!_0x65c32e){_0x2b8814[_0x9a5a('0x2c')](0x194);}return _0x65c32e;};}function handleError(_0x161b18,_0x492593){_0x492593=_0x492593||0x1f4;return function(_0x594bf0){logger['error'](_0x594bf0[_0x9a5a('0x38')]);if(_0x594bf0[_0x9a5a('0x39')]){delete _0x594bf0[_0x9a5a('0x39')];}_0x161b18[_0x9a5a('0x2d')](_0x492593)[_0x9a5a('0x3a')](_0x594bf0);};}exports[_0x9a5a('0x3b')]=function(_0x5380ac,_0x301eb0){var _0x41498b={},_0x3a8aa3={},_0x1d5152={'count':0x0,'rows':[]};var _0x547c3d=_[_0x9a5a('0x3c')](db[_0x9a5a('0x3d')][_0x9a5a('0x3e')],function(_0x23490b){return{'name':_0x23490b[_0x9a5a('0x3f')],'type':_0x23490b[_0x9a5a('0x40')][_0x9a5a('0x41')]};});_0x3a8aa3['model']=_[_0x9a5a('0x3c')](_0x547c3d,_0x9a5a('0x39'));_0x3a8aa3['query']=_['keys'](_0x5380ac['query']);_0x3a8aa3[_0x9a5a('0x42')]=_['intersection'](_0x3a8aa3[_0x9a5a('0x43')],_0x3a8aa3['query']);_0x41498b[_0x9a5a('0x44')]=_[_0x9a5a('0x45')](_0x3a8aa3[_0x9a5a('0x43')],qs['fields'](_0x5380ac['query']['fields']));_0x41498b[_0x9a5a('0x44')]=_0x41498b['attributes'][_0x9a5a('0x46')]?_0x41498b['attributes']:_0x3a8aa3['model'];if(!_0x5380ac['query'][_0x9a5a('0x47')]('nolimit')){_0x41498b[_0x9a5a('0x30')]=qs['limit'](_0x5380ac[_0x9a5a('0x48')][_0x9a5a('0x30')]);_0x41498b[_0x9a5a('0x2f')]=qs[_0x9a5a('0x2f')](_0x5380ac[_0x9a5a('0x48')][_0x9a5a('0x2f')]);}_0x41498b[_0x9a5a('0x49')]=qs[_0x9a5a('0x4a')](_0x5380ac[_0x9a5a('0x48')][_0x9a5a('0x4a')]);_0x41498b[_0x9a5a('0x4b')]=qs['filters'](_['pick'](_0x5380ac[_0x9a5a('0x48')],_0x3a8aa3[_0x9a5a('0x42')]),_0x547c3d);if(_0x5380ac[_0x9a5a('0x48')][_0x9a5a('0x4c')]){_0x41498b['where']=_[_0x9a5a('0x4d')](_0x41498b[_0x9a5a('0x4b')],{'$or':_[_0x9a5a('0x3c')](_0x547c3d,function(_0x2e3262){if(_0x2e3262['type']!=='VIRTUAL'){var _0x48d22d={};_0x48d22d[_0x2e3262[_0x9a5a('0x39')]]={'$like':'%'+_0x5380ac['query'][_0x9a5a('0x4c')]+'%'};return _0x48d22d;}})});}_0x41498b=_[_0x9a5a('0x4d')]({},_0x41498b,_0x5380ac['options']);var _0x227070={'where':_0x41498b[_0x9a5a('0x4b')]};return db[_0x9a5a('0x3d')][_0x9a5a('0x32')](_0x227070)['then'](function(_0x676261){_0x1d5152[_0x9a5a('0x32')]=_0x676261;if(_0x5380ac['query']['includeAll']){_0x41498b[_0x9a5a('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0x9a5a('0x4f')](_0x41498b);})['then'](function(_0x2160cc){_0x1d5152[_0x9a5a('0x50')]=_0x2160cc;return _0x1d5152;})[_0x9a5a('0x23')](respondWithFilteredResult(_0x301eb0,_0x41498b))[_0x9a5a('0x51')](handleError(_0x301eb0,null));};exports[_0x9a5a('0x52')]=function(_0x42dcbe,_0x209dfc){var _0x49fac9={'raw':!![],'where':{'id':_0x42dcbe[_0x9a5a('0x53')]['id']}},_0x4f0e4a={};_0x4f0e4a[_0x9a5a('0x43')]=_[_0x9a5a('0x54')](db[_0x9a5a('0x3d')][_0x9a5a('0x3e')]);_0x4f0e4a[_0x9a5a('0x48')]=_[_0x9a5a('0x54')](_0x42dcbe['query']);_0x4f0e4a[_0x9a5a('0x42')]=_['intersection'](_0x4f0e4a[_0x9a5a('0x43')],_0x4f0e4a['query']);_0x49fac9[_0x9a5a('0x44')]=_[_0x9a5a('0x45')](_0x4f0e4a[_0x9a5a('0x43')],qs[_0x9a5a('0x55')](_0x42dcbe[_0x9a5a('0x48')][_0x9a5a('0x55')]));_0x49fac9['attributes']=_0x49fac9[_0x9a5a('0x44')]['length']?_0x49fac9['attributes']:_0x4f0e4a[_0x9a5a('0x43')];if(_0x42dcbe[_0x9a5a('0x48')][_0x9a5a('0x56')]){_0x49fac9[_0x9a5a('0x4e')]=[{'all':!![]}];}_0x49fac9=_[_0x9a5a('0x4d')]({},_0x49fac9,_0x42dcbe['options']);return db[_0x9a5a('0x3d')]['find'](_0x49fac9)[_0x9a5a('0x23')](handleEntityNotFound(_0x209dfc,null))[_0x9a5a('0x23')](respondWithResult(_0x209dfc,null))[_0x9a5a('0x51')](handleError(_0x209dfc,null));};exports[_0x9a5a('0x57')]=function(_0x46448e,_0x225f90){return db[_0x9a5a('0x3d')][_0x9a5a('0x57')](_0x46448e['body'],{})[_0x9a5a('0x23')](respondWithResult(_0x225f90,0xc9))['catch'](handleError(_0x225f90,null));};exports[_0x9a5a('0x58')]=function(_0x202226,_0x4542b2){if(_0x202226[_0x9a5a('0x59')]['id']){delete _0x202226[_0x9a5a('0x59')]['id'];}return db[_0x9a5a('0x3d')][_0x9a5a('0x5a')]({'where':{'id':_0x202226[_0x9a5a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4542b2,null))['then'](saveUpdates(_0x202226[_0x9a5a('0x59')],null))['then'](respondWithResult(_0x4542b2,null))[_0x9a5a('0x51')](handleError(_0x4542b2,null));};exports['destroy']=function(_0x370977,_0x24dd34){return db[_0x9a5a('0x3d')]['find']({'where':{'id':_0x370977[_0x9a5a('0x53')]['id']}})[_0x9a5a('0x23')](handleEntityNotFound(_0x24dd34,null))[_0x9a5a('0x23')](removeEntity(_0x24dd34,null))['catch'](handleError(_0x24dd34,null));};exports[_0x9a5a('0x5b')]=function(_0x25438c,_0x2f9646){return db[_0x9a5a('0x3d')]['describe']()[_0x9a5a('0x23')](respondWithResult(_0x2f9646,null))[_0x9a5a('0x51')](handleError(_0x2f9646,null));};var interaction_log=require('../../config/logger')(_0x9a5a('0x5c'));exports[_0x9a5a('0x5d')]=function(_0x1c4ec3,_0x41dc7f,_0xdbd48f){var _0x417403={'agent':{},'channel':_0x9a5a('0x5e')};if(_0x1c4ec3['body']['id']){delete _0x1c4ec3['body']['id'];}_0x1c4ec3[_0x9a5a('0x59')]['read']=!![];_0x1c4ec3[_0x9a5a('0x59')][_0x9a5a('0x5f')]=moment()[_0x9a5a('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c4ec3[_0x9a5a('0x59')][_0x9a5a('0x61')]=_0x1c4ec3[_0x9a5a('0x59')]['UserId']||_0x1c4ec3[_0x9a5a('0x62')]['id'];_0x417403[_0x9a5a('0x63')]['id']=_0x1c4ec3['body']['UserId'];return db[_0x9a5a('0x3d')][_0x9a5a('0x5a')]({'where':{'id':_0x1c4ec3[_0x9a5a('0x53')]['id'],'UserId':null}})[_0x9a5a('0x23')](handleEntityNotFound(_0x41dc7f,null))[_0x9a5a('0x23')](saveUpdates(_0x1c4ec3[_0x9a5a('0x59')],null))[_0x9a5a('0x23')](function(_0x4f2758){if(_0x4f2758){_0x417403[_0x9a5a('0x2a')]=_0x4f2758[_0x9a5a('0x64')]({'plain':!![]});return db[_0x9a5a('0x65')][_0x9a5a('0x5a')]({'where':{'id':_0x4f2758[_0x9a5a('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x41dc7f,null))[_0x9a5a('0x23')](function(_0x7048b6){if(_0x7048b6){return _0x7048b6[_0x9a5a('0x58')]({'UserId':_0x1c4ec3[_0x9a5a('0x59')][_0x9a5a('0x61')],'read1stAt':_[_0x9a5a('0x67')](_0x7048b6[_0x9a5a('0x68')])?moment()[_0x9a5a('0x60')](_0x9a5a('0x69')):undefined});}return null;})[_0x9a5a('0x23')](function(_0x450792){if(_0x450792){_0x417403[_0x9a5a('0x6a')]=_0x450792['get']({'plain':!![]});interaction_log[_0x9a5a('0x24')](_0x9a5a('0x6b'),_0x1c4ec3[_0x9a5a('0x62')]['id'],_0x1c4ec3[_0x9a5a('0x62')][_0x9a5a('0x39')],_0x1c4ec3['user']['role'],_0x417403[_0x9a5a('0x6a')]['id'],_0x1c4ec3[_0x9a5a('0x59')]?JSON[_0x9a5a('0x6c')](_0x1c4ec3['body']):_0x9a5a('0x6d'));return respondWithRpcPromise(_0x9a5a('0x6e'),_0x9a5a('0x6f'),_0x417403);}return null;})[_0x9a5a('0x23')](function(_0x1e24b7){var _0x23eba0=_0x9a5a('0x70')+_0x1e24b7[_0x9a5a('0x2a')][_0x9a5a('0x71')];return db['sequelize'][_0x9a5a('0x48')](_0x23eba0,{'type':db[_0x9a5a('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9a5a('0x23')](function(_0x38236f){return _0x38236f;});})[_0x9a5a('0x23')](function(_0x24604a){if(_0x24604a){_0x417403[_0x9a5a('0x2a')][_0x9a5a('0x73')]=_0x24604a[0x0];if(!_0x1c4ec3[_0x9a5a('0x59')][_0x9a5a('0x61')])return;return db[_0x9a5a('0x74')]['find']({'where':{'id':_0x1c4ec3[_0x9a5a('0x59')]['UserId'],'role':_0x9a5a('0x63')},'attributes':['id',_0x9a5a('0x39'),'fullname',_0x9a5a('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x39d985){if(!_0x39d985)return null;_0x417403[_0x9a5a('0x2a')][_0x9a5a('0x63')]=_0x39d985;return _0x417403;})[_0x9a5a('0x23')](function(_0x1d3024){if(_0x1d3024){if(_0x1c4ec3['body'][_0x9a5a('0x76')]){_0x417403[_0x9a5a('0x2a')]['interface']=util[_0x9a5a('0x60')](_0x9a5a('0x77'),_0x1c4ec3[_0x9a5a('0x62')][_0x9a5a('0x39')]);_0x417403[_0x9a5a('0x2a')][_0x9a5a('0x78')]=_0x417403[_0x9a5a('0x78')];_0x417403[_0x9a5a('0x2a')][_0x9a5a('0x79')]=_0x417403[_0x9a5a('0x78')];_0x417403[_0x9a5a('0x2a')][_0x9a5a('0x7a')]='accept';return respondWithRpcPromise(_0x9a5a('0x7b'),_0x9a5a('0x7b'),{'event':_0x9a5a('0x7c'),'message':_[_0x9a5a('0x4d')](_0x417403['message'],JSON['parse'](_0x417403[_0x9a5a('0x6a')][_0x9a5a('0x7d')]))},client9002)['then'](function(){return _0x417403;});}return _0x417403;}return null;})['then'](respondWithResult(_0x41dc7f,null))[_0x9a5a('0x51')](handleError(_0x41dc7f,null));};var interaction_log=require(_0x9a5a('0x13'))(_0x9a5a('0x5c'));exports['reject']=function(_0x19c38e,_0x4e4f3b,_0x4d6050){var _0x4653e8={'agent':{},'channel':'chat'};if(_0x19c38e['body']['id']){delete _0x19c38e[_0x9a5a('0x59')]['id'];}_0x19c38e[_0x9a5a('0x59')]['UserId']=_0x19c38e[_0x9a5a('0x59')][_0x9a5a('0x61')]||_0x19c38e[_0x9a5a('0x62')]['id'];_0x4653e8[_0x9a5a('0x63')]['id']=_0x19c38e['body'][_0x9a5a('0x61')];return db[_0x9a5a('0x3d')][_0x9a5a('0x5a')]({'where':{'id':_0x19c38e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e4f3b,null))[_0x9a5a('0x23')](function(_0x3fa4f6){if(_0x3fa4f6){_0x4653e8['message']=_0x3fa4f6[_0x9a5a('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x9a5a('0x5a')]({'where':{'id':_0x3fa4f6['ChatInteractionId']}});}return null;})[_0x9a5a('0x23')](handleEntityNotFound(_0x4e4f3b,null))['then'](function(_0x3b28ad){if(_0x3b28ad){_0x4653e8[_0x9a5a('0x6a')]=_0x3b28ad['get']({'plain':!![]});interaction_log[_0x9a5a('0x24')](_0x9a5a('0x7e'),_0x19c38e[_0x9a5a('0x62')]['id'],_0x19c38e[_0x9a5a('0x62')][_0x9a5a('0x39')],_0x19c38e[_0x9a5a('0x62')][_0x9a5a('0x7f')],_0x4653e8[_0x9a5a('0x6a')]['id'],_0x19c38e['body']?JSON[_0x9a5a('0x6c')](_0x19c38e['body']):'null');return respondWithRpcPromise(_0x9a5a('0x80'),_0x9a5a('0x81'),_0x4653e8);}return null;})['then'](function(_0x4a398a){var _0xd9dd2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a398a[_0x9a5a('0x2a')][_0x9a5a('0x71')];return db[_0x9a5a('0x82')][_0x9a5a('0x48')](_0xd9dd2,{'type':db[_0x9a5a('0x72')][_0x9a5a('0x83')][_0x9a5a('0x84')],'raw':!![]})[_0x9a5a('0x23')](function(_0x46ae54){return _0x46ae54;});})[_0x9a5a('0x23')](function(_0xc08b47){if(_0xc08b47){_0x4653e8[_0x9a5a('0x2a')]['contact']=_0xc08b47[0x0];if(!_0x19c38e['body'][_0x9a5a('0x61')])return;return db[_0x9a5a('0x74')][_0x9a5a('0x5a')]({'where':{'id':_0x19c38e[_0x9a5a('0x59')]['UserId'],'role':_0x9a5a('0x63')},'attributes':['id',_0x9a5a('0x39'),_0x9a5a('0x85'),_0x9a5a('0x75'),_0x9a5a('0x86')],'raw':!![]});}return null;})[_0x9a5a('0x23')](function(_0xa4cab7){if(!_0xa4cab7)return null;_0x4653e8['message']['agent']=_0xa4cab7;return _0x4653e8;})[_0x9a5a('0x23')](function(_0x1d4ed4){if(_0x1d4ed4){_0x1d4ed4[_0x9a5a('0x2a')]['interface']=util[_0x9a5a('0x60')](_0x9a5a('0x77'),_0x19c38e[_0x9a5a('0x62')][_0x9a5a('0x39')]);_0x1d4ed4[_0x9a5a('0x2a')]['channel']=_0x4653e8['channel'];_0x1d4ed4[_0x9a5a('0x2a')][_0x9a5a('0x79')]=_0x4653e8[_0x9a5a('0x78')];_0x1d4ed4['message'][_0x9a5a('0x7a')]=_0x9a5a('0x87');respondWithRpcPromise(_0x9a5a('0x7b'),_0x9a5a('0x7b'),{'event':'rejectmessage','message':_[_0x9a5a('0x4d')](_0x4653e8[_0x9a5a('0x2a')],JSON[_0x9a5a('0x88')](_0x4653e8[_0x9a5a('0x6a')][_0x9a5a('0x7d')]))},client9002);return _0x4653e8;}return null;})[_0x9a5a('0x23')](respondWithResult(_0x4e4f3b,null))['catch'](handleError(_0x4e4f3b,null));}; \ No newline at end of file +var _0xfdb6=['query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','params','find','create','body','describe','../../config/logger','chat-interactions','read','format','UserId','user','agent','get','ChatInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','email','interface','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','map'];(function(_0x767352,_0x5af5a6){var _0x49a9f8=function(_0x1582a3){while(--_0x1582a3){_0x767352['push'](_0x767352['shift']());}};_0x49a9f8(++_0x5af5a6);}(_0xfdb6,0x1af));var _0x6fdb=function(_0x2d74b6,_0xc88164){_0x2d74b6=_0x2d74b6-0x0;var _0x73160a=_0xfdb6[_0x2d74b6];return _0x73160a;};'use strict';var emlformat=require(_0x6fdb('0x0'));var rimraf=require(_0x6fdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6fdb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6fdb('0x3'));var Mustache=require(_0x6fdb('0x4'));var util=require(_0x6fdb('0x5'));var path=require(_0x6fdb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fdb('0x7'));var _=require(_0x6fdb('0x8'));var squel=require(_0x6fdb('0x9'));var crypto=require(_0x6fdb('0xa'));var jsforce=require(_0x6fdb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6fdb('0xc'));var querystring=require(_0x6fdb('0xd'));var Papa=require(_0x6fdb('0xe'));var Redis=require(_0x6fdb('0xf'));var authService=require(_0x6fdb('0x10'));var qs=require(_0x6fdb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fdb('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6fdb('0x13'));var config=require(_0x6fdb('0x14'));var licenseUtil=require(_0x6fdb('0x15'));var db=require(_0x6fdb('0x16'))['db'];config['redis']=_[_0x6fdb('0x17')](config[_0x6fdb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fdb('0x19'))(new Redis(config[_0x6fdb('0x18')]));require('./chatMessage.socket')[_0x6fdb('0x1a')](socket);var jayson=require(_0x6fdb('0x1b'));var client=jayson[_0x6fdb('0x1c')][_0x6fdb('0x1d')]({'port':0x232c});var client9002=jayson[_0x6fdb('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd569,_0x55d6b4,_0xdd4be,_0x29e791){return new BPromise(function(_0x248597,_0xb4cdf2){var _0x43f506=_0x29e791||client;return _0x43f506['request'](_0x2dd569,_0xdd4be)[_0x6fdb('0x1e')](function(_0xd486e1){logger[_0x6fdb('0x1f')](_0x6fdb('0x20'),_0x55d6b4,_0x6fdb('0x21'));logger[_0x6fdb('0x22')](_0x6fdb('0x23'),_0x55d6b4,'request\x20sent',JSON[_0x6fdb('0x24')](_0xd486e1));if(_0xd486e1[_0x6fdb('0x25')]){if(_0xd486e1[_0x6fdb('0x25')]['code']===0x1f4){logger[_0x6fdb('0x25')]('ChatMessage,\x20%s,\x20%s',_0x55d6b4,_0xd486e1[_0x6fdb('0x25')][_0x6fdb('0x26')]);return _0xb4cdf2(_0xd486e1[_0x6fdb('0x25')][_0x6fdb('0x26')]);}logger[_0x6fdb('0x25')](_0x6fdb('0x20'),_0x55d6b4,_0xd486e1[_0x6fdb('0x25')][_0x6fdb('0x26')]);return _0x248597(_0xd486e1[_0x6fdb('0x25')][_0x6fdb('0x26')]);}else{logger['info'](_0x6fdb('0x20'),_0x55d6b4,_0x6fdb('0x21'));_0x248597(_0xd486e1['result'][_0x6fdb('0x26')]);}})['catch'](function(_0x36dbaf){logger[_0x6fdb('0x25')](_0x6fdb('0x20'),_0x55d6b4,_0x36dbaf);_0xb4cdf2(_0x36dbaf);});});}function respondWithStatusCode(_0x30a34e,_0x4a6350){_0x4a6350=_0x4a6350||0xcc;return function(_0x4ea76e){if(_0x4ea76e){return _0x30a34e['sendStatus'](_0x4a6350);}return _0x30a34e[_0x6fdb('0x27')](_0x4a6350)[_0x6fdb('0x28')]();};}function respondWithResult(_0x547d36,_0x30cb4f){_0x30cb4f=_0x30cb4f||0xc8;return function(_0x59e360){if(_0x59e360){return _0x547d36[_0x6fdb('0x27')](_0x30cb4f)[_0x6fdb('0x29')](_0x59e360);}};}function respondWithFilteredResult(_0x1af20a,_0x10511b){return function(_0x2413e5){if(_0x2413e5){var _0x146d5d=typeof _0x10511b[_0x6fdb('0x2a')]===_0x6fdb('0x2b')&&typeof _0x10511b[_0x6fdb('0x2c')]===_0x6fdb('0x2b');var _0x520f5e=_0x2413e5[_0x6fdb('0x2d')];var _0x333154=_0x146d5d?0x0:_0x10511b[_0x6fdb('0x2a')];var _0xc29c58=_0x146d5d?_0x2413e5[_0x6fdb('0x2d')]:_0x10511b['offset']+_0x10511b[_0x6fdb('0x2c')];var _0x3e76c3;if(_0xc29c58>=_0x520f5e){_0xc29c58=_0x520f5e;_0x3e76c3=0xc8;}else{_0x3e76c3=0xce;}_0x1af20a[_0x6fdb('0x27')](_0x3e76c3);return _0x1af20a['set'](_0x6fdb('0x2e'),_0x333154+'-'+_0xc29c58+'/'+_0x520f5e)[_0x6fdb('0x29')](_0x2413e5);}return null;};}function patchUpdates(_0x339fe5){return function(_0x582883){try{jsonpatch[_0x6fdb('0x2f')](_0x582883,_0x339fe5,!![]);}catch(_0x41eef3){return BPromise[_0x6fdb('0x30')](_0x41eef3);}return _0x582883['save']();};}function saveUpdates(_0x4e2c98,_0x49cbc0){return function(_0x2b876c){if(_0x2b876c){return _0x2b876c[_0x6fdb('0x31')](_0x4e2c98)[_0x6fdb('0x1e')](function(_0x872502){return _0x872502;});}return null;};}function removeEntity(_0x3069fc,_0x4f6d30){return function(_0x3429fc){if(_0x3429fc){return _0x3429fc[_0x6fdb('0x32')]()[_0x6fdb('0x1e')](function(){_0x3069fc[_0x6fdb('0x27')](0xcc)[_0x6fdb('0x28')]();});}};}function handleEntityNotFound(_0x4a0034,_0x49addd){return function(_0x524c67){if(!_0x524c67){_0x4a0034['sendStatus'](0x194);}return _0x524c67;};}function handleError(_0x16e6c6,_0x406b7e){_0x406b7e=_0x406b7e||0x1f4;return function(_0x4f5b12){logger[_0x6fdb('0x25')](_0x4f5b12[_0x6fdb('0x33')]);if(_0x4f5b12[_0x6fdb('0x34')]){delete _0x4f5b12['name'];}_0x16e6c6[_0x6fdb('0x27')](_0x406b7e)[_0x6fdb('0x35')](_0x4f5b12);};}exports[_0x6fdb('0x36')]=function(_0x5bb47c,_0x281963){var _0x5e9b3a={},_0x210184={},_0x445f53={'count':0x0,'rows':[]};var _0x257256=_['map'](db[_0x6fdb('0x37')][_0x6fdb('0x38')],function(_0xfbc673){return{'name':_0xfbc673[_0x6fdb('0x39')],'type':_0xfbc673[_0x6fdb('0x3a')][_0x6fdb('0x3b')]};});_0x210184['model']=_[_0x6fdb('0x3c')](_0x257256,_0x6fdb('0x34'));_0x210184[_0x6fdb('0x3d')]=_[_0x6fdb('0x3e')](_0x5bb47c[_0x6fdb('0x3d')]);_0x210184[_0x6fdb('0x3f')]=_[_0x6fdb('0x40')](_0x210184[_0x6fdb('0x41')],_0x210184['query']);_0x5e9b3a[_0x6fdb('0x42')]=_['intersection'](_0x210184['model'],qs[_0x6fdb('0x43')](_0x5bb47c['query'][_0x6fdb('0x43')]));_0x5e9b3a[_0x6fdb('0x42')]=_0x5e9b3a[_0x6fdb('0x42')][_0x6fdb('0x44')]?_0x5e9b3a[_0x6fdb('0x42')]:_0x210184[_0x6fdb('0x41')];if(!_0x5bb47c[_0x6fdb('0x3d')]['hasOwnProperty'](_0x6fdb('0x45'))){_0x5e9b3a[_0x6fdb('0x2c')]=qs['limit'](_0x5bb47c[_0x6fdb('0x3d')][_0x6fdb('0x2c')]);_0x5e9b3a['offset']=qs[_0x6fdb('0x2a')](_0x5bb47c[_0x6fdb('0x3d')][_0x6fdb('0x2a')]);}_0x5e9b3a[_0x6fdb('0x46')]=qs[_0x6fdb('0x47')](_0x5bb47c[_0x6fdb('0x3d')][_0x6fdb('0x47')]);_0x5e9b3a[_0x6fdb('0x48')]=qs[_0x6fdb('0x3f')](_['pick'](_0x5bb47c['query'],_0x210184['filters']),_0x257256);if(_0x5bb47c['query'][_0x6fdb('0x49')]){_0x5e9b3a[_0x6fdb('0x48')]=_[_0x6fdb('0x4a')](_0x5e9b3a[_0x6fdb('0x48')],{'$or':_[_0x6fdb('0x3c')](_0x257256,function(_0x499019){if(_0x499019['type']!==_0x6fdb('0x4b')){var _0x4d0f27={};_0x4d0f27[_0x499019['name']]={'$like':'%'+_0x5bb47c[_0x6fdb('0x3d')][_0x6fdb('0x49')]+'%'};return _0x4d0f27;}})});}_0x5e9b3a=_[_0x6fdb('0x4a')]({},_0x5e9b3a,_0x5bb47c[_0x6fdb('0x4c')]);var _0x46eced={'where':_0x5e9b3a[_0x6fdb('0x48')]};return db[_0x6fdb('0x37')]['count'](_0x46eced)[_0x6fdb('0x1e')](function(_0x1ad208){_0x445f53[_0x6fdb('0x2d')]=_0x1ad208;if(_0x5bb47c['query']['includeAll']){_0x5e9b3a[_0x6fdb('0x4d')]=[{'all':!![]}];}return db[_0x6fdb('0x37')][_0x6fdb('0x4e')](_0x5e9b3a);})[_0x6fdb('0x1e')](function(_0x558cdf){_0x445f53['rows']=_0x558cdf;return _0x445f53;})['then'](respondWithFilteredResult(_0x281963,_0x5e9b3a))[_0x6fdb('0x4f')](handleError(_0x281963,null));};exports['show']=function(_0x301210,_0x366547){var _0x3af79f={'raw':!![],'where':{'id':_0x301210[_0x6fdb('0x50')]['id']}},_0x5d2ea5={};_0x5d2ea5[_0x6fdb('0x41')]=_[_0x6fdb('0x3e')](db['ChatMessage'][_0x6fdb('0x38')]);_0x5d2ea5[_0x6fdb('0x3d')]=_[_0x6fdb('0x3e')](_0x301210[_0x6fdb('0x3d')]);_0x5d2ea5['filters']=_[_0x6fdb('0x40')](_0x5d2ea5['model'],_0x5d2ea5[_0x6fdb('0x3d')]);_0x3af79f[_0x6fdb('0x42')]=_[_0x6fdb('0x40')](_0x5d2ea5[_0x6fdb('0x41')],qs[_0x6fdb('0x43')](_0x301210[_0x6fdb('0x3d')][_0x6fdb('0x43')]));_0x3af79f[_0x6fdb('0x42')]=_0x3af79f[_0x6fdb('0x42')][_0x6fdb('0x44')]?_0x3af79f['attributes']:_0x5d2ea5[_0x6fdb('0x41')];if(_0x301210[_0x6fdb('0x3d')]['includeAll']){_0x3af79f[_0x6fdb('0x4d')]=[{'all':!![]}];}_0x3af79f=_[_0x6fdb('0x4a')]({},_0x3af79f,_0x301210[_0x6fdb('0x4c')]);return db[_0x6fdb('0x37')][_0x6fdb('0x51')](_0x3af79f)[_0x6fdb('0x1e')](handleEntityNotFound(_0x366547,null))[_0x6fdb('0x1e')](respondWithResult(_0x366547,null))['catch'](handleError(_0x366547,null));};exports[_0x6fdb('0x52')]=function(_0x3da343,_0x4de989){return db[_0x6fdb('0x37')]['create'](_0x3da343[_0x6fdb('0x53')],{})[_0x6fdb('0x1e')](respondWithResult(_0x4de989,0xc9))[_0x6fdb('0x4f')](handleError(_0x4de989,null));};exports[_0x6fdb('0x31')]=function(_0x52cf31,_0x4b665){if(_0x52cf31[_0x6fdb('0x53')]['id']){delete _0x52cf31['body']['id'];}return db[_0x6fdb('0x37')][_0x6fdb('0x51')]({'where':{'id':_0x52cf31['params']['id']}})[_0x6fdb('0x1e')](handleEntityNotFound(_0x4b665,null))[_0x6fdb('0x1e')](saveUpdates(_0x52cf31['body'],null))[_0x6fdb('0x1e')](respondWithResult(_0x4b665,null))[_0x6fdb('0x4f')](handleError(_0x4b665,null));};exports['destroy']=function(_0x5c00eb,_0x4718ef){return db[_0x6fdb('0x37')][_0x6fdb('0x51')]({'where':{'id':_0x5c00eb[_0x6fdb('0x50')]['id']}})[_0x6fdb('0x1e')](handleEntityNotFound(_0x4718ef,null))['then'](removeEntity(_0x4718ef,null))[_0x6fdb('0x4f')](handleError(_0x4718ef,null));};exports['describe']=function(_0x3a72f5,_0x4971c2){return db['ChatMessage'][_0x6fdb('0x54')]()[_0x6fdb('0x1e')](respondWithResult(_0x4971c2,null))[_0x6fdb('0x4f')](handleError(_0x4971c2,null));};var interaction_log=require(_0x6fdb('0x55'))(_0x6fdb('0x56'));exports['accept']=function(_0x5b023f,_0x309cad,_0x3caa79){var _0xbb04e9={'agent':{},'channel':'chat'};if(_0x5b023f['body']['id']){delete _0x5b023f[_0x6fdb('0x53')]['id'];}_0x5b023f['body'][_0x6fdb('0x57')]=!![];_0x5b023f['body']['readAt']=moment()[_0x6fdb('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b023f[_0x6fdb('0x53')][_0x6fdb('0x59')]=_0x5b023f['body']['UserId']||_0x5b023f[_0x6fdb('0x5a')]['id'];_0xbb04e9[_0x6fdb('0x5b')]['id']=_0x5b023f[_0x6fdb('0x53')]['UserId'];return db[_0x6fdb('0x37')][_0x6fdb('0x51')]({'where':{'id':_0x5b023f[_0x6fdb('0x50')]['id'],'UserId':null}})[_0x6fdb('0x1e')](handleEntityNotFound(_0x309cad,null))[_0x6fdb('0x1e')](saveUpdates(_0x5b023f[_0x6fdb('0x53')],null))[_0x6fdb('0x1e')](function(_0x22ae87){if(_0x22ae87){_0xbb04e9[_0x6fdb('0x26')]=_0x22ae87[_0x6fdb('0x5c')]({'plain':!![]});return db[_0x6fdb('0x5d')][_0x6fdb('0x51')]({'where':{'id':_0x22ae87['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x309cad,null))[_0x6fdb('0x1e')](function(_0x9f0d10){if(_0x9f0d10){return _0x9f0d10[_0x6fdb('0x31')]({'UserId':_0x5b023f[_0x6fdb('0x53')][_0x6fdb('0x59')],'read1stAt':_['isNil'](_0x9f0d10[_0x6fdb('0x5e')])?moment()[_0x6fdb('0x58')](_0x6fdb('0x5f')):undefined});}return null;})[_0x6fdb('0x1e')](function(_0xd3e8f8){if(_0xd3e8f8){_0xbb04e9['interaction']=_0xd3e8f8[_0x6fdb('0x5c')]({'plain':!![]});interaction_log[_0x6fdb('0x1f')](_0x6fdb('0x60'),_0x5b023f[_0x6fdb('0x5a')]['id'],_0x5b023f[_0x6fdb('0x5a')][_0x6fdb('0x34')],_0x5b023f[_0x6fdb('0x5a')][_0x6fdb('0x61')],_0xbb04e9[_0x6fdb('0x62')]['id'],_0x5b023f[_0x6fdb('0x53')]?JSON[_0x6fdb('0x24')](_0x5b023f[_0x6fdb('0x53')]):_0x6fdb('0x63'));return respondWithRpcPromise('AcceptMessage',_0x6fdb('0x64'),_0xbb04e9);}return null;})[_0x6fdb('0x1e')](function(_0x3fc403){var _0x47e6d1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3fc403[_0x6fdb('0x26')][_0x6fdb('0x65')];return db[_0x6fdb('0x66')][_0x6fdb('0x3d')](_0x47e6d1,{'type':db[_0x6fdb('0x67')][_0x6fdb('0x68')]['SELECT'],'raw':!![]})[_0x6fdb('0x1e')](function(_0x54c08f){return _0x54c08f;});})['then'](function(_0x51da56){if(_0x51da56){_0xbb04e9[_0x6fdb('0x26')][_0x6fdb('0x69')]=_0x51da56[0x0];if(!_0x5b023f[_0x6fdb('0x53')]['UserId'])return;return db['User'][_0x6fdb('0x51')]({'where':{'id':_0x5b023f[_0x6fdb('0x53')][_0x6fdb('0x59')],'role':_0x6fdb('0x5b')},'attributes':['id',_0x6fdb('0x34'),'fullname','email',_0x6fdb('0x6a')],'raw':!![]});}return null;})[_0x6fdb('0x1e')](function(_0x488994){if(!_0x488994)return null;_0xbb04e9[_0x6fdb('0x26')][_0x6fdb('0x5b')]=_0x488994;return _0xbb04e9;})['then'](function(_0xabccf4){if(_0xabccf4){if(_0x5b023f[_0x6fdb('0x53')][_0x6fdb('0x6b')]){_0xbb04e9[_0x6fdb('0x26')]['interface']=util[_0x6fdb('0x58')](_0x6fdb('0x6c'),_0x5b023f['user']['name']);_0xbb04e9[_0x6fdb('0x26')][_0x6fdb('0x6d')]=_0xbb04e9[_0x6fdb('0x6d')];_0xbb04e9[_0x6fdb('0x26')][_0x6fdb('0x6e')]=_0xbb04e9['channel'];_0xbb04e9[_0x6fdb('0x26')][_0x6fdb('0x6f')]=_0x6fdb('0x70');return respondWithRpcPromise(_0x6fdb('0x71'),_0x6fdb('0x71'),{'event':'acceptmessage','message':_[_0x6fdb('0x4a')](_0xbb04e9[_0x6fdb('0x26')],JSON[_0x6fdb('0x72')](_0xbb04e9['interaction'][_0x6fdb('0x73')]))},client9002)[_0x6fdb('0x1e')](function(){return _0xbb04e9;});}return _0xbb04e9;}return null;})['then'](respondWithResult(_0x309cad,null))['catch'](handleError(_0x309cad,null));};var interaction_log=require(_0x6fdb('0x55'))('chat-interactions');exports[_0x6fdb('0x30')]=function(_0x122fbc,_0x4437e6,_0x1286ff){var _0x4ffec6={'agent':{},'channel':'chat'};if(_0x122fbc[_0x6fdb('0x53')]['id']){delete _0x122fbc[_0x6fdb('0x53')]['id'];}_0x122fbc[_0x6fdb('0x53')][_0x6fdb('0x59')]=_0x122fbc[_0x6fdb('0x53')][_0x6fdb('0x59')]||_0x122fbc['user']['id'];_0x4ffec6['agent']['id']=_0x122fbc['body'][_0x6fdb('0x59')];return db[_0x6fdb('0x37')][_0x6fdb('0x51')]({'where':{'id':_0x122fbc[_0x6fdb('0x50')]['id'],'UserId':null}})[_0x6fdb('0x1e')](handleEntityNotFound(_0x4437e6,null))['then'](function(_0x381ece){if(_0x381ece){_0x4ffec6['message']=_0x381ece[_0x6fdb('0x5c')]({'plain':!![]});return db[_0x6fdb('0x5d')]['find']({'where':{'id':_0x381ece['ChatInteractionId']}});}return null;})[_0x6fdb('0x1e')](handleEntityNotFound(_0x4437e6,null))[_0x6fdb('0x1e')](function(_0x545d12){if(_0x545d12){_0x4ffec6[_0x6fdb('0x62')]=_0x545d12['get']({'plain':!![]});interaction_log[_0x6fdb('0x1f')](_0x6fdb('0x74'),_0x122fbc[_0x6fdb('0x5a')]['id'],_0x122fbc[_0x6fdb('0x5a')]['name'],_0x122fbc[_0x6fdb('0x5a')]['role'],_0x4ffec6[_0x6fdb('0x62')]['id'],_0x122fbc[_0x6fdb('0x53')]?JSON[_0x6fdb('0x24')](_0x122fbc[_0x6fdb('0x53')]):_0x6fdb('0x63'));return respondWithRpcPromise('RejectMessage',_0x6fdb('0x75'),_0x4ffec6);}return null;})[_0x6fdb('0x1e')](function(_0x700b7a){var _0x2a66df=_0x6fdb('0x76')+_0x700b7a[_0x6fdb('0x26')][_0x6fdb('0x65')];return db[_0x6fdb('0x66')][_0x6fdb('0x3d')](_0x2a66df,{'type':db[_0x6fdb('0x67')][_0x6fdb('0x68')]['SELECT'],'raw':!![]})[_0x6fdb('0x1e')](function(_0x12068a){return _0x12068a;});})[_0x6fdb('0x1e')](function(_0xce604d){if(_0xce604d){_0x4ffec6[_0x6fdb('0x26')]['contact']=_0xce604d[0x0];if(!_0x122fbc[_0x6fdb('0x53')][_0x6fdb('0x59')])return;return db[_0x6fdb('0x77')][_0x6fdb('0x51')]({'where':{'id':_0x122fbc['body'][_0x6fdb('0x59')],'role':_0x6fdb('0x5b')},'attributes':['id','name',_0x6fdb('0x78'),_0x6fdb('0x79'),'internal'],'raw':!![]});}return null;})[_0x6fdb('0x1e')](function(_0x3abba5){if(!_0x3abba5)return null;_0x4ffec6[_0x6fdb('0x26')][_0x6fdb('0x5b')]=_0x3abba5;return _0x4ffec6;})[_0x6fdb('0x1e')](function(_0x3723b9){if(_0x3723b9){_0x3723b9[_0x6fdb('0x26')][_0x6fdb('0x7a')]=util[_0x6fdb('0x58')](_0x6fdb('0x6c'),_0x122fbc['user'][_0x6fdb('0x34')]);_0x3723b9['message'][_0x6fdb('0x6d')]=_0x4ffec6[_0x6fdb('0x6d')];_0x3723b9[_0x6fdb('0x26')][_0x6fdb('0x6e')]=_0x4ffec6[_0x6fdb('0x6d')];_0x3723b9['message'][_0x6fdb('0x6f')]=_0x6fdb('0x30');respondWithRpcPromise('EventManager',_0x6fdb('0x71'),{'event':'rejectmessage','message':_[_0x6fdb('0x4a')](_0x4ffec6[_0x6fdb('0x26')],JSON[_0x6fdb('0x72')](_0x4ffec6[_0x6fdb('0x62')][_0x6fdb('0x73')]))},client9002);return _0x4ffec6;}return null;})[_0x6fdb('0x1e')](respondWithResult(_0x4437e6,null))[_0x6fdb('0x4f')](handleError(_0x4437e6,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index e7c9bd7..4b1dca8 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 _0x458e=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x458e,0x6d));var _0xe458=function(_0x169370,_0x5dba06){_0x169370=_0x169370-0x0;var _0x518c98=_0x458e[_0x169370];return _0x518c98;};'use strict';var EventEmitter=require(_0xe458('0x0'));var ChatMessage=require(_0xe458('0x1'))['db'][_0xe458('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe458('0x3'),'afterUpdate':'update','afterDestroy':_0xe458('0x4')};function emitEvent(_0x4e00ca){return function(_0x23495b,_0x3a5f15,_0x1111d3){ChatMessageEvents[_0xe458('0x5')](_0x4e00ca+':'+_0x23495b['id'],_0x23495b);ChatMessageEvents[_0xe458('0x5')](_0x4e00ca,_0x23495b);_0x1111d3(null);};}for(var e in events){if(events[_0xe458('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xe458('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x4c5e=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x2b81db,_0x3b6c1c){var _0x1c5754=function(_0x22d79b){while(--_0x22d79b){_0x2b81db['push'](_0x2b81db['shift']());}};_0x1c5754(++_0x3b6c1c);}(_0x4c5e,0x16f));var _0xe4c5=function(_0x2312b1,_0xfdd2b9){_0x2312b1=_0x2312b1-0x0;var _0x16afc8=_0x4c5e[_0x2312b1];return _0x16afc8;};'use strict';var EventEmitter=require(_0xe4c5('0x0'));var ChatMessage=require(_0xe4c5('0x1'))['db'][_0xe4c5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe4c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4c5('0x4'),'afterDestroy':_0xe4c5('0x5')};function emitEvent(_0x14d3fb){return function(_0x25202f,_0x3dcb9d,_0x124e23){ChatMessageEvents[_0xe4c5('0x6')](_0x14d3fb+':'+_0x25202f['id'],_0x25202f);ChatMessageEvents[_0xe4c5('0x6')](_0x14d3fb,_0x25202f);_0x124e23(null);};}for(var e in events){if(events[_0xe4c5('0x7')](e)){var event=events[e];ChatMessage[_0xe4c5('0x8')](e,emitEvent(event));}}module[_0xe4c5('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 244d813..72d3180 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 _0xa56b=['chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','secret','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage'];(function(_0x564ae6,_0x4b54c5){var _0x56e6cb=function(_0x52ffcb){while(--_0x52ffcb){_0x564ae6['push'](_0x564ae6['shift']());}};_0x56e6cb(++_0x4b54c5);}(_0xa56b,0x16e));var _0xba56=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xa56b[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0xba56('0x0'));var util=require(_0xba56('0x1'));var logger=require(_0xba56('0x2'))(_0xba56('0x3'));var moment=require(_0xba56('0x4'));var BPromise=require(_0xba56('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba56('0x6'));var rimraf=require(_0xba56('0x7'));var config=require(_0xba56('0x8'));var attributes=require('./chatMessage.attributes');module[_0xba56('0x9')]=function(_0x2950b8,_0x2bca58){return _0x2950b8[_0xba56('0xa')](_0xba56('0xb'),attributes,{'tableName':_0xba56('0xc'),'paranoid':![],'indexes':[{'name':_0xba56('0xd'),'fields':[_0xba56('0xe')],'type':_0xba56('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcb9de4,_0x541c96,_0x4d2c0c){var _0x350c76=_0x2950b8[_0xba56('0x10')];var _0x834990=_0xcb9de4['get']({'plain':!![]});if(_0x834990['direction'][_0xba56('0x11')]()==='in'||_0x834990[_0xba56('0x12')][_0xba56('0x11')]()==='out'&&!_0x834990[_0xba56('0x13')]&&!_['isNil'](_0x834990['UserId'])){_0x350c76['ChatInteraction'][_0xba56('0x14')]({'where':{'id':_0x834990[_0xba56('0x15')]}})[_0xba56('0x16')](function(_0x43d70a){if(_0x43d70a){_0x43d70a[_0xba56('0x17')]({'lastMsgAt':_0x834990[_0xba56('0x18')],'lastMsgDirection':_0x834990[_0xba56('0x12')]['toLowerCase']()});}})['catch'](function(_0x539461){console[_0xba56('0x19')](_0x539461);});}_0x4d2c0c();}},'charset':_0xba56('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8c32=['api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x12771c,_0x55afae){var _0x380f3c=function(_0x42fade){while(--_0x42fade){_0x12771c['push'](_0x12771c['shift']());}};_0x380f3c(++_0x55afae);}(_0x8c32,0x89));var _0x28c3=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x8c32[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var logger=require(_0x28c3('0x2'))(_0x28c3('0x3'));var moment=require('moment');var BPromise=require(_0x28c3('0x4'));var rp=require(_0x28c3('0x5'));var fs=require('fs');var path=require(_0x28c3('0x6'));var rimraf=require('rimraf');var config=require(_0x28c3('0x7'));var attributes=require(_0x28c3('0x8'));module['exports']=function(_0x893928,_0x32a8aa){return _0x893928[_0x28c3('0x9')](_0x28c3('0xa'),attributes,{'tableName':_0x28c3('0xb'),'paranoid':![],'indexes':[{'name':_0x28c3('0xc'),'fields':[_0x28c3('0xd')],'type':_0x28c3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6e628a,_0x891dd1,_0xa40d1){var _0x41f9ae=_0x893928[_0x28c3('0xf')];var _0x341a37=_0x6e628a[_0x28c3('0x10')]({'plain':!![]});if(_0x341a37[_0x28c3('0x11')]['toLowerCase']()==='in'||_0x341a37[_0x28c3('0x11')][_0x28c3('0x12')]()==='out'&&!_0x341a37['secret']&&!_[_0x28c3('0x13')](_0x341a37[_0x28c3('0x14')])){_0x41f9ae[_0x28c3('0x15')]['findOne']({'where':{'id':_0x341a37[_0x28c3('0x16')]}})[_0x28c3('0x17')](function(_0x524b6a){if(_0x524b6a){_0x524b6a[_0x28c3('0x18')]({'lastMsgAt':_0x341a37[_0x28c3('0x19')],'lastMsgDirection':_0x341a37[_0x28c3('0x11')][_0x28c3('0x12')]()});}})[_0x28c3('0x1a')](function(_0x8904d3){console['error'](_0x8904d3);});}_0xa40d1();}},'charset':'utf8mb4','collate':_0x28c3('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 19e2796..53492fc 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 _0xa33c=['create','body','options','raw','then','CreateChatMessage','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','./chatMessage.socket','register','request','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xa33c,0xd4));var _0xca33=function(_0x668dfe,_0x49c31b){_0x668dfe=_0x668dfe-0x0;var _0x32d759=_0xa33c[_0x668dfe];return _0x32d759;};'use strict';var _=require(_0xca33('0x0'));var util=require(_0xca33('0x1'));var moment=require(_0xca33('0x2'));var BPromise=require(_0xca33('0x3'));var rs=require(_0xca33('0x4'));var fs=require('fs');var Redis=require(_0xca33('0x5'));var db=require(_0xca33('0x6'))['db'];var utils=require(_0xca33('0x7'));var logger=require('../../config/logger')(_0xca33('0x8'));var config=require('../../config/environment');var jayson=require(_0xca33('0x9'));var client=jayson[_0xca33('0xa')][_0xca33('0xb')]({'port':0x232a});config[_0xca33('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca33('0xc')]));require(_0xca33('0xd'))[_0xca33('0xe')](socket);function respondWithRpcPromise(_0x388137,_0x5f51ea,_0x1645f9){return new BPromise(function(_0x2c6d53,_0xa4ffbd){return client[_0xca33('0xf')](_0x388137,_0x1645f9)['then'](function(_0x40d367){logger[_0xca33('0x10')]('ChatMessage,\x20%s,\x20%s',_0x5f51ea,_0xca33('0x11'));logger['debug'](_0xca33('0x12'),_0x5f51ea,'request\x20sent',JSON['stringify'](_0x40d367));if(_0x40d367[_0xca33('0x13')]){if(_0x40d367[_0xca33('0x13')][_0xca33('0x14')]===0x1f4){logger[_0xca33('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5f51ea,_0x40d367['error']['message']);return _0xa4ffbd(_0x40d367[_0xca33('0x13')]['message']);}logger[_0xca33('0x13')](_0xca33('0x15'),_0x5f51ea,_0x40d367[_0xca33('0x13')][_0xca33('0x16')]);return _0x2c6d53(_0x40d367[_0xca33('0x13')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5f51ea,'request\x20sent');_0x2c6d53(_0x40d367[_0xca33('0x17')]['message']);}})[_0xca33('0x18')](function(_0x168b79){logger[_0xca33('0x13')](_0xca33('0x15'),_0x5f51ea,_0x168b79);_0xa4ffbd(_0x168b79);});});}exports['CreateChatMessage']=function(_0x1fe17a){var _0x1783de=this;return new Promise(function(_0x33529d,_0x5b4801){return db[_0xca33('0x19')][_0xca33('0x1a')](_0x1fe17a[_0xca33('0x1b')],{'raw':_0x1fe17a[_0xca33('0x1c')]?_0x1fe17a['options'][_0xca33('0x1d')]===undefined?!![]:![]:!![]})[_0xca33('0x1e')](function(_0x4e10fa){logger[_0xca33('0x10')](_0xca33('0x1f'),_0x1fe17a);logger[_0xca33('0x20')](_0xca33('0x1f'),_0x1fe17a,JSON[_0xca33('0x21')](_0x4e10fa));_0x33529d(_0x4e10fa);})[_0xca33('0x18')](function(_0x5f0c87){logger['error']('CreateChatMessage',_0x5f0c87[_0xca33('0x16')],_0x1fe17a);_0x5b4801(_0x1783de[_0xca33('0x13')](0x1f4,_0x5f0c87[_0xca33('0x16')]));});});}; \ No newline at end of file +var _0x8c3d=['request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','options','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','./chatMessage.socket','register'];(function(_0x31a650,_0x556865){var _0x1a840e=function(_0x47511a){while(--_0x47511a){_0x31a650['push'](_0x31a650['shift']());}};_0x1a840e(++_0x556865);}(_0x8c3d,0x1f0));var _0xd8c3=function(_0xffdd08,_0x5cfdbc){_0xffdd08=_0xffdd08-0x0;var _0x2cb77f=_0x8c3d[_0xffdd08];return _0x2cb77f;};'use strict';var _=require(_0xd8c3('0x0'));var util=require(_0xd8c3('0x1'));var moment=require(_0xd8c3('0x2'));var BPromise=require(_0xd8c3('0x3'));var rs=require(_0xd8c3('0x4'));var fs=require('fs');var Redis=require(_0xd8c3('0x5'));var db=require(_0xd8c3('0x6'))['db'];var utils=require(_0xd8c3('0x7'));var logger=require(_0xd8c3('0x8'))(_0xd8c3('0x9'));var config=require('../../config/environment');var jayson=require(_0xd8c3('0xa'));var client=jayson['client'][_0xd8c3('0xb')]({'port':0x232a});config[_0xd8c3('0xc')]=_[_0xd8c3('0xd')](config[_0xd8c3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8c3('0xc')]));require(_0xd8c3('0xe'))[_0xd8c3('0xf')](socket);function respondWithRpcPromise(_0x3802ef,_0x492d87,_0x413ca2){return new BPromise(function(_0x227475,_0x587b73){return client[_0xd8c3('0x10')](_0x3802ef,_0x413ca2)[_0xd8c3('0x11')](function(_0x2b118a){logger[_0xd8c3('0x12')](_0xd8c3('0x13'),_0x492d87,_0xd8c3('0x14'));logger['debug'](_0xd8c3('0x15'),_0x492d87,_0xd8c3('0x14'),JSON[_0xd8c3('0x16')](_0x2b118a));if(_0x2b118a[_0xd8c3('0x17')]){if(_0x2b118a[_0xd8c3('0x17')][_0xd8c3('0x18')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x492d87,_0x2b118a['error'][_0xd8c3('0x19')]);return _0x587b73(_0x2b118a[_0xd8c3('0x17')][_0xd8c3('0x19')]);}logger[_0xd8c3('0x17')](_0xd8c3('0x13'),_0x492d87,_0x2b118a[_0xd8c3('0x17')][_0xd8c3('0x19')]);return _0x227475(_0x2b118a['error'][_0xd8c3('0x19')]);}else{logger[_0xd8c3('0x12')]('ChatMessage,\x20%s,\x20%s',_0x492d87,_0xd8c3('0x14'));_0x227475(_0x2b118a[_0xd8c3('0x1a')][_0xd8c3('0x19')]);}})['catch'](function(_0x57600c){logger[_0xd8c3('0x17')]('ChatMessage,\x20%s,\x20%s',_0x492d87,_0x57600c);_0x587b73(_0x57600c);});});}exports[_0xd8c3('0x1b')]=function(_0x358808){var _0x242f24=this;return new Promise(function(_0x27ced7,_0x2b2658){return db[_0xd8c3('0x1c')]['create'](_0x358808['body'],{'raw':_0x358808[_0xd8c3('0x1d')]?_0x358808[_0xd8c3('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xd8c3('0x11')](function(_0x1e0af6){logger[_0xd8c3('0x12')](_0xd8c3('0x1b'),_0x358808);logger[_0xd8c3('0x1e')](_0xd8c3('0x1b'),_0x358808,JSON[_0xd8c3('0x16')](_0x1e0af6));_0x27ced7(_0x1e0af6);})[_0xd8c3('0x1f')](function(_0xdda7d4){logger[_0xd8c3('0x17')](_0xd8c3('0x1b'),_0xdda7d4['message'],_0x358808);_0x2b2658(_0x242f24['error'](0x1f4,_0xdda7d4[_0xd8c3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f4404c5..6179820 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 _0x56e6=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x4f5880,_0x30f20e){var _0x379d79=function(_0x5694ae){while(--_0x5694ae){_0x4f5880['push'](_0x4f5880['shift']());}};_0x379d79(++_0x30f20e);}(_0x56e6,0x6b));var _0x656e=function(_0x29eaaf,_0x18cc33){_0x29eaaf=_0x29eaaf-0x0;var _0xd350fc=_0x56e6[_0x29eaaf];return _0xd350fc;};'use strict';var ChatMessageEvents=require(_0x656e('0x0'));var events=[_0x656e('0x1'),_0x656e('0x2'),_0x656e('0x3')];function createListener(_0x3a7a6a,_0x3833eb){return function(_0x5adaa8){_0x3833eb[_0x656e('0x4')](_0x3a7a6a,_0x5adaa8);};}function removeListener(_0x23c947,_0xe7d540){return function(){ChatMessageEvents[_0x656e('0x5')](_0x23c947,_0xe7d540);};}exports[_0x656e('0x6')]=function(_0x3fef98){for(var _0x81c232=0x0,_0x54eddb=events[_0x656e('0x7')];_0x81c232<_0x54eddb;_0x81c232++){var _0x1538a5=events[_0x81c232];var _0x1dad4e=createListener(_0x656e('0x8')+_0x1538a5,_0x3fef98);ChatMessageEvents['on'](_0x1538a5,_0x1dad4e);}}; \ No newline at end of file +var _0xc18a=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc18a,0x1cf));var _0xac18=function(_0x39fdb7,_0x5ac80d){_0x39fdb7=_0x39fdb7-0x0;var _0xbd17e7=_0xc18a[_0x39fdb7];return _0xbd17e7;};'use strict';var ChatMessageEvents=require(_0xac18('0x0'));var events=[_0xac18('0x1'),_0xac18('0x2'),_0xac18('0x3')];function createListener(_0x48266f,_0x3a3e96){return function(_0x2651c2){_0x3a3e96[_0xac18('0x4')](_0x48266f,_0x2651c2);};}function removeListener(_0x3da5f5,_0x42f646){return function(){ChatMessageEvents[_0xac18('0x5')](_0x3da5f5,_0x42f646);};}exports[_0xac18('0x6')]=function(_0x395493){for(var _0x49136f=0x0,_0xab6cb=events[_0xac18('0x7')];_0x49136f<_0xab6cb;_0x49136f++){var _0x542a9=events[_0x49136f];var _0x2bf4b8=createListener(_0xac18('0x8')+_0x542a9,_0x395493);ChatMessageEvents['on'](_0x542a9,_0x2bf4b8);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 028a7d4..407e2e6 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 _0x428b=['post','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x226e70,_0x419e57){var _0x4b5ac4=function(_0x5d8c12){while(--_0x5d8c12){_0x226e70['push'](_0x226e70['shift']());}};_0x4b5ac4(++_0x419e57);}(_0x428b,0x1de));var _0xb428=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x428b[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require(_0xb428('0x0'));var path=require(_0xb428('0x1'));var timeout=require(_0xb428('0x2'));var express=require(_0xb428('0x3'));var router=express[_0xb428('0x4')]();var fs_extra=require(_0xb428('0x5'));var auth=require(_0xb428('0x6'));var interaction=require(_0xb428('0x7'));var config=require(_0xb428('0x8'));var controller=require(_0xb428('0x9'));router[_0xb428('0xa')]('/',auth[_0xb428('0xb')](),controller['index']);router[_0xb428('0xa')](_0xb428('0xc'),auth['isAuthenticated'](),controller[_0xb428('0xd')]);router[_0xb428('0xa')](_0xb428('0xe'),auth[_0xb428('0xb')](),controller[_0xb428('0xf')]);router[_0xb428('0x10')]('/',auth[_0xb428('0xb')](),interaction['tracked']('chat','chatmessage:create'),controller[_0xb428('0x11')]);router[_0xb428('0x12')](_0xb428('0xe'),controller[_0xb428('0x13')]);router['put'](_0xb428('0x14'),auth[_0xb428('0xb')](),controller[_0xb428('0x15')]);router[_0xb428('0x12')](_0xb428('0x16'),auth[_0xb428('0xb')](),controller[_0xb428('0x17')]);router[_0xb428('0x18')](_0xb428('0xe'),auth[_0xb428('0xb')](),controller[_0xb428('0x19')]);module['exports']=router; \ No newline at end of file +var _0x3260=['/describe','/:id','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x3b9a59,_0x3af1f0){var _0x40e1db=function(_0x3dbe95){while(--_0x3dbe95){_0x3b9a59['push'](_0x3b9a59['shift']());}};_0x40e1db(++_0x3af1f0);}(_0x3260,0xa4));var _0x0326=function(_0x11da31,_0x5d576f){_0x11da31=_0x11da31-0x0;var _0x6bb4c8=_0x3260[_0x11da31];return _0x6bb4c8;};'use strict';var multer=require(_0x0326('0x0'));var util=require('util');var path=require(_0x0326('0x1'));var timeout=require(_0x0326('0x2'));var express=require(_0x0326('0x3'));var router=express[_0x0326('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0326('0x5'));var config=require(_0x0326('0x6'));var controller=require(_0x0326('0x7'));router[_0x0326('0x8')]('/',auth[_0x0326('0x9')](),controller[_0x0326('0xa')]);router[_0x0326('0x8')](_0x0326('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0326('0x8')](_0x0326('0xc'),auth[_0x0326('0x9')](),controller['show']);router[_0x0326('0xd')]('/',auth[_0x0326('0x9')](),interaction['tracked'](_0x0326('0xe'),_0x0326('0xf')),controller[_0x0326('0x10')]);router[_0x0326('0x11')]('/:id',controller[_0x0326('0x12')]);router['put'](_0x0326('0x13'),auth['isAuthenticated'](),controller[_0x0326('0x14')]);router[_0x0326('0x11')](_0x0326('0x15'),auth['isAuthenticated'](),controller[_0x0326('0x16')]);router[_0x0326('0x17')](_0x0326('0xc'),auth[_0x0326('0x9')](),controller[_0x0326('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 88f0ef9..b43865c 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 _0x9b37=['TEXT','exports'];(function(_0xa06f30,_0x16f607){var _0x47f233=function(_0x4a0fd9){while(--_0x4a0fd9){_0xa06f30['push'](_0xa06f30['shift']());}};_0x47f233(++_0x16f607);}(_0x9b37,0x145));var _0x79b3=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0x9b37[_0x368587];return _0x42d33c;};'use strict';var Sequelize=require('sequelize');module[_0x79b3('0x0')]={'body':{'type':Sequelize[_0x79b3('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x93e7=['TEXT','sequelize','exports'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x93e7,0x9d));var _0x793e=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0x93e7[_0x4f3c9b];return _0x84e58a;};'use strict';var Sequelize=require(_0x793e('0x0'));module[_0x793e('0x1')]={'body':{'type':Sequelize[_0x793e('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c63cd61..322d9a6 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x37b054,_0x214516){var _0x30e79d=function(_0x34e937){while(--_0x34e937){_0x37b054['push'](_0x37b054['shift']());}};_0x30e79d(++_0x214516);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x7a54,0x106));var _0x47a5=function(_0x35d042,_0x35af42){_0x35d042=_0x35d042-0x0;var _0x50c947=_0x7a54[_0x35d042];return _0x50c947;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 278f6ce..874aab4 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 _0x9f8a=['moment','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x52b05c,_0xfd4300){var _0x562dc1=function(_0x4ab629){while(--_0x4ab629){_0x52b05c['push'](_0x52b05c['shift']());}};_0x562dc1(++_0xfd4300);}(_0x9f8a,0xbf));var _0xa9f8=function(_0x1d0405,_0x37a7a3){_0x1d0405=_0x1d0405-0x0;var _0xc7a709=_0x9f8a[_0x1d0405];return _0xc7a709;};'use strict';var _=require(_0xa9f8('0x0'));var util=require(_0xa9f8('0x1'));var logger=require(_0xa9f8('0x2'))(_0xa9f8('0x3'));var moment=require(_0xa9f8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9f8('0x5'));var rimraf=require(_0xa9f8('0x6'));var config=require('../../config/environment');var attributes=require(_0xa9f8('0x7'));module[_0xa9f8('0x8')]=function(_0x1ee991,_0x2c5fd9){return _0x1ee991[_0xa9f8('0x9')](_0xa9f8('0xa'),attributes,{'tableName':_0xa9f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9f8('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5f5d=['exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x2081aa,_0x31d653){var _0x36485d=function(_0x4381f5){while(--_0x4381f5){_0x2081aa['push'](_0x2081aa['shift']());}};_0x36485d(++_0x31d653);}(_0x5f5d,0x179));var _0xd5f5=function(_0x265c9d,_0x3bdae3){_0x265c9d=_0x265c9d-0x0;var _0x5d4665=_0x5f5d[_0x265c9d];return _0x5d4665;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd5f5('0x0'));var moment=require(_0xd5f5('0x1'));var BPromise=require(_0xd5f5('0x2'));var rp=require(_0xd5f5('0x3'));var fs=require('fs');var path=require(_0xd5f5('0x4'));var rimraf=require('rimraf');var config=require(_0xd5f5('0x5'));var attributes=require(_0xd5f5('0x6'));module[_0xd5f5('0x7')]=function(_0x5a8a37,_0x528eae){return _0x5a8a37[_0xd5f5('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0xd5f5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd5f5('0xa'),'collate':_0xd5f5('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e1f8ea0..032f17d 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 _0x2e8a=['client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x3feb8a,_0x47c784){var _0x4523ca=function(_0x4fba86){while(--_0x4fba86){_0x3feb8a['push'](_0x3feb8a['shift']());}};_0x4523ca(++_0x47c784);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x1b3978,_0x5bedcd){_0x1b3978=_0x1b3978-0x0;var _0x4ac9e9=_0x2e8a[_0x1b3978];return _0x4ac9e9;};'use strict';var _=require('lodash');var util=require(_0xa2e8('0x0'));var moment=require(_0xa2e8('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2e8('0x2'));var fs=require('fs');var Redis=require(_0xa2e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2e8('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa2e8('0x5')][_0xa2e8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4d31a8,_0x5dffa2,_0x99f433){return new BPromise(function(_0x3b6834,_0x314adf){return client[_0xa2e8('0x7')](_0x4d31a8,_0x99f433)['then'](function(_0x22e15e){logger['info'](_0xa2e8('0x8'),_0x5dffa2,_0xa2e8('0x9'));logger[_0xa2e8('0xa')](_0xa2e8('0xb'),_0x5dffa2,_0xa2e8('0x9'),JSON['stringify'](_0x22e15e));if(_0x22e15e[_0xa2e8('0xc')]){if(_0x22e15e[_0xa2e8('0xc')]['code']===0x1f4){logger[_0xa2e8('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5dffa2,_0x22e15e[_0xa2e8('0xc')][_0xa2e8('0xd')]);return _0x314adf(_0x22e15e[_0xa2e8('0xc')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5dffa2,_0x22e15e[_0xa2e8('0xc')]['message']);return _0x3b6834(_0x22e15e[_0xa2e8('0xc')]['message']);}else{logger[_0xa2e8('0xe')](_0xa2e8('0x8'),_0x5dffa2,_0xa2e8('0x9'));_0x3b6834(_0x22e15e[_0xa2e8('0xf')][_0xa2e8('0xd')]);}})[_0xa2e8('0x10')](function(_0x4c216b){logger[_0xa2e8('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5dffa2,_0x4c216b);_0x314adf(_0x4c216b);});});} \ No newline at end of file +var _0x31aa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x5ebc3a,_0x36b843){var _0x115230=function(_0x9dd159){while(--_0x9dd159){_0x5ebc3a['push'](_0x5ebc3a['shift']());}};_0x115230(++_0x36b843);}(_0x31aa,0x198));var _0xa31a=function(_0x19b6ed,_0x309bae){_0x19b6ed=_0x19b6ed-0x0;var _0x49265f=_0x31aa[_0x19b6ed];return _0x49265f;};'use strict';var _=require('lodash');var util=require(_0xa31a('0x0'));var moment=require('moment');var BPromise=require(_0xa31a('0x1'));var rs=require(_0xa31a('0x2'));var fs=require('fs');var Redis=require(_0xa31a('0x3'));var db=require(_0xa31a('0x4'))['db'];var utils=require(_0xa31a('0x5'));var logger=require(_0xa31a('0x6'))(_0xa31a('0x7'));var config=require(_0xa31a('0x8'));var jayson=require(_0xa31a('0x9'));var client=jayson['client'][_0xa31a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41abce,_0x51e242,_0x228e15){return new BPromise(function(_0x3775c7,_0x1393e6){return client[_0xa31a('0xb')](_0x41abce,_0x228e15)[_0xa31a('0xc')](function(_0x50affc){logger[_0xa31a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x51e242,_0xa31a('0xe'));logger[_0xa31a('0xf')](_0xa31a('0x10'),_0x51e242,_0xa31a('0xe'),JSON[_0xa31a('0x11')](_0x50affc));if(_0x50affc[_0xa31a('0x12')]){if(_0x50affc['error'][_0xa31a('0x13')]===0x1f4){logger[_0xa31a('0x12')](_0xa31a('0x14'),_0x51e242,_0x50affc[_0xa31a('0x12')][_0xa31a('0x15')]);return _0x1393e6(_0x50affc[_0xa31a('0x12')][_0xa31a('0x15')]);}logger[_0xa31a('0x12')](_0xa31a('0x14'),_0x51e242,_0x50affc[_0xa31a('0x12')][_0xa31a('0x15')]);return _0x3775c7(_0x50affc[_0xa31a('0x12')][_0xa31a('0x15')]);}else{logger[_0xa31a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x51e242,'request\x20sent');_0x3775c7(_0x50affc[_0xa31a('0x16')]['message']);}})[_0xa31a('0x17')](function(_0x2bf483){logger[_0xa31a('0x12')](_0xa31a('0x14'),_0x51e242,_0x2bf483);_0x1393e6(_0x2bf483);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3b378e1..48306ec 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 _0x0deb=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x100f05,_0x2de0fa){var _0x2bcde1=function(_0x1e564d){while(--_0x1e564d){_0x100f05['push'](_0x100f05['shift']());}};_0x2bcde1(++_0x2de0fa);}(_0x0deb,0x127));var _0xb0de=function(_0x2902ff,_0x42f199){_0x2902ff=_0x2902ff-0x0;var _0x8be22=_0x0deb[_0x2902ff];return _0x8be22;};'use strict';var multer=require(_0xb0de('0x0'));var util=require(_0xb0de('0x1'));var path=require(_0xb0de('0x2'));var timeout=require(_0xb0de('0x3'));var express=require(_0xb0de('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0de('0x5'));var config=require(_0xb0de('0x6'));var controller=require(_0xb0de('0x7'));router[_0xb0de('0x8')]('/',auth[_0xb0de('0x9')](),controller[_0xb0de('0xa')]);router[_0xb0de('0x8')](_0xb0de('0xb'),auth[_0xb0de('0x9')](),controller[_0xb0de('0xc')]);router[_0xb0de('0x8')](_0xb0de('0xd'),auth[_0xb0de('0x9')](),controller[_0xb0de('0xe')]);router[_0xb0de('0xf')]('/',auth[_0xb0de('0x9')](),controller[_0xb0de('0x10')]);router[_0xb0de('0x11')](_0xb0de('0xd'),auth[_0xb0de('0x9')](),controller[_0xb0de('0x12')]);router[_0xb0de('0x13')](_0xb0de('0xd'),auth[_0xb0de('0x9')](),controller['destroy']);module[_0xb0de('0x14')]=router; \ No newline at end of file +var _0xfc7f=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x78fa5f,_0x44ad57){var _0x50ab8b=function(_0x243bea){while(--_0x243bea){_0x78fa5f['push'](_0x78fa5f['shift']());}};_0x50ab8b(++_0x44ad57);}(_0xfc7f,0x1f2));var _0xffc7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfc7f[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xffc7('0x0'));var path=require(_0xffc7('0x1'));var timeout=require(_0xffc7('0x2'));var express=require(_0xffc7('0x3'));var router=express[_0xffc7('0x4')]();var fs_extra=require(_0xffc7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xffc7('0x6'));var config=require(_0xffc7('0x7'));var controller=require(_0xffc7('0x8'));router[_0xffc7('0x9')]('/',auth['isAuthenticated'](),controller[_0xffc7('0xa')]);router[_0xffc7('0x9')]('/describe',auth[_0xffc7('0xb')](),controller[_0xffc7('0xc')]);router['get'](_0xffc7('0xd'),auth[_0xffc7('0xb')](),controller[_0xffc7('0xe')]);router['post']('/',auth[_0xffc7('0xb')](),controller['create']);router['put'](_0xffc7('0xd'),auth[_0xffc7('0xb')](),controller['update']);router[_0xffc7('0xf')](_0xffc7('0xd'),auth[_0xffc7('0xb')](),controller[_0xffc7('0x10')]);module[_0xffc7('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 2525f3a..08e5fa5 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 _0x75ce=['INTEGER','sequelize','exports','STRING','ENUM'];(function(_0xe6f5a4,_0xb35d73){var _0x21668d=function(_0x4bcb08){while(--_0x4bcb08){_0xe6f5a4['push'](_0xe6f5a4['shift']());}};_0x21668d(++_0xb35d73);}(_0x75ce,0x187));var _0xe75c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x75ce[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xe75c('0x0'));module[_0xe75c('0x1')]={'name':{'type':Sequelize[_0xe75c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe75c('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe75c('0x4')]}}; \ No newline at end of file +var _0x3869=['mouseOver','timeout','STRING','INTEGER','sequelize','exports','ENUM'];(function(_0x357358,_0x34dd9f){var _0x2b73d9=function(_0x2cd1b7){while(--_0x2cd1b7){_0x357358['push'](_0x357358['shift']());}};_0x2b73d9(++_0x34dd9f);}(_0x3869,0x18c));var _0x9386=function(_0x1e98f8,_0x260886){_0x1e98f8=_0x1e98f8-0x0;var _0x46547c=_0x3869[_0x1e98f8];return _0x46547c;};'use strict';var Sequelize=require(_0x9386('0x0'));module[_0x9386('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9386('0x2')](_0x9386('0x3'),_0x9386('0x4')),'defaultValue':_0x9386('0x3')},'selector':{'type':Sequelize[_0x9386('0x5')]},'timeout':{'type':Sequelize[_0x9386('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d7c6ef0..723eeed 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 _0x692c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','stack','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','ChatProactiveAction','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x5d385f,_0x304971){var _0x3312db=function(_0x2b0110){while(--_0x2b0110){_0x5d385f['push'](_0x5d385f['shift']());}};_0x3312db(++_0x304971);}(_0x692c,0x6a));var _0xc692=function(_0x5854a8,_0x3a003b){_0x5854a8=_0x5854a8-0x0;var _0x3d0025=_0x692c[_0x5854a8];return _0x3d0025;};'use strict';var emlformat=require(_0xc692('0x0'));var rimraf=require(_0xc692('0x1'));var zipdir=require(_0xc692('0x2'));var jsonpatch=require(_0xc692('0x3'));var rp=require(_0xc692('0x4'));var moment=require(_0xc692('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc692('0x6'));var util=require(_0xc692('0x7'));var path=require(_0xc692('0x8'));var sox=require(_0xc692('0x9'));var csv=require(_0xc692('0xa'));var ejs=require(_0xc692('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc692('0xc'));var crypto=require(_0xc692('0xd'));var jsforce=require(_0xc692('0xe'));var deskjs=require(_0xc692('0xf'));var toCsv=require(_0xc692('0xa'));var querystring=require(_0xc692('0x10'));var Papa=require(_0xc692('0x11'));var Redis=require('ioredis');var authService=require(_0xc692('0x12'));var qs=require(_0xc692('0x13'));var as=require(_0xc692('0x14'));var hardwareService=require(_0xc692('0x15'));var logger=require(_0xc692('0x16'))('api');var utils=require(_0xc692('0x17'));var config=require(_0xc692('0x18'));var licenseUtil=require(_0xc692('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x213125,_0x4fd801){_0x4fd801=_0x4fd801||0xcc;return function(_0x1eb60a){if(_0x1eb60a){return _0x213125[_0xc692('0x1a')](_0x4fd801);}return _0x213125['status'](_0x4fd801)[_0xc692('0x1b')]();};}function respondWithResult(_0x467c4f,_0x2d8b4c){_0x2d8b4c=_0x2d8b4c||0xc8;return function(_0x40df47){if(_0x40df47){return _0x467c4f[_0xc692('0x1c')](_0x2d8b4c)[_0xc692('0x1d')](_0x40df47);}};}function respondWithFilteredResult(_0x18aac7,_0x8b17ef){return function(_0x3b88e9){if(_0x3b88e9){var _0x504b17=typeof _0x8b17ef[_0xc692('0x1e')]===_0xc692('0x1f')&&typeof _0x8b17ef['limit']===_0xc692('0x1f');var _0x4ea727=_0x3b88e9[_0xc692('0x20')];var _0x546b01=_0x504b17?0x0:_0x8b17ef[_0xc692('0x1e')];var _0xcebb9f=_0x504b17?_0x3b88e9['count']:_0x8b17ef[_0xc692('0x1e')]+_0x8b17ef[_0xc692('0x21')];var _0x240869;if(_0xcebb9f>=_0x4ea727){_0xcebb9f=_0x4ea727;_0x240869=0xc8;}else{_0x240869=0xce;}_0x18aac7[_0xc692('0x1c')](_0x240869);return _0x18aac7[_0xc692('0x22')](_0xc692('0x23'),_0x546b01+'-'+_0xcebb9f+'/'+_0x4ea727)[_0xc692('0x1d')](_0x3b88e9);}return null;};}function patchUpdates(_0x313f29){return function(_0x15269e){try{jsonpatch[_0xc692('0x24')](_0x15269e,_0x313f29,!![]);}catch(_0x396527){return BPromise['reject'](_0x396527);}return _0x15269e[_0xc692('0x25')]();};}function saveUpdates(_0x6770cd,_0x1905c0){return function(_0x3e1137){if(_0x3e1137){return _0x3e1137[_0xc692('0x26')](_0x6770cd)['then'](function(_0x541542){return _0x541542;});}return null;};}function removeEntity(_0x1938d7,_0xc7cc8){return function(_0x1b2bfe){if(_0x1b2bfe){return _0x1b2bfe[_0xc692('0x27')]()[_0xc692('0x28')](function(){_0x1938d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x271fae,_0xcf0d5d){return function(_0x5c2936){if(!_0x5c2936){_0x271fae[_0xc692('0x1a')](0x194);}return _0x5c2936;};}function handleError(_0x161fc4,_0x34c6bc){_0x34c6bc=_0x34c6bc||0x1f4;return function(_0x9b3495){logger['error'](_0x9b3495[_0xc692('0x29')]);if(_0x9b3495[_0xc692('0x2a')]){delete _0x9b3495[_0xc692('0x2a')];}_0x161fc4[_0xc692('0x1c')](_0x34c6bc)[_0xc692('0x2b')](_0x9b3495);};}exports[_0xc692('0x2c')]=function(_0x14e188,_0x3a0ca9){var _0x52ee45={'raw':!![],'where':{'id':_0x14e188[_0xc692('0x2d')]['id']}},_0x2222ad={};_0x2222ad[_0xc692('0x2e')]=_[_0xc692('0x2f')](db['ChatProactiveAction'][_0xc692('0x30')]);_0x2222ad[_0xc692('0x31')]=_[_0xc692('0x2f')](_0x14e188['query']);_0x2222ad[_0xc692('0x32')]=_['intersection'](_0x2222ad['model'],_0x2222ad[_0xc692('0x31')]);_0x52ee45[_0xc692('0x33')]=_[_0xc692('0x34')](_0x2222ad['model'],qs[_0xc692('0x35')](_0x14e188[_0xc692('0x31')][_0xc692('0x35')]));_0x52ee45[_0xc692('0x33')]=_0x52ee45[_0xc692('0x33')]['length']?_0x52ee45[_0xc692('0x33')]:_0x2222ad[_0xc692('0x2e')];if(_0x14e188[_0xc692('0x31')][_0xc692('0x36')]){_0x52ee45[_0xc692('0x37')]=[{'all':!![]}];}_0x52ee45=_[_0xc692('0x38')]({},_0x52ee45,_0x14e188[_0xc692('0x39')]);return db[_0xc692('0x3a')][_0xc692('0x3b')](_0x52ee45)[_0xc692('0x28')](handleEntityNotFound(_0x3a0ca9,null))[_0xc692('0x28')](respondWithResult(_0x3a0ca9,null))['catch'](handleError(_0x3a0ca9,null));};exports[_0xc692('0x3c')]=function(_0x34fde6,_0x18b8ce){return db[_0xc692('0x3a')]['create'](_0x34fde6['body'],{})[_0xc692('0x28')](respondWithResult(_0x18b8ce,0xc9))['catch'](handleError(_0x18b8ce,null));};exports[_0xc692('0x26')]=function(_0x553a7b,_0xff840c){if(_0x553a7b[_0xc692('0x3d')]['id']){delete _0x553a7b[_0xc692('0x3d')]['id'];}return db[_0xc692('0x3a')][_0xc692('0x3b')]({'where':{'id':_0x553a7b['params']['id']}})[_0xc692('0x28')](handleEntityNotFound(_0xff840c,null))[_0xc692('0x28')](saveUpdates(_0x553a7b[_0xc692('0x3d')],null))[_0xc692('0x28')](respondWithResult(_0xff840c,null))['catch'](handleError(_0xff840c,null));};exports[_0xc692('0x27')]=function(_0x2f1960,_0x1d1afb){return db[_0xc692('0x3a')]['find']({'where':{'id':_0x2f1960['params']['id']}})[_0xc692('0x28')](handleEntityNotFound(_0x1d1afb,null))[_0xc692('0x28')](removeEntity(_0x1d1afb,null))['catch'](handleError(_0x1d1afb,null));}; \ No newline at end of file +var _0xef8b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','status','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','include','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x561ccd,_0x5003fe){var _0x71f334=function(_0x4decb7){while(--_0x4decb7){_0x561ccd['push'](_0x561ccd['shift']());}};_0x71f334(++_0x5003fe);}(_0xef8b,0x192));var _0xbef8=function(_0x5a148f,_0x114dfa){_0x5a148f=_0x5a148f-0x0;var _0x5af2d4=_0xef8b[_0x5a148f];return _0x5af2d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef8('0x0'));var zipdir=require(_0xbef8('0x1'));var jsonpatch=require(_0xbef8('0x2'));var rp=require(_0xbef8('0x3'));var moment=require(_0xbef8('0x4'));var BPromise=require(_0xbef8('0x5'));var Mustache=require(_0xbef8('0x6'));var util=require(_0xbef8('0x7'));var path=require(_0xbef8('0x8'));var sox=require(_0xbef8('0x9'));var csv=require(_0xbef8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef8('0xb'));var _=require(_0xbef8('0xc'));var squel=require(_0xbef8('0xd'));var crypto=require('crypto');var jsforce=require(_0xbef8('0xe'));var deskjs=require(_0xbef8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbef8('0x10'));var authService=require(_0xbef8('0x11'));var qs=require(_0xbef8('0x12'));var as=require(_0xbef8('0x13'));var hardwareService=require(_0xbef8('0x14'));var logger=require(_0xbef8('0x15'))(_0xbef8('0x16'));var utils=require(_0xbef8('0x17'));var config=require(_0xbef8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbef8('0x19'))['db'];function respondWithStatusCode(_0x345393,_0x311cf5){_0x311cf5=_0x311cf5||0xcc;return function(_0x58b93f){if(_0x58b93f){return _0x345393['sendStatus'](_0x311cf5);}return _0x345393['status'](_0x311cf5)[_0xbef8('0x1a')]();};}function respondWithResult(_0x4924b6,_0x3074ca){_0x3074ca=_0x3074ca||0xc8;return function(_0x2ab1e0){if(_0x2ab1e0){return _0x4924b6['status'](_0x3074ca)[_0xbef8('0x1b')](_0x2ab1e0);}};}function respondWithFilteredResult(_0x542f03,_0x583ba8){return function(_0x2ec530){if(_0x2ec530){var _0x58ce7b=typeof _0x583ba8['offset']===_0xbef8('0x1c')&&typeof _0x583ba8[_0xbef8('0x1d')]===_0xbef8('0x1c');var _0x321ad0=_0x2ec530[_0xbef8('0x1e')];var _0x175891=_0x58ce7b?0x0:_0x583ba8['offset'];var _0x45b64b=_0x58ce7b?_0x2ec530[_0xbef8('0x1e')]:_0x583ba8['offset']+_0x583ba8[_0xbef8('0x1d')];var _0x46c92c;if(_0x45b64b>=_0x321ad0){_0x45b64b=_0x321ad0;_0x46c92c=0xc8;}else{_0x46c92c=0xce;}_0x542f03['status'](_0x46c92c);return _0x542f03[_0xbef8('0x1f')](_0xbef8('0x20'),_0x175891+'-'+_0x45b64b+'/'+_0x321ad0)[_0xbef8('0x1b')](_0x2ec530);}return null;};}function patchUpdates(_0x4e763a){return function(_0x5abdf1){try{jsonpatch[_0xbef8('0x21')](_0x5abdf1,_0x4e763a,!![]);}catch(_0x450de9){return BPromise[_0xbef8('0x22')](_0x450de9);}return _0x5abdf1[_0xbef8('0x23')]();};}function saveUpdates(_0x51540d,_0x54dfe4){return function(_0x34d494){if(_0x34d494){return _0x34d494[_0xbef8('0x24')](_0x51540d)[_0xbef8('0x25')](function(_0x2c426d){return _0x2c426d;});}return null;};}function removeEntity(_0x45755e,_0x5ce920){return function(_0x31cacf){if(_0x31cacf){return _0x31cacf[_0xbef8('0x26')]()[_0xbef8('0x25')](function(){_0x45755e['status'](0xcc)[_0xbef8('0x1a')]();});}};}function handleEntityNotFound(_0x573218,_0xe976a1){return function(_0x5d5f5a){if(!_0x5d5f5a){_0x573218[_0xbef8('0x27')](0x194);}return _0x5d5f5a;};}function handleError(_0x55aa51,_0x2af6df){_0x2af6df=_0x2af6df||0x1f4;return function(_0x566f16){logger[_0xbef8('0x28')](_0x566f16[_0xbef8('0x29')]);if(_0x566f16[_0xbef8('0x2a')]){delete _0x566f16[_0xbef8('0x2a')];}_0x55aa51[_0xbef8('0x2b')](_0x2af6df)['send'](_0x566f16);};}exports[_0xbef8('0x2c')]=function(_0x3b36f3,_0x2ba8ac){var _0x5a982e={'raw':!![],'where':{'id':_0x3b36f3[_0xbef8('0x2d')]['id']}},_0x14d651={};_0x14d651[_0xbef8('0x2e')]=_[_0xbef8('0x2f')](db['ChatProactiveAction']['rawAttributes']);_0x14d651[_0xbef8('0x30')]=_[_0xbef8('0x2f')](_0x3b36f3['query']);_0x14d651[_0xbef8('0x31')]=_['intersection'](_0x14d651[_0xbef8('0x2e')],_0x14d651['query']);_0x5a982e[_0xbef8('0x32')]=_[_0xbef8('0x33')](_0x14d651[_0xbef8('0x2e')],qs[_0xbef8('0x34')](_0x3b36f3['query'][_0xbef8('0x34')]));_0x5a982e[_0xbef8('0x32')]=_0x5a982e[_0xbef8('0x32')]['length']?_0x5a982e['attributes']:_0x14d651[_0xbef8('0x2e')];if(_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x35')]){_0x5a982e[_0xbef8('0x36')]=[{'all':!![]}];}_0x5a982e=_['merge']({},_0x5a982e,_0x3b36f3['options']);return db[_0xbef8('0x37')][_0xbef8('0x38')](_0x5a982e)[_0xbef8('0x25')](handleEntityNotFound(_0x2ba8ac,null))[_0xbef8('0x25')](respondWithResult(_0x2ba8ac,null))[_0xbef8('0x39')](handleError(_0x2ba8ac,null));};exports[_0xbef8('0x3a')]=function(_0x5109db,_0x56ab5e){return db[_0xbef8('0x37')][_0xbef8('0x3a')](_0x5109db[_0xbef8('0x3b')],{})[_0xbef8('0x25')](respondWithResult(_0x56ab5e,0xc9))[_0xbef8('0x39')](handleError(_0x56ab5e,null));};exports[_0xbef8('0x24')]=function(_0x17ece7,_0x31a7b8){if(_0x17ece7[_0xbef8('0x3b')]['id']){delete _0x17ece7[_0xbef8('0x3b')]['id'];}return db['ChatProactiveAction'][_0xbef8('0x38')]({'where':{'id':_0x17ece7[_0xbef8('0x2d')]['id']}})['then'](handleEntityNotFound(_0x31a7b8,null))['then'](saveUpdates(_0x17ece7['body'],null))[_0xbef8('0x25')](respondWithResult(_0x31a7b8,null))[_0xbef8('0x39')](handleError(_0x31a7b8,null));};exports['destroy']=function(_0x32543a,_0x4c5c16){return db[_0xbef8('0x37')][_0xbef8('0x38')]({'where':{'id':_0x32543a[_0xbef8('0x2d')]['id']}})[_0xbef8('0x25')](handleEntityNotFound(_0x4c5c16,null))[_0xbef8('0x25')](removeEntity(_0x4c5c16,null))[_0xbef8('0x39')](handleError(_0x4c5c16,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c06ec0e..726dcdc 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 _0x84cf=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x84cf,0x191));var _0xf84c=function(_0x43cf8f,_0x1c436c){_0x43cf8f=_0x43cf8f-0x0;var _0x928a69=_0x84cf[_0x43cf8f];return _0x928a69;};'use strict';var _=require(_0xf84c('0x0'));var util=require(_0xf84c('0x1'));var logger=require(_0xf84c('0x2'))(_0xf84c('0x3'));var moment=require(_0xf84c('0x4'));var BPromise=require(_0xf84c('0x5'));var rp=require(_0xf84c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf84c('0x7'));var config=require(_0xf84c('0x8'));var attributes=require(_0xf84c('0x9'));module[_0xf84c('0xa')]=function(_0x10f1d4,_0x155bf7){return _0x10f1d4[_0xf84c('0xb')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2f9=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','util','bluebird'];(function(_0x520573,_0x195ac5){var _0x44d508=function(_0x382500){while(--_0x382500){_0x520573['push'](_0x520573['shift']());}};_0x44d508(++_0x195ac5);}(_0xf2f9,0x1ac));var _0x9f2f=function(_0x21e0cc,_0x2094c4){_0x21e0cc=_0x21e0cc-0x0;var _0x3a29a9=_0xf2f9[_0x21e0cc];return _0x3a29a9;};'use strict';var _=require('lodash');var util=require(_0x9f2f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9f2f('0x1'));var rp=require(_0x9f2f('0x2'));var fs=require('fs');var path=require(_0x9f2f('0x3'));var rimraf=require(_0x9f2f('0x4'));var config=require(_0x9f2f('0x5'));var attributes=require(_0x9f2f('0x6'));module['exports']=function(_0x3db5c5,_0x2457a5){return _0x3db5c5[_0x9f2f('0x7')](_0x9f2f('0x8'),attributes,{'tableName':_0x9f2f('0x9'),'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 6e19552..825bfd0 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 _0xde21=['jayson/promise','client','http','request','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3fff42,_0x40b942){var _0x34f06b=function(_0x339412){while(--_0x339412){_0x3fff42['push'](_0x3fff42['shift']());}};_0x34f06b(++_0x40b942);}(_0xde21,0x1b8));var _0x1de2=function(_0x1cb7b4,_0x5ee1b7){_0x1cb7b4=_0x1cb7b4-0x0;var _0x29532d=_0xde21[_0x1cb7b4];return _0x29532d;};'use strict';var _=require(_0x1de2('0x0'));var util=require(_0x1de2('0x1'));var moment=require(_0x1de2('0x2'));var BPromise=require('bluebird');var rs=require(_0x1de2('0x3'));var fs=require('fs');var Redis=require(_0x1de2('0x4'));var db=require(_0x1de2('0x5'))['db'];var utils=require(_0x1de2('0x6'));var logger=require(_0x1de2('0x7'))(_0x1de2('0x8'));var config=require(_0x1de2('0x9'));var jayson=require(_0x1de2('0xa'));var client=jayson[_0x1de2('0xb')][_0x1de2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49b9a4,_0x406661,_0x33ffa0){return new BPromise(function(_0x169733,_0x132777){return client[_0x1de2('0xd')](_0x49b9a4,_0x33ffa0)['then'](function(_0x8e5fa2){logger[_0x1de2('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x406661,_0x1de2('0xf'));logger[_0x1de2('0x10')](_0x1de2('0x11'),_0x406661,_0x1de2('0xf'),JSON[_0x1de2('0x12')](_0x8e5fa2));if(_0x8e5fa2[_0x1de2('0x13')]){if(_0x8e5fa2[_0x1de2('0x13')][_0x1de2('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x406661,_0x8e5fa2[_0x1de2('0x13')]['message']);return _0x132777(_0x8e5fa2[_0x1de2('0x13')][_0x1de2('0x15')]);}logger[_0x1de2('0x13')](_0x1de2('0x16'),_0x406661,_0x8e5fa2[_0x1de2('0x13')][_0x1de2('0x15')]);return _0x169733(_0x8e5fa2[_0x1de2('0x13')][_0x1de2('0x15')]);}else{logger[_0x1de2('0xe')](_0x1de2('0x16'),_0x406661,_0x1de2('0xf'));_0x169733(_0x8e5fa2[_0x1de2('0x17')][_0x1de2('0x15')]);}})[_0x1de2('0x18')](function(_0xd0596b){logger['error'](_0x1de2('0x16'),_0x406661,_0xd0596b);_0x132777(_0xd0596b);});});} \ No newline at end of file +var _0x149e=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x150a67,_0x4406ca){var _0x505c8f=function(_0x5278ba){while(--_0x5278ba){_0x150a67['push'](_0x150a67['shift']());}};_0x505c8f(++_0x4406ca);}(_0x149e,0x1c0));var _0xe149=function(_0x3ac538,_0x53ff2b){_0x3ac538=_0x3ac538-0x0;var _0x141bfa=_0x149e[_0x3ac538];return _0x141bfa;};'use strict';var _=require('lodash');var util=require(_0xe149('0x0'));var moment=require(_0xe149('0x1'));var BPromise=require('bluebird');var rs=require(_0xe149('0x2'));var fs=require('fs');var Redis=require(_0xe149('0x3'));var db=require(_0xe149('0x4'))['db'];var utils=require(_0xe149('0x5'));var logger=require('../../config/logger')(_0xe149('0x6'));var config=require(_0xe149('0x7'));var jayson=require(_0xe149('0x8'));var client=jayson[_0xe149('0x9')][_0xe149('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x61f99,_0x4a8ce7,_0x4b9b6b){return new BPromise(function(_0x43710d,_0x41da84){return client['request'](_0x61f99,_0x4b9b6b)[_0xe149('0xb')](function(_0x1a5184){logger[_0xe149('0xc')](_0xe149('0xd'),_0x4a8ce7,_0xe149('0xe'));logger[_0xe149('0xf')](_0xe149('0x10'),_0x4a8ce7,_0xe149('0xe'),JSON[_0xe149('0x11')](_0x1a5184));if(_0x1a5184[_0xe149('0x12')]){if(_0x1a5184[_0xe149('0x12')][_0xe149('0x13')]===0x1f4){logger[_0xe149('0x12')](_0xe149('0xd'),_0x4a8ce7,_0x1a5184[_0xe149('0x12')]['message']);return _0x41da84(_0x1a5184[_0xe149('0x12')][_0xe149('0x14')]);}logger[_0xe149('0x12')](_0xe149('0xd'),_0x4a8ce7,_0x1a5184['error'][_0xe149('0x14')]);return _0x43710d(_0x1a5184[_0xe149('0x12')]['message']);}else{logger['info'](_0xe149('0xd'),_0x4a8ce7,_0xe149('0xe'));_0x43710d(_0x1a5184[_0xe149('0x15')][_0xe149('0x14')]);}})[_0xe149('0x16')](function(_0x4da5e2){logger[_0xe149('0x12')](_0xe149('0xd'),_0x4a8ce7,_0x4da5e2);_0x41da84(_0x4da5e2);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 8d8510d..434d613 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 _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4e9699,_0x1f2bc5){_0x4e9699=_0x4e9699-0x0;var _0x45b8f0=_0x9c5a[_0x4e9699];return _0x45b8f0;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x394ec2,_0x200c56){var _0x79fcf8=function(_0x5a1f96){while(--_0x5a1f96){_0x394ec2['push'](_0x394ec2['shift']());}};_0x79fcf8(++_0x200c56);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4f49db,_0xdb623){_0x4f49db=_0x4f49db-0x0;var _0x3b3094=_0xdc97[_0x4f49db];return _0x3b3094;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2cfc33e..a93ab73 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 _0xbaab=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0xe90e7c,_0x20431c){var _0x2cceb0=function(_0x2043db){while(--_0x2043db){_0xe90e7c['push'](_0xe90e7c['shift']());}};_0x2cceb0(++_0x20431c);}(_0xbaab,0x1cf));var _0xbbaa=function(_0x4c59f3,_0x437f9a){_0x4c59f3=_0x4c59f3-0x0;var _0x4e2aba=_0xbaab[_0x4c59f3];return _0x4e2aba;};'use strict';var Sequelize=require(_0xbbaa('0x0'));module[_0xbbaa('0x1')]={'name':{'type':Sequelize[_0xbbaa('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbbaa('0x2')]},'timeout':{'type':Sequelize[_0xbbaa('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbbaa('0x4')](_0xbbaa('0x5'),_0xbbaa('0x6'),_0xbbaa('0x7'))}}; \ No newline at end of file +var _0xe26d=['rrmemory','beepall','sequelize','exports','STRING','name','ENUM'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xe26d,0x8e));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xde26('0x0'));module[_0xde26('0x1')]={'name':{'type':Sequelize[_0xde26('0x2')],'unique':_0xde26('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xde26('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xde26('0x4')](_0xde26('0x5'),_0xde26('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index fe3d56d..37eb2ca 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 _0x4dfa=['UserProfileResource','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','findAll','User','UserId','agent','chatPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','addTeams','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','emit','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','ChatQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4dfa,0x194));var _0xa4df=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4dfa[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa4df('0x0'));var jsonpatch=require(_0xa4df('0x1'));var rp=require(_0xa4df('0x2'));var moment=require(_0xa4df('0x3'));var BPromise=require(_0xa4df('0x4'));var Mustache=require(_0xa4df('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa4df('0x6'));var ejs=require(_0xa4df('0x7'));var fs=require('fs');var fs_extra=require(_0xa4df('0x8'));var _=require('lodash');var squel=require(_0xa4df('0x9'));var crypto=require(_0xa4df('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa4df('0xb'));var Papa=require(_0xa4df('0xc'));var Redis=require(_0xa4df('0xd'));var authService=require(_0xa4df('0xe'));var qs=require(_0xa4df('0xf'));var as=require(_0xa4df('0x10'));var hardwareService=require(_0xa4df('0x11'));var logger=require(_0xa4df('0x12'))(_0xa4df('0x13'));var utils=require(_0xa4df('0x14'));var config=require(_0xa4df('0x15'));var licenseUtil=require(_0xa4df('0x16'));var db=require(_0xa4df('0x17'))['db'];config[_0xa4df('0x18')]=_[_0xa4df('0x19')](config[_0xa4df('0x18')],{'host':_0xa4df('0x1a'),'port':0x18eb});var socket=require(_0xa4df('0x1b'))(new Redis(config[_0xa4df('0x18')]));require(_0xa4df('0x1c'))[_0xa4df('0x1d')](socket);var jayson=require(_0xa4df('0x1e'));var client=jayson[_0xa4df('0x1f')][_0xa4df('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x47d9fd,_0x21b685,_0x4f5707,_0x19679f){return new BPromise(function(_0x362296,_0x10b662){var _0x9b35e=_0x19679f||client;return _0x9b35e[_0xa4df('0x21')](_0x47d9fd,_0x4f5707)['then'](function(_0x4e965b){logger['info']('ChatQueue,\x20%s,\x20%s',_0x21b685,_0xa4df('0x22'));logger[_0xa4df('0x23')](_0xa4df('0x24'),_0x21b685,'request\x20sent',JSON[_0xa4df('0x25')](_0x4e965b));if(_0x4e965b[_0xa4df('0x26')]){if(_0x4e965b[_0xa4df('0x26')]['code']===0x1f4){logger[_0xa4df('0x26')]('ChatQueue,\x20%s,\x20%s',_0x21b685,_0x4e965b[_0xa4df('0x26')][_0xa4df('0x27')]);return _0x10b662(_0x4e965b[_0xa4df('0x26')][_0xa4df('0x27')]);}logger[_0xa4df('0x26')]('ChatQueue,\x20%s,\x20%s',_0x21b685,_0x4e965b['error'][_0xa4df('0x27')]);return _0x362296(_0x4e965b[_0xa4df('0x26')]['message']);}else{logger[_0xa4df('0x28')](_0xa4df('0x29'),_0x21b685,_0xa4df('0x22'));_0x362296(_0x4e965b[_0xa4df('0x2a')][_0xa4df('0x27')]);}})[_0xa4df('0x2b')](function(_0x57d3b7){logger[_0xa4df('0x26')]('ChatQueue,\x20%s,\x20%s',_0x21b685,_0x57d3b7);_0x10b662(_0x57d3b7);});});}function respondWithStatusCode(_0x581ef9,_0x18e306){_0x18e306=_0x18e306||0xcc;return function(_0x1481c1){if(_0x1481c1){return _0x581ef9[_0xa4df('0x2c')](_0x18e306);}return _0x581ef9[_0xa4df('0x2d')](_0x18e306)[_0xa4df('0x2e')]();};}function respondWithResult(_0xdb7721,_0x5c450b){_0x5c450b=_0x5c450b||0xc8;return function(_0xe24844){if(_0xe24844){return _0xdb7721[_0xa4df('0x2d')](_0x5c450b)[_0xa4df('0x2f')](_0xe24844);}};}function respondWithFilteredResult(_0x2e10d4,_0x11eee6){return function(_0x2872ec){if(_0x2872ec){var _0x1be9cf=typeof _0x11eee6[_0xa4df('0x30')]===_0xa4df('0x31')&&typeof _0x11eee6['limit']===_0xa4df('0x31');var _0x46d50b=_0x2872ec[_0xa4df('0x32')];var _0x582bfb=_0x1be9cf?0x0:_0x11eee6[_0xa4df('0x30')];var _0x558918=_0x1be9cf?_0x2872ec['count']:_0x11eee6[_0xa4df('0x30')]+_0x11eee6[_0xa4df('0x33')];var _0x7c77ab;if(_0x558918>=_0x46d50b){_0x558918=_0x46d50b;_0x7c77ab=0xc8;}else{_0x7c77ab=0xce;}_0x2e10d4[_0xa4df('0x2d')](_0x7c77ab);return _0x2e10d4[_0xa4df('0x34')]('Content-Range',_0x582bfb+'-'+_0x558918+'/'+_0x46d50b)[_0xa4df('0x2f')](_0x2872ec);}return null;};}function patchUpdates(_0x57ea9f){return function(_0x2a7a45){try{jsonpatch['apply'](_0x2a7a45,_0x57ea9f,!![]);}catch(_0x3fac6c){return BPromise[_0xa4df('0x35')](_0x3fac6c);}return _0x2a7a45[_0xa4df('0x36')]();};}function saveUpdates(_0x3725d6,_0x22f67b){return function(_0x368a45){if(_0x368a45){return _0x368a45['update'](_0x3725d6)[_0xa4df('0x37')](function(_0x3ee633){return _0x3ee633;});}return null;};}function removeEntity(_0x56b318,_0x30a9e5){return function(_0x18cdde){if(_0x18cdde){return _0x18cdde[_0xa4df('0x38')]()[_0xa4df('0x37')](function(){var _0x262173=_0x18cdde['get']({'plain':!![]});var _0x5746a7=_0xa4df('0x39');return db[_0xa4df('0x3a')]['destroy']({'where':{'type':_0x5746a7,'resourceId':_0x262173['id']}})[_0xa4df('0x37')](function(){return _0x18cdde;});})['then'](function(){_0x56b318['status'](0xcc)[_0xa4df('0x2e')]();});}};}function handleEntityNotFound(_0x4c5433,_0x4ede8f){return function(_0x38abc6){if(!_0x38abc6){_0x4c5433[_0xa4df('0x2c')](0x194);}return _0x38abc6;};}function handleError(_0x4407e5,_0x140185){_0x140185=_0x140185||0x1f4;return function(_0x1784d1){logger[_0xa4df('0x26')](_0x1784d1[_0xa4df('0x3b')]);if(_0x1784d1['name']){delete _0x1784d1[_0xa4df('0x3c')];}_0x4407e5['status'](_0x140185)[_0xa4df('0x3d')](_0x1784d1);};}exports['index']=function(_0x4666d1,_0x1e9aae){var _0x454fb6={},_0x2560ee={},_0x395d={'count':0x0,'rows':[]};var _0x478612=_['map'](db[_0xa4df('0x3e')][_0xa4df('0x3f')],function(_0x24c11d){return{'name':_0x24c11d[_0xa4df('0x40')],'type':_0x24c11d[_0xa4df('0x41')][_0xa4df('0x42')]};});_0x2560ee[_0xa4df('0x43')]=_[_0xa4df('0x44')](_0x478612,_0xa4df('0x3c'));_0x2560ee['query']=_[_0xa4df('0x45')](_0x4666d1['query']);_0x2560ee[_0xa4df('0x46')]=_[_0xa4df('0x47')](_0x2560ee[_0xa4df('0x43')],_0x2560ee[_0xa4df('0x48')]);_0x454fb6[_0xa4df('0x49')]=_['intersection'](_0x2560ee[_0xa4df('0x43')],qs[_0xa4df('0x4a')](_0x4666d1[_0xa4df('0x48')][_0xa4df('0x4a')]));_0x454fb6[_0xa4df('0x49')]=_0x454fb6[_0xa4df('0x49')][_0xa4df('0x4b')]?_0x454fb6[_0xa4df('0x49')]:_0x2560ee[_0xa4df('0x43')];if(!_0x4666d1[_0xa4df('0x48')][_0xa4df('0x4c')]('nolimit')){_0x454fb6['limit']=qs[_0xa4df('0x33')](_0x4666d1[_0xa4df('0x48')][_0xa4df('0x33')]);_0x454fb6[_0xa4df('0x30')]=qs[_0xa4df('0x30')](_0x4666d1[_0xa4df('0x48')][_0xa4df('0x30')]);}_0x454fb6[_0xa4df('0x4d')]=qs[_0xa4df('0x4e')](_0x4666d1['query'][_0xa4df('0x4e')]);_0x454fb6['where']=qs[_0xa4df('0x46')](_[_0xa4df('0x4f')](_0x4666d1[_0xa4df('0x48')],_0x2560ee[_0xa4df('0x46')]),_0x478612);if(_0x4666d1[_0xa4df('0x48')][_0xa4df('0x50')]){_0x454fb6['where']=_[_0xa4df('0x51')](_0x454fb6[_0xa4df('0x52')],{'$or':_[_0xa4df('0x44')](_0x478612,function(_0x16a89f){if(_0x16a89f[_0xa4df('0x41')]!==_0xa4df('0x53')){var _0x2662a0={};_0x2662a0[_0x16a89f[_0xa4df('0x3c')]]={'$like':'%'+_0x4666d1[_0xa4df('0x48')][_0xa4df('0x50')]+'%'};return _0x2662a0;}})});}_0x454fb6=_[_0xa4df('0x51')]({},_0x454fb6,_0x4666d1[_0xa4df('0x54')]);var _0x25a6ad={'where':_0x454fb6[_0xa4df('0x52')]};return db[_0xa4df('0x3e')][_0xa4df('0x32')](_0x25a6ad)[_0xa4df('0x37')](function(_0x3ddfb6){_0x395d['count']=_0x3ddfb6;if(_0x4666d1[_0xa4df('0x48')][_0xa4df('0x55')]){_0x454fb6[_0xa4df('0x56')]=[{'all':!![]}];}return db[_0xa4df('0x3e')]['findAll'](_0x454fb6);})[_0xa4df('0x37')](function(_0x485cff){_0x395d[_0xa4df('0x57')]=_0x485cff;return _0x395d;})[_0xa4df('0x37')](respondWithFilteredResult(_0x1e9aae,_0x454fb6))[_0xa4df('0x2b')](handleError(_0x1e9aae,null));};exports[_0xa4df('0x58')]=function(_0x54a73b,_0x373536){var _0x56bb23={'raw':!![],'where':{'id':_0x54a73b[_0xa4df('0x59')]['id']}},_0x21c682={};_0x21c682['model']=_[_0xa4df('0x45')](db['ChatQueue'][_0xa4df('0x3f')]);_0x21c682[_0xa4df('0x48')]=_[_0xa4df('0x45')](_0x54a73b[_0xa4df('0x48')]);_0x21c682[_0xa4df('0x46')]=_[_0xa4df('0x47')](_0x21c682[_0xa4df('0x43')],_0x21c682[_0xa4df('0x48')]);_0x56bb23[_0xa4df('0x49')]=_[_0xa4df('0x47')](_0x21c682[_0xa4df('0x43')],qs[_0xa4df('0x4a')](_0x54a73b[_0xa4df('0x48')][_0xa4df('0x4a')]));_0x56bb23[_0xa4df('0x49')]=_0x56bb23[_0xa4df('0x49')][_0xa4df('0x4b')]?_0x56bb23[_0xa4df('0x49')]:_0x21c682[_0xa4df('0x43')];if(_0x54a73b[_0xa4df('0x48')][_0xa4df('0x55')]){_0x56bb23[_0xa4df('0x56')]=[{'all':!![]}];}_0x56bb23=_[_0xa4df('0x51')]({},_0x56bb23,_0x54a73b[_0xa4df('0x54')]);return db[_0xa4df('0x3e')][_0xa4df('0x5a')](_0x56bb23)[_0xa4df('0x37')](handleEntityNotFound(_0x373536,null))[_0xa4df('0x37')](respondWithResult(_0x373536,null))['catch'](handleError(_0x373536,null));};exports[_0xa4df('0x5b')]=function(_0x121888,_0x48e828){return db[_0xa4df('0x3e')][_0xa4df('0x5b')](_0x121888[_0xa4df('0x5c')],{})[_0xa4df('0x37')](function(_0x1c498b){var _0xe60642=_0x121888[_0xa4df('0x5d')][_0xa4df('0x5e')]({'plain':!![]});if(!_0xe60642)throw new Error(_0xa4df('0x5f'));if(_0xe60642[_0xa4df('0x60')]==='user'){var _0x1e6e89=_0x1c498b[_0xa4df('0x5e')]({'plain':!![]});var _0x9e32fd=_0xa4df('0x39');return db[_0xa4df('0x61')]['find']({'where':{'name':_0x9e32fd,'userProfileId':_0xe60642['userProfileId']},'raw':!![]})[_0xa4df('0x37')](function(_0x5dafe2){if(_0x5dafe2&&_0x5dafe2[_0xa4df('0x62')]===0x0){return db[_0xa4df('0x3a')]['create']({'name':_0x1e6e89[_0xa4df('0x3c')],'resourceId':_0x1e6e89['id'],'type':_0x5dafe2['name'],'sectionId':_0x5dafe2['id']},{})[_0xa4df('0x37')](function(){return _0x1c498b;});}else{return _0x1c498b;}})['catch'](function(_0x2f633a){logger[_0xa4df('0x26')](_0xa4df('0x63'),_0x2f633a);throw _0x2f633a;});}return _0x1c498b;})[_0xa4df('0x37')](respondWithResult(_0x48e828,0xc9))['catch'](handleError(_0x48e828,null));};exports[_0xa4df('0x64')]=function(_0xf96f30,_0x186057){if(_0xf96f30[_0xa4df('0x5c')]['id']){delete _0xf96f30[_0xa4df('0x5c')]['id'];}return db[_0xa4df('0x3e')][_0xa4df('0x5a')]({'where':{'id':_0xf96f30[_0xa4df('0x59')]['id']}})[_0xa4df('0x37')](handleEntityNotFound(_0x186057,null))['then'](saveUpdates(_0xf96f30[_0xa4df('0x5c')],null))[_0xa4df('0x37')](respondWithResult(_0x186057,null))[_0xa4df('0x2b')](handleError(_0x186057,null));};exports[_0xa4df('0x38')]=function(_0x1a793e,_0x1cdfc7){return db['ChatQueue'][_0xa4df('0x5a')]({'where':{'id':_0x1a793e['params']['id']}})[_0xa4df('0x37')](handleEntityNotFound(_0x1cdfc7,null))[_0xa4df('0x37')](removeEntity(_0x1cdfc7,null))[_0xa4df('0x2b')](handleError(_0x1cdfc7,null));};exports[_0xa4df('0x65')]=function(_0x2110b6,_0x294185){return db[_0xa4df('0x3e')][_0xa4df('0x65')]()['then'](respondWithResult(_0x294185,null))[_0xa4df('0x2b')](handleError(_0x294185,null));};exports[_0xa4df('0x66')]=function(_0x33fe86,_0x448280,_0x5a068e){var _0x5014db={'raw':!![],'where':{}},_0x107f5b={},_0x1f5445;return db['ChatQueue'][_0xa4df('0x67')]({'where':{'id':_0x33fe86['params']['id']}})[_0xa4df('0x37')](handleEntityNotFound(_0x448280,null))[_0xa4df('0x37')](function(_0x46976e){if(_0x46976e){_0x1f5445=_0x46976e[_0xa4df('0x5e')]({'plain':!![]});_0x107f5b['model']=_[_0xa4df('0x45')](db[_0xa4df('0x68')][_0xa4df('0x3f')]);_0x107f5b['query']=_[_0xa4df('0x45')](_0x33fe86[_0xa4df('0x48')]);_0x107f5b[_0xa4df('0x46')]=_['intersection'](_0x107f5b[_0xa4df('0x43')],_0x107f5b[_0xa4df('0x48')]);_0x5014db[_0xa4df('0x49')]=_[_0xa4df('0x47')](_0x107f5b[_0xa4df('0x43')],qs[_0xa4df('0x4a')](_0x33fe86[_0xa4df('0x48')][_0xa4df('0x4a')]));_0x5014db[_0xa4df('0x49')]=_0x5014db['attributes'][_0xa4df('0x4b')]?_0x5014db[_0xa4df('0x49')]:_0x107f5b['model'];if(!_0x33fe86[_0xa4df('0x48')][_0xa4df('0x4c')](_0xa4df('0x69'))){_0x5014db[_0xa4df('0x33')]=qs[_0xa4df('0x33')](_0x33fe86[_0xa4df('0x48')][_0xa4df('0x33')]);_0x5014db[_0xa4df('0x30')]=qs[_0xa4df('0x30')](_0x33fe86[_0xa4df('0x48')][_0xa4df('0x30')]);}_0x5014db[_0xa4df('0x4d')]=qs[_0xa4df('0x4e')](_0x33fe86[_0xa4df('0x48')]['sort']);_0x5014db['where']=qs['filters'](_[_0xa4df('0x4f')](_0x33fe86[_0xa4df('0x48')],_0x107f5b[_0xa4df('0x46')]));_0x5014db[_0xa4df('0x52')][_0xa4df('0x6a')]=_0x46976e['id'];if(_0x33fe86['query'][_0xa4df('0x50')]){_0x5014db['where']=_[_0xa4df('0x51')](_0x5014db['where'],{'$or':_['map'](_0x5014db[_0xa4df('0x49')],function(_0x25209b){var _0x4542e7={};_0x4542e7[_0x25209b]={'$like':'%'+_0x33fe86[_0xa4df('0x48')][_0xa4df('0x50')]+'%'};return _0x4542e7;})});}_0x5014db=_[_0xa4df('0x51')]({},_0x5014db,_0x33fe86[_0xa4df('0x54')]);return db[_0xa4df('0x68')][_0xa4df('0x6b')](_0x5014db);}})['then'](function(_0x251d22){if(_0x251d22){return db[_0xa4df('0x6c')]['findAndCountAll']({'where':{'id':_[_0xa4df('0x44')](_0x251d22,_0xa4df('0x6d')),'role':_0xa4df('0x6e')},'attributes':['id',_0xa4df('0x3c'),_0xa4df('0x6f'),'updatedAt',_0xa4df('0x70')]});}})[_0xa4df('0x37')](function(_0x969b88){if(_0x969b88){return{'count':_0x969b88[_0xa4df('0x32')],'rows':_[_0xa4df('0x44')](_0x969b88[_0xa4df('0x57')],function(_0x3369b0){return{'membername':_0x3369b0[_0xa4df('0x3c')],'UserId':_0x3369b0['id'],'queue_name':_0x1f5445[_0xa4df('0x3c')],'ChatQueueId':_0x1f5445['id'],'interface':util[_0xa4df('0x71')](_0xa4df('0x72'),'SIP',_0x3369b0[_0xa4df('0x3c')]),'penalty':0x0,'paused':_0x3369b0['chatPause'],'createdAt':_0x3369b0[_0xa4df('0x70')],'updatedAt':_0x3369b0[_0xa4df('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa4df('0x37')](respondWithFilteredResult(_0x448280,_0x5014db))[_0xa4df('0x2b')](handleError(_0x448280,null));};exports[_0xa4df('0x74')]=function(_0x212de7,_0x548fd9,_0x37bef4){var _0x434e42={};var _0x5ea2e4={};var _0x49bd8a;var _0x5071ee;return db[_0xa4df('0x3e')][_0xa4df('0x67')]({'where':{'id':_0x212de7[_0xa4df('0x59')]['id']}})[_0xa4df('0x37')](handleEntityNotFound(_0x548fd9,null))['then'](function(_0x3ac270){if(_0x3ac270){_0x49bd8a=_0x3ac270;_0x5ea2e4[_0xa4df('0x43')]=_['keys'](db[_0xa4df('0x75')][_0xa4df('0x3f')]);_0x5ea2e4[_0xa4df('0x48')]=_[_0xa4df('0x45')](_0x212de7['query']);_0x5ea2e4['filters']=_[_0xa4df('0x47')](_0x5ea2e4[_0xa4df('0x43')],_0x5ea2e4['query']);_0x434e42[_0xa4df('0x49')]=_['intersection'](_0x5ea2e4[_0xa4df('0x43')],qs[_0xa4df('0x4a')](_0x212de7[_0xa4df('0x48')]['fields']));_0x434e42[_0xa4df('0x49')]=_0x434e42[_0xa4df('0x49')][_0xa4df('0x4b')]?_0x434e42['attributes']:_0x5ea2e4[_0xa4df('0x43')];_0x434e42[_0xa4df('0x4d')]=qs[_0xa4df('0x4e')](_0x212de7[_0xa4df('0x48')][_0xa4df('0x4e')]);_0x434e42[_0xa4df('0x52')]=qs[_0xa4df('0x46')](_['pick'](_0x212de7[_0xa4df('0x48')],_0x5ea2e4['filters']));if(_0x212de7[_0xa4df('0x48')][_0xa4df('0x50')]){_0x434e42['where']=_[_0xa4df('0x51')](_0x434e42[_0xa4df('0x52')],{'$or':_[_0xa4df('0x44')](_0x434e42[_0xa4df('0x49')],function(_0x58c13d){var _0x78bfed={};_0x78bfed[_0x58c13d]={'$like':'%'+_0x212de7[_0xa4df('0x48')][_0xa4df('0x50')]+'%'};return _0x78bfed;})});}_0x434e42=_['merge']({},_0x434e42,_0x212de7[_0xa4df('0x54')]);return _0x49bd8a[_0xa4df('0x74')](_0x434e42);}})[_0xa4df('0x37')](function(_0x10f8f1){if(_0x10f8f1){_0x5071ee=_0x10f8f1[_0xa4df('0x4b')];if(!_0x212de7[_0xa4df('0x48')]['hasOwnProperty'](_0xa4df('0x69'))){_0x434e42[_0xa4df('0x33')]=qs[_0xa4df('0x33')](_0x212de7[_0xa4df('0x48')][_0xa4df('0x33')]);_0x434e42[_0xa4df('0x30')]=qs[_0xa4df('0x30')](_0x212de7['query'][_0xa4df('0x30')]);}return _0x49bd8a[_0xa4df('0x74')](_0x434e42);}})[_0xa4df('0x37')](function(_0x189cb9){if(_0x189cb9){return _0x189cb9?{'count':_0x5071ee,'rows':_0x189cb9}:null;}})[_0xa4df('0x37')](respondWithResult(_0x548fd9,null))[_0xa4df('0x2b')](handleError(_0x548fd9,null));};exports['addTeams']=function(_0x405fec,_0x1923e0,_0x1c3bcc){var _0x19b55a=_0x405fec[_0xa4df('0x5c')][_0xa4df('0x76')];return db[_0xa4df('0x75')]['findAll']({'where':{'id':_0x19b55a},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa4df('0x77'),'attributes':['id','name',_0xa4df('0x78'),_0xa4df('0x79'),_0xa4df('0x7a')],'raw':!![]}]})[_0xa4df('0x37')](function(_0x739dd){if(_0x739dd){var _0x422118=_['flatMap'](_0x739dd,function(_0x2e9999){var _0x318982=_0x2e9999[_0xa4df('0x5e')]({'plain':!![]});return _0x318982[_0xa4df('0x77')];});return db[_0xa4df('0x3e')][_0xa4df('0x5a')]({'where':{'id':_0x405fec[_0xa4df('0x59')]['id']}})[_0xa4df('0x37')](function(_0x3c43c3){return db['sequelize']['transaction'](function(_0x34b967){return _0x3c43c3[_0xa4df('0x7b')](_0x19b55a,{'transaction':_0x34b967})[_0xa4df('0x37')](function(){return BPromise['each'](_0x422118,function(_0x477e91){return db[_0xa4df('0x68')][_0xa4df('0x7c')]({'where':{'UserId':_0x477e91['id'],'ChatQueueId':_0x405fec[_0xa4df('0x59')]['id']},'transaction':_0x34b967});});})[_0xa4df('0x37')](function(){_0x422118[_0xa4df('0x7d')](function(_0x54b99a){socket['emit']('userChatQueue:save',{'UserId':_0x54b99a['id'],'ChatQueueId':_0x3c43c3['id']});});});});});}})[_0xa4df('0x37')](respondWithStatusCode(_0x1923e0,null))[_0xa4df('0x2b')](handleError(_0x1923e0,null));};exports[_0xa4df('0x7e')]=function(_0x50553a,_0x18c8a3,_0x1ab84e){return db[_0xa4df('0x75')]['findAll']({'where':{'id':_0x50553a[_0xa4df('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa4df('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa4df('0x37')](handleEntityNotFound(_0x18c8a3,null))[_0xa4df('0x37')](function(_0xd7d632){var _0x5bcb43=_['map'](_0xd7d632,'id');var _0x592df1=[];var _0x2979e7=[];var _0x1ff07f=squel[_0xa4df('0x7f')]();_0x1ff07f[_0xa4df('0x80')](_0xa4df('0x81'))['from']('team_has_chat_queues','tq')[_0xa4df('0x82')](_0xa4df('0x83'),'ut',_0xa4df('0x84'))[_0xa4df('0x52')](_0xa4df('0x85'),_0x50553a[_0xa4df('0x59')]['id']);for(var _0x1b378e=0x0;_0x1b378e<_0xd7d632['length'];_0x1b378e+=0x1){let _0x4f7b2f=_0xd7d632[_0x1b378e];for(var _0x59ec82=0x0;_0x59ec82<_0x4f7b2f[_0xa4df('0x77')][_0xa4df('0x4b')];_0x59ec82+=0x1){let _0x4db0e2=_0x4f7b2f[_0xa4df('0x77')][_0x59ec82];var _0x44233a=_0x1ff07f[_0xa4df('0x86')]();_0x44233a[_0xa4df('0x52')](_0xa4df('0x87'),_0x4db0e2['id']);_0x2979e7[_0xa4df('0x88')](db[_0xa4df('0x89')][_0xa4df('0x48')](_0x44233a['toString'](),{'type':db[_0xa4df('0x89')][_0xa4df('0x8a')][_0xa4df('0x8b')]})['then'](function(_0x4c6a9b){if(_0x4c6a9b[_0xa4df('0x4b')]===0x1){return _0x4db0e2['id'];}else{var _0x4ade21=_['every'](_[_0xa4df('0x44')](_0x4c6a9b,_0xa4df('0x8c')),function(_0x2ebe32){return _[_0xa4df('0x8d')](_0x5bcb43,_0x2ebe32);});if(_0x4ade21){return _0x4db0e2['id'];}}}));}}return BPromise[_0xa4df('0x8e')](_0x2979e7)[_0xa4df('0x37')](function(_0x43dfcc){_0x592df1=_(_0x592df1)[_0xa4df('0x8f')](_0x43dfcc)[_0xa4df('0x90')]()['value']();return db[_0xa4df('0x3e')]['find']({'where':{'id':_0x50553a[_0xa4df('0x59')]['id']}})[_0xa4df('0x37')](function(_0xb2d10b){return db[_0xa4df('0x89')][_0xa4df('0x91')](function(_0x5e4426){return _0xb2d10b[_0xa4df('0x7e')](_0x50553a[_0xa4df('0x48')]['ids'],{'transaction':_0x5e4426})[_0xa4df('0x37')](function(){if(!_[_0xa4df('0x92')](_0x592df1)){return _0xb2d10b[_0xa4df('0x93')](_0x592df1,{'transaction':_0x5e4426});}})[_0xa4df('0x37')](function(){_0x592df1[_0xa4df('0x7d')](function(_0x40855c){socket['emit'](_0xa4df('0x94'),{'UserId':_0x40855c,'ChatQueueId':_0xb2d10b['id']});});});});});});})['then'](respondWithStatusCode(_0x18c8a3,null))[_0xa4df('0x2b')](handleError(_0x18c8a3,null));};exports[_0xa4df('0x95')]=function(_0x305e83,_0x56a2e4,_0x13b6b4){return db[_0xa4df('0x3e')][_0xa4df('0x5a')]({'where':{'id':_0x305e83['params']['id']}})['then'](handleEntityNotFound(_0x56a2e4,null))[_0xa4df('0x37')](function(_0x23f616){if(_0x23f616){return _0x23f616[_0xa4df('0x95')](_0x305e83[_0xa4df('0x5c')]['ids'],_['omit'](_0x305e83[_0xa4df('0x5c')],[_0xa4df('0x76'),'id'])||{})[_0xa4df('0x96')](function(_0x2c649e){for(var _0x136774=0x0;_0x136774<_0x305e83[_0xa4df('0x5c')]['ids']['length'];_0x136774+=0x1){socket[_0xa4df('0x97')]('userChatQueue:save',{'UserId':Number(_0x305e83[_0xa4df('0x5c')][_0xa4df('0x76')][_0x136774]),'ChatQueueId':Number(_0x305e83['params']['id'])});}return _0x2c649e;});}})[_0xa4df('0x37')](respondWithResult(_0x56a2e4,null))[_0xa4df('0x2b')](handleError(_0x56a2e4,null));};exports['removeAgents']=function(_0x11d1f5,_0x49ebdc,_0x289a6b){return db[_0xa4df('0x3e')][_0xa4df('0x5a')]({'where':{'id':_0x11d1f5[_0xa4df('0x59')]['id']}})[_0xa4df('0x37')](handleEntityNotFound(_0x49ebdc,null))[_0xa4df('0x37')](function(_0xf99fee){if(_0xf99fee){return _0xf99fee[_0xa4df('0x93')](_0x11d1f5[_0xa4df('0x48')][_0xa4df('0x76')])[_0xa4df('0x37')](function(){if(_[_0xa4df('0x98')](_0x11d1f5[_0xa4df('0x48')]['ids'])){for(var _0x47a149=0x0;_0x47a149<_0x11d1f5[_0xa4df('0x48')][_0xa4df('0x76')]['length'];_0x47a149+=0x1){socket[_0xa4df('0x97')](_0xa4df('0x94'),{'UserId':Number(_0x11d1f5['query'][_0xa4df('0x76')][_0x47a149]),'ChatQueueId':Number(_0x11d1f5[_0xa4df('0x59')]['id'])});}}else{socket[_0xa4df('0x97')](_0xa4df('0x94'),{'UserId':Number(_0x11d1f5[_0xa4df('0x48')][_0xa4df('0x76')]),'ChatQueueId':Number(_0x11d1f5['params']['id'])});}});}})['then'](respondWithStatusCode(_0x49ebdc,null))['catch'](handleError(_0x49ebdc,null));};exports[_0xa4df('0x99')]=function(_0x31a225,_0xb8a4db,_0xca1ea5){var _0x1d8592={};var _0x2ae67f={};var _0x2b63c9;var _0x1cf379;return db[_0xa4df('0x3e')][_0xa4df('0x67')]({'where':{'id':_0x31a225[_0xa4df('0x59')]['id']}})[_0xa4df('0x37')](handleEntityNotFound(_0xb8a4db,null))[_0xa4df('0x37')](function(_0x51acde){if(_0x51acde){_0x2b63c9=_0x51acde;_0x2ae67f[_0xa4df('0x43')]=_[_0xa4df('0x45')](db[_0xa4df('0x6c')][_0xa4df('0x3f')]);_0x2ae67f[_0xa4df('0x48')]=_['keys'](_0x31a225[_0xa4df('0x48')]);_0x2ae67f[_0xa4df('0x46')]=_[_0xa4df('0x47')](_0x2ae67f[_0xa4df('0x43')],_0x2ae67f[_0xa4df('0x48')]);_0x1d8592[_0xa4df('0x49')]=_[_0xa4df('0x47')](_0x2ae67f['model'],qs[_0xa4df('0x4a')](_0x31a225[_0xa4df('0x48')]['fields']));_0x1d8592[_0xa4df('0x49')]=_0x1d8592['attributes'][_0xa4df('0x4b')]?_0x1d8592[_0xa4df('0x49')]:_0x2ae67f[_0xa4df('0x43')];_0x1d8592[_0xa4df('0x4d')]=qs[_0xa4df('0x4e')](_0x31a225[_0xa4df('0x48')][_0xa4df('0x4e')]);_0x1d8592[_0xa4df('0x52')]=qs[_0xa4df('0x46')](_[_0xa4df('0x4f')](_0x31a225[_0xa4df('0x48')],_0x2ae67f['filters']));if(_0x31a225[_0xa4df('0x48')]['filter']){_0x1d8592[_0xa4df('0x52')]=_[_0xa4df('0x51')](_0x1d8592[_0xa4df('0x52')],{'$or':_[_0xa4df('0x44')](_0x1d8592['attributes'],function(_0x39b9c5){var _0x2c5a5e={};_0x2c5a5e[_0x39b9c5]={'$like':'%'+_0x31a225['query'][_0xa4df('0x50')]+'%'};return _0x2c5a5e;})});}_0x1d8592=_[_0xa4df('0x51')]({},_0x1d8592,_0x31a225[_0xa4df('0x54')]);return _0x2b63c9[_0xa4df('0x99')](_0x1d8592);}})[_0xa4df('0x37')](function(_0x4d3f62){if(_0x4d3f62){_0x1cf379=_0x4d3f62[_0xa4df('0x4b')];if(!_0x31a225['query'][_0xa4df('0x4c')](_0xa4df('0x69'))){_0x1d8592[_0xa4df('0x33')]=qs['limit'](_0x31a225[_0xa4df('0x48')][_0xa4df('0x33')]);_0x1d8592['offset']=qs[_0xa4df('0x30')](_0x31a225['query'][_0xa4df('0x30')]);}return _0x2b63c9['getAgents'](_0x1d8592);}})[_0xa4df('0x37')](function(_0x5837bc){if(_0x5837bc){return _0x5837bc?{'count':_0x1cf379,'rows':_0x5837bc}:null;}})[_0xa4df('0x37')](respondWithResult(_0xb8a4db,null))[_0xa4df('0x2b')](handleError(_0xb8a4db,null));}; \ No newline at end of file +var _0x2d0a=['nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','ChatQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','User','UserId','agent','chatPause','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','Team','addTeams','Agents','voicePause','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','then','destroy','get','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x2902b3,_0x4fc0ea){var _0x2c98d1=function(_0x2b25ae){while(--_0x2b25ae){_0x2902b3['push'](_0x2902b3['shift']());}};_0x2c98d1(++_0x4fc0ea);}(_0x2d0a,0xdc));var _0xa2d0=function(_0x27f05b,_0x49726f){_0x27f05b=_0x27f05b-0x0;var _0x314b72=_0x2d0a[_0x27f05b];return _0x314b72;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa2d0('0x0'));var jsonpatch=require(_0xa2d0('0x1'));var rp=require(_0xa2d0('0x2'));var moment=require(_0xa2d0('0x3'));var BPromise=require(_0xa2d0('0x4'));var Mustache=require('mustache');var util=require(_0xa2d0('0x5'));var path=require(_0xa2d0('0x6'));var sox=require('sox');var csv=require(_0xa2d0('0x7'));var ejs=require(_0xa2d0('0x8'));var fs=require('fs');var fs_extra=require(_0xa2d0('0x9'));var _=require(_0xa2d0('0xa'));var squel=require(_0xa2d0('0xb'));var crypto=require(_0xa2d0('0xc'));var jsforce=require(_0xa2d0('0xd'));var deskjs=require(_0xa2d0('0xe'));var toCsv=require(_0xa2d0('0x7'));var querystring=require(_0xa2d0('0xf'));var Papa=require(_0xa2d0('0x10'));var Redis=require(_0xa2d0('0x11'));var authService=require(_0xa2d0('0x12'));var qs=require(_0xa2d0('0x13'));var as=require(_0xa2d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2d0('0x15'))(_0xa2d0('0x16'));var utils=require(_0xa2d0('0x17'));var config=require(_0xa2d0('0x18'));var licenseUtil=require(_0xa2d0('0x19'));var db=require(_0xa2d0('0x1a'))['db'];config[_0xa2d0('0x1b')]=_['defaults'](config[_0xa2d0('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2d0('0x1c'))(new Redis(config['redis']));require(_0xa2d0('0x1d'))[_0xa2d0('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa2d0('0x1f')][_0xa2d0('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x30cab6,_0x56a8b0,_0x3ef4c4,_0x3e7faf){return new BPromise(function(_0x3e5a1d,_0x25fc8e){var _0xaebb82=_0x3e7faf||client;return _0xaebb82[_0xa2d0('0x21')](_0x30cab6,_0x3ef4c4)['then'](function(_0x2e235b){logger[_0xa2d0('0x22')](_0xa2d0('0x23'),_0x56a8b0,_0xa2d0('0x24'));logger[_0xa2d0('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x56a8b0,_0xa2d0('0x24'),JSON[_0xa2d0('0x26')](_0x2e235b));if(_0x2e235b['error']){if(_0x2e235b[_0xa2d0('0x27')]['code']===0x1f4){logger['error'](_0xa2d0('0x23'),_0x56a8b0,_0x2e235b['error'][_0xa2d0('0x28')]);return _0x25fc8e(_0x2e235b['error'][_0xa2d0('0x28')]);}logger[_0xa2d0('0x27')](_0xa2d0('0x23'),_0x56a8b0,_0x2e235b[_0xa2d0('0x27')][_0xa2d0('0x28')]);return _0x3e5a1d(_0x2e235b['error'][_0xa2d0('0x28')]);}else{logger[_0xa2d0('0x22')]('ChatQueue,\x20%s,\x20%s',_0x56a8b0,_0xa2d0('0x24'));_0x3e5a1d(_0x2e235b[_0xa2d0('0x29')][_0xa2d0('0x28')]);}})[_0xa2d0('0x2a')](function(_0x1dc9b2){logger[_0xa2d0('0x27')](_0xa2d0('0x23'),_0x56a8b0,_0x1dc9b2);_0x25fc8e(_0x1dc9b2);});});}function respondWithStatusCode(_0x16102d,_0x3aeb13){_0x3aeb13=_0x3aeb13||0xcc;return function(_0x143c73){if(_0x143c73){return _0x16102d[_0xa2d0('0x2b')](_0x3aeb13);}return _0x16102d[_0xa2d0('0x2c')](_0x3aeb13)[_0xa2d0('0x2d')]();};}function respondWithResult(_0x5c8a22,_0x468b4a){_0x468b4a=_0x468b4a||0xc8;return function(_0x194a3e){if(_0x194a3e){return _0x5c8a22[_0xa2d0('0x2c')](_0x468b4a)[_0xa2d0('0x2e')](_0x194a3e);}};}function respondWithFilteredResult(_0x3076fd,_0x4dbe08){return function(_0x464268){if(_0x464268){var _0x1fd8e4=typeof _0x4dbe08[_0xa2d0('0x2f')]===_0xa2d0('0x30')&&typeof _0x4dbe08['limit']===_0xa2d0('0x30');var _0x59194f=_0x464268[_0xa2d0('0x31')];var _0x568808=_0x1fd8e4?0x0:_0x4dbe08['offset'];var _0x5ae71c=_0x1fd8e4?_0x464268['count']:_0x4dbe08[_0xa2d0('0x2f')]+_0x4dbe08[_0xa2d0('0x32')];var _0x17e785;if(_0x5ae71c>=_0x59194f){_0x5ae71c=_0x59194f;_0x17e785=0xc8;}else{_0x17e785=0xce;}_0x3076fd[_0xa2d0('0x2c')](_0x17e785);return _0x3076fd[_0xa2d0('0x33')]('Content-Range',_0x568808+'-'+_0x5ae71c+'/'+_0x59194f)[_0xa2d0('0x2e')](_0x464268);}return null;};}function patchUpdates(_0x541404){return function(_0x5d2798){try{jsonpatch['apply'](_0x5d2798,_0x541404,!![]);}catch(_0x5e4b47){return BPromise[_0xa2d0('0x34')](_0x5e4b47);}return _0x5d2798['save']();};}function saveUpdates(_0x5b3716,_0x2deb6a){return function(_0x2f3ee8){if(_0x2f3ee8){return _0x2f3ee8['update'](_0x5b3716)[_0xa2d0('0x35')](function(_0x41fdba){return _0x41fdba;});}return null;};}function removeEntity(_0x38ddd6,_0x588e8e){return function(_0x3f07bd){if(_0x3f07bd){return _0x3f07bd[_0xa2d0('0x36')]()['then'](function(){var _0x3e2068=_0x3f07bd[_0xa2d0('0x37')]({'plain':!![]});var _0x8989a3='ChatQueues';return db['UserProfileResource'][_0xa2d0('0x36')]({'where':{'type':_0x8989a3,'resourceId':_0x3e2068['id']}})[_0xa2d0('0x35')](function(){return _0x3f07bd;});})['then'](function(){_0x38ddd6['status'](0xcc)[_0xa2d0('0x2d')]();});}};}function handleEntityNotFound(_0x35c85f,_0x30f0cc){return function(_0x4a62f4){if(!_0x4a62f4){_0x35c85f['sendStatus'](0x194);}return _0x4a62f4;};}function handleError(_0xe74f40,_0x1f720d){_0x1f720d=_0x1f720d||0x1f4;return function(_0x384443){logger[_0xa2d0('0x27')](_0x384443[_0xa2d0('0x38')]);if(_0x384443[_0xa2d0('0x39')]){delete _0x384443['name'];}_0xe74f40['status'](_0x1f720d)[_0xa2d0('0x3a')](_0x384443);};}exports[_0xa2d0('0x3b')]=function(_0x17cac1,_0x34730b){var _0x24245c={},_0x40110e={},_0x338c64={'count':0x0,'rows':[]};var _0x1b3855=_[_0xa2d0('0x3c')](db[_0xa2d0('0x3d')][_0xa2d0('0x3e')],function(_0x320ebf){return{'name':_0x320ebf[_0xa2d0('0x3f')],'type':_0x320ebf[_0xa2d0('0x40')]['key']};});_0x40110e['model']=_[_0xa2d0('0x3c')](_0x1b3855,_0xa2d0('0x39'));_0x40110e['query']=_[_0xa2d0('0x41')](_0x17cac1[_0xa2d0('0x42')]);_0x40110e[_0xa2d0('0x43')]=_[_0xa2d0('0x44')](_0x40110e[_0xa2d0('0x45')],_0x40110e[_0xa2d0('0x42')]);_0x24245c[_0xa2d0('0x46')]=_['intersection'](_0x40110e['model'],qs[_0xa2d0('0x47')](_0x17cac1[_0xa2d0('0x42')][_0xa2d0('0x47')]));_0x24245c[_0xa2d0('0x46')]=_0x24245c[_0xa2d0('0x46')][_0xa2d0('0x48')]?_0x24245c['attributes']:_0x40110e[_0xa2d0('0x45')];if(!_0x17cac1[_0xa2d0('0x42')][_0xa2d0('0x49')](_0xa2d0('0x4a'))){_0x24245c[_0xa2d0('0x32')]=qs[_0xa2d0('0x32')](_0x17cac1[_0xa2d0('0x42')]['limit']);_0x24245c[_0xa2d0('0x2f')]=qs[_0xa2d0('0x2f')](_0x17cac1[_0xa2d0('0x42')]['offset']);}_0x24245c[_0xa2d0('0x4b')]=qs[_0xa2d0('0x4c')](_0x17cac1['query'][_0xa2d0('0x4c')]);_0x24245c[_0xa2d0('0x4d')]=qs[_0xa2d0('0x43')](_[_0xa2d0('0x4e')](_0x17cac1[_0xa2d0('0x42')],_0x40110e[_0xa2d0('0x43')]),_0x1b3855);if(_0x17cac1[_0xa2d0('0x42')]['filter']){_0x24245c[_0xa2d0('0x4d')]=_['merge'](_0x24245c[_0xa2d0('0x4d')],{'$or':_[_0xa2d0('0x3c')](_0x1b3855,function(_0x402f45){if(_0x402f45['type']!==_0xa2d0('0x4f')){var _0x482f3b={};_0x482f3b[_0x402f45[_0xa2d0('0x39')]]={'$like':'%'+_0x17cac1[_0xa2d0('0x42')][_0xa2d0('0x50')]+'%'};return _0x482f3b;}})});}_0x24245c=_[_0xa2d0('0x51')]({},_0x24245c,_0x17cac1[_0xa2d0('0x52')]);var _0x13de79={'where':_0x24245c['where']};return db[_0xa2d0('0x3d')]['count'](_0x13de79)[_0xa2d0('0x35')](function(_0x5afa59){_0x338c64[_0xa2d0('0x31')]=_0x5afa59;if(_0x17cac1['query'][_0xa2d0('0x53')]){_0x24245c[_0xa2d0('0x54')]=[{'all':!![]}];}return db[_0xa2d0('0x3d')][_0xa2d0('0x55')](_0x24245c);})[_0xa2d0('0x35')](function(_0x245649){_0x338c64['rows']=_0x245649;return _0x338c64;})[_0xa2d0('0x35')](respondWithFilteredResult(_0x34730b,_0x24245c))[_0xa2d0('0x2a')](handleError(_0x34730b,null));};exports[_0xa2d0('0x56')]=function(_0x1a55dd,_0x581f99){var _0x276a6d={'raw':!![],'where':{'id':_0x1a55dd[_0xa2d0('0x57')]['id']}},_0x41b045={};_0x41b045[_0xa2d0('0x45')]=_[_0xa2d0('0x41')](db[_0xa2d0('0x3d')][_0xa2d0('0x3e')]);_0x41b045[_0xa2d0('0x42')]=_[_0xa2d0('0x41')](_0x1a55dd[_0xa2d0('0x42')]);_0x41b045[_0xa2d0('0x43')]=_[_0xa2d0('0x44')](_0x41b045[_0xa2d0('0x45')],_0x41b045['query']);_0x276a6d[_0xa2d0('0x46')]=_[_0xa2d0('0x44')](_0x41b045[_0xa2d0('0x45')],qs['fields'](_0x1a55dd[_0xa2d0('0x42')][_0xa2d0('0x47')]));_0x276a6d['attributes']=_0x276a6d['attributes'][_0xa2d0('0x48')]?_0x276a6d[_0xa2d0('0x46')]:_0x41b045[_0xa2d0('0x45')];if(_0x1a55dd['query'][_0xa2d0('0x53')]){_0x276a6d[_0xa2d0('0x54')]=[{'all':!![]}];}_0x276a6d=_[_0xa2d0('0x51')]({},_0x276a6d,_0x1a55dd[_0xa2d0('0x52')]);return db[_0xa2d0('0x3d')][_0xa2d0('0x58')](_0x276a6d)[_0xa2d0('0x35')](handleEntityNotFound(_0x581f99,null))[_0xa2d0('0x35')](respondWithResult(_0x581f99,null))[_0xa2d0('0x2a')](handleError(_0x581f99,null));};exports['create']=function(_0x4dc074,_0x588dbc){return db[_0xa2d0('0x3d')][_0xa2d0('0x59')](_0x4dc074[_0xa2d0('0x5a')],{})['then'](function(_0x584790){var _0x3a50c1=_0x4dc074[_0xa2d0('0x5b')][_0xa2d0('0x37')]({'plain':!![]});if(!_0x3a50c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a50c1[_0xa2d0('0x5c')]===_0xa2d0('0x5b')){var _0x4fbe56=_0x584790['get']({'plain':!![]});var _0x342b2b=_0xa2d0('0x5d');return db[_0xa2d0('0x5e')][_0xa2d0('0x58')]({'where':{'name':_0x342b2b,'userProfileId':_0x3a50c1[_0xa2d0('0x5f')]},'raw':!![]})[_0xa2d0('0x35')](function(_0x4cccae){if(_0x4cccae&&_0x4cccae['autoAssociation']===0x0){return db[_0xa2d0('0x60')]['create']({'name':_0x4fbe56[_0xa2d0('0x39')],'resourceId':_0x4fbe56['id'],'type':_0x4cccae[_0xa2d0('0x39')],'sectionId':_0x4cccae['id']},{})['then'](function(){return _0x584790;});}else{return _0x584790;}})[_0xa2d0('0x2a')](function(_0x1a5899){logger['error'](_0xa2d0('0x61'),_0x1a5899);throw _0x1a5899;});}return _0x584790;})[_0xa2d0('0x35')](respondWithResult(_0x588dbc,0xc9))[_0xa2d0('0x2a')](handleError(_0x588dbc,null));};exports[_0xa2d0('0x62')]=function(_0x4ada6c,_0x2b2098){if(_0x4ada6c[_0xa2d0('0x5a')]['id']){delete _0x4ada6c[_0xa2d0('0x5a')]['id'];}return db[_0xa2d0('0x3d')][_0xa2d0('0x58')]({'where':{'id':_0x4ada6c['params']['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x2b2098,null))['then'](saveUpdates(_0x4ada6c[_0xa2d0('0x5a')],null))[_0xa2d0('0x35')](respondWithResult(_0x2b2098,null))[_0xa2d0('0x2a')](handleError(_0x2b2098,null));};exports[_0xa2d0('0x36')]=function(_0x2e560d,_0x3cde85){return db[_0xa2d0('0x3d')][_0xa2d0('0x58')]({'where':{'id':_0x2e560d['params']['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x3cde85,null))[_0xa2d0('0x35')](removeEntity(_0x3cde85,null))[_0xa2d0('0x2a')](handleError(_0x3cde85,null));};exports[_0xa2d0('0x63')]=function(_0x19738b,_0x5f3f27){return db[_0xa2d0('0x3d')][_0xa2d0('0x63')]()[_0xa2d0('0x35')](respondWithResult(_0x5f3f27,null))['catch'](handleError(_0x5f3f27,null));};exports['getMembers']=function(_0x53d04a,_0x19df5f,_0x3e6874){var _0x176be1={'raw':!![],'where':{}},_0x10159a={},_0x35a039;return db[_0xa2d0('0x3d')][_0xa2d0('0x64')]({'where':{'id':_0x53d04a[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x19df5f,null))[_0xa2d0('0x35')](function(_0x10723d){if(_0x10723d){_0x35a039=_0x10723d[_0xa2d0('0x37')]({'plain':!![]});_0x10159a[_0xa2d0('0x45')]=_[_0xa2d0('0x41')](db[_0xa2d0('0x65')]['rawAttributes']);_0x10159a[_0xa2d0('0x42')]=_[_0xa2d0('0x41')](_0x53d04a['query']);_0x10159a[_0xa2d0('0x43')]=_[_0xa2d0('0x44')](_0x10159a['model'],_0x10159a['query']);_0x176be1[_0xa2d0('0x46')]=_[_0xa2d0('0x44')](_0x10159a[_0xa2d0('0x45')],qs[_0xa2d0('0x47')](_0x53d04a[_0xa2d0('0x42')]['fields']));_0x176be1[_0xa2d0('0x46')]=_0x176be1['attributes'][_0xa2d0('0x48')]?_0x176be1[_0xa2d0('0x46')]:_0x10159a['model'];if(!_0x53d04a[_0xa2d0('0x42')][_0xa2d0('0x49')](_0xa2d0('0x4a'))){_0x176be1[_0xa2d0('0x32')]=qs['limit'](_0x53d04a['query'][_0xa2d0('0x32')]);_0x176be1[_0xa2d0('0x2f')]=qs[_0xa2d0('0x2f')](_0x53d04a['query'][_0xa2d0('0x2f')]);}_0x176be1[_0xa2d0('0x4b')]=qs['sort'](_0x53d04a[_0xa2d0('0x42')]['sort']);_0x176be1[_0xa2d0('0x4d')]=qs[_0xa2d0('0x43')](_['pick'](_0x53d04a[_0xa2d0('0x42')],_0x10159a[_0xa2d0('0x43')]));_0x176be1[_0xa2d0('0x4d')]['ChatQueueId']=_0x10723d['id'];if(_0x53d04a[_0xa2d0('0x42')]['filter']){_0x176be1[_0xa2d0('0x4d')]=_[_0xa2d0('0x51')](_0x176be1['where'],{'$or':_[_0xa2d0('0x3c')](_0x176be1['attributes'],function(_0x2cbdfb){var _0x26a414={};_0x26a414[_0x2cbdfb]={'$like':'%'+_0x53d04a['query'][_0xa2d0('0x50')]+'%'};return _0x26a414;})});}_0x176be1=_[_0xa2d0('0x51')]({},_0x176be1,_0x53d04a[_0xa2d0('0x52')]);return db['UserChatQueue'][_0xa2d0('0x55')](_0x176be1);}})['then'](function(_0x4e1326){if(_0x4e1326){return db[_0xa2d0('0x66')]['findAndCountAll']({'where':{'id':_[_0xa2d0('0x3c')](_0x4e1326,_0xa2d0('0x67')),'role':_0xa2d0('0x68')},'attributes':['id',_0xa2d0('0x39'),_0xa2d0('0x69'),_0xa2d0('0x6a'),'createdAt']});}})['then'](function(_0xd2251){if(_0xd2251){return{'count':_0xd2251[_0xa2d0('0x31')],'rows':_['map'](_0xd2251[_0xa2d0('0x6b')],function(_0x4f4d3f){return{'membername':_0x4f4d3f[_0xa2d0('0x39')],'UserId':_0x4f4d3f['id'],'queue_name':_0x35a039['name'],'ChatQueueId':_0x35a039['id'],'interface':util['format'](_0xa2d0('0x6c'),_0xa2d0('0x6d'),_0x4f4d3f[_0xa2d0('0x39')]),'penalty':0x0,'paused':_0x4f4d3f['chatPause'],'createdAt':_0x4f4d3f[_0xa2d0('0x6e')],'updatedAt':_0x4f4d3f[_0xa2d0('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x19df5f,_0x176be1))[_0xa2d0('0x2a')](handleError(_0x19df5f,null));};exports[_0xa2d0('0x6f')]=function(_0x265c5a,_0x5439ef,_0x8ef9a){var _0x43473b={};var _0x30da42={};var _0x56fad5;var _0x3eff53;return db['ChatQueue'][_0xa2d0('0x64')]({'where':{'id':_0x265c5a[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x5439ef,null))[_0xa2d0('0x35')](function(_0x3a3021){if(_0x3a3021){_0x56fad5=_0x3a3021;_0x30da42[_0xa2d0('0x45')]=_[_0xa2d0('0x41')](db[_0xa2d0('0x70')]['rawAttributes']);_0x30da42[_0xa2d0('0x42')]=_[_0xa2d0('0x41')](_0x265c5a[_0xa2d0('0x42')]);_0x30da42[_0xa2d0('0x43')]=_['intersection'](_0x30da42[_0xa2d0('0x45')],_0x30da42[_0xa2d0('0x42')]);_0x43473b['attributes']=_[_0xa2d0('0x44')](_0x30da42[_0xa2d0('0x45')],qs[_0xa2d0('0x47')](_0x265c5a[_0xa2d0('0x42')][_0xa2d0('0x47')]));_0x43473b[_0xa2d0('0x46')]=_0x43473b[_0xa2d0('0x46')][_0xa2d0('0x48')]?_0x43473b[_0xa2d0('0x46')]:_0x30da42[_0xa2d0('0x45')];_0x43473b[_0xa2d0('0x4b')]=qs['sort'](_0x265c5a['query'][_0xa2d0('0x4c')]);_0x43473b[_0xa2d0('0x4d')]=qs['filters'](_['pick'](_0x265c5a[_0xa2d0('0x42')],_0x30da42[_0xa2d0('0x43')]));if(_0x265c5a[_0xa2d0('0x42')]['filter']){_0x43473b[_0xa2d0('0x4d')]=_[_0xa2d0('0x51')](_0x43473b[_0xa2d0('0x4d')],{'$or':_[_0xa2d0('0x3c')](_0x43473b[_0xa2d0('0x46')],function(_0x180726){var _0x3a5d06={};_0x3a5d06[_0x180726]={'$like':'%'+_0x265c5a[_0xa2d0('0x42')]['filter']+'%'};return _0x3a5d06;})});}_0x43473b=_[_0xa2d0('0x51')]({},_0x43473b,_0x265c5a[_0xa2d0('0x52')]);return _0x56fad5[_0xa2d0('0x6f')](_0x43473b);}})[_0xa2d0('0x35')](function(_0x45dc81){if(_0x45dc81){_0x3eff53=_0x45dc81['length'];if(!_0x265c5a['query'][_0xa2d0('0x49')]('nolimit')){_0x43473b[_0xa2d0('0x32')]=qs[_0xa2d0('0x32')](_0x265c5a[_0xa2d0('0x42')]['limit']);_0x43473b[_0xa2d0('0x2f')]=qs[_0xa2d0('0x2f')](_0x265c5a[_0xa2d0('0x42')][_0xa2d0('0x2f')]);}return _0x56fad5[_0xa2d0('0x6f')](_0x43473b);}})[_0xa2d0('0x35')](function(_0x366b8e){if(_0x366b8e){return _0x366b8e?{'count':_0x3eff53,'rows':_0x366b8e}:null;}})[_0xa2d0('0x35')](respondWithResult(_0x5439ef,null))[_0xa2d0('0x2a')](handleError(_0x5439ef,null));};exports[_0xa2d0('0x71')]=function(_0x55897,_0x34792d,_0x5b2995){var _0x4f7cca=_0x55897['body']['ids'];return db['Team'][_0xa2d0('0x55')]({'where':{'id':_0x4f7cca},'attributes':['id'],'include':[{'model':db[_0xa2d0('0x66')],'as':_0xa2d0('0x72'),'attributes':['id',_0xa2d0('0x39'),'online',_0xa2d0('0x73'),'interface'],'raw':!![]}]})[_0xa2d0('0x35')](function(_0xb8066b){if(_0xb8066b){var _0x2d62f7=_['flatMap'](_0xb8066b,function(_0x4c50dd){var _0x18a061=_0x4c50dd[_0xa2d0('0x37')]({'plain':!![]});return _0x18a061[_0xa2d0('0x72')];});return db[_0xa2d0('0x3d')][_0xa2d0('0x58')]({'where':{'id':_0x55897[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](function(_0x2bc32d){return db['sequelize'][_0xa2d0('0x74')](function(_0x56295d){return _0x2bc32d[_0xa2d0('0x71')](_0x4f7cca,{'transaction':_0x56295d})[_0xa2d0('0x35')](function(){return BPromise[_0xa2d0('0x75')](_0x2d62f7,function(_0x1400cf){return db[_0xa2d0('0x65')][_0xa2d0('0x76')]({'where':{'UserId':_0x1400cf['id'],'ChatQueueId':_0x55897[_0xa2d0('0x57')]['id']},'transaction':_0x56295d});});})[_0xa2d0('0x35')](function(){_0x2d62f7[_0xa2d0('0x77')](function(_0x507cc2){socket[_0xa2d0('0x78')]('userChatQueue:save',{'UserId':_0x507cc2['id'],'ChatQueueId':_0x2bc32d['id']});});});});});}})[_0xa2d0('0x35')](respondWithStatusCode(_0x34792d,null))[_0xa2d0('0x2a')](handleError(_0x34792d,null));};exports[_0xa2d0('0x79')]=function(_0x57c874,_0x319804,_0x34bc0d){return db[_0xa2d0('0x70')]['findAll']({'where':{'id':_0x57c874[_0xa2d0('0x42')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa2d0('0x72'),'attributes':['id'],'raw':!![]}]})[_0xa2d0('0x35')](handleEntityNotFound(_0x319804,null))[_0xa2d0('0x35')](function(_0x4daae5){var _0x2709c3=_[_0xa2d0('0x3c')](_0x4daae5,'id');var _0x407ba9=[];var _0x1ca939=[];var _0x2b68f9=squel[_0xa2d0('0x7a')]();_0x2b68f9[_0xa2d0('0x7b')](_0xa2d0('0x7c'))['from'](_0xa2d0('0x7d'),'tq')['join']('user_has_teams','ut',_0xa2d0('0x7e'))['where']('ChatQueueId\x20=\x20?',_0x57c874[_0xa2d0('0x57')]['id']);for(var _0x59f90e=0x0;_0x59f90e<_0x4daae5[_0xa2d0('0x48')];_0x59f90e+=0x1){let _0x51eeb2=_0x4daae5[_0x59f90e];for(var _0x4109a5=0x0;_0x4109a5<_0x51eeb2[_0xa2d0('0x72')]['length'];_0x4109a5+=0x1){let _0x2c8f46=_0x51eeb2['Agents'][_0x4109a5];var _0x22148d=_0x2b68f9[_0xa2d0('0x7f')]();_0x22148d[_0xa2d0('0x4d')](_0xa2d0('0x80'),_0x2c8f46['id']);_0x1ca939['push'](db[_0xa2d0('0x81')][_0xa2d0('0x42')](_0x22148d[_0xa2d0('0x82')](),{'type':db['sequelize']['QueryTypes'][_0xa2d0('0x83')]})['then'](function(_0x5266d7){if(_0x5266d7[_0xa2d0('0x48')]===0x1){return _0x2c8f46['id'];}else{var _0x4b200e=_['every'](_[_0xa2d0('0x3c')](_0x5266d7,_0xa2d0('0x84')),function(_0x4cf38d){return _[_0xa2d0('0x85')](_0x2709c3,_0x4cf38d);});if(_0x4b200e){return _0x2c8f46['id'];}}}));}}return BPromise[_0xa2d0('0x86')](_0x1ca939)[_0xa2d0('0x35')](function(_0x1ae58a){_0x407ba9=_(_0x407ba9)[_0xa2d0('0x87')](_0x1ae58a)[_0xa2d0('0x88')]()[_0xa2d0('0x89')]();return db['ChatQueue'][_0xa2d0('0x58')]({'where':{'id':_0x57c874[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](function(_0x3ff4a8){return db['sequelize'][_0xa2d0('0x74')](function(_0x51090b){return _0x3ff4a8[_0xa2d0('0x79')](_0x57c874[_0xa2d0('0x42')][_0xa2d0('0x8a')],{'transaction':_0x51090b})['then'](function(){if(!_[_0xa2d0('0x8b')](_0x407ba9)){return _0x3ff4a8[_0xa2d0('0x8c')](_0x407ba9,{'transaction':_0x51090b});}})[_0xa2d0('0x35')](function(){_0x407ba9[_0xa2d0('0x77')](function(_0x1c1d6f){socket[_0xa2d0('0x78')](_0xa2d0('0x8d'),{'UserId':_0x1c1d6f,'ChatQueueId':_0x3ff4a8['id']});});});});});});})[_0xa2d0('0x35')](respondWithStatusCode(_0x319804,null))[_0xa2d0('0x2a')](handleError(_0x319804,null));};exports['addAgents']=function(_0x1a17d4,_0x39e5d3,_0x46f0b5){return db[_0xa2d0('0x3d')][_0xa2d0('0x58')]({'where':{'id':_0x1a17d4[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x39e5d3,null))[_0xa2d0('0x35')](function(_0x310df1){if(_0x310df1){return _0x310df1[_0xa2d0('0x8e')](_0x1a17d4[_0xa2d0('0x5a')]['ids'],_['omit'](_0x1a17d4[_0xa2d0('0x5a')],[_0xa2d0('0x8a'),'id'])||{})[_0xa2d0('0x8f')](function(_0xc50ea9){for(var _0x1e8c22=0x0;_0x1e8c22<_0x1a17d4['body']['ids'][_0xa2d0('0x48')];_0x1e8c22+=0x1){socket['emit'](_0xa2d0('0x90'),{'UserId':Number(_0x1a17d4[_0xa2d0('0x5a')][_0xa2d0('0x8a')][_0x1e8c22]),'ChatQueueId':Number(_0x1a17d4[_0xa2d0('0x57')]['id'])});}return _0xc50ea9;});}})[_0xa2d0('0x35')](respondWithResult(_0x39e5d3,null))['catch'](handleError(_0x39e5d3,null));};exports[_0xa2d0('0x8c')]=function(_0x365c9c,_0x457a9b,_0x3db62e){return db['ChatQueue']['find']({'where':{'id':_0x365c9c[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x457a9b,null))['then'](function(_0x505389){if(_0x505389){return _0x505389[_0xa2d0('0x8c')](_0x365c9c[_0xa2d0('0x42')]['ids'])['then'](function(){if(_[_0xa2d0('0x91')](_0x365c9c['query']['ids'])){for(var _0x3c1ae3=0x0;_0x3c1ae3<_0x365c9c[_0xa2d0('0x42')]['ids'][_0xa2d0('0x48')];_0x3c1ae3+=0x1){socket[_0xa2d0('0x78')]('userChatQueue:remove',{'UserId':Number(_0x365c9c[_0xa2d0('0x42')]['ids'][_0x3c1ae3]),'ChatQueueId':Number(_0x365c9c['params']['id'])});}}else{socket['emit'](_0xa2d0('0x8d'),{'UserId':Number(_0x365c9c[_0xa2d0('0x42')][_0xa2d0('0x8a')]),'ChatQueueId':Number(_0x365c9c[_0xa2d0('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x457a9b,null))[_0xa2d0('0x2a')](handleError(_0x457a9b,null));};exports['getAgents']=function(_0x216d0d,_0x3d134a,_0x129594){var _0x586aba={};var _0x2c9cbe={};var _0x42e3ae;var _0xa0648c;return db[_0xa2d0('0x3d')][_0xa2d0('0x64')]({'where':{'id':_0x216d0d[_0xa2d0('0x57')]['id']}})[_0xa2d0('0x35')](handleEntityNotFound(_0x3d134a,null))['then'](function(_0x179562){if(_0x179562){_0x42e3ae=_0x179562;_0x2c9cbe[_0xa2d0('0x45')]=_[_0xa2d0('0x41')](db[_0xa2d0('0x66')]['rawAttributes']);_0x2c9cbe[_0xa2d0('0x42')]=_[_0xa2d0('0x41')](_0x216d0d['query']);_0x2c9cbe[_0xa2d0('0x43')]=_[_0xa2d0('0x44')](_0x2c9cbe[_0xa2d0('0x45')],_0x2c9cbe[_0xa2d0('0x42')]);_0x586aba[_0xa2d0('0x46')]=_[_0xa2d0('0x44')](_0x2c9cbe[_0xa2d0('0x45')],qs['fields'](_0x216d0d['query'][_0xa2d0('0x47')]));_0x586aba['attributes']=_0x586aba[_0xa2d0('0x46')][_0xa2d0('0x48')]?_0x586aba[_0xa2d0('0x46')]:_0x2c9cbe['model'];_0x586aba[_0xa2d0('0x4b')]=qs[_0xa2d0('0x4c')](_0x216d0d['query'][_0xa2d0('0x4c')]);_0x586aba['where']=qs[_0xa2d0('0x43')](_[_0xa2d0('0x4e')](_0x216d0d[_0xa2d0('0x42')],_0x2c9cbe[_0xa2d0('0x43')]));if(_0x216d0d[_0xa2d0('0x42')]['filter']){_0x586aba['where']=_[_0xa2d0('0x51')](_0x586aba['where'],{'$or':_['map'](_0x586aba[_0xa2d0('0x46')],function(_0x32547e){var _0x3135c5={};_0x3135c5[_0x32547e]={'$like':'%'+_0x216d0d[_0xa2d0('0x42')]['filter']+'%'};return _0x3135c5;})});}_0x586aba=_[_0xa2d0('0x51')]({},_0x586aba,_0x216d0d[_0xa2d0('0x52')]);return _0x42e3ae[_0xa2d0('0x92')](_0x586aba);}})[_0xa2d0('0x35')](function(_0xdc9836){if(_0xdc9836){_0xa0648c=_0xdc9836[_0xa2d0('0x48')];if(!_0x216d0d[_0xa2d0('0x42')]['hasOwnProperty'](_0xa2d0('0x4a'))){_0x586aba[_0xa2d0('0x32')]=qs['limit'](_0x216d0d[_0xa2d0('0x42')]['limit']);_0x586aba[_0xa2d0('0x2f')]=qs['offset'](_0x216d0d[_0xa2d0('0x42')][_0xa2d0('0x2f')]);}return _0x42e3ae[_0xa2d0('0x92')](_0x586aba);}})['then'](function(_0x2458a6){if(_0x2458a6){return _0x2458a6?{'count':_0xa0648c,'rows':_0x2458a6}:null;}})[_0xa2d0('0x35')](respondWithResult(_0x3d134a,null))[_0xa2d0('0x2a')](handleError(_0x3d134a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 2082816..0fb59e6 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 _0xfc13=['setMaxListeners','save','emit','ChatQueue'];(function(_0x35167f,_0x3c9b67){var _0x302aec=function(_0x4ac2e4){while(--_0x4ac2e4){_0x35167f['push'](_0x35167f['shift']());}};_0x302aec(++_0x3c9b67);}(_0xfc13,0x13f));var _0x3fc1=function(_0x393f0a,_0x3367ab){_0x393f0a=_0x393f0a-0x0;var _0x5b8da8=_0xfc13[_0x393f0a];return _0x5b8da8;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x3fc1('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3fc1('0x1')](0x0);var events={'afterCreate':_0x3fc1('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2fe0bc){return function(_0x3e9680,_0x4ad5af,_0x37c446){ChatQueueEvents[_0x3fc1('0x3')](_0x2fe0bc+':'+_0x3e9680['id'],_0x3e9680);ChatQueueEvents[_0x3fc1('0x3')](_0x2fe0bc,_0x3e9680);_0x37c446(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xc684=['save','update','remove','emit','hasOwnProperty','exports','events','ChatQueue'];(function(_0x3baaaf,_0x1fd62c){var _0x2b7c9c=function(_0x4a2fec){while(--_0x4a2fec){_0x3baaaf['push'](_0x3baaaf['shift']());}};_0x2b7c9c(++_0x1fd62c);}(_0xc684,0x106));var _0x4c68=function(_0x4ae5bb,_0x485f23){_0x4ae5bb=_0x4ae5bb-0x0;var _0x20df53=_0xc684[_0x4ae5bb];return _0x20df53;};'use strict';var EventEmitter=require(_0x4c68('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4c68('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c68('0x2'),'afterUpdate':_0x4c68('0x3'),'afterDestroy':_0x4c68('0x4')};function emitEvent(_0x1b6466){return function(_0x3d78d1,_0x481fd7,_0x17e300){ChatQueueEvents[_0x4c68('0x5')](_0x1b6466+':'+_0x3d78d1['id'],_0x3d78d1);ChatQueueEvents[_0x4c68('0x5')](_0x1b6466,_0x3d78d1);_0x17e300(null);};}for(var e in events){if(events[_0x4c68('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4c68('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 32e0bcf..9a5f894 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 _0x01bf=['request-promise','path','rimraf','../../config/environment','exports','ChatQueue','chat_queues','lodash','api','moment','bluebird'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x01bf,0x96));var _0xf01b=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0x01bf[_0x257a28];return _0x13bccc;};'use strict';var _=require(_0xf01b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf01b('0x1'));var moment=require(_0xf01b('0x2'));var BPromise=require(_0xf01b('0x3'));var rp=require(_0xf01b('0x4'));var fs=require('fs');var path=require(_0xf01b('0x5'));var rimraf=require(_0xf01b('0x6'));var config=require(_0xf01b('0x7'));var attributes=require('./chatQueue.attributes');module[_0xf01b('0x8')]=function(_0x3e86c2,_0x53f1d7){return _0x3e86c2['define'](_0xf01b('0x9'),attributes,{'tableName':_0xf01b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4053=['exports','ChatQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x4053,0x16d));var _0x3405=function(_0x39eaf1,_0x56f6b9){_0x39eaf1=_0x39eaf1-0x0;var _0x116705=_0x4053[_0x39eaf1];return _0x116705;};'use strict';var _=require(_0x3405('0x0'));var util=require(_0x3405('0x1'));var logger=require(_0x3405('0x2'))('api');var moment=require(_0x3405('0x3'));var BPromise=require(_0x3405('0x4'));var rp=require(_0x3405('0x5'));var fs=require('fs');var path=require(_0x3405('0x6'));var rimraf=require(_0x3405('0x7'));var config=require('../../config/environment');var attributes=require(_0x3405('0x8'));module[_0x3405('0x9')]=function(_0x54a985,_0x4b35ac){return _0x54a985['define'](_0x3405('0xa'),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 1d02c71..110acca 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 _0x40a3=['options','where','limit','include','map','model','attributes','GetChatQueue','ShowChatQueue','find','then','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','raw'];(function(_0x16539a,_0x58a8da){var _0x30d009=function(_0x12752d){while(--_0x12752d){_0x16539a['push'](_0x16539a['shift']());}};_0x30d009(++_0x58a8da);}(_0x40a3,0x153));var _0x340a=function(_0x311f8e,_0x2e48a7){_0x311f8e=_0x311f8e-0x0;var _0x1411a2=_0x40a3[_0x311f8e];return _0x1411a2;};'use strict';var _=require(_0x340a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x340a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x340a('0x2'))['db'];var utils=require(_0x340a('0x3'));var logger=require(_0x340a('0x4'))(_0x340a('0x5'));var config=require(_0x340a('0x6'));var jayson=require(_0x340a('0x7'));var client=jayson[_0x340a('0x8')]['http']({'port':0x232a});config[_0x340a('0x9')]=_[_0x340a('0xa')](config['redis'],{'host':_0x340a('0xb'),'port':0x18eb});var socket=require(_0x340a('0xc'))(new Redis(config[_0x340a('0x9')]));require(_0x340a('0xd'))[_0x340a('0xe')](socket);function respondWithRpcPromise(_0x4895a3,_0x36ea9b,_0x135421){return new BPromise(function(_0x7eb940,_0x5a92bb){return client[_0x340a('0xf')](_0x4895a3,_0x135421)['then'](function(_0x2e0b3d){logger[_0x340a('0x10')]('ChatQueue,\x20%s,\x20%s',_0x36ea9b,_0x340a('0x11'));logger[_0x340a('0x12')](_0x340a('0x13'),_0x36ea9b,_0x340a('0x11'),JSON[_0x340a('0x14')](_0x2e0b3d));if(_0x2e0b3d[_0x340a('0x15')]){if(_0x2e0b3d[_0x340a('0x15')][_0x340a('0x16')]===0x1f4){logger[_0x340a('0x15')](_0x340a('0x17'),_0x36ea9b,_0x2e0b3d[_0x340a('0x15')][_0x340a('0x18')]);return _0x5a92bb(_0x2e0b3d[_0x340a('0x15')][_0x340a('0x18')]);}logger[_0x340a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x36ea9b,_0x2e0b3d[_0x340a('0x15')]['message']);return _0x7eb940(_0x2e0b3d['error'][_0x340a('0x18')]);}else{logger[_0x340a('0x10')](_0x340a('0x17'),_0x36ea9b,_0x340a('0x11'));_0x7eb940(_0x2e0b3d[_0x340a('0x19')][_0x340a('0x18')]);}})[_0x340a('0x1a')](function(_0x16c923){logger[_0x340a('0x15')](_0x340a('0x17'),_0x36ea9b,_0x16c923);_0x5a92bb(_0x16c923);});});}exports['GetChatQueue']=function(_0x15489e){var _0x53bdf7=this;return new Promise(function(_0x393551,_0x30f383){return db[_0x340a('0x1b')][_0x340a('0x1c')]({'raw':_0x15489e['options']?_0x15489e['options'][_0x340a('0x1d')]===undefined?!![]:![]:!![],'where':_0x15489e[_0x340a('0x1e')]?_0x15489e['options'][_0x340a('0x1f')]||null:null,'attributes':_0x15489e[_0x340a('0x1e')]?_0x15489e[_0x340a('0x1e')]['attributes']||null:null,'limit':_0x15489e['options']?_0x15489e[_0x340a('0x1e')][_0x340a('0x20')]||null:null,'include':_0x15489e['options']?_0x15489e[_0x340a('0x1e')][_0x340a('0x21')]?_[_0x340a('0x22')](_0x15489e[_0x340a('0x1e')][_0x340a('0x21')],function(_0x2d0be0){return{'model':db[_0x2d0be0[_0x340a('0x23')]],'as':_0x2d0be0['as'],'attributes':_0x2d0be0[_0x340a('0x24')],'include':_0x2d0be0[_0x340a('0x21')]?_['map'](_0x2d0be0[_0x340a('0x21')],function(_0x4c59ff){return{'model':db[_0x4c59ff[_0x340a('0x23')]],'as':_0x4c59ff['as'],'attributes':_0x4c59ff[_0x340a('0x24')],'include':_0x4c59ff['include']?_['map'](_0x4c59ff['include'],function(_0x151a15){return{'model':db[_0x151a15[_0x340a('0x23')]],'as':_0x151a15['as'],'attributes':_0x151a15[_0x340a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c4c0){logger[_0x340a('0x10')]('GetChatQueue',_0x15489e);logger[_0x340a('0x12')](_0x340a('0x25'),_0x15489e,JSON[_0x340a('0x14')](_0x29c4c0));_0x393551(_0x29c4c0);})[_0x340a('0x1a')](function(_0x3ad80f){logger[_0x340a('0x15')]('GetChatQueue',_0x3ad80f[_0x340a('0x18')],_0x15489e);_0x30f383(_0x53bdf7[_0x340a('0x15')](0x1f4,_0x3ad80f[_0x340a('0x18')]));});});};exports[_0x340a('0x26')]=function(_0x4248c3){var _0x3bb7b5=this;return new Promise(function(_0x35d569,_0x140189){return db[_0x340a('0x1b')][_0x340a('0x27')]({'raw':_0x4248c3['options']?_0x4248c3[_0x340a('0x1e')][_0x340a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4248c3[_0x340a('0x1e')]?_0x4248c3[_0x340a('0x1e')]['where']||null:null,'attributes':_0x4248c3[_0x340a('0x1e')]?_0x4248c3['options'][_0x340a('0x24')]||null:null,'include':_0x4248c3['options']?_0x4248c3[_0x340a('0x1e')]['include']?_['map'](_0x4248c3[_0x340a('0x1e')]['include'],function(_0x25a550){return{'model':db[_0x25a550[_0x340a('0x23')]],'as':_0x25a550['as'],'attributes':_0x25a550[_0x340a('0x24')],'include':_0x25a550[_0x340a('0x21')]?_['map'](_0x25a550['include'],function(_0x51ebb7){return{'model':db[_0x51ebb7[_0x340a('0x23')]],'as':_0x51ebb7['as'],'attributes':_0x51ebb7[_0x340a('0x24')],'include':_0x51ebb7['include']?_['map'](_0x51ebb7[_0x340a('0x21')],function(_0x45d63f){return{'model':db[_0x45d63f['model']],'as':_0x45d63f['as'],'attributes':_0x45d63f[_0x340a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x340a('0x28')](function(_0x10daa3){logger[_0x340a('0x10')](_0x340a('0x26'),_0x4248c3);logger[_0x340a('0x12')](_0x340a('0x26'),_0x4248c3,JSON[_0x340a('0x14')](_0x10daa3));_0x35d569(_0x10daa3);})[_0x340a('0x1a')](function(_0x8f0903){logger[_0x340a('0x15')](_0x340a('0x26'),_0x8f0903[_0x340a('0x18')],_0x4248c3);_0x140189(_0x3bb7b5['error'](0x1f4,_0x8f0903[_0x340a('0x18')]));});});}; \ No newline at end of file +var _0x7dab=['ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowChatQueue','find','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','register','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x7dab,0xe5));var _0xb7da=function(_0x33bb07,_0x5b1849){_0x33bb07=_0x33bb07-0x0;var _0x481c81=_0x7dab[_0x33bb07];return _0x481c81;};'use strict';var _=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var moment=require(_0xb7da('0x2'));var BPromise=require(_0xb7da('0x3'));var rs=require(_0xb7da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7da('0x5'))['db'];var utils=require(_0xb7da('0x6'));var logger=require(_0xb7da('0x7'))(_0xb7da('0x8'));var config=require(_0xb7da('0x9'));var jayson=require(_0xb7da('0xa'));var client=jayson[_0xb7da('0xb')][_0xb7da('0xc')]({'port':0x232a});config['redis']=_[_0xb7da('0xd')](config[_0xb7da('0xe')],{'host':_0xb7da('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb7da('0x10'))[_0xb7da('0x11')](socket);function respondWithRpcPromise(_0x23abc7,_0x19d89e,_0x29285a){return new BPromise(function(_0x2cde27,_0x400009){return client[_0xb7da('0x12')](_0x23abc7,_0x29285a)['then'](function(_0x20f85d){logger[_0xb7da('0x13')]('ChatQueue,\x20%s,\x20%s',_0x19d89e,_0xb7da('0x14'));logger['debug'](_0xb7da('0x15'),_0x19d89e,_0xb7da('0x14'),JSON[_0xb7da('0x16')](_0x20f85d));if(_0x20f85d[_0xb7da('0x17')]){if(_0x20f85d['error']['code']===0x1f4){logger[_0xb7da('0x17')](_0xb7da('0x18'),_0x19d89e,_0x20f85d[_0xb7da('0x17')]['message']);return _0x400009(_0x20f85d[_0xb7da('0x17')][_0xb7da('0x19')]);}logger[_0xb7da('0x17')](_0xb7da('0x18'),_0x19d89e,_0x20f85d['error'][_0xb7da('0x19')]);return _0x2cde27(_0x20f85d[_0xb7da('0x17')][_0xb7da('0x19')]);}else{logger['info'](_0xb7da('0x18'),_0x19d89e,_0xb7da('0x14'));_0x2cde27(_0x20f85d[_0xb7da('0x1a')]['message']);}})[_0xb7da('0x1b')](function(_0x482f50){logger[_0xb7da('0x17')](_0xb7da('0x18'),_0x19d89e,_0x482f50);_0x400009(_0x482f50);});});}exports[_0xb7da('0x1c')]=function(_0x5c523){var _0x4d7e3b=this;return new Promise(function(_0x5c26ea,_0x292923){return db[_0xb7da('0x1d')][_0xb7da('0x1e')]({'raw':_0x5c523[_0xb7da('0x1f')]?_0x5c523[_0xb7da('0x1f')][_0xb7da('0x20')]===undefined?!![]:![]:!![],'where':_0x5c523[_0xb7da('0x1f')]?_0x5c523[_0xb7da('0x1f')][_0xb7da('0x21')]||null:null,'attributes':_0x5c523[_0xb7da('0x1f')]?_0x5c523[_0xb7da('0x1f')][_0xb7da('0x22')]||null:null,'limit':_0x5c523[_0xb7da('0x1f')]?_0x5c523['options'][_0xb7da('0x23')]||null:null,'include':_0x5c523[_0xb7da('0x1f')]?_0x5c523[_0xb7da('0x1f')]['include']?_[_0xb7da('0x24')](_0x5c523['options'][_0xb7da('0x25')],function(_0x21428c){return{'model':db[_0x21428c[_0xb7da('0x26')]],'as':_0x21428c['as'],'attributes':_0x21428c[_0xb7da('0x22')],'include':_0x21428c[_0xb7da('0x25')]?_['map'](_0x21428c[_0xb7da('0x25')],function(_0x1e564d){return{'model':db[_0x1e564d[_0xb7da('0x26')]],'as':_0x1e564d['as'],'attributes':_0x1e564d[_0xb7da('0x22')],'include':_0x1e564d['include']?_[_0xb7da('0x24')](_0x1e564d[_0xb7da('0x25')],function(_0x1829dc){return{'model':db[_0x1829dc['model']],'as':_0x1829dc['as'],'attributes':_0x1829dc[_0xb7da('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36f907){logger[_0xb7da('0x13')]('GetChatQueue',_0x5c523);logger['debug'](_0xb7da('0x1c'),_0x5c523,JSON[_0xb7da('0x16')](_0x36f907));_0x5c26ea(_0x36f907);})[_0xb7da('0x1b')](function(_0x37634f){logger[_0xb7da('0x17')](_0xb7da('0x1c'),_0x37634f[_0xb7da('0x19')],_0x5c523);_0x292923(_0x4d7e3b[_0xb7da('0x17')](0x1f4,_0x37634f[_0xb7da('0x19')]));});});};exports[_0xb7da('0x27')]=function(_0x39fa7){var _0x3d12f4=this;return new Promise(function(_0x343cca,_0x5246f1){return db[_0xb7da('0x1d')][_0xb7da('0x28')]({'raw':_0x39fa7[_0xb7da('0x1f')]?_0x39fa7[_0xb7da('0x1f')][_0xb7da('0x20')]===undefined?!![]:![]:!![],'where':_0x39fa7[_0xb7da('0x1f')]?_0x39fa7[_0xb7da('0x1f')]['where']||null:null,'attributes':_0x39fa7['options']?_0x39fa7[_0xb7da('0x1f')][_0xb7da('0x22')]||null:null,'include':_0x39fa7['options']?_0x39fa7[_0xb7da('0x1f')][_0xb7da('0x25')]?_[_0xb7da('0x24')](_0x39fa7['options'][_0xb7da('0x25')],function(_0x2f6f9f){return{'model':db[_0x2f6f9f[_0xb7da('0x26')]],'as':_0x2f6f9f['as'],'attributes':_0x2f6f9f[_0xb7da('0x22')],'include':_0x2f6f9f[_0xb7da('0x25')]?_['map'](_0x2f6f9f[_0xb7da('0x25')],function(_0x15b3aa){return{'model':db[_0x15b3aa['model']],'as':_0x15b3aa['as'],'attributes':_0x15b3aa[_0xb7da('0x22')],'include':_0x15b3aa[_0xb7da('0x25')]?_['map'](_0x15b3aa['include'],function(_0x59d584){return{'model':db[_0x59d584[_0xb7da('0x26')]],'as':_0x59d584['as'],'attributes':_0x59d584[_0xb7da('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb7da('0x29')](function(_0x2cf2b6){logger[_0xb7da('0x13')](_0xb7da('0x27'),_0x39fa7);logger[_0xb7da('0x2a')]('ShowChatQueue',_0x39fa7,JSON['stringify'](_0x2cf2b6));_0x343cca(_0x2cf2b6);})[_0xb7da('0x1b')](function(_0x51be0c){logger[_0xb7da('0x17')]('ShowChatQueue',_0x51be0c[_0xb7da('0x19')],_0x39fa7);_0x5246f1(_0x3d12f4[_0xb7da('0x17')](0x1f4,_0x51be0c[_0xb7da('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 271abf1..c9cd413 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 _0xbd50=['length','./chatQueue.events','save','remove','emit'];(function(_0x49d91c,_0x13aade){var _0x4b2880=function(_0x2e47cc){while(--_0x2e47cc){_0x49d91c['push'](_0x49d91c['shift']());}};_0x4b2880(++_0x13aade);}(_0xbd50,0x196));var _0x0bd5=function(_0x152ef0,_0x389f5a){_0x152ef0=_0x152ef0-0x0;var _0xbeeb55=_0xbd50[_0x152ef0];return _0xbeeb55;};'use strict';var ChatQueueEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatQueueEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatQueue:'+_0x1b99f3,_0x376024);ChatQueueEvents['on'](_0x1b99f3,_0x5ebe64);}}; \ No newline at end of file +var _0x57d4=['length','./chatQueue.events','save','update','emit','removeListener','register'];(function(_0x308512,_0x2f75fe){var _0x5c8fbc=function(_0x1efde2){while(--_0x1efde2){_0x308512['push'](_0x308512['shift']());}};_0x5c8fbc(++_0x2f75fe);}(_0x57d4,0x78));var _0x457d=function(_0x4a442a,_0x3a680d){_0x4a442a=_0x4a442a-0x0;var _0xa5a44d=_0x57d4[_0x4a442a];return _0xa5a44d;};'use strict';var ChatQueueEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){ChatQueueEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('chatQueue:'+_0x381e22,_0x247ec7);ChatQueueEvents['on'](_0x381e22,_0x4e32c0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 181a7f2..15b01ab 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2630f5,_0x4c0f1c){var _0x364044=function(_0x45c72c){while(--_0x45c72c){_0x2630f5['push'](_0x2630f5['shift']());}};_0x364044(++_0x4c0f1c);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x1e1f45,_0x24bda0){var _0x4df2b7=function(_0x121e79){while(--_0x121e79){_0x1e1f45['push'](_0x1e1f45['shift']());}};_0x4df2b7(++_0x24bda0);}(_0xe14b,0x93));var _0xbe14=function(_0x4fa101,_0x4f43f5){_0x4fa101=_0x4fa101-0x0;var _0x2b64b3=_0xe14b[_0x4fa101];return _0x2b64b3;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 26e430d..35c89f5 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 _0x54da=['STRING','moment','exports','DATE'];(function(_0x2bc2a2,_0x51e95f){var _0x20de67=function(_0x27f2d2){while(--_0x27f2d2){_0x2bc2a2['push'](_0x2bc2a2['shift']());}};_0x20de67(++_0x51e95f);}(_0x54da,0x9d));var _0xa54d=function(_0xc721f5,_0x42404b){_0xc721f5=_0xc721f5-0x0;var _0x1bc1bd=_0x54da[_0xc721f5];return _0x1bc1bd;};'use strict';var moment=require(_0xa54d('0x0'));var Sequelize=require('sequelize');module[_0xa54d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa54d('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa54d('0x2')]},'exitAt':{'type':Sequelize[_0xa54d('0x2')]},'reason':{'type':Sequelize[_0xa54d('0x3')]}}; \ No newline at end of file +var _0x655a=['DATE','moment','exports','STRING'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0x655a,0xed));var _0xa655=function(_0x17b242,_0xf4aa9){_0x17b242=_0x17b242-0x0;var _0x2cecce=_0x655a[_0x17b242];return _0x2cecce;};'use strict';var moment=require(_0xa655('0x0'));var Sequelize=require('sequelize');module[_0xa655('0x1')]={'uniqueid':{'type':Sequelize[_0xa655('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa655('0x2')]},'joinAt':{'type':Sequelize[_0xa655('0x3')]},'leaveAt':{'type':Sequelize[_0xa655('0x3')]},'acceptAt':{'type':Sequelize[_0xa655('0x3')]},'exitAt':{'type':Sequelize[_0xa655('0x3')]},'reason':{'type':Sequelize[_0xa655('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8b13e8d..5cdde04 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 _0x7ebb=['index','ChatQueueReport','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x2d1e4c,_0x3b49fe){var _0x4c4c1b=function(_0x2c087){while(--_0x2c087){_0x2d1e4c['push'](_0x2d1e4c['shift']());}};_0x4c4c1b(++_0x3b49fe);}(_0x7ebb,0x161));var _0xb7eb=function(_0x15009e,_0x5af79b){_0x15009e=_0x15009e-0x0;var _0x1dde11=_0x7ebb[_0x15009e];return _0x1dde11;};'use strict';var emlformat=require(_0xb7eb('0x0'));var rimraf=require(_0xb7eb('0x1'));var zipdir=require(_0xb7eb('0x2'));var jsonpatch=require(_0xb7eb('0x3'));var rp=require(_0xb7eb('0x4'));var moment=require(_0xb7eb('0x5'));var BPromise=require(_0xb7eb('0x6'));var Mustache=require('mustache');var util=require(_0xb7eb('0x7'));var path=require(_0xb7eb('0x8'));var sox=require(_0xb7eb('0x9'));var csv=require(_0xb7eb('0xa'));var ejs=require(_0xb7eb('0xb'));var fs=require('fs');var fs_extra=require(_0xb7eb('0xc'));var _=require(_0xb7eb('0xd'));var squel=require(_0xb7eb('0xe'));var crypto=require(_0xb7eb('0xf'));var jsforce=require(_0xb7eb('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7eb('0x11'));var Papa=require(_0xb7eb('0x12'));var Redis=require(_0xb7eb('0x13'));var authService=require(_0xb7eb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb7eb('0x15'));var hardwareService=require(_0xb7eb('0x16'));var logger=require('../../config/logger')(_0xb7eb('0x17'));var utils=require(_0xb7eb('0x18'));var config=require(_0xb7eb('0x19'));var licenseUtil=require(_0xb7eb('0x1a'));var db=require(_0xb7eb('0x1b'))['db'];function respondWithStatusCode(_0x24e51b,_0x3cf3ca){_0x3cf3ca=_0x3cf3ca||0xcc;return function(_0x5932b9){if(_0x5932b9){return _0x24e51b[_0xb7eb('0x1c')](_0x3cf3ca);}return _0x24e51b[_0xb7eb('0x1d')](_0x3cf3ca)[_0xb7eb('0x1e')]();};}function respondWithResult(_0x5e50f0,_0x3b2af5){_0x3b2af5=_0x3b2af5||0xc8;return function(_0xbd0a5a){if(_0xbd0a5a){return _0x5e50f0[_0xb7eb('0x1d')](_0x3b2af5)[_0xb7eb('0x1f')](_0xbd0a5a);}};}function respondWithFilteredResult(_0x560f8f,_0x348cc5){return function(_0x55c850){if(_0x55c850){var _0x4977b5=typeof _0x348cc5[_0xb7eb('0x20')]===_0xb7eb('0x21')&&typeof _0x348cc5['limit']===_0xb7eb('0x21');var _0x2186ae=_0x55c850[_0xb7eb('0x22')];var _0x1c0294=_0x4977b5?0x0:_0x348cc5['offset'];var _0x36fc4d=_0x4977b5?_0x55c850['count']:_0x348cc5[_0xb7eb('0x20')]+_0x348cc5[_0xb7eb('0x23')];var _0x4b74f3;if(_0x36fc4d>=_0x2186ae){_0x36fc4d=_0x2186ae;_0x4b74f3=0xc8;}else{_0x4b74f3=0xce;}_0x560f8f[_0xb7eb('0x1d')](_0x4b74f3);return _0x560f8f['set'](_0xb7eb('0x24'),_0x1c0294+'-'+_0x36fc4d+'/'+_0x2186ae)[_0xb7eb('0x1f')](_0x55c850);}return null;};}function patchUpdates(_0x1b6036){return function(_0x24657e){try{jsonpatch[_0xb7eb('0x25')](_0x24657e,_0x1b6036,!![]);}catch(_0x36beb6){return BPromise[_0xb7eb('0x26')](_0x36beb6);}return _0x24657e[_0xb7eb('0x27')]();};}function saveUpdates(_0x874ba5,_0x4c5cc8){return function(_0x53071f){if(_0x53071f){return _0x53071f[_0xb7eb('0x28')](_0x874ba5)[_0xb7eb('0x29')](function(_0x3ad448){return _0x3ad448;});}return null;};}function removeEntity(_0x29e197,_0x68c3d0){return function(_0x5bdadf){if(_0x5bdadf){return _0x5bdadf[_0xb7eb('0x2a')]()[_0xb7eb('0x29')](function(){_0x29e197[_0xb7eb('0x1d')](0xcc)[_0xb7eb('0x1e')]();});}};}function handleEntityNotFound(_0x48e4d7,_0x202b4d){return function(_0x48dabb){if(!_0x48dabb){_0x48e4d7[_0xb7eb('0x1c')](0x194);}return _0x48dabb;};}function handleError(_0x1b7617,_0xbba0bb){_0xbba0bb=_0xbba0bb||0x1f4;return function(_0x56a5d7){logger[_0xb7eb('0x2b')](_0x56a5d7[_0xb7eb('0x2c')]);if(_0x56a5d7[_0xb7eb('0x2d')]){delete _0x56a5d7[_0xb7eb('0x2d')];}_0x1b7617[_0xb7eb('0x1d')](_0xbba0bb)[_0xb7eb('0x2e')](_0x56a5d7);};}exports[_0xb7eb('0x2f')]=function(_0x23aee6,_0x841096){var _0x156e2b={},_0xc68143={},_0x3d75ed={'count':0x0,'rows':[]};var _0x2d19bf=_['map'](db[_0xb7eb('0x30')]['rawAttributes'],function(_0x20f0c0){return{'name':_0x20f0c0['fieldName'],'type':_0x20f0c0[_0xb7eb('0x31')][_0xb7eb('0x32')]};});_0xc68143['model']=_[_0xb7eb('0x33')](_0x2d19bf,_0xb7eb('0x2d'));_0xc68143[_0xb7eb('0x34')]=_['keys'](_0x23aee6[_0xb7eb('0x34')]);_0xc68143[_0xb7eb('0x35')]=_[_0xb7eb('0x36')](_0xc68143[_0xb7eb('0x37')],_0xc68143[_0xb7eb('0x34')]);_0x156e2b[_0xb7eb('0x38')]=_['intersection'](_0xc68143[_0xb7eb('0x37')],qs[_0xb7eb('0x39')](_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x39')]));_0x156e2b['attributes']=_0x156e2b[_0xb7eb('0x38')][_0xb7eb('0x3a')]?_0x156e2b['attributes']:_0xc68143[_0xb7eb('0x37')];if(!_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x3b')]('nolimit')){_0x156e2b[_0xb7eb('0x23')]=qs['limit'](_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x23')]);_0x156e2b[_0xb7eb('0x20')]=qs[_0xb7eb('0x20')](_0x23aee6['query']['offset']);}_0x156e2b[_0xb7eb('0x3c')]=qs[_0xb7eb('0x3d')](_0x23aee6['query'][_0xb7eb('0x3d')]);_0x156e2b[_0xb7eb('0x3e')]=qs[_0xb7eb('0x35')](_[_0xb7eb('0x3f')](_0x23aee6[_0xb7eb('0x34')],_0xc68143[_0xb7eb('0x35')]),_0x2d19bf);if(_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x40')]){_0x156e2b['where']=_[_0xb7eb('0x41')](_0x156e2b['where'],{'$or':_[_0xb7eb('0x33')](_0x2d19bf,function(_0x33e229){if(_0x33e229[_0xb7eb('0x31')]!==_0xb7eb('0x42')){var _0x5a8ecf={};_0x5a8ecf[_0x33e229[_0xb7eb('0x2d')]]={'$like':'%'+_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x40')]+'%'};return _0x5a8ecf;}})});}_0x156e2b=_[_0xb7eb('0x41')]({},_0x156e2b,_0x23aee6[_0xb7eb('0x43')]);var _0x4add76={'where':_0x156e2b[_0xb7eb('0x3e')]};return db['ChatQueueReport'][_0xb7eb('0x22')](_0x4add76)[_0xb7eb('0x29')](function(_0x57e3e6){_0x3d75ed[_0xb7eb('0x22')]=_0x57e3e6;if(_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x44')]){_0x156e2b[_0xb7eb('0x45')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x156e2b);})['then'](function(_0x3ee221){_0x3d75ed[_0xb7eb('0x46')]=_0x3ee221;return _0x3d75ed;})[_0xb7eb('0x29')](respondWithFilteredResult(_0x841096,_0x156e2b))[_0xb7eb('0x47')](handleError(_0x841096,null));};exports[_0xb7eb('0x48')]=function(_0x5147e8,_0x4d65e5){var _0x381fc3={'raw':!![],'where':{'id':_0x5147e8[_0xb7eb('0x49')]['id']}},_0x5c3a07={};_0x5c3a07[_0xb7eb('0x37')]=_[_0xb7eb('0x4a')](db['ChatQueueReport'][_0xb7eb('0x4b')]);_0x5c3a07[_0xb7eb('0x34')]=_[_0xb7eb('0x4a')](_0x5147e8['query']);_0x5c3a07[_0xb7eb('0x35')]=_[_0xb7eb('0x36')](_0x5c3a07[_0xb7eb('0x37')],_0x5c3a07[_0xb7eb('0x34')]);_0x381fc3[_0xb7eb('0x38')]=_[_0xb7eb('0x36')](_0x5c3a07[_0xb7eb('0x37')],qs[_0xb7eb('0x39')](_0x5147e8[_0xb7eb('0x34')][_0xb7eb('0x39')]));_0x381fc3[_0xb7eb('0x38')]=_0x381fc3[_0xb7eb('0x38')][_0xb7eb('0x3a')]?_0x381fc3[_0xb7eb('0x38')]:_0x5c3a07[_0xb7eb('0x37')];if(_0x5147e8[_0xb7eb('0x34')][_0xb7eb('0x44')]){_0x381fc3[_0xb7eb('0x45')]=[{'all':!![]}];}_0x381fc3=_[_0xb7eb('0x41')]({},_0x381fc3,_0x5147e8['options']);return db[_0xb7eb('0x30')][_0xb7eb('0x4c')](_0x381fc3)[_0xb7eb('0x29')](handleEntityNotFound(_0x4d65e5,null))[_0xb7eb('0x29')](respondWithResult(_0x4d65e5,null))[_0xb7eb('0x47')](handleError(_0x4d65e5,null));};exports['create']=function(_0x9d509b,_0xa3c387){return db['ChatQueueReport'][_0xb7eb('0x4d')](_0x9d509b[_0xb7eb('0x4e')],{})['then'](respondWithResult(_0xa3c387,0xc9))['catch'](handleError(_0xa3c387,null));};exports[_0xb7eb('0x28')]=function(_0x13741b,_0x2f20d3){if(_0x13741b[_0xb7eb('0x4e')]['id']){delete _0x13741b[_0xb7eb('0x4e')]['id'];}return db[_0xb7eb('0x30')][_0xb7eb('0x4c')]({'where':{'id':_0x13741b['params']['id']}})[_0xb7eb('0x29')](handleEntityNotFound(_0x2f20d3,null))[_0xb7eb('0x29')](saveUpdates(_0x13741b['body'],null))[_0xb7eb('0x29')](respondWithResult(_0x2f20d3,null))['catch'](handleError(_0x2f20d3,null));};exports['destroy']=function(_0x4bb9c2,_0x217dfd){return db[_0xb7eb('0x30')]['find']({'where':{'id':_0x4bb9c2['params']['id']}})[_0xb7eb('0x29')](handleEntityNotFound(_0x217dfd,null))[_0xb7eb('0x29')](removeEntity(_0x217dfd,null))[_0xb7eb('0x47')](handleError(_0x217dfd,null));};exports[_0xb7eb('0x4f')]=function(_0x15566c,_0x2ee16a){return db[_0xb7eb('0x30')][_0xb7eb('0x4f')]()[_0xb7eb('0x29')](respondWithResult(_0x2ee16a,null))[_0xb7eb('0x47')](handleError(_0x2ee16a,null));}; \ No newline at end of file +var _0xb234=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb234,0x13f));var _0x4b23=function(_0x1be321,_0x11155f){_0x1be321=_0x1be321-0x0;var _0x41308e=_0xb234[_0x1be321];return _0x41308e;};'use strict';var emlformat=require(_0x4b23('0x0'));var rimraf=require(_0x4b23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b23('0x2'));var rp=require(_0x4b23('0x3'));var moment=require(_0x4b23('0x4'));var BPromise=require(_0x4b23('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b23('0x6'));var sox=require(_0x4b23('0x7'));var csv=require('to-csv');var ejs=require(_0x4b23('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b23('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b23('0xa'));var deskjs=require(_0x4b23('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4b23('0xc'));var Papa=require(_0x4b23('0xd'));var Redis=require('ioredis');var authService=require(_0x4b23('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4b23('0xf'));var hardwareService=require(_0x4b23('0x10'));var logger=require(_0x4b23('0x11'))(_0x4b23('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b23('0x13'))['db'];function respondWithStatusCode(_0x1a6f01,_0x171648){_0x171648=_0x171648||0xcc;return function(_0xd27698){if(_0xd27698){return _0x1a6f01[_0x4b23('0x14')](_0x171648);}return _0x1a6f01[_0x4b23('0x15')](_0x171648)[_0x4b23('0x16')]();};}function respondWithResult(_0x3d9d2a,_0x5c8b32){_0x5c8b32=_0x5c8b32||0xc8;return function(_0x1347df){if(_0x1347df){return _0x3d9d2a['status'](_0x5c8b32)[_0x4b23('0x17')](_0x1347df);}};}function respondWithFilteredResult(_0x260aca,_0x1d4fe4){return function(_0x19938c){if(_0x19938c){var _0x2c37bc=typeof _0x1d4fe4['offset']===_0x4b23('0x18')&&typeof _0x1d4fe4[_0x4b23('0x19')]===_0x4b23('0x18');var _0xd4a985=_0x19938c[_0x4b23('0x1a')];var _0x26f7ad=_0x2c37bc?0x0:_0x1d4fe4['offset'];var _0x8133ad=_0x2c37bc?_0x19938c[_0x4b23('0x1a')]:_0x1d4fe4[_0x4b23('0x1b')]+_0x1d4fe4[_0x4b23('0x19')];var _0x3c3cfc;if(_0x8133ad>=_0xd4a985){_0x8133ad=_0xd4a985;_0x3c3cfc=0xc8;}else{_0x3c3cfc=0xce;}_0x260aca[_0x4b23('0x15')](_0x3c3cfc);return _0x260aca[_0x4b23('0x1c')](_0x4b23('0x1d'),_0x26f7ad+'-'+_0x8133ad+'/'+_0xd4a985)['json'](_0x19938c);}return null;};}function patchUpdates(_0x4e08e0){return function(_0x3f8ab6){try{jsonpatch[_0x4b23('0x1e')](_0x3f8ab6,_0x4e08e0,!![]);}catch(_0x19544b){return BPromise[_0x4b23('0x1f')](_0x19544b);}return _0x3f8ab6[_0x4b23('0x20')]();};}function saveUpdates(_0x1ad4f7,_0xc5d2df){return function(_0x38dc4d){if(_0x38dc4d){return _0x38dc4d[_0x4b23('0x21')](_0x1ad4f7)[_0x4b23('0x22')](function(_0x55ebd1){return _0x55ebd1;});}return null;};}function removeEntity(_0x53d327,_0x505fd4){return function(_0xf7f4fa){if(_0xf7f4fa){return _0xf7f4fa[_0x4b23('0x23')]()['then'](function(){_0x53d327[_0x4b23('0x15')](0xcc)[_0x4b23('0x16')]();});}};}function handleEntityNotFound(_0x5331c2,_0x56c123){return function(_0x335925){if(!_0x335925){_0x5331c2[_0x4b23('0x14')](0x194);}return _0x335925;};}function handleError(_0x2813b5,_0x1b8d5e){_0x1b8d5e=_0x1b8d5e||0x1f4;return function(_0x4bf5d5){logger[_0x4b23('0x24')](_0x4bf5d5[_0x4b23('0x25')]);if(_0x4bf5d5[_0x4b23('0x26')]){delete _0x4bf5d5[_0x4b23('0x26')];}_0x2813b5['status'](_0x1b8d5e)[_0x4b23('0x27')](_0x4bf5d5);};}exports[_0x4b23('0x28')]=function(_0x3ae265,_0x58bdc1){var _0x3f6df2={},_0xbd04c3={},_0x5cedb4={'count':0x0,'rows':[]};var _0xfdc265=_['map'](db[_0x4b23('0x29')][_0x4b23('0x2a')],function(_0xec6ae1){return{'name':_0xec6ae1[_0x4b23('0x2b')],'type':_0xec6ae1[_0x4b23('0x2c')]['key']};});_0xbd04c3[_0x4b23('0x2d')]=_[_0x4b23('0x2e')](_0xfdc265,_0x4b23('0x26'));_0xbd04c3[_0x4b23('0x2f')]=_['keys'](_0x3ae265[_0x4b23('0x2f')]);_0xbd04c3[_0x4b23('0x30')]=_['intersection'](_0xbd04c3['model'],_0xbd04c3[_0x4b23('0x2f')]);_0x3f6df2['attributes']=_[_0x4b23('0x31')](_0xbd04c3['model'],qs[_0x4b23('0x32')](_0x3ae265[_0x4b23('0x2f')][_0x4b23('0x32')]));_0x3f6df2[_0x4b23('0x33')]=_0x3f6df2[_0x4b23('0x33')]['length']?_0x3f6df2['attributes']:_0xbd04c3[_0x4b23('0x2d')];if(!_0x3ae265[_0x4b23('0x2f')][_0x4b23('0x34')](_0x4b23('0x35'))){_0x3f6df2[_0x4b23('0x19')]=qs['limit'](_0x3ae265[_0x4b23('0x2f')]['limit']);_0x3f6df2[_0x4b23('0x1b')]=qs[_0x4b23('0x1b')](_0x3ae265[_0x4b23('0x2f')][_0x4b23('0x1b')]);}_0x3f6df2[_0x4b23('0x36')]=qs[_0x4b23('0x37')](_0x3ae265[_0x4b23('0x2f')][_0x4b23('0x37')]);_0x3f6df2[_0x4b23('0x38')]=qs[_0x4b23('0x30')](_[_0x4b23('0x39')](_0x3ae265['query'],_0xbd04c3[_0x4b23('0x30')]),_0xfdc265);if(_0x3ae265[_0x4b23('0x2f')][_0x4b23('0x3a')]){_0x3f6df2[_0x4b23('0x38')]=_[_0x4b23('0x3b')](_0x3f6df2['where'],{'$or':_[_0x4b23('0x2e')](_0xfdc265,function(_0x20727d){if(_0x20727d[_0x4b23('0x2c')]!==_0x4b23('0x3c')){var _0x1d730b={};_0x1d730b[_0x20727d['name']]={'$like':'%'+_0x3ae265[_0x4b23('0x2f')]['filter']+'%'};return _0x1d730b;}})});}_0x3f6df2=_[_0x4b23('0x3b')]({},_0x3f6df2,_0x3ae265[_0x4b23('0x3d')]);var _0x5435bc={'where':_0x3f6df2[_0x4b23('0x38')]};return db[_0x4b23('0x29')]['count'](_0x5435bc)[_0x4b23('0x22')](function(_0x474ac5){_0x5cedb4[_0x4b23('0x1a')]=_0x474ac5;if(_0x3ae265[_0x4b23('0x2f')]['includeAll']){_0x3f6df2[_0x4b23('0x3e')]=[{'all':!![]}];}return db[_0x4b23('0x29')][_0x4b23('0x3f')](_0x3f6df2);})[_0x4b23('0x22')](function(_0x3639b6){_0x5cedb4[_0x4b23('0x40')]=_0x3639b6;return _0x5cedb4;})[_0x4b23('0x22')](respondWithFilteredResult(_0x58bdc1,_0x3f6df2))[_0x4b23('0x41')](handleError(_0x58bdc1,null));};exports[_0x4b23('0x42')]=function(_0x8fed81,_0x11304f){var _0x180875={'raw':!![],'where':{'id':_0x8fed81['params']['id']}},_0x5a0df6={};_0x5a0df6[_0x4b23('0x2d')]=_[_0x4b23('0x43')](db[_0x4b23('0x29')][_0x4b23('0x2a')]);_0x5a0df6[_0x4b23('0x2f')]=_[_0x4b23('0x43')](_0x8fed81[_0x4b23('0x2f')]);_0x5a0df6['filters']=_[_0x4b23('0x31')](_0x5a0df6[_0x4b23('0x2d')],_0x5a0df6[_0x4b23('0x2f')]);_0x180875['attributes']=_[_0x4b23('0x31')](_0x5a0df6['model'],qs[_0x4b23('0x32')](_0x8fed81[_0x4b23('0x2f')][_0x4b23('0x32')]));_0x180875['attributes']=_0x180875['attributes']['length']?_0x180875[_0x4b23('0x33')]:_0x5a0df6['model'];if(_0x8fed81['query'][_0x4b23('0x44')]){_0x180875[_0x4b23('0x3e')]=[{'all':!![]}];}_0x180875=_[_0x4b23('0x3b')]({},_0x180875,_0x8fed81['options']);return db[_0x4b23('0x29')][_0x4b23('0x45')](_0x180875)['then'](handleEntityNotFound(_0x11304f,null))[_0x4b23('0x22')](respondWithResult(_0x11304f,null))[_0x4b23('0x41')](handleError(_0x11304f,null));};exports[_0x4b23('0x46')]=function(_0x317466,_0x392dd7){return db[_0x4b23('0x29')][_0x4b23('0x46')](_0x317466['body'],{})[_0x4b23('0x22')](respondWithResult(_0x392dd7,0xc9))[_0x4b23('0x41')](handleError(_0x392dd7,null));};exports[_0x4b23('0x21')]=function(_0xf9d2c6,_0x28714d){if(_0xf9d2c6['body']['id']){delete _0xf9d2c6[_0x4b23('0x47')]['id'];}return db[_0x4b23('0x29')][_0x4b23('0x45')]({'where':{'id':_0xf9d2c6[_0x4b23('0x48')]['id']}})[_0x4b23('0x22')](handleEntityNotFound(_0x28714d,null))['then'](saveUpdates(_0xf9d2c6[_0x4b23('0x47')],null))[_0x4b23('0x22')](respondWithResult(_0x28714d,null))[_0x4b23('0x41')](handleError(_0x28714d,null));};exports[_0x4b23('0x23')]=function(_0x4a5204,_0x20923e){return db[_0x4b23('0x29')]['find']({'where':{'id':_0x4a5204['params']['id']}})[_0x4b23('0x22')](handleEntityNotFound(_0x20923e,null))[_0x4b23('0x22')](removeEntity(_0x20923e,null))[_0x4b23('0x41')](handleError(_0x20923e,null));};exports[_0x4b23('0x49')]=function(_0x5dbd3c,_0x4a7c45){return db[_0x4b23('0x29')]['describe']()[_0x4b23('0x22')](respondWithResult(_0x4a7c45,null))['catch'](handleError(_0x4a7c45,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index b03f8d7..0416052 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x122fe6,_0x4ac758){var _0x36b7d2=function(_0x12fca2){while(--_0x12fca2){_0x122fe6['push'](_0x122fe6['shift']());}};_0x36b7d2(++_0x4ac758);}(_0xb10b,0x12a));var _0xbb10=function(_0x4144c0,_0x253e2b){_0x4144c0=_0x4144c0-0x0;var _0x424d45=_0xb10b[_0x4144c0];return _0x424d45;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x5bd1a9,_0x313714){var _0x2ba345=function(_0x21b4af){while(--_0x21b4af){_0x5bd1a9['push'](_0x5bd1a9['shift']());}};_0x2ba345(++_0x313714);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 0486abe..82119e1 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 _0x4889=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','raw','then','update','options','attributes','limit','UpdateChatQueueReport','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4d3940,_0x167a82){var _0x542862=function(_0x462ca2){while(--_0x462ca2){_0x4d3940['push'](_0x4d3940['shift']());}};_0x542862(++_0x167a82);}(_0x4889,0x69));var _0x9488=function(_0x2f2dba,_0x451d2e){_0x2f2dba=_0x2f2dba-0x0;var _0x27e85e=_0x4889[_0x2f2dba];return _0x27e85e;};'use strict';var _=require(_0x9488('0x0'));var util=require(_0x9488('0x1'));var moment=require('moment');var BPromise=require(_0x9488('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9488('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9488('0x4'))('rpc');var config=require(_0x9488('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9488('0x6')][_0x9488('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x321792,_0x50cdb9,_0x5546b0){return new BPromise(function(_0x555565,_0x21e18c){return client['request'](_0x321792,_0x5546b0)['then'](function(_0x435a54){logger[_0x9488('0x8')](_0x9488('0x9'),_0x50cdb9,_0x9488('0xa'));logger[_0x9488('0xb')](_0x9488('0xc'),_0x50cdb9,_0x9488('0xa'),JSON[_0x9488('0xd')](_0x435a54));if(_0x435a54[_0x9488('0xe')]){if(_0x435a54[_0x9488('0xe')][_0x9488('0xf')]===0x1f4){logger['error'](_0x9488('0x9'),_0x50cdb9,_0x435a54[_0x9488('0xe')][_0x9488('0x10')]);return _0x21e18c(_0x435a54[_0x9488('0xe')][_0x9488('0x10')]);}logger[_0x9488('0xe')](_0x9488('0x9'),_0x50cdb9,_0x435a54[_0x9488('0xe')]['message']);return _0x555565(_0x435a54['error']['message']);}else{logger[_0x9488('0x8')](_0x9488('0x9'),_0x50cdb9,'request\x20sent');_0x555565(_0x435a54[_0x9488('0x11')][_0x9488('0x10')]);}})[_0x9488('0x12')](function(_0x1549d2){logger[_0x9488('0xe')](_0x9488('0x9'),_0x50cdb9,_0x1549d2);_0x21e18c(_0x1549d2);});});}exports[_0x9488('0x13')]=function(_0x4e5a97){var _0x18ba81=this;return new Promise(function(_0x150ef2,_0x19cbc0){return db[_0x9488('0x14')]['create'](_0x4e5a97[_0x9488('0x15')],{'raw':_0x4e5a97['options']?_0x4e5a97['options'][_0x9488('0x16')]===undefined?!![]:![]:!![]})[_0x9488('0x17')](function(_0x1317b5){logger[_0x9488('0x8')](_0x9488('0x13'),_0x4e5a97);logger[_0x9488('0xb')]('CreateChatQueueReport',_0x4e5a97,JSON[_0x9488('0xd')](_0x1317b5));_0x150ef2(_0x1317b5);})['catch'](function(_0x44433c){logger[_0x9488('0xe')]('CreateChatQueueReport',_0x44433c[_0x9488('0x10')],_0x4e5a97);_0x19cbc0(_0x18ba81[_0x9488('0xe')](0x1f4,_0x44433c[_0x9488('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x400650){var _0x57e44b=this;return new Promise(function(_0x17f1f4,_0x5dc27a){return db[_0x9488('0x14')][_0x9488('0x18')](_0x400650[_0x9488('0x15')],{'raw':_0x400650['options']?_0x400650[_0x9488('0x19')][_0x9488('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400650['options']?_0x400650[_0x9488('0x19')]['where']||null:null,'attributes':_0x400650[_0x9488('0x19')]?_0x400650['options'][_0x9488('0x1a')]||null:null,'limit':_0x400650[_0x9488('0x19')]?_0x400650[_0x9488('0x19')][_0x9488('0x1b')]||null:null})[_0x9488('0x17')](function(_0x348c8d){logger[_0x9488('0x8')](_0x9488('0x1c'),_0x400650);logger[_0x9488('0xb')]('UpdateChatQueueReport',_0x400650,JSON[_0x9488('0xd')](_0x348c8d));_0x17f1f4(_0x348c8d);})[_0x9488('0x12')](function(_0x5b270f){logger[_0x9488('0xe')](_0x9488('0x1c'),_0x5b270f['message'],_0x400650);_0x5dc27a(_0x57e44b[_0x9488('0xe')](0x1f4,_0x5b270f[_0x9488('0x10')]));});});}; \ No newline at end of file +var _0xd60e=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd60e,0x1d6));var _0xed60=function(_0x492084,_0x483c32){_0x492084=_0x492084-0x0;var _0x4b3a03=_0xd60e[_0x492084];return _0x4b3a03;};'use strict';var _=require(_0xed60('0x0'));var util=require(_0xed60('0x1'));var moment=require(_0xed60('0x2'));var BPromise=require('bluebird');var rs=require(_0xed60('0x3'));var fs=require('fs');var Redis=require(_0xed60('0x4'));var db=require(_0xed60('0x5'))['db'];var utils=require(_0xed60('0x6'));var logger=require(_0xed60('0x7'))(_0xed60('0x8'));var config=require('../../config/environment');var jayson=require(_0xed60('0x9'));var client=jayson['client'][_0xed60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37a5cb,_0x42bca1,_0x962cf1){return new BPromise(function(_0x1b0401,_0x3a3f74){return client[_0xed60('0xb')](_0x37a5cb,_0x962cf1)[_0xed60('0xc')](function(_0x38babe){logger[_0xed60('0xd')](_0xed60('0xe'),_0x42bca1,_0xed60('0xf'));logger['debug'](_0xed60('0x10'),_0x42bca1,_0xed60('0xf'),JSON[_0xed60('0x11')](_0x38babe));if(_0x38babe['error']){if(_0x38babe['error'][_0xed60('0x12')]===0x1f4){logger[_0xed60('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x42bca1,_0x38babe[_0xed60('0x13')][_0xed60('0x14')]);return _0x3a3f74(_0x38babe[_0xed60('0x13')][_0xed60('0x14')]);}logger[_0xed60('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x42bca1,_0x38babe['error']['message']);return _0x1b0401(_0x38babe[_0xed60('0x13')][_0xed60('0x14')]);}else{logger[_0xed60('0xd')](_0xed60('0xe'),_0x42bca1,_0xed60('0xf'));_0x1b0401(_0x38babe[_0xed60('0x15')][_0xed60('0x14')]);}})[_0xed60('0x16')](function(_0x64ecb){logger[_0xed60('0x13')](_0xed60('0xe'),_0x42bca1,_0x64ecb);_0x3a3f74(_0x64ecb);});});}exports[_0xed60('0x17')]=function(_0x5d1647){var _0x4f77f5=this;return new Promise(function(_0x2b8a2a,_0x8fb956){return db[_0xed60('0x18')][_0xed60('0x19')](_0x5d1647[_0xed60('0x1a')],{'raw':_0x5d1647[_0xed60('0x1b')]?_0x5d1647[_0xed60('0x1b')][_0xed60('0x1c')]===undefined?!![]:![]:!![]})[_0xed60('0xc')](function(_0x46a3f7){logger['info'](_0xed60('0x17'),_0x5d1647);logger['debug'](_0xed60('0x17'),_0x5d1647,JSON[_0xed60('0x11')](_0x46a3f7));_0x2b8a2a(_0x46a3f7);})[_0xed60('0x16')](function(_0x502a42){logger[_0xed60('0x13')](_0xed60('0x17'),_0x502a42[_0xed60('0x14')],_0x5d1647);_0x8fb956(_0x4f77f5[_0xed60('0x13')](0x1f4,_0x502a42[_0xed60('0x14')]));});});};exports[_0xed60('0x1d')]=function(_0x33e7c3){var _0x6ad487=this;return new Promise(function(_0x3f54a0,_0x449425){return db[_0xed60('0x18')]['update'](_0x33e7c3[_0xed60('0x1a')],{'raw':_0x33e7c3['options']?_0x33e7c3['options'][_0xed60('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33e7c3['options']?_0x33e7c3['options']['where']||null:null,'attributes':_0x33e7c3['options']?_0x33e7c3['options'][_0xed60('0x1e')]||null:null,'limit':_0x33e7c3[_0xed60('0x1b')]?_0x33e7c3[_0xed60('0x1b')][_0xed60('0x1f')]||null:null})['then'](function(_0x3c11bb){logger['info'](_0xed60('0x1d'),_0x33e7c3);logger['debug'](_0xed60('0x1d'),_0x33e7c3,JSON[_0xed60('0x11')](_0x3c11bb));_0x3f54a0(_0x3c11bb);})['catch'](function(_0x211137){logger['error'](_0xed60('0x1d'),_0x211137[_0xed60('0x14')],_0x33e7c3);_0x449425(_0x6ad487[_0xed60('0x13')](0x1f4,_0x211137[_0xed60('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4afbbfd..0f57849 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 _0x783e=['/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x592925,_0x16247a){var _0x1df24b=function(_0x2d11e7){while(--_0x2d11e7){_0x592925['push'](_0x592925['shift']());}};_0x1df24b(++_0x16247a);}(_0x783e,0xdf));var _0xe783=function(_0x1c194f,_0x548e32){_0x1c194f=_0x1c194f-0x0;var _0x3c08c1=_0x783e[_0x1c194f];return _0x3c08c1;};'use strict';var multer=require(_0xe783('0x0'));var util=require(_0xe783('0x1'));var path=require(_0xe783('0x2'));var timeout=require(_0xe783('0x3'));var express=require(_0xe783('0x4'));var router=express[_0xe783('0x5')]();var fs_extra=require(_0xe783('0x6'));var auth=require(_0xe783('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xe783('0x8')]('/',auth[_0xe783('0x9')](),controller[_0xe783('0xa')]);router[_0xe783('0x8')](_0xe783('0xb'),auth[_0xe783('0x9')](),controller[_0xe783('0xc')]);router['get']('/:id',auth[_0xe783('0x9')](),controller[_0xe783('0xd')]);router[_0xe783('0xe')]('/',auth['isAuthenticated'](),controller[_0xe783('0xf')]);router[_0xe783('0x10')](_0xe783('0x11'),auth[_0xe783('0x9')](),controller[_0xe783('0x12')]);router[_0xe783('0x13')]('/:id',auth[_0xe783('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xef18=['/:id','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','create','put'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xef18,0xdf));var _0x8ef1=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0xef18[_0x30033a];return _0x5e3518;};'use strict';var multer=require('multer');var util=require(_0x8ef1('0x0'));var path=require(_0x8ef1('0x1'));var timeout=require(_0x8ef1('0x2'));var express=require('express');var router=express[_0x8ef1('0x3')]();var fs_extra=require(_0x8ef1('0x4'));var auth=require(_0x8ef1('0x5'));var interaction=require(_0x8ef1('0x6'));var config=require(_0x8ef1('0x7'));var controller=require(_0x8ef1('0x8'));router['get']('/',auth[_0x8ef1('0x9')](),controller[_0x8ef1('0xa')]);router[_0x8ef1('0xb')](_0x8ef1('0xc'),auth[_0x8ef1('0x9')](),controller[_0x8ef1('0xd')]);router[_0x8ef1('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x8ef1('0xe')]);router['post']('/',auth[_0x8ef1('0x9')](),controller[_0x8ef1('0xf')]);router[_0x8ef1('0x10')](_0x8ef1('0x11'),auth[_0x8ef1('0x9')](),controller['update']);router['delete'](_0x8ef1('0x11'),auth[_0x8ef1('0x9')](),controller[_0x8ef1('0x12')]);module[_0x8ef1('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d4a2c2c..b7a5fe2 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1772c7,_0x3bb563){var _0x4bc90b=function(_0x285b8f){while(--_0x285b8f){_0x1772c7['push'](_0x1772c7['shift']());}};_0x4bc90b(++_0x3bb563);}(_0xe706,0xa3));var _0x6e70=function(_0x112c0d,_0x5af795){_0x112c0d=_0x112c0d-0x0;var _0xcb9325=_0xe706[_0x112c0d];return _0xcb9325;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x469ae4,_0x577ea2){var _0x43c1a9=function(_0x40ab57){while(--_0x40ab57){_0x469ae4['push'](_0x469ae4['shift']());}};_0x43c1a9(++_0x577ea2);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 092350f..c53a34c 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 _0xa7de=['end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa7de,0x15e));var _0xea7d=function(_0x1c019f,_0x489f3c){_0x1c019f=_0x1c019f-0x0;var _0x1932a9=_0xa7de[_0x1c019f];return _0x1932a9;};'use strict';var emlformat=require(_0xea7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7d('0x1'));var jsonpatch=require(_0xea7d('0x2'));var rp=require(_0xea7d('0x3'));var moment=require(_0xea7d('0x4'));var BPromise=require(_0xea7d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea7d('0x6'));var sox=require(_0xea7d('0x7'));var csv=require(_0xea7d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea7d('0x9'));var _=require('lodash');var squel=require(_0xea7d('0xa'));var crypto=require(_0xea7d('0xb'));var jsforce=require(_0xea7d('0xc'));var deskjs=require(_0xea7d('0xd'));var toCsv=require(_0xea7d('0x8'));var querystring=require(_0xea7d('0xe'));var Papa=require(_0xea7d('0xf'));var Redis=require(_0xea7d('0x10'));var authService=require(_0xea7d('0x11'));var qs=require(_0xea7d('0x12'));var as=require(_0xea7d('0x13'));var hardwareService=require(_0xea7d('0x14'));var logger=require('../../config/logger')(_0xea7d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xea7d('0x16'))['db'];function respondWithStatusCode(_0x4c2908,_0x2a8c14){_0x2a8c14=_0x2a8c14||0xcc;return function(_0x57c5ab){if(_0x57c5ab){return _0x4c2908[_0xea7d('0x17')](_0x2a8c14);}return _0x4c2908[_0xea7d('0x18')](_0x2a8c14)[_0xea7d('0x19')]();};}function respondWithResult(_0x464b8b,_0x321431){_0x321431=_0x321431||0xc8;return function(_0x21fbc3){if(_0x21fbc3){return _0x464b8b['status'](_0x321431)['json'](_0x21fbc3);}};}function respondWithFilteredResult(_0x52443f,_0x10d9bd){return function(_0x17cb4d){if(_0x17cb4d){var _0x6837f9=typeof _0x10d9bd[_0xea7d('0x1a')]===_0xea7d('0x1b')&&typeof _0x10d9bd[_0xea7d('0x1c')]===_0xea7d('0x1b');var _0x1a7d24=_0x17cb4d[_0xea7d('0x1d')];var _0x2b363f=_0x6837f9?0x0:_0x10d9bd[_0xea7d('0x1a')];var _0x2a5065=_0x6837f9?_0x17cb4d[_0xea7d('0x1d')]:_0x10d9bd[_0xea7d('0x1a')]+_0x10d9bd[_0xea7d('0x1c')];var _0x2de9d4;if(_0x2a5065>=_0x1a7d24){_0x2a5065=_0x1a7d24;_0x2de9d4=0xc8;}else{_0x2de9d4=0xce;}_0x52443f[_0xea7d('0x18')](_0x2de9d4);return _0x52443f[_0xea7d('0x1e')]('Content-Range',_0x2b363f+'-'+_0x2a5065+'/'+_0x1a7d24)[_0xea7d('0x1f')](_0x17cb4d);}return null;};}function patchUpdates(_0x5127ed){return function(_0x5486ff){try{jsonpatch[_0xea7d('0x20')](_0x5486ff,_0x5127ed,!![]);}catch(_0x1b3f1a){return BPromise[_0xea7d('0x21')](_0x1b3f1a);}return _0x5486ff[_0xea7d('0x22')]();};}function saveUpdates(_0x1243f8,_0x5ec563){return function(_0x5efce4){if(_0x5efce4){return _0x5efce4[_0xea7d('0x23')](_0x1243f8)[_0xea7d('0x24')](function(_0x492bb4){return _0x492bb4;});}return null;};}function removeEntity(_0x45e99c,_0x26b985){return function(_0x305db0){if(_0x305db0){return _0x305db0[_0xea7d('0x25')]()[_0xea7d('0x24')](function(){_0x45e99c[_0xea7d('0x18')](0xcc)[_0xea7d('0x19')]();});}};}function handleEntityNotFound(_0x5bd685,_0x15960a){return function(_0x41be5e){if(!_0x41be5e){_0x5bd685[_0xea7d('0x17')](0x194);}return _0x41be5e;};}function handleError(_0x2c21ff,_0x167f31){_0x167f31=_0x167f31||0x1f4;return function(_0x4aec66){logger[_0xea7d('0x26')](_0x4aec66[_0xea7d('0x27')]);if(_0x4aec66['name']){delete _0x4aec66[_0xea7d('0x28')];}_0x2c21ff[_0xea7d('0x18')](_0x167f31)[_0xea7d('0x29')](_0x4aec66);};}exports[_0xea7d('0x2a')]=function(_0xa8ee50,_0x5969df){var _0x3bd068={},_0x4b7034={},_0x1aa6a5={'count':0x0,'rows':[]};var _0x8e11c0=_[_0xea7d('0x2b')](db[_0xea7d('0x2c')][_0xea7d('0x2d')],function(_0x35e8bc){return{'name':_0x35e8bc[_0xea7d('0x2e')],'type':_0x35e8bc[_0xea7d('0x2f')]['key']};});_0x4b7034[_0xea7d('0x30')]=_['map'](_0x8e11c0,_0xea7d('0x28'));_0x4b7034[_0xea7d('0x31')]=_[_0xea7d('0x32')](_0xa8ee50[_0xea7d('0x31')]);_0x4b7034[_0xea7d('0x33')]=_[_0xea7d('0x34')](_0x4b7034[_0xea7d('0x30')],_0x4b7034[_0xea7d('0x31')]);_0x3bd068[_0xea7d('0x35')]=_['intersection'](_0x4b7034[_0xea7d('0x30')],qs[_0xea7d('0x36')](_0xa8ee50[_0xea7d('0x31')][_0xea7d('0x36')]));_0x3bd068['attributes']=_0x3bd068[_0xea7d('0x35')][_0xea7d('0x37')]?_0x3bd068[_0xea7d('0x35')]:_0x4b7034[_0xea7d('0x30')];if(!_0xa8ee50['query']['hasOwnProperty'](_0xea7d('0x38'))){_0x3bd068[_0xea7d('0x1c')]=qs[_0xea7d('0x1c')](_0xa8ee50['query'][_0xea7d('0x1c')]);_0x3bd068[_0xea7d('0x1a')]=qs['offset'](_0xa8ee50['query'][_0xea7d('0x1a')]);}_0x3bd068[_0xea7d('0x39')]=qs[_0xea7d('0x3a')](_0xa8ee50[_0xea7d('0x31')][_0xea7d('0x3a')]);_0x3bd068[_0xea7d('0x3b')]=qs['filters'](_[_0xea7d('0x3c')](_0xa8ee50['query'],_0x4b7034[_0xea7d('0x33')]),_0x8e11c0);if(_0xa8ee50[_0xea7d('0x31')][_0xea7d('0x3d')]){_0x3bd068['where']=_[_0xea7d('0x3e')](_0x3bd068[_0xea7d('0x3b')],{'$or':_[_0xea7d('0x2b')](_0x8e11c0,function(_0x475be7){if(_0x475be7[_0xea7d('0x2f')]!==_0xea7d('0x3f')){var _0x447182={};_0x447182[_0x475be7['name']]={'$like':'%'+_0xa8ee50[_0xea7d('0x31')][_0xea7d('0x3d')]+'%'};return _0x447182;}})});}_0x3bd068=_['merge']({},_0x3bd068,_0xa8ee50['options']);var _0x55d6a3={'where':_0x3bd068[_0xea7d('0x3b')]};return db[_0xea7d('0x2c')][_0xea7d('0x1d')](_0x55d6a3)[_0xea7d('0x24')](function(_0x5a7531){_0x1aa6a5[_0xea7d('0x1d')]=_0x5a7531;if(_0xa8ee50[_0xea7d('0x31')][_0xea7d('0x40')]){_0x3bd068[_0xea7d('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xea7d('0x42')](_0x3bd068);})[_0xea7d('0x24')](function(_0x4f1388){_0x1aa6a5['rows']=_0x4f1388;return _0x1aa6a5;})[_0xea7d('0x24')](respondWithFilteredResult(_0x5969df,_0x3bd068))[_0xea7d('0x43')](handleError(_0x5969df,null));};exports[_0xea7d('0x44')]=function(_0x42d119,_0x550843){var _0xde3886={'raw':!![],'where':{'id':_0x42d119[_0xea7d('0x45')]['id']}},_0x4242a1={};_0x4242a1['model']=_[_0xea7d('0x32')](db[_0xea7d('0x2c')][_0xea7d('0x2d')]);_0x4242a1['query']=_[_0xea7d('0x32')](_0x42d119[_0xea7d('0x31')]);_0x4242a1[_0xea7d('0x33')]=_[_0xea7d('0x34')](_0x4242a1[_0xea7d('0x30')],_0x4242a1[_0xea7d('0x31')]);_0xde3886[_0xea7d('0x35')]=_[_0xea7d('0x34')](_0x4242a1[_0xea7d('0x30')],qs[_0xea7d('0x36')](_0x42d119['query'][_0xea7d('0x36')]));_0xde3886[_0xea7d('0x35')]=_0xde3886[_0xea7d('0x35')][_0xea7d('0x37')]?_0xde3886[_0xea7d('0x35')]:_0x4242a1[_0xea7d('0x30')];if(_0x42d119[_0xea7d('0x31')]['includeAll']){_0xde3886[_0xea7d('0x41')]=[{'all':!![]}];}_0xde3886=_[_0xea7d('0x3e')]({},_0xde3886,_0x42d119[_0xea7d('0x46')]);return db['ChatTransferReport'][_0xea7d('0x47')](_0xde3886)['then'](handleEntityNotFound(_0x550843,null))['then'](respondWithResult(_0x550843,null))[_0xea7d('0x43')](handleError(_0x550843,null));};exports[_0xea7d('0x48')]=function(_0x16cb88,_0x57b8fd){return db[_0xea7d('0x2c')]['create'](_0x16cb88[_0xea7d('0x49')],{})['then'](respondWithResult(_0x57b8fd,0xc9))[_0xea7d('0x43')](handleError(_0x57b8fd,null));};exports[_0xea7d('0x23')]=function(_0x14bc7d,_0x43fc48){if(_0x14bc7d[_0xea7d('0x49')]['id']){delete _0x14bc7d[_0xea7d('0x49')]['id'];}return db[_0xea7d('0x2c')]['find']({'where':{'id':_0x14bc7d[_0xea7d('0x45')]['id']}})[_0xea7d('0x24')](handleEntityNotFound(_0x43fc48,null))[_0xea7d('0x24')](saveUpdates(_0x14bc7d['body'],null))[_0xea7d('0x24')](respondWithResult(_0x43fc48,null))[_0xea7d('0x43')](handleError(_0x43fc48,null));};exports[_0xea7d('0x25')]=function(_0x1bd285,_0x2f8b92){return db['ChatTransferReport'][_0xea7d('0x47')]({'where':{'id':_0x1bd285['params']['id']}})[_0xea7d('0x24')](handleEntityNotFound(_0x2f8b92,null))['then'](removeEntity(_0x2f8b92,null))[_0xea7d('0x43')](handleError(_0x2f8b92,null));};exports[_0xea7d('0x4a')]=function(_0x47eeac,_0x26de7d){return db[_0xea7d('0x2c')][_0xea7d('0x4a')]()['then'](respondWithResult(_0x26de7d,null))['catch'](handleError(_0x26de7d,null));}; \ No newline at end of file +var _0xdeaf=['include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','status','stack','name','send','index','map','ChatTransferReport','type','key','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','filter','merge','where','VIRTUAL','includeAll','findAll','rows','show','params'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0xdeaf,0x1c8));var _0xfdea=function(_0x497732,_0x57b465){_0x497732=_0x497732-0x0;var _0x3fe666=_0xdeaf[_0x497732];return _0x3fe666;};'use strict';var emlformat=require(_0xfdea('0x0'));var rimraf=require(_0xfdea('0x1'));var zipdir=require(_0xfdea('0x2'));var jsonpatch=require(_0xfdea('0x3'));var rp=require(_0xfdea('0x4'));var moment=require(_0xfdea('0x5'));var BPromise=require(_0xfdea('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfdea('0x7'));var sox=require(_0xfdea('0x8'));var csv=require(_0xfdea('0x9'));var ejs=require(_0xfdea('0xa'));var fs=require('fs');var fs_extra=require(_0xfdea('0xb'));var _=require(_0xfdea('0xc'));var squel=require(_0xfdea('0xd'));var crypto=require(_0xfdea('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfdea('0xf'));var toCsv=require(_0xfdea('0x9'));var querystring=require(_0xfdea('0x10'));var Papa=require(_0xfdea('0x11'));var Redis=require(_0xfdea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfdea('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdea('0x14'));var logger=require(_0xfdea('0x15'))(_0xfdea('0x16'));var utils=require('../../config/utils');var config=require(_0xfdea('0x17'));var licenseUtil=require(_0xfdea('0x18'));var db=require(_0xfdea('0x19'))['db'];function respondWithStatusCode(_0x1636d7,_0x4c5463){_0x4c5463=_0x4c5463||0xcc;return function(_0x15c090){if(_0x15c090){return _0x1636d7[_0xfdea('0x1a')](_0x4c5463);}return _0x1636d7['status'](_0x4c5463)[_0xfdea('0x1b')]();};}function respondWithResult(_0x4ec892,_0xa424db){_0xa424db=_0xa424db||0xc8;return function(_0x1dee40){if(_0x1dee40){return _0x4ec892['status'](_0xa424db)[_0xfdea('0x1c')](_0x1dee40);}};}function respondWithFilteredResult(_0x38fe6d,_0x59aaf9){return function(_0x32e634){if(_0x32e634){var _0x3e629c=typeof _0x59aaf9['offset']===_0xfdea('0x1d')&&typeof _0x59aaf9[_0xfdea('0x1e')]===_0xfdea('0x1d');var _0x1188c0=_0x32e634[_0xfdea('0x1f')];var _0x569b3b=_0x3e629c?0x0:_0x59aaf9[_0xfdea('0x20')];var _0x3a9848=_0x3e629c?_0x32e634[_0xfdea('0x1f')]:_0x59aaf9[_0xfdea('0x20')]+_0x59aaf9['limit'];var _0x2fa6b9;if(_0x3a9848>=_0x1188c0){_0x3a9848=_0x1188c0;_0x2fa6b9=0xc8;}else{_0x2fa6b9=0xce;}_0x38fe6d['status'](_0x2fa6b9);return _0x38fe6d[_0xfdea('0x21')](_0xfdea('0x22'),_0x569b3b+'-'+_0x3a9848+'/'+_0x1188c0)[_0xfdea('0x1c')](_0x32e634);}return null;};}function patchUpdates(_0x312b0a){return function(_0x59bb0e){try{jsonpatch[_0xfdea('0x23')](_0x59bb0e,_0x312b0a,!![]);}catch(_0x3de895){return BPromise[_0xfdea('0x24')](_0x3de895);}return _0x59bb0e[_0xfdea('0x25')]();};}function saveUpdates(_0x2ed2c2,_0x51dfe7){return function(_0x4b461d){if(_0x4b461d){return _0x4b461d[_0xfdea('0x26')](_0x2ed2c2)[_0xfdea('0x27')](function(_0x585537){return _0x585537;});}return null;};}function removeEntity(_0x13d8db,_0x5024a9){return function(_0x2ff79f){if(_0x2ff79f){return _0x2ff79f['destroy']()[_0xfdea('0x27')](function(){_0x13d8db[_0xfdea('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6e5d,_0x5d9f7b){return function(_0x59d29c){if(!_0x59d29c){_0x2d6e5d['sendStatus'](0x194);}return _0x59d29c;};}function handleError(_0x430de6,_0x254617){_0x254617=_0x254617||0x1f4;return function(_0x33c2cc){logger['error'](_0x33c2cc[_0xfdea('0x29')]);if(_0x33c2cc[_0xfdea('0x2a')]){delete _0x33c2cc['name'];}_0x430de6[_0xfdea('0x28')](_0x254617)[_0xfdea('0x2b')](_0x33c2cc);};}exports[_0xfdea('0x2c')]=function(_0x13b7cc,_0x124816){var _0x16957b={},_0xa04ebd={},_0x5b9ec6={'count':0x0,'rows':[]};var _0x1cf008=_[_0xfdea('0x2d')](db[_0xfdea('0x2e')]['rawAttributes'],function(_0x1cab03){return{'name':_0x1cab03['fieldName'],'type':_0x1cab03[_0xfdea('0x2f')][_0xfdea('0x30')]};});_0xa04ebd[_0xfdea('0x31')]=_[_0xfdea('0x2d')](_0x1cf008,_0xfdea('0x2a'));_0xa04ebd['query']=_[_0xfdea('0x32')](_0x13b7cc['query']);_0xa04ebd[_0xfdea('0x33')]=_['intersection'](_0xa04ebd[_0xfdea('0x31')],_0xa04ebd['query']);_0x16957b[_0xfdea('0x34')]=_[_0xfdea('0x35')](_0xa04ebd['model'],qs[_0xfdea('0x36')](_0x13b7cc[_0xfdea('0x37')][_0xfdea('0x36')]));_0x16957b[_0xfdea('0x34')]=_0x16957b[_0xfdea('0x34')][_0xfdea('0x38')]?_0x16957b[_0xfdea('0x34')]:_0xa04ebd['model'];if(!_0x13b7cc['query'][_0xfdea('0x39')](_0xfdea('0x3a'))){_0x16957b[_0xfdea('0x1e')]=qs[_0xfdea('0x1e')](_0x13b7cc[_0xfdea('0x37')]['limit']);_0x16957b[_0xfdea('0x20')]=qs[_0xfdea('0x20')](_0x13b7cc[_0xfdea('0x37')][_0xfdea('0x20')]);}_0x16957b[_0xfdea('0x3b')]=qs['sort'](_0x13b7cc['query']['sort']);_0x16957b['where']=qs['filters'](_['pick'](_0x13b7cc[_0xfdea('0x37')],_0xa04ebd[_0xfdea('0x33')]),_0x1cf008);if(_0x13b7cc[_0xfdea('0x37')][_0xfdea('0x3c')]){_0x16957b['where']=_[_0xfdea('0x3d')](_0x16957b[_0xfdea('0x3e')],{'$or':_[_0xfdea('0x2d')](_0x1cf008,function(_0x4f8136){if(_0x4f8136[_0xfdea('0x2f')]!==_0xfdea('0x3f')){var _0x4604d6={};_0x4604d6[_0x4f8136[_0xfdea('0x2a')]]={'$like':'%'+_0x13b7cc[_0xfdea('0x37')][_0xfdea('0x3c')]+'%'};return _0x4604d6;}})});}_0x16957b=_['merge']({},_0x16957b,_0x13b7cc['options']);var _0x3a03fe={'where':_0x16957b[_0xfdea('0x3e')]};return db[_0xfdea('0x2e')]['count'](_0x3a03fe)[_0xfdea('0x27')](function(_0x188f05){_0x5b9ec6[_0xfdea('0x1f')]=_0x188f05;if(_0x13b7cc['query'][_0xfdea('0x40')]){_0x16957b['include']=[{'all':!![]}];}return db[_0xfdea('0x2e')][_0xfdea('0x41')](_0x16957b);})[_0xfdea('0x27')](function(_0x217081){_0x5b9ec6[_0xfdea('0x42')]=_0x217081;return _0x5b9ec6;})[_0xfdea('0x27')](respondWithFilteredResult(_0x124816,_0x16957b))['catch'](handleError(_0x124816,null));};exports[_0xfdea('0x43')]=function(_0x58af39,_0x10f96f){var _0x54560a={'raw':!![],'where':{'id':_0x58af39[_0xfdea('0x44')]['id']}},_0x527a18={};_0x527a18[_0xfdea('0x31')]=_[_0xfdea('0x32')](db['ChatTransferReport']['rawAttributes']);_0x527a18[_0xfdea('0x37')]=_['keys'](_0x58af39[_0xfdea('0x37')]);_0x527a18[_0xfdea('0x33')]=_['intersection'](_0x527a18[_0xfdea('0x31')],_0x527a18[_0xfdea('0x37')]);_0x54560a['attributes']=_[_0xfdea('0x35')](_0x527a18[_0xfdea('0x31')],qs[_0xfdea('0x36')](_0x58af39[_0xfdea('0x37')][_0xfdea('0x36')]));_0x54560a[_0xfdea('0x34')]=_0x54560a[_0xfdea('0x34')][_0xfdea('0x38')]?_0x54560a[_0xfdea('0x34')]:_0x527a18[_0xfdea('0x31')];if(_0x58af39['query'][_0xfdea('0x40')]){_0x54560a[_0xfdea('0x45')]=[{'all':!![]}];}_0x54560a=_[_0xfdea('0x3d')]({},_0x54560a,_0x58af39['options']);return db[_0xfdea('0x2e')][_0xfdea('0x46')](_0x54560a)[_0xfdea('0x27')](handleEntityNotFound(_0x10f96f,null))['then'](respondWithResult(_0x10f96f,null))[_0xfdea('0x47')](handleError(_0x10f96f,null));};exports[_0xfdea('0x48')]=function(_0xdfc37f,_0x5f12d8){return db[_0xfdea('0x2e')][_0xfdea('0x48')](_0xdfc37f[_0xfdea('0x49')],{})[_0xfdea('0x27')](respondWithResult(_0x5f12d8,0xc9))[_0xfdea('0x47')](handleError(_0x5f12d8,null));};exports[_0xfdea('0x26')]=function(_0x152aa7,_0x21c42b){if(_0x152aa7[_0xfdea('0x49')]['id']){delete _0x152aa7[_0xfdea('0x49')]['id'];}return db[_0xfdea('0x2e')][_0xfdea('0x46')]({'where':{'id':_0x152aa7[_0xfdea('0x44')]['id']}})['then'](handleEntityNotFound(_0x21c42b,null))[_0xfdea('0x27')](saveUpdates(_0x152aa7[_0xfdea('0x49')],null))[_0xfdea('0x27')](respondWithResult(_0x21c42b,null))['catch'](handleError(_0x21c42b,null));};exports['destroy']=function(_0x2fa558,_0x17ca3f){return db[_0xfdea('0x2e')][_0xfdea('0x46')]({'where':{'id':_0x2fa558[_0xfdea('0x44')]['id']}})[_0xfdea('0x27')](handleEntityNotFound(_0x17ca3f,null))['then'](removeEntity(_0x17ca3f,null))[_0xfdea('0x47')](handleError(_0x17ca3f,null));};exports[_0xfdea('0x4a')]=function(_0x14cf4a,_0x413525){return db['ChatTransferReport'][_0xfdea('0x4a')]()[_0xfdea('0x27')](respondWithResult(_0x413525,null))[_0xfdea('0x47')](handleError(_0x413525,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 28f6f10..3326286 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 _0x1f65=['moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api'];(function(_0x2773c5,_0x42519e){var _0x56814b=function(_0x3a6eb9){while(--_0x3a6eb9){_0x2773c5['push'](_0x2773c5['shift']());}};_0x56814b(++_0x42519e);}(_0x1f65,0x190));var _0x51f6=function(_0x305d8c,_0x153576){_0x305d8c=_0x305d8c-0x0;var _0x1e6143=_0x1f65[_0x305d8c];return _0x1e6143;};'use strict';var _=require(_0x51f6('0x0'));var util=require(_0x51f6('0x1'));var logger=require('../../config/logger')(_0x51f6('0x2'));var moment=require(_0x51f6('0x3'));var BPromise=require(_0x51f6('0x4'));var rp=require(_0x51f6('0x5'));var fs=require('fs');var path=require(_0x51f6('0x6'));var rimraf=require('rimraf');var config=require(_0x51f6('0x7'));var attributes=require(_0x51f6('0x8'));module['exports']=function(_0xc27b2e,_0x160601){return _0xc27b2e[_0x51f6('0x9')](_0x51f6('0xa'),attributes,{'tableName':_0x51f6('0xb'),'paranoid':![],'indexes':[{'name':_0x51f6('0xc'),'fields':[_0x51f6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8356=['bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','util','../../config/logger','api'];(function(_0x21e488,_0x335018){var _0x44d09b=function(_0x424f9e){while(--_0x424f9e){_0x21e488['push'](_0x21e488['shift']());}};_0x44d09b(++_0x335018);}(_0x8356,0x11d));var _0x6835=function(_0x3dd0b9,_0x1d6c92){_0x3dd0b9=_0x3dd0b9-0x0;var _0x4c0351=_0x8356[_0x3dd0b9];return _0x4c0351;};'use strict';var _=require('lodash');var util=require(_0x6835('0x0'));var logger=require(_0x6835('0x1'))(_0x6835('0x2'));var moment=require('moment');var BPromise=require(_0x6835('0x3'));var rp=require(_0x6835('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6835('0x5'));var config=require(_0x6835('0x6'));var attributes=require(_0x6835('0x7'));module[_0x6835('0x8')]=function(_0x27ce2f,_0x510323){return _0x27ce2f[_0x6835('0x9')](_0x6835('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6835('0xb'),'fields':[_0x6835('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 67d601b..f411451 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 _0xaef3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1a3522,_0x23c76a){var _0x196f33=function(_0x182fa9){while(--_0x182fa9){_0x1a3522['push'](_0x1a3522['shift']());}};_0x196f33(++_0x23c76a);}(_0xaef3,0x7d));var _0x3aef=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xaef3[_0x284807];return _0x50c774;};'use strict';var _=require(_0x3aef('0x0'));var util=require(_0x3aef('0x1'));var moment=require(_0x3aef('0x2'));var BPromise=require(_0x3aef('0x3'));var rs=require(_0x3aef('0x4'));var fs=require('fs');var Redis=require(_0x3aef('0x5'));var db=require(_0x3aef('0x6'))['db'];var utils=require(_0x3aef('0x7'));var logger=require(_0x3aef('0x8'))('rpc');var config=require(_0x3aef('0x9'));var jayson=require(_0x3aef('0xa'));var client=jayson[_0x3aef('0xb')][_0x3aef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5940cb,_0x2a6e62,_0x4e7d24){return new BPromise(function(_0x48bb29,_0x34e1e2){return client[_0x3aef('0xd')](_0x5940cb,_0x4e7d24)[_0x3aef('0xe')](function(_0x3c8651){logger[_0x3aef('0xf')](_0x3aef('0x10'),_0x2a6e62,'request\x20sent');logger[_0x3aef('0x11')](_0x3aef('0x12'),_0x2a6e62,_0x3aef('0x13'),JSON[_0x3aef('0x14')](_0x3c8651));if(_0x3c8651[_0x3aef('0x15')]){if(_0x3c8651['error'][_0x3aef('0x16')]===0x1f4){logger[_0x3aef('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x2a6e62,_0x3c8651['error'][_0x3aef('0x17')]);return _0x34e1e2(_0x3c8651[_0x3aef('0x15')][_0x3aef('0x17')]);}logger[_0x3aef('0x15')](_0x3aef('0x10'),_0x2a6e62,_0x3c8651[_0x3aef('0x15')][_0x3aef('0x17')]);return _0x48bb29(_0x3c8651[_0x3aef('0x15')][_0x3aef('0x17')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x2a6e62,'request\x20sent');_0x48bb29(_0x3c8651[_0x3aef('0x18')][_0x3aef('0x17')]);}})[_0x3aef('0x19')](function(_0x21ea2d){logger[_0x3aef('0x15')](_0x3aef('0x10'),_0x2a6e62,_0x21ea2d);_0x34e1e2(_0x21ea2d);});});} \ No newline at end of file +var _0xc547=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf07933,_0xa817b3){var _0x2117d8=function(_0x4104c6){while(--_0x4104c6){_0xf07933['push'](_0xf07933['shift']());}};_0x2117d8(++_0xa817b3);}(_0xc547,0x9f));var _0x7c54=function(_0x5de53f,_0x1dd71c){_0x5de53f=_0x5de53f-0x0;var _0x805946=_0xc547[_0x5de53f];return _0x805946;};'use strict';var _=require(_0x7c54('0x0'));var util=require('util');var moment=require(_0x7c54('0x1'));var BPromise=require(_0x7c54('0x2'));var rs=require(_0x7c54('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c54('0x4'))['db'];var utils=require(_0x7c54('0x5'));var logger=require('../../config/logger')(_0x7c54('0x6'));var config=require(_0x7c54('0x7'));var jayson=require(_0x7c54('0x8'));var client=jayson[_0x7c54('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ed10a,_0x21275b,_0xe282bd){return new BPromise(function(_0x17d309,_0x185606){return client[_0x7c54('0xa')](_0x5ed10a,_0xe282bd)['then'](function(_0x178ccf){logger['info'](_0x7c54('0xb'),_0x21275b,_0x7c54('0xc'));logger[_0x7c54('0xd')](_0x7c54('0xe'),_0x21275b,_0x7c54('0xc'),JSON[_0x7c54('0xf')](_0x178ccf));if(_0x178ccf['error']){if(_0x178ccf[_0x7c54('0x10')][_0x7c54('0x11')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x21275b,_0x178ccf[_0x7c54('0x10')][_0x7c54('0x12')]);return _0x185606(_0x178ccf[_0x7c54('0x10')][_0x7c54('0x12')]);}logger[_0x7c54('0x10')](_0x7c54('0xb'),_0x21275b,_0x178ccf['error']['message']);return _0x17d309(_0x178ccf[_0x7c54('0x10')][_0x7c54('0x12')]);}else{logger[_0x7c54('0x13')](_0x7c54('0xb'),_0x21275b,_0x7c54('0xc'));_0x17d309(_0x178ccf[_0x7c54('0x14')][_0x7c54('0x12')]);}})[_0x7c54('0x15')](function(_0x407834){logger[_0x7c54('0x10')](_0x7c54('0xb'),_0x21275b,_0x407834);_0x185606(_0x407834);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 0c31ec0..e145e0f 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 _0x85b1=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x32fe3a,_0x1235e9){var _0x597089=function(_0x421d2c){while(--_0x421d2c){_0x32fe3a['push'](_0x32fe3a['shift']());}};_0x597089(++_0x1235e9);}(_0x85b1,0x1d6));var _0x185b=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x85b1[_0x11c573];return _0x6b72de;};'use strict';var multer=require('multer');var util=require(_0x185b('0x0'));var path=require(_0x185b('0x1'));var timeout=require(_0x185b('0x2'));var express=require(_0x185b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x185b('0x4'));var interaction=require(_0x185b('0x5'));var config=require('../../config/environment');var controller=require(_0x185b('0x6'));router[_0x185b('0x7')]('/',auth[_0x185b('0x8')](),controller[_0x185b('0x9')]);router['get'](_0x185b('0xa'),auth[_0x185b('0x8')](),controller[_0x185b('0xb')]);router[_0x185b('0x7')](_0x185b('0xc'),auth[_0x185b('0x8')](),controller[_0x185b('0xd')]);router[_0x185b('0xe')]('/',auth[_0x185b('0x8')](),controller['create']);router[_0x185b('0xf')](_0x185b('0xc'),auth[_0x185b('0x8')](),controller['update']);router['delete']('/:id',auth[_0x185b('0x8')](),controller[_0x185b('0x10')]);module[_0x185b('0x11')]=router; \ No newline at end of file +var _0x0f80=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1e3c2a,_0x33acf3){var _0x10fa0c=function(_0x798e09){while(--_0x798e09){_0x1e3c2a['push'](_0x1e3c2a['shift']());}};_0x10fa0c(++_0x33acf3);}(_0x0f80,0x108));var _0x00f8=function(_0x2fa2db,_0x1f9532){_0x2fa2db=_0x2fa2db-0x0;var _0xcb4fbb=_0x0f80[_0x2fa2db];return _0xcb4fbb;};'use strict';var multer=require('multer');var util=require(_0x00f8('0x0'));var path=require(_0x00f8('0x1'));var timeout=require(_0x00f8('0x2'));var express=require(_0x00f8('0x3'));var router=express[_0x00f8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x00f8('0x5'));var interaction=require(_0x00f8('0x6'));var config=require(_0x00f8('0x7'));var controller=require('./chatTransferReport.controller');router[_0x00f8('0x8')]('/',auth[_0x00f8('0x9')](),controller[_0x00f8('0xa')]);router[_0x00f8('0x8')](_0x00f8('0xb'),auth[_0x00f8('0x9')](),controller[_0x00f8('0xc')]);router['get'](_0x00f8('0xd'),auth[_0x00f8('0x9')](),controller[_0x00f8('0xe')]);router['post']('/',auth[_0x00f8('0x9')](),controller[_0x00f8('0xf')]);router[_0x00f8('0x10')](_0x00f8('0xd'),auth[_0x00f8('0x9')](),controller['update']);router['delete'](_0x00f8('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x00f8('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index cee8a5a..3ecccf1 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 _0x8b31=['randomstring','exports','STRING','address','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','thumb','star','stringify','text','name','input','email','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x3a6b88,_0x3914be){var _0x520c3f=function(_0x163e7d){while(--_0x163e7d){_0x3a6b88['push'](_0x3a6b88['shift']());}};_0x520c3f(++_0x3914be);}(_0x8b31,0x1c1));var _0x18b3=function(_0x2e039e,_0x52ec27){_0x2e039e=_0x2e039e-0x0;var _0x55f89c=_0x8b31[_0x2e039e];return _0x55f89c;};'use strict';var Sequelize=require(_0x18b3('0x0'));var rs=require(_0x18b3('0x1'));module[_0x18b3('0x2')]={'name':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![],'unique':_0x18b3('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![],'defaultValue':_0x18b3('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![],'defaultValue':_0x18b3('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![],'defaultValue':_0x18b3('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x18b3('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x18b3('0x9')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0xa')},'start_chat_button':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0xb')},'offline_chat_button':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0xc')},'download_transcript':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x18b3('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x18b3('0xd')]},'closingQuestion':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0xf')},'noteTitle':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x10')},'placeholderMessage':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x11')},'closingMessage':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x12')},'closingMessageButton':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x13')},'skipMessageButton':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x18b3('0x9')]('star',_0x18b3('0x15')),'defaultValue':_0x18b3('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x18b3('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x18b3('0xd')],'defaultValue':function(){return JSON[_0x18b3('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0x18b3('0x18'),'required':!![]},'props':{'title':_0x18b3('0x19'),'helpText':''}},{'type':_0x18b3('0x1a'),'props':{'title':_0x18b3('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x18b3('0x1b'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x18b3('0x1c')](_0x18b3('0x1d'))?JSON[_0x18b3('0x1e')](this['getDataValue']('onlineForm')):{};},'set':function(_0x25ea21){return this[_0x18b3('0x1f')]('onlineForm',JSON[_0x18b3('0x17')](_0x25ea21));}},'offlineForm':{'type':Sequelize[_0x18b3('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x18b3('0x1a'),'props':{'title':_0x18b3('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x18b3('0x1b'),'type':'email'},'variable':null},{'type':_0x18b3('0x20'),'config':{'placeholder':_0x18b3('0x21')},'props':{'title':_0x18b3('0x21'),'helpText':_0x18b3('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x18b3('0x1c')](_0x18b3('0x23'))?JSON[_0x18b3('0x1e')](this[_0x18b3('0x1c')](_0x18b3('0x23'))):{};},'set':function(_0x46d0b6){return this[_0x18b3('0x1f')](_0x18b3('0x23'),JSON[_0x18b3('0x17')](_0x46d0b6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x18b3('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x18b3('0x25')},'offlineMessageBody':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x27')},'skipUnmanaged':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x14')},'sendUnmanaged':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x13')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x18b3('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x18b3('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x18b3('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x18b3('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x2a')},'defaultTitle':{'type':Sequelize[_0x18b3('0x3')]},'customerAvatar':{'type':Sequelize[_0x18b3('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x18b3('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![],'defaultValue':_0x18b3('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x18b3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':_0x18b3('0x2c')},'systemAvatar':{'type':Sequelize[_0x18b3('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x18b3('0x7')],'comment':_0x18b3('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![],'comment':_0x18b3('0x2e'),'set':function(_0x4f1763){if(!_0x4f1763)this[_0x18b3('0x1f')](_0x18b3('0x2f'),null);this[_0x18b3('0x1f')]('mandatoryDisposition',_0x4f1763);}},'vidaooEscalation':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x18b3('0x3')]},'vidaooTopic':{'type':Sequelize[_0x18b3('0x3')],'allowNull':![],'defaultValue':_0x18b3('0x30')},'vidaooNote':{'type':Sequelize[_0x18b3('0x3')],'defaultValue':function(){return _0x18b3('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x18b3('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x18b3('0xd')]}}; \ No newline at end of file +var _0x5a9a=['Send','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Skip','Feedback','star','TEXT','stringify','name','text','input','onlineForm','parse','getDataValue','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','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a9a,0x1c9));var _0xa5a9=function(_0x2504b3,_0x1c24d2){_0x2504b3=_0x2504b3-0x0;var _0x14f6c5=_0x5a9a[_0x2504b3];return _0x14f6c5;};'use strict';var Sequelize=require(_0xa5a9('0x0'));var rs=require(_0xa5a9('0x1'));module[_0xa5a9('0x2')]={'name':{'type':Sequelize[_0xa5a9('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xa5a9('0x3')],'allowNull':![],'unique':_0xa5a9('0x4')},'description':{'type':Sequelize[_0xa5a9('0x3')]},'mapKey':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x5')},'mapKeyOffline':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xa5a9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x6')},'customerAlias':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa5a9('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa5a9('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa5a9('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa5a9('0x3')]},'animation':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa5a9('0xb')]('rounded','squared'),'defaultValue':_0xa5a9('0xc')},'header_online':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0xd')},'header_offline':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa5a9('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa5a9('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x10')},'placeholderMessage':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa5a9('0x12')},'ratingType':{'type':Sequelize[_0xa5a9('0xb')](_0xa5a9('0x13'),'thumb'),'defaultValue':_0xa5a9('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xa5a9('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa5a9('0x14')],'defaultValue':function(){return JSON[_0xa5a9('0x15')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xa5a9('0x16'),'type':_0xa5a9('0x17'),'required':!![]},'props':{'title':_0xa5a9('0x16'),'helpText':''}},{'type':_0xa5a9('0x18'),'props':{'title':_0xa5a9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa5a9('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa5a9('0x19'))?JSON[_0xa5a9('0x1a')](this[_0xa5a9('0x1b')]('onlineForm')):{};},'set':function(_0x1302fe){return this[_0xa5a9('0x1c')](_0xa5a9('0x19'),JSON[_0xa5a9('0x15')](_0x1302fe));}},'offlineForm':{'type':Sequelize[_0xa5a9('0x14')],'defaultValue':function(){return JSON[_0xa5a9('0x15')]({'items':[{'type':_0xa5a9('0x18'),'props':{'title':_0xa5a9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa5a9('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa5a9('0x1d')},'props':{'title':_0xa5a9('0x1d'),'helpText':_0xa5a9('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xa5a9('0x1b')](_0xa5a9('0x1f'))?JSON[_0xa5a9('0x1a')](this[_0xa5a9('0x1b')](_0xa5a9('0x1f'))):{};},'set':function(_0x1dfc5d){return this[_0xa5a9('0x1c')](_0xa5a9('0x1f'),JSON[_0xa5a9('0x15')](_0x1dfc5d));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa5a9('0x20')]();}},'autoclose':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa5a9('0x3')]},'forwardOffline':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x21')},'waitingMessage':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x23')},'offlineMessageBody':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xa5a9('0x11')},'sendUnmanaged':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa5a9('0x14')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa5a9('0x14')],'defaultValue':function(){return _0xa5a9('0x26');}},'notificationSound':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa5a9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x28')},'defaultTitle':{'type':Sequelize[_0xa5a9('0x3')]},'customerAvatar':{'type':Sequelize[_0xa5a9('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa5a9('0x3')],'allowNull':![],'defaultValue':_0xa5a9('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa5a9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa5a9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x2a')},'systemAvatar':{'type':Sequelize[_0xa5a9('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa5a9('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![],'comment':_0xa5a9('0x2b'),'set':function(_0x40f159){if(!_0x40f159)this[_0xa5a9('0x1c')](_0xa5a9('0x2c'),null);this[_0xa5a9('0x1c')](_0xa5a9('0x2d'),_0x40f159);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa5a9('0x3')]},'vidaooTopic':{'type':Sequelize[_0xa5a9('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':function(){return _0xa5a9('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0xa5a9('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa5a9('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 3de2376..db50898 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 _0x22ca=['render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','textColor','color_button','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','ChatWebsite','findAll','rows','show','params','include','find','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','custom','isNil','sitepic','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','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','account','Applications','list','applications','orderBy','priority','asc','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8'];(function(_0x3b7df5,_0x12330d){var _0x244e29=function(_0x41ee5e){while(--_0x41ee5e){_0x3b7df5['push'](_0x3b7df5['shift']());}};_0x244e29(++_0x12330d);}(_0x22ca,0x198));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa22c('0x0'));var zipdir=require(_0xa22c('0x1'));var jsonpatch=require(_0xa22c('0x2'));var rp=require(_0xa22c('0x3'));var moment=require(_0xa22c('0x4'));var BPromise=require(_0xa22c('0x5'));var Mustache=require('mustache');var util=require(_0xa22c('0x6'));var path=require(_0xa22c('0x7'));var sox=require(_0xa22c('0x8'));var csv=require(_0xa22c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa22c('0xa'));var _=require('lodash');var squel=require(_0xa22c('0xb'));var crypto=require('crypto');var jsforce=require(_0xa22c('0xc'));var deskjs=require(_0xa22c('0xd'));var toCsv=require(_0xa22c('0x9'));var querystring=require(_0xa22c('0xe'));var Papa=require(_0xa22c('0xf'));var Redis=require(_0xa22c('0x10'));var authService=require(_0xa22c('0x11'));var qs=require(_0xa22c('0x12'));var as=require(_0xa22c('0x13'));var hardwareService=require(_0xa22c('0x14'));var logger=require(_0xa22c('0x15'))(_0xa22c('0x16'));var utils=require(_0xa22c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa22c('0x18'));var db=require('../../mysqldb')['db'];config[_0xa22c('0x19')]=_['defaults'](config['redis'],{'host':_0xa22c('0x1a'),'port':0x18eb});var socket=require(_0xa22c('0x1b'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xa22c('0x1c')](socket);var jayson=require(_0xa22c('0x1d'));var client=jayson[_0xa22c('0x1e')][_0xa22c('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xa22c('0x1f')]({'port':0x232a});var client9003=jayson[_0xa22c('0x1e')][_0xa22c('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0xa22c('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x46c9ed,_0x1146b2,_0x20a503,_0x3211d6){return new BPromise(function(_0x49446b,_0x191847){var _0x4a0e80=_0x3211d6||client;return _0x4a0e80['request'](_0x46c9ed,_0x20a503)['then'](function(_0x585b84){logger[_0xa22c('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x1146b2,'request\x20sent');logger[_0xa22c('0x21')](_0xa22c('0x22'),_0x1146b2,'request\x20sent',JSON[_0xa22c('0x23')](_0x585b84));if(_0x585b84[_0xa22c('0x24')]){if(_0x585b84[_0xa22c('0x24')][_0xa22c('0x25')]===0x1f4){logger[_0xa22c('0x24')](_0xa22c('0x26'),_0x1146b2,_0x585b84['error'][_0xa22c('0x27')]);return _0x191847(_0x585b84[_0xa22c('0x24')][_0xa22c('0x27')]);}logger[_0xa22c('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x1146b2,_0x585b84[_0xa22c('0x24')]['message']);return _0x49446b(_0x585b84['error']['message']);}else{logger[_0xa22c('0x20')](_0xa22c('0x26'),_0x1146b2,_0xa22c('0x28'));_0x49446b(_0x585b84[_0xa22c('0x29')]['message']);}})[_0xa22c('0x2a')](function(_0x517b24){logger[_0xa22c('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x1146b2,_0x517b24);_0x191847(_0x517b24);});});}function respondWithStatusCode(_0x4c5f38,_0x3c1249){_0x3c1249=_0x3c1249||0xcc;return function(_0x1b6805){if(_0x1b6805){return _0x4c5f38[_0xa22c('0x2b')](_0x3c1249);}return _0x4c5f38[_0xa22c('0x2c')](_0x3c1249)[_0xa22c('0x2d')]();};}function respondWithResult(_0x414228,_0x144290){_0x144290=_0x144290||0xc8;return function(_0x5bd9ab){if(_0x5bd9ab){return _0x414228['status'](_0x144290)[_0xa22c('0x2e')](_0x5bd9ab);}};}function respondWithFilteredResult(_0x488225,_0x13a8a4){return function(_0x575a14){if(_0x575a14){var _0x4fbf55=typeof _0x13a8a4['offset']===_0xa22c('0x2f')&&typeof _0x13a8a4[_0xa22c('0x30')]===_0xa22c('0x2f');var _0x395348=_0x575a14[_0xa22c('0x31')];var _0x18cd7a=_0x4fbf55?0x0:_0x13a8a4[_0xa22c('0x32')];var _0x3ac7f2=_0x4fbf55?_0x575a14['count']:_0x13a8a4['offset']+_0x13a8a4[_0xa22c('0x30')];var _0xb5332e;if(_0x3ac7f2>=_0x395348){_0x3ac7f2=_0x395348;_0xb5332e=0xc8;}else{_0xb5332e=0xce;}_0x488225[_0xa22c('0x2c')](_0xb5332e);return _0x488225[_0xa22c('0x33')](_0xa22c('0x34'),_0x18cd7a+'-'+_0x3ac7f2+'/'+_0x395348)['json'](_0x575a14);}return null;};}function patchUpdates(_0x49abe3){return function(_0x44039f){try{jsonpatch[_0xa22c('0x35')](_0x44039f,_0x49abe3,!![]);}catch(_0x1f4304){return BPromise[_0xa22c('0x36')](_0x1f4304);}return _0x44039f[_0xa22c('0x37')]();};}function saveUpdates(_0x762141,_0x1a7b77){return function(_0x5a4d5f){if(_0x5a4d5f){return _0x5a4d5f[_0xa22c('0x38')](_0x762141)[_0xa22c('0x39')](function(_0x534911){return _0x534911;});}return null;};}function removeEntity(_0x4a7236,_0x311a0f){return function(_0x34a87c){if(_0x34a87c){return _0x34a87c[_0xa22c('0x3a')]()[_0xa22c('0x39')](function(){var _0x56bf89=_0x34a87c[_0xa22c('0x3b')]({'plain':!![]});var _0x152861=_0xa22c('0x3c');return db[_0xa22c('0x3d')]['destroy']({'where':{'type':_0x152861,'resourceId':_0x56bf89['id']}})[_0xa22c('0x39')](function(){return _0x34a87c;});})[_0xa22c('0x39')](function(){_0x4a7236['status'](0xcc)[_0xa22c('0x2d')]();});}};}function handleEntityNotFound(_0x3e389d,_0x1d5664){return function(_0x447d92){if(!_0x447d92){_0x3e389d[_0xa22c('0x2b')](0x194);}return _0x447d92;};}function handleError(_0x15891e,_0x1f907b){_0x1f907b=_0x1f907b||0x1f4;return function(_0x3e2bc5){logger[_0xa22c('0x24')](_0x3e2bc5[_0xa22c('0x3e')]);if(_0x3e2bc5[_0xa22c('0x3f')]){delete _0x3e2bc5[_0xa22c('0x3f')];}_0x15891e[_0xa22c('0x2c')](_0x1f907b)[_0xa22c('0x40')](_0x3e2bc5);};}exports['index']=function(_0xf3e352,_0x4fea12){var _0xba0f8f={'include':[{'model':db[_0xa22c('0x41')],'as':_0xa22c('0x42')}]},_0x437ce5={},_0x5f052c={'count':0x0,'rows':[]};var _0x449559=_[_0xa22c('0x43')](db['ChatWebsite'][_0xa22c('0x44')],function(_0x593d29){return{'name':_0x593d29[_0xa22c('0x45')],'type':_0x593d29[_0xa22c('0x46')][_0xa22c('0x47')]};});_0x437ce5[_0xa22c('0x48')]=_[_0xa22c('0x43')](_0x449559,_0xa22c('0x3f'));_0x437ce5[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0xf3e352[_0xa22c('0x49')]);_0x437ce5['filters']=_[_0xa22c('0x4b')](_0x437ce5[_0xa22c('0x48')],_0x437ce5[_0xa22c('0x49')]);_0xba0f8f[_0xa22c('0x4c')]=_[_0xa22c('0x4b')](_0x437ce5[_0xa22c('0x48')],qs[_0xa22c('0x4d')](_0xf3e352[_0xa22c('0x49')][_0xa22c('0x4d')]));_0xba0f8f[_0xa22c('0x4c')]=_0xba0f8f['attributes'][_0xa22c('0x4e')]?_0xba0f8f[_0xa22c('0x4c')]:_0x437ce5[_0xa22c('0x48')];if(!_0xf3e352[_0xa22c('0x49')][_0xa22c('0x4f')](_0xa22c('0x50'))){_0xba0f8f[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0xf3e352[_0xa22c('0x49')]['limit']);_0xba0f8f[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0xf3e352[_0xa22c('0x49')][_0xa22c('0x32')]);}_0xba0f8f[_0xa22c('0x51')]=qs[_0xa22c('0x52')](_0xf3e352[_0xa22c('0x49')][_0xa22c('0x52')]);_0xba0f8f[_0xa22c('0x53')]=qs[_0xa22c('0x54')](_['pick'](_0xf3e352[_0xa22c('0x49')],_0x437ce5['filters']),_0x449559);if(_0xf3e352[_0xa22c('0x49')][_0xa22c('0x55')]){_0xba0f8f[_0xa22c('0x53')]=_['merge'](_0xba0f8f[_0xa22c('0x53')],{'$or':_[_0xa22c('0x43')](_0x449559,function(_0x2e1d3b){if(_0x2e1d3b['type']!=='VIRTUAL'){var _0x54741c={};_0x54741c[_0x2e1d3b[_0xa22c('0x3f')]]={'$like':'%'+_0xf3e352[_0xa22c('0x49')]['filter']+'%'};return _0x54741c;}})});}_0xba0f8f=_[_0xa22c('0x56')]({},_0xba0f8f,_0xf3e352[_0xa22c('0x57')]);var _0x9698d1={'where':_0xba0f8f[_0xa22c('0x53')]};return db['ChatWebsite'][_0xa22c('0x31')](_0x9698d1)[_0xa22c('0x39')](function(_0x28d6cc){_0x5f052c[_0xa22c('0x31')]=_0x28d6cc;if(_0xf3e352[_0xa22c('0x49')][_0xa22c('0x58')]){_0xba0f8f['include']=[{'all':!![]}];}return db[_0xa22c('0x59')][_0xa22c('0x5a')](_0xba0f8f);})[_0xa22c('0x39')](function(_0x23c868){_0x5f052c[_0xa22c('0x5b')]=_0x23c868;return _0x5f052c;})['then'](respondWithFilteredResult(_0x4fea12,_0xba0f8f))['catch'](handleError(_0x4fea12,null));};exports[_0xa22c('0x5c')]=function(_0x467cb0,_0x420b1f){var _0x5baa7a={'raw':![],'where':{'id':_0x467cb0[_0xa22c('0x5d')]['id']},'include':[{'model':db[_0xa22c('0x41')],'as':_0xa22c('0x42')}]},_0x4566f4={};_0x4566f4[_0xa22c('0x48')]=_[_0xa22c('0x4a')](db['ChatWebsite'][_0xa22c('0x44')]);_0x4566f4[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0x467cb0[_0xa22c('0x49')]);_0x4566f4[_0xa22c('0x54')]=_[_0xa22c('0x4b')](_0x4566f4[_0xa22c('0x48')],_0x4566f4['query']);_0x5baa7a['attributes']=_[_0xa22c('0x4b')](_0x4566f4['model'],qs[_0xa22c('0x4d')](_0x467cb0['query']['fields']));_0x5baa7a['attributes']=_0x5baa7a[_0xa22c('0x4c')][_0xa22c('0x4e')]?_0x5baa7a['attributes']:_0x4566f4[_0xa22c('0x48')];if(_0x467cb0[_0xa22c('0x49')][_0xa22c('0x58')]){_0x5baa7a[_0xa22c('0x5e')]=[{'all':!![]}];}_0x5baa7a=_[_0xa22c('0x56')]({},_0x5baa7a,_0x467cb0[_0xa22c('0x57')]);return db[_0xa22c('0x59')][_0xa22c('0x5f')](_0x5baa7a)['then'](handleEntityNotFound(_0x420b1f,null))[_0xa22c('0x39')](respondWithResult(_0x420b1f,null))['catch'](handleError(_0x420b1f,null));};exports['create']=function(_0x43ed81,_0x756432){return db['ChatWebsite'][_0xa22c('0x60')](_0x43ed81[_0xa22c('0x61')],{})[_0xa22c('0x39')](function(_0x28c32f){var _0x3a0921=_0x43ed81['user'][_0xa22c('0x3b')]({'plain':!![]});if(!_0x3a0921)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a0921[_0xa22c('0x62')]===_0xa22c('0x63')){var _0x544b9d=_0x28c32f['get']({'plain':!![]});var _0x55cc9a=_0xa22c('0x3c');return db[_0xa22c('0x64')][_0xa22c('0x5f')]({'where':{'name':_0x55cc9a,'userProfileId':_0x3a0921['userProfileId']},'raw':!![]})['then'](function(_0x4013b3){if(_0x4013b3&&_0x4013b3['autoAssociation']===0x0){return db[_0xa22c('0x3d')][_0xa22c('0x60')]({'name':_0x544b9d['name'],'resourceId':_0x544b9d['id'],'type':_0x4013b3[_0xa22c('0x3f')],'sectionId':_0x4013b3['id']},{})[_0xa22c('0x39')](function(){return _0x28c32f;});}else{return _0x28c32f;}})[_0xa22c('0x2a')](function(_0x1a14dc){logger[_0xa22c('0x24')](_0xa22c('0x65'),_0x1a14dc);throw _0x1a14dc;});}return _0x28c32f;})[_0xa22c('0x39')](respondWithResult(_0x756432,0xc9))[_0xa22c('0x2a')](handleError(_0x756432,null));};exports[_0xa22c('0x38')]=function(_0x351e01,_0x377051){if(_0x351e01['body']['id']){delete _0x351e01[_0xa22c('0x61')]['id'];}return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'where':{'id':_0x351e01[_0xa22c('0x5d')]['id']},'include':[{'model':db[_0xa22c('0x41')],'as':_0xa22c('0x42')}]})[_0xa22c('0x39')](handleEntityNotFound(_0x377051,null))[_0xa22c('0x39')](saveUpdates(_0x351e01[_0xa22c('0x61')],null))['then'](respondWithResult(_0x377051,null))[_0xa22c('0x2a')](handleError(_0x377051,null));};exports[_0xa22c('0x3a')]=function(_0x58486a,_0x417d1a){return db[_0xa22c('0x59')]['find']({'where':{'id':_0x58486a['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x417d1a,null))[_0xa22c('0x39')](removeEntity(_0x417d1a,null))['catch'](handleError(_0x417d1a,null));};exports[_0xa22c('0x66')]=function(_0x505f8c,_0x13fd33){return db[_0xa22c('0x59')][_0xa22c('0x66')]()['then'](respondWithResult(_0x13fd33,null))['catch'](handleError(_0x13fd33,null));};exports[_0xa22c('0x67')]=function(_0x422f9f,_0x1402a1,_0x56cee){if(_0x422f9f[_0xa22c('0x61')]['id']){delete _0x422f9f[_0xa22c('0x61')]['id'];}return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x422f9f[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x1402a1,null))['then'](function(_0x2a5949){if(_0x2a5949){_0x422f9f['body'][_0xa22c('0x68')]=_0x2a5949['id'];return db[_0xa22c('0x69')][_0xa22c('0x60')](_0x422f9f[_0xa22c('0x61')]);}})[_0xa22c('0x39')](respondWithResult(_0x1402a1,null))['catch'](handleError(_0x1402a1,null));};exports[_0xa22c('0x6a')]=function(_0x55e5b9,_0x267f41,_0x68725e){var _0x42e6b1={'raw':![],'where':{}};var _0x416ec7={};var _0x2961c8={'count':0x0,'rows':[]};return db[_0xa22c('0x59')][_0xa22c('0x6b')]({'where':{'id':_0x55e5b9['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x267f41,null))[_0xa22c('0x39')](function(_0x58a8b8){if(_0x58a8b8){_0x416ec7['model']=_[_0xa22c('0x4a')](db[_0xa22c('0x69')][_0xa22c('0x44')]);_0x416ec7[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0x55e5b9[_0xa22c('0x49')]);_0x416ec7['filters']=_[_0xa22c('0x4b')](_0x416ec7['model'],_0x416ec7[_0xa22c('0x49')]);_0x42e6b1[_0xa22c('0x4c')]=_[_0xa22c('0x4b')](_0x416ec7[_0xa22c('0x48')],qs[_0xa22c('0x4d')](_0x55e5b9[_0xa22c('0x49')][_0xa22c('0x4d')]));_0x42e6b1[_0xa22c('0x4c')]=_0x42e6b1[_0xa22c('0x4c')]['length']?_0x42e6b1[_0xa22c('0x4c')]:_0x416ec7[_0xa22c('0x48')];if(!_0x55e5b9[_0xa22c('0x49')][_0xa22c('0x4f')](_0xa22c('0x50'))){_0x42e6b1[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x55e5b9[_0xa22c('0x49')]['limit']);_0x42e6b1[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0x55e5b9['query'][_0xa22c('0x32')]);}_0x42e6b1[_0xa22c('0x51')]=qs[_0xa22c('0x52')](_0x55e5b9[_0xa22c('0x49')][_0xa22c('0x52')]);_0x42e6b1[_0xa22c('0x53')]=qs['filters'](_['pick'](_0x55e5b9['query'],_0x416ec7[_0xa22c('0x54')]));_0x42e6b1['where'][_0xa22c('0x68')]=_0x58a8b8['id'];if(_0x55e5b9[_0xa22c('0x49')][_0xa22c('0x55')]){_0x42e6b1['where']=_[_0xa22c('0x56')](_0x42e6b1[_0xa22c('0x53')],{'$or':_['map'](_0x42e6b1[_0xa22c('0x4c')],function(_0x33701e){var _0x1981fd={};_0x1981fd[_0x33701e]={'$like':'%'+_0x55e5b9['query'][_0xa22c('0x55')]+'%'};return _0x1981fd;})});}_0x42e6b1=_[_0xa22c('0x56')]({},_0x42e6b1,_0x55e5b9[_0xa22c('0x57')]);return db[_0xa22c('0x69')][_0xa22c('0x31')]({'where':_0x42e6b1[_0xa22c('0x53')]})[_0xa22c('0x39')](function(_0x4918dd){_0x2961c8[_0xa22c('0x31')]=_0x4918dd;if(_0x55e5b9[_0xa22c('0x49')]['includeAll']){_0x42e6b1['include']=[{'all':!![]}];}return db['Disposition'][_0xa22c('0x5a')](_0x42e6b1);})[_0xa22c('0x39')](function(_0x2e91a3){_0x2961c8[_0xa22c('0x5b')]=_0x2e91a3;return _0x2961c8;});}})[_0xa22c('0x39')](respondWithFilteredResult(_0x267f41,_0x42e6b1))[_0xa22c('0x2a')](handleError(_0x267f41,null));};exports[_0xa22c('0x6c')]=function(_0x4b0a5b,_0x3eec96,_0x406d51){return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x4b0a5b[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x3eec96,null))[_0xa22c('0x39')](function(_0x3327b6){if(_0x3327b6){return _0x3327b6[_0xa22c('0x6c')](_0x4b0a5b[_0xa22c('0x49')][_0xa22c('0x6d')]);}})[_0xa22c('0x39')](respondWithStatusCode(_0x3eec96,null))[_0xa22c('0x2a')](handleError(_0x3eec96,null));};exports[_0xa22c('0x6e')]=function(_0x2edb19,_0x5736ba,_0x54b290){if(_0x2edb19[_0xa22c('0x61')]['id']){delete _0x2edb19['body']['id'];}return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'where':{'id':_0x2edb19['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x5736ba,null))[_0xa22c('0x39')](function(_0x2d6056){if(_0x2d6056){_0x2edb19[_0xa22c('0x61')][_0xa22c('0x68')]=_0x2d6056['id'];return db[_0xa22c('0x6f')][_0xa22c('0x60')](_0x2edb19['body']);}})[_0xa22c('0x39')](respondWithResult(_0x5736ba,null))['catch'](handleError(_0x5736ba,null));};exports['getAnswers']=function(_0x4bec18,_0x48330b,_0x422ed9){var _0x1291d9={'raw':![],'where':{}};var _0xf677fc={};var _0x4b039b={'count':0x0,'rows':[]};return db[_0xa22c('0x59')][_0xa22c('0x6b')]({'where':{'id':_0x4bec18[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x48330b,null))[_0xa22c('0x39')](function(_0x36b5e6){if(_0x36b5e6){_0xf677fc[_0xa22c('0x48')]=_[_0xa22c('0x4a')](db[_0xa22c('0x6f')][_0xa22c('0x44')]);_0xf677fc[_0xa22c('0x49')]=_['keys'](_0x4bec18[_0xa22c('0x49')]);_0xf677fc[_0xa22c('0x54')]=_['intersection'](_0xf677fc[_0xa22c('0x48')],_0xf677fc[_0xa22c('0x49')]);_0x1291d9[_0xa22c('0x4c')]=_[_0xa22c('0x4b')](_0xf677fc[_0xa22c('0x48')],qs[_0xa22c('0x4d')](_0x4bec18[_0xa22c('0x49')][_0xa22c('0x4d')]));_0x1291d9['attributes']=_0x1291d9[_0xa22c('0x4c')][_0xa22c('0x4e')]?_0x1291d9[_0xa22c('0x4c')]:_0xf677fc[_0xa22c('0x48')];if(!_0x4bec18[_0xa22c('0x49')]['hasOwnProperty'](_0xa22c('0x50'))){_0x1291d9[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x4bec18['query']['limit']);_0x1291d9[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0x4bec18[_0xa22c('0x49')][_0xa22c('0x32')]);}_0x1291d9[_0xa22c('0x51')]=qs[_0xa22c('0x52')](_0x4bec18[_0xa22c('0x49')][_0xa22c('0x52')]);_0x1291d9[_0xa22c('0x53')]=qs['filters'](_[_0xa22c('0x70')](_0x4bec18[_0xa22c('0x49')],_0xf677fc[_0xa22c('0x54')]));_0x1291d9[_0xa22c('0x53')][_0xa22c('0x68')]=_0x36b5e6['id'];if(_0x4bec18[_0xa22c('0x49')][_0xa22c('0x55')]){_0x1291d9['where']=_[_0xa22c('0x56')](_0x1291d9[_0xa22c('0x53')],{'$or':_[_0xa22c('0x43')](_0x1291d9[_0xa22c('0x4c')],function(_0x31061d){var _0x362583={};_0x362583[_0x31061d]={'$like':'%'+_0x4bec18[_0xa22c('0x49')][_0xa22c('0x55')]+'%'};return _0x362583;})});}_0x1291d9=_[_0xa22c('0x56')]({},_0x1291d9,_0x4bec18[_0xa22c('0x57')]);return db['CannedAnswer'][_0xa22c('0x31')]({'where':_0x1291d9['where']})['then'](function(_0x419423){_0x4b039b['count']=_0x419423;if(_0x4bec18[_0xa22c('0x49')][_0xa22c('0x58')]){_0x1291d9[_0xa22c('0x5e')]=[{'all':!![]}];}return db[_0xa22c('0x6f')][_0xa22c('0x5a')](_0x1291d9);})['then'](function(_0x3e8869){_0x4b039b[_0xa22c('0x5b')]=_0x3e8869;return _0x4b039b;});}})[_0xa22c('0x39')](respondWithFilteredResult(_0x48330b,_0x1291d9))['catch'](handleError(_0x48330b,null));};exports[_0xa22c('0x71')]=function(_0x51bd80,_0x5d28ef,_0x59284b){return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x51bd80['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x5d28ef,null))[_0xa22c('0x39')](function(_0x3afac9){if(_0x3afac9){return _0x3afac9[_0xa22c('0x71')](_0x51bd80[_0xa22c('0x49')][_0xa22c('0x6d')]);}})['then'](respondWithStatusCode(_0x5d28ef,null))[_0xa22c('0x2a')](handleError(_0x5d28ef,null));};exports[_0xa22c('0x72')]=function(_0xe2970a,_0x35b960,_0x38deac){_0xe2970a[_0xa22c('0x61')]['sitepic']=_0xe2970a[_0xa22c('0x73')][_0xa22c('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0xe2970a[_0xa22c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x35b960,null))[_0xa22c('0x39')](saveUpdates(_0xe2970a[_0xa22c('0x61')],null))[_0xa22c('0x39')](respondWithResult(_0x35b960,null))[_0xa22c('0x2a')](handleError(_0x35b960,null));};exports[_0xa22c('0x75')]=function(_0x19d0e7,_0x49f593,_0x141e4d){_0x19d0e7[_0xa22c('0x61')][_0xa22c('0x76')]=_0x19d0e7[_0xa22c('0x73')]['filename'];return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'where':{'id':_0x19d0e7['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x49f593,null))[_0xa22c('0x39')](saveUpdates(_0x19d0e7[_0xa22c('0x61')],null))[_0xa22c('0x39')](respondWithResult(_0x49f593,null))[_0xa22c('0x2a')](handleError(_0x49f593,null));};exports['addCustomerAvatar']=function(_0x24ffc9,_0x47a6bf,_0x32f30f){_0x24ffc9[_0xa22c('0x61')][_0xa22c('0x77')]=_0x24ffc9[_0xa22c('0x73')][_0xa22c('0x74')];return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x24ffc9[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x47a6bf,null))['then'](saveUpdates(_0x24ffc9[_0xa22c('0x61')],null))[_0xa22c('0x39')](respondWithResult(_0x47a6bf,null))['catch'](handleError(_0x47a6bf,null));};exports[_0xa22c('0x78')]=function(_0x120ddd,_0xeb1241,_0x10224a){_0x120ddd[_0xa22c('0x61')][_0xa22c('0x79')]=_0x120ddd[_0xa22c('0x73')][_0xa22c('0x74')];return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x120ddd[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0xeb1241,null))[_0xa22c('0x39')](saveUpdates(_0x120ddd['body'],null))[_0xa22c('0x39')](respondWithResult(_0xeb1241,null))[_0xa22c('0x2a')](handleError(_0xeb1241,null));};exports[_0xa22c('0x7a')]=function(_0x21817f,_0x24a6f4,_0x17db13){var _0x25d4a1=path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],'server/files/images/logos/default_logo.svg');var _0x6786db={'where':{'id':_0x21817f['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4f832f=![];return require(_0xa22c('0x18'))[_0xa22c('0x7d')]()[_0xa22c('0x39')](function(_0x238fa9){if(_0x238fa9){_0x4f832f=_0x238fa9[_0xa22c('0x7e')];}})[_0xa22c('0x39')](function(){return db[_0xa22c('0x59')][_0xa22c('0x5f')](_0x6786db);})[_0xa22c('0x39')](handleEntityNotFound(_0x24a6f4,null))[_0xa22c('0x39')](function(_0x6c7ec2){if(_0x6c7ec2){if(!_[_0xa22c('0x7f')](_0x6c7ec2[_0xa22c('0x80')])){if(fs['existsSync'](path['join'](config[_0xa22c('0x7c')],'server/files/images/logos/',_0x6c7ec2[_0xa22c('0x80')]))&&_0x4f832f){_0x25d4a1=path[_0xa22c('0x7b')](config['root'],_0xa22c('0x81'),_0x6c7ec2['sitepic']);}}return _0x24a6f4['download'](_0x25d4a1);}})['catch'](handleError(_0x24a6f4,null));};exports[_0xa22c('0x82')]=function(_0x42518e,_0x252261,_0x2455ec){var _0x4e85f2=path['join'](config[_0xa22c('0x7c')],_0xa22c('0x83'));var _0x128fe0={'where':{'id':_0x42518e['params']['id']},'attributes':['id',_0xa22c('0x76')],'raw':!![]};return db[_0xa22c('0x59')][_0xa22c('0x5f')](_0x128fe0)[_0xa22c('0x39')](handleEntityNotFound(_0x252261,null))[_0xa22c('0x39')](function(_0x48c6ac){if(_0x48c6ac){if(!_['isNil'](_0x48c6ac[_0xa22c('0x76')])){if(fs[_0xa22c('0x84')](path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],_0xa22c('0x85'),_0x48c6ac['agentAvatar']))){_0x4e85f2=path['join'](config[_0xa22c('0x7c')],_0xa22c('0x85'),_0x48c6ac['agentAvatar']);}}return _0x252261[_0xa22c('0x86')](_0x4e85f2);}})[_0xa22c('0x2a')](handleError(_0x252261,null));};exports['getCustomerAvatar']=function(_0x25e3c9,_0x552e2a,_0x3b5f59){var _0x1b2385=path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],_0xa22c('0x87'));var _0x16ad41={'where':{'id':_0x25e3c9[_0xa22c('0x5d')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xa22c('0x59')][_0xa22c('0x5f')](_0x16ad41)['then'](handleEntityNotFound(_0x552e2a,null))[_0xa22c('0x39')](function(_0x59ba5b){if(_0x59ba5b){if(!_[_0xa22c('0x7f')](_0x59ba5b[_0xa22c('0x77')])){if(fs['existsSync'](path['join'](config[_0xa22c('0x7c')],_0xa22c('0x85'),_0x59ba5b['customerAvatar']))&&_0x59ba5b[_0xa22c('0x88')]){_0x1b2385=path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],_0xa22c('0x85'),_0x59ba5b[_0xa22c('0x77')]);}}return _0x552e2a[_0xa22c('0x86')](_0x1b2385);}})[_0xa22c('0x2a')](handleError(_0x552e2a,null));};exports['getSystemAvatar']=function(_0x2b80ae,_0x43b9cb,_0x155e62){var _0xbd702d=path['join'](config[_0xa22c('0x7c')],_0xa22c('0x89'));var _0x4b5c38={'where':{'id':_0x2b80ae[_0xa22c('0x5d')]['id']},'attributes':['id',_0xa22c('0x79')],'raw':!![]};return db[_0xa22c('0x59')]['find'](_0x4b5c38)[_0xa22c('0x39')](handleEntityNotFound(_0x43b9cb,null))['then'](function(_0x18fc22){if(_0x18fc22){if(!_['isNil'](_0x18fc22[_0xa22c('0x79')])){if(fs['existsSync'](path[_0xa22c('0x7b')](config['root'],_0xa22c('0x85'),_0x18fc22[_0xa22c('0x79')]))){_0xbd702d=path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],_0xa22c('0x85'),_0x18fc22['systemAvatar']);}}return _0x43b9cb[_0xa22c('0x86')](_0xbd702d);}})['catch'](handleError(_0x43b9cb,null));};exports[_0xa22c('0x8a')]=function(_0x171b63,_0x10990d,_0x1d4f30){var _0x5df2a8=require(_0xa22c('0x8b'));var _0x44b192=new _0x5df2a8();var _0x6d7198=_0x44b192[_0xa22c('0x8c')](_0x171b63[_0xa22c('0x8d')][_0xa22c('0x8e')])[_0xa22c('0x8f')]();var _0x5bb2ae={'body':_0x171b63[_0xa22c('0x61')],'channel':'chat'};var _0xadbdd1=[];var _0x492d11=[];var _0x4d1097={};var _0x465416=![];return db[_0xa22c('0x90')][_0xa22c('0x66')]()[_0xa22c('0x39')](function(_0x59a24a){if(!_0x59a24a){throw new db['Sequelize'][(_0xa22c('0x91'))](_0xa22c('0x92'));}_0xadbdd1=_[_0xa22c('0x93')](_[_0xa22c('0x4a')](_0x59a24a),['createdAt',_0xa22c('0x94')]);_0x492d11=_[_0xa22c('0x93')](_['keys'](_0x59a24a),[_0xa22c('0x95'),_0xa22c('0x94'),_0xa22c('0x96'),_0xa22c('0x97')]);if(_0x171b63[_0xa22c('0x61')]['id']){delete _0x171b63['body']['id'];}if(_[_0xa22c('0x7f')](_0x171b63[_0xa22c('0x61')]['from'])){throw new db[(_0xa22c('0x98'))]['ValidationError'](_0xa22c('0x99'));}if(_[_0xa22c('0x7f')](_0x171b63[_0xa22c('0x61')][_0xa22c('0x61')])||_0x171b63[_0xa22c('0x61')][_0xa22c('0x61')]===''){throw new db[(_0xa22c('0x98'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa22c('0x7f')](_0x171b63[_0xa22c('0x61')][_0xa22c('0x9a')])){throw new db[(_0xa22c('0x98'))][(_0xa22c('0x91'))](_0xa22c('0x9b')+_0x492d11);}if(!_[_0xa22c('0x9c')](_0x492d11,_0x171b63[_0xa22c('0x61')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xa22c('0x9d')+_0x492d11);}_0x4d1097[_0x171b63[_0xa22c('0x61')]['mapKey']]=_0x171b63[_0xa22c('0x61')][_0xa22c('0x9e')];})[_0xa22c('0x39')](function(){return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'where':{'id':_0x171b63[_0xa22c('0x5d')]['id']},'include':[{'model':db[_0xa22c('0x9f')],'as':_0xa22c('0xa0'),'include':[{'model':db[_0xa22c('0x90')],'as':_0xa22c('0xa1'),'where':_0x4d1097,'limit':0x1,'order':[[_0xa22c('0x94'),_0xa22c('0xa2')]]}]},{'model':db[_0xa22c('0xa3')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x10990d,null))[_0xa22c('0x39')](function(_0x705508){if(_0x705508&&_0x705508[_0xa22c('0xa0')]){_0x5bb2ae[_0xa22c('0xa4')]=_0x705508;_0x5bb2ae['applications']=_0x705508[_0xa22c('0xa5')];_0x5bb2ae[_0xa22c('0xa6')]=_0x705508[_0xa22c('0xa0')];_0x5bb2ae[_0xa22c('0xa7')]=_[_0xa22c('0xa8')](_0x5bb2ae['applications'],[_0xa22c('0xa9')],[_0xa22c('0xaa')]);if(_0x5bb2ae[_0xa22c('0xa4')][_0xa22c('0xa5')]){delete _0x5bb2ae['account'][_0xa22c('0xa5')];}if(_0x5bb2ae[_0xa22c('0xa4')][_0xa22c('0xa0')]&&_0x5bb2ae[_0xa22c('0xa4')][_0xa22c('0xa0')][_0xa22c('0xa1')]['length']){return _0x5bb2ae[_0xa22c('0xa4')][_0xa22c('0xa0')]['Contacts'][0x0];}var _0x552741=_['defaults'](_0x171b63[_0xa22c('0x61')],{'firstName':_0x171b63['body']['from'],'ListId':_0x705508[_0xa22c('0x97')]});_0x552741[_0x171b63[_0xa22c('0x61')][_0xa22c('0x9a')]]=_0x171b63[_0xa22c('0x61')][_0xa22c('0x9e')];return db[_0xa22c('0x90')][_0xa22c('0x60')](_0x552741,{'fields':_0xadbdd1,'raw':!![]});}})[_0xa22c('0x39')](handleEntityNotFound(_0x10990d,null))[_0xa22c('0x39')](function(_0x357afc){_0x5bb2ae['contact']=_0x357afc;var _0x973f18=_0x171b63[_0xa22c('0x61')][_0xa22c('0xab')];if(_0x171b63[_0xa22c('0x8d')][_0xa22c('0xac')]){_0x973f18=_0x171b63[_0xa22c('0x8d')][_0xa22c('0xac')];}else if(_0x171b63[_0xa22c('0x8d')]['x-forwarded-for']){_0x973f18=_[_0xa22c('0xad')](_0x171b63[_0xa22c('0x8d')][_0xa22c('0xae')][_0xa22c('0xaf')](','));}if(_0x357afc){var _0x49cf0a={'ContactId':_0x357afc['id'],'ChatWebsiteId':_0x171b63[_0xa22c('0x5d')]['id'],'from':(_0x357afc[_0xa22c('0xb0')]||'')+'\x20'+(_0x357afc[_0xa22c('0xb1')]||''),'customerIp':_0x973f18,'customerPort':_0x171b63[_0xa22c('0x8d')]['x-real-port']?_0x171b63[_0xa22c('0x8d')]['x-real-port']:null,'referer':_0x171b63['body'][_0xa22c('0xb2')],'browserName':_0x6d7198[_0xa22c('0xb3')][_0xa22c('0x3f')]&&_0x6d7198[_0xa22c('0xb3')][_0xa22c('0xb4')]?util[_0xa22c('0xb5')](_0xa22c('0xb6'),_0x6d7198[_0xa22c('0xb3')][_0xa22c('0x3f')],_0x6d7198[_0xa22c('0xb3')][_0xa22c('0xb4')]):_0xa22c('0xb7'),'browserVersion':_0x6d7198[_0xa22c('0xb3')][_0xa22c('0xb4')]||_0xa22c('0xb7'),'osName':util[_0xa22c('0xb5')](_0xa22c('0xb6'),_0x6d7198['os'][_0xa22c('0x3f')],_0x6d7198['os']['version']),'osVersion':_0x6d7198['os'][_0xa22c('0xb4')],'deviceModel':_0x6d7198[_0xa22c('0xb8')][_0xa22c('0x48')]&&_0x6d7198[_0xa22c('0xb8')][_0xa22c('0xb9')]?util['format'](_0xa22c('0xba'),_0x6d7198[_0xa22c('0xb8')][_0xa22c('0x48')],_0x6d7198[_0xa22c('0xb8')][_0xa22c('0xb9')],_0x6d7198[_0xa22c('0xb8')]['type']):null,'deviceVendor':_0x6d7198[_0xa22c('0xb8')]['vendor'],'deviceType':_0x6d7198['device']['type'],'formData':JSON[_0xa22c('0x23')](_0x171b63[_0xa22c('0x61')])};var _0x121785={'ChatWebsiteId':_0x171b63[_0xa22c('0x5d')]['id'],'closed':![]};if(_0x171b63[_0xa22c('0x61')][_0xa22c('0xbb')]){_0x121785[_0xa22c('0xbb')]=_0x171b63[_0xa22c('0x61')]['threadId'];return db['ChatInteraction'][_0xa22c('0x5f')]({'where':_0x121785})[_0xa22c('0x39')](function(_0x8c3090){if(_0x8c3090){return[_0x8c3090,![]];}_0x49cf0a['threadId']=_0x171b63['body'][_0xa22c('0xbb')];_0x49cf0a['externalUrl']=_0x171b63['body'][_0xa22c('0xbc')];return db[_0xa22c('0xbd')][_0xa22c('0x60')](_0x49cf0a)['then'](function(_0x3ef8ae){return[_0x3ef8ae,!![]];});});}_0x121785[_0xa22c('0xbe')]=_0x357afc['id'];if(_0x171b63['body'][_0xa22c('0xbf')]&&_0x171b63[_0xa22c('0x61')][_0xa22c('0xbf')]['id']){_0x121785['id']=_0x171b63['body']['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x121785})[_0xa22c('0x39')](function(_0x1c5e23){if(_0x1c5e23){return[_0x1c5e23,![]];}return db[_0xa22c('0xbd')]['create'](_0x49cf0a)[_0xa22c('0x39')](function(_0x5c1715){return[_0x5c1715,!![]];});});}return db[_0xa22c('0xbd')][_0xa22c('0x60')](_0x49cf0a)[_0xa22c('0x39')](function(_0x4b0174){return[_0x4b0174,!![]];});}})[_0xa22c('0xc0')](function(_0x4ded0a,_0x268ec2){if(_0x4ded0a){_0x465416=_0x268ec2;if(!_0x268ec2){var _0x530ed0={'from':(_0x5bb2ae[_0xa22c('0xc1')][_0xa22c('0xb0')]||'')+'\x20'+(_0x5bb2ae['contact']['lastName']||'')};if(_0x171b63[_0xa22c('0x61')][_0xa22c('0xbb')]&&_0x171b63[_0xa22c('0x61')]['messageId']&&_0x171b63[_0xa22c('0x61')][_0xa22c('0xbb')]!=_0x171b63[_0xa22c('0x61')][_0xa22c('0xc2')]){_0x530ed0[_0xa22c('0xbb')]=_0x171b63[_0xa22c('0x61')]['messageId'];}return _0x4ded0a[_0xa22c('0x38')](_0x530ed0);}else{return _0x4ded0a;}}})[_0xa22c('0x39')](function(_0xb3068){_0x5bb2ae[_0xa22c('0xbf')]=_0xb3068[_0xa22c('0x3b')]({'plain':!![]});_0x5bb2ae[_0xa22c('0xbf')]['created']=_0x465416;if(_0x5bb2ae[_0xa22c('0xbf')]['created']){if(_0x5bb2ae['account'][_0xa22c('0xc3')]){_0x5bb2ae[_0xa22c('0xa7')][_0xa22c('0xc4')]({'id':0x0,'priority':_0x5bb2ae['applications'][_0xa22c('0x4e')]+0x1,'app':_0xa22c('0xc5'),'appdata':_0xa22c('0xc6'),'interval':_0xa22c('0xc7')});}}return db[_0xa22c('0xc8')]['create']({'body':_0x171b63['body'][_0xa22c('0x61')],'ChatWebsiteId':_0x171b63[_0xa22c('0x5d')]['id'],'ChatInteractionId':_0xb3068['id'],'direction':'in','ContactId':_0x5bb2ae[_0xa22c('0xc1')]['id'],'AttachmentId':_0x171b63['body'][_0xa22c('0xc9')]});})[_0xa22c('0x39')](function(_0x1f48c6){_0x5bb2ae[_0xa22c('0x27')]=_0x1f48c6;if(_0x5bb2ae['interaction'][_0xa22c('0xca')]){return db[_0xa22c('0xcb')][_0xa22c('0x5f')]({'attributes':['id',_0xa22c('0x3f')],'where':{'id':_0x5bb2ae[_0xa22c('0xbf')][_0xa22c('0xca')]}})['then'](function(_0x24590e){if(_0x24590e){_0x5bb2ae[_0xa22c('0xa7')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa22c('0xcc'),'appdata':_0x24590e[_0xa22c('0x3f')]+','+(_0x5bb2ae[_0xa22c('0xa4')][_0xa22c('0xcd')]||0xa),'interval':_0xa22c('0xc7')});_0x5bb2ae[_0xa22c('0xce')]=!![];}return respondWithRpcPromise(_0xa22c('0xcf'),'startRouting',_0x5bb2ae);});}return respondWithRpcPromise(_0xa22c('0xcf'),_0xa22c('0xd0'),_0x5bb2ae);})[_0xa22c('0x39')](function(_0x15c6e6){respondWithRpcPromise(_0xa22c('0xd1'),_0xa22c('0xd1'),{'event':_0xa22c('0x8a'),'message':_0x15c6e6},client9002);return _0x15c6e6;})[_0xa22c('0x39')](respondWithResult(_0x10990d,null))[_0xa22c('0x2a')](handleError(_0x10990d,null));};exports[_0xa22c('0xd2')]=function(_0x31d2f4,_0x7bef5e,_0x36eabb){var _0x13b227,_0x2544af,_0x5b0fd2;var _0x1b15fd=[];var _0x4b7277=[];var _0x4356d3={};var _0x5e2ad0=_0x31d2f4['files']||[];var _0x401574=[];var _0x39b9ed;return db[_0xa22c('0x90')][_0xa22c('0x66')]()['then'](function(_0x1e1394){if(!_0x1e1394){throw new db['Sequelize'][(_0xa22c('0x91'))](_0xa22c('0x92'));}_0x4b7277=_['difference'](_[_0xa22c('0x4a')](_0x1e1394),[_0xa22c('0x95'),_0xa22c('0x94')]);_0x1b15fd=_['difference'](_[_0xa22c('0x4a')](_0x1e1394),['createdAt',_0xa22c('0x94'),_0xa22c('0x96'),'ListId']);if(_0x31d2f4[_0xa22c('0x61')]['id']){delete _0x31d2f4[_0xa22c('0x61')]['id'];}if(_[_0xa22c('0x7f')](_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x9e')])){throw _0x7bef5e[_0xa22c('0x2c')](0x1f4)[_0xa22c('0x40')](new db[(_0xa22c('0x98'))][(_0xa22c('0x91'))](_0xa22c('0x99')));}if(_['isNil'](_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x61')])||_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x61')]===''){throw _0x7bef5e['status'](0x1f4)[_0xa22c('0x40')](new db['Sequelize'][(_0xa22c('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa22c('0x7f')](_0x31d2f4['body'][_0xa22c('0xd3')])){throw _0x7bef5e['status'](0x1f4)['send'](new db[(_0xa22c('0x98'))][(_0xa22c('0x91'))](_0xa22c('0xd4')+_0x1b15fd));}if(!_['includes'](_0x1b15fd,_0x31d2f4[_0xa22c('0x61')][_0xa22c('0xd3')])){throw _0x7bef5e[_0xa22c('0x2c')](0x1f4)[_0xa22c('0x40')](new db[(_0xa22c('0x98'))]['ValidationError'](_0xa22c('0xd5')+_0x1b15fd));}_0x4356d3[_0x31d2f4[_0xa22c('0x61')]['mapKeyOffline']]=_0x31d2f4[_0xa22c('0x61')]['from'];})[_0xa22c('0x39')](function(){return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'where':{'id':_0x31d2f4[_0xa22c('0x5d')]['id']},'include':[{'model':db[_0xa22c('0x9f')],'as':'List'},{'model':db['MailAccount'],'as':_0xa22c('0xd6')}]});})[_0xa22c('0x39')](handleEntityNotFound(_0x7bef5e,null))['then'](function(_0x5c1694){if(_0x5c1694&&_0x5c1694[_0xa22c('0xa0')]){_0x2544af=_0x5c1694;var _0x5d3430=_[_0xa22c('0xd7')](_0x31d2f4['body'],{'firstName':_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x9e')],'phone':_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x9e')],'ListId':_0x5c1694[_0xa22c('0x97')]});_0x5d3430[_0x31d2f4['body'][_0xa22c('0xd3')]]=_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x9e')];return db[_0xa22c('0x90')][_0xa22c('0xd8')]({'where':_0x4356d3,'defaults':_0x5d3430});}})['spread'](function(_0x95ed8d){if(_0x95ed8d){_0x5b0fd2=_0x95ed8d;var _0x40b52b=fs[_0xa22c('0xd9')](path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],_0xa22c('0xda')),_0xa22c('0xdb'));var _0x53f0ee=ejs[_0xa22c('0xdc')](_0x40b52b,{'body':_[_0xa22c('0xdd')](_0x31d2f4[_0xa22c('0x61')][_0xa22c('0x61')]),'bodyTitle':_0x2544af[_0xa22c('0xde')]});return db[_0xa22c('0xdf')][_0xa22c('0x60')]({'body':_0x53f0ee,'ContactId':_0x95ed8d['id'],'ChatWebsiteId':_0x2544af['id']});}})[_0xa22c('0x39')](function(_0x460263){_0x39b9ed=_0x460263;if(_0x5e2ad0[_0xa22c('0x4e')]){var _0x565ae3=_0x5e2ad0['map'](function(_0xfe6b4c){return{'name':_0xfe6b4c[_0xa22c('0xe0')],'basename':_0xfe6b4c[_0xa22c('0x74')],'type':_0xfe6b4c[_0xa22c('0xe1')],'ChatOfflineMessageId':_0x460263['id']};});_0x401574=_0x565ae3[_0xa22c('0x43')](_0x29dab7=>{var _0x3b7751={'filename':_0x29dab7['name'],'path':path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],_0xa22c('0xe2'),_0xa22c('0xe3'),'attachments',_0xa22c('0xe4'),_0x29dab7[_0xa22c('0xe5')])};return _0x3b7751;});if(!_0x2544af[_0xa22c('0xe6')]){return db[_0xa22c('0xe7')][_0xa22c('0xe8')](function(_0xedb368){return db[_0xa22c('0xe9')]['bulkCreate'](_0x565ae3,{'transaction':_0xedb368});});}}})['then'](function(){if(_0x39b9ed){_0x13b227=_0x39b9ed;return db[_0xa22c('0xd6')][_0xa22c('0x6b')]({'where':{'active':!![]},'include':[{'model':db[_0xa22c('0xea')],'as':_0xa22c('0xeb'),'raw':!![]}]});}})[_0xa22c('0x39')](function(_0x3518ac){if(_0x3518ac&&_0x3518ac['Smtp']&&_0x2544af['forwardOffline']&&_0x2544af[_0xa22c('0xec')]){var _0x53e16b={'tls':{'rejectUnauthorized':![]}};if(_0x3518ac['Smtp'][_0xa22c('0xed')]){_0x53e16b[_0xa22c('0xed')]=_0x3518ac[_0xa22c('0xeb')]['service'];}else{_0x53e16b['host']=_0x3518ac[_0xa22c('0xeb')]['host'];_0x53e16b[_0xa22c('0xee')]=_0x3518ac['Smtp'][_0xa22c('0xee')];_0x53e16b[_0xa22c('0xef')]=_0x3518ac[_0xa22c('0xeb')][_0xa22c('0xef')];}if(_0x3518ac[_0xa22c('0xeb')][_0xa22c('0xf0')]){_0x53e16b[_0xa22c('0xf1')]={'user':_0x3518ac[_0xa22c('0xeb')][_0xa22c('0x63')],'pass':_0x3518ac[_0xa22c('0xeb')]['pass']};}return respondWithRpcPromise(_0xa22c('0xf2'),'sendMail',{'account':_0x53e16b,'message':{'from':util[_0xa22c('0xb5')](_0xa22c('0xf3'),_0x3518ac['name'],_0x3518ac[_0xa22c('0xf4')]||_0x3518ac[_0xa22c('0xeb')][_0xa22c('0x63')]),'to':_0x2544af[_0xa22c('0xec')],'subject':_0x2544af['offlineMessageSubject'],'html':_0x13b227[_0xa22c('0x61')],'attachments':_0x401574}},client9003)['then'](function(){return _0x13b227;})[_0xa22c('0x2a')](function(_0x298afe){console['error'](_0x298afe);});}})[_0xa22c('0x39')](function(){if(_0x2544af&&_0x2544af[_0xa22c('0xe6')]&&_0x2544af[_0xa22c('0xf5')]){var _0x54a107=[];if(_0x5e2ad0['length']){_0x54a107=_0x5e2ad0[_0xa22c('0x43')](function(_0xf7ca67){return{'name':_0xf7ca67['originalname'],'basename':_0xf7ca67[_0xa22c('0x74')],'type':_0xf7ca67['mimetype'],'ChatOfflineMessageId':_0x39b9ed['id']};});}var _0x1cc3ea;if(!_[_0xa22c('0x7f')](_0x2544af['subjectOffline'])){var _0x323967=_[_0xa22c('0x43')](_0x31d2f4[_0xa22c('0x61')],function(_0x48275e){return _0x48275e;});var _0x18a501=_['toPairsIn'](_0x323967)[0x0];var _0x58545a=_[_0xa22c('0xf6')](_0x18a501,function(_0xbc5307){return _0xbc5307;});_0x1cc3ea=_0x58545a[0x1][_0x2544af[_0xa22c('0xf7')]];}var _0x1647b3={'from':_0x5b0fd2['email'],'firstName':_0x5b0fd2['firstName'],'lastName':_0x5b0fd2[_0xa22c('0xb1')],'mapKey':_0xa22c('0xf4'),'message':{'from':_0x5b0fd2['email'],'to':_0x2544af['MailAccount'][_0xa22c('0xf4')],'cc':'','subject':_[_0xa22c('0x7f')](_0x1cc3ea)?_0x2544af[_0xa22c('0xf8')]:_0x1cc3ea,'messageId':'','sentAt':new Date(),'attach':_0x54a107[_0xa22c('0x4e')],'attachments':_0x54a107,'originChannel':_0xa22c('0xf9'),'ChatWebsiteId':_0x2544af['id'],'ChatOfflineMessageId':_0x13b227['id'],'originTo':_0x2544af['MailAccount'][_0xa22c('0xf4')]},'body':_0x13b227[_0xa22c('0x61')]};var _0x402c03={'account':{'id':_0x2544af[_0xa22c('0xf5')]},'body':_0x1647b3,'log':_0xa22c('0xfa')};return respondWithRpcPromise('NotifyMailAccount',_0xa22c('0xfb'),_0x402c03,client9001)[_0xa22c('0x39')](function(){return _0x13b227;})[_0xa22c('0x2a')](function(_0x3f329a){console['error'](_0x3f329a);});}return;})['then'](function(){if(_0x13b227){return _0x13b227;}})[_0xa22c('0x39')](respondWithResult(_0x7bef5e,null))[_0xa22c('0x2a')](function(_0x38f101){console[_0xa22c('0x24')](_0xa22c('0x2a'),_0x38f101);for(var _0x4d5ec3 of _0x5e2ad0){var _0x2dec1a=path[_0xa22c('0x7b')](config[_0xa22c('0x7c')],'server',_0xa22c('0xe3'),_0xa22c('0xfc'),_0xa22c('0xe4'),_0x4d5ec3[_0xa22c('0x74')]);fs_extra[_0xa22c('0xfd')](_0x2dec1a)[_0xa22c('0x2a')](function(_0x5975d3){console['error'](_0xa22c('0xfe'),_0x2dec1a,_0x5975d3);});}});};exports['addInteraction']=function(_0x77202b,_0x1114a0,_0x2f19a5){return db[_0xa22c('0xbd')]['find']({'where':{'id':_0x77202b[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x1114a0,null))[_0xa22c('0x39')](function(_0x4bae10){if(_0x4bae10){return _0x4bae10['addInteraction'](_0x77202b[_0xa22c('0x61')][_0xa22c('0x6d')],_[_0xa22c('0xff')](_0x77202b['body'],[_0xa22c('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x1114a0,null))[_0xa22c('0x2a')](handleError(_0x1114a0,null));};exports[_0xa22c('0x100')]=function(_0x14c6eb,_0x441a51,_0x24042b){var _0x369297={'raw':![],'where':{}};var _0x25d801={};var _0x1c1949={'count':0x0,'rows':[]};return db[_0xa22c('0x59')][_0xa22c('0x6b')]({'where':{'id':_0x14c6eb['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x441a51,null))[_0xa22c('0x39')](function(_0x2968f0){if(_0x2968f0){_0x25d801['model']=_['keys'](db[_0xa22c('0xbd')]['rawAttributes']);_0x25d801[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0x14c6eb['query']);_0x25d801['filters']=_[_0xa22c('0x4b')](_0x25d801[_0xa22c('0x48')],_0x25d801[_0xa22c('0x49')]);_0x369297[_0xa22c('0x4c')]=_['intersection'](_0x25d801['model'],qs[_0xa22c('0x4d')](_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x4d')]));_0x369297['attributes']=_0x369297[_0xa22c('0x4c')]['length']?_0x369297['attributes']:_0x25d801[_0xa22c('0x48')];if(!_0x14c6eb[_0xa22c('0x49')]['hasOwnProperty'](_0xa22c('0x50'))){_0x369297[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x30')]);_0x369297[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x32')]);}_0x369297[_0xa22c('0x51')]=qs['sort'](_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x52')]);_0x369297[_0xa22c('0x53')]=qs[_0xa22c('0x54')](_[_0xa22c('0x70')](_0x14c6eb[_0xa22c('0x49')],_0x25d801[_0xa22c('0x54')]));_0x369297[_0xa22c('0x53')][_0xa22c('0x68')]=_0x2968f0['id'];if(_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x55')]){_0x369297[_0xa22c('0x53')]=_['merge'](_0x369297[_0xa22c('0x53')],{'$or':_[_0xa22c('0x43')](_0x369297['attributes'],function(_0x2aaf9b){var _0x32b9b6={};_0x32b9b6[_0x2aaf9b]={'$like':'%'+_0x14c6eb[_0xa22c('0x49')]['filter']+'%'};return _0x32b9b6;})});}_0x369297=_[_0xa22c('0x56')]({},_0x369297,_0x14c6eb[_0xa22c('0x57')]);return db[_0xa22c('0xbd')][_0xa22c('0x31')]({'where':_0x369297[_0xa22c('0x53')]})[_0xa22c('0x39')](function(_0x43d7ff){_0x1c1949[_0xa22c('0x31')]=_0x43d7ff;if(_0x14c6eb['query'][_0xa22c('0x58')]){_0x369297[_0xa22c('0x5e')]=[{'model':db['CmContact'],'as':_0xa22c('0x101'),'required':![]},{'model':db[_0xa22c('0xcb')],'as':_0xa22c('0x102'),'attributes':[_0xa22c('0x3f'),_0xa22c('0x103'),_0xa22c('0x104')],'required':![]},{'model':db[_0xa22c('0x105')],'as':_0xa22c('0x106'),'attributes':['id',_0xa22c('0x3f'),_0xa22c('0x107')],'where':_0x14c6eb['query'][_0xa22c('0x108')]?{'id':_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x108')]}:undefined,'required':_0x14c6eb[_0xa22c('0x49')][_0xa22c('0x108')]?!![]:![]}];}return db[_0xa22c('0xbd')]['findAll'](_0x369297);})[_0xa22c('0x39')](function(_0xdc1a15){_0x1c1949[_0xa22c('0x5b')]=_0xdc1a15;return _0x1c1949;});}})[_0xa22c('0x39')](respondWithFilteredResult(_0x441a51,_0x369297))['catch'](handleError(_0x441a51,null));};function iftimePromise(_0x445b63,_0x50ee40){return respondWithRpcPromise(_0xa22c('0x109'),_0xa22c('0x10a'),{'command':_0x50ee40[_0xa22c('0x10b')]?util['format'](_0xa22c('0x10c'),_0x445b63[_0xa22c('0x10d')],_0x50ee40[_0xa22c('0x10b')]):util[_0xa22c('0xb5')](_0xa22c('0x10e'),_0x445b63[_0xa22c('0x10d')])},client9002)[_0xa22c('0x39')](function(_0x43e5a2){var _0x47c743=_0x43e5a2&&_0x43e5a2[_0xa22c('0x10f')](_0xa22c('0x110'))>=0x0?!![]:![];logger[_0xa22c('0x20')](_0xa22c('0x111'),_0x50ee40['id'],_0x445b63['id'],_0x445b63[_0xa22c('0x10d')],_0x47c743?_0xa22c('0x112'):_0xa22c('0x113'),_0x50ee40['timezone']?_0x50ee40[_0xa22c('0x10b')]:_0xa22c('0x114'));return _0x47c743;})['catch'](function(_0x43ea07){logger[_0xa22c('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x50ee40['id'],_0x445b63['id'],_0x445b63[_0xa22c('0x10d')],util['inspect'](_0x43ea07,{'showHidden':![],'depth':null}),_0x50ee40['timezone']?_0x50ee40[_0xa22c('0x10b')]:_0xa22c('0x114'));return![];});}exports[_0xa22c('0x10a')]=function(_0x50d06f,_0x1ca2c5,_0x4767e9){var _0xc2c83=0x0;var _0xdc40dd=0x0;var _0x1be68e=![];var _0x5c86da;var _0x320313;return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x50d06f[_0xa22c('0x5d')]['id']},'include':[{'model':db[_0xa22c('0x115')],'as':_0xa22c('0x115'),'include':[{'model':db[_0xa22c('0x115')],'as':_0xa22c('0x116'),'attributes':['id',_0xa22c('0x10d')],'raw':!![]}]}]})[_0xa22c('0x39')](handleEntityNotFound(_0x1ca2c5,null))[_0xa22c('0x39')](function(_0x27347f){if(_0x27347f){_0x5c86da=_0x27347f;return _0x27347f[_0xa22c('0x117')]({'raw':!![]});}})[_0xa22c('0x39')](function(_0x1a8342){if(_0x5c86da){if(_0x1a8342){_0x320313=_0x1a8342;}}return require(_0xa22c('0x18'))[_0xa22c('0x7d')]();})[_0xa22c('0x39')](function(_0x3d1156){if(_0x3d1156){_0xdc40dd=_0x3d1156[_0xa22c('0x118')];_0x1be68e=_0x3d1156[_0xa22c('0x7e')];}})[_0xa22c('0x39')](function(){return db['ChatInteraction'][_0xa22c('0x31')]({'where':{'closed':![]}});})[_0xa22c('0x39')](function(_0x4ecafb){_0xc2c83=_0x4ecafb;if(_0xdc40dd&&_0x4ecafb>_0xdc40dd){return db[_0xa22c('0x119')][_0xa22c('0x6b')]({'where':{'id':0x1}})['then'](function(_0x3b272b){if(_0x3b272b){_0x3b272b[_0xa22c('0x11a')](_0xa22c('0x11b'));}});}})[_0xa22c('0x39')](function(){if(_0x5c86da['Interval']&&_0x5c86da['Interval'][_0xa22c('0x116')]){var _0x2b58ab=[];for(var _0x407826=0x0;_0x407826<_0x5c86da[_0xa22c('0x115')][_0xa22c('0x116')][_0xa22c('0x4e')];_0x407826++){var _0x3c096b=_0x5c86da[_0xa22c('0x115')][_0xa22c('0x116')][_0x407826][_0xa22c('0x3b')]({'plain':!![]});_0x2b58ab['push'](iftimePromise(_0x3c096b,_0x5c86da));}return BPromise[_0xa22c('0x11c')](_0x2b58ab)[_0xa22c('0x39')](function(_0x411133){return _[_0xa22c('0x11d')](_0x411133);});}else{return!![];}})[_0xa22c('0x39')](function(_0x1a718f){var _0x489180=fs[_0xa22c('0xd9')](path[_0xa22c('0x7b')](config['root'],_0xa22c('0x11e')),_0xa22c('0xdb'));var _0x3e6ee7={'remote':_0x5c86da[_0xa22c('0x11f')],'query':querystring[_0xa22c('0x23')](_[_0xa22c('0x56')](_0x5c86da['get']({'plain':!![]}),{'customerIp':_0x50d06f[_0xa22c('0x8d')]['x-forwarded-for']||_0x50d06f[_0xa22c('0x8d')][_0xa22c('0x120')]||_0x50d06f[_0xa22c('0x121')][_0xa22c('0x122')]||_0x50d06f['ip'],'referer':_0x50d06f['headers'][_0xa22c('0xb2')],'openedInteractions':_0xc2c83,'maxInteractions':_0xdc40dd,'virtual':_0x1be68e[_0xa22c('0x118')],'online':_0x1a718f,'custom':_0x1be68e}))[_0xa22c('0x123')](/'/g,'\x5c\x27')};_0x1ca2c5[_0xa22c('0x40')](ejs[_0xa22c('0xdc')](Mustache[_0xa22c('0xdc')](_0x489180,_0x3e6ee7),{'proactiveActions':_0x320313,'alignment':_0x5c86da['alignment'],'verticalAlignment':_0x5c86da['verticalAlignment'],'div_color':_0x5c86da[_0xa22c('0x107')],'text_color':_0x5c86da[_0xa22c('0x124')],'button_color':_0x5c86da[_0xa22c('0x125')],'background_color':_0x5c86da['backgroundColor']}));})[_0xa22c('0x2a')](handleError(_0x1ca2c5,null));};exports['addApplications']=function(_0x4311c0,_0x5463f0,_0x5e0bf0){return db[_0xa22c('0x59')]['findOne']({'where':{'id':_0x4311c0[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x5463f0,null))[_0xa22c('0x39')](function(_0x4ab9b9){if(_0x4ab9b9){return db[_0xa22c('0xe7')][_0xa22c('0xe8')](function(_0x2e5db1){return db['ChatApplication'][_0xa22c('0x3a')]({'where':{'ChatWebsiteId':_0x4311c0[_0xa22c('0x5d')]['id']},'transaction':_0x2e5db1})[_0xa22c('0x39')](function(_0x332e2d){var _0x4218aa=_[_0xa22c('0x43')](_0x4311c0['body'],function(_0x557e7d){_0x557e7d[_0xa22c('0x68')]=_0x4311c0[_0xa22c('0x5d')]['id'];return _0x557e7d;});return db[_0xa22c('0xa3')][_0xa22c('0x126')](_0x4218aa,{'transaction':_0x2e5db1});});})[_0xa22c('0x39')](function(){return db[_0xa22c('0xa3')][_0xa22c('0x127')]({'where':{'ChatWebsiteId':_0x4311c0[_0xa22c('0x5d')]['id']},'order':_0xa22c('0xa9')});});}})[_0xa22c('0x39')](respondWithResult(_0x5463f0,null))['catch'](handleError(_0x5463f0,null));};exports[_0xa22c('0x128')]=function(_0x3be420,_0x1625af,_0x497472){var _0x199e95={};var _0x3ddc70={};var _0x3e6d2d;var _0x160162;return db['ChatWebsite'][_0xa22c('0x6b')]({'where':{'id':_0x3be420[_0xa22c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1625af,null))[_0xa22c('0x39')](function(_0x4c723a){if(_0x4c723a){_0x3e6d2d=_0x4c723a;_0x3ddc70[_0xa22c('0x48')]=_[_0xa22c('0x4a')](db['ChatApplication'][_0xa22c('0x44')]);_0x3ddc70[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0x3be420[_0xa22c('0x49')]);_0x3ddc70['filters']=_['intersection'](_0x3ddc70[_0xa22c('0x48')],_0x3ddc70[_0xa22c('0x49')]);_0x199e95[_0xa22c('0x4c')]=_[_0xa22c('0x4b')](_0x3ddc70[_0xa22c('0x48')],qs['fields'](_0x3be420[_0xa22c('0x49')]['fields']));_0x199e95['attributes']=_0x199e95[_0xa22c('0x4c')][_0xa22c('0x4e')]?_0x199e95[_0xa22c('0x4c')]:_0x3ddc70[_0xa22c('0x48')];_0x199e95[_0xa22c('0x51')]=qs[_0xa22c('0x52')](_0x3be420[_0xa22c('0x49')][_0xa22c('0x52')]);_0x199e95[_0xa22c('0x53')]=qs[_0xa22c('0x54')](_[_0xa22c('0x70')](_0x3be420['query'],_0x3ddc70[_0xa22c('0x54')]));if(_0x3be420[_0xa22c('0x49')][_0xa22c('0x55')]){_0x199e95['where']=_['merge'](_0x199e95['where'],{'$or':_[_0xa22c('0x43')](_0x199e95[_0xa22c('0x4c')],function(_0x21c896){var _0x97f000={};_0x97f000[_0x21c896]={'$like':'%'+_0x3be420[_0xa22c('0x49')][_0xa22c('0x55')]+'%'};return _0x97f000;})});}_0x199e95=_['merge']({},_0x199e95,_0x3be420[_0xa22c('0x57')]);return _0x3e6d2d[_0xa22c('0x128')](_0x199e95);}})[_0xa22c('0x39')](function(_0x37b23c){if(_0x37b23c){_0x160162=_0x37b23c[_0xa22c('0x4e')];if(!_0x3be420[_0xa22c('0x49')]['hasOwnProperty'](_0xa22c('0x50'))){_0x199e95[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x3be420['query']['limit']);_0x199e95['offset']=qs[_0xa22c('0x32')](_0x3be420[_0xa22c('0x49')]['offset']);}return _0x3e6d2d['getApplications'](_0x199e95);}})['then'](function(_0x3ec470){if(_0x3ec470){return _0x3ec470?{'count':_0x160162,'rows':_0x3ec470}:null;}})[_0xa22c('0x39')](respondWithResult(_0x1625af,null))['catch'](handleError(_0x1625af,null));};exports['addProactiveActions']=function(_0x1e4487,_0x17803f,_0x19a9d0){return db[_0xa22c('0x129')][_0xa22c('0x5f')]({'where':{'id':_0x1e4487[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x17803f,null))[_0xa22c('0x39')](function(_0x25326f){if(_0x25326f){return _0x25326f['addProactiveActions'](_0x1e4487[_0xa22c('0x61')][_0xa22c('0x6d')],_[_0xa22c('0xff')](_0x1e4487[_0xa22c('0x61')],[_0xa22c('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x17803f,null))['catch'](handleError(_0x17803f,null));};exports[_0xa22c('0x117')]=function(_0x54eaf0,_0x9aa85a,_0x3aed0f){var _0x2a7e55={};var _0x38c666={};var _0x3a57ff;var _0x39245a;return db[_0xa22c('0x59')][_0xa22c('0x6b')]({'where':{'id':_0x54eaf0['params']['id']}})['then'](handleEntityNotFound(_0x9aa85a,null))['then'](function(_0x4f0cf0){if(_0x4f0cf0){_0x3a57ff=_0x4f0cf0;_0x38c666[_0xa22c('0x48')]=_[_0xa22c('0x4a')](db[_0xa22c('0x12a')][_0xa22c('0x44')]);_0x38c666[_0xa22c('0x49')]=_['keys'](_0x54eaf0[_0xa22c('0x49')]);_0x38c666[_0xa22c('0x54')]=_['intersection'](_0x38c666['model'],_0x38c666[_0xa22c('0x49')]);_0x2a7e55['attributes']=_[_0xa22c('0x4b')](_0x38c666['model'],qs[_0xa22c('0x4d')](_0x54eaf0[_0xa22c('0x49')]['fields']));_0x2a7e55[_0xa22c('0x4c')]=_0x2a7e55[_0xa22c('0x4c')][_0xa22c('0x4e')]?_0x2a7e55[_0xa22c('0x4c')]:_0x38c666[_0xa22c('0x48')];_0x2a7e55[_0xa22c('0x51')]=qs['sort'](_0x54eaf0['query'][_0xa22c('0x52')]);_0x2a7e55[_0xa22c('0x53')]=qs['filters'](_[_0xa22c('0x70')](_0x54eaf0[_0xa22c('0x49')],_0x38c666[_0xa22c('0x54')]));if(_0x54eaf0[_0xa22c('0x49')]['filter']){_0x2a7e55[_0xa22c('0x53')]=_[_0xa22c('0x56')](_0x2a7e55[_0xa22c('0x53')],{'$or':_[_0xa22c('0x43')](_0x2a7e55[_0xa22c('0x4c')],function(_0x5cd3ed){var _0x33713a={};_0x33713a[_0x5cd3ed]={'$like':'%'+_0x54eaf0[_0xa22c('0x49')][_0xa22c('0x55')]+'%'};return _0x33713a;})});}_0x2a7e55=_[_0xa22c('0x56')]({},_0x2a7e55,_0x54eaf0[_0xa22c('0x57')]);return _0x3a57ff[_0xa22c('0x117')](_0x2a7e55);}})[_0xa22c('0x39')](function(_0x2da39d){if(_0x2da39d){_0x39245a=_0x2da39d[_0xa22c('0x4e')];if(!_0x54eaf0[_0xa22c('0x49')][_0xa22c('0x4f')](_0xa22c('0x50'))){_0x2a7e55[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x54eaf0[_0xa22c('0x49')][_0xa22c('0x30')]);_0x2a7e55[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0x54eaf0[_0xa22c('0x49')][_0xa22c('0x32')]);}return _0x3a57ff[_0xa22c('0x117')](_0x2a7e55);}})[_0xa22c('0x39')](function(_0x2f81cc){if(_0x2f81cc){return _0x2f81cc?{'count':_0x39245a,'rows':_0x2f81cc}:null;}})[_0xa22c('0x39')](respondWithResult(_0x9aa85a,null))[_0xa22c('0x2a')](handleError(_0x9aa85a,null));};exports[_0xa22c('0x12b')]=function(_0x1360a8,_0x443ae1,_0x2381f0){var _0x36b269=_0x1360a8[_0xa22c('0x49')][_0xa22c('0x12c')]===_0xa22c('0x12d')?_0xa22c('0x12e'):'onlineForm';return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'attributes':['id',_0x36b269],'where':{'id':_0x1360a8[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x443ae1,null))['then'](function(_0x2895d8){if(_0x2895d8){var _0x8922b9=_0x2895d8[_0x36b269];var _0x3a7d04=_0x8922b9&&_0x8922b9['items']?_0x8922b9[_0xa22c('0x12f')]:[];_0x443ae1['send']({'fromKey':_[_0xa22c('0x7f')](_0x8922b9[_0xa22c('0x130')])?undefined:_0x8922b9['fromKey'],'count':_0x3a7d04[_0xa22c('0x4e')],'rows':_0x3a7d04});}})['catch'](handleError(_0x443ae1,null));};exports[_0xa22c('0x131')]=function(_0x449e93,_0x31b282,_0x5368a5){var _0x299bb0={'raw':![],'where':{}};var _0xf55b47={};var _0x471d31={'count':0x0,'rows':[]};return db[_0xa22c('0x59')][_0xa22c('0x6b')]({'where':{'id':_0x449e93['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x31b282,null))[_0xa22c('0x39')](function(_0x173095){if(_0x173095){_0xf55b47[_0xa22c('0x48')]=_['keys'](db[_0xa22c('0xdf')][_0xa22c('0x44')]);_0xf55b47[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0x449e93[_0xa22c('0x49')]);_0xf55b47[_0xa22c('0x54')]=_[_0xa22c('0x4b')](_0xf55b47[_0xa22c('0x48')],_0xf55b47[_0xa22c('0x49')]);_0x299bb0[_0xa22c('0x4c')]=_[_0xa22c('0x4b')](_0xf55b47[_0xa22c('0x48')],qs[_0xa22c('0x4d')](_0x449e93['query']['fields']));_0x299bb0[_0xa22c('0x4c')]=_0x299bb0['attributes'][_0xa22c('0x4e')]?_0x299bb0[_0xa22c('0x4c')]:_0xf55b47[_0xa22c('0x48')];if(!_0x449e93[_0xa22c('0x49')]['hasOwnProperty'](_0xa22c('0x50'))){_0x299bb0[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x449e93[_0xa22c('0x49')][_0xa22c('0x30')]);_0x299bb0[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0x449e93[_0xa22c('0x49')][_0xa22c('0x32')]);}_0x299bb0[_0xa22c('0x51')]=qs[_0xa22c('0x52')](_0x449e93[_0xa22c('0x49')][_0xa22c('0x52')]);_0x299bb0[_0xa22c('0x53')]=qs[_0xa22c('0x54')](_[_0xa22c('0x70')](_0x449e93[_0xa22c('0x49')],_0xf55b47['filters']));_0x299bb0[_0xa22c('0x53')][_0xa22c('0x68')]=_0x173095['id'];if(_0x449e93['query'][_0xa22c('0x55')]){_0x299bb0[_0xa22c('0x53')]=_[_0xa22c('0x56')](_0x299bb0[_0xa22c('0x53')],{'$or':_[_0xa22c('0x43')](_0x299bb0[_0xa22c('0x4c')],function(_0x3e0f7c){var _0x5cf18d={};_0x5cf18d[_0x3e0f7c]={'$like':'%'+_0x449e93[_0xa22c('0x49')][_0xa22c('0x55')]+'%'};return _0x5cf18d;})});}_0x299bb0=_[_0xa22c('0x56')]({},_0x299bb0,_0x449e93[_0xa22c('0x57')]);return db[_0xa22c('0xdf')][_0xa22c('0x31')]({'where':_0x299bb0['where']})[_0xa22c('0x39')](function(_0xefa70b){_0x471d31[_0xa22c('0x31')]=_0xefa70b;if(_0x449e93[_0xa22c('0x49')][_0xa22c('0x58')]){_0x299bb0['include']=[{'all':!![]}];}else{_0x299bb0['include']=[{'model':db[_0xa22c('0x90')],'as':_0xa22c('0x101'),'required':![]},{'model':db[_0xa22c('0xe9')],'as':_0xa22c('0x132'),'required':![]}];}return db['ChatOfflineMessage'][_0xa22c('0x5a')](_0x299bb0);})[_0xa22c('0x39')](function(_0x20ef52){_0x471d31['rows']=_0x20ef52;return _0x471d31;});}})['then'](respondWithFilteredResult(_0x31b282,_0x299bb0))[_0xa22c('0x2a')](handleError(_0x31b282,null));};exports[_0xa22c('0x133')]=function(_0x1c7694,_0x578f86,_0x114495){return db[_0xa22c('0x59')][_0xa22c('0x5f')]({'where':{'id':_0x1c7694['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x578f86,null))[_0xa22c('0x39')](function(_0x54a20b){if(_0x54a20b){return _0x54a20b['addAgents'](_0x1c7694[_0xa22c('0x61')][_0xa22c('0x6d')],_[_0xa22c('0xff')](_0x1c7694[_0xa22c('0x61')],[_0xa22c('0x6d'),'id'])||{})['spread'](function(_0x19be86){for(var _0x105140=0x0;_0x105140<_0x1c7694['body']['ids'][_0xa22c('0x4e')];_0x105140+=0x1){socket[_0xa22c('0x134')](_0xa22c('0x135'),{'UserId':Number(_0x1c7694[_0xa22c('0x61')][_0xa22c('0x6d')][_0x105140]),'ChatWebsiteId':Number(_0x1c7694[_0xa22c('0x5d')]['id'])});}return _0x19be86;});}})['then'](respondWithResult(_0x578f86,null))[_0xa22c('0x2a')](handleError(_0x578f86,null));};exports[_0xa22c('0x136')]=function(_0x536a74,_0x22acfb,_0x40929d){return db['ChatWebsite'][_0xa22c('0x5f')]({'where':{'id':_0x536a74['params']['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x22acfb,null))['then'](function(_0x56e5d7){if(_0x56e5d7){return _0x56e5d7[_0xa22c('0x136')](_0x536a74[_0xa22c('0x49')]['ids'])[_0xa22c('0x39')](function(){if(_[_0xa22c('0x137')](_0x536a74[_0xa22c('0x49')][_0xa22c('0x6d')])){for(var _0x16397f=0x0;_0x16397f<_0x536a74[_0xa22c('0x49')]['ids']['length'];_0x16397f+=0x1){socket[_0xa22c('0x134')]('userChatWebsite:remove',{'UserId':Number(_0x536a74['query'][_0xa22c('0x6d')][_0x16397f]),'ChatWebsiteId':Number(_0x536a74[_0xa22c('0x5d')]['id'])});}}else{socket[_0xa22c('0x134')](_0xa22c('0x138'),{'UserId':Number(_0x536a74[_0xa22c('0x49')][_0xa22c('0x6d')]),'ChatWebsiteId':Number(_0x536a74[_0xa22c('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x22acfb,null))[_0xa22c('0x2a')](handleError(_0x22acfb,null));};exports[_0xa22c('0x139')]=function(_0x437ea3,_0x107fae,_0x2f6c17){var _0x7e9cd5={};var _0x3c9c54={};var _0x283bbf;var _0x110654;return db[_0xa22c('0x59')][_0xa22c('0x6b')]({'where':{'id':_0x437ea3[_0xa22c('0x5d')]['id']}})[_0xa22c('0x39')](handleEntityNotFound(_0x107fae,null))[_0xa22c('0x39')](function(_0x45fd95){if(_0x45fd95){_0x283bbf=_0x45fd95;_0x3c9c54['model']=_[_0xa22c('0x4a')](db[_0xa22c('0xcb')][_0xa22c('0x44')]);_0x3c9c54[_0xa22c('0x49')]=_[_0xa22c('0x4a')](_0x437ea3['query']);_0x3c9c54[_0xa22c('0x54')]=_[_0xa22c('0x4b')](_0x3c9c54[_0xa22c('0x48')],_0x3c9c54[_0xa22c('0x49')]);_0x7e9cd5[_0xa22c('0x4c')]=_['intersection'](_0x3c9c54[_0xa22c('0x48')],qs[_0xa22c('0x4d')](_0x437ea3[_0xa22c('0x49')]['fields']));_0x7e9cd5['attributes']=_0x7e9cd5['attributes'][_0xa22c('0x4e')]?_0x7e9cd5[_0xa22c('0x4c')]:_0x3c9c54[_0xa22c('0x48')];_0x7e9cd5[_0xa22c('0x51')]=qs[_0xa22c('0x52')](_0x437ea3[_0xa22c('0x49')][_0xa22c('0x52')]);_0x7e9cd5[_0xa22c('0x53')]=qs[_0xa22c('0x54')](_['pick'](_0x437ea3[_0xa22c('0x49')],_0x3c9c54['filters']));if(_0x437ea3[_0xa22c('0x49')][_0xa22c('0x55')]){_0x7e9cd5[_0xa22c('0x53')]=_['merge'](_0x7e9cd5[_0xa22c('0x53')],{'$or':_[_0xa22c('0x43')](_0x7e9cd5['attributes'],function(_0x85b01c){var _0x5a1d2f={};_0x5a1d2f[_0x85b01c]={'$like':'%'+_0x437ea3['query']['filter']+'%'};return _0x5a1d2f;})});}_0x7e9cd5=_[_0xa22c('0x56')]({},_0x7e9cd5,_0x437ea3['options']);return _0x283bbf[_0xa22c('0x139')](_0x7e9cd5);}})[_0xa22c('0x39')](function(_0x263e6b){if(_0x263e6b){_0x110654=_0x263e6b[_0xa22c('0x4e')];if(!_0x437ea3[_0xa22c('0x49')][_0xa22c('0x4f')](_0xa22c('0x50'))){_0x7e9cd5[_0xa22c('0x30')]=qs[_0xa22c('0x30')](_0x437ea3[_0xa22c('0x49')][_0xa22c('0x30')]);_0x7e9cd5[_0xa22c('0x32')]=qs[_0xa22c('0x32')](_0x437ea3['query']['offset']);}return _0x283bbf[_0xa22c('0x139')](_0x7e9cd5);}})['then'](function(_0x122e09){if(_0x122e09){return _0x122e09?{'count':_0x110654,'rows':_0x122e09}:null;}})[_0xa22c('0x39')](respondWithResult(_0x107fae,null))[_0xa22c('0x2a')](handleError(_0x107fae,null));}; \ No newline at end of file +var _0xf2b6=['root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','join','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','existsSync','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','User','Owner','fullname','Tags','tag','Command','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','License','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','virtual','replace','alignment','color','textColor','color_button','backgroundColor','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','json','apply','reject','save','update','destroy','get','end','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatWebsites','UserProfileSection','userProfileId','UserProfileResource','params','Pause','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xf2b6,0xbb));var _0x6f2b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf2b6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6f2b('0x0'));var rimraf=require(_0x6f2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f2b('0x2'));var rp=require(_0x6f2b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6f2b('0x4'));var util=require('util');var path=require(_0x6f2b('0x5'));var sox=require(_0x6f2b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f2b('0x7'));var _=require(_0x6f2b('0x8'));var squel=require(_0x6f2b('0x9'));var crypto=require('crypto');var jsforce=require(_0x6f2b('0xa'));var deskjs=require(_0x6f2b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6f2b('0xc'));var Papa=require(_0x6f2b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f2b('0xe'));var as=require(_0x6f2b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f2b('0x10'))(_0x6f2b('0x11'));var utils=require(_0x6f2b('0x12'));var config=require(_0x6f2b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f2b('0x14'))['db'];config[_0x6f2b('0x15')]=_[_0x6f2b('0x16')](config['redis'],{'host':_0x6f2b('0x17'),'port':0x18eb});var socket=require(_0x6f2b('0x18'))(new Redis(config[_0x6f2b('0x15')]));require('./chatWebsite.socket')[_0x6f2b('0x19')](socket);var jayson=require(_0x6f2b('0x1a'));var client=jayson[_0x6f2b('0x1b')][_0x6f2b('0x1c')]({'port':0x232c});var client9002=jayson[_0x6f2b('0x1b')][_0x6f2b('0x1c')]({'port':0x232a});var client9003=jayson[_0x6f2b('0x1b')][_0x6f2b('0x1c')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x55a13f,_0x2663d3,_0x192e80,_0x3adb1b){return new BPromise(function(_0x280fc4,_0x16ea96){var _0x5e05aa=_0x3adb1b||client;return _0x5e05aa['request'](_0x55a13f,_0x192e80)[_0x6f2b('0x1d')](function(_0x98169d){logger[_0x6f2b('0x1e')](_0x6f2b('0x1f'),_0x2663d3,_0x6f2b('0x20'));logger[_0x6f2b('0x21')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2663d3,_0x6f2b('0x20'),JSON[_0x6f2b('0x22')](_0x98169d));if(_0x98169d[_0x6f2b('0x23')]){if(_0x98169d[_0x6f2b('0x23')][_0x6f2b('0x24')]===0x1f4){logger[_0x6f2b('0x23')](_0x6f2b('0x1f'),_0x2663d3,_0x98169d[_0x6f2b('0x23')][_0x6f2b('0x25')]);return _0x16ea96(_0x98169d[_0x6f2b('0x23')][_0x6f2b('0x25')]);}logger[_0x6f2b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x2663d3,_0x98169d[_0x6f2b('0x23')][_0x6f2b('0x25')]);return _0x280fc4(_0x98169d['error'][_0x6f2b('0x25')]);}else{logger[_0x6f2b('0x1e')](_0x6f2b('0x1f'),_0x2663d3,_0x6f2b('0x20'));_0x280fc4(_0x98169d[_0x6f2b('0x26')]['message']);}})[_0x6f2b('0x27')](function(_0x26cd91){logger[_0x6f2b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x2663d3,_0x26cd91);_0x16ea96(_0x26cd91);});});}function respondWithStatusCode(_0x21c92c,_0x9de120){_0x9de120=_0x9de120||0xcc;return function(_0x131e92){if(_0x131e92){return _0x21c92c[_0x6f2b('0x28')](_0x9de120);}return _0x21c92c['status'](_0x9de120)['end']();};}function respondWithResult(_0x5169d5,_0x1ebb46){_0x1ebb46=_0x1ebb46||0xc8;return function(_0x3cb5a3){if(_0x3cb5a3){return _0x5169d5[_0x6f2b('0x29')](_0x1ebb46)['json'](_0x3cb5a3);}};}function respondWithFilteredResult(_0x48f52d,_0x8fc140){return function(_0x1579b2){if(_0x1579b2){var _0x37721e=typeof _0x8fc140['offset']===_0x6f2b('0x2a')&&typeof _0x8fc140[_0x6f2b('0x2b')]===_0x6f2b('0x2a');var _0x495545=_0x1579b2[_0x6f2b('0x2c')];var _0x161a88=_0x37721e?0x0:_0x8fc140[_0x6f2b('0x2d')];var _0x7332a8=_0x37721e?_0x1579b2[_0x6f2b('0x2c')]:_0x8fc140[_0x6f2b('0x2d')]+_0x8fc140['limit'];var _0x280130;if(_0x7332a8>=_0x495545){_0x7332a8=_0x495545;_0x280130=0xc8;}else{_0x280130=0xce;}_0x48f52d[_0x6f2b('0x29')](_0x280130);return _0x48f52d['set']('Content-Range',_0x161a88+'-'+_0x7332a8+'/'+_0x495545)[_0x6f2b('0x2e')](_0x1579b2);}return null;};}function patchUpdates(_0x4906b3){return function(_0x49adb4){try{jsonpatch[_0x6f2b('0x2f')](_0x49adb4,_0x4906b3,!![]);}catch(_0x175138){return BPromise[_0x6f2b('0x30')](_0x175138);}return _0x49adb4[_0x6f2b('0x31')]();};}function saveUpdates(_0x24678a,_0x25d72f){return function(_0x379c5a){if(_0x379c5a){return _0x379c5a[_0x6f2b('0x32')](_0x24678a)[_0x6f2b('0x1d')](function(_0x5ab459){return _0x5ab459;});}return null;};}function removeEntity(_0xb4863b,_0x254f73){return function(_0x4e4732){if(_0x4e4732){return _0x4e4732[_0x6f2b('0x33')]()[_0x6f2b('0x1d')](function(){var _0x15fc47=_0x4e4732[_0x6f2b('0x34')]({'plain':!![]});var _0xc10103='ChatWebsites';return db['UserProfileResource'][_0x6f2b('0x33')]({'where':{'type':_0xc10103,'resourceId':_0x15fc47['id']}})[_0x6f2b('0x1d')](function(){return _0x4e4732;});})[_0x6f2b('0x1d')](function(){_0xb4863b['status'](0xcc)[_0x6f2b('0x35')]();});}};}function handleEntityNotFound(_0xd31642,_0x38b9c6){return function(_0x1fe3a9){if(!_0x1fe3a9){_0xd31642['sendStatus'](0x194);}return _0x1fe3a9;};}function handleError(_0x2c55d1,_0x36aa00){_0x36aa00=_0x36aa00||0x1f4;return function(_0x2d44d4){logger['error'](_0x2d44d4[_0x6f2b('0x36')]);if(_0x2d44d4[_0x6f2b('0x37')]){delete _0x2d44d4[_0x6f2b('0x37')];}_0x2c55d1[_0x6f2b('0x29')](_0x36aa00)[_0x6f2b('0x38')](_0x2d44d4);};}exports[_0x6f2b('0x39')]=function(_0x49b002,_0x59f97e){var _0x350097={'include':[{'model':db['Pause'],'as':_0x6f2b('0x3a')}]},_0x46039e={},_0x3fd29b={'count':0x0,'rows':[]};var _0x13fec8=_[_0x6f2b('0x3b')](db[_0x6f2b('0x3c')][_0x6f2b('0x3d')],function(_0x37ec0a){return{'name':_0x37ec0a[_0x6f2b('0x3e')],'type':_0x37ec0a[_0x6f2b('0x3f')][_0x6f2b('0x40')]};});_0x46039e[_0x6f2b('0x41')]=_[_0x6f2b('0x3b')](_0x13fec8,'name');_0x46039e[_0x6f2b('0x42')]=_[_0x6f2b('0x43')](_0x49b002[_0x6f2b('0x42')]);_0x46039e['filters']=_[_0x6f2b('0x44')](_0x46039e[_0x6f2b('0x41')],_0x46039e[_0x6f2b('0x42')]);_0x350097[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x46039e[_0x6f2b('0x41')],qs[_0x6f2b('0x46')](_0x49b002[_0x6f2b('0x42')][_0x6f2b('0x46')]));_0x350097['attributes']=_0x350097[_0x6f2b('0x45')][_0x6f2b('0x47')]?_0x350097[_0x6f2b('0x45')]:_0x46039e[_0x6f2b('0x41')];if(!_0x49b002[_0x6f2b('0x42')]['hasOwnProperty'](_0x6f2b('0x48'))){_0x350097['limit']=qs[_0x6f2b('0x2b')](_0x49b002[_0x6f2b('0x42')][_0x6f2b('0x2b')]);_0x350097['offset']=qs[_0x6f2b('0x2d')](_0x49b002['query'][_0x6f2b('0x2d')]);}_0x350097[_0x6f2b('0x49')]=qs['sort'](_0x49b002[_0x6f2b('0x42')][_0x6f2b('0x4a')]);_0x350097[_0x6f2b('0x4b')]=qs[_0x6f2b('0x4c')](_[_0x6f2b('0x4d')](_0x49b002['query'],_0x46039e[_0x6f2b('0x4c')]),_0x13fec8);if(_0x49b002[_0x6f2b('0x42')][_0x6f2b('0x4e')]){_0x350097['where']=_['merge'](_0x350097[_0x6f2b('0x4b')],{'$or':_[_0x6f2b('0x3b')](_0x13fec8,function(_0x3ac235){if(_0x3ac235[_0x6f2b('0x3f')]!==_0x6f2b('0x4f')){var _0x46808c={};_0x46808c[_0x3ac235[_0x6f2b('0x37')]]={'$like':'%'+_0x49b002[_0x6f2b('0x42')][_0x6f2b('0x4e')]+'%'};return _0x46808c;}})});}_0x350097=_[_0x6f2b('0x50')]({},_0x350097,_0x49b002[_0x6f2b('0x51')]);var _0x59b180={'where':_0x350097[_0x6f2b('0x4b')]};return db[_0x6f2b('0x3c')][_0x6f2b('0x2c')](_0x59b180)[_0x6f2b('0x1d')](function(_0x1b4f31){_0x3fd29b[_0x6f2b('0x2c')]=_0x1b4f31;if(_0x49b002[_0x6f2b('0x42')][_0x6f2b('0x52')]){_0x350097[_0x6f2b('0x53')]=[{'all':!![]}];}return db[_0x6f2b('0x3c')][_0x6f2b('0x54')](_0x350097);})[_0x6f2b('0x1d')](function(_0x168f73){_0x3fd29b[_0x6f2b('0x55')]=_0x168f73;return _0x3fd29b;})[_0x6f2b('0x1d')](respondWithFilteredResult(_0x59f97e,_0x350097))['catch'](handleError(_0x59f97e,null));};exports[_0x6f2b('0x56')]=function(_0x3f1db0,_0x43eaa1){var _0x58ce5b={'raw':![],'where':{'id':_0x3f1db0['params']['id']},'include':[{'model':db['Pause'],'as':_0x6f2b('0x3a')}]},_0x494bc0={};_0x494bc0['model']=_[_0x6f2b('0x43')](db[_0x6f2b('0x3c')][_0x6f2b('0x3d')]);_0x494bc0['query']=_[_0x6f2b('0x43')](_0x3f1db0['query']);_0x494bc0['filters']=_[_0x6f2b('0x44')](_0x494bc0[_0x6f2b('0x41')],_0x494bc0['query']);_0x58ce5b[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x494bc0['model'],qs[_0x6f2b('0x46')](_0x3f1db0['query'][_0x6f2b('0x46')]));_0x58ce5b[_0x6f2b('0x45')]=_0x58ce5b[_0x6f2b('0x45')][_0x6f2b('0x47')]?_0x58ce5b['attributes']:_0x494bc0[_0x6f2b('0x41')];if(_0x3f1db0['query'][_0x6f2b('0x52')]){_0x58ce5b['include']=[{'all':!![]}];}_0x58ce5b=_[_0x6f2b('0x50')]({},_0x58ce5b,_0x3f1db0[_0x6f2b('0x51')]);return db['ChatWebsite'][_0x6f2b('0x57')](_0x58ce5b)[_0x6f2b('0x1d')](handleEntityNotFound(_0x43eaa1,null))[_0x6f2b('0x1d')](respondWithResult(_0x43eaa1,null))[_0x6f2b('0x27')](handleError(_0x43eaa1,null));};exports[_0x6f2b('0x58')]=function(_0x4b32ab,_0x1f5ad9){return db[_0x6f2b('0x3c')][_0x6f2b('0x58')](_0x4b32ab[_0x6f2b('0x59')],{})[_0x6f2b('0x1d')](function(_0x15d5e4){var _0x4b97c5=_0x4b32ab['user'][_0x6f2b('0x34')]({'plain':!![]});if(!_0x4b97c5)throw new Error(_0x6f2b('0x5a'));if(_0x4b97c5['role']===_0x6f2b('0x5b')){var _0x27d504=_0x15d5e4['get']({'plain':!![]});var _0x2457f1=_0x6f2b('0x5c');return db[_0x6f2b('0x5d')][_0x6f2b('0x57')]({'where':{'name':_0x2457f1,'userProfileId':_0x4b97c5[_0x6f2b('0x5e')]},'raw':!![]})['then'](function(_0x5b5411){if(_0x5b5411&&_0x5b5411['autoAssociation']===0x0){return db[_0x6f2b('0x5f')]['create']({'name':_0x27d504['name'],'resourceId':_0x27d504['id'],'type':_0x5b5411[_0x6f2b('0x37')],'sectionId':_0x5b5411['id']},{})[_0x6f2b('0x1d')](function(){return _0x15d5e4;});}else{return _0x15d5e4;}})['catch'](function(_0x63e90b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63e90b);throw _0x63e90b;});}return _0x15d5e4;})['then'](respondWithResult(_0x1f5ad9,0xc9))[_0x6f2b('0x27')](handleError(_0x1f5ad9,null));};exports['update']=function(_0x2e200f,_0x4010b7){if(_0x2e200f[_0x6f2b('0x59')]['id']){delete _0x2e200f[_0x6f2b('0x59')]['id'];}return db[_0x6f2b('0x3c')]['find']({'where':{'id':_0x2e200f[_0x6f2b('0x60')]['id']},'include':[{'model':db[_0x6f2b('0x61')],'as':_0x6f2b('0x3a')}]})[_0x6f2b('0x1d')](handleEntityNotFound(_0x4010b7,null))['then'](saveUpdates(_0x2e200f[_0x6f2b('0x59')],null))[_0x6f2b('0x1d')](respondWithResult(_0x4010b7,null))[_0x6f2b('0x27')](handleError(_0x4010b7,null));};exports[_0x6f2b('0x33')]=function(_0x15263f,_0x3e8e50){return db[_0x6f2b('0x3c')][_0x6f2b('0x57')]({'where':{'id':_0x15263f[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x3e8e50,null))[_0x6f2b('0x1d')](removeEntity(_0x3e8e50,null))[_0x6f2b('0x27')](handleError(_0x3e8e50,null));};exports[_0x6f2b('0x62')]=function(_0x469113,_0x5080b9){return db[_0x6f2b('0x3c')][_0x6f2b('0x62')]()[_0x6f2b('0x1d')](respondWithResult(_0x5080b9,null))[_0x6f2b('0x27')](handleError(_0x5080b9,null));};exports['addDisposition']=function(_0x5a739a,_0x9d794d,_0x234cb8){if(_0x5a739a['body']['id']){delete _0x5a739a[_0x6f2b('0x59')]['id'];}return db['ChatWebsite'][_0x6f2b('0x57')]({'where':{'id':_0x5a739a['params']['id']}})['then'](handleEntityNotFound(_0x9d794d,null))[_0x6f2b('0x1d')](function(_0xe8d74d){if(_0xe8d74d){_0x5a739a[_0x6f2b('0x59')][_0x6f2b('0x63')]=_0xe8d74d['id'];return db[_0x6f2b('0x64')]['create'](_0x5a739a[_0x6f2b('0x59')]);}})[_0x6f2b('0x1d')](respondWithResult(_0x9d794d,null))[_0x6f2b('0x27')](handleError(_0x9d794d,null));};exports[_0x6f2b('0x65')]=function(_0x1e29b7,_0x4c7147,_0x3a9525){var _0x217978={'raw':![],'where':{}};var _0x30bb77={};var _0x32ed04={'count':0x0,'rows':[]};return db[_0x6f2b('0x3c')][_0x6f2b('0x66')]({'where':{'id':_0x1e29b7[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x4c7147,null))['then'](function(_0x5c4d1f){if(_0x5c4d1f){_0x30bb77[_0x6f2b('0x41')]=_['keys'](db[_0x6f2b('0x64')]['rawAttributes']);_0x30bb77[_0x6f2b('0x42')]=_['keys'](_0x1e29b7[_0x6f2b('0x42')]);_0x30bb77['filters']=_[_0x6f2b('0x44')](_0x30bb77[_0x6f2b('0x41')],_0x30bb77[_0x6f2b('0x42')]);_0x217978[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x30bb77['model'],qs['fields'](_0x1e29b7['query'][_0x6f2b('0x46')]));_0x217978[_0x6f2b('0x45')]=_0x217978[_0x6f2b('0x45')]['length']?_0x217978['attributes']:_0x30bb77['model'];if(!_0x1e29b7[_0x6f2b('0x42')][_0x6f2b('0x67')](_0x6f2b('0x48'))){_0x217978[_0x6f2b('0x2b')]=qs[_0x6f2b('0x2b')](_0x1e29b7[_0x6f2b('0x42')][_0x6f2b('0x2b')]);_0x217978[_0x6f2b('0x2d')]=qs[_0x6f2b('0x2d')](_0x1e29b7[_0x6f2b('0x42')]['offset']);}_0x217978[_0x6f2b('0x49')]=qs[_0x6f2b('0x4a')](_0x1e29b7[_0x6f2b('0x42')][_0x6f2b('0x4a')]);_0x217978[_0x6f2b('0x4b')]=qs[_0x6f2b('0x4c')](_[_0x6f2b('0x4d')](_0x1e29b7['query'],_0x30bb77[_0x6f2b('0x4c')]));_0x217978[_0x6f2b('0x4b')][_0x6f2b('0x63')]=_0x5c4d1f['id'];if(_0x1e29b7['query']['filter']){_0x217978['where']=_[_0x6f2b('0x50')](_0x217978[_0x6f2b('0x4b')],{'$or':_[_0x6f2b('0x3b')](_0x217978['attributes'],function(_0x57ee11){var _0x1bd347={};_0x1bd347[_0x57ee11]={'$like':'%'+_0x1e29b7[_0x6f2b('0x42')]['filter']+'%'};return _0x1bd347;})});}_0x217978=_[_0x6f2b('0x50')]({},_0x217978,_0x1e29b7[_0x6f2b('0x51')]);return db[_0x6f2b('0x64')]['count']({'where':_0x217978['where']})['then'](function(_0x4bee53){_0x32ed04[_0x6f2b('0x2c')]=_0x4bee53;if(_0x1e29b7['query'][_0x6f2b('0x52')]){_0x217978[_0x6f2b('0x53')]=[{'all':!![]}];}return db[_0x6f2b('0x64')][_0x6f2b('0x54')](_0x217978);})[_0x6f2b('0x1d')](function(_0x22a192){_0x32ed04[_0x6f2b('0x55')]=_0x22a192;return _0x32ed04;});}})['then'](respondWithFilteredResult(_0x4c7147,_0x217978))[_0x6f2b('0x27')](handleError(_0x4c7147,null));};exports[_0x6f2b('0x68')]=function(_0x417805,_0x276cba,_0x10dcc7){return db['ChatWebsite'][_0x6f2b('0x57')]({'where':{'id':_0x417805[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x276cba,null))[_0x6f2b('0x1d')](function(_0x345a5c){if(_0x345a5c){return _0x345a5c[_0x6f2b('0x68')](_0x417805[_0x6f2b('0x42')][_0x6f2b('0x69')]);}})[_0x6f2b('0x1d')](respondWithStatusCode(_0x276cba,null))[_0x6f2b('0x27')](handleError(_0x276cba,null));};exports[_0x6f2b('0x6a')]=function(_0x5ad06c,_0x376af9,_0x5b5b14){if(_0x5ad06c[_0x6f2b('0x59')]['id']){delete _0x5ad06c[_0x6f2b('0x59')]['id'];}return db[_0x6f2b('0x3c')][_0x6f2b('0x57')]({'where':{'id':_0x5ad06c[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x376af9,null))[_0x6f2b('0x1d')](function(_0x55027f){if(_0x55027f){_0x5ad06c[_0x6f2b('0x59')][_0x6f2b('0x63')]=_0x55027f['id'];return db[_0x6f2b('0x6b')][_0x6f2b('0x58')](_0x5ad06c[_0x6f2b('0x59')]);}})[_0x6f2b('0x1d')](respondWithResult(_0x376af9,null))['catch'](handleError(_0x376af9,null));};exports[_0x6f2b('0x6c')]=function(_0x591f4f,_0x3b8774,_0x5d9ed3){var _0x1d6f6e={'raw':![],'where':{}};var _0x4cca89={};var _0x23d5a0={'count':0x0,'rows':[]};return db[_0x6f2b('0x3c')]['findOne']({'where':{'id':_0x591f4f[_0x6f2b('0x60')]['id']}})['then'](handleEntityNotFound(_0x3b8774,null))['then'](function(_0x394937){if(_0x394937){_0x4cca89['model']=_[_0x6f2b('0x43')](db[_0x6f2b('0x6b')]['rawAttributes']);_0x4cca89[_0x6f2b('0x42')]=_[_0x6f2b('0x43')](_0x591f4f[_0x6f2b('0x42')]);_0x4cca89['filters']=_['intersection'](_0x4cca89[_0x6f2b('0x41')],_0x4cca89[_0x6f2b('0x42')]);_0x1d6f6e[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x4cca89[_0x6f2b('0x41')],qs['fields'](_0x591f4f[_0x6f2b('0x42')][_0x6f2b('0x46')]));_0x1d6f6e[_0x6f2b('0x45')]=_0x1d6f6e['attributes'][_0x6f2b('0x47')]?_0x1d6f6e[_0x6f2b('0x45')]:_0x4cca89['model'];if(!_0x591f4f[_0x6f2b('0x42')][_0x6f2b('0x67')]('nolimit')){_0x1d6f6e['limit']=qs[_0x6f2b('0x2b')](_0x591f4f[_0x6f2b('0x42')]['limit']);_0x1d6f6e['offset']=qs[_0x6f2b('0x2d')](_0x591f4f[_0x6f2b('0x42')][_0x6f2b('0x2d')]);}_0x1d6f6e[_0x6f2b('0x49')]=qs[_0x6f2b('0x4a')](_0x591f4f[_0x6f2b('0x42')]['sort']);_0x1d6f6e['where']=qs[_0x6f2b('0x4c')](_['pick'](_0x591f4f[_0x6f2b('0x42')],_0x4cca89[_0x6f2b('0x4c')]));_0x1d6f6e[_0x6f2b('0x4b')][_0x6f2b('0x63')]=_0x394937['id'];if(_0x591f4f[_0x6f2b('0x42')][_0x6f2b('0x4e')]){_0x1d6f6e[_0x6f2b('0x4b')]=_['merge'](_0x1d6f6e[_0x6f2b('0x4b')],{'$or':_[_0x6f2b('0x3b')](_0x1d6f6e[_0x6f2b('0x45')],function(_0x46c18f){var _0x3beff3={};_0x3beff3[_0x46c18f]={'$like':'%'+_0x591f4f[_0x6f2b('0x42')][_0x6f2b('0x4e')]+'%'};return _0x3beff3;})});}_0x1d6f6e=_['merge']({},_0x1d6f6e,_0x591f4f['options']);return db['CannedAnswer'][_0x6f2b('0x2c')]({'where':_0x1d6f6e[_0x6f2b('0x4b')]})[_0x6f2b('0x1d')](function(_0x10a1f2){_0x23d5a0['count']=_0x10a1f2;if(_0x591f4f[_0x6f2b('0x42')][_0x6f2b('0x52')]){_0x1d6f6e[_0x6f2b('0x53')]=[{'all':!![]}];}return db[_0x6f2b('0x6b')][_0x6f2b('0x54')](_0x1d6f6e);})[_0x6f2b('0x1d')](function(_0x36f7a5){_0x23d5a0[_0x6f2b('0x55')]=_0x36f7a5;return _0x23d5a0;});}})[_0x6f2b('0x1d')](respondWithFilteredResult(_0x3b8774,_0x1d6f6e))['catch'](handleError(_0x3b8774,null));};exports['removeAnswers']=function(_0xd1117,_0x1722c8,_0x4b3638){return db[_0x6f2b('0x3c')][_0x6f2b('0x57')]({'where':{'id':_0xd1117[_0x6f2b('0x60')]['id']}})['then'](handleEntityNotFound(_0x1722c8,null))[_0x6f2b('0x1d')](function(_0x5369d8){if(_0x5369d8){return _0x5369d8[_0x6f2b('0x6d')](_0xd1117[_0x6f2b('0x42')][_0x6f2b('0x69')]);}})[_0x6f2b('0x1d')](respondWithStatusCode(_0x1722c8,null))['catch'](handleError(_0x1722c8,null));};exports[_0x6f2b('0x6e')]=function(_0x42305e,_0x3881d1,_0x5d34c5){_0x42305e[_0x6f2b('0x59')][_0x6f2b('0x6f')]=_0x42305e[_0x6f2b('0x70')]['filename'];return db[_0x6f2b('0x3c')]['find']({'where':{'id':_0x42305e[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x3881d1,null))[_0x6f2b('0x1d')](saveUpdates(_0x42305e[_0x6f2b('0x59')],null))['then'](respondWithResult(_0x3881d1,null))[_0x6f2b('0x27')](handleError(_0x3881d1,null));};exports[_0x6f2b('0x71')]=function(_0x22804a,_0x1f5079,_0x5c6c81){_0x22804a[_0x6f2b('0x59')][_0x6f2b('0x72')]=_0x22804a['file']['filename'];return db[_0x6f2b('0x3c')][_0x6f2b('0x57')]({'where':{'id':_0x22804a['params']['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x1f5079,null))[_0x6f2b('0x1d')](saveUpdates(_0x22804a[_0x6f2b('0x59')],null))[_0x6f2b('0x1d')](respondWithResult(_0x1f5079,null))[_0x6f2b('0x27')](handleError(_0x1f5079,null));};exports['addCustomerAvatar']=function(_0x5e7768,_0x2a2c7b,_0x53833d){_0x5e7768[_0x6f2b('0x59')][_0x6f2b('0x73')]=_0x5e7768[_0x6f2b('0x70')][_0x6f2b('0x74')];return db['ChatWebsite'][_0x6f2b('0x57')]({'where':{'id':_0x5e7768['params']['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x2a2c7b,null))['then'](saveUpdates(_0x5e7768['body'],null))[_0x6f2b('0x1d')](respondWithResult(_0x2a2c7b,null))['catch'](handleError(_0x2a2c7b,null));};exports[_0x6f2b('0x75')]=function(_0x4c7a18,_0x353140,_0x36f373){_0x4c7a18[_0x6f2b('0x59')][_0x6f2b('0x76')]=_0x4c7a18[_0x6f2b('0x70')][_0x6f2b('0x74')];return db[_0x6f2b('0x3c')][_0x6f2b('0x57')]({'where':{'id':_0x4c7a18[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x353140,null))['then'](saveUpdates(_0x4c7a18['body'],null))['then'](respondWithResult(_0x353140,null))[_0x6f2b('0x27')](handleError(_0x353140,null));};exports[_0x6f2b('0x77')]=function(_0xd250ac,_0x536abb,_0x4fe11d){var _0x38e36f=path['join'](config[_0x6f2b('0x78')],_0x6f2b('0x79'));var _0x18d761={'where':{'id':_0xd250ac[_0x6f2b('0x60')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xfbe946=![];return require(_0x6f2b('0x7a'))[_0x6f2b('0x7b')]()[_0x6f2b('0x1d')](function(_0x2bf014){if(_0x2bf014){_0xfbe946=_0x2bf014[_0x6f2b('0x7c')];}})['then'](function(){return db[_0x6f2b('0x3c')][_0x6f2b('0x57')](_0x18d761);})[_0x6f2b('0x1d')](handleEntityNotFound(_0x536abb,null))[_0x6f2b('0x1d')](function(_0x25a4f6){if(_0x25a4f6){if(!_[_0x6f2b('0x7d')](_0x25a4f6[_0x6f2b('0x6f')])){if(fs['existsSync'](path[_0x6f2b('0x7e')](config['root'],'server/files/images/logos/',_0x25a4f6[_0x6f2b('0x6f')]))&&_0xfbe946){_0x38e36f=path[_0x6f2b('0x7e')](config['root'],'server/files/images/logos/',_0x25a4f6[_0x6f2b('0x6f')]);}}return _0x536abb[_0x6f2b('0x7f')](_0x38e36f);}})[_0x6f2b('0x27')](handleError(_0x536abb,null));};exports[_0x6f2b('0x80')]=function(_0x276774,_0x3afe5e,_0x1b90dc){var _0x30fe9a=path['join'](config[_0x6f2b('0x78')],'server/files/images/avatars/default_avatar.png');var _0x1605df={'where':{'id':_0x276774[_0x6f2b('0x60')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6f2b('0x3c')][_0x6f2b('0x57')](_0x1605df)['then'](handleEntityNotFound(_0x3afe5e,null))[_0x6f2b('0x1d')](function(_0x4e5942){if(_0x4e5942){if(!_[_0x6f2b('0x7d')](_0x4e5942[_0x6f2b('0x72')])){if(fs['existsSync'](path[_0x6f2b('0x7e')](config['root'],'server/files/images/avatars/',_0x4e5942[_0x6f2b('0x72')]))){_0x30fe9a=path['join'](config[_0x6f2b('0x78')],_0x6f2b('0x81'),_0x4e5942[_0x6f2b('0x72')]);}}return _0x3afe5e[_0x6f2b('0x7f')](_0x30fe9a);}})[_0x6f2b('0x27')](handleError(_0x3afe5e,null));};exports[_0x6f2b('0x82')]=function(_0x48019a,_0x5bcdc8,_0x5b9803){var _0x298eda=path[_0x6f2b('0x7e')](config[_0x6f2b('0x78')],_0x6f2b('0x83'));var _0x5df2a0={'where':{'id':_0x48019a['params']['id']},'attributes':['id',_0x6f2b('0x73'),_0x6f2b('0x84')],'raw':!![]};return db['ChatWebsite'][_0x6f2b('0x57')](_0x5df2a0)[_0x6f2b('0x1d')](handleEntityNotFound(_0x5bcdc8,null))[_0x6f2b('0x1d')](function(_0x379365){if(_0x379365){if(!_[_0x6f2b('0x7d')](_0x379365[_0x6f2b('0x73')])){if(fs['existsSync'](path[_0x6f2b('0x7e')](config['root'],'server/files/images/avatars/',_0x379365['customerAvatar']))&&_0x379365[_0x6f2b('0x84')]){_0x298eda=path[_0x6f2b('0x7e')](config[_0x6f2b('0x78')],'server/files/images/avatars/',_0x379365['customerAvatar']);}}return _0x5bcdc8[_0x6f2b('0x7f')](_0x298eda);}})[_0x6f2b('0x27')](handleError(_0x5bcdc8,null));};exports[_0x6f2b('0x85')]=function(_0x11b5ad,_0x5c2b1c,_0x14b7d6){var _0x1ee921=path[_0x6f2b('0x7e')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x249b26={'where':{'id':_0x11b5ad['params']['id']},'attributes':['id',_0x6f2b('0x76')],'raw':!![]};return db[_0x6f2b('0x3c')][_0x6f2b('0x57')](_0x249b26)[_0x6f2b('0x1d')](handleEntityNotFound(_0x5c2b1c,null))[_0x6f2b('0x1d')](function(_0xc11d28){if(_0xc11d28){if(!_[_0x6f2b('0x7d')](_0xc11d28['systemAvatar'])){if(fs[_0x6f2b('0x86')](path[_0x6f2b('0x7e')](config['root'],_0x6f2b('0x81'),_0xc11d28['systemAvatar']))){_0x1ee921=path[_0x6f2b('0x7e')](config[_0x6f2b('0x78')],_0x6f2b('0x81'),_0xc11d28[_0x6f2b('0x76')]);}}return _0x5c2b1c[_0x6f2b('0x7f')](_0x1ee921);}})[_0x6f2b('0x27')](handleError(_0x5c2b1c,null));};exports[_0x6f2b('0x87')]=function(_0x242c03,_0x1873f6,_0x16a96b){var _0x4f4b9e=require(_0x6f2b('0x88'));var _0x47d763=new _0x4f4b9e();var _0x2033bd=_0x47d763['setUA'](_0x242c03[_0x6f2b('0x89')][_0x6f2b('0x8a')])[_0x6f2b('0x8b')]();var _0x3d28ba={'body':_0x242c03[_0x6f2b('0x59')],'channel':_0x6f2b('0x8c')};var _0x324471=[];var _0x1f556d=[];var _0x4ec3da={};var _0x8da4cc=![];return db[_0x6f2b('0x8d')][_0x6f2b('0x62')]()[_0x6f2b('0x1d')](function(_0x30fe69){if(!_0x30fe69){throw new db[(_0x6f2b('0x8e'))]['ValidationError'](_0x6f2b('0x8f'));}_0x324471=_[_0x6f2b('0x90')](_[_0x6f2b('0x43')](_0x30fe69),[_0x6f2b('0x91'),_0x6f2b('0x92')]);_0x1f556d=_[_0x6f2b('0x90')](_[_0x6f2b('0x43')](_0x30fe69),[_0x6f2b('0x91'),'updatedAt',_0x6f2b('0x93'),_0x6f2b('0x94')]);if(_0x242c03[_0x6f2b('0x59')]['id']){delete _0x242c03[_0x6f2b('0x59')]['id'];}if(_[_0x6f2b('0x7d')](_0x242c03['body'][_0x6f2b('0x95')])){throw new db[(_0x6f2b('0x8e'))]['ValidationError'](_0x6f2b('0x96'));}if(_['isNil'](_0x242c03[_0x6f2b('0x59')][_0x6f2b('0x59')])||_0x242c03[_0x6f2b('0x59')][_0x6f2b('0x59')]===''){throw new db[(_0x6f2b('0x8e'))][(_0x6f2b('0x97'))](_0x6f2b('0x98'));}if(_[_0x6f2b('0x7d')](_0x242c03['body']['mapKey'])){throw new db[(_0x6f2b('0x8e'))][(_0x6f2b('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f556d);}if(!_[_0x6f2b('0x99')](_0x1f556d,_0x242c03[_0x6f2b('0x59')][_0x6f2b('0x9a')])){throw new db[(_0x6f2b('0x8e'))][(_0x6f2b('0x97'))](_0x6f2b('0x9b')+_0x1f556d);}_0x4ec3da[_0x242c03['body'][_0x6f2b('0x9a')]]=_0x242c03[_0x6f2b('0x59')][_0x6f2b('0x95')];})[_0x6f2b('0x1d')](function(){return db['ChatWebsite'][_0x6f2b('0x57')]({'where':{'id':_0x242c03['params']['id']},'include':[{'model':db[_0x6f2b('0x9c')],'as':_0x6f2b('0x9d'),'include':[{'model':db['CmContact'],'as':_0x6f2b('0x9e'),'where':_0x4ec3da,'limit':0x1,'order':[['updatedAt',_0x6f2b('0x9f')]]}]},{'model':db[_0x6f2b('0xa0')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1873f6,null))[_0x6f2b('0x1d')](function(_0x4f5412){if(_0x4f5412&&_0x4f5412[_0x6f2b('0x9d')]){_0x3d28ba[_0x6f2b('0xa1')]=_0x4f5412;_0x3d28ba[_0x6f2b('0xa2')]=_0x4f5412[_0x6f2b('0xa3')];_0x3d28ba[_0x6f2b('0xa4')]=_0x4f5412['List'];_0x3d28ba['applications']=_[_0x6f2b('0xa5')](_0x3d28ba['applications'],[_0x6f2b('0xa6')],['asc']);if(_0x3d28ba['account']['Applications']){delete _0x3d28ba[_0x6f2b('0xa1')][_0x6f2b('0xa3')];}if(_0x3d28ba[_0x6f2b('0xa1')][_0x6f2b('0x9d')]&&_0x3d28ba[_0x6f2b('0xa1')][_0x6f2b('0x9d')][_0x6f2b('0x9e')]['length']){return _0x3d28ba[_0x6f2b('0xa1')][_0x6f2b('0x9d')][_0x6f2b('0x9e')][0x0];}var _0x12c295=_['defaults'](_0x242c03[_0x6f2b('0x59')],{'firstName':_0x242c03[_0x6f2b('0x59')]['from'],'ListId':_0x4f5412[_0x6f2b('0x94')]});_0x12c295[_0x242c03[_0x6f2b('0x59')]['mapKey']]=_0x242c03[_0x6f2b('0x59')][_0x6f2b('0x95')];return db[_0x6f2b('0x8d')][_0x6f2b('0x58')](_0x12c295,{'fields':_0x324471,'raw':!![]});}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x1873f6,null))[_0x6f2b('0x1d')](function(_0x347068){_0x3d28ba[_0x6f2b('0xa7')]=_0x347068;var _0x1db3fc=_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xa8')];if(_0x242c03[_0x6f2b('0x89')][_0x6f2b('0xa9')]){_0x1db3fc=_0x242c03[_0x6f2b('0x89')]['cf-connecting-ip'];}else if(_0x242c03[_0x6f2b('0x89')][_0x6f2b('0xaa')]){_0x1db3fc=_[_0x6f2b('0xab')](_0x242c03[_0x6f2b('0x89')]['x-forwarded-for'][_0x6f2b('0xac')](','));}if(_0x347068){var _0x3042d2={'ContactId':_0x347068['id'],'ChatWebsiteId':_0x242c03[_0x6f2b('0x60')]['id'],'from':(_0x347068['firstName']||'')+'\x20'+(_0x347068[_0x6f2b('0xad')]||''),'customerIp':_0x1db3fc,'customerPort':_0x242c03['headers'][_0x6f2b('0xae')]?_0x242c03[_0x6f2b('0x89')][_0x6f2b('0xae')]:null,'referer':_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xaf')],'browserName':_0x2033bd[_0x6f2b('0xb0')][_0x6f2b('0x37')]&&_0x2033bd[_0x6f2b('0xb0')][_0x6f2b('0xb1')]?util[_0x6f2b('0xb2')]('%s\x20%s',_0x2033bd[_0x6f2b('0xb0')]['name'],_0x2033bd[_0x6f2b('0xb0')]['version']):_0x6f2b('0xb3'),'browserVersion':_0x2033bd[_0x6f2b('0xb0')][_0x6f2b('0xb1')]||_0x6f2b('0xb3'),'osName':util[_0x6f2b('0xb2')](_0x6f2b('0xb4'),_0x2033bd['os'][_0x6f2b('0x37')],_0x2033bd['os'][_0x6f2b('0xb1')]),'osVersion':_0x2033bd['os'][_0x6f2b('0xb1')],'deviceModel':_0x2033bd[_0x6f2b('0xb5')]['model']&&_0x2033bd[_0x6f2b('0xb5')]['vendor']?util[_0x6f2b('0xb2')](_0x6f2b('0xb6'),_0x2033bd[_0x6f2b('0xb5')][_0x6f2b('0x41')],_0x2033bd[_0x6f2b('0xb5')][_0x6f2b('0xb7')],_0x2033bd['device'][_0x6f2b('0x3f')]):null,'deviceVendor':_0x2033bd[_0x6f2b('0xb5')][_0x6f2b('0xb7')],'deviceType':_0x2033bd[_0x6f2b('0xb5')][_0x6f2b('0x3f')],'formData':JSON[_0x6f2b('0x22')](_0x242c03[_0x6f2b('0x59')])};var _0x3bf6e4={'ChatWebsiteId':_0x242c03['params']['id'],'closed':![]};if(_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xb8')]){_0x3bf6e4['threadId']=_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xb8')];return db[_0x6f2b('0xb9')]['find']({'where':_0x3bf6e4})['then'](function(_0x2cfc1e){if(_0x2cfc1e){return[_0x2cfc1e,![]];}_0x3042d2['threadId']=_0x242c03[_0x6f2b('0x59')]['threadId'];_0x3042d2[_0x6f2b('0xba')]=_0x242c03['body'][_0x6f2b('0xba')];return db[_0x6f2b('0xb9')][_0x6f2b('0x58')](_0x3042d2)[_0x6f2b('0x1d')](function(_0x3c6147){return[_0x3c6147,!![]];});});}_0x3bf6e4['ContactId']=_0x347068['id'];if(_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xbb')]&&_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xbb')]['id']){_0x3bf6e4['id']=_0x242c03[_0x6f2b('0x59')]['interaction']['id'];return db[_0x6f2b('0xb9')][_0x6f2b('0x57')]({'where':_0x3bf6e4})[_0x6f2b('0x1d')](function(_0x37b384){if(_0x37b384){return[_0x37b384,![]];}return db[_0x6f2b('0xb9')][_0x6f2b('0x58')](_0x3042d2)[_0x6f2b('0x1d')](function(_0x39b5f3){return[_0x39b5f3,!![]];});});}return db['ChatInteraction'][_0x6f2b('0x58')](_0x3042d2)['then'](function(_0x1aeeb2){return[_0x1aeeb2,!![]];});}})[_0x6f2b('0xbc')](function(_0x1d9ff1,_0x2a742d){if(_0x1d9ff1){_0x8da4cc=_0x2a742d;if(!_0x2a742d){var _0xe94365={'from':(_0x3d28ba['contact'][_0x6f2b('0xbd')]||'')+'\x20'+(_0x3d28ba[_0x6f2b('0xa7')][_0x6f2b('0xad')]||'')};if(_0x242c03[_0x6f2b('0x59')]['threadId']&&_0x242c03[_0x6f2b('0x59')]['messageId']&&_0x242c03['body'][_0x6f2b('0xb8')]!=_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xbe')]){_0xe94365[_0x6f2b('0xb8')]=_0x242c03[_0x6f2b('0x59')][_0x6f2b('0xbe')];}return _0x1d9ff1[_0x6f2b('0x32')](_0xe94365);}else{return _0x1d9ff1;}}})[_0x6f2b('0x1d')](function(_0x5204e7){_0x3d28ba['interaction']=_0x5204e7[_0x6f2b('0x34')]({'plain':!![]});_0x3d28ba[_0x6f2b('0xbb')][_0x6f2b('0xbf')]=_0x8da4cc;if(_0x3d28ba[_0x6f2b('0xbb')][_0x6f2b('0xbf')]){if(_0x3d28ba['account']['autoclose']){_0x3d28ba[_0x6f2b('0xa2')][_0x6f2b('0xc0')]({'id':0x0,'priority':_0x3d28ba[_0x6f2b('0xa2')][_0x6f2b('0x47')]+0x1,'app':_0x6f2b('0xc1'),'appdata':_0x6f2b('0xc2'),'interval':_0x6f2b('0xc3')});}}return db[_0x6f2b('0xc4')][_0x6f2b('0x58')]({'body':_0x242c03[_0x6f2b('0x59')][_0x6f2b('0x59')],'ChatWebsiteId':_0x242c03[_0x6f2b('0x60')]['id'],'ChatInteractionId':_0x5204e7['id'],'direction':'in','ContactId':_0x3d28ba[_0x6f2b('0xa7')]['id'],'AttachmentId':_0x242c03['body'][_0x6f2b('0xc5')]});})[_0x6f2b('0x1d')](function(_0x46e51d){_0x3d28ba['message']=_0x46e51d;if(_0x3d28ba[_0x6f2b('0xbb')]['UserId']){return db['User']['find']({'attributes':['id',_0x6f2b('0x37')],'where':{'id':_0x3d28ba[_0x6f2b('0xbb')]['UserId']}})[_0x6f2b('0x1d')](function(_0x32223b){if(_0x32223b){_0x3d28ba[_0x6f2b('0xa2')][_0x6f2b('0xc6')]({'id':0x0,'priority':0x0,'app':_0x6f2b('0xc7'),'appdata':_0x32223b[_0x6f2b('0x37')]+','+(_0x3d28ba['account'][_0x6f2b('0xc8')]||0xa),'interval':_0x6f2b('0xc3')});_0x3d28ba[_0x6f2b('0xc9')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x3d28ba);});}return respondWithRpcPromise(_0x6f2b('0xca'),_0x6f2b('0xcb'),_0x3d28ba);})['then'](function(_0x3deaa6){respondWithRpcPromise(_0x6f2b('0xcc'),_0x6f2b('0xcc'),{'event':_0x6f2b('0x87'),'message':_0x3deaa6},client9002);return _0x3deaa6;})['then'](respondWithResult(_0x1873f6,null))[_0x6f2b('0x27')](handleError(_0x1873f6,null));};exports[_0x6f2b('0xcd')]=function(_0x30aa80,_0x272b8a,_0x5a1e2f){var _0x4ded31,_0x3a96ea,_0x3c739a;var _0x59bafd=[];var _0x3f6a58=[];var _0x2bb8bd={};var _0x35a64a=_0x30aa80[_0x6f2b('0xce')]||[];var _0x2af40a=[];var _0x14ad9b;return db[_0x6f2b('0x8d')][_0x6f2b('0x62')]()['then'](function(_0x537846){if(!_0x537846){throw new db['Sequelize'][(_0x6f2b('0x97'))](_0x6f2b('0x8f'));}_0x3f6a58=_[_0x6f2b('0x90')](_[_0x6f2b('0x43')](_0x537846),[_0x6f2b('0x91'),_0x6f2b('0x92')]);_0x59bafd=_['difference'](_['keys'](_0x537846),[_0x6f2b('0x91'),_0x6f2b('0x92'),_0x6f2b('0x93'),_0x6f2b('0x94')]);if(_0x30aa80[_0x6f2b('0x59')]['id']){delete _0x30aa80['body']['id'];}if(_[_0x6f2b('0x7d')](_0x30aa80[_0x6f2b('0x59')][_0x6f2b('0x95')])){throw _0x272b8a[_0x6f2b('0x29')](0x1f4)[_0x6f2b('0x38')](new db[(_0x6f2b('0x8e'))][(_0x6f2b('0x97'))](_0x6f2b('0x96')));}if(_[_0x6f2b('0x7d')](_0x30aa80[_0x6f2b('0x59')][_0x6f2b('0x59')])||_0x30aa80['body'][_0x6f2b('0x59')]===''){throw _0x272b8a[_0x6f2b('0x29')](0x1f4)[_0x6f2b('0x38')](new db[(_0x6f2b('0x8e'))][(_0x6f2b('0x97'))](_0x6f2b('0x98')));}if(_[_0x6f2b('0x7d')](_0x30aa80[_0x6f2b('0x59')]['mapKeyOffline'])){throw _0x272b8a['status'](0x1f4)[_0x6f2b('0x38')](new db[(_0x6f2b('0x8e'))]['ValidationError'](_0x6f2b('0xcf')+_0x59bafd));}if(!_['includes'](_0x59bafd,_0x30aa80[_0x6f2b('0x59')][_0x6f2b('0xd0')])){throw _0x272b8a['status'](0x1f4)[_0x6f2b('0x38')](new db[(_0x6f2b('0x8e'))][(_0x6f2b('0x97'))](_0x6f2b('0xd1')+_0x59bafd));}_0x2bb8bd[_0x30aa80['body'][_0x6f2b('0xd0')]]=_0x30aa80[_0x6f2b('0x59')][_0x6f2b('0x95')];})[_0x6f2b('0x1d')](function(){return db['ChatWebsite'][_0x6f2b('0x57')]({'where':{'id':_0x30aa80[_0x6f2b('0x60')]['id']},'include':[{'model':db[_0x6f2b('0x9c')],'as':'List'},{'model':db[_0x6f2b('0xd2')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x272b8a,null))['then'](function(_0x453f6e){if(_0x453f6e&&_0x453f6e[_0x6f2b('0x9d')]){_0x3a96ea=_0x453f6e;var _0x50ff3d=_[_0x6f2b('0x16')](_0x30aa80['body'],{'firstName':_0x30aa80[_0x6f2b('0x59')]['from'],'phone':_0x30aa80[_0x6f2b('0x59')]['from'],'ListId':_0x453f6e['ListId']});_0x50ff3d[_0x30aa80[_0x6f2b('0x59')][_0x6f2b('0xd0')]]=_0x30aa80[_0x6f2b('0x59')]['from'];return db[_0x6f2b('0x8d')][_0x6f2b('0xd3')]({'where':_0x2bb8bd,'defaults':_0x50ff3d});}})['spread'](function(_0x39eba2){if(_0x39eba2){_0x3c739a=_0x39eba2;var _0x4dcf96=fs[_0x6f2b('0xd4')](path[_0x6f2b('0x7e')](config['root'],_0x6f2b('0xd5')),'utf8');var _0x369cf0=ejs[_0x6f2b('0xd6')](_0x4dcf96,{'body':_[_0x6f2b('0xd7')](_0x30aa80[_0x6f2b('0x59')][_0x6f2b('0x59')]),'bodyTitle':_0x3a96ea[_0x6f2b('0xd8')]});return db['ChatOfflineMessage'][_0x6f2b('0x58')]({'body':_0x369cf0,'ContactId':_0x39eba2['id'],'ChatWebsiteId':_0x3a96ea['id']});}})['then'](function(_0x1ed5eb){_0x14ad9b=_0x1ed5eb;if(_0x35a64a['length']){var _0x23fdf9=_0x35a64a['map'](function(_0x40b108){return{'name':_0x40b108['originalname'],'basename':_0x40b108[_0x6f2b('0x74')],'type':_0x40b108[_0x6f2b('0xd9')],'ChatOfflineMessageId':_0x1ed5eb['id']};});_0x2af40a=_0x23fdf9[_0x6f2b('0x3b')](_0x401cda=>{var _0x3c5fae={'filename':_0x401cda['name'],'path':path['join'](config[_0x6f2b('0x78')],'server',_0x6f2b('0xce'),'attachments',_0x6f2b('0xda'),_0x401cda[_0x6f2b('0xdb')])};return _0x3c5fae;});if(!_0x3a96ea[_0x6f2b('0xdc')]){return db[_0x6f2b('0xdd')][_0x6f2b('0xde')](function(_0x54ba4a){return db[_0x6f2b('0xdf')]['bulkCreate'](_0x23fdf9,{'transaction':_0x54ba4a});});}}})[_0x6f2b('0x1d')](function(){if(_0x14ad9b){_0x4ded31=_0x14ad9b;return db[_0x6f2b('0xd2')][_0x6f2b('0x66')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6f2b('0xe0'),'raw':!![]}]});}})[_0x6f2b('0x1d')](function(_0x1aaf51){if(_0x1aaf51&&_0x1aaf51[_0x6f2b('0xe0')]&&_0x3a96ea['forwardOffline']&&_0x3a96ea['forwardOfflineAddress']){var _0x475b8e={'tls':{'rejectUnauthorized':![]}};if(_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0xe1')]){_0x475b8e[_0x6f2b('0xe1')]=_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0xe1')];}else{_0x475b8e['host']=_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0xe2')];_0x475b8e['port']=_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0xe3')];_0x475b8e[_0x6f2b('0xe4')]=_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0xe4')];}if(_0x1aaf51[_0x6f2b('0xe0')]['authentication']){_0x475b8e[_0x6f2b('0xe5')]={'user':_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0x5b')],'pass':_0x1aaf51[_0x6f2b('0xe0')][_0x6f2b('0xe6')]};}return respondWithRpcPromise(_0x6f2b('0xe7'),_0x6f2b('0xe8'),{'account':_0x475b8e,'message':{'from':util[_0x6f2b('0xb2')]('\x22%s\x22\x20<%s>',_0x1aaf51[_0x6f2b('0x37')],_0x1aaf51['email']||_0x1aaf51[_0x6f2b('0xe0')]['user']),'to':_0x3a96ea[_0x6f2b('0xe9')],'subject':_0x3a96ea[_0x6f2b('0xea')],'html':_0x4ded31[_0x6f2b('0x59')],'attachments':_0x2af40a}},client9003)[_0x6f2b('0x1d')](function(){return _0x4ded31;})[_0x6f2b('0x27')](function(_0x126f4c){console['error'](_0x126f4c);});}})[_0x6f2b('0x1d')](function(){if(_0x3a96ea&&_0x3a96ea[_0x6f2b('0xdc')]&&_0x3a96ea[_0x6f2b('0xeb')]){var _0x30664a=[];if(_0x35a64a['length']){_0x30664a=_0x35a64a[_0x6f2b('0x3b')](function(_0x335df5){return{'name':_0x335df5[_0x6f2b('0xec')],'basename':_0x335df5[_0x6f2b('0x74')],'type':_0x335df5[_0x6f2b('0xd9')],'ChatOfflineMessageId':_0x14ad9b['id']};});}var _0x18bda2;if(!_[_0x6f2b('0x7d')](_0x3a96ea[_0x6f2b('0xed')])){var _0x234dd8=_[_0x6f2b('0x3b')](_0x30aa80[_0x6f2b('0x59')],function(_0x443669){return _0x443669;});var _0x596885=_[_0x6f2b('0xee')](_0x234dd8)[0x0];var _0x48d774=_[_0x6f2b('0xef')](_0x596885,function(_0x2d8f96){return _0x2d8f96;});_0x18bda2=_0x48d774[0x1][_0x3a96ea[_0x6f2b('0xed')]];}var _0x293dd7={'from':_0x3c739a[_0x6f2b('0xf0')],'firstName':_0x3c739a['firstName'],'lastName':_0x3c739a['lastName'],'mapKey':_0x6f2b('0xf0'),'message':{'from':_0x3c739a[_0x6f2b('0xf0')],'to':_0x3a96ea['MailAccount'][_0x6f2b('0xf0')],'cc':'','subject':_[_0x6f2b('0x7d')](_0x18bda2)?_0x3a96ea[_0x6f2b('0xea')]:_0x18bda2,'messageId':'','sentAt':new Date(),'attach':_0x30664a[_0x6f2b('0x47')],'attachments':_0x30664a,'originChannel':_0x6f2b('0xf1'),'ChatWebsiteId':_0x3a96ea['id'],'ChatOfflineMessageId':_0x4ded31['id'],'originTo':_0x3a96ea[_0x6f2b('0xd2')][_0x6f2b('0xf0')]},'body':_0x4ded31[_0x6f2b('0x59')]};var _0x5642be={'account':{'id':_0x3a96ea[_0x6f2b('0xeb')]},'body':_0x293dd7,'log':_0x6f2b('0xf2')};return respondWithRpcPromise(_0x6f2b('0xf2'),_0x6f2b('0xf3'),_0x5642be,client9001)['then'](function(){return _0x4ded31;})[_0x6f2b('0x27')](function(_0x1b82b3){console[_0x6f2b('0x23')](_0x1b82b3);});}return;})['then'](function(){if(_0x4ded31){return _0x4ded31;}})['then'](respondWithResult(_0x272b8a,null))['catch'](function(_0x4290b4){console[_0x6f2b('0x23')]('catch',_0x4290b4);for(var _0x1921bf of _0x35a64a){var _0x62791=path[_0x6f2b('0x7e')](config['root'],_0x6f2b('0xf4'),'files',_0x6f2b('0xf5'),_0x6f2b('0xda'),_0x1921bf[_0x6f2b('0x74')]);fs_extra[_0x6f2b('0xf6')](_0x62791)[_0x6f2b('0x27')](function(_0xc9276e){console[_0x6f2b('0x23')](_0x6f2b('0xf7'),_0x62791,_0xc9276e);});}});};exports[_0x6f2b('0xf8')]=function(_0x480102,_0x4bfa9b,_0x39e069){return db[_0x6f2b('0xb9')][_0x6f2b('0x57')]({'where':{'id':_0x480102[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x4bfa9b,null))['then'](function(_0x5a6150){if(_0x5a6150){return _0x5a6150[_0x6f2b('0xf8')](_0x480102['body'][_0x6f2b('0x69')],_['omit'](_0x480102[_0x6f2b('0x59')],[_0x6f2b('0x69'),'id'])||{});}})[_0x6f2b('0x1d')](respondWithResult(_0x4bfa9b,null))[_0x6f2b('0x27')](handleError(_0x4bfa9b,null));};exports['getInteractions']=function(_0x5569af,_0x40d1fc,_0x21f43a){var _0x595eb7={'raw':![],'where':{}};var _0x4aed92={};var _0x3ffadf={'count':0x0,'rows':[]};return db[_0x6f2b('0x3c')][_0x6f2b('0x66')]({'where':{'id':_0x5569af[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x40d1fc,null))[_0x6f2b('0x1d')](function(_0x278a3f){if(_0x278a3f){_0x4aed92[_0x6f2b('0x41')]=_[_0x6f2b('0x43')](db[_0x6f2b('0xb9')][_0x6f2b('0x3d')]);_0x4aed92[_0x6f2b('0x42')]=_[_0x6f2b('0x43')](_0x5569af[_0x6f2b('0x42')]);_0x4aed92['filters']=_[_0x6f2b('0x44')](_0x4aed92[_0x6f2b('0x41')],_0x4aed92['query']);_0x595eb7[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x4aed92['model'],qs[_0x6f2b('0x46')](_0x5569af[_0x6f2b('0x42')][_0x6f2b('0x46')]));_0x595eb7[_0x6f2b('0x45')]=_0x595eb7['attributes'][_0x6f2b('0x47')]?_0x595eb7[_0x6f2b('0x45')]:_0x4aed92[_0x6f2b('0x41')];if(!_0x5569af[_0x6f2b('0x42')][_0x6f2b('0x67')](_0x6f2b('0x48'))){_0x595eb7[_0x6f2b('0x2b')]=qs[_0x6f2b('0x2b')](_0x5569af[_0x6f2b('0x42')][_0x6f2b('0x2b')]);_0x595eb7[_0x6f2b('0x2d')]=qs['offset'](_0x5569af[_0x6f2b('0x42')][_0x6f2b('0x2d')]);}_0x595eb7[_0x6f2b('0x49')]=qs[_0x6f2b('0x4a')](_0x5569af[_0x6f2b('0x42')]['sort']);_0x595eb7[_0x6f2b('0x4b')]=qs[_0x6f2b('0x4c')](_[_0x6f2b('0x4d')](_0x5569af['query'],_0x4aed92[_0x6f2b('0x4c')]));_0x595eb7[_0x6f2b('0x4b')][_0x6f2b('0x63')]=_0x278a3f['id'];if(_0x5569af['query'][_0x6f2b('0x4e')]){_0x595eb7[_0x6f2b('0x4b')]=_[_0x6f2b('0x50')](_0x595eb7[_0x6f2b('0x4b')],{'$or':_[_0x6f2b('0x3b')](_0x595eb7[_0x6f2b('0x45')],function(_0x452d39){var _0x545864={};_0x545864[_0x452d39]={'$like':'%'+_0x5569af[_0x6f2b('0x42')][_0x6f2b('0x4e')]+'%'};return _0x545864;})});}_0x595eb7=_[_0x6f2b('0x50')]({},_0x595eb7,_0x5569af[_0x6f2b('0x51')]);return db[_0x6f2b('0xb9')][_0x6f2b('0x2c')]({'where':_0x595eb7[_0x6f2b('0x4b')]})[_0x6f2b('0x1d')](function(_0x24127d){_0x3ffadf[_0x6f2b('0x2c')]=_0x24127d;if(_0x5569af[_0x6f2b('0x42')][_0x6f2b('0x52')]){_0x595eb7['include']=[{'model':db[_0x6f2b('0x8d')],'as':_0x6f2b('0xf9'),'required':![]},{'model':db[_0x6f2b('0xfa')],'as':_0x6f2b('0xfb'),'attributes':[_0x6f2b('0x37'),_0x6f2b('0xfc'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x6f2b('0xfd'),'attributes':['id',_0x6f2b('0x37'),'color'],'where':_0x5569af[_0x6f2b('0x42')][_0x6f2b('0xfe')]?{'id':_0x5569af['query'][_0x6f2b('0xfe')]}:undefined,'required':_0x5569af[_0x6f2b('0x42')]['tag']?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x595eb7);})[_0x6f2b('0x1d')](function(_0x10ce61){_0x3ffadf[_0x6f2b('0x55')]=_0x10ce61;return _0x3ffadf;});}})[_0x6f2b('0x1d')](respondWithFilteredResult(_0x40d1fc,_0x595eb7))[_0x6f2b('0x27')](handleError(_0x40d1fc,null));};function iftimePromise(_0x2efe39,_0x4c3101){return respondWithRpcPromise(_0x6f2b('0xff'),'getSnippet',{'command':_0x4c3101[_0x6f2b('0x100')]?util[_0x6f2b('0xb2')]('iftime\x20%s,%s',_0x2efe39['interval'],_0x4c3101[_0x6f2b('0x100')]):util['format'](_0x6f2b('0x101'),_0x2efe39[_0x6f2b('0x102')])},client9002)['then'](function(_0x542883){var _0x4d7494=_0x542883&&_0x542883[_0x6f2b('0x103')](_0x6f2b('0x104'))>=0x0?!![]:![];logger[_0x6f2b('0x1e')](_0x6f2b('0x105'),_0x4c3101['id'],_0x2efe39['id'],_0x2efe39[_0x6f2b('0x102')],_0x4d7494?_0x6f2b('0x106'):'OFFLINE',_0x4c3101[_0x6f2b('0x100')]?_0x4c3101[_0x6f2b('0x100')]:'No\x20timezone');return _0x4d7494;})['catch'](function(_0x5f4c63){logger[_0x6f2b('0x23')](_0x6f2b('0x105'),_0x4c3101['id'],_0x2efe39['id'],_0x2efe39['interval'],util[_0x6f2b('0x107')](_0x5f4c63,{'showHidden':![],'depth':null}),_0x4c3101[_0x6f2b('0x100')]?_0x4c3101[_0x6f2b('0x100')]:_0x6f2b('0x108'));return![];});}exports[_0x6f2b('0x109')]=function(_0x4f4194,_0x3b0fdc,_0x1de2b5){var _0x705e0d=0x0;var _0x4df639=0x0;var _0x410a49=![];var _0x27470d;var _0x16ee0b;return db[_0x6f2b('0x3c')]['find']({'where':{'id':_0x4f4194[_0x6f2b('0x60')]['id']},'include':[{'model':db[_0x6f2b('0x10a')],'as':_0x6f2b('0x10a'),'include':[{'model':db[_0x6f2b('0x10a')],'as':_0x6f2b('0x10b'),'attributes':['id',_0x6f2b('0x102')],'raw':!![]}]}]})[_0x6f2b('0x1d')](handleEntityNotFound(_0x3b0fdc,null))[_0x6f2b('0x1d')](function(_0xa642e1){if(_0xa642e1){_0x27470d=_0xa642e1;return _0xa642e1['getProactiveActions']({'raw':!![]});}})[_0x6f2b('0x1d')](function(_0x561a0c){if(_0x27470d){if(_0x561a0c){_0x16ee0b=_0x561a0c;}}return require(_0x6f2b('0x7a'))[_0x6f2b('0x7b')]();})[_0x6f2b('0x1d')](function(_0x224984){if(_0x224984){_0x4df639=_0x224984['virtual'];_0x410a49=_0x224984['custom'];}})['then'](function(){return db['ChatInteraction'][_0x6f2b('0x2c')]({'where':{'closed':![]}});})[_0x6f2b('0x1d')](function(_0x3bcb62){_0x705e0d=_0x3bcb62;if(_0x4df639&&_0x3bcb62>_0x4df639){return db[_0x6f2b('0x10c')][_0x6f2b('0x66')]({'where':{'id':0x1}})['then'](function(_0x335ebe){if(_0x335ebe){_0x335ebe['increment']('chatLicenseExceeded');}});}})[_0x6f2b('0x1d')](function(){if(_0x27470d[_0x6f2b('0x10a')]&&_0x27470d[_0x6f2b('0x10a')]['Intervals']){var _0x107ff7=[];for(var _0x4709d6=0x0;_0x4709d6<_0x27470d[_0x6f2b('0x10a')]['Intervals']['length'];_0x4709d6++){var _0x469d2c=_0x27470d[_0x6f2b('0x10a')][_0x6f2b('0x10b')][_0x4709d6][_0x6f2b('0x34')]({'plain':!![]});_0x107ff7[_0x6f2b('0xc0')](iftimePromise(_0x469d2c,_0x27470d));}return BPromise['all'](_0x107ff7)[_0x6f2b('0x1d')](function(_0x532d26){return _[_0x6f2b('0x10d')](_0x532d26);});}else{return!![];}})[_0x6f2b('0x1d')](function(_0x43af64){var _0x6f092e=fs[_0x6f2b('0xd4')](path[_0x6f2b('0x7e')](config['root'],_0x6f2b('0x10e')),_0x6f2b('0x10f'));var _0x48fa5a={'remote':_0x27470d[_0x6f2b('0x110')],'query':querystring[_0x6f2b('0x22')](_[_0x6f2b('0x50')](_0x27470d[_0x6f2b('0x34')]({'plain':!![]}),{'customerIp':_0x4f4194[_0x6f2b('0x89')][_0x6f2b('0xaa')]||_0x4f4194[_0x6f2b('0x89')][_0x6f2b('0x111')]||_0x4f4194[_0x6f2b('0x112')]['remoteAddress']||_0x4f4194['ip'],'referer':_0x4f4194['headers'][_0x6f2b('0xaf')],'openedInteractions':_0x705e0d,'maxInteractions':_0x4df639,'virtual':_0x410a49[_0x6f2b('0x113')],'online':_0x43af64,'custom':_0x410a49}))[_0x6f2b('0x114')](/'/g,'\x5c\x27')};_0x3b0fdc[_0x6f2b('0x38')](ejs[_0x6f2b('0xd6')](Mustache[_0x6f2b('0xd6')](_0x6f092e,_0x48fa5a),{'proactiveActions':_0x16ee0b,'alignment':_0x27470d[_0x6f2b('0x115')],'verticalAlignment':_0x27470d['verticalAlignment'],'div_color':_0x27470d[_0x6f2b('0x116')],'text_color':_0x27470d[_0x6f2b('0x117')],'button_color':_0x27470d[_0x6f2b('0x118')],'background_color':_0x27470d[_0x6f2b('0x119')]}));})[_0x6f2b('0x27')](handleError(_0x3b0fdc,null));};exports[_0x6f2b('0x11a')]=function(_0x26e270,_0x79ae59,_0x4c21f3){return db[_0x6f2b('0x3c')][_0x6f2b('0x66')]({'where':{'id':_0x26e270['params']['id']}})['then'](handleEntityNotFound(_0x79ae59,null))[_0x6f2b('0x1d')](function(_0x506db7){if(_0x506db7){return db[_0x6f2b('0xdd')][_0x6f2b('0xde')](function(_0x2f2c69){return db['ChatApplication'][_0x6f2b('0x33')]({'where':{'ChatWebsiteId':_0x26e270[_0x6f2b('0x60')]['id']},'transaction':_0x2f2c69})[_0x6f2b('0x1d')](function(_0x2658a0){var _0x9709f1=_[_0x6f2b('0x3b')](_0x26e270[_0x6f2b('0x59')],function(_0x54920c){_0x54920c[_0x6f2b('0x63')]=_0x26e270['params']['id'];return _0x54920c;});return db[_0x6f2b('0xa0')][_0x6f2b('0x11b')](_0x9709f1,{'transaction':_0x2f2c69});});})[_0x6f2b('0x1d')](function(){return db['ChatApplication'][_0x6f2b('0x11c')]({'where':{'ChatWebsiteId':_0x26e270[_0x6f2b('0x60')]['id']},'order':_0x6f2b('0xa6')});});}})[_0x6f2b('0x1d')](respondWithResult(_0x79ae59,null))[_0x6f2b('0x27')](handleError(_0x79ae59,null));};exports[_0x6f2b('0x11d')]=function(_0x1a76fa,_0x50e1a8,_0x18e57c){var _0x12ac43={};var _0x28a651={};var _0x33a55c;var _0x18e594;return db[_0x6f2b('0x3c')][_0x6f2b('0x66')]({'where':{'id':_0x1a76fa['params']['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x50e1a8,null))[_0x6f2b('0x1d')](function(_0x2e8a2b){if(_0x2e8a2b){_0x33a55c=_0x2e8a2b;_0x28a651[_0x6f2b('0x41')]=_[_0x6f2b('0x43')](db[_0x6f2b('0xa0')][_0x6f2b('0x3d')]);_0x28a651[_0x6f2b('0x42')]=_[_0x6f2b('0x43')](_0x1a76fa[_0x6f2b('0x42')]);_0x28a651[_0x6f2b('0x4c')]=_['intersection'](_0x28a651['model'],_0x28a651[_0x6f2b('0x42')]);_0x12ac43[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x28a651[_0x6f2b('0x41')],qs['fields'](_0x1a76fa['query'][_0x6f2b('0x46')]));_0x12ac43['attributes']=_0x12ac43['attributes'][_0x6f2b('0x47')]?_0x12ac43['attributes']:_0x28a651[_0x6f2b('0x41')];_0x12ac43['order']=qs[_0x6f2b('0x4a')](_0x1a76fa['query'][_0x6f2b('0x4a')]);_0x12ac43[_0x6f2b('0x4b')]=qs['filters'](_[_0x6f2b('0x4d')](_0x1a76fa[_0x6f2b('0x42')],_0x28a651[_0x6f2b('0x4c')]));if(_0x1a76fa[_0x6f2b('0x42')][_0x6f2b('0x4e')]){_0x12ac43['where']=_['merge'](_0x12ac43[_0x6f2b('0x4b')],{'$or':_[_0x6f2b('0x3b')](_0x12ac43[_0x6f2b('0x45')],function(_0x2320ee){var _0x467b3b={};_0x467b3b[_0x2320ee]={'$like':'%'+_0x1a76fa[_0x6f2b('0x42')][_0x6f2b('0x4e')]+'%'};return _0x467b3b;})});}_0x12ac43=_[_0x6f2b('0x50')]({},_0x12ac43,_0x1a76fa['options']);return _0x33a55c['getApplications'](_0x12ac43);}})[_0x6f2b('0x1d')](function(_0x4e178c){if(_0x4e178c){_0x18e594=_0x4e178c[_0x6f2b('0x47')];if(!_0x1a76fa[_0x6f2b('0x42')][_0x6f2b('0x67')]('nolimit')){_0x12ac43['limit']=qs['limit'](_0x1a76fa[_0x6f2b('0x42')][_0x6f2b('0x2b')]);_0x12ac43['offset']=qs[_0x6f2b('0x2d')](_0x1a76fa[_0x6f2b('0x42')][_0x6f2b('0x2d')]);}return _0x33a55c[_0x6f2b('0x11d')](_0x12ac43);}})[_0x6f2b('0x1d')](function(_0xf4b0c4){if(_0xf4b0c4){return _0xf4b0c4?{'count':_0x18e594,'rows':_0xf4b0c4}:null;}})[_0x6f2b('0x1d')](respondWithResult(_0x50e1a8,null))[_0x6f2b('0x27')](handleError(_0x50e1a8,null));};exports[_0x6f2b('0x11e')]=function(_0x29248f,_0x57549e,_0xdc7033){return db[_0x6f2b('0x11f')][_0x6f2b('0x57')]({'where':{'id':_0x29248f[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x57549e,null))['then'](function(_0x4a07b6){if(_0x4a07b6){return _0x4a07b6[_0x6f2b('0x11e')](_0x29248f[_0x6f2b('0x59')]['ids'],_[_0x6f2b('0x120')](_0x29248f[_0x6f2b('0x59')],[_0x6f2b('0x69'),'id'])||{});}})['then'](respondWithResult(_0x57549e,null))[_0x6f2b('0x27')](handleError(_0x57549e,null));};exports[_0x6f2b('0x121')]=function(_0x3e1525,_0x5113a1,_0x56c16e){var _0x3e4644={};var _0x4ee2f7={};var _0x491a81;var _0x1dffc3;return db[_0x6f2b('0x3c')][_0x6f2b('0x66')]({'where':{'id':_0x3e1525['params']['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x5113a1,null))[_0x6f2b('0x1d')](function(_0x534674){if(_0x534674){_0x491a81=_0x534674;_0x4ee2f7[_0x6f2b('0x41')]=_['keys'](db[_0x6f2b('0x122')][_0x6f2b('0x3d')]);_0x4ee2f7['query']=_[_0x6f2b('0x43')](_0x3e1525[_0x6f2b('0x42')]);_0x4ee2f7['filters']=_['intersection'](_0x4ee2f7[_0x6f2b('0x41')],_0x4ee2f7[_0x6f2b('0x42')]);_0x3e4644[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x4ee2f7[_0x6f2b('0x41')],qs[_0x6f2b('0x46')](_0x3e1525[_0x6f2b('0x42')][_0x6f2b('0x46')]));_0x3e4644[_0x6f2b('0x45')]=_0x3e4644[_0x6f2b('0x45')]['length']?_0x3e4644[_0x6f2b('0x45')]:_0x4ee2f7[_0x6f2b('0x41')];_0x3e4644[_0x6f2b('0x49')]=qs[_0x6f2b('0x4a')](_0x3e1525['query'][_0x6f2b('0x4a')]);_0x3e4644[_0x6f2b('0x4b')]=qs['filters'](_['pick'](_0x3e1525[_0x6f2b('0x42')],_0x4ee2f7[_0x6f2b('0x4c')]));if(_0x3e1525['query'][_0x6f2b('0x4e')]){_0x3e4644[_0x6f2b('0x4b')]=_[_0x6f2b('0x50')](_0x3e4644[_0x6f2b('0x4b')],{'$or':_['map'](_0x3e4644[_0x6f2b('0x45')],function(_0x2350b5){var _0x30175b={};_0x30175b[_0x2350b5]={'$like':'%'+_0x3e1525[_0x6f2b('0x42')][_0x6f2b('0x4e')]+'%'};return _0x30175b;})});}_0x3e4644=_[_0x6f2b('0x50')]({},_0x3e4644,_0x3e1525[_0x6f2b('0x51')]);return _0x491a81['getProactiveActions'](_0x3e4644);}})[_0x6f2b('0x1d')](function(_0x2efa7d){if(_0x2efa7d){_0x1dffc3=_0x2efa7d[_0x6f2b('0x47')];if(!_0x3e1525['query'][_0x6f2b('0x67')](_0x6f2b('0x48'))){_0x3e4644[_0x6f2b('0x2b')]=qs[_0x6f2b('0x2b')](_0x3e1525[_0x6f2b('0x42')]['limit']);_0x3e4644[_0x6f2b('0x2d')]=qs[_0x6f2b('0x2d')](_0x3e1525[_0x6f2b('0x42')]['offset']);}return _0x491a81[_0x6f2b('0x121')](_0x3e4644);}})[_0x6f2b('0x1d')](function(_0x1de3fa){if(_0x1de3fa){return _0x1de3fa?{'count':_0x1dffc3,'rows':_0x1de3fa}:null;}})['then'](respondWithResult(_0x5113a1,null))['catch'](handleError(_0x5113a1,null));};exports[_0x6f2b('0x123')]=function(_0x4d2704,_0x5efc5c,_0x2db8c){var _0x533d3e=_0x4d2704[_0x6f2b('0x42')][_0x6f2b('0x124')]===_0x6f2b('0x125')?_0x6f2b('0x126'):_0x6f2b('0x127');return db['ChatWebsite'][_0x6f2b('0x57')]({'attributes':['id',_0x533d3e],'where':{'id':_0x4d2704['params']['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x5efc5c,null))[_0x6f2b('0x1d')](function(_0x3c6d60){if(_0x3c6d60){var _0x329daf=_0x3c6d60[_0x533d3e];var _0x3f50b1=_0x329daf&&_0x329daf[_0x6f2b('0x128')]?_0x329daf[_0x6f2b('0x128')]:[];_0x5efc5c[_0x6f2b('0x38')]({'fromKey':_[_0x6f2b('0x7d')](_0x329daf[_0x6f2b('0x129')])?undefined:_0x329daf['fromKey'],'count':_0x3f50b1[_0x6f2b('0x47')],'rows':_0x3f50b1});}})[_0x6f2b('0x27')](handleError(_0x5efc5c,null));};exports['getOfflineMessages']=function(_0x57e592,_0xcd8518,_0x18aedd){var _0x2a5950={'raw':![],'where':{}};var _0x4425a9={};var _0x2ea754={'count':0x0,'rows':[]};return db[_0x6f2b('0x3c')][_0x6f2b('0x66')]({'where':{'id':_0x57e592[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0xcd8518,null))[_0x6f2b('0x1d')](function(_0x2b4b1b){if(_0x2b4b1b){_0x4425a9[_0x6f2b('0x41')]=_[_0x6f2b('0x43')](db['ChatOfflineMessage']['rawAttributes']);_0x4425a9['query']=_['keys'](_0x57e592['query']);_0x4425a9[_0x6f2b('0x4c')]=_['intersection'](_0x4425a9[_0x6f2b('0x41')],_0x4425a9['query']);_0x2a5950[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x4425a9[_0x6f2b('0x41')],qs[_0x6f2b('0x46')](_0x57e592['query']['fields']));_0x2a5950['attributes']=_0x2a5950[_0x6f2b('0x45')][_0x6f2b('0x47')]?_0x2a5950[_0x6f2b('0x45')]:_0x4425a9[_0x6f2b('0x41')];if(!_0x57e592['query']['hasOwnProperty'](_0x6f2b('0x48'))){_0x2a5950['limit']=qs[_0x6f2b('0x2b')](_0x57e592[_0x6f2b('0x42')]['limit']);_0x2a5950[_0x6f2b('0x2d')]=qs[_0x6f2b('0x2d')](_0x57e592['query']['offset']);}_0x2a5950[_0x6f2b('0x49')]=qs[_0x6f2b('0x4a')](_0x57e592['query'][_0x6f2b('0x4a')]);_0x2a5950[_0x6f2b('0x4b')]=qs[_0x6f2b('0x4c')](_[_0x6f2b('0x4d')](_0x57e592[_0x6f2b('0x42')],_0x4425a9[_0x6f2b('0x4c')]));_0x2a5950[_0x6f2b('0x4b')][_0x6f2b('0x63')]=_0x2b4b1b['id'];if(_0x57e592[_0x6f2b('0x42')][_0x6f2b('0x4e')]){_0x2a5950[_0x6f2b('0x4b')]=_[_0x6f2b('0x50')](_0x2a5950[_0x6f2b('0x4b')],{'$or':_[_0x6f2b('0x3b')](_0x2a5950[_0x6f2b('0x45')],function(_0x387ed4){var _0x5aa51a={};_0x5aa51a[_0x387ed4]={'$like':'%'+_0x57e592[_0x6f2b('0x42')]['filter']+'%'};return _0x5aa51a;})});}_0x2a5950=_[_0x6f2b('0x50')]({},_0x2a5950,_0x57e592[_0x6f2b('0x51')]);return db[_0x6f2b('0x12a')][_0x6f2b('0x2c')]({'where':_0x2a5950['where']})[_0x6f2b('0x1d')](function(_0xe54353){_0x2ea754['count']=_0xe54353;if(_0x57e592['query'][_0x6f2b('0x52')]){_0x2a5950[_0x6f2b('0x53')]=[{'all':!![]}];}else{_0x2a5950[_0x6f2b('0x53')]=[{'model':db[_0x6f2b('0x8d')],'as':_0x6f2b('0xf9'),'required':![]},{'model':db[_0x6f2b('0xdf')],'as':_0x6f2b('0x12b'),'required':![]}];}return db[_0x6f2b('0x12a')][_0x6f2b('0x54')](_0x2a5950);})[_0x6f2b('0x1d')](function(_0x40d0fc){_0x2ea754['rows']=_0x40d0fc;return _0x2ea754;});}})[_0x6f2b('0x1d')](respondWithFilteredResult(_0xcd8518,_0x2a5950))[_0x6f2b('0x27')](handleError(_0xcd8518,null));};exports[_0x6f2b('0x12c')]=function(_0x1ee170,_0x3e9580,_0x2a70c6){return db['ChatWebsite'][_0x6f2b('0x57')]({'where':{'id':_0x1ee170['params']['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x3e9580,null))[_0x6f2b('0x1d')](function(_0x171a12){if(_0x171a12){return _0x171a12['addAgents'](_0x1ee170[_0x6f2b('0x59')][_0x6f2b('0x69')],_['omit'](_0x1ee170[_0x6f2b('0x59')],['ids','id'])||{})[_0x6f2b('0xbc')](function(_0x5d13ac){for(var _0x3812ae=0x0;_0x3812ae<_0x1ee170['body'][_0x6f2b('0x69')][_0x6f2b('0x47')];_0x3812ae+=0x1){socket[_0x6f2b('0x12d')](_0x6f2b('0x12e'),{'UserId':Number(_0x1ee170[_0x6f2b('0x59')]['ids'][_0x3812ae]),'ChatWebsiteId':Number(_0x1ee170[_0x6f2b('0x60')]['id'])});}return _0x5d13ac;});}})['then'](respondWithResult(_0x3e9580,null))[_0x6f2b('0x27')](handleError(_0x3e9580,null));};exports[_0x6f2b('0x12f')]=function(_0x21817b,_0x3636e8,_0x2c3e34){return db[_0x6f2b('0x3c')][_0x6f2b('0x57')]({'where':{'id':_0x21817b[_0x6f2b('0x60')]['id']}})['then'](handleEntityNotFound(_0x3636e8,null))[_0x6f2b('0x1d')](function(_0x397533){if(_0x397533){return _0x397533[_0x6f2b('0x12f')](_0x21817b[_0x6f2b('0x42')][_0x6f2b('0x69')])[_0x6f2b('0x1d')](function(){if(_[_0x6f2b('0x130')](_0x21817b[_0x6f2b('0x42')]['ids'])){for(var _0x3e7482=0x0;_0x3e7482<_0x21817b['query'][_0x6f2b('0x69')][_0x6f2b('0x47')];_0x3e7482+=0x1){socket[_0x6f2b('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x21817b[_0x6f2b('0x42')]['ids'][_0x3e7482]),'ChatWebsiteId':Number(_0x21817b[_0x6f2b('0x60')]['id'])});}}else{socket['emit'](_0x6f2b('0x131'),{'UserId':Number(_0x21817b['query'][_0x6f2b('0x69')]),'ChatWebsiteId':Number(_0x21817b[_0x6f2b('0x60')]['id'])});}});}})[_0x6f2b('0x1d')](respondWithStatusCode(_0x3636e8,null))[_0x6f2b('0x27')](handleError(_0x3636e8,null));};exports[_0x6f2b('0x132')]=function(_0x3b65a6,_0x19b9d6,_0x4edcba){var _0x21bd5a={};var _0x55ae86={};var _0x719293;var _0x484cb9;return db['ChatWebsite'][_0x6f2b('0x66')]({'where':{'id':_0x3b65a6[_0x6f2b('0x60')]['id']}})[_0x6f2b('0x1d')](handleEntityNotFound(_0x19b9d6,null))[_0x6f2b('0x1d')](function(_0x4516b4){if(_0x4516b4){_0x719293=_0x4516b4;_0x55ae86['model']=_['keys'](db[_0x6f2b('0xfa')][_0x6f2b('0x3d')]);_0x55ae86['query']=_['keys'](_0x3b65a6['query']);_0x55ae86['filters']=_['intersection'](_0x55ae86[_0x6f2b('0x41')],_0x55ae86['query']);_0x21bd5a[_0x6f2b('0x45')]=_[_0x6f2b('0x44')](_0x55ae86['model'],qs[_0x6f2b('0x46')](_0x3b65a6[_0x6f2b('0x42')][_0x6f2b('0x46')]));_0x21bd5a[_0x6f2b('0x45')]=_0x21bd5a[_0x6f2b('0x45')][_0x6f2b('0x47')]?_0x21bd5a[_0x6f2b('0x45')]:_0x55ae86[_0x6f2b('0x41')];_0x21bd5a[_0x6f2b('0x49')]=qs['sort'](_0x3b65a6[_0x6f2b('0x42')][_0x6f2b('0x4a')]);_0x21bd5a[_0x6f2b('0x4b')]=qs[_0x6f2b('0x4c')](_[_0x6f2b('0x4d')](_0x3b65a6[_0x6f2b('0x42')],_0x55ae86[_0x6f2b('0x4c')]));if(_0x3b65a6[_0x6f2b('0x42')][_0x6f2b('0x4e')]){_0x21bd5a[_0x6f2b('0x4b')]=_[_0x6f2b('0x50')](_0x21bd5a['where'],{'$or':_[_0x6f2b('0x3b')](_0x21bd5a[_0x6f2b('0x45')],function(_0x26d62a){var _0x3a4610={};_0x3a4610[_0x26d62a]={'$like':'%'+_0x3b65a6['query']['filter']+'%'};return _0x3a4610;})});}_0x21bd5a=_[_0x6f2b('0x50')]({},_0x21bd5a,_0x3b65a6[_0x6f2b('0x51')]);return _0x719293[_0x6f2b('0x132')](_0x21bd5a);}})['then'](function(_0x44c40b){if(_0x44c40b){_0x484cb9=_0x44c40b['length'];if(!_0x3b65a6[_0x6f2b('0x42')][_0x6f2b('0x67')](_0x6f2b('0x48'))){_0x21bd5a['limit']=qs[_0x6f2b('0x2b')](_0x3b65a6[_0x6f2b('0x42')][_0x6f2b('0x2b')]);_0x21bd5a[_0x6f2b('0x2d')]=qs[_0x6f2b('0x2d')](_0x3b65a6[_0x6f2b('0x42')]['offset']);}return _0x719293[_0x6f2b('0x132')](_0x21bd5a);}})[_0x6f2b('0x1d')](function(_0x328e7a){if(_0x328e7a){return _0x328e7a?{'count':_0x484cb9,'rows':_0x328e7a}:null;}})[_0x6f2b('0x1d')](respondWithResult(_0x19b9d6,null))['catch'](handleError(_0x19b9d6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 04f3cf3..c502f05 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 _0x76bb=['hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x1a1a1a,_0x2fd632){var _0x5232d3=function(_0x48da5e){while(--_0x48da5e){_0x1a1a1a['push'](_0x1a1a1a['shift']());}};_0x5232d3(++_0x2fd632);}(_0x76bb,0x16a));var _0xb76b=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x76bb[_0x4d8666];return _0x37175b;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xb76b('0x0'))['db'][_0xb76b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb76b('0x2')](0x0);var events={'afterCreate':_0xb76b('0x3'),'afterUpdate':'update','afterDestroy':_0xb76b('0x4')};function emitEvent(_0x1f5d45){return function(_0x4e5042,_0x414cff,_0x19a231){ChatWebsiteEvents['emit'](_0x1f5d45+':'+_0x4e5042['id'],_0x4e5042);ChatWebsiteEvents[_0xb76b('0x5')](_0x1f5d45,_0x4e5042);_0x19a231(null);};}for(var e in events){if(events[_0xb76b('0x6')](e)){var event=events[e];ChatWebsite[_0xb76b('0x7')](e,emitEvent(event));}}module[_0xb76b('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x815b=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x501401,_0x2d8737){var _0xfd0a47=function(_0x57decb){while(--_0x57decb){_0x501401['push'](_0x501401['shift']());}};_0xfd0a47(++_0x2d8737);}(_0x815b,0xb4));var _0xb815=function(_0x571723,_0x51c1e4){_0x571723=_0x571723-0x0;var _0x536331=_0x815b[_0x571723];return _0x536331;};'use strict';var EventEmitter=require(_0xb815('0x0'));var ChatWebsite=require(_0xb815('0x1'))['db'][_0xb815('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb815('0x3')](0x0);var events={'afterCreate':_0xb815('0x4'),'afterUpdate':'update','afterDestroy':_0xb815('0x5')};function emitEvent(_0x5352a9){return function(_0x5b4516,_0x16c25e,_0xed30fe){ChatWebsiteEvents[_0xb815('0x6')](_0x5352a9+':'+_0x5b4516['id'],_0x5b4516);ChatWebsiteEvents['emit'](_0x5352a9,_0x5b4516);_0xed30fe(null);};}for(var e in events){if(events[_0xb815('0x7')](e)){var event=events[e];ChatWebsite[_0xb815('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 01ee7d9..3560572 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 _0xbc32=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatWebsite','chat_websites','lodash'];(function(_0x479435,_0x46d4ee){var _0x227565=function(_0x4bd773){while(--_0x4bd773){_0x479435['push'](_0x479435['shift']());}};_0x227565(++_0x46d4ee);}(_0xbc32,0x196));var _0x2bc3=function(_0x1c0dd8,_0x1659d4){_0x1c0dd8=_0x1c0dd8-0x0;var _0x582223=_0xbc32[_0x1c0dd8];return _0x582223;};'use strict';var _=require(_0x2bc3('0x0'));var util=require(_0x2bc3('0x1'));var logger=require('../../config/logger')(_0x2bc3('0x2'));var moment=require(_0x2bc3('0x3'));var BPromise=require(_0x2bc3('0x4'));var rp=require(_0x2bc3('0x5'));var fs=require('fs');var path=require(_0x2bc3('0x6'));var rimraf=require(_0x2bc3('0x7'));var config=require(_0x2bc3('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x2dacd5,_0x5d72cc){return _0x2dacd5['define'](_0x2bc3('0x9'),attributes,{'tableName':_0x2bc3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc4=['ChatWebsite','chat_websites','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x3f6395,_0x3dbdb8){var _0x823586=function(_0x3f58de){while(--_0x3f58de){_0x3f6395['push'](_0x3f6395['shift']());}};_0x823586(++_0x3dbdb8);}(_0x3fc4,0x160));var _0x43fc=function(_0x88a34d,_0x17b654){_0x88a34d=_0x88a34d-0x0;var _0x58482e=_0x3fc4[_0x88a34d];return _0x58482e;};'use strict';var _=require(_0x43fc('0x0'));var util=require('util');var logger=require(_0x43fc('0x1'))('api');var moment=require(_0x43fc('0x2'));var BPromise=require(_0x43fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43fc('0x4'));var rimraf=require(_0x43fc('0x5'));var config=require(_0x43fc('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x5076c2,_0xa4b4d1){return _0x5076c2[_0x43fc('0x7')](_0x43fc('0x8'),attributes,{'tableName':_0x43fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index b7cb203..496a80a 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 _0xa343=['stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xa343,0x172));var _0x3a34=function(_0x1a54c2,_0xca7365){_0x1a54c2=_0x1a54c2-0x0;var _0x72d724=_0xa343[_0x1a54c2];return _0x72d724;};'use strict';var _=require(_0x3a34('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a34('0x1'));var rs=require(_0x3a34('0x2'));var fs=require('fs');var Redis=require(_0x3a34('0x3'));var db=require(_0x3a34('0x4'))['db'];var utils=require(_0x3a34('0x5'));var logger=require(_0x3a34('0x6'))(_0x3a34('0x7'));var config=require(_0x3a34('0x8'));var jayson=require(_0x3a34('0x9'));var client=jayson['client'][_0x3a34('0xa')]({'port':0x232a});config[_0x3a34('0xb')]=_['defaults'](config[_0x3a34('0xb')],{'host':_0x3a34('0xc'),'port':0x18eb});var socket=require(_0x3a34('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x23d263,_0x1c37c7,_0x567154){return new BPromise(function(_0x54036d,_0x17bb11){return client[_0x3a34('0xe')](_0x23d263,_0x567154)[_0x3a34('0xf')](function(_0x2c64f3){logger['info'](_0x3a34('0x10'),_0x1c37c7,'request\x20sent');logger[_0x3a34('0x11')](_0x3a34('0x12'),_0x1c37c7,_0x3a34('0x13'),JSON[_0x3a34('0x14')](_0x2c64f3));if(_0x2c64f3[_0x3a34('0x15')]){if(_0x2c64f3['error'][_0x3a34('0x16')]===0x1f4){logger['error'](_0x3a34('0x10'),_0x1c37c7,_0x2c64f3[_0x3a34('0x15')][_0x3a34('0x17')]);return _0x17bb11(_0x2c64f3['error'][_0x3a34('0x17')]);}logger[_0x3a34('0x15')](_0x3a34('0x10'),_0x1c37c7,_0x2c64f3[_0x3a34('0x15')]['message']);return _0x54036d(_0x2c64f3[_0x3a34('0x15')][_0x3a34('0x17')]);}else{logger[_0x3a34('0x18')](_0x3a34('0x10'),_0x1c37c7,_0x3a34('0x13'));_0x54036d(_0x2c64f3[_0x3a34('0x19')][_0x3a34('0x17')]);}})['catch'](function(_0x53ad00){logger['error'](_0x3a34('0x10'),_0x1c37c7,_0x53ad00);_0x17bb11(_0x53ad00);});});} \ No newline at end of file +var _0x0f16=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x0f16,0x1cf));var _0x60f1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0f16[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x60f1('0x0'));var util=require(_0x60f1('0x1'));var moment=require(_0x60f1('0x2'));var BPromise=require(_0x60f1('0x3'));var rs=require(_0x60f1('0x4'));var fs=require('fs');var Redis=require(_0x60f1('0x5'));var db=require(_0x60f1('0x6'))['db'];var utils=require(_0x60f1('0x7'));var logger=require(_0x60f1('0x8'))(_0x60f1('0x9'));var config=require('../../config/environment');var jayson=require(_0x60f1('0xa'));var client=jayson[_0x60f1('0xb')][_0x60f1('0xc')]({'port':0x232a});config[_0x60f1('0xd')]=_[_0x60f1('0xe')](config[_0x60f1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x60f1('0xf'))(new Redis(config['redis']));require(_0x60f1('0x10'))[_0x60f1('0x11')](socket);function respondWithRpcPromise(_0x24caad,_0x30aa56,_0x396965){return new BPromise(function(_0x5cc680,_0x43bbd3){return client[_0x60f1('0x12')](_0x24caad,_0x396965)[_0x60f1('0x13')](function(_0xac9471){logger[_0x60f1('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x30aa56,_0x60f1('0x15'));logger[_0x60f1('0x16')](_0x60f1('0x17'),_0x30aa56,'request\x20sent',JSON['stringify'](_0xac9471));if(_0xac9471[_0x60f1('0x18')]){if(_0xac9471[_0x60f1('0x18')][_0x60f1('0x19')]===0x1f4){logger[_0x60f1('0x18')](_0x60f1('0x1a'),_0x30aa56,_0xac9471[_0x60f1('0x18')][_0x60f1('0x1b')]);return _0x43bbd3(_0xac9471[_0x60f1('0x18')][_0x60f1('0x1b')]);}logger[_0x60f1('0x18')](_0x60f1('0x1a'),_0x30aa56,_0xac9471[_0x60f1('0x18')][_0x60f1('0x1b')]);return _0x5cc680(_0xac9471[_0x60f1('0x18')][_0x60f1('0x1b')]);}else{logger[_0x60f1('0x14')](_0x60f1('0x1a'),_0x30aa56,_0x60f1('0x15'));_0x5cc680(_0xac9471['result'][_0x60f1('0x1b')]);}})[_0x60f1('0x1c')](function(_0x2ba191){logger[_0x60f1('0x18')](_0x60f1('0x1a'),_0x30aa56,_0x2ba191);_0x43bbd3(_0x2ba191);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index cd44a1b..9f78546 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 _0x1ac3=['./chatWebsite.events','save','emit','removeListener','register','length','chatWebsite:'];(function(_0x52c112,_0x1ae2e4){var _0x4781b0=function(_0x3a6509){while(--_0x3a6509){_0x52c112['push'](_0x52c112['shift']());}};_0x4781b0(++_0x1ae2e4);}(_0x1ac3,0x149));var _0x31ac=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x1ac3[_0x5608a3];return _0x1ed50a;};'use strict';var ChatWebsiteEvents=require(_0x31ac('0x0'));var events=[_0x31ac('0x1'),'remove','update'];function createListener(_0x3163a3,_0x5dafc1){return function(_0x46e2b0){_0x5dafc1[_0x31ac('0x2')](_0x3163a3,_0x46e2b0);};}function removeListener(_0x16d711,_0x4e3dcb){return function(){ChatWebsiteEvents[_0x31ac('0x3')](_0x16d711,_0x4e3dcb);};}exports[_0x31ac('0x4')]=function(_0x26ff89){for(var _0x127efd=0x0,_0x55389c=events[_0x31ac('0x5')];_0x127efd<_0x55389c;_0x127efd++){var _0x376e76=events[_0x127efd];var _0x47d4ba=createListener(_0x31ac('0x6')+_0x376e76,_0x26ff89);ChatWebsiteEvents['on'](_0x376e76,_0x47d4ba);}}; \ No newline at end of file +var _0x96e5=['./chatWebsite.events','remove','emit','removeListener','chatWebsite:'];(function(_0x1509cf,_0x1f3054){var _0x201d44=function(_0x3ba690){while(--_0x3ba690){_0x1509cf['push'](_0x1509cf['shift']());}};_0x201d44(++_0x1f3054);}(_0x96e5,0x136));var _0x596e=function(_0x29b1a9,_0x457b00){_0x29b1a9=_0x29b1a9-0x0;var _0x25a0bb=_0x96e5[_0x29b1a9];return _0x25a0bb;};'use strict';var ChatWebsiteEvents=require(_0x596e('0x0'));var events=['save',_0x596e('0x1'),'update'];function createListener(_0x23f9bf,_0x1dafe6){return function(_0x1b9ae4){_0x1dafe6[_0x596e('0x2')](_0x23f9bf,_0x1b9ae4);};}function removeListener(_0x542dc2,_0x7d4f2b){return function(){ChatWebsiteEvents[_0x596e('0x3')](_0x542dc2,_0x7d4f2b);};}exports['register']=function(_0x13e7c7){for(var _0xd320e5=0x0,_0x7adab=events['length'];_0xd320e5<_0x7adab;_0xd320e5++){var _0x4b226b=events[_0xd320e5];var _0x5665fe=createListener(_0x596e('0x4')+_0x4b226b,_0x13e7c7);ChatWebsiteEvents['on'](_0x4b226b,_0x5665fe);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 9ad60b8..2e65d53 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 _0x3986=['create','post','addDisposition','/:id/canned_answers','addAnswer','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','addLogo','join','root','server/files/images/avatars/','now','single','file','diskStorage','addCustomerAvatar','addSystemAvatar','notify','attachments','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x3986,0x194));var _0x6398=function(_0x11daa2,_0x5bc1c3){_0x11daa2=_0x11daa2-0x0;var _0x48558a=_0x3986[_0x11daa2];return _0x48558a;};'use strict';var multer=require('multer');var util=require(_0x6398('0x0'));var path=require(_0x6398('0x1'));var timeout=require(_0x6398('0x2'));var express=require(_0x6398('0x3'));var router=express[_0x6398('0x4')]();var fs_extra=require(_0x6398('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6398('0x6'));var config=require(_0x6398('0x7'));var controller=require(_0x6398('0x8'));router[_0x6398('0x9')]('/',auth['isAuthenticated'](),controller[_0x6398('0xa')]);router['get'](_0x6398('0xb'),auth[_0x6398('0xc')](),controller[_0x6398('0xd')]);router['get'](_0x6398('0xe'),auth[_0x6398('0xc')](),controller[_0x6398('0xf')]);router[_0x6398('0x9')](_0x6398('0x10'),auth[_0x6398('0xc')](),controller[_0x6398('0x11')]);router[_0x6398('0x9')]('/:id/canned_answers',auth[_0x6398('0xc')](),controller[_0x6398('0x12')]);router[_0x6398('0x9')]('/:id/logo',controller['getLogo']);router[_0x6398('0x9')](_0x6398('0x13'),controller[_0x6398('0x14')]);router['get'](_0x6398('0x15'),controller['getCustomerAvatar']);router[_0x6398('0x9')](_0x6398('0x16'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x6398('0xc')](),controller[_0x6398('0x17')]);router[_0x6398('0x9')](_0x6398('0x18'),controller[_0x6398('0x19')]);router[_0x6398('0x9')](_0x6398('0x1a'),auth[_0x6398('0xc')](),controller[_0x6398('0x1b')]);router[_0x6398('0x9')](_0x6398('0x1c'),auth[_0x6398('0xc')](),controller[_0x6398('0x1d')]);router['get']('/:id/fields',controller[_0x6398('0x1e')]);router[_0x6398('0x9')](_0x6398('0x1f'),auth[_0x6398('0xc')](),controller[_0x6398('0x20')]);router[_0x6398('0x9')]('/:id/users',auth[_0x6398('0xc')](),controller[_0x6398('0x21')]);router['post']('/',auth[_0x6398('0xc')](),controller[_0x6398('0x22')]);router[_0x6398('0x23')](_0x6398('0x10'),auth['isAuthenticated'](),controller[_0x6398('0x24')]);router[_0x6398('0x23')](_0x6398('0x25'),auth[_0x6398('0xc')](),controller[_0x6398('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x77b531,_0xe94ab,_0x1b0bda){_0x1b0bda(null,path['join'](config['root'],_0x6398('0x27')));},'filename':function(_0x4af592,_0x9a88b3,_0x3ea381){_0x3ea381(null,util[_0x6398('0x28')](_0x6398('0x29'),Date['now'](),_0x9a88b3[_0x6398('0x2a')]));}})});router[_0x6398('0x23')](_0x6398('0x2b'),upload['single']('file'),controller[_0x6398('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b05b4,_0xf504be,_0x782405){_0x782405(null,path[_0x6398('0x2d')](config[_0x6398('0x2e')],_0x6398('0x2f')));},'filename':function(_0x4b7f45,_0x285237,_0x592b10){_0x592b10(null,util[_0x6398('0x28')](_0x6398('0x29'),Date[_0x6398('0x30')](),_0x285237[_0x6398('0x2a')]));}})});router[_0x6398('0x23')](_0x6398('0x13'),upload[_0x6398('0x31')](_0x6398('0x32')),controller['addAvatar']);var upload=multer({'storage':multer[_0x6398('0x33')]({'destination':function(_0xd46176,_0x1c8307,_0x397b39){_0x397b39(null,path[_0x6398('0x2d')](config[_0x6398('0x2e')],_0x6398('0x2f')));},'filename':function(_0x568c5e,_0x5df72e,_0x319791){_0x319791(null,util['format']('%s-%s',Date[_0x6398('0x30')](),_0x5df72e['originalname']));}})});router[_0x6398('0x23')](_0x6398('0x15'),upload[_0x6398('0x31')]('file'),controller[_0x6398('0x34')]);var upload=multer({'storage':multer[_0x6398('0x33')]({'destination':function(_0x437648,_0x50a171,_0x5a85ba){_0x5a85ba(null,path['join'](config[_0x6398('0x2e')],_0x6398('0x2f')));},'filename':function(_0x43f509,_0xb3c268,_0x343d0c){_0x343d0c(null,util[_0x6398('0x28')](_0x6398('0x29'),Date[_0x6398('0x30')](),_0xb3c268[_0x6398('0x2a')]));}})});router[_0x6398('0x23')](_0x6398('0x16'),upload[_0x6398('0x31')](_0x6398('0x32')),controller[_0x6398('0x35')]);router[_0x6398('0x23')]('/:id/notify',controller[_0x6398('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x6398('0x33')]({'destination':function(_0x4ea087,_0x3b323b,_0x32f22f){const _0x18f61a=path[_0x6398('0x2d')](config[_0x6398('0x2e')],'server/files',_0x6398('0x37'),'offline-chat');fs_extra[_0x6398('0x38')](_0x18f61a,function(){_0x32f22f(null,_0x18f61a);});},'filename':function(_0xcff8dd,_0x346652,_0x1c00b9){const _0x4c0ca8=_0x346652['originalname'][_0x6398('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x24d1be=path[_0x6398('0x3a')](_0x4c0ca8);const _0x1e8dca=Date[_0x6398('0x30')]()+'-'+_0x4c0ca8[_0x6398('0x39')](_0x24d1be,'')+_0x24d1be;_0x1c00b9(null,_0x1e8dca);}})});router[_0x6398('0x23')](_0x6398('0x3b'),offlineUploadMulter[_0x6398('0x3c')](),controller[_0x6398('0x3d')]);router[_0x6398('0x23')](_0x6398('0x3e'),auth[_0x6398('0xc')](),controller[_0x6398('0x3f')]);router[_0x6398('0x23')](_0x6398('0x1a'),auth[_0x6398('0xc')](),controller['addApplications']);router[_0x6398('0x23')]('/:id/proactive_actions',auth[_0x6398('0xc')](),controller[_0x6398('0x40')]);router[_0x6398('0x23')]('/:id/users',auth[_0x6398('0xc')](),controller[_0x6398('0x41')]);router[_0x6398('0x42')](_0x6398('0xe'),auth[_0x6398('0xc')](),controller[_0x6398('0x43')]);router[_0x6398('0x44')]('/:id',auth[_0x6398('0xc')](),controller[_0x6398('0x45')]);router[_0x6398('0x44')](_0x6398('0x10'),auth[_0x6398('0xc')](),controller[_0x6398('0x46')]);router[_0x6398('0x44')](_0x6398('0x25'),auth[_0x6398('0xc')](),controller[_0x6398('0x47')]);router['delete'](_0x6398('0x48'),auth[_0x6398('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf9ce=['/:id/dispositions','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','extname','/:id/offline','any','offline','addInteraction','addApplications','put','update','delete','destroy','removeDispositions','removeAnswers','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x34c915,_0x409592){var _0x535cc4=function(_0x619f13){while(--_0x619f13){_0x34c915['push'](_0x34c915['shift']());}};_0x535cc4(++_0x409592);}(_0xf9ce,0x10f));var _0xef9c=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xf9ce[_0x393d69];return _0x3cee37;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xef9c('0x0'));var express=require(_0xef9c('0x1'));var router=express[_0xef9c('0x2')]();var fs_extra=require(_0xef9c('0x3'));var auth=require(_0xef9c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef9c('0x5'));router[_0xef9c('0x6')]('/',auth[_0xef9c('0x7')](),controller[_0xef9c('0x8')]);router[_0xef9c('0x6')](_0xef9c('0x9'),auth[_0xef9c('0x7')](),controller[_0xef9c('0xa')]);router[_0xef9c('0x6')](_0xef9c('0xb'),auth[_0xef9c('0x7')](),controller[_0xef9c('0xc')]);router['get'](_0xef9c('0xd'),auth[_0xef9c('0x7')](),controller['getDispositions']);router[_0xef9c('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xef9c('0xe')]);router['get']('/:id/logo',controller[_0xef9c('0xf')]);router['get'](_0xef9c('0x10'),controller['getAvatar']);router[_0xef9c('0x6')](_0xef9c('0x11'),controller[_0xef9c('0x12')]);router[_0xef9c('0x6')](_0xef9c('0x13'),controller[_0xef9c('0x14')]);router[_0xef9c('0x6')](_0xef9c('0x15'),auth['isAuthenticated'](),controller[_0xef9c('0x16')]);router[_0xef9c('0x6')](_0xef9c('0x17'),controller[_0xef9c('0x18')]);router[_0xef9c('0x6')](_0xef9c('0x19'),auth['isAuthenticated'](),controller[_0xef9c('0x1a')]);router[_0xef9c('0x6')](_0xef9c('0x1b'),auth[_0xef9c('0x7')](),controller[_0xef9c('0x1c')]);router['get']('/:id/fields',controller[_0xef9c('0x1d')]);router[_0xef9c('0x6')](_0xef9c('0x1e'),auth['isAuthenticated'](),controller[_0xef9c('0x1f')]);router[_0xef9c('0x6')](_0xef9c('0x20'),auth[_0xef9c('0x7')](),controller[_0xef9c('0x21')]);router[_0xef9c('0x22')]('/',auth['isAuthenticated'](),controller[_0xef9c('0x23')]);router[_0xef9c('0x22')](_0xef9c('0xd'),auth['isAuthenticated'](),controller[_0xef9c('0x24')]);router[_0xef9c('0x22')](_0xef9c('0x25'),auth['isAuthenticated'](),controller[_0xef9c('0x26')]);var upload=multer({'storage':multer[_0xef9c('0x27')]({'destination':function(_0x73c73a,_0x205581,_0x552a79){_0x552a79(null,path[_0xef9c('0x28')](config[_0xef9c('0x29')],_0xef9c('0x2a')));},'filename':function(_0x4b830d,_0x54dccd,_0x3effb0){_0x3effb0(null,util[_0xef9c('0x2b')](_0xef9c('0x2c'),Date[_0xef9c('0x2d')](),_0x54dccd[_0xef9c('0x2e')]));}})});router['post'](_0xef9c('0x2f'),upload[_0xef9c('0x30')](_0xef9c('0x31')),controller['addLogo']);var upload=multer({'storage':multer[_0xef9c('0x27')]({'destination':function(_0x595a04,_0x4c4ec6,_0x3e6fbd){_0x3e6fbd(null,path[_0xef9c('0x28')](config[_0xef9c('0x29')],_0xef9c('0x32')));},'filename':function(_0x40735b,_0x162ad5,_0x4db669){_0x4db669(null,util[_0xef9c('0x2b')]('%s-%s',Date[_0xef9c('0x2d')](),_0x162ad5[_0xef9c('0x2e')]));}})});router['post'](_0xef9c('0x10'),upload[_0xef9c('0x30')]('file'),controller[_0xef9c('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e8f9d,_0x1d7af3,_0x45facd){_0x45facd(null,path['join'](config[_0xef9c('0x29')],_0xef9c('0x32')));},'filename':function(_0x424a30,_0x324645,_0x4dd37a){_0x4dd37a(null,util['format'](_0xef9c('0x2c'),Date[_0xef9c('0x2d')](),_0x324645[_0xef9c('0x2e')]));}})});router[_0xef9c('0x22')](_0xef9c('0x11'),upload['single'](_0xef9c('0x31')),controller[_0xef9c('0x34')]);var upload=multer({'storage':multer[_0xef9c('0x27')]({'destination':function(_0x57cd2e,_0xfc37b,_0x19cf83){_0x19cf83(null,path[_0xef9c('0x28')](config[_0xef9c('0x29')],'server/files/images/avatars/'));},'filename':function(_0x44a65a,_0x212872,_0x139627){_0x139627(null,util[_0xef9c('0x2b')](_0xef9c('0x2c'),Date[_0xef9c('0x2d')](),_0x212872['originalname']));}})});router[_0xef9c('0x22')](_0xef9c('0x13'),upload['single'](_0xef9c('0x31')),controller[_0xef9c('0x35')]);router[_0xef9c('0x22')](_0xef9c('0x36'),controller[_0xef9c('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x481570,_0x26e1c5,_0x580781){const _0x856eb1=path[_0xef9c('0x28')](config[_0xef9c('0x29')],_0xef9c('0x38'),'attachments','offline-chat');fs_extra[_0xef9c('0x39')](_0x856eb1,function(){_0x580781(null,_0x856eb1);});},'filename':function(_0xbbc1f9,_0x371cfb,_0x1b7d58){const _0x187291=_0x371cfb[_0xef9c('0x2e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4ecabc=path[_0xef9c('0x3a')](_0x187291);const _0x3c7f2a=Date[_0xef9c('0x2d')]()+'-'+_0x187291['replace'](_0x4ecabc,'')+_0x4ecabc;_0x1b7d58(null,_0x3c7f2a);}})});router[_0xef9c('0x22')](_0xef9c('0x3b'),offlineUploadMulter[_0xef9c('0x3c')](),controller[_0xef9c('0x3d')]);router[_0xef9c('0x22')]('/:id/interactions',auth[_0xef9c('0x7')](),controller[_0xef9c('0x3e')]);router[_0xef9c('0x22')](_0xef9c('0x19'),auth[_0xef9c('0x7')](),controller[_0xef9c('0x3f')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xef9c('0x22')](_0xef9c('0x20'),auth[_0xef9c('0x7')](),controller['addAgents']);router[_0xef9c('0x40')](_0xef9c('0xb'),auth[_0xef9c('0x7')](),controller[_0xef9c('0x41')]);router[_0xef9c('0x42')]('/:id',auth[_0xef9c('0x7')](),controller[_0xef9c('0x43')]);router['delete'](_0xef9c('0xd'),auth[_0xef9c('0x7')](),controller[_0xef9c('0x44')]);router[_0xef9c('0x42')]('/:id/canned_answers',auth[_0xef9c('0x7')](),controller[_0xef9c('0x45')]);router[_0xef9c('0x42')](_0xef9c('0x20'),auth[_0xef9c('0x7')](),controller['removeAgents']);module[_0xef9c('0x46')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 7605c3a..e779e8c 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 _0x80c3=['ENUM','Google','STRING','sequelize'];(function(_0x30ebd1,_0x2ae3e9){var _0x518e2c=function(_0x17db9e){while(--_0x17db9e){_0x30ebd1['push'](_0x30ebd1['shift']());}};_0x518e2c(++_0x2ae3e9);}(_0x80c3,0x18f));var _0x380c=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x80c3[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require(_0x380c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x380c('0x1')]('AmazonAWS',_0x380c('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x380c('0x3')]},'data2':{'type':Sequelize[_0x380c('0x3')]}}; \ No newline at end of file +var _0x84e7=['AmazonAWS','Google','exports','STRING'];(function(_0x76a906,_0xc0a0e5){var _0x13466d=function(_0x20b8ab){while(--_0x20b8ab){_0x76a906['push'](_0x76a906['shift']());}};_0x13466d(++_0xc0a0e5);}(_0x84e7,0x122));var _0x784e=function(_0x327209,_0x48a379){_0x327209=_0x327209-0x0;var _0x57f4b1=_0x84e7[_0x327209];return _0x57f4b1;};'use strict';var Sequelize=require('sequelize');module[_0x784e('0x0')]={'name':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x784e('0x2'),_0x784e('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x784e('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 8fa5140..91d70a6 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x2b42bb,_0x5a99dd){var _0x147077=function(_0x37db1f){while(--_0x37db1f){_0x2b42bb['push'](_0x2b42bb['shift']());}};_0x147077(++_0x5a99dd);}(_0xdb28,0x106));var _0x8db2=function(_0x2ed261,_0x26b4ab){_0x2ed261=_0x2ed261-0x0;var _0x46c0ad=_0xdb28[_0x2ed261];return _0x46c0ad;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x41207f,_0x522d10){var _0x80b1e3=function(_0x164c88){while(--_0x164c88){_0x41207f['push'](_0x41207f['shift']());}};_0x80b1e3(++_0x522d10);}(_0x2ef3,0xba));var _0x32ef=function(_0x3aeb23,_0x1964ec){_0x3aeb23=_0x3aeb23-0x0;var _0x2d5788=_0x2ef3[_0x3aeb23];return _0x2d5788;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e10f18e..2bed8a0 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 _0xc6bf=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xc6bf,0x1c2));var _0xfc6b=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0xc6bf[_0x219d87];return _0x22823d;};'use strict';var _=require(_0xfc6b('0x0'));var util=require(_0xfc6b('0x1'));var logger=require('../../config/logger')(_0xfc6b('0x2'));var moment=require('moment');var BPromise=require(_0xfc6b('0x3'));var rp=require(_0xfc6b('0x4'));var fs=require('fs');var path=require(_0xfc6b('0x5'));var rimraf=require(_0xfc6b('0x6'));var config=require(_0xfc6b('0x7'));var attributes=require(_0xfc6b('0x8'));module['exports']=function(_0x19c92f,_0x412e1e){return _0x19c92f[_0xfc6b('0x9')]('CloudProvider',attributes,{'tableName':_0xfc6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bb9=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash'];(function(_0x22e133,_0x527287){var _0x3455ca=function(_0x50084b){while(--_0x50084b){_0x22e133['push'](_0x22e133['shift']());}};_0x3455ca(++_0x527287);}(_0x4bb9,0x167));var _0x94bb=function(_0x4f69a7,_0x140e96){_0x4f69a7=_0x4f69a7-0x0;var _0x65d1ea=_0x4bb9[_0x4f69a7];return _0x65d1ea;};'use strict';var _=require(_0x94bb('0x0'));var util=require(_0x94bb('0x1'));var logger=require(_0x94bb('0x2'))(_0x94bb('0x3'));var moment=require('moment');var BPromise=require(_0x94bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94bb('0x5'));var rimraf=require(_0x94bb('0x6'));var config=require(_0x94bb('0x7'));var attributes=require(_0x94bb('0x8'));module['exports']=function(_0x43169b,_0x127779){return _0x43169b[_0x94bb('0x9')](_0x94bb('0xa'),attributes,{'tableName':_0x94bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 7eacc8f..a4e987e 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 _0x7b77=['debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0x7b77,0x179));var _0x77b7=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x7b77[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var moment=require(_0x77b7('0x2'));var BPromise=require(_0x77b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b7('0x4'));var db=require(_0x77b7('0x5'))['db'];var utils=require(_0x77b7('0x6'));var logger=require('../../config/logger')(_0x77b7('0x7'));var config=require(_0x77b7('0x8'));var jayson=require(_0x77b7('0x9'));var client=jayson[_0x77b7('0xa')][_0x77b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe3c16b,_0x5c9387,_0x39d8e4){return new BPromise(function(_0x32b8ab,_0x33d439){return client['request'](_0xe3c16b,_0x39d8e4)[_0x77b7('0xc')](function(_0x4cfd3f){logger['info']('CloudProvider,\x20%s,\x20%s',_0x5c9387,_0x77b7('0xd'));logger[_0x77b7('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5c9387,_0x77b7('0xd'),JSON[_0x77b7('0xf')](_0x4cfd3f));if(_0x4cfd3f[_0x77b7('0x10')]){if(_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x11')]===0x1f4){logger[_0x77b7('0x10')](_0x77b7('0x12'),_0x5c9387,_0x4cfd3f['error'][_0x77b7('0x13')]);return _0x33d439(_0x4cfd3f[_0x77b7('0x10')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x5c9387,_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x13')]);return _0x32b8ab(_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x13')]);}else{logger[_0x77b7('0x14')](_0x77b7('0x12'),_0x5c9387,'request\x20sent');_0x32b8ab(_0x4cfd3f[_0x77b7('0x15')][_0x77b7('0x13')]);}})[_0x77b7('0x16')](function(_0x2060df){logger[_0x77b7('0x10')](_0x77b7('0x12'),_0x5c9387,_0x2060df);_0x33d439(_0x2060df);});});} \ No newline at end of file +var _0x530f=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s'];(function(_0x27c07b,_0x5204a5){var _0x506d3c=function(_0x54387e){while(--_0x54387e){_0x27c07b['push'](_0x27c07b['shift']());}};_0x506d3c(++_0x5204a5);}(_0x530f,0x167));var _0xf530=function(_0x290a56,_0x5c540a){_0x290a56=_0x290a56-0x0;var _0x89610=_0x530f[_0x290a56];return _0x89610;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf530('0x1'));var fs=require('fs');var Redis=require(_0xf530('0x2'));var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require(_0xf530('0x5'))(_0xf530('0x6'));var config=require(_0xf530('0x7'));var jayson=require(_0xf530('0x8'));var client=jayson['client'][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce7f8,_0x1e8282,_0x50682f){return new BPromise(function(_0x2bbe3c,_0xf205be){return client[_0xf530('0xa')](_0x2ce7f8,_0x50682f)[_0xf530('0xb')](function(_0x4132bf){logger[_0xf530('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0xf530('0xd'));logger[_0xf530('0xe')](_0xf530('0xf'),_0x1e8282,_0xf530('0xd'),JSON[_0xf530('0x10')](_0x4132bf));if(_0x4132bf[_0xf530('0x11')]){if(_0x4132bf['error']['code']===0x1f4){logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0xf205be(_0x4132bf[_0xf530('0x11')]['message']);}logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0x2bbe3c(_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);}else{logger[_0xf530('0xc')](_0xf530('0x12'),_0x1e8282,'request\x20sent');_0x2bbe3c(_0x4132bf[_0xf530('0x14')][_0xf530('0x13')]);}})['catch'](function(_0x32eaea){logger[_0xf530('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0x32eaea);_0xf205be(_0x32eaea);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index fef8971..525510e 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 _0x7933=['../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x58a8aa,_0x1b0ca4){var _0x4e750d=function(_0x506fca){while(--_0x506fca){_0x58a8aa['push'](_0x58a8aa['shift']());}};_0x4e750d(++_0x1b0ca4);}(_0x7933,0xa6));var _0x3793=function(_0x5268ff,_0x126342){_0x5268ff=_0x5268ff-0x0;var _0x47b706=_0x7933[_0x5268ff];return _0x47b706;};'use strict';var multer=require(_0x3793('0x0'));var util=require(_0x3793('0x1'));var path=require('path');var timeout=require(_0x3793('0x2'));var express=require('express');var router=express[_0x3793('0x3')]();var fs_extra=require(_0x3793('0x4'));var auth=require(_0x3793('0x5'));var interaction=require(_0x3793('0x6'));var config=require('../../config/environment');var controller=require(_0x3793('0x7'));router[_0x3793('0x8')]('/',auth['isAuthenticated'](),controller[_0x3793('0x9')]);router[_0x3793('0x8')](_0x3793('0xa'),auth['isAuthenticated'](),controller[_0x3793('0xb')]);router[_0x3793('0xc')]('/',auth[_0x3793('0xd')](),controller[_0x3793('0xe')]);router[_0x3793('0xf')](_0x3793('0xa'),auth[_0x3793('0xd')](),controller[_0x3793('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3793('0x11')]);module[_0x3793('0x12')]=router; \ No newline at end of file +var _0x3e1d=['/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x180078,_0x37863a){var _0x4fceb9=function(_0x360bad){while(--_0x360bad){_0x180078['push'](_0x180078['shift']());}};_0x4fceb9(++_0x37863a);}(_0x3e1d,0x13a));var _0xd3e1=function(_0x27c1ab,_0x3734be){_0x27c1ab=_0x27c1ab-0x0;var _0x5087a3=_0x3e1d[_0x27c1ab];return _0x5087a3;};'use strict';var multer=require('multer');var util=require(_0xd3e1('0x0'));var path=require('path');var timeout=require(_0xd3e1('0x1'));var express=require(_0xd3e1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x3'));var interaction=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var controller=require(_0xd3e1('0x6'));router[_0xd3e1('0x7')]('/',auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x9')]);router['get'](_0xd3e1('0xa'),auth['isAuthenticated'](),controller[_0xd3e1('0xb')]);router[_0xd3e1('0xc')]('/',auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xd')]);router[_0xd3e1('0xe')](_0xd3e1('0xa'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xf')]);router['delete'](_0xd3e1('0xa'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x10')]);module[_0xd3e1('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 7d02631..d64f971 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 _0xa637=['exports','STRING','name','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa637,0x113));var _0x7a63=function(_0x5cf245,_0x33976e){_0x5cf245=_0x5cf245-0x0;var _0x1178c7=_0xa637[_0x5cf245];return _0x1178c7;};'use strict';var Sequelize=require(_0x7a63('0x0'));module[_0x7a63('0x1')]={'name':{'type':Sequelize[_0x7a63('0x2')],'unique':_0x7a63('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7a63('0x2')]},'companyId':{'type':Sequelize[_0x7a63('0x2')]},'website':{'type':Sequelize[_0x7a63('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7a63('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7a63('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7a63('0x2')]},'email':{'type':Sequelize[_0x7a63('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7a63('0x2')]},'sStreet':{'type':Sequelize[_0x7a63('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x7a63('0x2')]},'description':{'type':Sequelize[_0x7a63('0x2')]}}; \ No newline at end of file +var _0xce0a=['STRING'];(function(_0x22f348,_0x320e21){var _0x15ee35=function(_0x2b8d4f){while(--_0x2b8d4f){_0x22f348['push'](_0x22f348['shift']());}};_0x15ee35(++_0x320e21);}(_0xce0a,0xbb));var _0xace0=function(_0x491082,_0x28f78b){_0x491082=_0x491082-0x0;var _0x5797d9=_0xce0a[_0x491082];return _0x5797d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xace0('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xace0('0x0')]},'companyId':{'type':Sequelize[_0xace0('0x0')]},'website':{'type':Sequelize[_0xace0('0x0')]},'phone':{'type':Sequelize[_0xace0('0x0')]},'fax':{'type':Sequelize[_0xace0('0x0')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xace0('0x0')]},'postalCode':{'type':Sequelize[_0xace0('0x0')]},'city':{'type':Sequelize[_0xace0('0x0')]},'country':{'type':Sequelize[_0xace0('0x0')]},'email':{'type':Sequelize[_0xace0('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xace0('0x0')]},'sStreet':{'type':Sequelize[_0xace0('0x0')]},'sPostalCode':{'type':Sequelize[_0xace0('0x0')]},'sCity':{'type':Sequelize[_0xace0('0x0')]},'sCountry':{'type':Sequelize[_0xace0('0x0')]},'description':{'type':Sequelize[_0xace0('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 14531d2..26e52ff 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 _0xb2d2=['destroy','sendStatus','error','stack','name','index','CmCompany','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','params','describe','addContacts','ids','omit','length','getContacts','nolimit','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Companies','UserProfileResource'];(function(_0x378e82,_0x2fe78f){var _0x462154=function(_0x465733){while(--_0x465733){_0x378e82['push'](_0x378e82['shift']());}};_0x462154(++_0x2fe78f);}(_0xb2d2,0x1c0));var _0x2b2d=function(_0x1fcf1e,_0x1e10d6){_0x1fcf1e=_0x1fcf1e-0x0;var _0x1fafce=_0xb2d2[_0x1fcf1e];return _0x1fafce;};'use strict';var emlformat=require(_0x2b2d('0x0'));var rimraf=require(_0x2b2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2b2d('0x2'));var moment=require(_0x2b2d('0x3'));var BPromise=require(_0x2b2d('0x4'));var Mustache=require(_0x2b2d('0x5'));var util=require(_0x2b2d('0x6'));var path=require(_0x2b2d('0x7'));var sox=require(_0x2b2d('0x8'));var csv=require(_0x2b2d('0x9'));var ejs=require(_0x2b2d('0xa'));var fs=require('fs');var fs_extra=require(_0x2b2d('0xb'));var _=require('lodash');var squel=require(_0x2b2d('0xc'));var crypto=require('crypto');var jsforce=require(_0x2b2d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2b2d('0x9'));var querystring=require(_0x2b2d('0xe'));var Papa=require(_0x2b2d('0xf'));var Redis=require(_0x2b2d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2b2d('0x11'));var as=require(_0x2b2d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b2d('0x13'));var utils=require('../../config/utils');var config=require(_0x2b2d('0x14'));var licenseUtil=require(_0x2b2d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec159c,_0xc7aa20){_0xc7aa20=_0xc7aa20||0xcc;return function(_0x3dc51b){if(_0x3dc51b){return _0xec159c['sendStatus'](_0xc7aa20);}return _0xec159c[_0x2b2d('0x16')](_0xc7aa20)[_0x2b2d('0x17')]();};}function respondWithResult(_0x3083dc,_0x471e21){_0x471e21=_0x471e21||0xc8;return function(_0x5084d5){if(_0x5084d5){return _0x3083dc[_0x2b2d('0x16')](_0x471e21)[_0x2b2d('0x18')](_0x5084d5);}};}function respondWithFilteredResult(_0x263bb8,_0x302e35){return function(_0x2cb670){if(_0x2cb670){var _0x210918=typeof _0x302e35[_0x2b2d('0x19')]===_0x2b2d('0x1a')&&typeof _0x302e35[_0x2b2d('0x1b')]===_0x2b2d('0x1a');var _0x1b61ab=_0x2cb670['count'];var _0x34e69b=_0x210918?0x0:_0x302e35[_0x2b2d('0x19')];var _0x5020cf=_0x210918?_0x2cb670[_0x2b2d('0x1c')]:_0x302e35[_0x2b2d('0x19')]+_0x302e35['limit'];var _0x4d32cf;if(_0x5020cf>=_0x1b61ab){_0x5020cf=_0x1b61ab;_0x4d32cf=0xc8;}else{_0x4d32cf=0xce;}_0x263bb8[_0x2b2d('0x16')](_0x4d32cf);return _0x263bb8[_0x2b2d('0x1d')](_0x2b2d('0x1e'),_0x34e69b+'-'+_0x5020cf+'/'+_0x1b61ab)[_0x2b2d('0x18')](_0x2cb670);}return null;};}function patchUpdates(_0xabfdde){return function(_0x1d5f85){try{jsonpatch['apply'](_0x1d5f85,_0xabfdde,!![]);}catch(_0x49dabf){return BPromise[_0x2b2d('0x1f')](_0x49dabf);}return _0x1d5f85[_0x2b2d('0x20')]();};}function saveUpdates(_0x22b893,_0x2b94a6){return function(_0x2d14c3){if(_0x2d14c3){return _0x2d14c3[_0x2b2d('0x21')](_0x22b893)[_0x2b2d('0x22')](function(_0x3a529c){return _0x3a529c;});}return null;};}function removeEntity(_0x5bb240,_0x3b234a){return function(_0x1418ec){if(_0x1418ec){return _0x1418ec['destroy']()[_0x2b2d('0x22')](function(){var _0x230bbe=_0x1418ec[_0x2b2d('0x23')]({'plain':!![]});var _0x2bb884=_0x2b2d('0x24');return db[_0x2b2d('0x25')][_0x2b2d('0x26')]({'where':{'type':_0x2bb884,'resourceId':_0x230bbe['id']}})[_0x2b2d('0x22')](function(){return _0x1418ec;});})[_0x2b2d('0x22')](function(){_0x5bb240[_0x2b2d('0x16')](0xcc)[_0x2b2d('0x17')]();});}};}function handleEntityNotFound(_0xfed8cf,_0x59ac7e){return function(_0x3e62d9){if(!_0x3e62d9){_0xfed8cf[_0x2b2d('0x27')](0x194);}return _0x3e62d9;};}function handleError(_0x197c1d,_0x4639c2){_0x4639c2=_0x4639c2||0x1f4;return function(_0x140bbe){logger[_0x2b2d('0x28')](_0x140bbe[_0x2b2d('0x29')]);if(_0x140bbe[_0x2b2d('0x2a')]){delete _0x140bbe['name'];}_0x197c1d['status'](_0x4639c2)['send'](_0x140bbe);};}exports[_0x2b2d('0x2b')]=function(_0x2fca92,_0x100526){var _0x2b0d0f={},_0x214ce9={},_0xa2855f={'count':0x0,'rows':[]};return db[_0x2b2d('0x2c')]['describe']()[_0x2b2d('0x22')](function(_0x224eb7){_0x214ce9[_0x2b2d('0x2d')]=_['keys'](_0x224eb7);_0x214ce9[_0x2b2d('0x2e')]=_[_0x2b2d('0x2f')](_0x2fca92[_0x2b2d('0x2e')]);_0x214ce9[_0x2b2d('0x30')]=_[_0x2b2d('0x31')](_0x214ce9['model'],_0x214ce9[_0x2b2d('0x2e')]);_0x2b0d0f['attributes']=_['intersection'](_0x214ce9[_0x2b2d('0x2d')],qs[_0x2b2d('0x32')](_0x2fca92['query'][_0x2b2d('0x32')]));_0x2b0d0f[_0x2b2d('0x33')]=_0x2b0d0f['attributes']['length']?_0x2b0d0f[_0x2b2d('0x33')]:_0x214ce9['model'];if(!_0x2fca92[_0x2b2d('0x2e')]['hasOwnProperty']('nolimit')){_0x2b0d0f[_0x2b2d('0x1b')]=qs['limit'](_0x2fca92[_0x2b2d('0x2e')]['limit']);_0x2b0d0f[_0x2b2d('0x19')]=qs[_0x2b2d('0x19')](_0x2fca92['query'][_0x2b2d('0x19')]);}_0x2b0d0f[_0x2b2d('0x34')]=qs[_0x2b2d('0x35')](_0x2fca92[_0x2b2d('0x2e')][_0x2b2d('0x35')]);_0x2b0d0f[_0x2b2d('0x36')]=qs['filters'](_[_0x2b2d('0x37')](_0x2fca92[_0x2b2d('0x2e')],_0x214ce9[_0x2b2d('0x30')]),_0x224eb7);if(_0x2fca92[_0x2b2d('0x2e')][_0x2b2d('0x38')]){_0x2b0d0f[_0x2b2d('0x36')]=_[_0x2b2d('0x39')](_0x2b0d0f[_0x2b2d('0x36')],{'$or':_[_0x2b2d('0x3a')](_0x2b0d0f[_0x2b2d('0x33')],function(_0x41c89c){var _0x50a607={};_0x50a607[_0x41c89c]={'$like':'%'+_0x2fca92[_0x2b2d('0x2e')][_0x2b2d('0x38')]+'%'};return _0x50a607;})});}_0x2b0d0f=_[_0x2b2d('0x39')]({},_0x2b0d0f,_0x2fca92[_0x2b2d('0x3b')]);var _0x54ec65={'where':_0x2b0d0f[_0x2b2d('0x36')]};return db[_0x2b2d('0x2c')][_0x2b2d('0x1c')](_0x54ec65)[_0x2b2d('0x22')](function(_0x1cca82){_0xa2855f[_0x2b2d('0x1c')]=_0x1cca82;if(_0x2fca92['query'][_0x2b2d('0x3c')]){_0x2b0d0f[_0x2b2d('0x3d')]=[{'all':!![]}];}return db[_0x2b2d('0x2c')][_0x2b2d('0x3e')](_0x2b0d0f);})[_0x2b2d('0x22')](function(_0x10ebbf){_0xa2855f[_0x2b2d('0x3f')]=_0x10ebbf;return _0xa2855f;})['then'](respondWithFilteredResult(_0x100526,_0x2b0d0f))[_0x2b2d('0x40')](handleError(_0x100526,null));})['catch'](handleError(_0x100526,null));};exports['show']=function(_0x34f649,_0x4a551b){var _0x2bae99={'raw':![],'where':{'id':_0x34f649['params']['id']}},_0x265746={};_0x265746['model']=_[_0x2b2d('0x2f')](db[_0x2b2d('0x2c')][_0x2b2d('0x41')]);_0x265746['query']=_[_0x2b2d('0x2f')](_0x34f649[_0x2b2d('0x2e')]);_0x265746[_0x2b2d('0x30')]=_[_0x2b2d('0x31')](_0x265746[_0x2b2d('0x2d')],_0x265746[_0x2b2d('0x2e')]);_0x2bae99[_0x2b2d('0x33')]=_[_0x2b2d('0x31')](_0x265746[_0x2b2d('0x2d')],qs[_0x2b2d('0x32')](_0x34f649[_0x2b2d('0x2e')][_0x2b2d('0x32')]));_0x2bae99[_0x2b2d('0x33')]=_0x2bae99[_0x2b2d('0x33')]['length']?_0x2bae99[_0x2b2d('0x33')]:_0x265746[_0x2b2d('0x2d')];if(_0x34f649[_0x2b2d('0x2e')][_0x2b2d('0x3c')]){_0x2bae99['include']=[{'all':!![]}];}_0x2bae99=_['merge']({},_0x2bae99,_0x34f649[_0x2b2d('0x3b')]);return db[_0x2b2d('0x2c')][_0x2b2d('0x42')](_0x2bae99)[_0x2b2d('0x22')](handleEntityNotFound(_0x4a551b,null))[_0x2b2d('0x22')](respondWithResult(_0x4a551b,null))[_0x2b2d('0x40')](handleError(_0x4a551b,null));};exports[_0x2b2d('0x43')]=function(_0x2d72fb,_0x3a7e9b){return db[_0x2b2d('0x2c')][_0x2b2d('0x43')](_0x2d72fb[_0x2b2d('0x44')],{})[_0x2b2d('0x22')](function(_0x16d076){var _0x2558ef=_0x2d72fb[_0x2b2d('0x45')]['get']({'plain':!![]});if(!_0x2558ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2558ef[_0x2b2d('0x46')]==='user'){var _0x419e5c=_0x16d076[_0x2b2d('0x23')]({'plain':!![]});var _0x1dc362='Companies';return db['UserProfileSection'][_0x2b2d('0x42')]({'where':{'name':_0x1dc362,'userProfileId':_0x2558ef[_0x2b2d('0x47')]},'raw':!![]})['then'](function(_0x2ae4a2){if(_0x2ae4a2&&_0x2ae4a2[_0x2b2d('0x48')]===0x0){return db[_0x2b2d('0x25')][_0x2b2d('0x43')]({'name':_0x419e5c[_0x2b2d('0x2a')],'resourceId':_0x419e5c['id'],'type':_0x2ae4a2[_0x2b2d('0x2a')],'sectionId':_0x2ae4a2['id']},{})[_0x2b2d('0x22')](function(){return _0x16d076;});}else{return _0x16d076;}})[_0x2b2d('0x40')](function(_0xba90df){logger[_0x2b2d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xba90df);throw _0xba90df;});}return _0x16d076;})[_0x2b2d('0x22')](respondWithResult(_0x3a7e9b,0xc9))['catch'](handleError(_0x3a7e9b,null));};exports['update']=function(_0x4b81ee,_0x2b9c1f){if(_0x4b81ee['body']['id']){delete _0x4b81ee[_0x2b2d('0x44')]['id'];}return db[_0x2b2d('0x2c')][_0x2b2d('0x42')]({'where':{'id':_0x4b81ee[_0x2b2d('0x49')]['id']}})[_0x2b2d('0x22')](handleEntityNotFound(_0x2b9c1f,null))[_0x2b2d('0x22')](saveUpdates(_0x4b81ee[_0x2b2d('0x44')],null))[_0x2b2d('0x22')](respondWithResult(_0x2b9c1f,null))[_0x2b2d('0x40')](handleError(_0x2b9c1f,null));};exports[_0x2b2d('0x26')]=function(_0x3935c8,_0x3f9cea){return db[_0x2b2d('0x2c')][_0x2b2d('0x42')]({'where':{'id':_0x3935c8[_0x2b2d('0x49')]['id']}})[_0x2b2d('0x22')](handleEntityNotFound(_0x3f9cea,null))[_0x2b2d('0x22')](removeEntity(_0x3f9cea,null))['catch'](handleError(_0x3f9cea,null));};exports[_0x2b2d('0x4a')]=function(_0x4c94f6,_0x3755b7){return db[_0x2b2d('0x2c')]['describe']()[_0x2b2d('0x22')](respondWithResult(_0x3755b7,null))[_0x2b2d('0x40')](handleError(_0x3755b7,null));};exports['addContacts']=function(_0x46376e,_0x3a9e0b,_0x4ab6e4){return db['CmContact']['find']({'where':{'id':_0x46376e[_0x2b2d('0x49')]['id']}})[_0x2b2d('0x22')](handleEntityNotFound(_0x3a9e0b,null))['then'](function(_0x3f081a){if(_0x3f081a){return _0x3f081a[_0x2b2d('0x4b')](_0x46376e['body'][_0x2b2d('0x4c')],_[_0x2b2d('0x4d')](_0x46376e[_0x2b2d('0x44')],[_0x2b2d('0x4c'),'id'])||{});}})[_0x2b2d('0x22')](respondWithResult(_0x3a9e0b,null))[_0x2b2d('0x40')](handleError(_0x3a9e0b,null));};exports['getContacts']=function(_0x3a29a1,_0x366aab,_0x4fc357){var _0x51a435={};var _0x310f4b={};var _0x106396;var _0x2ac716;return db['CmCompany']['findOne']({'where':{'id':_0x3a29a1[_0x2b2d('0x49')]['id']}})[_0x2b2d('0x22')](handleEntityNotFound(_0x366aab,null))[_0x2b2d('0x22')](function(_0x4e4630){if(_0x4e4630){_0x106396=_0x4e4630;_0x310f4b['model']=_[_0x2b2d('0x2f')](db['CmContact'][_0x2b2d('0x41')]);_0x310f4b[_0x2b2d('0x2e')]=_[_0x2b2d('0x2f')](_0x3a29a1[_0x2b2d('0x2e')]);_0x310f4b[_0x2b2d('0x30')]=_[_0x2b2d('0x31')](_0x310f4b[_0x2b2d('0x2d')],_0x310f4b[_0x2b2d('0x2e')]);_0x51a435[_0x2b2d('0x33')]=_[_0x2b2d('0x31')](_0x310f4b[_0x2b2d('0x2d')],qs['fields'](_0x3a29a1[_0x2b2d('0x2e')]['fields']));_0x51a435[_0x2b2d('0x33')]=_0x51a435[_0x2b2d('0x33')][_0x2b2d('0x4e')]?_0x51a435[_0x2b2d('0x33')]:_0x310f4b[_0x2b2d('0x2d')];_0x51a435[_0x2b2d('0x34')]=qs['sort'](_0x3a29a1['query'][_0x2b2d('0x35')]);_0x51a435[_0x2b2d('0x36')]=qs[_0x2b2d('0x30')](_[_0x2b2d('0x37')](_0x3a29a1[_0x2b2d('0x2e')],_0x310f4b[_0x2b2d('0x30')]));if(_0x3a29a1[_0x2b2d('0x2e')]['filter']){_0x51a435['where']=_[_0x2b2d('0x39')](_0x51a435[_0x2b2d('0x36')],{'$or':_[_0x2b2d('0x3a')](_0x51a435[_0x2b2d('0x33')],function(_0x45fa81){var _0x324535={};_0x324535[_0x45fa81]={'$like':'%'+_0x3a29a1[_0x2b2d('0x2e')]['filter']+'%'};return _0x324535;})});}_0x51a435=_[_0x2b2d('0x39')]({},_0x51a435,_0x3a29a1[_0x2b2d('0x3b')]);return _0x106396[_0x2b2d('0x4f')](_0x51a435);}})[_0x2b2d('0x22')](function(_0xc15b90){if(_0xc15b90){_0x2ac716=_0xc15b90[_0x2b2d('0x4e')];if(!_0x3a29a1[_0x2b2d('0x2e')]['hasOwnProperty'](_0x2b2d('0x50'))){_0x51a435['limit']=qs[_0x2b2d('0x1b')](_0x3a29a1['query'][_0x2b2d('0x1b')]);_0x51a435[_0x2b2d('0x19')]=qs[_0x2b2d('0x19')](_0x3a29a1['query'][_0x2b2d('0x19')]);}return _0x106396[_0x2b2d('0x4f')](_0x51a435);}})[_0x2b2d('0x22')](function(_0x1b5868){if(_0x1b5868){return _0x1b5868?{'count':_0x2ac716,'rows':_0x1b5868}:null;}})[_0x2b2d('0x22')](respondWithResult(_0x366aab,null))[_0x2b2d('0x40')](handleError(_0x366aab,null));}; \ No newline at end of file +var _0x9250=['sort','where','filters','pick','filter','merge','map','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','order','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','save','update','then','Companies','UserProfileResource','destroy','sendStatus','error','name','send','index','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','nolimit'];(function(_0x3b1745,_0x20b73f){var _0x51b2b4=function(_0x12d179){while(--_0x12d179){_0x3b1745['push'](_0x3b1745['shift']());}};_0x51b2b4(++_0x20b73f);}(_0x9250,0x182));var _0x0925=function(_0x5cb4aa,_0x466db3){_0x5cb4aa=_0x5cb4aa-0x0;var _0x1a0c35=_0x9250[_0x5cb4aa];return _0x1a0c35;};'use strict';var emlformat=require(_0x0925('0x0'));var rimraf=require(_0x0925('0x1'));var zipdir=require(_0x0925('0x2'));var jsonpatch=require(_0x0925('0x3'));var rp=require(_0x0925('0x4'));var moment=require(_0x0925('0x5'));var BPromise=require(_0x0925('0x6'));var Mustache=require('mustache');var util=require(_0x0925('0x7'));var path=require('path');var sox=require(_0x0925('0x8'));var csv=require(_0x0925('0x9'));var ejs=require(_0x0925('0xa'));var fs=require('fs');var fs_extra=require(_0x0925('0xb'));var _=require('lodash');var squel=require(_0x0925('0xc'));var crypto=require(_0x0925('0xd'));var jsforce=require(_0x0925('0xe'));var deskjs=require(_0x0925('0xf'));var toCsv=require(_0x0925('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0925('0x10'));var qs=require(_0x0925('0x11'));var as=require(_0x0925('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0925('0x13'))(_0x0925('0x14'));var utils=require(_0x0925('0x15'));var config=require(_0x0925('0x16'));var licenseUtil=require(_0x0925('0x17'));var db=require(_0x0925('0x18'))['db'];function respondWithStatusCode(_0x4f4c22,_0x11a8e8){_0x11a8e8=_0x11a8e8||0xcc;return function(_0x52b3bb){if(_0x52b3bb){return _0x4f4c22['sendStatus'](_0x11a8e8);}return _0x4f4c22[_0x0925('0x19')](_0x11a8e8)['end']();};}function respondWithResult(_0x175e50,_0x5d43fa){_0x5d43fa=_0x5d43fa||0xc8;return function(_0xc2aa18){if(_0xc2aa18){return _0x175e50[_0x0925('0x19')](_0x5d43fa)[_0x0925('0x1a')](_0xc2aa18);}};}function respondWithFilteredResult(_0x267b60,_0x3f2251){return function(_0x18e5d3){if(_0x18e5d3){var _0x4a5074=typeof _0x3f2251['offset']===_0x0925('0x1b')&&typeof _0x3f2251[_0x0925('0x1c')]==='undefined';var _0x25c3ba=_0x18e5d3[_0x0925('0x1d')];var _0x4dfb14=_0x4a5074?0x0:_0x3f2251['offset'];var _0x58ac17=_0x4a5074?_0x18e5d3[_0x0925('0x1d')]:_0x3f2251[_0x0925('0x1e')]+_0x3f2251[_0x0925('0x1c')];var _0x30798f;if(_0x58ac17>=_0x25c3ba){_0x58ac17=_0x25c3ba;_0x30798f=0xc8;}else{_0x30798f=0xce;}_0x267b60[_0x0925('0x19')](_0x30798f);return _0x267b60[_0x0925('0x1f')]('Content-Range',_0x4dfb14+'-'+_0x58ac17+'/'+_0x25c3ba)[_0x0925('0x1a')](_0x18e5d3);}return null;};}function patchUpdates(_0x348287){return function(_0x274e74){try{jsonpatch[_0x0925('0x20')](_0x274e74,_0x348287,!![]);}catch(_0x336d04){return BPromise['reject'](_0x336d04);}return _0x274e74[_0x0925('0x21')]();};}function saveUpdates(_0x557381,_0x2029bc){return function(_0x1378fb){if(_0x1378fb){return _0x1378fb[_0x0925('0x22')](_0x557381)[_0x0925('0x23')](function(_0x380acf){return _0x380acf;});}return null;};}function removeEntity(_0x13d640,_0x3bca76){return function(_0x45122e){if(_0x45122e){return _0x45122e['destroy']()[_0x0925('0x23')](function(){var _0x4bb7c3=_0x45122e['get']({'plain':!![]});var _0x5be6d6=_0x0925('0x24');return db[_0x0925('0x25')][_0x0925('0x26')]({'where':{'type':_0x5be6d6,'resourceId':_0x4bb7c3['id']}})[_0x0925('0x23')](function(){return _0x45122e;});})['then'](function(){_0x13d640[_0x0925('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed98f,_0x3f122d){return function(_0x4d88a4){if(!_0x4d88a4){_0x1ed98f[_0x0925('0x27')](0x194);}return _0x4d88a4;};}function handleError(_0x483308,_0x7ea00e){_0x7ea00e=_0x7ea00e||0x1f4;return function(_0x2c5e04){logger[_0x0925('0x28')](_0x2c5e04['stack']);if(_0x2c5e04[_0x0925('0x29')]){delete _0x2c5e04[_0x0925('0x29')];}_0x483308[_0x0925('0x19')](_0x7ea00e)[_0x0925('0x2a')](_0x2c5e04);};}exports[_0x0925('0x2b')]=function(_0x3fe011,_0x803152){var _0x36ba26={},_0x59ce03={},_0x882a0f={'count':0x0,'rows':[]};return db[_0x0925('0x2c')][_0x0925('0x2d')]()[_0x0925('0x23')](function(_0x4dfc8c){_0x59ce03['model']=_[_0x0925('0x2e')](_0x4dfc8c);_0x59ce03[_0x0925('0x2f')]=_[_0x0925('0x2e')](_0x3fe011['query']);_0x59ce03['filters']=_[_0x0925('0x30')](_0x59ce03[_0x0925('0x31')],_0x59ce03[_0x0925('0x2f')]);_0x36ba26[_0x0925('0x32')]=_[_0x0925('0x30')](_0x59ce03[_0x0925('0x31')],qs[_0x0925('0x33')](_0x3fe011[_0x0925('0x2f')][_0x0925('0x33')]));_0x36ba26[_0x0925('0x32')]=_0x36ba26[_0x0925('0x32')][_0x0925('0x34')]?_0x36ba26[_0x0925('0x32')]:_0x59ce03[_0x0925('0x31')];if(!_0x3fe011[_0x0925('0x2f')]['hasOwnProperty'](_0x0925('0x35'))){_0x36ba26['limit']=qs[_0x0925('0x1c')](_0x3fe011[_0x0925('0x2f')]['limit']);_0x36ba26[_0x0925('0x1e')]=qs[_0x0925('0x1e')](_0x3fe011[_0x0925('0x2f')][_0x0925('0x1e')]);}_0x36ba26['order']=qs['sort'](_0x3fe011[_0x0925('0x2f')][_0x0925('0x36')]);_0x36ba26[_0x0925('0x37')]=qs[_0x0925('0x38')](_[_0x0925('0x39')](_0x3fe011[_0x0925('0x2f')],_0x59ce03[_0x0925('0x38')]),_0x4dfc8c);if(_0x3fe011[_0x0925('0x2f')][_0x0925('0x3a')]){_0x36ba26[_0x0925('0x37')]=_[_0x0925('0x3b')](_0x36ba26['where'],{'$or':_[_0x0925('0x3c')](_0x36ba26[_0x0925('0x32')],function(_0x15da00){var _0x362db6={};_0x362db6[_0x15da00]={'$like':'%'+_0x3fe011[_0x0925('0x2f')][_0x0925('0x3a')]+'%'};return _0x362db6;})});}_0x36ba26=_['merge']({},_0x36ba26,_0x3fe011[_0x0925('0x3d')]);var _0x50dbd7={'where':_0x36ba26[_0x0925('0x37')]};return db[_0x0925('0x2c')][_0x0925('0x1d')](_0x50dbd7)[_0x0925('0x23')](function(_0x28b16b){_0x882a0f[_0x0925('0x1d')]=_0x28b16b;if(_0x3fe011[_0x0925('0x2f')]['includeAll']){_0x36ba26['include']=[{'all':!![]}];}return db[_0x0925('0x2c')][_0x0925('0x3e')](_0x36ba26);})[_0x0925('0x23')](function(_0x51d531){_0x882a0f[_0x0925('0x3f')]=_0x51d531;return _0x882a0f;})[_0x0925('0x23')](respondWithFilteredResult(_0x803152,_0x36ba26))[_0x0925('0x40')](handleError(_0x803152,null));})[_0x0925('0x40')](handleError(_0x803152,null));};exports[_0x0925('0x41')]=function(_0x502ca2,_0x17db29){var _0x16736f={'raw':![],'where':{'id':_0x502ca2[_0x0925('0x42')]['id']}},_0x52b83a={};_0x52b83a[_0x0925('0x31')]=_['keys'](db[_0x0925('0x2c')][_0x0925('0x43')]);_0x52b83a[_0x0925('0x2f')]=_['keys'](_0x502ca2[_0x0925('0x2f')]);_0x52b83a[_0x0925('0x38')]=_[_0x0925('0x30')](_0x52b83a[_0x0925('0x31')],_0x52b83a[_0x0925('0x2f')]);_0x16736f[_0x0925('0x32')]=_[_0x0925('0x30')](_0x52b83a[_0x0925('0x31')],qs[_0x0925('0x33')](_0x502ca2[_0x0925('0x2f')][_0x0925('0x33')]));_0x16736f['attributes']=_0x16736f[_0x0925('0x32')][_0x0925('0x34')]?_0x16736f['attributes']:_0x52b83a[_0x0925('0x31')];if(_0x502ca2['query'][_0x0925('0x44')]){_0x16736f[_0x0925('0x45')]=[{'all':!![]}];}_0x16736f=_[_0x0925('0x3b')]({},_0x16736f,_0x502ca2[_0x0925('0x3d')]);return db[_0x0925('0x2c')][_0x0925('0x46')](_0x16736f)[_0x0925('0x23')](handleEntityNotFound(_0x17db29,null))[_0x0925('0x23')](respondWithResult(_0x17db29,null))['catch'](handleError(_0x17db29,null));};exports[_0x0925('0x47')]=function(_0x17ac6d,_0x44133c){return db[_0x0925('0x2c')][_0x0925('0x47')](_0x17ac6d[_0x0925('0x48')],{})[_0x0925('0x23')](function(_0x24a879){var _0x33b257=_0x17ac6d[_0x0925('0x49')][_0x0925('0x4a')]({'plain':!![]});if(!_0x33b257)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33b257[_0x0925('0x4b')]===_0x0925('0x49')){var _0x27dd9c=_0x24a879[_0x0925('0x4a')]({'plain':!![]});var _0x3e5759='Companies';return db[_0x0925('0x4c')][_0x0925('0x46')]({'where':{'name':_0x3e5759,'userProfileId':_0x33b257[_0x0925('0x4d')]},'raw':!![]})[_0x0925('0x23')](function(_0x289ac4){if(_0x289ac4&&_0x289ac4[_0x0925('0x4e')]===0x0){return db['UserProfileResource'][_0x0925('0x47')]({'name':_0x27dd9c[_0x0925('0x29')],'resourceId':_0x27dd9c['id'],'type':_0x289ac4[_0x0925('0x29')],'sectionId':_0x289ac4['id']},{})[_0x0925('0x23')](function(){return _0x24a879;});}else{return _0x24a879;}})[_0x0925('0x40')](function(_0x2e7b7b){logger[_0x0925('0x28')](_0x0925('0x4f'),_0x2e7b7b);throw _0x2e7b7b;});}return _0x24a879;})[_0x0925('0x23')](respondWithResult(_0x44133c,0xc9))[_0x0925('0x40')](handleError(_0x44133c,null));};exports['update']=function(_0x1da0b9,_0x19e178){if(_0x1da0b9[_0x0925('0x48')]['id']){delete _0x1da0b9[_0x0925('0x48')]['id'];}return db[_0x0925('0x2c')][_0x0925('0x46')]({'where':{'id':_0x1da0b9['params']['id']}})[_0x0925('0x23')](handleEntityNotFound(_0x19e178,null))[_0x0925('0x23')](saveUpdates(_0x1da0b9[_0x0925('0x48')],null))['then'](respondWithResult(_0x19e178,null))[_0x0925('0x40')](handleError(_0x19e178,null));};exports[_0x0925('0x26')]=function(_0x14404d,_0x232c63){return db[_0x0925('0x2c')][_0x0925('0x46')]({'where':{'id':_0x14404d[_0x0925('0x42')]['id']}})[_0x0925('0x23')](handleEntityNotFound(_0x232c63,null))['then'](removeEntity(_0x232c63,null))[_0x0925('0x40')](handleError(_0x232c63,null));};exports[_0x0925('0x2d')]=function(_0x5e9635,_0x6752d6){return db[_0x0925('0x2c')][_0x0925('0x2d')]()[_0x0925('0x23')](respondWithResult(_0x6752d6,null))[_0x0925('0x40')](handleError(_0x6752d6,null));};exports[_0x0925('0x50')]=function(_0x2efe71,_0x49ce0c,_0x20cf62){return db['CmContact'][_0x0925('0x46')]({'where':{'id':_0x2efe71[_0x0925('0x42')]['id']}})[_0x0925('0x23')](handleEntityNotFound(_0x49ce0c,null))[_0x0925('0x23')](function(_0x4b008a){if(_0x4b008a){return _0x4b008a[_0x0925('0x50')](_0x2efe71[_0x0925('0x48')][_0x0925('0x51')],_[_0x0925('0x52')](_0x2efe71[_0x0925('0x48')],[_0x0925('0x51'),'id'])||{});}})[_0x0925('0x23')](respondWithResult(_0x49ce0c,null))[_0x0925('0x40')](handleError(_0x49ce0c,null));};exports[_0x0925('0x53')]=function(_0x157613,_0x2c17f2,_0x85e6d4){var _0x4e8a0a={};var _0x370c17={};var _0x147759;var _0x340724;return db[_0x0925('0x2c')][_0x0925('0x54')]({'where':{'id':_0x157613[_0x0925('0x42')]['id']}})[_0x0925('0x23')](handleEntityNotFound(_0x2c17f2,null))['then'](function(_0x330049){if(_0x330049){_0x147759=_0x330049;_0x370c17['model']=_[_0x0925('0x2e')](db[_0x0925('0x55')]['rawAttributes']);_0x370c17['query']=_[_0x0925('0x2e')](_0x157613[_0x0925('0x2f')]);_0x370c17[_0x0925('0x38')]=_[_0x0925('0x30')](_0x370c17[_0x0925('0x31')],_0x370c17[_0x0925('0x2f')]);_0x4e8a0a['attributes']=_[_0x0925('0x30')](_0x370c17[_0x0925('0x31')],qs[_0x0925('0x33')](_0x157613[_0x0925('0x2f')][_0x0925('0x33')]));_0x4e8a0a[_0x0925('0x32')]=_0x4e8a0a[_0x0925('0x32')][_0x0925('0x34')]?_0x4e8a0a['attributes']:_0x370c17[_0x0925('0x31')];_0x4e8a0a[_0x0925('0x56')]=qs['sort'](_0x157613[_0x0925('0x2f')][_0x0925('0x36')]);_0x4e8a0a[_0x0925('0x37')]=qs[_0x0925('0x38')](_[_0x0925('0x39')](_0x157613[_0x0925('0x2f')],_0x370c17[_0x0925('0x38')]));if(_0x157613[_0x0925('0x2f')][_0x0925('0x3a')]){_0x4e8a0a[_0x0925('0x37')]=_[_0x0925('0x3b')](_0x4e8a0a[_0x0925('0x37')],{'$or':_[_0x0925('0x3c')](_0x4e8a0a['attributes'],function(_0x18db08){var _0x5688cf={};_0x5688cf[_0x18db08]={'$like':'%'+_0x157613[_0x0925('0x2f')][_0x0925('0x3a')]+'%'};return _0x5688cf;})});}_0x4e8a0a=_[_0x0925('0x3b')]({},_0x4e8a0a,_0x157613['options']);return _0x147759[_0x0925('0x53')](_0x4e8a0a);}})[_0x0925('0x23')](function(_0x2f0404){if(_0x2f0404){_0x340724=_0x2f0404[_0x0925('0x34')];if(!_0x157613[_0x0925('0x2f')][_0x0925('0x57')](_0x0925('0x35'))){_0x4e8a0a[_0x0925('0x1c')]=qs['limit'](_0x157613[_0x0925('0x2f')][_0x0925('0x1c')]);_0x4e8a0a[_0x0925('0x1e')]=qs['offset'](_0x157613[_0x0925('0x2f')][_0x0925('0x1e')]);}return _0x147759[_0x0925('0x53')](_0x4e8a0a);}})[_0x0925('0x23')](function(_0x117265){if(_0x117265){return _0x117265?{'count':_0x340724,'rows':_0x117265}:null;}})[_0x0925('0x23')](respondWithResult(_0x2c17f2,null))['catch'](handleError(_0x2c17f2,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 1398584..6f6cb2b 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 _0x7b48=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7b48,0x1b8));var _0x87b4=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0x7b48[_0x377fb1];return _0x3248e9;};'use strict';var _=require(_0x87b4('0x0'));var util=require(_0x87b4('0x1'));var logger=require(_0x87b4('0x2'))(_0x87b4('0x3'));var moment=require(_0x87b4('0x4'));var BPromise=require(_0x87b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87b4('0x6'));var rimraf=require(_0x87b4('0x7'));var config=require(_0x87b4('0x8'));var attributes=require(_0x87b4('0x9'));module[_0x87b4('0xa')]=function(_0x18f070,_0x4710a9){return _0x18f070[_0x87b4('0xb')](_0x87b4('0xc'),attributes,{'tableName':_0x87b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7103=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x57b740,_0x3a8814){var _0x576e93=function(_0x5b8041){while(--_0x5b8041){_0x57b740['push'](_0x57b740['shift']());}};_0x576e93(++_0x3a8814);}(_0x7103,0x1c4));var _0x3710=function(_0x1577a7,_0x160b96){_0x1577a7=_0x1577a7-0x0;var _0x17afe5=_0x7103[_0x1577a7];return _0x17afe5;};'use strict';var _=require(_0x3710('0x0'));var util=require('util');var logger=require(_0x3710('0x1'))(_0x3710('0x2'));var moment=require(_0x3710('0x3'));var BPromise=require(_0x3710('0x4'));var rp=require(_0x3710('0x5'));var fs=require('fs');var path=require(_0x3710('0x6'));var rimraf=require(_0x3710('0x7'));var config=require(_0x3710('0x8'));var attributes=require(_0x3710('0x9'));module['exports']=function(_0x5184c2,_0x1091f9){return _0x5184c2[_0x3710('0xa')](_0x3710('0xb'),attributes,{'tableName':_0x3710('0xc'),'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 b00e413..a7975b9 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 _0x8fa6=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x8fa6,0x12b));var _0x68fa=function(_0x1ea1e6,_0x9ea918){_0x1ea1e6=_0x1ea1e6-0x0;var _0x32160f=_0x8fa6[_0x1ea1e6];return _0x32160f;};'use strict';var _=require(_0x68fa('0x0'));var util=require('util');var moment=require(_0x68fa('0x1'));var BPromise=require(_0x68fa('0x2'));var rs=require(_0x68fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68fa('0x4'))['db'];var utils=require(_0x68fa('0x5'));var logger=require(_0x68fa('0x6'))('rpc');var config=require(_0x68fa('0x7'));var jayson=require(_0x68fa('0x8'));var client=jayson['client'][_0x68fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ce37,_0x3e1446,_0x456bd4){return new BPromise(function(_0x9d1f80,_0x287ba5){return client['request'](_0x21ce37,_0x456bd4)[_0x68fa('0xa')](function(_0x71ba54){logger[_0x68fa('0xb')](_0x68fa('0xc'),_0x3e1446,_0x68fa('0xd'));logger[_0x68fa('0xe')](_0x68fa('0xf'),_0x3e1446,_0x68fa('0xd'),JSON[_0x68fa('0x10')](_0x71ba54));if(_0x71ba54['error']){if(_0x71ba54[_0x68fa('0x11')][_0x68fa('0x12')]===0x1f4){logger[_0x68fa('0x11')](_0x68fa('0xc'),_0x3e1446,_0x71ba54[_0x68fa('0x11')]['message']);return _0x287ba5(_0x71ba54['error']['message']);}logger[_0x68fa('0x11')](_0x68fa('0xc'),_0x3e1446,_0x71ba54[_0x68fa('0x11')][_0x68fa('0x13')]);return _0x9d1f80(_0x71ba54[_0x68fa('0x11')][_0x68fa('0x13')]);}else{logger[_0x68fa('0xb')](_0x68fa('0xc'),_0x3e1446,_0x68fa('0xd'));_0x9d1f80(_0x71ba54['result'][_0x68fa('0x13')]);}})['catch'](function(_0x5fa378){logger[_0x68fa('0x11')](_0x68fa('0xc'),_0x3e1446,_0x5fa378);_0x287ba5(_0x5fa378);});});} \ No newline at end of file +var _0x2dd9=['info','request\x20sent','error','code','CmCompany,\x20%s,\x20%s','message','result','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x2dd9,0x73));var _0x92dd=function(_0x393a76,_0x499424){_0x393a76=_0x393a76-0x0;var _0x2a5088=_0x2dd9[_0x393a76];return _0x2a5088;};'use strict';var _=require('lodash');var util=require(_0x92dd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x92dd('0x1'));var fs=require('fs');var Redis=require(_0x92dd('0x2'));var db=require(_0x92dd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x92dd('0x4'))(_0x92dd('0x5'));var config=require(_0x92dd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x92dd('0x7')][_0x92dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x378ed4,_0x47b757,_0x15c966){return new BPromise(function(_0x415202,_0x3175da){return client[_0x92dd('0x9')](_0x378ed4,_0x15c966)[_0x92dd('0xa')](function(_0x4b7d98){logger[_0x92dd('0xb')]('CmCompany,\x20%s,\x20%s',_0x47b757,_0x92dd('0xc'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x47b757,_0x92dd('0xc'),JSON['stringify'](_0x4b7d98));if(_0x4b7d98[_0x92dd('0xd')]){if(_0x4b7d98[_0x92dd('0xd')][_0x92dd('0xe')]===0x1f4){logger[_0x92dd('0xd')](_0x92dd('0xf'),_0x47b757,_0x4b7d98['error']['message']);return _0x3175da(_0x4b7d98[_0x92dd('0xd')]['message']);}logger[_0x92dd('0xd')](_0x92dd('0xf'),_0x47b757,_0x4b7d98['error'][_0x92dd('0x10')]);return _0x415202(_0x4b7d98[_0x92dd('0xd')][_0x92dd('0x10')]);}else{logger[_0x92dd('0xb')]('CmCompany,\x20%s,\x20%s',_0x47b757,_0x92dd('0xc'));_0x415202(_0x4b7d98[_0x92dd('0x11')][_0x92dd('0x10')]);}})['catch'](function(_0x5455ad){logger['error'](_0x92dd('0xf'),_0x47b757,_0x5455ad);_0x3175da(_0x5455ad);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index e6479b9..fe0d7a0 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 _0x7bfb=['../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','describe','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2bc2c5,_0x397067){var _0x4d4ee6=function(_0x58db34){while(--_0x58db34){_0x2bc2c5['push'](_0x2bc2c5['shift']());}};_0x4d4ee6(++_0x397067);}(_0x7bfb,0x199));var _0xb7bf=function(_0x27396f,_0x49c474){_0x27396f=_0x27396f-0x0;var _0x54df56=_0x7bfb[_0x27396f];return _0x54df56;};'use strict';var multer=require(_0xb7bf('0x0'));var util=require(_0xb7bf('0x1'));var path=require('path');var timeout=require(_0xb7bf('0x2'));var express=require('express');var router=express[_0xb7bf('0x3')]();var fs_extra=require(_0xb7bf('0x4'));var auth=require(_0xb7bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb7bf('0x6'));var controller=require(_0xb7bf('0x7'));router[_0xb7bf('0x8')]('/',auth['isAuthenticated'](),controller[_0xb7bf('0x9')]);router[_0xb7bf('0x8')]('/describe',auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xb')]);router[_0xb7bf('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb7bf('0x8')](_0xb7bf('0xc'),auth['isAuthenticated'](),controller[_0xb7bf('0xd')]);router[_0xb7bf('0xe')]('/',auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xf')]);router[_0xb7bf('0xe')](_0xb7bf('0xc'),auth[_0xb7bf('0xa')](),controller[_0xb7bf('0x10')]);router[_0xb7bf('0x11')](_0xb7bf('0x12'),auth['isAuthenticated'](),controller[_0xb7bf('0x13')]);router[_0xb7bf('0x14')](_0xb7bf('0x12'),auth[_0xb7bf('0xa')](),controller[_0xb7bf('0x15')]);module[_0xb7bf('0x16')]=router; \ No newline at end of file +var _0x45bb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','destroy'];(function(_0x3f8778,_0x476178){var _0x2cec9f=function(_0x3bb79e){while(--_0x3bb79e){_0x3f8778['push'](_0x3f8778['shift']());}};_0x2cec9f(++_0x476178);}(_0x45bb,0x79));var _0xb45b=function(_0x1574d9,_0x39a7be){_0x1574d9=_0x1574d9-0x0;var _0x1f2152=_0x45bb[_0x1574d9];return _0x1f2152;};'use strict';var multer=require(_0xb45b('0x0'));var util=require(_0xb45b('0x1'));var path=require(_0xb45b('0x2'));var timeout=require(_0xb45b('0x3'));var express=require(_0xb45b('0x4'));var router=express[_0xb45b('0x5')]();var fs_extra=require(_0xb45b('0x6'));var auth=require(_0xb45b('0x7'));var interaction=require(_0xb45b('0x8'));var config=require(_0xb45b('0x9'));var controller=require(_0xb45b('0xa'));router[_0xb45b('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb45b('0xb')]('/describe',auth[_0xb45b('0xc')](),controller[_0xb45b('0xd')]);router[_0xb45b('0xb')](_0xb45b('0xe'),auth['isAuthenticated'](),controller[_0xb45b('0xf')]);router['get'](_0xb45b('0x10'),auth[_0xb45b('0xc')](),controller[_0xb45b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb45b('0x12')]);router[_0xb45b('0x13')](_0xb45b('0x10'),auth['isAuthenticated'](),controller[_0xb45b('0x14')]);router[_0xb45b('0x15')](_0xb45b('0xe'),auth[_0xb45b('0xc')](),controller['update']);router['delete'](_0xb45b('0xe'),auth[_0xb45b('0xc')](),controller[_0xb45b('0x16')]);module[_0xb45b('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index d944098..219a7ec 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 _0x9997=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9997,0x16a));var _0x7999=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x9997[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0x7999('0x0'));var Sequelize=require('sequelize');module[_0x7999('0x1')]={'firstName':{'type':Sequelize[_0x7999('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7999('0x2')]},'street':{'type':Sequelize[_0x7999('0x2')]},'postalCode':{'type':Sequelize[_0x7999('0x2')]},'city':{'type':Sequelize[_0x7999('0x2')]},'country':{'type':Sequelize[_0x7999('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x7999('0x2')]},'mobile':{'type':Sequelize[_0x7999('0x2')]},'fax':{'type':Sequelize[_0x7999('0x2')]},'email':{'type':Sequelize[_0x7999('0x2')]},'url':{'type':Sequelize[_0x7999('0x2')]},'facebook':{'type':Sequelize[_0x7999('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7999('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7999('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x7999('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7999('0x3')]},'priority':{'type':Sequelize[_0x7999('0x3')](0x2)[_0x7999('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7999('0x5')],'defaultValue':Sequelize[_0x7999('0x6')]}}; \ No newline at end of file +var _0x1e8a=['TEXT','INTEGER','DATE','NOW','lodash','sequelize','STRING'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x1e8a,0xa5));var _0xa1e8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1e8a[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xa1e8('0x0'));var Sequelize=require(_0xa1e8('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa1e8('0x2')]},'street':{'type':Sequelize[_0xa1e8('0x2')]},'postalCode':{'type':Sequelize[_0xa1e8('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa1e8('0x3')]},'phone':{'type':Sequelize[_0xa1e8('0x2')]},'mobile':{'type':Sequelize[_0xa1e8('0x2')]},'fax':{'type':Sequelize[_0xa1e8('0x2')]},'email':{'type':Sequelize[_0xa1e8('0x2')]},'url':{'type':Sequelize[_0xa1e8('0x2')]},'facebook':{'type':Sequelize[_0xa1e8('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa1e8('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa1e8('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa1e8('0x2')]},'wechat':{'type':Sequelize[_0xa1e8('0x2')]},'telegram':{'type':Sequelize[_0xa1e8('0x2')]},'UserId':{'type':Sequelize[_0xa1e8('0x4')]},'priority':{'type':Sequelize[_0xa1e8('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa1e8('0x5')],'defaultValue':Sequelize[_0xa1e8('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 6e49e2c..540c0a4 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 _0xdafa=['ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','spread','show','$and','omit','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','pick','getTags','nolimit','setTags','ids','getHoppers','ContactId','options','include','getHopperHistories','getJscriptySessions','includeAll','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','createReadStream','parse','User','No\x20ListId\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','message','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','Owner','browserName','deviceModel','osName','ratingMessage','referer','mail','subject','substatus','threadId','sortBy','reverse','slice','moment','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','./cmContact.socket','register','status','json','offset','undefined','count','set','update','then','destroy','end','sendStatus','error','stack','name','index','CmContact','keys','length','startsWith','push','CmCustomField','trimStart','all','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','uc.UserId\x20=\x20?','dateOfBirth','text','start','filter','isNil','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','resolve','agent','some','user','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','describe','tags','displayName','analytics','findAll','cf_','columnName','alias','custom','values','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction'];(function(_0x19a0de,_0x41661a){var _0x4a0e77=function(_0x12627d){while(--_0x12627d){_0x19a0de['push'](_0x19a0de['shift']());}};_0x4a0e77(++_0x41661a);}(_0xdafa,0x7d));var _0xadaf=function(_0x5eaa1f,_0xafbf6b){_0x5eaa1f=_0x5eaa1f-0x0;var _0x3f056d=_0xdafa[_0x5eaa1f];return _0x3f056d;};'use strict';var moment=require(_0xadaf('0x0'));var BPromise=require(_0xadaf('0x1'));var util=require(_0xadaf('0x2'));var path=require(_0xadaf('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xadaf('0x4'));var Papa=require(_0xadaf('0x5'));var Redis=require(_0xadaf('0x6'));var qs=require(_0xadaf('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xadaf('0x8'))(_0xadaf('0x9'));var config=require('../../config/environment');var db=require(_0xadaf('0xa'))['db'];config[_0xadaf('0xb')]=_['defaults'](config[_0xadaf('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadaf('0xb')]));require(_0xadaf('0xc'))[_0xadaf('0xd')](socket);function respondWithResult(_0x39243f,_0x4da144){_0x4da144=_0x4da144||0xc8;return function(_0x4bb90e){if(_0x4bb90e){return _0x39243f[_0xadaf('0xe')](_0x4da144)[_0xadaf('0xf')](_0x4bb90e);}};}function respondWithFilteredResult(_0x9238c8,_0x2f0594){return function(_0x1a0e70){if(_0x1a0e70){var _0x2de6a4=typeof _0x2f0594[_0xadaf('0x10')]===_0xadaf('0x11')&&typeof _0x2f0594['limit']===_0xadaf('0x11');var _0xb2d3bf=_0x1a0e70[_0xadaf('0x12')];var _0x1555e2=_0x2de6a4?0x0:_0x2f0594[_0xadaf('0x10')];var _0x3b05fd=_0x2de6a4?_0x1a0e70[_0xadaf('0x12')]:_0x2f0594[_0xadaf('0x10')]+_0x2f0594['limit'];var _0x40625f;if(_0x3b05fd>=_0xb2d3bf){_0x3b05fd=_0xb2d3bf;_0x40625f=0xc8;}else{_0x40625f=0xce;}_0x9238c8['status'](_0x40625f);return _0x9238c8[_0xadaf('0x13')]('Content-Range',_0x1555e2+'-'+_0x3b05fd+'/'+_0xb2d3bf)[_0xadaf('0xf')](_0x1a0e70);}return null;};}function saveUpdates(_0x213cf1){return function(_0x5661fe){if(_0x5661fe){return _0x5661fe[_0xadaf('0x14')](_0x213cf1)[_0xadaf('0x15')](function(_0x59546b){return _0x59546b;});}return null;};}function removeEntity(_0x2a8ccd){return function(_0x2fa3b0){if(_0x2fa3b0){return _0x2fa3b0[_0xadaf('0x16')]()[_0xadaf('0x15')](function(){_0x2a8ccd[_0xadaf('0xe')](0xcc)[_0xadaf('0x17')]();});}};}function handleEntityNotFound(_0x2b2890){return function(_0x3d9702){if(!_0x3d9702){_0x2b2890[_0xadaf('0x18')](0x194);}return _0x3d9702;};}function handleError(_0x9ee4c9,_0x449f05){_0x449f05=_0x449f05||0x1f4;return function(_0x274962){logger[_0xadaf('0x19')](_0x274962[_0xadaf('0x1a')]);if(_0x274962[_0xadaf('0x1b')]){delete _0x274962['name'];}_0x9ee4c9[_0xadaf('0xe')](_0x449f05)['send'](_0x274962);};}exports[_0xadaf('0x1c')]=function(_0x1a021e,_0x315bda){var _0x435192={},_0x209112={},_0x4c041b={'count':0x0,'rows':[]};return db[_0xadaf('0x1d')]['describe']()[_0xadaf('0x15')](function(_0x30e8ac){var _0x3ce754=[];for(var _0x12aafc=0x0;_0x12aafc0x1){_0x6df0b0['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xadaf('0x5b')](_0x337540),null);}else{if(qs['isNumeric'](_0x337540)){_0x6df0b0['or'](_0xadaf('0x5c'),_0x337540+'%');_0x6df0b0['or'](_0xadaf('0x5d'),_0x337540+'%');_0x6df0b0['or'](_0xadaf('0x5e'),_0x337540+'%');_0x6df0b0['or'](_0xadaf('0x5f'),_0x337540+'%');}else if(qs[_0xadaf('0x60')](_0x337540)){_0x6df0b0['or'](_0xadaf('0x61'),_0x337540+'%');}else{_0x6df0b0['or']('c.firstName\x20LIKE\x20?','%'+_0x337540+'%');_0x6df0b0['or'](_0xadaf('0x62'),'%'+_0x337540+'%');_0x6df0b0['or'](_0xadaf('0x61'),'%'+_0x337540+'%');}}}}_0x28cfb3['where'](_0x6df0b0);_0x28cfb3[_0xadaf('0x63')](_0xadaf('0x64'));var _0x1fbc13={'type':db['Sequelize'][_0xadaf('0x65')][_0xadaf('0x66')],'raw':!![]};var _0x1f6f7c=_0x28cfb3['clone']()[_0xadaf('0x32')](_0xadaf('0x64'));if(_0x435192[_0xadaf('0x2f')]){_0x435192[_0xadaf('0x2f')][_0xadaf('0x50')](function(_0x15104a){_0x28cfb3[_0xadaf('0x2f')]('c.'+_0x15104a[0x0],_0x15104a[0x1]===_0xadaf('0x67')?![]:!![]);});}if(!_['isEmpty'](_0x36ea30)){_0x28cfb3[_0xadaf('0x68')](_0x3348bb);_0x1f6f7c[_0xadaf('0x3d')](_0xadaf('0x69'),_0x36ea30);}BPromise[_0xadaf('0x6a')]()[_0xadaf('0x15')](function(){if(!_0x5482ed)return;if(_0x1a021e['user']['role']!==_0xadaf('0x6b'))return;if(!_[_0xadaf('0x6c')](_0x5482ed[_0xadaf('0x42')],[_0xadaf('0x32'),'User'])){return _0x1a021e[_0xadaf('0x6d')][_0xadaf('0x6e')]({'attributes':['id'],'raw':!![]})[_0xadaf('0x15')](function(_0x5c198a){if(_[_0xadaf('0x4f')](_0x5c198a)){_0x1f6f7c[_0xadaf('0x3d')](_0xadaf('0x6f'));_0x28cfb3[_0xadaf('0x3d')](_0xadaf('0x6f'));}else{_0x1f6f7c['where'](_0xadaf('0x52'),_['map'](_0x5c198a,'id'));_0x28cfb3[_0xadaf('0x3d')]('c.ListId\x20IN\x20?',_[_0xadaf('0x46')](_0x5c198a,'id'));}});}})[_0xadaf('0x15')](function(){if(_0x1a021e['user'][_0xadaf('0x70')]==='agent'&&!_0x5482ed&&!_0x1a021e['query'][_0xadaf('0x51')])return[];return db[_0xadaf('0x71')][_0xadaf('0x28')](_0x1f6f7c[_0xadaf('0x72')](),_0x1fbc13);})[_0xadaf('0x15')](function(_0x4860ea){_0x4c041b[_0xadaf('0x12')]=_0x4860ea[_0xadaf('0x1f')];if(_0x4c041b[_0xadaf('0x12')]===0x0)return[];return db['sequelize']['query'](_0x327826[_0xadaf('0x72')](),_0x1fbc13)[_0xadaf('0x15')](function(_0x5e3bb4){_0x2d04ab=_[_0xadaf('0x73')](_0x5e3bb4,'id');_0x1fbc13=_[_0xadaf('0x74')](_0x1fbc13,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a021e[_0xadaf('0x28')][_0xadaf('0x2b')]){_0x435192['attributes'][_0xadaf('0x50')](function(_0x2235f5){_0x28cfb3[_0xadaf('0x32')]('c.'+_0x2235f5);});}else{_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x64'));_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x75'));_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x76'));_0x28cfb3[_0xadaf('0x32')]('c.phone');_0x28cfb3['field'](_0xadaf('0x77'));_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x78'));_0x28cfb3[_0xadaf('0x32')]('c.email');_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x79'));_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x7a'));_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x7b'));_0x28cfb3['field'](_0xadaf('0x7c'));_0x28cfb3[_0xadaf('0x32')](_0xadaf('0x7d'),_0xadaf('0x7e'));}if(_0x435192['limit'])_0x28cfb3[_0xadaf('0x2e')](_0x435192[_0xadaf('0x2e')]);if(_0x435192['offset'])_0x28cfb3[_0xadaf('0x10')](_0x435192[_0xadaf('0x10')]);return db[_0xadaf('0x71')]['query'](_0x28cfb3[_0xadaf('0x72')](),_0x1fbc13);});})[_0xadaf('0x15')](function(_0x1c62fa){_0x1c62fa[_0xadaf('0x50')](function(_0x45219c){if(_0x45219c[_0xadaf('0x7e')]){_0x45219c[_0xadaf('0x7f')]=[];_0x45219c['TagIds'][_0xadaf('0x5a')](',')['forEach'](function(_0x2634e4){_0x45219c[_0xadaf('0x7f')][_0xadaf('0x21')](_0x2d04ab[_0x2634e4]);});}delete _0x45219c[_0xadaf('0x7e')];});_0x4c041b[_0xadaf('0x80')]=_0x1c62fa;return _0x4c041b;})[_0xadaf('0x15')](respondWithFilteredResult(_0x315bda,_0x435192));})[_0xadaf('0x81')](handleError(_0x315bda,null));};exports[_0xadaf('0x16')]=function(_0x1a732d,_0x4fd542){return db['CmContact'][_0xadaf('0x43')]({'where':{'id':_0x1a732d[_0xadaf('0x82')]['id']}})[_0xadaf('0x15')](handleEntityNotFound(_0x4fd542,null))[_0xadaf('0x15')](removeEntity(_0x4fd542,null))['catch'](handleError(_0x4fd542,null));};exports[_0xadaf('0x83')]=function(_0x3dddd0,_0x248970){return db['CmContact']['describe']()['then'](function(_0x11e287){delete _0x11e287[_0xadaf('0x84')];for(var _0x43754a=0x0;_0x43754a=_0x307174){_0x3c45a4=_0x307174;_0x73394d=0xc8;}else{_0x73394d=0xce;}_0x188eae[_0xd889('0x15')](_0x73394d);return _0x188eae[_0xd889('0x16')]('Content-Range',_0x1a9e04+'-'+_0x3c45a4+'/'+_0x307174)[_0xd889('0x10')](_0x3c8ece);}return null;};}function saveUpdates(_0x42b2f4){return function(_0x2b0667){if(_0x2b0667){return _0x2b0667[_0xd889('0x17')](_0x42b2f4)[_0xd889('0x18')](function(_0x151c13){return _0x151c13;});}return null;};}function removeEntity(_0x2ff273){return function(_0x102ba5){if(_0x102ba5){return _0x102ba5['destroy']()[_0xd889('0x18')](function(){_0x2ff273[_0xd889('0x15')](0xcc)[_0xd889('0x19')]();});}};}function handleEntityNotFound(_0x45222a){return function(_0x5195e9){if(!_0x5195e9){_0x45222a[_0xd889('0x1a')](0x194);}return _0x5195e9;};}function handleError(_0x17591b,_0x2bf73a){_0x2bf73a=_0x2bf73a||0x1f4;return function(_0x3c3477){logger['error'](_0x3c3477['stack']);if(_0x3c3477[_0xd889('0x1b')]){delete _0x3c3477['name'];}_0x17591b[_0xd889('0x15')](_0x2bf73a)[_0xd889('0x1c')](_0x3c3477);};}exports[_0xd889('0x1d')]=function(_0x73ac50,_0x235c25){var _0x1d3508={},_0xbd9d16={},_0x4606fe={'count':0x0,'rows':[]};return db[_0xd889('0x1e')][_0xd889('0x1f')]()[_0xd889('0x18')](function(_0x560e6b){var _0x1deb39=[];for(var _0x4d4d08=0x0;_0x4d4d080x1){_0x2c33d1['or'](_0xd889('0x5a'),qs[_0xd889('0x5b')](_0x492076),null);}else{if(qs[_0xd889('0x5c')](_0x492076)){_0x2c33d1['or'](_0xd889('0x5d'),_0x492076+'%');_0x2c33d1['or']('c.phone\x20LIKE\x20?',_0x492076+'%');_0x2c33d1['or'](_0xd889('0x5e'),_0x492076+'%');_0x2c33d1['or'](_0xd889('0x5f'),_0x492076+'%');}else if(qs[_0xd889('0x60')](_0x492076)){_0x2c33d1['or'](_0xd889('0x61'),_0x492076+'%');}else{_0x2c33d1['or']('c.firstName\x20LIKE\x20?','%'+_0x492076+'%');_0x2c33d1['or'](_0xd889('0x62'),'%'+_0x492076+'%');_0x2c33d1['or'](_0xd889('0x61'),'%'+_0x492076+'%');}}}}_0x280fdc[_0xd889('0x2d')](_0x2c33d1);_0x280fdc[_0xd889('0x63')](_0xd889('0x64'));var _0x3e6729={'type':db[_0xd889('0x65')][_0xd889('0x66')]['SELECT'],'raw':!![]};var _0x58cc34=_0x280fdc[_0xd889('0x67')]()[_0xd889('0x31')](_0xd889('0x64'));if(_0x1d3508['order']){_0x1d3508[_0xd889('0x2c')][_0xd889('0x42')](function(_0x589914){_0x280fdc['order']('c.'+_0x589914[0x0],_0x589914[0x1]===_0xd889('0x68')?![]:!![]);});}if(!_['isEmpty'](_0x2fea25)){_0x280fdc['having'](_0x38320a);_0x58cc34[_0xd889('0x2d')](_0xd889('0x69'),_0x2fea25);}BPromise[_0xd889('0x6a')]()[_0xd889('0x18')](function(){if(!_0x46449a)return;if(_0x73ac50[_0xd889('0x6b')]['role']!==_0xd889('0x6c'))return;if(!_[_0xd889('0x6d')](_0x46449a[_0xd889('0x3e')],[_0xd889('0x31'),_0xd889('0x45')])){return _0x73ac50[_0xd889('0x6b')][_0xd889('0x6e')]({'attributes':['id'],'raw':!![]})[_0xd889('0x18')](function(_0x360313){if(_[_0xd889('0x52')](_0x360313)){_0x58cc34[_0xd889('0x2d')](_0xd889('0x6f'));_0x280fdc[_0xd889('0x2d')](_0xd889('0x6f'));}else{_0x58cc34['where'](_0xd889('0x70'),_[_0xd889('0x71')](_0x360313,'id'));_0x280fdc[_0xd889('0x2d')](_0xd889('0x70'),_[_0xd889('0x71')](_0x360313,'id'));}});}})[_0xd889('0x18')](function(){if(_0x73ac50[_0xd889('0x6b')][_0xd889('0x72')]===_0xd889('0x6c')&&!_0x46449a&&!_0x73ac50[_0xd889('0x28')]['ListId'])return[];return db[_0xd889('0x73')][_0xd889('0x28')](_0x58cc34[_0xd889('0x74')](),_0x3e6729);})[_0xd889('0x18')](function(_0x44ec3c){_0x4606fe['count']=_0x44ec3c[_0xd889('0x21')];if(_0x4606fe[_0xd889('0x13')]===0x0)return[];return db[_0xd889('0x73')][_0xd889('0x28')](_0x2278ea[_0xd889('0x74')](),_0x3e6729)['then'](function(_0x41ac23){_0x57985d=_[_0xd889('0x75')](_0x41ac23,'id');_0x3e6729=_[_0xd889('0x76')](_0x3e6729,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x73ac50[_0xd889('0x28')]['fields']){_0x1d3508[_0xd889('0x29')][_0xd889('0x42')](function(_0x13753f){_0x280fdc[_0xd889('0x31')]('c.'+_0x13753f);});}else{_0x280fdc['field'](_0xd889('0x64'));_0x280fdc['field']('c.firstName');_0x280fdc[_0xd889('0x31')]('c.lastName');_0x280fdc[_0xd889('0x31')]('c.phone');_0x280fdc[_0xd889('0x31')](_0xd889('0x77'));_0x280fdc[_0xd889('0x31')](_0xd889('0x78'));_0x280fdc['field'](_0xd889('0x79'));_0x280fdc['field'](_0xd889('0x7a'));_0x280fdc[_0xd889('0x31')](_0xd889('0x7b'));_0x280fdc[_0xd889('0x31')](_0xd889('0x7c'));_0x280fdc['field'](_0xd889('0x7d'));_0x280fdc[_0xd889('0x31')](_0xd889('0x7e'),'TagIds');}if(_0x1d3508[_0xd889('0x12')])_0x280fdc[_0xd889('0x12')](_0x1d3508[_0xd889('0x12')]);if(_0x1d3508['offset'])_0x280fdc['offset'](_0x1d3508[_0xd889('0x14')]);return db[_0xd889('0x73')]['query'](_0x280fdc[_0xd889('0x74')](),_0x3e6729);});})[_0xd889('0x18')](function(_0x4c5495){_0x4c5495[_0xd889('0x42')](function(_0x5c4f61){if(_0x5c4f61['TagIds']){_0x5c4f61[_0xd889('0x7f')]=[];_0x5c4f61[_0xd889('0x80')][_0xd889('0x41')](',')[_0xd889('0x42')](function(_0x4a9b38){_0x5c4f61[_0xd889('0x7f')][_0xd889('0x23')](_0x57985d[_0x4a9b38]);});}delete _0x5c4f61[_0xd889('0x80')];});_0x4606fe[_0xd889('0x81')]=_0x4c5495;return _0x4606fe;})[_0xd889('0x18')](respondWithFilteredResult(_0x235c25,_0x1d3508));})[_0xd889('0x82')](handleError(_0x235c25,null));};exports[_0xd889('0x83')]=function(_0x4f08d7,_0x33b0ae){return db['CmContact'][_0xd889('0x3f')]({'where':{'id':_0x4f08d7['params']['id']}})[_0xd889('0x18')](handleEntityNotFound(_0x33b0ae,null))[_0xd889('0x18')](removeEntity(_0x33b0ae,null))['catch'](handleError(_0x33b0ae,null));};exports[_0xd889('0x1f')]=function(_0x4181a9,_0x47828c){return db['CmContact'][_0xd889('0x1f')]()[_0xd889('0x18')](function(_0x3c381d){delete _0x3c381d[_0xd889('0x84')];for(var _0x30a4e5=0x0;_0x30a4e5{}\s\\|]/g,'-');_0x110a48(null,util['format'](_0x77ef('0x23'),path[_0x77ef('0x24')](_0x1498e6[_0x77ef('0x22')],path[_0x77ef('0x25')](_0x1498e6[_0x77ef('0x22')])),Date['now'](),path[_0x77ef('0x25')](_0x1498e6[_0x77ef('0x22')])));}})});router[_0x77ef('0x1a')]('/csv',upload[_0x77ef('0x26')]('file'),controller[_0x77ef('0x27')]);var upload=multer({'storage':multer[_0x77ef('0x1f')]({'destination':function(_0x37ebf4,_0x3514af,_0x249d04){_0x249d04(null,path[_0x77ef('0x20')](config[_0x77ef('0x21')],_0x77ef('0x28')));},'filename':function(_0x4c673f,_0x18190d,_0x556491){_0x18190d[_0x77ef('0x22')]=_0x18190d[_0x77ef('0x22')][_0x77ef('0x29')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x556491(null,util[_0x77ef('0x2a')](_0x77ef('0x23'),path['basename'](_0x18190d['originalname'],path[_0x77ef('0x25')](_0x18190d[_0x77ef('0x22')])),Date[_0x77ef('0x2b')](),path[_0x77ef('0x25')](_0x18190d[_0x77ef('0x22')])));}})});router[_0x77ef('0x1a')](_0x77ef('0x2c'),upload[_0x77ef('0x26')](_0x77ef('0x2d')),controller[_0x77ef('0x2e')]);router[_0x77ef('0x1a')](_0x77ef('0x2f'),auth[_0x77ef('0xb')](),controller['import']);router['put'](_0x77ef('0xf'),auth[_0x77ef('0xb')](),controller[_0x77ef('0x30')]);router[_0x77ef('0x31')](_0x77ef('0xf'),auth[_0x77ef('0xb')](),controller[_0x77ef('0x32')]);module[_0x77ef('0x33')]=router; \ No newline at end of file +var _0xcb57=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','join','root','server/files/tmp','originalname','now','extname','/csv','single','file','uploadCsv','diskStorage','replace','format','%s-%s%s','basename','upload','/upload/:id','import','put','update'];(function(_0x2b84f5,_0x5d102a){var _0x4c4912=function(_0x2714cf){while(--_0x2714cf){_0x2b84f5['push'](_0x2b84f5['shift']());}};_0x4c4912(++_0x5d102a);}(_0xcb57,0x10b));var _0x7cb5=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xcb57[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0x7cb5('0x0'));var util=require(_0x7cb5('0x1'));var path=require('path');var timeout=require(_0x7cb5('0x2'));var express=require(_0x7cb5('0x3'));var router=express[_0x7cb5('0x4')]();var fs_extra=require(_0x7cb5('0x5'));var auth=require(_0x7cb5('0x6'));var interaction=require(_0x7cb5('0x7'));var config=require(_0x7cb5('0x8'));var controller=require(_0x7cb5('0x9'));router[_0x7cb5('0xa')]('/',auth[_0x7cb5('0xb')](),controller[_0x7cb5('0xc')]);router[_0x7cb5('0xa')](_0x7cb5('0xd'),auth[_0x7cb5('0xb')](),controller['describe']);router['get'](_0x7cb5('0xe'),auth['isAuthenticated'](),controller[_0x7cb5('0xf')]);router[_0x7cb5('0xa')](_0x7cb5('0x10'),auth[_0x7cb5('0xb')](),controller[_0x7cb5('0x11')]);router['get'](_0x7cb5('0x12'),auth['isAuthenticated'](),controller[_0x7cb5('0x13')]);router[_0x7cb5('0xa')](_0x7cb5('0x14'),auth['isAuthenticated'](),controller[_0x7cb5('0x15')]);router[_0x7cb5('0xa')]('/:id/hopper_finals',auth[_0x7cb5('0xb')](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0x7cb5('0xb')](),controller[_0x7cb5('0x16')]);router[_0x7cb5('0xa')](_0x7cb5('0x17'),auth[_0x7cb5('0xb')](),controller[_0x7cb5('0x18')]);router[_0x7cb5('0x19')](_0x7cb5('0x1a'),auth[_0x7cb5('0xb')](),controller[_0x7cb5('0x1b')]);router[_0x7cb5('0x19')]('/',auth['isAuthenticated'](),controller[_0x7cb5('0x1c')]);router[_0x7cb5('0x19')](_0x7cb5('0x1d'),auth[_0x7cb5('0xb')](),controller[_0x7cb5('0x1e')]);router[_0x7cb5('0x19')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3733f8,_0x2ef7ae,_0xe0e397){_0xe0e397(null,path[_0x7cb5('0x1f')](config[_0x7cb5('0x20')],_0x7cb5('0x21')));},'filename':function(_0x524d6a,_0x9f171a,_0x19e49a){_0x9f171a[_0x7cb5('0x22')]=_0x9f171a[_0x7cb5('0x22')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x19e49a(null,util['format']('%s-%s%s',path['basename'](_0x9f171a[_0x7cb5('0x22')],path['extname'](_0x9f171a['originalname'])),Date[_0x7cb5('0x23')](),path[_0x7cb5('0x24')](_0x9f171a[_0x7cb5('0x22')])));}})});router[_0x7cb5('0x19')](_0x7cb5('0x25'),upload[_0x7cb5('0x26')](_0x7cb5('0x27')),controller[_0x7cb5('0x28')]);var upload=multer({'storage':multer[_0x7cb5('0x29')]({'destination':function(_0x4cb7d7,_0x4d0f68,_0x4187f1){_0x4187f1(null,path[_0x7cb5('0x1f')](config[_0x7cb5('0x20')],_0x7cb5('0x21')));},'filename':function(_0xd5555e,_0x1404f9,_0x518d85){_0x1404f9[_0x7cb5('0x22')]=_0x1404f9[_0x7cb5('0x22')][_0x7cb5('0x2a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x518d85(null,util[_0x7cb5('0x2b')](_0x7cb5('0x2c'),path[_0x7cb5('0x2d')](_0x1404f9[_0x7cb5('0x22')],path[_0x7cb5('0x24')](_0x1404f9[_0x7cb5('0x22')])),Date[_0x7cb5('0x23')](),path[_0x7cb5('0x24')](_0x1404f9[_0x7cb5('0x22')])));}})});router[_0x7cb5('0x19')]('/upload',upload[_0x7cb5('0x26')](_0x7cb5('0x27')),controller[_0x7cb5('0x2e')]);router[_0x7cb5('0x19')](_0x7cb5('0x2f'),auth['isAuthenticated'](),controller[_0x7cb5('0x30')]);router[_0x7cb5('0x31')]('/:id',auth[_0x7cb5('0xb')](),controller[_0x7cb5('0x32')]);router['delete'](_0x7cb5('0xe'),auth['isAuthenticated'](),controller[_0x7cb5('0x33')]);module[_0x7cb5('0x34')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 0aee041..bdfe75c 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 _0x1fe2=['BOOLEAN','ENUM','voice','sequelize','lodash','alias','STRING','setDataValue','getDataValue','TEXT','select','parse','values','isArray'];(function(_0x5440a4,_0x5e1b01){var _0x4732ca=function(_0x5a7eef){while(--_0x5a7eef){_0x5440a4['push'](_0x5440a4['shift']());}};_0x4732ca(++_0x5e1b01);}(_0x1fe2,0x73));var _0x21fe=function(_0x49c6cc,_0xce5bc6){_0x49c6cc=_0x49c6cc-0x0;var _0x1d12c4=_0x1fe2[_0x49c6cc];return _0x1d12c4;};'use strict';var Sequelize=require(_0x21fe('0x0'));var _=require(_0x21fe('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4f788c){return this['getDataValue'](_0x21fe('0x2'));}},'alias':{'type':Sequelize[_0x21fe('0x3')],'allowNull':![],'set':function(_0x30d7f1){this[_0x21fe('0x4')](_0x21fe('0x2'),_0x30d7f1?_0x30d7f1:this[_0x21fe('0x5')]('name'));}},'type':{'type':Sequelize[_0x21fe('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x21fe('0x6')]('long'),'get':function(){if(this[_0x21fe('0x5')]('type')===_0x21fe('0x7')){return JSON[_0x21fe('0x8')](this['getDataValue']('values'));}else{return this[_0x21fe('0x5')](_0x21fe('0x9'));}},'set':function(_0x57bdac){if(Array[_0x21fe('0xa')](_0x57bdac)){this['setDataValue'](_0x21fe('0x9'),JSON['stringify'](_0x57bdac));}else{this[_0x21fe('0x4')](_0x21fe('0x9'),_0x57bdac);}}},'required':{'type':Sequelize[_0x21fe('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x21fe('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x21fe('0xc')](_0x21fe('0xd'))}}; \ No newline at end of file +var _0x757a=['alias','name','TEXT','long','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','sequelize','lodash','getDataValue','STRING'];(function(_0x5efbac,_0x4ad9b8){var _0x368212=function(_0x2fa3f2){while(--_0x2fa3f2){_0x5efbac['push'](_0x5efbac['shift']());}};_0x368212(++_0x4ad9b8);}(_0x757a,0xac));var _0xa757=function(_0x16e4a3,_0x534ec3){_0x16e4a3=_0x16e4a3-0x0;var _0x4254c0=_0x757a[_0x16e4a3];return _0x4254c0;};'use strict';var Sequelize=require(_0xa757('0x0'));var _=require(_0xa757('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x643a83){return this[_0xa757('0x2')]('alias');}},'alias':{'type':Sequelize[_0xa757('0x3')],'allowNull':![],'set':function(_0x551c2e){this['setDataValue'](_0xa757('0x4'),_0x551c2e?_0x551c2e:this[_0xa757('0x2')](_0xa757('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x7')),'get':function(){if(this['getDataValue']('type')===_0xa757('0x8')){return JSON[_0xa757('0x9')](this[_0xa757('0x2')](_0xa757('0xa')));}else{return this[_0xa757('0x2')]('values');}},'set':function(_0x5d4ec7){if(Array[_0xa757('0xb')](_0x5d4ec7)){this[_0xa757('0xc')](_0xa757('0xa'),JSON[_0xa757('0xd')](_0x5d4ec7));}else{this[_0xa757('0xc')]('values',_0x5d4ec7);}}},'required':{'type':Sequelize[_0xa757('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa757('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa757('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index bb38061..29c3fc9 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 _0x315f=['destroy','error','name','send','index','CmCustomField','rawAttributes','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','body','params','create','transaction','Sequelize','TEXT','text','INTEGER','switch','defaultValue','sequelize','addColumn','cm_contacts','cf_%d','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then'];(function(_0x400795,_0x37bd98){var _0x5020cc=function(_0x57d083){while(--_0x57d083){_0x400795['push'](_0x400795['shift']());}};_0x5020cc(++_0x37bd98);}(_0x315f,0x18e));var _0xf315=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x315f[_0x21f931];return _0x3f083c;};'use strict';var emlformat=require(_0xf315('0x0'));var rimraf=require(_0xf315('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf315('0x2'));var moment=require(_0xf315('0x3'));var BPromise=require(_0xf315('0x4'));var Mustache=require(_0xf315('0x5'));var util=require(_0xf315('0x6'));var path=require('path');var sox=require(_0xf315('0x7'));var csv=require(_0xf315('0x8'));var ejs=require(_0xf315('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf315('0xa'));var squel=require('squel');var crypto=require(_0xf315('0xb'));var jsforce=require(_0xf315('0xc'));var deskjs=require(_0xf315('0xd'));var toCsv=require(_0xf315('0x8'));var querystring=require(_0xf315('0xe'));var Papa=require(_0xf315('0xf'));var Redis=require('ioredis');var authService=require(_0xf315('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf315('0x11'));var hardwareService=require(_0xf315('0x12'));var logger=require(_0xf315('0x13'))(_0xf315('0x14'));var utils=require(_0xf315('0x15'));var config=require(_0xf315('0x16'));var licenseUtil=require(_0xf315('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f9e2,_0x11e0c0){_0x11e0c0=_0x11e0c0||0xcc;return function(_0xf092a){if(_0xf092a){return _0x27f9e2[_0xf315('0x18')](_0x11e0c0);}return _0x27f9e2[_0xf315('0x19')](_0x11e0c0)[_0xf315('0x1a')]();};}function respondWithResult(_0x4f9320,_0x216666){_0x216666=_0x216666||0xc8;return function(_0x44c7df){if(_0x44c7df){return _0x4f9320['status'](_0x216666)[_0xf315('0x1b')](_0x44c7df);}};}function respondWithFilteredResult(_0x270707,_0x21261f){return function(_0xc5bb06){if(_0xc5bb06){var _0x29c056=typeof _0x21261f[_0xf315('0x1c')]===_0xf315('0x1d')&&typeof _0x21261f[_0xf315('0x1e')]==='undefined';var _0x513a32=_0xc5bb06[_0xf315('0x1f')];var _0x1e0987=_0x29c056?0x0:_0x21261f[_0xf315('0x1c')];var _0x275d78=_0x29c056?_0xc5bb06['count']:_0x21261f['offset']+_0x21261f[_0xf315('0x1e')];var _0x33057a;if(_0x275d78>=_0x513a32){_0x275d78=_0x513a32;_0x33057a=0xc8;}else{_0x33057a=0xce;}_0x270707['status'](_0x33057a);return _0x270707[_0xf315('0x20')](_0xf315('0x21'),_0x1e0987+'-'+_0x275d78+'/'+_0x513a32)[_0xf315('0x1b')](_0xc5bb06);}return null;};}function patchUpdates(_0x19a0cf){return function(_0x43f967){try{jsonpatch[_0xf315('0x22')](_0x43f967,_0x19a0cf,!![]);}catch(_0x59d2de){return BPromise['reject'](_0x59d2de);}return _0x43f967[_0xf315('0x23')]();};}function saveUpdates(_0x10db0c,_0x3ff83d){return function(_0x18beb5){if(_0x18beb5){return _0x18beb5['update'](_0x10db0c)[_0xf315('0x24')](function(_0x2ccc59){return _0x2ccc59;});}return null;};}function removeEntity(_0x37a34a,_0x3d4077){return function(_0x978acd){if(_0x978acd){return _0x978acd[_0xf315('0x25')]()[_0xf315('0x24')](function(){_0x37a34a['status'](0xcc)[_0xf315('0x1a')]();});}};}function handleEntityNotFound(_0x4b4781,_0x29fc80){return function(_0x22d55e){if(!_0x22d55e){_0x4b4781[_0xf315('0x18')](0x194);}return _0x22d55e;};}function handleError(_0x48e27c,_0x10c97c){_0x10c97c=_0x10c97c||0x1f4;return function(_0x120147){logger[_0xf315('0x26')](_0x120147['stack']);if(_0x120147[_0xf315('0x27')]){delete _0x120147[_0xf315('0x27')];}_0x48e27c[_0xf315('0x19')](_0x10c97c)[_0xf315('0x28')](_0x120147);};}exports[_0xf315('0x29')]=function(_0x23fdf4,_0xbe44a0){var _0x5818bd={},_0x2f024a={},_0x11cbbe={'count':0x0,'rows':[]};var _0xc9024d=_['map'](db[_0xf315('0x2a')][_0xf315('0x2b')],function(_0x3d6c70){return{'name':_0x3d6c70['fieldName'],'type':_0x3d6c70[_0xf315('0x2c')][_0xf315('0x2d')]};});_0x2f024a[_0xf315('0x2e')]=_[_0xf315('0x2f')](_[_0xf315('0x30')](_0xc9024d,_0xf315('0x27')),[_0xf315('0x27')]);_0x2f024a['query']=_[_0xf315('0x31')](_0x23fdf4[_0xf315('0x32')]);_0x2f024a[_0xf315('0x33')]=_[_0xf315('0x34')](_0x2f024a[_0xf315('0x2e')],_0x2f024a['query']);_0x5818bd[_0xf315('0x35')]=_[_0xf315('0x34')](_0x2f024a[_0xf315('0x2e')],qs[_0xf315('0x36')](_0x23fdf4[_0xf315('0x32')][_0xf315('0x36')]));_0x5818bd[_0xf315('0x35')]=_0x5818bd['attributes'][_0xf315('0x37')]?_0x5818bd[_0xf315('0x35')]:_0x2f024a[_0xf315('0x2e')];if(!_0x23fdf4['query'][_0xf315('0x38')](_0xf315('0x39'))){_0x5818bd['limit']=qs[_0xf315('0x1e')](_0x23fdf4[_0xf315('0x32')][_0xf315('0x1e')]);_0x5818bd[_0xf315('0x1c')]=qs['offset'](_0x23fdf4[_0xf315('0x32')]['offset']);}_0x5818bd[_0xf315('0x3a')]=qs[_0xf315('0x3b')](_0x23fdf4[_0xf315('0x32')][_0xf315('0x3b')]);_0x5818bd[_0xf315('0x3c')]=qs[_0xf315('0x33')](_[_0xf315('0x3d')](_0x23fdf4[_0xf315('0x32')],_0x2f024a[_0xf315('0x33')]),_0xc9024d);if(_0x23fdf4[_0xf315('0x32')]['filter']){_0x5818bd['where']=_[_0xf315('0x3e')](_0x5818bd[_0xf315('0x3c')],{'$or':_[_0xf315('0x30')](_0xc9024d,function(_0x51f274){if(_0x51f274['type']!==_0xf315('0x3f')){var _0x27a493={};_0x27a493[_0x51f274[_0xf315('0x27')]]={'$like':'%'+_0x23fdf4[_0xf315('0x32')][_0xf315('0x40')]+'%'};return _0x27a493;}})});}_0x5818bd=_[_0xf315('0x3e')]({},_0x5818bd,_0x23fdf4['options']);var _0xfd1d3f={'where':_0x5818bd[_0xf315('0x3c')]};return db[_0xf315('0x2a')][_0xf315('0x1f')](_0xfd1d3f)[_0xf315('0x24')](function(_0x1ad38d){_0x11cbbe[_0xf315('0x1f')]=_0x1ad38d;if(_0x23fdf4[_0xf315('0x32')][_0xf315('0x41')]){_0x5818bd[_0xf315('0x42')]=[{'all':!![]}];}return db['CmCustomField'][_0xf315('0x43')](_0x5818bd);})[_0xf315('0x24')](function(_0xa2a242){_0x11cbbe[_0xf315('0x44')]=_0xa2a242;return _0x11cbbe;})[_0xf315('0x24')](respondWithFilteredResult(_0xbe44a0,_0x5818bd))[_0xf315('0x45')](handleError(_0xbe44a0,null));};exports[_0xf315('0x46')]=function(_0x4d60d4,_0xa51afe){var _0x35025a={'raw':!![],'where':{'id':_0x4d60d4['params']['id']}},_0x52e2bd={};_0x52e2bd[_0xf315('0x2e')]=_[_0xf315('0x31')](db['CmCustomField'][_0xf315('0x2b')]);_0x52e2bd[_0xf315('0x32')]=_[_0xf315('0x31')](_0x4d60d4[_0xf315('0x32')]);_0x52e2bd['filters']=_[_0xf315('0x34')](_0x52e2bd[_0xf315('0x2e')],_0x52e2bd[_0xf315('0x32')]);_0x35025a[_0xf315('0x35')]=_[_0xf315('0x34')](_0x52e2bd[_0xf315('0x2e')],qs['fields'](_0x4d60d4['query']['fields']));_0x35025a[_0xf315('0x35')]=_0x35025a[_0xf315('0x35')][_0xf315('0x37')]?_0x35025a[_0xf315('0x35')]:_0x52e2bd[_0xf315('0x2e')];if(_0x4d60d4[_0xf315('0x32')]['includeAll']){_0x35025a[_0xf315('0x42')]=[{'all':!![]}];}_0x35025a=_['merge']({},_0x35025a,_0x4d60d4[_0xf315('0x47')]);return db['CmCustomField'][_0xf315('0x48')](_0x35025a)[_0xf315('0x24')](handleEntityNotFound(_0xa51afe,null))[_0xf315('0x24')](respondWithResult(_0xa51afe,null))[_0xf315('0x45')](handleError(_0xa51afe,null));};exports['update']=function(_0x3083ff,_0x4d3741){if(_0x3083ff['body']['id']){delete _0x3083ff[_0xf315('0x49')]['id'];}return db[_0xf315('0x2a')]['find']({'where':{'id':_0x3083ff[_0xf315('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d3741,null))['then'](saveUpdates(_0x3083ff[_0xf315('0x49')],null))[_0xf315('0x24')](respondWithResult(_0x4d3741,null))[_0xf315('0x45')](handleError(_0x4d3741,null));};exports['destroy']=function(_0x1eabb0,_0x1088ea){return db[_0xf315('0x2a')]['find']({'where':{'id':_0x1eabb0['params']['id']}})[_0xf315('0x24')](handleEntityNotFound(_0x1088ea,null))[_0xf315('0x24')](removeEntity(_0x1088ea,null))[_0xf315('0x45')](handleError(_0x1088ea,null));};exports[_0xf315('0x4b')]=function(_0xc9773a,_0xd66507){var _0x506d46;return db['sequelize'][_0xf315('0x4c')](function(_0x3ea531){return db[_0xf315('0x2a')][_0xf315('0x4b')](_0xc9773a[_0xf315('0x49')],{'transaction':_0x3ea531})['then'](function(_0x47267a){_0x506d46=_0x47267a;var _0x4469cf={'type':db[_0xf315('0x4d')][_0xf315('0x4e')],'transaction':_0x3ea531};switch(_0xc9773a[_0xf315('0x49')]['type']){case _0xf315('0x4f'):_0x4469cf[_0xf315('0x2c')]=db[_0xf315('0x4d')]['TEXT'];break;case'number':_0x4469cf['type']=db[_0xf315('0x4d')][_0xf315('0x50')];break;case _0xf315('0x51'):_0x4469cf[_0xf315('0x2c')]=db['Sequelize']['BOOLEAN'];_0x4469cf[_0xf315('0x52')]=![];break;default:}return db[_0xf315('0x53')]['queryInterface'][_0xf315('0x54')](_0xf315('0x55'),util['format'](_0xf315('0x56'),_0x506d46['id']),_0x4469cf);})[_0xf315('0x24')](function(){return _0x506d46;});})[_0xf315('0x24')](respondWithResult(_0xd66507,0xc9))['catch'](handleError(_0xd66507,null));}; \ No newline at end of file +var _0xe797=['destroy','create','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','sequelize','addColumn','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','then','error','stack','name','send','CmCustomField','fieldName','type','key','model','differenceBy','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xe797,0x1e0));var _0x7e79=function(_0x53e72a,_0x1f06a1){_0x53e72a=_0x53e72a-0x0;var _0x56dda8=_0xe797[_0x53e72a];return _0x56dda8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e79('0x0'));var zipdir=require(_0x7e79('0x1'));var jsonpatch=require(_0x7e79('0x2'));var rp=require(_0x7e79('0x3'));var moment=require(_0x7e79('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e79('0x5'));var util=require(_0x7e79('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7e79('0x7'));var ejs=require(_0x7e79('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e79('0x9'));var crypto=require(_0x7e79('0xa'));var jsforce=require(_0x7e79('0xb'));var deskjs=require(_0x7e79('0xc'));var toCsv=require(_0x7e79('0x7'));var querystring=require('querystring');var Papa=require(_0x7e79('0xd'));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(_0x7e79('0xe'));var logger=require(_0x7e79('0xf'))(_0x7e79('0x10'));var utils=require(_0x7e79('0x11'));var config=require(_0x7e79('0x12'));var licenseUtil=require(_0x7e79('0x13'));var db=require(_0x7e79('0x14'))['db'];function respondWithStatusCode(_0x3a5c9d,_0x44a641){_0x44a641=_0x44a641||0xcc;return function(_0x4a2ee6){if(_0x4a2ee6){return _0x3a5c9d[_0x7e79('0x15')](_0x44a641);}return _0x3a5c9d[_0x7e79('0x16')](_0x44a641)[_0x7e79('0x17')]();};}function respondWithResult(_0x2ad3db,_0x19b22f){_0x19b22f=_0x19b22f||0xc8;return function(_0x315b8e){if(_0x315b8e){return _0x2ad3db[_0x7e79('0x16')](_0x19b22f)[_0x7e79('0x18')](_0x315b8e);}};}function respondWithFilteredResult(_0x45290a,_0x77df5e){return function(_0x517d41){if(_0x517d41){var _0x233e71=typeof _0x77df5e[_0x7e79('0x19')]===_0x7e79('0x1a')&&typeof _0x77df5e[_0x7e79('0x1b')]===_0x7e79('0x1a');var _0xf45424=_0x517d41['count'];var _0x1c068d=_0x233e71?0x0:_0x77df5e[_0x7e79('0x19')];var _0x3dda68=_0x233e71?_0x517d41[_0x7e79('0x1c')]:_0x77df5e[_0x7e79('0x19')]+_0x77df5e[_0x7e79('0x1b')];var _0x3f359d;if(_0x3dda68>=_0xf45424){_0x3dda68=_0xf45424;_0x3f359d=0xc8;}else{_0x3f359d=0xce;}_0x45290a[_0x7e79('0x16')](_0x3f359d);return _0x45290a[_0x7e79('0x1d')]('Content-Range',_0x1c068d+'-'+_0x3dda68+'/'+_0xf45424)[_0x7e79('0x18')](_0x517d41);}return null;};}function patchUpdates(_0x4a77d0){return function(_0x22061f){try{jsonpatch['apply'](_0x22061f,_0x4a77d0,!![]);}catch(_0x3e6b40){return BPromise['reject'](_0x3e6b40);}return _0x22061f['save']();};}function saveUpdates(_0x31e86b,_0x339652){return function(_0x152207){if(_0x152207){return _0x152207['update'](_0x31e86b)[_0x7e79('0x1e')](function(_0x10c013){return _0x10c013;});}return null;};}function removeEntity(_0x599616,_0x559426){return function(_0x489471){if(_0x489471){return _0x489471['destroy']()['then'](function(){_0x599616[_0x7e79('0x16')](0xcc)[_0x7e79('0x17')]();});}};}function handleEntityNotFound(_0x3f0ec9,_0x4124bd){return function(_0x3c8c28){if(!_0x3c8c28){_0x3f0ec9['sendStatus'](0x194);}return _0x3c8c28;};}function handleError(_0x266c39,_0x34270a){_0x34270a=_0x34270a||0x1f4;return function(_0x2c5767){logger[_0x7e79('0x1f')](_0x2c5767[_0x7e79('0x20')]);if(_0x2c5767[_0x7e79('0x21')]){delete _0x2c5767[_0x7e79('0x21')];}_0x266c39[_0x7e79('0x16')](_0x34270a)[_0x7e79('0x22')](_0x2c5767);};}exports['index']=function(_0x1f1cf8,_0x1f068b){var _0xaf10f4={},_0x39d518={},_0x24158d={'count':0x0,'rows':[]};var _0x5ae9d0=_['map'](db[_0x7e79('0x23')]['rawAttributes'],function(_0x701e7a){return{'name':_0x701e7a[_0x7e79('0x24')],'type':_0x701e7a[_0x7e79('0x25')][_0x7e79('0x26')]};});_0x39d518[_0x7e79('0x27')]=_[_0x7e79('0x28')](_[_0x7e79('0x29')](_0x5ae9d0,_0x7e79('0x21')),[_0x7e79('0x21')]);_0x39d518[_0x7e79('0x2a')]=_[_0x7e79('0x2b')](_0x1f1cf8['query']);_0x39d518[_0x7e79('0x2c')]=_['intersection'](_0x39d518[_0x7e79('0x27')],_0x39d518[_0x7e79('0x2a')]);_0xaf10f4[_0x7e79('0x2d')]=_[_0x7e79('0x2e')](_0x39d518[_0x7e79('0x27')],qs[_0x7e79('0x2f')](_0x1f1cf8['query'][_0x7e79('0x2f')]));_0xaf10f4[_0x7e79('0x2d')]=_0xaf10f4[_0x7e79('0x2d')]['length']?_0xaf10f4[_0x7e79('0x2d')]:_0x39d518['model'];if(!_0x1f1cf8[_0x7e79('0x2a')][_0x7e79('0x30')](_0x7e79('0x31'))){_0xaf10f4[_0x7e79('0x1b')]=qs[_0x7e79('0x1b')](_0x1f1cf8[_0x7e79('0x2a')][_0x7e79('0x1b')]);_0xaf10f4[_0x7e79('0x19')]=qs[_0x7e79('0x19')](_0x1f1cf8[_0x7e79('0x2a')]['offset']);}_0xaf10f4['order']=qs['sort'](_0x1f1cf8[_0x7e79('0x2a')]['sort']);_0xaf10f4[_0x7e79('0x32')]=qs[_0x7e79('0x2c')](_['pick'](_0x1f1cf8[_0x7e79('0x2a')],_0x39d518[_0x7e79('0x2c')]),_0x5ae9d0);if(_0x1f1cf8['query'][_0x7e79('0x33')]){_0xaf10f4[_0x7e79('0x32')]=_[_0x7e79('0x34')](_0xaf10f4[_0x7e79('0x32')],{'$or':_[_0x7e79('0x29')](_0x5ae9d0,function(_0x42eba){if(_0x42eba['type']!==_0x7e79('0x35')){var _0x5889d9={};_0x5889d9[_0x42eba[_0x7e79('0x21')]]={'$like':'%'+_0x1f1cf8[_0x7e79('0x2a')][_0x7e79('0x33')]+'%'};return _0x5889d9;}})});}_0xaf10f4=_[_0x7e79('0x34')]({},_0xaf10f4,_0x1f1cf8[_0x7e79('0x36')]);var _0x3cdd0e={'where':_0xaf10f4[_0x7e79('0x32')]};return db[_0x7e79('0x23')][_0x7e79('0x1c')](_0x3cdd0e)['then'](function(_0x30cfcf){_0x24158d['count']=_0x30cfcf;if(_0x1f1cf8[_0x7e79('0x2a')][_0x7e79('0x37')]){_0xaf10f4[_0x7e79('0x38')]=[{'all':!![]}];}return db[_0x7e79('0x23')][_0x7e79('0x39')](_0xaf10f4);})[_0x7e79('0x1e')](function(_0x582ae0){_0x24158d[_0x7e79('0x3a')]=_0x582ae0;return _0x24158d;})[_0x7e79('0x1e')](respondWithFilteredResult(_0x1f068b,_0xaf10f4))[_0x7e79('0x3b')](handleError(_0x1f068b,null));};exports[_0x7e79('0x3c')]=function(_0x559688,_0x443b4e){var _0x50edc7={'raw':!![],'where':{'id':_0x559688[_0x7e79('0x3d')]['id']}},_0x202fc7={};_0x202fc7['model']=_['keys'](db[_0x7e79('0x23')][_0x7e79('0x3e')]);_0x202fc7[_0x7e79('0x2a')]=_[_0x7e79('0x2b')](_0x559688[_0x7e79('0x2a')]);_0x202fc7['filters']=_[_0x7e79('0x2e')](_0x202fc7['model'],_0x202fc7['query']);_0x50edc7[_0x7e79('0x2d')]=_[_0x7e79('0x2e')](_0x202fc7[_0x7e79('0x27')],qs[_0x7e79('0x2f')](_0x559688[_0x7e79('0x2a')]['fields']));_0x50edc7['attributes']=_0x50edc7[_0x7e79('0x2d')][_0x7e79('0x3f')]?_0x50edc7['attributes']:_0x202fc7[_0x7e79('0x27')];if(_0x559688[_0x7e79('0x2a')][_0x7e79('0x37')]){_0x50edc7[_0x7e79('0x38')]=[{'all':!![]}];}_0x50edc7=_['merge']({},_0x50edc7,_0x559688[_0x7e79('0x36')]);return db[_0x7e79('0x23')][_0x7e79('0x40')](_0x50edc7)[_0x7e79('0x1e')](handleEntityNotFound(_0x443b4e,null))[_0x7e79('0x1e')](respondWithResult(_0x443b4e,null))['catch'](handleError(_0x443b4e,null));};exports['update']=function(_0x1ea5e9,_0x2c6294){if(_0x1ea5e9[_0x7e79('0x41')]['id']){delete _0x1ea5e9['body']['id'];}return db[_0x7e79('0x23')][_0x7e79('0x40')]({'where':{'id':_0x1ea5e9[_0x7e79('0x3d')]['id']}})[_0x7e79('0x1e')](handleEntityNotFound(_0x2c6294,null))[_0x7e79('0x1e')](saveUpdates(_0x1ea5e9['body'],null))[_0x7e79('0x1e')](respondWithResult(_0x2c6294,null))['catch'](handleError(_0x2c6294,null));};exports[_0x7e79('0x42')]=function(_0x5cc63e,_0x674799){return db['CmCustomField'][_0x7e79('0x40')]({'where':{'id':_0x5cc63e['params']['id']}})[_0x7e79('0x1e')](handleEntityNotFound(_0x674799,null))['then'](removeEntity(_0x674799,null))[_0x7e79('0x3b')](handleError(_0x674799,null));};exports[_0x7e79('0x43')]=function(_0x3a0e2a,_0x560866){var _0x41f16c;return db['sequelize']['transaction'](function(_0x464bd7){return db[_0x7e79('0x23')]['create'](_0x3a0e2a[_0x7e79('0x41')],{'transaction':_0x464bd7})[_0x7e79('0x1e')](function(_0x3453da){_0x41f16c=_0x3453da;var _0x5dd931={'type':db[_0x7e79('0x44')][_0x7e79('0x45')],'transaction':_0x464bd7};switch(_0x3a0e2a['body']['type']){case _0x7e79('0x46'):_0x5dd931['type']=db[_0x7e79('0x44')][_0x7e79('0x45')];break;case'number':_0x5dd931[_0x7e79('0x25')]=db['Sequelize'][_0x7e79('0x47')];break;case _0x7e79('0x48'):_0x5dd931[_0x7e79('0x25')]=db[_0x7e79('0x44')][_0x7e79('0x49')];_0x5dd931['defaultValue']=![];break;default:}return db[_0x7e79('0x4a')]['queryInterface'][_0x7e79('0x4b')]('cm_contacts',util[_0x7e79('0x4c')](_0x7e79('0x4d'),_0x41f16c['id']),_0x5dd931);})[_0x7e79('0x1e')](function(){return _0x41f16c;});})['then'](respondWithResult(_0x560866,0xc9))[_0x7e79('0x3b')](handleError(_0x560866,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 5b49746..b6cac28 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 _0x3bac=['define','cm_custom_fields','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes'];(function(_0x4ca01b,_0x5e5e3a){var _0x1989f2=function(_0xe2e9e8){while(--_0xe2e9e8){_0x4ca01b['push'](_0x4ca01b['shift']());}};_0x1989f2(++_0x5e5e3a);}(_0x3bac,0x1df));var _0xc3ba=function(_0x138975,_0x319d77){_0x138975=_0x138975-0x0;var _0x2ff39a=_0x3bac[_0x138975];return _0x2ff39a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3ba('0x0'))(_0xc3ba('0x1'));var moment=require('moment');var BPromise=require(_0xc3ba('0x2'));var rp=require(_0xc3ba('0x3'));var fs=require('fs');var path=require(_0xc3ba('0x4'));var rimraf=require('rimraf');var config=require(_0xc3ba('0x5'));var attributes=require(_0xc3ba('0x6'));module['exports']=function(_0x3749e7,_0x31843e){return _0x3749e7[_0xc3ba('0x7')]('CmCustomField',attributes,{'tableName':_0xc3ba('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8186=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x8186,0x1e0));var _0x6818=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x8186[_0x199bc4];return _0x136ffb;};'use strict';var _=require('lodash');var util=require(_0x6818('0x0'));var logger=require(_0x6818('0x1'))(_0x6818('0x2'));var moment=require(_0x6818('0x3'));var BPromise=require(_0x6818('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6818('0x5'));var rimraf=require('rimraf');var config=require(_0x6818('0x6'));var attributes=require(_0x6818('0x7'));module[_0x6818('0x8')]=function(_0x475e61,_0x3ee687){return _0x475e61[_0x6818('0x9')](_0x6818('0xa'),attributes,{'tableName':_0x6818('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 85c5085..3e6d9ef 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 _0xc909=['message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x2c5802,_0x33de02){var _0x36b625=function(_0x2ee193){while(--_0x2ee193){_0x2c5802['push'](_0x2c5802['shift']());}};_0x36b625(++_0x33de02);}(_0xc909,0xb7));var _0x9c90=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xc909[_0x30faec];return _0x29484f;};'use strict';var _=require('lodash');var util=require(_0x9c90('0x0'));var moment=require('moment');var BPromise=require(_0x9c90('0x1'));var rs=require(_0x9c90('0x2'));var fs=require('fs');var Redis=require(_0x9c90('0x3'));var db=require(_0x9c90('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c90('0x5'))(_0x9c90('0x6'));var config=require(_0x9c90('0x7'));var jayson=require(_0x9c90('0x8'));var client=jayson['client'][_0x9c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x393ddb,_0x407a78,_0x41c220){return new BPromise(function(_0x2e0b6b,_0x59a335){return client[_0x9c90('0xa')](_0x393ddb,_0x41c220)['then'](function(_0x1a343c){logger[_0x9c90('0xb')](_0x9c90('0xc'),_0x407a78,_0x9c90('0xd'));logger[_0x9c90('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x407a78,_0x9c90('0xd'),JSON['stringify'](_0x1a343c));if(_0x1a343c['error']){if(_0x1a343c[_0x9c90('0xf')][_0x9c90('0x10')]===0x1f4){logger[_0x9c90('0xf')](_0x9c90('0xc'),_0x407a78,_0x1a343c[_0x9c90('0xf')]['message']);return _0x59a335(_0x1a343c[_0x9c90('0xf')][_0x9c90('0x11')]);}logger[_0x9c90('0xf')](_0x9c90('0xc'),_0x407a78,_0x1a343c['error']['message']);return _0x2e0b6b(_0x1a343c[_0x9c90('0xf')]['message']);}else{logger[_0x9c90('0xb')](_0x9c90('0xc'),_0x407a78,_0x9c90('0xd'));_0x2e0b6b(_0x1a343c[_0x9c90('0x12')][_0x9c90('0x11')]);}})[_0x9c90('0x13')](function(_0xa155a0){logger[_0x9c90('0xf')](_0x9c90('0xc'),_0x407a78,_0xa155a0);_0x59a335(_0xa155a0);});});} \ No newline at end of file +var _0xdc96=['client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4b7b2c,_0xc7f703){var _0x4625e1=function(_0x4d506f){while(--_0x4d506f){_0x4b7b2c['push'](_0x4b7b2c['shift']());}};_0x4625e1(++_0xc7f703);}(_0xdc96,0xe8));var _0x6dc9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xdc96[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x6dc9('0x0'));var util=require('util');var moment=require(_0x6dc9('0x1'));var BPromise=require(_0x6dc9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dc9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dc9('0x4'))('rpc');var config=require(_0x6dc9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6dc9('0x6')][_0x6dc9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1693f8,_0x27c691,_0x417dad){return new BPromise(function(_0x24b95c,_0x13c826){return client[_0x6dc9('0x8')](_0x1693f8,_0x417dad)['then'](function(_0x4aeda7){logger[_0x6dc9('0x9')](_0x6dc9('0xa'),_0x27c691,_0x6dc9('0xb'));logger[_0x6dc9('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x27c691,_0x6dc9('0xb'),JSON['stringify'](_0x4aeda7));if(_0x4aeda7[_0x6dc9('0xd')]){if(_0x4aeda7['error'][_0x6dc9('0xe')]===0x1f4){logger[_0x6dc9('0xd')](_0x6dc9('0xa'),_0x27c691,_0x4aeda7['error'][_0x6dc9('0xf')]);return _0x13c826(_0x4aeda7[_0x6dc9('0xd')][_0x6dc9('0xf')]);}logger[_0x6dc9('0xd')](_0x6dc9('0xa'),_0x27c691,_0x4aeda7[_0x6dc9('0xd')][_0x6dc9('0xf')]);return _0x24b95c(_0x4aeda7[_0x6dc9('0xd')][_0x6dc9('0xf')]);}else{logger['info'](_0x6dc9('0xa'),_0x27c691,'request\x20sent');_0x24b95c(_0x4aeda7['result'][_0x6dc9('0xf')]);}})[_0x6dc9('0x10')](function(_0xcbc5f2){logger['error'](_0x6dc9('0xa'),_0x27c691,_0xcbc5f2);_0x13c826(_0xcbc5f2);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 5e42156..9cf6f4f 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 _0xe131=['/:id','show','post','create','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0xe131,0x1b5));var _0x1e13=function(_0x45c1dc,_0x254b6c){_0x45c1dc=_0x45c1dc-0x0;var _0x103e1e=_0xe131[_0x45c1dc];return _0x103e1e;};'use strict';var multer=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e13('0x2'));var router=express['Router']();var fs_extra=require(_0x1e13('0x3'));var auth=require(_0x1e13('0x4'));var interaction=require(_0x1e13('0x5'));var config=require(_0x1e13('0x6'));var controller=require(_0x1e13('0x7'));router[_0x1e13('0x8')]('/',auth[_0x1e13('0x9')](),controller[_0x1e13('0xa')]);router[_0x1e13('0x8')](_0x1e13('0xb'),auth[_0x1e13('0x9')](),controller[_0x1e13('0xc')]);router[_0x1e13('0xd')]('/',auth[_0x1e13('0x9')](),controller[_0x1e13('0xe')]);router['put'](_0x1e13('0xb'),auth[_0x1e13('0x9')](),controller['update']);router['delete'](_0x1e13('0xb'),auth[_0x1e13('0x9')](),controller[_0x1e13('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5a93=['/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4adfa4,_0x121c5a){var _0x14cec1=function(_0x4fd975){while(--_0x4fd975){_0x4adfa4['push'](_0x4adfa4['shift']());}};_0x14cec1(++_0x121c5a);}(_0x5a93,0xf6));var _0x35a9=function(_0x3cde94,_0x178d90){_0x3cde94=_0x3cde94-0x0;var _0xdfb7ac=_0x5a93[_0x3cde94];return _0xdfb7ac;};'use strict';var multer=require('multer');var util=require(_0x35a9('0x0'));var path=require('path');var timeout=require(_0x35a9('0x1'));var express=require(_0x35a9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a9('0x3'));var interaction=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var controller=require('./cmCustomField.controller');router[_0x35a9('0x6')]('/',auth[_0x35a9('0x7')](),controller[_0x35a9('0x8')]);router[_0x35a9('0x6')](_0x35a9('0x9'),auth[_0x35a9('0x7')](),controller[_0x35a9('0xa')]);router[_0x35a9('0xb')]('/',auth[_0x35a9('0x7')](),controller[_0x35a9('0xc')]);router[_0x35a9('0xd')](_0x35a9('0x9'),auth[_0x35a9('0x7')](),controller[_0x35a9('0xe')]);router[_0x35a9('0xf')](_0x35a9('0x9'),auth[_0x35a9('0x7')](),controller['destroy']);module[_0x35a9('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 1bb11ca..2333e18 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 _0xbd82=['BOOLEAN','DATE','INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x3cf288,_0x5b4797){var _0x176d79=function(_0x21fbf7){while(--_0x21fbf7){_0x3cf288['push'](_0x3cf288['shift']());}};_0x176d79(++_0x5b4797);}(_0xbd82,0xba));var _0x2bd8=function(_0x88560d,_0x551e04){_0x88560d=_0x88560d-0x0;var _0x36bb10=_0xbd82[_0x88560d];return _0x36bb10;};'use strict';var moment=require(_0x2bd8('0x0'));var Sequelize=require(_0x2bd8('0x1'));module['exports']={'phone':{'type':Sequelize[_0x2bd8('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x2bd8('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2bd8('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x2bd8('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2bd8('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2bd8('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2bd8('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2bd8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x2bd8('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2bd8('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2bd8('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x2bd8('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x2bd8('0x5')],'unique':_0x2bd8('0x6')},'CampaignId':{'type':Sequelize[_0x2bd8('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2bd8('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2bd8('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2bd8('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc1b3=['contactListQueue','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x292da7,_0x5619af){var _0x4592e3=function(_0x115460){while(--_0x115460){_0x292da7['push'](_0x292da7['shift']());}};_0x4592e3(++_0x5619af);}(_0xc1b3,0x172));var _0x3c1b=function(_0x20b013,_0x45db0d){_0x20b013=_0x20b013-0x0;var _0x56a850=_0xc1b3[_0x20b013];return _0x56a850;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x3c1b('0x0')]={'phone':{'type':Sequelize[_0x3c1b('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x3c1b('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3c1b('0x3')],'defaultValue':moment()[_0x3c1b('0x4')](_0x3c1b('0x5'))},'countbusyretry':{'type':Sequelize[_0x3c1b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3c1b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3c1b('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c1b('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3c1b('0x3')]},'priority':{'type':Sequelize[_0x3c1b('0x6')](0x2)[_0x3c1b('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3c1b('0x6')],'unique':_0x3c1b('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3c1b('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x3c1b('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c1b('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 243f448..904ca51 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 _0xdba8=['$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','campaigntype','CmContact','lastName','calleridname','firstName','isNil','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','literal','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','CmCompany','Company','CmList','List','dialActive','getOpenContacts','YYYY-MM-DD\x20HH:mm:ss','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq'];(function(_0x1c8116,_0x56c706){var _0x4ab30a=function(_0x55e80b){while(--_0x55e80b){_0x1c8116['push'](_0x1c8116['shift']());}};_0x4ab30a(++_0x56c706);}(_0xdba8,0x179));var _0x8dba=function(_0x2f3a4b,_0x3b4a9a){_0x2f3a4b=_0x2f3a4b-0x0;var _0x28a3e3=_0xdba8[_0x2f3a4b];return _0x28a3e3;};'use strict';var emlformat=require(_0x8dba('0x0'));var rimraf=require(_0x8dba('0x1'));var zipdir=require(_0x8dba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8dba('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8dba('0x4'));var util=require(_0x8dba('0x5'));var path=require('path');var sox=require(_0x8dba('0x6'));var csv=require(_0x8dba('0x7'));var ejs=require(_0x8dba('0x8'));var fs=require('fs');var fs_extra=require(_0x8dba('0x9'));var _=require(_0x8dba('0xa'));var squel=require(_0x8dba('0xb'));var crypto=require(_0x8dba('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8dba('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8dba('0xe'));var Papa=require(_0x8dba('0xf'));var Redis=require('ioredis');var authService=require(_0x8dba('0x10'));var qs=require(_0x8dba('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dba('0x12'));var logger=require('../../config/logger')(_0x8dba('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8dba('0x14'));var db=require(_0x8dba('0x15'))['db'];function respondWithStatusCode(_0x49a991,_0x27606a){_0x27606a=_0x27606a||0xcc;return function(_0x49e947){if(_0x49e947){return _0x49a991[_0x8dba('0x16')](_0x27606a);}return _0x49a991[_0x8dba('0x17')](_0x27606a)[_0x8dba('0x18')]();};}function respondWithResult(_0x5d630d,_0x1dbfd3){_0x1dbfd3=_0x1dbfd3||0xc8;return function(_0x447beb){if(_0x447beb){return _0x5d630d['status'](_0x1dbfd3)[_0x8dba('0x19')](_0x447beb);}};}function respondWithFilteredResult(_0x4625f2,_0x121f07){return function(_0x4ad556){if(_0x4ad556){var _0x3ceaff=typeof _0x121f07[_0x8dba('0x1a')]===_0x8dba('0x1b')&&typeof _0x121f07[_0x8dba('0x1c')]===_0x8dba('0x1b');var _0xeecd9b=_0x4ad556[_0x8dba('0x1d')];var _0x58f09f=_0x3ceaff?0x0:_0x121f07[_0x8dba('0x1a')];var _0x31fb81=_0x3ceaff?_0x4ad556['count']:_0x121f07[_0x8dba('0x1a')]+_0x121f07[_0x8dba('0x1c')];var _0x2a38aa;if(_0x31fb81>=_0xeecd9b){_0x31fb81=_0xeecd9b;_0x2a38aa=0xc8;}else{_0x2a38aa=0xce;}_0x4625f2[_0x8dba('0x17')](_0x2a38aa);return _0x4625f2[_0x8dba('0x1e')](_0x8dba('0x1f'),_0x58f09f+'-'+_0x31fb81+'/'+_0xeecd9b)[_0x8dba('0x19')](_0x4ad556);}return null;};}function patchUpdates(_0x37f1f1){return function(_0x1c431f){try{jsonpatch['apply'](_0x1c431f,_0x37f1f1,!![]);}catch(_0xc098db){return BPromise['reject'](_0xc098db);}return _0x1c431f['save']();};}function saveUpdates(_0x4e864d,_0x5e27cc){return function(_0x13d737){if(_0x13d737){return _0x13d737[_0x8dba('0x20')](_0x4e864d)[_0x8dba('0x21')](function(_0xc33041){return _0xc33041;});}return null;};}function removeEntity(_0x139c1e,_0x1b6bd9){return function(_0x11a50e){if(_0x11a50e){return _0x11a50e[_0x8dba('0x22')]()['then'](function(){_0x139c1e[_0x8dba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bb3d2,_0x5ba65e){return function(_0x1156c6){if(!_0x1156c6){_0x3bb3d2[_0x8dba('0x16')](0x194);}return _0x1156c6;};}function handleError(_0x5630a1,_0x55438e){_0x55438e=_0x55438e||0x1f4;return function(_0x122410){logger[_0x8dba('0x23')](_0x122410[_0x8dba('0x24')]);if(_0x122410[_0x8dba('0x25')]){delete _0x122410[_0x8dba('0x25')];}_0x5630a1[_0x8dba('0x17')](_0x55438e)[_0x8dba('0x26')](_0x122410);};}exports[_0x8dba('0x27')]=function(_0x357290,_0x409210){var _0x4fb611={},_0x5e1a4f={},_0x561dfb={'count':0x0,'rows':[]};var _0x5ed773=_[_0x8dba('0x28')](db[_0x8dba('0x29')][_0x8dba('0x2a')],function(_0xecf97e){return{'name':_0xecf97e['fieldName'],'type':_0xecf97e[_0x8dba('0x2b')][_0x8dba('0x2c')]};});_0x5e1a4f[_0x8dba('0x2d')]=_[_0x8dba('0x28')](_0x5ed773,_0x8dba('0x25'));_0x5e1a4f[_0x8dba('0x2e')]=_[_0x8dba('0x2f')](_0x357290[_0x8dba('0x2e')]);_0x5e1a4f[_0x8dba('0x30')]=_[_0x8dba('0x31')](_0x5e1a4f[_0x8dba('0x2d')],_0x5e1a4f[_0x8dba('0x2e')]);_0x5e1a4f[_0x8dba('0x30')]=_[_0x8dba('0x32')](_0x5e1a4f[_0x8dba('0x30')],[_0x8dba('0x33'),_0x8dba('0x34'),_0x8dba('0x35'),_0x8dba('0x36'),'$lt',_0x8dba('0x37'),_0x8dba('0x38'),_0x8dba('0x39'),'$not',_0x8dba('0x3a'),_0x8dba('0x3b'),'$in',_0x8dba('0x3c'),_0x8dba('0x3d'),_0x8dba('0x3e'),_0x8dba('0x3f'),_0x8dba('0x40'),_0x8dba('0x3d'),_0x8dba('0x41'),'$contains','$contained','$any']);_0x4fb611[_0x8dba('0x42')]=_[_0x8dba('0x31')](_0x5e1a4f[_0x8dba('0x2d')],qs[_0x8dba('0x43')](_0x357290['query'][_0x8dba('0x43')]));_0x4fb611[_0x8dba('0x42')]=_0x4fb611['attributes'][_0x8dba('0x44')]?_0x4fb611[_0x8dba('0x42')]:_0x5e1a4f['model'];if(!_0x357290['query'][_0x8dba('0x45')](_0x8dba('0x46'))){_0x4fb611[_0x8dba('0x1c')]=qs['limit'](_0x357290['query'][_0x8dba('0x1c')]);_0x4fb611[_0x8dba('0x1a')]=qs[_0x8dba('0x1a')](_0x357290[_0x8dba('0x2e')]['offset']);}_0x4fb611['order']=qs['sort'](_0x357290['query'][_0x8dba('0x47')]);_0x4fb611['where']=qs['filters'](_[_0x8dba('0x48')](_0x357290[_0x8dba('0x2e')],_0x5e1a4f[_0x8dba('0x30')]),_0x5ed773);if(_0x357290['query'][_0x8dba('0x49')]){_0x4fb611['where']=_[_0x8dba('0x4a')](_0x4fb611[_0x8dba('0x4b')],{'$or':_[_0x8dba('0x28')](_0x5ed773,function(_0x541a34){if(_0x541a34[_0x8dba('0x2b')]!=='VIRTUAL'){var _0x23e72d={};_0x23e72d[_0x541a34[_0x8dba('0x25')]]={'$like':'%'+_0x357290[_0x8dba('0x2e')][_0x8dba('0x49')]+'%'};return _0x23e72d;}})});}_0x4fb611=_[_0x8dba('0x4a')]({},_0x4fb611,_0x357290['options']);var _0x19a481={'where':_0x4fb611[_0x8dba('0x4b')]};return db[_0x8dba('0x29')][_0x8dba('0x1d')](_0x19a481)[_0x8dba('0x21')](function(_0x212e11){_0x561dfb['count']=_0x212e11;if(_0x357290[_0x8dba('0x2e')][_0x8dba('0x4c')]){_0x4fb611[_0x8dba('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x8dba('0x4e')](_0x4fb611);})[_0x8dba('0x21')](function(_0x81868b){_0x561dfb[_0x8dba('0x4f')]=_0x81868b;return _0x561dfb;})[_0x8dba('0x21')](respondWithFilteredResult(_0x409210,_0x4fb611))[_0x8dba('0x50')](handleError(_0x409210,null));};exports[_0x8dba('0x51')]=function(_0x5a3a3b,_0x2248c8){var _0x5c2ff8={'raw':!![],'where':{'id':_0x5a3a3b[_0x8dba('0x52')]['id']}},_0x969838={};_0x969838['model']=_['keys'](db[_0x8dba('0x29')][_0x8dba('0x2a')]);_0x969838['query']=_['keys'](_0x5a3a3b[_0x8dba('0x2e')]);_0x969838[_0x8dba('0x30')]=_['intersection'](_0x969838[_0x8dba('0x2d')],_0x969838[_0x8dba('0x2e')]);_0x5c2ff8[_0x8dba('0x42')]=_['intersection'](_0x969838[_0x8dba('0x2d')],qs[_0x8dba('0x43')](_0x5a3a3b['query'][_0x8dba('0x43')]));_0x5c2ff8[_0x8dba('0x42')]=_0x5c2ff8[_0x8dba('0x42')]['length']?_0x5c2ff8[_0x8dba('0x42')]:_0x969838[_0x8dba('0x2d')];if(_0x5a3a3b['query']['includeAll']){_0x5c2ff8[_0x8dba('0x4d')]=[{'all':!![]}];}_0x5c2ff8=_[_0x8dba('0x4a')]({},_0x5c2ff8,_0x5a3a3b[_0x8dba('0x53')]);return db[_0x8dba('0x29')][_0x8dba('0x54')](_0x5c2ff8)[_0x8dba('0x21')](handleEntityNotFound(_0x2248c8,null))[_0x8dba('0x21')](respondWithResult(_0x2248c8,null))['catch'](handleError(_0x2248c8,null));};exports[_0x8dba('0x55')]=function(_0x33777b,_0x38d8f0){return db['CmHopper']['create'](_0x33777b[_0x8dba('0x56')],{})[_0x8dba('0x21')](respondWithResult(_0x38d8f0,0xc9))[_0x8dba('0x50')](handleError(_0x38d8f0,null));};exports[_0x8dba('0x20')]=function(_0x2cd506,_0x44dac8){if(_0x2cd506[_0x8dba('0x56')]['id']){delete _0x2cd506[_0x8dba('0x56')]['id'];}return db[_0x8dba('0x29')][_0x8dba('0x54')]({'where':{'id':_0x2cd506[_0x8dba('0x52')]['id']}})[_0x8dba('0x21')](handleEntityNotFound(_0x44dac8,null))[_0x8dba('0x21')](saveUpdates(_0x2cd506[_0x8dba('0x56')],null))[_0x8dba('0x21')](respondWithResult(_0x44dac8,null))[_0x8dba('0x50')](handleError(_0x44dac8,null));};exports[_0x8dba('0x57')]=function(_0x1e76b0,_0x2792c9){return db[_0x8dba('0x29')][_0x8dba('0x57')]()['then'](respondWithResult(_0x2792c9,null))[_0x8dba('0x50')](handleError(_0x2792c9,null));};exports[_0x8dba('0x22')]=function(_0x47ec6e,_0x2830a5){var _0x44b846;return db[_0x8dba('0x29')][_0x8dba('0x54')]({'where':{'id':_0x47ec6e[_0x8dba('0x52')]['id']}})[_0x8dba('0x21')](handleEntityNotFound(_0x2830a5,null))[_0x8dba('0x21')](function(_0x564b84){if(_0x564b84){return _0x564b84[_0x8dba('0x22')]()[_0x8dba('0x21')](function(_0x500c58){return _0x500c58;});}})[_0x8dba('0x21')](function(_0x589093){_0x44b846=_0x589093;if(_0x589093){if(_0x589093[_0x8dba('0x58')]||_0x589093['CampaignId']){return db[_0x589093['VoiceQueueId']?_0x8dba('0x59'):_0x8dba('0x5a')]['find']({'where':{'id':_0x589093[_0x8dba('0x58')]?_0x589093[_0x8dba('0x58')]:_0x589093[_0x8dba('0x5b')]},'attributes':['id',_0x8dba('0x25')],'raw':!![]});}}})[_0x8dba('0x21')](function(_0x59e0da){var _0x573a9d={};if(_0x59e0da){_['merge'](_0x573a9d,_[_0x8dba('0x5c')](_0x44b846[_0x8dba('0x5d')],[_0x8dba('0x5e'),_0x8dba('0x5f'),'id']));_0x573a9d[_0x8dba('0x60')]=0x15;_0x573a9d[_0x8dba('0x61')]=_0x8dba('0x62');_0x573a9d[_0x8dba('0x63')]=_0x59e0da['name'];_0x573a9d[_0x8dba('0x64')]=_0x47ec6e[_0x8dba('0x65')][_0x8dba('0x25')];_0x573a9d[_0x8dba('0x66')]=_0x47ec6e['user']['id'];_0x573a9d[_0x8dba('0x62')]=!![];_0x573a9d[_0x8dba('0x67')]=moment()[_0x8dba('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x573a9d[_0x8dba('0x69')]=_0x44b846['phone'];_0x573a9d[_0x8dba('0x6a')]=_0x44b846[_0x8dba('0x58')]?'queue':'ivr';return db[_0x8dba('0x6b')][_0x8dba('0x54')]({'where':{'id':_0x573a9d['ContactId']},'attributes':['firstName',_0x8dba('0x6c')]})[_0x8dba('0x21')](function(_0x5eb6df){if(!_['isNil'](_0x2830a5)&&!_['isNil'](_0x5eb6df['firstName'])){_0x573a9d[_0x8dba('0x6d')]=_0x5eb6df[_0x8dba('0x6e')];if(!_[_0x8dba('0x6f')](_0x5eb6df['lastName'])){_0x573a9d[_0x8dba('0x6d')]+='\x20'+_0x5eb6df[_0x8dba('0x6c')];}}})['finally'](function(){return db[_0x8dba('0x70')][_0x8dba('0x55')](_0x573a9d);});}})['then'](function(){return _0x2830a5['status'](0xcc)[_0x8dba('0x18')]();})[_0x8dba('0x50')](handleError(_0x2830a5,null));};exports[_0x8dba('0x71')]=function(_0x22eb65,_0x1ac96d,_0x3ddfad){var _0x336bc1=[];return db[_0x8dba('0x6b')][_0x8dba('0x57')]()[_0x8dba('0x21')](function(_0x48e4f4){_0x336bc1=_[_0x8dba('0x2f')](_0x48e4f4);return _0x22eb65['user'][_0x8dba('0x72')]({'where':{'type':_0x8dba('0x73'),'dialActive':!![],'dialMethod':_0x8dba('0x74')},'attributes':['id','dialOrderByScheduledAt',_0x8dba('0x75')],'raw':!![]});})[_0x8dba('0x21')](function(_0x31b7d7){if(_0x31b7d7&&_0x31b7d7[_0x8dba('0x44')]){return db[_0x8dba('0x76')][_0x8dba('0x77')](function(_0x17ec8f){var _0x138355={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8dba('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8dba('0x28')](_0x31b7d7,'id')},'$or':[{'UserId':null},{'UserId':_0x22eb65['user']['id']}]};var _0x59e240={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31b7d7)[_0x8dba('0x49')]([_0x8dba('0x75'),0x0])[_0x8dba('0x28')]('id')[_0x8dba('0x78')]()},'$or':[{'UserId':null},{'UserId':_0x22eb65[_0x8dba('0x65')]['id']}]};var _0xb2f782={'$or':[_0x138355,_0x59e240]};var _0xf1bfcf=[];if(_0x22eb65[_0x8dba('0x56')][_0x8dba('0x79')]&&_0x22eb65['body'][_0x8dba('0x79')]===_0x8dba('0x7a')){if(!_[_0x8dba('0x7b')](_0x22eb65[_0x8dba('0x56')][_0x8dba('0x7c')])){_0xb2f782['id']={'$in':_0x22eb65['body'][_0x8dba('0x7c')]};}_0xf1bfcf=[[_0x8dba('0x7d'),_0x8dba('0x7e')],['scheduledAt',_0x31b7d7[0x0][_0x8dba('0x7f')]===_0x8dba('0x7e')?_0x8dba('0x80'):'ASC'],db[_0x8dba('0x76')][_0x8dba('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x8dba('0x80')]];}else{if(!_[_0x8dba('0x7b')](_0x22eb65[_0x8dba('0x56')]['hopperIds'])){_0xb2f782['id']={'$notIn':_0x22eb65[_0x8dba('0x56')][_0x8dba('0x7c')]};}_0xf1bfcf=[[_0x8dba('0x7d'),_0x8dba('0x80')],[_0x8dba('0x82'),_0x31b7d7[0x0]['dialOrderByScheduledAt']],db[_0x8dba('0x76')]['literal'](_0x8dba('0x83')),['id',_0x8dba('0x7e')]];}return db[_0x8dba('0x29')][_0x8dba('0x84')]({'attributes':['id',_0x8dba('0x85'),_0x8dba('0x86')],'where':_0xb2f782,'order':_0xf1bfcf,'transaction':_0x17ec8f,'lock':_0x17ec8f[_0x8dba('0x87')]['UPDATE'],'include':[{'model':db[_0x8dba('0x6b')],'as':'Contact','attributes':_0x336bc1,'include':[{'model':db[_0x8dba('0x88')],'as':_0x8dba('0x89'),'attributes':['id',_0x8dba('0x25')]}]},{'model':db[_0x8dba('0x8a')],'as':_0x8dba('0x8b'),'attributes':['id',_0x8dba('0x25')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x8dba('0x8c')]}]})[_0x8dba('0x21')](function(_0x549cc3){if(_0x549cc3){return _0x549cc3[_0x8dba('0x20')]({'UserId':_0x22eb65[_0x8dba('0x65')]['id']},{'transaction':_0x17ec8f});}});});}})[_0x8dba('0x21')](handleEntityNotFound(_0x1ac96d,null))[_0x8dba('0x21')](respondWithResult(_0x1ac96d,null))['catch'](handleError(_0x1ac96d,null));};exports[_0x8dba('0x8d')]=function(_0x3c487b,_0x57576e,_0x49747c){return _0x3c487b['user'][_0x8dba('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8dba('0x74')},'attributes':['id'],'raw':!![]})[_0x8dba('0x21')](function(_0x1b70ee){if(_0x1b70ee&&_0x1b70ee[_0x8dba('0x44')]){return db['CmHopper'][_0x8dba('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8dba('0x68')](_0x8dba('0x8e'))},'VoiceQueueId':{'$in':_[_0x8dba('0x28')](_0x1b70ee,'id')},'$or':[{'UserId':null},{'UserId':_0x3c487b[_0x8dba('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x3d49b3){if(!_[_0x8dba('0x6f')](_0x3d49b3)&&_['isNumber'](_0x3d49b3)){return _0x57576e['status'](0xc8)[_0x8dba('0x19')]({'contacts':_0x3d49b3});}else{logger['error'](_0x8dba('0x8f'),_0x8dba('0x8d'),0x194,_0x8dba('0x90'));_0x57576e[_0x8dba('0x16')](0x194);}})['catch'](handleError(_0x57576e,null));}; \ No newline at end of file +var _0xc9d9=['dialPreviewAutoRecallMe','sequelize','transaction','format','value','direction','prev','isEmpty','hopperIds','priority','scheduledAt','DESC','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','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','../../mysqldb','status','end','json','offset','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$in','$like','$iLike','$overlap','$contained','$any','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopper','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','dataValues','createdAt','state','deleted','membername','UserId','user','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','getPreview','outbound','preview'];(function(_0x459fe5,_0x595d54){var _0x8dc8ee=function(_0x2fa5e4){while(--_0x2fa5e4){_0x459fe5['push'](_0x459fe5['shift']());}};_0x8dc8ee(++_0x595d54);}(_0xc9d9,0x141));var _0x9c9d=function(_0x179417,_0x170294){_0x179417=_0x179417-0x0;var _0x3ccf48=_0xc9d9[_0x179417];return _0x3ccf48;};'use strict';var emlformat=require(_0x9c9d('0x0'));var rimraf=require(_0x9c9d('0x1'));var zipdir=require(_0x9c9d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c9d('0x3'));var moment=require(_0x9c9d('0x4'));var BPromise=require(_0x9c9d('0x5'));var Mustache=require('mustache');var util=require(_0x9c9d('0x6'));var path=require(_0x9c9d('0x7'));var sox=require(_0x9c9d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c9d('0x9'));var _=require(_0x9c9d('0xa'));var squel=require(_0x9c9d('0xb'));var crypto=require(_0x9c9d('0xc'));var jsforce=require(_0x9c9d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9c9d('0xe'));var querystring=require(_0x9c9d('0xf'));var Papa=require(_0x9c9d('0x10'));var Redis=require(_0x9c9d('0x11'));var authService=require(_0x9c9d('0x12'));var qs=require(_0x9c9d('0x13'));var as=require(_0x9c9d('0x14'));var hardwareService=require(_0x9c9d('0x15'));var logger=require(_0x9c9d('0x16'))(_0x9c9d('0x17'));var utils=require(_0x9c9d('0x18'));var config=require(_0x9c9d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c9d('0x1a'))['db'];function respondWithStatusCode(_0x4e497f,_0x59631b){_0x59631b=_0x59631b||0xcc;return function(_0x581ee8){if(_0x581ee8){return _0x4e497f['sendStatus'](_0x59631b);}return _0x4e497f[_0x9c9d('0x1b')](_0x59631b)[_0x9c9d('0x1c')]();};}function respondWithResult(_0x595c87,_0x41b879){_0x41b879=_0x41b879||0xc8;return function(_0x5d9dde){if(_0x5d9dde){return _0x595c87[_0x9c9d('0x1b')](_0x41b879)[_0x9c9d('0x1d')](_0x5d9dde);}};}function respondWithFilteredResult(_0x18b8cf,_0x45581b){return function(_0x7c4364){if(_0x7c4364){var _0x1268f7=typeof _0x45581b[_0x9c9d('0x1e')]==='undefined'&&typeof _0x45581b['limit']==='undefined';var _0x214c2f=_0x7c4364['count'];var _0x38654e=_0x1268f7?0x0:_0x45581b[_0x9c9d('0x1e')];var _0x2e0fdd=_0x1268f7?_0x7c4364[_0x9c9d('0x1f')]:_0x45581b[_0x9c9d('0x1e')]+_0x45581b[_0x9c9d('0x20')];var _0x2b4233;if(_0x2e0fdd>=_0x214c2f){_0x2e0fdd=_0x214c2f;_0x2b4233=0xc8;}else{_0x2b4233=0xce;}_0x18b8cf['status'](_0x2b4233);return _0x18b8cf[_0x9c9d('0x21')]('Content-Range',_0x38654e+'-'+_0x2e0fdd+'/'+_0x214c2f)[_0x9c9d('0x1d')](_0x7c4364);}return null;};}function patchUpdates(_0x32ca16){return function(_0x44580d){try{jsonpatch[_0x9c9d('0x22')](_0x44580d,_0x32ca16,!![]);}catch(_0x4d0f4f){return BPromise[_0x9c9d('0x23')](_0x4d0f4f);}return _0x44580d[_0x9c9d('0x24')]();};}function saveUpdates(_0x42e6e3,_0x2a7cf0){return function(_0x379da4){if(_0x379da4){return _0x379da4[_0x9c9d('0x25')](_0x42e6e3)[_0x9c9d('0x26')](function(_0x3aa9b0){return _0x3aa9b0;});}return null;};}function removeEntity(_0x333938,_0x41845f){return function(_0x2a8e7f){if(_0x2a8e7f){return _0x2a8e7f[_0x9c9d('0x27')]()[_0x9c9d('0x26')](function(){_0x333938[_0x9c9d('0x1b')](0xcc)[_0x9c9d('0x1c')]();});}};}function handleEntityNotFound(_0x34e2e4,_0x4b20cf){return function(_0xf0a9c8){if(!_0xf0a9c8){_0x34e2e4[_0x9c9d('0x28')](0x194);}return _0xf0a9c8;};}function handleError(_0x347767,_0x1ffb4d){_0x1ffb4d=_0x1ffb4d||0x1f4;return function(_0x263616){logger[_0x9c9d('0x29')](_0x263616[_0x9c9d('0x2a')]);if(_0x263616[_0x9c9d('0x2b')]){delete _0x263616[_0x9c9d('0x2b')];}_0x347767[_0x9c9d('0x1b')](_0x1ffb4d)[_0x9c9d('0x2c')](_0x263616);};}exports[_0x9c9d('0x2d')]=function(_0x3648b3,_0x9f4d53){var _0x54d927={},_0x56b236={},_0x4e5724={'count':0x0,'rows':[]};var _0x1ce904=_[_0x9c9d('0x2e')](db['CmHopper'][_0x9c9d('0x2f')],function(_0x5c185e){return{'name':_0x5c185e['fieldName'],'type':_0x5c185e[_0x9c9d('0x30')]['key']};});_0x56b236[_0x9c9d('0x31')]=_[_0x9c9d('0x2e')](_0x1ce904,_0x9c9d('0x2b'));_0x56b236[_0x9c9d('0x32')]=_[_0x9c9d('0x33')](_0x3648b3[_0x9c9d('0x32')]);_0x56b236[_0x9c9d('0x34')]=_[_0x9c9d('0x35')](_0x56b236[_0x9c9d('0x31')],_0x56b236[_0x9c9d('0x32')]);_0x56b236[_0x9c9d('0x34')]=_[_0x9c9d('0x36')](_0x56b236['filters'],[_0x9c9d('0x37'),_0x9c9d('0x38'),_0x9c9d('0x39'),_0x9c9d('0x3a'),_0x9c9d('0x3b'),_0x9c9d('0x3c'),_0x9c9d('0x3d'),_0x9c9d('0x3e'),'$not',_0x9c9d('0x3f'),'$notBetween',_0x9c9d('0x40'),'$notIn',_0x9c9d('0x41'),'$notLike',_0x9c9d('0x42'),'$notILike','$like',_0x9c9d('0x43'),'$contains',_0x9c9d('0x44'),_0x9c9d('0x45')]);_0x54d927['attributes']=_['intersection'](_0x56b236[_0x9c9d('0x31')],qs[_0x9c9d('0x46')](_0x3648b3[_0x9c9d('0x32')][_0x9c9d('0x46')]));_0x54d927[_0x9c9d('0x47')]=_0x54d927[_0x9c9d('0x47')][_0x9c9d('0x48')]?_0x54d927['attributes']:_0x56b236[_0x9c9d('0x31')];if(!_0x3648b3['query'][_0x9c9d('0x49')]('nolimit')){_0x54d927['limit']=qs[_0x9c9d('0x20')](_0x3648b3[_0x9c9d('0x32')][_0x9c9d('0x20')]);_0x54d927[_0x9c9d('0x1e')]=qs[_0x9c9d('0x1e')](_0x3648b3[_0x9c9d('0x32')][_0x9c9d('0x1e')]);}_0x54d927[_0x9c9d('0x4a')]=qs[_0x9c9d('0x4b')](_0x3648b3[_0x9c9d('0x32')][_0x9c9d('0x4b')]);_0x54d927[_0x9c9d('0x4c')]=qs['filters'](_[_0x9c9d('0x4d')](_0x3648b3[_0x9c9d('0x32')],_0x56b236[_0x9c9d('0x34')]),_0x1ce904);if(_0x3648b3[_0x9c9d('0x32')][_0x9c9d('0x4e')]){_0x54d927[_0x9c9d('0x4c')]=_[_0x9c9d('0x4f')](_0x54d927[_0x9c9d('0x4c')],{'$or':_[_0x9c9d('0x2e')](_0x1ce904,function(_0x5f401f){if(_0x5f401f[_0x9c9d('0x30')]!==_0x9c9d('0x50')){var _0xe3eb32={};_0xe3eb32[_0x5f401f[_0x9c9d('0x2b')]]={'$like':'%'+_0x3648b3[_0x9c9d('0x32')]['filter']+'%'};return _0xe3eb32;}})});}_0x54d927=_[_0x9c9d('0x4f')]({},_0x54d927,_0x3648b3[_0x9c9d('0x51')]);var _0x1ca2f3={'where':_0x54d927['where']};return db[_0x9c9d('0x52')][_0x9c9d('0x1f')](_0x1ca2f3)[_0x9c9d('0x26')](function(_0x3284a9){_0x4e5724[_0x9c9d('0x1f')]=_0x3284a9;if(_0x3648b3['query']['includeAll']){_0x54d927[_0x9c9d('0x53')]=[{'all':!![]}];}return db[_0x9c9d('0x52')][_0x9c9d('0x54')](_0x54d927);})['then'](function(_0x3ced8f){_0x4e5724[_0x9c9d('0x55')]=_0x3ced8f;return _0x4e5724;})['then'](respondWithFilteredResult(_0x9f4d53,_0x54d927))[_0x9c9d('0x56')](handleError(_0x9f4d53,null));};exports[_0x9c9d('0x57')]=function(_0x258286,_0x334935){var _0x330380={'raw':!![],'where':{'id':_0x258286[_0x9c9d('0x58')]['id']}},_0x37d684={};_0x37d684['model']=_[_0x9c9d('0x33')](db[_0x9c9d('0x52')][_0x9c9d('0x2f')]);_0x37d684[_0x9c9d('0x32')]=_[_0x9c9d('0x33')](_0x258286[_0x9c9d('0x32')]);_0x37d684[_0x9c9d('0x34')]=_[_0x9c9d('0x35')](_0x37d684[_0x9c9d('0x31')],_0x37d684[_0x9c9d('0x32')]);_0x330380[_0x9c9d('0x47')]=_[_0x9c9d('0x35')](_0x37d684[_0x9c9d('0x31')],qs['fields'](_0x258286[_0x9c9d('0x32')][_0x9c9d('0x46')]));_0x330380['attributes']=_0x330380[_0x9c9d('0x47')][_0x9c9d('0x48')]?_0x330380[_0x9c9d('0x47')]:_0x37d684[_0x9c9d('0x31')];if(_0x258286[_0x9c9d('0x32')][_0x9c9d('0x59')]){_0x330380[_0x9c9d('0x53')]=[{'all':!![]}];}_0x330380=_[_0x9c9d('0x4f')]({},_0x330380,_0x258286[_0x9c9d('0x51')]);return db[_0x9c9d('0x52')][_0x9c9d('0x5a')](_0x330380)[_0x9c9d('0x26')](handleEntityNotFound(_0x334935,null))['then'](respondWithResult(_0x334935,null))[_0x9c9d('0x56')](handleError(_0x334935,null));};exports['create']=function(_0x3cc820,_0x1d0b8c){return db[_0x9c9d('0x52')][_0x9c9d('0x5b')](_0x3cc820[_0x9c9d('0x5c')],{})[_0x9c9d('0x26')](respondWithResult(_0x1d0b8c,0xc9))[_0x9c9d('0x56')](handleError(_0x1d0b8c,null));};exports[_0x9c9d('0x25')]=function(_0x57a5c0,_0x38f60b){if(_0x57a5c0[_0x9c9d('0x5c')]['id']){delete _0x57a5c0[_0x9c9d('0x5c')]['id'];}return db[_0x9c9d('0x52')]['find']({'where':{'id':_0x57a5c0[_0x9c9d('0x58')]['id']}})['then'](handleEntityNotFound(_0x38f60b,null))[_0x9c9d('0x26')](saveUpdates(_0x57a5c0[_0x9c9d('0x5c')],null))[_0x9c9d('0x26')](respondWithResult(_0x38f60b,null))['catch'](handleError(_0x38f60b,null));};exports[_0x9c9d('0x5d')]=function(_0x28621f,_0x1934ea){return db[_0x9c9d('0x52')][_0x9c9d('0x5d')]()[_0x9c9d('0x26')](respondWithResult(_0x1934ea,null))['catch'](handleError(_0x1934ea,null));};exports[_0x9c9d('0x27')]=function(_0x1498bb,_0x5f0182){var _0xdd30d6;return db[_0x9c9d('0x52')]['find']({'where':{'id':_0x1498bb[_0x9c9d('0x58')]['id']}})['then'](handleEntityNotFound(_0x5f0182,null))[_0x9c9d('0x26')](function(_0x5e947a){if(_0x5e947a){return _0x5e947a['destroy']()[_0x9c9d('0x26')](function(_0x5548d3){return _0x5548d3;});}})[_0x9c9d('0x26')](function(_0x203a89){_0xdd30d6=_0x203a89;if(_0x203a89){if(_0x203a89[_0x9c9d('0x5e')]||_0x203a89[_0x9c9d('0x5f')]){return db[_0x203a89[_0x9c9d('0x5e')]?_0x9c9d('0x60'):'Campaign']['find']({'where':{'id':_0x203a89[_0x9c9d('0x5e')]?_0x203a89[_0x9c9d('0x5e')]:_0x203a89[_0x9c9d('0x5f')]},'attributes':['id',_0x9c9d('0x2b')],'raw':!![]});}}})[_0x9c9d('0x26')](function(_0x3596d6){var _0x31ef6a={};if(_0x3596d6){_[_0x9c9d('0x4f')](_0x31ef6a,_['omit'](_0xdd30d6[_0x9c9d('0x61')],[_0x9c9d('0x62'),'updatedAt','id']));_0x31ef6a[_0x9c9d('0x63')]=0x15;_0x31ef6a['statedesc']=_0x9c9d('0x64');_0x31ef6a['campaign']=_0x3596d6[_0x9c9d('0x2b')];_0x31ef6a[_0x9c9d('0x65')]=_0x1498bb['user'][_0x9c9d('0x2b')];_0x31ef6a[_0x9c9d('0x66')]=_0x1498bb[_0x9c9d('0x67')]['id'];_0x31ef6a[_0x9c9d('0x64')]=!![];_0x31ef6a['deletedat']=moment()['format'](_0x9c9d('0x68'));_0x31ef6a[_0x9c9d('0x69')]=_0xdd30d6[_0x9c9d('0x6a')];_0x31ef6a[_0x9c9d('0x6b')]=_0xdd30d6[_0x9c9d('0x5e')]?_0x9c9d('0x6c'):_0x9c9d('0x6d');return db[_0x9c9d('0x6e')][_0x9c9d('0x5a')]({'where':{'id':_0x31ef6a[_0x9c9d('0x6f')]},'attributes':['firstName',_0x9c9d('0x70')]})['then'](function(_0x4ee271){if(!_[_0x9c9d('0x71')](_0x5f0182)&&!_['isNil'](_0x4ee271[_0x9c9d('0x72')])){_0x31ef6a['calleridname']=_0x4ee271[_0x9c9d('0x72')];if(!_[_0x9c9d('0x71')](_0x4ee271[_0x9c9d('0x70')])){_0x31ef6a[_0x9c9d('0x73')]+='\x20'+_0x4ee271[_0x9c9d('0x70')];}}})['finally'](function(){return db[_0x9c9d('0x74')][_0x9c9d('0x5b')](_0x31ef6a);});}})[_0x9c9d('0x26')](function(){return _0x5f0182[_0x9c9d('0x1b')](0xcc)[_0x9c9d('0x1c')]();})[_0x9c9d('0x56')](handleError(_0x5f0182,null));};exports[_0x9c9d('0x75')]=function(_0x447214,_0x226282,_0x33d908){var _0x13c0d4=[];return db[_0x9c9d('0x6e')][_0x9c9d('0x5d')]()[_0x9c9d('0x26')](function(_0xcd85aa){_0x13c0d4=_[_0x9c9d('0x33')](_0xcd85aa);return _0x447214['user']['getVoiceQueues']({'where':{'type':_0x9c9d('0x76'),'dialActive':!![],'dialMethod':_0x9c9d('0x77')},'attributes':['id','dialOrderByScheduledAt',_0x9c9d('0x78')],'raw':!![]});})[_0x9c9d('0x26')](function(_0x59d3c1){if(_0x59d3c1&&_0x59d3c1['length']){return db[_0x9c9d('0x79')][_0x9c9d('0x7a')](function(_0x4355f0){var _0x28c210={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c9d('0x7b')](_0x9c9d('0x68'))},'VoiceQueueId':{'$in':_[_0x9c9d('0x2e')](_0x59d3c1,'id')},'$or':[{'UserId':null},{'UserId':_0x447214[_0x9c9d('0x67')]['id']}]};var _0x3b4866={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x59d3c1)[_0x9c9d('0x4e')](['dialPreviewAutoRecallMe',0x0])[_0x9c9d('0x2e')]('id')[_0x9c9d('0x7c')]()},'$or':[{'UserId':null},{'UserId':_0x447214[_0x9c9d('0x67')]['id']}]};var _0x5d5321={'$or':[_0x28c210,_0x3b4866]};var _0x37db84=[];if(_0x447214[_0x9c9d('0x5c')][_0x9c9d('0x7d')]&&_0x447214[_0x9c9d('0x5c')][_0x9c9d('0x7d')]===_0x9c9d('0x7e')){if(!_[_0x9c9d('0x7f')](_0x447214[_0x9c9d('0x5c')][_0x9c9d('0x80')])){_0x5d5321['id']={'$in':_0x447214[_0x9c9d('0x5c')]['hopperIds']};}_0x37db84=[[_0x9c9d('0x81'),'ASC'],[_0x9c9d('0x82'),_0x59d3c1[0x0]['dialOrderByScheduledAt']==='ASC'?_0x9c9d('0x83'):_0x9c9d('0x84')],db[_0x9c9d('0x79')][_0x9c9d('0x85')](_0x9c9d('0x86')),['id','DESC']];}else{if(!_[_0x9c9d('0x7f')](_0x447214[_0x9c9d('0x5c')][_0x9c9d('0x80')])){_0x5d5321['id']={'$notIn':_0x447214[_0x9c9d('0x5c')][_0x9c9d('0x80')]};}_0x37db84=[[_0x9c9d('0x81'),_0x9c9d('0x83')],[_0x9c9d('0x82'),_0x59d3c1[0x0][_0x9c9d('0x87')]],db[_0x9c9d('0x79')][_0x9c9d('0x85')](_0x9c9d('0x88')),['id',_0x9c9d('0x84')]];}return db[_0x9c9d('0x52')]['findOne']({'attributes':['id',_0x9c9d('0x89'),_0x9c9d('0x8a')],'where':_0x5d5321,'order':_0x37db84,'transaction':_0x4355f0,'lock':_0x4355f0['LOCK'][_0x9c9d('0x8b')],'include':[{'model':db[_0x9c9d('0x6e')],'as':_0x9c9d('0x8c'),'attributes':_0x13c0d4,'include':[{'model':db[_0x9c9d('0x8d')],'as':_0x9c9d('0x8e'),'attributes':['id',_0x9c9d('0x2b')]}]},{'model':db['CmList'],'as':_0x9c9d('0x8f'),'attributes':['id',_0x9c9d('0x2b')]},{'model':db[_0x9c9d('0x60')],'as':_0x9c9d('0x90'),'attributes':['id','name',_0x9c9d('0x91')]}]})[_0x9c9d('0x26')](function(_0x5d425d){if(_0x5d425d){return _0x5d425d['update']({'UserId':_0x447214[_0x9c9d('0x67')]['id']},{'transaction':_0x4355f0});}});});}})[_0x9c9d('0x26')](handleEntityNotFound(_0x226282,null))[_0x9c9d('0x26')](respondWithResult(_0x226282,null))['catch'](handleError(_0x226282,null));};exports[_0x9c9d('0x92')]=function(_0x4beee2,_0x5ee54b,_0x1fad8f){return _0x4beee2[_0x9c9d('0x67')]['getVoiceQueues']({'where':{'type':_0x9c9d('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x9c9d('0x26')](function(_0x3e251c){if(_0x3e251c&&_0x3e251c[_0x9c9d('0x48')]){return db[_0x9c9d('0x52')][_0x9c9d('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c9d('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x9c9d('0x2e')](_0x3e251c,'id')},'$or':[{'UserId':null},{'UserId':_0x4beee2[_0x9c9d('0x67')]['id']}]}});}return 0x0;})[_0x9c9d('0x26')](function(_0x4b87b0){if(!_[_0x9c9d('0x71')](_0x4b87b0)&&_['isNumber'](_0x4b87b0)){return _0x5ee54b[_0x9c9d('0x1b')](0xc8)[_0x9c9d('0x1d')]({'contacts':_0x4b87b0});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x9c9d('0x92'),0x194,'entity\x20not\x20found');_0x5ee54b[_0x9c9d('0x28')](0x194);}})['catch'](handleError(_0x5ee54b,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2e61e7a..353d98c 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 _0x687b=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x2e11d3,_0x26a29a){_0x2e11d3=_0x2e11d3-0x0;var _0x3f7f7f=_0x687b[_0x2e11d3];return _0x3f7f7f;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]},{'name':'phone','fields':[_0xb687('0xd')]},{'name':_0xb687('0xe'),'fields':[_0xb687('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird'];(function(_0x515253,_0x250eae){var _0x216c55=function(_0x2740b8){while(--_0x2740b8){_0x515253['push'](_0x515253['shift']());}};_0x216c55(++_0x250eae);}(_0x33af,0xec));var _0xf33a=function(_0x5e9018,_0x5d3a28){_0x5e9018=_0x5e9018-0x0;var _0x2062e2=_0x33af[_0x5e9018];return _0x2062e2;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[{'name':_0xf33a('0xc'),'fields':[_0xf33a('0xc')]},{'name':'phone','fields':[_0xf33a('0xd')]},{'name':_0xf33a('0xe'),'fields':[_0xf33a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 2380590..c681f81 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 _0x4a10=['push','includes','all','transaction','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','order','GetContactRecallMe','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','message','CmHopper,\x20%s,\x20%s','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','describe','sequelize','findAll','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','voicePause','length','UserId'];(function(_0x5d5ea8,_0x24952a){var _0x553c87=function(_0x479c13){while(--_0x479c13){_0x5d5ea8['push'](_0x5d5ea8['shift']());}};_0x553c87(++_0x24952a);}(_0x4a10,0x169));var _0x04a1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4a10[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x04a1('0x0'));var util=require(_0x04a1('0x1'));var moment=require(_0x04a1('0x2'));var BPromise=require(_0x04a1('0x3'));var rs=require(_0x04a1('0x4'));var fs=require('fs');var Redis=require(_0x04a1('0x5'));var db=require(_0x04a1('0x6'))['db'];var utils=require(_0x04a1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x04a1('0x8'));var jayson=require(_0x04a1('0x9'));var client=jayson['client'][_0x04a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5052f0,_0x226649,_0x5386d4){return new BPromise(function(_0x44cb1d,_0x67550d){return client['request'](_0x5052f0,_0x5386d4)[_0x04a1('0xb')](function(_0x31afbc){logger[_0x04a1('0xc')]('CmHopper,\x20%s,\x20%s',_0x226649,_0x04a1('0xd'));logger[_0x04a1('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x226649,'request\x20sent',JSON[_0x04a1('0xf')](_0x31afbc));if(_0x31afbc[_0x04a1('0x10')]){if(_0x31afbc[_0x04a1('0x10')][_0x04a1('0x11')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x226649,_0x31afbc[_0x04a1('0x10')]['message']);return _0x67550d(_0x31afbc[_0x04a1('0x10')][_0x04a1('0x12')]);}logger['error'](_0x04a1('0x13'),_0x226649,_0x31afbc[_0x04a1('0x10')][_0x04a1('0x12')]);return _0x44cb1d(_0x31afbc[_0x04a1('0x10')][_0x04a1('0x12')]);}else{logger['info'](_0x04a1('0x13'),_0x226649,_0x04a1('0xd'));_0x44cb1d(_0x31afbc['result'][_0x04a1('0x12')]);}})[_0x04a1('0x14')](function(_0x253acf){logger['error'](_0x04a1('0x13'),_0x226649,_0x253acf);_0x67550d(_0x253acf);});});}exports[_0x04a1('0x15')]=function(_0x121765){var _0x2d9997=this;return new Promise(function(_0x1bb7cd,_0x68b990){return db[_0x04a1('0x16')]['findAll']({'raw':_0x121765[_0x04a1('0x17')]?_0x121765[_0x04a1('0x17')][_0x04a1('0x18')]===undefined?!![]:![]:!![],'where':_0x121765[_0x04a1('0x17')]?_0x121765[_0x04a1('0x17')][_0x04a1('0x19')]||null:null,'attributes':_0x121765[_0x04a1('0x17')]?_0x121765[_0x04a1('0x17')][_0x04a1('0x1a')]||null:null,'limit':_0x121765[_0x04a1('0x17')]?_0x121765[_0x04a1('0x17')][_0x04a1('0x1b')]||null:null,'include':_0x121765[_0x04a1('0x17')]?_0x121765[_0x04a1('0x17')]['include']?_[_0x04a1('0x1c')](_0x121765[_0x04a1('0x17')]['include'],function(_0x245b45){return{'model':db[_0x245b45['model']],'as':_0x245b45['as'],'attributes':_0x245b45['attributes'],'include':_0x245b45[_0x04a1('0x1d')]?_['map'](_0x245b45[_0x04a1('0x1d')],function(_0x12edff){return{'model':db[_0x12edff[_0x04a1('0x1e')]],'as':_0x12edff['as'],'attributes':_0x12edff[_0x04a1('0x1a')],'include':_0x12edff[_0x04a1('0x1d')]?_['map'](_0x12edff['include'],function(_0x250e22){return{'model':db[_0x250e22[_0x04a1('0x1e')]],'as':_0x250e22['as'],'attributes':_0x250e22[_0x04a1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x04a1('0xb')](function(_0x3c45eb){logger[_0x04a1('0xc')](_0x04a1('0x15'),_0x121765);logger[_0x04a1('0xe')]('GetCmHopper',_0x121765,JSON[_0x04a1('0xf')](_0x3c45eb));_0x1bb7cd(_0x3c45eb);})['catch'](function(_0x2f8244){logger[_0x04a1('0x10')](_0x04a1('0x15'),_0x2f8244[_0x04a1('0x12')],_0x121765);_0x68b990(_0x2d9997[_0x04a1('0x10')](0x1f4,_0x2f8244[_0x04a1('0x12')]));});});};exports['ShowCmHopper']=function(_0x302f44){var _0x1c5c23=this;return new Promise(function(_0x1b0c8b,_0x9ddbc8){return db[_0x04a1('0x16')][_0x04a1('0x1f')]({'raw':_0x302f44[_0x04a1('0x17')]?_0x302f44[_0x04a1('0x17')][_0x04a1('0x18')]===undefined?!![]:![]:!![],'where':_0x302f44[_0x04a1('0x17')]?_0x302f44[_0x04a1('0x17')][_0x04a1('0x19')]||null:null,'attributes':_0x302f44[_0x04a1('0x17')]?_0x302f44[_0x04a1('0x17')][_0x04a1('0x1a')]||null:null,'include':_0x302f44[_0x04a1('0x17')]?_0x302f44['options'][_0x04a1('0x1d')]?_['map'](_0x302f44[_0x04a1('0x17')][_0x04a1('0x1d')],function(_0x551f6b){return{'model':db[_0x551f6b[_0x04a1('0x1e')]],'as':_0x551f6b['as'],'attributes':_0x551f6b[_0x04a1('0x1a')],'include':_0x551f6b['include']?_[_0x04a1('0x1c')](_0x551f6b[_0x04a1('0x1d')],function(_0xca1aaf){return{'model':db[_0xca1aaf[_0x04a1('0x1e')]],'as':_0xca1aaf['as'],'attributes':_0xca1aaf['attributes'],'include':_0xca1aaf[_0x04a1('0x1d')]?_['map'](_0xca1aaf[_0x04a1('0x1d')],function(_0x3cabb7){return{'model':db[_0x3cabb7[_0x04a1('0x1e')]],'as':_0x3cabb7['as'],'attributes':_0x3cabb7[_0x04a1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x04a1('0xb')](function(_0x23f95e){logger[_0x04a1('0xc')](_0x04a1('0x20'),_0x302f44);logger[_0x04a1('0xe')](_0x04a1('0x20'),_0x302f44,JSON['stringify'](_0x23f95e));_0x1b0c8b(_0x23f95e);})['catch'](function(_0x477794){logger[_0x04a1('0x10')]('ShowCmHopper',_0x477794[_0x04a1('0x12')],_0x302f44);_0x9ddbc8(_0x1c5c23['error'](0x1f4,_0x477794[_0x04a1('0x12')]));});});};exports[_0x04a1('0x21')]=function(_0x642f8a){var _0xec68cf=this;return new Promise(function(_0x188023,_0x3094c6){return db['CmHopper'][_0x04a1('0x22')](_0x642f8a[_0x04a1('0x23')],{'raw':_0x642f8a[_0x04a1('0x17')]?_0x642f8a[_0x04a1('0x17')][_0x04a1('0x18')]===undefined?!![]:![]:!![]})[_0x04a1('0xb')](function(_0x10d227){logger[_0x04a1('0xc')](_0x04a1('0x21'),_0x642f8a);logger['debug'](_0x04a1('0x21'),_0x642f8a,JSON[_0x04a1('0xf')](_0x10d227));_0x188023(_0x10d227);})[_0x04a1('0x14')](function(_0x2b159c){logger[_0x04a1('0x10')](_0x04a1('0x21'),_0x2b159c[_0x04a1('0x12')],_0x642f8a);_0x3094c6(_0xec68cf['error'](0x1f4,_0x2b159c[_0x04a1('0x12')]));});});};exports[_0x04a1('0x24')]=function(_0x29ac00){var _0x3f70a3=this;return new Promise(function(_0x2d6933,_0x1e9f53){return db[_0x04a1('0x16')][_0x04a1('0x25')](_0x29ac00[_0x04a1('0x23')],{'raw':_0x29ac00[_0x04a1('0x17')]?_0x29ac00['options'][_0x04a1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29ac00[_0x04a1('0x17')]?_0x29ac00['options'][_0x04a1('0x19')]||null:null,'attributes':_0x29ac00[_0x04a1('0x17')]?_0x29ac00[_0x04a1('0x17')][_0x04a1('0x1a')]||null:null,'limit':_0x29ac00[_0x04a1('0x17')]?_0x29ac00[_0x04a1('0x17')]['limit']||null:null})[_0x04a1('0xb')](function(_0x59cc75){logger[_0x04a1('0xc')](_0x04a1('0x24'),_0x29ac00);logger[_0x04a1('0xe')](_0x04a1('0x24'),_0x29ac00,JSON[_0x04a1('0xf')](_0x59cc75));_0x2d6933(_0x59cc75);})[_0x04a1('0x14')](function(_0x225857){logger[_0x04a1('0x10')](_0x04a1('0x24'),_0x225857[_0x04a1('0x12')],_0x29ac00);_0x1e9f53(_0x3f70a3[_0x04a1('0x10')](0x1f4,_0x225857['message']));});});};exports[_0x04a1('0x26')]=function(_0x142a77){var _0x245a11=this;return new Promise(function(_0x491f2c,_0x2cb90d){return db[_0x04a1('0x16')]['destroy']({'where':_0x142a77[_0x04a1('0x17')]?_0x142a77[_0x04a1('0x17')][_0x04a1('0x19')]||null:null})[_0x04a1('0xb')](function(_0x4ec4b8){logger['info'](_0x04a1('0x26'),_0x142a77);logger['debug'](_0x04a1('0x26'),_0x142a77,JSON[_0x04a1('0xf')](_0x4ec4b8));_0x491f2c(_0x4ec4b8);})[_0x04a1('0x14')](function(_0x347e52){logger['error'](_0x04a1('0x26'),_0x347e52[_0x04a1('0x12')],_0x142a77);_0x2cb90d(_0x245a11[_0x04a1('0x10')](0x1f4,_0x347e52[_0x04a1('0x12')]));});});};exports[_0x04a1('0x27')]=function(_0x470691){var _0x39f6d6=this;return new Promise(function(_0x4af87d,_0x5d503b){return db['CmContact'][_0x04a1('0x28')]()[_0x04a1('0xb')](function(_0x5830b3){return db[_0x04a1('0x29')]['transaction'](function(_0x4cc684){return db['CmHopper'][_0x04a1('0x2a')]({'where':_0x470691['options']?_0x470691[_0x04a1('0x17')][_0x04a1('0x19')]||null:null,'attributes':_0x470691[_0x04a1('0x17')]?_0x470691[_0x04a1('0x17')][_0x04a1('0x1a')]||null:null,'limit':_0x470691[_0x04a1('0x17')]?_0x470691['options'][_0x04a1('0x1b')]||null:null,'order':_0x470691[_0x04a1('0x17')]?_0x470691[_0x04a1('0x17')]['order']||null:null,'transaction':_0x4cc684,'lock':_0x4cc684[_0x04a1('0x2b')][_0x04a1('0x2c')],'include':[{'model':db[_0x04a1('0x2d')],'as':_0x04a1('0x2e'),'attributes':_[_0x04a1('0x2f')](_0x5830b3)},{'model':db[_0x04a1('0x30')],'as':_0x04a1('0x31'),'attributes':['id','name',_0x04a1('0x32')]}]})[_0x04a1('0xb')](function(_0x127953){var _0x428783=[];var _0x5bf283=[];for(var _0x270d47=0x0;_0x270d47<_0x127953[_0x04a1('0x33')];_0x270d47+=0x1){var _0x5a573c=_0x127953[_0x270d47][_0x04a1('0x34')];if(_0x5a573c===null){_0x428783[_0x04a1('0x35')](_0x127953[_0x270d47][_0x04a1('0x25')](_0x470691['body'],{'transaction':_0x4cc684}));}else if(!_0x5bf283[_0x04a1('0x36')](_0x5a573c)){_0x5bf283[_0x04a1('0x35')](_0x5a573c);_0x428783[_0x04a1('0x35')](_0x127953[_0x270d47][_0x04a1('0x25')](_0x470691[_0x04a1('0x23')],{'transaction':_0x4cc684}));}}return BPromise[_0x04a1('0x37')](_0x428783);});})['then'](function(_0x556ef7){logger[_0x04a1('0xc')](_0x04a1('0x27'),_0x470691);logger[_0x04a1('0xe')](_0x04a1('0x27'),_0x470691,JSON[_0x04a1('0xf')](_0x556ef7));_0x4af87d(_0x556ef7);})[_0x04a1('0x14')](function(_0x315750){logger['error'](_0x04a1('0x27'),_0x315750[_0x04a1('0x12')],_0x470691);_0x5d503b(_0x39f6d6[_0x04a1('0x10')](0x1f4,_0x315750[_0x04a1('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x4640bc){var _0x2763f0=this;return new Promise(function(_0x1ec112,_0x1a5914){return db[_0x04a1('0x29')][_0x04a1('0x38')](function(_0x6ea408){return db['CmHopperFinal'][_0x04a1('0x22')](_0x4640bc[_0x04a1('0x23')],{'raw':_0x4640bc['options']?_0x4640bc[_0x04a1('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x6ea408})[_0x04a1('0xb')](function(){return db['CmHopper'][_0x04a1('0x39')]({'where':_0x4640bc[_0x04a1('0x17')]?_0x4640bc['options']['where']||null:null,'transaction':_0x6ea408});});})[_0x04a1('0xb')](function(_0x379aea){logger[_0x04a1('0xc')](_0x04a1('0x3a'),_0x4640bc);logger[_0x04a1('0xe')](_0x04a1('0x3a'),_0x4640bc,JSON[_0x04a1('0xf')](_0x379aea));_0x1ec112(_0x379aea);})[_0x04a1('0x14')](function(_0x55b688){logger[_0x04a1('0x10')](_0x04a1('0x3a'),_0x55b688[_0x04a1('0x12')],_0x4640bc);_0x1a5914(_0x2763f0[_0x04a1('0x10')](0x1f4,_0x55b688[_0x04a1('0x12')]));});});};exports[_0x04a1('0x3b')]=function(_0x1ff34e){var _0x1c245d=this;return new Promise(function(_0x38bde3,_0x56c93d){return db[_0x04a1('0x16')][_0x04a1('0x2a')]({'raw':_0x1ff34e[_0x04a1('0x17')]?_0x1ff34e[_0x04a1('0x17')][_0x04a1('0x18')]===undefined?!![]:![]:!![],'where':_0x1ff34e[_0x04a1('0x17')]?_0x1ff34e['options']['where']||null:null,'attributes':[[db[_0x04a1('0x29')]['fn'](_0x04a1('0x3c'),db[_0x04a1('0x29')]['fn']('IF',db[_0x04a1('0x29')][_0x04a1('0x3d')](_0x04a1('0x3e')+util['format'](_0x04a1('0x3f'),moment()[_0x04a1('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x04a1('0x41')))),_0x04a1('0x42')]]})['then'](function(_0x3ac441){logger[_0x04a1('0xc')](_0x04a1('0x3b'),_0x1ff34e);logger[_0x04a1('0xe')](_0x04a1('0x3b'),_0x1ff34e,JSON[_0x04a1('0xf')](_0x3ac441));_0x38bde3(_0x3ac441);})[_0x04a1('0x14')](function(_0x2b535f){logger['error']('CountReScheduled',_0x2b535f[_0x04a1('0x12')],_0x1ff34e);_0x56c93d(_0x1c245d['error'](0x1f4,_0x2b535f[_0x04a1('0x12')]));});});};exports['GetContactRecallMe']=function(_0x162250){var _0x5c518b=this;return new Promise(function(_0x403060,_0x4b58ac){return db[_0x04a1('0x2d')]['describe']()[_0x04a1('0xb')](function(_0x3f5e6e){return db[_0x04a1('0x29')][_0x04a1('0x38')](function(_0xed6d14){return db[_0x04a1('0x16')]['findAll']({'where':_0x162250[_0x04a1('0x17')]?_0x162250[_0x04a1('0x17')]['where']||null:null,'attributes':_0x162250[_0x04a1('0x17')]?_0x162250[_0x04a1('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x162250[_0x04a1('0x17')]?_0x162250[_0x04a1('0x17')][_0x04a1('0x43')]||null:null,'group':db[_0x04a1('0x16')][_0x04a1('0x34')],'transaction':_0xed6d14,'lock':_0xed6d14[_0x04a1('0x2b')][_0x04a1('0x2c')],'include':_0x162250[_0x04a1('0x17')]?_0x162250[_0x04a1('0x17')][_0x04a1('0x1d')]?_[_0x04a1('0x1c')](_0x162250[_0x04a1('0x17')][_0x04a1('0x1d')],function(_0x2c498d){return{'model':db[_0x2c498d[_0x04a1('0x1e')]],'as':_0x2c498d['as'],'attributes':_0x2c498d[_0x04a1('0x1a')],'include':_0x2c498d[_0x04a1('0x1d')]?_['map'](_0x2c498d['include'],function(_0x1c3474){return{'model':db[_0x1c3474[_0x04a1('0x1e')]],'as':_0x1c3474['as'],'attributes':_0x1c3474['attributes'],'include':_0x1c3474[_0x04a1('0x1d')]?_[_0x04a1('0x1c')](_0x1c3474[_0x04a1('0x1d')],function(_0x36047b){return{'model':db[_0x36047b[_0x04a1('0x1e')]],'as':_0x36047b['as'],'attributes':_0x36047b[_0x04a1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x406385){var _0x5c0d18=[];for(var _0x50a747=0x0;_0x50a747<_0x406385['length'];_0x50a747+=0x1){_0x5c0d18[_0x04a1('0x35')](_0x406385[_0x50a747][_0x04a1('0x25')](_0x162250[_0x04a1('0x23')],{'transaction':_0xed6d14}));}return BPromise[_0x04a1('0x37')](_0x5c0d18);});})[_0x04a1('0xb')](function(_0x4f7d26){logger[_0x04a1('0xc')](_0x04a1('0x44'),_0x162250);logger[_0x04a1('0xe')](_0x04a1('0x44'),_0x162250,JSON[_0x04a1('0xf')](_0x4f7d26));_0x403060(_0x4f7d26);})[_0x04a1('0x14')](function(_0x2befb1){logger[_0x04a1('0x10')](_0x04a1('0x44'),_0x2befb1[_0x04a1('0x12')],_0x162250);_0x4b58ac(_0x5c518b[_0x04a1('0x10')](0x1f4,_0x2befb1['message']));});});});};exports['GetCmHopperPreview']=function(_0x1b0ed2){var _0x5859da=this;return new Promise(function(_0x155354,_0x5afc3c){db[_0x04a1('0x2d')]['describe']()['then'](function(_0x39e9f9){return db['CmHopper'][_0x04a1('0x2a')]({'raw':_0x1b0ed2[_0x04a1('0x17')]?_0x1b0ed2[_0x04a1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b0ed2[_0x04a1('0x17')]?_0x1b0ed2[_0x04a1('0x17')][_0x04a1('0x19')]||null:null,'attributes':_0x1b0ed2[_0x04a1('0x17')]?_0x1b0ed2[_0x04a1('0x17')][_0x04a1('0x1a')]||null:null,'limit':_0x1b0ed2[_0x04a1('0x17')]?_0x1b0ed2[_0x04a1('0x17')]['limit']||null:null,'include':_0x1b0ed2[_0x04a1('0x17')]?_0x1b0ed2[_0x04a1('0x17')][_0x04a1('0x1d')]?_[_0x04a1('0x1c')](_0x1b0ed2[_0x04a1('0x17')]['include'],function(_0xce6f9f){return{'model':db[_0xce6f9f[_0x04a1('0x1e')]],'as':_0xce6f9f['as'],'attributes':_0xce6f9f['as']==='Contact'?_['keys'](_0x39e9f9):_0xce6f9f[_0x04a1('0x1a')],'include':_0xce6f9f[_0x04a1('0x1d')]?_['map'](_0xce6f9f[_0x04a1('0x1d')],function(_0x570d56){return{'model':db[_0x570d56['model']],'as':_0x570d56['as'],'attributes':_0x570d56['attributes'],'include':_0x570d56[_0x04a1('0x1d')]?_[_0x04a1('0x1c')](_0x570d56[_0x04a1('0x1d')],function(_0x5224f8){return{'model':db[_0x5224f8[_0x04a1('0x1e')]],'as':_0x5224f8['as'],'attributes':_0x5224f8[_0x04a1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x04a1('0xb')](function(_0x520224){logger[_0x04a1('0xc')](_0x04a1('0x15'),_0x1b0ed2);logger[_0x04a1('0xe')](_0x04a1('0x15'),_0x1b0ed2,JSON[_0x04a1('0xf')](_0x520224));_0x155354(_0x520224);})['catch'](function(_0x12e67e){logger[_0x04a1('0x10')](_0x04a1('0x15'),_0x12e67e[_0x04a1('0x12')],_0x1b0ed2);_0x5afc3c(_0x5859da[_0x04a1('0x10')](0x1f4,_0x12e67e[_0x04a1('0x12')]));});});});}; \ No newline at end of file +var _0xf593=['limit','include','map','model','attributes','then','ShowCmHopper','find','stringify','create','CreateCmHopper','UpdateCmHopper','update','body','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','LOCK','Agent','name','voicePause','length','UserId','includes','push','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','order','UPDATE','all','GetCmHopperPreview','keys','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where'];(function(_0x2d03d0,_0x529ee7){var _0x43b480=function(_0x10a2bc){while(--_0x10a2bc){_0x2d03d0['push'](_0x2d03d0['shift']());}};_0x43b480(++_0x529ee7);}(_0xf593,0x71));var _0x3f59=function(_0x4ef716,_0x3cdfe6){_0x4ef716=_0x4ef716-0x0;var _0x2d65ff=_0xf593[_0x4ef716];return _0x2d65ff;};'use strict';var _=require(_0x3f59('0x0'));var util=require(_0x3f59('0x1'));var moment=require(_0x3f59('0x2'));var BPromise=require(_0x3f59('0x3'));var rs=require(_0x3f59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f59('0x5'))['db'];var utils=require(_0x3f59('0x6'));var logger=require(_0x3f59('0x7'))(_0x3f59('0x8'));var config=require(_0x3f59('0x9'));var jayson=require(_0x3f59('0xa'));var client=jayson['client'][_0x3f59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce4ec,_0x8a6e0a,_0x798e69){return new BPromise(function(_0x372e06,_0x57a8f6){return client[_0x3f59('0xc')](_0x4ce4ec,_0x798e69)['then'](function(_0x3d734c){logger[_0x3f59('0xd')](_0x3f59('0xe'),_0x8a6e0a,_0x3f59('0xf'));logger[_0x3f59('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x8a6e0a,'request\x20sent',JSON['stringify'](_0x3d734c));if(_0x3d734c[_0x3f59('0x11')]){if(_0x3d734c['error']['code']===0x1f4){logger[_0x3f59('0x11')](_0x3f59('0xe'),_0x8a6e0a,_0x3d734c[_0x3f59('0x11')]['message']);return _0x57a8f6(_0x3d734c[_0x3f59('0x11')]['message']);}logger[_0x3f59('0x11')](_0x3f59('0xe'),_0x8a6e0a,_0x3d734c[_0x3f59('0x11')][_0x3f59('0x12')]);return _0x372e06(_0x3d734c[_0x3f59('0x11')][_0x3f59('0x12')]);}else{logger[_0x3f59('0xd')]('CmHopper,\x20%s,\x20%s',_0x8a6e0a,'request\x20sent');_0x372e06(_0x3d734c[_0x3f59('0x13')][_0x3f59('0x12')]);}})[_0x3f59('0x14')](function(_0xe391a5){logger[_0x3f59('0x11')]('CmHopper,\x20%s,\x20%s',_0x8a6e0a,_0xe391a5);_0x57a8f6(_0xe391a5);});});}exports[_0x3f59('0x15')]=function(_0x367463){var _0x2174a3=this;return new Promise(function(_0x5a7d07,_0x288903){return db[_0x3f59('0x16')][_0x3f59('0x17')]({'raw':_0x367463[_0x3f59('0x18')]?_0x367463[_0x3f59('0x18')][_0x3f59('0x19')]===undefined?!![]:![]:!![],'where':_0x367463['options']?_0x367463['options'][_0x3f59('0x1a')]||null:null,'attributes':_0x367463[_0x3f59('0x18')]?_0x367463[_0x3f59('0x18')]['attributes']||null:null,'limit':_0x367463[_0x3f59('0x18')]?_0x367463[_0x3f59('0x18')][_0x3f59('0x1b')]||null:null,'include':_0x367463[_0x3f59('0x18')]?_0x367463[_0x3f59('0x18')][_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x367463[_0x3f59('0x18')][_0x3f59('0x1c')],function(_0x29c791){return{'model':db[_0x29c791[_0x3f59('0x1e')]],'as':_0x29c791['as'],'attributes':_0x29c791[_0x3f59('0x1f')],'include':_0x29c791[_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x29c791['include'],function(_0x5833ac){return{'model':db[_0x5833ac[_0x3f59('0x1e')]],'as':_0x5833ac['as'],'attributes':_0x5833ac[_0x3f59('0x1f')],'include':_0x5833ac['include']?_[_0x3f59('0x1d')](_0x5833ac[_0x3f59('0x1c')],function(_0x48f1e2){return{'model':db[_0x48f1e2['model']],'as':_0x48f1e2['as'],'attributes':_0x48f1e2[_0x3f59('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3f59('0x20')](function(_0x5f4c19){logger[_0x3f59('0xd')](_0x3f59('0x15'),_0x367463);logger[_0x3f59('0x10')]('GetCmHopper',_0x367463,JSON['stringify'](_0x5f4c19));_0x5a7d07(_0x5f4c19);})[_0x3f59('0x14')](function(_0x213fd8){logger['error']('GetCmHopper',_0x213fd8[_0x3f59('0x12')],_0x367463);_0x288903(_0x2174a3[_0x3f59('0x11')](0x1f4,_0x213fd8[_0x3f59('0x12')]));});});};exports[_0x3f59('0x21')]=function(_0x17cd76){var _0x14b4fc=this;return new Promise(function(_0x363796,_0x4dfcb2){return db['CmHopper'][_0x3f59('0x22')]({'raw':_0x17cd76[_0x3f59('0x18')]?_0x17cd76[_0x3f59('0x18')][_0x3f59('0x19')]===undefined?!![]:![]:!![],'where':_0x17cd76[_0x3f59('0x18')]?_0x17cd76[_0x3f59('0x18')][_0x3f59('0x1a')]||null:null,'attributes':_0x17cd76[_0x3f59('0x18')]?_0x17cd76[_0x3f59('0x18')][_0x3f59('0x1f')]||null:null,'include':_0x17cd76[_0x3f59('0x18')]?_0x17cd76[_0x3f59('0x18')][_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x17cd76[_0x3f59('0x18')][_0x3f59('0x1c')],function(_0xf63545){return{'model':db[_0xf63545[_0x3f59('0x1e')]],'as':_0xf63545['as'],'attributes':_0xf63545[_0x3f59('0x1f')],'include':_0xf63545[_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0xf63545[_0x3f59('0x1c')],function(_0x2989ed){return{'model':db[_0x2989ed['model']],'as':_0x2989ed['as'],'attributes':_0x2989ed[_0x3f59('0x1f')],'include':_0x2989ed[_0x3f59('0x1c')]?_['map'](_0x2989ed['include'],function(_0x3d3b5c){return{'model':db[_0x3d3b5c[_0x3f59('0x1e')]],'as':_0x3d3b5c['as'],'attributes':_0x3d3b5c[_0x3f59('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3f59('0x20')](function(_0x20b73c){logger[_0x3f59('0xd')]('ShowCmHopper',_0x17cd76);logger['debug']('ShowCmHopper',_0x17cd76,JSON[_0x3f59('0x23')](_0x20b73c));_0x363796(_0x20b73c);})[_0x3f59('0x14')](function(_0xc5cbe9){logger[_0x3f59('0x11')](_0x3f59('0x21'),_0xc5cbe9[_0x3f59('0x12')],_0x17cd76);_0x4dfcb2(_0x14b4fc[_0x3f59('0x11')](0x1f4,_0xc5cbe9[_0x3f59('0x12')]));});});};exports['CreateCmHopper']=function(_0x2f5e6a){var _0x3784ab=this;return new Promise(function(_0xc70f46,_0x5c8a3b){return db[_0x3f59('0x16')][_0x3f59('0x24')](_0x2f5e6a['body'],{'raw':_0x2f5e6a[_0x3f59('0x18')]?_0x2f5e6a[_0x3f59('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4cda65){logger[_0x3f59('0xd')]('CreateCmHopper',_0x2f5e6a);logger[_0x3f59('0x10')](_0x3f59('0x25'),_0x2f5e6a,JSON[_0x3f59('0x23')](_0x4cda65));_0xc70f46(_0x4cda65);})['catch'](function(_0x1617ce){logger[_0x3f59('0x11')]('CreateCmHopper',_0x1617ce[_0x3f59('0x12')],_0x2f5e6a);_0x5c8a3b(_0x3784ab['error'](0x1f4,_0x1617ce[_0x3f59('0x12')]));});});};exports[_0x3f59('0x26')]=function(_0x2044b1){var _0x31d9d9=this;return new Promise(function(_0x34c107,_0x2c66d8){return db[_0x3f59('0x16')][_0x3f59('0x27')](_0x2044b1[_0x3f59('0x28')],{'raw':_0x2044b1[_0x3f59('0x18')]?_0x2044b1[_0x3f59('0x18')][_0x3f59('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2044b1['options']?_0x2044b1['options'][_0x3f59('0x1a')]||null:null,'attributes':_0x2044b1[_0x3f59('0x18')]?_0x2044b1[_0x3f59('0x18')][_0x3f59('0x1f')]||null:null,'limit':_0x2044b1['options']?_0x2044b1['options'][_0x3f59('0x1b')]||null:null})[_0x3f59('0x20')](function(_0x5088eb){logger[_0x3f59('0xd')](_0x3f59('0x26'),_0x2044b1);logger[_0x3f59('0x10')](_0x3f59('0x26'),_0x2044b1,JSON['stringify'](_0x5088eb));_0x34c107(_0x5088eb);})['catch'](function(_0x4a2af2){logger[_0x3f59('0x11')](_0x3f59('0x26'),_0x4a2af2[_0x3f59('0x12')],_0x2044b1);_0x2c66d8(_0x31d9d9[_0x3f59('0x11')](0x1f4,_0x4a2af2[_0x3f59('0x12')]));});});};exports[_0x3f59('0x29')]=function(_0x131bad){var _0x599b72=this;return new Promise(function(_0x2278aa,_0x30f64e){return db[_0x3f59('0x16')][_0x3f59('0x2a')]({'where':_0x131bad[_0x3f59('0x18')]?_0x131bad[_0x3f59('0x18')][_0x3f59('0x1a')]||null:null})[_0x3f59('0x20')](function(_0x2fe61b){logger[_0x3f59('0xd')](_0x3f59('0x29'),_0x131bad);logger[_0x3f59('0x10')](_0x3f59('0x29'),_0x131bad,JSON[_0x3f59('0x23')](_0x2fe61b));_0x2278aa(_0x2fe61b);})[_0x3f59('0x14')](function(_0x36638e){logger[_0x3f59('0x11')]('DestroyCmHopper',_0x36638e[_0x3f59('0x12')],_0x131bad);_0x30f64e(_0x599b72[_0x3f59('0x11')](0x1f4,_0x36638e[_0x3f59('0x12')]));});});};exports['GetContactDialer']=function(_0x56d846){var _0x503fb4=this;return new Promise(function(_0x4c1b51,_0x1cb1f5){return db[_0x3f59('0x2b')][_0x3f59('0x2c')]()[_0x3f59('0x20')](function(_0x87925a){return db[_0x3f59('0x2d')][_0x3f59('0x2e')](function(_0x22f78f){return db[_0x3f59('0x16')]['findAll']({'where':_0x56d846['options']?_0x56d846[_0x3f59('0x18')]['where']||null:null,'attributes':_0x56d846[_0x3f59('0x18')]?_0x56d846[_0x3f59('0x18')][_0x3f59('0x1f')]||null:null,'limit':_0x56d846['options']?_0x56d846['options'][_0x3f59('0x1b')]||null:null,'order':_0x56d846[_0x3f59('0x18')]?_0x56d846[_0x3f59('0x18')]['order']||null:null,'transaction':_0x22f78f,'lock':_0x22f78f[_0x3f59('0x2f')]['UPDATE'],'include':[{'model':db[_0x3f59('0x2b')],'as':'Contact','attributes':_['keys'](_0x87925a)},{'model':db['User'],'as':_0x3f59('0x30'),'attributes':['id',_0x3f59('0x31'),_0x3f59('0x32')]}]})[_0x3f59('0x20')](function(_0x35804){var _0x5b0a30=[];var _0x5ed2a6=[];for(var _0x5c20e9=0x0;_0x5c20e9<_0x35804[_0x3f59('0x33')];_0x5c20e9+=0x1){var _0x180dee=_0x35804[_0x5c20e9][_0x3f59('0x34')];if(_0x180dee===null){_0x5b0a30['push'](_0x35804[_0x5c20e9]['update'](_0x56d846[_0x3f59('0x28')],{'transaction':_0x22f78f}));}else if(!_0x5ed2a6[_0x3f59('0x35')](_0x180dee)){_0x5ed2a6['push'](_0x180dee);_0x5b0a30[_0x3f59('0x36')](_0x35804[_0x5c20e9][_0x3f59('0x27')](_0x56d846[_0x3f59('0x28')],{'transaction':_0x22f78f}));}}return BPromise['all'](_0x5b0a30);});})[_0x3f59('0x20')](function(_0x5eccc1){logger['info'](_0x3f59('0x37'),_0x56d846);logger[_0x3f59('0x10')]('GetContactDialer',_0x56d846,JSON[_0x3f59('0x23')](_0x5eccc1));_0x4c1b51(_0x5eccc1);})[_0x3f59('0x14')](function(_0x34747b){logger[_0x3f59('0x11')]('GetContactDialer',_0x34747b[_0x3f59('0x12')],_0x56d846);_0x1cb1f5(_0x503fb4[_0x3f59('0x11')](0x1f4,_0x34747b[_0x3f59('0x12')]));});});});};exports[_0x3f59('0x38')]=function(_0x59b4f1){var _0x1e554b=this;return new Promise(function(_0x2d154e,_0x2347b2){return db['sequelize']['transaction'](function(_0x3eb3a6){return db[_0x3f59('0x39')][_0x3f59('0x24')](_0x59b4f1[_0x3f59('0x28')],{'raw':_0x59b4f1['options']?_0x59b4f1['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3eb3a6})[_0x3f59('0x20')](function(){return db[_0x3f59('0x16')][_0x3f59('0x2a')]({'where':_0x59b4f1[_0x3f59('0x18')]?_0x59b4f1[_0x3f59('0x18')][_0x3f59('0x1a')]||null:null,'transaction':_0x3eb3a6});});})[_0x3f59('0x20')](function(_0x36fc24){logger[_0x3f59('0xd')](_0x3f59('0x38'),_0x59b4f1);logger[_0x3f59('0x10')](_0x3f59('0x38'),_0x59b4f1,JSON[_0x3f59('0x23')](_0x36fc24));_0x2d154e(_0x36fc24);})['catch'](function(_0x401990){logger['error'](_0x3f59('0x38'),_0x401990[_0x3f59('0x12')],_0x59b4f1);_0x2347b2(_0x1e554b[_0x3f59('0x11')](0x1f4,_0x401990['message']));});});};exports[_0x3f59('0x3a')]=function(_0x3f877c){var _0x174da3=this;return new Promise(function(_0x31473c,_0x406cb5){return db[_0x3f59('0x16')]['findAll']({'raw':_0x3f877c[_0x3f59('0x18')]?_0x3f877c[_0x3f59('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f877c[_0x3f59('0x18')]?_0x3f877c[_0x3f59('0x18')][_0x3f59('0x1a')]||null:null,'attributes':[[db[_0x3f59('0x2d')]['fn']('COUNT',db[_0x3f59('0x2d')]['fn']('IF',db[_0x3f59('0x2d')][_0x3f59('0x3b')](_0x3f59('0x3c')+util[_0x3f59('0x3d')](_0x3f59('0x3e'),moment()['format'](_0x3f59('0x3f')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x3f59('0x20')](function(_0x6c4bc4){logger[_0x3f59('0xd')](_0x3f59('0x3a'),_0x3f877c);logger[_0x3f59('0x10')]('CountReScheduled',_0x3f877c,JSON[_0x3f59('0x23')](_0x6c4bc4));_0x31473c(_0x6c4bc4);})[_0x3f59('0x14')](function(_0x5ee999){logger[_0x3f59('0x11')]('CountReScheduled',_0x5ee999[_0x3f59('0x12')],_0x3f877c);_0x406cb5(_0x174da3[_0x3f59('0x11')](0x1f4,_0x5ee999[_0x3f59('0x12')]));});});};exports[_0x3f59('0x40')]=function(_0xcb86ee){var _0x2b8ecb=this;return new Promise(function(_0x39875e,_0x5bbb62){return db[_0x3f59('0x2b')][_0x3f59('0x2c')]()[_0x3f59('0x20')](function(_0x55b4ba){return db[_0x3f59('0x2d')][_0x3f59('0x2e')](function(_0x1b1fc7){return db['CmHopper']['findAll']({'where':_0xcb86ee[_0x3f59('0x18')]?_0xcb86ee[_0x3f59('0x18')][_0x3f59('0x1a')]||null:null,'attributes':_0xcb86ee[_0x3f59('0x18')]?_0xcb86ee[_0x3f59('0x18')][_0x3f59('0x1f')]||null:null,'limit':0x1,'order':_0xcb86ee[_0x3f59('0x18')]?_0xcb86ee[_0x3f59('0x18')][_0x3f59('0x41')]||null:null,'group':db[_0x3f59('0x16')][_0x3f59('0x34')],'transaction':_0x1b1fc7,'lock':_0x1b1fc7['LOCK'][_0x3f59('0x42')],'include':_0xcb86ee['options']?_0xcb86ee[_0x3f59('0x18')][_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0xcb86ee[_0x3f59('0x18')][_0x3f59('0x1c')],function(_0x42b5cc){return{'model':db[_0x42b5cc[_0x3f59('0x1e')]],'as':_0x42b5cc['as'],'attributes':_0x42b5cc[_0x3f59('0x1f')],'include':_0x42b5cc[_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x42b5cc[_0x3f59('0x1c')],function(_0x3cd020){return{'model':db[_0x3cd020[_0x3f59('0x1e')]],'as':_0x3cd020['as'],'attributes':_0x3cd020[_0x3f59('0x1f')],'include':_0x3cd020[_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x3cd020[_0x3f59('0x1c')],function(_0x37e44f){return{'model':db[_0x37e44f['model']],'as':_0x37e44f['as'],'attributes':_0x37e44f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f59('0x20')](function(_0x4322e5){var _0x3aef8e=[];for(var _0x598deb=0x0;_0x598deb<_0x4322e5[_0x3f59('0x33')];_0x598deb+=0x1){_0x3aef8e[_0x3f59('0x36')](_0x4322e5[_0x598deb][_0x3f59('0x27')](_0xcb86ee[_0x3f59('0x28')],{'transaction':_0x1b1fc7}));}return BPromise[_0x3f59('0x43')](_0x3aef8e);});})[_0x3f59('0x20')](function(_0x470bb6){logger[_0x3f59('0xd')](_0x3f59('0x40'),_0xcb86ee);logger[_0x3f59('0x10')]('GetContactRecallMe',_0xcb86ee,JSON[_0x3f59('0x23')](_0x470bb6));_0x39875e(_0x470bb6);})[_0x3f59('0x14')](function(_0x593d54){logger[_0x3f59('0x11')]('GetContactRecallMe',_0x593d54[_0x3f59('0x12')],_0xcb86ee);_0x5bbb62(_0x2b8ecb[_0x3f59('0x11')](0x1f4,_0x593d54[_0x3f59('0x12')]));});});});};exports[_0x3f59('0x44')]=function(_0x59451f){var _0x2bc6b6=this;return new Promise(function(_0x5a038f,_0x2cbdc5){db[_0x3f59('0x2b')][_0x3f59('0x2c')]()[_0x3f59('0x20')](function(_0x2b08f8){return db[_0x3f59('0x16')]['findAll']({'raw':_0x59451f[_0x3f59('0x18')]?_0x59451f[_0x3f59('0x18')][_0x3f59('0x19')]===undefined?!![]:![]:!![],'where':_0x59451f[_0x3f59('0x18')]?_0x59451f['options']['where']||null:null,'attributes':_0x59451f[_0x3f59('0x18')]?_0x59451f[_0x3f59('0x18')][_0x3f59('0x1f')]||null:null,'limit':_0x59451f[_0x3f59('0x18')]?_0x59451f[_0x3f59('0x18')][_0x3f59('0x1b')]||null:null,'include':_0x59451f['options']?_0x59451f['options'][_0x3f59('0x1c')]?_['map'](_0x59451f[_0x3f59('0x18')][_0x3f59('0x1c')],function(_0x439ce2){return{'model':db[_0x439ce2[_0x3f59('0x1e')]],'as':_0x439ce2['as'],'attributes':_0x439ce2['as']==='Contact'?_[_0x3f59('0x45')](_0x2b08f8):_0x439ce2[_0x3f59('0x1f')],'include':_0x439ce2[_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x439ce2[_0x3f59('0x1c')],function(_0x4f0010){return{'model':db[_0x4f0010[_0x3f59('0x1e')]],'as':_0x4f0010['as'],'attributes':_0x4f0010[_0x3f59('0x1f')],'include':_0x4f0010[_0x3f59('0x1c')]?_[_0x3f59('0x1d')](_0x4f0010[_0x3f59('0x1c')],function(_0x2fc76d){return{'model':db[_0x2fc76d[_0x3f59('0x1e')]],'as':_0x2fc76d['as'],'attributes':_0x2fc76d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x394056){logger[_0x3f59('0xd')](_0x3f59('0x15'),_0x59451f);logger['debug']('GetCmHopper',_0x59451f,JSON[_0x3f59('0x23')](_0x394056));_0x5a038f(_0x394056);})[_0x3f59('0x14')](function(_0xa44263){logger[_0x3f59('0x11')](_0x3f59('0x15'),_0xa44263['message'],_0x59451f);_0x2cbdc5(_0x2bc6b6[_0x3f59('0x11')](0x1f4,_0xa44263[_0x3f59('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 35a9bf1..712cf12 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 _0x0597=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/opencontacts','isAuthenticated','/:id','post','/preview','getPreview'];(function(_0x388108,_0x59e163){var _0x399317=function(_0x47ac27){while(--_0x47ac27){_0x388108['push'](_0x388108['shift']());}};_0x399317(++_0x59e163);}(_0x0597,0x114));var _0x7059=function(_0x372e7e,_0x3d7564){_0x372e7e=_0x372e7e-0x0;var _0x135cb9=_0x0597[_0x372e7e];return _0x135cb9;};'use strict';var multer=require(_0x7059('0x0'));var util=require(_0x7059('0x1'));var path=require(_0x7059('0x2'));var timeout=require('connect-timeout');var express=require(_0x7059('0x3'));var router=express[_0x7059('0x4')]();var fs_extra=require(_0x7059('0x5'));var auth=require(_0x7059('0x6'));var interaction=require(_0x7059('0x7'));var config=require(_0x7059('0x8'));var controller=require(_0x7059('0x9'));router[_0x7059('0xa')]('/',auth['isAuthenticated'](),controller[_0x7059('0xb')]);router[_0x7059('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7059('0xa')](_0x7059('0xc'),auth[_0x7059('0xd')](),controller['getOpenContacts']);router[_0x7059('0xa')](_0x7059('0xe'),auth[_0x7059('0xd')](),controller['show']);router[_0x7059('0xf')]('/',auth[_0x7059('0xd')](),controller['create']);router[_0x7059('0xf')](_0x7059('0x10'),auth[_0x7059('0xd')](),controller[_0x7059('0x11')]);router['put'](_0x7059('0xe'),auth[_0x7059('0xd')](),controller[_0x7059('0x12')]);router[_0x7059('0x13')](_0x7059('0xe'),auth[_0x7059('0xd')](),controller['destroy']);module[_0x7059('0x14')]=router; \ No newline at end of file +var _0xbf62=['../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/opencontacts','/:id','show','post','create','/preview','getPreview','put','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x11ad65,_0x352d3c){var _0x35590c=function(_0x2c3845){while(--_0x2c3845){_0x11ad65['push'](_0x11ad65['shift']());}};_0x35590c(++_0x352d3c);}(_0xbf62,0xd6));var _0x2bf6=function(_0x19a4ac,_0x5d763d){_0x19a4ac=_0x19a4ac-0x0;var _0x8f3876=_0xbf62[_0x19a4ac];return _0x8f3876;};'use strict';var multer=require(_0x2bf6('0x0'));var util=require(_0x2bf6('0x1'));var path=require(_0x2bf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bf6('0x3'));var router=express['Router']();var fs_extra=require(_0x2bf6('0x4'));var auth=require(_0x2bf6('0x5'));var interaction=require(_0x2bf6('0x6'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router['get']('/',auth[_0x2bf6('0x7')](),controller[_0x2bf6('0x8')]);router[_0x2bf6('0x9')](_0x2bf6('0xa'),auth[_0x2bf6('0x7')](),controller[_0x2bf6('0xb')]);router[_0x2bf6('0x9')](_0x2bf6('0xc'),auth[_0x2bf6('0x7')](),controller['getOpenContacts']);router[_0x2bf6('0x9')](_0x2bf6('0xd'),auth[_0x2bf6('0x7')](),controller[_0x2bf6('0xe')]);router[_0x2bf6('0xf')]('/',auth[_0x2bf6('0x7')](),controller[_0x2bf6('0x10')]);router[_0x2bf6('0xf')](_0x2bf6('0x11'),auth[_0x2bf6('0x7')](),controller[_0x2bf6('0x12')]);router[_0x2bf6('0x13')](_0x2bf6('0xd'),auth[_0x2bf6('0x7')](),controller['update']);router['delete'](_0x2bf6('0xd'),auth['isAuthenticated'](),controller[_0x2bf6('0x14')]);module[_0x2bf6('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 02b31ec..fcfe983 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 _0x15cb=['STRING','contactListQueue','INTEGER','sequelize'];(function(_0x741427,_0x21fe4c){var _0x5e0a59=function(_0x2c4eb5){while(--_0x2c4eb5){_0x741427['push'](_0x741427['shift']());}};_0x5e0a59(++_0x21fe4c);}(_0x15cb,0x16f));var _0xb15c=function(_0x4dacc0,_0x56ff5d){_0x4dacc0=_0x4dacc0-0x0;var _0x44686d=_0x15cb[_0x4dacc0];return _0x44686d;};'use strict';var moment=require('moment');var Sequelize=require(_0xb15c('0x0'));module['exports']={'phone':{'type':Sequelize[_0xb15c('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xb15c('0x2')},'ListId':{'type':Sequelize[_0xb15c('0x3')],'unique':_0xb15c('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb15c('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x7953=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x5105a2,_0x5b6309){var _0x35fa31=function(_0x29a963){while(--_0x29a963){_0x5105a2['push'](_0x5105a2['shift']());}};_0x35fa31(++_0x5b6309);}(_0x7953,0x66));var _0x3795=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x7953[_0x4b91c4];return _0x25cb80;};'use strict';var moment=require(_0x3795('0x0'));var Sequelize=require(_0x3795('0x1'));module[_0x3795('0x2')]={'phone':{'type':Sequelize[_0x3795('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3795('0x4')],'unique':_0x3795('0x5')},'ListId':{'type':Sequelize[_0x3795('0x4')],'unique':_0x3795('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index db16599..de99e58 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 _0xfd7c=['map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','rows','params','length','includeAll','include','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','name','index','CmHopperBlack','rawAttributes','fieldName','type','key','model'];(function(_0x3b14a2,_0x842338){var _0x24a6d2=function(_0x2b2d87){while(--_0x2b2d87){_0x3b14a2['push'](_0x3b14a2['shift']());}};_0x24a6d2(++_0x842338);}(_0xfd7c,0xe2));var _0xcfd7=function(_0x5cbea4,_0x41636d){_0x5cbea4=_0x5cbea4-0x0;var _0x5185ae=_0xfd7c[_0x5cbea4];return _0x5185ae;};'use strict';var emlformat=require(_0xcfd7('0x0'));var rimraf=require(_0xcfd7('0x1'));var zipdir=require(_0xcfd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfd7('0x3'));var moment=require('moment');var BPromise=require(_0xcfd7('0x4'));var Mustache=require(_0xcfd7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcfd7('0x6'));var csv=require(_0xcfd7('0x7'));var ejs=require(_0xcfd7('0x8'));var fs=require('fs');var fs_extra=require(_0xcfd7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcfd7('0xa'));var deskjs=require(_0xcfd7('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcfd7('0xc'));var qs=require(_0xcfd7('0xd'));var as=require(_0xcfd7('0xe'));var hardwareService=require(_0xcfd7('0xf'));var logger=require('../../config/logger')(_0xcfd7('0x10'));var utils=require(_0xcfd7('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xcfd7('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4a1a,_0x47ef6b){_0x47ef6b=_0x47ef6b||0xcc;return function(_0x2db83a){if(_0x2db83a){return _0x5e4a1a['sendStatus'](_0x47ef6b);}return _0x5e4a1a[_0xcfd7('0x13')](_0x47ef6b)[_0xcfd7('0x14')]();};}function respondWithResult(_0xba2e5c,_0xda740a){_0xda740a=_0xda740a||0xc8;return function(_0x550814){if(_0x550814){return _0xba2e5c[_0xcfd7('0x13')](_0xda740a)[_0xcfd7('0x15')](_0x550814);}};}function respondWithFilteredResult(_0x36e80d,_0x224f06){return function(_0xd983db){if(_0xd983db){var _0x425988=typeof _0x224f06[_0xcfd7('0x16')]===_0xcfd7('0x17')&&typeof _0x224f06[_0xcfd7('0x18')]==='undefined';var _0x3a4fc4=_0xd983db[_0xcfd7('0x19')];var _0x3f4d48=_0x425988?0x0:_0x224f06[_0xcfd7('0x16')];var _0xb0a038=_0x425988?_0xd983db['count']:_0x224f06[_0xcfd7('0x16')]+_0x224f06['limit'];var _0x17f923;if(_0xb0a038>=_0x3a4fc4){_0xb0a038=_0x3a4fc4;_0x17f923=0xc8;}else{_0x17f923=0xce;}_0x36e80d[_0xcfd7('0x13')](_0x17f923);return _0x36e80d[_0xcfd7('0x1a')]('Content-Range',_0x3f4d48+'-'+_0xb0a038+'/'+_0x3a4fc4)['json'](_0xd983db);}return null;};}function patchUpdates(_0x2f6e21){return function(_0x45c5c6){try{jsonpatch['apply'](_0x45c5c6,_0x2f6e21,!![]);}catch(_0x141b65){return BPromise[_0xcfd7('0x1b')](_0x141b65);}return _0x45c5c6['save']();};}function saveUpdates(_0x10be80,_0x2033bb){return function(_0x5cac82){if(_0x5cac82){return _0x5cac82[_0xcfd7('0x1c')](_0x10be80)[_0xcfd7('0x1d')](function(_0x32a860){return _0x32a860;});}return null;};}function removeEntity(_0x2ec6f5,_0x3508db){return function(_0x29063e){if(_0x29063e){return _0x29063e[_0xcfd7('0x1e')]()['then'](function(){_0x2ec6f5[_0xcfd7('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x505350,_0x48757a){return function(_0x1c1fa7){if(!_0x1c1fa7){_0x505350[_0xcfd7('0x1f')](0x194);}return _0x1c1fa7;};}function handleError(_0x1e1ce0,_0x16b228){_0x16b228=_0x16b228||0x1f4;return function(_0x4215f9){logger[_0xcfd7('0x20')](_0x4215f9[_0xcfd7('0x21')]);if(_0x4215f9[_0xcfd7('0x22')]){delete _0x4215f9[_0xcfd7('0x22')];}_0x1e1ce0['status'](_0x16b228)['send'](_0x4215f9);};}exports[_0xcfd7('0x23')]=function(_0x501926,_0x2ddb9a){var _0x50ff0f={},_0xfe4a9f={},_0x1b56c6={'count':0x0,'rows':[]};var _0x47837c=_['map'](db[_0xcfd7('0x24')][_0xcfd7('0x25')],function(_0x411732){return{'name':_0x411732[_0xcfd7('0x26')],'type':_0x411732[_0xcfd7('0x27')][_0xcfd7('0x28')]};});_0xfe4a9f[_0xcfd7('0x29')]=_[_0xcfd7('0x2a')](_0x47837c,'name');_0xfe4a9f['query']=_[_0xcfd7('0x2b')](_0x501926[_0xcfd7('0x2c')]);_0xfe4a9f[_0xcfd7('0x2d')]=_[_0xcfd7('0x2e')](_0xfe4a9f[_0xcfd7('0x29')],_0xfe4a9f[_0xcfd7('0x2c')]);_0x50ff0f['attributes']=_['intersection'](_0xfe4a9f['model'],qs[_0xcfd7('0x2f')](_0x501926[_0xcfd7('0x2c')][_0xcfd7('0x2f')]));_0x50ff0f[_0xcfd7('0x30')]=_0x50ff0f[_0xcfd7('0x30')]['length']?_0x50ff0f[_0xcfd7('0x30')]:_0xfe4a9f[_0xcfd7('0x29')];if(!_0x501926[_0xcfd7('0x2c')][_0xcfd7('0x31')](_0xcfd7('0x32'))){_0x50ff0f[_0xcfd7('0x18')]=qs[_0xcfd7('0x18')](_0x501926['query']['limit']);_0x50ff0f[_0xcfd7('0x16')]=qs[_0xcfd7('0x16')](_0x501926[_0xcfd7('0x2c')][_0xcfd7('0x16')]);}_0x50ff0f[_0xcfd7('0x33')]=qs[_0xcfd7('0x34')](_0x501926[_0xcfd7('0x2c')][_0xcfd7('0x34')]);_0x50ff0f[_0xcfd7('0x35')]=qs[_0xcfd7('0x2d')](_[_0xcfd7('0x36')](_0x501926[_0xcfd7('0x2c')],_0xfe4a9f[_0xcfd7('0x2d')]),_0x47837c);if(_0x501926[_0xcfd7('0x2c')][_0xcfd7('0x37')]){_0x50ff0f[_0xcfd7('0x35')]=_['merge'](_0x50ff0f['where'],{'$or':_[_0xcfd7('0x2a')](_0x47837c,function(_0x5e6f41){if(_0x5e6f41[_0xcfd7('0x27')]!==_0xcfd7('0x38')){var _0x9e1c50={};_0x9e1c50[_0x5e6f41[_0xcfd7('0x22')]]={'$like':'%'+_0x501926[_0xcfd7('0x2c')][_0xcfd7('0x37')]+'%'};return _0x9e1c50;}})});}_0x50ff0f=_['merge']({},_0x50ff0f,_0x501926[_0xcfd7('0x39')]);var _0x566418={'where':_0x50ff0f[_0xcfd7('0x35')]};return db['CmHopperBlack'][_0xcfd7('0x19')](_0x566418)[_0xcfd7('0x1d')](function(_0x446ed9){_0x1b56c6[_0xcfd7('0x19')]=_0x446ed9;if(_0x501926[_0xcfd7('0x2c')]['includeAll']){_0x50ff0f['include']=[{'all':!![]}];}return db[_0xcfd7('0x24')]['findAll'](_0x50ff0f);})[_0xcfd7('0x1d')](function(_0x5d1b53){_0x1b56c6[_0xcfd7('0x3a')]=_0x5d1b53;return _0x1b56c6;})[_0xcfd7('0x1d')](respondWithFilteredResult(_0x2ddb9a,_0x50ff0f))['catch'](handleError(_0x2ddb9a,null));};exports['show']=function(_0x3c9712,_0x3a88c3){var _0x1336e4={'raw':!![],'where':{'id':_0x3c9712[_0xcfd7('0x3b')]['id']}},_0x18c0c3={};_0x18c0c3[_0xcfd7('0x29')]=_[_0xcfd7('0x2b')](db['CmHopperBlack']['rawAttributes']);_0x18c0c3[_0xcfd7('0x2c')]=_['keys'](_0x3c9712[_0xcfd7('0x2c')]);_0x18c0c3[_0xcfd7('0x2d')]=_[_0xcfd7('0x2e')](_0x18c0c3[_0xcfd7('0x29')],_0x18c0c3[_0xcfd7('0x2c')]);_0x1336e4[_0xcfd7('0x30')]=_['intersection'](_0x18c0c3[_0xcfd7('0x29')],qs[_0xcfd7('0x2f')](_0x3c9712[_0xcfd7('0x2c')]['fields']));_0x1336e4[_0xcfd7('0x30')]=_0x1336e4['attributes'][_0xcfd7('0x3c')]?_0x1336e4[_0xcfd7('0x30')]:_0x18c0c3[_0xcfd7('0x29')];if(_0x3c9712[_0xcfd7('0x2c')][_0xcfd7('0x3d')]){_0x1336e4[_0xcfd7('0x3e')]=[{'all':!![]}];}_0x1336e4=_['merge']({},_0x1336e4,_0x3c9712[_0xcfd7('0x39')]);return db[_0xcfd7('0x24')][_0xcfd7('0x3f')](_0x1336e4)['then'](handleEntityNotFound(_0x3a88c3,null))[_0xcfd7('0x1d')](respondWithResult(_0x3a88c3,null))[_0xcfd7('0x40')](handleError(_0x3a88c3,null));};exports[_0xcfd7('0x1c')]=function(_0x3ef169,_0x2f3d17){if(_0x3ef169[_0xcfd7('0x41')]['id']){delete _0x3ef169[_0xcfd7('0x41')]['id'];}return db[_0xcfd7('0x24')][_0xcfd7('0x3f')]({'where':{'id':_0x3ef169[_0xcfd7('0x3b')]['id']}})[_0xcfd7('0x1d')](handleEntityNotFound(_0x2f3d17,null))[_0xcfd7('0x1d')](saveUpdates(_0x3ef169[_0xcfd7('0x41')],null))[_0xcfd7('0x1d')](respondWithResult(_0x2f3d17,null))[_0xcfd7('0x40')](handleError(_0x2f3d17,null));};exports[_0xcfd7('0x1e')]=function(_0xa43cfd,_0x29caef){return db[_0xcfd7('0x24')]['find']({'where':{'id':_0xa43cfd[_0xcfd7('0x3b')]['id']}})[_0xcfd7('0x1d')](handleEntityNotFound(_0x29caef,null))['then'](removeEntity(_0x29caef,null))[_0xcfd7('0x40')](handleError(_0x29caef,null));};exports[_0xcfd7('0x42')]=function(_0x1e49ba,_0x9f7a6c){return db[_0xcfd7('0x24')]['describe']()[_0xcfd7('0x1d')](respondWithResult(_0x9f7a6c,null))['catch'](handleError(_0x9f7a6c,null));}; \ No newline at end of file +var _0xc7ca=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','nolimit','limit','order','where','pick','filter','type','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','catch','show','params','keys','merge','body','find','describe'];(function(_0x79eded,_0xb368d5){var _0x3327e2=function(_0x51b4c1){while(--_0x51b4c1){_0x79eded['push'](_0x79eded['shift']());}};_0x3327e2(++_0xb368d5);}(_0xc7ca,0x1c8));var _0xac7c=function(_0x310b76,_0x4d5607){_0x310b76=_0x310b76-0x0;var _0x20729f=_0xc7ca[_0x310b76];return _0x20729f;};'use strict';var emlformat=require(_0xac7c('0x0'));var rimraf=require(_0xac7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7c('0x2'));var rp=require(_0xac7c('0x3'));var moment=require(_0xac7c('0x4'));var BPromise=require(_0xac7c('0x5'));var Mustache=require('mustache');var util=require(_0xac7c('0x6'));var path=require(_0xac7c('0x7'));var sox=require(_0xac7c('0x8'));var csv=require('to-csv');var ejs=require(_0xac7c('0x9'));var fs=require('fs');var fs_extra=require(_0xac7c('0xa'));var _=require(_0xac7c('0xb'));var squel=require(_0xac7c('0xc'));var crypto=require(_0xac7c('0xd'));var jsforce=require(_0xac7c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xac7c('0xf'));var querystring=require(_0xac7c('0x10'));var Papa=require(_0xac7c('0x11'));var Redis=require(_0xac7c('0x12'));var authService=require(_0xac7c('0x13'));var qs=require(_0xac7c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac7c('0x15'));var logger=require('../../config/logger')(_0xac7c('0x16'));var utils=require(_0xac7c('0x17'));var config=require(_0xac7c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xac7c('0x19'))['db'];function respondWithStatusCode(_0x2d2365,_0xad117c){_0xad117c=_0xad117c||0xcc;return function(_0x431127){if(_0x431127){return _0x2d2365[_0xac7c('0x1a')](_0xad117c);}return _0x2d2365[_0xac7c('0x1b')](_0xad117c)[_0xac7c('0x1c')]();};}function respondWithResult(_0x259bdd,_0x3535f8){_0x3535f8=_0x3535f8||0xc8;return function(_0x28f500){if(_0x28f500){return _0x259bdd['status'](_0x3535f8)[_0xac7c('0x1d')](_0x28f500);}};}function respondWithFilteredResult(_0x2ea718,_0x159a23){return function(_0x419a3b){if(_0x419a3b){var _0x56368c=typeof _0x159a23[_0xac7c('0x1e')]===_0xac7c('0x1f')&&typeof _0x159a23['limit']===_0xac7c('0x1f');var _0x2a0c3c=_0x419a3b[_0xac7c('0x20')];var _0x1ac3bf=_0x56368c?0x0:_0x159a23['offset'];var _0x917b12=_0x56368c?_0x419a3b['count']:_0x159a23[_0xac7c('0x1e')]+_0x159a23['limit'];var _0x222dcf;if(_0x917b12>=_0x2a0c3c){_0x917b12=_0x2a0c3c;_0x222dcf=0xc8;}else{_0x222dcf=0xce;}_0x2ea718[_0xac7c('0x1b')](_0x222dcf);return _0x2ea718[_0xac7c('0x21')](_0xac7c('0x22'),_0x1ac3bf+'-'+_0x917b12+'/'+_0x2a0c3c)[_0xac7c('0x1d')](_0x419a3b);}return null;};}function patchUpdates(_0x51ab59){return function(_0x130262){try{jsonpatch[_0xac7c('0x23')](_0x130262,_0x51ab59,!![]);}catch(_0x33ace6){return BPromise[_0xac7c('0x24')](_0x33ace6);}return _0x130262['save']();};}function saveUpdates(_0x3ea6d3,_0x306b2a){return function(_0x5e4ecf){if(_0x5e4ecf){return _0x5e4ecf[_0xac7c('0x25')](_0x3ea6d3)[_0xac7c('0x26')](function(_0x519896){return _0x519896;});}return null;};}function removeEntity(_0x2fa42b,_0x53b34d){return function(_0x1740b3){if(_0x1740b3){return _0x1740b3[_0xac7c('0x27')]()[_0xac7c('0x26')](function(){_0x2fa42b[_0xac7c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b180c,_0x99af60){return function(_0x264b89){if(!_0x264b89){_0x2b180c[_0xac7c('0x1a')](0x194);}return _0x264b89;};}function handleError(_0x3bb263,_0x454a33){_0x454a33=_0x454a33||0x1f4;return function(_0x440ba6){logger[_0xac7c('0x28')](_0x440ba6['stack']);if(_0x440ba6[_0xac7c('0x29')]){delete _0x440ba6[_0xac7c('0x29')];}_0x3bb263[_0xac7c('0x1b')](_0x454a33)[_0xac7c('0x2a')](_0x440ba6);};}exports[_0xac7c('0x2b')]=function(_0x4ed3ad,_0x2f2912){var _0x53da83={},_0x4ab9e7={},_0xa6853a={'count':0x0,'rows':[]};var _0x3a6cc2=_[_0xac7c('0x2c')](db['CmHopperBlack'][_0xac7c('0x2d')],function(_0x33b753){return{'name':_0x33b753[_0xac7c('0x2e')],'type':_0x33b753['type'][_0xac7c('0x2f')]};});_0x4ab9e7[_0xac7c('0x30')]=_[_0xac7c('0x2c')](_0x3a6cc2,'name');_0x4ab9e7['query']=_['keys'](_0x4ed3ad['query']);_0x4ab9e7[_0xac7c('0x31')]=_[_0xac7c('0x32')](_0x4ab9e7[_0xac7c('0x30')],_0x4ab9e7[_0xac7c('0x33')]);_0x53da83[_0xac7c('0x34')]=_['intersection'](_0x4ab9e7[_0xac7c('0x30')],qs[_0xac7c('0x35')](_0x4ed3ad[_0xac7c('0x33')]['fields']));_0x53da83[_0xac7c('0x34')]=_0x53da83[_0xac7c('0x34')][_0xac7c('0x36')]?_0x53da83[_0xac7c('0x34')]:_0x4ab9e7['model'];if(!_0x4ed3ad[_0xac7c('0x33')]['hasOwnProperty'](_0xac7c('0x37'))){_0x53da83['limit']=qs['limit'](_0x4ed3ad[_0xac7c('0x33')][_0xac7c('0x38')]);_0x53da83[_0xac7c('0x1e')]=qs[_0xac7c('0x1e')](_0x4ed3ad[_0xac7c('0x33')][_0xac7c('0x1e')]);}_0x53da83[_0xac7c('0x39')]=qs['sort'](_0x4ed3ad['query']['sort']);_0x53da83[_0xac7c('0x3a')]=qs[_0xac7c('0x31')](_[_0xac7c('0x3b')](_0x4ed3ad[_0xac7c('0x33')],_0x4ab9e7['filters']),_0x3a6cc2);if(_0x4ed3ad[_0xac7c('0x33')][_0xac7c('0x3c')]){_0x53da83[_0xac7c('0x3a')]=_['merge'](_0x53da83['where'],{'$or':_[_0xac7c('0x2c')](_0x3a6cc2,function(_0x84b3c0){if(_0x84b3c0[_0xac7c('0x3d')]!==_0xac7c('0x3e')){var _0x52a6b6={};_0x52a6b6[_0x84b3c0['name']]={'$like':'%'+_0x4ed3ad[_0xac7c('0x33')][_0xac7c('0x3c')]+'%'};return _0x52a6b6;}})});}_0x53da83=_['merge']({},_0x53da83,_0x4ed3ad[_0xac7c('0x3f')]);var _0x216f13={'where':_0x53da83[_0xac7c('0x3a')]};return db[_0xac7c('0x40')][_0xac7c('0x20')](_0x216f13)['then'](function(_0x213280){_0xa6853a[_0xac7c('0x20')]=_0x213280;if(_0x4ed3ad[_0xac7c('0x33')][_0xac7c('0x41')]){_0x53da83[_0xac7c('0x42')]=[{'all':!![]}];}return db[_0xac7c('0x40')][_0xac7c('0x43')](_0x53da83);})[_0xac7c('0x26')](function(_0x5e6b9f){_0xa6853a['rows']=_0x5e6b9f;return _0xa6853a;})[_0xac7c('0x26')](respondWithFilteredResult(_0x2f2912,_0x53da83))[_0xac7c('0x44')](handleError(_0x2f2912,null));};exports[_0xac7c('0x45')]=function(_0x5afe83,_0x2a6e67){var _0x39ea8d={'raw':!![],'where':{'id':_0x5afe83[_0xac7c('0x46')]['id']}},_0x26c374={};_0x26c374[_0xac7c('0x30')]=_[_0xac7c('0x47')](db['CmHopperBlack'][_0xac7c('0x2d')]);_0x26c374[_0xac7c('0x33')]=_[_0xac7c('0x47')](_0x5afe83['query']);_0x26c374[_0xac7c('0x31')]=_['intersection'](_0x26c374[_0xac7c('0x30')],_0x26c374[_0xac7c('0x33')]);_0x39ea8d['attributes']=_[_0xac7c('0x32')](_0x26c374[_0xac7c('0x30')],qs[_0xac7c('0x35')](_0x5afe83[_0xac7c('0x33')][_0xac7c('0x35')]));_0x39ea8d[_0xac7c('0x34')]=_0x39ea8d[_0xac7c('0x34')][_0xac7c('0x36')]?_0x39ea8d[_0xac7c('0x34')]:_0x26c374[_0xac7c('0x30')];if(_0x5afe83[_0xac7c('0x33')]['includeAll']){_0x39ea8d['include']=[{'all':!![]}];}_0x39ea8d=_[_0xac7c('0x48')]({},_0x39ea8d,_0x5afe83[_0xac7c('0x3f')]);return db['CmHopperBlack']['find'](_0x39ea8d)[_0xac7c('0x26')](handleEntityNotFound(_0x2a6e67,null))[_0xac7c('0x26')](respondWithResult(_0x2a6e67,null))[_0xac7c('0x44')](handleError(_0x2a6e67,null));};exports['update']=function(_0x409dec,_0x1f34e4){if(_0x409dec[_0xac7c('0x49')]['id']){delete _0x409dec['body']['id'];}return db[_0xac7c('0x40')][_0xac7c('0x4a')]({'where':{'id':_0x409dec['params']['id']}})[_0xac7c('0x26')](handleEntityNotFound(_0x1f34e4,null))['then'](saveUpdates(_0x409dec[_0xac7c('0x49')],null))[_0xac7c('0x26')](respondWithResult(_0x1f34e4,null))['catch'](handleError(_0x1f34e4,null));};exports[_0xac7c('0x27')]=function(_0x15bb69,_0x3450ab){return db[_0xac7c('0x40')][_0xac7c('0x4a')]({'where':{'id':_0x15bb69[_0xac7c('0x46')]['id']}})[_0xac7c('0x26')](handleEntityNotFound(_0x3450ab,null))[_0xac7c('0x26')](removeEntity(_0x3450ab,null))['catch'](handleError(_0x3450ab,null));};exports['describe']=function(_0x571419,_0x49cbbf){return db['CmHopperBlack'][_0xac7c('0x4b')]()[_0xac7c('0x26')](respondWithResult(_0x49cbbf,null))[_0xac7c('0x44')](handleError(_0x49cbbf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 9052a32..a88ba24 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 _0x8f43=['cm_hopper_black','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','CmHopperBlack'];(function(_0x1f854d,_0xee9b0d){var _0x26bed9=function(_0x1eaa2a){while(--_0x1eaa2a){_0x1f854d['push'](_0x1f854d['shift']());}};_0x26bed9(++_0xee9b0d);}(_0x8f43,0x135));var _0x38f4=function(_0x4772db,_0x3becdc){_0x4772db=_0x4772db-0x0;var _0x3f93db=_0x8f43[_0x4772db];return _0x3f93db;};'use strict';var _=require('lodash');var util=require(_0x38f4('0x0'));var logger=require(_0x38f4('0x1'))(_0x38f4('0x2'));var moment=require(_0x38f4('0x3'));var BPromise=require('bluebird');var rp=require(_0x38f4('0x4'));var fs=require('fs');var path=require(_0x38f4('0x5'));var rimraf=require('rimraf');var config=require(_0x38f4('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0x38f4('0x7')]=function(_0x32f4eb,_0x27852d){return _0x32f4eb[_0x38f4('0x8')](_0x38f4('0x9'),attributes,{'tableName':_0x38f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9284=['exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x551625,_0x35b24a){var _0x2f6e70=function(_0x33dbc8){while(--_0x33dbc8){_0x551625['push'](_0x551625['shift']());}};_0x2f6e70(++_0x35b24a);}(_0x9284,0x1d8));var _0x4928=function(_0x44814e,_0x4b68bf){_0x44814e=_0x44814e-0x0;var _0x4d2f8f=_0x9284[_0x44814e];return _0x4d2f8f;};'use strict';var _=require(_0x4928('0x0'));var util=require('util');var logger=require(_0x4928('0x1'))(_0x4928('0x2'));var moment=require(_0x4928('0x3'));var BPromise=require(_0x4928('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4928('0x5'));var rimraf=require(_0x4928('0x6'));var config=require(_0x4928('0x7'));var attributes=require(_0x4928('0x8'));module[_0x4928('0x9')]=function(_0x2d3b60,_0x52eb9c){return _0x2d3b60[_0x4928('0xa')](_0x4928('0xb'),attributes,{'tableName':_0x4928('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 7924732..887c636 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 _0xb983=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','where','attributes','limit','include','map','model','GetCmHopperBlack','catch','CmHopperBlack','update','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0xb983,0xdf));var _0x3b98=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0xb983[_0x237da8];return _0x558825;};'use strict';var _=require(_0x3b98('0x0'));var util=require(_0x3b98('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3b98('0x2'));var fs=require('fs');var Redis=require(_0x3b98('0x3'));var db=require(_0x3b98('0x4'))['db'];var utils=require(_0x3b98('0x5'));var logger=require(_0x3b98('0x6'))(_0x3b98('0x7'));var config=require(_0x3b98('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3b98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4380fe,_0x3b4230,_0x247385){return new BPromise(function(_0x42b318,_0x5a0687){return client[_0x3b98('0xa')](_0x4380fe,_0x247385)[_0x3b98('0xb')](function(_0x2ba4ee){logger[_0x3b98('0xc')](_0x3b98('0xd'),_0x3b4230,_0x3b98('0xe'));logger[_0x3b98('0xf')](_0x3b98('0x10'),_0x3b4230,_0x3b98('0xe'),JSON[_0x3b98('0x11')](_0x2ba4ee));if(_0x2ba4ee[_0x3b98('0x12')]){if(_0x2ba4ee[_0x3b98('0x12')][_0x3b98('0x13')]===0x1f4){logger['error'](_0x3b98('0xd'),_0x3b4230,_0x2ba4ee['error'][_0x3b98('0x14')]);return _0x5a0687(_0x2ba4ee[_0x3b98('0x12')][_0x3b98('0x14')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3b4230,_0x2ba4ee[_0x3b98('0x12')][_0x3b98('0x14')]);return _0x42b318(_0x2ba4ee[_0x3b98('0x12')][_0x3b98('0x14')]);}else{logger[_0x3b98('0xc')](_0x3b98('0xd'),_0x3b4230,'request\x20sent');_0x42b318(_0x2ba4ee[_0x3b98('0x15')][_0x3b98('0x14')]);}})['catch'](function(_0x2d2eec){logger[_0x3b98('0x12')](_0x3b98('0xd'),_0x3b4230,_0x2d2eec);_0x5a0687(_0x2d2eec);});});}exports['GetCmHopperBlack']=function(_0x4e772d){var _0x47a434=this;return new Promise(function(_0x5f53cd,_0x458a3b){return db['CmHopperBlack'][_0x3b98('0x16')]({'raw':_0x4e772d['options']?_0x4e772d[_0x3b98('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4e772d[_0x3b98('0x17')]?_0x4e772d[_0x3b98('0x17')][_0x3b98('0x18')]||null:null,'attributes':_0x4e772d[_0x3b98('0x17')]?_0x4e772d['options'][_0x3b98('0x19')]||null:null,'limit':_0x4e772d[_0x3b98('0x17')]?_0x4e772d[_0x3b98('0x17')][_0x3b98('0x1a')]||null:null,'include':_0x4e772d[_0x3b98('0x17')]?_0x4e772d['options'][_0x3b98('0x1b')]?_[_0x3b98('0x1c')](_0x4e772d[_0x3b98('0x17')][_0x3b98('0x1b')],function(_0x395e33){return{'model':db[_0x395e33[_0x3b98('0x1d')]],'as':_0x395e33['as'],'attributes':_0x395e33[_0x3b98('0x19')],'include':_0x395e33['include']?_[_0x3b98('0x1c')](_0x395e33[_0x3b98('0x1b')],function(_0x4c32ba){return{'model':db[_0x4c32ba[_0x3b98('0x1d')]],'as':_0x4c32ba['as'],'attributes':_0x4c32ba[_0x3b98('0x19')],'include':_0x4c32ba[_0x3b98('0x1b')]?_[_0x3b98('0x1c')](_0x4c32ba[_0x3b98('0x1b')],function(_0x1e73de){return{'model':db[_0x1e73de[_0x3b98('0x1d')]],'as':_0x1e73de['as'],'attributes':_0x1e73de[_0x3b98('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3b98('0xb')](function(_0x5250c8){logger['info'](_0x3b98('0x1e'),_0x4e772d);logger[_0x3b98('0xf')](_0x3b98('0x1e'),_0x4e772d,JSON[_0x3b98('0x11')](_0x5250c8));_0x5f53cd(_0x5250c8);})[_0x3b98('0x1f')](function(_0x158fba){logger[_0x3b98('0x12')](_0x3b98('0x1e'),_0x158fba[_0x3b98('0x14')],_0x4e772d);_0x458a3b(_0x47a434[_0x3b98('0x12')](0x1f4,_0x158fba[_0x3b98('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x58e55f){var _0x1ca02f=this;return new Promise(function(_0x1f04be,_0x3934d1){return db[_0x3b98('0x20')][_0x3b98('0x21')](_0x58e55f[_0x3b98('0x22')],{'raw':_0x58e55f[_0x3b98('0x17')]?_0x58e55f[_0x3b98('0x17')][_0x3b98('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58e55f[_0x3b98('0x17')]?_0x58e55f['options'][_0x3b98('0x18')]||null:null,'attributes':_0x58e55f[_0x3b98('0x17')]?_0x58e55f[_0x3b98('0x17')]['attributes']||null:null,'limit':_0x58e55f[_0x3b98('0x17')]?_0x58e55f[_0x3b98('0x17')][_0x3b98('0x1a')]||null:null})['then'](function(_0x4cbe24){logger[_0x3b98('0xc')](_0x3b98('0x24'),_0x58e55f);logger[_0x3b98('0xf')](_0x3b98('0x24'),_0x58e55f,JSON[_0x3b98('0x11')](_0x4cbe24));_0x1f04be(_0x4cbe24);})['catch'](function(_0x304bda){logger[_0x3b98('0x12')](_0x3b98('0x24'),_0x304bda['message'],_0x58e55f);_0x3934d1(_0x1ca02f['error'](0x1f4,_0x304bda['message']));});});};exports[_0x3b98('0x25')]=function(_0x5cbaec){var _0x12937d=this;return new Promise(function(_0x3d4033,_0x5f2ab5){return db[_0x3b98('0x20')]['destroy']({'where':_0x5cbaec[_0x3b98('0x17')]?_0x5cbaec[_0x3b98('0x17')]['where']||null:null})[_0x3b98('0xb')](function(_0x1d54d5){logger['info'](_0x3b98('0x25'),_0x5cbaec);logger[_0x3b98('0xf')](_0x3b98('0x25'),_0x5cbaec,JSON[_0x3b98('0x11')](_0x1d54d5));_0x3d4033(_0x1d54d5);})[_0x3b98('0x1f')](function(_0x4486b9){logger[_0x3b98('0x12')]('DestroyCmHopperBlack',_0x4486b9[_0x3b98('0x14')],_0x5cbaec);_0x5f2ab5(_0x12937d['error'](0x1f4,_0x4486b9[_0x3b98('0x14')]));});});}; \ No newline at end of file +var _0xcc86=['stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','update','body','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x3a80b2,_0x11e794){var _0x2894b2=function(_0x4119a2){while(--_0x4119a2){_0x3a80b2['push'](_0x3a80b2['shift']());}};_0x2894b2(++_0x11e794);}(_0xcc86,0xfb));var _0x6cc8=function(_0x30b060,_0x38cd42){_0x30b060=_0x30b060-0x0;var _0x1418c0=_0xcc86[_0x30b060];return _0x1418c0;};'use strict';var _=require(_0x6cc8('0x0'));var util=require('util');var moment=require(_0x6cc8('0x1'));var BPromise=require(_0x6cc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cc8('0x3'));var db=require(_0x6cc8('0x4'))['db'];var utils=require(_0x6cc8('0x5'));var logger=require(_0x6cc8('0x6'))(_0x6cc8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6cc8('0x8')][_0x6cc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44c4ab,_0x34b372,_0xbb9559){return new BPromise(function(_0x4e5d48,_0x428f69){return client['request'](_0x44c4ab,_0xbb9559)[_0x6cc8('0xa')](function(_0x370b72){logger[_0x6cc8('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x34b372,_0x6cc8('0xc'));logger[_0x6cc8('0xd')](_0x6cc8('0xe'),_0x34b372,_0x6cc8('0xc'),JSON[_0x6cc8('0xf')](_0x370b72));if(_0x370b72[_0x6cc8('0x10')]){if(_0x370b72[_0x6cc8('0x10')][_0x6cc8('0x11')]===0x1f4){logger[_0x6cc8('0x10')](_0x6cc8('0x12'),_0x34b372,_0x370b72['error']['message']);return _0x428f69(_0x370b72[_0x6cc8('0x10')][_0x6cc8('0x13')]);}logger[_0x6cc8('0x10')](_0x6cc8('0x12'),_0x34b372,_0x370b72[_0x6cc8('0x10')]['message']);return _0x4e5d48(_0x370b72[_0x6cc8('0x10')][_0x6cc8('0x13')]);}else{logger['info'](_0x6cc8('0x12'),_0x34b372,_0x6cc8('0xc'));_0x4e5d48(_0x370b72[_0x6cc8('0x14')]['message']);}})[_0x6cc8('0x15')](function(_0x308695){logger[_0x6cc8('0x10')](_0x6cc8('0x12'),_0x34b372,_0x308695);_0x428f69(_0x308695);});});}exports[_0x6cc8('0x16')]=function(_0x5d0252){var _0x44f747=this;return new Promise(function(_0x2e38a0,_0x2bc992){return db[_0x6cc8('0x17')][_0x6cc8('0x18')]({'raw':_0x5d0252[_0x6cc8('0x19')]?_0x5d0252[_0x6cc8('0x19')][_0x6cc8('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d0252[_0x6cc8('0x19')]?_0x5d0252[_0x6cc8('0x19')]['where']||null:null,'attributes':_0x5d0252[_0x6cc8('0x19')]?_0x5d0252[_0x6cc8('0x19')][_0x6cc8('0x1b')]||null:null,'limit':_0x5d0252[_0x6cc8('0x19')]?_0x5d0252[_0x6cc8('0x19')][_0x6cc8('0x1c')]||null:null,'include':_0x5d0252[_0x6cc8('0x19')]?_0x5d0252[_0x6cc8('0x19')][_0x6cc8('0x1d')]?_[_0x6cc8('0x1e')](_0x5d0252['options'][_0x6cc8('0x1d')],function(_0x32cfc8){return{'model':db[_0x32cfc8['model']],'as':_0x32cfc8['as'],'attributes':_0x32cfc8[_0x6cc8('0x1b')],'include':_0x32cfc8[_0x6cc8('0x1d')]?_['map'](_0x32cfc8[_0x6cc8('0x1d')],function(_0x5292af){return{'model':db[_0x5292af[_0x6cc8('0x1f')]],'as':_0x5292af['as'],'attributes':_0x5292af[_0x6cc8('0x1b')],'include':_0x5292af['include']?_[_0x6cc8('0x1e')](_0x5292af[_0x6cc8('0x1d')],function(_0x19d189){return{'model':db[_0x19d189[_0x6cc8('0x1f')]],'as':_0x19d189['as'],'attributes':_0x19d189[_0x6cc8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aae3d){logger[_0x6cc8('0xb')](_0x6cc8('0x16'),_0x5d0252);logger['debug'](_0x6cc8('0x16'),_0x5d0252,JSON[_0x6cc8('0xf')](_0x2aae3d));_0x2e38a0(_0x2aae3d);})[_0x6cc8('0x15')](function(_0xfb0bd2){logger[_0x6cc8('0x10')](_0x6cc8('0x16'),_0xfb0bd2[_0x6cc8('0x13')],_0x5d0252);_0x2bc992(_0x44f747[_0x6cc8('0x10')](0x1f4,_0xfb0bd2[_0x6cc8('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x208f46){var _0xf84efb=this;return new Promise(function(_0x444110,_0xfe2528){return db[_0x6cc8('0x17')][_0x6cc8('0x20')](_0x208f46[_0x6cc8('0x21')],{'raw':_0x208f46[_0x6cc8('0x19')]?_0x208f46[_0x6cc8('0x19')][_0x6cc8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208f46['options']?_0x208f46['options'][_0x6cc8('0x22')]||null:null,'attributes':_0x208f46[_0x6cc8('0x19')]?_0x208f46[_0x6cc8('0x19')][_0x6cc8('0x1b')]||null:null,'limit':_0x208f46[_0x6cc8('0x19')]?_0x208f46[_0x6cc8('0x19')][_0x6cc8('0x1c')]||null:null})[_0x6cc8('0xa')](function(_0x5c7774){logger[_0x6cc8('0xb')](_0x6cc8('0x23'),_0x208f46);logger[_0x6cc8('0xd')]('UpdateCmHopperBlack',_0x208f46,JSON[_0x6cc8('0xf')](_0x5c7774));_0x444110(_0x5c7774);})['catch'](function(_0x2ce24b){logger[_0x6cc8('0x10')](_0x6cc8('0x23'),_0x2ce24b[_0x6cc8('0x13')],_0x208f46);_0xfe2528(_0xf84efb[_0x6cc8('0x10')](0x1f4,_0x2ce24b[_0x6cc8('0x13')]));});});};exports[_0x6cc8('0x24')]=function(_0x563b3d){var _0x1a4dd8=this;return new Promise(function(_0x3cd7ab,_0xf2b182){return db[_0x6cc8('0x17')][_0x6cc8('0x25')]({'where':_0x563b3d['options']?_0x563b3d[_0x6cc8('0x19')][_0x6cc8('0x22')]||null:null})['then'](function(_0x1032b4){logger[_0x6cc8('0xb')]('DestroyCmHopperBlack',_0x563b3d);logger[_0x6cc8('0xd')]('DestroyCmHopperBlack',_0x563b3d,JSON[_0x6cc8('0xf')](_0x1032b4));_0x3cd7ab(_0x1032b4);})[_0x6cc8('0x15')](function(_0x1f54be){logger[_0x6cc8('0x10')]('DestroyCmHopperBlack',_0x1f54be['message'],_0x563b3d);_0xf2b182(_0x1a4dd8[_0x6cc8('0x10')](0x1f4,_0x1f54be[_0x6cc8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index fa38b5d..1bdb847 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 _0x1967=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1eef67,_0x3f38b4){var _0x115c81=function(_0x35ec0e){while(--_0x35ec0e){_0x1eef67['push'](_0x1eef67['shift']());}};_0x115c81(++_0x3f38b4);}(_0x1967,0x173));var _0x7196=function(_0x49003c,_0x4e7070){_0x49003c=_0x49003c-0x0;var _0x22c260=_0x1967[_0x49003c];return _0x22c260;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')](_0x7196('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x7196('0x12')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);module[_0x7196('0x14')]=router; \ No newline at end of file +var _0x3a6d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a6d,0x143));var _0xd3a6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3a6d[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/describe',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller['update']);router[_0xd3a6('0x10')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x11')]);module[_0xd3a6('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 38fc3a5..1761486 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 _0xab87=['setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','DATE','INTEGER','STRING','getDataValue','endtime'];(function(_0x1a7118,_0xf21148){var _0xf8eff4=function(_0x21d3d8){while(--_0x21d3d8){_0x1a7118['push'](_0x1a7118['shift']());}};_0xf8eff4(++_0xf21148);}(_0xab87,0x18b));var _0x7ab8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xab87[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7ab8('0x0'));var moment=require(_0x7ab8('0x1'));module[_0x7ab8('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7ab8('0x3')]},'countbusyretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7ab8('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x7ab8('0x5')]},'calleridnum':{'type':Sequelize[_0x7ab8('0x5')]},'calleridname':{'type':Sequelize[_0x7ab8('0x5')]},'starttime':{'type':Sequelize[_0x7ab8('0x3')]},'responsetime':{'type':Sequelize[_0x7ab8('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7ab8('0x3')]},'ringtime':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7ab8('0x5')]},'campaign':{'type':Sequelize[_0x7ab8('0x5')]},'campaigntype':{'type':Sequelize[_0x7ab8('0x5')]},'membername':{'type':Sequelize[_0x7ab8('0x5')]},'reason':{'type':Sequelize[_0x7ab8('0x5')]},'disposition':{'type':Sequelize[_0x7ab8('0x5')]},'secondDisposition':{'type':Sequelize[_0x7ab8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7ab8('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x2f9a4d){var _0x2fd6dd=this[_0x7ab8('0x6')](_0x7ab8('0x7'));if(_0x2fd6dd&&_0x2f9a4d){this[_0x7ab8('0x8')](_0x7ab8('0x9'),moment(_0x2f9a4d)['diff'](moment(_0x2fd6dd),_0x7ab8('0xa')));}return this[_0x7ab8('0x8')](_0x7ab8('0xb'),_0x2f9a4d);}},'amd':{'type':Sequelize[_0x7ab8('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7ab8('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x7ab8('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7ab8('0x3')]},'callback':{'type':Sequelize[_0x7ab8('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7ab8('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7ab8('0x3')]},'deleted':{'type':Sequelize[_0x7ab8('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x7ab8('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x7ab8('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7ab8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x311e=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN'];(function(_0x1ce631,_0x36a3ec){var _0x5120a8=function(_0x49ed5b){while(--_0x49ed5b){_0x1ce631['push'](_0x1ce631['shift']());}};_0x5120a8(++_0x36a3ec);}(_0x311e,0xc0));var _0xe311=function(_0x24a09d,_0x4cbf4d){_0x24a09d=_0x24a09d-0x0;var _0x5729b7=_0x311e[_0x24a09d];return _0x5729b7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe311('0x0'));module[_0xe311('0x1')]={'state':{'type':Sequelize[_0xe311('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe311('0x3')]},'scheduledat':{'type':Sequelize[_0xe311('0x4')]},'countbusyretry':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xe311('0x3')]},'originatecalleridname':{'type':Sequelize[_0xe311('0x3')]},'calleridnum':{'type':Sequelize[_0xe311('0x3')]},'calleridname':{'type':Sequelize[_0xe311('0x3')]},'starttime':{'type':Sequelize[_0xe311('0x4')]},'responsetime':{'type':Sequelize[_0xe311('0x4')]},'answertime':{'type':Sequelize[_0xe311('0x4')]},'droptime':{'type':Sequelize[_0xe311('0x4')]},'endtime':{'type':Sequelize[_0xe311('0x4')]},'ringtime':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe311('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe311('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xe311('0x3')]},'secondDisposition':{'type':Sequelize[_0xe311('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe311('0x3')]},'dispositionat':{'type':Sequelize[_0xe311('0x4')],'set':function(_0x21652d){var _0x36418d=this[_0xe311('0x5')](_0xe311('0x6'));if(_0x36418d&&_0x21652d){this[_0xe311('0x7')](_0xe311('0x8'),moment(_0x21652d)[_0xe311('0x9')](moment(_0x36418d),'seconds'));}return this[_0xe311('0x7')](_0xe311('0xa'),_0x21652d);}},'amd':{'type':Sequelize[_0xe311('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe311('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe311('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe311('0x4')]},'callback':{'type':Sequelize[_0xe311('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe311('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe311('0x4')]},'deleted':{'type':Sequelize[_0xe311('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe311('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe311('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe311('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe311('0x2')],'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 372205f..3cf10ad 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 _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x5bdbfd,_0x3aaf24){var _0x5711c0=function(_0x14b3ac){while(--_0x14b3ac){_0x5bdbfd['push'](_0x5bdbfd['shift']());}};_0x5711c0(++_0x3aaf24);}(_0xe3da,0x1cd));var _0xae3d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe3da[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file +var _0xbd51=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','describe','body','uniqueid','find','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x208,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt'];(function(_0x5d84e4,_0x4f552c){var _0x17d2de=function(_0x413f9e){while(--_0x413f9e){_0x5d84e4['push'](_0x5d84e4['shift']());}};_0x17d2de(++_0x4f552c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x57a986,_0x56f2d7){_0x57a986=_0x57a986-0x0;var _0x6548c8=_0xbd51[_0x57a986];return _0x6548c8;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')]()[_0x1bd5('0x40')](respondWithResult(_0xe71454,null))[_0x1bd5('0x48')](handleError(_0xe71454,null));};exports['update']=function(_0x13985e,_0x227a68){if(_0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')]){delete _0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')];}return db['CmHopperFinal'][_0x1bd5('0x4c')]({'where':{'uniqueid':_0x13985e[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x227a68,null))[_0x1bd5('0x40')](saveUpdates(_0x13985e[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x227a68,null))[_0x1bd5('0x48')](handleError(_0x227a68,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x587c46,_0x126221,_0x2d713b){return db[_0x1bd5('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x587c46[_0x1bd5('0x45')]['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x51')))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x52')))),_0x1bd5('0x53')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x1bd5('0x54')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x55')))),_0x1bd5('0x56')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),_0x1bd5('0x58')],[db['sequelize']['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),'reCallContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x126221,null))['then'](respondWithResult(_0x126221,null))['catch'](handleError(_0x126221,null));};exports[_0x1bd5('0x5c')]=function(_0xec9fac,_0x1790af,_0x54a8c4){return db['CmHopperFinal'][_0x1bd5('0x5d')]({'raw':![],'where':{'CampaignId':_0xec9fac['params']['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5e')))),'congestionContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x55')))),'dropContacts'],[db[_0x1bd5('0x4d')]['fn']('COUNT',db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),'abandonedContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),_0x1bd5('0x5f')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x1790af,null))[_0x1bd5('0x40')](respondWithResult(_0x1790af,null))[_0x1bd5('0x48')](handleError(_0x1790af,null));};exports[_0x1bd5('0x60')]=function(_0x195176,_0x393a8f,_0x1ffbab){return db[_0x1bd5('0x61')][_0x1bd5('0x4c')]({'where':{'id':_0x195176[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x393a8f,null))['then'](function(_0x3bd058){var _0x1d6223;if(_0x3bd058){_0x1d6223=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),'scheduledAt',_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x69'),_0x1bd5('0x6a'),'updatedAt'],squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),'ContactId')['field'](_0x1bd5('0x71'),'ListId')[_0x1bd5('0x6c')](_0x1bd5('0x72'),'VoiceQueueId')[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x73'))['from'](_0x1bd5('0x74'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x195176[_0x1bd5('0x4a')][_0x1bd5('0x77')][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()['field'](_0x1bd5('0x66'))[_0x1bd5('0x7a')](_0x1bd5('0x64'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')['from']('cm_hopper_final')[_0x1bd5('0x39')]('VoiceQueueId\x20=\x20?',_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')](_0x1bd5('0x7c')))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db['sequelize'][_0x1bd5('0x2f')](_0x1d6223);}return[];})['then'](respondWithResult(_0x393a8f,null))[_0x1bd5('0x48')](handleError(_0x393a8f,null));};exports[_0x1bd5('0x7e')]=function(_0x7d097,_0x50f2ac,_0x5db61c){return db[_0x1bd5('0x7f')]['find']({'where':{'id':_0x7d097[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x50f2ac,null))[_0x1bd5('0x40')](function(_0x16f996){var _0x248d66;if(_0x16f996){_0x248d66=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),_0x1bd5('0x6f'),_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x80'),_0x1bd5('0x6a'),_0x1bd5('0x73')],squel['select']()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),_0x1bd5('0x67'))[_0x1bd5('0x6c')]('ANY_VALUE(ListId)',_0x1bd5('0x68'))[_0x1bd5('0x6c')](_0x1bd5('0x81'),_0x1bd5('0x80'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')]('NOW()',_0x1bd5('0x73'))[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x7d097['body']['state'][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))[_0x1bd5('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x66'))['from'](_0x1bd5('0x64'))['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')]('state\x20=\x204'))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db[_0x1bd5('0x4d')][_0x1bd5('0x2f')](_0x248d66);}return[];})[_0x1bd5('0x40')](respondWithResult(_0x50f2ac,null))[_0x1bd5('0x48')](handleError(_0x50f2ac,null));};exports[_0x1bd5('0x83')]=function(_0x22e1f4,_0x347d06,_0x3cf023){return db[_0x1bd5('0x84')][_0x1bd5('0x85')]({'where':{'VoiceQueueId':_0x22e1f4[_0x1bd5('0x4a')]['VoiceQueueId'],'CampaignId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x80')],'ContactId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x67')]}})[_0x1bd5('0x40')](handleEntityNotFound(_0x347d06,null))[_0x1bd5('0x40')](function(_0x28f567){if(_0x28f567){return _0x28f567;}return null;})[_0x1bd5('0x40')](respondWithResult(_0x347d06,null))[_0x1bd5('0x48')](handleError(_0x347d06,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8f58472..9fdbede 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 _0x7270=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x248ba9,_0x5010ed){var _0x5e0f6b=function(_0x507fe0){while(--_0x507fe0){_0x248ba9['push'](_0x248ba9['shift']());}};_0x5e0f6b(++_0x5010ed);}(_0x7270,0x141));var _0x0727=function(_0x4471ff,_0x4bb7de){_0x4471ff=_0x4471ff-0x0;var _0xe723ca=_0x7270[_0x4471ff];return _0xe723ca;};'use strict';var _=require(_0x0727('0x0'));var util=require('util');var logger=require(_0x0727('0x1'))(_0x0727('0x2'));var moment=require(_0x0727('0x3'));var BPromise=require(_0x0727('0x4'));var rp=require(_0x0727('0x5'));var fs=require('fs');var path=require(_0x0727('0x6'));var rimraf=require(_0x0727('0x7'));var config=require(_0x0727('0x8'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x5b3b5d,_0x524f88){return _0x5b3b5d[_0x0727('0x9')](_0x0727('0xa'),attributes,{'tableName':_0x0727('0xb'),'paranoid':![],'indexes':[{'name':_0x0727('0xc'),'fields':[_0x0727('0xc')]},{'name':_0x0727('0xd'),'fields':[_0x0727('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0189=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','uniqueid','lodash','util','../../config/logger'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x0189,0x174));var _0x9018=function(_0x542b97,_0x23b33d){_0x542b97=_0x542b97-0x0;var _0x3c2e20=_0x0189[_0x542b97];return _0x3c2e20;};'use strict';var _=require(_0x9018('0x0'));var util=require(_0x9018('0x1'));var logger=require(_0x9018('0x2'))(_0x9018('0x3'));var moment=require('moment');var BPromise=require(_0x9018('0x4'));var rp=require(_0x9018('0x5'));var fs=require('fs');var path=require(_0x9018('0x6'));var rimraf=require(_0x9018('0x7'));var config=require(_0x9018('0x8'));var attributes=require(_0x9018('0x9'));module[_0x9018('0xa')]=function(_0x19ef98,_0x5e4633){return _0x19ef98[_0x9018('0xb')](_0x9018('0xc'),attributes,{'tableName':_0x9018('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x9018('0xe'),'fields':[_0x9018('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index dfffc72..24cc7cc 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x22354f,_0x90ec5e){var _0x177018=function(_0x3cbf62){while(--_0x3cbf62){_0x22354f['push'](_0x22354f['shift']());}};_0x177018(++_0x90ec5e);}(_0xb10b,0x12a));var _0xbb10=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb10b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x54c528,_0x2bb900){var _0x5c64ec=function(_0x53d7dc){while(--_0x53d7dc){_0x54c528['push'](_0x54c528['shift']());}};_0x5c64ec(++_0x2bb900);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e334b,_0x426b6e){_0x2e334b=_0x2e334b-0x0;var _0x390570=_0xb10b[_0x2e334b];return _0x390570;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e8f65cb..f36cc65 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 _0x39f8=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id'];(function(_0x46fdbb,_0x217295){var _0x219d7e=function(_0x1350b8){while(--_0x1350b8){_0x46fdbb['push'](_0x46fdbb['shift']());}};_0x219d7e(++_0x217295);}(_0x39f8,0xb3));var _0x839f=function(_0x55fd25,_0x2a7ab8){_0x55fd25=_0x55fd25-0x0;var _0x4c1218=_0x39f8[_0x55fd25];return _0x4c1218;};'use strict';var multer=require(_0x839f('0x0'));var util=require('util');var path=require(_0x839f('0x1'));var timeout=require(_0x839f('0x2'));var express=require(_0x839f('0x3'));var router=express[_0x839f('0x4')]();var fs_extra=require(_0x839f('0x5'));var auth=require(_0x839f('0x6'));var interaction=require(_0x839f('0x7'));var config=require('../../config/environment');var controller=require(_0x839f('0x8'));router['get']('/',auth[_0x839f('0x9')](),controller[_0x839f('0xa')]);router['get'](_0x839f('0xb'),auth['isAuthenticated'](),controller[_0x839f('0xc')]);router[_0x839f('0xd')](_0x839f('0xe'),auth[_0x839f('0x9')](),controller[_0x839f('0xf')]);router[_0x839f('0xd')](_0x839f('0x10'),auth[_0x839f('0x9')](),controller[_0x839f('0x11')]);router['get']('/campaign/countAttributes/:id',auth[_0x839f('0x9')](),controller[_0x839f('0x12')]);router[_0x839f('0x13')]('/voice/queue/moveContacts/:id',auth[_0x839f('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x839f('0x13')](_0x839f('0x14'),auth[_0x839f('0x9')](),controller[_0x839f('0x15')]);router[_0x839f('0x13')](_0x839f('0x16'),auth[_0x839f('0x9')](),controller['checkContactHopper']);router[_0x839f('0x17')](_0x839f('0xe'),auth[_0x839f('0x9')](),controller[_0x839f('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb5f1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','index','isAuthenticated','describe','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util'];(function(_0x10904d,_0x5352ab){var _0x22b0b1=function(_0x101348){while(--_0x101348){_0x10904d['push'](_0x10904d['shift']());}};_0x22b0b1(++_0x5352ab);}(_0xb5f1,0x150));var _0x1b5f=function(_0x2fd7e9,_0x491a5d){_0x2fd7e9=_0x2fd7e9-0x0;var _0x98e93=_0xb5f1[_0x2fd7e9];return _0x98e93;};'use strict';var multer=require(_0x1b5f('0x0'));var util=require(_0x1b5f('0x1'));var path=require('path');var timeout=require(_0x1b5f('0x2'));var express=require(_0x1b5f('0x3'));var router=express[_0x1b5f('0x4')]();var fs_extra=require(_0x1b5f('0x5'));var auth=require(_0x1b5f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1b5f('0x7'));var controller=require(_0x1b5f('0x8'));router[_0x1b5f('0x9')]('/',auth['isAuthenticated'](),controller[_0x1b5f('0xa')]);router[_0x1b5f('0x9')]('/describe',auth[_0x1b5f('0xb')](),controller[_0x1b5f('0xc')]);router[_0x1b5f('0x9')]('/:id',auth[_0x1b5f('0xb')](),controller['show']);router['get']('/voice/queue/countAttributes/:id',auth[_0x1b5f('0xb')](),controller[_0x1b5f('0xd')]);router['get'](_0x1b5f('0xe'),auth[_0x1b5f('0xb')](),controller[_0x1b5f('0xf')]);router[_0x1b5f('0x10')](_0x1b5f('0x11'),auth[_0x1b5f('0xb')](),controller[_0x1b5f('0x12')]);router[_0x1b5f('0x10')](_0x1b5f('0x13'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x1b5f('0x10')](_0x1b5f('0x14'),auth[_0x1b5f('0xb')](),controller[_0x1b5f('0x15')]);router[_0x1b5f('0x16')](_0x1b5f('0x17'),auth['isAuthenticated'](),controller[_0x1b5f('0x18')]);module[_0x1b5f('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index efe365d..becf01a 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 _0x15d7=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x305997,_0x1d2ef3){var _0x321570=function(_0x5f89f4){while(--_0x5f89f4){_0x305997['push'](_0x305997['shift']());}};_0x321570(++_0x1d2ef3);}(_0x15d7,0x111));var _0x715d=function(_0x6e8034,_0x5ce1b0){_0x6e8034=_0x6e8034-0x0;var _0x281866=_0x15d7[_0x6e8034];return _0x281866;};'use strict';var Sequelize=require(_0x715d('0x0'));module['exports']={'state':{'type':Sequelize[_0x715d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x715d('0x2')]},'scheduledat':{'type':Sequelize[_0x715d('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x715d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x715d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x715d('0x2')]},'calleridnum':{'type':Sequelize[_0x715d('0x2')]},'calleridname':{'type':Sequelize[_0x715d('0x2')]},'starttime':{'type':Sequelize[_0x715d('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x715d('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x715d('0x3')]},'ringtime':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x715d('0x2')]},'campaign':{'type':Sequelize[_0x715d('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x715d('0x2')]},'reason':{'type':Sequelize[_0x715d('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x715d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x715d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x715d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x715d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x715d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x679a=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x37201a,_0x14833b){var _0x28dda3=function(_0x1c9c31){while(--_0x1c9c31){_0x37201a['push'](_0x37201a['shift']());}};_0x28dda3(++_0x14833b);}(_0x679a,0x91));var _0xa679=function(_0x2310da,_0x300875){_0x2310da=_0x2310da-0x0;var _0x4ffae3=_0x679a[_0x2310da];return _0x4ffae3;};'use strict';var Sequelize=require(_0xa679('0x0'));module['exports']={'state':{'type':Sequelize[_0xa679('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa679('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa679('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xa679('0x2')]},'originatecalleridname':{'type':Sequelize[_0xa679('0x2')]},'calleridnum':{'type':Sequelize[_0xa679('0x2')]},'calleridname':{'type':Sequelize[_0xa679('0x2')]},'starttime':{'type':Sequelize[_0xa679('0x3')]},'responsetime':{'type':Sequelize[_0xa679('0x3')]},'answertime':{'type':Sequelize[_0xa679('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa679('0x2')]},'campaign':{'type':Sequelize[_0xa679('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa679('0x2')]},'amd':{'type':Sequelize[_0xa679('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa679('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xa679('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa679('0x3')]},'recallme':{'type':Sequelize[_0xa679('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa679('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa679('0x1')],'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 c22af3e..2c9dc44 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 _0x3138=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','CmHopperHistory','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','include','find','create','catch','describe','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x1d5eac,_0x3bde6b){var _0x590554=function(_0x12bced){while(--_0x12bced){_0x1d5eac['push'](_0x1d5eac['shift']());}};_0x590554(++_0x3bde6b);}(_0x3138,0x1c7));var _0x8313=function(_0x3f76e6,_0x4e5c5c){_0x3f76e6=_0x3f76e6-0x0;var _0x4ce5b9=_0x3138[_0x3f76e6];return _0x4ce5b9;};'use strict';var emlformat=require(_0x8313('0x0'));var rimraf=require(_0x8313('0x1'));var zipdir=require(_0x8313('0x2'));var jsonpatch=require(_0x8313('0x3'));var rp=require(_0x8313('0x4'));var moment=require(_0x8313('0x5'));var BPromise=require(_0x8313('0x6'));var Mustache=require(_0x8313('0x7'));var util=require(_0x8313('0x8'));var path=require(_0x8313('0x9'));var sox=require(_0x8313('0xa'));var csv=require('to-csv');var ejs=require(_0x8313('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8313('0xc'));var squel=require(_0x8313('0xd'));var crypto=require(_0x8313('0xe'));var jsforce=require(_0x8313('0xf'));var deskjs=require(_0x8313('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8313('0x11'));var Papa=require(_0x8313('0x12'));var Redis=require(_0x8313('0x13'));var authService=require(_0x8313('0x14'));var qs=require(_0x8313('0x15'));var as=require(_0x8313('0x16'));var hardwareService=require(_0x8313('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8313('0x18'));var licenseUtil=require(_0x8313('0x19'));var db=require(_0x8313('0x1a'))['db'];function respondWithStatusCode(_0x105be0,_0x39009d){_0x39009d=_0x39009d||0xcc;return function(_0x25d71a){if(_0x25d71a){return _0x105be0[_0x8313('0x1b')](_0x39009d);}return _0x105be0[_0x8313('0x1c')](_0x39009d)[_0x8313('0x1d')]();};}function respondWithResult(_0x4b4e06,_0x230688){_0x230688=_0x230688||0xc8;return function(_0x292a7d){if(_0x292a7d){return _0x4b4e06[_0x8313('0x1c')](_0x230688)[_0x8313('0x1e')](_0x292a7d);}};}function respondWithFilteredResult(_0x25e9bc,_0x3767f5){return function(_0x36b709){if(_0x36b709){var _0x257cd3=typeof _0x3767f5[_0x8313('0x1f')]===_0x8313('0x20')&&typeof _0x3767f5['limit']===_0x8313('0x20');var _0x240794=_0x36b709[_0x8313('0x21')];var _0x4e7b79=_0x257cd3?0x0:_0x3767f5['offset'];var _0x5ef5ad=_0x257cd3?_0x36b709['count']:_0x3767f5[_0x8313('0x1f')]+_0x3767f5[_0x8313('0x22')];var _0x5465e9;if(_0x5ef5ad>=_0x240794){_0x5ef5ad=_0x240794;_0x5465e9=0xc8;}else{_0x5465e9=0xce;}_0x25e9bc[_0x8313('0x1c')](_0x5465e9);return _0x25e9bc[_0x8313('0x23')](_0x8313('0x24'),_0x4e7b79+'-'+_0x5ef5ad+'/'+_0x240794)[_0x8313('0x1e')](_0x36b709);}return null;};}function patchUpdates(_0xbc2a1a){return function(_0x5cb9f2){try{jsonpatch[_0x8313('0x25')](_0x5cb9f2,_0xbc2a1a,!![]);}catch(_0x3327f1){return BPromise[_0x8313('0x26')](_0x3327f1);}return _0x5cb9f2[_0x8313('0x27')]();};}function saveUpdates(_0xbd8c11,_0x1ea373){return function(_0x16a579){if(_0x16a579){return _0x16a579[_0x8313('0x28')](_0xbd8c11)[_0x8313('0x29')](function(_0x5c1c07){return _0x5c1c07;});}return null;};}function removeEntity(_0x1db3ef,_0x401f24){return function(_0x36573f){if(_0x36573f){return _0x36573f[_0x8313('0x2a')]()[_0x8313('0x29')](function(){_0x1db3ef[_0x8313('0x1c')](0xcc)[_0x8313('0x1d')]();});}};}function handleEntityNotFound(_0x4e1c65,_0x412481){return function(_0x49c69a){if(!_0x49c69a){_0x4e1c65['sendStatus'](0x194);}return _0x49c69a;};}function handleError(_0x4fb6d6,_0x10edc4){_0x10edc4=_0x10edc4||0x1f4;return function(_0x5728ba){logger[_0x8313('0x2b')](_0x5728ba[_0x8313('0x2c')]);if(_0x5728ba['name']){delete _0x5728ba[_0x8313('0x2d')];}_0x4fb6d6[_0x8313('0x1c')](_0x10edc4)['send'](_0x5728ba);};}exports['index']=function(_0x5d8bd6,_0x32feed){var _0x164c57={},_0x50a7f0={},_0x1dbb52={'count':0x0,'rows':[]};var _0x4ee184=_[_0x8313('0x2e')](db[_0x8313('0x2f')][_0x8313('0x30')],function(_0x38878f){return{'name':_0x38878f[_0x8313('0x31')],'type':_0x38878f[_0x8313('0x32')]['key']};});_0x50a7f0[_0x8313('0x33')]=_[_0x8313('0x2e')](_0x4ee184,_0x8313('0x2d'));_0x50a7f0['query']=_[_0x8313('0x34')](_0x5d8bd6[_0x8313('0x35')]);_0x50a7f0[_0x8313('0x36')]=_[_0x8313('0x37')](_0x50a7f0[_0x8313('0x33')],_0x50a7f0[_0x8313('0x35')]);_0x164c57[_0x8313('0x38')]=_[_0x8313('0x37')](_0x50a7f0[_0x8313('0x33')],qs[_0x8313('0x39')](_0x5d8bd6[_0x8313('0x35')][_0x8313('0x39')]));_0x164c57[_0x8313('0x38')]=_0x164c57[_0x8313('0x38')][_0x8313('0x3a')]?_0x164c57[_0x8313('0x38')]:_0x50a7f0[_0x8313('0x33')];if(!_0x5d8bd6[_0x8313('0x35')][_0x8313('0x3b')](_0x8313('0x3c'))){_0x164c57[_0x8313('0x22')]=qs['limit'](_0x5d8bd6[_0x8313('0x35')][_0x8313('0x22')]);_0x164c57[_0x8313('0x1f')]=qs['offset'](_0x5d8bd6['query'][_0x8313('0x1f')]);}_0x164c57[_0x8313('0x3d')]=qs['sort'](_0x5d8bd6[_0x8313('0x35')][_0x8313('0x3e')]);_0x164c57[_0x8313('0x3f')]=qs[_0x8313('0x36')](_[_0x8313('0x40')](_0x5d8bd6[_0x8313('0x35')],_0x50a7f0[_0x8313('0x36')]),_0x4ee184);if(_0x5d8bd6[_0x8313('0x35')][_0x8313('0x41')]){_0x164c57[_0x8313('0x3f')]=_['merge'](_0x164c57['where'],{'$or':_[_0x8313('0x2e')](_0x4ee184,function(_0x2a262c){if(_0x2a262c[_0x8313('0x32')]!==_0x8313('0x42')){var _0x58e74b={};_0x58e74b[_0x2a262c['name']]={'$like':'%'+_0x5d8bd6[_0x8313('0x35')][_0x8313('0x41')]+'%'};return _0x58e74b;}})});}_0x164c57=_[_0x8313('0x43')]({},_0x164c57,_0x5d8bd6[_0x8313('0x44')]);var _0x723d2f={'where':_0x164c57[_0x8313('0x3f')]};return db['CmHopperHistory'][_0x8313('0x21')](_0x723d2f)[_0x8313('0x29')](function(_0x2e1b88){_0x1dbb52[_0x8313('0x21')]=_0x2e1b88;if(_0x5d8bd6['query'][_0x8313('0x45')]){_0x164c57['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x164c57);})[_0x8313('0x29')](function(_0x92c5b7){_0x1dbb52[_0x8313('0x46')]=_0x92c5b7;return _0x1dbb52;})[_0x8313('0x29')](respondWithFilteredResult(_0x32feed,_0x164c57))['catch'](handleError(_0x32feed,null));};exports[_0x8313('0x47')]=function(_0x4524c7,_0xd0fa57){var _0x59e4aa={'raw':!![],'where':{'id':_0x4524c7['params']['id']}},_0x5a0a32={};_0x5a0a32[_0x8313('0x33')]=_[_0x8313('0x34')](db['CmHopperHistory'][_0x8313('0x30')]);_0x5a0a32[_0x8313('0x35')]=_[_0x8313('0x34')](_0x4524c7[_0x8313('0x35')]);_0x5a0a32['filters']=_[_0x8313('0x37')](_0x5a0a32['model'],_0x5a0a32['query']);_0x59e4aa[_0x8313('0x38')]=_[_0x8313('0x37')](_0x5a0a32['model'],qs['fields'](_0x4524c7[_0x8313('0x35')][_0x8313('0x39')]));_0x59e4aa[_0x8313('0x38')]=_0x59e4aa[_0x8313('0x38')][_0x8313('0x3a')]?_0x59e4aa[_0x8313('0x38')]:_0x5a0a32[_0x8313('0x33')];if(_0x4524c7[_0x8313('0x35')]['includeAll']){_0x59e4aa[_0x8313('0x48')]=[{'all':!![]}];}_0x59e4aa=_[_0x8313('0x43')]({},_0x59e4aa,_0x4524c7[_0x8313('0x44')]);return db['CmHopperHistory'][_0x8313('0x49')](_0x59e4aa)[_0x8313('0x29')](handleEntityNotFound(_0xd0fa57,null))[_0x8313('0x29')](respondWithResult(_0xd0fa57,null))['catch'](handleError(_0xd0fa57,null));};exports[_0x8313('0x4a')]=function(_0x5c1f6d,_0x2c9fe8){return db[_0x8313('0x2f')]['create'](_0x5c1f6d['body'],{})['then'](respondWithResult(_0x2c9fe8,0xc9))[_0x8313('0x4b')](handleError(_0x2c9fe8,null));};exports[_0x8313('0x4c')]=function(_0xa45ab7,_0x3fbf92){return db[_0x8313('0x2f')][_0x8313('0x4c')]()['then'](respondWithResult(_0x3fbf92,null))[_0x8313('0x4b')](handleError(_0x3fbf92,null));};exports[_0x8313('0x28')]=function(_0x2301b9,_0x352527){if(_0x2301b9['body']['uniqueid']){delete _0x2301b9[_0x8313('0x4d')]['uniqueid'];}return db[_0x8313('0x2f')][_0x8313('0x49')]({'where':{'uniqueid':_0x2301b9[_0x8313('0x4e')]['id']}})[_0x8313('0x29')](handleEntityNotFound(_0x352527,null))[_0x8313('0x29')](saveUpdates(_0x2301b9[_0x8313('0x4d')],null))[_0x8313('0x29')](respondWithResult(_0x352527,null))['catch'](handleError(_0x352527,null));}; \ No newline at end of file +var _0xecfd=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','show','find','catch','create','describe','body','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xecfd,0x11d));var _0xdecf=function(_0x4e46ec,_0xa6c629){_0x4e46ec=_0x4e46ec-0x0;var _0x2fdfe0=_0xecfd[_0x4e46ec];return _0x2fdfe0;};'use strict';var emlformat=require(_0xdecf('0x0'));var rimraf=require(_0xdecf('0x1'));var zipdir=require(_0xdecf('0x2'));var jsonpatch=require(_0xdecf('0x3'));var rp=require(_0xdecf('0x4'));var moment=require(_0xdecf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdecf('0x6'));var util=require(_0xdecf('0x7'));var path=require(_0xdecf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdecf('0x9'));var fs=require('fs');var fs_extra=require(_0xdecf('0xa'));var _=require(_0xdecf('0xb'));var squel=require(_0xdecf('0xc'));var crypto=require(_0xdecf('0xd'));var jsforce=require(_0xdecf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdecf('0xf'));var querystring=require(_0xdecf('0x10'));var Papa=require(_0xdecf('0x11'));var Redis=require(_0xdecf('0x12'));var authService=require(_0xdecf('0x13'));var qs=require(_0xdecf('0x14'));var as=require(_0xdecf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdecf('0x16'))(_0xdecf('0x17'));var utils=require('../../config/utils');var config=require(_0xdecf('0x18'));var licenseUtil=require(_0xdecf('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cf0e3,_0x13cec5){_0x13cec5=_0x13cec5||0xcc;return function(_0x15e672){if(_0x15e672){return _0x3cf0e3[_0xdecf('0x1a')](_0x13cec5);}return _0x3cf0e3[_0xdecf('0x1b')](_0x13cec5)[_0xdecf('0x1c')]();};}function respondWithResult(_0x5175d8,_0xbcde37){_0xbcde37=_0xbcde37||0xc8;return function(_0x39fb09){if(_0x39fb09){return _0x5175d8[_0xdecf('0x1b')](_0xbcde37)[_0xdecf('0x1d')](_0x39fb09);}};}function respondWithFilteredResult(_0x3b110e,_0x5a4eac){return function(_0x317c62){if(_0x317c62){var _0x37f10c=typeof _0x5a4eac[_0xdecf('0x1e')]===_0xdecf('0x1f')&&typeof _0x5a4eac[_0xdecf('0x20')]===_0xdecf('0x1f');var _0x14257c=_0x317c62['count'];var _0x3d1647=_0x37f10c?0x0:_0x5a4eac[_0xdecf('0x1e')];var _0x1eb424=_0x37f10c?_0x317c62[_0xdecf('0x21')]:_0x5a4eac['offset']+_0x5a4eac[_0xdecf('0x20')];var _0x2680e0;if(_0x1eb424>=_0x14257c){_0x1eb424=_0x14257c;_0x2680e0=0xc8;}else{_0x2680e0=0xce;}_0x3b110e[_0xdecf('0x1b')](_0x2680e0);return _0x3b110e[_0xdecf('0x22')](_0xdecf('0x23'),_0x3d1647+'-'+_0x1eb424+'/'+_0x14257c)[_0xdecf('0x1d')](_0x317c62);}return null;};}function patchUpdates(_0x191d2f){return function(_0xfc800a){try{jsonpatch['apply'](_0xfc800a,_0x191d2f,!![]);}catch(_0x4e57b7){return BPromise[_0xdecf('0x24')](_0x4e57b7);}return _0xfc800a[_0xdecf('0x25')]();};}function saveUpdates(_0x1bdca5,_0x1c808a){return function(_0x41a48a){if(_0x41a48a){return _0x41a48a[_0xdecf('0x26')](_0x1bdca5)[_0xdecf('0x27')](function(_0x14b992){return _0x14b992;});}return null;};}function removeEntity(_0x385031,_0x224925){return function(_0x28acf2){if(_0x28acf2){return _0x28acf2['destroy']()['then'](function(){_0x385031[_0xdecf('0x1b')](0xcc)[_0xdecf('0x1c')]();});}};}function handleEntityNotFound(_0xab77cb,_0x52eea2){return function(_0x1b957e){if(!_0x1b957e){_0xab77cb['sendStatus'](0x194);}return _0x1b957e;};}function handleError(_0x13cdd9,_0x561016){_0x561016=_0x561016||0x1f4;return function(_0x433f62){logger[_0xdecf('0x28')](_0x433f62[_0xdecf('0x29')]);if(_0x433f62[_0xdecf('0x2a')]){delete _0x433f62[_0xdecf('0x2a')];}_0x13cdd9[_0xdecf('0x1b')](_0x561016)[_0xdecf('0x2b')](_0x433f62);};}exports[_0xdecf('0x2c')]=function(_0x1c5f93,_0xd1617a){var _0x3703e8={},_0x41a0b0={},_0x27996d={'count':0x0,'rows':[]};var _0x9e2756=_[_0xdecf('0x2d')](db[_0xdecf('0x2e')][_0xdecf('0x2f')],function(_0x370324){return{'name':_0x370324['fieldName'],'type':_0x370324[_0xdecf('0x30')][_0xdecf('0x31')]};});_0x41a0b0[_0xdecf('0x32')]=_['map'](_0x9e2756,_0xdecf('0x2a'));_0x41a0b0[_0xdecf('0x33')]=_[_0xdecf('0x34')](_0x1c5f93[_0xdecf('0x33')]);_0x41a0b0[_0xdecf('0x35')]=_['intersection'](_0x41a0b0[_0xdecf('0x32')],_0x41a0b0[_0xdecf('0x33')]);_0x3703e8['attributes']=_[_0xdecf('0x36')](_0x41a0b0['model'],qs['fields'](_0x1c5f93['query']['fields']));_0x3703e8['attributes']=_0x3703e8[_0xdecf('0x37')][_0xdecf('0x38')]?_0x3703e8[_0xdecf('0x37')]:_0x41a0b0[_0xdecf('0x32')];if(!_0x1c5f93[_0xdecf('0x33')][_0xdecf('0x39')](_0xdecf('0x3a'))){_0x3703e8[_0xdecf('0x20')]=qs[_0xdecf('0x20')](_0x1c5f93[_0xdecf('0x33')][_0xdecf('0x20')]);_0x3703e8[_0xdecf('0x1e')]=qs[_0xdecf('0x1e')](_0x1c5f93['query']['offset']);}_0x3703e8['order']=qs['sort'](_0x1c5f93['query'][_0xdecf('0x3b')]);_0x3703e8['where']=qs['filters'](_['pick'](_0x1c5f93[_0xdecf('0x33')],_0x41a0b0[_0xdecf('0x35')]),_0x9e2756);if(_0x1c5f93[_0xdecf('0x33')][_0xdecf('0x3c')]){_0x3703e8['where']=_[_0xdecf('0x3d')](_0x3703e8[_0xdecf('0x3e')],{'$or':_[_0xdecf('0x2d')](_0x9e2756,function(_0x141557){if(_0x141557[_0xdecf('0x30')]!=='VIRTUAL'){var _0x3a9357={};_0x3a9357[_0x141557[_0xdecf('0x2a')]]={'$like':'%'+_0x1c5f93[_0xdecf('0x33')][_0xdecf('0x3c')]+'%'};return _0x3a9357;}})});}_0x3703e8=_[_0xdecf('0x3d')]({},_0x3703e8,_0x1c5f93[_0xdecf('0x3f')]);var _0x3fb108={'where':_0x3703e8[_0xdecf('0x3e')]};return db[_0xdecf('0x2e')][_0xdecf('0x21')](_0x3fb108)[_0xdecf('0x27')](function(_0x20d3a7){_0x27996d['count']=_0x20d3a7;if(_0x1c5f93[_0xdecf('0x33')][_0xdecf('0x40')]){_0x3703e8[_0xdecf('0x41')]=[{'all':!![]}];}return db[_0xdecf('0x2e')][_0xdecf('0x42')](_0x3703e8);})[_0xdecf('0x27')](function(_0x23cb47){_0x27996d[_0xdecf('0x43')]=_0x23cb47;return _0x27996d;})['then'](respondWithFilteredResult(_0xd1617a,_0x3703e8))['catch'](handleError(_0xd1617a,null));};exports[_0xdecf('0x44')]=function(_0x578817,_0x26c987){var _0x58d202={'raw':!![],'where':{'id':_0x578817['params']['id']}},_0x2cf82f={};_0x2cf82f['model']=_[_0xdecf('0x34')](db[_0xdecf('0x2e')]['rawAttributes']);_0x2cf82f[_0xdecf('0x33')]=_[_0xdecf('0x34')](_0x578817[_0xdecf('0x33')]);_0x2cf82f[_0xdecf('0x35')]=_[_0xdecf('0x36')](_0x2cf82f['model'],_0x2cf82f[_0xdecf('0x33')]);_0x58d202[_0xdecf('0x37')]=_[_0xdecf('0x36')](_0x2cf82f[_0xdecf('0x32')],qs['fields'](_0x578817['query']['fields']));_0x58d202['attributes']=_0x58d202[_0xdecf('0x37')][_0xdecf('0x38')]?_0x58d202[_0xdecf('0x37')]:_0x2cf82f['model'];if(_0x578817[_0xdecf('0x33')][_0xdecf('0x40')]){_0x58d202[_0xdecf('0x41')]=[{'all':!![]}];}_0x58d202=_['merge']({},_0x58d202,_0x578817[_0xdecf('0x3f')]);return db[_0xdecf('0x2e')][_0xdecf('0x45')](_0x58d202)[_0xdecf('0x27')](handleEntityNotFound(_0x26c987,null))[_0xdecf('0x27')](respondWithResult(_0x26c987,null))[_0xdecf('0x46')](handleError(_0x26c987,null));};exports['create']=function(_0x914554,_0x2b08f0){return db['CmHopperHistory'][_0xdecf('0x47')](_0x914554['body'],{})[_0xdecf('0x27')](respondWithResult(_0x2b08f0,0xc9))[_0xdecf('0x46')](handleError(_0x2b08f0,null));};exports['describe']=function(_0x3d3282,_0x3e2bee){return db['CmHopperHistory'][_0xdecf('0x48')]()[_0xdecf('0x27')](respondWithResult(_0x3e2bee,null))[_0xdecf('0x46')](handleError(_0x3e2bee,null));};exports['update']=function(_0x3a727d,_0x110b2d){if(_0x3a727d[_0xdecf('0x49')][_0xdecf('0x4a')]){delete _0x3a727d[_0xdecf('0x49')][_0xdecf('0x4a')];}return db['CmHopperHistory'][_0xdecf('0x45')]({'where':{'uniqueid':_0x3a727d[_0xdecf('0x4b')]['id']}})[_0xdecf('0x27')](handleEntityNotFound(_0x110b2d,null))['then'](saveUpdates(_0x3a727d[_0xdecf('0x49')],null))[_0xdecf('0x27')](respondWithResult(_0x110b2d,null))['catch'](handleError(_0x110b2d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0121ce3..5dcaa64 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 _0x8952=['api','moment','bluebird','path','rimraf','../../config/environment','exports','cm_hopper_history','endtime','uniqueid','util','../../config/logger'];(function(_0x5e3494,_0x39a131){var _0xa9fc96=function(_0x2c2487){while(--_0x2c2487){_0x5e3494['push'](_0x5e3494['shift']());}};_0xa9fc96(++_0x39a131);}(_0x8952,0x17e));var _0x2895=function(_0x36b01a,_0x404a21){_0x36b01a=_0x36b01a-0x0;var _0x10628a=_0x8952[_0x36b01a];return _0x10628a;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('CmHopperHistory',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xa')]},{'name':_0x2895('0xb'),'fields':[_0x2895('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x29b6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x29b6,0x17e));var _0x629b=function(_0x582a2e,_0x113f68){_0x582a2e=_0x582a2e-0x0;var _0x3f83dd=_0x29b6[_0x582a2e];return _0x3f83dd;};'use strict';var _=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var logger=require(_0x629b('0x2'))(_0x629b('0x3'));var moment=require(_0x629b('0x4'));var BPromise=require(_0x629b('0x5'));var rp=require(_0x629b('0x6'));var fs=require('fs');var path=require(_0x629b('0x7'));var rimraf=require(_0x629b('0x8'));var config=require(_0x629b('0x9'));var attributes=require('./cmHopperHistory.attributes');module[_0x629b('0xa')]=function(_0x532d0e,_0x810a16){return _0x532d0e[_0x629b('0xb')](_0x629b('0xc'),attributes,{'tableName':_0x629b('0xd'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x629b('0xe')]},{'name':_0x629b('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index b6297a1..60c5c13 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 _0x2547=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','findAll','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','util'];(function(_0x7f0676,_0x2a9948){var _0x1afce7=function(_0x8501bf){while(--_0x8501bf){_0x7f0676['push'](_0x7f0676['shift']());}};_0x1afce7(++_0x2a9948);}(_0x2547,0x1cd));var _0x7254=function(_0x24661d,_0x426157){_0x24661d=_0x24661d-0x0;var _0x23f51c=_0x2547[_0x24661d];return _0x23f51c;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')](_0x2737e0[_0x7254('0x19')],{'raw':_0x2737e0[_0x7254('0x1a')]?_0x2737e0[_0x7254('0x1a')][_0x7254('0x1b')]===undefined?!![]:![]:!![]})[_0x7254('0x1c')](function(_0x3b6cb6){logger[_0x7254('0x14')](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')](_0x7254('0x16'),_0x2737e0,JSON[_0x7254('0x11')](_0x3b6cb6));_0x1f48f6(_0x3b6cb6);})[_0x7254('0x15')](function(_0x2bb2fe){logger[_0x7254('0x12')](_0x7254('0x16'),_0x2bb2fe[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b[_0x7254('0x12')](0x1f4,_0x2bb2fe['message']));});});};exports['AvgHandleTime']=function(_0x136ea3){var _0xd91c1f=this;return new Promise(function(_0x1c24ea,_0x54dace){return db[_0x7254('0x17')][_0x7254('0x1d')]({'raw':_0x136ea3[_0x7254('0x1a')]?_0x136ea3['options'][_0x7254('0x1b')]===undefined?!![]:![]:!![],'where':_0x136ea3[_0x7254('0x1a')]?_0x136ea3[_0x7254('0x1a')]['where']||null:null,'attributes':[[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')][_0x7254('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x22')))),_0x7254('0x23')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0x7254('0x24')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x25')))),_0x7254('0x26')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x27'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x27'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x28')))),_0x7254('0x29')]]})[_0x7254('0x1c')](function(_0x447515){logger[_0x7254('0x14')](_0x7254('0x2a'),_0x136ea3);logger[_0x7254('0xf')](_0x7254('0x2a'),_0x136ea3,JSON[_0x7254('0x11')](_0x447515));_0x1c24ea(_0x447515);})['catch'](function(_0x1fd417){logger[_0x7254('0x12')](_0x7254('0x2a'),_0x1fd417[_0x7254('0x13')],_0x136ea3);_0x54dace(_0xd91c1f[_0x7254('0x12')](0x1f4,_0x1fd417['message']));});});};exports[_0x7254('0x2b')]=function(_0x5e36b0){var _0x64067b=this;return new Promise(function(_0xb7716a,_0x3bb517){return db[_0x7254('0x17')][_0x7254('0x1d')]({'raw':_0x5e36b0['options']?_0x5e36b0[_0x7254('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5e36b0[_0x7254('0x1a')]?_0x5e36b0[_0x7254('0x1a')]['where']||null:null,'attributes':[[_0x7254('0x2c'),_0x7254('0x2d')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal'](_0x7254('0x2e')))),_0x7254('0x2f')],[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x7254('0x30')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7254('0x31')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x7254('0x32')))),'outboundBusyCallsDay'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x7254('0x33')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x7254('0x34')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7254('0x35')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')](_0x7254('0x36')))),'outboundUnknownCallsDay'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')](_0x7254('0x37')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x38')))),'outboundRejectCallsDay'],[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x7254('0x39')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x3a')))),_0x7254('0x3b')],[db[_0x7254('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x3c')))),_0x7254('0x3d')]],'group':[_0x7254('0x2c')]})['then'](function(_0x5a44fb){logger[_0x7254('0x14')](_0x7254('0x2b'),_0x5e36b0);logger[_0x7254('0xf')](_0x7254('0x2b'),_0x5e36b0,JSON['stringify'](_0x5a44fb));_0xb7716a(_0x5a44fb);})[_0x7254('0x15')](function(_0x3e3d09){logger['error'](_0x7254('0x2b'),_0x3e3d09['message'],_0x5e36b0);_0x3bb517(_0x64067b[_0x7254('0x12')](0x1f4,_0x3e3d09['message']));});});};exports[_0x7254('0x3e')]=function(_0x5cd945){var _0x55119e=this;return new Promise(function(_0x302ffc,_0x2ef688){return db[_0x7254('0x17')][_0x7254('0x1d')]({'raw':_0x5cd945['options']?_0x5cd945[_0x7254('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5cd945[_0x7254('0x1a')]?_0x5cd945[_0x7254('0x1a')][_0x7254('0x3f')]||null:null,'attributes':[[_0x7254('0x2c'),_0x7254('0x2d')],[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')][_0x7254('0x1f')]('id')),_0x7254('0x40')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')](_0x7254('0x22')))),_0x7254('0x41')]],'group':[_0x7254('0x2c')]})[_0x7254('0x1c')](function(_0x2396ce){logger[_0x7254('0x14')]('GetCampaignHopperHistory',_0x5cd945);logger['debug'](_0x7254('0x3e'),_0x5cd945,JSON['stringify'](_0x2396ce));_0x302ffc(_0x2396ce);})['catch'](function(_0xbd4dbf){logger[_0x7254('0x12')](_0x7254('0x3e'),_0xbd4dbf['message'],_0x5cd945);_0x2ef688(_0x55119e[_0x7254('0x12')](0x1f4,_0xbd4dbf['message']));});});}; \ No newline at end of file +var _0x579c=['outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','findAll','COUNT','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','where','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null'];(function(_0x1e64b6,_0x3dc8a4){var _0x3adeb5=function(_0x5bb1b4){while(--_0x5bb1b4){_0x1e64b6['push'](_0x1e64b6['shift']());}};_0x3adeb5(++_0x3dc8a4);}(_0x579c,0xda));var _0xc579=function(_0x469ac0,_0x2a13c7){_0x469ac0=_0x469ac0-0x0;var _0x806df5=_0x579c[_0x469ac0];return _0x806df5;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});}exports[_0xc579('0x18')]=function(_0x33d341){var _0xbbbe3e=this;return new Promise(function(_0x3da8a1,_0xa41248){return db[_0xc579('0x19')]['create'](_0x33d341[_0xc579('0x1a')],{'raw':_0x33d341[_0xc579('0x1b')]?_0x33d341['options'][_0xc579('0x1c')]===undefined?!![]:![]:!![]})[_0xc579('0xd')](function(_0x14fcdd){logger[_0xc579('0xe')](_0xc579('0x18'),_0x33d341);logger[_0xc579('0x10')](_0xc579('0x18'),_0x33d341,JSON[_0xc579('0x13')](_0x14fcdd));_0x3da8a1(_0x14fcdd);})['catch'](function(_0x92657f){logger[_0xc579('0x14')](_0xc579('0x18'),_0x92657f[_0xc579('0x16')],_0x33d341);_0xa41248(_0xbbbe3e[_0xc579('0x14')](0x1f4,_0x92657f['message']));});});};exports[_0xc579('0x1d')]=function(_0x3cf83f){var _0x1641e2=this;return new Promise(function(_0x4dec5e,_0x45e1ac){return db['CmHopperHistory'][_0xc579('0x1e')]({'raw':_0x3cf83f[_0xc579('0x1b')]?_0x3cf83f[_0xc579('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3cf83f[_0xc579('0x1b')]?_0x3cf83f['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xc579('0x1f'),db[_0xc579('0x20')][_0xc579('0x21')]('id')),_0xc579('0x22')],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db['sequelize']['literal'](_0xc579('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x25')))),_0xc579('0x26')],[db[_0xc579('0x20')]['fn']('COUNT',db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xc579('0x28'),db['sequelize']['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x29')))),_0xc579('0x2a')],[db[_0xc579('0x20')]['fn']('AVG',db[_0xc579('0x20')]['fn']('IF',db['sequelize'][_0xc579('0x24')](_0xc579('0x2b')))),'predictiveIntervalAvgTalktime']]})[_0xc579('0xd')](function(_0x249fdc){logger['info']('AvgHandleTime',_0x3cf83f);logger[_0xc579('0x10')](_0xc579('0x1d'),_0x3cf83f,JSON['stringify'](_0x249fdc));_0x4dec5e(_0x249fdc);})[_0xc579('0x17')](function(_0x40d0dd){logger['error'](_0xc579('0x1d'),_0x40d0dd['message'],_0x3cf83f);_0x45e1ac(_0x1641e2[_0xc579('0x14')](0x1f4,_0x40d0dd[_0xc579('0x16')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x198d87){var _0x288e15=this;return new Promise(function(_0x131343,_0x2fcdb5){return db[_0xc579('0x19')][_0xc579('0x1e')]({'raw':_0x198d87['options']?_0x198d87[_0xc579('0x1b')][_0xc579('0x1c')]===undefined?!![]:![]:!![],'where':_0x198d87['options']?_0x198d87[_0xc579('0x1b')][_0xc579('0x2c')]||null:null,'attributes':[[_0xc579('0x2d'),_0xc579('0x2e')],[db['sequelize']['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0xc579('0x20')]['fn']('COUNT',db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x23')))),_0xc579('0x30')],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db['sequelize'][_0xc579('0x24')](_0xc579('0x31')))),_0xc579('0x32')],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db['sequelize'][_0xc579('0x24')](_0xc579('0x33')))),_0xc579('0x34')],[db['sequelize']['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')]['literal'](_0xc579('0x35')))),'outboundDropCallsDayTimeout'],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db['sequelize'][_0xc579('0x24')](_0xc579('0x36')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')]['literal'](_0xc579('0x37')))),_0xc579('0x38')],[db['sequelize']['fn'](_0xc579('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xc579('0x39')))),_0xc579('0x3a')],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['fn']('IF',db['sequelize'][_0xc579('0x24')](_0xc579('0x3b')))),_0xc579('0x3c')],[db['sequelize']['fn']('COUNT',db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x3d')))),_0xc579('0x3e')],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xc579('0x24')](_0xc579('0x3f')))),'outboundRejectCallsDay'],[db[_0xc579('0x20')]['fn']('COUNT',db[_0xc579('0x20')]['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x40')))),_0xc579('0x41')]],'group':[_0xc579('0x2d')]})['then'](function(_0x563970){logger[_0xc579('0xe')](_0xc579('0x42'),_0x198d87);logger['debug'](_0xc579('0x42'),_0x198d87,JSON['stringify'](_0x563970));_0x131343(_0x563970);})[_0xc579('0x17')](function(_0x1b0931){logger[_0xc579('0x14')](_0xc579('0x42'),_0x1b0931['message'],_0x198d87);_0x2fcdb5(_0x288e15['error'](0x1f4,_0x1b0931[_0xc579('0x16')]));});});};exports['GetCampaignHopperHistory']=function(_0x205410){var _0x3737f1=this;return new Promise(function(_0x2aafde,_0x4d892c){return db[_0xc579('0x19')][_0xc579('0x1e')]({'raw':_0x205410['options']?_0x205410[_0xc579('0x1b')][_0xc579('0x1c')]===undefined?!![]:![]:!![],'where':_0x205410[_0xc579('0x1b')]?_0x205410[_0xc579('0x1b')][_0xc579('0x2c')]||null:null,'attributes':[['campaign','name'],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db[_0xc579('0x20')]['col']('id')),'ivrTotalCallsDays'],[db[_0xc579('0x20')]['fn'](_0xc579('0x1f'),db['sequelize']['fn']('IF',db[_0xc579('0x20')][_0xc579('0x24')](_0xc579('0x23')))),_0xc579('0x43')]],'group':[_0xc579('0x2d')]})[_0xc579('0xd')](function(_0x2fcfdc){logger['info'](_0xc579('0x44'),_0x205410);logger[_0xc579('0x10')](_0xc579('0x44'),_0x205410,JSON[_0xc579('0x13')](_0x2fcfdc));_0x2aafde(_0x2fcfdc);})[_0xc579('0x17')](function(_0x4c08c5){logger[_0xc579('0x14')](_0xc579('0x44'),_0x4c08c5[_0xc579('0x16')],_0x205410);_0x4d892c(_0x3737f1[_0xc579('0x14')](0x1f4,_0x4c08c5[_0xc579('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d6b2b95..1e5fb3e 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 _0x4394=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','multer','util','path','connect-timeout'];(function(_0x5a9330,_0x11ccb6){var _0x2104b9=function(_0x4eb9ca){while(--_0x4eb9ca){_0x5a9330['push'](_0x5a9330['shift']());}};_0x2104b9(++_0x11ccb6);}(_0x4394,0x11a));var _0x4439=function(_0x2c8de4,_0x48ecd7){_0x2c8de4=_0x2c8de4-0x0;var _0xa5f1d5=_0x4394[_0x2c8de4];return _0xa5f1d5;};'use strict';var multer=require(_0x4439('0x0'));var util=require(_0x4439('0x1'));var path=require(_0x4439('0x2'));var timeout=require(_0x4439('0x3'));var express=require(_0x4439('0x4'));var router=express[_0x4439('0x5')]();var fs_extra=require(_0x4439('0x6'));var auth=require(_0x4439('0x7'));var interaction=require(_0x4439('0x8'));var config=require(_0x4439('0x9'));var controller=require(_0x4439('0xa'));router[_0x4439('0xb')]('/',auth[_0x4439('0xc')](),controller[_0x4439('0xd')]);router[_0x4439('0xb')](_0x4439('0xe'),auth[_0x4439('0xc')](),controller[_0x4439('0xf')]);router[_0x4439('0xb')](_0x4439('0x10'),auth['isAuthenticated'](),controller[_0x4439('0x11')]);router[_0x4439('0x12')]('/',auth[_0x4439('0xc')](),controller[_0x4439('0x13')]);router[_0x4439('0x14')](_0x4439('0x10'),auth['isAuthenticated'](),controller[_0x4439('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4779=['put','update','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4779,0x120));var _0x9477=function(_0x3ef2fa,_0x4fd786){_0x3ef2fa=_0x3ef2fa-0x0;var _0x37f638=_0x4779[_0x3ef2fa];return _0x37f638;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9477('0x0'));var timeout=require(_0x9477('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9477('0x2'));var auth=require(_0x9477('0x3'));var interaction=require(_0x9477('0x4'));var config=require(_0x9477('0x5'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9477('0x6')]('/describe',auth[_0x9477('0x7')](),controller['describe']);router[_0x9477('0x6')](_0x9477('0x8'),auth[_0x9477('0x7')](),controller[_0x9477('0x9')]);router[_0x9477('0xa')]('/',auth[_0x9477('0x7')](),controller[_0x9477('0xb')]);router[_0x9477('0xc')](_0x9477('0x8'),auth[_0x9477('0x7')](),controller[_0x9477('0xd')]);module[_0x9477('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 799a277..0d8ba51 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 _0x6658=['sequelize','exports','STRING','name'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6658,0x198));var _0x8665=function(_0x2c6a19,_0x3e4040){_0x2c6a19=_0x2c6a19-0x0;var _0xbf21ac=_0x6658[_0x2c6a19];return _0xbf21ac;};'use strict';var Sequelize=require(_0x8665('0x0'));module[_0x8665('0x1')]={'name':{'type':Sequelize[_0x8665('0x2')],'unique':_0x8665('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8665('0x2')]},'dialPrefix':{'type':Sequelize[_0x8665('0x2')]}}; \ No newline at end of file +var _0x50d0=['STRING','name','sequelize'];(function(_0x3cc8c2,_0x3297a1){var _0x4a6c79=function(_0xf88d46){while(--_0xf88d46){_0x3cc8c2['push'](_0x3cc8c2['shift']());}};_0x4a6c79(++_0x3297a1);}(_0x50d0,0x101));var _0x050d=function(_0x4c271a,_0x461918){_0x4c271a=_0x4c271a-0x0;var _0x44acc1=_0x50d0[_0x4c271a];return _0x44acc1;};'use strict';var Sequelize=require(_0x050d('0x0'));module['exports']={'name':{'type':Sequelize[_0x050d('0x1')],'unique':_0x050d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x050d('0x1')]},'dialPrefix':{'type':Sequelize[_0x050d('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 1791b3a..41e9db8 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 _0xb73c=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','addDisposition','ListId','getDispositions','Disposition','removeDispositions','ids','addContacts','CmContact','describe','tags','isArray','join','push','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','addCustomField','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','omit','spread','removeAgents','emit','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmList','include','findAll','rows','catch','show','params','keys','includeAll','create'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xb73c,0xd2));var _0xcb73=function(_0x330712,_0x35ec18){_0x330712=_0x330712-0x0;var _0x12731f=_0xb73c[_0x330712];return _0x12731f;};'use strict';var emlformat=require(_0xcb73('0x0'));var rimraf=require(_0xcb73('0x1'));var zipdir=require(_0xcb73('0x2'));var jsonpatch=require(_0xcb73('0x3'));var rp=require('request-promise');var moment=require(_0xcb73('0x4'));var BPromise=require(_0xcb73('0x5'));var Mustache=require(_0xcb73('0x6'));var util=require('util');var path=require(_0xcb73('0x7'));var sox=require(_0xcb73('0x8'));var csv=require(_0xcb73('0x9'));var ejs=require(_0xcb73('0xa'));var fs=require('fs');var fs_extra=require(_0xcb73('0xb'));var _=require(_0xcb73('0xc'));var squel=require(_0xcb73('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb73('0xe'));var toCsv=require(_0xcb73('0x9'));var querystring=require(_0xcb73('0xf'));var Papa=require(_0xcb73('0x10'));var Redis=require('ioredis');var authService=require(_0xcb73('0x11'));var qs=require(_0xcb73('0x12'));var as=require(_0xcb73('0x13'));var hardwareService=require(_0xcb73('0x14'));var logger=require(_0xcb73('0x15'))(_0xcb73('0x16'));var utils=require(_0xcb73('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcb73('0x18'));var db=require(_0xcb73('0x19'))['db'];config[_0xcb73('0x1a')]=_[_0xcb73('0x1b')](config[_0xcb73('0x1a')],{'host':_0xcb73('0x1c'),'port':0x18eb});var socket=require(_0xcb73('0x1d'))(new Redis(config['redis']));require(_0xcb73('0x1e'))[_0xcb73('0x1f')](socket);function respondWithStatusCode(_0x1b1023,_0x5c3473){_0x5c3473=_0x5c3473||0xcc;return function(_0x228ef9){if(_0x228ef9){return _0x1b1023['sendStatus'](_0x5c3473);}return _0x1b1023[_0xcb73('0x20')](_0x5c3473)[_0xcb73('0x21')]();};}function respondWithResult(_0x318b2e,_0x3caeed){_0x3caeed=_0x3caeed||0xc8;return function(_0x3f9896){if(_0x3f9896){return _0x318b2e[_0xcb73('0x20')](_0x3caeed)[_0xcb73('0x22')](_0x3f9896);}};}function respondWithFilteredResult(_0x10e02b,_0x2e7e9b){return function(_0x19c4b6){if(_0x19c4b6){var _0x9102a6=typeof _0x2e7e9b[_0xcb73('0x23')]===_0xcb73('0x24')&&typeof _0x2e7e9b[_0xcb73('0x25')]==='undefined';var _0x5e2a7e=_0x19c4b6[_0xcb73('0x26')];var _0x259368=_0x9102a6?0x0:_0x2e7e9b[_0xcb73('0x23')];var _0x2f84a1=_0x9102a6?_0x19c4b6[_0xcb73('0x26')]:_0x2e7e9b[_0xcb73('0x23')]+_0x2e7e9b['limit'];var _0x561aa8;if(_0x2f84a1>=_0x5e2a7e){_0x2f84a1=_0x5e2a7e;_0x561aa8=0xc8;}else{_0x561aa8=0xce;}_0x10e02b[_0xcb73('0x20')](_0x561aa8);return _0x10e02b['set']('Content-Range',_0x259368+'-'+_0x2f84a1+'/'+_0x5e2a7e)['json'](_0x19c4b6);}return null;};}function patchUpdates(_0x1d2062){return function(_0x2aa2aa){try{jsonpatch[_0xcb73('0x27')](_0x2aa2aa,_0x1d2062,!![]);}catch(_0xd5ecd8){return BPromise[_0xcb73('0x28')](_0xd5ecd8);}return _0x2aa2aa[_0xcb73('0x29')]();};}function saveUpdates(_0x3d8022,_0x34eddc){return function(_0x167b62){if(_0x167b62){return _0x167b62[_0xcb73('0x2a')](_0x3d8022)[_0xcb73('0x2b')](function(_0x4ef666){return _0x4ef666;});}return null;};}function removeEntity(_0x3e2639,_0x5c71ab){return function(_0xfaf008){if(_0xfaf008){return _0xfaf008['destroy']()[_0xcb73('0x2b')](function(){var _0xb3461f=_0xfaf008[_0xcb73('0x2c')]({'plain':!![]});var _0x15c1d0=_0xcb73('0x2d');return db[_0xcb73('0x2e')][_0xcb73('0x2f')]({'where':{'type':_0x15c1d0,'resourceId':_0xb3461f['id']}})[_0xcb73('0x2b')](function(){return _0xfaf008;});})[_0xcb73('0x2b')](function(){_0x3e2639[_0xcb73('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498cd6,_0x39599d){return function(_0x417404){if(!_0x417404){_0x498cd6[_0xcb73('0x30')](0x194);}return _0x417404;};}function handleError(_0x179cbc,_0x1e4f3f){_0x1e4f3f=_0x1e4f3f||0x1f4;return function(_0x462005){logger['error'](_0x462005[_0xcb73('0x31')]);if(_0x462005['name']){delete _0x462005[_0xcb73('0x32')];}_0x179cbc[_0xcb73('0x20')](_0x1e4f3f)['send'](_0x462005);};}exports[_0xcb73('0x33')]=function(_0x4257aa,_0x36821b){var _0x8cd3b8={},_0x43b435={},_0x36dabc={'count':0x0,'rows':[]};var _0x554d3e=_[_0xcb73('0x34')](db['CmList'][_0xcb73('0x35')],function(_0x4aa54f){return{'name':_0x4aa54f[_0xcb73('0x36')],'type':_0x4aa54f[_0xcb73('0x37')][_0xcb73('0x38')]};});_0x43b435[_0xcb73('0x39')]=_[_0xcb73('0x34')](_0x554d3e,'name');_0x43b435['query']=_['keys'](_0x4257aa[_0xcb73('0x3a')]);_0x43b435[_0xcb73('0x3b')]=_[_0xcb73('0x3c')](_0x43b435['model'],_0x43b435['query']);_0x8cd3b8[_0xcb73('0x3d')]=_[_0xcb73('0x3c')](_0x43b435['model'],qs[_0xcb73('0x3e')](_0x4257aa[_0xcb73('0x3a')][_0xcb73('0x3e')]));_0x8cd3b8[_0xcb73('0x3d')]=_0x8cd3b8[_0xcb73('0x3d')][_0xcb73('0x3f')]?_0x8cd3b8[_0xcb73('0x3d')]:_0x43b435[_0xcb73('0x39')];if(!_0x4257aa['query'][_0xcb73('0x40')](_0xcb73('0x41'))){_0x8cd3b8['limit']=qs['limit'](_0x4257aa['query'][_0xcb73('0x25')]);_0x8cd3b8[_0xcb73('0x23')]=qs[_0xcb73('0x23')](_0x4257aa[_0xcb73('0x3a')][_0xcb73('0x23')]);}_0x8cd3b8[_0xcb73('0x42')]=qs['sort'](_0x4257aa[_0xcb73('0x3a')][_0xcb73('0x43')]);_0x8cd3b8[_0xcb73('0x44')]=qs[_0xcb73('0x3b')](_[_0xcb73('0x45')](_0x4257aa[_0xcb73('0x3a')],_0x43b435[_0xcb73('0x3b')]),_0x554d3e);if(_0x4257aa[_0xcb73('0x3a')][_0xcb73('0x46')]){_0x8cd3b8[_0xcb73('0x44')]=_[_0xcb73('0x47')](_0x8cd3b8[_0xcb73('0x44')],{'$or':_[_0xcb73('0x34')](_0x554d3e,function(_0x373e9f){if(_0x373e9f[_0xcb73('0x37')]!==_0xcb73('0x48')){var _0x306ad2={};_0x306ad2[_0x373e9f[_0xcb73('0x32')]]={'$like':'%'+_0x4257aa['query'][_0xcb73('0x46')]+'%'};return _0x306ad2;}})});}_0x8cd3b8=_['merge']({},_0x8cd3b8,_0x4257aa[_0xcb73('0x49')]);var _0x24107a={'where':_0x8cd3b8[_0xcb73('0x44')]};return db[_0xcb73('0x4a')][_0xcb73('0x26')](_0x24107a)[_0xcb73('0x2b')](function(_0x2a5a4e){_0x36dabc[_0xcb73('0x26')]=_0x2a5a4e;if(_0x4257aa[_0xcb73('0x3a')]['includeAll']){_0x8cd3b8[_0xcb73('0x4b')]=[{'all':!![]}];}return db[_0xcb73('0x4a')][_0xcb73('0x4c')](_0x8cd3b8);})[_0xcb73('0x2b')](function(_0x2c181f){_0x36dabc[_0xcb73('0x4d')]=_0x2c181f;return _0x36dabc;})[_0xcb73('0x2b')](respondWithFilteredResult(_0x36821b,_0x8cd3b8))[_0xcb73('0x4e')](handleError(_0x36821b,null));};exports[_0xcb73('0x4f')]=function(_0x927c30,_0x4cdca5){var _0x4ea450={'raw':![],'where':{'id':_0x927c30[_0xcb73('0x50')]['id']}},_0x626a3f={};_0x626a3f[_0xcb73('0x39')]=_[_0xcb73('0x51')](db['CmList'][_0xcb73('0x35')]);_0x626a3f[_0xcb73('0x3a')]=_[_0xcb73('0x51')](_0x927c30['query']);_0x626a3f[_0xcb73('0x3b')]=_[_0xcb73('0x3c')](_0x626a3f[_0xcb73('0x39')],_0x626a3f[_0xcb73('0x3a')]);_0x4ea450[_0xcb73('0x3d')]=_['intersection'](_0x626a3f['model'],qs['fields'](_0x927c30['query'][_0xcb73('0x3e')]));_0x4ea450[_0xcb73('0x3d')]=_0x4ea450[_0xcb73('0x3d')]['length']?_0x4ea450[_0xcb73('0x3d')]:_0x626a3f[_0xcb73('0x39')];if(_0x927c30[_0xcb73('0x3a')][_0xcb73('0x52')]){_0x4ea450[_0xcb73('0x4b')]=[{'all':!![]}];}_0x4ea450=_['merge']({},_0x4ea450,_0x927c30[_0xcb73('0x49')]);return db[_0xcb73('0x4a')]['find'](_0x4ea450)['then'](handleEntityNotFound(_0x4cdca5,null))['then'](respondWithResult(_0x4cdca5,null))[_0xcb73('0x4e')](handleError(_0x4cdca5,null));};exports['create']=function(_0x4ce564,_0xa37451){return db[_0xcb73('0x4a')][_0xcb73('0x53')](_0x4ce564['body'],{})[_0xcb73('0x2b')](function(_0x7ba81c){var _0x2a4746=_0x4ce564[_0xcb73('0x54')][_0xcb73('0x2c')]({'plain':!![]});if(!_0x2a4746)throw new Error(_0xcb73('0x55'));if(_0x2a4746[_0xcb73('0x56')]==='user'){var _0x226a34=_0x7ba81c[_0xcb73('0x2c')]({'plain':!![]});var _0x5bf62c=_0xcb73('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x5bf62c,'userProfileId':_0x2a4746[_0xcb73('0x57')]},'raw':!![]})['then'](function(_0x5db3ba){if(_0x5db3ba&&_0x5db3ba[_0xcb73('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x226a34['name'],'resourceId':_0x226a34['id'],'type':_0x5db3ba[_0xcb73('0x32')],'sectionId':_0x5db3ba['id']},{})[_0xcb73('0x2b')](function(){return _0x7ba81c;});}else{return _0x7ba81c;}})[_0xcb73('0x4e')](function(_0x457cc4){logger[_0xcb73('0x59')](_0xcb73('0x5a'),_0x457cc4);throw _0x457cc4;});}return _0x7ba81c;})['then'](respondWithResult(_0xa37451,0xc9))['catch'](handleError(_0xa37451,null));};exports[_0xcb73('0x2a')]=function(_0x341bbf,_0x10bd80){if(_0x341bbf['body']['id']){delete _0x341bbf[_0xcb73('0x5b')]['id'];}return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x341bbf['params']['id']}})['then'](handleEntityNotFound(_0x10bd80,null))['then'](saveUpdates(_0x341bbf[_0xcb73('0x5b')],null))[_0xcb73('0x2b')](respondWithResult(_0x10bd80,null))[_0xcb73('0x4e')](handleError(_0x10bd80,null));};exports[_0xcb73('0x2f')]=function(_0x53d364,_0xbf9624){return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x53d364[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0xbf9624,null))[_0xcb73('0x2b')](removeEntity(_0xbf9624,null))[_0xcb73('0x4e')](handleError(_0xbf9624,null));};exports['describe']=function(_0x499d2d,_0x4c7b51){return db[_0xcb73('0x4a')]['describe']()[_0xcb73('0x2b')](respondWithResult(_0x4c7b51,null))[_0xcb73('0x4e')](handleError(_0x4c7b51,null));};exports[_0xcb73('0x5d')]=function(_0x1c00cc,_0x5ad507,_0x1e4902){if(_0x1c00cc[_0xcb73('0x5b')]['id']){delete _0x1c00cc[_0xcb73('0x5b')]['id'];}return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x1c00cc['params']['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x5ad507,null))[_0xcb73('0x2b')](function(_0xa37821){if(_0xa37821){_0x1c00cc['body'][_0xcb73('0x5e')]=_0xa37821['id'];return db['Disposition']['create'](_0x1c00cc[_0xcb73('0x5b')]);}})[_0xcb73('0x2b')](respondWithResult(_0x5ad507,null))[_0xcb73('0x4e')](handleError(_0x5ad507,null));};exports[_0xcb73('0x5f')]=function(_0x5b8aab,_0x297e7a,_0x43baab){var _0x301693={'raw':![],'where':{}};var _0xb25ed7={};var _0x417c10={'count':0x0,'rows':[]};return db[_0xcb73('0x4a')]['findOne']({'where':{'id':_0x5b8aab[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x297e7a,null))[_0xcb73('0x2b')](function(_0x5d9554){if(_0x5d9554){_0xb25ed7['model']=_[_0xcb73('0x51')](db[_0xcb73('0x60')][_0xcb73('0x35')]);_0xb25ed7[_0xcb73('0x3a')]=_[_0xcb73('0x51')](_0x5b8aab[_0xcb73('0x3a')]);_0xb25ed7['filters']=_[_0xcb73('0x3c')](_0xb25ed7['model'],_0xb25ed7['query']);_0x301693[_0xcb73('0x3d')]=_[_0xcb73('0x3c')](_0xb25ed7['model'],qs[_0xcb73('0x3e')](_0x5b8aab[_0xcb73('0x3a')]['fields']));_0x301693['attributes']=_0x301693[_0xcb73('0x3d')]['length']?_0x301693['attributes']:_0xb25ed7[_0xcb73('0x39')];if(!_0x5b8aab[_0xcb73('0x3a')]['hasOwnProperty'](_0xcb73('0x41'))){_0x301693['limit']=qs[_0xcb73('0x25')](_0x5b8aab[_0xcb73('0x3a')][_0xcb73('0x25')]);_0x301693['offset']=qs[_0xcb73('0x23')](_0x5b8aab['query'][_0xcb73('0x23')]);}_0x301693[_0xcb73('0x42')]=qs[_0xcb73('0x43')](_0x5b8aab[_0xcb73('0x3a')]['sort']);_0x301693[_0xcb73('0x44')]=qs[_0xcb73('0x3b')](_[_0xcb73('0x45')](_0x5b8aab[_0xcb73('0x3a')],_0xb25ed7['filters']));_0x301693[_0xcb73('0x44')][_0xcb73('0x5e')]=_0x5d9554['id'];if(_0x5b8aab[_0xcb73('0x3a')][_0xcb73('0x46')]){_0x301693[_0xcb73('0x44')]=_[_0xcb73('0x47')](_0x301693['where'],{'$or':_[_0xcb73('0x34')](_0x301693['attributes'],function(_0x4e05d8){var _0x43039e={};_0x43039e[_0x4e05d8]={'$like':'%'+_0x5b8aab[_0xcb73('0x3a')]['filter']+'%'};return _0x43039e;})});}_0x301693=_[_0xcb73('0x47')]({},_0x301693,_0x5b8aab[_0xcb73('0x49')]);return db['Disposition'][_0xcb73('0x26')]({'where':_0x301693[_0xcb73('0x44')]})[_0xcb73('0x2b')](function(_0x2bf7cc){_0x417c10['count']=_0x2bf7cc;if(_0x5b8aab[_0xcb73('0x3a')][_0xcb73('0x52')]){_0x301693['include']=[{'all':!![]}];}return db[_0xcb73('0x60')][_0xcb73('0x4c')](_0x301693);})['then'](function(_0x45fa65){_0x417c10['rows']=_0x45fa65;return _0x417c10;});}})[_0xcb73('0x2b')](respondWithFilteredResult(_0x297e7a,_0x301693))['catch'](handleError(_0x297e7a,null));};exports[_0xcb73('0x61')]=function(_0x50952e,_0x3411cf,_0x10b20d){return db[_0xcb73('0x4a')]['find']({'where':{'id':_0x50952e[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x3411cf,null))['then'](function(_0x106e0b){if(_0x106e0b){return _0x106e0b[_0xcb73('0x61')](_0x50952e[_0xcb73('0x3a')][_0xcb73('0x62')]);}})['then'](respondWithStatusCode(_0x3411cf,null))[_0xcb73('0x4e')](handleError(_0x3411cf,null));};exports[_0xcb73('0x63')]=function(_0x22ca7c,_0x2ced1c,_0x579c63){return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x22ca7c[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x2ced1c,null))[_0xcb73('0x2b')](function(_0x1d5a0f){if(_0x1d5a0f){var _0x412c68=[];var _0x496ef4={'success':[],'errors':[]};return db[_0xcb73('0x64')][_0xcb73('0x65')]()[_0xcb73('0x2b')](function(_0x2ebc36){if(_0x22ca7c[_0xcb73('0x5b')][_0xcb73('0x66')]&&_[_0xcb73('0x67')](_0x22ca7c['body']['tags'])){if(_0x22ca7c['body']['tags'][_0xcb73('0x3f')]){_0x22ca7c[_0xcb73('0x5b')][_0xcb73('0x66')]=_0x22ca7c[_0xcb73('0x5b')][_0xcb73('0x66')][_0xcb73('0x68')](';')+';';}else{_0x22ca7c[_0xcb73('0x5b')][_0xcb73('0x66')]=null;}}else{_0x22ca7c[_0xcb73('0x5b')][_0xcb73('0x66')]=null;}if(_0x22ca7c['body']&&_[_0xcb73('0x67')](_0x22ca7c[_0xcb73('0x5b')])){for(var _0x36ad8d=0x0;_0x36ad8d<_0x22ca7c['body'][_0xcb73('0x3f')];_0x36ad8d+=0x1){_0x22ca7c[_0xcb73('0x5b')][_0x36ad8d][_0xcb73('0x5e')]=_0x22ca7c[_0xcb73('0x50')]['id'];_0x412c68[_0xcb73('0x69')](_0x22ca7c[_0xcb73('0x5b')][_0x36ad8d]);}return BPromise['each'](_0x412c68,function(_0x45584f){return db['CmContact'][_0xcb73('0x53')](_['omit'](_0x45584f,[_0xcb73('0x62'),'id'])||{},{'fields':_['keys'](_0x2ebc36),'raw':!![]})[_0xcb73('0x2b')](function(_0x2d1ad8){_0x496ef4[_0xcb73('0x6a')][_0xcb73('0x69')](_0x2d1ad8[_0xcb73('0x6b')]);})[_0xcb73('0x4e')](function(_0x13e9d9){_0x496ef4[_0xcb73('0x6c')][_0xcb73('0x69')]({'data':_0x45584f,'error':_0x13e9d9['message']});});})[_0xcb73('0x2b')](function(_0x3368f0){return _0x496ef4;})[_0xcb73('0x4e')](function(_0x163cb6){return _0x163cb6;});}else{_0x2ced1c['status'](0x190)['json']({'message':_0xcb73('0x6d')});}});}})[_0xcb73('0x2b')](respondWithResult(_0x2ced1c,null))['catch'](handleError(_0x2ced1c,null));};exports[_0xcb73('0x6e')]=function(_0x3c86ae,_0x1f2af0,_0x59e0e9){var _0x43c282;return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x3c86ae[_0xcb73('0x50')]['id']},'include':[{'model':db[_0xcb73('0x6f')],'as':'CustomFields'}]})[_0xcb73('0x2b')](handleEntityNotFound(_0x1f2af0,null))['then'](function(_0x38b0ee){if(_0x38b0ee){_0x43c282=_0x38b0ee;return db[_0xcb73('0x64')][_0xcb73('0x35')];}})['then'](function(_0x5f3637){if(_0x5f3637){var _0x249118={};var _0x893d10={};_0x893d10[_0xcb73('0x39')]=_[_0xcb73('0x70')](_[_0xcb73('0x51')](_0x5f3637),_[_0xcb73('0x34')](_0x43c282[_0xcb73('0x71')],function(_0x538b2b){return util[_0xcb73('0x72')](_0xcb73('0x73'),_0x538b2b['id']);}));_0x893d10[_0xcb73('0x3a')]=_[_0xcb73('0x51')](_0x3c86ae[_0xcb73('0x3a')]);_0x893d10[_0xcb73('0x3b')]=_['intersection'](_0x893d10['model'],_0x893d10['query']);_0x249118[_0xcb73('0x3d')]=_[_0xcb73('0x3c')](_0x893d10[_0xcb73('0x39')],qs['fields'](_0x3c86ae[_0xcb73('0x3a')][_0xcb73('0x3e')]));_0x249118[_0xcb73('0x3d')]=_0x249118[_0xcb73('0x3d')]['length']?_0x249118['attributes']:_0x893d10['model'];if(!_0x3c86ae[_0xcb73('0x3a')][_0xcb73('0x40')]('nolimit')){_0x249118['limit']=qs['limit'](_0x3c86ae[_0xcb73('0x3a')][_0xcb73('0x25')]);_0x249118[_0xcb73('0x23')]=qs[_0xcb73('0x23')](_0x3c86ae[_0xcb73('0x3a')][_0xcb73('0x23')]);}_0x249118[_0xcb73('0x42')]=qs[_0xcb73('0x43')](_0x3c86ae[_0xcb73('0x3a')][_0xcb73('0x43')]);_0x249118[_0xcb73('0x44')]=qs['filters'](_['pick'](_0x3c86ae[_0xcb73('0x3a')],_0x893d10['filters']));_0x249118[_0xcb73('0x74')]=!![];if(_0x3c86ae[_0xcb73('0x3a')][_0xcb73('0x46')]){_0x249118['where']=_[_0xcb73('0x47')](_0x249118[_0xcb73('0x44')],{'$or':_[_0xcb73('0x34')](_0x249118[_0xcb73('0x3d')],function(_0x429703){var _0x11dd29={};_0x11dd29[_0x429703]={'$like':'%'+_0x3c86ae[_0xcb73('0x3a')]['filter']+'%'};return _0x11dd29;})});}_0x249118=_[_0xcb73('0x47')]({},_0x249118,_0x3c86ae[_0xcb73('0x49')]);return _0x43c282['getContacts'](_0x249118);}})[_0xcb73('0x2b')](respondWithResult(_0x1f2af0,null))['catch'](handleError(_0x1f2af0,null));};exports['getContactsCsv']=function(_0x5af530,_0x4a7a9c,_0x1c1664){var _0x31c983;return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x5af530[_0xcb73('0x50')]['id']},'include':[{'model':db[_0xcb73('0x6f')],'as':_0xcb73('0x71')}]})[_0xcb73('0x2b')](handleEntityNotFound(_0x4a7a9c,null))[_0xcb73('0x2b')](function(_0x3798d2){if(_0x3798d2){_0x31c983=_0x3798d2;return db[_0xcb73('0x64')][_0xcb73('0x35')];}})[_0xcb73('0x2b')](function(_0xe08a09){if(_0xe08a09){var _0x1c7280={};var _0x3082ee={};_0x3082ee[_0xcb73('0x39')]=_[_0xcb73('0x70')](_['keys'](_0xe08a09),_[_0xcb73('0x34')](_0x31c983[_0xcb73('0x71')],function(_0x948cce){return util['format']('cf_%d',_0x948cce['id']);}));_0x3082ee[_0xcb73('0x3a')]=_[_0xcb73('0x51')](_0x5af530[_0xcb73('0x3a')]);_0x3082ee[_0xcb73('0x3b')]=_[_0xcb73('0x3c')](_0x3082ee[_0xcb73('0x39')],_0x3082ee[_0xcb73('0x3a')]);_0x1c7280[_0xcb73('0x3d')]=_[_0xcb73('0x3c')](_0x3082ee[_0xcb73('0x39')],qs[_0xcb73('0x3e')](_0x5af530[_0xcb73('0x3a')][_0xcb73('0x3e')]));_0x1c7280[_0xcb73('0x3d')]=_0x1c7280['attributes'][_0xcb73('0x3f')]?_0x1c7280[_0xcb73('0x3d')]:_0x3082ee[_0xcb73('0x39')];if(!_0x5af530[_0xcb73('0x3a')][_0xcb73('0x40')](_0xcb73('0x41'))){_0x1c7280[_0xcb73('0x25')]=qs[_0xcb73('0x25')](_0x5af530[_0xcb73('0x3a')]['limit']);_0x1c7280[_0xcb73('0x23')]=qs[_0xcb73('0x23')](_0x5af530[_0xcb73('0x3a')][_0xcb73('0x23')]);}_0x1c7280[_0xcb73('0x42')]=qs['sort'](_0x5af530[_0xcb73('0x3a')]['sort']);_0x1c7280[_0xcb73('0x44')]=qs[_0xcb73('0x3b')](_['pick'](_0x5af530['query'],_0x3082ee[_0xcb73('0x3b')]));_0x1c7280['raw']=!![];if(_0x5af530['query'][_0xcb73('0x46')]){_0x1c7280['where']=_[_0xcb73('0x47')](_0x1c7280[_0xcb73('0x44')],{'$or':_[_0xcb73('0x34')](_0x1c7280[_0xcb73('0x3d')],function(_0x3e6888){var _0x1f4739={};_0x1f4739[_0x3e6888]={'$like':'%'+_0x5af530[_0xcb73('0x3a')][_0xcb73('0x46')]+'%'};return _0x1f4739;})});}_0x1c7280=_['merge']({},_0x1c7280,_0x5af530[_0xcb73('0x49')]);return _0x31c983[_0xcb73('0x6e')](_0x1c7280);}})[_0xcb73('0x2b')](function(_0x15cde8){if(!_[_0xcb73('0x75')](_0x15cde8)){var _0x11d676=toCsv(_0x15cde8);var _0x2317ae=Date['now']();fs['writeFileSync'](util['format'](_0xcb73('0x76'),_0x31c983['id'],_0x2317ae),_0x11d676);_0x4a7a9c[_0xcb73('0x77')](_0xcb73('0x78'),_0xcb73('0x79')+util[_0xcb73('0x72')]('list_%d_%s.csv',_0x31c983['id'],_0x2317ae));_0x4a7a9c[_0xcb73('0x77')]('Content-type',_0xcb73('0x7a'));return _0x4a7a9c[_0xcb73('0x7b')](util[_0xcb73('0x72')](_0xcb73('0x76'),_0x31c983['id'],_0x2317ae));}else{return _0x4a7a9c[_0xcb73('0x30')](0xcc);}})[_0xcb73('0x4e')](handleError(_0x4a7a9c,null));};exports[_0xcb73('0x7c')]=function(_0x215ce4,_0x4c4c22,_0x1ecdb0){var _0x7dfa73;delete _0x215ce4[_0xcb73('0x5b')]['id'];return db[_0xcb73('0x4a')][_0xcb73('0x7d')]({'where':{'id':_0x215ce4[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x4c4c22,null))[_0xcb73('0x2b')](function(_0x2f1fec){if(_0x2f1fec){return db[_0xcb73('0x7e')]['transaction'](function(_0x47fc16){return db[_0xcb73('0x6f')][_0xcb73('0x53')](_0x215ce4['body'],{'transaction':_0x47fc16})[_0xcb73('0x2b')](function(_0x361eb9){_0x7dfa73=_0x361eb9;return _0x2f1fec[_0xcb73('0x7f')](_0x361eb9,{'transaction':_0x47fc16});})['then'](function(){var _0x3572d3={'type':db[_0xcb73('0x80')][_0xcb73('0x81')],'transaction':_0x47fc16};switch(_0x215ce4['body'][_0xcb73('0x37')]){case _0xcb73('0x82'):_0x3572d3['type']=db[_0xcb73('0x80')][_0xcb73('0x81')];break;case _0xcb73('0x83'):_0x3572d3[_0xcb73('0x37')]=db['Sequelize'][_0xcb73('0x84')];break;case _0xcb73('0x85'):_0x3572d3[_0xcb73('0x37')]=db['Sequelize']['BOOLEAN'];_0x3572d3['defaultValue']=![];break;default:}return db[_0xcb73('0x7e')][_0xcb73('0x86')][_0xcb73('0x87')](_0xcb73('0x88'),util[_0xcb73('0x72')]('cf_%s',_0x7dfa73['id']),_0x3572d3);})[_0xcb73('0x2b')](function(){return _0x7dfa73;});});}})[_0xcb73('0x2b')](respondWithResult(_0x4c4c22,null))['catch'](handleError(_0x4c4c22,null));};exports[_0xcb73('0x89')]=function(_0x191ccc,_0x1f4364,_0x4b6e16){var _0x26b9b2={};var _0x4dc36c={};var _0x5b774d;var _0x1d68fb;return db['CmList']['findOne']({'where':{'id':_0x191ccc[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x1f4364,null))[_0xcb73('0x2b')](function(_0x1f9282){if(_0x1f9282){_0x5b774d=_0x1f9282;_0x4dc36c[_0xcb73('0x39')]=_[_0xcb73('0x51')](db[_0xcb73('0x6f')][_0xcb73('0x35')]);_0x4dc36c[_0xcb73('0x3a')]=_[_0xcb73('0x51')](_0x191ccc['query']);_0x4dc36c['filters']=_[_0xcb73('0x3c')](_0x4dc36c[_0xcb73('0x39')],_0x4dc36c[_0xcb73('0x3a')]);_0x26b9b2[_0xcb73('0x3d')]=_['intersection'](_0x4dc36c['model'],qs['fields'](_0x191ccc[_0xcb73('0x3a')]['fields']));_0x26b9b2[_0xcb73('0x3d')]=_0x26b9b2[_0xcb73('0x3d')][_0xcb73('0x3f')]?_0x26b9b2[_0xcb73('0x3d')]:_0x4dc36c['model'];_0x26b9b2[_0xcb73('0x42')]=qs['sort'](_0x191ccc[_0xcb73('0x3a')][_0xcb73('0x43')]);_0x26b9b2[_0xcb73('0x44')]=qs[_0xcb73('0x3b')](_[_0xcb73('0x45')](_0x191ccc[_0xcb73('0x3a')],_0x4dc36c[_0xcb73('0x3b')]));_0x26b9b2[_0xcb73('0x44')]=_['merge'](_0x26b9b2[_0xcb73('0x44')],{'$or':[{'ListId':_0x1f9282['id']},{'ListId':null}]});if(_0x191ccc[_0xcb73('0x3a')][_0xcb73('0x46')]){_0x26b9b2[_0xcb73('0x44')]=_[_0xcb73('0x47')](_0x26b9b2['where'],{'$or':_[_0xcb73('0x34')](_0x26b9b2[_0xcb73('0x3d')],function(_0x483a39){var _0x4d3e21={};_0x4d3e21[_0x483a39]={'$like':'%'+_0x191ccc[_0xcb73('0x3a')][_0xcb73('0x46')]+'%'};return _0x4d3e21;})});}_0x26b9b2=_[_0xcb73('0x47')]({},_0x26b9b2,_0x191ccc[_0xcb73('0x49')]);return db[_0xcb73('0x6f')][_0xcb73('0x8a')](_0x26b9b2);}})['then'](respondWithResult(_0x1f4364,null))[_0xcb73('0x4e')](handleError(_0x1f4364,null));};exports[_0xcb73('0x8b')]=function(_0x2c75a4,_0x5e3167,_0x300e5e){return db[_0xcb73('0x4a')][_0xcb73('0x5c')]({'where':{'id':_0x2c75a4['params']['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x5e3167,null))['then'](function(_0x23efb0){if(_0x23efb0){return _0x23efb0[_0xcb73('0x8b')](_0x2c75a4[_0xcb73('0x5b')][_0xcb73('0x62')],_[_0xcb73('0x8c')](_0x2c75a4[_0xcb73('0x5b')],[_0xcb73('0x62'),'id'])||{})[_0xcb73('0x8d')](function(_0x240217){for(var _0x37b2a9=0x0;_0x37b2a9<_0x2c75a4[_0xcb73('0x5b')][_0xcb73('0x62')][_0xcb73('0x3f')];_0x37b2a9+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x2c75a4[_0xcb73('0x5b')][_0xcb73('0x62')][_0x37b2a9]),'CmListId':Number(_0x2c75a4[_0xcb73('0x50')]['id'])});}return _0x240217;});}})[_0xcb73('0x2b')](respondWithResult(_0x5e3167,null))[_0xcb73('0x4e')](handleError(_0x5e3167,null));};exports[_0xcb73('0x8e')]=function(_0x1cec3,_0x4747c2,_0x15fd67){return db['CmList'][_0xcb73('0x5c')]({'where':{'id':_0x1cec3['params']['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x4747c2,null))[_0xcb73('0x2b')](function(_0x5d4d98){if(_0x5d4d98){return _0x5d4d98[_0xcb73('0x8e')](_0x1cec3['query'][_0xcb73('0x62')])[_0xcb73('0x2b')](function(){if(_[_0xcb73('0x67')](_0x1cec3['query'][_0xcb73('0x62')])){for(var _0x5ae751=0x0;_0x5ae751<_0x1cec3[_0xcb73('0x3a')]['ids'][_0xcb73('0x3f')];_0x5ae751+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x1cec3['query'][_0xcb73('0x62')][_0x5ae751]),'CmListId':Number(_0x1cec3[_0xcb73('0x50')]['id'])});}}else{socket[_0xcb73('0x8f')](_0xcb73('0x90'),{'UserId':Number(_0x1cec3[_0xcb73('0x3a')][_0xcb73('0x62')]),'CmListId':Number(_0x1cec3[_0xcb73('0x50')]['id'])});}});}})[_0xcb73('0x2b')](respondWithStatusCode(_0x4747c2,null))['catch'](handleError(_0x4747c2,null));};exports['getAgents']=function(_0x4aaf9b,_0x105a1f,_0x28e7a8){var _0x52c882={};var _0x5d1c22={};var _0x31130f;var _0x521f06;return db[_0xcb73('0x4a')]['findOne']({'where':{'id':_0x4aaf9b[_0xcb73('0x50')]['id']}})[_0xcb73('0x2b')](handleEntityNotFound(_0x105a1f,null))[_0xcb73('0x2b')](function(_0x227ef7){if(_0x227ef7){_0x31130f=_0x227ef7;_0x5d1c22['model']=_[_0xcb73('0x51')](db[_0xcb73('0x91')][_0xcb73('0x35')]);_0x5d1c22[_0xcb73('0x3a')]=_[_0xcb73('0x51')](_0x4aaf9b[_0xcb73('0x3a')]);_0x5d1c22[_0xcb73('0x3b')]=_['intersection'](_0x5d1c22[_0xcb73('0x39')],_0x5d1c22[_0xcb73('0x3a')]);_0x52c882[_0xcb73('0x3d')]=_[_0xcb73('0x3c')](_0x5d1c22[_0xcb73('0x39')],qs['fields'](_0x4aaf9b[_0xcb73('0x3a')][_0xcb73('0x3e')]));_0x52c882[_0xcb73('0x3d')]=_0x52c882[_0xcb73('0x3d')][_0xcb73('0x3f')]?_0x52c882[_0xcb73('0x3d')]:_0x5d1c22[_0xcb73('0x39')];_0x52c882[_0xcb73('0x42')]=qs[_0xcb73('0x43')](_0x4aaf9b[_0xcb73('0x3a')][_0xcb73('0x43')]);_0x52c882[_0xcb73('0x44')]=qs['filters'](_[_0xcb73('0x45')](_0x4aaf9b['query'],_0x5d1c22[_0xcb73('0x3b')]));if(_0x4aaf9b[_0xcb73('0x3a')][_0xcb73('0x46')]){_0x52c882[_0xcb73('0x44')]=_[_0xcb73('0x47')](_0x52c882[_0xcb73('0x44')],{'$or':_['map'](_0x52c882[_0xcb73('0x3d')],function(_0xc17b59){var _0x2113c4={};_0x2113c4[_0xc17b59]={'$like':'%'+_0x4aaf9b['query']['filter']+'%'};return _0x2113c4;})});}_0x52c882=_[_0xcb73('0x47')]({},_0x52c882,_0x4aaf9b[_0xcb73('0x49')]);return _0x31130f[_0xcb73('0x92')](_0x52c882);}})['then'](function(_0x142fcf){if(_0x142fcf){_0x521f06=_0x142fcf[_0xcb73('0x3f')];if(!_0x4aaf9b['query'][_0xcb73('0x40')](_0xcb73('0x41'))){_0x52c882[_0xcb73('0x25')]=qs['limit'](_0x4aaf9b['query'][_0xcb73('0x25')]);_0x52c882[_0xcb73('0x23')]=qs[_0xcb73('0x23')](_0x4aaf9b[_0xcb73('0x3a')][_0xcb73('0x23')]);}return _0x31130f[_0xcb73('0x92')](_0x52c882);}})[_0xcb73('0x2b')](function(_0x25f671){if(_0x25f671){return _0x25f671?{'count':_0x521f06,'rows':_0x25f671}:null;}})['then'](respondWithResult(_0x105a1f,null))[_0xcb73('0x4e')](handleError(_0x105a1f,null));}; \ No newline at end of file +var _0xf488=['status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','Lists','error','stack','name','send','index','map','CmList','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','pick','filter','removeDispositions','ids','addContacts','tags','join','isArray','each','CmContact','omit','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','order','getContactsCsv','CmCustomField','concat','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','findOne','transaction','addCustomFields','Sequelize','TEXT','number','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus'];(function(_0x4d7ceb,_0xdc23b0){var _0x4bb84e=function(_0x5dd7f5){while(--_0x5dd7f5){_0x4d7ceb['push'](_0x4d7ceb['shift']());}};_0x4bb84e(++_0xdc23b0);}(_0xf488,0x103));var _0x8f48=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xf488[_0x284807];return _0x50c774;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8f48('0x0'));var rp=require(_0x8f48('0x1'));var moment=require(_0x8f48('0x2'));var BPromise=require(_0x8f48('0x3'));var Mustache=require(_0x8f48('0x4'));var util=require(_0x8f48('0x5'));var path=require(_0x8f48('0x6'));var sox=require(_0x8f48('0x7'));var csv=require('to-csv');var ejs=require(_0x8f48('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8f48('0x9'));var crypto=require('crypto');var jsforce=require(_0x8f48('0xa'));var deskjs=require(_0x8f48('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8f48('0xc'));var Papa=require(_0x8f48('0xd'));var Redis=require(_0x8f48('0xe'));var authService=require(_0x8f48('0xf'));var qs=require(_0x8f48('0x10'));var as=require(_0x8f48('0x11'));var hardwareService=require(_0x8f48('0x12'));var logger=require(_0x8f48('0x13'))(_0x8f48('0x14'));var utils=require(_0x8f48('0x15'));var config=require(_0x8f48('0x16'));var licenseUtil=require(_0x8f48('0x17'));var db=require(_0x8f48('0x18'))['db'];config[_0x8f48('0x19')]=_[_0x8f48('0x1a')](config['redis'],{'host':_0x8f48('0x1b'),'port':0x18eb});var socket=require(_0x8f48('0x1c'))(new Redis(config[_0x8f48('0x19')]));require(_0x8f48('0x1d'))['register'](socket);function respondWithStatusCode(_0x33825,_0x51a24d){_0x51a24d=_0x51a24d||0xcc;return function(_0x4fa609){if(_0x4fa609){return _0x33825[_0x8f48('0x1e')](_0x51a24d);}return _0x33825[_0x8f48('0x1f')](_0x51a24d)[_0x8f48('0x20')]();};}function respondWithResult(_0x200641,_0x286e58){_0x286e58=_0x286e58||0xc8;return function(_0xae6679){if(_0xae6679){return _0x200641[_0x8f48('0x1f')](_0x286e58)['json'](_0xae6679);}};}function respondWithFilteredResult(_0x3d35ac,_0x4d2a26){return function(_0x4f31b1){if(_0x4f31b1){var _0x115bdd=typeof _0x4d2a26[_0x8f48('0x21')]===_0x8f48('0x22')&&typeof _0x4d2a26[_0x8f48('0x23')]===_0x8f48('0x22');var _0x148b03=_0x4f31b1[_0x8f48('0x24')];var _0x10c989=_0x115bdd?0x0:_0x4d2a26['offset'];var _0x533754=_0x115bdd?_0x4f31b1[_0x8f48('0x24')]:_0x4d2a26[_0x8f48('0x21')]+_0x4d2a26['limit'];var _0x38b8e5;if(_0x533754>=_0x148b03){_0x533754=_0x148b03;_0x38b8e5=0xc8;}else{_0x38b8e5=0xce;}_0x3d35ac[_0x8f48('0x1f')](_0x38b8e5);return _0x3d35ac[_0x8f48('0x25')](_0x8f48('0x26'),_0x10c989+'-'+_0x533754+'/'+_0x148b03)[_0x8f48('0x27')](_0x4f31b1);}return null;};}function patchUpdates(_0x5f0bd5){return function(_0x1e460e){try{jsonpatch['apply'](_0x1e460e,_0x5f0bd5,!![]);}catch(_0x1a5bb1){return BPromise[_0x8f48('0x28')](_0x1a5bb1);}return _0x1e460e[_0x8f48('0x29')]();};}function saveUpdates(_0x40fcb1,_0x2b0130){return function(_0x404518){if(_0x404518){return _0x404518[_0x8f48('0x2a')](_0x40fcb1)[_0x8f48('0x2b')](function(_0x79d34a){return _0x79d34a;});}return null;};}function removeEntity(_0x38e1ef,_0x50a8b5){return function(_0x4411d4){if(_0x4411d4){return _0x4411d4[_0x8f48('0x2c')]()['then'](function(){var _0x45cbab=_0x4411d4[_0x8f48('0x2d')]({'plain':!![]});var _0x411161=_0x8f48('0x2e');return db['UserProfileResource'][_0x8f48('0x2c')]({'where':{'type':_0x411161,'resourceId':_0x45cbab['id']}})['then'](function(){return _0x4411d4;});})[_0x8f48('0x2b')](function(){_0x38e1ef['status'](0xcc)[_0x8f48('0x20')]();});}};}function handleEntityNotFound(_0x138715,_0x451304){return function(_0x464fde){if(!_0x464fde){_0x138715[_0x8f48('0x1e')](0x194);}return _0x464fde;};}function handleError(_0x4e8cd3,_0x3b4d5e){_0x3b4d5e=_0x3b4d5e||0x1f4;return function(_0x3b9590){logger[_0x8f48('0x2f')](_0x3b9590[_0x8f48('0x30')]);if(_0x3b9590['name']){delete _0x3b9590[_0x8f48('0x31')];}_0x4e8cd3[_0x8f48('0x1f')](_0x3b4d5e)[_0x8f48('0x32')](_0x3b9590);};}exports[_0x8f48('0x33')]=function(_0x2507d9,_0x20a52d){var _0x231fe5={},_0x5bd2c4={},_0x4b522c={'count':0x0,'rows':[]};var _0x373303=_[_0x8f48('0x34')](db[_0x8f48('0x35')][_0x8f48('0x36')],function(_0x2fe6bd){return{'name':_0x2fe6bd['fieldName'],'type':_0x2fe6bd[_0x8f48('0x37')][_0x8f48('0x38')]};});_0x5bd2c4[_0x8f48('0x39')]=_[_0x8f48('0x34')](_0x373303,_0x8f48('0x31'));_0x5bd2c4[_0x8f48('0x3a')]=_['keys'](_0x2507d9['query']);_0x5bd2c4[_0x8f48('0x3b')]=_[_0x8f48('0x3c')](_0x5bd2c4[_0x8f48('0x39')],_0x5bd2c4['query']);_0x231fe5[_0x8f48('0x3d')]=_[_0x8f48('0x3c')](_0x5bd2c4['model'],qs[_0x8f48('0x3e')](_0x2507d9['query'][_0x8f48('0x3e')]));_0x231fe5['attributes']=_0x231fe5[_0x8f48('0x3d')][_0x8f48('0x3f')]?_0x231fe5[_0x8f48('0x3d')]:_0x5bd2c4[_0x8f48('0x39')];if(!_0x2507d9['query'][_0x8f48('0x40')](_0x8f48('0x41'))){_0x231fe5['limit']=qs[_0x8f48('0x23')](_0x2507d9[_0x8f48('0x3a')][_0x8f48('0x23')]);_0x231fe5[_0x8f48('0x21')]=qs[_0x8f48('0x21')](_0x2507d9['query'][_0x8f48('0x21')]);}_0x231fe5['order']=qs[_0x8f48('0x42')](_0x2507d9[_0x8f48('0x3a')]['sort']);_0x231fe5[_0x8f48('0x43')]=qs['filters'](_['pick'](_0x2507d9[_0x8f48('0x3a')],_0x5bd2c4[_0x8f48('0x3b')]),_0x373303);if(_0x2507d9[_0x8f48('0x3a')]['filter']){_0x231fe5[_0x8f48('0x43')]=_['merge'](_0x231fe5['where'],{'$or':_[_0x8f48('0x34')](_0x373303,function(_0x163768){if(_0x163768[_0x8f48('0x37')]!=='VIRTUAL'){var _0x39ca66={};_0x39ca66[_0x163768[_0x8f48('0x31')]]={'$like':'%'+_0x2507d9[_0x8f48('0x3a')]['filter']+'%'};return _0x39ca66;}})});}_0x231fe5=_[_0x8f48('0x44')]({},_0x231fe5,_0x2507d9['options']);var _0x56644d={'where':_0x231fe5['where']};return db[_0x8f48('0x35')][_0x8f48('0x24')](_0x56644d)[_0x8f48('0x2b')](function(_0x119df5){_0x4b522c[_0x8f48('0x24')]=_0x119df5;if(_0x2507d9[_0x8f48('0x3a')][_0x8f48('0x45')]){_0x231fe5[_0x8f48('0x46')]=[{'all':!![]}];}return db[_0x8f48('0x35')][_0x8f48('0x47')](_0x231fe5);})[_0x8f48('0x2b')](function(_0x5ec0ef){_0x4b522c[_0x8f48('0x48')]=_0x5ec0ef;return _0x4b522c;})[_0x8f48('0x2b')](respondWithFilteredResult(_0x20a52d,_0x231fe5))[_0x8f48('0x49')](handleError(_0x20a52d,null));};exports[_0x8f48('0x4a')]=function(_0x50a46c,_0x1b01c8){var _0x51c1e3={'raw':![],'where':{'id':_0x50a46c[_0x8f48('0x4b')]['id']}},_0x4bd8a0={};_0x4bd8a0[_0x8f48('0x39')]=_[_0x8f48('0x4c')](db[_0x8f48('0x35')][_0x8f48('0x36')]);_0x4bd8a0[_0x8f48('0x3a')]=_[_0x8f48('0x4c')](_0x50a46c[_0x8f48('0x3a')]);_0x4bd8a0[_0x8f48('0x3b')]=_[_0x8f48('0x3c')](_0x4bd8a0[_0x8f48('0x39')],_0x4bd8a0[_0x8f48('0x3a')]);_0x51c1e3[_0x8f48('0x3d')]=_[_0x8f48('0x3c')](_0x4bd8a0[_0x8f48('0x39')],qs[_0x8f48('0x3e')](_0x50a46c['query'][_0x8f48('0x3e')]));_0x51c1e3[_0x8f48('0x3d')]=_0x51c1e3[_0x8f48('0x3d')][_0x8f48('0x3f')]?_0x51c1e3[_0x8f48('0x3d')]:_0x4bd8a0[_0x8f48('0x39')];if(_0x50a46c['query'][_0x8f48('0x45')]){_0x51c1e3[_0x8f48('0x46')]=[{'all':!![]}];}_0x51c1e3=_[_0x8f48('0x44')]({},_0x51c1e3,_0x50a46c[_0x8f48('0x4d')]);return db['CmList'][_0x8f48('0x4e')](_0x51c1e3)['then'](handleEntityNotFound(_0x1b01c8,null))[_0x8f48('0x2b')](respondWithResult(_0x1b01c8,null))[_0x8f48('0x49')](handleError(_0x1b01c8,null));};exports[_0x8f48('0x4f')]=function(_0x2ff6fa,_0x544a37){return db[_0x8f48('0x35')]['create'](_0x2ff6fa[_0x8f48('0x50')],{})['then'](function(_0x19d00b){var _0x3ed6d0=_0x2ff6fa[_0x8f48('0x51')][_0x8f48('0x2d')]({'plain':!![]});if(!_0x3ed6d0)throw new Error(_0x8f48('0x52'));if(_0x3ed6d0[_0x8f48('0x53')]===_0x8f48('0x51')){var _0x9a8f99=_0x19d00b[_0x8f48('0x2d')]({'plain':!![]});var _0x28bd98='Lists';return db['UserProfileSection'][_0x8f48('0x4e')]({'where':{'name':_0x28bd98,'userProfileId':_0x3ed6d0[_0x8f48('0x54')]},'raw':!![]})['then'](function(_0x4ccc6a){if(_0x4ccc6a&&_0x4ccc6a[_0x8f48('0x55')]===0x0){return db[_0x8f48('0x56')][_0x8f48('0x4f')]({'name':_0x9a8f99[_0x8f48('0x31')],'resourceId':_0x9a8f99['id'],'type':_0x4ccc6a[_0x8f48('0x31')],'sectionId':_0x4ccc6a['id']},{})[_0x8f48('0x2b')](function(){return _0x19d00b;});}else{return _0x19d00b;}})['catch'](function(_0x1cefb9){logger[_0x8f48('0x2f')](_0x8f48('0x57'),_0x1cefb9);throw _0x1cefb9;});}return _0x19d00b;})['then'](respondWithResult(_0x544a37,0xc9))['catch'](handleError(_0x544a37,null));};exports[_0x8f48('0x2a')]=function(_0x3e42c8,_0x1b5655){if(_0x3e42c8[_0x8f48('0x50')]['id']){delete _0x3e42c8[_0x8f48('0x50')]['id'];}return db[_0x8f48('0x35')]['find']({'where':{'id':_0x3e42c8['params']['id']}})['then'](handleEntityNotFound(_0x1b5655,null))['then'](saveUpdates(_0x3e42c8[_0x8f48('0x50')],null))['then'](respondWithResult(_0x1b5655,null))['catch'](handleError(_0x1b5655,null));};exports[_0x8f48('0x2c')]=function(_0x217405,_0x2ab83c){return db[_0x8f48('0x35')]['find']({'where':{'id':_0x217405[_0x8f48('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ab83c,null))[_0x8f48('0x2b')](removeEntity(_0x2ab83c,null))[_0x8f48('0x49')](handleError(_0x2ab83c,null));};exports['describe']=function(_0x541c43,_0xdcb4b8){return db[_0x8f48('0x35')][_0x8f48('0x58')]()[_0x8f48('0x2b')](respondWithResult(_0xdcb4b8,null))[_0x8f48('0x49')](handleError(_0xdcb4b8,null));};exports[_0x8f48('0x59')]=function(_0x16f3e5,_0x2468eb,_0x172b24){if(_0x16f3e5[_0x8f48('0x50')]['id']){delete _0x16f3e5[_0x8f48('0x50')]['id'];}return db['CmList'][_0x8f48('0x4e')]({'where':{'id':_0x16f3e5[_0x8f48('0x4b')]['id']}})[_0x8f48('0x2b')](handleEntityNotFound(_0x2468eb,null))[_0x8f48('0x2b')](function(_0x3a22f3){if(_0x3a22f3){_0x16f3e5[_0x8f48('0x50')][_0x8f48('0x5a')]=_0x3a22f3['id'];return db[_0x8f48('0x5b')][_0x8f48('0x4f')](_0x16f3e5[_0x8f48('0x50')]);}})[_0x8f48('0x2b')](respondWithResult(_0x2468eb,null))['catch'](handleError(_0x2468eb,null));};exports['getDispositions']=function(_0x27543a,_0xda1ba,_0x1a7fee){var _0x1490a3={'raw':![],'where':{}};var _0x5bae73={};var _0x32f156={'count':0x0,'rows':[]};return db[_0x8f48('0x35')]['findOne']({'where':{'id':_0x27543a['params']['id']}})[_0x8f48('0x2b')](handleEntityNotFound(_0xda1ba,null))[_0x8f48('0x2b')](function(_0x22a0b6){if(_0x22a0b6){_0x5bae73[_0x8f48('0x39')]=_[_0x8f48('0x4c')](db[_0x8f48('0x5b')][_0x8f48('0x36')]);_0x5bae73[_0x8f48('0x3a')]=_[_0x8f48('0x4c')](_0x27543a[_0x8f48('0x3a')]);_0x5bae73[_0x8f48('0x3b')]=_['intersection'](_0x5bae73[_0x8f48('0x39')],_0x5bae73[_0x8f48('0x3a')]);_0x1490a3[_0x8f48('0x3d')]=_['intersection'](_0x5bae73[_0x8f48('0x39')],qs[_0x8f48('0x3e')](_0x27543a[_0x8f48('0x3a')]['fields']));_0x1490a3[_0x8f48('0x3d')]=_0x1490a3[_0x8f48('0x3d')]['length']?_0x1490a3[_0x8f48('0x3d')]:_0x5bae73[_0x8f48('0x39')];if(!_0x27543a[_0x8f48('0x3a')]['hasOwnProperty'](_0x8f48('0x41'))){_0x1490a3[_0x8f48('0x23')]=qs[_0x8f48('0x23')](_0x27543a[_0x8f48('0x3a')][_0x8f48('0x23')]);_0x1490a3[_0x8f48('0x21')]=qs['offset'](_0x27543a['query'][_0x8f48('0x21')]);}_0x1490a3['order']=qs[_0x8f48('0x42')](_0x27543a[_0x8f48('0x3a')]['sort']);_0x1490a3[_0x8f48('0x43')]=qs['filters'](_[_0x8f48('0x5c')](_0x27543a[_0x8f48('0x3a')],_0x5bae73[_0x8f48('0x3b')]));_0x1490a3[_0x8f48('0x43')][_0x8f48('0x5a')]=_0x22a0b6['id'];if(_0x27543a[_0x8f48('0x3a')][_0x8f48('0x5d')]){_0x1490a3['where']=_['merge'](_0x1490a3[_0x8f48('0x43')],{'$or':_[_0x8f48('0x34')](_0x1490a3['attributes'],function(_0x31d0bb){var _0x178f4={};_0x178f4[_0x31d0bb]={'$like':'%'+_0x27543a[_0x8f48('0x3a')][_0x8f48('0x5d')]+'%'};return _0x178f4;})});}_0x1490a3=_[_0x8f48('0x44')]({},_0x1490a3,_0x27543a[_0x8f48('0x4d')]);return db[_0x8f48('0x5b')]['count']({'where':_0x1490a3['where']})[_0x8f48('0x2b')](function(_0x354ce3){_0x32f156[_0x8f48('0x24')]=_0x354ce3;if(_0x27543a[_0x8f48('0x3a')]['includeAll']){_0x1490a3[_0x8f48('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x8f48('0x47')](_0x1490a3);})[_0x8f48('0x2b')](function(_0x17f502){_0x32f156[_0x8f48('0x48')]=_0x17f502;return _0x32f156;});}})[_0x8f48('0x2b')](respondWithFilteredResult(_0xda1ba,_0x1490a3))[_0x8f48('0x49')](handleError(_0xda1ba,null));};exports[_0x8f48('0x5e')]=function(_0x5ce3ed,_0x379501,_0x5e17a4){return db['CmList'][_0x8f48('0x4e')]({'where':{'id':_0x5ce3ed[_0x8f48('0x4b')]['id']}})['then'](handleEntityNotFound(_0x379501,null))[_0x8f48('0x2b')](function(_0x41594c){if(_0x41594c){return _0x41594c[_0x8f48('0x5e')](_0x5ce3ed[_0x8f48('0x3a')][_0x8f48('0x5f')]);}})[_0x8f48('0x2b')](respondWithStatusCode(_0x379501,null))[_0x8f48('0x49')](handleError(_0x379501,null));};exports[_0x8f48('0x60')]=function(_0x5e2055,_0x41bdfa,_0x44e15b){return db['CmList'][_0x8f48('0x4e')]({'where':{'id':_0x5e2055[_0x8f48('0x4b')]['id']}})[_0x8f48('0x2b')](handleEntityNotFound(_0x41bdfa,null))[_0x8f48('0x2b')](function(_0x336258){if(_0x336258){var _0x3eb80f=[];var _0x1ddd80={'success':[],'errors':[]};return db['CmContact'][_0x8f48('0x58')]()[_0x8f48('0x2b')](function(_0x72380f){if(_0x5e2055[_0x8f48('0x50')]['tags']&&_['isArray'](_0x5e2055[_0x8f48('0x50')][_0x8f48('0x61')])){if(_0x5e2055[_0x8f48('0x50')][_0x8f48('0x61')][_0x8f48('0x3f')]){_0x5e2055[_0x8f48('0x50')][_0x8f48('0x61')]=_0x5e2055[_0x8f48('0x50')]['tags'][_0x8f48('0x62')](';')+';';}else{_0x5e2055['body']['tags']=null;}}else{_0x5e2055['body'][_0x8f48('0x61')]=null;}if(_0x5e2055[_0x8f48('0x50')]&&_[_0x8f48('0x63')](_0x5e2055[_0x8f48('0x50')])){for(var _0x26cda1=0x0;_0x26cda1<_0x5e2055[_0x8f48('0x50')]['length'];_0x26cda1+=0x1){_0x5e2055[_0x8f48('0x50')][_0x26cda1]['ListId']=_0x5e2055[_0x8f48('0x4b')]['id'];_0x3eb80f['push'](_0x5e2055[_0x8f48('0x50')][_0x26cda1]);}return BPromise[_0x8f48('0x64')](_0x3eb80f,function(_0x4364d2){return db[_0x8f48('0x65')][_0x8f48('0x4f')](_[_0x8f48('0x66')](_0x4364d2,[_0x8f48('0x5f'),'id'])||{},{'fields':_[_0x8f48('0x4c')](_0x72380f),'raw':!![]})[_0x8f48('0x2b')](function(_0x540df3){_0x1ddd80['success']['push'](_0x540df3['dataValues']);})[_0x8f48('0x49')](function(_0x1ace62){_0x1ddd80[_0x8f48('0x67')]['push']({'data':_0x4364d2,'error':_0x1ace62[_0x8f48('0x68')]});});})[_0x8f48('0x2b')](function(_0x3078a5){return _0x1ddd80;})['catch'](function(_0xec1e1c){return _0xec1e1c;});}else{_0x41bdfa[_0x8f48('0x1f')](0x190)[_0x8f48('0x27')]({'message':_0x8f48('0x69')});}});}})[_0x8f48('0x2b')](respondWithResult(_0x41bdfa,null))[_0x8f48('0x49')](handleError(_0x41bdfa,null));};exports[_0x8f48('0x6a')]=function(_0x43cc94,_0x57e604,_0x10b2a9){var _0x51f8c5;return db[_0x8f48('0x35')][_0x8f48('0x4e')]({'where':{'id':_0x43cc94[_0x8f48('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x8f48('0x6b')}]})[_0x8f48('0x2b')](handleEntityNotFound(_0x57e604,null))[_0x8f48('0x2b')](function(_0x42425c){if(_0x42425c){_0x51f8c5=_0x42425c;return db[_0x8f48('0x65')]['rawAttributes'];}})[_0x8f48('0x2b')](function(_0xd279b0){if(_0xd279b0){var _0x2539b9={};var _0x24518f={};_0x24518f[_0x8f48('0x39')]=_['concat'](_['keys'](_0xd279b0),_['map'](_0x51f8c5[_0x8f48('0x6b')],function(_0x17886f){return util[_0x8f48('0x6c')](_0x8f48('0x6d'),_0x17886f['id']);}));_0x24518f[_0x8f48('0x3a')]=_[_0x8f48('0x4c')](_0x43cc94[_0x8f48('0x3a')]);_0x24518f[_0x8f48('0x3b')]=_['intersection'](_0x24518f[_0x8f48('0x39')],_0x24518f[_0x8f48('0x3a')]);_0x2539b9[_0x8f48('0x3d')]=_[_0x8f48('0x3c')](_0x24518f['model'],qs[_0x8f48('0x3e')](_0x43cc94[_0x8f48('0x3a')][_0x8f48('0x3e')]));_0x2539b9['attributes']=_0x2539b9[_0x8f48('0x3d')][_0x8f48('0x3f')]?_0x2539b9[_0x8f48('0x3d')]:_0x24518f['model'];if(!_0x43cc94[_0x8f48('0x3a')]['hasOwnProperty'](_0x8f48('0x41'))){_0x2539b9[_0x8f48('0x23')]=qs['limit'](_0x43cc94[_0x8f48('0x3a')]['limit']);_0x2539b9[_0x8f48('0x21')]=qs[_0x8f48('0x21')](_0x43cc94[_0x8f48('0x3a')][_0x8f48('0x21')]);}_0x2539b9[_0x8f48('0x6e')]=qs['sort'](_0x43cc94[_0x8f48('0x3a')]['sort']);_0x2539b9[_0x8f48('0x43')]=qs[_0x8f48('0x3b')](_[_0x8f48('0x5c')](_0x43cc94[_0x8f48('0x3a')],_0x24518f[_0x8f48('0x3b')]));_0x2539b9['raw']=!![];if(_0x43cc94['query']['filter']){_0x2539b9[_0x8f48('0x43')]=_[_0x8f48('0x44')](_0x2539b9[_0x8f48('0x43')],{'$or':_['map'](_0x2539b9[_0x8f48('0x3d')],function(_0xc47231){var _0x304af9={};_0x304af9[_0xc47231]={'$like':'%'+_0x43cc94[_0x8f48('0x3a')][_0x8f48('0x5d')]+'%'};return _0x304af9;})});}_0x2539b9=_[_0x8f48('0x44')]({},_0x2539b9,_0x43cc94[_0x8f48('0x4d')]);return _0x51f8c5[_0x8f48('0x6a')](_0x2539b9);}})[_0x8f48('0x2b')](respondWithResult(_0x57e604,null))[_0x8f48('0x49')](handleError(_0x57e604,null));};exports[_0x8f48('0x6f')]=function(_0x23e953,_0x25d85b,_0x25c99b){var _0x448dcf;return db[_0x8f48('0x35')][_0x8f48('0x4e')]({'where':{'id':_0x23e953[_0x8f48('0x4b')]['id']},'include':[{'model':db[_0x8f48('0x70')],'as':_0x8f48('0x6b')}]})[_0x8f48('0x2b')](handleEntityNotFound(_0x25d85b,null))[_0x8f48('0x2b')](function(_0x5c79b2){if(_0x5c79b2){_0x448dcf=_0x5c79b2;return db[_0x8f48('0x65')][_0x8f48('0x36')];}})[_0x8f48('0x2b')](function(_0x4f301a){if(_0x4f301a){var _0x1a264b={};var _0x52e353={};_0x52e353['model']=_[_0x8f48('0x71')](_[_0x8f48('0x4c')](_0x4f301a),_[_0x8f48('0x34')](_0x448dcf[_0x8f48('0x6b')],function(_0xcf6886){return util[_0x8f48('0x6c')](_0x8f48('0x6d'),_0xcf6886['id']);}));_0x52e353[_0x8f48('0x3a')]=_[_0x8f48('0x4c')](_0x23e953[_0x8f48('0x3a')]);_0x52e353[_0x8f48('0x3b')]=_[_0x8f48('0x3c')](_0x52e353[_0x8f48('0x39')],_0x52e353[_0x8f48('0x3a')]);_0x1a264b[_0x8f48('0x3d')]=_[_0x8f48('0x3c')](_0x52e353[_0x8f48('0x39')],qs[_0x8f48('0x3e')](_0x23e953[_0x8f48('0x3a')][_0x8f48('0x3e')]));_0x1a264b[_0x8f48('0x3d')]=_0x1a264b[_0x8f48('0x3d')][_0x8f48('0x3f')]?_0x1a264b[_0x8f48('0x3d')]:_0x52e353[_0x8f48('0x39')];if(!_0x23e953[_0x8f48('0x3a')][_0x8f48('0x40')](_0x8f48('0x41'))){_0x1a264b[_0x8f48('0x23')]=qs[_0x8f48('0x23')](_0x23e953[_0x8f48('0x3a')][_0x8f48('0x23')]);_0x1a264b[_0x8f48('0x21')]=qs['offset'](_0x23e953['query'][_0x8f48('0x21')]);}_0x1a264b[_0x8f48('0x6e')]=qs[_0x8f48('0x42')](_0x23e953[_0x8f48('0x3a')][_0x8f48('0x42')]);_0x1a264b['where']=qs['filters'](_[_0x8f48('0x5c')](_0x23e953['query'],_0x52e353[_0x8f48('0x3b')]));_0x1a264b['raw']=!![];if(_0x23e953[_0x8f48('0x3a')][_0x8f48('0x5d')]){_0x1a264b[_0x8f48('0x43')]=_[_0x8f48('0x44')](_0x1a264b['where'],{'$or':_[_0x8f48('0x34')](_0x1a264b[_0x8f48('0x3d')],function(_0xb34f51){var _0x227168={};_0x227168[_0xb34f51]={'$like':'%'+_0x23e953[_0x8f48('0x3a')][_0x8f48('0x5d')]+'%'};return _0x227168;})});}_0x1a264b=_[_0x8f48('0x44')]({},_0x1a264b,_0x23e953[_0x8f48('0x4d')]);return _0x448dcf['getContacts'](_0x1a264b);}})[_0x8f48('0x2b')](function(_0x38c29f){if(!_[_0x8f48('0x72')](_0x38c29f)){var _0x5d4481=toCsv(_0x38c29f);var _0x242d82=Date[_0x8f48('0x73')]();fs['writeFileSync'](util[_0x8f48('0x6c')](_0x8f48('0x74'),_0x448dcf['id'],_0x242d82),_0x5d4481);_0x25d85b[_0x8f48('0x75')](_0x8f48('0x76'),_0x8f48('0x77')+util[_0x8f48('0x6c')]('list_%d_%s.csv',_0x448dcf['id'],_0x242d82));_0x25d85b[_0x8f48('0x75')](_0x8f48('0x78'),_0x8f48('0x79'));return _0x25d85b['download'](util[_0x8f48('0x6c')](_0x8f48('0x74'),_0x448dcf['id'],_0x242d82));}else{return _0x25d85b[_0x8f48('0x1e')](0xcc);}})[_0x8f48('0x49')](handleError(_0x25d85b,null));};exports[_0x8f48('0x7a')]=function(_0x1c88b5,_0x1bbf38,_0x46fb1d){var _0x3c074d;delete _0x1c88b5[_0x8f48('0x50')]['id'];return db[_0x8f48('0x35')][_0x8f48('0x7b')]({'where':{'id':_0x1c88b5['params']['id']}})[_0x8f48('0x2b')](handleEntityNotFound(_0x1bbf38,null))[_0x8f48('0x2b')](function(_0x19ad40){if(_0x19ad40){return db['sequelize'][_0x8f48('0x7c')](function(_0x3bd822){return db[_0x8f48('0x70')][_0x8f48('0x4f')](_0x1c88b5[_0x8f48('0x50')],{'transaction':_0x3bd822})[_0x8f48('0x2b')](function(_0x1d0ad9){_0x3c074d=_0x1d0ad9;return _0x19ad40[_0x8f48('0x7d')](_0x1d0ad9,{'transaction':_0x3bd822});})[_0x8f48('0x2b')](function(){var _0x43ade8={'type':db[_0x8f48('0x7e')][_0x8f48('0x7f')],'transaction':_0x3bd822};switch(_0x1c88b5[_0x8f48('0x50')]['type']){case'text':_0x43ade8[_0x8f48('0x37')]=db['Sequelize'][_0x8f48('0x7f')];break;case _0x8f48('0x80'):_0x43ade8[_0x8f48('0x37')]=db[_0x8f48('0x7e')]['INTEGER'];break;case'switch':_0x43ade8[_0x8f48('0x37')]=db['Sequelize'][_0x8f48('0x81')];_0x43ade8['defaultValue']=![];break;default:}return db[_0x8f48('0x82')][_0x8f48('0x83')][_0x8f48('0x84')](_0x8f48('0x85'),util[_0x8f48('0x6c')](_0x8f48('0x86'),_0x3c074d['id']),_0x43ade8);})[_0x8f48('0x2b')](function(){return _0x3c074d;});});}})[_0x8f48('0x2b')](respondWithResult(_0x1bbf38,null))[_0x8f48('0x49')](handleError(_0x1bbf38,null));};exports[_0x8f48('0x87')]=function(_0x183eba,_0x3b15fe,_0xfd8550){var _0xea89de={};var _0x7403df={};var _0x512865;var _0x2c00ef;return db[_0x8f48('0x35')][_0x8f48('0x7b')]({'where':{'id':_0x183eba[_0x8f48('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b15fe,null))[_0x8f48('0x2b')](function(_0x44bd31){if(_0x44bd31){_0x512865=_0x44bd31;_0x7403df[_0x8f48('0x39')]=_[_0x8f48('0x4c')](db['CmCustomField'][_0x8f48('0x36')]);_0x7403df[_0x8f48('0x3a')]=_[_0x8f48('0x4c')](_0x183eba['query']);_0x7403df[_0x8f48('0x3b')]=_[_0x8f48('0x3c')](_0x7403df['model'],_0x7403df[_0x8f48('0x3a')]);_0xea89de[_0x8f48('0x3d')]=_['intersection'](_0x7403df[_0x8f48('0x39')],qs['fields'](_0x183eba[_0x8f48('0x3a')][_0x8f48('0x3e')]));_0xea89de[_0x8f48('0x3d')]=_0xea89de['attributes'][_0x8f48('0x3f')]?_0xea89de[_0x8f48('0x3d')]:_0x7403df[_0x8f48('0x39')];_0xea89de[_0x8f48('0x6e')]=qs['sort'](_0x183eba[_0x8f48('0x3a')][_0x8f48('0x42')]);_0xea89de[_0x8f48('0x43')]=qs[_0x8f48('0x3b')](_[_0x8f48('0x5c')](_0x183eba[_0x8f48('0x3a')],_0x7403df[_0x8f48('0x3b')]));_0xea89de['where']=_[_0x8f48('0x44')](_0xea89de[_0x8f48('0x43')],{'$or':[{'ListId':_0x44bd31['id']},{'ListId':null}]});if(_0x183eba[_0x8f48('0x3a')][_0x8f48('0x5d')]){_0xea89de[_0x8f48('0x43')]=_[_0x8f48('0x44')](_0xea89de['where'],{'$or':_[_0x8f48('0x34')](_0xea89de['attributes'],function(_0x31284f){var _0x1106dc={};_0x1106dc[_0x31284f]={'$like':'%'+_0x183eba['query']['filter']+'%'};return _0x1106dc;})});}_0xea89de=_[_0x8f48('0x44')]({},_0xea89de,_0x183eba[_0x8f48('0x4d')]);return db[_0x8f48('0x70')][_0x8f48('0x88')](_0xea89de);}})[_0x8f48('0x2b')](respondWithResult(_0x3b15fe,null))[_0x8f48('0x49')](handleError(_0x3b15fe,null));};exports[_0x8f48('0x89')]=function(_0x29d54f,_0x4430af,_0x4dc30b){return db[_0x8f48('0x35')][_0x8f48('0x4e')]({'where':{'id':_0x29d54f['params']['id']}})['then'](handleEntityNotFound(_0x4430af,null))['then'](function(_0x1a4b5d){if(_0x1a4b5d){return _0x1a4b5d[_0x8f48('0x89')](_0x29d54f[_0x8f48('0x50')][_0x8f48('0x5f')],_[_0x8f48('0x66')](_0x29d54f['body'],[_0x8f48('0x5f'),'id'])||{})[_0x8f48('0x8a')](function(_0xf40f4){for(var _0x393626=0x0;_0x393626<_0x29d54f[_0x8f48('0x50')][_0x8f48('0x5f')][_0x8f48('0x3f')];_0x393626+=0x1){socket[_0x8f48('0x8b')](_0x8f48('0x8c'),{'UserId':Number(_0x29d54f[_0x8f48('0x50')][_0x8f48('0x5f')][_0x393626]),'CmListId':Number(_0x29d54f[_0x8f48('0x4b')]['id'])});}return _0xf40f4;});}})[_0x8f48('0x2b')](respondWithResult(_0x4430af,null))['catch'](handleError(_0x4430af,null));};exports[_0x8f48('0x8d')]=function(_0x46bb7e,_0x4d9551,_0x5f4709){return db[_0x8f48('0x35')][_0x8f48('0x4e')]({'where':{'id':_0x46bb7e[_0x8f48('0x4b')]['id']}})[_0x8f48('0x2b')](handleEntityNotFound(_0x4d9551,null))[_0x8f48('0x2b')](function(_0x52a6c9){if(_0x52a6c9){return _0x52a6c9[_0x8f48('0x8d')](_0x46bb7e[_0x8f48('0x3a')][_0x8f48('0x5f')])[_0x8f48('0x2b')](function(){if(_['isArray'](_0x46bb7e[_0x8f48('0x3a')][_0x8f48('0x5f')])){for(var _0x3a8e4f=0x0;_0x3a8e4f<_0x46bb7e['query'][_0x8f48('0x5f')][_0x8f48('0x3f')];_0x3a8e4f+=0x1){socket[_0x8f48('0x8b')](_0x8f48('0x8e'),{'UserId':Number(_0x46bb7e[_0x8f48('0x3a')]['ids'][_0x3a8e4f]),'CmListId':Number(_0x46bb7e['params']['id'])});}}else{socket[_0x8f48('0x8b')](_0x8f48('0x8e'),{'UserId':Number(_0x46bb7e[_0x8f48('0x3a')][_0x8f48('0x5f')]),'CmListId':Number(_0x46bb7e[_0x8f48('0x4b')]['id'])});}});}})[_0x8f48('0x2b')](respondWithStatusCode(_0x4d9551,null))[_0x8f48('0x49')](handleError(_0x4d9551,null));};exports[_0x8f48('0x8f')]=function(_0x4a46e4,_0xb799dd,_0x1f51c7){var _0x1af37d={};var _0x504dbe={};var _0x26d898;var _0x487f5a;return db[_0x8f48('0x35')][_0x8f48('0x7b')]({'where':{'id':_0x4a46e4['params']['id']}})[_0x8f48('0x2b')](handleEntityNotFound(_0xb799dd,null))[_0x8f48('0x2b')](function(_0x1698d8){if(_0x1698d8){_0x26d898=_0x1698d8;_0x504dbe[_0x8f48('0x39')]=_[_0x8f48('0x4c')](db[_0x8f48('0x90')][_0x8f48('0x36')]);_0x504dbe[_0x8f48('0x3a')]=_['keys'](_0x4a46e4[_0x8f48('0x3a')]);_0x504dbe['filters']=_[_0x8f48('0x3c')](_0x504dbe['model'],_0x504dbe[_0x8f48('0x3a')]);_0x1af37d[_0x8f48('0x3d')]=_[_0x8f48('0x3c')](_0x504dbe[_0x8f48('0x39')],qs[_0x8f48('0x3e')](_0x4a46e4[_0x8f48('0x3a')]['fields']));_0x1af37d['attributes']=_0x1af37d[_0x8f48('0x3d')]['length']?_0x1af37d[_0x8f48('0x3d')]:_0x504dbe[_0x8f48('0x39')];_0x1af37d[_0x8f48('0x6e')]=qs[_0x8f48('0x42')](_0x4a46e4[_0x8f48('0x3a')][_0x8f48('0x42')]);_0x1af37d[_0x8f48('0x43')]=qs[_0x8f48('0x3b')](_[_0x8f48('0x5c')](_0x4a46e4[_0x8f48('0x3a')],_0x504dbe[_0x8f48('0x3b')]));if(_0x4a46e4['query'][_0x8f48('0x5d')]){_0x1af37d[_0x8f48('0x43')]=_[_0x8f48('0x44')](_0x1af37d[_0x8f48('0x43')],{'$or':_[_0x8f48('0x34')](_0x1af37d['attributes'],function(_0x46f139){var _0x421e18={};_0x421e18[_0x46f139]={'$like':'%'+_0x4a46e4[_0x8f48('0x3a')][_0x8f48('0x5d')]+'%'};return _0x421e18;})});}_0x1af37d=_[_0x8f48('0x44')]({},_0x1af37d,_0x4a46e4['options']);return _0x26d898[_0x8f48('0x8f')](_0x1af37d);}})[_0x8f48('0x2b')](function(_0x68ff6a){if(_0x68ff6a){_0x487f5a=_0x68ff6a[_0x8f48('0x3f')];if(!_0x4a46e4[_0x8f48('0x3a')]['hasOwnProperty'](_0x8f48('0x41'))){_0x1af37d['limit']=qs[_0x8f48('0x23')](_0x4a46e4[_0x8f48('0x3a')][_0x8f48('0x23')]);_0x1af37d['offset']=qs[_0x8f48('0x21')](_0x4a46e4['query'][_0x8f48('0x21')]);}return _0x26d898[_0x8f48('0x8f')](_0x1af37d);}})[_0x8f48('0x2b')](function(_0x179209){if(_0x179209){return _0x179209?{'count':_0x487f5a,'rows':_0x179209}:null;}})['then'](respondWithResult(_0xb799dd,null))[_0x8f48('0x49')](handleError(_0xb799dd,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1fd6f49..4a20f4e 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x14e51e,_0xed289b){var _0xf93e94=function(_0x4ed5bb){while(--_0x4ed5bb){_0x14e51e['push'](_0x14e51e['shift']());}};_0xf93e94(++_0xed289b);}(_0x814b,0x1a2));var _0xb814=function(_0x113afc,_0x2c7d5a){_0x113afc=_0x113afc-0x0;var _0x3a9219=_0x814b[_0x113afc];return _0x3a9219;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x5fc3[_0x5774be];return _0x4914b4;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 497c9af..3040d81 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['cm_lists','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x254c5d,_0x5763fa){var _0x5e4f74=function(_0x1089b5){while(--_0x1089b5){_0x254c5d['push'](_0x254c5d['shift']());}};_0x5e4f74(++_0x5763fa);}(_0xa74f,0x9a));var _0xfa74=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xa74f[_0x872b02];return _0x1a6b24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2a0765,_0x3ae964){var _0x547461=function(_0x355d25){while(--_0x355d25){_0x2a0765['push'](_0x2a0765['shift']());}};_0x547461(++_0x3ae964);}(_0xb903,0x185));var _0x3b90=function(_0x36ef06,_0x4ef570){_0x36ef06=_0x36ef06-0x0;var _0x272cce=_0xb903[_0x36ef06];return _0x272cce;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('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 695c4c6..3d86da7 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 _0xc921=['localhost','./cmList.socket','request','request\x20sent','error','CmList,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0xc921,0x1d2));var _0x1c92=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xc921[_0x4e4519];return _0x340044;};'use strict';var _=require(_0x1c92('0x0'));var util=require(_0x1c92('0x1'));var moment=require(_0x1c92('0x2'));var BPromise=require(_0x1c92('0x3'));var rs=require(_0x1c92('0x4'));var fs=require('fs');var Redis=require(_0x1c92('0x5'));var db=require(_0x1c92('0x6'))['db'];var utils=require(_0x1c92('0x7'));var logger=require(_0x1c92('0x8'))(_0x1c92('0x9'));var config=require('../../config/environment');var jayson=require(_0x1c92('0xa'));var client=jayson[_0x1c92('0xb')][_0x1c92('0xc')]({'port':0x232a});config[_0x1c92('0xd')]=_['defaults'](config[_0x1c92('0xd')],{'host':_0x1c92('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c92('0xd')]));require(_0x1c92('0xf'))['register'](socket);function respondWithRpcPromise(_0x589439,_0x2d2157,_0xe21ac5){return new BPromise(function(_0x19646d,_0x11d0de){return client[_0x1c92('0x10')](_0x589439,_0xe21ac5)['then'](function(_0x507f6e){logger['info']('CmList,\x20%s,\x20%s',_0x2d2157,'request\x20sent');logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x2d2157,_0x1c92('0x11'),JSON['stringify'](_0x507f6e));if(_0x507f6e[_0x1c92('0x12')]){if(_0x507f6e[_0x1c92('0x12')]['code']===0x1f4){logger[_0x1c92('0x12')](_0x1c92('0x13'),_0x2d2157,_0x507f6e[_0x1c92('0x12')]['message']);return _0x11d0de(_0x507f6e[_0x1c92('0x12')][_0x1c92('0x14')]);}logger[_0x1c92('0x12')](_0x1c92('0x13'),_0x2d2157,_0x507f6e['error'][_0x1c92('0x14')]);return _0x19646d(_0x507f6e[_0x1c92('0x12')][_0x1c92('0x14')]);}else{logger[_0x1c92('0x15')](_0x1c92('0x13'),_0x2d2157,_0x1c92('0x11'));_0x19646d(_0x507f6e[_0x1c92('0x16')][_0x1c92('0x14')]);}})[_0x1c92('0x17')](function(_0x2e33f7){logger[_0x1c92('0x12')](_0x1c92('0x13'),_0x2d2157,_0x2e33f7);_0x11d0de(_0x2e33f7);});});} \ No newline at end of file +var _0x90b6=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x311374,_0x132c28){var _0x1bf041=function(_0x97fff2){while(--_0x97fff2){_0x311374['push'](_0x311374['shift']());}};_0x1bf041(++_0x132c28);}(_0x90b6,0xb7));var _0x690b=function(_0x34759,_0x253489){_0x34759=_0x34759-0x0;var _0x63f560=_0x90b6[_0x34759];return _0x63f560;};'use strict';var _=require(_0x690b('0x0'));var util=require(_0x690b('0x1'));var moment=require(_0x690b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x690b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x690b('0x4'));var logger=require(_0x690b('0x5'))(_0x690b('0x6'));var config=require(_0x690b('0x7'));var jayson=require(_0x690b('0x8'));var client=jayson['client'][_0x690b('0x9')]({'port':0x232a});config[_0x690b('0xa')]=_[_0x690b('0xb')](config[_0x690b('0xa')],{'host':_0x690b('0xc'),'port':0x18eb});var socket=require(_0x690b('0xd'))(new Redis(config['redis']));require(_0x690b('0xe'))['register'](socket);function respondWithRpcPromise(_0x35388a,_0x4e9b64,_0x45d746){return new BPromise(function(_0x253c17,_0x44e857){return client[_0x690b('0xf')](_0x35388a,_0x45d746)[_0x690b('0x10')](function(_0x403ee3){logger[_0x690b('0x11')](_0x690b('0x12'),_0x4e9b64,_0x690b('0x13'));logger[_0x690b('0x14')](_0x690b('0x15'),_0x4e9b64,'request\x20sent',JSON['stringify'](_0x403ee3));if(_0x403ee3[_0x690b('0x16')]){if(_0x403ee3[_0x690b('0x16')]['code']===0x1f4){logger[_0x690b('0x16')]('CmList,\x20%s,\x20%s',_0x4e9b64,_0x403ee3[_0x690b('0x16')][_0x690b('0x17')]);return _0x44e857(_0x403ee3[_0x690b('0x16')][_0x690b('0x17')]);}logger['error'](_0x690b('0x12'),_0x4e9b64,_0x403ee3[_0x690b('0x16')][_0x690b('0x17')]);return _0x253c17(_0x403ee3['error']['message']);}else{logger[_0x690b('0x11')]('CmList,\x20%s,\x20%s',_0x4e9b64,_0x690b('0x13'));_0x253c17(_0x403ee3[_0x690b('0x18')][_0x690b('0x17')]);}})[_0x690b('0x19')](function(_0x502854){logger[_0x690b('0x16')](_0x690b('0x12'),_0x4e9b64,_0x502854);_0x44e857(_0x502854);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index df0e7f7..dabd9b9 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 _0x5e1e=['removeListener','register','length','cmList:','./cmList.events','update','emit'];(function(_0x3f14c0,_0x145b95){var _0x340cb5=function(_0x3184f0){while(--_0x3184f0){_0x3f14c0['push'](_0x3f14c0['shift']());}};_0x340cb5(++_0x145b95);}(_0x5e1e,0xe4));var _0xe5e1=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5e1e[_0x122096];return _0x3d1966;};'use strict';var CmListEvents=require(_0xe5e1('0x0'));var events=['save','remove',_0xe5e1('0x1')];function createListener(_0x4d6f52,_0xb30aa8){return function(_0x32ceeb){_0xb30aa8[_0xe5e1('0x2')](_0x4d6f52,_0x32ceeb);};}function removeListener(_0x176ea4,_0x2cd81d){return function(){CmListEvents[_0xe5e1('0x3')](_0x176ea4,_0x2cd81d);};}exports[_0xe5e1('0x4')]=function(_0x12b807){for(var _0x53bea9=0x0,_0x18d438=events[_0xe5e1('0x5')];_0x53bea9<_0x18d438;_0x53bea9++){var _0x585a31=events[_0x53bea9];var _0x221ea4=createListener(_0xe5e1('0x6')+_0x585a31,_0x12b807);CmListEvents['on'](_0x585a31,_0x221ea4);}}; \ No newline at end of file +var _0x0bcb=['emit','removeListener','register','length','remove','update'];(function(_0x181b48,_0x3f7868){var _0x19f3b5=function(_0x5115bd){while(--_0x5115bd){_0x181b48['push'](_0x181b48['shift']());}};_0x19f3b5(++_0x3f7868);}(_0x0bcb,0x118));var _0xb0bc=function(_0x3edd43,_0x4e1971){_0x3edd43=_0x3edd43-0x0;var _0x2f8dda=_0x0bcb[_0x3edd43];return _0x2f8dda;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xb0bc('0x0'),_0xb0bc('0x1')];function createListener(_0x3b0944,_0x4ea69a){return function(_0xbe37b4){_0x4ea69a[_0xb0bc('0x2')](_0x3b0944,_0xbe37b4);};}function removeListener(_0x174eb7,_0x11de70){return function(){CmListEvents[_0xb0bc('0x3')](_0x174eb7,_0x11de70);};}exports[_0xb0bc('0x4')]=function(_0x1452d9){for(var _0x13fac4=0x0,_0x2dc663=events[_0xb0bc('0x5')];_0x13fac4<_0x2dc663;_0x13fac4++){var _0x48d931=events[_0x13fac4];var _0x36a086=createListener('cmList:'+_0x48d931,_0x1452d9);CmListEvents['on'](_0x48d931,_0x36a086);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 191ce90..51dd54e 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 _0xabbc=['addContacts','/:id/fields','addCustomField','addAgents','update','delete','removeDispositions','removeAgents','exports','multer','util','express','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','addDisposition'];(function(_0x487fc1,_0x46621c){var _0x5d79bd=function(_0x450770){while(--_0x450770){_0x487fc1['push'](_0x487fc1['shift']());}};_0x5d79bd(++_0x46621c);}(_0xabbc,0x175));var _0xcabb=function(_0x85953f,_0x2decd2){_0x85953f=_0x85953f-0x0;var _0x35a9c5=_0xabbc[_0x85953f];return _0x35a9c5;};'use strict';var multer=require(_0xcabb('0x0'));var util=require(_0xcabb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcabb('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcabb('0x3'));var controller=require(_0xcabb('0x4'));router[_0xcabb('0x5')]('/',auth[_0xcabb('0x6')](),controller['index']);router[_0xcabb('0x5')](_0xcabb('0x7'),auth[_0xcabb('0x6')](),controller['describe']);router[_0xcabb('0x5')](_0xcabb('0x8'),auth[_0xcabb('0x6')](),controller[_0xcabb('0x9')]);router[_0xcabb('0x5')](_0xcabb('0xa'),auth[_0xcabb('0x6')](),controller[_0xcabb('0xb')]);router[_0xcabb('0x5')]('/:id/contacts',auth[_0xcabb('0x6')](),controller['getContacts']);router['get'](_0xcabb('0xc'),auth[_0xcabb('0x6')](),controller[_0xcabb('0xd')]);router['get']('/:id/fields',auth[_0xcabb('0x6')](),controller[_0xcabb('0xe')]);router['get'](_0xcabb('0xf'),auth[_0xcabb('0x6')](),controller['getAgents']);router[_0xcabb('0x10')]('/',auth[_0xcabb('0x6')](),controller[_0xcabb('0x11')]);router[_0xcabb('0x10')]('/:id/dispositions',auth[_0xcabb('0x6')](),controller[_0xcabb('0x12')]);router[_0xcabb('0x10')]('/:id/contacts',auth[_0xcabb('0x6')](),controller[_0xcabb('0x13')]);router[_0xcabb('0x10')](_0xcabb('0x14'),auth[_0xcabb('0x6')](),controller[_0xcabb('0x15')]);router[_0xcabb('0x10')](_0xcabb('0xf'),auth['isAuthenticated'](),controller[_0xcabb('0x16')]);router['put']('/:id',auth[_0xcabb('0x6')](),controller[_0xcabb('0x17')]);router[_0xcabb('0x18')]('/:id',auth[_0xcabb('0x6')](),controller['destroy']);router[_0xcabb('0x18')](_0xcabb('0xa'),auth[_0xcabb('0x6')](),controller[_0xcabb('0x19')]);router[_0xcabb('0x18')](_0xcabb('0xf'),auth['isAuthenticated'](),controller[_0xcabb('0x1a')]);module[_0xcabb('0x1b')]=router; \ No newline at end of file +var _0xb413=['addAgents','put','update','destroy','delete','removeDispositions','removeAgents','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addContacts','addCustomField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb413,0x1b4));var _0x3b41=function(_0x167075,_0x51fa83){_0x167075=_0x167075-0x0;var _0x3c5f0a=_0xb413[_0x167075];return _0x3c5f0a;};'use strict';var multer=require('multer');var util=require(_0x3b41('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b41('0x1'));var router=express[_0x3b41('0x2')]();var fs_extra=require(_0x3b41('0x3'));var auth=require(_0x3b41('0x4'));var interaction=require(_0x3b41('0x5'));var config=require('../../config/environment');var controller=require(_0x3b41('0x6'));router[_0x3b41('0x7')]('/',auth[_0x3b41('0x8')](),controller[_0x3b41('0x9')]);router[_0x3b41('0x7')](_0x3b41('0xa'),auth[_0x3b41('0x8')](),controller[_0x3b41('0xb')]);router[_0x3b41('0x7')](_0x3b41('0xc'),auth[_0x3b41('0x8')](),controller[_0x3b41('0xd')]);router[_0x3b41('0x7')](_0x3b41('0xe'),auth[_0x3b41('0x8')](),controller[_0x3b41('0xf')]);router['get'](_0x3b41('0x10'),auth[_0x3b41('0x8')](),controller['getContacts']);router[_0x3b41('0x7')](_0x3b41('0x11'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x3b41('0x7')](_0x3b41('0x12'),auth[_0x3b41('0x8')](),controller[_0x3b41('0x13')]);router[_0x3b41('0x7')](_0x3b41('0x14'),auth['isAuthenticated'](),controller[_0x3b41('0x15')]);router[_0x3b41('0x16')]('/',auth['isAuthenticated'](),controller[_0x3b41('0x17')]);router[_0x3b41('0x16')](_0x3b41('0xe'),auth[_0x3b41('0x8')](),controller['addDisposition']);router[_0x3b41('0x16')](_0x3b41('0x10'),auth[_0x3b41('0x8')](),controller[_0x3b41('0x18')]);router['post']('/:id/fields',auth[_0x3b41('0x8')](),controller[_0x3b41('0x19')]);router[_0x3b41('0x16')](_0x3b41('0x14'),auth['isAuthenticated'](),controller[_0x3b41('0x1a')]);router[_0x3b41('0x1b')]('/:id',auth[_0x3b41('0x8')](),controller[_0x3b41('0x1c')]);router['delete'](_0x3b41('0xc'),auth[_0x3b41('0x8')](),controller[_0x3b41('0x1d')]);router[_0x3b41('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3b41('0x1f')]);router['delete'](_0x3b41('0x14'),auth[_0x3b41('0x8')](),controller[_0x3b41('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index cd32e51..35cc748 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 _0x3791=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x3791,0x18c));var _0x1379=function(_0x167022,_0x590e5c){_0x167022=_0x167022-0x0;var _0x413cbd=_0x3791[_0x167022];return _0x413cbd;};'use strict';var Sequelize=require(_0x1379('0x0'));module[_0x1379('0x1')]={'name':{'type':Sequelize[_0x1379('0x2')],'get':function(_0x2424c5){return this['getDataValue'](_0x1379('0x3'));}},'field':{'type':Sequelize[_0x1379('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x1379('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x2f26=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x1041d4,_0x3426ff){var _0x1a6f86=function(_0x2c8c34){while(--_0x2c8c34){_0x1041d4['push'](_0x1041d4['shift']());}};_0x1a6f86(++_0x3426ff);}(_0x2f26,0x1b9));var _0x62f2=function(_0x31c319,_0x474e7c){_0x31c319=_0x31c319-0x0;var _0xf33897=_0x2f26[_0x31c319];return _0xf33897;};'use strict';var Sequelize=require('sequelize');module[_0x62f2('0x0')]={'name':{'type':Sequelize[_0x62f2('0x1')],'get':function(_0x357a5e){return this[_0x62f2('0x2')](_0x62f2('0x3'));}},'field':{'type':Sequelize[_0x62f2('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x62f2('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x62f2('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 20fb764..e4b882d 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(_0x574445,_0xc10949){var _0x2c48db=function(_0x227dd4){while(--_0x227dd4){_0x574445['push'](_0x574445['shift']());}};_0x2c48db(++_0xc10949);}(_0x7a54,0x106));var _0x47a5=function(_0xfbe793,_0x2523c6){_0xfbe793=_0xfbe793-0x0;var _0x51e1fa=_0x7a54[_0xfbe793];return _0x51e1fa;};'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 _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(_0x434408,_0x28c088){var _0x275401=function(_0x1032db){while(--_0x1032db){_0x434408['push'](_0x434408['shift']());}};_0x275401(++_0x28c088);}(_0x7a54,0x106));var _0x47a5=function(_0x51e0e1,_0x4f079f){_0x51e0e1=_0x51e0e1-0x0;var _0x3475f8=_0x7a54[_0x51e0e1];return _0x3475f8;};'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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 7b5a573..9c6384e 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 _0xbd65=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','Condition','lodash','util','moment'];(function(_0x5102a1,_0x4b8043){var _0x5baf98=function(_0x5a6ecd){while(--_0x5a6ecd){_0x5102a1['push'](_0x5102a1['shift']());}};_0x5baf98(++_0x4b8043);}(_0xbd65,0x168));var _0x5bd6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbd65[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5bd6('0x0'));var util=require(_0x5bd6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5bd6('0x2'));var BPromise=require(_0x5bd6('0x3'));var rp=require(_0x5bd6('0x4'));var fs=require('fs');var path=require(_0x5bd6('0x5'));var rimraf=require(_0x5bd6('0x6'));var config=require(_0x5bd6('0x7'));var attributes=require(_0x5bd6('0x8'));module[_0x5bd6('0x9')]=function(_0x1b3549,_0x36f1f2){return _0x1b3549['define'](_0x5bd6('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4d2=['path','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util','bluebird'];(function(_0x482246,_0xdbff65){var _0x599ca=function(_0x158cf8){while(--_0x158cf8){_0x482246['push'](_0x482246['shift']());}};_0x599ca(++_0xdbff65);}(_0xa4d2,0x89));var _0x2a4d=function(_0x3d3aab,_0x55b265){_0x3d3aab=_0x3d3aab-0x0;var _0x44f18e=_0xa4d2[_0x3d3aab];return _0x44f18e;};'use strict';var _=require(_0x2a4d('0x0'));var util=require(_0x2a4d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2a4d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a4d('0x3'));var rimraf=require(_0x2a4d('0x4'));var config=require(_0x2a4d('0x5'));var attributes=require(_0x2a4d('0x6'));module[_0x2a4d('0x7')]=function(_0x5acbc6,_0x4cf0eb){return _0x5acbc6['define'](_0x2a4d('0x8'),attributes,{'tableName':_0x2a4d('0x9'),'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 e03b7f7..5025613 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 _0xfe06=['stringify','error','code','result','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x6742d9,_0x45c03c){var _0x5dbb51=function(_0x21e3be){while(--_0x21e3be){_0x6742d9['push'](_0x6742d9['shift']());}};_0x5dbb51(++_0x45c03c);}(_0xfe06,0x148));var _0x6fe0=function(_0x2a0aeb,_0x498df0){_0x2a0aeb=_0x2a0aeb-0x0;var _0x2a56ab=_0xfe06[_0x2a0aeb];return _0x2a56ab;};'use strict';var _=require(_0x6fe0('0x0'));var util=require(_0x6fe0('0x1'));var moment=require(_0x6fe0('0x2'));var BPromise=require(_0x6fe0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6fe0('0x4'));var db=require(_0x6fe0('0x5'))['db'];var utils=require(_0x6fe0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6fe0('0x7'));var jayson=require(_0x6fe0('0x8'));var client=jayson['client'][_0x6fe0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ba032,_0xfd349b,_0x6ebf6e){return new BPromise(function(_0x20f113,_0x4c15dd){return client[_0x6fe0('0xa')](_0x3ba032,_0x6ebf6e)[_0x6fe0('0xb')](function(_0x486c3c){logger[_0x6fe0('0xc')](_0x6fe0('0xd'),_0xfd349b,_0x6fe0('0xe'));logger[_0x6fe0('0xf')](_0x6fe0('0x10'),_0xfd349b,_0x6fe0('0xe'),JSON[_0x6fe0('0x11')](_0x486c3c));if(_0x486c3c['error']){if(_0x486c3c[_0x6fe0('0x12')][_0x6fe0('0x13')]===0x1f4){logger['error'](_0x6fe0('0xd'),_0xfd349b,_0x486c3c[_0x6fe0('0x12')]['message']);return _0x4c15dd(_0x486c3c['error']['message']);}logger[_0x6fe0('0x12')](_0x6fe0('0xd'),_0xfd349b,_0x486c3c[_0x6fe0('0x12')]['message']);return _0x20f113(_0x486c3c['error']['message']);}else{logger[_0x6fe0('0xc')](_0x6fe0('0xd'),_0xfd349b,_0x6fe0('0xe'));_0x20f113(_0x486c3c[_0x6fe0('0x14')][_0x6fe0('0x15')]);}})[_0x6fe0('0x16')](function(_0x575805){logger[_0x6fe0('0x12')](_0x6fe0('0xd'),_0xfd349b,_0x575805);_0x4c15dd(_0x575805);});});} \ No newline at end of file +var _0x4cab=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error'];(function(_0x3a4104,_0x1925df){var _0x242e14=function(_0x1aef8a){while(--_0x1aef8a){_0x3a4104['push'](_0x3a4104['shift']());}};_0x242e14(++_0x1925df);}(_0x4cab,0xfe));var _0xb4ca=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x4cab[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require('lodash');var util=require(_0xb4ca('0x0'));var moment=require(_0xb4ca('0x1'));var BPromise=require(_0xb4ca('0x2'));var rs=require(_0xb4ca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4ca('0x4'))['db'];var utils=require(_0xb4ca('0x5'));var logger=require(_0xb4ca('0x6'))(_0xb4ca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb4ca('0x8')][_0xb4ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc317,_0x1a64a4,_0x1c739e){return new BPromise(function(_0x405033,_0x1f647f){return client['request'](_0x2bc317,_0x1c739e)[_0xb4ca('0xa')](function(_0x51384e){logger[_0xb4ca('0xb')](_0xb4ca('0xc'),_0x1a64a4,_0xb4ca('0xd'));logger['debug'](_0xb4ca('0xe'),_0x1a64a4,'request\x20sent',JSON['stringify'](_0x51384e));if(_0x51384e[_0xb4ca('0xf')]){if(_0x51384e['error'][_0xb4ca('0x10')]===0x1f4){logger[_0xb4ca('0xf')](_0xb4ca('0xc'),_0x1a64a4,_0x51384e[_0xb4ca('0xf')][_0xb4ca('0x11')]);return _0x1f647f(_0x51384e[_0xb4ca('0xf')]['message']);}logger[_0xb4ca('0xf')](_0xb4ca('0xc'),_0x1a64a4,_0x51384e[_0xb4ca('0xf')]['message']);return _0x405033(_0x51384e[_0xb4ca('0xf')][_0xb4ca('0x11')]);}else{logger[_0xb4ca('0xb')](_0xb4ca('0xc'),_0x1a64a4,'request\x20sent');_0x405033(_0x51384e['result']['message']);}})['catch'](function(_0x456c7c){logger[_0xb4ca('0xf')](_0xb4ca('0xc'),_0x1a64a4,_0x456c7c);_0x1f647f(_0x456c7c);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8fae79a..cfa36e9 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 _0xa55c=['isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xa55c,0x16c));var _0xca55=function(_0x23fcb7,_0x1ce68c){_0x23fcb7=_0x23fcb7-0x0;var _0x1f36a7=_0xa55c[_0x23fcb7];return _0x1f36a7;};'use strict';var multer=require(_0xca55('0x0'));var util=require(_0xca55('0x1'));var path=require(_0xca55('0x2'));var timeout=require(_0xca55('0x3'));var express=require(_0xca55('0x4'));var router=express[_0xca55('0x5')]();var fs_extra=require(_0xca55('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xca55('0x7'));var config=require(_0xca55('0x8'));var controller=require(_0xca55('0x9'));router[_0xca55('0xa')]('/:id',auth[_0xca55('0xb')](),controller[_0xca55('0xc')]);router[_0xca55('0xd')]('/:id',auth[_0xca55('0xb')](),controller[_0xca55('0xe')]);module['exports']=router; \ No newline at end of file +var _0xf207=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0xfe2799,_0x19063c){var _0x447670=function(_0x270487){while(--_0x270487){_0xfe2799['push'](_0xfe2799['shift']());}};_0x447670(++_0x19063c);}(_0xf207,0x13b));var _0x7f20=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0xf207[_0x705b98];return _0x47b72f;};'use strict';var multer=require(_0x7f20('0x0'));var util=require('util');var path=require(_0x7f20('0x1'));var timeout=require(_0x7f20('0x2'));var express=require('express');var router=express[_0x7f20('0x3')]();var fs_extra=require(_0x7f20('0x4'));var auth=require(_0x7f20('0x5'));var interaction=require(_0x7f20('0x6'));var config=require(_0x7f20('0x7'));var controller=require(_0x7f20('0x8'));router['put'](_0x7f20('0x9'),auth[_0x7f20('0xa')](),controller[_0x7f20('0xb')]);router[_0x7f20('0xc')](_0x7f20('0x9'),auth[_0x7f20('0xa')](),controller[_0x7f20('0xd')]);module[_0x7f20('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 9a479b1..4f815a4 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 _0x2032=['name','exports','STRING'];(function(_0x3a58a1,_0x26ceac){var _0x530a3e=function(_0x4a5549){while(--_0x4a5549){_0x3a58a1['push'](_0x3a58a1['shift']());}};_0x530a3e(++_0x26ceac);}(_0x2032,0xd9));var _0x2203=function(_0x853403,_0x52525a){_0x853403=_0x853403-0x0;var _0x5a1ba4=_0x2032[_0x853403];return _0x5a1ba4;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x4e9a5d,_0x55467c){var _0x8f2308=function(_0x3ec62c){while(--_0x3ec62c){_0x4e9a5d['push'](_0x4e9a5d['shift']());}};_0x8f2308(++_0x55467c);}(_0x757a,0xde));var _0xa757=function(_0x37f126,_0x3dc8eb){_0x37f126=_0x37f126-0x0;var _0x35d503=_0x757a[_0x37f126];return _0x35d503;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 8900cc0..51f4d90 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 _0x3c70=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CustomDashboards','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','role','autoAssociation','error','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','order','pick','rimraf','fast-json-patch','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','count','set','json','update','then','get','destroy','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','find','create'];(function(_0x511cb7,_0x3c0389){var _0x2fa807=function(_0x132d30){while(--_0x132d30){_0x511cb7['push'](_0x511cb7['shift']());}};_0x2fa807(++_0x3c0389);}(_0x3c70,0x19e));var _0x03c7=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x3c70[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03c7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03c7('0x1'));var rp=require(_0x03c7('0x2'));var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var Mustache=require('mustache');var util=require(_0x03c7('0x5'));var path=require(_0x03c7('0x6'));var sox=require(_0x03c7('0x7'));var csv=require('to-csv');var ejs=require(_0x03c7('0x8'));var fs=require('fs');var fs_extra=require(_0x03c7('0x9'));var _=require(_0x03c7('0xa'));var squel=require(_0x03c7('0xb'));var crypto=require(_0x03c7('0xc'));var jsforce=require(_0x03c7('0xd'));var deskjs=require(_0x03c7('0xe'));var toCsv=require(_0x03c7('0xf'));var querystring=require(_0x03c7('0x10'));var Papa=require(_0x03c7('0x11'));var Redis=require(_0x03c7('0x12'));var authService=require(_0x03c7('0x13'));var qs=require(_0x03c7('0x14'));var as=require(_0x03c7('0x15'));var hardwareService=require(_0x03c7('0x16'));var logger=require(_0x03c7('0x17'))(_0x03c7('0x18'));var utils=require(_0x03c7('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x03c7('0x1a'));var db=require(_0x03c7('0x1b'))['db'];config[_0x03c7('0x1c')]=_[_0x03c7('0x1d')](config['redis'],{'host':_0x03c7('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x03c7('0x1f')](socket);function respondWithStatusCode(_0x36684d,_0x28038b){_0x28038b=_0x28038b||0xcc;return function(_0x765b49){if(_0x765b49){return _0x36684d[_0x03c7('0x20')](_0x28038b);}return _0x36684d[_0x03c7('0x21')](_0x28038b)[_0x03c7('0x22')]();};}function respondWithResult(_0x26f356,_0x4e5ff8){_0x4e5ff8=_0x4e5ff8||0xc8;return function(_0x1e2374){if(_0x1e2374){return _0x26f356[_0x03c7('0x21')](_0x4e5ff8)['json'](_0x1e2374);}};}function respondWithFilteredResult(_0x46bffd,_0x499591){return function(_0x4cb1d0){if(_0x4cb1d0){var _0x4f6787=typeof _0x499591[_0x03c7('0x23')]===_0x03c7('0x24')&&typeof _0x499591['limit']===_0x03c7('0x24');var _0x36ab56=_0x4cb1d0[_0x03c7('0x25')];var _0x11a53a=_0x4f6787?0x0:_0x499591[_0x03c7('0x23')];var _0x2d32a0=_0x4f6787?_0x4cb1d0['count']:_0x499591[_0x03c7('0x23')]+_0x499591['limit'];var _0x1cb4aa;if(_0x2d32a0>=_0x36ab56){_0x2d32a0=_0x36ab56;_0x1cb4aa=0xc8;}else{_0x1cb4aa=0xce;}_0x46bffd[_0x03c7('0x21')](_0x1cb4aa);return _0x46bffd[_0x03c7('0x26')]('Content-Range',_0x11a53a+'-'+_0x2d32a0+'/'+_0x36ab56)[_0x03c7('0x27')](_0x4cb1d0);}return null;};}function patchUpdates(_0x1e313b){return function(_0x5f3142){try{jsonpatch['apply'](_0x5f3142,_0x1e313b,!![]);}catch(_0x4d669e){return BPromise['reject'](_0x4d669e);}return _0x5f3142['save']();};}function saveUpdates(_0x425226,_0x490e44){return function(_0x9116f1){if(_0x9116f1){return _0x9116f1[_0x03c7('0x28')](_0x425226)[_0x03c7('0x29')](function(_0x37d725){return _0x37d725;});}return null;};}function removeEntity(_0xfd7cff,_0x552f9e){return function(_0x2e5ece){if(_0x2e5ece){return _0x2e5ece['destroy']()[_0x03c7('0x29')](function(){var _0x217e96=_0x2e5ece[_0x03c7('0x2a')]({'plain':!![]});var _0x5c1226='CustomDashboards';return db['UserProfileResource'][_0x03c7('0x2b')]({'where':{'type':_0x5c1226,'resourceId':_0x217e96['id']}})[_0x03c7('0x29')](function(){return _0x2e5ece;});})[_0x03c7('0x29')](function(){_0xfd7cff[_0x03c7('0x21')](0xcc)[_0x03c7('0x22')]();});}};}function handleEntityNotFound(_0x10b5a4,_0x4a3405){return function(_0x9d0777){if(!_0x9d0777){_0x10b5a4['sendStatus'](0x194);}return _0x9d0777;};}function handleError(_0x1e247d,_0x2b6ee6){_0x2b6ee6=_0x2b6ee6||0x1f4;return function(_0x27a793){logger['error'](_0x27a793[_0x03c7('0x2c')]);if(_0x27a793[_0x03c7('0x2d')]){delete _0x27a793[_0x03c7('0x2d')];}_0x1e247d[_0x03c7('0x21')](_0x2b6ee6)[_0x03c7('0x2e')](_0x27a793);};}exports[_0x03c7('0x2f')]=function(_0x4acb53,_0x367f7f){var _0x3d3315={},_0x52eef1={},_0x20f005={'count':0x0,'rows':[]};var _0x4f20ae=_[_0x03c7('0x30')](db[_0x03c7('0x31')][_0x03c7('0x32')],function(_0x614f6d){return{'name':_0x614f6d[_0x03c7('0x33')],'type':_0x614f6d[_0x03c7('0x34')][_0x03c7('0x35')]};});_0x52eef1[_0x03c7('0x36')]=_[_0x03c7('0x30')](_0x4f20ae,'name');_0x52eef1[_0x03c7('0x37')]=_[_0x03c7('0x38')](_0x4acb53[_0x03c7('0x37')]);_0x52eef1['filters']=_[_0x03c7('0x39')](_0x52eef1[_0x03c7('0x36')],_0x52eef1[_0x03c7('0x37')]);_0x3d3315[_0x03c7('0x3a')]=_[_0x03c7('0x39')](_0x52eef1[_0x03c7('0x36')],qs[_0x03c7('0x3b')](_0x4acb53['query'][_0x03c7('0x3b')]));_0x3d3315[_0x03c7('0x3a')]=_0x3d3315[_0x03c7('0x3a')][_0x03c7('0x3c')]?_0x3d3315[_0x03c7('0x3a')]:_0x52eef1[_0x03c7('0x36')];if(!_0x4acb53[_0x03c7('0x37')][_0x03c7('0x3d')](_0x03c7('0x3e'))){_0x3d3315[_0x03c7('0x3f')]=qs['limit'](_0x4acb53[_0x03c7('0x37')]['limit']);_0x3d3315[_0x03c7('0x23')]=qs[_0x03c7('0x23')](_0x4acb53['query'][_0x03c7('0x23')]);}_0x3d3315['order']=qs[_0x03c7('0x40')](_0x4acb53['query']['sort']);_0x3d3315[_0x03c7('0x41')]=qs[_0x03c7('0x42')](_['pick'](_0x4acb53[_0x03c7('0x37')],_0x52eef1[_0x03c7('0x42')]),_0x4f20ae);if(_0x4acb53[_0x03c7('0x37')][_0x03c7('0x43')]){_0x3d3315['where']=_[_0x03c7('0x44')](_0x3d3315[_0x03c7('0x41')],{'$or':_[_0x03c7('0x30')](_0x4f20ae,function(_0x55a4e6){if(_0x55a4e6['type']!==_0x03c7('0x45')){var _0x370185={};_0x370185[_0x55a4e6[_0x03c7('0x2d')]]={'$like':'%'+_0x4acb53[_0x03c7('0x37')]['filter']+'%'};return _0x370185;}})});}_0x3d3315=_[_0x03c7('0x44')]({},_0x3d3315,_0x4acb53['options']);var _0x5b5527={'where':_0x3d3315[_0x03c7('0x41')]};return db[_0x03c7('0x31')][_0x03c7('0x25')](_0x5b5527)[_0x03c7('0x29')](function(_0x5b9983){_0x20f005[_0x03c7('0x25')]=_0x5b9983;if(_0x4acb53[_0x03c7('0x37')][_0x03c7('0x46')]){_0x3d3315['include']=[{'all':!![]}];}return db[_0x03c7('0x31')]['findAll'](_0x3d3315);})[_0x03c7('0x29')](function(_0x30f162){_0x20f005[_0x03c7('0x47')]=_0x30f162;return _0x20f005;})[_0x03c7('0x29')](respondWithFilteredResult(_0x367f7f,_0x3d3315))[_0x03c7('0x48')](handleError(_0x367f7f,null));};exports[_0x03c7('0x49')]=function(_0x239e53,_0x4f5440){var _0x324d25={'raw':![],'where':{'id':_0x239e53[_0x03c7('0x4a')]['id']}},_0x1c6d95={};_0x1c6d95[_0x03c7('0x36')]=_[_0x03c7('0x38')](db[_0x03c7('0x31')][_0x03c7('0x32')]);_0x1c6d95[_0x03c7('0x37')]=_[_0x03c7('0x38')](_0x239e53['query']);_0x1c6d95[_0x03c7('0x42')]=_[_0x03c7('0x39')](_0x1c6d95[_0x03c7('0x36')],_0x1c6d95[_0x03c7('0x37')]);_0x324d25['attributes']=_[_0x03c7('0x39')](_0x1c6d95['model'],qs[_0x03c7('0x3b')](_0x239e53[_0x03c7('0x37')][_0x03c7('0x3b')]));_0x324d25[_0x03c7('0x3a')]=_0x324d25[_0x03c7('0x3a')]['length']?_0x324d25[_0x03c7('0x3a')]:_0x1c6d95[_0x03c7('0x36')];if(_0x239e53[_0x03c7('0x37')][_0x03c7('0x46')]){_0x324d25[_0x03c7('0x4b')]=[{'all':!![]}];}_0x324d25=_[_0x03c7('0x44')]({},_0x324d25,_0x239e53['options']);return db[_0x03c7('0x31')][_0x03c7('0x4c')](_0x324d25)['then'](handleEntityNotFound(_0x4f5440,null))[_0x03c7('0x29')](respondWithResult(_0x4f5440,null))['catch'](handleError(_0x4f5440,null));};exports[_0x03c7('0x4d')]=function(_0xd033ec,_0x4bdc17){return db[_0x03c7('0x31')]['create'](_0xd033ec[_0x03c7('0x4e')],{})['then'](function(_0x4f382d){var _0x3bc3c5=_0xd033ec['user']['get']({'plain':!![]});if(!_0x3bc3c5)throw new Error(_0x03c7('0x4f'));if(_0x3bc3c5['role']===_0x03c7('0x50')){var _0x4363c5=_0x4f382d['get']({'plain':!![]});var _0x40f5fd=_0x03c7('0x51');return db[_0x03c7('0x52')]['find']({'where':{'name':_0x40f5fd,'userProfileId':_0x3bc3c5['userProfileId']},'raw':!![]})['then'](function(_0x354c7a){if(_0x354c7a&&_0x354c7a['autoAssociation']===0x0){return db[_0x03c7('0x53')][_0x03c7('0x4d')]({'name':_0x4363c5[_0x03c7('0x2d')],'resourceId':_0x4363c5['id'],'type':_0x354c7a[_0x03c7('0x2d')],'sectionId':_0x354c7a['id']},{})[_0x03c7('0x29')](function(){return _0x4f382d;});}else{return _0x4f382d;}})['catch'](function(_0x1f231e){logger['error'](_0x03c7('0x54'),_0x1f231e);throw _0x1f231e;});}return _0x4f382d;})[_0x03c7('0x29')](respondWithResult(_0x4bdc17,0xc9))[_0x03c7('0x48')](handleError(_0x4bdc17,null));};exports[_0x03c7('0x55')]=function(_0x56e790,_0xc8b8e5){var _0x1cc842={'where':{'id':_0x56e790[_0x03c7('0x4a')]['id']}},_0x5d7189={};_0x5d7189[_0x03c7('0x36')]=_[_0x03c7('0x38')](db['Dashboard'][_0x03c7('0x32')]);_0x1cc842['attributes']=_[_0x03c7('0x39')](_0x5d7189[_0x03c7('0x36')],qs[_0x03c7('0x3b')](_0x56e790['query'][_0x03c7('0x3b')]));_0x1cc842[_0x03c7('0x3a')]=_0x1cc842['attributes'][_0x03c7('0x3c')]?_0x1cc842[_0x03c7('0x3a')]:_0x5d7189[_0x03c7('0x36')];if(_0x56e790['query'][_0x03c7('0x46')]){_0x1cc842['include']=[{'all':!![]}];}_0x1cc842=_[_0x03c7('0x44')]({},_0x1cc842,_0x56e790[_0x03c7('0x56')]);return db[_0x03c7('0x31')][_0x03c7('0x4c')](_0x1cc842)[_0x03c7('0x29')](handleEntityNotFound(_0xc8b8e5,null))[_0x03c7('0x29')](function(_0x13dee3){if(_0x13dee3){var _0x2f0e01=_0x13dee3[_0x03c7('0x2a')]({'plain':!![]});_0x2f0e01=qs[_0x03c7('0x57')](_0x2f0e01,['id',_0x03c7('0x58'),_0x03c7('0x59')]);_0x56e790[_0x03c7('0x4e')]=_[_0x03c7('0x57')](_0x56e790[_0x03c7('0x4e')],['id',_0x03c7('0x58'),_0x03c7('0x59')]);return db['Dashboard'][_0x03c7('0x4d')](_[_0x03c7('0x44')](_0x2f0e01,_0x56e790[_0x03c7('0x4e')]),{'include':_0x56e790[_0x03c7('0x37')][_0x03c7('0x46')]?[{'all':!![]}]:undefined})[_0x03c7('0x29')](function(_0x2a8e45){var _0x4e699c=_0x56e790['user'][_0x03c7('0x2a')]({'plain':!![]});if(!_0x4e699c)throw new Error(_0x03c7('0x4f'));if(_0x4e699c[_0x03c7('0x5a')]===_0x03c7('0x50')){var _0x1a4a99=_0x2a8e45[_0x03c7('0x2a')]({'plain':!![]});var _0x34e500=_0x03c7('0x51');return db[_0x03c7('0x52')]['find']({'where':{'name':_0x34e500,'userProfileId':_0x4e699c['userProfileId']},'raw':!![]})[_0x03c7('0x29')](function(_0x57d5ae){if(_0x57d5ae&&_0x57d5ae[_0x03c7('0x5b')]===0x0){return db['UserProfileResource'][_0x03c7('0x4d')]({'name':_0x1a4a99[_0x03c7('0x2d')],'resourceId':_0x1a4a99['id'],'type':_0x57d5ae[_0x03c7('0x2d')],'sectionId':_0x57d5ae['id']},{})[_0x03c7('0x29')](function(){return _0x2a8e45;});}else{return _0x2a8e45;}})[_0x03c7('0x48')](function(_0x4eae10){logger[_0x03c7('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4eae10);throw _0x4eae10;});}return _0x2a8e45;});}})[_0x03c7('0x29')](respondWithResult(_0xc8b8e5,0xc9))[_0x03c7('0x48')](handleError(_0xc8b8e5,null));};exports[_0x03c7('0x28')]=function(_0x14dc94,_0x33c98d){if(_0x14dc94[_0x03c7('0x4e')]['id']){delete _0x14dc94[_0x03c7('0x4e')]['id'];}return db[_0x03c7('0x31')]['find']({'where':{'id':_0x14dc94[_0x03c7('0x4a')]['id']}})[_0x03c7('0x29')](handleEntityNotFound(_0x33c98d,null))[_0x03c7('0x29')](saveUpdates(_0x14dc94[_0x03c7('0x4e')],null))[_0x03c7('0x29')](respondWithResult(_0x33c98d,null))[_0x03c7('0x48')](handleError(_0x33c98d,null));};exports[_0x03c7('0x2b')]=function(_0xc5eb5e,_0x1c3539){return db[_0x03c7('0x31')][_0x03c7('0x4c')]({'where':{'id':_0xc5eb5e[_0x03c7('0x4a')]['id']}})[_0x03c7('0x29')](handleEntityNotFound(_0x1c3539,null))[_0x03c7('0x29')](removeEntity(_0x1c3539,null))[_0x03c7('0x48')](handleError(_0x1c3539,null));};function widgetAttributes(_0x55e887){try{switch(_0x55e887[_0x03c7('0x34')]){case _0x03c7('0x5d'):return[{'name':_0x03c7('0x5e'),'value':_0x55e887[_0x03c7('0x5e')]||(_0x55e887['attrs']&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0][_0x03c7('0x60')]:undefined)||'https://'}];case'custom':return[{'name':_0x03c7('0x61'),'value':_0x55e887[_0x03c7('0x61')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0][_0x03c7('0x60')]:undefined)||''}];case _0x03c7('0x62'):return[{'name':_0x03c7('0x63'),'value':_0x55e887[_0x03c7('0x63')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0][_0x03c7('0x60')]:undefined)||_0x03c7('0x64')},{'name':'attrTimezone','value':_0x55e887[_0x03c7('0x65')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x1]?_0x55e887[_0x03c7('0x5f')][0x1][_0x03c7('0x60')]:undefined)||_0x03c7('0x66')},{'name':_0x03c7('0x67'),'value':_0x55e887[_0x03c7('0x67')]||(_0x55e887['attrs']&&_0x55e887[_0x03c7('0x5f')][0x2]?_0x55e887[_0x03c7('0x5f')][0x2][_0x03c7('0x60')]:undefined)||0xc}];case _0x03c7('0x68'):return[{'name':_0x03c7('0x69'),'value':_0x55e887['attrMetric']||(_0x55e887['attrs']&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0][_0x03c7('0x60')]:undefined)||_0x03c7('0x6a')},{'name':_0x03c7('0x6b'),'value':_0x55e887['attrVoiceQueues']||(_0x55e887['attrs']&&_0x55e887[_0x03c7('0x5f')][0x1]?_0x55e887[_0x03c7('0x5f')][0x1][_0x03c7('0x60')]:undefined)||[]},{'name':_0x03c7('0x67'),'value':_0x55e887[_0x03c7('0x67')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x2]?_0x55e887[_0x03c7('0x5f')][0x2][_0x03c7('0x60')]:undefined)||0x14}];case'multibar-chart':case _0x03c7('0x6c'):return[{'name':_0x03c7('0x6d'),'value':_0x55e887[_0x03c7('0x6d')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0][_0x03c7('0x60')]:undefined)||_0x03c7('0x6a')},{'name':'attrSerie2','value':_0x55e887[_0x03c7('0x6e')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887['attrs'][0x1]?_0x55e887[_0x03c7('0x5f')][0x1]['value']:undefined)||null},{'name':_0x03c7('0x6f'),'value':_0x55e887['attrSerie3']||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x2]?_0x55e887[_0x03c7('0x5f')][0x2][_0x03c7('0x60')]:undefined)||null},{'name':_0x03c7('0x6b'),'value':_0x55e887[_0x03c7('0x6b')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x3]?_0x55e887['attrs'][0x3][_0x03c7('0x60')]:undefined)||[]}];case _0x03c7('0x70'):return[{'name':'attrReport','type':_0x55e887[_0x03c7('0x71')]||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0]['type']:undefined)||null,'value':_0x55e887['attrReport']||(_0x55e887[_0x03c7('0x5f')]&&_0x55e887[_0x03c7('0x5f')][0x0]?_0x55e887[_0x03c7('0x5f')][0x0][_0x03c7('0x60')]:undefined)||null},{'name':_0x03c7('0x72'),'value':_0x55e887[_0x03c7('0x72')]||(_0x55e887['attrs']&&_0x55e887[_0x03c7('0x5f')][0x1]?_0x55e887[_0x03c7('0x5f')][0x1][_0x03c7('0x60')]:undefined)||0x0}];default:return[];}}catch(_0xf1f616){logger[_0x03c7('0x5c')](_0x03c7('0x73'),JSON[_0x03c7('0x74')](_0xf1f616));return[];}}exports['addItem']=function(_0x2df614,_0x542632,_0x3d5877){if(_0x2df614[_0x03c7('0x4e')]['id']){delete _0x2df614[_0x03c7('0x4e')]['id'];}return db[_0x03c7('0x31')][_0x03c7('0x4c')]({'where':{'id':_0x2df614['params']['id']}})[_0x03c7('0x29')](handleEntityNotFound(_0x542632,null))[_0x03c7('0x29')](function(_0x10ea5d){if(_0x10ea5d){_0x2df614[_0x03c7('0x4e')][_0x03c7('0x75')]=_0x10ea5d['id'];_0x2df614[_0x03c7('0x4e')][_0x03c7('0x5f')]=widgetAttributes(_0x2df614[_0x03c7('0x4e')]);return db[_0x03c7('0x76')][_0x03c7('0x4d')](_0x2df614[_0x03c7('0x4e')]);}})[_0x03c7('0x29')](respondWithResult(_0x542632,null))['catch'](handleError(_0x542632,null));};exports[_0x03c7('0x77')]=function(_0x57b7f7,_0x361e36,_0x1354ec){var _0x2beff1={};var _0x108b02={};var _0x2a09f2;var _0x32bd25;return db[_0x03c7('0x31')][_0x03c7('0x78')]({'where':{'id':_0x57b7f7[_0x03c7('0x4a')]['id']}})[_0x03c7('0x29')](handleEntityNotFound(_0x361e36,null))[_0x03c7('0x29')](function(_0x35fc38){if(_0x35fc38){_0x2a09f2=_0x35fc38;_0x108b02[_0x03c7('0x36')]=_[_0x03c7('0x38')](db[_0x03c7('0x76')][_0x03c7('0x32')]);_0x108b02[_0x03c7('0x37')]=_[_0x03c7('0x38')](_0x57b7f7[_0x03c7('0x37')]);_0x108b02[_0x03c7('0x42')]=_['intersection'](_0x108b02[_0x03c7('0x36')],_0x108b02[_0x03c7('0x37')]);_0x2beff1[_0x03c7('0x3a')]=_[_0x03c7('0x39')](_0x108b02[_0x03c7('0x36')],qs['fields'](_0x57b7f7[_0x03c7('0x37')][_0x03c7('0x3b')]));_0x2beff1[_0x03c7('0x3a')]=_0x2beff1[_0x03c7('0x3a')][_0x03c7('0x3c')]?_0x2beff1[_0x03c7('0x3a')]:_0x108b02[_0x03c7('0x36')];_0x2beff1[_0x03c7('0x79')]=qs[_0x03c7('0x40')](_0x57b7f7[_0x03c7('0x37')][_0x03c7('0x40')]);_0x2beff1[_0x03c7('0x41')]=qs[_0x03c7('0x42')](_[_0x03c7('0x7a')](_0x57b7f7[_0x03c7('0x37')],_0x108b02['filters']));if(_0x57b7f7[_0x03c7('0x37')]['filter']){_0x2beff1[_0x03c7('0x41')]=_[_0x03c7('0x44')](_0x2beff1[_0x03c7('0x41')],{'$or':_['map'](_0x2beff1['attributes'],function(_0xef2e03){var _0x1c2c5a={};_0x1c2c5a[_0xef2e03]={'$like':'%'+_0x57b7f7[_0x03c7('0x37')][_0x03c7('0x43')]+'%'};return _0x1c2c5a;})});}_0x2beff1=_[_0x03c7('0x44')]({},_0x2beff1,_0x57b7f7[_0x03c7('0x56')]);return _0x2a09f2[_0x03c7('0x77')](_0x2beff1);}})[_0x03c7('0x29')](function(_0x155cbf){if(_0x155cbf){_0x32bd25=_0x155cbf[_0x03c7('0x3c')];if(!_0x57b7f7[_0x03c7('0x37')][_0x03c7('0x3d')](_0x03c7('0x3e'))){_0x2beff1[_0x03c7('0x3f')]=qs['limit'](_0x57b7f7[_0x03c7('0x37')][_0x03c7('0x3f')]);_0x2beff1['offset']=qs['offset'](_0x57b7f7[_0x03c7('0x37')][_0x03c7('0x23')]);}return _0x2a09f2[_0x03c7('0x77')](_0x2beff1);}})[_0x03c7('0x29')](function(_0x3d2471){if(_0x3d2471){return _0x3d2471?{'count':_0x32bd25,'rows':_0x3d2471}:null;}})[_0x03c7('0x29')](respondWithResult(_0x361e36,null))[_0x03c7('0x48')](handleError(_0x361e36,null));}; \ No newline at end of file +var _0x113c=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','end','json','undefined','limit','count','offset','status','set','Content-Range','save','update','then','destroy','get','CustomDashboards','UserProfileResource','stack','name','send','Dashboard','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','createdAt','user','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0xe02ad0,_0x52353b){var _0x54e767=function(_0x4bf8b0){while(--_0x4bf8b0){_0xe02ad0['push'](_0xe02ad0['shift']());}};_0x54e767(++_0x52353b);}(_0x113c,0xe0));var _0xc113=function(_0x423106,_0x4c07e0){_0x423106=_0x423106-0x0;var _0x1611ae=_0x113c[_0x423106];return _0x1611ae;};'use strict';var emlformat=require(_0xc113('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc113('0x1'));var rp=require(_0xc113('0x2'));var moment=require(_0xc113('0x3'));var BPromise=require(_0xc113('0x4'));var Mustache=require(_0xc113('0x5'));var util=require('util');var path=require(_0xc113('0x6'));var sox=require(_0xc113('0x7'));var csv=require(_0xc113('0x8'));var ejs=require(_0xc113('0x9'));var fs=require('fs');var fs_extra=require(_0xc113('0xa'));var _=require('lodash');var squel=require(_0xc113('0xb'));var crypto=require(_0xc113('0xc'));var jsforce=require(_0xc113('0xd'));var deskjs=require(_0xc113('0xe'));var toCsv=require(_0xc113('0x8'));var querystring=require('querystring');var Papa=require(_0xc113('0xf'));var Redis=require(_0xc113('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc113('0x11'));var as=require(_0xc113('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc113('0x13'));var utils=require(_0xc113('0x14'));var config=require(_0xc113('0x15'));var licenseUtil=require(_0xc113('0x16'));var db=require(_0xc113('0x17'))['db'];config[_0xc113('0x18')]=_['defaults'](config[_0xc113('0x18')],{'host':_0xc113('0x19'),'port':0x18eb});var socket=require(_0xc113('0x1a'))(new Redis(config[_0xc113('0x18')]));require(_0xc113('0x1b'))['register'](socket);function respondWithStatusCode(_0x1a8e78,_0x4381c1){_0x4381c1=_0x4381c1||0xcc;return function(_0x9bd264){if(_0x9bd264){return _0x1a8e78['sendStatus'](_0x4381c1);}return _0x1a8e78['status'](_0x4381c1)[_0xc113('0x1c')]();};}function respondWithResult(_0x3ba77c,_0x4d5c52){_0x4d5c52=_0x4d5c52||0xc8;return function(_0x5ed159){if(_0x5ed159){return _0x3ba77c['status'](_0x4d5c52)[_0xc113('0x1d')](_0x5ed159);}};}function respondWithFilteredResult(_0x231ffd,_0x17c626){return function(_0x55f020){if(_0x55f020){var _0x4da0b0=typeof _0x17c626['offset']===_0xc113('0x1e')&&typeof _0x17c626[_0xc113('0x1f')]===_0xc113('0x1e');var _0x1d820a=_0x55f020[_0xc113('0x20')];var _0x1b5e83=_0x4da0b0?0x0:_0x17c626[_0xc113('0x21')];var _0x8e85af=_0x4da0b0?_0x55f020['count']:_0x17c626[_0xc113('0x21')]+_0x17c626[_0xc113('0x1f')];var _0x4d352b;if(_0x8e85af>=_0x1d820a){_0x8e85af=_0x1d820a;_0x4d352b=0xc8;}else{_0x4d352b=0xce;}_0x231ffd[_0xc113('0x22')](_0x4d352b);return _0x231ffd[_0xc113('0x23')](_0xc113('0x24'),_0x1b5e83+'-'+_0x8e85af+'/'+_0x1d820a)[_0xc113('0x1d')](_0x55f020);}return null;};}function patchUpdates(_0x3d92ef){return function(_0x3314a){try{jsonpatch['apply'](_0x3314a,_0x3d92ef,!![]);}catch(_0x193a56){return BPromise['reject'](_0x193a56);}return _0x3314a[_0xc113('0x25')]();};}function saveUpdates(_0x1189ac,_0x4aa4dc){return function(_0x20fd36){if(_0x20fd36){return _0x20fd36[_0xc113('0x26')](_0x1189ac)[_0xc113('0x27')](function(_0x49a844){return _0x49a844;});}return null;};}function removeEntity(_0xcf2876,_0x4fc17a){return function(_0x39654c){if(_0x39654c){return _0x39654c[_0xc113('0x28')]()[_0xc113('0x27')](function(){var _0x25b332=_0x39654c[_0xc113('0x29')]({'plain':!![]});var _0x2aa070=_0xc113('0x2a');return db[_0xc113('0x2b')][_0xc113('0x28')]({'where':{'type':_0x2aa070,'resourceId':_0x25b332['id']}})[_0xc113('0x27')](function(){return _0x39654c;});})[_0xc113('0x27')](function(){_0xcf2876[_0xc113('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4362c6,_0x3cfbf5){return function(_0x4e2719){if(!_0x4e2719){_0x4362c6['sendStatus'](0x194);}return _0x4e2719;};}function handleError(_0x2ab8eb,_0x30953f){_0x30953f=_0x30953f||0x1f4;return function(_0x2e9084){logger['error'](_0x2e9084[_0xc113('0x2c')]);if(_0x2e9084[_0xc113('0x2d')]){delete _0x2e9084[_0xc113('0x2d')];}_0x2ab8eb[_0xc113('0x22')](_0x30953f)[_0xc113('0x2e')](_0x2e9084);};}exports['index']=function(_0x7d1a46,_0x5c7693){var _0x239bc1={},_0x3034d2={},_0x96cccb={'count':0x0,'rows':[]};var _0x198462=_['map'](db[_0xc113('0x2f')][_0xc113('0x30')],function(_0x3f26bf){return{'name':_0x3f26bf[_0xc113('0x31')],'type':_0x3f26bf[_0xc113('0x32')][_0xc113('0x33')]};});_0x3034d2[_0xc113('0x34')]=_[_0xc113('0x35')](_0x198462,_0xc113('0x2d'));_0x3034d2[_0xc113('0x36')]=_['keys'](_0x7d1a46[_0xc113('0x36')]);_0x3034d2[_0xc113('0x37')]=_[_0xc113('0x38')](_0x3034d2[_0xc113('0x34')],_0x3034d2[_0xc113('0x36')]);_0x239bc1[_0xc113('0x39')]=_['intersection'](_0x3034d2[_0xc113('0x34')],qs[_0xc113('0x3a')](_0x7d1a46[_0xc113('0x36')][_0xc113('0x3a')]));_0x239bc1['attributes']=_0x239bc1[_0xc113('0x39')][_0xc113('0x3b')]?_0x239bc1[_0xc113('0x39')]:_0x3034d2['model'];if(!_0x7d1a46[_0xc113('0x36')][_0xc113('0x3c')]('nolimit')){_0x239bc1['limit']=qs['limit'](_0x7d1a46[_0xc113('0x36')][_0xc113('0x1f')]);_0x239bc1[_0xc113('0x21')]=qs[_0xc113('0x21')](_0x7d1a46['query']['offset']);}_0x239bc1[_0xc113('0x3d')]=qs[_0xc113('0x3e')](_0x7d1a46[_0xc113('0x36')][_0xc113('0x3e')]);_0x239bc1['where']=qs[_0xc113('0x37')](_[_0xc113('0x3f')](_0x7d1a46[_0xc113('0x36')],_0x3034d2['filters']),_0x198462);if(_0x7d1a46[_0xc113('0x36')][_0xc113('0x40')]){_0x239bc1[_0xc113('0x41')]=_['merge'](_0x239bc1[_0xc113('0x41')],{'$or':_['map'](_0x198462,function(_0x7e0033){if(_0x7e0033['type']!=='VIRTUAL'){var _0x16b76e={};_0x16b76e[_0x7e0033[_0xc113('0x2d')]]={'$like':'%'+_0x7d1a46[_0xc113('0x36')][_0xc113('0x40')]+'%'};return _0x16b76e;}})});}_0x239bc1=_[_0xc113('0x42')]({},_0x239bc1,_0x7d1a46[_0xc113('0x43')]);var _0x45cc63={'where':_0x239bc1[_0xc113('0x41')]};return db[_0xc113('0x2f')]['count'](_0x45cc63)[_0xc113('0x27')](function(_0x24b93c){_0x96cccb[_0xc113('0x20')]=_0x24b93c;if(_0x7d1a46[_0xc113('0x36')][_0xc113('0x44')]){_0x239bc1[_0xc113('0x45')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x239bc1);})[_0xc113('0x27')](function(_0x3a6c8a){_0x96cccb[_0xc113('0x46')]=_0x3a6c8a;return _0x96cccb;})['then'](respondWithFilteredResult(_0x5c7693,_0x239bc1))[_0xc113('0x47')](handleError(_0x5c7693,null));};exports[_0xc113('0x48')]=function(_0x2bdb15,_0x1ceff3){var _0x60f966={'raw':![],'where':{'id':_0x2bdb15[_0xc113('0x49')]['id']}},_0x1396ed={};_0x1396ed[_0xc113('0x34')]=_[_0xc113('0x4a')](db[_0xc113('0x2f')][_0xc113('0x30')]);_0x1396ed['query']=_[_0xc113('0x4a')](_0x2bdb15[_0xc113('0x36')]);_0x1396ed[_0xc113('0x37')]=_['intersection'](_0x1396ed[_0xc113('0x34')],_0x1396ed['query']);_0x60f966[_0xc113('0x39')]=_[_0xc113('0x38')](_0x1396ed[_0xc113('0x34')],qs[_0xc113('0x3a')](_0x2bdb15['query'][_0xc113('0x3a')]));_0x60f966[_0xc113('0x39')]=_0x60f966['attributes'][_0xc113('0x3b')]?_0x60f966[_0xc113('0x39')]:_0x1396ed[_0xc113('0x34')];if(_0x2bdb15[_0xc113('0x36')][_0xc113('0x44')]){_0x60f966[_0xc113('0x45')]=[{'all':!![]}];}_0x60f966=_[_0xc113('0x42')]({},_0x60f966,_0x2bdb15[_0xc113('0x43')]);return db['Dashboard'][_0xc113('0x4b')](_0x60f966)[_0xc113('0x27')](handleEntityNotFound(_0x1ceff3,null))['then'](respondWithResult(_0x1ceff3,null))[_0xc113('0x47')](handleError(_0x1ceff3,null));};exports[_0xc113('0x4c')]=function(_0x491016,_0x7e8d8){return db['Dashboard'][_0xc113('0x4c')](_0x491016[_0xc113('0x4d')],{})[_0xc113('0x27')](function(_0x129666){var _0xd02e75=_0x491016['user'][_0xc113('0x29')]({'plain':!![]});if(!_0xd02e75)throw new Error(_0xc113('0x4e'));if(_0xd02e75[_0xc113('0x4f')]==='user'){var _0x557c8c=_0x129666[_0xc113('0x29')]({'plain':!![]});var _0xe97153=_0xc113('0x2a');return db[_0xc113('0x50')][_0xc113('0x4b')]({'where':{'name':_0xe97153,'userProfileId':_0xd02e75[_0xc113('0x51')]},'raw':!![]})[_0xc113('0x27')](function(_0x232c0d){if(_0x232c0d&&_0x232c0d[_0xc113('0x52')]===0x0){return db[_0xc113('0x2b')][_0xc113('0x4c')]({'name':_0x557c8c[_0xc113('0x2d')],'resourceId':_0x557c8c['id'],'type':_0x232c0d['name'],'sectionId':_0x232c0d['id']},{})[_0xc113('0x27')](function(){return _0x129666;});}else{return _0x129666;}})[_0xc113('0x47')](function(_0x596973){logger[_0xc113('0x53')](_0xc113('0x54'),_0x596973);throw _0x596973;});}return _0x129666;})[_0xc113('0x27')](respondWithResult(_0x7e8d8,0xc9))[_0xc113('0x47')](handleError(_0x7e8d8,null));};exports[_0xc113('0x55')]=function(_0x7c0ccc,_0x419c8a){var _0x4b6e68={'where':{'id':_0x7c0ccc[_0xc113('0x49')]['id']}},_0x5cc997={};_0x5cc997[_0xc113('0x34')]=_[_0xc113('0x4a')](db[_0xc113('0x2f')][_0xc113('0x30')]);_0x4b6e68[_0xc113('0x39')]=_[_0xc113('0x38')](_0x5cc997[_0xc113('0x34')],qs[_0xc113('0x3a')](_0x7c0ccc[_0xc113('0x36')][_0xc113('0x3a')]));_0x4b6e68[_0xc113('0x39')]=_0x4b6e68[_0xc113('0x39')][_0xc113('0x3b')]?_0x4b6e68[_0xc113('0x39')]:_0x5cc997['model'];if(_0x7c0ccc[_0xc113('0x36')][_0xc113('0x44')]){_0x4b6e68[_0xc113('0x45')]=[{'all':!![]}];}_0x4b6e68=_[_0xc113('0x42')]({},_0x4b6e68,_0x7c0ccc[_0xc113('0x43')]);return db[_0xc113('0x2f')]['find'](_0x4b6e68)[_0xc113('0x27')](handleEntityNotFound(_0x419c8a,null))[_0xc113('0x27')](function(_0x4d8a83){if(_0x4d8a83){var _0x12943a=_0x4d8a83[_0xc113('0x29')]({'plain':!![]});_0x12943a=qs['omit'](_0x12943a,['id','createdAt',_0xc113('0x56')]);_0x7c0ccc[_0xc113('0x4d')]=_['omit'](_0x7c0ccc[_0xc113('0x4d')],['id',_0xc113('0x57'),_0xc113('0x56')]);return db['Dashboard'][_0xc113('0x4c')](_[_0xc113('0x42')](_0x12943a,_0x7c0ccc[_0xc113('0x4d')]),{'include':_0x7c0ccc[_0xc113('0x36')][_0xc113('0x44')]?[{'all':!![]}]:undefined})[_0xc113('0x27')](function(_0x587c59){var _0x5e7c2a=_0x7c0ccc[_0xc113('0x58')]['get']({'plain':!![]});if(!_0x5e7c2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e7c2a[_0xc113('0x4f')]==='user'){var _0x206924=_0x587c59[_0xc113('0x29')]({'plain':!![]});var _0x3d0a3c=_0xc113('0x2a');return db[_0xc113('0x50')][_0xc113('0x4b')]({'where':{'name':_0x3d0a3c,'userProfileId':_0x5e7c2a[_0xc113('0x51')]},'raw':!![]})[_0xc113('0x27')](function(_0x438ad7){if(_0x438ad7&&_0x438ad7['autoAssociation']===0x0){return db[_0xc113('0x2b')][_0xc113('0x4c')]({'name':_0x206924[_0xc113('0x2d')],'resourceId':_0x206924['id'],'type':_0x438ad7[_0xc113('0x2d')],'sectionId':_0x438ad7['id']},{})[_0xc113('0x27')](function(){return _0x587c59;});}else{return _0x587c59;}})[_0xc113('0x47')](function(_0x17f582){logger[_0xc113('0x53')](_0xc113('0x54'),_0x17f582);throw _0x17f582;});}return _0x587c59;});}})[_0xc113('0x27')](respondWithResult(_0x419c8a,0xc9))[_0xc113('0x47')](handleError(_0x419c8a,null));};exports[_0xc113('0x26')]=function(_0x5dc29d,_0x1a365e){if(_0x5dc29d[_0xc113('0x4d')]['id']){delete _0x5dc29d[_0xc113('0x4d')]['id'];}return db[_0xc113('0x2f')][_0xc113('0x4b')]({'where':{'id':_0x5dc29d[_0xc113('0x49')]['id']}})[_0xc113('0x27')](handleEntityNotFound(_0x1a365e,null))[_0xc113('0x27')](saveUpdates(_0x5dc29d[_0xc113('0x4d')],null))[_0xc113('0x27')](respondWithResult(_0x1a365e,null))[_0xc113('0x47')](handleError(_0x1a365e,null));};exports[_0xc113('0x28')]=function(_0x14ff49,_0x4ac12c){return db[_0xc113('0x2f')][_0xc113('0x4b')]({'where':{'id':_0x14ff49['params']['id']}})[_0xc113('0x27')](handleEntityNotFound(_0x4ac12c,null))[_0xc113('0x27')](removeEntity(_0x4ac12c,null))[_0xc113('0x47')](handleError(_0x4ac12c,null));};function widgetAttributes(_0x32c41a){try{switch(_0x32c41a[_0xc113('0x32')]){case _0xc113('0x59'):return[{'name':'attrUrl','value':_0x32c41a[_0xc113('0x5a')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x0]?_0x32c41a['attrs'][0x0][_0xc113('0x5c')]:undefined)||_0xc113('0x5d')}];case _0xc113('0x5e'):return[{'name':_0xc113('0x5f'),'value':_0x32c41a[_0xc113('0x5f')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x0]?_0x32c41a[_0xc113('0x5b')][0x0][_0xc113('0x5c')]:undefined)||''}];case _0xc113('0x60'):return[{'name':_0xc113('0x61'),'value':_0x32c41a['attrHourFormat']||(_0x32c41a['attrs']&&_0x32c41a['attrs'][0x0]?_0x32c41a[_0xc113('0x5b')][0x0][_0xc113('0x5c')]:undefined)||'HH:mm:ss'},{'name':_0xc113('0x62'),'value':_0x32c41a[_0xc113('0x62')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x1]?_0x32c41a[_0xc113('0x5b')][0x1][_0xc113('0x5c')]:undefined)||_0xc113('0x63')},{'name':_0xc113('0x64'),'value':_0x32c41a[_0xc113('0x64')]||(_0x32c41a['attrs']&&_0x32c41a[_0xc113('0x5b')][0x2]?_0x32c41a[_0xc113('0x5b')][0x2][_0xc113('0x5c')]:undefined)||0xc}];case _0xc113('0x65'):return[{'name':'attrMetric','value':_0x32c41a['attrMetric']||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a['attrs'][0x0]?_0x32c41a[_0xc113('0x5b')][0x0][_0xc113('0x5c')]:undefined)||_0xc113('0x66')},{'name':_0xc113('0x67'),'value':_0x32c41a[_0xc113('0x67')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x1]?_0x32c41a[_0xc113('0x5b')][0x1][_0xc113('0x5c')]:undefined)||[]},{'name':_0xc113('0x64'),'value':_0x32c41a[_0xc113('0x64')]||(_0x32c41a['attrs']&&_0x32c41a[_0xc113('0x5b')][0x2]?_0x32c41a[_0xc113('0x5b')][0x2]['value']:undefined)||0x14}];case _0xc113('0x68'):case _0xc113('0x69'):return[{'name':_0xc113('0x6a'),'value':_0x32c41a[_0xc113('0x6a')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x0]?_0x32c41a[_0xc113('0x5b')][0x0][_0xc113('0x5c')]:undefined)||_0xc113('0x66')},{'name':_0xc113('0x6b'),'value':_0x32c41a[_0xc113('0x6b')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x1]?_0x32c41a[_0xc113('0x5b')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x32c41a['attrSerie3']||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a['attrs'][0x2]?_0x32c41a[_0xc113('0x5b')][0x2][_0xc113('0x5c')]:undefined)||null},{'name':_0xc113('0x67'),'value':_0x32c41a[_0xc113('0x67')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a[_0xc113('0x5b')][0x3]?_0x32c41a[_0xc113('0x5b')][0x3][_0xc113('0x5c')]:undefined)||[]}];case'web-report':return[{'name':_0xc113('0x6c'),'type':_0x32c41a['reportType']||(_0x32c41a['attrs']&&_0x32c41a[_0xc113('0x5b')][0x0]?_0x32c41a[_0xc113('0x5b')][0x0][_0xc113('0x32')]:undefined)||null,'value':_0x32c41a[_0xc113('0x6c')]||(_0x32c41a[_0xc113('0x5b')]&&_0x32c41a['attrs'][0x0]?_0x32c41a[_0xc113('0x5b')][0x0][_0xc113('0x5c')]:undefined)||null},{'name':_0xc113('0x6d'),'value':_0x32c41a['attrRefresh']||(_0x32c41a['attrs']&&_0x32c41a[_0xc113('0x5b')][0x1]?_0x32c41a['attrs'][0x1][_0xc113('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x36a80a){logger['error'](_0xc113('0x6e'),JSON[_0xc113('0x6f')](_0x36a80a));return[];}}exports[_0xc113('0x70')]=function(_0x2231c5,_0x2380d8,_0xd97f37){if(_0x2231c5[_0xc113('0x4d')]['id']){delete _0x2231c5[_0xc113('0x4d')]['id'];}return db[_0xc113('0x2f')]['find']({'where':{'id':_0x2231c5[_0xc113('0x49')]['id']}})[_0xc113('0x27')](handleEntityNotFound(_0x2380d8,null))['then'](function(_0x4d9ca3){if(_0x4d9ca3){_0x2231c5[_0xc113('0x4d')][_0xc113('0x71')]=_0x4d9ca3['id'];_0x2231c5[_0xc113('0x4d')][_0xc113('0x5b')]=widgetAttributes(_0x2231c5[_0xc113('0x4d')]);return db[_0xc113('0x72')][_0xc113('0x4c')](_0x2231c5[_0xc113('0x4d')]);}})['then'](respondWithResult(_0x2380d8,null))[_0xc113('0x47')](handleError(_0x2380d8,null));};exports[_0xc113('0x73')]=function(_0x354b76,_0x51325c,_0x43b439){var _0x579482={};var _0x38165e={};var _0xf7f8ce;var _0x22053f;return db[_0xc113('0x2f')][_0xc113('0x74')]({'where':{'id':_0x354b76[_0xc113('0x49')]['id']}})['then'](handleEntityNotFound(_0x51325c,null))[_0xc113('0x27')](function(_0x209ec8){if(_0x209ec8){_0xf7f8ce=_0x209ec8;_0x38165e[_0xc113('0x34')]=_[_0xc113('0x4a')](db[_0xc113('0x72')][_0xc113('0x30')]);_0x38165e[_0xc113('0x36')]=_['keys'](_0x354b76[_0xc113('0x36')]);_0x38165e[_0xc113('0x37')]=_['intersection'](_0x38165e['model'],_0x38165e[_0xc113('0x36')]);_0x579482[_0xc113('0x39')]=_[_0xc113('0x38')](_0x38165e['model'],qs[_0xc113('0x3a')](_0x354b76['query'][_0xc113('0x3a')]));_0x579482[_0xc113('0x39')]=_0x579482[_0xc113('0x39')][_0xc113('0x3b')]?_0x579482['attributes']:_0x38165e['model'];_0x579482['order']=qs['sort'](_0x354b76[_0xc113('0x36')][_0xc113('0x3e')]);_0x579482[_0xc113('0x41')]=qs[_0xc113('0x37')](_[_0xc113('0x3f')](_0x354b76[_0xc113('0x36')],_0x38165e['filters']));if(_0x354b76[_0xc113('0x36')][_0xc113('0x40')]){_0x579482['where']=_[_0xc113('0x42')](_0x579482[_0xc113('0x41')],{'$or':_['map'](_0x579482[_0xc113('0x39')],function(_0x5c744e){var _0x2ad90a={};_0x2ad90a[_0x5c744e]={'$like':'%'+_0x354b76['query'][_0xc113('0x40')]+'%'};return _0x2ad90a;})});}_0x579482=_['merge']({},_0x579482,_0x354b76['options']);return _0xf7f8ce[_0xc113('0x73')](_0x579482);}})[_0xc113('0x27')](function(_0x12cd8a){if(_0x12cd8a){_0x22053f=_0x12cd8a[_0xc113('0x3b')];if(!_0x354b76[_0xc113('0x36')][_0xc113('0x3c')](_0xc113('0x75'))){_0x579482['limit']=qs[_0xc113('0x1f')](_0x354b76['query']['limit']);_0x579482[_0xc113('0x21')]=qs[_0xc113('0x21')](_0x354b76[_0xc113('0x36')]['offset']);}return _0xf7f8ce[_0xc113('0x73')](_0x579482);}})[_0xc113('0x27')](function(_0xd3f48){if(_0xd3f48){return _0xd3f48?{'count':_0x22053f,'rows':_0xd3f48}:null;}})[_0xc113('0x27')](respondWithResult(_0x51325c,null))[_0xc113('0x47')](handleError(_0x51325c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 5693ff0..1ec6750 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 _0x855e=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x37cfbc,_0x3cc6c7){var _0x5856b9=function(_0x447f92){while(--_0x447f92){_0x37cfbc['push'](_0x37cfbc['shift']());}};_0x5856b9(++_0x3cc6c7);}(_0x855e,0x1f2));var _0xe855=function(_0x26197e,_0x4d7e8e){_0x26197e=_0x26197e-0x0;var _0x3f7afe=_0x855e[_0x26197e];return _0x3f7afe;};'use strict';var EventEmitter=require(_0xe855('0x0'));var Dashboard=require(_0xe855('0x1'))['db'][_0xe855('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe855('0x3')](0x0);var events={'afterCreate':_0xe855('0x4'),'afterUpdate':_0xe855('0x5'),'afterDestroy':_0xe855('0x6')};function emitEvent(_0x48f702){return function(_0x2b99b8,_0xfab6c4,_0x47b09e){DashboardEvents[_0xe855('0x7')](_0x48f702+':'+_0x2b99b8['id'],_0x2b99b8);DashboardEvents[_0xe855('0x7')](_0x48f702,_0x2b99b8);_0x47b09e(null);};}for(var e in events){if(events[_0xe855('0x8')](e)){var event=events[e];Dashboard[_0xe855('0x9')](e,emitEvent(event));}}module[_0xe855('0xa')]=DashboardEvents; \ No newline at end of file +var _0xf981=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf981,0xe6));var _0x1f98=function(_0x413dcc,_0x13c10){_0x413dcc=_0x413dcc-0x0;var _0x4f1970=_0xf981[_0x413dcc];return _0x4f1970;};'use strict';var EventEmitter=require(_0x1f98('0x0'));var Dashboard=require(_0x1f98('0x1'))['db'][_0x1f98('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1f98('0x3')](0x0);var events={'afterCreate':_0x1f98('0x4'),'afterUpdate':_0x1f98('0x5'),'afterDestroy':_0x1f98('0x6')};function emitEvent(_0xd68165){return function(_0x562a81,_0x14da55,_0x15c6fa){DashboardEvents[_0x1f98('0x7')](_0xd68165+':'+_0x562a81['id'],_0x562a81);DashboardEvents[_0x1f98('0x7')](_0xd68165,_0x562a81);_0x15c6fa(null);};}for(var e in events){if(events[_0x1f98('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index f23dc44..a52921c 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 _0xfd3a=['../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x145241,_0x56bf84){var _0x43d7d5=function(_0x35acfa){while(--_0x35acfa){_0x145241['push'](_0x145241['shift']());}};_0x43d7d5(++_0x56bf84);}(_0xfd3a,0x179));var _0xafd3=function(_0x5d6fd5,_0x3e6b00){_0x5d6fd5=_0x5d6fd5-0x0;var _0x441638=_0xfd3a[_0x5d6fd5];return _0x441638;};'use strict';var _=require(_0xafd3('0x0'));var util=require(_0xafd3('0x1'));var logger=require(_0xafd3('0x2'))(_0xafd3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xafd3('0x4'));var fs=require('fs');var path=require(_0xafd3('0x5'));var rimraf=require(_0xafd3('0x6'));var config=require(_0xafd3('0x7'));var attributes=require(_0xafd3('0x8'));module['exports']=function(_0x9db715,_0x1a72eb){return _0x9db715[_0xafd3('0x9')](_0xafd3('0xa'),attributes,{'tableName':_0xafd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafca=['dashboards','util','../../config/logger','moment','request-promise','path','../../config/environment','./dashboard.attributes','Dashboard'];(function(_0x59b305,_0x3fbe96){var _0x510779=function(_0x3ad10a){while(--_0x3ad10a){_0x59b305['push'](_0x59b305['shift']());}};_0x510779(++_0x3fbe96);}(_0xafca,0x106));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xaafc('0x0'));var logger=require(_0xaafc('0x1'))('api');var moment=require(_0xaafc('0x2'));var BPromise=require('bluebird');var rp=require(_0xaafc('0x3'));var fs=require('fs');var path=require(_0xaafc('0x4'));var rimraf=require('rimraf');var config=require(_0xaafc('0x5'));var attributes=require(_0xaafc('0x6'));module['exports']=function(_0x49f372,_0x34a58a){return _0x49f372['define'](_0xaafc('0x7'),attributes,{'tableName':_0xaafc('0x8'),'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 f1e3ece..2662fad 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 _0x2c06=['request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x51bd66,_0x54d827){var _0x355f28=function(_0x83b5d6){while(--_0x83b5d6){_0x51bd66['push'](_0x51bd66['shift']());}};_0x355f28(++_0x54d827);}(_0x2c06,0x1dc));var _0x62c0=function(_0x1f3257,_0x121ee9){_0x1f3257=_0x1f3257-0x0;var _0x16ea4b=_0x2c06[_0x1f3257];return _0x16ea4b;};'use strict';var _=require(_0x62c0('0x0'));var util=require(_0x62c0('0x1'));var moment=require(_0x62c0('0x2'));var BPromise=require(_0x62c0('0x3'));var rs=require(_0x62c0('0x4'));var fs=require('fs');var Redis=require(_0x62c0('0x5'));var db=require(_0x62c0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x62c0('0x7'));var config=require(_0x62c0('0x8'));var jayson=require(_0x62c0('0x9'));var client=jayson[_0x62c0('0xa')]['http']({'port':0x232a});config[_0x62c0('0xb')]=_[_0x62c0('0xc')](config[_0x62c0('0xb')],{'host':_0x62c0('0xd'),'port':0x18eb});var socket=require(_0x62c0('0xe'))(new Redis(config[_0x62c0('0xb')]));require(_0x62c0('0xf'))[_0x62c0('0x10')](socket);function respondWithRpcPromise(_0x5de791,_0x32b4e1,_0x212c70){return new BPromise(function(_0x415581,_0xb3cd1c){return client[_0x62c0('0x11')](_0x5de791,_0x212c70)[_0x62c0('0x12')](function(_0x3ced83){logger[_0x62c0('0x13')]('Dashboard,\x20%s,\x20%s',_0x32b4e1,'request\x20sent');logger[_0x62c0('0x14')](_0x62c0('0x15'),_0x32b4e1,_0x62c0('0x16'),JSON['stringify'](_0x3ced83));if(_0x3ced83[_0x62c0('0x17')]){if(_0x3ced83[_0x62c0('0x17')][_0x62c0('0x18')]===0x1f4){logger['error'](_0x62c0('0x19'),_0x32b4e1,_0x3ced83[_0x62c0('0x17')][_0x62c0('0x1a')]);return _0xb3cd1c(_0x3ced83[_0x62c0('0x17')]['message']);}logger[_0x62c0('0x17')](_0x62c0('0x19'),_0x32b4e1,_0x3ced83[_0x62c0('0x17')]['message']);return _0x415581(_0x3ced83[_0x62c0('0x17')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x32b4e1,_0x62c0('0x16'));_0x415581(_0x3ced83[_0x62c0('0x1b')][_0x62c0('0x1a')]);}})[_0x62c0('0x1c')](function(_0x4cffef){logger['error'](_0x62c0('0x19'),_0x32b4e1,_0x4cffef);_0xb3cd1c(_0x4cffef);});});} \ No newline at end of file +var _0xe9b0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./dashboard.socket','register','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0xb1fb65,_0x96688b){var _0x2172fc=function(_0x5dc7fb){while(--_0x5dc7fb){_0xb1fb65['push'](_0xb1fb65['shift']());}};_0x2172fc(++_0x96688b);}(_0xe9b0,0x141));var _0x0e9b=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0xe9b0[_0x4dc0c8];return _0x26bf81;};'use strict';var _=require(_0x0e9b('0x0'));var util=require(_0x0e9b('0x1'));var moment=require(_0x0e9b('0x2'));var BPromise=require(_0x0e9b('0x3'));var rs=require(_0x0e9b('0x4'));var fs=require('fs');var Redis=require(_0x0e9b('0x5'));var db=require(_0x0e9b('0x6'))['db'];var utils=require(_0x0e9b('0x7'));var logger=require('../../config/logger')(_0x0e9b('0x8'));var config=require(_0x0e9b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0e9b('0xa')][_0x0e9b('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0e9b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e9b('0xd'))(new Redis(config[_0x0e9b('0xc')]));require(_0x0e9b('0xe'))[_0x0e9b('0xf')](socket);function respondWithRpcPromise(_0x5dbaeb,_0xe6de63,_0x110e29){return new BPromise(function(_0x1c8761,_0x1ca1c3){return client['request'](_0x5dbaeb,_0x110e29)[_0x0e9b('0x10')](function(_0x1b064a){logger[_0x0e9b('0x11')]('Dashboard,\x20%s,\x20%s',_0xe6de63,_0x0e9b('0x12'));logger[_0x0e9b('0x13')](_0x0e9b('0x14'),_0xe6de63,_0x0e9b('0x12'),JSON[_0x0e9b('0x15')](_0x1b064a));if(_0x1b064a[_0x0e9b('0x16')]){if(_0x1b064a[_0x0e9b('0x16')][_0x0e9b('0x17')]===0x1f4){logger['error'](_0x0e9b('0x18'),_0xe6de63,_0x1b064a[_0x0e9b('0x16')]['message']);return _0x1ca1c3(_0x1b064a[_0x0e9b('0x16')][_0x0e9b('0x19')]);}logger['error'](_0x0e9b('0x18'),_0xe6de63,_0x1b064a['error'][_0x0e9b('0x19')]);return _0x1c8761(_0x1b064a['error'][_0x0e9b('0x19')]);}else{logger[_0x0e9b('0x11')](_0x0e9b('0x18'),_0xe6de63,_0x0e9b('0x12'));_0x1c8761(_0x1b064a[_0x0e9b('0x1a')]['message']);}})['catch'](function(_0x405160){logger[_0x0e9b('0x16')]('Dashboard,\x20%s,\x20%s',_0xe6de63,_0x405160);_0x1ca1c3(_0x405160);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f42440a..b36641e 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 _0x6bd9=['length','./dashboard.events','update','emit','removeListener','register'];(function(_0x542a9a,_0x3f7d1f){var _0x468acd=function(_0x4d71e3){while(--_0x4d71e3){_0x542a9a['push'](_0x542a9a['shift']());}};_0x468acd(++_0x3f7d1f);}(_0x6bd9,0x73));var _0x96bd=function(_0x4e5684,_0x3c516d){_0x4e5684=_0x4e5684-0x0;var _0x464011=_0x6bd9[_0x4e5684];return _0x464011;};'use strict';var DashboardEvents=require(_0x96bd('0x0'));var events=['save','remove',_0x96bd('0x1')];function createListener(_0x4a778c,_0x1063ab){return function(_0x2b19c3){_0x1063ab[_0x96bd('0x2')](_0x4a778c,_0x2b19c3);};}function removeListener(_0x322dff,_0x5150fb){return function(){DashboardEvents[_0x96bd('0x3')](_0x322dff,_0x5150fb);};}exports[_0x96bd('0x4')]=function(_0x43cb2b){for(var _0x430460=0x0,_0x563d0c=events[_0x96bd('0x5')];_0x430460<_0x563d0c;_0x430460++){var _0x547ed9=events[_0x430460];var _0xe3aa21=createListener('dashboard:'+_0x547ed9,_0x43cb2b);DashboardEvents['on'](_0x547ed9,_0xe3aa21);}}; \ No newline at end of file +var _0x1ecd=['length','dashboard:','./dashboard.events','save','remove','emit','removeListener','register'];(function(_0x4b017e,_0xc9257){var _0x72176f=function(_0x340716){while(--_0x340716){_0x4b017e['push'](_0x4b017e['shift']());}};_0x72176f(++_0xc9257);}(_0x1ecd,0xf2));var _0xd1ec=function(_0x4906ca,_0x7cb8c0){_0x4906ca=_0x4906ca-0x0;var _0x493642=_0x1ecd[_0x4906ca];return _0x493642;};'use strict';var DashboardEvents=require(_0xd1ec('0x0'));var events=[_0xd1ec('0x1'),_0xd1ec('0x2'),'update'];function createListener(_0x100d40,_0x28dc7d){return function(_0x32fb3d){_0x28dc7d[_0xd1ec('0x3')](_0x100d40,_0x32fb3d);};}function removeListener(_0x33994d,_0x32fab0){return function(){DashboardEvents[_0xd1ec('0x4')](_0x33994d,_0x32fab0);};}exports[_0xd1ec('0x5')]=function(_0x103c26){for(var _0x39954c=0x0,_0x2ef094=events[_0xd1ec('0x6')];_0x39954c<_0x2ef094;_0x39954c++){var _0x555808=events[_0x39954c];var _0x4d05be=createListener(_0xd1ec('0x7')+_0x555808,_0x103c26);DashboardEvents['on'](_0x555808,_0x4d05be);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b2514cb..e7ac4a9 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 _0x344c=['index','get','/:id/items','getItems','post','create','/:id/clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','isAuthenticated'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x344c,0x14f));var _0xc344=function(_0xf8b8e0,_0x1690e3){_0xf8b8e0=_0xf8b8e0-0x0;var _0x701abe=_0x344c[_0xf8b8e0];return _0x701abe;};'use strict';var multer=require(_0xc344('0x0'));var util=require(_0xc344('0x1'));var path=require(_0xc344('0x2'));var timeout=require(_0xc344('0x3'));var express=require('express');var router=express[_0xc344('0x4')]();var fs_extra=require(_0xc344('0x5'));var auth=require(_0xc344('0x6'));var interaction=require(_0xc344('0x7'));var config=require('../../config/environment');var controller=require(_0xc344('0x8'));router['get']('/',auth[_0xc344('0x9')](),controller[_0xc344('0xa')]);router[_0xc344('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc344('0xb')](_0xc344('0xc'),auth[_0xc344('0x9')](),controller[_0xc344('0xd')]);router[_0xc344('0xe')]('/',auth[_0xc344('0x9')](),controller[_0xc344('0xf')]);router[_0xc344('0xe')](_0xc344('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xc344('0xe')](_0xc344('0xc'),auth[_0xc344('0x9')](),controller['addItem']);router[_0xc344('0x11')](_0xc344('0x12'),auth[_0xc344('0x9')](),controller[_0xc344('0x13')]);router[_0xc344('0x14')](_0xc344('0x12'),auth[_0xc344('0x9')](),controller[_0xc344('0x15')]);module[_0xc344('0x16')]=router; \ No newline at end of file +var _0x405b=['get','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller'];(function(_0x7c5c0e,_0x38577c){var _0x369522=function(_0x842f10){while(--_0x842f10){_0x7c5c0e['push'](_0x7c5c0e['shift']());}};_0x369522(++_0x38577c);}(_0x405b,0xff));var _0xb405=function(_0x88daf3,_0x134dc5){_0x88daf3=_0x88daf3-0x0;var _0x2daa02=_0x405b[_0x88daf3];return _0x2daa02;};'use strict';var multer=require(_0xb405('0x0'));var util=require(_0xb405('0x1'));var path=require(_0xb405('0x2'));var timeout=require('connect-timeout');var express=require(_0xb405('0x3'));var router=express['Router']();var fs_extra=require(_0xb405('0x4'));var auth=require(_0xb405('0x5'));var interaction=require(_0xb405('0x6'));var config=require(_0xb405('0x7'));var controller=require(_0xb405('0x8'));router[_0xb405('0x9')]('/',auth[_0xb405('0xa')](),controller['index']);router[_0xb405('0x9')]('/:id',auth[_0xb405('0xa')](),controller[_0xb405('0xb')]);router[_0xb405('0x9')](_0xb405('0xc'),auth[_0xb405('0xa')](),controller[_0xb405('0xd')]);router[_0xb405('0xe')]('/',auth[_0xb405('0xa')](),controller[_0xb405('0xf')]);router[_0xb405('0xe')](_0xb405('0x10'),auth['isAuthenticated'](),controller[_0xb405('0x11')]);router[_0xb405('0xe')](_0xb405('0xc'),auth[_0xb405('0xa')](),controller[_0xb405('0x12')]);router['put'](_0xb405('0x13'),auth[_0xb405('0xa')](),controller['update']);router['delete'](_0xb405('0x13'),auth[_0xb405('0xa')](),controller[_0xb405('0x14')]);module[_0xb405('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index ecb9590..67e92e2 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 _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xfdbd[_0x2cf2e9];return _0xd3670d;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x491b7e,_0x5e923b){var _0x4af869=function(_0x34ae83){while(--_0x34ae83){_0x491b7e['push'](_0x491b7e['shift']());}};_0x4af869(++_0x5e923b);}(_0x2ef3,0xba));var _0x32ef=function(_0xb96483,_0x2431f3){_0xb96483=_0xb96483-0x0;var _0x18dc66=_0x2ef3[_0xb96483];return _0x18dc66;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 1971c44..3251c1a 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 _0x3cc5=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','stack','send','model','keys','DashboardItem','filters','query','attributes','intersection','fields','length','includeAll','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cc5,0x15b));var _0x53cc=function(_0x1b46b0,_0x64f773){_0x1b46b0=_0x1b46b0-0x0;var _0x2e361c=_0x3cc5[_0x1b46b0];return _0x2e361c;};'use strict';var emlformat=require(_0x53cc('0x0'));var rimraf=require(_0x53cc('0x1'));var zipdir=require(_0x53cc('0x2'));var jsonpatch=require(_0x53cc('0x3'));var rp=require(_0x53cc('0x4'));var moment=require(_0x53cc('0x5'));var BPromise=require(_0x53cc('0x6'));var Mustache=require('mustache');var util=require(_0x53cc('0x7'));var path=require(_0x53cc('0x8'));var sox=require(_0x53cc('0x9'));var csv=require(_0x53cc('0xa'));var ejs=require(_0x53cc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53cc('0xc'));var squel=require(_0x53cc('0xd'));var crypto=require(_0x53cc('0xe'));var jsforce=require(_0x53cc('0xf'));var deskjs=require(_0x53cc('0x10'));var toCsv=require(_0x53cc('0xa'));var querystring=require(_0x53cc('0x11'));var Papa=require(_0x53cc('0x12'));var Redis=require('ioredis');var authService=require(_0x53cc('0x13'));var qs=require(_0x53cc('0x14'));var as=require(_0x53cc('0x15'));var hardwareService=require(_0x53cc('0x16'));var logger=require(_0x53cc('0x17'))(_0x53cc('0x18'));var utils=require(_0x53cc('0x19'));var config=require(_0x53cc('0x1a'));var licenseUtil=require(_0x53cc('0x1b'));var db=require(_0x53cc('0x1c'))['db'];config['redis']=_[_0x53cc('0x1d')](config[_0x53cc('0x1e')],{'host':_0x53cc('0x1f'),'port':0x18eb});var socket=require(_0x53cc('0x20'))(new Redis(config['redis']));require(_0x53cc('0x21'))['register'](socket);function respondWithStatusCode(_0x42e152,_0x5d626f){_0x5d626f=_0x5d626f||0xcc;return function(_0x303791){if(_0x303791){return _0x42e152[_0x53cc('0x22')](_0x5d626f);}return _0x42e152[_0x53cc('0x23')](_0x5d626f)[_0x53cc('0x24')]();};}function respondWithResult(_0x35db91,_0x27e25c){_0x27e25c=_0x27e25c||0xc8;return function(_0x4bd2ac){if(_0x4bd2ac){return _0x35db91['status'](_0x27e25c)[_0x53cc('0x25')](_0x4bd2ac);}};}function respondWithFilteredResult(_0x25ea27,_0x48cd1e){return function(_0x31fe64){if(_0x31fe64){var _0x4dbfe3=typeof _0x48cd1e[_0x53cc('0x26')]===_0x53cc('0x27')&&typeof _0x48cd1e['limit']==='undefined';var _0x59ffc1=_0x31fe64[_0x53cc('0x28')];var _0x99cd4d=_0x4dbfe3?0x0:_0x48cd1e[_0x53cc('0x26')];var _0x447a21=_0x4dbfe3?_0x31fe64[_0x53cc('0x28')]:_0x48cd1e['offset']+_0x48cd1e[_0x53cc('0x29')];var _0xd2ec03;if(_0x447a21>=_0x59ffc1){_0x447a21=_0x59ffc1;_0xd2ec03=0xc8;}else{_0xd2ec03=0xce;}_0x25ea27[_0x53cc('0x23')](_0xd2ec03);return _0x25ea27[_0x53cc('0x2a')](_0x53cc('0x2b'),_0x99cd4d+'-'+_0x447a21+'/'+_0x59ffc1)[_0x53cc('0x25')](_0x31fe64);}return null;};}function patchUpdates(_0x2fa5ad){return function(_0xcb75d){try{jsonpatch[_0x53cc('0x2c')](_0xcb75d,_0x2fa5ad,!![]);}catch(_0x370205){return BPromise['reject'](_0x370205);}return _0xcb75d[_0x53cc('0x2d')]();};}function saveUpdates(_0x59d0b8,_0x1a6bbe){return function(_0x72f294){if(_0x72f294){return _0x72f294[_0x53cc('0x2e')](_0x59d0b8)['then'](function(_0x281268){return _0x281268;});}return null;};}function removeEntity(_0x259801,_0x46d257){return function(_0x30081c){if(_0x30081c){return _0x30081c[_0x53cc('0x2f')]()[_0x53cc('0x30')](function(){_0x259801['status'](0xcc)[_0x53cc('0x24')]();});}};}function handleEntityNotFound(_0x2dbd6b,_0x462238){return function(_0x38dc5a){if(!_0x38dc5a){_0x2dbd6b[_0x53cc('0x22')](0x194);}return _0x38dc5a;};}function handleError(_0x1cd656,_0x569e59){_0x569e59=_0x569e59||0x1f4;return function(_0x7e0068){logger['error'](_0x7e0068[_0x53cc('0x31')]);if(_0x7e0068['name']){delete _0x7e0068['name'];}_0x1cd656[_0x53cc('0x23')](_0x569e59)[_0x53cc('0x32')](_0x7e0068);};}exports['show']=function(_0x3cc710,_0x6e10f4){var _0x328f9d={'raw':![],'where':{'id':_0x3cc710['params']['id']}},_0x5e2154={};_0x5e2154[_0x53cc('0x33')]=_[_0x53cc('0x34')](db[_0x53cc('0x35')]['rawAttributes']);_0x5e2154['query']=_['keys'](_0x3cc710['query']);_0x5e2154[_0x53cc('0x36')]=_['intersection'](_0x5e2154[_0x53cc('0x33')],_0x5e2154[_0x53cc('0x37')]);_0x328f9d[_0x53cc('0x38')]=_[_0x53cc('0x39')](_0x5e2154[_0x53cc('0x33')],qs[_0x53cc('0x3a')](_0x3cc710[_0x53cc('0x37')]['fields']));_0x328f9d[_0x53cc('0x38')]=_0x328f9d[_0x53cc('0x38')][_0x53cc('0x3b')]?_0x328f9d['attributes']:_0x5e2154[_0x53cc('0x33')];if(_0x3cc710[_0x53cc('0x37')][_0x53cc('0x3c')]){_0x328f9d['include']=[{'all':!![]}];}_0x328f9d=_['merge']({},_0x328f9d,_0x3cc710[_0x53cc('0x3d')]);return db['DashboardItem'][_0x53cc('0x3e')](_0x328f9d)['then'](handleEntityNotFound(_0x6e10f4,null))[_0x53cc('0x30')](respondWithResult(_0x6e10f4,null))['catch'](handleError(_0x6e10f4,null));};exports[_0x53cc('0x2f')]=function(_0x4f1a86,_0x521418){return db['DashboardItem'][_0x53cc('0x3e')]({'where':{'id':_0x4f1a86['params']['id']}})['then'](handleEntityNotFound(_0x521418,null))['then'](removeEntity(_0x521418,null))[_0x53cc('0x3f')](handleError(_0x521418,null));};function widgetAttributes(_0xae2855){try{switch(_0xae2855[_0x53cc('0x40')]){case _0x53cc('0x41'):return[{'name':_0x53cc('0x42'),'value':_0xae2855[_0x53cc('0x42')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855['attrs'][0x0]?_0xae2855[_0x53cc('0x43')][0x0][_0x53cc('0x44')]:undefined)||_0x53cc('0x45')}];case _0x53cc('0x46'):return[{'name':_0x53cc('0x47'),'value':_0xae2855[_0x53cc('0x47')]||(_0xae2855['attrs']&&_0xae2855[_0x53cc('0x43')][0x0]?_0xae2855[_0x53cc('0x43')][0x0]['value']:undefined)||''}];case _0x53cc('0x48'):return[{'name':_0x53cc('0x49'),'value':_0xae2855[_0x53cc('0x49')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x0]?_0xae2855[_0x53cc('0x43')][0x0]['value']:undefined)||_0x53cc('0x4a')},{'name':_0x53cc('0x4b'),'value':_0xae2855[_0x53cc('0x4b')]||(_0xae2855['attrs']&&_0xae2855[_0x53cc('0x43')][0x1]?_0xae2855['attrs'][0x1][_0x53cc('0x44')]:undefined)||_0x53cc('0x4c')},{'name':_0x53cc('0x4d'),'value':_0xae2855[_0x53cc('0x4d')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x2]?_0xae2855[_0x53cc('0x43')][0x2][_0x53cc('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0x53cc('0x4e'),'value':_0xae2855[_0x53cc('0x4e')]||(_0xae2855['attrs']&&_0xae2855['attrs'][0x0]?_0xae2855[_0x53cc('0x43')][0x0]['value']:undefined)||_0x53cc('0x4f')},{'name':_0x53cc('0x50'),'value':_0xae2855[_0x53cc('0x50')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x1]?_0xae2855[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||[]},{'name':_0x53cc('0x4d'),'value':_0xae2855[_0x53cc('0x4d')]||(_0xae2855['attrs']&&_0xae2855[_0x53cc('0x43')][0x2]?_0xae2855[_0x53cc('0x43')][0x2][_0x53cc('0x44')]:undefined)||0x14}];case'multibar-chart':case _0x53cc('0x51'):return[{'name':_0x53cc('0x52'),'value':_0xae2855[_0x53cc('0x52')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x0]?_0xae2855[_0x53cc('0x43')][0x0]['value']:undefined)||'total'},{'name':_0x53cc('0x53'),'value':_0xae2855['attrSerie2']||(_0xae2855['attrs']&&_0xae2855['attrs'][0x1]?_0xae2855[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0xae2855['attrSerie3']||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x2]?_0xae2855['attrs'][0x2][_0x53cc('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xae2855[_0x53cc('0x50')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x3]?_0xae2855[_0x53cc('0x43')][0x3][_0x53cc('0x44')]:undefined)||[]}];case'web-report':return[{'name':_0x53cc('0x54'),'type':_0xae2855[_0x53cc('0x55')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x0]?_0xae2855[_0x53cc('0x43')][0x0]['type']:undefined)||null,'value':_0xae2855[_0x53cc('0x54')]||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x0]?_0xae2855[_0x53cc('0x43')][0x0]['value']:undefined)||null},{'name':_0x53cc('0x56'),'value':_0xae2855['attrRefresh']||(_0xae2855[_0x53cc('0x43')]&&_0xae2855[_0x53cc('0x43')][0x1]?_0xae2855['attrs'][0x1][_0x53cc('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x244f89){logger['error'](_0x53cc('0x57'),JSON[_0x53cc('0x58')](_0x244f89));return[];}}exports['create']=function(_0x436572,_0x443c01){if(_0x436572[_0x53cc('0x59')]){_0x436572[_0x53cc('0x59')][_0x53cc('0x43')]=widgetAttributes(_0x436572[_0x53cc('0x59')]);}return db['DashboardItem'][_0x53cc('0x5a')](_0x436572[_0x53cc('0x59')],{})['then'](respondWithResult(_0x443c01,0xc9))[_0x53cc('0x3f')](handleError(_0x443c01,null));};exports['update']=function(_0x2af201,_0x54c124){if(_0x2af201[_0x53cc('0x59')]['id']){delete _0x2af201[_0x53cc('0x59')]['id'];}_0x2af201[_0x53cc('0x59')][_0x53cc('0x43')]=widgetAttributes(_0x2af201[_0x53cc('0x59')]);return db[_0x53cc('0x35')]['find']({'where':{'id':_0x2af201['params']['id']}})[_0x53cc('0x30')](handleEntityNotFound(_0x54c124,null))[_0x53cc('0x30')](saveUpdates(_0x2af201['body'],null))[_0x53cc('0x30')](respondWithResult(_0x54c124,null))[_0x53cc('0x3f')](handleError(_0x54c124,null));}; \ No newline at end of file +var _0x1d18=['catch','type','attrs','value','https://','attrPath','attrHourFormat','attrTimezone','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','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','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','send','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','options','find'];(function(_0x298057,_0x2d9a1e){var _0x43bde8=function(_0x40502b){while(--_0x40502b){_0x298057['push'](_0x298057['shift']());}};_0x43bde8(++_0x2d9a1e);}(_0x1d18,0x10d));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x81d1('0x0'));var rimraf=require(_0x81d1('0x1'));var zipdir=require(_0x81d1('0x2'));var jsonpatch=require(_0x81d1('0x3'));var rp=require(_0x81d1('0x4'));var moment=require('moment');var BPromise=require(_0x81d1('0x5'));var Mustache=require('mustache');var util=require(_0x81d1('0x6'));var path=require(_0x81d1('0x7'));var sox=require('sox');var csv=require(_0x81d1('0x8'));var ejs=require(_0x81d1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81d1('0xa'));var squel=require(_0x81d1('0xb'));var crypto=require('crypto');var jsforce=require(_0x81d1('0xc'));var deskjs=require(_0x81d1('0xd'));var toCsv=require(_0x81d1('0x8'));var querystring=require(_0x81d1('0xe'));var Papa=require(_0x81d1('0xf'));var Redis=require('ioredis');var authService=require(_0x81d1('0x10'));var qs=require(_0x81d1('0x11'));var as=require(_0x81d1('0x12'));var hardwareService=require(_0x81d1('0x13'));var logger=require(_0x81d1('0x14'))(_0x81d1('0x15'));var utils=require(_0x81d1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x81d1('0x17'));var db=require(_0x81d1('0x18'))['db'];config[_0x81d1('0x19')]=_['defaults'](config[_0x81d1('0x19')],{'host':_0x81d1('0x1a'),'port':0x18eb});var socket=require(_0x81d1('0x1b'))(new Redis(config[_0x81d1('0x19')]));require(_0x81d1('0x1c'))['register'](socket);function respondWithStatusCode(_0x355943,_0xc6b6a4){_0xc6b6a4=_0xc6b6a4||0xcc;return function(_0x2f7f23){if(_0x2f7f23){return _0x355943[_0x81d1('0x1d')](_0xc6b6a4);}return _0x355943[_0x81d1('0x1e')](_0xc6b6a4)[_0x81d1('0x1f')]();};}function respondWithResult(_0x4569dc,_0x135e04){_0x135e04=_0x135e04||0xc8;return function(_0xb1bfe4){if(_0xb1bfe4){return _0x4569dc[_0x81d1('0x1e')](_0x135e04)[_0x81d1('0x20')](_0xb1bfe4);}};}function respondWithFilteredResult(_0x5eb7a1,_0x45c1aa){return function(_0x581c3b){if(_0x581c3b){var _0x266008=typeof _0x45c1aa[_0x81d1('0x21')]===_0x81d1('0x22')&&typeof _0x45c1aa[_0x81d1('0x23')]===_0x81d1('0x22');var _0x257d62=_0x581c3b[_0x81d1('0x24')];var _0x5da1e2=_0x266008?0x0:_0x45c1aa[_0x81d1('0x21')];var _0x16ae74=_0x266008?_0x581c3b[_0x81d1('0x24')]:_0x45c1aa[_0x81d1('0x21')]+_0x45c1aa[_0x81d1('0x23')];var _0x523e0c;if(_0x16ae74>=_0x257d62){_0x16ae74=_0x257d62;_0x523e0c=0xc8;}else{_0x523e0c=0xce;}_0x5eb7a1[_0x81d1('0x1e')](_0x523e0c);return _0x5eb7a1[_0x81d1('0x25')](_0x81d1('0x26'),_0x5da1e2+'-'+_0x16ae74+'/'+_0x257d62)['json'](_0x581c3b);}return null;};}function patchUpdates(_0x3c9ba4){return function(_0x20aa37){try{jsonpatch[_0x81d1('0x27')](_0x20aa37,_0x3c9ba4,!![]);}catch(_0x34857c){return BPromise['reject'](_0x34857c);}return _0x20aa37['save']();};}function saveUpdates(_0x3da333,_0x3e6b5e){return function(_0x176a0d){if(_0x176a0d){return _0x176a0d[_0x81d1('0x28')](_0x3da333)[_0x81d1('0x29')](function(_0x468ab3){return _0x468ab3;});}return null;};}function removeEntity(_0x27540a,_0x3c42a0){return function(_0x385252){if(_0x385252){return _0x385252[_0x81d1('0x2a')]()[_0x81d1('0x29')](function(){_0x27540a[_0x81d1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1149af,_0x41764d){return function(_0x528d28){if(!_0x528d28){_0x1149af['sendStatus'](0x194);}return _0x528d28;};}function handleError(_0x2597a1,_0x11034e){_0x11034e=_0x11034e||0x1f4;return function(_0x3c2d6c){logger['error'](_0x3c2d6c['stack']);if(_0x3c2d6c['name']){delete _0x3c2d6c[_0x81d1('0x2b')];}_0x2597a1[_0x81d1('0x1e')](_0x11034e)[_0x81d1('0x2c')](_0x3c2d6c);};}exports['show']=function(_0x5162e6,_0x40508a){var _0x500350={'raw':![],'where':{'id':_0x5162e6[_0x81d1('0x2d')]['id']}},_0x4cd330={};_0x4cd330[_0x81d1('0x2e')]=_['keys'](db[_0x81d1('0x2f')][_0x81d1('0x30')]);_0x4cd330[_0x81d1('0x31')]=_[_0x81d1('0x32')](_0x5162e6['query']);_0x4cd330[_0x81d1('0x33')]=_[_0x81d1('0x34')](_0x4cd330['model'],_0x4cd330['query']);_0x500350[_0x81d1('0x35')]=_[_0x81d1('0x34')](_0x4cd330[_0x81d1('0x2e')],qs[_0x81d1('0x36')](_0x5162e6['query'][_0x81d1('0x36')]));_0x500350[_0x81d1('0x35')]=_0x500350[_0x81d1('0x35')][_0x81d1('0x37')]?_0x500350[_0x81d1('0x35')]:_0x4cd330['model'];if(_0x5162e6[_0x81d1('0x31')][_0x81d1('0x38')]){_0x500350['include']=[{'all':!![]}];}_0x500350=_['merge']({},_0x500350,_0x5162e6[_0x81d1('0x39')]);return db[_0x81d1('0x2f')][_0x81d1('0x3a')](_0x500350)[_0x81d1('0x29')](handleEntityNotFound(_0x40508a,null))[_0x81d1('0x29')](respondWithResult(_0x40508a,null))[_0x81d1('0x3b')](handleError(_0x40508a,null));};exports[_0x81d1('0x2a')]=function(_0x84d42f,_0x5a062b){return db[_0x81d1('0x2f')][_0x81d1('0x3a')]({'where':{'id':_0x84d42f[_0x81d1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5a062b,null))[_0x81d1('0x29')](removeEntity(_0x5a062b,null))[_0x81d1('0x3b')](handleError(_0x5a062b,null));};function widgetAttributes(_0x176704){try{switch(_0x176704[_0x81d1('0x3c')]){case'iframe':return[{'name':'attrUrl','value':_0x176704['attrUrl']||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x0]?_0x176704[_0x81d1('0x3d')][0x0][_0x81d1('0x3e')]:undefined)||_0x81d1('0x3f')}];case'custom':return[{'name':_0x81d1('0x40'),'value':_0x176704[_0x81d1('0x40')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704['attrs'][0x0]?_0x176704[_0x81d1('0x3d')][0x0][_0x81d1('0x3e')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x176704[_0x81d1('0x41')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x0]?_0x176704[_0x81d1('0x3d')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x81d1('0x42'),'value':_0x176704[_0x81d1('0x42')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x1]?_0x176704[_0x81d1('0x3d')][0x1][_0x81d1('0x3e')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x176704['attrFontSize']||(_0x176704['attrs']&&_0x176704[_0x81d1('0x3d')][0x2]?_0x176704['attrs'][0x2][_0x81d1('0x3e')]:undefined)||0xc}];case _0x81d1('0x43'):return[{'name':_0x81d1('0x44'),'value':_0x176704['attrMetric']||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x0]?_0x176704['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x81d1('0x45'),'value':_0x176704['attrVoiceQueues']||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x1]?_0x176704[_0x81d1('0x3d')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x176704['attrFontSize']||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x2]?_0x176704[_0x81d1('0x3d')][0x2][_0x81d1('0x3e')]:undefined)||0x14}];case'multibar-chart':case _0x81d1('0x46'):return[{'name':_0x81d1('0x47'),'value':_0x176704[_0x81d1('0x47')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704['attrs'][0x0]?_0x176704[_0x81d1('0x3d')][0x0][_0x81d1('0x3e')]:undefined)||_0x81d1('0x48')},{'name':'attrSerie2','value':_0x176704[_0x81d1('0x49')]||(_0x176704['attrs']&&_0x176704[_0x81d1('0x3d')][0x1]?_0x176704['attrs'][0x1][_0x81d1('0x3e')]:undefined)||null},{'name':_0x81d1('0x4a'),'value':_0x176704[_0x81d1('0x4a')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x2]?_0x176704[_0x81d1('0x3d')][0x2][_0x81d1('0x3e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x176704[_0x81d1('0x45')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x3]?_0x176704[_0x81d1('0x3d')][0x3][_0x81d1('0x3e')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x176704['reportType']||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x0]?_0x176704[_0x81d1('0x3d')][0x0]['type']:undefined)||null,'value':_0x176704[_0x81d1('0x4b')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x0]?_0x176704['attrs'][0x0][_0x81d1('0x3e')]:undefined)||null},{'name':_0x81d1('0x4c'),'value':_0x176704[_0x81d1('0x4c')]||(_0x176704[_0x81d1('0x3d')]&&_0x176704[_0x81d1('0x3d')][0x1]?_0x176704[_0x81d1('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1c88a4){logger[_0x81d1('0x4d')](_0x81d1('0x4e'),JSON[_0x81d1('0x4f')](_0x1c88a4));return[];}}exports[_0x81d1('0x50')]=function(_0x29c26c,_0x91776e){if(_0x29c26c['body']){_0x29c26c[_0x81d1('0x51')][_0x81d1('0x3d')]=widgetAttributes(_0x29c26c['body']);}return db[_0x81d1('0x2f')]['create'](_0x29c26c['body'],{})['then'](respondWithResult(_0x91776e,0xc9))[_0x81d1('0x3b')](handleError(_0x91776e,null));};exports[_0x81d1('0x28')]=function(_0x578a8e,_0x5bb9ab){if(_0x578a8e[_0x81d1('0x51')]['id']){delete _0x578a8e[_0x81d1('0x51')]['id'];}_0x578a8e[_0x81d1('0x51')][_0x81d1('0x3d')]=widgetAttributes(_0x578a8e[_0x81d1('0x51')]);return db['DashboardItem'][_0x81d1('0x3a')]({'where':{'id':_0x578a8e['params']['id']}})[_0x81d1('0x29')](handleEntityNotFound(_0x5bb9ab,null))['then'](saveUpdates(_0x578a8e[_0x81d1('0x51')],null))[_0x81d1('0x29')](respondWithResult(_0x5bb9ab,null))['catch'](handleError(_0x5bb9ab,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 71652d6..c0ae6ee 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 _0x6628=['../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','exports','events'];(function(_0x3ae70a,_0x25bfaa){var _0x4cfbc4=function(_0x3d308b){while(--_0x3d308b){_0x3ae70a['push'](_0x3ae70a['shift']());}};_0x4cfbc4(++_0x25bfaa);}(_0x6628,0x19f));var _0x8662=function(_0x3c16b1,_0x357dc1){_0x3c16b1=_0x3c16b1-0x0;var _0x52f78f=_0x6628[_0x3c16b1];return _0x52f78f;};'use strict';var EventEmitter=require(_0x8662('0x0'));var DashboardItem=require(_0x8662('0x1'))['db'][_0x8662('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8662('0x3')](0x0);var events={'afterCreate':_0x8662('0x4'),'afterUpdate':_0x8662('0x5'),'afterDestroy':'remove'};function emitEvent(_0x6e5ffb){return function(_0x3f27cf,_0x2b8036,_0x2ebe04){DashboardItemEvents[_0x8662('0x6')](_0x6e5ffb+':'+_0x3f27cf['id'],_0x3f27cf);DashboardItemEvents[_0x8662('0x6')](_0x6e5ffb,_0x3f27cf);_0x2ebe04(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x8662('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x24ba=['DashboardItem','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3c9ff9,_0x3255a0){var _0x34a960=function(_0x36e310){while(--_0x36e310){_0x3c9ff9['push'](_0x3c9ff9['shift']());}};_0x34a960(++_0x3255a0);}(_0x24ba,0xd6));var _0xa24b=function(_0x4aa350,_0x12a9eb){_0x4aa350=_0x4aa350-0x0;var _0x32a16f=_0x24ba[_0x4aa350];return _0x32a16f;};'use strict';var EventEmitter=require(_0xa24b('0x0'));var DashboardItem=require(_0xa24b('0x1'))['db'][_0xa24b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa24b('0x3'),'afterUpdate':_0xa24b('0x4'),'afterDestroy':_0xa24b('0x5')};function emitEvent(_0x5ba463){return function(_0x4a5207,_0x16fb01,_0x2ee5d7){DashboardItemEvents['emit'](_0x5ba463+':'+_0x4a5207['id'],_0x4a5207);DashboardItemEvents[_0xa24b('0x6')](_0x5ba463,_0x4a5207);_0x2ee5d7(null);};}for(var e in events){if(events[_0xa24b('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xa24b('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index e9fe66b..add9084 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 _0xbacf=['../../config/logger','api','moment','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util'];(function(_0x3e1213,_0x20b6b3){var _0x3c79c9=function(_0x5c4d90){while(--_0x5c4d90){_0x3e1213['push'](_0x3e1213['shift']());}};_0x3c79c9(++_0x20b6b3);}(_0xbacf,0xf9));var _0xfbac=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xbacf[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0xfbac('0x0'));var logger=require(_0xfbac('0x1'))(_0xfbac('0x2'));var moment=require(_0xfbac('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfbac('0x4'));var config=require(_0xfbac('0x5'));var attributes=require(_0xfbac('0x6'));module[_0xfbac('0x7')]=function(_0x2e4915,_0x21746a){return _0x2e4915[_0xfbac('0x8')](_0xfbac('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f8=['DashboardItem','dashboard_items','util','../../config/logger','api','moment','request-promise','define'];(function(_0xf09210,_0x4a215a){var _0x17d266=function(_0x81b03f){while(--_0x81b03f){_0xf09210['push'](_0xf09210['shift']());}};_0x17d266(++_0x4a215a);}(_0x37f8,0xd2));var _0x837f=function(_0xda1a8f,_0x3b2da7){_0xda1a8f=_0xda1a8f-0x0;var _0x5f884=_0x37f8[_0xda1a8f];return _0x5f884;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var logger=require(_0x837f('0x1'))(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require('bluebird');var rp=require(_0x837f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x19c939,_0x42986f){return _0x19c939[_0x837f('0x5')](_0x837f('0x6'),attributes,{'tableName':_0x837f('0x7'),'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 6da5162..a8578f9 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 _0x9cea=['DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info'];(function(_0x3a6b59,_0x2d911e){var _0x330c6e=function(_0xb4d1c2){while(--_0xb4d1c2){_0x3a6b59['push'](_0x3a6b59['shift']());}};_0x330c6e(++_0x2d911e);}(_0x9cea,0x1ee));var _0xa9ce=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x9cea[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xa9ce('0x0'));var util=require(_0xa9ce('0x1'));var moment=require(_0xa9ce('0x2'));var BPromise=require(_0xa9ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9ce('0x4'))['db'];var utils=require(_0xa9ce('0x5'));var logger=require(_0xa9ce('0x6'))(_0xa9ce('0x7'));var config=require(_0xa9ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa9ce('0x9')][_0xa9ce('0xa')]({'port':0x232a});config[_0xa9ce('0xb')]=_[_0xa9ce('0xc')](config['redis'],{'host':_0xa9ce('0xd'),'port':0x18eb});var socket=require(_0xa9ce('0xe'))(new Redis(config[_0xa9ce('0xb')]));require(_0xa9ce('0xf'))[_0xa9ce('0x10')](socket);function respondWithRpcPromise(_0x1517a0,_0x4336f1,_0x3da990){return new BPromise(function(_0x2bf8ac,_0x24989b){return client[_0xa9ce('0x11')](_0x1517a0,_0x3da990)['then'](function(_0x2f75e5){logger[_0xa9ce('0x12')](_0xa9ce('0x13'),_0x4336f1,'request\x20sent');logger[_0xa9ce('0x14')](_0xa9ce('0x15'),_0x4336f1,_0xa9ce('0x16'),JSON['stringify'](_0x2f75e5));if(_0x2f75e5[_0xa9ce('0x17')]){if(_0x2f75e5[_0xa9ce('0x17')][_0xa9ce('0x18')]===0x1f4){logger[_0xa9ce('0x17')](_0xa9ce('0x13'),_0x4336f1,_0x2f75e5[_0xa9ce('0x17')]['message']);return _0x24989b(_0x2f75e5['error'][_0xa9ce('0x19')]);}logger[_0xa9ce('0x17')](_0xa9ce('0x13'),_0x4336f1,_0x2f75e5[_0xa9ce('0x17')][_0xa9ce('0x19')]);return _0x2bf8ac(_0x2f75e5[_0xa9ce('0x17')][_0xa9ce('0x19')]);}else{logger[_0xa9ce('0x12')]('DashboardItem,\x20%s,\x20%s',_0x4336f1,_0xa9ce('0x16'));_0x2bf8ac(_0x2f75e5[_0xa9ce('0x1a')]['message']);}})['catch'](function(_0x43325b){logger[_0xa9ce('0x17')](_0xa9ce('0x13'),_0x4336f1,_0x43325b);_0x24989b(_0x43325b);});});} \ No newline at end of file +var _0xc4be=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc4be,0x14a));var _0xec4b=function(_0x48b4ef,_0x4eabb4){_0x48b4ef=_0x48b4ef-0x0;var _0x1f7a32=_0xc4be[_0x48b4ef];return _0x1f7a32;};'use strict';var _=require(_0xec4b('0x0'));var util=require(_0xec4b('0x1'));var moment=require(_0xec4b('0x2'));var BPromise=require(_0xec4b('0x3'));var rs=require(_0xec4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec4b('0x5'))['db'];var utils=require(_0xec4b('0x6'));var logger=require(_0xec4b('0x7'))(_0xec4b('0x8'));var config=require(_0xec4b('0x9'));var jayson=require(_0xec4b('0xa'));var client=jayson[_0xec4b('0xb')][_0xec4b('0xc')]({'port':0x232a});config[_0xec4b('0xd')]=_[_0xec4b('0xe')](config[_0xec4b('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xec4b('0xf'))(new Redis(config[_0xec4b('0xd')]));require('./dashboardItem.socket')[_0xec4b('0x10')](socket);function respondWithRpcPromise(_0x34058c,_0x48a29b,_0x9b0831){return new BPromise(function(_0x213e7d,_0x30c361){return client[_0xec4b('0x11')](_0x34058c,_0x9b0831)[_0xec4b('0x12')](function(_0x1edd87){logger[_0xec4b('0x13')](_0xec4b('0x14'),_0x48a29b,'request\x20sent');logger[_0xec4b('0x15')](_0xec4b('0x16'),_0x48a29b,_0xec4b('0x17'),JSON[_0xec4b('0x18')](_0x1edd87));if(_0x1edd87['error']){if(_0x1edd87[_0xec4b('0x19')][_0xec4b('0x1a')]===0x1f4){logger[_0xec4b('0x19')](_0xec4b('0x14'),_0x48a29b,_0x1edd87[_0xec4b('0x19')][_0xec4b('0x1b')]);return _0x30c361(_0x1edd87[_0xec4b('0x19')][_0xec4b('0x1b')]);}logger['error'](_0xec4b('0x14'),_0x48a29b,_0x1edd87[_0xec4b('0x19')][_0xec4b('0x1b')]);return _0x213e7d(_0x1edd87[_0xec4b('0x19')]['message']);}else{logger[_0xec4b('0x13')](_0xec4b('0x14'),_0x48a29b,_0xec4b('0x17'));_0x213e7d(_0x1edd87['result'][_0xec4b('0x1b')]);}})['catch'](function(_0x47438c){logger['error'](_0xec4b('0x14'),_0x48a29b,_0x47438c);_0x30c361(_0x47438c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5848460..436064d 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 _0x7573=['register','length','save','remove','emit','removeListener'];(function(_0x4ac087,_0x250e0b){var _0x137c8b=function(_0x311698){while(--_0x311698){_0x4ac087['push'](_0x4ac087['shift']());}};_0x137c8b(++_0x250e0b);}(_0x7573,0x146));var _0x3757=function(_0xbc337e,_0x10472d){_0xbc337e=_0xbc337e-0x0;var _0x42e84b=_0x7573[_0xbc337e];return _0x42e84b;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x3757('0x0'),_0x3757('0x1'),'update'];function createListener(_0x406611,_0xa0ed5d){return function(_0x42bc52){_0xa0ed5d[_0x3757('0x2')](_0x406611,_0x42bc52);};}function removeListener(_0x207453,_0x2dcd3b){return function(){DashboardItemEvents[_0x3757('0x3')](_0x207453,_0x2dcd3b);};}exports[_0x3757('0x4')]=function(_0x51c423){for(var _0x3934ae=0x0,_0x3d14d5=events[_0x3757('0x5')];_0x3934ae<_0x3d14d5;_0x3934ae++){var _0x253a20=events[_0x3934ae];var _0x4881ff=createListener('dashboardItem:'+_0x253a20,_0x51c423);DashboardItemEvents['on'](_0x253a20,_0x4881ff);}}; \ No newline at end of file +var _0xd5f8=['./dashboardItem.events','save','remove','update','emit','length'];(function(_0x191fb8,_0x3fb84f){var _0x504075=function(_0x2bad03){while(--_0x2bad03){_0x191fb8['push'](_0x191fb8['shift']());}};_0x504075(++_0x3fb84f);}(_0xd5f8,0x1ec));var _0x8d5f=function(_0x47c4f4,_0x1dea08){_0x47c4f4=_0x47c4f4-0x0;var _0x551bb2=_0xd5f8[_0x47c4f4];return _0x551bb2;};'use strict';var DashboardItemEvents=require(_0x8d5f('0x0'));var events=[_0x8d5f('0x1'),_0x8d5f('0x2'),_0x8d5f('0x3')];function createListener(_0x1f0f11,_0x723995){return function(_0x3c9dc6){_0x723995[_0x8d5f('0x4')](_0x1f0f11,_0x3c9dc6);};}function removeListener(_0x154f9d,_0x20e762){return function(){DashboardItemEvents['removeListener'](_0x154f9d,_0x20e762);};}exports['register']=function(_0xf912ef){for(var _0x705df7=0x0,_0x8cc183=events[_0x8d5f('0x5')];_0x705df7<_0x8cc183;_0x705df7++){var _0x3ef401=events[_0x705df7];var _0x315226=createListener('dashboardItem:'+_0x3ef401,_0xf912ef);DashboardItemEvents['on'](_0x3ef401,_0x315226);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 1aa8aa3..4a1bae9 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 _0xf46b=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x29ad42,_0x44f20e){var _0x12e00b=function(_0x1cedfa){while(--_0x1cedfa){_0x29ad42['push'](_0x29ad42['shift']());}};_0x12e00b(++_0x44f20e);}(_0xf46b,0x13f));var _0xbf46=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xf46b[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xbf46('0x0'));var util=require(_0xbf46('0x1'));var path=require(_0xbf46('0x2'));var timeout=require(_0xbf46('0x3'));var express=require(_0xbf46('0x4'));var router=express[_0xbf46('0x5')]();var fs_extra=require(_0xbf46('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbf46('0x7'));var config=require(_0xbf46('0x8'));var controller=require(_0xbf46('0x9'));router['get'](_0xbf46('0xa'),auth[_0xbf46('0xb')](),controller[_0xbf46('0xc')]);router[_0xbf46('0xd')]('/',auth[_0xbf46('0xb')](),controller[_0xbf46('0xe')]);router[_0xbf46('0xf')](_0xbf46('0xa'),auth[_0xbf46('0xb')](),controller['update']);router[_0xbf46('0x10')](_0xbf46('0xa'),auth[_0xbf46('0xb')](),controller[_0xbf46('0x11')]);module[_0xbf46('0x12')]=router; \ No newline at end of file +var _0xb28a=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','post','update','/:id','destroy','exports','multer'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xb28a,0xed));var _0xab28=function(_0x2ace90,_0x5c4685){_0x2ace90=_0x2ace90-0x0;var _0x4b77cf=_0xb28a[_0x2ace90];return _0x4b77cf;};'use strict';var multer=require(_0xab28('0x0'));var util=require(_0xab28('0x1'));var path=require(_0xab28('0x2'));var timeout=require('connect-timeout');var express=require(_0xab28('0x3'));var router=express[_0xab28('0x4')]();var fs_extra=require(_0xab28('0x5'));var auth=require(_0xab28('0x6'));var interaction=require(_0xab28('0x7'));var config=require(_0xab28('0x8'));var controller=require(_0xab28('0x9'));router['get']('/:id',auth[_0xab28('0xa')](),controller[_0xab28('0xb')]);router[_0xab28('0xc')]('/',auth[_0xab28('0xa')](),controller['create']);router['put']('/:id',auth[_0xab28('0xa')](),controller[_0xab28('0xd')]);router['delete'](_0xab28('0xe'),auth[_0xab28('0xa')](),controller[_0xab28('0xf')]);module[_0xab28('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8f83840..cbddf40 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 _0xd46c=['first','second','third','STRING','ENUM'];(function(_0x30a44e,_0x8be1af){var _0x5af85d=function(_0x430613){while(--_0x430613){_0x30a44e['push'](_0x30a44e['shift']());}};_0x5af85d(++_0x8be1af);}(_0xd46c,0x175));var _0xcd46=function(_0x11cb39,_0x55dd31){_0x11cb39=_0x11cb39-0x0;var _0x43f840=_0xd46c[_0x11cb39];return _0x43f840;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcd46('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0xcd46('0x1')](_0xcd46('0x2'),_0xcd46('0x3'),_0xcd46('0x4')),'allowNull':![],'defaultValue':_0xcd46('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6151=['second','third','sequelize','exports','STRING','ENUM'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6151,0x1ca));var _0x1615=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0x6151[_0x21d0c3];return _0x4df18e;};'use strict';var Sequelize=require(_0x1615('0x0'));module[_0x1615('0x1')]={'name':{'type':Sequelize[_0x1615('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x1615('0x3')]('first',_0x1615('0x4'),_0x1615('0x5')),'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 a794d75..5708165 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 _0x75a2=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','Dispositions','UserProfileResource','sendStatus','stack','name','send','index','map','Disposition','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','status'];(function(_0x5a6768,_0x48a115){var _0x10e35b=function(_0x209043){while(--_0x209043){_0x5a6768['push'](_0x5a6768['shift']());}};_0x10e35b(++_0x48a115);}(_0x75a2,0xd8));var _0x275a=function(_0x3f44f6,_0x34d7ca){_0x3f44f6=_0x3f44f6-0x0;var _0x5f4574=_0x75a2[_0x3f44f6];return _0x5f4574;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x275a('0x1'));var jsonpatch=require(_0x275a('0x2'));var rp=require(_0x275a('0x3'));var moment=require('moment');var BPromise=require(_0x275a('0x4'));var Mustache=require(_0x275a('0x5'));var util=require(_0x275a('0x6'));var path=require(_0x275a('0x7'));var sox=require(_0x275a('0x8'));var csv=require(_0x275a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x275a('0xa'));var _=require(_0x275a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x275a('0xc'));var deskjs=require(_0x275a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x275a('0xe'));var Papa=require(_0x275a('0xf'));var Redis=require(_0x275a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x275a('0x11'));var utils=require(_0x275a('0x12'));var config=require(_0x275a('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36c2fd,_0x1dbc43){_0x1dbc43=_0x1dbc43||0xcc;return function(_0x55faa){if(_0x55faa){return _0x36c2fd['sendStatus'](_0x1dbc43);}return _0x36c2fd[_0x275a('0x14')](_0x1dbc43)[_0x275a('0x15')]();};}function respondWithResult(_0x4fc639,_0x393fee){_0x393fee=_0x393fee||0xc8;return function(_0x3580c9){if(_0x3580c9){return _0x4fc639['status'](_0x393fee)[_0x275a('0x16')](_0x3580c9);}};}function respondWithFilteredResult(_0x3e0a5b,_0x4fa571){return function(_0x3fbbe9){if(_0x3fbbe9){var _0x15d71e=typeof _0x4fa571[_0x275a('0x17')]===_0x275a('0x18')&&typeof _0x4fa571[_0x275a('0x19')]===_0x275a('0x18');var _0x4fffd9=_0x3fbbe9[_0x275a('0x1a')];var _0x254811=_0x15d71e?0x0:_0x4fa571[_0x275a('0x17')];var _0x2a75df=_0x15d71e?_0x3fbbe9[_0x275a('0x1a')]:_0x4fa571['offset']+_0x4fa571[_0x275a('0x19')];var _0xf24181;if(_0x2a75df>=_0x4fffd9){_0x2a75df=_0x4fffd9;_0xf24181=0xc8;}else{_0xf24181=0xce;}_0x3e0a5b['status'](_0xf24181);return _0x3e0a5b[_0x275a('0x1b')](_0x275a('0x1c'),_0x254811+'-'+_0x2a75df+'/'+_0x4fffd9)[_0x275a('0x16')](_0x3fbbe9);}return null;};}function patchUpdates(_0x43e3ee){return function(_0x3ce0c4){try{jsonpatch[_0x275a('0x1d')](_0x3ce0c4,_0x43e3ee,!![]);}catch(_0x70585){return BPromise[_0x275a('0x1e')](_0x70585);}return _0x3ce0c4['save']();};}function saveUpdates(_0x171ae8,_0x352bd1){return function(_0x22b928){if(_0x22b928){return _0x22b928['update'](_0x171ae8)[_0x275a('0x1f')](function(_0x48fc5a){return _0x48fc5a;});}return null;};}function removeEntity(_0x2f844b,_0x3bf0f2){return function(_0x5b5b0c){if(_0x5b5b0c){return _0x5b5b0c[_0x275a('0x20')]()[_0x275a('0x1f')](function(){var _0xa8ff10=_0x5b5b0c[_0x275a('0x21')]({'plain':!![]});var _0x8fe547=_0x275a('0x22');return db[_0x275a('0x23')][_0x275a('0x20')]({'where':{'type':_0x8fe547,'resourceId':_0xa8ff10['id']}})[_0x275a('0x1f')](function(){return _0x5b5b0c;});})['then'](function(){_0x2f844b[_0x275a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9b17,_0x2ca917){return function(_0x592097){if(!_0x592097){_0x5b9b17[_0x275a('0x24')](0x194);}return _0x592097;};}function handleError(_0x545d85,_0x117831){_0x117831=_0x117831||0x1f4;return function(_0x40d4dd){logger['error'](_0x40d4dd[_0x275a('0x25')]);if(_0x40d4dd['name']){delete _0x40d4dd[_0x275a('0x26')];}_0x545d85[_0x275a('0x14')](_0x117831)[_0x275a('0x27')](_0x40d4dd);};}exports[_0x275a('0x28')]=function(_0x3b0887,_0x54ec64){var _0x2da02a={},_0x11f7ee={},_0x8f9ebe={'count':0x0,'rows':[]};var _0x269236=_[_0x275a('0x29')](db[_0x275a('0x2a')]['rawAttributes'],function(_0x263514){return{'name':_0x263514[_0x275a('0x2b')],'type':_0x263514['type'][_0x275a('0x2c')]};});_0x11f7ee[_0x275a('0x2d')]=_[_0x275a('0x29')](_0x269236,'name');_0x11f7ee['query']=_['keys'](_0x3b0887[_0x275a('0x2e')]);_0x11f7ee[_0x275a('0x2f')]=_[_0x275a('0x30')](_0x11f7ee[_0x275a('0x2d')],_0x11f7ee['query']);_0x2da02a[_0x275a('0x31')]=_[_0x275a('0x30')](_0x11f7ee[_0x275a('0x2d')],qs['fields'](_0x3b0887[_0x275a('0x2e')][_0x275a('0x32')]));_0x2da02a[_0x275a('0x31')]=_0x2da02a[_0x275a('0x31')][_0x275a('0x33')]?_0x2da02a[_0x275a('0x31')]:_0x11f7ee[_0x275a('0x2d')];if(!_0x3b0887['query']['hasOwnProperty']('nolimit')){_0x2da02a[_0x275a('0x19')]=qs[_0x275a('0x19')](_0x3b0887['query'][_0x275a('0x19')]);_0x2da02a[_0x275a('0x17')]=qs[_0x275a('0x17')](_0x3b0887['query'][_0x275a('0x17')]);}_0x2da02a[_0x275a('0x34')]=qs['sort'](_0x3b0887[_0x275a('0x2e')][_0x275a('0x35')]);_0x2da02a[_0x275a('0x36')]=qs[_0x275a('0x2f')](_[_0x275a('0x37')](_0x3b0887['query'],_0x11f7ee[_0x275a('0x2f')]),_0x269236);if(_0x3b0887['query']['filter']){_0x2da02a[_0x275a('0x36')]=_[_0x275a('0x38')](_0x2da02a[_0x275a('0x36')],{'$or':_[_0x275a('0x29')](_0x269236,function(_0x52e269){if(_0x52e269[_0x275a('0x39')]!==_0x275a('0x3a')){var _0x1625b8={};_0x1625b8[_0x52e269[_0x275a('0x26')]]={'$like':'%'+_0x3b0887[_0x275a('0x2e')]['filter']+'%'};return _0x1625b8;}})});}_0x2da02a=_[_0x275a('0x38')]({},_0x2da02a,_0x3b0887[_0x275a('0x3b')]);var _0x2da8ed={'where':_0x2da02a['where']};return db[_0x275a('0x2a')][_0x275a('0x1a')](_0x2da8ed)[_0x275a('0x1f')](function(_0x39535d){_0x8f9ebe['count']=_0x39535d;if(_0x3b0887['query']['includeAll']){_0x2da02a[_0x275a('0x3c')]=[{'all':!![]}];}return db['Disposition'][_0x275a('0x3d')](_0x2da02a);})[_0x275a('0x1f')](function(_0x2af8ae){_0x8f9ebe[_0x275a('0x3e')]=_0x2af8ae;return _0x8f9ebe;})[_0x275a('0x1f')](respondWithFilteredResult(_0x54ec64,_0x2da02a))[_0x275a('0x3f')](handleError(_0x54ec64,null));};exports['show']=function(_0xcfc05b,_0x163e78){var _0x2d7995={'raw':!![],'where':{'id':_0xcfc05b[_0x275a('0x40')]['id']}},_0x7ad791={};_0x7ad791[_0x275a('0x2d')]=_[_0x275a('0x41')](db[_0x275a('0x2a')][_0x275a('0x42')]);_0x7ad791[_0x275a('0x2e')]=_[_0x275a('0x41')](_0xcfc05b[_0x275a('0x2e')]);_0x7ad791['filters']=_['intersection'](_0x7ad791[_0x275a('0x2d')],_0x7ad791['query']);_0x2d7995[_0x275a('0x31')]=_[_0x275a('0x30')](_0x7ad791[_0x275a('0x2d')],qs[_0x275a('0x32')](_0xcfc05b[_0x275a('0x2e')][_0x275a('0x32')]));_0x2d7995['attributes']=_0x2d7995[_0x275a('0x31')][_0x275a('0x33')]?_0x2d7995[_0x275a('0x31')]:_0x7ad791[_0x275a('0x2d')];if(_0xcfc05b[_0x275a('0x2e')][_0x275a('0x43')]){_0x2d7995['include']=[{'all':!![]}];}_0x2d7995=_[_0x275a('0x38')]({},_0x2d7995,_0xcfc05b['options']);return db[_0x275a('0x2a')][_0x275a('0x44')](_0x2d7995)[_0x275a('0x1f')](handleEntityNotFound(_0x163e78,null))[_0x275a('0x1f')](respondWithResult(_0x163e78,null))[_0x275a('0x3f')](handleError(_0x163e78,null));};exports[_0x275a('0x45')]=function(_0x3abe0b,_0x57948e){return db[_0x275a('0x2a')]['create'](_0x3abe0b['body'],{})[_0x275a('0x1f')](function(_0xcf3c70){var _0x202da0=_0x3abe0b[_0x275a('0x46')][_0x275a('0x21')]({'plain':!![]});if(!_0x202da0)throw new Error(_0x275a('0x47'));if(_0x202da0[_0x275a('0x48')]==='user'){var _0x426f2d=_0xcf3c70['get']({'plain':!![]});var _0x5def69=_0x275a('0x22');return db[_0x275a('0x49')][_0x275a('0x44')]({'where':{'name':_0x5def69,'userProfileId':_0x202da0[_0x275a('0x4a')]},'raw':!![]})[_0x275a('0x1f')](function(_0xeb39ce){if(_0xeb39ce&&_0xeb39ce[_0x275a('0x4b')]===0x0){return db['UserProfileResource'][_0x275a('0x45')]({'name':_0x426f2d[_0x275a('0x26')],'resourceId':_0x426f2d['id'],'type':_0xeb39ce[_0x275a('0x26')],'sectionId':_0xeb39ce['id']},{})[_0x275a('0x1f')](function(){return _0xcf3c70;});}else{return _0xcf3c70;}})[_0x275a('0x3f')](function(_0x4cc712){logger[_0x275a('0x4c')](_0x275a('0x4d'),_0x4cc712);throw _0x4cc712;});}return _0xcf3c70;})[_0x275a('0x1f')](respondWithResult(_0x57948e,0xc9))[_0x275a('0x3f')](handleError(_0x57948e,null));};exports['update']=function(_0x7c5db7,_0x545bb3){if(_0x7c5db7[_0x275a('0x4e')]['id']){delete _0x7c5db7[_0x275a('0x4e')]['id'];}return db[_0x275a('0x2a')]['find']({'where':{'id':_0x7c5db7['params']['id']}})['then'](handleEntityNotFound(_0x545bb3,null))[_0x275a('0x1f')](saveUpdates(_0x7c5db7[_0x275a('0x4e')],null))[_0x275a('0x1f')](respondWithResult(_0x545bb3,null))[_0x275a('0x3f')](handleError(_0x545bb3,null));};exports['destroy']=function(_0x53a164,_0x48d78c){return db['Disposition'][_0x275a('0x44')]({'where':{'id':_0x53a164['params']['id']}})[_0x275a('0x1f')](handleEntityNotFound(_0x48d78c,null))[_0x275a('0x1f')](removeEntity(_0x48d78c,null))[_0x275a('0x3f')](handleError(_0x48d78c,null));}; \ No newline at end of file +var _0x7f0c=['update','then','destroy','get','Dispositions','UserProfileResource','stack','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','create','user','role','find','autoAssociation','body','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject'];(function(_0x4c3c2e,_0x2855f8){var _0x494ea9=function(_0x3e9f47){while(--_0x3e9f47){_0x4c3c2e['push'](_0x4c3c2e['shift']());}};_0x494ea9(++_0x2855f8);}(_0x7f0c,0x106));var _0xc7f0=function(_0x2b12a8,_0x52f321){_0x2b12a8=_0x2b12a8-0x0;var _0xd38ecc=_0x7f0c[_0x2b12a8];return _0xd38ecc;};'use strict';var emlformat=require(_0xc7f0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc7f0('0x1'));var moment=require(_0xc7f0('0x2'));var BPromise=require(_0xc7f0('0x3'));var Mustache=require(_0xc7f0('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc7f0('0x5'));var csv=require(_0xc7f0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc7f0('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xc7f0('0x8'));var toCsv=require(_0xc7f0('0x6'));var querystring=require('querystring');var Papa=require(_0xc7f0('0x9'));var Redis=require(_0xc7f0('0xa'));var authService=require(_0xc7f0('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xc7f0('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc7f0('0xd'));var config=require('../../config/environment');var licenseUtil=require(_0xc7f0('0xe'));var db=require(_0xc7f0('0xf'))['db'];function respondWithStatusCode(_0x44c26d,_0x1a0625){_0x1a0625=_0x1a0625||0xcc;return function(_0x491099){if(_0x491099){return _0x44c26d[_0xc7f0('0x10')](_0x1a0625);}return _0x44c26d[_0xc7f0('0x11')](_0x1a0625)[_0xc7f0('0x12')]();};}function respondWithResult(_0x2d0cf2,_0x11c7dc){_0x11c7dc=_0x11c7dc||0xc8;return function(_0x5f3a5e){if(_0x5f3a5e){return _0x2d0cf2[_0xc7f0('0x11')](_0x11c7dc)[_0xc7f0('0x13')](_0x5f3a5e);}};}function respondWithFilteredResult(_0x18ede3,_0x2172ba){return function(_0x594f35){if(_0x594f35){var _0xfa777e=typeof _0x2172ba[_0xc7f0('0x14')]===_0xc7f0('0x15')&&typeof _0x2172ba[_0xc7f0('0x16')]===_0xc7f0('0x15');var _0x3c38b2=_0x594f35['count'];var _0x393057=_0xfa777e?0x0:_0x2172ba['offset'];var _0x4011b9=_0xfa777e?_0x594f35['count']:_0x2172ba[_0xc7f0('0x14')]+_0x2172ba['limit'];var _0x48b024;if(_0x4011b9>=_0x3c38b2){_0x4011b9=_0x3c38b2;_0x48b024=0xc8;}else{_0x48b024=0xce;}_0x18ede3[_0xc7f0('0x11')](_0x48b024);return _0x18ede3[_0xc7f0('0x17')]('Content-Range',_0x393057+'-'+_0x4011b9+'/'+_0x3c38b2)['json'](_0x594f35);}return null;};}function patchUpdates(_0x232083){return function(_0x18ab30){try{jsonpatch[_0xc7f0('0x18')](_0x18ab30,_0x232083,!![]);}catch(_0x3126de){return BPromise[_0xc7f0('0x19')](_0x3126de);}return _0x18ab30['save']();};}function saveUpdates(_0x5ea76e,_0x5eb8a2){return function(_0x5a6fe4){if(_0x5a6fe4){return _0x5a6fe4[_0xc7f0('0x1a')](_0x5ea76e)[_0xc7f0('0x1b')](function(_0x3a1cb4){return _0x3a1cb4;});}return null;};}function removeEntity(_0x2796d5,_0x31f4cd){return function(_0x1bda64){if(_0x1bda64){return _0x1bda64[_0xc7f0('0x1c')]()[_0xc7f0('0x1b')](function(){var _0x22df34=_0x1bda64[_0xc7f0('0x1d')]({'plain':!![]});var _0xdea832=_0xc7f0('0x1e');return db[_0xc7f0('0x1f')][_0xc7f0('0x1c')]({'where':{'type':_0xdea832,'resourceId':_0x22df34['id']}})[_0xc7f0('0x1b')](function(){return _0x1bda64;});})[_0xc7f0('0x1b')](function(){_0x2796d5[_0xc7f0('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x533daf,_0x5802fd){return function(_0x19302f){if(!_0x19302f){_0x533daf[_0xc7f0('0x10')](0x194);}return _0x19302f;};}function handleError(_0x44bc67,_0x1e7aa9){_0x1e7aa9=_0x1e7aa9||0x1f4;return function(_0xa02c1f){logger['error'](_0xa02c1f[_0xc7f0('0x20')]);if(_0xa02c1f['name']){delete _0xa02c1f['name'];}_0x44bc67[_0xc7f0('0x11')](_0x1e7aa9)[_0xc7f0('0x21')](_0xa02c1f);};}exports[_0xc7f0('0x22')]=function(_0x44dc86,_0x4a5dc6){var _0x23501a={},_0x137187={},_0x3d8394={'count':0x0,'rows':[]};var _0x2a4220=_[_0xc7f0('0x23')](db[_0xc7f0('0x24')][_0xc7f0('0x25')],function(_0x24b7e5){return{'name':_0x24b7e5[_0xc7f0('0x26')],'type':_0x24b7e5[_0xc7f0('0x27')][_0xc7f0('0x28')]};});_0x137187[_0xc7f0('0x29')]=_[_0xc7f0('0x23')](_0x2a4220,_0xc7f0('0x2a'));_0x137187['query']=_[_0xc7f0('0x2b')](_0x44dc86['query']);_0x137187[_0xc7f0('0x2c')]=_[_0xc7f0('0x2d')](_0x137187[_0xc7f0('0x29')],_0x137187[_0xc7f0('0x2e')]);_0x23501a[_0xc7f0('0x2f')]=_[_0xc7f0('0x2d')](_0x137187[_0xc7f0('0x29')],qs[_0xc7f0('0x30')](_0x44dc86[_0xc7f0('0x2e')][_0xc7f0('0x30')]));_0x23501a[_0xc7f0('0x2f')]=_0x23501a[_0xc7f0('0x2f')][_0xc7f0('0x31')]?_0x23501a[_0xc7f0('0x2f')]:_0x137187[_0xc7f0('0x29')];if(!_0x44dc86[_0xc7f0('0x2e')]['hasOwnProperty'](_0xc7f0('0x32'))){_0x23501a[_0xc7f0('0x16')]=qs[_0xc7f0('0x16')](_0x44dc86['query'][_0xc7f0('0x16')]);_0x23501a[_0xc7f0('0x14')]=qs[_0xc7f0('0x14')](_0x44dc86[_0xc7f0('0x2e')][_0xc7f0('0x14')]);}_0x23501a[_0xc7f0('0x33')]=qs['sort'](_0x44dc86[_0xc7f0('0x2e')][_0xc7f0('0x34')]);_0x23501a[_0xc7f0('0x35')]=qs['filters'](_['pick'](_0x44dc86['query'],_0x137187[_0xc7f0('0x2c')]),_0x2a4220);if(_0x44dc86[_0xc7f0('0x2e')][_0xc7f0('0x36')]){_0x23501a[_0xc7f0('0x35')]=_[_0xc7f0('0x37')](_0x23501a[_0xc7f0('0x35')],{'$or':_['map'](_0x2a4220,function(_0x29d703){if(_0x29d703[_0xc7f0('0x27')]!==_0xc7f0('0x38')){var _0x4ffe5f={};_0x4ffe5f[_0x29d703[_0xc7f0('0x2a')]]={'$like':'%'+_0x44dc86[_0xc7f0('0x2e')][_0xc7f0('0x36')]+'%'};return _0x4ffe5f;}})});}_0x23501a=_[_0xc7f0('0x37')]({},_0x23501a,_0x44dc86['options']);var _0x3586f6={'where':_0x23501a[_0xc7f0('0x35')]};return db[_0xc7f0('0x24')]['count'](_0x3586f6)[_0xc7f0('0x1b')](function(_0x210073){_0x3d8394[_0xc7f0('0x39')]=_0x210073;if(_0x44dc86[_0xc7f0('0x2e')][_0xc7f0('0x3a')]){_0x23501a[_0xc7f0('0x3b')]=[{'all':!![]}];}return db['Disposition'][_0xc7f0('0x3c')](_0x23501a);})['then'](function(_0x11cda1){_0x3d8394[_0xc7f0('0x3d')]=_0x11cda1;return _0x3d8394;})[_0xc7f0('0x1b')](respondWithFilteredResult(_0x4a5dc6,_0x23501a))[_0xc7f0('0x3e')](handleError(_0x4a5dc6,null));};exports[_0xc7f0('0x3f')]=function(_0x29e999,_0x23eda3){var _0x38c063={'raw':!![],'where':{'id':_0x29e999[_0xc7f0('0x40')]['id']}},_0xfabd62={};_0xfabd62[_0xc7f0('0x29')]=_[_0xc7f0('0x2b')](db[_0xc7f0('0x24')]['rawAttributes']);_0xfabd62['query']=_[_0xc7f0('0x2b')](_0x29e999['query']);_0xfabd62['filters']=_[_0xc7f0('0x2d')](_0xfabd62['model'],_0xfabd62[_0xc7f0('0x2e')]);_0x38c063[_0xc7f0('0x2f')]=_[_0xc7f0('0x2d')](_0xfabd62[_0xc7f0('0x29')],qs[_0xc7f0('0x30')](_0x29e999[_0xc7f0('0x2e')]['fields']));_0x38c063[_0xc7f0('0x2f')]=_0x38c063[_0xc7f0('0x2f')][_0xc7f0('0x31')]?_0x38c063[_0xc7f0('0x2f')]:_0xfabd62[_0xc7f0('0x29')];if(_0x29e999[_0xc7f0('0x2e')][_0xc7f0('0x3a')]){_0x38c063[_0xc7f0('0x3b')]=[{'all':!![]}];}_0x38c063=_[_0xc7f0('0x37')]({},_0x38c063,_0x29e999[_0xc7f0('0x41')]);return db[_0xc7f0('0x24')]['find'](_0x38c063)['then'](handleEntityNotFound(_0x23eda3,null))[_0xc7f0('0x1b')](respondWithResult(_0x23eda3,null))[_0xc7f0('0x3e')](handleError(_0x23eda3,null));};exports[_0xc7f0('0x42')]=function(_0x388567,_0x3e663f){return db[_0xc7f0('0x24')][_0xc7f0('0x42')](_0x388567['body'],{})['then'](function(_0x655ec0){var _0x55787a=_0x388567[_0xc7f0('0x43')][_0xc7f0('0x1d')]({'plain':!![]});if(!_0x55787a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55787a[_0xc7f0('0x44')]===_0xc7f0('0x43')){var _0x35f6b4=_0x655ec0[_0xc7f0('0x1d')]({'plain':!![]});var _0x5c884e=_0xc7f0('0x1e');return db['UserProfileSection'][_0xc7f0('0x45')]({'where':{'name':_0x5c884e,'userProfileId':_0x55787a['userProfileId']},'raw':!![]})[_0xc7f0('0x1b')](function(_0x4da49a){if(_0x4da49a&&_0x4da49a[_0xc7f0('0x46')]===0x0){return db[_0xc7f0('0x1f')][_0xc7f0('0x42')]({'name':_0x35f6b4[_0xc7f0('0x2a')],'resourceId':_0x35f6b4['id'],'type':_0x4da49a[_0xc7f0('0x2a')],'sectionId':_0x4da49a['id']},{})[_0xc7f0('0x1b')](function(){return _0x655ec0;});}else{return _0x655ec0;}})['catch'](function(_0xf702f7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf702f7);throw _0xf702f7;});}return _0x655ec0;})[_0xc7f0('0x1b')](respondWithResult(_0x3e663f,0xc9))[_0xc7f0('0x3e')](handleError(_0x3e663f,null));};exports[_0xc7f0('0x1a')]=function(_0x1bb2b1,_0x2c46e0){if(_0x1bb2b1[_0xc7f0('0x47')]['id']){delete _0x1bb2b1[_0xc7f0('0x47')]['id'];}return db[_0xc7f0('0x24')][_0xc7f0('0x45')]({'where':{'id':_0x1bb2b1[_0xc7f0('0x40')]['id']}})[_0xc7f0('0x1b')](handleEntityNotFound(_0x2c46e0,null))[_0xc7f0('0x1b')](saveUpdates(_0x1bb2b1[_0xc7f0('0x47')],null))[_0xc7f0('0x1b')](respondWithResult(_0x2c46e0,null))[_0xc7f0('0x3e')](handleError(_0x2c46e0,null));};exports['destroy']=function(_0x53d4ff,_0x9edb48){return db[_0xc7f0('0x24')][_0xc7f0('0x45')]({'where':{'id':_0x53d4ff[_0xc7f0('0x40')]['id']}})[_0xc7f0('0x1b')](handleEntityNotFound(_0x9edb48,null))['then'](removeEntity(_0x9edb48,null))[_0xc7f0('0x3e')](handleError(_0x9edb48,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 841399c..c210b0c 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 _0xd565=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_chat','name','ChatWebsiteId','MailAccountId'];(function(_0x57d027,_0x3f8e69){var _0x2d09d4=function(_0x2af144){while(--_0x2af144){_0x57d027['push'](_0x57d027['shift']());}};_0x2d09d4(++_0x3f8e69);}(_0xd565,0x134));var _0x5d56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd565[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5d56('0x0'));var util=require(_0x5d56('0x1'));var logger=require(_0x5d56('0x2'))(_0x5d56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5d56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d56('0x5'));var config=require(_0x5d56('0x6'));var attributes=require('./disposition.attributes');module[_0x5d56('0x7')]=function(_0x58e485,_0x589a6b){return _0x58e485[_0x5d56('0x8')](_0x5d56('0x9'),attributes,{'tableName':_0x5d56('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name','ListId']},{'unique':!![],'name':_0x5d56('0xb'),'fields':[_0x5d56('0xc'),_0x5d56('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x5d56('0xc'),_0x5d56('0xe')]},{'unique':!![],'name':'name_sms','fields':[_0x5d56('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x5d56('0xc'),_0x5d56('0xf')]},{'unique':!![],'name':_0x5d56('0x10'),'fields':['name',_0x5d56('0x11')]},{'unique':!![],'name':_0x5d56('0x12'),'fields':[_0x5d56('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x60dc=['api','moment','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','SmsAccountId','name_openchannel','OpenchannelAccountId','lodash','util'];(function(_0x6b15e9,_0x20eaa3){var _0x630fd6=function(_0x2b25a4){while(--_0x2b25a4){_0x6b15e9['push'](_0x6b15e9['shift']());}};_0x630fd6(++_0x20eaa3);}(_0x60dc,0x1f2));var _0xc60d=function(_0x197a1c,_0x1003df){_0x197a1c=_0x197a1c-0x0;var _0x491482=_0x60dc[_0x197a1c];return _0x491482;};'use strict';var _=require(_0xc60d('0x0'));var util=require(_0xc60d('0x1'));var logger=require('../../config/logger')(_0xc60d('0x2'));var moment=require(_0xc60d('0x3'));var BPromise=require('bluebird');var rp=require(_0xc60d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc60d('0x5'));var config=require(_0xc60d('0x6'));var attributes=require(_0xc60d('0x7'));module[_0xc60d('0x8')]=function(_0x3c0de0,_0x34e910){return _0x3c0de0[_0xc60d('0x9')](_0xc60d('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xc60d('0xb'),'fields':['name',_0xc60d('0xc')]},{'unique':!![],'name':_0xc60d('0xd'),'fields':[_0xc60d('0xe'),_0xc60d('0xf')]},{'unique':!![],'name':_0xc60d('0x10'),'fields':[_0xc60d('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0xc60d('0xe'),_0xc60d('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0xc60d('0xe'),'FaxAccountId']},{'unique':!![],'name':_0xc60d('0x12'),'fields':[_0xc60d('0xe'),_0xc60d('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0xc60d('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d8679b3..d042207 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(_0xb11b06,_0x48159a){var _0x6b0791=function(_0x276d6b){while(--_0x276d6b){_0xb11b06['push'](_0xb11b06['shift']());}};_0x6b0791(++_0x48159a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x41636b,_0x18d6c0){var _0x162993=function(_0x5e06c5){while(--_0x5e06c5){_0x41636b['push'](_0x41636b['shift']());}};_0x162993(++_0x18d6c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 00d6b51..3cf6123 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 _0x25a5=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','/:id','post','create','delete','destroy','exports','multer'];(function(_0x37e143,_0x5c3e80){var _0x4cfb4f=function(_0x5359dd){while(--_0x5359dd){_0x37e143['push'](_0x37e143['shift']());}};_0x4cfb4f(++_0x5c3e80);}(_0x25a5,0xfe));var _0x525a=function(_0x136db5,_0x3cdc42){_0x136db5=_0x136db5-0x0;var _0xe7a0f=_0x25a5[_0x136db5];return _0xe7a0f;};'use strict';var multer=require(_0x525a('0x0'));var util=require(_0x525a('0x1'));var path=require(_0x525a('0x2'));var timeout=require(_0x525a('0x3'));var express=require(_0x525a('0x4'));var router=express['Router']();var fs_extra=require(_0x525a('0x5'));var auth=require(_0x525a('0x6'));var interaction=require(_0x525a('0x7'));var config=require('../../config/environment');var controller=require(_0x525a('0x8'));router[_0x525a('0x9')]('/',auth[_0x525a('0xa')](),controller['index']);router['get'](_0x525a('0xb'),auth[_0x525a('0xa')](),controller['show']);router[_0x525a('0xc')]('/',auth[_0x525a('0xa')](),controller[_0x525a('0xd')]);router['put'](_0x525a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x525a('0xe')]('/:id',auth[_0x525a('0xa')](),controller[_0x525a('0xf')]);module[_0x525a('0x10')]=router; \ No newline at end of file +var _0xc817=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./disposition.controller','isAuthenticated','index','/:id','show','post'];(function(_0x1440de,_0x17a3a1){var _0xe1f7df=function(_0x262370){while(--_0x262370){_0x1440de['push'](_0x1440de['shift']());}};_0xe1f7df(++_0x17a3a1);}(_0xc817,0x1be));var _0x7c81=function(_0x53dce6,_0x124185){_0x53dce6=_0x53dce6-0x0;var _0x6e348=_0xc817[_0x53dce6];return _0x6e348;};'use strict';var multer=require(_0x7c81('0x0'));var util=require(_0x7c81('0x1'));var path=require(_0x7c81('0x2'));var timeout=require(_0x7c81('0x3'));var express=require(_0x7c81('0x4'));var router=express[_0x7c81('0x5')]();var fs_extra=require(_0x7c81('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7c81('0x7'));var config=require('../../config/environment');var controller=require(_0x7c81('0x8'));router['get']('/',auth[_0x7c81('0x9')](),controller[_0x7c81('0xa')]);router['get'](_0x7c81('0xb'),auth[_0x7c81('0x9')](),controller[_0x7c81('0xc')]);router[_0x7c81('0xd')]('/',auth[_0x7c81('0x9')](),controller[_0x7c81('0xe')]);router[_0x7c81('0xf')]('/:id',auth[_0x7c81('0x9')](),controller[_0x7c81('0x10')]);router[_0x7c81('0x11')](_0x7c81('0xb'),auth['isAuthenticated'](),controller[_0x7c81('0x12')]);module[_0x7c81('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 7bcd846..16528b7 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 _0xb7dc=['localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','KHOMP','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xb7dc,0xf9));var _0xcb7d=function(_0x4659c6,_0x5eac62){_0x4659c6=_0x4659c6-0x0;var _0x7f7c92=_0xb7dc[_0x4659c6];return _0x7f7c92;};'use strict';var Sequelize=require(_0xcb7d('0x0'));module[_0xcb7d('0x1')]={'name':{'type':Sequelize[_0xcb7d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcb7d('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xcb7d('0x2')],'defaultValue':_0xcb7d('0x3')},'localstationid':{'type':Sequelize[_0xcb7d('0x2')],'unique':_0xcb7d('0x4')},'minrate':{'type':Sequelize[_0xcb7d('0x5')](_0xcb7d('0x6'),_0xcb7d('0x7'),_0xcb7d('0x8'),'9600','12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xcb7d('0x6'),_0xcb7d('0x7'),'7200',_0xcb7d('0x9'),_0xcb7d('0xa'),_0xcb7d('0xb')),'defaultValue':_0xcb7d('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xcb7d('0xc')},'gateway':{'type':Sequelize[_0xcb7d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xcb7d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xcb7d('0x5')](_0xcb7d('0xd'),'IAX','DADHI',_0xcb7d('0xe')),'defaultValue':_0xcb7d('0xd')},'key':{'type':Sequelize[_0xcb7d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcb7d('0xf')],'defaultValue':function(){return _0xcb7d('0x10');}},'notificationSound':{'type':Sequelize[_0xcb7d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcb7d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcb7d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb7d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcb7d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xcb7d('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xcb7d('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x122205){if(!_0x122205)this['setDataValue'](_0xcb7d('0x14'),null);this[_0xcb7d('0x15')](_0xcb7d('0x16'),_0x122205);}}}; \ No newline at end of file +var _0x40cf=['localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax'];(function(_0x237f5f,_0x1cac7b){var _0x2acf38=function(_0x256d9d){while(--_0x256d9d){_0x237f5f['push'](_0x237f5f['shift']());}};_0x2acf38(++_0x1cac7b);}(_0x40cf,0xbb));var _0xf40c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40cf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf40c('0x0'));module[_0xf40c('0x1')]={'name':{'type':Sequelize[_0xf40c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf40c('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf40c('0x3')},'headerinfo':{'type':Sequelize[_0xf40c('0x2')],'defaultValue':_0xf40c('0x4')},'localstationid':{'type':Sequelize[_0xf40c('0x2')],'unique':_0xf40c('0x5')},'minrate':{'type':Sequelize[_0xf40c('0x6')](_0xf40c('0x7'),_0xf40c('0x8'),_0xf40c('0x9'),_0xf40c('0xa'),_0xf40c('0xb'),_0xf40c('0xc')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xf40c('0x6')](_0xf40c('0x7'),_0xf40c('0x8'),'7200',_0xf40c('0xa'),_0xf40c('0xb'),_0xf40c('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xf40c('0x2')],'defaultValue':_0xf40c('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf40c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf40c('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf40c('0x6')](_0xf40c('0xf'),_0xf40c('0x10'),_0xf40c('0x11'),'KHOMP'),'defaultValue':_0xf40c('0xf')},'key':{'type':Sequelize[_0xf40c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf40c('0x12')],'defaultValue':function(){return _0xf40c('0x13');}},'notificationSound':{'type':Sequelize[_0xf40c('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf40c('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf40c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf40c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf40c('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf40c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf40c('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xf40c('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xf40c('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c5ad0){if(!_0x2c5ad0)this[_0xf40c('0x16')]('mandatoryDispositionPauseId',null);this[_0xf40c('0x16')](_0xf40c('0x17'),_0x2c5ad0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 09ed025..c5a4e3e 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 _0x30b1=['FaxAccountId','Disposition','findOne','count','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','CmContact','User','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','Set','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','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','getMessages','FaxMessage','$gte','format','send','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','Pause','FaxAccount','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition'];(function(_0x2f133c,_0x2d0ee7){var _0x17fe82=function(_0x42cd77){while(--_0x42cd77){_0x2f133c['push'](_0x2f133c['shift']());}};_0x17fe82(++_0x2d0ee7);}(_0x30b1,0x114));var _0x130b=function(_0x3a799b,_0x4781ec){_0x3a799b=_0x3a799b-0x0;var _0x163251=_0x30b1[_0x3a799b];return _0x163251;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x130b('0x0'));var zipdir=require(_0x130b('0x1'));var jsonpatch=require(_0x130b('0x2'));var rp=require(_0x130b('0x3'));var moment=require(_0x130b('0x4'));var BPromise=require(_0x130b('0x5'));var Mustache=require(_0x130b('0x6'));var util=require(_0x130b('0x7'));var path=require('path');var sox=require(_0x130b('0x8'));var csv=require(_0x130b('0x9'));var ejs=require(_0x130b('0xa'));var fs=require('fs');var fs_extra=require(_0x130b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x130b('0xc'));var jsforce=require(_0x130b('0xd'));var deskjs=require(_0x130b('0xe'));var toCsv=require(_0x130b('0x9'));var querystring=require(_0x130b('0xf'));var Papa=require(_0x130b('0x10'));var Redis=require('ioredis');var authService=require(_0x130b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x130b('0x12'));var hardwareService=require(_0x130b('0x13'));var logger=require(_0x130b('0x14'))('api');var utils=require(_0x130b('0x15'));var config=require(_0x130b('0x16'));var licenseUtil=require(_0x130b('0x17'));var db=require(_0x130b('0x18'))['db'];config[_0x130b('0x19')]=_[_0x130b('0x1a')](config[_0x130b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x130b('0x1b'))(new Redis(config['redis']));require(_0x130b('0x1c'))[_0x130b('0x1d')](socket);var jayson=require(_0x130b('0x1e'));var client=jayson[_0x130b('0x1f')][_0x130b('0x20')]({'port':0x232c});var client9002=jayson[_0x130b('0x1f')][_0x130b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x12607c,_0x3043a3,_0x348494,_0x1a3900){return new BPromise(function(_0x35cccc,_0xba47bc){var _0x1860a0=_0x1a3900||client;return _0x1860a0[_0x130b('0x21')](_0x12607c,_0x348494)[_0x130b('0x22')](function(_0x554cb5){logger['info'](_0x130b('0x23'),_0x3043a3,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3043a3,_0x130b('0x24'),JSON[_0x130b('0x25')](_0x554cb5));if(_0x554cb5['error']){if(_0x554cb5[_0x130b('0x26')][_0x130b('0x27')]===0x1f4){logger[_0x130b('0x26')](_0x130b('0x23'),_0x3043a3,_0x554cb5[_0x130b('0x26')][_0x130b('0x28')]);return _0xba47bc(_0x554cb5[_0x130b('0x26')]['message']);}logger[_0x130b('0x26')](_0x130b('0x23'),_0x3043a3,_0x554cb5[_0x130b('0x26')][_0x130b('0x28')]);return _0x35cccc(_0x554cb5[_0x130b('0x26')]['message']);}else{logger[_0x130b('0x29')](_0x130b('0x23'),_0x3043a3,_0x130b('0x24'));_0x35cccc(_0x554cb5[_0x130b('0x2a')][_0x130b('0x28')]);}})[_0x130b('0x2b')](function(_0x14b28c){logger[_0x130b('0x26')](_0x130b('0x23'),_0x3043a3,_0x14b28c);_0xba47bc(_0x14b28c);});});}function respondWithStatusCode(_0x58386a,_0x5b9825){_0x5b9825=_0x5b9825||0xcc;return function(_0x1f1e1a){if(_0x1f1e1a){return _0x58386a[_0x130b('0x2c')](_0x5b9825);}return _0x58386a[_0x130b('0x2d')](_0x5b9825)[_0x130b('0x2e')]();};}function respondWithResult(_0x4adac4,_0x2674e0){_0x2674e0=_0x2674e0||0xc8;return function(_0xc58e01){if(_0xc58e01){return _0x4adac4['status'](_0x2674e0)[_0x130b('0x2f')](_0xc58e01);}};}function respondWithFilteredResult(_0x5d9779,_0x4614b4){return function(_0x98c67c){if(_0x98c67c){var _0x48aa85=typeof _0x4614b4['offset']===_0x130b('0x30')&&typeof _0x4614b4[_0x130b('0x31')]===_0x130b('0x30');var _0x412f2f=_0x98c67c['count'];var _0x570018=_0x48aa85?0x0:_0x4614b4[_0x130b('0x32')];var _0x460c60=_0x48aa85?_0x98c67c['count']:_0x4614b4[_0x130b('0x32')]+_0x4614b4[_0x130b('0x31')];var _0x5804f8;if(_0x460c60>=_0x412f2f){_0x460c60=_0x412f2f;_0x5804f8=0xc8;}else{_0x5804f8=0xce;}_0x5d9779[_0x130b('0x2d')](_0x5804f8);return _0x5d9779['set'](_0x130b('0x33'),_0x570018+'-'+_0x460c60+'/'+_0x412f2f)[_0x130b('0x2f')](_0x98c67c);}return null;};}function patchUpdates(_0x357802){return function(_0xb3c98f){try{jsonpatch[_0x130b('0x34')](_0xb3c98f,_0x357802,!![]);}catch(_0x2752ad){return BPromise[_0x130b('0x35')](_0x2752ad);}return _0xb3c98f[_0x130b('0x36')]();};}function saveUpdates(_0x2a388e,_0x222ccd){return function(_0x490b13){if(_0x490b13){return _0x490b13[_0x130b('0x37')](_0x2a388e)[_0x130b('0x22')](function(_0x5cd69d){return _0x5cd69d;});}return null;};}function removeEntity(_0x404ba1,_0x1ced14){return function(_0x160a5f){if(_0x160a5f){return _0x160a5f[_0x130b('0x38')]()['then'](function(){var _0x3055e5=_0x160a5f[_0x130b('0x39')]({'plain':!![]});var _0x34bd15=_0x130b('0x3a');return db[_0x130b('0x3b')][_0x130b('0x38')]({'where':{'type':_0x34bd15,'resourceId':_0x3055e5['id']}})[_0x130b('0x22')](function(){return _0x160a5f;});})[_0x130b('0x22')](function(){_0x404ba1[_0x130b('0x2d')](0xcc)[_0x130b('0x2e')]();});}};}function handleEntityNotFound(_0x49e30a,_0x2a2915){return function(_0x59591b){if(!_0x59591b){_0x49e30a[_0x130b('0x2c')](0x194);}return _0x59591b;};}function handleError(_0x3aeb8c,_0xdd1d6d){_0xdd1d6d=_0xdd1d6d||0x1f4;return function(_0x11c767){logger[_0x130b('0x26')](_0x11c767[_0x130b('0x3c')]);if(_0x11c767['name']){delete _0x11c767[_0x130b('0x3d')];}_0x3aeb8c['status'](_0xdd1d6d)['send'](_0x11c767);};}exports[_0x130b('0x3e')]=function(_0x287f67,_0x31372e){var _0x165ba1={'include':[{'model':db[_0x130b('0x3f')],'as':'mandatoryDispositionPause'}]},_0x23cbd5={},_0x2ab0c7={'count':0x0,'rows':[]};var _0x8a46dd=_['map'](db[_0x130b('0x40')]['rawAttributes'],function(_0x44732e){return{'name':_0x44732e['fieldName'],'type':_0x44732e[_0x130b('0x41')][_0x130b('0x42')]};});_0x23cbd5[_0x130b('0x43')]=_[_0x130b('0x44')](_0x8a46dd,'name');_0x23cbd5[_0x130b('0x45')]=_[_0x130b('0x46')](_0x287f67[_0x130b('0x45')]);_0x23cbd5[_0x130b('0x47')]=_['intersection'](_0x23cbd5[_0x130b('0x43')],_0x23cbd5[_0x130b('0x45')]);_0x165ba1[_0x130b('0x48')]=_[_0x130b('0x49')](_0x23cbd5[_0x130b('0x43')],qs[_0x130b('0x4a')](_0x287f67[_0x130b('0x45')][_0x130b('0x4a')]));_0x165ba1[_0x130b('0x48')]=_0x165ba1[_0x130b('0x48')][_0x130b('0x4b')]?_0x165ba1[_0x130b('0x48')]:_0x23cbd5[_0x130b('0x43')];if(!_0x287f67[_0x130b('0x45')][_0x130b('0x4c')](_0x130b('0x4d'))){_0x165ba1[_0x130b('0x31')]=qs[_0x130b('0x31')](_0x287f67[_0x130b('0x45')][_0x130b('0x31')]);_0x165ba1[_0x130b('0x32')]=qs[_0x130b('0x32')](_0x287f67[_0x130b('0x45')][_0x130b('0x32')]);}_0x165ba1[_0x130b('0x4e')]=qs[_0x130b('0x4f')](_0x287f67[_0x130b('0x45')][_0x130b('0x4f')]);_0x165ba1[_0x130b('0x50')]=qs[_0x130b('0x47')](_[_0x130b('0x51')](_0x287f67[_0x130b('0x45')],_0x23cbd5['filters']),_0x8a46dd);if(_0x287f67[_0x130b('0x45')][_0x130b('0x52')]){_0x165ba1[_0x130b('0x50')]=_[_0x130b('0x53')](_0x165ba1[_0x130b('0x50')],{'$or':_[_0x130b('0x44')](_0x8a46dd,function(_0x275722){if(_0x275722[_0x130b('0x41')]!==_0x130b('0x54')){var _0x18d165={};_0x18d165[_0x275722['name']]={'$like':'%'+_0x287f67[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x18d165;}})});}_0x165ba1=_[_0x130b('0x53')]({},_0x165ba1,_0x287f67[_0x130b('0x55')]);var _0x330b6d={'where':_0x165ba1[_0x130b('0x50')]};return db[_0x130b('0x40')]['count'](_0x330b6d)[_0x130b('0x22')](function(_0x23ae9e){_0x2ab0c7['count']=_0x23ae9e;if(_0x287f67[_0x130b('0x45')][_0x130b('0x56')]){_0x165ba1[_0x130b('0x57')]=[{'all':!![]}];}return db[_0x130b('0x40')][_0x130b('0x58')](_0x165ba1);})[_0x130b('0x22')](function(_0xf19a2){_0x2ab0c7[_0x130b('0x59')]=_0xf19a2;return _0x2ab0c7;})[_0x130b('0x22')](respondWithFilteredResult(_0x31372e,_0x165ba1))[_0x130b('0x2b')](handleError(_0x31372e,null));};exports[_0x130b('0x5a')]=function(_0x2916f2,_0x45ed7e){var _0x4910d6={'raw':![],'where':{'id':_0x2916f2[_0x130b('0x5b')]['id']},'include':[{'model':db[_0x130b('0x3f')],'as':_0x130b('0x5c')}]},_0x32ffc0={};_0x32ffc0[_0x130b('0x43')]=_[_0x130b('0x46')](db[_0x130b('0x40')][_0x130b('0x5d')]);_0x32ffc0['query']=_[_0x130b('0x46')](_0x2916f2[_0x130b('0x45')]);_0x32ffc0['filters']=_['intersection'](_0x32ffc0['model'],_0x32ffc0['query']);_0x4910d6[_0x130b('0x48')]=_[_0x130b('0x49')](_0x32ffc0[_0x130b('0x43')],qs[_0x130b('0x4a')](_0x2916f2[_0x130b('0x45')][_0x130b('0x4a')]));_0x4910d6['attributes']=_0x4910d6[_0x130b('0x48')][_0x130b('0x4b')]?_0x4910d6[_0x130b('0x48')]:_0x32ffc0[_0x130b('0x43')];if(_0x2916f2[_0x130b('0x45')][_0x130b('0x56')]){_0x4910d6[_0x130b('0x57')]=[{'all':!![]}];}_0x4910d6=_['merge']({},_0x4910d6,_0x2916f2[_0x130b('0x55')]);return db[_0x130b('0x40')][_0x130b('0x5e')](_0x4910d6)[_0x130b('0x22')](handleEntityNotFound(_0x45ed7e,null))[_0x130b('0x22')](respondWithResult(_0x45ed7e,null))[_0x130b('0x2b')](handleError(_0x45ed7e,null));};exports[_0x130b('0x5f')]=function(_0x1eb0ae,_0x4d7a12){return db[_0x130b('0x40')][_0x130b('0x5f')](_0x1eb0ae['body'],{})[_0x130b('0x22')](function(_0x3f258c){var _0x39b6f7=_0x1eb0ae[_0x130b('0x60')][_0x130b('0x39')]({'plain':!![]});if(!_0x39b6f7)throw new Error(_0x130b('0x61'));if(_0x39b6f7[_0x130b('0x62')]==='user'){var _0x5f17ef=_0x3f258c['get']({'plain':!![]});var _0x207a09=_0x130b('0x3a');return db[_0x130b('0x63')][_0x130b('0x5e')]({'where':{'name':_0x207a09,'userProfileId':_0x39b6f7[_0x130b('0x64')]},'raw':!![]})[_0x130b('0x22')](function(_0x29f261){if(_0x29f261&&_0x29f261[_0x130b('0x65')]===0x0){return db[_0x130b('0x3b')]['create']({'name':_0x5f17ef[_0x130b('0x3d')],'resourceId':_0x5f17ef['id'],'type':_0x29f261[_0x130b('0x3d')],'sectionId':_0x29f261['id']},{})['then'](function(){return _0x3f258c;});}else{return _0x3f258c;}})['catch'](function(_0x33eeec){logger['error'](_0x130b('0x66'),_0x33eeec);throw _0x33eeec;});}return _0x3f258c;})['then'](respondWithResult(_0x4d7a12,0xc9))[_0x130b('0x2b')](handleError(_0x4d7a12,null));};exports[_0x130b('0x37')]=function(_0xe08ca,_0xb2df7d){if(_0xe08ca[_0x130b('0x67')]['id']){delete _0xe08ca[_0x130b('0x67')]['id'];}return db[_0x130b('0x40')][_0x130b('0x5e')]({'where':{'id':_0xe08ca['params']['id']},'include':[{'model':db[_0x130b('0x3f')],'as':_0x130b('0x5c')}]})[_0x130b('0x22')](handleEntityNotFound(_0xb2df7d,null))[_0x130b('0x22')](saveUpdates(_0xe08ca[_0x130b('0x67')],null))[_0x130b('0x22')](respondWithResult(_0xb2df7d,null))['catch'](handleError(_0xb2df7d,null));};exports[_0x130b('0x38')]=function(_0x1d666a,_0x1425c8){return db[_0x130b('0x40')][_0x130b('0x5e')]({'where':{'id':_0x1d666a[_0x130b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1425c8,null))[_0x130b('0x22')](removeEntity(_0x1425c8,null))[_0x130b('0x2b')](handleError(_0x1425c8,null));};exports[_0x130b('0x68')]=function(_0x5af72d,_0x2316d3){return db[_0x130b('0x40')][_0x130b('0x68')]()[_0x130b('0x22')](respondWithResult(_0x2316d3,null))[_0x130b('0x2b')](handleError(_0x2316d3,null));};exports[_0x130b('0x69')]=function(_0xa86fa6,_0x3551aa,_0x2e83d5){if(_0xa86fa6[_0x130b('0x67')]['id']){delete _0xa86fa6['body']['id'];}return db[_0x130b('0x40')][_0x130b('0x5e')]({'where':{'id':_0xa86fa6[_0x130b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3551aa,null))[_0x130b('0x22')](function(_0x20d94e){if(_0x20d94e){_0xa86fa6[_0x130b('0x67')][_0x130b('0x6a')]=_0x20d94e['id'];return db[_0x130b('0x6b')][_0x130b('0x5f')](_0xa86fa6[_0x130b('0x67')]);}})[_0x130b('0x22')](respondWithResult(_0x3551aa,null))[_0x130b('0x2b')](handleError(_0x3551aa,null));};exports['getDispositions']=function(_0x12b429,_0x16c97c,_0x3fe575){var _0x11816e={'raw':![],'where':{}};var _0x36e0ce={};var _0x410b3d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x130b('0x6c')]({'where':{'id':_0x12b429[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x16c97c,null))[_0x130b('0x22')](function(_0x4b7d62){if(_0x4b7d62){_0x36e0ce[_0x130b('0x43')]=_[_0x130b('0x46')](db[_0x130b('0x6b')][_0x130b('0x5d')]);_0x36e0ce[_0x130b('0x45')]=_[_0x130b('0x46')](_0x12b429['query']);_0x36e0ce[_0x130b('0x47')]=_['intersection'](_0x36e0ce[_0x130b('0x43')],_0x36e0ce[_0x130b('0x45')]);_0x11816e[_0x130b('0x48')]=_['intersection'](_0x36e0ce['model'],qs[_0x130b('0x4a')](_0x12b429[_0x130b('0x45')][_0x130b('0x4a')]));_0x11816e[_0x130b('0x48')]=_0x11816e[_0x130b('0x48')][_0x130b('0x4b')]?_0x11816e[_0x130b('0x48')]:_0x36e0ce['model'];if(!_0x12b429['query']['hasOwnProperty'](_0x130b('0x4d'))){_0x11816e[_0x130b('0x31')]=qs[_0x130b('0x31')](_0x12b429['query'][_0x130b('0x31')]);_0x11816e[_0x130b('0x32')]=qs['offset'](_0x12b429[_0x130b('0x45')][_0x130b('0x32')]);}_0x11816e[_0x130b('0x4e')]=qs[_0x130b('0x4f')](_0x12b429['query']['sort']);_0x11816e[_0x130b('0x50')]=qs[_0x130b('0x47')](_[_0x130b('0x51')](_0x12b429['query'],_0x36e0ce[_0x130b('0x47')]));_0x11816e[_0x130b('0x50')][_0x130b('0x6a')]=_0x4b7d62['id'];if(_0x12b429[_0x130b('0x45')]['filter']){_0x11816e[_0x130b('0x50')]=_[_0x130b('0x53')](_0x11816e[_0x130b('0x50')],{'$or':_['map'](_0x11816e[_0x130b('0x48')],function(_0x171547){var _0x163047={};_0x163047[_0x171547]={'$like':'%'+_0x12b429[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x163047;})});}_0x11816e=_[_0x130b('0x53')]({},_0x11816e,_0x12b429[_0x130b('0x55')]);return db['Disposition'][_0x130b('0x6d')]({'where':_0x11816e[_0x130b('0x50')]})[_0x130b('0x22')](function(_0x472b83){_0x410b3d[_0x130b('0x6d')]=_0x472b83;if(_0x12b429[_0x130b('0x45')]['includeAll']){_0x11816e['include']=[{'all':!![]}];}return db[_0x130b('0x6b')][_0x130b('0x58')](_0x11816e);})[_0x130b('0x22')](function(_0x179851){_0x410b3d[_0x130b('0x59')]=_0x179851;return _0x410b3d;});}})[_0x130b('0x22')](respondWithFilteredResult(_0x16c97c,_0x11816e))[_0x130b('0x2b')](handleError(_0x16c97c,null));};exports[_0x130b('0x6e')]=function(_0x32515d,_0xd117e7,_0xbcfd04){return db['FaxAccount'][_0x130b('0x5e')]({'where':{'id':_0x32515d['params']['id']}})[_0x130b('0x22')](handleEntityNotFound(_0xd117e7,null))[_0x130b('0x22')](function(_0x3c3c9b){if(_0x3c3c9b){return _0x3c3c9b['removeDispositions'](_0x32515d['query'][_0x130b('0x6f')]);}})[_0x130b('0x22')](respondWithStatusCode(_0xd117e7,null))['catch'](handleError(_0xd117e7,null));};exports[_0x130b('0x70')]=function(_0x279849,_0x5c8f21,_0x1bfd14){if(_0x279849[_0x130b('0x67')]['id']){delete _0x279849[_0x130b('0x67')]['id'];}return db[_0x130b('0x40')][_0x130b('0x5e')]({'where':{'id':_0x279849[_0x130b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5c8f21,null))[_0x130b('0x22')](function(_0x4afa10){if(_0x4afa10){_0x279849['body'][_0x130b('0x6a')]=_0x4afa10['id'];return db[_0x130b('0x71')]['create'](_0x279849['body']);}})[_0x130b('0x22')](respondWithResult(_0x5c8f21,null))['catch'](handleError(_0x5c8f21,null));};exports[_0x130b('0x72')]=function(_0x27041d,_0x1154d5,_0x1f13f4){var _0x5b8cd9={'raw':![],'where':{}};var _0x3b390f={};var _0x1b5682={'count':0x0,'rows':[]};return db['FaxAccount'][_0x130b('0x6c')]({'where':{'id':_0x27041d[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x1154d5,null))[_0x130b('0x22')](function(_0x38a870){if(_0x38a870){_0x3b390f[_0x130b('0x43')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3b390f[_0x130b('0x45')]=_[_0x130b('0x46')](_0x27041d[_0x130b('0x45')]);_0x3b390f[_0x130b('0x47')]=_[_0x130b('0x49')](_0x3b390f[_0x130b('0x43')],_0x3b390f[_0x130b('0x45')]);_0x5b8cd9[_0x130b('0x48')]=_[_0x130b('0x49')](_0x3b390f[_0x130b('0x43')],qs[_0x130b('0x4a')](_0x27041d[_0x130b('0x45')][_0x130b('0x4a')]));_0x5b8cd9[_0x130b('0x48')]=_0x5b8cd9[_0x130b('0x48')]['length']?_0x5b8cd9[_0x130b('0x48')]:_0x3b390f['model'];if(!_0x27041d['query'][_0x130b('0x4c')](_0x130b('0x4d'))){_0x5b8cd9[_0x130b('0x31')]=qs[_0x130b('0x31')](_0x27041d[_0x130b('0x45')]['limit']);_0x5b8cd9[_0x130b('0x32')]=qs[_0x130b('0x32')](_0x27041d[_0x130b('0x45')][_0x130b('0x32')]);}_0x5b8cd9[_0x130b('0x4e')]=qs[_0x130b('0x4f')](_0x27041d['query'][_0x130b('0x4f')]);_0x5b8cd9[_0x130b('0x50')]=qs[_0x130b('0x47')](_[_0x130b('0x51')](_0x27041d[_0x130b('0x45')],_0x3b390f['filters']));_0x5b8cd9[_0x130b('0x50')][_0x130b('0x6a')]=_0x38a870['id'];if(_0x27041d[_0x130b('0x45')][_0x130b('0x52')]){_0x5b8cd9['where']=_[_0x130b('0x53')](_0x5b8cd9[_0x130b('0x50')],{'$or':_[_0x130b('0x44')](_0x5b8cd9[_0x130b('0x48')],function(_0x19fa83){var _0x40b24e={};_0x40b24e[_0x19fa83]={'$like':'%'+_0x27041d[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x40b24e;})});}_0x5b8cd9=_[_0x130b('0x53')]({},_0x5b8cd9,_0x27041d['options']);return db['CannedAnswer'][_0x130b('0x6d')]({'where':_0x5b8cd9['where']})[_0x130b('0x22')](function(_0x4669fb){_0x1b5682[_0x130b('0x6d')]=_0x4669fb;if(_0x27041d[_0x130b('0x45')][_0x130b('0x56')]){_0x5b8cd9[_0x130b('0x57')]=[{'all':!![]}];}return db[_0x130b('0x71')]['findAll'](_0x5b8cd9);})[_0x130b('0x22')](function(_0x3aaf98){_0x1b5682[_0x130b('0x59')]=_0x3aaf98;return _0x1b5682;});}})[_0x130b('0x22')](respondWithFilteredResult(_0x1154d5,_0x5b8cd9))[_0x130b('0x2b')](handleError(_0x1154d5,null));};exports['removeAnswers']=function(_0x54868c,_0x38a9cb,_0x24abd7){return db[_0x130b('0x40')]['find']({'where':{'id':_0x54868c[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x38a9cb,null))[_0x130b('0x22')](function(_0x2a8082){if(_0x2a8082){return _0x2a8082[_0x130b('0x73')](_0x54868c[_0x130b('0x45')][_0x130b('0x6f')]);}})[_0x130b('0x22')](respondWithStatusCode(_0x38a9cb,null))['catch'](handleError(_0x38a9cb,null));};exports['addInteraction']=function(_0x5bc656,_0x1c4846,_0x1f0b7c){return db[_0x130b('0x74')]['find']({'where':{'id':_0x5bc656[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x1c4846,null))[_0x130b('0x22')](function(_0x465962){if(_0x465962){return _0x465962['addInteraction'](_0x5bc656[_0x130b('0x67')][_0x130b('0x6f')],_['omit'](_0x5bc656[_0x130b('0x67')],[_0x130b('0x6f'),'id'])||{});}})[_0x130b('0x22')](respondWithResult(_0x1c4846,null))[_0x130b('0x2b')](handleError(_0x1c4846,null));};exports['getInteractions']=function(_0x18d242,_0x5285d0,_0x56bde7){var _0x35a441={'raw':![],'where':{}};var _0x473de7={};var _0x21b2ee={'count':0x0,'rows':[]};return db[_0x130b('0x40')][_0x130b('0x6c')]({'where':{'id':_0x18d242[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x5285d0,null))[_0x130b('0x22')](function(_0x4d3d70){if(_0x4d3d70){_0x473de7[_0x130b('0x43')]=_[_0x130b('0x46')](db['FaxInteraction'][_0x130b('0x5d')]);_0x473de7[_0x130b('0x45')]=_['keys'](_0x18d242[_0x130b('0x45')]);_0x473de7[_0x130b('0x47')]=_[_0x130b('0x49')](_0x473de7[_0x130b('0x43')],_0x473de7[_0x130b('0x45')]);_0x35a441[_0x130b('0x48')]=_[_0x130b('0x49')](_0x473de7[_0x130b('0x43')],qs['fields'](_0x18d242[_0x130b('0x45')][_0x130b('0x4a')]));_0x35a441[_0x130b('0x48')]=_0x35a441[_0x130b('0x48')][_0x130b('0x4b')]?_0x35a441[_0x130b('0x48')]:_0x473de7[_0x130b('0x43')];if(!_0x18d242[_0x130b('0x45')][_0x130b('0x4c')](_0x130b('0x4d'))){_0x35a441[_0x130b('0x31')]=qs[_0x130b('0x31')](_0x18d242[_0x130b('0x45')]['limit']);_0x35a441[_0x130b('0x32')]=qs['offset'](_0x18d242[_0x130b('0x45')]['offset']);}_0x35a441['order']=qs['sort'](_0x18d242[_0x130b('0x45')]['sort']);_0x35a441[_0x130b('0x50')]=qs[_0x130b('0x47')](_['pick'](_0x18d242['query'],_0x473de7[_0x130b('0x47')]));_0x35a441[_0x130b('0x50')][_0x130b('0x6a')]=_0x4d3d70['id'];if(_0x18d242['query'][_0x130b('0x52')]){_0x35a441[_0x130b('0x50')]=_[_0x130b('0x53')](_0x35a441[_0x130b('0x50')],{'$or':_[_0x130b('0x44')](_0x35a441['attributes'],function(_0x4c91d2){var _0x413f50={};_0x413f50[_0x4c91d2]={'$like':'%'+_0x18d242[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x413f50;})});}_0x35a441=_['merge']({},_0x35a441,_0x18d242[_0x130b('0x55')]);return db[_0x130b('0x74')][_0x130b('0x6d')]({'where':_0x35a441[_0x130b('0x50')]})['then'](function(_0x44730a){_0x21b2ee[_0x130b('0x6d')]=_0x44730a;if(_0x18d242['query'][_0x130b('0x56')]){_0x35a441[_0x130b('0x57')]=[{'model':db[_0x130b('0x75')],'as':'Contact','required':![]},{'model':db[_0x130b('0x76')],'as':'Owner','attributes':[_0x130b('0x3d'),_0x130b('0x77'),_0x130b('0x78')],'required':![]},{'model':db[_0x130b('0x79')],'as':_0x130b('0x7a'),'attributes':['id',_0x130b('0x3d'),'color'],'where':_0x18d242[_0x130b('0x45')][_0x130b('0x7b')]?{'id':_0x18d242[_0x130b('0x45')][_0x130b('0x7b')]}:undefined,'required':_0x18d242[_0x130b('0x45')][_0x130b('0x7b')]?!![]:![]}];}return db[_0x130b('0x74')]['findAll'](_0x35a441);})[_0x130b('0x22')](function(_0x40d67b){_0x21b2ee[_0x130b('0x59')]=_0x40d67b;return _0x21b2ee;});}})[_0x130b('0x22')](respondWithFilteredResult(_0x5285d0,_0x35a441))['catch'](handleError(_0x5285d0,null));};exports[_0x130b('0x7c')]=function(_0x5f4bdd,_0x468fae,_0x5824ef){return db['FaxAccount']['findOne']({'where':{'id':_0x5f4bdd[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x468fae,null))['then'](function(_0xda829){if(_0xda829){return db[_0x130b('0x7d')][_0x130b('0x7e')](function(_0x532263){return db[_0x130b('0x7f')][_0x130b('0x38')]({'where':{'FaxAccountId':_0x5f4bdd[_0x130b('0x5b')]['id']},'transaction':_0x532263})['then'](function(_0x26579d){var _0x5998d0=_[_0x130b('0x44')](_0x5f4bdd[_0x130b('0x67')],function(_0x4a8101){_0x4a8101['FaxAccountId']=_0x5f4bdd[_0x130b('0x5b')]['id'];return _0x4a8101;});return db[_0x130b('0x7f')][_0x130b('0x80')](_0x5998d0,{'transaction':_0x532263});});})['then'](function(){return db[_0x130b('0x7f')][_0x130b('0x81')]({'where':{'FaxAccountId':_0x5f4bdd[_0x130b('0x5b')]['id']},'order':_0x130b('0x82')});});}})[_0x130b('0x22')](respondWithResult(_0x468fae,null))[_0x130b('0x2b')](handleError(_0x468fae,null));};exports['getApplications']=function(_0x25cd65,_0xa6816a,_0x463048){var _0x5a900b={};var _0x5c1cfb={};var _0x4e6e02;var _0x56a5ca;return db[_0x130b('0x40')][_0x130b('0x6c')]({'where':{'id':_0x25cd65[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0xa6816a,null))[_0x130b('0x22')](function(_0x15ec5d){if(_0x15ec5d){_0x4e6e02=_0x15ec5d;_0x5c1cfb[_0x130b('0x43')]=_[_0x130b('0x46')](db[_0x130b('0x7f')]['rawAttributes']);_0x5c1cfb[_0x130b('0x45')]=_['keys'](_0x25cd65['query']);_0x5c1cfb[_0x130b('0x47')]=_['intersection'](_0x5c1cfb[_0x130b('0x43')],_0x5c1cfb[_0x130b('0x45')]);_0x5a900b[_0x130b('0x48')]=_[_0x130b('0x49')](_0x5c1cfb[_0x130b('0x43')],qs[_0x130b('0x4a')](_0x25cd65['query']['fields']));_0x5a900b[_0x130b('0x48')]=_0x5a900b[_0x130b('0x48')][_0x130b('0x4b')]?_0x5a900b['attributes']:_0x5c1cfb[_0x130b('0x43')];_0x5a900b['order']=qs[_0x130b('0x4f')](_0x25cd65[_0x130b('0x45')]['sort']);_0x5a900b[_0x130b('0x50')]=qs[_0x130b('0x47')](_[_0x130b('0x51')](_0x25cd65[_0x130b('0x45')],_0x5c1cfb[_0x130b('0x47')]));if(_0x25cd65[_0x130b('0x45')]['filter']){_0x5a900b[_0x130b('0x50')]=_[_0x130b('0x53')](_0x5a900b[_0x130b('0x50')],{'$or':_[_0x130b('0x44')](_0x5a900b[_0x130b('0x48')],function(_0xccba4d){var _0x262bcc={};_0x262bcc[_0xccba4d]={'$like':'%'+_0x25cd65[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x262bcc;})});}_0x5a900b=_[_0x130b('0x53')]({},_0x5a900b,_0x25cd65['options']);return _0x4e6e02[_0x130b('0x83')](_0x5a900b);}})[_0x130b('0x22')](function(_0x1b5250){if(_0x1b5250){_0x56a5ca=_0x1b5250[_0x130b('0x4b')];if(!_0x25cd65[_0x130b('0x45')]['hasOwnProperty'](_0x130b('0x4d'))){_0x5a900b['limit']=qs['limit'](_0x25cd65[_0x130b('0x45')][_0x130b('0x31')]);_0x5a900b['offset']=qs[_0x130b('0x32')](_0x25cd65[_0x130b('0x45')][_0x130b('0x32')]);}return _0x4e6e02[_0x130b('0x83')](_0x5a900b);}})['then'](function(_0x284933){if(_0x284933){return _0x284933?{'count':_0x56a5ca,'rows':_0x284933}:null;}})[_0x130b('0x22')](respondWithResult(_0xa6816a,null))[_0x130b('0x2b')](handleError(_0xa6816a,null));};function Extension(_0x43cc89,_0x51d36f,_0x1ab380,_0x4ce147){this[_0x130b('0x84')]=_0x130b('0x85');this[_0x130b('0x86')]=_0x43cc89[_0x130b('0x87')];this['app']=_0x4ce147;this[_0x130b('0x41')]=_0x130b('0x88');this[_0x130b('0x89')]=_0x130b('0x8a');this[_0x130b('0x6a')]=_0x43cc89['id'];this['priority']=_0x51d36f;this[_0x130b('0x8b')]=_0x1ab380;}function createExtensionsReciveFax(_0x5a569b){var _0x265ec0=0x1;var _0x17a922=[];_0x17a922['push'](new Extension(_0x5a569b,_0x265ec0,'',_0x130b('0x8c')));_0x265ec0+=0x1;_0x17a922[_0x130b('0x8d')](new Extension(_0x5a569b,_0x265ec0,_0x130b('0x8e'),'Set'));_0x265ec0+=0x1;for(var _0x57cc5d in _0x5a569b){if(_0x5a569b['hasOwnProperty'](_0x57cc5d)&&(_0x57cc5d==='ecm'||_0x57cc5d===_0x130b('0x87')||_0x57cc5d==='gateway'||_0x57cc5d===_0x130b('0x8f')||_0x57cc5d===_0x130b('0x90')||_0x57cc5d===_0x130b('0x91')||_0x57cc5d==='minrate'||_0x57cc5d==='modem'||_0x57cc5d===_0x130b('0x92'))){_0x17a922[_0x130b('0x8d')](new Extension(_0x5a569b,_0x265ec0,_0x130b('0x93')+_0x57cc5d+')='+_0x5a569b[_0x57cc5d],_0x130b('0x94')));_0x265ec0+=0x1;}}_0x17a922[_0x130b('0x8d')](new Extension(_0x5a569b,_0x265ec0,'6',_0x130b('0x95')));_0x265ec0+=0x1;_0x17a922[_0x130b('0x8d')](new Extension(_0x5a569b,_0x265ec0,_0x130b('0x96'),_0x130b('0x97')));_0x265ec0=0x0;return _0x17a922;}exports[_0x130b('0x98')]=function(_0x50ee0e,_0x15de70,_0x337719){var _0x153783;return db[_0x130b('0x7d')]['transaction'](function(_0x417d85){return db[_0x130b('0x40')][_0x130b('0x5f')](_0x50ee0e[_0x130b('0x67')],{'transaction':_0x417d85})[_0x130b('0x22')](function(_0x255e0f){_0x153783=_0x255e0f[_0x130b('0x39')]({'plain':!![]});return db[_0x130b('0x99')]['bulkCreate'](createExtensionsReciveFax(_0x153783),{'transaction':_0x417d85});});})[_0x130b('0x22')](function(){return _0x153783;})[_0x130b('0x22')](respondWithResult(_0x15de70,null))['catch'](handleError(_0x15de70,null));};exports[_0x130b('0x9a')]=function(_0x42ee39,_0x2b2bd6,_0x50ecf6){var _0x5e4d42;return db[_0x130b('0x7d')][_0x130b('0x7e')](function(_0x223545){return db[_0x130b('0x40')][_0x130b('0x37')](_0x42ee39[_0x130b('0x67')],{'where':{'id':_0x42ee39[_0x130b('0x67')]['id']},'transaction':_0x223545})[_0x130b('0x22')](function(_0x4239ad){return db['VoiceExtension'][_0x130b('0x38')]({'where':{'FaxAccountId':_0x42ee39[_0x130b('0x67')]['id']},'transaction':_0x223545})[_0x130b('0x22')](function(_0x8dd01f){return db[_0x130b('0x99')][_0x130b('0x80')](createExtensionsReciveFax(_[_0x130b('0x9b')](_0x42ee39[_0x130b('0x67')],[_0x130b('0x9c'),_0x130b('0x42'),_0x130b('0x9d'),_0x130b('0x9e'),'TrunkId','ListId'])),{'transaction':_0x223545});});});})[_0x130b('0x22')](function(){return db[_0x130b('0x40')]['findById'](_0x42ee39['body']['id']);})[_0x130b('0x22')](respondWithResult(_0x2b2bd6,null))['catch'](handleError(_0x2b2bd6,null));};exports[_0x130b('0x9f')]=function(_0x3cc186,_0x534d0e,_0x3d7106){var _0xdc3d28={'raw':!![],'where':{}};var _0x47c52a={};var _0x47b96e={'count':0x0,'rows':[]};return db[_0x130b('0x40')]['findOne']({'where':{'id':_0x3cc186['params']['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x534d0e,null))['then'](function(_0x349294){if(_0x349294){_0x47c52a[_0x130b('0x43')]=_[_0x130b('0x46')](db[_0x130b('0xa0')]['rawAttributes']);_0x47c52a[_0x130b('0x45')]=_['keys'](_0x3cc186['query']);_0x47c52a[_0x130b('0x47')]=_[_0x130b('0x49')](_0x47c52a[_0x130b('0x43')],_0x47c52a['query']);_0xdc3d28[_0x130b('0x48')]=_[_0x130b('0x49')](_0x47c52a['model'],qs[_0x130b('0x4a')](_0x3cc186['query'][_0x130b('0x4a')]));_0xdc3d28[_0x130b('0x48')]=_0xdc3d28[_0x130b('0x48')][_0x130b('0x4b')]?_0xdc3d28[_0x130b('0x48')]:_0x47c52a['model'];if(!_0x3cc186['query'][_0x130b('0x4c')](_0x130b('0x4d'))){_0xdc3d28[_0x130b('0x31')]=qs[_0x130b('0x31')](_0x3cc186[_0x130b('0x45')]['limit']);_0xdc3d28[_0x130b('0x32')]=qs[_0x130b('0x32')](_0x3cc186[_0x130b('0x45')]['offset']);}_0xdc3d28[_0x130b('0x4e')]=qs[_0x130b('0x4f')](_0x3cc186[_0x130b('0x45')][_0x130b('0x4f')]);_0xdc3d28[_0x130b('0x50')]=qs['filters'](_[_0x130b('0x51')](_0x3cc186[_0x130b('0x45')],_0x47c52a['filters']));_0xdc3d28[_0x130b('0x50')][_0x130b('0x6a')]=_0x349294['id'];if(_0x3cc186[_0x130b('0x45')][_0x130b('0x52')]){_0xdc3d28[_0x130b('0x50')]=_['merge'](_0xdc3d28[_0x130b('0x50')],{'$or':_[_0x130b('0x44')](_0xdc3d28[_0x130b('0x48')],function(_0x129a0c){var _0x2d81af={};_0x2d81af[_0x129a0c]={'$like':'%'+_0x3cc186[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x2d81af;})});}if(_0x3cc186['query'][_0x130b('0xa1')]){var _0x114010=_0x3cc186[_0x130b('0x45')][_0x130b('0xa1')]['split'](',');var _0x20560e={};_0x20560e[_0x114010[0x0]]={'$gte':moment(_0x114010[0x1])[_0x130b('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0xdc3d28['where']=_[_0x130b('0x53')](_0xdc3d28[_0x130b('0x50')],_0x20560e);}_0xdc3d28=_[_0x130b('0x53')]({},_0xdc3d28,_0x3cc186[_0x130b('0x55')]);return db[_0x130b('0xa0')]['count']({'where':_0xdc3d28['where']})[_0x130b('0x22')](function(_0x214d0e){_0x47b96e['count']=_0x214d0e;if(_0x3cc186[_0x130b('0x45')]['includeAll']){_0xdc3d28[_0x130b('0x57')]=[{'all':!![]}];}return db[_0x130b('0xa0')][_0x130b('0x58')](_0xdc3d28);})[_0x130b('0x22')](function(_0x3c90a9){_0x47b96e[_0x130b('0x59')]=_0x3c90a9;return _0x47b96e;});}})[_0x130b('0x22')](respondWithFilteredResult(_0x534d0e,_0xdc3d28))[_0x130b('0x2b')](handleError(_0x534d0e,null));};exports[_0x130b('0xa3')]=function(_0x1c7dda,_0x47f5f6,_0x3e1196){var _0x232769,_0x39f6df={},_0x2ef5eb;if(_0x1c7dda[_0x130b('0x67')]['to']){_0x2ef5eb=_0x1c7dda[_0x130b('0x67')]['to'][0x0];}return db[_0x130b('0x40')][_0x130b('0x5e')]({'where':{'id':_0x1c7dda[_0x130b('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x130b('0x75')],'as':'Contacts','where':{'fax':_0x2ef5eb},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x47f5f6,null))['then'](function(_0x41fb9b){_0x232769=_0x41fb9b;if(_0x1c7dda['body'][_0x130b('0xa4')]&&_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][_0x130b('0x4b')]){for(var _0x3e3be3=0x0;_0x3e3be3<_0x1c7dda[_0x130b('0x67')]['attachments'][_0x130b('0x4b')];_0x3e3be3+=0x1){_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][_0x3e3be3]={'filename':_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][_0x3e3be3][_0x130b('0x3d')],'id':_0x1c7dda[_0x130b('0x67')]['attachments'][_0x3e3be3]['id'],'path':path[_0x130b('0xa5')](config[_0x130b('0xa6')],_0x130b('0xa7'),_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][_0x3e3be3][_0x130b('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x130b('0xa9'),{'FaxAccountId':_[_0x130b('0xaa')](_0x1c7dda[_0x130b('0x5b')]['id'])?undefined:_0x1c7dda[_0x130b('0x5b')]['id'],'path':_[_0x130b('0xaa')](_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][0x0][_0x130b('0xab')])?undefined:_0x1c7dda['body'][_0x130b('0xa4')][0x0][_0x130b('0xab')],'fax':_[_0x130b('0xaa')](_0x1c7dda[_0x130b('0x67')]['to'][0x0])?undefined:_0x1c7dda[_0x130b('0x67')]['to'][0x0]},client9002);})[_0x130b('0x22')](function(){if(_0x232769){if(_[_0x130b('0xaa')](_0x1c7dda[_0x130b('0x67')][_0x130b('0xac')])){_0x1c7dda['body'][_0x130b('0xac')]=util['format']('\x22%s\x22\x20<%s>',_0x232769['name'],_0x232769['fax']);}if(_0x232769[_0x130b('0xad')]){if(_0x232769[_0x130b('0xad')][_0x130b('0xae')][_0x130b('0x4b')]){return _0x232769[_0x130b('0xad')][_0x130b('0xae')][0x0];}else{return db[_0x130b('0x75')][_0x130b('0x5f')](_[_0x130b('0x1a')](_0x1c7dda['body'],{'firstName':_0x1c7dda[_0x130b('0x67')]['to'][0x0],'phone':_0x1c7dda[_0x130b('0x67')]['to'][0x0],'fax':_0x1c7dda[_0x130b('0x67')]['to'][0x0],'ListId':_0x232769['ListId']}));}}else{throw new Error(_0x130b('0xaf'));}}else{throw new Error(_0x130b('0xb0'));}})['then'](function(_0xa0cc21){if(_0xa0cc21){return db[_0x130b('0x74')]['find']({'where':{'ContactId':_0xa0cc21['id'],'closed':![],'FaxAccountId':_0x232769['id']}})[_0x130b('0x22')](function(_0x370bb9){if(_0x370bb9){return[_0x370bb9,![]];}return db[_0x130b('0x74')][_0x130b('0x5f')]({'UserId':_0x1c7dda['user']['id'],'ContactId':_0xa0cc21['id'],'FaxAccountId':_0x232769['id'],'fax':_0x1c7dda['body']['to'][0x0],'firstMsgDirection':_0x130b('0xb1'),'Messages':[_[_0x130b('0x53')](_0x1c7dda[_0x130b('0x67')],{'read':![],'body':_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][0x0][_0x130b('0xb2')],'FaxAccountId':_0x232769['id'],'UserId':_0x1c7dda[_0x130b('0x60')]['id'],'ContactId':_0xa0cc21['id'],'AttachmentId':_0x1c7dda[_0x130b('0x67')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x130b('0xa0')],'as':_0x130b('0xb3')}]})['then'](function(_0x435e00){return[_0x435e00,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x130b('0xb4')](function(_0x38555d,_0xc2fd48){if(_0xc2fd48){return _0x38555d;}return db[_0x130b('0xa0')]['create']({'direction':_0x130b('0xb1'),'read':![],'body':_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][0x0]['filename'],'FaxAccountId':_0x232769['id'],'FaxInteractionId':_0x38555d['id'],'UserId':_0x1c7dda[_0x130b('0x60')]['id'],'ContactId':_0x38555d[_0x130b('0xb5')],'AttachmentId':_0x1c7dda['body'][_0x130b('0xa4')][0x0]['id']})[_0x130b('0x22')](function(_0x5ec6c3){_0x38555d[_0x130b('0xb6')]['Messages']=[];_0x38555d[_0x130b('0xb6')][_0x130b('0xb3')][_0x130b('0x8d')](_0x5ec6c3[_0x130b('0xb6')]);return _0x38555d;});})['then'](function(_0x3b04bc){respondWithRpcPromise(_0x130b('0xb7'),_0x130b('0xb7'),{'FaxAccountId':_[_0x130b('0xaa')](_0x1c7dda['params']['id'])?undefined:_0x1c7dda[_0x130b('0x5b')]['id'],'path':_['isNil'](_0x1c7dda[_0x130b('0x67')][_0x130b('0xa4')][0x0][_0x130b('0xab')])?undefined:_0x1c7dda[_0x130b('0x67')]['attachments'][0x0]['path'],'fax':_[_0x130b('0xaa')](_0x1c7dda[_0x130b('0x67')]['to'][0x0])?undefined:_0x1c7dda[_0x130b('0x67')]['to'][0x0],'AttachmentId':_0x1c7dda['body'][_0x130b('0xa4')][0x0]['id']},client9002)[_0x130b('0x22')](function(_0x50ea13){logger['info'](_0x130b('0xb8'),_0x50ea13);})['catch'](function(_0x5af43c){logger['info'](_0x130b('0xb8'),_0x5af43c);});return _0x3b04bc;})['then'](respondWithResult(_0x47f5f6,null))[_0x130b('0x2b')](handleError(_0x47f5f6,null));};exports[_0x130b('0xb9')]=function(_0x5c4276,_0x475de3,_0x3b32d4){return db[_0x130b('0x40')][_0x130b('0x5e')]({'where':{'id':_0x5c4276[_0x130b('0x5b')]['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x475de3,null))[_0x130b('0x22')](function(_0x3aa19d){if(_0x3aa19d){return _0x3aa19d[_0x130b('0xb9')](_0x5c4276[_0x130b('0x67')][_0x130b('0x6f')],_[_0x130b('0x9b')](_0x5c4276['body'],[_0x130b('0x6f'),'id'])||{})[_0x130b('0xb4')](function(_0x4f8a97){for(var _0x545c21=0x0;_0x545c21<_0x5c4276[_0x130b('0x67')][_0x130b('0x6f')]['length'];_0x545c21+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x5c4276[_0x130b('0x67')]['ids'][_0x545c21]),'FaxAccountId':Number(_0x5c4276['params']['id'])});}return _0x4f8a97;});}})[_0x130b('0x22')](respondWithResult(_0x475de3,null))[_0x130b('0x2b')](handleError(_0x475de3,null));};exports[_0x130b('0xba')]=function(_0x191fe9,_0x24949e,_0x24979b){return db['FaxAccount'][_0x130b('0x5e')]({'where':{'id':_0x191fe9['params']['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x24949e,null))[_0x130b('0x22')](function(_0x5321a6){if(_0x5321a6){return _0x5321a6['removeAgents'](_0x191fe9['query'][_0x130b('0x6f')])[_0x130b('0x22')](function(){if(_[_0x130b('0xbb')](_0x191fe9[_0x130b('0x45')][_0x130b('0x6f')])){for(var _0x4da466=0x0;_0x4da466<_0x191fe9['query'][_0x130b('0x6f')][_0x130b('0x4b')];_0x4da466+=0x1){socket[_0x130b('0xbc')](_0x130b('0xbd'),{'UserId':Number(_0x191fe9[_0x130b('0x45')][_0x130b('0x6f')][_0x4da466]),'FaxAccountId':Number(_0x191fe9[_0x130b('0x5b')]['id'])});}}else{socket[_0x130b('0xbc')](_0x130b('0xbd'),{'UserId':Number(_0x191fe9[_0x130b('0x45')][_0x130b('0x6f')]),'FaxAccountId':Number(_0x191fe9[_0x130b('0x5b')]['id'])});}});}})[_0x130b('0x22')](respondWithStatusCode(_0x24949e,null))['catch'](handleError(_0x24949e,null));};exports[_0x130b('0xbe')]=function(_0x3179cd,_0x1e1c87,_0x465191){var _0x26d231={};var _0x293c4d={};var _0x5592e3;var _0x5e2fbe;return db[_0x130b('0x40')][_0x130b('0x6c')]({'where':{'id':_0x3179cd['params']['id']}})[_0x130b('0x22')](handleEntityNotFound(_0x1e1c87,null))[_0x130b('0x22')](function(_0x305efb){if(_0x305efb){_0x5592e3=_0x305efb;_0x293c4d[_0x130b('0x43')]=_['keys'](db[_0x130b('0x76')]['rawAttributes']);_0x293c4d[_0x130b('0x45')]=_['keys'](_0x3179cd[_0x130b('0x45')]);_0x293c4d[_0x130b('0x47')]=_['intersection'](_0x293c4d[_0x130b('0x43')],_0x293c4d['query']);_0x26d231[_0x130b('0x48')]=_[_0x130b('0x49')](_0x293c4d[_0x130b('0x43')],qs[_0x130b('0x4a')](_0x3179cd[_0x130b('0x45')][_0x130b('0x4a')]));_0x26d231['attributes']=_0x26d231[_0x130b('0x48')][_0x130b('0x4b')]?_0x26d231[_0x130b('0x48')]:_0x293c4d[_0x130b('0x43')];_0x26d231[_0x130b('0x4e')]=qs[_0x130b('0x4f')](_0x3179cd[_0x130b('0x45')][_0x130b('0x4f')]);_0x26d231[_0x130b('0x50')]=qs[_0x130b('0x47')](_[_0x130b('0x51')](_0x3179cd['query'],_0x293c4d[_0x130b('0x47')]));if(_0x3179cd[_0x130b('0x45')][_0x130b('0x52')]){_0x26d231['where']=_[_0x130b('0x53')](_0x26d231[_0x130b('0x50')],{'$or':_[_0x130b('0x44')](_0x26d231[_0x130b('0x48')],function(_0x4898eb){var _0x5a406f={};_0x5a406f[_0x4898eb]={'$like':'%'+_0x3179cd[_0x130b('0x45')][_0x130b('0x52')]+'%'};return _0x5a406f;})});}_0x26d231=_[_0x130b('0x53')]({},_0x26d231,_0x3179cd[_0x130b('0x55')]);return _0x5592e3[_0x130b('0xbe')](_0x26d231);}})[_0x130b('0x22')](function(_0x3997b6){if(_0x3997b6){_0x5e2fbe=_0x3997b6[_0x130b('0x4b')];if(!_0x3179cd['query'][_0x130b('0x4c')](_0x130b('0x4d'))){_0x26d231[_0x130b('0x31')]=qs[_0x130b('0x31')](_0x3179cd[_0x130b('0x45')]['limit']);_0x26d231[_0x130b('0x32')]=qs[_0x130b('0x32')](_0x3179cd[_0x130b('0x45')][_0x130b('0x32')]);}return _0x5592e3[_0x130b('0xbe')](_0x26d231);}})[_0x130b('0x22')](function(_0x582d56){if(_0x582d56){return _0x582d56?{'count':_0x5e2fbe,'rows':_0x582d56}:null;}})[_0x130b('0x22')](respondWithResult(_0x1e1c87,null))[_0x130b('0x2b')](handleError(_0x1e1c87,null));}; \ No newline at end of file +var _0xd4aa=['count','Content-Range','json','apply','reject','save','update','then','destroy','FaxAccounts','sendStatus','stack','name','send','index','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','sequelize','transaction','FaxApplication','priority','getApplications','context','exten','localstationid','system','description','appdata','push','CDR(type)=inbound-fax','Set','ecm','headerinfo','minrate','modem','FAXOPT(','Wait','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','basename','CheckAfterSend','isNil','from','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','undefined','limit'];(function(_0x12db66,_0x287fc5){var _0x83a2ae=function(_0x2e0188){while(--_0x2e0188){_0x12db66['push'](_0x12db66['shift']());}};_0x83a2ae(++_0x287fc5);}(_0xd4aa,0x143));var _0xad4a=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xd4aa[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0xad4a('0x0'));var rimraf=require(_0xad4a('0x1'));var zipdir=require(_0xad4a('0x2'));var jsonpatch=require(_0xad4a('0x3'));var rp=require('request-promise');var moment=require(_0xad4a('0x4'));var BPromise=require(_0xad4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xad4a('0x6'));var sox=require(_0xad4a('0x7'));var csv=require(_0xad4a('0x8'));var ejs=require(_0xad4a('0x9'));var fs=require('fs');var fs_extra=require(_0xad4a('0xa'));var _=require(_0xad4a('0xb'));var squel=require(_0xad4a('0xc'));var crypto=require(_0xad4a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xad4a('0xe'));var toCsv=require(_0xad4a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xad4a('0xf'));var qs=require(_0xad4a('0x10'));var as=require(_0xad4a('0x11'));var hardwareService=require(_0xad4a('0x12'));var logger=require('../../config/logger')(_0xad4a('0x13'));var utils=require(_0xad4a('0x14'));var config=require(_0xad4a('0x15'));var licenseUtil=require(_0xad4a('0x16'));var db=require('../../mysqldb')['db'];config[_0xad4a('0x17')]=_[_0xad4a('0x18')](config[_0xad4a('0x17')],{'host':_0xad4a('0x19'),'port':0x18eb});var socket=require(_0xad4a('0x1a'))(new Redis(config[_0xad4a('0x17')]));require(_0xad4a('0x1b'))[_0xad4a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xad4a('0x1d')][_0xad4a('0x1e')]({'port':0x232c});var client9002=jayson[_0xad4a('0x1d')][_0xad4a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x104a41,_0x311e6e,_0x20f702,_0x207ff6){return new BPromise(function(_0x369091,_0x31e648){var _0x2fc7b2=_0x207ff6||client;return _0x2fc7b2[_0xad4a('0x1f')](_0x104a41,_0x20f702)['then'](function(_0x35a58b){logger[_0xad4a('0x20')](_0xad4a('0x21'),_0x311e6e,'request\x20sent');logger[_0xad4a('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x311e6e,_0xad4a('0x23'),JSON[_0xad4a('0x24')](_0x35a58b));if(_0x35a58b[_0xad4a('0x25')]){if(_0x35a58b['error'][_0xad4a('0x26')]===0x1f4){logger['error'](_0xad4a('0x21'),_0x311e6e,_0x35a58b[_0xad4a('0x25')][_0xad4a('0x27')]);return _0x31e648(_0x35a58b[_0xad4a('0x25')][_0xad4a('0x27')]);}logger['error'](_0xad4a('0x21'),_0x311e6e,_0x35a58b[_0xad4a('0x25')][_0xad4a('0x27')]);return _0x369091(_0x35a58b[_0xad4a('0x25')][_0xad4a('0x27')]);}else{logger[_0xad4a('0x20')](_0xad4a('0x21'),_0x311e6e,_0xad4a('0x23'));_0x369091(_0x35a58b[_0xad4a('0x28')]['message']);}})[_0xad4a('0x29')](function(_0x15fed4){logger[_0xad4a('0x25')](_0xad4a('0x21'),_0x311e6e,_0x15fed4);_0x31e648(_0x15fed4);});});}function respondWithStatusCode(_0x49749b,_0x127172){_0x127172=_0x127172||0xcc;return function(_0x5a7842){if(_0x5a7842){return _0x49749b['sendStatus'](_0x127172);}return _0x49749b[_0xad4a('0x2a')](_0x127172)[_0xad4a('0x2b')]();};}function respondWithResult(_0x4214af,_0xd25de9){_0xd25de9=_0xd25de9||0xc8;return function(_0x1153d2){if(_0x1153d2){return _0x4214af['status'](_0xd25de9)['json'](_0x1153d2);}};}function respondWithFilteredResult(_0x16f57e,_0x1eceb5){return function(_0x2601a6){if(_0x2601a6){var _0x3f8224=typeof _0x1eceb5[_0xad4a('0x2c')]===_0xad4a('0x2d')&&typeof _0x1eceb5[_0xad4a('0x2e')]===_0xad4a('0x2d');var _0x16c5e8=_0x2601a6[_0xad4a('0x2f')];var _0x3a8af1=_0x3f8224?0x0:_0x1eceb5[_0xad4a('0x2c')];var _0x1a57de=_0x3f8224?_0x2601a6[_0xad4a('0x2f')]:_0x1eceb5[_0xad4a('0x2c')]+_0x1eceb5[_0xad4a('0x2e')];var _0x1b8a69;if(_0x1a57de>=_0x16c5e8){_0x1a57de=_0x16c5e8;_0x1b8a69=0xc8;}else{_0x1b8a69=0xce;}_0x16f57e[_0xad4a('0x2a')](_0x1b8a69);return _0x16f57e['set'](_0xad4a('0x30'),_0x3a8af1+'-'+_0x1a57de+'/'+_0x16c5e8)[_0xad4a('0x31')](_0x2601a6);}return null;};}function patchUpdates(_0x352d54){return function(_0x3abf3a){try{jsonpatch[_0xad4a('0x32')](_0x3abf3a,_0x352d54,!![]);}catch(_0x5ee29d){return BPromise[_0xad4a('0x33')](_0x5ee29d);}return _0x3abf3a[_0xad4a('0x34')]();};}function saveUpdates(_0x5b4717,_0x365890){return function(_0x165f00){if(_0x165f00){return _0x165f00[_0xad4a('0x35')](_0x5b4717)[_0xad4a('0x36')](function(_0x1ed604){return _0x1ed604;});}return null;};}function removeEntity(_0x388c9d,_0x9e12ef){return function(_0x301972){if(_0x301972){return _0x301972[_0xad4a('0x37')]()[_0xad4a('0x36')](function(){var _0x506fd1=_0x301972['get']({'plain':!![]});var _0x126831=_0xad4a('0x38');return db['UserProfileResource'][_0xad4a('0x37')]({'where':{'type':_0x126831,'resourceId':_0x506fd1['id']}})[_0xad4a('0x36')](function(){return _0x301972;});})[_0xad4a('0x36')](function(){_0x388c9d[_0xad4a('0x2a')](0xcc)[_0xad4a('0x2b')]();});}};}function handleEntityNotFound(_0x1afd38,_0xeabe99){return function(_0x5d54e1){if(!_0x5d54e1){_0x1afd38[_0xad4a('0x39')](0x194);}return _0x5d54e1;};}function handleError(_0x1fce2f,_0x2722b9){_0x2722b9=_0x2722b9||0x1f4;return function(_0x1eb975){logger['error'](_0x1eb975[_0xad4a('0x3a')]);if(_0x1eb975[_0xad4a('0x3b')]){delete _0x1eb975[_0xad4a('0x3b')];}_0x1fce2f[_0xad4a('0x2a')](_0x2722b9)[_0xad4a('0x3c')](_0x1eb975);};}exports[_0xad4a('0x3d')]=function(_0x19335d,_0x1feb15){var _0x41bd3a={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2f3579={},_0x139782={'count':0x0,'rows':[]};var _0x498d57=_[_0xad4a('0x3e')](db[_0xad4a('0x3f')][_0xad4a('0x40')],function(_0x5e2e4f){return{'name':_0x5e2e4f[_0xad4a('0x41')],'type':_0x5e2e4f[_0xad4a('0x42')][_0xad4a('0x43')]};});_0x2f3579['model']=_[_0xad4a('0x3e')](_0x498d57,_0xad4a('0x3b'));_0x2f3579[_0xad4a('0x44')]=_[_0xad4a('0x45')](_0x19335d['query']);_0x2f3579[_0xad4a('0x46')]=_['intersection'](_0x2f3579[_0xad4a('0x47')],_0x2f3579[_0xad4a('0x44')]);_0x41bd3a[_0xad4a('0x48')]=_[_0xad4a('0x49')](_0x2f3579[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0x19335d[_0xad4a('0x44')][_0xad4a('0x4a')]));_0x41bd3a[_0xad4a('0x48')]=_0x41bd3a[_0xad4a('0x48')][_0xad4a('0x4b')]?_0x41bd3a[_0xad4a('0x48')]:_0x2f3579[_0xad4a('0x47')];if(!_0x19335d[_0xad4a('0x44')][_0xad4a('0x4c')]('nolimit')){_0x41bd3a[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0x19335d[_0xad4a('0x44')][_0xad4a('0x2e')]);_0x41bd3a[_0xad4a('0x2c')]=qs[_0xad4a('0x2c')](_0x19335d[_0xad4a('0x44')]['offset']);}_0x41bd3a[_0xad4a('0x4d')]=qs['sort'](_0x19335d[_0xad4a('0x44')][_0xad4a('0x4e')]);_0x41bd3a['where']=qs[_0xad4a('0x46')](_[_0xad4a('0x4f')](_0x19335d[_0xad4a('0x44')],_0x2f3579['filters']),_0x498d57);if(_0x19335d[_0xad4a('0x44')][_0xad4a('0x50')]){_0x41bd3a[_0xad4a('0x51')]=_[_0xad4a('0x52')](_0x41bd3a[_0xad4a('0x51')],{'$or':_['map'](_0x498d57,function(_0x75f8cc){if(_0x75f8cc[_0xad4a('0x42')]!=='VIRTUAL'){var _0x1f8ad6={};_0x1f8ad6[_0x75f8cc[_0xad4a('0x3b')]]={'$like':'%'+_0x19335d[_0xad4a('0x44')][_0xad4a('0x50')]+'%'};return _0x1f8ad6;}})});}_0x41bd3a=_[_0xad4a('0x52')]({},_0x41bd3a,_0x19335d['options']);var _0xebe4b8={'where':_0x41bd3a['where']};return db[_0xad4a('0x3f')][_0xad4a('0x2f')](_0xebe4b8)[_0xad4a('0x36')](function(_0x5851c9){_0x139782[_0xad4a('0x2f')]=_0x5851c9;if(_0x19335d[_0xad4a('0x44')][_0xad4a('0x53')]){_0x41bd3a[_0xad4a('0x54')]=[{'all':!![]}];}return db[_0xad4a('0x3f')]['findAll'](_0x41bd3a);})[_0xad4a('0x36')](function(_0x42780c){_0x139782[_0xad4a('0x55')]=_0x42780c;return _0x139782;})[_0xad4a('0x36')](respondWithFilteredResult(_0x1feb15,_0x41bd3a))['catch'](handleError(_0x1feb15,null));};exports[_0xad4a('0x56')]=function(_0x31acd9,_0x3f05f5){var _0x2448ee={'raw':![],'where':{'id':_0x31acd9[_0xad4a('0x57')]['id']},'include':[{'model':db[_0xad4a('0x58')],'as':_0xad4a('0x59')}]},_0x140688={};_0x140688[_0xad4a('0x47')]=_[_0xad4a('0x45')](db[_0xad4a('0x3f')][_0xad4a('0x40')]);_0x140688[_0xad4a('0x44')]=_[_0xad4a('0x45')](_0x31acd9['query']);_0x140688['filters']=_[_0xad4a('0x49')](_0x140688[_0xad4a('0x47')],_0x140688[_0xad4a('0x44')]);_0x2448ee[_0xad4a('0x48')]=_['intersection'](_0x140688[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0x31acd9[_0xad4a('0x44')]['fields']));_0x2448ee[_0xad4a('0x48')]=_0x2448ee['attributes'][_0xad4a('0x4b')]?_0x2448ee['attributes']:_0x140688[_0xad4a('0x47')];if(_0x31acd9['query'][_0xad4a('0x53')]){_0x2448ee[_0xad4a('0x54')]=[{'all':!![]}];}_0x2448ee=_[_0xad4a('0x52')]({},_0x2448ee,_0x31acd9[_0xad4a('0x5a')]);return db[_0xad4a('0x3f')][_0xad4a('0x5b')](_0x2448ee)['then'](handleEntityNotFound(_0x3f05f5,null))[_0xad4a('0x36')](respondWithResult(_0x3f05f5,null))[_0xad4a('0x29')](handleError(_0x3f05f5,null));};exports[_0xad4a('0x5c')]=function(_0xb60db0,_0x516633){return db['FaxAccount']['create'](_0xb60db0[_0xad4a('0x5d')],{})[_0xad4a('0x36')](function(_0x35ed0b){var _0x31a76d=_0xb60db0[_0xad4a('0x5e')]['get']({'plain':!![]});if(!_0x31a76d)throw new Error(_0xad4a('0x5f'));if(_0x31a76d[_0xad4a('0x60')]===_0xad4a('0x5e')){var _0x27d924=_0x35ed0b[_0xad4a('0x61')]({'plain':!![]});var _0x3b802e='FaxAccounts';return db[_0xad4a('0x62')]['find']({'where':{'name':_0x3b802e,'userProfileId':_0x31a76d[_0xad4a('0x63')]},'raw':!![]})[_0xad4a('0x36')](function(_0x2adba6){if(_0x2adba6&&_0x2adba6[_0xad4a('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x27d924[_0xad4a('0x3b')],'resourceId':_0x27d924['id'],'type':_0x2adba6['name'],'sectionId':_0x2adba6['id']},{})[_0xad4a('0x36')](function(){return _0x35ed0b;});}else{return _0x35ed0b;}})[_0xad4a('0x29')](function(_0xbfc3df){logger[_0xad4a('0x25')](_0xad4a('0x65'),_0xbfc3df);throw _0xbfc3df;});}return _0x35ed0b;})[_0xad4a('0x36')](respondWithResult(_0x516633,0xc9))[_0xad4a('0x29')](handleError(_0x516633,null));};exports[_0xad4a('0x35')]=function(_0xaf1125,_0x21030e){if(_0xaf1125[_0xad4a('0x5d')]['id']){delete _0xaf1125['body']['id'];}return db['FaxAccount'][_0xad4a('0x5b')]({'where':{'id':_0xaf1125[_0xad4a('0x57')]['id']},'include':[{'model':db[_0xad4a('0x58')],'as':_0xad4a('0x59')}]})[_0xad4a('0x36')](handleEntityNotFound(_0x21030e,null))[_0xad4a('0x36')](saveUpdates(_0xaf1125[_0xad4a('0x5d')],null))[_0xad4a('0x36')](respondWithResult(_0x21030e,null))[_0xad4a('0x29')](handleError(_0x21030e,null));};exports['destroy']=function(_0x1d42ee,_0x2384fc){return db[_0xad4a('0x3f')][_0xad4a('0x5b')]({'where':{'id':_0x1d42ee[_0xad4a('0x57')]['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x2384fc,null))['then'](removeEntity(_0x2384fc,null))[_0xad4a('0x29')](handleError(_0x2384fc,null));};exports[_0xad4a('0x66')]=function(_0x562048,_0x2ecd88){return db[_0xad4a('0x3f')][_0xad4a('0x66')]()[_0xad4a('0x36')](respondWithResult(_0x2ecd88,null))[_0xad4a('0x29')](handleError(_0x2ecd88,null));};exports[_0xad4a('0x67')]=function(_0x2be572,_0x222066,_0x68516d){if(_0x2be572[_0xad4a('0x5d')]['id']){delete _0x2be572[_0xad4a('0x5d')]['id'];}return db[_0xad4a('0x3f')][_0xad4a('0x5b')]({'where':{'id':_0x2be572[_0xad4a('0x57')]['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x222066,null))['then'](function(_0x493522){if(_0x493522){_0x2be572['body'][_0xad4a('0x68')]=_0x493522['id'];return db[_0xad4a('0x69')]['create'](_0x2be572['body']);}})['then'](respondWithResult(_0x222066,null))[_0xad4a('0x29')](handleError(_0x222066,null));};exports[_0xad4a('0x6a')]=function(_0x4d1d28,_0x35110c,_0x28a65e){var _0x5852af={'raw':![],'where':{}};var _0x3cca57={};var _0x240670={'count':0x0,'rows':[]};return db[_0xad4a('0x3f')][_0xad4a('0x6b')]({'where':{'id':_0x4d1d28[_0xad4a('0x57')]['id']}})['then'](handleEntityNotFound(_0x35110c,null))['then'](function(_0x23d716){if(_0x23d716){_0x3cca57['model']=_['keys'](db[_0xad4a('0x69')][_0xad4a('0x40')]);_0x3cca57[_0xad4a('0x44')]=_[_0xad4a('0x45')](_0x4d1d28[_0xad4a('0x44')]);_0x3cca57[_0xad4a('0x46')]=_[_0xad4a('0x49')](_0x3cca57[_0xad4a('0x47')],_0x3cca57[_0xad4a('0x44')]);_0x5852af[_0xad4a('0x48')]=_['intersection'](_0x3cca57[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0x4d1d28[_0xad4a('0x44')]['fields']));_0x5852af[_0xad4a('0x48')]=_0x5852af[_0xad4a('0x48')][_0xad4a('0x4b')]?_0x5852af[_0xad4a('0x48')]:_0x3cca57[_0xad4a('0x47')];if(!_0x4d1d28[_0xad4a('0x44')][_0xad4a('0x4c')](_0xad4a('0x6c'))){_0x5852af[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0x4d1d28[_0xad4a('0x44')][_0xad4a('0x2e')]);_0x5852af['offset']=qs['offset'](_0x4d1d28[_0xad4a('0x44')]['offset']);}_0x5852af[_0xad4a('0x4d')]=qs[_0xad4a('0x4e')](_0x4d1d28['query']['sort']);_0x5852af[_0xad4a('0x51')]=qs[_0xad4a('0x46')](_[_0xad4a('0x4f')](_0x4d1d28['query'],_0x3cca57[_0xad4a('0x46')]));_0x5852af['where'][_0xad4a('0x68')]=_0x23d716['id'];if(_0x4d1d28[_0xad4a('0x44')]['filter']){_0x5852af[_0xad4a('0x51')]=_[_0xad4a('0x52')](_0x5852af[_0xad4a('0x51')],{'$or':_[_0xad4a('0x3e')](_0x5852af[_0xad4a('0x48')],function(_0x160e8f){var _0x1f89ed={};_0x1f89ed[_0x160e8f]={'$like':'%'+_0x4d1d28['query']['filter']+'%'};return _0x1f89ed;})});}_0x5852af=_[_0xad4a('0x52')]({},_0x5852af,_0x4d1d28[_0xad4a('0x5a')]);return db[_0xad4a('0x69')]['count']({'where':_0x5852af['where']})[_0xad4a('0x36')](function(_0x3144b6){_0x240670[_0xad4a('0x2f')]=_0x3144b6;if(_0x4d1d28[_0xad4a('0x44')]['includeAll']){_0x5852af[_0xad4a('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xad4a('0x6d')](_0x5852af);})[_0xad4a('0x36')](function(_0x5ba072){_0x240670['rows']=_0x5ba072;return _0x240670;});}})['then'](respondWithFilteredResult(_0x35110c,_0x5852af))[_0xad4a('0x29')](handleError(_0x35110c,null));};exports['removeDispositions']=function(_0x38c413,_0x377878,_0x43fde5){return db[_0xad4a('0x3f')]['find']({'where':{'id':_0x38c413['params']['id']}})['then'](handleEntityNotFound(_0x377878,null))[_0xad4a('0x36')](function(_0x42223e){if(_0x42223e){return _0x42223e[_0xad4a('0x6e')](_0x38c413[_0xad4a('0x44')]['ids']);}})[_0xad4a('0x36')](respondWithStatusCode(_0x377878,null))[_0xad4a('0x29')](handleError(_0x377878,null));};exports['addAnswer']=function(_0x119023,_0xe0b2ff,_0x5161f4){if(_0x119023[_0xad4a('0x5d')]['id']){delete _0x119023[_0xad4a('0x5d')]['id'];}return db[_0xad4a('0x3f')][_0xad4a('0x5b')]({'where':{'id':_0x119023['params']['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0xe0b2ff,null))[_0xad4a('0x36')](function(_0x44e6d8){if(_0x44e6d8){_0x119023[_0xad4a('0x5d')][_0xad4a('0x68')]=_0x44e6d8['id'];return db[_0xad4a('0x6f')][_0xad4a('0x5c')](_0x119023[_0xad4a('0x5d')]);}})[_0xad4a('0x36')](respondWithResult(_0xe0b2ff,null))[_0xad4a('0x29')](handleError(_0xe0b2ff,null));};exports[_0xad4a('0x70')]=function(_0x28b19c,_0x3261ae,_0x64fe39){var _0x154110={'raw':![],'where':{}};var _0x11f4fc={};var _0x90012f={'count':0x0,'rows':[]};return db[_0xad4a('0x3f')][_0xad4a('0x6b')]({'where':{'id':_0x28b19c[_0xad4a('0x57')]['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x3261ae,null))[_0xad4a('0x36')](function(_0x36585a){if(_0x36585a){_0x11f4fc[_0xad4a('0x47')]=_[_0xad4a('0x45')](db[_0xad4a('0x6f')][_0xad4a('0x40')]);_0x11f4fc['query']=_[_0xad4a('0x45')](_0x28b19c['query']);_0x11f4fc['filters']=_[_0xad4a('0x49')](_0x11f4fc[_0xad4a('0x47')],_0x11f4fc[_0xad4a('0x44')]);_0x154110[_0xad4a('0x48')]=_[_0xad4a('0x49')](_0x11f4fc[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0x28b19c['query'][_0xad4a('0x4a')]));_0x154110[_0xad4a('0x48')]=_0x154110[_0xad4a('0x48')][_0xad4a('0x4b')]?_0x154110['attributes']:_0x11f4fc[_0xad4a('0x47')];if(!_0x28b19c[_0xad4a('0x44')][_0xad4a('0x4c')](_0xad4a('0x6c'))){_0x154110[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0x28b19c[_0xad4a('0x44')]['limit']);_0x154110['offset']=qs['offset'](_0x28b19c['query'][_0xad4a('0x2c')]);}_0x154110[_0xad4a('0x4d')]=qs['sort'](_0x28b19c['query'][_0xad4a('0x4e')]);_0x154110[_0xad4a('0x51')]=qs[_0xad4a('0x46')](_[_0xad4a('0x4f')](_0x28b19c[_0xad4a('0x44')],_0x11f4fc['filters']));_0x154110['where']['FaxAccountId']=_0x36585a['id'];if(_0x28b19c[_0xad4a('0x44')][_0xad4a('0x50')]){_0x154110['where']=_[_0xad4a('0x52')](_0x154110['where'],{'$or':_[_0xad4a('0x3e')](_0x154110[_0xad4a('0x48')],function(_0x145ed5){var _0x130c8e={};_0x130c8e[_0x145ed5]={'$like':'%'+_0x28b19c[_0xad4a('0x44')][_0xad4a('0x50')]+'%'};return _0x130c8e;})});}_0x154110=_[_0xad4a('0x52')]({},_0x154110,_0x28b19c['options']);return db[_0xad4a('0x6f')]['count']({'where':_0x154110[_0xad4a('0x51')]})[_0xad4a('0x36')](function(_0x5ddaa1){_0x90012f[_0xad4a('0x2f')]=_0x5ddaa1;if(_0x28b19c['query'][_0xad4a('0x53')]){_0x154110[_0xad4a('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xad4a('0x6d')](_0x154110);})[_0xad4a('0x36')](function(_0x4e9dde){_0x90012f[_0xad4a('0x55')]=_0x4e9dde;return _0x90012f;});}})[_0xad4a('0x36')](respondWithFilteredResult(_0x3261ae,_0x154110))[_0xad4a('0x29')](handleError(_0x3261ae,null));};exports[_0xad4a('0x71')]=function(_0x5d0b94,_0x516bf5,_0x2d06d9){return db[_0xad4a('0x3f')][_0xad4a('0x5b')]({'where':{'id':_0x5d0b94['params']['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x516bf5,null))[_0xad4a('0x36')](function(_0x4f6561){if(_0x4f6561){return _0x4f6561['removeAnswers'](_0x5d0b94[_0xad4a('0x44')][_0xad4a('0x72')]);}})['then'](respondWithStatusCode(_0x516bf5,null))[_0xad4a('0x29')](handleError(_0x516bf5,null));};exports['addInteraction']=function(_0x11ce19,_0x44a4c5,_0xd94a5f){return db[_0xad4a('0x73')]['find']({'where':{'id':_0x11ce19[_0xad4a('0x57')]['id']}})['then'](handleEntityNotFound(_0x44a4c5,null))[_0xad4a('0x36')](function(_0x1b2249){if(_0x1b2249){return _0x1b2249[_0xad4a('0x74')](_0x11ce19[_0xad4a('0x5d')][_0xad4a('0x72')],_['omit'](_0x11ce19[_0xad4a('0x5d')],['ids','id'])||{});}})[_0xad4a('0x36')](respondWithResult(_0x44a4c5,null))[_0xad4a('0x29')](handleError(_0x44a4c5,null));};exports[_0xad4a('0x75')]=function(_0xe0beae,_0xa34630,_0x446e9f){var _0x257985={'raw':![],'where':{}};var _0x437b14={};var _0x2c4115={'count':0x0,'rows':[]};return db[_0xad4a('0x3f')][_0xad4a('0x6b')]({'where':{'id':_0xe0beae['params']['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0xa34630,null))[_0xad4a('0x36')](function(_0x1c76d5){if(_0x1c76d5){_0x437b14[_0xad4a('0x47')]=_[_0xad4a('0x45')](db['FaxInteraction'][_0xad4a('0x40')]);_0x437b14[_0xad4a('0x44')]=_['keys'](_0xe0beae[_0xad4a('0x44')]);_0x437b14[_0xad4a('0x46')]=_['intersection'](_0x437b14['model'],_0x437b14[_0xad4a('0x44')]);_0x257985['attributes']=_[_0xad4a('0x49')](_0x437b14[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0xe0beae[_0xad4a('0x44')][_0xad4a('0x4a')]));_0x257985[_0xad4a('0x48')]=_0x257985[_0xad4a('0x48')][_0xad4a('0x4b')]?_0x257985[_0xad4a('0x48')]:_0x437b14[_0xad4a('0x47')];if(!_0xe0beae[_0xad4a('0x44')][_0xad4a('0x4c')]('nolimit')){_0x257985[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0xe0beae[_0xad4a('0x44')][_0xad4a('0x2e')]);_0x257985[_0xad4a('0x2c')]=qs['offset'](_0xe0beae[_0xad4a('0x44')][_0xad4a('0x2c')]);}_0x257985[_0xad4a('0x4d')]=qs['sort'](_0xe0beae[_0xad4a('0x44')]['sort']);_0x257985[_0xad4a('0x51')]=qs['filters'](_[_0xad4a('0x4f')](_0xe0beae[_0xad4a('0x44')],_0x437b14[_0xad4a('0x46')]));_0x257985[_0xad4a('0x51')][_0xad4a('0x68')]=_0x1c76d5['id'];if(_0xe0beae[_0xad4a('0x44')][_0xad4a('0x50')]){_0x257985[_0xad4a('0x51')]=_[_0xad4a('0x52')](_0x257985[_0xad4a('0x51')],{'$or':_[_0xad4a('0x3e')](_0x257985[_0xad4a('0x48')],function(_0x499b31){var _0x5a1e18={};_0x5a1e18[_0x499b31]={'$like':'%'+_0xe0beae[_0xad4a('0x44')][_0xad4a('0x50')]+'%'};return _0x5a1e18;})});}_0x257985=_[_0xad4a('0x52')]({},_0x257985,_0xe0beae[_0xad4a('0x5a')]);return db[_0xad4a('0x73')][_0xad4a('0x2f')]({'where':_0x257985['where']})[_0xad4a('0x36')](function(_0x315ad0){_0x2c4115['count']=_0x315ad0;if(_0xe0beae[_0xad4a('0x44')][_0xad4a('0x53')]){_0x257985[_0xad4a('0x54')]=[{'model':db[_0xad4a('0x76')],'as':_0xad4a('0x77'),'required':![]},{'model':db[_0xad4a('0x78')],'as':_0xad4a('0x79'),'attributes':[_0xad4a('0x3b'),_0xad4a('0x7a'),_0xad4a('0x7b')],'required':![]},{'model':db['Tag'],'as':_0xad4a('0x7c'),'attributes':['id',_0xad4a('0x3b'),_0xad4a('0x7d')],'where':_0xe0beae['query']['tag']?{'id':_0xe0beae['query'][_0xad4a('0x7e')]}:undefined,'required':_0xe0beae[_0xad4a('0x44')][_0xad4a('0x7e')]?!![]:![]}];}return db[_0xad4a('0x73')]['findAll'](_0x257985);})[_0xad4a('0x36')](function(_0x5a24ac){_0x2c4115['rows']=_0x5a24ac;return _0x2c4115;});}})['then'](respondWithFilteredResult(_0xa34630,_0x257985))['catch'](handleError(_0xa34630,null));};exports['addApplications']=function(_0xb26803,_0x810b63,_0x23d6a3){return db[_0xad4a('0x3f')][_0xad4a('0x6b')]({'where':{'id':_0xb26803[_0xad4a('0x57')]['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x810b63,null))[_0xad4a('0x36')](function(_0x1aa1e3){if(_0x1aa1e3){return db[_0xad4a('0x7f')][_0xad4a('0x80')](function(_0x8a9d0b){return db['FaxApplication'][_0xad4a('0x37')]({'where':{'FaxAccountId':_0xb26803[_0xad4a('0x57')]['id']},'transaction':_0x8a9d0b})[_0xad4a('0x36')](function(_0x2bde1b){var _0x52f924=_[_0xad4a('0x3e')](_0xb26803[_0xad4a('0x5d')],function(_0x3cfd38){_0x3cfd38[_0xad4a('0x68')]=_0xb26803[_0xad4a('0x57')]['id'];return _0x3cfd38;});return db[_0xad4a('0x81')]['bulkCreate'](_0x52f924,{'transaction':_0x8a9d0b});});})[_0xad4a('0x36')](function(){return db[_0xad4a('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0xb26803[_0xad4a('0x57')]['id']},'order':_0xad4a('0x82')});});}})['then'](respondWithResult(_0x810b63,null))[_0xad4a('0x29')](handleError(_0x810b63,null));};exports[_0xad4a('0x83')]=function(_0x133d07,_0xecdbc7,_0x5de130){var _0x12023c={};var _0x3bf053={};var _0x399d55;var _0x4a451c;return db['FaxAccount'][_0xad4a('0x6b')]({'where':{'id':_0x133d07[_0xad4a('0x57')]['id']}})['then'](handleEntityNotFound(_0xecdbc7,null))[_0xad4a('0x36')](function(_0x23057f){if(_0x23057f){_0x399d55=_0x23057f;_0x3bf053[_0xad4a('0x47')]=_[_0xad4a('0x45')](db['FaxApplication'][_0xad4a('0x40')]);_0x3bf053['query']=_[_0xad4a('0x45')](_0x133d07[_0xad4a('0x44')]);_0x3bf053[_0xad4a('0x46')]=_[_0xad4a('0x49')](_0x3bf053['model'],_0x3bf053[_0xad4a('0x44')]);_0x12023c[_0xad4a('0x48')]=_[_0xad4a('0x49')](_0x3bf053['model'],qs[_0xad4a('0x4a')](_0x133d07['query'][_0xad4a('0x4a')]));_0x12023c['attributes']=_0x12023c['attributes'][_0xad4a('0x4b')]?_0x12023c[_0xad4a('0x48')]:_0x3bf053[_0xad4a('0x47')];_0x12023c[_0xad4a('0x4d')]=qs[_0xad4a('0x4e')](_0x133d07['query'][_0xad4a('0x4e')]);_0x12023c[_0xad4a('0x51')]=qs[_0xad4a('0x46')](_[_0xad4a('0x4f')](_0x133d07[_0xad4a('0x44')],_0x3bf053[_0xad4a('0x46')]));if(_0x133d07[_0xad4a('0x44')]['filter']){_0x12023c[_0xad4a('0x51')]=_[_0xad4a('0x52')](_0x12023c['where'],{'$or':_[_0xad4a('0x3e')](_0x12023c['attributes'],function(_0x5d4533){var _0x256645={};_0x256645[_0x5d4533]={'$like':'%'+_0x133d07[_0xad4a('0x44')][_0xad4a('0x50')]+'%'};return _0x256645;})});}_0x12023c=_[_0xad4a('0x52')]({},_0x12023c,_0x133d07[_0xad4a('0x5a')]);return _0x399d55[_0xad4a('0x83')](_0x12023c);}})[_0xad4a('0x36')](function(_0x504bd8){if(_0x504bd8){_0x4a451c=_0x504bd8['length'];if(!_0x133d07[_0xad4a('0x44')]['hasOwnProperty']('nolimit')){_0x12023c[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0x133d07[_0xad4a('0x44')]['limit']);_0x12023c[_0xad4a('0x2c')]=qs['offset'](_0x133d07[_0xad4a('0x44')][_0xad4a('0x2c')]);}return _0x399d55[_0xad4a('0x83')](_0x12023c);}})[_0xad4a('0x36')](function(_0x25c589){if(_0x25c589){return _0x25c589?{'count':_0x4a451c,'rows':_0x25c589}:null;}})[_0xad4a('0x36')](respondWithResult(_0xecdbc7,null))['catch'](handleError(_0xecdbc7,null));};function Extension(_0x260fd5,_0x20b86a,_0x1bd613,_0x4657f6){this[_0xad4a('0x84')]='from-voip-provider';this[_0xad4a('0x85')]=_0x260fd5[_0xad4a('0x86')];this['app']=_0x4657f6;this['type']=_0xad4a('0x87');this[_0xad4a('0x88')]='Fax\x20Extension';this['FaxAccountId']=_0x260fd5['id'];this[_0xad4a('0x82')]=_0x20b86a;this[_0xad4a('0x89')]=_0x1bd613;}function createExtensionsReciveFax(_0x501c74){var _0x5cd65a=0x1;var _0x8521c7=[];_0x8521c7[_0xad4a('0x8a')](new Extension(_0x501c74,_0x5cd65a,'','Answer'));_0x5cd65a+=0x1;_0x8521c7[_0xad4a('0x8a')](new Extension(_0x501c74,_0x5cd65a,_0xad4a('0x8b'),_0xad4a('0x8c')));_0x5cd65a+=0x1;for(var _0x59d780 in _0x501c74){if(_0x501c74[_0xad4a('0x4c')](_0x59d780)&&(_0x59d780===_0xad4a('0x8d')||_0x59d780==='localstationid'||_0x59d780==='gateway'||_0x59d780==='faxdetect'||_0x59d780===_0xad4a('0x8e')||_0x59d780==='maxrate'||_0x59d780===_0xad4a('0x8f')||_0x59d780===_0xad4a('0x90')||_0x59d780==='t38timeout')){_0x8521c7[_0xad4a('0x8a')](new Extension(_0x501c74,_0x5cd65a,_0xad4a('0x91')+_0x59d780+')='+_0x501c74[_0x59d780],_0xad4a('0x8c')));_0x5cd65a+=0x1;}}_0x8521c7[_0xad4a('0x8a')](new Extension(_0x501c74,_0x5cd65a,'6',_0xad4a('0x92')));_0x5cd65a+=0x1;_0x8521c7[_0xad4a('0x8a')](new Extension(_0x501c74,_0x5cd65a,'/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'));_0x5cd65a=0x0;return _0x8521c7;}exports[_0xad4a('0x93')]=function(_0x2209e7,_0x259042,_0x552e92){var _0xbb6d06;return db[_0xad4a('0x7f')][_0xad4a('0x80')](function(_0x815afc){return db[_0xad4a('0x3f')][_0xad4a('0x5c')](_0x2209e7['body'],{'transaction':_0x815afc})[_0xad4a('0x36')](function(_0x3dd5a8){_0xbb6d06=_0x3dd5a8[_0xad4a('0x61')]({'plain':!![]});return db[_0xad4a('0x94')][_0xad4a('0x95')](createExtensionsReciveFax(_0xbb6d06),{'transaction':_0x815afc});});})[_0xad4a('0x36')](function(){return _0xbb6d06;})['then'](respondWithResult(_0x259042,null))[_0xad4a('0x29')](handleError(_0x259042,null));};exports[_0xad4a('0x96')]=function(_0x13d76e,_0x38e8b6,_0xb44ca4){var _0x24ad65;return db[_0xad4a('0x7f')][_0xad4a('0x80')](function(_0x2f0977){return db[_0xad4a('0x3f')][_0xad4a('0x35')](_0x13d76e[_0xad4a('0x5d')],{'where':{'id':_0x13d76e['body']['id']},'transaction':_0x2f0977})[_0xad4a('0x36')](function(_0xe6d68a){return db[_0xad4a('0x94')]['destroy']({'where':{'FaxAccountId':_0x13d76e[_0xad4a('0x5d')]['id']},'transaction':_0x2f0977})[_0xad4a('0x36')](function(_0x872cfc){return db['VoiceExtension'][_0xad4a('0x95')](createExtensionsReciveFax(_['omit'](_0x13d76e['body'],[_0xad4a('0x97'),_0xad4a('0x43'),_0xad4a('0x98'),_0xad4a('0x99'),_0xad4a('0x9a'),_0xad4a('0x9b')])),{'transaction':_0x2f0977});});});})['then'](function(){return db[_0xad4a('0x3f')][_0xad4a('0x9c')](_0x13d76e[_0xad4a('0x5d')]['id']);})[_0xad4a('0x36')](respondWithResult(_0x38e8b6,null))[_0xad4a('0x29')](handleError(_0x38e8b6,null));};exports['getMessages']=function(_0x3c1295,_0x4065e2,_0x1f2d43){var _0x4fbb8c={'raw':!![],'where':{}};var _0x3ff273={};var _0x39bcd3={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3c1295[_0xad4a('0x57')]['id']}})['then'](handleEntityNotFound(_0x4065e2,null))[_0xad4a('0x36')](function(_0x1e47a3){if(_0x1e47a3){_0x3ff273[_0xad4a('0x47')]=_[_0xad4a('0x45')](db['FaxMessage'][_0xad4a('0x40')]);_0x3ff273['query']=_[_0xad4a('0x45')](_0x3c1295[_0xad4a('0x44')]);_0x3ff273[_0xad4a('0x46')]=_[_0xad4a('0x49')](_0x3ff273['model'],_0x3ff273[_0xad4a('0x44')]);_0x4fbb8c[_0xad4a('0x48')]=_[_0xad4a('0x49')](_0x3ff273[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0x3c1295[_0xad4a('0x44')]['fields']));_0x4fbb8c['attributes']=_0x4fbb8c[_0xad4a('0x48')][_0xad4a('0x4b')]?_0x4fbb8c[_0xad4a('0x48')]:_0x3ff273[_0xad4a('0x47')];if(!_0x3c1295[_0xad4a('0x44')][_0xad4a('0x4c')](_0xad4a('0x6c'))){_0x4fbb8c[_0xad4a('0x2e')]=qs['limit'](_0x3c1295[_0xad4a('0x44')]['limit']);_0x4fbb8c[_0xad4a('0x2c')]=qs[_0xad4a('0x2c')](_0x3c1295['query'][_0xad4a('0x2c')]);}_0x4fbb8c[_0xad4a('0x4d')]=qs['sort'](_0x3c1295[_0xad4a('0x44')][_0xad4a('0x4e')]);_0x4fbb8c[_0xad4a('0x51')]=qs[_0xad4a('0x46')](_[_0xad4a('0x4f')](_0x3c1295[_0xad4a('0x44')],_0x3ff273[_0xad4a('0x46')]));_0x4fbb8c['where']['FaxAccountId']=_0x1e47a3['id'];if(_0x3c1295[_0xad4a('0x44')][_0xad4a('0x50')]){_0x4fbb8c[_0xad4a('0x51')]=_[_0xad4a('0x52')](_0x4fbb8c['where'],{'$or':_['map'](_0x4fbb8c['attributes'],function(_0x9a2bf7){var _0x4468d4={};_0x4468d4[_0x9a2bf7]={'$like':'%'+_0x3c1295[_0xad4a('0x44')][_0xad4a('0x50')]+'%'};return _0x4468d4;})});}if(_0x3c1295[_0xad4a('0x44')]['$gte']){var _0x4c7e10=_0x3c1295[_0xad4a('0x44')][_0xad4a('0x9d')][_0xad4a('0x9e')](',');var _0xb4d04e={};_0xb4d04e[_0x4c7e10[0x0]]={'$gte':moment(_0x4c7e10[0x1])[_0xad4a('0x9f')](_0xad4a('0xa0'))};_0x4fbb8c[_0xad4a('0x51')]=_['merge'](_0x4fbb8c[_0xad4a('0x51')],_0xb4d04e);}_0x4fbb8c=_[_0xad4a('0x52')]({},_0x4fbb8c,_0x3c1295[_0xad4a('0x5a')]);return db['FaxMessage'][_0xad4a('0x2f')]({'where':_0x4fbb8c[_0xad4a('0x51')]})[_0xad4a('0x36')](function(_0x1e721f){_0x39bcd3[_0xad4a('0x2f')]=_0x1e721f;if(_0x3c1295['query'][_0xad4a('0x53')]){_0x4fbb8c['include']=[{'all':!![]}];}return db[_0xad4a('0xa1')][_0xad4a('0x6d')](_0x4fbb8c);})[_0xad4a('0x36')](function(_0x2a5b2a){_0x39bcd3[_0xad4a('0x55')]=_0x2a5b2a;return _0x39bcd3;});}})[_0xad4a('0x36')](respondWithFilteredResult(_0x4065e2,_0x4fbb8c))['catch'](handleError(_0x4065e2,null));};exports[_0xad4a('0x3c')]=function(_0x570b21,_0x5a5df3,_0x59d9c5){var _0x2e87d8,_0x4f16a3={},_0x576f82;if(_0x570b21['body']['to']){_0x576f82=_0x570b21[_0xad4a('0x5d')]['to'][0x0];}return db['FaxAccount'][_0xad4a('0x5b')]({'where':{'id':_0x570b21['params']['id']},'include':[{'model':db[_0xad4a('0xa2')],'as':_0xad4a('0xa3'),'include':[{'model':db[_0xad4a('0x76')],'as':_0xad4a('0xa4'),'where':{'fax':_0x576f82},'limit':0x1,'order':[[_0xad4a('0x99'),_0xad4a('0xa5')]]}]}]})[_0xad4a('0x36')](handleEntityNotFound(_0x5a5df3,null))[_0xad4a('0x36')](function(_0x150539){_0x2e87d8=_0x150539;if(_0x570b21['body'][_0xad4a('0xa6')]&&_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][_0xad4a('0x4b')]){for(var _0x4f5421=0x0;_0x4f5421<_0x570b21['body'][_0xad4a('0xa6')][_0xad4a('0x4b')];_0x4f5421+=0x1){_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][_0x4f5421]={'filename':_0x570b21['body'][_0xad4a('0xa6')][_0x4f5421][_0xad4a('0x3b')],'id':_0x570b21[_0xad4a('0x5d')]['attachments'][_0x4f5421]['id'],'path':path['join'](config['root'],'server/files/attachments',_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][_0x4f5421][_0xad4a('0xa7')])};}}return respondWithRpcPromise(_0xad4a('0xa8'),_0xad4a('0xa8'),{'FaxAccountId':_[_0xad4a('0xa9')](_0x570b21[_0xad4a('0x57')]['id'])?undefined:_0x570b21['params']['id'],'path':_[_0xad4a('0xa9')](_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][0x0]['path'])?undefined:_0x570b21[_0xad4a('0x5d')]['attachments'][0x0][_0xad4a('0x6')],'fax':_['isNil'](_0x570b21[_0xad4a('0x5d')]['to'][0x0])?undefined:_0x570b21[_0xad4a('0x5d')]['to'][0x0]},client9002);})[_0xad4a('0x36')](function(){if(_0x2e87d8){if(_[_0xad4a('0xa9')](_0x570b21[_0xad4a('0x5d')][_0xad4a('0xaa')])){_0x570b21['body'][_0xad4a('0xaa')]=util[_0xad4a('0x9f')]('\x22%s\x22\x20<%s>',_0x2e87d8[_0xad4a('0x3b')],_0x2e87d8['fax']);}if(_0x2e87d8[_0xad4a('0xa3')]){if(_0x2e87d8[_0xad4a('0xa3')][_0xad4a('0xa4')]['length']){return _0x2e87d8['List'][_0xad4a('0xa4')][0x0];}else{return db['CmContact']['create'](_[_0xad4a('0x18')](_0x570b21[_0xad4a('0x5d')],{'firstName':_0x570b21['body']['to'][0x0],'phone':_0x570b21[_0xad4a('0x5d')]['to'][0x0],'fax':_0x570b21[_0xad4a('0x5d')]['to'][0x0],'ListId':_0x2e87d8[_0xad4a('0x9b')]}));}}else{throw new Error(_0xad4a('0xab'));}}else{throw new Error(_0xad4a('0xac'));}})[_0xad4a('0x36')](function(_0x107b24){if(_0x107b24){return db[_0xad4a('0x73')][_0xad4a('0x5b')]({'where':{'ContactId':_0x107b24['id'],'closed':![],'FaxAccountId':_0x2e87d8['id']}})[_0xad4a('0x36')](function(_0x18ac82){if(_0x18ac82){return[_0x18ac82,![]];}return db[_0xad4a('0x73')]['create']({'UserId':_0x570b21[_0xad4a('0x5e')]['id'],'ContactId':_0x107b24['id'],'FaxAccountId':_0x2e87d8['id'],'fax':_0x570b21[_0xad4a('0x5d')]['to'][0x0],'firstMsgDirection':_0xad4a('0xad'),'Messages':[_[_0xad4a('0x52')](_0x570b21[_0xad4a('0x5d')],{'read':![],'body':_0x570b21['body'][_0xad4a('0xa6')][0x0]['filename'],'FaxAccountId':_0x2e87d8['id'],'UserId':_0x570b21[_0xad4a('0x5e')]['id'],'ContactId':_0x107b24['id'],'AttachmentId':_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xad4a('0xa1')],'as':_0xad4a('0xae')}]})['then'](function(_0x4463d5){return[_0x4463d5,!![]];});});}else{throw new Error(_0xad4a('0xaf'));}})[_0xad4a('0xb0')](function(_0x55c412,_0x5ad616){if(_0x5ad616){return _0x55c412;}return db[_0xad4a('0xa1')][_0xad4a('0x5c')]({'direction':'out','read':![],'body':_0x570b21[_0xad4a('0x5d')]['attachments'][0x0]['filename'],'FaxAccountId':_0x2e87d8['id'],'FaxInteractionId':_0x55c412['id'],'UserId':_0x570b21[_0xad4a('0x5e')]['id'],'ContactId':_0x55c412['ContactId'],'AttachmentId':_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][0x0]['id']})[_0xad4a('0x36')](function(_0x15f69e){_0x55c412[_0xad4a('0xb1')][_0xad4a('0xae')]=[];_0x55c412[_0xad4a('0xb1')][_0xad4a('0xae')][_0xad4a('0x8a')](_0x15f69e[_0xad4a('0xb1')]);return _0x55c412;});})[_0xad4a('0x36')](function(_0x5005da){respondWithRpcPromise(_0xad4a('0xb2'),_0xad4a('0xb2'),{'FaxAccountId':_[_0xad4a('0xa9')](_0x570b21[_0xad4a('0x57')]['id'])?undefined:_0x570b21[_0xad4a('0x57')]['id'],'path':_[_0xad4a('0xa9')](_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][0x0]['path'])?undefined:_0x570b21[_0xad4a('0x5d')][_0xad4a('0xa6')][0x0]['path'],'fax':_[_0xad4a('0xa9')](_0x570b21[_0xad4a('0x5d')]['to'][0x0])?undefined:_0x570b21[_0xad4a('0x5d')]['to'][0x0],'AttachmentId':_0x570b21['body'][_0xad4a('0xa6')][0x0]['id']},client9002)[_0xad4a('0x36')](function(_0x325334){logger['info']('SendFaxRpc,\x20%s',_0x325334);})['catch'](function(_0x401d0a){logger[_0xad4a('0x20')](_0xad4a('0xb3'),_0x401d0a);});return _0x5005da;})[_0xad4a('0x36')](respondWithResult(_0x5a5df3,null))[_0xad4a('0x29')](handleError(_0x5a5df3,null));};exports[_0xad4a('0xb4')]=function(_0x176994,_0x378c15,_0x5dd723){return db['FaxAccount'][_0xad4a('0x5b')]({'where':{'id':_0x176994[_0xad4a('0x57')]['id']}})['then'](handleEntityNotFound(_0x378c15,null))[_0xad4a('0x36')](function(_0x427888){if(_0x427888){return _0x427888[_0xad4a('0xb4')](_0x176994['body'][_0xad4a('0x72')],_['omit'](_0x176994[_0xad4a('0x5d')],[_0xad4a('0x72'),'id'])||{})['spread'](function(_0x46d618){for(var _0x114e15=0x0;_0x114e15<_0x176994['body'][_0xad4a('0x72')][_0xad4a('0x4b')];_0x114e15+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x176994['body'][_0xad4a('0x72')][_0x114e15]),'FaxAccountId':Number(_0x176994[_0xad4a('0x57')]['id'])});}return _0x46d618;});}})['then'](respondWithResult(_0x378c15,null))['catch'](handleError(_0x378c15,null));};exports[_0xad4a('0xb5')]=function(_0x4e20c0,_0x4f7c20,_0x25e719){return db[_0xad4a('0x3f')][_0xad4a('0x5b')]({'where':{'id':_0x4e20c0[_0xad4a('0x57')]['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x4f7c20,null))['then'](function(_0x9109c){if(_0x9109c){return _0x9109c[_0xad4a('0xb5')](_0x4e20c0[_0xad4a('0x44')][_0xad4a('0x72')])['then'](function(){if(_['isArray'](_0x4e20c0['query']['ids'])){for(var _0x17a0e5=0x0;_0x17a0e5<_0x4e20c0[_0xad4a('0x44')][_0xad4a('0x72')][_0xad4a('0x4b')];_0x17a0e5+=0x1){socket[_0xad4a('0xb6')](_0xad4a('0xb7'),{'UserId':Number(_0x4e20c0['query'][_0xad4a('0x72')][_0x17a0e5]),'FaxAccountId':Number(_0x4e20c0['params']['id'])});}}else{socket[_0xad4a('0xb6')]('userFaxAccount:remove',{'UserId':Number(_0x4e20c0[_0xad4a('0x44')]['ids']),'FaxAccountId':Number(_0x4e20c0[_0xad4a('0x57')]['id'])});}});}})[_0xad4a('0x36')](respondWithStatusCode(_0x4f7c20,null))[_0xad4a('0x29')](handleError(_0x4f7c20,null));};exports[_0xad4a('0xb8')]=function(_0x53889a,_0x276d52,_0x4f64e3){var _0x5df287={};var _0x4678e2={};var _0x37a1d2;var _0xb214d8;return db[_0xad4a('0x3f')][_0xad4a('0x6b')]({'where':{'id':_0x53889a['params']['id']}})[_0xad4a('0x36')](handleEntityNotFound(_0x276d52,null))[_0xad4a('0x36')](function(_0x10292e){if(_0x10292e){_0x37a1d2=_0x10292e;_0x4678e2['model']=_[_0xad4a('0x45')](db[_0xad4a('0x78')][_0xad4a('0x40')]);_0x4678e2[_0xad4a('0x44')]=_[_0xad4a('0x45')](_0x53889a[_0xad4a('0x44')]);_0x4678e2[_0xad4a('0x46')]=_[_0xad4a('0x49')](_0x4678e2[_0xad4a('0x47')],_0x4678e2[_0xad4a('0x44')]);_0x5df287['attributes']=_[_0xad4a('0x49')](_0x4678e2[_0xad4a('0x47')],qs[_0xad4a('0x4a')](_0x53889a[_0xad4a('0x44')]['fields']));_0x5df287[_0xad4a('0x48')]=_0x5df287[_0xad4a('0x48')]['length']?_0x5df287[_0xad4a('0x48')]:_0x4678e2[_0xad4a('0x47')];_0x5df287[_0xad4a('0x4d')]=qs[_0xad4a('0x4e')](_0x53889a['query']['sort']);_0x5df287[_0xad4a('0x51')]=qs[_0xad4a('0x46')](_[_0xad4a('0x4f')](_0x53889a[_0xad4a('0x44')],_0x4678e2[_0xad4a('0x46')]));if(_0x53889a[_0xad4a('0x44')][_0xad4a('0x50')]){_0x5df287[_0xad4a('0x51')]=_[_0xad4a('0x52')](_0x5df287[_0xad4a('0x51')],{'$or':_[_0xad4a('0x3e')](_0x5df287[_0xad4a('0x48')],function(_0x13c1ff){var _0x5c407b={};_0x5c407b[_0x13c1ff]={'$like':'%'+_0x53889a[_0xad4a('0x44')][_0xad4a('0x50')]+'%'};return _0x5c407b;})});}_0x5df287=_[_0xad4a('0x52')]({},_0x5df287,_0x53889a['options']);return _0x37a1d2[_0xad4a('0xb8')](_0x5df287);}})[_0xad4a('0x36')](function(_0x1da3c4){if(_0x1da3c4){_0xb214d8=_0x1da3c4[_0xad4a('0x4b')];if(!_0x53889a[_0xad4a('0x44')][_0xad4a('0x4c')](_0xad4a('0x6c'))){_0x5df287[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0x53889a[_0xad4a('0x44')][_0xad4a('0x2e')]);_0x5df287[_0xad4a('0x2c')]=qs[_0xad4a('0x2c')](_0x53889a[_0xad4a('0x44')][_0xad4a('0x2c')]);}return _0x37a1d2[_0xad4a('0xb8')](_0x5df287);}})['then'](function(_0x1210ff){if(_0x1210ff){return _0x1210ff?{'count':_0xb214d8,'rows':_0x1210ff}:null;}})[_0xad4a('0x36')](respondWithResult(_0x276d52,null))[_0xad4a('0x29')](handleError(_0x276d52,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 1a8d31d..4515ca7 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 _0x30c7=['exports','events','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5dd265,_0x573dea){var _0x5c8f88=function(_0x110a9f){while(--_0x110a9f){_0x5dd265['push'](_0x5dd265['shift']());}};_0x5c8f88(++_0x573dea);}(_0x30c7,0x111));var _0x730c=function(_0x241937,_0x45f1c3){_0x241937=_0x241937-0x0;var _0x35a1ca=_0x30c7[_0x241937];return _0x35a1ca;};'use strict';var EventEmitter=require(_0x730c('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x730c('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x730c('0x2')](0x0);var events={'afterCreate':_0x730c('0x3'),'afterUpdate':'update','afterDestroy':_0x730c('0x4')};function emitEvent(_0x3e0a2f){return function(_0x49c816,_0x59a230,_0x4cf801){FaxAccountEvents['emit'](_0x3e0a2f+':'+_0x49c816['id'],_0x49c816);FaxAccountEvents[_0x730c('0x5')](_0x3e0a2f,_0x49c816);_0x4cf801(null);};}for(var e in events){if(events[_0x730c('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x730c('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xdd20=['update','emit','exports','events','setMaxListeners'];(function(_0x47ad14,_0x254c8d){var _0x1823be=function(_0x182868){while(--_0x182868){_0x47ad14['push'](_0x47ad14['shift']());}};_0x1823be(++_0x254c8d);}(_0xdd20,0x120));var _0x0dd2=function(_0x44b939,_0x569350){_0x44b939=_0x44b939-0x0;var _0x5f2664=_0xdd20[_0x44b939];return _0x5f2664;};'use strict';var EventEmitter=require(_0x0dd2('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0dd2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0dd2('0x2'),'afterDestroy':'remove'};function emitEvent(_0x10a702){return function(_0x4a09f3,_0x45b18d,_0x526e19){FaxAccountEvents[_0x0dd2('0x3')](_0x10a702+':'+_0x4a09f3['id'],_0x4a09f3);FaxAccountEvents[_0x0dd2('0x3')](_0x10a702,_0x4a09f3);_0x526e19(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x0dd2('0x4')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 827e050..89c3437 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 _0x4b6d=['./faxAccount.attributes','exports','define','FaxAccount','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x50a9e3,_0x3b3d88){var _0x46bac7=function(_0x3c48d4){while(--_0x3c48d4){_0x50a9e3['push'](_0x50a9e3['shift']());}};_0x46bac7(++_0x3b3d88);}(_0x4b6d,0x101));var _0xd4b6=function(_0xb2fb3d,_0x57ad24){_0xb2fb3d=_0xb2fb3d-0x0;var _0x4b5236=_0x4b6d[_0xb2fb3d];return _0x4b5236;};'use strict';var _=require(_0xd4b6('0x0'));var util=require(_0xd4b6('0x1'));var logger=require('../../config/logger')(_0xd4b6('0x2'));var moment=require(_0xd4b6('0x3'));var BPromise=require(_0xd4b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4b6('0x5'));var rimraf=require('rimraf');var config=require(_0xd4b6('0x6'));var attributes=require(_0xd4b6('0x7'));module[_0xd4b6('0x8')]=function(_0x1a037d,_0x55b193){return _0x1a037d[_0xd4b6('0x9')](_0xd4b6('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x838a=['moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','lodash','util','../../config/logger'];(function(_0x1b53ed,_0x37b039){var _0x8d8f86=function(_0x984400){while(--_0x984400){_0x1b53ed['push'](_0x1b53ed['shift']());}};_0x8d8f86(++_0x37b039);}(_0x838a,0x168));var _0xa838=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x838a[_0x3ee55a];return _0x581800;};'use strict';var _=require(_0xa838('0x0'));var util=require(_0xa838('0x1'));var logger=require(_0xa838('0x2'))('api');var moment=require(_0xa838('0x3'));var BPromise=require(_0xa838('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa838('0x5'));var rimraf=require(_0xa838('0x6'));var config=require(_0xa838('0x7'));var attributes=require(_0xa838('0x8'));module['exports']=function(_0x216dd9,_0x5ca9b){return _0x216dd9[_0xa838('0x9')](_0xa838('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index e321ed0..f424a8d 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 _0x62a6=['body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','get','Applications','list','applications','orderBy','priority','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','created','interaction','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','options','limit','map','include','model','attributes','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId'];(function(_0x102236,_0x25ed0b){var _0x4d76ef=function(_0x591092){while(--_0x591092){_0x102236['push'](_0x102236['shift']());}};_0x4d76ef(++_0x25ed0b);}(_0x62a6,0x13e));var _0x662a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x62a6[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x662a('0x0'));var util=require(_0x662a('0x1'));var moment=require(_0x662a('0x2'));var BPromise=require(_0x662a('0x3'));var rs=require(_0x662a('0x4'));var fs=require('fs');var Redis=require(_0x662a('0x5'));var db=require(_0x662a('0x6'))['db'];var utils=require(_0x662a('0x7'));var logger=require(_0x662a('0x8'))(_0x662a('0x9'));var config=require(_0x662a('0xa'));var jayson=require(_0x662a('0xb'));var client=jayson[_0x662a('0xc')][_0x662a('0xd')]({'port':0x232c});config[_0x662a('0xe')]=_[_0x662a('0xf')](config[_0x662a('0xe')],{'host':_0x662a('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x662a('0xe')]));require(_0x662a('0x11'))[_0x662a('0x12')](socket);function respondWithRpcPromise(_0x43e00a,_0x4825f4,_0x21b7a9){return new BPromise(function(_0x269bdf,_0x19be8){return client['request'](_0x43e00a,_0x21b7a9)[_0x662a('0x13')](function(_0x3fc6a9){logger[_0x662a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x4825f4,_0x662a('0x15'));logger[_0x662a('0x16')](_0x662a('0x17'),_0x4825f4,_0x662a('0x15'),JSON[_0x662a('0x18')](_0x3fc6a9));if(_0x3fc6a9[_0x662a('0x19')]){if(_0x3fc6a9['error']['code']===0x1f4){logger[_0x662a('0x19')](_0x662a('0x1a'),_0x4825f4,_0x3fc6a9[_0x662a('0x19')]['message']);return _0x19be8(_0x3fc6a9[_0x662a('0x19')][_0x662a('0x1b')]);}logger['error'](_0x662a('0x1a'),_0x4825f4,_0x3fc6a9[_0x662a('0x19')][_0x662a('0x1b')]);return _0x269bdf(_0x3fc6a9[_0x662a('0x19')][_0x662a('0x1b')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4825f4,_0x662a('0x15'));_0x269bdf(_0x3fc6a9[_0x662a('0x1c')][_0x662a('0x1b')]);}})[_0x662a('0x1d')](function(_0xf6e1cc){logger[_0x662a('0x19')](_0x662a('0x1a'),_0x4825f4,_0xf6e1cc);_0x19be8(_0xf6e1cc);});});}exports[_0x662a('0x1e')]=function(_0x255a6b){var _0x57ec95=this;return new Promise(function(_0x26cc9f,_0x35f877){return db[_0x662a('0x1f')]['findAll']({'raw':_0x255a6b[_0x662a('0x20')]?_0x255a6b['options']['raw']===undefined?!![]:![]:!![],'where':_0x255a6b[_0x662a('0x20')]?_0x255a6b[_0x662a('0x20')]['where']||null:null,'attributes':_0x255a6b[_0x662a('0x20')]?_0x255a6b['options']['attributes']||null:null,'limit':_0x255a6b[_0x662a('0x20')]?_0x255a6b[_0x662a('0x20')][_0x662a('0x21')]||null:null,'include':_0x255a6b['options']?_0x255a6b['options']['include']?_[_0x662a('0x22')](_0x255a6b[_0x662a('0x20')][_0x662a('0x23')],function(_0x3f6849){return{'model':db[_0x3f6849[_0x662a('0x24')]],'as':_0x3f6849['as'],'attributes':_0x3f6849[_0x662a('0x25')],'include':_0x3f6849['include']?_['map'](_0x3f6849['include'],function(_0x54bde5){return{'model':db[_0x54bde5[_0x662a('0x24')]],'as':_0x54bde5['as'],'attributes':_0x54bde5[_0x662a('0x25')],'include':_0x54bde5[_0x662a('0x23')]?_[_0x662a('0x22')](_0x54bde5[_0x662a('0x23')],function(_0x4871f9){return{'model':db[_0x4871f9[_0x662a('0x24')]],'as':_0x4871f9['as'],'attributes':_0x4871f9[_0x662a('0x25')]};}):[]};}):[]};}):[]:[]})[_0x662a('0x13')](function(_0x3900d9){logger[_0x662a('0x14')]('GetFaxAccount',_0x255a6b);logger[_0x662a('0x16')](_0x662a('0x1e'),_0x255a6b,JSON[_0x662a('0x18')](_0x3900d9));_0x26cc9f(_0x3900d9);})[_0x662a('0x1d')](function(_0x2b0cf9){logger['error'](_0x662a('0x1e'),_0x2b0cf9['message'],_0x255a6b);_0x35f877(_0x57ec95[_0x662a('0x19')](0x1f4,_0x2b0cf9[_0x662a('0x1b')]));});});};exports[_0x662a('0x26')]=function(_0x4a380c,_0x44569b,_0x55c647){var _0x9c0602=this;return new Promise(function(_0x4f728b,_0x3e7fb0){var _0x3aaf3e={'body':_0x4a380c['body'],'channel':_0x662a('0x27')};var _0x326664=[];var _0x36b4d7=[];var _0x347b55={};return db[_0x662a('0x28')][_0x662a('0x29')]()[_0x662a('0x13')](function(_0xea1537){if(!_0xea1537){throw new db[(_0x662a('0x2a'))][(_0x662a('0x2b'))](_0x662a('0x2c'));}_0x326664=_[_0x662a('0x2d')](_[_0x662a('0x2e')](_0xea1537),[_0x662a('0x2f'),_0x662a('0x30')]);_0x36b4d7=_[_0x662a('0x2d')](_['keys'](_0xea1537),[_0x662a('0x2f'),_0x662a('0x30'),_0x662a('0x31'),'ListId']);if(_0x4a380c[_0x662a('0x32')]['id']){delete _0x4a380c[_0x662a('0x32')]['id'];}if(_[_0x662a('0x33')](_0x4a380c['body'][_0x662a('0x34')])){throw new db[(_0x662a('0x2a'))][(_0x662a('0x2b'))](_0x662a('0x35'));}if(_[_0x662a('0x33')](_0x4a380c[_0x662a('0x32')][_0x662a('0x32')])||_0x4a380c[_0x662a('0x32')][_0x662a('0x32')]===''){throw new db[(_0x662a('0x2a'))]['ValidationError'](_0x662a('0x36'));}if(_[_0x662a('0x33')](_0x4a380c[_0x662a('0x32')][_0x662a('0x37')])){throw new db[(_0x662a('0x2a'))]['ValidationError'](_0x662a('0x38')+_0x36b4d7);}if(!_[_0x662a('0x39')](_0x36b4d7,_0x4a380c['body'][_0x662a('0x37')])){throw new db[(_0x662a('0x2a'))][(_0x662a('0x2b'))](_0x662a('0x3a')+_0x36b4d7);}_0x347b55[_0x4a380c['body'][_0x662a('0x37')]]=_0x4a380c[_0x662a('0x32')]['from'];})['then'](function(){return db['FaxAccount'][_0x662a('0x3b')]({'where':{'id':_0x4a380c[_0x662a('0x3c')]['id']},'include':[{'model':db[_0x662a('0x3d')],'as':_0x662a('0x3e'),'include':[{'model':db[_0x662a('0x28')],'as':_0x662a('0x3f'),'where':_0x347b55,'limit':0x1,'order':[['updatedAt',_0x662a('0x40')]]}]},{'model':db[_0x662a('0x41')],'as':'Applications'}]});})[_0x662a('0x13')](function(_0xb66e7d){if(_0xb66e7d&&_0xb66e7d[_0x662a('0x3e')]){var _0x4c3630=_0xb66e7d[_0x662a('0x42')]({'plain':!![]});_0x3aaf3e['account']=_0x4c3630;_0x3aaf3e['applications']=_0x4c3630[_0x662a('0x43')];_0x3aaf3e[_0x662a('0x44')]=_0x4c3630[_0x662a('0x3e')];_0x3aaf3e[_0x662a('0x45')]=_[_0x662a('0x46')](_0x3aaf3e[_0x662a('0x45')],[_0x662a('0x47')],['asc']);if(_0x3aaf3e[_0x662a('0x3c')][_0x662a('0x43')]){delete _0x3aaf3e[_0x662a('0x3c')][_0x662a('0x43')];}if(_0x3aaf3e[_0x662a('0x3c')][_0x662a('0x3e')]&&_0x3aaf3e[_0x662a('0x3c')][_0x662a('0x3e')]['Contacts'][_0x662a('0x48')]){return _0x3aaf3e[_0x662a('0x3c')][_0x662a('0x3e')]['Contacts'][0x0];}var _0x17e1bc=_['defaults'](_0x4a380c[_0x662a('0x32')],{'firstName':_0x4a380c[_0x662a('0x32')][_0x662a('0x34')],'ListId':_0x4c3630['ListId']});_0x17e1bc[_0x4a380c[_0x662a('0x32')]['mapKey']]=_0x4a380c[_0x662a('0x32')][_0x662a('0x34')];return db[_0x662a('0x28')][_0x662a('0x49')](_0x17e1bc,{'fields':_0x326664,'raw':!![]});}})[_0x662a('0x13')](function(_0x3e8dae){_0x3aaf3e[_0x662a('0x4a')]=_0x3e8dae;if(_0x3e8dae){var _0x49f17d={'ContactId':_0x3e8dae['id'],'FaxAccountId':_0x4a380c[_0x662a('0x3c')]['id'],'fax':_0x3e8dae[_0x662a('0x27')]};return db[_0x662a('0x4b')][_0x662a('0x3b')]({'where':{'ContactId':_0x3e8dae['id'],'closed':![],'FaxAccountId':_0x4a380c[_0x662a('0x3c')]['id']}})[_0x662a('0x13')](function(_0x2d2d30){if(_0x2d2d30){return[_0x2d2d30,![]];}return db[_0x662a('0x4b')][_0x662a('0x49')](_0x49f17d)[_0x662a('0x13')](function(_0x49365c){return[_0x49365c,!![]];});});}else{throw new Error(_0x662a('0x4c'));}})['spread'](function(_0x1cc443,_0x4452e8){var _0x3c0d8f=_0x1cc443[_0x662a('0x42')]({'plain':!![]});if(_0x4452e8){if(_0x3aaf3e['account'][_0x662a('0x4d')]){_0x3aaf3e['applications'][_0x662a('0x4e')]({'id':0x0,'priority':_0x3aaf3e[_0x662a('0x45')]['length']+0x1,'app':_0x662a('0x4f'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x3c0d8f['created']=!![];}else{_0x3c0d8f[_0x662a('0x50')]=![];}_0x3aaf3e[_0x662a('0x51')]=_0x3c0d8f;return db['FaxMessage'][_0x662a('0x49')]({'body':_0x4a380c[_0x662a('0x32')][_0x662a('0x32')],'FaxAccountId':_0x4a380c[_0x662a('0x3c')]['id'],'FaxInteractionId':_0x1cc443['id'],'direction':'in','ContactId':_0x1cc443[_0x662a('0x52')],'AttachmentId':_0x4a380c[_0x662a('0x32')][_0x662a('0x53')]});})['then'](function(_0x16c75d){_0x3aaf3e[_0x662a('0x1b')]=_0x16c75d;if(_0x3aaf3e[_0x662a('0x51')]['UserId']){return db[_0x662a('0x54')][_0x662a('0x3b')]({'attributes':['id',_0x662a('0x55')],'where':{'id':_0x3aaf3e[_0x662a('0x51')][_0x662a('0x56')]}})[_0x662a('0x13')](function(_0x5caf4f){if(_0x5caf4f){_0x3aaf3e[_0x662a('0x45')][_0x662a('0x57')]({'id':0x0,'priority':0x0,'app':_0x662a('0x58'),'appdata':_0x5caf4f[_0x662a('0x55')]+','+(_0x3aaf3e['account'][_0x662a('0x59')]||0xa),'interval':_0x662a('0x5a')});}return respondWithRpcPromise('Start',_0x662a('0x5b'),_0x3aaf3e);});}return respondWithRpcPromise('Start','startRouting',_0x3aaf3e);})[_0x662a('0x13')](function(_0x5b61d5){_0x4f728b(_0x5b61d5);})['catch'](function(_0x40b8bb){_0x3e7fb0(_0x9c0602['error'](0x1f4,_0x40b8bb[_0x662a('0x1b')]));});});}; \ No newline at end of file +var _0x1124=['length','ListId','contact','fax','FaxInteraction','Contact\x20not\x20found','autoclose','close','*,*,*,*','interaction','create','ContactId','AttachmentId','name','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','CmContact','Sequelize','ValidationError','keys','updatedAt','createdAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','CmList','List','Contacts','DESC','FaxApplication','get','account','Applications','list','applications','orderBy','priority'];(function(_0x375f06,_0x26abae){var _0x1d29ad=function(_0xc19f2d){while(--_0xc19f2d){_0x375f06['push'](_0x375f06['shift']());}};_0x1d29ad(++_0x26abae);}(_0x1124,0x167));var _0x4112=function(_0x118b82,_0xb96ffb){_0x118b82=_0x118b82-0x0;var _0x2b0a16=_0x1124[_0x118b82];return _0x2b0a16;};'use strict';var _=require(_0x4112('0x0'));var util=require(_0x4112('0x1'));var moment=require('moment');var BPromise=require(_0x4112('0x2'));var rs=require(_0x4112('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4112('0x4'));var logger=require(_0x4112('0x5'))('rpc');var config=require(_0x4112('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4112('0x7')]['http']({'port':0x232c});config[_0x4112('0x8')]=_[_0x4112('0x9')](config[_0x4112('0x8')],{'host':_0x4112('0xa'),'port':0x18eb});var socket=require(_0x4112('0xb'))(new Redis(config[_0x4112('0x8')]));require(_0x4112('0xc'))[_0x4112('0xd')](socket);function respondWithRpcPromise(_0x5ee90f,_0x50a510,_0x4daadd){return new BPromise(function(_0x48f0f5,_0x4b4b0a){return client['request'](_0x5ee90f,_0x4daadd)['then'](function(_0x127d14){logger['info'](_0x4112('0xe'),_0x50a510,'request\x20sent');logger[_0x4112('0xf')](_0x4112('0x10'),_0x50a510,_0x4112('0x11'),JSON[_0x4112('0x12')](_0x127d14));if(_0x127d14[_0x4112('0x13')]){if(_0x127d14['error'][_0x4112('0x14')]===0x1f4){logger[_0x4112('0x13')](_0x4112('0xe'),_0x50a510,_0x127d14[_0x4112('0x13')]['message']);return _0x4b4b0a(_0x127d14[_0x4112('0x13')][_0x4112('0x15')]);}logger[_0x4112('0x13')](_0x4112('0xe'),_0x50a510,_0x127d14['error'][_0x4112('0x15')]);return _0x48f0f5(_0x127d14[_0x4112('0x13')][_0x4112('0x15')]);}else{logger[_0x4112('0x16')](_0x4112('0xe'),_0x50a510,_0x4112('0x11'));_0x48f0f5(_0x127d14[_0x4112('0x17')]['message']);}})[_0x4112('0x18')](function(_0x469074){logger[_0x4112('0x13')](_0x4112('0xe'),_0x50a510,_0x469074);_0x4b4b0a(_0x469074);});});}exports[_0x4112('0x19')]=function(_0x2a633e){var _0x2472ea=this;return new Promise(function(_0x365d42,_0x3c3615){return db[_0x4112('0x1a')][_0x4112('0x1b')]({'raw':_0x2a633e[_0x4112('0x1c')]?_0x2a633e[_0x4112('0x1c')][_0x4112('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a633e[_0x4112('0x1c')]?_0x2a633e[_0x4112('0x1c')][_0x4112('0x1e')]||null:null,'attributes':_0x2a633e['options']?_0x2a633e[_0x4112('0x1c')][_0x4112('0x1f')]||null:null,'limit':_0x2a633e[_0x4112('0x1c')]?_0x2a633e['options'][_0x4112('0x20')]||null:null,'include':_0x2a633e[_0x4112('0x1c')]?_0x2a633e[_0x4112('0x1c')][_0x4112('0x21')]?_[_0x4112('0x22')](_0x2a633e['options'][_0x4112('0x21')],function(_0x11dd38){return{'model':db[_0x11dd38[_0x4112('0x23')]],'as':_0x11dd38['as'],'attributes':_0x11dd38[_0x4112('0x1f')],'include':_0x11dd38[_0x4112('0x21')]?_[_0x4112('0x22')](_0x11dd38[_0x4112('0x21')],function(_0x23db56){return{'model':db[_0x23db56['model']],'as':_0x23db56['as'],'attributes':_0x23db56[_0x4112('0x1f')],'include':_0x23db56[_0x4112('0x21')]?_[_0x4112('0x22')](_0x23db56[_0x4112('0x21')],function(_0x5d56ce){return{'model':db[_0x5d56ce[_0x4112('0x23')]],'as':_0x5d56ce['as'],'attributes':_0x5d56ce[_0x4112('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4112('0x24')](function(_0x15826a){logger[_0x4112('0x16')]('GetFaxAccount',_0x2a633e);logger[_0x4112('0xf')]('GetFaxAccount',_0x2a633e,JSON[_0x4112('0x12')](_0x15826a));_0x365d42(_0x15826a);})['catch'](function(_0x230c27){logger[_0x4112('0x13')](_0x4112('0x19'),_0x230c27[_0x4112('0x15')],_0x2a633e);_0x3c3615(_0x2472ea[_0x4112('0x13')](0x1f4,_0x230c27[_0x4112('0x15')]));});});};exports['NotifyFaxAccount']=function(_0x13691a,_0x20609a,_0x1b2a79){var _0x1ce703=this;return new Promise(function(_0x5bf0e5,_0x5093f4){var _0x33cc73={'body':_0x13691a['body'],'channel':'fax'};var _0x5b734f=[];var _0xc4cc17=[];var _0x3bca12={};return db[_0x4112('0x25')]['describe']()['then'](function(_0x271ca0){if(!_0x271ca0){throw new db[(_0x4112('0x26'))][(_0x4112('0x27'))]('no\x20available\x20attributes');}_0x5b734f=_['difference'](_[_0x4112('0x28')](_0x271ca0),['createdAt',_0x4112('0x29')]);_0xc4cc17=_['difference'](_['keys'](_0x271ca0),[_0x4112('0x2a'),_0x4112('0x29'),_0x4112('0x2b'),'ListId']);if(_0x13691a[_0x4112('0x2c')]['id']){delete _0x13691a[_0x4112('0x2c')]['id'];}if(_[_0x4112('0x2d')](_0x13691a['body'][_0x4112('0x2e')])){throw new db[(_0x4112('0x26'))][(_0x4112('0x27'))](_0x4112('0x2f'));}if(_[_0x4112('0x2d')](_0x13691a[_0x4112('0x2c')][_0x4112('0x2c')])||_0x13691a['body']['body']===''){throw new db['Sequelize'][(_0x4112('0x27'))](_0x4112('0x30'));}if(_[_0x4112('0x2d')](_0x13691a[_0x4112('0x2c')]['mapKey'])){throw new db[(_0x4112('0x26'))][(_0x4112('0x27'))](_0x4112('0x31')+_0xc4cc17);}if(!_[_0x4112('0x32')](_0xc4cc17,_0x13691a[_0x4112('0x2c')]['mapKey'])){throw new db[(_0x4112('0x26'))][(_0x4112('0x27'))](_0x4112('0x33')+_0xc4cc17);}_0x3bca12[_0x13691a[_0x4112('0x2c')][_0x4112('0x34')]]=_0x13691a[_0x4112('0x2c')][_0x4112('0x2e')];})[_0x4112('0x24')](function(){return db[_0x4112('0x1a')][_0x4112('0x35')]({'where':{'id':_0x13691a['account']['id']},'include':[{'model':db[_0x4112('0x36')],'as':_0x4112('0x37'),'include':[{'model':db[_0x4112('0x25')],'as':_0x4112('0x38'),'where':_0x3bca12,'limit':0x1,'order':[[_0x4112('0x29'),_0x4112('0x39')]]}]},{'model':db[_0x4112('0x3a')],'as':'Applications'}]});})[_0x4112('0x24')](function(_0x347c12){if(_0x347c12&&_0x347c12[_0x4112('0x37')]){var _0x281af7=_0x347c12[_0x4112('0x3b')]({'plain':!![]});_0x33cc73[_0x4112('0x3c')]=_0x281af7;_0x33cc73['applications']=_0x281af7[_0x4112('0x3d')];_0x33cc73[_0x4112('0x3e')]=_0x281af7[_0x4112('0x37')];_0x33cc73[_0x4112('0x3f')]=_[_0x4112('0x40')](_0x33cc73['applications'],[_0x4112('0x41')],['asc']);if(_0x33cc73[_0x4112('0x3c')][_0x4112('0x3d')]){delete _0x33cc73['account'][_0x4112('0x3d')];}if(_0x33cc73[_0x4112('0x3c')][_0x4112('0x37')]&&_0x33cc73[_0x4112('0x3c')][_0x4112('0x37')][_0x4112('0x38')][_0x4112('0x42')]){return _0x33cc73[_0x4112('0x3c')][_0x4112('0x37')][_0x4112('0x38')][0x0];}var _0x4ecf77=_['defaults'](_0x13691a['body'],{'firstName':_0x13691a[_0x4112('0x2c')][_0x4112('0x2e')],'ListId':_0x281af7[_0x4112('0x43')]});_0x4ecf77[_0x13691a[_0x4112('0x2c')][_0x4112('0x34')]]=_0x13691a[_0x4112('0x2c')][_0x4112('0x2e')];return db['CmContact']['create'](_0x4ecf77,{'fields':_0x5b734f,'raw':!![]});}})[_0x4112('0x24')](function(_0x2ef382){_0x33cc73[_0x4112('0x44')]=_0x2ef382;if(_0x2ef382){var _0x4dc012={'ContactId':_0x2ef382['id'],'FaxAccountId':_0x13691a[_0x4112('0x3c')]['id'],'fax':_0x2ef382[_0x4112('0x45')]};return db[_0x4112('0x46')][_0x4112('0x35')]({'where':{'ContactId':_0x2ef382['id'],'closed':![],'FaxAccountId':_0x13691a['account']['id']}})['then'](function(_0x1e80ca){if(_0x1e80ca){return[_0x1e80ca,![]];}return db[_0x4112('0x46')]['create'](_0x4dc012)[_0x4112('0x24')](function(_0x2a4636){return[_0x2a4636,!![]];});});}else{throw new Error(_0x4112('0x47'));}})['spread'](function(_0x31c510,_0x3a755c){var _0x22e94d=_0x31c510[_0x4112('0x3b')]({'plain':!![]});if(_0x3a755c){if(_0x33cc73[_0x4112('0x3c')][_0x4112('0x48')]){_0x33cc73['applications']['push']({'id':0x0,'priority':_0x33cc73[_0x4112('0x3f')]['length']+0x1,'app':_0x4112('0x49'),'appdata':'unmanaged','interval':_0x4112('0x4a')});}_0x22e94d['created']=!![];}else{_0x22e94d['created']=![];}_0x33cc73[_0x4112('0x4b')]=_0x22e94d;return db['FaxMessage'][_0x4112('0x4c')]({'body':_0x13691a[_0x4112('0x2c')][_0x4112('0x2c')],'FaxAccountId':_0x13691a[_0x4112('0x3c')]['id'],'FaxInteractionId':_0x31c510['id'],'direction':'in','ContactId':_0x31c510[_0x4112('0x4d')],'AttachmentId':_0x13691a[_0x4112('0x2c')][_0x4112('0x4e')]});})['then'](function(_0x963ea9){_0x33cc73['message']=_0x963ea9;if(_0x33cc73[_0x4112('0x4b')]['UserId']){return db['User'][_0x4112('0x35')]({'attributes':['id',_0x4112('0x4f')],'where':{'id':_0x33cc73[_0x4112('0x4b')][_0x4112('0x50')]}})[_0x4112('0x24')](function(_0x4d451f){if(_0x4d451f){_0x33cc73[_0x4112('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4112('0x51'),'appdata':_0x4d451f[_0x4112('0x4f')]+','+(_0x33cc73[_0x4112('0x3c')][_0x4112('0x52')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x33cc73);});}return respondWithRpcPromise(_0x4112('0x53'),_0x4112('0x54'),_0x33cc73);})[_0x4112('0x24')](function(_0x475772){_0x5bf0e5(_0x475772);})[_0x4112('0x18')](function(_0x574603){_0x5093f4(_0x1ce703[_0x4112('0x13')](0x1f4,_0x574603['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index b61cf55..eb146ea 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 _0xa112=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x3287a6,_0x35e598){var _0x9c6449=function(_0x407e41){while(--_0x407e41){_0x3287a6['push'](_0x3287a6['shift']());}};_0x9c6449(++_0x35e598);}(_0xa112,0xa7));var _0x2a11=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xa112[_0x1b7368];return _0x25d54c;};'use strict';var FaxAccountEvents=require(_0x2a11('0x0'));var events=[_0x2a11('0x1'),_0x2a11('0x2'),'update'];function createListener(_0x14e341,_0x25f9a4){return function(_0x1af065){_0x25f9a4[_0x2a11('0x3')](_0x14e341,_0x1af065);};}function removeListener(_0x201b90,_0x4f9bff){return function(){FaxAccountEvents[_0x2a11('0x4')](_0x201b90,_0x4f9bff);};}exports[_0x2a11('0x5')]=function(_0x4d6538){for(var _0x1f51ca=0x0,_0x56b390=events[_0x2a11('0x6')];_0x1f51ca<_0x56b390;_0x1f51ca++){var _0x386e2f=events[_0x1f51ca];var _0x1663b5=createListener(_0x2a11('0x7')+_0x386e2f,_0x4d6538);FaxAccountEvents['on'](_0x386e2f,_0x1663b5);}}; \ No newline at end of file +var _0x1cc8=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','remove'];(function(_0x44bf73,_0x1fb4c4){var _0x10929a=function(_0x538ca0){while(--_0x538ca0){_0x44bf73['push'](_0x44bf73['shift']());}};_0x10929a(++_0x1fb4c4);}(_0x1cc8,0xa6));var _0x81cc=function(_0x48876a,_0x43168c){_0x48876a=_0x48876a-0x0;var _0x5d059b=_0x1cc8[_0x48876a];return _0x5d059b;};'use strict';var FaxAccountEvents=require(_0x81cc('0x0'));var events=['save',_0x81cc('0x1'),'update'];function createListener(_0x203556,_0x3bb028){return function(_0x2ba4ad){_0x3bb028[_0x81cc('0x2')](_0x203556,_0x2ba4ad);};}function removeListener(_0x51fb91,_0x441051){return function(){FaxAccountEvents[_0x81cc('0x3')](_0x51fb91,_0x441051);};}exports[_0x81cc('0x4')]=function(_0x3db3fa){for(var _0x407b6d=0x0,_0x24dafa=events[_0x81cc('0x5')];_0x407b6d<_0x24dafa;_0x407b6d++){var _0x2908b1=events[_0x407b6d];var _0x3648a4=createListener(_0x81cc('0x6')+_0x2908b1,_0x3db3fa);FaxAccountEvents['on'](_0x2908b1,_0x3648a4);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 5f1b234..39bf56e 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(_0x35493d,_0x17eabe){var _0x254db6=function(_0x22d1ca){while(--_0x22d1ca){_0x35493d['push'](_0x35493d['shift']());}};_0x254db6(++_0x17eabe);}(_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'));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(_0x2de114,_0xc8e415){var _0x467c98=function(_0x2095f4){while(--_0x2095f4){_0x2de114['push'](_0x2de114['shift']());}};_0x467c98(++_0xc8e415);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 5f62bb0..5c75a73 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 _0x3f6a=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x25700f,_0x231f63){var _0x4f82f9=function(_0x10a02c){while(--_0x10a02c){_0x25700f['push'](_0x25700f['shift']());}};_0x4f82f9(++_0x231f63);}(_0x3f6a,0x167));var _0xa3f6=function(_0x216112,_0x3a57f4){_0x216112=_0x216112-0x0;var _0x578c6f=_0x3f6a[_0x216112];return _0x578c6f;};'use strict';var Sequelize=require(_0xa3f6('0x0'));module[_0xa3f6('0x1')]={'priority':{'type':Sequelize[_0xa3f6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa3f6('0x3')],'allowNull':![],'defaultValue':_0xa3f6('0x4')},'appdata':{'type':Sequelize[_0xa3f6('0x5')]()},'description':{'type':Sequelize[_0xa3f6('0x3')]},'interval':{'type':Sequelize[_0xa3f6('0x3')],'defaultValue':_0xa3f6('0x6')}}; \ No newline at end of file +var _0xa7bf=['INTEGER','STRING','noop','*,*,*,*'];(function(_0x5366e7,_0x1b8be9){var _0x1b7106=function(_0x398557){while(--_0x398557){_0x5366e7['push'](_0x5366e7['shift']());}};_0x1b7106(++_0x1b8be9);}(_0xa7bf,0x164));var _0xfa7b=function(_0x2a0078,_0x44254d){_0x2a0078=_0x2a0078-0x0;var _0x485cc2=_0xa7bf[_0x2a0078];return _0x485cc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xfa7b('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xfa7b('0x1')],'allowNull':![],'defaultValue':_0xfa7b('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfa7b('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xfa7b('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 86caeea..b54a0d5 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 _0x370a=['crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','save','update','then','end','error','stack','name','send','index','map','FaxApplication','fieldName','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','VIRTUAL','merge','includeAll','include','findAll','catch','rawAttributes','length','find','create','body','destroy','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x5a88cc,_0x5c1895){var _0x13c95b=function(_0x181dfe){while(--_0x181dfe){_0x5a88cc['push'](_0x5a88cc['shift']());}};_0x13c95b(++_0x5c1895);}(_0x370a,0x104));var _0xa370=function(_0x3f8d4c,_0x5b5a96){_0x3f8d4c=_0x3f8d4c-0x0;var _0xe5c793=_0x370a[_0x3f8d4c];return _0xe5c793;};'use strict';var emlformat=require(_0xa370('0x0'));var rimraf=require(_0xa370('0x1'));var zipdir=require(_0xa370('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa370('0x3'));var moment=require('moment');var BPromise=require(_0xa370('0x4'));var Mustache=require(_0xa370('0x5'));var util=require(_0xa370('0x6'));var path=require(_0xa370('0x7'));var sox=require('sox');var csv=require(_0xa370('0x8'));var ejs=require(_0xa370('0x9'));var fs=require('fs');var fs_extra=require(_0xa370('0xa'));var _=require(_0xa370('0xb'));var squel=require('squel');var crypto=require(_0xa370('0xc'));var jsforce=require(_0xa370('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa370('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa370('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa370('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa370('0x11'))(_0xa370('0x12'));var utils=require(_0xa370('0x13'));var config=require(_0xa370('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa370('0x15'))['db'];function respondWithStatusCode(_0x5832e9,_0x2dfc18){_0x2dfc18=_0x2dfc18||0xcc;return function(_0x332828){if(_0x332828){return _0x5832e9[_0xa370('0x16')](_0x2dfc18);}return _0x5832e9[_0xa370('0x17')](_0x2dfc18)['end']();};}function respondWithResult(_0x272fab,_0x3c51ba){_0x3c51ba=_0x3c51ba||0xc8;return function(_0x1dd2b2){if(_0x1dd2b2){return _0x272fab[_0xa370('0x17')](_0x3c51ba)[_0xa370('0x18')](_0x1dd2b2);}};}function respondWithFilteredResult(_0x3dedc3,_0x2c4e00){return function(_0xc76920){if(_0xc76920){var _0x232b9d=typeof _0x2c4e00[_0xa370('0x19')]==='undefined'&&typeof _0x2c4e00[_0xa370('0x1a')]==='undefined';var _0x3da6ea=_0xc76920[_0xa370('0x1b')];var _0x362fd7=_0x232b9d?0x0:_0x2c4e00['offset'];var _0x251be8=_0x232b9d?_0xc76920['count']:_0x2c4e00[_0xa370('0x19')]+_0x2c4e00[_0xa370('0x1a')];var _0x4ba8c5;if(_0x251be8>=_0x3da6ea){_0x251be8=_0x3da6ea;_0x4ba8c5=0xc8;}else{_0x4ba8c5=0xce;}_0x3dedc3['status'](_0x4ba8c5);return _0x3dedc3['set'](_0xa370('0x1c'),_0x362fd7+'-'+_0x251be8+'/'+_0x3da6ea)['json'](_0xc76920);}return null;};}function patchUpdates(_0x7427e5){return function(_0x3e00a3){try{jsonpatch['apply'](_0x3e00a3,_0x7427e5,!![]);}catch(_0x273855){return BPromise['reject'](_0x273855);}return _0x3e00a3[_0xa370('0x1d')]();};}function saveUpdates(_0x528cb2,_0x20018a){return function(_0x523de7){if(_0x523de7){return _0x523de7[_0xa370('0x1e')](_0x528cb2)[_0xa370('0x1f')](function(_0x30cf29){return _0x30cf29;});}return null;};}function removeEntity(_0x634962,_0x39218b){return function(_0x34af44){if(_0x34af44){return _0x34af44['destroy']()[_0xa370('0x1f')](function(){_0x634962[_0xa370('0x17')](0xcc)[_0xa370('0x20')]();});}};}function handleEntityNotFound(_0x49a6e6,_0x246f28){return function(_0x5ea7f9){if(!_0x5ea7f9){_0x49a6e6[_0xa370('0x16')](0x194);}return _0x5ea7f9;};}function handleError(_0x51316a,_0x5c2c35){_0x5c2c35=_0x5c2c35||0x1f4;return function(_0x4554b3){logger[_0xa370('0x21')](_0x4554b3[_0xa370('0x22')]);if(_0x4554b3[_0xa370('0x23')]){delete _0x4554b3['name'];}_0x51316a[_0xa370('0x17')](_0x5c2c35)[_0xa370('0x24')](_0x4554b3);};}exports[_0xa370('0x25')]=function(_0x3d9410,_0x5a31f5){var _0x46af55={},_0x50abdc={},_0x47f8d2={'count':0x0,'rows':[]};var _0x15fa60=_[_0xa370('0x26')](db[_0xa370('0x27')]['rawAttributes'],function(_0x4c9712){return{'name':_0x4c9712[_0xa370('0x28')],'type':_0x4c9712['type']['key']};});_0x50abdc['model']=_[_0xa370('0x26')](_0x15fa60,_0xa370('0x23'));_0x50abdc[_0xa370('0x29')]=_[_0xa370('0x2a')](_0x3d9410['query']);_0x50abdc['filters']=_['intersection'](_0x50abdc['model'],_0x50abdc[_0xa370('0x29')]);_0x46af55[_0xa370('0x2b')]=_[_0xa370('0x2c')](_0x50abdc[_0xa370('0x2d')],qs[_0xa370('0x2e')](_0x3d9410[_0xa370('0x29')][_0xa370('0x2e')]));_0x46af55[_0xa370('0x2b')]=_0x46af55[_0xa370('0x2b')]['length']?_0x46af55[_0xa370('0x2b')]:_0x50abdc[_0xa370('0x2d')];if(!_0x3d9410[_0xa370('0x29')][_0xa370('0x2f')](_0xa370('0x30'))){_0x46af55[_0xa370('0x1a')]=qs['limit'](_0x3d9410[_0xa370('0x29')][_0xa370('0x1a')]);_0x46af55[_0xa370('0x19')]=qs[_0xa370('0x19')](_0x3d9410[_0xa370('0x29')][_0xa370('0x19')]);}_0x46af55[_0xa370('0x31')]=qs['sort'](_0x3d9410[_0xa370('0x29')][_0xa370('0x32')]);_0x46af55['where']=qs[_0xa370('0x33')](_[_0xa370('0x34')](_0x3d9410[_0xa370('0x29')],_0x50abdc[_0xa370('0x33')]),_0x15fa60);if(_0x3d9410[_0xa370('0x29')]['filter']){_0x46af55[_0xa370('0x35')]=_['merge'](_0x46af55[_0xa370('0x35')],{'$or':_[_0xa370('0x26')](_0x15fa60,function(_0x4167ba){if(_0x4167ba[_0xa370('0x36')]!==_0xa370('0x37')){var _0x1bb19a={};_0x1bb19a[_0x4167ba[_0xa370('0x23')]]={'$like':'%'+_0x3d9410[_0xa370('0x29')]['filter']+'%'};return _0x1bb19a;}})});}_0x46af55=_[_0xa370('0x38')]({},_0x46af55,_0x3d9410['options']);var _0x1db051={'where':_0x46af55['where']};return db[_0xa370('0x27')]['count'](_0x1db051)[_0xa370('0x1f')](function(_0x13bead){_0x47f8d2[_0xa370('0x1b')]=_0x13bead;if(_0x3d9410[_0xa370('0x29')][_0xa370('0x39')]){_0x46af55[_0xa370('0x3a')]=[{'all':!![]}];}return db[_0xa370('0x27')][_0xa370('0x3b')](_0x46af55);})[_0xa370('0x1f')](function(_0x40b00c){_0x47f8d2['rows']=_0x40b00c;return _0x47f8d2;})[_0xa370('0x1f')](respondWithFilteredResult(_0x5a31f5,_0x46af55))[_0xa370('0x3c')](handleError(_0x5a31f5,null));};exports['show']=function(_0xf8993f,_0x7ea59c){var _0x300c1e={'raw':!![],'where':{'id':_0xf8993f['params']['id']}},_0x1f4184={};_0x1f4184['model']=_[_0xa370('0x2a')](db['FaxApplication'][_0xa370('0x3d')]);_0x1f4184[_0xa370('0x29')]=_[_0xa370('0x2a')](_0xf8993f['query']);_0x1f4184[_0xa370('0x33')]=_[_0xa370('0x2c')](_0x1f4184['model'],_0x1f4184[_0xa370('0x29')]);_0x300c1e[_0xa370('0x2b')]=_[_0xa370('0x2c')](_0x1f4184[_0xa370('0x2d')],qs[_0xa370('0x2e')](_0xf8993f[_0xa370('0x29')][_0xa370('0x2e')]));_0x300c1e[_0xa370('0x2b')]=_0x300c1e[_0xa370('0x2b')][_0xa370('0x3e')]?_0x300c1e[_0xa370('0x2b')]:_0x1f4184[_0xa370('0x2d')];if(_0xf8993f[_0xa370('0x29')][_0xa370('0x39')]){_0x300c1e['include']=[{'all':!![]}];}_0x300c1e=_[_0xa370('0x38')]({},_0x300c1e,_0xf8993f['options']);return db[_0xa370('0x27')][_0xa370('0x3f')](_0x300c1e)[_0xa370('0x1f')](handleEntityNotFound(_0x7ea59c,null))[_0xa370('0x1f')](respondWithResult(_0x7ea59c,null))['catch'](handleError(_0x7ea59c,null));};exports[_0xa370('0x40')]=function(_0x3c8902,_0x1911eb){return db[_0xa370('0x27')]['create'](_0x3c8902[_0xa370('0x41')],{})[_0xa370('0x1f')](respondWithResult(_0x1911eb,0xc9))[_0xa370('0x3c')](handleError(_0x1911eb,null));};exports[_0xa370('0x1e')]=function(_0x3dddcb,_0x587d6f){if(_0x3dddcb[_0xa370('0x41')]['id']){delete _0x3dddcb[_0xa370('0x41')]['id'];}return db[_0xa370('0x27')][_0xa370('0x3f')]({'where':{'id':_0x3dddcb['params']['id']}})['then'](handleEntityNotFound(_0x587d6f,null))[_0xa370('0x1f')](saveUpdates(_0x3dddcb['body'],null))[_0xa370('0x1f')](respondWithResult(_0x587d6f,null))[_0xa370('0x3c')](handleError(_0x587d6f,null));};exports[_0xa370('0x42')]=function(_0x3238f8,_0x4005c0){return db[_0xa370('0x27')][_0xa370('0x3f')]({'where':{'id':_0x3238f8[_0xa370('0x43')]['id']}})['then'](handleEntityNotFound(_0x4005c0,null))[_0xa370('0x1f')](removeEntity(_0x4005c0,null))[_0xa370('0x3c')](handleError(_0x4005c0,null));}; \ No newline at end of file +var _0x890d=['fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','create','body','params','find','eml-format','rimraf','zip-dir'];(function(_0x2b2094,_0x59e69d){var _0x3d56ff=function(_0x138bdf){while(--_0x138bdf){_0x2b2094['push'](_0x2b2094['shift']());}};_0x3d56ff(++_0x59e69d);}(_0x890d,0x16f));var _0xd890=function(_0x511bf0,_0x193086){_0x511bf0=_0x511bf0-0x0;var _0x53513c=_0x890d[_0x511bf0];return _0x53513c;};'use strict';var emlformat=require(_0xd890('0x0'));var rimraf=require(_0xd890('0x1'));var zipdir=require(_0xd890('0x2'));var jsonpatch=require(_0xd890('0x3'));var rp=require(_0xd890('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd890('0x5'));var util=require(_0xd890('0x6'));var path=require(_0xd890('0x7'));var sox=require(_0xd890('0x8'));var csv=require('to-csv');var ejs=require(_0xd890('0x9'));var fs=require('fs');var fs_extra=require(_0xd890('0xa'));var _=require(_0xd890('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd890('0xc'));var toCsv=require(_0xd890('0xd'));var querystring=require(_0xd890('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd890('0xf'));var qs=require(_0xd890('0x10'));var as=require(_0xd890('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd890('0x12'))('api');var utils=require(_0xd890('0x13'));var config=require(_0xd890('0x14'));var licenseUtil=require(_0xd890('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37de81,_0x3805d5){_0x3805d5=_0x3805d5||0xcc;return function(_0x2445d8){if(_0x2445d8){return _0x37de81[_0xd890('0x16')](_0x3805d5);}return _0x37de81[_0xd890('0x17')](_0x3805d5)[_0xd890('0x18')]();};}function respondWithResult(_0xf597a8,_0x1054bf){_0x1054bf=_0x1054bf||0xc8;return function(_0x4997e9){if(_0x4997e9){return _0xf597a8[_0xd890('0x17')](_0x1054bf)[_0xd890('0x19')](_0x4997e9);}};}function respondWithFilteredResult(_0x23afc5,_0x1240ff){return function(_0x2ffd71){if(_0x2ffd71){var _0x268106=typeof _0x1240ff[_0xd890('0x1a')]===_0xd890('0x1b')&&typeof _0x1240ff[_0xd890('0x1c')]===_0xd890('0x1b');var _0x4f8924=_0x2ffd71[_0xd890('0x1d')];var _0x57daf8=_0x268106?0x0:_0x1240ff[_0xd890('0x1a')];var _0x44cd82=_0x268106?_0x2ffd71['count']:_0x1240ff[_0xd890('0x1a')]+_0x1240ff[_0xd890('0x1c')];var _0x1f3fef;if(_0x44cd82>=_0x4f8924){_0x44cd82=_0x4f8924;_0x1f3fef=0xc8;}else{_0x1f3fef=0xce;}_0x23afc5['status'](_0x1f3fef);return _0x23afc5[_0xd890('0x1e')]('Content-Range',_0x57daf8+'-'+_0x44cd82+'/'+_0x4f8924)[_0xd890('0x19')](_0x2ffd71);}return null;};}function patchUpdates(_0x54fbec){return function(_0x4a314c){try{jsonpatch['apply'](_0x4a314c,_0x54fbec,!![]);}catch(_0x2f9a9b){return BPromise[_0xd890('0x1f')](_0x2f9a9b);}return _0x4a314c[_0xd890('0x20')]();};}function saveUpdates(_0x3cae8e,_0x456add){return function(_0x12ce94){if(_0x12ce94){return _0x12ce94[_0xd890('0x21')](_0x3cae8e)[_0xd890('0x22')](function(_0x415d91){return _0x415d91;});}return null;};}function removeEntity(_0x538f31,_0x4b8ea6){return function(_0xba6bbe){if(_0xba6bbe){return _0xba6bbe[_0xd890('0x23')]()[_0xd890('0x22')](function(){_0x538f31[_0xd890('0x17')](0xcc)[_0xd890('0x18')]();});}};}function handleEntityNotFound(_0x4a10b4,_0xdb8448){return function(_0x5ae305){if(!_0x5ae305){_0x4a10b4[_0xd890('0x16')](0x194);}return _0x5ae305;};}function handleError(_0x46ea96,_0x1dd9c9){_0x1dd9c9=_0x1dd9c9||0x1f4;return function(_0x39b7f0){logger[_0xd890('0x24')](_0x39b7f0[_0xd890('0x25')]);if(_0x39b7f0[_0xd890('0x26')]){delete _0x39b7f0[_0xd890('0x26')];}_0x46ea96[_0xd890('0x17')](_0x1dd9c9)[_0xd890('0x27')](_0x39b7f0);};}exports[_0xd890('0x28')]=function(_0x3f6d70,_0x5b8a99){var _0x5c4abb={},_0x1abd50={},_0x3298ce={'count':0x0,'rows':[]};var _0x261213=_[_0xd890('0x29')](db[_0xd890('0x2a')][_0xd890('0x2b')],function(_0x3ecd9f){return{'name':_0x3ecd9f[_0xd890('0x2c')],'type':_0x3ecd9f[_0xd890('0x2d')][_0xd890('0x2e')]};});_0x1abd50['model']=_['map'](_0x261213,_0xd890('0x26'));_0x1abd50[_0xd890('0x2f')]=_[_0xd890('0x30')](_0x3f6d70[_0xd890('0x2f')]);_0x1abd50[_0xd890('0x31')]=_[_0xd890('0x32')](_0x1abd50[_0xd890('0x33')],_0x1abd50['query']);_0x5c4abb[_0xd890('0x34')]=_[_0xd890('0x32')](_0x1abd50['model'],qs[_0xd890('0x35')](_0x3f6d70[_0xd890('0x2f')][_0xd890('0x35')]));_0x5c4abb[_0xd890('0x34')]=_0x5c4abb[_0xd890('0x34')][_0xd890('0x36')]?_0x5c4abb[_0xd890('0x34')]:_0x1abd50[_0xd890('0x33')];if(!_0x3f6d70[_0xd890('0x2f')][_0xd890('0x37')](_0xd890('0x38'))){_0x5c4abb[_0xd890('0x1c')]=qs[_0xd890('0x1c')](_0x3f6d70[_0xd890('0x2f')][_0xd890('0x1c')]);_0x5c4abb[_0xd890('0x1a')]=qs[_0xd890('0x1a')](_0x3f6d70[_0xd890('0x2f')][_0xd890('0x1a')]);}_0x5c4abb['order']=qs[_0xd890('0x39')](_0x3f6d70[_0xd890('0x2f')][_0xd890('0x39')]);_0x5c4abb['where']=qs[_0xd890('0x31')](_[_0xd890('0x3a')](_0x3f6d70[_0xd890('0x2f')],_0x1abd50['filters']),_0x261213);if(_0x3f6d70[_0xd890('0x2f')][_0xd890('0x3b')]){_0x5c4abb['where']=_['merge'](_0x5c4abb['where'],{'$or':_['map'](_0x261213,function(_0x227c98){if(_0x227c98['type']!==_0xd890('0x3c')){var _0x5d94e1={};_0x5d94e1[_0x227c98[_0xd890('0x26')]]={'$like':'%'+_0x3f6d70['query'][_0xd890('0x3b')]+'%'};return _0x5d94e1;}})});}_0x5c4abb=_[_0xd890('0x3d')]({},_0x5c4abb,_0x3f6d70[_0xd890('0x3e')]);var _0x4d6aeb={'where':_0x5c4abb[_0xd890('0x3f')]};return db[_0xd890('0x2a')]['count'](_0x4d6aeb)[_0xd890('0x22')](function(_0x207685){_0x3298ce[_0xd890('0x1d')]=_0x207685;if(_0x3f6d70[_0xd890('0x2f')][_0xd890('0x40')]){_0x5c4abb[_0xd890('0x41')]=[{'all':!![]}];}return db[_0xd890('0x2a')][_0xd890('0x42')](_0x5c4abb);})[_0xd890('0x22')](function(_0x29a2fd){_0x3298ce[_0xd890('0x43')]=_0x29a2fd;return _0x3298ce;})[_0xd890('0x22')](respondWithFilteredResult(_0x5b8a99,_0x5c4abb))[_0xd890('0x44')](handleError(_0x5b8a99,null));};exports[_0xd890('0x45')]=function(_0x13d294,_0x4aef51){var _0xb93d1c={'raw':!![],'where':{'id':_0x13d294['params']['id']}},_0x4cd3dd={};_0x4cd3dd['model']=_[_0xd890('0x30')](db[_0xd890('0x2a')][_0xd890('0x2b')]);_0x4cd3dd[_0xd890('0x2f')]=_[_0xd890('0x30')](_0x13d294['query']);_0x4cd3dd[_0xd890('0x31')]=_[_0xd890('0x32')](_0x4cd3dd['model'],_0x4cd3dd[_0xd890('0x2f')]);_0xb93d1c['attributes']=_[_0xd890('0x32')](_0x4cd3dd['model'],qs['fields'](_0x13d294['query'][_0xd890('0x35')]));_0xb93d1c['attributes']=_0xb93d1c[_0xd890('0x34')][_0xd890('0x36')]?_0xb93d1c[_0xd890('0x34')]:_0x4cd3dd[_0xd890('0x33')];if(_0x13d294[_0xd890('0x2f')][_0xd890('0x40')]){_0xb93d1c[_0xd890('0x41')]=[{'all':!![]}];}_0xb93d1c=_[_0xd890('0x3d')]({},_0xb93d1c,_0x13d294['options']);return db[_0xd890('0x2a')]['find'](_0xb93d1c)[_0xd890('0x22')](handleEntityNotFound(_0x4aef51,null))[_0xd890('0x22')](respondWithResult(_0x4aef51,null))[_0xd890('0x44')](handleError(_0x4aef51,null));};exports[_0xd890('0x46')]=function(_0x17dec9,_0x4978a3){return db[_0xd890('0x2a')][_0xd890('0x46')](_0x17dec9[_0xd890('0x47')],{})[_0xd890('0x22')](respondWithResult(_0x4978a3,0xc9))['catch'](handleError(_0x4978a3,null));};exports[_0xd890('0x21')]=function(_0x17ab4e,_0x5bb6b4){if(_0x17ab4e[_0xd890('0x47')]['id']){delete _0x17ab4e[_0xd890('0x47')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x17ab4e[_0xd890('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bb6b4,null))['then'](saveUpdates(_0x17ab4e[_0xd890('0x47')],null))[_0xd890('0x22')](respondWithResult(_0x5bb6b4,null))[_0xd890('0x44')](handleError(_0x5bb6b4,null));};exports['destroy']=function(_0x557d35,_0xf26633){return db['FaxApplication'][_0xd890('0x49')]({'where':{'id':_0x557d35['params']['id']}})[_0xd890('0x22')](handleEntityNotFound(_0xf26633,null))[_0xd890('0x22')](removeEntity(_0xf26633,null))[_0xd890('0x44')](handleError(_0xf26633,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d44ba3c..239b6ad 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 _0xaf06=['define','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xaf06,0x86));var _0x6af0=function(_0x2a304d,_0x2ebab6){_0x2a304d=_0x2a304d-0x0;var _0x3f831b=_0xaf06[_0x2a304d];return _0x3f831b;};'use strict';var _=require(_0x6af0('0x0'));var util=require(_0x6af0('0x1'));var logger=require(_0x6af0('0x2'))(_0x6af0('0x3'));var moment=require(_0x6af0('0x4'));var BPromise=require(_0x6af0('0x5'));var rp=require(_0x6af0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6af0('0x7'));var config=require(_0x6af0('0x8'));var attributes=require('./faxApplication.attributes');module[_0x6af0('0x9')]=function(_0x13572f,_0x3574d8){return _0x13572f[_0x6af0('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6af0('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xae1f=['request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x3f9fa2,_0x1fd8ff){var _0x1a9be8=function(_0xbee571){while(--_0xbee571){_0x3f9fa2['push'](_0x3f9fa2['shift']());}};_0x1a9be8(++_0x1fd8ff);}(_0xae1f,0x19c));var _0xfae1=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0xae1f[_0x5a27e8];return _0x4e38f7;};'use strict';var _=require(_0xfae1('0x0'));var util=require(_0xfae1('0x1'));var logger=require(_0xfae1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfae1('0x3'));var rp=require(_0xfae1('0x4'));var fs=require('fs');var path=require(_0xfae1('0x5'));var rimraf=require('rimraf');var config=require(_0xfae1('0x6'));var attributes=require(_0xfae1('0x7'));module[_0xfae1('0x8')]=function(_0x453403,_0x949800){return _0x453403[_0xfae1('0x9')]('FaxApplication',attributes,{'tableName':_0xfae1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfae1('0xb'),'collate':_0xfae1('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0423d93..0efca31 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 _0x54bb=['error','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x7a8568,_0x3675ab){var _0x2c034d=function(_0x34cbba){while(--_0x34cbba){_0x7a8568['push'](_0x7a8568['shift']());}};_0x2c034d(++_0x3675ab);}(_0x54bb,0x161));var _0xb54b=function(_0x5f139c,_0x34abe0){_0x5f139c=_0x5f139c-0x0;var _0xd3bd61=_0x54bb[_0x5f139c];return _0xd3bd61;};'use strict';var _=require(_0xb54b('0x0'));var util=require(_0xb54b('0x1'));var moment=require(_0xb54b('0x2'));var BPromise=require(_0xb54b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb54b('0x4'));var db=require(_0xb54b('0x5'))['db'];var utils=require(_0xb54b('0x6'));var logger=require(_0xb54b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb54b('0x8'));var client=jayson[_0xb54b('0x9')][_0xb54b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xec457c,_0x532f2d,_0x4c9204){return new BPromise(function(_0xae8929,_0x87d225){return client[_0xb54b('0xb')](_0xec457c,_0x4c9204)['then'](function(_0xb5aeee){logger[_0xb54b('0xc')](_0xb54b('0xd'),_0x532f2d,_0xb54b('0xe'));logger[_0xb54b('0xf')](_0xb54b('0x10'),_0x532f2d,_0xb54b('0xe'),JSON[_0xb54b('0x11')](_0xb5aeee));if(_0xb5aeee['error']){if(_0xb5aeee['error'][_0xb54b('0x12')]===0x1f4){logger['error'](_0xb54b('0xd'),_0x532f2d,_0xb5aeee[_0xb54b('0x13')]['message']);return _0x87d225(_0xb5aeee['error'][_0xb54b('0x14')]);}logger['error'](_0xb54b('0xd'),_0x532f2d,_0xb5aeee['error'][_0xb54b('0x14')]);return _0xae8929(_0xb5aeee[_0xb54b('0x13')][_0xb54b('0x14')]);}else{logger[_0xb54b('0xc')](_0xb54b('0xd'),_0x532f2d,'request\x20sent');_0xae8929(_0xb5aeee[_0xb54b('0x15')][_0xb54b('0x14')]);}})[_0xb54b('0x16')](function(_0x5a6c6e){logger[_0xb54b('0x13')](_0xb54b('0xd'),_0x532f2d,_0x5a6c6e);_0x87d225(_0x5a6c6e);});});}exports[_0xb54b('0x17')]=function(_0x298c04){var _0x19d055=this;return new Promise(function(_0x146d81,_0x42e777){return db[_0xb54b('0x18')][_0xb54b('0x19')](_0x298c04[_0xb54b('0x1a')],{'raw':_0x298c04[_0xb54b('0x1b')]?_0x298c04['options'][_0xb54b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x298c04[_0xb54b('0x1b')]?_0x298c04[_0xb54b('0x1b')]['where']||null:null,'attributes':_0x298c04['options']?_0x298c04[_0xb54b('0x1b')][_0xb54b('0x1d')]||null:null,'limit':_0x298c04[_0xb54b('0x1b')]?_0x298c04['options'][_0xb54b('0x1e')]||null:null})['then'](function(_0x456d1a){logger[_0xb54b('0xc')](_0xb54b('0x17'),_0x298c04);logger[_0xb54b('0xf')](_0xb54b('0x17'),_0x298c04,JSON['stringify'](_0x456d1a));_0x146d81(_0x456d1a);})[_0xb54b('0x16')](function(_0x2b7248){logger['error'](_0xb54b('0x17'),_0x2b7248[_0xb54b('0x14')],_0x298c04);_0x42e777(_0x19d055[_0xb54b('0x13')](0x1f4,_0x2b7248[_0xb54b('0x14')]));});});}; \ No newline at end of file +var _0x8225=['FaxApplication','body','options','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication'];(function(_0x4789c9,_0x4a6ae6){var _0x577fe0=function(_0x5cfc79){while(--_0x5cfc79){_0x4789c9['push'](_0x4789c9['shift']());}};_0x577fe0(++_0x4a6ae6);}(_0x8225,0x150));var _0x5822=function(_0x41f9de,_0x24659d){_0x41f9de=_0x41f9de-0x0;var _0x12d689=_0x8225[_0x41f9de];return _0x12d689;};'use strict';var _=require(_0x5822('0x0'));var util=require(_0x5822('0x1'));var moment=require(_0x5822('0x2'));var BPromise=require(_0x5822('0x3'));var rs=require(_0x5822('0x4'));var fs=require('fs');var Redis=require(_0x5822('0x5'));var db=require(_0x5822('0x6'))['db'];var utils=require(_0x5822('0x7'));var logger=require(_0x5822('0x8'))(_0x5822('0x9'));var config=require(_0x5822('0xa'));var jayson=require(_0x5822('0xb'));var client=jayson['client'][_0x5822('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c8519,_0x32fb23,_0xc52124){return new BPromise(function(_0x2ddd46,_0x565c36){return client[_0x5822('0xd')](_0x1c8519,_0xc52124)[_0x5822('0xe')](function(_0x5305dd){logger[_0x5822('0xf')]('FaxApplication,\x20%s,\x20%s',_0x32fb23,'request\x20sent');logger[_0x5822('0x10')](_0x5822('0x11'),_0x32fb23,_0x5822('0x12'),JSON[_0x5822('0x13')](_0x5305dd));if(_0x5305dd[_0x5822('0x14')]){if(_0x5305dd[_0x5822('0x14')][_0x5822('0x15')]===0x1f4){logger[_0x5822('0x14')](_0x5822('0x16'),_0x32fb23,_0x5305dd[_0x5822('0x14')][_0x5822('0x17')]);return _0x565c36(_0x5305dd[_0x5822('0x14')][_0x5822('0x17')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x32fb23,_0x5305dd['error'][_0x5822('0x17')]);return _0x2ddd46(_0x5305dd[_0x5822('0x14')][_0x5822('0x17')]);}else{logger[_0x5822('0xf')](_0x5822('0x16'),_0x32fb23,_0x5822('0x12'));_0x2ddd46(_0x5305dd[_0x5822('0x18')][_0x5822('0x17')]);}})[_0x5822('0x19')](function(_0x58544d){logger[_0x5822('0x14')]('FaxApplication,\x20%s,\x20%s',_0x32fb23,_0x58544d);_0x565c36(_0x58544d);});});}exports[_0x5822('0x1a')]=function(_0x490867){var _0x5f1dc0=this;return new Promise(function(_0x5dc1eb,_0x2f9a58){return db[_0x5822('0x1b')]['update'](_0x490867[_0x5822('0x1c')],{'raw':_0x490867[_0x5822('0x1d')]?_0x490867['options'][_0x5822('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x490867['options']?_0x490867[_0x5822('0x1d')]['where']||null:null,'attributes':_0x490867['options']?_0x490867[_0x5822('0x1d')][_0x5822('0x1f')]||null:null,'limit':_0x490867[_0x5822('0x1d')]?_0x490867[_0x5822('0x1d')][_0x5822('0x20')]||null:null})['then'](function(_0x554f6){logger[_0x5822('0xf')](_0x5822('0x1a'),_0x490867);logger[_0x5822('0x10')](_0x5822('0x1a'),_0x490867,JSON['stringify'](_0x554f6));_0x5dc1eb(_0x554f6);})[_0x5822('0x19')](function(_0x58056e){logger['error'](_0x5822('0x1a'),_0x58056e[_0x5822('0x17')],_0x490867);_0x2f9a58(_0x5f1dc0[_0x5822('0x14')](0x1f4,_0x58056e[_0x5822('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index f98e343..13e04b3 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 _0xe605=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0xa94aee,_0x3ef46d){var _0x3fc480=function(_0x32620a){while(--_0x32620a){_0xa94aee['push'](_0xa94aee['shift']());}};_0x3fc480(++_0x3ef46d);}(_0xe605,0x92));var _0x5e60=function(_0x55de2e,_0x20d830){_0x55de2e=_0x55de2e-0x0;var _0x37f35c=_0xe605[_0x55de2e];return _0x37f35c;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5e60('0xd')]);router[_0x5e60('0xe')](_0x5e60('0xf'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x10')]);router[_0x5e60('0x11')]('/:id',auth[_0x5e60('0xb')](),controller['destroy']);module[_0x5e60('0x12')]=router; \ No newline at end of file +var _0x9354=['Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','util','path','express'];(function(_0x410476,_0x2f8757){var _0x3e3b2b=function(_0x4bfdf6){while(--_0x4bfdf6){_0x410476['push'](_0x410476['shift']());}};_0x3e3b2b(++_0x2f8757);}(_0x9354,0x96));var _0x4935=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x9354[_0x2e76a7];return _0x454cde;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['post']('/',auth[_0x4935('0x9')](),controller['create']);router[_0x4935('0xd')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xe')]);router[_0x4935('0xf')](_0x4935('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4935('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index fcc9790..2154708 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 _0xcefb=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x17c164,_0x180303){var _0x1e2492=function(_0x3eb8dc){while(--_0x3eb8dc){_0x17c164['push'](_0x17c164['shift']());}};_0x1e2492(++_0x180303);}(_0xcefb,0x173));var _0xbcef=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0xcefb[_0x316c42];return _0x2b38f7;};'use strict';var Sequelize=require(_0xbcef('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbcef('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbcef('0x2')]},'disposition':{'type':Sequelize[_0xbcef('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbcef('0x3')]},'note':{'type':Sequelize[_0xbcef('0x3')]},'read1stAt':{'type':Sequelize[_0xbcef('0x2')]},'fax':{'type':Sequelize[_0xbcef('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbcef('0x4')]('in',_0xbcef('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7932=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x4fe72a,_0x1d536e){var _0x2970d5=function(_0x21287d){while(--_0x21287d){_0x4fe72a['push'](_0x4fe72a['shift']());}};_0x2970d5(++_0x1d536e);}(_0x7932,0xc2));var _0x2793=function(_0x16ec1f,_0x3b833f){_0x16ec1f=_0x16ec1f-0x0;var _0x15da2b=_0x7932[_0x16ec1f];return _0x15da2b;};'use strict';var Sequelize=require(_0x2793('0x0'));module[_0x2793('0x1')]={'closed':{'type':Sequelize[_0x2793('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2793('0x3')]},'disposition':{'type':Sequelize[_0x2793('0x4')]},'secondDisposition':{'type':Sequelize[_0x2793('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2793('0x4')]},'note':{'type':Sequelize[_0x2793('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x2793('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2793('0x5')]('in',_0x2793('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2793('0x5')]('in','out'),'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 fba58ab..4a335ac 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 _0x831a=['fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','sequelize','toString','merge','FaxInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','includeAll','options','catch','create','params','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','removeTags','download','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','pipe','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','u.id','u.fullname','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId'];(function(_0x3eb43a,_0x5353a8){var _0x165bd7=function(_0x1aa633){while(--_0x1aa633){_0x3eb43a['push'](_0x3eb43a['shift']());}};_0x165bd7(++_0x5353a8);}(_0x831a,0x81));var _0xa831=function(_0x25bf91,_0x3ec72b){_0x25bf91=_0x25bf91-0x0;var _0x406506=_0x831a[_0x25bf91];return _0x406506;};'use strict';var emlformat=require(_0xa831('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa831('0x1'));var jsonpatch=require(_0xa831('0x2'));var rp=require('request-promise');var moment=require(_0xa831('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa831('0x4'));var path=require(_0xa831('0x5'));var sox=require(_0xa831('0x6'));var csv=require(_0xa831('0x7'));var ejs=require(_0xa831('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa831('0x9'));var crypto=require(_0xa831('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa831('0x7'));var querystring=require(_0xa831('0xb'));var Papa=require(_0xa831('0xc'));var Redis=require(_0xa831('0xd'));var authService=require(_0xa831('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa831('0xf'));var hardwareService=require(_0xa831('0x10'));var logger=require(_0xa831('0x11'))(_0xa831('0x12'));var utils=require(_0xa831('0x13'));var config=require(_0xa831('0x14'));var licenseUtil=require(_0xa831('0x15'));var db=require('../../mysqldb')['db'];config[_0xa831('0x16')]=_[_0xa831('0x17')](config[_0xa831('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa831('0x18'))(new Redis(config[_0xa831('0x16')]));require(_0xa831('0x19'))[_0xa831('0x1a')](socket);function respondWithStatusCode(_0x401aa3,_0xc06d86){_0xc06d86=_0xc06d86||0xcc;return function(_0x3a5f53){if(_0x3a5f53){return _0x401aa3[_0xa831('0x1b')](_0xc06d86);}return _0x401aa3[_0xa831('0x1c')](_0xc06d86)[_0xa831('0x1d')]();};}function respondWithResult(_0x722f71,_0x233ccf){_0x233ccf=_0x233ccf||0xc8;return function(_0x59cae4){if(_0x59cae4){return _0x722f71[_0xa831('0x1c')](_0x233ccf)['json'](_0x59cae4);}};}function respondWithFilteredResult(_0x118657,_0x5d4092){return function(_0x1cf96b){if(_0x1cf96b){var _0x5d96d0=typeof _0x5d4092[_0xa831('0x1e')]==='undefined'&&typeof _0x5d4092[_0xa831('0x1f')]===_0xa831('0x20');var _0x23fe67=_0x1cf96b[_0xa831('0x21')];var _0x97762b=_0x5d96d0?0x0:_0x5d4092[_0xa831('0x1e')];var _0x370dda=_0x5d96d0?_0x1cf96b[_0xa831('0x21')]:_0x5d4092[_0xa831('0x1e')]+_0x5d4092[_0xa831('0x1f')];var _0x554e04;if(_0x370dda>=_0x23fe67){_0x370dda=_0x23fe67;_0x554e04=0xc8;}else{_0x554e04=0xce;}_0x118657[_0xa831('0x1c')](_0x554e04);return _0x118657['set'](_0xa831('0x22'),_0x97762b+'-'+_0x370dda+'/'+_0x23fe67)['json'](_0x1cf96b);}return null;};}function patchUpdates(_0x43798a){return function(_0x18c99d){try{jsonpatch['apply'](_0x18c99d,_0x43798a,!![]);}catch(_0x3a3c61){return BPromise[_0xa831('0x23')](_0x3a3c61);}return _0x18c99d[_0xa831('0x24')]();};}function saveUpdates(_0x27f373,_0x4d542b){return function(_0x2493c2){if(_0x2493c2){return _0x2493c2[_0xa831('0x25')](_0x27f373)[_0xa831('0x26')](function(_0x468c9a){return _0x468c9a;});}return null;};}function removeEntity(_0x3b20fe,_0x3e64a3){return function(_0x5708e5){if(_0x5708e5){return _0x5708e5[_0xa831('0x27')]()[_0xa831('0x26')](function(){_0x3b20fe['status'](0xcc)[_0xa831('0x1d')]();});}};}function handleEntityNotFound(_0x35f339,_0x580e95){return function(_0x3f9fa7){if(!_0x3f9fa7){_0x35f339[_0xa831('0x1b')](0x194);}return _0x3f9fa7;};}function handleError(_0x507125,_0x565b75){_0x565b75=_0x565b75||0x1f4;return function(_0x52885f){logger[_0xa831('0x28')](_0x52885f[_0xa831('0x29')]);if(_0x52885f[_0xa831('0x2a')]){delete _0x52885f[_0xa831('0x2a')];}_0x507125[_0xa831('0x1c')](_0x565b75)[_0xa831('0x2b')](_0x52885f);};}function getInteractionUsers(_0x980df2,_0x3ae94d){return new BPromise(function(_0x5ba3b8,_0x294929){try{if(_0x3ae94d[_0x980df2['id']]){_0x980df2['Users']=_[_0xa831('0x2c')](_0x3ae94d[_0x980df2['id']],function(_0x4a2a02){return{'id':_0x4a2a02['id'],'fullname':_0x4a2a02[_0xa831('0x2d')]};});}}catch(_0x380e07){_0x294929(_0x380e07);}_0x5ba3b8(_0x980df2);});}function getInteractionTags(_0x4fd38e,_0x5959af){return new BPromise(function(_0x206f5a,_0x4f4170){try{if(_0x4fd38e[_0xa831('0x2e')]){_0x4fd38e[_0xa831('0x2f')]=[];_0x4fd38e[_0xa831('0x2e')][_0xa831('0x30')](',')[_0xa831('0x31')](function(_0xdb24b5){_0x4fd38e['Tags'][_0xa831('0x32')](_0x5959af[_0xdb24b5]);});}delete _0x4fd38e[_0xa831('0x2e')];}catch(_0x1b0ba6){_0x4f4170(_0x1b0ba6);}_0x206f5a(_0x4fd38e);});}function updateFaxInteraction(_0x447baa,_0x5ccd1c,_0x38f25c){return new BPromise(function(_0x329222,_0x14ce8d){return getInteractionUsers(_0x447baa,_0x38f25c)[_0xa831('0x26')](function(_0x5dbaf1){return getInteractionTags(_0x5dbaf1,_0x5ccd1c);})[_0xa831('0x26')](function(_0x279e47){_0x329222(_0x279e47);})['catch'](function(_0x259bbf){_0x14ce8d(_0x259bbf);});});}exports['index']=function(_0x5944ca,_0x4f263a){var _0xcbbf52={},_0x1e2352={},_0x16e9db={'count':0x0,'rows':[]};var _0xa177fa=_[_0xa831('0x2c')](db['FaxInteraction'][_0xa831('0x33')],function(_0x1ced24){return{'name':_0x1ced24[_0xa831('0x34')],'type':_0x1ced24[_0xa831('0x35')][_0xa831('0x36')]};});_0x1e2352[_0xa831('0x37')]=_['map'](_0xa177fa,_0xa831('0x2a'));_0x1e2352[_0xa831('0x38')]=_[_0xa831('0x39')](_0x5944ca[_0xa831('0x38')]);_0x1e2352[_0xa831('0x3a')]=_[_0xa831('0x3b')](_0x1e2352[_0xa831('0x37')],_0x1e2352['query']);_0xcbbf52[_0xa831('0x3c')]=_[_0xa831('0x3b')](_0x1e2352[_0xa831('0x37')],qs[_0xa831('0x3d')](_0x5944ca['query']['fields']));_0xcbbf52['attributes']=_0xcbbf52[_0xa831('0x3c')]['length']?_0xcbbf52['attributes']:_0x1e2352[_0xa831('0x37')];if(!_0x5944ca[_0xa831('0x38')][_0xa831('0x3e')](_0xa831('0x3f'))){_0xcbbf52[_0xa831('0x1f')]=qs[_0xa831('0x1f')](_0x5944ca[_0xa831('0x38')]['limit']);_0xcbbf52['offset']=qs[_0xa831('0x1e')](_0x5944ca[_0xa831('0x38')][_0xa831('0x1e')]);}_0xcbbf52[_0xa831('0x40')]=qs[_0xa831('0x41')](_0x5944ca['query']['sort']);_0xcbbf52[_0xa831('0x42')]=qs['filters'](_[_0xa831('0x43')](_0x5944ca[_0xa831('0x38')],_0x1e2352[_0xa831('0x3a')]),_0xa177fa);var _0x6ad51d=[];var _0x304073=squel['select']()[_0xa831('0x44')]('id')['field'](_0xa831('0x2a'))[_0xa831('0x44')](_0xa831('0x45'))[_0xa831('0x46')]('tools_tags');var _0x29b82a=squel['select']()[_0xa831('0x44')](_0xa831('0x47'))[_0xa831('0x44')](_0xa831('0x48'))[_0xa831('0x44')]('ui.FaxInteractionId')[_0xa831('0x46')](_0xa831('0x49'),'ui')['left_join'](_0xa831('0x4a'),'u',_0xa831('0x4b'));var _0x14792d=squel['select']()['from'](_0xa831('0x4c'),'i')[_0xa831('0x4d')]('cm_contacts','c',_0xa831('0x4e'))[_0xa831('0x4d')](_0xa831('0x4a'),'o',_0xa831('0x4f'))[_0xa831('0x4d')](_0xa831('0x50'),'a',_0xa831('0x51'))[_0xa831('0x4d')]('fax_messages','me',_0xa831('0x52'))[_0xa831('0x4d')](_0xa831('0x53'),'it',_0xa831('0x54'))[_0xa831('0x4d')]('tools_tags','t',_0xa831('0x55'));var _0x1184f2=squel[_0xa831('0x56')]();var _0x14a8ba=[];var _0x40e5d0=squel[_0xa831('0x56')]();var _0x2be089;if(_0x5944ca[_0xa831('0x38')][_0xa831('0x57')]){_0x2be089=as[_0xa831('0x58')](_0x5944ca[_0xa831('0x38')]['search']);var _0x287145=_0x2be089['sqlOperator'];for(var _0x35557e=0x0;_0x35557e<_0x2be089['conditions'][_0xa831('0x59')];_0x35557e++){var _0x4bada9=_0x2be089[_0xa831('0x5a')][_0x35557e];var _0x266a44='i';var _0x557a25=_[_0xa831('0x5b')](_0xa177fa,['name',_0x4bada9['field']]);if(!_0x557a25){switch(_0x4bada9[_0xa831('0x44')]){case _0xa831('0x5c'):if(_0x4bada9[_0xa831('0x5d')]==0x1){_0x14792d[_0xa831('0x5e')]('`'+_0x4bada9['field']+_0xa831('0x5f'));}else{_0x14792d[_0xa831('0x5e')]('`'+_0x4bada9[_0xa831('0x44')]+'`\x20>\x200');}break;case _0xa831('0x60'):if(_0x4bada9['operator']==='$substring'){if(_0x4bada9[_0xa831('0x5d')][_0xa831('0x30')]('\x20')[_0xa831('0x59')]>0x1){_0x1184f2[_0x287145](_0xa831('0x61'),qs[_0xa831('0x62')](_0x4bada9[_0xa831('0x5d')]),null);}else{var _0xdde7a6='%'+_0x4bada9['value']+'%';_0x1184f2[_0x287145]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xdde7a6,_0xdde7a6,_0xdde7a6);}}else{_0x557a25=_[_0xa831('0x5b')](_0xa177fa,[_0xa831('0x2a'),'ContactId']);_0x4bada9['field']=_0xa831('0x63');_0x5ee311=as[_0xa831('0x64')](_0x266a44,_0x557a25[_0xa831('0x35')],_0x4bada9);_0x1184f2[_0x287145](_0x5ee311[_0xa831('0x65')],_0x5ee311[_0xa831('0x5d')][_0xa831('0x66')],_0x5ee311[_0xa831('0x5d')][_0xa831('0x1d')]);}break;case _0xa831('0x67'):var _0x2c3e26=_0x4bada9[_0xa831('0x5d')]['split'](',')[_0xa831('0x2c')](function(_0x40dcda){return Number(_0x40dcda);});_0x2c3e26[_0xa831('0x31')](function(_0x1ff96c){_0x40e5d0['or'](_0xa831('0x68'),'%,'+_0x1ff96c+',%');});_0x14a8ba=_['union'](_0x14a8ba,_0x2c3e26);break;case _0xa831('0x69'):if(_0x4bada9['operator']===_0xa831('0x6a')){_0x1184f2[_0x287145](_0xa831('0x6b'),'%'+_0x4bada9['value']+'%',null);}else{_0x557a25=_[_0xa831('0x5b')](_0xa177fa,['name',_0xa831('0x6c')]);_0x4bada9['field']=_0xa831('0x6c');_0x5ee311=as[_0xa831('0x64')](_0x266a44,_0x557a25['type'],_0x4bada9);_0x1184f2[_0x287145](_0x5ee311[_0xa831('0x65')],_0x5ee311['value'][_0xa831('0x66')],_0x5ee311[_0xa831('0x5d')][_0xa831('0x1d')]);}break;case _0xa831('0x6d'):_0x5ee311=as['buildExpression']('me',null,_0x4bada9);_0x1184f2[_0x287145](_0x5ee311[_0xa831('0x65')],_0x5ee311[_0xa831('0x5d')]['start'],_0x5ee311['value']['end']);break;}}else{var _0x5ee311=as[_0xa831('0x64')](_0x266a44,_0x557a25[_0xa831('0x35')],_0x4bada9);_0x1184f2[_0x287145](_0x5ee311['text'],_0x5ee311['value'][_0xa831('0x66')],_0x5ee311[_0xa831('0x5d')][_0xa831('0x1d')]);}}}else{var _0x452f15=_(_0x5944ca[_0xa831('0x38')])[_0xa831('0x39')]()[_0xa831('0x2c')](function(_0x4a5d01){return _[_0xa831('0x6e')](_0xa177fa,[_0xa831('0x2a'),_0x4a5d01])?_0x4a5d01:undefined;})[_0xa831('0x6f')]()[_0xa831('0x5d')]();if(!_['isEmpty'](_0x452f15)){_0x452f15['forEach'](function(_0x5626e6){if(_0x5626e6===_0xa831('0x70')){_0x14792d['where'](_0xa831('0x71'),[][_0xa831('0x72')](_0x5944ca[_0xa831('0x38')][_0x5626e6]));}else if(_0x5626e6===_0xa831('0x73')){var _0x47cd41=JSON[_0xa831('0x74')](_0x5944ca[_0xa831('0x38')][_0x5626e6])['$gte'];var _0x15ca78=JSON[_0xa831('0x74')](_0x5944ca[_0xa831('0x38')][_0x5626e6])[_0xa831('0x75')];_0x14792d[_0xa831('0x42')](_0xa831('0x76'),_0x47cd41,_0x15ca78);}else{if(_0x5944ca['query'][_0x5626e6]===_0xa831('0x77')){_0x14792d['where']('i.'+_0x5626e6+_0xa831('0x78'));}else{_0x14792d['where']('i.'+_0x5626e6+'\x20=\x20?',_0x5944ca[_0xa831('0x38')][_0x5626e6]);}}});}if(_0x5944ca[_0xa831('0x38')][_0xa831('0x79')]){if(_0x5944ca[_0xa831('0x38')][_0xa831('0x79')]==0x1){_0x14792d[_0xa831('0x5e')](_0xa831('0x7a'));}else{_0x14792d['having'](_0xa831('0x7b'));}}if(_0x5944ca['query'][_0xa831('0x7c')]){_0x14a8ba=_[_0xa831('0x7d')](_0x5944ca['query'][_0xa831('0x7c')])?_0x5944ca[_0xa831('0x38')][_0xa831('0x7c')]:new Array(_0x5944ca[_0xa831('0x38')][_0xa831('0x7c')]);_0x14a8ba[_0xa831('0x31')](function(_0x48cb58){_0x40e5d0['or'](_0xa831('0x68'),'%,'+_0x48cb58+',%');});}if(_0x5944ca['query']['filter']){var _0x572da2=_0x5944ca[_0xa831('0x38')][_0xa831('0x7e')][_0xa831('0x7f')]('\x5c','\x5c\x5c')[_0xa831('0x7f')](/'/g,'\x27\x27');if(qs[_0xa831('0x80')](_0x572da2)){_0x1184f2['or'](_0xa831('0x81'),_0x572da2+'%')['or'](_0xa831('0x82'),_0x572da2+'%');}_0x1184f2['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x572da2+'%');}}_0x14792d['where'](_0x1184f2);_0x14792d[_0xa831('0x83')](_0xa831('0x84'));var _0x104b6f={'type':db[_0xa831('0x85')]['QueryTypes'][_0xa831('0x86')],'raw':!![]};var _0x168d2f=_0x14792d[_0xa831('0x87')]();_0x168d2f[_0xa831('0x44')](_0xa831('0x84'));_0x168d2f['field'](_0xa831('0x88'),'unreadMessages');if(_0xcbbf52[_0xa831('0x40')]){_0xcbbf52[_0xa831('0x40')][_0xa831('0x31')](function(_0x5e070e){var _0x248cb2=_0x5e070e[0x0]==='contactName'?_0x5e070e[0x0]:'i.'+_0x5e070e[0x0];_0x14792d[_0xa831('0x40')](_0x248cb2,_0x5e070e[0x1]===_0xa831('0x89')?![]:!![]);});}if(!_[_0xa831('0x8a')](_0x14a8ba)){_0x14792d[_0xa831('0x5e')](_0x40e5d0);_0x168d2f[_0xa831('0x42')]('t.id\x20IN\x20?',_0x14a8ba);}BPromise['resolve']()[_0xa831('0x26')](function(){if(!_0x2be089){if(_0x5944ca[_0xa831('0x38')][_0xa831('0x70')])return;_0x168d2f[_0xa831('0x42')](_0xa831('0x8b'));_0x14792d[_0xa831('0x42')](_0xa831('0x8b'));return;}if(_0x5944ca[_0xa831('0x8c')][_0xa831('0x8d')]!==_0xa831('0x8e'))return;return _0x5944ca[_0xa831('0x8c')][_0xa831('0x8f')]({'attributes':['id'],'raw':!![]})[_0xa831('0x26')](function(_0x5e8f57){if(_[_0xa831('0x8a')](_0x5e8f57)){_0x168d2f['where']('i.FaxAccountId\x20IS\x20NULL');_0x14792d[_0xa831('0x42')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x168d2f['where']('i.FaxAccountId\x20IN\x20?',_[_0xa831('0x2c')](_0x5e8f57,'id'));_0x14792d[_0xa831('0x42')](_0xa831('0x71'),_[_0xa831('0x2c')](_0x5e8f57,'id'));}});})[_0xa831('0x26')](function(){if(_0x5944ca[_0xa831('0x8c')][_0xa831('0x8d')]===_0xa831('0x8e')&&!_0x2be089&&!_0x5944ca['query'][_0xa831('0x70')])return[];return db[_0xa831('0x90')][_0xa831('0x38')](_0x168d2f[_0xa831('0x91')](),_0x104b6f);})['then'](function(_0x4d48d7){_0x16e9db['count']=_0x4d48d7['length'];if(_0x16e9db[_0xa831('0x21')]===0x0)return[];return db[_0xa831('0x90')][_0xa831('0x38')](_0x304073[_0xa831('0x91')](),_0x104b6f)[_0xa831('0x26')](function(_0x52c389){_0x6ad51d=_['keyBy'](_0x52c389,'id');_0x104b6f=_[_0xa831('0x92')](_0x104b6f,{'model':db[_0xa831('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5944ca[_0xa831('0x38')][_0xa831('0x3d')]){_0xcbbf52[_0xa831('0x3c')][_0xa831('0x31')](function(_0xcdbe3b){_0x14792d['field']('i.'+_0xcdbe3b);});}else{_0x14792d[_0xa831('0x44')](_0xa831('0x88'),_0xa831('0x5c'));_0x14792d[_0xa831('0x44')](_0xa831('0x94'),'Account.key');_0x14792d['field'](_0xa831('0x95'),_0xa831('0x96'));_0x14792d['field'](_0xa831('0x97'),_0xa831('0x98'));_0x14792d['field'](_0xa831('0x99'));_0x14792d[_0xa831('0x44')](_0xa831('0x9a'),_0xa831('0x9b'));_0x14792d[_0xa831('0x44')]('c.lastName',_0xa831('0x9c'));_0x14792d['field'](_0xa831('0x9d'),'Contact.email');_0x14792d['field']('c.phone',_0xa831('0x9e'));_0x14792d[_0xa831('0x44')](_0xa831('0x9f'),_0xa831('0xa0'));_0x14792d['field'](_0xa831('0xa1'),'Contact.fax');_0x14792d[_0xa831('0x44')](_0xa831('0xa2'),_0xa831('0xa3'));_0x14792d[_0xa831('0x44')](_0xa831('0xa4'),'Owner.internal');_0x14792d[_0xa831('0x44')](_0xa831('0xa5'),_0xa831('0x2e'));}if(_0xcbbf52[_0xa831('0x1f')])_0x14792d[_0xa831('0x1f')](_0xcbbf52[_0xa831('0x1f')]);if(_0xcbbf52[_0xa831('0x1e')])_0x14792d[_0xa831('0x1e')](_0xcbbf52[_0xa831('0x1e')]);return db[_0xa831('0x90')][_0xa831('0x38')](_0x14792d[_0xa831('0x91')](),_0x104b6f);})[_0xa831('0x26')](function(_0xa72b79){if(_0xa72b79[_0xa831('0x59')]>0x0)_0x29b82a[_0xa831('0x42')](_0xa831('0xa6'),_[_0xa831('0x2c')](_0xa72b79,'id'));return db[_0xa831('0x90')]['query'](_0x29b82a[_0xa831('0x91')](),_0x104b6f)['then'](function(_0x350e9c){var _0x314c44=_['groupBy'](_0x350e9c,_0xa831('0xa7'));var _0x904e99=[];_0xa72b79[_0xa831('0x31')](function(_0x306089){_0x904e99[_0xa831('0x32')](updateFaxInteraction(_0x306089,_0x6ad51d,_0x314c44));});return BPromise[_0xa831('0xa8')](_0x904e99);});});})[_0xa831('0x26')](function(_0x2557c0){_0x16e9db['rows']=_0x2557c0;return _0x16e9db;})[_0xa831('0x26')](respondWithFilteredResult(_0x4f263a,_0xcbbf52))['catch'](handleError(_0x4f263a,null));};exports[_0xa831('0xa9')]=function(_0x14d398,_0x12516f){var _0x11bde9={'raw':![],'where':{'id':_0x14d398['params']['id']}},_0x325538={};_0x325538['model']=_[_0xa831('0x39')](db['FaxInteraction'][_0xa831('0x33')]);_0x325538['query']=_['keys'](_0x14d398[_0xa831('0x38')]);_0x325538[_0xa831('0x3a')]=_[_0xa831('0x3b')](_0x325538[_0xa831('0x37')],_0x325538['query']);_0x11bde9[_0xa831('0x3c')]=_['intersection'](_0x325538[_0xa831('0x37')],qs[_0xa831('0x3d')](_0x14d398[_0xa831('0x38')][_0xa831('0x3d')]));_0x11bde9['attributes']=_0x11bde9[_0xa831('0x3c')][_0xa831('0x59')]?_0x11bde9[_0xa831('0x3c')]:_0x325538[_0xa831('0x37')];if(_0x14d398[_0xa831('0x38')][_0xa831('0xaa')]){_0x11bde9['include']=[{'all':!![]}];}_0x11bde9=_[_0xa831('0x92')]({},_0x11bde9,_0x14d398[_0xa831('0xab')]);return db['FaxInteraction'][_0xa831('0x5b')](_0x11bde9)['then'](handleEntityNotFound(_0x12516f,null))['then'](respondWithResult(_0x12516f,null))[_0xa831('0xac')](handleError(_0x12516f,null));};exports[_0xa831('0xad')]=function(_0x59e038,_0x228138){return db[_0xa831('0x93')][_0xa831('0xad')](_0x59e038[_0xa831('0x6d')],{})[_0xa831('0x26')](respondWithResult(_0x228138,0xc9))[_0xa831('0xac')](handleError(_0x228138,null));};exports[_0xa831('0x25')]=function(_0x154469,_0x413447){if(_0x154469[_0xa831('0x6d')]['id']){delete _0x154469[_0xa831('0x6d')]['id'];}return db[_0xa831('0x93')][_0xa831('0x5b')]({'where':{'id':_0x154469[_0xa831('0xae')]['id']}})['then'](handleEntityNotFound(_0x413447,null))[_0xa831('0x26')](saveUpdates(_0x154469[_0xa831('0x6d')],null))[_0xa831('0x26')](respondWithResult(_0x413447,null))['catch'](handleError(_0x413447,null));};exports['destroy']=function(_0xaae7a,_0x354452){return db['FaxInteraction']['find']({'where':{'id':_0xaae7a[_0xa831('0xae')]['id']}})[_0xa831('0x26')](handleEntityNotFound(_0x354452,null))[_0xa831('0x26')](removeEntity(_0x354452,null))[_0xa831('0xac')](handleError(_0x354452,null));};exports['describe']=function(_0x521428,_0x1fc74c){return db[_0xa831('0x93')][_0xa831('0xaf')]()[_0xa831('0x26')](respondWithResult(_0x1fc74c,null))[_0xa831('0xac')](handleError(_0x1fc74c,null));};exports['addMessage']=function(_0x35b35e,_0x38d363,_0x3e9db9){return db[_0xa831('0xb0')]['find']({'where':{'id':_0x35b35e['params']['id']}})[_0xa831('0x26')](handleEntityNotFound(_0x38d363,null))['then'](function(_0x5ac6bb){if(_0x5ac6bb){return _0x5ac6bb[_0xa831('0xb1')](_0x35b35e['body'][_0xa831('0xb2')],_[_0xa831('0xb3')](_0x35b35e['body'],[_0xa831('0xb2'),'id'])||{});}})[_0xa831('0x26')](respondWithResult(_0x38d363,null))[_0xa831('0xac')](handleError(_0x38d363,null));};exports[_0xa831('0xb4')]=function(_0x1ef96,_0x8fbd71,_0x3fba74){var _0x4b63cf={'raw':![],'where':{}};var _0x163cad={};var _0x5e7582={'count':0x0,'rows':[]};return db[_0xa831('0x93')][_0xa831('0xb5')]({'where':{'id':_0x1ef96[_0xa831('0xae')]['id']}})[_0xa831('0x26')](handleEntityNotFound(_0x8fbd71,null))['then'](function(_0x17faf1){if(_0x17faf1){_0x163cad['model']=_[_0xa831('0x39')](db[_0xa831('0xb0')][_0xa831('0x33')]);_0x163cad[_0xa831('0x38')]=_[_0xa831('0x39')](_0x1ef96[_0xa831('0x38')]);_0x163cad[_0xa831('0x3a')]=_[_0xa831('0x3b')](_0x163cad[_0xa831('0x37')],_0x163cad['query']);_0x4b63cf[_0xa831('0x3c')]=_[_0xa831('0x3b')](_0x163cad['model'],qs[_0xa831('0x3d')](_0x1ef96[_0xa831('0x38')]['fields']));_0x4b63cf[_0xa831('0x3c')]=_0x4b63cf['attributes'][_0xa831('0x59')]?_0x4b63cf['attributes']:_0x163cad[_0xa831('0x37')];if(!_0x1ef96[_0xa831('0x38')][_0xa831('0x3e')](_0xa831('0x3f'))){_0x4b63cf[_0xa831('0x1f')]=qs[_0xa831('0x1f')](_0x1ef96[_0xa831('0x38')][_0xa831('0x1f')]);_0x4b63cf[_0xa831('0x1e')]=qs['offset'](_0x1ef96['query'][_0xa831('0x1e')]);}_0x4b63cf[_0xa831('0x40')]=qs[_0xa831('0x41')](_0x1ef96['query'][_0xa831('0x41')]);_0x4b63cf[_0xa831('0x42')]=qs[_0xa831('0x3a')](_['pick'](_0x1ef96[_0xa831('0x38')],_0x163cad[_0xa831('0x3a')]));_0x4b63cf['where'][_0xa831('0xa7')]=_0x17faf1['id'];if(_0x1ef96[_0xa831('0x38')][_0xa831('0x7e')]){_0x4b63cf[_0xa831('0x42')]=_['merge'](_0x4b63cf[_0xa831('0x42')],{'$or':_[_0xa831('0x2c')](_0x4b63cf['attributes'],function(_0x349f32){var _0x2610f3={};_0x2610f3[_0x349f32]={'$like':'%'+_0x1ef96[_0xa831('0x38')][_0xa831('0x7e')]+'%'};return _0x2610f3;})});}if(_0x1ef96[_0xa831('0x38')][_0xa831('0xb6')]){var _0xaeca84=_0x1ef96[_0xa831('0x38')]['$gte'][_0xa831('0x30')](',');var _0x188d67={};_0x188d67[_0xaeca84[0x0]]={'$gte':moment(_0xaeca84[0x1])[_0xa831('0xb7')](_0xa831('0xb8'))};_0x4b63cf[_0xa831('0x42')]=_[_0xa831('0x92')](_0x4b63cf[_0xa831('0x42')],_0x188d67);}_0x4b63cf=_[_0xa831('0x92')]({},_0x4b63cf,_0x1ef96[_0xa831('0xab')]);return db[_0xa831('0xb0')][_0xa831('0x21')]({'where':_0x4b63cf[_0xa831('0x42')]})[_0xa831('0x26')](function(_0xf9a24d){_0x5e7582['count']=_0xf9a24d;if(_0x1ef96[_0xa831('0x38')]['includeAll']){_0x4b63cf[_0xa831('0xb9')]=[{'all':!![]}];}return db[_0xa831('0xb0')]['findAll'](_0x4b63cf);})[_0xa831('0x26')](function(_0x46bce9){_0x5e7582[_0xa831('0xba')]=_0x46bce9;return _0x5e7582;});}})[_0xa831('0x26')](respondWithFilteredResult(_0x8fbd71,_0x4b63cf))[_0xa831('0xac')](handleError(_0x8fbd71,null));};exports[_0xa831('0xbb')]=function(_0x29b036,_0x453595,_0x1da1ce){return db['FaxInteraction']['find']({'where':{'id':_0x29b036['params']['id']}})[_0xa831('0x26')](handleEntityNotFound(_0x453595,null))['then'](function(_0x48d044){if(_0x48d044){return _0x48d044['setTags'](_0x29b036['body'][_0xa831('0xb2')],_[_0xa831('0xb3')](_0x29b036[_0xa831('0x6d')],[_0xa831('0xb2'),'id'])||{})['spread'](function(){return db[_0xa831('0x67')]['findAll']({'attributes':['id',_0xa831('0x2a'),_0xa831('0x45')],'where':{'id':_0x29b036['body'][_0xa831('0xb2')]}});})[_0xa831('0x26')](function(_0xde813d){socket['emit']('faxInteractionTags:save',{'id':Number(_0x29b036[_0xa831('0xae')]['id']),'tags':_0xde813d||[]});return{'id':Number(_0x29b036[_0xa831('0xae')]['id']),'tags':_0xde813d||[]};});}})[_0xa831('0x26')](respondWithResult(_0x453595,null))[_0xa831('0xac')](handleError(_0x453595,null));};exports[_0xa831('0xbc')]=function(_0x460651,_0x48035f,_0x240237){return db[_0xa831('0x93')][_0xa831('0x5b')]({'where':{'id':_0x460651[_0xa831('0xae')]['id']}})[_0xa831('0x26')](handleEntityNotFound(_0x48035f,null))[_0xa831('0x26')](function(_0x47fbeb){if(_0x47fbeb){return _0x47fbeb['removeTags'](_0x460651[_0xa831('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x48035f,null))['catch'](handleError(_0x48035f,null));};exports[_0xa831('0xbd')]=function(_0x271ac9,_0x41c441){var _0x248050=moment()[_0xa831('0xbe')]()[_0xa831('0x91')]();var _0x8b7165=path[_0xa831('0xbf')](config['root'],_0xa831('0xc0'),_0xa831('0xc1'),_0xa831('0xc2'));var _0x21f167=path[_0xa831('0xbf')](config['root'],_0xa831('0xc0'),_0xa831('0xc1'),_0xa831('0xc3'));var _0x1c99b8=path[_0xa831('0xbf')](_0x8b7165,_0x248050);var _0x2d31d4=util[_0xa831('0xb7')](_0xa831('0xc4'),_0x271ac9[_0xa831('0xae')]['id'],_0x248050);var _0x282691=path[_0xa831('0xbf')](_0x8b7165,_0x2d31d4);var _0x3f0c29=[];_0x3f0c29[_0xa831('0x32')]({'model':db[_0xa831('0xc5')],'as':_0xa831('0xc5'),'raw':!![]});var _0x475f55=[{'model':db[_0xa831('0xb0')],'as':_0xa831('0xc6'),'attributes':['id','body','createdAt'],'include':_0x3f0c29}];return db['FaxInteraction'][_0xa831('0x5b')]({'where':{'id':_0x271ac9[_0xa831('0xae')]['id']},'include':_0x475f55})['then'](handleEntityNotFound(_0x41c441,null))[_0xa831('0x26')](function(_0x3d37ea){if(_0x3d37ea&&_0x3d37ea[_0xa831('0xc6')]){var _0x362778=_0x3d37ea['get']({'plain':!![]});fs[_0xa831('0xc7')](_0x1c99b8);for(var _0x308777=0x0;_0x308777<_0x362778[_0xa831('0xc6')][_0xa831('0x59')];_0x308777++){var _0x10626a=_0x362778[_0xa831('0xc6')][_0x308777][_0xa831('0xc5')];if(_0x10626a){var _0x17677a=path[_0xa831('0xbf')](_0x21f167,_0x10626a[_0xa831('0xc8')]);if(fs[_0xa831('0xc9')](_0x17677a)){fs['createReadStream'](_0x17677a)[_0xa831('0xca')](fs['createWriteStream'](path['join'](_0x1c99b8,_0x10626a[_0xa831('0xc8')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x2c2991,_0x572d15){zipdir(_0x1c99b8,{'saveTo':_0x282691},function(_0x470592,_0x473173){if(_0x470592)return _0x572d15(_0x470592);return _0x2c2991(_0x473173);});})['then'](function(){return new BPromise(function(_0x324567,_0x1899b8){rimraf(_0x1c99b8,function(_0x284903){if(_0x284903)_0x1899b8(_0x284903);return _0x324567();});});})[_0xa831('0x26')](function(){return _0x41c441[_0xa831('0xbd')](_0x282691,_0x2d31d4,function(_0xe0aa30){if(_0xe0aa30){console['log'](_0xa831('0xcb'),_0xe0aa30);}else{fs[_0xa831('0xcc')](_0x282691);}});});});}else{return _0x41c441['sendStatus'](0xc8);}})[_0xa831('0xac')](handleError(_0x41c441,null));}; \ No newline at end of file +var _0xb40f=['zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','destroy','stack','name','send','Users','map','TagIds','split','forEach','Tags','push','then','catch','index','FaxInteraction','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','end','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?','UserId','body','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','include','merge','options','create','update','describe','addMessage','FaxMessage','ids','omit','findOne','rawAttributes','hasOwnProperty','format','includeAll','findAll','rows','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','Attachment','Messages','get','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','rimraf'];(function(_0x226012,_0x44c139){var _0x4a7066=function(_0x552549){while(--_0x552549){_0x226012['push'](_0x226012['shift']());}};_0x4a7066(++_0x44c139);}(_0xb40f,0x1bf));var _0xfb40=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0xb40f[_0x12a2a6];return _0x1754ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb40('0x0'));var zipdir=require(_0xfb40('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb40('0x2'));var moment=require('moment');var BPromise=require(_0xfb40('0x3'));var Mustache=require(_0xfb40('0x4'));var util=require(_0xfb40('0x5'));var path=require('path');var sox=require(_0xfb40('0x6'));var csv=require(_0xfb40('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfb40('0x8'));var crypto=require(_0xfb40('0x9'));var jsforce=require(_0xfb40('0xa'));var deskjs=require(_0xfb40('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfb40('0xc'));var Papa=require(_0xfb40('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfb40('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb40('0xf'))(_0xfb40('0x10'));var utils=require(_0xfb40('0x11'));var config=require(_0xfb40('0x12'));var licenseUtil=require(_0xfb40('0x13'));var db=require(_0xfb40('0x14'))['db'];config[_0xfb40('0x15')]=_[_0xfb40('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb40('0x17'))(new Redis(config['redis']));require(_0xfb40('0x18'))[_0xfb40('0x19')](socket);function respondWithStatusCode(_0x382fb2,_0x1bfb6b){_0x1bfb6b=_0x1bfb6b||0xcc;return function(_0x43095c){if(_0x43095c){return _0x382fb2[_0xfb40('0x1a')](_0x1bfb6b);}return _0x382fb2[_0xfb40('0x1b')](_0x1bfb6b)['end']();};}function respondWithResult(_0x119f91,_0x140664){_0x140664=_0x140664||0xc8;return function(_0x3905c2){if(_0x3905c2){return _0x119f91[_0xfb40('0x1b')](_0x140664)['json'](_0x3905c2);}};}function respondWithFilteredResult(_0xdae59f,_0x260092){return function(_0x18ce01){if(_0x18ce01){var _0x1cd3e1=typeof _0x260092['offset']==='undefined'&&typeof _0x260092[_0xfb40('0x1c')]===_0xfb40('0x1d');var _0x21964e=_0x18ce01['count'];var _0x2efca3=_0x1cd3e1?0x0:_0x260092[_0xfb40('0x1e')];var _0x2f51f3=_0x1cd3e1?_0x18ce01[_0xfb40('0x1f')]:_0x260092[_0xfb40('0x1e')]+_0x260092[_0xfb40('0x1c')];var _0x5ac101;if(_0x2f51f3>=_0x21964e){_0x2f51f3=_0x21964e;_0x5ac101=0xc8;}else{_0x5ac101=0xce;}_0xdae59f[_0xfb40('0x1b')](_0x5ac101);return _0xdae59f[_0xfb40('0x20')](_0xfb40('0x21'),_0x2efca3+'-'+_0x2f51f3+'/'+_0x21964e)[_0xfb40('0x22')](_0x18ce01);}return null;};}function patchUpdates(_0x1e6b24){return function(_0x2e88d3){try{jsonpatch[_0xfb40('0x23')](_0x2e88d3,_0x1e6b24,!![]);}catch(_0x38b01a){return BPromise[_0xfb40('0x24')](_0x38b01a);}return _0x2e88d3['save']();};}function saveUpdates(_0x27d729,_0x470f03){return function(_0x3db549){if(_0x3db549){return _0x3db549['update'](_0x27d729)['then'](function(_0x36d0c6){return _0x36d0c6;});}return null;};}function removeEntity(_0x64ffb,_0x1fbbe3){return function(_0x258004){if(_0x258004){return _0x258004[_0xfb40('0x25')]()['then'](function(){_0x64ffb[_0xfb40('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x886de7,_0x452e5c){return function(_0x5872f7){if(!_0x5872f7){_0x886de7[_0xfb40('0x1a')](0x194);}return _0x5872f7;};}function handleError(_0x3d0284,_0x7ae647){_0x7ae647=_0x7ae647||0x1f4;return function(_0x2e46f3){logger['error'](_0x2e46f3[_0xfb40('0x26')]);if(_0x2e46f3[_0xfb40('0x27')]){delete _0x2e46f3[_0xfb40('0x27')];}_0x3d0284[_0xfb40('0x1b')](_0x7ae647)[_0xfb40('0x28')](_0x2e46f3);};}function getInteractionUsers(_0x27be40,_0xa2ebf2){return new BPromise(function(_0x2c0425,_0x437f9c){try{if(_0xa2ebf2[_0x27be40['id']]){_0x27be40[_0xfb40('0x29')]=_[_0xfb40('0x2a')](_0xa2ebf2[_0x27be40['id']],function(_0x13c593){return{'id':_0x13c593['id'],'fullname':_0x13c593['fullname']};});}}catch(_0x37365b){_0x437f9c(_0x37365b);}_0x2c0425(_0x27be40);});}function getInteractionTags(_0xa49683,_0x16b144){return new BPromise(function(_0x32391c,_0x26fc92){try{if(_0xa49683[_0xfb40('0x2b')]){_0xa49683['Tags']=[];_0xa49683[_0xfb40('0x2b')][_0xfb40('0x2c')](',')[_0xfb40('0x2d')](function(_0x46ac0e){_0xa49683[_0xfb40('0x2e')][_0xfb40('0x2f')](_0x16b144[_0x46ac0e]);});}delete _0xa49683[_0xfb40('0x2b')];}catch(_0x502f96){_0x26fc92(_0x502f96);}_0x32391c(_0xa49683);});}function updateFaxInteraction(_0x2f4b0,_0x2ffb15,_0x432484){return new BPromise(function(_0x254e6e,_0x42be62){return getInteractionUsers(_0x2f4b0,_0x432484)[_0xfb40('0x30')](function(_0x463dd0){return getInteractionTags(_0x463dd0,_0x2ffb15);})['then'](function(_0x1ccbf4){_0x254e6e(_0x1ccbf4);})[_0xfb40('0x31')](function(_0x3654c6){_0x42be62(_0x3654c6);});});}exports[_0xfb40('0x32')]=function(_0x353e52,_0xa0dbc6){var _0x2a747a={},_0x409ec6={},_0x3f0faa={'count':0x0,'rows':[]};var _0x37126f=_[_0xfb40('0x2a')](db[_0xfb40('0x33')]['rawAttributes'],function(_0x38a4ae){return{'name':_0x38a4ae[_0xfb40('0x34')],'type':_0x38a4ae['type'][_0xfb40('0x35')]};});_0x409ec6[_0xfb40('0x36')]=_[_0xfb40('0x2a')](_0x37126f,_0xfb40('0x27'));_0x409ec6[_0xfb40('0x37')]=_[_0xfb40('0x38')](_0x353e52[_0xfb40('0x37')]);_0x409ec6[_0xfb40('0x39')]=_[_0xfb40('0x3a')](_0x409ec6[_0xfb40('0x36')],_0x409ec6[_0xfb40('0x37')]);_0x2a747a[_0xfb40('0x3b')]=_[_0xfb40('0x3a')](_0x409ec6[_0xfb40('0x36')],qs[_0xfb40('0x3c')](_0x353e52[_0xfb40('0x37')][_0xfb40('0x3c')]));_0x2a747a['attributes']=_0x2a747a[_0xfb40('0x3b')][_0xfb40('0x3d')]?_0x2a747a[_0xfb40('0x3b')]:_0x409ec6['model'];if(!_0x353e52[_0xfb40('0x37')]['hasOwnProperty'](_0xfb40('0x3e'))){_0x2a747a['limit']=qs['limit'](_0x353e52[_0xfb40('0x37')][_0xfb40('0x1c')]);_0x2a747a[_0xfb40('0x1e')]=qs[_0xfb40('0x1e')](_0x353e52[_0xfb40('0x37')][_0xfb40('0x1e')]);}_0x2a747a[_0xfb40('0x3f')]=qs[_0xfb40('0x40')](_0x353e52[_0xfb40('0x37')][_0xfb40('0x40')]);_0x2a747a[_0xfb40('0x41')]=qs['filters'](_[_0xfb40('0x42')](_0x353e52['query'],_0x409ec6[_0xfb40('0x39')]),_0x37126f);var _0x21e0bb=[];var _0x13f9e2=squel[_0xfb40('0x43')]()[_0xfb40('0x44')]('id')[_0xfb40('0x44')](_0xfb40('0x27'))['field']('color')[_0xfb40('0x45')](_0xfb40('0x46'));var _0x39011e=squel[_0xfb40('0x43')]()[_0xfb40('0x44')]('u.id')[_0xfb40('0x44')](_0xfb40('0x47'))['field'](_0xfb40('0x48'))[_0xfb40('0x45')](_0xfb40('0x49'),'ui')[_0xfb40('0x4a')](_0xfb40('0x4b'),'u',_0xfb40('0x4c'));var _0x430b89=squel[_0xfb40('0x43')]()[_0xfb40('0x45')](_0xfb40('0x4d'),'i')[_0xfb40('0x4a')](_0xfb40('0x4e'),'c',_0xfb40('0x4f'))[_0xfb40('0x4a')](_0xfb40('0x4b'),'o','o.id\x20=\x20i.UserId')[_0xfb40('0x4a')](_0xfb40('0x50'),'a','a.id\x20=\x20i.FaxAccountId')[_0xfb40('0x4a')](_0xfb40('0x51'),'me',_0xfb40('0x52'))[_0xfb40('0x4a')](_0xfb40('0x53'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xfb40('0x4a')](_0xfb40('0x46'),'t',_0xfb40('0x54'));var _0x44cc42=squel[_0xfb40('0x55')]();var _0x5115c7=[];var _0x123808=squel[_0xfb40('0x55')]();var _0x259eb8;if(_0x353e52[_0xfb40('0x37')][_0xfb40('0x56')]){_0x259eb8=as[_0xfb40('0x57')](_0x353e52[_0xfb40('0x37')][_0xfb40('0x56')]);var _0x18422f=_0x259eb8['sqlOperator'];for(var _0x995dca=0x0;_0x995dca<_0x259eb8[_0xfb40('0x58')][_0xfb40('0x3d')];_0x995dca++){var _0x389d19=_0x259eb8[_0xfb40('0x58')][_0x995dca];var _0x338dcf='i';var _0x1c00e9=_[_0xfb40('0x59')](_0x37126f,[_0xfb40('0x27'),_0x389d19['field']]);if(!_0x1c00e9){switch(_0x389d19[_0xfb40('0x44')]){case _0xfb40('0x5a'):if(_0x389d19[_0xfb40('0x5b')]==0x1){_0x430b89[_0xfb40('0x5c')]('`'+_0x389d19[_0xfb40('0x44')]+_0xfb40('0x5d'));}else{_0x430b89[_0xfb40('0x5c')]('`'+_0x389d19[_0xfb40('0x44')]+'`\x20>\x200');}break;case _0xfb40('0x5e'):if(_0x389d19[_0xfb40('0x5f')]==='$substring'){if(_0x389d19[_0xfb40('0x5b')][_0xfb40('0x2c')]('\x20')['length']>0x1){_0x44cc42[_0x18422f](_0xfb40('0x60'),qs[_0xfb40('0x61')](_0x389d19[_0xfb40('0x5b')]),null);}else{var _0x177f1c='%'+_0x389d19['value']+'%';_0x44cc42[_0x18422f](_0xfb40('0x62'),_0x177f1c,_0x177f1c,_0x177f1c);}}else{_0x1c00e9=_[_0xfb40('0x59')](_0x37126f,[_0xfb40('0x27'),_0xfb40('0x63')]);_0x389d19[_0xfb40('0x44')]='ContactId';_0x5107ae=as[_0xfb40('0x64')](_0x338dcf,_0x1c00e9[_0xfb40('0x65')],_0x389d19);_0x44cc42[_0x18422f](_0x5107ae[_0xfb40('0x66')],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x67')],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x68')]);}break;case _0xfb40('0x69'):var _0x4b31e1=_0x389d19[_0xfb40('0x5b')][_0xfb40('0x2c')](',')[_0xfb40('0x2a')](function(_0x2c04fd){return Number(_0x2c04fd);});_0x4b31e1[_0xfb40('0x2d')](function(_0xf2b57b){_0x123808['or'](_0xfb40('0x6a'),'%,'+_0xf2b57b+',%');});_0x5115c7=_[_0xfb40('0x6b')](_0x5115c7,_0x4b31e1);break;case _0xfb40('0x6c'):if(_0x389d19[_0xfb40('0x5f')]===_0xfb40('0x6d')){_0x44cc42[_0x18422f](_0xfb40('0x6e'),'%'+_0x389d19[_0xfb40('0x5b')]+'%',null);}else{_0x1c00e9=_[_0xfb40('0x59')](_0x37126f,[_0xfb40('0x27'),_0xfb40('0x6f')]);_0x389d19[_0xfb40('0x44')]=_0xfb40('0x6f');_0x5107ae=as[_0xfb40('0x64')](_0x338dcf,_0x1c00e9[_0xfb40('0x65')],_0x389d19);_0x44cc42[_0x18422f](_0x5107ae[_0xfb40('0x66')],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x67')],_0x5107ae['value'][_0xfb40('0x68')]);}break;case _0xfb40('0x70'):_0x5107ae=as['buildExpression']('me',null,_0x389d19);_0x44cc42[_0x18422f](_0x5107ae[_0xfb40('0x66')],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x67')],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x68')]);break;}}else{var _0x5107ae=as[_0xfb40('0x64')](_0x338dcf,_0x1c00e9['type'],_0x389d19);_0x44cc42[_0x18422f](_0x5107ae['text'],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x67')],_0x5107ae[_0xfb40('0x5b')][_0xfb40('0x68')]);}}}else{var _0x466f65=_(_0x353e52[_0xfb40('0x37')])[_0xfb40('0x38')]()[_0xfb40('0x2a')](function(_0x1138ad){return _['some'](_0x37126f,['name',_0x1138ad])?_0x1138ad:undefined;})[_0xfb40('0x71')]()[_0xfb40('0x5b')]();if(!_[_0xfb40('0x72')](_0x466f65)){_0x466f65[_0xfb40('0x2d')](function(_0x2fe11d){if(_0x2fe11d===_0xfb40('0x73')){_0x430b89[_0xfb40('0x41')](_0xfb40('0x74'),[][_0xfb40('0x75')](_0x353e52[_0xfb40('0x37')][_0x2fe11d]));}else if(_0x2fe11d===_0xfb40('0x76')){var _0x3ad7de=JSON[_0xfb40('0x77')](_0x353e52[_0xfb40('0x37')][_0x2fe11d])[_0xfb40('0x78')];var _0x554643=JSON[_0xfb40('0x77')](_0x353e52[_0xfb40('0x37')][_0x2fe11d])[_0xfb40('0x79')];_0x430b89[_0xfb40('0x41')](_0xfb40('0x7a'),_0x3ad7de,_0x554643);}else{if(_0x353e52[_0xfb40('0x37')][_0x2fe11d]===_0xfb40('0x7b')){_0x430b89['where']('i.'+_0x2fe11d+_0xfb40('0x7c'));}else{_0x430b89['where']('i.'+_0x2fe11d+_0xfb40('0x7d'),_0x353e52[_0xfb40('0x37')][_0x2fe11d]);}}});}if(_0x353e52[_0xfb40('0x37')][_0xfb40('0x7e')]){if(_0x353e52[_0xfb40('0x37')][_0xfb40('0x7e')]==0x1){_0x430b89[_0xfb40('0x5c')](_0xfb40('0x7f'));}else{_0x430b89[_0xfb40('0x5c')](_0xfb40('0x80'));}}if(_0x353e52['query']['tag']){_0x5115c7=_[_0xfb40('0x81')](_0x353e52[_0xfb40('0x37')][_0xfb40('0x82')])?_0x353e52['query'][_0xfb40('0x82')]:new Array(_0x353e52[_0xfb40('0x37')][_0xfb40('0x82')]);_0x5115c7[_0xfb40('0x2d')](function(_0x540225){_0x123808['or'](_0xfb40('0x6a'),'%,'+_0x540225+',%');});}if(_0x353e52[_0xfb40('0x37')][_0xfb40('0x83')]){var _0x35a14f=_0x353e52[_0xfb40('0x37')]['filter'][_0xfb40('0x84')]('\x5c','\x5c\x5c')[_0xfb40('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x35a14f)){_0x44cc42['or'](_0xfb40('0x85'),_0x35a14f+'%')['or'](_0xfb40('0x86'),_0x35a14f+'%');}_0x44cc42['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x35a14f+'%');}}_0x430b89['where'](_0x44cc42);_0x430b89[_0xfb40('0x87')]('i.id');var _0x1a6fcf={'type':db[_0xfb40('0x88')][_0xfb40('0x89')][_0xfb40('0x8a')],'raw':!![]};var _0x4e1c6a=_0x430b89[_0xfb40('0x8b')]();_0x4e1c6a[_0xfb40('0x44')](_0xfb40('0x8c'));_0x4e1c6a[_0xfb40('0x44')](_0xfb40('0x8d'),_0xfb40('0x5a'));if(_0x2a747a[_0xfb40('0x3f')]){_0x2a747a[_0xfb40('0x3f')][_0xfb40('0x2d')](function(_0x400f5d){var _0x35aa5c=_0x400f5d[0x0]===_0xfb40('0x8e')?_0x400f5d[0x0]:'i.'+_0x400f5d[0x0];_0x430b89[_0xfb40('0x3f')](_0x35aa5c,_0x400f5d[0x1]===_0xfb40('0x8f')?![]:!![]);});}if(!_[_0xfb40('0x72')](_0x5115c7)){_0x430b89['having'](_0x123808);_0x4e1c6a[_0xfb40('0x41')](_0xfb40('0x90'),_0x5115c7);}BPromise[_0xfb40('0x91')]()[_0xfb40('0x30')](function(){if(!_0x259eb8){if(_0x353e52[_0xfb40('0x37')]['FaxAccountId'])return;_0x4e1c6a[_0xfb40('0x41')](_0xfb40('0x92'));_0x430b89[_0xfb40('0x41')](_0xfb40('0x92'));return;}if(_0x353e52[_0xfb40('0x93')][_0xfb40('0x94')]!=='agent')return;return _0x353e52['user'][_0xfb40('0x95')]({'attributes':['id'],'raw':!![]})[_0xfb40('0x30')](function(_0x326040){if(_[_0xfb40('0x72')](_0x326040)){_0x4e1c6a['where']('i.FaxAccountId\x20IS\x20NULL');_0x430b89[_0xfb40('0x41')](_0xfb40('0x96'));}else{_0x4e1c6a[_0xfb40('0x41')]('i.FaxAccountId\x20IN\x20?',_[_0xfb40('0x2a')](_0x326040,'id'));_0x430b89[_0xfb40('0x41')](_0xfb40('0x74'),_[_0xfb40('0x2a')](_0x326040,'id'));}});})['then'](function(){if(_0x353e52[_0xfb40('0x93')][_0xfb40('0x94')]===_0xfb40('0x97')&&!_0x259eb8&&!_0x353e52[_0xfb40('0x37')][_0xfb40('0x73')])return[];return db[_0xfb40('0x98')][_0xfb40('0x37')](_0x4e1c6a[_0xfb40('0x99')](),_0x1a6fcf);})[_0xfb40('0x30')](function(_0x31e0ec){_0x3f0faa['count']=_0x31e0ec['length'];if(_0x3f0faa['count']===0x0)return[];return db[_0xfb40('0x98')][_0xfb40('0x37')](_0x13f9e2['toString'](),_0x1a6fcf)['then'](function(_0x2749bc){_0x21e0bb=_[_0xfb40('0x9a')](_0x2749bc,'id');_0x1a6fcf=_['merge'](_0x1a6fcf,{'model':db[_0xfb40('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x353e52[_0xfb40('0x37')][_0xfb40('0x3c')]){_0x2a747a[_0xfb40('0x3b')][_0xfb40('0x2d')](function(_0xce573){_0x430b89[_0xfb40('0x44')]('i.'+_0xce573);});}else{_0x430b89[_0xfb40('0x44')](_0xfb40('0x8d'),_0xfb40('0x5a'));_0x430b89[_0xfb40('0x44')](_0xfb40('0x9b'),_0xfb40('0x9c'));_0x430b89[_0xfb40('0x44')](_0xfb40('0x9d'),_0xfb40('0x9e'));_0x430b89[_0xfb40('0x44')](_0xfb40('0x9f'),'contactName');_0x430b89['field'](_0xfb40('0xa0'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xa1'),_0xfb40('0xa2'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xa3'),_0xfb40('0xa4'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xa5'),_0xfb40('0xa6'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xa7'),_0xfb40('0xa8'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xa9'),_0xfb40('0xaa'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xab'),_0xfb40('0xac'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xad'),_0xfb40('0xae'));_0x430b89[_0xfb40('0x44')]('o.internal',_0xfb40('0xaf'));_0x430b89[_0xfb40('0x44')](_0xfb40('0xb0'),_0xfb40('0x2b'));}if(_0x2a747a[_0xfb40('0x1c')])_0x430b89[_0xfb40('0x1c')](_0x2a747a['limit']);if(_0x2a747a['offset'])_0x430b89[_0xfb40('0x1e')](_0x2a747a[_0xfb40('0x1e')]);return db[_0xfb40('0x98')][_0xfb40('0x37')](_0x430b89[_0xfb40('0x99')](),_0x1a6fcf);})[_0xfb40('0x30')](function(_0x1f8b7f){if(_0x1f8b7f[_0xfb40('0x3d')]>0x0)_0x39011e[_0xfb40('0x41')](_0xfb40('0xb1'),_['map'](_0x1f8b7f,'id'));return db['sequelize']['query'](_0x39011e[_0xfb40('0x99')](),_0x1a6fcf)['then'](function(_0x35ae52){var _0x5d159c=_[_0xfb40('0xb2')](_0x35ae52,_0xfb40('0xb3'));var _0x1640cb=[];_0x1f8b7f[_0xfb40('0x2d')](function(_0x4a33c0){_0x1640cb[_0xfb40('0x2f')](updateFaxInteraction(_0x4a33c0,_0x21e0bb,_0x5d159c));});return BPromise[_0xfb40('0xb4')](_0x1640cb);});});})[_0xfb40('0x30')](function(_0xca5bf2){_0x3f0faa['rows']=_0xca5bf2;return _0x3f0faa;})['then'](respondWithFilteredResult(_0xa0dbc6,_0x2a747a))['catch'](handleError(_0xa0dbc6,null));};exports[_0xfb40('0xb5')]=function(_0x44d7cc,_0x14cef0){var _0x13004c={'raw':![],'where':{'id':_0x44d7cc[_0xfb40('0xb6')]['id']}},_0x5d5d39={};_0x5d5d39[_0xfb40('0x36')]=_[_0xfb40('0x38')](db[_0xfb40('0x33')]['rawAttributes']);_0x5d5d39[_0xfb40('0x37')]=_[_0xfb40('0x38')](_0x44d7cc[_0xfb40('0x37')]);_0x5d5d39[_0xfb40('0x39')]=_[_0xfb40('0x3a')](_0x5d5d39[_0xfb40('0x36')],_0x5d5d39[_0xfb40('0x37')]);_0x13004c[_0xfb40('0x3b')]=_['intersection'](_0x5d5d39['model'],qs[_0xfb40('0x3c')](_0x44d7cc['query'][_0xfb40('0x3c')]));_0x13004c['attributes']=_0x13004c[_0xfb40('0x3b')]['length']?_0x13004c[_0xfb40('0x3b')]:_0x5d5d39['model'];if(_0x44d7cc[_0xfb40('0x37')]['includeAll']){_0x13004c[_0xfb40('0xb7')]=[{'all':!![]}];}_0x13004c=_[_0xfb40('0xb8')]({},_0x13004c,_0x44d7cc[_0xfb40('0xb9')]);return db[_0xfb40('0x33')][_0xfb40('0x59')](_0x13004c)['then'](handleEntityNotFound(_0x14cef0,null))[_0xfb40('0x30')](respondWithResult(_0x14cef0,null))[_0xfb40('0x31')](handleError(_0x14cef0,null));};exports['create']=function(_0x1d3f8e,_0x1dcc28){return db['FaxInteraction'][_0xfb40('0xba')](_0x1d3f8e['body'],{})[_0xfb40('0x30')](respondWithResult(_0x1dcc28,0xc9))[_0xfb40('0x31')](handleError(_0x1dcc28,null));};exports[_0xfb40('0xbb')]=function(_0x59670e,_0x3bb3f2){if(_0x59670e[_0xfb40('0x70')]['id']){delete _0x59670e['body']['id'];}return db['FaxInteraction'][_0xfb40('0x59')]({'where':{'id':_0x59670e[_0xfb40('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3bb3f2,null))['then'](saveUpdates(_0x59670e[_0xfb40('0x70')],null))[_0xfb40('0x30')](respondWithResult(_0x3bb3f2,null))['catch'](handleError(_0x3bb3f2,null));};exports[_0xfb40('0x25')]=function(_0xb93df6,_0x2a7c17){return db[_0xfb40('0x33')][_0xfb40('0x59')]({'where':{'id':_0xb93df6[_0xfb40('0xb6')]['id']}})['then'](handleEntityNotFound(_0x2a7c17,null))['then'](removeEntity(_0x2a7c17,null))[_0xfb40('0x31')](handleError(_0x2a7c17,null));};exports[_0xfb40('0xbc')]=function(_0x14edfc,_0x18634e){return db['FaxInteraction'][_0xfb40('0xbc')]()['then'](respondWithResult(_0x18634e,null))[_0xfb40('0x31')](handleError(_0x18634e,null));};exports[_0xfb40('0xbd')]=function(_0x472259,_0x43450f,_0x89d1ce){return db[_0xfb40('0xbe')][_0xfb40('0x59')]({'where':{'id':_0x472259['params']['id']}})[_0xfb40('0x30')](handleEntityNotFound(_0x43450f,null))['then'](function(_0x222b66){if(_0x222b66){return _0x222b66[_0xfb40('0xbd')](_0x472259[_0xfb40('0x70')][_0xfb40('0xbf')],_[_0xfb40('0xc0')](_0x472259[_0xfb40('0x70')],[_0xfb40('0xbf'),'id'])||{});}})[_0xfb40('0x30')](respondWithResult(_0x43450f,null))[_0xfb40('0x31')](handleError(_0x43450f,null));};exports['getMessages']=function(_0x53b1f2,_0x27c659,_0x41020d){var _0x4be807={'raw':![],'where':{}};var _0x498ea6={};var _0x557244={'count':0x0,'rows':[]};return db[_0xfb40('0x33')][_0xfb40('0xc1')]({'where':{'id':_0x53b1f2[_0xfb40('0xb6')]['id']}})['then'](handleEntityNotFound(_0x27c659,null))[_0xfb40('0x30')](function(_0xe4f8f6){if(_0xe4f8f6){_0x498ea6['model']=_[_0xfb40('0x38')](db['FaxMessage'][_0xfb40('0xc2')]);_0x498ea6[_0xfb40('0x37')]=_[_0xfb40('0x38')](_0x53b1f2[_0xfb40('0x37')]);_0x498ea6[_0xfb40('0x39')]=_[_0xfb40('0x3a')](_0x498ea6[_0xfb40('0x36')],_0x498ea6[_0xfb40('0x37')]);_0x4be807[_0xfb40('0x3b')]=_[_0xfb40('0x3a')](_0x498ea6[_0xfb40('0x36')],qs[_0xfb40('0x3c')](_0x53b1f2[_0xfb40('0x37')][_0xfb40('0x3c')]));_0x4be807[_0xfb40('0x3b')]=_0x4be807[_0xfb40('0x3b')][_0xfb40('0x3d')]?_0x4be807[_0xfb40('0x3b')]:_0x498ea6['model'];if(!_0x53b1f2[_0xfb40('0x37')][_0xfb40('0xc3')](_0xfb40('0x3e'))){_0x4be807[_0xfb40('0x1c')]=qs[_0xfb40('0x1c')](_0x53b1f2[_0xfb40('0x37')][_0xfb40('0x1c')]);_0x4be807[_0xfb40('0x1e')]=qs[_0xfb40('0x1e')](_0x53b1f2[_0xfb40('0x37')][_0xfb40('0x1e')]);}_0x4be807[_0xfb40('0x3f')]=qs[_0xfb40('0x40')](_0x53b1f2['query']['sort']);_0x4be807[_0xfb40('0x41')]=qs[_0xfb40('0x39')](_[_0xfb40('0x42')](_0x53b1f2[_0xfb40('0x37')],_0x498ea6[_0xfb40('0x39')]));_0x4be807[_0xfb40('0x41')][_0xfb40('0xb3')]=_0xe4f8f6['id'];if(_0x53b1f2[_0xfb40('0x37')]['filter']){_0x4be807[_0xfb40('0x41')]=_['merge'](_0x4be807[_0xfb40('0x41')],{'$or':_[_0xfb40('0x2a')](_0x4be807[_0xfb40('0x3b')],function(_0x28b39a){var _0x50f5c5={};_0x50f5c5[_0x28b39a]={'$like':'%'+_0x53b1f2[_0xfb40('0x37')][_0xfb40('0x83')]+'%'};return _0x50f5c5;})});}if(_0x53b1f2[_0xfb40('0x37')][_0xfb40('0x78')]){var _0x38dcee=_0x53b1f2[_0xfb40('0x37')][_0xfb40('0x78')][_0xfb40('0x2c')](',');var _0x278ee5={};_0x278ee5[_0x38dcee[0x0]]={'$gte':moment(_0x38dcee[0x1])[_0xfb40('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4be807[_0xfb40('0x41')]=_['merge'](_0x4be807['where'],_0x278ee5);}_0x4be807=_['merge']({},_0x4be807,_0x53b1f2[_0xfb40('0xb9')]);return db['FaxMessage'][_0xfb40('0x1f')]({'where':_0x4be807[_0xfb40('0x41')]})['then'](function(_0x19cad2){_0x557244[_0xfb40('0x1f')]=_0x19cad2;if(_0x53b1f2[_0xfb40('0x37')][_0xfb40('0xc5')]){_0x4be807[_0xfb40('0xb7')]=[{'all':!![]}];}return db[_0xfb40('0xbe')][_0xfb40('0xc6')](_0x4be807);})[_0xfb40('0x30')](function(_0x56e134){_0x557244[_0xfb40('0xc7')]=_0x56e134;return _0x557244;});}})[_0xfb40('0x30')](respondWithFilteredResult(_0x27c659,_0x4be807))[_0xfb40('0x31')](handleError(_0x27c659,null));};exports[_0xfb40('0xc8')]=function(_0x2a07e6,_0x4dc499,_0x3c10a6){return db[_0xfb40('0x33')][_0xfb40('0x59')]({'where':{'id':_0x2a07e6[_0xfb40('0xb6')]['id']}})[_0xfb40('0x30')](handleEntityNotFound(_0x4dc499,null))[_0xfb40('0x30')](function(_0x4e5d24){if(_0x4e5d24){return _0x4e5d24[_0xfb40('0xc9')](_0x2a07e6[_0xfb40('0x70')]['ids'],_[_0xfb40('0xc0')](_0x2a07e6[_0xfb40('0x70')],[_0xfb40('0xbf'),'id'])||{})[_0xfb40('0xca')](function(){return db[_0xfb40('0x69')][_0xfb40('0xc6')]({'attributes':['id','name','color'],'where':{'id':_0x2a07e6[_0xfb40('0x70')][_0xfb40('0xbf')]}});})[_0xfb40('0x30')](function(_0x320fc0){socket[_0xfb40('0xcb')](_0xfb40('0xcc'),{'id':Number(_0x2a07e6[_0xfb40('0xb6')]['id']),'tags':_0x320fc0||[]});return{'id':Number(_0x2a07e6['params']['id']),'tags':_0x320fc0||[]};});}})['then'](respondWithResult(_0x4dc499,null))[_0xfb40('0x31')](handleError(_0x4dc499,null));};exports['removeTags']=function(_0x33ad6c,_0x27513d,_0x108ddc){return db[_0xfb40('0x33')]['find']({'where':{'id':_0x33ad6c[_0xfb40('0xb6')]['id']}})[_0xfb40('0x30')](handleEntityNotFound(_0x27513d,null))[_0xfb40('0x30')](function(_0x4546ac){if(_0x4546ac){return _0x4546ac[_0xfb40('0xcd')](_0x33ad6c['query'][_0xfb40('0xbf')]);}})[_0xfb40('0x30')](respondWithStatusCode(_0x27513d,null))['catch'](handleError(_0x27513d,null));};exports[_0xfb40('0xce')]=function(_0x3071ee,_0x31f71e){var _0x429f37=moment()[_0xfb40('0xcf')]()[_0xfb40('0x99')]();var _0x2eec4e=path[_0xfb40('0xd0')](config[_0xfb40('0xd1')],_0xfb40('0xd2'),_0xfb40('0xd3'),_0xfb40('0xd4'));var _0x434c5d=path[_0xfb40('0xd0')](config[_0xfb40('0xd1')],_0xfb40('0xd2'),_0xfb40('0xd3'),_0xfb40('0xd5'));var _0x226e5a=path[_0xfb40('0xd0')](_0x2eec4e,_0x429f37);var _0x2c58f9=util[_0xfb40('0xc4')]('transcript-%d-%s.zip',_0x3071ee[_0xfb40('0xb6')]['id'],_0x429f37);var _0x544831=path[_0xfb40('0xd0')](_0x2eec4e,_0x2c58f9);var _0x58dbce=[];_0x58dbce[_0xfb40('0x2f')]({'model':db[_0xfb40('0xd6')],'as':_0xfb40('0xd6'),'raw':!![]});var _0x34dec1=[{'model':db[_0xfb40('0xbe')],'as':_0xfb40('0xd7'),'attributes':['id',_0xfb40('0x70'),_0xfb40('0x76')],'include':_0x58dbce}];return db['FaxInteraction']['find']({'where':{'id':_0x3071ee[_0xfb40('0xb6')]['id']},'include':_0x34dec1})[_0xfb40('0x30')](handleEntityNotFound(_0x31f71e,null))[_0xfb40('0x30')](function(_0x1b3da1){if(_0x1b3da1&&_0x1b3da1[_0xfb40('0xd7')]){var _0xdd1717=_0x1b3da1[_0xfb40('0xd8')]({'plain':!![]});fs['mkdirSync'](_0x226e5a);for(var _0x34a8ee=0x0;_0x34a8ee<_0xdd1717[_0xfb40('0xd7')][_0xfb40('0x3d')];_0x34a8ee++){var _0x37b8c7=_0xdd1717[_0xfb40('0xd7')][_0x34a8ee][_0xfb40('0xd6')];if(_0x37b8c7){var _0x353444=path[_0xfb40('0xd0')](_0x434c5d,_0x37b8c7['basename']);if(fs[_0xfb40('0xd9')](_0x353444)){fs[_0xfb40('0xda')](_0x353444)[_0xfb40('0xdb')](fs[_0xfb40('0xdc')](path[_0xfb40('0xd0')](_0x226e5a,_0x37b8c7['basename'])));}}}return BPromise[_0xfb40('0x91')]()[_0xfb40('0x30')](function(){return new BPromise(function(_0x3d9227,_0x1e84a5){zipdir(_0x226e5a,{'saveTo':_0x544831},function(_0x4bfb44,_0x344863){if(_0x4bfb44)return _0x1e84a5(_0x4bfb44);return _0x3d9227(_0x344863);});})[_0xfb40('0x30')](function(){return new BPromise(function(_0x4f760a,_0x95f23b){rimraf(_0x226e5a,function(_0x5bb2e3){if(_0x5bb2e3)_0x95f23b(_0x5bb2e3);return _0x4f760a();});});})[_0xfb40('0x30')](function(){return _0x31f71e['download'](_0x544831,_0x2c58f9,function(_0x226b29){if(_0x226b29){console[_0xfb40('0xdd')](_0xfb40('0xde'),_0x226b29);}else{fs[_0xfb40('0xdf')](_0x544831);}});});});}else{return _0x31f71e['sendStatus'](0xc8);}})[_0xfb40('0x31')](handleError(_0x31f71e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 52977cc..d80d1b4 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 _0xbbec=['setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x4d4af3,_0x58c206){var _0x21d77f=function(_0x2bc77a){while(--_0x2bc77a){_0x4d4af3['push'](_0x4d4af3['shift']());}};_0x21d77f(++_0x58c206);}(_0xbbec,0x106));var _0xcbbe=function(_0x1a2f00,_0x78c782){_0x1a2f00=_0x1a2f00-0x0;var _0x373dec=_0xbbec[_0x1a2f00];return _0x373dec;};'use strict';var EventEmitter=require(_0xcbbe('0x0'));var FaxInteraction=require(_0xcbbe('0x1'))['db'][_0xcbbe('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xcbbe('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xcbbe('0x4')](0x0);var events={'afterCreate':_0xcbbe('0x5'),'afterUpdate':_0xcbbe('0x6'),'afterDestroy':_0xcbbe('0x7')};function emitEvent(_0x4c910d){return function(_0x58f241,_0x277b00,_0xa1bea8){_0x58f241['getUsers']({'attributes':['id'],'raw':!![]})[_0xcbbe('0x8')](function(_0x1e554b){_0x58f241[_0xcbbe('0x9')]('Users',_0x1e554b[_0xcbbe('0xa')](function(_0x18d4f2){return{'id':_0x18d4f2['id']};}));return FaxMessage[_0xcbbe('0xb')]({'where':{'FaxInteractionId':_0x58f241['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcbbe('0x8')](function(_0x24fa15){_0x58f241['setDataValue'](_0xcbbe('0xc'),_0x24fa15[_0xcbbe('0xd')]);FaxInteractionEvents['emit'](_0x4c910d+':'+_0x58f241['id'],_0x58f241);FaxInteractionEvents[_0xcbbe('0xe')](_0x4c910d,_0x58f241);_0xa1bea8(null);})[_0xcbbe('0xf')](_0xa1bea8(null));};}for(var e in events){if(events[_0xcbbe('0x10')](e)){var event=events[e];FaxInteraction[_0xcbbe('0x11')](e,emitEvent(event));}}module[_0xcbbe('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x99a3=['FaxInteraction','FaxMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99a3,0x11b));var _0x399a=function(_0x9ba220,_0x119f6d){_0x9ba220=_0x9ba220-0x0;var _0x6394ce=_0x99a3[_0x9ba220];return _0x6394ce;};'use strict';var EventEmitter=require(_0x399a('0x0'));var FaxInteraction=require(_0x399a('0x1'))['db'][_0x399a('0x2')];var FaxMessage=require(_0x399a('0x1'))['db'][_0x399a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x399a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x399a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x263fb9){return function(_0x3da423,_0x5a4d66,_0x2eb45f){_0x3da423[_0x399a('0x6')]({'attributes':['id'],'raw':!![]})[_0x399a('0x7')](function(_0x5ad1d7){_0x3da423[_0x399a('0x8')](_0x399a('0x9'),_0x5ad1d7[_0x399a('0xa')](function(_0x2a7947){return{'id':_0x2a7947['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3da423['id'],'direction':'in','read':![]},'raw':!![]});})[_0x399a('0x7')](function(_0x4e3ff6){_0x3da423[_0x399a('0x8')](_0x399a('0xb'),_0x4e3ff6['length']);FaxInteractionEvents[_0x399a('0xc')](_0x263fb9+':'+_0x3da423['id'],_0x3da423);FaxInteractionEvents[_0x399a('0xc')](_0x263fb9,_0x3da423);_0x2eb45f(null);})[_0x399a('0xd')](_0x2eb45f(null));};}for(var e in events){if(events[_0x399a('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0ec8d3a..bb68494 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 _0xe1bd=['fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xe1bd,0x1a3));var _0xde1b=function(_0x3ed71c,_0x58702b){_0x3ed71c=_0x3ed71c-0x0;var _0x3aecdd=_0xe1bd[_0x3ed71c];return _0x3aecdd;};'use strict';var _=require(_0xde1b('0x0'));var util=require(_0xde1b('0x1'));var logger=require(_0xde1b('0x2'))(_0xde1b('0x3'));var moment=require(_0xde1b('0x4'));var BPromise=require(_0xde1b('0x5'));var rp=require(_0xde1b('0x6'));var fs=require('fs');var path=require(_0xde1b('0x7'));var rimraf=require(_0xde1b('0x8'));var config=require(_0xde1b('0x9'));var attributes=require('./faxInteraction.attributes');module[_0xde1b('0xa')]=function(_0x7a680,_0x4b0d1c){return _0x7a680[_0xde1b('0xb')](_0xde1b('0xc'),attributes,{'tableName':_0xde1b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1da9f4,_0x403447,_0x236e1e){if(_0x1da9f4[_0xde1b('0xe')]('closed')){_0x1da9f4[_0xde1b('0xf')]=moment()[_0xde1b('0x10')](_0xde1b('0x11'));}_0x236e1e(null,_0x1da9f4);}}});}; \ No newline at end of file +var _0xfd16=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x27c401,_0x592dab){var _0x263b74=function(_0x55f9ce){while(--_0x55f9ce){_0x27c401['push'](_0x27c401['shift']());}};_0x263b74(++_0x592dab);}(_0xfd16,0x113));var _0x6fd1=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xfd16[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x6fd1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6fd1('0x1'));var BPromise=require(_0x6fd1('0x2'));var rp=require(_0x6fd1('0x3'));var fs=require('fs');var path=require(_0x6fd1('0x4'));var rimraf=require(_0x6fd1('0x5'));var config=require(_0x6fd1('0x6'));var attributes=require(_0x6fd1('0x7'));module[_0x6fd1('0x8')]=function(_0x3c17aa,_0x328476){return _0x3c17aa[_0x6fd1('0x9')](_0x6fd1('0xa'),attributes,{'tableName':_0x6fd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45cbd8,_0x23d5d5,_0x17615a){if(_0x45cbd8[_0x6fd1('0xc')](_0x6fd1('0xd'))){_0x45cbd8[_0x6fd1('0xe')]=moment()[_0x6fd1('0xf')](_0x6fd1('0x10'));}_0x17615a(null,_0x45cbd8);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ca71626..f4d1426 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 _0x8ea6=['http','redis','defaults','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','debug','AddTagsToFaxInteraction','find','ids','omit','AddTags','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5c3b65,_0x1d4ba0){var _0x2d07cb=function(_0x175728){while(--_0x175728){_0x5c3b65['push'](_0x5c3b65['shift']());}};_0x2d07cb(++_0x1d4ba0);}(_0x8ea6,0x90));var _0x68ea=function(_0x66dfd6,_0x4673a3){_0x66dfd6=_0x66dfd6-0x0;var _0x25514e=_0x8ea6[_0x66dfd6];return _0x25514e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x68ea('0x0'));var BPromise=require(_0x68ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68ea('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ea('0x3'))(_0x68ea('0x4'));var config=require(_0x68ea('0x5'));var jayson=require(_0x68ea('0x6'));var client=jayson[_0x68ea('0x7')][_0x68ea('0x8')]({'port':0x232a});config[_0x68ea('0x9')]=_[_0x68ea('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68ea('0x9')]));require(_0x68ea('0xb'))[_0x68ea('0xc')](socket);function respondWithRpcPromise(_0x4188ae,_0x32d63d,_0x2fe4c3){return new BPromise(function(_0x117c6e,_0x560057){return client[_0x68ea('0xd')](_0x4188ae,_0x2fe4c3)[_0x68ea('0xe')](function(_0x3ff7d5){logger[_0x68ea('0xf')](_0x68ea('0x10'),_0x32d63d,_0x68ea('0x11'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x32d63d,_0x68ea('0x11'),JSON[_0x68ea('0x12')](_0x3ff7d5));if(_0x3ff7d5[_0x68ea('0x13')]){if(_0x3ff7d5[_0x68ea('0x13')][_0x68ea('0x14')]===0x1f4){logger[_0x68ea('0x13')](_0x68ea('0x10'),_0x32d63d,_0x3ff7d5['error']['message']);return _0x560057(_0x3ff7d5[_0x68ea('0x13')][_0x68ea('0x15')]);}logger[_0x68ea('0x13')](_0x68ea('0x10'),_0x32d63d,_0x3ff7d5[_0x68ea('0x13')]['message']);return _0x117c6e(_0x3ff7d5[_0x68ea('0x13')]['message']);}else{logger['info'](_0x68ea('0x10'),_0x32d63d,_0x68ea('0x11'));_0x117c6e(_0x3ff7d5[_0x68ea('0x16')]['message']);}})[_0x68ea('0x17')](function(_0x337b4b){logger['error'](_0x68ea('0x10'),_0x32d63d,_0x337b4b);_0x560057(_0x337b4b);});});}exports[_0x68ea('0x18')]=function(_0x1cfdcd){var _0x31fc43=this;return new Promise(function(_0x598675,_0x383275){return db[_0x68ea('0x19')][_0x68ea('0x1a')](_0x1cfdcd[_0x68ea('0x1b')],{'raw':_0x1cfdcd[_0x68ea('0x1c')]?_0x1cfdcd[_0x68ea('0x1c')][_0x68ea('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cfdcd[_0x68ea('0x1c')]?_0x1cfdcd[_0x68ea('0x1c')][_0x68ea('0x1e')]||null:null,'attributes':_0x1cfdcd[_0x68ea('0x1c')]?_0x1cfdcd[_0x68ea('0x1c')]['attributes']||null:null,'limit':_0x1cfdcd[_0x68ea('0x1c')]?_0x1cfdcd[_0x68ea('0x1c')][_0x68ea('0x1f')]||null:null})[_0x68ea('0xe')](function(_0x18b76a){logger['info']('UpdateFaxInteraction',_0x1cfdcd);logger[_0x68ea('0x20')](_0x68ea('0x18'),_0x1cfdcd,JSON[_0x68ea('0x12')](_0x18b76a));_0x598675(_0x18b76a);})[_0x68ea('0x17')](function(_0x4c84ba){logger[_0x68ea('0x13')]('UpdateFaxInteraction',_0x4c84ba[_0x68ea('0x15')],_0x1cfdcd);_0x383275(_0x31fc43['error'](0x1f4,_0x4c84ba[_0x68ea('0x15')]));});});};exports[_0x68ea('0x21')]=function(_0x363240){return new Promise(function(_0x44a1ed,_0x3b5088){return db[_0x68ea('0x19')][_0x68ea('0x22')]({'where':_0x363240['options']?_0x363240['options'][_0x68ea('0x1e')]||null:null})[_0x68ea('0xe')](function(_0x80cf2e){if(_0x80cf2e){return _0x80cf2e['addTags'](_0x363240[_0x68ea('0x1b')][_0x68ea('0x23')],_[_0x68ea('0x24')](_0x363240[_0x68ea('0x1b')],[_0x68ea('0x23'),'id'])||{});}})['spread'](function(_0x34a10f){logger[_0x68ea('0xf')]('AddTags',_0x363240);logger['debug'](_0x68ea('0x25'),_0x363240,JSON[_0x68ea('0x12')](_0x34a10f));_0x44a1ed(_0x34a10f);})['catch'](function(_0x236b4b){logger[_0x68ea('0x13')](_0x68ea('0x25'),_0x236b4b[_0x68ea('0x15')],_0x363240);_0x3b5088(_this['error'](0x1f4,_0x236b4b[_0x68ea('0x15')]));});});}; \ No newline at end of file +var _0x20a9=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','ids','spread','AddTags','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x20a9,0x124));var _0x920a=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x20a9[_0x45fe9c];return _0x233d48;};'use strict';var _=require(_0x920a('0x0'));var util=require(_0x920a('0x1'));var moment=require(_0x920a('0x2'));var BPromise=require(_0x920a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x920a('0x4'));var db=require(_0x920a('0x5'))['db'];var utils=require(_0x920a('0x6'));var logger=require(_0x920a('0x7'))(_0x920a('0x8'));var config=require('../../config/environment');var jayson=require(_0x920a('0x9'));var client=jayson[_0x920a('0xa')][_0x920a('0xb')]({'port':0x232a});config[_0x920a('0xc')]=_['defaults'](config['redis'],{'host':_0x920a('0xd'),'port':0x18eb});var socket=require(_0x920a('0xe'))(new Redis(config[_0x920a('0xc')]));require(_0x920a('0xf'))[_0x920a('0x10')](socket);function respondWithRpcPromise(_0x16a27c,_0x25023b,_0x5b71a4){return new BPromise(function(_0x38811e,_0x3bdd22){return client[_0x920a('0x11')](_0x16a27c,_0x5b71a4)[_0x920a('0x12')](function(_0x493508){logger[_0x920a('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x25023b,_0x920a('0x14'));logger[_0x920a('0x15')](_0x920a('0x16'),_0x25023b,_0x920a('0x14'),JSON[_0x920a('0x17')](_0x493508));if(_0x493508[_0x920a('0x18')]){if(_0x493508['error'][_0x920a('0x19')]===0x1f4){logger[_0x920a('0x18')](_0x920a('0x1a'),_0x25023b,_0x493508[_0x920a('0x18')]['message']);return _0x3bdd22(_0x493508[_0x920a('0x18')][_0x920a('0x1b')]);}logger[_0x920a('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x25023b,_0x493508[_0x920a('0x18')]['message']);return _0x38811e(_0x493508['error'][_0x920a('0x1b')]);}else{logger['info'](_0x920a('0x1a'),_0x25023b,_0x920a('0x14'));_0x38811e(_0x493508['result'][_0x920a('0x1b')]);}})['catch'](function(_0x23e6d9){logger[_0x920a('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x25023b,_0x23e6d9);_0x3bdd22(_0x23e6d9);});});}exports[_0x920a('0x1c')]=function(_0x505b34){var _0x38e3b9=this;return new Promise(function(_0x2f2681,_0x172a5c){return db[_0x920a('0x1d')][_0x920a('0x1e')](_0x505b34[_0x920a('0x1f')],{'raw':_0x505b34[_0x920a('0x20')]?_0x505b34['options'][_0x920a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x505b34[_0x920a('0x20')]?_0x505b34[_0x920a('0x20')][_0x920a('0x22')]||null:null,'attributes':_0x505b34[_0x920a('0x20')]?_0x505b34['options'][_0x920a('0x23')]||null:null,'limit':_0x505b34[_0x920a('0x20')]?_0x505b34[_0x920a('0x20')][_0x920a('0x24')]||null:null})[_0x920a('0x12')](function(_0x3b227f){logger[_0x920a('0x13')](_0x920a('0x1c'),_0x505b34);logger[_0x920a('0x15')](_0x920a('0x1c'),_0x505b34,JSON['stringify'](_0x3b227f));_0x2f2681(_0x3b227f);})['catch'](function(_0x100d1b){logger['error'](_0x920a('0x1c'),_0x100d1b[_0x920a('0x1b')],_0x505b34);_0x172a5c(_0x38e3b9['error'](0x1f4,_0x100d1b['message']));});});};exports[_0x920a('0x25')]=function(_0x4c4bb4){return new Promise(function(_0x1a82b5,_0x1698cf){return db['FaxInteraction'][_0x920a('0x26')]({'where':_0x4c4bb4[_0x920a('0x20')]?_0x4c4bb4['options'][_0x920a('0x22')]||null:null})[_0x920a('0x12')](function(_0x2367ff){if(_0x2367ff){return _0x2367ff['addTags'](_0x4c4bb4[_0x920a('0x1f')][_0x920a('0x27')],_['omit'](_0x4c4bb4[_0x920a('0x1f')],[_0x920a('0x27'),'id'])||{});}})[_0x920a('0x28')](function(_0x4fe45f){logger[_0x920a('0x13')](_0x920a('0x29'),_0x4c4bb4);logger['debug']('AddTags',_0x4c4bb4,JSON[_0x920a('0x17')](_0x4fe45f));_0x1a82b5(_0x4fe45f);})[_0x920a('0x2a')](function(_0x388a45){logger['error'](_0x920a('0x29'),_0x388a45[_0x920a('0x1b')],_0x4c4bb4);_0x1698cf(_this[_0x920a('0x18')](0x1f4,_0x388a45[_0x920a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d742c2a..6949d58 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 _0x7815=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x2a2abf,_0x4b5ef2){var _0x20077a=function(_0x574905){while(--_0x574905){_0x2a2abf['push'](_0x2a2abf['shift']());}};_0x20077a(++_0x4b5ef2);}(_0x7815,0xc9));var _0x5781=function(_0x2d5b1a,_0x4121d1){_0x2d5b1a=_0x2d5b1a-0x0;var _0x4b8806=_0x7815[_0x2d5b1a];return _0x4b8806;};'use strict';var FaxInteractionEvents=require(_0x5781('0x0'));var events=[_0x5781('0x1'),_0x5781('0x2'),_0x5781('0x3')];function createListener(_0x518b6b,_0x1e678d){return function(_0x4d326e){_0x1e678d[_0x5781('0x4')](_0x518b6b,_0x4d326e);};}function removeListener(_0x3f14f2,_0x554743){return function(){FaxInteractionEvents[_0x5781('0x5')](_0x3f14f2,_0x554743);};}exports[_0x5781('0x6')]=function(_0x4bcc8f){for(var _0x4c832d=0x0,_0x58b23a=events['length'];_0x4c832d<_0x58b23a;_0x4c832d++){var _0x3f35ce=events[_0x4c832d];var _0x2c8599=createListener(_0x5781('0x7')+_0x3f35ce,_0x4bcc8f);FaxInteractionEvents['on'](_0x3f35ce,_0x2c8599);}}; \ No newline at end of file +var _0xf6c3=['register','faxInteraction:','./faxInteraction.events','save','remove','update','removeListener'];(function(_0x2bd1b0,_0x528ce9){var _0x3b33eb=function(_0xbb2a0b){while(--_0xbb2a0b){_0x2bd1b0['push'](_0x2bd1b0['shift']());}};_0x3b33eb(++_0x528ce9);}(_0xf6c3,0x87));var _0x3f6c=function(_0xa151f8,_0xc2e6f9){_0xa151f8=_0xa151f8-0x0;var _0x164914=_0xf6c3[_0xa151f8];return _0x164914;};'use strict';var FaxInteractionEvents=require(_0x3f6c('0x0'));var events=[_0x3f6c('0x1'),_0x3f6c('0x2'),_0x3f6c('0x3')];function createListener(_0x4a7288,_0x44b8ae){return function(_0x49653d){_0x44b8ae['emit'](_0x4a7288,_0x49653d);};}function removeListener(_0x53a193,_0x4f359b){return function(){FaxInteractionEvents[_0x3f6c('0x4')](_0x53a193,_0x4f359b);};}exports[_0x3f6c('0x5')]=function(_0x4c5dee){for(var _0x2a9224=0x0,_0x3bba70=events['length'];_0x2a9224<_0x3bba70;_0x2a9224++){var _0x263706=events[_0x2a9224];var _0x5c4dbb=createListener(_0x3f6c('0x6')+_0x263706,_0x4c5dee);FaxInteractionEvents['on'](_0x263706,_0x5c4dbb);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 45fb544..19809be 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 _0xdb1a=['./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','tracked','faxinteraction:addtags','addTags','fax','update','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2cc1e4,_0x5246d9){var _0x27dcc3=function(_0x74c85c){while(--_0x74c85c){_0x2cc1e4['push'](_0x2cc1e4['shift']());}};_0x27dcc3(++_0x5246d9);}(_0xdb1a,0xca));var _0xadb1=function(_0x56786b,_0x22eb09){_0x56786b=_0x56786b-0x0;var _0x9c4ca5=_0xdb1a[_0x56786b];return _0x9c4ca5;};'use strict';var multer=require(_0xadb1('0x0'));var util=require(_0xadb1('0x1'));var path=require(_0xadb1('0x2'));var timeout=require(_0xadb1('0x3'));var express=require('express');var router=express[_0xadb1('0x4')]();var fs_extra=require(_0xadb1('0x5'));var auth=require(_0xadb1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xadb1('0x7'));var controller=require(_0xadb1('0x8'));router[_0xadb1('0x9')]('/',auth[_0xadb1('0xa')](),controller[_0xadb1('0xb')]);router[_0xadb1('0x9')](_0xadb1('0xc'),auth[_0xadb1('0xa')](),controller[_0xadb1('0xd')]);router[_0xadb1('0x9')](_0xadb1('0xe'),auth[_0xadb1('0xa')](),controller[_0xadb1('0xf')]);router['get']('/:id/messages',auth[_0xadb1('0xa')](),controller[_0xadb1('0x10')]);router[_0xadb1('0x9')](_0xadb1('0x11'),auth[_0xadb1('0xa')](),controller[_0xadb1('0x12')]);router['post']('/',auth[_0xadb1('0xa')](),controller[_0xadb1('0x13')]);router[_0xadb1('0x14')](_0xadb1('0x15'),auth['isAuthenticated'](),controller[_0xadb1('0x16')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xadb1('0x17')]('fax',_0xadb1('0x18')),controller[_0xadb1('0x19')]);router['put']('/:id',auth[_0xadb1('0xa')](),interaction[_0xadb1('0x17')](_0xadb1('0x1a'),'faxinteraction:update'),controller[_0xadb1('0x1b')]);router['delete'](_0xadb1('0xe'),auth['isAuthenticated'](),interaction[_0xadb1('0x17')](_0xadb1('0x1a'),'faxinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0xadb1('0xa')](),controller[_0xadb1('0x1c')]);module[_0xadb1('0x1d')]=router; \ No newline at end of file +var _0x78d8=['../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','download','create','post','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','delete','/:id','faxinteraction:destroy','exports','util','path','connect-timeout'];(function(_0x992bf3,_0xb85335){var _0xd0a139=function(_0x1040bd){while(--_0x1040bd){_0x992bf3['push'](_0x992bf3['shift']());}};_0xd0a139(++_0xb85335);}(_0x78d8,0x15c));var _0x878d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x78d8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x878d('0x0'));var path=require(_0x878d('0x1'));var timeout=require(_0x878d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x878d('0x3'));var config=require(_0x878d('0x4'));var controller=require(_0x878d('0x5'));router[_0x878d('0x6')]('/',auth[_0x878d('0x7')](),controller[_0x878d('0x8')]);router[_0x878d('0x6')](_0x878d('0x9'),auth[_0x878d('0x7')](),controller[_0x878d('0xa')]);router['get']('/:id',auth[_0x878d('0x7')](),controller[_0x878d('0xb')]);router[_0x878d('0x6')](_0x878d('0xc'),auth[_0x878d('0x7')](),controller[_0x878d('0xd')]);router[_0x878d('0x6')]('/:id/download',auth[_0x878d('0x7')](),controller[_0x878d('0xe')]);router['post']('/',auth[_0x878d('0x7')](),controller[_0x878d('0xf')]);router[_0x878d('0x10')]('/:id/messages',auth[_0x878d('0x7')](),controller['addMessage']);router[_0x878d('0x10')](_0x878d('0x11'),auth[_0x878d('0x7')](),interaction['tracked'](_0x878d('0x12'),_0x878d('0x13')),controller[_0x878d('0x14')]);router[_0x878d('0x15')]('/:id',auth[_0x878d('0x7')](),interaction[_0x878d('0x16')](_0x878d('0x12'),'faxinteraction:update'),controller['update']);router[_0x878d('0x17')](_0x878d('0x18'),auth[_0x878d('0x7')](),interaction['tracked'](_0x878d('0x12'),_0x878d('0x19')),controller['destroy']);router[_0x878d('0x17')](_0x878d('0x11'),auth['isAuthenticated'](),controller['removeTags']);module[_0x878d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 8a0c581..fd2cb27 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 _0xbe31=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x155861,_0x257fb2){var _0x2e9827=function(_0x1957bc){while(--_0x1957bc){_0x155861['push'](_0x155861['shift']());}};_0x2e9827(++_0x257fb2);}(_0xbe31,0x83));var _0x1be3=function(_0xff1dd3,_0x40abd2){_0xff1dd3=_0xff1dd3-0x0;var _0x57e542=_0xbe31[_0xff1dd3];return _0x57e542;};'use strict';var Sequelize=require('sequelize');module[_0x1be3('0x0')]={'body':{'type':Sequelize[_0x1be3('0x1')](_0x1be3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1be3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1be3('0x4')]('in',_0x1be3('0x5')),'defaultValue':_0x1be3('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1be3('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1be3('0x6')]}}; \ No newline at end of file +var _0xfd28=['exports','TEXT','BOOLEAN','out'];(function(_0x347e91,_0x1ab743){var _0x9c5413=function(_0x34dbe8){while(--_0x34dbe8){_0x347e91['push'](_0x347e91['shift']());}};_0x9c5413(++_0x1ab743);}(_0xfd28,0x148));var _0x8fd2=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0xfd28[_0xfc0976];return _0x23579f;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'body':{'type':Sequelize[_0x8fd2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8fd2('0x3')),'defaultValue':_0x8fd2('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8fd2('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 755ab1e..98b425d 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 _0x91ca=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','sendStatus','stack','name','index','FaxMessage','fieldName','type','key','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','update','body','destroy','describe','fax-interactions','accept','fax','read','readAt','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','basename','download','join','files','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x91ca,0x110));var _0xa91c=function(_0x4c7c25,_0x1e16a8){_0x4c7c25=_0x4c7c25-0x0;var _0x297619=_0x91ca[_0x4c7c25];return _0x297619;};'use strict';var emlformat=require(_0xa91c('0x0'));var rimraf=require(_0xa91c('0x1'));var zipdir=require(_0xa91c('0x2'));var jsonpatch=require(_0xa91c('0x3'));var rp=require('request-promise');var moment=require(_0xa91c('0x4'));var BPromise=require(_0xa91c('0x5'));var Mustache=require(_0xa91c('0x6'));var util=require(_0xa91c('0x7'));var path=require(_0xa91c('0x8'));var sox=require(_0xa91c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa91c('0xa'));var _=require(_0xa91c('0xb'));var squel=require(_0xa91c('0xc'));var crypto=require(_0xa91c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa91c('0xe'));var toCsv=require(_0xa91c('0xf'));var querystring=require(_0xa91c('0x10'));var Papa=require(_0xa91c('0x11'));var Redis=require(_0xa91c('0x12'));var authService=require(_0xa91c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa91c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa91c('0x15'))(_0xa91c('0x16'));var utils=require(_0xa91c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa91c('0x18'));var db=require(_0xa91c('0x19'))['db'];config['redis']=_[_0xa91c('0x1a')](config['redis'],{'host':_0xa91c('0x1b'),'port':0x18eb});var socket=require(_0xa91c('0x1c'))(new Redis(config[_0xa91c('0x1d')]));require(_0xa91c('0x1e'))[_0xa91c('0x1f')](socket);var jayson=require(_0xa91c('0x20'));var client=jayson[_0xa91c('0x21')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ebc59,_0x129794,_0x3f62c5,_0x1838cb){return new BPromise(function(_0x10c9c3,_0x4eb005){var _0x2046ce=_0x1838cb||client;return _0x2046ce[_0xa91c('0x22')](_0x5ebc59,_0x3f62c5)[_0xa91c('0x23')](function(_0x3db376){logger[_0xa91c('0x24')](_0xa91c('0x25'),_0x129794,_0xa91c('0x26'));logger[_0xa91c('0x27')](_0xa91c('0x28'),_0x129794,_0xa91c('0x26'),JSON['stringify'](_0x3db376));if(_0x3db376[_0xa91c('0x29')]){if(_0x3db376['error'][_0xa91c('0x2a')]===0x1f4){logger[_0xa91c('0x29')](_0xa91c('0x25'),_0x129794,_0x3db376[_0xa91c('0x29')][_0xa91c('0x2b')]);return _0x4eb005(_0x3db376[_0xa91c('0x29')][_0xa91c('0x2b')]);}logger[_0xa91c('0x29')](_0xa91c('0x25'),_0x129794,_0x3db376['error'][_0xa91c('0x2b')]);return _0x10c9c3(_0x3db376[_0xa91c('0x29')]['message']);}else{logger[_0xa91c('0x24')](_0xa91c('0x25'),_0x129794,_0xa91c('0x26'));_0x10c9c3(_0x3db376[_0xa91c('0x2c')][_0xa91c('0x2b')]);}})[_0xa91c('0x2d')](function(_0x11f377){logger[_0xa91c('0x29')](_0xa91c('0x25'),_0x129794,_0x11f377);_0x4eb005(_0x11f377);});});}function respondWithStatusCode(_0xd4f6e5,_0x1f6af7){_0x1f6af7=_0x1f6af7||0xcc;return function(_0x15eb43){if(_0x15eb43){return _0xd4f6e5['sendStatus'](_0x1f6af7);}return _0xd4f6e5['status'](_0x1f6af7)[_0xa91c('0x2e')]();};}function respondWithResult(_0x3d0d15,_0x3468bc){_0x3468bc=_0x3468bc||0xc8;return function(_0x540b47){if(_0x540b47){return _0x3d0d15[_0xa91c('0x2f')](_0x3468bc)[_0xa91c('0x30')](_0x540b47);}};}function respondWithFilteredResult(_0x2ddac4,_0x5c1d9c){return function(_0x7184aa){if(_0x7184aa){var _0x287119=typeof _0x5c1d9c[_0xa91c('0x31')]===_0xa91c('0x32')&&typeof _0x5c1d9c[_0xa91c('0x33')]==='undefined';var _0x57bccc=_0x7184aa[_0xa91c('0x34')];var _0x3fff1a=_0x287119?0x0:_0x5c1d9c['offset'];var _0x5d522c=_0x287119?_0x7184aa[_0xa91c('0x34')]:_0x5c1d9c[_0xa91c('0x31')]+_0x5c1d9c[_0xa91c('0x33')];var _0x1b8c9c;if(_0x5d522c>=_0x57bccc){_0x5d522c=_0x57bccc;_0x1b8c9c=0xc8;}else{_0x1b8c9c=0xce;}_0x2ddac4['status'](_0x1b8c9c);return _0x2ddac4[_0xa91c('0x35')](_0xa91c('0x36'),_0x3fff1a+'-'+_0x5d522c+'/'+_0x57bccc)[_0xa91c('0x30')](_0x7184aa);}return null;};}function patchUpdates(_0x1028d3){return function(_0x3784c5){try{jsonpatch[_0xa91c('0x37')](_0x3784c5,_0x1028d3,!![]);}catch(_0x4a11bd){return BPromise['reject'](_0x4a11bd);}return _0x3784c5[_0xa91c('0x38')]();};}function saveUpdates(_0x5ad8a3,_0x22f002){return function(_0x2bb022){if(_0x2bb022){return _0x2bb022['update'](_0x5ad8a3)['then'](function(_0x2c12bc){return _0x2c12bc;});}return null;};}function removeEntity(_0x4c5bc9,_0x48ebd1){return function(_0x2ff9db){if(_0x2ff9db){return _0x2ff9db['destroy']()[_0xa91c('0x23')](function(){_0x4c5bc9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fc818,_0x103cde){return function(_0xa3ccda){if(!_0xa3ccda){_0x2fc818[_0xa91c('0x39')](0x194);}return _0xa3ccda;};}function handleError(_0x28a886,_0x18decb){_0x18decb=_0x18decb||0x1f4;return function(_0x540808){logger[_0xa91c('0x29')](_0x540808[_0xa91c('0x3a')]);if(_0x540808[_0xa91c('0x3b')]){delete _0x540808['name'];}_0x28a886[_0xa91c('0x2f')](_0x18decb)['send'](_0x540808);};}exports[_0xa91c('0x3c')]=function(_0x198d88,_0x2ebb28){var _0x2dbdcc={},_0x4434d5={},_0x50929b={'count':0x0,'rows':[]};var _0x36afd6=_['map'](db[_0xa91c('0x3d')]['rawAttributes'],function(_0xeda654){return{'name':_0xeda654[_0xa91c('0x3e')],'type':_0xeda654[_0xa91c('0x3f')][_0xa91c('0x40')]};});_0x4434d5[_0xa91c('0x41')]=_[_0xa91c('0x42')](_0x36afd6,_0xa91c('0x3b'));_0x4434d5['query']=_[_0xa91c('0x43')](_0x198d88[_0xa91c('0x44')]);_0x4434d5[_0xa91c('0x45')]=_['intersection'](_0x4434d5[_0xa91c('0x41')],_0x4434d5[_0xa91c('0x44')]);_0x2dbdcc['attributes']=_['intersection'](_0x4434d5[_0xa91c('0x41')],qs[_0xa91c('0x46')](_0x198d88[_0xa91c('0x44')]['fields']));_0x2dbdcc[_0xa91c('0x47')]=_0x2dbdcc[_0xa91c('0x47')][_0xa91c('0x48')]?_0x2dbdcc[_0xa91c('0x47')]:_0x4434d5[_0xa91c('0x41')];if(!_0x198d88['query'][_0xa91c('0x49')](_0xa91c('0x4a'))){_0x2dbdcc[_0xa91c('0x33')]=qs[_0xa91c('0x33')](_0x198d88['query'][_0xa91c('0x33')]);_0x2dbdcc[_0xa91c('0x31')]=qs[_0xa91c('0x31')](_0x198d88[_0xa91c('0x44')][_0xa91c('0x31')]);}_0x2dbdcc['order']=qs[_0xa91c('0x4b')](_0x198d88[_0xa91c('0x44')][_0xa91c('0x4b')]);_0x2dbdcc[_0xa91c('0x4c')]=qs[_0xa91c('0x45')](_[_0xa91c('0x4d')](_0x198d88[_0xa91c('0x44')],_0x4434d5[_0xa91c('0x45')]),_0x36afd6);if(_0x198d88[_0xa91c('0x44')]['filter']){_0x2dbdcc['where']=_[_0xa91c('0x4e')](_0x2dbdcc[_0xa91c('0x4c')],{'$or':_[_0xa91c('0x42')](_0x36afd6,function(_0x525f8e){if(_0x525f8e[_0xa91c('0x3f')]!=='VIRTUAL'){var _0x458e8={};_0x458e8[_0x525f8e['name']]={'$like':'%'+_0x198d88['query'][_0xa91c('0x4f')]+'%'};return _0x458e8;}})});}_0x2dbdcc=_[_0xa91c('0x4e')]({},_0x2dbdcc,_0x198d88[_0xa91c('0x50')]);var _0x3c0e48={'where':_0x2dbdcc[_0xa91c('0x4c')]};return db[_0xa91c('0x3d')]['count'](_0x3c0e48)['then'](function(_0x6e95d3){_0x50929b[_0xa91c('0x34')]=_0x6e95d3;if(_0x198d88[_0xa91c('0x44')][_0xa91c('0x51')]){_0x2dbdcc[_0xa91c('0x52')]=[{'all':!![]}];}return db[_0xa91c('0x3d')][_0xa91c('0x53')](_0x2dbdcc);})[_0xa91c('0x23')](function(_0x2e4eb3){_0x50929b[_0xa91c('0x54')]=_0x2e4eb3;return _0x50929b;})[_0xa91c('0x23')](respondWithFilteredResult(_0x2ebb28,_0x2dbdcc))['catch'](handleError(_0x2ebb28,null));};exports[_0xa91c('0x55')]=function(_0x58e4cc,_0x7050d2){var _0x3f454c={'raw':!![],'where':{'id':_0x58e4cc[_0xa91c('0x56')]['id']}},_0x12d994={};_0x12d994[_0xa91c('0x41')]=_[_0xa91c('0x43')](db['FaxMessage'][_0xa91c('0x57')]);_0x12d994[_0xa91c('0x44')]=_[_0xa91c('0x43')](_0x58e4cc[_0xa91c('0x44')]);_0x12d994[_0xa91c('0x45')]=_[_0xa91c('0x58')](_0x12d994[_0xa91c('0x41')],_0x12d994[_0xa91c('0x44')]);_0x3f454c[_0xa91c('0x47')]=_[_0xa91c('0x58')](_0x12d994[_0xa91c('0x41')],qs[_0xa91c('0x46')](_0x58e4cc['query'][_0xa91c('0x46')]));_0x3f454c['attributes']=_0x3f454c['attributes'][_0xa91c('0x48')]?_0x3f454c[_0xa91c('0x47')]:_0x12d994['model'];if(_0x58e4cc[_0xa91c('0x44')]['includeAll']){_0x3f454c[_0xa91c('0x52')]=[{'all':!![]}];}_0x3f454c=_[_0xa91c('0x4e')]({},_0x3f454c,_0x58e4cc['options']);return db[_0xa91c('0x3d')][_0xa91c('0x59')](_0x3f454c)[_0xa91c('0x23')](handleEntityNotFound(_0x7050d2,null))['then'](respondWithResult(_0x7050d2,null))[_0xa91c('0x2d')](handleError(_0x7050d2,null));};exports[_0xa91c('0x5a')]=function(_0x4162bc,_0x1bf133){if(_0x4162bc[_0xa91c('0x5b')]['id']){delete _0x4162bc[_0xa91c('0x5b')]['id'];}return db[_0xa91c('0x3d')][_0xa91c('0x59')]({'where':{'id':_0x4162bc['params']['id']}})['then'](handleEntityNotFound(_0x1bf133,null))[_0xa91c('0x23')](saveUpdates(_0x4162bc[_0xa91c('0x5b')],null))[_0xa91c('0x23')](respondWithResult(_0x1bf133,null))[_0xa91c('0x2d')](handleError(_0x1bf133,null));};exports[_0xa91c('0x5c')]=function(_0x372c5f,_0x4598b7){return db[_0xa91c('0x3d')][_0xa91c('0x59')]({'where':{'id':_0x372c5f['params']['id']}})[_0xa91c('0x23')](handleEntityNotFound(_0x4598b7,null))[_0xa91c('0x23')](removeEntity(_0x4598b7,null))['catch'](handleError(_0x4598b7,null));};exports['describe']=function(_0x3be813,_0x9b2da3){return db['FaxMessage'][_0xa91c('0x5d')]()['then'](respondWithResult(_0x9b2da3,null))[_0xa91c('0x2d')](handleError(_0x9b2da3,null));};var interaction_log=require('../../config/logger')(_0xa91c('0x5e'));exports[_0xa91c('0x5f')]=function(_0x5683f5,_0x4db2e9,_0x48807d){var _0x491d12={'agent':{},'channel':_0xa91c('0x60')};if(_0x5683f5[_0xa91c('0x5b')]['id']){delete _0x5683f5['body']['id'];}_0x5683f5[_0xa91c('0x5b')][_0xa91c('0x61')]=!![];_0x5683f5[_0xa91c('0x5b')][_0xa91c('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5683f5['body']['UserId']=_0x5683f5[_0xa91c('0x5b')][_0xa91c('0x63')]||_0x5683f5[_0xa91c('0x64')]['id'];_0x491d12[_0xa91c('0x65')]['id']=_0x5683f5['body'][_0xa91c('0x63')];return db[_0xa91c('0x3d')][_0xa91c('0x59')]({'where':{'id':_0x5683f5['params']['id'],'UserId':null}})[_0xa91c('0x23')](handleEntityNotFound(_0x4db2e9,null))[_0xa91c('0x23')](saveUpdates(_0x5683f5['body'],null))[_0xa91c('0x23')](function(_0x6cc2d7){if(_0x6cc2d7){_0x491d12['message']=_0x6cc2d7[_0xa91c('0x66')]({'plain':!![]});return db['FaxInteraction'][_0xa91c('0x59')]({'where':{'id':_0x6cc2d7[_0xa91c('0x67')]}});}return null;})[_0xa91c('0x23')](handleEntityNotFound(_0x4db2e9,null))[_0xa91c('0x23')](function(_0x541994){if(_0x541994){return _0x541994[_0xa91c('0x5a')]({'UserId':_0x5683f5[_0xa91c('0x5b')][_0xa91c('0x63')],'read1stAt':_[_0xa91c('0x68')](_0x541994[_0xa91c('0x69')])?moment()[_0xa91c('0x6a')](_0xa91c('0x6b')):undefined});}return null;})['then'](function(_0x83596e){if(_0x83596e){_0x491d12[_0xa91c('0x6c')]=_0x83596e[_0xa91c('0x66')]({'plain':!![]});interaction_log[_0xa91c('0x24')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5683f5[_0xa91c('0x64')]['id'],_0x5683f5['user'][_0xa91c('0x3b')],_0x5683f5[_0xa91c('0x64')][_0xa91c('0x6d')],_0x491d12[_0xa91c('0x6c')]['id'],_0x5683f5['body']?JSON[_0xa91c('0x6e')](_0x5683f5['body']):_0xa91c('0x6f'));return respondWithRpcPromise(_0xa91c('0x70'),_0xa91c('0x71'),_0x491d12);}return null;})['then'](function(_0x50c5cd){var _0x185171='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x50c5cd[_0xa91c('0x2b')][_0xa91c('0x72')];return db[_0xa91c('0x73')]['query'](_0x185171,{'type':db[_0xa91c('0x74')]['QueryTypes'][_0xa91c('0x75')],'raw':!![]})[_0xa91c('0x23')](function(_0x453604){return _0x453604;});})[_0xa91c('0x23')](function(_0x24d522){if(_0x24d522){_0x491d12['message'][_0xa91c('0x76')]=_0x24d522[0x0];if(!_0x5683f5[_0xa91c('0x5b')][_0xa91c('0x63')])return;return db[_0xa91c('0x77')][_0xa91c('0x59')]({'where':{'id':_0x5683f5['body'][_0xa91c('0x63')],'role':'agent'},'attributes':['id',_0xa91c('0x3b'),_0xa91c('0x78'),_0xa91c('0x79'),_0xa91c('0x7a')],'raw':!![]});}return null;})[_0xa91c('0x23')](function(_0x1ec346){if(!_0x1ec346)return null;_0x491d12[_0xa91c('0x2b')][_0xa91c('0x65')]=_0x1ec346;return _0x491d12;})[_0xa91c('0x23')](function(_0x3fc865){if(_0x3fc865){if(_0x5683f5['body'][_0xa91c('0x7b')]){_0x491d12[_0xa91c('0x2b')][_0xa91c('0x7c')]=util[_0xa91c('0x6a')](_0xa91c('0x7d'),_0x5683f5[_0xa91c('0x64')]['name']);_0x491d12['message'][_0xa91c('0x7e')]=_0x491d12[_0xa91c('0x7e')];_0x491d12[_0xa91c('0x2b')][_0xa91c('0x7f')]=_0x491d12['channel'];_0x491d12[_0xa91c('0x2b')][_0xa91c('0x80')]=_0xa91c('0x5f');return respondWithRpcPromise(_0xa91c('0x81'),_0xa91c('0x81'),{'event':_0xa91c('0x82'),'message':_0x491d12[_0xa91c('0x2b')]},client9002)[_0xa91c('0x23')](function(){return _0x491d12;});}return _0x491d12;}return null;})['then'](respondWithResult(_0x4db2e9,null))[_0xa91c('0x2d')](handleError(_0x4db2e9,null));};var interaction_log=require(_0xa91c('0x15'))(_0xa91c('0x5e'));exports[_0xa91c('0x83')]=function(_0x57f1c4,_0x54877a,_0x49cc99){var _0x442a7f={'agent':{},'channel':_0xa91c('0x60')};if(_0x57f1c4['body']['id']){delete _0x57f1c4[_0xa91c('0x5b')]['id'];}_0x57f1c4[_0xa91c('0x5b')][_0xa91c('0x63')]=_0x57f1c4[_0xa91c('0x5b')]['UserId']||_0x57f1c4[_0xa91c('0x64')]['id'];_0x442a7f[_0xa91c('0x65')]['id']=_0x57f1c4[_0xa91c('0x5b')][_0xa91c('0x63')];return db[_0xa91c('0x3d')][_0xa91c('0x59')]({'where':{'id':_0x57f1c4[_0xa91c('0x56')]['id'],'UserId':null}})[_0xa91c('0x23')](handleEntityNotFound(_0x54877a,null))['then'](function(_0x2a75ff){if(_0x2a75ff){_0x442a7f[_0xa91c('0x2b')]=_0x2a75ff[_0xa91c('0x66')]({'plain':!![]});return db[_0xa91c('0x84')]['find']({'where':{'id':_0x2a75ff[_0xa91c('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x54877a,null))[_0xa91c('0x23')](function(_0x1c0f17){if(_0x1c0f17){_0x442a7f[_0xa91c('0x6c')]=_0x1c0f17[_0xa91c('0x66')]({'plain':!![]});interaction_log[_0xa91c('0x24')](_0xa91c('0x85'),_0x57f1c4[_0xa91c('0x64')]['id'],_0x57f1c4[_0xa91c('0x64')][_0xa91c('0x3b')],_0x57f1c4[_0xa91c('0x64')]['role'],_0x442a7f[_0xa91c('0x6c')]['id'],_0x57f1c4['body']?JSON[_0xa91c('0x6e')](_0x57f1c4[_0xa91c('0x5b')]):_0xa91c('0x6f'));return respondWithRpcPromise(_0xa91c('0x86'),'rejectMessage',_0x442a7f);}return null;})['then'](function(_0x46287e){var _0x167dbf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46287e[_0xa91c('0x2b')]['ContactId'];return db[_0xa91c('0x73')][_0xa91c('0x44')](_0x167dbf,{'type':db[_0xa91c('0x74')]['QueryTypes']['SELECT'],'raw':!![]})[_0xa91c('0x23')](function(_0x3c4df4){return _0x3c4df4;});})[_0xa91c('0x23')](function(_0x2bd30b){if(_0x2bd30b){_0x442a7f[_0xa91c('0x2b')][_0xa91c('0x76')]=_0x2bd30b[0x0];if(!_0x57f1c4[_0xa91c('0x5b')]['UserId'])return;return db['User'][_0xa91c('0x59')]({'where':{'id':_0x57f1c4['body']['UserId'],'role':_0xa91c('0x65')},'attributes':['id',_0xa91c('0x3b'),_0xa91c('0x78'),'email',_0xa91c('0x7a')],'raw':!![]});}return null;})[_0xa91c('0x23')](function(_0x49a0a2){if(!_0x49a0a2)return null;_0x442a7f[_0xa91c('0x2b')][_0xa91c('0x65')]=_0x49a0a2;return _0x442a7f;})[_0xa91c('0x23')](function(_0x18a698){if(_0x18a698){_0x18a698[_0xa91c('0x2b')][_0xa91c('0x7c')]=util[_0xa91c('0x6a')]('SIP/%s',_0x57f1c4['user']['name']);_0x18a698[_0xa91c('0x2b')]['channel']=_0x442a7f[_0xa91c('0x7e')];_0x18a698[_0xa91c('0x2b')][_0xa91c('0x7f')]=_0x442a7f[_0xa91c('0x7e')];_0x18a698['message']['event']='reject';respondWithRpcPromise(_0xa91c('0x81'),_0xa91c('0x81'),{'event':_0xa91c('0x87'),'message':_0x18a698[_0xa91c('0x2b')]},client9002);return _0x442a7f;}return null;})[_0xa91c('0x23')](respondWithResult(_0x54877a,null))[_0xa91c('0x2d')](handleError(_0x54877a,null));};exports['create']=function(_0x2b365b,_0x261e49){var _0x24471e;return db[_0xa91c('0x3d')][_0xa91c('0x88')](_0x2b365b[_0xa91c('0x5b')],{})[_0xa91c('0x23')](function(_0x583a39){_0x24471e=_0x583a39;return db[_0xa91c('0x89')][_0xa91c('0x8a')]({'where':{'id':_0x24471e['ContactId']}});})['then'](function(_0x5e5bd6){if(_[_0xa91c('0x68')](_0x5e5bd6)){return;}else{_0x24471e['fax']=_0x5e5bd6[_0xa91c('0x60')];return db[_0xa91c('0x8b')][_0xa91c('0x8a')]({'where':{'id':_0x24471e[_0xa91c('0x8c')]}});}})[_0xa91c('0x23')](function(_0x4d8ea1){return respondWithRpcPromise(_0xa91c('0x8d'),_0xa91c('0x8d'),{'FaxAccountId':_['isNil'](_0x2b365b[_0xa91c('0x5b')])?undefined:_0x2b365b[_0xa91c('0x5b')]['FaxAccountId'],'path':_[_0xa91c('0x68')](_0x4d8ea1)?undefined:util[_0xa91c('0x6a')]('/var/opt/motion2/server/files/attachments/%s',_0x4d8ea1[_0xa91c('0x8e')]),'fax':_['isNil'](_0x24471e[_0xa91c('0x60')])?undefined:_0x24471e[_0xa91c('0x60')],'AttachmentId':_0x24471e['AttachmentId']},client9002);})[_0xa91c('0x23')](respondWithResult(_0x261e49,0xc9))[_0xa91c('0x2d')](handleError(_0x261e49,null));};exports[_0xa91c('0x8f')]=function(_0x42477a,_0x94cef4){var _0x33c2ba=path[_0xa91c('0x90')](config['root'],'server',_0xa91c('0x91'),'attachments');return db[_0xa91c('0x3d')][_0xa91c('0x59')]({'where':{'id':_0x42477a[_0xa91c('0x56')]['id']},'include':[{'model':db['Attachment'],'as':_0xa91c('0x8b')}]})[_0xa91c('0x23')](handleEntityNotFound(_0x94cef4,null))[_0xa91c('0x23')](function(_0x15f553){if(_0x15f553){return _0x94cef4[_0xa91c('0x8f')](path[_0xa91c('0x90')](_0x33c2ba,_0x15f553[_0xa91c('0x8b')]['basename']));}})['catch'](handleError(_0x94cef4,null));}; \ No newline at end of file +var _0xa003=['body','find','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','User','fullname','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','client','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','count','json','apply','reject','save','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa003,0x1f0));var _0x3a00=function(_0x4a78d0,_0x1cde86){_0x4a78d0=_0x4a78d0-0x0;var _0x18f317=_0xa003[_0x4a78d0];return _0x18f317;};'use strict';var emlformat=require(_0x3a00('0x0'));var rimraf=require(_0x3a00('0x1'));var zipdir=require(_0x3a00('0x2'));var jsonpatch=require(_0x3a00('0x3'));var rp=require(_0x3a00('0x4'));var moment=require(_0x3a00('0x5'));var BPromise=require(_0x3a00('0x6'));var Mustache=require(_0x3a00('0x7'));var util=require(_0x3a00('0x8'));var path=require(_0x3a00('0x9'));var sox=require(_0x3a00('0xa'));var csv=require('to-csv');var ejs=require(_0x3a00('0xb'));var fs=require('fs');var fs_extra=require(_0x3a00('0xc'));var _=require('lodash');var squel=require(_0x3a00('0xd'));var crypto=require(_0x3a00('0xe'));var jsforce=require(_0x3a00('0xf'));var deskjs=require(_0x3a00('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3a00('0x11'));var Papa=require(_0x3a00('0x12'));var Redis=require(_0x3a00('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a00('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a00('0x15'))(_0x3a00('0x16'));var utils=require(_0x3a00('0x17'));var config=require(_0x3a00('0x18'));var licenseUtil=require(_0x3a00('0x19'));var db=require(_0x3a00('0x1a'))['db'];config[_0x3a00('0x1b')]=_['defaults'](config[_0x3a00('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a00('0x1c'))(new Redis(config[_0x3a00('0x1b')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3a00('0x1d')][_0x3a00('0x1e')]({'port':0x232c});var client9002=jayson[_0x3a00('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235c90,_0x1dc56c,_0x1b76a0,_0x53f882){return new BPromise(function(_0x6db2d5,_0x386c62){var _0x103de9=_0x53f882||client;return _0x103de9[_0x3a00('0x1f')](_0x235c90,_0x1b76a0)[_0x3a00('0x20')](function(_0x4432fc){logger[_0x3a00('0x21')]('FaxMessage,\x20%s,\x20%s',_0x1dc56c,'request\x20sent');logger[_0x3a00('0x22')](_0x3a00('0x23'),_0x1dc56c,_0x3a00('0x24'),JSON['stringify'](_0x4432fc));if(_0x4432fc[_0x3a00('0x25')]){if(_0x4432fc[_0x3a00('0x25')][_0x3a00('0x26')]===0x1f4){logger['error'](_0x3a00('0x27'),_0x1dc56c,_0x4432fc['error']['message']);return _0x386c62(_0x4432fc[_0x3a00('0x25')][_0x3a00('0x28')]);}logger[_0x3a00('0x25')](_0x3a00('0x27'),_0x1dc56c,_0x4432fc[_0x3a00('0x25')][_0x3a00('0x28')]);return _0x6db2d5(_0x4432fc[_0x3a00('0x25')][_0x3a00('0x28')]);}else{logger[_0x3a00('0x21')](_0x3a00('0x27'),_0x1dc56c,_0x3a00('0x24'));_0x6db2d5(_0x4432fc[_0x3a00('0x29')][_0x3a00('0x28')]);}})[_0x3a00('0x2a')](function(_0x27c1ef){logger[_0x3a00('0x25')](_0x3a00('0x27'),_0x1dc56c,_0x27c1ef);_0x386c62(_0x27c1ef);});});}function respondWithStatusCode(_0x1fb79c,_0x3f379b){_0x3f379b=_0x3f379b||0xcc;return function(_0x2b9044){if(_0x2b9044){return _0x1fb79c[_0x3a00('0x2b')](_0x3f379b);}return _0x1fb79c[_0x3a00('0x2c')](_0x3f379b)[_0x3a00('0x2d')]();};}function respondWithResult(_0xa54d62,_0x5f51b4){_0x5f51b4=_0x5f51b4||0xc8;return function(_0x599328){if(_0x599328){return _0xa54d62['status'](_0x5f51b4)['json'](_0x599328);}};}function respondWithFilteredResult(_0x50d429,_0x5a995e){return function(_0x9ea4bd){if(_0x9ea4bd){var _0x5fbaf=typeof _0x5a995e[_0x3a00('0x2e')]==='undefined'&&typeof _0x5a995e[_0x3a00('0x2f')]==='undefined';var _0x19fc4e=_0x9ea4bd['count'];var _0x50d0d1=_0x5fbaf?0x0:_0x5a995e[_0x3a00('0x2e')];var _0x481ebc=_0x5fbaf?_0x9ea4bd[_0x3a00('0x30')]:_0x5a995e['offset']+_0x5a995e[_0x3a00('0x2f')];var _0x21e8f8;if(_0x481ebc>=_0x19fc4e){_0x481ebc=_0x19fc4e;_0x21e8f8=0xc8;}else{_0x21e8f8=0xce;}_0x50d429[_0x3a00('0x2c')](_0x21e8f8);return _0x50d429['set']('Content-Range',_0x50d0d1+'-'+_0x481ebc+'/'+_0x19fc4e)[_0x3a00('0x31')](_0x9ea4bd);}return null;};}function patchUpdates(_0x3faabc){return function(_0x158422){try{jsonpatch[_0x3a00('0x32')](_0x158422,_0x3faabc,!![]);}catch(_0xb9e030){return BPromise[_0x3a00('0x33')](_0xb9e030);}return _0x158422[_0x3a00('0x34')]();};}function saveUpdates(_0x19696a,_0x5577ed){return function(_0x44db37){if(_0x44db37){return _0x44db37['update'](_0x19696a)[_0x3a00('0x20')](function(_0x4b4db7){return _0x4b4db7;});}return null;};}function removeEntity(_0x101a56,_0x4bd887){return function(_0x316330){if(_0x316330){return _0x316330[_0x3a00('0x35')]()[_0x3a00('0x20')](function(){_0x101a56['status'](0xcc)[_0x3a00('0x2d')]();});}};}function handleEntityNotFound(_0x1b328b,_0x2f913c){return function(_0x1abdcc){if(!_0x1abdcc){_0x1b328b[_0x3a00('0x2b')](0x194);}return _0x1abdcc;};}function handleError(_0x1d272a,_0x1f6d36){_0x1f6d36=_0x1f6d36||0x1f4;return function(_0x3d4980){logger[_0x3a00('0x25')](_0x3d4980[_0x3a00('0x36')]);if(_0x3d4980[_0x3a00('0x37')]){delete _0x3d4980[_0x3a00('0x37')];}_0x1d272a[_0x3a00('0x2c')](_0x1f6d36)[_0x3a00('0x38')](_0x3d4980);};}exports[_0x3a00('0x39')]=function(_0x2d6fb2,_0x2d553d){var _0x23a178={},_0x3e76dd={},_0x364dc8={'count':0x0,'rows':[]};var _0x4007bb=_['map'](db[_0x3a00('0x3a')][_0x3a00('0x3b')],function(_0x5544cd){return{'name':_0x5544cd[_0x3a00('0x3c')],'type':_0x5544cd[_0x3a00('0x3d')][_0x3a00('0x3e')]};});_0x3e76dd['model']=_[_0x3a00('0x3f')](_0x4007bb,_0x3a00('0x37'));_0x3e76dd['query']=_[_0x3a00('0x40')](_0x2d6fb2[_0x3a00('0x41')]);_0x3e76dd[_0x3a00('0x42')]=_[_0x3a00('0x43')](_0x3e76dd[_0x3a00('0x44')],_0x3e76dd[_0x3a00('0x41')]);_0x23a178[_0x3a00('0x45')]=_[_0x3a00('0x43')](_0x3e76dd['model'],qs[_0x3a00('0x46')](_0x2d6fb2['query']['fields']));_0x23a178[_0x3a00('0x45')]=_0x23a178[_0x3a00('0x45')][_0x3a00('0x47')]?_0x23a178['attributes']:_0x3e76dd[_0x3a00('0x44')];if(!_0x2d6fb2[_0x3a00('0x41')][_0x3a00('0x48')]('nolimit')){_0x23a178['limit']=qs[_0x3a00('0x2f')](_0x2d6fb2[_0x3a00('0x41')][_0x3a00('0x2f')]);_0x23a178[_0x3a00('0x2e')]=qs[_0x3a00('0x2e')](_0x2d6fb2[_0x3a00('0x41')]['offset']);}_0x23a178[_0x3a00('0x49')]=qs[_0x3a00('0x4a')](_0x2d6fb2[_0x3a00('0x41')][_0x3a00('0x4a')]);_0x23a178['where']=qs[_0x3a00('0x42')](_[_0x3a00('0x4b')](_0x2d6fb2['query'],_0x3e76dd[_0x3a00('0x42')]),_0x4007bb);if(_0x2d6fb2['query'][_0x3a00('0x4c')]){_0x23a178[_0x3a00('0x4d')]=_['merge'](_0x23a178[_0x3a00('0x4d')],{'$or':_[_0x3a00('0x3f')](_0x4007bb,function(_0x3d4622){if(_0x3d4622[_0x3a00('0x3d')]!==_0x3a00('0x4e')){var _0x4c3484={};_0x4c3484[_0x3d4622[_0x3a00('0x37')]]={'$like':'%'+_0x2d6fb2[_0x3a00('0x41')][_0x3a00('0x4c')]+'%'};return _0x4c3484;}})});}_0x23a178=_['merge']({},_0x23a178,_0x2d6fb2[_0x3a00('0x4f')]);var _0x40849c={'where':_0x23a178[_0x3a00('0x4d')]};return db['FaxMessage'][_0x3a00('0x30')](_0x40849c)[_0x3a00('0x20')](function(_0x4e72e0){_0x364dc8[_0x3a00('0x30')]=_0x4e72e0;if(_0x2d6fb2[_0x3a00('0x41')][_0x3a00('0x50')]){_0x23a178[_0x3a00('0x51')]=[{'all':!![]}];}return db[_0x3a00('0x3a')][_0x3a00('0x52')](_0x23a178);})[_0x3a00('0x20')](function(_0x32410d){_0x364dc8[_0x3a00('0x53')]=_0x32410d;return _0x364dc8;})[_0x3a00('0x20')](respondWithFilteredResult(_0x2d553d,_0x23a178))[_0x3a00('0x2a')](handleError(_0x2d553d,null));};exports[_0x3a00('0x54')]=function(_0x13a579,_0xaabffa){var _0x70bb1b={'raw':!![],'where':{'id':_0x13a579[_0x3a00('0x55')]['id']}},_0x57d4ee={};_0x57d4ee[_0x3a00('0x44')]=_[_0x3a00('0x40')](db[_0x3a00('0x3a')][_0x3a00('0x3b')]);_0x57d4ee[_0x3a00('0x41')]=_['keys'](_0x13a579['query']);_0x57d4ee[_0x3a00('0x42')]=_[_0x3a00('0x43')](_0x57d4ee[_0x3a00('0x44')],_0x57d4ee[_0x3a00('0x41')]);_0x70bb1b['attributes']=_[_0x3a00('0x43')](_0x57d4ee[_0x3a00('0x44')],qs[_0x3a00('0x46')](_0x13a579[_0x3a00('0x41')][_0x3a00('0x46')]));_0x70bb1b[_0x3a00('0x45')]=_0x70bb1b['attributes'][_0x3a00('0x47')]?_0x70bb1b['attributes']:_0x57d4ee[_0x3a00('0x44')];if(_0x13a579[_0x3a00('0x41')][_0x3a00('0x50')]){_0x70bb1b[_0x3a00('0x51')]=[{'all':!![]}];}_0x70bb1b=_[_0x3a00('0x56')]({},_0x70bb1b,_0x13a579['options']);return db[_0x3a00('0x3a')]['find'](_0x70bb1b)[_0x3a00('0x20')](handleEntityNotFound(_0xaabffa,null))[_0x3a00('0x20')](respondWithResult(_0xaabffa,null))[_0x3a00('0x2a')](handleError(_0xaabffa,null));};exports[_0x3a00('0x57')]=function(_0xb96bd3,_0x3673ba){if(_0xb96bd3['body']['id']){delete _0xb96bd3[_0x3a00('0x58')]['id'];}return db[_0x3a00('0x3a')][_0x3a00('0x59')]({'where':{'id':_0xb96bd3['params']['id']}})['then'](handleEntityNotFound(_0x3673ba,null))[_0x3a00('0x20')](saveUpdates(_0xb96bd3[_0x3a00('0x58')],null))[_0x3a00('0x20')](respondWithResult(_0x3673ba,null))[_0x3a00('0x2a')](handleError(_0x3673ba,null));};exports[_0x3a00('0x35')]=function(_0x2f1ed2,_0x1b386f){return db[_0x3a00('0x3a')][_0x3a00('0x59')]({'where':{'id':_0x2f1ed2[_0x3a00('0x55')]['id']}})[_0x3a00('0x20')](handleEntityNotFound(_0x1b386f,null))['then'](removeEntity(_0x1b386f,null))[_0x3a00('0x2a')](handleError(_0x1b386f,null));};exports[_0x3a00('0x5a')]=function(_0x396075,_0x18429b){return db['FaxMessage'][_0x3a00('0x5a')]()[_0x3a00('0x20')](respondWithResult(_0x18429b,null))[_0x3a00('0x2a')](handleError(_0x18429b,null));};var interaction_log=require(_0x3a00('0x15'))(_0x3a00('0x5b'));exports[_0x3a00('0x5c')]=function(_0x15b4c8,_0x55d005,_0x126993){var _0x1bf768={'agent':{},'channel':_0x3a00('0x5d')};if(_0x15b4c8[_0x3a00('0x58')]['id']){delete _0x15b4c8[_0x3a00('0x58')]['id'];}_0x15b4c8[_0x3a00('0x58')][_0x3a00('0x5e')]=!![];_0x15b4c8['body']['readAt']=moment()[_0x3a00('0x5f')](_0x3a00('0x60'));_0x15b4c8[_0x3a00('0x58')][_0x3a00('0x61')]=_0x15b4c8[_0x3a00('0x58')][_0x3a00('0x61')]||_0x15b4c8[_0x3a00('0x62')]['id'];_0x1bf768['agent']['id']=_0x15b4c8[_0x3a00('0x58')][_0x3a00('0x61')];return db[_0x3a00('0x3a')][_0x3a00('0x59')]({'where':{'id':_0x15b4c8['params']['id'],'UserId':null}})[_0x3a00('0x20')](handleEntityNotFound(_0x55d005,null))[_0x3a00('0x20')](saveUpdates(_0x15b4c8[_0x3a00('0x58')],null))['then'](function(_0x276409){if(_0x276409){_0x1bf768['message']=_0x276409[_0x3a00('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x3a00('0x59')]({'where':{'id':_0x276409[_0x3a00('0x64')]}});}return null;})[_0x3a00('0x20')](handleEntityNotFound(_0x55d005,null))[_0x3a00('0x20')](function(_0xf48467){if(_0xf48467){return _0xf48467[_0x3a00('0x57')]({'UserId':_0x15b4c8[_0x3a00('0x58')][_0x3a00('0x61')],'read1stAt':_[_0x3a00('0x65')](_0xf48467[_0x3a00('0x66')])?moment()[_0x3a00('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3a00('0x20')](function(_0x4d13cd){if(_0x4d13cd){_0x1bf768[_0x3a00('0x67')]=_0x4d13cd[_0x3a00('0x63')]({'plain':!![]});interaction_log[_0x3a00('0x21')](_0x3a00('0x68'),_0x15b4c8[_0x3a00('0x62')]['id'],_0x15b4c8[_0x3a00('0x62')][_0x3a00('0x37')],_0x15b4c8[_0x3a00('0x62')]['role'],_0x1bf768[_0x3a00('0x67')]['id'],_0x15b4c8[_0x3a00('0x58')]?JSON[_0x3a00('0x69')](_0x15b4c8['body']):_0x3a00('0x6a'));return respondWithRpcPromise(_0x3a00('0x6b'),_0x3a00('0x6c'),_0x1bf768);}return null;})[_0x3a00('0x20')](function(_0x1c6ffa){var _0x24813b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c6ffa['message']['ContactId'];return db['sequelize'][_0x3a00('0x41')](_0x24813b,{'type':db[_0x3a00('0x6d')][_0x3a00('0x6e')][_0x3a00('0x6f')],'raw':!![]})[_0x3a00('0x20')](function(_0x2b2343){return _0x2b2343;});})['then'](function(_0x57d65a){if(_0x57d65a){_0x1bf768[_0x3a00('0x28')][_0x3a00('0x70')]=_0x57d65a[0x0];if(!_0x15b4c8[_0x3a00('0x58')]['UserId'])return;return db['User'][_0x3a00('0x59')]({'where':{'id':_0x15b4c8['body'][_0x3a00('0x61')],'role':_0x3a00('0x71')},'attributes':['id',_0x3a00('0x37'),'fullname',_0x3a00('0x72'),_0x3a00('0x73')],'raw':!![]});}return null;})[_0x3a00('0x20')](function(_0x2f6d45){if(!_0x2f6d45)return null;_0x1bf768[_0x3a00('0x28')][_0x3a00('0x71')]=_0x2f6d45;return _0x1bf768;})['then'](function(_0x349532){if(_0x349532){if(_0x15b4c8[_0x3a00('0x58')][_0x3a00('0x74')]){_0x1bf768[_0x3a00('0x28')][_0x3a00('0x75')]=util[_0x3a00('0x5f')](_0x3a00('0x76'),_0x15b4c8['user']['name']);_0x1bf768[_0x3a00('0x28')][_0x3a00('0x77')]=_0x1bf768[_0x3a00('0x77')];_0x1bf768[_0x3a00('0x28')][_0x3a00('0x78')]=_0x1bf768[_0x3a00('0x77')];_0x1bf768[_0x3a00('0x28')][_0x3a00('0x79')]=_0x3a00('0x5c');return respondWithRpcPromise(_0x3a00('0x7a'),_0x3a00('0x7a'),{'event':_0x3a00('0x7b'),'message':_0x1bf768['message']},client9002)['then'](function(){return _0x1bf768;});}return _0x1bf768;}return null;})[_0x3a00('0x20')](respondWithResult(_0x55d005,null))[_0x3a00('0x2a')](handleError(_0x55d005,null));};var interaction_log=require('../../config/logger')(_0x3a00('0x5b'));exports[_0x3a00('0x33')]=function(_0x38e6b3,_0x3ebbe7,_0x36480a){var _0x3bcfb8={'agent':{},'channel':_0x3a00('0x5d')};if(_0x38e6b3['body']['id']){delete _0x38e6b3[_0x3a00('0x58')]['id'];}_0x38e6b3[_0x3a00('0x58')][_0x3a00('0x61')]=_0x38e6b3[_0x3a00('0x58')]['UserId']||_0x38e6b3['user']['id'];_0x3bcfb8['agent']['id']=_0x38e6b3[_0x3a00('0x58')][_0x3a00('0x61')];return db[_0x3a00('0x3a')][_0x3a00('0x59')]({'where':{'id':_0x38e6b3[_0x3a00('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ebbe7,null))[_0x3a00('0x20')](function(_0x436a7a){if(_0x436a7a){_0x3bcfb8['message']=_0x436a7a[_0x3a00('0x63')]({'plain':!![]});return db[_0x3a00('0x7c')][_0x3a00('0x59')]({'where':{'id':_0x436a7a['FaxInteractionId']}});}return null;})[_0x3a00('0x20')](handleEntityNotFound(_0x3ebbe7,null))[_0x3a00('0x20')](function(_0x4c8f0e){if(_0x4c8f0e){_0x3bcfb8[_0x3a00('0x67')]=_0x4c8f0e[_0x3a00('0x63')]({'plain':!![]});interaction_log[_0x3a00('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x38e6b3[_0x3a00('0x62')]['id'],_0x38e6b3[_0x3a00('0x62')][_0x3a00('0x37')],_0x38e6b3[_0x3a00('0x62')][_0x3a00('0x7d')],_0x3bcfb8['interaction']['id'],_0x38e6b3['body']?JSON[_0x3a00('0x69')](_0x38e6b3[_0x3a00('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0x3a00('0x7e'),_0x3bcfb8);}return null;})['then'](function(_0x12673f){var _0x6cf089=_0x3a00('0x7f')+_0x12673f[_0x3a00('0x28')][_0x3a00('0x80')];return db[_0x3a00('0x81')][_0x3a00('0x41')](_0x6cf089,{'type':db[_0x3a00('0x6d')][_0x3a00('0x6e')][_0x3a00('0x6f')],'raw':!![]})[_0x3a00('0x20')](function(_0x2e067c){return _0x2e067c;});})[_0x3a00('0x20')](function(_0x23cd4a){if(_0x23cd4a){_0x3bcfb8[_0x3a00('0x28')][_0x3a00('0x70')]=_0x23cd4a[0x0];if(!_0x38e6b3[_0x3a00('0x58')][_0x3a00('0x61')])return;return db[_0x3a00('0x82')][_0x3a00('0x59')]({'where':{'id':_0x38e6b3['body']['UserId'],'role':_0x3a00('0x71')},'attributes':['id',_0x3a00('0x37'),_0x3a00('0x83'),_0x3a00('0x72'),_0x3a00('0x73')],'raw':!![]});}return null;})[_0x3a00('0x20')](function(_0x4bcedb){if(!_0x4bcedb)return null;_0x3bcfb8[_0x3a00('0x28')]['agent']=_0x4bcedb;return _0x3bcfb8;})[_0x3a00('0x20')](function(_0x2348fa){if(_0x2348fa){_0x2348fa[_0x3a00('0x28')][_0x3a00('0x75')]=util[_0x3a00('0x5f')]('SIP/%s',_0x38e6b3[_0x3a00('0x62')][_0x3a00('0x37')]);_0x2348fa['message']['channel']=_0x3bcfb8[_0x3a00('0x77')];_0x2348fa[_0x3a00('0x28')]['motionChannel']=_0x3bcfb8[_0x3a00('0x77')];_0x2348fa[_0x3a00('0x28')][_0x3a00('0x79')]=_0x3a00('0x33');respondWithRpcPromise(_0x3a00('0x7a'),_0x3a00('0x7a'),{'event':_0x3a00('0x84'),'message':_0x2348fa[_0x3a00('0x28')]},client9002);return _0x3bcfb8;}return null;})[_0x3a00('0x20')](respondWithResult(_0x3ebbe7,null))['catch'](handleError(_0x3ebbe7,null));};exports[_0x3a00('0x85')]=function(_0x1e29b1,_0x20d833){var _0x3b5373;return db[_0x3a00('0x3a')][_0x3a00('0x85')](_0x1e29b1[_0x3a00('0x58')],{})[_0x3a00('0x20')](function(_0x2c56db){_0x3b5373=_0x2c56db;return db[_0x3a00('0x86')]['findOne']({'where':{'id':_0x3b5373[_0x3a00('0x80')]}});})['then'](function(_0xe174b3){if(_[_0x3a00('0x65')](_0xe174b3)){return;}else{_0x3b5373['fax']=_0xe174b3[_0x3a00('0x5d')];return db[_0x3a00('0x87')][_0x3a00('0x88')]({'where':{'id':_0x3b5373[_0x3a00('0x89')]}});}})[_0x3a00('0x20')](function(_0x4f3e00){return respondWithRpcPromise(_0x3a00('0x8a'),_0x3a00('0x8a'),{'FaxAccountId':_[_0x3a00('0x65')](_0x1e29b1[_0x3a00('0x58')])?undefined:_0x1e29b1['body'][_0x3a00('0x8b')],'path':_[_0x3a00('0x65')](_0x4f3e00)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x4f3e00[_0x3a00('0x8c')]),'fax':_[_0x3a00('0x65')](_0x3b5373[_0x3a00('0x5d')])?undefined:_0x3b5373[_0x3a00('0x5d')],'AttachmentId':_0x3b5373[_0x3a00('0x89')]},client9002);})['then'](respondWithResult(_0x20d833,0xc9))[_0x3a00('0x2a')](handleError(_0x20d833,null));};exports[_0x3a00('0x8d')]=function(_0x55daaf,_0x67f0df){var _0x41baf2=path[_0x3a00('0x8e')](config[_0x3a00('0x8f')],'server',_0x3a00('0x90'),_0x3a00('0x91'));return db[_0x3a00('0x3a')][_0x3a00('0x59')]({'where':{'id':_0x55daaf['params']['id']},'include':[{'model':db['Attachment'],'as':_0x3a00('0x87')}]})[_0x3a00('0x20')](handleEntityNotFound(_0x67f0df,null))[_0x3a00('0x20')](function(_0x2958b9){if(_0x2958b9){return _0x67f0df['download'](path[_0x3a00('0x8e')](_0x41baf2,_0x2958b9[_0x3a00('0x87')][_0x3a00('0x8c')]));}})['catch'](handleError(_0x67f0df,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 17f12d3..3d6e827 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 _0x0954=['exports','events','FaxMessage','setMaxListeners','update','remove','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0954,0x135));var _0x4095=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x0954[_0x420f2a];return _0x28f802;};'use strict';var EventEmitter=require(_0x4095('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x4095('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4095('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4095('0x3'),'afterDestroy':_0x4095('0x4')};function emitEvent(_0xee98e){return function(_0x88c144,_0x173fd4,_0x6832ca){FaxMessageEvents['emit'](_0xee98e+':'+_0x88c144['id'],_0x88c144);FaxMessageEvents['emit'](_0xee98e,_0x88c144);_0x6832ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x4095('0x5')](e,emitEvent(event));}}module[_0x4095('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0xbff5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x1cd5c9,_0x69dea5){var _0xf75cc1=function(_0x4f30b0){while(--_0x4f30b0){_0x1cd5c9['push'](_0x1cd5c9['shift']());}};_0xf75cc1(++_0x69dea5);}(_0xbff5,0x1bc));var _0x5bff=function(_0x25989c,_0x211ed9){_0x25989c=_0x25989c-0x0;var _0x3c7735=_0xbff5[_0x25989c];return _0x3c7735;};'use strict';var EventEmitter=require(_0x5bff('0x0'));var FaxMessage=require(_0x5bff('0x1'))['db'][_0x5bff('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5bff('0x3')](0x0);var events={'afterCreate':_0x5bff('0x4'),'afterUpdate':_0x5bff('0x5'),'afterDestroy':_0x5bff('0x6')};function emitEvent(_0x4dccf3){return function(_0x3868ae,_0x486083,_0x4c567d){FaxMessageEvents[_0x5bff('0x7')](_0x4dccf3+':'+_0x3868ae['id'],_0x3868ae);FaxMessageEvents[_0x5bff('0x7')](_0x4dccf3,_0x3868ae);_0x4c567d(null);};}for(var e in events){if(events[_0x5bff('0x8')](e)){var event=events[e];FaxMessage[_0x5bff('0x9')](e,emitEvent(event));}}module[_0x5bff('0xa')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index cf7bebb..c9ae37b 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 _0xec86=['exports','define','FaxMessage','fax_messages','fti_fax_messages','get','toLowerCase','direction','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xec86,0xbb));var _0x6ec8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xec86[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x6ec8('0x0'));var util=require(_0x6ec8('0x1'));var logger=require('../../config/logger')(_0x6ec8('0x2'));var moment=require('moment');var BPromise=require(_0x6ec8('0x3'));var rp=require(_0x6ec8('0x4'));var fs=require('fs');var path=require(_0x6ec8('0x5'));var rimraf=require(_0x6ec8('0x6'));var config=require(_0x6ec8('0x7'));var attributes=require(_0x6ec8('0x8'));module[_0x6ec8('0x9')]=function(_0x42970b,_0x1a9797){return _0x42970b[_0x6ec8('0xa')](_0x6ec8('0xb'),attributes,{'tableName':_0x6ec8('0xc'),'paranoid':![],'indexes':[{'name':_0x6ec8('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a4aea,_0x40af45,_0x3cc443){var _0x2f7981=_0x42970b['models'];var _0x26693d=_0x5a4aea[_0x6ec8('0xe')]({'plain':!![]});if(_0x26693d['direction'][_0x6ec8('0xf')]()==='in'||_0x26693d[_0x6ec8('0x10')]['toLowerCase']()===_0x6ec8('0x11')&&!_0x26693d[_0x6ec8('0x12')]&&!_[_0x6ec8('0x13')](_0x26693d['UserId'])){_0x2f7981[_0x6ec8('0x14')][_0x6ec8('0x15')]({'where':{'id':_0x26693d[_0x6ec8('0x16')]}})[_0x6ec8('0x17')](function(_0x134907){if(_0x134907){_0x134907['update']({'lastMsgAt':_0x26693d[_0x6ec8('0x18')],'lastMsgDirection':_0x26693d[_0x6ec8('0x10')][_0x6ec8('0xf')]()});}})[_0x6ec8('0x19')](function(_0x4719e8){console[_0x6ec8('0x1a')](_0x4719e8);});}_0x3cc443();}},'charset':'utf8mb4','collate':_0x6ec8('0x1b')});}; \ No newline at end of file +var _0x46f7=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e2d84,_0x3133ef){var _0x3dbd39=function(_0x2ed7ff){while(--_0x2ed7ff){_0x3e2d84['push'](_0x3e2d84['shift']());}};_0x3dbd39(++_0x3133ef);}(_0x46f7,0x1a4));var _0x746f=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x46f7[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x746f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x746f('0x1'));var moment=require(_0x746f('0x2'));var BPromise=require(_0x746f('0x3'));var rp=require(_0x746f('0x4'));var fs=require('fs');var path=require(_0x746f('0x5'));var rimraf=require(_0x746f('0x6'));var config=require(_0x746f('0x7'));var attributes=require(_0x746f('0x8'));module[_0x746f('0x9')]=function(_0x509ca4,_0x4af1e7){return _0x509ca4['define']('FaxMessage',attributes,{'tableName':_0x746f('0xa'),'paranoid':![],'indexes':[{'name':_0x746f('0xb'),'fields':[_0x746f('0xc')],'type':_0x746f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ad255,_0x4c698c,_0x3a92e8){var _0x4375a5=_0x509ca4[_0x746f('0xe')];var _0x1bbcba=_0x5ad255[_0x746f('0xf')]({'plain':!![]});if(_0x1bbcba[_0x746f('0x10')][_0x746f('0x11')]()==='in'||_0x1bbcba[_0x746f('0x10')][_0x746f('0x11')]()===_0x746f('0x12')&&!_0x1bbcba['secret']&&!_[_0x746f('0x13')](_0x1bbcba[_0x746f('0x14')])){_0x4375a5[_0x746f('0x15')][_0x746f('0x16')]({'where':{'id':_0x1bbcba[_0x746f('0x17')]}})['then'](function(_0x2c380b){if(_0x2c380b){_0x2c380b[_0x746f('0x18')]({'lastMsgAt':_0x1bbcba[_0x746f('0x19')],'lastMsgDirection':_0x1bbcba[_0x746f('0x10')][_0x746f('0x11')]()});}})[_0x746f('0x1a')](function(_0x53757d){console[_0x746f('0x1b')](_0x53757d);});}_0x3a92e8();}},'charset':_0x746f('0x1c'),'collate':_0x746f('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5937cc0..e602c77 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 _0xf3cd=['redis','defaults','socket.io-emitter','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','body','options','raw','UpdateFaxMessage','FaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1bd543,_0x366dfb){var _0x47c226=function(_0x44f242){while(--_0x44f242){_0x1bd543['push'](_0x1bd543['shift']());}};_0x47c226(++_0x366dfb);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3fcfb6,_0x515024){_0x3fcfb6=_0x3fcfb6-0x0;var _0x3b99a7=_0xf3cd[_0x3fcfb6];return _0x3b99a7;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});config[_0xdf3c('0xc')]=_[_0xdf3c('0xd')](config[_0xdf3c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf3c('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xdf3c('0xf')](socket);function respondWithRpcPromise(_0x981616,_0x5ef936,_0x1dba4c){return new BPromise(function(_0x205f33,_0x2d420c){return client[_0xdf3c('0x10')](_0x981616,_0x1dba4c)[_0xdf3c('0x11')](function(_0x1c456b){logger[_0xdf3c('0x12')](_0xdf3c('0x13'),_0x5ef936,'request\x20sent');logger[_0xdf3c('0x14')](_0xdf3c('0x15'),_0x5ef936,_0xdf3c('0x16'),JSON[_0xdf3c('0x17')](_0x1c456b));if(_0x1c456b['error']){if(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x19')]===0x1f4){logger[_0xdf3c('0x18')]('FaxMessage,\x20%s,\x20%s',_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x2d420c(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x205f33(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}else{logger['info'](_0xdf3c('0x13'),_0x5ef936,_0xdf3c('0x16'));_0x205f33(_0x1c456b[_0xdf3c('0x1b')][_0xdf3c('0x1a')]);}})[_0xdf3c('0x1c')](function(_0x113b56){logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x113b56);_0x2d420c(_0x113b56);});});}exports[_0xdf3c('0x1d')]=function(_0x18fb5f){var _0x267488=this;return new Promise(function(_0x3d14cc,_0x25487c){return db['FaxMessage']['create'](_0x18fb5f[_0xdf3c('0x1e')],{'raw':_0x18fb5f['options']?_0x18fb5f[_0xdf3c('0x1f')][_0xdf3c('0x20')]===undefined?!![]:![]:!![]})[_0xdf3c('0x11')](function(_0x38b319){logger[_0xdf3c('0x12')](_0xdf3c('0x1d'),_0x18fb5f);logger['debug'](_0xdf3c('0x1d'),_0x18fb5f,JSON[_0xdf3c('0x17')](_0x38b319));_0x3d14cc(_0x38b319);})[_0xdf3c('0x1c')](function(_0x24754a){logger[_0xdf3c('0x18')](_0xdf3c('0x1d'),_0x24754a[_0xdf3c('0x1a')],_0x18fb5f);_0x25487c(_0x267488[_0xdf3c('0x18')](0x1f4,_0x24754a[_0xdf3c('0x1a')]));});});};exports[_0xdf3c('0x21')]=function(_0x4c076c){var _0xd284d7=this;return new Promise(function(_0x153daa,_0x4b57a4){return db[_0xdf3c('0x22')]['update'](_0x4c076c['body'],{'raw':_0x4c076c['options']?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c076c['options']?_0x4c076c['options'][_0xdf3c('0x23')]||null:null,'attributes':_0x4c076c[_0xdf3c('0x1f')]?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x24')]||null:null,'limit':_0x4c076c['options']?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x25')]||null:null})['then'](function(_0x51e0a4){logger[_0xdf3c('0x12')](_0xdf3c('0x21'),_0x4c076c);logger[_0xdf3c('0x14')]('UpdateFaxMessage',_0x4c076c,JSON[_0xdf3c('0x17')](_0x51e0a4));_0x153daa(_0x51e0a4);})[_0xdf3c('0x1c')](function(_0x21e7b8){logger[_0xdf3c('0x18')]('UpdateFaxMessage',_0x21e7b8[_0xdf3c('0x1a')],_0x4c076c);_0x4b57a4(_0xd284d7[_0xdf3c('0x18')](0x1f4,_0x21e7b8['message']));});});}; \ No newline at end of file +var _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x46a8a1,_0x306ff8){var _0x13e5a9=function(_0x4657c7){while(--_0x4657c7){_0x46a8a1['push'](_0x46a8a1['shift']());}};_0x13e5a9(++_0x306ff8);}(_0xac9d,0x14d));var _0xdac9=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0xac9d[_0x3b3750];return _0x1b9e8b;};'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});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e4d75e5..7bf9413 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 _0x90e6=['remove','update','emit','removeListener','register','length','faxMessage:','save'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x90e6,0x9f));var _0x690e=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x90e6[_0x2f1114];return _0x2fe856;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x690e('0x0'),_0x690e('0x1'),_0x690e('0x2')];function createListener(_0x413437,_0x364266){return function(_0x5895ba){_0x364266[_0x690e('0x3')](_0x413437,_0x5895ba);};}function removeListener(_0x2b4907,_0x35a965){return function(){FaxMessageEvents[_0x690e('0x4')](_0x2b4907,_0x35a965);};}exports[_0x690e('0x5')]=function(_0x1b4d3b){for(var _0x120103=0x0,_0x25348b=events[_0x690e('0x6')];_0x120103<_0x25348b;_0x120103++){var _0xc74be=events[_0x120103];var _0x26b6d8=createListener(_0x690e('0x7')+_0xc74be,_0x1b4d3b);FaxMessageEvents['on'](_0xc74be,_0x26b6d8);}}; \ No newline at end of file +var _0x127a=['register','length','faxMessage:','./faxMessage.events','remove','update','emit','removeListener'];(function(_0x1abed2,_0x42796e){var _0x423e34=function(_0x5dacf3){while(--_0x5dacf3){_0x1abed2['push'](_0x1abed2['shift']());}};_0x423e34(++_0x42796e);}(_0x127a,0xfb));var _0xa127=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x127a[_0x34843e];return _0x598f7f;};'use strict';var FaxMessageEvents=require(_0xa127('0x0'));var events=['save',_0xa127('0x1'),_0xa127('0x2')];function createListener(_0x24a380,_0x19ded4){return function(_0x430db6){_0x19ded4[_0xa127('0x3')](_0x24a380,_0x430db6);};}function removeListener(_0x282231,_0x3e5097){return function(){FaxMessageEvents[_0xa127('0x4')](_0x282231,_0x3e5097);};}exports[_0xa127('0x5')]=function(_0x583f22){for(var _0x10acf4=0x0,_0x1ce1a9=events[_0xa127('0x6')];_0x10acf4<_0x1ce1a9;_0x10acf4++){var _0x1ca015=events[_0x10acf4];var _0x3e2b89=createListener(_0xa127('0x7')+_0x1ca015,_0x583f22);FaxMessageEvents['on'](_0x1ca015,_0x3e2b89);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 65b7800..83cd884 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 _0x4ded=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','download','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x324d5e,_0x4d31e5){var _0x184220=function(_0x306179){while(--_0x306179){_0x324d5e['push'](_0x324d5e['shift']());}};_0x184220(++_0x4d31e5);}(_0x4ded,0x116));var _0xd4de=function(_0x2689ee,_0x123c60){_0x2689ee=_0x2689ee-0x0;var _0x24e623=_0x4ded[_0x2689ee];return _0x24e623;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var fs_extra=require(_0xd4de('0x6'));var auth=require(_0xd4de('0x7'));var interaction=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var controller=require(_0xd4de('0xa'));router[_0xd4de('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4de('0xc')]);router[_0xd4de('0xb')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0xf')]);router[_0xd4de('0xb')]('/:id',auth[_0xd4de('0xe')](),controller['show']);router['get']('/:id/download',auth[_0xd4de('0xe')](),controller[_0xd4de('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xd4de('0x11'),'faxmessage:create'),controller[_0xd4de('0x12')]);router[_0xd4de('0x13')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x15')]);router[_0xd4de('0x13')](_0xd4de('0x16'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x17')]);router[_0xd4de('0x13')](_0xd4de('0x18'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x19')]);router[_0xd4de('0x1a')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xd3d1=['put','update','accept','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create'];(function(_0x275100,_0x23fbe9){var _0x509928=function(_0x5ba1f5){while(--_0x5ba1f5){_0x275100['push'](_0x275100['shift']());}};_0x509928(++_0x23fbe9);}(_0xd3d1,0x172));var _0x1d3d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd3d1[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var fs_extra=require(_0x1d3d('0x4'));var auth=require(_0x1d3d('0x5'));var interaction=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var controller=require(_0x1d3d('0x8'));router[_0x1d3d('0x9')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0x9')](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router[_0x1d3d('0x9')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller['show']);router[_0x1d3d('0x9')](_0x1d3d('0xf'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x10')]);router[_0x1d3d('0x11')]('/',auth[_0x1d3d('0xa')](),interaction[_0x1d3d('0x12')](_0x1d3d('0x13'),_0x1d3d('0x14')),controller[_0x1d3d('0x15')]);router[_0x1d3d('0x16')]('/:id',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x17')]);router['put']('/:id/accept',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x18')]);router[_0x1d3d('0x16')]('/:id/reject',auth[_0x1d3d('0xa')](),controller['reject']);router[_0x1d3d('0x19')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x1a')]);module[_0x1d3d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3213e67..9b35272 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 _0xf417=['name','INTEGER','beepall','exports','STRING'];(function(_0x1f4c0b,_0x28f740){var _0xa2eddb=function(_0x51f179){while(--_0x51f179){_0x1f4c0b['push'](_0x1f4c0b['shift']());}};_0xa2eddb(++_0x28f740);}(_0xf417,0x8f));var _0x7f41=function(_0x53c6af,_0x5108f2){_0x53c6af=_0x53c6af-0x0;var _0x9cefc6=_0xf417[_0x53c6af];return _0x9cefc6;};'use strict';var Sequelize=require('sequelize');module[_0x7f41('0x0')]={'name':{'type':Sequelize[_0x7f41('0x1')],'unique':_0x7f41('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7f41('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7f41('0x4'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbef1=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1a9390,_0x3339e6){var _0x2b4514=function(_0x1c07d5){while(--_0x1c07d5){_0x1a9390['push'](_0x1a9390['shift']());}};_0x2b4514(++_0x3339e6);}(_0xbef1,0x188));var _0x1bef=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0xbef1[_0x51ed62];return _0x34aee3;};'use strict';var Sequelize=require(_0x1bef('0x0'));module[_0x1bef('0x1')]={'name':{'type':Sequelize[_0x1bef('0x2')],'unique':_0x1bef('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1bef('0x2')]},'timeout':{'type':Sequelize[_0x1bef('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1bef('0x5')](_0x1bef('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 9ff4a71..8c3378a 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 _0x4482=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','FaxQueues','UserProfileResource','end','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','merge','filter','includeAll','findAll','rows','keys','include','options','find','catch','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','pick','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','ids','Agents','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userFaxQueue:save','removeTeams','User','select','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','compact','removeAgents','userFaxQueue:remove','body','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2a8c19,_0xe8330a){var _0x52f5a7=function(_0x380e50){while(--_0x380e50){_0x2a8c19['push'](_0x2a8c19['shift']());}};_0x52f5a7(++_0xe8330a);}(_0x4482,0xf6));var _0x2448=function(_0x306dab,_0x287bb5){_0x306dab=_0x306dab-0x0;var _0x4b421f=_0x4482[_0x306dab];return _0x4b421f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2448('0x0'));var zipdir=require(_0x2448('0x1'));var jsonpatch=require(_0x2448('0x2'));var rp=require(_0x2448('0x3'));var moment=require(_0x2448('0x4'));var BPromise=require(_0x2448('0x5'));var Mustache=require(_0x2448('0x6'));var util=require(_0x2448('0x7'));var path=require('path');var sox=require(_0x2448('0x8'));var csv=require(_0x2448('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2448('0xa'));var squel=require(_0x2448('0xb'));var crypto=require(_0x2448('0xc'));var jsforce=require(_0x2448('0xd'));var deskjs=require(_0x2448('0xe'));var toCsv=require(_0x2448('0x9'));var querystring=require(_0x2448('0xf'));var Papa=require(_0x2448('0x10'));var Redis=require(_0x2448('0x11'));var authService=require(_0x2448('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2448('0x13'));var logger=require('../../config/logger')(_0x2448('0x14'));var utils=require('../../config/utils');var config=require(_0x2448('0x15'));var licenseUtil=require(_0x2448('0x16'));var db=require('../../mysqldb')['db'];config[_0x2448('0x17')]=_[_0x2448('0x18')](config[_0x2448('0x17')],{'host':_0x2448('0x19'),'port':0x18eb});var socket=require(_0x2448('0x1a'))(new Redis(config[_0x2448('0x17')]));require(_0x2448('0x1b'))['register'](socket);function respondWithStatusCode(_0x3f6667,_0x2a3367){_0x2a3367=_0x2a3367||0xcc;return function(_0x4658ee){if(_0x4658ee){return _0x3f6667[_0x2448('0x1c')](_0x2a3367);}return _0x3f6667[_0x2448('0x1d')](_0x2a3367)['end']();};}function respondWithResult(_0x136ecd,_0x31da19){_0x31da19=_0x31da19||0xc8;return function(_0x182773){if(_0x182773){return _0x136ecd[_0x2448('0x1d')](_0x31da19)[_0x2448('0x1e')](_0x182773);}};}function respondWithFilteredResult(_0x1cf7d3,_0x132b52){return function(_0x1e4a43){if(_0x1e4a43){var _0x569d88=typeof _0x132b52['offset']===_0x2448('0x1f')&&typeof _0x132b52['limit']===_0x2448('0x1f');var _0x57261e=_0x1e4a43[_0x2448('0x20')];var _0x2fad03=_0x569d88?0x0:_0x132b52[_0x2448('0x21')];var _0x5e2e4a=_0x569d88?_0x1e4a43['count']:_0x132b52[_0x2448('0x21')]+_0x132b52[_0x2448('0x22')];var _0x215284;if(_0x5e2e4a>=_0x57261e){_0x5e2e4a=_0x57261e;_0x215284=0xc8;}else{_0x215284=0xce;}_0x1cf7d3['status'](_0x215284);return _0x1cf7d3[_0x2448('0x23')](_0x2448('0x24'),_0x2fad03+'-'+_0x5e2e4a+'/'+_0x57261e)['json'](_0x1e4a43);}return null;};}function patchUpdates(_0x1e5c07){return function(_0x240111){try{jsonpatch['apply'](_0x240111,_0x1e5c07,!![]);}catch(_0x1bbf6f){return BPromise[_0x2448('0x25')](_0x1bbf6f);}return _0x240111[_0x2448('0x26')]();};}function saveUpdates(_0x47cd8d,_0x18a0a9){return function(_0x49a402){if(_0x49a402){return _0x49a402['update'](_0x47cd8d)[_0x2448('0x27')](function(_0x14c79c){return _0x14c79c;});}return null;};}function removeEntity(_0x312c8f,_0x2161dd){return function(_0xb5cc6b){if(_0xb5cc6b){return _0xb5cc6b[_0x2448('0x28')]()[_0x2448('0x27')](function(){var _0x164ffe=_0xb5cc6b[_0x2448('0x29')]({'plain':!![]});var _0x2a76b4=_0x2448('0x2a');return db[_0x2448('0x2b')]['destroy']({'where':{'type':_0x2a76b4,'resourceId':_0x164ffe['id']}})[_0x2448('0x27')](function(){return _0xb5cc6b;});})['then'](function(){_0x312c8f[_0x2448('0x1d')](0xcc)[_0x2448('0x2c')]();});}};}function handleEntityNotFound(_0x446e73,_0x5f0b7f){return function(_0x4bd5c7){if(!_0x4bd5c7){_0x446e73[_0x2448('0x1c')](0x194);}return _0x4bd5c7;};}function handleError(_0x3209f0,_0x14096b){_0x14096b=_0x14096b||0x1f4;return function(_0x5053f0){logger[_0x2448('0x2d')](_0x5053f0['stack']);if(_0x5053f0[_0x2448('0x2e')]){delete _0x5053f0['name'];}_0x3209f0[_0x2448('0x1d')](_0x14096b)[_0x2448('0x2f')](_0x5053f0);};}exports[_0x2448('0x30')]=function(_0x559f75,_0x43c8a7){var _0x400015={},_0x1f37eb={},_0x4dc9c4={'count':0x0,'rows':[]};var _0x233dfc=_[_0x2448('0x31')](db[_0x2448('0x32')][_0x2448('0x33')],function(_0x4dcd9f){return{'name':_0x4dcd9f[_0x2448('0x34')],'type':_0x4dcd9f[_0x2448('0x35')][_0x2448('0x36')]};});_0x1f37eb['model']=_[_0x2448('0x31')](_0x233dfc,_0x2448('0x2e'));_0x1f37eb['query']=_['keys'](_0x559f75[_0x2448('0x37')]);_0x1f37eb[_0x2448('0x38')]=_[_0x2448('0x39')](_0x1f37eb[_0x2448('0x3a')],_0x1f37eb[_0x2448('0x37')]);_0x400015[_0x2448('0x3b')]=_[_0x2448('0x39')](_0x1f37eb[_0x2448('0x3a')],qs[_0x2448('0x3c')](_0x559f75[_0x2448('0x37')][_0x2448('0x3c')]));_0x400015[_0x2448('0x3b')]=_0x400015[_0x2448('0x3b')][_0x2448('0x3d')]?_0x400015['attributes']:_0x1f37eb[_0x2448('0x3a')];if(!_0x559f75[_0x2448('0x37')]['hasOwnProperty']('nolimit')){_0x400015['limit']=qs['limit'](_0x559f75[_0x2448('0x37')][_0x2448('0x22')]);_0x400015['offset']=qs['offset'](_0x559f75[_0x2448('0x37')][_0x2448('0x21')]);}_0x400015[_0x2448('0x3e')]=qs[_0x2448('0x3f')](_0x559f75[_0x2448('0x37')][_0x2448('0x3f')]);_0x400015[_0x2448('0x40')]=qs[_0x2448('0x38')](_['pick'](_0x559f75['query'],_0x1f37eb[_0x2448('0x38')]),_0x233dfc);if(_0x559f75[_0x2448('0x37')]['filter']){_0x400015[_0x2448('0x40')]=_[_0x2448('0x41')](_0x400015[_0x2448('0x40')],{'$or':_[_0x2448('0x31')](_0x233dfc,function(_0x2f36ba){if(_0x2f36ba[_0x2448('0x35')]!=='VIRTUAL'){var _0x4d1c60={};_0x4d1c60[_0x2f36ba['name']]={'$like':'%'+_0x559f75[_0x2448('0x37')][_0x2448('0x42')]+'%'};return _0x4d1c60;}})});}_0x400015=_[_0x2448('0x41')]({},_0x400015,_0x559f75['options']);var _0xefe197={'where':_0x400015[_0x2448('0x40')]};return db[_0x2448('0x32')][_0x2448('0x20')](_0xefe197)[_0x2448('0x27')](function(_0x3360bd){_0x4dc9c4['count']=_0x3360bd;if(_0x559f75['query'][_0x2448('0x43')]){_0x400015['include']=[{'all':!![]}];}return db[_0x2448('0x32')][_0x2448('0x44')](_0x400015);})[_0x2448('0x27')](function(_0x3d2669){_0x4dc9c4[_0x2448('0x45')]=_0x3d2669;return _0x4dc9c4;})['then'](respondWithFilteredResult(_0x43c8a7,_0x400015))['catch'](handleError(_0x43c8a7,null));};exports['show']=function(_0x5a7d6a,_0x37b8ba){var _0x37c637={'raw':!![],'where':{'id':_0x5a7d6a['params']['id']}},_0x4e8897={};_0x4e8897[_0x2448('0x3a')]=_[_0x2448('0x46')](db['FaxQueue']['rawAttributes']);_0x4e8897[_0x2448('0x37')]=_[_0x2448('0x46')](_0x5a7d6a[_0x2448('0x37')]);_0x4e8897['filters']=_[_0x2448('0x39')](_0x4e8897[_0x2448('0x3a')],_0x4e8897['query']);_0x37c637[_0x2448('0x3b')]=_[_0x2448('0x39')](_0x4e8897[_0x2448('0x3a')],qs['fields'](_0x5a7d6a[_0x2448('0x37')][_0x2448('0x3c')]));_0x37c637['attributes']=_0x37c637['attributes'][_0x2448('0x3d')]?_0x37c637[_0x2448('0x3b')]:_0x4e8897[_0x2448('0x3a')];if(_0x5a7d6a[_0x2448('0x37')][_0x2448('0x43')]){_0x37c637[_0x2448('0x47')]=[{'all':!![]}];}_0x37c637=_['merge']({},_0x37c637,_0x5a7d6a[_0x2448('0x48')]);return db[_0x2448('0x32')][_0x2448('0x49')](_0x37c637)[_0x2448('0x27')](handleEntityNotFound(_0x37b8ba,null))[_0x2448('0x27')](respondWithResult(_0x37b8ba,null))[_0x2448('0x4a')](handleError(_0x37b8ba,null));};exports['create']=function(_0x20dd20,_0x4cc835){return db['FaxQueue'][_0x2448('0x4b')](_0x20dd20['body'],{})[_0x2448('0x27')](function(_0x573230){var _0x2fbdd0=_0x20dd20['user'][_0x2448('0x29')]({'plain':!![]});if(!_0x2fbdd0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbdd0[_0x2448('0x4c')]===_0x2448('0x4d')){var _0x544189=_0x573230['get']({'plain':!![]});var _0x226a21=_0x2448('0x2a');return db[_0x2448('0x4e')][_0x2448('0x49')]({'where':{'name':_0x226a21,'userProfileId':_0x2fbdd0['userProfileId']},'raw':!![]})[_0x2448('0x27')](function(_0x542a44){if(_0x542a44&&_0x542a44[_0x2448('0x4f')]===0x0){return db[_0x2448('0x2b')][_0x2448('0x4b')]({'name':_0x544189[_0x2448('0x2e')],'resourceId':_0x544189['id'],'type':_0x542a44[_0x2448('0x2e')],'sectionId':_0x542a44['id']},{})[_0x2448('0x27')](function(){return _0x573230;});}else{return _0x573230;}})[_0x2448('0x4a')](function(_0x258890){logger[_0x2448('0x2d')](_0x2448('0x50'),_0x258890);throw _0x258890;});}return _0x573230;})[_0x2448('0x27')](respondWithResult(_0x4cc835,0xc9))[_0x2448('0x4a')](handleError(_0x4cc835,null));};exports[_0x2448('0x51')]=function(_0x20b781,_0x598443){if(_0x20b781['body']['id']){delete _0x20b781['body']['id'];}return db['FaxQueue'][_0x2448('0x49')]({'where':{'id':_0x20b781[_0x2448('0x52')]['id']}})[_0x2448('0x27')](handleEntityNotFound(_0x598443,null))[_0x2448('0x27')](saveUpdates(_0x20b781['body'],null))[_0x2448('0x27')](respondWithResult(_0x598443,null))['catch'](handleError(_0x598443,null));};exports[_0x2448('0x28')]=function(_0x4ccb91,_0x40a127){return db[_0x2448('0x32')][_0x2448('0x49')]({'where':{'id':_0x4ccb91[_0x2448('0x52')]['id']}})[_0x2448('0x27')](handleEntityNotFound(_0x40a127,null))['then'](removeEntity(_0x40a127,null))[_0x2448('0x4a')](handleError(_0x40a127,null));};exports['describe']=function(_0x41ae4c,_0xdab951){return db[_0x2448('0x32')]['describe']()[_0x2448('0x27')](respondWithResult(_0xdab951,null))[_0x2448('0x4a')](handleError(_0xdab951,null));};exports[_0x2448('0x53')]=function(_0x4bd1f5,_0x5522cd,_0x42a234){var _0x3247ba={'raw':!![],'where':{}},_0x2d65c5={},_0x4b9eeb;return db['FaxQueue'][_0x2448('0x54')]({'where':{'id':_0x4bd1f5[_0x2448('0x52')]['id']}})[_0x2448('0x27')](handleEntityNotFound(_0x5522cd,null))[_0x2448('0x27')](function(_0x14d6fa){if(_0x14d6fa){_0x4b9eeb=_0x14d6fa[_0x2448('0x29')]({'plain':!![]});_0x2d65c5[_0x2448('0x3a')]=_[_0x2448('0x46')](db[_0x2448('0x55')]['rawAttributes']);_0x2d65c5['query']=_[_0x2448('0x46')](_0x4bd1f5['query']);_0x2d65c5[_0x2448('0x38')]=_[_0x2448('0x39')](_0x2d65c5[_0x2448('0x3a')],_0x2d65c5['query']);_0x3247ba[_0x2448('0x3b')]=_['intersection'](_0x2d65c5[_0x2448('0x3a')],qs['fields'](_0x4bd1f5['query'][_0x2448('0x3c')]));_0x3247ba[_0x2448('0x3b')]=_0x3247ba['attributes'][_0x2448('0x3d')]?_0x3247ba[_0x2448('0x3b')]:_0x2d65c5[_0x2448('0x3a')];if(!_0x4bd1f5[_0x2448('0x37')][_0x2448('0x56')](_0x2448('0x57'))){_0x3247ba[_0x2448('0x22')]=qs[_0x2448('0x22')](_0x4bd1f5[_0x2448('0x37')][_0x2448('0x22')]);_0x3247ba[_0x2448('0x21')]=qs[_0x2448('0x21')](_0x4bd1f5[_0x2448('0x37')][_0x2448('0x21')]);}_0x3247ba[_0x2448('0x3e')]=qs[_0x2448('0x3f')](_0x4bd1f5[_0x2448('0x37')][_0x2448('0x3f')]);_0x3247ba['where']=qs[_0x2448('0x38')](_[_0x2448('0x58')](_0x4bd1f5[_0x2448('0x37')],_0x2d65c5[_0x2448('0x38')]));_0x3247ba['where']['FaxQueueId']=_0x14d6fa['id'];if(_0x4bd1f5[_0x2448('0x37')]['filter']){_0x3247ba[_0x2448('0x40')]=_['merge'](_0x3247ba[_0x2448('0x40')],{'$or':_[_0x2448('0x31')](_0x3247ba['attributes'],function(_0x4a6dd5){var _0x3c60a7={};_0x3c60a7[_0x4a6dd5]={'$like':'%'+_0x4bd1f5[_0x2448('0x37')][_0x2448('0x42')]+'%'};return _0x3c60a7;})});}_0x3247ba=_['merge']({},_0x3247ba,_0x4bd1f5['options']);return db[_0x2448('0x55')][_0x2448('0x44')](_0x3247ba);}})[_0x2448('0x27')](function(_0x17b9e7){if(_0x17b9e7){return db['User'][_0x2448('0x59')]({'where':{'id':_[_0x2448('0x31')](_0x17b9e7,'UserId'),'role':_0x2448('0x5a')},'attributes':['id',_0x2448('0x2e'),_0x2448('0x5b'),'updatedAt',_0x2448('0x5c')]});}})[_0x2448('0x27')](function(_0x48e36e){if(_0x48e36e){return{'count':_0x48e36e[_0x2448('0x20')],'rows':_[_0x2448('0x31')](_0x48e36e[_0x2448('0x45')],function(_0x3fc4f7){return{'membername':_0x3fc4f7['name'],'UserId':_0x3fc4f7['id'],'queue_name':_0x4b9eeb[_0x2448('0x2e')],'FaxQueueId':_0x4b9eeb['id'],'interface':util[_0x2448('0x5d')](_0x2448('0x5e'),_0x2448('0x5f'),_0x3fc4f7['name']),'penalty':0x0,'paused':_0x3fc4f7['faxPause'],'createdAt':_0x3fc4f7['createdAt'],'updatedAt':_0x3fc4f7[_0x2448('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2448('0x27')](respondWithFilteredResult(_0x5522cd,_0x3247ba))[_0x2448('0x4a')](handleError(_0x5522cd,null));};exports['getTeams']=function(_0x49078a,_0x2039e0,_0x3fe453){var _0x182f87={};var _0x1a8f66={};var _0x191879;var _0x5bde91;return db[_0x2448('0x32')]['findOne']({'where':{'id':_0x49078a[_0x2448('0x52')]['id']}})[_0x2448('0x27')](handleEntityNotFound(_0x2039e0,null))[_0x2448('0x27')](function(_0x58351a){if(_0x58351a){_0x191879=_0x58351a;_0x1a8f66[_0x2448('0x3a')]=_[_0x2448('0x46')](db[_0x2448('0x61')][_0x2448('0x33')]);_0x1a8f66[_0x2448('0x37')]=_[_0x2448('0x46')](_0x49078a[_0x2448('0x37')]);_0x1a8f66[_0x2448('0x38')]=_[_0x2448('0x39')](_0x1a8f66[_0x2448('0x3a')],_0x1a8f66[_0x2448('0x37')]);_0x182f87[_0x2448('0x3b')]=_[_0x2448('0x39')](_0x1a8f66[_0x2448('0x3a')],qs['fields'](_0x49078a[_0x2448('0x37')][_0x2448('0x3c')]));_0x182f87[_0x2448('0x3b')]=_0x182f87[_0x2448('0x3b')][_0x2448('0x3d')]?_0x182f87[_0x2448('0x3b')]:_0x1a8f66[_0x2448('0x3a')];_0x182f87['order']=qs[_0x2448('0x3f')](_0x49078a['query'][_0x2448('0x3f')]);_0x182f87[_0x2448('0x40')]=qs[_0x2448('0x38')](_['pick'](_0x49078a['query'],_0x1a8f66[_0x2448('0x38')]));if(_0x49078a[_0x2448('0x37')][_0x2448('0x42')]){_0x182f87[_0x2448('0x40')]=_[_0x2448('0x41')](_0x182f87[_0x2448('0x40')],{'$or':_['map'](_0x182f87[_0x2448('0x3b')],function(_0x299f98){var _0x110895={};_0x110895[_0x299f98]={'$like':'%'+_0x49078a['query'][_0x2448('0x42')]+'%'};return _0x110895;})});}_0x182f87=_['merge']({},_0x182f87,_0x49078a[_0x2448('0x48')]);return _0x191879[_0x2448('0x62')](_0x182f87);}})['then'](function(_0x35e241){if(_0x35e241){_0x5bde91=_0x35e241['length'];if(!_0x49078a[_0x2448('0x37')]['hasOwnProperty']('nolimit')){_0x182f87[_0x2448('0x22')]=qs[_0x2448('0x22')](_0x49078a['query'][_0x2448('0x22')]);_0x182f87['offset']=qs[_0x2448('0x21')](_0x49078a[_0x2448('0x37')]['offset']);}return _0x191879[_0x2448('0x62')](_0x182f87);}})[_0x2448('0x27')](function(_0x4ca009){if(_0x4ca009){return _0x4ca009?{'count':_0x5bde91,'rows':_0x4ca009}:null;}})[_0x2448('0x27')](respondWithResult(_0x2039e0,null))[_0x2448('0x4a')](handleError(_0x2039e0,null));};exports['addTeams']=function(_0x318fce,_0x33f0c7,_0x44a7d1){var _0x562302=_0x318fce['body'][_0x2448('0x63')];return db[_0x2448('0x61')][_0x2448('0x44')]({'where':{'id':_0x562302},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2448('0x64'),'attributes':['id',_0x2448('0x2e'),'online','voicePause',_0x2448('0x65')],'raw':!![]}]})[_0x2448('0x27')](function(_0x32d846){if(_0x32d846){var _0x1ea9dd=_[_0x2448('0x66')](_0x32d846,function(_0x2a3eb8){var _0x30a465=_0x2a3eb8[_0x2448('0x29')]({'plain':!![]});return _0x30a465[_0x2448('0x64')];});return db[_0x2448('0x32')][_0x2448('0x49')]({'where':{'id':_0x318fce['params']['id']}})[_0x2448('0x27')](function(_0x4b6f31){return db[_0x2448('0x67')][_0x2448('0x68')](function(_0x1626bb){return _0x4b6f31[_0x2448('0x69')](_0x562302,{'transaction':_0x1626bb})[_0x2448('0x27')](function(){return BPromise[_0x2448('0x6a')](_0x1ea9dd,function(_0x612ee6){return db[_0x2448('0x55')]['findOrCreate']({'where':{'UserId':_0x612ee6['id'],'FaxQueueId':_0x318fce['params']['id']},'transaction':_0x1626bb});});})[_0x2448('0x27')](function(){_0x1ea9dd[_0x2448('0x6b')](function(_0x36c7d4){socket[_0x2448('0x6c')](_0x2448('0x6d'),{'UserId':_0x36c7d4['id'],'FaxQueueId':_0x4b6f31['id']});});});});});}})[_0x2448('0x27')](respondWithStatusCode(_0x33f0c7,null))[_0x2448('0x4a')](handleError(_0x33f0c7,null));};exports[_0x2448('0x6e')]=function(_0x475d67,_0x547f05,_0x13ade4){return db['Team'][_0x2448('0x44')]({'where':{'id':_0x475d67[_0x2448('0x37')][_0x2448('0x63')]},'attributes':['id'],'include':[{'model':db[_0x2448('0x6f')],'as':_0x2448('0x64'),'attributes':['id'],'raw':!![]}]})[_0x2448('0x27')](handleEntityNotFound(_0x547f05,null))['then'](function(_0x95de0f){var _0x2eff5e=_['map'](_0x95de0f,'id');var _0x3d77e0=[];var _0x4eec36=[];var _0x44af7c=squel[_0x2448('0x70')]();_0x44af7c['field'](_0x2448('0x71'))[_0x2448('0x72')](_0x2448('0x73'),'tq')[_0x2448('0x74')]('user_has_teams','ut',_0x2448('0x75'))[_0x2448('0x40')]('FaxQueueId\x20=\x20?',_0x475d67[_0x2448('0x52')]['id']);for(var _0x3acb30=0x0;_0x3acb30<_0x95de0f[_0x2448('0x3d')];_0x3acb30+=0x1){let _0x5d5acb=_0x95de0f[_0x3acb30];for(var _0x2f6c6f=0x0;_0x2f6c6f<_0x5d5acb[_0x2448('0x64')]['length'];_0x2f6c6f+=0x1){let _0x23cfac=_0x5d5acb[_0x2448('0x64')][_0x2f6c6f];var _0x4c27d2=_0x44af7c['clone']();_0x4c27d2[_0x2448('0x40')](_0x2448('0x76'),_0x23cfac['id']);_0x4eec36['push'](db[_0x2448('0x67')][_0x2448('0x37')](_0x4c27d2[_0x2448('0x77')](),{'type':db['sequelize']['QueryTypes'][_0x2448('0x78')]})[_0x2448('0x27')](function(_0x1aac3b){if(_0x1aac3b[_0x2448('0x3d')]===0x1){return _0x23cfac['id'];}else{var _0x2cacc8=_[_0x2448('0x79')](_['map'](_0x1aac3b,_0x2448('0x7a')),function(_0x25e39a){return _[_0x2448('0x7b')](_0x2eff5e,_0x25e39a);});if(_0x2cacc8){return _0x23cfac['id'];}}}));}}return BPromise['all'](_0x4eec36)['then'](function(_0x43c363){_0x3d77e0=_(_0x3d77e0)['union'](_0x43c363)[_0x2448('0x7c')]()['value']();return db['FaxQueue'][_0x2448('0x49')]({'where':{'id':_0x475d67['params']['id']}})[_0x2448('0x27')](function(_0x3488c3){return db[_0x2448('0x67')]['transaction'](function(_0x2a9f12){return _0x3488c3[_0x2448('0x6e')](_0x475d67[_0x2448('0x37')]['ids'],{'transaction':_0x2a9f12})['then'](function(){if(!_['isEmpty'](_0x3d77e0)){return _0x3488c3[_0x2448('0x7d')](_0x3d77e0,{'transaction':_0x2a9f12});}})[_0x2448('0x27')](function(){_0x3d77e0[_0x2448('0x6b')](function(_0x416728){socket['emit'](_0x2448('0x7e'),{'UserId':_0x416728,'FaxQueueId':_0x3488c3['id']});});});});});});})[_0x2448('0x27')](respondWithStatusCode(_0x547f05,null))[_0x2448('0x4a')](handleError(_0x547f05,null));};exports['addAgents']=function(_0x1691a8,_0x146c9d,_0x2d8e73){return db[_0x2448('0x32')][_0x2448('0x49')]({'where':{'id':_0x1691a8[_0x2448('0x52')]['id']}})[_0x2448('0x27')](handleEntityNotFound(_0x146c9d,null))[_0x2448('0x27')](function(_0xb03620){if(_0xb03620){return _0xb03620['addAgents'](_0x1691a8[_0x2448('0x7f')][_0x2448('0x63')],_[_0x2448('0x80')](_0x1691a8[_0x2448('0x7f')],[_0x2448('0x63'),'id'])||{})[_0x2448('0x81')](function(_0x1522c8){for(var _0xd87953=0x0;_0xd87953<_0x1691a8[_0x2448('0x7f')][_0x2448('0x63')][_0x2448('0x3d')];_0xd87953+=0x1){socket['emit'](_0x2448('0x6d'),{'UserId':Number(_0x1691a8[_0x2448('0x7f')][_0x2448('0x63')][_0xd87953]),'FaxQueueId':Number(_0x1691a8[_0x2448('0x52')]['id'])});}return _0x1522c8;});}})[_0x2448('0x27')](respondWithResult(_0x146c9d,null))[_0x2448('0x4a')](handleError(_0x146c9d,null));};exports[_0x2448('0x7d')]=function(_0x25e836,_0x3396de,_0x5eb746){return db['FaxQueue'][_0x2448('0x49')]({'where':{'id':_0x25e836['params']['id']}})['then'](handleEntityNotFound(_0x3396de,null))[_0x2448('0x27')](function(_0x41d069){if(_0x41d069){return _0x41d069['removeAgents'](_0x25e836[_0x2448('0x37')]['ids'])[_0x2448('0x27')](function(){if(_['isArray'](_0x25e836[_0x2448('0x37')][_0x2448('0x63')])){for(var _0x8c1cdd=0x0;_0x8c1cdd<_0x25e836[_0x2448('0x37')][_0x2448('0x63')][_0x2448('0x3d')];_0x8c1cdd+=0x1){socket[_0x2448('0x6c')](_0x2448('0x7e'),{'UserId':Number(_0x25e836[_0x2448('0x37')][_0x2448('0x63')][_0x8c1cdd]),'FaxQueueId':Number(_0x25e836[_0x2448('0x52')]['id'])});}}else{socket[_0x2448('0x6c')](_0x2448('0x7e'),{'UserId':Number(_0x25e836[_0x2448('0x37')][_0x2448('0x63')]),'FaxQueueId':Number(_0x25e836[_0x2448('0x52')]['id'])});}});}})[_0x2448('0x27')](respondWithStatusCode(_0x3396de,null))[_0x2448('0x4a')](handleError(_0x3396de,null));};exports[_0x2448('0x82')]=function(_0x10a1bb,_0x50b551,_0x269a0e){var _0x492754={};var _0x316914={};var _0x341800;var _0x4a3c6f;return db[_0x2448('0x32')][_0x2448('0x54')]({'where':{'id':_0x10a1bb[_0x2448('0x52')]['id']}})[_0x2448('0x27')](handleEntityNotFound(_0x50b551,null))[_0x2448('0x27')](function(_0x3650cf){if(_0x3650cf){_0x341800=_0x3650cf;_0x316914[_0x2448('0x3a')]=_[_0x2448('0x46')](db[_0x2448('0x6f')][_0x2448('0x33')]);_0x316914[_0x2448('0x37')]=_[_0x2448('0x46')](_0x10a1bb[_0x2448('0x37')]);_0x316914[_0x2448('0x38')]=_[_0x2448('0x39')](_0x316914[_0x2448('0x3a')],_0x316914['query']);_0x492754['attributes']=_[_0x2448('0x39')](_0x316914['model'],qs[_0x2448('0x3c')](_0x10a1bb['query'][_0x2448('0x3c')]));_0x492754[_0x2448('0x3b')]=_0x492754[_0x2448('0x3b')][_0x2448('0x3d')]?_0x492754[_0x2448('0x3b')]:_0x316914['model'];_0x492754[_0x2448('0x3e')]=qs[_0x2448('0x3f')](_0x10a1bb['query']['sort']);_0x492754[_0x2448('0x40')]=qs[_0x2448('0x38')](_[_0x2448('0x58')](_0x10a1bb[_0x2448('0x37')],_0x316914[_0x2448('0x38')]));if(_0x10a1bb[_0x2448('0x37')][_0x2448('0x42')]){_0x492754[_0x2448('0x40')]=_['merge'](_0x492754['where'],{'$or':_[_0x2448('0x31')](_0x492754['attributes'],function(_0x1f2c68){var _0x54d1f7={};_0x54d1f7[_0x1f2c68]={'$like':'%'+_0x10a1bb['query'][_0x2448('0x42')]+'%'};return _0x54d1f7;})});}_0x492754=_[_0x2448('0x41')]({},_0x492754,_0x10a1bb['options']);return _0x341800[_0x2448('0x82')](_0x492754);}})[_0x2448('0x27')](function(_0x57259e){if(_0x57259e){_0x4a3c6f=_0x57259e[_0x2448('0x3d')];if(!_0x10a1bb[_0x2448('0x37')][_0x2448('0x56')](_0x2448('0x57'))){_0x492754[_0x2448('0x22')]=qs[_0x2448('0x22')](_0x10a1bb['query'][_0x2448('0x22')]);_0x492754['offset']=qs[_0x2448('0x21')](_0x10a1bb[_0x2448('0x37')]['offset']);}return _0x341800[_0x2448('0x82')](_0x492754);}})[_0x2448('0x27')](function(_0x20ff9e){if(_0x20ff9e){return _0x20ff9e?{'count':_0x4a3c6f,'rows':_0x20ff9e}:null;}})[_0x2448('0x27')](respondWithResult(_0x50b551,null))[_0x2448('0x4a')](handleError(_0x50b551,null));}; \ No newline at end of file +var _0xafbb=['field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','removeAgents','forEach','emit','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','FaxQueues','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','FaxQueue','findAll','rows','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','length','sort','UserFaxQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','faxPause','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','removeTeams','select'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0xafbb,0xad));var _0xbafb=function(_0x7daffd,_0x171e53){_0x7daffd=_0x7daffd-0x0;var _0x122add=_0xafbb[_0x7daffd];return _0x122add;};'use strict';var emlformat=require(_0xbafb('0x0'));var rimraf=require(_0xbafb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbafb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbafb('0x3'));var util=require(_0xbafb('0x4'));var path=require(_0xbafb('0x5'));var sox=require(_0xbafb('0x6'));var csv=require(_0xbafb('0x7'));var ejs=require(_0xbafb('0x8'));var fs=require('fs');var fs_extra=require(_0xbafb('0x9'));var _=require('lodash');var squel=require(_0xbafb('0xa'));var crypto=require('crypto');var jsforce=require(_0xbafb('0xb'));var deskjs=require(_0xbafb('0xc'));var toCsv=require(_0xbafb('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbafb('0xd'));var authService=require(_0xbafb('0xe'));var qs=require(_0xbafb('0xf'));var as=require(_0xbafb('0x10'));var hardwareService=require(_0xbafb('0x11'));var logger=require(_0xbafb('0x12'))(_0xbafb('0x13'));var utils=require(_0xbafb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbafb('0x15'));var db=require(_0xbafb('0x16'))['db'];config['redis']=_[_0xbafb('0x17')](config[_0xbafb('0x18')],{'host':_0xbafb('0x19'),'port':0x18eb});var socket=require(_0xbafb('0x1a'))(new Redis(config[_0xbafb('0x18')]));require(_0xbafb('0x1b'))[_0xbafb('0x1c')](socket);function respondWithStatusCode(_0x543392,_0x3e96df){_0x3e96df=_0x3e96df||0xcc;return function(_0x10a336){if(_0x10a336){return _0x543392[_0xbafb('0x1d')](_0x3e96df);}return _0x543392[_0xbafb('0x1e')](_0x3e96df)[_0xbafb('0x1f')]();};}function respondWithResult(_0x2c9b06,_0x4e2b82){_0x4e2b82=_0x4e2b82||0xc8;return function(_0x4b20ed){if(_0x4b20ed){return _0x2c9b06[_0xbafb('0x1e')](_0x4e2b82)[_0xbafb('0x20')](_0x4b20ed);}};}function respondWithFilteredResult(_0x595c9a,_0x1d4df2){return function(_0x470684){if(_0x470684){var _0x569e1c=typeof _0x1d4df2['offset']===_0xbafb('0x21')&&typeof _0x1d4df2[_0xbafb('0x22')]===_0xbafb('0x21');var _0x2cdeaf=_0x470684[_0xbafb('0x23')];var _0x252e2f=_0x569e1c?0x0:_0x1d4df2['offset'];var _0x3a36b2=_0x569e1c?_0x470684['count']:_0x1d4df2['offset']+_0x1d4df2[_0xbafb('0x22')];var _0x5cc480;if(_0x3a36b2>=_0x2cdeaf){_0x3a36b2=_0x2cdeaf;_0x5cc480=0xc8;}else{_0x5cc480=0xce;}_0x595c9a['status'](_0x5cc480);return _0x595c9a[_0xbafb('0x24')](_0xbafb('0x25'),_0x252e2f+'-'+_0x3a36b2+'/'+_0x2cdeaf)[_0xbafb('0x20')](_0x470684);}return null;};}function patchUpdates(_0x29f9c9){return function(_0x5b9b41){try{jsonpatch[_0xbafb('0x26')](_0x5b9b41,_0x29f9c9,!![]);}catch(_0x14304d){return BPromise[_0xbafb('0x27')](_0x14304d);}return _0x5b9b41[_0xbafb('0x28')]();};}function saveUpdates(_0x28de81,_0x30ecf2){return function(_0x35f3ce){if(_0x35f3ce){return _0x35f3ce['update'](_0x28de81)[_0xbafb('0x29')](function(_0x1449c0){return _0x1449c0;});}return null;};}function removeEntity(_0x5f523f,_0x1a7103){return function(_0x1546c5){if(_0x1546c5){return _0x1546c5[_0xbafb('0x2a')]()[_0xbafb('0x29')](function(){var _0x718b2f=_0x1546c5['get']({'plain':!![]});var _0x506595=_0xbafb('0x2b');return db[_0xbafb('0x2c')][_0xbafb('0x2a')]({'where':{'type':_0x506595,'resourceId':_0x718b2f['id']}})[_0xbafb('0x29')](function(){return _0x1546c5;});})['then'](function(){_0x5f523f['status'](0xcc)[_0xbafb('0x1f')]();});}};}function handleEntityNotFound(_0x470ff4,_0x1af44d){return function(_0x256950){if(!_0x256950){_0x470ff4[_0xbafb('0x1d')](0x194);}return _0x256950;};}function handleError(_0x25eabd,_0x5f144b){_0x5f144b=_0x5f144b||0x1f4;return function(_0x1cefb5){logger['error'](_0x1cefb5[_0xbafb('0x2d')]);if(_0x1cefb5[_0xbafb('0x2e')]){delete _0x1cefb5[_0xbafb('0x2e')];}_0x25eabd['status'](_0x5f144b)[_0xbafb('0x2f')](_0x1cefb5);};}exports['index']=function(_0x53e2b2,_0x3c6fd9){var _0x272444={},_0x2aaa29={},_0x20add4={'count':0x0,'rows':[]};var _0x50beae=_[_0xbafb('0x30')](db['FaxQueue'][_0xbafb('0x31')],function(_0x5f02dc){return{'name':_0x5f02dc[_0xbafb('0x32')],'type':_0x5f02dc['type'][_0xbafb('0x33')]};});_0x2aaa29[_0xbafb('0x34')]=_[_0xbafb('0x30')](_0x50beae,_0xbafb('0x2e'));_0x2aaa29[_0xbafb('0x35')]=_[_0xbafb('0x36')](_0x53e2b2[_0xbafb('0x35')]);_0x2aaa29[_0xbafb('0x37')]=_[_0xbafb('0x38')](_0x2aaa29[_0xbafb('0x34')],_0x2aaa29[_0xbafb('0x35')]);_0x272444['attributes']=_['intersection'](_0x2aaa29[_0xbafb('0x34')],qs[_0xbafb('0x39')](_0x53e2b2[_0xbafb('0x35')]['fields']));_0x272444[_0xbafb('0x3a')]=_0x272444[_0xbafb('0x3a')]['length']?_0x272444['attributes']:_0x2aaa29[_0xbafb('0x34')];if(!_0x53e2b2['query'][_0xbafb('0x3b')](_0xbafb('0x3c'))){_0x272444['limit']=qs[_0xbafb('0x22')](_0x53e2b2[_0xbafb('0x35')][_0xbafb('0x22')]);_0x272444[_0xbafb('0x3d')]=qs[_0xbafb('0x3d')](_0x53e2b2[_0xbafb('0x35')][_0xbafb('0x3d')]);}_0x272444[_0xbafb('0x3e')]=qs['sort'](_0x53e2b2[_0xbafb('0x35')]['sort']);_0x272444[_0xbafb('0x3f')]=qs[_0xbafb('0x37')](_[_0xbafb('0x40')](_0x53e2b2[_0xbafb('0x35')],_0x2aaa29[_0xbafb('0x37')]),_0x50beae);if(_0x53e2b2[_0xbafb('0x35')][_0xbafb('0x41')]){_0x272444[_0xbafb('0x3f')]=_[_0xbafb('0x42')](_0x272444['where'],{'$or':_[_0xbafb('0x30')](_0x50beae,function(_0x4b7c69){if(_0x4b7c69[_0xbafb('0x43')]!==_0xbafb('0x44')){var _0x3cdaa6={};_0x3cdaa6[_0x4b7c69['name']]={'$like':'%'+_0x53e2b2[_0xbafb('0x35')][_0xbafb('0x41')]+'%'};return _0x3cdaa6;}})});}_0x272444=_[_0xbafb('0x42')]({},_0x272444,_0x53e2b2[_0xbafb('0x45')]);var _0x484590={'where':_0x272444[_0xbafb('0x3f')]};return db['FaxQueue'][_0xbafb('0x23')](_0x484590)[_0xbafb('0x29')](function(_0x5b5771){_0x20add4[_0xbafb('0x23')]=_0x5b5771;if(_0x53e2b2[_0xbafb('0x35')][_0xbafb('0x46')]){_0x272444[_0xbafb('0x47')]=[{'all':!![]}];}return db[_0xbafb('0x48')][_0xbafb('0x49')](_0x272444);})[_0xbafb('0x29')](function(_0x3a63e4){_0x20add4[_0xbafb('0x4a')]=_0x3a63e4;return _0x20add4;})['then'](respondWithFilteredResult(_0x3c6fd9,_0x272444))[_0xbafb('0x4b')](handleError(_0x3c6fd9,null));};exports[_0xbafb('0x4c')]=function(_0x38d64a,_0x4cb32){var _0x58155a={'raw':!![],'where':{'id':_0x38d64a[_0xbafb('0x4d')]['id']}},_0x1bee7e={};_0x1bee7e[_0xbafb('0x34')]=_[_0xbafb('0x36')](db[_0xbafb('0x48')][_0xbafb('0x31')]);_0x1bee7e[_0xbafb('0x35')]=_[_0xbafb('0x36')](_0x38d64a[_0xbafb('0x35')]);_0x1bee7e[_0xbafb('0x37')]=_['intersection'](_0x1bee7e[_0xbafb('0x34')],_0x1bee7e[_0xbafb('0x35')]);_0x58155a[_0xbafb('0x3a')]=_[_0xbafb('0x38')](_0x1bee7e[_0xbafb('0x34')],qs[_0xbafb('0x39')](_0x38d64a[_0xbafb('0x35')]['fields']));_0x58155a[_0xbafb('0x3a')]=_0x58155a[_0xbafb('0x3a')]['length']?_0x58155a['attributes']:_0x1bee7e[_0xbafb('0x34')];if(_0x38d64a[_0xbafb('0x35')][_0xbafb('0x46')]){_0x58155a[_0xbafb('0x47')]=[{'all':!![]}];}_0x58155a=_[_0xbafb('0x42')]({},_0x58155a,_0x38d64a[_0xbafb('0x45')]);return db['FaxQueue'][_0xbafb('0x4e')](_0x58155a)[_0xbafb('0x29')](handleEntityNotFound(_0x4cb32,null))['then'](respondWithResult(_0x4cb32,null))['catch'](handleError(_0x4cb32,null));};exports['create']=function(_0x276000,_0x476fe1){return db[_0xbafb('0x48')][_0xbafb('0x4f')](_0x276000[_0xbafb('0x50')],{})[_0xbafb('0x29')](function(_0x244fcd){var _0x3e9a0a=_0x276000[_0xbafb('0x51')][_0xbafb('0x52')]({'plain':!![]});if(!_0x3e9a0a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9a0a[_0xbafb('0x53')]===_0xbafb('0x51')){var _0x4534fe=_0x244fcd[_0xbafb('0x52')]({'plain':!![]});var _0x40dc3b=_0xbafb('0x2b');return db[_0xbafb('0x54')][_0xbafb('0x4e')]({'where':{'name':_0x40dc3b,'userProfileId':_0x3e9a0a[_0xbafb('0x55')]},'raw':!![]})[_0xbafb('0x29')](function(_0x52a3ee){if(_0x52a3ee&&_0x52a3ee[_0xbafb('0x56')]===0x0){return db[_0xbafb('0x2c')][_0xbafb('0x4f')]({'name':_0x4534fe[_0xbafb('0x2e')],'resourceId':_0x4534fe['id'],'type':_0x52a3ee[_0xbafb('0x2e')],'sectionId':_0x52a3ee['id']},{})[_0xbafb('0x29')](function(){return _0x244fcd;});}else{return _0x244fcd;}})[_0xbafb('0x4b')](function(_0x529a51){logger[_0xbafb('0x57')](_0xbafb('0x58'),_0x529a51);throw _0x529a51;});}return _0x244fcd;})[_0xbafb('0x29')](respondWithResult(_0x476fe1,0xc9))[_0xbafb('0x4b')](handleError(_0x476fe1,null));};exports['update']=function(_0x316305,_0x151d48){if(_0x316305['body']['id']){delete _0x316305['body']['id'];}return db[_0xbafb('0x48')]['find']({'where':{'id':_0x316305[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](handleEntityNotFound(_0x151d48,null))[_0xbafb('0x29')](saveUpdates(_0x316305['body'],null))[_0xbafb('0x29')](respondWithResult(_0x151d48,null))[_0xbafb('0x4b')](handleError(_0x151d48,null));};exports[_0xbafb('0x2a')]=function(_0xe955a6,_0x165608){return db[_0xbafb('0x48')][_0xbafb('0x4e')]({'where':{'id':_0xe955a6[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](handleEntityNotFound(_0x165608,null))[_0xbafb('0x29')](removeEntity(_0x165608,null))['catch'](handleError(_0x165608,null));};exports[_0xbafb('0x59')]=function(_0x2f36b2,_0x54dd63){return db[_0xbafb('0x48')]['describe']()[_0xbafb('0x29')](respondWithResult(_0x54dd63,null))[_0xbafb('0x4b')](handleError(_0x54dd63,null));};exports[_0xbafb('0x5a')]=function(_0x37a8b6,_0x366f57,_0x36d160){var _0x32b7ae={'raw':!![],'where':{}},_0x56a80f={},_0x221514;return db[_0xbafb('0x48')][_0xbafb('0x5b')]({'where':{'id':_0x37a8b6[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](handleEntityNotFound(_0x366f57,null))[_0xbafb('0x29')](function(_0x1b5cb5){if(_0x1b5cb5){_0x221514=_0x1b5cb5[_0xbafb('0x52')]({'plain':!![]});_0x56a80f[_0xbafb('0x34')]=_['keys'](db['UserFaxQueue'][_0xbafb('0x31')]);_0x56a80f[_0xbafb('0x35')]=_[_0xbafb('0x36')](_0x37a8b6[_0xbafb('0x35')]);_0x56a80f[_0xbafb('0x37')]=_['intersection'](_0x56a80f['model'],_0x56a80f[_0xbafb('0x35')]);_0x32b7ae[_0xbafb('0x3a')]=_[_0xbafb('0x38')](_0x56a80f[_0xbafb('0x34')],qs[_0xbafb('0x39')](_0x37a8b6[_0xbafb('0x35')][_0xbafb('0x39')]));_0x32b7ae[_0xbafb('0x3a')]=_0x32b7ae[_0xbafb('0x3a')][_0xbafb('0x5c')]?_0x32b7ae[_0xbafb('0x3a')]:_0x56a80f['model'];if(!_0x37a8b6['query'][_0xbafb('0x3b')](_0xbafb('0x3c'))){_0x32b7ae['limit']=qs[_0xbafb('0x22')](_0x37a8b6['query']['limit']);_0x32b7ae['offset']=qs[_0xbafb('0x3d')](_0x37a8b6[_0xbafb('0x35')]['offset']);}_0x32b7ae[_0xbafb('0x3e')]=qs['sort'](_0x37a8b6[_0xbafb('0x35')][_0xbafb('0x5d')]);_0x32b7ae[_0xbafb('0x3f')]=qs[_0xbafb('0x37')](_[_0xbafb('0x40')](_0x37a8b6[_0xbafb('0x35')],_0x56a80f[_0xbafb('0x37')]));_0x32b7ae[_0xbafb('0x3f')]['FaxQueueId']=_0x1b5cb5['id'];if(_0x37a8b6[_0xbafb('0x35')]['filter']){_0x32b7ae[_0xbafb('0x3f')]=_[_0xbafb('0x42')](_0x32b7ae[_0xbafb('0x3f')],{'$or':_[_0xbafb('0x30')](_0x32b7ae['attributes'],function(_0x191e2e){var _0x8ccbf3={};_0x8ccbf3[_0x191e2e]={'$like':'%'+_0x37a8b6[_0xbafb('0x35')][_0xbafb('0x41')]+'%'};return _0x8ccbf3;})});}_0x32b7ae=_[_0xbafb('0x42')]({},_0x32b7ae,_0x37a8b6['options']);return db[_0xbafb('0x5e')]['findAll'](_0x32b7ae);}})[_0xbafb('0x29')](function(_0x416990){if(_0x416990){return db[_0xbafb('0x5f')][_0xbafb('0x60')]({'where':{'id':_['map'](_0x416990,_0xbafb('0x61')),'role':_0xbafb('0x62')},'attributes':['id','name','faxPause',_0xbafb('0x63'),_0xbafb('0x64')]});}})['then'](function(_0xf01ed5){if(_0xf01ed5){return{'count':_0xf01ed5[_0xbafb('0x23')],'rows':_['map'](_0xf01ed5[_0xbafb('0x4a')],function(_0x55b33a){return{'membername':_0x55b33a[_0xbafb('0x2e')],'UserId':_0x55b33a['id'],'queue_name':_0x221514[_0xbafb('0x2e')],'FaxQueueId':_0x221514['id'],'interface':util['format'](_0xbafb('0x65'),_0xbafb('0x66'),_0x55b33a[_0xbafb('0x2e')]),'penalty':0x0,'paused':_0x55b33a[_0xbafb('0x67')],'createdAt':_0x55b33a[_0xbafb('0x64')],'updatedAt':_0x55b33a[_0xbafb('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbafb('0x29')](respondWithFilteredResult(_0x366f57,_0x32b7ae))['catch'](handleError(_0x366f57,null));};exports['getTeams']=function(_0x122c87,_0x53c1bd,_0x83f20b){var _0x75a06f={};var _0x5c1f77={};var _0x52a942;var _0x579a4b;return db[_0xbafb('0x48')][_0xbafb('0x5b')]({'where':{'id':_0x122c87['params']['id']}})[_0xbafb('0x29')](handleEntityNotFound(_0x53c1bd,null))[_0xbafb('0x29')](function(_0x131c71){if(_0x131c71){_0x52a942=_0x131c71;_0x5c1f77['model']=_['keys'](db['Team'][_0xbafb('0x31')]);_0x5c1f77[_0xbafb('0x35')]=_[_0xbafb('0x36')](_0x122c87['query']);_0x5c1f77[_0xbafb('0x37')]=_[_0xbafb('0x38')](_0x5c1f77[_0xbafb('0x34')],_0x5c1f77[_0xbafb('0x35')]);_0x75a06f[_0xbafb('0x3a')]=_['intersection'](_0x5c1f77['model'],qs['fields'](_0x122c87[_0xbafb('0x35')][_0xbafb('0x39')]));_0x75a06f['attributes']=_0x75a06f[_0xbafb('0x3a')][_0xbafb('0x5c')]?_0x75a06f[_0xbafb('0x3a')]:_0x5c1f77[_0xbafb('0x34')];_0x75a06f['order']=qs['sort'](_0x122c87[_0xbafb('0x35')][_0xbafb('0x5d')]);_0x75a06f[_0xbafb('0x3f')]=qs[_0xbafb('0x37')](_['pick'](_0x122c87[_0xbafb('0x35')],_0x5c1f77[_0xbafb('0x37')]));if(_0x122c87[_0xbafb('0x35')][_0xbafb('0x41')]){_0x75a06f[_0xbafb('0x3f')]=_[_0xbafb('0x42')](_0x75a06f[_0xbafb('0x3f')],{'$or':_[_0xbafb('0x30')](_0x75a06f[_0xbafb('0x3a')],function(_0x110bd5){var _0x1a996e={};_0x1a996e[_0x110bd5]={'$like':'%'+_0x122c87['query']['filter']+'%'};return _0x1a996e;})});}_0x75a06f=_[_0xbafb('0x42')]({},_0x75a06f,_0x122c87[_0xbafb('0x45')]);return _0x52a942[_0xbafb('0x68')](_0x75a06f);}})[_0xbafb('0x29')](function(_0x52c0df){if(_0x52c0df){_0x579a4b=_0x52c0df[_0xbafb('0x5c')];if(!_0x122c87[_0xbafb('0x35')][_0xbafb('0x3b')](_0xbafb('0x3c'))){_0x75a06f['limit']=qs['limit'](_0x122c87[_0xbafb('0x35')][_0xbafb('0x22')]);_0x75a06f[_0xbafb('0x3d')]=qs[_0xbafb('0x3d')](_0x122c87['query'][_0xbafb('0x3d')]);}return _0x52a942['getTeams'](_0x75a06f);}})['then'](function(_0x217f8e){if(_0x217f8e){return _0x217f8e?{'count':_0x579a4b,'rows':_0x217f8e}:null;}})[_0xbafb('0x29')](respondWithResult(_0x53c1bd,null))[_0xbafb('0x4b')](handleError(_0x53c1bd,null));};exports[_0xbafb('0x69')]=function(_0x5632d8,_0x51dbef,_0x28811f){var _0x5a22b9=_0x5632d8[_0xbafb('0x50')][_0xbafb('0x6a')];return db[_0xbafb('0x6b')]['findAll']({'where':{'id':_0x5a22b9},'attributes':['id'],'include':[{'model':db[_0xbafb('0x5f')],'as':_0xbafb('0x6c'),'attributes':['id','name',_0xbafb('0x6d'),_0xbafb('0x6e'),_0xbafb('0x6f')],'raw':!![]}]})[_0xbafb('0x29')](function(_0x3c395d){if(_0x3c395d){var _0x3dc615=_[_0xbafb('0x70')](_0x3c395d,function(_0x556720){var _0x5e6de7=_0x556720['get']({'plain':!![]});return _0x5e6de7[_0xbafb('0x6c')];});return db[_0xbafb('0x48')]['find']({'where':{'id':_0x5632d8[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](function(_0x298f3c){return db['sequelize'][_0xbafb('0x71')](function(_0x1941ee){return _0x298f3c[_0xbafb('0x69')](_0x5a22b9,{'transaction':_0x1941ee})[_0xbafb('0x29')](function(){return BPromise['each'](_0x3dc615,function(_0x1f5554){return db[_0xbafb('0x5e')][_0xbafb('0x72')]({'where':{'UserId':_0x1f5554['id'],'FaxQueueId':_0x5632d8[_0xbafb('0x4d')]['id']},'transaction':_0x1941ee});});})[_0xbafb('0x29')](function(){_0x3dc615['forEach'](function(_0xbb43ce){socket['emit']('userFaxQueue:save',{'UserId':_0xbb43ce['id'],'FaxQueueId':_0x298f3c['id']});});});});});}})[_0xbafb('0x29')](respondWithStatusCode(_0x51dbef,null))[_0xbafb('0x4b')](handleError(_0x51dbef,null));};exports[_0xbafb('0x73')]=function(_0x3c19e8,_0x42a21d,_0x52d5c9){return db[_0xbafb('0x6b')][_0xbafb('0x49')]({'where':{'id':_0x3c19e8[_0xbafb('0x35')][_0xbafb('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbafb('0x5f')],'as':_0xbafb('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xbafb('0x29')](handleEntityNotFound(_0x42a21d,null))[_0xbafb('0x29')](function(_0x1658d8){var _0x4695fa=_[_0xbafb('0x30')](_0x1658d8,'id');var _0x5f336e=[];var _0x570c2e=[];var _0x3244be=squel[_0xbafb('0x74')]();_0x3244be[_0xbafb('0x75')](_0xbafb('0x76'))[_0xbafb('0x77')](_0xbafb('0x78'),'tq')[_0xbafb('0x79')](_0xbafb('0x7a'),'ut',_0xbafb('0x7b'))[_0xbafb('0x3f')]('FaxQueueId\x20=\x20?',_0x3c19e8[_0xbafb('0x4d')]['id']);for(var _0x2da36f=0x0;_0x2da36f<_0x1658d8[_0xbafb('0x5c')];_0x2da36f+=0x1){let _0x5c6a57=_0x1658d8[_0x2da36f];for(var _0x2138eb=0x0;_0x2138eb<_0x5c6a57[_0xbafb('0x6c')][_0xbafb('0x5c')];_0x2138eb+=0x1){let _0x21a752=_0x5c6a57['Agents'][_0x2138eb];var _0x409d3a=_0x3244be[_0xbafb('0x7c')]();_0x409d3a['where'](_0xbafb('0x7d'),_0x21a752['id']);_0x570c2e[_0xbafb('0x7e')](db[_0xbafb('0x7f')][_0xbafb('0x35')](_0x409d3a[_0xbafb('0x80')](),{'type':db[_0xbafb('0x7f')][_0xbafb('0x81')][_0xbafb('0x82')]})[_0xbafb('0x29')](function(_0x444473){if(_0x444473[_0xbafb('0x5c')]===0x1){return _0x21a752['id'];}else{var _0x326dd8=_[_0xbafb('0x83')](_[_0xbafb('0x30')](_0x444473,_0xbafb('0x84')),function(_0x5632bc){return _['includes'](_0x4695fa,_0x5632bc);});if(_0x326dd8){return _0x21a752['id'];}}}));}}return BPromise['all'](_0x570c2e)[_0xbafb('0x29')](function(_0xe6f680){_0x5f336e=_(_0x5f336e)[_0xbafb('0x85')](_0xe6f680)[_0xbafb('0x86')]()[_0xbafb('0x87')]();return db[_0xbafb('0x48')][_0xbafb('0x4e')]({'where':{'id':_0x3c19e8[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](function(_0x12621b){return db[_0xbafb('0x7f')][_0xbafb('0x71')](function(_0x54527a){return _0x12621b[_0xbafb('0x73')](_0x3c19e8[_0xbafb('0x35')][_0xbafb('0x6a')],{'transaction':_0x54527a})[_0xbafb('0x29')](function(){if(!_['isEmpty'](_0x5f336e)){return _0x12621b[_0xbafb('0x88')](_0x5f336e,{'transaction':_0x54527a});}})[_0xbafb('0x29')](function(){_0x5f336e[_0xbafb('0x89')](function(_0x28995d){socket[_0xbafb('0x8a')](_0xbafb('0x8b'),{'UserId':_0x28995d,'FaxQueueId':_0x12621b['id']});});});});});});})[_0xbafb('0x29')](respondWithStatusCode(_0x42a21d,null))['catch'](handleError(_0x42a21d,null));};exports[_0xbafb('0x8c')]=function(_0xb10112,_0x317039,_0x45c5e2){return db['FaxQueue']['find']({'where':{'id':_0xb10112[_0xbafb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x317039,null))[_0xbafb('0x29')](function(_0x11556f){if(_0x11556f){return _0x11556f['addAgents'](_0xb10112[_0xbafb('0x50')][_0xbafb('0x6a')],_['omit'](_0xb10112[_0xbafb('0x50')],['ids','id'])||{})[_0xbafb('0x8d')](function(_0x4d5a16){for(var _0x1284f3=0x0;_0x1284f3<_0xb10112[_0xbafb('0x50')]['ids'][_0xbafb('0x5c')];_0x1284f3+=0x1){socket[_0xbafb('0x8a')](_0xbafb('0x8e'),{'UserId':Number(_0xb10112['body'][_0xbafb('0x6a')][_0x1284f3]),'FaxQueueId':Number(_0xb10112[_0xbafb('0x4d')]['id'])});}return _0x4d5a16;});}})[_0xbafb('0x29')](respondWithResult(_0x317039,null))[_0xbafb('0x4b')](handleError(_0x317039,null));};exports[_0xbafb('0x88')]=function(_0x5b1038,_0xc995f2,_0x1d5731){return db[_0xbafb('0x48')][_0xbafb('0x4e')]({'where':{'id':_0x5b1038[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](handleEntityNotFound(_0xc995f2,null))[_0xbafb('0x29')](function(_0x44aa9f){if(_0x44aa9f){return _0x44aa9f[_0xbafb('0x88')](_0x5b1038[_0xbafb('0x35')]['ids'])[_0xbafb('0x29')](function(){if(_[_0xbafb('0x8f')](_0x5b1038['query'][_0xbafb('0x6a')])){for(var _0x2474e3=0x0;_0x2474e3<_0x5b1038[_0xbafb('0x35')][_0xbafb('0x6a')][_0xbafb('0x5c')];_0x2474e3+=0x1){socket[_0xbafb('0x8a')](_0xbafb('0x8b'),{'UserId':Number(_0x5b1038['query'][_0xbafb('0x6a')][_0x2474e3]),'FaxQueueId':Number(_0x5b1038[_0xbafb('0x4d')]['id'])});}}else{socket['emit'](_0xbafb('0x8b'),{'UserId':Number(_0x5b1038['query'][_0xbafb('0x6a')]),'FaxQueueId':Number(_0x5b1038['params']['id'])});}});}})[_0xbafb('0x29')](respondWithStatusCode(_0xc995f2,null))[_0xbafb('0x4b')](handleError(_0xc995f2,null));};exports[_0xbafb('0x90')]=function(_0x434c30,_0x5c49f9,_0x45da2d){var _0x4568c9={};var _0x2a9956={};var _0x8a6652;var _0x496d13;return db[_0xbafb('0x48')]['findOne']({'where':{'id':_0x434c30[_0xbafb('0x4d')]['id']}})[_0xbafb('0x29')](handleEntityNotFound(_0x5c49f9,null))[_0xbafb('0x29')](function(_0x3150f6){if(_0x3150f6){_0x8a6652=_0x3150f6;_0x2a9956[_0xbafb('0x34')]=_[_0xbafb('0x36')](db['User'][_0xbafb('0x31')]);_0x2a9956[_0xbafb('0x35')]=_['keys'](_0x434c30['query']);_0x2a9956[_0xbafb('0x37')]=_[_0xbafb('0x38')](_0x2a9956[_0xbafb('0x34')],_0x2a9956[_0xbafb('0x35')]);_0x4568c9[_0xbafb('0x3a')]=_[_0xbafb('0x38')](_0x2a9956[_0xbafb('0x34')],qs[_0xbafb('0x39')](_0x434c30[_0xbafb('0x35')][_0xbafb('0x39')]));_0x4568c9[_0xbafb('0x3a')]=_0x4568c9['attributes']['length']?_0x4568c9[_0xbafb('0x3a')]:_0x2a9956[_0xbafb('0x34')];_0x4568c9[_0xbafb('0x3e')]=qs[_0xbafb('0x5d')](_0x434c30[_0xbafb('0x35')][_0xbafb('0x5d')]);_0x4568c9[_0xbafb('0x3f')]=qs[_0xbafb('0x37')](_['pick'](_0x434c30['query'],_0x2a9956[_0xbafb('0x37')]));if(_0x434c30[_0xbafb('0x35')]['filter']){_0x4568c9[_0xbafb('0x3f')]=_[_0xbafb('0x42')](_0x4568c9[_0xbafb('0x3f')],{'$or':_[_0xbafb('0x30')](_0x4568c9['attributes'],function(_0x2ffcf6){var _0x2e3fc5={};_0x2e3fc5[_0x2ffcf6]={'$like':'%'+_0x434c30[_0xbafb('0x35')]['filter']+'%'};return _0x2e3fc5;})});}_0x4568c9=_[_0xbafb('0x42')]({},_0x4568c9,_0x434c30[_0xbafb('0x45')]);return _0x8a6652[_0xbafb('0x90')](_0x4568c9);}})['then'](function(_0x23a99f){if(_0x23a99f){_0x496d13=_0x23a99f['length'];if(!_0x434c30['query']['hasOwnProperty'](_0xbafb('0x3c'))){_0x4568c9[_0xbafb('0x22')]=qs['limit'](_0x434c30[_0xbafb('0x35')][_0xbafb('0x22')]);_0x4568c9[_0xbafb('0x3d')]=qs['offset'](_0x434c30[_0xbafb('0x35')][_0xbafb('0x3d')]);}return _0x8a6652[_0xbafb('0x90')](_0x4568c9);}})[_0xbafb('0x29')](function(_0x513e2f){if(_0x513e2f){return _0x513e2f?{'count':_0x496d13,'rows':_0x513e2f}:null;}})['then'](respondWithResult(_0x5c49f9,null))[_0xbafb('0x4b')](handleError(_0x5c49f9,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f511d37..ebd2354 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 _0x4165=['../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty','hook','events'];(function(_0x217aad,_0xb7e378){var _0x43703a=function(_0x43cbf0){while(--_0x43cbf0){_0x217aad['push'](_0x217aad['shift']());}};_0x43703a(++_0xb7e378);}(_0x4165,0x18f));var _0x5416=function(_0x2c3f2a,_0xd8283b){_0x2c3f2a=_0x2c3f2a-0x0;var _0x1161a8=_0x4165[_0x2c3f2a];return _0x1161a8;};'use strict';var EventEmitter=require(_0x5416('0x0'));var FaxQueue=require(_0x5416('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5416('0x2')](0x0);var events={'afterCreate':_0x5416('0x3'),'afterUpdate':_0x5416('0x4'),'afterDestroy':_0x5416('0x5')};function emitEvent(_0x47de68){return function(_0x57023a,_0x115346,_0x5c63e2){FaxQueueEvents['emit'](_0x47de68+':'+_0x57023a['id'],_0x57023a);FaxQueueEvents['emit'](_0x47de68,_0x57023a);_0x5c63e2(null);};}for(var e in events){if(events[_0x5416('0x6')](e)){var event=events[e];FaxQueue[_0x5416('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x54f6=['save','update','emit','hasOwnProperty','exports','../../mysqldb','FaxQueue'];(function(_0xf09dee,_0x1eb9ff){var _0x2ed315=function(_0xe9479b){while(--_0xe9479b){_0xf09dee['push'](_0xf09dee['shift']());}};_0x2ed315(++_0x1eb9ff);}(_0x54f6,0x91));var _0x654f=function(_0x45659f,_0x24045a){_0x45659f=_0x45659f-0x0;var _0xb72da9=_0x54f6[_0x45659f];return _0xb72da9;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x654f('0x0'))['db'][_0x654f('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x654f('0x2'),'afterUpdate':_0x654f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4f17fe){return function(_0x3b593a,_0x3734b2,_0x8818ca){FaxQueueEvents[_0x654f('0x4')](_0x4f17fe+':'+_0x3b593a['id'],_0x3b593a);FaxQueueEvents[_0x654f('0x4')](_0x4f17fe,_0x3b593a);_0x8818ca(null);};}for(var e in events){if(events[_0x654f('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x654f('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 8b61f52..ae92d6f 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 _0x163b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','fax_queues','util','../../config/logger'];(function(_0x279039,_0x43b1db){var _0xa1f0e0=function(_0x9db49){while(--_0x9db49){_0x279039['push'](_0x279039['shift']());}};_0xa1f0e0(++_0x43b1db);}(_0x163b,0xfa));var _0xb163=function(_0x4c70a1,_0x38d5a0){_0x4c70a1=_0x4c70a1-0x0;var _0x58091d=_0x163b[_0x4c70a1];return _0x58091d;};'use strict';var _=require('lodash');var util=require(_0xb163('0x0'));var logger=require(_0xb163('0x1'))(_0xb163('0x2'));var moment=require(_0xb163('0x3'));var BPromise=require(_0xb163('0x4'));var rp=require(_0xb163('0x5'));var fs=require('fs');var path=require(_0xb163('0x6'));var rimraf=require(_0xb163('0x7'));var config=require(_0xb163('0x8'));var attributes=require(_0xb163('0x9'));module[_0xb163('0xa')]=function(_0x2c9b74,_0xf0d05d){return _0x2c9b74['define']('FaxQueue',attributes,{'tableName':_0xb163('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['api','request-promise','path','rimraf','./faxQueue.attributes','define','FaxQueue','fax_queues','util'];(function(_0xadc313,_0x35819e){var _0x451419=function(_0x314a1f){while(--_0x314a1f){_0xadc313['push'](_0xadc313['shift']());}};_0x451419(++_0x35819e);}(_0x46ed,0x104));var _0xd46e=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x46ed[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0xd46e('0x0'));var logger=require('../../config/logger')(_0xd46e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd46e('0x2'));var fs=require('fs');var path=require(_0xd46e('0x3'));var rimraf=require(_0xd46e('0x4'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x5'));module['exports']=function(_0x336d4c,_0x49ee8b){return _0x336d4c[_0xd46e('0x6')](_0xd46e('0x7'),attributes,{'tableName':_0xd46e('0x8'),'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 75e985a..e99b381 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 _0x8826=['raw','where','attributes','limit','include','map','model','catch','find','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','FaxQueue','findAll','options'];(function(_0x53a24e,_0x2f4d63){var _0x197991=function(_0x18ea2e){while(--_0x18ea2e){_0x53a24e['push'](_0x53a24e['shift']());}};_0x197991(++_0x2f4d63);}(_0x8826,0x106));var _0x6882=function(_0x1c5ea8,_0x25c5c5){_0x1c5ea8=_0x1c5ea8-0x0;var _0x20b5b9=_0x8826[_0x1c5ea8];return _0x20b5b9;};'use strict';var _=require(_0x6882('0x0'));var util=require(_0x6882('0x1'));var moment=require(_0x6882('0x2'));var BPromise=require(_0x6882('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6882('0x4'));var db=require(_0x6882('0x5'))['db'];var utils=require(_0x6882('0x6'));var logger=require(_0x6882('0x7'))(_0x6882('0x8'));var config=require(_0x6882('0x9'));var jayson=require(_0x6882('0xa'));var client=jayson[_0x6882('0xb')][_0x6882('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6882('0xd')],{'host':_0x6882('0xe'),'port':0x18eb});var socket=require(_0x6882('0xf'))(new Redis(config[_0x6882('0xd')]));require(_0x6882('0x10'))['register'](socket);function respondWithRpcPromise(_0x46f0cb,_0x34dc3c,_0x33872e){return new BPromise(function(_0x360212,_0x422019){return client['request'](_0x46f0cb,_0x33872e)[_0x6882('0x11')](function(_0x4da9b0){logger[_0x6882('0x12')]('FaxQueue,\x20%s,\x20%s',_0x34dc3c,_0x6882('0x13'));logger[_0x6882('0x14')](_0x6882('0x15'),_0x34dc3c,_0x6882('0x13'),JSON[_0x6882('0x16')](_0x4da9b0));if(_0x4da9b0[_0x6882('0x17')]){if(_0x4da9b0[_0x6882('0x17')][_0x6882('0x18')]===0x1f4){logger[_0x6882('0x17')](_0x6882('0x19'),_0x34dc3c,_0x4da9b0['error'][_0x6882('0x1a')]);return _0x422019(_0x4da9b0['error'][_0x6882('0x1a')]);}logger[_0x6882('0x17')](_0x6882('0x19'),_0x34dc3c,_0x4da9b0[_0x6882('0x17')][_0x6882('0x1a')]);return _0x360212(_0x4da9b0[_0x6882('0x17')][_0x6882('0x1a')]);}else{logger[_0x6882('0x12')](_0x6882('0x19'),_0x34dc3c,_0x6882('0x13'));_0x360212(_0x4da9b0[_0x6882('0x1b')][_0x6882('0x1a')]);}})['catch'](function(_0x232bb2){logger['error'](_0x6882('0x19'),_0x34dc3c,_0x232bb2);_0x422019(_0x232bb2);});});}exports[_0x6882('0x1c')]=function(_0x298fe6){var _0xc66ac4=this;return new Promise(function(_0x4ded28,_0x3f76ac){return db[_0x6882('0x1d')][_0x6882('0x1e')]({'raw':_0x298fe6[_0x6882('0x1f')]?_0x298fe6[_0x6882('0x1f')][_0x6882('0x20')]===undefined?!![]:![]:!![],'where':_0x298fe6[_0x6882('0x1f')]?_0x298fe6[_0x6882('0x1f')][_0x6882('0x21')]||null:null,'attributes':_0x298fe6[_0x6882('0x1f')]?_0x298fe6[_0x6882('0x1f')][_0x6882('0x22')]||null:null,'limit':_0x298fe6[_0x6882('0x1f')]?_0x298fe6[_0x6882('0x1f')][_0x6882('0x23')]||null:null,'include':_0x298fe6[_0x6882('0x1f')]?_0x298fe6['options'][_0x6882('0x24')]?_[_0x6882('0x25')](_0x298fe6['options']['include'],function(_0x5215f7){return{'model':db[_0x5215f7[_0x6882('0x26')]],'as':_0x5215f7['as'],'attributes':_0x5215f7[_0x6882('0x22')],'include':_0x5215f7[_0x6882('0x24')]?_[_0x6882('0x25')](_0x5215f7[_0x6882('0x24')],function(_0x1d6940){return{'model':db[_0x1d6940[_0x6882('0x26')]],'as':_0x1d6940['as'],'attributes':_0x1d6940[_0x6882('0x22')],'include':_0x1d6940[_0x6882('0x24')]?_['map'](_0x1d6940[_0x6882('0x24')],function(_0x1b4685){return{'model':db[_0x1b4685[_0x6882('0x26')]],'as':_0x1b4685['as'],'attributes':_0x1b4685[_0x6882('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6882('0x11')](function(_0x12572b){logger[_0x6882('0x12')](_0x6882('0x1c'),_0x298fe6);logger[_0x6882('0x14')](_0x6882('0x1c'),_0x298fe6,JSON[_0x6882('0x16')](_0x12572b));_0x4ded28(_0x12572b);})[_0x6882('0x27')](function(_0x9e0e55){logger[_0x6882('0x17')](_0x6882('0x1c'),_0x9e0e55[_0x6882('0x1a')],_0x298fe6);_0x3f76ac(_0xc66ac4[_0x6882('0x17')](0x1f4,_0x9e0e55[_0x6882('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x53cbb7){var _0x1a5603=this;return new Promise(function(_0x5420d7,_0x112c9e){return db[_0x6882('0x1d')][_0x6882('0x28')]({'raw':_0x53cbb7[_0x6882('0x1f')]?_0x53cbb7[_0x6882('0x1f')][_0x6882('0x20')]===undefined?!![]:![]:!![],'where':_0x53cbb7[_0x6882('0x1f')]?_0x53cbb7[_0x6882('0x1f')][_0x6882('0x21')]||null:null,'attributes':_0x53cbb7[_0x6882('0x1f')]?_0x53cbb7[_0x6882('0x1f')][_0x6882('0x22')]||null:null,'include':_0x53cbb7[_0x6882('0x1f')]?_0x53cbb7[_0x6882('0x1f')][_0x6882('0x24')]?_[_0x6882('0x25')](_0x53cbb7[_0x6882('0x1f')][_0x6882('0x24')],function(_0x21d443){return{'model':db[_0x21d443['model']],'as':_0x21d443['as'],'attributes':_0x21d443[_0x6882('0x22')],'include':_0x21d443[_0x6882('0x24')]?_['map'](_0x21d443['include'],function(_0x55056b){return{'model':db[_0x55056b['model']],'as':_0x55056b['as'],'attributes':_0x55056b[_0x6882('0x22')],'include':_0x55056b[_0x6882('0x24')]?_[_0x6882('0x25')](_0x55056b[_0x6882('0x24')],function(_0xb46a47){return{'model':db[_0xb46a47['model']],'as':_0xb46a47['as'],'attributes':_0xb46a47[_0x6882('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6882('0x11')](function(_0xf18bfd){logger[_0x6882('0x12')](_0x6882('0x29'),_0x53cbb7);logger[_0x6882('0x14')](_0x6882('0x29'),_0x53cbb7,JSON['stringify'](_0xf18bfd));_0x5420d7(_0xf18bfd);})['catch'](function(_0x52b515){logger['error'](_0x6882('0x29'),_0x52b515['message'],_0x53cbb7);_0x112c9e(_0x1a5603[_0x6882('0x17')](0x1f4,_0x52b515[_0x6882('0x1a')]));});});}; \ No newline at end of file +var _0x67a5=['localhost','socket.io-emitter','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','map','model','ShowFaxQueue','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x1f420c,_0x3ec48e){var _0x4fd002=function(_0x1cdbdd){while(--_0x1cdbdd){_0x1f420c['push'](_0x1f420c['shift']());}};_0x4fd002(++_0x3ec48e);}(_0x67a5,0xb5));var _0x567a=function(_0x57ea33,_0x344bf2){_0x57ea33=_0x57ea33-0x0;var _0x448e62=_0x67a5[_0x57ea33];return _0x448e62;};'use strict';var _=require(_0x567a('0x0'));var util=require(_0x567a('0x1'));var moment=require(_0x567a('0x2'));var BPromise=require(_0x567a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x567a('0x4'));var db=require(_0x567a('0x5'))['db'];var utils=require(_0x567a('0x6'));var logger=require(_0x567a('0x7'))(_0x567a('0x8'));var config=require('../../config/environment');var jayson=require(_0x567a('0x9'));var client=jayson[_0x567a('0xa')][_0x567a('0xb')]({'port':0x232a});config[_0x567a('0xc')]=_[_0x567a('0xd')](config[_0x567a('0xc')],{'host':_0x567a('0xe'),'port':0x18eb});var socket=require(_0x567a('0xf'))(new Redis(config[_0x567a('0xc')]));require(_0x567a('0x10'))['register'](socket);function respondWithRpcPromise(_0x452ae0,_0x22161d,_0x45ef93){return new BPromise(function(_0x39ab4f,_0x14fa9b){return client[_0x567a('0x11')](_0x452ae0,_0x45ef93)[_0x567a('0x12')](function(_0x2e61cf){logger['info'](_0x567a('0x13'),_0x22161d,_0x567a('0x14'));logger[_0x567a('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x22161d,_0x567a('0x14'),JSON[_0x567a('0x16')](_0x2e61cf));if(_0x2e61cf[_0x567a('0x17')]){if(_0x2e61cf[_0x567a('0x17')][_0x567a('0x18')]===0x1f4){logger[_0x567a('0x17')](_0x567a('0x13'),_0x22161d,_0x2e61cf[_0x567a('0x17')][_0x567a('0x19')]);return _0x14fa9b(_0x2e61cf[_0x567a('0x17')][_0x567a('0x19')]);}logger[_0x567a('0x17')](_0x567a('0x13'),_0x22161d,_0x2e61cf[_0x567a('0x17')][_0x567a('0x19')]);return _0x39ab4f(_0x2e61cf[_0x567a('0x17')][_0x567a('0x19')]);}else{logger[_0x567a('0x1a')](_0x567a('0x13'),_0x22161d,_0x567a('0x14'));_0x39ab4f(_0x2e61cf['result']['message']);}})[_0x567a('0x1b')](function(_0x8c216a){logger[_0x567a('0x17')](_0x567a('0x13'),_0x22161d,_0x8c216a);_0x14fa9b(_0x8c216a);});});}exports[_0x567a('0x1c')]=function(_0x27b366){var _0x30a12d=this;return new Promise(function(_0x45675e,_0x32c69b){return db[_0x567a('0x1d')][_0x567a('0x1e')]({'raw':_0x27b366[_0x567a('0x1f')]?_0x27b366[_0x567a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x27b366[_0x567a('0x1f')]?_0x27b366['options'][_0x567a('0x20')]||null:null,'attributes':_0x27b366[_0x567a('0x1f')]?_0x27b366['options'][_0x567a('0x21')]||null:null,'limit':_0x27b366[_0x567a('0x1f')]?_0x27b366[_0x567a('0x1f')]['limit']||null:null,'include':_0x27b366['options']?_0x27b366[_0x567a('0x1f')][_0x567a('0x22')]?_[_0x567a('0x23')](_0x27b366[_0x567a('0x1f')][_0x567a('0x22')],function(_0x388758){return{'model':db[_0x388758[_0x567a('0x24')]],'as':_0x388758['as'],'attributes':_0x388758[_0x567a('0x21')],'include':_0x388758['include']?_[_0x567a('0x23')](_0x388758[_0x567a('0x22')],function(_0x444240){return{'model':db[_0x444240['model']],'as':_0x444240['as'],'attributes':_0x444240['attributes'],'include':_0x444240[_0x567a('0x22')]?_[_0x567a('0x23')](_0x444240[_0x567a('0x22')],function(_0x106c1e){return{'model':db[_0x106c1e['model']],'as':_0x106c1e['as'],'attributes':_0x106c1e['attributes']};}):[]};}):[]};}):[]:[]})[_0x567a('0x12')](function(_0x42f335){logger['info'](_0x567a('0x1c'),_0x27b366);logger[_0x567a('0x15')](_0x567a('0x1c'),_0x27b366,JSON[_0x567a('0x16')](_0x42f335));_0x45675e(_0x42f335);})[_0x567a('0x1b')](function(_0x336bbf){logger[_0x567a('0x17')](_0x567a('0x1c'),_0x336bbf[_0x567a('0x19')],_0x27b366);_0x32c69b(_0x30a12d[_0x567a('0x17')](0x1f4,_0x336bbf['message']));});});};exports[_0x567a('0x25')]=function(_0x204a67){var _0x41c289=this;return new Promise(function(_0x4b2c53,_0x2b2371){return db[_0x567a('0x1d')]['find']({'raw':_0x204a67[_0x567a('0x1f')]?_0x204a67[_0x567a('0x1f')][_0x567a('0x26')]===undefined?!![]:![]:!![],'where':_0x204a67[_0x567a('0x1f')]?_0x204a67['options'][_0x567a('0x20')]||null:null,'attributes':_0x204a67[_0x567a('0x1f')]?_0x204a67[_0x567a('0x1f')][_0x567a('0x21')]||null:null,'include':_0x204a67['options']?_0x204a67[_0x567a('0x1f')][_0x567a('0x22')]?_[_0x567a('0x23')](_0x204a67['options'][_0x567a('0x22')],function(_0x1c0882){return{'model':db[_0x1c0882[_0x567a('0x24')]],'as':_0x1c0882['as'],'attributes':_0x1c0882[_0x567a('0x21')],'include':_0x1c0882[_0x567a('0x22')]?_[_0x567a('0x23')](_0x1c0882[_0x567a('0x22')],function(_0xa57b9c){return{'model':db[_0xa57b9c[_0x567a('0x24')]],'as':_0xa57b9c['as'],'attributes':_0xa57b9c['attributes'],'include':_0xa57b9c[_0x567a('0x22')]?_[_0x567a('0x23')](_0xa57b9c['include'],function(_0x9603c0){return{'model':db[_0x9603c0[_0x567a('0x24')]],'as':_0x9603c0['as'],'attributes':_0x9603c0[_0x567a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x567a('0x12')](function(_0x428edd){logger[_0x567a('0x1a')](_0x567a('0x25'),_0x204a67);logger[_0x567a('0x15')](_0x567a('0x25'),_0x204a67,JSON[_0x567a('0x16')](_0x428edd));_0x4b2c53(_0x428edd);})[_0x567a('0x1b')](function(_0x2b7157){logger[_0x567a('0x17')]('ShowFaxQueue',_0x2b7157[_0x567a('0x19')],_0x204a67);_0x2b2371(_0x41c289[_0x567a('0x17')](0x1f4,_0x2b7157[_0x567a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 8bf869c..dcdca00 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 _0xcc18=['faxQueue:','./faxQueue.events','remove','emit','removeListener','register','length'];(function(_0x1b4408,_0x261ad0){var _0xc893ec=function(_0x460aea){while(--_0x460aea){_0x1b4408['push'](_0x1b4408['shift']());}};_0xc893ec(++_0x261ad0);}(_0xcc18,0x1e4));var _0x8cc1=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xcc18[_0x342baa];return _0x1208f3;};'use strict';var FaxQueueEvents=require(_0x8cc1('0x0'));var events=['save',_0x8cc1('0x1'),'update'];function createListener(_0x50a06e,_0x52142b){return function(_0x1690af){_0x52142b[_0x8cc1('0x2')](_0x50a06e,_0x1690af);};}function removeListener(_0x2393dc,_0x4c78d9){return function(){FaxQueueEvents[_0x8cc1('0x3')](_0x2393dc,_0x4c78d9);};}exports[_0x8cc1('0x4')]=function(_0x4ade0d){for(var _0x17cade=0x0,_0x22937d=events[_0x8cc1('0x5')];_0x17cade<_0x22937d;_0x17cade++){var _0x284a7c=events[_0x17cade];var _0x3cdcf5=createListener(_0x8cc1('0x6')+_0x284a7c,_0x4ade0d);FaxQueueEvents['on'](_0x284a7c,_0x3cdcf5);}}; \ No newline at end of file +var _0xc5dc=['removeListener','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5dc,0x128));var _0xcc5d=function(_0x506d68,_0x3a4903){_0x506d68=_0x506d68-0x0;var _0x3d268d=_0xc5dc[_0x506d68];return _0x3d268d;};'use strict';var FaxQueueEvents=require(_0xcc5d('0x0'));var events=[_0xcc5d('0x1'),_0xcc5d('0x2'),_0xcc5d('0x3')];function createListener(_0x363cad,_0x468c7f){return function(_0x2dcbbf){_0x468c7f[_0xcc5d('0x4')](_0x363cad,_0x2dcbbf);};}function removeListener(_0x14e58c,_0x373967){return function(){FaxQueueEvents[_0xcc5d('0x5')](_0x14e58c,_0x373967);};}exports['register']=function(_0x237c0d){for(var _0xcd601e=0x0,_0x44026e=events['length'];_0xcd601e<_0x44026e;_0xcd601e++){var _0x58c833=events[_0xcd601e];var _0x4a3e1f=createListener(_0xcc5d('0x6')+_0x58c833,_0x237c0d);FaxQueueEvents['on'](_0x58c833,_0x4a3e1f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index bf285ee..1d7d261 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 _0x27a0=['/:id/users','getAgents','post','addTeams','addAgents','update','destroy','delete','exports','util','path','connect-timeout','express','Router','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x27a0,0xbf));var _0x027a=function(_0x484869,_0x38cfe4){_0x484869=_0x484869-0x0;var _0x4d6037=_0x27a0[_0x484869];return _0x4d6037;};'use strict';var multer=require('multer');var util=require(_0x027a('0x0'));var path=require(_0x027a('0x1'));var timeout=require(_0x027a('0x2'));var express=require(_0x027a('0x3'));var router=express[_0x027a('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(_0x027a('0x5'));router[_0x027a('0x6')]('/',auth[_0x027a('0x7')](),controller[_0x027a('0x8')]);router[_0x027a('0x6')](_0x027a('0x9'),auth['isAuthenticated'](),controller[_0x027a('0xa')]);router[_0x027a('0x6')](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0xc')]);router[_0x027a('0x6')](_0x027a('0xd'),auth['isAuthenticated'](),controller[_0x027a('0xe')]);router[_0x027a('0x6')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller[_0x027a('0x10')]);router[_0x027a('0x6')](_0x027a('0x11'),auth[_0x027a('0x7')](),controller[_0x027a('0x12')]);router[_0x027a('0x13')]('/',auth[_0x027a('0x7')](),controller['create']);router[_0x027a('0x13')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller[_0x027a('0x14')]);router[_0x027a('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x027a('0x15')]);router['put'](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x027a('0x17')]);router[_0x027a('0x18')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller['removeTeams']);router[_0x027a('0x18')](_0x027a('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x027a('0x19')]=router; \ No newline at end of file +var _0x2da6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','multer','util','path'];(function(_0x1dc5b0,_0xf88152){var _0x506fb0=function(_0x1600be){while(--_0x1600be){_0x1dc5b0['push'](_0x1dc5b0['shift']());}};_0x506fb0(++_0xf88152);}(_0x2da6,0x1dd));var _0x62da=function(_0x2d7f2c,_0x113b24){_0x2d7f2c=_0x2d7f2c-0x0;var _0x2c3d45=_0x2da6[_0x2d7f2c];return _0x2c3d45;};'use strict';var multer=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var path=require(_0x62da('0x2'));var timeout=require(_0x62da('0x3'));var express=require(_0x62da('0x4'));var router=express[_0x62da('0x5')]();var fs_extra=require(_0x62da('0x6'));var auth=require(_0x62da('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x62da('0x8'));router[_0x62da('0x9')]('/',auth[_0x62da('0xa')](),controller[_0x62da('0xb')]);router[_0x62da('0x9')](_0x62da('0xc'),auth[_0x62da('0xa')](),controller[_0x62da('0xd')]);router[_0x62da('0x9')]('/:id',auth[_0x62da('0xa')](),controller[_0x62da('0xe')]);router[_0x62da('0x9')](_0x62da('0xf'),auth['isAuthenticated'](),controller[_0x62da('0x10')]);router[_0x62da('0x9')](_0x62da('0x11'),auth[_0x62da('0xa')](),controller[_0x62da('0x12')]);router['get'](_0x62da('0x13'),auth[_0x62da('0xa')](),controller[_0x62da('0x14')]);router[_0x62da('0x15')]('/',auth[_0x62da('0xa')](),controller['create']);router['post'](_0x62da('0x11'),auth[_0x62da('0xa')](),controller[_0x62da('0x16')]);router[_0x62da('0x15')](_0x62da('0x13'),auth[_0x62da('0xa')](),controller[_0x62da('0x17')]);router[_0x62da('0x18')](_0x62da('0x19'),auth[_0x62da('0xa')](),controller[_0x62da('0x1a')]);router[_0x62da('0x1b')](_0x62da('0x19'),auth[_0x62da('0xa')](),controller['destroy']);router['delete'](_0x62da('0x11'),auth['isAuthenticated'](),controller[_0x62da('0x1c')]);router[_0x62da('0x1b')](_0x62da('0x13'),auth['isAuthenticated'](),controller[_0x62da('0x1d')]);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 8c02c93..ee75357 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 _0x2bb6=['DATE','moment','STRING'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x2bb6,0xfd));var _0x62bb=function(_0x42506a,_0x18914e){_0x42506a=_0x42506a-0x0;var _0x52d1ac=_0x2bb6[_0x42506a];return _0x52d1ac;};'use strict';var moment=require(_0x62bb('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x62bb('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x62bb('0x1')]},'joinAt':{'type':Sequelize[_0x62bb('0x2')]},'leaveAt':{'type':Sequelize[_0x62bb('0x2')]},'acceptAt':{'type':Sequelize[_0x62bb('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x62bb('0x1')]}}; \ No newline at end of file +var _0x3975=['sequelize','STRING','DATE','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3975,0x197));var _0x5397=function(_0x4463d0,_0x1c7736){_0x4463d0=_0x4463d0-0x0;var _0x4aae13=_0x3975[_0x4463d0];return _0x4aae13;};'use strict';var moment=require(_0x5397('0x0'));var Sequelize=require(_0x5397('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5397('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5397('0x3')]},'acceptAt':{'type':Sequelize[_0x5397('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5397('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index fcfe55b..37d2de6 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 _0x1a5c=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','FaxQueueReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','keys','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5217e2,_0x15c6f1){var _0x2da0b4=function(_0x437fc2){while(--_0x437fc2){_0x5217e2['push'](_0x5217e2['shift']());}};_0x2da0b4(++_0x15c6f1);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x1a5c[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0xc1a5('0x0'));var rimraf=require(_0xc1a5('0x1'));var zipdir=require(_0xc1a5('0x2'));var jsonpatch=require(_0xc1a5('0x3'));var rp=require(_0xc1a5('0x4'));var moment=require(_0xc1a5('0x5'));var BPromise=require(_0xc1a5('0x6'));var Mustache=require(_0xc1a5('0x7'));var util=require(_0xc1a5('0x8'));var path=require(_0xc1a5('0x9'));var sox=require('sox');var csv=require(_0xc1a5('0xa'));var ejs=require(_0xc1a5('0xb'));var fs=require('fs');var fs_extra=require(_0xc1a5('0xc'));var _=require(_0xc1a5('0xd'));var squel=require(_0xc1a5('0xe'));var crypto=require(_0xc1a5('0xf'));var jsforce=require(_0xc1a5('0x10'));var deskjs=require(_0xc1a5('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc1a5('0x12'));var Papa=require(_0xc1a5('0x13'));var Redis=require('ioredis');var authService=require(_0xc1a5('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1a5('0x15'));var logger=require(_0xc1a5('0x16'))('api');var utils=require(_0xc1a5('0x17'));var config=require(_0xc1a5('0x18'));var licenseUtil=require(_0xc1a5('0x19'));var db=require(_0xc1a5('0x1a'))['db'];function respondWithStatusCode(_0x1fb066,_0x52fe6d){_0x52fe6d=_0x52fe6d||0xcc;return function(_0x428ccf){if(_0x428ccf){return _0x1fb066[_0xc1a5('0x1b')](_0x52fe6d);}return _0x1fb066[_0xc1a5('0x1c')](_0x52fe6d)[_0xc1a5('0x1d')]();};}function respondWithResult(_0x1aec58,_0x1dabb5){_0x1dabb5=_0x1dabb5||0xc8;return function(_0x24e513){if(_0x24e513){return _0x1aec58[_0xc1a5('0x1c')](_0x1dabb5)[_0xc1a5('0x1e')](_0x24e513);}};}function respondWithFilteredResult(_0x4fcced,_0x4b2590){return function(_0x1b2cfb){if(_0x1b2cfb){var _0xfdb88e=typeof _0x4b2590[_0xc1a5('0x1f')]==='undefined'&&typeof _0x4b2590[_0xc1a5('0x20')]===_0xc1a5('0x21');var _0x21faf9=_0x1b2cfb['count'];var _0x82766f=_0xfdb88e?0x0:_0x4b2590['offset'];var _0x294e92=_0xfdb88e?_0x1b2cfb[_0xc1a5('0x22')]:_0x4b2590[_0xc1a5('0x1f')]+_0x4b2590[_0xc1a5('0x20')];var _0xcbdda5;if(_0x294e92>=_0x21faf9){_0x294e92=_0x21faf9;_0xcbdda5=0xc8;}else{_0xcbdda5=0xce;}_0x4fcced[_0xc1a5('0x1c')](_0xcbdda5);return _0x4fcced[_0xc1a5('0x23')](_0xc1a5('0x24'),_0x82766f+'-'+_0x294e92+'/'+_0x21faf9)[_0xc1a5('0x1e')](_0x1b2cfb);}return null;};}function patchUpdates(_0x1f327c){return function(_0x45a3f5){try{jsonpatch[_0xc1a5('0x25')](_0x45a3f5,_0x1f327c,!![]);}catch(_0x6452c7){return BPromise[_0xc1a5('0x26')](_0x6452c7);}return _0x45a3f5['save']();};}function saveUpdates(_0xb93792,_0x12002d){return function(_0x4b424c){if(_0x4b424c){return _0x4b424c[_0xc1a5('0x27')](_0xb93792)[_0xc1a5('0x28')](function(_0x283599){return _0x283599;});}return null;};}function removeEntity(_0x2a8ee8,_0x232666){return function(_0x2e2351){if(_0x2e2351){return _0x2e2351[_0xc1a5('0x29')]()[_0xc1a5('0x28')](function(){_0x2a8ee8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b19c5,_0x259c22){return function(_0x2d3a61){if(!_0x2d3a61){_0x2b19c5['sendStatus'](0x194);}return _0x2d3a61;};}function handleError(_0x1b3b91,_0x4f5cc9){_0x4f5cc9=_0x4f5cc9||0x1f4;return function(_0x5aba6b){logger[_0xc1a5('0x2a')](_0x5aba6b[_0xc1a5('0x2b')]);if(_0x5aba6b[_0xc1a5('0x2c')]){delete _0x5aba6b[_0xc1a5('0x2c')];}_0x1b3b91['status'](_0x4f5cc9)['send'](_0x5aba6b);};}exports['index']=function(_0x1fa511,_0x56b32a){var _0x207a88={},_0x4dc158={},_0x2bef7a={'count':0x0,'rows':[]};var _0x3ba741=_[_0xc1a5('0x2d')](db[_0xc1a5('0x2e')]['rawAttributes'],function(_0x4d7542){return{'name':_0x4d7542[_0xc1a5('0x2f')],'type':_0x4d7542['type'][_0xc1a5('0x30')]};});_0x4dc158[_0xc1a5('0x31')]=_[_0xc1a5('0x2d')](_0x3ba741,_0xc1a5('0x2c'));_0x4dc158['query']=_['keys'](_0x1fa511[_0xc1a5('0x32')]);_0x4dc158[_0xc1a5('0x33')]=_[_0xc1a5('0x34')](_0x4dc158[_0xc1a5('0x31')],_0x4dc158[_0xc1a5('0x32')]);_0x207a88[_0xc1a5('0x35')]=_[_0xc1a5('0x34')](_0x4dc158[_0xc1a5('0x31')],qs[_0xc1a5('0x36')](_0x1fa511[_0xc1a5('0x32')][_0xc1a5('0x36')]));_0x207a88[_0xc1a5('0x35')]=_0x207a88[_0xc1a5('0x35')][_0xc1a5('0x37')]?_0x207a88['attributes']:_0x4dc158[_0xc1a5('0x31')];if(!_0x1fa511[_0xc1a5('0x32')][_0xc1a5('0x38')](_0xc1a5('0x39'))){_0x207a88[_0xc1a5('0x20')]=qs[_0xc1a5('0x20')](_0x1fa511['query'][_0xc1a5('0x20')]);_0x207a88[_0xc1a5('0x1f')]=qs[_0xc1a5('0x1f')](_0x1fa511[_0xc1a5('0x32')]['offset']);}_0x207a88[_0xc1a5('0x3a')]=qs[_0xc1a5('0x3b')](_0x1fa511[_0xc1a5('0x32')]['sort']);_0x207a88['where']=qs[_0xc1a5('0x33')](_[_0xc1a5('0x3c')](_0x1fa511['query'],_0x4dc158[_0xc1a5('0x33')]),_0x3ba741);if(_0x1fa511['query']['filter']){_0x207a88[_0xc1a5('0x3d')]=_[_0xc1a5('0x3e')](_0x207a88[_0xc1a5('0x3d')],{'$or':_[_0xc1a5('0x2d')](_0x3ba741,function(_0x2daaba){if(_0x2daaba['type']!==_0xc1a5('0x3f')){var _0x41aed1={};_0x41aed1[_0x2daaba[_0xc1a5('0x2c')]]={'$like':'%'+_0x1fa511[_0xc1a5('0x32')]['filter']+'%'};return _0x41aed1;}})});}_0x207a88=_[_0xc1a5('0x3e')]({},_0x207a88,_0x1fa511[_0xc1a5('0x40')]);var _0x777914={'where':_0x207a88[_0xc1a5('0x3d')]};return db[_0xc1a5('0x2e')][_0xc1a5('0x22')](_0x777914)[_0xc1a5('0x28')](function(_0x5842e7){_0x2bef7a['count']=_0x5842e7;if(_0x1fa511[_0xc1a5('0x32')][_0xc1a5('0x41')]){_0x207a88[_0xc1a5('0x42')]=[{'all':!![]}];}return db[_0xc1a5('0x2e')][_0xc1a5('0x43')](_0x207a88);})[_0xc1a5('0x28')](function(_0x2f3c62){_0x2bef7a[_0xc1a5('0x44')]=_0x2f3c62;return _0x2bef7a;})['then'](respondWithFilteredResult(_0x56b32a,_0x207a88))['catch'](handleError(_0x56b32a,null));};exports['show']=function(_0x4e5b97,_0x2aaf8f){var _0x1089d2={'raw':!![],'where':{'id':_0x4e5b97['params']['id']}},_0x169aa7={};_0x169aa7[_0xc1a5('0x31')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x169aa7[_0xc1a5('0x32')]=_[_0xc1a5('0x45')](_0x4e5b97[_0xc1a5('0x32')]);_0x169aa7[_0xc1a5('0x33')]=_[_0xc1a5('0x34')](_0x169aa7[_0xc1a5('0x31')],_0x169aa7['query']);_0x1089d2[_0xc1a5('0x35')]=_[_0xc1a5('0x34')](_0x169aa7[_0xc1a5('0x31')],qs[_0xc1a5('0x36')](_0x4e5b97[_0xc1a5('0x32')][_0xc1a5('0x36')]));_0x1089d2['attributes']=_0x1089d2[_0xc1a5('0x35')][_0xc1a5('0x37')]?_0x1089d2[_0xc1a5('0x35')]:_0x169aa7[_0xc1a5('0x31')];if(_0x4e5b97['query']['includeAll']){_0x1089d2[_0xc1a5('0x42')]=[{'all':!![]}];}_0x1089d2=_['merge']({},_0x1089d2,_0x4e5b97['options']);return db[_0xc1a5('0x2e')][_0xc1a5('0x46')](_0x1089d2)['then'](handleEntityNotFound(_0x2aaf8f,null))[_0xc1a5('0x28')](respondWithResult(_0x2aaf8f,null))[_0xc1a5('0x47')](handleError(_0x2aaf8f,null));};exports['create']=function(_0x3f7ffa,_0x509d44){return db[_0xc1a5('0x2e')][_0xc1a5('0x48')](_0x3f7ffa['body'],{})[_0xc1a5('0x28')](respondWithResult(_0x509d44,0xc9))[_0xc1a5('0x47')](handleError(_0x509d44,null));};exports[_0xc1a5('0x27')]=function(_0x6a9a49,_0x336523){if(_0x6a9a49[_0xc1a5('0x49')]['id']){delete _0x6a9a49[_0xc1a5('0x49')]['id'];}return db['FaxQueueReport'][_0xc1a5('0x46')]({'where':{'id':_0x6a9a49[_0xc1a5('0x4a')]['id']}})[_0xc1a5('0x28')](handleEntityNotFound(_0x336523,null))[_0xc1a5('0x28')](saveUpdates(_0x6a9a49[_0xc1a5('0x49')],null))[_0xc1a5('0x28')](respondWithResult(_0x336523,null))['catch'](handleError(_0x336523,null));};exports[_0xc1a5('0x29')]=function(_0x102664,_0x489d49){return db[_0xc1a5('0x2e')][_0xc1a5('0x46')]({'where':{'id':_0x102664['params']['id']}})[_0xc1a5('0x28')](handleEntityNotFound(_0x489d49,null))[_0xc1a5('0x28')](removeEntity(_0x489d49,null))['catch'](handleError(_0x489d49,null));};exports[_0xc1a5('0x4b')]=function(_0x23b8ee,_0x3ac8b6){return db[_0xc1a5('0x2e')][_0xc1a5('0x4b')]()[_0xc1a5('0x28')](respondWithResult(_0x3ac8b6,null))[_0xc1a5('0x47')](handleError(_0x3ac8b6,null));}; \ No newline at end of file +var _0x4ef1=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','FaxQueueReport','includeAll','findAll','rows','catch','show','include','options','create','update','body','find','params'];(function(_0x2faac9,_0x3663a8){var _0x3744ca=function(_0x422093){while(--_0x422093){_0x2faac9['push'](_0x2faac9['shift']());}};_0x3744ca(++_0x3663a8);}(_0x4ef1,0xeb));var _0x14ef=function(_0x257e65,_0x3f4a68){_0x257e65=_0x257e65-0x0;var _0x3eef2f=_0x4ef1[_0x257e65];return _0x3eef2f;};'use strict';var emlformat=require(_0x14ef('0x0'));var rimraf=require(_0x14ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14ef('0x2'));var rp=require(_0x14ef('0x3'));var moment=require(_0x14ef('0x4'));var BPromise=require(_0x14ef('0x5'));var Mustache=require(_0x14ef('0x6'));var util=require(_0x14ef('0x7'));var path=require(_0x14ef('0x8'));var sox=require(_0x14ef('0x9'));var csv=require(_0x14ef('0xa'));var ejs=require(_0x14ef('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14ef('0xc'));var squel=require(_0x14ef('0xd'));var crypto=require('crypto');var jsforce=require(_0x14ef('0xe'));var deskjs=require(_0x14ef('0xf'));var toCsv=require(_0x14ef('0xa'));var querystring=require(_0x14ef('0x10'));var Papa=require(_0x14ef('0x11'));var Redis=require('ioredis');var authService=require(_0x14ef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x14ef('0x13'));var hardwareService=require(_0x14ef('0x14'));var logger=require(_0x14ef('0x15'))(_0x14ef('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x14ef('0x17'));var db=require(_0x14ef('0x18'))['db'];function respondWithStatusCode(_0x4a7610,_0x3cf22b){_0x3cf22b=_0x3cf22b||0xcc;return function(_0x467ffc){if(_0x467ffc){return _0x4a7610[_0x14ef('0x19')](_0x3cf22b);}return _0x4a7610['status'](_0x3cf22b)[_0x14ef('0x1a')]();};}function respondWithResult(_0xbe32b8,_0x2263f1){_0x2263f1=_0x2263f1||0xc8;return function(_0xa9e67d){if(_0xa9e67d){return _0xbe32b8['status'](_0x2263f1)[_0x14ef('0x1b')](_0xa9e67d);}};}function respondWithFilteredResult(_0x14b857,_0x435fc1){return function(_0x20aefa){if(_0x20aefa){var _0x5364e5=typeof _0x435fc1[_0x14ef('0x1c')]===_0x14ef('0x1d')&&typeof _0x435fc1[_0x14ef('0x1e')]===_0x14ef('0x1d');var _0x42f3cc=_0x20aefa[_0x14ef('0x1f')];var _0x17f63a=_0x5364e5?0x0:_0x435fc1[_0x14ef('0x1c')];var _0x19b2cb=_0x5364e5?_0x20aefa[_0x14ef('0x1f')]:_0x435fc1[_0x14ef('0x1c')]+_0x435fc1[_0x14ef('0x1e')];var _0x1fce64;if(_0x19b2cb>=_0x42f3cc){_0x19b2cb=_0x42f3cc;_0x1fce64=0xc8;}else{_0x1fce64=0xce;}_0x14b857[_0x14ef('0x20')](_0x1fce64);return _0x14b857['set']('Content-Range',_0x17f63a+'-'+_0x19b2cb+'/'+_0x42f3cc)[_0x14ef('0x1b')](_0x20aefa);}return null;};}function patchUpdates(_0x34a991){return function(_0x376bac){try{jsonpatch[_0x14ef('0x21')](_0x376bac,_0x34a991,!![]);}catch(_0x4686cf){return BPromise[_0x14ef('0x22')](_0x4686cf);}return _0x376bac[_0x14ef('0x23')]();};}function saveUpdates(_0x11e9a3,_0x52f889){return function(_0x477e18){if(_0x477e18){return _0x477e18['update'](_0x11e9a3)['then'](function(_0xcaf3a6){return _0xcaf3a6;});}return null;};}function removeEntity(_0xd52011,_0x37bb6f){return function(_0x275cc7){if(_0x275cc7){return _0x275cc7[_0x14ef('0x24')]()[_0x14ef('0x25')](function(){_0xd52011[_0x14ef('0x20')](0xcc)[_0x14ef('0x1a')]();});}};}function handleEntityNotFound(_0x45105f,_0x168fa6){return function(_0x582b89){if(!_0x582b89){_0x45105f[_0x14ef('0x19')](0x194);}return _0x582b89;};}function handleError(_0x5cb75d,_0x184f29){_0x184f29=_0x184f29||0x1f4;return function(_0x21a176){logger[_0x14ef('0x26')](_0x21a176[_0x14ef('0x27')]);if(_0x21a176['name']){delete _0x21a176[_0x14ef('0x28')];}_0x5cb75d['status'](_0x184f29)['send'](_0x21a176);};}exports[_0x14ef('0x29')]=function(_0x40d50d,_0x17d961){var _0x344c2a={},_0x38f5e9={},_0x42ef99={'count':0x0,'rows':[]};var _0x215ffd=_[_0x14ef('0x2a')](db['FaxQueueReport'][_0x14ef('0x2b')],function(_0x25f16f){return{'name':_0x25f16f[_0x14ef('0x2c')],'type':_0x25f16f[_0x14ef('0x2d')][_0x14ef('0x2e')]};});_0x38f5e9[_0x14ef('0x2f')]=_[_0x14ef('0x2a')](_0x215ffd,_0x14ef('0x28'));_0x38f5e9[_0x14ef('0x30')]=_[_0x14ef('0x31')](_0x40d50d[_0x14ef('0x30')]);_0x38f5e9['filters']=_['intersection'](_0x38f5e9[_0x14ef('0x2f')],_0x38f5e9[_0x14ef('0x30')]);_0x344c2a[_0x14ef('0x32')]=_[_0x14ef('0x33')](_0x38f5e9['model'],qs['fields'](_0x40d50d[_0x14ef('0x30')][_0x14ef('0x34')]));_0x344c2a[_0x14ef('0x32')]=_0x344c2a[_0x14ef('0x32')][_0x14ef('0x35')]?_0x344c2a[_0x14ef('0x32')]:_0x38f5e9['model'];if(!_0x40d50d[_0x14ef('0x30')][_0x14ef('0x36')](_0x14ef('0x37'))){_0x344c2a['limit']=qs['limit'](_0x40d50d['query'][_0x14ef('0x1e')]);_0x344c2a[_0x14ef('0x1c')]=qs[_0x14ef('0x1c')](_0x40d50d['query']['offset']);}_0x344c2a[_0x14ef('0x38')]=qs['sort'](_0x40d50d[_0x14ef('0x30')][_0x14ef('0x39')]);_0x344c2a[_0x14ef('0x3a')]=qs['filters'](_[_0x14ef('0x3b')](_0x40d50d[_0x14ef('0x30')],_0x38f5e9[_0x14ef('0x3c')]),_0x215ffd);if(_0x40d50d['query'][_0x14ef('0x3d')]){_0x344c2a['where']=_[_0x14ef('0x3e')](_0x344c2a[_0x14ef('0x3a')],{'$or':_[_0x14ef('0x2a')](_0x215ffd,function(_0x7c6f10){if(_0x7c6f10['type']!==_0x14ef('0x3f')){var _0x35115e={};_0x35115e[_0x7c6f10[_0x14ef('0x28')]]={'$like':'%'+_0x40d50d['query'][_0x14ef('0x3d')]+'%'};return _0x35115e;}})});}_0x344c2a=_[_0x14ef('0x3e')]({},_0x344c2a,_0x40d50d['options']);var _0x3ad29b={'where':_0x344c2a['where']};return db[_0x14ef('0x40')][_0x14ef('0x1f')](_0x3ad29b)[_0x14ef('0x25')](function(_0x30cd4c){_0x42ef99['count']=_0x30cd4c;if(_0x40d50d[_0x14ef('0x30')][_0x14ef('0x41')]){_0x344c2a['include']=[{'all':!![]}];}return db[_0x14ef('0x40')][_0x14ef('0x42')](_0x344c2a);})['then'](function(_0x1607bb){_0x42ef99[_0x14ef('0x43')]=_0x1607bb;return _0x42ef99;})[_0x14ef('0x25')](respondWithFilteredResult(_0x17d961,_0x344c2a))[_0x14ef('0x44')](handleError(_0x17d961,null));};exports[_0x14ef('0x45')]=function(_0x29e4d3,_0x28fd92){var _0x20879d={'raw':!![],'where':{'id':_0x29e4d3['params']['id']}},_0x44aec8={};_0x44aec8[_0x14ef('0x2f')]=_[_0x14ef('0x31')](db[_0x14ef('0x40')]['rawAttributes']);_0x44aec8['query']=_[_0x14ef('0x31')](_0x29e4d3['query']);_0x44aec8['filters']=_['intersection'](_0x44aec8[_0x14ef('0x2f')],_0x44aec8[_0x14ef('0x30')]);_0x20879d['attributes']=_[_0x14ef('0x33')](_0x44aec8['model'],qs['fields'](_0x29e4d3['query'][_0x14ef('0x34')]));_0x20879d[_0x14ef('0x32')]=_0x20879d[_0x14ef('0x32')][_0x14ef('0x35')]?_0x20879d[_0x14ef('0x32')]:_0x44aec8['model'];if(_0x29e4d3[_0x14ef('0x30')]['includeAll']){_0x20879d[_0x14ef('0x46')]=[{'all':!![]}];}_0x20879d=_[_0x14ef('0x3e')]({},_0x20879d,_0x29e4d3[_0x14ef('0x47')]);return db[_0x14ef('0x40')]['find'](_0x20879d)[_0x14ef('0x25')](handleEntityNotFound(_0x28fd92,null))['then'](respondWithResult(_0x28fd92,null))[_0x14ef('0x44')](handleError(_0x28fd92,null));};exports[_0x14ef('0x48')]=function(_0x36d767,_0x23b6eb){return db['FaxQueueReport'][_0x14ef('0x48')](_0x36d767['body'],{})['then'](respondWithResult(_0x23b6eb,0xc9))['catch'](handleError(_0x23b6eb,null));};exports[_0x14ef('0x49')]=function(_0x44308f,_0x47a996){if(_0x44308f[_0x14ef('0x4a')]['id']){delete _0x44308f[_0x14ef('0x4a')]['id'];}return db[_0x14ef('0x40')][_0x14ef('0x4b')]({'where':{'id':_0x44308f[_0x14ef('0x4c')]['id']}})[_0x14ef('0x25')](handleEntityNotFound(_0x47a996,null))['then'](saveUpdates(_0x44308f[_0x14ef('0x4a')],null))['then'](respondWithResult(_0x47a996,null))[_0x14ef('0x44')](handleError(_0x47a996,null));};exports[_0x14ef('0x24')]=function(_0x3438f1,_0x306bdd){return db[_0x14ef('0x40')][_0x14ef('0x4b')]({'where':{'id':_0x3438f1[_0x14ef('0x4c')]['id']}})[_0x14ef('0x25')](handleEntityNotFound(_0x306bdd,null))['then'](removeEntity(_0x306bdd,null))[_0x14ef('0x44')](handleError(_0x306bdd,null));};exports[_0x14ef('0x4d')]=function(_0x360290,_0x4b2626){return db[_0x14ef('0x40')][_0x14ef('0x4d')]()[_0x14ef('0x25')](respondWithResult(_0x4b2626,null))[_0x14ef('0x44')](handleError(_0x4b2626,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index af5405b..104abbe 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 _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fd658,_0x16a96b){var _0x8c9953=function(_0x392f05){while(--_0x392f05){_0x1fd658['push'](_0x1fd658['shift']());}};_0x8c9953(++_0x16a96b);}(_0x4975,0x86));var _0x5497=function(_0x56e87b,_0x1a2424){_0x56e87b=_0x56e87b-0x0;var _0x410e43=_0x4975[_0x56e87b];return _0x410e43;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4012a9,_0x247a25){var _0x518be7=function(_0x3a035c){while(--_0x3a035c){_0x4012a9['push'](_0x4012a9['shift']());}};_0x518be7(++_0x247a25);}(_0x4975,0x86));var _0x5497=function(_0x47bf69,_0x1660f6){_0x47bf69=_0x47bf69-0x0;var _0x5d14f1=_0x4975[_0x47bf69];return _0x5d14f1;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('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 1885e7e..bbad77f 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 _0xa083=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','UpdateFaxQueueReport','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x25234c,_0x6b540){var _0x311468=function(_0x5cba90){while(--_0x5cba90){_0x25234c['push'](_0x25234c['shift']());}};_0x311468(++_0x6b540);}(_0xa083,0xe4));var _0x3a08=function(_0x5cbcc1,_0x17d57e){_0x5cbcc1=_0x5cbcc1-0x0;var _0x44bbb3=_0xa083[_0x5cbcc1];return _0x44bbb3;};'use strict';var _=require(_0x3a08('0x0'));var util=require(_0x3a08('0x1'));var moment=require(_0x3a08('0x2'));var BPromise=require(_0x3a08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a08('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a08('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a08('0x6'));var jayson=require(_0x3a08('0x7'));var client=jayson[_0x3a08('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x540f7c,_0x460005,_0x92ebab){return new BPromise(function(_0x18ff85,_0x508e10){return client[_0x3a08('0x9')](_0x540f7c,_0x92ebab)[_0x3a08('0xa')](function(_0x115256){logger[_0x3a08('0xb')](_0x3a08('0xc'),_0x460005,_0x3a08('0xd'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x460005,_0x3a08('0xd'),JSON[_0x3a08('0xe')](_0x115256));if(_0x115256[_0x3a08('0xf')]){if(_0x115256[_0x3a08('0xf')][_0x3a08('0x10')]===0x1f4){logger[_0x3a08('0xf')](_0x3a08('0xc'),_0x460005,_0x115256['error']['message']);return _0x508e10(_0x115256[_0x3a08('0xf')][_0x3a08('0x11')]);}logger[_0x3a08('0xf')](_0x3a08('0xc'),_0x460005,_0x115256[_0x3a08('0xf')][_0x3a08('0x11')]);return _0x18ff85(_0x115256[_0x3a08('0xf')][_0x3a08('0x11')]);}else{logger[_0x3a08('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x460005,_0x3a08('0xd'));_0x18ff85(_0x115256[_0x3a08('0x12')][_0x3a08('0x11')]);}})[_0x3a08('0x13')](function(_0x1ff75a){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x460005,_0x1ff75a);_0x508e10(_0x1ff75a);});});}exports[_0x3a08('0x14')]=function(_0x83e38){var _0x4b7674=this;return new Promise(function(_0x31634f,_0x5829da){return db[_0x3a08('0x15')][_0x3a08('0x16')](_0x83e38[_0x3a08('0x17')],{'raw':_0x83e38[_0x3a08('0x18')]?_0x83e38[_0x3a08('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3a08('0xa')](function(_0x328e43){logger[_0x3a08('0xb')](_0x3a08('0x14'),_0x83e38);logger[_0x3a08('0x19')](_0x3a08('0x14'),_0x83e38,JSON[_0x3a08('0xe')](_0x328e43));_0x31634f(_0x328e43);})[_0x3a08('0x13')](function(_0x52bc77){logger[_0x3a08('0xf')](_0x3a08('0x14'),_0x52bc77[_0x3a08('0x11')],_0x83e38);_0x5829da(_0x4b7674[_0x3a08('0xf')](0x1f4,_0x52bc77[_0x3a08('0x11')]));});});};exports[_0x3a08('0x1a')]=function(_0x10f61a){var _0x3a88bc=this;return new Promise(function(_0x883cff,_0x1222a5){return db[_0x3a08('0x15')]['update'](_0x10f61a[_0x3a08('0x17')],{'raw':_0x10f61a[_0x3a08('0x18')]?_0x10f61a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10f61a[_0x3a08('0x18')]?_0x10f61a['options'][_0x3a08('0x1b')]||null:null,'attributes':_0x10f61a[_0x3a08('0x18')]?_0x10f61a[_0x3a08('0x18')][_0x3a08('0x1c')]||null:null,'limit':_0x10f61a[_0x3a08('0x18')]?_0x10f61a[_0x3a08('0x18')][_0x3a08('0x1d')]||null:null})[_0x3a08('0xa')](function(_0x3f8e93){logger[_0x3a08('0xb')](_0x3a08('0x1a'),_0x10f61a);logger[_0x3a08('0x19')]('UpdateFaxQueueReport',_0x10f61a,JSON[_0x3a08('0xe')](_0x3f8e93));_0x883cff(_0x3f8e93);})[_0x3a08('0x13')](function(_0x4859ef){logger[_0x3a08('0xf')]('UpdateFaxQueueReport',_0x4859ef['message'],_0x10f61a);_0x1222a5(_0x3a88bc['error'](0x1f4,_0x4859ef[_0x3a08('0x11')]));});});}; \ No newline at end of file +var _0x69b9=['message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','debug','body','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24c638,_0x228041){var _0xc7f16b=function(_0x2f0fab){while(--_0x2f0fab){_0x24c638['push'](_0x24c638['shift']());}};_0xc7f16b(++_0x228041);}(_0x69b9,0x19a));var _0x969b=function(_0x4d0e70,_0x1514c0){_0x4d0e70=_0x4d0e70-0x0;var _0x27b0f0=_0x69b9[_0x4d0e70];return _0x27b0f0;};'use strict';var _=require(_0x969b('0x0'));var util=require(_0x969b('0x1'));var moment=require(_0x969b('0x2'));var BPromise=require(_0x969b('0x3'));var rs=require(_0x969b('0x4'));var fs=require('fs');var Redis=require(_0x969b('0x5'));var db=require(_0x969b('0x6'))['db'];var utils=require(_0x969b('0x7'));var logger=require(_0x969b('0x8'))(_0x969b('0x9'));var config=require(_0x969b('0xa'));var jayson=require(_0x969b('0xb'));var client=jayson[_0x969b('0xc')][_0x969b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a54a3,_0x5314c5,_0x70e572){return new BPromise(function(_0xb4e5a9,_0x109618){return client[_0x969b('0xe')](_0x1a54a3,_0x70e572)[_0x969b('0xf')](function(_0x33a907){logger[_0x969b('0x10')](_0x969b('0x11'),_0x5314c5,_0x969b('0x12'));logger['debug'](_0x969b('0x13'),_0x5314c5,_0x969b('0x12'),JSON[_0x969b('0x14')](_0x33a907));if(_0x33a907['error']){if(_0x33a907[_0x969b('0x15')]['code']===0x1f4){logger['error'](_0x969b('0x11'),_0x5314c5,_0x33a907[_0x969b('0x15')][_0x969b('0x16')]);return _0x109618(_0x33a907[_0x969b('0x15')]['message']);}logger[_0x969b('0x15')](_0x969b('0x11'),_0x5314c5,_0x33a907[_0x969b('0x15')][_0x969b('0x16')]);return _0xb4e5a9(_0x33a907[_0x969b('0x15')][_0x969b('0x16')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5314c5,'request\x20sent');_0xb4e5a9(_0x33a907[_0x969b('0x17')][_0x969b('0x16')]);}})[_0x969b('0x18')](function(_0x3f17f7){logger[_0x969b('0x15')](_0x969b('0x11'),_0x5314c5,_0x3f17f7);_0x109618(_0x3f17f7);});});}exports[_0x969b('0x19')]=function(_0x39bfd4){var _0x3d10ea=this;return new Promise(function(_0x28aaba,_0x125402){return db[_0x969b('0x1a')][_0x969b('0x1b')](_0x39bfd4['body'],{'raw':_0x39bfd4[_0x969b('0x1c')]?_0x39bfd4[_0x969b('0x1c')][_0x969b('0x1d')]===undefined?!![]:![]:!![]})[_0x969b('0xf')](function(_0x1fb16c){logger[_0x969b('0x10')](_0x969b('0x19'),_0x39bfd4);logger[_0x969b('0x1e')](_0x969b('0x19'),_0x39bfd4,JSON[_0x969b('0x14')](_0x1fb16c));_0x28aaba(_0x1fb16c);})[_0x969b('0x18')](function(_0x2a4946){logger['error'](_0x969b('0x19'),_0x2a4946[_0x969b('0x16')],_0x39bfd4);_0x125402(_0x3d10ea[_0x969b('0x15')](0x1f4,_0x2a4946[_0x969b('0x16')]));});});};exports['UpdateFaxQueueReport']=function(_0x2e7cb1){var _0x12b189=this;return new Promise(function(_0x403720,_0xcea5ef){return db[_0x969b('0x1a')]['update'](_0x2e7cb1[_0x969b('0x1f')],{'raw':_0x2e7cb1[_0x969b('0x1c')]?_0x2e7cb1['options'][_0x969b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e7cb1[_0x969b('0x1c')]?_0x2e7cb1[_0x969b('0x1c')][_0x969b('0x20')]||null:null,'attributes':_0x2e7cb1[_0x969b('0x1c')]?_0x2e7cb1[_0x969b('0x1c')][_0x969b('0x21')]||null:null,'limit':_0x2e7cb1[_0x969b('0x1c')]?_0x2e7cb1['options'][_0x969b('0x22')]||null:null})[_0x969b('0xf')](function(_0x5fd3d1){logger['info'](_0x969b('0x23'),_0x2e7cb1);logger[_0x969b('0x1e')](_0x969b('0x23'),_0x2e7cb1,JSON[_0x969b('0x14')](_0x5fd3d1));_0x403720(_0x5fd3d1);})[_0x969b('0x18')](function(_0xcb724a){logger[_0x969b('0x15')]('UpdateFaxQueueReport',_0xcb724a[_0x969b('0x16')],_0x2e7cb1);_0xcea5ef(_0x12b189[_0x969b('0x15')](0x1f4,_0xcb724a[_0x969b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 6c960f1..748633f 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 _0xabcf=['isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x24e649,_0x58c33d){var _0x55b3c6=function(_0xb2270b){while(--_0xb2270b){_0x24e649['push'](_0x24e649['shift']());}};_0x55b3c6(++_0x58c33d);}(_0xabcf,0x1d4));var _0xfabc=function(_0x1beb35,_0xa94fa6){_0x1beb35=_0x1beb35-0x0;var _0x2c8f81=_0xabcf[_0x1beb35];return _0x2c8f81;};'use strict';var multer=require(_0xfabc('0x0'));var util=require(_0xfabc('0x1'));var path=require(_0xfabc('0x2'));var timeout=require(_0xfabc('0x3'));var express=require('express');var router=express[_0xfabc('0x4')]();var fs_extra=require(_0xfabc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfabc('0x6'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0xfabc('0x7')](),controller[_0xfabc('0x8')]);router[_0xfabc('0x9')](_0xfabc('0xa'),auth[_0xfabc('0x7')](),controller['describe']);router[_0xfabc('0x9')](_0xfabc('0xb'),auth[_0xfabc('0x7')](),controller['show']);router[_0xfabc('0xc')]('/',auth['isAuthenticated'](),controller[_0xfabc('0xd')]);router[_0xfabc('0xe')](_0xfabc('0xb'),auth[_0xfabc('0x7')](),controller[_0xfabc('0xf')]);router[_0xfabc('0x10')]('/:id',auth[_0xfabc('0x7')](),controller[_0xfabc('0x11')]);module[_0xfabc('0x12')]=router; \ No newline at end of file +var _0x0ef4=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','destroy'];(function(_0x591a6e,_0x25ee73){var _0x2dfeb8=function(_0x27e640){while(--_0x27e640){_0x591a6e['push'](_0x591a6e['shift']());}};_0x2dfeb8(++_0x25ee73);}(_0x0ef4,0x1dd));var _0x40ef=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x0ef4[_0x593564];return _0x211a89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x40ef('0x0'));var timeout=require(_0x40ef('0x1'));var express=require('express');var router=express[_0x40ef('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x40ef('0x3'));var interaction=require(_0x40ef('0x4'));var config=require('../../config/environment');var controller=require(_0x40ef('0x5'));router[_0x40ef('0x6')]('/',auth[_0x40ef('0x7')](),controller[_0x40ef('0x8')]);router[_0x40ef('0x6')]('/describe',auth[_0x40ef('0x7')](),controller[_0x40ef('0x9')]);router[_0x40ef('0x6')](_0x40ef('0xa'),auth[_0x40ef('0x7')](),controller[_0x40ef('0xb')]);router[_0x40ef('0xc')]('/',auth[_0x40ef('0x7')](),controller[_0x40ef('0xd')]);router[_0x40ef('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x40ef('0xa'),auth[_0x40ef('0x7')](),controller[_0x40ef('0xf')]);module[_0x40ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index eeaf728..59598da 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x7074d5,_0x427953){var _0xced075=function(_0x200009){while(--_0x200009){_0x7074d5['push'](_0x7074d5['shift']());}};_0xced075(++_0x427953);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xf0f395,_0x1cedae){var _0x140775=function(_0x3d6794){while(--_0x3d6794){_0xf0f395['push'](_0xf0f395['shift']());}};_0x140775(++_0x1cedae);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x00bb[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 69c662f..670f85c 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 _0x668c=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','FaxTransferReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2d3b38,_0x288048){var _0x220696=function(_0x200788){while(--_0x200788){_0x2d3b38['push'](_0x2d3b38['shift']());}};_0x220696(++_0x288048);}(_0x668c,0xd0));var _0xc668=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x668c[_0x196e1b];return _0x5e1f18;};'use strict';var emlformat=require(_0xc668('0x0'));var rimraf=require(_0xc668('0x1'));var zipdir=require(_0xc668('0x2'));var jsonpatch=require(_0xc668('0x3'));var rp=require('request-promise');var moment=require(_0xc668('0x4'));var BPromise=require(_0xc668('0x5'));var Mustache=require(_0xc668('0x6'));var util=require(_0xc668('0x7'));var path=require(_0xc668('0x8'));var sox=require(_0xc668('0x9'));var csv=require(_0xc668('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc668('0xb'));var _=require(_0xc668('0xc'));var squel=require('squel');var crypto=require(_0xc668('0xd'));var jsforce=require(_0xc668('0xe'));var deskjs=require(_0xc668('0xf'));var toCsv=require(_0xc668('0xa'));var querystring=require(_0xc668('0x10'));var Papa=require(_0xc668('0x11'));var Redis=require(_0xc668('0x12'));var authService=require(_0xc668('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc668('0x14'));var hardwareService=require(_0xc668('0x15'));var logger=require(_0xc668('0x16'))('api');var utils=require(_0xc668('0x17'));var config=require(_0xc668('0x18'));var licenseUtil=require(_0xc668('0x19'));var db=require(_0xc668('0x1a'))['db'];function respondWithStatusCode(_0x23c084,_0x4c28ea){_0x4c28ea=_0x4c28ea||0xcc;return function(_0x454eb2){if(_0x454eb2){return _0x23c084[_0xc668('0x1b')](_0x4c28ea);}return _0x23c084[_0xc668('0x1c')](_0x4c28ea)['end']();};}function respondWithResult(_0xcbfa61,_0x21526c){_0x21526c=_0x21526c||0xc8;return function(_0x3e9b9e){if(_0x3e9b9e){return _0xcbfa61['status'](_0x21526c)['json'](_0x3e9b9e);}};}function respondWithFilteredResult(_0x57657c,_0x40202f){return function(_0x446ee2){if(_0x446ee2){var _0xb3da2e=typeof _0x40202f[_0xc668('0x1d')]==='undefined'&&typeof _0x40202f[_0xc668('0x1e')]===_0xc668('0x1f');var _0xe6a06c=_0x446ee2[_0xc668('0x20')];var _0x3b1a79=_0xb3da2e?0x0:_0x40202f[_0xc668('0x1d')];var _0x1988cd=_0xb3da2e?_0x446ee2[_0xc668('0x20')]:_0x40202f[_0xc668('0x1d')]+_0x40202f[_0xc668('0x1e')];var _0x2256b7;if(_0x1988cd>=_0xe6a06c){_0x1988cd=_0xe6a06c;_0x2256b7=0xc8;}else{_0x2256b7=0xce;}_0x57657c['status'](_0x2256b7);return _0x57657c[_0xc668('0x21')](_0xc668('0x22'),_0x3b1a79+'-'+_0x1988cd+'/'+_0xe6a06c)[_0xc668('0x23')](_0x446ee2);}return null;};}function patchUpdates(_0x2d6fa0){return function(_0x80c26c){try{jsonpatch[_0xc668('0x24')](_0x80c26c,_0x2d6fa0,!![]);}catch(_0x63539e){return BPromise[_0xc668('0x25')](_0x63539e);}return _0x80c26c[_0xc668('0x26')]();};}function saveUpdates(_0x39312b,_0x4c590b){return function(_0x142ac1){if(_0x142ac1){return _0x142ac1[_0xc668('0x27')](_0x39312b)[_0xc668('0x28')](function(_0x44f7ea){return _0x44f7ea;});}return null;};}function removeEntity(_0x30fd60,_0x280519){return function(_0x19d7f1){if(_0x19d7f1){return _0x19d7f1[_0xc668('0x29')]()['then'](function(){_0x30fd60[_0xc668('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3444a6,_0x3df131){return function(_0x4ef22c){if(!_0x4ef22c){_0x3444a6['sendStatus'](0x194);}return _0x4ef22c;};}function handleError(_0x3a0e02,_0x56ff12){_0x56ff12=_0x56ff12||0x1f4;return function(_0x4e844d){logger[_0xc668('0x2a')](_0x4e844d[_0xc668('0x2b')]);if(_0x4e844d[_0xc668('0x2c')]){delete _0x4e844d[_0xc668('0x2c')];}_0x3a0e02[_0xc668('0x1c')](_0x56ff12)[_0xc668('0x2d')](_0x4e844d);};}exports['index']=function(_0x524538,_0x568cfc){var _0x234d85={},_0x170c68={},_0x4d6dfe={'count':0x0,'rows':[]};var _0x123b15=_['map'](db[_0xc668('0x2e')]['rawAttributes'],function(_0x4d444d){return{'name':_0x4d444d[_0xc668('0x2f')],'type':_0x4d444d[_0xc668('0x30')]['key']};});_0x170c68[_0xc668('0x31')]=_[_0xc668('0x32')](_0x123b15,_0xc668('0x2c'));_0x170c68[_0xc668('0x33')]=_[_0xc668('0x34')](_0x524538[_0xc668('0x33')]);_0x170c68[_0xc668('0x35')]=_[_0xc668('0x36')](_0x170c68['model'],_0x170c68[_0xc668('0x33')]);_0x234d85[_0xc668('0x37')]=_[_0xc668('0x36')](_0x170c68[_0xc668('0x31')],qs[_0xc668('0x38')](_0x524538['query']['fields']));_0x234d85[_0xc668('0x37')]=_0x234d85['attributes'][_0xc668('0x39')]?_0x234d85[_0xc668('0x37')]:_0x170c68['model'];if(!_0x524538[_0xc668('0x33')][_0xc668('0x3a')]('nolimit')){_0x234d85[_0xc668('0x1e')]=qs['limit'](_0x524538[_0xc668('0x33')]['limit']);_0x234d85['offset']=qs[_0xc668('0x1d')](_0x524538[_0xc668('0x33')][_0xc668('0x1d')]);}_0x234d85[_0xc668('0x3b')]=qs['sort'](_0x524538['query'][_0xc668('0x3c')]);_0x234d85[_0xc668('0x3d')]=qs[_0xc668('0x35')](_['pick'](_0x524538[_0xc668('0x33')],_0x170c68[_0xc668('0x35')]),_0x123b15);if(_0x524538[_0xc668('0x33')][_0xc668('0x3e')]){_0x234d85['where']=_[_0xc668('0x3f')](_0x234d85[_0xc668('0x3d')],{'$or':_[_0xc668('0x32')](_0x123b15,function(_0x31e617){if(_0x31e617[_0xc668('0x30')]!==_0xc668('0x40')){var _0x385def={};_0x385def[_0x31e617[_0xc668('0x2c')]]={'$like':'%'+_0x524538[_0xc668('0x33')][_0xc668('0x3e')]+'%'};return _0x385def;}})});}_0x234d85=_['merge']({},_0x234d85,_0x524538[_0xc668('0x41')]);var _0xbd1ef9={'where':_0x234d85[_0xc668('0x3d')]};return db[_0xc668('0x2e')][_0xc668('0x20')](_0xbd1ef9)[_0xc668('0x28')](function(_0x28012d){_0x4d6dfe[_0xc668('0x20')]=_0x28012d;if(_0x524538[_0xc668('0x33')][_0xc668('0x42')]){_0x234d85['include']=[{'all':!![]}];}return db[_0xc668('0x2e')][_0xc668('0x43')](_0x234d85);})['then'](function(_0x379ae6){_0x4d6dfe[_0xc668('0x44')]=_0x379ae6;return _0x4d6dfe;})[_0xc668('0x28')](respondWithFilteredResult(_0x568cfc,_0x234d85))[_0xc668('0x45')](handleError(_0x568cfc,null));};exports[_0xc668('0x46')]=function(_0x4d0953,_0xbc4e78){var _0x4d1b7a={'raw':!![],'where':{'id':_0x4d0953[_0xc668('0x47')]['id']}},_0x26417a={};_0x26417a['model']=_[_0xc668('0x34')](db[_0xc668('0x2e')][_0xc668('0x48')]);_0x26417a[_0xc668('0x33')]=_[_0xc668('0x34')](_0x4d0953[_0xc668('0x33')]);_0x26417a[_0xc668('0x35')]=_[_0xc668('0x36')](_0x26417a[_0xc668('0x31')],_0x26417a[_0xc668('0x33')]);_0x4d1b7a[_0xc668('0x37')]=_[_0xc668('0x36')](_0x26417a[_0xc668('0x31')],qs['fields'](_0x4d0953[_0xc668('0x33')][_0xc668('0x38')]));_0x4d1b7a[_0xc668('0x37')]=_0x4d1b7a[_0xc668('0x37')][_0xc668('0x39')]?_0x4d1b7a['attributes']:_0x26417a[_0xc668('0x31')];if(_0x4d0953['query'][_0xc668('0x42')]){_0x4d1b7a['include']=[{'all':!![]}];}_0x4d1b7a=_['merge']({},_0x4d1b7a,_0x4d0953[_0xc668('0x41')]);return db['FaxTransferReport']['find'](_0x4d1b7a)['then'](handleEntityNotFound(_0xbc4e78,null))[_0xc668('0x28')](respondWithResult(_0xbc4e78,null))[_0xc668('0x45')](handleError(_0xbc4e78,null));};exports[_0xc668('0x49')]=function(_0x11e780,_0x2e34bb){return db[_0xc668('0x2e')]['create'](_0x11e780[_0xc668('0x4a')],{})[_0xc668('0x28')](respondWithResult(_0x2e34bb,0xc9))['catch'](handleError(_0x2e34bb,null));};exports[_0xc668('0x27')]=function(_0x21fb34,_0x117420){if(_0x21fb34[_0xc668('0x4a')]['id']){delete _0x21fb34[_0xc668('0x4a')]['id'];}return db[_0xc668('0x2e')][_0xc668('0x4b')]({'where':{'id':_0x21fb34[_0xc668('0x47')]['id']}})[_0xc668('0x28')](handleEntityNotFound(_0x117420,null))['then'](saveUpdates(_0x21fb34['body'],null))[_0xc668('0x28')](respondWithResult(_0x117420,null))[_0xc668('0x45')](handleError(_0x117420,null));};exports[_0xc668('0x29')]=function(_0x35aef9,_0x1aff9a){return db[_0xc668('0x2e')][_0xc668('0x4b')]({'where':{'id':_0x35aef9[_0xc668('0x47')]['id']}})['then'](handleEntityNotFound(_0x1aff9a,null))[_0xc668('0x28')](removeEntity(_0x1aff9a,null))['catch'](handleError(_0x1aff9a,null));};exports[_0xc668('0x4c')]=function(_0x212b83,_0x52071c){return db['FaxTransferReport']['describe']()[_0xc668('0x28')](respondWithResult(_0x52071c,null))[_0xc668('0x45')](handleError(_0x52071c,null));}; \ No newline at end of file +var _0x776e=['Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','FaxTransferReport','findAll','rows','catch','show','keys','intersection','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set'];(function(_0x299028,_0x4d7e9f){var _0x12154e=function(_0x558d18){while(--_0x558d18){_0x299028['push'](_0x299028['shift']());}};_0x12154e(++_0x4d7e9f);}(_0x776e,0x16c));var _0xe776=function(_0x5f0937,_0x17e901){_0x5f0937=_0x5f0937-0x0;var _0x204c68=_0x776e[_0x5f0937];return _0x204c68;};'use strict';var emlformat=require(_0xe776('0x0'));var rimraf=require(_0xe776('0x1'));var zipdir=require(_0xe776('0x2'));var jsonpatch=require(_0xe776('0x3'));var rp=require(_0xe776('0x4'));var moment=require(_0xe776('0x5'));var BPromise=require(_0xe776('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe776('0x7'));var sox=require(_0xe776('0x8'));var csv=require(_0xe776('0x9'));var ejs=require(_0xe776('0xa'));var fs=require('fs');var fs_extra=require(_0xe776('0xb'));var _=require(_0xe776('0xc'));var squel=require(_0xe776('0xd'));var crypto=require(_0xe776('0xe'));var jsforce=require(_0xe776('0xf'));var deskjs=require(_0xe776('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe776('0x11'));var Papa=require(_0xe776('0x12'));var Redis=require(_0xe776('0x13'));var authService=require(_0xe776('0x14'));var qs=require(_0xe776('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe776('0x16'));var logger=require(_0xe776('0x17'))(_0xe776('0x18'));var utils=require(_0xe776('0x19'));var config=require(_0xe776('0x1a'));var licenseUtil=require(_0xe776('0x1b'));var db=require(_0xe776('0x1c'))['db'];function respondWithStatusCode(_0x2aaf34,_0x2aec9b){_0x2aec9b=_0x2aec9b||0xcc;return function(_0x1378f7){if(_0x1378f7){return _0x2aaf34['sendStatus'](_0x2aec9b);}return _0x2aaf34[_0xe776('0x1d')](_0x2aec9b)[_0xe776('0x1e')]();};}function respondWithResult(_0x470994,_0x1160cb){_0x1160cb=_0x1160cb||0xc8;return function(_0x531504){if(_0x531504){return _0x470994[_0xe776('0x1d')](_0x1160cb)[_0xe776('0x1f')](_0x531504);}};}function respondWithFilteredResult(_0x2fbdfd,_0x4f2c36){return function(_0x491c45){if(_0x491c45){var _0x466077=typeof _0x4f2c36[_0xe776('0x20')]==='undefined'&&typeof _0x4f2c36[_0xe776('0x21')]===_0xe776('0x22');var _0x221baa=_0x491c45['count'];var _0x2a0fb4=_0x466077?0x0:_0x4f2c36['offset'];var _0x473a8f=_0x466077?_0x491c45['count']:_0x4f2c36['offset']+_0x4f2c36[_0xe776('0x21')];var _0x4482ce;if(_0x473a8f>=_0x221baa){_0x473a8f=_0x221baa;_0x4482ce=0xc8;}else{_0x4482ce=0xce;}_0x2fbdfd['status'](_0x4482ce);return _0x2fbdfd[_0xe776('0x23')](_0xe776('0x24'),_0x2a0fb4+'-'+_0x473a8f+'/'+_0x221baa)[_0xe776('0x1f')](_0x491c45);}return null;};}function patchUpdates(_0x52dbe4){return function(_0x13471d){try{jsonpatch[_0xe776('0x25')](_0x13471d,_0x52dbe4,!![]);}catch(_0x3d480e){return BPromise[_0xe776('0x26')](_0x3d480e);}return _0x13471d[_0xe776('0x27')]();};}function saveUpdates(_0x5087f3,_0x35ead6){return function(_0x26ae46){if(_0x26ae46){return _0x26ae46[_0xe776('0x28')](_0x5087f3)[_0xe776('0x29')](function(_0x5dc26d){return _0x5dc26d;});}return null;};}function removeEntity(_0x4a6ec4,_0x2a8247){return function(_0x1847dd){if(_0x1847dd){return _0x1847dd['destroy']()[_0xe776('0x29')](function(){_0x4a6ec4[_0xe776('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313707,_0x146924){return function(_0x375847){if(!_0x375847){_0x313707[_0xe776('0x2a')](0x194);}return _0x375847;};}function handleError(_0x3422cb,_0x59b77d){_0x59b77d=_0x59b77d||0x1f4;return function(_0x432a6f){logger[_0xe776('0x2b')](_0x432a6f['stack']);if(_0x432a6f[_0xe776('0x2c')]){delete _0x432a6f[_0xe776('0x2c')];}_0x3422cb[_0xe776('0x1d')](_0x59b77d)[_0xe776('0x2d')](_0x432a6f);};}exports['index']=function(_0xf1f3b9,_0x12c0a4){var _0x2b8638={},_0xf6bea0={},_0x184ea2={'count':0x0,'rows':[]};var _0x19a271=_[_0xe776('0x2e')](db['FaxTransferReport'][_0xe776('0x2f')],function(_0x5b0196){return{'name':_0x5b0196['fieldName'],'type':_0x5b0196[_0xe776('0x30')][_0xe776('0x31')]};});_0xf6bea0[_0xe776('0x32')]=_['map'](_0x19a271,_0xe776('0x2c'));_0xf6bea0[_0xe776('0x33')]=_['keys'](_0xf1f3b9[_0xe776('0x33')]);_0xf6bea0[_0xe776('0x34')]=_['intersection'](_0xf6bea0['model'],_0xf6bea0[_0xe776('0x33')]);_0x2b8638[_0xe776('0x35')]=_['intersection'](_0xf6bea0[_0xe776('0x32')],qs['fields'](_0xf1f3b9[_0xe776('0x33')][_0xe776('0x36')]));_0x2b8638[_0xe776('0x35')]=_0x2b8638[_0xe776('0x35')][_0xe776('0x37')]?_0x2b8638[_0xe776('0x35')]:_0xf6bea0[_0xe776('0x32')];if(!_0xf1f3b9['query'][_0xe776('0x38')]('nolimit')){_0x2b8638[_0xe776('0x21')]=qs[_0xe776('0x21')](_0xf1f3b9[_0xe776('0x33')][_0xe776('0x21')]);_0x2b8638[_0xe776('0x20')]=qs[_0xe776('0x20')](_0xf1f3b9[_0xe776('0x33')]['offset']);}_0x2b8638[_0xe776('0x39')]=qs['sort'](_0xf1f3b9['query'][_0xe776('0x3a')]);_0x2b8638[_0xe776('0x3b')]=qs[_0xe776('0x34')](_[_0xe776('0x3c')](_0xf1f3b9[_0xe776('0x33')],_0xf6bea0[_0xe776('0x34')]),_0x19a271);if(_0xf1f3b9['query']['filter']){_0x2b8638[_0xe776('0x3b')]=_[_0xe776('0x3d')](_0x2b8638[_0xe776('0x3b')],{'$or':_[_0xe776('0x2e')](_0x19a271,function(_0x545bf2){if(_0x545bf2[_0xe776('0x30')]!==_0xe776('0x3e')){var _0x4f43a2={};_0x4f43a2[_0x545bf2[_0xe776('0x2c')]]={'$like':'%'+_0xf1f3b9[_0xe776('0x33')]['filter']+'%'};return _0x4f43a2;}})});}_0x2b8638=_['merge']({},_0x2b8638,_0xf1f3b9[_0xe776('0x3f')]);var _0x3754dc={'where':_0x2b8638[_0xe776('0x3b')]};return db['FaxTransferReport'][_0xe776('0x40')](_0x3754dc)[_0xe776('0x29')](function(_0x22a398){_0x184ea2[_0xe776('0x40')]=_0x22a398;if(_0xf1f3b9[_0xe776('0x33')][_0xe776('0x41')]){_0x2b8638[_0xe776('0x42')]=[{'all':!![]}];}return db[_0xe776('0x43')][_0xe776('0x44')](_0x2b8638);})['then'](function(_0x83e1d6){_0x184ea2[_0xe776('0x45')]=_0x83e1d6;return _0x184ea2;})[_0xe776('0x29')](respondWithFilteredResult(_0x12c0a4,_0x2b8638))[_0xe776('0x46')](handleError(_0x12c0a4,null));};exports[_0xe776('0x47')]=function(_0x49ad25,_0x448e6d){var _0x5b0c0a={'raw':!![],'where':{'id':_0x49ad25['params']['id']}},_0x151066={};_0x151066[_0xe776('0x32')]=_['keys'](db['FaxTransferReport'][_0xe776('0x2f')]);_0x151066[_0xe776('0x33')]=_[_0xe776('0x48')](_0x49ad25[_0xe776('0x33')]);_0x151066[_0xe776('0x34')]=_['intersection'](_0x151066[_0xe776('0x32')],_0x151066[_0xe776('0x33')]);_0x5b0c0a[_0xe776('0x35')]=_[_0xe776('0x49')](_0x151066[_0xe776('0x32')],qs['fields'](_0x49ad25[_0xe776('0x33')][_0xe776('0x36')]));_0x5b0c0a[_0xe776('0x35')]=_0x5b0c0a[_0xe776('0x35')][_0xe776('0x37')]?_0x5b0c0a['attributes']:_0x151066[_0xe776('0x32')];if(_0x49ad25['query'][_0xe776('0x41')]){_0x5b0c0a[_0xe776('0x42')]=[{'all':!![]}];}_0x5b0c0a=_['merge']({},_0x5b0c0a,_0x49ad25[_0xe776('0x3f')]);return db[_0xe776('0x43')][_0xe776('0x4a')](_0x5b0c0a)[_0xe776('0x29')](handleEntityNotFound(_0x448e6d,null))[_0xe776('0x29')](respondWithResult(_0x448e6d,null))[_0xe776('0x46')](handleError(_0x448e6d,null));};exports[_0xe776('0x4b')]=function(_0x5d1304,_0x25dfc6){return db[_0xe776('0x43')][_0xe776('0x4b')](_0x5d1304[_0xe776('0x4c')],{})['then'](respondWithResult(_0x25dfc6,0xc9))[_0xe776('0x46')](handleError(_0x25dfc6,null));};exports[_0xe776('0x28')]=function(_0x74772e,_0x1f55ed){if(_0x74772e[_0xe776('0x4c')]['id']){delete _0x74772e[_0xe776('0x4c')]['id'];}return db[_0xe776('0x43')][_0xe776('0x4a')]({'where':{'id':_0x74772e[_0xe776('0x4d')]['id']}})[_0xe776('0x29')](handleEntityNotFound(_0x1f55ed,null))[_0xe776('0x29')](saveUpdates(_0x74772e[_0xe776('0x4c')],null))[_0xe776('0x29')](respondWithResult(_0x1f55ed,null))[_0xe776('0x46')](handleError(_0x1f55ed,null));};exports[_0xe776('0x4e')]=function(_0x5dc383,_0x6d3a7e){return db[_0xe776('0x43')][_0xe776('0x4a')]({'where':{'id':_0x5dc383[_0xe776('0x4d')]['id']}})[_0xe776('0x29')](handleEntityNotFound(_0x6d3a7e,null))[_0xe776('0x29')](removeEntity(_0x6d3a7e,null))[_0xe776('0x46')](handleError(_0x6d3a7e,null));};exports[_0xe776('0x4f')]=function(_0x31ca9f,_0xe6c9c3){return db[_0xe776('0x43')][_0xe776('0x4f')]()['then'](respondWithResult(_0xe6c9c3,null))[_0xe776('0x46')](handleError(_0xe6c9c3,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 599a219..c0991d0 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 _0xda27=['bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x19c3e0,_0x470f6d){var _0x566594=function(_0x5336d0){while(--_0x5336d0){_0x19c3e0['push'](_0x19c3e0['shift']());}};_0x566594(++_0x470f6d);}(_0xda27,0x1cf));var _0x7da2=function(_0x540d06,_0x19ab10){_0x540d06=_0x540d06-0x0;var _0x3493f1=_0xda27[_0x540d06];return _0x3493f1;};'use strict';var _=require(_0x7da2('0x0'));var util=require(_0x7da2('0x1'));var logger=require(_0x7da2('0x2'))(_0x7da2('0x3'));var moment=require(_0x7da2('0x4'));var BPromise=require(_0x7da2('0x5'));var rp=require(_0x7da2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7da2('0x7'));var config=require(_0x7da2('0x8'));var attributes=require(_0x7da2('0x9'));module['exports']=function(_0x2f2ec8,_0x14babf){return _0x2f2ec8[_0x7da2('0xa')]('FaxTransferReport',attributes,{'tableName':_0x7da2('0xb'),'paranoid':![],'indexes':[{'name':_0x7da2('0xc'),'fields':[_0x7da2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7bc=['bluebird','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment'];(function(_0x13a258,_0x1e8c33){var _0x4f3892=function(_0x13275d){while(--_0x13275d){_0x13a258['push'](_0x13a258['shift']());}};_0x4f3892(++_0x1e8c33);}(_0xe7bc,0x1dd));var _0xce7b=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xe7bc[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0xce7b('0x0'));var util=require(_0xce7b('0x1'));var logger=require('../../config/logger')(_0xce7b('0x2'));var moment=require(_0xce7b('0x3'));var BPromise=require(_0xce7b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce7b('0x5'));var rimraf=require(_0xce7b('0x6'));var config=require(_0xce7b('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0xce7b('0x8')]=function(_0x529b68,_0x23dfdb){return _0x529b68[_0xce7b('0x9')](_0xce7b('0xa'),attributes,{'tableName':_0xce7b('0xb'),'paranoid':![],'indexes':[{'name':_0xce7b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index bad7bfd..ded66cb 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 _0xbfca=['http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2b40eb,_0x1a7470){var _0x30eda8=function(_0x218bba){while(--_0x218bba){_0x2b40eb['push'](_0x2b40eb['shift']());}};_0x30eda8(++_0x1a7470);}(_0xbfca,0x106));var _0xabfc=function(_0x2d7167,_0x387984){_0x2d7167=_0x2d7167-0x0;var _0x3eb679=_0xbfca[_0x2d7167];return _0x3eb679;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var moment=require('moment');var BPromise=require(_0xabfc('0x2'));var rs=require(_0xabfc('0x3'));var fs=require('fs');var Redis=require(_0xabfc('0x4'));var db=require(_0xabfc('0x5'))['db'];var utils=require(_0xabfc('0x6'));var logger=require(_0xabfc('0x7'))('rpc');var config=require(_0xabfc('0x8'));var jayson=require(_0xabfc('0x9'));var client=jayson[_0xabfc('0xa')][_0xabfc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571d99,_0x152623,_0x60c7a8){return new BPromise(function(_0x10577f,_0x5edd74){return client['request'](_0x571d99,_0x60c7a8)[_0xabfc('0xc')](function(_0x171658){logger[_0xabfc('0xd')](_0xabfc('0xe'),_0x152623,_0xabfc('0xf'));logger[_0xabfc('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x152623,_0xabfc('0xf'),JSON['stringify'](_0x171658));if(_0x171658[_0xabfc('0x11')]){if(_0x171658[_0xabfc('0x11')][_0xabfc('0x12')]===0x1f4){logger[_0xabfc('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x152623,_0x171658[_0xabfc('0x11')][_0xabfc('0x13')]);return _0x5edd74(_0x171658[_0xabfc('0x11')][_0xabfc('0x13')]);}logger[_0xabfc('0x11')](_0xabfc('0xe'),_0x152623,_0x171658[_0xabfc('0x11')][_0xabfc('0x13')]);return _0x10577f(_0x171658['error'][_0xabfc('0x13')]);}else{logger[_0xabfc('0xd')](_0xabfc('0xe'),_0x152623,_0xabfc('0xf'));_0x10577f(_0x171658['result']['message']);}})[_0xabfc('0x14')](function(_0x1a2a52){logger[_0xabfc('0x11')](_0xabfc('0xe'),_0x152623,_0x1a2a52);_0x5edd74(_0x1a2a52);});});} \ No newline at end of file +var _0x0f68=['../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5b47fa,_0x42b2c6){var _0x34aeae=function(_0x3d5852){while(--_0x3d5852){_0x5b47fa['push'](_0x5b47fa['shift']());}};_0x34aeae(++_0x42b2c6);}(_0x0f68,0x1db));var _0x80f6=function(_0x512c78,_0x13381c){_0x512c78=_0x512c78-0x0;var _0xe82ac7=_0x0f68[_0x512c78];return _0xe82ac7;};'use strict';var _=require('lodash');var util=require(_0x80f6('0x0'));var moment=require(_0x80f6('0x1'));var BPromise=require('bluebird');var rs=require(_0x80f6('0x2'));var fs=require('fs');var Redis=require(_0x80f6('0x3'));var db=require(_0x80f6('0x4'))['db'];var utils=require(_0x80f6('0x5'));var logger=require(_0x80f6('0x6'))(_0x80f6('0x7'));var config=require(_0x80f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x80f6('0x9')][_0x80f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54c8f3,_0x446fcd,_0x4db1e1){return new BPromise(function(_0x5049c0,_0x491a8c){return client[_0x80f6('0xb')](_0x54c8f3,_0x4db1e1)[_0x80f6('0xc')](function(_0x395d4d){logger[_0x80f6('0xd')](_0x80f6('0xe'),_0x446fcd,_0x80f6('0xf'));logger['debug'](_0x80f6('0x10'),_0x446fcd,_0x80f6('0xf'),JSON['stringify'](_0x395d4d));if(_0x395d4d[_0x80f6('0x11')]){if(_0x395d4d[_0x80f6('0x11')]['code']===0x1f4){logger[_0x80f6('0x11')](_0x80f6('0xe'),_0x446fcd,_0x395d4d[_0x80f6('0x11')][_0x80f6('0x12')]);return _0x491a8c(_0x395d4d[_0x80f6('0x11')]['message']);}logger[_0x80f6('0x11')](_0x80f6('0xe'),_0x446fcd,_0x395d4d[_0x80f6('0x11')]['message']);return _0x5049c0(_0x395d4d['error'][_0x80f6('0x12')]);}else{logger['info'](_0x80f6('0xe'),_0x446fcd,_0x80f6('0xf'));_0x5049c0(_0x395d4d[_0x80f6('0x13')][_0x80f6('0x12')]);}})[_0x80f6('0x14')](function(_0x348aa0){logger[_0x80f6('0x11')](_0x80f6('0xe'),_0x446fcd,_0x348aa0);_0x491a8c(_0x348aa0);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0d2bf1d..98828f9 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 _0xa977=['index','/describe','isAuthenticated','describe','/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get'];(function(_0x2f4a45,_0x3bfee9){var _0x2201ce=function(_0x1491a1){while(--_0x1491a1){_0x2f4a45['push'](_0x2f4a45['shift']());}};_0x2201ce(++_0x3bfee9);}(_0xa977,0x1ed));var _0x7a97=function(_0xd0dbe2,_0x4f798d){_0xd0dbe2=_0xd0dbe2-0x0;var _0x571c84=_0xa977[_0xd0dbe2];return _0x571c84;};'use strict';var multer=require(_0x7a97('0x0'));var util=require(_0x7a97('0x1'));var path=require('path');var timeout=require(_0x7a97('0x2'));var express=require(_0x7a97('0x3'));var router=express[_0x7a97('0x4')]();var fs_extra=require(_0x7a97('0x5'));var auth=require(_0x7a97('0x6'));var interaction=require(_0x7a97('0x7'));var config=require(_0x7a97('0x8'));var controller=require(_0x7a97('0x9'));router[_0x7a97('0xa')]('/',auth['isAuthenticated'](),controller[_0x7a97('0xb')]);router[_0x7a97('0xa')](_0x7a97('0xc'),auth[_0x7a97('0xd')](),controller[_0x7a97('0xe')]);router[_0x7a97('0xa')](_0x7a97('0xf'),auth['isAuthenticated'](),controller[_0x7a97('0x10')]);router['post']('/',auth[_0x7a97('0xd')](),controller[_0x7a97('0x11')]);router['put'](_0x7a97('0xf'),auth[_0x7a97('0xd')](),controller[_0x7a97('0x12')]);router[_0x7a97('0x13')](_0x7a97('0xf'),auth[_0x7a97('0xd')](),controller['destroy']);module[_0x7a97('0x14')]=router; \ No newline at end of file +var _0xa44c=['delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x4c8abe,_0x1ba6f2){var _0x1462a6=function(_0x5001f8){while(--_0x5001f8){_0x4c8abe['push'](_0x4c8abe['shift']());}};_0x1462a6(++_0x1ba6f2);}(_0xa44c,0x129));var _0xca44=function(_0x3ccd74,_0x216329){_0x3ccd74=_0x3ccd74-0x0;var _0x372538=_0xa44c[_0x3ccd74];return _0x372538;};'use strict';var multer=require(_0xca44('0x0'));var util=require(_0xca44('0x1'));var path=require(_0xca44('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xca44('0x3')]();var fs_extra=require(_0xca44('0x4'));var auth=require(_0xca44('0x5'));var interaction=require(_0xca44('0x6'));var config=require(_0xca44('0x7'));var controller=require(_0xca44('0x8'));router[_0xca44('0x9')]('/',auth[_0xca44('0xa')](),controller[_0xca44('0xb')]);router['get'](_0xca44('0xc'),auth[_0xca44('0xa')](),controller[_0xca44('0xd')]);router[_0xca44('0x9')](_0xca44('0xe'),auth[_0xca44('0xa')](),controller[_0xca44('0xf')]);router[_0xca44('0x10')]('/',auth[_0xca44('0xa')](),controller[_0xca44('0x11')]);router['put'](_0xca44('0xe'),auth[_0xca44('0xa')](),controller['update']);router[_0xca44('0x12')]('/:id',auth[_0xca44('0xa')](),controller[_0xca44('0x13')]);module[_0xca44('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index fb6d7fc..ac1a41a 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 _0xe52f=['get','index','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./intDeskAccount.controller'];(function(_0x4ac29a,_0x5c704a){var _0x499e36=function(_0x542554){while(--_0x542554){_0x4ac29a['push'](_0x4ac29a['shift']());}};_0x499e36(++_0x5c704a);}(_0xe52f,0x197));var _0xfe52=function(_0x2a42a9,_0x3a24ee){_0x2a42a9=_0x2a42a9-0x0;var _0x2513fa=_0xe52f[_0x2a42a9];return _0x2513fa;};'use strict';var multer=require(_0xfe52('0x0'));var util=require(_0xfe52('0x1'));var path=require(_0xfe52('0x2'));var timeout=require(_0xfe52('0x3'));var express=require('express');var router=express[_0xfe52('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfe52('0x5'));var controller=require(_0xfe52('0x6'));router[_0xfe52('0x7')]('/',auth['isAuthenticated'](),controller[_0xfe52('0x8')]);router[_0xfe52('0x7')]('/:id',auth[_0xfe52('0x9')](),controller[_0xfe52('0xa')]);router['get']('/:id/configurations',auth[_0xfe52('0x9')](),controller[_0xfe52('0xb')]);router['get'](_0xfe52('0xc'),auth[_0xfe52('0x9')](),controller[_0xfe52('0xd')]);router[_0xfe52('0xe')]('/',auth[_0xfe52('0x9')](),controller[_0xfe52('0xf')]);router[_0xfe52('0xe')]('/:id/configurations',auth[_0xfe52('0x9')](),controller[_0xfe52('0x10')]);router[_0xfe52('0x11')](_0xfe52('0x12'),auth[_0xfe52('0x9')](),controller[_0xfe52('0x13')]);router[_0xfe52('0x14')](_0xfe52('0x12'),auth[_0xfe52('0x9')](),controller[_0xfe52('0x15')]);module[_0xfe52('0x16')]=router; \ No newline at end of file +var _0xa9ec=['get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x94f1fb,_0x12aa1c){var _0x670725=function(_0x491ece){while(--_0x491ece){_0x94f1fb['push'](_0x94f1fb['shift']());}};_0x670725(++_0x12aa1c);}(_0xa9ec,0x148));var _0xca9e=function(_0x2f3a46,_0x25335f){_0x2f3a46=_0x2f3a46-0x0;var _0x98fa2f=_0xa9ec[_0x2f3a46];return _0x98fa2f;};'use strict';var multer=require(_0xca9e('0x0'));var util=require(_0xca9e('0x1'));var path=require(_0xca9e('0x2'));var timeout=require(_0xca9e('0x3'));var express=require('express');var router=express[_0xca9e('0x4')]();var fs_extra=require(_0xca9e('0x5'));var auth=require(_0xca9e('0x6'));var interaction=require(_0xca9e('0x7'));var config=require(_0xca9e('0x8'));var controller=require(_0xca9e('0x9'));router[_0xca9e('0xa')]('/',auth[_0xca9e('0xb')](),controller[_0xca9e('0xc')]);router[_0xca9e('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xca9e('0xa')](_0xca9e('0xd'),auth[_0xca9e('0xb')](),controller[_0xca9e('0xe')]);router[_0xca9e('0xa')](_0xca9e('0xf'),auth['isAuthenticated'](),controller[_0xca9e('0x10')]);router[_0xca9e('0x11')]('/',auth[_0xca9e('0xb')](),controller[_0xca9e('0x12')]);router[_0xca9e('0x11')](_0xca9e('0xd'),auth['isAuthenticated'](),controller[_0xca9e('0x13')]);router[_0xca9e('0x14')]('/:id',auth[_0xca9e('0xb')](),controller[_0xca9e('0x15')]);router[_0xca9e('0x16')](_0xca9e('0x17'),auth['isAuthenticated'](),controller[_0xca9e('0x18')]);module[_0xca9e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index fbb13e9..c84ddd6 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 _0xb27a=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x148f53,_0x32f677){var _0x176cda=function(_0x3a03c2){while(--_0x3a03c2){_0x148f53['push'](_0x148f53['shift']());}};_0x176cda(++_0x32f677);}(_0xb27a,0x183));var _0xab27=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0xb27a[_0x8a7e38];return _0x228609;};'use strict';var Sequelize=require(_0xab27('0x0'));module[_0xab27('0x1')]={'name':{'type':Sequelize[_0xab27('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xab27('0x3')](_0xab27('0x4')),'defaultValue':_0xab27('0x4')},'password':{'type':Sequelize[_0xab27('0x2')]},'consumerKey':{'type':Sequelize[_0xab27('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xab27('0x2')]},'tokenSecret':{'type':Sequelize[_0xab27('0x2')]},'serverUrl':{'type':Sequelize[_0xab27('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xab27('0x5'),_0xab27('0x6')),'defaultValue':_0xab27('0x5')}}; \ No newline at end of file +var _0xdaed=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0xb296a0,_0x2f6060){var _0x5ba2f4=function(_0x5f4978){while(--_0x5f4978){_0xb296a0['push'](_0xb296a0['shift']());}};_0x5ba2f4(++_0x2f6060);}(_0xdaed,0x17b));var _0xddae=function(_0x4c8e77,_0x56cf44){_0x4c8e77=_0x4c8e77-0x0;var _0x594018=_0xdaed[_0x4c8e77];return _0x594018;};'use strict';var Sequelize=require(_0xddae('0x0'));module[_0xddae('0x1')]={'name':{'type':Sequelize[_0xddae('0x2')]},'description':{'type':Sequelize[_0xddae('0x2')]},'username':{'type':Sequelize[_0xddae('0x2')]},'remoteUri':{'type':Sequelize[_0xddae('0x2')]},'authType':{'type':Sequelize[_0xddae('0x3')](_0xddae('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xddae('0x2')]},'consumerKey':{'type':Sequelize[_0xddae('0x2')]},'consumerSecret':{'type':Sequelize[_0xddae('0x2')]},'token':{'type':Sequelize[_0xddae('0x2')]},'tokenSecret':{'type':Sequelize[_0xddae('0x2')]},'serverUrl':{'type':Sequelize[_0xddae('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xddae('0x3')](_0xddae('0x5'),_0xddae('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e8b67f6..03c6e67 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 _0x3218=['statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','DeskAccount','includeAll','include','catch','show','params','find','create','body','getConfigurations','findOne','keys','length','order','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','tokenSecret','slice','substring','lastIndexOf','format','application/json','headers','Authorization','Basic\x20%s','%s:%s','password','base64','concat','_embedded','active','label','test'];(function(_0x26158a,_0x35e5ab){var _0x1cf4ac=function(_0x37da77){while(--_0x37da77){_0x26158a['push'](_0x26158a['shift']());}};_0x1cf4ac(++_0x35e5ab);}(_0x3218,0x74));var _0x8321=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x3218[_0xc14df7];return _0x34a445;};'use strict';var emlformat=require(_0x8321('0x0'));var rimraf=require(_0x8321('0x1'));var zipdir=require(_0x8321('0x2'));var jsonpatch=require(_0x8321('0x3'));var rp=require(_0x8321('0x4'));var moment=require('moment');var BPromise=require(_0x8321('0x5'));var Mustache=require(_0x8321('0x6'));var util=require(_0x8321('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8321('0x8'));var ejs=require(_0x8321('0x9'));var fs=require('fs');var fs_extra=require(_0x8321('0xa'));var _=require(_0x8321('0xb'));var squel=require('squel');var crypto=require(_0x8321('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8321('0xd'));var toCsv=require(_0x8321('0x8'));var querystring=require(_0x8321('0xe'));var Papa=require(_0x8321('0xf'));var Redis=require(_0x8321('0x10'));var authService=require(_0x8321('0x11'));var qs=require(_0x8321('0x12'));var as=require(_0x8321('0x13'));var hardwareService=require(_0x8321('0x14'));var logger=require(_0x8321('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8321('0x16'));var licenseUtil=require(_0x8321('0x17'));var db=require(_0x8321('0x18'))['db'];var integrations=require(_0x8321('0x19'));function respondWithStatusCode(_0x4b3916,_0x34ced4){_0x34ced4=_0x34ced4||0xcc;return function(_0x1b4e1e){if(_0x1b4e1e){return _0x4b3916['sendStatus'](_0x34ced4);}return _0x4b3916['status'](_0x34ced4)[_0x8321('0x1a')]();};}function respondWithResult(_0x4d0fad,_0x170eeb){_0x170eeb=_0x170eeb||0xc8;return function(_0x2a4d79){if(_0x2a4d79){return _0x4d0fad[_0x8321('0x1b')](_0x170eeb)[_0x8321('0x1c')](_0x2a4d79);}};}function respondWithFilteredResult(_0x127ee5,_0xd23e4b){return function(_0x32d6ca){if(_0x32d6ca){var _0x1b94fe=typeof _0xd23e4b[_0x8321('0x1d')]===_0x8321('0x1e')&&typeof _0xd23e4b['limit']===_0x8321('0x1e');var _0x356847=_0x32d6ca[_0x8321('0x1f')];var _0x2f299e=_0x1b94fe?0x0:_0xd23e4b[_0x8321('0x1d')];var _0x3b1d48=_0x1b94fe?_0x32d6ca[_0x8321('0x1f')]:_0xd23e4b[_0x8321('0x1d')]+_0xd23e4b[_0x8321('0x20')];var _0x3c4181;if(_0x3b1d48>=_0x356847){_0x3b1d48=_0x356847;_0x3c4181=0xc8;}else{_0x3c4181=0xce;}_0x127ee5[_0x8321('0x1b')](_0x3c4181);return _0x127ee5[_0x8321('0x21')](_0x8321('0x22'),_0x2f299e+'-'+_0x3b1d48+'/'+_0x356847)['json'](_0x32d6ca);}return null;};}function patchUpdates(_0x52fddf){return function(_0x22a092){try{jsonpatch[_0x8321('0x23')](_0x22a092,_0x52fddf,!![]);}catch(_0x3ef918){return BPromise[_0x8321('0x24')](_0x3ef918);}return _0x22a092[_0x8321('0x25')]();};}function saveUpdates(_0x432e46,_0x458da9){return function(_0x217359){if(_0x217359){return _0x217359[_0x8321('0x26')](_0x432e46)['then'](function(_0x399e9c){return _0x399e9c;});}return null;};}function removeEntity(_0x5ced44,_0x358ae6){return function(_0x4c3381){if(_0x4c3381){return _0x4c3381[_0x8321('0x27')]()[_0x8321('0x28')](function(){_0x5ced44[_0x8321('0x1b')](0xcc)[_0x8321('0x1a')]();});}};}function handleEntityNotFound(_0x3d298b,_0x52378e){return function(_0x264b62){if(!_0x264b62){_0x3d298b[_0x8321('0x29')](0x194);}return _0x264b62;};}function handleError(_0x1c697e,_0xb636){_0xb636=_0xb636||0x1f4;return function(_0x395280){logger[_0x8321('0x2a')](_0x395280[_0x8321('0x2b')]);if(_0x395280[_0x8321('0x2c')]){delete _0x395280['name'];}_0x1c697e[_0x8321('0x1b')](_0xb636)[_0x8321('0x2d')](_0x395280);};}exports[_0x8321('0x2e')]=function(_0x48c971,_0x24f9a2){var _0x56e62f={},_0x5a0782={},_0x48075e={'count':0x0,'rows':[]};var _0x466193=_[_0x8321('0x2f')](db['DeskAccount'][_0x8321('0x30')],function(_0xa39403){return{'name':_0xa39403[_0x8321('0x31')],'type':_0xa39403[_0x8321('0x32')][_0x8321('0x33')]};});_0x5a0782[_0x8321('0x34')]=_[_0x8321('0x2f')](_0x466193,_0x8321('0x2c'));_0x5a0782[_0x8321('0x35')]=_['keys'](_0x48c971[_0x8321('0x35')]);_0x5a0782[_0x8321('0x36')]=_[_0x8321('0x37')](_0x5a0782[_0x8321('0x34')],_0x5a0782[_0x8321('0x35')]);_0x56e62f[_0x8321('0x38')]=_['intersection'](_0x5a0782[_0x8321('0x34')],qs[_0x8321('0x39')](_0x48c971[_0x8321('0x35')][_0x8321('0x39')]));_0x56e62f[_0x8321('0x38')]=_0x56e62f[_0x8321('0x38')]['length']?_0x56e62f['attributes']:_0x5a0782[_0x8321('0x34')];if(!_0x48c971[_0x8321('0x35')][_0x8321('0x3a')](_0x8321('0x3b'))){_0x56e62f[_0x8321('0x20')]=qs['limit'](_0x48c971[_0x8321('0x35')][_0x8321('0x20')]);_0x56e62f[_0x8321('0x1d')]=qs['offset'](_0x48c971[_0x8321('0x35')][_0x8321('0x1d')]);}_0x56e62f['order']=qs[_0x8321('0x3c')](_0x48c971[_0x8321('0x35')][_0x8321('0x3c')]);_0x56e62f[_0x8321('0x3d')]=qs[_0x8321('0x36')](_['pick'](_0x48c971[_0x8321('0x35')],_0x5a0782[_0x8321('0x36')]),_0x466193);if(_0x48c971[_0x8321('0x35')][_0x8321('0x3e')]){_0x56e62f[_0x8321('0x3d')]=_[_0x8321('0x3f')](_0x56e62f[_0x8321('0x3d')],{'$or':_[_0x8321('0x2f')](_0x466193,function(_0x270031){if(_0x270031['type']!==_0x8321('0x40')){var _0x35cf57={};_0x35cf57[_0x270031[_0x8321('0x2c')]]={'$like':'%'+_0x48c971[_0x8321('0x35')][_0x8321('0x3e')]+'%'};return _0x35cf57;}})});}_0x56e62f=_[_0x8321('0x3f')]({},_0x56e62f,_0x48c971['options']);var _0x475a66={'where':_0x56e62f['where']};return db[_0x8321('0x41')][_0x8321('0x1f')](_0x475a66)['then'](function(_0x1cad3d){_0x48075e['count']=_0x1cad3d;if(_0x48c971['query'][_0x8321('0x42')]){_0x56e62f[_0x8321('0x43')]=[{'all':!![]}];}return db[_0x8321('0x41')]['findAll'](_0x56e62f);})[_0x8321('0x28')](function(_0x57d4dd){_0x48075e['rows']=_0x57d4dd;return _0x48075e;})[_0x8321('0x28')](respondWithFilteredResult(_0x24f9a2,_0x56e62f))[_0x8321('0x44')](handleError(_0x24f9a2,null));};exports[_0x8321('0x45')]=function(_0x13cb34,_0xd3a08d){var _0x4caf15={'raw':![],'where':{'id':_0x13cb34[_0x8321('0x46')]['id']}},_0x167f67={};_0x167f67[_0x8321('0x34')]=_['keys'](db[_0x8321('0x41')][_0x8321('0x30')]);_0x167f67[_0x8321('0x35')]=_['keys'](_0x13cb34[_0x8321('0x35')]);_0x167f67[_0x8321('0x36')]=_[_0x8321('0x37')](_0x167f67[_0x8321('0x34')],_0x167f67[_0x8321('0x35')]);_0x4caf15['attributes']=_[_0x8321('0x37')](_0x167f67['model'],qs[_0x8321('0x39')](_0x13cb34[_0x8321('0x35')][_0x8321('0x39')]));_0x4caf15[_0x8321('0x38')]=_0x4caf15['attributes']['length']?_0x4caf15['attributes']:_0x167f67['model'];if(_0x13cb34[_0x8321('0x35')][_0x8321('0x42')]){_0x4caf15[_0x8321('0x43')]=[{'all':!![]}];}_0x4caf15=_[_0x8321('0x3f')]({},_0x4caf15,_0x13cb34['options']);return db['DeskAccount'][_0x8321('0x47')](_0x4caf15)[_0x8321('0x28')](handleEntityNotFound(_0xd3a08d,null))[_0x8321('0x28')](respondWithResult(_0xd3a08d,null))[_0x8321('0x44')](handleError(_0xd3a08d,null));};exports[_0x8321('0x48')]=function(_0x167170,_0x4fb502){return db[_0x8321('0x41')][_0x8321('0x48')](_0x167170[_0x8321('0x49')],{})['then'](respondWithResult(_0x4fb502,0xc9))[_0x8321('0x44')](handleError(_0x4fb502,null));};exports['update']=function(_0x31698a,_0x66be6f){if(_0x31698a[_0x8321('0x49')]['id']){delete _0x31698a[_0x8321('0x49')]['id'];}return db[_0x8321('0x41')][_0x8321('0x47')]({'where':{'id':_0x31698a[_0x8321('0x46')]['id']}})[_0x8321('0x28')](handleEntityNotFound(_0x66be6f,null))['then'](saveUpdates(_0x31698a['body'],null))[_0x8321('0x28')](respondWithResult(_0x66be6f,null))[_0x8321('0x44')](handleError(_0x66be6f,null));};exports[_0x8321('0x27')]=function(_0x4b5b71,_0xbb94a9){return db[_0x8321('0x41')][_0x8321('0x47')]({'where':{'id':_0x4b5b71['params']['id']}})[_0x8321('0x28')](handleEntityNotFound(_0xbb94a9,null))[_0x8321('0x28')](removeEntity(_0xbb94a9,null))[_0x8321('0x44')](handleError(_0xbb94a9,null));};exports[_0x8321('0x4a')]=function(_0x4d9865,_0x2c0ace,_0x35dabc){var _0x400943={};var _0x3d0b47={};var _0x28ef64;var _0xf7963e;return db[_0x8321('0x41')][_0x8321('0x4b')]({'where':{'id':_0x4d9865['params']['id']}})['then'](handleEntityNotFound(_0x2c0ace,null))[_0x8321('0x28')](function(_0x29224c){if(_0x29224c){_0x28ef64=_0x29224c;_0x3d0b47['model']=_[_0x8321('0x4c')](db['DeskConfiguration'][_0x8321('0x30')]);_0x3d0b47[_0x8321('0x35')]=_[_0x8321('0x4c')](_0x4d9865[_0x8321('0x35')]);_0x3d0b47[_0x8321('0x36')]=_[_0x8321('0x37')](_0x3d0b47[_0x8321('0x34')],_0x3d0b47[_0x8321('0x35')]);_0x400943[_0x8321('0x38')]=_[_0x8321('0x37')](_0x3d0b47[_0x8321('0x34')],qs['fields'](_0x4d9865[_0x8321('0x35')][_0x8321('0x39')]));_0x400943[_0x8321('0x38')]=_0x400943[_0x8321('0x38')][_0x8321('0x4d')]?_0x400943[_0x8321('0x38')]:_0x3d0b47[_0x8321('0x34')];_0x400943[_0x8321('0x4e')]=qs[_0x8321('0x3c')](_0x4d9865[_0x8321('0x35')][_0x8321('0x3c')]);_0x400943[_0x8321('0x3d')]=qs[_0x8321('0x36')](_[_0x8321('0x4f')](_0x4d9865[_0x8321('0x35')],_0x3d0b47[_0x8321('0x36')]));if(_0x4d9865['query']['filter']){_0x400943[_0x8321('0x3d')]=_[_0x8321('0x3f')](_0x400943[_0x8321('0x3d')],{'$or':_[_0x8321('0x2f')](_0x400943[_0x8321('0x38')],function(_0x2adc50){var _0x501fbf={};_0x501fbf[_0x2adc50]={'$like':'%'+_0x4d9865[_0x8321('0x35')][_0x8321('0x3e')]+'%'};return _0x501fbf;})});}_0x400943=_[_0x8321('0x3f')]({},_0x400943,_0x4d9865['options']);return _0x28ef64[_0x8321('0x4a')](_0x400943);}})[_0x8321('0x28')](function(_0x41b831){if(_0x41b831){_0xf7963e=_0x41b831[_0x8321('0x4d')];if(!_0x4d9865[_0x8321('0x35')][_0x8321('0x3a')]('nolimit')){_0x400943['limit']=qs[_0x8321('0x20')](_0x4d9865['query']['limit']);_0x400943[_0x8321('0x1d')]=qs['offset'](_0x4d9865['query']['offset']);}return _0x28ef64[_0x8321('0x4a')](_0x400943);}})[_0x8321('0x28')](function(_0x2d0f31){if(_0x2d0f31){return _0x2d0f31?{'count':_0xf7963e,'rows':_0x2d0f31}:null;}})[_0x8321('0x28')](respondWithResult(_0x2c0ace,null))['catch'](handleError(_0x2c0ace,null));};exports[_0x8321('0x50')]=function(_0x352dbe,_0x2575f9,_0x2509da){if(_0x352dbe[_0x8321('0x49')]['id']){delete _0x352dbe[_0x8321('0x49')]['id'];}return db[_0x8321('0x41')][_0x8321('0x4b')]({'where':{'id':_0x352dbe[_0x8321('0x46')]['id']}})[_0x8321('0x28')](handleEntityNotFound(_0x2575f9,null))['then'](function(_0x5969c3){if(_0x5969c3){_0x352dbe[_0x8321('0x49')][_0x8321('0x51')]=_0x5969c3['id'];_0x352dbe[_0x8321('0x49')][_0x8321('0x52')]=integrations[_0x8321('0x53')](_0x352dbe[_0x8321('0x49')]['channel'],_0x352dbe['body'][_0x8321('0x32')]);_0x352dbe[_0x8321('0x49')][_0x8321('0x54')]=integrations['getDescriptions'](_0x352dbe[_0x8321('0x49')][_0x8321('0x55')],_0x352dbe['body'][_0x8321('0x32')]);return db['DeskConfiguration']['create'](_0x352dbe[_0x8321('0x49')],{'include':[{'model':db[_0x8321('0x56')],'as':'Subjects'},{'model':db[_0x8321('0x56')],'as':'Descriptions'}]});}return null;})[_0x8321('0x28')](respondWithResult(_0x2575f9,null))[_0x8321('0x44')](handleError(_0x2575f9,null));};exports[_0x8321('0x57')]=function(_0x42a2bc,_0x301380,_0x1aeb7e){var _0x514e9c=[{'name':_0x8321('0x58'),'label':_0x8321('0x58'),'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 _0x4c1e06='';return db[_0x8321('0x41')][_0x8321('0x4b')]({'where':{'id':_0x42a2bc[_0x8321('0x46')]['id']},'attributes':['id',_0x8321('0x59'),_0x8321('0x5a'),_0x8321('0x5b'),'password',_0x8321('0x5c'),'consumerSecret','token',_0x8321('0x5d')]})['then'](handleEntityNotFound(_0x301380,null))[_0x8321('0x28')](function(_0x3fd294){if(_0x3fd294){_0x4c1e06=_0x3fd294[_0x8321('0x59')];var _0x353440=_0x4c1e06[_0x8321('0x5e')](-0x1);if(_0x353440==='/'){_0x4c1e06=_0x4c1e06[_0x8321('0x5f')](0x0,_0x4c1e06[_0x8321('0x60')](_0x353440));}var _0x312ab9={'method':'GET','uri':util[_0x8321('0x61')]('%s/custom_fields',_0x4c1e06),'headers':{'Content-Type':_0x8321('0x62'),'Accept':'application/json'},'json':!![]};if(_0x3fd294[_0x8321('0x5a')]==='basic'){_0x312ab9[_0x8321('0x63')][_0x8321('0x64')]=util['format'](_0x8321('0x65'),new Buffer(util[_0x8321('0x61')](_0x8321('0x66'),_0x3fd294[_0x8321('0x5b')],_0x3fd294[_0x8321('0x67')]))['toString'](_0x8321('0x68')));}return rp(_0x312ab9)[_0x8321('0x28')](function(_0x4e6e79){return _0x514e9c[_0x8321('0x69')](_[_0x8321('0x2f')](_0x4e6e79[_0x8321('0x6a')]['entries'],function(_0x1e8bf6){return{'id':_0x1e8bf6['name'],'name':_0x1e8bf6[_0x8321('0x2c')],'type':_0x1e8bf6['type'],'active':_0x1e8bf6[_0x8321('0x6b')],'label':_0x1e8bf6[_0x8321('0x6c')],'custom':!![]};}));});}})[_0x8321('0x28')](function(_0x3f1642){return{'count':_0x3f1642[_0x8321('0x4d')],'rows':_0x3f1642};})[_0x8321('0x28')](respondWithResult(_0x301380,null))['catch'](function(_0x275df7){var _0x3eaafb=_0x42a2bc[_0x8321('0x35')][_0x8321('0x6d')]?0x1f4:_0x275df7[_0x8321('0x6e')]||0x1f4;logger[_0x8321('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x8321('0x57'),_0x3eaafb,JSON[_0x8321('0x6f')](_0x275df7));delete _0x275df7[_0x8321('0x2c')];if(_0x3eaafb===0x191){_0x3eaafb=0x190;}_0x301380[_0x8321('0x1b')](_0x3eaafb)[_0x8321('0x2d')](_0x42a2bc[_0x8321('0x35')][_0x8321('0x6d')]?{'message':_0x8321('0x70'),'statusCode':_0x275df7[_0x8321('0x6e')]}:_0x275df7);});}; \ No newline at end of file +var _0xeb47=['where','pick','filter','merge','options','DeskAccount','include','findAll','rows','catch','show','params','keys','find','create','update','body','getConfigurations','findOne','rawAttributes','order','Subjects','getSubjects','channel','Descriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Authorization','toString','base64','concat','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','json','apply','reject','save','then','destroy','sendStatus','stack','send','index','map','fieldName','type','key','name','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xeb47,0xa4));var _0x7eb4=function(_0x4171d9,_0x50c029){_0x4171d9=_0x4171d9-0x0;var _0x2997d2=_0xeb47[_0x4171d9];return _0x2997d2;};'use strict';var emlformat=require(_0x7eb4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7eb4('0x1'));var moment=require(_0x7eb4('0x2'));var BPromise=require(_0x7eb4('0x3'));var Mustache=require(_0x7eb4('0x4'));var util=require(_0x7eb4('0x5'));var path=require(_0x7eb4('0x6'));var sox=require(_0x7eb4('0x7'));var csv=require('to-csv');var ejs=require(_0x7eb4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7eb4('0x9'));var squel=require('squel');var crypto=require(_0x7eb4('0xa'));var jsforce=require(_0x7eb4('0xb'));var deskjs=require(_0x7eb4('0xc'));var toCsv=require(_0x7eb4('0xd'));var querystring=require(_0x7eb4('0xe'));var Papa=require(_0x7eb4('0xf'));var Redis=require(_0x7eb4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7eb4('0x11'));var as=require(_0x7eb4('0x12'));var hardwareService=require(_0x7eb4('0x13'));var logger=require(_0x7eb4('0x14'))('api');var utils=require(_0x7eb4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7eb4('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7eb4('0x17'));function respondWithStatusCode(_0x57e423,_0x3ca6c8){_0x3ca6c8=_0x3ca6c8||0xcc;return function(_0x267b60){if(_0x267b60){return _0x57e423['sendStatus'](_0x3ca6c8);}return _0x57e423[_0x7eb4('0x18')](_0x3ca6c8)[_0x7eb4('0x19')]();};}function respondWithResult(_0x5e19b8,_0xb231cd){_0xb231cd=_0xb231cd||0xc8;return function(_0xa8332b){if(_0xa8332b){return _0x5e19b8[_0x7eb4('0x18')](_0xb231cd)['json'](_0xa8332b);}};}function respondWithFilteredResult(_0x2c2200,_0x59158e){return function(_0x276ff4){if(_0x276ff4){var _0x57ec44=typeof _0x59158e['offset']===_0x7eb4('0x1a')&&typeof _0x59158e['limit']===_0x7eb4('0x1a');var _0x44bc99=_0x276ff4[_0x7eb4('0x1b')];var _0x505bbe=_0x57ec44?0x0:_0x59158e[_0x7eb4('0x1c')];var _0x1c16ed=_0x57ec44?_0x276ff4[_0x7eb4('0x1b')]:_0x59158e[_0x7eb4('0x1c')]+_0x59158e[_0x7eb4('0x1d')];var _0x2e3fc7;if(_0x1c16ed>=_0x44bc99){_0x1c16ed=_0x44bc99;_0x2e3fc7=0xc8;}else{_0x2e3fc7=0xce;}_0x2c2200[_0x7eb4('0x18')](_0x2e3fc7);return _0x2c2200[_0x7eb4('0x1e')]('Content-Range',_0x505bbe+'-'+_0x1c16ed+'/'+_0x44bc99)[_0x7eb4('0x1f')](_0x276ff4);}return null;};}function patchUpdates(_0x36bceb){return function(_0x3ff235){try{jsonpatch[_0x7eb4('0x20')](_0x3ff235,_0x36bceb,!![]);}catch(_0x7271df){return BPromise[_0x7eb4('0x21')](_0x7271df);}return _0x3ff235[_0x7eb4('0x22')]();};}function saveUpdates(_0x2125ae,_0x3b659f){return function(_0x567dea){if(_0x567dea){return _0x567dea['update'](_0x2125ae)[_0x7eb4('0x23')](function(_0x1fca4e){return _0x1fca4e;});}return null;};}function removeEntity(_0x1db70a,_0x5d38a0){return function(_0x39ea65){if(_0x39ea65){return _0x39ea65[_0x7eb4('0x24')]()[_0x7eb4('0x23')](function(){_0x1db70a[_0x7eb4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x335f75,_0x4e8d68){return function(_0x14fdb1){if(!_0x14fdb1){_0x335f75[_0x7eb4('0x25')](0x194);}return _0x14fdb1;};}function handleError(_0xe2295d,_0x24d960){_0x24d960=_0x24d960||0x1f4;return function(_0x31a12){logger['error'](_0x31a12[_0x7eb4('0x26')]);if(_0x31a12['name']){delete _0x31a12['name'];}_0xe2295d[_0x7eb4('0x18')](_0x24d960)[_0x7eb4('0x27')](_0x31a12);};}exports[_0x7eb4('0x28')]=function(_0x3d8557,_0x32a1eb){var _0x492597={},_0x41e618={},_0x5251b3={'count':0x0,'rows':[]};var _0x1e298=_[_0x7eb4('0x29')](db['DeskAccount']['rawAttributes'],function(_0xffdf02){return{'name':_0xffdf02[_0x7eb4('0x2a')],'type':_0xffdf02[_0x7eb4('0x2b')][_0x7eb4('0x2c')]};});_0x41e618['model']=_['map'](_0x1e298,_0x7eb4('0x2d'));_0x41e618[_0x7eb4('0x2e')]=_['keys'](_0x3d8557[_0x7eb4('0x2e')]);_0x41e618[_0x7eb4('0x2f')]=_['intersection'](_0x41e618[_0x7eb4('0x30')],_0x41e618[_0x7eb4('0x2e')]);_0x492597['attributes']=_[_0x7eb4('0x31')](_0x41e618[_0x7eb4('0x30')],qs[_0x7eb4('0x32')](_0x3d8557[_0x7eb4('0x2e')]['fields']));_0x492597[_0x7eb4('0x33')]=_0x492597['attributes'][_0x7eb4('0x34')]?_0x492597[_0x7eb4('0x33')]:_0x41e618['model'];if(!_0x3d8557[_0x7eb4('0x2e')][_0x7eb4('0x35')](_0x7eb4('0x36'))){_0x492597[_0x7eb4('0x1d')]=qs['limit'](_0x3d8557['query'][_0x7eb4('0x1d')]);_0x492597[_0x7eb4('0x1c')]=qs[_0x7eb4('0x1c')](_0x3d8557[_0x7eb4('0x2e')][_0x7eb4('0x1c')]);}_0x492597['order']=qs[_0x7eb4('0x37')](_0x3d8557[_0x7eb4('0x2e')][_0x7eb4('0x37')]);_0x492597[_0x7eb4('0x38')]=qs[_0x7eb4('0x2f')](_[_0x7eb4('0x39')](_0x3d8557[_0x7eb4('0x2e')],_0x41e618[_0x7eb4('0x2f')]),_0x1e298);if(_0x3d8557[_0x7eb4('0x2e')][_0x7eb4('0x3a')]){_0x492597[_0x7eb4('0x38')]=_[_0x7eb4('0x3b')](_0x492597[_0x7eb4('0x38')],{'$or':_[_0x7eb4('0x29')](_0x1e298,function(_0x5d55af){if(_0x5d55af[_0x7eb4('0x2b')]!=='VIRTUAL'){var _0x27e04e={};_0x27e04e[_0x5d55af['name']]={'$like':'%'+_0x3d8557[_0x7eb4('0x2e')][_0x7eb4('0x3a')]+'%'};return _0x27e04e;}})});}_0x492597=_[_0x7eb4('0x3b')]({},_0x492597,_0x3d8557[_0x7eb4('0x3c')]);var _0xc065cb={'where':_0x492597[_0x7eb4('0x38')]};return db[_0x7eb4('0x3d')][_0x7eb4('0x1b')](_0xc065cb)[_0x7eb4('0x23')](function(_0x102833){_0x5251b3['count']=_0x102833;if(_0x3d8557[_0x7eb4('0x2e')]['includeAll']){_0x492597[_0x7eb4('0x3e')]=[{'all':!![]}];}return db[_0x7eb4('0x3d')][_0x7eb4('0x3f')](_0x492597);})[_0x7eb4('0x23')](function(_0x4a2299){_0x5251b3[_0x7eb4('0x40')]=_0x4a2299;return _0x5251b3;})[_0x7eb4('0x23')](respondWithFilteredResult(_0x32a1eb,_0x492597))[_0x7eb4('0x41')](handleError(_0x32a1eb,null));};exports[_0x7eb4('0x42')]=function(_0x3b86d4,_0x5bcf46){var _0x1f2ae9={'raw':![],'where':{'id':_0x3b86d4[_0x7eb4('0x43')]['id']}},_0x35ba0e={};_0x35ba0e[_0x7eb4('0x30')]=_[_0x7eb4('0x44')](db[_0x7eb4('0x3d')]['rawAttributes']);_0x35ba0e[_0x7eb4('0x2e')]=_[_0x7eb4('0x44')](_0x3b86d4[_0x7eb4('0x2e')]);_0x35ba0e[_0x7eb4('0x2f')]=_[_0x7eb4('0x31')](_0x35ba0e[_0x7eb4('0x30')],_0x35ba0e[_0x7eb4('0x2e')]);_0x1f2ae9[_0x7eb4('0x33')]=_['intersection'](_0x35ba0e[_0x7eb4('0x30')],qs[_0x7eb4('0x32')](_0x3b86d4[_0x7eb4('0x2e')][_0x7eb4('0x32')]));_0x1f2ae9[_0x7eb4('0x33')]=_0x1f2ae9['attributes'][_0x7eb4('0x34')]?_0x1f2ae9[_0x7eb4('0x33')]:_0x35ba0e[_0x7eb4('0x30')];if(_0x3b86d4['query']['includeAll']){_0x1f2ae9[_0x7eb4('0x3e')]=[{'all':!![]}];}_0x1f2ae9=_[_0x7eb4('0x3b')]({},_0x1f2ae9,_0x3b86d4[_0x7eb4('0x3c')]);return db['DeskAccount'][_0x7eb4('0x45')](_0x1f2ae9)[_0x7eb4('0x23')](handleEntityNotFound(_0x5bcf46,null))[_0x7eb4('0x23')](respondWithResult(_0x5bcf46,null))[_0x7eb4('0x41')](handleError(_0x5bcf46,null));};exports[_0x7eb4('0x46')]=function(_0x4bb837,_0x3df4b6){return db[_0x7eb4('0x3d')][_0x7eb4('0x46')](_0x4bb837['body'],{})['then'](respondWithResult(_0x3df4b6,0xc9))[_0x7eb4('0x41')](handleError(_0x3df4b6,null));};exports[_0x7eb4('0x47')]=function(_0x67f183,_0x5a3c71){if(_0x67f183['body']['id']){delete _0x67f183[_0x7eb4('0x48')]['id'];}return db['DeskAccount'][_0x7eb4('0x45')]({'where':{'id':_0x67f183[_0x7eb4('0x43')]['id']}})[_0x7eb4('0x23')](handleEntityNotFound(_0x5a3c71,null))['then'](saveUpdates(_0x67f183[_0x7eb4('0x48')],null))['then'](respondWithResult(_0x5a3c71,null))[_0x7eb4('0x41')](handleError(_0x5a3c71,null));};exports[_0x7eb4('0x24')]=function(_0x15c897,_0x4efad3){return db[_0x7eb4('0x3d')][_0x7eb4('0x45')]({'where':{'id':_0x15c897[_0x7eb4('0x43')]['id']}})['then'](handleEntityNotFound(_0x4efad3,null))[_0x7eb4('0x23')](removeEntity(_0x4efad3,null))[_0x7eb4('0x41')](handleError(_0x4efad3,null));};exports[_0x7eb4('0x49')]=function(_0x339700,_0xbe2904,_0x5927a6){var _0x272a28={};var _0x9e090c={};var _0x32ec55;var _0x3205da;return db['DeskAccount'][_0x7eb4('0x4a')]({'where':{'id':_0x339700['params']['id']}})[_0x7eb4('0x23')](handleEntityNotFound(_0xbe2904,null))[_0x7eb4('0x23')](function(_0x323beb){if(_0x323beb){_0x32ec55=_0x323beb;_0x9e090c[_0x7eb4('0x30')]=_['keys'](db['DeskConfiguration'][_0x7eb4('0x4b')]);_0x9e090c[_0x7eb4('0x2e')]=_['keys'](_0x339700[_0x7eb4('0x2e')]);_0x9e090c['filters']=_['intersection'](_0x9e090c[_0x7eb4('0x30')],_0x9e090c[_0x7eb4('0x2e')]);_0x272a28[_0x7eb4('0x33')]=_[_0x7eb4('0x31')](_0x9e090c[_0x7eb4('0x30')],qs['fields'](_0x339700[_0x7eb4('0x2e')][_0x7eb4('0x32')]));_0x272a28[_0x7eb4('0x33')]=_0x272a28['attributes'][_0x7eb4('0x34')]?_0x272a28[_0x7eb4('0x33')]:_0x9e090c[_0x7eb4('0x30')];_0x272a28[_0x7eb4('0x4c')]=qs[_0x7eb4('0x37')](_0x339700['query'][_0x7eb4('0x37')]);_0x272a28[_0x7eb4('0x38')]=qs['filters'](_[_0x7eb4('0x39')](_0x339700[_0x7eb4('0x2e')],_0x9e090c[_0x7eb4('0x2f')]));if(_0x339700['query'][_0x7eb4('0x3a')]){_0x272a28[_0x7eb4('0x38')]=_[_0x7eb4('0x3b')](_0x272a28[_0x7eb4('0x38')],{'$or':_[_0x7eb4('0x29')](_0x272a28[_0x7eb4('0x33')],function(_0x43c61c){var _0x5d4510={};_0x5d4510[_0x43c61c]={'$like':'%'+_0x339700[_0x7eb4('0x2e')]['filter']+'%'};return _0x5d4510;})});}_0x272a28=_[_0x7eb4('0x3b')]({},_0x272a28,_0x339700[_0x7eb4('0x3c')]);return _0x32ec55[_0x7eb4('0x49')](_0x272a28);}})[_0x7eb4('0x23')](function(_0x4b319d){if(_0x4b319d){_0x3205da=_0x4b319d[_0x7eb4('0x34')];if(!_0x339700['query']['hasOwnProperty'](_0x7eb4('0x36'))){_0x272a28['limit']=qs[_0x7eb4('0x1d')](_0x339700[_0x7eb4('0x2e')][_0x7eb4('0x1d')]);_0x272a28[_0x7eb4('0x1c')]=qs[_0x7eb4('0x1c')](_0x339700[_0x7eb4('0x2e')]['offset']);}return _0x32ec55[_0x7eb4('0x49')](_0x272a28);}})[_0x7eb4('0x23')](function(_0x2b9db0){if(_0x2b9db0){return _0x2b9db0?{'count':_0x3205da,'rows':_0x2b9db0}:null;}})[_0x7eb4('0x23')](respondWithResult(_0xbe2904,null))[_0x7eb4('0x41')](handleError(_0xbe2904,null));};exports['addConfiguration']=function(_0x15ebf8,_0xba1fd5,_0x4495bc){if(_0x15ebf8[_0x7eb4('0x48')]['id']){delete _0x15ebf8[_0x7eb4('0x48')]['id'];}return db[_0x7eb4('0x3d')]['findOne']({'where':{'id':_0x15ebf8[_0x7eb4('0x43')]['id']}})[_0x7eb4('0x23')](handleEntityNotFound(_0xba1fd5,null))[_0x7eb4('0x23')](function(_0x3d2410){if(_0x3d2410){_0x15ebf8['body']['AccountId']=_0x3d2410['id'];_0x15ebf8[_0x7eb4('0x48')][_0x7eb4('0x4d')]=integrations[_0x7eb4('0x4e')](_0x15ebf8[_0x7eb4('0x48')][_0x7eb4('0x4f')],_0x15ebf8['body']['type']);_0x15ebf8[_0x7eb4('0x48')][_0x7eb4('0x50')]=integrations['getDescriptions'](_0x15ebf8[_0x7eb4('0x48')][_0x7eb4('0x4f')],_0x15ebf8['body'][_0x7eb4('0x2b')]);return db[_0x7eb4('0x51')][_0x7eb4('0x46')](_0x15ebf8[_0x7eb4('0x48')],{'include':[{'model':db[_0x7eb4('0x52')],'as':'Subjects'},{'model':db[_0x7eb4('0x52')],'as':'Descriptions'}]});}return null;})[_0x7eb4('0x23')](respondWithResult(_0xba1fd5,null))[_0x7eb4('0x41')](handleError(_0xba1fd5,null));};exports[_0x7eb4('0x53')]=function(_0x2292e5,_0x38768f,_0x4dd515){var _0x57fde9=[{'name':'priority','label':_0x7eb4('0x54'),'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 _0x339281='';return db['DeskAccount'][_0x7eb4('0x4a')]({'where':{'id':_0x2292e5[_0x7eb4('0x43')]['id']},'attributes':['id',_0x7eb4('0x55'),_0x7eb4('0x56'),_0x7eb4('0x57'),_0x7eb4('0x58'),'consumerKey',_0x7eb4('0x59'),_0x7eb4('0x5a'),'tokenSecret']})[_0x7eb4('0x23')](handleEntityNotFound(_0x38768f,null))[_0x7eb4('0x23')](function(_0x518179){if(_0x518179){_0x339281=_0x518179[_0x7eb4('0x55')];var _0xc973ad=_0x339281[_0x7eb4('0x5b')](-0x1);if(_0xc973ad==='/'){_0x339281=_0x339281[_0x7eb4('0x5c')](0x0,_0x339281[_0x7eb4('0x5d')](_0xc973ad));}var _0x345382={'method':_0x7eb4('0x5e'),'uri':util[_0x7eb4('0x5f')]('%s/custom_fields',_0x339281),'headers':{'Content-Type':_0x7eb4('0x60'),'Accept':_0x7eb4('0x60')},'json':!![]};if(_0x518179[_0x7eb4('0x56')]===_0x7eb4('0x61')){_0x345382[_0x7eb4('0x62')][_0x7eb4('0x63')]=util[_0x7eb4('0x5f')]('Basic\x20%s',new Buffer(util[_0x7eb4('0x5f')]('%s:%s',_0x518179['username'],_0x518179[_0x7eb4('0x58')]))[_0x7eb4('0x64')](_0x7eb4('0x65')));}return rp(_0x345382)[_0x7eb4('0x23')](function(_0x56b970){return _0x57fde9[_0x7eb4('0x66')](_[_0x7eb4('0x29')](_0x56b970['_embedded']['entries'],function(_0x4e2ca2){return{'id':_0x4e2ca2[_0x7eb4('0x2d')],'name':_0x4e2ca2[_0x7eb4('0x2d')],'type':_0x4e2ca2[_0x7eb4('0x2b')],'active':_0x4e2ca2[_0x7eb4('0x67')],'label':_0x4e2ca2[_0x7eb4('0x68')],'custom':!![]};}));});}})['then'](function(_0x14851f){return{'count':_0x14851f['length'],'rows':_0x14851f};})[_0x7eb4('0x23')](respondWithResult(_0x38768f,null))[_0x7eb4('0x41')](function(_0x33cb37){var _0x2a2a55=_0x2292e5[_0x7eb4('0x2e')][_0x7eb4('0x69')]?0x1f4:_0x33cb37[_0x7eb4('0x6a')]||0x1f4;logger[_0x7eb4('0x6b')](_0x7eb4('0x6c'),_0x7eb4('0x53'),_0x2a2a55,JSON[_0x7eb4('0x6d')](_0x33cb37));delete _0x33cb37[_0x7eb4('0x2d')];if(_0x2a2a55===0x191){_0x2a2a55=0x190;}_0x38768f[_0x7eb4('0x18')](_0x2a2a55)[_0x7eb4('0x27')](_0x2292e5[_0x7eb4('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x33cb37[_0x7eb4('0x6a')]}:_0x33cb37);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 2b922fd..1dbf1aa 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 _0x6c7c=['./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','../../config/logger','bluebird','path','../../config/environment'];(function(_0x5374d2,_0x2d943e){var _0x169b92=function(_0x3a9dd9){while(--_0x3a9dd9){_0x5374d2['push'](_0x5374d2['shift']());}};_0x169b92(++_0x2d943e);}(_0x6c7c,0xcb));var _0xc6c7=function(_0x25106f,_0x1d3509){_0x25106f=_0x25106f-0x0;var _0x47000d=_0x6c7c[_0x25106f];return _0x47000d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc6c7('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc6c7('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6c7('0x2'));var rimraf=require('rimraf');var config=require(_0xc6c7('0x3'));var attributes=require(_0xc6c7('0x4'));var integrations=require(_0xc6c7('0x5'));module['exports']=function(_0x5f01d7,_0x320e40){return _0x5f01d7[_0xc6c7('0x6')](_0xc6c7('0x7'),attributes,{'tableName':_0xc6c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6ec=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2e0dca,_0x45a901){var _0x31605b=function(_0x4dbb8a){while(--_0x4dbb8a){_0x2e0dca['push'](_0x2e0dca['shift']());}};_0x31605b(++_0x45a901);}(_0xa6ec,0x1c5));var _0xca6e=function(_0x4f79bc,_0x3359a9){_0x4f79bc=_0x4f79bc-0x0;var _0xdf0ec3=_0xa6ec[_0x4f79bc];return _0xdf0ec3;};'use strict';var _=require(_0xca6e('0x0'));var util=require(_0xca6e('0x1'));var logger=require(_0xca6e('0x2'))(_0xca6e('0x3'));var moment=require(_0xca6e('0x4'));var BPromise=require('bluebird');var rp=require(_0xca6e('0x5'));var fs=require('fs');var path=require(_0xca6e('0x6'));var rimraf=require(_0xca6e('0x7'));var config=require(_0xca6e('0x8'));var attributes=require(_0xca6e('0x9'));var integrations=require(_0xca6e('0xa'));module[_0xca6e('0xb')]=function(_0x12521c,_0x2c0452){return _0x12521c[_0xca6e('0xc')]('DeskAccount',attributes,{'tableName':_0xca6e('0xd'),'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 3df4252..99a8992 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 _0x7906=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','where','map','include','model','attributes','GetDeskAccount','ShowDeskAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s'];(function(_0x23e5ce,_0x57584d){var _0x2ce19b=function(_0x318e1f){while(--_0x318e1f){_0x23e5ce['push'](_0x23e5ce['shift']());}};_0x2ce19b(++_0x57584d);}(_0x7906,0x1ac));var _0x6790=function(_0x45c7a2,_0x16eca0){_0x45c7a2=_0x45c7a2-0x0;var _0x4a2ab4=_0x7906[_0x45c7a2];return _0x4a2ab4;};'use strict';var _=require(_0x6790('0x0'));var util=require('util');var moment=require(_0x6790('0x1'));var BPromise=require(_0x6790('0x2'));var rs=require(_0x6790('0x3'));var fs=require('fs');var Redis=require(_0x6790('0x4'));var db=require(_0x6790('0x5'))['db'];var utils=require(_0x6790('0x6'));var logger=require(_0x6790('0x7'))(_0x6790('0x8'));var config=require(_0x6790('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6790('0xa')][_0x6790('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x999c6c,_0xce01fe,_0x1fb505){return new BPromise(function(_0x4056ea,_0x5d65aa){return client[_0x6790('0xc')](_0x999c6c,_0x1fb505)[_0x6790('0xd')](function(_0x2fe194){logger[_0x6790('0xe')](_0x6790('0xf'),_0xce01fe,_0x6790('0x10'));logger[_0x6790('0x11')](_0x6790('0x12'),_0xce01fe,_0x6790('0x10'),JSON[_0x6790('0x13')](_0x2fe194));if(_0x2fe194['error']){if(_0x2fe194[_0x6790('0x14')][_0x6790('0x15')]===0x1f4){logger[_0x6790('0x14')]('DeskAccount,\x20%s,\x20%s',_0xce01fe,_0x2fe194['error'][_0x6790('0x16')]);return _0x5d65aa(_0x2fe194[_0x6790('0x14')][_0x6790('0x16')]);}logger['error'](_0x6790('0xf'),_0xce01fe,_0x2fe194['error']['message']);return _0x4056ea(_0x2fe194[_0x6790('0x14')][_0x6790('0x16')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0xce01fe,_0x6790('0x10'));_0x4056ea(_0x2fe194[_0x6790('0x17')][_0x6790('0x16')]);}})[_0x6790('0x18')](function(_0x38f30c){logger[_0x6790('0x14')](_0x6790('0xf'),_0xce01fe,_0x38f30c);_0x5d65aa(_0x38f30c);});});}exports['GetDeskAccount']=function(_0x539f7c){var _0x478dfd=this;return new Promise(function(_0x4249ae,_0x3809b8){return db[_0x6790('0x19')][_0x6790('0x1a')]({'raw':_0x539f7c[_0x6790('0x1b')]?_0x539f7c[_0x6790('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x539f7c[_0x6790('0x1b')]?_0x539f7c[_0x6790('0x1b')][_0x6790('0x1c')]||null:null,'attributes':_0x539f7c[_0x6790('0x1b')]?_0x539f7c[_0x6790('0x1b')]['attributes']||null:null,'limit':_0x539f7c['options']?_0x539f7c[_0x6790('0x1b')]['limit']||null:null,'include':_0x539f7c[_0x6790('0x1b')]?_0x539f7c['options']['include']?_[_0x6790('0x1d')](_0x539f7c['options'][_0x6790('0x1e')],function(_0x38f39e){return{'model':db[_0x38f39e[_0x6790('0x1f')]],'as':_0x38f39e['as'],'attributes':_0x38f39e[_0x6790('0x20')],'include':_0x38f39e[_0x6790('0x1e')]?_[_0x6790('0x1d')](_0x38f39e[_0x6790('0x1e')],function(_0x2accd9){return{'model':db[_0x2accd9[_0x6790('0x1f')]],'as':_0x2accd9['as'],'attributes':_0x2accd9[_0x6790('0x20')],'include':_0x2accd9[_0x6790('0x1e')]?_[_0x6790('0x1d')](_0x2accd9[_0x6790('0x1e')],function(_0x10d4c4){return{'model':db[_0x10d4c4['model']],'as':_0x10d4c4['as'],'attributes':_0x10d4c4['attributes']};}):[]};}):[]};}):[]:[]})[_0x6790('0xd')](function(_0x55b850){logger[_0x6790('0xe')](_0x6790('0x21'),_0x539f7c);logger[_0x6790('0x11')]('GetDeskAccount',_0x539f7c,JSON['stringify'](_0x55b850));_0x4249ae(_0x55b850);})[_0x6790('0x18')](function(_0x242c2c){logger[_0x6790('0x14')](_0x6790('0x21'),_0x242c2c['message'],_0x539f7c);_0x3809b8(_0x478dfd['error'](0x1f4,_0x242c2c[_0x6790('0x16')]));});});};exports[_0x6790('0x22')]=function(_0x3fbbf0){var _0x134f99=this;return new Promise(function(_0x35cecb,_0x1ed34a){return db[_0x6790('0x19')][_0x6790('0x23')]({'raw':_0x3fbbf0[_0x6790('0x1b')]?_0x3fbbf0[_0x6790('0x1b')][_0x6790('0x24')]===undefined?!![]:![]:!![],'where':_0x3fbbf0['options']?_0x3fbbf0[_0x6790('0x1b')]['where']||null:null,'attributes':_0x3fbbf0[_0x6790('0x1b')]?_0x3fbbf0[_0x6790('0x1b')][_0x6790('0x20')]||null:null,'include':_0x3fbbf0[_0x6790('0x1b')]?_0x3fbbf0[_0x6790('0x1b')]['include']?_[_0x6790('0x1d')](_0x3fbbf0[_0x6790('0x1b')][_0x6790('0x1e')],function(_0x5e200b){return{'model':db[_0x5e200b[_0x6790('0x1f')]],'as':_0x5e200b['as'],'attributes':_0x5e200b[_0x6790('0x20')],'include':_0x5e200b['include']?_[_0x6790('0x1d')](_0x5e200b[_0x6790('0x1e')],function(_0x2ea820){return{'model':db[_0x2ea820['model']],'as':_0x2ea820['as'],'attributes':_0x2ea820['attributes'],'include':_0x2ea820[_0x6790('0x1e')]?_[_0x6790('0x1d')](_0x2ea820[_0x6790('0x1e')],function(_0x423c60){return{'model':db[_0x423c60['model']],'as':_0x423c60['as'],'attributes':_0x423c60[_0x6790('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6790('0xd')](function(_0x15909f){logger[_0x6790('0xe')](_0x6790('0x22'),_0x3fbbf0);logger[_0x6790('0x11')]('ShowDeskAccount',_0x3fbbf0,JSON[_0x6790('0x13')](_0x15909f));_0x35cecb(_0x15909f);})['catch'](function(_0x393f6b){logger[_0x6790('0x14')]('ShowDeskAccount',_0x393f6b['message'],_0x3fbbf0);_0x1ed34a(_0x134f99[_0x6790('0x14')](0x1f4,_0x393f6b[_0x6790('0x16')]));});});}; \ No newline at end of file +var _0xb1be=['rpc','../../config/environment','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s','error','message','result','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model','stringify','catch','ShowDeskAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1be,0x139));var _0xeb1b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb1be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeb1b('0x0'));var util=require(_0xeb1b('0x1'));var moment=require(_0xeb1b('0x2'));var BPromise=require(_0xeb1b('0x3'));var rs=require(_0xeb1b('0x4'));var fs=require('fs');var Redis=require(_0xeb1b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb1b('0x6'));var logger=require('../../config/logger')(_0xeb1b('0x7'));var config=require(_0xeb1b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x221a4f,_0xc4e0d8,_0x2ccbad){return new BPromise(function(_0x480bab,_0x403985){return client[_0xeb1b('0xa')](_0x221a4f,_0x2ccbad)[_0xeb1b('0xb')](function(_0x153d46){logger[_0xeb1b('0xc')]('DeskAccount,\x20%s,\x20%s',_0xc4e0d8,_0xeb1b('0xd'));logger[_0xeb1b('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xc4e0d8,'request\x20sent',JSON['stringify'](_0x153d46));if(_0x153d46['error']){if(_0x153d46['error']['code']===0x1f4){logger['error'](_0xeb1b('0xf'),_0xc4e0d8,_0x153d46[_0xeb1b('0x10')][_0xeb1b('0x11')]);return _0x403985(_0x153d46[_0xeb1b('0x10')][_0xeb1b('0x11')]);}logger[_0xeb1b('0x10')]('DeskAccount,\x20%s,\x20%s',_0xc4e0d8,_0x153d46[_0xeb1b('0x10')]['message']);return _0x480bab(_0x153d46['error'][_0xeb1b('0x11')]);}else{logger[_0xeb1b('0xc')](_0xeb1b('0xf'),_0xc4e0d8,_0xeb1b('0xd'));_0x480bab(_0x153d46[_0xeb1b('0x12')]['message']);}})['catch'](function(_0x243f8c){logger[_0xeb1b('0x10')](_0xeb1b('0xf'),_0xc4e0d8,_0x243f8c);_0x403985(_0x243f8c);});});}exports[_0xeb1b('0x13')]=function(_0x2da777){var _0x4da1e6=this;return new Promise(function(_0xaa721,_0x56a122){return db['DeskAccount'][_0xeb1b('0x14')]({'raw':_0x2da777[_0xeb1b('0x15')]?_0x2da777[_0xeb1b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2da777[_0xeb1b('0x15')]?_0x2da777[_0xeb1b('0x15')][_0xeb1b('0x16')]||null:null,'attributes':_0x2da777[_0xeb1b('0x15')]?_0x2da777['options'][_0xeb1b('0x17')]||null:null,'limit':_0x2da777[_0xeb1b('0x15')]?_0x2da777[_0xeb1b('0x15')][_0xeb1b('0x18')]||null:null,'include':_0x2da777[_0xeb1b('0x15')]?_0x2da777[_0xeb1b('0x15')][_0xeb1b('0x19')]?_[_0xeb1b('0x1a')](_0x2da777[_0xeb1b('0x15')][_0xeb1b('0x19')],function(_0xf2d959){return{'model':db[_0xf2d959[_0xeb1b('0x1b')]],'as':_0xf2d959['as'],'attributes':_0xf2d959['attributes'],'include':_0xf2d959['include']?_['map'](_0xf2d959['include'],function(_0x37eda7){return{'model':db[_0x37eda7[_0xeb1b('0x1b')]],'as':_0x37eda7['as'],'attributes':_0x37eda7['attributes'],'include':_0x37eda7[_0xeb1b('0x19')]?_[_0xeb1b('0x1a')](_0x37eda7['include'],function(_0x2f664b){return{'model':db[_0x2f664b[_0xeb1b('0x1b')]],'as':_0x2f664b['as'],'attributes':_0x2f664b[_0xeb1b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b10ac){logger[_0xeb1b('0xc')]('GetDeskAccount',_0x2da777);logger[_0xeb1b('0xe')]('GetDeskAccount',_0x2da777,JSON[_0xeb1b('0x1c')](_0x4b10ac));_0xaa721(_0x4b10ac);})[_0xeb1b('0x1d')](function(_0x437b5f){logger[_0xeb1b('0x10')](_0xeb1b('0x13'),_0x437b5f[_0xeb1b('0x11')],_0x2da777);_0x56a122(_0x4da1e6[_0xeb1b('0x10')](0x1f4,_0x437b5f['message']));});});};exports[_0xeb1b('0x1e')]=function(_0x24feb3){var _0x171e99=this;return new Promise(function(_0x460038,_0x44dfc2){return db['DeskAccount']['find']({'raw':_0x24feb3[_0xeb1b('0x15')]?_0x24feb3[_0xeb1b('0x15')][_0xeb1b('0x1f')]===undefined?!![]:![]:!![],'where':_0x24feb3[_0xeb1b('0x15')]?_0x24feb3[_0xeb1b('0x15')][_0xeb1b('0x16')]||null:null,'attributes':_0x24feb3[_0xeb1b('0x15')]?_0x24feb3[_0xeb1b('0x15')][_0xeb1b('0x17')]||null:null,'include':_0x24feb3['options']?_0x24feb3[_0xeb1b('0x15')]['include']?_[_0xeb1b('0x1a')](_0x24feb3[_0xeb1b('0x15')][_0xeb1b('0x19')],function(_0x543679){return{'model':db[_0x543679[_0xeb1b('0x1b')]],'as':_0x543679['as'],'attributes':_0x543679[_0xeb1b('0x17')],'include':_0x543679[_0xeb1b('0x19')]?_[_0xeb1b('0x1a')](_0x543679['include'],function(_0x140459){return{'model':db[_0x140459[_0xeb1b('0x1b')]],'as':_0x140459['as'],'attributes':_0x140459[_0xeb1b('0x17')],'include':_0x140459[_0xeb1b('0x19')]?_[_0xeb1b('0x1a')](_0x140459[_0xeb1b('0x19')],function(_0x267a82){return{'model':db[_0x267a82['model']],'as':_0x267a82['as'],'attributes':_0x267a82[_0xeb1b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xeb1b('0xb')](function(_0x5f57e7){logger[_0xeb1b('0xc')]('ShowDeskAccount',_0x24feb3);logger['debug'](_0xeb1b('0x1e'),_0x24feb3,JSON[_0xeb1b('0x1c')](_0x5f57e7));_0x460038(_0x5f57e7);})[_0xeb1b('0x1d')](function(_0x1c9c3f){logger['error'](_0xeb1b('0x1e'),_0x1c9c3f['message'],_0x24feb3);_0x44dfc2(_0x171e99[_0xeb1b('0x10')](0x1f4,_0x1c9c3f['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index ef3ebf9..4d6946b 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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x3e03b7,_0x3529d7){var _0x53fb90=function(_0x5f1477){while(--_0x5f1477){_0x3e03b7['push'](_0x3e03b7['shift']());}};_0x53fb90(++_0x3529d7);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0xf67f45,_0x36e087){var _0xd9ab5=function(_0x594070){while(--_0x594070){_0xf67f45['push'](_0xf67f45['shift']());}};_0xd9ab5(++_0x36e087);}(_0x55ca,0x126));var _0xa55c=function(_0xbf4ddf,_0x66b3cb){_0xbf4ddf=_0xbf4ddf-0x0;var _0x3cb273=_0x55ca[_0xbf4ddf];return _0x3cb273;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 8d4213a..5b6f46a 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 _0x257b=['exports','STRING'];(function(_0x53b1c7,_0x1bbad8){var _0x2a47ef=function(_0x32e870){while(--_0x32e870){_0x53b1c7['push'](_0x53b1c7['shift']());}};_0x2a47ef(++_0x1bbad8);}(_0x257b,0x152));var _0xb257=function(_0x4e4713,_0x2f8d5d){_0x4e4713=_0x4e4713-0x0;var _0x540c71=_0x257b[_0x4e4713];return _0x540c71;};'use strict';var Sequelize=require('sequelize');module[_0xb257('0x0')]={'name':{'type':Sequelize[_0xb257('0x1')]},'description':{'type':Sequelize[_0xb257('0x1')]}}; \ No newline at end of file +var _0x8d2b=['STRING','exports'];(function(_0x2a4797,_0x354c05){var _0x2f3b89=function(_0x16d939){while(--_0x16d939){_0x2a4797['push'](_0x2a4797['shift']());}};_0x2f3b89(++_0x354c05);}(_0x8d2b,0x1e1));var _0xb8d2=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x8d2b[_0x44268d];return _0x4be92d;};'use strict';var Sequelize=require('sequelize');module[_0xb8d2('0x0')]={'name':{'type':Sequelize[_0xb8d2('0x1')]},'description':{'type':Sequelize[_0xb8d2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 46e8236..e61956f 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 _0x9ff9=['getSubjects','order','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','destroy','error','stack','name','index','map','DeskConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','getFields','findOne','DeskField','length'];(function(_0x4915cc,_0x52c1fd){var _0x2be34d=function(_0x2865d4){while(--_0x2865d4){_0x4915cc['push'](_0x4915cc['shift']());}};_0x2be34d(++_0x52c1fd);}(_0x9ff9,0x14b));var _0x99ff=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9ff9[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x99ff('0x0'));var rimraf=require(_0x99ff('0x1'));var zipdir=require(_0x99ff('0x2'));var jsonpatch=require(_0x99ff('0x3'));var rp=require(_0x99ff('0x4'));var moment=require(_0x99ff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x99ff('0x6'));var util=require('util');var path=require(_0x99ff('0x7'));var sox=require(_0x99ff('0x8'));var csv=require(_0x99ff('0x9'));var ejs=require(_0x99ff('0xa'));var fs=require('fs');var fs_extra=require(_0x99ff('0xb'));var _=require(_0x99ff('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99ff('0xd'));var toCsv=require('to-csv');var querystring=require(_0x99ff('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x99ff('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x99ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99ff('0x11'))(_0x99ff('0x12'));var utils=require('../../config/utils');var config=require(_0x99ff('0x13'));var licenseUtil=require(_0x99ff('0x14'));var db=require(_0x99ff('0x15'))['db'];function respondWithStatusCode(_0x4c92f2,_0x490755){_0x490755=_0x490755||0xcc;return function(_0xe78313){if(_0xe78313){return _0x4c92f2[_0x99ff('0x16')](_0x490755);}return _0x4c92f2[_0x99ff('0x17')](_0x490755)[_0x99ff('0x18')]();};}function respondWithResult(_0x57d088,_0x215539){_0x215539=_0x215539||0xc8;return function(_0x1455d2){if(_0x1455d2){return _0x57d088[_0x99ff('0x17')](_0x215539)[_0x99ff('0x19')](_0x1455d2);}};}function respondWithFilteredResult(_0x5a983e,_0x11ca51){return function(_0x21cddd){if(_0x21cddd){var _0xa9bf2b=typeof _0x11ca51[_0x99ff('0x1a')]==='undefined'&&typeof _0x11ca51[_0x99ff('0x1b')]===_0x99ff('0x1c');var _0x12c6d6=_0x21cddd[_0x99ff('0x1d')];var _0x4cc7e4=_0xa9bf2b?0x0:_0x11ca51[_0x99ff('0x1a')];var _0x2f30d6=_0xa9bf2b?_0x21cddd[_0x99ff('0x1d')]:_0x11ca51[_0x99ff('0x1a')]+_0x11ca51['limit'];var _0x582fa5;if(_0x2f30d6>=_0x12c6d6){_0x2f30d6=_0x12c6d6;_0x582fa5=0xc8;}else{_0x582fa5=0xce;}_0x5a983e['status'](_0x582fa5);return _0x5a983e[_0x99ff('0x1e')]('Content-Range',_0x4cc7e4+'-'+_0x2f30d6+'/'+_0x12c6d6)[_0x99ff('0x19')](_0x21cddd);}return null;};}function patchUpdates(_0x39ee6f){return function(_0x553ea8){try{jsonpatch[_0x99ff('0x1f')](_0x553ea8,_0x39ee6f,!![]);}catch(_0x1dc012){return BPromise['reject'](_0x1dc012);}return _0x553ea8['save']();};}function saveUpdates(_0x221640,_0x5b13ec){return function(_0x207a2d){if(_0x207a2d){return _0x207a2d[_0x99ff('0x20')](_0x221640)[_0x99ff('0x21')](function(_0x1dd9cd){return _0x1dd9cd;});}return null;};}function removeEntity(_0x27d39f,_0x1e249c){return function(_0x5b139b){if(_0x5b139b){return _0x5b139b[_0x99ff('0x22')]()[_0x99ff('0x21')](function(){_0x27d39f[_0x99ff('0x17')](0xcc)[_0x99ff('0x18')]();});}};}function handleEntityNotFound(_0x36847a,_0x3bb287){return function(_0x1c3128){if(!_0x1c3128){_0x36847a['sendStatus'](0x194);}return _0x1c3128;};}function handleError(_0x1976ee,_0x5803d6){_0x5803d6=_0x5803d6||0x1f4;return function(_0x537b4b){logger[_0x99ff('0x23')](_0x537b4b[_0x99ff('0x24')]);if(_0x537b4b[_0x99ff('0x25')]){delete _0x537b4b['name'];}_0x1976ee[_0x99ff('0x17')](_0x5803d6)['send'](_0x537b4b);};}exports[_0x99ff('0x26')]=function(_0x37c256,_0x30ada0){var _0x3e7262={},_0x2d269d={},_0x378362={'count':0x0,'rows':[]};var _0x78e3bb=_[_0x99ff('0x27')](db[_0x99ff('0x28')]['rawAttributes'],function(_0x105a18){return{'name':_0x105a18[_0x99ff('0x29')],'type':_0x105a18[_0x99ff('0x2a')][_0x99ff('0x2b')]};});_0x2d269d['model']=_[_0x99ff('0x27')](_0x78e3bb,_0x99ff('0x25'));_0x2d269d[_0x99ff('0x2c')]=_[_0x99ff('0x2d')](_0x37c256[_0x99ff('0x2c')]);_0x2d269d[_0x99ff('0x2e')]=_[_0x99ff('0x2f')](_0x2d269d[_0x99ff('0x30')],_0x2d269d[_0x99ff('0x2c')]);_0x3e7262[_0x99ff('0x31')]=_[_0x99ff('0x2f')](_0x2d269d[_0x99ff('0x30')],qs[_0x99ff('0x32')](_0x37c256[_0x99ff('0x2c')][_0x99ff('0x32')]));_0x3e7262[_0x99ff('0x31')]=_0x3e7262[_0x99ff('0x31')]['length']?_0x3e7262[_0x99ff('0x31')]:_0x2d269d[_0x99ff('0x30')];if(!_0x37c256[_0x99ff('0x2c')][_0x99ff('0x33')](_0x99ff('0x34'))){_0x3e7262[_0x99ff('0x1b')]=qs[_0x99ff('0x1b')](_0x37c256[_0x99ff('0x2c')]['limit']);_0x3e7262[_0x99ff('0x1a')]=qs['offset'](_0x37c256[_0x99ff('0x2c')]['offset']);}_0x3e7262['order']=qs[_0x99ff('0x35')](_0x37c256[_0x99ff('0x2c')]['sort']);_0x3e7262[_0x99ff('0x36')]=qs[_0x99ff('0x2e')](_[_0x99ff('0x37')](_0x37c256[_0x99ff('0x2c')],_0x2d269d['filters']),_0x78e3bb);if(_0x37c256[_0x99ff('0x2c')][_0x99ff('0x38')]){_0x3e7262['where']=_[_0x99ff('0x39')](_0x3e7262[_0x99ff('0x36')],{'$or':_[_0x99ff('0x27')](_0x78e3bb,function(_0x572220){if(_0x572220[_0x99ff('0x2a')]!==_0x99ff('0x3a')){var _0x1d8693={};_0x1d8693[_0x572220['name']]={'$like':'%'+_0x37c256[_0x99ff('0x2c')][_0x99ff('0x38')]+'%'};return _0x1d8693;}})});}_0x3e7262=_[_0x99ff('0x39')]({},_0x3e7262,_0x37c256['options']);var _0x36824c={'where':_0x3e7262[_0x99ff('0x36')]};return db[_0x99ff('0x28')][_0x99ff('0x1d')](_0x36824c)['then'](function(_0x1d17e8){_0x378362[_0x99ff('0x1d')]=_0x1d17e8;if(_0x37c256[_0x99ff('0x2c')][_0x99ff('0x3b')]){_0x3e7262[_0x99ff('0x3c')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x99ff('0x3d')](_0x3e7262);})[_0x99ff('0x21')](function(_0x307fff){_0x378362[_0x99ff('0x3e')]=_0x307fff;return _0x378362;})[_0x99ff('0x21')](respondWithFilteredResult(_0x30ada0,_0x3e7262))[_0x99ff('0x3f')](handleError(_0x30ada0,null));};exports['show']=function(_0x481b39,_0x4327f5){var _0x5544f2={'raw':![],'where':{'id':_0x481b39[_0x99ff('0x40')]['id']}},_0x357f8b={};_0x357f8b[_0x99ff('0x30')]=_[_0x99ff('0x2d')](db[_0x99ff('0x28')][_0x99ff('0x41')]);_0x357f8b['query']=_[_0x99ff('0x2d')](_0x481b39[_0x99ff('0x2c')]);_0x357f8b[_0x99ff('0x2e')]=_[_0x99ff('0x2f')](_0x357f8b[_0x99ff('0x30')],_0x357f8b['query']);_0x5544f2[_0x99ff('0x31')]=_[_0x99ff('0x2f')](_0x357f8b['model'],qs[_0x99ff('0x32')](_0x481b39[_0x99ff('0x2c')][_0x99ff('0x32')]));_0x5544f2[_0x99ff('0x31')]=_0x5544f2['attributes']['length']?_0x5544f2['attributes']:_0x357f8b[_0x99ff('0x30')];if(_0x481b39['query'][_0x99ff('0x3b')]){_0x5544f2[_0x99ff('0x3c')]=[{'all':!![]}];}_0x5544f2=_[_0x99ff('0x39')]({},_0x5544f2,_0x481b39[_0x99ff('0x42')]);return db[_0x99ff('0x28')][_0x99ff('0x43')](_0x5544f2)['then'](handleEntityNotFound(_0x4327f5,null))[_0x99ff('0x21')](respondWithResult(_0x4327f5,null))[_0x99ff('0x3f')](handleError(_0x4327f5,null));};exports[_0x99ff('0x44')]=function(_0x47f558,_0x5f597b){return db['DeskConfiguration']['create'](_0x47f558[_0x99ff('0x45')],{})[_0x99ff('0x21')](respondWithResult(_0x5f597b,0xc9))['catch'](handleError(_0x5f597b,null));};exports[_0x99ff('0x20')]=function(_0x507eea,_0x5ee54a){if(_0x507eea[_0x99ff('0x45')]['id']){delete _0x507eea[_0x99ff('0x45')]['id'];}return db['DeskConfiguration'][_0x99ff('0x43')]({'where':{'id':_0x507eea[_0x99ff('0x40')]['id']}})[_0x99ff('0x21')](handleEntityNotFound(_0x5ee54a,null))[_0x99ff('0x21')](saveUpdates(_0x507eea[_0x99ff('0x45')],null))['then'](respondWithResult(_0x5ee54a,null))['catch'](handleError(_0x5ee54a,null));};exports[_0x99ff('0x22')]=function(_0x5573db,_0x4afe1d){return db[_0x99ff('0x28')][_0x99ff('0x43')]({'where':{'id':_0x5573db[_0x99ff('0x40')]['id']}})[_0x99ff('0x21')](handleEntityNotFound(_0x4afe1d,null))['then'](removeEntity(_0x4afe1d,null))[_0x99ff('0x3f')](handleError(_0x4afe1d,null));};exports[_0x99ff('0x46')]=function(_0x19d69c,_0x29ba6f,_0x178054){var _0x27a8ef={};var _0x1a0db6={};var _0xa986ab;var _0x17d576;return db[_0x99ff('0x28')][_0x99ff('0x47')]({'where':{'id':_0x19d69c[_0x99ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x29ba6f,null))[_0x99ff('0x21')](function(_0x5b0647){if(_0x5b0647){_0xa986ab=_0x5b0647;_0x1a0db6[_0x99ff('0x30')]=_[_0x99ff('0x2d')](db[_0x99ff('0x48')][_0x99ff('0x41')]);_0x1a0db6[_0x99ff('0x2c')]=_[_0x99ff('0x2d')](_0x19d69c['query']);_0x1a0db6['filters']=_[_0x99ff('0x2f')](_0x1a0db6[_0x99ff('0x30')],_0x1a0db6['query']);_0x27a8ef[_0x99ff('0x31')]=_[_0x99ff('0x2f')](_0x1a0db6[_0x99ff('0x30')],qs[_0x99ff('0x32')](_0x19d69c[_0x99ff('0x2c')]['fields']));_0x27a8ef[_0x99ff('0x31')]=_0x27a8ef[_0x99ff('0x31')][_0x99ff('0x49')]?_0x27a8ef['attributes']:_0x1a0db6['model'];_0x27a8ef['order']=qs[_0x99ff('0x35')](_0x19d69c[_0x99ff('0x2c')][_0x99ff('0x35')]);_0x27a8ef['where']=qs[_0x99ff('0x2e')](_[_0x99ff('0x37')](_0x19d69c[_0x99ff('0x2c')],_0x1a0db6['filters']));if(_0x19d69c[_0x99ff('0x2c')][_0x99ff('0x38')]){_0x27a8ef[_0x99ff('0x36')]=_[_0x99ff('0x39')](_0x27a8ef[_0x99ff('0x36')],{'$or':_[_0x99ff('0x27')](_0x27a8ef[_0x99ff('0x31')],function(_0x1737b7){var _0x167291={};_0x167291[_0x1737b7]={'$like':'%'+_0x19d69c[_0x99ff('0x2c')][_0x99ff('0x38')]+'%'};return _0x167291;})});}_0x27a8ef=_[_0x99ff('0x39')]({},_0x27a8ef,_0x19d69c[_0x99ff('0x42')]);return _0xa986ab[_0x99ff('0x46')](_0x27a8ef);}})[_0x99ff('0x21')](function(_0x48d074){if(_0x48d074){_0x17d576=_0x48d074[_0x99ff('0x49')];if(!_0x19d69c[_0x99ff('0x2c')][_0x99ff('0x33')]('nolimit')){_0x27a8ef[_0x99ff('0x1b')]=qs[_0x99ff('0x1b')](_0x19d69c[_0x99ff('0x2c')][_0x99ff('0x1b')]);_0x27a8ef[_0x99ff('0x1a')]=qs[_0x99ff('0x1a')](_0x19d69c[_0x99ff('0x2c')]['offset']);}return _0xa986ab[_0x99ff('0x46')](_0x27a8ef);}})[_0x99ff('0x21')](function(_0xb3bf6c){if(_0xb3bf6c){return _0xb3bf6c?{'count':_0x17d576,'rows':_0xb3bf6c}:null;}})[_0x99ff('0x21')](respondWithResult(_0x29ba6f,null))[_0x99ff('0x3f')](handleError(_0x29ba6f,null));};exports[_0x99ff('0x4a')]=function(_0x524857,_0x68562b,_0x1d6309){var _0x25c3eb={};var _0x4ca8c4={};var _0x18c08d;var _0x58fa1c;return db[_0x99ff('0x28')][_0x99ff('0x47')]({'where':{'id':_0x524857[_0x99ff('0x40')]['id']}})[_0x99ff('0x21')](handleEntityNotFound(_0x68562b,null))[_0x99ff('0x21')](function(_0x5a9836){if(_0x5a9836){_0x18c08d=_0x5a9836;_0x4ca8c4['model']=_[_0x99ff('0x2d')](db[_0x99ff('0x48')][_0x99ff('0x41')]);_0x4ca8c4['query']=_[_0x99ff('0x2d')](_0x524857['query']);_0x4ca8c4[_0x99ff('0x2e')]=_[_0x99ff('0x2f')](_0x4ca8c4[_0x99ff('0x30')],_0x4ca8c4['query']);_0x25c3eb[_0x99ff('0x31')]=_[_0x99ff('0x2f')](_0x4ca8c4['model'],qs[_0x99ff('0x32')](_0x524857['query'][_0x99ff('0x32')]));_0x25c3eb[_0x99ff('0x31')]=_0x25c3eb[_0x99ff('0x31')][_0x99ff('0x49')]?_0x25c3eb[_0x99ff('0x31')]:_0x4ca8c4[_0x99ff('0x30')];_0x25c3eb['order']=qs[_0x99ff('0x35')](_0x524857['query'][_0x99ff('0x35')]);_0x25c3eb[_0x99ff('0x36')]=qs[_0x99ff('0x2e')](_[_0x99ff('0x37')](_0x524857[_0x99ff('0x2c')],_0x4ca8c4[_0x99ff('0x2e')]));if(_0x524857[_0x99ff('0x2c')][_0x99ff('0x38')]){_0x25c3eb[_0x99ff('0x36')]=_['merge'](_0x25c3eb[_0x99ff('0x36')],{'$or':_[_0x99ff('0x27')](_0x25c3eb[_0x99ff('0x31')],function(_0xc7f642){var _0x3e69bc={};_0x3e69bc[_0xc7f642]={'$like':'%'+_0x524857[_0x99ff('0x2c')][_0x99ff('0x38')]+'%'};return _0x3e69bc;})});}_0x25c3eb=_[_0x99ff('0x39')]({},_0x25c3eb,_0x524857[_0x99ff('0x42')]);return _0x18c08d['getSubjects'](_0x25c3eb);}})[_0x99ff('0x21')](function(_0x40055a){if(_0x40055a){_0x58fa1c=_0x40055a[_0x99ff('0x49')];if(!_0x524857[_0x99ff('0x2c')]['hasOwnProperty'](_0x99ff('0x34'))){_0x25c3eb['limit']=qs[_0x99ff('0x1b')](_0x524857[_0x99ff('0x2c')][_0x99ff('0x1b')]);_0x25c3eb[_0x99ff('0x1a')]=qs[_0x99ff('0x1a')](_0x524857[_0x99ff('0x2c')]['offset']);}return _0x18c08d['getSubjects'](_0x25c3eb);}})[_0x99ff('0x21')](function(_0x876d17){if(_0x876d17){return _0x876d17?{'count':_0x58fa1c,'rows':_0x876d17}:null;}})[_0x99ff('0x21')](respondWithResult(_0x68562b,null))[_0x99ff('0x3f')](handleError(_0x68562b,null));};exports['getDescriptions']=function(_0x377b3d,_0x298d84,_0x5ed1da){var _0x541e78={};var _0x4dab15={};var _0x70ae9f;var _0x432a0a;return db[_0x99ff('0x28')][_0x99ff('0x47')]({'where':{'id':_0x377b3d[_0x99ff('0x40')]['id']}})[_0x99ff('0x21')](handleEntityNotFound(_0x298d84,null))['then'](function(_0x9e7a05){if(_0x9e7a05){_0x70ae9f=_0x9e7a05;_0x4dab15[_0x99ff('0x30')]=_[_0x99ff('0x2d')](db['DeskField'][_0x99ff('0x41')]);_0x4dab15[_0x99ff('0x2c')]=_['keys'](_0x377b3d[_0x99ff('0x2c')]);_0x4dab15[_0x99ff('0x2e')]=_[_0x99ff('0x2f')](_0x4dab15[_0x99ff('0x30')],_0x4dab15[_0x99ff('0x2c')]);_0x541e78[_0x99ff('0x31')]=_['intersection'](_0x4dab15[_0x99ff('0x30')],qs[_0x99ff('0x32')](_0x377b3d[_0x99ff('0x2c')]['fields']));_0x541e78[_0x99ff('0x31')]=_0x541e78['attributes'][_0x99ff('0x49')]?_0x541e78['attributes']:_0x4dab15[_0x99ff('0x30')];_0x541e78[_0x99ff('0x4b')]=qs[_0x99ff('0x35')](_0x377b3d['query'][_0x99ff('0x35')]);_0x541e78['where']=qs[_0x99ff('0x2e')](_[_0x99ff('0x37')](_0x377b3d[_0x99ff('0x2c')],_0x4dab15['filters']));if(_0x377b3d['query']['filter']){_0x541e78[_0x99ff('0x36')]=_[_0x99ff('0x39')](_0x541e78[_0x99ff('0x36')],{'$or':_[_0x99ff('0x27')](_0x541e78[_0x99ff('0x31')],function(_0x4479fa){var _0x351bec={};_0x351bec[_0x4479fa]={'$like':'%'+_0x377b3d[_0x99ff('0x2c')]['filter']+'%'};return _0x351bec;})});}_0x541e78=_['merge']({},_0x541e78,_0x377b3d[_0x99ff('0x42')]);return _0x70ae9f['getDescriptions'](_0x541e78);}})[_0x99ff('0x21')](function(_0xd62261){if(_0xd62261){_0x432a0a=_0xd62261[_0x99ff('0x49')];if(!_0x377b3d[_0x99ff('0x2c')][_0x99ff('0x33')](_0x99ff('0x34'))){_0x541e78[_0x99ff('0x1b')]=qs[_0x99ff('0x1b')](_0x377b3d[_0x99ff('0x2c')]['limit']);_0x541e78[_0x99ff('0x1a')]=qs['offset'](_0x377b3d[_0x99ff('0x2c')][_0x99ff('0x1a')]);}return _0x70ae9f[_0x99ff('0x4c')](_0x541e78);}})[_0x99ff('0x21')](function(_0x6882f5){if(_0x6882f5){return _0x6882f5?{'count':_0x432a0a,'rows':_0x6882f5}:null;}})[_0x99ff('0x21')](respondWithResult(_0x298d84,null))['catch'](handleError(_0x298d84,null));};exports['getTags']=function(_0x163d3a,_0xbbaaad,_0x55986){var _0x1b0dca={};var _0xb66c6e={};var _0x33f78d;var _0x2d317e;return db['DeskConfiguration'][_0x99ff('0x47')]({'where':{'id':_0x163d3a['params']['id']}})['then'](handleEntityNotFound(_0xbbaaad,null))[_0x99ff('0x21')](function(_0x47161d){if(_0x47161d){_0x33f78d=_0x47161d;_0xb66c6e['model']=_[_0x99ff('0x2d')](db[_0x99ff('0x4d')][_0x99ff('0x41')]);_0xb66c6e[_0x99ff('0x2c')]=_[_0x99ff('0x2d')](_0x163d3a[_0x99ff('0x2c')]);_0xb66c6e[_0x99ff('0x2e')]=_[_0x99ff('0x2f')](_0xb66c6e['model'],_0xb66c6e[_0x99ff('0x2c')]);_0x1b0dca['attributes']=_['intersection'](_0xb66c6e['model'],qs[_0x99ff('0x32')](_0x163d3a[_0x99ff('0x2c')][_0x99ff('0x32')]));_0x1b0dca['attributes']=_0x1b0dca[_0x99ff('0x31')][_0x99ff('0x49')]?_0x1b0dca['attributes']:_0xb66c6e[_0x99ff('0x30')];_0x1b0dca['order']=qs[_0x99ff('0x35')](_0x163d3a[_0x99ff('0x2c')][_0x99ff('0x35')]);_0x1b0dca[_0x99ff('0x36')]=qs[_0x99ff('0x2e')](_['pick'](_0x163d3a['query'],_0xb66c6e[_0x99ff('0x2e')]));if(_0x163d3a['query'][_0x99ff('0x38')]){_0x1b0dca[_0x99ff('0x36')]=_[_0x99ff('0x39')](_0x1b0dca[_0x99ff('0x36')],{'$or':_[_0x99ff('0x27')](_0x1b0dca[_0x99ff('0x31')],function(_0x15f6b6){var _0x345f0f={};_0x345f0f[_0x15f6b6]={'$like':'%'+_0x163d3a[_0x99ff('0x2c')][_0x99ff('0x38')]+'%'};return _0x345f0f;})});}_0x1b0dca=_[_0x99ff('0x39')]({},_0x1b0dca,_0x163d3a[_0x99ff('0x42')]);return _0x33f78d['getTags'](_0x1b0dca);}})['then'](function(_0x54b50f){if(_0x54b50f){_0x2d317e=_0x54b50f[_0x99ff('0x49')];if(!_0x163d3a['query'][_0x99ff('0x33')](_0x99ff('0x34'))){_0x1b0dca[_0x99ff('0x1b')]=qs[_0x99ff('0x1b')](_0x163d3a[_0x99ff('0x2c')][_0x99ff('0x1b')]);_0x1b0dca[_0x99ff('0x1a')]=qs[_0x99ff('0x1a')](_0x163d3a[_0x99ff('0x2c')][_0x99ff('0x1a')]);}return _0x33f78d[_0x99ff('0x4e')](_0x1b0dca);}})[_0x99ff('0x21')](function(_0x55cdfc){if(_0x55cdfc){return _0x55cdfc?{'count':_0x2d317e,'rows':_0x55cdfc}:null;}})[_0x99ff('0x21')](respondWithResult(_0xbbaaad,null))['catch'](handleError(_0xbbaaad,null));};exports[_0x99ff('0x4f')]=function(_0x4c877b,_0x535153,_0x54bac6){if(_0x4c877b['body']['id']){delete _0x4c877b['body']['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x4c877b[_0x99ff('0x40')]['id']}})[_0x99ff('0x21')](handleEntityNotFound(_0x535153,null))['then'](function(_0x39b93d){if(_0x39b93d){return _0x39b93d[_0x99ff('0x4f')](_0x4c877b[_0x99ff('0x45')][_0x99ff('0x50')]||[]);}return null;})[_0x99ff('0x21')](respondWithResult(_0x535153,null))[_0x99ff('0x3f')](handleError(_0x535153,null));}; \ No newline at end of file +var _0xcb7c=['show','params','length','find','catch','create','body','update','destroy','getFields','DeskField','keys','getSubjects','getDescriptions','findOne','getTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll'];(function(_0x2d3410,_0x16a6a0){var _0x3e29c1=function(_0x15c204){while(--_0x15c204){_0x2d3410['push'](_0x2d3410['shift']());}};_0x3e29c1(++_0x16a6a0);}(_0xcb7c,0x66));var _0xccb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb7c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xccb7('0x0'));var rimraf=require(_0xccb7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccb7('0x2'));var rp=require(_0xccb7('0x3'));var moment=require(_0xccb7('0x4'));var BPromise=require(_0xccb7('0x5'));var Mustache=require(_0xccb7('0x6'));var util=require(_0xccb7('0x7'));var path=require(_0xccb7('0x8'));var sox=require(_0xccb7('0x9'));var csv=require(_0xccb7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccb7('0xb'));var _=require(_0xccb7('0xc'));var squel=require(_0xccb7('0xd'));var crypto=require(_0xccb7('0xe'));var jsforce=require(_0xccb7('0xf'));var deskjs=require(_0xccb7('0x10'));var toCsv=require(_0xccb7('0xa'));var querystring=require(_0xccb7('0x11'));var Papa=require(_0xccb7('0x12'));var Redis=require(_0xccb7('0x13'));var authService=require(_0xccb7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xccb7('0x15'));var hardwareService=require(_0xccb7('0x16'));var logger=require(_0xccb7('0x17'))(_0xccb7('0x18'));var utils=require('../../config/utils');var config=require(_0xccb7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xccb7('0x1a'))['db'];function respondWithStatusCode(_0x502e54,_0x316deb){_0x316deb=_0x316deb||0xcc;return function(_0x47c61e){if(_0x47c61e){return _0x502e54[_0xccb7('0x1b')](_0x316deb);}return _0x502e54['status'](_0x316deb)[_0xccb7('0x1c')]();};}function respondWithResult(_0x327937,_0x28b7a0){_0x28b7a0=_0x28b7a0||0xc8;return function(_0x57b40c){if(_0x57b40c){return _0x327937[_0xccb7('0x1d')](_0x28b7a0)[_0xccb7('0x1e')](_0x57b40c);}};}function respondWithFilteredResult(_0x5700e2,_0x5d86e0){return function(_0x5df584){if(_0x5df584){var _0x5f3a11=typeof _0x5d86e0[_0xccb7('0x1f')]===_0xccb7('0x20')&&typeof _0x5d86e0[_0xccb7('0x21')]===_0xccb7('0x20');var _0x12b8db=_0x5df584['count'];var _0x1faacb=_0x5f3a11?0x0:_0x5d86e0[_0xccb7('0x1f')];var _0x3f4c54=_0x5f3a11?_0x5df584[_0xccb7('0x22')]:_0x5d86e0[_0xccb7('0x1f')]+_0x5d86e0[_0xccb7('0x21')];var _0x4ea602;if(_0x3f4c54>=_0x12b8db){_0x3f4c54=_0x12b8db;_0x4ea602=0xc8;}else{_0x4ea602=0xce;}_0x5700e2['status'](_0x4ea602);return _0x5700e2[_0xccb7('0x23')](_0xccb7('0x24'),_0x1faacb+'-'+_0x3f4c54+'/'+_0x12b8db)[_0xccb7('0x1e')](_0x5df584);}return null;};}function patchUpdates(_0x22c4c0){return function(_0x5243c9){try{jsonpatch[_0xccb7('0x25')](_0x5243c9,_0x22c4c0,!![]);}catch(_0x169ec4){return BPromise[_0xccb7('0x26')](_0x169ec4);}return _0x5243c9['save']();};}function saveUpdates(_0x4cd289,_0x5f5372){return function(_0x34bafc){if(_0x34bafc){return _0x34bafc['update'](_0x4cd289)['then'](function(_0x35f7f5){return _0x35f7f5;});}return null;};}function removeEntity(_0x2b8de8,_0x1f0e83){return function(_0x791329){if(_0x791329){return _0x791329['destroy']()[_0xccb7('0x27')](function(){_0x2b8de8[_0xccb7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59dab0,_0x5ef314){return function(_0x25ba55){if(!_0x25ba55){_0x59dab0[_0xccb7('0x1b')](0x194);}return _0x25ba55;};}function handleError(_0x1c823d,_0x1e7c5b){_0x1e7c5b=_0x1e7c5b||0x1f4;return function(_0x398f36){logger[_0xccb7('0x28')](_0x398f36[_0xccb7('0x29')]);if(_0x398f36[_0xccb7('0x2a')]){delete _0x398f36[_0xccb7('0x2a')];}_0x1c823d[_0xccb7('0x1d')](_0x1e7c5b)['send'](_0x398f36);};}exports[_0xccb7('0x2b')]=function(_0x4051a0,_0x5017ec){var _0x4b73b9={},_0x1305fd={},_0xdaff53={'count':0x0,'rows':[]};var _0x285f56=_[_0xccb7('0x2c')](db[_0xccb7('0x2d')][_0xccb7('0x2e')],function(_0x3ecc1f){return{'name':_0x3ecc1f[_0xccb7('0x2f')],'type':_0x3ecc1f[_0xccb7('0x30')][_0xccb7('0x31')]};});_0x1305fd[_0xccb7('0x32')]=_[_0xccb7('0x2c')](_0x285f56,_0xccb7('0x2a'));_0x1305fd[_0xccb7('0x33')]=_['keys'](_0x4051a0['query']);_0x1305fd[_0xccb7('0x34')]=_[_0xccb7('0x35')](_0x1305fd[_0xccb7('0x32')],_0x1305fd[_0xccb7('0x33')]);_0x4b73b9['attributes']=_['intersection'](_0x1305fd[_0xccb7('0x32')],qs[_0xccb7('0x36')](_0x4051a0[_0xccb7('0x33')][_0xccb7('0x36')]));_0x4b73b9['attributes']=_0x4b73b9[_0xccb7('0x37')]['length']?_0x4b73b9['attributes']:_0x1305fd[_0xccb7('0x32')];if(!_0x4051a0[_0xccb7('0x33')][_0xccb7('0x38')](_0xccb7('0x39'))){_0x4b73b9[_0xccb7('0x21')]=qs[_0xccb7('0x21')](_0x4051a0[_0xccb7('0x33')]['limit']);_0x4b73b9[_0xccb7('0x1f')]=qs[_0xccb7('0x1f')](_0x4051a0[_0xccb7('0x33')][_0xccb7('0x1f')]);}_0x4b73b9[_0xccb7('0x3a')]=qs[_0xccb7('0x3b')](_0x4051a0[_0xccb7('0x33')]['sort']);_0x4b73b9['where']=qs[_0xccb7('0x34')](_[_0xccb7('0x3c')](_0x4051a0[_0xccb7('0x33')],_0x1305fd[_0xccb7('0x34')]),_0x285f56);if(_0x4051a0[_0xccb7('0x33')][_0xccb7('0x3d')]){_0x4b73b9[_0xccb7('0x3e')]=_[_0xccb7('0x3f')](_0x4b73b9[_0xccb7('0x3e')],{'$or':_[_0xccb7('0x2c')](_0x285f56,function(_0x1f810f){if(_0x1f810f['type']!=='VIRTUAL'){var _0x217fe8={};_0x217fe8[_0x1f810f[_0xccb7('0x2a')]]={'$like':'%'+_0x4051a0[_0xccb7('0x33')]['filter']+'%'};return _0x217fe8;}})});}_0x4b73b9=_[_0xccb7('0x3f')]({},_0x4b73b9,_0x4051a0[_0xccb7('0x40')]);var _0x25ac0b={'where':_0x4b73b9[_0xccb7('0x3e')]};return db['DeskConfiguration'][_0xccb7('0x22')](_0x25ac0b)[_0xccb7('0x27')](function(_0x5d9ae0){_0xdaff53[_0xccb7('0x22')]=_0x5d9ae0;if(_0x4051a0[_0xccb7('0x33')][_0xccb7('0x41')]){_0x4b73b9[_0xccb7('0x42')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xccb7('0x43')](_0x4b73b9);})[_0xccb7('0x27')](function(_0x1ceee3){_0xdaff53['rows']=_0x1ceee3;return _0xdaff53;})['then'](respondWithFilteredResult(_0x5017ec,_0x4b73b9))['catch'](handleError(_0x5017ec,null));};exports[_0xccb7('0x44')]=function(_0x501f6a,_0x228002){var _0x42b457={'raw':![],'where':{'id':_0x501f6a[_0xccb7('0x45')]['id']}},_0x1d1b94={};_0x1d1b94[_0xccb7('0x32')]=_['keys'](db[_0xccb7('0x2d')][_0xccb7('0x2e')]);_0x1d1b94['query']=_['keys'](_0x501f6a[_0xccb7('0x33')]);_0x1d1b94['filters']=_[_0xccb7('0x35')](_0x1d1b94[_0xccb7('0x32')],_0x1d1b94[_0xccb7('0x33')]);_0x42b457['attributes']=_[_0xccb7('0x35')](_0x1d1b94[_0xccb7('0x32')],qs[_0xccb7('0x36')](_0x501f6a[_0xccb7('0x33')]['fields']));_0x42b457[_0xccb7('0x37')]=_0x42b457[_0xccb7('0x37')][_0xccb7('0x46')]?_0x42b457['attributes']:_0x1d1b94[_0xccb7('0x32')];if(_0x501f6a[_0xccb7('0x33')][_0xccb7('0x41')]){_0x42b457[_0xccb7('0x42')]=[{'all':!![]}];}_0x42b457=_[_0xccb7('0x3f')]({},_0x42b457,_0x501f6a[_0xccb7('0x40')]);return db['DeskConfiguration'][_0xccb7('0x47')](_0x42b457)['then'](handleEntityNotFound(_0x228002,null))[_0xccb7('0x27')](respondWithResult(_0x228002,null))[_0xccb7('0x48')](handleError(_0x228002,null));};exports['create']=function(_0x5ced7c,_0xd9e87a){return db[_0xccb7('0x2d')][_0xccb7('0x49')](_0x5ced7c[_0xccb7('0x4a')],{})[_0xccb7('0x27')](respondWithResult(_0xd9e87a,0xc9))[_0xccb7('0x48')](handleError(_0xd9e87a,null));};exports[_0xccb7('0x4b')]=function(_0x475a7c,_0x3a883c){if(_0x475a7c['body']['id']){delete _0x475a7c['body']['id'];}return db['DeskConfiguration'][_0xccb7('0x47')]({'where':{'id':_0x475a7c[_0xccb7('0x45')]['id']}})[_0xccb7('0x27')](handleEntityNotFound(_0x3a883c,null))[_0xccb7('0x27')](saveUpdates(_0x475a7c['body'],null))[_0xccb7('0x27')](respondWithResult(_0x3a883c,null))[_0xccb7('0x48')](handleError(_0x3a883c,null));};exports[_0xccb7('0x4c')]=function(_0x4a41f0,_0xc2c60e){return db[_0xccb7('0x2d')][_0xccb7('0x47')]({'where':{'id':_0x4a41f0[_0xccb7('0x45')]['id']}})[_0xccb7('0x27')](handleEntityNotFound(_0xc2c60e,null))[_0xccb7('0x27')](removeEntity(_0xc2c60e,null))[_0xccb7('0x48')](handleError(_0xc2c60e,null));};exports[_0xccb7('0x4d')]=function(_0x499e91,_0x269ef6,_0x53db7c){var _0x4a2b6c={};var _0x34d95d={};var _0x4beae4;var _0x5e797c;return db[_0xccb7('0x2d')]['findOne']({'where':{'id':_0x499e91['params']['id']}})[_0xccb7('0x27')](handleEntityNotFound(_0x269ef6,null))['then'](function(_0x881764){if(_0x881764){_0x4beae4=_0x881764;_0x34d95d[_0xccb7('0x32')]=_['keys'](db[_0xccb7('0x4e')][_0xccb7('0x2e')]);_0x34d95d[_0xccb7('0x33')]=_[_0xccb7('0x4f')](_0x499e91[_0xccb7('0x33')]);_0x34d95d['filters']=_[_0xccb7('0x35')](_0x34d95d['model'],_0x34d95d['query']);_0x4a2b6c[_0xccb7('0x37')]=_[_0xccb7('0x35')](_0x34d95d['model'],qs[_0xccb7('0x36')](_0x499e91['query'][_0xccb7('0x36')]));_0x4a2b6c[_0xccb7('0x37')]=_0x4a2b6c['attributes'][_0xccb7('0x46')]?_0x4a2b6c[_0xccb7('0x37')]:_0x34d95d[_0xccb7('0x32')];_0x4a2b6c[_0xccb7('0x3a')]=qs['sort'](_0x499e91[_0xccb7('0x33')][_0xccb7('0x3b')]);_0x4a2b6c[_0xccb7('0x3e')]=qs[_0xccb7('0x34')](_[_0xccb7('0x3c')](_0x499e91[_0xccb7('0x33')],_0x34d95d[_0xccb7('0x34')]));if(_0x499e91[_0xccb7('0x33')][_0xccb7('0x3d')]){_0x4a2b6c['where']=_[_0xccb7('0x3f')](_0x4a2b6c[_0xccb7('0x3e')],{'$or':_[_0xccb7('0x2c')](_0x4a2b6c[_0xccb7('0x37')],function(_0x3e0178){var _0xd08d34={};_0xd08d34[_0x3e0178]={'$like':'%'+_0x499e91[_0xccb7('0x33')][_0xccb7('0x3d')]+'%'};return _0xd08d34;})});}_0x4a2b6c=_[_0xccb7('0x3f')]({},_0x4a2b6c,_0x499e91[_0xccb7('0x40')]);return _0x4beae4[_0xccb7('0x4d')](_0x4a2b6c);}})[_0xccb7('0x27')](function(_0x1f5549){if(_0x1f5549){_0x5e797c=_0x1f5549[_0xccb7('0x46')];if(!_0x499e91[_0xccb7('0x33')]['hasOwnProperty'](_0xccb7('0x39'))){_0x4a2b6c[_0xccb7('0x21')]=qs[_0xccb7('0x21')](_0x499e91[_0xccb7('0x33')][_0xccb7('0x21')]);_0x4a2b6c[_0xccb7('0x1f')]=qs[_0xccb7('0x1f')](_0x499e91[_0xccb7('0x33')][_0xccb7('0x1f')]);}return _0x4beae4[_0xccb7('0x4d')](_0x4a2b6c);}})[_0xccb7('0x27')](function(_0x1e1172){if(_0x1e1172){return _0x1e1172?{'count':_0x5e797c,'rows':_0x1e1172}:null;}})[_0xccb7('0x27')](respondWithResult(_0x269ef6,null))['catch'](handleError(_0x269ef6,null));};exports[_0xccb7('0x50')]=function(_0x598a69,_0x22e07e,_0xe243f8){var _0x504d66={};var _0x231ae8={};var _0x277a6c;var _0x2b36d6;return db[_0xccb7('0x2d')]['findOne']({'where':{'id':_0x598a69[_0xccb7('0x45')]['id']}})[_0xccb7('0x27')](handleEntityNotFound(_0x22e07e,null))[_0xccb7('0x27')](function(_0x2a8356){if(_0x2a8356){_0x277a6c=_0x2a8356;_0x231ae8[_0xccb7('0x32')]=_['keys'](db[_0xccb7('0x4e')]['rawAttributes']);_0x231ae8[_0xccb7('0x33')]=_[_0xccb7('0x4f')](_0x598a69[_0xccb7('0x33')]);_0x231ae8[_0xccb7('0x34')]=_['intersection'](_0x231ae8[_0xccb7('0x32')],_0x231ae8[_0xccb7('0x33')]);_0x504d66[_0xccb7('0x37')]=_[_0xccb7('0x35')](_0x231ae8[_0xccb7('0x32')],qs[_0xccb7('0x36')](_0x598a69[_0xccb7('0x33')][_0xccb7('0x36')]));_0x504d66[_0xccb7('0x37')]=_0x504d66['attributes']['length']?_0x504d66[_0xccb7('0x37')]:_0x231ae8['model'];_0x504d66[_0xccb7('0x3a')]=qs['sort'](_0x598a69[_0xccb7('0x33')][_0xccb7('0x3b')]);_0x504d66[_0xccb7('0x3e')]=qs[_0xccb7('0x34')](_[_0xccb7('0x3c')](_0x598a69[_0xccb7('0x33')],_0x231ae8[_0xccb7('0x34')]));if(_0x598a69[_0xccb7('0x33')][_0xccb7('0x3d')]){_0x504d66[_0xccb7('0x3e')]=_['merge'](_0x504d66['where'],{'$or':_[_0xccb7('0x2c')](_0x504d66[_0xccb7('0x37')],function(_0x265e70){var _0x297913={};_0x297913[_0x265e70]={'$like':'%'+_0x598a69[_0xccb7('0x33')]['filter']+'%'};return _0x297913;})});}_0x504d66=_[_0xccb7('0x3f')]({},_0x504d66,_0x598a69['options']);return _0x277a6c[_0xccb7('0x50')](_0x504d66);}})[_0xccb7('0x27')](function(_0x41dcb6){if(_0x41dcb6){_0x2b36d6=_0x41dcb6[_0xccb7('0x46')];if(!_0x598a69[_0xccb7('0x33')]['hasOwnProperty']('nolimit')){_0x504d66['limit']=qs[_0xccb7('0x21')](_0x598a69[_0xccb7('0x33')][_0xccb7('0x21')]);_0x504d66[_0xccb7('0x1f')]=qs['offset'](_0x598a69['query'][_0xccb7('0x1f')]);}return _0x277a6c[_0xccb7('0x50')](_0x504d66);}})['then'](function(_0x8eb8fc){if(_0x8eb8fc){return _0x8eb8fc?{'count':_0x2b36d6,'rows':_0x8eb8fc}:null;}})[_0xccb7('0x27')](respondWithResult(_0x22e07e,null))['catch'](handleError(_0x22e07e,null));};exports[_0xccb7('0x51')]=function(_0x1d646a,_0x599ff1,_0x260048){var _0x130be7={};var _0x7b41a9={};var _0x4108ea;var _0x429662;return db['DeskConfiguration'][_0xccb7('0x52')]({'where':{'id':_0x1d646a[_0xccb7('0x45')]['id']}})['then'](handleEntityNotFound(_0x599ff1,null))[_0xccb7('0x27')](function(_0x3eda5e){if(_0x3eda5e){_0x4108ea=_0x3eda5e;_0x7b41a9[_0xccb7('0x32')]=_[_0xccb7('0x4f')](db[_0xccb7('0x4e')][_0xccb7('0x2e')]);_0x7b41a9[_0xccb7('0x33')]=_['keys'](_0x1d646a[_0xccb7('0x33')]);_0x7b41a9[_0xccb7('0x34')]=_[_0xccb7('0x35')](_0x7b41a9[_0xccb7('0x32')],_0x7b41a9['query']);_0x130be7[_0xccb7('0x37')]=_['intersection'](_0x7b41a9['model'],qs[_0xccb7('0x36')](_0x1d646a[_0xccb7('0x33')][_0xccb7('0x36')]));_0x130be7[_0xccb7('0x37')]=_0x130be7['attributes'][_0xccb7('0x46')]?_0x130be7[_0xccb7('0x37')]:_0x7b41a9[_0xccb7('0x32')];_0x130be7[_0xccb7('0x3a')]=qs[_0xccb7('0x3b')](_0x1d646a[_0xccb7('0x33')]['sort']);_0x130be7[_0xccb7('0x3e')]=qs[_0xccb7('0x34')](_[_0xccb7('0x3c')](_0x1d646a[_0xccb7('0x33')],_0x7b41a9[_0xccb7('0x34')]));if(_0x1d646a[_0xccb7('0x33')][_0xccb7('0x3d')]){_0x130be7[_0xccb7('0x3e')]=_['merge'](_0x130be7[_0xccb7('0x3e')],{'$or':_[_0xccb7('0x2c')](_0x130be7['attributes'],function(_0x14b52d){var _0x3867f5={};_0x3867f5[_0x14b52d]={'$like':'%'+_0x1d646a[_0xccb7('0x33')]['filter']+'%'};return _0x3867f5;})});}_0x130be7=_[_0xccb7('0x3f')]({},_0x130be7,_0x1d646a[_0xccb7('0x40')]);return _0x4108ea['getDescriptions'](_0x130be7);}})['then'](function(_0x336260){if(_0x336260){_0x429662=_0x336260[_0xccb7('0x46')];if(!_0x1d646a['query']['hasOwnProperty'](_0xccb7('0x39'))){_0x130be7[_0xccb7('0x21')]=qs['limit'](_0x1d646a[_0xccb7('0x33')][_0xccb7('0x21')]);_0x130be7[_0xccb7('0x1f')]=qs['offset'](_0x1d646a[_0xccb7('0x33')][_0xccb7('0x1f')]);}return _0x4108ea['getDescriptions'](_0x130be7);}})[_0xccb7('0x27')](function(_0x4d570b){if(_0x4d570b){return _0x4d570b?{'count':_0x429662,'rows':_0x4d570b}:null;}})[_0xccb7('0x27')](respondWithResult(_0x599ff1,null))[_0xccb7('0x48')](handleError(_0x599ff1,null));};exports[_0xccb7('0x53')]=function(_0x51308e,_0x595f8d,_0x564ef2){var _0x22b42d={};var _0x574e9a={};var _0x2cc241;var _0x284108;return db[_0xccb7('0x2d')][_0xccb7('0x52')]({'where':{'id':_0x51308e[_0xccb7('0x45')]['id']}})[_0xccb7('0x27')](handleEntityNotFound(_0x595f8d,null))[_0xccb7('0x27')](function(_0x17bd2a){if(_0x17bd2a){_0x2cc241=_0x17bd2a;_0x574e9a[_0xccb7('0x32')]=_['keys'](db['Tag'][_0xccb7('0x2e')]);_0x574e9a[_0xccb7('0x33')]=_[_0xccb7('0x4f')](_0x51308e[_0xccb7('0x33')]);_0x574e9a[_0xccb7('0x34')]=_[_0xccb7('0x35')](_0x574e9a[_0xccb7('0x32')],_0x574e9a[_0xccb7('0x33')]);_0x22b42d[_0xccb7('0x37')]=_[_0xccb7('0x35')](_0x574e9a[_0xccb7('0x32')],qs[_0xccb7('0x36')](_0x51308e[_0xccb7('0x33')][_0xccb7('0x36')]));_0x22b42d[_0xccb7('0x37')]=_0x22b42d[_0xccb7('0x37')]['length']?_0x22b42d[_0xccb7('0x37')]:_0x574e9a[_0xccb7('0x32')];_0x22b42d['order']=qs[_0xccb7('0x3b')](_0x51308e[_0xccb7('0x33')][_0xccb7('0x3b')]);_0x22b42d[_0xccb7('0x3e')]=qs['filters'](_['pick'](_0x51308e[_0xccb7('0x33')],_0x574e9a[_0xccb7('0x34')]));if(_0x51308e[_0xccb7('0x33')][_0xccb7('0x3d')]){_0x22b42d['where']=_[_0xccb7('0x3f')](_0x22b42d[_0xccb7('0x3e')],{'$or':_[_0xccb7('0x2c')](_0x22b42d[_0xccb7('0x37')],function(_0x4e45b0){var _0x21cec3={};_0x21cec3[_0x4e45b0]={'$like':'%'+_0x51308e[_0xccb7('0x33')][_0xccb7('0x3d')]+'%'};return _0x21cec3;})});}_0x22b42d=_['merge']({},_0x22b42d,_0x51308e[_0xccb7('0x40')]);return _0x2cc241[_0xccb7('0x53')](_0x22b42d);}})[_0xccb7('0x27')](function(_0x1d477c){if(_0x1d477c){_0x284108=_0x1d477c[_0xccb7('0x46')];if(!_0x51308e[_0xccb7('0x33')]['hasOwnProperty'](_0xccb7('0x39'))){_0x22b42d[_0xccb7('0x21')]=qs['limit'](_0x51308e['query'][_0xccb7('0x21')]);_0x22b42d[_0xccb7('0x1f')]=qs[_0xccb7('0x1f')](_0x51308e[_0xccb7('0x33')]['offset']);}return _0x2cc241[_0xccb7('0x53')](_0x22b42d);}})[_0xccb7('0x27')](function(_0x275598){if(_0x275598){return _0x275598?{'count':_0x284108,'rows':_0x275598}:null;}})['then'](respondWithResult(_0x595f8d,null))[_0xccb7('0x48')](handleError(_0x595f8d,null));};exports['setTags']=function(_0x443c86,_0x298ad4,_0x2303af){if(_0x443c86['body']['id']){delete _0x443c86[_0xccb7('0x4a')]['id'];}return db[_0xccb7('0x2d')][_0xccb7('0x52')]({'where':{'id':_0x443c86['params']['id']}})[_0xccb7('0x27')](handleEntityNotFound(_0x298ad4,null))[_0xccb7('0x27')](function(_0x291d15){if(_0x291d15){return _0x291d15['setTags'](_0x443c86['body'][_0xccb7('0x54')]||[]);}return null;})['then'](respondWithResult(_0x298ad4,null))['catch'](handleError(_0x298ad4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index aeeb2cb..7cde11a 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 _0x874f=['request-promise','rimraf','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x874f,0x127));var _0xf874=function(_0x44c801,_0x5ad314){_0x44c801=_0x44c801-0x0;var _0x3f3468=_0x874f[_0x44c801];return _0x3f3468;};'use strict';var _=require(_0xf874('0x0'));var util=require(_0xf874('0x1'));var logger=require(_0xf874('0x2'))(_0xf874('0x3'));var moment=require(_0xf874('0x4'));var BPromise=require('bluebird');var rp=require(_0xf874('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf874('0x6'));var config=require('../../config/environment');var attributes=require(_0xf874('0x7'));module['exports']=function(_0x3a53fb,_0x22501c){return _0x3a53fb[_0xf874('0x8')]('DeskConfiguration',attributes,{'tableName':_0xf874('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc23a=['util','../../config/logger','api','request-promise','rimraf','./intDeskConfiguration.attributes','exports','lodash'];(function(_0x3984a6,_0x4adaba){var _0x2cc75f=function(_0x4a3849){while(--_0x4a3849){_0x3984a6['push'](_0x3984a6['shift']());}};_0x2cc75f(++_0x4adaba);}(_0xc23a,0xb7));var _0xac23=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0xc23a[_0x1c4409];return _0x356d8f;};'use strict';var _=require(_0xac23('0x0'));var util=require(_0xac23('0x1'));var logger=require(_0xac23('0x2'))(_0xac23('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac23('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac23('0x5'));var config=require('../../config/environment');var attributes=require(_0xac23('0x6'));module[_0xac23('0x7')]=function(_0x2d584f,_0x6e731d){return _0x2d584f['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 901e5b6..b0ee349 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 _0x838a=['request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x56260c,_0x3594bc){var _0x3293b9=function(_0x3e1744){while(--_0x3e1744){_0x56260c['push'](_0x56260c['shift']());}};_0x3293b9(++_0x3594bc);}(_0x838a,0x65));var _0xa838=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0x838a[_0x109371];return _0x4fd858;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa838('0x0'));var BPromise=require(_0xa838('0x1'));var rs=require(_0xa838('0x2'));var fs=require('fs');var Redis=require(_0xa838('0x3'));var db=require(_0xa838('0x4'))['db'];var utils=require(_0xa838('0x5'));var logger=require(_0xa838('0x6'))(_0xa838('0x7'));var config=require(_0xa838('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa838('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x330456,_0x269d37,_0xb9b8e3){return new BPromise(function(_0x1de41,_0x56cd0c){return client['request'](_0x330456,_0xb9b8e3)[_0xa838('0xa')](function(_0x506d96){logger[_0xa838('0xb')](_0xa838('0xc'),_0x269d37,_0xa838('0xd'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x269d37,'request\x20sent',JSON['stringify'](_0x506d96));if(_0x506d96[_0xa838('0xe')]){if(_0x506d96['error'][_0xa838('0xf')]===0x1f4){logger[_0xa838('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x269d37,_0x506d96['error'][_0xa838('0x10')]);return _0x56cd0c(_0x506d96[_0xa838('0xe')]['message']);}logger[_0xa838('0xe')](_0xa838('0xc'),_0x269d37,_0x506d96[_0xa838('0xe')]['message']);return _0x1de41(_0x506d96[_0xa838('0xe')][_0xa838('0x10')]);}else{logger[_0xa838('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x269d37,_0xa838('0xd'));_0x1de41(_0x506d96[_0xa838('0x11')][_0xa838('0x10')]);}})[_0xa838('0x12')](function(_0x380c9f){logger['error'](_0xa838('0xc'),_0x269d37,_0x380c9f);_0x56cd0c(_0x380c9f);});});} \ No newline at end of file +var _0x78e7=['error','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xb2127b,_0x5626bd){var _0x4dd571=function(_0x247b9f){while(--_0x247b9f){_0xb2127b['push'](_0xb2127b['shift']());}};_0x4dd571(++_0x5626bd);}(_0x78e7,0x17d));var _0x778e=function(_0x58d9bc,_0x5d4234){_0x58d9bc=_0x58d9bc-0x0;var _0x51f967=_0x78e7[_0x58d9bc];return _0x51f967;};'use strict';var _=require('lodash');var util=require(_0x778e('0x0'));var moment=require(_0x778e('0x1'));var BPromise=require('bluebird');var rs=require(_0x778e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x778e('0x3'))['db'];var utils=require(_0x778e('0x4'));var logger=require(_0x778e('0x5'))(_0x778e('0x6'));var config=require('../../config/environment');var jayson=require(_0x778e('0x7'));var client=jayson[_0x778e('0x8')][_0x778e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d9518,_0xd3da09,_0x2e5c5a){return new BPromise(function(_0x1e3704,_0x4b95ca){return client[_0x778e('0xa')](_0x8d9518,_0x2e5c5a)[_0x778e('0xb')](function(_0x400f42){logger[_0x778e('0xc')](_0x778e('0xd'),_0xd3da09,_0x778e('0xe'));logger[_0x778e('0xf')](_0x778e('0x10'),_0xd3da09,_0x778e('0xe'),JSON[_0x778e('0x11')](_0x400f42));if(_0x400f42[_0x778e('0x12')]){if(_0x400f42['error']['code']===0x1f4){logger[_0x778e('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0xd3da09,_0x400f42[_0x778e('0x12')]['message']);return _0x4b95ca(_0x400f42[_0x778e('0x12')][_0x778e('0x13')]);}logger[_0x778e('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0xd3da09,_0x400f42[_0x778e('0x12')]['message']);return _0x1e3704(_0x400f42['error'][_0x778e('0x13')]);}else{logger[_0x778e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0xd3da09,_0x778e('0xe'));_0x1e3704(_0x400f42['result']['message']);}})[_0x778e('0x14')](function(_0x2aab80){logger[_0x778e('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0xd3da09,_0x2aab80);_0x4b95ca(_0x2aab80);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2848d22..0eebe0d 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 _0x2ce5=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2ce5,0x1e5));var _0x52ce=function(_0x5c7596,_0x54b972){_0x5c7596=_0x5c7596-0x0;var _0x401674=_0x2ce5[_0x5c7596];return _0x401674;};'use strict';var multer=require(_0x52ce('0x0'));var util=require(_0x52ce('0x1'));var path=require('path');var timeout=require(_0x52ce('0x2'));var express=require(_0x52ce('0x3'));var router=express[_0x52ce('0x4')]();var fs_extra=require(_0x52ce('0x5'));var auth=require(_0x52ce('0x6'));var interaction=require(_0x52ce('0x7'));var config=require(_0x52ce('0x8'));var controller=require(_0x52ce('0x9'));router[_0x52ce('0xa')]('/',auth[_0x52ce('0xb')](),controller[_0x52ce('0xc')]);router['get'](_0x52ce('0xd'),auth[_0x52ce('0xb')](),controller[_0x52ce('0xe')]);router[_0x52ce('0xf')]('/',auth[_0x52ce('0xb')](),controller[_0x52ce('0x10')]);router[_0x52ce('0x11')](_0x52ce('0xd'),auth[_0x52ce('0xb')](),controller[_0x52ce('0x12')]);router[_0x52ce('0x13')](_0x52ce('0xd'),auth[_0x52ce('0xb')](),controller['destroy']);module[_0x52ce('0x14')]=router; \ No newline at end of file +var _0x926f=['update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x4b3c80,_0x8fa313){var _0x434bc0=function(_0x4abedf){while(--_0x4abedf){_0x4b3c80['push'](_0x4b3c80['shift']());}};_0x434bc0(++_0x8fa313);}(_0x926f,0x19b));var _0xf926=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x926f[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xf926('0x0'));var util=require(_0xf926('0x1'));var path=require('path');var timeout=require(_0xf926('0x2'));var express=require('express');var router=express[_0xf926('0x3')]();var fs_extra=require(_0xf926('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf926('0x5'));var controller=require(_0xf926('0x6'));router['get']('/',auth[_0xf926('0x7')](),controller[_0xf926('0x8')]);router[_0xf926('0x9')](_0xf926('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf926('0xb')]('/',auth[_0xf926('0x7')](),controller[_0xf926('0xc')]);router[_0xf926('0xd')](_0xf926('0xa'),auth['isAuthenticated'](),controller[_0xf926('0xe')]);router[_0xf926('0xf')](_0xf926('0xa'),auth[_0xf926('0x7')](),controller[_0xf926('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6302599..638c660 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 _0xf5fa=['picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x16a344,_0x43dc6c){var _0x24f848=function(_0x23c39a){while(--_0x23c39a){_0x16a344['push'](_0x16a344['shift']());}};_0x24f848(++_0x43dc6c);}(_0xf5fa,0x13e));var _0xaf5f=function(_0x1f249d,_0x3169f4){_0x1f249d=_0x1f249d-0x0;var _0x29e733=_0xf5fa[_0x1f249d];return _0x29e733;};'use strict';var Sequelize=require(_0xaf5f('0x0'));module[_0xaf5f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xaf5f('0x2'),_0xaf5f('0x3'),_0xaf5f('0x4'),_0xaf5f('0x5'),_0xaf5f('0x6')),'defaultValue':_0xaf5f('0x2')},'content':{'type':Sequelize[_0xaf5f('0x7')]},'key':{'type':Sequelize[_0xaf5f('0x7')]},'keyType':{'type':Sequelize[_0xaf5f('0x8')]('string',_0xaf5f('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaf5f('0x7')]},'nameField':{'type':Sequelize[_0xaf5f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf5f('0x7')]}}; \ No newline at end of file +var _0xd849=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x29c5bc,_0x5e8abf){var _0x20266f=function(_0x460e40){while(--_0x460e40){_0x29c5bc['push'](_0x29c5bc['shift']());}};_0x20266f(++_0x5e8abf);}(_0xd849,0x177));var _0x9d84=function(_0x29740e,_0x200cc1){_0x29740e=_0x29740e-0x0;var _0x89660b=_0xd849[_0x29740e];return _0x89660b;};'use strict';var Sequelize=require(_0x9d84('0x0'));module[_0x9d84('0x1')]={'type':{'type':Sequelize[_0x9d84('0x2')](_0x9d84('0x3'),'variable',_0x9d84('0x4'),_0x9d84('0x5'),_0x9d84('0x6')),'defaultValue':_0x9d84('0x3')},'content':{'type':Sequelize[_0x9d84('0x7')]},'key':{'type':Sequelize[_0x9d84('0x7')]},'keyType':{'type':Sequelize[_0x9d84('0x2')](_0x9d84('0x3'),'variable',_0x9d84('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9d84('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d84('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 45984cb..580d2eb 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 _0xa680=['error','name','index','map','DeskField','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy'];(function(_0x57f694,_0x2915b0){var _0x2262d0=function(_0x2c0389){while(--_0x2c0389){_0x57f694['push'](_0x57f694['shift']());}};_0x2262d0(++_0x2915b0);}(_0xa680,0xb0));var _0x0a68=function(_0x8b2cab,_0x23e762){_0x8b2cab=_0x8b2cab-0x0;var _0x44482a=_0xa680[_0x8b2cab];return _0x44482a;};'use strict';var emlformat=require(_0x0a68('0x0'));var rimraf=require(_0x0a68('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a68('0x2'));var moment=require(_0x0a68('0x3'));var BPromise=require(_0x0a68('0x4'));var Mustache=require(_0x0a68('0x5'));var util=require('util');var path=require(_0x0a68('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a68('0x7'));var _=require(_0x0a68('0x8'));var squel=require(_0x0a68('0x9'));var crypto=require(_0x0a68('0xa'));var jsforce=require(_0x0a68('0xb'));var deskjs=require(_0x0a68('0xc'));var toCsv=require(_0x0a68('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a68('0xe'));var authService=require(_0x0a68('0xf'));var qs=require(_0x0a68('0x10'));var as=require(_0x0a68('0x11'));var hardwareService=require(_0x0a68('0x12'));var logger=require(_0x0a68('0x13'))(_0x0a68('0x14'));var utils=require(_0x0a68('0x15'));var config=require(_0x0a68('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a68('0x17'))['db'];function respondWithStatusCode(_0x6baaf,_0x1f1306){_0x1f1306=_0x1f1306||0xcc;return function(_0x10fa2d){if(_0x10fa2d){return _0x6baaf[_0x0a68('0x18')](_0x1f1306);}return _0x6baaf[_0x0a68('0x19')](_0x1f1306)[_0x0a68('0x1a')]();};}function respondWithResult(_0x2b0d2e,_0x4b4716){_0x4b4716=_0x4b4716||0xc8;return function(_0x4c2a93){if(_0x4c2a93){return _0x2b0d2e[_0x0a68('0x19')](_0x4b4716)[_0x0a68('0x1b')](_0x4c2a93);}};}function respondWithFilteredResult(_0x38587a,_0x50cb26){return function(_0x34707e){if(_0x34707e){var _0x5ad51a=typeof _0x50cb26[_0x0a68('0x1c')]===_0x0a68('0x1d')&&typeof _0x50cb26['limit']===_0x0a68('0x1d');var _0xc9ac2b=_0x34707e[_0x0a68('0x1e')];var _0x367e5e=_0x5ad51a?0x0:_0x50cb26[_0x0a68('0x1c')];var _0x104f62=_0x5ad51a?_0x34707e['count']:_0x50cb26['offset']+_0x50cb26['limit'];var _0x2ba411;if(_0x104f62>=_0xc9ac2b){_0x104f62=_0xc9ac2b;_0x2ba411=0xc8;}else{_0x2ba411=0xce;}_0x38587a[_0x0a68('0x19')](_0x2ba411);return _0x38587a[_0x0a68('0x1f')]('Content-Range',_0x367e5e+'-'+_0x104f62+'/'+_0xc9ac2b)['json'](_0x34707e);}return null;};}function patchUpdates(_0x36e9b0){return function(_0x91b85e){try{jsonpatch[_0x0a68('0x20')](_0x91b85e,_0x36e9b0,!![]);}catch(_0x2f89fd){return BPromise['reject'](_0x2f89fd);}return _0x91b85e[_0x0a68('0x21')]();};}function saveUpdates(_0x3c6967,_0x207696){return function(_0x4b98fa){if(_0x4b98fa){return _0x4b98fa[_0x0a68('0x22')](_0x3c6967)[_0x0a68('0x23')](function(_0x5f2ec2){return _0x5f2ec2;});}return null;};}function removeEntity(_0x4b7251,_0x58d72b){return function(_0x2fde6a){if(_0x2fde6a){return _0x2fde6a[_0x0a68('0x24')]()['then'](function(){_0x4b7251['status'](0xcc)[_0x0a68('0x1a')]();});}};}function handleEntityNotFound(_0x4fc58e,_0x790d22){return function(_0x5335b0){if(!_0x5335b0){_0x4fc58e[_0x0a68('0x18')](0x194);}return _0x5335b0;};}function handleError(_0x35a540,_0x255467){_0x255467=_0x255467||0x1f4;return function(_0x42b203){logger[_0x0a68('0x25')](_0x42b203['stack']);if(_0x42b203[_0x0a68('0x26')]){delete _0x42b203[_0x0a68('0x26')];}_0x35a540[_0x0a68('0x19')](_0x255467)['send'](_0x42b203);};}exports[_0x0a68('0x27')]=function(_0x2d8985,_0x489012){var _0x354420={},_0x2fb1da={},_0x524a08={'count':0x0,'rows':[]};var _0x3349b2=_[_0x0a68('0x28')](db[_0x0a68('0x29')][_0x0a68('0x2a')],function(_0x53c2a5){return{'name':_0x53c2a5['fieldName'],'type':_0x53c2a5[_0x0a68('0x2b')]['key']};});_0x2fb1da['model']=_[_0x0a68('0x28')](_0x3349b2,_0x0a68('0x26'));_0x2fb1da[_0x0a68('0x2c')]=_[_0x0a68('0x2d')](_0x2d8985['query']);_0x2fb1da['filters']=_[_0x0a68('0x2e')](_0x2fb1da[_0x0a68('0x2f')],_0x2fb1da[_0x0a68('0x2c')]);_0x354420[_0x0a68('0x30')]=_[_0x0a68('0x2e')](_0x2fb1da['model'],qs['fields'](_0x2d8985['query'][_0x0a68('0x31')]));_0x354420[_0x0a68('0x30')]=_0x354420[_0x0a68('0x30')][_0x0a68('0x32')]?_0x354420[_0x0a68('0x30')]:_0x2fb1da['model'];if(!_0x2d8985['query'][_0x0a68('0x33')](_0x0a68('0x34'))){_0x354420[_0x0a68('0x35')]=qs[_0x0a68('0x35')](_0x2d8985['query'][_0x0a68('0x35')]);_0x354420[_0x0a68('0x1c')]=qs[_0x0a68('0x1c')](_0x2d8985[_0x0a68('0x2c')][_0x0a68('0x1c')]);}_0x354420[_0x0a68('0x36')]=qs[_0x0a68('0x37')](_0x2d8985['query'][_0x0a68('0x37')]);_0x354420[_0x0a68('0x38')]=qs[_0x0a68('0x39')](_[_0x0a68('0x3a')](_0x2d8985[_0x0a68('0x2c')],_0x2fb1da[_0x0a68('0x39')]),_0x3349b2);if(_0x2d8985[_0x0a68('0x2c')][_0x0a68('0x3b')]){_0x354420['where']=_[_0x0a68('0x3c')](_0x354420[_0x0a68('0x38')],{'$or':_[_0x0a68('0x28')](_0x3349b2,function(_0x2d02fc){if(_0x2d02fc[_0x0a68('0x2b')]!==_0x0a68('0x3d')){var _0x5e1eb1={};_0x5e1eb1[_0x2d02fc[_0x0a68('0x26')]]={'$like':'%'+_0x2d8985[_0x0a68('0x2c')][_0x0a68('0x3b')]+'%'};return _0x5e1eb1;}})});}_0x354420=_[_0x0a68('0x3c')]({},_0x354420,_0x2d8985[_0x0a68('0x3e')]);var _0x394ce9={'where':_0x354420[_0x0a68('0x38')]};return db[_0x0a68('0x29')][_0x0a68('0x1e')](_0x394ce9)[_0x0a68('0x23')](function(_0x593add){_0x524a08[_0x0a68('0x1e')]=_0x593add;if(_0x2d8985['query']['includeAll']){_0x354420[_0x0a68('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x0a68('0x40')](_0x354420);})[_0x0a68('0x23')](function(_0x41e49e){_0x524a08['rows']=_0x41e49e;return _0x524a08;})[_0x0a68('0x23')](respondWithFilteredResult(_0x489012,_0x354420))[_0x0a68('0x41')](handleError(_0x489012,null));};exports['show']=function(_0x370761,_0x38f39b){var _0x55967a={'raw':!![],'where':{'id':_0x370761[_0x0a68('0x42')]['id']}},_0x195557={};_0x195557[_0x0a68('0x2f')]=_['keys'](db['DeskField'][_0x0a68('0x2a')]);_0x195557[_0x0a68('0x2c')]=_[_0x0a68('0x2d')](_0x370761[_0x0a68('0x2c')]);_0x195557['filters']=_[_0x0a68('0x2e')](_0x195557['model'],_0x195557['query']);_0x55967a[_0x0a68('0x30')]=_[_0x0a68('0x2e')](_0x195557[_0x0a68('0x2f')],qs[_0x0a68('0x31')](_0x370761['query'][_0x0a68('0x31')]));_0x55967a[_0x0a68('0x30')]=_0x55967a[_0x0a68('0x30')][_0x0a68('0x32')]?_0x55967a['attributes']:_0x195557['model'];if(_0x370761[_0x0a68('0x2c')][_0x0a68('0x43')]){_0x55967a['include']=[{'all':!![]}];}_0x55967a=_[_0x0a68('0x3c')]({},_0x55967a,_0x370761[_0x0a68('0x3e')]);return db[_0x0a68('0x29')][_0x0a68('0x44')](_0x55967a)[_0x0a68('0x23')](handleEntityNotFound(_0x38f39b,null))[_0x0a68('0x23')](respondWithResult(_0x38f39b,null))[_0x0a68('0x41')](handleError(_0x38f39b,null));};exports[_0x0a68('0x45')]=function(_0x158c4f,_0x367671){return db[_0x0a68('0x29')][_0x0a68('0x45')](_0x158c4f[_0x0a68('0x46')],{})[_0x0a68('0x23')](respondWithResult(_0x367671,0xc9))[_0x0a68('0x41')](handleError(_0x367671,null));};exports[_0x0a68('0x22')]=function(_0x403c07,_0x4b8a03){if(_0x403c07['body']['id']){delete _0x403c07['body']['id'];}return db['DeskField'][_0x0a68('0x44')]({'where':{'id':_0x403c07[_0x0a68('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b8a03,null))[_0x0a68('0x23')](saveUpdates(_0x403c07[_0x0a68('0x46')],null))['then'](respondWithResult(_0x4b8a03,null))[_0x0a68('0x41')](handleError(_0x4b8a03,null));};exports[_0x0a68('0x24')]=function(_0x591d5c,_0x357919){return db[_0x0a68('0x29')]['find']({'where':{'id':_0x591d5c[_0x0a68('0x42')]['id']}})['then'](handleEntityNotFound(_0x357919,null))['then'](removeEntity(_0x357919,null))['catch'](handleError(_0x357919,null));}; \ No newline at end of file +var _0x1d65=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','DeskField','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','destroy','rimraf','zip-dir','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','stack','name','send','map','rawAttributes','fieldName','model','query','keys'];(function(_0x185cd0,_0x4d682c){var _0x370329=function(_0x52887a){while(--_0x52887a){_0x185cd0['push'](_0x185cd0['shift']());}};_0x370329(++_0x4d682c);}(_0x1d65,0x1d7));var _0x51d6=function(_0x327e23,_0x22dd8c){_0x327e23=_0x327e23-0x0;var _0x4e9b6d=_0x1d65[_0x327e23];return _0x4e9b6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51d6('0x0'));var zipdir=require(_0x51d6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51d6('0x2'));var moment=require(_0x51d6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x51d6('0x4'));var path=require('path');var sox=require(_0x51d6('0x5'));var csv=require('to-csv');var ejs=require(_0x51d6('0x6'));var fs=require('fs');var fs_extra=require(_0x51d6('0x7'));var _=require(_0x51d6('0x8'));var squel=require(_0x51d6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x51d6('0xa'));var toCsv=require(_0x51d6('0xb'));var querystring=require(_0x51d6('0xc'));var Papa=require(_0x51d6('0xd'));var Redis=require(_0x51d6('0xe'));var authService=require(_0x51d6('0xf'));var qs=require(_0x51d6('0x10'));var as=require(_0x51d6('0x11'));var hardwareService=require(_0x51d6('0x12'));var logger=require(_0x51d6('0x13'))(_0x51d6('0x14'));var utils=require(_0x51d6('0x15'));var config=require(_0x51d6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x51d6('0x17'))['db'];function respondWithStatusCode(_0x4165e7,_0x1eab9b){_0x1eab9b=_0x1eab9b||0xcc;return function(_0x383859){if(_0x383859){return _0x4165e7[_0x51d6('0x18')](_0x1eab9b);}return _0x4165e7[_0x51d6('0x19')](_0x1eab9b)['end']();};}function respondWithResult(_0x52c98d,_0x3da684){_0x3da684=_0x3da684||0xc8;return function(_0x384e08){if(_0x384e08){return _0x52c98d[_0x51d6('0x19')](_0x3da684)[_0x51d6('0x1a')](_0x384e08);}};}function respondWithFilteredResult(_0x2c9919,_0x50134f){return function(_0x4b9c02){if(_0x4b9c02){var _0x5647b7=typeof _0x50134f[_0x51d6('0x1b')]===_0x51d6('0x1c')&&typeof _0x50134f[_0x51d6('0x1d')]===_0x51d6('0x1c');var _0x2c2c00=_0x4b9c02[_0x51d6('0x1e')];var _0x531d96=_0x5647b7?0x0:_0x50134f[_0x51d6('0x1b')];var _0x8bc9d3=_0x5647b7?_0x4b9c02['count']:_0x50134f[_0x51d6('0x1b')]+_0x50134f[_0x51d6('0x1d')];var _0x2c3248;if(_0x8bc9d3>=_0x2c2c00){_0x8bc9d3=_0x2c2c00;_0x2c3248=0xc8;}else{_0x2c3248=0xce;}_0x2c9919[_0x51d6('0x19')](_0x2c3248);return _0x2c9919[_0x51d6('0x1f')](_0x51d6('0x20'),_0x531d96+'-'+_0x8bc9d3+'/'+_0x2c2c00)[_0x51d6('0x1a')](_0x4b9c02);}return null;};}function patchUpdates(_0x3b128d){return function(_0x5da088){try{jsonpatch[_0x51d6('0x21')](_0x5da088,_0x3b128d,!![]);}catch(_0x3888cb){return BPromise[_0x51d6('0x22')](_0x3888cb);}return _0x5da088[_0x51d6('0x23')]();};}function saveUpdates(_0x33b0fb,_0x751a6){return function(_0x471a8c){if(_0x471a8c){return _0x471a8c['update'](_0x33b0fb)[_0x51d6('0x24')](function(_0x5382b9){return _0x5382b9;});}return null;};}function removeEntity(_0x2d5e70,_0x28b7d6){return function(_0x53c88f){if(_0x53c88f){return _0x53c88f['destroy']()[_0x51d6('0x24')](function(){_0x2d5e70[_0x51d6('0x19')](0xcc)[_0x51d6('0x25')]();});}};}function handleEntityNotFound(_0x171440,_0x29cf0d){return function(_0x192cf8){if(!_0x192cf8){_0x171440['sendStatus'](0x194);}return _0x192cf8;};}function handleError(_0x4276ef,_0x45e250){_0x45e250=_0x45e250||0x1f4;return function(_0x4c0d55){logger['error'](_0x4c0d55[_0x51d6('0x26')]);if(_0x4c0d55[_0x51d6('0x27')]){delete _0x4c0d55['name'];}_0x4276ef[_0x51d6('0x19')](_0x45e250)[_0x51d6('0x28')](_0x4c0d55);};}exports['index']=function(_0x1d734a,_0x2014ef){var _0x49796b={},_0x45151={},_0x4c81e3={'count':0x0,'rows':[]};var _0x307490=_[_0x51d6('0x29')](db['DeskField'][_0x51d6('0x2a')],function(_0x59d12c){return{'name':_0x59d12c[_0x51d6('0x2b')],'type':_0x59d12c['type']['key']};});_0x45151[_0x51d6('0x2c')]=_[_0x51d6('0x29')](_0x307490,_0x51d6('0x27'));_0x45151[_0x51d6('0x2d')]=_[_0x51d6('0x2e')](_0x1d734a[_0x51d6('0x2d')]);_0x45151['filters']=_['intersection'](_0x45151[_0x51d6('0x2c')],_0x45151['query']);_0x49796b['attributes']=_[_0x51d6('0x2f')](_0x45151[_0x51d6('0x2c')],qs[_0x51d6('0x30')](_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x30')]));_0x49796b[_0x51d6('0x31')]=_0x49796b['attributes'][_0x51d6('0x32')]?_0x49796b['attributes']:_0x45151[_0x51d6('0x2c')];if(!_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x33')](_0x51d6('0x34'))){_0x49796b[_0x51d6('0x1d')]=qs[_0x51d6('0x1d')](_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x1d')]);_0x49796b[_0x51d6('0x1b')]=qs[_0x51d6('0x1b')](_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x1b')]);}_0x49796b[_0x51d6('0x35')]=qs[_0x51d6('0x36')](_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x36')]);_0x49796b[_0x51d6('0x37')]=qs[_0x51d6('0x38')](_['pick'](_0x1d734a[_0x51d6('0x2d')],_0x45151['filters']),_0x307490);if(_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x39')]){_0x49796b[_0x51d6('0x37')]=_[_0x51d6('0x3a')](_0x49796b[_0x51d6('0x37')],{'$or':_['map'](_0x307490,function(_0x36126e){if(_0x36126e[_0x51d6('0x3b')]!==_0x51d6('0x3c')){var _0x46c507={};_0x46c507[_0x36126e[_0x51d6('0x27')]]={'$like':'%'+_0x1d734a[_0x51d6('0x2d')][_0x51d6('0x39')]+'%'};return _0x46c507;}})});}_0x49796b=_[_0x51d6('0x3a')]({},_0x49796b,_0x1d734a['options']);var _0xd18c3c={'where':_0x49796b[_0x51d6('0x37')]};return db[_0x51d6('0x3d')][_0x51d6('0x1e')](_0xd18c3c)[_0x51d6('0x24')](function(_0x47cc1e){_0x4c81e3[_0x51d6('0x1e')]=_0x47cc1e;if(_0x1d734a['query'][_0x51d6('0x3e')]){_0x49796b[_0x51d6('0x3f')]=[{'all':!![]}];}return db[_0x51d6('0x3d')][_0x51d6('0x40')](_0x49796b);})[_0x51d6('0x24')](function(_0x4fbefd){_0x4c81e3[_0x51d6('0x41')]=_0x4fbefd;return _0x4c81e3;})[_0x51d6('0x24')](respondWithFilteredResult(_0x2014ef,_0x49796b))['catch'](handleError(_0x2014ef,null));};exports[_0x51d6('0x42')]=function(_0x4336f5,_0x2bd7db){var _0x57aa0f={'raw':!![],'where':{'id':_0x4336f5[_0x51d6('0x43')]['id']}},_0xc1ddeb={};_0xc1ddeb['model']=_['keys'](db[_0x51d6('0x3d')][_0x51d6('0x2a')]);_0xc1ddeb[_0x51d6('0x2d')]=_[_0x51d6('0x2e')](_0x4336f5[_0x51d6('0x2d')]);_0xc1ddeb[_0x51d6('0x38')]=_[_0x51d6('0x2f')](_0xc1ddeb[_0x51d6('0x2c')],_0xc1ddeb[_0x51d6('0x2d')]);_0x57aa0f['attributes']=_[_0x51d6('0x2f')](_0xc1ddeb[_0x51d6('0x2c')],qs[_0x51d6('0x30')](_0x4336f5[_0x51d6('0x2d')][_0x51d6('0x30')]));_0x57aa0f[_0x51d6('0x31')]=_0x57aa0f['attributes'][_0x51d6('0x32')]?_0x57aa0f[_0x51d6('0x31')]:_0xc1ddeb[_0x51d6('0x2c')];if(_0x4336f5[_0x51d6('0x2d')][_0x51d6('0x3e')]){_0x57aa0f[_0x51d6('0x3f')]=[{'all':!![]}];}_0x57aa0f=_['merge']({},_0x57aa0f,_0x4336f5[_0x51d6('0x44')]);return db[_0x51d6('0x3d')][_0x51d6('0x45')](_0x57aa0f)[_0x51d6('0x24')](handleEntityNotFound(_0x2bd7db,null))[_0x51d6('0x24')](respondWithResult(_0x2bd7db,null))['catch'](handleError(_0x2bd7db,null));};exports[_0x51d6('0x46')]=function(_0x4f738e,_0x1d4291){return db['DeskField'][_0x51d6('0x46')](_0x4f738e[_0x51d6('0x47')],{})['then'](respondWithResult(_0x1d4291,0xc9))[_0x51d6('0x48')](handleError(_0x1d4291,null));};exports['update']=function(_0xbb90db,_0x311417){if(_0xbb90db[_0x51d6('0x47')]['id']){delete _0xbb90db[_0x51d6('0x47')]['id'];}return db[_0x51d6('0x3d')]['find']({'where':{'id':_0xbb90db['params']['id']}})[_0x51d6('0x24')](handleEntityNotFound(_0x311417,null))[_0x51d6('0x24')](saveUpdates(_0xbb90db[_0x51d6('0x47')],null))[_0x51d6('0x24')](respondWithResult(_0x311417,null))[_0x51d6('0x48')](handleError(_0x311417,null));};exports[_0x51d6('0x49')]=function(_0x29ee53,_0x18205f){return db[_0x51d6('0x3d')][_0x51d6('0x45')]({'where':{'id':_0x29ee53[_0x51d6('0x43')]['id']}})[_0x51d6('0x24')](handleEntityNotFound(_0x18205f,null))[_0x51d6('0x24')](removeEntity(_0x18205f,null))[_0x51d6('0x48')](handleError(_0x18205f,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index cf998a0..bcdb21f 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 _0x3662=['path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','request-promise'];(function(_0x36552f,_0x25d8c5){var _0x25500c=function(_0x892f2){while(--_0x892f2){_0x36552f['push'](_0x36552f['shift']());}};_0x25500c(++_0x25d8c5);}(_0x3662,0x78));var _0x2366=function(_0x3fc081,_0x5cba49){_0x3fc081=_0x3fc081-0x0;var _0x591c1c=_0x3662[_0x3fc081];return _0x591c1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2366('0x0'));var fs=require('fs');var path=require(_0x2366('0x1'));var rimraf=require(_0x2366('0x2'));var config=require(_0x2366('0x3'));var attributes=require('./intDeskField.attributes');module[_0x2366('0x4')]=function(_0x43e6ad,_0x30c07e){return _0x43e6ad[_0x2366('0x5')](_0x2366('0x6'),attributes,{'tableName':_0x2366('0x7'),'paranoid':![],'indexes':[{'name':_0x2366('0x8'),'fields':[_0x2366('0x9'),_0x2366('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ca3=['path','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x5ca3,0x149));var _0x35ca=function(_0x517e21,_0x52749b){_0x517e21=_0x517e21-0x0;var _0x480f6d=_0x5ca3[_0x517e21];return _0x480f6d;};'use strict';var _=require(_0x35ca('0x0'));var util=require(_0x35ca('0x1'));var logger=require(_0x35ca('0x2'))(_0x35ca('0x3'));var moment=require(_0x35ca('0x4'));var BPromise=require(_0x35ca('0x5'));var rp=require(_0x35ca('0x6'));var fs=require('fs');var path=require(_0x35ca('0x7'));var rimraf=require('rimraf');var config=require(_0x35ca('0x8'));var attributes=require(_0x35ca('0x9'));module['exports']=function(_0x26ebaf,_0x1ba57f){return _0x26ebaf[_0x35ca('0xa')](_0x35ca('0xb'),attributes,{'tableName':_0x35ca('0xc'),'paranoid':![],'indexes':[{'name':_0x35ca('0xd'),'fields':[_0x35ca('0xe'),_0x35ca('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 29335cf..0a2db44 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 _0x3cd0=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x31e0dd,_0x545760){var _0x59dd02=function(_0x578c11){while(--_0x578c11){_0x31e0dd['push'](_0x31e0dd['shift']());}};_0x59dd02(++_0x545760);}(_0x3cd0,0x1f0));var _0x03cd=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x3cd0[_0xda464c];return _0x19e222;};'use strict';var _=require('lodash');var util=require(_0x03cd('0x0'));var moment=require(_0x03cd('0x1'));var BPromise=require(_0x03cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x03cd('0x4'));var logger=require(_0x03cd('0x5'))(_0x03cd('0x6'));var config=require(_0x03cd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x03cd('0x8')][_0x03cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33775e,_0x15ef71,_0x4e5e1b){return new BPromise(function(_0x3303e8,_0xee3ca6){return client[_0x03cd('0xa')](_0x33775e,_0x4e5e1b)[_0x03cd('0xb')](function(_0x15e7f3){logger[_0x03cd('0xc')](_0x03cd('0xd'),_0x15ef71,_0x03cd('0xe'));logger[_0x03cd('0xf')](_0x03cd('0x10'),_0x15ef71,'request\x20sent',JSON[_0x03cd('0x11')](_0x15e7f3));if(_0x15e7f3[_0x03cd('0x12')]){if(_0x15e7f3[_0x03cd('0x12')][_0x03cd('0x13')]===0x1f4){logger['error'](_0x03cd('0xd'),_0x15ef71,_0x15e7f3['error'][_0x03cd('0x14')]);return _0xee3ca6(_0x15e7f3[_0x03cd('0x12')][_0x03cd('0x14')]);}logger[_0x03cd('0x12')](_0x03cd('0xd'),_0x15ef71,_0x15e7f3[_0x03cd('0x12')][_0x03cd('0x14')]);return _0x3303e8(_0x15e7f3[_0x03cd('0x12')][_0x03cd('0x14')]);}else{logger[_0x03cd('0xc')]('DeskField,\x20%s,\x20%s',_0x15ef71,_0x03cd('0xe'));_0x3303e8(_0x15e7f3[_0x03cd('0x15')]['message']);}})[_0x03cd('0x16')](function(_0x3cdf37){logger[_0x03cd('0x12')](_0x03cd('0xd'),_0x15ef71,_0x3cdf37);_0xee3ca6(_0x3cdf37);});});} \ No newline at end of file +var _0x4174=['then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4174,0xf8));var _0x4417=function(_0x3ef1d4,_0x3fc67a){_0x3ef1d4=_0x3ef1d4-0x0;var _0x2c5f70=_0x4174[_0x3ef1d4];return _0x2c5f70;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4417('0x0'));var BPromise=require(_0x4417('0x1'));var rs=require(_0x4417('0x2'));var fs=require('fs');var Redis=require(_0x4417('0x3'));var db=require(_0x4417('0x4'))['db'];var utils=require(_0x4417('0x5'));var logger=require('../../config/logger')(_0x4417('0x6'));var config=require(_0x4417('0x7'));var jayson=require(_0x4417('0x8'));var client=jayson[_0x4417('0x9')][_0x4417('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x142499,_0x27cfdd,_0x554a8e){return new BPromise(function(_0x5ef397,_0x4e7fba){return client[_0x4417('0xb')](_0x142499,_0x554a8e)[_0x4417('0xc')](function(_0x1254c3){logger[_0x4417('0xd')](_0x4417('0xe'),_0x27cfdd,_0x4417('0xf'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x27cfdd,'request\x20sent',JSON[_0x4417('0x10')](_0x1254c3));if(_0x1254c3[_0x4417('0x11')]){if(_0x1254c3['error']['code']===0x1f4){logger['error'](_0x4417('0xe'),_0x27cfdd,_0x1254c3[_0x4417('0x11')][_0x4417('0x12')]);return _0x4e7fba(_0x1254c3[_0x4417('0x11')][_0x4417('0x12')]);}logger[_0x4417('0x11')](_0x4417('0xe'),_0x27cfdd,_0x1254c3[_0x4417('0x11')][_0x4417('0x12')]);return _0x5ef397(_0x1254c3[_0x4417('0x11')][_0x4417('0x12')]);}else{logger[_0x4417('0xd')](_0x4417('0xe'),_0x27cfdd,'request\x20sent');_0x5ef397(_0x1254c3['result'][_0x4417('0x12')]);}})[_0x4417('0x13')](function(_0xeb9475){logger[_0x4417('0x11')](_0x4417('0xe'),_0x27cfdd,_0xeb9475);_0x4e7fba(_0xeb9475);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 1caf0d5..4d2ddd0 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 _0x6940=['update','delete','destroy','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','create','post','addConfiguration','put','/:id'];(function(_0x93aa47,_0xaeb5f9){var _0x26d122=function(_0x493121){while(--_0x493121){_0x93aa47['push'](_0x93aa47['shift']());}};_0x26d122(++_0xaeb5f9);}(_0x6940,0x67));var _0x0694=function(_0x2ef56c,_0x318029){_0x2ef56c=_0x2ef56c-0x0;var _0x312508=_0x6940[_0x2ef56c];return _0x312508;};'use strict';var multer=require('multer');var util=require(_0x0694('0x0'));var path=require(_0x0694('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0694('0x2')]();var fs_extra=require(_0x0694('0x3'));var auth=require(_0x0694('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0694('0x5'));var controller=require(_0x0694('0x6'));router[_0x0694('0x7')]('/',auth[_0x0694('0x8')](),controller[_0x0694('0x9')]);router[_0x0694('0x7')]('/:id',auth[_0x0694('0x8')](),controller['show']);router[_0x0694('0x7')](_0x0694('0xa'),auth[_0x0694('0x8')](),controller[_0x0694('0xb')]);router[_0x0694('0x7')]('/:id/fields',auth[_0x0694('0x8')](),controller['getFields']);router['post']('/',auth[_0x0694('0x8')](),controller[_0x0694('0xc')]);router[_0x0694('0xd')]('/:id/configurations',auth[_0x0694('0x8')](),controller[_0x0694('0xe')]);router[_0x0694('0xf')](_0x0694('0x10'),auth['isAuthenticated'](),controller[_0x0694('0x11')]);router[_0x0694('0x12')](_0x0694('0x10'),auth[_0x0694('0x8')](),controller[_0x0694('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa26b=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x31688a,_0x588c7d){var _0xc7b088=function(_0x3ed4c8){while(--_0x3ed4c8){_0x31688a['push'](_0x31688a['shift']());}};_0xc7b088(++_0x588c7d);}(_0xa26b,0x149));var _0xba26=function(_0x2d4ae2,_0x5a8638){_0x2d4ae2=_0x2d4ae2-0x0;var _0x3a27af=_0xa26b[_0x2d4ae2];return _0x3a27af;};'use strict';var multer=require(_0xba26('0x0'));var util=require(_0xba26('0x1'));var path=require(_0xba26('0x2'));var timeout=require(_0xba26('0x3'));var express=require(_0xba26('0x4'));var router=express[_0xba26('0x5')]();var fs_extra=require(_0xba26('0x6'));var auth=require(_0xba26('0x7'));var interaction=require(_0xba26('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xba26('0x9')]('/',auth[_0xba26('0xa')](),controller[_0xba26('0xb')]);router[_0xba26('0x9')](_0xba26('0xc'),auth[_0xba26('0xa')](),controller[_0xba26('0xd')]);router['get'](_0xba26('0xe'),auth[_0xba26('0xa')](),controller[_0xba26('0xf')]);router[_0xba26('0x9')](_0xba26('0x10'),auth[_0xba26('0xa')](),controller[_0xba26('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xba26('0x12')](_0xba26('0xe'),auth[_0xba26('0xa')](),controller['addConfiguration']);router[_0xba26('0x13')](_0xba26('0xc'),auth[_0xba26('0xa')](),controller[_0xba26('0x14')]);router[_0xba26('0x15')](_0xba26('0xc'),auth[_0xba26('0xa')](),controller[_0xba26('0x16')]);module[_0xba26('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 7d3acb8..ebeb988 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 _0xd85e=['sequelize','exports','STRING'];(function(_0x3ca37a,_0x830859){var _0x49654b=function(_0x3bc42a){while(--_0x3bc42a){_0x3ca37a['push'](_0x3ca37a['shift']());}};_0x49654b(++_0x830859);}(_0xd85e,0x72));var _0xed85=function(_0x396268,_0x55fca7){_0x396268=_0x396268-0x0;var _0x2cdf39=_0xd85e[_0x396268];return _0x2cdf39;};'use strict';var Sequelize=require(_0xed85('0x0'));module[_0xed85('0x1')]={'name':{'type':Sequelize[_0xed85('0x2')]},'username':{'type':Sequelize[_0xed85('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xed85('0x2')]},'serverUrl':{'type':Sequelize[_0xed85('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe6c5=['exports','STRING'];(function(_0x10f494,_0x37b246){var _0x1d428=function(_0x5b8388){while(--_0x5b8388){_0x10f494['push'](_0x10f494['shift']());}};_0x1d428(++_0x37b246);}(_0xe6c5,0x108));var _0x5e6c=function(_0x429313,_0x3f1962){_0x429313=_0x429313-0x0;var _0x4ee6b4=_0xe6c5[_0x429313];return _0x4ee6b4;};'use strict';var Sequelize=require('sequelize');module[_0x5e6c('0x0')]={'name':{'type':Sequelize[_0x5e6c('0x1')]},'username':{'type':Sequelize[_0x5e6c('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x5e6c('0x1')]},'clientId':{'type':Sequelize[_0x5e6c('0x1')]},'clientSecret':{'type':Sequelize[_0x5e6c('0x1')]},'serverUrl':{'type':Sequelize[_0x5e6c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5e6c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a99c405..b99f83f 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 _0x9f75=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','create','body','find','params','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','clientId','GET','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x3b7fab,_0x5dcda1){var _0x1022f8=function(_0x3a1048){while(--_0x3a1048){_0x3b7fab['push'](_0x3b7fab['shift']());}};_0x1022f8(++_0x5dcda1);}(_0x9f75,0x15a));var _0x59f7=function(_0x29b4a7,_0x1cfb6f){_0x29b4a7=_0x29b4a7-0x0;var _0x5c35d6=_0x9f75[_0x29b4a7];return _0x5c35d6;};'use strict';var emlformat=require(_0x59f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59f7('0x1'));var jsonpatch=require(_0x59f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x59f7('0x3'));var Mustache=require(_0x59f7('0x4'));var util=require(_0x59f7('0x5'));var path=require(_0x59f7('0x6'));var sox=require('sox');var csv=require(_0x59f7('0x7'));var ejs=require(_0x59f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x59f7('0x9'));var crypto=require(_0x59f7('0xa'));var jsforce=require(_0x59f7('0xb'));var deskjs=require(_0x59f7('0xc'));var toCsv=require(_0x59f7('0x7'));var querystring=require(_0x59f7('0xd'));var Papa=require('papaparse');var Redis=require(_0x59f7('0xe'));var authService=require(_0x59f7('0xf'));var qs=require(_0x59f7('0x10'));var as=require(_0x59f7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59f7('0x12'))('api');var utils=require(_0x59f7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x59f7('0x14'));var db=require(_0x59f7('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x585044,_0xf44f98){_0xf44f98=_0xf44f98||0xcc;return function(_0x43f20f){if(_0x43f20f){return _0x585044[_0x59f7('0x16')](_0xf44f98);}return _0x585044[_0x59f7('0x17')](_0xf44f98)[_0x59f7('0x18')]();};}function respondWithResult(_0x2e9923,_0x5c5167){_0x5c5167=_0x5c5167||0xc8;return function(_0x4b4a18){if(_0x4b4a18){return _0x2e9923['status'](_0x5c5167)[_0x59f7('0x19')](_0x4b4a18);}};}function respondWithFilteredResult(_0x512067,_0xa3aa79){return function(_0x446b66){if(_0x446b66){var _0x46c223=typeof _0xa3aa79[_0x59f7('0x1a')]===_0x59f7('0x1b')&&typeof _0xa3aa79[_0x59f7('0x1c')]===_0x59f7('0x1b');var _0x38de7f=_0x446b66[_0x59f7('0x1d')];var _0xd619db=_0x46c223?0x0:_0xa3aa79[_0x59f7('0x1a')];var _0x129f55=_0x46c223?_0x446b66['count']:_0xa3aa79[_0x59f7('0x1a')]+_0xa3aa79[_0x59f7('0x1c')];var _0x594867;if(_0x129f55>=_0x38de7f){_0x129f55=_0x38de7f;_0x594867=0xc8;}else{_0x594867=0xce;}_0x512067[_0x59f7('0x17')](_0x594867);return _0x512067[_0x59f7('0x1e')](_0x59f7('0x1f'),_0xd619db+'-'+_0x129f55+'/'+_0x38de7f)['json'](_0x446b66);}return null;};}function patchUpdates(_0x2d2990){return function(_0x359bf4){try{jsonpatch['apply'](_0x359bf4,_0x2d2990,!![]);}catch(_0x181551){return BPromise[_0x59f7('0x20')](_0x181551);}return _0x359bf4[_0x59f7('0x21')]();};}function saveUpdates(_0x2ca762,_0x1a4d80){return function(_0x45e4a1){if(_0x45e4a1){return _0x45e4a1[_0x59f7('0x22')](_0x2ca762)[_0x59f7('0x23')](function(_0x1cc78d){return _0x1cc78d;});}return null;};}function removeEntity(_0xeff590,_0x1cdb9f){return function(_0x454fa4){if(_0x454fa4){return _0x454fa4[_0x59f7('0x24')]()[_0x59f7('0x23')](function(){_0xeff590[_0x59f7('0x17')](0xcc)[_0x59f7('0x18')]();});}};}function handleEntityNotFound(_0xd2ea31,_0x1edda0){return function(_0x3f234c){if(!_0x3f234c){_0xd2ea31[_0x59f7('0x16')](0x194);}return _0x3f234c;};}function handleError(_0x246ab4,_0x5751f0){_0x5751f0=_0x5751f0||0x1f4;return function(_0x3d28c6){logger['error'](_0x3d28c6[_0x59f7('0x25')]);if(_0x3d28c6['name']){delete _0x3d28c6[_0x59f7('0x26')];}_0x246ab4[_0x59f7('0x17')](_0x5751f0)[_0x59f7('0x27')](_0x3d28c6);};}exports['index']=function(_0x659655,_0x179526){var _0x392b5f={},_0x11f668={},_0x3c6033={'count':0x0,'rows':[]};var _0x4838e9=_[_0x59f7('0x28')](db[_0x59f7('0x29')][_0x59f7('0x2a')],function(_0x171d77){return{'name':_0x171d77[_0x59f7('0x2b')],'type':_0x171d77[_0x59f7('0x2c')][_0x59f7('0x2d')]};});_0x11f668[_0x59f7('0x2e')]=_['map'](_0x4838e9,_0x59f7('0x26'));_0x11f668['query']=_['keys'](_0x659655[_0x59f7('0x2f')]);_0x11f668[_0x59f7('0x30')]=_['intersection'](_0x11f668[_0x59f7('0x2e')],_0x11f668[_0x59f7('0x2f')]);_0x392b5f[_0x59f7('0x31')]=_[_0x59f7('0x32')](_0x11f668[_0x59f7('0x2e')],qs[_0x59f7('0x33')](_0x659655['query'][_0x59f7('0x33')]));_0x392b5f[_0x59f7('0x31')]=_0x392b5f[_0x59f7('0x31')][_0x59f7('0x34')]?_0x392b5f[_0x59f7('0x31')]:_0x11f668[_0x59f7('0x2e')];if(!_0x659655[_0x59f7('0x2f')][_0x59f7('0x35')](_0x59f7('0x36'))){_0x392b5f['limit']=qs[_0x59f7('0x1c')](_0x659655['query'][_0x59f7('0x1c')]);_0x392b5f['offset']=qs[_0x59f7('0x1a')](_0x659655['query']['offset']);}_0x392b5f['order']=qs['sort'](_0x659655[_0x59f7('0x2f')][_0x59f7('0x37')]);_0x392b5f[_0x59f7('0x38')]=qs[_0x59f7('0x30')](_[_0x59f7('0x39')](_0x659655[_0x59f7('0x2f')],_0x11f668[_0x59f7('0x30')]),_0x4838e9);if(_0x659655[_0x59f7('0x2f')][_0x59f7('0x3a')]){_0x392b5f[_0x59f7('0x38')]=_[_0x59f7('0x3b')](_0x392b5f[_0x59f7('0x38')],{'$or':_[_0x59f7('0x28')](_0x4838e9,function(_0x127ea9){if(_0x127ea9[_0x59f7('0x2c')]!==_0x59f7('0x3c')){var _0x39b71a={};_0x39b71a[_0x127ea9[_0x59f7('0x26')]]={'$like':'%'+_0x659655[_0x59f7('0x2f')]['filter']+'%'};return _0x39b71a;}})});}_0x392b5f=_['merge']({},_0x392b5f,_0x659655[_0x59f7('0x3d')]);var _0x2fa40e={'where':_0x392b5f['where']};return db[_0x59f7('0x29')][_0x59f7('0x1d')](_0x2fa40e)[_0x59f7('0x23')](function(_0x25fe0d){_0x3c6033[_0x59f7('0x1d')]=_0x25fe0d;if(_0x659655[_0x59f7('0x2f')][_0x59f7('0x3e')]){_0x392b5f[_0x59f7('0x3f')]=[{'all':!![]}];}return db[_0x59f7('0x29')]['findAll'](_0x392b5f);})[_0x59f7('0x23')](function(_0x188dd3){_0x3c6033['rows']=_0x188dd3;return _0x3c6033;})[_0x59f7('0x23')](respondWithFilteredResult(_0x179526,_0x392b5f))[_0x59f7('0x40')](handleError(_0x179526,null));};exports[_0x59f7('0x41')]=function(_0x36ea59,_0x259e43){var _0x96d9db={'raw':![],'where':{'id':_0x36ea59['params']['id']}},_0x1b7cd8={};_0x1b7cd8[_0x59f7('0x2e')]=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x1b7cd8[_0x59f7('0x2f')]=_[_0x59f7('0x42')](_0x36ea59[_0x59f7('0x2f')]);_0x1b7cd8[_0x59f7('0x30')]=_[_0x59f7('0x32')](_0x1b7cd8['model'],_0x1b7cd8['query']);_0x96d9db['attributes']=_[_0x59f7('0x32')](_0x1b7cd8[_0x59f7('0x2e')],qs[_0x59f7('0x33')](_0x36ea59[_0x59f7('0x2f')][_0x59f7('0x33')]));_0x96d9db[_0x59f7('0x31')]=_0x96d9db[_0x59f7('0x31')][_0x59f7('0x34')]?_0x96d9db[_0x59f7('0x31')]:_0x1b7cd8['model'];if(_0x36ea59[_0x59f7('0x2f')][_0x59f7('0x3e')]){_0x96d9db[_0x59f7('0x3f')]=[{'all':!![]}];}_0x96d9db=_[_0x59f7('0x3b')]({},_0x96d9db,_0x36ea59[_0x59f7('0x3d')]);return db[_0x59f7('0x29')]['find'](_0x96d9db)[_0x59f7('0x23')](handleEntityNotFound(_0x259e43,null))[_0x59f7('0x23')](respondWithResult(_0x259e43,null))[_0x59f7('0x40')](handleError(_0x259e43,null));};exports[_0x59f7('0x43')]=function(_0x78e34c,_0x489e91){return db[_0x59f7('0x29')][_0x59f7('0x43')](_0x78e34c['body'],{})['then'](respondWithResult(_0x489e91,0xc9))[_0x59f7('0x40')](handleError(_0x489e91,null));};exports[_0x59f7('0x22')]=function(_0x2fff7c,_0x155d0d){if(_0x2fff7c[_0x59f7('0x44')]['id']){delete _0x2fff7c['body']['id'];}return db[_0x59f7('0x29')][_0x59f7('0x45')]({'where':{'id':_0x2fff7c[_0x59f7('0x46')]['id']}})[_0x59f7('0x23')](handleEntityNotFound(_0x155d0d,null))['then'](saveUpdates(_0x2fff7c['body'],null))[_0x59f7('0x23')](respondWithResult(_0x155d0d,null))['catch'](handleError(_0x155d0d,null));};exports['destroy']=function(_0x41ad07,_0x22cf9d){return db[_0x59f7('0x29')]['find']({'where':{'id':_0x41ad07['params']['id']}})[_0x59f7('0x23')](handleEntityNotFound(_0x22cf9d,null))[_0x59f7('0x23')](removeEntity(_0x22cf9d,null))[_0x59f7('0x40')](handleError(_0x22cf9d,null));};exports[_0x59f7('0x47')]=function(_0x109074,_0x5366f5,_0x210fb5){var _0x1c6854={};var _0xfcd9a1={};var _0x40d39a;var _0x5da7cb;return db[_0x59f7('0x29')][_0x59f7('0x48')]({'where':{'id':_0x109074[_0x59f7('0x46')]['id']}})[_0x59f7('0x23')](handleEntityNotFound(_0x5366f5,null))[_0x59f7('0x23')](function(_0x553ed9){if(_0x553ed9){_0x40d39a=_0x553ed9;_0xfcd9a1[_0x59f7('0x2e')]=_['keys'](db[_0x59f7('0x49')][_0x59f7('0x2a')]);_0xfcd9a1[_0x59f7('0x2f')]=_[_0x59f7('0x42')](_0x109074[_0x59f7('0x2f')]);_0xfcd9a1['filters']=_['intersection'](_0xfcd9a1[_0x59f7('0x2e')],_0xfcd9a1[_0x59f7('0x2f')]);_0x1c6854[_0x59f7('0x31')]=_['intersection'](_0xfcd9a1['model'],qs[_0x59f7('0x33')](_0x109074[_0x59f7('0x2f')][_0x59f7('0x33')]));_0x1c6854[_0x59f7('0x31')]=_0x1c6854['attributes'][_0x59f7('0x34')]?_0x1c6854[_0x59f7('0x31')]:_0xfcd9a1[_0x59f7('0x2e')];_0x1c6854[_0x59f7('0x4a')]=qs[_0x59f7('0x37')](_0x109074['query'][_0x59f7('0x37')]);_0x1c6854[_0x59f7('0x38')]=qs[_0x59f7('0x30')](_['pick'](_0x109074[_0x59f7('0x2f')],_0xfcd9a1['filters']));if(_0x109074[_0x59f7('0x2f')][_0x59f7('0x3a')]){_0x1c6854[_0x59f7('0x38')]=_[_0x59f7('0x3b')](_0x1c6854['where'],{'$or':_['map'](_0x1c6854[_0x59f7('0x31')],function(_0x1ebdf4){var _0x150c22={};_0x150c22[_0x1ebdf4]={'$like':'%'+_0x109074[_0x59f7('0x2f')][_0x59f7('0x3a')]+'%'};return _0x150c22;})});}_0x1c6854=_[_0x59f7('0x3b')]({},_0x1c6854,_0x109074[_0x59f7('0x3d')]);return _0x40d39a['getConfigurations'](_0x1c6854);}})[_0x59f7('0x23')](function(_0x5777d9){if(_0x5777d9){_0x5da7cb=_0x5777d9['length'];if(!_0x109074['query']['hasOwnProperty'](_0x59f7('0x36'))){_0x1c6854[_0x59f7('0x1c')]=qs[_0x59f7('0x1c')](_0x109074['query'][_0x59f7('0x1c')]);_0x1c6854['offset']=qs[_0x59f7('0x1a')](_0x109074[_0x59f7('0x2f')][_0x59f7('0x1a')]);}return _0x40d39a[_0x59f7('0x47')](_0x1c6854);}})[_0x59f7('0x23')](function(_0x3a9317){if(_0x3a9317){return _0x3a9317?{'count':_0x5da7cb,'rows':_0x3a9317}:null;}})['then'](respondWithResult(_0x5366f5,null))[_0x59f7('0x40')](handleError(_0x5366f5,null));};exports[_0x59f7('0x4b')]=function(_0x29f09a,_0x2c635b,_0x1d10e6){if(_0x29f09a[_0x59f7('0x44')]['id']){delete _0x29f09a[_0x59f7('0x44')]['id'];}return db[_0x59f7('0x29')][_0x59f7('0x48')]({'where':{'id':_0x29f09a[_0x59f7('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c635b,null))[_0x59f7('0x23')](function(_0x212f8a){if(_0x212f8a){_0x29f09a[_0x59f7('0x44')]['AccountId']=_0x212f8a['id'];_0x29f09a['body'][_0x59f7('0x4c')]=integrations[_0x59f7('0x4d')](_0x29f09a[_0x59f7('0x44')][_0x59f7('0x4e')],_0x29f09a['body'][_0x59f7('0x2c')]);_0x29f09a['body'][_0x59f7('0x4f')]=integrations[_0x59f7('0x50')](_0x29f09a[_0x59f7('0x44')][_0x59f7('0x4e')],_0x29f09a['body'][_0x59f7('0x2c')]);return db['Dynamics365Configuration'][_0x59f7('0x43')](_0x29f09a[_0x59f7('0x44')],{'include':[{'model':db[_0x59f7('0x51')],'as':_0x59f7('0x4c')},{'model':db[_0x59f7('0x51')],'as':_0x59f7('0x4f')}]});}return null;})[_0x59f7('0x23')](respondWithResult(_0x2c635b,null))[_0x59f7('0x40')](handleError(_0x2c635b,null));};exports['getFields']=function(_0x327082,_0xa673bd,_0x242e43){var _0x23e380=_0x327082['query'][_0x59f7('0x52')];var _0x14faa4=_0x23e380==='incident'?_0x59f7('0x53'):_0x59f7('0x54');var _0x7a0f6f='';var _0x1adadd='';var _0xd480fb='';var _0x1443cd='';var _0x3633bf='';var _0x556ef2='';var _0x393ea7='';var _0xe65e20='';var _0x17248a=[_0x59f7('0x55'),_0x59f7('0x56'),_0x59f7('0x57'),_0x59f7('0x58'),_0x59f7('0x59'),_0x59f7('0x5a'),_0x59f7('0x5b'),_0x59f7('0x5c'),_0x59f7('0x5d'),_0x59f7('0x5e')];var _0x50d43f=[_0x59f7('0x5f'),_0x59f7('0x60'),_0x59f7('0x61'),_0x59f7('0x62'),_0x59f7('0x63'),_0x59f7('0x64'),'contractdetailidname',_0x59f7('0x65'),_0x59f7('0x66'),_0x59f7('0x67'),_0x59f7('0x68'),'createdbyyominame',_0x59f7('0x69'),_0x59f7('0x6a'),_0x59f7('0x6b'),_0x59f7('0x6c'),_0x59f7('0x6d'),_0x59f7('0x6e'),_0x59f7('0x6f'),_0x59f7('0x70'),_0x59f7('0x71'),_0x59f7('0x72'),_0x59f7('0x73'),'exchangerate',_0x59f7('0x74'),_0x59f7('0x75'),_0x59f7('0x76'),_0x59f7('0x77'),_0x59f7('0x78'),_0x59f7('0x79'),'masteridname',_0x59f7('0x7a'),_0x59f7('0x7b'),'modifiedbyname',_0x59f7('0x7c'),_0x59f7('0x7d'),_0x59f7('0x7e'),_0x59f7('0x7f'),_0x59f7('0x80'),_0x59f7('0x81'),'numberofchildincidents',_0x59f7('0x82'),'overriddencreatedon',_0x59f7('0x83'),_0x59f7('0x84'),'owneridyominame',_0x59f7('0x85'),'primarycontactidname',_0x59f7('0x86'),_0x59f7('0x87'),_0x59f7('0x88'),_0x59f7('0x89'),_0x59f7('0x8a'),_0x59f7('0x8b'),_0x59f7('0x8c'),_0x59f7('0x8d'),'responsiblecontactidyominame',_0x59f7('0x8e'),_0x59f7('0x8f'),'slaname',_0x59f7('0x90'),'statecode',_0x59f7('0x91'),_0x59f7('0x92'),_0x59f7('0x93'),_0x59f7('0x94'),_0x59f7('0x95'),_0x59f7('0x96'),_0x59f7('0x97'),_0x59f7('0x98')];var _0x35b8eb=_0x17248a[_0x59f7('0x99')](_0x50d43f);return db[_0x59f7('0x29')][_0x59f7('0x48')]({'where':{'id':_0x327082['params']['id']},'attributes':['id','username',_0x59f7('0x9a'),_0x59f7('0x9b'),_0x59f7('0x9c'),'clientId',_0x59f7('0x9d')]})['then'](handleEntityNotFound(_0xa673bd,null))['then'](function(_0x35f9ba){if(_0x35f9ba){_0xe65e20=_0x35f9ba[_0x59f7('0x9b')];var _0x468640=_0xe65e20['slice'](-0x1);if(_0x468640==='/'){_0xe65e20=_0xe65e20[_0x59f7('0x9e')](0x0,_0xe65e20[_0x59f7('0x9f')](_0x468640));}_0x393ea7=util[_0x59f7('0xa0')](_0x59f7('0xa1'),_0xe65e20);var _0x23a1a1={'method':_0x59f7('0xa2'),'uri':'https://login.microsoftonline.com/'+_0x35f9ba[_0x59f7('0x9c')]+'/oauth2/token','form':{'client_id':_0x35f9ba[_0x59f7('0xa3')],'resource':_0xe65e20,'username':_0x35f9ba['username'],'password':_0x35f9ba[_0x59f7('0x9a')],'grant_type':'password','client_secret':_0x35f9ba[_0x59f7('0x9d')]},'json':!![]};return rp(_0x23a1a1);}})['then'](function(_0x3851d1){_0x556ef2=_0x3851d1['access_token'];var _0x512b41={'method':_0x59f7('0xa4'),'uri':encodeURI(_0x393ea7+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x14faa4+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x556ef2,'If-None-Match':null,'OData-Version':_0x59f7('0xa5')},'json':!![]};return rp(_0x512b41);})[_0x59f7('0x23')](function(_0x2329dc){var _0x343f8e=_0x2329dc[_0x59f7('0xa6')][0x0];var _0x57bf1b=_0x343f8e[_0x59f7('0xa7')];var _0x543dd2={'method':_0x59f7('0xa4'),'uri':_0x393ea7+_0x59f7('0xa8')+_0x57bf1b+_0x59f7('0xa9'),'headers':{'Authorization':_0x59f7('0xaa')+_0x556ef2,'If-None-Match':null,'OData-Version':_0x59f7('0xa5')},'json':!![]};return rp(_0x543dd2);})[_0x59f7('0x23')](function(_0x41e7f9){_0x7a0f6f=_0x41e7f9;_0x1adadd=_0x7a0f6f['Attributes'];_0x1adadd=_[_0x59f7('0xab')](_0x1adadd,function(_0x31bb14){return!_0x35b8eb['includes'](_0x31bb14[_0x59f7('0xac')]);});var _0x170c60=[];var _0x469ad8=[];_0x1adadd[_0x59f7('0xad')](function(_0x359a61){if(_0x359a61[_0x59f7('0xae')]){var _0x3351df=_0x359a61[_0x59f7('0xae')]['substring'](_0x359a61[_0x59f7('0xae')][_0x59f7('0x9f')]('.')+0x1);if(_0x3351df===_0x59f7('0xaf')){_0x170c60[_0x59f7('0xb0')](getSelectList(_0x393ea7,_0x23e380,_0x469ad8,_0x7a0f6f[_0x59f7('0xa7')],_0x359a61[_0x59f7('0xa7')],_0x556ef2));}}});return Promise[_0x59f7('0xb1')](_0x170c60);})[_0x59f7('0x23')](function(_0x5d61e5){_0xd480fb=_0x5d61e5[0x0];var _0x263b5b=[];var _0x1a4f7b=[];_0x1adadd[_0x59f7('0xad')](function(_0x35e3e1){if(!_['isNil'](_0x35e3e1[_0x59f7('0xae')])){var _0x2c2af2=_0x35e3e1[_0x59f7('0xae')][_0x59f7('0x9e')](_0x35e3e1[_0x59f7('0xae')]['lastIndexOf']('.')+0x1);if(_0x2c2af2==='BooleanAttributeMetadata'){_0x263b5b[_0x59f7('0xb0')](getBooleanList(_0x393ea7,_0x23e380,_0x1a4f7b,_0x7a0f6f[_0x59f7('0xa7')],_0x35e3e1[_0x59f7('0xa7')],_0x556ef2));}}});return Promise[_0x59f7('0xb1')](_0x263b5b);})[_0x59f7('0x23')](function(_0xe15448){_0x1443cd=_0xe15448[0x0];var _0xf58ffa=[];var _0x1ca10b=[];_0x1adadd[_0x59f7('0xad')](function(_0x70c8e6){if(_0x70c8e6[_0x59f7('0xae')]){var _0x23ed55=_0x70c8e6[_0x59f7('0xae')][_0x59f7('0x9e')](_0x70c8e6[_0x59f7('0xae')]['lastIndexOf']('.')+0x1);if(_0x23ed55==='StringAttributeMetadata'||_0x23ed55==='DoubleAttributeMetadata'||_0x23ed55===_0x59f7('0xb2')||_0x23ed55==='IntegerAttributeMetadata'||_0x23ed55===_0x59f7('0xb3')||_0x23ed55===_0x59f7('0xb4')||_0x23ed55===_0x59f7('0xb5')||_0x23ed55===_0x59f7('0xb6')||_0x23ed55===_0x59f7('0xb7')||_0x23ed55===_0x59f7('0xb8')){_0xf58ffa[_0x59f7('0xb0')](getInputList(_0x393ea7,_0x23e380,_0x23ed55,_0x1ca10b,_0x7a0f6f['MetadataId'],_0x70c8e6['MetadataId'],_0x556ef2));}}});return Promise[_0x59f7('0xb1')](_0xf58ffa);})['then'](function(_0x80d121){_0x3633bf=_0x80d121[0x0];var _0x8d6521=_0xd480fb[_0x59f7('0x99')](_0x1443cd)['concat'](_0x3633bf);var _0xc858e5={'count':_0x8d6521[_0x59f7('0x34')],'rows':_0x8d6521};return _0xc858e5;})['then'](respondWithResult(_0xa673bd,null))[_0x59f7('0x40')](function(_0x4781dc){var _0x57634a=_0x327082['query'][_0x59f7('0xb9')]?0x1f4:_0x4781dc[_0x59f7('0xba')]||0x1f4;logger['error'](_0x4781dc[_0x59f7('0x25')]);delete _0x4781dc[_0x59f7('0x26')];if(_0x57634a===0x191){_0x57634a=0x190;}_0xa673bd['status'](_0x57634a)['send'](_0x327082[_0x59f7('0x2f')][_0x59f7('0xb9')]?{'message':'Wrong\x20credentials','statusCode':_0x4781dc['statusCode']}:_0x4781dc);});};function getSelectList(_0x14ac28,_0x2aa95d,_0x22c2da,_0xb15ab,_0x528ac8,_0x58df20){var _0x2b49f5={'method':_0x59f7('0xa4'),'uri':_0x14ac28+_0x59f7('0xa8')+_0xb15ab+_0x59f7('0xbb')+_0x528ac8+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x59f7('0xbc'),'headers':{'Authorization':_0x59f7('0xaa')+_0x58df20,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2b49f5)[_0x59f7('0x23')](function(_0x2c4b15){var _0x4542b7=[];var _0x523fe0=_0x2c4b15[_0x59f7('0xbd')][_0x59f7('0xbe')];_0x523fe0[_0x59f7('0xad')](function(_0x4e7cb9){_0x4542b7[_0x59f7('0xb0')]({'name':_0x4e7cb9[_0x59f7('0xbf')][_0x59f7('0xc0')][_0x59f7('0xbf')],'value':String(_0x4e7cb9[_0x59f7('0xc1')])});});var _0x2a1155={'id':_0x2aa95d+'_'+_0x2c4b15['LogicalName'],'name':_0x2c4b15[_0x59f7('0xc2')][_0x59f7('0xc0')][_0x59f7('0xbf')],'custom':![],'options':_0x4542b7};_0x22c2da['push'](_0x2a1155);return _0x22c2da;});}function getBooleanList(_0x15a17a,_0x4d564f,_0x5d929b,_0x11b987,_0x1db166,_0x368893){var _0xe5b29d={'method':_0x59f7('0xa4'),'uri':_0x15a17a+'EntityDefinitions('+_0x11b987+_0x59f7('0xbb')+_0x1db166+_0x59f7('0xc3'),'headers':{'Authorization':_0x59f7('0xaa')+_0x368893,'If-None-Match':null,'OData-Version':_0x59f7('0xa5')},'json':!![]};return rp(_0xe5b29d)[_0x59f7('0x23')](function(_0x39f5e2){var _0x27ccc8=[];_0x27ccc8[_0x59f7('0xb0')]({'name':_0x39f5e2[_0x59f7('0xbd')][_0x59f7('0xc4')][_0x59f7('0xbf')][_0x59f7('0xc0')][_0x59f7('0xbf')],'value':_0x59f7('0xc5')},{'name':_0x39f5e2[_0x59f7('0xbd')]['FalseOption'][_0x59f7('0xbf')][_0x59f7('0xc0')][_0x59f7('0xbf')],'value':_0x59f7('0xc6')});var _0x2ef2da={'id':_0x4d564f+'_'+_0x39f5e2[_0x59f7('0xac')],'name':_0x39f5e2[_0x59f7('0xc2')][_0x59f7('0xc0')][_0x59f7('0xbf')],'custom':![],'options':_0x27ccc8};_0x5d929b[_0x59f7('0xb0')](_0x2ef2da);return _0x5d929b;});}function getInputList(_0x72648f,_0x221bd5,_0x3fb0ce,_0x4323df,_0x1dc028,_0x1d3edb,_0x3fbc6c){var _0x43fbbc={'method':_0x59f7('0xa4'),'uri':_0x72648f+_0x59f7('0xa8')+_0x1dc028+_0x59f7('0xbb')+_0x1d3edb+_0x59f7('0xc7')+_0x3fb0ce+_0x59f7('0xc8'),'headers':{'Authorization':'Bearer\x20'+_0x3fbc6c,'If-None-Match':null,'OData-Version':_0x59f7('0xa5')},'json':!![]};return rp(_0x43fbbc)[_0x59f7('0x23')](function(_0x5744ea){var _0x598765={'id':_0x221bd5+'_'+_0x5744ea[_0x59f7('0xac')],'name':_0x5744ea[_0x59f7('0xc2')][_0x59f7('0xc0')]?_0x5744ea[_0x59f7('0xc2')][_0x59f7('0xc0')]['Label']:_0x5744ea[_0x59f7('0xac')],'custom':![],'options':[]};_0x4323df[_0x59f7('0xb0')](_0x598765);return _0x4323df;});} \ No newline at end of file +var _0xde50=['options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','update','body','destroy','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','type','Dynamics365Field','ticketType','Incident','title','description','ownerid','caseorigincode','phonenumber','regardingobjectid','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','slainvokedidname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','remoteUri','clientId','slice','format','POST','https://login.microsoftonline.com/','tenantId','password','access_token','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','Label','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter'];(function(_0x4c49c0,_0x4adb76){var _0x596b70=function(_0x292c6b){while(--_0x292c6b){_0x4c49c0['push'](_0x4c49c0['shift']());}};_0x596b70(++_0x4adb76);}(_0xde50,0x140));var _0x0de5=function(_0x101806,_0xe82f07){_0x101806=_0x101806-0x0;var _0x2956d2=_0xde50[_0x101806];return _0x2956d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0de5('0x0'));var jsonpatch=require(_0x0de5('0x1'));var rp=require(_0x0de5('0x2'));var moment=require(_0x0de5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0de5('0x4'));var util=require('util');var path=require(_0x0de5('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0de5('0x6'));var _=require(_0x0de5('0x7'));var squel=require(_0x0de5('0x8'));var crypto=require('crypto');var jsforce=require(_0x0de5('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0de5('0xa'));var Redis=require(_0x0de5('0xb'));var authService=require(_0x0de5('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0de5('0xd'));var hardwareService=require(_0x0de5('0xe'));var logger=require('../../config/logger')(_0x0de5('0xf'));var utils=require(_0x0de5('0x10'));var config=require(_0x0de5('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0de5('0x12'));function respondWithStatusCode(_0x4672f7,_0x3793c6){_0x3793c6=_0x3793c6||0xcc;return function(_0x14bf51){if(_0x14bf51){return _0x4672f7[_0x0de5('0x13')](_0x3793c6);}return _0x4672f7['status'](_0x3793c6)[_0x0de5('0x14')]();};}function respondWithResult(_0x5eaad2,_0x544703){_0x544703=_0x544703||0xc8;return function(_0x2b71cd){if(_0x2b71cd){return _0x5eaad2[_0x0de5('0x15')](_0x544703)[_0x0de5('0x16')](_0x2b71cd);}};}function respondWithFilteredResult(_0x92fe6d,_0x5cbab){return function(_0x2be086){if(_0x2be086){var _0x512fa8=typeof _0x5cbab[_0x0de5('0x17')]===_0x0de5('0x18')&&typeof _0x5cbab[_0x0de5('0x19')]===_0x0de5('0x18');var _0x2e4c22=_0x2be086[_0x0de5('0x1a')];var _0x58ce66=_0x512fa8?0x0:_0x5cbab[_0x0de5('0x17')];var _0x48ba4e=_0x512fa8?_0x2be086[_0x0de5('0x1a')]:_0x5cbab[_0x0de5('0x17')]+_0x5cbab[_0x0de5('0x19')];var _0x325a8;if(_0x48ba4e>=_0x2e4c22){_0x48ba4e=_0x2e4c22;_0x325a8=0xc8;}else{_0x325a8=0xce;}_0x92fe6d['status'](_0x325a8);return _0x92fe6d[_0x0de5('0x1b')]('Content-Range',_0x58ce66+'-'+_0x48ba4e+'/'+_0x2e4c22)[_0x0de5('0x16')](_0x2be086);}return null;};}function patchUpdates(_0x30a2c1){return function(_0x3a5284){try{jsonpatch['apply'](_0x3a5284,_0x30a2c1,!![]);}catch(_0x2b7fcb){return BPromise[_0x0de5('0x1c')](_0x2b7fcb);}return _0x3a5284[_0x0de5('0x1d')]();};}function saveUpdates(_0x224745,_0x55cc87){return function(_0x4645f7){if(_0x4645f7){return _0x4645f7['update'](_0x224745)[_0x0de5('0x1e')](function(_0xf979a0){return _0xf979a0;});}return null;};}function removeEntity(_0x3bf543,_0x2bacf4){return function(_0x5bfe1e){if(_0x5bfe1e){return _0x5bfe1e['destroy']()[_0x0de5('0x1e')](function(){_0x3bf543['status'](0xcc)[_0x0de5('0x14')]();});}};}function handleEntityNotFound(_0x4b9d30,_0x2f0f75){return function(_0x2ff48c){if(!_0x2ff48c){_0x4b9d30[_0x0de5('0x13')](0x194);}return _0x2ff48c;};}function handleError(_0x473e1c,_0x3b8981){_0x3b8981=_0x3b8981||0x1f4;return function(_0x4a1eaa){logger[_0x0de5('0x1f')](_0x4a1eaa[_0x0de5('0x20')]);if(_0x4a1eaa[_0x0de5('0x21')]){delete _0x4a1eaa[_0x0de5('0x21')];}_0x473e1c[_0x0de5('0x15')](_0x3b8981)[_0x0de5('0x22')](_0x4a1eaa);};}exports['index']=function(_0x1c26d3,_0x4b52bb){var _0x521026={},_0x2b6853={},_0x56d8a8={'count':0x0,'rows':[]};var _0x5213a6=_[_0x0de5('0x23')](db[_0x0de5('0x24')][_0x0de5('0x25')],function(_0x523b4f){return{'name':_0x523b4f[_0x0de5('0x26')],'type':_0x523b4f['type'][_0x0de5('0x27')]};});_0x2b6853[_0x0de5('0x28')]=_[_0x0de5('0x23')](_0x5213a6,_0x0de5('0x21'));_0x2b6853['query']=_['keys'](_0x1c26d3[_0x0de5('0x29')]);_0x2b6853[_0x0de5('0x2a')]=_[_0x0de5('0x2b')](_0x2b6853[_0x0de5('0x28')],_0x2b6853[_0x0de5('0x29')]);_0x521026['attributes']=_[_0x0de5('0x2b')](_0x2b6853[_0x0de5('0x28')],qs['fields'](_0x1c26d3['query'][_0x0de5('0x2c')]));_0x521026[_0x0de5('0x2d')]=_0x521026[_0x0de5('0x2d')][_0x0de5('0x2e')]?_0x521026[_0x0de5('0x2d')]:_0x2b6853[_0x0de5('0x28')];if(!_0x1c26d3[_0x0de5('0x29')]['hasOwnProperty'](_0x0de5('0x2f'))){_0x521026[_0x0de5('0x19')]=qs['limit'](_0x1c26d3[_0x0de5('0x29')][_0x0de5('0x19')]);_0x521026[_0x0de5('0x17')]=qs[_0x0de5('0x17')](_0x1c26d3[_0x0de5('0x29')][_0x0de5('0x17')]);}_0x521026[_0x0de5('0x30')]=qs[_0x0de5('0x31')](_0x1c26d3['query'][_0x0de5('0x31')]);_0x521026['where']=qs[_0x0de5('0x2a')](_['pick'](_0x1c26d3[_0x0de5('0x29')],_0x2b6853[_0x0de5('0x2a')]),_0x5213a6);if(_0x1c26d3[_0x0de5('0x29')]['filter']){_0x521026[_0x0de5('0x32')]=_[_0x0de5('0x33')](_0x521026[_0x0de5('0x32')],{'$or':_[_0x0de5('0x23')](_0x5213a6,function(_0x44582c){if(_0x44582c['type']!==_0x0de5('0x34')){var _0x53366b={};_0x53366b[_0x44582c['name']]={'$like':'%'+_0x1c26d3['query'][_0x0de5('0x35')]+'%'};return _0x53366b;}})});}_0x521026=_[_0x0de5('0x33')]({},_0x521026,_0x1c26d3[_0x0de5('0x36')]);var _0x111b2={'where':_0x521026[_0x0de5('0x32')]};return db['Dynamics365Account']['count'](_0x111b2)[_0x0de5('0x1e')](function(_0x1a67d1){_0x56d8a8[_0x0de5('0x1a')]=_0x1a67d1;if(_0x1c26d3[_0x0de5('0x29')][_0x0de5('0x37')]){_0x521026['include']=[{'all':!![]}];}return db[_0x0de5('0x24')][_0x0de5('0x38')](_0x521026);})[_0x0de5('0x1e')](function(_0x58a3d0){_0x56d8a8[_0x0de5('0x39')]=_0x58a3d0;return _0x56d8a8;})[_0x0de5('0x1e')](respondWithFilteredResult(_0x4b52bb,_0x521026))[_0x0de5('0x3a')](handleError(_0x4b52bb,null));};exports[_0x0de5('0x3b')]=function(_0x35c23d,_0x2e73b4){var _0x1b0923={'raw':![],'where':{'id':_0x35c23d[_0x0de5('0x3c')]['id']}},_0x3ef5b2={};_0x3ef5b2['model']=_[_0x0de5('0x3d')](db[_0x0de5('0x24')][_0x0de5('0x25')]);_0x3ef5b2['query']=_['keys'](_0x35c23d['query']);_0x3ef5b2[_0x0de5('0x2a')]=_[_0x0de5('0x2b')](_0x3ef5b2['model'],_0x3ef5b2[_0x0de5('0x29')]);_0x1b0923[_0x0de5('0x2d')]=_[_0x0de5('0x2b')](_0x3ef5b2['model'],qs[_0x0de5('0x2c')](_0x35c23d[_0x0de5('0x29')][_0x0de5('0x2c')]));_0x1b0923[_0x0de5('0x2d')]=_0x1b0923[_0x0de5('0x2d')][_0x0de5('0x2e')]?_0x1b0923[_0x0de5('0x2d')]:_0x3ef5b2[_0x0de5('0x28')];if(_0x35c23d[_0x0de5('0x29')][_0x0de5('0x37')]){_0x1b0923[_0x0de5('0x3e')]=[{'all':!![]}];}_0x1b0923=_[_0x0de5('0x33')]({},_0x1b0923,_0x35c23d[_0x0de5('0x36')]);return db[_0x0de5('0x24')][_0x0de5('0x3f')](_0x1b0923)[_0x0de5('0x1e')](handleEntityNotFound(_0x2e73b4,null))[_0x0de5('0x1e')](respondWithResult(_0x2e73b4,null))[_0x0de5('0x3a')](handleError(_0x2e73b4,null));};exports[_0x0de5('0x40')]=function(_0x552271,_0x5ab0c2){return db[_0x0de5('0x24')][_0x0de5('0x40')](_0x552271['body'],{})[_0x0de5('0x1e')](respondWithResult(_0x5ab0c2,0xc9))['catch'](handleError(_0x5ab0c2,null));};exports[_0x0de5('0x41')]=function(_0x4fbd4d,_0x271fd5){if(_0x4fbd4d[_0x0de5('0x42')]['id']){delete _0x4fbd4d['body']['id'];}return db[_0x0de5('0x24')]['find']({'where':{'id':_0x4fbd4d[_0x0de5('0x3c')]['id']}})[_0x0de5('0x1e')](handleEntityNotFound(_0x271fd5,null))['then'](saveUpdates(_0x4fbd4d[_0x0de5('0x42')],null))['then'](respondWithResult(_0x271fd5,null))[_0x0de5('0x3a')](handleError(_0x271fd5,null));};exports[_0x0de5('0x43')]=function(_0x351184,_0x3ca2ad){return db[_0x0de5('0x24')][_0x0de5('0x3f')]({'where':{'id':_0x351184['params']['id']}})['then'](handleEntityNotFound(_0x3ca2ad,null))[_0x0de5('0x1e')](removeEntity(_0x3ca2ad,null))['catch'](handleError(_0x3ca2ad,null));};exports[_0x0de5('0x44')]=function(_0x23fdfd,_0x3f2713,_0x754736){var _0x1abeef={};var _0x4a532c={};var _0x2c70fc;var _0x2ffc7e;return db['Dynamics365Account'][_0x0de5('0x45')]({'where':{'id':_0x23fdfd['params']['id']}})[_0x0de5('0x1e')](handleEntityNotFound(_0x3f2713,null))[_0x0de5('0x1e')](function(_0x3e79f4){if(_0x3e79f4){_0x2c70fc=_0x3e79f4;_0x4a532c[_0x0de5('0x28')]=_[_0x0de5('0x3d')](db[_0x0de5('0x46')][_0x0de5('0x25')]);_0x4a532c['query']=_[_0x0de5('0x3d')](_0x23fdfd[_0x0de5('0x29')]);_0x4a532c[_0x0de5('0x2a')]=_[_0x0de5('0x2b')](_0x4a532c[_0x0de5('0x28')],_0x4a532c[_0x0de5('0x29')]);_0x1abeef['attributes']=_[_0x0de5('0x2b')](_0x4a532c[_0x0de5('0x28')],qs[_0x0de5('0x2c')](_0x23fdfd[_0x0de5('0x29')][_0x0de5('0x2c')]));_0x1abeef[_0x0de5('0x2d')]=_0x1abeef[_0x0de5('0x2d')][_0x0de5('0x2e')]?_0x1abeef[_0x0de5('0x2d')]:_0x4a532c[_0x0de5('0x28')];_0x1abeef['order']=qs['sort'](_0x23fdfd[_0x0de5('0x29')][_0x0de5('0x31')]);_0x1abeef[_0x0de5('0x32')]=qs[_0x0de5('0x2a')](_['pick'](_0x23fdfd['query'],_0x4a532c['filters']));if(_0x23fdfd[_0x0de5('0x29')][_0x0de5('0x35')]){_0x1abeef[_0x0de5('0x32')]=_[_0x0de5('0x33')](_0x1abeef['where'],{'$or':_['map'](_0x1abeef[_0x0de5('0x2d')],function(_0x432e46){var _0x45919f={};_0x45919f[_0x432e46]={'$like':'%'+_0x23fdfd[_0x0de5('0x29')][_0x0de5('0x35')]+'%'};return _0x45919f;})});}_0x1abeef=_[_0x0de5('0x33')]({},_0x1abeef,_0x23fdfd[_0x0de5('0x36')]);return _0x2c70fc[_0x0de5('0x44')](_0x1abeef);}})[_0x0de5('0x1e')](function(_0x33b235){if(_0x33b235){_0x2ffc7e=_0x33b235[_0x0de5('0x2e')];if(!_0x23fdfd[_0x0de5('0x29')][_0x0de5('0x47')](_0x0de5('0x2f'))){_0x1abeef[_0x0de5('0x19')]=qs[_0x0de5('0x19')](_0x23fdfd[_0x0de5('0x29')]['limit']);_0x1abeef['offset']=qs['offset'](_0x23fdfd[_0x0de5('0x29')][_0x0de5('0x17')]);}return _0x2c70fc[_0x0de5('0x44')](_0x1abeef);}})[_0x0de5('0x1e')](function(_0x1d973a){if(_0x1d973a){return _0x1d973a?{'count':_0x2ffc7e,'rows':_0x1d973a}:null;}})['then'](respondWithResult(_0x3f2713,null))[_0x0de5('0x3a')](handleError(_0x3f2713,null));};exports[_0x0de5('0x48')]=function(_0x385f4e,_0x24ccb7,_0x6e8aad){if(_0x385f4e[_0x0de5('0x42')]['id']){delete _0x385f4e['body']['id'];}return db[_0x0de5('0x24')][_0x0de5('0x45')]({'where':{'id':_0x385f4e[_0x0de5('0x3c')]['id']}})[_0x0de5('0x1e')](handleEntityNotFound(_0x24ccb7,null))['then'](function(_0x5c1475){if(_0x5c1475){_0x385f4e[_0x0de5('0x42')]['AccountId']=_0x5c1475['id'];_0x385f4e['body'][_0x0de5('0x49')]=integrations[_0x0de5('0x4a')](_0x385f4e[_0x0de5('0x42')]['channel'],_0x385f4e[_0x0de5('0x42')]['type']);_0x385f4e['body'][_0x0de5('0x4b')]=integrations[_0x0de5('0x4c')](_0x385f4e[_0x0de5('0x42')][_0x0de5('0x4d')],_0x385f4e['body'][_0x0de5('0x4e')]);return db[_0x0de5('0x46')]['create'](_0x385f4e['body'],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x0de5('0x4f')],'as':_0x0de5('0x4b')}]});}return null;})[_0x0de5('0x1e')](respondWithResult(_0x24ccb7,null))[_0x0de5('0x3a')](handleError(_0x24ccb7,null));};exports['getFields']=function(_0x167b63,_0x1529b6,_0x398130){var _0x1b3bcd=_0x167b63[_0x0de5('0x29')][_0x0de5('0x50')];var _0x6371f3=_0x1b3bcd==='incident'?_0x0de5('0x51'):'PhoneCall';var _0x3991ed='';var _0x4b8f3c='';var _0x2691e1='';var _0x55b080='';var _0x228d74='';var _0x345907='';var _0x4f7eaa='';var _0x69cdc6='';var _0x6ed5c4=[_0x0de5('0x52'),_0x0de5('0x53'),'customerid',_0x0de5('0x54'),_0x0de5('0x55'),'subject',_0x0de5('0x56'),_0x0de5('0x57'),'directioncode','phonecall_activity_parties'];var _0x285df1=[_0x0de5('0x58'),'accountidyominame',_0x0de5('0x59'),_0x0de5('0x5a'),_0x0de5('0x5b'),_0x0de5('0x5c'),_0x0de5('0x5d'),'contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame',_0x0de5('0x5e'),_0x0de5('0x5f'),_0x0de5('0x60'),_0x0de5('0x61'),'createdonbehalfbyyominame',_0x0de5('0x62'),'customeridtype',_0x0de5('0x63'),_0x0de5('0x64'),_0x0de5('0x65'),_0x0de5('0x66'),'entityimage_url',_0x0de5('0x67'),_0x0de5('0x68'),_0x0de5('0x69'),'followupby',_0x0de5('0x6a'),'influencescore',_0x0de5('0x6b'),_0x0de5('0x6c'),_0x0de5('0x6d'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x0de5('0x6e'),_0x0de5('0x6f'),'modifiedon',_0x0de5('0x70'),_0x0de5('0x71'),'msdyn_incidenttypename','msdyn_iotalertname',_0x0de5('0x72'),_0x0de5('0x73'),_0x0de5('0x74'),_0x0de5('0x75'),_0x0de5('0x76'),_0x0de5('0x77'),'parentcaseidname',_0x0de5('0x78'),_0x0de5('0x79'),_0x0de5('0x7a'),_0x0de5('0x7b'),_0x0de5('0x7c'),_0x0de5('0x7d'),'resolvebykpiidname',_0x0de5('0x7e'),'responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x0de5('0x7f'),'slaname',_0x0de5('0x80'),_0x0de5('0x81'),_0x0de5('0x82'),'subjectidname',_0x0de5('0x83'),_0x0de5('0x84'),_0x0de5('0x85'),_0x0de5('0x86'),_0x0de5('0x87'),_0x0de5('0x88')];var _0x181ba5=_0x6ed5c4[_0x0de5('0x89')](_0x285df1);return db[_0x0de5('0x24')]['findOne']({'where':{'id':_0x167b63['params']['id']},'attributes':['id','username','password',_0x0de5('0x8a'),'tenantId',_0x0de5('0x8b'),'clientSecret']})[_0x0de5('0x1e')](handleEntityNotFound(_0x1529b6,null))[_0x0de5('0x1e')](function(_0x4be816){if(_0x4be816){_0x69cdc6=_0x4be816['remoteUri'];var _0x23d4f4=_0x69cdc6[_0x0de5('0x8c')](-0x1);if(_0x23d4f4==='/'){_0x69cdc6=_0x69cdc6['substring'](0x0,_0x69cdc6['lastIndexOf'](_0x23d4f4));}_0x4f7eaa=util[_0x0de5('0x8d')]('%s/api/data/v9.0/',_0x69cdc6);var _0xaed5d7={'method':_0x0de5('0x8e'),'uri':_0x0de5('0x8f')+_0x4be816[_0x0de5('0x90')]+'/oauth2/token','form':{'client_id':_0x4be816['clientId'],'resource':_0x69cdc6,'username':_0x4be816['username'],'password':_0x4be816['password'],'grant_type':_0x0de5('0x91'),'client_secret':_0x4be816['clientSecret']},'json':!![]};return rp(_0xaed5d7);}})['then'](function(_0x3cdb67){_0x345907=_0x3cdb67[_0x0de5('0x92')];var _0x1d4e0f={'method':'GET','uri':encodeURI(_0x4f7eaa+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x6371f3+'\x27'),'headers':{'Authorization':_0x0de5('0x93')+_0x345907,'If-None-Match':null,'OData-Version':_0x0de5('0x94')},'json':!![]};return rp(_0x1d4e0f);})[_0x0de5('0x1e')](function(_0x17c7e9){var _0x277d22=_0x17c7e9['value'][0x0];var _0x4d32d6=_0x277d22[_0x0de5('0x95')];var _0x5d4d34={'method':_0x0de5('0x96'),'uri':_0x4f7eaa+_0x0de5('0x97')+_0x4d32d6+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x345907,'If-None-Match':null,'OData-Version':_0x0de5('0x94')},'json':!![]};return rp(_0x5d4d34);})[_0x0de5('0x1e')](function(_0x580240){_0x3991ed=_0x580240;_0x4b8f3c=_0x3991ed[_0x0de5('0x98')];_0x4b8f3c=_[_0x0de5('0x99')](_0x4b8f3c,function(_0xe60d6d){return!_0x181ba5['includes'](_0xe60d6d[_0x0de5('0x9a')]);});var _0x21fe67=[];var _0x2a2d27=[];_0x4b8f3c[_0x0de5('0x9b')](function(_0x475a34){if(_0x475a34[_0x0de5('0x9c')]){var _0x5a7669=_0x475a34['@odata.type'][_0x0de5('0x9d')](_0x475a34[_0x0de5('0x9c')][_0x0de5('0x9e')]('.')+0x1);if(_0x5a7669===_0x0de5('0x9f')){_0x21fe67[_0x0de5('0xa0')](getSelectList(_0x4f7eaa,_0x1b3bcd,_0x2a2d27,_0x3991ed[_0x0de5('0x95')],_0x475a34[_0x0de5('0x95')],_0x345907));}}});return Promise[_0x0de5('0xa1')](_0x21fe67);})[_0x0de5('0x1e')](function(_0x2841ff){_0x2691e1=_0x2841ff[0x0];var _0x1a7f29=[];var _0x302a25=[];_0x4b8f3c[_0x0de5('0x9b')](function(_0x340363){if(!_[_0x0de5('0xa2')](_0x340363['@odata.type'])){var _0x5fe7ac=_0x340363[_0x0de5('0x9c')][_0x0de5('0x9d')](_0x340363[_0x0de5('0x9c')][_0x0de5('0x9e')]('.')+0x1);if(_0x5fe7ac===_0x0de5('0xa3')){_0x1a7f29[_0x0de5('0xa0')](getBooleanList(_0x4f7eaa,_0x1b3bcd,_0x302a25,_0x3991ed[_0x0de5('0x95')],_0x340363[_0x0de5('0x95')],_0x345907));}}});return Promise[_0x0de5('0xa1')](_0x1a7f29);})[_0x0de5('0x1e')](function(_0x294b6b){_0x55b080=_0x294b6b[0x0];var _0x65b771=[];var _0x2cf670=[];_0x4b8f3c[_0x0de5('0x9b')](function(_0x1babad){if(_0x1babad[_0x0de5('0x9c')]){var _0x132c92=_0x1babad['@odata.type'][_0x0de5('0x9d')](_0x1babad[_0x0de5('0x9c')][_0x0de5('0x9e')]('.')+0x1);if(_0x132c92===_0x0de5('0xa4')||_0x132c92===_0x0de5('0xa5')||_0x132c92===_0x0de5('0xa6')||_0x132c92===_0x0de5('0xa7')||_0x132c92===_0x0de5('0xa8')||_0x132c92===_0x0de5('0xa9')||_0x132c92==='StatusAttributeMetadata'||_0x132c92===_0x0de5('0xaa')||_0x132c92===_0x0de5('0xab')||_0x132c92===_0x0de5('0xac')){_0x65b771[_0x0de5('0xa0')](getInputList(_0x4f7eaa,_0x1b3bcd,_0x132c92,_0x2cf670,_0x3991ed[_0x0de5('0x95')],_0x1babad['MetadataId'],_0x345907));}}});return Promise[_0x0de5('0xa1')](_0x65b771);})['then'](function(_0x4a64fc){_0x228d74=_0x4a64fc[0x0];var _0x1bbdfc=_0x2691e1[_0x0de5('0x89')](_0x55b080)[_0x0de5('0x89')](_0x228d74);var _0xac858={'count':_0x1bbdfc[_0x0de5('0x2e')],'rows':_0x1bbdfc};return _0xac858;})[_0x0de5('0x1e')](respondWithResult(_0x1529b6,null))['catch'](function(_0x188391){var _0xd63a75=_0x167b63[_0x0de5('0x29')]['test']?0x1f4:_0x188391['statusCode']||0x1f4;logger[_0x0de5('0x1f')](_0x188391[_0x0de5('0x20')]);delete _0x188391[_0x0de5('0x21')];if(_0xd63a75===0x191){_0xd63a75=0x190;}_0x1529b6[_0x0de5('0x15')](_0xd63a75)[_0x0de5('0x22')](_0x167b63[_0x0de5('0x29')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x188391['statusCode']}:_0x188391);});};function getSelectList(_0x161378,_0xa4e7ec,_0x5697d9,_0xf29c92,_0x346da8,_0x52058f){var _0x4f32ea={'method':_0x0de5('0x96'),'uri':_0x161378+_0x0de5('0x97')+_0xf29c92+_0x0de5('0xad')+_0x346da8+_0x0de5('0xae')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x0de5('0x93')+_0x52058f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4f32ea)[_0x0de5('0x1e')](function(_0x775087){var _0xb862cd=[];var _0x2c1ee9=_0x775087[_0x0de5('0xaf')][_0x0de5('0xb0')];_0x2c1ee9[_0x0de5('0x9b')](function(_0x3a2ef0){_0xb862cd[_0x0de5('0xa0')]({'name':_0x3a2ef0['Label'][_0x0de5('0xb1')]['Label'],'value':String(_0x3a2ef0[_0x0de5('0xb2')])});});var _0x18af8d={'id':_0xa4e7ec+'_'+_0x775087[_0x0de5('0x9a')],'name':_0x775087[_0x0de5('0xb3')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0xb862cd};_0x5697d9[_0x0de5('0xa0')](_0x18af8d);return _0x5697d9;});}function getBooleanList(_0xc68b07,_0xbb0573,_0x5ae872,_0x204e38,_0x5b4fde,_0x36b408){var _0x519449={'method':_0x0de5('0x96'),'uri':_0xc68b07+_0x0de5('0x97')+_0x204e38+_0x0de5('0xad')+_0x5b4fde+_0x0de5('0xb4'),'headers':{'Authorization':_0x0de5('0x93')+_0x36b408,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x519449)[_0x0de5('0x1e')](function(_0x1519c1){var _0x6a0bc4=[];_0x6a0bc4[_0x0de5('0xa0')]({'name':_0x1519c1['OptionSet'][_0x0de5('0xb5')][_0x0de5('0xb6')][_0x0de5('0xb1')][_0x0de5('0xb6')],'value':_0x0de5('0xb7')},{'name':_0x1519c1[_0x0de5('0xaf')]['FalseOption'][_0x0de5('0xb6')]['UserLocalizedLabel'][_0x0de5('0xb6')],'value':_0x0de5('0xb8')});var _0x27f8b5={'id':_0xbb0573+'_'+_0x1519c1['LogicalName'],'name':_0x1519c1[_0x0de5('0xb3')][_0x0de5('0xb1')][_0x0de5('0xb6')],'custom':![],'options':_0x6a0bc4};_0x5ae872[_0x0de5('0xa0')](_0x27f8b5);return _0x5ae872;});}function getInputList(_0x266c76,_0x3e6837,_0x58f6be,_0x16f0b1,_0x143499,_0x3b89b0,_0x1959cb){var _0xa5e24f={'method':'GET','uri':_0x266c76+'EntityDefinitions('+_0x143499+_0x0de5('0xad')+_0x3b89b0+_0x0de5('0xb9')+_0x58f6be+_0x0de5('0xba'),'headers':{'Authorization':'Bearer\x20'+_0x1959cb,'If-None-Match':null,'OData-Version':_0x0de5('0x94')},'json':!![]};return rp(_0xa5e24f)['then'](function(_0x4e8d93){var _0x5a0a0e={'id':_0x3e6837+'_'+_0x4e8d93['LogicalName'],'name':_0x4e8d93[_0x0de5('0xb3')][_0x0de5('0xb1')]?_0x4e8d93['DisplayName']['UserLocalizedLabel']['Label']:_0x4e8d93[_0x0de5('0x9a')],'custom':![],'options':[]};_0x16f0b1['push'](_0x5a0a0e);return _0x16f0b1;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 5980f9b..2b1db62 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(_0x4670d1,_0x1e8df6){var _0xfc0f0c=function(_0x6bc458){while(--_0x6bc458){_0x4670d1['push'](_0x4670d1['shift']());}};_0xfc0f0c(++_0x1e8df6);}(_0xe706,0xa3));var _0x6e70=function(_0x496cdc,_0x9d6db3){_0x496cdc=_0x496cdc-0x0;var _0x103a8e=_0xe706[_0x496cdc];return _0x103a8e;};'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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x14251b,_0x516707){var _0x39001c=function(_0x43bb87){while(--_0x43bb87){_0x14251b['push'](_0x14251b['shift']());}};_0x39001c(++_0x516707);}(_0x757a,0xde));var _0xa757=function(_0x272104,_0x1e627e){_0x272104=_0x272104-0x0;var _0x573d68=_0x757a[_0x272104];return _0x573d68;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'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 fafbf40..c43dff6 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 _0x093f=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetDynamics365Account','Dynamics365Account','raw','options','limit','include','map','attributes','model','stringify','ShowDynamics365Account','catch','lodash'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x093f,0x7b));var _0xf093=function(_0x594b31,_0x6e42e0){_0x594b31=_0x594b31-0x0;var _0x55d881=_0x093f[_0x594b31];return _0x55d881;};'use strict';var _=require(_0xf093('0x0'));var util=require('util');var moment=require(_0xf093('0x1'));var BPromise=require(_0xf093('0x2'));var rs=require(_0xf093('0x3'));var fs=require('fs');var Redis=require(_0xf093('0x4'));var db=require(_0xf093('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf093('0x6'));var config=require('../../config/environment');var jayson=require(_0xf093('0x7'));var client=jayson['client'][_0xf093('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x894f91,_0x208e1,_0xe2b4e9){return new BPromise(function(_0x31c2f3,_0x546ba4){return client[_0xf093('0x9')](_0x894f91,_0xe2b4e9)[_0xf093('0xa')](function(_0x5388ce){logger[_0xf093('0xb')](_0xf093('0xc'),_0x208e1,_0xf093('0xd'));logger[_0xf093('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x208e1,_0xf093('0xd'),JSON['stringify'](_0x5388ce));if(_0x5388ce[_0xf093('0xf')]){if(_0x5388ce[_0xf093('0xf')][_0xf093('0x10')]===0x1f4){logger[_0xf093('0xf')](_0xf093('0xc'),_0x208e1,_0x5388ce[_0xf093('0xf')][_0xf093('0x11')]);return _0x546ba4(_0x5388ce['error']['message']);}logger[_0xf093('0xf')](_0xf093('0xc'),_0x208e1,_0x5388ce[_0xf093('0xf')][_0xf093('0x11')]);return _0x31c2f3(_0x5388ce[_0xf093('0xf')][_0xf093('0x11')]);}else{logger[_0xf093('0xb')](_0xf093('0xc'),_0x208e1,_0xf093('0xd'));_0x31c2f3(_0x5388ce[_0xf093('0x12')][_0xf093('0x11')]);}})['catch'](function(_0x4cd878){logger[_0xf093('0xf')](_0xf093('0xc'),_0x208e1,_0x4cd878);_0x546ba4(_0x4cd878);});});}exports[_0xf093('0x13')]=function(_0x268817){var _0x4d0dca=this;return new Promise(function(_0x5336f1,_0x49abea){return db[_0xf093('0x14')]['findAll']({'raw':_0x268817['options']?_0x268817['options'][_0xf093('0x15')]===undefined?!![]:![]:!![],'where':_0x268817[_0xf093('0x16')]?_0x268817['options']['where']||null:null,'attributes':_0x268817[_0xf093('0x16')]?_0x268817['options']['attributes']||null:null,'limit':_0x268817['options']?_0x268817[_0xf093('0x16')][_0xf093('0x17')]||null:null,'include':_0x268817[_0xf093('0x16')]?_0x268817[_0xf093('0x16')][_0xf093('0x18')]?_[_0xf093('0x19')](_0x268817[_0xf093('0x16')][_0xf093('0x18')],function(_0x278031){return{'model':db[_0x278031['model']],'as':_0x278031['as'],'attributes':_0x278031['attributes'],'include':_0x278031[_0xf093('0x18')]?_['map'](_0x278031['include'],function(_0x252b78){return{'model':db[_0x252b78['model']],'as':_0x252b78['as'],'attributes':_0x252b78[_0xf093('0x1a')],'include':_0x252b78[_0xf093('0x18')]?_[_0xf093('0x19')](_0x252b78[_0xf093('0x18')],function(_0x46941d){return{'model':db[_0x46941d[_0xf093('0x1b')]],'as':_0x46941d['as'],'attributes':_0x46941d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf093('0xa')](function(_0x4d4c5d){logger[_0xf093('0xb')]('GetDynamics365Account',_0x268817);logger['debug'](_0xf093('0x13'),_0x268817,JSON[_0xf093('0x1c')](_0x4d4c5d));_0x5336f1(_0x4d4c5d);})['catch'](function(_0x41060d){logger[_0xf093('0xf')](_0xf093('0x13'),_0x41060d['message'],_0x268817);_0x49abea(_0x4d0dca[_0xf093('0xf')](0x1f4,_0x41060d[_0xf093('0x11')]));});});};exports[_0xf093('0x1d')]=function(_0x126891){var _0x53dd4b=this;return new Promise(function(_0x16cdad,_0x51d35f){return db[_0xf093('0x14')]['find']({'raw':_0x126891[_0xf093('0x16')]?_0x126891[_0xf093('0x16')][_0xf093('0x15')]===undefined?!![]:![]:!![],'where':_0x126891['options']?_0x126891[_0xf093('0x16')]['where']||null:null,'attributes':_0x126891[_0xf093('0x16')]?_0x126891['options'][_0xf093('0x1a')]||null:null,'include':_0x126891['options']?_0x126891['options'][_0xf093('0x18')]?_[_0xf093('0x19')](_0x126891[_0xf093('0x16')][_0xf093('0x18')],function(_0x39ed52){return{'model':db[_0x39ed52['model']],'as':_0x39ed52['as'],'attributes':_0x39ed52[_0xf093('0x1a')],'include':_0x39ed52[_0xf093('0x18')]?_['map'](_0x39ed52['include'],function(_0x4cd6b6){return{'model':db[_0x4cd6b6[_0xf093('0x1b')]],'as':_0x4cd6b6['as'],'attributes':_0x4cd6b6[_0xf093('0x1a')],'include':_0x4cd6b6[_0xf093('0x18')]?_[_0xf093('0x19')](_0x4cd6b6[_0xf093('0x18')],function(_0x26952b){return{'model':db[_0x26952b[_0xf093('0x1b')]],'as':_0x26952b['as'],'attributes':_0x26952b[_0xf093('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf093('0xa')](function(_0x91acc8){logger[_0xf093('0xb')](_0xf093('0x1d'),_0x126891);logger[_0xf093('0xe')](_0xf093('0x1d'),_0x126891,JSON[_0xf093('0x1c')](_0x91acc8));_0x16cdad(_0x91acc8);})[_0xf093('0x1e')](function(_0x50c741){logger['error'](_0xf093('0x1d'),_0x50c741[_0xf093('0x11')],_0x126891);_0x51d35f(_0x53dd4b[_0xf093('0xf')](0x1f4,_0x50c741[_0xf093('0x11')]));});});}; \ No newline at end of file +var _0xf9e9=['attributes','map','model','include','then','ShowDynamics365Account','find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where'];(function(_0x412482,_0x109124){var _0x42221a=function(_0x1b05d7){while(--_0x1b05d7){_0x412482['push'](_0x412482['shift']());}};_0x42221a(++_0x109124);}(_0xf9e9,0xe7));var _0x9f9e=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0xf9e9[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0x9f9e('0x0'));var util=require(_0x9f9e('0x1'));var moment=require(_0x9f9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f9e('0x3'))['db'];var utils=require(_0x9f9e('0x4'));var logger=require(_0x9f9e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9f9e('0x6'));var client=jayson[_0x9f9e('0x7')][_0x9f9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x504dd4,_0x14d01d,_0x20ea8d){return new BPromise(function(_0x106ba6,_0x1630e9){return client[_0x9f9e('0x9')](_0x504dd4,_0x20ea8d)['then'](function(_0xd7fe35){logger[_0x9f9e('0xa')](_0x9f9e('0xb'),_0x14d01d,_0x9f9e('0xc'));logger[_0x9f9e('0xd')](_0x9f9e('0xe'),_0x14d01d,_0x9f9e('0xc'),JSON[_0x9f9e('0xf')](_0xd7fe35));if(_0xd7fe35['error']){if(_0xd7fe35[_0x9f9e('0x10')]['code']===0x1f4){logger[_0x9f9e('0x10')](_0x9f9e('0xb'),_0x14d01d,_0xd7fe35[_0x9f9e('0x10')][_0x9f9e('0x11')]);return _0x1630e9(_0xd7fe35[_0x9f9e('0x10')][_0x9f9e('0x11')]);}logger[_0x9f9e('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x14d01d,_0xd7fe35[_0x9f9e('0x10')][_0x9f9e('0x11')]);return _0x106ba6(_0xd7fe35[_0x9f9e('0x10')]['message']);}else{logger[_0x9f9e('0xa')](_0x9f9e('0xb'),_0x14d01d,_0x9f9e('0xc'));_0x106ba6(_0xd7fe35['result'][_0x9f9e('0x11')]);}})[_0x9f9e('0x12')](function(_0x10bf22){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x14d01d,_0x10bf22);_0x1630e9(_0x10bf22);});});}exports[_0x9f9e('0x13')]=function(_0x3f86e4){var _0x5386d4=this;return new Promise(function(_0x4bdd4a,_0x234758){return db[_0x9f9e('0x14')][_0x9f9e('0x15')]({'raw':_0x3f86e4[_0x9f9e('0x16')]?_0x3f86e4[_0x9f9e('0x16')][_0x9f9e('0x17')]===undefined?!![]:![]:!![],'where':_0x3f86e4[_0x9f9e('0x16')]?_0x3f86e4['options'][_0x9f9e('0x18')]||null:null,'attributes':_0x3f86e4[_0x9f9e('0x16')]?_0x3f86e4[_0x9f9e('0x16')][_0x9f9e('0x19')]||null:null,'limit':_0x3f86e4[_0x9f9e('0x16')]?_0x3f86e4[_0x9f9e('0x16')]['limit']||null:null,'include':_0x3f86e4[_0x9f9e('0x16')]?_0x3f86e4[_0x9f9e('0x16')]['include']?_[_0x9f9e('0x1a')](_0x3f86e4[_0x9f9e('0x16')]['include'],function(_0x51c793){return{'model':db[_0x51c793[_0x9f9e('0x1b')]],'as':_0x51c793['as'],'attributes':_0x51c793[_0x9f9e('0x19')],'include':_0x51c793[_0x9f9e('0x1c')]?_[_0x9f9e('0x1a')](_0x51c793[_0x9f9e('0x1c')],function(_0x1b4fd8){return{'model':db[_0x1b4fd8['model']],'as':_0x1b4fd8['as'],'attributes':_0x1b4fd8['attributes'],'include':_0x1b4fd8['include']?_[_0x9f9e('0x1a')](_0x1b4fd8['include'],function(_0x38d1af){return{'model':db[_0x38d1af['model']],'as':_0x38d1af['as'],'attributes':_0x38d1af[_0x9f9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9f9e('0x1d')](function(_0x3310dc){logger[_0x9f9e('0xa')](_0x9f9e('0x13'),_0x3f86e4);logger['debug'](_0x9f9e('0x13'),_0x3f86e4,JSON[_0x9f9e('0xf')](_0x3310dc));_0x4bdd4a(_0x3310dc);})['catch'](function(_0x12dc22){logger[_0x9f9e('0x10')](_0x9f9e('0x13'),_0x12dc22[_0x9f9e('0x11')],_0x3f86e4);_0x234758(_0x5386d4['error'](0x1f4,_0x12dc22['message']));});});};exports[_0x9f9e('0x1e')]=function(_0x28f3d5){var _0x3d0082=this;return new Promise(function(_0x193a86,_0x461c12){return db[_0x9f9e('0x14')][_0x9f9e('0x1f')]({'raw':_0x28f3d5[_0x9f9e('0x16')]?_0x28f3d5[_0x9f9e('0x16')][_0x9f9e('0x17')]===undefined?!![]:![]:!![],'where':_0x28f3d5[_0x9f9e('0x16')]?_0x28f3d5[_0x9f9e('0x16')]['where']||null:null,'attributes':_0x28f3d5['options']?_0x28f3d5[_0x9f9e('0x16')][_0x9f9e('0x19')]||null:null,'include':_0x28f3d5[_0x9f9e('0x16')]?_0x28f3d5[_0x9f9e('0x16')]['include']?_[_0x9f9e('0x1a')](_0x28f3d5[_0x9f9e('0x16')][_0x9f9e('0x1c')],function(_0x305f92){return{'model':db[_0x305f92[_0x9f9e('0x1b')]],'as':_0x305f92['as'],'attributes':_0x305f92[_0x9f9e('0x19')],'include':_0x305f92[_0x9f9e('0x1c')]?_['map'](_0x305f92[_0x9f9e('0x1c')],function(_0x3ede61){return{'model':db[_0x3ede61['model']],'as':_0x3ede61['as'],'attributes':_0x3ede61[_0x9f9e('0x19')],'include':_0x3ede61[_0x9f9e('0x1c')]?_[_0x9f9e('0x1a')](_0x3ede61[_0x9f9e('0x1c')],function(_0x123e63){return{'model':db[_0x123e63[_0x9f9e('0x1b')]],'as':_0x123e63['as'],'attributes':_0x123e63[_0x9f9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9b2f){logger[_0x9f9e('0xa')](_0x9f9e('0x1e'),_0x28f3d5);logger[_0x9f9e('0xd')]('ShowDynamics365Account',_0x28f3d5,JSON[_0x9f9e('0xf')](_0x3f9b2f));_0x193a86(_0x3f9b2f);})['catch'](function(_0x17b3e6){logger[_0x9f9e('0x10')](_0x9f9e('0x1e'),_0x17b3e6[_0x9f9e('0x11')],_0x28f3d5);_0x461c12(_0x3d0082[_0x9f9e('0x10')](0x1f4,_0x17b3e6['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9017d9f..46cb9e7 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 _0xa1a4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x24b124,_0x415a49){var _0x444f01=function(_0x240770){while(--_0x240770){_0x24b124['push'](_0x24b124['shift']());}};_0x444f01(++_0x415a49);}(_0xa1a4,0x11f));var _0x4a1a=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa1a4[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x4a1a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a1a('0x1'));var express=require(_0x4a1a('0x2'));var router=express[_0x4a1a('0x3')]();var fs_extra=require(_0x4a1a('0x4'));var auth=require(_0x4a1a('0x5'));var interaction=require(_0x4a1a('0x6'));var config=require(_0x4a1a('0x7'));var controller=require(_0x4a1a('0x8'));router[_0x4a1a('0x9')]('/',auth[_0x4a1a('0xa')](),controller[_0x4a1a('0xb')]);router[_0x4a1a('0x9')]('/:id',auth[_0x4a1a('0xa')](),controller['show']);router[_0x4a1a('0x9')](_0x4a1a('0xc'),auth[_0x4a1a('0xa')](),controller[_0x4a1a('0xd')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x4a1a('0x9')](_0x4a1a('0xe'),auth[_0x4a1a('0xa')](),controller[_0x4a1a('0xf')]);router[_0x4a1a('0x10')]('/',auth['isAuthenticated'](),controller[_0x4a1a('0x11')]);router[_0x4a1a('0x12')](_0x4a1a('0x13'),auth[_0x4a1a('0xa')](),controller[_0x4a1a('0x14')]);router[_0x4a1a('0x15')]('/:id',auth[_0x4a1a('0xa')](),controller[_0x4a1a('0x16')]);module[_0x4a1a('0x17')]=router; \ No newline at end of file +var _0xe027=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','/:id','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete'];(function(_0x512661,_0x4b4012){var _0x1debde=function(_0x1ed401){while(--_0x1ed401){_0x512661['push'](_0x512661['shift']());}};_0x1debde(++_0x4b4012);}(_0xe027,0x106));var _0x7e02=function(_0x3c3187,_0x149b1e){_0x3c3187=_0x3c3187-0x0;var _0x298e38=_0xe027[_0x3c3187];return _0x298e38;};'use strict';var multer=require(_0x7e02('0x0'));var util=require(_0x7e02('0x1'));var path=require(_0x7e02('0x2'));var timeout=require(_0x7e02('0x3'));var express=require(_0x7e02('0x4'));var router=express[_0x7e02('0x5')]();var fs_extra=require(_0x7e02('0x6'));var auth=require(_0x7e02('0x7'));var interaction=require(_0x7e02('0x8'));var config=require(_0x7e02('0x9'));var controller=require(_0x7e02('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x7e02('0xb')]);router['get'](_0x7e02('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7e02('0xd')]('/:id/fields',auth[_0x7e02('0xe')](),controller[_0x7e02('0xf')]);router[_0x7e02('0xd')](_0x7e02('0x10'),auth[_0x7e02('0xe')](),controller[_0x7e02('0x11')]);router['get'](_0x7e02('0x12'),auth['isAuthenticated'](),controller[_0x7e02('0x13')]);router[_0x7e02('0x14')]('/',auth[_0x7e02('0xe')](),controller[_0x7e02('0x15')]);router[_0x7e02('0x16')](_0x7e02('0xc'),auth[_0x7e02('0xe')](),controller['update']);router[_0x7e02('0x17')]('/:id',auth[_0x7e02('0xe')](),controller[_0x7e02('0x18')]);module[_0x7e02('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 948aa98..c9591c0 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 _0x8ed2=['STRING','incident','phonecall','sequelize','exports'];(function(_0xf8a187,_0x123a86){var _0x43fa9e=function(_0x18b92e){while(--_0x18b92e){_0xf8a187['push'](_0xf8a187['shift']());}};_0x43fa9e(++_0x123a86);}(_0x8ed2,0xad));var _0x28ed=function(_0x6d2455,_0x1f2a96){_0x6d2455=_0x6d2455-0x0;var _0x5d30bc=_0x8ed2[_0x6d2455];return _0x5d30bc;};'use strict';var Sequelize=require(_0x28ed('0x0'));module[_0x28ed('0x1')]={'name':{'type':Sequelize[_0x28ed('0x2')]},'description':{'type':Sequelize[_0x28ed('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x28ed('0x3'),_0x28ed('0x4')),'defaultValue':_0x28ed('0x3')}}; \ No newline at end of file +var _0x53c6=['incident','exports','STRING','ENUM','phonecall'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0x53c6,0xc4));var _0x653c=function(_0x27f06a,_0x13942e){_0x27f06a=_0x27f06a-0x0;var _0x5d8672=_0x53c6[_0x27f06a];return _0x5d8672;};'use strict';var Sequelize=require('sequelize');module[_0x653c('0x0')]={'name':{'type':Sequelize[_0x653c('0x1')]},'description':{'type':Sequelize[_0x653c('0x1')]},'ticketType':{'type':Sequelize[_0x653c('0x2')]('incident',_0x653c('0x3')),'defaultValue':_0x653c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 7c389a4..37b0a43 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 _0xff48=['name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','getFields','Dynamics365Field','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack'];(function(_0x2da923,_0x56a642){var _0x3f24b7=function(_0x58f540){while(--_0x58f540){_0x2da923['push'](_0x2da923['shift']());}};_0x3f24b7(++_0x56a642);}(_0xff48,0x11c));var _0x8ff4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff48[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8ff4('0x0'));var rimraf=require(_0x8ff4('0x1'));var zipdir=require(_0x8ff4('0x2'));var jsonpatch=require(_0x8ff4('0x3'));var rp=require(_0x8ff4('0x4'));var moment=require(_0x8ff4('0x5'));var BPromise=require(_0x8ff4('0x6'));var Mustache=require(_0x8ff4('0x7'));var util=require(_0x8ff4('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8ff4('0x9'));var ejs=require(_0x8ff4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ff4('0xb'));var squel=require('squel');var crypto=require(_0x8ff4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8ff4('0xd'));var toCsv=require(_0x8ff4('0x9'));var querystring=require(_0x8ff4('0xe'));var Papa=require(_0x8ff4('0xf'));var Redis=require(_0x8ff4('0x10'));var authService=require(_0x8ff4('0x11'));var qs=require(_0x8ff4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ff4('0x13'));var logger=require(_0x8ff4('0x14'))('api');var utils=require(_0x8ff4('0x15'));var config=require(_0x8ff4('0x16'));var licenseUtil=require(_0x8ff4('0x17'));var db=require(_0x8ff4('0x18'))['db'];function respondWithStatusCode(_0x1a8d46,_0x5af565){_0x5af565=_0x5af565||0xcc;return function(_0x14e99f){if(_0x14e99f){return _0x1a8d46[_0x8ff4('0x19')](_0x5af565);}return _0x1a8d46[_0x8ff4('0x1a')](_0x5af565)[_0x8ff4('0x1b')]();};}function respondWithResult(_0x55ca6a,_0x507226){_0x507226=_0x507226||0xc8;return function(_0x2a0100){if(_0x2a0100){return _0x55ca6a[_0x8ff4('0x1a')](_0x507226)['json'](_0x2a0100);}};}function respondWithFilteredResult(_0x12a6ea,_0xe59044){return function(_0x243ede){if(_0x243ede){var _0x27695b=typeof _0xe59044[_0x8ff4('0x1c')]==='undefined'&&typeof _0xe59044[_0x8ff4('0x1d')]===_0x8ff4('0x1e');var _0xb727ab=_0x243ede[_0x8ff4('0x1f')];var _0x28ccdd=_0x27695b?0x0:_0xe59044['offset'];var _0x392d6a=_0x27695b?_0x243ede[_0x8ff4('0x1f')]:_0xe59044[_0x8ff4('0x1c')]+_0xe59044[_0x8ff4('0x1d')];var _0x46036e;if(_0x392d6a>=_0xb727ab){_0x392d6a=_0xb727ab;_0x46036e=0xc8;}else{_0x46036e=0xce;}_0x12a6ea[_0x8ff4('0x1a')](_0x46036e);return _0x12a6ea[_0x8ff4('0x20')](_0x8ff4('0x21'),_0x28ccdd+'-'+_0x392d6a+'/'+_0xb727ab)['json'](_0x243ede);}return null;};}function patchUpdates(_0xf8a575){return function(_0x36adb2){try{jsonpatch[_0x8ff4('0x22')](_0x36adb2,_0xf8a575,!![]);}catch(_0x55ef3a){return BPromise['reject'](_0x55ef3a);}return _0x36adb2[_0x8ff4('0x23')]();};}function saveUpdates(_0x28bf58,_0x282d88){return function(_0x1a3726){if(_0x1a3726){return _0x1a3726['update'](_0x28bf58)[_0x8ff4('0x24')](function(_0x56a73b){return _0x56a73b;});}return null;};}function removeEntity(_0x6e83ee,_0x42c91e){return function(_0x2612f2){if(_0x2612f2){return _0x2612f2[_0x8ff4('0x25')]()[_0x8ff4('0x24')](function(){_0x6e83ee[_0x8ff4('0x1a')](0xcc)[_0x8ff4('0x1b')]();});}};}function handleEntityNotFound(_0x2894d1,_0x201d20){return function(_0x9ef5bb){if(!_0x9ef5bb){_0x2894d1['sendStatus'](0x194);}return _0x9ef5bb;};}function handleError(_0x2d66b9,_0x309609){_0x309609=_0x309609||0x1f4;return function(_0x22cef1){logger[_0x8ff4('0x26')](_0x22cef1[_0x8ff4('0x27')]);if(_0x22cef1[_0x8ff4('0x28')]){delete _0x22cef1[_0x8ff4('0x28')];}_0x2d66b9[_0x8ff4('0x1a')](_0x309609)[_0x8ff4('0x29')](_0x22cef1);};}exports[_0x8ff4('0x2a')]=function(_0x40cbc1,_0x4b973d){var _0x695d0c={},_0x1ea73a={},_0x3158b5={'count':0x0,'rows':[]};var _0x356f44=_[_0x8ff4('0x2b')](db[_0x8ff4('0x2c')][_0x8ff4('0x2d')],function(_0x233806){return{'name':_0x233806['fieldName'],'type':_0x233806[_0x8ff4('0x2e')][_0x8ff4('0x2f')]};});_0x1ea73a['model']=_[_0x8ff4('0x2b')](_0x356f44,_0x8ff4('0x28'));_0x1ea73a['query']=_[_0x8ff4('0x30')](_0x40cbc1['query']);_0x1ea73a[_0x8ff4('0x31')]=_['intersection'](_0x1ea73a[_0x8ff4('0x32')],_0x1ea73a[_0x8ff4('0x33')]);_0x695d0c['attributes']=_[_0x8ff4('0x34')](_0x1ea73a['model'],qs['fields'](_0x40cbc1['query'][_0x8ff4('0x35')]));_0x695d0c[_0x8ff4('0x36')]=_0x695d0c[_0x8ff4('0x36')][_0x8ff4('0x37')]?_0x695d0c[_0x8ff4('0x36')]:_0x1ea73a[_0x8ff4('0x32')];if(!_0x40cbc1['query'][_0x8ff4('0x38')](_0x8ff4('0x39'))){_0x695d0c[_0x8ff4('0x1d')]=qs[_0x8ff4('0x1d')](_0x40cbc1[_0x8ff4('0x33')][_0x8ff4('0x1d')]);_0x695d0c[_0x8ff4('0x1c')]=qs[_0x8ff4('0x1c')](_0x40cbc1[_0x8ff4('0x33')][_0x8ff4('0x1c')]);}_0x695d0c['order']=qs[_0x8ff4('0x3a')](_0x40cbc1[_0x8ff4('0x33')][_0x8ff4('0x3a')]);_0x695d0c[_0x8ff4('0x3b')]=qs['filters'](_[_0x8ff4('0x3c')](_0x40cbc1[_0x8ff4('0x33')],_0x1ea73a[_0x8ff4('0x31')]),_0x356f44);if(_0x40cbc1['query'][_0x8ff4('0x3d')]){_0x695d0c['where']=_[_0x8ff4('0x3e')](_0x695d0c[_0x8ff4('0x3b')],{'$or':_[_0x8ff4('0x2b')](_0x356f44,function(_0x196316){if(_0x196316[_0x8ff4('0x2e')]!==_0x8ff4('0x3f')){var _0x2cbf0d={};_0x2cbf0d[_0x196316['name']]={'$like':'%'+_0x40cbc1['query'][_0x8ff4('0x3d')]+'%'};return _0x2cbf0d;}})});}_0x695d0c=_[_0x8ff4('0x3e')]({},_0x695d0c,_0x40cbc1['options']);var _0x17152a={'where':_0x695d0c[_0x8ff4('0x3b')]};return db[_0x8ff4('0x2c')][_0x8ff4('0x1f')](_0x17152a)[_0x8ff4('0x24')](function(_0x1d94bc){_0x3158b5[_0x8ff4('0x1f')]=_0x1d94bc;if(_0x40cbc1['query'][_0x8ff4('0x40')]){_0x695d0c[_0x8ff4('0x41')]=[{'all':!![]}];}return db[_0x8ff4('0x2c')][_0x8ff4('0x42')](_0x695d0c);})[_0x8ff4('0x24')](function(_0x11166c){_0x3158b5[_0x8ff4('0x43')]=_0x11166c;return _0x3158b5;})[_0x8ff4('0x24')](respondWithFilteredResult(_0x4b973d,_0x695d0c))['catch'](handleError(_0x4b973d,null));};exports[_0x8ff4('0x44')]=function(_0x3a59ba,_0xcfd036){var _0xd5a4b3={'raw':![],'where':{'id':_0x3a59ba[_0x8ff4('0x45')]['id']}},_0x2fcb6e={};_0x2fcb6e['model']=_['keys'](db[_0x8ff4('0x2c')][_0x8ff4('0x2d')]);_0x2fcb6e[_0x8ff4('0x33')]=_['keys'](_0x3a59ba[_0x8ff4('0x33')]);_0x2fcb6e['filters']=_[_0x8ff4('0x34')](_0x2fcb6e[_0x8ff4('0x32')],_0x2fcb6e['query']);_0xd5a4b3['attributes']=_[_0x8ff4('0x34')](_0x2fcb6e[_0x8ff4('0x32')],qs[_0x8ff4('0x35')](_0x3a59ba[_0x8ff4('0x33')]['fields']));_0xd5a4b3['attributes']=_0xd5a4b3[_0x8ff4('0x36')]['length']?_0xd5a4b3[_0x8ff4('0x36')]:_0x2fcb6e['model'];if(_0x3a59ba[_0x8ff4('0x33')]['includeAll']){_0xd5a4b3['include']=[{'all':!![]}];}_0xd5a4b3=_[_0x8ff4('0x3e')]({},_0xd5a4b3,_0x3a59ba[_0x8ff4('0x46')]);return db['Dynamics365Configuration'][_0x8ff4('0x47')](_0xd5a4b3)[_0x8ff4('0x24')](handleEntityNotFound(_0xcfd036,null))[_0x8ff4('0x24')](respondWithResult(_0xcfd036,null))[_0x8ff4('0x48')](handleError(_0xcfd036,null));};exports[_0x8ff4('0x49')]=function(_0x252621,_0x1089f1){return db[_0x8ff4('0x2c')][_0x8ff4('0x49')](_0x252621[_0x8ff4('0x4a')],{})[_0x8ff4('0x24')](respondWithResult(_0x1089f1,0xc9))[_0x8ff4('0x48')](handleError(_0x1089f1,null));};exports['update']=function(_0x2ef670,_0x262995){if(_0x2ef670[_0x8ff4('0x4a')]['id']){delete _0x2ef670[_0x8ff4('0x4a')]['id'];}return db[_0x8ff4('0x2c')][_0x8ff4('0x47')]({'where':{'id':_0x2ef670['params']['id']}})[_0x8ff4('0x24')](handleEntityNotFound(_0x262995,null))[_0x8ff4('0x24')](saveUpdates(_0x2ef670['body'],null))[_0x8ff4('0x24')](respondWithResult(_0x262995,null))[_0x8ff4('0x48')](handleError(_0x262995,null));};exports['destroy']=function(_0x4c9046,_0x37f12e){return db[_0x8ff4('0x2c')][_0x8ff4('0x47')]({'where':{'id':_0x4c9046[_0x8ff4('0x45')]['id']}})['then'](handleEntityNotFound(_0x37f12e,null))['then'](removeEntity(_0x37f12e,null))[_0x8ff4('0x48')](handleError(_0x37f12e,null));};exports[_0x8ff4('0x4b')]=function(_0x780a34,_0x16365f,_0x344ab1){var _0x5d085f={};var _0xae63f0={};var _0x29c579;var _0x2361b7;return db[_0x8ff4('0x2c')]['findOne']({'where':{'id':_0x780a34[_0x8ff4('0x45')]['id']}})[_0x8ff4('0x24')](handleEntityNotFound(_0x16365f,null))[_0x8ff4('0x24')](function(_0x13e8ff){if(_0x13e8ff){_0x29c579=_0x13e8ff;_0xae63f0[_0x8ff4('0x32')]=_[_0x8ff4('0x30')](db[_0x8ff4('0x4c')][_0x8ff4('0x2d')]);_0xae63f0[_0x8ff4('0x33')]=_[_0x8ff4('0x30')](_0x780a34['query']);_0xae63f0['filters']=_[_0x8ff4('0x34')](_0xae63f0['model'],_0xae63f0[_0x8ff4('0x33')]);_0x5d085f[_0x8ff4('0x36')]=_['intersection'](_0xae63f0['model'],qs['fields'](_0x780a34[_0x8ff4('0x33')][_0x8ff4('0x35')]));_0x5d085f['attributes']=_0x5d085f['attributes'][_0x8ff4('0x37')]?_0x5d085f[_0x8ff4('0x36')]:_0xae63f0[_0x8ff4('0x32')];_0x5d085f['order']=qs[_0x8ff4('0x3a')](_0x780a34[_0x8ff4('0x33')][_0x8ff4('0x3a')]);_0x5d085f['where']=qs[_0x8ff4('0x31')](_['pick'](_0x780a34[_0x8ff4('0x33')],_0xae63f0['filters']));if(_0x780a34[_0x8ff4('0x33')][_0x8ff4('0x3d')]){_0x5d085f[_0x8ff4('0x3b')]=_[_0x8ff4('0x3e')](_0x5d085f[_0x8ff4('0x3b')],{'$or':_[_0x8ff4('0x2b')](_0x5d085f[_0x8ff4('0x36')],function(_0x1db143){var _0xdbfa55={};_0xdbfa55[_0x1db143]={'$like':'%'+_0x780a34[_0x8ff4('0x33')]['filter']+'%'};return _0xdbfa55;})});}_0x5d085f=_[_0x8ff4('0x3e')]({},_0x5d085f,_0x780a34[_0x8ff4('0x46')]);return _0x29c579[_0x8ff4('0x4b')](_0x5d085f);}})[_0x8ff4('0x24')](function(_0x673379){if(_0x673379){_0x2361b7=_0x673379[_0x8ff4('0x37')];if(!_0x780a34[_0x8ff4('0x33')]['hasOwnProperty']('nolimit')){_0x5d085f['limit']=qs[_0x8ff4('0x1d')](_0x780a34[_0x8ff4('0x33')][_0x8ff4('0x1d')]);_0x5d085f['offset']=qs[_0x8ff4('0x1c')](_0x780a34[_0x8ff4('0x33')][_0x8ff4('0x1c')]);}return _0x29c579[_0x8ff4('0x4b')](_0x5d085f);}})['then'](function(_0x5af661){if(_0x5af661){return _0x5af661?{'count':_0x2361b7,'rows':_0x5af661}:null;}})[_0x8ff4('0x24')](respondWithResult(_0x16365f,null))[_0x8ff4('0x48')](handleError(_0x16365f,null));};exports[_0x8ff4('0x4d')]=function(_0x2f38fe,_0x5ab3bc,_0x3d5b42){var _0x2f8d71={};var _0x8255a9={};var _0x5e34f4;var _0x22bdd8;return db[_0x8ff4('0x2c')][_0x8ff4('0x4e')]({'where':{'id':_0x2f38fe['params']['id']}})[_0x8ff4('0x24')](handleEntityNotFound(_0x5ab3bc,null))[_0x8ff4('0x24')](function(_0xf2c4e9){if(_0xf2c4e9){_0x5e34f4=_0xf2c4e9;_0x8255a9[_0x8ff4('0x32')]=_['keys'](db['Dynamics365Field'][_0x8ff4('0x2d')]);_0x8255a9['query']=_['keys'](_0x2f38fe[_0x8ff4('0x33')]);_0x8255a9[_0x8ff4('0x31')]=_[_0x8ff4('0x34')](_0x8255a9[_0x8ff4('0x32')],_0x8255a9['query']);_0x2f8d71['attributes']=_[_0x8ff4('0x34')](_0x8255a9['model'],qs[_0x8ff4('0x35')](_0x2f38fe[_0x8ff4('0x33')][_0x8ff4('0x35')]));_0x2f8d71[_0x8ff4('0x36')]=_0x2f8d71['attributes'][_0x8ff4('0x37')]?_0x2f8d71['attributes']:_0x8255a9[_0x8ff4('0x32')];_0x2f8d71[_0x8ff4('0x4f')]=qs[_0x8ff4('0x3a')](_0x2f38fe[_0x8ff4('0x33')][_0x8ff4('0x3a')]);_0x2f8d71[_0x8ff4('0x3b')]=qs[_0x8ff4('0x31')](_['pick'](_0x2f38fe[_0x8ff4('0x33')],_0x8255a9['filters']));if(_0x2f38fe['query'][_0x8ff4('0x3d')]){_0x2f8d71[_0x8ff4('0x3b')]=_[_0x8ff4('0x3e')](_0x2f8d71[_0x8ff4('0x3b')],{'$or':_[_0x8ff4('0x2b')](_0x2f8d71[_0x8ff4('0x36')],function(_0x5b5b7c){var _0xea2c1b={};_0xea2c1b[_0x5b5b7c]={'$like':'%'+_0x2f38fe[_0x8ff4('0x33')][_0x8ff4('0x3d')]+'%'};return _0xea2c1b;})});}_0x2f8d71=_[_0x8ff4('0x3e')]({},_0x2f8d71,_0x2f38fe[_0x8ff4('0x46')]);return _0x5e34f4[_0x8ff4('0x4d')](_0x2f8d71);}})['then'](function(_0x220dde){if(_0x220dde){_0x22bdd8=_0x220dde[_0x8ff4('0x37')];if(!_0x2f38fe[_0x8ff4('0x33')][_0x8ff4('0x38')]('nolimit')){_0x2f8d71[_0x8ff4('0x1d')]=qs[_0x8ff4('0x1d')](_0x2f38fe[_0x8ff4('0x33')][_0x8ff4('0x1d')]);_0x2f8d71['offset']=qs[_0x8ff4('0x1c')](_0x2f38fe[_0x8ff4('0x33')][_0x8ff4('0x1c')]);}return _0x5e34f4[_0x8ff4('0x4d')](_0x2f8d71);}})[_0x8ff4('0x24')](function(_0x1aa1a5){if(_0x1aa1a5){return _0x1aa1a5?{'count':_0x22bdd8,'rows':_0x1aa1a5}:null;}})[_0x8ff4('0x24')](respondWithResult(_0x5ab3bc,null))['catch'](handleError(_0x5ab3bc,null));};exports[_0x8ff4('0x50')]=function(_0x43f798,_0x1c5f0b,_0x12d8e3){var _0x5bf782={};var _0x304725={};var _0x38c7d2;var _0x597cf5;return db[_0x8ff4('0x2c')]['findOne']({'where':{'id':_0x43f798[_0x8ff4('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c5f0b,null))['then'](function(_0x291875){if(_0x291875){_0x38c7d2=_0x291875;_0x304725[_0x8ff4('0x32')]=_['keys'](db[_0x8ff4('0x4c')]['rawAttributes']);_0x304725[_0x8ff4('0x33')]=_[_0x8ff4('0x30')](_0x43f798[_0x8ff4('0x33')]);_0x304725[_0x8ff4('0x31')]=_[_0x8ff4('0x34')](_0x304725['model'],_0x304725[_0x8ff4('0x33')]);_0x5bf782['attributes']=_[_0x8ff4('0x34')](_0x304725[_0x8ff4('0x32')],qs['fields'](_0x43f798['query']['fields']));_0x5bf782[_0x8ff4('0x36')]=_0x5bf782[_0x8ff4('0x36')][_0x8ff4('0x37')]?_0x5bf782['attributes']:_0x304725[_0x8ff4('0x32')];_0x5bf782['order']=qs[_0x8ff4('0x3a')](_0x43f798[_0x8ff4('0x33')][_0x8ff4('0x3a')]);_0x5bf782[_0x8ff4('0x3b')]=qs['filters'](_['pick'](_0x43f798['query'],_0x304725[_0x8ff4('0x31')]));if(_0x43f798[_0x8ff4('0x33')][_0x8ff4('0x3d')]){_0x5bf782[_0x8ff4('0x3b')]=_[_0x8ff4('0x3e')](_0x5bf782[_0x8ff4('0x3b')],{'$or':_['map'](_0x5bf782['attributes'],function(_0x3bb731){var _0x5c1ca5={};_0x5c1ca5[_0x3bb731]={'$like':'%'+_0x43f798[_0x8ff4('0x33')][_0x8ff4('0x3d')]+'%'};return _0x5c1ca5;})});}_0x5bf782=_[_0x8ff4('0x3e')]({},_0x5bf782,_0x43f798[_0x8ff4('0x46')]);return _0x38c7d2[_0x8ff4('0x50')](_0x5bf782);}})['then'](function(_0x17e01b){if(_0x17e01b){_0x597cf5=_0x17e01b[_0x8ff4('0x37')];if(!_0x43f798['query'][_0x8ff4('0x38')](_0x8ff4('0x39'))){_0x5bf782[_0x8ff4('0x1d')]=qs[_0x8ff4('0x1d')](_0x43f798[_0x8ff4('0x33')][_0x8ff4('0x1d')]);_0x5bf782['offset']=qs['offset'](_0x43f798[_0x8ff4('0x33')]['offset']);}return _0x38c7d2[_0x8ff4('0x50')](_0x5bf782);}})['then'](function(_0xd672ac){if(_0xd672ac){return _0xd672ac?{'count':_0x597cf5,'rows':_0xd672ac}:null;}})['then'](respondWithResult(_0x1c5f0b,null))[_0x8ff4('0x48')](handleError(_0x1c5f0b,null));}; \ No newline at end of file +var _0xf053=['findOne','length','order','getSubjects','getDescriptions','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Configuration','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','getFields'];(function(_0x2d414e,_0x4b72be){var _0x1471ab=function(_0x447238){while(--_0x447238){_0x2d414e['push'](_0x2d414e['shift']());}};_0x1471ab(++_0x4b72be);}(_0xf053,0x9f));var _0x3f05=function(_0x5e9da3,_0x2deba4){_0x5e9da3=_0x5e9da3-0x0;var _0x3391d7=_0xf053[_0x5e9da3];return _0x3391d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3f05('0x0'));var rp=require('request-promise');var moment=require(_0x3f05('0x1'));var BPromise=require(_0x3f05('0x2'));var Mustache=require(_0x3f05('0x3'));var util=require(_0x3f05('0x4'));var path=require(_0x3f05('0x5'));var sox=require(_0x3f05('0x6'));var csv=require(_0x3f05('0x7'));var ejs=require(_0x3f05('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f05('0x9'));var squel=require(_0x3f05('0xa'));var crypto=require(_0x3f05('0xb'));var jsforce=require(_0x3f05('0xc'));var deskjs=require(_0x3f05('0xd'));var toCsv=require(_0x3f05('0x7'));var querystring=require(_0x3f05('0xe'));var Papa=require('papaparse');var Redis=require(_0x3f05('0xf'));var authService=require(_0x3f05('0x10'));var qs=require(_0x3f05('0x11'));var as=require(_0x3f05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f05('0x13'))('api');var utils=require(_0x3f05('0x14'));var config=require(_0x3f05('0x15'));var licenseUtil=require(_0x3f05('0x16'));var db=require(_0x3f05('0x17'))['db'];function respondWithStatusCode(_0x12ff41,_0x49c9f0){_0x49c9f0=_0x49c9f0||0xcc;return function(_0x16c211){if(_0x16c211){return _0x12ff41['sendStatus'](_0x49c9f0);}return _0x12ff41[_0x3f05('0x18')](_0x49c9f0)[_0x3f05('0x19')]();};}function respondWithResult(_0x59efdb,_0x1e6dc9){_0x1e6dc9=_0x1e6dc9||0xc8;return function(_0x5c28e5){if(_0x5c28e5){return _0x59efdb[_0x3f05('0x18')](_0x1e6dc9)[_0x3f05('0x1a')](_0x5c28e5);}};}function respondWithFilteredResult(_0x8d1e42,_0x346ca0){return function(_0x3ce7a3){if(_0x3ce7a3){var _0x30c7b2=typeof _0x346ca0['offset']===_0x3f05('0x1b')&&typeof _0x346ca0['limit']===_0x3f05('0x1b');var _0x56886b=_0x3ce7a3[_0x3f05('0x1c')];var _0x4a86d8=_0x30c7b2?0x0:_0x346ca0['offset'];var _0x3765af=_0x30c7b2?_0x3ce7a3[_0x3f05('0x1c')]:_0x346ca0[_0x3f05('0x1d')]+_0x346ca0[_0x3f05('0x1e')];var _0x175de2;if(_0x3765af>=_0x56886b){_0x3765af=_0x56886b;_0x175de2=0xc8;}else{_0x175de2=0xce;}_0x8d1e42[_0x3f05('0x18')](_0x175de2);return _0x8d1e42[_0x3f05('0x1f')](_0x3f05('0x20'),_0x4a86d8+'-'+_0x3765af+'/'+_0x56886b)['json'](_0x3ce7a3);}return null;};}function patchUpdates(_0x3604d3){return function(_0x511110){try{jsonpatch['apply'](_0x511110,_0x3604d3,!![]);}catch(_0x2b3ca3){return BPromise[_0x3f05('0x21')](_0x2b3ca3);}return _0x511110[_0x3f05('0x22')]();};}function saveUpdates(_0x1e3851,_0x49c0a0){return function(_0x18e03a){if(_0x18e03a){return _0x18e03a[_0x3f05('0x23')](_0x1e3851)['then'](function(_0x3d61af){return _0x3d61af;});}return null;};}function removeEntity(_0xfec2e,_0x9fdddb){return function(_0x3eb428){if(_0x3eb428){return _0x3eb428[_0x3f05('0x24')]()[_0x3f05('0x25')](function(){_0xfec2e[_0x3f05('0x18')](0xcc)[_0x3f05('0x19')]();});}};}function handleEntityNotFound(_0x48d31b,_0x4a1148){return function(_0x53ab78){if(!_0x53ab78){_0x48d31b['sendStatus'](0x194);}return _0x53ab78;};}function handleError(_0x1dd85e,_0x105c06){_0x105c06=_0x105c06||0x1f4;return function(_0x217aff){logger[_0x3f05('0x26')](_0x217aff[_0x3f05('0x27')]);if(_0x217aff['name']){delete _0x217aff[_0x3f05('0x28')];}_0x1dd85e['status'](_0x105c06)[_0x3f05('0x29')](_0x217aff);};}exports[_0x3f05('0x2a')]=function(_0x27fb10,_0x479218){var _0x4deda2={},_0x3daf17={},_0x1e2a50={'count':0x0,'rows':[]};var _0x3bd7f5=_[_0x3f05('0x2b')](db[_0x3f05('0x2c')]['rawAttributes'],function(_0x53a2d7){return{'name':_0x53a2d7['fieldName'],'type':_0x53a2d7[_0x3f05('0x2d')][_0x3f05('0x2e')]};});_0x3daf17[_0x3f05('0x2f')]=_[_0x3f05('0x2b')](_0x3bd7f5,'name');_0x3daf17[_0x3f05('0x30')]=_[_0x3f05('0x31')](_0x27fb10['query']);_0x3daf17['filters']=_[_0x3f05('0x32')](_0x3daf17[_0x3f05('0x2f')],_0x3daf17[_0x3f05('0x30')]);_0x4deda2[_0x3f05('0x33')]=_['intersection'](_0x3daf17[_0x3f05('0x2f')],qs[_0x3f05('0x34')](_0x27fb10[_0x3f05('0x30')][_0x3f05('0x34')]));_0x4deda2[_0x3f05('0x33')]=_0x4deda2['attributes']['length']?_0x4deda2[_0x3f05('0x33')]:_0x3daf17['model'];if(!_0x27fb10[_0x3f05('0x30')][_0x3f05('0x35')](_0x3f05('0x36'))){_0x4deda2[_0x3f05('0x1e')]=qs[_0x3f05('0x1e')](_0x27fb10[_0x3f05('0x30')]['limit']);_0x4deda2[_0x3f05('0x1d')]=qs[_0x3f05('0x1d')](_0x27fb10[_0x3f05('0x30')]['offset']);}_0x4deda2['order']=qs[_0x3f05('0x37')](_0x27fb10['query'][_0x3f05('0x37')]);_0x4deda2[_0x3f05('0x38')]=qs['filters'](_[_0x3f05('0x39')](_0x27fb10[_0x3f05('0x30')],_0x3daf17[_0x3f05('0x3a')]),_0x3bd7f5);if(_0x27fb10['query'][_0x3f05('0x3b')]){_0x4deda2['where']=_['merge'](_0x4deda2[_0x3f05('0x38')],{'$or':_[_0x3f05('0x2b')](_0x3bd7f5,function(_0x2bd776){if(_0x2bd776[_0x3f05('0x2d')]!=='VIRTUAL'){var _0x4ef59b={};_0x4ef59b[_0x2bd776['name']]={'$like':'%'+_0x27fb10[_0x3f05('0x30')][_0x3f05('0x3b')]+'%'};return _0x4ef59b;}})});}_0x4deda2=_[_0x3f05('0x3c')]({},_0x4deda2,_0x27fb10[_0x3f05('0x3d')]);var _0x3d25d4={'where':_0x4deda2['where']};return db['Dynamics365Configuration'][_0x3f05('0x1c')](_0x3d25d4)[_0x3f05('0x25')](function(_0x1b40b0){_0x1e2a50[_0x3f05('0x1c')]=_0x1b40b0;if(_0x27fb10[_0x3f05('0x30')][_0x3f05('0x3e')]){_0x4deda2[_0x3f05('0x3f')]=[{'all':!![]}];}return db[_0x3f05('0x2c')]['findAll'](_0x4deda2);})['then'](function(_0x4a0932){_0x1e2a50['rows']=_0x4a0932;return _0x1e2a50;})['then'](respondWithFilteredResult(_0x479218,_0x4deda2))[_0x3f05('0x40')](handleError(_0x479218,null));};exports[_0x3f05('0x41')]=function(_0x33f078,_0x4f6d1e){var _0x1e2bbe={'raw':![],'where':{'id':_0x33f078[_0x3f05('0x42')]['id']}},_0x35da12={};_0x35da12[_0x3f05('0x2f')]=_[_0x3f05('0x31')](db[_0x3f05('0x2c')][_0x3f05('0x43')]);_0x35da12[_0x3f05('0x30')]=_[_0x3f05('0x31')](_0x33f078[_0x3f05('0x30')]);_0x35da12['filters']=_['intersection'](_0x35da12['model'],_0x35da12[_0x3f05('0x30')]);_0x1e2bbe['attributes']=_['intersection'](_0x35da12[_0x3f05('0x2f')],qs[_0x3f05('0x34')](_0x33f078[_0x3f05('0x30')][_0x3f05('0x34')]));_0x1e2bbe[_0x3f05('0x33')]=_0x1e2bbe[_0x3f05('0x33')]['length']?_0x1e2bbe[_0x3f05('0x33')]:_0x35da12[_0x3f05('0x2f')];if(_0x33f078[_0x3f05('0x30')]['includeAll']){_0x1e2bbe['include']=[{'all':!![]}];}_0x1e2bbe=_[_0x3f05('0x3c')]({},_0x1e2bbe,_0x33f078['options']);return db['Dynamics365Configuration'][_0x3f05('0x44')](_0x1e2bbe)[_0x3f05('0x25')](handleEntityNotFound(_0x4f6d1e,null))[_0x3f05('0x25')](respondWithResult(_0x4f6d1e,null))['catch'](handleError(_0x4f6d1e,null));};exports['create']=function(_0x4168be,_0x122d0c){return db[_0x3f05('0x2c')][_0x3f05('0x45')](_0x4168be[_0x3f05('0x46')],{})['then'](respondWithResult(_0x122d0c,0xc9))['catch'](handleError(_0x122d0c,null));};exports[_0x3f05('0x23')]=function(_0x4cfb44,_0x3e87b3){if(_0x4cfb44[_0x3f05('0x46')]['id']){delete _0x4cfb44[_0x3f05('0x46')]['id'];}return db[_0x3f05('0x2c')][_0x3f05('0x44')]({'where':{'id':_0x4cfb44[_0x3f05('0x42')]['id']}})[_0x3f05('0x25')](handleEntityNotFound(_0x3e87b3,null))[_0x3f05('0x25')](saveUpdates(_0x4cfb44[_0x3f05('0x46')],null))['then'](respondWithResult(_0x3e87b3,null))[_0x3f05('0x40')](handleError(_0x3e87b3,null));};exports['destroy']=function(_0x58a823,_0x55e3ce){return db[_0x3f05('0x2c')][_0x3f05('0x44')]({'where':{'id':_0x58a823[_0x3f05('0x42')]['id']}})['then'](handleEntityNotFound(_0x55e3ce,null))['then'](removeEntity(_0x55e3ce,null))[_0x3f05('0x40')](handleError(_0x55e3ce,null));};exports[_0x3f05('0x47')]=function(_0x3069ff,_0x3c981e,_0x1fe97b){var _0x270f10={};var _0x4144d4={};var _0x3558a3;var _0x436802;return db['Dynamics365Configuration'][_0x3f05('0x48')]({'where':{'id':_0x3069ff[_0x3f05('0x42')]['id']}})[_0x3f05('0x25')](handleEntityNotFound(_0x3c981e,null))[_0x3f05('0x25')](function(_0x28db11){if(_0x28db11){_0x3558a3=_0x28db11;_0x4144d4[_0x3f05('0x2f')]=_[_0x3f05('0x31')](db['Dynamics365Field'][_0x3f05('0x43')]);_0x4144d4[_0x3f05('0x30')]=_['keys'](_0x3069ff['query']);_0x4144d4[_0x3f05('0x3a')]=_[_0x3f05('0x32')](_0x4144d4[_0x3f05('0x2f')],_0x4144d4['query']);_0x270f10[_0x3f05('0x33')]=_['intersection'](_0x4144d4[_0x3f05('0x2f')],qs[_0x3f05('0x34')](_0x3069ff[_0x3f05('0x30')][_0x3f05('0x34')]));_0x270f10[_0x3f05('0x33')]=_0x270f10[_0x3f05('0x33')][_0x3f05('0x49')]?_0x270f10['attributes']:_0x4144d4['model'];_0x270f10[_0x3f05('0x4a')]=qs['sort'](_0x3069ff[_0x3f05('0x30')][_0x3f05('0x37')]);_0x270f10[_0x3f05('0x38')]=qs[_0x3f05('0x3a')](_[_0x3f05('0x39')](_0x3069ff['query'],_0x4144d4[_0x3f05('0x3a')]));if(_0x3069ff['query'][_0x3f05('0x3b')]){_0x270f10['where']=_[_0x3f05('0x3c')](_0x270f10[_0x3f05('0x38')],{'$or':_[_0x3f05('0x2b')](_0x270f10[_0x3f05('0x33')],function(_0x194cf9){var _0x2c326b={};_0x2c326b[_0x194cf9]={'$like':'%'+_0x3069ff[_0x3f05('0x30')]['filter']+'%'};return _0x2c326b;})});}_0x270f10=_['merge']({},_0x270f10,_0x3069ff[_0x3f05('0x3d')]);return _0x3558a3[_0x3f05('0x47')](_0x270f10);}})[_0x3f05('0x25')](function(_0x4ff372){if(_0x4ff372){_0x436802=_0x4ff372[_0x3f05('0x49')];if(!_0x3069ff[_0x3f05('0x30')][_0x3f05('0x35')](_0x3f05('0x36'))){_0x270f10['limit']=qs[_0x3f05('0x1e')](_0x3069ff[_0x3f05('0x30')][_0x3f05('0x1e')]);_0x270f10[_0x3f05('0x1d')]=qs[_0x3f05('0x1d')](_0x3069ff[_0x3f05('0x30')]['offset']);}return _0x3558a3['getFields'](_0x270f10);}})['then'](function(_0x35964d){if(_0x35964d){return _0x35964d?{'count':_0x436802,'rows':_0x35964d}:null;}})['then'](respondWithResult(_0x3c981e,null))['catch'](handleError(_0x3c981e,null));};exports[_0x3f05('0x4b')]=function(_0x38d802,_0x3678bc,_0x11ab14){var _0x51e31d={};var _0xd32934={};var _0x88591b;var _0x5521fe;return db['Dynamics365Configuration'][_0x3f05('0x48')]({'where':{'id':_0x38d802['params']['id']}})[_0x3f05('0x25')](handleEntityNotFound(_0x3678bc,null))[_0x3f05('0x25')](function(_0x3e6c0d){if(_0x3e6c0d){_0x88591b=_0x3e6c0d;_0xd32934[_0x3f05('0x2f')]=_[_0x3f05('0x31')](db['Dynamics365Field'][_0x3f05('0x43')]);_0xd32934['query']=_[_0x3f05('0x31')](_0x38d802['query']);_0xd32934[_0x3f05('0x3a')]=_[_0x3f05('0x32')](_0xd32934[_0x3f05('0x2f')],_0xd32934[_0x3f05('0x30')]);_0x51e31d['attributes']=_[_0x3f05('0x32')](_0xd32934[_0x3f05('0x2f')],qs['fields'](_0x38d802[_0x3f05('0x30')]['fields']));_0x51e31d[_0x3f05('0x33')]=_0x51e31d[_0x3f05('0x33')][_0x3f05('0x49')]?_0x51e31d[_0x3f05('0x33')]:_0xd32934[_0x3f05('0x2f')];_0x51e31d[_0x3f05('0x4a')]=qs['sort'](_0x38d802[_0x3f05('0x30')]['sort']);_0x51e31d['where']=qs[_0x3f05('0x3a')](_[_0x3f05('0x39')](_0x38d802[_0x3f05('0x30')],_0xd32934[_0x3f05('0x3a')]));if(_0x38d802[_0x3f05('0x30')][_0x3f05('0x3b')]){_0x51e31d[_0x3f05('0x38')]=_['merge'](_0x51e31d['where'],{'$or':_[_0x3f05('0x2b')](_0x51e31d['attributes'],function(_0x58dba7){var _0x1fa3ab={};_0x1fa3ab[_0x58dba7]={'$like':'%'+_0x38d802['query']['filter']+'%'};return _0x1fa3ab;})});}_0x51e31d=_['merge']({},_0x51e31d,_0x38d802[_0x3f05('0x3d')]);return _0x88591b[_0x3f05('0x4b')](_0x51e31d);}})[_0x3f05('0x25')](function(_0x318bf7){if(_0x318bf7){_0x5521fe=_0x318bf7['length'];if(!_0x38d802[_0x3f05('0x30')][_0x3f05('0x35')](_0x3f05('0x36'))){_0x51e31d[_0x3f05('0x1e')]=qs['limit'](_0x38d802['query'][_0x3f05('0x1e')]);_0x51e31d[_0x3f05('0x1d')]=qs[_0x3f05('0x1d')](_0x38d802[_0x3f05('0x30')][_0x3f05('0x1d')]);}return _0x88591b[_0x3f05('0x4b')](_0x51e31d);}})['then'](function(_0x26e7c9){if(_0x26e7c9){return _0x26e7c9?{'count':_0x5521fe,'rows':_0x26e7c9}:null;}})[_0x3f05('0x25')](respondWithResult(_0x3678bc,null))[_0x3f05('0x40')](handleError(_0x3678bc,null));};exports[_0x3f05('0x4c')]=function(_0x267287,_0x3793b2,_0x1278ff){var _0x46c54c={};var _0x43af8e={};var _0x3c441c;var _0x5025ef;return db[_0x3f05('0x2c')][_0x3f05('0x48')]({'where':{'id':_0x267287[_0x3f05('0x42')]['id']}})['then'](handleEntityNotFound(_0x3793b2,null))['then'](function(_0x33aa1a){if(_0x33aa1a){_0x3c441c=_0x33aa1a;_0x43af8e['model']=_[_0x3f05('0x31')](db['Dynamics365Field'][_0x3f05('0x43')]);_0x43af8e['query']=_[_0x3f05('0x31')](_0x267287[_0x3f05('0x30')]);_0x43af8e[_0x3f05('0x3a')]=_[_0x3f05('0x32')](_0x43af8e[_0x3f05('0x2f')],_0x43af8e[_0x3f05('0x30')]);_0x46c54c['attributes']=_['intersection'](_0x43af8e[_0x3f05('0x2f')],qs[_0x3f05('0x34')](_0x267287[_0x3f05('0x30')][_0x3f05('0x34')]));_0x46c54c[_0x3f05('0x33')]=_0x46c54c['attributes']['length']?_0x46c54c[_0x3f05('0x33')]:_0x43af8e[_0x3f05('0x2f')];_0x46c54c[_0x3f05('0x4a')]=qs[_0x3f05('0x37')](_0x267287[_0x3f05('0x30')][_0x3f05('0x37')]);_0x46c54c[_0x3f05('0x38')]=qs[_0x3f05('0x3a')](_[_0x3f05('0x39')](_0x267287[_0x3f05('0x30')],_0x43af8e[_0x3f05('0x3a')]));if(_0x267287[_0x3f05('0x30')][_0x3f05('0x3b')]){_0x46c54c[_0x3f05('0x38')]=_[_0x3f05('0x3c')](_0x46c54c[_0x3f05('0x38')],{'$or':_['map'](_0x46c54c[_0x3f05('0x33')],function(_0x3dda8a){var _0xdbe29a={};_0xdbe29a[_0x3dda8a]={'$like':'%'+_0x267287[_0x3f05('0x30')][_0x3f05('0x3b')]+'%'};return _0xdbe29a;})});}_0x46c54c=_[_0x3f05('0x3c')]({},_0x46c54c,_0x267287['options']);return _0x3c441c[_0x3f05('0x4c')](_0x46c54c);}})[_0x3f05('0x25')](function(_0x5ef3bd){if(_0x5ef3bd){_0x5025ef=_0x5ef3bd[_0x3f05('0x49')];if(!_0x267287[_0x3f05('0x30')][_0x3f05('0x35')]('nolimit')){_0x46c54c[_0x3f05('0x1e')]=qs[_0x3f05('0x1e')](_0x267287[_0x3f05('0x30')][_0x3f05('0x1e')]);_0x46c54c[_0x3f05('0x1d')]=qs[_0x3f05('0x1d')](_0x267287[_0x3f05('0x30')][_0x3f05('0x1d')]);}return _0x3c441c[_0x3f05('0x4c')](_0x46c54c);}})[_0x3f05('0x25')](function(_0x12dbe9){if(_0x12dbe9){return _0x12dbe9?{'count':_0x5025ef,'rows':_0x12dbe9}:null;}})['then'](respondWithResult(_0x3793b2,null))[_0x3f05('0x40')](handleError(_0x3793b2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index a29ca17..1b0b57f 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 _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4b49ab,_0xa3f86){var _0x311474=function(_0x202d63){while(--_0x202d63){_0x4b49ab['push'](_0x4b49ab['shift']());}};_0x311474(++_0xa3f86);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xa69d58,_0xcd9d79){_0xa69d58=_0xa69d58-0x0;var _0x598193=_0xd6d6[_0xa69d58];return _0x598193;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x330bca,_0x4cdbac){var _0x19e656=function(_0x9fd34f){while(--_0x9fd34f){_0x330bca['push'](_0x330bca['shift']());}};_0x19e656(++_0x4cdbac);}(_0x34e8,0x12c));var _0x834e=function(_0x56204a,_0x2f20be){_0x56204a=_0x56204a-0x0;var _0x269fcb=_0x34e8[_0x56204a];return _0x269fcb;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 34cb3ac..a1b050b 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 _0x03e0=['then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x258ec6,_0x17ff4c){var _0x2b23db=function(_0x41355f){while(--_0x41355f){_0x258ec6['push'](_0x258ec6['shift']());}};_0x2b23db(++_0x17ff4c);}(_0x03e0,0x188));var _0x003e=function(_0x2d7ead,_0x48cb08){_0x2d7ead=_0x2d7ead-0x0;var _0x4ecf0e=_0x03e0[_0x2d7ead];return _0x4ecf0e;};'use strict';var _=require('lodash');var util=require(_0x003e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x003e('0x1'));var db=require(_0x003e('0x2'))['db'];var utils=require(_0x003e('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x003e('0x4'));var jayson=require(_0x003e('0x5'));var client=jayson[_0x003e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0900,_0x4b3be9,_0x530b74){return new BPromise(function(_0x522824,_0x31b6e3){return client[_0x003e('0x7')](_0x4d0900,_0x530b74)[_0x003e('0x8')](function(_0x2fcbf5){logger[_0x003e('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4b3be9,_0x003e('0xa'));logger[_0x003e('0xb')](_0x003e('0xc'),_0x4b3be9,_0x003e('0xa'),JSON[_0x003e('0xd')](_0x2fcbf5));if(_0x2fcbf5[_0x003e('0xe')]){if(_0x2fcbf5[_0x003e('0xe')][_0x003e('0xf')]===0x1f4){logger[_0x003e('0xe')](_0x003e('0x10'),_0x4b3be9,_0x2fcbf5[_0x003e('0xe')][_0x003e('0x11')]);return _0x31b6e3(_0x2fcbf5[_0x003e('0xe')]['message']);}logger[_0x003e('0xe')](_0x003e('0x10'),_0x4b3be9,_0x2fcbf5[_0x003e('0xe')]['message']);return _0x522824(_0x2fcbf5[_0x003e('0xe')][_0x003e('0x11')]);}else{logger['info'](_0x003e('0x10'),_0x4b3be9,_0x003e('0xa'));_0x522824(_0x2fcbf5[_0x003e('0x12')][_0x003e('0x11')]);}})[_0x003e('0x13')](function(_0x54825e){logger[_0x003e('0xe')](_0x003e('0x10'),_0x4b3be9,_0x54825e);_0x31b6e3(_0x54825e);});});} \ No newline at end of file +var _0x8a92=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../config/utils'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x8a92,0x95));var _0x28a9=function(_0x5aecfc,_0x1908b6){_0x5aecfc=_0x5aecfc-0x0;var _0x13282e=_0x8a92[_0x5aecfc];return _0x13282e;};'use strict';var _=require(_0x28a9('0x0'));var util=require(_0x28a9('0x1'));var moment=require(_0x28a9('0x2'));var BPromise=require(_0x28a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x28a9('0x4'));var logger=require(_0x28a9('0x5'))('rpc');var config=require(_0x28a9('0x6'));var jayson=require(_0x28a9('0x7'));var client=jayson[_0x28a9('0x8')][_0x28a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34cbf6,_0x55b397,_0x25da65){return new BPromise(function(_0x36a44e,_0x1018aa){return client[_0x28a9('0xa')](_0x34cbf6,_0x25da65)[_0x28a9('0xb')](function(_0x2cf075){logger[_0x28a9('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x55b397,_0x28a9('0xd'));logger[_0x28a9('0xe')](_0x28a9('0xf'),_0x55b397,_0x28a9('0xd'),JSON[_0x28a9('0x10')](_0x2cf075));if(_0x2cf075[_0x28a9('0x11')]){if(_0x2cf075[_0x28a9('0x11')][_0x28a9('0x12')]===0x1f4){logger[_0x28a9('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x55b397,_0x2cf075[_0x28a9('0x11')][_0x28a9('0x13')]);return _0x1018aa(_0x2cf075[_0x28a9('0x11')][_0x28a9('0x13')]);}logger[_0x28a9('0x11')](_0x28a9('0x14'),_0x55b397,_0x2cf075[_0x28a9('0x11')][_0x28a9('0x13')]);return _0x36a44e(_0x2cf075[_0x28a9('0x11')][_0x28a9('0x13')]);}else{logger['info'](_0x28a9('0x14'),_0x55b397,_0x28a9('0xd'));_0x36a44e(_0x2cf075[_0x28a9('0x15')][_0x28a9('0x13')]);}})['catch'](function(_0x5b538b){logger[_0x28a9('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x55b397,_0x5b538b);_0x1018aa(_0x5b538b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 0d65bf2..a78a0b1 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 _0xa4a5=['index','get','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa4a5,0x185));var _0x5a4a=function(_0x4d871d,_0x4ae072){_0x4d871d=_0x4d871d-0x0;var _0x4d4144=_0xa4a5[_0x4d871d];return _0x4d4144;};'use strict';var multer=require(_0x5a4a('0x0'));var util=require(_0x5a4a('0x1'));var path=require(_0x5a4a('0x2'));var timeout=require(_0x5a4a('0x3'));var express=require(_0x5a4a('0x4'));var router=express[_0x5a4a('0x5')]();var fs_extra=require(_0x5a4a('0x6'));var auth=require(_0x5a4a('0x7'));var interaction=require(_0x5a4a('0x8'));var config=require(_0x5a4a('0x9'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x5a4a('0xa')](),controller[_0x5a4a('0xb')]);router[_0x5a4a('0xc')]('/:id',auth[_0x5a4a('0xa')](),controller[_0x5a4a('0xd')]);router['post']('/',auth[_0x5a4a('0xa')](),controller[_0x5a4a('0xe')]);router['put'](_0x5a4a('0xf'),auth[_0x5a4a('0xa')](),controller[_0x5a4a('0x10')]);router[_0x5a4a('0x11')](_0x5a4a('0xf'),auth[_0x5a4a('0xa')](),controller[_0x5a4a('0x12')]);module[_0x5a4a('0x13')]=router; \ No newline at end of file +var _0x6fc9=['fs-extra','../../config/environment','./intDynamics365Field.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x5248e0,_0x1e5d0c){var _0x1eb0fd=function(_0x3e769c){while(--_0x3e769c){_0x5248e0['push'](_0x5248e0['shift']());}};_0x1eb0fd(++_0x1e5d0c);}(_0x6fc9,0xc7));var _0x96fc=function(_0x2d0920,_0x56f65f){_0x2d0920=_0x2d0920-0x0;var _0x101421=_0x6fc9[_0x2d0920];return _0x101421;};'use strict';var multer=require(_0x96fc('0x0'));var util=require('util');var path=require(_0x96fc('0x1'));var timeout=require(_0x96fc('0x2'));var express=require(_0x96fc('0x3'));var router=express[_0x96fc('0x4')]();var fs_extra=require(_0x96fc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x96fc('0x6'));var controller=require(_0x96fc('0x7'));router[_0x96fc('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x96fc('0x8')](_0x96fc('0x9'),auth[_0x96fc('0xa')](),controller['show']);router[_0x96fc('0xb')]('/',auth[_0x96fc('0xa')](),controller[_0x96fc('0xc')]);router[_0x96fc('0xd')](_0x96fc('0x9'),auth[_0x96fc('0xa')](),controller[_0x96fc('0xe')]);router[_0x96fc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x96fc('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f9e8f0a..23ea603 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 _0x0ec0=['customVariable','picklist','STRING','string','ENUM','variable'];(function(_0x49d804,_0x32887c){var _0x5d1bb5=function(_0x4737e7){while(--_0x4737e7){_0x49d804['push'](_0x49d804['shift']());}};_0x5d1bb5(++_0x32887c);}(_0x0ec0,0x196));var _0x00ec=function(_0x34ddda,_0x2b9662){_0x34ddda=_0x34ddda-0x0;var _0x287ab0=_0x0ec0[_0x34ddda];return _0x287ab0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x00ec('0x0')]('string',_0x00ec('0x1'),_0x00ec('0x2'),'keyValue',_0x00ec('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x00ec('0x4')]},'keyType':{'type':Sequelize[_0x00ec('0x0')](_0x00ec('0x5'),_0x00ec('0x1'),_0x00ec('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x00ec('0x4')]},'nameField':{'type':Sequelize[_0x00ec('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x00ec('0x4')]}}; \ No newline at end of file +var _0xe196=['variable','customVariable','BOOLEAN','exports','ENUM','keyValue','string','STRING'];(function(_0x236029,_0x5d4c17){var _0x350df5=function(_0x551862){while(--_0x551862){_0x236029['push'](_0x236029['shift']());}};_0x350df5(++_0x5d4c17);}(_0xe196,0x163));var _0x6e19=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe196[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x6e19('0x0')]={'type':{'type':Sequelize[_0x6e19('0x1')]('string','variable','customVariable',_0x6e19('0x2'),'picklist'),'defaultValue':_0x6e19('0x3')},'content':{'type':Sequelize[_0x6e19('0x4')]},'key':{'type':Sequelize[_0x6e19('0x4')]},'keyType':{'type':Sequelize[_0x6e19('0x1')](_0x6e19('0x3'),_0x6e19('0x5'),_0x6e19('0x6'))},'keyContent':{'type':Sequelize[_0x6e19('0x4')]},'idField':{'type':Sequelize[_0x6e19('0x4')]},'nameField':{'type':Sequelize[_0x6e19('0x4')]},'customField':{'type':Sequelize[_0x6e19('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e19('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d2c6772..595e8aa 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 _0xf8e7=['status','end','json','offset','count','limit','set','apply','reject','save','then','sendStatus','error','stack','name','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','update','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1d6317,_0x3ddfcb){var _0x244707=function(_0x3876d2){while(--_0x3876d2){_0x1d6317['push'](_0x1d6317['shift']());}};_0x244707(++_0x3ddfcb);}(_0xf8e7,0x116));var _0x7f8e=function(_0x5daf8f,_0x307436){_0x5daf8f=_0x5daf8f-0x0;var _0x59a139=_0xf8e7[_0x5daf8f];return _0x59a139;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f8e('0x0'));var zipdir=require(_0x7f8e('0x1'));var jsonpatch=require(_0x7f8e('0x2'));var rp=require(_0x7f8e('0x3'));var moment=require(_0x7f8e('0x4'));var BPromise=require(_0x7f8e('0x5'));var Mustache=require(_0x7f8e('0x6'));var util=require(_0x7f8e('0x7'));var path=require(_0x7f8e('0x8'));var sox=require(_0x7f8e('0x9'));var csv=require('to-csv');var ejs=require(_0x7f8e('0xa'));var fs=require('fs');var fs_extra=require(_0x7f8e('0xb'));var _=require(_0x7f8e('0xc'));var squel=require('squel');var crypto=require(_0x7f8e('0xd'));var jsforce=require(_0x7f8e('0xe'));var deskjs=require(_0x7f8e('0xf'));var toCsv=require(_0x7f8e('0x10'));var querystring=require(_0x7f8e('0x11'));var Papa=require(_0x7f8e('0x12'));var Redis=require('ioredis');var authService=require(_0x7f8e('0x13'));var qs=require(_0x7f8e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f8e('0x15'));var logger=require(_0x7f8e('0x16'))('api');var utils=require(_0x7f8e('0x17'));var config=require(_0x7f8e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f8e('0x19'))['db'];function respondWithStatusCode(_0x92af73,_0x765e27){_0x765e27=_0x765e27||0xcc;return function(_0x17a468){if(_0x17a468){return _0x92af73['sendStatus'](_0x765e27);}return _0x92af73[_0x7f8e('0x1a')](_0x765e27)[_0x7f8e('0x1b')]();};}function respondWithResult(_0x34f8fd,_0x166094){_0x166094=_0x166094||0xc8;return function(_0x51be7d){if(_0x51be7d){return _0x34f8fd[_0x7f8e('0x1a')](_0x166094)[_0x7f8e('0x1c')](_0x51be7d);}};}function respondWithFilteredResult(_0x305c05,_0x80d824){return function(_0x113750){if(_0x113750){var _0x46e2ce=typeof _0x80d824[_0x7f8e('0x1d')]==='undefined'&&typeof _0x80d824['limit']==='undefined';var _0x4cef9d=_0x113750[_0x7f8e('0x1e')];var _0x1408cf=_0x46e2ce?0x0:_0x80d824[_0x7f8e('0x1d')];var _0x438ff6=_0x46e2ce?_0x113750['count']:_0x80d824[_0x7f8e('0x1d')]+_0x80d824[_0x7f8e('0x1f')];var _0x51720a;if(_0x438ff6>=_0x4cef9d){_0x438ff6=_0x4cef9d;_0x51720a=0xc8;}else{_0x51720a=0xce;}_0x305c05[_0x7f8e('0x1a')](_0x51720a);return _0x305c05[_0x7f8e('0x20')]('Content-Range',_0x1408cf+'-'+_0x438ff6+'/'+_0x4cef9d)[_0x7f8e('0x1c')](_0x113750);}return null;};}function patchUpdates(_0x32efba){return function(_0x1a51ae){try{jsonpatch[_0x7f8e('0x21')](_0x1a51ae,_0x32efba,!![]);}catch(_0x3478ec){return BPromise[_0x7f8e('0x22')](_0x3478ec);}return _0x1a51ae[_0x7f8e('0x23')]();};}function saveUpdates(_0x3b4798,_0x105349){return function(_0x338c93){if(_0x338c93){return _0x338c93['update'](_0x3b4798)['then'](function(_0x586483){return _0x586483;});}return null;};}function removeEntity(_0x45a266,_0x1dde0c){return function(_0x37867e){if(_0x37867e){return _0x37867e['destroy']()[_0x7f8e('0x24')](function(){_0x45a266['status'](0xcc)[_0x7f8e('0x1b')]();});}};}function handleEntityNotFound(_0x3288c6,_0x3534eb){return function(_0x4db77a){if(!_0x4db77a){_0x3288c6[_0x7f8e('0x25')](0x194);}return _0x4db77a;};}function handleError(_0x4d4c62,_0x4dc47c){_0x4dc47c=_0x4dc47c||0x1f4;return function(_0xf78886){logger[_0x7f8e('0x26')](_0xf78886[_0x7f8e('0x27')]);if(_0xf78886[_0x7f8e('0x28')]){delete _0xf78886[_0x7f8e('0x28')];}_0x4d4c62[_0x7f8e('0x1a')](_0x4dc47c)['send'](_0xf78886);};}exports[_0x7f8e('0x29')]=function(_0x5e9ce1,_0x421909){var _0x26c125={},_0x865da5={},_0x159d09={'count':0x0,'rows':[]};var _0x5b35bc=_[_0x7f8e('0x2a')](db[_0x7f8e('0x2b')][_0x7f8e('0x2c')],function(_0x2fbe12){return{'name':_0x2fbe12[_0x7f8e('0x2d')],'type':_0x2fbe12[_0x7f8e('0x2e')][_0x7f8e('0x2f')]};});_0x865da5[_0x7f8e('0x30')]=_['map'](_0x5b35bc,_0x7f8e('0x28'));_0x865da5[_0x7f8e('0x31')]=_[_0x7f8e('0x32')](_0x5e9ce1[_0x7f8e('0x31')]);_0x865da5[_0x7f8e('0x33')]=_[_0x7f8e('0x34')](_0x865da5[_0x7f8e('0x30')],_0x865da5[_0x7f8e('0x31')]);_0x26c125[_0x7f8e('0x35')]=_['intersection'](_0x865da5[_0x7f8e('0x30')],qs['fields'](_0x5e9ce1[_0x7f8e('0x31')][_0x7f8e('0x36')]));_0x26c125[_0x7f8e('0x35')]=_0x26c125['attributes'][_0x7f8e('0x37')]?_0x26c125['attributes']:_0x865da5[_0x7f8e('0x30')];if(!_0x5e9ce1[_0x7f8e('0x31')][_0x7f8e('0x38')](_0x7f8e('0x39'))){_0x26c125['limit']=qs['limit'](_0x5e9ce1['query']['limit']);_0x26c125[_0x7f8e('0x1d')]=qs[_0x7f8e('0x1d')](_0x5e9ce1['query']['offset']);}_0x26c125[_0x7f8e('0x3a')]=qs[_0x7f8e('0x3b')](_0x5e9ce1[_0x7f8e('0x31')][_0x7f8e('0x3b')]);_0x26c125[_0x7f8e('0x3c')]=qs['filters'](_[_0x7f8e('0x3d')](_0x5e9ce1[_0x7f8e('0x31')],_0x865da5[_0x7f8e('0x33')]),_0x5b35bc);if(_0x5e9ce1[_0x7f8e('0x31')][_0x7f8e('0x3e')]){_0x26c125['where']=_['merge'](_0x26c125['where'],{'$or':_[_0x7f8e('0x2a')](_0x5b35bc,function(_0x53970a){if(_0x53970a[_0x7f8e('0x2e')]!=='VIRTUAL'){var _0xe7f0ce={};_0xe7f0ce[_0x53970a['name']]={'$like':'%'+_0x5e9ce1[_0x7f8e('0x31')][_0x7f8e('0x3e')]+'%'};return _0xe7f0ce;}})});}_0x26c125=_['merge']({},_0x26c125,_0x5e9ce1[_0x7f8e('0x3f')]);var _0x5b8ad0={'where':_0x26c125[_0x7f8e('0x3c')]};return db[_0x7f8e('0x2b')][_0x7f8e('0x1e')](_0x5b8ad0)[_0x7f8e('0x24')](function(_0x53fcba){_0x159d09[_0x7f8e('0x1e')]=_0x53fcba;if(_0x5e9ce1['query'][_0x7f8e('0x40')]){_0x26c125['include']=[{'all':!![]}];}return db[_0x7f8e('0x2b')][_0x7f8e('0x41')](_0x26c125);})['then'](function(_0x56be3d){_0x159d09[_0x7f8e('0x42')]=_0x56be3d;return _0x159d09;})[_0x7f8e('0x24')](respondWithFilteredResult(_0x421909,_0x26c125))[_0x7f8e('0x43')](handleError(_0x421909,null));};exports[_0x7f8e('0x44')]=function(_0x544c62,_0x3edd4f){var _0x380ed0={'raw':!![],'where':{'id':_0x544c62[_0x7f8e('0x45')]['id']}},_0x3478b4={};_0x3478b4[_0x7f8e('0x30')]=_[_0x7f8e('0x32')](db['Dynamics365Field']['rawAttributes']);_0x3478b4[_0x7f8e('0x31')]=_['keys'](_0x544c62[_0x7f8e('0x31')]);_0x3478b4[_0x7f8e('0x33')]=_[_0x7f8e('0x34')](_0x3478b4['model'],_0x3478b4[_0x7f8e('0x31')]);_0x380ed0[_0x7f8e('0x35')]=_['intersection'](_0x3478b4['model'],qs[_0x7f8e('0x36')](_0x544c62[_0x7f8e('0x31')][_0x7f8e('0x36')]));_0x380ed0[_0x7f8e('0x35')]=_0x380ed0['attributes'][_0x7f8e('0x37')]?_0x380ed0[_0x7f8e('0x35')]:_0x3478b4[_0x7f8e('0x30')];if(_0x544c62[_0x7f8e('0x31')][_0x7f8e('0x40')]){_0x380ed0[_0x7f8e('0x46')]=[{'all':!![]}];}_0x380ed0=_[_0x7f8e('0x47')]({},_0x380ed0,_0x544c62[_0x7f8e('0x3f')]);return db[_0x7f8e('0x2b')]['find'](_0x380ed0)[_0x7f8e('0x24')](handleEntityNotFound(_0x3edd4f,null))[_0x7f8e('0x24')](respondWithResult(_0x3edd4f,null))[_0x7f8e('0x43')](handleError(_0x3edd4f,null));};exports['create']=function(_0x4840b2,_0x2fdc22){return db[_0x7f8e('0x2b')]['create'](_0x4840b2['body'],{})[_0x7f8e('0x24')](respondWithResult(_0x2fdc22,0xc9))[_0x7f8e('0x43')](handleError(_0x2fdc22,null));};exports[_0x7f8e('0x48')]=function(_0x47a2aa,_0x61551){if(_0x47a2aa[_0x7f8e('0x49')]['id']){delete _0x47a2aa['body']['id'];}return db[_0x7f8e('0x2b')][_0x7f8e('0x4a')]({'where':{'id':_0x47a2aa[_0x7f8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x61551,null))[_0x7f8e('0x24')](saveUpdates(_0x47a2aa[_0x7f8e('0x49')],null))['then'](respondWithResult(_0x61551,null))['catch'](handleError(_0x61551,null));};exports[_0x7f8e('0x4b')]=function(_0x12a3ee,_0x18d9ea){return db[_0x7f8e('0x2b')][_0x7f8e('0x4a')]({'where':{'id':_0x12a3ee[_0x7f8e('0x45')]['id']}})[_0x7f8e('0x24')](handleEntityNotFound(_0x18d9ea,null))[_0x7f8e('0x24')](removeEntity(_0x18d9ea,null))[_0x7f8e('0x43')](handleError(_0x18d9ea,null));}; \ No newline at end of file +var _0x8c1f=['count','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined'];(function(_0x122f8f,_0x5c3793){var _0x2c7cba=function(_0x22dc07){while(--_0x22dc07){_0x122f8f['push'](_0x122f8f['shift']());}};_0x2c7cba(++_0x5c3793);}(_0x8c1f,0xc0));var _0xf8c1=function(_0x341dd2,_0x5a91ae){_0x341dd2=_0x341dd2-0x0;var _0x12e944=_0x8c1f[_0x341dd2];return _0x12e944;};'use strict';var emlformat=require(_0xf8c1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf8c1('0x1'));var moment=require(_0xf8c1('0x2'));var BPromise=require(_0xf8c1('0x3'));var Mustache=require(_0xf8c1('0x4'));var util=require(_0xf8c1('0x5'));var path=require('path');var sox=require(_0xf8c1('0x6'));var csv=require(_0xf8c1('0x7'));var ejs=require(_0xf8c1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8c1('0x9'));var squel=require(_0xf8c1('0xa'));var crypto=require(_0xf8c1('0xb'));var jsforce=require(_0xf8c1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf8c1('0xd'));var Redis=require('ioredis');var authService=require(_0xf8c1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf8c1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8c1('0x10'))(_0xf8c1('0x11'));var utils=require(_0xf8c1('0x12'));var config=require(_0xf8c1('0x13'));var licenseUtil=require(_0xf8c1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b72ca,_0x3690ec){_0x3690ec=_0x3690ec||0xcc;return function(_0x3cee24){if(_0x3cee24){return _0x5b72ca[_0xf8c1('0x15')](_0x3690ec);}return _0x5b72ca[_0xf8c1('0x16')](_0x3690ec)[_0xf8c1('0x17')]();};}function respondWithResult(_0xb6dc01,_0x29c215){_0x29c215=_0x29c215||0xc8;return function(_0x95c08f){if(_0x95c08f){return _0xb6dc01['status'](_0x29c215)['json'](_0x95c08f);}};}function respondWithFilteredResult(_0x3c9f25,_0x490231){return function(_0x379c34){if(_0x379c34){var _0xdba2f1=typeof _0x490231[_0xf8c1('0x18')]==='undefined'&&typeof _0x490231[_0xf8c1('0x19')]===_0xf8c1('0x1a');var _0x1a80ab=_0x379c34[_0xf8c1('0x1b')];var _0x49cde7=_0xdba2f1?0x0:_0x490231[_0xf8c1('0x18')];var _0x44c0c6=_0xdba2f1?_0x379c34[_0xf8c1('0x1b')]:_0x490231['offset']+_0x490231[_0xf8c1('0x19')];var _0x3a435f;if(_0x44c0c6>=_0x1a80ab){_0x44c0c6=_0x1a80ab;_0x3a435f=0xc8;}else{_0x3a435f=0xce;}_0x3c9f25[_0xf8c1('0x16')](_0x3a435f);return _0x3c9f25['set'](_0xf8c1('0x1c'),_0x49cde7+'-'+_0x44c0c6+'/'+_0x1a80ab)[_0xf8c1('0x1d')](_0x379c34);}return null;};}function patchUpdates(_0x2a4a5f){return function(_0x3adfe8){try{jsonpatch[_0xf8c1('0x1e')](_0x3adfe8,_0x2a4a5f,!![]);}catch(_0x4bfe63){return BPromise['reject'](_0x4bfe63);}return _0x3adfe8[_0xf8c1('0x1f')]();};}function saveUpdates(_0x8c46f8,_0x33a884){return function(_0x489f9e){if(_0x489f9e){return _0x489f9e[_0xf8c1('0x20')](_0x8c46f8)[_0xf8c1('0x21')](function(_0x115776){return _0x115776;});}return null;};}function removeEntity(_0x547f8d,_0x26c390){return function(_0x5c6cad){if(_0x5c6cad){return _0x5c6cad['destroy']()[_0xf8c1('0x21')](function(){_0x547f8d['status'](0xcc)[_0xf8c1('0x17')]();});}};}function handleEntityNotFound(_0x4ab715,_0x5a50b5){return function(_0x244bfe){if(!_0x244bfe){_0x4ab715[_0xf8c1('0x15')](0x194);}return _0x244bfe;};}function handleError(_0x557350,_0x23157f){_0x23157f=_0x23157f||0x1f4;return function(_0x4d9ab2){logger[_0xf8c1('0x22')](_0x4d9ab2[_0xf8c1('0x23')]);if(_0x4d9ab2[_0xf8c1('0x24')]){delete _0x4d9ab2[_0xf8c1('0x24')];}_0x557350[_0xf8c1('0x16')](_0x23157f)[_0xf8c1('0x25')](_0x4d9ab2);};}exports[_0xf8c1('0x26')]=function(_0x22be33,_0x562f0c){var _0x14d925={},_0x244cdb={},_0x22b922={'count':0x0,'rows':[]};var _0x566a8e=_[_0xf8c1('0x27')](db[_0xf8c1('0x28')][_0xf8c1('0x29')],function(_0x922751){return{'name':_0x922751[_0xf8c1('0x2a')],'type':_0x922751['type'][_0xf8c1('0x2b')]};});_0x244cdb[_0xf8c1('0x2c')]=_['map'](_0x566a8e,_0xf8c1('0x24'));_0x244cdb[_0xf8c1('0x2d')]=_['keys'](_0x22be33[_0xf8c1('0x2d')]);_0x244cdb[_0xf8c1('0x2e')]=_[_0xf8c1('0x2f')](_0x244cdb['model'],_0x244cdb[_0xf8c1('0x2d')]);_0x14d925[_0xf8c1('0x30')]=_[_0xf8c1('0x2f')](_0x244cdb['model'],qs[_0xf8c1('0x31')](_0x22be33[_0xf8c1('0x2d')][_0xf8c1('0x31')]));_0x14d925[_0xf8c1('0x30')]=_0x14d925[_0xf8c1('0x30')][_0xf8c1('0x32')]?_0x14d925[_0xf8c1('0x30')]:_0x244cdb[_0xf8c1('0x2c')];if(!_0x22be33[_0xf8c1('0x2d')][_0xf8c1('0x33')](_0xf8c1('0x34'))){_0x14d925[_0xf8c1('0x19')]=qs['limit'](_0x22be33[_0xf8c1('0x2d')][_0xf8c1('0x19')]);_0x14d925['offset']=qs['offset'](_0x22be33[_0xf8c1('0x2d')]['offset']);}_0x14d925[_0xf8c1('0x35')]=qs[_0xf8c1('0x36')](_0x22be33[_0xf8c1('0x2d')][_0xf8c1('0x36')]);_0x14d925[_0xf8c1('0x37')]=qs[_0xf8c1('0x2e')](_[_0xf8c1('0x38')](_0x22be33[_0xf8c1('0x2d')],_0x244cdb[_0xf8c1('0x2e')]),_0x566a8e);if(_0x22be33['query'][_0xf8c1('0x39')]){_0x14d925[_0xf8c1('0x37')]=_['merge'](_0x14d925[_0xf8c1('0x37')],{'$or':_['map'](_0x566a8e,function(_0x30ab0f){if(_0x30ab0f['type']!==_0xf8c1('0x3a')){var _0x463a0f={};_0x463a0f[_0x30ab0f[_0xf8c1('0x24')]]={'$like':'%'+_0x22be33[_0xf8c1('0x2d')][_0xf8c1('0x39')]+'%'};return _0x463a0f;}})});}_0x14d925=_[_0xf8c1('0x3b')]({},_0x14d925,_0x22be33['options']);var _0x318fec={'where':_0x14d925[_0xf8c1('0x37')]};return db[_0xf8c1('0x28')]['count'](_0x318fec)[_0xf8c1('0x21')](function(_0x2d2dc7){_0x22b922[_0xf8c1('0x1b')]=_0x2d2dc7;if(_0x22be33[_0xf8c1('0x2d')][_0xf8c1('0x3c')]){_0x14d925[_0xf8c1('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xf8c1('0x3e')](_0x14d925);})[_0xf8c1('0x21')](function(_0x36012d){_0x22b922[_0xf8c1('0x3f')]=_0x36012d;return _0x22b922;})[_0xf8c1('0x21')](respondWithFilteredResult(_0x562f0c,_0x14d925))[_0xf8c1('0x40')](handleError(_0x562f0c,null));};exports[_0xf8c1('0x41')]=function(_0x3ae529,_0x23e6d1){var _0xb6c0fb={'raw':!![],'where':{'id':_0x3ae529[_0xf8c1('0x42')]['id']}},_0x4c5b19={};_0x4c5b19[_0xf8c1('0x2c')]=_[_0xf8c1('0x43')](db[_0xf8c1('0x28')]['rawAttributes']);_0x4c5b19['query']=_[_0xf8c1('0x43')](_0x3ae529[_0xf8c1('0x2d')]);_0x4c5b19[_0xf8c1('0x2e')]=_[_0xf8c1('0x2f')](_0x4c5b19['model'],_0x4c5b19[_0xf8c1('0x2d')]);_0xb6c0fb[_0xf8c1('0x30')]=_['intersection'](_0x4c5b19[_0xf8c1('0x2c')],qs[_0xf8c1('0x31')](_0x3ae529[_0xf8c1('0x2d')]['fields']));_0xb6c0fb['attributes']=_0xb6c0fb['attributes'][_0xf8c1('0x32')]?_0xb6c0fb[_0xf8c1('0x30')]:_0x4c5b19['model'];if(_0x3ae529[_0xf8c1('0x2d')][_0xf8c1('0x3c')]){_0xb6c0fb[_0xf8c1('0x3d')]=[{'all':!![]}];}_0xb6c0fb=_[_0xf8c1('0x3b')]({},_0xb6c0fb,_0x3ae529[_0xf8c1('0x44')]);return db[_0xf8c1('0x28')][_0xf8c1('0x45')](_0xb6c0fb)[_0xf8c1('0x21')](handleEntityNotFound(_0x23e6d1,null))[_0xf8c1('0x21')](respondWithResult(_0x23e6d1,null))[_0xf8c1('0x40')](handleError(_0x23e6d1,null));};exports[_0xf8c1('0x46')]=function(_0x4492aa,_0x2199f0){return db[_0xf8c1('0x28')][_0xf8c1('0x46')](_0x4492aa[_0xf8c1('0x47')],{})['then'](respondWithResult(_0x2199f0,0xc9))['catch'](handleError(_0x2199f0,null));};exports[_0xf8c1('0x20')]=function(_0x45cc5e,_0x197932){if(_0x45cc5e[_0xf8c1('0x47')]['id']){delete _0x45cc5e[_0xf8c1('0x47')]['id'];}return db['Dynamics365Field'][_0xf8c1('0x45')]({'where':{'id':_0x45cc5e[_0xf8c1('0x42')]['id']}})[_0xf8c1('0x21')](handleEntityNotFound(_0x197932,null))['then'](saveUpdates(_0x45cc5e[_0xf8c1('0x47')],null))[_0xf8c1('0x21')](respondWithResult(_0x197932,null))['catch'](handleError(_0x197932,null));};exports[_0xf8c1('0x48')]=function(_0x12a407,_0x4b8487){return db[_0xf8c1('0x28')][_0xf8c1('0x45')]({'where':{'id':_0x12a407['params']['id']}})[_0xf8c1('0x21')](handleEntityNotFound(_0x4b8487,null))[_0xf8c1('0x21')](removeEntity(_0x4b8487,null))[_0xf8c1('0x40')](handleError(_0x4b8487,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 259cdfc..e71059b 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 _0x93a6=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','dynamics365_unique_index','idField','FieldId','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x93a6,0x137));var _0x693a=function(_0x5795f5,_0xa4aa64){_0x5795f5=_0x5795f5-0x0;var _0x3c6736=_0x93a6[_0x5795f5];return _0x3c6736;};'use strict';var _=require('lodash');var util=require(_0x693a('0x0'));var logger=require('../../config/logger')(_0x693a('0x1'));var moment=require(_0x693a('0x2'));var BPromise=require(_0x693a('0x3'));var rp=require(_0x693a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x693a('0x5'));var config=require(_0x693a('0x6'));var attributes=require(_0x693a('0x7'));module[_0x693a('0x8')]=function(_0x5e8962,_0xcbe100){return _0x5e8962['define'](_0x693a('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x693a('0xa'),'fields':[_0x693a('0xb'),_0x693a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33f6=['exports','define','Dynamics365Field','dynamics365_unique_index','idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x583b3b,_0x31271d){var _0xcdb6d0=function(_0x209dcd){while(--_0x209dcd){_0x583b3b['push'](_0x583b3b['shift']());}};_0xcdb6d0(++_0x31271d);}(_0x33f6,0x1ef));var _0x633f=function(_0x1fb1c2,_0x28c38d){_0x1fb1c2=_0x1fb1c2-0x0;var _0x3037dc=_0x33f6[_0x1fb1c2];return _0x3037dc;};'use strict';var _=require(_0x633f('0x0'));var util=require(_0x633f('0x1'));var logger=require('../../config/logger')(_0x633f('0x2'));var moment=require(_0x633f('0x3'));var BPromise=require(_0x633f('0x4'));var rp=require(_0x633f('0x5'));var fs=require('fs');var path=require(_0x633f('0x6'));var rimraf=require(_0x633f('0x7'));var config=require(_0x633f('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x633f('0x9')]=function(_0x39c65d,_0x190342){return _0x39c65d[_0x633f('0xa')](_0x633f('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x633f('0xc'),'fields':[_0x633f('0xd'),'FieldId'],'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 a66b520..9a70219 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 _0x5109=['client','http','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x284310,_0x570032){var _0x40826d=function(_0x32a578){while(--_0x32a578){_0x284310['push'](_0x284310['shift']());}};_0x40826d(++_0x570032);}(_0x5109,0xfa));var _0x9510=function(_0x441bc0,_0x1c573d){_0x441bc0=_0x441bc0-0x0;var _0x1f34a3=_0x5109[_0x441bc0];return _0x1f34a3;};'use strict';var _=require(_0x9510('0x0'));var util=require(_0x9510('0x1'));var moment=require(_0x9510('0x2'));var BPromise=require(_0x9510('0x3'));var rs=require(_0x9510('0x4'));var fs=require('fs');var Redis=require(_0x9510('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9510('0x6'));var logger=require(_0x9510('0x7'))('rpc');var config=require(_0x9510('0x8'));var jayson=require(_0x9510('0x9'));var client=jayson[_0x9510('0xa')][_0x9510('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11e84a,_0x46bb22,_0x410d0b){return new BPromise(function(_0xd18a32,_0x3be9a8){return client['request'](_0x11e84a,_0x410d0b)['then'](function(_0x22076f){logger[_0x9510('0xc')](_0x9510('0xd'),_0x46bb22,'request\x20sent');logger[_0x9510('0xe')](_0x9510('0xf'),_0x46bb22,_0x9510('0x10'),JSON['stringify'](_0x22076f));if(_0x22076f['error']){if(_0x22076f[_0x9510('0x11')]['code']===0x1f4){logger[_0x9510('0x11')](_0x9510('0xd'),_0x46bb22,_0x22076f['error']['message']);return _0x3be9a8(_0x22076f[_0x9510('0x11')][_0x9510('0x12')]);}logger[_0x9510('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x46bb22,_0x22076f[_0x9510('0x11')]['message']);return _0xd18a32(_0x22076f[_0x9510('0x11')][_0x9510('0x12')]);}else{logger[_0x9510('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x46bb22,_0x9510('0x10'));_0xd18a32(_0x22076f['result']['message']);}})[_0x9510('0x13')](function(_0x4c20e5){logger[_0x9510('0x11')](_0x9510('0xd'),_0x46bb22,_0x4c20e5);_0x3be9a8(_0x4c20e5);});});} \ No newline at end of file +var _0xd86e=['info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then'];(function(_0x598def,_0x547009){var _0x2cf32b=function(_0x1196de){while(--_0x1196de){_0x598def['push'](_0x598def['shift']());}};_0x2cf32b(++_0x547009);}(_0xd86e,0x1c0));var _0xed86=function(_0x5731ec,_0x47096b){_0x5731ec=_0x5731ec-0x0;var _0x3e43cf=_0xd86e[_0x5731ec];return _0x3e43cf;};'use strict';var _=require(_0xed86('0x0'));var util=require(_0xed86('0x1'));var moment=require(_0xed86('0x2'));var BPromise=require(_0xed86('0x3'));var rs=require(_0xed86('0x4'));var fs=require('fs');var Redis=require(_0xed86('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed86('0x6'))(_0xed86('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed86('0x8')][_0xed86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4cf8,_0x297faf,_0xfec29){return new BPromise(function(_0x59364f,_0x4fb4eb){return client[_0xed86('0xa')](_0x3d4cf8,_0xfec29)[_0xed86('0xb')](function(_0xea43f4){logger[_0xed86('0xc')](_0xed86('0xd'),_0x297faf,_0xed86('0xe'));logger[_0xed86('0xf')](_0xed86('0x10'),_0x297faf,'request\x20sent',JSON[_0xed86('0x11')](_0xea43f4));if(_0xea43f4[_0xed86('0x12')]){if(_0xea43f4[_0xed86('0x12')][_0xed86('0x13')]===0x1f4){logger[_0xed86('0x12')](_0xed86('0xd'),_0x297faf,_0xea43f4[_0xed86('0x12')][_0xed86('0x14')]);return _0x4fb4eb(_0xea43f4['error'][_0xed86('0x14')]);}logger[_0xed86('0x12')](_0xed86('0xd'),_0x297faf,_0xea43f4[_0xed86('0x12')][_0xed86('0x14')]);return _0x59364f(_0xea43f4[_0xed86('0x12')][_0xed86('0x14')]);}else{logger[_0xed86('0xc')](_0xed86('0xd'),_0x297faf,'request\x20sent');_0x59364f(_0xea43f4[_0xed86('0x15')]['message']);}})[_0xed86('0x16')](function(_0x1b16b){logger['error'](_0xed86('0xd'),_0x297faf,_0x1b16b);_0x4fb4eb(_0x1b16b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 56ea8b0..56282b5 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 _0x2a71=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x470005,_0x3cf960){var _0x3efb28=function(_0x3453fb){while(--_0x3453fb){_0x470005['push'](_0x470005['shift']());}};_0x3efb28(++_0x3cf960);}(_0x2a71,0xd4));var _0x12a7=function(_0x536869,_0x2128d8){_0x536869=_0x536869-0x0;var _0x2746f3=_0x2a71[_0x536869];return _0x2746f3;};'use strict';var multer=require(_0x12a7('0x0'));var util=require(_0x12a7('0x1'));var path=require(_0x12a7('0x2'));var timeout=require(_0x12a7('0x3'));var express=require('express');var router=express[_0x12a7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x12a7('0x5'));var config=require(_0x12a7('0x6'));var controller=require(_0x12a7('0x7'));router[_0x12a7('0x8')]('/',auth[_0x12a7('0x9')](),controller['index']);router[_0x12a7('0x8')](_0x12a7('0xa'),auth[_0x12a7('0x9')](),controller['show']);router['get'](_0x12a7('0xb'),auth[_0x12a7('0x9')](),controller[_0x12a7('0xc')]);router[_0x12a7('0x8')](_0x12a7('0xd'),auth[_0x12a7('0x9')](),controller[_0x12a7('0xe')]);router[_0x12a7('0xf')]('/',auth[_0x12a7('0x9')](),controller['create']);router['post'](_0x12a7('0xb'),auth[_0x12a7('0x9')](),controller[_0x12a7('0x10')]);router[_0x12a7('0x11')]('/:id',auth[_0x12a7('0x9')](),controller[_0x12a7('0x12')]);router['delete'](_0x12a7('0xa'),auth[_0x12a7('0x9')](),controller[_0x12a7('0x13')]);module[_0x12a7('0x14')]=router; \ No newline at end of file +var _0x3aa4=['post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','create'];(function(_0xc4a608,_0x45fecd){var _0x5e2730=function(_0x38c3c5){while(--_0x38c3c5){_0xc4a608['push'](_0xc4a608['shift']());}};_0x5e2730(++_0x45fecd);}(_0x3aa4,0x1d0));var _0x43aa=function(_0x439da3,_0x373310){_0x439da3=_0x439da3-0x0;var _0x1a7a12=_0x3aa4[_0x439da3];return _0x1a7a12;};'use strict';var multer=require('multer');var util=require(_0x43aa('0x0'));var path=require(_0x43aa('0x1'));var timeout=require(_0x43aa('0x2'));var express=require(_0x43aa('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43aa('0x4'));var interaction=require(_0x43aa('0x5'));var config=require(_0x43aa('0x6'));var controller=require(_0x43aa('0x7'));router[_0x43aa('0x8')]('/',auth['isAuthenticated'](),controller[_0x43aa('0x9')]);router[_0x43aa('0x8')](_0x43aa('0xa'),auth[_0x43aa('0xb')](),controller['show']);router[_0x43aa('0x8')]('/:id/configurations',auth[_0x43aa('0xb')](),controller[_0x43aa('0xc')]);router[_0x43aa('0x8')](_0x43aa('0xd'),auth[_0x43aa('0xb')](),controller[_0x43aa('0xe')]);router['post']('/',auth[_0x43aa('0xb')](),controller[_0x43aa('0xf')]);router[_0x43aa('0x10')](_0x43aa('0x11'),auth[_0x43aa('0xb')](),controller[_0x43aa('0x12')]);router[_0x43aa('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x43aa('0x14')]);router[_0x43aa('0x15')](_0x43aa('0xa'),auth[_0x43aa('0xb')](),controller[_0x43aa('0x16')]);module[_0x43aa('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6b8efc2..af78782 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 _0x1c9a=['sequelize','STRING','username','remoteUri'];(function(_0x5f4333,_0x4d409d){var _0x6cb057=function(_0x3824e5){while(--_0x3824e5){_0x5f4333['push'](_0x5f4333['shift']());}};_0x6cb057(++_0x4d409d);}(_0x1c9a,0x98));var _0xa1c9=function(_0x40a94e,_0x21cbfd){_0x40a94e=_0x40a94e-0x0;var _0x1359c0=_0x1c9a[_0x40a94e];return _0x1359c0;};'use strict';var Sequelize=require(_0xa1c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa1c9('0x1')],'unique':_0xa1c9('0x2')},'apiKey':{'type':Sequelize[_0xa1c9('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa1c9('0x3')},'serverUrl':{'type':Sequelize[_0xa1c9('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x28901a,_0x205175){var _0x2ac0f8=function(_0x28ee75){while(--_0x28ee75){_0x28901a['push'](_0x28901a['shift']());}};_0x2ac0f8(++_0x205175);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('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 16a5306..19df074 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 _0xbf5c=['stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','catch','show','params','length','includeAll','find','create','body','update','FreshdeskConfiguration','getConfigurations','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','findOne','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','%s:X','toString','agent','description','priority','group','ticket_type','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','then','destroy','error'];(function(_0x2a5465,_0x3abb56){var _0x1184be=function(_0x15b506){while(--_0x15b506){_0x2a5465['push'](_0x2a5465['shift']());}};_0x1184be(++_0x3abb56);}(_0xbf5c,0xb8));var _0xcbf5=function(_0xdd21ef,_0x3bbb32){_0xdd21ef=_0xdd21ef-0x0;var _0x14ab4e=_0xbf5c[_0xdd21ef];return _0x14ab4e;};'use strict';var emlformat=require(_0xcbf5('0x0'));var rimraf=require(_0xcbf5('0x1'));var zipdir=require(_0xcbf5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbf5('0x3'));var moment=require(_0xcbf5('0x4'));var BPromise=require(_0xcbf5('0x5'));var Mustache=require('mustache');var util=require(_0xcbf5('0x6'));var path=require(_0xcbf5('0x7'));var sox=require('sox');var csv=require(_0xcbf5('0x8'));var ejs=require(_0xcbf5('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf5('0xa'));var _=require('lodash');var squel=require(_0xcbf5('0xb'));var crypto=require(_0xcbf5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbf5('0x8'));var querystring=require(_0xcbf5('0xd'));var Papa=require(_0xcbf5('0xe'));var Redis=require('ioredis');var authService=require(_0xcbf5('0xf'));var qs=require(_0xcbf5('0x10'));var as=require(_0xcbf5('0x11'));var hardwareService=require(_0xcbf5('0x12'));var logger=require(_0xcbf5('0x13'))(_0xcbf5('0x14'));var utils=require('../../config/utils');var config=require(_0xcbf5('0x15'));var licenseUtil=require(_0xcbf5('0x16'));var db=require(_0xcbf5('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e5307,_0x18c2fe){_0x18c2fe=_0x18c2fe||0xcc;return function(_0x528e7c){if(_0x528e7c){return _0x5e5307[_0xcbf5('0x18')](_0x18c2fe);}return _0x5e5307[_0xcbf5('0x19')](_0x18c2fe)[_0xcbf5('0x1a')]();};}function respondWithResult(_0x2e7536,_0x51b1d2){_0x51b1d2=_0x51b1d2||0xc8;return function(_0x48ad3c){if(_0x48ad3c){return _0x2e7536[_0xcbf5('0x19')](_0x51b1d2)['json'](_0x48ad3c);}};}function respondWithFilteredResult(_0x2c58ba,_0x5348ce){return function(_0x4fc535){if(_0x4fc535){var _0x3024ea=typeof _0x5348ce[_0xcbf5('0x1b')]===_0xcbf5('0x1c')&&typeof _0x5348ce[_0xcbf5('0x1d')]===_0xcbf5('0x1c');var _0x4048cf=_0x4fc535[_0xcbf5('0x1e')];var _0x53939d=_0x3024ea?0x0:_0x5348ce[_0xcbf5('0x1b')];var _0x10d573=_0x3024ea?_0x4fc535[_0xcbf5('0x1e')]:_0x5348ce[_0xcbf5('0x1b')]+_0x5348ce[_0xcbf5('0x1d')];var _0x3b3022;if(_0x10d573>=_0x4048cf){_0x10d573=_0x4048cf;_0x3b3022=0xc8;}else{_0x3b3022=0xce;}_0x2c58ba[_0xcbf5('0x19')](_0x3b3022);return _0x2c58ba[_0xcbf5('0x1f')]('Content-Range',_0x53939d+'-'+_0x10d573+'/'+_0x4048cf)[_0xcbf5('0x20')](_0x4fc535);}return null;};}function patchUpdates(_0x4e8874){return function(_0x297b86){try{jsonpatch['apply'](_0x297b86,_0x4e8874,!![]);}catch(_0x9f5e81){return BPromise[_0xcbf5('0x21')](_0x9f5e81);}return _0x297b86[_0xcbf5('0x22')]();};}function saveUpdates(_0xf2360,_0x3e9548){return function(_0x278f30){if(_0x278f30){return _0x278f30['update'](_0xf2360)[_0xcbf5('0x23')](function(_0x5602fd){return _0x5602fd;});}return null;};}function removeEntity(_0x965482,_0x1b59d4){return function(_0x26477c){if(_0x26477c){return _0x26477c[_0xcbf5('0x24')]()['then'](function(){_0x965482[_0xcbf5('0x19')](0xcc)[_0xcbf5('0x1a')]();});}};}function handleEntityNotFound(_0x2aa7c,_0x41d465){return function(_0x1a2635){if(!_0x1a2635){_0x2aa7c[_0xcbf5('0x18')](0x194);}return _0x1a2635;};}function handleError(_0x149b61,_0xe6742){_0xe6742=_0xe6742||0x1f4;return function(_0x5e2f8e){logger[_0xcbf5('0x25')](_0x5e2f8e[_0xcbf5('0x26')]);if(_0x5e2f8e[_0xcbf5('0x27')]){delete _0x5e2f8e[_0xcbf5('0x27')];}_0x149b61[_0xcbf5('0x19')](_0xe6742)['send'](_0x5e2f8e);};}exports[_0xcbf5('0x28')]=function(_0x367eb0,_0x9ce00){var _0x3389a1={},_0x14e61d={},_0x13024d={'count':0x0,'rows':[]};var _0x4b22f3=_[_0xcbf5('0x29')](db[_0xcbf5('0x2a')][_0xcbf5('0x2b')],function(_0xa56ec3){return{'name':_0xa56ec3[_0xcbf5('0x2c')],'type':_0xa56ec3[_0xcbf5('0x2d')][_0xcbf5('0x2e')]};});_0x14e61d['model']=_['map'](_0x4b22f3,_0xcbf5('0x27'));_0x14e61d['query']=_[_0xcbf5('0x2f')](_0x367eb0[_0xcbf5('0x30')]);_0x14e61d[_0xcbf5('0x31')]=_[_0xcbf5('0x32')](_0x14e61d[_0xcbf5('0x33')],_0x14e61d['query']);_0x3389a1['attributes']=_[_0xcbf5('0x32')](_0x14e61d[_0xcbf5('0x33')],qs[_0xcbf5('0x34')](_0x367eb0[_0xcbf5('0x30')][_0xcbf5('0x34')]));_0x3389a1[_0xcbf5('0x35')]=_0x3389a1[_0xcbf5('0x35')]['length']?_0x3389a1[_0xcbf5('0x35')]:_0x14e61d[_0xcbf5('0x33')];if(!_0x367eb0[_0xcbf5('0x30')][_0xcbf5('0x36')]('nolimit')){_0x3389a1[_0xcbf5('0x1d')]=qs[_0xcbf5('0x1d')](_0x367eb0['query'][_0xcbf5('0x1d')]);_0x3389a1[_0xcbf5('0x1b')]=qs['offset'](_0x367eb0['query'][_0xcbf5('0x1b')]);}_0x3389a1[_0xcbf5('0x37')]=qs[_0xcbf5('0x38')](_0x367eb0[_0xcbf5('0x30')]['sort']);_0x3389a1[_0xcbf5('0x39')]=qs[_0xcbf5('0x31')](_[_0xcbf5('0x3a')](_0x367eb0[_0xcbf5('0x30')],_0x14e61d['filters']),_0x4b22f3);if(_0x367eb0[_0xcbf5('0x30')][_0xcbf5('0x3b')]){_0x3389a1['where']=_['merge'](_0x3389a1[_0xcbf5('0x39')],{'$or':_[_0xcbf5('0x29')](_0x4b22f3,function(_0x4cbcf8){if(_0x4cbcf8[_0xcbf5('0x2d')]!==_0xcbf5('0x3c')){var _0x2b318c={};_0x2b318c[_0x4cbcf8[_0xcbf5('0x27')]]={'$like':'%'+_0x367eb0[_0xcbf5('0x30')]['filter']+'%'};return _0x2b318c;}})});}_0x3389a1=_[_0xcbf5('0x3d')]({},_0x3389a1,_0x367eb0[_0xcbf5('0x3e')]);var _0x5d1d96={'where':_0x3389a1[_0xcbf5('0x39')]};return db['FreshdeskAccount'][_0xcbf5('0x1e')](_0x5d1d96)['then'](function(_0xbbddc9){_0x13024d[_0xcbf5('0x1e')]=_0xbbddc9;if(_0x367eb0[_0xcbf5('0x30')]['includeAll']){_0x3389a1[_0xcbf5('0x3f')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x3389a1);})['then'](function(_0x3b1847){_0x13024d['rows']=_0x3b1847;return _0x13024d;})['then'](respondWithFilteredResult(_0x9ce00,_0x3389a1))[_0xcbf5('0x40')](handleError(_0x9ce00,null));};exports[_0xcbf5('0x41')]=function(_0x4c106a,_0x222020){var _0x4df47d={'raw':![],'where':{'id':_0x4c106a[_0xcbf5('0x42')]['id']}},_0x3c1fb9={};_0x3c1fb9[_0xcbf5('0x33')]=_[_0xcbf5('0x2f')](db[_0xcbf5('0x2a')][_0xcbf5('0x2b')]);_0x3c1fb9[_0xcbf5('0x30')]=_['keys'](_0x4c106a['query']);_0x3c1fb9['filters']=_[_0xcbf5('0x32')](_0x3c1fb9['model'],_0x3c1fb9[_0xcbf5('0x30')]);_0x4df47d[_0xcbf5('0x35')]=_[_0xcbf5('0x32')](_0x3c1fb9[_0xcbf5('0x33')],qs[_0xcbf5('0x34')](_0x4c106a[_0xcbf5('0x30')][_0xcbf5('0x34')]));_0x4df47d[_0xcbf5('0x35')]=_0x4df47d[_0xcbf5('0x35')][_0xcbf5('0x43')]?_0x4df47d[_0xcbf5('0x35')]:_0x3c1fb9[_0xcbf5('0x33')];if(_0x4c106a[_0xcbf5('0x30')][_0xcbf5('0x44')]){_0x4df47d['include']=[{'all':!![]}];}_0x4df47d=_[_0xcbf5('0x3d')]({},_0x4df47d,_0x4c106a['options']);return db[_0xcbf5('0x2a')][_0xcbf5('0x45')](_0x4df47d)[_0xcbf5('0x23')](handleEntityNotFound(_0x222020,null))[_0xcbf5('0x23')](respondWithResult(_0x222020,null))[_0xcbf5('0x40')](handleError(_0x222020,null));};exports[_0xcbf5('0x46')]=function(_0x3f4020,_0x3db994){return db['FreshdeskAccount']['create'](_0x3f4020[_0xcbf5('0x47')],{})['then'](respondWithResult(_0x3db994,0xc9))['catch'](handleError(_0x3db994,null));};exports[_0xcbf5('0x48')]=function(_0xddb159,_0x372c5d){if(_0xddb159['body']['id']){delete _0xddb159[_0xcbf5('0x47')]['id'];}return db['FreshdeskAccount'][_0xcbf5('0x45')]({'where':{'id':_0xddb159['params']['id']}})[_0xcbf5('0x23')](handleEntityNotFound(_0x372c5d,null))[_0xcbf5('0x23')](saveUpdates(_0xddb159[_0xcbf5('0x47')],null))[_0xcbf5('0x23')](respondWithResult(_0x372c5d,null))[_0xcbf5('0x40')](handleError(_0x372c5d,null));};exports['destroy']=function(_0x36046d,_0xeac2e5){return db[_0xcbf5('0x2a')][_0xcbf5('0x45')]({'where':{'id':_0x36046d['params']['id']}})[_0xcbf5('0x23')](handleEntityNotFound(_0xeac2e5,null))['then'](removeEntity(_0xeac2e5,null))['catch'](handleError(_0xeac2e5,null));};exports['getConfigurations']=function(_0x5c8951,_0x30c38c,_0x5ee439){var _0x1d07e2={};var _0x329536={};var _0x5ada8c;var _0x6c7c11;return db[_0xcbf5('0x2a')]['findOne']({'where':{'id':_0x5c8951[_0xcbf5('0x42')]['id']}})[_0xcbf5('0x23')](handleEntityNotFound(_0x30c38c,null))[_0xcbf5('0x23')](function(_0x5322a6){if(_0x5322a6){_0x5ada8c=_0x5322a6;_0x329536[_0xcbf5('0x33')]=_[_0xcbf5('0x2f')](db[_0xcbf5('0x49')]['rawAttributes']);_0x329536[_0xcbf5('0x30')]=_[_0xcbf5('0x2f')](_0x5c8951['query']);_0x329536[_0xcbf5('0x31')]=_[_0xcbf5('0x32')](_0x329536[_0xcbf5('0x33')],_0x329536[_0xcbf5('0x30')]);_0x1d07e2[_0xcbf5('0x35')]=_['intersection'](_0x329536['model'],qs[_0xcbf5('0x34')](_0x5c8951['query'][_0xcbf5('0x34')]));_0x1d07e2['attributes']=_0x1d07e2[_0xcbf5('0x35')][_0xcbf5('0x43')]?_0x1d07e2['attributes']:_0x329536[_0xcbf5('0x33')];_0x1d07e2[_0xcbf5('0x37')]=qs['sort'](_0x5c8951[_0xcbf5('0x30')]['sort']);_0x1d07e2[_0xcbf5('0x39')]=qs[_0xcbf5('0x31')](_[_0xcbf5('0x3a')](_0x5c8951['query'],_0x329536['filters']));if(_0x5c8951[_0xcbf5('0x30')][_0xcbf5('0x3b')]){_0x1d07e2[_0xcbf5('0x39')]=_[_0xcbf5('0x3d')](_0x1d07e2[_0xcbf5('0x39')],{'$or':_[_0xcbf5('0x29')](_0x1d07e2[_0xcbf5('0x35')],function(_0x5a6c91){var _0x592572={};_0x592572[_0x5a6c91]={'$like':'%'+_0x5c8951[_0xcbf5('0x30')][_0xcbf5('0x3b')]+'%'};return _0x592572;})});}_0x1d07e2=_[_0xcbf5('0x3d')]({},_0x1d07e2,_0x5c8951[_0xcbf5('0x3e')]);return _0x5ada8c[_0xcbf5('0x4a')](_0x1d07e2);}})[_0xcbf5('0x23')](function(_0x252bb1){if(_0x252bb1){_0x6c7c11=_0x252bb1[_0xcbf5('0x43')];if(!_0x5c8951[_0xcbf5('0x30')][_0xcbf5('0x36')](_0xcbf5('0x4b'))){_0x1d07e2['limit']=qs['limit'](_0x5c8951['query'][_0xcbf5('0x1d')]);_0x1d07e2['offset']=qs['offset'](_0x5c8951['query'][_0xcbf5('0x1b')]);}return _0x5ada8c[_0xcbf5('0x4a')](_0x1d07e2);}})['then'](function(_0x1beffc){if(_0x1beffc){return _0x1beffc?{'count':_0x6c7c11,'rows':_0x1beffc}:null;}})[_0xcbf5('0x23')](respondWithResult(_0x30c38c,null))[_0xcbf5('0x40')](handleError(_0x30c38c,null));};exports['addConfiguration']=function(_0x435de8,_0x3a4bd7,_0x48ddc4){if(_0x435de8[_0xcbf5('0x47')]['id']){delete _0x435de8[_0xcbf5('0x47')]['id'];}return db[_0xcbf5('0x2a')]['findOne']({'where':{'id':_0x435de8['params']['id']}})[_0xcbf5('0x23')](handleEntityNotFound(_0x3a4bd7,null))['then'](function(_0x24e832){if(_0x24e832){_0x435de8[_0xcbf5('0x47')][_0xcbf5('0x4c')]=_0x24e832['id'];_0x435de8['body'][_0xcbf5('0x4d')]=integrations['getSubjects'](_0x435de8[_0xcbf5('0x47')][_0xcbf5('0x4e')],_0x435de8['body'][_0xcbf5('0x2d')]);_0x435de8['body'][_0xcbf5('0x4f')]=integrations[_0xcbf5('0x50')](_0x435de8['body'][_0xcbf5('0x4e')],_0x435de8[_0xcbf5('0x47')][_0xcbf5('0x2d')]);return db['FreshdeskConfiguration'][_0xcbf5('0x46')](_0x435de8[_0xcbf5('0x47')],{'include':[{'model':db[_0xcbf5('0x51')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0xcbf5('0x23')](respondWithResult(_0x3a4bd7,null))[_0xcbf5('0x40')](handleError(_0x3a4bd7,null));};exports['getFields']=function(_0x457081,_0x13d744,_0x5da189){var _0x41389e='';return db[_0xcbf5('0x2a')][_0xcbf5('0x52')]({'where':{'id':_0x457081['params']['id']},'attributes':['id',_0xcbf5('0x53'),_0xcbf5('0x54')]})[_0xcbf5('0x23')](handleEntityNotFound(_0x13d744,null))['then'](function(_0x10f6a5){if(_0x10f6a5){_0x41389e=_0x10f6a5['remoteUri'];var _0x2758a4=_0x41389e[_0xcbf5('0x55')](-0x1);if(_0x2758a4==='/'){_0x41389e=_0x41389e[_0xcbf5('0x56')](0x0,_0x41389e[_0xcbf5('0x57')](_0x2758a4));}return rp({'method':'GET','uri':util[_0xcbf5('0x58')](_0xcbf5('0x59'),_0x41389e,_0xcbf5('0x5a')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xcbf5('0x5b'),_0x10f6a5[_0xcbf5('0x54')]))[_0xcbf5('0x5c')]('base64'))},'json':!![]});}})[_0xcbf5('0x23')](function(_0x5d2323){if(_0x5d2323){var _0xb46cc5=['requester','subject',_0xcbf5('0x5d'),_0xcbf5('0x5e'),_0xcbf5('0x19'),_0xcbf5('0x5f'),_0xcbf5('0x60'),'source',_0xcbf5('0x61'),_0xcbf5('0x60'),'company'];_[_0xcbf5('0x62')](_0x5d2323,function(_0x50e8c3){return _0xb46cc5[_0xcbf5('0x63')](_0x50e8c3[_0xcbf5('0x27')])||!_0x50e8c3[_0xcbf5('0x64')]&&_0x50e8c3['type']!=='custom_text'&&_0x50e8c3['type']!==_0xcbf5('0x65');});return{'count':_0x5d2323['length'],'rows':_[_0xcbf5('0x29')](_0x5d2323,function(_0x3aef82){return{'id':_0x3aef82['name'],'name':_0x3aef82[_0xcbf5('0x66')],'custom':!_0x3aef82[_0xcbf5('0x64')],'options':_0x3aef82[_0xcbf5('0x67')]?_[_0xcbf5('0x29')](_0x3aef82[_0xcbf5('0x67')],function(_0x39108a){return{'name':_[_0xcbf5('0x68')](_0x39108a),'value':_0x39108a};}):[]};})};}})['then'](respondWithResult(_0x13d744,null))[_0xcbf5('0x40')](function(_0x30969d){var _0x1a86df=_0x457081[_0xcbf5('0x30')][_0xcbf5('0x69')]?0x1f4:_0x30969d[_0xcbf5('0x6a')]||0x1f4;logger[_0xcbf5('0x25')](_0xcbf5('0x6b'),'getFields',_0x1a86df,JSON[_0xcbf5('0x6c')](_0x30969d));delete _0x30969d['name'];if(_0x1a86df===0x191){_0x1a86df=0x190;}_0x13d744['status'](_0x1a86df)[_0xcbf5('0x6d')](_0x457081[_0xcbf5('0x30')]['test']?{'message':_0xcbf5('0x6e'),'statusCode':_0x30969d[_0xcbf5('0x6a')]}:_0x30969d);});}; \ No newline at end of file +var _0x8a9d=['getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','description','group','source','ticket_type','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','rows','show','keys','includeAll','find','catch','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0x12781b,_0x2b8cc9){var _0x4e0329=function(_0x1d601b){while(--_0x1d601b){_0x12781b['push'](_0x12781b['shift']());}};_0x4e0329(++_0x2b8cc9);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x8a9d[_0x107f10];return _0x811cab;};'use strict';var emlformat=require(_0xd8a9('0x0'));var rimraf=require(_0xd8a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8a9('0x2'));var rp=require(_0xd8a9('0x3'));var moment=require('moment');var BPromise=require(_0xd8a9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8a9('0x5'));var sox=require(_0xd8a9('0x6'));var csv=require(_0xd8a9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8a9('0x8'));var _=require(_0xd8a9('0x9'));var squel=require(_0xd8a9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd8a9('0xb'));var toCsv=require(_0xd8a9('0x7'));var querystring=require('querystring');var Papa=require(_0xd8a9('0xc'));var Redis=require(_0xd8a9('0xd'));var authService=require(_0xd8a9('0xe'));var qs=require(_0xd8a9('0xf'));var as=require(_0xd8a9('0x10'));var hardwareService=require(_0xd8a9('0x11'));var logger=require(_0xd8a9('0x12'))(_0xd8a9('0x13'));var utils=require(_0xd8a9('0x14'));var config=require(_0xd8a9('0x15'));var licenseUtil=require(_0xd8a9('0x16'));var db=require(_0xd8a9('0x17'))['db'];var integrations=require(_0xd8a9('0x18'));function respondWithStatusCode(_0x87c04e,_0x281f47){_0x281f47=_0x281f47||0xcc;return function(_0x46998e){if(_0x46998e){return _0x87c04e['sendStatus'](_0x281f47);}return _0x87c04e[_0xd8a9('0x19')](_0x281f47)['end']();};}function respondWithResult(_0x46cf9d,_0x34a7ee){_0x34a7ee=_0x34a7ee||0xc8;return function(_0x33cec4){if(_0x33cec4){return _0x46cf9d['status'](_0x34a7ee)['json'](_0x33cec4);}};}function respondWithFilteredResult(_0x32fefd,_0x5ef067){return function(_0x1db97b){if(_0x1db97b){var _0x379eb0=typeof _0x5ef067[_0xd8a9('0x1a')]===_0xd8a9('0x1b')&&typeof _0x5ef067['limit']===_0xd8a9('0x1b');var _0x230092=_0x1db97b[_0xd8a9('0x1c')];var _0x486e61=_0x379eb0?0x0:_0x5ef067[_0xd8a9('0x1a')];var _0x3d6dc3=_0x379eb0?_0x1db97b[_0xd8a9('0x1c')]:_0x5ef067[_0xd8a9('0x1a')]+_0x5ef067[_0xd8a9('0x1d')];var _0x371aae;if(_0x3d6dc3>=_0x230092){_0x3d6dc3=_0x230092;_0x371aae=0xc8;}else{_0x371aae=0xce;}_0x32fefd[_0xd8a9('0x19')](_0x371aae);return _0x32fefd[_0xd8a9('0x1e')](_0xd8a9('0x1f'),_0x486e61+'-'+_0x3d6dc3+'/'+_0x230092)[_0xd8a9('0x20')](_0x1db97b);}return null;};}function patchUpdates(_0x53907e){return function(_0x20d58c){try{jsonpatch[_0xd8a9('0x21')](_0x20d58c,_0x53907e,!![]);}catch(_0x17af6d){return BPromise[_0xd8a9('0x22')](_0x17af6d);}return _0x20d58c[_0xd8a9('0x23')]();};}function saveUpdates(_0x4eba54,_0xff2b6e){return function(_0x385663){if(_0x385663){return _0x385663[_0xd8a9('0x24')](_0x4eba54)[_0xd8a9('0x25')](function(_0x4abe9a){return _0x4abe9a;});}return null;};}function removeEntity(_0x49d57a,_0x4ae351){return function(_0x5ddb32){if(_0x5ddb32){return _0x5ddb32[_0xd8a9('0x26')]()[_0xd8a9('0x25')](function(){_0x49d57a[_0xd8a9('0x19')](0xcc)[_0xd8a9('0x27')]();});}};}function handleEntityNotFound(_0x442c96,_0x1de15d){return function(_0xf7237){if(!_0xf7237){_0x442c96[_0xd8a9('0x28')](0x194);}return _0xf7237;};}function handleError(_0x2b4102,_0x598457){_0x598457=_0x598457||0x1f4;return function(_0x582dd8){logger[_0xd8a9('0x29')](_0x582dd8[_0xd8a9('0x2a')]);if(_0x582dd8[_0xd8a9('0x2b')]){delete _0x582dd8['name'];}_0x2b4102[_0xd8a9('0x19')](_0x598457)[_0xd8a9('0x2c')](_0x582dd8);};}exports[_0xd8a9('0x2d')]=function(_0x419ebe,_0x1bb98f){var _0x3563e2={},_0x52ea4d={},_0x78fe4a={'count':0x0,'rows':[]};var _0x51fa43=_[_0xd8a9('0x2e')](db[_0xd8a9('0x2f')][_0xd8a9('0x30')],function(_0xd55c36){return{'name':_0xd55c36[_0xd8a9('0x31')],'type':_0xd55c36[_0xd8a9('0x32')][_0xd8a9('0x33')]};});_0x52ea4d[_0xd8a9('0x34')]=_['map'](_0x51fa43,_0xd8a9('0x2b'));_0x52ea4d['query']=_['keys'](_0x419ebe[_0xd8a9('0x35')]);_0x52ea4d[_0xd8a9('0x36')]=_[_0xd8a9('0x37')](_0x52ea4d['model'],_0x52ea4d[_0xd8a9('0x35')]);_0x3563e2[_0xd8a9('0x38')]=_[_0xd8a9('0x37')](_0x52ea4d[_0xd8a9('0x34')],qs[_0xd8a9('0x39')](_0x419ebe['query'][_0xd8a9('0x39')]));_0x3563e2[_0xd8a9('0x38')]=_0x3563e2['attributes'][_0xd8a9('0x3a')]?_0x3563e2[_0xd8a9('0x38')]:_0x52ea4d[_0xd8a9('0x34')];if(!_0x419ebe[_0xd8a9('0x35')][_0xd8a9('0x3b')](_0xd8a9('0x3c'))){_0x3563e2[_0xd8a9('0x1d')]=qs[_0xd8a9('0x1d')](_0x419ebe[_0xd8a9('0x35')][_0xd8a9('0x1d')]);_0x3563e2['offset']=qs[_0xd8a9('0x1a')](_0x419ebe[_0xd8a9('0x35')]['offset']);}_0x3563e2[_0xd8a9('0x3d')]=qs[_0xd8a9('0x3e')](_0x419ebe[_0xd8a9('0x35')][_0xd8a9('0x3e')]);_0x3563e2['where']=qs['filters'](_[_0xd8a9('0x3f')](_0x419ebe[_0xd8a9('0x35')],_0x52ea4d[_0xd8a9('0x36')]),_0x51fa43);if(_0x419ebe[_0xd8a9('0x35')][_0xd8a9('0x40')]){_0x3563e2[_0xd8a9('0x41')]=_[_0xd8a9('0x42')](_0x3563e2[_0xd8a9('0x41')],{'$or':_['map'](_0x51fa43,function(_0x27f83a){if(_0x27f83a[_0xd8a9('0x32')]!=='VIRTUAL'){var _0x2465d3={};_0x2465d3[_0x27f83a[_0xd8a9('0x2b')]]={'$like':'%'+_0x419ebe[_0xd8a9('0x35')][_0xd8a9('0x40')]+'%'};return _0x2465d3;}})});}_0x3563e2=_[_0xd8a9('0x42')]({},_0x3563e2,_0x419ebe[_0xd8a9('0x43')]);var _0x4b9f30={'where':_0x3563e2[_0xd8a9('0x41')]};return db[_0xd8a9('0x2f')][_0xd8a9('0x1c')](_0x4b9f30)['then'](function(_0x1b8b1d){_0x78fe4a[_0xd8a9('0x1c')]=_0x1b8b1d;if(_0x419ebe[_0xd8a9('0x35')]['includeAll']){_0x3563e2[_0xd8a9('0x44')]=[{'all':!![]}];}return db[_0xd8a9('0x2f')]['findAll'](_0x3563e2);})['then'](function(_0x421571){_0x78fe4a[_0xd8a9('0x45')]=_0x421571;return _0x78fe4a;})[_0xd8a9('0x25')](respondWithFilteredResult(_0x1bb98f,_0x3563e2))['catch'](handleError(_0x1bb98f,null));};exports[_0xd8a9('0x46')]=function(_0x5d3469,_0x53ac26){var _0x5e3076={'raw':![],'where':{'id':_0x5d3469['params']['id']}},_0x51fb42={};_0x51fb42['model']=_[_0xd8a9('0x47')](db['FreshdeskAccount'][_0xd8a9('0x30')]);_0x51fb42[_0xd8a9('0x35')]=_[_0xd8a9('0x47')](_0x5d3469[_0xd8a9('0x35')]);_0x51fb42['filters']=_[_0xd8a9('0x37')](_0x51fb42['model'],_0x51fb42[_0xd8a9('0x35')]);_0x5e3076[_0xd8a9('0x38')]=_[_0xd8a9('0x37')](_0x51fb42[_0xd8a9('0x34')],qs[_0xd8a9('0x39')](_0x5d3469[_0xd8a9('0x35')][_0xd8a9('0x39')]));_0x5e3076[_0xd8a9('0x38')]=_0x5e3076['attributes']['length']?_0x5e3076[_0xd8a9('0x38')]:_0x51fb42[_0xd8a9('0x34')];if(_0x5d3469[_0xd8a9('0x35')][_0xd8a9('0x48')]){_0x5e3076[_0xd8a9('0x44')]=[{'all':!![]}];}_0x5e3076=_[_0xd8a9('0x42')]({},_0x5e3076,_0x5d3469['options']);return db['FreshdeskAccount'][_0xd8a9('0x49')](_0x5e3076)['then'](handleEntityNotFound(_0x53ac26,null))[_0xd8a9('0x25')](respondWithResult(_0x53ac26,null))[_0xd8a9('0x4a')](handleError(_0x53ac26,null));};exports[_0xd8a9('0x4b')]=function(_0x3baacf,_0x1c7fab){return db[_0xd8a9('0x2f')][_0xd8a9('0x4b')](_0x3baacf[_0xd8a9('0x4c')],{})[_0xd8a9('0x25')](respondWithResult(_0x1c7fab,0xc9))['catch'](handleError(_0x1c7fab,null));};exports[_0xd8a9('0x24')]=function(_0x5c502e,_0x38ab66){if(_0x5c502e[_0xd8a9('0x4c')]['id']){delete _0x5c502e['body']['id'];}return db[_0xd8a9('0x2f')]['find']({'where':{'id':_0x5c502e[_0xd8a9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38ab66,null))[_0xd8a9('0x25')](saveUpdates(_0x5c502e[_0xd8a9('0x4c')],null))['then'](respondWithResult(_0x38ab66,null))[_0xd8a9('0x4a')](handleError(_0x38ab66,null));};exports['destroy']=function(_0x257a7c,_0x3346a4){return db[_0xd8a9('0x2f')]['find']({'where':{'id':_0x257a7c[_0xd8a9('0x4d')]['id']}})[_0xd8a9('0x25')](handleEntityNotFound(_0x3346a4,null))[_0xd8a9('0x25')](removeEntity(_0x3346a4,null))['catch'](handleError(_0x3346a4,null));};exports[_0xd8a9('0x4e')]=function(_0x58ae38,_0x57f6f0,_0x5307c6){var _0x361f13={};var _0x59f0f7={};var _0x40fcd3;var _0x255854;return db[_0xd8a9('0x2f')][_0xd8a9('0x4f')]({'where':{'id':_0x58ae38[_0xd8a9('0x4d')]['id']}})[_0xd8a9('0x25')](handleEntityNotFound(_0x57f6f0,null))[_0xd8a9('0x25')](function(_0x19b4ab){if(_0x19b4ab){_0x40fcd3=_0x19b4ab;_0x59f0f7['model']=_[_0xd8a9('0x47')](db[_0xd8a9('0x50')][_0xd8a9('0x30')]);_0x59f0f7['query']=_[_0xd8a9('0x47')](_0x58ae38[_0xd8a9('0x35')]);_0x59f0f7[_0xd8a9('0x36')]=_['intersection'](_0x59f0f7[_0xd8a9('0x34')],_0x59f0f7[_0xd8a9('0x35')]);_0x361f13[_0xd8a9('0x38')]=_[_0xd8a9('0x37')](_0x59f0f7[_0xd8a9('0x34')],qs[_0xd8a9('0x39')](_0x58ae38[_0xd8a9('0x35')][_0xd8a9('0x39')]));_0x361f13['attributes']=_0x361f13[_0xd8a9('0x38')][_0xd8a9('0x3a')]?_0x361f13[_0xd8a9('0x38')]:_0x59f0f7[_0xd8a9('0x34')];_0x361f13[_0xd8a9('0x3d')]=qs[_0xd8a9('0x3e')](_0x58ae38[_0xd8a9('0x35')][_0xd8a9('0x3e')]);_0x361f13['where']=qs[_0xd8a9('0x36')](_[_0xd8a9('0x3f')](_0x58ae38[_0xd8a9('0x35')],_0x59f0f7[_0xd8a9('0x36')]));if(_0x58ae38[_0xd8a9('0x35')][_0xd8a9('0x40')]){_0x361f13['where']=_[_0xd8a9('0x42')](_0x361f13[_0xd8a9('0x41')],{'$or':_[_0xd8a9('0x2e')](_0x361f13[_0xd8a9('0x38')],function(_0x4f2b4e){var _0x5834cb={};_0x5834cb[_0x4f2b4e]={'$like':'%'+_0x58ae38['query'][_0xd8a9('0x40')]+'%'};return _0x5834cb;})});}_0x361f13=_['merge']({},_0x361f13,_0x58ae38['options']);return _0x40fcd3[_0xd8a9('0x4e')](_0x361f13);}})[_0xd8a9('0x25')](function(_0x47ada5){if(_0x47ada5){_0x255854=_0x47ada5[_0xd8a9('0x3a')];if(!_0x58ae38[_0xd8a9('0x35')][_0xd8a9('0x3b')](_0xd8a9('0x3c'))){_0x361f13[_0xd8a9('0x1d')]=qs[_0xd8a9('0x1d')](_0x58ae38[_0xd8a9('0x35')][_0xd8a9('0x1d')]);_0x361f13[_0xd8a9('0x1a')]=qs['offset'](_0x58ae38[_0xd8a9('0x35')]['offset']);}return _0x40fcd3['getConfigurations'](_0x361f13);}})[_0xd8a9('0x25')](function(_0x24119f){if(_0x24119f){return _0x24119f?{'count':_0x255854,'rows':_0x24119f}:null;}})['then'](respondWithResult(_0x57f6f0,null))['catch'](handleError(_0x57f6f0,null));};exports[_0xd8a9('0x51')]=function(_0x1a0569,_0x3906c0,_0x52d50e){if(_0x1a0569['body']['id']){delete _0x1a0569[_0xd8a9('0x4c')]['id'];}return db[_0xd8a9('0x2f')]['findOne']({'where':{'id':_0x1a0569[_0xd8a9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3906c0,null))[_0xd8a9('0x25')](function(_0x49a6cf){if(_0x49a6cf){_0x1a0569['body'][_0xd8a9('0x52')]=_0x49a6cf['id'];_0x1a0569[_0xd8a9('0x4c')][_0xd8a9('0x53')]=integrations[_0xd8a9('0x54')](_0x1a0569[_0xd8a9('0x4c')][_0xd8a9('0x55')],_0x1a0569[_0xd8a9('0x4c')]['type']);_0x1a0569[_0xd8a9('0x4c')][_0xd8a9('0x56')]=integrations[_0xd8a9('0x57')](_0x1a0569[_0xd8a9('0x4c')][_0xd8a9('0x55')],_0x1a0569['body'][_0xd8a9('0x32')]);return db[_0xd8a9('0x50')][_0xd8a9('0x4b')](_0x1a0569[_0xd8a9('0x4c')],{'include':[{'model':db[_0xd8a9('0x58')],'as':_0xd8a9('0x53')},{'model':db[_0xd8a9('0x58')],'as':_0xd8a9('0x56')}]});}return null;})[_0xd8a9('0x25')](respondWithResult(_0x3906c0,null))[_0xd8a9('0x4a')](handleError(_0x3906c0,null));};exports[_0xd8a9('0x59')]=function(_0x44e323,_0x328852,_0x4ae506){var _0x35330d='';return db[_0xd8a9('0x2f')][_0xd8a9('0x4f')]({'where':{'id':_0x44e323[_0xd8a9('0x4d')]['id']},'attributes':['id',_0xd8a9('0x5a'),'apiKey']})[_0xd8a9('0x25')](handleEntityNotFound(_0x328852,null))['then'](function(_0x240577){if(_0x240577){_0x35330d=_0x240577[_0xd8a9('0x5a')];var _0x3c14ac=_0x35330d[_0xd8a9('0x5b')](-0x1);if(_0x3c14ac==='/'){_0x35330d=_0x35330d[_0xd8a9('0x5c')](0x0,_0x35330d[_0xd8a9('0x5d')](_0x3c14ac));}return rp({'method':_0xd8a9('0x5e'),'uri':util[_0xd8a9('0x5f')]('%s/%s',_0x35330d,_0xd8a9('0x60')),'headers':{'Authorization':util[_0xd8a9('0x5f')](_0xd8a9('0x61'),new Buffer(util['format'](_0xd8a9('0x62'),_0x240577['apiKey']))['toString'](_0xd8a9('0x63')))},'json':!![]});}})['then'](function(_0x4ae50b){if(_0x4ae50b){var _0x3c904a=[_0xd8a9('0x64'),'subject','agent',_0xd8a9('0x65'),_0xd8a9('0x19'),'priority',_0xd8a9('0x66'),_0xd8a9('0x67'),_0xd8a9('0x68'),_0xd8a9('0x66'),'company'];_[_0xd8a9('0x69')](_0x4ae50b,function(_0x1b8672){return _0x3c904a[_0xd8a9('0x6a')](_0x1b8672[_0xd8a9('0x2b')])||!_0x1b8672['default']&&_0x1b8672[_0xd8a9('0x32')]!==_0xd8a9('0x6b')&&_0x1b8672[_0xd8a9('0x32')]!==_0xd8a9('0x6c');});return{'count':_0x4ae50b[_0xd8a9('0x3a')],'rows':_['map'](_0x4ae50b,function(_0xe5f917){return{'id':_0xe5f917[_0xd8a9('0x2b')],'name':_0xe5f917[_0xd8a9('0x6d')],'custom':!_0xe5f917[_0xd8a9('0x6e')],'options':_0xe5f917[_0xd8a9('0x6f')]?_[_0xd8a9('0x2e')](_0xe5f917[_0xd8a9('0x6f')],function(_0x2598f5){return{'name':_[_0xd8a9('0x70')](_0x2598f5),'value':_0x2598f5};}):[]};})};}})['then'](respondWithResult(_0x328852,null))[_0xd8a9('0x4a')](function(_0x557004){var _0x1afd36=_0x44e323[_0xd8a9('0x35')][_0xd8a9('0x71')]?0x1f4:_0x557004[_0xd8a9('0x72')]||0x1f4;logger['error'](_0xd8a9('0x73'),_0xd8a9('0x59'),_0x1afd36,JSON['stringify'](_0x557004));delete _0x557004[_0xd8a9('0x2b')];if(_0x1afd36===0x191){_0x1afd36=0x190;}_0x328852[_0xd8a9('0x19')](_0x1afd36)[_0xd8a9('0x2c')](_0x44e323[_0xd8a9('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x557004[_0xd8a9('0x72')]}:_0x557004);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index ad445ff..95a9eae 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 _0x4e0d=['request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4d87de,_0x39542e){var _0x1c8f3e=function(_0xe6c992){while(--_0xe6c992){_0x4d87de['push'](_0x4d87de['shift']());}};_0x1c8f3e(++_0x39542e);}(_0x4e0d,0xcb));var _0xd4e0=function(_0x5bb616,_0x1d6442){_0x5bb616=_0x5bb616-0x0;var _0x3332a8=_0x4e0d[_0x5bb616];return _0x3332a8;};'use strict';var _=require(_0xd4e0('0x0'));var util=require(_0xd4e0('0x1'));var logger=require(_0xd4e0('0x2'))('api');var moment=require(_0xd4e0('0x3'));var BPromise=require(_0xd4e0('0x4'));var rp=require(_0xd4e0('0x5'));var fs=require('fs');var path=require(_0xd4e0('0x6'));var rimraf=require(_0xd4e0('0x7'));var config=require(_0xd4e0('0x8'));var attributes=require(_0xd4e0('0x9'));var integrations=require(_0xd4e0('0xa'));module['exports']=function(_0x5bee38,_0x5db619){return _0x5bee38[_0xd4e0('0xb')](_0xd4e0('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecf1=['request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecf1,0xf9));var _0x1ecf=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xecf1[_0xd511d];return _0x3f148e;};'use strict';var _=require(_0x1ecf('0x0'));var util=require(_0x1ecf('0x1'));var logger=require(_0x1ecf('0x2'))(_0x1ecf('0x3'));var moment=require(_0x1ecf('0x4'));var BPromise=require(_0x1ecf('0x5'));var rp=require(_0x1ecf('0x6'));var fs=require('fs');var path=require(_0x1ecf('0x7'));var rimraf=require(_0x1ecf('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ecf('0x9'));var integrations=require(_0x1ecf('0xa'));module[_0x1ecf('0xb')]=function(_0x35cb01,_0x50c603){return _0x35cb01[_0x1ecf('0xc')](_0x1ecf('0xd'),attributes,{'tableName':_0x1ecf('0xe'),'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 9e52bd1..2df73a2 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 _0xc399=['http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','raw','options','limit','include','map','model','attributes','find','where','ShowFreshdeskAccount','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1c4b72,_0x47b058){var _0x5dd0f1=function(_0x5eec73){while(--_0x5eec73){_0x1c4b72['push'](_0x1c4b72['shift']());}};_0x5dd0f1(++_0x47b058);}(_0xc399,0xd9));var _0x9c39=function(_0x26f9ba,_0x2cce21){_0x26f9ba=_0x26f9ba-0x0;var _0x1fe5eb=_0xc399[_0x26f9ba];return _0x1fe5eb;};'use strict';var _=require(_0x9c39('0x0'));var util=require(_0x9c39('0x1'));var moment=require(_0x9c39('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c39('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c39('0x4'))(_0x9c39('0x5'));var config=require(_0x9c39('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c39('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5de886,_0x1f1378,_0x482227){return new BPromise(function(_0x999e59,_0x12648a){return client[_0x9c39('0x8')](_0x5de886,_0x482227)[_0x9c39('0x9')](function(_0x37c5f9){logger[_0x9c39('0xa')](_0x9c39('0xb'),_0x1f1378,'request\x20sent');logger[_0x9c39('0xc')](_0x9c39('0xd'),_0x1f1378,_0x9c39('0xe'),JSON[_0x9c39('0xf')](_0x37c5f9));if(_0x37c5f9[_0x9c39('0x10')]){if(_0x37c5f9[_0x9c39('0x10')]['code']===0x1f4){logger[_0x9c39('0x10')](_0x9c39('0xb'),_0x1f1378,_0x37c5f9[_0x9c39('0x10')][_0x9c39('0x11')]);return _0x12648a(_0x37c5f9[_0x9c39('0x10')][_0x9c39('0x11')]);}logger['error'](_0x9c39('0xb'),_0x1f1378,_0x37c5f9[_0x9c39('0x10')][_0x9c39('0x11')]);return _0x999e59(_0x37c5f9[_0x9c39('0x10')][_0x9c39('0x11')]);}else{logger[_0x9c39('0xa')](_0x9c39('0xb'),_0x1f1378,_0x9c39('0xe'));_0x999e59(_0x37c5f9['result'][_0x9c39('0x11')]);}})[_0x9c39('0x12')](function(_0x1b6c90){logger['error'](_0x9c39('0xb'),_0x1f1378,_0x1b6c90);_0x12648a(_0x1b6c90);});});}exports[_0x9c39('0x13')]=function(_0xe180e9){var _0x234ff9=this;return new Promise(function(_0x5ebfa2,_0x2480e2){return db[_0x9c39('0x14')][_0x9c39('0x15')]({'raw':_0xe180e9['options']?_0xe180e9['options'][_0x9c39('0x16')]===undefined?!![]:![]:!![],'where':_0xe180e9[_0x9c39('0x17')]?_0xe180e9[_0x9c39('0x17')]['where']||null:null,'attributes':_0xe180e9[_0x9c39('0x17')]?_0xe180e9['options']['attributes']||null:null,'limit':_0xe180e9[_0x9c39('0x17')]?_0xe180e9[_0x9c39('0x17')][_0x9c39('0x18')]||null:null,'include':_0xe180e9[_0x9c39('0x17')]?_0xe180e9[_0x9c39('0x17')][_0x9c39('0x19')]?_[_0x9c39('0x1a')](_0xe180e9[_0x9c39('0x17')]['include'],function(_0x304736){return{'model':db[_0x304736[_0x9c39('0x1b')]],'as':_0x304736['as'],'attributes':_0x304736['attributes'],'include':_0x304736[_0x9c39('0x19')]?_[_0x9c39('0x1a')](_0x304736[_0x9c39('0x19')],function(_0x188cc5){return{'model':db[_0x188cc5[_0x9c39('0x1b')]],'as':_0x188cc5['as'],'attributes':_0x188cc5[_0x9c39('0x1c')],'include':_0x188cc5['include']?_['map'](_0x188cc5[_0x9c39('0x19')],function(_0x3634d1){return{'model':db[_0x3634d1['model']],'as':_0x3634d1['as'],'attributes':_0x3634d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c39('0x9')](function(_0x371761){logger['info'](_0x9c39('0x13'),_0xe180e9);logger[_0x9c39('0xc')]('GetFreshdeskAccount',_0xe180e9,JSON['stringify'](_0x371761));_0x5ebfa2(_0x371761);})[_0x9c39('0x12')](function(_0x27de98){logger[_0x9c39('0x10')](_0x9c39('0x13'),_0x27de98[_0x9c39('0x11')],_0xe180e9);_0x2480e2(_0x234ff9['error'](0x1f4,_0x27de98[_0x9c39('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x4da774){var _0x3e9d13=this;return new Promise(function(_0x49d04c,_0x1b26e0){return db[_0x9c39('0x14')][_0x9c39('0x1d')]({'raw':_0x4da774[_0x9c39('0x17')]?_0x4da774[_0x9c39('0x17')][_0x9c39('0x16')]===undefined?!![]:![]:!![],'where':_0x4da774[_0x9c39('0x17')]?_0x4da774[_0x9c39('0x17')][_0x9c39('0x1e')]||null:null,'attributes':_0x4da774[_0x9c39('0x17')]?_0x4da774[_0x9c39('0x17')]['attributes']||null:null,'include':_0x4da774[_0x9c39('0x17')]?_0x4da774['options'][_0x9c39('0x19')]?_['map'](_0x4da774['options'][_0x9c39('0x19')],function(_0x18c22a){return{'model':db[_0x18c22a[_0x9c39('0x1b')]],'as':_0x18c22a['as'],'attributes':_0x18c22a[_0x9c39('0x1c')],'include':_0x18c22a[_0x9c39('0x19')]?_[_0x9c39('0x1a')](_0x18c22a[_0x9c39('0x19')],function(_0x1cc2c6){return{'model':db[_0x1cc2c6[_0x9c39('0x1b')]],'as':_0x1cc2c6['as'],'attributes':_0x1cc2c6[_0x9c39('0x1c')],'include':_0x1cc2c6[_0x9c39('0x19')]?_[_0x9c39('0x1a')](_0x1cc2c6[_0x9c39('0x19')],function(_0x30ac7a){return{'model':db[_0x30ac7a['model']],'as':_0x30ac7a['as'],'attributes':_0x30ac7a[_0x9c39('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a966f){logger['info'](_0x9c39('0x1f'),_0x4da774);logger[_0x9c39('0xc')](_0x9c39('0x1f'),_0x4da774,JSON[_0x9c39('0xf')](_0x3a966f));_0x49d04c(_0x3a966f);})[_0x9c39('0x12')](function(_0x31e1c6){logger['error']('ShowFreshdeskAccount',_0x31e1c6['message'],_0x4da774);_0x1b26e0(_0x3e9d13[_0x9c39('0x10')](0x1f4,_0x31e1c6[_0x9c39('0x11')]));});});}; \ No newline at end of file +var _0x2397=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','debug','ShowFreshdeskAccount','find','map','moment','bluebird'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2397,0x142));var _0x7239=function(_0x1ec8cf,_0x22ad74){_0x1ec8cf=_0x1ec8cf-0x0;var _0x4c4fea=_0x2397[_0x1ec8cf];return _0x4c4fea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7239('0x0'));var BPromise=require(_0x7239('0x1'));var rs=require(_0x7239('0x2'));var fs=require('fs');var Redis=require(_0x7239('0x3'));var db=require(_0x7239('0x4'))['db'];var utils=require(_0x7239('0x5'));var logger=require(_0x7239('0x6'))(_0x7239('0x7'));var config=require(_0x7239('0x8'));var jayson=require(_0x7239('0x9'));var client=jayson['client'][_0x7239('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x108624,_0xe11930,_0x51047e){return new BPromise(function(_0x36d97d,_0x255d84){return client['request'](_0x108624,_0x51047e)[_0x7239('0xb')](function(_0x392a07){logger[_0x7239('0xc')](_0x7239('0xd'),_0xe11930,_0x7239('0xe'));logger['debug'](_0x7239('0xf'),_0xe11930,_0x7239('0xe'),JSON[_0x7239('0x10')](_0x392a07));if(_0x392a07['error']){if(_0x392a07[_0x7239('0x11')][_0x7239('0x12')]===0x1f4){logger[_0x7239('0x11')](_0x7239('0xd'),_0xe11930,_0x392a07[_0x7239('0x11')][_0x7239('0x13')]);return _0x255d84(_0x392a07['error']['message']);}logger[_0x7239('0x11')](_0x7239('0xd'),_0xe11930,_0x392a07[_0x7239('0x11')]['message']);return _0x36d97d(_0x392a07[_0x7239('0x11')]['message']);}else{logger[_0x7239('0xc')](_0x7239('0xd'),_0xe11930,_0x7239('0xe'));_0x36d97d(_0x392a07[_0x7239('0x14')][_0x7239('0x13')]);}})[_0x7239('0x15')](function(_0x2f8c39){logger[_0x7239('0x11')](_0x7239('0xd'),_0xe11930,_0x2f8c39);_0x255d84(_0x2f8c39);});});}exports[_0x7239('0x16')]=function(_0x30e81d){var _0x33f56f=this;return new Promise(function(_0x3c5762,_0x2a0704){return db[_0x7239('0x17')][_0x7239('0x18')]({'raw':_0x30e81d[_0x7239('0x19')]?_0x30e81d[_0x7239('0x19')][_0x7239('0x1a')]===undefined?!![]:![]:!![],'where':_0x30e81d[_0x7239('0x19')]?_0x30e81d[_0x7239('0x19')][_0x7239('0x1b')]||null:null,'attributes':_0x30e81d[_0x7239('0x19')]?_0x30e81d['options'][_0x7239('0x1c')]||null:null,'limit':_0x30e81d[_0x7239('0x19')]?_0x30e81d[_0x7239('0x19')][_0x7239('0x1d')]||null:null,'include':_0x30e81d[_0x7239('0x19')]?_0x30e81d[_0x7239('0x19')][_0x7239('0x1e')]?_['map'](_0x30e81d[_0x7239('0x19')]['include'],function(_0x244b59){return{'model':db[_0x244b59['model']],'as':_0x244b59['as'],'attributes':_0x244b59[_0x7239('0x1c')],'include':_0x244b59['include']?_['map'](_0x244b59[_0x7239('0x1e')],function(_0x1b8d4){return{'model':db[_0x1b8d4[_0x7239('0x1f')]],'as':_0x1b8d4['as'],'attributes':_0x1b8d4[_0x7239('0x1c')],'include':_0x1b8d4['include']?_['map'](_0x1b8d4[_0x7239('0x1e')],function(_0x4c75e7){return{'model':db[_0x4c75e7[_0x7239('0x1f')]],'as':_0x4c75e7['as'],'attributes':_0x4c75e7[_0x7239('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7239('0xb')](function(_0xacf60){logger[_0x7239('0xc')](_0x7239('0x16'),_0x30e81d);logger[_0x7239('0x20')](_0x7239('0x16'),_0x30e81d,JSON['stringify'](_0xacf60));_0x3c5762(_0xacf60);})[_0x7239('0x15')](function(_0x1d9917){logger[_0x7239('0x11')]('GetFreshdeskAccount',_0x1d9917[_0x7239('0x13')],_0x30e81d);_0x2a0704(_0x33f56f[_0x7239('0x11')](0x1f4,_0x1d9917[_0x7239('0x13')]));});});};exports[_0x7239('0x21')]=function(_0x167e5b){var _0x142a8f=this;return new Promise(function(_0x3fe31a,_0x4e7fc2){return db[_0x7239('0x17')][_0x7239('0x22')]({'raw':_0x167e5b[_0x7239('0x19')]?_0x167e5b['options'][_0x7239('0x1a')]===undefined?!![]:![]:!![],'where':_0x167e5b['options']?_0x167e5b[_0x7239('0x19')]['where']||null:null,'attributes':_0x167e5b[_0x7239('0x19')]?_0x167e5b[_0x7239('0x19')][_0x7239('0x1c')]||null:null,'include':_0x167e5b[_0x7239('0x19')]?_0x167e5b[_0x7239('0x19')]['include']?_['map'](_0x167e5b[_0x7239('0x19')][_0x7239('0x1e')],function(_0x2be736){return{'model':db[_0x2be736[_0x7239('0x1f')]],'as':_0x2be736['as'],'attributes':_0x2be736[_0x7239('0x1c')],'include':_0x2be736['include']?_[_0x7239('0x23')](_0x2be736[_0x7239('0x1e')],function(_0x506e06){return{'model':db[_0x506e06[_0x7239('0x1f')]],'as':_0x506e06['as'],'attributes':_0x506e06[_0x7239('0x1c')],'include':_0x506e06[_0x7239('0x1e')]?_[_0x7239('0x23')](_0x506e06[_0x7239('0x1e')],function(_0x2ad6ed){return{'model':db[_0x2ad6ed[_0x7239('0x1f')]],'as':_0x2ad6ed['as'],'attributes':_0x2ad6ed[_0x7239('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7239('0xb')](function(_0x221578){logger['info'](_0x7239('0x21'),_0x167e5b);logger[_0x7239('0x20')](_0x7239('0x21'),_0x167e5b,JSON[_0x7239('0x10')](_0x221578));_0x3fe31a(_0x221578);})[_0x7239('0x15')](function(_0x242d66){logger[_0x7239('0x11')](_0x7239('0x21'),_0x242d66['message'],_0x167e5b);_0x4e7fc2(_0x142a8f['error'](0x1f4,_0x242d66['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 1a5d0b9..cc5f859 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 _0x6e57=['./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x39871f,_0x42cbeb){var _0x1c1fd0=function(_0x36ae54){while(--_0x36ae54){_0x39871f['push'](_0x39871f['shift']());}};_0x1c1fd0(++_0x42cbeb);}(_0x6e57,0x1c0));var _0x76e5=function(_0x2702eb,_0xd1bc94){_0x2702eb=_0x2702eb-0x0;var _0x323a1d=_0x6e57[_0x2702eb];return _0x323a1d;};'use strict';var multer=require(_0x76e5('0x0'));var util=require(_0x76e5('0x1'));var path=require(_0x76e5('0x2'));var timeout=require(_0x76e5('0x3'));var express=require(_0x76e5('0x4'));var router=express['Router']();var fs_extra=require(_0x76e5('0x5'));var auth=require(_0x76e5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76e5('0x7'));var controller=require(_0x76e5('0x8'));router['get']('/',auth[_0x76e5('0x9')](),controller[_0x76e5('0xa')]);router[_0x76e5('0xb')](_0x76e5('0xc'),auth[_0x76e5('0x9')](),controller['show']);router[_0x76e5('0xb')]('/:id/fields',auth[_0x76e5('0x9')](),controller[_0x76e5('0xd')]);router['get']('/:id/subjects',auth[_0x76e5('0x9')](),controller[_0x76e5('0xe')]);router[_0x76e5('0xb')](_0x76e5('0xf'),auth[_0x76e5('0x9')](),controller[_0x76e5('0x10')]);router[_0x76e5('0xb')](_0x76e5('0x11'),auth[_0x76e5('0x9')](),controller[_0x76e5('0x12')]);router[_0x76e5('0x13')]('/',auth[_0x76e5('0x9')](),controller[_0x76e5('0x14')]);router[_0x76e5('0x13')]('/:id/tags',auth[_0x76e5('0x9')](),controller['setTags']);router[_0x76e5('0x15')](_0x76e5('0xc'),auth[_0x76e5('0x9')](),controller['update']);router['delete'](_0x76e5('0xc'),auth[_0x76e5('0x9')](),controller[_0x76e5('0x16')]);module[_0x76e5('0x17')]=router; \ No newline at end of file +var _0xb7e5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x4ac64e,_0x35a821){var _0x2fb5ae=function(_0x58f46f){while(--_0x58f46f){_0x4ac64e['push'](_0x4ac64e['shift']());}};_0x2fb5ae(++_0x35a821);}(_0xb7e5,0x1ab));var _0x5b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x5b7e('0x0'));var path=require(_0x5b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b7e('0x2'));var router=express[_0x5b7e('0x3')]();var fs_extra=require(_0x5b7e('0x4'));var auth=require(_0x5b7e('0x5'));var interaction=require(_0x5b7e('0x6'));var config=require(_0x5b7e('0x7'));var controller=require(_0x5b7e('0x8'));router[_0x5b7e('0x9')]('/',auth[_0x5b7e('0xa')](),controller[_0x5b7e('0xb')]);router[_0x5b7e('0x9')](_0x5b7e('0xc'),auth[_0x5b7e('0xa')](),controller['show']);router['get'](_0x5b7e('0xd'),auth[_0x5b7e('0xa')](),controller['getFields']);router['get'](_0x5b7e('0xe'),auth[_0x5b7e('0xa')](),controller[_0x5b7e('0xf')]);router[_0x5b7e('0x9')]('/:id/descriptions',auth[_0x5b7e('0xa')](),controller[_0x5b7e('0x10')]);router[_0x5b7e('0x9')](_0x5b7e('0x11'),auth[_0x5b7e('0xa')](),controller[_0x5b7e('0x12')]);router[_0x5b7e('0x13')]('/',auth['isAuthenticated'](),controller[_0x5b7e('0x14')]);router[_0x5b7e('0x13')](_0x5b7e('0x11'),auth['isAuthenticated'](),controller[_0x5b7e('0x15')]);router[_0x5b7e('0x16')](_0x5b7e('0xc'),auth[_0x5b7e('0xa')](),controller[_0x5b7e('0x17')]);router[_0x5b7e('0x18')](_0x5b7e('0xc'),auth[_0x5b7e('0xa')](),controller[_0x5b7e('0x19')]);module[_0x5b7e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 754bab3..5e4bfc2 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 _0xb67e=['STRING','exports'];(function(_0x59b5a1,_0x35a89f){var _0x353e94=function(_0x4515ea){while(--_0x4515ea){_0x59b5a1['push'](_0x59b5a1['shift']());}};_0x353e94(++_0x35a89f);}(_0xb67e,0x117));var _0xeb67=function(_0x103002,_0x225960){_0x103002=_0x103002-0x0;var _0x41be4f=_0xb67e[_0x103002];return _0x41be4f;};'use strict';var Sequelize=require('sequelize');module[_0xeb67('0x0')]={'name':{'type':Sequelize[_0xeb67('0x1')]},'description':{'type':Sequelize[_0xeb67('0x1')]}}; \ No newline at end of file +var _0x6615=['sequelize','STRING'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x6615,0x7a));var _0x5661=function(_0x193109,_0x50a9ca){_0x193109=_0x193109-0x0;var _0x4af109=_0x6615[_0x193109];return _0x4af109;};'use strict';var Sequelize=require(_0x5661('0x0'));module['exports']={'name':{'type':Sequelize[_0x5661('0x1')]},'description':{'type':Sequelize[_0x5661('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 1468926..e6243f6 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 _0xbc01=['catch','params','include','find','create','body','update','getFields','getSubjects','findOne','getDescriptions','FreshdeskField','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0xbc01,0xfe));var _0x1bc0=function(_0x48dfba,_0x24fa73){_0x48dfba=_0x48dfba-0x0;var _0x5d09cb=_0xbc01[_0x48dfba];return _0x5d09cb;};'use strict';var emlformat=require(_0x1bc0('0x0'));var rimraf=require(_0x1bc0('0x1'));var zipdir=require(_0x1bc0('0x2'));var jsonpatch=require(_0x1bc0('0x3'));var rp=require(_0x1bc0('0x4'));var moment=require('moment');var BPromise=require(_0x1bc0('0x5'));var Mustache=require('mustache');var util=require(_0x1bc0('0x6'));var path=require(_0x1bc0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1bc0('0x8'));var fs=require('fs');var fs_extra=require(_0x1bc0('0x9'));var _=require(_0x1bc0('0xa'));var squel=require('squel');var crypto=require(_0x1bc0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1bc0('0xc'));var toCsv=require(_0x1bc0('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1bc0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1bc0('0xf'));var hardwareService=require(_0x1bc0('0x10'));var logger=require('../../config/logger')(_0x1bc0('0x11'));var utils=require(_0x1bc0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1bc0('0x13'));var db=require(_0x1bc0('0x14'))['db'];function respondWithStatusCode(_0xd0dba8,_0x142dee){_0x142dee=_0x142dee||0xcc;return function(_0x2f79f5){if(_0x2f79f5){return _0xd0dba8[_0x1bc0('0x15')](_0x142dee);}return _0xd0dba8[_0x1bc0('0x16')](_0x142dee)[_0x1bc0('0x17')]();};}function respondWithResult(_0x754254,_0x411dc5){_0x411dc5=_0x411dc5||0xc8;return function(_0x58e7b6){if(_0x58e7b6){return _0x754254[_0x1bc0('0x16')](_0x411dc5)['json'](_0x58e7b6);}};}function respondWithFilteredResult(_0x3e9975,_0x1c1d67){return function(_0x51a94e){if(_0x51a94e){var _0x20c097=typeof _0x1c1d67[_0x1bc0('0x18')]==='undefined'&&typeof _0x1c1d67[_0x1bc0('0x19')]===_0x1bc0('0x1a');var _0x21c0ab=_0x51a94e[_0x1bc0('0x1b')];var _0x30951b=_0x20c097?0x0:_0x1c1d67[_0x1bc0('0x18')];var _0x1b3a63=_0x20c097?_0x51a94e[_0x1bc0('0x1b')]:_0x1c1d67[_0x1bc0('0x18')]+_0x1c1d67['limit'];var _0x3c3bfe;if(_0x1b3a63>=_0x21c0ab){_0x1b3a63=_0x21c0ab;_0x3c3bfe=0xc8;}else{_0x3c3bfe=0xce;}_0x3e9975[_0x1bc0('0x16')](_0x3c3bfe);return _0x3e9975[_0x1bc0('0x1c')](_0x1bc0('0x1d'),_0x30951b+'-'+_0x1b3a63+'/'+_0x21c0ab)[_0x1bc0('0x1e')](_0x51a94e);}return null;};}function patchUpdates(_0x5c57ce){return function(_0x2bfd7f){try{jsonpatch[_0x1bc0('0x1f')](_0x2bfd7f,_0x5c57ce,!![]);}catch(_0x235814){return BPromise[_0x1bc0('0x20')](_0x235814);}return _0x2bfd7f[_0x1bc0('0x21')]();};}function saveUpdates(_0x20e152,_0x5b6d6c){return function(_0x1e5755){if(_0x1e5755){return _0x1e5755['update'](_0x20e152)[_0x1bc0('0x22')](function(_0xb44867){return _0xb44867;});}return null;};}function removeEntity(_0x3f4f07,_0xa3d9cc){return function(_0x124e02){if(_0x124e02){return _0x124e02[_0x1bc0('0x23')]()['then'](function(){_0x3f4f07['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ba193,_0x183f05){return function(_0x461d66){if(!_0x461d66){_0x5ba193[_0x1bc0('0x15')](0x194);}return _0x461d66;};}function handleError(_0x1ae71e,_0x4fe1a6){_0x4fe1a6=_0x4fe1a6||0x1f4;return function(_0x4f047f){logger['error'](_0x4f047f[_0x1bc0('0x24')]);if(_0x4f047f[_0x1bc0('0x25')]){delete _0x4f047f[_0x1bc0('0x25')];}_0x1ae71e[_0x1bc0('0x16')](_0x4fe1a6)[_0x1bc0('0x26')](_0x4f047f);};}exports['index']=function(_0x4247ec,_0x57cdaa){var _0x538858={},_0xb3d02f={},_0x3f2157={'count':0x0,'rows':[]};var _0x6db7bf=_[_0x1bc0('0x27')](db[_0x1bc0('0x28')][_0x1bc0('0x29')],function(_0x5e490c){return{'name':_0x5e490c[_0x1bc0('0x2a')],'type':_0x5e490c[_0x1bc0('0x2b')][_0x1bc0('0x2c')]};});_0xb3d02f['model']=_[_0x1bc0('0x27')](_0x6db7bf,'name');_0xb3d02f[_0x1bc0('0x2d')]=_[_0x1bc0('0x2e')](_0x4247ec[_0x1bc0('0x2d')]);_0xb3d02f['filters']=_[_0x1bc0('0x2f')](_0xb3d02f[_0x1bc0('0x30')],_0xb3d02f['query']);_0x538858[_0x1bc0('0x31')]=_['intersection'](_0xb3d02f[_0x1bc0('0x30')],qs[_0x1bc0('0x32')](_0x4247ec[_0x1bc0('0x2d')][_0x1bc0('0x32')]));_0x538858['attributes']=_0x538858[_0x1bc0('0x31')][_0x1bc0('0x33')]?_0x538858[_0x1bc0('0x31')]:_0xb3d02f[_0x1bc0('0x30')];if(!_0x4247ec[_0x1bc0('0x2d')][_0x1bc0('0x34')](_0x1bc0('0x35'))){_0x538858[_0x1bc0('0x19')]=qs['limit'](_0x4247ec[_0x1bc0('0x2d')][_0x1bc0('0x19')]);_0x538858['offset']=qs[_0x1bc0('0x18')](_0x4247ec[_0x1bc0('0x2d')][_0x1bc0('0x18')]);}_0x538858[_0x1bc0('0x36')]=qs[_0x1bc0('0x37')](_0x4247ec[_0x1bc0('0x2d')]['sort']);_0x538858['where']=qs[_0x1bc0('0x38')](_[_0x1bc0('0x39')](_0x4247ec['query'],_0xb3d02f[_0x1bc0('0x38')]),_0x6db7bf);if(_0x4247ec['query'][_0x1bc0('0x3a')]){_0x538858[_0x1bc0('0x3b')]=_[_0x1bc0('0x3c')](_0x538858[_0x1bc0('0x3b')],{'$or':_[_0x1bc0('0x27')](_0x6db7bf,function(_0x809795){if(_0x809795['type']!==_0x1bc0('0x3d')){var _0x4bdd5a={};_0x4bdd5a[_0x809795[_0x1bc0('0x25')]]={'$like':'%'+_0x4247ec['query'][_0x1bc0('0x3a')]+'%'};return _0x4bdd5a;}})});}_0x538858=_[_0x1bc0('0x3c')]({},_0x538858,_0x4247ec[_0x1bc0('0x3e')]);var _0x4c1bf3={'where':_0x538858[_0x1bc0('0x3b')]};return db[_0x1bc0('0x28')][_0x1bc0('0x1b')](_0x4c1bf3)['then'](function(_0x410392){_0x3f2157[_0x1bc0('0x1b')]=_0x410392;if(_0x4247ec[_0x1bc0('0x2d')][_0x1bc0('0x3f')]){_0x538858['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x1bc0('0x40')](_0x538858);})[_0x1bc0('0x22')](function(_0x2266cb){_0x3f2157[_0x1bc0('0x41')]=_0x2266cb;return _0x3f2157;})[_0x1bc0('0x22')](respondWithFilteredResult(_0x57cdaa,_0x538858))[_0x1bc0('0x42')](handleError(_0x57cdaa,null));};exports['show']=function(_0x23c24b,_0x49ee21){var _0x5a53f7={'raw':![],'where':{'id':_0x23c24b[_0x1bc0('0x43')]['id']}},_0x169070={};_0x169070['model']=_[_0x1bc0('0x2e')](db[_0x1bc0('0x28')]['rawAttributes']);_0x169070[_0x1bc0('0x2d')]=_['keys'](_0x23c24b[_0x1bc0('0x2d')]);_0x169070[_0x1bc0('0x38')]=_[_0x1bc0('0x2f')](_0x169070[_0x1bc0('0x30')],_0x169070['query']);_0x5a53f7[_0x1bc0('0x31')]=_['intersection'](_0x169070[_0x1bc0('0x30')],qs['fields'](_0x23c24b[_0x1bc0('0x2d')][_0x1bc0('0x32')]));_0x5a53f7['attributes']=_0x5a53f7[_0x1bc0('0x31')][_0x1bc0('0x33')]?_0x5a53f7[_0x1bc0('0x31')]:_0x169070[_0x1bc0('0x30')];if(_0x23c24b[_0x1bc0('0x2d')][_0x1bc0('0x3f')]){_0x5a53f7[_0x1bc0('0x44')]=[{'all':!![]}];}_0x5a53f7=_[_0x1bc0('0x3c')]({},_0x5a53f7,_0x23c24b[_0x1bc0('0x3e')]);return db['FreshdeskConfiguration'][_0x1bc0('0x45')](_0x5a53f7)[_0x1bc0('0x22')](handleEntityNotFound(_0x49ee21,null))['then'](respondWithResult(_0x49ee21,null))[_0x1bc0('0x42')](handleError(_0x49ee21,null));};exports[_0x1bc0('0x46')]=function(_0x2a976e,_0x284b5c){return db[_0x1bc0('0x28')]['create'](_0x2a976e[_0x1bc0('0x47')],{})[_0x1bc0('0x22')](respondWithResult(_0x284b5c,0xc9))[_0x1bc0('0x42')](handleError(_0x284b5c,null));};exports[_0x1bc0('0x48')]=function(_0x207687,_0x39b87e){if(_0x207687[_0x1bc0('0x47')]['id']){delete _0x207687['body']['id'];}return db[_0x1bc0('0x28')][_0x1bc0('0x45')]({'where':{'id':_0x207687['params']['id']}})[_0x1bc0('0x22')](handleEntityNotFound(_0x39b87e,null))[_0x1bc0('0x22')](saveUpdates(_0x207687[_0x1bc0('0x47')],null))[_0x1bc0('0x22')](respondWithResult(_0x39b87e,null))[_0x1bc0('0x42')](handleError(_0x39b87e,null));};exports[_0x1bc0('0x23')]=function(_0x3beedb,_0x33d5a5){return db['FreshdeskConfiguration'][_0x1bc0('0x45')]({'where':{'id':_0x3beedb[_0x1bc0('0x43')]['id']}})[_0x1bc0('0x22')](handleEntityNotFound(_0x33d5a5,null))['then'](removeEntity(_0x33d5a5,null))['catch'](handleError(_0x33d5a5,null));};exports[_0x1bc0('0x49')]=function(_0x2bdb65,_0x48751e,_0x57853c){var _0xe55a4={};var _0x3c58d3={};var _0x169f1c;var _0x4aeb9b;return db[_0x1bc0('0x28')]['findOne']({'where':{'id':_0x2bdb65[_0x1bc0('0x43')]['id']}})['then'](handleEntityNotFound(_0x48751e,null))[_0x1bc0('0x22')](function(_0x29e056){if(_0x29e056){_0x169f1c=_0x29e056;_0x3c58d3[_0x1bc0('0x30')]=_['keys'](db['FreshdeskField'][_0x1bc0('0x29')]);_0x3c58d3['query']=_[_0x1bc0('0x2e')](_0x2bdb65[_0x1bc0('0x2d')]);_0x3c58d3['filters']=_[_0x1bc0('0x2f')](_0x3c58d3[_0x1bc0('0x30')],_0x3c58d3['query']);_0xe55a4[_0x1bc0('0x31')]=_['intersection'](_0x3c58d3[_0x1bc0('0x30')],qs['fields'](_0x2bdb65[_0x1bc0('0x2d')][_0x1bc0('0x32')]));_0xe55a4[_0x1bc0('0x31')]=_0xe55a4[_0x1bc0('0x31')][_0x1bc0('0x33')]?_0xe55a4[_0x1bc0('0x31')]:_0x3c58d3[_0x1bc0('0x30')];_0xe55a4[_0x1bc0('0x36')]=qs[_0x1bc0('0x37')](_0x2bdb65['query'][_0x1bc0('0x37')]);_0xe55a4['where']=qs['filters'](_['pick'](_0x2bdb65[_0x1bc0('0x2d')],_0x3c58d3['filters']));if(_0x2bdb65[_0x1bc0('0x2d')]['filter']){_0xe55a4['where']=_[_0x1bc0('0x3c')](_0xe55a4[_0x1bc0('0x3b')],{'$or':_['map'](_0xe55a4[_0x1bc0('0x31')],function(_0x12de68){var _0x4666fa={};_0x4666fa[_0x12de68]={'$like':'%'+_0x2bdb65[_0x1bc0('0x2d')]['filter']+'%'};return _0x4666fa;})});}_0xe55a4=_[_0x1bc0('0x3c')]({},_0xe55a4,_0x2bdb65[_0x1bc0('0x3e')]);return _0x169f1c['getFields'](_0xe55a4);}})[_0x1bc0('0x22')](function(_0x4314ed){if(_0x4314ed){_0x4aeb9b=_0x4314ed[_0x1bc0('0x33')];if(!_0x2bdb65['query'][_0x1bc0('0x34')](_0x1bc0('0x35'))){_0xe55a4[_0x1bc0('0x19')]=qs['limit'](_0x2bdb65[_0x1bc0('0x2d')]['limit']);_0xe55a4[_0x1bc0('0x18')]=qs[_0x1bc0('0x18')](_0x2bdb65[_0x1bc0('0x2d')][_0x1bc0('0x18')]);}return _0x169f1c[_0x1bc0('0x49')](_0xe55a4);}})[_0x1bc0('0x22')](function(_0x5819b1){if(_0x5819b1){return _0x5819b1?{'count':_0x4aeb9b,'rows':_0x5819b1}:null;}})[_0x1bc0('0x22')](respondWithResult(_0x48751e,null))['catch'](handleError(_0x48751e,null));};exports[_0x1bc0('0x4a')]=function(_0x29ea3f,_0x11360f,_0xc692de){var _0x42a659={};var _0xab602f={};var _0x54442d;var _0xd31de5;return db[_0x1bc0('0x28')][_0x1bc0('0x4b')]({'where':{'id':_0x29ea3f[_0x1bc0('0x43')]['id']}})[_0x1bc0('0x22')](handleEntityNotFound(_0x11360f,null))[_0x1bc0('0x22')](function(_0x1a2810){if(_0x1a2810){_0x54442d=_0x1a2810;_0xab602f['model']=_[_0x1bc0('0x2e')](db['FreshdeskField'][_0x1bc0('0x29')]);_0xab602f['query']=_[_0x1bc0('0x2e')](_0x29ea3f[_0x1bc0('0x2d')]);_0xab602f['filters']=_[_0x1bc0('0x2f')](_0xab602f[_0x1bc0('0x30')],_0xab602f[_0x1bc0('0x2d')]);_0x42a659['attributes']=_[_0x1bc0('0x2f')](_0xab602f[_0x1bc0('0x30')],qs['fields'](_0x29ea3f['query'][_0x1bc0('0x32')]));_0x42a659[_0x1bc0('0x31')]=_0x42a659[_0x1bc0('0x31')]['length']?_0x42a659[_0x1bc0('0x31')]:_0xab602f['model'];_0x42a659[_0x1bc0('0x36')]=qs[_0x1bc0('0x37')](_0x29ea3f['query'][_0x1bc0('0x37')]);_0x42a659[_0x1bc0('0x3b')]=qs[_0x1bc0('0x38')](_[_0x1bc0('0x39')](_0x29ea3f['query'],_0xab602f[_0x1bc0('0x38')]));if(_0x29ea3f[_0x1bc0('0x2d')]['filter']){_0x42a659[_0x1bc0('0x3b')]=_[_0x1bc0('0x3c')](_0x42a659[_0x1bc0('0x3b')],{'$or':_[_0x1bc0('0x27')](_0x42a659[_0x1bc0('0x31')],function(_0x58cff7){var _0x191409={};_0x191409[_0x58cff7]={'$like':'%'+_0x29ea3f['query'][_0x1bc0('0x3a')]+'%'};return _0x191409;})});}_0x42a659=_[_0x1bc0('0x3c')]({},_0x42a659,_0x29ea3f[_0x1bc0('0x3e')]);return _0x54442d['getSubjects'](_0x42a659);}})[_0x1bc0('0x22')](function(_0x445f21){if(_0x445f21){_0xd31de5=_0x445f21['length'];if(!_0x29ea3f[_0x1bc0('0x2d')][_0x1bc0('0x34')](_0x1bc0('0x35'))){_0x42a659['limit']=qs[_0x1bc0('0x19')](_0x29ea3f[_0x1bc0('0x2d')][_0x1bc0('0x19')]);_0x42a659[_0x1bc0('0x18')]=qs[_0x1bc0('0x18')](_0x29ea3f[_0x1bc0('0x2d')][_0x1bc0('0x18')]);}return _0x54442d[_0x1bc0('0x4a')](_0x42a659);}})[_0x1bc0('0x22')](function(_0x514db3){if(_0x514db3){return _0x514db3?{'count':_0xd31de5,'rows':_0x514db3}:null;}})[_0x1bc0('0x22')](respondWithResult(_0x11360f,null))[_0x1bc0('0x42')](handleError(_0x11360f,null));};exports[_0x1bc0('0x4c')]=function(_0x1356a6,_0x1d3ef8,_0x576b40){var _0x4a6121={};var _0x34dfea={};var _0x51519a;var _0x412c84;return db[_0x1bc0('0x28')]['findOne']({'where':{'id':_0x1356a6[_0x1bc0('0x43')]['id']}})[_0x1bc0('0x22')](handleEntityNotFound(_0x1d3ef8,null))[_0x1bc0('0x22')](function(_0x26546d){if(_0x26546d){_0x51519a=_0x26546d;_0x34dfea[_0x1bc0('0x30')]=_['keys'](db[_0x1bc0('0x4d')][_0x1bc0('0x29')]);_0x34dfea[_0x1bc0('0x2d')]=_[_0x1bc0('0x2e')](_0x1356a6[_0x1bc0('0x2d')]);_0x34dfea['filters']=_[_0x1bc0('0x2f')](_0x34dfea[_0x1bc0('0x30')],_0x34dfea[_0x1bc0('0x2d')]);_0x4a6121['attributes']=_[_0x1bc0('0x2f')](_0x34dfea[_0x1bc0('0x30')],qs[_0x1bc0('0x32')](_0x1356a6[_0x1bc0('0x2d')]['fields']));_0x4a6121['attributes']=_0x4a6121[_0x1bc0('0x31')]['length']?_0x4a6121[_0x1bc0('0x31')]:_0x34dfea['model'];_0x4a6121['order']=qs[_0x1bc0('0x37')](_0x1356a6[_0x1bc0('0x2d')]['sort']);_0x4a6121[_0x1bc0('0x3b')]=qs[_0x1bc0('0x38')](_[_0x1bc0('0x39')](_0x1356a6[_0x1bc0('0x2d')],_0x34dfea[_0x1bc0('0x38')]));if(_0x1356a6[_0x1bc0('0x2d')]['filter']){_0x4a6121['where']=_[_0x1bc0('0x3c')](_0x4a6121[_0x1bc0('0x3b')],{'$or':_[_0x1bc0('0x27')](_0x4a6121[_0x1bc0('0x31')],function(_0x28518f){var _0x341bcc={};_0x341bcc[_0x28518f]={'$like':'%'+_0x1356a6[_0x1bc0('0x2d')]['filter']+'%'};return _0x341bcc;})});}_0x4a6121=_[_0x1bc0('0x3c')]({},_0x4a6121,_0x1356a6['options']);return _0x51519a[_0x1bc0('0x4c')](_0x4a6121);}})['then'](function(_0x32d971){if(_0x32d971){_0x412c84=_0x32d971[_0x1bc0('0x33')];if(!_0x1356a6['query'][_0x1bc0('0x34')](_0x1bc0('0x35'))){_0x4a6121['limit']=qs['limit'](_0x1356a6['query']['limit']);_0x4a6121[_0x1bc0('0x18')]=qs['offset'](_0x1356a6[_0x1bc0('0x2d')][_0x1bc0('0x18')]);}return _0x51519a['getDescriptions'](_0x4a6121);}})[_0x1bc0('0x22')](function(_0x95358){if(_0x95358){return _0x95358?{'count':_0x412c84,'rows':_0x95358}:null;}})[_0x1bc0('0x22')](respondWithResult(_0x1d3ef8,null))[_0x1bc0('0x42')](handleError(_0x1d3ef8,null));};exports['getTags']=function(_0x110b94,_0x49aa51,_0x2e8a07){var _0x2deaab={};var _0x175b4a={};var _0x37ee45;var _0x4c36f0;return db['FreshdeskConfiguration'][_0x1bc0('0x4b')]({'where':{'id':_0x110b94['params']['id']}})[_0x1bc0('0x22')](handleEntityNotFound(_0x49aa51,null))[_0x1bc0('0x22')](function(_0x3839e9){if(_0x3839e9){_0x37ee45=_0x3839e9;_0x175b4a[_0x1bc0('0x30')]=_['keys'](db['Tag']['rawAttributes']);_0x175b4a[_0x1bc0('0x2d')]=_[_0x1bc0('0x2e')](_0x110b94[_0x1bc0('0x2d')]);_0x175b4a[_0x1bc0('0x38')]=_[_0x1bc0('0x2f')](_0x175b4a['model'],_0x175b4a[_0x1bc0('0x2d')]);_0x2deaab['attributes']=_[_0x1bc0('0x2f')](_0x175b4a[_0x1bc0('0x30')],qs['fields'](_0x110b94[_0x1bc0('0x2d')][_0x1bc0('0x32')]));_0x2deaab['attributes']=_0x2deaab['attributes']['length']?_0x2deaab[_0x1bc0('0x31')]:_0x175b4a[_0x1bc0('0x30')];_0x2deaab['order']=qs[_0x1bc0('0x37')](_0x110b94[_0x1bc0('0x2d')][_0x1bc0('0x37')]);_0x2deaab[_0x1bc0('0x3b')]=qs['filters'](_['pick'](_0x110b94[_0x1bc0('0x2d')],_0x175b4a[_0x1bc0('0x38')]));if(_0x110b94[_0x1bc0('0x2d')][_0x1bc0('0x3a')]){_0x2deaab[_0x1bc0('0x3b')]=_[_0x1bc0('0x3c')](_0x2deaab[_0x1bc0('0x3b')],{'$or':_['map'](_0x2deaab[_0x1bc0('0x31')],function(_0x130140){var _0x3cc9ba={};_0x3cc9ba[_0x130140]={'$like':'%'+_0x110b94[_0x1bc0('0x2d')]['filter']+'%'};return _0x3cc9ba;})});}_0x2deaab=_[_0x1bc0('0x3c')]({},_0x2deaab,_0x110b94[_0x1bc0('0x3e')]);return _0x37ee45['getTags'](_0x2deaab);}})[_0x1bc0('0x22')](function(_0x596b10){if(_0x596b10){_0x4c36f0=_0x596b10[_0x1bc0('0x33')];if(!_0x110b94[_0x1bc0('0x2d')][_0x1bc0('0x34')](_0x1bc0('0x35'))){_0x2deaab['limit']=qs[_0x1bc0('0x19')](_0x110b94[_0x1bc0('0x2d')]['limit']);_0x2deaab[_0x1bc0('0x18')]=qs[_0x1bc0('0x18')](_0x110b94[_0x1bc0('0x2d')][_0x1bc0('0x18')]);}return _0x37ee45['getTags'](_0x2deaab);}})[_0x1bc0('0x22')](function(_0x37c398){if(_0x37c398){return _0x37c398?{'count':_0x4c36f0,'rows':_0x37c398}:null;}})['then'](respondWithResult(_0x49aa51,null))[_0x1bc0('0x42')](handleError(_0x49aa51,null));};exports[_0x1bc0('0x4e')]=function(_0x32d598,_0x3a8be8,_0x2492a4){if(_0x32d598[_0x1bc0('0x47')]['id']){delete _0x32d598['body']['id'];}return db[_0x1bc0('0x28')][_0x1bc0('0x4b')]({'where':{'id':_0x32d598['params']['id']}})['then'](handleEntityNotFound(_0x3a8be8,null))[_0x1bc0('0x22')](function(_0x29176f){if(_0x29176f){return _0x29176f[_0x1bc0('0x4e')](_0x32d598[_0x1bc0('0x47')][_0x1bc0('0x4f')]||[]);}return null;})[_0x1bc0('0x22')](respondWithResult(_0x3a8be8,null))[_0x1bc0('0x42')](handleError(_0x3a8be8,null));}; \ No newline at end of file +var _0x3199=['desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','create','update','body','find','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x317746,_0x95e0fa){var _0x397848=function(_0x437864){while(--_0x437864){_0x317746['push'](_0x317746['shift']());}};_0x397848(++_0x95e0fa);}(_0x3199,0xe7));var _0x9319=function(_0x1d6a09,_0x23b891){_0x1d6a09=_0x1d6a09-0x0;var _0x1814af=_0x3199[_0x1d6a09];return _0x1814af;};'use strict';var emlformat=require(_0x9319('0x0'));var rimraf=require(_0x9319('0x1'));var zipdir=require(_0x9319('0x2'));var jsonpatch=require(_0x9319('0x3'));var rp=require('request-promise');var moment=require(_0x9319('0x4'));var BPromise=require(_0x9319('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9319('0x6'));var sox=require(_0x9319('0x7'));var csv=require(_0x9319('0x8'));var ejs=require(_0x9319('0x9'));var fs=require('fs');var fs_extra=require(_0x9319('0xa'));var _=require(_0x9319('0xb'));var squel=require(_0x9319('0xc'));var crypto=require(_0x9319('0xd'));var jsforce=require(_0x9319('0xe'));var deskjs=require(_0x9319('0xf'));var toCsv=require(_0x9319('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9319('0x10'));var qs=require(_0x9319('0x11'));var as=require(_0x9319('0x12'));var hardwareService=require(_0x9319('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9319('0x14'));var licenseUtil=require(_0x9319('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f058,_0x9ca36a){_0x9ca36a=_0x9ca36a||0xcc;return function(_0x4ae920){if(_0x4ae920){return _0x38f058[_0x9319('0x16')](_0x9ca36a);}return _0x38f058[_0x9319('0x17')](_0x9ca36a)[_0x9319('0x18')]();};}function respondWithResult(_0x1c1160,_0x4797dc){_0x4797dc=_0x4797dc||0xc8;return function(_0x23ed4c){if(_0x23ed4c){return _0x1c1160[_0x9319('0x17')](_0x4797dc)[_0x9319('0x19')](_0x23ed4c);}};}function respondWithFilteredResult(_0x401ce9,_0x4a1cf8){return function(_0x4116dc){if(_0x4116dc){var _0x38a23f=typeof _0x4a1cf8[_0x9319('0x1a')]===_0x9319('0x1b')&&typeof _0x4a1cf8['limit']===_0x9319('0x1b');var _0x2e2516=_0x4116dc['count'];var _0x38c030=_0x38a23f?0x0:_0x4a1cf8[_0x9319('0x1a')];var _0x470e19=_0x38a23f?_0x4116dc[_0x9319('0x1c')]:_0x4a1cf8[_0x9319('0x1a')]+_0x4a1cf8[_0x9319('0x1d')];var _0x5354ce;if(_0x470e19>=_0x2e2516){_0x470e19=_0x2e2516;_0x5354ce=0xc8;}else{_0x5354ce=0xce;}_0x401ce9[_0x9319('0x17')](_0x5354ce);return _0x401ce9[_0x9319('0x1e')]('Content-Range',_0x38c030+'-'+_0x470e19+'/'+_0x2e2516)['json'](_0x4116dc);}return null;};}function patchUpdates(_0xc37c67){return function(_0xaf20ca){try{jsonpatch[_0x9319('0x1f')](_0xaf20ca,_0xc37c67,!![]);}catch(_0x3ce4af){return BPromise[_0x9319('0x20')](_0x3ce4af);}return _0xaf20ca[_0x9319('0x21')]();};}function saveUpdates(_0x3e0bb7,_0x368e12){return function(_0xeb714b){if(_0xeb714b){return _0xeb714b['update'](_0x3e0bb7)[_0x9319('0x22')](function(_0x3fec05){return _0x3fec05;});}return null;};}function removeEntity(_0x4af7ed,_0x4a8c36){return function(_0x3d08fa){if(_0x3d08fa){return _0x3d08fa[_0x9319('0x23')]()[_0x9319('0x22')](function(){_0x4af7ed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4da2ca,_0x23146d){return function(_0x59658d){if(!_0x59658d){_0x4da2ca['sendStatus'](0x194);}return _0x59658d;};}function handleError(_0x3ac444,_0x242cce){_0x242cce=_0x242cce||0x1f4;return function(_0x507518){logger[_0x9319('0x24')](_0x507518[_0x9319('0x25')]);if(_0x507518[_0x9319('0x26')]){delete _0x507518[_0x9319('0x26')];}_0x3ac444[_0x9319('0x17')](_0x242cce)['send'](_0x507518);};}exports[_0x9319('0x27')]=function(_0x466677,_0x284026){var _0x459384={},_0x358bb1={},_0x5952f5={'count':0x0,'rows':[]};var _0x5d0136=_[_0x9319('0x28')](db[_0x9319('0x29')][_0x9319('0x2a')],function(_0x54cb33){return{'name':_0x54cb33['fieldName'],'type':_0x54cb33['type'][_0x9319('0x2b')]};});_0x358bb1[_0x9319('0x2c')]=_[_0x9319('0x28')](_0x5d0136,_0x9319('0x26'));_0x358bb1[_0x9319('0x2d')]=_[_0x9319('0x2e')](_0x466677[_0x9319('0x2d')]);_0x358bb1[_0x9319('0x2f')]=_[_0x9319('0x30')](_0x358bb1[_0x9319('0x2c')],_0x358bb1[_0x9319('0x2d')]);_0x459384[_0x9319('0x31')]=_['intersection'](_0x358bb1[_0x9319('0x2c')],qs[_0x9319('0x32')](_0x466677[_0x9319('0x2d')][_0x9319('0x32')]));_0x459384[_0x9319('0x31')]=_0x459384[_0x9319('0x31')]['length']?_0x459384[_0x9319('0x31')]:_0x358bb1[_0x9319('0x2c')];if(!_0x466677[_0x9319('0x2d')][_0x9319('0x33')](_0x9319('0x34'))){_0x459384[_0x9319('0x1d')]=qs['limit'](_0x466677[_0x9319('0x2d')][_0x9319('0x1d')]);_0x459384[_0x9319('0x1a')]=qs[_0x9319('0x1a')](_0x466677[_0x9319('0x2d')]['offset']);}_0x459384[_0x9319('0x35')]=qs[_0x9319('0x36')](_0x466677[_0x9319('0x2d')]['sort']);_0x459384['where']=qs[_0x9319('0x2f')](_[_0x9319('0x37')](_0x466677[_0x9319('0x2d')],_0x358bb1['filters']),_0x5d0136);if(_0x466677[_0x9319('0x2d')][_0x9319('0x38')]){_0x459384[_0x9319('0x39')]=_[_0x9319('0x3a')](_0x459384[_0x9319('0x39')],{'$or':_[_0x9319('0x28')](_0x5d0136,function(_0x268516){if(_0x268516[_0x9319('0x3b')]!==_0x9319('0x3c')){var _0x74fb4c={};_0x74fb4c[_0x268516['name']]={'$like':'%'+_0x466677[_0x9319('0x2d')]['filter']+'%'};return _0x74fb4c;}})});}_0x459384=_['merge']({},_0x459384,_0x466677[_0x9319('0x3d')]);var _0x445542={'where':_0x459384[_0x9319('0x39')]};return db[_0x9319('0x29')][_0x9319('0x1c')](_0x445542)[_0x9319('0x22')](function(_0x30749b){_0x5952f5[_0x9319('0x1c')]=_0x30749b;if(_0x466677[_0x9319('0x2d')]['includeAll']){_0x459384[_0x9319('0x3e')]=[{'all':!![]}];}return db[_0x9319('0x29')][_0x9319('0x3f')](_0x459384);})['then'](function(_0x5d20f4){_0x5952f5[_0x9319('0x40')]=_0x5d20f4;return _0x5952f5;})[_0x9319('0x22')](respondWithFilteredResult(_0x284026,_0x459384))[_0x9319('0x41')](handleError(_0x284026,null));};exports[_0x9319('0x42')]=function(_0x2d0855,_0x1187c3){var _0x4bd7d2={'raw':![],'where':{'id':_0x2d0855[_0x9319('0x43')]['id']}},_0x5b8a6f={};_0x5b8a6f[_0x9319('0x2c')]=_[_0x9319('0x2e')](db[_0x9319('0x29')][_0x9319('0x2a')]);_0x5b8a6f[_0x9319('0x2d')]=_[_0x9319('0x2e')](_0x2d0855[_0x9319('0x2d')]);_0x5b8a6f[_0x9319('0x2f')]=_['intersection'](_0x5b8a6f[_0x9319('0x2c')],_0x5b8a6f[_0x9319('0x2d')]);_0x4bd7d2[_0x9319('0x31')]=_['intersection'](_0x5b8a6f[_0x9319('0x2c')],qs[_0x9319('0x32')](_0x2d0855[_0x9319('0x2d')][_0x9319('0x32')]));_0x4bd7d2[_0x9319('0x31')]=_0x4bd7d2[_0x9319('0x31')][_0x9319('0x44')]?_0x4bd7d2[_0x9319('0x31')]:_0x5b8a6f[_0x9319('0x2c')];if(_0x2d0855[_0x9319('0x2d')][_0x9319('0x45')]){_0x4bd7d2['include']=[{'all':!![]}];}_0x4bd7d2=_['merge']({},_0x4bd7d2,_0x2d0855[_0x9319('0x3d')]);return db[_0x9319('0x29')]['find'](_0x4bd7d2)[_0x9319('0x22')](handleEntityNotFound(_0x1187c3,null))[_0x9319('0x22')](respondWithResult(_0x1187c3,null))[_0x9319('0x41')](handleError(_0x1187c3,null));};exports['create']=function(_0x3cae8f,_0x277bec){return db[_0x9319('0x29')][_0x9319('0x46')](_0x3cae8f['body'],{})['then'](respondWithResult(_0x277bec,0xc9))['catch'](handleError(_0x277bec,null));};exports[_0x9319('0x47')]=function(_0x43cead,_0x3e4b44){if(_0x43cead[_0x9319('0x48')]['id']){delete _0x43cead[_0x9319('0x48')]['id'];}return db['FreshdeskConfiguration'][_0x9319('0x49')]({'where':{'id':_0x43cead['params']['id']}})[_0x9319('0x22')](handleEntityNotFound(_0x3e4b44,null))[_0x9319('0x22')](saveUpdates(_0x43cead[_0x9319('0x48')],null))[_0x9319('0x22')](respondWithResult(_0x3e4b44,null))[_0x9319('0x41')](handleError(_0x3e4b44,null));};exports[_0x9319('0x23')]=function(_0x23876e,_0x221a98){return db[_0x9319('0x29')][_0x9319('0x49')]({'where':{'id':_0x23876e[_0x9319('0x43')]['id']}})[_0x9319('0x22')](handleEntityNotFound(_0x221a98,null))[_0x9319('0x22')](removeEntity(_0x221a98,null))[_0x9319('0x41')](handleError(_0x221a98,null));};exports['getFields']=function(_0x47a04d,_0x2c84b3,_0x5160c6){var _0x5d5359={};var _0x4faf2d={};var _0x40a5d2;var _0x2afa82;return db[_0x9319('0x29')][_0x9319('0x4a')]({'where':{'id':_0x47a04d[_0x9319('0x43')]['id']}})[_0x9319('0x22')](handleEntityNotFound(_0x2c84b3,null))[_0x9319('0x22')](function(_0x2ffcc4){if(_0x2ffcc4){_0x40a5d2=_0x2ffcc4;_0x4faf2d[_0x9319('0x2c')]=_[_0x9319('0x2e')](db[_0x9319('0x4b')][_0x9319('0x2a')]);_0x4faf2d[_0x9319('0x2d')]=_['keys'](_0x47a04d[_0x9319('0x2d')]);_0x4faf2d[_0x9319('0x2f')]=_[_0x9319('0x30')](_0x4faf2d['model'],_0x4faf2d[_0x9319('0x2d')]);_0x5d5359[_0x9319('0x31')]=_['intersection'](_0x4faf2d[_0x9319('0x2c')],qs[_0x9319('0x32')](_0x47a04d['query']['fields']));_0x5d5359['attributes']=_0x5d5359[_0x9319('0x31')][_0x9319('0x44')]?_0x5d5359['attributes']:_0x4faf2d[_0x9319('0x2c')];_0x5d5359[_0x9319('0x35')]=qs['sort'](_0x47a04d[_0x9319('0x2d')]['sort']);_0x5d5359['where']=qs['filters'](_[_0x9319('0x37')](_0x47a04d[_0x9319('0x2d')],_0x4faf2d[_0x9319('0x2f')]));if(_0x47a04d['query']['filter']){_0x5d5359[_0x9319('0x39')]=_[_0x9319('0x3a')](_0x5d5359[_0x9319('0x39')],{'$or':_[_0x9319('0x28')](_0x5d5359[_0x9319('0x31')],function(_0x5cdedb){var _0x3427c9={};_0x3427c9[_0x5cdedb]={'$like':'%'+_0x47a04d[_0x9319('0x2d')]['filter']+'%'};return _0x3427c9;})});}_0x5d5359=_[_0x9319('0x3a')]({},_0x5d5359,_0x47a04d['options']);return _0x40a5d2[_0x9319('0x4c')](_0x5d5359);}})[_0x9319('0x22')](function(_0x4c3d59){if(_0x4c3d59){_0x2afa82=_0x4c3d59['length'];if(!_0x47a04d[_0x9319('0x2d')]['hasOwnProperty'](_0x9319('0x34'))){_0x5d5359[_0x9319('0x1d')]=qs[_0x9319('0x1d')](_0x47a04d['query'][_0x9319('0x1d')]);_0x5d5359[_0x9319('0x1a')]=qs[_0x9319('0x1a')](_0x47a04d[_0x9319('0x2d')][_0x9319('0x1a')]);}return _0x40a5d2[_0x9319('0x4c')](_0x5d5359);}})[_0x9319('0x22')](function(_0x281875){if(_0x281875){return _0x281875?{'count':_0x2afa82,'rows':_0x281875}:null;}})[_0x9319('0x22')](respondWithResult(_0x2c84b3,null))[_0x9319('0x41')](handleError(_0x2c84b3,null));};exports[_0x9319('0x4d')]=function(_0x4d20d6,_0x1e07d8,_0x4d9b26){var _0x5a074f={};var _0x2e08ba={};var _0x78f1ea;var _0x5cbfd8;return db[_0x9319('0x29')][_0x9319('0x4a')]({'where':{'id':_0x4d20d6['params']['id']}})[_0x9319('0x22')](handleEntityNotFound(_0x1e07d8,null))['then'](function(_0x237eeb){if(_0x237eeb){_0x78f1ea=_0x237eeb;_0x2e08ba[_0x9319('0x2c')]=_[_0x9319('0x2e')](db['FreshdeskField'][_0x9319('0x2a')]);_0x2e08ba[_0x9319('0x2d')]=_[_0x9319('0x2e')](_0x4d20d6[_0x9319('0x2d')]);_0x2e08ba[_0x9319('0x2f')]=_[_0x9319('0x30')](_0x2e08ba[_0x9319('0x2c')],_0x2e08ba[_0x9319('0x2d')]);_0x5a074f[_0x9319('0x31')]=_[_0x9319('0x30')](_0x2e08ba[_0x9319('0x2c')],qs[_0x9319('0x32')](_0x4d20d6[_0x9319('0x2d')]['fields']));_0x5a074f['attributes']=_0x5a074f['attributes'][_0x9319('0x44')]?_0x5a074f[_0x9319('0x31')]:_0x2e08ba['model'];_0x5a074f[_0x9319('0x35')]=qs[_0x9319('0x36')](_0x4d20d6[_0x9319('0x2d')][_0x9319('0x36')]);_0x5a074f[_0x9319('0x39')]=qs[_0x9319('0x2f')](_[_0x9319('0x37')](_0x4d20d6[_0x9319('0x2d')],_0x2e08ba[_0x9319('0x2f')]));if(_0x4d20d6[_0x9319('0x2d')][_0x9319('0x38')]){_0x5a074f[_0x9319('0x39')]=_['merge'](_0x5a074f[_0x9319('0x39')],{'$or':_[_0x9319('0x28')](_0x5a074f['attributes'],function(_0x336d8f){var _0x1c8297={};_0x1c8297[_0x336d8f]={'$like':'%'+_0x4d20d6['query'][_0x9319('0x38')]+'%'};return _0x1c8297;})});}_0x5a074f=_[_0x9319('0x3a')]({},_0x5a074f,_0x4d20d6[_0x9319('0x3d')]);return _0x78f1ea['getSubjects'](_0x5a074f);}})[_0x9319('0x22')](function(_0x19ad74){if(_0x19ad74){_0x5cbfd8=_0x19ad74[_0x9319('0x44')];if(!_0x4d20d6['query'][_0x9319('0x33')](_0x9319('0x34'))){_0x5a074f[_0x9319('0x1d')]=qs[_0x9319('0x1d')](_0x4d20d6[_0x9319('0x2d')]['limit']);_0x5a074f[_0x9319('0x1a')]=qs[_0x9319('0x1a')](_0x4d20d6[_0x9319('0x2d')][_0x9319('0x1a')]);}return _0x78f1ea[_0x9319('0x4d')](_0x5a074f);}})[_0x9319('0x22')](function(_0x5bf26f){if(_0x5bf26f){return _0x5bf26f?{'count':_0x5cbfd8,'rows':_0x5bf26f}:null;}})[_0x9319('0x22')](respondWithResult(_0x1e07d8,null))['catch'](handleError(_0x1e07d8,null));};exports[_0x9319('0x4e')]=function(_0x2b430f,_0xf10854,_0x1e8921){var _0x5cc950={};var _0x31baca={};var _0x33f838;var _0x537044;return db[_0x9319('0x29')][_0x9319('0x4a')]({'where':{'id':_0x2b430f[_0x9319('0x43')]['id']}})['then'](handleEntityNotFound(_0xf10854,null))[_0x9319('0x22')](function(_0x24f0b3){if(_0x24f0b3){_0x33f838=_0x24f0b3;_0x31baca[_0x9319('0x2c')]=_[_0x9319('0x2e')](db[_0x9319('0x4b')]['rawAttributes']);_0x31baca[_0x9319('0x2d')]=_[_0x9319('0x2e')](_0x2b430f[_0x9319('0x2d')]);_0x31baca[_0x9319('0x2f')]=_[_0x9319('0x30')](_0x31baca['model'],_0x31baca[_0x9319('0x2d')]);_0x5cc950[_0x9319('0x31')]=_[_0x9319('0x30')](_0x31baca[_0x9319('0x2c')],qs['fields'](_0x2b430f[_0x9319('0x2d')][_0x9319('0x32')]));_0x5cc950[_0x9319('0x31')]=_0x5cc950[_0x9319('0x31')]['length']?_0x5cc950[_0x9319('0x31')]:_0x31baca[_0x9319('0x2c')];_0x5cc950['order']=qs[_0x9319('0x36')](_0x2b430f[_0x9319('0x2d')][_0x9319('0x36')]);_0x5cc950[_0x9319('0x39')]=qs[_0x9319('0x2f')](_[_0x9319('0x37')](_0x2b430f[_0x9319('0x2d')],_0x31baca[_0x9319('0x2f')]));if(_0x2b430f[_0x9319('0x2d')][_0x9319('0x38')]){_0x5cc950['where']=_[_0x9319('0x3a')](_0x5cc950[_0x9319('0x39')],{'$or':_[_0x9319('0x28')](_0x5cc950[_0x9319('0x31')],function(_0x562eb1){var _0x53db20={};_0x53db20[_0x562eb1]={'$like':'%'+_0x2b430f['query'][_0x9319('0x38')]+'%'};return _0x53db20;})});}_0x5cc950=_[_0x9319('0x3a')]({},_0x5cc950,_0x2b430f[_0x9319('0x3d')]);return _0x33f838[_0x9319('0x4e')](_0x5cc950);}})['then'](function(_0x396c0c){if(_0x396c0c){_0x537044=_0x396c0c['length'];if(!_0x2b430f['query']['hasOwnProperty']('nolimit')){_0x5cc950['limit']=qs[_0x9319('0x1d')](_0x2b430f['query'][_0x9319('0x1d')]);_0x5cc950['offset']=qs[_0x9319('0x1a')](_0x2b430f['query'][_0x9319('0x1a')]);}return _0x33f838['getDescriptions'](_0x5cc950);}})[_0x9319('0x22')](function(_0x274820){if(_0x274820){return _0x274820?{'count':_0x537044,'rows':_0x274820}:null;}})[_0x9319('0x22')](respondWithResult(_0xf10854,null))[_0x9319('0x41')](handleError(_0xf10854,null));};exports[_0x9319('0x4f')]=function(_0x461349,_0x5322ca,_0x567962){var _0x525a5d={};var _0x74269f={};var _0x10f230;var _0x2dc429;return db[_0x9319('0x29')]['findOne']({'where':{'id':_0x461349[_0x9319('0x43')]['id']}})[_0x9319('0x22')](handleEntityNotFound(_0x5322ca,null))['then'](function(_0x20b283){if(_0x20b283){_0x10f230=_0x20b283;_0x74269f[_0x9319('0x2c')]=_['keys'](db['Tag'][_0x9319('0x2a')]);_0x74269f['query']=_['keys'](_0x461349[_0x9319('0x2d')]);_0x74269f[_0x9319('0x2f')]=_[_0x9319('0x30')](_0x74269f[_0x9319('0x2c')],_0x74269f[_0x9319('0x2d')]);_0x525a5d[_0x9319('0x31')]=_[_0x9319('0x30')](_0x74269f[_0x9319('0x2c')],qs[_0x9319('0x32')](_0x461349[_0x9319('0x2d')]['fields']));_0x525a5d[_0x9319('0x31')]=_0x525a5d[_0x9319('0x31')]['length']?_0x525a5d['attributes']:_0x74269f[_0x9319('0x2c')];_0x525a5d[_0x9319('0x35')]=qs[_0x9319('0x36')](_0x461349['query'][_0x9319('0x36')]);_0x525a5d[_0x9319('0x39')]=qs['filters'](_['pick'](_0x461349['query'],_0x74269f[_0x9319('0x2f')]));if(_0x461349[_0x9319('0x2d')][_0x9319('0x38')]){_0x525a5d[_0x9319('0x39')]=_[_0x9319('0x3a')](_0x525a5d[_0x9319('0x39')],{'$or':_['map'](_0x525a5d['attributes'],function(_0x2dd10e){var _0x55e9df={};_0x55e9df[_0x2dd10e]={'$like':'%'+_0x461349[_0x9319('0x2d')][_0x9319('0x38')]+'%'};return _0x55e9df;})});}_0x525a5d=_[_0x9319('0x3a')]({},_0x525a5d,_0x461349[_0x9319('0x3d')]);return _0x10f230[_0x9319('0x4f')](_0x525a5d);}})[_0x9319('0x22')](function(_0x47bde9){if(_0x47bde9){_0x2dc429=_0x47bde9['length'];if(!_0x461349[_0x9319('0x2d')][_0x9319('0x33')]('nolimit')){_0x525a5d[_0x9319('0x1d')]=qs['limit'](_0x461349[_0x9319('0x2d')]['limit']);_0x525a5d[_0x9319('0x1a')]=qs[_0x9319('0x1a')](_0x461349['query']['offset']);}return _0x10f230[_0x9319('0x4f')](_0x525a5d);}})[_0x9319('0x22')](function(_0x1f97d6){if(_0x1f97d6){return _0x1f97d6?{'count':_0x2dc429,'rows':_0x1f97d6}:null;}})[_0x9319('0x22')](respondWithResult(_0x5322ca,null))['catch'](handleError(_0x5322ca,null));};exports[_0x9319('0x50')]=function(_0x4f6145,_0x1500b9,_0x501e70){if(_0x4f6145[_0x9319('0x48')]['id']){delete _0x4f6145[_0x9319('0x48')]['id'];}return db[_0x9319('0x29')][_0x9319('0x4a')]({'where':{'id':_0x4f6145[_0x9319('0x43')]['id']}})[_0x9319('0x22')](handleEntityNotFound(_0x1500b9,null))[_0x9319('0x22')](function(_0x1ba097){if(_0x1ba097){return _0x1ba097[_0x9319('0x50')](_0x4f6145['body'][_0x9319('0x51')]||[]);}return null;})[_0x9319('0x22')](respondWithResult(_0x1500b9,null))['catch'](handleError(_0x1500b9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 789473f..659296e 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 _0x5122=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3ae8f4,_0x2920f4){var _0x367312=function(_0x4dffbf){while(--_0x4dffbf){_0x3ae8f4['push'](_0x3ae8f4['shift']());}};_0x367312(++_0x2920f4);}(_0x5122,0xd1));var _0x2512=function(_0xedc55a,_0x356697){_0xedc55a=_0xedc55a-0x0;var _0x185075=_0x5122[_0xedc55a];return _0x185075;};'use strict';var _=require(_0x2512('0x0'));var util=require(_0x2512('0x1'));var logger=require(_0x2512('0x2'))('api');var moment=require(_0x2512('0x3'));var BPromise=require(_0x2512('0x4'));var rp=require(_0x2512('0x5'));var fs=require('fs');var path=require(_0x2512('0x6'));var rimraf=require(_0x2512('0x7'));var config=require(_0x2512('0x8'));var attributes=require(_0x2512('0x9'));module['exports']=function(_0x91eb9f,_0x31087f){return _0x91eb9f[_0x2512('0xa')](_0x2512('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f02=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x2cebe1,_0x2d18c7){var _0x4ba945=function(_0x142350){while(--_0x142350){_0x2cebe1['push'](_0x2cebe1['shift']());}};_0x4ba945(++_0x2d18c7);}(_0x1f02,0x71));var _0x21f0=function(_0x365c07,_0x3e9139){_0x365c07=_0x365c07-0x0;var _0x5cafc4=_0x1f02[_0x365c07];return _0x5cafc4;};'use strict';var _=require('lodash');var util=require(_0x21f0('0x0'));var logger=require(_0x21f0('0x1'))(_0x21f0('0x2'));var moment=require(_0x21f0('0x3'));var BPromise=require('bluebird');var rp=require(_0x21f0('0x4'));var fs=require('fs');var path=require(_0x21f0('0x5'));var rimraf=require('rimraf');var config=require(_0x21f0('0x6'));var attributes=require(_0x21f0('0x7'));module['exports']=function(_0x558a29,_0x5813cb){return _0x558a29[_0x21f0('0x8')](_0x21f0('0x9'),attributes,{'tableName':_0x21f0('0xa'),'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 c6ce515..7abaa68 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 _0x661c=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger'];(function(_0x167a23,_0x38e693){var _0x25ed59=function(_0x25c938){while(--_0x25c938){_0x167a23['push'](_0x167a23['shift']());}};_0x25ed59(++_0x38e693);}(_0x661c,0xb2));var _0xc661=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x661c[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xc661('0x0'));var util=require(_0xc661('0x1'));var moment=require(_0xc661('0x2'));var BPromise=require('bluebird');var rs=require(_0xc661('0x3'));var fs=require('fs');var Redis=require(_0xc661('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc661('0x5'))('rpc');var config=require(_0xc661('0x6'));var jayson=require(_0xc661('0x7'));var client=jayson[_0xc661('0x8')][_0xc661('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c998b,_0x4bc226,_0x478ee7){return new BPromise(function(_0x583d02,_0x530942){return client[_0xc661('0xa')](_0x5c998b,_0x478ee7)[_0xc661('0xb')](function(_0x11459b){logger[_0xc661('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4bc226,_0xc661('0xd'));logger[_0xc661('0xe')](_0xc661('0xf'),_0x4bc226,_0xc661('0xd'),JSON[_0xc661('0x10')](_0x11459b));if(_0x11459b[_0xc661('0x11')]){if(_0x11459b[_0xc661('0x11')][_0xc661('0x12')]===0x1f4){logger[_0xc661('0x11')](_0xc661('0x13'),_0x4bc226,_0x11459b[_0xc661('0x11')]['message']);return _0x530942(_0x11459b[_0xc661('0x11')][_0xc661('0x14')]);}logger[_0xc661('0x11')](_0xc661('0x13'),_0x4bc226,_0x11459b[_0xc661('0x11')][_0xc661('0x14')]);return _0x583d02(_0x11459b['error'][_0xc661('0x14')]);}else{logger['info'](_0xc661('0x13'),_0x4bc226,_0xc661('0xd'));_0x583d02(_0x11459b[_0xc661('0x15')][_0xc661('0x14')]);}})[_0xc661('0x16')](function(_0xcd5518){logger[_0xc661('0x11')](_0xc661('0x13'),_0x4bc226,_0xcd5518);_0x530942(_0xcd5518);});});} \ No newline at end of file +var _0x575f=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message'];(function(_0x3d4948,_0x7b5e60){var _0x1a875d=function(_0x488381){while(--_0x488381){_0x3d4948['push'](_0x3d4948['shift']());}};_0x1a875d(++_0x7b5e60);}(_0x575f,0x178));var _0xf575=function(_0x38b3d3,_0x4c9f57){_0x38b3d3=_0x38b3d3-0x0;var _0x342e5e=_0x575f[_0x38b3d3];return _0x342e5e;};'use strict';var _=require(_0xf575('0x0'));var util=require(_0xf575('0x1'));var moment=require(_0xf575('0x2'));var BPromise=require('bluebird');var rs=require(_0xf575('0x3'));var fs=require('fs');var Redis=require(_0xf575('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf575('0x5'));var logger=require(_0xf575('0x6'))(_0xf575('0x7'));var config=require('../../config/environment');var jayson=require(_0xf575('0x8'));var client=jayson[_0xf575('0x9')][_0xf575('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6a33e0,_0x488526,_0x289a1d){return new BPromise(function(_0x1a3101,_0x46b2f6){return client[_0xf575('0xb')](_0x6a33e0,_0x289a1d)[_0xf575('0xc')](function(_0x5af72c){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x488526,_0xf575('0xd'));logger['debug'](_0xf575('0xe'),_0x488526,_0xf575('0xd'),JSON[_0xf575('0xf')](_0x5af72c));if(_0x5af72c[_0xf575('0x10')]){if(_0x5af72c[_0xf575('0x10')][_0xf575('0x11')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x488526,_0x5af72c[_0xf575('0x10')]['message']);return _0x46b2f6(_0x5af72c[_0xf575('0x10')]['message']);}logger[_0xf575('0x10')](_0xf575('0x12'),_0x488526,_0x5af72c['error'][_0xf575('0x13')]);return _0x1a3101(_0x5af72c[_0xf575('0x10')][_0xf575('0x13')]);}else{logger['info'](_0xf575('0x12'),_0x488526,'request\x20sent');_0x1a3101(_0x5af72c[_0xf575('0x14')][_0xf575('0x13')]);}})[_0xf575('0x15')](function(_0x356cf5){logger['error'](_0xf575('0x12'),_0x488526,_0x356cf5);_0x46b2f6(_0x356cf5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 001fe45..a55a334 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 _0x8770=['create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8770,0xe3));var _0x0877=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8770[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0877('0x0'));var util=require('util');var path=require(_0x0877('0x1'));var timeout=require(_0x0877('0x2'));var express=require(_0x0877('0x3'));var router=express[_0x0877('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0877('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0877('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x0877('0x7')]('/',auth[_0x0877('0x8')](),controller[_0x0877('0x9')]);router[_0x0877('0x7')]('/:id',auth[_0x0877('0x8')](),controller[_0x0877('0xa')]);router['post']('/',auth[_0x0877('0x8')](),controller[_0x0877('0xb')]);router[_0x0877('0xc')]('/:id',auth[_0x0877('0x8')](),controller['update']);router[_0x0877('0xd')](_0x0877('0xe'),auth['isAuthenticated'](),controller[_0x0877('0xf')]);module[_0x0877('0x10')]=router; \ No newline at end of file +var _0xa3ed=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3ed,0x95));var _0xda3e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa3ed[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xda3e('0x0'));var util=require(_0xda3e('0x1'));var path=require(_0xda3e('0x2'));var timeout=require(_0xda3e('0x3'));var express=require(_0xda3e('0x4'));var router=express[_0xda3e('0x5')]();var fs_extra=require(_0xda3e('0x6'));var auth=require(_0xda3e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xda3e('0x8'));var controller=require(_0xda3e('0x9'));router[_0xda3e('0xa')]('/',auth[_0xda3e('0xb')](),controller[_0xda3e('0xc')]);router[_0xda3e('0xa')](_0xda3e('0xd'),auth[_0xda3e('0xb')](),controller['show']);router[_0xda3e('0xe')]('/',auth[_0xda3e('0xb')](),controller[_0xda3e('0xf')]);router[_0xda3e('0x10')](_0xda3e('0xd'),auth[_0xda3e('0xb')](),controller[_0xda3e('0x11')]);router[_0xda3e('0x12')]('/:id',auth[_0xda3e('0xb')](),controller[_0xda3e('0x13')]);module[_0xda3e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5f0b9e3..12a10ae 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 _0x5ba5=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5ba5,0x131));var _0x55ba=function(_0x80785c,_0x16b54d){_0x80785c=_0x80785c-0x0;var _0x1ae31a=_0x5ba5[_0x80785c];return _0x1ae31a;};'use strict';var Sequelize=require(_0x55ba('0x0'));module[_0x55ba('0x1')]={'type':{'type':Sequelize[_0x55ba('0x2')](_0x55ba('0x3'),_0x55ba('0x4'),_0x55ba('0x5'),_0x55ba('0x6'),_0x55ba('0x7')),'defaultValue':_0x55ba('0x3')},'content':{'type':Sequelize[_0x55ba('0x8')]},'key':{'type':Sequelize[_0x55ba('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x55ba('0x8')]},'idField':{'type':Sequelize[_0x55ba('0x8')]},'nameField':{'type':Sequelize[_0x55ba('0x8')]},'customField':{'type':Sequelize[_0x55ba('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x55ba('0x8')]}}; \ No newline at end of file +var _0x275a=['customVariable','keyValue','picklist','STRING','exports','ENUM','string','variable'];(function(_0x5d1b00,_0x24c80e){var _0x22aaf0=function(_0x1b8ccb){while(--_0x1b8ccb){_0x5d1b00['push'](_0x5d1b00['shift']());}};_0x22aaf0(++_0x24c80e);}(_0x275a,0x16c));var _0xa275=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x275a[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0xa275('0x0')]={'type':{'type':Sequelize[_0xa275('0x1')](_0xa275('0x2'),_0xa275('0x3'),_0xa275('0x4'),_0xa275('0x5'),_0xa275('0x6')),'defaultValue':_0xa275('0x2')},'content':{'type':Sequelize[_0xa275('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa275('0x1')](_0xa275('0x2'),'variable',_0xa275('0x4'))},'keyContent':{'type':Sequelize[_0xa275('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa275('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa275('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index bdda367..e947145 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 _0x5eb1=['status','limit','count','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','send','index','map','FreshdeskField','rawAttributes','fieldName','type','model','name','query','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','keys','intersection','create','update','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5eb1,0x7c));var _0x15eb=function(_0x133fe4,_0x1f473b){_0x133fe4=_0x133fe4-0x0;var _0x4c4017=_0x5eb1[_0x133fe4];return _0x4c4017;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15eb('0x0'));var zipdir=require(_0x15eb('0x1'));var jsonpatch=require(_0x15eb('0x2'));var rp=require(_0x15eb('0x3'));var moment=require(_0x15eb('0x4'));var BPromise=require(_0x15eb('0x5'));var Mustache=require('mustache');var util=require(_0x15eb('0x6'));var path=require(_0x15eb('0x7'));var sox=require(_0x15eb('0x8'));var csv=require(_0x15eb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15eb('0xa'));var _=require(_0x15eb('0xb'));var squel=require('squel');var crypto=require(_0x15eb('0xc'));var jsforce=require(_0x15eb('0xd'));var deskjs=require(_0x15eb('0xe'));var toCsv=require(_0x15eb('0x9'));var querystring=require(_0x15eb('0xf'));var Papa=require(_0x15eb('0x10'));var Redis=require(_0x15eb('0x11'));var authService=require(_0x15eb('0x12'));var qs=require(_0x15eb('0x13'));var as=require(_0x15eb('0x14'));var hardwareService=require(_0x15eb('0x15'));var logger=require(_0x15eb('0x16'))(_0x15eb('0x17'));var utils=require('../../config/utils');var config=require(_0x15eb('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x498a0c,_0xda1ddf){_0xda1ddf=_0xda1ddf||0xcc;return function(_0x330436){if(_0x330436){return _0x498a0c[_0x15eb('0x19')](_0xda1ddf);}return _0x498a0c[_0x15eb('0x1a')](_0xda1ddf)['end']();};}function respondWithResult(_0x1d5326,_0x3b921c){_0x3b921c=_0x3b921c||0xc8;return function(_0x212f04){if(_0x212f04){return _0x1d5326[_0x15eb('0x1a')](_0x3b921c)['json'](_0x212f04);}};}function respondWithFilteredResult(_0x48aed7,_0x544e7c){return function(_0x500d58){if(_0x500d58){var _0x1188e0=typeof _0x544e7c['offset']==='undefined'&&typeof _0x544e7c[_0x15eb('0x1b')]==='undefined';var _0x2b898c=_0x500d58['count'];var _0x23a687=_0x1188e0?0x0:_0x544e7c['offset'];var _0x603d05=_0x1188e0?_0x500d58[_0x15eb('0x1c')]:_0x544e7c['offset']+_0x544e7c[_0x15eb('0x1b')];var _0x431ba8;if(_0x603d05>=_0x2b898c){_0x603d05=_0x2b898c;_0x431ba8=0xc8;}else{_0x431ba8=0xce;}_0x48aed7['status'](_0x431ba8);return _0x48aed7[_0x15eb('0x1d')](_0x15eb('0x1e'),_0x23a687+'-'+_0x603d05+'/'+_0x2b898c)[_0x15eb('0x1f')](_0x500d58);}return null;};}function patchUpdates(_0x149332){return function(_0xb66333){try{jsonpatch[_0x15eb('0x20')](_0xb66333,_0x149332,!![]);}catch(_0x56f51d){return BPromise[_0x15eb('0x21')](_0x56f51d);}return _0xb66333['save']();};}function saveUpdates(_0x2603fe,_0x49915b){return function(_0x195ae2){if(_0x195ae2){return _0x195ae2['update'](_0x2603fe)[_0x15eb('0x22')](function(_0x158674){return _0x158674;});}return null;};}function removeEntity(_0xa0cefc,_0x9b0a52){return function(_0x14d66e){if(_0x14d66e){return _0x14d66e[_0x15eb('0x23')]()[_0x15eb('0x22')](function(){_0xa0cefc[_0x15eb('0x1a')](0xcc)[_0x15eb('0x24')]();});}};}function handleEntityNotFound(_0x17c2ef,_0x526648){return function(_0x3a787d){if(!_0x3a787d){_0x17c2ef[_0x15eb('0x19')](0x194);}return _0x3a787d;};}function handleError(_0x394c25,_0x3f655b){_0x3f655b=_0x3f655b||0x1f4;return function(_0x1fcb1a){logger[_0x15eb('0x25')](_0x1fcb1a[_0x15eb('0x26')]);if(_0x1fcb1a['name']){delete _0x1fcb1a['name'];}_0x394c25[_0x15eb('0x1a')](_0x3f655b)[_0x15eb('0x27')](_0x1fcb1a);};}exports[_0x15eb('0x28')]=function(_0xa1ea61,_0x50f7be){var _0x222764={},_0x5f2df5={},_0x302bf7={'count':0x0,'rows':[]};var _0x47b056=_[_0x15eb('0x29')](db[_0x15eb('0x2a')][_0x15eb('0x2b')],function(_0x153d86){return{'name':_0x153d86[_0x15eb('0x2c')],'type':_0x153d86[_0x15eb('0x2d')]['key']};});_0x5f2df5[_0x15eb('0x2e')]=_[_0x15eb('0x29')](_0x47b056,_0x15eb('0x2f'));_0x5f2df5['query']=_['keys'](_0xa1ea61[_0x15eb('0x30')]);_0x5f2df5[_0x15eb('0x31')]=_['intersection'](_0x5f2df5['model'],_0x5f2df5['query']);_0x222764[_0x15eb('0x32')]=_['intersection'](_0x5f2df5[_0x15eb('0x2e')],qs[_0x15eb('0x33')](_0xa1ea61['query'][_0x15eb('0x33')]));_0x222764[_0x15eb('0x32')]=_0x222764[_0x15eb('0x32')][_0x15eb('0x34')]?_0x222764[_0x15eb('0x32')]:_0x5f2df5[_0x15eb('0x2e')];if(!_0xa1ea61['query'][_0x15eb('0x35')](_0x15eb('0x36'))){_0x222764[_0x15eb('0x1b')]=qs[_0x15eb('0x1b')](_0xa1ea61[_0x15eb('0x30')]['limit']);_0x222764[_0x15eb('0x37')]=qs[_0x15eb('0x37')](_0xa1ea61['query'][_0x15eb('0x37')]);}_0x222764[_0x15eb('0x38')]=qs['sort'](_0xa1ea61[_0x15eb('0x30')]['sort']);_0x222764[_0x15eb('0x39')]=qs['filters'](_[_0x15eb('0x3a')](_0xa1ea61['query'],_0x5f2df5[_0x15eb('0x31')]),_0x47b056);if(_0xa1ea61[_0x15eb('0x30')]['filter']){_0x222764['where']=_[_0x15eb('0x3b')](_0x222764[_0x15eb('0x39')],{'$or':_[_0x15eb('0x29')](_0x47b056,function(_0x530f1e){if(_0x530f1e[_0x15eb('0x2d')]!=='VIRTUAL'){var _0x2830={};_0x2830[_0x530f1e['name']]={'$like':'%'+_0xa1ea61[_0x15eb('0x30')][_0x15eb('0x3c')]+'%'};return _0x2830;}})});}_0x222764=_[_0x15eb('0x3b')]({},_0x222764,_0xa1ea61[_0x15eb('0x3d')]);var _0x724448={'where':_0x222764[_0x15eb('0x39')]};return db[_0x15eb('0x2a')][_0x15eb('0x1c')](_0x724448)[_0x15eb('0x22')](function(_0x32a5a6){_0x302bf7[_0x15eb('0x1c')]=_0x32a5a6;if(_0xa1ea61['query'][_0x15eb('0x3e')]){_0x222764[_0x15eb('0x3f')]=[{'all':!![]}];}return db[_0x15eb('0x2a')][_0x15eb('0x40')](_0x222764);})['then'](function(_0x1618e5){_0x302bf7[_0x15eb('0x41')]=_0x1618e5;return _0x302bf7;})[_0x15eb('0x22')](respondWithFilteredResult(_0x50f7be,_0x222764))[_0x15eb('0x42')](handleError(_0x50f7be,null));};exports[_0x15eb('0x43')]=function(_0x570599,_0x3ace6a){var _0x23aea0={'raw':!![],'where':{'id':_0x570599['params']['id']}},_0x5e1b5b={};_0x5e1b5b[_0x15eb('0x2e')]=_[_0x15eb('0x44')](db[_0x15eb('0x2a')]['rawAttributes']);_0x5e1b5b[_0x15eb('0x30')]=_[_0x15eb('0x44')](_0x570599['query']);_0x5e1b5b[_0x15eb('0x31')]=_[_0x15eb('0x45')](_0x5e1b5b[_0x15eb('0x2e')],_0x5e1b5b[_0x15eb('0x30')]);_0x23aea0[_0x15eb('0x32')]=_[_0x15eb('0x45')](_0x5e1b5b['model'],qs[_0x15eb('0x33')](_0x570599[_0x15eb('0x30')]['fields']));_0x23aea0[_0x15eb('0x32')]=_0x23aea0[_0x15eb('0x32')][_0x15eb('0x34')]?_0x23aea0[_0x15eb('0x32')]:_0x5e1b5b[_0x15eb('0x2e')];if(_0x570599[_0x15eb('0x30')]['includeAll']){_0x23aea0[_0x15eb('0x3f')]=[{'all':!![]}];}_0x23aea0=_['merge']({},_0x23aea0,_0x570599[_0x15eb('0x3d')]);return db['FreshdeskField']['find'](_0x23aea0)[_0x15eb('0x22')](handleEntityNotFound(_0x3ace6a,null))[_0x15eb('0x22')](respondWithResult(_0x3ace6a,null))[_0x15eb('0x42')](handleError(_0x3ace6a,null));};exports['create']=function(_0x556f9d,_0x121fc7){return db['FreshdeskField'][_0x15eb('0x46')](_0x556f9d['body'],{})[_0x15eb('0x22')](respondWithResult(_0x121fc7,0xc9))[_0x15eb('0x42')](handleError(_0x121fc7,null));};exports[_0x15eb('0x47')]=function(_0x50d0a,_0x5d5421){if(_0x50d0a[_0x15eb('0x48')]['id']){delete _0x50d0a[_0x15eb('0x48')]['id'];}return db['FreshdeskField'][_0x15eb('0x49')]({'where':{'id':_0x50d0a[_0x15eb('0x4a')]['id']}})[_0x15eb('0x22')](handleEntityNotFound(_0x5d5421,null))[_0x15eb('0x22')](saveUpdates(_0x50d0a[_0x15eb('0x48')],null))[_0x15eb('0x22')](respondWithResult(_0x5d5421,null))[_0x15eb('0x42')](handleError(_0x5d5421,null));};exports[_0x15eb('0x23')]=function(_0x33e324,_0x160c4a){return db[_0x15eb('0x2a')]['find']({'where':{'id':_0x33e324[_0x15eb('0x4a')]['id']}})[_0x15eb('0x22')](handleEntityNotFound(_0x160c4a,null))['then'](removeEntity(_0x160c4a,null))[_0x15eb('0x42')](handleError(_0x160c4a,null));}; \ No newline at end of file +var _0x0bb5=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','catch','create','body','update','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','map','FreshdeskField','fieldName','type','key'];(function(_0x1f0dcd,_0x43d42a){var _0x1c990c=function(_0x1ae695){while(--_0x1ae695){_0x1f0dcd['push'](_0x1f0dcd['shift']());}};_0x1c990c(++_0x43d42a);}(_0x0bb5,0x148));var _0x50bb=function(_0x1acd4d,_0x31175a){_0x1acd4d=_0x1acd4d-0x0;var _0x2ade06=_0x0bb5[_0x1acd4d];return _0x2ade06;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226370,_0x58837d){_0x58837d=_0x58837d||0xcc;return function(_0x283f04){if(_0x283f04){return _0x226370[_0x50bb('0x19')](_0x58837d);}return _0x226370[_0x50bb('0x1a')](_0x58837d)['end']();};}function respondWithResult(_0x17007f,_0x309986){_0x309986=_0x309986||0xc8;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['status'](_0x309986)[_0x50bb('0x1b')](_0x3094f2);}};}function respondWithFilteredResult(_0x5e8478,_0x21befa){return function(_0x3e1a51){if(_0x3e1a51){var _0x253073=typeof _0x21befa[_0x50bb('0x1c')]===_0x50bb('0x1d')&&typeof _0x21befa['limit']===_0x50bb('0x1d');var _0x174065=_0x3e1a51['count'];var _0x24ba19=_0x253073?0x0:_0x21befa['offset'];var _0x301f61=_0x253073?_0x3e1a51[_0x50bb('0x1e')]:_0x21befa['offset']+_0x21befa['limit'];var _0x43465b;if(_0x301f61>=_0x174065){_0x301f61=_0x174065;_0x43465b=0xc8;}else{_0x43465b=0xce;}_0x5e8478[_0x50bb('0x1a')](_0x43465b);return _0x5e8478[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x301f61+'/'+_0x174065)['json'](_0x3e1a51);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){_0x1a2a0b[_0x50bb('0x1a')](0xcc)[_0x50bb('0x26')]();});}};}function handleEntityNotFound(_0x284a76,_0x3462c1){return function(_0x5234d7){if(!_0x5234d7){_0x284a76[_0x50bb('0x19')](0x194);}return _0x5234d7;};}function handleError(_0x4d38f7,_0x55e87b){_0x55e87b=_0x55e87b||0x1f4;return function(_0x2befd9){logger['error'](_0x2befd9['stack']);if(_0x2befd9[_0x50bb('0x27')]){delete _0x2befd9[_0x50bb('0x27')];}_0x4d38f7[_0x50bb('0x1a')](_0x55e87b)[_0x50bb('0x28')](_0x2befd9);};}exports[_0x50bb('0x29')]=function(_0x269479,_0x41a8ad){var _0x41d479={},_0x4f7514={},_0x44ce86={'count':0x0,'rows':[]};var _0x461cf3=_[_0x50bb('0x2a')](db[_0x50bb('0x2b')]['rawAttributes'],function(_0x13dc3c){return{'name':_0x13dc3c[_0x50bb('0x2c')],'type':_0x13dc3c[_0x50bb('0x2d')][_0x50bb('0x2e')]};});_0x4f7514[_0x50bb('0x2f')]=_[_0x50bb('0x2a')](_0x461cf3,_0x50bb('0x27'));_0x4f7514[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x269479[_0x50bb('0x30')]);_0x4f7514[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x4f7514['model'],_0x4f7514[_0x50bb('0x30')]);_0x41d479[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x4f7514[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x269479[_0x50bb('0x30')][_0x50bb('0x35')]));_0x41d479[_0x50bb('0x34')]=_0x41d479[_0x50bb('0x34')][_0x50bb('0x36')]?_0x41d479[_0x50bb('0x34')]:_0x4f7514['model'];if(!_0x269479[_0x50bb('0x30')][_0x50bb('0x37')](_0x50bb('0x38'))){_0x41d479[_0x50bb('0x39')]=qs[_0x50bb('0x39')](_0x269479[_0x50bb('0x30')]['limit']);_0x41d479['offset']=qs[_0x50bb('0x1c')](_0x269479['query'][_0x50bb('0x1c')]);}_0x41d479[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x269479[_0x50bb('0x30')][_0x50bb('0x3b')]);_0x41d479['where']=qs[_0x50bb('0x32')](_['pick'](_0x269479[_0x50bb('0x30')],_0x4f7514[_0x50bb('0x32')]),_0x461cf3);if(_0x269479[_0x50bb('0x30')]['filter']){_0x41d479['where']=_[_0x50bb('0x3c')](_0x41d479[_0x50bb('0x3d')],{'$or':_[_0x50bb('0x2a')](_0x461cf3,function(_0x21a180){if(_0x21a180['type']!==_0x50bb('0x3e')){var _0x4b75dc={};_0x4b75dc[_0x21a180['name']]={'$like':'%'+_0x269479[_0x50bb('0x30')]['filter']+'%'};return _0x4b75dc;}})});}_0x41d479=_[_0x50bb('0x3c')]({},_0x41d479,_0x269479[_0x50bb('0x3f')]);var _0x1ef231={'where':_0x41d479[_0x50bb('0x3d')]};return db[_0x50bb('0x2b')][_0x50bb('0x1e')](_0x1ef231)[_0x50bb('0x24')](function(_0x1cf782){_0x44ce86[_0x50bb('0x1e')]=_0x1cf782;if(_0x269479[_0x50bb('0x30')]['includeAll']){_0x41d479['include']=[{'all':!![]}];}return db[_0x50bb('0x2b')][_0x50bb('0x40')](_0x41d479);})[_0x50bb('0x24')](function(_0x1d929d){_0x44ce86['rows']=_0x1d929d;return _0x44ce86;})[_0x50bb('0x24')](respondWithFilteredResult(_0x41a8ad,_0x41d479))['catch'](handleError(_0x41a8ad,null));};exports[_0x50bb('0x41')]=function(_0x473a4c,_0x379944){var _0x40748d={'raw':!![],'where':{'id':_0x473a4c[_0x50bb('0x42')]['id']}},_0x1c438b={};_0x1c438b[_0x50bb('0x2f')]=_[_0x50bb('0x31')](db[_0x50bb('0x2b')][_0x50bb('0x43')]);_0x1c438b[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x473a4c[_0x50bb('0x30')]);_0x1c438b[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x1c438b[_0x50bb('0x2f')],_0x1c438b['query']);_0x40748d[_0x50bb('0x34')]=_['intersection'](_0x1c438b[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x473a4c[_0x50bb('0x30')][_0x50bb('0x35')]));_0x40748d[_0x50bb('0x34')]=_0x40748d[_0x50bb('0x34')][_0x50bb('0x36')]?_0x40748d[_0x50bb('0x34')]:_0x1c438b[_0x50bb('0x2f')];if(_0x473a4c[_0x50bb('0x30')][_0x50bb('0x44')]){_0x40748d[_0x50bb('0x45')]=[{'all':!![]}];}_0x40748d=_[_0x50bb('0x3c')]({},_0x40748d,_0x473a4c[_0x50bb('0x3f')]);return db['FreshdeskField'][_0x50bb('0x46')](_0x40748d)['then'](handleEntityNotFound(_0x379944,null))[_0x50bb('0x24')](respondWithResult(_0x379944,null))[_0x50bb('0x47')](handleError(_0x379944,null));};exports[_0x50bb('0x48')]=function(_0x35b440,_0x650e91){return db[_0x50bb('0x2b')][_0x50bb('0x48')](_0x35b440[_0x50bb('0x49')],{})['then'](respondWithResult(_0x650e91,0xc9))[_0x50bb('0x47')](handleError(_0x650e91,null));};exports[_0x50bb('0x4a')]=function(_0xf52a22,_0x13afe2){if(_0xf52a22[_0x50bb('0x49')]['id']){delete _0xf52a22['body']['id'];}return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0xf52a22[_0x50bb('0x42')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x13afe2,null))[_0x50bb('0x24')](saveUpdates(_0xf52a22['body'],null))['then'](respondWithResult(_0x13afe2,null))[_0x50bb('0x47')](handleError(_0x13afe2,null));};exports['destroy']=function(_0x357d08,_0x57ee0e){return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0x357d08[_0x50bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x57ee0e,null))[_0x50bb('0x24')](removeEntity(_0x57ee0e,null))[_0x50bb('0x47')](handleError(_0x57ee0e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 87f2afb..cb84c8f 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 _0x50d6=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50d6,0xc5));var _0x650d=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0x50d6[_0x1f1a97];return _0x29fc6a;};'use strict';var _=require(_0x650d('0x0'));var util=require('util');var logger=require(_0x650d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x650d('0x2'));var rp=require(_0x650d('0x3'));var fs=require('fs');var path=require(_0x650d('0x4'));var rimraf=require(_0x650d('0x5'));var config=require('../../config/environment');var attributes=require(_0x650d('0x6'));module['exports']=function(_0x243127,_0x3751e6){return _0x243127['define'](_0x650d('0x7'),attributes,{'tableName':_0x650d('0x8'),'paranoid':![],'indexes':[{'name':_0x650d('0x9'),'fields':[_0x650d('0xa'),_0x650d('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe50e=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x327da4,_0x558f0f){var _0xfdd883=function(_0x53bd7f){while(--_0x53bd7f){_0x327da4['push'](_0x327da4['shift']());}};_0xfdd883(++_0x558f0f);}(_0xe50e,0xf9));var _0xee50=function(_0x5adc90,_0x4c694e){_0x5adc90=_0x5adc90-0x0;var _0x1509ca=_0xe50e[_0x5adc90];return _0x1509ca;};'use strict';var _=require(_0xee50('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xee50('0x1'));var BPromise=require(_0xee50('0x2'));var rp=require(_0xee50('0x3'));var fs=require('fs');var path=require(_0xee50('0x4'));var rimraf=require(_0xee50('0x5'));var config=require(_0xee50('0x6'));var attributes=require(_0xee50('0x7'));module[_0xee50('0x8')]=function(_0x3fe965,_0x3b0585){return _0x3fe965[_0xee50('0x9')](_0xee50('0xa'),attributes,{'tableName':_0xee50('0xb'),'paranoid':![],'indexes':[{'name':_0xee50('0xc'),'fields':[_0xee50('0xd'),_0xee50('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 36b9214..e286ff0 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 _0x3b3a=['rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3538b7,_0x3ffb53){var _0x2296a6=function(_0xa82d90){while(--_0xa82d90){_0x3538b7['push'](_0x3538b7['shift']());}};_0x2296a6(++_0x3ffb53);}(_0x3b3a,0x1c6));var _0xa3b3=function(_0x325077,_0x5c9a4b){_0x325077=_0x325077-0x0;var _0x4453d3=_0x3b3a[_0x325077];return _0x4453d3;};'use strict';var _=require(_0xa3b3('0x0'));var util=require('util');var moment=require(_0xa3b3('0x1'));var BPromise=require(_0xa3b3('0x2'));var rs=require(_0xa3b3('0x3'));var fs=require('fs');var Redis=require(_0xa3b3('0x4'));var db=require(_0xa3b3('0x5'))['db'];var utils=require(_0xa3b3('0x6'));var logger=require(_0xa3b3('0x7'))(_0xa3b3('0x8'));var config=require(_0xa3b3('0x9'));var jayson=require(_0xa3b3('0xa'));var client=jayson[_0xa3b3('0xb')][_0xa3b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b92f8,_0x2e99cc,_0x232c4d){return new BPromise(function(_0x26ef67,_0x5a0d4b){return client[_0xa3b3('0xd')](_0x4b92f8,_0x232c4d)[_0xa3b3('0xe')](function(_0x36b2b7){logger['info'](_0xa3b3('0xf'),_0x2e99cc,_0xa3b3('0x10'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2e99cc,_0xa3b3('0x10'),JSON[_0xa3b3('0x11')](_0x36b2b7));if(_0x36b2b7[_0xa3b3('0x12')]){if(_0x36b2b7[_0xa3b3('0x12')]['code']===0x1f4){logger[_0xa3b3('0x12')](_0xa3b3('0xf'),_0x2e99cc,_0x36b2b7['error']['message']);return _0x5a0d4b(_0x36b2b7[_0xa3b3('0x12')][_0xa3b3('0x13')]);}logger[_0xa3b3('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x2e99cc,_0x36b2b7[_0xa3b3('0x12')]['message']);return _0x26ef67(_0x36b2b7[_0xa3b3('0x12')][_0xa3b3('0x13')]);}else{logger[_0xa3b3('0x14')](_0xa3b3('0xf'),_0x2e99cc,_0xa3b3('0x10'));_0x26ef67(_0x36b2b7[_0xa3b3('0x15')][_0xa3b3('0x13')]);}})['catch'](function(_0x2be2e7){logger[_0xa3b3('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x2e99cc,_0x2be2e7);_0x5a0d4b(_0x2be2e7);});});} \ No newline at end of file +var _0x3950=['error','message','result','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38e729,_0x532f4e){var _0x2efd36=function(_0x2bdaae){while(--_0x2bdaae){_0x38e729['push'](_0x38e729['shift']());}};_0x2efd36(++_0x532f4e);}(_0x3950,0x1e9));var _0x0395=function(_0x17ebae,_0x7da3){_0x17ebae=_0x17ebae-0x0;var _0x8cbe7d=_0x3950[_0x17ebae];return _0x8cbe7d;};'use strict';var _=require(_0x0395('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0395('0x1'));var rs=require(_0x0395('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0395('0x3'));var logger=require(_0x0395('0x4'))(_0x0395('0x5'));var config=require('../../config/environment');var jayson=require(_0x0395('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d204e,_0x27bf74,_0x3dac4c){return new BPromise(function(_0x1034d1,_0x5632d8){return client[_0x0395('0x7')](_0x2d204e,_0x3dac4c)[_0x0395('0x8')](function(_0x569050){logger[_0x0395('0x9')](_0x0395('0xa'),_0x27bf74,_0x0395('0xb'));logger[_0x0395('0xc')](_0x0395('0xd'),_0x27bf74,_0x0395('0xb'),JSON[_0x0395('0xe')](_0x569050));if(_0x569050[_0x0395('0xf')]){if(_0x569050['error']['code']===0x1f4){logger[_0x0395('0xf')](_0x0395('0xa'),_0x27bf74,_0x569050[_0x0395('0xf')][_0x0395('0x10')]);return _0x5632d8(_0x569050[_0x0395('0xf')][_0x0395('0x10')]);}logger[_0x0395('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x27bf74,_0x569050[_0x0395('0xf')][_0x0395('0x10')]);return _0x1034d1(_0x569050[_0x0395('0xf')]['message']);}else{logger[_0x0395('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x27bf74,_0x0395('0xb'));_0x1034d1(_0x569050[_0x0395('0x11')]['message']);}})['catch'](function(_0xd83fd4){logger[_0x0395('0xf')](_0x0395('0xa'),_0x27bf74,_0xd83fd4);_0x5632d8(_0xd83fd4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2ef23cb..79162c6 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 _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x16d2,0x123));var _0x216d=function(_0x4179b1,_0x18b2b8){_0x4179b1=_0x4179b1-0x0;var _0x7a26bf=_0x16d2[_0x4179b1];return _0x7a26bf;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router; \ No newline at end of file +var _0xac4a=['show','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','get'];(function(_0x174a7c,_0x163b97){var _0x2e35d6=function(_0x31157f){while(--_0x31157f){_0x174a7c['push'](_0x174a7c['shift']());}};_0x2e35d6(++_0x163b97);}(_0xac4a,0x13f));var _0xaac4=function(_0x2aeafb,_0xc8d478){_0x2aeafb=_0x2aeafb-0x0;var _0x2305ff=_0xac4a[_0x2aeafb];return _0x2305ff;};'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')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/configurations',auth[_0xaac4('0x9')](),controller['getConfigurations']);router[_0xaac4('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xd')]('/',auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router[_0xaac4('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')](_0xaac4('0x11'),auth['isAuthenticated'](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0x14')]);module[_0xaac4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 914c24c..162d43e 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 _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9536,0x179));var _0x6953=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x9536[_0x52096b];return _0x2b1cc7;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x065e=['sequelize','STRING','username'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x065e,0x1a7));var _0xe065=function(_0x39f12a,_0x46cdb7){_0x39f12a=_0x39f12a-0x0;var _0xf0a9f3=_0x065e[_0x39f12a];return _0xf0a9f3;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe065('0x1')],'unique':_0xe065('0x2')},'apiKey':{'type':Sequelize[_0xe065('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index e3ba0a5..456472f 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 _0xaaaf=['name','send','index','map','FreshsalesAccount','fieldName','type','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','catch','keys','rawAttributes','filters','length','includeAll','options','create','body','find','params','getConfigurations','findOne','FreshsalesConfiguration','filter','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x281bd1,_0xae3ff5){var _0x50bb0e=function(_0x7be6fe){while(--_0x7be6fe){_0x281bd1['push'](_0x281bd1['shift']());}};_0x50bb0e(++_0xae3ff5);}(_0xaaaf,0x108));var _0xfaaa=function(_0x26cf78,_0x552a86){_0x26cf78=_0x26cf78-0x0;var _0xc70624=_0xaaaf[_0x26cf78];return _0xc70624;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaaa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfaaa('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xfaaa('0x2'));var util=require(_0xfaaa('0x3'));var path=require(_0xfaaa('0x4'));var sox=require(_0xfaaa('0x5'));var csv=require(_0xfaaa('0x6'));var ejs=require(_0xfaaa('0x7'));var fs=require('fs');var fs_extra=require(_0xfaaa('0x8'));var _=require(_0xfaaa('0x9'));var squel=require('squel');var crypto=require(_0xfaaa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfaaa('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfaaa('0xc'));var Papa=require(_0xfaaa('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfaaa('0xe'));var as=require(_0xfaaa('0xf'));var hardwareService=require(_0xfaaa('0x10'));var logger=require(_0xfaaa('0x11'))(_0xfaaa('0x12'));var utils=require(_0xfaaa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfaaa('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfaaa('0x15'));function respondWithStatusCode(_0x2f52f9,_0x12c738){_0x12c738=_0x12c738||0xcc;return function(_0x9d8286){if(_0x9d8286){return _0x2f52f9['sendStatus'](_0x12c738);}return _0x2f52f9[_0xfaaa('0x16')](_0x12c738)[_0xfaaa('0x17')]();};}function respondWithResult(_0x9c1d84,_0x3360eb){_0x3360eb=_0x3360eb||0xc8;return function(_0x232cd2){if(_0x232cd2){return _0x9c1d84[_0xfaaa('0x16')](_0x3360eb)['json'](_0x232cd2);}};}function respondWithFilteredResult(_0x48afa0,_0x1b402e){return function(_0x4904cf){if(_0x4904cf){var _0x1db204=typeof _0x1b402e[_0xfaaa('0x18')]==='undefined'&&typeof _0x1b402e[_0xfaaa('0x19')]===_0xfaaa('0x1a');var _0x2fac4c=_0x4904cf[_0xfaaa('0x1b')];var _0x6a958c=_0x1db204?0x0:_0x1b402e['offset'];var _0x4f9c7d=_0x1db204?_0x4904cf[_0xfaaa('0x1b')]:_0x1b402e[_0xfaaa('0x18')]+_0x1b402e[_0xfaaa('0x19')];var _0x380ed6;if(_0x4f9c7d>=_0x2fac4c){_0x4f9c7d=_0x2fac4c;_0x380ed6=0xc8;}else{_0x380ed6=0xce;}_0x48afa0[_0xfaaa('0x16')](_0x380ed6);return _0x48afa0[_0xfaaa('0x1c')](_0xfaaa('0x1d'),_0x6a958c+'-'+_0x4f9c7d+'/'+_0x2fac4c)[_0xfaaa('0x1e')](_0x4904cf);}return null;};}function patchUpdates(_0x482690){return function(_0x126537){try{jsonpatch[_0xfaaa('0x1f')](_0x126537,_0x482690,!![]);}catch(_0x2d982f){return BPromise[_0xfaaa('0x20')](_0x2d982f);}return _0x126537[_0xfaaa('0x21')]();};}function saveUpdates(_0x5d89a2,_0x331a9f){return function(_0x551f71){if(_0x551f71){return _0x551f71[_0xfaaa('0x22')](_0x5d89a2)[_0xfaaa('0x23')](function(_0x3d9f32){return _0x3d9f32;});}return null;};}function removeEntity(_0x4a4c16,_0x42f5e3){return function(_0x43fee2){if(_0x43fee2){return _0x43fee2[_0xfaaa('0x24')]()[_0xfaaa('0x23')](function(){_0x4a4c16[_0xfaaa('0x16')](0xcc)[_0xfaaa('0x17')]();});}};}function handleEntityNotFound(_0x51965a,_0x420be9){return function(_0x53c15a){if(!_0x53c15a){_0x51965a[_0xfaaa('0x25')](0x194);}return _0x53c15a;};}function handleError(_0x4f4ac1,_0xa390d1){_0xa390d1=_0xa390d1||0x1f4;return function(_0x4e6b9f){logger[_0xfaaa('0x26')](_0x4e6b9f['stack']);if(_0x4e6b9f[_0xfaaa('0x27')]){delete _0x4e6b9f[_0xfaaa('0x27')];}_0x4f4ac1[_0xfaaa('0x16')](_0xa390d1)[_0xfaaa('0x28')](_0x4e6b9f);};}exports[_0xfaaa('0x29')]=function(_0x408bf5,_0x4018de){var _0x47c925={},_0xe9bc4e={},_0x40140a={'count':0x0,'rows':[]};var _0x5160cf=_[_0xfaaa('0x2a')](db[_0xfaaa('0x2b')]['rawAttributes'],function(_0x5c85e0){return{'name':_0x5c85e0[_0xfaaa('0x2c')],'type':_0x5c85e0[_0xfaaa('0x2d')]['key']};});_0xe9bc4e['model']=_['map'](_0x5160cf,_0xfaaa('0x27'));_0xe9bc4e[_0xfaaa('0x2e')]=_['keys'](_0x408bf5['query']);_0xe9bc4e['filters']=_[_0xfaaa('0x2f')](_0xe9bc4e[_0xfaaa('0x30')],_0xe9bc4e['query']);_0x47c925[_0xfaaa('0x31')]=_[_0xfaaa('0x2f')](_0xe9bc4e[_0xfaaa('0x30')],qs[_0xfaaa('0x32')](_0x408bf5[_0xfaaa('0x2e')]['fields']));_0x47c925['attributes']=_0x47c925[_0xfaaa('0x31')]['length']?_0x47c925['attributes']:_0xe9bc4e[_0xfaaa('0x30')];if(!_0x408bf5[_0xfaaa('0x2e')][_0xfaaa('0x33')](_0xfaaa('0x34'))){_0x47c925['limit']=qs['limit'](_0x408bf5['query'][_0xfaaa('0x19')]);_0x47c925['offset']=qs[_0xfaaa('0x18')](_0x408bf5[_0xfaaa('0x2e')][_0xfaaa('0x18')]);}_0x47c925[_0xfaaa('0x35')]=qs[_0xfaaa('0x36')](_0x408bf5[_0xfaaa('0x2e')][_0xfaaa('0x36')]);_0x47c925[_0xfaaa('0x37')]=qs['filters'](_[_0xfaaa('0x38')](_0x408bf5['query'],_0xe9bc4e['filters']),_0x5160cf);if(_0x408bf5[_0xfaaa('0x2e')]['filter']){_0x47c925[_0xfaaa('0x37')]=_[_0xfaaa('0x39')](_0x47c925[_0xfaaa('0x37')],{'$or':_['map'](_0x5160cf,function(_0x2ce8c8){if(_0x2ce8c8[_0xfaaa('0x2d')]!==_0xfaaa('0x3a')){var _0x2e2134={};_0x2e2134[_0x2ce8c8[_0xfaaa('0x27')]]={'$like':'%'+_0x408bf5[_0xfaaa('0x2e')]['filter']+'%'};return _0x2e2134;}})});}_0x47c925=_[_0xfaaa('0x39')]({},_0x47c925,_0x408bf5['options']);var _0x315602={'where':_0x47c925[_0xfaaa('0x37')]};return db[_0xfaaa('0x2b')][_0xfaaa('0x1b')](_0x315602)[_0xfaaa('0x23')](function(_0x55c367){_0x40140a['count']=_0x55c367;if(_0x408bf5[_0xfaaa('0x2e')]['includeAll']){_0x47c925[_0xfaaa('0x3b')]=[{'all':!![]}];}return db[_0xfaaa('0x2b')][_0xfaaa('0x3c')](_0x47c925);})['then'](function(_0x1482e7){_0x40140a['rows']=_0x1482e7;return _0x40140a;})[_0xfaaa('0x23')](respondWithFilteredResult(_0x4018de,_0x47c925))[_0xfaaa('0x3d')](handleError(_0x4018de,null));};exports['show']=function(_0x32ef9d,_0x11f67f){var _0x2ea793={'raw':![],'where':{'id':_0x32ef9d['params']['id']}},_0x6dfceb={};_0x6dfceb[_0xfaaa('0x30')]=_[_0xfaaa('0x3e')](db[_0xfaaa('0x2b')][_0xfaaa('0x3f')]);_0x6dfceb[_0xfaaa('0x2e')]=_[_0xfaaa('0x3e')](_0x32ef9d['query']);_0x6dfceb[_0xfaaa('0x40')]=_[_0xfaaa('0x2f')](_0x6dfceb[_0xfaaa('0x30')],_0x6dfceb[_0xfaaa('0x2e')]);_0x2ea793[_0xfaaa('0x31')]=_['intersection'](_0x6dfceb[_0xfaaa('0x30')],qs['fields'](_0x32ef9d[_0xfaaa('0x2e')][_0xfaaa('0x32')]));_0x2ea793[_0xfaaa('0x31')]=_0x2ea793['attributes'][_0xfaaa('0x41')]?_0x2ea793[_0xfaaa('0x31')]:_0x6dfceb[_0xfaaa('0x30')];if(_0x32ef9d['query'][_0xfaaa('0x42')]){_0x2ea793['include']=[{'all':!![]}];}_0x2ea793=_['merge']({},_0x2ea793,_0x32ef9d[_0xfaaa('0x43')]);return db[_0xfaaa('0x2b')]['find'](_0x2ea793)[_0xfaaa('0x23')](handleEntityNotFound(_0x11f67f,null))[_0xfaaa('0x23')](respondWithResult(_0x11f67f,null))[_0xfaaa('0x3d')](handleError(_0x11f67f,null));};exports[_0xfaaa('0x44')]=function(_0x47e41d,_0xa28a38){return db[_0xfaaa('0x2b')][_0xfaaa('0x44')](_0x47e41d[_0xfaaa('0x45')],{})[_0xfaaa('0x23')](respondWithResult(_0xa28a38,0xc9))[_0xfaaa('0x3d')](handleError(_0xa28a38,null));};exports[_0xfaaa('0x22')]=function(_0x2a0919,_0x34ea38){if(_0x2a0919['body']['id']){delete _0x2a0919[_0xfaaa('0x45')]['id'];}return db['FreshsalesAccount'][_0xfaaa('0x46')]({'where':{'id':_0x2a0919[_0xfaaa('0x47')]['id']}})[_0xfaaa('0x23')](handleEntityNotFound(_0x34ea38,null))['then'](saveUpdates(_0x2a0919[_0xfaaa('0x45')],null))[_0xfaaa('0x23')](respondWithResult(_0x34ea38,null))[_0xfaaa('0x3d')](handleError(_0x34ea38,null));};exports['destroy']=function(_0x550299,_0x3d12d1){return db[_0xfaaa('0x2b')][_0xfaaa('0x46')]({'where':{'id':_0x550299[_0xfaaa('0x47')]['id']}})[_0xfaaa('0x23')](handleEntityNotFound(_0x3d12d1,null))[_0xfaaa('0x23')](removeEntity(_0x3d12d1,null))[_0xfaaa('0x3d')](handleError(_0x3d12d1,null));};exports[_0xfaaa('0x48')]=function(_0x3093be,_0x4fc05f,_0x1eaad9){var _0x172004={};var _0x5dd56f={};var _0x145076;var _0x62ab01;return db[_0xfaaa('0x2b')][_0xfaaa('0x49')]({'where':{'id':_0x3093be[_0xfaaa('0x47')]['id']}})[_0xfaaa('0x23')](handleEntityNotFound(_0x4fc05f,null))['then'](function(_0x5c2d17){if(_0x5c2d17){_0x145076=_0x5c2d17;_0x5dd56f[_0xfaaa('0x30')]=_[_0xfaaa('0x3e')](db[_0xfaaa('0x4a')][_0xfaaa('0x3f')]);_0x5dd56f[_0xfaaa('0x2e')]=_[_0xfaaa('0x3e')](_0x3093be['query']);_0x5dd56f['filters']=_[_0xfaaa('0x2f')](_0x5dd56f[_0xfaaa('0x30')],_0x5dd56f[_0xfaaa('0x2e')]);_0x172004['attributes']=_[_0xfaaa('0x2f')](_0x5dd56f['model'],qs[_0xfaaa('0x32')](_0x3093be[_0xfaaa('0x2e')]['fields']));_0x172004[_0xfaaa('0x31')]=_0x172004[_0xfaaa('0x31')]['length']?_0x172004[_0xfaaa('0x31')]:_0x5dd56f[_0xfaaa('0x30')];_0x172004[_0xfaaa('0x35')]=qs[_0xfaaa('0x36')](_0x3093be[_0xfaaa('0x2e')][_0xfaaa('0x36')]);_0x172004[_0xfaaa('0x37')]=qs[_0xfaaa('0x40')](_[_0xfaaa('0x38')](_0x3093be[_0xfaaa('0x2e')],_0x5dd56f['filters']));if(_0x3093be[_0xfaaa('0x2e')][_0xfaaa('0x4b')]){_0x172004[_0xfaaa('0x37')]=_[_0xfaaa('0x39')](_0x172004[_0xfaaa('0x37')],{'$or':_[_0xfaaa('0x2a')](_0x172004[_0xfaaa('0x31')],function(_0x3a2ebe){var _0x33bfab={};_0x33bfab[_0x3a2ebe]={'$like':'%'+_0x3093be[_0xfaaa('0x2e')][_0xfaaa('0x4b')]+'%'};return _0x33bfab;})});}_0x172004=_[_0xfaaa('0x39')]({},_0x172004,_0x3093be[_0xfaaa('0x43')]);return _0x145076[_0xfaaa('0x48')](_0x172004);}})[_0xfaaa('0x23')](function(_0x445ac9){if(_0x445ac9){_0x62ab01=_0x445ac9[_0xfaaa('0x41')];if(!_0x3093be[_0xfaaa('0x2e')][_0xfaaa('0x33')](_0xfaaa('0x34'))){_0x172004[_0xfaaa('0x19')]=qs[_0xfaaa('0x19')](_0x3093be['query']['limit']);_0x172004['offset']=qs[_0xfaaa('0x18')](_0x3093be['query']['offset']);}return _0x145076['getConfigurations'](_0x172004);}})['then'](function(_0x484606){if(_0x484606){return _0x484606?{'count':_0x62ab01,'rows':_0x484606}:null;}})[_0xfaaa('0x23')](respondWithResult(_0x4fc05f,null))[_0xfaaa('0x3d')](handleError(_0x4fc05f,null));};exports[_0xfaaa('0x4c')]=function(_0x2bcc6a,_0x46becb,_0x52aba7){if(_0x2bcc6a[_0xfaaa('0x45')]['id']){delete _0x2bcc6a[_0xfaaa('0x45')]['id'];}return db[_0xfaaa('0x2b')]['findOne']({'where':{'id':_0x2bcc6a['params']['id']}})[_0xfaaa('0x23')](handleEntityNotFound(_0x46becb,null))[_0xfaaa('0x23')](function(_0x4af0bb){if(_0x4af0bb){_0x2bcc6a[_0xfaaa('0x45')][_0xfaaa('0x4d')]=_0x4af0bb['id'];_0x2bcc6a['body'][_0xfaaa('0x4e')]=integrations['getSubjects'](_0x2bcc6a['body'][_0xfaaa('0x4f')],_0x2bcc6a[_0xfaaa('0x45')][_0xfaaa('0x2d')]);_0x2bcc6a[_0xfaaa('0x45')]['Descriptions']=integrations[_0xfaaa('0x50')](_0x2bcc6a[_0xfaaa('0x45')][_0xfaaa('0x4f')],_0x2bcc6a[_0xfaaa('0x45')][_0xfaaa('0x2d')]);return db[_0xfaaa('0x4a')][_0xfaaa('0x44')](_0x2bcc6a[_0xfaaa('0x45')],{'include':[{'model':db[_0xfaaa('0x51')],'as':_0xfaaa('0x4e')},{'model':db[_0xfaaa('0x51')],'as':_0xfaaa('0x52')}]});}return null;})[_0xfaaa('0x23')](respondWithResult(_0x46becb,null))[_0xfaaa('0x3d')](handleError(_0x46becb,null));};exports[_0xfaaa('0x53')]=function(_0x4a4cdb,_0x21e9dd,_0x3e840d){var _0xd86a9a='';var _0x36a541='';return db['FreshsalesAccount'][_0xfaaa('0x49')]({'where':{'id':_0x4a4cdb[_0xfaaa('0x47')]['id']},'attributes':['id','username',_0xfaaa('0x54'),_0xfaaa('0x55')]})[_0xfaaa('0x23')](handleEntityNotFound(_0x21e9dd,null))[_0xfaaa('0x23')](function(_0x18716f){if(_0x18716f){_0x36a541=_0x18716f[_0xfaaa('0x56')];_0xd86a9a=_0x18716f[_0xfaaa('0x54')];var _0x1e2889=_0x18716f['remoteUri'][_0xfaaa('0x57')](-0x1);if(_0x1e2889==='/'){_0xd86a9a=_0xd86a9a[_0xfaaa('0x58')](0x0,_0xd86a9a[_0xfaaa('0x59')](_0x1e2889));}return rp({'method':'GET','uri':util[_0xfaaa('0x5a')](_0xfaaa('0x5b'),_0xd86a9a,_0xfaaa('0x5c')),'headers':{'Authorization':_0xfaaa('0x5d')+_0x18716f[_0xfaaa('0x55')]},'json':!![]});}})[_0xfaaa('0x23')](function(_0x5c0a83){if(_0x5c0a83){var _0x4f2d2e=_0x5c0a83[_0xfaaa('0x5e')];var _0x2be9fc=![];var _0x152d65=null;for(_0x152d65=0x0;_0x152d65<_0x4f2d2e['length'];_0x152d65++){if(_0x4f2d2e[_0x152d65][_0xfaaa('0x5f')]===_0x36a541){_0x2be9fc=!![];}}if(_0x2be9fc){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xfaaa('0x60')});}}})[_0xfaaa('0x23')](respondWithResult(_0x21e9dd,null))[_0xfaaa('0x3d')](function(_0x358e6e){var _0x205f3e=_0x4a4cdb[_0xfaaa('0x2e')]['test']?0x1f4:_0x358e6e[_0xfaaa('0x61')]||0x1f4;logger[_0xfaaa('0x26')](_0xfaaa('0x62'),_0xfaaa('0x53'),_0x205f3e,JSON[_0xfaaa('0x63')](_0x358e6e));delete _0x358e6e['name'];if(_0x205f3e===0x191){_0x205f3e=0x190;}_0x21e9dd[_0xfaaa('0x16')](_0x205f3e)[_0xfaaa('0x28')](_0x4a4cdb[_0xfaaa('0x2e')][_0xfaaa('0x64')]?{'message':'Wrong\x20credentials','statusCode':_0x358e6e[_0xfaaa('0x61')]}:_0x358e6e);});}; \ No newline at end of file +var _0x21ff=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','Content-Range','json','apply','update','then','sendStatus','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','length','include','find','create','body','catch','destroy','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesField','username','apiKey','remoteUri','slice','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x53f715,_0x52587b){var _0x16c757=function(_0x5cc9bf){while(--_0x5cc9bf){_0x53f715['push'](_0x53f715['shift']());}};_0x16c757(++_0x52587b);}(_0x21ff,0x123));var _0xf21f=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x21ff[_0x1627ae];return _0x34b38f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf21f('0x0'));var zipdir=require(_0xf21f('0x1'));var jsonpatch=require(_0xf21f('0x2'));var rp=require(_0xf21f('0x3'));var moment=require(_0xf21f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf21f('0x5'));var util=require('util');var path=require(_0xf21f('0x6'));var sox=require(_0xf21f('0x7'));var csv=require('to-csv');var ejs=require(_0xf21f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf21f('0x9'));var crypto=require(_0xf21f('0xa'));var jsforce=require(_0xf21f('0xb'));var deskjs=require(_0xf21f('0xc'));var toCsv=require(_0xf21f('0xd'));var querystring=require(_0xf21f('0xe'));var Papa=require(_0xf21f('0xf'));var Redis=require(_0xf21f('0x10'));var authService=require(_0xf21f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf21f('0x12'));var hardwareService=require(_0xf21f('0x13'));var logger=require(_0xf21f('0x14'))(_0xf21f('0x15'));var utils=require(_0xf21f('0x16'));var config=require(_0xf21f('0x17'));var licenseUtil=require(_0xf21f('0x18'));var db=require(_0xf21f('0x19'))['db'];var integrations=require(_0xf21f('0x1a'));function respondWithStatusCode(_0x958ff0,_0xd69aae){_0xd69aae=_0xd69aae||0xcc;return function(_0x18c965){if(_0x18c965){return _0x958ff0['sendStatus'](_0xd69aae);}return _0x958ff0[_0xf21f('0x1b')](_0xd69aae)[_0xf21f('0x1c')]();};}function respondWithResult(_0x470195,_0xa8ddae){_0xa8ddae=_0xa8ddae||0xc8;return function(_0x345b77){if(_0x345b77){return _0x470195[_0xf21f('0x1b')](_0xa8ddae)['json'](_0x345b77);}};}function respondWithFilteredResult(_0x11fcc4,_0x55eeca){return function(_0x5cedf7){if(_0x5cedf7){var _0x523333=typeof _0x55eeca['offset']===_0xf21f('0x1d')&&typeof _0x55eeca[_0xf21f('0x1e')]===_0xf21f('0x1d');var _0x12c19b=_0x5cedf7[_0xf21f('0x1f')];var _0x146620=_0x523333?0x0:_0x55eeca[_0xf21f('0x20')];var _0x238a5e=_0x523333?_0x5cedf7['count']:_0x55eeca[_0xf21f('0x20')]+_0x55eeca[_0xf21f('0x1e')];var _0x32498b;if(_0x238a5e>=_0x12c19b){_0x238a5e=_0x12c19b;_0x32498b=0xc8;}else{_0x32498b=0xce;}_0x11fcc4[_0xf21f('0x1b')](_0x32498b);return _0x11fcc4['set'](_0xf21f('0x21'),_0x146620+'-'+_0x238a5e+'/'+_0x12c19b)[_0xf21f('0x22')](_0x5cedf7);}return null;};}function patchUpdates(_0x204457){return function(_0x1d27f0){try{jsonpatch[_0xf21f('0x23')](_0x1d27f0,_0x204457,!![]);}catch(_0x524e0d){return BPromise['reject'](_0x524e0d);}return _0x1d27f0['save']();};}function saveUpdates(_0x4368de,_0x2d0943){return function(_0x308b84){if(_0x308b84){return _0x308b84[_0xf21f('0x24')](_0x4368de)['then'](function(_0x4ae69e){return _0x4ae69e;});}return null;};}function removeEntity(_0x5d56c4,_0x47565d){return function(_0x5b17f7){if(_0x5b17f7){return _0x5b17f7['destroy']()[_0xf21f('0x25')](function(){_0x5d56c4[_0xf21f('0x1b')](0xcc)[_0xf21f('0x1c')]();});}};}function handleEntityNotFound(_0x400bac,_0x5996c5){return function(_0x3fbe4d){if(!_0x3fbe4d){_0x400bac[_0xf21f('0x26')](0x194);}return _0x3fbe4d;};}function handleError(_0x43befb,_0x309add){_0x309add=_0x309add||0x1f4;return function(_0x5e1474){logger[_0xf21f('0x27')](_0x5e1474[_0xf21f('0x28')]);if(_0x5e1474[_0xf21f('0x29')]){delete _0x5e1474['name'];}_0x43befb['status'](_0x309add)[_0xf21f('0x2a')](_0x5e1474);};}exports[_0xf21f('0x2b')]=function(_0x1eee7e,_0x410553){var _0x1318eb={},_0x58ff9d={},_0x46509e={'count':0x0,'rows':[]};var _0x4812c3=_['map'](db[_0xf21f('0x2c')][_0xf21f('0x2d')],function(_0x43940f){return{'name':_0x43940f[_0xf21f('0x2e')],'type':_0x43940f[_0xf21f('0x2f')][_0xf21f('0x30')]};});_0x58ff9d[_0xf21f('0x31')]=_[_0xf21f('0x32')](_0x4812c3,_0xf21f('0x29'));_0x58ff9d[_0xf21f('0x33')]=_[_0xf21f('0x34')](_0x1eee7e[_0xf21f('0x33')]);_0x58ff9d['filters']=_['intersection'](_0x58ff9d[_0xf21f('0x31')],_0x58ff9d[_0xf21f('0x33')]);_0x1318eb[_0xf21f('0x35')]=_['intersection'](_0x58ff9d['model'],qs[_0xf21f('0x36')](_0x1eee7e[_0xf21f('0x33')][_0xf21f('0x36')]));_0x1318eb[_0xf21f('0x35')]=_0x1318eb[_0xf21f('0x35')]['length']?_0x1318eb[_0xf21f('0x35')]:_0x58ff9d[_0xf21f('0x31')];if(!_0x1eee7e[_0xf21f('0x33')][_0xf21f('0x37')]('nolimit')){_0x1318eb[_0xf21f('0x1e')]=qs[_0xf21f('0x1e')](_0x1eee7e[_0xf21f('0x33')][_0xf21f('0x1e')]);_0x1318eb[_0xf21f('0x20')]=qs[_0xf21f('0x20')](_0x1eee7e[_0xf21f('0x33')]['offset']);}_0x1318eb[_0xf21f('0x38')]=qs[_0xf21f('0x39')](_0x1eee7e['query'][_0xf21f('0x39')]);_0x1318eb['where']=qs[_0xf21f('0x3a')](_[_0xf21f('0x3b')](_0x1eee7e[_0xf21f('0x33')],_0x58ff9d['filters']),_0x4812c3);if(_0x1eee7e[_0xf21f('0x33')][_0xf21f('0x3c')]){_0x1318eb[_0xf21f('0x3d')]=_[_0xf21f('0x3e')](_0x1318eb['where'],{'$or':_[_0xf21f('0x32')](_0x4812c3,function(_0xe98707){if(_0xe98707[_0xf21f('0x2f')]!==_0xf21f('0x3f')){var _0x15f9b4={};_0x15f9b4[_0xe98707[_0xf21f('0x29')]]={'$like':'%'+_0x1eee7e[_0xf21f('0x33')][_0xf21f('0x3c')]+'%'};return _0x15f9b4;}})});}_0x1318eb=_[_0xf21f('0x3e')]({},_0x1318eb,_0x1eee7e[_0xf21f('0x40')]);var _0x2709ad={'where':_0x1318eb[_0xf21f('0x3d')]};return db['FreshsalesAccount'][_0xf21f('0x1f')](_0x2709ad)['then'](function(_0x133c60){_0x46509e['count']=_0x133c60;if(_0x1eee7e[_0xf21f('0x33')][_0xf21f('0x41')]){_0x1318eb['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0xf21f('0x42')](_0x1318eb);})['then'](function(_0x3f3e1){_0x46509e[_0xf21f('0x43')]=_0x3f3e1;return _0x46509e;})['then'](respondWithFilteredResult(_0x410553,_0x1318eb))['catch'](handleError(_0x410553,null));};exports[_0xf21f('0x44')]=function(_0x5f0d88,_0x188ae3){var _0x3aa7ab={'raw':![],'where':{'id':_0x5f0d88[_0xf21f('0x45')]['id']}},_0x2e969c={};_0x2e969c['model']=_[_0xf21f('0x34')](db['FreshsalesAccount']['rawAttributes']);_0x2e969c[_0xf21f('0x33')]=_[_0xf21f('0x34')](_0x5f0d88['query']);_0x2e969c[_0xf21f('0x3a')]=_[_0xf21f('0x46')](_0x2e969c['model'],_0x2e969c[_0xf21f('0x33')]);_0x3aa7ab[_0xf21f('0x35')]=_[_0xf21f('0x46')](_0x2e969c['model'],qs[_0xf21f('0x36')](_0x5f0d88[_0xf21f('0x33')][_0xf21f('0x36')]));_0x3aa7ab[_0xf21f('0x35')]=_0x3aa7ab['attributes'][_0xf21f('0x47')]?_0x3aa7ab[_0xf21f('0x35')]:_0x2e969c[_0xf21f('0x31')];if(_0x5f0d88['query'][_0xf21f('0x41')]){_0x3aa7ab[_0xf21f('0x48')]=[{'all':!![]}];}_0x3aa7ab=_[_0xf21f('0x3e')]({},_0x3aa7ab,_0x5f0d88['options']);return db['FreshsalesAccount'][_0xf21f('0x49')](_0x3aa7ab)[_0xf21f('0x25')](handleEntityNotFound(_0x188ae3,null))[_0xf21f('0x25')](respondWithResult(_0x188ae3,null))['catch'](handleError(_0x188ae3,null));};exports[_0xf21f('0x4a')]=function(_0x213f62,_0x323347){return db[_0xf21f('0x2c')][_0xf21f('0x4a')](_0x213f62[_0xf21f('0x4b')],{})['then'](respondWithResult(_0x323347,0xc9))['catch'](handleError(_0x323347,null));};exports[_0xf21f('0x24')]=function(_0x1aca7f,_0x20bf0e){if(_0x1aca7f[_0xf21f('0x4b')]['id']){delete _0x1aca7f[_0xf21f('0x4b')]['id'];}return db[_0xf21f('0x2c')]['find']({'where':{'id':_0x1aca7f[_0xf21f('0x45')]['id']}})['then'](handleEntityNotFound(_0x20bf0e,null))[_0xf21f('0x25')](saveUpdates(_0x1aca7f['body'],null))['then'](respondWithResult(_0x20bf0e,null))[_0xf21f('0x4c')](handleError(_0x20bf0e,null));};exports[_0xf21f('0x4d')]=function(_0x5219ea,_0xb53ad5){return db[_0xf21f('0x2c')][_0xf21f('0x49')]({'where':{'id':_0x5219ea[_0xf21f('0x45')]['id']}})[_0xf21f('0x25')](handleEntityNotFound(_0xb53ad5,null))[_0xf21f('0x25')](removeEntity(_0xb53ad5,null))[_0xf21f('0x4c')](handleError(_0xb53ad5,null));};exports[_0xf21f('0x4e')]=function(_0x149f80,_0x5b7db2,_0x134e20){var _0x3e3e6e={};var _0x5d92a1={};var _0x4624bf;var _0x9d6692;return db[_0xf21f('0x2c')][_0xf21f('0x4f')]({'where':{'id':_0x149f80[_0xf21f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b7db2,null))[_0xf21f('0x25')](function(_0x685305){if(_0x685305){_0x4624bf=_0x685305;_0x5d92a1[_0xf21f('0x31')]=_[_0xf21f('0x34')](db[_0xf21f('0x50')][_0xf21f('0x2d')]);_0x5d92a1[_0xf21f('0x33')]=_[_0xf21f('0x34')](_0x149f80[_0xf21f('0x33')]);_0x5d92a1[_0xf21f('0x3a')]=_[_0xf21f('0x46')](_0x5d92a1[_0xf21f('0x31')],_0x5d92a1['query']);_0x3e3e6e['attributes']=_[_0xf21f('0x46')](_0x5d92a1['model'],qs[_0xf21f('0x36')](_0x149f80[_0xf21f('0x33')][_0xf21f('0x36')]));_0x3e3e6e[_0xf21f('0x35')]=_0x3e3e6e[_0xf21f('0x35')][_0xf21f('0x47')]?_0x3e3e6e[_0xf21f('0x35')]:_0x5d92a1[_0xf21f('0x31')];_0x3e3e6e[_0xf21f('0x38')]=qs[_0xf21f('0x39')](_0x149f80[_0xf21f('0x33')][_0xf21f('0x39')]);_0x3e3e6e[_0xf21f('0x3d')]=qs[_0xf21f('0x3a')](_[_0xf21f('0x3b')](_0x149f80[_0xf21f('0x33')],_0x5d92a1['filters']));if(_0x149f80[_0xf21f('0x33')]['filter']){_0x3e3e6e['where']=_[_0xf21f('0x3e')](_0x3e3e6e['where'],{'$or':_['map'](_0x3e3e6e['attributes'],function(_0x46916c){var _0x2ee27f={};_0x2ee27f[_0x46916c]={'$like':'%'+_0x149f80[_0xf21f('0x33')][_0xf21f('0x3c')]+'%'};return _0x2ee27f;})});}_0x3e3e6e=_[_0xf21f('0x3e')]({},_0x3e3e6e,_0x149f80['options']);return _0x4624bf[_0xf21f('0x4e')](_0x3e3e6e);}})[_0xf21f('0x25')](function(_0x4964bf){if(_0x4964bf){_0x9d6692=_0x4964bf[_0xf21f('0x47')];if(!_0x149f80['query'][_0xf21f('0x37')](_0xf21f('0x51'))){_0x3e3e6e[_0xf21f('0x1e')]=qs['limit'](_0x149f80[_0xf21f('0x33')][_0xf21f('0x1e')]);_0x3e3e6e[_0xf21f('0x20')]=qs[_0xf21f('0x20')](_0x149f80[_0xf21f('0x33')][_0xf21f('0x20')]);}return _0x4624bf[_0xf21f('0x4e')](_0x3e3e6e);}})[_0xf21f('0x25')](function(_0x4e594c){if(_0x4e594c){return _0x4e594c?{'count':_0x9d6692,'rows':_0x4e594c}:null;}})['then'](respondWithResult(_0x5b7db2,null))[_0xf21f('0x4c')](handleError(_0x5b7db2,null));};exports[_0xf21f('0x52')]=function(_0x3b1feb,_0x478692,_0x2faf5c){if(_0x3b1feb[_0xf21f('0x4b')]['id']){delete _0x3b1feb[_0xf21f('0x4b')]['id'];}return db[_0xf21f('0x2c')][_0xf21f('0x4f')]({'where':{'id':_0x3b1feb[_0xf21f('0x45')]['id']}})[_0xf21f('0x25')](handleEntityNotFound(_0x478692,null))[_0xf21f('0x25')](function(_0x5dbaa6){if(_0x5dbaa6){_0x3b1feb[_0xf21f('0x4b')][_0xf21f('0x53')]=_0x5dbaa6['id'];_0x3b1feb[_0xf21f('0x4b')][_0xf21f('0x54')]=integrations['getSubjects'](_0x3b1feb[_0xf21f('0x4b')]['channel'],_0x3b1feb[_0xf21f('0x4b')][_0xf21f('0x2f')]);_0x3b1feb[_0xf21f('0x4b')][_0xf21f('0x55')]=integrations[_0xf21f('0x56')](_0x3b1feb[_0xf21f('0x4b')][_0xf21f('0x57')],_0x3b1feb[_0xf21f('0x4b')][_0xf21f('0x2f')]);return db['FreshsalesConfiguration'][_0xf21f('0x4a')](_0x3b1feb[_0xf21f('0x4b')],{'include':[{'model':db[_0xf21f('0x58')],'as':_0xf21f('0x54')},{'model':db[_0xf21f('0x58')],'as':'Descriptions'}]});}return null;})[_0xf21f('0x25')](respondWithResult(_0x478692,null))[_0xf21f('0x4c')](handleError(_0x478692,null));};exports['getFields']=function(_0x1f4d0f,_0x4e3919,_0x540628){var _0x1b3221='';var _0x4078ea='';return db[_0xf21f('0x2c')][_0xf21f('0x4f')]({'where':{'id':_0x1f4d0f['params']['id']},'attributes':['id',_0xf21f('0x59'),'remoteUri',_0xf21f('0x5a')]})[_0xf21f('0x25')](handleEntityNotFound(_0x4e3919,null))[_0xf21f('0x25')](function(_0x1a1c32){if(_0x1a1c32){_0x4078ea=_0x1a1c32['username'];_0x1b3221=_0x1a1c32[_0xf21f('0x5b')];var _0x32d11a=_0x1a1c32[_0xf21f('0x5b')][_0xf21f('0x5c')](-0x1);if(_0x32d11a==='/'){_0x1b3221=_0x1b3221['substring'](0x0,_0x1b3221[_0xf21f('0x5d')](_0x32d11a));}return rp({'method':'GET','uri':util['format'](_0xf21f('0x5e'),_0x1b3221,_0xf21f('0x5f')),'headers':{'Authorization':_0xf21f('0x60')+_0x1a1c32[_0xf21f('0x5a')]},'json':!![]});}})[_0xf21f('0x25')](function(_0x6d5978){if(_0x6d5978){var _0x1431de=_0x6d5978[_0xf21f('0x61')];var _0x35bbfa=![];var _0xeee168=null;for(_0xeee168=0x0;_0xeee168<_0x1431de[_0xf21f('0x47')];_0xeee168++){if(_0x1431de[_0xeee168][_0xf21f('0x62')]===_0x4078ea){_0x35bbfa=!![];}}if(_0x35bbfa){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf21f('0x63')});}}})[_0xf21f('0x25')](respondWithResult(_0x4e3919,null))[_0xf21f('0x4c')](function(_0x516dd1){var _0x1ef2fc=_0x1f4d0f[_0xf21f('0x33')][_0xf21f('0x64')]?0x1f4:_0x516dd1['statusCode']||0x1f4;logger[_0xf21f('0x27')](_0xf21f('0x65'),'getFields',_0x1ef2fc,JSON[_0xf21f('0x66')](_0x516dd1));delete _0x516dd1[_0xf21f('0x29')];if(_0x1ef2fc===0x191){_0x1ef2fc=0x190;}_0x4e3919[_0xf21f('0x1b')](_0x1ef2fc)['send'](_0x1f4d0f['query'][_0xf21f('0x64')]?{'message':_0xf21f('0x67'),'statusCode':_0x516dd1[_0xf21f('0x68')]}:_0x516dd1);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 1f884bb..4859110 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 _0x1883=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bc7ac,_0x1eed0e){var _0x5a35d7=function(_0x1496c6){while(--_0x1496c6){_0x1bc7ac['push'](_0x1bc7ac['shift']());}};_0x5a35d7(++_0x1eed0e);}(_0x1883,0xab));var _0x3188=function(_0x168a40,_0x5e9d63){_0x168a40=_0x168a40-0x0;var _0x1a9f3c=_0x1883[_0x168a40];return _0x1a9f3c;};'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'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa46e=['api','moment','bluebird','path','../../config/environment','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0xe814a3,_0x41f690){var _0xc60cc0=function(_0xe3eba8){while(--_0xe3eba8){_0xe814a3['push'](_0xe814a3['shift']());}};_0xc60cc0(++_0x41f690);}(_0xa46e,0x8a));var _0xea46=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xa46e[_0x1db251];return _0x56685a;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xea46('0x7'));module['exports']=function(_0x10bee5,_0x3dc26f){return _0x10bee5['define'](_0xea46('0x8'),attributes,{'tableName':_0xea46('0x9'),'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 eb74b59..ade17c6 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 _0x4991=['where','attributes','limit','include','map','model','catch','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','findAll','options','raw'];(function(_0x140f46,_0x6cde54){var _0x415866=function(_0x1f5b34){while(--_0x1f5b34){_0x140f46['push'](_0x140f46['shift']());}};_0x415866(++_0x6cde54);}(_0x4991,0xf7));var _0x1499=function(_0xd08763,_0x50602d){_0xd08763=_0xd08763-0x0;var _0xcf4b70=_0x4991[_0xd08763];return _0xcf4b70;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['FreshsalesAccount'][_0x1499('0x16')]({'raw':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'limit':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1b')]||null:null,'include':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')],function(_0x2c7f57){return{'model':db[_0x2c7f57['model']],'as':_0x2c7f57['as'],'attributes':_0x2c7f57[_0x1499('0x1a')],'include':_0x2c7f57[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x2c7f57[_0x1499('0x1c')],function(_0x3968e0){return{'model':db[_0x3968e0[_0x1499('0x1e')]],'as':_0x3968e0['as'],'attributes':_0x3968e0['attributes'],'include':_0x3968e0['include']?_[_0x1499('0x1d')](_0x3968e0[_0x1499('0x1c')],function(_0x3b9259){return{'model':db[_0x3b9259[_0x1499('0x1e')]],'as':_0x3b9259['as'],'attributes':_0x3b9259[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e5ed1){logger['info']('GetFreshsalesAccount',_0x1e45a9);logger['debug'](_0x1499('0x15'),_0x1e45a9,JSON[_0x1499('0x11')](_0x3e5ed1));_0x5b9859(_0x3e5ed1);})[_0x1499('0x1f')](function(_0x1b460b){logger[_0x1499('0x12')](_0x1499('0x15'),_0x1b460b[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533['error'](0x1f4,_0x1b460b[_0x1499('0x13')]));});});};exports[_0x1499('0x20')]=function(_0x39995b){var _0x5b59ea=this;return new Promise(function(_0x2dae84,_0x16466c){return db['FreshsalesAccount'][_0x1499('0x21')]({'raw':_0x39995b[_0x1499('0x17')]?_0x39995b['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'include':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x39995b[_0x1499('0x17')][_0x1499('0x1c')],function(_0x3f4c1a){return{'model':db[_0x3f4c1a[_0x1499('0x1e')]],'as':_0x3f4c1a['as'],'attributes':_0x3f4c1a[_0x1499('0x1a')],'include':_0x3f4c1a[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x3f4c1a[_0x1499('0x1c')],function(_0x29e89e){return{'model':db[_0x29e89e['model']],'as':_0x29e89e['as'],'attributes':_0x29e89e[_0x1499('0x1a')],'include':_0x29e89e[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x29e89e[_0x1499('0x1c')],function(_0x31251c){return{'model':db[_0x31251c[_0x1499('0x1e')]],'as':_0x31251c['as'],'attributes':_0x31251c[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1499('0xc')](function(_0x12cf93){logger[_0x1499('0xd')](_0x1499('0x20'),_0x39995b);logger['debug']('ShowFreshsalesAccount',_0x39995b,JSON[_0x1499('0x11')](_0x12cf93));_0x2dae84(_0x12cf93);})['catch'](function(_0x29bb8f){logger['error'](_0x1499('0x20'),_0x29bb8f[_0x1499('0x13')],_0x39995b);_0x16466c(_0x5b59ea[_0x1499('0x12')](0x1f4,_0x29bb8f[_0x1499('0x13')]));});});}; \ No newline at end of file +var _0x2a07=['GetFreshsalesAccount','debug','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes'];(function(_0x114358,_0xc9eefd){var _0xf73b58=function(_0x17badb){while(--_0x17badb){_0x114358['push'](_0x114358['shift']());}};_0xf73b58(++_0xc9eefd);}(_0x2a07,0x74));var _0x72a0=function(_0x845fcc,_0x518cfb){_0x845fcc=_0x845fcc-0x0;var _0x3a0e79=_0x2a07[_0x845fcc];return _0x3a0e79;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['GetFreshsalesAccount']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')]({'raw':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1a')]||null:null,'attributes':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['attributes']||null:null,'limit':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1b')]||null:null,'include':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x3022b0){return{'model':db[_0x3022b0[_0x72a0('0x1e')]],'as':_0x3022b0['as'],'attributes':_0x3022b0['attributes'],'include':_0x3022b0['include']?_[_0x72a0('0x1d')](_0x3022b0[_0x72a0('0x1c')],function(_0x123df4){return{'model':db[_0x123df4[_0x72a0('0x1e')]],'as':_0x123df4['as'],'attributes':_0x123df4[_0x72a0('0x1f')],'include':_0x123df4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x123df4[_0x72a0('0x1c')],function(_0xee99e2){return{'model':db[_0xee99e2[_0x72a0('0x1e')]],'as':_0xee99e2['as'],'attributes':_0xee99e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x553641){logger[_0x72a0('0x15')](_0x72a0('0x20'),_0x100d8f);logger[_0x72a0('0x21')](_0x72a0('0x20'),_0x100d8f,JSON[_0x72a0('0x12')](_0x553641));_0x131b73(_0x553641);})[_0x72a0('0x16')](function(_0x23c96a){logger[_0x72a0('0x13')]('GetFreshsalesAccount',_0x23c96a[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x23c96a[_0x72a0('0x14')]));});});};exports[_0x72a0('0x22')]=function(_0x13c04){var _0x19e783=this;return new Promise(function(_0x3a5e54,_0x592401){return db[_0x72a0('0x17')][_0x72a0('0x23')]({'raw':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x24')]===undefined?!![]:![]:!![],'where':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1a')]||null:null,'attributes':_0x13c04['options']?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1f')]||null:null,'include':_0x13c04[_0x72a0('0x19')]?_0x13c04['options'][_0x72a0('0x1c')]?_['map'](_0x13c04[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x1d02c4){return{'model':db[_0x1d02c4[_0x72a0('0x1e')]],'as':_0x1d02c4['as'],'attributes':_0x1d02c4[_0x72a0('0x1f')],'include':_0x1d02c4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x1d02c4[_0x72a0('0x1c')],function(_0x154c1e){return{'model':db[_0x154c1e[_0x72a0('0x1e')]],'as':_0x154c1e['as'],'attributes':_0x154c1e[_0x72a0('0x1f')],'include':_0x154c1e[_0x72a0('0x1c')]?_['map'](_0x154c1e[_0x72a0('0x1c')],function(_0x5eb8f1){return{'model':db[_0x5eb8f1[_0x72a0('0x1e')]],'as':_0x5eb8f1['as'],'attributes':_0x5eb8f1[_0x72a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x1a9597){logger[_0x72a0('0x15')](_0x72a0('0x22'),_0x13c04);logger[_0x72a0('0x21')](_0x72a0('0x22'),_0x13c04,JSON[_0x72a0('0x12')](_0x1a9597));_0x3a5e54(_0x1a9597);})['catch'](function(_0x4a973a){logger[_0x72a0('0x13')](_0x72a0('0x22'),_0x4a973a[_0x72a0('0x14')],_0x13c04);_0x592401(_0x19e783[_0x72a0('0x13')](0x1f4,_0x4a973a[_0x72a0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index c490555..361f8c1 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 _0x0547=['/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','get','isAuthenticated','index'];(function(_0x5c3ecd,_0x8c53b3){var _0x436020=function(_0x3ddcf7){while(--_0x3ddcf7){_0x5c3ecd['push'](_0x5c3ecd['shift']());}};_0x436020(++_0x8c53b3);}(_0x0547,0x11d));var _0x7054=function(_0x71a8f0,_0x9eefe2){_0x71a8f0=_0x71a8f0-0x0;var _0x182497=_0x0547[_0x71a8f0];return _0x182497;};'use strict';var multer=require(_0x7054('0x0'));var util=require(_0x7054('0x1'));var path=require(_0x7054('0x2'));var timeout=require(_0x7054('0x3'));var express=require(_0x7054('0x4'));var router=express[_0x7054('0x5')]();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('./intFreshsalesConfiguration.controller');router[_0x7054('0x6')]('/',auth[_0x7054('0x7')](),controller[_0x7054('0x8')]);router[_0x7054('0x6')](_0x7054('0x9'),auth[_0x7054('0x7')](),controller[_0x7054('0xa')]);router[_0x7054('0x6')](_0x7054('0xb'),auth[_0x7054('0x7')](),controller[_0x7054('0xc')]);router[_0x7054('0x6')](_0x7054('0xd'),auth[_0x7054('0x7')](),controller[_0x7054('0xe')]);router[_0x7054('0x6')](_0x7054('0xf'),auth[_0x7054('0x7')](),controller[_0x7054('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x7054('0x7')](),controller[_0x7054('0x11')]);router[_0x7054('0x12')](_0x7054('0x9'),auth['isAuthenticated'](),controller[_0x7054('0x13')]);module[_0x7054('0x14')]=router; \ No newline at end of file +var _0x2332=['delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','create','put'];(function(_0x54b48f,_0x41001b){var _0x392744=function(_0x2dc7b8){while(--_0x2dc7b8){_0x54b48f['push'](_0x54b48f['shift']());}};_0x392744(++_0x41001b);}(_0x2332,0x116));var _0x2233=function(_0xc3dda0,_0xd6ea45){_0xc3dda0=_0xc3dda0-0x0;var _0x1b1ac4=_0x2332[_0xc3dda0];return _0x1b1ac4;};'use strict';var multer=require(_0x2233('0x0'));var util=require(_0x2233('0x1'));var path=require(_0x2233('0x2'));var timeout=require(_0x2233('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2233('0x4'));var interaction=require(_0x2233('0x5'));var config=require(_0x2233('0x6'));var controller=require(_0x2233('0x7'));router[_0x2233('0x8')]('/',auth[_0x2233('0x9')](),controller[_0x2233('0xa')]);router['get'](_0x2233('0xb'),auth[_0x2233('0x9')](),controller[_0x2233('0xc')]);router[_0x2233('0x8')](_0x2233('0xd'),auth['isAuthenticated'](),controller[_0x2233('0xe')]);router[_0x2233('0x8')](_0x2233('0xf'),auth[_0x2233('0x9')](),controller['getDescriptions']);router[_0x2233('0x8')](_0x2233('0x10'),auth[_0x2233('0x9')](),controller[_0x2233('0x11')]);router[_0x2233('0x12')]('/',auth[_0x2233('0x9')](),controller[_0x2233('0x13')]);router[_0x2233('0x14')](_0x2233('0xb'),auth[_0x2233('0x9')](),controller['update']);router[_0x2233('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2233('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index f4e4947..322c82e 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 _0x8662=['sequelize','STRING'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0x8662,0x1da));var _0x2866=function(_0x1bf1e7,_0x211b46){_0x1bf1e7=_0x1bf1e7-0x0;var _0x4cd5af=_0x8662[_0x1bf1e7];return _0x4cd5af;};'use strict';var Sequelize=require(_0x2866('0x0'));module['exports']={'name':{'type':Sequelize[_0x2866('0x1')]},'description':{'type':Sequelize[_0x2866('0x1')]}}; \ No newline at end of file +var _0x32ac=['sequelize','exports','STRING'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x32ac,0x14d));var _0xc32a=function(_0xf25eb2,_0x571735){_0xf25eb2=_0xf25eb2-0x0;var _0x1afe95=_0x32ac[_0xf25eb2];return _0x1afe95;};'use strict';var Sequelize=require(_0xc32a('0x0'));module[_0xc32a('0x1')]={'name':{'type':Sequelize[_0xc32a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 18282e3..f586004 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 _0x9973=['params','find','create','body','catch','destroy','getSubjects','findOne','getDescriptions','getFields','FreshsalesField','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','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','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x9973,0x157));var _0x3997=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9973[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3997('0x0'));var zipdir=require(_0x3997('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3997('0x2'));var moment=require(_0x3997('0x3'));var BPromise=require(_0x3997('0x4'));var Mustache=require(_0x3997('0x5'));var util=require(_0x3997('0x6'));var path=require(_0x3997('0x7'));var sox=require(_0x3997('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3997('0x9'));var _=require(_0x3997('0xa'));var squel=require(_0x3997('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3997('0xc'));var querystring=require(_0x3997('0xd'));var Papa=require(_0x3997('0xe'));var Redis=require(_0x3997('0xf'));var authService=require(_0x3997('0x10'));var qs=require(_0x3997('0x11'));var as=require(_0x3997('0x12'));var hardwareService=require(_0x3997('0x13'));var logger=require(_0x3997('0x14'))(_0x3997('0x15'));var utils=require(_0x3997('0x16'));var config=require(_0x3997('0x17'));var licenseUtil=require(_0x3997('0x18'));var db=require(_0x3997('0x19'))['db'];function respondWithStatusCode(_0x47ac4c,_0x21e864){_0x21e864=_0x21e864||0xcc;return function(_0x427147){if(_0x427147){return _0x47ac4c[_0x3997('0x1a')](_0x21e864);}return _0x47ac4c[_0x3997('0x1b')](_0x21e864)[_0x3997('0x1c')]();};}function respondWithResult(_0x22d946,_0x3e4d70){_0x3e4d70=_0x3e4d70||0xc8;return function(_0x5fd33b){if(_0x5fd33b){return _0x22d946['status'](_0x3e4d70)[_0x3997('0x1d')](_0x5fd33b);}};}function respondWithFilteredResult(_0xa39649,_0x42df3b){return function(_0x2bc94f){if(_0x2bc94f){var _0x59bcaa=typeof _0x42df3b[_0x3997('0x1e')]===_0x3997('0x1f')&&typeof _0x42df3b['limit']==='undefined';var _0x29280d=_0x2bc94f[_0x3997('0x20')];var _0x588407=_0x59bcaa?0x0:_0x42df3b[_0x3997('0x1e')];var _0x262d41=_0x59bcaa?_0x2bc94f[_0x3997('0x20')]:_0x42df3b[_0x3997('0x1e')]+_0x42df3b[_0x3997('0x21')];var _0x4fde7f;if(_0x262d41>=_0x29280d){_0x262d41=_0x29280d;_0x4fde7f=0xc8;}else{_0x4fde7f=0xce;}_0xa39649[_0x3997('0x1b')](_0x4fde7f);return _0xa39649[_0x3997('0x22')](_0x3997('0x23'),_0x588407+'-'+_0x262d41+'/'+_0x29280d)['json'](_0x2bc94f);}return null;};}function patchUpdates(_0x20caab){return function(_0x1ed237){try{jsonpatch['apply'](_0x1ed237,_0x20caab,!![]);}catch(_0x1b7870){return BPromise[_0x3997('0x24')](_0x1b7870);}return _0x1ed237[_0x3997('0x25')]();};}function saveUpdates(_0x4be588,_0x4b8b0f){return function(_0x32f58d){if(_0x32f58d){return _0x32f58d[_0x3997('0x26')](_0x4be588)[_0x3997('0x27')](function(_0x36ae50){return _0x36ae50;});}return null;};}function removeEntity(_0x5b61c3,_0x256213){return function(_0x5a4414){if(_0x5a4414){return _0x5a4414['destroy']()[_0x3997('0x27')](function(){_0x5b61c3[_0x3997('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ea781,_0xc1606f){return function(_0xe3e7b6){if(!_0xe3e7b6){_0x5ea781[_0x3997('0x1a')](0x194);}return _0xe3e7b6;};}function handleError(_0x58fb7b,_0x4ce5fb){_0x4ce5fb=_0x4ce5fb||0x1f4;return function(_0x570fd7){logger[_0x3997('0x28')](_0x570fd7[_0x3997('0x29')]);if(_0x570fd7[_0x3997('0x2a')]){delete _0x570fd7[_0x3997('0x2a')];}_0x58fb7b[_0x3997('0x1b')](_0x4ce5fb)[_0x3997('0x2b')](_0x570fd7);};}exports['index']=function(_0x5ad688,_0x390f8e){var _0x36b4ee={},_0x55cee5={},_0x2cec57={'count':0x0,'rows':[]};var _0x2e9877=_[_0x3997('0x2c')](db[_0x3997('0x2d')][_0x3997('0x2e')],function(_0x99fb98){return{'name':_0x99fb98['fieldName'],'type':_0x99fb98[_0x3997('0x2f')][_0x3997('0x30')]};});_0x55cee5[_0x3997('0x31')]=_[_0x3997('0x2c')](_0x2e9877,_0x3997('0x2a'));_0x55cee5['query']=_[_0x3997('0x32')](_0x5ad688[_0x3997('0x33')]);_0x55cee5[_0x3997('0x34')]=_[_0x3997('0x35')](_0x55cee5[_0x3997('0x31')],_0x55cee5[_0x3997('0x33')]);_0x36b4ee['attributes']=_[_0x3997('0x35')](_0x55cee5[_0x3997('0x31')],qs[_0x3997('0x36')](_0x5ad688[_0x3997('0x33')][_0x3997('0x36')]));_0x36b4ee[_0x3997('0x37')]=_0x36b4ee[_0x3997('0x37')][_0x3997('0x38')]?_0x36b4ee[_0x3997('0x37')]:_0x55cee5[_0x3997('0x31')];if(!_0x5ad688[_0x3997('0x33')][_0x3997('0x39')](_0x3997('0x3a'))){_0x36b4ee[_0x3997('0x21')]=qs[_0x3997('0x21')](_0x5ad688['query'][_0x3997('0x21')]);_0x36b4ee[_0x3997('0x1e')]=qs[_0x3997('0x1e')](_0x5ad688[_0x3997('0x33')]['offset']);}_0x36b4ee[_0x3997('0x3b')]=qs[_0x3997('0x3c')](_0x5ad688[_0x3997('0x33')]['sort']);_0x36b4ee[_0x3997('0x3d')]=qs[_0x3997('0x34')](_[_0x3997('0x3e')](_0x5ad688[_0x3997('0x33')],_0x55cee5[_0x3997('0x34')]),_0x2e9877);if(_0x5ad688[_0x3997('0x33')][_0x3997('0x3f')]){_0x36b4ee[_0x3997('0x3d')]=_['merge'](_0x36b4ee[_0x3997('0x3d')],{'$or':_['map'](_0x2e9877,function(_0x309ad8){if(_0x309ad8[_0x3997('0x2f')]!==_0x3997('0x40')){var _0x19a032={};_0x19a032[_0x309ad8['name']]={'$like':'%'+_0x5ad688[_0x3997('0x33')][_0x3997('0x3f')]+'%'};return _0x19a032;}})});}_0x36b4ee=_[_0x3997('0x41')]({},_0x36b4ee,_0x5ad688[_0x3997('0x42')]);var _0x59123d={'where':_0x36b4ee[_0x3997('0x3d')]};return db['FreshsalesConfiguration'][_0x3997('0x20')](_0x59123d)[_0x3997('0x27')](function(_0x3653af){_0x2cec57[_0x3997('0x20')]=_0x3653af;if(_0x5ad688[_0x3997('0x33')][_0x3997('0x43')]){_0x36b4ee[_0x3997('0x44')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x3997('0x45')](_0x36b4ee);})[_0x3997('0x27')](function(_0x92bcf1){_0x2cec57[_0x3997('0x46')]=_0x92bcf1;return _0x2cec57;})['then'](respondWithFilteredResult(_0x390f8e,_0x36b4ee))['catch'](handleError(_0x390f8e,null));};exports[_0x3997('0x47')]=function(_0x555b70,_0x1fd945){var _0x227d64={'raw':![],'where':{'id':_0x555b70[_0x3997('0x48')]['id']}},_0x1df442={};_0x1df442['model']=_[_0x3997('0x32')](db[_0x3997('0x2d')]['rawAttributes']);_0x1df442[_0x3997('0x33')]=_[_0x3997('0x32')](_0x555b70[_0x3997('0x33')]);_0x1df442[_0x3997('0x34')]=_[_0x3997('0x35')](_0x1df442[_0x3997('0x31')],_0x1df442['query']);_0x227d64['attributes']=_['intersection'](_0x1df442[_0x3997('0x31')],qs[_0x3997('0x36')](_0x555b70[_0x3997('0x33')]['fields']));_0x227d64[_0x3997('0x37')]=_0x227d64['attributes']['length']?_0x227d64['attributes']:_0x1df442[_0x3997('0x31')];if(_0x555b70[_0x3997('0x33')][_0x3997('0x43')]){_0x227d64[_0x3997('0x44')]=[{'all':!![]}];}_0x227d64=_['merge']({},_0x227d64,_0x555b70[_0x3997('0x42')]);return db['FreshsalesConfiguration'][_0x3997('0x49')](_0x227d64)['then'](handleEntityNotFound(_0x1fd945,null))[_0x3997('0x27')](respondWithResult(_0x1fd945,null))['catch'](handleError(_0x1fd945,null));};exports[_0x3997('0x4a')]=function(_0x4bcac8,_0x7e3917){return db[_0x3997('0x2d')][_0x3997('0x4a')](_0x4bcac8[_0x3997('0x4b')],{})[_0x3997('0x27')](respondWithResult(_0x7e3917,0xc9))[_0x3997('0x4c')](handleError(_0x7e3917,null));};exports['update']=function(_0x32e84d,_0x260170){if(_0x32e84d[_0x3997('0x4b')]['id']){delete _0x32e84d[_0x3997('0x4b')]['id'];}return db[_0x3997('0x2d')][_0x3997('0x49')]({'where':{'id':_0x32e84d['params']['id']}})['then'](handleEntityNotFound(_0x260170,null))[_0x3997('0x27')](saveUpdates(_0x32e84d['body'],null))[_0x3997('0x27')](respondWithResult(_0x260170,null))['catch'](handleError(_0x260170,null));};exports[_0x3997('0x4d')]=function(_0x459847,_0x325342){return db[_0x3997('0x2d')]['find']({'where':{'id':_0x459847['params']['id']}})[_0x3997('0x27')](handleEntityNotFound(_0x325342,null))['then'](removeEntity(_0x325342,null))[_0x3997('0x4c')](handleError(_0x325342,null));};exports[_0x3997('0x4e')]=function(_0x14962a,_0x1dc324,_0x298331){var _0x1f6d39={};var _0x2af697={};var _0x5fad18;var _0x55dee3;return db[_0x3997('0x2d')][_0x3997('0x4f')]({'where':{'id':_0x14962a[_0x3997('0x48')]['id']}})[_0x3997('0x27')](handleEntityNotFound(_0x1dc324,null))[_0x3997('0x27')](function(_0x311085){if(_0x311085){_0x5fad18=_0x311085;_0x2af697[_0x3997('0x31')]=_[_0x3997('0x32')](db['FreshsalesField'][_0x3997('0x2e')]);_0x2af697[_0x3997('0x33')]=_[_0x3997('0x32')](_0x14962a['query']);_0x2af697[_0x3997('0x34')]=_[_0x3997('0x35')](_0x2af697[_0x3997('0x31')],_0x2af697[_0x3997('0x33')]);_0x1f6d39[_0x3997('0x37')]=_[_0x3997('0x35')](_0x2af697[_0x3997('0x31')],qs[_0x3997('0x36')](_0x14962a[_0x3997('0x33')][_0x3997('0x36')]));_0x1f6d39[_0x3997('0x37')]=_0x1f6d39['attributes'][_0x3997('0x38')]?_0x1f6d39[_0x3997('0x37')]:_0x2af697[_0x3997('0x31')];_0x1f6d39[_0x3997('0x3b')]=qs[_0x3997('0x3c')](_0x14962a[_0x3997('0x33')][_0x3997('0x3c')]);_0x1f6d39['where']=qs['filters'](_[_0x3997('0x3e')](_0x14962a[_0x3997('0x33')],_0x2af697[_0x3997('0x34')]));if(_0x14962a[_0x3997('0x33')]['filter']){_0x1f6d39['where']=_[_0x3997('0x41')](_0x1f6d39[_0x3997('0x3d')],{'$or':_[_0x3997('0x2c')](_0x1f6d39[_0x3997('0x37')],function(_0x1e5b0f){var _0x8da487={};_0x8da487[_0x1e5b0f]={'$like':'%'+_0x14962a['query'][_0x3997('0x3f')]+'%'};return _0x8da487;})});}_0x1f6d39=_[_0x3997('0x41')]({},_0x1f6d39,_0x14962a['options']);return _0x5fad18[_0x3997('0x4e')](_0x1f6d39);}})[_0x3997('0x27')](function(_0x29dacf){if(_0x29dacf){_0x55dee3=_0x29dacf['length'];if(!_0x14962a[_0x3997('0x33')][_0x3997('0x39')](_0x3997('0x3a'))){_0x1f6d39['limit']=qs[_0x3997('0x21')](_0x14962a[_0x3997('0x33')][_0x3997('0x21')]);_0x1f6d39[_0x3997('0x1e')]=qs[_0x3997('0x1e')](_0x14962a[_0x3997('0x33')][_0x3997('0x1e')]);}return _0x5fad18[_0x3997('0x4e')](_0x1f6d39);}})[_0x3997('0x27')](function(_0x128b7a){if(_0x128b7a){return _0x128b7a?{'count':_0x55dee3,'rows':_0x128b7a}:null;}})['then'](respondWithResult(_0x1dc324,null))['catch'](handleError(_0x1dc324,null));};exports['getDescriptions']=function(_0x233f2e,_0x27b5a5,_0x125d9e){var _0x2474be={};var _0x546449={};var _0x1d9b63;var _0x440930;return db[_0x3997('0x2d')][_0x3997('0x4f')]({'where':{'id':_0x233f2e[_0x3997('0x48')]['id']}})[_0x3997('0x27')](handleEntityNotFound(_0x27b5a5,null))[_0x3997('0x27')](function(_0x9402cd){if(_0x9402cd){_0x1d9b63=_0x9402cd;_0x546449[_0x3997('0x31')]=_['keys'](db['FreshsalesField'][_0x3997('0x2e')]);_0x546449[_0x3997('0x33')]=_[_0x3997('0x32')](_0x233f2e[_0x3997('0x33')]);_0x546449[_0x3997('0x34')]=_[_0x3997('0x35')](_0x546449[_0x3997('0x31')],_0x546449['query']);_0x2474be[_0x3997('0x37')]=_[_0x3997('0x35')](_0x546449['model'],qs[_0x3997('0x36')](_0x233f2e['query'][_0x3997('0x36')]));_0x2474be[_0x3997('0x37')]=_0x2474be[_0x3997('0x37')][_0x3997('0x38')]?_0x2474be[_0x3997('0x37')]:_0x546449[_0x3997('0x31')];_0x2474be[_0x3997('0x3b')]=qs[_0x3997('0x3c')](_0x233f2e[_0x3997('0x33')][_0x3997('0x3c')]);_0x2474be[_0x3997('0x3d')]=qs[_0x3997('0x34')](_[_0x3997('0x3e')](_0x233f2e['query'],_0x546449[_0x3997('0x34')]));if(_0x233f2e['query'][_0x3997('0x3f')]){_0x2474be[_0x3997('0x3d')]=_[_0x3997('0x41')](_0x2474be[_0x3997('0x3d')],{'$or':_[_0x3997('0x2c')](_0x2474be[_0x3997('0x37')],function(_0x110ce8){var _0x42a1db={};_0x42a1db[_0x110ce8]={'$like':'%'+_0x233f2e[_0x3997('0x33')][_0x3997('0x3f')]+'%'};return _0x42a1db;})});}_0x2474be=_[_0x3997('0x41')]({},_0x2474be,_0x233f2e[_0x3997('0x42')]);return _0x1d9b63[_0x3997('0x50')](_0x2474be);}})[_0x3997('0x27')](function(_0x1a0668){if(_0x1a0668){_0x440930=_0x1a0668[_0x3997('0x38')];if(!_0x233f2e[_0x3997('0x33')][_0x3997('0x39')](_0x3997('0x3a'))){_0x2474be[_0x3997('0x21')]=qs[_0x3997('0x21')](_0x233f2e[_0x3997('0x33')]['limit']);_0x2474be[_0x3997('0x1e')]=qs[_0x3997('0x1e')](_0x233f2e[_0x3997('0x33')][_0x3997('0x1e')]);}return _0x1d9b63[_0x3997('0x50')](_0x2474be);}})[_0x3997('0x27')](function(_0x539c87){if(_0x539c87){return _0x539c87?{'count':_0x440930,'rows':_0x539c87}:null;}})[_0x3997('0x27')](respondWithResult(_0x27b5a5,null))[_0x3997('0x4c')](handleError(_0x27b5a5,null));};exports[_0x3997('0x51')]=function(_0x4da9af,_0xe87e51,_0x5eaa43){var _0x15dc26={};var _0x1ce526={};var _0x1d4b74;var _0x48b6f9;return db[_0x3997('0x2d')][_0x3997('0x4f')]({'where':{'id':_0x4da9af[_0x3997('0x48')]['id']}})[_0x3997('0x27')](handleEntityNotFound(_0xe87e51,null))[_0x3997('0x27')](function(_0x573b6a){if(_0x573b6a){_0x1d4b74=_0x573b6a;_0x1ce526[_0x3997('0x31')]=_['keys'](db[_0x3997('0x52')][_0x3997('0x2e')]);_0x1ce526[_0x3997('0x33')]=_[_0x3997('0x32')](_0x4da9af['query']);_0x1ce526['filters']=_[_0x3997('0x35')](_0x1ce526[_0x3997('0x31')],_0x1ce526[_0x3997('0x33')]);_0x15dc26[_0x3997('0x37')]=_['intersection'](_0x1ce526[_0x3997('0x31')],qs[_0x3997('0x36')](_0x4da9af['query'][_0x3997('0x36')]));_0x15dc26[_0x3997('0x37')]=_0x15dc26['attributes'][_0x3997('0x38')]?_0x15dc26['attributes']:_0x1ce526['model'];_0x15dc26['order']=qs[_0x3997('0x3c')](_0x4da9af['query'][_0x3997('0x3c')]);_0x15dc26[_0x3997('0x3d')]=qs[_0x3997('0x34')](_['pick'](_0x4da9af[_0x3997('0x33')],_0x1ce526[_0x3997('0x34')]));if(_0x4da9af[_0x3997('0x33')][_0x3997('0x3f')]){_0x15dc26[_0x3997('0x3d')]=_[_0x3997('0x41')](_0x15dc26[_0x3997('0x3d')],{'$or':_['map'](_0x15dc26[_0x3997('0x37')],function(_0x15ec35){var _0x475e0f={};_0x475e0f[_0x15ec35]={'$like':'%'+_0x4da9af[_0x3997('0x33')][_0x3997('0x3f')]+'%'};return _0x475e0f;})});}_0x15dc26=_[_0x3997('0x41')]({},_0x15dc26,_0x4da9af[_0x3997('0x42')]);return _0x1d4b74[_0x3997('0x51')](_0x15dc26);}})[_0x3997('0x27')](function(_0x429738){if(_0x429738){_0x48b6f9=_0x429738[_0x3997('0x38')];if(!_0x4da9af[_0x3997('0x33')][_0x3997('0x39')](_0x3997('0x3a'))){_0x15dc26[_0x3997('0x21')]=qs[_0x3997('0x21')](_0x4da9af[_0x3997('0x33')]['limit']);_0x15dc26['offset']=qs[_0x3997('0x1e')](_0x4da9af[_0x3997('0x33')][_0x3997('0x1e')]);}return _0x1d4b74['getFields'](_0x15dc26);}})[_0x3997('0x27')](function(_0x39a135){if(_0x39a135){return _0x39a135?{'count':_0x48b6f9,'rows':_0x39a135}:null;}})['then'](respondWithResult(_0xe87e51,null))[_0x3997('0x4c')](handleError(_0xe87e51,null));}; \ No newline at end of file +var _0x33b6=['filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','params','rawAttributes','include','find','catch','create','body','destroy','getSubjects','findOne','length','getDescriptions','FreshsalesField','getFields','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','count','limit','set','reject','update','then','sendStatus','stack','name','index','map','FreshsalesConfiguration','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0xa58910,_0x43ee06){var _0x25e236=function(_0x11570e){while(--_0x11570e){_0xa58910['push'](_0xa58910['shift']());}};_0x25e236(++_0x43ee06);}(_0x33b6,0x1c7));var _0x633b=function(_0x38323b,_0x5f79df){_0x38323b=_0x38323b-0x0;var _0x2b9af5=_0x33b6[_0x38323b];return _0x2b9af5;};'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(_0x633b('0x0'));var moment=require(_0x633b('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x633b('0x2'));var util=require(_0x633b('0x3'));var path=require(_0x633b('0x4'));var sox=require(_0x633b('0x5'));var csv=require('to-csv');var ejs=require(_0x633b('0x6'));var fs=require('fs');var fs_extra=require(_0x633b('0x7'));var _=require(_0x633b('0x8'));var squel=require('squel');var crypto=require(_0x633b('0x9'));var jsforce=require(_0x633b('0xa'));var deskjs=require(_0x633b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x633b('0xc'));var Redis=require('ioredis');var authService=require(_0x633b('0xd'));var qs=require(_0x633b('0xe'));var as=require(_0x633b('0xf'));var hardwareService=require(_0x633b('0x10'));var logger=require(_0x633b('0x11'))(_0x633b('0x12'));var utils=require('../../config/utils');var config=require(_0x633b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x633b('0x14'))['db'];function respondWithStatusCode(_0x7c03d7,_0x4b370c){_0x4b370c=_0x4b370c||0xcc;return function(_0x379820){if(_0x379820){return _0x7c03d7['sendStatus'](_0x4b370c);}return _0x7c03d7[_0x633b('0x15')](_0x4b370c)[_0x633b('0x16')]();};}function respondWithResult(_0x25dc35,_0x32d5f5){_0x32d5f5=_0x32d5f5||0xc8;return function(_0x8237b8){if(_0x8237b8){return _0x25dc35['status'](_0x32d5f5)[_0x633b('0x17')](_0x8237b8);}};}function respondWithFilteredResult(_0x449a6f,_0x2ac7ff){return function(_0x54c26b){if(_0x54c26b){var _0x46e7c5=typeof _0x2ac7ff[_0x633b('0x18')]==='undefined'&&typeof _0x2ac7ff['limit']==='undefined';var _0x5e3abc=_0x54c26b[_0x633b('0x19')];var _0x36bc71=_0x46e7c5?0x0:_0x2ac7ff['offset'];var _0x5f9e16=_0x46e7c5?_0x54c26b[_0x633b('0x19')]:_0x2ac7ff[_0x633b('0x18')]+_0x2ac7ff[_0x633b('0x1a')];var _0x2bd53c;if(_0x5f9e16>=_0x5e3abc){_0x5f9e16=_0x5e3abc;_0x2bd53c=0xc8;}else{_0x2bd53c=0xce;}_0x449a6f[_0x633b('0x15')](_0x2bd53c);return _0x449a6f[_0x633b('0x1b')]('Content-Range',_0x36bc71+'-'+_0x5f9e16+'/'+_0x5e3abc)[_0x633b('0x17')](_0x54c26b);}return null;};}function patchUpdates(_0x128f23){return function(_0x4313ef){try{jsonpatch['apply'](_0x4313ef,_0x128f23,!![]);}catch(_0x28c889){return BPromise[_0x633b('0x1c')](_0x28c889);}return _0x4313ef['save']();};}function saveUpdates(_0x288af1,_0x37b2d5){return function(_0x50abd4){if(_0x50abd4){return _0x50abd4[_0x633b('0x1d')](_0x288af1)['then'](function(_0x50fb8b){return _0x50fb8b;});}return null;};}function removeEntity(_0x4a8686,_0x108c79){return function(_0x333115){if(_0x333115){return _0x333115['destroy']()[_0x633b('0x1e')](function(){_0x4a8686[_0x633b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4d1e,_0x1e5dd9){return function(_0x85ba61){if(!_0x85ba61){_0x4f4d1e[_0x633b('0x1f')](0x194);}return _0x85ba61;};}function handleError(_0x5ca78d,_0x25dc86){_0x25dc86=_0x25dc86||0x1f4;return function(_0xf6b2d2){logger['error'](_0xf6b2d2[_0x633b('0x20')]);if(_0xf6b2d2[_0x633b('0x21')]){delete _0xf6b2d2[_0x633b('0x21')];}_0x5ca78d[_0x633b('0x15')](_0x25dc86)['send'](_0xf6b2d2);};}exports[_0x633b('0x22')]=function(_0x1265aa,_0xffc3c8){var _0x1a0cc9={},_0x1be051={},_0x59477b={'count':0x0,'rows':[]};var _0x111f44=_[_0x633b('0x23')](db[_0x633b('0x24')]['rawAttributes'],function(_0x3d848a){return{'name':_0x3d848a['fieldName'],'type':_0x3d848a[_0x633b('0x25')][_0x633b('0x26')]};});_0x1be051[_0x633b('0x27')]=_['map'](_0x111f44,_0x633b('0x21'));_0x1be051[_0x633b('0x28')]=_[_0x633b('0x29')](_0x1265aa[_0x633b('0x28')]);_0x1be051['filters']=_['intersection'](_0x1be051['model'],_0x1be051[_0x633b('0x28')]);_0x1a0cc9[_0x633b('0x2a')]=_[_0x633b('0x2b')](_0x1be051[_0x633b('0x27')],qs[_0x633b('0x2c')](_0x1265aa[_0x633b('0x28')]['fields']));_0x1a0cc9['attributes']=_0x1a0cc9[_0x633b('0x2a')]['length']?_0x1a0cc9[_0x633b('0x2a')]:_0x1be051[_0x633b('0x27')];if(!_0x1265aa['query'][_0x633b('0x2d')](_0x633b('0x2e'))){_0x1a0cc9['limit']=qs[_0x633b('0x1a')](_0x1265aa[_0x633b('0x28')][_0x633b('0x1a')]);_0x1a0cc9[_0x633b('0x18')]=qs[_0x633b('0x18')](_0x1265aa[_0x633b('0x28')][_0x633b('0x18')]);}_0x1a0cc9[_0x633b('0x2f')]=qs['sort'](_0x1265aa[_0x633b('0x28')][_0x633b('0x30')]);_0x1a0cc9['where']=qs[_0x633b('0x31')](_[_0x633b('0x32')](_0x1265aa['query'],_0x1be051[_0x633b('0x31')]),_0x111f44);if(_0x1265aa[_0x633b('0x28')][_0x633b('0x33')]){_0x1a0cc9[_0x633b('0x34')]=_[_0x633b('0x35')](_0x1a0cc9[_0x633b('0x34')],{'$or':_['map'](_0x111f44,function(_0x474bbb){if(_0x474bbb['type']!==_0x633b('0x36')){var _0x3ff6dd={};_0x3ff6dd[_0x474bbb[_0x633b('0x21')]]={'$like':'%'+_0x1265aa[_0x633b('0x28')][_0x633b('0x33')]+'%'};return _0x3ff6dd;}})});}_0x1a0cc9=_[_0x633b('0x35')]({},_0x1a0cc9,_0x1265aa[_0x633b('0x37')]);var _0x4ac8e9={'where':_0x1a0cc9[_0x633b('0x34')]};return db[_0x633b('0x24')][_0x633b('0x19')](_0x4ac8e9)['then'](function(_0x31c023){_0x59477b[_0x633b('0x19')]=_0x31c023;if(_0x1265aa[_0x633b('0x28')][_0x633b('0x38')]){_0x1a0cc9['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1a0cc9);})['then'](function(_0x220c4d){_0x59477b[_0x633b('0x39')]=_0x220c4d;return _0x59477b;})['then'](respondWithFilteredResult(_0xffc3c8,_0x1a0cc9))['catch'](handleError(_0xffc3c8,null));};exports['show']=function(_0xe160ef,_0x3768ed){var _0xd766e8={'raw':![],'where':{'id':_0xe160ef[_0x633b('0x3a')]['id']}},_0x2d03d0={};_0x2d03d0[_0x633b('0x27')]=_['keys'](db[_0x633b('0x24')][_0x633b('0x3b')]);_0x2d03d0['query']=_[_0x633b('0x29')](_0xe160ef[_0x633b('0x28')]);_0x2d03d0[_0x633b('0x31')]=_[_0x633b('0x2b')](_0x2d03d0[_0x633b('0x27')],_0x2d03d0[_0x633b('0x28')]);_0xd766e8[_0x633b('0x2a')]=_[_0x633b('0x2b')](_0x2d03d0['model'],qs['fields'](_0xe160ef['query']['fields']));_0xd766e8['attributes']=_0xd766e8[_0x633b('0x2a')]['length']?_0xd766e8[_0x633b('0x2a')]:_0x2d03d0[_0x633b('0x27')];if(_0xe160ef[_0x633b('0x28')]['includeAll']){_0xd766e8[_0x633b('0x3c')]=[{'all':!![]}];}_0xd766e8=_['merge']({},_0xd766e8,_0xe160ef['options']);return db['FreshsalesConfiguration'][_0x633b('0x3d')](_0xd766e8)['then'](handleEntityNotFound(_0x3768ed,null))[_0x633b('0x1e')](respondWithResult(_0x3768ed,null))[_0x633b('0x3e')](handleError(_0x3768ed,null));};exports[_0x633b('0x3f')]=function(_0x576174,_0x1dfa50){return db[_0x633b('0x24')]['create'](_0x576174[_0x633b('0x40')],{})[_0x633b('0x1e')](respondWithResult(_0x1dfa50,0xc9))[_0x633b('0x3e')](handleError(_0x1dfa50,null));};exports['update']=function(_0x1787ac,_0x40e468){if(_0x1787ac[_0x633b('0x40')]['id']){delete _0x1787ac['body']['id'];}return db[_0x633b('0x24')][_0x633b('0x3d')]({'where':{'id':_0x1787ac['params']['id']}})[_0x633b('0x1e')](handleEntityNotFound(_0x40e468,null))['then'](saveUpdates(_0x1787ac[_0x633b('0x40')],null))['then'](respondWithResult(_0x40e468,null))[_0x633b('0x3e')](handleError(_0x40e468,null));};exports[_0x633b('0x41')]=function(_0x3154f2,_0x170f80){return db[_0x633b('0x24')][_0x633b('0x3d')]({'where':{'id':_0x3154f2[_0x633b('0x3a')]['id']}})[_0x633b('0x1e')](handleEntityNotFound(_0x170f80,null))[_0x633b('0x1e')](removeEntity(_0x170f80,null))[_0x633b('0x3e')](handleError(_0x170f80,null));};exports[_0x633b('0x42')]=function(_0x3f76fc,_0x38b9a4,_0x5c6d31){var _0x438a65={};var _0x32da24={};var _0x55908a;var _0x28e75e;return db['FreshsalesConfiguration'][_0x633b('0x43')]({'where':{'id':_0x3f76fc[_0x633b('0x3a')]['id']}})[_0x633b('0x1e')](handleEntityNotFound(_0x38b9a4,null))[_0x633b('0x1e')](function(_0x4e598b){if(_0x4e598b){_0x55908a=_0x4e598b;_0x32da24[_0x633b('0x27')]=_[_0x633b('0x29')](db['FreshsalesField'][_0x633b('0x3b')]);_0x32da24[_0x633b('0x28')]=_[_0x633b('0x29')](_0x3f76fc[_0x633b('0x28')]);_0x32da24['filters']=_['intersection'](_0x32da24[_0x633b('0x27')],_0x32da24[_0x633b('0x28')]);_0x438a65['attributes']=_[_0x633b('0x2b')](_0x32da24[_0x633b('0x27')],qs[_0x633b('0x2c')](_0x3f76fc[_0x633b('0x28')][_0x633b('0x2c')]));_0x438a65[_0x633b('0x2a')]=_0x438a65['attributes'][_0x633b('0x44')]?_0x438a65[_0x633b('0x2a')]:_0x32da24[_0x633b('0x27')];_0x438a65[_0x633b('0x2f')]=qs[_0x633b('0x30')](_0x3f76fc[_0x633b('0x28')][_0x633b('0x30')]);_0x438a65[_0x633b('0x34')]=qs[_0x633b('0x31')](_[_0x633b('0x32')](_0x3f76fc[_0x633b('0x28')],_0x32da24['filters']));if(_0x3f76fc[_0x633b('0x28')]['filter']){_0x438a65['where']=_[_0x633b('0x35')](_0x438a65[_0x633b('0x34')],{'$or':_[_0x633b('0x23')](_0x438a65['attributes'],function(_0x37fce9){var _0x22f275={};_0x22f275[_0x37fce9]={'$like':'%'+_0x3f76fc[_0x633b('0x28')][_0x633b('0x33')]+'%'};return _0x22f275;})});}_0x438a65=_['merge']({},_0x438a65,_0x3f76fc[_0x633b('0x37')]);return _0x55908a[_0x633b('0x42')](_0x438a65);}})[_0x633b('0x1e')](function(_0x5f3fd2){if(_0x5f3fd2){_0x28e75e=_0x5f3fd2['length'];if(!_0x3f76fc['query'][_0x633b('0x2d')](_0x633b('0x2e'))){_0x438a65[_0x633b('0x1a')]=qs['limit'](_0x3f76fc[_0x633b('0x28')][_0x633b('0x1a')]);_0x438a65[_0x633b('0x18')]=qs['offset'](_0x3f76fc['query'][_0x633b('0x18')]);}return _0x55908a[_0x633b('0x42')](_0x438a65);}})[_0x633b('0x1e')](function(_0x1f68fd){if(_0x1f68fd){return _0x1f68fd?{'count':_0x28e75e,'rows':_0x1f68fd}:null;}})['then'](respondWithResult(_0x38b9a4,null))[_0x633b('0x3e')](handleError(_0x38b9a4,null));};exports[_0x633b('0x45')]=function(_0x2c61b4,_0x3a3cfc,_0x2a4a09){var _0x402894={};var _0x11227a={};var _0x1ac63d;var _0x81fcd3;return db[_0x633b('0x24')]['findOne']({'where':{'id':_0x2c61b4[_0x633b('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3a3cfc,null))[_0x633b('0x1e')](function(_0x49c32d){if(_0x49c32d){_0x1ac63d=_0x49c32d;_0x11227a['model']=_[_0x633b('0x29')](db[_0x633b('0x46')][_0x633b('0x3b')]);_0x11227a['query']=_[_0x633b('0x29')](_0x2c61b4[_0x633b('0x28')]);_0x11227a[_0x633b('0x31')]=_[_0x633b('0x2b')](_0x11227a[_0x633b('0x27')],_0x11227a['query']);_0x402894[_0x633b('0x2a')]=_[_0x633b('0x2b')](_0x11227a[_0x633b('0x27')],qs[_0x633b('0x2c')](_0x2c61b4[_0x633b('0x28')][_0x633b('0x2c')]));_0x402894[_0x633b('0x2a')]=_0x402894[_0x633b('0x2a')][_0x633b('0x44')]?_0x402894[_0x633b('0x2a')]:_0x11227a[_0x633b('0x27')];_0x402894[_0x633b('0x2f')]=qs[_0x633b('0x30')](_0x2c61b4[_0x633b('0x28')]['sort']);_0x402894[_0x633b('0x34')]=qs[_0x633b('0x31')](_[_0x633b('0x32')](_0x2c61b4[_0x633b('0x28')],_0x11227a[_0x633b('0x31')]));if(_0x2c61b4[_0x633b('0x28')][_0x633b('0x33')]){_0x402894[_0x633b('0x34')]=_['merge'](_0x402894['where'],{'$or':_[_0x633b('0x23')](_0x402894[_0x633b('0x2a')],function(_0x204f3c){var _0x3ae5f2={};_0x3ae5f2[_0x204f3c]={'$like':'%'+_0x2c61b4[_0x633b('0x28')][_0x633b('0x33')]+'%'};return _0x3ae5f2;})});}_0x402894=_[_0x633b('0x35')]({},_0x402894,_0x2c61b4['options']);return _0x1ac63d[_0x633b('0x45')](_0x402894);}})[_0x633b('0x1e')](function(_0x58c743){if(_0x58c743){_0x81fcd3=_0x58c743[_0x633b('0x44')];if(!_0x2c61b4[_0x633b('0x28')][_0x633b('0x2d')](_0x633b('0x2e'))){_0x402894[_0x633b('0x1a')]=qs[_0x633b('0x1a')](_0x2c61b4['query'][_0x633b('0x1a')]);_0x402894[_0x633b('0x18')]=qs[_0x633b('0x18')](_0x2c61b4[_0x633b('0x28')][_0x633b('0x18')]);}return _0x1ac63d[_0x633b('0x45')](_0x402894);}})['then'](function(_0x590bc0){if(_0x590bc0){return _0x590bc0?{'count':_0x81fcd3,'rows':_0x590bc0}:null;}})['then'](respondWithResult(_0x3a3cfc,null))['catch'](handleError(_0x3a3cfc,null));};exports['getFields']=function(_0x207b01,_0x34b7d9,_0x45ac6e){var _0x4cf6a2={};var _0x2bcbd1={};var _0x32d4ad;var _0x426b54;return db[_0x633b('0x24')][_0x633b('0x43')]({'where':{'id':_0x207b01[_0x633b('0x3a')]['id']}})[_0x633b('0x1e')](handleEntityNotFound(_0x34b7d9,null))[_0x633b('0x1e')](function(_0x121693){if(_0x121693){_0x32d4ad=_0x121693;_0x2bcbd1[_0x633b('0x27')]=_[_0x633b('0x29')](db[_0x633b('0x46')][_0x633b('0x3b')]);_0x2bcbd1[_0x633b('0x28')]=_['keys'](_0x207b01['query']);_0x2bcbd1[_0x633b('0x31')]=_[_0x633b('0x2b')](_0x2bcbd1[_0x633b('0x27')],_0x2bcbd1[_0x633b('0x28')]);_0x4cf6a2[_0x633b('0x2a')]=_[_0x633b('0x2b')](_0x2bcbd1[_0x633b('0x27')],qs[_0x633b('0x2c')](_0x207b01['query']['fields']));_0x4cf6a2[_0x633b('0x2a')]=_0x4cf6a2['attributes'][_0x633b('0x44')]?_0x4cf6a2['attributes']:_0x2bcbd1[_0x633b('0x27')];_0x4cf6a2[_0x633b('0x2f')]=qs['sort'](_0x207b01[_0x633b('0x28')][_0x633b('0x30')]);_0x4cf6a2[_0x633b('0x34')]=qs[_0x633b('0x31')](_[_0x633b('0x32')](_0x207b01[_0x633b('0x28')],_0x2bcbd1[_0x633b('0x31')]));if(_0x207b01[_0x633b('0x28')][_0x633b('0x33')]){_0x4cf6a2[_0x633b('0x34')]=_[_0x633b('0x35')](_0x4cf6a2[_0x633b('0x34')],{'$or':_[_0x633b('0x23')](_0x4cf6a2[_0x633b('0x2a')],function(_0x166d2c){var _0x1aea43={};_0x1aea43[_0x166d2c]={'$like':'%'+_0x207b01[_0x633b('0x28')][_0x633b('0x33')]+'%'};return _0x1aea43;})});}_0x4cf6a2=_[_0x633b('0x35')]({},_0x4cf6a2,_0x207b01[_0x633b('0x37')]);return _0x32d4ad[_0x633b('0x47')](_0x4cf6a2);}})[_0x633b('0x1e')](function(_0x4e9050){if(_0x4e9050){_0x426b54=_0x4e9050['length'];if(!_0x207b01[_0x633b('0x28')][_0x633b('0x2d')](_0x633b('0x2e'))){_0x4cf6a2[_0x633b('0x1a')]=qs[_0x633b('0x1a')](_0x207b01[_0x633b('0x28')][_0x633b('0x1a')]);_0x4cf6a2[_0x633b('0x18')]=qs[_0x633b('0x18')](_0x207b01[_0x633b('0x28')][_0x633b('0x18')]);}return _0x32d4ad[_0x633b('0x47')](_0x4cf6a2);}})['then'](function(_0x121dae){if(_0x121dae){return _0x121dae?{'count':_0x426b54,'rows':_0x121dae}:null;}})[_0x633b('0x1e')](respondWithResult(_0x34b7d9,null))[_0x633b('0x3e')](handleError(_0x34b7d9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 314f99c..85ff867 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 _0x895d=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4aa72b,_0x87767c){var _0x5cd743=function(_0x474e12){while(--_0x474e12){_0x4aa72b['push'](_0x4aa72b['shift']());}};_0x5cd743(++_0x87767c);}(_0x895d,0x71));var _0xd895=function(_0x9dca39,_0x2b3ed4){_0x9dca39=_0x9dca39-0x0;var _0x2fd760=_0x895d[_0x9dca39];return _0x2fd760;};'use strict';var _=require('lodash');var util=require(_0xd895('0x0'));var logger=require('../../config/logger')(_0xd895('0x1'));var moment=require(_0xd895('0x2'));var BPromise=require(_0xd895('0x3'));var rp=require(_0xd895('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd895('0x5'));var config=require(_0xd895('0x6'));var attributes=require(_0xd895('0x7'));module[_0xd895('0x8')]=function(_0xf98abd,_0x49511b){return _0xf98abd[_0xd895('0x9')](_0xd895('0xa'),attributes,{'tableName':_0xd895('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8c2=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x178355,_0xfb7a85){var _0x5b9263=function(_0x47fde9){while(--_0x47fde9){_0x178355['push'](_0x178355['shift']());}};_0x5b9263(++_0xfb7a85);}(_0xc8c2,0x14b));var _0x2c8c=function(_0x1fbf82,_0x5a47f3){_0x1fbf82=_0x1fbf82-0x0;var _0x2374a5=_0xc8c2[_0x1fbf82];return _0x2374a5;};'use strict';var _=require(_0x2c8c('0x0'));var util=require(_0x2c8c('0x1'));var logger=require(_0x2c8c('0x2'))('api');var moment=require(_0x2c8c('0x3'));var BPromise=require(_0x2c8c('0x4'));var rp=require(_0x2c8c('0x5'));var fs=require('fs');var path=require(_0x2c8c('0x6'));var rimraf=require(_0x2c8c('0x7'));var config=require(_0x2c8c('0x8'));var attributes=require(_0x2c8c('0x9'));module[_0x2c8c('0xa')]=function(_0x44fe09,_0x63ae7b){return _0x44fe09[_0x2c8c('0xb')](_0x2c8c('0xc'),attributes,{'tableName':_0x2c8c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 5933866..977aed9 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 _0x76b0=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x4d44da,_0x4909ca){var _0x5fa813=function(_0x3a6efe){while(--_0x3a6efe){_0x4d44da['push'](_0x4d44da['shift']());}};_0x5fa813(++_0x4909ca);}(_0x76b0,0x1b4));var _0x076b=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x76b0[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x076b('0x0'));var moment=require('moment');var BPromise=require(_0x076b('0x1'));var rs=require(_0x076b('0x2'));var fs=require('fs');var Redis=require(_0x076b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x076b('0x4'));var logger=require(_0x076b('0x5'))(_0x076b('0x6'));var config=require('../../config/environment');var jayson=require(_0x076b('0x7'));var client=jayson[_0x076b('0x8')][_0x076b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26bdcf,_0x908dcf,_0x23b906){return new BPromise(function(_0x6dfc4e,_0x1572d9){return client[_0x076b('0xa')](_0x26bdcf,_0x23b906)[_0x076b('0xb')](function(_0x56a97e){logger[_0x076b('0xc')](_0x076b('0xd'),_0x908dcf,_0x076b('0xe'));logger[_0x076b('0xf')](_0x076b('0x10'),_0x908dcf,_0x076b('0xe'),JSON['stringify'](_0x56a97e));if(_0x56a97e['error']){if(_0x56a97e[_0x076b('0x11')][_0x076b('0x12')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x908dcf,_0x56a97e[_0x076b('0x11')][_0x076b('0x13')]);return _0x1572d9(_0x56a97e['error'][_0x076b('0x13')]);}logger[_0x076b('0x11')](_0x076b('0xd'),_0x908dcf,_0x56a97e[_0x076b('0x11')][_0x076b('0x13')]);return _0x6dfc4e(_0x56a97e[_0x076b('0x11')][_0x076b('0x13')]);}else{logger[_0x076b('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x908dcf,_0x076b('0xe'));_0x6dfc4e(_0x56a97e[_0x076b('0x14')]['message']);}})[_0x076b('0x15')](function(_0x49393f){logger[_0x076b('0x11')](_0x076b('0xd'),_0x908dcf,_0x49393f);_0x1572d9(_0x49393f);});});} \ No newline at end of file +var _0x75d4=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x28f61d,_0x147a60){var _0x19ac82=function(_0x748712){while(--_0x748712){_0x28f61d['push'](_0x28f61d['shift']());}};_0x19ac82(++_0x147a60);}(_0x75d4,0x10a));var _0x475d=function(_0x3ed125,_0x285d52){_0x3ed125=_0x3ed125-0x0;var _0xd74e9f=_0x75d4[_0x3ed125];return _0xd74e9f;};'use strict';var _=require(_0x475d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x475d('0x1'));var rs=require(_0x475d('0x2'));var fs=require('fs');var Redis=require(_0x475d('0x3'));var db=require(_0x475d('0x4'))['db'];var utils=require(_0x475d('0x5'));var logger=require(_0x475d('0x6'))(_0x475d('0x7'));var config=require(_0x475d('0x8'));var jayson=require(_0x475d('0x9'));var client=jayson[_0x475d('0xa')][_0x475d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x302fb2,_0x2e6cc8,_0x1a50d8){return new BPromise(function(_0x558d18,_0x5197b4){return client['request'](_0x302fb2,_0x1a50d8)[_0x475d('0xc')](function(_0x39a282){logger[_0x475d('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2e6cc8,_0x475d('0xe'));logger[_0x475d('0xf')](_0x475d('0x10'),_0x2e6cc8,_0x475d('0xe'),JSON[_0x475d('0x11')](_0x39a282));if(_0x39a282[_0x475d('0x12')]){if(_0x39a282[_0x475d('0x12')][_0x475d('0x13')]===0x1f4){logger[_0x475d('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2e6cc8,_0x39a282['error']['message']);return _0x5197b4(_0x39a282['error'][_0x475d('0x14')]);}logger['error'](_0x475d('0x15'),_0x2e6cc8,_0x39a282['error'][_0x475d('0x14')]);return _0x558d18(_0x39a282[_0x475d('0x12')]['message']);}else{logger[_0x475d('0xd')](_0x475d('0x15'),_0x2e6cc8,_0x475d('0xe'));_0x558d18(_0x39a282[_0x475d('0x16')]['message']);}})[_0x475d('0x17')](function(_0x643e54){logger[_0x475d('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2e6cc8,_0x643e54);_0x5197b4(_0x643e54);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 414c2f6..efcb563 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 _0x9b83=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','update','delete','destroy','exports','multer'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x9b83,0x84));var _0x39b8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9b83[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var path=require(_0x39b8('0x2'));var timeout=require(_0x39b8('0x3'));var express=require(_0x39b8('0x4'));var router=express[_0x39b8('0x5')]();var fs_extra=require(_0x39b8('0x6'));var auth=require(_0x39b8('0x7'));var interaction=require(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var controller=require('./intFreshsalesField.controller');router[_0x39b8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x39b8('0xa')](_0x39b8('0xb'),auth[_0x39b8('0xc')](),controller[_0x39b8('0xd')]);router[_0x39b8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x39b8('0xb'),auth[_0x39b8('0xc')](),controller[_0x39b8('0xf')]);router[_0x39b8('0x10')](_0x39b8('0xb'),auth[_0x39b8('0xc')](),controller[_0x39b8('0x11')]);module[_0x39b8('0x12')]=router; \ No newline at end of file +var _0x0328=['../../config/environment','./intFreshsalesField.controller','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0328,0x172));var _0x8032=function(_0x64fe69,_0x5abe00){_0x64fe69=_0x64fe69-0x0;var _0x2e871b=_0x0328[_0x64fe69];return _0x2e871b;};'use strict';var multer=require(_0x8032('0x0'));var util=require(_0x8032('0x1'));var path=require(_0x8032('0x2'));var timeout=require(_0x8032('0x3'));var express=require(_0x8032('0x4'));var router=express[_0x8032('0x5')]();var fs_extra=require(_0x8032('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8032('0x7'));var config=require(_0x8032('0x8'));var controller=require(_0x8032('0x9'));router['get']('/',auth[_0x8032('0xa')](),controller['index']);router['get'](_0x8032('0xb'),auth[_0x8032('0xa')](),controller['show']);router[_0x8032('0xc')]('/',auth['isAuthenticated'](),controller[_0x8032('0xd')]);router[_0x8032('0xe')](_0x8032('0xb'),auth['isAuthenticated'](),controller[_0x8032('0xf')]);router[_0x8032('0x10')](_0x8032('0xb'),auth['isAuthenticated'](),controller[_0x8032('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 3e427fe..9fa8a5b 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 _0xf2ae=['customVariable','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x2412a3,_0x399101){var _0x35a809=function(_0x566ade){while(--_0x566ade){_0x2412a3['push'](_0x2412a3['shift']());}};_0x35a809(++_0x399101);}(_0xf2ae,0x14c));var _0xef2a=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xf2ae[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0xef2a('0x0'));module[_0xef2a('0x1')]={'type':{'type':Sequelize[_0xef2a('0x2')]('string',_0xef2a('0x3'),_0xef2a('0x4'),'keyValue','picklist'),'defaultValue':_0xef2a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xef2a('0x6')]},'keyType':{'type':Sequelize[_0xef2a('0x2')](_0xef2a('0x5'),_0xef2a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xef2a('0x6')]},'idField':{'type':Sequelize[_0xef2a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xef2a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef2a('0x6')]}}; \ No newline at end of file +var _0xfdf8=['string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1c47c6,_0x389bec){var _0x2ee15=function(_0x509c7e){while(--_0x509c7e){_0x1c47c6['push'](_0x1c47c6['shift']());}};_0x2ee15(++_0x389bec);}(_0xfdf8,0x138));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x8fdf('0x0'));module[_0x8fdf('0x1')]={'type':{'type':Sequelize[_0x8fdf('0x2')](_0x8fdf('0x3'),'variable',_0x8fdf('0x4'),_0x8fdf('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8fdf('0x6')]},'keyType':{'type':Sequelize[_0x8fdf('0x2')](_0x8fdf('0x3'),_0x8fdf('0x7'),_0x8fdf('0x4'))},'keyContent':{'type':Sequelize[_0x8fdf('0x6')]},'idField':{'type':Sequelize[_0x8fdf('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8fdf('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 96e2bbb..9f371a3 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 _0x4fb0=['rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','FreshsalesField'];(function(_0x3f3f4f,_0x29e8c7){var _0x124519=function(_0x2a6787){while(--_0x2a6787){_0x3f3f4f['push'](_0x3f3f4f['shift']());}};_0x124519(++_0x29e8c7);}(_0x4fb0,0x1d2));var _0x04fb=function(_0x3907df,_0x350c03){_0x3907df=_0x3907df-0x0;var _0x218e5e=_0x4fb0[_0x3907df];return _0x218e5e;};'use strict';var emlformat=require(_0x04fb('0x0'));var rimraf=require(_0x04fb('0x1'));var zipdir=require(_0x04fb('0x2'));var jsonpatch=require(_0x04fb('0x3'));var rp=require(_0x04fb('0x4'));var moment=require(_0x04fb('0x5'));var BPromise=require(_0x04fb('0x6'));var Mustache=require('mustache');var util=require(_0x04fb('0x7'));var path=require(_0x04fb('0x8'));var sox=require(_0x04fb('0x9'));var csv=require(_0x04fb('0xa'));var ejs=require(_0x04fb('0xb'));var fs=require('fs');var fs_extra=require(_0x04fb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x04fb('0xd'));var jsforce=require(_0x04fb('0xe'));var deskjs=require(_0x04fb('0xf'));var toCsv=require(_0x04fb('0xa'));var querystring=require('querystring');var Papa=require(_0x04fb('0x10'));var Redis=require(_0x04fb('0x11'));var authService=require(_0x04fb('0x12'));var qs=require(_0x04fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04fb('0x14'));var logger=require(_0x04fb('0x15'))(_0x04fb('0x16'));var utils=require('../../config/utils');var config=require(_0x04fb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x04fb('0x18'))['db'];function respondWithStatusCode(_0x19ab9a,_0x32f344){_0x32f344=_0x32f344||0xcc;return function(_0x4097d9){if(_0x4097d9){return _0x19ab9a[_0x04fb('0x19')](_0x32f344);}return _0x19ab9a['status'](_0x32f344)[_0x04fb('0x1a')]();};}function respondWithResult(_0x1ef1eb,_0x2069f4){_0x2069f4=_0x2069f4||0xc8;return function(_0x5b1ca6){if(_0x5b1ca6){return _0x1ef1eb[_0x04fb('0x1b')](_0x2069f4)[_0x04fb('0x1c')](_0x5b1ca6);}};}function respondWithFilteredResult(_0x2f6944,_0x368b79){return function(_0x3bc554){if(_0x3bc554){var _0x8d10c7=typeof _0x368b79[_0x04fb('0x1d')]===_0x04fb('0x1e')&&typeof _0x368b79[_0x04fb('0x1f')]===_0x04fb('0x1e');var _0x491848=_0x3bc554['count'];var _0x9b07f=_0x8d10c7?0x0:_0x368b79[_0x04fb('0x1d')];var _0x196ce7=_0x8d10c7?_0x3bc554[_0x04fb('0x20')]:_0x368b79['offset']+_0x368b79[_0x04fb('0x1f')];var _0xc53ef8;if(_0x196ce7>=_0x491848){_0x196ce7=_0x491848;_0xc53ef8=0xc8;}else{_0xc53ef8=0xce;}_0x2f6944[_0x04fb('0x1b')](_0xc53ef8);return _0x2f6944[_0x04fb('0x21')](_0x04fb('0x22'),_0x9b07f+'-'+_0x196ce7+'/'+_0x491848)[_0x04fb('0x1c')](_0x3bc554);}return null;};}function patchUpdates(_0x19b674){return function(_0x57e372){try{jsonpatch['apply'](_0x57e372,_0x19b674,!![]);}catch(_0x531e9c){return BPromise[_0x04fb('0x23')](_0x531e9c);}return _0x57e372[_0x04fb('0x24')]();};}function saveUpdates(_0x1ed04f,_0x352aba){return function(_0x5d8dc4){if(_0x5d8dc4){return _0x5d8dc4[_0x04fb('0x25')](_0x1ed04f)[_0x04fb('0x26')](function(_0x3de515){return _0x3de515;});}return null;};}function removeEntity(_0x1ec129,_0x17e35e){return function(_0x498116){if(_0x498116){return _0x498116['destroy']()[_0x04fb('0x26')](function(){_0x1ec129['status'](0xcc)[_0x04fb('0x1a')]();});}};}function handleEntityNotFound(_0x3684b3,_0xe7a505){return function(_0x15e3ed){if(!_0x15e3ed){_0x3684b3[_0x04fb('0x19')](0x194);}return _0x15e3ed;};}function handleError(_0x4f8651,_0x2b8e5c){_0x2b8e5c=_0x2b8e5c||0x1f4;return function(_0x415f70){logger[_0x04fb('0x27')](_0x415f70['stack']);if(_0x415f70['name']){delete _0x415f70[_0x04fb('0x28')];}_0x4f8651[_0x04fb('0x1b')](_0x2b8e5c)[_0x04fb('0x29')](_0x415f70);};}exports[_0x04fb('0x2a')]=function(_0x1feef3,_0x70f822){var _0x10fbbd={},_0x162ee6={},_0x5aee91={'count':0x0,'rows':[]};var _0x191941=_[_0x04fb('0x2b')](db[_0x04fb('0x2c')][_0x04fb('0x2d')],function(_0xf5e69a){return{'name':_0xf5e69a['fieldName'],'type':_0xf5e69a[_0x04fb('0x2e')][_0x04fb('0x2f')]};});_0x162ee6[_0x04fb('0x30')]=_[_0x04fb('0x2b')](_0x191941,'name');_0x162ee6['query']=_[_0x04fb('0x31')](_0x1feef3[_0x04fb('0x32')]);_0x162ee6[_0x04fb('0x33')]=_[_0x04fb('0x34')](_0x162ee6['model'],_0x162ee6[_0x04fb('0x32')]);_0x10fbbd[_0x04fb('0x35')]=_['intersection'](_0x162ee6['model'],qs[_0x04fb('0x36')](_0x1feef3[_0x04fb('0x32')][_0x04fb('0x36')]));_0x10fbbd[_0x04fb('0x35')]=_0x10fbbd[_0x04fb('0x35')][_0x04fb('0x37')]?_0x10fbbd[_0x04fb('0x35')]:_0x162ee6['model'];if(!_0x1feef3[_0x04fb('0x32')][_0x04fb('0x38')]('nolimit')){_0x10fbbd[_0x04fb('0x1f')]=qs[_0x04fb('0x1f')](_0x1feef3[_0x04fb('0x32')][_0x04fb('0x1f')]);_0x10fbbd['offset']=qs['offset'](_0x1feef3[_0x04fb('0x32')][_0x04fb('0x1d')]);}_0x10fbbd[_0x04fb('0x39')]=qs['sort'](_0x1feef3[_0x04fb('0x32')][_0x04fb('0x3a')]);_0x10fbbd[_0x04fb('0x3b')]=qs['filters'](_[_0x04fb('0x3c')](_0x1feef3['query'],_0x162ee6['filters']),_0x191941);if(_0x1feef3['query'][_0x04fb('0x3d')]){_0x10fbbd['where']=_[_0x04fb('0x3e')](_0x10fbbd['where'],{'$or':_[_0x04fb('0x2b')](_0x191941,function(_0x2a7057){if(_0x2a7057[_0x04fb('0x2e')]!=='VIRTUAL'){var _0x3d4a67={};_0x3d4a67[_0x2a7057[_0x04fb('0x28')]]={'$like':'%'+_0x1feef3[_0x04fb('0x32')][_0x04fb('0x3d')]+'%'};return _0x3d4a67;}})});}_0x10fbbd=_[_0x04fb('0x3e')]({},_0x10fbbd,_0x1feef3['options']);var _0x5ac019={'where':_0x10fbbd[_0x04fb('0x3b')]};return db[_0x04fb('0x2c')][_0x04fb('0x20')](_0x5ac019)['then'](function(_0x4774f6){_0x5aee91[_0x04fb('0x20')]=_0x4774f6;if(_0x1feef3['query']['includeAll']){_0x10fbbd[_0x04fb('0x3f')]=[{'all':!![]}];}return db[_0x04fb('0x2c')][_0x04fb('0x40')](_0x10fbbd);})[_0x04fb('0x26')](function(_0x26c011){_0x5aee91[_0x04fb('0x41')]=_0x26c011;return _0x5aee91;})[_0x04fb('0x26')](respondWithFilteredResult(_0x70f822,_0x10fbbd))[_0x04fb('0x42')](handleError(_0x70f822,null));};exports[_0x04fb('0x43')]=function(_0x3f814b,_0x5803ce){var _0x10986f={'raw':!![],'where':{'id':_0x3f814b[_0x04fb('0x44')]['id']}},_0x4f50c1={};_0x4f50c1[_0x04fb('0x30')]=_[_0x04fb('0x31')](db[_0x04fb('0x2c')][_0x04fb('0x2d')]);_0x4f50c1[_0x04fb('0x32')]=_[_0x04fb('0x31')](_0x3f814b[_0x04fb('0x32')]);_0x4f50c1[_0x04fb('0x33')]=_[_0x04fb('0x34')](_0x4f50c1[_0x04fb('0x30')],_0x4f50c1[_0x04fb('0x32')]);_0x10986f[_0x04fb('0x35')]=_[_0x04fb('0x34')](_0x4f50c1[_0x04fb('0x30')],qs[_0x04fb('0x36')](_0x3f814b['query'][_0x04fb('0x36')]));_0x10986f['attributes']=_0x10986f[_0x04fb('0x35')][_0x04fb('0x37')]?_0x10986f[_0x04fb('0x35')]:_0x4f50c1[_0x04fb('0x30')];if(_0x3f814b['query'][_0x04fb('0x45')]){_0x10986f[_0x04fb('0x3f')]=[{'all':!![]}];}_0x10986f=_[_0x04fb('0x3e')]({},_0x10986f,_0x3f814b['options']);return db[_0x04fb('0x2c')][_0x04fb('0x46')](_0x10986f)[_0x04fb('0x26')](handleEntityNotFound(_0x5803ce,null))[_0x04fb('0x26')](respondWithResult(_0x5803ce,null))[_0x04fb('0x42')](handleError(_0x5803ce,null));};exports['create']=function(_0x229a52,_0x524df6){return db[_0x04fb('0x2c')]['create'](_0x229a52['body'],{})[_0x04fb('0x26')](respondWithResult(_0x524df6,0xc9))[_0x04fb('0x42')](handleError(_0x524df6,null));};exports[_0x04fb('0x25')]=function(_0x5478e7,_0x53d8bd){if(_0x5478e7[_0x04fb('0x47')]['id']){delete _0x5478e7[_0x04fb('0x47')]['id'];}return db[_0x04fb('0x2c')][_0x04fb('0x46')]({'where':{'id':_0x5478e7[_0x04fb('0x44')]['id']}})[_0x04fb('0x26')](handleEntityNotFound(_0x53d8bd,null))[_0x04fb('0x26')](saveUpdates(_0x5478e7[_0x04fb('0x47')],null))[_0x04fb('0x26')](respondWithResult(_0x53d8bd,null))['catch'](handleError(_0x53d8bd,null));};exports[_0x04fb('0x48')]=function(_0x47ec4d,_0x2398d8){return db[_0x04fb('0x2c')][_0x04fb('0x46')]({'where':{'id':_0x47ec4d[_0x04fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x2398d8,null))['then'](removeEntity(_0x2398d8,null))['catch'](handleError(_0x2398d8,null));}; \ No newline at end of file +var _0x7936=['undefined','limit','count','set','Content-Range','apply','destroy','then','error','stack','name','send','map','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','FreshsalesField','findAll','params','rawAttributes','fields','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x9c8cfc,_0x4dd439){var _0x2e0282=function(_0x1eebfd){while(--_0x1eebfd){_0x9c8cfc['push'](_0x9c8cfc['shift']());}};_0x2e0282(++_0x4dd439);}(_0x7936,0x18b));var _0x6793=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7936[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6793('0x0'));var rimraf=require(_0x6793('0x1'));var zipdir=require(_0x6793('0x2'));var jsonpatch=require(_0x6793('0x3'));var rp=require(_0x6793('0x4'));var moment=require(_0x6793('0x5'));var BPromise=require(_0x6793('0x6'));var Mustache=require(_0x6793('0x7'));var util=require(_0x6793('0x8'));var path=require(_0x6793('0x9'));var sox=require('sox');var csv=require(_0x6793('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6793('0xb'));var _=require('lodash');var squel=require(_0x6793('0xc'));var crypto=require(_0x6793('0xd'));var jsforce=require(_0x6793('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6793('0xf'));var Papa=require(_0x6793('0x10'));var Redis=require(_0x6793('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6793('0x12'));var as=require(_0x6793('0x13'));var hardwareService=require(_0x6793('0x14'));var logger=require(_0x6793('0x15'))(_0x6793('0x16'));var utils=require(_0x6793('0x17'));var config=require(_0x6793('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6793('0x19'))['db'];function respondWithStatusCode(_0xbfcfc4,_0x20c441){_0x20c441=_0x20c441||0xcc;return function(_0x533f91){if(_0x533f91){return _0xbfcfc4[_0x6793('0x1a')](_0x20c441);}return _0xbfcfc4[_0x6793('0x1b')](_0x20c441)[_0x6793('0x1c')]();};}function respondWithResult(_0x456ac6,_0x9b8b9c){_0x9b8b9c=_0x9b8b9c||0xc8;return function(_0x102d66){if(_0x102d66){return _0x456ac6[_0x6793('0x1b')](_0x9b8b9c)[_0x6793('0x1d')](_0x102d66);}};}function respondWithFilteredResult(_0x4ca0f6,_0x2289f9){return function(_0x70b6fe){if(_0x70b6fe){var _0x32401a=typeof _0x2289f9[_0x6793('0x1e')]===_0x6793('0x1f')&&typeof _0x2289f9[_0x6793('0x20')]===_0x6793('0x1f');var _0x4c16b0=_0x70b6fe[_0x6793('0x21')];var _0x48c926=_0x32401a?0x0:_0x2289f9[_0x6793('0x1e')];var _0x2d120a=_0x32401a?_0x70b6fe[_0x6793('0x21')]:_0x2289f9['offset']+_0x2289f9['limit'];var _0x5b2df7;if(_0x2d120a>=_0x4c16b0){_0x2d120a=_0x4c16b0;_0x5b2df7=0xc8;}else{_0x5b2df7=0xce;}_0x4ca0f6[_0x6793('0x1b')](_0x5b2df7);return _0x4ca0f6[_0x6793('0x22')](_0x6793('0x23'),_0x48c926+'-'+_0x2d120a+'/'+_0x4c16b0)[_0x6793('0x1d')](_0x70b6fe);}return null;};}function patchUpdates(_0x31e347){return function(_0x511b55){try{jsonpatch[_0x6793('0x24')](_0x511b55,_0x31e347,!![]);}catch(_0x2390db){return BPromise['reject'](_0x2390db);}return _0x511b55['save']();};}function saveUpdates(_0x579ce1,_0x513446){return function(_0x250d6c){if(_0x250d6c){return _0x250d6c['update'](_0x579ce1)['then'](function(_0x505fde){return _0x505fde;});}return null;};}function removeEntity(_0x8ba035,_0x467f5a){return function(_0x461fae){if(_0x461fae){return _0x461fae[_0x6793('0x25')]()[_0x6793('0x26')](function(){_0x8ba035['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x432633,_0x58fd1c){return function(_0x95ca44){if(!_0x95ca44){_0x432633['sendStatus'](0x194);}return _0x95ca44;};}function handleError(_0x57b833,_0x385f8b){_0x385f8b=_0x385f8b||0x1f4;return function(_0x43f476){logger[_0x6793('0x27')](_0x43f476[_0x6793('0x28')]);if(_0x43f476[_0x6793('0x29')]){delete _0x43f476[_0x6793('0x29')];}_0x57b833['status'](_0x385f8b)[_0x6793('0x2a')](_0x43f476);};}exports['index']=function(_0x4d75cf,_0x2b44e8){var _0x564c0e={},_0x14ab4d={},_0x43bed7={'count':0x0,'rows':[]};var _0x567fb9=_[_0x6793('0x2b')](db['FreshsalesField']['rawAttributes'],function(_0x2ebba8){return{'name':_0x2ebba8[_0x6793('0x2c')],'type':_0x2ebba8[_0x6793('0x2d')]['key']};});_0x14ab4d[_0x6793('0x2e')]=_[_0x6793('0x2b')](_0x567fb9,_0x6793('0x29'));_0x14ab4d[_0x6793('0x2f')]=_[_0x6793('0x30')](_0x4d75cf[_0x6793('0x2f')]);_0x14ab4d[_0x6793('0x31')]=_['intersection'](_0x14ab4d[_0x6793('0x2e')],_0x14ab4d[_0x6793('0x2f')]);_0x564c0e[_0x6793('0x32')]=_[_0x6793('0x33')](_0x14ab4d[_0x6793('0x2e')],qs['fields'](_0x4d75cf[_0x6793('0x2f')]['fields']));_0x564c0e[_0x6793('0x32')]=_0x564c0e[_0x6793('0x32')][_0x6793('0x34')]?_0x564c0e[_0x6793('0x32')]:_0x14ab4d[_0x6793('0x2e')];if(!_0x4d75cf[_0x6793('0x2f')][_0x6793('0x35')](_0x6793('0x36'))){_0x564c0e[_0x6793('0x20')]=qs['limit'](_0x4d75cf[_0x6793('0x2f')]['limit']);_0x564c0e[_0x6793('0x1e')]=qs['offset'](_0x4d75cf[_0x6793('0x2f')][_0x6793('0x1e')]);}_0x564c0e[_0x6793('0x37')]=qs[_0x6793('0x38')](_0x4d75cf[_0x6793('0x2f')][_0x6793('0x38')]);_0x564c0e[_0x6793('0x39')]=qs[_0x6793('0x31')](_[_0x6793('0x3a')](_0x4d75cf['query'],_0x14ab4d[_0x6793('0x31')]),_0x567fb9);if(_0x4d75cf[_0x6793('0x2f')][_0x6793('0x3b')]){_0x564c0e[_0x6793('0x39')]=_['merge'](_0x564c0e[_0x6793('0x39')],{'$or':_[_0x6793('0x2b')](_0x567fb9,function(_0x538de9){if(_0x538de9[_0x6793('0x2d')]!=='VIRTUAL'){var _0x3f482c={};_0x3f482c[_0x538de9['name']]={'$like':'%'+_0x4d75cf[_0x6793('0x2f')]['filter']+'%'};return _0x3f482c;}})});}_0x564c0e=_['merge']({},_0x564c0e,_0x4d75cf['options']);var _0x19eb28={'where':_0x564c0e[_0x6793('0x39')]};return db['FreshsalesField']['count'](_0x19eb28)[_0x6793('0x26')](function(_0x13c483){_0x43bed7['count']=_0x13c483;if(_0x4d75cf[_0x6793('0x2f')][_0x6793('0x3c')]){_0x564c0e[_0x6793('0x3d')]=[{'all':!![]}];}return db[_0x6793('0x3e')][_0x6793('0x3f')](_0x564c0e);})[_0x6793('0x26')](function(_0x709262){_0x43bed7['rows']=_0x709262;return _0x43bed7;})['then'](respondWithFilteredResult(_0x2b44e8,_0x564c0e))['catch'](handleError(_0x2b44e8,null));};exports['show']=function(_0x1f4352,_0xea49d9){var _0x4a3e2c={'raw':!![],'where':{'id':_0x1f4352[_0x6793('0x40')]['id']}},_0x13d84e={};_0x13d84e[_0x6793('0x2e')]=_[_0x6793('0x30')](db[_0x6793('0x3e')][_0x6793('0x41')]);_0x13d84e[_0x6793('0x2f')]=_['keys'](_0x1f4352[_0x6793('0x2f')]);_0x13d84e[_0x6793('0x31')]=_[_0x6793('0x33')](_0x13d84e['model'],_0x13d84e[_0x6793('0x2f')]);_0x4a3e2c['attributes']=_[_0x6793('0x33')](_0x13d84e['model'],qs['fields'](_0x1f4352['query'][_0x6793('0x42')]));_0x4a3e2c[_0x6793('0x32')]=_0x4a3e2c[_0x6793('0x32')][_0x6793('0x34')]?_0x4a3e2c['attributes']:_0x13d84e[_0x6793('0x2e')];if(_0x1f4352[_0x6793('0x2f')][_0x6793('0x3c')]){_0x4a3e2c['include']=[{'all':!![]}];}_0x4a3e2c=_['merge']({},_0x4a3e2c,_0x1f4352[_0x6793('0x43')]);return db['FreshsalesField'][_0x6793('0x44')](_0x4a3e2c)[_0x6793('0x26')](handleEntityNotFound(_0xea49d9,null))['then'](respondWithResult(_0xea49d9,null))[_0x6793('0x45')](handleError(_0xea49d9,null));};exports['create']=function(_0x38510c,_0x31a15d){return db['FreshsalesField']['create'](_0x38510c['body'],{})[_0x6793('0x26')](respondWithResult(_0x31a15d,0xc9))[_0x6793('0x45')](handleError(_0x31a15d,null));};exports['update']=function(_0x5dbff9,_0x2c8af6){if(_0x5dbff9['body']['id']){delete _0x5dbff9['body']['id'];}return db[_0x6793('0x3e')][_0x6793('0x44')]({'where':{'id':_0x5dbff9[_0x6793('0x40')]['id']}})[_0x6793('0x26')](handleEntityNotFound(_0x2c8af6,null))[_0x6793('0x26')](saveUpdates(_0x5dbff9[_0x6793('0x46')],null))[_0x6793('0x26')](respondWithResult(_0x2c8af6,null))[_0x6793('0x45')](handleError(_0x2c8af6,null));};exports[_0x6793('0x25')]=function(_0x552d7f,_0x339d71){return db[_0x6793('0x3e')]['find']({'where':{'id':_0x552d7f[_0x6793('0x40')]['id']}})[_0x6793('0x26')](handleEntityNotFound(_0x339d71,null))[_0x6793('0x26')](removeEntity(_0x339d71,null))['catch'](handleError(_0x339d71,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index dbf311e..e2e1ad6 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 _0x352e=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x352e,0x1a6));var _0xe352=function(_0x17e0d4,_0x2636d8){_0x17e0d4=_0x17e0d4-0x0;var _0x362714=_0x352e[_0x17e0d4];return _0x362714;};'use strict';var _=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var logger=require(_0xe352('0x2'))(_0xe352('0x3'));var moment=require(_0xe352('0x4'));var BPromise=require(_0xe352('0x5'));var rp=require(_0xe352('0x6'));var fs=require('fs');var path=require(_0xe352('0x7'));var rimraf=require('rimraf');var config=require(_0xe352('0x8'));var attributes=require(_0xe352('0x9'));module['exports']=function(_0x2fed6a,_0x31aac8){return _0x2fed6a[_0xe352('0xa')](_0xe352('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xe352('0xc'),'fields':[_0xe352('0xd'),_0xe352('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d62=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x8d62,0xf8));var _0x28d6=function(_0x4be77f,_0x29b810){_0x4be77f=_0x4be77f-0x0;var _0x36eaaa=_0x8d62[_0x4be77f];return _0x36eaaa;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var logger=require(_0x28d6('0x1'))(_0x28d6('0x2'));var moment=require(_0x28d6('0x3'));var BPromise=require(_0x28d6('0x4'));var rp=require(_0x28d6('0x5'));var fs=require('fs');var path=require(_0x28d6('0x6'));var rimraf=require(_0x28d6('0x7'));var config=require(_0x28d6('0x8'));var attributes=require(_0x28d6('0x9'));module[_0x28d6('0xa')]=function(_0x4385ba,_0x3c827b){return _0x4385ba[_0x28d6('0xb')]('FreshsalesField',attributes,{'tableName':_0x28d6('0xc'),'paranoid':![],'indexes':[{'name':_0x28d6('0xd'),'fields':[_0x28d6('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 1d7af30..4064b7d 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x4975,0x86));var _0x5497=function(_0x191259,_0x5c846c){_0x191259=_0x191259-0x0;var _0x592e40=_0x4975[_0x191259];return _0x592e40;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x679a2f,_0x2e2155){var _0x42206b=function(_0x31a36e){while(--_0x31a36e){_0x679a2f['push'](_0x679a2f['shift']());}};_0x42206b(++_0x2e2155);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c34cc2c..9ff996f 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(_0x4cbe76,_0x32db92){var _0x5e13be=function(_0x5dd731){while(--_0x5dd731){_0x4cbe76['push'](_0x4cbe76['shift']());}};_0x5e13be(++_0x32db92);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x39aa03,_0x83a9ee){var _0x4efc32=function(_0x227f0a){while(--_0x227f0a){_0x39aa03['push'](_0x39aa03['shift']());}};_0x4efc32(++_0x83a9ee);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 4db832e..6595b7f 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 _0x9131=['STRING','username','newTab','sequelize','exports'];(function(_0xb5a6a3,_0x4c25af){var _0x491209=function(_0x443b5c){while(--_0x443b5c){_0xb5a6a3['push'](_0xb5a6a3['shift']());}};_0x491209(++_0x4c25af);}(_0x9131,0xc6));var _0x1913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9131[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1913('0x0'));module[_0x1913('0x1')]={'name':{'type':Sequelize[_0x1913('0x2')]},'description':{'type':Sequelize[_0x1913('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1913('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1913('0x2')]},'clientId':{'type':Sequelize[_0x1913('0x2')]},'clientSecret':{'type':Sequelize[_0x1913('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1913('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x1913('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4e7b=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x170536,_0xad16cb){_0x170536=_0x170536-0x0;var _0x500e95=_0x4e7b[_0x170536];return _0x500e95;};'use strict';var Sequelize=require(_0xb4e7('0x0'));module[_0xb4e7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb4e7('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb4e7('0x3')},'remoteUri':{'type':Sequelize[_0xb4e7('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb4e7('0x2')]},'clientSecret':{'type':Sequelize[_0xb4e7('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb4e7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb4e7('0x4')](_0xb4e7('0x5'),_0xb4e7('0x6')),'defaultValue':_0xb4e7('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 01feb93..59a5ea4 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 _0x3051=['True','False','false','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SalesforceAccount','includeAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','SalesforceConfiguration','filter','hasOwnProperty','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','login','concat','ticketType','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x3051,0x85));var _0x1305=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3051[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1305('0x0'));var rp=require(_0x1305('0x1'));var moment=require(_0x1305('0x2'));var BPromise=require(_0x1305('0x3'));var Mustache=require(_0x1305('0x4'));var util=require('util');var path=require(_0x1305('0x5'));var sox=require(_0x1305('0x6'));var csv=require(_0x1305('0x7'));var ejs=require(_0x1305('0x8'));var fs=require('fs');var fs_extra=require(_0x1305('0x9'));var _=require(_0x1305('0xa'));var squel=require(_0x1305('0xb'));var crypto=require(_0x1305('0xc'));var jsforce=require(_0x1305('0xd'));var deskjs=require(_0x1305('0xe'));var toCsv=require(_0x1305('0x7'));var querystring=require(_0x1305('0xf'));var Papa=require('papaparse');var Redis=require(_0x1305('0x10'));var authService=require(_0x1305('0x11'));var qs=require(_0x1305('0x12'));var as=require(_0x1305('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1305('0x14'))(_0x1305('0x15'));var utils=require('../../config/utils');var config=require(_0x1305('0x16'));var licenseUtil=require(_0x1305('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1305('0x18'));function respondWithStatusCode(_0x16b377,_0x269f84){_0x269f84=_0x269f84||0xcc;return function(_0x110477){if(_0x110477){return _0x16b377[_0x1305('0x19')](_0x269f84);}return _0x16b377[_0x1305('0x1a')](_0x269f84)[_0x1305('0x1b')]();};}function respondWithResult(_0x37838c,_0xf6709c){_0xf6709c=_0xf6709c||0xc8;return function(_0x7b1adc){if(_0x7b1adc){return _0x37838c[_0x1305('0x1a')](_0xf6709c)[_0x1305('0x1c')](_0x7b1adc);}};}function respondWithFilteredResult(_0x4509e7,_0x2ea162){return function(_0x5faa4){if(_0x5faa4){var _0x38f3dd=typeof _0x2ea162[_0x1305('0x1d')]===_0x1305('0x1e')&&typeof _0x2ea162[_0x1305('0x1f')]===_0x1305('0x1e');var _0x31ed44=_0x5faa4['count'];var _0x1f68c8=_0x38f3dd?0x0:_0x2ea162[_0x1305('0x1d')];var _0x58994b=_0x38f3dd?_0x5faa4[_0x1305('0x20')]:_0x2ea162[_0x1305('0x1d')]+_0x2ea162['limit'];var _0x305151;if(_0x58994b>=_0x31ed44){_0x58994b=_0x31ed44;_0x305151=0xc8;}else{_0x305151=0xce;}_0x4509e7[_0x1305('0x1a')](_0x305151);return _0x4509e7['set'](_0x1305('0x21'),_0x1f68c8+'-'+_0x58994b+'/'+_0x31ed44)[_0x1305('0x1c')](_0x5faa4);}return null;};}function patchUpdates(_0x459361){return function(_0x16b247){try{jsonpatch['apply'](_0x16b247,_0x459361,!![]);}catch(_0x211d5d){return BPromise['reject'](_0x211d5d);}return _0x16b247[_0x1305('0x22')]();};}function saveUpdates(_0x3c29b1,_0x283972){return function(_0x49ee4e){if(_0x49ee4e){return _0x49ee4e['update'](_0x3c29b1)[_0x1305('0x23')](function(_0x4a462f){return _0x4a462f;});}return null;};}function removeEntity(_0x6b5ef9,_0x4f5fe5){return function(_0x24c843){if(_0x24c843){return _0x24c843['destroy']()['then'](function(){_0x6b5ef9[_0x1305('0x1a')](0xcc)[_0x1305('0x1b')]();});}};}function handleEntityNotFound(_0x2b7645,_0x563ab9){return function(_0x569e44){if(!_0x569e44){_0x2b7645[_0x1305('0x19')](0x194);}return _0x569e44;};}function handleError(_0x5110fa,_0x123c04){_0x123c04=_0x123c04||0x1f4;return function(_0x4422eb){logger['error'](_0x4422eb[_0x1305('0x24')]);if(_0x4422eb[_0x1305('0x25')]){delete _0x4422eb[_0x1305('0x25')];}_0x5110fa[_0x1305('0x1a')](_0x123c04)['send'](_0x4422eb);};}exports['index']=function(_0x43f0ce,_0x17266c){var _0x31d5d0={},_0x3a6147={},_0x188473={'count':0x0,'rows':[]};var _0x2d2315=_[_0x1305('0x26')](db['SalesforceAccount'][_0x1305('0x27')],function(_0x2505cf){return{'name':_0x2505cf[_0x1305('0x28')],'type':_0x2505cf[_0x1305('0x29')][_0x1305('0x2a')]};});_0x3a6147['model']=_[_0x1305('0x26')](_0x2d2315,'name');_0x3a6147[_0x1305('0x2b')]=_[_0x1305('0x2c')](_0x43f0ce['query']);_0x3a6147[_0x1305('0x2d')]=_[_0x1305('0x2e')](_0x3a6147[_0x1305('0x2f')],_0x3a6147[_0x1305('0x2b')]);_0x31d5d0[_0x1305('0x30')]=_['intersection'](_0x3a6147['model'],qs[_0x1305('0x31')](_0x43f0ce[_0x1305('0x2b')][_0x1305('0x31')]));_0x31d5d0[_0x1305('0x30')]=_0x31d5d0[_0x1305('0x30')][_0x1305('0x32')]?_0x31d5d0[_0x1305('0x30')]:_0x3a6147['model'];if(!_0x43f0ce[_0x1305('0x2b')]['hasOwnProperty'](_0x1305('0x33'))){_0x31d5d0['limit']=qs['limit'](_0x43f0ce[_0x1305('0x2b')]['limit']);_0x31d5d0[_0x1305('0x1d')]=qs[_0x1305('0x1d')](_0x43f0ce['query']['offset']);}_0x31d5d0[_0x1305('0x34')]=qs['sort'](_0x43f0ce[_0x1305('0x2b')][_0x1305('0x35')]);_0x31d5d0[_0x1305('0x36')]=qs[_0x1305('0x2d')](_[_0x1305('0x37')](_0x43f0ce[_0x1305('0x2b')],_0x3a6147[_0x1305('0x2d')]),_0x2d2315);if(_0x43f0ce['query']['filter']){_0x31d5d0[_0x1305('0x36')]=_[_0x1305('0x38')](_0x31d5d0[_0x1305('0x36')],{'$or':_['map'](_0x2d2315,function(_0x295973){if(_0x295973['type']!==_0x1305('0x39')){var _0x1f93d3={};_0x1f93d3[_0x295973[_0x1305('0x25')]]={'$like':'%'+_0x43f0ce['query']['filter']+'%'};return _0x1f93d3;}})});}_0x31d5d0=_['merge']({},_0x31d5d0,_0x43f0ce[_0x1305('0x3a')]);var _0x3e8735={'where':_0x31d5d0[_0x1305('0x36')]};return db[_0x1305('0x3b')][_0x1305('0x20')](_0x3e8735)[_0x1305('0x23')](function(_0x133337){_0x188473['count']=_0x133337;if(_0x43f0ce[_0x1305('0x2b')][_0x1305('0x3c')]){_0x31d5d0['include']=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x31d5d0);})[_0x1305('0x23')](function(_0x4e6286){_0x188473[_0x1305('0x3d')]=_0x4e6286;return _0x188473;})[_0x1305('0x23')](respondWithFilteredResult(_0x17266c,_0x31d5d0))[_0x1305('0x3e')](handleError(_0x17266c,null));};exports[_0x1305('0x3f')]=function(_0x3787be,_0x316ad2){var _0x1154fd={'raw':![],'where':{'id':_0x3787be[_0x1305('0x40')]['id']}},_0x3e0ae3={};_0x3e0ae3[_0x1305('0x2f')]=_[_0x1305('0x2c')](db[_0x1305('0x3b')]['rawAttributes']);_0x3e0ae3[_0x1305('0x2b')]=_[_0x1305('0x2c')](_0x3787be[_0x1305('0x2b')]);_0x3e0ae3['filters']=_['intersection'](_0x3e0ae3[_0x1305('0x2f')],_0x3e0ae3[_0x1305('0x2b')]);_0x1154fd['attributes']=_[_0x1305('0x2e')](_0x3e0ae3['model'],qs[_0x1305('0x31')](_0x3787be[_0x1305('0x2b')][_0x1305('0x31')]));_0x1154fd[_0x1305('0x30')]=_0x1154fd['attributes'][_0x1305('0x32')]?_0x1154fd[_0x1305('0x30')]:_0x3e0ae3[_0x1305('0x2f')];if(_0x3787be['query'][_0x1305('0x3c')]){_0x1154fd[_0x1305('0x41')]=[{'all':!![]}];}_0x1154fd=_[_0x1305('0x38')]({},_0x1154fd,_0x3787be[_0x1305('0x3a')]);return db[_0x1305('0x3b')][_0x1305('0x42')](_0x1154fd)[_0x1305('0x23')](handleEntityNotFound(_0x316ad2,null))[_0x1305('0x23')](respondWithResult(_0x316ad2,null))[_0x1305('0x3e')](handleError(_0x316ad2,null));};exports[_0x1305('0x43')]=function(_0x33d4c2,_0x142b59){return db[_0x1305('0x3b')][_0x1305('0x43')](_0x33d4c2[_0x1305('0x44')],{})[_0x1305('0x23')](respondWithResult(_0x142b59,0xc9))[_0x1305('0x3e')](handleError(_0x142b59,null));};exports['update']=function(_0x1b9331,_0x5e4608){if(_0x1b9331[_0x1305('0x44')]['id']){delete _0x1b9331['body']['id'];}return db[_0x1305('0x3b')][_0x1305('0x42')]({'where':{'id':_0x1b9331['params']['id']}})['then'](handleEntityNotFound(_0x5e4608,null))[_0x1305('0x23')](saveUpdates(_0x1b9331['body'],null))['then'](respondWithResult(_0x5e4608,null))[_0x1305('0x3e')](handleError(_0x5e4608,null));};exports[_0x1305('0x45')]=function(_0x294466,_0x507c32){return db[_0x1305('0x3b')]['find']({'where':{'id':_0x294466[_0x1305('0x40')]['id']}})['then'](handleEntityNotFound(_0x507c32,null))[_0x1305('0x23')](removeEntity(_0x507c32,null))[_0x1305('0x3e')](handleError(_0x507c32,null));};exports[_0x1305('0x46')]=function(_0x47fc80,_0x3c00ec,_0x3d6b5d){var _0x3ab23e={};var _0x487ec0={};var _0x3f5886;var _0x35ff4e;return db[_0x1305('0x3b')]['findOne']({'where':{'id':_0x47fc80[_0x1305('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c00ec,null))['then'](function(_0x3cc174){if(_0x3cc174){_0x3f5886=_0x3cc174;_0x487ec0[_0x1305('0x2f')]=_[_0x1305('0x2c')](db[_0x1305('0x47')][_0x1305('0x27')]);_0x487ec0['query']=_[_0x1305('0x2c')](_0x47fc80[_0x1305('0x2b')]);_0x487ec0[_0x1305('0x2d')]=_[_0x1305('0x2e')](_0x487ec0['model'],_0x487ec0[_0x1305('0x2b')]);_0x3ab23e[_0x1305('0x30')]=_['intersection'](_0x487ec0['model'],qs[_0x1305('0x31')](_0x47fc80[_0x1305('0x2b')]['fields']));_0x3ab23e[_0x1305('0x30')]=_0x3ab23e[_0x1305('0x30')][_0x1305('0x32')]?_0x3ab23e[_0x1305('0x30')]:_0x487ec0[_0x1305('0x2f')];_0x3ab23e[_0x1305('0x34')]=qs[_0x1305('0x35')](_0x47fc80['query']['sort']);_0x3ab23e['where']=qs[_0x1305('0x2d')](_['pick'](_0x47fc80['query'],_0x487ec0[_0x1305('0x2d')]));if(_0x47fc80[_0x1305('0x2b')][_0x1305('0x48')]){_0x3ab23e[_0x1305('0x36')]=_[_0x1305('0x38')](_0x3ab23e['where'],{'$or':_[_0x1305('0x26')](_0x3ab23e[_0x1305('0x30')],function(_0x4e4847){var _0x529515={};_0x529515[_0x4e4847]={'$like':'%'+_0x47fc80[_0x1305('0x2b')][_0x1305('0x48')]+'%'};return _0x529515;})});}_0x3ab23e=_[_0x1305('0x38')]({},_0x3ab23e,_0x47fc80[_0x1305('0x3a')]);return _0x3f5886['getConfigurations'](_0x3ab23e);}})[_0x1305('0x23')](function(_0x5db651){if(_0x5db651){_0x35ff4e=_0x5db651[_0x1305('0x32')];if(!_0x47fc80[_0x1305('0x2b')][_0x1305('0x49')](_0x1305('0x33'))){_0x3ab23e[_0x1305('0x1f')]=qs[_0x1305('0x1f')](_0x47fc80[_0x1305('0x2b')][_0x1305('0x1f')]);_0x3ab23e['offset']=qs['offset'](_0x47fc80['query'][_0x1305('0x1d')]);}return _0x3f5886['getConfigurations'](_0x3ab23e);}})[_0x1305('0x23')](function(_0x551c4b){if(_0x551c4b){return _0x551c4b?{'count':_0x35ff4e,'rows':_0x551c4b}:null;}})['then'](respondWithResult(_0x3c00ec,null))[_0x1305('0x3e')](handleError(_0x3c00ec,null));};exports[_0x1305('0x4a')]=function(_0x2bd845,_0x56278b,_0x5a34b5){if(_0x2bd845['body']['id']){delete _0x2bd845['body']['id'];}return db[_0x1305('0x3b')]['findOne']({'where':{'id':_0x2bd845[_0x1305('0x40')]['id']}})['then'](handleEntityNotFound(_0x56278b,null))[_0x1305('0x23')](function(_0x55b5a8){if(_0x55b5a8){_0x2bd845[_0x1305('0x44')]['AccountId']=_0x55b5a8['id'];_0x2bd845[_0x1305('0x44')][_0x1305('0x4b')]=integrations['getSubjects'](_0x2bd845[_0x1305('0x44')][_0x1305('0x4c')],_0x2bd845[_0x1305('0x44')][_0x1305('0x29')]);_0x2bd845['body'][_0x1305('0x4d')]=integrations[_0x1305('0x4e')](_0x2bd845['body'][_0x1305('0x4c')],_0x2bd845['body']['type']);return db[_0x1305('0x47')][_0x1305('0x43')](_0x2bd845[_0x1305('0x44')],{'include':[{'model':db[_0x1305('0x4f')],'as':_0x1305('0x4b')},{'model':db[_0x1305('0x4f')],'as':'Descriptions'}]});}return null;})[_0x1305('0x23')](respondWithResult(_0x56278b,null))[_0x1305('0x3e')](handleError(_0x56278b,null));};exports['getFields']=function(_0x3dc968,_0x70e99b,_0x30aa31){var _0x54329e;var _0x3d5545='';var _0x573969=_0x1305('0x50');return db[_0x1305('0x3b')]['findOne']({'where':{'id':_0x3dc968[_0x1305('0x40')]['id']},'attributes':['id',_0x1305('0x51'),_0x1305('0x52'),_0x1305('0x53'),_0x1305('0x54'),_0x1305('0x55'),_0x1305('0x56')]})[_0x1305('0x23')](handleEntityNotFound(_0x70e99b,null))[_0x1305('0x23')](function(_0x49a05d){if(_0x49a05d){_0x3d5545=_0x49a05d[_0x1305('0x51')];var _0x5bd4d1=_0x3d5545[_0x1305('0x57')](-0x1);if(_0x5bd4d1==='/'){_0x3d5545=_0x3d5545[_0x1305('0x58')](0x0,_0x3d5545[_0x1305('0x59')](_0x5bd4d1));}_0x54329e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3d5545,'clientId':_0x49a05d['clientId'],'clientSecret':_0x49a05d[_0x1305('0x53')]}});return _0x54329e[_0x1305('0x5a')](_0x49a05d[_0x1305('0x54')],_0x49a05d['password'][_0x1305('0x5b')](_0x49a05d[_0x1305('0x56')]));}})[_0x1305('0x23')](function(_0x35006a){if(_0x35006a){if(!_['isNil'](_0x3dc968[_0x1305('0x2b')][_0x1305('0x5c')])){_0x573969=_0x3dc968[_0x1305('0x2b')][_0x1305('0x5c')];}return _0x54329e['sobject'](_0x573969)['describe']();}})[_0x1305('0x23')](function(_0x5e2c33){var _0x3e7c30=[_0x1305('0x5d'),_0x1305('0x5e'),_0x1305('0x5f'),_0x1305('0x60'),_0x1305('0x61'),_0x1305('0x62')];var _0x4a0749=[_0x1305('0x63'),_0x1305('0x64'),_0x1305('0x65'),_0x1305('0x66'),'email',_0x1305('0x67'),_0x1305('0x68')];if(_0x5e2c33){_[_0x1305('0x69')](_0x5e2c33['fields'],function(_0x249797){return _0x3e7c30[_0x1305('0x6a')](_0x249797['name'])||!_0x4a0749[_0x1305('0x6a')](_0x249797[_0x1305('0x29')]);});return{'count':_0x5e2c33[_0x1305('0x31')]['length'],'rows':_[_0x1305('0x26')](_0x5e2c33[_0x1305('0x31')],function(_0x187902){return{'id':_0x187902[_0x1305('0x25')],'name':_0x187902[_0x1305('0x6b')],'custom':_0x187902[_0x1305('0x6c')],'options':_0x187902[_0x1305('0x6d')]['length']>0x0?_[_0x1305('0x26')](_0x187902[_0x1305('0x6d')],function(_0x271b49){return{'name':_0x271b49[_0x1305('0x6b')],'value':_0x271b49[_0x1305('0x6e')]};}):_0x187902[_0x1305('0x29')]==_0x1305('0x66')?[{'name':_0x1305('0x6f'),'value':'true'},{'name':_0x1305('0x70'),'value':_0x1305('0x71')}]:[]};})};}})[_0x1305('0x23')](respondWithResult(_0x70e99b,null))[_0x1305('0x3e')](function(_0x348f86){var _0xaaffd1=_0x3dc968[_0x1305('0x2b')][_0x1305('0x72')]?0x1f4:_0x348f86['statusCode']||0x1f4;logger[_0x1305('0x73')](_0x1305('0x74'),_0x1305('0x75'),_0xaaffd1,JSON[_0x1305('0x76')](_0x348f86));delete _0x348f86['name'];if(_0xaaffd1===0x191){_0xaaffd1=0x190;}_0x70e99b[_0x1305('0x1a')](_0xaaffd1)[_0x1305('0x77')](_0x3dc968['query'][_0x1305('0x72')]?{'message':_0x1305('0x78'),'statusCode':_0x348f86[_0x1305('0x79')]}:_0x348f86);});}; \ No newline at end of file +var _0xae2d=['type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','lastIndexOf','login','username','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','boolean','email','textarea','phone','remove','includes','custom','picklistValues','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','mustache','path','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','sendStatus','status','json','offset','undefined','limit','set','save','update','then','end','error','name','index','map','SalesforceAccount','rawAttributes','fieldName'];(function(_0x2727e5,_0x361206){var _0x1bf4b3=function(_0x3b1c26){while(--_0x3b1c26){_0x2727e5['push'](_0x2727e5['shift']());}};_0x1bf4b3(++_0x361206);}(_0xae2d,0xcc));var _0xdae2=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xae2d[_0x4db46b];return _0x565be8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdae2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdae2('0x1'));var moment=require(_0xdae2('0x2'));var BPromise=require(_0xdae2('0x3'));var Mustache=require(_0xdae2('0x4'));var util=require('util');var path=require(_0xdae2('0x5'));var sox=require('sox');var csv=require(_0xdae2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdae2('0x7'));var _=require(_0xdae2('0x8'));var squel=require(_0xdae2('0x9'));var crypto=require(_0xdae2('0xa'));var jsforce=require(_0xdae2('0xb'));var deskjs=require(_0xdae2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdae2('0xd'));var Papa=require(_0xdae2('0xe'));var Redis=require(_0xdae2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdae2('0x10'));var as=require(_0xdae2('0x11'));var hardwareService=require(_0xdae2('0x12'));var logger=require(_0xdae2('0x13'))('api');var utils=require(_0xdae2('0x14'));var config=require(_0xdae2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x131f0c,_0x364bfe){_0x364bfe=_0x364bfe||0xcc;return function(_0x77a226){if(_0x77a226){return _0x131f0c[_0xdae2('0x16')](_0x364bfe);}return _0x131f0c[_0xdae2('0x17')](_0x364bfe)['end']();};}function respondWithResult(_0x5d75ec,_0x2bb76d){_0x2bb76d=_0x2bb76d||0xc8;return function(_0x4b21d3){if(_0x4b21d3){return _0x5d75ec[_0xdae2('0x17')](_0x2bb76d)[_0xdae2('0x18')](_0x4b21d3);}};}function respondWithFilteredResult(_0x11ecb6,_0x4f0289){return function(_0xdbadab){if(_0xdbadab){var _0x33ec56=typeof _0x4f0289[_0xdae2('0x19')]===_0xdae2('0x1a')&&typeof _0x4f0289[_0xdae2('0x1b')]===_0xdae2('0x1a');var _0x1b88cd=_0xdbadab['count'];var _0x161016=_0x33ec56?0x0:_0x4f0289[_0xdae2('0x19')];var _0x171f4d=_0x33ec56?_0xdbadab['count']:_0x4f0289[_0xdae2('0x19')]+_0x4f0289[_0xdae2('0x1b')];var _0xd743df;if(_0x171f4d>=_0x1b88cd){_0x171f4d=_0x1b88cd;_0xd743df=0xc8;}else{_0xd743df=0xce;}_0x11ecb6[_0xdae2('0x17')](_0xd743df);return _0x11ecb6[_0xdae2('0x1c')]('Content-Range',_0x161016+'-'+_0x171f4d+'/'+_0x1b88cd)[_0xdae2('0x18')](_0xdbadab);}return null;};}function patchUpdates(_0x49baf7){return function(_0x10d108){try{jsonpatch['apply'](_0x10d108,_0x49baf7,!![]);}catch(_0xe703bf){return BPromise['reject'](_0xe703bf);}return _0x10d108[_0xdae2('0x1d')]();};}function saveUpdates(_0x1bb2e6,_0x3e544a){return function(_0x25dd82){if(_0x25dd82){return _0x25dd82[_0xdae2('0x1e')](_0x1bb2e6)[_0xdae2('0x1f')](function(_0x5cbf1b){return _0x5cbf1b;});}return null;};}function removeEntity(_0x3d4b38,_0x48ddb0){return function(_0x391c20){if(_0x391c20){return _0x391c20['destroy']()['then'](function(){_0x3d4b38[_0xdae2('0x17')](0xcc)[_0xdae2('0x20')]();});}};}function handleEntityNotFound(_0x2288c6,_0x2f0e44){return function(_0x4fccc7){if(!_0x4fccc7){_0x2288c6[_0xdae2('0x16')](0x194);}return _0x4fccc7;};}function handleError(_0x28c94d,_0x4abea2){_0x4abea2=_0x4abea2||0x1f4;return function(_0x167992){logger[_0xdae2('0x21')](_0x167992['stack']);if(_0x167992['name']){delete _0x167992[_0xdae2('0x22')];}_0x28c94d['status'](_0x4abea2)['send'](_0x167992);};}exports[_0xdae2('0x23')]=function(_0x5d4c5a,_0x285366){var _0xb161ef={},_0x4dd508={},_0x4544aa={'count':0x0,'rows':[]};var _0x533c9b=_[_0xdae2('0x24')](db[_0xdae2('0x25')][_0xdae2('0x26')],function(_0x4c406c){return{'name':_0x4c406c[_0xdae2('0x27')],'type':_0x4c406c[_0xdae2('0x28')][_0xdae2('0x29')]};});_0x4dd508[_0xdae2('0x2a')]=_[_0xdae2('0x24')](_0x533c9b,_0xdae2('0x22'));_0x4dd508['query']=_[_0xdae2('0x2b')](_0x5d4c5a['query']);_0x4dd508[_0xdae2('0x2c')]=_['intersection'](_0x4dd508[_0xdae2('0x2a')],_0x4dd508[_0xdae2('0x2d')]);_0xb161ef[_0xdae2('0x2e')]=_[_0xdae2('0x2f')](_0x4dd508[_0xdae2('0x2a')],qs[_0xdae2('0x30')](_0x5d4c5a[_0xdae2('0x2d')][_0xdae2('0x30')]));_0xb161ef[_0xdae2('0x2e')]=_0xb161ef[_0xdae2('0x2e')]['length']?_0xb161ef[_0xdae2('0x2e')]:_0x4dd508['model'];if(!_0x5d4c5a[_0xdae2('0x2d')][_0xdae2('0x31')](_0xdae2('0x32'))){_0xb161ef[_0xdae2('0x1b')]=qs[_0xdae2('0x1b')](_0x5d4c5a[_0xdae2('0x2d')][_0xdae2('0x1b')]);_0xb161ef[_0xdae2('0x19')]=qs['offset'](_0x5d4c5a['query'][_0xdae2('0x19')]);}_0xb161ef[_0xdae2('0x33')]=qs[_0xdae2('0x34')](_0x5d4c5a[_0xdae2('0x2d')][_0xdae2('0x34')]);_0xb161ef[_0xdae2('0x35')]=qs['filters'](_[_0xdae2('0x36')](_0x5d4c5a[_0xdae2('0x2d')],_0x4dd508[_0xdae2('0x2c')]),_0x533c9b);if(_0x5d4c5a['query'][_0xdae2('0x37')]){_0xb161ef[_0xdae2('0x35')]=_[_0xdae2('0x38')](_0xb161ef[_0xdae2('0x35')],{'$or':_[_0xdae2('0x24')](_0x533c9b,function(_0x57ae7a){if(_0x57ae7a[_0xdae2('0x28')]!==_0xdae2('0x39')){var _0x50d157={};_0x50d157[_0x57ae7a[_0xdae2('0x22')]]={'$like':'%'+_0x5d4c5a['query'][_0xdae2('0x37')]+'%'};return _0x50d157;}})});}_0xb161ef=_[_0xdae2('0x38')]({},_0xb161ef,_0x5d4c5a['options']);var _0x3802b9={'where':_0xb161ef[_0xdae2('0x35')]};return db[_0xdae2('0x25')][_0xdae2('0x3a')](_0x3802b9)['then'](function(_0x5c94c5){_0x4544aa[_0xdae2('0x3a')]=_0x5c94c5;if(_0x5d4c5a['query'][_0xdae2('0x3b')]){_0xb161ef['include']=[{'all':!![]}];}return db[_0xdae2('0x25')][_0xdae2('0x3c')](_0xb161ef);})[_0xdae2('0x1f')](function(_0x4723ba){_0x4544aa[_0xdae2('0x3d')]=_0x4723ba;return _0x4544aa;})[_0xdae2('0x1f')](respondWithFilteredResult(_0x285366,_0xb161ef))[_0xdae2('0x3e')](handleError(_0x285366,null));};exports[_0xdae2('0x3f')]=function(_0x46df83,_0x4a8710){var _0x5c8c83={'raw':![],'where':{'id':_0x46df83[_0xdae2('0x40')]['id']}},_0x396477={};_0x396477['model']=_[_0xdae2('0x2b')](db['SalesforceAccount'][_0xdae2('0x26')]);_0x396477[_0xdae2('0x2d')]=_[_0xdae2('0x2b')](_0x46df83[_0xdae2('0x2d')]);_0x396477[_0xdae2('0x2c')]=_[_0xdae2('0x2f')](_0x396477[_0xdae2('0x2a')],_0x396477['query']);_0x5c8c83[_0xdae2('0x2e')]=_['intersection'](_0x396477[_0xdae2('0x2a')],qs[_0xdae2('0x30')](_0x46df83[_0xdae2('0x2d')][_0xdae2('0x30')]));_0x5c8c83['attributes']=_0x5c8c83[_0xdae2('0x2e')][_0xdae2('0x41')]?_0x5c8c83['attributes']:_0x396477[_0xdae2('0x2a')];if(_0x46df83[_0xdae2('0x2d')]['includeAll']){_0x5c8c83[_0xdae2('0x42')]=[{'all':!![]}];}_0x5c8c83=_['merge']({},_0x5c8c83,_0x46df83[_0xdae2('0x43')]);return db['SalesforceAccount'][_0xdae2('0x44')](_0x5c8c83)[_0xdae2('0x1f')](handleEntityNotFound(_0x4a8710,null))[_0xdae2('0x1f')](respondWithResult(_0x4a8710,null))['catch'](handleError(_0x4a8710,null));};exports[_0xdae2('0x45')]=function(_0x1103d8,_0x3388ea){return db[_0xdae2('0x25')][_0xdae2('0x45')](_0x1103d8[_0xdae2('0x46')],{})[_0xdae2('0x1f')](respondWithResult(_0x3388ea,0xc9))[_0xdae2('0x3e')](handleError(_0x3388ea,null));};exports[_0xdae2('0x1e')]=function(_0x15e36f,_0x195410){if(_0x15e36f[_0xdae2('0x46')]['id']){delete _0x15e36f[_0xdae2('0x46')]['id'];}return db[_0xdae2('0x25')][_0xdae2('0x44')]({'where':{'id':_0x15e36f[_0xdae2('0x40')]['id']}})[_0xdae2('0x1f')](handleEntityNotFound(_0x195410,null))['then'](saveUpdates(_0x15e36f[_0xdae2('0x46')],null))[_0xdae2('0x1f')](respondWithResult(_0x195410,null))[_0xdae2('0x3e')](handleError(_0x195410,null));};exports['destroy']=function(_0x4da884,_0x1de8b2){return db[_0xdae2('0x25')][_0xdae2('0x44')]({'where':{'id':_0x4da884[_0xdae2('0x40')]['id']}})[_0xdae2('0x1f')](handleEntityNotFound(_0x1de8b2,null))['then'](removeEntity(_0x1de8b2,null))[_0xdae2('0x3e')](handleError(_0x1de8b2,null));};exports[_0xdae2('0x47')]=function(_0x17783d,_0x355e1f,_0x404910){var _0x362cf9={};var _0x591b4c={};var _0x35af53;var _0xa55a43;return db[_0xdae2('0x25')][_0xdae2('0x48')]({'where':{'id':_0x17783d[_0xdae2('0x40')]['id']}})['then'](handleEntityNotFound(_0x355e1f,null))[_0xdae2('0x1f')](function(_0x26ad5b){if(_0x26ad5b){_0x35af53=_0x26ad5b;_0x591b4c[_0xdae2('0x2a')]=_[_0xdae2('0x2b')](db[_0xdae2('0x49')][_0xdae2('0x26')]);_0x591b4c[_0xdae2('0x2d')]=_[_0xdae2('0x2b')](_0x17783d[_0xdae2('0x2d')]);_0x591b4c['filters']=_[_0xdae2('0x2f')](_0x591b4c[_0xdae2('0x2a')],_0x591b4c['query']);_0x362cf9[_0xdae2('0x2e')]=_[_0xdae2('0x2f')](_0x591b4c[_0xdae2('0x2a')],qs[_0xdae2('0x30')](_0x17783d['query'][_0xdae2('0x30')]));_0x362cf9[_0xdae2('0x2e')]=_0x362cf9[_0xdae2('0x2e')][_0xdae2('0x41')]?_0x362cf9[_0xdae2('0x2e')]:_0x591b4c[_0xdae2('0x2a')];_0x362cf9[_0xdae2('0x33')]=qs['sort'](_0x17783d['query']['sort']);_0x362cf9[_0xdae2('0x35')]=qs['filters'](_['pick'](_0x17783d['query'],_0x591b4c[_0xdae2('0x2c')]));if(_0x17783d[_0xdae2('0x2d')][_0xdae2('0x37')]){_0x362cf9['where']=_['merge'](_0x362cf9['where'],{'$or':_[_0xdae2('0x24')](_0x362cf9[_0xdae2('0x2e')],function(_0xd1fd70){var _0x21efd5={};_0x21efd5[_0xd1fd70]={'$like':'%'+_0x17783d[_0xdae2('0x2d')][_0xdae2('0x37')]+'%'};return _0x21efd5;})});}_0x362cf9=_[_0xdae2('0x38')]({},_0x362cf9,_0x17783d['options']);return _0x35af53[_0xdae2('0x47')](_0x362cf9);}})[_0xdae2('0x1f')](function(_0x1ca447){if(_0x1ca447){_0xa55a43=_0x1ca447['length'];if(!_0x17783d[_0xdae2('0x2d')][_0xdae2('0x31')](_0xdae2('0x32'))){_0x362cf9[_0xdae2('0x1b')]=qs[_0xdae2('0x1b')](_0x17783d[_0xdae2('0x2d')]['limit']);_0x362cf9['offset']=qs['offset'](_0x17783d[_0xdae2('0x2d')][_0xdae2('0x19')]);}return _0x35af53[_0xdae2('0x47')](_0x362cf9);}})[_0xdae2('0x1f')](function(_0x3e3a46){if(_0x3e3a46){return _0x3e3a46?{'count':_0xa55a43,'rows':_0x3e3a46}:null;}})[_0xdae2('0x1f')](respondWithResult(_0x355e1f,null))[_0xdae2('0x3e')](handleError(_0x355e1f,null));};exports[_0xdae2('0x4a')]=function(_0x1764e4,_0x598baa,_0x487105){if(_0x1764e4[_0xdae2('0x46')]['id']){delete _0x1764e4[_0xdae2('0x46')]['id'];}return db['SalesforceAccount'][_0xdae2('0x48')]({'where':{'id':_0x1764e4[_0xdae2('0x40')]['id']}})[_0xdae2('0x1f')](handleEntityNotFound(_0x598baa,null))[_0xdae2('0x1f')](function(_0x22b6ef){if(_0x22b6ef){_0x1764e4['body'][_0xdae2('0x4b')]=_0x22b6ef['id'];_0x1764e4[_0xdae2('0x46')][_0xdae2('0x4c')]=integrations['getSubjects'](_0x1764e4['body'][_0xdae2('0x4d')],_0x1764e4[_0xdae2('0x46')][_0xdae2('0x28')]);_0x1764e4[_0xdae2('0x46')][_0xdae2('0x4e')]=integrations['getDescriptions'](_0x1764e4[_0xdae2('0x46')][_0xdae2('0x4d')],_0x1764e4[_0xdae2('0x46')][_0xdae2('0x28')]);return db['SalesforceConfiguration'][_0xdae2('0x45')](_0x1764e4['body'],{'include':[{'model':db[_0xdae2('0x4f')],'as':'Subjects'},{'model':db[_0xdae2('0x4f')],'as':_0xdae2('0x4e')}]});}return null;})[_0xdae2('0x1f')](respondWithResult(_0x598baa,null))[_0xdae2('0x3e')](handleError(_0x598baa,null));};exports[_0xdae2('0x50')]=function(_0x58a875,_0x5e76d2,_0x324c7f){var _0x4ef543;var _0x575b05='';var _0x57e5bb=_0xdae2('0x51');return db[_0xdae2('0x25')][_0xdae2('0x48')]({'where':{'id':_0x58a875[_0xdae2('0x40')]['id']},'attributes':['id',_0xdae2('0x52'),_0xdae2('0x53'),_0xdae2('0x54'),'username',_0xdae2('0x55'),_0xdae2('0x56')]})[_0xdae2('0x1f')](handleEntityNotFound(_0x5e76d2,null))[_0xdae2('0x1f')](function(_0x2fff17){if(_0x2fff17){_0x575b05=_0x2fff17[_0xdae2('0x52')];var _0x5e9b95=_0x575b05[_0xdae2('0x57')](-0x1);if(_0x5e9b95==='/'){_0x575b05=_0x575b05[_0xdae2('0x58')](0x0,_0x575b05[_0xdae2('0x59')](_0x5e9b95));}_0x4ef543=new jsforce['Connection']({'oauth2':{'loginUrl':_0x575b05,'clientId':_0x2fff17['clientId'],'clientSecret':_0x2fff17['clientSecret']}});return _0x4ef543[_0xdae2('0x5a')](_0x2fff17[_0xdae2('0x5b')],_0x2fff17[_0xdae2('0x55')][_0xdae2('0x5c')](_0x2fff17[_0xdae2('0x56')]));}})[_0xdae2('0x1f')](function(_0x300e9f){if(_0x300e9f){if(!_[_0xdae2('0x5d')](_0x58a875[_0xdae2('0x2d')][_0xdae2('0x5e')])){_0x57e5bb=_0x58a875['query'][_0xdae2('0x5e')];}return _0x4ef543[_0xdae2('0x5f')](_0x57e5bb)['describe']();}})[_0xdae2('0x1f')](function(_0x432f79){var _0xda490a=[_0xdae2('0x60'),_0xdae2('0x61'),_0xdae2('0x62'),_0xdae2('0x63'),_0xdae2('0x64'),_0xdae2('0x65')];var _0x20c5ed=[_0xdae2('0x66'),_0xdae2('0x67'),'picklist',_0xdae2('0x68'),_0xdae2('0x69'),_0xdae2('0x6a'),_0xdae2('0x6b')];if(_0x432f79){_[_0xdae2('0x6c')](_0x432f79[_0xdae2('0x30')],function(_0x3c9690){return _0xda490a['includes'](_0x3c9690[_0xdae2('0x22')])||!_0x20c5ed[_0xdae2('0x6d')](_0x3c9690[_0xdae2('0x28')]);});return{'count':_0x432f79[_0xdae2('0x30')][_0xdae2('0x41')],'rows':_[_0xdae2('0x24')](_0x432f79[_0xdae2('0x30')],function(_0x374fee){return{'id':_0x374fee[_0xdae2('0x22')],'name':_0x374fee['label'],'custom':_0x374fee[_0xdae2('0x6e')],'options':_0x374fee[_0xdae2('0x6f')][_0xdae2('0x41')]>0x0?_[_0xdae2('0x24')](_0x374fee['picklistValues'],function(_0x20ad02){return{'name':_0x20ad02['label'],'value':_0x20ad02[_0xdae2('0x70')]};}):_0x374fee[_0xdae2('0x28')]==_0xdae2('0x68')?[{'name':_0xdae2('0x71'),'value':_0xdae2('0x72')},{'name':_0xdae2('0x73'),'value':'false'}]:[]};})};}})[_0xdae2('0x1f')](respondWithResult(_0x5e76d2,null))[_0xdae2('0x3e')](function(_0x4e98fd){var _0x33b7b3=_0x58a875[_0xdae2('0x2d')][_0xdae2('0x74')]?0x1f4:_0x4e98fd[_0xdae2('0x75')]||0x1f4;logger[_0xdae2('0x21')](_0xdae2('0x76'),'getFields',_0x33b7b3,JSON[_0xdae2('0x77')](_0x4e98fd));delete _0x4e98fd[_0xdae2('0x22')];if(_0x33b7b3===0x191){_0x33b7b3=0x190;}_0x5e76d2['status'](_0x33b7b3)[_0xdae2('0x78')](_0x58a875[_0xdae2('0x2d')][_0xdae2('0x74')]?{'message':_0xdae2('0x79'),'statusCode':_0x4e98fd[_0xdae2('0x75')]}:_0x4e98fd);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index f6b99a6..8d84c44 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 _0x52d2=['../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x52d2,0x13e));var _0x252d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x52d2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x252d('0x0'));var util=require(_0x252d('0x1'));var logger=require(_0x252d('0x2'))(_0x252d('0x3'));var moment=require(_0x252d('0x4'));var BPromise=require(_0x252d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x252d('0x6'));var rimraf=require('rimraf');var config=require(_0x252d('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x252d('0x8'));module[_0x252d('0x9')]=function(_0x148fe5,_0x3f1dd8){return _0x148fe5[_0x252d('0xa')](_0x252d('0xb'),attributes,{'tableName':_0x252d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea1a=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xea1a,0x158));var _0xaea1=function(_0x675db4,_0x4120d0){_0x675db4=_0x675db4-0x0;var _0x11c8bb=_0xea1a[_0x675db4];return _0x11c8bb;};'use strict';var _=require(_0xaea1('0x0'));var util=require(_0xaea1('0x1'));var logger=require(_0xaea1('0x2'))(_0xaea1('0x3'));var moment=require('moment');var BPromise=require(_0xaea1('0x4'));var rp=require(_0xaea1('0x5'));var fs=require('fs');var path=require(_0xaea1('0x6'));var rimraf=require(_0xaea1('0x7'));var config=require(_0xaea1('0x8'));var attributes=require(_0xaea1('0x9'));var integrations=require(_0xaea1('0xa'));module[_0xaea1('0xb')]=function(_0x5208c7,_0x884233){return _0x5208c7[_0xaea1('0xc')](_0xaea1('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index c486b71..f85f3ad 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 _0x058b=['moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','options','raw','attributes','limit','include','map','model','catch','ShowSalesforceAccount','find','where','lodash','util'];(function(_0x3bc0f8,_0x5e0007){var _0x200206=function(_0x4c49ba){while(--_0x4c49ba){_0x3bc0f8['push'](_0x3bc0f8['shift']());}};_0x200206(++_0x5e0007);}(_0x058b,0x148));var _0xb058=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x058b[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0xb058('0x0'));var util=require(_0xb058('0x1'));var moment=require(_0xb058('0x2'));var BPromise=require(_0xb058('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb058('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb058('0x5'))('rpc');var config=require(_0xb058('0x6'));var jayson=require(_0xb058('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7254,_0x4dd6a3,_0x2fbe87){return new BPromise(function(_0x34acd8,_0x2b3523){return client[_0xb058('0x8')](_0x4f7254,_0x2fbe87)[_0xb058('0x9')](function(_0xd3a64){logger[_0xb058('0xa')](_0xb058('0xb'),_0x4dd6a3,_0xb058('0xc'));logger[_0xb058('0xd')](_0xb058('0xe'),_0x4dd6a3,_0xb058('0xc'),JSON[_0xb058('0xf')](_0xd3a64));if(_0xd3a64[_0xb058('0x10')]){if(_0xd3a64[_0xb058('0x10')][_0xb058('0x11')]===0x1f4){logger[_0xb058('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4dd6a3,_0xd3a64[_0xb058('0x10')][_0xb058('0x12')]);return _0x2b3523(_0xd3a64['error'][_0xb058('0x12')]);}logger['error'](_0xb058('0xb'),_0x4dd6a3,_0xd3a64['error'][_0xb058('0x12')]);return _0x34acd8(_0xd3a64['error'][_0xb058('0x12')]);}else{logger[_0xb058('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x4dd6a3,_0xb058('0xc'));_0x34acd8(_0xd3a64[_0xb058('0x13')][_0xb058('0x12')]);}})['catch'](function(_0x2f7fbc){logger[_0xb058('0x10')](_0xb058('0xb'),_0x4dd6a3,_0x2f7fbc);_0x2b3523(_0x2f7fbc);});});}exports[_0xb058('0x14')]=function(_0x2b6721){var _0x58d61e=this;return new Promise(function(_0x1220e3,_0x43439d){return db[_0xb058('0x15')]['findAll']({'raw':_0x2b6721[_0xb058('0x16')]?_0x2b6721[_0xb058('0x16')][_0xb058('0x17')]===undefined?!![]:![]:!![],'where':_0x2b6721[_0xb058('0x16')]?_0x2b6721[_0xb058('0x16')]['where']||null:null,'attributes':_0x2b6721[_0xb058('0x16')]?_0x2b6721[_0xb058('0x16')][_0xb058('0x18')]||null:null,'limit':_0x2b6721[_0xb058('0x16')]?_0x2b6721[_0xb058('0x16')][_0xb058('0x19')]||null:null,'include':_0x2b6721[_0xb058('0x16')]?_0x2b6721[_0xb058('0x16')][_0xb058('0x1a')]?_[_0xb058('0x1b')](_0x2b6721[_0xb058('0x16')][_0xb058('0x1a')],function(_0xe652bd){return{'model':db[_0xe652bd[_0xb058('0x1c')]],'as':_0xe652bd['as'],'attributes':_0xe652bd[_0xb058('0x18')],'include':_0xe652bd[_0xb058('0x1a')]?_[_0xb058('0x1b')](_0xe652bd['include'],function(_0x17a673){return{'model':db[_0x17a673[_0xb058('0x1c')]],'as':_0x17a673['as'],'attributes':_0x17a673[_0xb058('0x18')],'include':_0x17a673[_0xb058('0x1a')]?_[_0xb058('0x1b')](_0x17a673[_0xb058('0x1a')],function(_0x5ce43e){return{'model':db[_0x5ce43e[_0xb058('0x1c')]],'as':_0x5ce43e['as'],'attributes':_0x5ce43e[_0xb058('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb058('0x9')](function(_0x5f0bee){logger[_0xb058('0xa')](_0xb058('0x14'),_0x2b6721);logger['debug'](_0xb058('0x14'),_0x2b6721,JSON[_0xb058('0xf')](_0x5f0bee));_0x1220e3(_0x5f0bee);})[_0xb058('0x1d')](function(_0x1bf0a7){logger[_0xb058('0x10')](_0xb058('0x14'),_0x1bf0a7[_0xb058('0x12')],_0x2b6721);_0x43439d(_0x58d61e[_0xb058('0x10')](0x1f4,_0x1bf0a7[_0xb058('0x12')]));});});};exports[_0xb058('0x1e')]=function(_0x4544f3){var _0x531831=this;return new Promise(function(_0x4afd09,_0x358761){return db[_0xb058('0x15')][_0xb058('0x1f')]({'raw':_0x4544f3[_0xb058('0x16')]?_0x4544f3[_0xb058('0x16')][_0xb058('0x17')]===undefined?!![]:![]:!![],'where':_0x4544f3[_0xb058('0x16')]?_0x4544f3[_0xb058('0x16')][_0xb058('0x20')]||null:null,'attributes':_0x4544f3[_0xb058('0x16')]?_0x4544f3[_0xb058('0x16')][_0xb058('0x18')]||null:null,'include':_0x4544f3[_0xb058('0x16')]?_0x4544f3['options'][_0xb058('0x1a')]?_[_0xb058('0x1b')](_0x4544f3[_0xb058('0x16')][_0xb058('0x1a')],function(_0x5c6d48){return{'model':db[_0x5c6d48['model']],'as':_0x5c6d48['as'],'attributes':_0x5c6d48['attributes'],'include':_0x5c6d48[_0xb058('0x1a')]?_[_0xb058('0x1b')](_0x5c6d48['include'],function(_0x8d63e2){return{'model':db[_0x8d63e2[_0xb058('0x1c')]],'as':_0x8d63e2['as'],'attributes':_0x8d63e2['attributes'],'include':_0x8d63e2['include']?_['map'](_0x8d63e2['include'],function(_0x38e1ee){return{'model':db[_0x38e1ee['model']],'as':_0x38e1ee['as'],'attributes':_0x38e1ee[_0xb058('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb058('0x9')](function(_0xce1fd4){logger[_0xb058('0xa')](_0xb058('0x1e'),_0x4544f3);logger[_0xb058('0xd')](_0xb058('0x1e'),_0x4544f3,JSON['stringify'](_0xce1fd4));_0x4afd09(_0xce1fd4);})[_0xb058('0x1d')](function(_0x2651aa){logger[_0xb058('0x10')](_0xb058('0x1e'),_0x2651aa[_0xb058('0x12')],_0x4544f3);_0x358761(_0x531831['error'](0x1f4,_0x2651aa[_0xb058('0x12')]));});});}; \ No newline at end of file +var _0x7782=['GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowSalesforceAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x6d5d2b,_0x71ca8d){var _0xd9aeb2=function(_0x364949){while(--_0x364949){_0x6d5d2b['push'](_0x6d5d2b['shift']());}};_0xd9aeb2(++_0x71ca8d);}(_0x7782,0x134));var _0x2778=function(_0x3fd8ef,_0x342f77){_0x3fd8ef=_0x3fd8ef-0x0;var _0x400b8b=_0x7782[_0x3fd8ef];return _0x400b8b;};'use strict';var _=require(_0x2778('0x0'));var util=require(_0x2778('0x1'));var moment=require(_0x2778('0x2'));var BPromise=require(_0x2778('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2778('0x4'));var db=require(_0x2778('0x5'))['db'];var utils=require(_0x2778('0x6'));var logger=require(_0x2778('0x7'))(_0x2778('0x8'));var config=require(_0x2778('0x9'));var jayson=require(_0x2778('0xa'));var client=jayson[_0x2778('0xb')][_0x2778('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52c63d,_0x102b84,_0x17e472){return new BPromise(function(_0x255141,_0x25a748){return client['request'](_0x52c63d,_0x17e472)[_0x2778('0xd')](function(_0x74b9d1){logger[_0x2778('0xe')](_0x2778('0xf'),_0x102b84,'request\x20sent');logger[_0x2778('0x10')](_0x2778('0x11'),_0x102b84,_0x2778('0x12'),JSON[_0x2778('0x13')](_0x74b9d1));if(_0x74b9d1[_0x2778('0x14')]){if(_0x74b9d1[_0x2778('0x14')][_0x2778('0x15')]===0x1f4){logger['error'](_0x2778('0xf'),_0x102b84,_0x74b9d1['error'][_0x2778('0x16')]);return _0x25a748(_0x74b9d1[_0x2778('0x14')][_0x2778('0x16')]);}logger[_0x2778('0x14')](_0x2778('0xf'),_0x102b84,_0x74b9d1['error'][_0x2778('0x16')]);return _0x255141(_0x74b9d1[_0x2778('0x14')][_0x2778('0x16')]);}else{logger[_0x2778('0xe')](_0x2778('0xf'),_0x102b84,'request\x20sent');_0x255141(_0x74b9d1[_0x2778('0x17')][_0x2778('0x16')]);}})[_0x2778('0x18')](function(_0x54b9ed){logger[_0x2778('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x102b84,_0x54b9ed);_0x25a748(_0x54b9ed);});});}exports[_0x2778('0x19')]=function(_0x56d59a){var _0x3685c9=this;return new Promise(function(_0x25edac,_0x1549ef){return db['SalesforceAccount'][_0x2778('0x1a')]({'raw':_0x56d59a[_0x2778('0x1b')]?_0x56d59a[_0x2778('0x1b')][_0x2778('0x1c')]===undefined?!![]:![]:!![],'where':_0x56d59a[_0x2778('0x1b')]?_0x56d59a[_0x2778('0x1b')][_0x2778('0x1d')]||null:null,'attributes':_0x56d59a[_0x2778('0x1b')]?_0x56d59a[_0x2778('0x1b')][_0x2778('0x1e')]||null:null,'limit':_0x56d59a[_0x2778('0x1b')]?_0x56d59a[_0x2778('0x1b')][_0x2778('0x1f')]||null:null,'include':_0x56d59a['options']?_0x56d59a[_0x2778('0x1b')][_0x2778('0x20')]?_[_0x2778('0x21')](_0x56d59a['options'][_0x2778('0x20')],function(_0x4b2de5){return{'model':db[_0x4b2de5[_0x2778('0x22')]],'as':_0x4b2de5['as'],'attributes':_0x4b2de5[_0x2778('0x1e')],'include':_0x4b2de5[_0x2778('0x20')]?_[_0x2778('0x21')](_0x4b2de5[_0x2778('0x20')],function(_0x3da83f){return{'model':db[_0x3da83f[_0x2778('0x22')]],'as':_0x3da83f['as'],'attributes':_0x3da83f[_0x2778('0x1e')],'include':_0x3da83f[_0x2778('0x20')]?_[_0x2778('0x21')](_0x3da83f[_0x2778('0x20')],function(_0x9a1302){return{'model':db[_0x9a1302['model']],'as':_0x9a1302['as'],'attributes':_0x9a1302[_0x2778('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x576e91){logger[_0x2778('0xe')](_0x2778('0x19'),_0x56d59a);logger[_0x2778('0x10')](_0x2778('0x19'),_0x56d59a,JSON[_0x2778('0x13')](_0x576e91));_0x25edac(_0x576e91);})['catch'](function(_0x3c1cad){logger[_0x2778('0x14')](_0x2778('0x19'),_0x3c1cad[_0x2778('0x16')],_0x56d59a);_0x1549ef(_0x3685c9['error'](0x1f4,_0x3c1cad[_0x2778('0x16')]));});});};exports['ShowSalesforceAccount']=function(_0x11583e){var _0xc46a4d=this;return new Promise(function(_0x3e8f37,_0x173cd8){return db['SalesforceAccount'][_0x2778('0x23')]({'raw':_0x11583e[_0x2778('0x1b')]?_0x11583e[_0x2778('0x1b')][_0x2778('0x1c')]===undefined?!![]:![]:!![],'where':_0x11583e[_0x2778('0x1b')]?_0x11583e[_0x2778('0x1b')][_0x2778('0x1d')]||null:null,'attributes':_0x11583e[_0x2778('0x1b')]?_0x11583e[_0x2778('0x1b')][_0x2778('0x1e')]||null:null,'include':_0x11583e[_0x2778('0x1b')]?_0x11583e[_0x2778('0x1b')]['include']?_['map'](_0x11583e['options']['include'],function(_0x5542e5){return{'model':db[_0x5542e5['model']],'as':_0x5542e5['as'],'attributes':_0x5542e5[_0x2778('0x1e')],'include':_0x5542e5['include']?_[_0x2778('0x21')](_0x5542e5['include'],function(_0x2018f4){return{'model':db[_0x2018f4[_0x2778('0x22')]],'as':_0x2018f4['as'],'attributes':_0x2018f4[_0x2778('0x1e')],'include':_0x2018f4[_0x2778('0x20')]?_[_0x2778('0x21')](_0x2018f4[_0x2778('0x20')],function(_0x195f82){return{'model':db[_0x195f82[_0x2778('0x22')]],'as':_0x195f82['as'],'attributes':_0x195f82[_0x2778('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa58655){logger['info'](_0x2778('0x24'),_0x11583e);logger[_0x2778('0x10')](_0x2778('0x24'),_0x11583e,JSON[_0x2778('0x13')](_0xa58655));_0x3e8f37(_0xa58655);})[_0x2778('0x18')](function(_0xa371c9){logger['error']('ShowSalesforceAccount',_0xa371c9[_0x2778('0x16')],_0x11583e);_0x173cd8(_0xc46a4d[_0x2778('0x14')](0x1f4,_0xa371c9[_0x2778('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2601688..762b6a8 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x58634f,_0x3096e7){var _0x3372c7=function(_0x945fc8){while(--_0x945fc8){_0x58634f['push'](_0x58634f['shift']());}};_0x3372c7(++_0x3096e7);}(_0x7a54,0x106));var _0x47a5=function(_0x5a5dc7,_0x3e0d70){_0x5a5dc7=_0x5a5dc7-0x0;var _0x1a6d4d=_0x7a54[_0x5a5dc7];return _0x1a6d4d;};'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('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x0b0e[_0x58c20f];return _0x3b0318;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 48e2f29..e5c72fd 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 _0x6f71=['contact_lead','contact','lead','account_contact_lead','account','nothing','exports','STRING','ENUM','Case'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x6f71,0x1aa));var _0x16f7=function(_0x2379d3,_0x1941a5){_0x2379d3=_0x2379d3-0x0;var _0x42a663=_0x6f71[_0x2379d3];return _0x42a663;};'use strict';var Sequelize=require('sequelize');module[_0x16f7('0x0')]={'name':{'type':Sequelize[_0x16f7('0x1')]},'description':{'type':Sequelize[_0x16f7('0x1')]},'ticketType':{'type':Sequelize[_0x16f7('0x2')]('Task',_0x16f7('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x16f7('0x4'),_0x16f7('0x5'),_0x16f7('0x6'),_0x16f7('0x7'),_0x16f7('0x8')),'defaultValue':_0x16f7('0x4')},'moduleCreate':{'type':Sequelize[_0x16f7('0x2')](_0x16f7('0x9'),'contact',_0x16f7('0x6'),_0x16f7('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x16f7('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x16f7('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x16f7('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2905=['lead','account','nothing','sequelize','STRING','ENUM','Task','contact_lead','contact'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2905,0x1e9));var _0x5290=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2905[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5290('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5290('0x1')]},'ticketType':{'type':Sequelize[_0x5290('0x2')]('Task','Case'),'defaultValue':_0x5290('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5290('0x4'),_0x5290('0x5'),_0x5290('0x6'),'account_contact_lead',_0x5290('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x5290('0x2')](_0x5290('0x8'),_0x5290('0x5'),_0x5290('0x6'),_0x5290('0x7')),'defaultValue':_0x5290('0x6')},'leadId':{'type':Sequelize[_0x5290('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x5290('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index caf0c4b..25a6387 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 _0x5549=['length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','catch','create','body','update','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields'];(function(_0x1c6efd,_0xb2f3cd){var _0x53a918=function(_0x14c19b){while(--_0x14c19b){_0x1c6efd['push'](_0x1c6efd['shift']());}};_0x53a918(++_0xb2f3cd);}(_0x5549,0x1f4));var _0x9554=function(_0x579168,_0x2b0ffb){_0x579168=_0x579168-0x0;var _0x3e19cf=_0x5549[_0x579168];return _0x3e19cf;};'use strict';var emlformat=require(_0x9554('0x0'));var rimraf=require(_0x9554('0x1'));var zipdir=require(_0x9554('0x2'));var jsonpatch=require(_0x9554('0x3'));var rp=require(_0x9554('0x4'));var moment=require('moment');var BPromise=require(_0x9554('0x5'));var Mustache=require(_0x9554('0x6'));var util=require(_0x9554('0x7'));var path=require(_0x9554('0x8'));var sox=require(_0x9554('0x9'));var csv=require('to-csv');var ejs=require(_0x9554('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9554('0xb'));var squel=require(_0x9554('0xc'));var crypto=require(_0x9554('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9554('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9554('0xf'));var Redis=require('ioredis');var authService=require(_0x9554('0x10'));var qs=require(_0x9554('0x11'));var as=require(_0x9554('0x12'));var hardwareService=require(_0x9554('0x13'));var logger=require(_0x9554('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9554('0x15'));var licenseUtil=require(_0x9554('0x16'));var db=require(_0x9554('0x17'))['db'];function respondWithStatusCode(_0x582d34,_0x2ba34a){_0x2ba34a=_0x2ba34a||0xcc;return function(_0x34b0f5){if(_0x34b0f5){return _0x582d34[_0x9554('0x18')](_0x2ba34a);}return _0x582d34['status'](_0x2ba34a)[_0x9554('0x19')]();};}function respondWithResult(_0x2228ae,_0x50d879){_0x50d879=_0x50d879||0xc8;return function(_0x2b9f7c){if(_0x2b9f7c){return _0x2228ae[_0x9554('0x1a')](_0x50d879)[_0x9554('0x1b')](_0x2b9f7c);}};}function respondWithFilteredResult(_0x849437,_0x4a1a20){return function(_0x1a2694){if(_0x1a2694){var _0x37003a=typeof _0x4a1a20[_0x9554('0x1c')]==='undefined'&&typeof _0x4a1a20[_0x9554('0x1d')]==='undefined';var _0x18811c=_0x1a2694[_0x9554('0x1e')];var _0x5de328=_0x37003a?0x0:_0x4a1a20[_0x9554('0x1c')];var _0x107584=_0x37003a?_0x1a2694[_0x9554('0x1e')]:_0x4a1a20[_0x9554('0x1c')]+_0x4a1a20[_0x9554('0x1d')];var _0x43e013;if(_0x107584>=_0x18811c){_0x107584=_0x18811c;_0x43e013=0xc8;}else{_0x43e013=0xce;}_0x849437[_0x9554('0x1a')](_0x43e013);return _0x849437['set'](_0x9554('0x1f'),_0x5de328+'-'+_0x107584+'/'+_0x18811c)[_0x9554('0x1b')](_0x1a2694);}return null;};}function patchUpdates(_0x938c91){return function(_0x3909a9){try{jsonpatch[_0x9554('0x20')](_0x3909a9,_0x938c91,!![]);}catch(_0x1efa6c){return BPromise[_0x9554('0x21')](_0x1efa6c);}return _0x3909a9[_0x9554('0x22')]();};}function saveUpdates(_0x85e5a5,_0x49d8e0){return function(_0x7abc7e){if(_0x7abc7e){return _0x7abc7e['update'](_0x85e5a5)[_0x9554('0x23')](function(_0x1755d3){return _0x1755d3;});}return null;};}function removeEntity(_0x4c08f9,_0x48576d){return function(_0x3fb762){if(_0x3fb762){return _0x3fb762[_0x9554('0x24')]()[_0x9554('0x23')](function(){_0x4c08f9[_0x9554('0x1a')](0xcc)[_0x9554('0x19')]();});}};}function handleEntityNotFound(_0x4356b9,_0xdfb500){return function(_0x16d54e){if(!_0x16d54e){_0x4356b9[_0x9554('0x18')](0x194);}return _0x16d54e;};}function handleError(_0x86044c,_0x5e94cd){_0x5e94cd=_0x5e94cd||0x1f4;return function(_0x13310b){logger[_0x9554('0x25')](_0x13310b[_0x9554('0x26')]);if(_0x13310b['name']){delete _0x13310b['name'];}_0x86044c['status'](_0x5e94cd)['send'](_0x13310b);};}exports[_0x9554('0x27')]=function(_0x497c13,_0x286498){var _0xe4dbef={},_0x31a99c={},_0x41f50f={'count':0x0,'rows':[]};var _0x52946c=_[_0x9554('0x28')](db[_0x9554('0x29')][_0x9554('0x2a')],function(_0x14eb74){return{'name':_0x14eb74[_0x9554('0x2b')],'type':_0x14eb74[_0x9554('0x2c')]['key']};});_0x31a99c['model']=_[_0x9554('0x28')](_0x52946c,_0x9554('0x2d'));_0x31a99c[_0x9554('0x2e')]=_[_0x9554('0x2f')](_0x497c13[_0x9554('0x2e')]);_0x31a99c[_0x9554('0x30')]=_[_0x9554('0x31')](_0x31a99c[_0x9554('0x32')],_0x31a99c['query']);_0xe4dbef[_0x9554('0x33')]=_[_0x9554('0x31')](_0x31a99c[_0x9554('0x32')],qs['fields'](_0x497c13[_0x9554('0x2e')][_0x9554('0x34')]));_0xe4dbef['attributes']=_0xe4dbef[_0x9554('0x33')][_0x9554('0x35')]?_0xe4dbef['attributes']:_0x31a99c[_0x9554('0x32')];if(!_0x497c13['query'][_0x9554('0x36')](_0x9554('0x37'))){_0xe4dbef['limit']=qs[_0x9554('0x1d')](_0x497c13['query']['limit']);_0xe4dbef['offset']=qs['offset'](_0x497c13[_0x9554('0x2e')]['offset']);}_0xe4dbef[_0x9554('0x38')]=qs[_0x9554('0x39')](_0x497c13[_0x9554('0x2e')][_0x9554('0x39')]);_0xe4dbef['where']=qs['filters'](_['pick'](_0x497c13['query'],_0x31a99c[_0x9554('0x30')]),_0x52946c);if(_0x497c13[_0x9554('0x2e')][_0x9554('0x3a')]){_0xe4dbef[_0x9554('0x3b')]=_['merge'](_0xe4dbef[_0x9554('0x3b')],{'$or':_[_0x9554('0x28')](_0x52946c,function(_0x41adea){if(_0x41adea[_0x9554('0x2c')]!==_0x9554('0x3c')){var _0x1f38d0={};_0x1f38d0[_0x41adea['name']]={'$like':'%'+_0x497c13['query'][_0x9554('0x3a')]+'%'};return _0x1f38d0;}})});}_0xe4dbef=_[_0x9554('0x3d')]({},_0xe4dbef,_0x497c13[_0x9554('0x3e')]);var _0x577fe5={'where':_0xe4dbef[_0x9554('0x3b')]};return db[_0x9554('0x29')][_0x9554('0x1e')](_0x577fe5)[_0x9554('0x23')](function(_0x42eafe){_0x41f50f[_0x9554('0x1e')]=_0x42eafe;if(_0x497c13[_0x9554('0x2e')]['includeAll']){_0xe4dbef[_0x9554('0x3f')]=[{'all':!![]}];}return db[_0x9554('0x29')]['findAll'](_0xe4dbef);})[_0x9554('0x23')](function(_0x40bbbd){_0x41f50f[_0x9554('0x40')]=_0x40bbbd;return _0x41f50f;})[_0x9554('0x23')](respondWithFilteredResult(_0x286498,_0xe4dbef))['catch'](handleError(_0x286498,null));};exports[_0x9554('0x41')]=function(_0x3db4db,_0x3c7abc){var _0x4481a7={'raw':![],'where':{'id':_0x3db4db[_0x9554('0x42')]['id']}},_0x2e1e00={};_0x2e1e00[_0x9554('0x32')]=_[_0x9554('0x2f')](db[_0x9554('0x29')][_0x9554('0x2a')]);_0x2e1e00[_0x9554('0x2e')]=_['keys'](_0x3db4db['query']);_0x2e1e00['filters']=_[_0x9554('0x31')](_0x2e1e00['model'],_0x2e1e00[_0x9554('0x2e')]);_0x4481a7[_0x9554('0x33')]=_['intersection'](_0x2e1e00[_0x9554('0x32')],qs[_0x9554('0x34')](_0x3db4db[_0x9554('0x2e')]['fields']));_0x4481a7[_0x9554('0x33')]=_0x4481a7[_0x9554('0x33')][_0x9554('0x35')]?_0x4481a7[_0x9554('0x33')]:_0x2e1e00[_0x9554('0x32')];if(_0x3db4db[_0x9554('0x2e')][_0x9554('0x43')]){_0x4481a7[_0x9554('0x3f')]=[{'all':!![]}];}_0x4481a7=_[_0x9554('0x3d')]({},_0x4481a7,_0x3db4db[_0x9554('0x3e')]);return db['SalesforceConfiguration'][_0x9554('0x44')](_0x4481a7)[_0x9554('0x23')](handleEntityNotFound(_0x3c7abc,null))['then'](respondWithResult(_0x3c7abc,null))[_0x9554('0x45')](handleError(_0x3c7abc,null));};exports[_0x9554('0x46')]=function(_0x154c8f,_0x39d944){return db[_0x9554('0x29')][_0x9554('0x46')](_0x154c8f[_0x9554('0x47')],{})[_0x9554('0x23')](respondWithResult(_0x39d944,0xc9))[_0x9554('0x45')](handleError(_0x39d944,null));};exports[_0x9554('0x48')]=function(_0x377e22,_0x51ff51){if(_0x377e22['body']['id']){delete _0x377e22[_0x9554('0x47')]['id'];}return db[_0x9554('0x29')]['find']({'where':{'id':_0x377e22[_0x9554('0x42')]['id']}})['then'](handleEntityNotFound(_0x51ff51,null))[_0x9554('0x23')](saveUpdates(_0x377e22[_0x9554('0x47')],null))['then'](respondWithResult(_0x51ff51,null))['catch'](handleError(_0x51ff51,null));};exports['destroy']=function(_0x2cba8f,_0xa64dad){return db[_0x9554('0x29')]['find']({'where':{'id':_0x2cba8f[_0x9554('0x42')]['id']}})[_0x9554('0x23')](handleEntityNotFound(_0xa64dad,null))[_0x9554('0x23')](removeEntity(_0xa64dad,null))['catch'](handleError(_0xa64dad,null));};exports[_0x9554('0x49')]=function(_0x405f78,_0x1fbd29,_0x20b4a7){var _0x2704bb={};var _0x5e3bf9={};var _0x2b2290;var _0xd6ea9f;return db[_0x9554('0x29')][_0x9554('0x4a')]({'where':{'id':_0x405f78[_0x9554('0x42')]['id']}})[_0x9554('0x23')](handleEntityNotFound(_0x1fbd29,null))[_0x9554('0x23')](function(_0x1d7e77){if(_0x1d7e77){_0x2b2290=_0x1d7e77;_0x5e3bf9[_0x9554('0x32')]=_[_0x9554('0x2f')](db[_0x9554('0x4b')][_0x9554('0x2a')]);_0x5e3bf9[_0x9554('0x2e')]=_[_0x9554('0x2f')](_0x405f78[_0x9554('0x2e')]);_0x5e3bf9[_0x9554('0x30')]=_['intersection'](_0x5e3bf9[_0x9554('0x32')],_0x5e3bf9[_0x9554('0x2e')]);_0x2704bb[_0x9554('0x33')]=_[_0x9554('0x31')](_0x5e3bf9[_0x9554('0x32')],qs[_0x9554('0x34')](_0x405f78[_0x9554('0x2e')][_0x9554('0x34')]));_0x2704bb[_0x9554('0x33')]=_0x2704bb[_0x9554('0x33')][_0x9554('0x35')]?_0x2704bb[_0x9554('0x33')]:_0x5e3bf9[_0x9554('0x32')];_0x2704bb[_0x9554('0x38')]=qs[_0x9554('0x39')](_0x405f78[_0x9554('0x2e')][_0x9554('0x39')]);_0x2704bb[_0x9554('0x3b')]=qs[_0x9554('0x30')](_[_0x9554('0x4c')](_0x405f78[_0x9554('0x2e')],_0x5e3bf9[_0x9554('0x30')]));if(_0x405f78[_0x9554('0x2e')][_0x9554('0x3a')]){_0x2704bb[_0x9554('0x3b')]=_[_0x9554('0x3d')](_0x2704bb[_0x9554('0x3b')],{'$or':_[_0x9554('0x28')](_0x2704bb['attributes'],function(_0x125fb5){var _0x88f6ea={};_0x88f6ea[_0x125fb5]={'$like':'%'+_0x405f78[_0x9554('0x2e')][_0x9554('0x3a')]+'%'};return _0x88f6ea;})});}_0x2704bb=_[_0x9554('0x3d')]({},_0x2704bb,_0x405f78[_0x9554('0x3e')]);return _0x2b2290[_0x9554('0x49')](_0x2704bb);}})[_0x9554('0x23')](function(_0x3e6376){if(_0x3e6376){_0xd6ea9f=_0x3e6376['length'];if(!_0x405f78[_0x9554('0x2e')]['hasOwnProperty']('nolimit')){_0x2704bb[_0x9554('0x1d')]=qs[_0x9554('0x1d')](_0x405f78[_0x9554('0x2e')][_0x9554('0x1d')]);_0x2704bb[_0x9554('0x1c')]=qs['offset'](_0x405f78[_0x9554('0x2e')][_0x9554('0x1c')]);}return _0x2b2290[_0x9554('0x49')](_0x2704bb);}})[_0x9554('0x23')](function(_0x2d5b35){if(_0x2d5b35){return _0x2d5b35?{'count':_0xd6ea9f,'rows':_0x2d5b35}:null;}})['then'](respondWithResult(_0x1fbd29,null))[_0x9554('0x45')](handleError(_0x1fbd29,null));};exports[_0x9554('0x4d')]=function(_0x1e43eb,_0x4f2db5,_0x5b7c26){var _0x3025f5={};var _0x49161d={};var _0x2728a2;var _0x8ff4c1;return db[_0x9554('0x29')][_0x9554('0x4a')]({'where':{'id':_0x1e43eb[_0x9554('0x42')]['id']}})[_0x9554('0x23')](handleEntityNotFound(_0x4f2db5,null))[_0x9554('0x23')](function(_0x1543ad){if(_0x1543ad){_0x2728a2=_0x1543ad;_0x49161d[_0x9554('0x32')]=_['keys'](db[_0x9554('0x4b')][_0x9554('0x2a')]);_0x49161d[_0x9554('0x2e')]=_['keys'](_0x1e43eb['query']);_0x49161d[_0x9554('0x30')]=_[_0x9554('0x31')](_0x49161d[_0x9554('0x32')],_0x49161d[_0x9554('0x2e')]);_0x3025f5[_0x9554('0x33')]=_[_0x9554('0x31')](_0x49161d[_0x9554('0x32')],qs[_0x9554('0x34')](_0x1e43eb[_0x9554('0x2e')][_0x9554('0x34')]));_0x3025f5[_0x9554('0x33')]=_0x3025f5[_0x9554('0x33')]['length']?_0x3025f5['attributes']:_0x49161d[_0x9554('0x32')];_0x3025f5[_0x9554('0x38')]=qs[_0x9554('0x39')](_0x1e43eb['query']['sort']);_0x3025f5[_0x9554('0x3b')]=qs[_0x9554('0x30')](_[_0x9554('0x4c')](_0x1e43eb[_0x9554('0x2e')],_0x49161d[_0x9554('0x30')]));if(_0x1e43eb[_0x9554('0x2e')][_0x9554('0x3a')]){_0x3025f5[_0x9554('0x3b')]=_['merge'](_0x3025f5['where'],{'$or':_[_0x9554('0x28')](_0x3025f5[_0x9554('0x33')],function(_0x2ed3ae){var _0x394618={};_0x394618[_0x2ed3ae]={'$like':'%'+_0x1e43eb[_0x9554('0x2e')][_0x9554('0x3a')]+'%'};return _0x394618;})});}_0x3025f5=_[_0x9554('0x3d')]({},_0x3025f5,_0x1e43eb[_0x9554('0x3e')]);return _0x2728a2[_0x9554('0x4d')](_0x3025f5);}})[_0x9554('0x23')](function(_0x3ea928){if(_0x3ea928){_0x8ff4c1=_0x3ea928[_0x9554('0x35')];if(!_0x1e43eb['query'][_0x9554('0x36')]('nolimit')){_0x3025f5[_0x9554('0x1d')]=qs[_0x9554('0x1d')](_0x1e43eb[_0x9554('0x2e')][_0x9554('0x1d')]);_0x3025f5[_0x9554('0x1c')]=qs['offset'](_0x1e43eb[_0x9554('0x2e')][_0x9554('0x1c')]);}return _0x2728a2[_0x9554('0x4d')](_0x3025f5);}})['then'](function(_0x1892e9){if(_0x1892e9){return _0x1892e9?{'count':_0x8ff4c1,'rows':_0x1892e9}:null;}})[_0x9554('0x23')](respondWithResult(_0x4f2db5,null))[_0x9554('0x45')](handleError(_0x4f2db5,null));};exports[_0x9554('0x4e')]=function(_0x1e7366,_0x25a42d,_0x396f22){var _0x591878={};var _0x2d3e9b={};var _0x4ad14f;var _0x5aff0f;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1e7366[_0x9554('0x42')]['id']}})[_0x9554('0x23')](handleEntityNotFound(_0x25a42d,null))[_0x9554('0x23')](function(_0x576c70){if(_0x576c70){_0x4ad14f=_0x576c70;_0x2d3e9b[_0x9554('0x32')]=_['keys'](db[_0x9554('0x4b')][_0x9554('0x2a')]);_0x2d3e9b[_0x9554('0x2e')]=_[_0x9554('0x2f')](_0x1e7366[_0x9554('0x2e')]);_0x2d3e9b['filters']=_[_0x9554('0x31')](_0x2d3e9b[_0x9554('0x32')],_0x2d3e9b[_0x9554('0x2e')]);_0x591878[_0x9554('0x33')]=_['intersection'](_0x2d3e9b[_0x9554('0x32')],qs[_0x9554('0x34')](_0x1e7366[_0x9554('0x2e')][_0x9554('0x34')]));_0x591878['attributes']=_0x591878[_0x9554('0x33')][_0x9554('0x35')]?_0x591878[_0x9554('0x33')]:_0x2d3e9b[_0x9554('0x32')];_0x591878[_0x9554('0x38')]=qs[_0x9554('0x39')](_0x1e7366[_0x9554('0x2e')][_0x9554('0x39')]);_0x591878[_0x9554('0x3b')]=qs[_0x9554('0x30')](_[_0x9554('0x4c')](_0x1e7366['query'],_0x2d3e9b[_0x9554('0x30')]));if(_0x1e7366[_0x9554('0x2e')]['filter']){_0x591878[_0x9554('0x3b')]=_[_0x9554('0x3d')](_0x591878[_0x9554('0x3b')],{'$or':_[_0x9554('0x28')](_0x591878[_0x9554('0x33')],function(_0x519bcb){var _0x131e4a={};_0x131e4a[_0x519bcb]={'$like':'%'+_0x1e7366[_0x9554('0x2e')]['filter']+'%'};return _0x131e4a;})});}_0x591878=_['merge']({},_0x591878,_0x1e7366[_0x9554('0x3e')]);return _0x4ad14f[_0x9554('0x4e')](_0x591878);}})[_0x9554('0x23')](function(_0x1fcb55){if(_0x1fcb55){_0x5aff0f=_0x1fcb55[_0x9554('0x35')];if(!_0x1e7366[_0x9554('0x2e')][_0x9554('0x36')](_0x9554('0x37'))){_0x591878['limit']=qs[_0x9554('0x1d')](_0x1e7366['query'][_0x9554('0x1d')]);_0x591878[_0x9554('0x1c')]=qs[_0x9554('0x1c')](_0x1e7366[_0x9554('0x2e')]['offset']);}return _0x4ad14f[_0x9554('0x4e')](_0x591878);}})[_0x9554('0x23')](function(_0x3dd240){if(_0x3dd240){return _0x3dd240?{'count':_0x5aff0f,'rows':_0x3dd240}:null;}})[_0x9554('0x23')](respondWithResult(_0x25a42d,null))[_0x9554('0x45')](handleError(_0x25a42d,null));}; \ No newline at end of file +var _0xd2c4=['rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','length','find','body','params','getFields','findOne','SalesforceField','getSubjects','pick','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','stack','name','send','map','SalesforceConfiguration'];(function(_0x225b1c,_0x56a332){var _0x3eac2d=function(_0x1bbb58){while(--_0x1bbb58){_0x225b1c['push'](_0x225b1c['shift']());}};_0x3eac2d(++_0x56a332);}(_0xd2c4,0x110));var _0x4d2c=function(_0x13fb21,_0xfc7475){_0x13fb21=_0x13fb21-0x0;var _0x4067a1=_0xd2c4[_0x13fb21];return _0x4067a1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d2c('0x0'));var jsonpatch=require(_0x4d2c('0x1'));var rp=require(_0x4d2c('0x2'));var moment=require(_0x4d2c('0x3'));var BPromise=require(_0x4d2c('0x4'));var Mustache=require('mustache');var util=require(_0x4d2c('0x5'));var path=require('path');var sox=require(_0x4d2c('0x6'));var csv=require(_0x4d2c('0x7'));var ejs=require(_0x4d2c('0x8'));var fs=require('fs');var fs_extra=require(_0x4d2c('0x9'));var _=require(_0x4d2c('0xa'));var squel=require(_0x4d2c('0xb'));var crypto=require('crypto');var jsforce=require(_0x4d2c('0xc'));var deskjs=require(_0x4d2c('0xd'));var toCsv=require(_0x4d2c('0x7'));var querystring=require(_0x4d2c('0xe'));var Papa=require(_0x4d2c('0xf'));var Redis=require('ioredis');var authService=require(_0x4d2c('0x10'));var qs=require(_0x4d2c('0x11'));var as=require(_0x4d2c('0x12'));var hardwareService=require(_0x4d2c('0x13'));var logger=require(_0x4d2c('0x14'))(_0x4d2c('0x15'));var utils=require(_0x4d2c('0x16'));var config=require(_0x4d2c('0x17'));var licenseUtil=require(_0x4d2c('0x18'));var db=require(_0x4d2c('0x19'))['db'];function respondWithStatusCode(_0x55fa3f,_0x152cae){_0x152cae=_0x152cae||0xcc;return function(_0x573853){if(_0x573853){return _0x55fa3f[_0x4d2c('0x1a')](_0x152cae);}return _0x55fa3f[_0x4d2c('0x1b')](_0x152cae)[_0x4d2c('0x1c')]();};}function respondWithResult(_0x2e942c,_0x161952){_0x161952=_0x161952||0xc8;return function(_0x4d827d){if(_0x4d827d){return _0x2e942c['status'](_0x161952)[_0x4d2c('0x1d')](_0x4d827d);}};}function respondWithFilteredResult(_0x5ba401,_0x1079e9){return function(_0x36124d){if(_0x36124d){var _0x5a1184=typeof _0x1079e9[_0x4d2c('0x1e')]==='undefined'&&typeof _0x1079e9[_0x4d2c('0x1f')]===_0x4d2c('0x20');var _0x52fba7=_0x36124d[_0x4d2c('0x21')];var _0x241168=_0x5a1184?0x0:_0x1079e9[_0x4d2c('0x1e')];var _0x45fb87=_0x5a1184?_0x36124d[_0x4d2c('0x21')]:_0x1079e9[_0x4d2c('0x1e')]+_0x1079e9[_0x4d2c('0x1f')];var _0x26c295;if(_0x45fb87>=_0x52fba7){_0x45fb87=_0x52fba7;_0x26c295=0xc8;}else{_0x26c295=0xce;}_0x5ba401[_0x4d2c('0x1b')](_0x26c295);return _0x5ba401['set']('Content-Range',_0x241168+'-'+_0x45fb87+'/'+_0x52fba7)[_0x4d2c('0x1d')](_0x36124d);}return null;};}function patchUpdates(_0xf97f57){return function(_0x16dc11){try{jsonpatch['apply'](_0x16dc11,_0xf97f57,!![]);}catch(_0x2db5c7){return BPromise[_0x4d2c('0x22')](_0x2db5c7);}return _0x16dc11[_0x4d2c('0x23')]();};}function saveUpdates(_0x19e398,_0x8065e3){return function(_0x43e339){if(_0x43e339){return _0x43e339[_0x4d2c('0x24')](_0x19e398)['then'](function(_0x3e6c67){return _0x3e6c67;});}return null;};}function removeEntity(_0x438c6e,_0x3091fe){return function(_0x237880){if(_0x237880){return _0x237880['destroy']()[_0x4d2c('0x25')](function(){_0x438c6e[_0x4d2c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af949,_0x3915fc){return function(_0x4871b0){if(!_0x4871b0){_0x4af949[_0x4d2c('0x1a')](0x194);}return _0x4871b0;};}function handleError(_0x32e8de,_0x36f3e4){_0x36f3e4=_0x36f3e4||0x1f4;return function(_0x4e37af){logger[_0x4d2c('0x26')](_0x4e37af[_0x4d2c('0x27')]);if(_0x4e37af[_0x4d2c('0x28')]){delete _0x4e37af[_0x4d2c('0x28')];}_0x32e8de['status'](_0x36f3e4)[_0x4d2c('0x29')](_0x4e37af);};}exports['index']=function(_0x381a6c,_0x3fcc64){var _0x2c32ee={},_0x1e67db={},_0x50070={'count':0x0,'rows':[]};var _0x59dfea=_[_0x4d2c('0x2a')](db[_0x4d2c('0x2b')][_0x4d2c('0x2c')],function(_0x387520){return{'name':_0x387520[_0x4d2c('0x2d')],'type':_0x387520[_0x4d2c('0x2e')][_0x4d2c('0x2f')]};});_0x1e67db['model']=_[_0x4d2c('0x2a')](_0x59dfea,_0x4d2c('0x28'));_0x1e67db[_0x4d2c('0x30')]=_['keys'](_0x381a6c[_0x4d2c('0x30')]);_0x1e67db[_0x4d2c('0x31')]=_['intersection'](_0x1e67db[_0x4d2c('0x32')],_0x1e67db[_0x4d2c('0x30')]);_0x2c32ee[_0x4d2c('0x33')]=_[_0x4d2c('0x34')](_0x1e67db[_0x4d2c('0x32')],qs[_0x4d2c('0x35')](_0x381a6c[_0x4d2c('0x30')][_0x4d2c('0x35')]));_0x2c32ee['attributes']=_0x2c32ee[_0x4d2c('0x33')]['length']?_0x2c32ee[_0x4d2c('0x33')]:_0x1e67db[_0x4d2c('0x32')];if(!_0x381a6c['query'][_0x4d2c('0x36')](_0x4d2c('0x37'))){_0x2c32ee['limit']=qs['limit'](_0x381a6c['query'][_0x4d2c('0x1f')]);_0x2c32ee[_0x4d2c('0x1e')]=qs[_0x4d2c('0x1e')](_0x381a6c[_0x4d2c('0x30')][_0x4d2c('0x1e')]);}_0x2c32ee[_0x4d2c('0x38')]=qs[_0x4d2c('0x39')](_0x381a6c[_0x4d2c('0x30')]['sort']);_0x2c32ee[_0x4d2c('0x3a')]=qs['filters'](_['pick'](_0x381a6c['query'],_0x1e67db['filters']),_0x59dfea);if(_0x381a6c[_0x4d2c('0x30')][_0x4d2c('0x3b')]){_0x2c32ee[_0x4d2c('0x3a')]=_[_0x4d2c('0x3c')](_0x2c32ee[_0x4d2c('0x3a')],{'$or':_['map'](_0x59dfea,function(_0x11a4d1){if(_0x11a4d1['type']!==_0x4d2c('0x3d')){var _0x590ec9={};_0x590ec9[_0x11a4d1[_0x4d2c('0x28')]]={'$like':'%'+_0x381a6c[_0x4d2c('0x30')][_0x4d2c('0x3b')]+'%'};return _0x590ec9;}})});}_0x2c32ee=_['merge']({},_0x2c32ee,_0x381a6c[_0x4d2c('0x3e')]);var _0x47eb36={'where':_0x2c32ee[_0x4d2c('0x3a')]};return db[_0x4d2c('0x2b')][_0x4d2c('0x21')](_0x47eb36)[_0x4d2c('0x25')](function(_0x3731ab){_0x50070['count']=_0x3731ab;if(_0x381a6c[_0x4d2c('0x30')][_0x4d2c('0x3f')]){_0x2c32ee[_0x4d2c('0x40')]=[{'all':!![]}];}return db[_0x4d2c('0x2b')]['findAll'](_0x2c32ee);})['then'](function(_0x1bb780){_0x50070[_0x4d2c('0x41')]=_0x1bb780;return _0x50070;})['then'](respondWithFilteredResult(_0x3fcc64,_0x2c32ee))[_0x4d2c('0x42')](handleError(_0x3fcc64,null));};exports[_0x4d2c('0x43')]=function(_0x1d67ac,_0xe432b5){var _0x491369={'raw':![],'where':{'id':_0x1d67ac['params']['id']}},_0x4ee26b={};_0x4ee26b['model']=_[_0x4d2c('0x44')](db['SalesforceConfiguration'][_0x4d2c('0x2c')]);_0x4ee26b[_0x4d2c('0x30')]=_[_0x4d2c('0x44')](_0x1d67ac[_0x4d2c('0x30')]);_0x4ee26b[_0x4d2c('0x31')]=_[_0x4d2c('0x34')](_0x4ee26b[_0x4d2c('0x32')],_0x4ee26b[_0x4d2c('0x30')]);_0x491369[_0x4d2c('0x33')]=_[_0x4d2c('0x34')](_0x4ee26b['model'],qs[_0x4d2c('0x35')](_0x1d67ac['query'][_0x4d2c('0x35')]));_0x491369[_0x4d2c('0x33')]=_0x491369['attributes'][_0x4d2c('0x45')]?_0x491369[_0x4d2c('0x33')]:_0x4ee26b[_0x4d2c('0x32')];if(_0x1d67ac[_0x4d2c('0x30')][_0x4d2c('0x3f')]){_0x491369['include']=[{'all':!![]}];}_0x491369=_['merge']({},_0x491369,_0x1d67ac[_0x4d2c('0x3e')]);return db['SalesforceConfiguration'][_0x4d2c('0x46')](_0x491369)['then'](handleEntityNotFound(_0xe432b5,null))[_0x4d2c('0x25')](respondWithResult(_0xe432b5,null))['catch'](handleError(_0xe432b5,null));};exports['create']=function(_0x3df995,_0x301210){return db[_0x4d2c('0x2b')]['create'](_0x3df995['body'],{})['then'](respondWithResult(_0x301210,0xc9))['catch'](handleError(_0x301210,null));};exports['update']=function(_0x11c377,_0x25ed8e){if(_0x11c377[_0x4d2c('0x47')]['id']){delete _0x11c377['body']['id'];}return db[_0x4d2c('0x2b')][_0x4d2c('0x46')]({'where':{'id':_0x11c377[_0x4d2c('0x48')]['id']}})[_0x4d2c('0x25')](handleEntityNotFound(_0x25ed8e,null))[_0x4d2c('0x25')](saveUpdates(_0x11c377[_0x4d2c('0x47')],null))[_0x4d2c('0x25')](respondWithResult(_0x25ed8e,null))[_0x4d2c('0x42')](handleError(_0x25ed8e,null));};exports['destroy']=function(_0x13ec87,_0x28911a){return db[_0x4d2c('0x2b')][_0x4d2c('0x46')]({'where':{'id':_0x13ec87[_0x4d2c('0x48')]['id']}})[_0x4d2c('0x25')](handleEntityNotFound(_0x28911a,null))[_0x4d2c('0x25')](removeEntity(_0x28911a,null))[_0x4d2c('0x42')](handleError(_0x28911a,null));};exports[_0x4d2c('0x49')]=function(_0x115dce,_0x313f04,_0x5150eb){var _0x7183ae={};var _0x56b4c8={};var _0x3a20c4;var _0x4fe448;return db[_0x4d2c('0x2b')][_0x4d2c('0x4a')]({'where':{'id':_0x115dce[_0x4d2c('0x48')]['id']}})[_0x4d2c('0x25')](handleEntityNotFound(_0x313f04,null))[_0x4d2c('0x25')](function(_0x439f87){if(_0x439f87){_0x3a20c4=_0x439f87;_0x56b4c8['model']=_['keys'](db[_0x4d2c('0x4b')][_0x4d2c('0x2c')]);_0x56b4c8[_0x4d2c('0x30')]=_[_0x4d2c('0x44')](_0x115dce['query']);_0x56b4c8[_0x4d2c('0x31')]=_['intersection'](_0x56b4c8[_0x4d2c('0x32')],_0x56b4c8['query']);_0x7183ae['attributes']=_['intersection'](_0x56b4c8[_0x4d2c('0x32')],qs['fields'](_0x115dce['query'][_0x4d2c('0x35')]));_0x7183ae[_0x4d2c('0x33')]=_0x7183ae[_0x4d2c('0x33')][_0x4d2c('0x45')]?_0x7183ae[_0x4d2c('0x33')]:_0x56b4c8[_0x4d2c('0x32')];_0x7183ae[_0x4d2c('0x38')]=qs[_0x4d2c('0x39')](_0x115dce[_0x4d2c('0x30')]['sort']);_0x7183ae['where']=qs['filters'](_['pick'](_0x115dce[_0x4d2c('0x30')],_0x56b4c8['filters']));if(_0x115dce[_0x4d2c('0x30')][_0x4d2c('0x3b')]){_0x7183ae[_0x4d2c('0x3a')]=_['merge'](_0x7183ae[_0x4d2c('0x3a')],{'$or':_['map'](_0x7183ae[_0x4d2c('0x33')],function(_0x1d5b7f){var _0x1b12c7={};_0x1b12c7[_0x1d5b7f]={'$like':'%'+_0x115dce[_0x4d2c('0x30')][_0x4d2c('0x3b')]+'%'};return _0x1b12c7;})});}_0x7183ae=_[_0x4d2c('0x3c')]({},_0x7183ae,_0x115dce[_0x4d2c('0x3e')]);return _0x3a20c4[_0x4d2c('0x49')](_0x7183ae);}})[_0x4d2c('0x25')](function(_0x518b64){if(_0x518b64){_0x4fe448=_0x518b64[_0x4d2c('0x45')];if(!_0x115dce['query'][_0x4d2c('0x36')](_0x4d2c('0x37'))){_0x7183ae[_0x4d2c('0x1f')]=qs[_0x4d2c('0x1f')](_0x115dce[_0x4d2c('0x30')][_0x4d2c('0x1f')]);_0x7183ae[_0x4d2c('0x1e')]=qs['offset'](_0x115dce[_0x4d2c('0x30')]['offset']);}return _0x3a20c4[_0x4d2c('0x49')](_0x7183ae);}})[_0x4d2c('0x25')](function(_0x40a12c){if(_0x40a12c){return _0x40a12c?{'count':_0x4fe448,'rows':_0x40a12c}:null;}})[_0x4d2c('0x25')](respondWithResult(_0x313f04,null))[_0x4d2c('0x42')](handleError(_0x313f04,null));};exports[_0x4d2c('0x4c')]=function(_0x40e1da,_0x3a7abe,_0xc71db9){var _0x3beaa0={};var _0x26c61a={};var _0x3c47eb;var _0x38d918;return db[_0x4d2c('0x2b')][_0x4d2c('0x4a')]({'where':{'id':_0x40e1da[_0x4d2c('0x48')]['id']}})[_0x4d2c('0x25')](handleEntityNotFound(_0x3a7abe,null))[_0x4d2c('0x25')](function(_0x145e71){if(_0x145e71){_0x3c47eb=_0x145e71;_0x26c61a[_0x4d2c('0x32')]=_['keys'](db[_0x4d2c('0x4b')][_0x4d2c('0x2c')]);_0x26c61a[_0x4d2c('0x30')]=_[_0x4d2c('0x44')](_0x40e1da['query']);_0x26c61a[_0x4d2c('0x31')]=_[_0x4d2c('0x34')](_0x26c61a[_0x4d2c('0x32')],_0x26c61a[_0x4d2c('0x30')]);_0x3beaa0[_0x4d2c('0x33')]=_[_0x4d2c('0x34')](_0x26c61a[_0x4d2c('0x32')],qs[_0x4d2c('0x35')](_0x40e1da[_0x4d2c('0x30')][_0x4d2c('0x35')]));_0x3beaa0[_0x4d2c('0x33')]=_0x3beaa0['attributes']['length']?_0x3beaa0[_0x4d2c('0x33')]:_0x26c61a[_0x4d2c('0x32')];_0x3beaa0['order']=qs['sort'](_0x40e1da[_0x4d2c('0x30')][_0x4d2c('0x39')]);_0x3beaa0[_0x4d2c('0x3a')]=qs[_0x4d2c('0x31')](_[_0x4d2c('0x4d')](_0x40e1da[_0x4d2c('0x30')],_0x26c61a[_0x4d2c('0x31')]));if(_0x40e1da[_0x4d2c('0x30')]['filter']){_0x3beaa0[_0x4d2c('0x3a')]=_['merge'](_0x3beaa0[_0x4d2c('0x3a')],{'$or':_[_0x4d2c('0x2a')](_0x3beaa0['attributes'],function(_0x45e32a){var _0x1368d1={};_0x1368d1[_0x45e32a]={'$like':'%'+_0x40e1da[_0x4d2c('0x30')][_0x4d2c('0x3b')]+'%'};return _0x1368d1;})});}_0x3beaa0=_[_0x4d2c('0x3c')]({},_0x3beaa0,_0x40e1da['options']);return _0x3c47eb['getSubjects'](_0x3beaa0);}})[_0x4d2c('0x25')](function(_0x5dcb92){if(_0x5dcb92){_0x38d918=_0x5dcb92[_0x4d2c('0x45')];if(!_0x40e1da[_0x4d2c('0x30')]['hasOwnProperty']('nolimit')){_0x3beaa0[_0x4d2c('0x1f')]=qs['limit'](_0x40e1da[_0x4d2c('0x30')][_0x4d2c('0x1f')]);_0x3beaa0['offset']=qs['offset'](_0x40e1da['query'][_0x4d2c('0x1e')]);}return _0x3c47eb[_0x4d2c('0x4c')](_0x3beaa0);}})[_0x4d2c('0x25')](function(_0x4b4f15){if(_0x4b4f15){return _0x4b4f15?{'count':_0x38d918,'rows':_0x4b4f15}:null;}})[_0x4d2c('0x25')](respondWithResult(_0x3a7abe,null))[_0x4d2c('0x42')](handleError(_0x3a7abe,null));};exports[_0x4d2c('0x4e')]=function(_0x52081c,_0x513846,_0x4864a6){var _0x57449e={};var _0x505f9a={};var _0x88f66c;var _0x3b59b5;return db[_0x4d2c('0x2b')]['findOne']({'where':{'id':_0x52081c[_0x4d2c('0x48')]['id']}})[_0x4d2c('0x25')](handleEntityNotFound(_0x513846,null))[_0x4d2c('0x25')](function(_0x5667e1){if(_0x5667e1){_0x88f66c=_0x5667e1;_0x505f9a['model']=_['keys'](db['SalesforceField'][_0x4d2c('0x2c')]);_0x505f9a['query']=_[_0x4d2c('0x44')](_0x52081c[_0x4d2c('0x30')]);_0x505f9a[_0x4d2c('0x31')]=_[_0x4d2c('0x34')](_0x505f9a[_0x4d2c('0x32')],_0x505f9a['query']);_0x57449e['attributes']=_[_0x4d2c('0x34')](_0x505f9a['model'],qs['fields'](_0x52081c['query'][_0x4d2c('0x35')]));_0x57449e[_0x4d2c('0x33')]=_0x57449e[_0x4d2c('0x33')][_0x4d2c('0x45')]?_0x57449e['attributes']:_0x505f9a['model'];_0x57449e[_0x4d2c('0x38')]=qs[_0x4d2c('0x39')](_0x52081c[_0x4d2c('0x30')][_0x4d2c('0x39')]);_0x57449e[_0x4d2c('0x3a')]=qs[_0x4d2c('0x31')](_[_0x4d2c('0x4d')](_0x52081c[_0x4d2c('0x30')],_0x505f9a[_0x4d2c('0x31')]));if(_0x52081c['query'][_0x4d2c('0x3b')]){_0x57449e[_0x4d2c('0x3a')]=_[_0x4d2c('0x3c')](_0x57449e[_0x4d2c('0x3a')],{'$or':_[_0x4d2c('0x2a')](_0x57449e['attributes'],function(_0x42e499){var _0xeae066={};_0xeae066[_0x42e499]={'$like':'%'+_0x52081c[_0x4d2c('0x30')][_0x4d2c('0x3b')]+'%'};return _0xeae066;})});}_0x57449e=_['merge']({},_0x57449e,_0x52081c[_0x4d2c('0x3e')]);return _0x88f66c[_0x4d2c('0x4e')](_0x57449e);}})[_0x4d2c('0x25')](function(_0x2cb2ac){if(_0x2cb2ac){_0x3b59b5=_0x2cb2ac['length'];if(!_0x52081c[_0x4d2c('0x30')][_0x4d2c('0x36')](_0x4d2c('0x37'))){_0x57449e[_0x4d2c('0x1f')]=qs[_0x4d2c('0x1f')](_0x52081c[_0x4d2c('0x30')]['limit']);_0x57449e[_0x4d2c('0x1e')]=qs[_0x4d2c('0x1e')](_0x52081c[_0x4d2c('0x30')][_0x4d2c('0x1e')]);}return _0x88f66c[_0x4d2c('0x4e')](_0x57449e);}})[_0x4d2c('0x25')](function(_0x43c703){if(_0x43c703){return _0x43c703?{'count':_0x3b59b5,'rows':_0x43c703}:null;}})[_0x4d2c('0x25')](respondWithResult(_0x513846,null))[_0x4d2c('0x42')](handleError(_0x513846,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 2e72c62..0ce6c15 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 _0x546b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger'];(function(_0x313aaa,_0x481bc8){var _0x56800c=function(_0x467151){while(--_0x467151){_0x313aaa['push'](_0x313aaa['shift']());}};_0x56800c(++_0x481bc8);}(_0x546b,0x15d));var _0xb546=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x546b[_0x43f881];return _0x365c14;};'use strict';var _=require(_0xb546('0x0'));var util=require('util');var logger=require(_0xb546('0x1'))(_0xb546('0x2'));var moment=require(_0xb546('0x3'));var BPromise=require(_0xb546('0x4'));var rp=require(_0xb546('0x5'));var fs=require('fs');var path=require(_0xb546('0x6'));var rimraf=require(_0xb546('0x7'));var config=require(_0xb546('0x8'));var attributes=require(_0xb546('0x9'));module[_0xb546('0xa')]=function(_0x12507f,_0x347c8b){return _0x12507f['define'](_0xb546('0xb'),attributes,{'tableName':_0xb546('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93ae=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','lodash'];(function(_0x253195,_0x56002c){var _0x9fa6de=function(_0x39342b){while(--_0x39342b){_0x253195['push'](_0x253195['shift']());}};_0x9fa6de(++_0x56002c);}(_0x93ae,0x17b));var _0xe93a=function(_0x52ecc9,_0x472be8){_0x52ecc9=_0x52ecc9-0x0;var _0x50f6a5=_0x93ae[_0x52ecc9];return _0x50f6a5;};'use strict';var _=require(_0xe93a('0x0'));var util=require(_0xe93a('0x1'));var logger=require(_0xe93a('0x2'))(_0xe93a('0x3'));var moment=require(_0xe93a('0x4'));var BPromise=require(_0xe93a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe93a('0x6'));var rimraf=require(_0xe93a('0x7'));var config=require(_0xe93a('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x1fa7c2,_0x48ebee){return _0x1fa7c2[_0xe93a('0x9')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 095d8c1..e1bc767 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 _0x8884=['then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','SalesforceConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x124293,_0x13e239){var _0x5b4cbb=function(_0x1f172e){while(--_0x1f172e){_0x124293['push'](_0x124293['shift']());}};_0x5b4cbb(++_0x13e239);}(_0x8884,0x135));var _0x4888=function(_0x1c4a34,_0x31afec){_0x1c4a34=_0x1c4a34-0x0;var _0x5c4153=_0x8884[_0x1c4a34];return _0x5c4153;};'use strict';var _=require(_0x4888('0x0'));var util=require(_0x4888('0x1'));var moment=require(_0x4888('0x2'));var BPromise=require(_0x4888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4888('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4888('0x5'));var logger=require('../../config/logger')(_0x4888('0x6'));var config=require(_0x4888('0x7'));var jayson=require(_0x4888('0x8'));var client=jayson[_0x4888('0x9')][_0x4888('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3abeea,_0x3d85b8,_0x1ac713){return new BPromise(function(_0x3cc71d,_0x321c05){return client['request'](_0x3abeea,_0x1ac713)[_0x4888('0xb')](function(_0x13e903){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x3d85b8,'request\x20sent');logger[_0x4888('0xc')](_0x4888('0xd'),_0x3d85b8,'request\x20sent',JSON['stringify'](_0x13e903));if(_0x13e903[_0x4888('0xe')]){if(_0x13e903[_0x4888('0xe')]['code']===0x1f4){logger[_0x4888('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d85b8,_0x13e903[_0x4888('0xe')][_0x4888('0xf')]);return _0x321c05(_0x13e903[_0x4888('0xe')][_0x4888('0xf')]);}logger[_0x4888('0xe')](_0x4888('0x10'),_0x3d85b8,_0x13e903[_0x4888('0xe')][_0x4888('0xf')]);return _0x3cc71d(_0x13e903[_0x4888('0xe')][_0x4888('0xf')]);}else{logger[_0x4888('0x11')](_0x4888('0x10'),_0x3d85b8,'request\x20sent');_0x3cc71d(_0x13e903[_0x4888('0x12')][_0x4888('0xf')]);}})[_0x4888('0x13')](function(_0x104974){logger[_0x4888('0xe')](_0x4888('0x10'),_0x3d85b8,_0x104974);_0x321c05(_0x104974);});});} \ No newline at end of file +var _0xc5c6=['then','info','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0xc5c6,0xd2));var _0x6c5c=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xc5c6[_0x4ed520];return _0x4415a6;};'use strict';var _=require('lodash');var util=require(_0x6c5c('0x0'));var moment=require(_0x6c5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x6c5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c5c('0x3'))['db'];var utils=require(_0x6c5c('0x4'));var logger=require(_0x6c5c('0x5'))('rpc');var config=require(_0x6c5c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c5c('0x7')][_0x6c5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6af2a4,_0x292d45,_0x512e1a){return new BPromise(function(_0x4ca480,_0x526a98){return client[_0x6c5c('0x9')](_0x6af2a4,_0x512e1a)[_0x6c5c('0xa')](function(_0x273ffd){logger[_0x6c5c('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x292d45,_0x6c5c('0xc'));logger[_0x6c5c('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x292d45,_0x6c5c('0xc'),JSON[_0x6c5c('0xe')](_0x273ffd));if(_0x273ffd[_0x6c5c('0xf')]){if(_0x273ffd[_0x6c5c('0xf')][_0x6c5c('0x10')]===0x1f4){logger['error'](_0x6c5c('0x11'),_0x292d45,_0x273ffd['error'][_0x6c5c('0x12')]);return _0x526a98(_0x273ffd[_0x6c5c('0xf')][_0x6c5c('0x12')]);}logger[_0x6c5c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x292d45,_0x273ffd[_0x6c5c('0xf')][_0x6c5c('0x12')]);return _0x4ca480(_0x273ffd['error'][_0x6c5c('0x12')]);}else{logger[_0x6c5c('0xb')](_0x6c5c('0x11'),_0x292d45,'request\x20sent');_0x4ca480(_0x273ffd[_0x6c5c('0x13')][_0x6c5c('0x12')]);}})['catch'](function(_0x2a798a){logger[_0x6c5c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x292d45,_0x2a798a);_0x526a98(_0x2a798a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 1d91788..ff21909 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 _0x467c=['express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','create','put','update','destroy','path','connect-timeout'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x467c,0x11e));var _0xc467=function(_0x578610,_0x3da0b5){_0x578610=_0x578610-0x0;var _0x5b363a=_0x467c[_0x578610];return _0x5b363a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc467('0x0'));var timeout=require(_0xc467('0x1'));var express=require(_0xc467('0x2'));var router=express[_0xc467('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc467('0x4'));var interaction=require(_0xc467('0x5'));var config=require('../../config/environment');var controller=require(_0xc467('0x6'));router['get']('/',auth[_0xc467('0x7')](),controller[_0xc467('0x8')]);router[_0xc467('0x9')](_0xc467('0xa'),auth['isAuthenticated'](),controller[_0xc467('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc467('0xc')]);router[_0xc467('0xd')](_0xc467('0xa'),auth['isAuthenticated'](),controller[_0xc467('0xe')]);router['delete'](_0xc467('0xa'),auth['isAuthenticated'](),controller[_0xc467('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa46e=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports'];(function(_0x433861,_0x506eb4){var _0x441b39=function(_0x3fa2db){while(--_0x3fa2db){_0x433861['push'](_0x433861['shift']());}};_0x441b39(++_0x506eb4);}(_0xa46e,0x1b0));var _0xea46=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xa46e[_0x2e50a2];return _0x47e5de;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require(_0xea46('0x2'));var timeout=require('connect-timeout');var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require(_0xea46('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xea46('0x6'));var config=require(_0xea46('0x7'));var controller=require(_0xea46('0x8'));router[_0xea46('0x9')]('/',auth[_0xea46('0xa')](),controller['index']);router['get'](_0xea46('0xb'),auth['isAuthenticated'](),controller[_0xea46('0xc')]);router[_0xea46('0xd')]('/',auth[_0xea46('0xa')](),controller['create']);router['put'](_0xea46('0xb'),auth['isAuthenticated'](),controller[_0xea46('0xe')]);router[_0xea46('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xea46('0x10')]);module[_0xea46('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 6086ad3..25cd534 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 _0xce34=['STRING','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3cb204,_0x1cf852){var _0x426dcb=function(_0x40e37e){while(--_0x40e37e){_0x3cb204['push'](_0x3cb204['shift']());}};_0x426dcb(++_0x1cf852);}(_0xce34,0xb9));var _0x4ce3=function(_0x33203b,_0x3ad9ec){_0x33203b=_0x33203b-0x0;var _0x14170c=_0xce34[_0x33203b];return _0x14170c;};'use strict';var Sequelize=require(_0x4ce3('0x0'));module[_0x4ce3('0x1')]={'type':{'type':Sequelize[_0x4ce3('0x2')](_0x4ce3('0x3'),_0x4ce3('0x4'),_0x4ce3('0x5'),'keyValue',_0x4ce3('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4ce3('0x7')]},'keyType':{'type':Sequelize[_0x4ce3('0x2')](_0x4ce3('0x3'),'variable',_0x4ce3('0x5'))},'keyContent':{'type':Sequelize[_0x4ce3('0x7')]},'idField':{'type':Sequelize[_0x4ce3('0x7')]},'variableName':{'type':Sequelize[_0x4ce3('0x7')]}}; \ No newline at end of file +var _0xde4a=['sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0xde4a,0x75));var _0xade4=function(_0x13ca87,_0x24c3cf){_0x13ca87=_0x13ca87-0x0;var _0x476281=_0xde4a[_0x13ca87];return _0x476281;};'use strict';var Sequelize=require(_0xade4('0x0'));module[_0xade4('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xade4('0x2'),_0xade4('0x3'),_0xade4('0x4'),_0xade4('0x5')),'defaultValue':_0xade4('0x6')},'content':{'type':Sequelize[_0xade4('0x7')]},'key':{'type':Sequelize[_0xade4('0x7')]},'keyType':{'type':Sequelize[_0xade4('0x8')](_0xade4('0x6'),_0xade4('0x2'),_0xade4('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xade4('0x7')]},'variableName':{'type':Sequelize[_0xade4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3ba0972..756bd5b 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 _0x1ee1=['params','destroy','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/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','SalesforceField','includeAll','include','findAll','catch','find','create','body'];(function(_0x1fe475,_0x45bdb0){var _0x43d0b6=function(_0x59511d){while(--_0x59511d){_0x1fe475['push'](_0x1fe475['shift']());}};_0x43d0b6(++_0x45bdb0);}(_0x1ee1,0xdd));var _0x11ee=function(_0x24275f,_0x3ae529){_0x24275f=_0x24275f-0x0;var _0x5b48bd=_0x1ee1[_0x24275f];return _0x5b48bd;};'use strict';var emlformat=require(_0x11ee('0x0'));var rimraf=require(_0x11ee('0x1'));var zipdir=require(_0x11ee('0x2'));var jsonpatch=require(_0x11ee('0x3'));var rp=require(_0x11ee('0x4'));var moment=require(_0x11ee('0x5'));var BPromise=require(_0x11ee('0x6'));var Mustache=require(_0x11ee('0x7'));var util=require('util');var path=require('path');var sox=require(_0x11ee('0x8'));var csv=require('to-csv');var ejs=require(_0x11ee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11ee('0xa'));var squel=require(_0x11ee('0xb'));var crypto=require(_0x11ee('0xc'));var jsforce=require(_0x11ee('0xd'));var deskjs=require(_0x11ee('0xe'));var toCsv=require(_0x11ee('0xf'));var querystring=require('querystring');var Papa=require(_0x11ee('0x10'));var Redis=require(_0x11ee('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11ee('0x12'));var hardwareService=require(_0x11ee('0x13'));var logger=require(_0x11ee('0x14'))(_0x11ee('0x15'));var utils=require(_0x11ee('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x11ee('0x17'))['db'];function respondWithStatusCode(_0x3ecb0f,_0x5548e4){_0x5548e4=_0x5548e4||0xcc;return function(_0x26dc07){if(_0x26dc07){return _0x3ecb0f[_0x11ee('0x18')](_0x5548e4);}return _0x3ecb0f[_0x11ee('0x19')](_0x5548e4)[_0x11ee('0x1a')]();};}function respondWithResult(_0x38e41b,_0x118223){_0x118223=_0x118223||0xc8;return function(_0x244c1f){if(_0x244c1f){return _0x38e41b[_0x11ee('0x19')](_0x118223)[_0x11ee('0x1b')](_0x244c1f);}};}function respondWithFilteredResult(_0x23b7a9,_0x300660){return function(_0xbcf54b){if(_0xbcf54b){var _0x59c5b8=typeof _0x300660[_0x11ee('0x1c')]===_0x11ee('0x1d')&&typeof _0x300660[_0x11ee('0x1e')]===_0x11ee('0x1d');var _0x395ce5=_0xbcf54b[_0x11ee('0x1f')];var _0x33affb=_0x59c5b8?0x0:_0x300660[_0x11ee('0x1c')];var _0x604a33=_0x59c5b8?_0xbcf54b['count']:_0x300660[_0x11ee('0x1c')]+_0x300660[_0x11ee('0x1e')];var _0x134648;if(_0x604a33>=_0x395ce5){_0x604a33=_0x395ce5;_0x134648=0xc8;}else{_0x134648=0xce;}_0x23b7a9['status'](_0x134648);return _0x23b7a9[_0x11ee('0x20')](_0x11ee('0x21'),_0x33affb+'-'+_0x604a33+'/'+_0x395ce5)['json'](_0xbcf54b);}return null;};}function patchUpdates(_0x170233){return function(_0x1995e6){try{jsonpatch['apply'](_0x1995e6,_0x170233,!![]);}catch(_0x58456b){return BPromise[_0x11ee('0x22')](_0x58456b);}return _0x1995e6[_0x11ee('0x23')]();};}function saveUpdates(_0x161560,_0x274511){return function(_0x5624f6){if(_0x5624f6){return _0x5624f6[_0x11ee('0x24')](_0x161560)[_0x11ee('0x25')](function(_0x385cc2){return _0x385cc2;});}return null;};}function removeEntity(_0x1881e5,_0xf6f467){return function(_0x305a24){if(_0x305a24){return _0x305a24['destroy']()[_0x11ee('0x25')](function(){_0x1881e5['status'](0xcc)[_0x11ee('0x1a')]();});}};}function handleEntityNotFound(_0x215d0a,_0x48fb0a){return function(_0x2765cd){if(!_0x2765cd){_0x215d0a[_0x11ee('0x18')](0x194);}return _0x2765cd;};}function handleError(_0x215e7a,_0x5ba4ea){_0x5ba4ea=_0x5ba4ea||0x1f4;return function(_0x285a8a){logger[_0x11ee('0x26')](_0x285a8a[_0x11ee('0x27')]);if(_0x285a8a[_0x11ee('0x28')]){delete _0x285a8a['name'];}_0x215e7a['status'](_0x5ba4ea)['send'](_0x285a8a);};}exports[_0x11ee('0x29')]=function(_0xba086,_0x8f3d88){var _0x2728a7={},_0x28b634={},_0x25fb86={'count':0x0,'rows':[]};var _0x40a89b=_[_0x11ee('0x2a')](db['SalesforceField'][_0x11ee('0x2b')],function(_0x405d47){return{'name':_0x405d47[_0x11ee('0x2c')],'type':_0x405d47[_0x11ee('0x2d')][_0x11ee('0x2e')]};});_0x28b634[_0x11ee('0x2f')]=_[_0x11ee('0x2a')](_0x40a89b,_0x11ee('0x28'));_0x28b634[_0x11ee('0x30')]=_[_0x11ee('0x31')](_0xba086[_0x11ee('0x30')]);_0x28b634[_0x11ee('0x32')]=_[_0x11ee('0x33')](_0x28b634['model'],_0x28b634['query']);_0x2728a7[_0x11ee('0x34')]=_[_0x11ee('0x33')](_0x28b634[_0x11ee('0x2f')],qs['fields'](_0xba086[_0x11ee('0x30')][_0x11ee('0x35')]));_0x2728a7[_0x11ee('0x34')]=_0x2728a7[_0x11ee('0x34')][_0x11ee('0x36')]?_0x2728a7[_0x11ee('0x34')]:_0x28b634[_0x11ee('0x2f')];if(!_0xba086[_0x11ee('0x30')][_0x11ee('0x37')](_0x11ee('0x38'))){_0x2728a7['limit']=qs[_0x11ee('0x1e')](_0xba086['query'][_0x11ee('0x1e')]);_0x2728a7[_0x11ee('0x1c')]=qs[_0x11ee('0x1c')](_0xba086[_0x11ee('0x30')][_0x11ee('0x1c')]);}_0x2728a7['order']=qs['sort'](_0xba086['query'][_0x11ee('0x39')]);_0x2728a7[_0x11ee('0x3a')]=qs[_0x11ee('0x32')](_[_0x11ee('0x3b')](_0xba086['query'],_0x28b634[_0x11ee('0x32')]),_0x40a89b);if(_0xba086[_0x11ee('0x30')]['filter']){_0x2728a7[_0x11ee('0x3a')]=_['merge'](_0x2728a7['where'],{'$or':_['map'](_0x40a89b,function(_0x1f52c9){if(_0x1f52c9[_0x11ee('0x2d')]!==_0x11ee('0x3c')){var _0x2f16f9={};_0x2f16f9[_0x1f52c9['name']]={'$like':'%'+_0xba086[_0x11ee('0x30')][_0x11ee('0x3d')]+'%'};return _0x2f16f9;}})});}_0x2728a7=_[_0x11ee('0x3e')]({},_0x2728a7,_0xba086['options']);var _0x3993c0={'where':_0x2728a7[_0x11ee('0x3a')]};return db[_0x11ee('0x3f')][_0x11ee('0x1f')](_0x3993c0)[_0x11ee('0x25')](function(_0x549579){_0x25fb86[_0x11ee('0x1f')]=_0x549579;if(_0xba086[_0x11ee('0x30')][_0x11ee('0x40')]){_0x2728a7[_0x11ee('0x41')]=[{'all':!![]}];}return db['SalesforceField'][_0x11ee('0x42')](_0x2728a7);})[_0x11ee('0x25')](function(_0x229c9d){_0x25fb86['rows']=_0x229c9d;return _0x25fb86;})[_0x11ee('0x25')](respondWithFilteredResult(_0x8f3d88,_0x2728a7))[_0x11ee('0x43')](handleError(_0x8f3d88,null));};exports['show']=function(_0x1e8e02,_0x501496){var _0x2f3fb4={'raw':!![],'where':{'id':_0x1e8e02['params']['id']}},_0x2b1b2a={};_0x2b1b2a[_0x11ee('0x2f')]=_[_0x11ee('0x31')](db[_0x11ee('0x3f')][_0x11ee('0x2b')]);_0x2b1b2a['query']=_[_0x11ee('0x31')](_0x1e8e02[_0x11ee('0x30')]);_0x2b1b2a[_0x11ee('0x32')]=_[_0x11ee('0x33')](_0x2b1b2a[_0x11ee('0x2f')],_0x2b1b2a[_0x11ee('0x30')]);_0x2f3fb4[_0x11ee('0x34')]=_[_0x11ee('0x33')](_0x2b1b2a[_0x11ee('0x2f')],qs[_0x11ee('0x35')](_0x1e8e02['query']['fields']));_0x2f3fb4[_0x11ee('0x34')]=_0x2f3fb4[_0x11ee('0x34')]['length']?_0x2f3fb4[_0x11ee('0x34')]:_0x2b1b2a[_0x11ee('0x2f')];if(_0x1e8e02[_0x11ee('0x30')]['includeAll']){_0x2f3fb4[_0x11ee('0x41')]=[{'all':!![]}];}_0x2f3fb4=_[_0x11ee('0x3e')]({},_0x2f3fb4,_0x1e8e02['options']);return db[_0x11ee('0x3f')][_0x11ee('0x44')](_0x2f3fb4)[_0x11ee('0x25')](handleEntityNotFound(_0x501496,null))[_0x11ee('0x25')](respondWithResult(_0x501496,null))['catch'](handleError(_0x501496,null));};exports[_0x11ee('0x45')]=function(_0x198912,_0x4c5752){return db[_0x11ee('0x3f')][_0x11ee('0x45')](_0x198912[_0x11ee('0x46')],{})[_0x11ee('0x25')](respondWithResult(_0x4c5752,0xc9))['catch'](handleError(_0x4c5752,null));};exports[_0x11ee('0x24')]=function(_0x34790f,_0x42db32){if(_0x34790f[_0x11ee('0x46')]['id']){delete _0x34790f[_0x11ee('0x46')]['id'];}return db[_0x11ee('0x3f')][_0x11ee('0x44')]({'where':{'id':_0x34790f[_0x11ee('0x47')]['id']}})[_0x11ee('0x25')](handleEntityNotFound(_0x42db32,null))['then'](saveUpdates(_0x34790f['body'],null))[_0x11ee('0x25')](respondWithResult(_0x42db32,null))[_0x11ee('0x43')](handleError(_0x42db32,null));};exports[_0x11ee('0x48')]=function(_0x54ab70,_0x302873){return db[_0x11ee('0x3f')]['find']({'where':{'id':_0x54ab70[_0x11ee('0x47')]['id']}})[_0x11ee('0x25')](handleEntityNotFound(_0x302873,null))[_0x11ee('0x25')](removeEntity(_0x302873,null))[_0x11ee('0x43')](handleError(_0x302873,null));}; \ No newline at end of file +var _0xda81=['bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','send','index','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','VIRTUAL','filter','includeAll','include','SalesforceField','findAll','rows','show','params','rawAttributes','options','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x571c1d,_0x3b0586){var _0x33c609=function(_0x226499){while(--_0x226499){_0x571c1d['push'](_0x571c1d['shift']());}};_0x33c609(++_0x3b0586);}(_0xda81,0x1c3));var _0x1da8=function(_0x104081,_0x46f142){_0x104081=_0x104081-0x0;var _0x24a5f2=_0xda81[_0x104081];return _0x24a5f2;};'use strict';var emlformat=require(_0x1da8('0x0'));var rimraf=require(_0x1da8('0x1'));var zipdir=require(_0x1da8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1da8('0x3'));var moment=require(_0x1da8('0x4'));var BPromise=require(_0x1da8('0x5'));var Mustache=require(_0x1da8('0x6'));var util=require('util');var path=require(_0x1da8('0x7'));var sox=require(_0x1da8('0x8'));var csv=require('to-csv');var ejs=require(_0x1da8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1da8('0xa'));var squel=require(_0x1da8('0xb'));var crypto=require(_0x1da8('0xc'));var jsforce=require(_0x1da8('0xd'));var deskjs=require(_0x1da8('0xe'));var toCsv=require(_0x1da8('0xf'));var querystring=require(_0x1da8('0x10'));var Papa=require(_0x1da8('0x11'));var Redis=require(_0x1da8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1da8('0x13'));var as=require(_0x1da8('0x14'));var hardwareService=require(_0x1da8('0x15'));var logger=require(_0x1da8('0x16'))(_0x1da8('0x17'));var utils=require('../../config/utils');var config=require(_0x1da8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1da8('0x19'))['db'];function respondWithStatusCode(_0x4127c8,_0x2717e6){_0x2717e6=_0x2717e6||0xcc;return function(_0x444ea6){if(_0x444ea6){return _0x4127c8[_0x1da8('0x1a')](_0x2717e6);}return _0x4127c8['status'](_0x2717e6)[_0x1da8('0x1b')]();};}function respondWithResult(_0x491a3f,_0x335935){_0x335935=_0x335935||0xc8;return function(_0x283169){if(_0x283169){return _0x491a3f[_0x1da8('0x1c')](_0x335935)[_0x1da8('0x1d')](_0x283169);}};}function respondWithFilteredResult(_0x23b7e7,_0x1e25ff){return function(_0x5f40c0){if(_0x5f40c0){var _0x155829=typeof _0x1e25ff[_0x1da8('0x1e')]===_0x1da8('0x1f')&&typeof _0x1e25ff[_0x1da8('0x20')]===_0x1da8('0x1f');var _0x422721=_0x5f40c0[_0x1da8('0x21')];var _0x1258e3=_0x155829?0x0:_0x1e25ff[_0x1da8('0x1e')];var _0x4ccb6e=_0x155829?_0x5f40c0[_0x1da8('0x21')]:_0x1e25ff[_0x1da8('0x1e')]+_0x1e25ff[_0x1da8('0x20')];var _0x2b84fa;if(_0x4ccb6e>=_0x422721){_0x4ccb6e=_0x422721;_0x2b84fa=0xc8;}else{_0x2b84fa=0xce;}_0x23b7e7[_0x1da8('0x1c')](_0x2b84fa);return _0x23b7e7[_0x1da8('0x22')]('Content-Range',_0x1258e3+'-'+_0x4ccb6e+'/'+_0x422721)[_0x1da8('0x1d')](_0x5f40c0);}return null;};}function patchUpdates(_0x36f234){return function(_0x3afeb3){try{jsonpatch[_0x1da8('0x23')](_0x3afeb3,_0x36f234,!![]);}catch(_0x9f2255){return BPromise[_0x1da8('0x24')](_0x9f2255);}return _0x3afeb3['save']();};}function saveUpdates(_0x283ff8,_0x503adb){return function(_0x3650e8){if(_0x3650e8){return _0x3650e8[_0x1da8('0x25')](_0x283ff8)[_0x1da8('0x26')](function(_0x370d2a){return _0x370d2a;});}return null;};}function removeEntity(_0x2a9002,_0x2ea607){return function(_0x2839e2){if(_0x2839e2){return _0x2839e2['destroy']()['then'](function(){_0x2a9002[_0x1da8('0x1c')](0xcc)[_0x1da8('0x1b')]();});}};}function handleEntityNotFound(_0x4e281e,_0x242e69){return function(_0x1509a9){if(!_0x1509a9){_0x4e281e[_0x1da8('0x1a')](0x194);}return _0x1509a9;};}function handleError(_0x138aad,_0x1e2d3e){_0x1e2d3e=_0x1e2d3e||0x1f4;return function(_0x46af20){logger['error'](_0x46af20[_0x1da8('0x27')]);if(_0x46af20[_0x1da8('0x28')]){delete _0x46af20[_0x1da8('0x28')];}_0x138aad[_0x1da8('0x1c')](_0x1e2d3e)[_0x1da8('0x29')](_0x46af20);};}exports[_0x1da8('0x2a')]=function(_0x272a98,_0x31d32d){var _0x442043={},_0x21f3fe={},_0x58e3c6={'count':0x0,'rows':[]};var _0x157977=_['map'](db['SalesforceField']['rawAttributes'],function(_0x54d3fd){return{'name':_0x54d3fd[_0x1da8('0x2b')],'type':_0x54d3fd[_0x1da8('0x2c')]['key']};});_0x21f3fe[_0x1da8('0x2d')]=_['map'](_0x157977,_0x1da8('0x28'));_0x21f3fe[_0x1da8('0x2e')]=_[_0x1da8('0x2f')](_0x272a98['query']);_0x21f3fe[_0x1da8('0x30')]=_[_0x1da8('0x31')](_0x21f3fe[_0x1da8('0x2d')],_0x21f3fe[_0x1da8('0x2e')]);_0x442043['attributes']=_[_0x1da8('0x31')](_0x21f3fe[_0x1da8('0x2d')],qs[_0x1da8('0x32')](_0x272a98[_0x1da8('0x2e')][_0x1da8('0x32')]));_0x442043[_0x1da8('0x33')]=_0x442043['attributes'][_0x1da8('0x34')]?_0x442043[_0x1da8('0x33')]:_0x21f3fe[_0x1da8('0x2d')];if(!_0x272a98['query'][_0x1da8('0x35')](_0x1da8('0x36'))){_0x442043[_0x1da8('0x20')]=qs[_0x1da8('0x20')](_0x272a98[_0x1da8('0x2e')]['limit']);_0x442043[_0x1da8('0x1e')]=qs[_0x1da8('0x1e')](_0x272a98[_0x1da8('0x2e')]['offset']);}_0x442043['order']=qs[_0x1da8('0x37')](_0x272a98['query']['sort']);_0x442043['where']=qs[_0x1da8('0x30')](_[_0x1da8('0x38')](_0x272a98[_0x1da8('0x2e')],_0x21f3fe['filters']),_0x157977);if(_0x272a98[_0x1da8('0x2e')]['filter']){_0x442043[_0x1da8('0x39')]=_[_0x1da8('0x3a')](_0x442043[_0x1da8('0x39')],{'$or':_[_0x1da8('0x3b')](_0x157977,function(_0x2a6b70){if(_0x2a6b70[_0x1da8('0x2c')]!==_0x1da8('0x3c')){var _0x268ec9={};_0x268ec9[_0x2a6b70[_0x1da8('0x28')]]={'$like':'%'+_0x272a98[_0x1da8('0x2e')][_0x1da8('0x3d')]+'%'};return _0x268ec9;}})});}_0x442043=_[_0x1da8('0x3a')]({},_0x442043,_0x272a98['options']);var _0x3df5cb={'where':_0x442043[_0x1da8('0x39')]};return db['SalesforceField'][_0x1da8('0x21')](_0x3df5cb)[_0x1da8('0x26')](function(_0x3794ff){_0x58e3c6['count']=_0x3794ff;if(_0x272a98[_0x1da8('0x2e')][_0x1da8('0x3e')]){_0x442043[_0x1da8('0x3f')]=[{'all':!![]}];}return db[_0x1da8('0x40')][_0x1da8('0x41')](_0x442043);})['then'](function(_0x3655c0){_0x58e3c6[_0x1da8('0x42')]=_0x3655c0;return _0x58e3c6;})[_0x1da8('0x26')](respondWithFilteredResult(_0x31d32d,_0x442043))['catch'](handleError(_0x31d32d,null));};exports[_0x1da8('0x43')]=function(_0x5dd58e,_0x37d431){var _0x3cd2d5={'raw':!![],'where':{'id':_0x5dd58e[_0x1da8('0x44')]['id']}},_0x1f9871={};_0x1f9871[_0x1da8('0x2d')]=_[_0x1da8('0x2f')](db[_0x1da8('0x40')][_0x1da8('0x45')]);_0x1f9871[_0x1da8('0x2e')]=_[_0x1da8('0x2f')](_0x5dd58e['query']);_0x1f9871[_0x1da8('0x30')]=_[_0x1da8('0x31')](_0x1f9871[_0x1da8('0x2d')],_0x1f9871[_0x1da8('0x2e')]);_0x3cd2d5[_0x1da8('0x33')]=_['intersection'](_0x1f9871[_0x1da8('0x2d')],qs[_0x1da8('0x32')](_0x5dd58e[_0x1da8('0x2e')][_0x1da8('0x32')]));_0x3cd2d5[_0x1da8('0x33')]=_0x3cd2d5[_0x1da8('0x33')][_0x1da8('0x34')]?_0x3cd2d5[_0x1da8('0x33')]:_0x1f9871[_0x1da8('0x2d')];if(_0x5dd58e[_0x1da8('0x2e')][_0x1da8('0x3e')]){_0x3cd2d5[_0x1da8('0x3f')]=[{'all':!![]}];}_0x3cd2d5=_[_0x1da8('0x3a')]({},_0x3cd2d5,_0x5dd58e[_0x1da8('0x46')]);return db['SalesforceField']['find'](_0x3cd2d5)[_0x1da8('0x26')](handleEntityNotFound(_0x37d431,null))[_0x1da8('0x26')](respondWithResult(_0x37d431,null))[_0x1da8('0x47')](handleError(_0x37d431,null));};exports[_0x1da8('0x48')]=function(_0x25777f,_0x1ed191){return db['SalesforceField'][_0x1da8('0x48')](_0x25777f['body'],{})[_0x1da8('0x26')](respondWithResult(_0x1ed191,0xc9))[_0x1da8('0x47')](handleError(_0x1ed191,null));};exports[_0x1da8('0x25')]=function(_0x5d16cb,_0x319531){if(_0x5d16cb[_0x1da8('0x49')]['id']){delete _0x5d16cb[_0x1da8('0x49')]['id'];}return db[_0x1da8('0x40')][_0x1da8('0x4a')]({'where':{'id':_0x5d16cb[_0x1da8('0x44')]['id']}})['then'](handleEntityNotFound(_0x319531,null))[_0x1da8('0x26')](saveUpdates(_0x5d16cb['body'],null))[_0x1da8('0x26')](respondWithResult(_0x319531,null))['catch'](handleError(_0x319531,null));};exports[_0x1da8('0x4b')]=function(_0x5860c8,_0xec5023){return db[_0x1da8('0x40')][_0x1da8('0x4a')]({'where':{'id':_0x5860c8['params']['id']}})[_0x1da8('0x26')](handleEntityNotFound(_0xec5023,null))[_0x1da8('0x26')](removeEntity(_0xec5023,null))[_0x1da8('0x47')](handleError(_0xec5023,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 8e9a2c4..8bf5208 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 _0x7f22=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7f22,0x14c));var _0x27f2=function(_0x3e031e,_0x10c2cc){_0x3e031e=_0x3e031e-0x0;var _0x4225dd=_0x7f22[_0x3e031e];return _0x4225dd;};'use strict';var _=require(_0x27f2('0x0'));var util=require(_0x27f2('0x1'));var logger=require(_0x27f2('0x2'))(_0x27f2('0x3'));var moment=require('moment');var BPromise=require(_0x27f2('0x4'));var rp=require(_0x27f2('0x5'));var fs=require('fs');var path=require(_0x27f2('0x6'));var rimraf=require(_0x27f2('0x7'));var config=require(_0x27f2('0x8'));var attributes=require(_0x27f2('0x9'));module[_0x27f2('0xa')]=function(_0x1950e,_0x906b5b){return _0x1950e[_0x27f2('0xb')](_0x27f2('0xc'),attributes,{'tableName':_0x27f2('0xd'),'paranoid':![],'indexes':[{'name':_0x27f2('0xe'),'fields':[_0x27f2('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x40d7=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x525ba3,_0x148964){var _0x515f58=function(_0xf8fa70){while(--_0xf8fa70){_0x525ba3['push'](_0x525ba3['shift']());}};_0x515f58(++_0x148964);}(_0x40d7,0xf4));var _0x740d=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x40d7[_0x1c8cc6];return _0x522936;};'use strict';var _=require(_0x740d('0x0'));var util=require(_0x740d('0x1'));var logger=require(_0x740d('0x2'))(_0x740d('0x3'));var moment=require(_0x740d('0x4'));var BPromise=require(_0x740d('0x5'));var rp=require(_0x740d('0x6'));var fs=require('fs');var path=require(_0x740d('0x7'));var rimraf=require(_0x740d('0x8'));var config=require(_0x740d('0x9'));var attributes=require(_0x740d('0xa'));module[_0x740d('0xb')]=function(_0x365253,_0x126098){return _0x365253[_0x740d('0xc')](_0x740d('0xd'),attributes,{'tableName':_0x740d('0xe'),'paranoid':![],'indexes':[{'name':_0x740d('0xf'),'fields':['idField',_0x740d('0x10')],'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 86200cd..5de1972 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 _0x80cc=['../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x80cc,0xd6));var _0xc80c=function(_0x4e0883,_0x344ea3){_0x4e0883=_0x4e0883-0x0;var _0x58e41f=_0x80cc[_0x4e0883];return _0x58e41f;};'use strict';var _=require(_0xc80c('0x0'));var util=require(_0xc80c('0x1'));var moment=require('moment');var BPromise=require(_0xc80c('0x2'));var rs=require(_0xc80c('0x3'));var fs=require('fs');var Redis=require(_0xc80c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc80c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc80c('0x6'));var jayson=require(_0xc80c('0x7'));var client=jayson[_0xc80c('0x8')][_0xc80c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51ee03,_0x4330bd,_0x263871){return new BPromise(function(_0x5ee220,_0x49f662){return client['request'](_0x51ee03,_0x263871)[_0xc80c('0xa')](function(_0x2edea4){logger[_0xc80c('0xb')](_0xc80c('0xc'),_0x4330bd,_0xc80c('0xd'));logger[_0xc80c('0xe')](_0xc80c('0xf'),_0x4330bd,'request\x20sent',JSON['stringify'](_0x2edea4));if(_0x2edea4[_0xc80c('0x10')]){if(_0x2edea4[_0xc80c('0x10')]['code']===0x1f4){logger[_0xc80c('0x10')](_0xc80c('0xc'),_0x4330bd,_0x2edea4['error']['message']);return _0x49f662(_0x2edea4[_0xc80c('0x10')][_0xc80c('0x11')]);}logger[_0xc80c('0x10')](_0xc80c('0xc'),_0x4330bd,_0x2edea4[_0xc80c('0x10')][_0xc80c('0x11')]);return _0x5ee220(_0x2edea4[_0xc80c('0x10')][_0xc80c('0x11')]);}else{logger[_0xc80c('0xb')]('SalesforceField,\x20%s,\x20%s',_0x4330bd,_0xc80c('0xd'));_0x5ee220(_0x2edea4[_0xc80c('0x12')][_0xc80c('0x11')]);}})[_0xc80c('0x13')](function(_0x5a22de){logger[_0xc80c('0x10')](_0xc80c('0xc'),_0x4330bd,_0x5a22de);_0x49f662(_0x5a22de);});});} \ No newline at end of file +var _0x8d1b=['rpc','jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1cf55c,_0x2750e6){var _0x58024f=function(_0x9b88cb){while(--_0x9b88cb){_0x1cf55c['push'](_0x1cf55c['shift']());}};_0x58024f(++_0x2750e6);}(_0x8d1b,0x1a8));var _0xb8d1=function(_0x56f74a,_0x443c23){_0x56f74a=_0x56f74a-0x0;var _0xd4391b=_0x8d1b[_0x56f74a];return _0xd4391b;};'use strict';var _=require(_0xb8d1('0x0'));var util=require(_0xb8d1('0x1'));var moment=require(_0xb8d1('0x2'));var BPromise=require(_0xb8d1('0x3'));var rs=require(_0xb8d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8d1('0x5'))['db'];var utils=require(_0xb8d1('0x6'));var logger=require(_0xb8d1('0x7'))(_0xb8d1('0x8'));var config=require('../../config/environment');var jayson=require(_0xb8d1('0x9'));var client=jayson['client'][_0xb8d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ad19d,_0x4947f9,_0x116eac){return new BPromise(function(_0x1e7b4b,_0x1b57c7){return client[_0xb8d1('0xb')](_0x3ad19d,_0x116eac)[_0xb8d1('0xc')](function(_0x489147){logger[_0xb8d1('0xd')](_0xb8d1('0xe'),_0x4947f9,'request\x20sent');logger[_0xb8d1('0xf')](_0xb8d1('0x10'),_0x4947f9,_0xb8d1('0x11'),JSON[_0xb8d1('0x12')](_0x489147));if(_0x489147['error']){if(_0x489147[_0xb8d1('0x13')][_0xb8d1('0x14')]===0x1f4){logger[_0xb8d1('0x13')](_0xb8d1('0xe'),_0x4947f9,_0x489147[_0xb8d1('0x13')]['message']);return _0x1b57c7(_0x489147[_0xb8d1('0x13')][_0xb8d1('0x15')]);}logger[_0xb8d1('0x13')](_0xb8d1('0xe'),_0x4947f9,_0x489147[_0xb8d1('0x13')][_0xb8d1('0x15')]);return _0x1e7b4b(_0x489147[_0xb8d1('0x13')]['message']);}else{logger[_0xb8d1('0xd')](_0xb8d1('0xe'),_0x4947f9,_0xb8d1('0x11'));_0x1e7b4b(_0x489147[_0xb8d1('0x16')][_0xb8d1('0x15')]);}})[_0xb8d1('0x17')](function(_0x3375bc){logger[_0xb8d1('0x13')]('SalesforceField,\x20%s,\x20%s',_0x4947f9,_0x3375bc);_0x1b57c7(_0x3375bc);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d804a39..155022f 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 _0x7834=['create','addConfiguration','put','delete','/:id','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x534f9c,_0x18a669){var _0x2b7696=function(_0x33afb5){while(--_0x33afb5){_0x534f9c['push'](_0x534f9c['shift']());}};_0x2b7696(++_0x18a669);}(_0x7834,0x13f));var _0x4783=function(_0x385f77,_0x27f2a0){_0x385f77=_0x385f77-0x0;var _0x5b21c6=_0x7834[_0x385f77];return _0x5b21c6;};'use strict';var multer=require(_0x4783('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4783('0x1'));var express=require('express');var router=express[_0x4783('0x2')]();var fs_extra=require(_0x4783('0x3'));var auth=require(_0x4783('0x4'));var interaction=require(_0x4783('0x5'));var config=require(_0x4783('0x6'));var controller=require(_0x4783('0x7'));router[_0x4783('0x8')]('/',auth['isAuthenticated'](),controller[_0x4783('0x9')]);router[_0x4783('0x8')]('/:id',auth[_0x4783('0xa')](),controller[_0x4783('0xb')]);router[_0x4783('0x8')](_0x4783('0xc'),auth[_0x4783('0xa')](),controller[_0x4783('0xd')]);router['get'](_0x4783('0xe'),auth[_0x4783('0xa')](),controller[_0x4783('0xf')]);router[_0x4783('0x10')]('/',auth[_0x4783('0xa')](),controller[_0x4783('0x11')]);router[_0x4783('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4783('0x12')]);router[_0x4783('0x13')]('/:id',auth[_0x4783('0xa')](),controller['update']);router[_0x4783('0x14')](_0x4783('0x15'),auth[_0x4783('0xa')](),controller[_0x4783('0x16')]);module[_0x4783('0x17')]=router; \ No newline at end of file +var _0x2e21=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x58da9c,_0x109e4c){var _0x3916c7=function(_0xb1342){while(--_0xb1342){_0x58da9c['push'](_0x58da9c['shift']());}};_0x3916c7(++_0x109e4c);}(_0x2e21,0xba));var _0x12e2=function(_0x54e518,_0x25305f){_0x54e518=_0x54e518-0x0;var _0x50f7ab=_0x2e21[_0x54e518];return _0x50f7ab;};'use strict';var multer=require(_0x12e2('0x0'));var util=require(_0x12e2('0x1'));var path=require(_0x12e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x12e2('0x3'));var router=express['Router']();var fs_extra=require(_0x12e2('0x4'));var auth=require(_0x12e2('0x5'));var interaction=require(_0x12e2('0x6'));var config=require(_0x12e2('0x7'));var controller=require(_0x12e2('0x8'));router[_0x12e2('0x9')]('/',auth[_0x12e2('0xa')](),controller[_0x12e2('0xb')]);router[_0x12e2('0x9')](_0x12e2('0xc'),auth[_0x12e2('0xa')](),controller[_0x12e2('0xd')]);router['get'](_0x12e2('0xe'),auth['isAuthenticated'](),controller[_0x12e2('0xf')]);router['get'](_0x12e2('0x10'),auth[_0x12e2('0xa')](),controller[_0x12e2('0x11')]);router['post']('/',auth[_0x12e2('0xa')](),controller[_0x12e2('0x12')]);router['post'](_0x12e2('0xe'),auth['isAuthenticated'](),controller[_0x12e2('0x13')]);router['put'](_0x12e2('0xc'),auth[_0x12e2('0xa')](),controller[_0x12e2('0x14')]);router[_0x12e2('0x15')](_0x12e2('0xc'),auth[_0x12e2('0xa')](),controller[_0x12e2('0x16')]);module[_0x12e2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index baa4751..5daf6a7 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 _0x89b5=['remoteUri','sequelize','STRING'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x89b5,0x157));var _0x589b=function(_0x1a0405,_0x5f158e){_0x1a0405=_0x1a0405-0x0;var _0x1d165e=_0x89b5[_0x1a0405];return _0x1d165e;};'use strict';var Sequelize=require(_0x589b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x589b('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x589b('0x1')]},'email':{'type':Sequelize[_0x589b('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x589b('0x2')},'serverUrl':{'type':Sequelize[_0x589b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4308=['username','exports','STRING'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x4308,0x1ab));var _0x8430=function(_0x13e0e3,_0x3eb12e){_0x13e0e3=_0x13e0e3-0x0;var _0x3d89b8=_0x4308[_0x13e0e3];return _0x3d89b8;};'use strict';var Sequelize=require('sequelize');module[_0x8430('0x0')]={'name':{'type':Sequelize[_0x8430('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8430('0x1')],'unique':_0x8430('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8430('0x1')]},'remoteUri':{'type':Sequelize[_0x8430('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8430('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 f057f04..d0defe1 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 _0x4c4e=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','length','create','body','find','params','findOne','ServicenowConfiguration','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','approval_history','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','parent_incident','sys_id','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','sys_mod_count','reopen_count','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','GET','incident?sysparm_display_value=all','result','log','assign','remove','label','push','TCL:\x20_object','includes','forEach','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','True','true','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x4c4e,0x117));var _0xe4c4=function(_0x49aff7,_0x48f0b0){_0x49aff7=_0x49aff7-0x0;var _0x20c927=_0x4c4e[_0x49aff7];return _0x20c927;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require(_0xe4c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require('mustache');var util=require(_0xe4c4('0x5'));var path=require(_0xe4c4('0x6'));var sox=require(_0xe4c4('0x7'));var csv=require(_0xe4c4('0x8'));var ejs=require(_0xe4c4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0x8'));var querystring=require('querystring');var Papa=require(_0xe4c4('0xf'));var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))(_0xe4c4('0x16'));var utils=require('../../config/utils');var config=require(_0xe4c4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bd381,_0x59a7e4){_0x59a7e4=_0x59a7e4||0xcc;return function(_0x5f2e61){if(_0x5f2e61){return _0x3bd381[_0xe4c4('0x18')](_0x59a7e4);}return _0x3bd381[_0xe4c4('0x19')](_0x59a7e4)[_0xe4c4('0x1a')]();};}function respondWithResult(_0x3d2e37,_0x2816e8){_0x2816e8=_0x2816e8||0xc8;return function(_0x1d3419){if(_0x1d3419){return _0x3d2e37[_0xe4c4('0x19')](_0x2816e8)['json'](_0x1d3419);}};}function respondWithFilteredResult(_0x491d85,_0x290832){return function(_0x45cc7c){if(_0x45cc7c){var _0x977459=typeof _0x290832[_0xe4c4('0x1b')]===_0xe4c4('0x1c')&&typeof _0x290832[_0xe4c4('0x1d')]===_0xe4c4('0x1c');var _0x36f528=_0x45cc7c[_0xe4c4('0x1e')];var _0x3b6f1f=_0x977459?0x0:_0x290832[_0xe4c4('0x1b')];var _0x3bdc7a=_0x977459?_0x45cc7c[_0xe4c4('0x1e')]:_0x290832[_0xe4c4('0x1b')]+_0x290832[_0xe4c4('0x1d')];var _0x2e4ca2;if(_0x3bdc7a>=_0x36f528){_0x3bdc7a=_0x36f528;_0x2e4ca2=0xc8;}else{_0x2e4ca2=0xce;}_0x491d85[_0xe4c4('0x19')](_0x2e4ca2);return _0x491d85['set'](_0xe4c4('0x1f'),_0x3b6f1f+'-'+_0x3bdc7a+'/'+_0x36f528)['json'](_0x45cc7c);}return null;};}function patchUpdates(_0x3d1003){return function(_0x56770b){try{jsonpatch[_0xe4c4('0x20')](_0x56770b,_0x3d1003,!![]);}catch(_0x55f747){return BPromise[_0xe4c4('0x21')](_0x55f747);}return _0x56770b['save']();};}function saveUpdates(_0x396c25,_0x51c1a8){return function(_0x15e790){if(_0x15e790){return _0x15e790[_0xe4c4('0x22')](_0x396c25)['then'](function(_0x1a5dc5){return _0x1a5dc5;});}return null;};}function removeEntity(_0x4298de,_0x114346){return function(_0x3cd8a8){if(_0x3cd8a8){return _0x3cd8a8[_0xe4c4('0x23')]()[_0xe4c4('0x24')](function(){_0x4298de[_0xe4c4('0x19')](0xcc)[_0xe4c4('0x1a')]();});}};}function handleEntityNotFound(_0x5d84c1,_0xba2527){return function(_0x1c4e59){if(!_0x1c4e59){_0x5d84c1[_0xe4c4('0x18')](0x194);}return _0x1c4e59;};}function handleError(_0x215931,_0xf5cef3){_0xf5cef3=_0xf5cef3||0x1f4;return function(_0x504f5c){logger[_0xe4c4('0x25')](_0x504f5c[_0xe4c4('0x26')]);if(_0x504f5c['name']){delete _0x504f5c[_0xe4c4('0x27')];}_0x215931[_0xe4c4('0x19')](_0xf5cef3)[_0xe4c4('0x28')](_0x504f5c);};}exports[_0xe4c4('0x29')]=function(_0x5851e8,_0x3173ae){var _0x433822={},_0x1e4709={},_0x3eac0d={'count':0x0,'rows':[]};var _0xa5df56=_['map'](db[_0xe4c4('0x2a')][_0xe4c4('0x2b')],function(_0x795f55){return{'name':_0x795f55[_0xe4c4('0x2c')],'type':_0x795f55[_0xe4c4('0x2d')]['key']};});_0x1e4709[_0xe4c4('0x2e')]=_[_0xe4c4('0x2f')](_0xa5df56,_0xe4c4('0x27'));_0x1e4709[_0xe4c4('0x30')]=_[_0xe4c4('0x31')](_0x5851e8['query']);_0x1e4709['filters']=_[_0xe4c4('0x32')](_0x1e4709[_0xe4c4('0x2e')],_0x1e4709[_0xe4c4('0x30')]);_0x433822['attributes']=_[_0xe4c4('0x32')](_0x1e4709['model'],qs[_0xe4c4('0x33')](_0x5851e8[_0xe4c4('0x30')]['fields']));_0x433822[_0xe4c4('0x34')]=_0x433822['attributes']['length']?_0x433822['attributes']:_0x1e4709[_0xe4c4('0x2e')];if(!_0x5851e8['query'][_0xe4c4('0x35')]('nolimit')){_0x433822[_0xe4c4('0x1d')]=qs['limit'](_0x5851e8[_0xe4c4('0x30')][_0xe4c4('0x1d')]);_0x433822[_0xe4c4('0x1b')]=qs[_0xe4c4('0x1b')](_0x5851e8[_0xe4c4('0x30')][_0xe4c4('0x1b')]);}_0x433822[_0xe4c4('0x36')]=qs[_0xe4c4('0x37')](_0x5851e8[_0xe4c4('0x30')][_0xe4c4('0x37')]);_0x433822[_0xe4c4('0x38')]=qs[_0xe4c4('0x39')](_[_0xe4c4('0x3a')](_0x5851e8[_0xe4c4('0x30')],_0x1e4709['filters']),_0xa5df56);if(_0x5851e8[_0xe4c4('0x30')][_0xe4c4('0x3b')]){_0x433822[_0xe4c4('0x38')]=_[_0xe4c4('0x3c')](_0x433822['where'],{'$or':_[_0xe4c4('0x2f')](_0xa5df56,function(_0x134e30){if(_0x134e30['type']!==_0xe4c4('0x3d')){var _0x3106c1={};_0x3106c1[_0x134e30[_0xe4c4('0x27')]]={'$like':'%'+_0x5851e8['query']['filter']+'%'};return _0x3106c1;}})});}_0x433822=_[_0xe4c4('0x3c')]({},_0x433822,_0x5851e8[_0xe4c4('0x3e')]);var _0x27b275={'where':_0x433822[_0xe4c4('0x38')]};return db['ServicenowAccount'][_0xe4c4('0x1e')](_0x27b275)['then'](function(_0x5c8ee5){_0x3eac0d[_0xe4c4('0x1e')]=_0x5c8ee5;if(_0x5851e8[_0xe4c4('0x30')][_0xe4c4('0x3f')]){_0x433822[_0xe4c4('0x40')]=[{'all':!![]}];}return db[_0xe4c4('0x2a')]['findAll'](_0x433822);})['then'](function(_0x415a3c){_0x3eac0d[_0xe4c4('0x41')]=_0x415a3c;return _0x3eac0d;})[_0xe4c4('0x24')](respondWithFilteredResult(_0x3173ae,_0x433822))[_0xe4c4('0x42')](handleError(_0x3173ae,null));};exports['show']=function(_0x539b9a,_0x36d3d9){var _0x18e964={'raw':![],'where':{'id':_0x539b9a['params']['id']}},_0x10c5a5={};_0x10c5a5[_0xe4c4('0x2e')]=_['keys'](db[_0xe4c4('0x2a')][_0xe4c4('0x2b')]);_0x10c5a5[_0xe4c4('0x30')]=_['keys'](_0x539b9a[_0xe4c4('0x30')]);_0x10c5a5['filters']=_[_0xe4c4('0x32')](_0x10c5a5['model'],_0x10c5a5['query']);_0x18e964['attributes']=_[_0xe4c4('0x32')](_0x10c5a5[_0xe4c4('0x2e')],qs[_0xe4c4('0x33')](_0x539b9a['query']['fields']));_0x18e964[_0xe4c4('0x34')]=_0x18e964['attributes'][_0xe4c4('0x43')]?_0x18e964[_0xe4c4('0x34')]:_0x10c5a5['model'];if(_0x539b9a[_0xe4c4('0x30')][_0xe4c4('0x3f')]){_0x18e964[_0xe4c4('0x40')]=[{'all':!![]}];}_0x18e964=_[_0xe4c4('0x3c')]({},_0x18e964,_0x539b9a[_0xe4c4('0x3e')]);return db[_0xe4c4('0x2a')]['find'](_0x18e964)[_0xe4c4('0x24')](handleEntityNotFound(_0x36d3d9,null))[_0xe4c4('0x24')](respondWithResult(_0x36d3d9,null))[_0xe4c4('0x42')](handleError(_0x36d3d9,null));};exports[_0xe4c4('0x44')]=function(_0x1ac843,_0x11a908){return db[_0xe4c4('0x2a')][_0xe4c4('0x44')](_0x1ac843[_0xe4c4('0x45')],{})[_0xe4c4('0x24')](respondWithResult(_0x11a908,0xc9))[_0xe4c4('0x42')](handleError(_0x11a908,null));};exports[_0xe4c4('0x22')]=function(_0x16cc80,_0x573358){if(_0x16cc80[_0xe4c4('0x45')]['id']){delete _0x16cc80['body']['id'];}return db[_0xe4c4('0x2a')][_0xe4c4('0x46')]({'where':{'id':_0x16cc80[_0xe4c4('0x47')]['id']}})[_0xe4c4('0x24')](handleEntityNotFound(_0x573358,null))[_0xe4c4('0x24')](saveUpdates(_0x16cc80[_0xe4c4('0x45')],null))[_0xe4c4('0x24')](respondWithResult(_0x573358,null))[_0xe4c4('0x42')](handleError(_0x573358,null));};exports[_0xe4c4('0x23')]=function(_0x798aa3,_0xc958f7){return db[_0xe4c4('0x2a')][_0xe4c4('0x46')]({'where':{'id':_0x798aa3[_0xe4c4('0x47')]['id']}})[_0xe4c4('0x24')](handleEntityNotFound(_0xc958f7,null))['then'](removeEntity(_0xc958f7,null))[_0xe4c4('0x42')](handleError(_0xc958f7,null));};exports['getConfigurations']=function(_0x36950b,_0xb506c4,_0x4b8052){var _0x5e7268={};var _0xbf8895={};var _0x538bae;var _0x1b5873;return db['ServicenowAccount'][_0xe4c4('0x48')]({'where':{'id':_0x36950b[_0xe4c4('0x47')]['id']}})[_0xe4c4('0x24')](handleEntityNotFound(_0xb506c4,null))[_0xe4c4('0x24')](function(_0x2485b7){if(_0x2485b7){_0x538bae=_0x2485b7;_0xbf8895[_0xe4c4('0x2e')]=_[_0xe4c4('0x31')](db[_0xe4c4('0x49')][_0xe4c4('0x2b')]);_0xbf8895[_0xe4c4('0x30')]=_[_0xe4c4('0x31')](_0x36950b[_0xe4c4('0x30')]);_0xbf8895[_0xe4c4('0x39')]=_['intersection'](_0xbf8895[_0xe4c4('0x2e')],_0xbf8895[_0xe4c4('0x30')]);_0x5e7268[_0xe4c4('0x34')]=_[_0xe4c4('0x32')](_0xbf8895[_0xe4c4('0x2e')],qs[_0xe4c4('0x33')](_0x36950b[_0xe4c4('0x30')][_0xe4c4('0x33')]));_0x5e7268['attributes']=_0x5e7268[_0xe4c4('0x34')][_0xe4c4('0x43')]?_0x5e7268['attributes']:_0xbf8895['model'];_0x5e7268[_0xe4c4('0x36')]=qs[_0xe4c4('0x37')](_0x36950b['query'][_0xe4c4('0x37')]);_0x5e7268['where']=qs['filters'](_['pick'](_0x36950b['query'],_0xbf8895[_0xe4c4('0x39')]));if(_0x36950b['query'][_0xe4c4('0x3b')]){_0x5e7268[_0xe4c4('0x38')]=_[_0xe4c4('0x3c')](_0x5e7268[_0xe4c4('0x38')],{'$or':_[_0xe4c4('0x2f')](_0x5e7268['attributes'],function(_0x5365d9){var _0x434b55={};_0x434b55[_0x5365d9]={'$like':'%'+_0x36950b['query'][_0xe4c4('0x3b')]+'%'};return _0x434b55;})});}_0x5e7268=_['merge']({},_0x5e7268,_0x36950b[_0xe4c4('0x3e')]);return _0x538bae[_0xe4c4('0x4a')](_0x5e7268);}})[_0xe4c4('0x24')](function(_0x50b165){if(_0x50b165){_0x1b5873=_0x50b165[_0xe4c4('0x43')];if(!_0x36950b[_0xe4c4('0x30')][_0xe4c4('0x35')](_0xe4c4('0x4b'))){_0x5e7268[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x36950b[_0xe4c4('0x30')]['limit']);_0x5e7268[_0xe4c4('0x1b')]=qs[_0xe4c4('0x1b')](_0x36950b[_0xe4c4('0x30')][_0xe4c4('0x1b')]);}return _0x538bae['getConfigurations'](_0x5e7268);}})[_0xe4c4('0x24')](function(_0x251e38){if(_0x251e38){return _0x251e38?{'count':_0x1b5873,'rows':_0x251e38}:null;}})[_0xe4c4('0x24')](respondWithResult(_0xb506c4,null))[_0xe4c4('0x42')](handleError(_0xb506c4,null));};exports[_0xe4c4('0x4c')]=function(_0x3acddf,_0x2d6dac,_0x50c14e){if(_0x3acddf[_0xe4c4('0x45')]['id']){delete _0x3acddf[_0xe4c4('0x45')]['id'];}return db[_0xe4c4('0x2a')]['findOne']({'where':{'id':_0x3acddf[_0xe4c4('0x47')]['id']}})[_0xe4c4('0x24')](handleEntityNotFound(_0x2d6dac,null))[_0xe4c4('0x24')](function(_0x3fd5bf){if(_0x3fd5bf){_0x3acddf[_0xe4c4('0x45')]['AccountId']=_0x3fd5bf['id'];_0x3acddf['body'][_0xe4c4('0x4d')]=integrations[_0xe4c4('0x4e')](_0x3acddf[_0xe4c4('0x45')][_0xe4c4('0x4f')],_0x3acddf[_0xe4c4('0x45')][_0xe4c4('0x2d')]);_0x3acddf[_0xe4c4('0x45')][_0xe4c4('0x50')]=integrations[_0xe4c4('0x51')](_0x3acddf[_0xe4c4('0x45')][_0xe4c4('0x4f')],_0x3acddf['body']['type']);return db[_0xe4c4('0x49')][_0xe4c4('0x44')](_0x3acddf['body'],{'include':[{'model':db[_0xe4c4('0x52')],'as':_0xe4c4('0x4d')},{'model':db[_0xe4c4('0x52')],'as':_0xe4c4('0x50')}]});}return null;})[_0xe4c4('0x24')](respondWithResult(_0x2d6dac,null))[_0xe4c4('0x42')](handleError(_0x2d6dac,null));};exports[_0xe4c4('0x53')]=function(_0x1f88b5,_0x357422,_0x1243f4){var _0x1f5cd5=[_0xe4c4('0x54'),_0xe4c4('0x55'),_0xe4c4('0x56'),_0xe4c4('0x57'),_0xe4c4('0x58'),_0xe4c4('0x59'),_0xe4c4('0x5a'),_0xe4c4('0x5b'),_0xe4c4('0x5c')];var _0x304984=[_0xe4c4('0x5d'),_0xe4c4('0x54'),'caused_by','watch_list','upon_reject','sys_updated_on','child_incidents',_0xe4c4('0x55'),_0xe4c4('0x5e'),'number','resolved_by','sys_updated_by',_0xe4c4('0x5f'),_0xe4c4('0x60'),_0xe4c4('0x61'),_0xe4c4('0x62'),_0xe4c4('0x63'),_0xe4c4('0x64'),_0xe4c4('0x56'),_0xe4c4('0x36'),'calendar_stc',_0xe4c4('0x65'),_0xe4c4('0x66'),'delivery_plan',_0xe4c4('0x67'),_0xe4c4('0x68'),_0xe4c4('0x69'),_0xe4c4('0x6a'),_0xe4c4('0x6b'),_0xe4c4('0x6c'),_0xe4c4('0x6d'),_0xe4c4('0x6e'),'expected_start',_0xe4c4('0x6f'),_0xe4c4('0x70'),_0xe4c4('0x71'),'work_end',_0xe4c4('0x72'),_0xe4c4('0x73'),_0xe4c4('0x74'),'approval_set',_0xe4c4('0x57'),_0xe4c4('0x75'),'short_description',_0xe4c4('0x58'),_0xe4c4('0x76'),_0xe4c4('0x77'),_0xe4c4('0x78'),_0xe4c4('0x79'),_0xe4c4('0x7a'),'additional_assignee_list',_0xe4c4('0x7b'),'calendar_duration',_0xe4c4('0x59'),_0xe4c4('0x7c'),_0xe4c4('0x7d'),_0xe4c4('0x7e'),'follow_up',_0xe4c4('0x7f'),_0xe4c4('0x80'),'contact_type','reopened_by','incident_state','urgency',_0xe4c4('0x81'),_0xe4c4('0x82'),_0xe4c4('0x83'),_0xe4c4('0x84'),_0xe4c4('0x85'),'severity','comments',_0xe4c4('0x86'),_0xe4c4('0x87'),'comments_and_work_notes','due_date',_0xe4c4('0x88'),_0xe4c4('0x89'),'sys_tags','escalation','upon_approval','correlation_id',_0xe4c4('0x8a'),_0xe4c4('0x5c')];var _0x5844a9='';var _0x180f27='';var _0x4fbcef=[];var _0x6487e3='';var _0x3734b5='';var _0x4267a5=[];var _0x154b6c='';var _0xd64ef='';var _0x2eb1df={};var _0x192dbe='';return db[_0xe4c4('0x2a')][_0xe4c4('0x48')]({'where':{'id':_0x1f88b5['params']['id']},'attributes':['id',_0xe4c4('0x8b'),_0xe4c4('0x8c'),_0xe4c4('0x8d'),_0xe4c4('0x8e'),_0xe4c4('0x8f')]})['then'](handleEntityNotFound(_0x357422,null))['then'](function(_0x566365){if(_0x566365){_0x192dbe=_0x566365['remoteUri'];var _0x20cb80=_0x192dbe['slice'](-0x1);if(_0x20cb80==='/'){_0x192dbe=_0x192dbe[_0xe4c4('0x90')](0x0,_0x192dbe[_0xe4c4('0x91')](_0x20cb80));}_0xd64ef=util[_0xe4c4('0x92')]('%s/api/now/doc/table/schema/',_0x192dbe);_0x154b6c=util[_0xe4c4('0x92')]('%s/api/now/table/',_0x192dbe);_0x2eb1df={'user':_0x566365['username'],'pass':_0x566365[_0xe4c4('0x8c')]};var _0x14f333={'method':_0xe4c4('0x93'),'uri':_0xd64ef+_0xe4c4('0x94'),'auth':_0x2eb1df,'json':!![]};return rp(_0x14f333);}})[_0xe4c4('0x24')](function(_0xd36ddb){if(_0xd36ddb[_0xe4c4('0x95')]['length']>0x0){_0x5844a9=_0xd36ddb[_0xe4c4('0x95')];}console[_0xe4c4('0x96')]('incident\x20table\x20objects',_0x5844a9);_0x4267a5=[];_0x180f27=Object[_0xe4c4('0x97')]([],_0x5844a9);_[_0xe4c4('0x98')](_0x180f27,function(_0x4b2376){return!_0x1f5cd5['includes'](_0x4b2376[_0xe4c4('0x27')]);});_0x180f27['forEach'](function(_0x23938d){var _0x4aa378=createFieldObject(_0x154b6c,_0x2eb1df,_0x23938d['internalType'],_0x23938d['name'],_0x23938d[_0xe4c4('0x99')],![]);_0x4267a5[_0xe4c4('0x9a')](_0x4aa378);});return Promise['all'](_0x4267a5);})['then'](function(_0x5ec961){_0x4fbcef=_0x5ec961;_0x6487e3=Object['assign']([],_0x5844a9);console['log'](_0xe4c4('0x9b'),_0x5844a9);_[_0xe4c4('0x98')](_0x6487e3,function(_0x57882f){return _0x304984[_0xe4c4('0x9c')](_0x57882f[_0xe4c4('0x27')]);});console[_0xe4c4('0x96')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x6487e3);_0x4267a5=[];_0x6487e3[_0xe4c4('0x9d')](function(_0x37b215){var _0x331469=createFieldObject(_0x154b6c,_0x2eb1df,_0x37b215[_0xe4c4('0x9e')],_0x37b215[_0xe4c4('0x27')],_0x37b215[_0xe4c4('0x99')],!![]);_0x4267a5['push'](_0x331469);});return Promise['all'](_0x4267a5);})[_0xe4c4('0x24')](function(_0x326991){_0x3734b5=_0x326991;var _0x755e80=_0x4fbcef[_0xe4c4('0x9f')](_0x3734b5);return{'count':_0x755e80[_0xe4c4('0x43')],'rows':_0x755e80};})[_0xe4c4('0x24')](respondWithResult(_0x357422,null))[_0xe4c4('0x42')](function(_0x3af299){console[_0xe4c4('0x96')](_0xe4c4('0xa0')+_0x3af299);var _0x13f543=_0x1f88b5[_0xe4c4('0x30')][_0xe4c4('0xa1')]?0x1f4:_0x3af299[_0xe4c4('0xa2')]||0x1f4;logger[_0xe4c4('0x25')](_0x3af299[_0xe4c4('0x26')]);delete _0x3af299['name'];if(_0x13f543===0x191){_0x13f543=0x190;}_0x357422[_0xe4c4('0x19')](_0x13f543)[_0xe4c4('0x28')](_0x1f88b5['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3af299[_0xe4c4('0xa2')]}:_0x3af299);});};function createFieldObject(_0x648486,_0xb4f76d,_0xab1577,_0x3191e3,_0x559fb0,_0x3829e9){return new Promise(function(_0x3a6ec,_0x352097){var _0x367c21={'id':_0x3191e3,'name':_0x559fb0,'custom':_0x3829e9};if(_0xab1577==='boolean'){_0x367c21[_0xe4c4('0x3e')]=[{'name':_0xe4c4('0xa3'),'value':_0xe4c4('0xa4')},{'name':'False','value':'false'}];_0x3a6ec(_0x367c21);}else{var _0x4b066f={'method':_0xe4c4('0x93'),'uri':_0x648486+_0xe4c4('0xa5')+_0x3191e3,'auth':_0xb4f76d,'json':!![]};return rp(_0x4b066f)[_0xe4c4('0x24')](function(_0x5a5aa0){var _0x27f4a9=[];if(_0x5a5aa0['result'][_0xe4c4('0x43')]>0x0){_0x5a5aa0[_0xe4c4('0x95')][_0xe4c4('0x9d')](function(_0x149e8b){if(_0x149e8b['inactive']===_0xe4c4('0xa6')){var _0x484d17={'name':_0x149e8b[_0xe4c4('0x99')],'value':_0x149e8b[_0xe4c4('0xa7')]};_0x27f4a9[_0xe4c4('0x9a')](_0x484d17);}});}_0x367c21[_0xe4c4('0x3e')]=_0x27f4a9;if(_0x367c21['options'][_0xe4c4('0x43')]>0x0){_0x3a6ec(_0x367c21);}else{if(_0x3829e9==![]){_0x3a6ec();}else{_0x3a6ec(_0x367c21);}}});}});} \ No newline at end of file +var _0x707f=['slice','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','push','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','error','statusCode','true','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','sendStatus','stack','send','map','ServicenowAccount','rawAttributes','fieldName','type','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','include','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','Subjects','Descriptions','getDescriptions','channel','ServicenowField','subcategory','close_code','notify','incident_state','category','made_sla','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','reopened_time','resolved_at','caller_id','approval_set','work_notes','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','sla_due','approval','due_date','sys_mod_count','sys_tags','location','username','password','email','serverUrl','remoteUri'];(function(_0x3cf5ed,_0x259b80){var _0x1cb16e=function(_0x5de5c9){while(--_0x5de5c9){_0x3cf5ed['push'](_0x3cf5ed['shift']());}};_0x1cb16e(++_0x259b80);}(_0x707f,0xcd));var _0xf707=function(_0x75d3ce,_0x59c61d){_0x75d3ce=_0x75d3ce-0x0;var _0x1c96f8=_0x707f[_0x75d3ce];return _0x1c96f8;};'use strict';var emlformat=require(_0xf707('0x0'));var rimraf=require(_0xf707('0x1'));var zipdir=require(_0xf707('0x2'));var jsonpatch=require(_0xf707('0x3'));var rp=require(_0xf707('0x4'));var moment=require(_0xf707('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf707('0x6'));var util=require(_0xf707('0x7'));var path=require('path');var sox=require(_0xf707('0x8'));var csv=require(_0xf707('0x9'));var ejs=require(_0xf707('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf707('0xb'));var squel=require(_0xf707('0xc'));var crypto=require(_0xf707('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf707('0x9'));var querystring=require(_0xf707('0xe'));var Papa=require(_0xf707('0xf'));var Redis=require(_0xf707('0x10'));var authService=require(_0xf707('0x11'));var qs=require(_0xf707('0x12'));var as=require(_0xf707('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf707('0x14'));var utils=require(_0xf707('0x15'));var config=require(_0xf707('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf707('0x17'))['db'];var integrations=require(_0xf707('0x18'));function respondWithStatusCode(_0x290279,_0x4b88aa){_0x4b88aa=_0x4b88aa||0xcc;return function(_0x3610ad){if(_0x3610ad){return _0x290279['sendStatus'](_0x4b88aa);}return _0x290279[_0xf707('0x19')](_0x4b88aa)['end']();};}function respondWithResult(_0x10fd80,_0x1637d9){_0x1637d9=_0x1637d9||0xc8;return function(_0x198469){if(_0x198469){return _0x10fd80[_0xf707('0x19')](_0x1637d9)[_0xf707('0x1a')](_0x198469);}};}function respondWithFilteredResult(_0x507830,_0x18d4c6){return function(_0x4784bf){if(_0x4784bf){var _0x7ff58c=typeof _0x18d4c6[_0xf707('0x1b')]===_0xf707('0x1c')&&typeof _0x18d4c6[_0xf707('0x1d')]===_0xf707('0x1c');var _0x5789b6=_0x4784bf[_0xf707('0x1e')];var _0x50f417=_0x7ff58c?0x0:_0x18d4c6[_0xf707('0x1b')];var _0x401346=_0x7ff58c?_0x4784bf[_0xf707('0x1e')]:_0x18d4c6[_0xf707('0x1b')]+_0x18d4c6[_0xf707('0x1d')];var _0x2c7c53;if(_0x401346>=_0x5789b6){_0x401346=_0x5789b6;_0x2c7c53=0xc8;}else{_0x2c7c53=0xce;}_0x507830['status'](_0x2c7c53);return _0x507830[_0xf707('0x1f')]('Content-Range',_0x50f417+'-'+_0x401346+'/'+_0x5789b6)['json'](_0x4784bf);}return null;};}function patchUpdates(_0x5ab87f){return function(_0x3de731){try{jsonpatch[_0xf707('0x20')](_0x3de731,_0x5ab87f,!![]);}catch(_0x4ef8e8){return BPromise['reject'](_0x4ef8e8);}return _0x3de731[_0xf707('0x21')]();};}function saveUpdates(_0x486d12,_0x5383a0){return function(_0x35c7b7){if(_0x35c7b7){return _0x35c7b7[_0xf707('0x22')](_0x486d12)[_0xf707('0x23')](function(_0x2d7ac1){return _0x2d7ac1;});}return null;};}function removeEntity(_0xc6f14a,_0x57b0da){return function(_0x48f16b){if(_0x48f16b){return _0x48f16b['destroy']()[_0xf707('0x23')](function(){_0xc6f14a[_0xf707('0x19')](0xcc)[_0xf707('0x24')]();});}};}function handleEntityNotFound(_0x411e7b,_0x4be1ef){return function(_0x3f27d4){if(!_0x3f27d4){_0x411e7b[_0xf707('0x25')](0x194);}return _0x3f27d4;};}function handleError(_0x580008,_0x2f40db){_0x2f40db=_0x2f40db||0x1f4;return function(_0x545b89){logger['error'](_0x545b89[_0xf707('0x26')]);if(_0x545b89['name']){delete _0x545b89['name'];}_0x580008[_0xf707('0x19')](_0x2f40db)[_0xf707('0x27')](_0x545b89);};}exports['index']=function(_0x4243db,_0x2e6c3f){var _0x2b89b1={},_0x5eb1ac={},_0x17ec1e={'count':0x0,'rows':[]};var _0x4c2b9b=_[_0xf707('0x28')](db[_0xf707('0x29')][_0xf707('0x2a')],function(_0x28dd36){return{'name':_0x28dd36[_0xf707('0x2b')],'type':_0x28dd36[_0xf707('0x2c')]['key']};});_0x5eb1ac[_0xf707('0x2d')]=_[_0xf707('0x28')](_0x4c2b9b,_0xf707('0x2e'));_0x5eb1ac[_0xf707('0x2f')]=_['keys'](_0x4243db[_0xf707('0x2f')]);_0x5eb1ac[_0xf707('0x30')]=_['intersection'](_0x5eb1ac[_0xf707('0x2d')],_0x5eb1ac['query']);_0x2b89b1[_0xf707('0x31')]=_[_0xf707('0x32')](_0x5eb1ac[_0xf707('0x2d')],qs[_0xf707('0x33')](_0x4243db[_0xf707('0x2f')][_0xf707('0x33')]));_0x2b89b1[_0xf707('0x31')]=_0x2b89b1['attributes'][_0xf707('0x34')]?_0x2b89b1[_0xf707('0x31')]:_0x5eb1ac[_0xf707('0x2d')];if(!_0x4243db[_0xf707('0x2f')][_0xf707('0x35')](_0xf707('0x36'))){_0x2b89b1[_0xf707('0x1d')]=qs['limit'](_0x4243db[_0xf707('0x2f')][_0xf707('0x1d')]);_0x2b89b1['offset']=qs[_0xf707('0x1b')](_0x4243db[_0xf707('0x2f')][_0xf707('0x1b')]);}_0x2b89b1[_0xf707('0x37')]=qs[_0xf707('0x38')](_0x4243db['query'][_0xf707('0x38')]);_0x2b89b1[_0xf707('0x39')]=qs[_0xf707('0x30')](_[_0xf707('0x3a')](_0x4243db[_0xf707('0x2f')],_0x5eb1ac[_0xf707('0x30')]),_0x4c2b9b);if(_0x4243db[_0xf707('0x2f')][_0xf707('0x3b')]){_0x2b89b1[_0xf707('0x39')]=_[_0xf707('0x3c')](_0x2b89b1[_0xf707('0x39')],{'$or':_[_0xf707('0x28')](_0x4c2b9b,function(_0x151d4e){if(_0x151d4e[_0xf707('0x2c')]!==_0xf707('0x3d')){var _0xf1e6c3={};_0xf1e6c3[_0x151d4e[_0xf707('0x2e')]]={'$like':'%'+_0x4243db[_0xf707('0x2f')][_0xf707('0x3b')]+'%'};return _0xf1e6c3;}})});}_0x2b89b1=_[_0xf707('0x3c')]({},_0x2b89b1,_0x4243db[_0xf707('0x3e')]);var _0x2e7f8f={'where':_0x2b89b1[_0xf707('0x39')]};return db[_0xf707('0x29')][_0xf707('0x1e')](_0x2e7f8f)['then'](function(_0x69d64f){_0x17ec1e[_0xf707('0x1e')]=_0x69d64f;if(_0x4243db[_0xf707('0x2f')]['includeAll']){_0x2b89b1['include']=[{'all':!![]}];}return db[_0xf707('0x29')][_0xf707('0x3f')](_0x2b89b1);})[_0xf707('0x23')](function(_0x1ae998){_0x17ec1e[_0xf707('0x40')]=_0x1ae998;return _0x17ec1e;})['then'](respondWithFilteredResult(_0x2e6c3f,_0x2b89b1))[_0xf707('0x41')](handleError(_0x2e6c3f,null));};exports[_0xf707('0x42')]=function(_0x5f4009,_0x5452bf){var _0x32d738={'raw':![],'where':{'id':_0x5f4009[_0xf707('0x43')]['id']}},_0x321460={};_0x321460[_0xf707('0x2d')]=_[_0xf707('0x44')](db[_0xf707('0x29')]['rawAttributes']);_0x321460[_0xf707('0x2f')]=_[_0xf707('0x44')](_0x5f4009[_0xf707('0x2f')]);_0x321460[_0xf707('0x30')]=_[_0xf707('0x32')](_0x321460[_0xf707('0x2d')],_0x321460[_0xf707('0x2f')]);_0x32d738['attributes']=_[_0xf707('0x32')](_0x321460[_0xf707('0x2d')],qs['fields'](_0x5f4009[_0xf707('0x2f')][_0xf707('0x33')]));_0x32d738[_0xf707('0x31')]=_0x32d738[_0xf707('0x31')][_0xf707('0x34')]?_0x32d738[_0xf707('0x31')]:_0x321460['model'];if(_0x5f4009[_0xf707('0x2f')]['includeAll']){_0x32d738[_0xf707('0x45')]=[{'all':!![]}];}_0x32d738=_['merge']({},_0x32d738,_0x5f4009[_0xf707('0x3e')]);return db[_0xf707('0x29')][_0xf707('0x46')](_0x32d738)['then'](handleEntityNotFound(_0x5452bf,null))[_0xf707('0x23')](respondWithResult(_0x5452bf,null))[_0xf707('0x41')](handleError(_0x5452bf,null));};exports[_0xf707('0x47')]=function(_0x59a50e,_0x4c785c){return db[_0xf707('0x29')][_0xf707('0x47')](_0x59a50e[_0xf707('0x48')],{})[_0xf707('0x23')](respondWithResult(_0x4c785c,0xc9))[_0xf707('0x41')](handleError(_0x4c785c,null));};exports[_0xf707('0x22')]=function(_0x202f43,_0x447fe1){if(_0x202f43['body']['id']){delete _0x202f43[_0xf707('0x48')]['id'];}return db[_0xf707('0x29')]['find']({'where':{'id':_0x202f43['params']['id']}})[_0xf707('0x23')](handleEntityNotFound(_0x447fe1,null))[_0xf707('0x23')](saveUpdates(_0x202f43[_0xf707('0x48')],null))['then'](respondWithResult(_0x447fe1,null))[_0xf707('0x41')](handleError(_0x447fe1,null));};exports['destroy']=function(_0x40c3e1,_0x24005b){return db[_0xf707('0x29')][_0xf707('0x46')]({'where':{'id':_0x40c3e1[_0xf707('0x43')]['id']}})[_0xf707('0x23')](handleEntityNotFound(_0x24005b,null))[_0xf707('0x23')](removeEntity(_0x24005b,null))['catch'](handleError(_0x24005b,null));};exports[_0xf707('0x49')]=function(_0x2658e4,_0x4b3162,_0x14c544){var _0xfa7310={};var _0x2a6a8b={};var _0x47d759;var _0x585198;return db[_0xf707('0x29')][_0xf707('0x4a')]({'where':{'id':_0x2658e4[_0xf707('0x43')]['id']}})[_0xf707('0x23')](handleEntityNotFound(_0x4b3162,null))[_0xf707('0x23')](function(_0x16d10f){if(_0x16d10f){_0x47d759=_0x16d10f;_0x2a6a8b['model']=_[_0xf707('0x44')](db[_0xf707('0x4b')]['rawAttributes']);_0x2a6a8b['query']=_['keys'](_0x2658e4[_0xf707('0x2f')]);_0x2a6a8b['filters']=_[_0xf707('0x32')](_0x2a6a8b[_0xf707('0x2d')],_0x2a6a8b[_0xf707('0x2f')]);_0xfa7310[_0xf707('0x31')]=_[_0xf707('0x32')](_0x2a6a8b['model'],qs[_0xf707('0x33')](_0x2658e4['query'][_0xf707('0x33')]));_0xfa7310[_0xf707('0x31')]=_0xfa7310[_0xf707('0x31')][_0xf707('0x34')]?_0xfa7310[_0xf707('0x31')]:_0x2a6a8b['model'];_0xfa7310[_0xf707('0x37')]=qs[_0xf707('0x38')](_0x2658e4[_0xf707('0x2f')][_0xf707('0x38')]);_0xfa7310[_0xf707('0x39')]=qs[_0xf707('0x30')](_[_0xf707('0x3a')](_0x2658e4[_0xf707('0x2f')],_0x2a6a8b['filters']));if(_0x2658e4['query'][_0xf707('0x3b')]){_0xfa7310[_0xf707('0x39')]=_[_0xf707('0x3c')](_0xfa7310['where'],{'$or':_[_0xf707('0x28')](_0xfa7310[_0xf707('0x31')],function(_0x2d594c){var _0x37596f={};_0x37596f[_0x2d594c]={'$like':'%'+_0x2658e4[_0xf707('0x2f')][_0xf707('0x3b')]+'%'};return _0x37596f;})});}_0xfa7310=_[_0xf707('0x3c')]({},_0xfa7310,_0x2658e4[_0xf707('0x3e')]);return _0x47d759[_0xf707('0x49')](_0xfa7310);}})['then'](function(_0x3ad417){if(_0x3ad417){_0x585198=_0x3ad417[_0xf707('0x34')];if(!_0x2658e4[_0xf707('0x2f')][_0xf707('0x35')](_0xf707('0x36'))){_0xfa7310[_0xf707('0x1d')]=qs['limit'](_0x2658e4[_0xf707('0x2f')][_0xf707('0x1d')]);_0xfa7310['offset']=qs[_0xf707('0x1b')](_0x2658e4[_0xf707('0x2f')][_0xf707('0x1b')]);}return _0x47d759['getConfigurations'](_0xfa7310);}})[_0xf707('0x23')](function(_0x4ed485){if(_0x4ed485){return _0x4ed485?{'count':_0x585198,'rows':_0x4ed485}:null;}})[_0xf707('0x23')](respondWithResult(_0x4b3162,null))[_0xf707('0x41')](handleError(_0x4b3162,null));};exports[_0xf707('0x4c')]=function(_0x30344b,_0x1bc4ef,_0xdca535){if(_0x30344b[_0xf707('0x48')]['id']){delete _0x30344b[_0xf707('0x48')]['id'];}return db['ServicenowAccount'][_0xf707('0x4a')]({'where':{'id':_0x30344b[_0xf707('0x43')]['id']}})[_0xf707('0x23')](handleEntityNotFound(_0x1bc4ef,null))[_0xf707('0x23')](function(_0xf5f5c0){if(_0xf5f5c0){_0x30344b['body']['AccountId']=_0xf5f5c0['id'];_0x30344b['body'][_0xf707('0x4d')]=integrations['getSubjects'](_0x30344b['body']['channel'],_0x30344b[_0xf707('0x48')]['type']);_0x30344b['body'][_0xf707('0x4e')]=integrations[_0xf707('0x4f')](_0x30344b[_0xf707('0x48')][_0xf707('0x50')],_0x30344b['body'][_0xf707('0x2c')]);return db[_0xf707('0x4b')]['create'](_0x30344b['body'],{'include':[{'model':db['ServicenowField'],'as':_0xf707('0x4d')},{'model':db[_0xf707('0x51')],'as':_0xf707('0x4e')}]});}return null;})[_0xf707('0x23')](respondWithResult(_0x1bc4ef,null))[_0xf707('0x41')](handleError(_0x1bc4ef,null));};exports['getFields']=function(_0x2824c4,_0x5ec58c,_0x50cdc1){var _0x41c686=['made_sla','hold_reason','knowledge',_0xf707('0x52'),_0xf707('0x53'),_0xf707('0x54'),_0xf707('0x55'),'severity',_0xf707('0x56')];var _0x2005b9=['parent',_0xf707('0x57'),'caused_by',_0xf707('0x58'),_0xf707('0x59'),_0xf707('0x5a'),_0xf707('0x5b'),_0xf707('0x5c'),_0xf707('0x5d'),_0xf707('0x5e'),_0xf707('0x5f'),_0xf707('0x60'),'opened_by',_0xf707('0x61'),_0xf707('0x62'),_0xf707('0x63'),_0xf707('0x64'),'sys_created_by','knowledge',_0xf707('0x37'),_0xf707('0x65'),'closed_at',_0xf707('0x66'),_0xf707('0x67'),_0xf707('0x68'),_0xf707('0x69'),_0xf707('0x6a'),_0xf707('0x6b'),_0xf707('0x6c'),_0xf707('0x6d'),_0xf707('0x6e'),_0xf707('0x6f'),_0xf707('0x70'),'opened_at',_0xf707('0x71'),'group_list','work_end',_0xf707('0x72'),_0xf707('0x73'),_0xf707('0x74'),_0xf707('0x75'),'subcategory',_0xf707('0x76'),'short_description',_0xf707('0x53'),'correlation_display',_0xf707('0x77'),_0xf707('0x78'),_0xf707('0x79'),'business_stc',_0xf707('0x7a'),_0xf707('0x7b'),_0xf707('0x7c'),_0xf707('0x54'),_0xf707('0x7d'),_0xf707('0x7e'),'closed_by','follow_up',_0xf707('0x7f'),_0xf707('0x80'),_0xf707('0x81'),_0xf707('0x82'),_0xf707('0x55'),_0xf707('0x83'),_0xf707('0x84'),_0xf707('0x85'),_0xf707('0x86'),_0xf707('0x87'),_0xf707('0x88'),_0xf707('0x89'),'comments',_0xf707('0x8a'),_0xf707('0x8b'),'comments_and_work_notes',_0xf707('0x8c'),_0xf707('0x8d'),'reopen_count',_0xf707('0x8e'),'escalation','upon_approval','correlation_id',_0xf707('0x8f'),_0xf707('0x56')];var _0x4b37fb='';var _0x47bc1d='';var _0x353a25=[];var _0x4c579e='';var _0x492fa1='';var _0x5469b1=[];var _0x31fc82='';var _0x5677d6='';var _0x11a15f={};var _0x4dd51a='';return db[_0xf707('0x29')][_0xf707('0x4a')]({'where':{'id':_0x2824c4[_0xf707('0x43')]['id']},'attributes':['id',_0xf707('0x90'),_0xf707('0x91'),_0xf707('0x92'),'remoteUri',_0xf707('0x93')]})['then'](handleEntityNotFound(_0x5ec58c,null))['then'](function(_0x2b195f){if(_0x2b195f){_0x4dd51a=_0x2b195f[_0xf707('0x94')];var _0x72a1d=_0x4dd51a[_0xf707('0x95')](-0x1);if(_0x72a1d==='/'){_0x4dd51a=_0x4dd51a['substring'](0x0,_0x4dd51a['lastIndexOf'](_0x72a1d));}_0x5677d6=util['format'](_0xf707('0x96'),_0x4dd51a);_0x31fc82=util[_0xf707('0x97')](_0xf707('0x98'),_0x4dd51a);_0x11a15f={'user':_0x2b195f[_0xf707('0x90')],'pass':_0x2b195f['password']};var _0x3577f3={'method':_0xf707('0x99'),'uri':_0x5677d6+_0xf707('0x9a'),'auth':_0x11a15f,'json':!![]};return rp(_0x3577f3);}})[_0xf707('0x23')](function(_0x106a92){if(_0x106a92['result'][_0xf707('0x34')]>0x0){_0x4b37fb=_0x106a92[_0xf707('0x9b')];}console[_0xf707('0x9c')](_0xf707('0x9d'),_0x4b37fb);_0x5469b1=[];_0x47bc1d=Object['assign']([],_0x4b37fb);_[_0xf707('0x9e')](_0x47bc1d,function(_0x5770e5){return!_0x41c686[_0xf707('0x9f')](_0x5770e5[_0xf707('0x2e')]);});_0x47bc1d[_0xf707('0xa0')](function(_0x263062){var _0x4a7115=createFieldObject(_0x31fc82,_0x11a15f,_0x263062[_0xf707('0xa1')],_0x263062[_0xf707('0x2e')],_0x263062['label'],![]);_0x5469b1[_0xf707('0xa2')](_0x4a7115);});return Promise[_0xf707('0xa3')](_0x5469b1);})[_0xf707('0x23')](function(_0xc4b77b){_0x353a25=_0xc4b77b;_0x4c579e=Object[_0xf707('0xa4')]([],_0x4b37fb);console['log']('TCL:\x20_object',_0x4b37fb);_[_0xf707('0x9e')](_0x4c579e,function(_0x43b054){return _0x2005b9['includes'](_0x43b054[_0xf707('0x2e')]);});console[_0xf707('0x9c')](_0xf707('0xa5'),_0x4c579e);_0x5469b1=[];_0x4c579e['forEach'](function(_0x562ed8){var _0x2008b5=createFieldObject(_0x31fc82,_0x11a15f,_0x562ed8['internalType'],_0x562ed8[_0xf707('0x2e')],_0x562ed8[_0xf707('0xa6')],!![]);_0x5469b1[_0xf707('0xa2')](_0x2008b5);});return Promise['all'](_0x5469b1);})[_0xf707('0x23')](function(_0x5c1976){_0x492fa1=_0x5c1976;var _0x108510=_0x353a25[_0xf707('0xa7')](_0x492fa1);return{'count':_0x108510[_0xf707('0x34')],'rows':_0x108510};})[_0xf707('0x23')](respondWithResult(_0x5ec58c,null))['catch'](function(_0x294a3d){console['log'](_0xf707('0xa8')+_0x294a3d);var _0x21137a=_0x2824c4[_0xf707('0x2f')][_0xf707('0xa9')]?0x1f4:_0x294a3d['statusCode']||0x1f4;logger[_0xf707('0xaa')](_0x294a3d[_0xf707('0x26')]);delete _0x294a3d[_0xf707('0x2e')];if(_0x21137a===0x191){_0x21137a=0x190;}_0x5ec58c[_0xf707('0x19')](_0x21137a)[_0xf707('0x27')](_0x2824c4[_0xf707('0x2f')][_0xf707('0xa9')]?{'message':'Wrong\x20credentials','statusCode':_0x294a3d[_0xf707('0xab')]}:_0x294a3d);});};function createFieldObject(_0x37e936,_0xd4c4f1,_0x29f1ee,_0x35eb0f,_0x32ef87,_0x20a0f4){return new Promise(function(_0x54b360,_0x2fc0a0){var _0x3a8058={'id':_0x35eb0f,'name':_0x32ef87,'custom':_0x20a0f4};if(_0x29f1ee==='boolean'){_0x3a8058['options']=[{'name':'True','value':_0xf707('0xac')},{'name':'False','value':'false'}];_0x54b360(_0x3a8058);}else{var _0x80e7c0={'method':'GET','uri':_0x37e936+_0xf707('0xad')+_0x35eb0f,'auth':_0xd4c4f1,'json':!![]};return rp(_0x80e7c0)[_0xf707('0x23')](function(_0x36d897){var _0x11069b=[];if(_0x36d897[_0xf707('0x9b')][_0xf707('0x34')]>0x0){_0x36d897[_0xf707('0x9b')][_0xf707('0xa0')](function(_0x48995e){if(_0x48995e[_0xf707('0xae')]===_0xf707('0xaf')){var _0x26c5ce={'name':_0x48995e[_0xf707('0xa6')],'value':_0x48995e[_0xf707('0xb0')]};_0x11069b[_0xf707('0xa2')](_0x26c5ce);}});}_0x3a8058[_0xf707('0x3e')]=_0x11069b;if(_0x3a8058[_0xf707('0x3e')][_0xf707('0x34')]>0x0){_0x54b360(_0x3a8058);}else{if(_0x20a0f4==![]){_0x54b360();}else{_0x54b360(_0x3a8058);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 357b157..634719e 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 _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','int_servicenow_accounts','util'];(function(_0x13c174,_0xda25fe){var _0x160654=function(_0x1b6ac2){while(--_0x1b6ac2){_0x13c174['push'](_0x13c174['shift']());}};_0x160654(++_0xda25fe);}(_0x6f47,0xc7));var _0x76f4=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x6f47[_0x3c2a69];return _0x596bc8;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));var integrations=require(_0x76f4('0x7'));module['exports']=function(_0x35602f,_0xfc2405){return _0x35602f[_0x76f4('0x8')]('ServicenowAccount',attributes,{'tableName':_0x76f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0x160e65,_0x43013c){var _0x5735de=function(_0x56f82e){while(--_0x56f82e){_0x160e65['push'](_0x160e65['shift']());}};_0x5735de(++_0x43013c);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('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 d1e1122..e7e67a0 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 _0x84ce=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','GetServicenowAccount','findAll','raw','options','where','attributes','limit','include','model','catch','ShowServicenowAccount','ServicenowAccount','find','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x84ce,0xb7));var _0xe84c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x84ce[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe84c('0x0'));var util=require(_0xe84c('0x1'));var moment=require(_0xe84c('0x2'));var BPromise=require(_0xe84c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe84c('0x4'));var db=require(_0xe84c('0x5'))['db'];var utils=require(_0xe84c('0x6'));var logger=require(_0xe84c('0x7'))(_0xe84c('0x8'));var config=require(_0xe84c('0x9'));var jayson=require(_0xe84c('0xa'));var client=jayson[_0xe84c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12311e,_0x194d5e,_0x342686){return new BPromise(function(_0x35b290,_0x284f16){return client[_0xe84c('0xc')](_0x12311e,_0x342686)[_0xe84c('0xd')](function(_0x1de708){logger[_0xe84c('0xe')](_0xe84c('0xf'),_0x194d5e,_0xe84c('0x10'));logger[_0xe84c('0x11')](_0xe84c('0x12'),_0x194d5e,'request\x20sent',JSON[_0xe84c('0x13')](_0x1de708));if(_0x1de708[_0xe84c('0x14')]){if(_0x1de708[_0xe84c('0x14')][_0xe84c('0x15')]===0x1f4){logger[_0xe84c('0x14')](_0xe84c('0xf'),_0x194d5e,_0x1de708[_0xe84c('0x14')]['message']);return _0x284f16(_0x1de708[_0xe84c('0x14')]['message']);}logger[_0xe84c('0x14')](_0xe84c('0xf'),_0x194d5e,_0x1de708[_0xe84c('0x14')]['message']);return _0x35b290(_0x1de708[_0xe84c('0x14')]['message']);}else{logger['info'](_0xe84c('0xf'),_0x194d5e,_0xe84c('0x10'));_0x35b290(_0x1de708[_0xe84c('0x16')][_0xe84c('0x17')]);}})['catch'](function(_0x1052df){logger['error'](_0xe84c('0xf'),_0x194d5e,_0x1052df);_0x284f16(_0x1052df);});});}exports[_0xe84c('0x18')]=function(_0x2470b2){var _0x4b5f96=this;return new Promise(function(_0x9dd0f4,_0x185927){return db['ServicenowAccount'][_0xe84c('0x19')]({'raw':_0x2470b2['options']?_0x2470b2['options'][_0xe84c('0x1a')]===undefined?!![]:![]:!![],'where':_0x2470b2[_0xe84c('0x1b')]?_0x2470b2[_0xe84c('0x1b')][_0xe84c('0x1c')]||null:null,'attributes':_0x2470b2[_0xe84c('0x1b')]?_0x2470b2[_0xe84c('0x1b')][_0xe84c('0x1d')]||null:null,'limit':_0x2470b2['options']?_0x2470b2[_0xe84c('0x1b')][_0xe84c('0x1e')]||null:null,'include':_0x2470b2[_0xe84c('0x1b')]?_0x2470b2['options'][_0xe84c('0x1f')]?_['map'](_0x2470b2[_0xe84c('0x1b')][_0xe84c('0x1f')],function(_0x30f450){return{'model':db[_0x30f450[_0xe84c('0x20')]],'as':_0x30f450['as'],'attributes':_0x30f450[_0xe84c('0x1d')],'include':_0x30f450[_0xe84c('0x1f')]?_['map'](_0x30f450['include'],function(_0x417f1f){return{'model':db[_0x417f1f[_0xe84c('0x20')]],'as':_0x417f1f['as'],'attributes':_0x417f1f[_0xe84c('0x1d')],'include':_0x417f1f[_0xe84c('0x1f')]?_['map'](_0x417f1f[_0xe84c('0x1f')],function(_0x8704ef){return{'model':db[_0x8704ef[_0xe84c('0x20')]],'as':_0x8704ef['as'],'attributes':_0x8704ef[_0xe84c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cd374){logger[_0xe84c('0xe')](_0xe84c('0x18'),_0x2470b2);logger[_0xe84c('0x11')](_0xe84c('0x18'),_0x2470b2,JSON['stringify'](_0x1cd374));_0x9dd0f4(_0x1cd374);})[_0xe84c('0x21')](function(_0x3cfc99){logger[_0xe84c('0x14')]('GetServicenowAccount',_0x3cfc99[_0xe84c('0x17')],_0x2470b2);_0x185927(_0x4b5f96[_0xe84c('0x14')](0x1f4,_0x3cfc99[_0xe84c('0x17')]));});});};exports[_0xe84c('0x22')]=function(_0x492ed1){var _0x224bf8=this;return new Promise(function(_0x287e5b,_0x4f4653){return db[_0xe84c('0x23')][_0xe84c('0x24')]({'raw':_0x492ed1[_0xe84c('0x1b')]?_0x492ed1[_0xe84c('0x1b')][_0xe84c('0x1a')]===undefined?!![]:![]:!![],'where':_0x492ed1[_0xe84c('0x1b')]?_0x492ed1[_0xe84c('0x1b')][_0xe84c('0x1c')]||null:null,'attributes':_0x492ed1['options']?_0x492ed1[_0xe84c('0x1b')][_0xe84c('0x1d')]||null:null,'include':_0x492ed1[_0xe84c('0x1b')]?_0x492ed1['options'][_0xe84c('0x1f')]?_[_0xe84c('0x25')](_0x492ed1['options'][_0xe84c('0x1f')],function(_0x45ff8a){return{'model':db[_0x45ff8a['model']],'as':_0x45ff8a['as'],'attributes':_0x45ff8a[_0xe84c('0x1d')],'include':_0x45ff8a[_0xe84c('0x1f')]?_[_0xe84c('0x25')](_0x45ff8a[_0xe84c('0x1f')],function(_0x5dd98d){return{'model':db[_0x5dd98d[_0xe84c('0x20')]],'as':_0x5dd98d['as'],'attributes':_0x5dd98d['attributes'],'include':_0x5dd98d[_0xe84c('0x1f')]?_[_0xe84c('0x25')](_0x5dd98d['include'],function(_0x1d00b4){return{'model':db[_0x1d00b4[_0xe84c('0x20')]],'as':_0x1d00b4['as'],'attributes':_0x1d00b4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3923d9){logger[_0xe84c('0xe')](_0xe84c('0x22'),_0x492ed1);logger['debug'](_0xe84c('0x22'),_0x492ed1,JSON[_0xe84c('0x13')](_0x3923d9));_0x287e5b(_0x3923d9);})[_0xe84c('0x21')](function(_0x32682b){logger['error'](_0xe84c('0x22'),_0x32682b[_0xe84c('0x17')],_0x492ed1);_0x4f4653(_0x224bf8[_0xe84c('0x14')](0x1f4,_0x32682b['message']));});});}; \ No newline at end of file +var _0x303e=['where','attributes','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ServicenowAccount','options'];(function(_0x595708,_0x562f8f){var _0x486ce2=function(_0x4cf7ea){while(--_0x4cf7ea){_0x595708['push'](_0x595708['shift']());}};_0x486ce2(++_0x562f8f);}(_0x303e,0x195));var _0xe303=function(_0x31a5dc,_0x4946fa){_0x31a5dc=_0x31a5dc-0x0;var _0x78723c=_0x303e[_0x31a5dc];return _0x78723c;};'use strict';var _=require(_0xe303('0x0'));var util=require('util');var moment=require(_0xe303('0x1'));var BPromise=require('bluebird');var rs=require(_0xe303('0x2'));var fs=require('fs');var Redis=require(_0xe303('0x3'));var db=require(_0xe303('0x4'))['db'];var utils=require(_0xe303('0x5'));var logger=require(_0xe303('0x6'))('rpc');var config=require(_0xe303('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe303('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38df4f,_0x4d2acb,_0x9823e6){return new BPromise(function(_0x2b6268,_0x545687){return client[_0xe303('0x9')](_0x38df4f,_0x9823e6)[_0xe303('0xa')](function(_0x4be038){logger['info'](_0xe303('0xb'),_0x4d2acb,_0xe303('0xc'));logger[_0xe303('0xd')](_0xe303('0xe'),_0x4d2acb,'request\x20sent',JSON[_0xe303('0xf')](_0x4be038));if(_0x4be038[_0xe303('0x10')]){if(_0x4be038[_0xe303('0x10')][_0xe303('0x11')]===0x1f4){logger[_0xe303('0x10')](_0xe303('0xb'),_0x4d2acb,_0x4be038[_0xe303('0x10')][_0xe303('0x12')]);return _0x545687(_0x4be038[_0xe303('0x10')][_0xe303('0x12')]);}logger[_0xe303('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4d2acb,_0x4be038[_0xe303('0x10')][_0xe303('0x12')]);return _0x2b6268(_0x4be038[_0xe303('0x10')][_0xe303('0x12')]);}else{logger[_0xe303('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x4d2acb,_0xe303('0xc'));_0x2b6268(_0x4be038[_0xe303('0x14')]['message']);}})[_0xe303('0x15')](function(_0x1f6c2f){logger[_0xe303('0x10')](_0xe303('0xb'),_0x4d2acb,_0x1f6c2f);_0x545687(_0x1f6c2f);});});}exports['GetServicenowAccount']=function(_0x506c8b){var _0x38c2af=this;return new Promise(function(_0x5d5d59,_0x26ab2d){return db[_0xe303('0x16')]['findAll']({'raw':_0x506c8b[_0xe303('0x17')]?_0x506c8b[_0xe303('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x506c8b[_0xe303('0x17')]?_0x506c8b[_0xe303('0x17')][_0xe303('0x18')]||null:null,'attributes':_0x506c8b[_0xe303('0x17')]?_0x506c8b['options'][_0xe303('0x19')]||null:null,'limit':_0x506c8b['options']?_0x506c8b[_0xe303('0x17')]['limit']||null:null,'include':_0x506c8b[_0xe303('0x17')]?_0x506c8b['options'][_0xe303('0x1a')]?_['map'](_0x506c8b[_0xe303('0x17')]['include'],function(_0x54da37){return{'model':db[_0x54da37['model']],'as':_0x54da37['as'],'attributes':_0x54da37[_0xe303('0x19')],'include':_0x54da37[_0xe303('0x1a')]?_[_0xe303('0x1b')](_0x54da37[_0xe303('0x1a')],function(_0x1a1cd4){return{'model':db[_0x1a1cd4[_0xe303('0x1c')]],'as':_0x1a1cd4['as'],'attributes':_0x1a1cd4[_0xe303('0x19')],'include':_0x1a1cd4['include']?_['map'](_0x1a1cd4[_0xe303('0x1a')],function(_0x47a328){return{'model':db[_0x47a328['model']],'as':_0x47a328['as'],'attributes':_0x47a328[_0xe303('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe303('0xa')](function(_0x349c0a){logger[_0xe303('0x13')](_0xe303('0x1d'),_0x506c8b);logger[_0xe303('0xd')](_0xe303('0x1d'),_0x506c8b,JSON[_0xe303('0xf')](_0x349c0a));_0x5d5d59(_0x349c0a);})[_0xe303('0x15')](function(_0x453033){logger['error'](_0xe303('0x1d'),_0x453033[_0xe303('0x12')],_0x506c8b);_0x26ab2d(_0x38c2af['error'](0x1f4,_0x453033[_0xe303('0x12')]));});});};exports[_0xe303('0x1e')]=function(_0x20193c){var _0x1a5252=this;return new Promise(function(_0x3373f6,_0x426cc4){return db[_0xe303('0x16')][_0xe303('0x1f')]({'raw':_0x20193c[_0xe303('0x17')]?_0x20193c['options'][_0xe303('0x20')]===undefined?!![]:![]:!![],'where':_0x20193c[_0xe303('0x17')]?_0x20193c['options']['where']||null:null,'attributes':_0x20193c['options']?_0x20193c[_0xe303('0x17')]['attributes']||null:null,'include':_0x20193c[_0xe303('0x17')]?_0x20193c['options'][_0xe303('0x1a')]?_[_0xe303('0x1b')](_0x20193c['options'][_0xe303('0x1a')],function(_0x2df419){return{'model':db[_0x2df419[_0xe303('0x1c')]],'as':_0x2df419['as'],'attributes':_0x2df419['attributes'],'include':_0x2df419[_0xe303('0x1a')]?_['map'](_0x2df419['include'],function(_0x549075){return{'model':db[_0x549075[_0xe303('0x1c')]],'as':_0x549075['as'],'attributes':_0x549075[_0xe303('0x19')],'include':_0x549075[_0xe303('0x1a')]?_[_0xe303('0x1b')](_0x549075[_0xe303('0x1a')],function(_0x240287){return{'model':db[_0x240287['model']],'as':_0x240287['as'],'attributes':_0x240287[_0xe303('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e103a){logger[_0xe303('0x13')]('ShowServicenowAccount',_0x20193c);logger[_0xe303('0xd')](_0xe303('0x1e'),_0x20193c,JSON['stringify'](_0x3e103a));_0x3373f6(_0x3e103a);})[_0xe303('0x15')](function(_0x24ffc6){logger[_0xe303('0x10')](_0xe303('0x1e'),_0x24ffc6[_0xe303('0x12')],_0x20193c);_0x426cc4(_0x1a5252[_0xe303('0x10')](0x1f4,_0x24ffc6[_0xe303('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3a9ac84..e0b382a 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 _0x2cc9=['put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x2097ca,_0x24f48a){var _0x3e7dab=function(_0x19f43e){while(--_0x19f43e){_0x2097ca['push'](_0x2097ca['shift']());}};_0x3e7dab(++_0x24f48a);}(_0x2cc9,0xa5));var _0x92cc=function(_0x64de47,_0x3b9660){_0x64de47=_0x64de47-0x0;var _0x20c62e=_0x2cc9[_0x64de47];return _0x20c62e;};'use strict';var multer=require(_0x92cc('0x0'));var util=require(_0x92cc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x92cc('0x2'));var router=express[_0x92cc('0x3')]();var fs_extra=require(_0x92cc('0x4'));var auth=require(_0x92cc('0x5'));var interaction=require(_0x92cc('0x6'));var config=require('../../config/environment');var controller=require(_0x92cc('0x7'));router[_0x92cc('0x8')]('/',auth[_0x92cc('0x9')](),controller['index']);router[_0x92cc('0x8')](_0x92cc('0xa'),auth[_0x92cc('0x9')](),controller[_0x92cc('0xb')]);router['get'](_0x92cc('0xc'),auth[_0x92cc('0x9')](),controller[_0x92cc('0xd')]);router[_0x92cc('0x8')](_0x92cc('0xe'),auth[_0x92cc('0x9')](),controller[_0x92cc('0xf')]);router[_0x92cc('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x92cc('0x10')]);router[_0x92cc('0x11')]('/',auth[_0x92cc('0x9')](),controller[_0x92cc('0x12')]);router[_0x92cc('0x13')](_0x92cc('0xa'),auth[_0x92cc('0x9')](),controller[_0x92cc('0x14')]);router['delete'](_0x92cc('0xa'),auth['isAuthenticated'](),controller[_0x92cc('0x15')]);module[_0x92cc('0x16')]=router; \ No newline at end of file +var _0xb341=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb341,0x147));var _0x1b34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb341[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1b34('0x0'));var util=require(_0x1b34('0x1'));var path=require(_0x1b34('0x2'));var timeout=require(_0x1b34('0x3'));var express=require(_0x1b34('0x4'));var router=express[_0x1b34('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b34('0x6'));var interaction=require(_0x1b34('0x7'));var config=require(_0x1b34('0x8'));var controller=require(_0x1b34('0x9'));router[_0x1b34('0xa')]('/',auth[_0x1b34('0xb')](),controller[_0x1b34('0xc')]);router[_0x1b34('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1b34('0xd')]);router[_0x1b34('0xa')](_0x1b34('0xe'),auth[_0x1b34('0xb')](),controller['getFields']);router[_0x1b34('0xa')](_0x1b34('0xf'),auth['isAuthenticated'](),controller[_0x1b34('0x10')]);router[_0x1b34('0xa')](_0x1b34('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x1b34('0xb')](),controller[_0x1b34('0x12')]);router[_0x1b34('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1b34('0x14')]);router[_0x1b34('0x15')]('/:id',auth[_0x1b34('0xb')](),controller['destroy']);module[_0x1b34('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 9a16ed2..205077e 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 _0xf0b3=['exports','STRING','sequelize'];(function(_0x581aa7,_0x51dd54){var _0x5e8c0f=function(_0x289ccc){while(--_0x289ccc){_0x581aa7['push'](_0x581aa7['shift']());}};_0x5e8c0f(++_0x51dd54);}(_0xf0b3,0xe0));var _0x3f0b=function(_0x4fe7bb,_0x1bdd1c){_0x4fe7bb=_0x4fe7bb-0x0;var _0x5659cc=_0xf0b3[_0x4fe7bb];return _0x5659cc;};'use strict';var Sequelize=require(_0x3f0b('0x0'));module[_0x3f0b('0x1')]={'name':{'type':Sequelize[_0x3f0b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8f21=['sequelize','exports','STRING'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x8f21,0x17d));var _0x18f2=function(_0x3e5b26,_0x409d77){_0x3e5b26=_0x3e5b26-0x0;var _0x2ca146=_0x8f21[_0x3e5b26];return _0x2ca146;};'use strict';var Sequelize=require(_0x18f2('0x0'));module[_0x18f2('0x1')]={'name':{'type':Sequelize[_0x18f2('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 549fb20..c9984ed 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 _0x2923=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ServicenowConfiguration','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','sort','getFields','length','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x2923,0x8b));var _0x3292=function(_0x29cc24,_0x3fc46e){_0x29cc24=_0x29cc24-0x0;var _0x278d5f=_0x2923[_0x29cc24];return _0x278d5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3292('0x0'));var zipdir=require(_0x3292('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3292('0x2'));var Mustache=require(_0x3292('0x3'));var util=require(_0x3292('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x3292('0x5'));var ejs=require(_0x3292('0x6'));var fs=require('fs');var fs_extra=require(_0x3292('0x7'));var _=require(_0x3292('0x8'));var squel=require(_0x3292('0x9'));var crypto=require(_0x3292('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3292('0xb'));var toCsv=require(_0x3292('0x5'));var querystring=require(_0x3292('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3292('0xd'));var qs=require(_0x3292('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3292('0xf'));var logger=require(_0x3292('0x10'))('api');var utils=require(_0x3292('0x11'));var config=require(_0x3292('0x12'));var licenseUtil=require(_0x3292('0x13'));var db=require(_0x3292('0x14'))['db'];function respondWithStatusCode(_0x55673f,_0x34f74b){_0x34f74b=_0x34f74b||0xcc;return function(_0x21bb77){if(_0x21bb77){return _0x55673f[_0x3292('0x15')](_0x34f74b);}return _0x55673f[_0x3292('0x16')](_0x34f74b)[_0x3292('0x17')]();};}function respondWithResult(_0x4b43f9,_0xadc7ec){_0xadc7ec=_0xadc7ec||0xc8;return function(_0x401d14){if(_0x401d14){return _0x4b43f9[_0x3292('0x16')](_0xadc7ec)[_0x3292('0x18')](_0x401d14);}};}function respondWithFilteredResult(_0x428670,_0x530e81){return function(_0x28fcac){if(_0x28fcac){var _0x11d7b0=typeof _0x530e81[_0x3292('0x19')]===_0x3292('0x1a')&&typeof _0x530e81[_0x3292('0x1b')]==='undefined';var _0x2c02e7=_0x28fcac['count'];var _0x376c3f=_0x11d7b0?0x0:_0x530e81['offset'];var _0x4304e1=_0x11d7b0?_0x28fcac[_0x3292('0x1c')]:_0x530e81[_0x3292('0x19')]+_0x530e81[_0x3292('0x1b')];var _0x2fa66b;if(_0x4304e1>=_0x2c02e7){_0x4304e1=_0x2c02e7;_0x2fa66b=0xc8;}else{_0x2fa66b=0xce;}_0x428670[_0x3292('0x16')](_0x2fa66b);return _0x428670[_0x3292('0x1d')](_0x3292('0x1e'),_0x376c3f+'-'+_0x4304e1+'/'+_0x2c02e7)[_0x3292('0x18')](_0x28fcac);}return null;};}function patchUpdates(_0x2dd4d5){return function(_0x27b7e0){try{jsonpatch[_0x3292('0x1f')](_0x27b7e0,_0x2dd4d5,!![]);}catch(_0x599ff6){return BPromise[_0x3292('0x20')](_0x599ff6);}return _0x27b7e0[_0x3292('0x21')]();};}function saveUpdates(_0x1abc7a,_0x406fae){return function(_0x5b7978){if(_0x5b7978){return _0x5b7978[_0x3292('0x22')](_0x1abc7a)[_0x3292('0x23')](function(_0x3dde86){return _0x3dde86;});}return null;};}function removeEntity(_0x24166c,_0x179350){return function(_0xc2340d){if(_0xc2340d){return _0xc2340d[_0x3292('0x24')]()[_0x3292('0x23')](function(){_0x24166c[_0x3292('0x16')](0xcc)[_0x3292('0x17')]();});}};}function handleEntityNotFound(_0x139512,_0x176481){return function(_0x4efbd3){if(!_0x4efbd3){_0x139512[_0x3292('0x15')](0x194);}return _0x4efbd3;};}function handleError(_0x2dca90,_0x2f87ca){_0x2f87ca=_0x2f87ca||0x1f4;return function(_0x5bdd51){logger['error'](_0x5bdd51[_0x3292('0x25')]);if(_0x5bdd51[_0x3292('0x26')]){delete _0x5bdd51[_0x3292('0x26')];}_0x2dca90[_0x3292('0x16')](_0x2f87ca)[_0x3292('0x27')](_0x5bdd51);};}exports[_0x3292('0x28')]=function(_0x49d288,_0x15c61c){var _0xacc146={},_0x55c1d9={},_0x4f1b62={'count':0x0,'rows':[]};var _0x37b779=_[_0x3292('0x29')](db['ServicenowConfiguration']['rawAttributes'],function(_0x3e1117){return{'name':_0x3e1117[_0x3292('0x2a')],'type':_0x3e1117[_0x3292('0x2b')]['key']};});_0x55c1d9[_0x3292('0x2c')]=_['map'](_0x37b779,_0x3292('0x26'));_0x55c1d9[_0x3292('0x2d')]=_['keys'](_0x49d288[_0x3292('0x2d')]);_0x55c1d9[_0x3292('0x2e')]=_['intersection'](_0x55c1d9[_0x3292('0x2c')],_0x55c1d9[_0x3292('0x2d')]);_0xacc146[_0x3292('0x2f')]=_[_0x3292('0x30')](_0x55c1d9['model'],qs[_0x3292('0x31')](_0x49d288[_0x3292('0x2d')][_0x3292('0x31')]));_0xacc146[_0x3292('0x2f')]=_0xacc146[_0x3292('0x2f')]['length']?_0xacc146[_0x3292('0x2f')]:_0x55c1d9[_0x3292('0x2c')];if(!_0x49d288[_0x3292('0x2d')][_0x3292('0x32')](_0x3292('0x33'))){_0xacc146[_0x3292('0x1b')]=qs[_0x3292('0x1b')](_0x49d288[_0x3292('0x2d')][_0x3292('0x1b')]);_0xacc146[_0x3292('0x19')]=qs[_0x3292('0x19')](_0x49d288[_0x3292('0x2d')][_0x3292('0x19')]);}_0xacc146[_0x3292('0x34')]=qs['sort'](_0x49d288[_0x3292('0x2d')]['sort']);_0xacc146['where']=qs['filters'](_[_0x3292('0x35')](_0x49d288[_0x3292('0x2d')],_0x55c1d9['filters']),_0x37b779);if(_0x49d288['query'][_0x3292('0x36')]){_0xacc146[_0x3292('0x37')]=_[_0x3292('0x38')](_0xacc146[_0x3292('0x37')],{'$or':_['map'](_0x37b779,function(_0x107cbc){if(_0x107cbc[_0x3292('0x2b')]!==_0x3292('0x39')){var _0x554675={};_0x554675[_0x107cbc['name']]={'$like':'%'+_0x49d288['query'][_0x3292('0x36')]+'%'};return _0x554675;}})});}_0xacc146=_[_0x3292('0x38')]({},_0xacc146,_0x49d288[_0x3292('0x3a')]);var _0x2ed0c9={'where':_0xacc146['where']};return db['ServicenowConfiguration'][_0x3292('0x1c')](_0x2ed0c9)[_0x3292('0x23')](function(_0x3eeaa9){_0x4f1b62[_0x3292('0x1c')]=_0x3eeaa9;if(_0x49d288[_0x3292('0x2d')][_0x3292('0x3b')]){_0xacc146[_0x3292('0x3c')]=[{'all':!![]}];}return db[_0x3292('0x3d')][_0x3292('0x3e')](_0xacc146);})[_0x3292('0x23')](function(_0x10bf10){_0x4f1b62[_0x3292('0x3f')]=_0x10bf10;return _0x4f1b62;})['then'](respondWithFilteredResult(_0x15c61c,_0xacc146))[_0x3292('0x40')](handleError(_0x15c61c,null));};exports[_0x3292('0x41')]=function(_0x4400df,_0xdecf7c){var _0x2b1159={'raw':![],'where':{'id':_0x4400df[_0x3292('0x42')]['id']}},_0x1bdc04={};_0x1bdc04['model']=_['keys'](db['ServicenowConfiguration'][_0x3292('0x43')]);_0x1bdc04[_0x3292('0x2d')]=_[_0x3292('0x44')](_0x4400df['query']);_0x1bdc04[_0x3292('0x2e')]=_[_0x3292('0x30')](_0x1bdc04[_0x3292('0x2c')],_0x1bdc04['query']);_0x2b1159['attributes']=_[_0x3292('0x30')](_0x1bdc04[_0x3292('0x2c')],qs[_0x3292('0x31')](_0x4400df[_0x3292('0x2d')]['fields']));_0x2b1159['attributes']=_0x2b1159['attributes']['length']?_0x2b1159['attributes']:_0x1bdc04[_0x3292('0x2c')];if(_0x4400df[_0x3292('0x2d')][_0x3292('0x3b')]){_0x2b1159['include']=[{'all':!![]}];}_0x2b1159=_[_0x3292('0x38')]({},_0x2b1159,_0x4400df[_0x3292('0x3a')]);return db[_0x3292('0x3d')][_0x3292('0x45')](_0x2b1159)[_0x3292('0x23')](handleEntityNotFound(_0xdecf7c,null))[_0x3292('0x23')](respondWithResult(_0xdecf7c,null))['catch'](handleError(_0xdecf7c,null));};exports[_0x3292('0x46')]=function(_0x4a8b28,_0x49dbc0){return db[_0x3292('0x3d')]['create'](_0x4a8b28[_0x3292('0x47')],{})[_0x3292('0x23')](respondWithResult(_0x49dbc0,0xc9))[_0x3292('0x40')](handleError(_0x49dbc0,null));};exports[_0x3292('0x22')]=function(_0x20d025,_0x1b5b13){if(_0x20d025[_0x3292('0x47')]['id']){delete _0x20d025[_0x3292('0x47')]['id'];}return db[_0x3292('0x3d')]['find']({'where':{'id':_0x20d025[_0x3292('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b5b13,null))[_0x3292('0x23')](saveUpdates(_0x20d025['body'],null))[_0x3292('0x23')](respondWithResult(_0x1b5b13,null))[_0x3292('0x40')](handleError(_0x1b5b13,null));};exports[_0x3292('0x24')]=function(_0x5da386,_0x3e7f64){return db['ServicenowConfiguration']['find']({'where':{'id':_0x5da386['params']['id']}})[_0x3292('0x23')](handleEntityNotFound(_0x3e7f64,null))[_0x3292('0x23')](removeEntity(_0x3e7f64,null))[_0x3292('0x40')](handleError(_0x3e7f64,null));};exports['getFields']=function(_0x342eef,_0x2b4bf3,_0x1b303e){var _0x566664={};var _0x4e2434={};var _0x318e22;var _0x5b3412;return db[_0x3292('0x3d')]['findOne']({'where':{'id':_0x342eef[_0x3292('0x42')]['id']}})[_0x3292('0x23')](handleEntityNotFound(_0x2b4bf3,null))['then'](function(_0x955a78){if(_0x955a78){_0x318e22=_0x955a78;_0x4e2434[_0x3292('0x2c')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x4e2434['query']=_[_0x3292('0x44')](_0x342eef['query']);_0x4e2434[_0x3292('0x2e')]=_['intersection'](_0x4e2434['model'],_0x4e2434[_0x3292('0x2d')]);_0x566664['attributes']=_[_0x3292('0x30')](_0x4e2434[_0x3292('0x2c')],qs[_0x3292('0x31')](_0x342eef[_0x3292('0x2d')][_0x3292('0x31')]));_0x566664[_0x3292('0x2f')]=_0x566664[_0x3292('0x2f')]['length']?_0x566664[_0x3292('0x2f')]:_0x4e2434[_0x3292('0x2c')];_0x566664[_0x3292('0x34')]=qs[_0x3292('0x48')](_0x342eef['query'][_0x3292('0x48')]);_0x566664[_0x3292('0x37')]=qs[_0x3292('0x2e')](_['pick'](_0x342eef['query'],_0x4e2434[_0x3292('0x2e')]));if(_0x342eef[_0x3292('0x2d')][_0x3292('0x36')]){_0x566664['where']=_[_0x3292('0x38')](_0x566664[_0x3292('0x37')],{'$or':_[_0x3292('0x29')](_0x566664[_0x3292('0x2f')],function(_0x5de059){var _0x14da4b={};_0x14da4b[_0x5de059]={'$like':'%'+_0x342eef[_0x3292('0x2d')][_0x3292('0x36')]+'%'};return _0x14da4b;})});}_0x566664=_[_0x3292('0x38')]({},_0x566664,_0x342eef[_0x3292('0x3a')]);return _0x318e22[_0x3292('0x49')](_0x566664);}})[_0x3292('0x23')](function(_0x2fb48b){if(_0x2fb48b){_0x5b3412=_0x2fb48b[_0x3292('0x4a')];if(!_0x342eef[_0x3292('0x2d')][_0x3292('0x32')](_0x3292('0x33'))){_0x566664[_0x3292('0x1b')]=qs['limit'](_0x342eef[_0x3292('0x2d')][_0x3292('0x1b')]);_0x566664['offset']=qs['offset'](_0x342eef[_0x3292('0x2d')][_0x3292('0x19')]);}return _0x318e22['getFields'](_0x566664);}})[_0x3292('0x23')](function(_0x33ae4e){if(_0x33ae4e){return _0x33ae4e?{'count':_0x5b3412,'rows':_0x33ae4e}:null;}})[_0x3292('0x23')](respondWithResult(_0x2b4bf3,null))[_0x3292('0x40')](handleError(_0x2b4bf3,null));};exports['getSubjects']=function(_0x3008e4,_0x546a4a,_0x154ba4){var _0xc36881={};var _0x5d87b0={};var _0x1ecba1;var _0x250106;return db['ServicenowConfiguration'][_0x3292('0x4b')]({'where':{'id':_0x3008e4[_0x3292('0x42')]['id']}})['then'](handleEntityNotFound(_0x546a4a,null))[_0x3292('0x23')](function(_0x340621){if(_0x340621){_0x1ecba1=_0x340621;_0x5d87b0[_0x3292('0x2c')]=_[_0x3292('0x44')](db[_0x3292('0x4c')][_0x3292('0x43')]);_0x5d87b0[_0x3292('0x2d')]=_[_0x3292('0x44')](_0x3008e4[_0x3292('0x2d')]);_0x5d87b0[_0x3292('0x2e')]=_[_0x3292('0x30')](_0x5d87b0['model'],_0x5d87b0[_0x3292('0x2d')]);_0xc36881[_0x3292('0x2f')]=_['intersection'](_0x5d87b0[_0x3292('0x2c')],qs[_0x3292('0x31')](_0x3008e4[_0x3292('0x2d')][_0x3292('0x31')]));_0xc36881[_0x3292('0x2f')]=_0xc36881[_0x3292('0x2f')][_0x3292('0x4a')]?_0xc36881['attributes']:_0x5d87b0['model'];_0xc36881[_0x3292('0x34')]=qs[_0x3292('0x48')](_0x3008e4['query'][_0x3292('0x48')]);_0xc36881['where']=qs[_0x3292('0x2e')](_[_0x3292('0x35')](_0x3008e4[_0x3292('0x2d')],_0x5d87b0[_0x3292('0x2e')]));if(_0x3008e4[_0x3292('0x2d')]['filter']){_0xc36881['where']=_['merge'](_0xc36881[_0x3292('0x37')],{'$or':_[_0x3292('0x29')](_0xc36881[_0x3292('0x2f')],function(_0x59e25b){var _0x27515e={};_0x27515e[_0x59e25b]={'$like':'%'+_0x3008e4[_0x3292('0x2d')][_0x3292('0x36')]+'%'};return _0x27515e;})});}_0xc36881=_[_0x3292('0x38')]({},_0xc36881,_0x3008e4[_0x3292('0x3a')]);return _0x1ecba1[_0x3292('0x4d')](_0xc36881);}})[_0x3292('0x23')](function(_0x127304){if(_0x127304){_0x250106=_0x127304['length'];if(!_0x3008e4[_0x3292('0x2d')]['hasOwnProperty']('nolimit')){_0xc36881[_0x3292('0x1b')]=qs[_0x3292('0x1b')](_0x3008e4['query']['limit']);_0xc36881[_0x3292('0x19')]=qs['offset'](_0x3008e4[_0x3292('0x2d')][_0x3292('0x19')]);}return _0x1ecba1[_0x3292('0x4d')](_0xc36881);}})['then'](function(_0x57520b){if(_0x57520b){return _0x57520b?{'count':_0x250106,'rows':_0x57520b}:null;}})[_0x3292('0x23')](respondWithResult(_0x546a4a,null))[_0x3292('0x40')](handleError(_0x546a4a,null));};exports[_0x3292('0x4e')]=function(_0xacbece,_0x5db08c,_0x3f5586){var _0x144205={};var _0x3011d1={};var _0x27b1dc;var _0x309349;return db[_0x3292('0x3d')][_0x3292('0x4b')]({'where':{'id':_0xacbece[_0x3292('0x42')]['id']}})[_0x3292('0x23')](handleEntityNotFound(_0x5db08c,null))[_0x3292('0x23')](function(_0x361c44){if(_0x361c44){_0x27b1dc=_0x361c44;_0x3011d1[_0x3292('0x2c')]=_[_0x3292('0x44')](db['ServicenowField'][_0x3292('0x43')]);_0x3011d1[_0x3292('0x2d')]=_[_0x3292('0x44')](_0xacbece['query']);_0x3011d1['filters']=_[_0x3292('0x30')](_0x3011d1['model'],_0x3011d1[_0x3292('0x2d')]);_0x144205[_0x3292('0x2f')]=_[_0x3292('0x30')](_0x3011d1[_0x3292('0x2c')],qs[_0x3292('0x31')](_0xacbece['query'][_0x3292('0x31')]));_0x144205[_0x3292('0x2f')]=_0x144205[_0x3292('0x2f')][_0x3292('0x4a')]?_0x144205[_0x3292('0x2f')]:_0x3011d1[_0x3292('0x2c')];_0x144205[_0x3292('0x34')]=qs[_0x3292('0x48')](_0xacbece[_0x3292('0x2d')][_0x3292('0x48')]);_0x144205[_0x3292('0x37')]=qs[_0x3292('0x2e')](_[_0x3292('0x35')](_0xacbece[_0x3292('0x2d')],_0x3011d1[_0x3292('0x2e')]));if(_0xacbece[_0x3292('0x2d')][_0x3292('0x36')]){_0x144205[_0x3292('0x37')]=_[_0x3292('0x38')](_0x144205[_0x3292('0x37')],{'$or':_[_0x3292('0x29')](_0x144205[_0x3292('0x2f')],function(_0x5e4b21){var _0x3657ff={};_0x3657ff[_0x5e4b21]={'$like':'%'+_0xacbece[_0x3292('0x2d')][_0x3292('0x36')]+'%'};return _0x3657ff;})});}_0x144205=_[_0x3292('0x38')]({},_0x144205,_0xacbece[_0x3292('0x3a')]);return _0x27b1dc['getDescriptions'](_0x144205);}})['then'](function(_0x4ea609){if(_0x4ea609){_0x309349=_0x4ea609['length'];if(!_0xacbece[_0x3292('0x2d')][_0x3292('0x32')](_0x3292('0x33'))){_0x144205[_0x3292('0x1b')]=qs[_0x3292('0x1b')](_0xacbece[_0x3292('0x2d')][_0x3292('0x1b')]);_0x144205['offset']=qs[_0x3292('0x19')](_0xacbece[_0x3292('0x2d')]['offset']);}return _0x27b1dc[_0x3292('0x4e')](_0x144205);}})[_0x3292('0x23')](function(_0x63d61f){if(_0x63d61f){return _0x63d61f?{'count':_0x309349,'rows':_0x63d61f}:null;}})[_0x3292('0x23')](respondWithResult(_0x5db08c,null))[_0x3292('0x40')](handleError(_0x5db08c,null));}; \ No newline at end of file +var _0xb283=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','error','stack','name','status','send','map','ServicenowConfiguration','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','destroy','getFields','findOne','getSubjects','ServicenowField','getDescriptions'];(function(_0x31b4ce,_0x234e4a){var _0x4693e1=function(_0x1bd314){while(--_0x1bd314){_0x31b4ce['push'](_0x31b4ce['shift']());}};_0x4693e1(++_0x234e4a);}(_0xb283,0x1ec));var _0x3b28=function(_0x353ce9,_0x12ffea){_0x353ce9=_0x353ce9-0x0;var _0x2de21a=_0xb283[_0x353ce9];return _0x2de21a;};'use strict';var emlformat=require(_0x3b28('0x0'));var rimraf=require(_0x3b28('0x1'));var zipdir=require(_0x3b28('0x2'));var jsonpatch=require(_0x3b28('0x3'));var rp=require(_0x3b28('0x4'));var moment=require(_0x3b28('0x5'));var BPromise=require(_0x3b28('0x6'));var Mustache=require(_0x3b28('0x7'));var util=require(_0x3b28('0x8'));var path=require(_0x3b28('0x9'));var sox=require(_0x3b28('0xa'));var csv=require(_0x3b28('0xb'));var ejs=require(_0x3b28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b28('0xd'));var squel=require(_0x3b28('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b28('0xf'));var toCsv=require(_0x3b28('0xb'));var querystring=require(_0x3b28('0x10'));var Papa=require(_0x3b28('0x11'));var Redis=require(_0x3b28('0x12'));var authService=require(_0x3b28('0x13'));var qs=require(_0x3b28('0x14'));var as=require(_0x3b28('0x15'));var hardwareService=require(_0x3b28('0x16'));var logger=require('../../config/logger')(_0x3b28('0x17'));var utils=require(_0x3b28('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3b28('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12b99d,_0xf5342b){_0xf5342b=_0xf5342b||0xcc;return function(_0x35cf24){if(_0x35cf24){return _0x12b99d[_0x3b28('0x1a')](_0xf5342b);}return _0x12b99d['status'](_0xf5342b)[_0x3b28('0x1b')]();};}function respondWithResult(_0xcabf3d,_0x2f77da){_0x2f77da=_0x2f77da||0xc8;return function(_0x5287b7){if(_0x5287b7){return _0xcabf3d['status'](_0x2f77da)[_0x3b28('0x1c')](_0x5287b7);}};}function respondWithFilteredResult(_0x3e100f,_0x4e4134){return function(_0x519294){if(_0x519294){var _0x55ba4c=typeof _0x4e4134['offset']===_0x3b28('0x1d')&&typeof _0x4e4134[_0x3b28('0x1e')]===_0x3b28('0x1d');var _0x22649d=_0x519294[_0x3b28('0x1f')];var _0x5776dc=_0x55ba4c?0x0:_0x4e4134['offset'];var _0x1df8e3=_0x55ba4c?_0x519294[_0x3b28('0x1f')]:_0x4e4134['offset']+_0x4e4134['limit'];var _0x5534b9;if(_0x1df8e3>=_0x22649d){_0x1df8e3=_0x22649d;_0x5534b9=0xc8;}else{_0x5534b9=0xce;}_0x3e100f['status'](_0x5534b9);return _0x3e100f['set'](_0x3b28('0x20'),_0x5776dc+'-'+_0x1df8e3+'/'+_0x22649d)[_0x3b28('0x1c')](_0x519294);}return null;};}function patchUpdates(_0x3301be){return function(_0x590830){try{jsonpatch[_0x3b28('0x21')](_0x590830,_0x3301be,!![]);}catch(_0xe7fd98){return BPromise[_0x3b28('0x22')](_0xe7fd98);}return _0x590830[_0x3b28('0x23')]();};}function saveUpdates(_0x4d5242,_0x32bbad){return function(_0x1e831a){if(_0x1e831a){return _0x1e831a[_0x3b28('0x24')](_0x4d5242)['then'](function(_0xf4922){return _0xf4922;});}return null;};}function removeEntity(_0x1339b9,_0x4f0021){return function(_0x529d1b){if(_0x529d1b){return _0x529d1b['destroy']()['then'](function(){_0x1339b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ea1c,_0xd80475){return function(_0x1515f1){if(!_0x1515f1){_0x28ea1c[_0x3b28('0x1a')](0x194);}return _0x1515f1;};}function handleError(_0x3c144a,_0x5cfe6d){_0x5cfe6d=_0x5cfe6d||0x1f4;return function(_0x56429f){logger[_0x3b28('0x25')](_0x56429f[_0x3b28('0x26')]);if(_0x56429f[_0x3b28('0x27')]){delete _0x56429f[_0x3b28('0x27')];}_0x3c144a[_0x3b28('0x28')](_0x5cfe6d)[_0x3b28('0x29')](_0x56429f);};}exports['index']=function(_0x13caff,_0x5afa66){var _0x3d6192={},_0x50bbd1={},_0x7279c0={'count':0x0,'rows':[]};var _0xf22c09=_[_0x3b28('0x2a')](db[_0x3b28('0x2b')]['rawAttributes'],function(_0x2c505a){return{'name':_0x2c505a['fieldName'],'type':_0x2c505a['type'][_0x3b28('0x2c')]};});_0x50bbd1[_0x3b28('0x2d')]=_[_0x3b28('0x2a')](_0xf22c09,_0x3b28('0x27'));_0x50bbd1[_0x3b28('0x2e')]=_[_0x3b28('0x2f')](_0x13caff[_0x3b28('0x2e')]);_0x50bbd1[_0x3b28('0x30')]=_[_0x3b28('0x31')](_0x50bbd1[_0x3b28('0x2d')],_0x50bbd1[_0x3b28('0x2e')]);_0x3d6192[_0x3b28('0x32')]=_['intersection'](_0x50bbd1['model'],qs[_0x3b28('0x33')](_0x13caff[_0x3b28('0x2e')][_0x3b28('0x33')]));_0x3d6192[_0x3b28('0x32')]=_0x3d6192[_0x3b28('0x32')][_0x3b28('0x34')]?_0x3d6192[_0x3b28('0x32')]:_0x50bbd1[_0x3b28('0x2d')];if(!_0x13caff[_0x3b28('0x2e')][_0x3b28('0x35')](_0x3b28('0x36'))){_0x3d6192['limit']=qs['limit'](_0x13caff['query'][_0x3b28('0x1e')]);_0x3d6192[_0x3b28('0x37')]=qs[_0x3b28('0x37')](_0x13caff[_0x3b28('0x2e')][_0x3b28('0x37')]);}_0x3d6192[_0x3b28('0x38')]=qs[_0x3b28('0x39')](_0x13caff['query'][_0x3b28('0x39')]);_0x3d6192[_0x3b28('0x3a')]=qs['filters'](_[_0x3b28('0x3b')](_0x13caff[_0x3b28('0x2e')],_0x50bbd1[_0x3b28('0x30')]),_0xf22c09);if(_0x13caff[_0x3b28('0x2e')][_0x3b28('0x3c')]){_0x3d6192[_0x3b28('0x3a')]=_[_0x3b28('0x3d')](_0x3d6192[_0x3b28('0x3a')],{'$or':_[_0x3b28('0x2a')](_0xf22c09,function(_0x17d3f7){if(_0x17d3f7[_0x3b28('0x3e')]!==_0x3b28('0x3f')){var _0x51b23f={};_0x51b23f[_0x17d3f7[_0x3b28('0x27')]]={'$like':'%'+_0x13caff[_0x3b28('0x2e')][_0x3b28('0x3c')]+'%'};return _0x51b23f;}})});}_0x3d6192=_[_0x3b28('0x3d')]({},_0x3d6192,_0x13caff[_0x3b28('0x40')]);var _0x2362b0={'where':_0x3d6192[_0x3b28('0x3a')]};return db[_0x3b28('0x2b')][_0x3b28('0x1f')](_0x2362b0)[_0x3b28('0x41')](function(_0x24b891){_0x7279c0[_0x3b28('0x1f')]=_0x24b891;if(_0x13caff[_0x3b28('0x2e')][_0x3b28('0x42')]){_0x3d6192[_0x3b28('0x43')]=[{'all':!![]}];}return db[_0x3b28('0x2b')]['findAll'](_0x3d6192);})[_0x3b28('0x41')](function(_0xc929a9){_0x7279c0[_0x3b28('0x44')]=_0xc929a9;return _0x7279c0;})[_0x3b28('0x41')](respondWithFilteredResult(_0x5afa66,_0x3d6192))[_0x3b28('0x45')](handleError(_0x5afa66,null));};exports[_0x3b28('0x46')]=function(_0x3fd15f,_0x5144c3){var _0x5e980b={'raw':![],'where':{'id':_0x3fd15f['params']['id']}},_0x304ae2={};_0x304ae2[_0x3b28('0x2d')]=_['keys'](db['ServicenowConfiguration'][_0x3b28('0x47')]);_0x304ae2[_0x3b28('0x2e')]=_[_0x3b28('0x2f')](_0x3fd15f['query']);_0x304ae2['filters']=_[_0x3b28('0x31')](_0x304ae2[_0x3b28('0x2d')],_0x304ae2[_0x3b28('0x2e')]);_0x5e980b[_0x3b28('0x32')]=_['intersection'](_0x304ae2[_0x3b28('0x2d')],qs[_0x3b28('0x33')](_0x3fd15f[_0x3b28('0x2e')][_0x3b28('0x33')]));_0x5e980b[_0x3b28('0x32')]=_0x5e980b[_0x3b28('0x32')]['length']?_0x5e980b['attributes']:_0x304ae2[_0x3b28('0x2d')];if(_0x3fd15f['query']['includeAll']){_0x5e980b[_0x3b28('0x43')]=[{'all':!![]}];}_0x5e980b=_[_0x3b28('0x3d')]({},_0x5e980b,_0x3fd15f[_0x3b28('0x40')]);return db[_0x3b28('0x2b')][_0x3b28('0x48')](_0x5e980b)[_0x3b28('0x41')](handleEntityNotFound(_0x5144c3,null))['then'](respondWithResult(_0x5144c3,null))[_0x3b28('0x45')](handleError(_0x5144c3,null));};exports[_0x3b28('0x49')]=function(_0x50b60d,_0x4efeb6){return db[_0x3b28('0x2b')][_0x3b28('0x49')](_0x50b60d['body'],{})[_0x3b28('0x41')](respondWithResult(_0x4efeb6,0xc9))[_0x3b28('0x45')](handleError(_0x4efeb6,null));};exports[_0x3b28('0x24')]=function(_0x17cfea,_0x4e1417){if(_0x17cfea[_0x3b28('0x4a')]['id']){delete _0x17cfea[_0x3b28('0x4a')]['id'];}return db[_0x3b28('0x2b')][_0x3b28('0x48')]({'where':{'id':_0x17cfea[_0x3b28('0x4b')]['id']}})[_0x3b28('0x41')](handleEntityNotFound(_0x4e1417,null))['then'](saveUpdates(_0x17cfea[_0x3b28('0x4a')],null))[_0x3b28('0x41')](respondWithResult(_0x4e1417,null))['catch'](handleError(_0x4e1417,null));};exports[_0x3b28('0x4c')]=function(_0xa832d0,_0x512912){return db['ServicenowConfiguration'][_0x3b28('0x48')]({'where':{'id':_0xa832d0[_0x3b28('0x4b')]['id']}})[_0x3b28('0x41')](handleEntityNotFound(_0x512912,null))['then'](removeEntity(_0x512912,null))[_0x3b28('0x45')](handleError(_0x512912,null));};exports[_0x3b28('0x4d')]=function(_0x1a7028,_0x284779,_0x51e5d9){var _0x53498e={};var _0x42920d={};var _0x32b495;var _0x2491fa;return db['ServicenowConfiguration'][_0x3b28('0x4e')]({'where':{'id':_0x1a7028[_0x3b28('0x4b')]['id']}})['then'](handleEntityNotFound(_0x284779,null))['then'](function(_0xad616b){if(_0xad616b){_0x32b495=_0xad616b;_0x42920d[_0x3b28('0x2d')]=_[_0x3b28('0x2f')](db['ServicenowField'][_0x3b28('0x47')]);_0x42920d['query']=_['keys'](_0x1a7028[_0x3b28('0x2e')]);_0x42920d['filters']=_['intersection'](_0x42920d[_0x3b28('0x2d')],_0x42920d[_0x3b28('0x2e')]);_0x53498e['attributes']=_['intersection'](_0x42920d[_0x3b28('0x2d')],qs[_0x3b28('0x33')](_0x1a7028[_0x3b28('0x2e')][_0x3b28('0x33')]));_0x53498e[_0x3b28('0x32')]=_0x53498e[_0x3b28('0x32')]['length']?_0x53498e[_0x3b28('0x32')]:_0x42920d[_0x3b28('0x2d')];_0x53498e['order']=qs['sort'](_0x1a7028[_0x3b28('0x2e')][_0x3b28('0x39')]);_0x53498e[_0x3b28('0x3a')]=qs[_0x3b28('0x30')](_[_0x3b28('0x3b')](_0x1a7028[_0x3b28('0x2e')],_0x42920d['filters']));if(_0x1a7028[_0x3b28('0x2e')][_0x3b28('0x3c')]){_0x53498e[_0x3b28('0x3a')]=_[_0x3b28('0x3d')](_0x53498e[_0x3b28('0x3a')],{'$or':_[_0x3b28('0x2a')](_0x53498e[_0x3b28('0x32')],function(_0x3715f7){var _0x165ba9={};_0x165ba9[_0x3715f7]={'$like':'%'+_0x1a7028[_0x3b28('0x2e')][_0x3b28('0x3c')]+'%'};return _0x165ba9;})});}_0x53498e=_['merge']({},_0x53498e,_0x1a7028[_0x3b28('0x40')]);return _0x32b495[_0x3b28('0x4d')](_0x53498e);}})['then'](function(_0x30b699){if(_0x30b699){_0x2491fa=_0x30b699[_0x3b28('0x34')];if(!_0x1a7028['query']['hasOwnProperty'](_0x3b28('0x36'))){_0x53498e[_0x3b28('0x1e')]=qs[_0x3b28('0x1e')](_0x1a7028[_0x3b28('0x2e')][_0x3b28('0x1e')]);_0x53498e['offset']=qs[_0x3b28('0x37')](_0x1a7028[_0x3b28('0x2e')][_0x3b28('0x37')]);}return _0x32b495[_0x3b28('0x4d')](_0x53498e);}})[_0x3b28('0x41')](function(_0x357698){if(_0x357698){return _0x357698?{'count':_0x2491fa,'rows':_0x357698}:null;}})[_0x3b28('0x41')](respondWithResult(_0x284779,null))[_0x3b28('0x45')](handleError(_0x284779,null));};exports[_0x3b28('0x4f')]=function(_0xbff855,_0x2fb24d,_0x2a8f1b){var _0x13cc1b={};var _0x5cce38={};var _0x15bc9f;var _0x194f31;return db['ServicenowConfiguration'][_0x3b28('0x4e')]({'where':{'id':_0xbff855['params']['id']}})['then'](handleEntityNotFound(_0x2fb24d,null))[_0x3b28('0x41')](function(_0x3f4a77){if(_0x3f4a77){_0x15bc9f=_0x3f4a77;_0x5cce38[_0x3b28('0x2d')]=_[_0x3b28('0x2f')](db[_0x3b28('0x50')]['rawAttributes']);_0x5cce38[_0x3b28('0x2e')]=_[_0x3b28('0x2f')](_0xbff855[_0x3b28('0x2e')]);_0x5cce38[_0x3b28('0x30')]=_[_0x3b28('0x31')](_0x5cce38[_0x3b28('0x2d')],_0x5cce38[_0x3b28('0x2e')]);_0x13cc1b['attributes']=_[_0x3b28('0x31')](_0x5cce38[_0x3b28('0x2d')],qs[_0x3b28('0x33')](_0xbff855['query']['fields']));_0x13cc1b[_0x3b28('0x32')]=_0x13cc1b[_0x3b28('0x32')][_0x3b28('0x34')]?_0x13cc1b[_0x3b28('0x32')]:_0x5cce38['model'];_0x13cc1b[_0x3b28('0x38')]=qs[_0x3b28('0x39')](_0xbff855[_0x3b28('0x2e')][_0x3b28('0x39')]);_0x13cc1b[_0x3b28('0x3a')]=qs[_0x3b28('0x30')](_[_0x3b28('0x3b')](_0xbff855[_0x3b28('0x2e')],_0x5cce38[_0x3b28('0x30')]));if(_0xbff855[_0x3b28('0x2e')][_0x3b28('0x3c')]){_0x13cc1b[_0x3b28('0x3a')]=_[_0x3b28('0x3d')](_0x13cc1b['where'],{'$or':_[_0x3b28('0x2a')](_0x13cc1b[_0x3b28('0x32')],function(_0x5a1692){var _0x41abdb={};_0x41abdb[_0x5a1692]={'$like':'%'+_0xbff855[_0x3b28('0x2e')][_0x3b28('0x3c')]+'%'};return _0x41abdb;})});}_0x13cc1b=_[_0x3b28('0x3d')]({},_0x13cc1b,_0xbff855[_0x3b28('0x40')]);return _0x15bc9f[_0x3b28('0x4f')](_0x13cc1b);}})['then'](function(_0x5ea605){if(_0x5ea605){_0x194f31=_0x5ea605['length'];if(!_0xbff855[_0x3b28('0x2e')][_0x3b28('0x35')](_0x3b28('0x36'))){_0x13cc1b[_0x3b28('0x1e')]=qs[_0x3b28('0x1e')](_0xbff855[_0x3b28('0x2e')][_0x3b28('0x1e')]);_0x13cc1b[_0x3b28('0x37')]=qs['offset'](_0xbff855[_0x3b28('0x2e')][_0x3b28('0x37')]);}return _0x15bc9f[_0x3b28('0x4f')](_0x13cc1b);}})['then'](function(_0x1ffe9f){if(_0x1ffe9f){return _0x1ffe9f?{'count':_0x194f31,'rows':_0x1ffe9f}:null;}})[_0x3b28('0x41')](respondWithResult(_0x2fb24d,null))[_0x3b28('0x45')](handleError(_0x2fb24d,null));};exports['getDescriptions']=function(_0x2e084a,_0x4f53bb,_0xa9a9e8){var _0x25120f={};var _0x1eaf1c={};var _0x3f60cd;var _0x5ce02a;return db[_0x3b28('0x2b')][_0x3b28('0x4e')]({'where':{'id':_0x2e084a[_0x3b28('0x4b')]['id']}})[_0x3b28('0x41')](handleEntityNotFound(_0x4f53bb,null))[_0x3b28('0x41')](function(_0x5a3b8e){if(_0x5a3b8e){_0x3f60cd=_0x5a3b8e;_0x1eaf1c[_0x3b28('0x2d')]=_[_0x3b28('0x2f')](db['ServicenowField'][_0x3b28('0x47')]);_0x1eaf1c['query']=_['keys'](_0x2e084a[_0x3b28('0x2e')]);_0x1eaf1c[_0x3b28('0x30')]=_[_0x3b28('0x31')](_0x1eaf1c['model'],_0x1eaf1c['query']);_0x25120f[_0x3b28('0x32')]=_[_0x3b28('0x31')](_0x1eaf1c[_0x3b28('0x2d')],qs[_0x3b28('0x33')](_0x2e084a[_0x3b28('0x2e')][_0x3b28('0x33')]));_0x25120f[_0x3b28('0x32')]=_0x25120f[_0x3b28('0x32')]['length']?_0x25120f[_0x3b28('0x32')]:_0x1eaf1c[_0x3b28('0x2d')];_0x25120f[_0x3b28('0x38')]=qs[_0x3b28('0x39')](_0x2e084a[_0x3b28('0x2e')]['sort']);_0x25120f[_0x3b28('0x3a')]=qs['filters'](_['pick'](_0x2e084a[_0x3b28('0x2e')],_0x1eaf1c['filters']));if(_0x2e084a['query'][_0x3b28('0x3c')]){_0x25120f[_0x3b28('0x3a')]=_[_0x3b28('0x3d')](_0x25120f[_0x3b28('0x3a')],{'$or':_[_0x3b28('0x2a')](_0x25120f[_0x3b28('0x32')],function(_0x574ba0){var _0x42e3d2={};_0x42e3d2[_0x574ba0]={'$like':'%'+_0x2e084a[_0x3b28('0x2e')]['filter']+'%'};return _0x42e3d2;})});}_0x25120f=_[_0x3b28('0x3d')]({},_0x25120f,_0x2e084a[_0x3b28('0x40')]);return _0x3f60cd[_0x3b28('0x51')](_0x25120f);}})['then'](function(_0x3d6690){if(_0x3d6690){_0x5ce02a=_0x3d6690[_0x3b28('0x34')];if(!_0x2e084a[_0x3b28('0x2e')][_0x3b28('0x35')](_0x3b28('0x36'))){_0x25120f['limit']=qs['limit'](_0x2e084a['query'][_0x3b28('0x1e')]);_0x25120f['offset']=qs[_0x3b28('0x37')](_0x2e084a['query'][_0x3b28('0x37')]);}return _0x3f60cd[_0x3b28('0x51')](_0x25120f);}})[_0x3b28('0x41')](function(_0x352426){if(_0x352426){return _0x352426?{'count':_0x5ce02a,'rows':_0x352426}:null;}})[_0x3b28('0x41')](respondWithResult(_0x4f53bb,null))[_0x3b28('0x45')](handleError(_0x4f53bb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 07aeedc..5828340 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 _0x7177=['exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf','./intServicenowConfiguration.attributes'];(function(_0x3da93c,_0x412dd9){var _0x3bdda5=function(_0x448991){while(--_0x448991){_0x3da93c['push'](_0x3da93c['shift']());}};_0x3bdda5(++_0x412dd9);}(_0x7177,0x101));var _0x7717=function(_0x33a0bb,_0x5c268b){_0x33a0bb=_0x33a0bb-0x0;var _0x229f56=_0x7177[_0x33a0bb];return _0x229f56;};'use strict';var _=require(_0x7717('0x0'));var util=require('util');var logger=require(_0x7717('0x1'))('api');var moment=require(_0x7717('0x2'));var BPromise=require(_0x7717('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7717('0x4'));var rimraf=require(_0x7717('0x5'));var config=require('../../config/environment');var attributes=require(_0x7717('0x6'));module[_0x7717('0x7')]=function(_0x40e3ec,_0x20ca81){return _0x40e3ec[_0x7717('0x8')](_0x7717('0x9'),attributes,{'tableName':_0x7717('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3a0=['define','ServicenowConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1895e2,_0x26731a){var _0x29ab2f=function(_0x2763f8){while(--_0x2763f8){_0x1895e2['push'](_0x1895e2['shift']());}};_0x29ab2f(++_0x26731a);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x4446f0,_0x1dcec1){_0x4446f0=_0x4446f0-0x0;var _0x5cc013=_0xd3a0[_0x4446f0];return _0x5cc013;};'use strict';var _=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var logger=require(_0x0d3a('0x2'))(_0x0d3a('0x3'));var moment=require('moment');var BPromise=require(_0x0d3a('0x4'));var rp=require(_0x0d3a('0x5'));var fs=require('fs');var path=require(_0x0d3a('0x6'));var rimraf=require(_0x0d3a('0x7'));var config=require(_0x0d3a('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x0d3a('0x9')]=function(_0x16f051,_0x22cf8f){return _0x16f051[_0x0d3a('0xa')](_0x0d3a('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 3b48926..e626306 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 _0xe6d9=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3ca717,_0x2c0ea4){var _0x562534=function(_0x56f1d6){while(--_0x56f1d6){_0x3ca717['push'](_0x3ca717['shift']());}};_0x562534(++_0x2c0ea4);}(_0xe6d9,0x1cf));var _0x9e6d=function(_0x132671,_0x26760e){_0x132671=_0x132671-0x0;var _0x4a3b55=_0xe6d9[_0x132671];return _0x4a3b55;};'use strict';var _=require(_0x9e6d('0x0'));var util=require(_0x9e6d('0x1'));var moment=require(_0x9e6d('0x2'));var BPromise=require(_0x9e6d('0x3'));var rs=require(_0x9e6d('0x4'));var fs=require('fs');var Redis=require(_0x9e6d('0x5'));var db=require(_0x9e6d('0x6'))['db'];var utils=require(_0x9e6d('0x7'));var logger=require(_0x9e6d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e6d('0x9')][_0x9e6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ea9c4,_0x47052d,_0x4b3ac5){return new BPromise(function(_0x15dd4c,_0x3f7ed6){return client[_0x9e6d('0xb')](_0x3ea9c4,_0x4b3ac5)['then'](function(_0x1c35e7){logger['info'](_0x9e6d('0xc'),_0x47052d,_0x9e6d('0xd'));logger[_0x9e6d('0xe')](_0x9e6d('0xf'),_0x47052d,_0x9e6d('0xd'),JSON[_0x9e6d('0x10')](_0x1c35e7));if(_0x1c35e7['error']){if(_0x1c35e7['error'][_0x9e6d('0x11')]===0x1f4){logger[_0x9e6d('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47052d,_0x1c35e7[_0x9e6d('0x12')][_0x9e6d('0x13')]);return _0x3f7ed6(_0x1c35e7['error'][_0x9e6d('0x13')]);}logger[_0x9e6d('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47052d,_0x1c35e7['error'][_0x9e6d('0x13')]);return _0x15dd4c(_0x1c35e7[_0x9e6d('0x12')][_0x9e6d('0x13')]);}else{logger[_0x9e6d('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47052d,'request\x20sent');_0x15dd4c(_0x1c35e7[_0x9e6d('0x15')][_0x9e6d('0x13')]);}})[_0x9e6d('0x16')](function(_0x10abd7){logger[_0x9e6d('0x12')](_0x9e6d('0xc'),_0x47052d,_0x10abd7);_0x3f7ed6(_0x10abd7);});});} \ No newline at end of file +var _0xfca5=['request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2cb61d,_0x5b42f6){var _0x43605d=function(_0x478472){while(--_0x478472){_0x2cb61d['push'](_0x2cb61d['shift']());}};_0x43605d(++_0x5b42f6);}(_0xfca5,0xcf));var _0x5fca=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xfca5[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x5fca('0x0'));var util=require('util');var moment=require(_0x5fca('0x1'));var BPromise=require(_0x5fca('0x2'));var rs=require(_0x5fca('0x3'));var fs=require('fs');var Redis=require(_0x5fca('0x4'));var db=require(_0x5fca('0x5'))['db'];var utils=require(_0x5fca('0x6'));var logger=require(_0x5fca('0x7'))(_0x5fca('0x8'));var config=require(_0x5fca('0x9'));var jayson=require(_0x5fca('0xa'));var client=jayson[_0x5fca('0xb')][_0x5fca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51df91,_0x2aca59,_0x33314b){return new BPromise(function(_0x5ef3eb,_0x224387){return client[_0x5fca('0xd')](_0x51df91,_0x33314b)[_0x5fca('0xe')](function(_0x13a479){logger['info'](_0x5fca('0xf'),_0x2aca59,_0x5fca('0x10'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2aca59,_0x5fca('0x10'),JSON[_0x5fca('0x11')](_0x13a479));if(_0x13a479[_0x5fca('0x12')]){if(_0x13a479[_0x5fca('0x12')][_0x5fca('0x13')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x2aca59,_0x13a479[_0x5fca('0x12')][_0x5fca('0x14')]);return _0x224387(_0x13a479['error'][_0x5fca('0x14')]);}logger[_0x5fca('0x12')](_0x5fca('0xf'),_0x2aca59,_0x13a479['error']['message']);return _0x5ef3eb(_0x13a479[_0x5fca('0x12')][_0x5fca('0x14')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x2aca59,'request\x20sent');_0x5ef3eb(_0x13a479['result']['message']);}})[_0x5fca('0x15')](function(_0xb5e32e){logger[_0x5fca('0x12')](_0x5fca('0xf'),_0x2aca59,_0xb5e32e);_0x224387(_0xb5e32e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index df5e5aa..4c4e326 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 _0x89e6=['/:id','show','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2dde3e,_0x30efad){var _0x236538=function(_0x5654d5){while(--_0x5654d5){_0x2dde3e['push'](_0x2dde3e['shift']());}};_0x236538(++_0x30efad);}(_0x89e6,0x104));var _0x689e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89e6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x689e('0x0'));var path=require(_0x689e('0x1'));var timeout=require('connect-timeout');var express=require(_0x689e('0x2'));var router=express[_0x689e('0x3')]();var fs_extra=require(_0x689e('0x4'));var auth=require(_0x689e('0x5'));var interaction=require(_0x689e('0x6'));var config=require(_0x689e('0x7'));var controller=require('./intServicenowField.controller');router[_0x689e('0x8')]('/',auth[_0x689e('0x9')](),controller['index']);router['get'](_0x689e('0xa'),auth['isAuthenticated'](),controller[_0x689e('0xb')]);router[_0x689e('0xc')]('/',auth[_0x689e('0x9')](),controller['create']);router[_0x689e('0xd')](_0x689e('0xa'),auth[_0x689e('0x9')](),controller[_0x689e('0xe')]);router[_0x689e('0xf')](_0x689e('0xa'),auth[_0x689e('0x9')](),controller[_0x689e('0x10')]);module[_0x689e('0x11')]=router; \ No newline at end of file +var _0xdc2e=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xdc2e,0x99));var _0xedc2=function(_0x1bcaac,_0x1f9791){_0x1bcaac=_0x1bcaac-0x0;var _0x50dcac=_0xdc2e[_0x1bcaac];return _0x50dcac;};'use strict';var multer=require(_0xedc2('0x0'));var util=require(_0xedc2('0x1'));var path=require(_0xedc2('0x2'));var timeout=require(_0xedc2('0x3'));var express=require('express');var router=express[_0xedc2('0x4')]();var fs_extra=require(_0xedc2('0x5'));var auth=require(_0xedc2('0x6'));var interaction=require(_0xedc2('0x7'));var config=require(_0xedc2('0x8'));var controller=require(_0xedc2('0x9'));router[_0xedc2('0xa')]('/',auth[_0xedc2('0xb')](),controller[_0xedc2('0xc')]);router[_0xedc2('0xa')]('/:id',auth[_0xedc2('0xb')](),controller[_0xedc2('0xd')]);router[_0xedc2('0xe')]('/',auth[_0xedc2('0xb')](),controller[_0xedc2('0xf')]);router[_0xedc2('0x10')](_0xedc2('0x11'),auth[_0xedc2('0xb')](),controller[_0xedc2('0x12')]);router['delete'](_0xedc2('0x11'),auth[_0xedc2('0xb')](),controller['destroy']);module[_0xedc2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index c03503d..7b29ce3 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 _0x7088=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x4cb819,_0x382986){var _0x33fb18=function(_0x211d5e){while(--_0x211d5e){_0x4cb819['push'](_0x4cb819['shift']());}};_0x33fb18(++_0x382986);}(_0x7088,0x1af));var _0x8708=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7088[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0x8708('0x0'));module['exports']={'type':{'type':Sequelize[_0x8708('0x1')](_0x8708('0x2'),_0x8708('0x3'),_0x8708('0x4'),_0x8708('0x5'),_0x8708('0x6')),'defaultValue':_0x8708('0x2')},'content':{'type':Sequelize[_0x8708('0x7')]},'key':{'type':Sequelize[_0x8708('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x8708('0x2'),_0x8708('0x3'),_0x8708('0x4'))},'keyContent':{'type':Sequelize[_0x8708('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8708('0x7')]},'customField':{'type':Sequelize[_0x8708('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8708('0x7')]}}; \ No newline at end of file +var _0xf222=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0xc28004,_0x5ec9dc){var _0x7f2a45=function(_0x129bab){while(--_0x129bab){_0xc28004['push'](_0xc28004['shift']());}};_0x7f2a45(++_0x5ec9dc);}(_0xf222,0x12a));var _0x2f22=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf222[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x2f22('0x0'));module[_0x2f22('0x1')]={'type':{'type':Sequelize[_0x2f22('0x2')](_0x2f22('0x3'),'variable',_0x2f22('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2f22('0x5')]},'key':{'type':Sequelize[_0x2f22('0x5')]},'keyType':{'type':Sequelize[_0x2f22('0x2')](_0x2f22('0x3'),_0x2f22('0x6'),_0x2f22('0x4'))},'keyContent':{'type':Sequelize[_0x2f22('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2f22('0x5')]},'customField':{'type':Sequelize[_0x2f22('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f22('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 302ee47..4f328b7 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 _0x43fd=['options','includeAll','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','nolimit','limit','sort','where','pick','merge','VIRTUAL'];(function(_0x4179d5,_0x41468c){var _0x1498d9=function(_0x231131){while(--_0x231131){_0x4179d5['push'](_0x4179d5['shift']());}};_0x1498d9(++_0x41468c);}(_0x43fd,0x125));var _0xd43f=function(_0x46d578,_0x5727a4){_0x46d578=_0x46d578-0x0;var _0x53d96b=_0x43fd[_0x46d578];return _0x53d96b;};'use strict';var emlformat=require(_0xd43f('0x0'));var rimraf=require(_0xd43f('0x1'));var zipdir=require(_0xd43f('0x2'));var jsonpatch=require(_0xd43f('0x3'));var rp=require(_0xd43f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd43f('0x5'));var util=require(_0xd43f('0x6'));var path=require('path');var sox=require(_0xd43f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd43f('0x8'));var _=require(_0xd43f('0x9'));var squel=require(_0xd43f('0xa'));var crypto=require('crypto');var jsforce=require(_0xd43f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd43f('0xc'));var querystring=require('querystring');var Papa=require(_0xd43f('0xd'));var Redis=require(_0xd43f('0xe'));var authService=require(_0xd43f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd43f('0x10'));var hardwareService=require(_0xd43f('0x11'));var logger=require(_0xd43f('0x12'))(_0xd43f('0x13'));var utils=require(_0xd43f('0x14'));var config=require(_0xd43f('0x15'));var licenseUtil=require(_0xd43f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b40aa,_0x489793){_0x489793=_0x489793||0xcc;return function(_0x265893){if(_0x265893){return _0x2b40aa[_0xd43f('0x17')](_0x489793);}return _0x2b40aa[_0xd43f('0x18')](_0x489793)[_0xd43f('0x19')]();};}function respondWithResult(_0x58707a,_0x3205d8){_0x3205d8=_0x3205d8||0xc8;return function(_0xc0c200){if(_0xc0c200){return _0x58707a[_0xd43f('0x18')](_0x3205d8)[_0xd43f('0x1a')](_0xc0c200);}};}function respondWithFilteredResult(_0xff510b,_0x46a0a1){return function(_0x58e702){if(_0x58e702){var _0x468d02=typeof _0x46a0a1['offset']===_0xd43f('0x1b')&&typeof _0x46a0a1['limit']===_0xd43f('0x1b');var _0x3c98c9=_0x58e702[_0xd43f('0x1c')];var _0x1ff64b=_0x468d02?0x0:_0x46a0a1[_0xd43f('0x1d')];var _0x728c7e=_0x468d02?_0x58e702[_0xd43f('0x1c')]:_0x46a0a1[_0xd43f('0x1d')]+_0x46a0a1['limit'];var _0x39189c;if(_0x728c7e>=_0x3c98c9){_0x728c7e=_0x3c98c9;_0x39189c=0xc8;}else{_0x39189c=0xce;}_0xff510b[_0xd43f('0x18')](_0x39189c);return _0xff510b[_0xd43f('0x1e')](_0xd43f('0x1f'),_0x1ff64b+'-'+_0x728c7e+'/'+_0x3c98c9)[_0xd43f('0x1a')](_0x58e702);}return null;};}function patchUpdates(_0x453ad7){return function(_0xd26a76){try{jsonpatch[_0xd43f('0x20')](_0xd26a76,_0x453ad7,!![]);}catch(_0x50f201){return BPromise['reject'](_0x50f201);}return _0xd26a76[_0xd43f('0x21')]();};}function saveUpdates(_0x13234a,_0x29d76f){return function(_0x18b75a){if(_0x18b75a){return _0x18b75a[_0xd43f('0x22')](_0x13234a)[_0xd43f('0x23')](function(_0x1d1cae){return _0x1d1cae;});}return null;};}function removeEntity(_0x570e43,_0xac5e65){return function(_0x7c14c3){if(_0x7c14c3){return _0x7c14c3[_0xd43f('0x24')]()[_0xd43f('0x23')](function(){_0x570e43[_0xd43f('0x18')](0xcc)[_0xd43f('0x19')]();});}};}function handleEntityNotFound(_0x3ee278,_0x47d855){return function(_0x57d86f){if(!_0x57d86f){_0x3ee278[_0xd43f('0x17')](0x194);}return _0x57d86f;};}function handleError(_0x266168,_0x1de6e2){_0x1de6e2=_0x1de6e2||0x1f4;return function(_0x3d3b30){logger['error'](_0x3d3b30[_0xd43f('0x25')]);if(_0x3d3b30[_0xd43f('0x26')]){delete _0x3d3b30[_0xd43f('0x26')];}_0x266168['status'](_0x1de6e2)[_0xd43f('0x27')](_0x3d3b30);};}exports[_0xd43f('0x28')]=function(_0x4f282b,_0x2f2a50){var _0x301455={},_0x558573={},_0xe75ee2={'count':0x0,'rows':[]};var _0x366479=_[_0xd43f('0x29')](db[_0xd43f('0x2a')][_0xd43f('0x2b')],function(_0x2bc8e6){return{'name':_0x2bc8e6[_0xd43f('0x2c')],'type':_0x2bc8e6[_0xd43f('0x2d')][_0xd43f('0x2e')]};});_0x558573[_0xd43f('0x2f')]=_['map'](_0x366479,_0xd43f('0x26'));_0x558573['query']=_[_0xd43f('0x30')](_0x4f282b['query']);_0x558573[_0xd43f('0x31')]=_[_0xd43f('0x32')](_0x558573[_0xd43f('0x2f')],_0x558573['query']);_0x301455[_0xd43f('0x33')]=_[_0xd43f('0x32')](_0x558573['model'],qs[_0xd43f('0x34')](_0x4f282b['query'][_0xd43f('0x34')]));_0x301455[_0xd43f('0x33')]=_0x301455[_0xd43f('0x33')][_0xd43f('0x35')]?_0x301455[_0xd43f('0x33')]:_0x558573[_0xd43f('0x2f')];if(!_0x4f282b[_0xd43f('0x36')]['hasOwnProperty'](_0xd43f('0x37'))){_0x301455[_0xd43f('0x38')]=qs[_0xd43f('0x38')](_0x4f282b[_0xd43f('0x36')]['limit']);_0x301455[_0xd43f('0x1d')]=qs[_0xd43f('0x1d')](_0x4f282b[_0xd43f('0x36')][_0xd43f('0x1d')]);}_0x301455['order']=qs['sort'](_0x4f282b[_0xd43f('0x36')][_0xd43f('0x39')]);_0x301455[_0xd43f('0x3a')]=qs[_0xd43f('0x31')](_[_0xd43f('0x3b')](_0x4f282b[_0xd43f('0x36')],_0x558573[_0xd43f('0x31')]),_0x366479);if(_0x4f282b['query']['filter']){_0x301455['where']=_[_0xd43f('0x3c')](_0x301455[_0xd43f('0x3a')],{'$or':_['map'](_0x366479,function(_0x2c00d3){if(_0x2c00d3[_0xd43f('0x2d')]!==_0xd43f('0x3d')){var _0x53c32c={};_0x53c32c[_0x2c00d3[_0xd43f('0x26')]]={'$like':'%'+_0x4f282b[_0xd43f('0x36')]['filter']+'%'};return _0x53c32c;}})});}_0x301455=_['merge']({},_0x301455,_0x4f282b[_0xd43f('0x3e')]);var _0xd526c5={'where':_0x301455['where']};return db[_0xd43f('0x2a')]['count'](_0xd526c5)[_0xd43f('0x23')](function(_0x3e5b03){_0xe75ee2[_0xd43f('0x1c')]=_0x3e5b03;if(_0x4f282b[_0xd43f('0x36')][_0xd43f('0x3f')]){_0x301455['include']=[{'all':!![]}];}return db[_0xd43f('0x2a')][_0xd43f('0x40')](_0x301455);})['then'](function(_0x37f5db){_0xe75ee2['rows']=_0x37f5db;return _0xe75ee2;})[_0xd43f('0x23')](respondWithFilteredResult(_0x2f2a50,_0x301455))[_0xd43f('0x41')](handleError(_0x2f2a50,null));};exports[_0xd43f('0x42')]=function(_0x1281e6,_0x416dd3){var _0x381fdc={'raw':!![],'where':{'id':_0x1281e6[_0xd43f('0x43')]['id']}},_0x5db7f9={};_0x5db7f9['model']=_[_0xd43f('0x30')](db[_0xd43f('0x2a')][_0xd43f('0x2b')]);_0x5db7f9[_0xd43f('0x36')]=_['keys'](_0x1281e6['query']);_0x5db7f9[_0xd43f('0x31')]=_[_0xd43f('0x32')](_0x5db7f9[_0xd43f('0x2f')],_0x5db7f9[_0xd43f('0x36')]);_0x381fdc[_0xd43f('0x33')]=_[_0xd43f('0x32')](_0x5db7f9[_0xd43f('0x2f')],qs['fields'](_0x1281e6[_0xd43f('0x36')][_0xd43f('0x34')]));_0x381fdc[_0xd43f('0x33')]=_0x381fdc[_0xd43f('0x33')][_0xd43f('0x35')]?_0x381fdc[_0xd43f('0x33')]:_0x5db7f9[_0xd43f('0x2f')];if(_0x1281e6[_0xd43f('0x36')][_0xd43f('0x3f')]){_0x381fdc['include']=[{'all':!![]}];}_0x381fdc=_[_0xd43f('0x3c')]({},_0x381fdc,_0x1281e6[_0xd43f('0x3e')]);return db[_0xd43f('0x2a')][_0xd43f('0x44')](_0x381fdc)['then'](handleEntityNotFound(_0x416dd3,null))[_0xd43f('0x23')](respondWithResult(_0x416dd3,null))['catch'](handleError(_0x416dd3,null));};exports[_0xd43f('0x45')]=function(_0x32a25b,_0x545580){return db[_0xd43f('0x2a')]['create'](_0x32a25b['body'],{})[_0xd43f('0x23')](respondWithResult(_0x545580,0xc9))[_0xd43f('0x41')](handleError(_0x545580,null));};exports[_0xd43f('0x22')]=function(_0x4c04f9,_0x51c785){if(_0x4c04f9[_0xd43f('0x46')]['id']){delete _0x4c04f9[_0xd43f('0x46')]['id'];}return db[_0xd43f('0x2a')][_0xd43f('0x44')]({'where':{'id':_0x4c04f9[_0xd43f('0x43')]['id']}})[_0xd43f('0x23')](handleEntityNotFound(_0x51c785,null))[_0xd43f('0x23')](saveUpdates(_0x4c04f9[_0xd43f('0x46')],null))[_0xd43f('0x23')](respondWithResult(_0x51c785,null))[_0xd43f('0x41')](handleError(_0x51c785,null));};exports['destroy']=function(_0x6879ad,_0x173a79){return db[_0xd43f('0x2a')][_0xd43f('0x44')]({'where':{'id':_0x6879ad['params']['id']}})[_0xd43f('0x23')](handleEntityNotFound(_0x173a79,null))[_0xd43f('0x23')](removeEntity(_0x173a79,null))[_0xd43f('0x41')](handleError(_0x173a79,null));}; \ No newline at end of file +var _0xaa50=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0x514a2e,_0x2b44e5){var _0x6a578c=function(_0x562666){while(--_0x562666){_0x514a2e['push'](_0x514a2e['shift']());}};_0x6a578c(++_0x2b44e5);}(_0xaa50,0x7a));var _0x0aa5=function(_0x5518df,_0x456550){_0x5518df=_0x5518df-0x0;var _0x47ecf0=_0xaa50[_0x5518df];return _0x47ecf0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0aa5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0aa5('0x1'));var util=require(_0x0aa5('0x2'));var path=require(_0x0aa5('0x3'));var sox=require(_0x0aa5('0x4'));var csv=require(_0x0aa5('0x5'));var ejs=require(_0x0aa5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0aa5('0x7'));var squel=require(_0x0aa5('0x8'));var crypto=require(_0x0aa5('0x9'));var jsforce=require(_0x0aa5('0xa'));var deskjs=require(_0x0aa5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0aa5('0xc'));var Papa=require(_0x0aa5('0xd'));var Redis=require(_0x0aa5('0xe'));var authService=require(_0x0aa5('0xf'));var qs=require(_0x0aa5('0x10'));var as=require(_0x0aa5('0x11'));var hardwareService=require(_0x0aa5('0x12'));var logger=require(_0x0aa5('0x13'))('api');var utils=require(_0x0aa5('0x14'));var config=require(_0x0aa5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0aa5('0x16'))['db'];function respondWithStatusCode(_0x302c12,_0x78e782){_0x78e782=_0x78e782||0xcc;return function(_0xe043b6){if(_0xe043b6){return _0x302c12[_0x0aa5('0x17')](_0x78e782);}return _0x302c12['status'](_0x78e782)[_0x0aa5('0x18')]();};}function respondWithResult(_0x536a84,_0x25c9db){_0x25c9db=_0x25c9db||0xc8;return function(_0x4ac682){if(_0x4ac682){return _0x536a84[_0x0aa5('0x19')](_0x25c9db)[_0x0aa5('0x1a')](_0x4ac682);}};}function respondWithFilteredResult(_0x1b9a2e,_0x23f695){return function(_0x42d191){if(_0x42d191){var _0x2bb2e7=typeof _0x23f695[_0x0aa5('0x1b')]===_0x0aa5('0x1c')&&typeof _0x23f695[_0x0aa5('0x1d')]===_0x0aa5('0x1c');var _0x347dc1=_0x42d191[_0x0aa5('0x1e')];var _0x3dd108=_0x2bb2e7?0x0:_0x23f695['offset'];var _0x52e801=_0x2bb2e7?_0x42d191[_0x0aa5('0x1e')]:_0x23f695[_0x0aa5('0x1b')]+_0x23f695[_0x0aa5('0x1d')];var _0x5f26b6;if(_0x52e801>=_0x347dc1){_0x52e801=_0x347dc1;_0x5f26b6=0xc8;}else{_0x5f26b6=0xce;}_0x1b9a2e['status'](_0x5f26b6);return _0x1b9a2e[_0x0aa5('0x1f')](_0x0aa5('0x20'),_0x3dd108+'-'+_0x52e801+'/'+_0x347dc1)[_0x0aa5('0x1a')](_0x42d191);}return null;};}function patchUpdates(_0x42ab2d){return function(_0xce716){try{jsonpatch[_0x0aa5('0x21')](_0xce716,_0x42ab2d,!![]);}catch(_0x5b7567){return BPromise['reject'](_0x5b7567);}return _0xce716[_0x0aa5('0x22')]();};}function saveUpdates(_0x7c1a01,_0xd87009){return function(_0x391d70){if(_0x391d70){return _0x391d70[_0x0aa5('0x23')](_0x7c1a01)[_0x0aa5('0x24')](function(_0x5ae2b2){return _0x5ae2b2;});}return null;};}function removeEntity(_0x104e3b,_0x341f86){return function(_0x425033){if(_0x425033){return _0x425033[_0x0aa5('0x25')]()['then'](function(){_0x104e3b[_0x0aa5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a284,_0xed6114){return function(_0x3ccbc5){if(!_0x3ccbc5){_0x18a284[_0x0aa5('0x17')](0x194);}return _0x3ccbc5;};}function handleError(_0x2903ec,_0xa84486){_0xa84486=_0xa84486||0x1f4;return function(_0x4b0fee){logger[_0x0aa5('0x26')](_0x4b0fee[_0x0aa5('0x27')]);if(_0x4b0fee[_0x0aa5('0x28')]){delete _0x4b0fee[_0x0aa5('0x28')];}_0x2903ec[_0x0aa5('0x19')](_0xa84486)[_0x0aa5('0x29')](_0x4b0fee);};}exports[_0x0aa5('0x2a')]=function(_0x21cd70,_0x402b6f){var _0x5f2ae6={},_0x327caa={},_0x39b93f={'count':0x0,'rows':[]};var _0x5865b4=_[_0x0aa5('0x2b')](db[_0x0aa5('0x2c')][_0x0aa5('0x2d')],function(_0x4fa341){return{'name':_0x4fa341[_0x0aa5('0x2e')],'type':_0x4fa341[_0x0aa5('0x2f')][_0x0aa5('0x30')]};});_0x327caa['model']=_[_0x0aa5('0x2b')](_0x5865b4,_0x0aa5('0x28'));_0x327caa[_0x0aa5('0x31')]=_[_0x0aa5('0x32')](_0x21cd70[_0x0aa5('0x31')]);_0x327caa['filters']=_[_0x0aa5('0x33')](_0x327caa[_0x0aa5('0x34')],_0x327caa[_0x0aa5('0x31')]);_0x5f2ae6[_0x0aa5('0x35')]=_[_0x0aa5('0x33')](_0x327caa['model'],qs[_0x0aa5('0x36')](_0x21cd70[_0x0aa5('0x31')][_0x0aa5('0x36')]));_0x5f2ae6[_0x0aa5('0x35')]=_0x5f2ae6['attributes'][_0x0aa5('0x37')]?_0x5f2ae6[_0x0aa5('0x35')]:_0x327caa['model'];if(!_0x21cd70[_0x0aa5('0x31')][_0x0aa5('0x38')]('nolimit')){_0x5f2ae6['limit']=qs[_0x0aa5('0x1d')](_0x21cd70[_0x0aa5('0x31')][_0x0aa5('0x1d')]);_0x5f2ae6[_0x0aa5('0x1b')]=qs[_0x0aa5('0x1b')](_0x21cd70[_0x0aa5('0x31')][_0x0aa5('0x1b')]);}_0x5f2ae6[_0x0aa5('0x39')]=qs[_0x0aa5('0x3a')](_0x21cd70[_0x0aa5('0x31')][_0x0aa5('0x3a')]);_0x5f2ae6[_0x0aa5('0x3b')]=qs[_0x0aa5('0x3c')](_['pick'](_0x21cd70[_0x0aa5('0x31')],_0x327caa[_0x0aa5('0x3c')]),_0x5865b4);if(_0x21cd70['query'][_0x0aa5('0x3d')]){_0x5f2ae6[_0x0aa5('0x3b')]=_[_0x0aa5('0x3e')](_0x5f2ae6['where'],{'$or':_[_0x0aa5('0x2b')](_0x5865b4,function(_0x5dff65){if(_0x5dff65['type']!=='VIRTUAL'){var _0x509036={};_0x509036[_0x5dff65[_0x0aa5('0x28')]]={'$like':'%'+_0x21cd70[_0x0aa5('0x31')][_0x0aa5('0x3d')]+'%'};return _0x509036;}})});}_0x5f2ae6=_[_0x0aa5('0x3e')]({},_0x5f2ae6,_0x21cd70['options']);var _0x149e32={'where':_0x5f2ae6[_0x0aa5('0x3b')]};return db[_0x0aa5('0x2c')][_0x0aa5('0x1e')](_0x149e32)[_0x0aa5('0x24')](function(_0x2aabda){_0x39b93f[_0x0aa5('0x1e')]=_0x2aabda;if(_0x21cd70['query'][_0x0aa5('0x3f')]){_0x5f2ae6[_0x0aa5('0x40')]=[{'all':!![]}];}return db[_0x0aa5('0x2c')][_0x0aa5('0x41')](_0x5f2ae6);})['then'](function(_0x595b1a){_0x39b93f[_0x0aa5('0x42')]=_0x595b1a;return _0x39b93f;})[_0x0aa5('0x24')](respondWithFilteredResult(_0x402b6f,_0x5f2ae6))[_0x0aa5('0x43')](handleError(_0x402b6f,null));};exports[_0x0aa5('0x44')]=function(_0x556151,_0x5235f9){var _0x7f7d86={'raw':!![],'where':{'id':_0x556151['params']['id']}},_0xded23e={};_0xded23e['model']=_[_0x0aa5('0x32')](db[_0x0aa5('0x2c')][_0x0aa5('0x2d')]);_0xded23e[_0x0aa5('0x31')]=_['keys'](_0x556151[_0x0aa5('0x31')]);_0xded23e[_0x0aa5('0x3c')]=_[_0x0aa5('0x33')](_0xded23e[_0x0aa5('0x34')],_0xded23e[_0x0aa5('0x31')]);_0x7f7d86['attributes']=_[_0x0aa5('0x33')](_0xded23e[_0x0aa5('0x34')],qs['fields'](_0x556151['query'][_0x0aa5('0x36')]));_0x7f7d86['attributes']=_0x7f7d86[_0x0aa5('0x35')][_0x0aa5('0x37')]?_0x7f7d86[_0x0aa5('0x35')]:_0xded23e[_0x0aa5('0x34')];if(_0x556151[_0x0aa5('0x31')][_0x0aa5('0x3f')]){_0x7f7d86[_0x0aa5('0x40')]=[{'all':!![]}];}_0x7f7d86=_[_0x0aa5('0x3e')]({},_0x7f7d86,_0x556151[_0x0aa5('0x45')]);return db[_0x0aa5('0x2c')][_0x0aa5('0x46')](_0x7f7d86)[_0x0aa5('0x24')](handleEntityNotFound(_0x5235f9,null))[_0x0aa5('0x24')](respondWithResult(_0x5235f9,null))['catch'](handleError(_0x5235f9,null));};exports[_0x0aa5('0x47')]=function(_0x5081d0,_0x571120){return db[_0x0aa5('0x2c')][_0x0aa5('0x47')](_0x5081d0[_0x0aa5('0x48')],{})[_0x0aa5('0x24')](respondWithResult(_0x571120,0xc9))[_0x0aa5('0x43')](handleError(_0x571120,null));};exports['update']=function(_0x3bbb7b,_0x35185c){if(_0x3bbb7b['body']['id']){delete _0x3bbb7b[_0x0aa5('0x48')]['id'];}return db[_0x0aa5('0x2c')][_0x0aa5('0x46')]({'where':{'id':_0x3bbb7b[_0x0aa5('0x49')]['id']}})[_0x0aa5('0x24')](handleEntityNotFound(_0x35185c,null))[_0x0aa5('0x24')](saveUpdates(_0x3bbb7b[_0x0aa5('0x48')],null))[_0x0aa5('0x24')](respondWithResult(_0x35185c,null))[_0x0aa5('0x43')](handleError(_0x35185c,null));};exports[_0x0aa5('0x25')]=function(_0x4305f2,_0x37a971){return db['ServicenowField'][_0x0aa5('0x46')]({'where':{'id':_0x4305f2[_0x0aa5('0x49')]['id']}})[_0x0aa5('0x24')](handleEntityNotFound(_0x37a971,null))['then'](removeEntity(_0x37a971,null))[_0x0aa5('0x43')](handleError(_0x37a971,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index fbfb7db..3f782d9 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 _0xe822=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xe822,0xf2));var _0x2e82=function(_0x11204e,_0x19433e){_0x11204e=_0x11204e-0x0;var _0x3110f6=_0xe822[_0x11204e];return _0x3110f6;};'use strict';var _=require(_0x2e82('0x0'));var util=require(_0x2e82('0x1'));var logger=require(_0x2e82('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2e82('0x3'));var rp=require(_0x2e82('0x4'));var fs=require('fs');var path=require(_0x2e82('0x5'));var rimraf=require(_0x2e82('0x6'));var config=require(_0x2e82('0x7'));var attributes=require('./intServicenowField.attributes');module[_0x2e82('0x8')]=function(_0x24090e,_0x160b0b){return _0x24090e[_0x2e82('0x9')]('ServicenowField',attributes,{'tableName':_0x2e82('0xa'),'paranoid':![],'indexes':[{'name':_0x2e82('0xb'),'fields':[_0x2e82('0xc'),_0x2e82('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2106=['servicenow_unique_index','idField','FieldId','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x2106,0xe0));var _0x6210=function(_0x5ce152,_0xc098c3){_0x5ce152=_0x5ce152-0x0;var _0x5dd173=_0x2106[_0x5ce152];return _0x5dd173;};'use strict';var _=require('lodash');var util=require(_0x6210('0x0'));var logger=require(_0x6210('0x1'))('api');var moment=require(_0x6210('0x2'));var BPromise=require('bluebird');var rp=require(_0x6210('0x3'));var fs=require('fs');var path=require(_0x6210('0x4'));var rimraf=require(_0x6210('0x5'));var config=require(_0x6210('0x6'));var attributes=require(_0x6210('0x7'));module['exports']=function(_0x5dc703,_0x340338){return _0x5dc703[_0x6210('0x8')]('ServicenowField',attributes,{'tableName':_0x6210('0x9'),'paranoid':![],'indexes':[{'name':_0x6210('0xa'),'fields':[_0x6210('0xb'),_0x6210('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 0953c1c..9eb37f4 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 _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x9874d1,_0x13140e){var _0x1b9ef3=function(_0x1e90fd){while(--_0x1e90fd){_0x9874d1['push'](_0x9874d1['shift']());}};_0x1b9ef3(++_0x13140e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3f6d5b,_0x142405){var _0x10a002=function(_0x49e658){while(--_0x49e658){_0x3f6d5b['push'](_0x3f6d5b['shift']());}};_0x10a002(++_0x142405);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 472fc15..c6f797e 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(_0x351d08,_0x46c538){var _0x32eb85=function(_0x1cf701){while(--_0x1cf701){_0x351d08['push'](_0x351d08['shift']());}};_0x32eb85(++_0x46c538);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4858d6,_0x383e09){var _0x170bbe=function(_0x4545c6){while(--_0x4545c6){_0x4858d6['push'](_0x4858d6['shift']());}};_0x170bbe(++_0x383e09);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 04b753e..db15667 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(_0x573ca5,_0x2b9889){var _0x43e6c5=function(_0x538ca4){while(--_0x538ca4){_0x573ca5['push'](_0x573ca5['shift']());}};_0x43e6c5(++_0x2b9889);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x55ed,_0x5ec9d1){var _0x51dc12=function(_0x2a549a){while(--_0x2a549a){_0x55ed['push'](_0x55ed['shift']());}};_0x51dc12(++_0x5ec9d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 6e16123..8e78125 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 _0x0a7f=['error','name','send','index','map','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','params','findOne','SugarcrmConfiguration','order','getConfigurations','AccountId','Subjects','Descriptions','SugarcrmField','created_by','duration_hours','duration_minutes','parent_type','direction','password','remoteUri','slice','substring','lastIndexOf','%s%s','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','sendStatus'];(function(_0x1c8db6,_0x3c0c33){var _0x30a46a=function(_0x27cb17){while(--_0x27cb17){_0x1c8db6['push'](_0x1c8db6['shift']());}};_0x30a46a(++_0x3c0c33);}(_0x0a7f,0x1b2));var _0xf0a7=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x0a7f[_0x29d6e6];return _0xc75ff0;};'use strict';var emlformat=require(_0xf0a7('0x0'));var rimraf=require(_0xf0a7('0x1'));var zipdir=require(_0xf0a7('0x2'));var jsonpatch=require(_0xf0a7('0x3'));var rp=require(_0xf0a7('0x4'));var moment=require(_0xf0a7('0x5'));var BPromise=require(_0xf0a7('0x6'));var Mustache=require(_0xf0a7('0x7'));var util=require('util');var path=require(_0xf0a7('0x8'));var sox=require('sox');var csv=require(_0xf0a7('0x9'));var ejs=require(_0xf0a7('0xa'));var fs=require('fs');var fs_extra=require(_0xf0a7('0xb'));var _=require(_0xf0a7('0xc'));var squel=require(_0xf0a7('0xd'));var crypto=require(_0xf0a7('0xe'));var jsforce=require(_0xf0a7('0xf'));var deskjs=require(_0xf0a7('0x10'));var toCsv=require(_0xf0a7('0x9'));var querystring=require(_0xf0a7('0x11'));var Papa=require(_0xf0a7('0x12'));var Redis=require(_0xf0a7('0x13'));var authService=require(_0xf0a7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf0a7('0x15'));var hardwareService=require(_0xf0a7('0x16'));var logger=require(_0xf0a7('0x17'))(_0xf0a7('0x18'));var utils=require(_0xf0a7('0x19'));var config=require(_0xf0a7('0x1a'));var licenseUtil=require(_0xf0a7('0x1b'));var db=require(_0xf0a7('0x1c'))['db'];var integrations=require(_0xf0a7('0x1d'));function respondWithStatusCode(_0x1f6609,_0x313e80){_0x313e80=_0x313e80||0xcc;return function(_0x389310){if(_0x389310){return _0x1f6609['sendStatus'](_0x313e80);}return _0x1f6609['status'](_0x313e80)['end']();};}function respondWithResult(_0x55d947,_0x3b8cf5){_0x3b8cf5=_0x3b8cf5||0xc8;return function(_0x36eee0){if(_0x36eee0){return _0x55d947[_0xf0a7('0x1e')](_0x3b8cf5)[_0xf0a7('0x1f')](_0x36eee0);}};}function respondWithFilteredResult(_0x342577,_0x18a809){return function(_0x48bcac){if(_0x48bcac){var _0x593fcc=typeof _0x18a809['offset']===_0xf0a7('0x20')&&typeof _0x18a809[_0xf0a7('0x21')]===_0xf0a7('0x20');var _0x41b0bc=_0x48bcac[_0xf0a7('0x22')];var _0x2ebed4=_0x593fcc?0x0:_0x18a809['offset'];var _0x853c51=_0x593fcc?_0x48bcac['count']:_0x18a809[_0xf0a7('0x23')]+_0x18a809[_0xf0a7('0x21')];var _0xea146f;if(_0x853c51>=_0x41b0bc){_0x853c51=_0x41b0bc;_0xea146f=0xc8;}else{_0xea146f=0xce;}_0x342577[_0xf0a7('0x1e')](_0xea146f);return _0x342577['set'](_0xf0a7('0x24'),_0x2ebed4+'-'+_0x853c51+'/'+_0x41b0bc)[_0xf0a7('0x1f')](_0x48bcac);}return null;};}function patchUpdates(_0xa21aaa){return function(_0x2eb128){try{jsonpatch['apply'](_0x2eb128,_0xa21aaa,!![]);}catch(_0x3e70e0){return BPromise[_0xf0a7('0x25')](_0x3e70e0);}return _0x2eb128[_0xf0a7('0x26')]();};}function saveUpdates(_0x3749c0,_0x4df50d){return function(_0x52d45f){if(_0x52d45f){return _0x52d45f[_0xf0a7('0x27')](_0x3749c0)[_0xf0a7('0x28')](function(_0x8b3f95){return _0x8b3f95;});}return null;};}function removeEntity(_0x568022,_0x47b896){return function(_0x5476b6){if(_0x5476b6){return _0x5476b6['destroy']()[_0xf0a7('0x28')](function(){_0x568022[_0xf0a7('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48fd7f,_0x3f7554){return function(_0x38d73c){if(!_0x38d73c){_0x48fd7f[_0xf0a7('0x29')](0x194);}return _0x38d73c;};}function handleError(_0x30b0b9,_0x1997be){_0x1997be=_0x1997be||0x1f4;return function(_0x54d24b){logger[_0xf0a7('0x2a')](_0x54d24b['stack']);if(_0x54d24b[_0xf0a7('0x2b')]){delete _0x54d24b['name'];}_0x30b0b9['status'](_0x1997be)[_0xf0a7('0x2c')](_0x54d24b);};}exports[_0xf0a7('0x2d')]=function(_0xcb6956,_0x2db57c){var _0x2a1882={},_0x15f90d={},_0x5333d0={'count':0x0,'rows':[]};var _0x994c80=_[_0xf0a7('0x2e')](db['SugarcrmAccount']['rawAttributes'],function(_0x29b83b){return{'name':_0x29b83b['fieldName'],'type':_0x29b83b[_0xf0a7('0x2f')]['key']};});_0x15f90d[_0xf0a7('0x30')]=_[_0xf0a7('0x2e')](_0x994c80,_0xf0a7('0x2b'));_0x15f90d[_0xf0a7('0x31')]=_[_0xf0a7('0x32')](_0xcb6956['query']);_0x15f90d['filters']=_[_0xf0a7('0x33')](_0x15f90d[_0xf0a7('0x30')],_0x15f90d[_0xf0a7('0x31')]);_0x2a1882['attributes']=_[_0xf0a7('0x33')](_0x15f90d[_0xf0a7('0x30')],qs[_0xf0a7('0x34')](_0xcb6956[_0xf0a7('0x31')][_0xf0a7('0x34')]));_0x2a1882['attributes']=_0x2a1882['attributes'][_0xf0a7('0x35')]?_0x2a1882[_0xf0a7('0x36')]:_0x15f90d[_0xf0a7('0x30')];if(!_0xcb6956['query'][_0xf0a7('0x37')](_0xf0a7('0x38'))){_0x2a1882['limit']=qs[_0xf0a7('0x21')](_0xcb6956[_0xf0a7('0x31')]['limit']);_0x2a1882['offset']=qs[_0xf0a7('0x23')](_0xcb6956[_0xf0a7('0x31')][_0xf0a7('0x23')]);}_0x2a1882['order']=qs[_0xf0a7('0x39')](_0xcb6956[_0xf0a7('0x31')]['sort']);_0x2a1882[_0xf0a7('0x3a')]=qs[_0xf0a7('0x3b')](_[_0xf0a7('0x3c')](_0xcb6956['query'],_0x15f90d['filters']),_0x994c80);if(_0xcb6956[_0xf0a7('0x31')][_0xf0a7('0x3d')]){_0x2a1882['where']=_[_0xf0a7('0x3e')](_0x2a1882[_0xf0a7('0x3a')],{'$or':_[_0xf0a7('0x2e')](_0x994c80,function(_0x492970){if(_0x492970[_0xf0a7('0x2f')]!==_0xf0a7('0x3f')){var _0x3d80ad={};_0x3d80ad[_0x492970[_0xf0a7('0x2b')]]={'$like':'%'+_0xcb6956[_0xf0a7('0x31')][_0xf0a7('0x3d')]+'%'};return _0x3d80ad;}})});}_0x2a1882=_['merge']({},_0x2a1882,_0xcb6956[_0xf0a7('0x40')]);var _0x5779aa={'where':_0x2a1882[_0xf0a7('0x3a')]};return db[_0xf0a7('0x41')][_0xf0a7('0x22')](_0x5779aa)[_0xf0a7('0x28')](function(_0x30621b){_0x5333d0[_0xf0a7('0x22')]=_0x30621b;if(_0xcb6956['query'][_0xf0a7('0x42')]){_0x2a1882[_0xf0a7('0x43')]=[{'all':!![]}];}return db[_0xf0a7('0x41')][_0xf0a7('0x44')](_0x2a1882);})[_0xf0a7('0x28')](function(_0x1165c2){_0x5333d0[_0xf0a7('0x45')]=_0x1165c2;return _0x5333d0;})[_0xf0a7('0x28')](respondWithFilteredResult(_0x2db57c,_0x2a1882))['catch'](handleError(_0x2db57c,null));};exports[_0xf0a7('0x46')]=function(_0x1febb8,_0x1894a3){var _0x2b4d4b={'raw':![],'where':{'id':_0x1febb8['params']['id']}},_0x166cc2={};_0x166cc2[_0xf0a7('0x30')]=_[_0xf0a7('0x32')](db[_0xf0a7('0x41')][_0xf0a7('0x47')]);_0x166cc2['query']=_[_0xf0a7('0x32')](_0x1febb8[_0xf0a7('0x31')]);_0x166cc2[_0xf0a7('0x3b')]=_['intersection'](_0x166cc2[_0xf0a7('0x30')],_0x166cc2['query']);_0x2b4d4b['attributes']=_[_0xf0a7('0x33')](_0x166cc2[_0xf0a7('0x30')],qs[_0xf0a7('0x34')](_0x1febb8[_0xf0a7('0x31')][_0xf0a7('0x34')]));_0x2b4d4b[_0xf0a7('0x36')]=_0x2b4d4b[_0xf0a7('0x36')]['length']?_0x2b4d4b['attributes']:_0x166cc2[_0xf0a7('0x30')];if(_0x1febb8[_0xf0a7('0x31')]['includeAll']){_0x2b4d4b['include']=[{'all':!![]}];}_0x2b4d4b=_['merge']({},_0x2b4d4b,_0x1febb8['options']);return db[_0xf0a7('0x41')][_0xf0a7('0x48')](_0x2b4d4b)['then'](handleEntityNotFound(_0x1894a3,null))[_0xf0a7('0x28')](respondWithResult(_0x1894a3,null))['catch'](handleError(_0x1894a3,null));};exports['create']=function(_0x4fee6d,_0x80af06){return db[_0xf0a7('0x41')][_0xf0a7('0x49')](_0x4fee6d[_0xf0a7('0x4a')],{})[_0xf0a7('0x28')](respondWithResult(_0x80af06,0xc9))[_0xf0a7('0x4b')](handleError(_0x80af06,null));};exports[_0xf0a7('0x27')]=function(_0xf6d090,_0x4e7f96){if(_0xf6d090[_0xf0a7('0x4a')]['id']){delete _0xf6d090[_0xf0a7('0x4a')]['id'];}return db[_0xf0a7('0x41')][_0xf0a7('0x48')]({'where':{'id':_0xf6d090[_0xf0a7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e7f96,null))['then'](saveUpdates(_0xf6d090[_0xf0a7('0x4a')],null))[_0xf0a7('0x28')](respondWithResult(_0x4e7f96,null))['catch'](handleError(_0x4e7f96,null));};exports['destroy']=function(_0x363cad,_0x528a4c){return db[_0xf0a7('0x41')][_0xf0a7('0x48')]({'where':{'id':_0x363cad[_0xf0a7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x528a4c,null))[_0xf0a7('0x28')](removeEntity(_0x528a4c,null))[_0xf0a7('0x4b')](handleError(_0x528a4c,null));};exports['getConfigurations']=function(_0x58e60b,_0x12b856,_0xe4f07b){var _0x2c5ebb={};var _0xe085af={};var _0x1543d4;var _0x36b440;return db['SugarcrmAccount'][_0xf0a7('0x4d')]({'where':{'id':_0x58e60b['params']['id']}})[_0xf0a7('0x28')](handleEntityNotFound(_0x12b856,null))['then'](function(_0x47f464){if(_0x47f464){_0x1543d4=_0x47f464;_0xe085af[_0xf0a7('0x30')]=_[_0xf0a7('0x32')](db[_0xf0a7('0x4e')]['rawAttributes']);_0xe085af['query']=_[_0xf0a7('0x32')](_0x58e60b[_0xf0a7('0x31')]);_0xe085af[_0xf0a7('0x3b')]=_[_0xf0a7('0x33')](_0xe085af[_0xf0a7('0x30')],_0xe085af[_0xf0a7('0x31')]);_0x2c5ebb['attributes']=_[_0xf0a7('0x33')](_0xe085af[_0xf0a7('0x30')],qs[_0xf0a7('0x34')](_0x58e60b[_0xf0a7('0x31')][_0xf0a7('0x34')]));_0x2c5ebb[_0xf0a7('0x36')]=_0x2c5ebb[_0xf0a7('0x36')][_0xf0a7('0x35')]?_0x2c5ebb[_0xf0a7('0x36')]:_0xe085af[_0xf0a7('0x30')];_0x2c5ebb[_0xf0a7('0x4f')]=qs['sort'](_0x58e60b[_0xf0a7('0x31')][_0xf0a7('0x39')]);_0x2c5ebb[_0xf0a7('0x3a')]=qs[_0xf0a7('0x3b')](_['pick'](_0x58e60b[_0xf0a7('0x31')],_0xe085af['filters']));if(_0x58e60b['query'][_0xf0a7('0x3d')]){_0x2c5ebb[_0xf0a7('0x3a')]=_['merge'](_0x2c5ebb[_0xf0a7('0x3a')],{'$or':_[_0xf0a7('0x2e')](_0x2c5ebb[_0xf0a7('0x36')],function(_0x2a0f77){var _0x4eca38={};_0x4eca38[_0x2a0f77]={'$like':'%'+_0x58e60b[_0xf0a7('0x31')][_0xf0a7('0x3d')]+'%'};return _0x4eca38;})});}_0x2c5ebb=_[_0xf0a7('0x3e')]({},_0x2c5ebb,_0x58e60b['options']);return _0x1543d4[_0xf0a7('0x50')](_0x2c5ebb);}})['then'](function(_0x51d3f6){if(_0x51d3f6){_0x36b440=_0x51d3f6['length'];if(!_0x58e60b['query']['hasOwnProperty'](_0xf0a7('0x38'))){_0x2c5ebb[_0xf0a7('0x21')]=qs['limit'](_0x58e60b[_0xf0a7('0x31')][_0xf0a7('0x21')]);_0x2c5ebb[_0xf0a7('0x23')]=qs[_0xf0a7('0x23')](_0x58e60b[_0xf0a7('0x31')][_0xf0a7('0x23')]);}return _0x1543d4[_0xf0a7('0x50')](_0x2c5ebb);}})[_0xf0a7('0x28')](function(_0x378baa){if(_0x378baa){return _0x378baa?{'count':_0x36b440,'rows':_0x378baa}:null;}})[_0xf0a7('0x28')](respondWithResult(_0x12b856,null))[_0xf0a7('0x4b')](handleError(_0x12b856,null));};exports['addConfiguration']=function(_0x5bc72c,_0x2e5848,_0xdf3e48){if(_0x5bc72c[_0xf0a7('0x4a')]['id']){delete _0x5bc72c[_0xf0a7('0x4a')]['id'];}return db['SugarcrmAccount'][_0xf0a7('0x4d')]({'where':{'id':_0x5bc72c[_0xf0a7('0x4c')]['id']}})[_0xf0a7('0x28')](handleEntityNotFound(_0x2e5848,null))[_0xf0a7('0x28')](function(_0x58d78d){if(_0x58d78d){_0x5bc72c[_0xf0a7('0x4a')][_0xf0a7('0x51')]=_0x58d78d['id'];_0x5bc72c['body'][_0xf0a7('0x52')]=integrations['getSubjects'](_0x5bc72c['body']['channel'],_0x5bc72c[_0xf0a7('0x4a')][_0xf0a7('0x2f')]);_0x5bc72c[_0xf0a7('0x4a')][_0xf0a7('0x53')]=integrations['getDescriptions'](_0x5bc72c[_0xf0a7('0x4a')]['channel'],_0x5bc72c[_0xf0a7('0x4a')][_0xf0a7('0x2f')]);return db[_0xf0a7('0x4e')]['create'](_0x5bc72c[_0xf0a7('0x4a')],{'include':[{'model':db[_0xf0a7('0x54')],'as':'Subjects'},{'model':db[_0xf0a7('0x54')],'as':_0xf0a7('0x53')}]});}return null;})['then'](respondWithResult(_0x2e5848,null))['catch'](handleError(_0x2e5848,null));};exports['getFields']=function(_0x314488,_0x3120da,_0x4bbebb){var _0x3db1df='';var _0x24e92b=['id',_0xf0a7('0x2b'),'assigned_user_id',_0xf0a7('0x55'),'description','date_start',_0xf0a7('0x56'),_0xf0a7('0x57'),'parent_id',_0xf0a7('0x58'),'parent_name',_0xf0a7('0x59')];return db[_0xf0a7('0x41')]['findOne']({'where':{'id':_0x314488[_0xf0a7('0x4c')]['id']},'attributes':['id','username',_0xf0a7('0x5a'),_0xf0a7('0x5b')]})[_0xf0a7('0x28')](handleEntityNotFound(_0x3120da,null))[_0xf0a7('0x28')](function(_0x502f3e){if(_0x502f3e){_0x3db1df=_0x502f3e[_0xf0a7('0x5b')];var _0x2e0ac5=_0x3db1df[_0xf0a7('0x5c')](-0x1);if(_0x2e0ac5==='/'){_0x3db1df=_0x3db1df[_0xf0a7('0x5d')](0x0,_0x3db1df[_0xf0a7('0x5e')](_0x2e0ac5));}return rp({'method':'POST','uri':util['format'](_0xf0a7('0x5f'),_0x3db1df,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xf0a7('0x60'),'input_type':_0xf0a7('0x61'),'response_type':_0xf0a7('0x61'),'rest_data':JSON[_0xf0a7('0x62')]({'user_auth':{'user_name':_0x502f3e[_0xf0a7('0x63')],'password':_0x502f3e['password'],'encryption':_0xf0a7('0x64')},'application':_0xf0a7('0x65')})}});}})['then'](function(_0x2b1102){if(_0x2b1102&&_0x2b1102[_0xf0a7('0x2b')]!==_0xf0a7('0x66')&&_0x2b1102[_0xf0a7('0x2b')]!==_0xf0a7('0x67')){return rp({'method':_0xf0a7('0x68'),'uri':util[_0xf0a7('0x69')](_0xf0a7('0x5f'),_0x3db1df,_0xf0a7('0x6a')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xf0a7('0x61'),'rest_data':JSON['stringify']({'session':_0x2b1102['id'],'module_name':_0xf0a7('0x6b')})}})['then'](function(_0x35a3b2){if(_0x35a3b2){var _0x3f729f=_[_0xf0a7('0x6c')](_0x35a3b2[_0xf0a7('0x6d')]);_[_0xf0a7('0x6e')](_0x3f729f,function(_0x2138d0){return _0x24e92b[_0xf0a7('0x6f')](_0x2138d0[_0xf0a7('0x2b')]);});return{'count':_0x3f729f['length'],'rows':_[_0xf0a7('0x2e')](_0x3f729f,function(_0x335abc){return{'id':_0x335abc[_0xf0a7('0x2b')],'name':_0x335abc[_0xf0a7('0x70')],'custom':_[_0xf0a7('0x71')](_0x335abc[_0xf0a7('0x2b')],'_c')?!![]:![],'options':_0x335abc[_0xf0a7('0x40')]?_[_0xf0a7('0x2e')](_['values'](_0x335abc[_0xf0a7('0x40')]),function(_0x264501){return{'name':_0x264501[_0xf0a7('0x72')],'value':_0x264501['name']};}):[]};})};}})[_0xf0a7('0x28')](respondWithResult(_0x3120da,null))[_0xf0a7('0x4b')](function(_0x1a87e5){var _0x5e9358=_0x314488[_0xf0a7('0x31')][_0xf0a7('0x73')]?0x1f4:_0x1a87e5[_0xf0a7('0x74')]||0x1f4;logger[_0xf0a7('0x2a')](_0xf0a7('0x75'),'getFields',_0x5e9358,JSON[_0xf0a7('0x62')](_0x1a87e5));delete _0x1a87e5[_0xf0a7('0x2b')];if(_0x5e9358===0x191){_0x5e9358=0x190;}_0x3120da[_0xf0a7('0x1e')](_0x5e9358)[_0xf0a7('0x2c')](_0x314488[_0xf0a7('0x31')][_0xf0a7('0x73')]?{'message':_0xf0a7('0x76'),'statusCode':_0x1a87e5['statusCode']}:_0x1a87e5);});}else{var _0x564730=0x1f4;_0x3120da[_0xf0a7('0x1e')](_0x564730)[_0xf0a7('0x2c')]({'message':_0xf0a7('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x73bc=['path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','destroy','then','end','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','getConfigurations','findOne','order','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x73bc,0x76));var _0xc73b=function(_0xd1eace,_0xc110c0){_0xd1eace=_0xd1eace-0x0;var _0x31511e=_0x73bc[_0xd1eace];return _0x31511e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc73b('0x0'));var zipdir=require(_0xc73b('0x1'));var jsonpatch=require(_0xc73b('0x2'));var rp=require(_0xc73b('0x3'));var moment=require('moment');var BPromise=require(_0xc73b('0x4'));var Mustache=require(_0xc73b('0x5'));var util=require(_0xc73b('0x6'));var path=require(_0xc73b('0x7'));var sox=require(_0xc73b('0x8'));var csv=require(_0xc73b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc73b('0xa'));var _=require(_0xc73b('0xb'));var squel=require('squel');var crypto=require(_0xc73b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc73b('0x9'));var querystring=require(_0xc73b('0xd'));var Papa=require(_0xc73b('0xe'));var Redis=require(_0xc73b('0xf'));var authService=require(_0xc73b('0x10'));var qs=require(_0xc73b('0x11'));var as=require(_0xc73b('0x12'));var hardwareService=require(_0xc73b('0x13'));var logger=require(_0xc73b('0x14'))(_0xc73b('0x15'));var utils=require(_0xc73b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc73b('0x17'));var db=require(_0xc73b('0x18'))['db'];var integrations=require(_0xc73b('0x19'));function respondWithStatusCode(_0xe4b73b,_0x32059e){_0x32059e=_0x32059e||0xcc;return function(_0x5cbf91){if(_0x5cbf91){return _0xe4b73b[_0xc73b('0x1a')](_0x32059e);}return _0xe4b73b[_0xc73b('0x1b')](_0x32059e)['end']();};}function respondWithResult(_0x5d4b71,_0x170599){_0x170599=_0x170599||0xc8;return function(_0x3a0a83){if(_0x3a0a83){return _0x5d4b71[_0xc73b('0x1b')](_0x170599)[_0xc73b('0x1c')](_0x3a0a83);}};}function respondWithFilteredResult(_0x5d3dd3,_0x451b40){return function(_0x3d5012){if(_0x3d5012){var _0x15a8c5=typeof _0x451b40[_0xc73b('0x1d')]===_0xc73b('0x1e')&&typeof _0x451b40[_0xc73b('0x1f')]===_0xc73b('0x1e');var _0x95ce6a=_0x3d5012[_0xc73b('0x20')];var _0x1d0169=_0x15a8c5?0x0:_0x451b40['offset'];var _0x37a417=_0x15a8c5?_0x3d5012[_0xc73b('0x20')]:_0x451b40['offset']+_0x451b40[_0xc73b('0x1f')];var _0x3704c8;if(_0x37a417>=_0x95ce6a){_0x37a417=_0x95ce6a;_0x3704c8=0xc8;}else{_0x3704c8=0xce;}_0x5d3dd3[_0xc73b('0x1b')](_0x3704c8);return _0x5d3dd3[_0xc73b('0x21')]('Content-Range',_0x1d0169+'-'+_0x37a417+'/'+_0x95ce6a)[_0xc73b('0x1c')](_0x3d5012);}return null;};}function patchUpdates(_0x108b74){return function(_0x3465f9){try{jsonpatch[_0xc73b('0x22')](_0x3465f9,_0x108b74,!![]);}catch(_0x591f3e){return BPromise['reject'](_0x591f3e);}return _0x3465f9['save']();};}function saveUpdates(_0x5c361e,_0x37ac6a){return function(_0x3e930a){if(_0x3e930a){return _0x3e930a[_0xc73b('0x23')](_0x5c361e)['then'](function(_0x564e32){return _0x564e32;});}return null;};}function removeEntity(_0x569d35,_0x5ec2ba){return function(_0x1af0f7){if(_0x1af0f7){return _0x1af0f7[_0xc73b('0x24')]()[_0xc73b('0x25')](function(){_0x569d35['status'](0xcc)[_0xc73b('0x26')]();});}};}function handleEntityNotFound(_0x54cc3a,_0x3b875b){return function(_0x2d2b4d){if(!_0x2d2b4d){_0x54cc3a[_0xc73b('0x1a')](0x194);}return _0x2d2b4d;};}function handleError(_0x3aba0a,_0x1e8455){_0x1e8455=_0x1e8455||0x1f4;return function(_0x12267b){logger['error'](_0x12267b[_0xc73b('0x27')]);if(_0x12267b[_0xc73b('0x28')]){delete _0x12267b[_0xc73b('0x28')];}_0x3aba0a[_0xc73b('0x1b')](_0x1e8455)[_0xc73b('0x29')](_0x12267b);};}exports[_0xc73b('0x2a')]=function(_0x35a8cf,_0x15f38d){var _0x475582={},_0x2bfcd2={},_0x4134bb={'count':0x0,'rows':[]};var _0x4f5701=_[_0xc73b('0x2b')](db[_0xc73b('0x2c')][_0xc73b('0x2d')],function(_0x1dffd5){return{'name':_0x1dffd5['fieldName'],'type':_0x1dffd5[_0xc73b('0x2e')][_0xc73b('0x2f')]};});_0x2bfcd2[_0xc73b('0x30')]=_[_0xc73b('0x2b')](_0x4f5701,'name');_0x2bfcd2[_0xc73b('0x31')]=_['keys'](_0x35a8cf[_0xc73b('0x31')]);_0x2bfcd2['filters']=_[_0xc73b('0x32')](_0x2bfcd2[_0xc73b('0x30')],_0x2bfcd2[_0xc73b('0x31')]);_0x475582[_0xc73b('0x33')]=_['intersection'](_0x2bfcd2['model'],qs['fields'](_0x35a8cf['query'][_0xc73b('0x34')]));_0x475582[_0xc73b('0x33')]=_0x475582[_0xc73b('0x33')][_0xc73b('0x35')]?_0x475582[_0xc73b('0x33')]:_0x2bfcd2[_0xc73b('0x30')];if(!_0x35a8cf[_0xc73b('0x31')][_0xc73b('0x36')](_0xc73b('0x37'))){_0x475582['limit']=qs[_0xc73b('0x1f')](_0x35a8cf[_0xc73b('0x31')][_0xc73b('0x1f')]);_0x475582[_0xc73b('0x1d')]=qs[_0xc73b('0x1d')](_0x35a8cf[_0xc73b('0x31')][_0xc73b('0x1d')]);}_0x475582['order']=qs[_0xc73b('0x38')](_0x35a8cf['query'][_0xc73b('0x38')]);_0x475582[_0xc73b('0x39')]=qs['filters'](_['pick'](_0x35a8cf[_0xc73b('0x31')],_0x2bfcd2[_0xc73b('0x3a')]),_0x4f5701);if(_0x35a8cf[_0xc73b('0x31')][_0xc73b('0x3b')]){_0x475582[_0xc73b('0x39')]=_[_0xc73b('0x3c')](_0x475582[_0xc73b('0x39')],{'$or':_['map'](_0x4f5701,function(_0x4ef025){if(_0x4ef025[_0xc73b('0x2e')]!==_0xc73b('0x3d')){var _0x4b604a={};_0x4b604a[_0x4ef025[_0xc73b('0x28')]]={'$like':'%'+_0x35a8cf[_0xc73b('0x31')]['filter']+'%'};return _0x4b604a;}})});}_0x475582=_['merge']({},_0x475582,_0x35a8cf['options']);var _0x1b5e36={'where':_0x475582['where']};return db['SugarcrmAccount'][_0xc73b('0x20')](_0x1b5e36)[_0xc73b('0x25')](function(_0x2937cc){_0x4134bb[_0xc73b('0x20')]=_0x2937cc;if(_0x35a8cf[_0xc73b('0x31')][_0xc73b('0x3e')]){_0x475582[_0xc73b('0x3f')]=[{'all':!![]}];}return db[_0xc73b('0x2c')][_0xc73b('0x40')](_0x475582);})['then'](function(_0x3eae10){_0x4134bb[_0xc73b('0x41')]=_0x3eae10;return _0x4134bb;})['then'](respondWithFilteredResult(_0x15f38d,_0x475582))['catch'](handleError(_0x15f38d,null));};exports[_0xc73b('0x42')]=function(_0x526652,_0xc047b){var _0x3df949={'raw':![],'where':{'id':_0x526652[_0xc73b('0x43')]['id']}},_0x4c322a={};_0x4c322a[_0xc73b('0x30')]=_[_0xc73b('0x44')](db[_0xc73b('0x2c')][_0xc73b('0x2d')]);_0x4c322a[_0xc73b('0x31')]=_['keys'](_0x526652['query']);_0x4c322a[_0xc73b('0x3a')]=_['intersection'](_0x4c322a[_0xc73b('0x30')],_0x4c322a['query']);_0x3df949[_0xc73b('0x33')]=_[_0xc73b('0x32')](_0x4c322a['model'],qs['fields'](_0x526652[_0xc73b('0x31')]['fields']));_0x3df949[_0xc73b('0x33')]=_0x3df949[_0xc73b('0x33')][_0xc73b('0x35')]?_0x3df949[_0xc73b('0x33')]:_0x4c322a[_0xc73b('0x30')];if(_0x526652['query'][_0xc73b('0x3e')]){_0x3df949[_0xc73b('0x3f')]=[{'all':!![]}];}_0x3df949=_[_0xc73b('0x3c')]({},_0x3df949,_0x526652[_0xc73b('0x45')]);return db[_0xc73b('0x2c')][_0xc73b('0x46')](_0x3df949)[_0xc73b('0x25')](handleEntityNotFound(_0xc047b,null))[_0xc73b('0x25')](respondWithResult(_0xc047b,null))[_0xc73b('0x47')](handleError(_0xc047b,null));};exports[_0xc73b('0x48')]=function(_0x574fcd,_0xb84a3a){return db[_0xc73b('0x2c')][_0xc73b('0x48')](_0x574fcd[_0xc73b('0x49')],{})['then'](respondWithResult(_0xb84a3a,0xc9))[_0xc73b('0x47')](handleError(_0xb84a3a,null));};exports[_0xc73b('0x23')]=function(_0x1cb932,_0x43896a){if(_0x1cb932[_0xc73b('0x49')]['id']){delete _0x1cb932['body']['id'];}return db[_0xc73b('0x2c')][_0xc73b('0x46')]({'where':{'id':_0x1cb932[_0xc73b('0x43')]['id']}})[_0xc73b('0x25')](handleEntityNotFound(_0x43896a,null))[_0xc73b('0x25')](saveUpdates(_0x1cb932[_0xc73b('0x49')],null))['then'](respondWithResult(_0x43896a,null))[_0xc73b('0x47')](handleError(_0x43896a,null));};exports[_0xc73b('0x24')]=function(_0x47dba8,_0x5876a5){return db['SugarcrmAccount'][_0xc73b('0x46')]({'where':{'id':_0x47dba8[_0xc73b('0x43')]['id']}})[_0xc73b('0x25')](handleEntityNotFound(_0x5876a5,null))[_0xc73b('0x25')](removeEntity(_0x5876a5,null))[_0xc73b('0x47')](handleError(_0x5876a5,null));};exports[_0xc73b('0x4a')]=function(_0x211b93,_0x5eb32b,_0x25c0e0){var _0x4841d1={};var _0x31db68={};var _0x36d394;var _0x37cc5e;return db[_0xc73b('0x2c')][_0xc73b('0x4b')]({'where':{'id':_0x211b93['params']['id']}})['then'](handleEntityNotFound(_0x5eb32b,null))[_0xc73b('0x25')](function(_0x381a98){if(_0x381a98){_0x36d394=_0x381a98;_0x31db68['model']=_[_0xc73b('0x44')](db['SugarcrmConfiguration'][_0xc73b('0x2d')]);_0x31db68[_0xc73b('0x31')]=_[_0xc73b('0x44')](_0x211b93[_0xc73b('0x31')]);_0x31db68['filters']=_[_0xc73b('0x32')](_0x31db68[_0xc73b('0x30')],_0x31db68[_0xc73b('0x31')]);_0x4841d1[_0xc73b('0x33')]=_['intersection'](_0x31db68[_0xc73b('0x30')],qs[_0xc73b('0x34')](_0x211b93['query'][_0xc73b('0x34')]));_0x4841d1[_0xc73b('0x33')]=_0x4841d1[_0xc73b('0x33')]['length']?_0x4841d1[_0xc73b('0x33')]:_0x31db68[_0xc73b('0x30')];_0x4841d1[_0xc73b('0x4c')]=qs['sort'](_0x211b93[_0xc73b('0x31')][_0xc73b('0x38')]);_0x4841d1[_0xc73b('0x39')]=qs['filters'](_[_0xc73b('0x4d')](_0x211b93[_0xc73b('0x31')],_0x31db68[_0xc73b('0x3a')]));if(_0x211b93[_0xc73b('0x31')][_0xc73b('0x3b')]){_0x4841d1['where']=_[_0xc73b('0x3c')](_0x4841d1[_0xc73b('0x39')],{'$or':_['map'](_0x4841d1['attributes'],function(_0x584d1b){var _0x18e6c1={};_0x18e6c1[_0x584d1b]={'$like':'%'+_0x211b93[_0xc73b('0x31')][_0xc73b('0x3b')]+'%'};return _0x18e6c1;})});}_0x4841d1=_[_0xc73b('0x3c')]({},_0x4841d1,_0x211b93['options']);return _0x36d394[_0xc73b('0x4a')](_0x4841d1);}})['then'](function(_0x2a4582){if(_0x2a4582){_0x37cc5e=_0x2a4582[_0xc73b('0x35')];if(!_0x211b93['query']['hasOwnProperty'](_0xc73b('0x37'))){_0x4841d1[_0xc73b('0x1f')]=qs[_0xc73b('0x1f')](_0x211b93['query'][_0xc73b('0x1f')]);_0x4841d1[_0xc73b('0x1d')]=qs[_0xc73b('0x1d')](_0x211b93[_0xc73b('0x31')][_0xc73b('0x1d')]);}return _0x36d394[_0xc73b('0x4a')](_0x4841d1);}})[_0xc73b('0x25')](function(_0xab1385){if(_0xab1385){return _0xab1385?{'count':_0x37cc5e,'rows':_0xab1385}:null;}})[_0xc73b('0x25')](respondWithResult(_0x5eb32b,null))[_0xc73b('0x47')](handleError(_0x5eb32b,null));};exports[_0xc73b('0x4e')]=function(_0x865ef7,_0x41828e,_0x35b376){if(_0x865ef7[_0xc73b('0x49')]['id']){delete _0x865ef7[_0xc73b('0x49')]['id'];}return db[_0xc73b('0x2c')][_0xc73b('0x4b')]({'where':{'id':_0x865ef7[_0xc73b('0x43')]['id']}})[_0xc73b('0x25')](handleEntityNotFound(_0x41828e,null))['then'](function(_0xf9b6b6){if(_0xf9b6b6){_0x865ef7[_0xc73b('0x49')][_0xc73b('0x4f')]=_0xf9b6b6['id'];_0x865ef7['body']['Subjects']=integrations[_0xc73b('0x50')](_0x865ef7[_0xc73b('0x49')][_0xc73b('0x51')],_0x865ef7[_0xc73b('0x49')][_0xc73b('0x2e')]);_0x865ef7['body'][_0xc73b('0x52')]=integrations[_0xc73b('0x53')](_0x865ef7[_0xc73b('0x49')][_0xc73b('0x51')],_0x865ef7[_0xc73b('0x49')][_0xc73b('0x2e')]);return db[_0xc73b('0x54')]['create'](_0x865ef7[_0xc73b('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xc73b('0x55')},{'model':db[_0xc73b('0x56')],'as':_0xc73b('0x52')}]});}return null;})['then'](respondWithResult(_0x41828e,null))[_0xc73b('0x47')](handleError(_0x41828e,null));};exports[_0xc73b('0x57')]=function(_0x302b99,_0x551dd7,_0x28c084){var _0x21945d='';var _0x52eac7=['id',_0xc73b('0x28'),_0xc73b('0x58'),_0xc73b('0x59'),_0xc73b('0x5a'),_0xc73b('0x5b'),_0xc73b('0x5c'),_0xc73b('0x5d'),_0xc73b('0x5e'),'parent_type',_0xc73b('0x5f'),_0xc73b('0x60')];return db[_0xc73b('0x2c')]['findOne']({'where':{'id':_0x302b99[_0xc73b('0x43')]['id']},'attributes':['id',_0xc73b('0x61'),_0xc73b('0x62'),'remoteUri']})[_0xc73b('0x25')](handleEntityNotFound(_0x551dd7,null))[_0xc73b('0x25')](function(_0x5bb1af){if(_0x5bb1af){_0x21945d=_0x5bb1af[_0xc73b('0x63')];var _0x40da96=_0x21945d[_0xc73b('0x64')](-0x1);if(_0x40da96==='/'){_0x21945d=_0x21945d[_0xc73b('0x65')](0x0,_0x21945d[_0xc73b('0x66')](_0x40da96));}return rp({'method':'POST','uri':util[_0xc73b('0x67')](_0xc73b('0x68'),_0x21945d,_0xc73b('0x69')),'json':!![],'form':{'method':_0xc73b('0x6a'),'input_type':'JSON','response_type':_0xc73b('0x6b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5bb1af[_0xc73b('0x61')],'password':_0x5bb1af[_0xc73b('0x62')],'encryption':'PLAIN'},'application':_0xc73b('0x6c')})}});}})[_0xc73b('0x25')](function(_0x2bcfd0){if(_0x2bcfd0&&_0x2bcfd0['name']!==_0xc73b('0x6d')&&_0x2bcfd0['name']!==_0xc73b('0x6e')){return rp({'method':_0xc73b('0x6f'),'uri':util[_0xc73b('0x67')](_0xc73b('0x68'),_0x21945d,_0xc73b('0x69')),'json':!![],'form':{'method':_0xc73b('0x70'),'input_type':_0xc73b('0x6b'),'response_type':_0xc73b('0x6b'),'rest_data':JSON['stringify']({'session':_0x2bcfd0['id'],'module_name':_0xc73b('0x71')})}})['then'](function(_0x24c343){if(_0x24c343){var _0x51ff05=_[_0xc73b('0x72')](_0x24c343[_0xc73b('0x73')]);_[_0xc73b('0x74')](_0x51ff05,function(_0x217d93){return _0x52eac7[_0xc73b('0x75')](_0x217d93['name']);});return{'count':_0x51ff05[_0xc73b('0x35')],'rows':_[_0xc73b('0x2b')](_0x51ff05,function(_0x28ecd7){return{'id':_0x28ecd7['name'],'name':_0x28ecd7['label'],'custom':_[_0xc73b('0x76')](_0x28ecd7[_0xc73b('0x28')],'_c')?!![]:![],'options':_0x28ecd7[_0xc73b('0x45')]?_[_0xc73b('0x2b')](_[_0xc73b('0x72')](_0x28ecd7[_0xc73b('0x45')]),function(_0x294455){return{'name':_0x294455[_0xc73b('0x77')],'value':_0x294455[_0xc73b('0x28')]};}):[]};})};}})[_0xc73b('0x25')](respondWithResult(_0x551dd7,null))[_0xc73b('0x47')](function(_0x490ba5){var _0x5dc343=_0x302b99[_0xc73b('0x31')][_0xc73b('0x78')]?0x1f4:_0x490ba5[_0xc73b('0x79')]||0x1f4;logger[_0xc73b('0x7a')](_0xc73b('0x7b'),_0xc73b('0x57'),_0x5dc343,JSON[_0xc73b('0x7c')](_0x490ba5));delete _0x490ba5[_0xc73b('0x28')];if(_0x5dc343===0x191){_0x5dc343=0x190;}_0x551dd7[_0xc73b('0x1b')](_0x5dc343)['send'](_0x302b99[_0xc73b('0x31')][_0xc73b('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x490ba5[_0xc73b('0x79')]}:_0x490ba5);});}else{var _0x40ff48=0x1f4;_0x551dd7[_0xc73b('0x1b')](_0x40ff48)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index b8ec60c..91a51f0 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 _0xfd33=['SugarcrmAccount','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x49348a,_0x2ca546){var _0x209919=function(_0x595087){while(--_0x595087){_0x49348a['push'](_0x49348a['shift']());}};_0x209919(++_0x2ca546);}(_0xfd33,0xe8));var _0x3fd3=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xfd33[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x3fd3('0x0'));var util=require(_0x3fd3('0x1'));var logger=require(_0x3fd3('0x2'))(_0x3fd3('0x3'));var moment=require('moment');var BPromise=require(_0x3fd3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fd3('0x5'));var rimraf=require('rimraf');var config=require(_0x3fd3('0x6'));var attributes=require(_0x3fd3('0x7'));var integrations=require(_0x3fd3('0x8'));module[_0x3fd3('0x9')]=function(_0x32031a,_0xafc60d){return _0x32031a['define'](_0x3fd3('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcff9=['bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','lodash','util','../../config/logger','api'];(function(_0x2da19b,_0x4d660f){var _0x11eb51=function(_0x10523c){while(--_0x10523c){_0x2da19b['push'](_0x2da19b['shift']());}};_0x11eb51(++_0x4d660f);}(_0xcff9,0x8c));var _0x9cff=function(_0x435d2d,_0x5c1865){_0x435d2d=_0x435d2d-0x0;var _0x3bde90=_0xcff9[_0x435d2d];return _0x3bde90;};'use strict';var _=require(_0x9cff('0x0'));var util=require(_0x9cff('0x1'));var logger=require(_0x9cff('0x2'))(_0x9cff('0x3'));var moment=require('moment');var BPromise=require(_0x9cff('0x4'));var rp=require(_0x9cff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9cff('0x6'));var config=require(_0x9cff('0x7'));var attributes=require(_0x9cff('0x8'));var integrations=require(_0x9cff('0x9'));module[_0x9cff('0xa')]=function(_0x1825f5,_0x48e4d8){return _0x1825f5['define'](_0x9cff('0xb'),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 19cf99e..a1112b9 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 _0x1156=['info','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','model','catch','ShowSugarcrmAccount','find','map','lodash','util','bluebird','../../config/utils','rpc','../../config/environment','client','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x21b9b3,_0x4f2573){var _0x509ef6=function(_0x43509b){while(--_0x43509b){_0x21b9b3['push'](_0x21b9b3['shift']());}};_0x509ef6(++_0x4f2573);}(_0x1156,0x6f));var _0x6115=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x1156[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0x6115('0x0'));var util=require(_0x6115('0x1'));var moment=require('moment');var BPromise=require(_0x6115('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6115('0x3'));var logger=require('../../config/logger')(_0x6115('0x4'));var config=require(_0x6115('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6115('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bcad9,_0x14a54b,_0x47f3eb){return new BPromise(function(_0x4312e1,_0x73a12){return client[_0x6115('0x7')](_0x5bcad9,_0x47f3eb)[_0x6115('0x8')](function(_0x108dd7){logger['info'](_0x6115('0x9'),_0x14a54b,'request\x20sent');logger[_0x6115('0xa')](_0x6115('0xb'),_0x14a54b,_0x6115('0xc'),JSON[_0x6115('0xd')](_0x108dd7));if(_0x108dd7['error']){if(_0x108dd7['error'][_0x6115('0xe')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x14a54b,_0x108dd7[_0x6115('0xf')][_0x6115('0x10')]);return _0x73a12(_0x108dd7[_0x6115('0xf')][_0x6115('0x10')]);}logger[_0x6115('0xf')](_0x6115('0x9'),_0x14a54b,_0x108dd7[_0x6115('0xf')][_0x6115('0x10')]);return _0x4312e1(_0x108dd7[_0x6115('0xf')][_0x6115('0x10')]);}else{logger[_0x6115('0x11')](_0x6115('0x9'),_0x14a54b,'request\x20sent');_0x4312e1(_0x108dd7[_0x6115('0x12')]['message']);}})['catch'](function(_0x159879){logger[_0x6115('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x14a54b,_0x159879);_0x73a12(_0x159879);});});}exports[_0x6115('0x13')]=function(_0x141aec){var _0x5849a0=this;return new Promise(function(_0xe0edec,_0x23dfb8){return db[_0x6115('0x14')][_0x6115('0x15')]({'raw':_0x141aec['options']?_0x141aec[_0x6115('0x16')][_0x6115('0x17')]===undefined?!![]:![]:!![],'where':_0x141aec[_0x6115('0x16')]?_0x141aec[_0x6115('0x16')][_0x6115('0x18')]||null:null,'attributes':_0x141aec['options']?_0x141aec['options'][_0x6115('0x19')]||null:null,'limit':_0x141aec[_0x6115('0x16')]?_0x141aec[_0x6115('0x16')]['limit']||null:null,'include':_0x141aec[_0x6115('0x16')]?_0x141aec['options'][_0x6115('0x1a')]?_['map'](_0x141aec[_0x6115('0x16')][_0x6115('0x1a')],function(_0x47eb6c){return{'model':db[_0x47eb6c['model']],'as':_0x47eb6c['as'],'attributes':_0x47eb6c[_0x6115('0x19')],'include':_0x47eb6c['include']?_['map'](_0x47eb6c[_0x6115('0x1a')],function(_0x4f084c){return{'model':db[_0x4f084c[_0x6115('0x1b')]],'as':_0x4f084c['as'],'attributes':_0x4f084c[_0x6115('0x19')],'include':_0x4f084c[_0x6115('0x1a')]?_['map'](_0x4f084c[_0x6115('0x1a')],function(_0x4545b1){return{'model':db[_0x4545b1[_0x6115('0x1b')]],'as':_0x4545b1['as'],'attributes':_0x4545b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6115('0x8')](function(_0x536e85){logger[_0x6115('0x11')]('GetSugarcrmAccount',_0x141aec);logger[_0x6115('0xa')](_0x6115('0x13'),_0x141aec,JSON[_0x6115('0xd')](_0x536e85));_0xe0edec(_0x536e85);})[_0x6115('0x1c')](function(_0x383736){logger['error'](_0x6115('0x13'),_0x383736[_0x6115('0x10')],_0x141aec);_0x23dfb8(_0x5849a0['error'](0x1f4,_0x383736[_0x6115('0x10')]));});});};exports[_0x6115('0x1d')]=function(_0x2ba371){var _0x1fda7f=this;return new Promise(function(_0x349ce0,_0x3f91df){return db[_0x6115('0x14')][_0x6115('0x1e')]({'raw':_0x2ba371['options']?_0x2ba371[_0x6115('0x16')][_0x6115('0x17')]===undefined?!![]:![]:!![],'where':_0x2ba371['options']?_0x2ba371[_0x6115('0x16')][_0x6115('0x18')]||null:null,'attributes':_0x2ba371[_0x6115('0x16')]?_0x2ba371['options']['attributes']||null:null,'include':_0x2ba371['options']?_0x2ba371[_0x6115('0x16')][_0x6115('0x1a')]?_[_0x6115('0x1f')](_0x2ba371[_0x6115('0x16')][_0x6115('0x1a')],function(_0x20f8bc){return{'model':db[_0x20f8bc['model']],'as':_0x20f8bc['as'],'attributes':_0x20f8bc['attributes'],'include':_0x20f8bc[_0x6115('0x1a')]?_[_0x6115('0x1f')](_0x20f8bc[_0x6115('0x1a')],function(_0xf4e8d6){return{'model':db[_0xf4e8d6[_0x6115('0x1b')]],'as':_0xf4e8d6['as'],'attributes':_0xf4e8d6[_0x6115('0x19')],'include':_0xf4e8d6[_0x6115('0x1a')]?_[_0x6115('0x1f')](_0xf4e8d6[_0x6115('0x1a')],function(_0x17a859){return{'model':db[_0x17a859[_0x6115('0x1b')]],'as':_0x17a859['as'],'attributes':_0x17a859[_0x6115('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6115('0x8')](function(_0x588520){logger[_0x6115('0x11')](_0x6115('0x1d'),_0x2ba371);logger[_0x6115('0xa')](_0x6115('0x1d'),_0x2ba371,JSON[_0x6115('0xd')](_0x588520));_0x349ce0(_0x588520);})['catch'](function(_0x3eaff5){logger[_0x6115('0xf')](_0x6115('0x1d'),_0x3eaff5['message'],_0x2ba371);_0x3f91df(_0x1fda7f[_0x6115('0xf')](0x1f4,_0x3eaff5[_0x6115('0x10')]));});});}; \ No newline at end of file +var _0x3ed0=['message','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x149be7,_0xbfcee5){var _0x51c211=function(_0x2d0ce4){while(--_0x2d0ce4){_0x149be7['push'](_0x149be7['shift']());}};_0x51c211(++_0xbfcee5);}(_0x3ed0,0x179));var _0x03ed=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x3ed0[_0x442f02];return _0xab6ef1;};'use strict';var _=require('lodash');var util=require(_0x03ed('0x0'));var moment=require(_0x03ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x03ed('0x2'));var fs=require('fs');var Redis=require(_0x03ed('0x3'));var db=require(_0x03ed('0x4'))['db'];var utils=require(_0x03ed('0x5'));var logger=require(_0x03ed('0x6'))(_0x03ed('0x7'));var config=require(_0x03ed('0x8'));var jayson=require(_0x03ed('0x9'));var client=jayson[_0x03ed('0xa')][_0x03ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46366d,_0x222505,_0x42be0f){return new BPromise(function(_0x1ac886,_0x20d614){return client[_0x03ed('0xc')](_0x46366d,_0x42be0f)[_0x03ed('0xd')](function(_0x52b297){logger[_0x03ed('0xe')](_0x03ed('0xf'),_0x222505,_0x03ed('0x10'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x222505,_0x03ed('0x10'),JSON[_0x03ed('0x11')](_0x52b297));if(_0x52b297[_0x03ed('0x12')]){if(_0x52b297[_0x03ed('0x12')]['code']===0x1f4){logger[_0x03ed('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x222505,_0x52b297[_0x03ed('0x12')][_0x03ed('0x13')]);return _0x20d614(_0x52b297['error'][_0x03ed('0x13')]);}logger[_0x03ed('0x12')](_0x03ed('0xf'),_0x222505,_0x52b297[_0x03ed('0x12')][_0x03ed('0x13')]);return _0x1ac886(_0x52b297['error'][_0x03ed('0x13')]);}else{logger[_0x03ed('0xe')](_0x03ed('0xf'),_0x222505,_0x03ed('0x10'));_0x1ac886(_0x52b297[_0x03ed('0x14')]['message']);}})[_0x03ed('0x15')](function(_0x22d80d){logger[_0x03ed('0x12')](_0x03ed('0xf'),_0x222505,_0x22d80d);_0x20d614(_0x22d80d);});});}exports['GetSugarcrmAccount']=function(_0x4397c7){var _0x23034f=this;return new Promise(function(_0x34750d,_0x15ac8c){return db[_0x03ed('0x16')][_0x03ed('0x17')]({'raw':_0x4397c7[_0x03ed('0x18')]?_0x4397c7[_0x03ed('0x18')][_0x03ed('0x19')]===undefined?!![]:![]:!![],'where':_0x4397c7[_0x03ed('0x18')]?_0x4397c7[_0x03ed('0x18')][_0x03ed('0x1a')]||null:null,'attributes':_0x4397c7[_0x03ed('0x18')]?_0x4397c7[_0x03ed('0x18')][_0x03ed('0x1b')]||null:null,'limit':_0x4397c7['options']?_0x4397c7['options'][_0x03ed('0x1c')]||null:null,'include':_0x4397c7[_0x03ed('0x18')]?_0x4397c7[_0x03ed('0x18')]['include']?_[_0x03ed('0x1d')](_0x4397c7['options'][_0x03ed('0x1e')],function(_0x829fc8){return{'model':db[_0x829fc8[_0x03ed('0x1f')]],'as':_0x829fc8['as'],'attributes':_0x829fc8[_0x03ed('0x1b')],'include':_0x829fc8[_0x03ed('0x1e')]?_[_0x03ed('0x1d')](_0x829fc8[_0x03ed('0x1e')],function(_0x3665e9){return{'model':db[_0x3665e9['model']],'as':_0x3665e9['as'],'attributes':_0x3665e9[_0x03ed('0x1b')],'include':_0x3665e9[_0x03ed('0x1e')]?_[_0x03ed('0x1d')](_0x3665e9['include'],function(_0x2ca246){return{'model':db[_0x2ca246[_0x03ed('0x1f')]],'as':_0x2ca246['as'],'attributes':_0x2ca246[_0x03ed('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x381e9c){logger[_0x03ed('0xe')](_0x03ed('0x20'),_0x4397c7);logger['debug'](_0x03ed('0x20'),_0x4397c7,JSON[_0x03ed('0x11')](_0x381e9c));_0x34750d(_0x381e9c);})[_0x03ed('0x15')](function(_0x4ced23){logger['error']('GetSugarcrmAccount',_0x4ced23[_0x03ed('0x13')],_0x4397c7);_0x15ac8c(_0x23034f[_0x03ed('0x12')](0x1f4,_0x4ced23[_0x03ed('0x13')]));});});};exports[_0x03ed('0x21')]=function(_0x154126){var _0x5dc99f=this;return new Promise(function(_0x534db5,_0x1f0a03){return db[_0x03ed('0x16')][_0x03ed('0x22')]({'raw':_0x154126['options']?_0x154126['options'][_0x03ed('0x19')]===undefined?!![]:![]:!![],'where':_0x154126[_0x03ed('0x18')]?_0x154126['options'][_0x03ed('0x1a')]||null:null,'attributes':_0x154126[_0x03ed('0x18')]?_0x154126['options'][_0x03ed('0x1b')]||null:null,'include':_0x154126[_0x03ed('0x18')]?_0x154126[_0x03ed('0x18')][_0x03ed('0x1e')]?_[_0x03ed('0x1d')](_0x154126[_0x03ed('0x18')][_0x03ed('0x1e')],function(_0x1fb5dd){return{'model':db[_0x1fb5dd[_0x03ed('0x1f')]],'as':_0x1fb5dd['as'],'attributes':_0x1fb5dd[_0x03ed('0x1b')],'include':_0x1fb5dd[_0x03ed('0x1e')]?_[_0x03ed('0x1d')](_0x1fb5dd['include'],function(_0x12504e){return{'model':db[_0x12504e[_0x03ed('0x1f')]],'as':_0x12504e['as'],'attributes':_0x12504e[_0x03ed('0x1b')],'include':_0x12504e[_0x03ed('0x1e')]?_[_0x03ed('0x1d')](_0x12504e[_0x03ed('0x1e')],function(_0x33eccd){return{'model':db[_0x33eccd[_0x03ed('0x1f')]],'as':_0x33eccd['as'],'attributes':_0x33eccd['attributes']};}):[]};}):[]};}):[]:[]})[_0x03ed('0xd')](function(_0x3bb3ac){logger[_0x03ed('0xe')](_0x03ed('0x21'),_0x154126);logger[_0x03ed('0x23')](_0x03ed('0x21'),_0x154126,JSON[_0x03ed('0x11')](_0x3bb3ac));_0x534db5(_0x3bb3ac);})[_0x03ed('0x15')](function(_0x4150b1){logger['error'](_0x03ed('0x21'),_0x4150b1[_0x03ed('0x13')],_0x154126);_0x1f0a03(_0x5dc99f[_0x03ed('0x12')](0x1f4,_0x4150b1['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a699223..54a77e9 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 _0x9a81=['getSubjects','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x44cf99,_0x29ae11){var _0x746876=function(_0x37d24d){while(--_0x37d24d){_0x44cf99['push'](_0x44cf99['shift']());}};_0x746876(++_0x29ae11);}(_0x9a81,0x1ea));var _0x19a8=function(_0x6751f5,_0x5c71d9){_0x6751f5=_0x6751f5-0x0;var _0x2198e9=_0x9a81[_0x6751f5];return _0x2198e9;};'use strict';var multer=require(_0x19a8('0x0'));var util=require('util');var path=require(_0x19a8('0x1'));var timeout=require(_0x19a8('0x2'));var express=require(_0x19a8('0x3'));var router=express[_0x19a8('0x4')]();var fs_extra=require(_0x19a8('0x5'));var auth=require(_0x19a8('0x6'));var interaction=require(_0x19a8('0x7'));var config=require(_0x19a8('0x8'));var controller=require(_0x19a8('0x9'));router[_0x19a8('0xa')]('/',auth[_0x19a8('0xb')](),controller['index']);router['get']('/:id',auth[_0x19a8('0xb')](),controller[_0x19a8('0xc')]);router['get'](_0x19a8('0xd'),auth[_0x19a8('0xb')](),controller[_0x19a8('0xe')]);router['get'](_0x19a8('0xf'),auth[_0x19a8('0xb')](),controller[_0x19a8('0x10')]);router['get']('/:id/descriptions',auth[_0x19a8('0xb')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x19a8('0x11')]);router[_0x19a8('0x12')](_0x19a8('0x13'),auth[_0x19a8('0xb')](),controller[_0x19a8('0x14')]);router[_0x19a8('0x15')](_0x19a8('0x13'),auth[_0x19a8('0xb')](),controller[_0x19a8('0x16')]);module['exports']=router; \ No newline at end of file +var _0x834d=['/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x834d,0x1c3));var _0xd834=function(_0x4f395d,_0x18fd1e){_0x4f395d=_0x4f395d-0x0;var _0x56f59c=_0x834d[_0x4f395d];return _0x56f59c;};'use strict';var multer=require(_0xd834('0x0'));var util=require(_0xd834('0x1'));var path=require(_0xd834('0x2'));var timeout=require(_0xd834('0x3'));var express=require(_0xd834('0x4'));var router=express[_0xd834('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd834('0x6'));var config=require(_0xd834('0x7'));var controller=require(_0xd834('0x8'));router[_0xd834('0x9')]('/',auth[_0xd834('0xa')](),controller['index']);router[_0xd834('0x9')](_0xd834('0xb'),auth[_0xd834('0xa')](),controller['show']);router[_0xd834('0x9')](_0xd834('0xc'),auth[_0xd834('0xa')](),controller['getFields']);router[_0xd834('0x9')](_0xd834('0xd'),auth[_0xd834('0xa')](),controller[_0xd834('0xe')]);router[_0xd834('0x9')]('/:id/descriptions',auth[_0xd834('0xa')](),controller[_0xd834('0xf')]);router[_0xd834('0x10')]('/',auth[_0xd834('0xa')](),controller[_0xd834('0x11')]);router[_0xd834('0x12')](_0xd834('0xb'),auth[_0xd834('0xa')](),controller['update']);router['delete'](_0xd834('0xb'),auth['isAuthenticated'](),controller[_0xd834('0x13')]);module[_0xd834('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 972df27..8f5254f 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 _0x094a=['STRING','sequelize','exports'];(function(_0x3315dd,_0x580502){var _0x25be22=function(_0x207595){while(--_0x207595){_0x3315dd['push'](_0x3315dd['shift']());}};_0x25be22(++_0x580502);}(_0x094a,0x8e));var _0xa094=function(_0x38a9d5,_0x44a9c8){_0x38a9d5=_0x38a9d5-0x0;var _0xd85244=_0x094a[_0x38a9d5];return _0xd85244;};'use strict';var Sequelize=require(_0xa094('0x0'));module[_0xa094('0x1')]={'name':{'type':Sequelize[_0xa094('0x2')]},'description':{'type':Sequelize[_0xa094('0x2')]}}; \ No newline at end of file +var _0x0c0d=['STRING','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0c0d,0x1a3));var _0xd0c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0c0d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xd0c0('0x0')]={'name':{'type':Sequelize[_0xd0c0('0x1')]},'description':{'type':Sequelize[_0xd0c0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2dc0604..99961cb 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 _0x7eb1=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','error','stack','send','index','map','SugarcrmConfiguration','type','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','getFields','findOne','SugarcrmField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7eb1,0xa5));var _0x17eb=function(_0x1c115b,_0x59d8a5){_0x1c115b=_0x1c115b-0x0;var _0x234a18=_0x7eb1[_0x1c115b];return _0x234a18;};'use strict';var emlformat=require(_0x17eb('0x0'));var rimraf=require(_0x17eb('0x1'));var zipdir=require(_0x17eb('0x2'));var jsonpatch=require(_0x17eb('0x3'));var rp=require(_0x17eb('0x4'));var moment=require('moment');var BPromise=require(_0x17eb('0x5'));var Mustache=require(_0x17eb('0x6'));var util=require(_0x17eb('0x7'));var path=require(_0x17eb('0x8'));var sox=require(_0x17eb('0x9'));var csv=require('to-csv');var ejs=require(_0x17eb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17eb('0xb'));var squel=require(_0x17eb('0xc'));var crypto=require(_0x17eb('0xd'));var jsforce=require(_0x17eb('0xe'));var deskjs=require(_0x17eb('0xf'));var toCsv=require(_0x17eb('0x10'));var querystring=require(_0x17eb('0x11'));var Papa=require(_0x17eb('0x12'));var Redis=require(_0x17eb('0x13'));var authService=require(_0x17eb('0x14'));var qs=require(_0x17eb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17eb('0x16'));var logger=require(_0x17eb('0x17'))(_0x17eb('0x18'));var utils=require('../../config/utils');var config=require(_0x17eb('0x19'));var licenseUtil=require(_0x17eb('0x1a'));var db=require(_0x17eb('0x1b'))['db'];function respondWithStatusCode(_0x5aae86,_0x15ed72){_0x15ed72=_0x15ed72||0xcc;return function(_0xe03041){if(_0xe03041){return _0x5aae86[_0x17eb('0x1c')](_0x15ed72);}return _0x5aae86[_0x17eb('0x1d')](_0x15ed72)['end']();};}function respondWithResult(_0x318707,_0x2a611c){_0x2a611c=_0x2a611c||0xc8;return function(_0x701f7d){if(_0x701f7d){return _0x318707[_0x17eb('0x1d')](_0x2a611c)[_0x17eb('0x1e')](_0x701f7d);}};}function respondWithFilteredResult(_0x2ceb16,_0x204bd6){return function(_0x12968d){if(_0x12968d){var _0x5ca425=typeof _0x204bd6[_0x17eb('0x1f')]==='undefined'&&typeof _0x204bd6[_0x17eb('0x20')]===_0x17eb('0x21');var _0x31a925=_0x12968d['count'];var _0x564070=_0x5ca425?0x0:_0x204bd6[_0x17eb('0x1f')];var _0x19371d=_0x5ca425?_0x12968d[_0x17eb('0x22')]:_0x204bd6[_0x17eb('0x1f')]+_0x204bd6[_0x17eb('0x20')];var _0x1d2745;if(_0x19371d>=_0x31a925){_0x19371d=_0x31a925;_0x1d2745=0xc8;}else{_0x1d2745=0xce;}_0x2ceb16[_0x17eb('0x1d')](_0x1d2745);return _0x2ceb16['set'](_0x17eb('0x23'),_0x564070+'-'+_0x19371d+'/'+_0x31a925)['json'](_0x12968d);}return null;};}function patchUpdates(_0x2b6a5b){return function(_0x41b693){try{jsonpatch['apply'](_0x41b693,_0x2b6a5b,!![]);}catch(_0x191484){return BPromise[_0x17eb('0x24')](_0x191484);}return _0x41b693[_0x17eb('0x25')]();};}function saveUpdates(_0x21cbb7,_0x47150a){return function(_0x228f34){if(_0x228f34){return _0x228f34[_0x17eb('0x26')](_0x21cbb7)[_0x17eb('0x27')](function(_0x2429b5){return _0x2429b5;});}return null;};}function removeEntity(_0x338f60,_0x179af1){return function(_0x18c6d3){if(_0x18c6d3){return _0x18c6d3[_0x17eb('0x28')]()[_0x17eb('0x27')](function(){_0x338f60[_0x17eb('0x1d')](0xcc)[_0x17eb('0x29')]();});}};}function handleEntityNotFound(_0x54a859,_0x118ada){return function(_0x506a58){if(!_0x506a58){_0x54a859[_0x17eb('0x1c')](0x194);}return _0x506a58;};}function handleError(_0x530d24,_0xa3de9d){_0xa3de9d=_0xa3de9d||0x1f4;return function(_0x48b7c0){logger[_0x17eb('0x2a')](_0x48b7c0[_0x17eb('0x2b')]);if(_0x48b7c0['name']){delete _0x48b7c0['name'];}_0x530d24[_0x17eb('0x1d')](_0xa3de9d)[_0x17eb('0x2c')](_0x48b7c0);};}exports[_0x17eb('0x2d')]=function(_0x5e8775,_0x1a6d7e){var _0x13e587={},_0x44930b={},_0x345309={'count':0x0,'rows':[]};var _0x34fdca=_[_0x17eb('0x2e')](db[_0x17eb('0x2f')]['rawAttributes'],function(_0x30be41){return{'name':_0x30be41['fieldName'],'type':_0x30be41[_0x17eb('0x30')]['key']};});_0x44930b[_0x17eb('0x31')]=_[_0x17eb('0x2e')](_0x34fdca,_0x17eb('0x32'));_0x44930b[_0x17eb('0x33')]=_[_0x17eb('0x34')](_0x5e8775[_0x17eb('0x33')]);_0x44930b[_0x17eb('0x35')]=_['intersection'](_0x44930b[_0x17eb('0x31')],_0x44930b[_0x17eb('0x33')]);_0x13e587[_0x17eb('0x36')]=_[_0x17eb('0x37')](_0x44930b[_0x17eb('0x31')],qs[_0x17eb('0x38')](_0x5e8775['query'][_0x17eb('0x38')]));_0x13e587[_0x17eb('0x36')]=_0x13e587[_0x17eb('0x36')][_0x17eb('0x39')]?_0x13e587[_0x17eb('0x36')]:_0x44930b[_0x17eb('0x31')];if(!_0x5e8775[_0x17eb('0x33')][_0x17eb('0x3a')](_0x17eb('0x3b'))){_0x13e587[_0x17eb('0x20')]=qs['limit'](_0x5e8775[_0x17eb('0x33')][_0x17eb('0x20')]);_0x13e587[_0x17eb('0x1f')]=qs[_0x17eb('0x1f')](_0x5e8775[_0x17eb('0x33')][_0x17eb('0x1f')]);}_0x13e587['order']=qs['sort'](_0x5e8775[_0x17eb('0x33')][_0x17eb('0x3c')]);_0x13e587[_0x17eb('0x3d')]=qs[_0x17eb('0x35')](_[_0x17eb('0x3e')](_0x5e8775[_0x17eb('0x33')],_0x44930b[_0x17eb('0x35')]),_0x34fdca);if(_0x5e8775['query'][_0x17eb('0x3f')]){_0x13e587[_0x17eb('0x3d')]=_[_0x17eb('0x40')](_0x13e587['where'],{'$or':_['map'](_0x34fdca,function(_0x2dfbf6){if(_0x2dfbf6[_0x17eb('0x30')]!==_0x17eb('0x41')){var _0x4db179={};_0x4db179[_0x2dfbf6[_0x17eb('0x32')]]={'$like':'%'+_0x5e8775['query'][_0x17eb('0x3f')]+'%'};return _0x4db179;}})});}_0x13e587=_[_0x17eb('0x40')]({},_0x13e587,_0x5e8775[_0x17eb('0x42')]);var _0x41c339={'where':_0x13e587[_0x17eb('0x3d')]};return db[_0x17eb('0x2f')][_0x17eb('0x22')](_0x41c339)[_0x17eb('0x27')](function(_0x3bc4da){_0x345309[_0x17eb('0x22')]=_0x3bc4da;if(_0x5e8775[_0x17eb('0x33')][_0x17eb('0x43')]){_0x13e587[_0x17eb('0x44')]=[{'all':!![]}];}return db[_0x17eb('0x2f')][_0x17eb('0x45')](_0x13e587);})[_0x17eb('0x27')](function(_0x413d33){_0x345309[_0x17eb('0x46')]=_0x413d33;return _0x345309;})[_0x17eb('0x27')](respondWithFilteredResult(_0x1a6d7e,_0x13e587))[_0x17eb('0x47')](handleError(_0x1a6d7e,null));};exports[_0x17eb('0x48')]=function(_0x2e1170,_0x1e540b){var _0x4ae7f2={'raw':![],'where':{'id':_0x2e1170['params']['id']}},_0x53661b={};_0x53661b['model']=_[_0x17eb('0x34')](db[_0x17eb('0x2f')][_0x17eb('0x49')]);_0x53661b[_0x17eb('0x33')]=_[_0x17eb('0x34')](_0x2e1170[_0x17eb('0x33')]);_0x53661b[_0x17eb('0x35')]=_[_0x17eb('0x37')](_0x53661b[_0x17eb('0x31')],_0x53661b[_0x17eb('0x33')]);_0x4ae7f2['attributes']=_['intersection'](_0x53661b[_0x17eb('0x31')],qs['fields'](_0x2e1170['query']['fields']));_0x4ae7f2[_0x17eb('0x36')]=_0x4ae7f2[_0x17eb('0x36')][_0x17eb('0x39')]?_0x4ae7f2[_0x17eb('0x36')]:_0x53661b['model'];if(_0x2e1170[_0x17eb('0x33')][_0x17eb('0x43')]){_0x4ae7f2[_0x17eb('0x44')]=[{'all':!![]}];}_0x4ae7f2=_['merge']({},_0x4ae7f2,_0x2e1170[_0x17eb('0x42')]);return db[_0x17eb('0x2f')][_0x17eb('0x4a')](_0x4ae7f2)[_0x17eb('0x27')](handleEntityNotFound(_0x1e540b,null))[_0x17eb('0x27')](respondWithResult(_0x1e540b,null))[_0x17eb('0x47')](handleError(_0x1e540b,null));};exports[_0x17eb('0x4b')]=function(_0x5756c2,_0x3b4921){return db[_0x17eb('0x2f')][_0x17eb('0x4b')](_0x5756c2[_0x17eb('0x4c')],{})['then'](respondWithResult(_0x3b4921,0xc9))[_0x17eb('0x47')](handleError(_0x3b4921,null));};exports['update']=function(_0x319841,_0xed31ff){if(_0x319841[_0x17eb('0x4c')]['id']){delete _0x319841[_0x17eb('0x4c')]['id'];}return db[_0x17eb('0x2f')]['find']({'where':{'id':_0x319841[_0x17eb('0x4d')]['id']}})[_0x17eb('0x27')](handleEntityNotFound(_0xed31ff,null))[_0x17eb('0x27')](saveUpdates(_0x319841[_0x17eb('0x4c')],null))[_0x17eb('0x27')](respondWithResult(_0xed31ff,null))[_0x17eb('0x47')](handleError(_0xed31ff,null));};exports[_0x17eb('0x28')]=function(_0x51d783,_0x596e37){return db[_0x17eb('0x2f')][_0x17eb('0x4a')]({'where':{'id':_0x51d783[_0x17eb('0x4d')]['id']}})[_0x17eb('0x27')](handleEntityNotFound(_0x596e37,null))[_0x17eb('0x27')](removeEntity(_0x596e37,null))[_0x17eb('0x47')](handleError(_0x596e37,null));};exports[_0x17eb('0x4e')]=function(_0x2f0fc7,_0x51de47,_0x4cca40){var _0x33e66b={};var _0x15888c={};var _0xa3330c;var _0x296e38;return db['SugarcrmConfiguration'][_0x17eb('0x4f')]({'where':{'id':_0x2f0fc7[_0x17eb('0x4d')]['id']}})[_0x17eb('0x27')](handleEntityNotFound(_0x51de47,null))['then'](function(_0x535b4c){if(_0x535b4c){_0xa3330c=_0x535b4c;_0x15888c[_0x17eb('0x31')]=_[_0x17eb('0x34')](db[_0x17eb('0x50')][_0x17eb('0x49')]);_0x15888c[_0x17eb('0x33')]=_[_0x17eb('0x34')](_0x2f0fc7[_0x17eb('0x33')]);_0x15888c['filters']=_[_0x17eb('0x37')](_0x15888c[_0x17eb('0x31')],_0x15888c[_0x17eb('0x33')]);_0x33e66b[_0x17eb('0x36')]=_[_0x17eb('0x37')](_0x15888c[_0x17eb('0x31')],qs['fields'](_0x2f0fc7[_0x17eb('0x33')][_0x17eb('0x38')]));_0x33e66b[_0x17eb('0x36')]=_0x33e66b['attributes'][_0x17eb('0x39')]?_0x33e66b[_0x17eb('0x36')]:_0x15888c[_0x17eb('0x31')];_0x33e66b[_0x17eb('0x51')]=qs[_0x17eb('0x3c')](_0x2f0fc7[_0x17eb('0x33')][_0x17eb('0x3c')]);_0x33e66b['where']=qs[_0x17eb('0x35')](_[_0x17eb('0x3e')](_0x2f0fc7[_0x17eb('0x33')],_0x15888c[_0x17eb('0x35')]));if(_0x2f0fc7['query'][_0x17eb('0x3f')]){_0x33e66b[_0x17eb('0x3d')]=_[_0x17eb('0x40')](_0x33e66b[_0x17eb('0x3d')],{'$or':_['map'](_0x33e66b[_0x17eb('0x36')],function(_0x5640fe){var _0x28c9ef={};_0x28c9ef[_0x5640fe]={'$like':'%'+_0x2f0fc7['query'][_0x17eb('0x3f')]+'%'};return _0x28c9ef;})});}_0x33e66b=_[_0x17eb('0x40')]({},_0x33e66b,_0x2f0fc7[_0x17eb('0x42')]);return _0xa3330c[_0x17eb('0x4e')](_0x33e66b);}})['then'](function(_0x14f77d){if(_0x14f77d){_0x296e38=_0x14f77d['length'];if(!_0x2f0fc7[_0x17eb('0x33')][_0x17eb('0x3a')](_0x17eb('0x3b'))){_0x33e66b[_0x17eb('0x20')]=qs['limit'](_0x2f0fc7[_0x17eb('0x33')][_0x17eb('0x20')]);_0x33e66b[_0x17eb('0x1f')]=qs[_0x17eb('0x1f')](_0x2f0fc7[_0x17eb('0x33')][_0x17eb('0x1f')]);}return _0xa3330c[_0x17eb('0x4e')](_0x33e66b);}})[_0x17eb('0x27')](function(_0x586c82){if(_0x586c82){return _0x586c82?{'count':_0x296e38,'rows':_0x586c82}:null;}})['then'](respondWithResult(_0x51de47,null))['catch'](handleError(_0x51de47,null));};exports[_0x17eb('0x52')]=function(_0x5e6e95,_0x1668a3,_0x32db37){var _0x5d1a94={};var _0x15c7fd={};var _0x27f2f8;var _0x4a3b50;return db[_0x17eb('0x2f')][_0x17eb('0x4f')]({'where':{'id':_0x5e6e95['params']['id']}})[_0x17eb('0x27')](handleEntityNotFound(_0x1668a3,null))['then'](function(_0x365d92){if(_0x365d92){_0x27f2f8=_0x365d92;_0x15c7fd[_0x17eb('0x31')]=_[_0x17eb('0x34')](db[_0x17eb('0x50')][_0x17eb('0x49')]);_0x15c7fd[_0x17eb('0x33')]=_['keys'](_0x5e6e95[_0x17eb('0x33')]);_0x15c7fd[_0x17eb('0x35')]=_['intersection'](_0x15c7fd['model'],_0x15c7fd[_0x17eb('0x33')]);_0x5d1a94[_0x17eb('0x36')]=_[_0x17eb('0x37')](_0x15c7fd[_0x17eb('0x31')],qs[_0x17eb('0x38')](_0x5e6e95[_0x17eb('0x33')][_0x17eb('0x38')]));_0x5d1a94[_0x17eb('0x36')]=_0x5d1a94['attributes']['length']?_0x5d1a94[_0x17eb('0x36')]:_0x15c7fd[_0x17eb('0x31')];_0x5d1a94[_0x17eb('0x51')]=qs[_0x17eb('0x3c')](_0x5e6e95[_0x17eb('0x33')][_0x17eb('0x3c')]);_0x5d1a94[_0x17eb('0x3d')]=qs[_0x17eb('0x35')](_['pick'](_0x5e6e95[_0x17eb('0x33')],_0x15c7fd['filters']));if(_0x5e6e95['query'][_0x17eb('0x3f')]){_0x5d1a94[_0x17eb('0x3d')]=_[_0x17eb('0x40')](_0x5d1a94[_0x17eb('0x3d')],{'$or':_[_0x17eb('0x2e')](_0x5d1a94[_0x17eb('0x36')],function(_0x721e86){var _0x39e47b={};_0x39e47b[_0x721e86]={'$like':'%'+_0x5e6e95[_0x17eb('0x33')][_0x17eb('0x3f')]+'%'};return _0x39e47b;})});}_0x5d1a94=_[_0x17eb('0x40')]({},_0x5d1a94,_0x5e6e95[_0x17eb('0x42')]);return _0x27f2f8['getSubjects'](_0x5d1a94);}})[_0x17eb('0x27')](function(_0x3fa90d){if(_0x3fa90d){_0x4a3b50=_0x3fa90d[_0x17eb('0x39')];if(!_0x5e6e95['query'][_0x17eb('0x3a')](_0x17eb('0x3b'))){_0x5d1a94[_0x17eb('0x20')]=qs[_0x17eb('0x20')](_0x5e6e95[_0x17eb('0x33')][_0x17eb('0x20')]);_0x5d1a94[_0x17eb('0x1f')]=qs[_0x17eb('0x1f')](_0x5e6e95['query']['offset']);}return _0x27f2f8[_0x17eb('0x52')](_0x5d1a94);}})[_0x17eb('0x27')](function(_0x2b8c11){if(_0x2b8c11){return _0x2b8c11?{'count':_0x4a3b50,'rows':_0x2b8c11}:null;}})[_0x17eb('0x27')](respondWithResult(_0x1668a3,null))[_0x17eb('0x47')](handleError(_0x1668a3,null));};exports[_0x17eb('0x53')]=function(_0x11f6b6,_0x1bb81a,_0x3dcdb2){var _0x54e018={};var _0x395e77={};var _0x1a301e;var _0x5e12ca;return db[_0x17eb('0x2f')][_0x17eb('0x4f')]({'where':{'id':_0x11f6b6[_0x17eb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1bb81a,null))[_0x17eb('0x27')](function(_0x445fb1){if(_0x445fb1){_0x1a301e=_0x445fb1;_0x395e77[_0x17eb('0x31')]=_['keys'](db[_0x17eb('0x50')][_0x17eb('0x49')]);_0x395e77[_0x17eb('0x33')]=_[_0x17eb('0x34')](_0x11f6b6[_0x17eb('0x33')]);_0x395e77[_0x17eb('0x35')]=_[_0x17eb('0x37')](_0x395e77[_0x17eb('0x31')],_0x395e77[_0x17eb('0x33')]);_0x54e018[_0x17eb('0x36')]=_[_0x17eb('0x37')](_0x395e77[_0x17eb('0x31')],qs[_0x17eb('0x38')](_0x11f6b6[_0x17eb('0x33')][_0x17eb('0x38')]));_0x54e018['attributes']=_0x54e018['attributes']['length']?_0x54e018[_0x17eb('0x36')]:_0x395e77[_0x17eb('0x31')];_0x54e018[_0x17eb('0x51')]=qs[_0x17eb('0x3c')](_0x11f6b6[_0x17eb('0x33')][_0x17eb('0x3c')]);_0x54e018[_0x17eb('0x3d')]=qs[_0x17eb('0x35')](_[_0x17eb('0x3e')](_0x11f6b6[_0x17eb('0x33')],_0x395e77[_0x17eb('0x35')]));if(_0x11f6b6[_0x17eb('0x33')]['filter']){_0x54e018[_0x17eb('0x3d')]=_[_0x17eb('0x40')](_0x54e018[_0x17eb('0x3d')],{'$or':_['map'](_0x54e018['attributes'],function(_0x199880){var _0x32f571={};_0x32f571[_0x199880]={'$like':'%'+_0x11f6b6[_0x17eb('0x33')][_0x17eb('0x3f')]+'%'};return _0x32f571;})});}_0x54e018=_[_0x17eb('0x40')]({},_0x54e018,_0x11f6b6['options']);return _0x1a301e[_0x17eb('0x53')](_0x54e018);}})['then'](function(_0x2231ea){if(_0x2231ea){_0x5e12ca=_0x2231ea[_0x17eb('0x39')];if(!_0x11f6b6['query'][_0x17eb('0x3a')]('nolimit')){_0x54e018[_0x17eb('0x20')]=qs[_0x17eb('0x20')](_0x11f6b6[_0x17eb('0x33')][_0x17eb('0x20')]);_0x54e018['offset']=qs[_0x17eb('0x1f')](_0x11f6b6[_0x17eb('0x33')][_0x17eb('0x1f')]);}return _0x1a301e[_0x17eb('0x53')](_0x54e018);}})[_0x17eb('0x27')](function(_0x277f4a){if(_0x277f4a){return _0x277f4a?{'count':_0x5e12ca,'rows':_0x277f4a}:null;}})['then'](respondWithResult(_0x1bb81a,null))[_0x17eb('0x47')](handleError(_0x1bb81a,null));}; \ No newline at end of file +var _0x90a5=['findOne','SugarcrmField','pick','getSubjects','getDescriptions','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','then','include','rows','show','includeAll','find','create','body','params','catch','getFields'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x90a5,0xa5));var _0x590a=function(_0x5324ad,_0x4dcf9a){_0x5324ad=_0x5324ad-0x0;var _0x3ba22c=_0x90a5[_0x5324ad];return _0x3ba22c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x590a('0x0'));var jsonpatch=require(_0x590a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x590a('0x2'));var Mustache=require(_0x590a('0x3'));var util=require(_0x590a('0x4'));var path=require(_0x590a('0x5'));var sox=require(_0x590a('0x6'));var csv=require(_0x590a('0x7'));var ejs=require(_0x590a('0x8'));var fs=require('fs');var fs_extra=require(_0x590a('0x9'));var _=require(_0x590a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x590a('0xb'));var deskjs=require(_0x590a('0xc'));var toCsv=require(_0x590a('0x7'));var querystring=require(_0x590a('0xd'));var Papa=require('papaparse');var Redis=require(_0x590a('0xe'));var authService=require(_0x590a('0xf'));var qs=require(_0x590a('0x10'));var as=require(_0x590a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x590a('0x12'))(_0x590a('0x13'));var utils=require(_0x590a('0x14'));var config=require(_0x590a('0x15'));var licenseUtil=require(_0x590a('0x16'));var db=require(_0x590a('0x17'))['db'];function respondWithStatusCode(_0xfd9dc7,_0x8a14c6){_0x8a14c6=_0x8a14c6||0xcc;return function(_0x2f747e){if(_0x2f747e){return _0xfd9dc7[_0x590a('0x18')](_0x8a14c6);}return _0xfd9dc7['status'](_0x8a14c6)[_0x590a('0x19')]();};}function respondWithResult(_0x2c86ac,_0x3ea1d9){_0x3ea1d9=_0x3ea1d9||0xc8;return function(_0x5a38cc){if(_0x5a38cc){return _0x2c86ac[_0x590a('0x1a')](_0x3ea1d9)[_0x590a('0x1b')](_0x5a38cc);}};}function respondWithFilteredResult(_0x26063f,_0x30f131){return function(_0x376bef){if(_0x376bef){var _0xe452b6=typeof _0x30f131[_0x590a('0x1c')]===_0x590a('0x1d')&&typeof _0x30f131[_0x590a('0x1e')]===_0x590a('0x1d');var _0x49edfe=_0x376bef['count'];var _0x1b2d40=_0xe452b6?0x0:_0x30f131[_0x590a('0x1c')];var _0x170c64=_0xe452b6?_0x376bef['count']:_0x30f131['offset']+_0x30f131[_0x590a('0x1e')];var _0x5456c4;if(_0x170c64>=_0x49edfe){_0x170c64=_0x49edfe;_0x5456c4=0xc8;}else{_0x5456c4=0xce;}_0x26063f['status'](_0x5456c4);return _0x26063f['set'](_0x590a('0x1f'),_0x1b2d40+'-'+_0x170c64+'/'+_0x49edfe)[_0x590a('0x1b')](_0x376bef);}return null;};}function patchUpdates(_0x537a9a){return function(_0x4b58a8){try{jsonpatch[_0x590a('0x20')](_0x4b58a8,_0x537a9a,!![]);}catch(_0x312729){return BPromise[_0x590a('0x21')](_0x312729);}return _0x4b58a8[_0x590a('0x22')]();};}function saveUpdates(_0x5ea2e7,_0x5e876c){return function(_0x432ecb){if(_0x432ecb){return _0x432ecb[_0x590a('0x23')](_0x5ea2e7)['then'](function(_0x58eb23){return _0x58eb23;});}return null;};}function removeEntity(_0x4442d4,_0x3a63b0){return function(_0x1b866c){if(_0x1b866c){return _0x1b866c[_0x590a('0x24')]()['then'](function(){_0x4442d4[_0x590a('0x1a')](0xcc)[_0x590a('0x19')]();});}};}function handleEntityNotFound(_0xf2cdeb,_0x37bbba){return function(_0x48b7d3){if(!_0x48b7d3){_0xf2cdeb[_0x590a('0x18')](0x194);}return _0x48b7d3;};}function handleError(_0x1a2cc5,_0x5ee7ae){_0x5ee7ae=_0x5ee7ae||0x1f4;return function(_0x26c2a3){logger[_0x590a('0x25')](_0x26c2a3[_0x590a('0x26')]);if(_0x26c2a3[_0x590a('0x27')]){delete _0x26c2a3[_0x590a('0x27')];}_0x1a2cc5[_0x590a('0x1a')](_0x5ee7ae)['send'](_0x26c2a3);};}exports[_0x590a('0x28')]=function(_0x586fbc,_0x28020a){var _0x2823f9={},_0x345fce={},_0xf1c82f={'count':0x0,'rows':[]};var _0x29fa5f=_[_0x590a('0x29')](db[_0x590a('0x2a')][_0x590a('0x2b')],function(_0x1a8c6c){return{'name':_0x1a8c6c[_0x590a('0x2c')],'type':_0x1a8c6c[_0x590a('0x2d')][_0x590a('0x2e')]};});_0x345fce[_0x590a('0x2f')]=_[_0x590a('0x29')](_0x29fa5f,_0x590a('0x27'));_0x345fce[_0x590a('0x30')]=_[_0x590a('0x31')](_0x586fbc['query']);_0x345fce[_0x590a('0x32')]=_[_0x590a('0x33')](_0x345fce['model'],_0x345fce[_0x590a('0x30')]);_0x2823f9['attributes']=_[_0x590a('0x33')](_0x345fce[_0x590a('0x2f')],qs[_0x590a('0x34')](_0x586fbc['query'][_0x590a('0x34')]));_0x2823f9[_0x590a('0x35')]=_0x2823f9['attributes'][_0x590a('0x36')]?_0x2823f9[_0x590a('0x35')]:_0x345fce[_0x590a('0x2f')];if(!_0x586fbc[_0x590a('0x30')][_0x590a('0x37')](_0x590a('0x38'))){_0x2823f9[_0x590a('0x1e')]=qs[_0x590a('0x1e')](_0x586fbc['query'][_0x590a('0x1e')]);_0x2823f9[_0x590a('0x1c')]=qs[_0x590a('0x1c')](_0x586fbc['query']['offset']);}_0x2823f9[_0x590a('0x39')]=qs['sort'](_0x586fbc[_0x590a('0x30')][_0x590a('0x3a')]);_0x2823f9[_0x590a('0x3b')]=qs['filters'](_['pick'](_0x586fbc[_0x590a('0x30')],_0x345fce['filters']),_0x29fa5f);if(_0x586fbc[_0x590a('0x30')][_0x590a('0x3c')]){_0x2823f9[_0x590a('0x3b')]=_[_0x590a('0x3d')](_0x2823f9[_0x590a('0x3b')],{'$or':_[_0x590a('0x29')](_0x29fa5f,function(_0x91bd3){if(_0x91bd3[_0x590a('0x2d')]!=='VIRTUAL'){var _0x457194={};_0x457194[_0x91bd3['name']]={'$like':'%'+_0x586fbc['query'][_0x590a('0x3c')]+'%'};return _0x457194;}})});}_0x2823f9=_['merge']({},_0x2823f9,_0x586fbc[_0x590a('0x3e')]);var _0x1607d7={'where':_0x2823f9[_0x590a('0x3b')]};return db['SugarcrmConfiguration'][_0x590a('0x3f')](_0x1607d7)[_0x590a('0x40')](function(_0x502c3e){_0xf1c82f[_0x590a('0x3f')]=_0x502c3e;if(_0x586fbc['query']['includeAll']){_0x2823f9[_0x590a('0x41')]=[{'all':!![]}];}return db[_0x590a('0x2a')]['findAll'](_0x2823f9);})[_0x590a('0x40')](function(_0x20f8aa){_0xf1c82f[_0x590a('0x42')]=_0x20f8aa;return _0xf1c82f;})[_0x590a('0x40')](respondWithFilteredResult(_0x28020a,_0x2823f9))['catch'](handleError(_0x28020a,null));};exports[_0x590a('0x43')]=function(_0x5d3be5,_0x58ce56){var _0x4fc7d2={'raw':![],'where':{'id':_0x5d3be5['params']['id']}},_0x527ba3={};_0x527ba3[_0x590a('0x2f')]=_['keys'](db[_0x590a('0x2a')][_0x590a('0x2b')]);_0x527ba3[_0x590a('0x30')]=_[_0x590a('0x31')](_0x5d3be5[_0x590a('0x30')]);_0x527ba3['filters']=_[_0x590a('0x33')](_0x527ba3[_0x590a('0x2f')],_0x527ba3['query']);_0x4fc7d2[_0x590a('0x35')]=_[_0x590a('0x33')](_0x527ba3[_0x590a('0x2f')],qs[_0x590a('0x34')](_0x5d3be5['query'][_0x590a('0x34')]));_0x4fc7d2[_0x590a('0x35')]=_0x4fc7d2[_0x590a('0x35')][_0x590a('0x36')]?_0x4fc7d2['attributes']:_0x527ba3[_0x590a('0x2f')];if(_0x5d3be5['query'][_0x590a('0x44')]){_0x4fc7d2['include']=[{'all':!![]}];}_0x4fc7d2=_[_0x590a('0x3d')]({},_0x4fc7d2,_0x5d3be5['options']);return db[_0x590a('0x2a')][_0x590a('0x45')](_0x4fc7d2)[_0x590a('0x40')](handleEntityNotFound(_0x58ce56,null))['then'](respondWithResult(_0x58ce56,null))['catch'](handleError(_0x58ce56,null));};exports[_0x590a('0x46')]=function(_0xed9bd3,_0x1a31b3){return db[_0x590a('0x2a')][_0x590a('0x46')](_0xed9bd3[_0x590a('0x47')],{})[_0x590a('0x40')](respondWithResult(_0x1a31b3,0xc9))['catch'](handleError(_0x1a31b3,null));};exports[_0x590a('0x23')]=function(_0x42a3e5,_0x5a8fe3){if(_0x42a3e5[_0x590a('0x47')]['id']){delete _0x42a3e5[_0x590a('0x47')]['id'];}return db[_0x590a('0x2a')][_0x590a('0x45')]({'where':{'id':_0x42a3e5[_0x590a('0x48')]['id']}})[_0x590a('0x40')](handleEntityNotFound(_0x5a8fe3,null))[_0x590a('0x40')](saveUpdates(_0x42a3e5[_0x590a('0x47')],null))[_0x590a('0x40')](respondWithResult(_0x5a8fe3,null))['catch'](handleError(_0x5a8fe3,null));};exports['destroy']=function(_0x32d373,_0x2be333){return db[_0x590a('0x2a')]['find']({'where':{'id':_0x32d373[_0x590a('0x48')]['id']}})[_0x590a('0x40')](handleEntityNotFound(_0x2be333,null))['then'](removeEntity(_0x2be333,null))[_0x590a('0x49')](handleError(_0x2be333,null));};exports[_0x590a('0x4a')]=function(_0xaa6509,_0xb6d1db,_0xe74a48){var _0x4185fe={};var _0x3f989f={};var _0x372666;var _0x1434d3;return db['SugarcrmConfiguration'][_0x590a('0x4b')]({'where':{'id':_0xaa6509[_0x590a('0x48')]['id']}})[_0x590a('0x40')](handleEntityNotFound(_0xb6d1db,null))['then'](function(_0x1b5d08){if(_0x1b5d08){_0x372666=_0x1b5d08;_0x3f989f['model']=_[_0x590a('0x31')](db[_0x590a('0x4c')][_0x590a('0x2b')]);_0x3f989f['query']=_[_0x590a('0x31')](_0xaa6509[_0x590a('0x30')]);_0x3f989f[_0x590a('0x32')]=_[_0x590a('0x33')](_0x3f989f[_0x590a('0x2f')],_0x3f989f[_0x590a('0x30')]);_0x4185fe['attributes']=_[_0x590a('0x33')](_0x3f989f[_0x590a('0x2f')],qs[_0x590a('0x34')](_0xaa6509[_0x590a('0x30')]['fields']));_0x4185fe[_0x590a('0x35')]=_0x4185fe[_0x590a('0x35')]['length']?_0x4185fe[_0x590a('0x35')]:_0x3f989f['model'];_0x4185fe[_0x590a('0x39')]=qs['sort'](_0xaa6509[_0x590a('0x30')][_0x590a('0x3a')]);_0x4185fe['where']=qs[_0x590a('0x32')](_[_0x590a('0x4d')](_0xaa6509[_0x590a('0x30')],_0x3f989f[_0x590a('0x32')]));if(_0xaa6509[_0x590a('0x30')][_0x590a('0x3c')]){_0x4185fe[_0x590a('0x3b')]=_['merge'](_0x4185fe[_0x590a('0x3b')],{'$or':_[_0x590a('0x29')](_0x4185fe['attributes'],function(_0x3e23f8){var _0x2e7f14={};_0x2e7f14[_0x3e23f8]={'$like':'%'+_0xaa6509['query'][_0x590a('0x3c')]+'%'};return _0x2e7f14;})});}_0x4185fe=_[_0x590a('0x3d')]({},_0x4185fe,_0xaa6509[_0x590a('0x3e')]);return _0x372666[_0x590a('0x4a')](_0x4185fe);}})[_0x590a('0x40')](function(_0x2c989c){if(_0x2c989c){_0x1434d3=_0x2c989c[_0x590a('0x36')];if(!_0xaa6509[_0x590a('0x30')][_0x590a('0x37')](_0x590a('0x38'))){_0x4185fe[_0x590a('0x1e')]=qs[_0x590a('0x1e')](_0xaa6509[_0x590a('0x30')][_0x590a('0x1e')]);_0x4185fe['offset']=qs['offset'](_0xaa6509[_0x590a('0x30')][_0x590a('0x1c')]);}return _0x372666[_0x590a('0x4a')](_0x4185fe);}})[_0x590a('0x40')](function(_0x352ac6){if(_0x352ac6){return _0x352ac6?{'count':_0x1434d3,'rows':_0x352ac6}:null;}})[_0x590a('0x40')](respondWithResult(_0xb6d1db,null))[_0x590a('0x49')](handleError(_0xb6d1db,null));};exports[_0x590a('0x4e')]=function(_0x8da5bc,_0x58e4a6,_0x30707e){var _0x8ffe43={};var _0x3c26c6={};var _0x17a39e;var _0xb94e2d;return db[_0x590a('0x2a')]['findOne']({'where':{'id':_0x8da5bc[_0x590a('0x48')]['id']}})[_0x590a('0x40')](handleEntityNotFound(_0x58e4a6,null))[_0x590a('0x40')](function(_0x491ad3){if(_0x491ad3){_0x17a39e=_0x491ad3;_0x3c26c6[_0x590a('0x2f')]=_['keys'](db[_0x590a('0x4c')][_0x590a('0x2b')]);_0x3c26c6[_0x590a('0x30')]=_[_0x590a('0x31')](_0x8da5bc['query']);_0x3c26c6[_0x590a('0x32')]=_[_0x590a('0x33')](_0x3c26c6[_0x590a('0x2f')],_0x3c26c6['query']);_0x8ffe43[_0x590a('0x35')]=_['intersection'](_0x3c26c6[_0x590a('0x2f')],qs[_0x590a('0x34')](_0x8da5bc[_0x590a('0x30')][_0x590a('0x34')]));_0x8ffe43[_0x590a('0x35')]=_0x8ffe43[_0x590a('0x35')]['length']?_0x8ffe43[_0x590a('0x35')]:_0x3c26c6[_0x590a('0x2f')];_0x8ffe43[_0x590a('0x39')]=qs[_0x590a('0x3a')](_0x8da5bc[_0x590a('0x30')][_0x590a('0x3a')]);_0x8ffe43[_0x590a('0x3b')]=qs[_0x590a('0x32')](_['pick'](_0x8da5bc[_0x590a('0x30')],_0x3c26c6[_0x590a('0x32')]));if(_0x8da5bc[_0x590a('0x30')][_0x590a('0x3c')]){_0x8ffe43[_0x590a('0x3b')]=_[_0x590a('0x3d')](_0x8ffe43['where'],{'$or':_[_0x590a('0x29')](_0x8ffe43[_0x590a('0x35')],function(_0x4b87b8){var _0x2392c9={};_0x2392c9[_0x4b87b8]={'$like':'%'+_0x8da5bc[_0x590a('0x30')][_0x590a('0x3c')]+'%'};return _0x2392c9;})});}_0x8ffe43=_[_0x590a('0x3d')]({},_0x8ffe43,_0x8da5bc[_0x590a('0x3e')]);return _0x17a39e['getSubjects'](_0x8ffe43);}})[_0x590a('0x40')](function(_0x368516){if(_0x368516){_0xb94e2d=_0x368516['length'];if(!_0x8da5bc[_0x590a('0x30')]['hasOwnProperty'](_0x590a('0x38'))){_0x8ffe43['limit']=qs[_0x590a('0x1e')](_0x8da5bc[_0x590a('0x30')][_0x590a('0x1e')]);_0x8ffe43[_0x590a('0x1c')]=qs[_0x590a('0x1c')](_0x8da5bc[_0x590a('0x30')][_0x590a('0x1c')]);}return _0x17a39e[_0x590a('0x4e')](_0x8ffe43);}})[_0x590a('0x40')](function(_0x476af6){if(_0x476af6){return _0x476af6?{'count':_0xb94e2d,'rows':_0x476af6}:null;}})[_0x590a('0x40')](respondWithResult(_0x58e4a6,null))[_0x590a('0x49')](handleError(_0x58e4a6,null));};exports['getDescriptions']=function(_0x13ef89,_0x687a07,_0x5a2228){var _0x302ac0={};var _0x35a8b3={};var _0x5ed65b;var _0x319b1c;return db[_0x590a('0x2a')][_0x590a('0x4b')]({'where':{'id':_0x13ef89['params']['id']}})[_0x590a('0x40')](handleEntityNotFound(_0x687a07,null))[_0x590a('0x40')](function(_0x3bc0bc){if(_0x3bc0bc){_0x5ed65b=_0x3bc0bc;_0x35a8b3[_0x590a('0x2f')]=_[_0x590a('0x31')](db[_0x590a('0x4c')][_0x590a('0x2b')]);_0x35a8b3[_0x590a('0x30')]=_[_0x590a('0x31')](_0x13ef89[_0x590a('0x30')]);_0x35a8b3[_0x590a('0x32')]=_[_0x590a('0x33')](_0x35a8b3['model'],_0x35a8b3['query']);_0x302ac0[_0x590a('0x35')]=_[_0x590a('0x33')](_0x35a8b3[_0x590a('0x2f')],qs[_0x590a('0x34')](_0x13ef89[_0x590a('0x30')][_0x590a('0x34')]));_0x302ac0['attributes']=_0x302ac0[_0x590a('0x35')][_0x590a('0x36')]?_0x302ac0[_0x590a('0x35')]:_0x35a8b3['model'];_0x302ac0[_0x590a('0x39')]=qs[_0x590a('0x3a')](_0x13ef89[_0x590a('0x30')]['sort']);_0x302ac0[_0x590a('0x3b')]=qs['filters'](_['pick'](_0x13ef89[_0x590a('0x30')],_0x35a8b3[_0x590a('0x32')]));if(_0x13ef89['query'][_0x590a('0x3c')]){_0x302ac0[_0x590a('0x3b')]=_['merge'](_0x302ac0['where'],{'$or':_[_0x590a('0x29')](_0x302ac0[_0x590a('0x35')],function(_0xfbd5ea){var _0x29c64c={};_0x29c64c[_0xfbd5ea]={'$like':'%'+_0x13ef89[_0x590a('0x30')][_0x590a('0x3c')]+'%'};return _0x29c64c;})});}_0x302ac0=_[_0x590a('0x3d')]({},_0x302ac0,_0x13ef89[_0x590a('0x3e')]);return _0x5ed65b['getDescriptions'](_0x302ac0);}})[_0x590a('0x40')](function(_0x55a1bf){if(_0x55a1bf){_0x319b1c=_0x55a1bf[_0x590a('0x36')];if(!_0x13ef89[_0x590a('0x30')][_0x590a('0x37')](_0x590a('0x38'))){_0x302ac0[_0x590a('0x1e')]=qs[_0x590a('0x1e')](_0x13ef89['query'][_0x590a('0x1e')]);_0x302ac0[_0x590a('0x1c')]=qs[_0x590a('0x1c')](_0x13ef89[_0x590a('0x30')][_0x590a('0x1c')]);}return _0x5ed65b[_0x590a('0x4f')](_0x302ac0);}})[_0x590a('0x40')](function(_0x2b7b9d){if(_0x2b7b9d){return _0x2b7b9d?{'count':_0x319b1c,'rows':_0x2b7b9d}:null;}})[_0x590a('0x40')](respondWithResult(_0x687a07,null))['catch'](handleError(_0x687a07,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index cfeab28..d9d3c78 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 _0x021c=['./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util','api','bluebird','rimraf','../../config/environment'];(function(_0x16fd78,_0x3b2888){var _0x2702c9=function(_0x7a1ada){while(--_0x7a1ada){_0x16fd78['push'](_0x16fd78['shift']());}};_0x2702c9(++_0x3b2888);}(_0x021c,0xdb));var _0xc021=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x021c[_0xccf869];return _0x21a9db;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var logger=require('../../config/logger')(_0xc021('0x2'));var moment=require('moment');var BPromise=require(_0xc021('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc021('0x4'));var config=require(_0xc021('0x5'));var attributes=require(_0xc021('0x6'));module['exports']=function(_0x1892c2,_0x593204){return _0x1892c2[_0xc021('0x7')](_0xc021('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65f4=['path','rimraf','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x45d06e,_0x5e2c2c){var _0x4e109e=function(_0x163c60){while(--_0x163c60){_0x45d06e['push'](_0x45d06e['shift']());}};_0x4e109e(++_0x5e2c2c);}(_0x65f4,0xae));var _0x465f=function(_0x293457,_0x5e46b3){_0x293457=_0x293457-0x0;var _0x4d8294=_0x65f4[_0x293457];return _0x4d8294;};'use strict';var _=require(_0x465f('0x0'));var util=require(_0x465f('0x1'));var logger=require(_0x465f('0x2'))(_0x465f('0x3'));var moment=require(_0x465f('0x4'));var BPromise=require('bluebird');var rp=require(_0x465f('0x5'));var fs=require('fs');var path=require(_0x465f('0x6'));var rimraf=require(_0x465f('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x465f('0x8')]=function(_0x253b1d,_0x2e8918){return _0x253b1d[_0x465f('0x9')](_0x465f('0xa'),attributes,{'tableName':_0x465f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 4c2b23b..e4a88d1 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 _0xa54a=['info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SugarcrmConfiguration,\x20%s,\x20%s','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xa54a,0x1be));var _0xaa54=function(_0x4ec48c,_0x44a301){_0x4ec48c=_0x4ec48c-0x0;var _0x5f0a4c=_0xa54a[_0x4ec48c];return _0x5f0a4c;};'use strict';var _=require('lodash');var util=require(_0xaa54('0x0'));var moment=require('moment');var BPromise=require(_0xaa54('0x1'));var rs=require(_0xaa54('0x2'));var fs=require('fs');var Redis=require(_0xaa54('0x3'));var db=require(_0xaa54('0x4'))['db'];var utils=require(_0xaa54('0x5'));var logger=require(_0xaa54('0x6'))(_0xaa54('0x7'));var config=require(_0xaa54('0x8'));var jayson=require(_0xaa54('0x9'));var client=jayson[_0xaa54('0xa')][_0xaa54('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15d0a4,_0x4cafcf,_0x546b24){return new BPromise(function(_0x2486c0,_0x40079b){return client[_0xaa54('0xc')](_0x15d0a4,_0x546b24)[_0xaa54('0xd')](function(_0x4568c1){logger[_0xaa54('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4cafcf,'request\x20sent');logger[_0xaa54('0xf')](_0xaa54('0x10'),_0x4cafcf,_0xaa54('0x11'),JSON[_0xaa54('0x12')](_0x4568c1));if(_0x4568c1['error']){if(_0x4568c1['error'][_0xaa54('0x13')]===0x1f4){logger[_0xaa54('0x14')](_0xaa54('0x15'),_0x4cafcf,_0x4568c1['error'][_0xaa54('0x16')]);return _0x40079b(_0x4568c1[_0xaa54('0x14')]['message']);}logger[_0xaa54('0x14')](_0xaa54('0x15'),_0x4cafcf,_0x4568c1['error'][_0xaa54('0x16')]);return _0x2486c0(_0x4568c1['error'][_0xaa54('0x16')]);}else{logger[_0xaa54('0xe')](_0xaa54('0x15'),_0x4cafcf,_0xaa54('0x11'));_0x2486c0(_0x4568c1['result']['message']);}})['catch'](function(_0x5c875d){logger['error'](_0xaa54('0x15'),_0x4cafcf,_0x5c875d);_0x40079b(_0x5c875d);});});} \ No newline at end of file +var _0x604f=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x18084f,_0x45dda8){var _0x3dd12c=function(_0x23a02f){while(--_0x23a02f){_0x18084f['push'](_0x18084f['shift']());}};_0x3dd12c(++_0x45dda8);}(_0x604f,0x149));var _0xf604=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x604f[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0xf604('0x0'));var util=require(_0xf604('0x1'));var moment=require('moment');var BPromise=require(_0xf604('0x2'));var rs=require(_0xf604('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf604('0x4'))['db'];var utils=require(_0xf604('0x5'));var logger=require(_0xf604('0x6'))(_0xf604('0x7'));var config=require(_0xf604('0x8'));var jayson=require(_0xf604('0x9'));var client=jayson[_0xf604('0xa')][_0xf604('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x231517,_0x4d6066,_0x3ce8dd){return new BPromise(function(_0x485970,_0x192e82){return client['request'](_0x231517,_0x3ce8dd)[_0xf604('0xc')](function(_0x2fe40c){logger[_0xf604('0xd')](_0xf604('0xe'),_0x4d6066,'request\x20sent');logger['debug'](_0xf604('0xf'),_0x4d6066,_0xf604('0x10'),JSON[_0xf604('0x11')](_0x2fe40c));if(_0x2fe40c[_0xf604('0x12')]){if(_0x2fe40c['error'][_0xf604('0x13')]===0x1f4){logger[_0xf604('0x12')](_0xf604('0xe'),_0x4d6066,_0x2fe40c[_0xf604('0x12')][_0xf604('0x14')]);return _0x192e82(_0x2fe40c[_0xf604('0x12')][_0xf604('0x14')]);}logger['error'](_0xf604('0xe'),_0x4d6066,_0x2fe40c[_0xf604('0x12')][_0xf604('0x14')]);return _0x485970(_0x2fe40c['error'][_0xf604('0x14')]);}else{logger[_0xf604('0xd')](_0xf604('0xe'),_0x4d6066,'request\x20sent');_0x485970(_0x2fe40c['result'][_0xf604('0x14')]);}})[_0xf604('0x15')](function(_0x263852){logger[_0xf604('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d6066,_0x263852);_0x192e82(_0x263852);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 62f772e..1cb6aee 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 _0xabe5=['post','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show'];(function(_0x40bc88,_0xda0630){var _0x143161=function(_0x2ad5ee){while(--_0x2ad5ee){_0x40bc88['push'](_0x40bc88['shift']());}};_0x143161(++_0xda0630);}(_0xabe5,0x1b4));var _0x5abe=function(_0x202359,_0x148421){_0x202359=_0x202359-0x0;var _0x4f5702=_0xabe5[_0x202359];return _0x4f5702;};'use strict';var multer=require(_0x5abe('0x0'));var util=require(_0x5abe('0x1'));var path=require(_0x5abe('0x2'));var timeout=require('connect-timeout');var express=require(_0x5abe('0x3'));var router=express[_0x5abe('0x4')]();var fs_extra=require(_0x5abe('0x5'));var auth=require(_0x5abe('0x6'));var interaction=require(_0x5abe('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x5abe('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5abe('0x8')](_0x5abe('0x9'),auth[_0x5abe('0xa')](),controller[_0x5abe('0xb')]);router[_0x5abe('0xc')]('/',auth[_0x5abe('0xa')](),controller['create']);router[_0x5abe('0xd')](_0x5abe('0x9'),auth[_0x5abe('0xa')](),controller['update']);router[_0x5abe('0xe')]('/:id',auth[_0x5abe('0xa')](),controller[_0x5abe('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4cfa=['index','get','/:id','isAuthenticated','show','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x4535f2,_0x20613c){var _0x260c57=function(_0x14a665){while(--_0x14a665){_0x4535f2['push'](_0x4535f2['shift']());}};_0x260c57(++_0x20613c);}(_0x4cfa,0xe1));var _0xa4cf=function(_0x44c73d,_0x486a49){_0x44c73d=_0x44c73d-0x0;var _0xe2b045=_0x4cfa[_0x44c73d];return _0xe2b045;};'use strict';var multer=require(_0xa4cf('0x0'));var util=require(_0xa4cf('0x1'));var path=require(_0xa4cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4cf('0x3'));var router=express[_0xa4cf('0x4')]();var fs_extra=require(_0xa4cf('0x5'));var auth=require(_0xa4cf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa4cf('0x7'));var controller=require(_0xa4cf('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa4cf('0x9')]);router[_0xa4cf('0xa')](_0xa4cf('0xb'),auth[_0xa4cf('0xc')](),controller[_0xa4cf('0xd')]);router[_0xa4cf('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa4cf('0xb'),auth['isAuthenticated'](),controller[_0xa4cf('0xf')]);router['delete'](_0xa4cf('0xb'),auth[_0xa4cf('0xc')](),controller[_0xa4cf('0x10')]);module[_0xa4cf('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index a73dc30..9fa5c84 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 _0x41ca=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x37cfaa,_0x579a8a){var _0x443b88=function(_0x5bc8a5){while(--_0x5bc8a5){_0x37cfaa['push'](_0x37cfaa['shift']());}};_0x443b88(++_0x579a8a);}(_0x41ca,0xe0));var _0xa41c=function(_0xf02312,_0x3e9026){_0xf02312=_0xf02312-0x0;var _0x300008=_0x41ca[_0xf02312];return _0x300008;};'use strict';var Sequelize=require(_0xa41c('0x0'));module[_0xa41c('0x1')]={'type':{'type':Sequelize[_0xa41c('0x2')](_0xa41c('0x3'),_0xa41c('0x4'),_0xa41c('0x5'),_0xa41c('0x6'),'picklist'),'defaultValue':_0xa41c('0x3')},'content':{'type':Sequelize[_0xa41c('0x7')]},'key':{'type':Sequelize[_0xa41c('0x7')]},'keyType':{'type':Sequelize[_0xa41c('0x2')]('string',_0xa41c('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xa41c('0x7')]},'idField':{'type':Sequelize[_0xa41c('0x7')]},'nameField':{'type':Sequelize[_0xa41c('0x7')]},'customField':{'type':Sequelize[_0xa41c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa41c('0x7')]}}; \ No newline at end of file +var _0xff2c=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize'];(function(_0x55529f,_0x270041){var _0x188abc=function(_0x3cca9c){while(--_0x3cca9c){_0x55529f['push'](_0x55529f['shift']());}};_0x188abc(++_0x270041);}(_0xff2c,0x11f));var _0xcff2=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0xff2c[_0x5bfa44];return _0x43815f;};'use strict';var Sequelize=require(_0xcff2('0x0'));module[_0xcff2('0x1')]={'type':{'type':Sequelize[_0xcff2('0x2')]('string',_0xcff2('0x3'),_0xcff2('0x4'),_0xcff2('0x5'),_0xcff2('0x6')),'defaultValue':_0xcff2('0x7')},'content':{'type':Sequelize[_0xcff2('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xcff2('0x3'),_0xcff2('0x4'))},'keyContent':{'type':Sequelize[_0xcff2('0x8')]},'idField':{'type':Sequelize[_0xcff2('0x8')]},'nameField':{'type':Sequelize[_0xcff2('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcff2('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 0223eab..a7c83db 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 _0x56e4=['count','set','apply','reject','save','update','then','destroy','end','error','stack','name','map','SugarcrmField','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','catch','show','params','rawAttributes','length','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined'];(function(_0x57b812,_0x306e84){var _0x46dcb4=function(_0xd82591){while(--_0xd82591){_0x57b812['push'](_0x57b812['shift']());}};_0x46dcb4(++_0x306e84);}(_0x56e4,0xb4));var _0x456e=function(_0x4ac804,_0x1bdd4d){_0x4ac804=_0x4ac804-0x0;var _0x1db2c1=_0x56e4[_0x4ac804];return _0x1db2c1;};'use strict';var emlformat=require(_0x456e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x456e('0x1'));var jsonpatch=require(_0x456e('0x2'));var rp=require(_0x456e('0x3'));var moment=require(_0x456e('0x4'));var BPromise=require(_0x456e('0x5'));var Mustache=require('mustache');var util=require(_0x456e('0x6'));var path=require('path');var sox=require(_0x456e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x456e('0x8'));var _=require('lodash');var squel=require(_0x456e('0x9'));var crypto=require(_0x456e('0xa'));var jsforce=require(_0x456e('0xb'));var deskjs=require(_0x456e('0xc'));var toCsv=require(_0x456e('0xd'));var querystring=require(_0x456e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x456e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x456e('0x10'));var logger=require('../../config/logger')(_0x456e('0x11'));var utils=require('../../config/utils');var config=require(_0x456e('0x12'));var licenseUtil=require(_0x456e('0x13'));var db=require(_0x456e('0x14'))['db'];function respondWithStatusCode(_0x219e92,_0x626fcc){_0x626fcc=_0x626fcc||0xcc;return function(_0x2ba2a6){if(_0x2ba2a6){return _0x219e92[_0x456e('0x15')](_0x626fcc);}return _0x219e92[_0x456e('0x16')](_0x626fcc)['end']();};}function respondWithResult(_0x35cf44,_0x138424){_0x138424=_0x138424||0xc8;return function(_0x49f43a){if(_0x49f43a){return _0x35cf44[_0x456e('0x16')](_0x138424)[_0x456e('0x17')](_0x49f43a);}};}function respondWithFilteredResult(_0x3921b1,_0x224c69){return function(_0x4ca92d){if(_0x4ca92d){var _0x38b51b=typeof _0x224c69[_0x456e('0x18')]==='undefined'&&typeof _0x224c69[_0x456e('0x19')]===_0x456e('0x1a');var _0x2373ab=_0x4ca92d[_0x456e('0x1b')];var _0x18dd37=_0x38b51b?0x0:_0x224c69[_0x456e('0x18')];var _0x212a58=_0x38b51b?_0x4ca92d[_0x456e('0x1b')]:_0x224c69[_0x456e('0x18')]+_0x224c69[_0x456e('0x19')];var _0xa8de10;if(_0x212a58>=_0x2373ab){_0x212a58=_0x2373ab;_0xa8de10=0xc8;}else{_0xa8de10=0xce;}_0x3921b1[_0x456e('0x16')](_0xa8de10);return _0x3921b1[_0x456e('0x1c')]('Content-Range',_0x18dd37+'-'+_0x212a58+'/'+_0x2373ab)[_0x456e('0x17')](_0x4ca92d);}return null;};}function patchUpdates(_0x29e870){return function(_0x101e62){try{jsonpatch[_0x456e('0x1d')](_0x101e62,_0x29e870,!![]);}catch(_0x176259){return BPromise[_0x456e('0x1e')](_0x176259);}return _0x101e62[_0x456e('0x1f')]();};}function saveUpdates(_0x1523ec,_0x1bdc3c){return function(_0x37fb4e){if(_0x37fb4e){return _0x37fb4e[_0x456e('0x20')](_0x1523ec)[_0x456e('0x21')](function(_0x479cc8){return _0x479cc8;});}return null;};}function removeEntity(_0x4fbb99,_0x1663bc){return function(_0xfb003a){if(_0xfb003a){return _0xfb003a[_0x456e('0x22')]()[_0x456e('0x21')](function(){_0x4fbb99['status'](0xcc)[_0x456e('0x23')]();});}};}function handleEntityNotFound(_0x5d7625,_0x308e3b){return function(_0xf0bf2d){if(!_0xf0bf2d){_0x5d7625['sendStatus'](0x194);}return _0xf0bf2d;};}function handleError(_0x45cec1,_0x5ca9aa){_0x5ca9aa=_0x5ca9aa||0x1f4;return function(_0x528045){logger[_0x456e('0x24')](_0x528045[_0x456e('0x25')]);if(_0x528045[_0x456e('0x26')]){delete _0x528045['name'];}_0x45cec1[_0x456e('0x16')](_0x5ca9aa)['send'](_0x528045);};}exports['index']=function(_0x5c11d7,_0x5f233c){var _0x4087c5={},_0x2b9903={},_0xc60ee2={'count':0x0,'rows':[]};var _0x2fd4a7=_[_0x456e('0x27')](db[_0x456e('0x28')]['rawAttributes'],function(_0x3513c1){return{'name':_0x3513c1[_0x456e('0x29')],'type':_0x3513c1[_0x456e('0x2a')][_0x456e('0x2b')]};});_0x2b9903['model']=_[_0x456e('0x27')](_0x2fd4a7,'name');_0x2b9903[_0x456e('0x2c')]=_[_0x456e('0x2d')](_0x5c11d7[_0x456e('0x2c')]);_0x2b9903[_0x456e('0x2e')]=_[_0x456e('0x2f')](_0x2b9903['model'],_0x2b9903[_0x456e('0x2c')]);_0x4087c5['attributes']=_[_0x456e('0x2f')](_0x2b9903[_0x456e('0x30')],qs[_0x456e('0x31')](_0x5c11d7[_0x456e('0x2c')]['fields']));_0x4087c5[_0x456e('0x32')]=_0x4087c5[_0x456e('0x32')]['length']?_0x4087c5[_0x456e('0x32')]:_0x2b9903[_0x456e('0x30')];if(!_0x5c11d7['query'][_0x456e('0x33')]('nolimit')){_0x4087c5['limit']=qs['limit'](_0x5c11d7[_0x456e('0x2c')][_0x456e('0x19')]);_0x4087c5[_0x456e('0x18')]=qs[_0x456e('0x18')](_0x5c11d7[_0x456e('0x2c')]['offset']);}_0x4087c5[_0x456e('0x34')]=qs['sort'](_0x5c11d7['query'][_0x456e('0x35')]);_0x4087c5[_0x456e('0x36')]=qs['filters'](_[_0x456e('0x37')](_0x5c11d7[_0x456e('0x2c')],_0x2b9903['filters']),_0x2fd4a7);if(_0x5c11d7[_0x456e('0x2c')][_0x456e('0x38')]){_0x4087c5[_0x456e('0x36')]=_[_0x456e('0x39')](_0x4087c5[_0x456e('0x36')],{'$or':_[_0x456e('0x27')](_0x2fd4a7,function(_0x261ba0){if(_0x261ba0['type']!=='VIRTUAL'){var _0xf5577={};_0xf5577[_0x261ba0['name']]={'$like':'%'+_0x5c11d7[_0x456e('0x2c')][_0x456e('0x38')]+'%'};return _0xf5577;}})});}_0x4087c5=_['merge']({},_0x4087c5,_0x5c11d7['options']);var _0x4398cf={'where':_0x4087c5[_0x456e('0x36')]};return db[_0x456e('0x28')]['count'](_0x4398cf)[_0x456e('0x21')](function(_0x4f1069){_0xc60ee2[_0x456e('0x1b')]=_0x4f1069;if(_0x5c11d7[_0x456e('0x2c')][_0x456e('0x3a')]){_0x4087c5[_0x456e('0x3b')]=[{'all':!![]}];}return db[_0x456e('0x28')]['findAll'](_0x4087c5);})['then'](function(_0x5728ba){_0xc60ee2['rows']=_0x5728ba;return _0xc60ee2;})[_0x456e('0x21')](respondWithFilteredResult(_0x5f233c,_0x4087c5))[_0x456e('0x3c')](handleError(_0x5f233c,null));};exports[_0x456e('0x3d')]=function(_0x4d2375,_0x5edbfc){var _0x397a56={'raw':!![],'where':{'id':_0x4d2375[_0x456e('0x3e')]['id']}},_0x45e0e3={};_0x45e0e3[_0x456e('0x30')]=_[_0x456e('0x2d')](db[_0x456e('0x28')][_0x456e('0x3f')]);_0x45e0e3[_0x456e('0x2c')]=_[_0x456e('0x2d')](_0x4d2375['query']);_0x45e0e3[_0x456e('0x2e')]=_[_0x456e('0x2f')](_0x45e0e3[_0x456e('0x30')],_0x45e0e3[_0x456e('0x2c')]);_0x397a56[_0x456e('0x32')]=_[_0x456e('0x2f')](_0x45e0e3['model'],qs[_0x456e('0x31')](_0x4d2375[_0x456e('0x2c')][_0x456e('0x31')]));_0x397a56[_0x456e('0x32')]=_0x397a56['attributes'][_0x456e('0x40')]?_0x397a56[_0x456e('0x32')]:_0x45e0e3['model'];if(_0x4d2375[_0x456e('0x2c')][_0x456e('0x3a')]){_0x397a56['include']=[{'all':!![]}];}_0x397a56=_[_0x456e('0x39')]({},_0x397a56,_0x4d2375[_0x456e('0x41')]);return db[_0x456e('0x28')][_0x456e('0x42')](_0x397a56)['then'](handleEntityNotFound(_0x5edbfc,null))[_0x456e('0x21')](respondWithResult(_0x5edbfc,null))[_0x456e('0x3c')](handleError(_0x5edbfc,null));};exports[_0x456e('0x43')]=function(_0x3f50a0,_0x420f77){return db[_0x456e('0x28')][_0x456e('0x43')](_0x3f50a0['body'],{})[_0x456e('0x21')](respondWithResult(_0x420f77,0xc9))[_0x456e('0x3c')](handleError(_0x420f77,null));};exports[_0x456e('0x20')]=function(_0x76570d,_0x42b670){if(_0x76570d[_0x456e('0x44')]['id']){delete _0x76570d['body']['id'];}return db[_0x456e('0x28')][_0x456e('0x42')]({'where':{'id':_0x76570d[_0x456e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42b670,null))[_0x456e('0x21')](saveUpdates(_0x76570d[_0x456e('0x44')],null))[_0x456e('0x21')](respondWithResult(_0x42b670,null))[_0x456e('0x3c')](handleError(_0x42b670,null));};exports[_0x456e('0x22')]=function(_0x2faeff,_0x20e930){return db['SugarcrmField'][_0x456e('0x42')]({'where':{'id':_0x2faeff['params']['id']}})['then'](handleEntityNotFound(_0x20e930,null))[_0x456e('0x21')](removeEntity(_0x20e930,null))['catch'](handleError(_0x20e930,null));}; \ No newline at end of file +var _0x57f5=['order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x492b1f,_0x236846){var _0x4fca2c=function(_0x1bbf4b){while(--_0x1bbf4b){_0x492b1f['push'](_0x492b1f['shift']());}};_0x4fca2c(++_0x236846);}(_0x57f5,0xab));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x557f('0x0'));var rimraf=require(_0x557f('0x1'));var zipdir=require(_0x557f('0x2'));var jsonpatch=require(_0x557f('0x3'));var rp=require(_0x557f('0x4'));var moment=require(_0x557f('0x5'));var BPromise=require(_0x557f('0x6'));var Mustache=require(_0x557f('0x7'));var util=require(_0x557f('0x8'));var path=require(_0x557f('0x9'));var sox=require('sox');var csv=require(_0x557f('0xa'));var ejs=require(_0x557f('0xb'));var fs=require('fs');var fs_extra=require(_0x557f('0xc'));var _=require(_0x557f('0xd'));var squel=require(_0x557f('0xe'));var crypto=require(_0x557f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x557f('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x557f('0x11'));var Redis=require('ioredis');var authService=require(_0x557f('0x12'));var qs=require(_0x557f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x557f('0x14'));var logger=require('../../config/logger')(_0x557f('0x15'));var utils=require(_0x557f('0x16'));var config=require(_0x557f('0x17'));var licenseUtil=require(_0x557f('0x18'));var db=require(_0x557f('0x19'))['db'];function respondWithStatusCode(_0x223c89,_0x27ea96){_0x27ea96=_0x27ea96||0xcc;return function(_0x1c6051){if(_0x1c6051){return _0x223c89[_0x557f('0x1a')](_0x27ea96);}return _0x223c89['status'](_0x27ea96)[_0x557f('0x1b')]();};}function respondWithResult(_0x5891b7,_0x1928e5){_0x1928e5=_0x1928e5||0xc8;return function(_0x582007){if(_0x582007){return _0x5891b7[_0x557f('0x1c')](_0x1928e5)[_0x557f('0x1d')](_0x582007);}};}function respondWithFilteredResult(_0x703986,_0x6fcf2a){return function(_0x43035d){if(_0x43035d){var _0x2ba38f=typeof _0x6fcf2a[_0x557f('0x1e')]===_0x557f('0x1f')&&typeof _0x6fcf2a[_0x557f('0x20')]===_0x557f('0x1f');var _0xbd37d=_0x43035d[_0x557f('0x21')];var _0x3c8245=_0x2ba38f?0x0:_0x6fcf2a[_0x557f('0x1e')];var _0x8d5c9e=_0x2ba38f?_0x43035d[_0x557f('0x21')]:_0x6fcf2a[_0x557f('0x1e')]+_0x6fcf2a['limit'];var _0x2fa98a;if(_0x8d5c9e>=_0xbd37d){_0x8d5c9e=_0xbd37d;_0x2fa98a=0xc8;}else{_0x2fa98a=0xce;}_0x703986[_0x557f('0x1c')](_0x2fa98a);return _0x703986[_0x557f('0x22')]('Content-Range',_0x3c8245+'-'+_0x8d5c9e+'/'+_0xbd37d)[_0x557f('0x1d')](_0x43035d);}return null;};}function patchUpdates(_0x16b119){return function(_0x1ae298){try{jsonpatch[_0x557f('0x23')](_0x1ae298,_0x16b119,!![]);}catch(_0x10d318){return BPromise['reject'](_0x10d318);}return _0x1ae298['save']();};}function saveUpdates(_0xd30dbe,_0x58a3cb){return function(_0x4caeac){if(_0x4caeac){return _0x4caeac[_0x557f('0x24')](_0xd30dbe)[_0x557f('0x25')](function(_0x2e2b95){return _0x2e2b95;});}return null;};}function removeEntity(_0x227aed,_0x24042b){return function(_0x4bcd63){if(_0x4bcd63){return _0x4bcd63['destroy']()[_0x557f('0x25')](function(){_0x227aed[_0x557f('0x1c')](0xcc)[_0x557f('0x1b')]();});}};}function handleEntityNotFound(_0x54b0f1,_0x4db233){return function(_0x47f201){if(!_0x47f201){_0x54b0f1[_0x557f('0x1a')](0x194);}return _0x47f201;};}function handleError(_0x3706c2,_0x3f1577){_0x3f1577=_0x3f1577||0x1f4;return function(_0x390cdb){logger[_0x557f('0x26')](_0x390cdb[_0x557f('0x27')]);if(_0x390cdb['name']){delete _0x390cdb[_0x557f('0x28')];}_0x3706c2[_0x557f('0x1c')](_0x3f1577)[_0x557f('0x29')](_0x390cdb);};}exports[_0x557f('0x2a')]=function(_0x1c05bb,_0x93bb2d){var _0x497ac3={},_0x431a1d={},_0x44c9bd={'count':0x0,'rows':[]};var _0x32ee7e=_[_0x557f('0x2b')](db[_0x557f('0x2c')][_0x557f('0x2d')],function(_0x19ad35){return{'name':_0x19ad35[_0x557f('0x2e')],'type':_0x19ad35[_0x557f('0x2f')][_0x557f('0x30')]};});_0x431a1d[_0x557f('0x31')]=_[_0x557f('0x2b')](_0x32ee7e,_0x557f('0x28'));_0x431a1d[_0x557f('0x32')]=_[_0x557f('0x33')](_0x1c05bb[_0x557f('0x32')]);_0x431a1d['filters']=_[_0x557f('0x34')](_0x431a1d[_0x557f('0x31')],_0x431a1d[_0x557f('0x32')]);_0x497ac3[_0x557f('0x35')]=_[_0x557f('0x34')](_0x431a1d['model'],qs[_0x557f('0x36')](_0x1c05bb['query']['fields']));_0x497ac3['attributes']=_0x497ac3[_0x557f('0x35')]['length']?_0x497ac3['attributes']:_0x431a1d[_0x557f('0x31')];if(!_0x1c05bb[_0x557f('0x32')][_0x557f('0x37')](_0x557f('0x38'))){_0x497ac3[_0x557f('0x20')]=qs[_0x557f('0x20')](_0x1c05bb[_0x557f('0x32')][_0x557f('0x20')]);_0x497ac3[_0x557f('0x1e')]=qs['offset'](_0x1c05bb[_0x557f('0x32')][_0x557f('0x1e')]);}_0x497ac3[_0x557f('0x39')]=qs[_0x557f('0x3a')](_0x1c05bb['query']['sort']);_0x497ac3[_0x557f('0x3b')]=qs[_0x557f('0x3c')](_['pick'](_0x1c05bb[_0x557f('0x32')],_0x431a1d[_0x557f('0x3c')]),_0x32ee7e);if(_0x1c05bb['query'][_0x557f('0x3d')]){_0x497ac3[_0x557f('0x3b')]=_[_0x557f('0x3e')](_0x497ac3[_0x557f('0x3b')],{'$or':_['map'](_0x32ee7e,function(_0x423dd3){if(_0x423dd3[_0x557f('0x2f')]!==_0x557f('0x3f')){var _0x52839d={};_0x52839d[_0x423dd3[_0x557f('0x28')]]={'$like':'%'+_0x1c05bb[_0x557f('0x32')][_0x557f('0x3d')]+'%'};return _0x52839d;}})});}_0x497ac3=_[_0x557f('0x3e')]({},_0x497ac3,_0x1c05bb[_0x557f('0x40')]);var _0x21fb27={'where':_0x497ac3['where']};return db['SugarcrmField'][_0x557f('0x21')](_0x21fb27)[_0x557f('0x25')](function(_0x496586){_0x44c9bd[_0x557f('0x21')]=_0x496586;if(_0x1c05bb[_0x557f('0x32')]['includeAll']){_0x497ac3[_0x557f('0x41')]=[{'all':!![]}];}return db['SugarcrmField'][_0x557f('0x42')](_0x497ac3);})[_0x557f('0x25')](function(_0x5b193f){_0x44c9bd[_0x557f('0x43')]=_0x5b193f;return _0x44c9bd;})[_0x557f('0x25')](respondWithFilteredResult(_0x93bb2d,_0x497ac3))[_0x557f('0x44')](handleError(_0x93bb2d,null));};exports[_0x557f('0x45')]=function(_0x483f54,_0x33c0fd){var _0x5c6774={'raw':!![],'where':{'id':_0x483f54[_0x557f('0x46')]['id']}},_0x3ee8ad={};_0x3ee8ad['model']=_[_0x557f('0x33')](db[_0x557f('0x2c')][_0x557f('0x2d')]);_0x3ee8ad['query']=_['keys'](_0x483f54[_0x557f('0x32')]);_0x3ee8ad[_0x557f('0x3c')]=_['intersection'](_0x3ee8ad[_0x557f('0x31')],_0x3ee8ad[_0x557f('0x32')]);_0x5c6774[_0x557f('0x35')]=_['intersection'](_0x3ee8ad[_0x557f('0x31')],qs[_0x557f('0x36')](_0x483f54['query'][_0x557f('0x36')]));_0x5c6774[_0x557f('0x35')]=_0x5c6774[_0x557f('0x35')][_0x557f('0x47')]?_0x5c6774['attributes']:_0x3ee8ad['model'];if(_0x483f54[_0x557f('0x32')]['includeAll']){_0x5c6774[_0x557f('0x41')]=[{'all':!![]}];}_0x5c6774=_[_0x557f('0x3e')]({},_0x5c6774,_0x483f54[_0x557f('0x40')]);return db[_0x557f('0x2c')][_0x557f('0x48')](_0x5c6774)[_0x557f('0x25')](handleEntityNotFound(_0x33c0fd,null))['then'](respondWithResult(_0x33c0fd,null))['catch'](handleError(_0x33c0fd,null));};exports[_0x557f('0x49')]=function(_0x2032a2,_0x1a90ca){return db[_0x557f('0x2c')][_0x557f('0x49')](_0x2032a2[_0x557f('0x4a')],{})[_0x557f('0x25')](respondWithResult(_0x1a90ca,0xc9))[_0x557f('0x44')](handleError(_0x1a90ca,null));};exports['update']=function(_0x51acc0,_0x513f97){if(_0x51acc0[_0x557f('0x4a')]['id']){delete _0x51acc0['body']['id'];}return db[_0x557f('0x2c')][_0x557f('0x48')]({'where':{'id':_0x51acc0[_0x557f('0x46')]['id']}})[_0x557f('0x25')](handleEntityNotFound(_0x513f97,null))[_0x557f('0x25')](saveUpdates(_0x51acc0[_0x557f('0x4a')],null))[_0x557f('0x25')](respondWithResult(_0x513f97,null))[_0x557f('0x44')](handleError(_0x513f97,null));};exports[_0x557f('0x4b')]=function(_0x38b8fa,_0x3cb063){return db[_0x557f('0x2c')][_0x557f('0x48')]({'where':{'id':_0x38b8fa[_0x557f('0x46')]['id']}})[_0x557f('0x25')](handleEntityNotFound(_0x3cb063,null))[_0x557f('0x25')](removeEntity(_0x3cb063,null))[_0x557f('0x44')](handleError(_0x3cb063,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 9167932..c053460 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 _0xdd43=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xdd43,0xae));var _0x3dd4=function(_0x15498b,_0x4886a6){_0x15498b=_0x15498b-0x0;var _0x34cd5b=_0xdd43[_0x15498b];return _0x34cd5b;};'use strict';var _=require(_0x3dd4('0x0'));var util=require(_0x3dd4('0x1'));var logger=require(_0x3dd4('0x2'))(_0x3dd4('0x3'));var moment=require('moment');var BPromise=require(_0x3dd4('0x4'));var rp=require(_0x3dd4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3dd4('0x6'));var config=require(_0x3dd4('0x7'));var attributes=require(_0x3dd4('0x8'));module[_0x3dd4('0x9')]=function(_0x2d4632,_0x1019af){return _0x2d4632[_0x3dd4('0xa')](_0x3dd4('0xb'),attributes,{'tableName':_0x3dd4('0xc'),'paranoid':![],'indexes':[{'name':_0x3dd4('0xd'),'fields':[_0x3dd4('0xe'),_0x3dd4('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2753=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','SugarcrmField','idField','FieldId'];(function(_0x2301a3,_0x2258e3){var _0x18816a=function(_0x299299){while(--_0x299299){_0x2301a3['push'](_0x2301a3['shift']());}};_0x18816a(++_0x2258e3);}(_0x2753,0xa8));var _0x3275=function(_0x28f8df,_0x3cad64){_0x28f8df=_0x28f8df-0x0;var _0xffbd8e=_0x2753[_0x28f8df];return _0xffbd8e;};'use strict';var _=require(_0x3275('0x0'));var util=require(_0x3275('0x1'));var logger=require(_0x3275('0x2'))(_0x3275('0x3'));var moment=require('moment');var BPromise=require(_0x3275('0x4'));var rp=require(_0x3275('0x5'));var fs=require('fs');var path=require(_0x3275('0x6'));var rimraf=require(_0x3275('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x2d6a4d,_0x306ce8){return _0x2d6a4d[_0x3275('0x8')](_0x3275('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3275('0xa'),_0x3275('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 0f0f7e0..4dc7d4f 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 _0xc293=['info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then'];(function(_0x19ff3d,_0x51a1cc){var _0x300f45=function(_0x34c864){while(--_0x34c864){_0x19ff3d['push'](_0x19ff3d['shift']());}};_0x300f45(++_0x51a1cc);}(_0xc293,0xd1));var _0x3c29=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0xc293[_0x574617];return _0x29de90;};'use strict';var _=require(_0x3c29('0x0'));var util=require(_0x3c29('0x1'));var moment=require(_0x3c29('0x2'));var BPromise=require(_0x3c29('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c29('0x4'));var db=require(_0x3c29('0x5'))['db'];var utils=require(_0x3c29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3c29('0x7'));var client=jayson[_0x3c29('0x8')][_0x3c29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29a6ea,_0x4112cd,_0x321b88){return new BPromise(function(_0x3647c5,_0xe9b50d){return client['request'](_0x29a6ea,_0x321b88)[_0x3c29('0xa')](function(_0x50f693){logger[_0x3c29('0xb')](_0x3c29('0xc'),_0x4112cd,'request\x20sent');logger[_0x3c29('0xd')](_0x3c29('0xe'),_0x4112cd,_0x3c29('0xf'),JSON[_0x3c29('0x10')](_0x50f693));if(_0x50f693[_0x3c29('0x11')]){if(_0x50f693['error']['code']===0x1f4){logger[_0x3c29('0x11')](_0x3c29('0xc'),_0x4112cd,_0x50f693[_0x3c29('0x11')][_0x3c29('0x12')]);return _0xe9b50d(_0x50f693[_0x3c29('0x11')]['message']);}logger[_0x3c29('0x11')](_0x3c29('0xc'),_0x4112cd,_0x50f693['error'][_0x3c29('0x12')]);return _0x3647c5(_0x50f693[_0x3c29('0x11')][_0x3c29('0x12')]);}else{logger[_0x3c29('0xb')](_0x3c29('0xc'),_0x4112cd,_0x3c29('0xf'));_0x3647c5(_0x50f693[_0x3c29('0x13')][_0x3c29('0x12')]);}})['catch'](function(_0x1c4163){logger[_0x3c29('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4112cd,_0x1c4163);_0xe9b50d(_0x1c4163);});});} \ No newline at end of file +var _0xe56f=['client','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','ioredis','../../config/utils','jayson/promise'];(function(_0x4ff41c,_0x483c21){var _0x275644=function(_0xcaef54){while(--_0xcaef54){_0x4ff41c['push'](_0x4ff41c['shift']());}};_0x275644(++_0x483c21);}(_0xe56f,0x6a));var _0xfe56=function(_0x447d0c,_0x809c3b){_0x447d0c=_0x447d0c-0x0;var _0x553209=_0xe56f[_0x447d0c];return _0x553209;};'use strict';var _=require(_0xfe56('0x0'));var util=require(_0xfe56('0x1'));var moment=require(_0xfe56('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe56('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe56('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfe56('0x5'));var client=jayson[_0xfe56('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x503963,_0x3e165f,_0xd4b044){return new BPromise(function(_0x2d8c32,_0x4dfb95){return client[_0xfe56('0x7')](_0x503963,_0xd4b044)['then'](function(_0x3fc29c){logger['info'](_0xfe56('0x8'),_0x3e165f,_0xfe56('0x9'));logger['debug'](_0xfe56('0xa'),_0x3e165f,_0xfe56('0x9'),JSON[_0xfe56('0xb')](_0x3fc29c));if(_0x3fc29c['error']){if(_0x3fc29c[_0xfe56('0xc')]['code']===0x1f4){logger[_0xfe56('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3e165f,_0x3fc29c['error'][_0xfe56('0xd')]);return _0x4dfb95(_0x3fc29c[_0xfe56('0xc')][_0xfe56('0xd')]);}logger[_0xfe56('0xc')](_0xfe56('0x8'),_0x3e165f,_0x3fc29c[_0xfe56('0xc')]['message']);return _0x2d8c32(_0x3fc29c[_0xfe56('0xc')][_0xfe56('0xd')]);}else{logger[_0xfe56('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x3e165f,_0xfe56('0x9'));_0x2d8c32(_0x3fc29c[_0xfe56('0xf')]['message']);}})['catch'](function(_0x351176){logger['error'](_0xfe56('0x8'),_0x3e165f,_0x351176);_0x4dfb95(_0x351176);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ecdab27..436f2d8 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 _0x2fb5=['put','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration'];(function(_0x11397f,_0x253549){var _0x4fa92a=function(_0x2f5747){while(--_0x2f5747){_0x11397f['push'](_0x11397f['shift']());}};_0x4fa92a(++_0x253549);}(_0x2fb5,0xff));var _0x52fb=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x2fb5[_0x96f74c];return _0x379222;};'use strict';var multer=require(_0x52fb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x52fb('0x1'));var express=require(_0x52fb('0x2'));var router=express[_0x52fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x52fb('0x4'));var interaction=require(_0x52fb('0x5'));var config=require(_0x52fb('0x6'));var controller=require(_0x52fb('0x7'));router['get']('/',auth[_0x52fb('0x8')](),controller['index']);router[_0x52fb('0x9')](_0x52fb('0xa'),auth[_0x52fb('0x8')](),controller[_0x52fb('0xb')]);router[_0x52fb('0x9')](_0x52fb('0xc'),auth['isAuthenticated'](),controller[_0x52fb('0xd')]);router['get'](_0x52fb('0xe'),auth[_0x52fb('0x8')](),controller[_0x52fb('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x52fb('0x10')]);router['post'](_0x52fb('0xc'),auth['isAuthenticated'](),controller[_0x52fb('0x11')]);router[_0x52fb('0x12')](_0x52fb('0xa'),auth[_0x52fb('0x8')](),controller['update']);router[_0x52fb('0x13')](_0x52fb('0xa'),auth[_0x52fb('0x8')](),controller[_0x52fb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7341=['getFields','post','create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x5a3767,_0x2a9214){var _0x362c69=function(_0x278a5c){while(--_0x278a5c){_0x5a3767['push'](_0x5a3767['shift']());}};_0x362c69(++_0x2a9214);}(_0x7341,0xe4));var _0x1734=function(_0x305839,_0x52a41b){_0x305839=_0x305839-0x0;var _0x41ebe3=_0x7341[_0x305839];return _0x41ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1734('0x0'));var timeout=require('connect-timeout');var express=require(_0x1734('0x1'));var router=express[_0x1734('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1734('0x3'));var interaction=require(_0x1734('0x4'));var config=require(_0x1734('0x5'));var controller=require(_0x1734('0x6'));router[_0x1734('0x7')]('/',auth[_0x1734('0x8')](),controller[_0x1734('0x9')]);router['get'](_0x1734('0xa'),auth[_0x1734('0x8')](),controller[_0x1734('0xb')]);router['get'](_0x1734('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1734('0x7')](_0x1734('0xd'),auth[_0x1734('0x8')](),controller[_0x1734('0xe')]);router[_0x1734('0xf')]('/',auth[_0x1734('0x8')](),controller[_0x1734('0x10')]);router[_0x1734('0xf')](_0x1734('0xc'),auth[_0x1734('0x8')](),controller['addConfiguration']);router[_0x1734('0x11')](_0x1734('0xa'),auth[_0x1734('0x8')](),controller[_0x1734('0x12')]);router[_0x1734('0x13')](_0x1734('0xa'),auth[_0x1734('0x8')](),controller[_0x1734('0x14')]);module[_0x1734('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 1bb4bf3..4ea4675 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 _0xfa4d=['STRING','HelpDesk','exports'];(function(_0x516770,_0xb9ffc8){var _0x5008f8=function(_0x1a5191){while(--_0x1a5191){_0x516770['push'](_0x516770['shift']());}};_0x5008f8(++_0xb9ffc8);}(_0xfa4d,0xe9));var _0xdfa4=function(_0x418be3,_0x3c5f70){_0x418be3=_0x418be3-0x0;var _0x13edc8=_0xfa4d[_0x418be3];return _0x13edc8;};'use strict';var Sequelize=require('sequelize');module[_0xdfa4('0x0')]={'name':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![],'defaultValue':_0xdfa4('0x2')},'remoteUri':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x379f=['STRING','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x379f,0x185));var _0xf379=function(_0x2f9808,_0x3389f0){_0x2f9808=_0x2f9808-0x0;var _0x5044c4=_0x379f[_0x2f9808];return _0x5044c4;};'use strict';var Sequelize=require('sequelize');module[_0xf379('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf379('0x1')]},'username':{'type':Sequelize[_0xf379('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf379('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf379('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf379('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 98f8c6b..f2d1e06 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 _0xc479=['intersection','query','attributes','fields','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','description','moduleName','serverUrl','accessKey','username','remoteUri','slice','substring','lastIndexOf','format','GET','getchallenge','success','result','describe','sessionName','autogenerated','owner','remove','false','label','startsWith','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc479,0x11f));var _0x9c47=function(_0x53a24e,_0x2f4d63){_0x53a24e=_0x53a24e-0x0;var _0x197991=_0xc479[_0x53a24e];return _0x197991;};'use strict';var emlformat=require(_0x9c47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c47('0x1'));var jsonpatch=require(_0x9c47('0x2'));var rp=require(_0x9c47('0x3'));var moment=require(_0x9c47('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c47('0x5'));var util=require('util');var path=require(_0x9c47('0x6'));var sox=require('sox');var csv=require(_0x9c47('0x7'));var ejs=require(_0x9c47('0x8'));var fs=require('fs');var fs_extra=require(_0x9c47('0x9'));var _=require('lodash');var squel=require(_0x9c47('0xa'));var crypto=require('crypto');var jsforce=require(_0x9c47('0xb'));var deskjs=require(_0x9c47('0xc'));var toCsv=require(_0x9c47('0x7'));var querystring=require(_0x9c47('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9c47('0xe'));var qs=require(_0x9c47('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c47('0x10'));var logger=require(_0x9c47('0x11'))('api');var utils=require(_0x9c47('0x12'));var config=require(_0x9c47('0x13'));var licenseUtil=require(_0x9c47('0x14'));var db=require(_0x9c47('0x15'))['db'];var integrations=require(_0x9c47('0x16'));function respondWithStatusCode(_0x2ee811,_0x56eef8){_0x56eef8=_0x56eef8||0xcc;return function(_0x461f09){if(_0x461f09){return _0x2ee811[_0x9c47('0x17')](_0x56eef8);}return _0x2ee811['status'](_0x56eef8)[_0x9c47('0x18')]();};}function respondWithResult(_0x5aaf5f,_0x3e4380){_0x3e4380=_0x3e4380||0xc8;return function(_0x10b7d6){if(_0x10b7d6){return _0x5aaf5f[_0x9c47('0x19')](_0x3e4380)[_0x9c47('0x1a')](_0x10b7d6);}};}function respondWithFilteredResult(_0x52a587,_0x1c2e64){return function(_0x238590){if(_0x238590){var _0x15c567=typeof _0x1c2e64[_0x9c47('0x1b')]===_0x9c47('0x1c')&&typeof _0x1c2e64[_0x9c47('0x1d')]===_0x9c47('0x1c');var _0x3b726a=_0x238590['count'];var _0x78af2e=_0x15c567?0x0:_0x1c2e64[_0x9c47('0x1b')];var _0x3e21fb=_0x15c567?_0x238590[_0x9c47('0x1e')]:_0x1c2e64[_0x9c47('0x1b')]+_0x1c2e64[_0x9c47('0x1d')];var _0x432370;if(_0x3e21fb>=_0x3b726a){_0x3e21fb=_0x3b726a;_0x432370=0xc8;}else{_0x432370=0xce;}_0x52a587[_0x9c47('0x19')](_0x432370);return _0x52a587['set']('Content-Range',_0x78af2e+'-'+_0x3e21fb+'/'+_0x3b726a)['json'](_0x238590);}return null;};}function patchUpdates(_0x35e238){return function(_0x51720f){try{jsonpatch['apply'](_0x51720f,_0x35e238,!![]);}catch(_0x13a0d0){return BPromise[_0x9c47('0x1f')](_0x13a0d0);}return _0x51720f[_0x9c47('0x20')]();};}function saveUpdates(_0x28b13,_0x166843){return function(_0x2982e4){if(_0x2982e4){return _0x2982e4[_0x9c47('0x21')](_0x28b13)[_0x9c47('0x22')](function(_0x276dd1){return _0x276dd1;});}return null;};}function removeEntity(_0x28fb3f,_0x14b19d){return function(_0x5100f1){if(_0x5100f1){return _0x5100f1[_0x9c47('0x23')]()[_0x9c47('0x22')](function(){_0x28fb3f[_0x9c47('0x19')](0xcc)[_0x9c47('0x18')]();});}};}function handleEntityNotFound(_0x135f83,_0x4d5968){return function(_0x2a52c6){if(!_0x2a52c6){_0x135f83[_0x9c47('0x17')](0x194);}return _0x2a52c6;};}function handleError(_0x22011f,_0x2eed75){_0x2eed75=_0x2eed75||0x1f4;return function(_0x36e999){logger[_0x9c47('0x24')](_0x36e999[_0x9c47('0x25')]);if(_0x36e999[_0x9c47('0x26')]){delete _0x36e999['name'];}_0x22011f[_0x9c47('0x19')](_0x2eed75)[_0x9c47('0x27')](_0x36e999);};}exports[_0x9c47('0x28')]=function(_0x2c2e47,_0x3e2755){var _0x55cafe={},_0x3ccafa={},_0x3f106b={'count':0x0,'rows':[]};var _0x58f1f3=_[_0x9c47('0x29')](db[_0x9c47('0x2a')][_0x9c47('0x2b')],function(_0x7b6497){return{'name':_0x7b6497[_0x9c47('0x2c')],'type':_0x7b6497[_0x9c47('0x2d')][_0x9c47('0x2e')]};});_0x3ccafa[_0x9c47('0x2f')]=_[_0x9c47('0x29')](_0x58f1f3,_0x9c47('0x26'));_0x3ccafa['query']=_[_0x9c47('0x30')](_0x2c2e47['query']);_0x3ccafa['filters']=_[_0x9c47('0x31')](_0x3ccafa['model'],_0x3ccafa[_0x9c47('0x32')]);_0x55cafe[_0x9c47('0x33')]=_[_0x9c47('0x31')](_0x3ccafa['model'],qs[_0x9c47('0x34')](_0x2c2e47[_0x9c47('0x32')][_0x9c47('0x34')]));_0x55cafe['attributes']=_0x55cafe['attributes']['length']?_0x55cafe['attributes']:_0x3ccafa[_0x9c47('0x2f')];if(!_0x2c2e47['query']['hasOwnProperty'](_0x9c47('0x35'))){_0x55cafe['limit']=qs[_0x9c47('0x1d')](_0x2c2e47['query'][_0x9c47('0x1d')]);_0x55cafe[_0x9c47('0x1b')]=qs[_0x9c47('0x1b')](_0x2c2e47[_0x9c47('0x32')][_0x9c47('0x1b')]);}_0x55cafe[_0x9c47('0x36')]=qs[_0x9c47('0x37')](_0x2c2e47[_0x9c47('0x32')][_0x9c47('0x37')]);_0x55cafe['where']=qs[_0x9c47('0x38')](_['pick'](_0x2c2e47['query'],_0x3ccafa[_0x9c47('0x38')]),_0x58f1f3);if(_0x2c2e47[_0x9c47('0x32')][_0x9c47('0x39')]){_0x55cafe[_0x9c47('0x3a')]=_['merge'](_0x55cafe[_0x9c47('0x3a')],{'$or':_['map'](_0x58f1f3,function(_0x4208d7){if(_0x4208d7[_0x9c47('0x2d')]!==_0x9c47('0x3b')){var _0xfd8c8f={};_0xfd8c8f[_0x4208d7[_0x9c47('0x26')]]={'$like':'%'+_0x2c2e47[_0x9c47('0x32')][_0x9c47('0x39')]+'%'};return _0xfd8c8f;}})});}_0x55cafe=_[_0x9c47('0x3c')]({},_0x55cafe,_0x2c2e47[_0x9c47('0x3d')]);var _0x185bc2={'where':_0x55cafe['where']};return db[_0x9c47('0x2a')]['count'](_0x185bc2)[_0x9c47('0x22')](function(_0x10dbc6){_0x3f106b[_0x9c47('0x1e')]=_0x10dbc6;if(_0x2c2e47['query']['includeAll']){_0x55cafe[_0x9c47('0x3e')]=[{'all':!![]}];}return db['VtigerAccount'][_0x9c47('0x3f')](_0x55cafe);})[_0x9c47('0x22')](function(_0x29f5f2){_0x3f106b[_0x9c47('0x40')]=_0x29f5f2;return _0x3f106b;})[_0x9c47('0x22')](respondWithFilteredResult(_0x3e2755,_0x55cafe))[_0x9c47('0x41')](handleError(_0x3e2755,null));};exports['show']=function(_0xa482cb,_0x593090){var _0x23f4c3={'raw':![],'where':{'id':_0xa482cb[_0x9c47('0x42')]['id']}},_0x5e31dd={};_0x5e31dd[_0x9c47('0x2f')]=_[_0x9c47('0x30')](db[_0x9c47('0x2a')]['rawAttributes']);_0x5e31dd[_0x9c47('0x32')]=_['keys'](_0xa482cb[_0x9c47('0x32')]);_0x5e31dd[_0x9c47('0x38')]=_['intersection'](_0x5e31dd['model'],_0x5e31dd[_0x9c47('0x32')]);_0x23f4c3[_0x9c47('0x33')]=_[_0x9c47('0x31')](_0x5e31dd[_0x9c47('0x2f')],qs['fields'](_0xa482cb[_0x9c47('0x32')][_0x9c47('0x34')]));_0x23f4c3[_0x9c47('0x33')]=_0x23f4c3[_0x9c47('0x33')][_0x9c47('0x43')]?_0x23f4c3[_0x9c47('0x33')]:_0x5e31dd[_0x9c47('0x2f')];if(_0xa482cb[_0x9c47('0x32')]['includeAll']){_0x23f4c3['include']=[{'all':!![]}];}_0x23f4c3=_[_0x9c47('0x3c')]({},_0x23f4c3,_0xa482cb[_0x9c47('0x3d')]);return db[_0x9c47('0x2a')][_0x9c47('0x44')](_0x23f4c3)['then'](handleEntityNotFound(_0x593090,null))['then'](respondWithResult(_0x593090,null))[_0x9c47('0x41')](handleError(_0x593090,null));};exports[_0x9c47('0x45')]=function(_0x9acb48,_0x4d7b18){return db[_0x9c47('0x2a')][_0x9c47('0x45')](_0x9acb48['body'],{})[_0x9c47('0x22')](respondWithResult(_0x4d7b18,0xc9))['catch'](handleError(_0x4d7b18,null));};exports[_0x9c47('0x21')]=function(_0xbbd5f7,_0x5c857f){if(_0xbbd5f7[_0x9c47('0x46')]['id']){delete _0xbbd5f7[_0x9c47('0x46')]['id'];}return db[_0x9c47('0x2a')]['find']({'where':{'id':_0xbbd5f7['params']['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x5c857f,null))[_0x9c47('0x22')](saveUpdates(_0xbbd5f7[_0x9c47('0x46')],null))['then'](respondWithResult(_0x5c857f,null))[_0x9c47('0x41')](handleError(_0x5c857f,null));};exports[_0x9c47('0x23')]=function(_0x326e50,_0x4553a9){return db['VtigerAccount'][_0x9c47('0x44')]({'where':{'id':_0x326e50['params']['id']}})['then'](handleEntityNotFound(_0x4553a9,null))[_0x9c47('0x22')](removeEntity(_0x4553a9,null))['catch'](handleError(_0x4553a9,null));};exports[_0x9c47('0x47')]=function(_0x331d37,_0x53b96c,_0xe00bc8){var _0x263043={};var _0x285569={};var _0x2d6294;var _0x526c50;return db[_0x9c47('0x2a')][_0x9c47('0x48')]({'where':{'id':_0x331d37[_0x9c47('0x42')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x53b96c,null))[_0x9c47('0x22')](function(_0x295d43){if(_0x295d43){_0x2d6294=_0x295d43;_0x285569['model']=_[_0x9c47('0x30')](db[_0x9c47('0x49')][_0x9c47('0x2b')]);_0x285569[_0x9c47('0x32')]=_[_0x9c47('0x30')](_0x331d37[_0x9c47('0x32')]);_0x285569[_0x9c47('0x38')]=_[_0x9c47('0x31')](_0x285569[_0x9c47('0x2f')],_0x285569[_0x9c47('0x32')]);_0x263043[_0x9c47('0x33')]=_[_0x9c47('0x31')](_0x285569[_0x9c47('0x2f')],qs[_0x9c47('0x34')](_0x331d37[_0x9c47('0x32')][_0x9c47('0x34')]));_0x263043[_0x9c47('0x33')]=_0x263043[_0x9c47('0x33')][_0x9c47('0x43')]?_0x263043[_0x9c47('0x33')]:_0x285569[_0x9c47('0x2f')];_0x263043['order']=qs[_0x9c47('0x37')](_0x331d37['query'][_0x9c47('0x37')]);_0x263043[_0x9c47('0x3a')]=qs[_0x9c47('0x38')](_['pick'](_0x331d37[_0x9c47('0x32')],_0x285569[_0x9c47('0x38')]));if(_0x331d37['query'][_0x9c47('0x39')]){_0x263043['where']=_[_0x9c47('0x3c')](_0x263043[_0x9c47('0x3a')],{'$or':_[_0x9c47('0x29')](_0x263043[_0x9c47('0x33')],function(_0x293e68){var _0x51739a={};_0x51739a[_0x293e68]={'$like':'%'+_0x331d37[_0x9c47('0x32')]['filter']+'%'};return _0x51739a;})});}_0x263043=_[_0x9c47('0x3c')]({},_0x263043,_0x331d37[_0x9c47('0x3d')]);return _0x2d6294[_0x9c47('0x47')](_0x263043);}})[_0x9c47('0x22')](function(_0x28076c){if(_0x28076c){_0x526c50=_0x28076c[_0x9c47('0x43')];if(!_0x331d37[_0x9c47('0x32')][_0x9c47('0x4a')](_0x9c47('0x35'))){_0x263043['limit']=qs[_0x9c47('0x1d')](_0x331d37[_0x9c47('0x32')][_0x9c47('0x1d')]);_0x263043['offset']=qs['offset'](_0x331d37[_0x9c47('0x32')][_0x9c47('0x1b')]);}return _0x2d6294[_0x9c47('0x47')](_0x263043);}})[_0x9c47('0x22')](function(_0x508b65){if(_0x508b65){return _0x508b65?{'count':_0x526c50,'rows':_0x508b65}:null;}})['then'](respondWithResult(_0x53b96c,null))[_0x9c47('0x41')](handleError(_0x53b96c,null));};exports[_0x9c47('0x4b')]=function(_0x2fc80d,_0x298930,_0x2f340b){if(_0x2fc80d['body']['id']){delete _0x2fc80d[_0x9c47('0x46')]['id'];}return db[_0x9c47('0x2a')][_0x9c47('0x48')]({'where':{'id':_0x2fc80d['params']['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x298930,null))[_0x9c47('0x22')](function(_0xda4804){if(_0xda4804){_0x2fc80d[_0x9c47('0x46')]['AccountId']=_0xda4804['id'];_0x2fc80d['body']['Subjects']=integrations['getSubjects'](_0x2fc80d[_0x9c47('0x46')][_0x9c47('0x4c')],_0x2fc80d[_0x9c47('0x46')][_0x9c47('0x2d')]);_0x2fc80d[_0x9c47('0x46')]['Descriptions']=integrations[_0x9c47('0x4d')](_0x2fc80d[_0x9c47('0x46')]['channel'],_0x2fc80d[_0x9c47('0x46')][_0x9c47('0x2d')]);return db[_0x9c47('0x49')][_0x9c47('0x45')](_0x2fc80d[_0x9c47('0x46')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x9c47('0x4e')],'as':_0x9c47('0x4f')}]});}return null;})['then'](respondWithResult(_0x298930,null))[_0x9c47('0x41')](handleError(_0x298930,null));};var md5=require(_0x9c47('0x50'));exports[_0x9c47('0x51')]=function(_0x5d6161,_0x349de8,_0x16a0a9){var _0x129ac6=null;var _0x4f4082=null;var _0xa85a9b=null;var _0x2acea4=null;var _0x2a8ed2='';return db['VtigerAccount']['findOne']({'where':{'id':_0x5d6161['params']['id']},'attributes':['id',_0x9c47('0x26'),'username',_0x9c47('0x52'),_0x9c47('0x53'),'remoteUri',_0x9c47('0x54'),_0x9c47('0x55')]})['then'](handleEntityNotFound(_0x349de8,null))[_0x9c47('0x22')](function(_0x1b148c){if(_0x1b148c){_0x129ac6=_0x1b148c[_0x9c47('0x56')];_0x4f4082=_0x1b148c['accessKey'];_0xa85a9b=_0x1b148c[_0x9c47('0x53')];_0x2a8ed2=_0x1b148c[_0x9c47('0x57')];var _0xeeab42=_0x2a8ed2[_0x9c47('0x58')](-0x1);if(_0xeeab42==='/'){_0x2a8ed2=_0x2a8ed2[_0x9c47('0x59')](0x0,_0x2a8ed2[_0x9c47('0x5a')](_0xeeab42));}_0x2acea4=util[_0x9c47('0x5b')]('%s/webservice.php',_0x2a8ed2);var _0x486e8b={'method':_0x9c47('0x5c'),'uri':_0x2acea4,'qs':{'operation':_0x9c47('0x5d'),'username':_0x1b148c[_0x9c47('0x56')]},'json':!![]};return rp(_0x486e8b);}})[_0x9c47('0x22')](function(_0x2697a6){if(_0x2697a6[_0x9c47('0x5e')]){var _0x32e1a9={'method':'POST','uri':_0x2acea4,'form':{'operation':'login','username':_0x129ac6,'accessKey':md5(_0x2697a6[_0x9c47('0x5f')]['token']+_0x4f4082)},'json':!![]};return rp(_0x32e1a9);}})[_0x9c47('0x22')](function(_0x374ef3){if(_0x374ef3[_0x9c47('0x5e')]){var _0x2eac7a={'method':_0x9c47('0x5c'),'uri':_0x2acea4,'qs':{'operation':_0x9c47('0x60'),'username':_0x129ac6,'sessionName':_0x374ef3['result'][_0x9c47('0x61')],'elementType':_0xa85a9b},'json':!![]};return rp(_0x2eac7a);}})[_0x9c47('0x22')](function(_0xe05bbf){if(_0xe05bbf[_0x9c47('0x5e')]){var _0x8c1428=[_0x9c47('0x62'),'reference',_0x9c47('0x63')];_[_0x9c47('0x64')](_0xe05bbf[_0x9c47('0x5f')][_0x9c47('0x34')],function(_0x3b945f){return _0x8c1428['includes'](_0x3b945f[_0x9c47('0x2d')][_0x9c47('0x26')]);});_[_0x9c47('0x64')](_0xe05bbf[_0x9c47('0x5f')][_0x9c47('0x34')],function(_0x2bf4d6){return _0x2bf4d6['editable']===_0x9c47('0x65');});return{'count':_0xe05bbf[_0x9c47('0x5f')][_0x9c47('0x34')][_0x9c47('0x43')],'rows':_['map'](_0xe05bbf['result'][_0x9c47('0x34')],function(_0x1c4bb2){return{'id':_0x1c4bb2[_0x9c47('0x26')],'name':_0x1c4bb2[_0x9c47('0x66')],'custom':_[_0x9c47('0x67')](_0x1c4bb2[_0x9c47('0x26')],_0x9c47('0x68'))?!![]:![],'options':_0x1c4bb2[_0x9c47('0x2d')][_0x9c47('0x26')]===_0x9c47('0x69')&&_0x1c4bb2[_0x9c47('0x2d')][_0x9c47('0x6a')]['length']>0x0?_[_0x9c47('0x29')](_0x1c4bb2[_0x9c47('0x2d')][_0x9c47('0x6a')],function(_0x36b36d){return{'name':_0x36b36d[_0x9c47('0x66')],'value':_0x36b36d[_0x9c47('0x6b')]};}):[]};})};}})['then'](respondWithResult(_0x349de8,null))[_0x9c47('0x41')](function(_0x57f98e){console[_0x9c47('0x6c')]('vTiger\x20error:\x20'+_0x57f98e);var _0x3a365f=_0x5d6161['query'][_0x9c47('0x6d')]?0x1f4:_0x57f98e[_0x9c47('0x6e')]||0x1f4;logger[_0x9c47('0x24')](_0x9c47('0x6f'),_0x9c47('0x51'),_0x3a365f,JSON['stringify'](_0x57f98e));delete _0x57f98e[_0x9c47('0x26')];if(_0x3a365f===0x191){_0x3a365f=0x190;}_0x349de8[_0x9c47('0x19')](_0x3a365f)[_0x9c47('0x27')](_0x5d6161[_0x9c47('0x32')][_0x9c47('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x57f98e[_0x9c47('0x6e')]}:_0x57f98e);});}; \ No newline at end of file +var _0x154a=['editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','update','then','end','error','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','include','VtigerAccount','findAll','rows','catch','show','rawAttributes','includeAll','find','body','params','getConfigurations','VtigerConfiguration','nolimit','AccountId','Subjects','create','VtigerField','Descriptions','md5','findOne','description','moduleName','serverUrl','username','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','result','describe','sessionName','autogenerated','reference','owner','remove','includes'];(function(_0x11b731,_0xec5afe){var _0x4296ce=function(_0x2ff095){while(--_0x2ff095){_0x11b731['push'](_0x11b731['shift']());}};_0x4296ce(++_0xec5afe);}(_0x154a,0x103));var _0xa154=function(_0x2abb11,_0x28c9af){_0x2abb11=_0x2abb11-0x0;var _0x302d06=_0x154a[_0x2abb11];return _0x302d06;};'use strict';var emlformat=require(_0xa154('0x0'));var rimraf=require(_0xa154('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa154('0x2'));var rp=require(_0xa154('0x3'));var moment=require('moment');var BPromise=require(_0xa154('0x4'));var Mustache=require(_0xa154('0x5'));var util=require(_0xa154('0x6'));var path=require(_0xa154('0x7'));var sox=require(_0xa154('0x8'));var csv=require(_0xa154('0x9'));var ejs=require(_0xa154('0xa'));var fs=require('fs');var fs_extra=require(_0xa154('0xb'));var _=require(_0xa154('0xc'));var squel=require(_0xa154('0xd'));var crypto=require(_0xa154('0xe'));var jsforce=require(_0xa154('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa154('0x9'));var querystring=require('querystring');var Papa=require(_0xa154('0x10'));var Redis=require(_0xa154('0x11'));var authService=require(_0xa154('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa154('0x13'));var hardwareService=require(_0xa154('0x14'));var logger=require(_0xa154('0x15'))(_0xa154('0x16'));var utils=require(_0xa154('0x17'));var config=require(_0xa154('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa154('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x58574d,_0x128540){_0x128540=_0x128540||0xcc;return function(_0x4edea9){if(_0x4edea9){return _0x58574d[_0xa154('0x1a')](_0x128540);}return _0x58574d[_0xa154('0x1b')](_0x128540)['end']();};}function respondWithResult(_0x1a8342,_0x333737){_0x333737=_0x333737||0xc8;return function(_0xea11b8){if(_0xea11b8){return _0x1a8342['status'](_0x333737)[_0xa154('0x1c')](_0xea11b8);}};}function respondWithFilteredResult(_0x30b9ad,_0x2cd640){return function(_0x5b6163){if(_0x5b6163){var _0x387ce9=typeof _0x2cd640[_0xa154('0x1d')]===_0xa154('0x1e')&&typeof _0x2cd640[_0xa154('0x1f')]===_0xa154('0x1e');var _0x2abeaa=_0x5b6163[_0xa154('0x20')];var _0x24fa2e=_0x387ce9?0x0:_0x2cd640[_0xa154('0x1d')];var _0x4f0699=_0x387ce9?_0x5b6163[_0xa154('0x20')]:_0x2cd640[_0xa154('0x1d')]+_0x2cd640['limit'];var _0x14d6fb;if(_0x4f0699>=_0x2abeaa){_0x4f0699=_0x2abeaa;_0x14d6fb=0xc8;}else{_0x14d6fb=0xce;}_0x30b9ad['status'](_0x14d6fb);return _0x30b9ad[_0xa154('0x21')]('Content-Range',_0x24fa2e+'-'+_0x4f0699+'/'+_0x2abeaa)[_0xa154('0x1c')](_0x5b6163);}return null;};}function patchUpdates(_0x4ec89c){return function(_0x1bb43e){try{jsonpatch['apply'](_0x1bb43e,_0x4ec89c,!![]);}catch(_0x42c0bd){return BPromise['reject'](_0x42c0bd);}return _0x1bb43e[_0xa154('0x22')]();};}function saveUpdates(_0x21ca2c,_0x1b8e1b){return function(_0x1617dc){if(_0x1617dc){return _0x1617dc[_0xa154('0x23')](_0x21ca2c)[_0xa154('0x24')](function(_0x173c69){return _0x173c69;});}return null;};}function removeEntity(_0x3472a5,_0x12cc4d){return function(_0x4e6f22){if(_0x4e6f22){return _0x4e6f22['destroy']()[_0xa154('0x24')](function(){_0x3472a5[_0xa154('0x1b')](0xcc)[_0xa154('0x25')]();});}};}function handleEntityNotFound(_0x2717f8,_0x29f84c){return function(_0x3de6ec){if(!_0x3de6ec){_0x2717f8[_0xa154('0x1a')](0x194);}return _0x3de6ec;};}function handleError(_0x982dd8,_0x178a7b){_0x178a7b=_0x178a7b||0x1f4;return function(_0x498fcc){logger[_0xa154('0x26')](_0x498fcc[_0xa154('0x27')]);if(_0x498fcc['name']){delete _0x498fcc['name'];}_0x982dd8[_0xa154('0x1b')](_0x178a7b)[_0xa154('0x28')](_0x498fcc);};}exports[_0xa154('0x29')]=function(_0x1fec8c,_0x263f7f){var _0x65428={},_0x2f3755={},_0xbab8ad={'count':0x0,'rows':[]};var _0x3cc453=_[_0xa154('0x2a')](db['VtigerAccount']['rawAttributes'],function(_0x582d0d){return{'name':_0x582d0d[_0xa154('0x2b')],'type':_0x582d0d[_0xa154('0x2c')][_0xa154('0x2d')]};});_0x2f3755[_0xa154('0x2e')]=_[_0xa154('0x2a')](_0x3cc453,_0xa154('0x2f'));_0x2f3755[_0xa154('0x30')]=_[_0xa154('0x31')](_0x1fec8c[_0xa154('0x30')]);_0x2f3755[_0xa154('0x32')]=_[_0xa154('0x33')](_0x2f3755[_0xa154('0x2e')],_0x2f3755['query']);_0x65428[_0xa154('0x34')]=_['intersection'](_0x2f3755[_0xa154('0x2e')],qs[_0xa154('0x35')](_0x1fec8c[_0xa154('0x30')][_0xa154('0x35')]));_0x65428[_0xa154('0x34')]=_0x65428[_0xa154('0x34')][_0xa154('0x36')]?_0x65428[_0xa154('0x34')]:_0x2f3755[_0xa154('0x2e')];if(!_0x1fec8c[_0xa154('0x30')][_0xa154('0x37')]('nolimit')){_0x65428['limit']=qs[_0xa154('0x1f')](_0x1fec8c[_0xa154('0x30')][_0xa154('0x1f')]);_0x65428['offset']=qs[_0xa154('0x1d')](_0x1fec8c[_0xa154('0x30')][_0xa154('0x1d')]);}_0x65428[_0xa154('0x38')]=qs[_0xa154('0x39')](_0x1fec8c[_0xa154('0x30')]['sort']);_0x65428['where']=qs['filters'](_[_0xa154('0x3a')](_0x1fec8c[_0xa154('0x30')],_0x2f3755[_0xa154('0x32')]),_0x3cc453);if(_0x1fec8c['query'][_0xa154('0x3b')]){_0x65428['where']=_[_0xa154('0x3c')](_0x65428[_0xa154('0x3d')],{'$or':_['map'](_0x3cc453,function(_0x2b3981){if(_0x2b3981[_0xa154('0x2c')]!=='VIRTUAL'){var _0x12373c={};_0x12373c[_0x2b3981[_0xa154('0x2f')]]={'$like':'%'+_0x1fec8c[_0xa154('0x30')][_0xa154('0x3b')]+'%'};return _0x12373c;}})});}_0x65428=_['merge']({},_0x65428,_0x1fec8c[_0xa154('0x3e')]);var _0x59baa2={'where':_0x65428[_0xa154('0x3d')]};return db['VtigerAccount'][_0xa154('0x20')](_0x59baa2)[_0xa154('0x24')](function(_0x497616){_0xbab8ad[_0xa154('0x20')]=_0x497616;if(_0x1fec8c[_0xa154('0x30')]['includeAll']){_0x65428[_0xa154('0x3f')]=[{'all':!![]}];}return db[_0xa154('0x40')][_0xa154('0x41')](_0x65428);})[_0xa154('0x24')](function(_0x46ff3f){_0xbab8ad[_0xa154('0x42')]=_0x46ff3f;return _0xbab8ad;})[_0xa154('0x24')](respondWithFilteredResult(_0x263f7f,_0x65428))[_0xa154('0x43')](handleError(_0x263f7f,null));};exports[_0xa154('0x44')]=function(_0x5eb4b8,_0x2b23d8){var _0x50b415={'raw':![],'where':{'id':_0x5eb4b8['params']['id']}},_0x8c6820={};_0x8c6820[_0xa154('0x2e')]=_[_0xa154('0x31')](db[_0xa154('0x40')][_0xa154('0x45')]);_0x8c6820[_0xa154('0x30')]=_[_0xa154('0x31')](_0x5eb4b8['query']);_0x8c6820[_0xa154('0x32')]=_['intersection'](_0x8c6820[_0xa154('0x2e')],_0x8c6820[_0xa154('0x30')]);_0x50b415[_0xa154('0x34')]=_['intersection'](_0x8c6820[_0xa154('0x2e')],qs[_0xa154('0x35')](_0x5eb4b8[_0xa154('0x30')][_0xa154('0x35')]));_0x50b415[_0xa154('0x34')]=_0x50b415[_0xa154('0x34')]['length']?_0x50b415['attributes']:_0x8c6820['model'];if(_0x5eb4b8[_0xa154('0x30')][_0xa154('0x46')]){_0x50b415['include']=[{'all':!![]}];}_0x50b415=_[_0xa154('0x3c')]({},_0x50b415,_0x5eb4b8['options']);return db[_0xa154('0x40')][_0xa154('0x47')](_0x50b415)['then'](handleEntityNotFound(_0x2b23d8,null))[_0xa154('0x24')](respondWithResult(_0x2b23d8,null))[_0xa154('0x43')](handleError(_0x2b23d8,null));};exports['create']=function(_0x57fe36,_0x396993){return db[_0xa154('0x40')]['create'](_0x57fe36['body'],{})[_0xa154('0x24')](respondWithResult(_0x396993,0xc9))[_0xa154('0x43')](handleError(_0x396993,null));};exports[_0xa154('0x23')]=function(_0x2ee591,_0x3fa629){if(_0x2ee591[_0xa154('0x48')]['id']){delete _0x2ee591[_0xa154('0x48')]['id'];}return db[_0xa154('0x40')][_0xa154('0x47')]({'where':{'id':_0x2ee591[_0xa154('0x49')]['id']}})[_0xa154('0x24')](handleEntityNotFound(_0x3fa629,null))[_0xa154('0x24')](saveUpdates(_0x2ee591[_0xa154('0x48')],null))[_0xa154('0x24')](respondWithResult(_0x3fa629,null))['catch'](handleError(_0x3fa629,null));};exports['destroy']=function(_0x5b0197,_0x298c76){return db['VtigerAccount'][_0xa154('0x47')]({'where':{'id':_0x5b0197[_0xa154('0x49')]['id']}})[_0xa154('0x24')](handleEntityNotFound(_0x298c76,null))[_0xa154('0x24')](removeEntity(_0x298c76,null))[_0xa154('0x43')](handleError(_0x298c76,null));};exports[_0xa154('0x4a')]=function(_0x4d435b,_0x40a8ee,_0x5eeec1){var _0x54ad18={};var _0x26e533={};var _0x30df18;var _0x54400e;return db[_0xa154('0x40')]['findOne']({'where':{'id':_0x4d435b[_0xa154('0x49')]['id']}})[_0xa154('0x24')](handleEntityNotFound(_0x40a8ee,null))['then'](function(_0x5f5ce2){if(_0x5f5ce2){_0x30df18=_0x5f5ce2;_0x26e533[_0xa154('0x2e')]=_['keys'](db[_0xa154('0x4b')][_0xa154('0x45')]);_0x26e533['query']=_[_0xa154('0x31')](_0x4d435b[_0xa154('0x30')]);_0x26e533[_0xa154('0x32')]=_[_0xa154('0x33')](_0x26e533[_0xa154('0x2e')],_0x26e533['query']);_0x54ad18[_0xa154('0x34')]=_[_0xa154('0x33')](_0x26e533[_0xa154('0x2e')],qs[_0xa154('0x35')](_0x4d435b[_0xa154('0x30')]['fields']));_0x54ad18[_0xa154('0x34')]=_0x54ad18[_0xa154('0x34')][_0xa154('0x36')]?_0x54ad18[_0xa154('0x34')]:_0x26e533[_0xa154('0x2e')];_0x54ad18[_0xa154('0x38')]=qs['sort'](_0x4d435b[_0xa154('0x30')]['sort']);_0x54ad18['where']=qs[_0xa154('0x32')](_[_0xa154('0x3a')](_0x4d435b[_0xa154('0x30')],_0x26e533[_0xa154('0x32')]));if(_0x4d435b['query'][_0xa154('0x3b')]){_0x54ad18[_0xa154('0x3d')]=_[_0xa154('0x3c')](_0x54ad18['where'],{'$or':_['map'](_0x54ad18[_0xa154('0x34')],function(_0x393d1d){var _0x43b9bc={};_0x43b9bc[_0x393d1d]={'$like':'%'+_0x4d435b[_0xa154('0x30')][_0xa154('0x3b')]+'%'};return _0x43b9bc;})});}_0x54ad18=_[_0xa154('0x3c')]({},_0x54ad18,_0x4d435b[_0xa154('0x3e')]);return _0x30df18[_0xa154('0x4a')](_0x54ad18);}})[_0xa154('0x24')](function(_0x1f68ce){if(_0x1f68ce){_0x54400e=_0x1f68ce['length'];if(!_0x4d435b[_0xa154('0x30')][_0xa154('0x37')](_0xa154('0x4c'))){_0x54ad18[_0xa154('0x1f')]=qs['limit'](_0x4d435b[_0xa154('0x30')][_0xa154('0x1f')]);_0x54ad18['offset']=qs[_0xa154('0x1d')](_0x4d435b[_0xa154('0x30')][_0xa154('0x1d')]);}return _0x30df18[_0xa154('0x4a')](_0x54ad18);}})[_0xa154('0x24')](function(_0x4fde36){if(_0x4fde36){return _0x4fde36?{'count':_0x54400e,'rows':_0x4fde36}:null;}})['then'](respondWithResult(_0x40a8ee,null))['catch'](handleError(_0x40a8ee,null));};exports['addConfiguration']=function(_0x4f92c1,_0x11ec2b,_0x4097d0){if(_0x4f92c1[_0xa154('0x48')]['id']){delete _0x4f92c1[_0xa154('0x48')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x4f92c1[_0xa154('0x49')]['id']}})[_0xa154('0x24')](handleEntityNotFound(_0x11ec2b,null))[_0xa154('0x24')](function(_0x33ab9c){if(_0x33ab9c){_0x4f92c1[_0xa154('0x48')][_0xa154('0x4d')]=_0x33ab9c['id'];_0x4f92c1['body'][_0xa154('0x4e')]=integrations['getSubjects'](_0x4f92c1['body']['channel'],_0x4f92c1[_0xa154('0x48')][_0xa154('0x2c')]);_0x4f92c1['body']['Descriptions']=integrations['getDescriptions'](_0x4f92c1['body']['channel'],_0x4f92c1['body'][_0xa154('0x2c')]);return db['VtigerConfiguration'][_0xa154('0x4f')](_0x4f92c1[_0xa154('0x48')],{'include':[{'model':db[_0xa154('0x50')],'as':_0xa154('0x4e')},{'model':db[_0xa154('0x50')],'as':_0xa154('0x51')}]});}return null;})[_0xa154('0x24')](respondWithResult(_0x11ec2b,null))[_0xa154('0x43')](handleError(_0x11ec2b,null));};var md5=require(_0xa154('0x52'));exports['getFields']=function(_0x4559f4,_0x7f34bd,_0x29a32d){var _0x3627e7=null;var _0x2364ed=null;var _0x2f5e62=null;var _0xe2955c=null;var _0x130432='';return db[_0xa154('0x40')][_0xa154('0x53')]({'where':{'id':_0x4559f4[_0xa154('0x49')]['id']},'attributes':['id',_0xa154('0x2f'),'username',_0xa154('0x54'),_0xa154('0x55'),'remoteUri',_0xa154('0x56'),'accessKey']})[_0xa154('0x24')](handleEntityNotFound(_0x7f34bd,null))['then'](function(_0x58a6af){if(_0x58a6af){_0x3627e7=_0x58a6af[_0xa154('0x57')];_0x2364ed=_0x58a6af[_0xa154('0x58')];_0x2f5e62=_0x58a6af[_0xa154('0x55')];_0x130432=_0x58a6af[_0xa154('0x59')];var _0x3e3406=_0x130432[_0xa154('0x5a')](-0x1);if(_0x3e3406==='/'){_0x130432=_0x130432[_0xa154('0x5b')](0x0,_0x130432[_0xa154('0x5c')](_0x3e3406));}_0xe2955c=util[_0xa154('0x5d')](_0xa154('0x5e'),_0x130432);var _0x4062d5={'method':_0xa154('0x5f'),'uri':_0xe2955c,'qs':{'operation':_0xa154('0x60'),'username':_0x58a6af[_0xa154('0x57')]},'json':!![]};return rp(_0x4062d5);}})[_0xa154('0x24')](function(_0x3b8128){if(_0x3b8128[_0xa154('0x61')]){var _0x1e3f65={'method':'POST','uri':_0xe2955c,'form':{'operation':_0xa154('0x62'),'username':_0x3627e7,'accessKey':md5(_0x3b8128[_0xa154('0x63')]['token']+_0x2364ed)},'json':!![]};return rp(_0x1e3f65);}})[_0xa154('0x24')](function(_0x3347ad){if(_0x3347ad['success']){var _0x4a8522={'method':'GET','uri':_0xe2955c,'qs':{'operation':_0xa154('0x64'),'username':_0x3627e7,'sessionName':_0x3347ad[_0xa154('0x63')][_0xa154('0x65')],'elementType':_0x2f5e62},'json':!![]};return rp(_0x4a8522);}})[_0xa154('0x24')](function(_0x14d1c5){if(_0x14d1c5['success']){var _0x2ae02c=[_0xa154('0x66'),_0xa154('0x67'),_0xa154('0x68')];_[_0xa154('0x69')](_0x14d1c5[_0xa154('0x63')][_0xa154('0x35')],function(_0x49b202){return _0x2ae02c[_0xa154('0x6a')](_0x49b202['type']['name']);});_[_0xa154('0x69')](_0x14d1c5[_0xa154('0x63')]['fields'],function(_0x3a098a){return _0x3a098a[_0xa154('0x6b')]==='false';});return{'count':_0x14d1c5[_0xa154('0x63')][_0xa154('0x35')][_0xa154('0x36')],'rows':_['map'](_0x14d1c5[_0xa154('0x63')]['fields'],function(_0x4ab025){return{'id':_0x4ab025[_0xa154('0x2f')],'name':_0x4ab025[_0xa154('0x6c')],'custom':_[_0xa154('0x6d')](_0x4ab025['name'],_0xa154('0x6e'))?!![]:![],'options':_0x4ab025[_0xa154('0x2c')]['name']===_0xa154('0x6f')&&_0x4ab025['type'][_0xa154('0x70')][_0xa154('0x36')]>0x0?_[_0xa154('0x2a')](_0x4ab025['type'][_0xa154('0x70')],function(_0x285824){return{'name':_0x285824[_0xa154('0x6c')],'value':_0x285824[_0xa154('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x7f34bd,null))[_0xa154('0x43')](function(_0xf88133){console[_0xa154('0x72')](_0xa154('0x73')+_0xf88133);var _0x8e6778=_0x4559f4[_0xa154('0x30')][_0xa154('0x74')]?0x1f4:_0xf88133[_0xa154('0x75')]||0x1f4;logger['error'](_0xa154('0x76'),_0xa154('0x77'),_0x8e6778,JSON[_0xa154('0x78')](_0xf88133));delete _0xf88133[_0xa154('0x2f')];if(_0x8e6778===0x191){_0x8e6778=0x190;}_0x7f34bd[_0xa154('0x1b')](_0x8e6778)[_0xa154('0x28')](_0x4559f4[_0xa154('0x30')]['test']?{'message':_0xa154('0x79'),'statusCode':_0xf88133[_0xa154('0x75')]}:_0xf88133);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 5b802bd..e978244 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 _0x1499=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x16d8db,_0x6a1999){var _0x51ca48=function(_0x412e25){while(--_0x412e25){_0x16d8db['push'](_0x16d8db['shift']());}};_0x51ca48(++_0x6a1999);}(_0x1499,0x118));var _0x9149=function(_0x49e458,_0x3b57f7){_0x49e458=_0x49e458-0x0;var _0x3c2f42=_0x1499[_0x49e458];return _0x3c2f42;};'use strict';var _=require(_0x9149('0x0'));var util=require(_0x9149('0x1'));var logger=require(_0x9149('0x2'))(_0x9149('0x3'));var moment=require(_0x9149('0x4'));var BPromise=require(_0x9149('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9149('0x6'));var config=require(_0x9149('0x7'));var attributes=require(_0x9149('0x8'));var integrations=require(_0x9149('0x9'));module['exports']=function(_0x59366a,_0x1bfa69){return _0x59366a[_0x9149('0xa')](_0x9149('0xb'),attributes,{'tableName':_0x9149('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cb1=['exports','define','VtigerAccount','int_vtiger_accounts','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x2fa062,_0x829218){var _0x67b34b=function(_0x5bde45){while(--_0x5bde45){_0x2fa062['push'](_0x2fa062['shift']());}};_0x67b34b(++_0x829218);}(_0x3cb1,0xb8));var _0x13cb=function(_0x150302,_0x5ea5a8){_0x150302=_0x150302-0x0;var _0x4316e6=_0x3cb1[_0x150302];return _0x4316e6;};'use strict';var _=require(_0x13cb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x13cb('0x1'));var BPromise=require(_0x13cb('0x2'));var rp=require(_0x13cb('0x3'));var fs=require('fs');var path=require(_0x13cb('0x4'));var rimraf=require(_0x13cb('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x13cb('0x6')]=function(_0x5bae55,_0x45af04){return _0x5bae55[_0x13cb('0x7')](_0x13cb('0x8'),attributes,{'tableName':_0x13cb('0x9'),'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 aa93e9b..b3e7608 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 _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xcb91[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file +var _0x80ed=['then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','where','limit','include','map','model','attributes','GetVtigerAccount','VtigerAccount','find','raw','debug','ShowVtigerAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x80ed,0x11c));var _0xd80e=function(_0x33d19e,_0x24f013){_0x33d19e=_0x33d19e-0x0;var _0x295179=_0x80ed[_0x33d19e];return _0x295179;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c361,_0x411b3a,_0x438f7d){return new BPromise(function(_0x3b4f35,_0x1bacd3){return client[_0xd80e('0xb')](_0x51c361,_0x438f7d)[_0xd80e('0xc')](function(_0x3063ff){logger[_0xd80e('0xd')](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));logger['debug'](_0xd80e('0x10'),_0x411b3a,_0xd80e('0xf'),JSON[_0xd80e('0x11')](_0x3063ff));if(_0x3063ff[_0xd80e('0x12')]){if(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x13')]===0x1f4){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')]['message']);return _0x1bacd3(_0x3063ff['error']['message']);}logger['error'](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);return _0x3b4f35(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);}else{logger['info'](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));_0x3b4f35(_0x3063ff[_0xd80e('0x15')][_0xd80e('0x14')]);}})[_0xd80e('0x16')](function(_0xc25d82){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0xc25d82);_0x1bacd3(_0xc25d82);});});}exports['GetVtigerAccount']=function(_0x21ceec){var _0x1cc576=this;return new Promise(function(_0x3b543d,_0x34e239){return db['VtigerAccount'][_0xd80e('0x17')]({'raw':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')][_0xd80e('0x19')]||null:null,'attributes':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')]['attributes']||null:null,'limit':_0x21ceec['options']?_0x21ceec[_0xd80e('0x18')][_0xd80e('0x1a')]||null:null,'include':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')][_0xd80e('0x1b')]?_[_0xd80e('0x1c')](_0x21ceec[_0xd80e('0x18')]['include'],function(_0x1fbf8a){return{'model':db[_0x1fbf8a[_0xd80e('0x1d')]],'as':_0x1fbf8a['as'],'attributes':_0x1fbf8a[_0xd80e('0x1e')],'include':_0x1fbf8a['include']?_[_0xd80e('0x1c')](_0x1fbf8a[_0xd80e('0x1b')],function(_0xe9bb59){return{'model':db[_0xe9bb59['model']],'as':_0xe9bb59['as'],'attributes':_0xe9bb59['attributes'],'include':_0xe9bb59['include']?_[_0xd80e('0x1c')](_0xe9bb59['include'],function(_0x9f9287){return{'model':db[_0x9f9287[_0xd80e('0x1d')]],'as':_0x9f9287['as'],'attributes':_0x9f9287['attributes']};}):[]};}):[]};}):[]:[]})[_0xd80e('0xc')](function(_0xe1c04a){logger[_0xd80e('0xd')](_0xd80e('0x1f'),_0x21ceec);logger['debug'](_0xd80e('0x1f'),_0x21ceec,JSON[_0xd80e('0x11')](_0xe1c04a));_0x3b543d(_0xe1c04a);})[_0xd80e('0x16')](function(_0x39088b){logger[_0xd80e('0x12')](_0xd80e('0x1f'),_0x39088b[_0xd80e('0x14')],_0x21ceec);_0x34e239(_0x1cc576[_0xd80e('0x12')](0x1f4,_0x39088b['message']));});});};exports['ShowVtigerAccount']=function(_0x30f9bd){var _0x1303eb=this;return new Promise(function(_0x400220,_0x32360c){return db[_0xd80e('0x20')][_0xd80e('0x21')]({'raw':_0x30f9bd['options']?_0x30f9bd['options'][_0xd80e('0x22')]===undefined?!![]:![]:!![],'where':_0x30f9bd[_0xd80e('0x18')]?_0x30f9bd[_0xd80e('0x18')][_0xd80e('0x19')]||null:null,'attributes':_0x30f9bd[_0xd80e('0x18')]?_0x30f9bd[_0xd80e('0x18')][_0xd80e('0x1e')]||null:null,'include':_0x30f9bd[_0xd80e('0x18')]?_0x30f9bd['options']['include']?_[_0xd80e('0x1c')](_0x30f9bd[_0xd80e('0x18')][_0xd80e('0x1b')],function(_0x12d113){return{'model':db[_0x12d113[_0xd80e('0x1d')]],'as':_0x12d113['as'],'attributes':_0x12d113[_0xd80e('0x1e')],'include':_0x12d113[_0xd80e('0x1b')]?_[_0xd80e('0x1c')](_0x12d113[_0xd80e('0x1b')],function(_0x192c08){return{'model':db[_0x192c08['model']],'as':_0x192c08['as'],'attributes':_0x192c08[_0xd80e('0x1e')],'include':_0x192c08['include']?_[_0xd80e('0x1c')](_0x192c08[_0xd80e('0x1b')],function(_0x366b80){return{'model':db[_0x366b80[_0xd80e('0x1d')]],'as':_0x366b80['as'],'attributes':_0x366b80['attributes']};}):[]};}):[]};}):[]:[]})[_0xd80e('0xc')](function(_0x54a969){logger[_0xd80e('0xd')]('ShowVtigerAccount',_0x30f9bd);logger[_0xd80e('0x23')](_0xd80e('0x24'),_0x30f9bd,JSON['stringify'](_0x54a969));_0x400220(_0x54a969);})[_0xd80e('0x16')](function(_0x41ac0d){logger[_0xd80e('0x12')]('ShowVtigerAccount',_0x41ac0d[_0xd80e('0x14')],_0x30f9bd);_0x32360c(_0x1303eb[_0xd80e('0x12')](0x1f4,_0x41ac0d[_0xd80e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index cfe0671..0ec549b 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 _0x8701=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','destroy'];(function(_0x48ae23,_0x101c88){var _0x3dd94e=function(_0x3771be){while(--_0x3771be){_0x48ae23['push'](_0x48ae23['shift']());}};_0x3dd94e(++_0x101c88);}(_0x8701,0x112));var _0x1870=function(_0x22c080,_0x2e34c3){_0x22c080=_0x22c080-0x0;var _0x19939d=_0x8701[_0x22c080];return _0x19939d;};'use strict';var multer=require(_0x1870('0x0'));var util=require(_0x1870('0x1'));var path=require('path');var timeout=require(_0x1870('0x2'));var express=require('express');var router=express[_0x1870('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1870('0x4'));var interaction=require(_0x1870('0x5'));var config=require('../../config/environment');var controller=require(_0x1870('0x6'));router[_0x1870('0x7')]('/',auth[_0x1870('0x8')](),controller[_0x1870('0x9')]);router[_0x1870('0x7')](_0x1870('0xa'),auth[_0x1870('0x8')](),controller[_0x1870('0xb')]);router['get'](_0x1870('0xc'),auth[_0x1870('0x8')](),controller['getFields']);router[_0x1870('0x7')](_0x1870('0xd'),auth['isAuthenticated'](),controller[_0x1870('0xe')]);router[_0x1870('0x7')](_0x1870('0xf'),auth[_0x1870('0x8')](),controller[_0x1870('0x10')]);router[_0x1870('0x11')]('/',auth[_0x1870('0x8')](),controller[_0x1870('0x12')]);router['put']('/:id',auth[_0x1870('0x8')](),controller['update']);router['delete'](_0x1870('0xa'),auth[_0x1870('0x8')](),controller[_0x1870('0x13')]);module[_0x1870('0x14')]=router; \ No newline at end of file +var _0x1021=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x3272d0,_0x552a32){var _0x60401e=function(_0x4cb77f){while(--_0x4cb77f){_0x3272d0['push'](_0x3272d0['shift']());}};_0x60401e(++_0x552a32);}(_0x1021,0x1d7));var _0x1102=function(_0x23aa48,_0x640d5){_0x23aa48=_0x23aa48-0x0;var _0x592b6f=_0x1021[_0x23aa48];return _0x592b6f;};'use strict';var multer=require(_0x1102('0x0'));var util=require(_0x1102('0x1'));var path=require(_0x1102('0x2'));var timeout=require(_0x1102('0x3'));var express=require('express');var router=express[_0x1102('0x4')]();var fs_extra=require(_0x1102('0x5'));var auth=require(_0x1102('0x6'));var interaction=require(_0x1102('0x7'));var config=require(_0x1102('0x8'));var controller=require(_0x1102('0x9'));router[_0x1102('0xa')]('/',auth['isAuthenticated'](),controller[_0x1102('0xb')]);router[_0x1102('0xa')](_0x1102('0xc'),auth[_0x1102('0xd')](),controller['show']);router[_0x1102('0xa')]('/:id/fields',auth[_0x1102('0xd')](),controller[_0x1102('0xe')]);router['get'](_0x1102('0xf'),auth[_0x1102('0xd')](),controller[_0x1102('0x10')]);router[_0x1102('0xa')](_0x1102('0x11'),auth['isAuthenticated'](),controller[_0x1102('0x12')]);router[_0x1102('0x13')]('/',auth['isAuthenticated'](),controller[_0x1102('0x14')]);router[_0x1102('0x15')](_0x1102('0xc'),auth['isAuthenticated'](),controller[_0x1102('0x16')]);router[_0x1102('0x17')]('/:id',auth[_0x1102('0xd')](),controller[_0x1102('0x18')]);module[_0x1102('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 74300f9..6c2605f 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 _0x321f=['STRING','exports'];(function(_0xc8ddc7,_0x709b5a){var _0x1604fd=function(_0x2d1ae0){while(--_0x2d1ae0){_0xc8ddc7['push'](_0xc8ddc7['shift']());}};_0x1604fd(++_0x709b5a);}(_0x321f,0xfb));var _0xf321=function(_0x14a321,_0x4889d9){_0x14a321=_0x14a321-0x0;var _0x16dd89=_0x321f[_0x14a321];return _0x16dd89;};'use strict';var Sequelize=require('sequelize');module[_0xf321('0x0')]={'name':{'type':Sequelize[_0xf321('0x1')]},'description':{'type':Sequelize[_0xf321('0x1')]}}; \ No newline at end of file +var _0x2e34=['exports','STRING','sequelize'];(function(_0x173ce9,_0x1f4873){var _0x2bdbe6=function(_0x58da30){while(--_0x58da30){_0x173ce9['push'](_0x173ce9['shift']());}};_0x2bdbe6(++_0x1f4873);}(_0x2e34,0x152));var _0x42e3=function(_0x523037,_0x50d991){_0x523037=_0x523037-0x0;var _0x497517=_0x2e34[_0x523037];return _0x497517;};'use strict';var Sequelize=require(_0x42e3('0x0'));module[_0x42e3('0x1')]={'name':{'type':Sequelize[_0x42e3('0x2')]},'description':{'type':Sequelize[_0x42e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 15b3af2..f77b745 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 _0x6cef=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','VtigerConfiguration','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x9a262d,_0x4a126f){var _0x22c92d=function(_0x163553){while(--_0x163553){_0x9a262d['push'](_0x9a262d['shift']());}};_0x22c92d(++_0x4a126f);}(_0x6cef,0xe8));var _0xf6ce=function(_0x59e85e,_0x4e399b){_0x59e85e=_0x59e85e-0x0;var _0x34e955=_0x6cef[_0x59e85e];return _0x34e955;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6ce('0x0'));var zipdir=require(_0xf6ce('0x1'));var jsonpatch=require(_0xf6ce('0x2'));var rp=require(_0xf6ce('0x3'));var moment=require(_0xf6ce('0x4'));var BPromise=require(_0xf6ce('0x5'));var Mustache=require(_0xf6ce('0x6'));var util=require(_0xf6ce('0x7'));var path=require('path');var sox=require(_0xf6ce('0x8'));var csv=require(_0xf6ce('0x9'));var ejs=require(_0xf6ce('0xa'));var fs=require('fs');var fs_extra=require(_0xf6ce('0xb'));var _=require(_0xf6ce('0xc'));var squel=require(_0xf6ce('0xd'));var crypto=require(_0xf6ce('0xe'));var jsforce=require(_0xf6ce('0xf'));var deskjs=require(_0xf6ce('0x10'));var toCsv=require(_0xf6ce('0x9'));var querystring=require(_0xf6ce('0x11'));var Papa=require(_0xf6ce('0x12'));var Redis=require('ioredis');var authService=require(_0xf6ce('0x13'));var qs=require(_0xf6ce('0x14'));var as=require(_0xf6ce('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6ce('0x16'))(_0xf6ce('0x17'));var utils=require(_0xf6ce('0x18'));var config=require(_0xf6ce('0x19'));var licenseUtil=require(_0xf6ce('0x1a'));var db=require(_0xf6ce('0x1b'))['db'];function respondWithStatusCode(_0x18838b,_0x206b2e){_0x206b2e=_0x206b2e||0xcc;return function(_0x4d704c){if(_0x4d704c){return _0x18838b[_0xf6ce('0x1c')](_0x206b2e);}return _0x18838b['status'](_0x206b2e)['end']();};}function respondWithResult(_0x382a42,_0x49db1a){_0x49db1a=_0x49db1a||0xc8;return function(_0x37a911){if(_0x37a911){return _0x382a42['status'](_0x49db1a)[_0xf6ce('0x1d')](_0x37a911);}};}function respondWithFilteredResult(_0x131efa,_0x509f7a){return function(_0x5a0194){if(_0x5a0194){var _0x5526b1=typeof _0x509f7a[_0xf6ce('0x1e')]===_0xf6ce('0x1f')&&typeof _0x509f7a[_0xf6ce('0x20')]===_0xf6ce('0x1f');var _0x448919=_0x5a0194[_0xf6ce('0x21')];var _0x8caf67=_0x5526b1?0x0:_0x509f7a['offset'];var _0x100e71=_0x5526b1?_0x5a0194[_0xf6ce('0x21')]:_0x509f7a[_0xf6ce('0x1e')]+_0x509f7a[_0xf6ce('0x20')];var _0x13442e;if(_0x100e71>=_0x448919){_0x100e71=_0x448919;_0x13442e=0xc8;}else{_0x13442e=0xce;}_0x131efa[_0xf6ce('0x22')](_0x13442e);return _0x131efa['set'](_0xf6ce('0x23'),_0x8caf67+'-'+_0x100e71+'/'+_0x448919)[_0xf6ce('0x1d')](_0x5a0194);}return null;};}function patchUpdates(_0xb06cdd){return function(_0x5c0a33){try{jsonpatch[_0xf6ce('0x24')](_0x5c0a33,_0xb06cdd,!![]);}catch(_0x6efb50){return BPromise[_0xf6ce('0x25')](_0x6efb50);}return _0x5c0a33[_0xf6ce('0x26')]();};}function saveUpdates(_0x1ac747,_0x3654b9){return function(_0x395e28){if(_0x395e28){return _0x395e28[_0xf6ce('0x27')](_0x1ac747)[_0xf6ce('0x28')](function(_0x245011){return _0x245011;});}return null;};}function removeEntity(_0xdafc46,_0x20634d){return function(_0xc759b5){if(_0xc759b5){return _0xc759b5[_0xf6ce('0x29')]()[_0xf6ce('0x28')](function(){_0xdafc46[_0xf6ce('0x22')](0xcc)[_0xf6ce('0x2a')]();});}};}function handleEntityNotFound(_0x1343be,_0x1ebe57){return function(_0x966a09){if(!_0x966a09){_0x1343be[_0xf6ce('0x1c')](0x194);}return _0x966a09;};}function handleError(_0x1b2971,_0x5701e9){_0x5701e9=_0x5701e9||0x1f4;return function(_0x160536){logger['error'](_0x160536['stack']);if(_0x160536[_0xf6ce('0x2b')]){delete _0x160536[_0xf6ce('0x2b')];}_0x1b2971[_0xf6ce('0x22')](_0x5701e9)[_0xf6ce('0x2c')](_0x160536);};}exports[_0xf6ce('0x2d')]=function(_0x566c22,_0x590d81){var _0x36e0ef={},_0x2067fa={},_0x2f7be7={'count':0x0,'rows':[]};var _0x503bb3=_['map'](db[_0xf6ce('0x2e')]['rawAttributes'],function(_0x3e2bd5){return{'name':_0x3e2bd5[_0xf6ce('0x2f')],'type':_0x3e2bd5[_0xf6ce('0x30')][_0xf6ce('0x31')]};});_0x2067fa[_0xf6ce('0x32')]=_[_0xf6ce('0x33')](_0x503bb3,_0xf6ce('0x2b'));_0x2067fa['query']=_[_0xf6ce('0x34')](_0x566c22[_0xf6ce('0x35')]);_0x2067fa[_0xf6ce('0x36')]=_['intersection'](_0x2067fa['model'],_0x2067fa[_0xf6ce('0x35')]);_0x36e0ef['attributes']=_[_0xf6ce('0x37')](_0x2067fa['model'],qs[_0xf6ce('0x38')](_0x566c22[_0xf6ce('0x35')][_0xf6ce('0x38')]));_0x36e0ef[_0xf6ce('0x39')]=_0x36e0ef['attributes'][_0xf6ce('0x3a')]?_0x36e0ef['attributes']:_0x2067fa[_0xf6ce('0x32')];if(!_0x566c22[_0xf6ce('0x35')][_0xf6ce('0x3b')](_0xf6ce('0x3c'))){_0x36e0ef['limit']=qs[_0xf6ce('0x20')](_0x566c22['query'][_0xf6ce('0x20')]);_0x36e0ef['offset']=qs['offset'](_0x566c22['query'][_0xf6ce('0x1e')]);}_0x36e0ef['order']=qs['sort'](_0x566c22['query'][_0xf6ce('0x3d')]);_0x36e0ef[_0xf6ce('0x3e')]=qs[_0xf6ce('0x36')](_[_0xf6ce('0x3f')](_0x566c22['query'],_0x2067fa[_0xf6ce('0x36')]),_0x503bb3);if(_0x566c22[_0xf6ce('0x35')][_0xf6ce('0x40')]){_0x36e0ef[_0xf6ce('0x3e')]=_[_0xf6ce('0x41')](_0x36e0ef[_0xf6ce('0x3e')],{'$or':_[_0xf6ce('0x33')](_0x503bb3,function(_0x13a0bf){if(_0x13a0bf[_0xf6ce('0x30')]!==_0xf6ce('0x42')){var _0x508644={};_0x508644[_0x13a0bf[_0xf6ce('0x2b')]]={'$like':'%'+_0x566c22[_0xf6ce('0x35')][_0xf6ce('0x40')]+'%'};return _0x508644;}})});}_0x36e0ef=_['merge']({},_0x36e0ef,_0x566c22[_0xf6ce('0x43')]);var _0xee465={'where':_0x36e0ef[_0xf6ce('0x3e')]};return db[_0xf6ce('0x2e')][_0xf6ce('0x21')](_0xee465)[_0xf6ce('0x28')](function(_0x2d7470){_0x2f7be7['count']=_0x2d7470;if(_0x566c22[_0xf6ce('0x35')][_0xf6ce('0x44')]){_0x36e0ef[_0xf6ce('0x45')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x36e0ef);})[_0xf6ce('0x28')](function(_0x274527){_0x2f7be7[_0xf6ce('0x46')]=_0x274527;return _0x2f7be7;})[_0xf6ce('0x28')](respondWithFilteredResult(_0x590d81,_0x36e0ef))[_0xf6ce('0x47')](handleError(_0x590d81,null));};exports[_0xf6ce('0x48')]=function(_0x8c81f4,_0x45e6dd){var _0xc52942={'raw':![],'where':{'id':_0x8c81f4[_0xf6ce('0x49')]['id']}},_0x31eb7f={};_0x31eb7f[_0xf6ce('0x32')]=_['keys'](db[_0xf6ce('0x2e')][_0xf6ce('0x4a')]);_0x31eb7f['query']=_['keys'](_0x8c81f4[_0xf6ce('0x35')]);_0x31eb7f[_0xf6ce('0x36')]=_['intersection'](_0x31eb7f[_0xf6ce('0x32')],_0x31eb7f[_0xf6ce('0x35')]);_0xc52942['attributes']=_[_0xf6ce('0x37')](_0x31eb7f['model'],qs[_0xf6ce('0x38')](_0x8c81f4[_0xf6ce('0x35')]['fields']));_0xc52942['attributes']=_0xc52942[_0xf6ce('0x39')][_0xf6ce('0x3a')]?_0xc52942[_0xf6ce('0x39')]:_0x31eb7f[_0xf6ce('0x32')];if(_0x8c81f4[_0xf6ce('0x35')]['includeAll']){_0xc52942[_0xf6ce('0x45')]=[{'all':!![]}];}_0xc52942=_[_0xf6ce('0x41')]({},_0xc52942,_0x8c81f4['options']);return db[_0xf6ce('0x2e')][_0xf6ce('0x4b')](_0xc52942)[_0xf6ce('0x28')](handleEntityNotFound(_0x45e6dd,null))[_0xf6ce('0x28')](respondWithResult(_0x45e6dd,null))[_0xf6ce('0x47')](handleError(_0x45e6dd,null));};exports[_0xf6ce('0x4c')]=function(_0xce0389,_0x4ccfbc){return db['VtigerConfiguration'][_0xf6ce('0x4c')](_0xce0389[_0xf6ce('0x4d')],{})[_0xf6ce('0x28')](respondWithResult(_0x4ccfbc,0xc9))[_0xf6ce('0x47')](handleError(_0x4ccfbc,null));};exports['update']=function(_0x3db839,_0x288a37){if(_0x3db839[_0xf6ce('0x4d')]['id']){delete _0x3db839['body']['id'];}return db[_0xf6ce('0x2e')][_0xf6ce('0x4b')]({'where':{'id':_0x3db839['params']['id']}})[_0xf6ce('0x28')](handleEntityNotFound(_0x288a37,null))[_0xf6ce('0x28')](saveUpdates(_0x3db839[_0xf6ce('0x4d')],null))[_0xf6ce('0x28')](respondWithResult(_0x288a37,null))[_0xf6ce('0x47')](handleError(_0x288a37,null));};exports[_0xf6ce('0x29')]=function(_0x207e96,_0x1b673f){return db[_0xf6ce('0x2e')][_0xf6ce('0x4b')]({'where':{'id':_0x207e96['params']['id']}})[_0xf6ce('0x28')](handleEntityNotFound(_0x1b673f,null))[_0xf6ce('0x28')](removeEntity(_0x1b673f,null))['catch'](handleError(_0x1b673f,null));};exports[_0xf6ce('0x4e')]=function(_0x32d782,_0x4bba80,_0x473b65){var _0xa398be={};var _0x20ec33={};var _0x795b44;var _0x34576e;return db[_0xf6ce('0x2e')][_0xf6ce('0x4f')]({'where':{'id':_0x32d782['params']['id']}})[_0xf6ce('0x28')](handleEntityNotFound(_0x4bba80,null))['then'](function(_0x5052fe){if(_0x5052fe){_0x795b44=_0x5052fe;_0x20ec33[_0xf6ce('0x32')]=_[_0xf6ce('0x34')](db[_0xf6ce('0x50')]['rawAttributes']);_0x20ec33[_0xf6ce('0x35')]=_[_0xf6ce('0x34')](_0x32d782['query']);_0x20ec33['filters']=_[_0xf6ce('0x37')](_0x20ec33[_0xf6ce('0x32')],_0x20ec33[_0xf6ce('0x35')]);_0xa398be[_0xf6ce('0x39')]=_['intersection'](_0x20ec33['model'],qs[_0xf6ce('0x38')](_0x32d782[_0xf6ce('0x35')][_0xf6ce('0x38')]));_0xa398be[_0xf6ce('0x39')]=_0xa398be[_0xf6ce('0x39')][_0xf6ce('0x3a')]?_0xa398be['attributes']:_0x20ec33[_0xf6ce('0x32')];_0xa398be[_0xf6ce('0x51')]=qs[_0xf6ce('0x3d')](_0x32d782[_0xf6ce('0x35')][_0xf6ce('0x3d')]);_0xa398be[_0xf6ce('0x3e')]=qs[_0xf6ce('0x36')](_['pick'](_0x32d782[_0xf6ce('0x35')],_0x20ec33['filters']));if(_0x32d782['query'][_0xf6ce('0x40')]){_0xa398be['where']=_[_0xf6ce('0x41')](_0xa398be['where'],{'$or':_['map'](_0xa398be['attributes'],function(_0x168b43){var _0x13a535={};_0x13a535[_0x168b43]={'$like':'%'+_0x32d782[_0xf6ce('0x35')]['filter']+'%'};return _0x13a535;})});}_0xa398be=_[_0xf6ce('0x41')]({},_0xa398be,_0x32d782[_0xf6ce('0x43')]);return _0x795b44[_0xf6ce('0x4e')](_0xa398be);}})[_0xf6ce('0x28')](function(_0x5f3489){if(_0x5f3489){_0x34576e=_0x5f3489[_0xf6ce('0x3a')];if(!_0x32d782['query']['hasOwnProperty'](_0xf6ce('0x3c'))){_0xa398be[_0xf6ce('0x20')]=qs[_0xf6ce('0x20')](_0x32d782['query']['limit']);_0xa398be['offset']=qs[_0xf6ce('0x1e')](_0x32d782[_0xf6ce('0x35')][_0xf6ce('0x1e')]);}return _0x795b44[_0xf6ce('0x4e')](_0xa398be);}})[_0xf6ce('0x28')](function(_0x5b1efc){if(_0x5b1efc){return _0x5b1efc?{'count':_0x34576e,'rows':_0x5b1efc}:null;}})[_0xf6ce('0x28')](respondWithResult(_0x4bba80,null))[_0xf6ce('0x47')](handleError(_0x4bba80,null));};exports[_0xf6ce('0x52')]=function(_0x2607d9,_0xbadfec,_0x10ac7d){var _0x2bd5a0={};var _0x26cbdb={};var _0x5a55b0;var _0x4d9f33;return db[_0xf6ce('0x2e')][_0xf6ce('0x4f')]({'where':{'id':_0x2607d9[_0xf6ce('0x49')]['id']}})['then'](handleEntityNotFound(_0xbadfec,null))['then'](function(_0x5a8bb2){if(_0x5a8bb2){_0x5a55b0=_0x5a8bb2;_0x26cbdb[_0xf6ce('0x32')]=_[_0xf6ce('0x34')](db[_0xf6ce('0x50')][_0xf6ce('0x4a')]);_0x26cbdb[_0xf6ce('0x35')]=_[_0xf6ce('0x34')](_0x2607d9['query']);_0x26cbdb[_0xf6ce('0x36')]=_[_0xf6ce('0x37')](_0x26cbdb['model'],_0x26cbdb[_0xf6ce('0x35')]);_0x2bd5a0['attributes']=_[_0xf6ce('0x37')](_0x26cbdb[_0xf6ce('0x32')],qs['fields'](_0x2607d9['query'][_0xf6ce('0x38')]));_0x2bd5a0[_0xf6ce('0x39')]=_0x2bd5a0[_0xf6ce('0x39')]['length']?_0x2bd5a0[_0xf6ce('0x39')]:_0x26cbdb['model'];_0x2bd5a0['order']=qs[_0xf6ce('0x3d')](_0x2607d9[_0xf6ce('0x35')][_0xf6ce('0x3d')]);_0x2bd5a0[_0xf6ce('0x3e')]=qs[_0xf6ce('0x36')](_[_0xf6ce('0x3f')](_0x2607d9[_0xf6ce('0x35')],_0x26cbdb[_0xf6ce('0x36')]));if(_0x2607d9[_0xf6ce('0x35')]['filter']){_0x2bd5a0[_0xf6ce('0x3e')]=_[_0xf6ce('0x41')](_0x2bd5a0[_0xf6ce('0x3e')],{'$or':_[_0xf6ce('0x33')](_0x2bd5a0[_0xf6ce('0x39')],function(_0x1a315a){var _0x515f73={};_0x515f73[_0x1a315a]={'$like':'%'+_0x2607d9[_0xf6ce('0x35')]['filter']+'%'};return _0x515f73;})});}_0x2bd5a0=_[_0xf6ce('0x41')]({},_0x2bd5a0,_0x2607d9[_0xf6ce('0x43')]);return _0x5a55b0[_0xf6ce('0x52')](_0x2bd5a0);}})['then'](function(_0x15f1b8){if(_0x15f1b8){_0x4d9f33=_0x15f1b8[_0xf6ce('0x3a')];if(!_0x2607d9[_0xf6ce('0x35')][_0xf6ce('0x3b')]('nolimit')){_0x2bd5a0[_0xf6ce('0x20')]=qs['limit'](_0x2607d9[_0xf6ce('0x35')][_0xf6ce('0x20')]);_0x2bd5a0[_0xf6ce('0x1e')]=qs[_0xf6ce('0x1e')](_0x2607d9[_0xf6ce('0x35')]['offset']);}return _0x5a55b0[_0xf6ce('0x52')](_0x2bd5a0);}})[_0xf6ce('0x28')](function(_0x28b1e1){if(_0x28b1e1){return _0x28b1e1?{'count':_0x4d9f33,'rows':_0x28b1e1}:null;}})[_0xf6ce('0x28')](respondWithResult(_0xbadfec,null))[_0xf6ce('0x47')](handleError(_0xbadfec,null));};exports[_0xf6ce('0x53')]=function(_0x5927db,_0x22b618,_0x20f151){var _0x11fe96={};var _0x65cb48={};var _0x332092;var _0x8cbaca;return db[_0xf6ce('0x2e')][_0xf6ce('0x4f')]({'where':{'id':_0x5927db[_0xf6ce('0x49')]['id']}})['then'](handleEntityNotFound(_0x22b618,null))[_0xf6ce('0x28')](function(_0x2dc6b6){if(_0x2dc6b6){_0x332092=_0x2dc6b6;_0x65cb48[_0xf6ce('0x32')]=_[_0xf6ce('0x34')](db[_0xf6ce('0x50')][_0xf6ce('0x4a')]);_0x65cb48[_0xf6ce('0x35')]=_[_0xf6ce('0x34')](_0x5927db[_0xf6ce('0x35')]);_0x65cb48[_0xf6ce('0x36')]=_[_0xf6ce('0x37')](_0x65cb48[_0xf6ce('0x32')],_0x65cb48['query']);_0x11fe96['attributes']=_[_0xf6ce('0x37')](_0x65cb48['model'],qs[_0xf6ce('0x38')](_0x5927db[_0xf6ce('0x35')]['fields']));_0x11fe96['attributes']=_0x11fe96[_0xf6ce('0x39')]['length']?_0x11fe96['attributes']:_0x65cb48['model'];_0x11fe96[_0xf6ce('0x51')]=qs[_0xf6ce('0x3d')](_0x5927db[_0xf6ce('0x35')][_0xf6ce('0x3d')]);_0x11fe96[_0xf6ce('0x3e')]=qs['filters'](_[_0xf6ce('0x3f')](_0x5927db[_0xf6ce('0x35')],_0x65cb48['filters']));if(_0x5927db[_0xf6ce('0x35')][_0xf6ce('0x40')]){_0x11fe96[_0xf6ce('0x3e')]=_['merge'](_0x11fe96[_0xf6ce('0x3e')],{'$or':_[_0xf6ce('0x33')](_0x11fe96[_0xf6ce('0x39')],function(_0x25701b){var _0x14e02f={};_0x14e02f[_0x25701b]={'$like':'%'+_0x5927db[_0xf6ce('0x35')][_0xf6ce('0x40')]+'%'};return _0x14e02f;})});}_0x11fe96=_[_0xf6ce('0x41')]({},_0x11fe96,_0x5927db[_0xf6ce('0x43')]);return _0x332092[_0xf6ce('0x53')](_0x11fe96);}})[_0xf6ce('0x28')](function(_0x2296fd){if(_0x2296fd){_0x8cbaca=_0x2296fd[_0xf6ce('0x3a')];if(!_0x5927db[_0xf6ce('0x35')]['hasOwnProperty']('nolimit')){_0x11fe96['limit']=qs[_0xf6ce('0x20')](_0x5927db[_0xf6ce('0x35')][_0xf6ce('0x20')]);_0x11fe96[_0xf6ce('0x1e')]=qs[_0xf6ce('0x1e')](_0x5927db[_0xf6ce('0x35')][_0xf6ce('0x1e')]);}return _0x332092[_0xf6ce('0x53')](_0x11fe96);}})['then'](function(_0x5df819){if(_0x5df819){return _0x5df819?{'count':_0x8cbaca,'rows':_0x5df819}:null;}})[_0xf6ce('0x28')](respondWithResult(_0x22b618,null))[_0xf6ce('0x47')](handleError(_0x22b618,null));}; \ No newline at end of file +var _0xdf1f=['params','find','catch','create','body','destroy','getFields','findOne','hasOwnProperty','VtigerField','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../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','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','show'];(function(_0x581a36,_0x2ab0f7){var _0x1528ee=function(_0x4c712e){while(--_0x4c712e){_0x581a36['push'](_0x581a36['shift']());}};_0x1528ee(++_0x2ab0f7);}(_0xdf1f,0x1ec));var _0xfdf1=function(_0x5e7ab9,_0x147229){_0x5e7ab9=_0x5e7ab9-0x0;var _0x26dade=_0xdf1f[_0x5e7ab9];return _0x26dade;};'use strict';var emlformat=require(_0xfdf1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfdf1('0x1'));var rp=require(_0xfdf1('0x2'));var moment=require(_0xfdf1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfdf1('0x4'));var util=require('util');var path=require(_0xfdf1('0x5'));var sox=require(_0xfdf1('0x6'));var csv=require(_0xfdf1('0x7'));var ejs=require(_0xfdf1('0x8'));var fs=require('fs');var fs_extra=require(_0xfdf1('0x9'));var _=require(_0xfdf1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdf1('0xb'));var deskjs=require(_0xfdf1('0xc'));var toCsv=require(_0xfdf1('0x7'));var querystring=require(_0xfdf1('0xd'));var Papa=require('papaparse');var Redis=require(_0xfdf1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfdf1('0xf'));var as=require(_0xfdf1('0x10'));var hardwareService=require(_0xfdf1('0x11'));var logger=require(_0xfdf1('0x12'))(_0xfdf1('0x13'));var utils=require('../../config/utils');var config=require(_0xfdf1('0x14'));var licenseUtil=require(_0xfdf1('0x15'));var db=require(_0xfdf1('0x16'))['db'];function respondWithStatusCode(_0x5ada07,_0x59529e){_0x59529e=_0x59529e||0xcc;return function(_0x2e6b59){if(_0x2e6b59){return _0x5ada07[_0xfdf1('0x17')](_0x59529e);}return _0x5ada07[_0xfdf1('0x18')](_0x59529e)[_0xfdf1('0x19')]();};}function respondWithResult(_0xbf475d,_0x86dec3){_0x86dec3=_0x86dec3||0xc8;return function(_0x3d8470){if(_0x3d8470){return _0xbf475d[_0xfdf1('0x18')](_0x86dec3)[_0xfdf1('0x1a')](_0x3d8470);}};}function respondWithFilteredResult(_0x1a5b45,_0x28b9b1){return function(_0x15188b){if(_0x15188b){var _0x3a507d=typeof _0x28b9b1['offset']===_0xfdf1('0x1b')&&typeof _0x28b9b1['limit']==='undefined';var _0x536012=_0x15188b[_0xfdf1('0x1c')];var _0x57bf56=_0x3a507d?0x0:_0x28b9b1['offset'];var _0x19058c=_0x3a507d?_0x15188b['count']:_0x28b9b1[_0xfdf1('0x1d')]+_0x28b9b1[_0xfdf1('0x1e')];var _0x537a56;if(_0x19058c>=_0x536012){_0x19058c=_0x536012;_0x537a56=0xc8;}else{_0x537a56=0xce;}_0x1a5b45[_0xfdf1('0x18')](_0x537a56);return _0x1a5b45[_0xfdf1('0x1f')](_0xfdf1('0x20'),_0x57bf56+'-'+_0x19058c+'/'+_0x536012)['json'](_0x15188b);}return null;};}function patchUpdates(_0x167434){return function(_0x266a4e){try{jsonpatch[_0xfdf1('0x21')](_0x266a4e,_0x167434,!![]);}catch(_0x3dba1c){return BPromise[_0xfdf1('0x22')](_0x3dba1c);}return _0x266a4e[_0xfdf1('0x23')]();};}function saveUpdates(_0x2c9d74,_0x33a058){return function(_0x585952){if(_0x585952){return _0x585952[_0xfdf1('0x24')](_0x2c9d74)['then'](function(_0x6746a7){return _0x6746a7;});}return null;};}function removeEntity(_0x43e1c1,_0x449f05){return function(_0x3f620a){if(_0x3f620a){return _0x3f620a['destroy']()[_0xfdf1('0x25')](function(){_0x43e1c1['status'](0xcc)[_0xfdf1('0x19')]();});}};}function handleEntityNotFound(_0x288a12,_0x2af500){return function(_0x2a051d){if(!_0x2a051d){_0x288a12[_0xfdf1('0x17')](0x194);}return _0x2a051d;};}function handleError(_0x11a1a8,_0x57eb11){_0x57eb11=_0x57eb11||0x1f4;return function(_0x3944e6){logger[_0xfdf1('0x26')](_0x3944e6[_0xfdf1('0x27')]);if(_0x3944e6[_0xfdf1('0x28')]){delete _0x3944e6[_0xfdf1('0x28')];}_0x11a1a8[_0xfdf1('0x18')](_0x57eb11)[_0xfdf1('0x29')](_0x3944e6);};}exports[_0xfdf1('0x2a')]=function(_0x49e299,_0x2b7866){var _0x583e00={},_0x2431c1={},_0x54c5b2={'count':0x0,'rows':[]};var _0x28f1eb=_[_0xfdf1('0x2b')](db['VtigerConfiguration'][_0xfdf1('0x2c')],function(_0x295714){return{'name':_0x295714['fieldName'],'type':_0x295714[_0xfdf1('0x2d')][_0xfdf1('0x2e')]};});_0x2431c1[_0xfdf1('0x2f')]=_[_0xfdf1('0x2b')](_0x28f1eb,'name');_0x2431c1[_0xfdf1('0x30')]=_[_0xfdf1('0x31')](_0x49e299['query']);_0x2431c1[_0xfdf1('0x32')]=_[_0xfdf1('0x33')](_0x2431c1[_0xfdf1('0x2f')],_0x2431c1[_0xfdf1('0x30')]);_0x583e00[_0xfdf1('0x34')]=_[_0xfdf1('0x33')](_0x2431c1[_0xfdf1('0x2f')],qs[_0xfdf1('0x35')](_0x49e299[_0xfdf1('0x30')]['fields']));_0x583e00['attributes']=_0x583e00['attributes'][_0xfdf1('0x36')]?_0x583e00[_0xfdf1('0x34')]:_0x2431c1[_0xfdf1('0x2f')];if(!_0x49e299[_0xfdf1('0x30')]['hasOwnProperty'](_0xfdf1('0x37'))){_0x583e00[_0xfdf1('0x1e')]=qs[_0xfdf1('0x1e')](_0x49e299[_0xfdf1('0x30')][_0xfdf1('0x1e')]);_0x583e00['offset']=qs[_0xfdf1('0x1d')](_0x49e299[_0xfdf1('0x30')][_0xfdf1('0x1d')]);}_0x583e00[_0xfdf1('0x38')]=qs[_0xfdf1('0x39')](_0x49e299[_0xfdf1('0x30')][_0xfdf1('0x39')]);_0x583e00[_0xfdf1('0x3a')]=qs['filters'](_[_0xfdf1('0x3b')](_0x49e299[_0xfdf1('0x30')],_0x2431c1[_0xfdf1('0x32')]),_0x28f1eb);if(_0x49e299[_0xfdf1('0x30')][_0xfdf1('0x3c')]){_0x583e00[_0xfdf1('0x3a')]=_[_0xfdf1('0x3d')](_0x583e00['where'],{'$or':_[_0xfdf1('0x2b')](_0x28f1eb,function(_0x2f3b08){if(_0x2f3b08[_0xfdf1('0x2d')]!==_0xfdf1('0x3e')){var _0xf570c4={};_0xf570c4[_0x2f3b08['name']]={'$like':'%'+_0x49e299[_0xfdf1('0x30')][_0xfdf1('0x3c')]+'%'};return _0xf570c4;}})});}_0x583e00=_[_0xfdf1('0x3d')]({},_0x583e00,_0x49e299[_0xfdf1('0x3f')]);var _0x444133={'where':_0x583e00[_0xfdf1('0x3a')]};return db[_0xfdf1('0x40')][_0xfdf1('0x1c')](_0x444133)[_0xfdf1('0x25')](function(_0x507eb9){_0x54c5b2[_0xfdf1('0x1c')]=_0x507eb9;if(_0x49e299[_0xfdf1('0x30')][_0xfdf1('0x41')]){_0x583e00[_0xfdf1('0x42')]=[{'all':!![]}];}return db[_0xfdf1('0x40')]['findAll'](_0x583e00);})[_0xfdf1('0x25')](function(_0x3d3bba){_0x54c5b2['rows']=_0x3d3bba;return _0x54c5b2;})['then'](respondWithFilteredResult(_0x2b7866,_0x583e00))['catch'](handleError(_0x2b7866,null));};exports[_0xfdf1('0x43')]=function(_0x54ca07,_0x395090){var _0x3939b8={'raw':![],'where':{'id':_0x54ca07[_0xfdf1('0x44')]['id']}},_0xb7939a={};_0xb7939a['model']=_[_0xfdf1('0x31')](db[_0xfdf1('0x40')][_0xfdf1('0x2c')]);_0xb7939a[_0xfdf1('0x30')]=_['keys'](_0x54ca07[_0xfdf1('0x30')]);_0xb7939a['filters']=_[_0xfdf1('0x33')](_0xb7939a[_0xfdf1('0x2f')],_0xb7939a[_0xfdf1('0x30')]);_0x3939b8['attributes']=_[_0xfdf1('0x33')](_0xb7939a[_0xfdf1('0x2f')],qs[_0xfdf1('0x35')](_0x54ca07[_0xfdf1('0x30')][_0xfdf1('0x35')]));_0x3939b8[_0xfdf1('0x34')]=_0x3939b8[_0xfdf1('0x34')]['length']?_0x3939b8[_0xfdf1('0x34')]:_0xb7939a[_0xfdf1('0x2f')];if(_0x54ca07[_0xfdf1('0x30')][_0xfdf1('0x41')]){_0x3939b8[_0xfdf1('0x42')]=[{'all':!![]}];}_0x3939b8=_['merge']({},_0x3939b8,_0x54ca07[_0xfdf1('0x3f')]);return db[_0xfdf1('0x40')][_0xfdf1('0x45')](_0x3939b8)[_0xfdf1('0x25')](handleEntityNotFound(_0x395090,null))['then'](respondWithResult(_0x395090,null))[_0xfdf1('0x46')](handleError(_0x395090,null));};exports[_0xfdf1('0x47')]=function(_0x5bbd4b,_0x14b193){return db[_0xfdf1('0x40')]['create'](_0x5bbd4b[_0xfdf1('0x48')],{})[_0xfdf1('0x25')](respondWithResult(_0x14b193,0xc9))['catch'](handleError(_0x14b193,null));};exports[_0xfdf1('0x24')]=function(_0x212c1e,_0x46599c){if(_0x212c1e[_0xfdf1('0x48')]['id']){delete _0x212c1e[_0xfdf1('0x48')]['id'];}return db[_0xfdf1('0x40')][_0xfdf1('0x45')]({'where':{'id':_0x212c1e[_0xfdf1('0x44')]['id']}})[_0xfdf1('0x25')](handleEntityNotFound(_0x46599c,null))[_0xfdf1('0x25')](saveUpdates(_0x212c1e[_0xfdf1('0x48')],null))['then'](respondWithResult(_0x46599c,null))[_0xfdf1('0x46')](handleError(_0x46599c,null));};exports[_0xfdf1('0x49')]=function(_0x3a9c08,_0x1d8643){return db[_0xfdf1('0x40')][_0xfdf1('0x45')]({'where':{'id':_0x3a9c08[_0xfdf1('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d8643,null))['then'](removeEntity(_0x1d8643,null))[_0xfdf1('0x46')](handleError(_0x1d8643,null));};exports[_0xfdf1('0x4a')]=function(_0x594e65,_0x5d1b8b,_0x43ed2c){var _0x5ef39a={};var _0x301a39={};var _0x2300fb;var _0xbd99b5;return db['VtigerConfiguration'][_0xfdf1('0x4b')]({'where':{'id':_0x594e65[_0xfdf1('0x44')]['id']}})[_0xfdf1('0x25')](handleEntityNotFound(_0x5d1b8b,null))[_0xfdf1('0x25')](function(_0x38ff3c){if(_0x38ff3c){_0x2300fb=_0x38ff3c;_0x301a39['model']=_[_0xfdf1('0x31')](db['VtigerField'][_0xfdf1('0x2c')]);_0x301a39[_0xfdf1('0x30')]=_[_0xfdf1('0x31')](_0x594e65[_0xfdf1('0x30')]);_0x301a39[_0xfdf1('0x32')]=_[_0xfdf1('0x33')](_0x301a39[_0xfdf1('0x2f')],_0x301a39['query']);_0x5ef39a[_0xfdf1('0x34')]=_[_0xfdf1('0x33')](_0x301a39[_0xfdf1('0x2f')],qs[_0xfdf1('0x35')](_0x594e65[_0xfdf1('0x30')]['fields']));_0x5ef39a[_0xfdf1('0x34')]=_0x5ef39a[_0xfdf1('0x34')][_0xfdf1('0x36')]?_0x5ef39a['attributes']:_0x301a39[_0xfdf1('0x2f')];_0x5ef39a[_0xfdf1('0x38')]=qs[_0xfdf1('0x39')](_0x594e65['query'][_0xfdf1('0x39')]);_0x5ef39a[_0xfdf1('0x3a')]=qs['filters'](_[_0xfdf1('0x3b')](_0x594e65[_0xfdf1('0x30')],_0x301a39[_0xfdf1('0x32')]));if(_0x594e65['query'][_0xfdf1('0x3c')]){_0x5ef39a[_0xfdf1('0x3a')]=_[_0xfdf1('0x3d')](_0x5ef39a['where'],{'$or':_[_0xfdf1('0x2b')](_0x5ef39a['attributes'],function(_0x32ce8b){var _0x14b57c={};_0x14b57c[_0x32ce8b]={'$like':'%'+_0x594e65['query'][_0xfdf1('0x3c')]+'%'};return _0x14b57c;})});}_0x5ef39a=_[_0xfdf1('0x3d')]({},_0x5ef39a,_0x594e65[_0xfdf1('0x3f')]);return _0x2300fb['getFields'](_0x5ef39a);}})[_0xfdf1('0x25')](function(_0x64740a){if(_0x64740a){_0xbd99b5=_0x64740a['length'];if(!_0x594e65[_0xfdf1('0x30')][_0xfdf1('0x4c')](_0xfdf1('0x37'))){_0x5ef39a[_0xfdf1('0x1e')]=qs[_0xfdf1('0x1e')](_0x594e65[_0xfdf1('0x30')][_0xfdf1('0x1e')]);_0x5ef39a[_0xfdf1('0x1d')]=qs['offset'](_0x594e65[_0xfdf1('0x30')][_0xfdf1('0x1d')]);}return _0x2300fb[_0xfdf1('0x4a')](_0x5ef39a);}})['then'](function(_0xe8e4ab){if(_0xe8e4ab){return _0xe8e4ab?{'count':_0xbd99b5,'rows':_0xe8e4ab}:null;}})[_0xfdf1('0x25')](respondWithResult(_0x5d1b8b,null))[_0xfdf1('0x46')](handleError(_0x5d1b8b,null));};exports['getSubjects']=function(_0x581937,_0x24b7bb,_0xe7fba3){var _0x27484e={};var _0x546b14={};var _0x2fd796;var _0x394461;return db[_0xfdf1('0x40')][_0xfdf1('0x4b')]({'where':{'id':_0x581937[_0xfdf1('0x44')]['id']}})[_0xfdf1('0x25')](handleEntityNotFound(_0x24b7bb,null))[_0xfdf1('0x25')](function(_0x1b5fb4){if(_0x1b5fb4){_0x2fd796=_0x1b5fb4;_0x546b14[_0xfdf1('0x2f')]=_['keys'](db[_0xfdf1('0x4d')]['rawAttributes']);_0x546b14[_0xfdf1('0x30')]=_[_0xfdf1('0x31')](_0x581937['query']);_0x546b14[_0xfdf1('0x32')]=_[_0xfdf1('0x33')](_0x546b14['model'],_0x546b14['query']);_0x27484e[_0xfdf1('0x34')]=_[_0xfdf1('0x33')](_0x546b14['model'],qs[_0xfdf1('0x35')](_0x581937[_0xfdf1('0x30')]['fields']));_0x27484e[_0xfdf1('0x34')]=_0x27484e[_0xfdf1('0x34')][_0xfdf1('0x36')]?_0x27484e[_0xfdf1('0x34')]:_0x546b14[_0xfdf1('0x2f')];_0x27484e['order']=qs['sort'](_0x581937[_0xfdf1('0x30')][_0xfdf1('0x39')]);_0x27484e['where']=qs[_0xfdf1('0x32')](_[_0xfdf1('0x3b')](_0x581937[_0xfdf1('0x30')],_0x546b14[_0xfdf1('0x32')]));if(_0x581937[_0xfdf1('0x30')][_0xfdf1('0x3c')]){_0x27484e['where']=_[_0xfdf1('0x3d')](_0x27484e[_0xfdf1('0x3a')],{'$or':_[_0xfdf1('0x2b')](_0x27484e['attributes'],function(_0x4833bd){var _0x1de430={};_0x1de430[_0x4833bd]={'$like':'%'+_0x581937[_0xfdf1('0x30')][_0xfdf1('0x3c')]+'%'};return _0x1de430;})});}_0x27484e=_['merge']({},_0x27484e,_0x581937[_0xfdf1('0x3f')]);return _0x2fd796[_0xfdf1('0x4e')](_0x27484e);}})[_0xfdf1('0x25')](function(_0x1a0234){if(_0x1a0234){_0x394461=_0x1a0234[_0xfdf1('0x36')];if(!_0x581937['query'][_0xfdf1('0x4c')]('nolimit')){_0x27484e['limit']=qs[_0xfdf1('0x1e')](_0x581937[_0xfdf1('0x30')]['limit']);_0x27484e[_0xfdf1('0x1d')]=qs[_0xfdf1('0x1d')](_0x581937[_0xfdf1('0x30')][_0xfdf1('0x1d')]);}return _0x2fd796[_0xfdf1('0x4e')](_0x27484e);}})[_0xfdf1('0x25')](function(_0x5db082){if(_0x5db082){return _0x5db082?{'count':_0x394461,'rows':_0x5db082}:null;}})['then'](respondWithResult(_0x24b7bb,null))[_0xfdf1('0x46')](handleError(_0x24b7bb,null));};exports[_0xfdf1('0x4f')]=function(_0x244a15,_0x2477c4,_0x55b529){var _0x20840b={};var _0x25147b={};var _0x5af5de;var _0x323986;return db[_0xfdf1('0x40')]['findOne']({'where':{'id':_0x244a15[_0xfdf1('0x44')]['id']}})[_0xfdf1('0x25')](handleEntityNotFound(_0x2477c4,null))[_0xfdf1('0x25')](function(_0x45f58c){if(_0x45f58c){_0x5af5de=_0x45f58c;_0x25147b[_0xfdf1('0x2f')]=_[_0xfdf1('0x31')](db[_0xfdf1('0x4d')][_0xfdf1('0x2c')]);_0x25147b['query']=_[_0xfdf1('0x31')](_0x244a15[_0xfdf1('0x30')]);_0x25147b[_0xfdf1('0x32')]=_[_0xfdf1('0x33')](_0x25147b['model'],_0x25147b[_0xfdf1('0x30')]);_0x20840b['attributes']=_[_0xfdf1('0x33')](_0x25147b[_0xfdf1('0x2f')],qs['fields'](_0x244a15[_0xfdf1('0x30')][_0xfdf1('0x35')]));_0x20840b['attributes']=_0x20840b[_0xfdf1('0x34')][_0xfdf1('0x36')]?_0x20840b[_0xfdf1('0x34')]:_0x25147b['model'];_0x20840b['order']=qs[_0xfdf1('0x39')](_0x244a15[_0xfdf1('0x30')][_0xfdf1('0x39')]);_0x20840b['where']=qs[_0xfdf1('0x32')](_[_0xfdf1('0x3b')](_0x244a15[_0xfdf1('0x30')],_0x25147b[_0xfdf1('0x32')]));if(_0x244a15[_0xfdf1('0x30')]['filter']){_0x20840b['where']=_[_0xfdf1('0x3d')](_0x20840b['where'],{'$or':_[_0xfdf1('0x2b')](_0x20840b[_0xfdf1('0x34')],function(_0x544237){var _0x3e9961={};_0x3e9961[_0x544237]={'$like':'%'+_0x244a15['query'][_0xfdf1('0x3c')]+'%'};return _0x3e9961;})});}_0x20840b=_[_0xfdf1('0x3d')]({},_0x20840b,_0x244a15[_0xfdf1('0x3f')]);return _0x5af5de[_0xfdf1('0x4f')](_0x20840b);}})['then'](function(_0xfa545c){if(_0xfa545c){_0x323986=_0xfa545c[_0xfdf1('0x36')];if(!_0x244a15[_0xfdf1('0x30')]['hasOwnProperty'](_0xfdf1('0x37'))){_0x20840b[_0xfdf1('0x1e')]=qs[_0xfdf1('0x1e')](_0x244a15[_0xfdf1('0x30')]['limit']);_0x20840b['offset']=qs[_0xfdf1('0x1d')](_0x244a15[_0xfdf1('0x30')]['offset']);}return _0x5af5de[_0xfdf1('0x4f')](_0x20840b);}})[_0xfdf1('0x25')](function(_0x48d292){if(_0x48d292){return _0x48d292?{'count':_0x323986,'rows':_0x48d292}:null;}})[_0xfdf1('0x25')](respondWithResult(_0x2477c4,null))[_0xfdf1('0x46')](handleError(_0x2477c4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 97fd98b..7d46ba8 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 _0x47dc=['define','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x47dc,0x1c3));var _0xc47d=function(_0x6b0a18,_0x5b26e6){_0x6b0a18=_0x6b0a18-0x0;var _0x1d522c=_0x47dc[_0x6b0a18];return _0x1d522c;};'use strict';var _=require(_0xc47d('0x0'));var util=require(_0xc47d('0x1'));var logger=require('../../config/logger')(_0xc47d('0x2'));var moment=require(_0xc47d('0x3'));var BPromise=require(_0xc47d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc47d('0x5'));var rimraf=require(_0xc47d('0x6'));var config=require(_0xc47d('0x7'));var attributes=require(_0xc47d('0x8'));module['exports']=function(_0x9cf550,_0x5f549d){return _0x9cf550[_0xc47d('0x9')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x583d=['util','../../config/logger','api','moment','bluebird','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','lodash'];(function(_0x32cf6c,_0x9ac132){var _0x314cc9=function(_0x320b7b){while(--_0x320b7b){_0x32cf6c['push'](_0x32cf6c['shift']());}};_0x314cc9(++_0x9ac132);}(_0x583d,0xce));var _0xd583=function(_0x3275e3,_0x5207d2){_0x3275e3=_0x3275e3-0x0;var _0x1de687=_0x583d[_0x3275e3];return _0x1de687;};'use strict';var _=require(_0xd583('0x0'));var util=require(_0xd583('0x1'));var logger=require(_0xd583('0x2'))(_0xd583('0x3'));var moment=require(_0xd583('0x4'));var BPromise=require(_0xd583('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd583('0x6'));var attributes=require(_0xd583('0x7'));module['exports']=function(_0x454efa,_0x13649d){return _0x454efa['define'](_0xd583('0x8'),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 45997d1..d9ac9a3 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 _0xbf99=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x1a715f,_0x4ff35b){var _0x13ba76=function(_0x5da899){while(--_0x5da899){_0x1a715f['push'](_0x1a715f['shift']());}};_0x13ba76(++_0x4ff35b);}(_0xbf99,0x17e));var _0x9bf9=function(_0x934bca,_0x393251){_0x934bca=_0x934bca-0x0;var _0x2a1cb9=_0xbf99[_0x934bca];return _0x2a1cb9;};'use strict';var _=require(_0x9bf9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9bf9('0x1'));var rs=require(_0x9bf9('0x2'));var fs=require('fs');var Redis=require(_0x9bf9('0x3'));var db=require(_0x9bf9('0x4'))['db'];var utils=require(_0x9bf9('0x5'));var logger=require('../../config/logger')(_0x9bf9('0x6'));var config=require(_0x9bf9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9bf9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ccd95,_0x3fb00e,_0xa798a){return new BPromise(function(_0x881df1,_0x1a4085){return client[_0x9bf9('0x9')](_0x2ccd95,_0xa798a)['then'](function(_0x44b840){logger[_0x9bf9('0xa')](_0x9bf9('0xb'),_0x3fb00e,'request\x20sent');logger[_0x9bf9('0xc')](_0x9bf9('0xd'),_0x3fb00e,_0x9bf9('0xe'),JSON['stringify'](_0x44b840));if(_0x44b840[_0x9bf9('0xf')]){if(_0x44b840[_0x9bf9('0xf')][_0x9bf9('0x10')]===0x1f4){logger[_0x9bf9('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x3fb00e,_0x44b840[_0x9bf9('0xf')][_0x9bf9('0x11')]);return _0x1a4085(_0x44b840[_0x9bf9('0xf')][_0x9bf9('0x11')]);}logger['error'](_0x9bf9('0xb'),_0x3fb00e,_0x44b840['error']['message']);return _0x881df1(_0x44b840[_0x9bf9('0xf')][_0x9bf9('0x11')]);}else{logger[_0x9bf9('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x3fb00e,_0x9bf9('0xe'));_0x881df1(_0x44b840[_0x9bf9('0x12')][_0x9bf9('0x11')]);}})[_0x9bf9('0x13')](function(_0x15d104){logger[_0x9bf9('0xf')](_0x9bf9('0xb'),_0x3fb00e,_0x15d104);_0x1a4085(_0x15d104);});});} \ No newline at end of file +var _0x198e=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x23fc4b,_0x2371c5){var _0x19d0dc=function(_0x72f873){while(--_0x72f873){_0x23fc4b['push'](_0x23fc4b['shift']());}};_0x19d0dc(++_0x2371c5);}(_0x198e,0x109));var _0xe198=function(_0x595681,_0x571351){_0x595681=_0x595681-0x0;var _0x12dc7d=_0x198e[_0x595681];return _0x12dc7d;};'use strict';var _=require(_0xe198('0x0'));var util=require(_0xe198('0x1'));var moment=require(_0xe198('0x2'));var BPromise=require(_0xe198('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe198('0x4'));var db=require(_0xe198('0x5'))['db'];var utils=require(_0xe198('0x6'));var logger=require('../../config/logger')(_0xe198('0x7'));var config=require('../../config/environment');var jayson=require(_0xe198('0x8'));var client=jayson[_0xe198('0x9')][_0xe198('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa091,_0x36af42,_0x22bb74){return new BPromise(function(_0x104756,_0x3c7dea){return client['request'](_0x5aa091,_0x22bb74)[_0xe198('0xb')](function(_0x74265e){logger['info'](_0xe198('0xc'),_0x36af42,'request\x20sent');logger[_0xe198('0xd')](_0xe198('0xe'),_0x36af42,_0xe198('0xf'),JSON[_0xe198('0x10')](_0x74265e));if(_0x74265e[_0xe198('0x11')]){if(_0x74265e[_0xe198('0x11')][_0xe198('0x12')]===0x1f4){logger[_0xe198('0x11')](_0xe198('0xc'),_0x36af42,_0x74265e[_0xe198('0x11')][_0xe198('0x13')]);return _0x3c7dea(_0x74265e[_0xe198('0x11')][_0xe198('0x13')]);}logger[_0xe198('0x11')](_0xe198('0xc'),_0x36af42,_0x74265e[_0xe198('0x11')]['message']);return _0x104756(_0x74265e[_0xe198('0x11')][_0xe198('0x13')]);}else{logger[_0xe198('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x36af42,_0xe198('0xf'));_0x104756(_0x74265e[_0xe198('0x15')][_0xe198('0x13')]);}})['catch'](function(_0x31ae3e){logger['error'](_0xe198('0xc'),_0x36af42,_0x31ae3e);_0x3c7dea(_0x31ae3e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b382e92..5071fb2 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 _0xbd95=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1fb3a1,_0x49b98a){var _0x4c4d49=function(_0x531a01){while(--_0x531a01){_0x1fb3a1['push'](_0x1fb3a1['shift']());}};_0x4c4d49(++_0x49b98a);}(_0xbd95,0x160));var _0x5bd9=function(_0x1b296f,_0x43f2e1){_0x1b296f=_0x1b296f-0x0;var _0x47e874=_0xbd95[_0x1b296f];return _0x47e874;};'use strict';var multer=require(_0x5bd9('0x0'));var util=require(_0x5bd9('0x1'));var path=require(_0x5bd9('0x2'));var timeout=require('connect-timeout');var express=require(_0x5bd9('0x3'));var router=express['Router']();var fs_extra=require(_0x5bd9('0x4'));var auth=require(_0x5bd9('0x5'));var interaction=require(_0x5bd9('0x6'));var config=require(_0x5bd9('0x7'));var controller=require('./intVtigerField.controller');router[_0x5bd9('0x8')]('/',auth[_0x5bd9('0x9')](),controller[_0x5bd9('0xa')]);router['get'](_0x5bd9('0xb'),auth[_0x5bd9('0x9')](),controller[_0x5bd9('0xc')]);router[_0x5bd9('0xd')]('/',auth[_0x5bd9('0x9')](),controller['create']);router[_0x5bd9('0xe')]('/:id',auth[_0x5bd9('0x9')](),controller[_0x5bd9('0xf')]);router[_0x5bd9('0x10')](_0x5bd9('0xb'),auth[_0x5bd9('0x9')](),controller[_0x5bd9('0x11')]);module[_0x5bd9('0x12')]=router; \ No newline at end of file +var _0xeed2=['destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x110e2f,_0x5b5e51){var _0x20bbb9=function(_0x33c462){while(--_0x33c462){_0x110e2f['push'](_0x110e2f['shift']());}};_0x20bbb9(++_0x5b5e51);}(_0xeed2,0x1ef));var _0x2eed=function(_0x4e7749,_0x40c308){_0x4e7749=_0x4e7749-0x0;var _0x4f3bf7=_0xeed2[_0x4e7749];return _0x4f3bf7;};'use strict';var multer=require(_0x2eed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2eed('0x1'));var express=require('express');var router=express[_0x2eed('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2eed('0x3'));var interaction=require(_0x2eed('0x4'));var config=require('../../config/environment');var controller=require(_0x2eed('0x5'));router[_0x2eed('0x6')]('/',auth[_0x2eed('0x7')](),controller[_0x2eed('0x8')]);router[_0x2eed('0x6')](_0x2eed('0x9'),auth[_0x2eed('0x7')](),controller[_0x2eed('0xa')]);router[_0x2eed('0xb')]('/',auth['isAuthenticated'](),controller[_0x2eed('0xc')]);router['put'](_0x2eed('0x9'),auth[_0x2eed('0x7')](),controller[_0x2eed('0xd')]);router[_0x2eed('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2eed('0xf')]);module[_0x2eed('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e67257a..03c1a37 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 _0x8f02=['sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x2aada3,_0x3ef238){var _0x8d1401=function(_0xf05b1d){while(--_0xf05b1d){_0x2aada3['push'](_0x2aada3['shift']());}};_0x8d1401(++_0x3ef238);}(_0x8f02,0x196));var _0x28f0=function(_0x2c8f23,_0x29ca7a){_0x2c8f23=_0x2c8f23-0x0;var _0x33fe86=_0x8f02[_0x2c8f23];return _0x33fe86;};'use strict';var Sequelize=require(_0x28f0('0x0'));module['exports']={'type':{'type':Sequelize[_0x28f0('0x1')](_0x28f0('0x2'),_0x28f0('0x3'),_0x28f0('0x4'),'keyValue',_0x28f0('0x5')),'defaultValue':_0x28f0('0x2')},'content':{'type':Sequelize[_0x28f0('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x28f0('0x1')](_0x28f0('0x2'),_0x28f0('0x3'),_0x28f0('0x4'))},'keyContent':{'type':Sequelize[_0x28f0('0x6')]},'idField':{'type':Sequelize[_0x28f0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x28f0('0x6')]}}; \ No newline at end of file +var _0x0513=['variable','customVariable','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x571bbb,_0x499235){var _0x1688cf=function(_0x1dba3e){while(--_0x1dba3e){_0x571bbb['push'](_0x571bbb['shift']());}};_0x1688cf(++_0x499235);}(_0x0513,0x101));var _0x3051=function(_0xfdc783,_0x25e943){_0xfdc783=_0xfdc783-0x0;var _0x45699d=_0x0513[_0xfdc783];return _0x45699d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3051('0x0')](_0x3051('0x1'),_0x3051('0x2'),_0x3051('0x3'),'keyValue',_0x3051('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3051('0x5')]},'keyType':{'type':Sequelize[_0x3051('0x0')](_0x3051('0x1'),_0x3051('0x2'),_0x3051('0x3'))},'keyContent':{'type':Sequelize[_0x3051('0x5')]},'idField':{'type':Sequelize[_0x3051('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3051('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 67249d0..ce94de5 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 _0x94c4=['show','params','length','include','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','VtigerField','rawAttributes','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch'];(function(_0x3ae8c6,_0x4623ed){var _0x3ecbfa=function(_0x2ec526){while(--_0x2ec526){_0x3ae8c6['push'](_0x3ae8c6['shift']());}};_0x3ecbfa(++_0x4623ed);}(_0x94c4,0x1c3));var _0x494c=function(_0x37c9e,_0x5bb916){_0x37c9e=_0x37c9e-0x0;var _0x124e0b=_0x94c4[_0x37c9e];return _0x124e0b;};'use strict';var emlformat=require(_0x494c('0x0'));var rimraf=require(_0x494c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x494c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x494c('0x3'));var Mustache=require(_0x494c('0x4'));var util=require('util');var path=require(_0x494c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x494c('0x6'));var fs=require('fs');var fs_extra=require(_0x494c('0x7'));var _=require(_0x494c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x494c('0x9'));var toCsv=require(_0x494c('0xa'));var querystring=require(_0x494c('0xb'));var Papa=require(_0x494c('0xc'));var Redis=require(_0x494c('0xd'));var authService=require(_0x494c('0xe'));var qs=require(_0x494c('0xf'));var as=require(_0x494c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x494c('0x11'))(_0x494c('0x12'));var utils=require(_0x494c('0x13'));var config=require(_0x494c('0x14'));var licenseUtil=require(_0x494c('0x15'));var db=require(_0x494c('0x16'))['db'];function respondWithStatusCode(_0x342f8e,_0x44b7ab){_0x44b7ab=_0x44b7ab||0xcc;return function(_0x393ffd){if(_0x393ffd){return _0x342f8e['sendStatus'](_0x44b7ab);}return _0x342f8e[_0x494c('0x17')](_0x44b7ab)['end']();};}function respondWithResult(_0x1223d2,_0xa60ab1){_0xa60ab1=_0xa60ab1||0xc8;return function(_0x3db773){if(_0x3db773){return _0x1223d2[_0x494c('0x17')](_0xa60ab1)['json'](_0x3db773);}};}function respondWithFilteredResult(_0x2bc6fb,_0x5bea53){return function(_0x3125dd){if(_0x3125dd){var _0x43188d=typeof _0x5bea53[_0x494c('0x18')]===_0x494c('0x19')&&typeof _0x5bea53[_0x494c('0x1a')]===_0x494c('0x19');var _0x1d318e=_0x3125dd[_0x494c('0x1b')];var _0xda195e=_0x43188d?0x0:_0x5bea53['offset'];var _0x55a00c=_0x43188d?_0x3125dd['count']:_0x5bea53[_0x494c('0x18')]+_0x5bea53[_0x494c('0x1a')];var _0x40b3f1;if(_0x55a00c>=_0x1d318e){_0x55a00c=_0x1d318e;_0x40b3f1=0xc8;}else{_0x40b3f1=0xce;}_0x2bc6fb['status'](_0x40b3f1);return _0x2bc6fb[_0x494c('0x1c')](_0x494c('0x1d'),_0xda195e+'-'+_0x55a00c+'/'+_0x1d318e)[_0x494c('0x1e')](_0x3125dd);}return null;};}function patchUpdates(_0x20f95a){return function(_0xd36514){try{jsonpatch[_0x494c('0x1f')](_0xd36514,_0x20f95a,!![]);}catch(_0xb093ed){return BPromise[_0x494c('0x20')](_0xb093ed);}return _0xd36514[_0x494c('0x21')]();};}function saveUpdates(_0x17baac,_0x3c05d6){return function(_0x1a0d5e){if(_0x1a0d5e){return _0x1a0d5e[_0x494c('0x22')](_0x17baac)[_0x494c('0x23')](function(_0x1cd6df){return _0x1cd6df;});}return null;};}function removeEntity(_0x44c8e5,_0x441a2f){return function(_0x5d30a4){if(_0x5d30a4){return _0x5d30a4[_0x494c('0x24')]()[_0x494c('0x23')](function(){_0x44c8e5[_0x494c('0x17')](0xcc)[_0x494c('0x25')]();});}};}function handleEntityNotFound(_0x2548ef,_0x2231ac){return function(_0x24a829){if(!_0x24a829){_0x2548ef[_0x494c('0x26')](0x194);}return _0x24a829;};}function handleError(_0x44e962,_0x2d8625){_0x2d8625=_0x2d8625||0x1f4;return function(_0x1c56e0){logger['error'](_0x1c56e0[_0x494c('0x27')]);if(_0x1c56e0[_0x494c('0x28')]){delete _0x1c56e0['name'];}_0x44e962[_0x494c('0x17')](_0x2d8625)[_0x494c('0x29')](_0x1c56e0);};}exports[_0x494c('0x2a')]=function(_0x314a94,_0x2e040f){var _0x1d7960={},_0x2fba60={},_0x2b3248={'count':0x0,'rows':[]};var _0x536472=_[_0x494c('0x2b')](db[_0x494c('0x2c')][_0x494c('0x2d')],function(_0x146bb4){return{'name':_0x146bb4['fieldName'],'type':_0x146bb4['type'][_0x494c('0x2e')]};});_0x2fba60[_0x494c('0x2f')]=_[_0x494c('0x2b')](_0x536472,_0x494c('0x28'));_0x2fba60[_0x494c('0x30')]=_[_0x494c('0x31')](_0x314a94[_0x494c('0x30')]);_0x2fba60['filters']=_[_0x494c('0x32')](_0x2fba60['model'],_0x2fba60['query']);_0x1d7960[_0x494c('0x33')]=_[_0x494c('0x32')](_0x2fba60[_0x494c('0x2f')],qs['fields'](_0x314a94[_0x494c('0x30')][_0x494c('0x34')]));_0x1d7960['attributes']=_0x1d7960[_0x494c('0x33')]['length']?_0x1d7960[_0x494c('0x33')]:_0x2fba60[_0x494c('0x2f')];if(!_0x314a94[_0x494c('0x30')]['hasOwnProperty'](_0x494c('0x35'))){_0x1d7960['limit']=qs[_0x494c('0x1a')](_0x314a94[_0x494c('0x30')][_0x494c('0x1a')]);_0x1d7960[_0x494c('0x18')]=qs[_0x494c('0x18')](_0x314a94[_0x494c('0x30')][_0x494c('0x18')]);}_0x1d7960[_0x494c('0x36')]=qs[_0x494c('0x37')](_0x314a94[_0x494c('0x30')]['sort']);_0x1d7960[_0x494c('0x38')]=qs[_0x494c('0x39')](_[_0x494c('0x3a')](_0x314a94[_0x494c('0x30')],_0x2fba60[_0x494c('0x39')]),_0x536472);if(_0x314a94[_0x494c('0x30')][_0x494c('0x3b')]){_0x1d7960[_0x494c('0x38')]=_[_0x494c('0x3c')](_0x1d7960[_0x494c('0x38')],{'$or':_[_0x494c('0x2b')](_0x536472,function(_0x20141f){if(_0x20141f[_0x494c('0x3d')]!==_0x494c('0x3e')){var _0x552684={};_0x552684[_0x20141f['name']]={'$like':'%'+_0x314a94['query']['filter']+'%'};return _0x552684;}})});}_0x1d7960=_[_0x494c('0x3c')]({},_0x1d7960,_0x314a94[_0x494c('0x3f')]);var _0x50c3f0={'where':_0x1d7960['where']};return db[_0x494c('0x2c')]['count'](_0x50c3f0)[_0x494c('0x23')](function(_0x2e3ce8){_0x2b3248[_0x494c('0x1b')]=_0x2e3ce8;if(_0x314a94[_0x494c('0x30')]['includeAll']){_0x1d7960['include']=[{'all':!![]}];}return db[_0x494c('0x2c')][_0x494c('0x40')](_0x1d7960);})[_0x494c('0x23')](function(_0xde502b){_0x2b3248[_0x494c('0x41')]=_0xde502b;return _0x2b3248;})[_0x494c('0x23')](respondWithFilteredResult(_0x2e040f,_0x1d7960))[_0x494c('0x42')](handleError(_0x2e040f,null));};exports[_0x494c('0x43')]=function(_0x3697b5,_0x148870){var _0x3fd319={'raw':!![],'where':{'id':_0x3697b5[_0x494c('0x44')]['id']}},_0x54013c={};_0x54013c[_0x494c('0x2f')]=_[_0x494c('0x31')](db[_0x494c('0x2c')][_0x494c('0x2d')]);_0x54013c[_0x494c('0x30')]=_[_0x494c('0x31')](_0x3697b5[_0x494c('0x30')]);_0x54013c[_0x494c('0x39')]=_[_0x494c('0x32')](_0x54013c[_0x494c('0x2f')],_0x54013c[_0x494c('0x30')]);_0x3fd319[_0x494c('0x33')]=_[_0x494c('0x32')](_0x54013c[_0x494c('0x2f')],qs['fields'](_0x3697b5['query'][_0x494c('0x34')]));_0x3fd319[_0x494c('0x33')]=_0x3fd319['attributes'][_0x494c('0x45')]?_0x3fd319['attributes']:_0x54013c['model'];if(_0x3697b5[_0x494c('0x30')]['includeAll']){_0x3fd319[_0x494c('0x46')]=[{'all':!![]}];}_0x3fd319=_[_0x494c('0x3c')]({},_0x3fd319,_0x3697b5[_0x494c('0x3f')]);return db[_0x494c('0x2c')][_0x494c('0x47')](_0x3fd319)[_0x494c('0x23')](handleEntityNotFound(_0x148870,null))[_0x494c('0x23')](respondWithResult(_0x148870,null))[_0x494c('0x42')](handleError(_0x148870,null));};exports[_0x494c('0x48')]=function(_0x5270b1,_0x3ac98b){return db[_0x494c('0x2c')][_0x494c('0x48')](_0x5270b1[_0x494c('0x49')],{})['then'](respondWithResult(_0x3ac98b,0xc9))[_0x494c('0x42')](handleError(_0x3ac98b,null));};exports[_0x494c('0x22')]=function(_0x39f620,_0x3f052d){if(_0x39f620[_0x494c('0x49')]['id']){delete _0x39f620[_0x494c('0x49')]['id'];}return db['VtigerField'][_0x494c('0x47')]({'where':{'id':_0x39f620[_0x494c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f052d,null))[_0x494c('0x23')](saveUpdates(_0x39f620['body'],null))['then'](respondWithResult(_0x3f052d,null))['catch'](handleError(_0x3f052d,null));};exports[_0x494c('0x24')]=function(_0x1a8e3d,_0x40dc99){return db[_0x494c('0x2c')][_0x494c('0x47')]({'where':{'id':_0x1a8e3d['params']['id']}})['then'](handleEntityNotFound(_0x40dc99,null))['then'](removeEntity(_0x40dc99,null))['catch'](handleError(_0x40dc99,null));}; \ No newline at end of file +var _0xa269=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','status','end','json','offset','undefined','limit','count','apply','update','then','sendStatus','error','stack','name','send','map','VtigerField','rawAttributes','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','rows','catch','show','params','length','includeAll','include','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0xa269,0xc4));var _0x9a26=function(_0x24835e,_0xfa5d6a){_0x24835e=_0x24835e-0x0;var _0x4a18e4=_0xa269[_0x24835e];return _0x4a18e4;};'use strict';var emlformat=require(_0x9a26('0x0'));var rimraf=require(_0x9a26('0x1'));var zipdir=require(_0x9a26('0x2'));var jsonpatch=require(_0x9a26('0x3'));var rp=require(_0x9a26('0x4'));var moment=require(_0x9a26('0x5'));var BPromise=require(_0x9a26('0x6'));var Mustache=require('mustache');var util=require(_0x9a26('0x7'));var path=require(_0x9a26('0x8'));var sox=require(_0x9a26('0x9'));var csv=require(_0x9a26('0xa'));var ejs=require(_0x9a26('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a26('0xc'));var squel=require('squel');var crypto=require(_0x9a26('0xd'));var jsforce=require(_0x9a26('0xe'));var deskjs=require(_0x9a26('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9a26('0x10'));var Papa=require(_0x9a26('0x11'));var Redis=require(_0x9a26('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9a26('0x13'));var as=require(_0x9a26('0x14'));var hardwareService=require(_0x9a26('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9a26('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x397cd5,_0x432cf0){_0x432cf0=_0x432cf0||0xcc;return function(_0x5e9af3){if(_0x5e9af3){return _0x397cd5['sendStatus'](_0x432cf0);}return _0x397cd5[_0x9a26('0x17')](_0x432cf0)[_0x9a26('0x18')]();};}function respondWithResult(_0x23b128,_0x4b0aa2){_0x4b0aa2=_0x4b0aa2||0xc8;return function(_0x50b45a){if(_0x50b45a){return _0x23b128['status'](_0x4b0aa2)[_0x9a26('0x19')](_0x50b45a);}};}function respondWithFilteredResult(_0x543feb,_0xbeaa67){return function(_0x1fc90e){if(_0x1fc90e){var _0x478f33=typeof _0xbeaa67[_0x9a26('0x1a')]===_0x9a26('0x1b')&&typeof _0xbeaa67[_0x9a26('0x1c')]===_0x9a26('0x1b');var _0x389267=_0x1fc90e['count'];var _0x1df60b=_0x478f33?0x0:_0xbeaa67[_0x9a26('0x1a')];var _0x1da223=_0x478f33?_0x1fc90e[_0x9a26('0x1d')]:_0xbeaa67['offset']+_0xbeaa67[_0x9a26('0x1c')];var _0x25539a;if(_0x1da223>=_0x389267){_0x1da223=_0x389267;_0x25539a=0xc8;}else{_0x25539a=0xce;}_0x543feb[_0x9a26('0x17')](_0x25539a);return _0x543feb['set']('Content-Range',_0x1df60b+'-'+_0x1da223+'/'+_0x389267)[_0x9a26('0x19')](_0x1fc90e);}return null;};}function patchUpdates(_0x3f8d95){return function(_0x22406d){try{jsonpatch[_0x9a26('0x1e')](_0x22406d,_0x3f8d95,!![]);}catch(_0x5b1095){return BPromise['reject'](_0x5b1095);}return _0x22406d['save']();};}function saveUpdates(_0x38ac48,_0x1e9749){return function(_0x43736f){if(_0x43736f){return _0x43736f[_0x9a26('0x1f')](_0x38ac48)[_0x9a26('0x20')](function(_0x559de6){return _0x559de6;});}return null;};}function removeEntity(_0x57e761,_0xfe8346){return function(_0x1dfeb1){if(_0x1dfeb1){return _0x1dfeb1['destroy']()[_0x9a26('0x20')](function(){_0x57e761['status'](0xcc)[_0x9a26('0x18')]();});}};}function handleEntityNotFound(_0x30ca2b,_0x128510){return function(_0x5d1261){if(!_0x5d1261){_0x30ca2b[_0x9a26('0x21')](0x194);}return _0x5d1261;};}function handleError(_0x52b550,_0x38005f){_0x38005f=_0x38005f||0x1f4;return function(_0x5d78d6){logger[_0x9a26('0x22')](_0x5d78d6[_0x9a26('0x23')]);if(_0x5d78d6[_0x9a26('0x24')]){delete _0x5d78d6['name'];}_0x52b550[_0x9a26('0x17')](_0x38005f)[_0x9a26('0x25')](_0x5d78d6);};}exports['index']=function(_0x14d947,_0x9b7255){var _0x13e978={},_0x228881={},_0x1c6aa8={'count':0x0,'rows':[]};var _0x53b7a2=_[_0x9a26('0x26')](db[_0x9a26('0x27')][_0x9a26('0x28')],function(_0xf2b13b){return{'name':_0xf2b13b['fieldName'],'type':_0xf2b13b['type']['key']};});_0x228881['model']=_[_0x9a26('0x26')](_0x53b7a2,_0x9a26('0x24'));_0x228881[_0x9a26('0x29')]=_[_0x9a26('0x2a')](_0x14d947[_0x9a26('0x29')]);_0x228881[_0x9a26('0x2b')]=_[_0x9a26('0x2c')](_0x228881['model'],_0x228881[_0x9a26('0x29')]);_0x13e978[_0x9a26('0x2d')]=_[_0x9a26('0x2c')](_0x228881[_0x9a26('0x2e')],qs[_0x9a26('0x2f')](_0x14d947[_0x9a26('0x29')][_0x9a26('0x2f')]));_0x13e978[_0x9a26('0x2d')]=_0x13e978[_0x9a26('0x2d')]['length']?_0x13e978[_0x9a26('0x2d')]:_0x228881[_0x9a26('0x2e')];if(!_0x14d947['query'][_0x9a26('0x30')]('nolimit')){_0x13e978['limit']=qs[_0x9a26('0x1c')](_0x14d947['query'][_0x9a26('0x1c')]);_0x13e978['offset']=qs['offset'](_0x14d947['query'][_0x9a26('0x1a')]);}_0x13e978['order']=qs[_0x9a26('0x31')](_0x14d947[_0x9a26('0x29')]['sort']);_0x13e978[_0x9a26('0x32')]=qs[_0x9a26('0x2b')](_[_0x9a26('0x33')](_0x14d947[_0x9a26('0x29')],_0x228881[_0x9a26('0x2b')]),_0x53b7a2);if(_0x14d947[_0x9a26('0x29')][_0x9a26('0x34')]){_0x13e978[_0x9a26('0x32')]=_['merge'](_0x13e978[_0x9a26('0x32')],{'$or':_[_0x9a26('0x26')](_0x53b7a2,function(_0x5847cf){if(_0x5847cf[_0x9a26('0x35')]!==_0x9a26('0x36')){var _0x578cc6={};_0x578cc6[_0x5847cf[_0x9a26('0x24')]]={'$like':'%'+_0x14d947[_0x9a26('0x29')]['filter']+'%'};return _0x578cc6;}})});}_0x13e978=_[_0x9a26('0x37')]({},_0x13e978,_0x14d947['options']);var _0x2aec0e={'where':_0x13e978[_0x9a26('0x32')]};return db[_0x9a26('0x27')][_0x9a26('0x1d')](_0x2aec0e)[_0x9a26('0x20')](function(_0x3a7c88){_0x1c6aa8['count']=_0x3a7c88;if(_0x14d947[_0x9a26('0x29')]['includeAll']){_0x13e978['include']=[{'all':!![]}];}return db[_0x9a26('0x27')]['findAll'](_0x13e978);})['then'](function(_0x55002d){_0x1c6aa8[_0x9a26('0x38')]=_0x55002d;return _0x1c6aa8;})[_0x9a26('0x20')](respondWithFilteredResult(_0x9b7255,_0x13e978))[_0x9a26('0x39')](handleError(_0x9b7255,null));};exports[_0x9a26('0x3a')]=function(_0xfe0409,_0x4b5aaf){var _0x35d58b={'raw':!![],'where':{'id':_0xfe0409[_0x9a26('0x3b')]['id']}},_0x814c57={};_0x814c57[_0x9a26('0x2e')]=_[_0x9a26('0x2a')](db[_0x9a26('0x27')]['rawAttributes']);_0x814c57['query']=_[_0x9a26('0x2a')](_0xfe0409[_0x9a26('0x29')]);_0x814c57[_0x9a26('0x2b')]=_[_0x9a26('0x2c')](_0x814c57['model'],_0x814c57[_0x9a26('0x29')]);_0x35d58b[_0x9a26('0x2d')]=_[_0x9a26('0x2c')](_0x814c57[_0x9a26('0x2e')],qs[_0x9a26('0x2f')](_0xfe0409[_0x9a26('0x29')][_0x9a26('0x2f')]));_0x35d58b[_0x9a26('0x2d')]=_0x35d58b[_0x9a26('0x2d')][_0x9a26('0x3c')]?_0x35d58b[_0x9a26('0x2d')]:_0x814c57[_0x9a26('0x2e')];if(_0xfe0409[_0x9a26('0x29')][_0x9a26('0x3d')]){_0x35d58b[_0x9a26('0x3e')]=[{'all':!![]}];}_0x35d58b=_[_0x9a26('0x37')]({},_0x35d58b,_0xfe0409[_0x9a26('0x3f')]);return db[_0x9a26('0x27')]['find'](_0x35d58b)[_0x9a26('0x20')](handleEntityNotFound(_0x4b5aaf,null))[_0x9a26('0x20')](respondWithResult(_0x4b5aaf,null))[_0x9a26('0x39')](handleError(_0x4b5aaf,null));};exports[_0x9a26('0x40')]=function(_0x32a93a,_0x193a4b){return db['VtigerField']['create'](_0x32a93a[_0x9a26('0x41')],{})['then'](respondWithResult(_0x193a4b,0xc9))['catch'](handleError(_0x193a4b,null));};exports[_0x9a26('0x1f')]=function(_0x159a0f,_0x5a7b79){if(_0x159a0f[_0x9a26('0x41')]['id']){delete _0x159a0f[_0x9a26('0x41')]['id'];}return db[_0x9a26('0x27')][_0x9a26('0x42')]({'where':{'id':_0x159a0f[_0x9a26('0x3b')]['id']}})[_0x9a26('0x20')](handleEntityNotFound(_0x5a7b79,null))[_0x9a26('0x20')](saveUpdates(_0x159a0f[_0x9a26('0x41')],null))[_0x9a26('0x20')](respondWithResult(_0x5a7b79,null))[_0x9a26('0x39')](handleError(_0x5a7b79,null));};exports[_0x9a26('0x43')]=function(_0x3b7c3c,_0x5317bc){return db[_0x9a26('0x27')][_0x9a26('0x42')]({'where':{'id':_0x3b7c3c[_0x9a26('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5317bc,null))[_0x9a26('0x20')](removeEntity(_0x5317bc,null))['catch'](handleError(_0x5317bc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a839642..61269db 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 _0x16d7=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x16d7,0xf4));var _0x716d=function(_0x33bcc2,_0x4ab0dd){_0x33bcc2=_0x33bcc2-0x0;var _0x590b4e=_0x16d7[_0x33bcc2];return _0x590b4e;};'use strict';var _=require(_0x716d('0x0'));var util=require(_0x716d('0x1'));var logger=require(_0x716d('0x2'))('api');var moment=require(_0x716d('0x3'));var BPromise=require(_0x716d('0x4'));var rp=require(_0x716d('0x5'));var fs=require('fs');var path=require(_0x716d('0x6'));var rimraf=require(_0x716d('0x7'));var config=require(_0x716d('0x8'));var attributes=require(_0x716d('0x9'));module[_0x716d('0xa')]=function(_0x25a582,_0x44da12){return _0x25a582[_0x716d('0xb')](_0x716d('0xc'),attributes,{'tableName':_0x716d('0xd'),'paranoid':![],'indexes':[{'name':_0x716d('0xe'),'fields':[_0x716d('0xf'),_0x716d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb98=['bluebird','rimraf','./intVtigerField.attributes','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','moment'];(function(_0x5ff416,_0x1907a9){var _0x385572=function(_0x3b63f6){while(--_0x3b63f6){_0x5ff416['push'](_0x5ff416['shift']());}};_0x385572(++_0x1907a9);}(_0xcb98,0xd9));var _0x8cb9=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xcb98[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0x8cb9('0x0'));var util=require(_0x8cb9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8cb9('0x2'));var BPromise=require(_0x8cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8cb9('0x4'));var config=require('../../config/environment');var attributes=require(_0x8cb9('0x5'));module['exports']=function(_0x42bf55,_0x13de49){return _0x42bf55['define'](_0x8cb9('0x6'),attributes,{'tableName':_0x8cb9('0x7'),'paranoid':![],'indexes':[{'name':_0x8cb9('0x8'),'fields':[_0x8cb9('0x9'),_0x8cb9('0xa')],'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 eda2307..71eef64 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 _0xa898=['jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5c8811,_0x4f77d5){var _0x2c0941=function(_0x30e2bc){while(--_0x30e2bc){_0x5c8811['push'](_0x5c8811['shift']());}};_0x2c0941(++_0x4f77d5);}(_0xa898,0x13a));var _0x8a89=function(_0x59d93b,_0x5cec35){_0x59d93b=_0x59d93b-0x0;var _0x380d01=_0xa898[_0x59d93b];return _0x380d01;};'use strict';var _=require(_0x8a89('0x0'));var util=require(_0x8a89('0x1'));var moment=require(_0x8a89('0x2'));var BPromise=require(_0x8a89('0x3'));var rs=require(_0x8a89('0x4'));var fs=require('fs');var Redis=require(_0x8a89('0x5'));var db=require(_0x8a89('0x6'))['db'];var utils=require(_0x8a89('0x7'));var logger=require(_0x8a89('0x8'))(_0x8a89('0x9'));var config=require(_0x8a89('0xa'));var jayson=require(_0x8a89('0xb'));var client=jayson['client'][_0x8a89('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ebddc,_0x2a108c,_0x27b272){return new BPromise(function(_0x20b9a2,_0x4cf5ea){return client[_0x8a89('0xd')](_0x5ebddc,_0x27b272)[_0x8a89('0xe')](function(_0x2dce66){logger['info'](_0x8a89('0xf'),_0x2a108c,_0x8a89('0x10'));logger[_0x8a89('0x11')](_0x8a89('0x12'),_0x2a108c,_0x8a89('0x10'),JSON[_0x8a89('0x13')](_0x2dce66));if(_0x2dce66['error']){if(_0x2dce66[_0x8a89('0x14')][_0x8a89('0x15')]===0x1f4){logger[_0x8a89('0x14')](_0x8a89('0xf'),_0x2a108c,_0x2dce66[_0x8a89('0x14')]['message']);return _0x4cf5ea(_0x2dce66[_0x8a89('0x14')][_0x8a89('0x16')]);}logger[_0x8a89('0x14')]('VtigerField,\x20%s,\x20%s',_0x2a108c,_0x2dce66[_0x8a89('0x14')][_0x8a89('0x16')]);return _0x20b9a2(_0x2dce66[_0x8a89('0x14')][_0x8a89('0x16')]);}else{logger[_0x8a89('0x17')](_0x8a89('0xf'),_0x2a108c,'request\x20sent');_0x20b9a2(_0x2dce66[_0x8a89('0x18')][_0x8a89('0x16')]);}})['catch'](function(_0x4d9945){logger[_0x8a89('0x14')](_0x8a89('0xf'),_0x2a108c,_0x4d9945);_0x4cf5ea(_0x4d9945);});});} \ No newline at end of file +var _0xc8a6=['request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http'];(function(_0x2b7389,_0x58311b){var _0xe5d9da=function(_0xecec75){while(--_0xecec75){_0x2b7389['push'](_0x2b7389['shift']());}};_0xe5d9da(++_0x58311b);}(_0xc8a6,0xbf));var _0x6c8a=function(_0x5397ee,_0xdb6412){_0x5397ee=_0x5397ee-0x0;var _0x3191ee=_0xc8a6[_0x5397ee];return _0x3191ee;};'use strict';var _=require(_0x6c8a('0x0'));var util=require(_0x6c8a('0x1'));var moment=require(_0x6c8a('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c8a('0x4'))['db'];var utils=require(_0x6c8a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c8a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c8a('0x7')][_0x6c8a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12b90f,_0x18ef4e,_0x2897c2){return new BPromise(function(_0x23f960,_0x2874ec){return client[_0x6c8a('0x9')](_0x12b90f,_0x2897c2)[_0x6c8a('0xa')](function(_0xe83232){logger['info'](_0x6c8a('0xb'),_0x18ef4e,_0x6c8a('0xc'));logger[_0x6c8a('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x18ef4e,'request\x20sent',JSON[_0x6c8a('0xe')](_0xe83232));if(_0xe83232[_0x6c8a('0xf')]){if(_0xe83232[_0x6c8a('0xf')][_0x6c8a('0x10')]===0x1f4){logger['error'](_0x6c8a('0xb'),_0x18ef4e,_0xe83232[_0x6c8a('0xf')][_0x6c8a('0x11')]);return _0x2874ec(_0xe83232[_0x6c8a('0xf')][_0x6c8a('0x11')]);}logger[_0x6c8a('0xf')]('VtigerField,\x20%s,\x20%s',_0x18ef4e,_0xe83232[_0x6c8a('0xf')][_0x6c8a('0x11')]);return _0x23f960(_0xe83232[_0x6c8a('0xf')][_0x6c8a('0x11')]);}else{logger['info'](_0x6c8a('0xb'),_0x18ef4e,_0x6c8a('0xc'));_0x23f960(_0xe83232[_0x6c8a('0x12')][_0x6c8a('0x11')]);}})[_0x6c8a('0x13')](function(_0x5aad25){logger[_0x6c8a('0xf')](_0x6c8a('0xb'),_0x18ef4e,_0x5aad25);_0x2874ec(_0x5aad25);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 84339a1..63a4bc8 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 _0x1a3f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x1a3f,0x100));var _0xf1a3=function(_0x220149,_0x367a9d){_0x220149=_0x220149-0x0;var _0x4c4884=_0x1a3f[_0x220149];return _0x4c4884;};'use strict';var multer=require(_0xf1a3('0x0'));var util=require('util');var path=require(_0xf1a3('0x1'));var timeout=require(_0xf1a3('0x2'));var express=require(_0xf1a3('0x3'));var router=express[_0xf1a3('0x4')]();var fs_extra=require(_0xf1a3('0x5'));var auth=require(_0xf1a3('0x6'));var interaction=require(_0xf1a3('0x7'));var config=require(_0xf1a3('0x8'));var controller=require(_0xf1a3('0x9'));router['get']('/',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xb')]);router[_0xf1a3('0xc')]('/:id',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xd')]);router[_0xf1a3('0xc')]('/:id/configurations',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xe')]);router['get'](_0xf1a3('0xf'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x10')]);router[_0xf1a3('0x11')]('/',auth['isAuthenticated'](),controller[_0xf1a3('0x12')]);router[_0xf1a3('0x11')](_0xf1a3('0x13'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x14')]);router[_0xf1a3('0x15')](_0xf1a3('0x16'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x17')]);router[_0xf1a3('0x18')](_0xf1a3('0x16'),auth['isAuthenticated'](),controller[_0xf1a3('0x19')]);module['exports']=router; \ No newline at end of file +var _0x50e5=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','/:id','update','destroy','exports','multer'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x50e5,0xb7));var _0x550e=function(_0x4622b8,_0x3a4a46){_0x4622b8=_0x4622b8-0x0;var _0x81bcb2=_0x50e5[_0x4622b8];return _0x81bcb2;};'use strict';var multer=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var path=require('path');var timeout=require(_0x550e('0x2'));var express=require(_0x550e('0x3'));var router=express[_0x550e('0x4')]();var fs_extra=require(_0x550e('0x5'));var auth=require(_0x550e('0x6'));var interaction=require(_0x550e('0x7'));var config=require(_0x550e('0x8'));var controller=require(_0x550e('0x9'));router[_0x550e('0xa')]('/',auth[_0x550e('0xb')](),controller[_0x550e('0xc')]);router[_0x550e('0xa')]('/:id',auth[_0x550e('0xb')](),controller[_0x550e('0xd')]);router['get'](_0x550e('0xe'),auth[_0x550e('0xb')](),controller[_0x550e('0xf')]);router['get'](_0x550e('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x550e('0x11')]('/',auth[_0x550e('0xb')](),controller['create']);router[_0x550e('0x11')](_0x550e('0xe'),auth[_0x550e('0xb')](),controller[_0x550e('0x12')]);router['put'](_0x550e('0x13'),auth['isAuthenticated'](),controller[_0x550e('0x14')]);router['delete'](_0x550e('0x13'),auth[_0x550e('0xb')](),controller[_0x550e('0x15')]);module[_0x550e('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 8557d84..9010ee4 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 _0xa456=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa456,0x142));var _0x6a45=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xa456[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'password':{'type':Sequelize[_0x6a45('0x2')]},'token':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6a45('0x4')},'authType':{'type':Sequelize[_0x6a45('0x5')](_0x6a45('0x6'),_0x6a45('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6a45('0x5')](_0x6a45('0x8'),_0x6a45('0x9')),'defaultValue':_0x6a45('0x8')}}; \ No newline at end of file +var _0x16ce=['password','integrationTab','newTab','exports','STRING','username','ENUM','token'];(function(_0x287bb7,_0x5daf7b){var _0x1d100f=function(_0x451365){while(--_0x451365){_0x287bb7['push'](_0x287bb7['shift']());}};_0x1d100f(++_0x5daf7b);}(_0x16ce,0xfb));var _0xe16c=function(_0x4ff634,_0x366d98){_0x4ff634=_0x4ff634-0x0;var _0x244dc5=_0x16ce[_0x4ff634];return _0x244dc5;};'use strict';var Sequelize=require('sequelize');module[_0xe16c('0x0')]={'name':{'type':Sequelize[_0xe16c('0x1')]},'description':{'type':Sequelize[_0xe16c('0x1')]},'username':{'type':Sequelize[_0xe16c('0x1')],'unique':_0xe16c('0x2')},'password':{'type':Sequelize[_0xe16c('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xe16c('0x3')]('password',_0xe16c('0x4')),'defaultValue':_0xe16c('0x5')},'serverUrl':{'type':Sequelize[_0xe16c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe16c('0x3')](_0xe16c('0x6'),_0xe16c('0x7')),'defaultValue':_0xe16c('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 122fcf0..2a9aac3 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 _0x6b20=['../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','merge','create','body','find','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','getFields','username','password','authType','remoteUri','slice','format','Basic\x20%s','%s:%s','toString','base64','token','headers','Sequelize','ValidationError','Unknown\x20authentication\x20type','remove','includes','ticket_fields','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x154848,_0x5dae75){var _0x4f60ee=function(_0x312309){while(--_0x312309){_0x154848['push'](_0x154848['shift']());}};_0x4f60ee(++_0x5dae75);}(_0x6b20,0xd1));var _0x06b2=function(_0x3d877f,_0x545453){_0x3d877f=_0x3d877f-0x0;var _0x13e552=_0x6b20[_0x3d877f];return _0x13e552;};'use strict';var emlformat=require(_0x06b2('0x0'));var rimraf=require(_0x06b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b2('0x2'));var rp=require('request-promise');var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var Mustache=require(_0x06b2('0x5'));var util=require('util');var path=require(_0x06b2('0x6'));var sox=require(_0x06b2('0x7'));var csv=require(_0x06b2('0x8'));var ejs=require(_0x06b2('0x9'));var fs=require('fs');var fs_extra=require(_0x06b2('0xa'));var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x8'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var licenseUtil=require(_0x06b2('0x15'));var db=require(_0x06b2('0x16'))['db'];var integrations=require(_0x06b2('0x17'));function respondWithStatusCode(_0x810a12,_0x3039c9){_0x3039c9=_0x3039c9||0xcc;return function(_0x926bf6){if(_0x926bf6){return _0x810a12[_0x06b2('0x18')](_0x3039c9);}return _0x810a12[_0x06b2('0x19')](_0x3039c9)[_0x06b2('0x1a')]();};}function respondWithResult(_0x2822e9,_0x26faee){_0x26faee=_0x26faee||0xc8;return function(_0x544de8){if(_0x544de8){return _0x2822e9[_0x06b2('0x19')](_0x26faee)[_0x06b2('0x1b')](_0x544de8);}};}function respondWithFilteredResult(_0x47496c,_0x3830e9){return function(_0xef0466){if(_0xef0466){var _0x45d5c5=typeof _0x3830e9['offset']===_0x06b2('0x1c')&&typeof _0x3830e9[_0x06b2('0x1d')]==='undefined';var _0x1e16d1=_0xef0466['count'];var _0x4c9cae=_0x45d5c5?0x0:_0x3830e9[_0x06b2('0x1e')];var _0x1b4ab0=_0x45d5c5?_0xef0466[_0x06b2('0x1f')]:_0x3830e9[_0x06b2('0x1e')]+_0x3830e9['limit'];var _0x288801;if(_0x1b4ab0>=_0x1e16d1){_0x1b4ab0=_0x1e16d1;_0x288801=0xc8;}else{_0x288801=0xce;}_0x47496c[_0x06b2('0x19')](_0x288801);return _0x47496c[_0x06b2('0x20')](_0x06b2('0x21'),_0x4c9cae+'-'+_0x1b4ab0+'/'+_0x1e16d1)[_0x06b2('0x1b')](_0xef0466);}return null;};}function patchUpdates(_0x368ad8){return function(_0x268e7d){try{jsonpatch['apply'](_0x268e7d,_0x368ad8,!![]);}catch(_0x18c9a9){return BPromise[_0x06b2('0x22')](_0x18c9a9);}return _0x268e7d[_0x06b2('0x23')]();};}function saveUpdates(_0x208384,_0x4e2a4c){return function(_0x4fa84f){if(_0x4fa84f){return _0x4fa84f[_0x06b2('0x24')](_0x208384)[_0x06b2('0x25')](function(_0x4fc95f){return _0x4fc95f;});}return null;};}function removeEntity(_0x39659f,_0x5e40f2){return function(_0x3d58c6){if(_0x3d58c6){return _0x3d58c6[_0x06b2('0x26')]()[_0x06b2('0x25')](function(){_0x39659f['status'](0xcc)[_0x06b2('0x1a')]();});}};}function handleEntityNotFound(_0x306ce,_0xc65820){return function(_0x1a94dc){if(!_0x1a94dc){_0x306ce[_0x06b2('0x18')](0x194);}return _0x1a94dc;};}function handleError(_0x4f5e90,_0xbb00ea){_0xbb00ea=_0xbb00ea||0x1f4;return function(_0x34370b){logger[_0x06b2('0x27')](_0x34370b[_0x06b2('0x28')]);if(_0x34370b[_0x06b2('0x29')]){delete _0x34370b[_0x06b2('0x29')];}_0x4f5e90['status'](_0xbb00ea)[_0x06b2('0x2a')](_0x34370b);};}exports[_0x06b2('0x2b')]=function(_0x2720fa,_0x13c0eb){var _0x1f02d8={},_0x1bfaa9={},_0x3668bb={'count':0x0,'rows':[]};var _0x51698b=_[_0x06b2('0x2c')](db[_0x06b2('0x2d')][_0x06b2('0x2e')],function(_0x15a78b){return{'name':_0x15a78b[_0x06b2('0x2f')],'type':_0x15a78b[_0x06b2('0x30')][_0x06b2('0x31')]};});_0x1bfaa9[_0x06b2('0x32')]=_['map'](_0x51698b,_0x06b2('0x29'));_0x1bfaa9[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x2720fa[_0x06b2('0x33')]);_0x1bfaa9[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x1bfaa9[_0x06b2('0x32')],_0x1bfaa9['query']);_0x1f02d8['attributes']=_[_0x06b2('0x36')](_0x1bfaa9[_0x06b2('0x32')],qs[_0x06b2('0x37')](_0x2720fa['query'][_0x06b2('0x37')]));_0x1f02d8[_0x06b2('0x38')]=_0x1f02d8[_0x06b2('0x38')][_0x06b2('0x39')]?_0x1f02d8[_0x06b2('0x38')]:_0x1bfaa9[_0x06b2('0x32')];if(!_0x2720fa['query'][_0x06b2('0x3a')](_0x06b2('0x3b'))){_0x1f02d8[_0x06b2('0x1d')]=qs['limit'](_0x2720fa[_0x06b2('0x33')][_0x06b2('0x1d')]);_0x1f02d8['offset']=qs[_0x06b2('0x1e')](_0x2720fa[_0x06b2('0x33')][_0x06b2('0x1e')]);}_0x1f02d8[_0x06b2('0x3c')]=qs[_0x06b2('0x3d')](_0x2720fa[_0x06b2('0x33')][_0x06b2('0x3d')]);_0x1f02d8[_0x06b2('0x3e')]=qs[_0x06b2('0x35')](_[_0x06b2('0x3f')](_0x2720fa[_0x06b2('0x33')],_0x1bfaa9[_0x06b2('0x35')]),_0x51698b);if(_0x2720fa['query'][_0x06b2('0x40')]){_0x1f02d8['where']=_['merge'](_0x1f02d8[_0x06b2('0x3e')],{'$or':_['map'](_0x51698b,function(_0x26ab14){if(_0x26ab14['type']!==_0x06b2('0x41')){var _0x369673={};_0x369673[_0x26ab14[_0x06b2('0x29')]]={'$like':'%'+_0x2720fa[_0x06b2('0x33')][_0x06b2('0x40')]+'%'};return _0x369673;}})});}_0x1f02d8=_['merge']({},_0x1f02d8,_0x2720fa[_0x06b2('0x42')]);var _0xee3ec6={'where':_0x1f02d8[_0x06b2('0x3e')]};return db[_0x06b2('0x2d')][_0x06b2('0x1f')](_0xee3ec6)[_0x06b2('0x25')](function(_0x5f2549){_0x3668bb[_0x06b2('0x1f')]=_0x5f2549;if(_0x2720fa[_0x06b2('0x33')]['includeAll']){_0x1f02d8['include']=[{'all':!![]}];}return db[_0x06b2('0x2d')][_0x06b2('0x43')](_0x1f02d8);})[_0x06b2('0x25')](function(_0x3a8452){_0x3668bb[_0x06b2('0x44')]=_0x3a8452;return _0x3668bb;})[_0x06b2('0x25')](respondWithFilteredResult(_0x13c0eb,_0x1f02d8))[_0x06b2('0x45')](handleError(_0x13c0eb,null));};exports[_0x06b2('0x46')]=function(_0x2e2a80,_0x117bf4){var _0x1d7750={'raw':![],'where':{'id':_0x2e2a80[_0x06b2('0x47')]['id']}},_0xf9b9e={};_0xf9b9e[_0x06b2('0x32')]=_[_0x06b2('0x34')](db[_0x06b2('0x2d')][_0x06b2('0x2e')]);_0xf9b9e[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x2e2a80['query']);_0xf9b9e[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0xf9b9e[_0x06b2('0x32')],_0xf9b9e[_0x06b2('0x33')]);_0x1d7750['attributes']=_[_0x06b2('0x36')](_0xf9b9e[_0x06b2('0x32')],qs['fields'](_0x2e2a80[_0x06b2('0x33')][_0x06b2('0x37')]));_0x1d7750['attributes']=_0x1d7750[_0x06b2('0x38')][_0x06b2('0x39')]?_0x1d7750['attributes']:_0xf9b9e['model'];if(_0x2e2a80['query'][_0x06b2('0x48')]){_0x1d7750[_0x06b2('0x49')]=[{'all':!![]}];}_0x1d7750=_[_0x06b2('0x4a')]({},_0x1d7750,_0x2e2a80[_0x06b2('0x42')]);return db[_0x06b2('0x2d')]['find'](_0x1d7750)['then'](handleEntityNotFound(_0x117bf4,null))[_0x06b2('0x25')](respondWithResult(_0x117bf4,null))[_0x06b2('0x45')](handleError(_0x117bf4,null));};exports[_0x06b2('0x4b')]=function(_0x1f4d89,_0x33ac29){return db[_0x06b2('0x2d')]['create'](_0x1f4d89[_0x06b2('0x4c')],{})[_0x06b2('0x25')](respondWithResult(_0x33ac29,0xc9))[_0x06b2('0x45')](handleError(_0x33ac29,null));};exports[_0x06b2('0x24')]=function(_0x146c5c,_0x36a74a){if(_0x146c5c['body']['id']){delete _0x146c5c[_0x06b2('0x4c')]['id'];}return db[_0x06b2('0x2d')][_0x06b2('0x4d')]({'where':{'id':_0x146c5c[_0x06b2('0x47')]['id']}})['then'](handleEntityNotFound(_0x36a74a,null))[_0x06b2('0x25')](saveUpdates(_0x146c5c[_0x06b2('0x4c')],null))[_0x06b2('0x25')](respondWithResult(_0x36a74a,null))[_0x06b2('0x45')](handleError(_0x36a74a,null));};exports['destroy']=function(_0x346f04,_0x8cf9fe){return db[_0x06b2('0x2d')][_0x06b2('0x4d')]({'where':{'id':_0x346f04[_0x06b2('0x47')]['id']}})[_0x06b2('0x25')](handleEntityNotFound(_0x8cf9fe,null))[_0x06b2('0x25')](removeEntity(_0x8cf9fe,null))[_0x06b2('0x45')](handleError(_0x8cf9fe,null));};exports['getConfigurations']=function(_0x33bc8e,_0x8288ae,_0x318a3b){var _0x5c328c={};var _0x2857d5={};var _0x2f75a0;var _0x4fba4c;return db['ZendeskAccount'][_0x06b2('0x4e')]({'where':{'id':_0x33bc8e['params']['id']}})['then'](handleEntityNotFound(_0x8288ae,null))[_0x06b2('0x25')](function(_0x5899c1){if(_0x5899c1){_0x2f75a0=_0x5899c1;_0x2857d5[_0x06b2('0x32')]=_[_0x06b2('0x34')](db[_0x06b2('0x4f')][_0x06b2('0x2e')]);_0x2857d5[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x33bc8e[_0x06b2('0x33')]);_0x2857d5[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x2857d5[_0x06b2('0x32')],_0x2857d5['query']);_0x5c328c['attributes']=_[_0x06b2('0x36')](_0x2857d5[_0x06b2('0x32')],qs['fields'](_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x37')]));_0x5c328c[_0x06b2('0x38')]=_0x5c328c[_0x06b2('0x38')]['length']?_0x5c328c['attributes']:_0x2857d5['model'];_0x5c328c[_0x06b2('0x3c')]=qs['sort'](_0x33bc8e['query'][_0x06b2('0x3d')]);_0x5c328c[_0x06b2('0x3e')]=qs[_0x06b2('0x35')](_[_0x06b2('0x3f')](_0x33bc8e[_0x06b2('0x33')],_0x2857d5[_0x06b2('0x35')]));if(_0x33bc8e['query'][_0x06b2('0x40')]){_0x5c328c[_0x06b2('0x3e')]=_['merge'](_0x5c328c[_0x06b2('0x3e')],{'$or':_[_0x06b2('0x2c')](_0x5c328c[_0x06b2('0x38')],function(_0x2e0388){var _0x23ce27={};_0x23ce27[_0x2e0388]={'$like':'%'+_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x40')]+'%'};return _0x23ce27;})});}_0x5c328c=_[_0x06b2('0x4a')]({},_0x5c328c,_0x33bc8e[_0x06b2('0x42')]);return _0x2f75a0[_0x06b2('0x50')](_0x5c328c);}})[_0x06b2('0x25')](function(_0x397b16){if(_0x397b16){_0x4fba4c=_0x397b16['length'];if(!_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x3a')]('nolimit')){_0x5c328c[_0x06b2('0x1d')]=qs[_0x06b2('0x1d')](_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x1d')]);_0x5c328c['offset']=qs[_0x06b2('0x1e')](_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x1e')]);}return _0x2f75a0['getConfigurations'](_0x5c328c);}})[_0x06b2('0x25')](function(_0x1ad9f7){if(_0x1ad9f7){return _0x1ad9f7?{'count':_0x4fba4c,'rows':_0x1ad9f7}:null;}})[_0x06b2('0x25')](respondWithResult(_0x8288ae,null))[_0x06b2('0x45')](handleError(_0x8288ae,null));};exports[_0x06b2('0x51')]=function(_0x43b907,_0x1aae55,_0x10faea){if(_0x43b907[_0x06b2('0x4c')]['id']){delete _0x43b907['body']['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x43b907['params']['id']}})[_0x06b2('0x25')](handleEntityNotFound(_0x1aae55,null))['then'](function(_0x200a6e){if(_0x200a6e){_0x43b907[_0x06b2('0x4c')][_0x06b2('0x52')]=_0x200a6e['id'];_0x43b907[_0x06b2('0x4c')][_0x06b2('0x53')]=integrations[_0x06b2('0x54')](_0x43b907['body']['channel'],_0x43b907[_0x06b2('0x4c')][_0x06b2('0x30')]);_0x43b907['body'][_0x06b2('0x55')]=integrations[_0x06b2('0x56')](_0x43b907[_0x06b2('0x4c')][_0x06b2('0x57')],_0x43b907[_0x06b2('0x4c')][_0x06b2('0x30')]);return db['ZendeskConfiguration'][_0x06b2('0x4b')](_0x43b907['body'],{'include':[{'model':db[_0x06b2('0x58')],'as':_0x06b2('0x53')},{'model':db[_0x06b2('0x58')],'as':'Descriptions'}]});}return null;})[_0x06b2('0x25')](respondWithResult(_0x1aae55,null))[_0x06b2('0x45')](handleError(_0x1aae55,null));};exports[_0x06b2('0x59')]=function(_0x4cc763,_0xc1010,_0x4900d2){var _0x15b345='';return db[_0x06b2('0x2d')][_0x06b2('0x4e')]({'where':{'id':_0x4cc763[_0x06b2('0x47')]['id']},'attributes':['id',_0x06b2('0x5a'),_0x06b2('0x5b'),'token',_0x06b2('0x5c'),_0x06b2('0x5d')]})[_0x06b2('0x25')](handleEntityNotFound(_0xc1010,null))[_0x06b2('0x25')](function(_0x5f3db5){if(_0x5f3db5){_0x15b345=_0x5f3db5[_0x06b2('0x5d')];var _0x39464c=_0x15b345[_0x06b2('0x5e')](-0x1);if(_0x39464c==='/'){_0x15b345=_0x15b345['substring'](0x0,_0x15b345['lastIndexOf'](_0x39464c));}var _0x3ef003={'method':'GET','uri':util[_0x06b2('0x5f')]('%s/%s',_0x15b345,'ticket_fields'),'json':!![]};switch(_0x5f3db5[_0x06b2('0x5c')]){case _0x06b2('0x5b'):_0x3ef003['headers']={'Authorization':util[_0x06b2('0x5f')](_0x06b2('0x60'),new Buffer(util[_0x06b2('0x5f')](_0x06b2('0x61'),_0x5f3db5[_0x06b2('0x5a')],_0x5f3db5[_0x06b2('0x5b')]))[_0x06b2('0x62')](_0x06b2('0x63')))};break;case _0x06b2('0x64'):_0x3ef003[_0x06b2('0x65')]={'Authorization':util[_0x06b2('0x5f')]('Basic\x20%s',new Buffer(util[_0x06b2('0x5f')]('%s/token:%s',_0x5f3db5['username'],_0x5f3db5[_0x06b2('0x64')]))[_0x06b2('0x62')]('base64'))};break;default:throw new db[(_0x06b2('0x66'))][(_0x06b2('0x67'))](_0x06b2('0x68'));}return rp(_0x3ef003);}})['then'](function(_0x309337){if(_0x309337){var _0x3ff04f=['subject','description','group','assignee'];_[_0x06b2('0x69')](_0x309337['ticket_fields'],function(_0x1e4412){return _0x3ff04f[_0x06b2('0x6a')](_0x1e4412[_0x06b2('0x30')]);});return{'count':_0x309337[_0x06b2('0x6b')][_0x06b2('0x39')],'rows':_[_0x06b2('0x2c')](_0x309337[_0x06b2('0x6b')],function(_0x444725){return{'id':_0x444725['id'],'name':_0x444725[_0x06b2('0x6c')]>0x7?_0x444725[_0x06b2('0x6d')]:_0x444725[_0x06b2('0x30')],'custom':_0x444725[_0x06b2('0x6c')]>0x7?!![]:![],'options':_0x444725[_0x06b2('0x6e')]?_0x444725['system_field_options']:_0x444725['custom_field_options']?_0x444725[_0x06b2('0x6f')]:[]};})};}})[_0x06b2('0x25')](respondWithResult(_0xc1010,null))[_0x06b2('0x45')](function(_0x1328ec){var _0x364706=_0x4cc763[_0x06b2('0x33')]['test']?0x1f4:_0x1328ec['statusCode']||0x1f4;logger[_0x06b2('0x27')](_0x06b2('0x70'),_0x06b2('0x59'),_0x364706,JSON[_0x06b2('0x71')](_0x1328ec));delete _0x1328ec[_0x06b2('0x29')];if(_0x364706===0x191){_0x364706=0x190;}_0xc1010['status'](_0x364706)[_0x06b2('0x2a')](_0x4cc763['query']['test']?{'message':_0x06b2('0x72'),'statusCode':_0x1328ec[_0x06b2('0x73')]}:_0x1328ec);});}; \ No newline at end of file +var _0x7334=['params','keys','rawAttributes','includeAll','options','find','create','body','destroy','ZendeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','findOne','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','toString','base64','ValidationError','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','index','map','fieldName','model','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','ZendeskAccount','include','findAll','rows','catch','show'];(function(_0x25c9be,_0x16a4cb){var _0x272f7a=function(_0x4458bb){while(--_0x4458bb){_0x25c9be['push'](_0x25c9be['shift']());}};_0x272f7a(++_0x16a4cb);}(_0x7334,0x184));var _0x4733=function(_0x2549f5,_0xacf4de){_0x2549f5=_0x2549f5-0x0;var _0x17e591=_0x7334[_0x2549f5];return _0x17e591;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];var integrations=require(_0x4733('0x1a'));function respondWithStatusCode(_0x100ecd,_0x1c146c){_0x1c146c=_0x1c146c||0xcc;return function(_0x2c0f6b){if(_0x2c0f6b){return _0x100ecd['sendStatus'](_0x1c146c);}return _0x100ecd[_0x4733('0x1b')](_0x1c146c)['end']();};}function respondWithResult(_0x4327f3,_0x1a22e4){_0x1a22e4=_0x1a22e4||0xc8;return function(_0x2e5b1b){if(_0x2e5b1b){return _0x4327f3[_0x4733('0x1b')](_0x1a22e4)[_0x4733('0x1c')](_0x2e5b1b);}};}function respondWithFilteredResult(_0x167016,_0x12f111){return function(_0x9fff){if(_0x9fff){var _0x1920ce=typeof _0x12f111['offset']===_0x4733('0x1d')&&typeof _0x12f111[_0x4733('0x1e')]==='undefined';var _0x444824=_0x9fff[_0x4733('0x1f')];var _0x2aa223=_0x1920ce?0x0:_0x12f111[_0x4733('0x20')];var _0x579f67=_0x1920ce?_0x9fff['count']:_0x12f111[_0x4733('0x20')]+_0x12f111[_0x4733('0x1e')];var _0x50c585;if(_0x579f67>=_0x444824){_0x579f67=_0x444824;_0x50c585=0xc8;}else{_0x50c585=0xce;}_0x167016[_0x4733('0x1b')](_0x50c585);return _0x167016[_0x4733('0x21')](_0x4733('0x22'),_0x2aa223+'-'+_0x579f67+'/'+_0x444824)[_0x4733('0x1c')](_0x9fff);}return null;};}function patchUpdates(_0x493cd3){return function(_0x1232e5){try{jsonpatch[_0x4733('0x23')](_0x1232e5,_0x493cd3,!![]);}catch(_0x5d058d){return BPromise[_0x4733('0x24')](_0x5d058d);}return _0x1232e5[_0x4733('0x25')]();};}function saveUpdates(_0x478e34,_0x15a291){return function(_0x115ce4){if(_0x115ce4){return _0x115ce4[_0x4733('0x26')](_0x478e34)[_0x4733('0x27')](function(_0x3a2542){return _0x3a2542;});}return null;};}function removeEntity(_0x24db74,_0x180049){return function(_0x2bb78f){if(_0x2bb78f){return _0x2bb78f['destroy']()[_0x4733('0x27')](function(){_0x24db74[_0x4733('0x1b')](0xcc)[_0x4733('0x28')]();});}};}function handleEntityNotFound(_0x2cb247,_0x30ee9b){return function(_0x3bd683){if(!_0x3bd683){_0x2cb247[_0x4733('0x29')](0x194);}return _0x3bd683;};}function handleError(_0xc3ab0a,_0x13bc12){_0x13bc12=_0x13bc12||0x1f4;return function(_0x23fe6c){logger['error'](_0x23fe6c[_0x4733('0x2a')]);if(_0x23fe6c['name']){delete _0x23fe6c['name'];}_0xc3ab0a[_0x4733('0x1b')](_0x13bc12)['send'](_0x23fe6c);};}exports[_0x4733('0x2b')]=function(_0x479989,_0x4abc0d){var _0x517c73={},_0x2976b0={},_0x3bfe53={'count':0x0,'rows':[]};var _0x29621e=_[_0x4733('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x50f67e){return{'name':_0x50f67e[_0x4733('0x2d')],'type':_0x50f67e['type']['key']};});_0x2976b0[_0x4733('0x2e')]=_[_0x4733('0x2c')](_0x29621e,_0x4733('0x2f'));_0x2976b0['query']=_['keys'](_0x479989[_0x4733('0x30')]);_0x2976b0[_0x4733('0x31')]=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],_0x2976b0[_0x4733('0x30')]);_0x517c73['attributes']=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x479989[_0x4733('0x30')][_0x4733('0x33')]));_0x517c73['attributes']=_0x517c73['attributes'][_0x4733('0x34')]?_0x517c73[_0x4733('0x35')]:_0x2976b0[_0x4733('0x2e')];if(!_0x479989[_0x4733('0x30')][_0x4733('0x36')]('nolimit')){_0x517c73[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x479989[_0x4733('0x30')]['limit']);_0x517c73[_0x4733('0x20')]=qs[_0x4733('0x20')](_0x479989[_0x4733('0x30')][_0x4733('0x20')]);}_0x517c73[_0x4733('0x37')]=qs[_0x4733('0x38')](_0x479989[_0x4733('0x30')][_0x4733('0x38')]);_0x517c73['where']=qs[_0x4733('0x31')](_['pick'](_0x479989[_0x4733('0x30')],_0x2976b0[_0x4733('0x31')]),_0x29621e);if(_0x479989[_0x4733('0x30')][_0x4733('0x39')]){_0x517c73[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x517c73[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x29621e,function(_0x592fc2){if(_0x592fc2[_0x4733('0x3c')]!==_0x4733('0x3d')){var _0x5e12c3={};_0x5e12c3[_0x592fc2[_0x4733('0x2f')]]={'$like':'%'+_0x479989[_0x4733('0x30')]['filter']+'%'};return _0x5e12c3;}})});}_0x517c73=_[_0x4733('0x3b')]({},_0x517c73,_0x479989['options']);var _0x43ac2d={'where':_0x517c73['where']};return db[_0x4733('0x3e')][_0x4733('0x1f')](_0x43ac2d)['then'](function(_0x515720){_0x3bfe53[_0x4733('0x1f')]=_0x515720;if(_0x479989[_0x4733('0x30')]['includeAll']){_0x517c73[_0x4733('0x3f')]=[{'all':!![]}];}return db[_0x4733('0x3e')][_0x4733('0x40')](_0x517c73);})[_0x4733('0x27')](function(_0x3ae58c){_0x3bfe53[_0x4733('0x41')]=_0x3ae58c;return _0x3bfe53;})[_0x4733('0x27')](respondWithFilteredResult(_0x4abc0d,_0x517c73))[_0x4733('0x42')](handleError(_0x4abc0d,null));};exports[_0x4733('0x43')]=function(_0x42e055,_0x444471){var _0x1d32df={'raw':![],'where':{'id':_0x42e055[_0x4733('0x44')]['id']}},_0x191c04={};_0x191c04[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x3e')][_0x4733('0x46')]);_0x191c04['query']=_[_0x4733('0x45')](_0x42e055[_0x4733('0x30')]);_0x191c04[_0x4733('0x31')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],_0x191c04[_0x4733('0x30')]);_0x1d32df[_0x4733('0x35')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x42e055[_0x4733('0x30')][_0x4733('0x33')]));_0x1d32df[_0x4733('0x35')]=_0x1d32df[_0x4733('0x35')]['length']?_0x1d32df['attributes']:_0x191c04[_0x4733('0x2e')];if(_0x42e055[_0x4733('0x30')][_0x4733('0x47')]){_0x1d32df[_0x4733('0x3f')]=[{'all':!![]}];}_0x1d32df=_[_0x4733('0x3b')]({},_0x1d32df,_0x42e055[_0x4733('0x48')]);return db[_0x4733('0x3e')][_0x4733('0x49')](_0x1d32df)[_0x4733('0x27')](handleEntityNotFound(_0x444471,null))[_0x4733('0x27')](respondWithResult(_0x444471,null))['catch'](handleError(_0x444471,null));};exports['create']=function(_0x51e201,_0x521ad3){return db[_0x4733('0x3e')][_0x4733('0x4a')](_0x51e201[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x521ad3,0xc9))[_0x4733('0x42')](handleError(_0x521ad3,null));};exports[_0x4733('0x26')]=function(_0x1c6abf,_0x2484f4){if(_0x1c6abf[_0x4733('0x4b')]['id']){delete _0x1c6abf[_0x4733('0x4b')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x1c6abf[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0x2484f4,null))[_0x4733('0x27')](saveUpdates(_0x1c6abf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x2484f4,null))['catch'](handleError(_0x2484f4,null));};exports[_0x4733('0x4c')]=function(_0x45c9ad,_0x31ae69){return db[_0x4733('0x3e')][_0x4733('0x49')]({'where':{'id':_0x45c9ad[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x31ae69,null))[_0x4733('0x27')](removeEntity(_0x31ae69,null))[_0x4733('0x42')](handleError(_0x31ae69,null));};exports['getConfigurations']=function(_0x31fb69,_0xdb1561,_0x899344){var _0x491fa5={};var _0x2effd2={};var _0x130aee;var _0xafb3f8;return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x31fb69[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0xdb1561,null))[_0x4733('0x27')](function(_0x3b8165){if(_0x3b8165){_0x130aee=_0x3b8165;_0x2effd2[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x4d')]['rawAttributes']);_0x2effd2[_0x4733('0x30')]=_[_0x4733('0x45')](_0x31fb69['query']);_0x2effd2['filters']=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],_0x2effd2[_0x4733('0x30')]);_0x491fa5[_0x4733('0x35')]=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x31fb69[_0x4733('0x30')]['fields']));_0x491fa5['attributes']=_0x491fa5[_0x4733('0x35')]['length']?_0x491fa5[_0x4733('0x35')]:_0x2effd2[_0x4733('0x2e')];_0x491fa5[_0x4733('0x37')]=qs['sort'](_0x31fb69['query']['sort']);_0x491fa5[_0x4733('0x3a')]=qs[_0x4733('0x31')](_[_0x4733('0x4e')](_0x31fb69['query'],_0x2effd2[_0x4733('0x31')]));if(_0x31fb69[_0x4733('0x30')][_0x4733('0x39')]){_0x491fa5[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x491fa5[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x491fa5['attributes'],function(_0x1ed9eb){var _0x2b5eec={};_0x2b5eec[_0x1ed9eb]={'$like':'%'+_0x31fb69['query']['filter']+'%'};return _0x2b5eec;})});}_0x491fa5=_[_0x4733('0x3b')]({},_0x491fa5,_0x31fb69[_0x4733('0x48')]);return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x475dad){if(_0x475dad){_0xafb3f8=_0x475dad[_0x4733('0x34')];if(!_0x31fb69[_0x4733('0x30')][_0x4733('0x36')](_0x4733('0x50'))){_0x491fa5['limit']=qs[_0x4733('0x1e')](_0x31fb69[_0x4733('0x30')][_0x4733('0x1e')]);_0x491fa5['offset']=qs[_0x4733('0x20')](_0x31fb69['query'][_0x4733('0x20')]);}return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x3696d6){if(_0x3696d6){return _0x3696d6?{'count':_0xafb3f8,'rows':_0x3696d6}:null;}})[_0x4733('0x27')](respondWithResult(_0xdb1561,null))[_0x4733('0x42')](handleError(_0xdb1561,null));};exports['addConfiguration']=function(_0x137793,_0x574787,_0x15552d){if(_0x137793[_0x4733('0x4b')]['id']){delete _0x137793['body']['id'];}return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x137793['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x574787,null))[_0x4733('0x27')](function(_0x1a0ebf){if(_0x1a0ebf){_0x137793[_0x4733('0x4b')][_0x4733('0x51')]=_0x1a0ebf['id'];_0x137793[_0x4733('0x4b')][_0x4733('0x52')]=integrations[_0x4733('0x53')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793['body']['type']);_0x137793[_0x4733('0x4b')][_0x4733('0x54')]=integrations[_0x4733('0x55')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793[_0x4733('0x4b')][_0x4733('0x3c')]);return db[_0x4733('0x4d')]['create'](_0x137793[_0x4733('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x4733('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4733('0x27')](respondWithResult(_0x574787,null))['catch'](handleError(_0x574787,null));};exports[_0x4733('0x56')]=function(_0x523498,_0x4e835b,_0x1a7baf){var _0x5c6083='';return db['ZendeskAccount'][_0x4733('0x57')]({'where':{'id':_0x523498[_0x4733('0x44')]['id']},'attributes':['id',_0x4733('0x58'),'password',_0x4733('0x59'),_0x4733('0x5a'),_0x4733('0x5b')]})[_0x4733('0x27')](handleEntityNotFound(_0x4e835b,null))[_0x4733('0x27')](function(_0x29f4e8){if(_0x29f4e8){_0x5c6083=_0x29f4e8['remoteUri'];var _0x3c9e3b=_0x5c6083[_0x4733('0x5c')](-0x1);if(_0x3c9e3b==='/'){_0x5c6083=_0x5c6083[_0x4733('0x5d')](0x0,_0x5c6083['lastIndexOf'](_0x3c9e3b));}var _0x2c0377={'method':_0x4733('0x5e'),'uri':util[_0x4733('0x5f')](_0x4733('0x60'),_0x5c6083,_0x4733('0x61')),'json':!![]};switch(_0x29f4e8[_0x4733('0x5a')]){case _0x4733('0x62'):_0x2c0377[_0x4733('0x63')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x62')]))[_0x4733('0x64')](_0x4733('0x65')))};break;case _0x4733('0x59'):_0x2c0377['headers']={'Authorization':util[_0x4733('0x5f')]('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s/token:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x59')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x4733('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x2c0377);}})[_0x4733('0x27')](function(_0x2fe1d3){if(_0x2fe1d3){var _0x59cc5b=[_0x4733('0x67'),'description','group',_0x4733('0x68')];_[_0x4733('0x69')](_0x2fe1d3[_0x4733('0x61')],function(_0x5a067b){return _0x59cc5b['includes'](_0x5a067b[_0x4733('0x3c')]);});return{'count':_0x2fe1d3['ticket_fields'][_0x4733('0x34')],'rows':_[_0x4733('0x2c')](_0x2fe1d3[_0x4733('0x61')],function(_0x42657b){return{'id':_0x42657b['id'],'name':_0x42657b[_0x4733('0x6a')]>0x7?_0x42657b[_0x4733('0x6b')]:_0x42657b['type'],'custom':_0x42657b[_0x4733('0x6a')]>0x7?!![]:![],'options':_0x42657b[_0x4733('0x6c')]?_0x42657b[_0x4733('0x6c')]:_0x42657b[_0x4733('0x6d')]?_0x42657b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x4e835b,null))[_0x4733('0x42')](function(_0x4d87c1){var _0x131595=_0x523498[_0x4733('0x30')][_0x4733('0x6e')]?0x1f4:_0x4d87c1[_0x4733('0x6f')]||0x1f4;logger[_0x4733('0x70')](_0x4733('0x71'),_0x4733('0x56'),_0x131595,JSON['stringify'](_0x4d87c1));delete _0x4d87c1[_0x4733('0x2f')];if(_0x131595===0x191){_0x131595=0x190;}_0x4e835b[_0x4733('0x1b')](_0x131595)['send'](_0x523498['query'][_0x4733('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d87c1[_0x4733('0x6f')]}:_0x4d87c1);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index dbf1b9d..99d601e 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 _0xf401=['path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','api','request-promise'];(function(_0x290df5,_0x2cc0cb){var _0x27c215=function(_0x39645a){while(--_0x39645a){_0x290df5['push'](_0x290df5['shift']());}};_0x27c215(++_0x2cc0cb);}(_0xf401,0x16f));var _0x1f40=function(_0x414518,_0x8226e0){_0x414518=_0x414518-0x0;var _0x1127a5=_0xf401[_0x414518];return _0x1127a5;};'use strict';var _=require(_0x1f40('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f40('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f40('0x2'));var fs=require('fs');var path=require(_0x1f40('0x3'));var rimraf=require(_0x1f40('0x4'));var config=require('../../config/environment');var attributes=require(_0x1f40('0x5'));var integrations=require(_0x1f40('0x6'));module['exports']=function(_0x256e01,_0x26a428){return _0x256e01[_0x1f40('0x7')](_0x1f40('0x8'),attributes,{'tableName':_0x1f40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d12=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x6d12,0xbe));var _0x26d1=function(_0x4da4ea,_0x2875d3){_0x4da4ea=_0x4da4ea-0x0;var _0x3cc102=_0x6d12[_0x4da4ea];return _0x3cc102;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x26d1('0x0'))(_0x26d1('0x1'));var moment=require(_0x26d1('0x2'));var BPromise=require(_0x26d1('0x3'));var rp=require(_0x26d1('0x4'));var fs=require('fs');var path=require(_0x26d1('0x5'));var rimraf=require(_0x26d1('0x6'));var config=require(_0x26d1('0x7'));var attributes=require(_0x26d1('0x8'));var integrations=require(_0x26d1('0x9'));module[_0x26d1('0xa')]=function(_0x389cf9,_0xaace95){return _0x389cf9[_0x26d1('0xb')](_0x26d1('0xc'),attributes,{'tableName':_0x26d1('0xd'),'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 90d03bc..dd9248e 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 _0xa573=['ioredis','../../mysqldb','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','then','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0xa573,0x1c2));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a57('0x0'));var util=require(_0x3a57('0x1'));var moment=require(_0x3a57('0x2'));var BPromise=require(_0x3a57('0x3'));var rs=require(_0x3a57('0x4'));var fs=require('fs');var Redis=require(_0x3a57('0x5'));var db=require(_0x3a57('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3a57('0x7'));var client=jayson[_0x3a57('0x8')][_0x3a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e096f,_0x24ee20,_0x5f3cdf){return new BPromise(function(_0x23d816,_0x202c4f){return client[_0x3a57('0xa')](_0x5e096f,_0x5f3cdf)['then'](function(_0x51542c){logger[_0x3a57('0xb')](_0x3a57('0xc'),_0x24ee20,'request\x20sent');logger[_0x3a57('0xd')](_0x3a57('0xe'),_0x24ee20,_0x3a57('0xf'),JSON[_0x3a57('0x10')](_0x51542c));if(_0x51542c['error']){if(_0x51542c[_0x3a57('0x11')][_0x3a57('0x12')]===0x1f4){logger['error'](_0x3a57('0xc'),_0x24ee20,_0x51542c[_0x3a57('0x11')]['message']);return _0x202c4f(_0x51542c[_0x3a57('0x11')][_0x3a57('0x13')]);}logger[_0x3a57('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x24ee20,_0x51542c[_0x3a57('0x11')][_0x3a57('0x13')]);return _0x23d816(_0x51542c[_0x3a57('0x11')][_0x3a57('0x13')]);}else{logger[_0x3a57('0xb')](_0x3a57('0xc'),_0x24ee20,_0x3a57('0xf'));_0x23d816(_0x51542c[_0x3a57('0x14')][_0x3a57('0x13')]);}})[_0x3a57('0x15')](function(_0x4d6c76){logger[_0x3a57('0x11')](_0x3a57('0xc'),_0x24ee20,_0x4d6c76);_0x202c4f(_0x4d6c76);});});}exports[_0x3a57('0x16')]=function(_0x3dd7a5){var _0x43617f=this;return new Promise(function(_0xad707c,_0x521c98){return db[_0x3a57('0x17')][_0x3a57('0x18')]({'raw':_0x3dd7a5[_0x3a57('0x19')]?_0x3dd7a5[_0x3a57('0x19')][_0x3a57('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dd7a5[_0x3a57('0x19')]?_0x3dd7a5['options'][_0x3a57('0x1b')]||null:null,'attributes':_0x3dd7a5[_0x3a57('0x19')]?_0x3dd7a5['options']['attributes']||null:null,'limit':_0x3dd7a5['options']?_0x3dd7a5[_0x3a57('0x19')][_0x3a57('0x1c')]||null:null,'include':_0x3dd7a5[_0x3a57('0x19')]?_0x3dd7a5[_0x3a57('0x19')][_0x3a57('0x1d')]?_[_0x3a57('0x1e')](_0x3dd7a5[_0x3a57('0x19')][_0x3a57('0x1d')],function(_0x1e24b7){return{'model':db[_0x1e24b7['model']],'as':_0x1e24b7['as'],'attributes':_0x1e24b7[_0x3a57('0x1f')],'include':_0x1e24b7['include']?_['map'](_0x1e24b7[_0x3a57('0x1d')],function(_0x130944){return{'model':db[_0x130944[_0x3a57('0x20')]],'as':_0x130944['as'],'attributes':_0x130944[_0x3a57('0x1f')],'include':_0x130944[_0x3a57('0x1d')]?_[_0x3a57('0x1e')](_0x130944[_0x3a57('0x1d')],function(_0x19210e){return{'model':db[_0x19210e[_0x3a57('0x20')]],'as':_0x19210e['as'],'attributes':_0x19210e[_0x3a57('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3a57('0x21')](function(_0x52ff89){logger[_0x3a57('0xb')](_0x3a57('0x16'),_0x3dd7a5);logger[_0x3a57('0xd')](_0x3a57('0x16'),_0x3dd7a5,JSON[_0x3a57('0x10')](_0x52ff89));_0xad707c(_0x52ff89);})['catch'](function(_0x45611a){logger[_0x3a57('0x11')](_0x3a57('0x16'),_0x45611a['message'],_0x3dd7a5);_0x521c98(_0x43617f[_0x3a57('0x11')](0x1f4,_0x45611a[_0x3a57('0x13')]));});});};exports[_0x3a57('0x22')]=function(_0x3c5a88){var _0x4bf632=this;return new Promise(function(_0x502090,_0x284ba4){return db['ZendeskAccount']['find']({'raw':_0x3c5a88[_0x3a57('0x19')]?_0x3c5a88[_0x3a57('0x19')][_0x3a57('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c5a88[_0x3a57('0x19')]?_0x3c5a88[_0x3a57('0x19')]['where']||null:null,'attributes':_0x3c5a88[_0x3a57('0x19')]?_0x3c5a88[_0x3a57('0x19')][_0x3a57('0x1f')]||null:null,'include':_0x3c5a88[_0x3a57('0x19')]?_0x3c5a88[_0x3a57('0x19')][_0x3a57('0x1d')]?_[_0x3a57('0x1e')](_0x3c5a88['options'][_0x3a57('0x1d')],function(_0x6c713){return{'model':db[_0x6c713[_0x3a57('0x20')]],'as':_0x6c713['as'],'attributes':_0x6c713[_0x3a57('0x1f')],'include':_0x6c713['include']?_[_0x3a57('0x1e')](_0x6c713[_0x3a57('0x1d')],function(_0x4bf7f8){return{'model':db[_0x4bf7f8['model']],'as':_0x4bf7f8['as'],'attributes':_0x4bf7f8[_0x3a57('0x1f')],'include':_0x4bf7f8[_0x3a57('0x1d')]?_[_0x3a57('0x1e')](_0x4bf7f8[_0x3a57('0x1d')],function(_0xb408b9){return{'model':db[_0xb408b9[_0x3a57('0x20')]],'as':_0xb408b9['as'],'attributes':_0xb408b9[_0x3a57('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3a57('0x21')](function(_0x81fea6){logger[_0x3a57('0xb')](_0x3a57('0x22'),_0x3c5a88);logger[_0x3a57('0xd')]('ShowZendeskAccount',_0x3c5a88,JSON[_0x3a57('0x10')](_0x81fea6));_0x502090(_0x81fea6);})[_0x3a57('0x15')](function(_0x24e8f8){logger[_0x3a57('0x11')]('ShowZendeskAccount',_0x24e8f8[_0x3a57('0x13')],_0x3c5a88);_0x284ba4(_0x4bf632[_0x3a57('0x11')](0x1f4,_0x24e8f8[_0x3a57('0x13')]));});});}; \ No newline at end of file +var _0x61b3=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','map','include','model','find','ShowZendeskAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug'];(function(_0xf95def,_0xa45441){var _0x27ea9e=function(_0x49624d){while(--_0x49624d){_0xf95def['push'](_0xf95def['shift']());}};_0x27ea9e(++_0xa45441);}(_0x61b3,0x79));var _0x361b=function(_0x1d3e2a,_0x2254ce){_0x1d3e2a=_0x1d3e2a-0x0;var _0x1df717=_0x61b3[_0x1d3e2a];return _0x1df717;};'use strict';var _=require(_0x361b('0x0'));var util=require(_0x361b('0x1'));var moment=require(_0x361b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x361b('0x3'));var db=require(_0x361b('0x4'))['db'];var utils=require(_0x361b('0x5'));var logger=require('../../config/logger')(_0x361b('0x6'));var config=require('../../config/environment');var jayson=require(_0x361b('0x7'));var client=jayson[_0x361b('0x8')][_0x361b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2479a4,_0x192aeb,_0x426459){return new BPromise(function(_0x21a04e,_0x18180d){return client[_0x361b('0xa')](_0x2479a4,_0x426459)[_0x361b('0xb')](function(_0x4e67dd){logger[_0x361b('0xc')](_0x361b('0xd'),_0x192aeb,'request\x20sent');logger[_0x361b('0xe')](_0x361b('0xf'),_0x192aeb,'request\x20sent',JSON[_0x361b('0x10')](_0x4e67dd));if(_0x4e67dd['error']){if(_0x4e67dd['error'][_0x361b('0x11')]===0x1f4){logger[_0x361b('0x12')](_0x361b('0xd'),_0x192aeb,_0x4e67dd[_0x361b('0x12')][_0x361b('0x13')]);return _0x18180d(_0x4e67dd[_0x361b('0x12')][_0x361b('0x13')]);}logger[_0x361b('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x192aeb,_0x4e67dd['error'][_0x361b('0x13')]);return _0x21a04e(_0x4e67dd['error']['message']);}else{logger[_0x361b('0xc')](_0x361b('0xd'),_0x192aeb,_0x361b('0x14'));_0x21a04e(_0x4e67dd['result'][_0x361b('0x13')]);}})[_0x361b('0x15')](function(_0x2e7c0d){logger[_0x361b('0x12')](_0x361b('0xd'),_0x192aeb,_0x2e7c0d);_0x18180d(_0x2e7c0d);});});}exports[_0x361b('0x16')]=function(_0x385d81){var _0x2c959f=this;return new Promise(function(_0x266a06,_0x1965e0){return db[_0x361b('0x17')][_0x361b('0x18')]({'raw':_0x385d81[_0x361b('0x19')]?_0x385d81[_0x361b('0x19')][_0x361b('0x1a')]===undefined?!![]:![]:!![],'where':_0x385d81[_0x361b('0x19')]?_0x385d81[_0x361b('0x19')]['where']||null:null,'attributes':_0x385d81[_0x361b('0x19')]?_0x385d81['options'][_0x361b('0x1b')]||null:null,'limit':_0x385d81[_0x361b('0x19')]?_0x385d81[_0x361b('0x19')][_0x361b('0x1c')]||null:null,'include':_0x385d81[_0x361b('0x19')]?_0x385d81[_0x361b('0x19')]['include']?_[_0x361b('0x1d')](_0x385d81[_0x361b('0x19')]['include'],function(_0x4f138d){return{'model':db[_0x4f138d['model']],'as':_0x4f138d['as'],'attributes':_0x4f138d[_0x361b('0x1b')],'include':_0x4f138d[_0x361b('0x1e')]?_['map'](_0x4f138d[_0x361b('0x1e')],function(_0x58cee7){return{'model':db[_0x58cee7[_0x361b('0x1f')]],'as':_0x58cee7['as'],'attributes':_0x58cee7[_0x361b('0x1b')],'include':_0x58cee7[_0x361b('0x1e')]?_[_0x361b('0x1d')](_0x58cee7[_0x361b('0x1e')],function(_0x31954e){return{'model':db[_0x31954e[_0x361b('0x1f')]],'as':_0x31954e['as'],'attributes':_0x31954e['attributes']};}):[]};}):[]};}):[]:[]})[_0x361b('0xb')](function(_0xa1d2db){logger[_0x361b('0xc')](_0x361b('0x16'),_0x385d81);logger[_0x361b('0xe')](_0x361b('0x16'),_0x385d81,JSON[_0x361b('0x10')](_0xa1d2db));_0x266a06(_0xa1d2db);})[_0x361b('0x15')](function(_0x4239fa){logger['error']('GetZendeskAccount',_0x4239fa[_0x361b('0x13')],_0x385d81);_0x1965e0(_0x2c959f[_0x361b('0x12')](0x1f4,_0x4239fa[_0x361b('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x55c218){var _0x5b9f4c=this;return new Promise(function(_0x469c78,_0x498938){return db[_0x361b('0x17')][_0x361b('0x20')]({'raw':_0x55c218[_0x361b('0x19')]?_0x55c218[_0x361b('0x19')][_0x361b('0x1a')]===undefined?!![]:![]:!![],'where':_0x55c218[_0x361b('0x19')]?_0x55c218['options']['where']||null:null,'attributes':_0x55c218[_0x361b('0x19')]?_0x55c218['options'][_0x361b('0x1b')]||null:null,'include':_0x55c218[_0x361b('0x19')]?_0x55c218[_0x361b('0x19')][_0x361b('0x1e')]?_['map'](_0x55c218['options']['include'],function(_0x13e66e){return{'model':db[_0x13e66e[_0x361b('0x1f')]],'as':_0x13e66e['as'],'attributes':_0x13e66e[_0x361b('0x1b')],'include':_0x13e66e[_0x361b('0x1e')]?_[_0x361b('0x1d')](_0x13e66e['include'],function(_0x3b6160){return{'model':db[_0x3b6160[_0x361b('0x1f')]],'as':_0x3b6160['as'],'attributes':_0x3b6160[_0x361b('0x1b')],'include':_0x3b6160[_0x361b('0x1e')]?_[_0x361b('0x1d')](_0x3b6160[_0x361b('0x1e')],function(_0x28ad05){return{'model':db[_0x28ad05[_0x361b('0x1f')]],'as':_0x28ad05['as'],'attributes':_0x28ad05[_0x361b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x361b('0xb')](function(_0x8deaea){logger['info'](_0x361b('0x21'),_0x55c218);logger['debug'](_0x361b('0x21'),_0x55c218,JSON[_0x361b('0x10')](_0x8deaea));_0x469c78(_0x8deaea);})[_0x361b('0x15')](function(_0x1d26c3){logger[_0x361b('0x12')]('ShowZendeskAccount',_0x1d26c3['message'],_0x55c218);_0x498938(_0x5b9f4c['error'](0x1f4,_0x1d26c3[_0x361b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 61d1455..a34174d 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 _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x4b25ed,_0x3d9891){var _0x48d03b=function(_0x5d1b09){while(--_0x5d1b09){_0x4b25ed['push'](_0x4b25ed['shift']());}};_0x48d03b(++_0x3d9891);}(_0x153f,0x15b));var _0xf153=function(_0x2ea8d4,_0x25f2eb){_0x2ea8d4=_0x2ea8d4-0x0;var _0x4bb60a=_0x153f[_0x2ea8d4];return _0x4bb60a;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x32dae6,_0x11f2b0){var _0x39209f=function(_0x568aeb){while(--_0x568aeb){_0x32dae6['push'](_0x32dae6['shift']());}};_0x39209f(++_0x11f2b0);}(_0x087b,0x11a));var _0xb087=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x087b[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 64e3c53..ab4df1e 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 _0xdd25=['STRING','sequelize','exports'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xdd25,0xee));var _0x5dd2=function(_0x4d579,_0x166420){_0x4d579=_0x4d579-0x0;var _0xbe74a6=_0xdd25[_0x4d579];return _0xbe74a6;};'use strict';var Sequelize=require(_0x5dd2('0x0'));module[_0x5dd2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5dd2('0x2')]}}; \ No newline at end of file +var _0xea3b=['exports','STRING'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xea3b,0x90));var _0xbea3=function(_0x51821c,_0x2e39c5){_0x51821c=_0x51821c-0x0;var _0x20bde8=_0xea3b[_0x51821c];return _0x20bde8;};'use strict';var Sequelize=require('sequelize');module[_0xbea3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbea3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 0fe3e78..0b8db87 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 _0xf546=['options','getFields','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','destroy','stack','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','name','filter','then','include','findAll','rows','catch','params','includeAll','create','body','find','findOne','ZendeskField','sort','pick'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0xf546,0x146));var _0x6f54=function(_0x3994b9,_0x436e6e){_0x3994b9=_0x3994b9-0x0;var _0x449db5=_0xf546[_0x3994b9];return _0x449db5;};'use strict';var emlformat=require(_0x6f54('0x0'));var rimraf=require(_0x6f54('0x1'));var zipdir=require(_0x6f54('0x2'));var jsonpatch=require(_0x6f54('0x3'));var rp=require(_0x6f54('0x4'));var moment=require(_0x6f54('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f54('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6f54('0x7'));var ejs=require(_0x6f54('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f54('0x9'));var squel=require(_0x6f54('0xa'));var crypto=require(_0x6f54('0xb'));var jsforce=require(_0x6f54('0xc'));var deskjs=require(_0x6f54('0xd'));var toCsv=require(_0x6f54('0x7'));var querystring=require(_0x6f54('0xe'));var Papa=require(_0x6f54('0xf'));var Redis=require(_0x6f54('0x10'));var authService=require(_0x6f54('0x11'));var qs=require(_0x6f54('0x12'));var as=require(_0x6f54('0x13'));var hardwareService=require(_0x6f54('0x14'));var logger=require(_0x6f54('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6f54('0x16'));var licenseUtil=require(_0x6f54('0x17'));var db=require(_0x6f54('0x18'))['db'];function respondWithStatusCode(_0x4437e3,_0x37c70e){_0x37c70e=_0x37c70e||0xcc;return function(_0x4f9a5e){if(_0x4f9a5e){return _0x4437e3[_0x6f54('0x19')](_0x37c70e);}return _0x4437e3[_0x6f54('0x1a')](_0x37c70e)[_0x6f54('0x1b')]();};}function respondWithResult(_0x2a8ad,_0x5830dd){_0x5830dd=_0x5830dd||0xc8;return function(_0x3cc716){if(_0x3cc716){return _0x2a8ad[_0x6f54('0x1a')](_0x5830dd)[_0x6f54('0x1c')](_0x3cc716);}};}function respondWithFilteredResult(_0x4b281a,_0x27c65d){return function(_0x19e409){if(_0x19e409){var _0x3169a2=typeof _0x27c65d[_0x6f54('0x1d')]===_0x6f54('0x1e')&&typeof _0x27c65d['limit']===_0x6f54('0x1e');var _0x52e624=_0x19e409[_0x6f54('0x1f')];var _0x54af69=_0x3169a2?0x0:_0x27c65d[_0x6f54('0x1d')];var _0x5088b7=_0x3169a2?_0x19e409['count']:_0x27c65d['offset']+_0x27c65d[_0x6f54('0x20')];var _0x12c703;if(_0x5088b7>=_0x52e624){_0x5088b7=_0x52e624;_0x12c703=0xc8;}else{_0x12c703=0xce;}_0x4b281a[_0x6f54('0x1a')](_0x12c703);return _0x4b281a['set']('Content-Range',_0x54af69+'-'+_0x5088b7+'/'+_0x52e624)[_0x6f54('0x1c')](_0x19e409);}return null;};}function patchUpdates(_0x548a9c){return function(_0x915c62){try{jsonpatch[_0x6f54('0x21')](_0x915c62,_0x548a9c,!![]);}catch(_0x4a846a){return BPromise[_0x6f54('0x22')](_0x4a846a);}return _0x915c62['save']();};}function saveUpdates(_0xa1a7b8,_0x508d81){return function(_0x456f47){if(_0x456f47){return _0x456f47[_0x6f54('0x23')](_0xa1a7b8)['then'](function(_0x269e5a){return _0x269e5a;});}return null;};}function removeEntity(_0x3b0d23,_0x3c803a){return function(_0x29678d){if(_0x29678d){return _0x29678d[_0x6f54('0x24')]()['then'](function(){_0x3b0d23[_0x6f54('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d951,_0x7e51da){return function(_0x207bf0){if(!_0x207bf0){_0x26d951['sendStatus'](0x194);}return _0x207bf0;};}function handleError(_0x104af7,_0x43358f){_0x43358f=_0x43358f||0x1f4;return function(_0x5217c0){logger['error'](_0x5217c0[_0x6f54('0x25')]);if(_0x5217c0['name']){delete _0x5217c0['name'];}_0x104af7[_0x6f54('0x1a')](_0x43358f)['send'](_0x5217c0);};}exports['index']=function(_0x145e5a,_0x36edd3){var _0x45b3ed={},_0x1cca65={},_0x2e8547={'count':0x0,'rows':[]};var _0x390b01=_[_0x6f54('0x26')](db[_0x6f54('0x27')][_0x6f54('0x28')],function(_0x125bea){return{'name':_0x125bea[_0x6f54('0x29')],'type':_0x125bea[_0x6f54('0x2a')][_0x6f54('0x2b')]};});_0x1cca65[_0x6f54('0x2c')]=_['map'](_0x390b01,'name');_0x1cca65[_0x6f54('0x2d')]=_[_0x6f54('0x2e')](_0x145e5a[_0x6f54('0x2d')]);_0x1cca65[_0x6f54('0x2f')]=_[_0x6f54('0x30')](_0x1cca65[_0x6f54('0x2c')],_0x1cca65[_0x6f54('0x2d')]);_0x45b3ed[_0x6f54('0x31')]=_[_0x6f54('0x30')](_0x1cca65[_0x6f54('0x2c')],qs[_0x6f54('0x32')](_0x145e5a[_0x6f54('0x2d')][_0x6f54('0x32')]));_0x45b3ed[_0x6f54('0x31')]=_0x45b3ed[_0x6f54('0x31')][_0x6f54('0x33')]?_0x45b3ed[_0x6f54('0x31')]:_0x1cca65['model'];if(!_0x145e5a[_0x6f54('0x2d')][_0x6f54('0x34')](_0x6f54('0x35'))){_0x45b3ed['limit']=qs[_0x6f54('0x20')](_0x145e5a[_0x6f54('0x2d')][_0x6f54('0x20')]);_0x45b3ed['offset']=qs[_0x6f54('0x1d')](_0x145e5a[_0x6f54('0x2d')]['offset']);}_0x45b3ed[_0x6f54('0x36')]=qs['sort'](_0x145e5a[_0x6f54('0x2d')]['sort']);_0x45b3ed[_0x6f54('0x37')]=qs['filters'](_['pick'](_0x145e5a[_0x6f54('0x2d')],_0x1cca65[_0x6f54('0x2f')]),_0x390b01);if(_0x145e5a[_0x6f54('0x2d')]['filter']){_0x45b3ed[_0x6f54('0x37')]=_[_0x6f54('0x38')](_0x45b3ed[_0x6f54('0x37')],{'$or':_['map'](_0x390b01,function(_0x6d88e9){if(_0x6d88e9[_0x6f54('0x2a')]!==_0x6f54('0x39')){var _0x45d38c={};_0x45d38c[_0x6d88e9[_0x6f54('0x3a')]]={'$like':'%'+_0x145e5a[_0x6f54('0x2d')][_0x6f54('0x3b')]+'%'};return _0x45d38c;}})});}_0x45b3ed=_[_0x6f54('0x38')]({},_0x45b3ed,_0x145e5a['options']);var _0x55b965={'where':_0x45b3ed['where']};return db[_0x6f54('0x27')][_0x6f54('0x1f')](_0x55b965)[_0x6f54('0x3c')](function(_0xfe7b69){_0x2e8547['count']=_0xfe7b69;if(_0x145e5a[_0x6f54('0x2d')]['includeAll']){_0x45b3ed[_0x6f54('0x3d')]=[{'all':!![]}];}return db[_0x6f54('0x27')][_0x6f54('0x3e')](_0x45b3ed);})[_0x6f54('0x3c')](function(_0x56c1e5){_0x2e8547[_0x6f54('0x3f')]=_0x56c1e5;return _0x2e8547;})[_0x6f54('0x3c')](respondWithFilteredResult(_0x36edd3,_0x45b3ed))[_0x6f54('0x40')](handleError(_0x36edd3,null));};exports['show']=function(_0x4c13e8,_0xde2865){var _0x3f69ad={'raw':![],'where':{'id':_0x4c13e8[_0x6f54('0x41')]['id']}},_0x590b82={};_0x590b82[_0x6f54('0x2c')]=_[_0x6f54('0x2e')](db[_0x6f54('0x27')][_0x6f54('0x28')]);_0x590b82['query']=_[_0x6f54('0x2e')](_0x4c13e8[_0x6f54('0x2d')]);_0x590b82[_0x6f54('0x2f')]=_[_0x6f54('0x30')](_0x590b82['model'],_0x590b82[_0x6f54('0x2d')]);_0x3f69ad['attributes']=_[_0x6f54('0x30')](_0x590b82[_0x6f54('0x2c')],qs[_0x6f54('0x32')](_0x4c13e8[_0x6f54('0x2d')][_0x6f54('0x32')]));_0x3f69ad[_0x6f54('0x31')]=_0x3f69ad[_0x6f54('0x31')][_0x6f54('0x33')]?_0x3f69ad[_0x6f54('0x31')]:_0x590b82['model'];if(_0x4c13e8['query'][_0x6f54('0x42')]){_0x3f69ad[_0x6f54('0x3d')]=[{'all':!![]}];}_0x3f69ad=_[_0x6f54('0x38')]({},_0x3f69ad,_0x4c13e8['options']);return db[_0x6f54('0x27')]['find'](_0x3f69ad)[_0x6f54('0x3c')](handleEntityNotFound(_0xde2865,null))[_0x6f54('0x3c')](respondWithResult(_0xde2865,null))[_0x6f54('0x40')](handleError(_0xde2865,null));};exports[_0x6f54('0x43')]=function(_0x36cbe7,_0x4413b3){return db[_0x6f54('0x27')][_0x6f54('0x43')](_0x36cbe7['body'],{})[_0x6f54('0x3c')](respondWithResult(_0x4413b3,0xc9))[_0x6f54('0x40')](handleError(_0x4413b3,null));};exports[_0x6f54('0x23')]=function(_0x2681c5,_0x3d8fa6){if(_0x2681c5[_0x6f54('0x44')]['id']){delete _0x2681c5[_0x6f54('0x44')]['id'];}return db[_0x6f54('0x27')][_0x6f54('0x45')]({'where':{'id':_0x2681c5[_0x6f54('0x41')]['id']}})[_0x6f54('0x3c')](handleEntityNotFound(_0x3d8fa6,null))[_0x6f54('0x3c')](saveUpdates(_0x2681c5[_0x6f54('0x44')],null))[_0x6f54('0x3c')](respondWithResult(_0x3d8fa6,null))[_0x6f54('0x40')](handleError(_0x3d8fa6,null));};exports[_0x6f54('0x24')]=function(_0x5ee416,_0x13f0b2){return db[_0x6f54('0x27')][_0x6f54('0x45')]({'where':{'id':_0x5ee416[_0x6f54('0x41')]['id']}})['then'](handleEntityNotFound(_0x13f0b2,null))[_0x6f54('0x3c')](removeEntity(_0x13f0b2,null))[_0x6f54('0x40')](handleError(_0x13f0b2,null));};exports['getFields']=function(_0x5ab4db,_0xd40274,_0x633a16){var _0x47be07={};var _0x35f7b4={};var _0x3194e9;var _0x34970e;return db[_0x6f54('0x27')][_0x6f54('0x46')]({'where':{'id':_0x5ab4db[_0x6f54('0x41')]['id']}})[_0x6f54('0x3c')](handleEntityNotFound(_0xd40274,null))['then'](function(_0x512301){if(_0x512301){_0x3194e9=_0x512301;_0x35f7b4[_0x6f54('0x2c')]=_[_0x6f54('0x2e')](db[_0x6f54('0x47')]['rawAttributes']);_0x35f7b4[_0x6f54('0x2d')]=_[_0x6f54('0x2e')](_0x5ab4db['query']);_0x35f7b4[_0x6f54('0x2f')]=_['intersection'](_0x35f7b4[_0x6f54('0x2c')],_0x35f7b4[_0x6f54('0x2d')]);_0x47be07[_0x6f54('0x31')]=_[_0x6f54('0x30')](_0x35f7b4[_0x6f54('0x2c')],qs['fields'](_0x5ab4db[_0x6f54('0x2d')][_0x6f54('0x32')]));_0x47be07[_0x6f54('0x31')]=_0x47be07[_0x6f54('0x31')][_0x6f54('0x33')]?_0x47be07[_0x6f54('0x31')]:_0x35f7b4[_0x6f54('0x2c')];_0x47be07['order']=qs[_0x6f54('0x48')](_0x5ab4db[_0x6f54('0x2d')]['sort']);_0x47be07[_0x6f54('0x37')]=qs['filters'](_[_0x6f54('0x49')](_0x5ab4db[_0x6f54('0x2d')],_0x35f7b4['filters']));if(_0x5ab4db[_0x6f54('0x2d')][_0x6f54('0x3b')]){_0x47be07['where']=_[_0x6f54('0x38')](_0x47be07['where'],{'$or':_[_0x6f54('0x26')](_0x47be07[_0x6f54('0x31')],function(_0x64800c){var _0x27045d={};_0x27045d[_0x64800c]={'$like':'%'+_0x5ab4db['query'][_0x6f54('0x3b')]+'%'};return _0x27045d;})});}_0x47be07=_[_0x6f54('0x38')]({},_0x47be07,_0x5ab4db[_0x6f54('0x4a')]);return _0x3194e9[_0x6f54('0x4b')](_0x47be07);}})[_0x6f54('0x3c')](function(_0xf94fa2){if(_0xf94fa2){_0x34970e=_0xf94fa2[_0x6f54('0x33')];if(!_0x5ab4db[_0x6f54('0x2d')][_0x6f54('0x34')]('nolimit')){_0x47be07[_0x6f54('0x20')]=qs[_0x6f54('0x20')](_0x5ab4db[_0x6f54('0x2d')][_0x6f54('0x20')]);_0x47be07[_0x6f54('0x1d')]=qs[_0x6f54('0x1d')](_0x5ab4db[_0x6f54('0x2d')][_0x6f54('0x1d')]);}return _0x3194e9[_0x6f54('0x4b')](_0x47be07);}})[_0x6f54('0x3c')](function(_0x5f1c78){if(_0x5f1c78){return _0x5f1c78?{'count':_0x34970e,'rows':_0x5f1c78}:null;}})[_0x6f54('0x3c')](respondWithResult(_0xd40274,null))[_0x6f54('0x40')](handleError(_0xd40274,null));};exports[_0x6f54('0x4c')]=function(_0x5ba250,_0x4d5062,_0x4688af){var _0x290473={};var _0x2de0f9={};var _0x4b35fc;var _0x264fbd;return db[_0x6f54('0x27')]['findOne']({'where':{'id':_0x5ba250[_0x6f54('0x41')]['id']}})[_0x6f54('0x3c')](handleEntityNotFound(_0x4d5062,null))[_0x6f54('0x3c')](function(_0x3554d8){if(_0x3554d8){_0x4b35fc=_0x3554d8;_0x2de0f9[_0x6f54('0x2c')]=_[_0x6f54('0x2e')](db[_0x6f54('0x47')][_0x6f54('0x28')]);_0x2de0f9[_0x6f54('0x2d')]=_['keys'](_0x5ba250['query']);_0x2de0f9['filters']=_[_0x6f54('0x30')](_0x2de0f9[_0x6f54('0x2c')],_0x2de0f9['query']);_0x290473[_0x6f54('0x31')]=_[_0x6f54('0x30')](_0x2de0f9[_0x6f54('0x2c')],qs['fields'](_0x5ba250[_0x6f54('0x2d')][_0x6f54('0x32')]));_0x290473['attributes']=_0x290473[_0x6f54('0x31')][_0x6f54('0x33')]?_0x290473[_0x6f54('0x31')]:_0x2de0f9['model'];_0x290473[_0x6f54('0x36')]=qs['sort'](_0x5ba250[_0x6f54('0x2d')][_0x6f54('0x48')]);_0x290473[_0x6f54('0x37')]=qs[_0x6f54('0x2f')](_['pick'](_0x5ba250[_0x6f54('0x2d')],_0x2de0f9[_0x6f54('0x2f')]));if(_0x5ba250[_0x6f54('0x2d')][_0x6f54('0x3b')]){_0x290473[_0x6f54('0x37')]=_['merge'](_0x290473['where'],{'$or':_[_0x6f54('0x26')](_0x290473[_0x6f54('0x31')],function(_0x5a9981){var _0x1e39cd={};_0x1e39cd[_0x5a9981]={'$like':'%'+_0x5ba250[_0x6f54('0x2d')]['filter']+'%'};return _0x1e39cd;})});}_0x290473=_[_0x6f54('0x38')]({},_0x290473,_0x5ba250['options']);return _0x4b35fc[_0x6f54('0x4c')](_0x290473);}})[_0x6f54('0x3c')](function(_0x119d6f){if(_0x119d6f){_0x264fbd=_0x119d6f[_0x6f54('0x33')];if(!_0x5ba250['query']['hasOwnProperty'](_0x6f54('0x35'))){_0x290473[_0x6f54('0x20')]=qs['limit'](_0x5ba250[_0x6f54('0x2d')][_0x6f54('0x20')]);_0x290473['offset']=qs[_0x6f54('0x1d')](_0x5ba250[_0x6f54('0x2d')][_0x6f54('0x1d')]);}return _0x4b35fc[_0x6f54('0x4c')](_0x290473);}})[_0x6f54('0x3c')](function(_0x54fbc9){if(_0x54fbc9){return _0x54fbc9?{'count':_0x264fbd,'rows':_0x54fbc9}:null;}})['then'](respondWithResult(_0x4d5062,null))[_0x6f54('0x40')](handleError(_0x4d5062,null));};exports[_0x6f54('0x4d')]=function(_0x400976,_0x33e5ad,_0x5b3f74){var _0x4d3969={};var _0x2d5534={};var _0x208028;var _0xafaec0;return db[_0x6f54('0x27')][_0x6f54('0x46')]({'where':{'id':_0x400976['params']['id']}})['then'](handleEntityNotFound(_0x33e5ad,null))[_0x6f54('0x3c')](function(_0x5d718d){if(_0x5d718d){_0x208028=_0x5d718d;_0x2d5534['model']=_[_0x6f54('0x2e')](db[_0x6f54('0x47')][_0x6f54('0x28')]);_0x2d5534[_0x6f54('0x2d')]=_[_0x6f54('0x2e')](_0x400976[_0x6f54('0x2d')]);_0x2d5534['filters']=_[_0x6f54('0x30')](_0x2d5534[_0x6f54('0x2c')],_0x2d5534[_0x6f54('0x2d')]);_0x4d3969[_0x6f54('0x31')]=_['intersection'](_0x2d5534['model'],qs[_0x6f54('0x32')](_0x400976[_0x6f54('0x2d')][_0x6f54('0x32')]));_0x4d3969[_0x6f54('0x31')]=_0x4d3969[_0x6f54('0x31')][_0x6f54('0x33')]?_0x4d3969[_0x6f54('0x31')]:_0x2d5534[_0x6f54('0x2c')];_0x4d3969['order']=qs[_0x6f54('0x48')](_0x400976[_0x6f54('0x2d')][_0x6f54('0x48')]);_0x4d3969[_0x6f54('0x37')]=qs[_0x6f54('0x2f')](_[_0x6f54('0x49')](_0x400976['query'],_0x2d5534['filters']));if(_0x400976[_0x6f54('0x2d')][_0x6f54('0x3b')]){_0x4d3969[_0x6f54('0x37')]=_[_0x6f54('0x38')](_0x4d3969[_0x6f54('0x37')],{'$or':_[_0x6f54('0x26')](_0x4d3969[_0x6f54('0x31')],function(_0x2cf418){var _0x2b481b={};_0x2b481b[_0x2cf418]={'$like':'%'+_0x400976[_0x6f54('0x2d')]['filter']+'%'};return _0x2b481b;})});}_0x4d3969=_['merge']({},_0x4d3969,_0x400976[_0x6f54('0x4a')]);return _0x208028['getDescriptions'](_0x4d3969);}})['then'](function(_0x5d6f1f){if(_0x5d6f1f){_0xafaec0=_0x5d6f1f['length'];if(!_0x400976[_0x6f54('0x2d')]['hasOwnProperty'](_0x6f54('0x35'))){_0x4d3969[_0x6f54('0x20')]=qs[_0x6f54('0x20')](_0x400976[_0x6f54('0x2d')][_0x6f54('0x20')]);_0x4d3969['offset']=qs[_0x6f54('0x1d')](_0x400976['query'][_0x6f54('0x1d')]);}return _0x208028[_0x6f54('0x4d')](_0x4d3969);}})[_0x6f54('0x3c')](function(_0x5b69f4){if(_0x5b69f4){return _0x5b69f4?{'count':_0xafaec0,'rows':_0x5b69f4}:null;}})['then'](respondWithResult(_0x33e5ad,null))[_0x6f54('0x40')](handleError(_0x33e5ad,null));};exports[_0x6f54('0x4e')]=function(_0x2ed55c,_0x58e173,_0xeafb9d){var _0x2d47dd={};var _0x24daa7={};var _0x2efef4;var _0x184f48;return db[_0x6f54('0x27')][_0x6f54('0x46')]({'where':{'id':_0x2ed55c[_0x6f54('0x41')]['id']}})['then'](handleEntityNotFound(_0x58e173,null))[_0x6f54('0x3c')](function(_0x281521){if(_0x281521){_0x2efef4=_0x281521;_0x24daa7[_0x6f54('0x2c')]=_['keys'](db['Tag']['rawAttributes']);_0x24daa7[_0x6f54('0x2d')]=_[_0x6f54('0x2e')](_0x2ed55c[_0x6f54('0x2d')]);_0x24daa7[_0x6f54('0x2f')]=_[_0x6f54('0x30')](_0x24daa7[_0x6f54('0x2c')],_0x24daa7[_0x6f54('0x2d')]);_0x2d47dd['attributes']=_[_0x6f54('0x30')](_0x24daa7[_0x6f54('0x2c')],qs[_0x6f54('0x32')](_0x2ed55c[_0x6f54('0x2d')]['fields']));_0x2d47dd[_0x6f54('0x31')]=_0x2d47dd[_0x6f54('0x31')][_0x6f54('0x33')]?_0x2d47dd['attributes']:_0x24daa7[_0x6f54('0x2c')];_0x2d47dd['order']=qs[_0x6f54('0x48')](_0x2ed55c[_0x6f54('0x2d')][_0x6f54('0x48')]);_0x2d47dd[_0x6f54('0x37')]=qs[_0x6f54('0x2f')](_['pick'](_0x2ed55c[_0x6f54('0x2d')],_0x24daa7[_0x6f54('0x2f')]));if(_0x2ed55c[_0x6f54('0x2d')]['filter']){_0x2d47dd[_0x6f54('0x37')]=_[_0x6f54('0x38')](_0x2d47dd['where'],{'$or':_[_0x6f54('0x26')](_0x2d47dd[_0x6f54('0x31')],function(_0x10532f){var _0x535e44={};_0x535e44[_0x10532f]={'$like':'%'+_0x2ed55c[_0x6f54('0x2d')][_0x6f54('0x3b')]+'%'};return _0x535e44;})});}_0x2d47dd=_['merge']({},_0x2d47dd,_0x2ed55c[_0x6f54('0x4a')]);return _0x2efef4[_0x6f54('0x4e')](_0x2d47dd);}})[_0x6f54('0x3c')](function(_0x14ff9f){if(_0x14ff9f){_0x184f48=_0x14ff9f[_0x6f54('0x33')];if(!_0x2ed55c[_0x6f54('0x2d')]['hasOwnProperty']('nolimit')){_0x2d47dd[_0x6f54('0x20')]=qs[_0x6f54('0x20')](_0x2ed55c[_0x6f54('0x2d')]['limit']);_0x2d47dd['offset']=qs[_0x6f54('0x1d')](_0x2ed55c[_0x6f54('0x2d')][_0x6f54('0x1d')]);}return _0x2efef4[_0x6f54('0x4e')](_0x2d47dd);}})[_0x6f54('0x3c')](function(_0x33be46){if(_0x33be46){return _0x33be46?{'count':_0x184f48,'rows':_0x33be46}:null;}})[_0x6f54('0x3c')](respondWithResult(_0x58e173,null))[_0x6f54('0x40')](handleError(_0x58e173,null));};exports[_0x6f54('0x4f')]=function(_0x14902e,_0x18f8f2,_0x3ecc32){if(_0x14902e[_0x6f54('0x44')]['id']){delete _0x14902e[_0x6f54('0x44')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x14902e['params']['id']}})[_0x6f54('0x3c')](handleEntityNotFound(_0x18f8f2,null))[_0x6f54('0x3c')](function(_0x26d0ea){if(_0x26d0ea){return _0x26d0ea['setTags'](_0x14902e[_0x6f54('0x44')]['ids']||[]);}return null;})[_0x6f54('0x3c')](respondWithResult(_0x18f8f2,null))['catch'](handleError(_0x18f8f2,null));}; \ No newline at end of file +var _0xae3e=['getSubjects','getDescriptions','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','then','destroy','error','stack','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','ZendeskConfiguration','includeAll','include','show','keys','find','create','catch','update','body','params','getFields','findOne','ZendeskField','nolimit'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xae3e,0xe9));var _0xeae3=function(_0x2bf3ef,_0x1f97a8){_0x2bf3ef=_0x2bf3ef-0x0;var _0x2315ce=_0xae3e[_0x2bf3ef];return _0x2315ce;};'use strict';var emlformat=require(_0xeae3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeae3('0x1'));var rp=require(_0xeae3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xeae3('0x3'));var sox=require(_0xeae3('0x4'));var csv=require(_0xeae3('0x5'));var ejs=require(_0xeae3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeae3('0x7'));var squel=require(_0xeae3('0x8'));var crypto=require(_0xeae3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xeae3('0xa'));var toCsv=require(_0xeae3('0x5'));var querystring=require('querystring');var Papa=require(_0xeae3('0xb'));var Redis=require(_0xeae3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xeae3('0xd'));var as=require(_0xeae3('0xe'));var hardwareService=require(_0xeae3('0xf'));var logger=require(_0xeae3('0x10'))(_0xeae3('0x11'));var utils=require(_0xeae3('0x12'));var config=require(_0xeae3('0x13'));var licenseUtil=require(_0xeae3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24cbed,_0x5f54e6){_0x5f54e6=_0x5f54e6||0xcc;return function(_0x23072b){if(_0x23072b){return _0x24cbed[_0xeae3('0x15')](_0x5f54e6);}return _0x24cbed[_0xeae3('0x16')](_0x5f54e6)[_0xeae3('0x17')]();};}function respondWithResult(_0x16b2fb,_0x34218d){_0x34218d=_0x34218d||0xc8;return function(_0x3b8401){if(_0x3b8401){return _0x16b2fb[_0xeae3('0x16')](_0x34218d)[_0xeae3('0x18')](_0x3b8401);}};}function respondWithFilteredResult(_0x3cf2ec,_0x16fc96){return function(_0x52cd63){if(_0x52cd63){var _0x5b8429=typeof _0x16fc96['offset']===_0xeae3('0x19')&&typeof _0x16fc96[_0xeae3('0x1a')]==='undefined';var _0x3a3e52=_0x52cd63[_0xeae3('0x1b')];var _0x678eb1=_0x5b8429?0x0:_0x16fc96[_0xeae3('0x1c')];var _0x24f256=_0x5b8429?_0x52cd63[_0xeae3('0x1b')]:_0x16fc96[_0xeae3('0x1c')]+_0x16fc96[_0xeae3('0x1a')];var _0x42c71f;if(_0x24f256>=_0x3a3e52){_0x24f256=_0x3a3e52;_0x42c71f=0xc8;}else{_0x42c71f=0xce;}_0x3cf2ec[_0xeae3('0x16')](_0x42c71f);return _0x3cf2ec['set'](_0xeae3('0x1d'),_0x678eb1+'-'+_0x24f256+'/'+_0x3a3e52)[_0xeae3('0x18')](_0x52cd63);}return null;};}function patchUpdates(_0x3c8400){return function(_0x1f3682){try{jsonpatch[_0xeae3('0x1e')](_0x1f3682,_0x3c8400,!![]);}catch(_0x1bea69){return BPromise['reject'](_0x1bea69);}return _0x1f3682['save']();};}function saveUpdates(_0x1ef940,_0x501d33){return function(_0x544a14){if(_0x544a14){return _0x544a14['update'](_0x1ef940)[_0xeae3('0x1f')](function(_0x4eae27){return _0x4eae27;});}return null;};}function removeEntity(_0x46feba,_0x37f0dd){return function(_0x460e7a){if(_0x460e7a){return _0x460e7a[_0xeae3('0x20')]()['then'](function(){_0x46feba[_0xeae3('0x16')](0xcc)[_0xeae3('0x17')]();});}};}function handleEntityNotFound(_0x74df24,_0x39f020){return function(_0x3569e6){if(!_0x3569e6){_0x74df24[_0xeae3('0x15')](0x194);}return _0x3569e6;};}function handleError(_0x21bb36,_0x4b8ff0){_0x4b8ff0=_0x4b8ff0||0x1f4;return function(_0x214baf){logger[_0xeae3('0x21')](_0x214baf[_0xeae3('0x22')]);if(_0x214baf['name']){delete _0x214baf['name'];}_0x21bb36[_0xeae3('0x16')](_0x4b8ff0)[_0xeae3('0x23')](_0x214baf);};}exports[_0xeae3('0x24')]=function(_0x5679e8,_0x1873bc){var _0x557b2a={},_0x5d8ae6={},_0x1a7483={'count':0x0,'rows':[]};var _0x55815d=_[_0xeae3('0x25')](db['ZendeskConfiguration'][_0xeae3('0x26')],function(_0x2d0305){return{'name':_0x2d0305['fieldName'],'type':_0x2d0305[_0xeae3('0x27')][_0xeae3('0x28')]};});_0x5d8ae6[_0xeae3('0x29')]=_[_0xeae3('0x25')](_0x55815d,'name');_0x5d8ae6['query']=_['keys'](_0x5679e8[_0xeae3('0x2a')]);_0x5d8ae6[_0xeae3('0x2b')]=_[_0xeae3('0x2c')](_0x5d8ae6[_0xeae3('0x29')],_0x5d8ae6[_0xeae3('0x2a')]);_0x557b2a[_0xeae3('0x2d')]=_[_0xeae3('0x2c')](_0x5d8ae6[_0xeae3('0x29')],qs[_0xeae3('0x2e')](_0x5679e8['query'][_0xeae3('0x2e')]));_0x557b2a[_0xeae3('0x2d')]=_0x557b2a[_0xeae3('0x2d')][_0xeae3('0x2f')]?_0x557b2a[_0xeae3('0x2d')]:_0x5d8ae6[_0xeae3('0x29')];if(!_0x5679e8[_0xeae3('0x2a')][_0xeae3('0x30')]('nolimit')){_0x557b2a['limit']=qs[_0xeae3('0x1a')](_0x5679e8[_0xeae3('0x2a')][_0xeae3('0x1a')]);_0x557b2a[_0xeae3('0x1c')]=qs[_0xeae3('0x1c')](_0x5679e8[_0xeae3('0x2a')]['offset']);}_0x557b2a[_0xeae3('0x31')]=qs[_0xeae3('0x32')](_0x5679e8[_0xeae3('0x2a')][_0xeae3('0x32')]);_0x557b2a['where']=qs[_0xeae3('0x2b')](_[_0xeae3('0x33')](_0x5679e8[_0xeae3('0x2a')],_0x5d8ae6[_0xeae3('0x2b')]),_0x55815d);if(_0x5679e8['query']['filter']){_0x557b2a[_0xeae3('0x34')]=_[_0xeae3('0x35')](_0x557b2a[_0xeae3('0x34')],{'$or':_[_0xeae3('0x25')](_0x55815d,function(_0x185acc){if(_0x185acc['type']!=='VIRTUAL'){var _0x5cfefa={};_0x5cfefa[_0x185acc['name']]={'$like':'%'+_0x5679e8[_0xeae3('0x2a')][_0xeae3('0x36')]+'%'};return _0x5cfefa;}})});}_0x557b2a=_['merge']({},_0x557b2a,_0x5679e8[_0xeae3('0x37')]);var _0x437aeb={'where':_0x557b2a[_0xeae3('0x34')]};return db[_0xeae3('0x38')][_0xeae3('0x1b')](_0x437aeb)[_0xeae3('0x1f')](function(_0xb71350){_0x1a7483[_0xeae3('0x1b')]=_0xb71350;if(_0x5679e8['query'][_0xeae3('0x39')]){_0x557b2a[_0xeae3('0x3a')]=[{'all':!![]}];}return db[_0xeae3('0x38')]['findAll'](_0x557b2a);})[_0xeae3('0x1f')](function(_0x489138){_0x1a7483['rows']=_0x489138;return _0x1a7483;})['then'](respondWithFilteredResult(_0x1873bc,_0x557b2a))['catch'](handleError(_0x1873bc,null));};exports[_0xeae3('0x3b')]=function(_0x3ec947,_0x294932){var _0x14aedb={'raw':![],'where':{'id':_0x3ec947['params']['id']}},_0x3c1160={};_0x3c1160[_0xeae3('0x29')]=_[_0xeae3('0x3c')](db[_0xeae3('0x38')][_0xeae3('0x26')]);_0x3c1160['query']=_['keys'](_0x3ec947[_0xeae3('0x2a')]);_0x3c1160[_0xeae3('0x2b')]=_[_0xeae3('0x2c')](_0x3c1160['model'],_0x3c1160[_0xeae3('0x2a')]);_0x14aedb[_0xeae3('0x2d')]=_[_0xeae3('0x2c')](_0x3c1160['model'],qs[_0xeae3('0x2e')](_0x3ec947[_0xeae3('0x2a')][_0xeae3('0x2e')]));_0x14aedb[_0xeae3('0x2d')]=_0x14aedb[_0xeae3('0x2d')][_0xeae3('0x2f')]?_0x14aedb['attributes']:_0x3c1160[_0xeae3('0x29')];if(_0x3ec947[_0xeae3('0x2a')]['includeAll']){_0x14aedb['include']=[{'all':!![]}];}_0x14aedb=_[_0xeae3('0x35')]({},_0x14aedb,_0x3ec947[_0xeae3('0x37')]);return db[_0xeae3('0x38')][_0xeae3('0x3d')](_0x14aedb)['then'](handleEntityNotFound(_0x294932,null))[_0xeae3('0x1f')](respondWithResult(_0x294932,null))['catch'](handleError(_0x294932,null));};exports[_0xeae3('0x3e')]=function(_0x415cff,_0x3db4ee){return db[_0xeae3('0x38')][_0xeae3('0x3e')](_0x415cff['body'],{})[_0xeae3('0x1f')](respondWithResult(_0x3db4ee,0xc9))[_0xeae3('0x3f')](handleError(_0x3db4ee,null));};exports[_0xeae3('0x40')]=function(_0xbc403d,_0x82108d){if(_0xbc403d[_0xeae3('0x41')]['id']){delete _0xbc403d[_0xeae3('0x41')]['id'];}return db['ZendeskConfiguration'][_0xeae3('0x3d')]({'where':{'id':_0xbc403d[_0xeae3('0x42')]['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0x82108d,null))[_0xeae3('0x1f')](saveUpdates(_0xbc403d['body'],null))['then'](respondWithResult(_0x82108d,null))[_0xeae3('0x3f')](handleError(_0x82108d,null));};exports[_0xeae3('0x20')]=function(_0x41e263,_0x80a3f8){return db[_0xeae3('0x38')][_0xeae3('0x3d')]({'where':{'id':_0x41e263[_0xeae3('0x42')]['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0x80a3f8,null))[_0xeae3('0x1f')](removeEntity(_0x80a3f8,null))[_0xeae3('0x3f')](handleError(_0x80a3f8,null));};exports[_0xeae3('0x43')]=function(_0x7960dc,_0x3d5d2a,_0x12d1e6){var _0x30663b={};var _0xa7b8b3={};var _0x3efa7d;var _0x502d8d;return db['ZendeskConfiguration'][_0xeae3('0x44')]({'where':{'id':_0x7960dc[_0xeae3('0x42')]['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0x3d5d2a,null))['then'](function(_0x49f9a9){if(_0x49f9a9){_0x3efa7d=_0x49f9a9;_0xa7b8b3[_0xeae3('0x29')]=_['keys'](db[_0xeae3('0x45')][_0xeae3('0x26')]);_0xa7b8b3[_0xeae3('0x2a')]=_['keys'](_0x7960dc[_0xeae3('0x2a')]);_0xa7b8b3[_0xeae3('0x2b')]=_[_0xeae3('0x2c')](_0xa7b8b3['model'],_0xa7b8b3[_0xeae3('0x2a')]);_0x30663b[_0xeae3('0x2d')]=_[_0xeae3('0x2c')](_0xa7b8b3[_0xeae3('0x29')],qs['fields'](_0x7960dc[_0xeae3('0x2a')]['fields']));_0x30663b[_0xeae3('0x2d')]=_0x30663b[_0xeae3('0x2d')][_0xeae3('0x2f')]?_0x30663b[_0xeae3('0x2d')]:_0xa7b8b3[_0xeae3('0x29')];_0x30663b[_0xeae3('0x31')]=qs[_0xeae3('0x32')](_0x7960dc[_0xeae3('0x2a')][_0xeae3('0x32')]);_0x30663b['where']=qs[_0xeae3('0x2b')](_[_0xeae3('0x33')](_0x7960dc[_0xeae3('0x2a')],_0xa7b8b3[_0xeae3('0x2b')]));if(_0x7960dc[_0xeae3('0x2a')][_0xeae3('0x36')]){_0x30663b[_0xeae3('0x34')]=_[_0xeae3('0x35')](_0x30663b['where'],{'$or':_[_0xeae3('0x25')](_0x30663b[_0xeae3('0x2d')],function(_0x50440a){var _0x272cc0={};_0x272cc0[_0x50440a]={'$like':'%'+_0x7960dc[_0xeae3('0x2a')][_0xeae3('0x36')]+'%'};return _0x272cc0;})});}_0x30663b=_['merge']({},_0x30663b,_0x7960dc[_0xeae3('0x37')]);return _0x3efa7d[_0xeae3('0x43')](_0x30663b);}})[_0xeae3('0x1f')](function(_0x5ab0c9){if(_0x5ab0c9){_0x502d8d=_0x5ab0c9['length'];if(!_0x7960dc[_0xeae3('0x2a')]['hasOwnProperty'](_0xeae3('0x46'))){_0x30663b[_0xeae3('0x1a')]=qs[_0xeae3('0x1a')](_0x7960dc[_0xeae3('0x2a')]['limit']);_0x30663b[_0xeae3('0x1c')]=qs[_0xeae3('0x1c')](_0x7960dc['query'][_0xeae3('0x1c')]);}return _0x3efa7d[_0xeae3('0x43')](_0x30663b);}})[_0xeae3('0x1f')](function(_0x25bf1b){if(_0x25bf1b){return _0x25bf1b?{'count':_0x502d8d,'rows':_0x25bf1b}:null;}})[_0xeae3('0x1f')](respondWithResult(_0x3d5d2a,null))[_0xeae3('0x3f')](handleError(_0x3d5d2a,null));};exports[_0xeae3('0x47')]=function(_0xad0811,_0x2ec755,_0x54c8f8){var _0x2a96c5={};var _0x202ea7={};var _0x3f5be9;var _0x570100;return db[_0xeae3('0x38')][_0xeae3('0x44')]({'where':{'id':_0xad0811[_0xeae3('0x42')]['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0x2ec755,null))[_0xeae3('0x1f')](function(_0x308d6b){if(_0x308d6b){_0x3f5be9=_0x308d6b;_0x202ea7['model']=_[_0xeae3('0x3c')](db['ZendeskField'][_0xeae3('0x26')]);_0x202ea7[_0xeae3('0x2a')]=_['keys'](_0xad0811[_0xeae3('0x2a')]);_0x202ea7[_0xeae3('0x2b')]=_['intersection'](_0x202ea7[_0xeae3('0x29')],_0x202ea7[_0xeae3('0x2a')]);_0x2a96c5[_0xeae3('0x2d')]=_[_0xeae3('0x2c')](_0x202ea7[_0xeae3('0x29')],qs[_0xeae3('0x2e')](_0xad0811[_0xeae3('0x2a')][_0xeae3('0x2e')]));_0x2a96c5['attributes']=_0x2a96c5['attributes']['length']?_0x2a96c5[_0xeae3('0x2d')]:_0x202ea7['model'];_0x2a96c5['order']=qs[_0xeae3('0x32')](_0xad0811[_0xeae3('0x2a')][_0xeae3('0x32')]);_0x2a96c5['where']=qs[_0xeae3('0x2b')](_[_0xeae3('0x33')](_0xad0811['query'],_0x202ea7[_0xeae3('0x2b')]));if(_0xad0811[_0xeae3('0x2a')][_0xeae3('0x36')]){_0x2a96c5[_0xeae3('0x34')]=_[_0xeae3('0x35')](_0x2a96c5['where'],{'$or':_[_0xeae3('0x25')](_0x2a96c5[_0xeae3('0x2d')],function(_0x4585b1){var _0xf56f00={};_0xf56f00[_0x4585b1]={'$like':'%'+_0xad0811['query'][_0xeae3('0x36')]+'%'};return _0xf56f00;})});}_0x2a96c5=_['merge']({},_0x2a96c5,_0xad0811[_0xeae3('0x37')]);return _0x3f5be9[_0xeae3('0x47')](_0x2a96c5);}})[_0xeae3('0x1f')](function(_0x87344e){if(_0x87344e){_0x570100=_0x87344e[_0xeae3('0x2f')];if(!_0xad0811[_0xeae3('0x2a')][_0xeae3('0x30')](_0xeae3('0x46'))){_0x2a96c5[_0xeae3('0x1a')]=qs[_0xeae3('0x1a')](_0xad0811['query']['limit']);_0x2a96c5[_0xeae3('0x1c')]=qs['offset'](_0xad0811[_0xeae3('0x2a')]['offset']);}return _0x3f5be9['getSubjects'](_0x2a96c5);}})[_0xeae3('0x1f')](function(_0x3de0fa){if(_0x3de0fa){return _0x3de0fa?{'count':_0x570100,'rows':_0x3de0fa}:null;}})[_0xeae3('0x1f')](respondWithResult(_0x2ec755,null))[_0xeae3('0x3f')](handleError(_0x2ec755,null));};exports[_0xeae3('0x48')]=function(_0x5475c7,_0xa593d6,_0x2ec3da){var _0x4d17b1={};var _0x357e44={};var _0x5f9928;var _0x1d55a9;return db[_0xeae3('0x38')][_0xeae3('0x44')]({'where':{'id':_0x5475c7['params']['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0xa593d6,null))[_0xeae3('0x1f')](function(_0x4f00da){if(_0x4f00da){_0x5f9928=_0x4f00da;_0x357e44[_0xeae3('0x29')]=_['keys'](db[_0xeae3('0x45')][_0xeae3('0x26')]);_0x357e44[_0xeae3('0x2a')]=_[_0xeae3('0x3c')](_0x5475c7[_0xeae3('0x2a')]);_0x357e44[_0xeae3('0x2b')]=_[_0xeae3('0x2c')](_0x357e44['model'],_0x357e44[_0xeae3('0x2a')]);_0x4d17b1['attributes']=_['intersection'](_0x357e44[_0xeae3('0x29')],qs['fields'](_0x5475c7[_0xeae3('0x2a')][_0xeae3('0x2e')]));_0x4d17b1[_0xeae3('0x2d')]=_0x4d17b1['attributes'][_0xeae3('0x2f')]?_0x4d17b1[_0xeae3('0x2d')]:_0x357e44[_0xeae3('0x29')];_0x4d17b1[_0xeae3('0x31')]=qs[_0xeae3('0x32')](_0x5475c7[_0xeae3('0x2a')][_0xeae3('0x32')]);_0x4d17b1[_0xeae3('0x34')]=qs[_0xeae3('0x2b')](_[_0xeae3('0x33')](_0x5475c7[_0xeae3('0x2a')],_0x357e44[_0xeae3('0x2b')]));if(_0x5475c7[_0xeae3('0x2a')][_0xeae3('0x36')]){_0x4d17b1['where']=_[_0xeae3('0x35')](_0x4d17b1['where'],{'$or':_['map'](_0x4d17b1[_0xeae3('0x2d')],function(_0x143097){var _0x3ef339={};_0x3ef339[_0x143097]={'$like':'%'+_0x5475c7[_0xeae3('0x2a')]['filter']+'%'};return _0x3ef339;})});}_0x4d17b1=_[_0xeae3('0x35')]({},_0x4d17b1,_0x5475c7['options']);return _0x5f9928['getDescriptions'](_0x4d17b1);}})[_0xeae3('0x1f')](function(_0x4ca717){if(_0x4ca717){_0x1d55a9=_0x4ca717['length'];if(!_0x5475c7[_0xeae3('0x2a')][_0xeae3('0x30')](_0xeae3('0x46'))){_0x4d17b1['limit']=qs[_0xeae3('0x1a')](_0x5475c7[_0xeae3('0x2a')][_0xeae3('0x1a')]);_0x4d17b1[_0xeae3('0x1c')]=qs[_0xeae3('0x1c')](_0x5475c7[_0xeae3('0x2a')][_0xeae3('0x1c')]);}return _0x5f9928['getDescriptions'](_0x4d17b1);}})[_0xeae3('0x1f')](function(_0x45cd45){if(_0x45cd45){return _0x45cd45?{'count':_0x1d55a9,'rows':_0x45cd45}:null;}})['then'](respondWithResult(_0xa593d6,null))[_0xeae3('0x3f')](handleError(_0xa593d6,null));};exports[_0xeae3('0x49')]=function(_0x4e9374,_0x203298,_0x463fe6){var _0x141718={};var _0x10cab9={};var _0x344a58;var _0x12dd74;return db['ZendeskConfiguration'][_0xeae3('0x44')]({'where':{'id':_0x4e9374[_0xeae3('0x42')]['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0x203298,null))['then'](function(_0x1e5213){if(_0x1e5213){_0x344a58=_0x1e5213;_0x10cab9['model']=_[_0xeae3('0x3c')](db['Tag'][_0xeae3('0x26')]);_0x10cab9[_0xeae3('0x2a')]=_[_0xeae3('0x3c')](_0x4e9374['query']);_0x10cab9[_0xeae3('0x2b')]=_[_0xeae3('0x2c')](_0x10cab9[_0xeae3('0x29')],_0x10cab9[_0xeae3('0x2a')]);_0x141718['attributes']=_[_0xeae3('0x2c')](_0x10cab9[_0xeae3('0x29')],qs[_0xeae3('0x2e')](_0x4e9374[_0xeae3('0x2a')][_0xeae3('0x2e')]));_0x141718[_0xeae3('0x2d')]=_0x141718[_0xeae3('0x2d')][_0xeae3('0x2f')]?_0x141718[_0xeae3('0x2d')]:_0x10cab9[_0xeae3('0x29')];_0x141718[_0xeae3('0x31')]=qs[_0xeae3('0x32')](_0x4e9374['query'][_0xeae3('0x32')]);_0x141718[_0xeae3('0x34')]=qs['filters'](_[_0xeae3('0x33')](_0x4e9374[_0xeae3('0x2a')],_0x10cab9[_0xeae3('0x2b')]));if(_0x4e9374['query'][_0xeae3('0x36')]){_0x141718['where']=_[_0xeae3('0x35')](_0x141718[_0xeae3('0x34')],{'$or':_['map'](_0x141718[_0xeae3('0x2d')],function(_0x48fe2e){var _0x1f806f={};_0x1f806f[_0x48fe2e]={'$like':'%'+_0x4e9374[_0xeae3('0x2a')][_0xeae3('0x36')]+'%'};return _0x1f806f;})});}_0x141718=_[_0xeae3('0x35')]({},_0x141718,_0x4e9374['options']);return _0x344a58['getTags'](_0x141718);}})[_0xeae3('0x1f')](function(_0x4fd185){if(_0x4fd185){_0x12dd74=_0x4fd185['length'];if(!_0x4e9374['query'][_0xeae3('0x30')](_0xeae3('0x46'))){_0x141718[_0xeae3('0x1a')]=qs[_0xeae3('0x1a')](_0x4e9374[_0xeae3('0x2a')]['limit']);_0x141718['offset']=qs['offset'](_0x4e9374[_0xeae3('0x2a')][_0xeae3('0x1c')]);}return _0x344a58[_0xeae3('0x49')](_0x141718);}})[_0xeae3('0x1f')](function(_0x208bf2){if(_0x208bf2){return _0x208bf2?{'count':_0x12dd74,'rows':_0x208bf2}:null;}})[_0xeae3('0x1f')](respondWithResult(_0x203298,null))[_0xeae3('0x3f')](handleError(_0x203298,null));};exports[_0xeae3('0x4a')]=function(_0x14ae32,_0x1d937c,_0x3e3865){if(_0x14ae32[_0xeae3('0x41')]['id']){delete _0x14ae32[_0xeae3('0x41')]['id'];}return db[_0xeae3('0x38')][_0xeae3('0x44')]({'where':{'id':_0x14ae32[_0xeae3('0x42')]['id']}})[_0xeae3('0x1f')](handleEntityNotFound(_0x1d937c,null))['then'](function(_0x565526){if(_0x565526){return _0x565526[_0xeae3('0x4a')](_0x14ae32[_0xeae3('0x41')][_0xeae3('0x4b')]||[]);}return null;})[_0xeae3('0x1f')](respondWithResult(_0x1d937c,null))[_0xeae3('0x3f')](handleError(_0x1d937c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 952475e..af57a7d 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 _0x373d=['define','ZendeskConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x373d,0x1e2));var _0xd373=function(_0x434e1a,_0x16f187){_0x434e1a=_0x434e1a-0x0;var _0x15081a=_0x373d[_0x434e1a];return _0x15081a;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var logger=require(_0xd373('0x1'))(_0xd373('0x2'));var moment=require(_0xd373('0x3'));var BPromise=require(_0xd373('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd373('0x5'));var rimraf=require(_0xd373('0x6'));var config=require(_0xd373('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x31a0fb,_0x3e4443){return _0x31a0fb[_0xd373('0x8')](_0xd373('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa478=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x82be4,_0x1b074b){var _0xe2637=function(_0x1a5481){while(--_0x1a5481){_0x82be4['push'](_0x82be4['shift']());}};_0xe2637(++_0x1b074b);}(_0xa478,0x136));var _0x8a47=function(_0xbb0ce8,_0xb63549){_0xbb0ce8=_0xbb0ce8-0x0;var _0x1a1b17=_0xa478[_0xbb0ce8];return _0x1a1b17;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));module[_0x8a47('0xb')]=function(_0x50226a,_0x413787){return _0x50226a[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':_0x8a47('0xe'),'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 fa2e6df..d410194 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 _0x0041=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','util','moment','bluebird'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0041,0x127));var _0x1004=function(_0x3666f8,_0x243909){_0x3666f8=_0x3666f8-0x0;var _0x371c75=_0x0041[_0x3666f8];return _0x371c75;};'use strict';var _=require(_0x1004('0x0'));var util=require(_0x1004('0x1'));var moment=require(_0x1004('0x2'));var BPromise=require(_0x1004('0x3'));var rs=require(_0x1004('0x4'));var fs=require('fs');var Redis=require(_0x1004('0x5'));var db=require(_0x1004('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1004('0x7'))('rpc');var config=require(_0x1004('0x8'));var jayson=require(_0x1004('0x9'));var client=jayson[_0x1004('0xa')][_0x1004('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f2cd7,_0x34fd6b,_0x4118ad){return new BPromise(function(_0x405cb4,_0x4c1046){return client[_0x1004('0xc')](_0x4f2cd7,_0x4118ad)[_0x1004('0xd')](function(_0x354a5b){logger[_0x1004('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34fd6b,_0x1004('0xf'));logger[_0x1004('0x10')](_0x1004('0x11'),_0x34fd6b,_0x1004('0xf'),JSON[_0x1004('0x12')](_0x354a5b));if(_0x354a5b['error']){if(_0x354a5b['error'][_0x1004('0x13')]===0x1f4){logger[_0x1004('0x14')](_0x1004('0x15'),_0x34fd6b,_0x354a5b[_0x1004('0x14')][_0x1004('0x16')]);return _0x4c1046(_0x354a5b[_0x1004('0x14')][_0x1004('0x16')]);}logger['error'](_0x1004('0x15'),_0x34fd6b,_0x354a5b[_0x1004('0x14')][_0x1004('0x16')]);return _0x405cb4(_0x354a5b[_0x1004('0x14')][_0x1004('0x16')]);}else{logger[_0x1004('0xe')](_0x1004('0x15'),_0x34fd6b,_0x1004('0xf'));_0x405cb4(_0x354a5b['result']['message']);}})['catch'](function(_0x4b7c1f){logger[_0x1004('0x14')](_0x1004('0x15'),_0x34fd6b,_0x4b7c1f);_0x4c1046(_0x4b7c1f);});});} \ No newline at end of file +var _0xa39e=['code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xa39e,0x1be));var _0xea39=function(_0x218ea3,_0x36f59c){_0x218ea3=_0x218ea3-0x0;var _0x49265e=_0xa39e[_0x218ea3];return _0x49265e;};'use strict';var _=require('lodash');var util=require(_0xea39('0x0'));var moment=require(_0xea39('0x1'));var BPromise=require('bluebird');var rs=require(_0xea39('0x2'));var fs=require('fs');var Redis=require(_0xea39('0x3'));var db=require(_0xea39('0x4'))['db'];var utils=require(_0xea39('0x5'));var logger=require('../../config/logger')(_0xea39('0x6'));var config=require('../../config/environment');var jayson=require(_0xea39('0x7'));var client=jayson['client'][_0xea39('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe64462,_0x2f9c93,_0x22e3b1){return new BPromise(function(_0x309add,_0x45df52){return client[_0xea39('0x9')](_0xe64462,_0x22e3b1)[_0xea39('0xa')](function(_0x175dd2){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x2f9c93,_0xea39('0xb'));logger[_0xea39('0xc')](_0xea39('0xd'),_0x2f9c93,_0xea39('0xb'),JSON[_0xea39('0xe')](_0x175dd2));if(_0x175dd2[_0xea39('0xf')]){if(_0x175dd2['error'][_0xea39('0x10')]===0x1f4){logger[_0xea39('0xf')](_0xea39('0x11'),_0x2f9c93,_0x175dd2[_0xea39('0xf')][_0xea39('0x12')]);return _0x45df52(_0x175dd2['error'][_0xea39('0x12')]);}logger[_0xea39('0xf')](_0xea39('0x11'),_0x2f9c93,_0x175dd2[_0xea39('0xf')][_0xea39('0x12')]);return _0x309add(_0x175dd2[_0xea39('0xf')]['message']);}else{logger[_0xea39('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2f9c93,'request\x20sent');_0x309add(_0x175dd2[_0xea39('0x14')]['message']);}})[_0xea39('0x15')](function(_0xc0e5aa){logger['error'](_0xea39('0x11'),_0x2f9c93,_0xc0e5aa);_0x45df52(_0xc0e5aa);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index b1a11dc..dad79ab 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 _0xe208=['../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe208,0x1ba));var _0x8e20=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xe208[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0x8e20('0x0'));var util=require(_0x8e20('0x1'));var path=require(_0x8e20('0x2'));var timeout=require(_0x8e20('0x3'));var express=require(_0x8e20('0x4'));var router=express[_0x8e20('0x5')]();var fs_extra=require(_0x8e20('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e20('0x7'));var config=require(_0x8e20('0x8'));var controller=require(_0x8e20('0x9'));router[_0x8e20('0xa')]('/',auth[_0x8e20('0xb')](),controller[_0x8e20('0xc')]);router['get'](_0x8e20('0xd'),auth[_0x8e20('0xb')](),controller['show']);router['post']('/',auth[_0x8e20('0xb')](),controller[_0x8e20('0xe')]);router[_0x8e20('0xf')]('/:id',auth[_0x8e20('0xb')](),controller[_0x8e20('0x10')]);router['delete'](_0x8e20('0xd'),auth[_0x8e20('0xb')](),controller[_0x8e20('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4dc5=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3490d4,_0x1e7bbc){var _0x8f02fd=function(_0x1e7bd3){while(--_0x1e7bd3){_0x3490d4['push'](_0x3490d4['shift']());}};_0x8f02fd(++_0x1e7bbc);}(_0x4dc5,0x161));var _0x54dc=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x4dc5[_0x46d0c9];return _0x174506;};'use strict';var multer=require(_0x54dc('0x0'));var util=require('util');var path=require(_0x54dc('0x1'));var timeout=require(_0x54dc('0x2'));var express=require(_0x54dc('0x3'));var router=express[_0x54dc('0x4')]();var fs_extra=require(_0x54dc('0x5'));var auth=require(_0x54dc('0x6'));var interaction=require(_0x54dc('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x54dc('0x8')](_0x54dc('0x9'),auth[_0x54dc('0xa')](),controller[_0x54dc('0xb')]);router[_0x54dc('0xc')]('/',auth[_0x54dc('0xa')](),controller[_0x54dc('0xd')]);router[_0x54dc('0xe')](_0x54dc('0x9'),auth['isAuthenticated'](),controller[_0x54dc('0xf')]);router[_0x54dc('0x10')](_0x54dc('0x9'),auth[_0x54dc('0xa')](),controller[_0x54dc('0x11')]);module[_0x54dc('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 d906d57..16e16ec 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 _0xb799=['STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string'];(function(_0x1a0dc6,_0x4f396a){var _0xe592af=function(_0x531ea2){while(--_0x531ea2){_0x1a0dc6['push'](_0x1a0dc6['shift']());}};_0xe592af(++_0x4f396a);}(_0xb799,0x1ba));var _0x9b79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb799[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9b79('0x0'));module['exports']={'type':{'type':Sequelize[_0x9b79('0x1')]('string',_0x9b79('0x2'),_0x9b79('0x3'),_0x9b79('0x4'),'picklist'),'defaultValue':_0x9b79('0x5')},'content':{'type':Sequelize[_0x9b79('0x6')]},'key':{'type':Sequelize[_0x9b79('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x9b79('0x5'),'variable',_0x9b79('0x3'))},'keyContent':{'type':Sequelize[_0x9b79('0x6')]},'idField':{'type':Sequelize[_0x9b79('0x6')]},'nameField':{'type':Sequelize[_0x9b79('0x6')]},'customField':{'type':Sequelize[_0x9b79('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b79('0x6')]}}; \ No newline at end of file +var _0xf93c=['string','keyValue','STRING','variable','BOOLEAN','sequelize','ENUM'];(function(_0x5c4e7a,_0x12dcff){var _0x2692fb=function(_0x42940b){while(--_0x42940b){_0x5c4e7a['push'](_0x5c4e7a['shift']());}};_0x2692fb(++_0x12dcff);}(_0xf93c,0x8a));var _0xcf93=function(_0x52e6ef,_0x5cdc09){_0x52e6ef=_0x52e6ef-0x0;var _0x5ee981=_0xf93c[_0x52e6ef];return _0x5ee981;};'use strict';var Sequelize=require(_0xcf93('0x0'));module['exports']={'type':{'type':Sequelize[_0xcf93('0x1')](_0xcf93('0x2'),'variable','customVariable',_0xcf93('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcf93('0x4')]},'keyType':{'type':Sequelize[_0xcf93('0x1')](_0xcf93('0x2'),_0xcf93('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0xcf93('0x4')]},'idField':{'type':Sequelize[_0xcf93('0x4')]},'nameField':{'type':Sequelize[_0xcf93('0x4')]},'customField':{'type':Sequelize[_0xcf93('0x6')],'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 b21dd39..dc9f60d 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 _0xf2dd=['eml-format','rimraf','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskField','includeAll','include','catch','show','params','rawAttributes','find','create','body'];(function(_0x32975f,_0x194b73){var _0x5d1832=function(_0x1b141f){while(--_0x1b141f){_0x32975f['push'](_0x32975f['shift']());}};_0x5d1832(++_0x194b73);}(_0xf2dd,0x84));var _0xdf2d=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xf2dd[_0x3c2b2e];return _0x27a338;};'use strict';var emlformat=require(_0xdf2d('0x0'));var rimraf=require(_0xdf2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdf2d('0x2'));var moment=require(_0xdf2d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdf2d('0x4'));var util=require('util');var path=require(_0xdf2d('0x5'));var sox=require('sox');var csv=require(_0xdf2d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf2d('0x7'));var _=require(_0xdf2d('0x8'));var squel=require('squel');var crypto=require(_0xdf2d('0x9'));var jsforce=require(_0xdf2d('0xa'));var deskjs=require(_0xdf2d('0xb'));var toCsv=require(_0xdf2d('0x6'));var querystring=require('querystring');var Papa=require(_0xdf2d('0xc'));var Redis=require('ioredis');var authService=require(_0xdf2d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf2d('0xe'))(_0xdf2d('0xf'));var utils=require(_0xdf2d('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xdf2d('0x11'));var db=require(_0xdf2d('0x12'))['db'];function respondWithStatusCode(_0x75411e,_0x4913f3){_0x4913f3=_0x4913f3||0xcc;return function(_0x11ddd1){if(_0x11ddd1){return _0x75411e[_0xdf2d('0x13')](_0x4913f3);}return _0x75411e[_0xdf2d('0x14')](_0x4913f3)['end']();};}function respondWithResult(_0x10cc26,_0x59a2ec){_0x59a2ec=_0x59a2ec||0xc8;return function(_0x350ffe){if(_0x350ffe){return _0x10cc26[_0xdf2d('0x14')](_0x59a2ec)['json'](_0x350ffe);}};}function respondWithFilteredResult(_0x720c34,_0x5e3195){return function(_0x3a7767){if(_0x3a7767){var _0x21606c=typeof _0x5e3195[_0xdf2d('0x15')]===_0xdf2d('0x16')&&typeof _0x5e3195['limit']===_0xdf2d('0x16');var _0x5bf37f=_0x3a7767[_0xdf2d('0x17')];var _0x4499ea=_0x21606c?0x0:_0x5e3195['offset'];var _0x3104b6=_0x21606c?_0x3a7767['count']:_0x5e3195[_0xdf2d('0x15')]+_0x5e3195['limit'];var _0x2638b8;if(_0x3104b6>=_0x5bf37f){_0x3104b6=_0x5bf37f;_0x2638b8=0xc8;}else{_0x2638b8=0xce;}_0x720c34[_0xdf2d('0x14')](_0x2638b8);return _0x720c34['set'](_0xdf2d('0x18'),_0x4499ea+'-'+_0x3104b6+'/'+_0x5bf37f)['json'](_0x3a7767);}return null;};}function patchUpdates(_0x23c5f1){return function(_0x3185ed){try{jsonpatch[_0xdf2d('0x19')](_0x3185ed,_0x23c5f1,!![]);}catch(_0x28cfce){return BPromise[_0xdf2d('0x1a')](_0x28cfce);}return _0x3185ed[_0xdf2d('0x1b')]();};}function saveUpdates(_0x46f8a3,_0x2ef2c6){return function(_0xe8511a){if(_0xe8511a){return _0xe8511a[_0xdf2d('0x1c')](_0x46f8a3)[_0xdf2d('0x1d')](function(_0x2c0905){return _0x2c0905;});}return null;};}function removeEntity(_0x15fb55,_0x32b34b){return function(_0xc0c24e){if(_0xc0c24e){return _0xc0c24e[_0xdf2d('0x1e')]()[_0xdf2d('0x1d')](function(){_0x15fb55[_0xdf2d('0x14')](0xcc)[_0xdf2d('0x1f')]();});}};}function handleEntityNotFound(_0x4f5333,_0x5041a2){return function(_0x19ba8b){if(!_0x19ba8b){_0x4f5333[_0xdf2d('0x13')](0x194);}return _0x19ba8b;};}function handleError(_0x12eb3e,_0x3bed0b){_0x3bed0b=_0x3bed0b||0x1f4;return function(_0x13422f){logger['error'](_0x13422f[_0xdf2d('0x20')]);if(_0x13422f[_0xdf2d('0x21')]){delete _0x13422f[_0xdf2d('0x21')];}_0x12eb3e[_0xdf2d('0x14')](_0x3bed0b)[_0xdf2d('0x22')](_0x13422f);};}exports['index']=function(_0x116153,_0x55de28){var _0x4d112d={},_0x4cd025={},_0x459eec={'count':0x0,'rows':[]};var _0x3f7936=_[_0xdf2d('0x23')](db['ZendeskField']['rawAttributes'],function(_0x51c959){return{'name':_0x51c959[_0xdf2d('0x24')],'type':_0x51c959['type'][_0xdf2d('0x25')]};});_0x4cd025[_0xdf2d('0x26')]=_[_0xdf2d('0x23')](_0x3f7936,_0xdf2d('0x21'));_0x4cd025['query']=_[_0xdf2d('0x27')](_0x116153[_0xdf2d('0x28')]);_0x4cd025[_0xdf2d('0x29')]=_[_0xdf2d('0x2a')](_0x4cd025[_0xdf2d('0x26')],_0x4cd025['query']);_0x4d112d['attributes']=_[_0xdf2d('0x2a')](_0x4cd025['model'],qs[_0xdf2d('0x2b')](_0x116153[_0xdf2d('0x28')]['fields']));_0x4d112d[_0xdf2d('0x2c')]=_0x4d112d[_0xdf2d('0x2c')][_0xdf2d('0x2d')]?_0x4d112d[_0xdf2d('0x2c')]:_0x4cd025[_0xdf2d('0x26')];if(!_0x116153['query'][_0xdf2d('0x2e')]('nolimit')){_0x4d112d[_0xdf2d('0x2f')]=qs[_0xdf2d('0x2f')](_0x116153[_0xdf2d('0x28')][_0xdf2d('0x2f')]);_0x4d112d[_0xdf2d('0x15')]=qs['offset'](_0x116153[_0xdf2d('0x28')][_0xdf2d('0x15')]);}_0x4d112d[_0xdf2d('0x30')]=qs[_0xdf2d('0x31')](_0x116153[_0xdf2d('0x28')]['sort']);_0x4d112d[_0xdf2d('0x32')]=qs[_0xdf2d('0x29')](_[_0xdf2d('0x33')](_0x116153[_0xdf2d('0x28')],_0x4cd025['filters']),_0x3f7936);if(_0x116153[_0xdf2d('0x28')][_0xdf2d('0x34')]){_0x4d112d['where']=_[_0xdf2d('0x35')](_0x4d112d[_0xdf2d('0x32')],{'$or':_[_0xdf2d('0x23')](_0x3f7936,function(_0xd6d8e0){if(_0xd6d8e0['type']!==_0xdf2d('0x36')){var _0x19adbb={};_0x19adbb[_0xd6d8e0['name']]={'$like':'%'+_0x116153[_0xdf2d('0x28')][_0xdf2d('0x34')]+'%'};return _0x19adbb;}})});}_0x4d112d=_[_0xdf2d('0x35')]({},_0x4d112d,_0x116153[_0xdf2d('0x37')]);var _0x367027={'where':_0x4d112d[_0xdf2d('0x32')]};return db[_0xdf2d('0x38')][_0xdf2d('0x17')](_0x367027)[_0xdf2d('0x1d')](function(_0xa145f0){_0x459eec['count']=_0xa145f0;if(_0x116153[_0xdf2d('0x28')][_0xdf2d('0x39')]){_0x4d112d[_0xdf2d('0x3a')]=[{'all':!![]}];}return db[_0xdf2d('0x38')]['findAll'](_0x4d112d);})['then'](function(_0x14f045){_0x459eec['rows']=_0x14f045;return _0x459eec;})[_0xdf2d('0x1d')](respondWithFilteredResult(_0x55de28,_0x4d112d))[_0xdf2d('0x3b')](handleError(_0x55de28,null));};exports[_0xdf2d('0x3c')]=function(_0x2b8b63,_0x23add0){var _0x2a0a3d={'raw':!![],'where':{'id':_0x2b8b63[_0xdf2d('0x3d')]['id']}},_0x46cbe6={};_0x46cbe6[_0xdf2d('0x26')]=_['keys'](db['ZendeskField'][_0xdf2d('0x3e')]);_0x46cbe6[_0xdf2d('0x28')]=_['keys'](_0x2b8b63[_0xdf2d('0x28')]);_0x46cbe6[_0xdf2d('0x29')]=_['intersection'](_0x46cbe6[_0xdf2d('0x26')],_0x46cbe6['query']);_0x2a0a3d[_0xdf2d('0x2c')]=_[_0xdf2d('0x2a')](_0x46cbe6['model'],qs[_0xdf2d('0x2b')](_0x2b8b63[_0xdf2d('0x28')][_0xdf2d('0x2b')]));_0x2a0a3d[_0xdf2d('0x2c')]=_0x2a0a3d[_0xdf2d('0x2c')][_0xdf2d('0x2d')]?_0x2a0a3d[_0xdf2d('0x2c')]:_0x46cbe6[_0xdf2d('0x26')];if(_0x2b8b63['query'][_0xdf2d('0x39')]){_0x2a0a3d[_0xdf2d('0x3a')]=[{'all':!![]}];}_0x2a0a3d=_[_0xdf2d('0x35')]({},_0x2a0a3d,_0x2b8b63[_0xdf2d('0x37')]);return db[_0xdf2d('0x38')][_0xdf2d('0x3f')](_0x2a0a3d)[_0xdf2d('0x1d')](handleEntityNotFound(_0x23add0,null))[_0xdf2d('0x1d')](respondWithResult(_0x23add0,null))['catch'](handleError(_0x23add0,null));};exports[_0xdf2d('0x40')]=function(_0x24de18,_0x4e06d4){return db[_0xdf2d('0x38')][_0xdf2d('0x40')](_0x24de18[_0xdf2d('0x41')],{})[_0xdf2d('0x1d')](respondWithResult(_0x4e06d4,0xc9))[_0xdf2d('0x3b')](handleError(_0x4e06d4,null));};exports[_0xdf2d('0x1c')]=function(_0x219f7d,_0x190018){if(_0x219f7d[_0xdf2d('0x41')]['id']){delete _0x219f7d['body']['id'];}return db[_0xdf2d('0x38')][_0xdf2d('0x3f')]({'where':{'id':_0x219f7d[_0xdf2d('0x3d')]['id']}})[_0xdf2d('0x1d')](handleEntityNotFound(_0x190018,null))[_0xdf2d('0x1d')](saveUpdates(_0x219f7d[_0xdf2d('0x41')],null))[_0xdf2d('0x1d')](respondWithResult(_0x190018,null))[_0xdf2d('0x3b')](handleError(_0x190018,null));};exports[_0xdf2d('0x1e')]=function(_0x4ea20e,_0x3a99e1){return db['ZendeskField'][_0xdf2d('0x3f')]({'where':{'id':_0x4ea20e[_0xdf2d('0x3d')]['id']}})[_0xdf2d('0x1d')](handleEntityNotFound(_0x3a99e1,null))[_0xdf2d('0x1d')](removeEntity(_0x3a99e1,null))[_0xdf2d('0x3b')](handleError(_0x3a99e1,null));}; \ No newline at end of file +var _0x2180=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','ZendeskField','rawAttributes','fieldName','type','model','keys','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x1da988,_0x2acfae){var _0xaf122a=function(_0xe78762){while(--_0xe78762){_0x1da988['push'](_0x1da988['shift']());}};_0xaf122a(++_0x2acfae);}(_0x2180,0x11b));var _0x0218=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0x2180[_0x9b2bb0];return _0x2cdb3b;};'use strict';var emlformat=require(_0x0218('0x0'));var rimraf=require(_0x0218('0x1'));var zipdir=require(_0x0218('0x2'));var jsonpatch=require(_0x0218('0x3'));var rp=require(_0x0218('0x4'));var moment=require('moment');var BPromise=require(_0x0218('0x5'));var Mustache=require(_0x0218('0x6'));var util=require('util');var path=require(_0x0218('0x7'));var sox=require(_0x0218('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0218('0x9'));var _=require(_0x0218('0xa'));var squel=require(_0x0218('0xb'));var crypto=require(_0x0218('0xc'));var jsforce=require(_0x0218('0xd'));var deskjs=require(_0x0218('0xe'));var toCsv=require(_0x0218('0xf'));var querystring=require(_0x0218('0x10'));var Papa=require(_0x0218('0x11'));var Redis=require(_0x0218('0x12'));var authService=require(_0x0218('0x13'));var qs=require(_0x0218('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0218('0x15'));var logger=require(_0x0218('0x16'))(_0x0218('0x17'));var utils=require(_0x0218('0x18'));var config=require(_0x0218('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0218('0x1a'))['db'];function respondWithStatusCode(_0x6c8d7d,_0x334fae){_0x334fae=_0x334fae||0xcc;return function(_0x4ea449){if(_0x4ea449){return _0x6c8d7d[_0x0218('0x1b')](_0x334fae);}return _0x6c8d7d['status'](_0x334fae)[_0x0218('0x1c')]();};}function respondWithResult(_0x57a9b9,_0x2d8f1a){_0x2d8f1a=_0x2d8f1a||0xc8;return function(_0x2afe03){if(_0x2afe03){return _0x57a9b9[_0x0218('0x1d')](_0x2d8f1a)['json'](_0x2afe03);}};}function respondWithFilteredResult(_0x119410,_0x81eb2){return function(_0x464272){if(_0x464272){var _0x5263a7=typeof _0x81eb2['offset']===_0x0218('0x1e')&&typeof _0x81eb2[_0x0218('0x1f')]===_0x0218('0x1e');var _0x22048b=_0x464272[_0x0218('0x20')];var _0x5b375b=_0x5263a7?0x0:_0x81eb2[_0x0218('0x21')];var _0x3fe71b=_0x5263a7?_0x464272[_0x0218('0x20')]:_0x81eb2['offset']+_0x81eb2[_0x0218('0x1f')];var _0xc60fd;if(_0x3fe71b>=_0x22048b){_0x3fe71b=_0x22048b;_0xc60fd=0xc8;}else{_0xc60fd=0xce;}_0x119410[_0x0218('0x1d')](_0xc60fd);return _0x119410[_0x0218('0x22')](_0x0218('0x23'),_0x5b375b+'-'+_0x3fe71b+'/'+_0x22048b)['json'](_0x464272);}return null;};}function patchUpdates(_0xcd7e18){return function(_0x553c4e){try{jsonpatch[_0x0218('0x24')](_0x553c4e,_0xcd7e18,!![]);}catch(_0x13a0c0){return BPromise[_0x0218('0x25')](_0x13a0c0);}return _0x553c4e[_0x0218('0x26')]();};}function saveUpdates(_0x42a5ca,_0x3771e3){return function(_0x341409){if(_0x341409){return _0x341409[_0x0218('0x27')](_0x42a5ca)[_0x0218('0x28')](function(_0x2f2289){return _0x2f2289;});}return null;};}function removeEntity(_0x4f5adf,_0x4cf74d){return function(_0x1a4800){if(_0x1a4800){return _0x1a4800[_0x0218('0x29')]()[_0x0218('0x28')](function(){_0x4f5adf[_0x0218('0x1d')](0xcc)[_0x0218('0x1c')]();});}};}function handleEntityNotFound(_0x23ae83,_0x5f32e3){return function(_0x35d6bf){if(!_0x35d6bf){_0x23ae83[_0x0218('0x1b')](0x194);}return _0x35d6bf;};}function handleError(_0x570e30,_0x2d6ffb){_0x2d6ffb=_0x2d6ffb||0x1f4;return function(_0x36938d){logger['error'](_0x36938d['stack']);if(_0x36938d[_0x0218('0x2a')]){delete _0x36938d[_0x0218('0x2a')];}_0x570e30['status'](_0x2d6ffb)[_0x0218('0x2b')](_0x36938d);};}exports['index']=function(_0x35fd25,_0x2237ed){var _0x46a2af={},_0x2b9be8={},_0x22180d={'count':0x0,'rows':[]};var _0x21a631=_[_0x0218('0x2c')](db[_0x0218('0x2d')][_0x0218('0x2e')],function(_0xa8f41){return{'name':_0xa8f41[_0x0218('0x2f')],'type':_0xa8f41[_0x0218('0x30')]['key']};});_0x2b9be8[_0x0218('0x31')]=_['map'](_0x21a631,_0x0218('0x2a'));_0x2b9be8['query']=_[_0x0218('0x32')](_0x35fd25['query']);_0x2b9be8[_0x0218('0x33')]=_['intersection'](_0x2b9be8[_0x0218('0x31')],_0x2b9be8['query']);_0x46a2af['attributes']=_[_0x0218('0x34')](_0x2b9be8[_0x0218('0x31')],qs[_0x0218('0x35')](_0x35fd25['query']['fields']));_0x46a2af['attributes']=_0x46a2af[_0x0218('0x36')][_0x0218('0x37')]?_0x46a2af[_0x0218('0x36')]:_0x2b9be8['model'];if(!_0x35fd25[_0x0218('0x38')][_0x0218('0x39')](_0x0218('0x3a'))){_0x46a2af[_0x0218('0x1f')]=qs[_0x0218('0x1f')](_0x35fd25[_0x0218('0x38')][_0x0218('0x1f')]);_0x46a2af[_0x0218('0x21')]=qs[_0x0218('0x21')](_0x35fd25[_0x0218('0x38')][_0x0218('0x21')]);}_0x46a2af['order']=qs['sort'](_0x35fd25[_0x0218('0x38')][_0x0218('0x3b')]);_0x46a2af[_0x0218('0x3c')]=qs[_0x0218('0x33')](_[_0x0218('0x3d')](_0x35fd25['query'],_0x2b9be8['filters']),_0x21a631);if(_0x35fd25['query'][_0x0218('0x3e')]){_0x46a2af['where']=_[_0x0218('0x3f')](_0x46a2af['where'],{'$or':_[_0x0218('0x2c')](_0x21a631,function(_0x1d99a5){if(_0x1d99a5[_0x0218('0x30')]!=='VIRTUAL'){var _0x15e03a={};_0x15e03a[_0x1d99a5[_0x0218('0x2a')]]={'$like':'%'+_0x35fd25[_0x0218('0x38')]['filter']+'%'};return _0x15e03a;}})});}_0x46a2af=_[_0x0218('0x3f')]({},_0x46a2af,_0x35fd25[_0x0218('0x40')]);var _0x327b88={'where':_0x46a2af['where']};return db[_0x0218('0x2d')][_0x0218('0x20')](_0x327b88)[_0x0218('0x28')](function(_0x4fa80e){_0x22180d[_0x0218('0x20')]=_0x4fa80e;if(_0x35fd25['query'][_0x0218('0x41')]){_0x46a2af[_0x0218('0x42')]=[{'all':!![]}];}return db[_0x0218('0x2d')][_0x0218('0x43')](_0x46a2af);})[_0x0218('0x28')](function(_0x5b8403){_0x22180d[_0x0218('0x44')]=_0x5b8403;return _0x22180d;})['then'](respondWithFilteredResult(_0x2237ed,_0x46a2af))[_0x0218('0x45')](handleError(_0x2237ed,null));};exports[_0x0218('0x46')]=function(_0x47c17e,_0x1ee38c){var _0x2cac98={'raw':!![],'where':{'id':_0x47c17e[_0x0218('0x47')]['id']}},_0x4e85fd={};_0x4e85fd['model']=_[_0x0218('0x32')](db['ZendeskField'][_0x0218('0x2e')]);_0x4e85fd[_0x0218('0x38')]=_[_0x0218('0x32')](_0x47c17e[_0x0218('0x38')]);_0x4e85fd[_0x0218('0x33')]=_[_0x0218('0x34')](_0x4e85fd[_0x0218('0x31')],_0x4e85fd['query']);_0x2cac98[_0x0218('0x36')]=_['intersection'](_0x4e85fd[_0x0218('0x31')],qs['fields'](_0x47c17e[_0x0218('0x38')][_0x0218('0x35')]));_0x2cac98['attributes']=_0x2cac98[_0x0218('0x36')]['length']?_0x2cac98[_0x0218('0x36')]:_0x4e85fd[_0x0218('0x31')];if(_0x47c17e[_0x0218('0x38')][_0x0218('0x41')]){_0x2cac98['include']=[{'all':!![]}];}_0x2cac98=_[_0x0218('0x3f')]({},_0x2cac98,_0x47c17e['options']);return db[_0x0218('0x2d')][_0x0218('0x48')](_0x2cac98)[_0x0218('0x28')](handleEntityNotFound(_0x1ee38c,null))[_0x0218('0x28')](respondWithResult(_0x1ee38c,null))[_0x0218('0x45')](handleError(_0x1ee38c,null));};exports[_0x0218('0x49')]=function(_0x344090,_0x351a90){return db['ZendeskField']['create'](_0x344090[_0x0218('0x4a')],{})[_0x0218('0x28')](respondWithResult(_0x351a90,0xc9))[_0x0218('0x45')](handleError(_0x351a90,null));};exports['update']=function(_0x1c5470,_0x12fe12){if(_0x1c5470[_0x0218('0x4a')]['id']){delete _0x1c5470[_0x0218('0x4a')]['id'];}return db[_0x0218('0x2d')]['find']({'where':{'id':_0x1c5470[_0x0218('0x47')]['id']}})[_0x0218('0x28')](handleEntityNotFound(_0x12fe12,null))[_0x0218('0x28')](saveUpdates(_0x1c5470['body'],null))[_0x0218('0x28')](respondWithResult(_0x12fe12,null))[_0x0218('0x45')](handleError(_0x12fe12,null));};exports[_0x0218('0x29')]=function(_0x516a0d,_0x5d9f4b){return db[_0x0218('0x2d')][_0x0218('0x48')]({'where':{'id':_0x516a0d[_0x0218('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d9f4b,null))[_0x0218('0x28')](removeEntity(_0x5d9f4b,null))[_0x0218('0x45')](handleError(_0x5d9f4b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 663d1aa..337d1cd 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 _0x6f6d=['rimraf','../../config/environment','exports','define','ZendeskField','zendesk_unique_index','FieldId','util','../../config/logger','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f6d,0xa3));var _0xd6f6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6f6d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xd6f6('0x0'));var logger=require(_0xd6f6('0x1'))(_0xd6f6('0x2'));var moment=require(_0xd6f6('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6f6('0x5'));var config=require(_0xd6f6('0x6'));var attributes=require('./intZendeskField.attributes');module[_0xd6f6('0x7')]=function(_0x45ab2e,_0x5447f6){return _0x45ab2e[_0xd6f6('0x8')](_0xd6f6('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xd6f6('0xa'),'fields':['idField',_0xd6f6('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf446=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','ZendeskField','int_zendesk_fields','idField','lodash'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf446,0x11d));var _0x6f44=function(_0x1f7e47,_0x516078){_0x1f7e47=_0x1f7e47-0x0;var _0x5f36bf=_0xf446[_0x1f7e47];return _0x5f36bf;};'use strict';var _=require(_0x6f44('0x0'));var util=require(_0x6f44('0x1'));var logger=require(_0x6f44('0x2'))(_0x6f44('0x3'));var moment=require(_0x6f44('0x4'));var BPromise=require(_0x6f44('0x5'));var rp=require(_0x6f44('0x6'));var fs=require('fs');var path=require(_0x6f44('0x7'));var rimraf=require('rimraf');var config=require(_0x6f44('0x8'));var attributes=require(_0x6f44('0x9'));module['exports']=function(_0x2c2ac7,_0x35d3a6){return _0x2c2ac7['define'](_0x6f44('0xa'),attributes,{'tableName':_0x6f44('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x6f44('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index fa3d049..a3a6797 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 _0x8586=['client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x1feda6,_0x3f7180){var _0x51cfba=function(_0x5106c4){while(--_0x5106c4){_0x1feda6['push'](_0x1feda6['shift']());}};_0x51cfba(++_0x3f7180);}(_0x8586,0x6f));var _0x6858=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0x8586[_0xdd2348];return _0x2e0a02;};'use strict';var _=require('lodash');var util=require(_0x6858('0x0'));var moment=require(_0x6858('0x1'));var BPromise=require(_0x6858('0x2'));var rs=require(_0x6858('0x3'));var fs=require('fs');var Redis=require(_0x6858('0x4'));var db=require(_0x6858('0x5'))['db'];var utils=require(_0x6858('0x6'));var logger=require('../../config/logger')(_0x6858('0x7'));var config=require('../../config/environment');var jayson=require(_0x6858('0x8'));var client=jayson[_0x6858('0x9')][_0x6858('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f4191,_0x3f3a53,_0x10e953){return new BPromise(function(_0x519557,_0x558532){return client[_0x6858('0xb')](_0x3f4191,_0x10e953)[_0x6858('0xc')](function(_0x48883b){logger[_0x6858('0xd')](_0x6858('0xe'),_0x3f3a53,_0x6858('0xf'));logger[_0x6858('0x10')](_0x6858('0x11'),_0x3f3a53,'request\x20sent',JSON[_0x6858('0x12')](_0x48883b));if(_0x48883b[_0x6858('0x13')]){if(_0x48883b[_0x6858('0x13')][_0x6858('0x14')]===0x1f4){logger[_0x6858('0x13')](_0x6858('0xe'),_0x3f3a53,_0x48883b['error']['message']);return _0x558532(_0x48883b[_0x6858('0x13')][_0x6858('0x15')]);}logger[_0x6858('0x13')](_0x6858('0xe'),_0x3f3a53,_0x48883b[_0x6858('0x13')][_0x6858('0x15')]);return _0x519557(_0x48883b[_0x6858('0x13')][_0x6858('0x15')]);}else{logger[_0x6858('0xd')](_0x6858('0xe'),_0x3f3a53,_0x6858('0xf'));_0x519557(_0x48883b[_0x6858('0x16')][_0x6858('0x15')]);}})[_0x6858('0x17')](function(_0x6fc4c6){logger[_0x6858('0x13')](_0x6858('0xe'),_0x3f3a53,_0x6fc4c6);_0x558532(_0x6fc4c6);});});} \ No newline at end of file +var _0x436f=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','info'];(function(_0x417aa6,_0x401f42){var _0x46e3bc=function(_0x361de5){while(--_0x361de5){_0x417aa6['push'](_0x417aa6['shift']());}};_0x46e3bc(++_0x401f42);}(_0x436f,0x106));var _0xf436=function(_0x10ad5d,_0x574bf4){_0x10ad5d=_0x10ad5d-0x0;var _0x48cae3=_0x436f[_0x10ad5d];return _0x48cae3;};'use strict';var _=require(_0xf436('0x0'));var util=require(_0xf436('0x1'));var moment=require(_0xf436('0x2'));var BPromise=require(_0xf436('0x3'));var rs=require(_0xf436('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf436('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf436('0x6'));var config=require(_0xf436('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf436('0x8')][_0xf436('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa9f9f7,_0x38f01d,_0x151f50){return new BPromise(function(_0x26053e,_0x115787){return client['request'](_0xa9f9f7,_0x151f50)['then'](function(_0x561da9){logger[_0xf436('0xa')](_0xf436('0xb'),_0x38f01d,_0xf436('0xc'));logger[_0xf436('0xd')](_0xf436('0xe'),_0x38f01d,_0xf436('0xc'),JSON[_0xf436('0xf')](_0x561da9));if(_0x561da9['error']){if(_0x561da9[_0xf436('0x10')][_0xf436('0x11')]===0x1f4){logger[_0xf436('0x10')](_0xf436('0xb'),_0x38f01d,_0x561da9[_0xf436('0x10')][_0xf436('0x12')]);return _0x115787(_0x561da9[_0xf436('0x10')][_0xf436('0x12')]);}logger[_0xf436('0x10')]('ZendeskField,\x20%s,\x20%s',_0x38f01d,_0x561da9[_0xf436('0x10')][_0xf436('0x12')]);return _0x26053e(_0x561da9[_0xf436('0x10')]['message']);}else{logger[_0xf436('0xa')](_0xf436('0xb'),_0x38f01d,_0xf436('0xc'));_0x26053e(_0x561da9[_0xf436('0x13')]['message']);}})[_0xf436('0x14')](function(_0x3b6d3f){logger[_0xf436('0x10')](_0xf436('0xb'),_0x38f01d,_0x3b6d3f);_0x115787(_0x3b6d3f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 0320d0c..e668eee 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 _0x416b=['get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller'];(function(_0x136232,_0x52fb30){var _0x597776=function(_0x148375){while(--_0x148375){_0x136232['push'](_0x136232['shift']());}};_0x597776(++_0x52fb30);}(_0x416b,0x1d9));var _0xb416=function(_0x28237e,_0x2a7f11){_0x28237e=_0x28237e-0x0;var _0x1c014b=_0x416b[_0x28237e];return _0x1c014b;};'use strict';var multer=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var path=require(_0xb416('0x2'));var timeout=require(_0xb416('0x3'));var express=require(_0xb416('0x4'));var router=express['Router']();var fs_extra=require(_0xb416('0x5'));var auth=require(_0xb416('0x6'));var interaction=require(_0xb416('0x7'));var config=require(_0xb416('0x8'));var controller=require(_0xb416('0x9'));router[_0xb416('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb416('0xb'),auth[_0xb416('0xc')](),controller[_0xb416('0xd')]);router[_0xb416('0xa')](_0xb416('0xe'),auth[_0xb416('0xc')](),controller[_0xb416('0xf')]);router[_0xb416('0xa')](_0xb416('0x10'),auth[_0xb416('0xc')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb416('0x11')](_0xb416('0xe'),auth[_0xb416('0xc')](),controller[_0xb416('0x12')]);router['put'](_0xb416('0xb'),auth['isAuthenticated'](),controller[_0xb416('0x13')]);router[_0xb416('0x14')](_0xb416('0xb'),auth[_0xb416('0xc')](),controller[_0xb416('0x15')]);module[_0xb416('0x16')]=router; \ No newline at end of file +var _0x6af2=['addConfiguration','delete','/:id','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x1f5b17,_0x29c9c7){var _0x3161e1=function(_0x52ef4f){while(--_0x52ef4f){_0x1f5b17['push'](_0x1f5b17['shift']());}};_0x3161e1(++_0x29c9c7);}(_0x6af2,0x1e1));var _0x26af=function(_0x106b4c,_0x2f0072){_0x106b4c=_0x106b4c-0x0;var _0x554652=_0x6af2[_0x106b4c];return _0x554652;};'use strict';var multer=require(_0x26af('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x26af('0x1'));var express=require(_0x26af('0x2'));var router=express['Router']();var fs_extra=require(_0x26af('0x3'));var auth=require(_0x26af('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x26af('0x5'));var controller=require(_0x26af('0x6'));router[_0x26af('0x7')]('/',auth[_0x26af('0x8')](),controller['index']);router['get']('/:id',auth[_0x26af('0x8')](),controller['show']);router['get'](_0x26af('0x9'),auth[_0x26af('0x8')](),controller[_0x26af('0xa')]);router[_0x26af('0x7')](_0x26af('0xb'),auth[_0x26af('0x8')](),controller['getFields']);router['post']('/',auth[_0x26af('0x8')](),controller['create']);router['post'](_0x26af('0x9'),auth[_0x26af('0x8')](),controller[_0x26af('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x26af('0xd')](_0x26af('0xe'),auth['isAuthenticated'](),controller[_0x26af('0xf')]);module[_0x26af('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 30245bb..aa27246 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 _0x22fb=['STRING'];(function(_0x2566ca,_0x199004){var _0x4b53d4=function(_0x2bebdd){while(--_0x2bebdd){_0x2566ca['push'](_0x2566ca['shift']());}};_0x4b53d4(++_0x199004);}(_0x22fb,0x192));var _0xb22f=function(_0x1e8dc6,_0x4eda23){_0x1e8dc6=_0x1e8dc6-0x0;var _0x5acd73=_0x22fb[_0x1e8dc6];return _0x5acd73;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file +var _0x9c44=['STRING'];(function(_0xf3b525,_0x419b48){var _0x1f98b3=function(_0x1050c9){while(--_0x1050c9){_0xf3b525['push'](_0xf3b525['shift']());}};_0x1f98b3(++_0x419b48);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 44c4421..0c81ca3 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 _0xbaa6=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','show','length','find','catch','create','body','params','ZohoConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','Descriptions','channel','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Call_Result','Call_Type','api_name','push','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x19ae48,_0x376bb4){var _0x2699a2=function(_0x3c62ff){while(--_0x3c62ff){_0x19ae48['push'](_0x19ae48['shift']());}};_0x2699a2(++_0x376bb4);}(_0xbaa6,0x156));var _0x6baa=function(_0x1ba9bd,_0x3299e8){_0x1ba9bd=_0x1ba9bd-0x0;var _0x19aae2=_0xbaa6[_0x1ba9bd];return _0x19aae2;};'use strict';var emlformat=require(_0x6baa('0x0'));var rimraf=require(_0x6baa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6baa('0x2'));var rp=require('request-promise');var moment=require(_0x6baa('0x3'));var BPromise=require(_0x6baa('0x4'));var Mustache=require(_0x6baa('0x5'));var util=require(_0x6baa('0x6'));var path=require(_0x6baa('0x7'));var sox=require(_0x6baa('0x8'));var csv=require(_0x6baa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6baa('0xa'));var _=require('lodash');var squel=require(_0x6baa('0xb'));var crypto=require(_0x6baa('0xc'));var jsforce=require(_0x6baa('0xd'));var deskjs=require(_0x6baa('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6baa('0xf'));var authService=require(_0x6baa('0x10'));var qs=require(_0x6baa('0x11'));var as=require(_0x6baa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6baa('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6baa('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3d269a,_0x295ca3){_0x295ca3=_0x295ca3||0xcc;return function(_0x2c7ee7){if(_0x2c7ee7){return _0x3d269a[_0x6baa('0x15')](_0x295ca3);}return _0x3d269a['status'](_0x295ca3)['end']();};}function respondWithResult(_0x1acefd,_0x197315){_0x197315=_0x197315||0xc8;return function(_0x183dfe){if(_0x183dfe){return _0x1acefd[_0x6baa('0x16')](_0x197315)[_0x6baa('0x17')](_0x183dfe);}};}function respondWithFilteredResult(_0x3007ad,_0x3dbb54){return function(_0x3bd17d){if(_0x3bd17d){var _0x23c966=typeof _0x3dbb54[_0x6baa('0x18')]===_0x6baa('0x19')&&typeof _0x3dbb54[_0x6baa('0x1a')]===_0x6baa('0x19');var _0x517d35=_0x3bd17d[_0x6baa('0x1b')];var _0xacf36=_0x23c966?0x0:_0x3dbb54[_0x6baa('0x18')];var _0x23689c=_0x23c966?_0x3bd17d[_0x6baa('0x1b')]:_0x3dbb54['offset']+_0x3dbb54[_0x6baa('0x1a')];var _0x5cc198;if(_0x23689c>=_0x517d35){_0x23689c=_0x517d35;_0x5cc198=0xc8;}else{_0x5cc198=0xce;}_0x3007ad[_0x6baa('0x16')](_0x5cc198);return _0x3007ad[_0x6baa('0x1c')](_0x6baa('0x1d'),_0xacf36+'-'+_0x23689c+'/'+_0x517d35)['json'](_0x3bd17d);}return null;};}function patchUpdates(_0x5e9b6c){return function(_0x3d59f5){try{jsonpatch[_0x6baa('0x1e')](_0x3d59f5,_0x5e9b6c,!![]);}catch(_0x524696){return BPromise[_0x6baa('0x1f')](_0x524696);}return _0x3d59f5[_0x6baa('0x20')]();};}function saveUpdates(_0x2e5326,_0x1f1359){return function(_0x382914){if(_0x382914){return _0x382914[_0x6baa('0x21')](_0x2e5326)['then'](function(_0x887706){return _0x887706;});}return null;};}function removeEntity(_0x3cd297,_0x57adfc){return function(_0x15366e){if(_0x15366e){return _0x15366e[_0x6baa('0x22')]()[_0x6baa('0x23')](function(){_0x3cd297[_0x6baa('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x62bac7,_0x5f1071){return function(_0x1f038b){if(!_0x1f038b){_0x62bac7[_0x6baa('0x15')](0x194);}return _0x1f038b;};}function handleError(_0x529f00,_0x194979){_0x194979=_0x194979||0x1f4;return function(_0x2def7d){logger['error'](_0x2def7d['stack']);if(_0x2def7d[_0x6baa('0x24')]){delete _0x2def7d[_0x6baa('0x24')];}_0x529f00[_0x6baa('0x16')](_0x194979)[_0x6baa('0x25')](_0x2def7d);};}exports['index']=function(_0x5a2599,_0xb02ddb){var _0x517c3e={},_0x56f34a={},_0x530ef5={'count':0x0,'rows':[]};var _0x2265d8=_[_0x6baa('0x26')](db[_0x6baa('0x27')][_0x6baa('0x28')],function(_0x1a7c99){return{'name':_0x1a7c99[_0x6baa('0x29')],'type':_0x1a7c99[_0x6baa('0x2a')][_0x6baa('0x2b')]};});_0x56f34a[_0x6baa('0x2c')]=_[_0x6baa('0x26')](_0x2265d8,_0x6baa('0x24'));_0x56f34a[_0x6baa('0x2d')]=_[_0x6baa('0x2e')](_0x5a2599[_0x6baa('0x2d')]);_0x56f34a['filters']=_[_0x6baa('0x2f')](_0x56f34a['model'],_0x56f34a[_0x6baa('0x2d')]);_0x517c3e[_0x6baa('0x30')]=_[_0x6baa('0x2f')](_0x56f34a[_0x6baa('0x2c')],qs['fields'](_0x5a2599[_0x6baa('0x2d')][_0x6baa('0x31')]));_0x517c3e['attributes']=_0x517c3e['attributes']['length']?_0x517c3e[_0x6baa('0x30')]:_0x56f34a[_0x6baa('0x2c')];if(!_0x5a2599['query'][_0x6baa('0x32')](_0x6baa('0x33'))){_0x517c3e[_0x6baa('0x1a')]=qs['limit'](_0x5a2599[_0x6baa('0x2d')][_0x6baa('0x1a')]);_0x517c3e[_0x6baa('0x18')]=qs[_0x6baa('0x18')](_0x5a2599['query'][_0x6baa('0x18')]);}_0x517c3e[_0x6baa('0x34')]=qs[_0x6baa('0x35')](_0x5a2599['query']['sort']);_0x517c3e[_0x6baa('0x36')]=qs['filters'](_[_0x6baa('0x37')](_0x5a2599[_0x6baa('0x2d')],_0x56f34a[_0x6baa('0x38')]),_0x2265d8);if(_0x5a2599[_0x6baa('0x2d')][_0x6baa('0x39')]){_0x517c3e[_0x6baa('0x36')]=_[_0x6baa('0x3a')](_0x517c3e[_0x6baa('0x36')],{'$or':_[_0x6baa('0x26')](_0x2265d8,function(_0x1fda1b){if(_0x1fda1b[_0x6baa('0x2a')]!==_0x6baa('0x3b')){var _0x426bd0={};_0x426bd0[_0x1fda1b[_0x6baa('0x24')]]={'$like':'%'+_0x5a2599[_0x6baa('0x2d')]['filter']+'%'};return _0x426bd0;}})});}_0x517c3e=_[_0x6baa('0x3a')]({},_0x517c3e,_0x5a2599[_0x6baa('0x3c')]);var _0x47963c={'where':_0x517c3e[_0x6baa('0x36')]};return db[_0x6baa('0x27')]['count'](_0x47963c)[_0x6baa('0x23')](function(_0x1c0240){_0x530ef5['count']=_0x1c0240;if(_0x5a2599['query']['includeAll']){_0x517c3e[_0x6baa('0x3d')]=[{'all':!![]}];}return db[_0x6baa('0x27')][_0x6baa('0x3e')](_0x517c3e);})[_0x6baa('0x23')](function(_0x438cc3){_0x530ef5['rows']=_0x438cc3;return _0x530ef5;})[_0x6baa('0x23')](respondWithFilteredResult(_0xb02ddb,_0x517c3e))['catch'](handleError(_0xb02ddb,null));};exports[_0x6baa('0x3f')]=function(_0x27c7ff,_0x4b640b){var _0x3f33a2={'raw':![],'where':{'id':_0x27c7ff['params']['id']}},_0xe691b4={};_0xe691b4[_0x6baa('0x2c')]=_[_0x6baa('0x2e')](db[_0x6baa('0x27')][_0x6baa('0x28')]);_0xe691b4[_0x6baa('0x2d')]=_[_0x6baa('0x2e')](_0x27c7ff[_0x6baa('0x2d')]);_0xe691b4[_0x6baa('0x38')]=_['intersection'](_0xe691b4[_0x6baa('0x2c')],_0xe691b4['query']);_0x3f33a2[_0x6baa('0x30')]=_[_0x6baa('0x2f')](_0xe691b4[_0x6baa('0x2c')],qs['fields'](_0x27c7ff[_0x6baa('0x2d')]['fields']));_0x3f33a2[_0x6baa('0x30')]=_0x3f33a2[_0x6baa('0x30')][_0x6baa('0x40')]?_0x3f33a2[_0x6baa('0x30')]:_0xe691b4[_0x6baa('0x2c')];if(_0x27c7ff['query']['includeAll']){_0x3f33a2[_0x6baa('0x3d')]=[{'all':!![]}];}_0x3f33a2=_[_0x6baa('0x3a')]({},_0x3f33a2,_0x27c7ff[_0x6baa('0x3c')]);return db['ZohoAccount'][_0x6baa('0x41')](_0x3f33a2)[_0x6baa('0x23')](handleEntityNotFound(_0x4b640b,null))['then'](respondWithResult(_0x4b640b,null))[_0x6baa('0x42')](handleError(_0x4b640b,null));};exports[_0x6baa('0x43')]=function(_0x34c2be,_0x49edf4){return db['ZohoAccount']['create'](_0x34c2be[_0x6baa('0x44')],{})['then'](respondWithResult(_0x49edf4,0xc9))['catch'](handleError(_0x49edf4,null));};exports[_0x6baa('0x21')]=function(_0x297d58,_0x561599){if(_0x297d58[_0x6baa('0x44')]['id']){delete _0x297d58[_0x6baa('0x44')]['id'];}return db['ZohoAccount'][_0x6baa('0x41')]({'where':{'id':_0x297d58[_0x6baa('0x45')]['id']}})[_0x6baa('0x23')](handleEntityNotFound(_0x561599,null))[_0x6baa('0x23')](saveUpdates(_0x297d58[_0x6baa('0x44')],null))['then'](respondWithResult(_0x561599,null))['catch'](handleError(_0x561599,null));};exports[_0x6baa('0x22')]=function(_0x1947af,_0xd2296c){return db[_0x6baa('0x27')][_0x6baa('0x41')]({'where':{'id':_0x1947af[_0x6baa('0x45')]['id']}})[_0x6baa('0x23')](handleEntityNotFound(_0xd2296c,null))[_0x6baa('0x23')](removeEntity(_0xd2296c,null))[_0x6baa('0x42')](handleError(_0xd2296c,null));};exports['getConfigurations']=function(_0x347a99,_0x121029,_0x18138f){var _0x14f3d4={};var _0x460a02={};var _0x1e348a;var _0x559d35;return db[_0x6baa('0x27')]['findOne']({'where':{'id':_0x347a99['params']['id']}})[_0x6baa('0x23')](handleEntityNotFound(_0x121029,null))[_0x6baa('0x23')](function(_0x2fcedd){if(_0x2fcedd){_0x1e348a=_0x2fcedd;_0x460a02['model']=_[_0x6baa('0x2e')](db[_0x6baa('0x46')][_0x6baa('0x28')]);_0x460a02[_0x6baa('0x2d')]=_[_0x6baa('0x2e')](_0x347a99[_0x6baa('0x2d')]);_0x460a02[_0x6baa('0x38')]=_[_0x6baa('0x2f')](_0x460a02[_0x6baa('0x2c')],_0x460a02[_0x6baa('0x2d')]);_0x14f3d4[_0x6baa('0x30')]=_['intersection'](_0x460a02[_0x6baa('0x2c')],qs[_0x6baa('0x31')](_0x347a99[_0x6baa('0x2d')][_0x6baa('0x31')]));_0x14f3d4[_0x6baa('0x30')]=_0x14f3d4[_0x6baa('0x30')][_0x6baa('0x40')]?_0x14f3d4['attributes']:_0x460a02[_0x6baa('0x2c')];_0x14f3d4[_0x6baa('0x34')]=qs[_0x6baa('0x35')](_0x347a99[_0x6baa('0x2d')][_0x6baa('0x35')]);_0x14f3d4[_0x6baa('0x36')]=qs['filters'](_[_0x6baa('0x37')](_0x347a99[_0x6baa('0x2d')],_0x460a02[_0x6baa('0x38')]));if(_0x347a99[_0x6baa('0x2d')][_0x6baa('0x39')]){_0x14f3d4['where']=_[_0x6baa('0x3a')](_0x14f3d4['where'],{'$or':_[_0x6baa('0x26')](_0x14f3d4['attributes'],function(_0x12ceee){var _0xb71a6a={};_0xb71a6a[_0x12ceee]={'$like':'%'+_0x347a99[_0x6baa('0x2d')][_0x6baa('0x39')]+'%'};return _0xb71a6a;})});}_0x14f3d4=_[_0x6baa('0x3a')]({},_0x14f3d4,_0x347a99['options']);return _0x1e348a[_0x6baa('0x47')](_0x14f3d4);}})[_0x6baa('0x23')](function(_0x51a2cf){if(_0x51a2cf){_0x559d35=_0x51a2cf[_0x6baa('0x40')];if(!_0x347a99[_0x6baa('0x2d')][_0x6baa('0x32')]('nolimit')){_0x14f3d4[_0x6baa('0x1a')]=qs[_0x6baa('0x1a')](_0x347a99[_0x6baa('0x2d')][_0x6baa('0x1a')]);_0x14f3d4[_0x6baa('0x18')]=qs[_0x6baa('0x18')](_0x347a99[_0x6baa('0x2d')][_0x6baa('0x18')]);}return _0x1e348a[_0x6baa('0x47')](_0x14f3d4);}})[_0x6baa('0x23')](function(_0x25505e){if(_0x25505e){return _0x25505e?{'count':_0x559d35,'rows':_0x25505e}:null;}})[_0x6baa('0x23')](respondWithResult(_0x121029,null))[_0x6baa('0x42')](handleError(_0x121029,null));};exports[_0x6baa('0x48')]=function(_0x27c4c1,_0x228e4a,_0x28f143){if(_0x27c4c1[_0x6baa('0x44')]['id']){delete _0x27c4c1[_0x6baa('0x44')]['id'];}return db['ZohoAccount'][_0x6baa('0x49')]({'where':{'id':_0x27c4c1[_0x6baa('0x45')]['id']}})[_0x6baa('0x23')](handleEntityNotFound(_0x228e4a,null))[_0x6baa('0x23')](function(_0x3374bd){if(_0x3374bd){_0x27c4c1[_0x6baa('0x44')]['AccountId']=_0x3374bd['id'];_0x27c4c1[_0x6baa('0x44')][_0x6baa('0x4a')]=integrations[_0x6baa('0x4b')](_0x27c4c1[_0x6baa('0x44')]['channel'],_0x27c4c1[_0x6baa('0x44')][_0x6baa('0x2a')]);_0x27c4c1['body'][_0x6baa('0x4c')]=integrations['getDescriptions'](_0x27c4c1[_0x6baa('0x44')][_0x6baa('0x4d')],_0x27c4c1[_0x6baa('0x44')][_0x6baa('0x2a')]);return db[_0x6baa('0x46')][_0x6baa('0x43')](_0x27c4c1[_0x6baa('0x44')],{'include':[{'model':db[_0x6baa('0x4e')],'as':_0x6baa('0x4a')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x228e4a,null))[_0x6baa('0x42')](handleError(_0x228e4a,null));};function getAccessToken(_0x317a71){return new Promise(function(_0x39af15,_0xedd297){var _0x1d7a12;switch(_0x317a71['zone']){case'US':_0x1d7a12=_0x6baa('0x4f');break;case'AU':_0x1d7a12='https://accounts.zoho.com.au';break;case'EU':_0x1d7a12=_0x6baa('0x50');break;case'IN':_0x1d7a12=_0x6baa('0x51');break;case'CN':_0x1d7a12=_0x6baa('0x52');break;default:_0x1d7a12=_0x6baa('0x50');break;}var _0x1de081={'method':'POST','uri':_0x1d7a12+_0x6baa('0x53'),'qs':{'refresh_token':_0x317a71['refreshToken'],'client_id':_0x317a71[_0x6baa('0x54')],'client_secret':_0x317a71[_0x6baa('0x55')],'grant_type':_0x6baa('0x56')},'json':!![]};return rp(_0x1de081)[_0x6baa('0x23')](function(_0x3c7af4){if(_0x3c7af4[_0x6baa('0x57')]){_0x39af15(_0x3c7af4[_0x6baa('0x57')]);}else{_0xedd297(_0x6baa('0x58'));}})[_0x6baa('0x42')](function(_0x2eb666){_0xedd297(_0x2eb666);});});}exports['getFields']=function(_0x462283,_0x427a62,_0x10bb7d){var _0x492e73,_0x4f87be,_0x153180,_0x33445c,_0x161d9c;return db[_0x6baa('0x27')][_0x6baa('0x49')]({'where':{'id':_0x462283['params']['id']},'attributes':['id',_0x6baa('0x59'),'zone',_0x6baa('0x54'),_0x6baa('0x55'),_0x6baa('0x5a'),_0x6baa('0x5b'),_0x6baa('0x5c')]})[_0x6baa('0x23')](handleEntityNotFound(_0x427a62,null))[_0x6baa('0x23')](function(_0xe392e3){_0x161d9c=_0xe392e3;_0x492e73=_0x161d9c['host'];_0x4f87be=_0x492e73===_0x6baa('0x5d')?'eu':_0x6baa('0x5e');_0x153180=_0x161d9c[_0x6baa('0x5a')];var _0x3a2488=_0x153180[_0x6baa('0x5f')](-0x1);if(_0x3a2488==='/'||_0x3a2488==='\x5c'||_0x3a2488===':'){_0x153180=_0x153180[_0x6baa('0x60')](0x0,_0x153180[_0x6baa('0x61')](_0x3a2488));}if(!_0x161d9c[_0x6baa('0x5c')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x161d9c);})[_0x6baa('0x23')](function(_0x105607){if(_0x105607){return rp({'method':_0x6baa('0x62'),'uri':util[_0x6baa('0x63')](_0x6baa('0x64'),_0x4f87be),'qs':{'module':_0x6baa('0x65')},'headers':{'Authorization':_0x6baa('0x66')+_0x105607},'json':!![]});}})[_0x6baa('0x23')](function(_0x567aa2){if(_0x567aa2){if(_0x567aa2[_0x6baa('0x67')]&&_0x567aa2[_0x6baa('0x67')][_0x6baa('0x68')]){throw new Error(_0x567aa2[_0x6baa('0x67')][_0x6baa('0x68')][_0x6baa('0x69')]);}var _0x15b295=[];var _0x26497e=[];var _0x526e6a=[_0x6baa('0x6a'),'Subject','Description','WhoId','Call_Duration',_0x6baa('0x6b'),'Call_Start_Time',_0x6baa('0x6c')];_0x26497e=_['remove'](_0x567aa2[_0x6baa('0x31')],function(_0x23db7b){return _0x526e6a['includes'](_0x23db7b[_0x6baa('0x6d')]);});for(var _0x4da656=0x0;_0x4da656<_0x26497e[_0x6baa('0x40')];_0x4da656++){if(_0x26497e[_0x4da656]['system_mandatory']===![]){_0x15b295[_0x6baa('0x6e')]({'id':_0x26497e[_0x4da656]['id'],'name':_0x26497e[_0x4da656]['display_label'],'custom':_0x26497e[_0x4da656][_0x6baa('0x6f')],'options':_0x26497e[_0x4da656][_0x6baa('0x70')]===_0x6baa('0x71')&&_0x26497e[_0x4da656]['pick_list_values'][_0x6baa('0x40')]>-0x1?_['map'](_0x26497e[_0x4da656]['pick_list_values'],function(_0x5e7a47){return{'name':_0x5e7a47,'value':_0x5e7a47};}):[]});}}return{'count':_0x15b295[_0x6baa('0x40')],'rows':_0x15b295};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x427a62,null))[_0x6baa('0x42')](function(_0xa1bdb5){var _0x1f6da8=_0x462283[_0x6baa('0x2d')][_0x6baa('0x72')]?0x1f4:_0xa1bdb5[_0x6baa('0x73')]||0x1f4;logger['error'](_0x6baa('0x74'),_0x6baa('0x75'),_0x1f6da8,JSON['stringify'](_0xa1bdb5));delete _0xa1bdb5[_0x6baa('0x24')];if(_0x1f6da8===0x191){_0x1f6da8=0x190;}_0x427a62[_0x6baa('0x16')](_0x1f6da8)[_0x6baa('0x25')](_0x462283[_0x6baa('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xa1bdb5['statusCode']}:_0xa1bdb5);});}; \ No newline at end of file +var _0xaaf6=['serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','getConfigurations','findOne','hasOwnProperty','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host'];(function(_0x53c964,_0x50ab29){var _0x54d8c1=function(_0x3a041f){while(--_0x3a041f){_0x53c964['push'](_0x53c964['shift']());}};_0x54d8c1(++_0x50ab29);}(_0xaaf6,0x137));var _0x6aaf=function(_0x5c6693,_0x546923){_0x5c6693=_0x5c6693-0x0;var _0x2ce490=_0xaaf6[_0x5c6693];return _0x2ce490;};'use strict';var emlformat=require(_0x6aaf('0x0'));var rimraf=require(_0x6aaf('0x1'));var zipdir=require(_0x6aaf('0x2'));var jsonpatch=require(_0x6aaf('0x3'));var rp=require(_0x6aaf('0x4'));var moment=require(_0x6aaf('0x5'));var BPromise=require(_0x6aaf('0x6'));var Mustache=require(_0x6aaf('0x7'));var util=require(_0x6aaf('0x8'));var path=require(_0x6aaf('0x9'));var sox=require(_0x6aaf('0xa'));var csv=require(_0x6aaf('0xb'));var ejs=require(_0x6aaf('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6aaf('0xd'));var crypto=require(_0x6aaf('0xe'));var jsforce=require(_0x6aaf('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6aaf('0xb'));var querystring=require(_0x6aaf('0x10'));var Papa=require(_0x6aaf('0x11'));var Redis=require(_0x6aaf('0x12'));var authService=require(_0x6aaf('0x13'));var qs=require(_0x6aaf('0x14'));var as=require(_0x6aaf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6aaf('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x6aaf('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6aaf('0x18'))['db'];var integrations=require(_0x6aaf('0x19'));function respondWithStatusCode(_0x516544,_0x2f63b0){_0x2f63b0=_0x2f63b0||0xcc;return function(_0x4df234){if(_0x4df234){return _0x516544['sendStatus'](_0x2f63b0);}return _0x516544[_0x6aaf('0x1a')](_0x2f63b0)[_0x6aaf('0x1b')]();};}function respondWithResult(_0x2ae993,_0x4691db){_0x4691db=_0x4691db||0xc8;return function(_0x453579){if(_0x453579){return _0x2ae993[_0x6aaf('0x1a')](_0x4691db)[_0x6aaf('0x1c')](_0x453579);}};}function respondWithFilteredResult(_0x3f147a,_0xc8255){return function(_0x90c8ac){if(_0x90c8ac){var _0x5042c4=typeof _0xc8255[_0x6aaf('0x1d')]===_0x6aaf('0x1e')&&typeof _0xc8255[_0x6aaf('0x1f')]==='undefined';var _0x4457f8=_0x90c8ac[_0x6aaf('0x20')];var _0x4ce5da=_0x5042c4?0x0:_0xc8255[_0x6aaf('0x1d')];var _0x1335e8=_0x5042c4?_0x90c8ac[_0x6aaf('0x20')]:_0xc8255[_0x6aaf('0x1d')]+_0xc8255['limit'];var _0x3882ab;if(_0x1335e8>=_0x4457f8){_0x1335e8=_0x4457f8;_0x3882ab=0xc8;}else{_0x3882ab=0xce;}_0x3f147a[_0x6aaf('0x1a')](_0x3882ab);return _0x3f147a[_0x6aaf('0x21')](_0x6aaf('0x22'),_0x4ce5da+'-'+_0x1335e8+'/'+_0x4457f8)[_0x6aaf('0x1c')](_0x90c8ac);}return null;};}function patchUpdates(_0x459c7b){return function(_0x41e06a){try{jsonpatch[_0x6aaf('0x23')](_0x41e06a,_0x459c7b,!![]);}catch(_0x4f1d42){return BPromise[_0x6aaf('0x24')](_0x4f1d42);}return _0x41e06a[_0x6aaf('0x25')]();};}function saveUpdates(_0x9a14b2,_0x1a4f68){return function(_0x10cde4){if(_0x10cde4){return _0x10cde4[_0x6aaf('0x26')](_0x9a14b2)[_0x6aaf('0x27')](function(_0x2132d3){return _0x2132d3;});}return null;};}function removeEntity(_0x3d890b,_0x43925c){return function(_0x2415ac){if(_0x2415ac){return _0x2415ac[_0x6aaf('0x28')]()[_0x6aaf('0x27')](function(){_0x3d890b[_0x6aaf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22af9e,_0x5e9373){return function(_0x5405e7){if(!_0x5405e7){_0x22af9e[_0x6aaf('0x29')](0x194);}return _0x5405e7;};}function handleError(_0x57cc5f,_0x134b0c){_0x134b0c=_0x134b0c||0x1f4;return function(_0x57fad1){logger[_0x6aaf('0x2a')](_0x57fad1[_0x6aaf('0x2b')]);if(_0x57fad1['name']){delete _0x57fad1[_0x6aaf('0x2c')];}_0x57cc5f[_0x6aaf('0x1a')](_0x134b0c)['send'](_0x57fad1);};}exports[_0x6aaf('0x2d')]=function(_0xf1eb02,_0x304426){var _0x2c391a={},_0x456c99={},_0xe5e4a8={'count':0x0,'rows':[]};var _0x2618bd=_[_0x6aaf('0x2e')](db[_0x6aaf('0x2f')][_0x6aaf('0x30')],function(_0x269f49){return{'name':_0x269f49[_0x6aaf('0x31')],'type':_0x269f49['type'][_0x6aaf('0x32')]};});_0x456c99['model']=_[_0x6aaf('0x2e')](_0x2618bd,_0x6aaf('0x2c'));_0x456c99[_0x6aaf('0x33')]=_[_0x6aaf('0x34')](_0xf1eb02[_0x6aaf('0x33')]);_0x456c99['filters']=_[_0x6aaf('0x35')](_0x456c99['model'],_0x456c99['query']);_0x2c391a[_0x6aaf('0x36')]=_[_0x6aaf('0x35')](_0x456c99[_0x6aaf('0x37')],qs['fields'](_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x38')]));_0x2c391a[_0x6aaf('0x36')]=_0x2c391a[_0x6aaf('0x36')][_0x6aaf('0x39')]?_0x2c391a[_0x6aaf('0x36')]:_0x456c99[_0x6aaf('0x37')];if(!_0xf1eb02[_0x6aaf('0x33')]['hasOwnProperty'](_0x6aaf('0x3a'))){_0x2c391a[_0x6aaf('0x1f')]=qs[_0x6aaf('0x1f')](_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x1f')]);_0x2c391a['offset']=qs[_0x6aaf('0x1d')](_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x1d')]);}_0x2c391a[_0x6aaf('0x3b')]=qs[_0x6aaf('0x3c')](_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x3c')]);_0x2c391a[_0x6aaf('0x3d')]=qs[_0x6aaf('0x3e')](_[_0x6aaf('0x3f')](_0xf1eb02[_0x6aaf('0x33')],_0x456c99[_0x6aaf('0x3e')]),_0x2618bd);if(_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x40')]){_0x2c391a['where']=_[_0x6aaf('0x41')](_0x2c391a['where'],{'$or':_[_0x6aaf('0x2e')](_0x2618bd,function(_0x2d8d77){if(_0x2d8d77['type']!==_0x6aaf('0x42')){var _0x3fad1d={};_0x3fad1d[_0x2d8d77[_0x6aaf('0x2c')]]={'$like':'%'+_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x40')]+'%'};return _0x3fad1d;}})});}_0x2c391a=_[_0x6aaf('0x41')]({},_0x2c391a,_0xf1eb02[_0x6aaf('0x43')]);var _0xce7db={'where':_0x2c391a[_0x6aaf('0x3d')]};return db['ZohoAccount'][_0x6aaf('0x20')](_0xce7db)[_0x6aaf('0x27')](function(_0x1a5ace){_0xe5e4a8[_0x6aaf('0x20')]=_0x1a5ace;if(_0xf1eb02[_0x6aaf('0x33')][_0x6aaf('0x44')]){_0x2c391a[_0x6aaf('0x45')]=[{'all':!![]}];}return db['ZohoAccount'][_0x6aaf('0x46')](_0x2c391a);})[_0x6aaf('0x27')](function(_0x5ac8c5){_0xe5e4a8[_0x6aaf('0x47')]=_0x5ac8c5;return _0xe5e4a8;})[_0x6aaf('0x27')](respondWithFilteredResult(_0x304426,_0x2c391a))[_0x6aaf('0x48')](handleError(_0x304426,null));};exports[_0x6aaf('0x49')]=function(_0x45bd32,_0x4743dd){var _0x3da2f8={'raw':![],'where':{'id':_0x45bd32[_0x6aaf('0x4a')]['id']}},_0x2f2142={};_0x2f2142[_0x6aaf('0x37')]=_[_0x6aaf('0x34')](db[_0x6aaf('0x2f')][_0x6aaf('0x30')]);_0x2f2142[_0x6aaf('0x33')]=_['keys'](_0x45bd32[_0x6aaf('0x33')]);_0x2f2142[_0x6aaf('0x3e')]=_[_0x6aaf('0x35')](_0x2f2142['model'],_0x2f2142[_0x6aaf('0x33')]);_0x3da2f8[_0x6aaf('0x36')]=_['intersection'](_0x2f2142[_0x6aaf('0x37')],qs['fields'](_0x45bd32['query'][_0x6aaf('0x38')]));_0x3da2f8['attributes']=_0x3da2f8[_0x6aaf('0x36')]['length']?_0x3da2f8['attributes']:_0x2f2142['model'];if(_0x45bd32[_0x6aaf('0x33')][_0x6aaf('0x44')]){_0x3da2f8[_0x6aaf('0x45')]=[{'all':!![]}];}_0x3da2f8=_[_0x6aaf('0x41')]({},_0x3da2f8,_0x45bd32['options']);return db[_0x6aaf('0x2f')]['find'](_0x3da2f8)[_0x6aaf('0x27')](handleEntityNotFound(_0x4743dd,null))[_0x6aaf('0x27')](respondWithResult(_0x4743dd,null))[_0x6aaf('0x48')](handleError(_0x4743dd,null));};exports[_0x6aaf('0x4b')]=function(_0x369dc4,_0x30eebc){return db[_0x6aaf('0x2f')]['create'](_0x369dc4['body'],{})[_0x6aaf('0x27')](respondWithResult(_0x30eebc,0xc9))[_0x6aaf('0x48')](handleError(_0x30eebc,null));};exports['update']=function(_0x5ae80f,_0xa6ad7d){if(_0x5ae80f[_0x6aaf('0x4c')]['id']){delete _0x5ae80f[_0x6aaf('0x4c')]['id'];}return db[_0x6aaf('0x2f')]['find']({'where':{'id':_0x5ae80f[_0x6aaf('0x4a')]['id']}})[_0x6aaf('0x27')](handleEntityNotFound(_0xa6ad7d,null))['then'](saveUpdates(_0x5ae80f['body'],null))[_0x6aaf('0x27')](respondWithResult(_0xa6ad7d,null))[_0x6aaf('0x48')](handleError(_0xa6ad7d,null));};exports['destroy']=function(_0x2541b8,_0x10472e){return db[_0x6aaf('0x2f')]['find']({'where':{'id':_0x2541b8['params']['id']}})['then'](handleEntityNotFound(_0x10472e,null))['then'](removeEntity(_0x10472e,null))[_0x6aaf('0x48')](handleError(_0x10472e,null));};exports[_0x6aaf('0x4d')]=function(_0x2b0c90,_0x4ad692,_0x2965af){var _0x57f0c6={};var _0x25e210={};var _0x5c65b7;var _0x57415c;return db[_0x6aaf('0x2f')][_0x6aaf('0x4e')]({'where':{'id':_0x2b0c90['params']['id']}})[_0x6aaf('0x27')](handleEntityNotFound(_0x4ad692,null))[_0x6aaf('0x27')](function(_0x51568e){if(_0x51568e){_0x5c65b7=_0x51568e;_0x25e210[_0x6aaf('0x37')]=_[_0x6aaf('0x34')](db['ZohoConfiguration'][_0x6aaf('0x30')]);_0x25e210[_0x6aaf('0x33')]=_[_0x6aaf('0x34')](_0x2b0c90[_0x6aaf('0x33')]);_0x25e210['filters']=_[_0x6aaf('0x35')](_0x25e210[_0x6aaf('0x37')],_0x25e210['query']);_0x57f0c6[_0x6aaf('0x36')]=_[_0x6aaf('0x35')](_0x25e210['model'],qs[_0x6aaf('0x38')](_0x2b0c90[_0x6aaf('0x33')][_0x6aaf('0x38')]));_0x57f0c6[_0x6aaf('0x36')]=_0x57f0c6[_0x6aaf('0x36')][_0x6aaf('0x39')]?_0x57f0c6['attributes']:_0x25e210['model'];_0x57f0c6[_0x6aaf('0x3b')]=qs[_0x6aaf('0x3c')](_0x2b0c90[_0x6aaf('0x33')][_0x6aaf('0x3c')]);_0x57f0c6['where']=qs[_0x6aaf('0x3e')](_[_0x6aaf('0x3f')](_0x2b0c90['query'],_0x25e210[_0x6aaf('0x3e')]));if(_0x2b0c90[_0x6aaf('0x33')][_0x6aaf('0x40')]){_0x57f0c6['where']=_[_0x6aaf('0x41')](_0x57f0c6[_0x6aaf('0x3d')],{'$or':_[_0x6aaf('0x2e')](_0x57f0c6['attributes'],function(_0x49bd7c){var _0x3ce170={};_0x3ce170[_0x49bd7c]={'$like':'%'+_0x2b0c90['query']['filter']+'%'};return _0x3ce170;})});}_0x57f0c6=_['merge']({},_0x57f0c6,_0x2b0c90[_0x6aaf('0x43')]);return _0x5c65b7[_0x6aaf('0x4d')](_0x57f0c6);}})[_0x6aaf('0x27')](function(_0x103208){if(_0x103208){_0x57415c=_0x103208[_0x6aaf('0x39')];if(!_0x2b0c90[_0x6aaf('0x33')][_0x6aaf('0x4f')](_0x6aaf('0x3a'))){_0x57f0c6[_0x6aaf('0x1f')]=qs[_0x6aaf('0x1f')](_0x2b0c90['query'][_0x6aaf('0x1f')]);_0x57f0c6[_0x6aaf('0x1d')]=qs[_0x6aaf('0x1d')](_0x2b0c90[_0x6aaf('0x33')][_0x6aaf('0x1d')]);}return _0x5c65b7['getConfigurations'](_0x57f0c6);}})[_0x6aaf('0x27')](function(_0x287c14){if(_0x287c14){return _0x287c14?{'count':_0x57415c,'rows':_0x287c14}:null;}})[_0x6aaf('0x27')](respondWithResult(_0x4ad692,null))[_0x6aaf('0x48')](handleError(_0x4ad692,null));};exports['addConfiguration']=function(_0x2d5c6c,_0x248f27,_0x3cd780){if(_0x2d5c6c[_0x6aaf('0x4c')]['id']){delete _0x2d5c6c['body']['id'];}return db[_0x6aaf('0x2f')][_0x6aaf('0x4e')]({'where':{'id':_0x2d5c6c[_0x6aaf('0x4a')]['id']}})[_0x6aaf('0x27')](handleEntityNotFound(_0x248f27,null))[_0x6aaf('0x27')](function(_0x4d57a8){if(_0x4d57a8){_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x50')]=_0x4d57a8['id'];_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x51')]=integrations['getSubjects'](_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x52')],_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x53')]);_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x54')]=integrations[_0x6aaf('0x55')](_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x52')],_0x2d5c6c[_0x6aaf('0x4c')][_0x6aaf('0x53')]);return db[_0x6aaf('0x56')]['create'](_0x2d5c6c[_0x6aaf('0x4c')],{'include':[{'model':db[_0x6aaf('0x57')],'as':_0x6aaf('0x51')},{'model':db[_0x6aaf('0x57')],'as':_0x6aaf('0x54')}]});}return null;})[_0x6aaf('0x27')](respondWithResult(_0x248f27,null))['catch'](handleError(_0x248f27,null));};function getAccessToken(_0x56b6e3){return new Promise(function(_0x5d0aea,_0x4a307b){var _0x4e1bdc;switch(_0x56b6e3[_0x6aaf('0x58')]){case'US':_0x4e1bdc=_0x6aaf('0x59');break;case'AU':_0x4e1bdc=_0x6aaf('0x5a');break;case'EU':_0x4e1bdc=_0x6aaf('0x5b');break;case'IN':_0x4e1bdc='https://accounts.zoho.in';break;case'CN':_0x4e1bdc=_0x6aaf('0x5c');break;default:_0x4e1bdc=_0x6aaf('0x5b');break;}var _0xdb0d76={'method':_0x6aaf('0x5d'),'uri':_0x4e1bdc+_0x6aaf('0x5e'),'qs':{'refresh_token':_0x56b6e3[_0x6aaf('0x5f')],'client_id':_0x56b6e3[_0x6aaf('0x60')],'client_secret':_0x56b6e3[_0x6aaf('0x61')],'grant_type':_0x6aaf('0x62')},'json':!![]};return rp(_0xdb0d76)['then'](function(_0x84a628){if(_0x84a628[_0x6aaf('0x63')]){_0x5d0aea(_0x84a628['access_token']);}else{_0x4a307b(_0x6aaf('0x64'));}})[_0x6aaf('0x48')](function(_0x33f902){_0x4a307b(_0x33f902);});});}exports[_0x6aaf('0x65')]=function(_0x34263c,_0x451315,_0x1d50bd){var _0xdaec6f,_0x25f91a,_0x35076d,_0x7c8081,_0x395c61;return db[_0x6aaf('0x2f')][_0x6aaf('0x4e')]({'where':{'id':_0x34263c[_0x6aaf('0x4a')]['id']},'attributes':['id',_0x6aaf('0x66'),'zone',_0x6aaf('0x60'),'clientSecret',_0x6aaf('0x67'),_0x6aaf('0x68'),_0x6aaf('0x5f')]})[_0x6aaf('0x27')](handleEntityNotFound(_0x451315,null))['then'](function(_0x20ef18){_0x395c61=_0x20ef18;_0xdaec6f=_0x395c61['host'];_0x25f91a=_0xdaec6f===_0x6aaf('0x69')?'eu':_0x6aaf('0x6a');_0x35076d=_0x395c61[_0x6aaf('0x67')];var _0x71a4f4=_0x35076d[_0x6aaf('0x6b')](-0x1);if(_0x71a4f4==='/'||_0x71a4f4==='\x5c'||_0x71a4f4===':'){_0x35076d=_0x35076d['substring'](0x0,_0x35076d[_0x6aaf('0x6c')](_0x71a4f4));}if(!_0x395c61[_0x6aaf('0x5f')]){throw new Error(_0x6aaf('0x6d'));}return getAccessToken(_0x395c61);})['then'](function(_0x2f3f52){if(_0x2f3f52){return rp({'method':_0x6aaf('0x6e'),'uri':util[_0x6aaf('0x6f')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x25f91a),'qs':{'module':_0x6aaf('0x70')},'headers':{'Authorization':_0x6aaf('0x71')+_0x2f3f52},'json':!![]});}})[_0x6aaf('0x27')](function(_0x15374d){if(_0x15374d){if(_0x15374d[_0x6aaf('0x72')]&&_0x15374d[_0x6aaf('0x72')][_0x6aaf('0x2a')]){throw new Error(_0x15374d[_0x6aaf('0x72')][_0x6aaf('0x2a')][_0x6aaf('0x73')]);}var _0xedf793=[];var _0x1a1126=[];var _0x1c24a9=[_0x6aaf('0x74'),_0x6aaf('0x75'),_0x6aaf('0x76'),_0x6aaf('0x77'),_0x6aaf('0x78'),_0x6aaf('0x79'),_0x6aaf('0x7a'),_0x6aaf('0x7b')];_0x1a1126=_[_0x6aaf('0x7c')](_0x15374d[_0x6aaf('0x38')],function(_0x3d1d27){return _0x1c24a9[_0x6aaf('0x7d')](_0x3d1d27[_0x6aaf('0x7e')]);});for(var _0x3e108=0x0;_0x3e108<_0x1a1126[_0x6aaf('0x39')];_0x3e108++){if(_0x1a1126[_0x3e108][_0x6aaf('0x7f')]===![]){_0xedf793[_0x6aaf('0x80')]({'id':_0x1a1126[_0x3e108]['id'],'name':_0x1a1126[_0x3e108][_0x6aaf('0x81')],'custom':_0x1a1126[_0x3e108][_0x6aaf('0x82')],'options':_0x1a1126[_0x3e108][_0x6aaf('0x83')]===_0x6aaf('0x84')&&_0x1a1126[_0x3e108]['pick_list_values'][_0x6aaf('0x39')]>-0x1?_['map'](_0x1a1126[_0x3e108]['pick_list_values'],function(_0x49bbd3){return{'name':_0x49bbd3,'value':_0x49bbd3};}):[]});}}return{'count':_0xedf793[_0x6aaf('0x39')],'rows':_0xedf793};}else{return{'count':0x0,'rows':[]};}})[_0x6aaf('0x27')](respondWithResult(_0x451315,null))['catch'](function(_0x4e8f34){var _0x5b4773=_0x34263c['query'][_0x6aaf('0x85')]?0x1f4:_0x4e8f34[_0x6aaf('0x86')]||0x1f4;logger[_0x6aaf('0x2a')](_0x6aaf('0x87'),_0x6aaf('0x65'),_0x5b4773,JSON['stringify'](_0x4e8f34));delete _0x4e8f34[_0x6aaf('0x2c')];if(_0x5b4773===0x191){_0x5b4773=0x190;}_0x451315[_0x6aaf('0x1a')](_0x5b4773)[_0x6aaf('0x88')](_0x34263c['query']['test']?{'message':_0x6aaf('0x89'),'statusCode':_0x4e8f34[_0x6aaf('0x86')]}:_0x4e8f34);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index b634c05..31251d4 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 _0x56ae=['ZohoAccount','changed','clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','then','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','inspect','https://accounts.zoho.eu','POST','parse','refreshToken','name','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x56ae,0x13c));var _0xe56a=function(_0x4b22b7,_0x570e9e){_0x4b22b7=_0x4b22b7-0x0;var _0x453e4f=_0x56ae[_0x4b22b7];return _0x453e4f;};'use strict';var _=require(_0xe56a('0x0'));var util=require(_0xe56a('0x1'));var logger=require(_0xe56a('0x2'))(_0xe56a('0x3'));var moment=require(_0xe56a('0x4'));var BPromise=require(_0xe56a('0x5'));var rp=require(_0xe56a('0x6'));var fs=require('fs');var path=require(_0xe56a('0x7'));var rimraf=require(_0xe56a('0x8'));var config=require(_0xe56a('0x9'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe56a('0xa')]=function(_0x45b9a1,_0x2c97f9){return _0x45b9a1[_0xe56a('0xb')](_0xe56a('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x33549c,_0x312fce,_0x2ddb97){if(_0x33549c[_0xe56a('0xd')]('zone')||_0x33549c['changed']('serverUrl')||_0x33549c[_0xe56a('0xd')](_0xe56a('0xe'))||_0x33549c['changed'](_0xe56a('0xf'))||_0x33549c[_0xe56a('0xd')](_0xe56a('0x10'))||_0x33549c[_0xe56a('0xd')](_0xe56a('0x11'))){var _0x19ddae,_0x3ad5ee;_0x19ddae=_0x33549c[_0xe56a('0x12')];var _0x23286f=_0x19ddae[_0xe56a('0x13')](-0x1);if(_0x23286f==='/'||_0x23286f==='\x5c'||_0x23286f===':'){_0x19ddae=_0x19ddae[_0xe56a('0x14')](0x0,_0x19ddae[_0xe56a('0x15')](_0x23286f));}switch(_0x33549c[_0xe56a('0x16')]){case'US':_0x3ad5ee=_0xe56a('0x17');break;case'AU':_0x3ad5ee='https://accounts.zoho.com.au';break;case'IN':_0x3ad5ee=_0xe56a('0x18');break;case'CN':_0x3ad5ee=_0xe56a('0x19');break;default:_0x3ad5ee='https://accounts.zoho.eu';break;}var _0x1445ec={'method':'POST','uri':_0x3ad5ee+_0xe56a('0x1a'),'form':{'grant_type':_0xe56a('0x1b'),'client_id':_0x33549c['clientId'],'client_secret':_0x33549c[_0xe56a('0xf')],'redirect_uri':_0x33549c[_0xe56a('0x12')],'code':_0x33549c['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1445ec)[_0xe56a('0x1c')](function(_0x22bd81){var _0x435bf1=JSON['parse'](_0x22bd81);if(_0x435bf1[_0xe56a('0x1d')]){_0x33549c['refreshToken']=_0x435bf1[_0xe56a('0x1d')];logger['info'](util[_0xe56a('0x1e')](_0xe56a('0x1f'),_0x33549c['name'],_0x33549c['id']));}else{logger[_0xe56a('0x20')](util['format'](_0xe56a('0x21'),_0x33549c['name'],_0x33549c['id']),util[_0xe56a('0x22')](_0x435bf1,{'showHidden':![],'depth':null}));}return _0x2ddb97(null,_0x312fce);})['catch'](function(_0x1ce8b3){logger[_0xe56a('0x20')](util[_0xe56a('0x1e')](_0xe56a('0x21'),_0x33549c['name'],_0x33549c['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2ddb97(_0x1ce8b3);});}else{return _0x2ddb97(null,_0x312fce);}},'beforeUpdate':function(_0x1ef686,_0x386d86,_0x18e505){if(_0x1ef686[_0xe56a('0xd')](_0xe56a('0x16'))||_0x1ef686[_0xe56a('0xd')](_0xe56a('0x12'))||_0x1ef686[_0xe56a('0xd')](_0xe56a('0xe'))||_0x1ef686['changed'](_0xe56a('0xf'))||_0x1ef686[_0xe56a('0xd')]('code')||_0x1ef686[_0xe56a('0xd')](_0xe56a('0x11'))){var _0x23d8d0,_0x180662;_0x23d8d0=_0x1ef686[_0xe56a('0x12')];var _0x45c373=_0x23d8d0[_0xe56a('0x13')](-0x1);if(_0x45c373==='/'||_0x45c373==='\x5c'||_0x45c373===':'){_0x23d8d0=_0x23d8d0['substring'](0x0,_0x23d8d0[_0xe56a('0x15')](_0x45c373));}switch(_0x1ef686['zone']){case'US':_0x180662=_0xe56a('0x17');break;case'AU':_0x180662='https://accounts.zoho.com.au';break;case'IN':_0x180662=_0xe56a('0x18');break;case'CN':_0x180662=_0xe56a('0x19');break;default:_0x180662=_0xe56a('0x23');break;}var _0x5a8c30={'method':_0xe56a('0x24'),'uri':_0x180662+_0xe56a('0x1a'),'form':{'grant_type':_0xe56a('0x1b'),'client_id':_0x1ef686['clientId'],'client_secret':_0x1ef686[_0xe56a('0xf')],'redirect_uri':_0x1ef686[_0xe56a('0x12')],'code':_0x1ef686[_0xe56a('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5a8c30)[_0xe56a('0x1c')](function(_0x14bf3e){var _0x4e05a9=JSON[_0xe56a('0x25')](_0x14bf3e);if(_0x4e05a9[_0xe56a('0x1d')]){_0x1ef686[_0xe56a('0x26')]=_0x4e05a9[_0xe56a('0x1d')];logger['info'](util[_0xe56a('0x1e')](_0xe56a('0x1f'),_0x1ef686[_0xe56a('0x27')],_0x1ef686['id']));}else{logger[_0xe56a('0x20')](util[_0xe56a('0x1e')](_0xe56a('0x21'),_0x1ef686[_0xe56a('0x27')],_0x1ef686['id']),util[_0xe56a('0x22')](_0x4e05a9,{'showHidden':![],'depth':null}));}return _0x18e505(null,_0x386d86);})[_0xe56a('0x28')](function(_0x50e2a3){logger[_0xe56a('0x20')](util[_0xe56a('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1ef686['name'],_0x1ef686['id']),util[_0xe56a('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x18e505(_0x50e2a3);});}else{return _0x18e505(null,_0x386d86);}}}});}; \ No newline at end of file +var _0x40cb=['ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','host','slice','https://accounts.zoho.com.cn','https://accounts.zoho.eu','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x2c8d85,_0x590fef){var _0x277ef4=function(_0x7c7a91){while(--_0x7c7a91){_0x2c8d85['push'](_0x2c8d85['shift']());}};_0x277ef4(++_0x590fef);}(_0x40cb,0xf1));var _0xb40c=function(_0x36e9ae,_0x3d1123){_0x36e9ae=_0x36e9ae-0x0;var _0x541ba2=_0x40cb[_0x36e9ae];return _0x541ba2;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var logger=require(_0xb40c('0x2'))('api');var moment=require(_0xb40c('0x3'));var BPromise=require(_0xb40c('0x4'));var rp=require(_0xb40c('0x5'));var fs=require('fs');var path=require(_0xb40c('0x6'));var rimraf=require(_0xb40c('0x7'));var config=require('../../config/environment');var attributes=require(_0xb40c('0x8'));var integrations=require(_0xb40c('0x9'));module[_0xb40c('0xa')]=function(_0xd52e45,_0x29c495){return _0xd52e45['define'](_0xb40c('0xb'),attributes,{'tableName':_0xb40c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x59599d,_0x2b717d,_0x58271b){if(_0x59599d[_0xb40c('0xd')](_0xb40c('0xe'))||_0x59599d[_0xb40c('0xd')](_0xb40c('0xf'))||_0x59599d[_0xb40c('0xd')]('clientId')||_0x59599d['changed'](_0xb40c('0x10'))||_0x59599d['changed'](_0xb40c('0x11'))||_0x59599d['changed']('host')){var _0x1aecc1,_0x1ce707;_0x1aecc1=_0x59599d['serverUrl'];var _0x5723a9=_0x1aecc1['slice'](-0x1);if(_0x5723a9==='/'||_0x5723a9==='\x5c'||_0x5723a9===':'){_0x1aecc1=_0x1aecc1[_0xb40c('0x12')](0x0,_0x1aecc1[_0xb40c('0x13')](_0x5723a9));}switch(_0x59599d[_0xb40c('0xe')]){case'US':_0x1ce707=_0xb40c('0x14');break;case'AU':_0x1ce707=_0xb40c('0x15');break;case'IN':_0x1ce707=_0xb40c('0x16');break;case'CN':_0x1ce707='https://accounts.zoho.com.cn';break;default:_0x1ce707='https://accounts.zoho.eu';break;}var _0xcf8999={'method':_0xb40c('0x17'),'uri':_0x1ce707+'/oauth/v2/token','form':{'grant_type':_0xb40c('0x18'),'client_id':_0x59599d[_0xb40c('0x19')],'client_secret':_0x59599d[_0xb40c('0x10')],'redirect_uri':_0x59599d[_0xb40c('0xf')],'code':_0x59599d['code']},'headers':{'Content-Type':_0xb40c('0x1a')}};return rp(_0xcf8999)[_0xb40c('0x1b')](function(_0x51e663){var _0x5c7cf6=JSON[_0xb40c('0x1c')](_0x51e663);if(_0x5c7cf6[_0xb40c('0x1d')]){_0x59599d['refreshToken']=_0x5c7cf6[_0xb40c('0x1d')];logger[_0xb40c('0x1e')](util[_0xb40c('0x1f')](_0xb40c('0x20'),_0x59599d[_0xb40c('0x21')],_0x59599d['id']));}else{logger[_0xb40c('0x22')](util[_0xb40c('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x59599d['name'],_0x59599d['id']),util[_0xb40c('0x23')](_0x5c7cf6,{'showHidden':![],'depth':null}));}return _0x58271b(null,_0x2b717d);})[_0xb40c('0x24')](function(_0x40d7f1){logger[_0xb40c('0x22')](util[_0xb40c('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x59599d['name'],_0x59599d['id']),util[_0xb40c('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x58271b(_0x40d7f1);});}else{return _0x58271b(null,_0x2b717d);}},'beforeUpdate':function(_0xafdba5,_0x577a28,_0x54ee7f){if(_0xafdba5[_0xb40c('0xd')](_0xb40c('0xe'))||_0xafdba5[_0xb40c('0xd')](_0xb40c('0xf'))||_0xafdba5[_0xb40c('0xd')]('clientId')||_0xafdba5[_0xb40c('0xd')]('clientSecret')||_0xafdba5[_0xb40c('0xd')](_0xb40c('0x11'))||_0xafdba5[_0xb40c('0xd')](_0xb40c('0x25'))){var _0x300696,_0x245e9f;_0x300696=_0xafdba5[_0xb40c('0xf')];var _0x543350=_0x300696[_0xb40c('0x26')](-0x1);if(_0x543350==='/'||_0x543350==='\x5c'||_0x543350===':'){_0x300696=_0x300696[_0xb40c('0x12')](0x0,_0x300696[_0xb40c('0x13')](_0x543350));}switch(_0xafdba5[_0xb40c('0xe')]){case'US':_0x245e9f=_0xb40c('0x14');break;case'AU':_0x245e9f=_0xb40c('0x15');break;case'IN':_0x245e9f=_0xb40c('0x16');break;case'CN':_0x245e9f=_0xb40c('0x27');break;default:_0x245e9f=_0xb40c('0x28');break;}var _0x2731c2={'method':_0xb40c('0x17'),'uri':_0x245e9f+'/oauth/v2/token','form':{'grant_type':_0xb40c('0x18'),'client_id':_0xafdba5[_0xb40c('0x19')],'client_secret':_0xafdba5[_0xb40c('0x10')],'redirect_uri':_0xafdba5[_0xb40c('0xf')],'code':_0xafdba5[_0xb40c('0x11')]},'headers':{'Content-Type':_0xb40c('0x1a')}};return rp(_0x2731c2)[_0xb40c('0x1b')](function(_0x1c829c){var _0x1af400=JSON[_0xb40c('0x1c')](_0x1c829c);if(_0x1af400['refresh_token']){_0xafdba5['refreshToken']=_0x1af400['refresh_token'];logger[_0xb40c('0x1e')](util['format'](_0xb40c('0x20'),_0xafdba5[_0xb40c('0x21')],_0xafdba5['id']));}else{logger['error'](util[_0xb40c('0x1f')](_0xb40c('0x29'),_0xafdba5[_0xb40c('0x21')],_0xafdba5['id']),util[_0xb40c('0x23')](_0x1af400,{'showHidden':![],'depth':null}));}return _0x54ee7f(null,_0x577a28);})[_0xb40c('0x24')](function(_0x189008){logger[_0xb40c('0x22')](util[_0xb40c('0x1f')](_0xb40c('0x29'),_0xafdba5['name'],_0xafdba5['id']),util[_0xb40c('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x54ee7f(_0x189008);});}else{return _0x54ee7f(null,_0x577a28);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 2a9f4d6..0389737 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 _0xf846=['code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit','include','map','model','attributes','then','ShowZohoAccount','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xf846,0x85));var _0x6f84=function(_0x45b869,_0x58d2d5){_0x45b869=_0x45b869-0x0;var _0x796691=_0xf846[_0x45b869];return _0x796691;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var moment=require(_0x6f84('0x2'));var BPromise=require(_0x6f84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f84('0x4'));var db=require(_0x6f84('0x5'))['db'];var utils=require(_0x6f84('0x6'));var logger=require(_0x6f84('0x7'))('rpc');var config=require(_0x6f84('0x8'));var jayson=require(_0x6f84('0x9'));var client=jayson[_0x6f84('0xa')][_0x6f84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162a59,_0x45dd2b,_0x4dcf04){return new BPromise(function(_0x196c7a,_0x2da435){return client[_0x6f84('0xc')](_0x162a59,_0x4dcf04)['then'](function(_0x156032){logger[_0x6f84('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x45dd2b,_0x6f84('0xe'));logger[_0x6f84('0xf')](_0x6f84('0x10'),_0x45dd2b,_0x6f84('0xe'),JSON[_0x6f84('0x11')](_0x156032));if(_0x156032[_0x6f84('0x12')]){if(_0x156032[_0x6f84('0x12')][_0x6f84('0x13')]===0x1f4){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032[_0x6f84('0x12')]['message']);return _0x2da435(_0x156032[_0x6f84('0x12')]['message']);}logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032['error'][_0x6f84('0x15')]);return _0x196c7a(_0x156032['error'][_0x6f84('0x15')]);}else{logger['info'](_0x6f84('0x14'),_0x45dd2b,'request\x20sent');_0x196c7a(_0x156032[_0x6f84('0x16')]['message']);}})[_0x6f84('0x17')](function(_0x27bc7d){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x27bc7d);_0x2da435(_0x27bc7d);});});}exports[_0x6f84('0x18')]=function(_0x2abc28){var _0x5474ad=this;return new Promise(function(_0x2b91ad,_0x4f323b){return db[_0x6f84('0x19')][_0x6f84('0x1a')]({'raw':_0x2abc28[_0x6f84('0x1b')]?_0x2abc28[_0x6f84('0x1b')][_0x6f84('0x1c')]===undefined?!![]:![]:!![],'where':_0x2abc28[_0x6f84('0x1b')]?_0x2abc28[_0x6f84('0x1b')]['where']||null:null,'attributes':_0x2abc28['options']?_0x2abc28[_0x6f84('0x1b')]['attributes']||null:null,'limit':_0x2abc28[_0x6f84('0x1b')]?_0x2abc28[_0x6f84('0x1b')][_0x6f84('0x1d')]||null:null,'include':_0x2abc28[_0x6f84('0x1b')]?_0x2abc28[_0x6f84('0x1b')][_0x6f84('0x1e')]?_[_0x6f84('0x1f')](_0x2abc28[_0x6f84('0x1b')][_0x6f84('0x1e')],function(_0x512320){return{'model':db[_0x512320[_0x6f84('0x20')]],'as':_0x512320['as'],'attributes':_0x512320['attributes'],'include':_0x512320[_0x6f84('0x1e')]?_[_0x6f84('0x1f')](_0x512320[_0x6f84('0x1e')],function(_0x430fb7){return{'model':db[_0x430fb7[_0x6f84('0x20')]],'as':_0x430fb7['as'],'attributes':_0x430fb7[_0x6f84('0x21')],'include':_0x430fb7[_0x6f84('0x1e')]?_[_0x6f84('0x1f')](_0x430fb7[_0x6f84('0x1e')],function(_0x31badd){return{'model':db[_0x31badd[_0x6f84('0x20')]],'as':_0x31badd['as'],'attributes':_0x31badd[_0x6f84('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6f84('0x22')](function(_0x2650e7){logger[_0x6f84('0xd')](_0x6f84('0x18'),_0x2abc28);logger[_0x6f84('0xf')]('GetZohoAccount',_0x2abc28,JSON[_0x6f84('0x11')](_0x2650e7));_0x2b91ad(_0x2650e7);})[_0x6f84('0x17')](function(_0x13d6f1){logger['error']('GetZohoAccount',_0x13d6f1[_0x6f84('0x15')],_0x2abc28);_0x4f323b(_0x5474ad[_0x6f84('0x12')](0x1f4,_0x13d6f1['message']));});});};exports[_0x6f84('0x23')]=function(_0x9a78c1){var _0x17f6a9=this;return new Promise(function(_0x468681,_0x4f58c1){return db[_0x6f84('0x19')][_0x6f84('0x24')]({'raw':_0x9a78c1[_0x6f84('0x1b')]?_0x9a78c1[_0x6f84('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x9a78c1[_0x6f84('0x1b')]?_0x9a78c1[_0x6f84('0x1b')][_0x6f84('0x25')]||null:null,'attributes':_0x9a78c1[_0x6f84('0x1b')]?_0x9a78c1[_0x6f84('0x1b')][_0x6f84('0x21')]||null:null,'include':_0x9a78c1[_0x6f84('0x1b')]?_0x9a78c1[_0x6f84('0x1b')][_0x6f84('0x1e')]?_[_0x6f84('0x1f')](_0x9a78c1[_0x6f84('0x1b')]['include'],function(_0x714495){return{'model':db[_0x714495[_0x6f84('0x20')]],'as':_0x714495['as'],'attributes':_0x714495[_0x6f84('0x21')],'include':_0x714495[_0x6f84('0x1e')]?_[_0x6f84('0x1f')](_0x714495['include'],function(_0xc3062e){return{'model':db[_0xc3062e['model']],'as':_0xc3062e['as'],'attributes':_0xc3062e[_0x6f84('0x21')],'include':_0xc3062e[_0x6f84('0x1e')]?_[_0x6f84('0x1f')](_0xc3062e[_0x6f84('0x1e')],function(_0x40ddb0){return{'model':db[_0x40ddb0[_0x6f84('0x20')]],'as':_0x40ddb0['as'],'attributes':_0x40ddb0[_0x6f84('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6f84('0x22')](function(_0x390e7c){logger[_0x6f84('0xd')](_0x6f84('0x23'),_0x9a78c1);logger[_0x6f84('0xf')](_0x6f84('0x23'),_0x9a78c1,JSON[_0x6f84('0x11')](_0x390e7c));_0x468681(_0x390e7c);})[_0x6f84('0x17')](function(_0x393d1e){logger[_0x6f84('0x12')]('ShowZohoAccount',_0x393d1e[_0x6f84('0x15')],_0x9a78c1);_0x4f58c1(_0x17f6a9[_0x6f84('0x12')](0x1f4,_0x393d1e['message']));});});}; \ No newline at end of file +var _0x8a9a=['then','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','map','include','model','find','ShowZohoAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x462568,_0x59a852){var _0x169bcf=function(_0x33ce2b){while(--_0x33ce2b){_0x462568['push'](_0x462568['shift']());}};_0x169bcf(++_0x59a852);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x8a9a[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a2bc,_0x4a091d,_0x1b4873){return new BPromise(function(_0x129e9f,_0x1477b0){return client[_0xa8a9('0xc')](_0x24a2bc,_0x1b4873)[_0xa8a9('0xd')](function(_0x4ebe24){logger[_0xa8a9('0xe')](_0xa8a9('0xf'),_0x4a091d,'request\x20sent');logger[_0xa8a9('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'),JSON[_0xa8a9('0x12')](_0x4ebe24));if(_0x4ebe24['error']){if(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x14')]===0x1f4){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);return _0x1477b0(_0x4ebe24['error'][_0xa8a9('0x15')]);}logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24['error']['message']);return _0x129e9f(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);}else{logger[_0xa8a9('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'));_0x129e9f(_0x4ebe24[_0xa8a9('0x16')]['message']);}})['catch'](function(_0x1039c9){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x1039c9);_0x1477b0(_0x1039c9);});});}exports[_0xa8a9('0x17')]=function(_0x46a89d){var _0x4456aa=this;return new Promise(function(_0x5cd106,_0x499e5b){return db[_0xa8a9('0x18')]['findAll']({'raw':_0x46a89d['options']?_0x46a89d[_0xa8a9('0x19')][_0xa8a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x46a89d[_0xa8a9('0x19')]?_0x46a89d[_0xa8a9('0x19')][_0xa8a9('0x1b')]||null:null,'attributes':_0x46a89d[_0xa8a9('0x19')]?_0x46a89d[_0xa8a9('0x19')][_0xa8a9('0x1c')]||null:null,'limit':_0x46a89d[_0xa8a9('0x19')]?_0x46a89d['options'][_0xa8a9('0x1d')]||null:null,'include':_0x46a89d['options']?_0x46a89d[_0xa8a9('0x19')]['include']?_[_0xa8a9('0x1e')](_0x46a89d[_0xa8a9('0x19')]['include'],function(_0x58f832){return{'model':db[_0x58f832['model']],'as':_0x58f832['as'],'attributes':_0x58f832['attributes'],'include':_0x58f832[_0xa8a9('0x1f')]?_['map'](_0x58f832[_0xa8a9('0x1f')],function(_0x5276bd){return{'model':db[_0x5276bd[_0xa8a9('0x20')]],'as':_0x5276bd['as'],'attributes':_0x5276bd[_0xa8a9('0x1c')],'include':_0x5276bd[_0xa8a9('0x1f')]?_[_0xa8a9('0x1e')](_0x5276bd[_0xa8a9('0x1f')],function(_0x34d84a){return{'model':db[_0x34d84a['model']],'as':_0x34d84a['as'],'attributes':_0x34d84a[_0xa8a9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45578f){logger[_0xa8a9('0xe')](_0xa8a9('0x17'),_0x46a89d);logger[_0xa8a9('0x10')](_0xa8a9('0x17'),_0x46a89d,JSON[_0xa8a9('0x12')](_0x45578f));_0x5cd106(_0x45578f);})['catch'](function(_0x24021c){logger[_0xa8a9('0x13')](_0xa8a9('0x17'),_0x24021c['message'],_0x46a89d);_0x499e5b(_0x4456aa[_0xa8a9('0x13')](0x1f4,_0x24021c[_0xa8a9('0x15')]));});});};exports['ShowZohoAccount']=function(_0x4d42fc){var _0x5c9246=this;return new Promise(function(_0x5b4022,_0x294137){return db['ZohoAccount'][_0xa8a9('0x21')]({'raw':_0x4d42fc[_0xa8a9('0x19')]?_0x4d42fc[_0xa8a9('0x19')][_0xa8a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d42fc['options']?_0x4d42fc['options'][_0xa8a9('0x1b')]||null:null,'attributes':_0x4d42fc[_0xa8a9('0x19')]?_0x4d42fc[_0xa8a9('0x19')]['attributes']||null:null,'include':_0x4d42fc[_0xa8a9('0x19')]?_0x4d42fc[_0xa8a9('0x19')][_0xa8a9('0x1f')]?_[_0xa8a9('0x1e')](_0x4d42fc[_0xa8a9('0x19')]['include'],function(_0x2c890d){return{'model':db[_0x2c890d[_0xa8a9('0x20')]],'as':_0x2c890d['as'],'attributes':_0x2c890d[_0xa8a9('0x1c')],'include':_0x2c890d['include']?_[_0xa8a9('0x1e')](_0x2c890d['include'],function(_0x52df35){return{'model':db[_0x52df35['model']],'as':_0x52df35['as'],'attributes':_0x52df35[_0xa8a9('0x1c')],'include':_0x52df35['include']?_[_0xa8a9('0x1e')](_0x52df35[_0xa8a9('0x1f')],function(_0x1c065e){return{'model':db[_0x1c065e['model']],'as':_0x1c065e['as'],'attributes':_0x1c065e[_0xa8a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa8a9('0xd')](function(_0x559f9b){logger['info'](_0xa8a9('0x22'),_0x4d42fc);logger[_0xa8a9('0x10')]('ShowZohoAccount',_0x4d42fc,JSON[_0xa8a9('0x12')](_0x559f9b));_0x5b4022(_0x559f9b);})[_0xa8a9('0x23')](function(_0x598bf8){logger[_0xa8a9('0x13')](_0xa8a9('0x22'),_0x598bf8[_0xa8a9('0x15')],_0x4d42fc);_0x294137(_0x5c9246['error'](0x1f4,_0x598bf8[_0xa8a9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 12f46a0..834338c 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 _0x7ab3=['getDescriptions','create','update','delete','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7ab3,0xe0));var _0x37ab=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x7ab3[_0x580971];return _0x16d873;};'use strict';var multer=require('multer');var util=require(_0x37ab('0x0'));var path=require(_0x37ab('0x1'));var timeout=require(_0x37ab('0x2'));var express=require(_0x37ab('0x3'));var router=express['Router']();var fs_extra=require(_0x37ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x37ab('0x5'));var config=require('../../config/environment');var controller=require(_0x37ab('0x6'));router[_0x37ab('0x7')]('/',auth[_0x37ab('0x8')](),controller[_0x37ab('0x9')]);router[_0x37ab('0x7')](_0x37ab('0xa'),auth[_0x37ab('0x8')](),controller[_0x37ab('0xb')]);router[_0x37ab('0x7')](_0x37ab('0xc'),auth[_0x37ab('0x8')](),controller[_0x37ab('0xd')]);router[_0x37ab('0x7')](_0x37ab('0xe'),auth[_0x37ab('0x8')](),controller[_0x37ab('0xf')]);router[_0x37ab('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x37ab('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x37ab('0x11')]);router['put'](_0x37ab('0xa'),auth[_0x37ab('0x8')](),controller[_0x37ab('0x12')]);router[_0x37ab('0x13')](_0x37ab('0xa'),auth[_0x37ab('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4a6c=['get','index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x4a6c,0x191));var _0xc4a6=function(_0x308dcd,_0x4133a4){_0x308dcd=_0x308dcd-0x0;var _0x60d3f2=_0x4a6c[_0x308dcd];return _0x60d3f2;};'use strict';var multer=require(_0xc4a6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc4a6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc4a6('0x2'));var auth=require(_0xc4a6('0x3'));var interaction=require(_0xc4a6('0x4'));var config=require(_0xc4a6('0x5'));var controller=require(_0xc4a6('0x6'));router[_0xc4a6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc4a6('0x8')]);router[_0xc4a6('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc4a6('0x9')]);router[_0xc4a6('0x7')](_0xc4a6('0xa'),auth[_0xc4a6('0xb')](),controller[_0xc4a6('0xc')]);router[_0xc4a6('0x7')](_0xc4a6('0xd'),auth[_0xc4a6('0xb')](),controller[_0xc4a6('0xe')]);router[_0xc4a6('0x7')](_0xc4a6('0xf'),auth[_0xc4a6('0xb')](),controller[_0xc4a6('0x10')]);router[_0xc4a6('0x11')]('/',auth[_0xc4a6('0xb')](),controller[_0xc4a6('0x12')]);router[_0xc4a6('0x13')](_0xc4a6('0x14'),auth['isAuthenticated'](),controller[_0xc4a6('0x15')]);router['delete'](_0xc4a6('0x14'),auth[_0xc4a6('0xb')](),controller[_0xc4a6('0x16')]);module[_0xc4a6('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 981685b..2226f52 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 _0xbd70=['contact_lead','sequelize','STRING','ENUM','lead','contact'];(function(_0x210ffd,_0xdfbfd1){var _0x10e31e=function(_0x21dc7a){while(--_0x21dc7a){_0x210ffd['push'](_0x210ffd['shift']());}};_0x10e31e(++_0xdfbfd1);}(_0xbd70,0xe5));var _0x0bd7=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xbd70[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x0bd7('0x0'));module['exports']={'name':{'type':Sequelize[_0x0bd7('0x1')]},'moduleCreate':{'type':Sequelize[_0x0bd7('0x2')](_0x0bd7('0x3'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x0bd7('0x2')]('contact_lead',_0x0bd7('0x4'),'lead'),'defaultValue':_0x0bd7('0x5')},'description':{'type':Sequelize[_0x0bd7('0x1')]}}; \ No newline at end of file +var _0xe931=['exports','STRING','lead','contact','nothing','ENUM','contact_lead','sequelize'];(function(_0x4664b9,_0x326c2a){var _0x5a2cd4=function(_0x19bab6){while(--_0x19bab6){_0x4664b9['push'](_0x4664b9['shift']());}};_0x5a2cd4(++_0x326c2a);}(_0xe931,0x177));var _0x1e93=function(_0x5dc2cb,_0x38ef72){_0x5dc2cb=_0x5dc2cb-0x0;var _0x50bd11=_0xe931[_0x5dc2cb];return _0x50bd11;};'use strict';var Sequelize=require(_0x1e93('0x0'));module[_0x1e93('0x1')]={'name':{'type':Sequelize[_0x1e93('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x1e93('0x3'),_0x1e93('0x4'),_0x1e93('0x5')),'defaultValue':_0x1e93('0x3')},'moduleSearch':{'type':Sequelize[_0x1e93('0x6')](_0x1e93('0x7'),_0x1e93('0x4'),_0x1e93('0x3')),'defaultValue':_0x1e93('0x7')},'description':{'type':Sequelize[_0x1e93('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6a0c0b2..428b81e 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 _0xad03=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','stack','name','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','length','create','body','find','getFields','order','nolimit','getSubjects','findOne','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0xad03,0x1d4));var _0x3ad0=function(_0x558c71,_0x3dcdd9){_0x558c71=_0x558c71-0x0;var _0x237700=_0xad03[_0x558c71];return _0x237700;};'use strict';var emlformat=require(_0x3ad0('0x0'));var rimraf=require(_0x3ad0('0x1'));var zipdir=require(_0x3ad0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3ad0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3ad0('0x4'));var util=require(_0x3ad0('0x5'));var path=require(_0x3ad0('0x6'));var sox=require(_0x3ad0('0x7'));var csv=require(_0x3ad0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ad0('0x9'));var _=require('lodash');var squel=require(_0x3ad0('0xa'));var crypto=require(_0x3ad0('0xb'));var jsforce=require(_0x3ad0('0xc'));var deskjs=require(_0x3ad0('0xd'));var toCsv=require(_0x3ad0('0x8'));var querystring=require(_0x3ad0('0xe'));var Papa=require('papaparse');var Redis=require(_0x3ad0('0xf'));var authService=require(_0x3ad0('0x10'));var qs=require(_0x3ad0('0x11'));var as=require(_0x3ad0('0x12'));var hardwareService=require(_0x3ad0('0x13'));var logger=require(_0x3ad0('0x14'))(_0x3ad0('0x15'));var utils=require(_0x3ad0('0x16'));var config=require(_0x3ad0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa843f8,_0x502ed8){_0x502ed8=_0x502ed8||0xcc;return function(_0x59db0e){if(_0x59db0e){return _0xa843f8[_0x3ad0('0x18')](_0x502ed8);}return _0xa843f8['status'](_0x502ed8)[_0x3ad0('0x19')]();};}function respondWithResult(_0x5cf44d,_0x47a88e){_0x47a88e=_0x47a88e||0xc8;return function(_0x3f395e){if(_0x3f395e){return _0x5cf44d[_0x3ad0('0x1a')](_0x47a88e)[_0x3ad0('0x1b')](_0x3f395e);}};}function respondWithFilteredResult(_0x59da2c,_0xe20318){return function(_0x1c55ae){if(_0x1c55ae){var _0x57db66=typeof _0xe20318['offset']===_0x3ad0('0x1c')&&typeof _0xe20318[_0x3ad0('0x1d')]===_0x3ad0('0x1c');var _0x1ec540=_0x1c55ae[_0x3ad0('0x1e')];var _0x549f04=_0x57db66?0x0:_0xe20318[_0x3ad0('0x1f')];var _0x3bebd4=_0x57db66?_0x1c55ae[_0x3ad0('0x1e')]:_0xe20318[_0x3ad0('0x1f')]+_0xe20318['limit'];var _0x2db2ed;if(_0x3bebd4>=_0x1ec540){_0x3bebd4=_0x1ec540;_0x2db2ed=0xc8;}else{_0x2db2ed=0xce;}_0x59da2c[_0x3ad0('0x1a')](_0x2db2ed);return _0x59da2c[_0x3ad0('0x20')]('Content-Range',_0x549f04+'-'+_0x3bebd4+'/'+_0x1ec540)[_0x3ad0('0x1b')](_0x1c55ae);}return null;};}function patchUpdates(_0x130c13){return function(_0x32188e){try{jsonpatch[_0x3ad0('0x21')](_0x32188e,_0x130c13,!![]);}catch(_0x55d089){return BPromise[_0x3ad0('0x22')](_0x55d089);}return _0x32188e['save']();};}function saveUpdates(_0xf0f60,_0x5cbee6){return function(_0x2558f7){if(_0x2558f7){return _0x2558f7[_0x3ad0('0x23')](_0xf0f60)[_0x3ad0('0x24')](function(_0x42aca4){return _0x42aca4;});}return null;};}function removeEntity(_0x5632ee,_0x5c32bf){return function(_0x564fd7){if(_0x564fd7){return _0x564fd7[_0x3ad0('0x25')]()[_0x3ad0('0x24')](function(){_0x5632ee[_0x3ad0('0x1a')](0xcc)[_0x3ad0('0x19')]();});}};}function handleEntityNotFound(_0x5e0718,_0x5bfb52){return function(_0x30fb07){if(!_0x30fb07){_0x5e0718[_0x3ad0('0x18')](0x194);}return _0x30fb07;};}function handleError(_0x3f289c,_0x4a0817){_0x4a0817=_0x4a0817||0x1f4;return function(_0x2b1053){logger[_0x3ad0('0x26')](_0x2b1053[_0x3ad0('0x27')]);if(_0x2b1053[_0x3ad0('0x28')]){delete _0x2b1053['name'];}_0x3f289c[_0x3ad0('0x1a')](_0x4a0817)['send'](_0x2b1053);};}exports[_0x3ad0('0x29')]=function(_0x5f11f7,_0x16c131){var _0x5c90da={},_0x29da2b={},_0x1b02e0={'count':0x0,'rows':[]};var _0x58704c=_[_0x3ad0('0x2a')](db[_0x3ad0('0x2b')]['rawAttributes'],function(_0x465388){return{'name':_0x465388[_0x3ad0('0x2c')],'type':_0x465388[_0x3ad0('0x2d')][_0x3ad0('0x2e')]};});_0x29da2b[_0x3ad0('0x2f')]=_[_0x3ad0('0x2a')](_0x58704c,_0x3ad0('0x28'));_0x29da2b[_0x3ad0('0x30')]=_[_0x3ad0('0x31')](_0x5f11f7['query']);_0x29da2b['filters']=_[_0x3ad0('0x32')](_0x29da2b[_0x3ad0('0x2f')],_0x29da2b['query']);_0x5c90da['attributes']=_[_0x3ad0('0x32')](_0x29da2b['model'],qs['fields'](_0x5f11f7[_0x3ad0('0x30')]['fields']));_0x5c90da[_0x3ad0('0x33')]=_0x5c90da[_0x3ad0('0x33')]['length']?_0x5c90da[_0x3ad0('0x33')]:_0x29da2b[_0x3ad0('0x2f')];if(!_0x5f11f7[_0x3ad0('0x30')][_0x3ad0('0x34')]('nolimit')){_0x5c90da[_0x3ad0('0x1d')]=qs[_0x3ad0('0x1d')](_0x5f11f7[_0x3ad0('0x30')][_0x3ad0('0x1d')]);_0x5c90da['offset']=qs[_0x3ad0('0x1f')](_0x5f11f7[_0x3ad0('0x30')][_0x3ad0('0x1f')]);}_0x5c90da['order']=qs['sort'](_0x5f11f7['query'][_0x3ad0('0x35')]);_0x5c90da[_0x3ad0('0x36')]=qs[_0x3ad0('0x37')](_[_0x3ad0('0x38')](_0x5f11f7[_0x3ad0('0x30')],_0x29da2b[_0x3ad0('0x37')]),_0x58704c);if(_0x5f11f7[_0x3ad0('0x30')][_0x3ad0('0x39')]){_0x5c90da[_0x3ad0('0x36')]=_[_0x3ad0('0x3a')](_0x5c90da['where'],{'$or':_[_0x3ad0('0x2a')](_0x58704c,function(_0x4dff7f){if(_0x4dff7f[_0x3ad0('0x2d')]!==_0x3ad0('0x3b')){var _0x2d7a8e={};_0x2d7a8e[_0x4dff7f['name']]={'$like':'%'+_0x5f11f7[_0x3ad0('0x30')][_0x3ad0('0x39')]+'%'};return _0x2d7a8e;}})});}_0x5c90da=_[_0x3ad0('0x3a')]({},_0x5c90da,_0x5f11f7[_0x3ad0('0x3c')]);var _0x4e99ca={'where':_0x5c90da['where']};return db[_0x3ad0('0x2b')]['count'](_0x4e99ca)[_0x3ad0('0x24')](function(_0x38d82e){_0x1b02e0[_0x3ad0('0x1e')]=_0x38d82e;if(_0x5f11f7[_0x3ad0('0x30')][_0x3ad0('0x3d')]){_0x5c90da[_0x3ad0('0x3e')]=[{'all':!![]}];}return db[_0x3ad0('0x2b')][_0x3ad0('0x3f')](_0x5c90da);})[_0x3ad0('0x24')](function(_0x37ac6b){_0x1b02e0[_0x3ad0('0x40')]=_0x37ac6b;return _0x1b02e0;})[_0x3ad0('0x24')](respondWithFilteredResult(_0x16c131,_0x5c90da))[_0x3ad0('0x41')](handleError(_0x16c131,null));};exports['show']=function(_0x212f19,_0x5d0b14){var _0x367af0={'raw':![],'where':{'id':_0x212f19[_0x3ad0('0x42')]['id']}},_0x2b6e46={};_0x2b6e46['model']=_[_0x3ad0('0x31')](db[_0x3ad0('0x2b')][_0x3ad0('0x43')]);_0x2b6e46[_0x3ad0('0x30')]=_[_0x3ad0('0x31')](_0x212f19[_0x3ad0('0x30')]);_0x2b6e46['filters']=_[_0x3ad0('0x32')](_0x2b6e46[_0x3ad0('0x2f')],_0x2b6e46[_0x3ad0('0x30')]);_0x367af0[_0x3ad0('0x33')]=_['intersection'](_0x2b6e46[_0x3ad0('0x2f')],qs[_0x3ad0('0x44')](_0x212f19[_0x3ad0('0x30')][_0x3ad0('0x44')]));_0x367af0[_0x3ad0('0x33')]=_0x367af0[_0x3ad0('0x33')][_0x3ad0('0x45')]?_0x367af0['attributes']:_0x2b6e46[_0x3ad0('0x2f')];if(_0x212f19[_0x3ad0('0x30')][_0x3ad0('0x3d')]){_0x367af0[_0x3ad0('0x3e')]=[{'all':!![]}];}_0x367af0=_[_0x3ad0('0x3a')]({},_0x367af0,_0x212f19[_0x3ad0('0x3c')]);return db[_0x3ad0('0x2b')]['find'](_0x367af0)['then'](handleEntityNotFound(_0x5d0b14,null))['then'](respondWithResult(_0x5d0b14,null))[_0x3ad0('0x41')](handleError(_0x5d0b14,null));};exports[_0x3ad0('0x46')]=function(_0xd1250a,_0x15cead){return db[_0x3ad0('0x2b')][_0x3ad0('0x46')](_0xd1250a[_0x3ad0('0x47')],{})[_0x3ad0('0x24')](respondWithResult(_0x15cead,0xc9))[_0x3ad0('0x41')](handleError(_0x15cead,null));};exports[_0x3ad0('0x23')]=function(_0x14f6ce,_0x323303){if(_0x14f6ce['body']['id']){delete _0x14f6ce['body']['id'];}return db[_0x3ad0('0x2b')][_0x3ad0('0x48')]({'where':{'id':_0x14f6ce[_0x3ad0('0x42')]['id']}})['then'](handleEntityNotFound(_0x323303,null))[_0x3ad0('0x24')](saveUpdates(_0x14f6ce[_0x3ad0('0x47')],null))[_0x3ad0('0x24')](respondWithResult(_0x323303,null))[_0x3ad0('0x41')](handleError(_0x323303,null));};exports[_0x3ad0('0x25')]=function(_0x8bdace,_0x335952){return db[_0x3ad0('0x2b')][_0x3ad0('0x48')]({'where':{'id':_0x8bdace[_0x3ad0('0x42')]['id']}})[_0x3ad0('0x24')](handleEntityNotFound(_0x335952,null))[_0x3ad0('0x24')](removeEntity(_0x335952,null))[_0x3ad0('0x41')](handleError(_0x335952,null));};exports[_0x3ad0('0x49')]=function(_0x1ee75,_0x33aa32,_0x215fbc){var _0x38a2d7={};var _0x3d93db={};var _0x5e2aff;var _0x9991d8;return db[_0x3ad0('0x2b')]['findOne']({'where':{'id':_0x1ee75['params']['id']}})[_0x3ad0('0x24')](handleEntityNotFound(_0x33aa32,null))[_0x3ad0('0x24')](function(_0x5b8727){if(_0x5b8727){_0x5e2aff=_0x5b8727;_0x3d93db[_0x3ad0('0x2f')]=_[_0x3ad0('0x31')](db['ZohoField'][_0x3ad0('0x43')]);_0x3d93db[_0x3ad0('0x30')]=_[_0x3ad0('0x31')](_0x1ee75[_0x3ad0('0x30')]);_0x3d93db[_0x3ad0('0x37')]=_[_0x3ad0('0x32')](_0x3d93db[_0x3ad0('0x2f')],_0x3d93db[_0x3ad0('0x30')]);_0x38a2d7[_0x3ad0('0x33')]=_[_0x3ad0('0x32')](_0x3d93db[_0x3ad0('0x2f')],qs['fields'](_0x1ee75[_0x3ad0('0x30')][_0x3ad0('0x44')]));_0x38a2d7[_0x3ad0('0x33')]=_0x38a2d7[_0x3ad0('0x33')][_0x3ad0('0x45')]?_0x38a2d7[_0x3ad0('0x33')]:_0x3d93db[_0x3ad0('0x2f')];_0x38a2d7[_0x3ad0('0x4a')]=qs['sort'](_0x1ee75[_0x3ad0('0x30')]['sort']);_0x38a2d7['where']=qs[_0x3ad0('0x37')](_[_0x3ad0('0x38')](_0x1ee75[_0x3ad0('0x30')],_0x3d93db[_0x3ad0('0x37')]));if(_0x1ee75[_0x3ad0('0x30')]['filter']){_0x38a2d7[_0x3ad0('0x36')]=_[_0x3ad0('0x3a')](_0x38a2d7[_0x3ad0('0x36')],{'$or':_[_0x3ad0('0x2a')](_0x38a2d7['attributes'],function(_0x1157f3){var _0x2f006f={};_0x2f006f[_0x1157f3]={'$like':'%'+_0x1ee75[_0x3ad0('0x30')]['filter']+'%'};return _0x2f006f;})});}_0x38a2d7=_[_0x3ad0('0x3a')]({},_0x38a2d7,_0x1ee75['options']);return _0x5e2aff[_0x3ad0('0x49')](_0x38a2d7);}})[_0x3ad0('0x24')](function(_0xa777c3){if(_0xa777c3){_0x9991d8=_0xa777c3['length'];if(!_0x1ee75[_0x3ad0('0x30')][_0x3ad0('0x34')](_0x3ad0('0x4b'))){_0x38a2d7[_0x3ad0('0x1d')]=qs[_0x3ad0('0x1d')](_0x1ee75[_0x3ad0('0x30')]['limit']);_0x38a2d7['offset']=qs[_0x3ad0('0x1f')](_0x1ee75[_0x3ad0('0x30')][_0x3ad0('0x1f')]);}return _0x5e2aff[_0x3ad0('0x49')](_0x38a2d7);}})['then'](function(_0x18b457){if(_0x18b457){return _0x18b457?{'count':_0x9991d8,'rows':_0x18b457}:null;}})[_0x3ad0('0x24')](respondWithResult(_0x33aa32,null))[_0x3ad0('0x41')](handleError(_0x33aa32,null));};exports[_0x3ad0('0x4c')]=function(_0x25f5d4,_0x568ebc,_0x2962ee){var _0x2311f9={};var _0x4d6bf3={};var _0x29cf6a;var _0x30ffe3;return db[_0x3ad0('0x2b')][_0x3ad0('0x4d')]({'where':{'id':_0x25f5d4[_0x3ad0('0x42')]['id']}})[_0x3ad0('0x24')](handleEntityNotFound(_0x568ebc,null))[_0x3ad0('0x24')](function(_0x42a3d0){if(_0x42a3d0){_0x29cf6a=_0x42a3d0;_0x4d6bf3[_0x3ad0('0x2f')]=_[_0x3ad0('0x31')](db[_0x3ad0('0x4e')]['rawAttributes']);_0x4d6bf3['query']=_[_0x3ad0('0x31')](_0x25f5d4[_0x3ad0('0x30')]);_0x4d6bf3[_0x3ad0('0x37')]=_['intersection'](_0x4d6bf3['model'],_0x4d6bf3[_0x3ad0('0x30')]);_0x2311f9[_0x3ad0('0x33')]=_[_0x3ad0('0x32')](_0x4d6bf3[_0x3ad0('0x2f')],qs[_0x3ad0('0x44')](_0x25f5d4[_0x3ad0('0x30')]['fields']));_0x2311f9[_0x3ad0('0x33')]=_0x2311f9[_0x3ad0('0x33')]['length']?_0x2311f9[_0x3ad0('0x33')]:_0x4d6bf3[_0x3ad0('0x2f')];_0x2311f9[_0x3ad0('0x4a')]=qs[_0x3ad0('0x35')](_0x25f5d4[_0x3ad0('0x30')][_0x3ad0('0x35')]);_0x2311f9[_0x3ad0('0x36')]=qs[_0x3ad0('0x37')](_[_0x3ad0('0x38')](_0x25f5d4['query'],_0x4d6bf3[_0x3ad0('0x37')]));if(_0x25f5d4[_0x3ad0('0x30')][_0x3ad0('0x39')]){_0x2311f9[_0x3ad0('0x36')]=_[_0x3ad0('0x3a')](_0x2311f9['where'],{'$or':_[_0x3ad0('0x2a')](_0x2311f9['attributes'],function(_0x57473e){var _0x5ee856={};_0x5ee856[_0x57473e]={'$like':'%'+_0x25f5d4[_0x3ad0('0x30')][_0x3ad0('0x39')]+'%'};return _0x5ee856;})});}_0x2311f9=_[_0x3ad0('0x3a')]({},_0x2311f9,_0x25f5d4[_0x3ad0('0x3c')]);return _0x29cf6a[_0x3ad0('0x4c')](_0x2311f9);}})['then'](function(_0x32c670){if(_0x32c670){_0x30ffe3=_0x32c670[_0x3ad0('0x45')];if(!_0x25f5d4[_0x3ad0('0x30')][_0x3ad0('0x34')](_0x3ad0('0x4b'))){_0x2311f9[_0x3ad0('0x1d')]=qs[_0x3ad0('0x1d')](_0x25f5d4[_0x3ad0('0x30')][_0x3ad0('0x1d')]);_0x2311f9[_0x3ad0('0x1f')]=qs[_0x3ad0('0x1f')](_0x25f5d4[_0x3ad0('0x30')]['offset']);}return _0x29cf6a[_0x3ad0('0x4c')](_0x2311f9);}})[_0x3ad0('0x24')](function(_0x22223b){if(_0x22223b){return _0x22223b?{'count':_0x30ffe3,'rows':_0x22223b}:null;}})[_0x3ad0('0x24')](respondWithResult(_0x568ebc,null))[_0x3ad0('0x41')](handleError(_0x568ebc,null));};exports['getDescriptions']=function(_0x3c7b74,_0x1024c5,_0xdfb9d0){var _0x4e5183={};var _0x2417d9={};var _0x59b36f;var _0x42ece5;return db['ZohoConfiguration'][_0x3ad0('0x4d')]({'where':{'id':_0x3c7b74[_0x3ad0('0x42')]['id']}})[_0x3ad0('0x24')](handleEntityNotFound(_0x1024c5,null))[_0x3ad0('0x24')](function(_0x524673){if(_0x524673){_0x59b36f=_0x524673;_0x2417d9[_0x3ad0('0x2f')]=_[_0x3ad0('0x31')](db[_0x3ad0('0x4e')]['rawAttributes']);_0x2417d9[_0x3ad0('0x30')]=_[_0x3ad0('0x31')](_0x3c7b74[_0x3ad0('0x30')]);_0x2417d9['filters']=_['intersection'](_0x2417d9[_0x3ad0('0x2f')],_0x2417d9[_0x3ad0('0x30')]);_0x4e5183['attributes']=_[_0x3ad0('0x32')](_0x2417d9[_0x3ad0('0x2f')],qs[_0x3ad0('0x44')](_0x3c7b74[_0x3ad0('0x30')][_0x3ad0('0x44')]));_0x4e5183[_0x3ad0('0x33')]=_0x4e5183[_0x3ad0('0x33')][_0x3ad0('0x45')]?_0x4e5183[_0x3ad0('0x33')]:_0x2417d9[_0x3ad0('0x2f')];_0x4e5183[_0x3ad0('0x4a')]=qs['sort'](_0x3c7b74[_0x3ad0('0x30')][_0x3ad0('0x35')]);_0x4e5183['where']=qs[_0x3ad0('0x37')](_[_0x3ad0('0x38')](_0x3c7b74[_0x3ad0('0x30')],_0x2417d9[_0x3ad0('0x37')]));if(_0x3c7b74[_0x3ad0('0x30')][_0x3ad0('0x39')]){_0x4e5183['where']=_['merge'](_0x4e5183[_0x3ad0('0x36')],{'$or':_['map'](_0x4e5183[_0x3ad0('0x33')],function(_0x36f8b5){var _0x1d023c={};_0x1d023c[_0x36f8b5]={'$like':'%'+_0x3c7b74[_0x3ad0('0x30')][_0x3ad0('0x39')]+'%'};return _0x1d023c;})});}_0x4e5183=_['merge']({},_0x4e5183,_0x3c7b74[_0x3ad0('0x3c')]);return _0x59b36f[_0x3ad0('0x4f')](_0x4e5183);}})[_0x3ad0('0x24')](function(_0x46aaee){if(_0x46aaee){_0x42ece5=_0x46aaee['length'];if(!_0x3c7b74[_0x3ad0('0x30')][_0x3ad0('0x34')]('nolimit')){_0x4e5183[_0x3ad0('0x1d')]=qs[_0x3ad0('0x1d')](_0x3c7b74[_0x3ad0('0x30')][_0x3ad0('0x1d')]);_0x4e5183[_0x3ad0('0x1f')]=qs[_0x3ad0('0x1f')](_0x3c7b74['query']['offset']);}return _0x59b36f[_0x3ad0('0x4f')](_0x4e5183);}})[_0x3ad0('0x24')](function(_0x19e4f1){if(_0x19e4f1){return _0x19e4f1?{'count':_0x42ece5,'rows':_0x19e4f1}:null;}})[_0x3ad0('0x24')](respondWithResult(_0x1024c5,null))[_0x3ad0('0x41')](handleError(_0x1024c5,null));}; \ No newline at end of file +var _0x78e8=['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','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','include','options','find','create','body','getFields','ZohoField','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x78e8,0x18f));var _0x878e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x78e8[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x878e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x878e('0x1'));var rp=require(_0x878e('0x2'));var moment=require('moment');var BPromise=require(_0x878e('0x3'));var Mustache=require('mustache');var util=require(_0x878e('0x4'));var path=require(_0x878e('0x5'));var sox=require('sox');var csv=require(_0x878e('0x6'));var ejs=require(_0x878e('0x7'));var fs=require('fs');var fs_extra=require(_0x878e('0x8'));var _=require(_0x878e('0x9'));var squel=require(_0x878e('0xa'));var crypto=require(_0x878e('0xb'));var jsforce=require(_0x878e('0xc'));var deskjs=require(_0x878e('0xd'));var toCsv=require(_0x878e('0x6'));var querystring=require(_0x878e('0xe'));var Papa=require(_0x878e('0xf'));var Redis=require(_0x878e('0x10'));var authService=require(_0x878e('0x11'));var qs=require(_0x878e('0x12'));var as=require(_0x878e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x878e('0x14'))(_0x878e('0x15'));var utils=require(_0x878e('0x16'));var config=require(_0x878e('0x17'));var licenseUtil=require(_0x878e('0x18'));var db=require(_0x878e('0x19'))['db'];function respondWithStatusCode(_0xf54ec9,_0x4dc0fe){_0x4dc0fe=_0x4dc0fe||0xcc;return function(_0x3ef74a){if(_0x3ef74a){return _0xf54ec9[_0x878e('0x1a')](_0x4dc0fe);}return _0xf54ec9[_0x878e('0x1b')](_0x4dc0fe)[_0x878e('0x1c')]();};}function respondWithResult(_0x4598a7,_0x4b3cdf){_0x4b3cdf=_0x4b3cdf||0xc8;return function(_0x313c60){if(_0x313c60){return _0x4598a7[_0x878e('0x1b')](_0x4b3cdf)[_0x878e('0x1d')](_0x313c60);}};}function respondWithFilteredResult(_0x58e23b,_0x1d4267){return function(_0x3ddd6c){if(_0x3ddd6c){var _0x69ea2c=typeof _0x1d4267[_0x878e('0x1e')]==='undefined'&&typeof _0x1d4267[_0x878e('0x1f')]===_0x878e('0x20');var _0x32aad6=_0x3ddd6c[_0x878e('0x21')];var _0x3649cd=_0x69ea2c?0x0:_0x1d4267[_0x878e('0x1e')];var _0x41837b=_0x69ea2c?_0x3ddd6c[_0x878e('0x21')]:_0x1d4267[_0x878e('0x1e')]+_0x1d4267[_0x878e('0x1f')];var _0x261757;if(_0x41837b>=_0x32aad6){_0x41837b=_0x32aad6;_0x261757=0xc8;}else{_0x261757=0xce;}_0x58e23b['status'](_0x261757);return _0x58e23b[_0x878e('0x22')](_0x878e('0x23'),_0x3649cd+'-'+_0x41837b+'/'+_0x32aad6)[_0x878e('0x1d')](_0x3ddd6c);}return null;};}function patchUpdates(_0x15f318){return function(_0x7d82eb){try{jsonpatch[_0x878e('0x24')](_0x7d82eb,_0x15f318,!![]);}catch(_0x11d912){return BPromise['reject'](_0x11d912);}return _0x7d82eb[_0x878e('0x25')]();};}function saveUpdates(_0x23de18,_0x56d95e){return function(_0x335d18){if(_0x335d18){return _0x335d18[_0x878e('0x26')](_0x23de18)[_0x878e('0x27')](function(_0x20c886){return _0x20c886;});}return null;};}function removeEntity(_0x416f17,_0x2bb839){return function(_0x4543b8){if(_0x4543b8){return _0x4543b8[_0x878e('0x28')]()[_0x878e('0x27')](function(){_0x416f17[_0x878e('0x1b')](0xcc)[_0x878e('0x1c')]();});}};}function handleEntityNotFound(_0x3e0738,_0x3b6bb7){return function(_0x3b27af){if(!_0x3b27af){_0x3e0738[_0x878e('0x1a')](0x194);}return _0x3b27af;};}function handleError(_0x2f676b,_0x2dab0f){_0x2dab0f=_0x2dab0f||0x1f4;return function(_0x39f719){logger[_0x878e('0x29')](_0x39f719[_0x878e('0x2a')]);if(_0x39f719[_0x878e('0x2b')]){delete _0x39f719[_0x878e('0x2b')];}_0x2f676b[_0x878e('0x1b')](_0x2dab0f)['send'](_0x39f719);};}exports[_0x878e('0x2c')]=function(_0xb0cda7,_0x2259b1){var _0x1173ee={},_0x21b763={},_0x49daf5={'count':0x0,'rows':[]};var _0x25994e=_[_0x878e('0x2d')](db[_0x878e('0x2e')][_0x878e('0x2f')],function(_0x22b641){return{'name':_0x22b641[_0x878e('0x30')],'type':_0x22b641[_0x878e('0x31')][_0x878e('0x32')]};});_0x21b763['model']=_[_0x878e('0x2d')](_0x25994e,'name');_0x21b763[_0x878e('0x33')]=_[_0x878e('0x34')](_0xb0cda7['query']);_0x21b763[_0x878e('0x35')]=_[_0x878e('0x36')](_0x21b763[_0x878e('0x37')],_0x21b763[_0x878e('0x33')]);_0x1173ee[_0x878e('0x38')]=_[_0x878e('0x36')](_0x21b763[_0x878e('0x37')],qs[_0x878e('0x39')](_0xb0cda7[_0x878e('0x33')][_0x878e('0x39')]));_0x1173ee[_0x878e('0x38')]=_0x1173ee[_0x878e('0x38')][_0x878e('0x3a')]?_0x1173ee['attributes']:_0x21b763['model'];if(!_0xb0cda7[_0x878e('0x33')][_0x878e('0x3b')](_0x878e('0x3c'))){_0x1173ee['limit']=qs['limit'](_0xb0cda7[_0x878e('0x33')][_0x878e('0x1f')]);_0x1173ee[_0x878e('0x1e')]=qs['offset'](_0xb0cda7[_0x878e('0x33')][_0x878e('0x1e')]);}_0x1173ee[_0x878e('0x3d')]=qs[_0x878e('0x3e')](_0xb0cda7[_0x878e('0x33')][_0x878e('0x3e')]);_0x1173ee[_0x878e('0x3f')]=qs['filters'](_[_0x878e('0x40')](_0xb0cda7[_0x878e('0x33')],_0x21b763[_0x878e('0x35')]),_0x25994e);if(_0xb0cda7[_0x878e('0x33')][_0x878e('0x41')]){_0x1173ee[_0x878e('0x3f')]=_[_0x878e('0x42')](_0x1173ee[_0x878e('0x3f')],{'$or':_['map'](_0x25994e,function(_0x54021c){if(_0x54021c[_0x878e('0x31')]!=='VIRTUAL'){var _0x424999={};_0x424999[_0x54021c['name']]={'$like':'%'+_0xb0cda7['query']['filter']+'%'};return _0x424999;}})});}_0x1173ee=_['merge']({},_0x1173ee,_0xb0cda7['options']);var _0x552cdf={'where':_0x1173ee['where']};return db[_0x878e('0x2e')]['count'](_0x552cdf)[_0x878e('0x27')](function(_0x431635){_0x49daf5['count']=_0x431635;if(_0xb0cda7[_0x878e('0x33')][_0x878e('0x43')]){_0x1173ee['include']=[{'all':!![]}];}return db[_0x878e('0x2e')]['findAll'](_0x1173ee);})[_0x878e('0x27')](function(_0x4f4ba6){_0x49daf5[_0x878e('0x44')]=_0x4f4ba6;return _0x49daf5;})[_0x878e('0x27')](respondWithFilteredResult(_0x2259b1,_0x1173ee))[_0x878e('0x45')](handleError(_0x2259b1,null));};exports[_0x878e('0x46')]=function(_0x389582,_0xcf0561){var _0x206566={'raw':![],'where':{'id':_0x389582[_0x878e('0x47')]['id']}},_0x57ba8a={};_0x57ba8a[_0x878e('0x37')]=_[_0x878e('0x34')](db[_0x878e('0x2e')][_0x878e('0x2f')]);_0x57ba8a[_0x878e('0x33')]=_[_0x878e('0x34')](_0x389582['query']);_0x57ba8a[_0x878e('0x35')]=_['intersection'](_0x57ba8a['model'],_0x57ba8a[_0x878e('0x33')]);_0x206566[_0x878e('0x38')]=_[_0x878e('0x36')](_0x57ba8a['model'],qs[_0x878e('0x39')](_0x389582['query'][_0x878e('0x39')]));_0x206566['attributes']=_0x206566[_0x878e('0x38')]['length']?_0x206566[_0x878e('0x38')]:_0x57ba8a[_0x878e('0x37')];if(_0x389582[_0x878e('0x33')][_0x878e('0x43')]){_0x206566[_0x878e('0x48')]=[{'all':!![]}];}_0x206566=_[_0x878e('0x42')]({},_0x206566,_0x389582[_0x878e('0x49')]);return db[_0x878e('0x2e')][_0x878e('0x4a')](_0x206566)[_0x878e('0x27')](handleEntityNotFound(_0xcf0561,null))[_0x878e('0x27')](respondWithResult(_0xcf0561,null))[_0x878e('0x45')](handleError(_0xcf0561,null));};exports[_0x878e('0x4b')]=function(_0x2aa01b,_0x5f39f1){return db['ZohoConfiguration'][_0x878e('0x4b')](_0x2aa01b['body'],{})['then'](respondWithResult(_0x5f39f1,0xc9))[_0x878e('0x45')](handleError(_0x5f39f1,null));};exports['update']=function(_0x41f6c9,_0xb96d6e){if(_0x41f6c9[_0x878e('0x4c')]['id']){delete _0x41f6c9[_0x878e('0x4c')]['id'];}return db[_0x878e('0x2e')][_0x878e('0x4a')]({'where':{'id':_0x41f6c9['params']['id']}})['then'](handleEntityNotFound(_0xb96d6e,null))[_0x878e('0x27')](saveUpdates(_0x41f6c9[_0x878e('0x4c')],null))[_0x878e('0x27')](respondWithResult(_0xb96d6e,null))[_0x878e('0x45')](handleError(_0xb96d6e,null));};exports[_0x878e('0x28')]=function(_0x5a22a4,_0x1f3a4b){return db['ZohoConfiguration'][_0x878e('0x4a')]({'where':{'id':_0x5a22a4['params']['id']}})[_0x878e('0x27')](handleEntityNotFound(_0x1f3a4b,null))[_0x878e('0x27')](removeEntity(_0x1f3a4b,null))['catch'](handleError(_0x1f3a4b,null));};exports[_0x878e('0x4d')]=function(_0x104c83,_0x48b7d1,_0x30dfba){var _0x434321={};var _0x445a79={};var _0x768c66;var _0x4418f4;return db[_0x878e('0x2e')]['findOne']({'where':{'id':_0x104c83[_0x878e('0x47')]['id']}})[_0x878e('0x27')](handleEntityNotFound(_0x48b7d1,null))[_0x878e('0x27')](function(_0x46edd7){if(_0x46edd7){_0x768c66=_0x46edd7;_0x445a79[_0x878e('0x37')]=_[_0x878e('0x34')](db[_0x878e('0x4e')][_0x878e('0x2f')]);_0x445a79[_0x878e('0x33')]=_[_0x878e('0x34')](_0x104c83['query']);_0x445a79[_0x878e('0x35')]=_[_0x878e('0x36')](_0x445a79[_0x878e('0x37')],_0x445a79['query']);_0x434321[_0x878e('0x38')]=_['intersection'](_0x445a79['model'],qs[_0x878e('0x39')](_0x104c83['query'][_0x878e('0x39')]));_0x434321['attributes']=_0x434321[_0x878e('0x38')][_0x878e('0x3a')]?_0x434321['attributes']:_0x445a79[_0x878e('0x37')];_0x434321[_0x878e('0x3d')]=qs[_0x878e('0x3e')](_0x104c83[_0x878e('0x33')][_0x878e('0x3e')]);_0x434321[_0x878e('0x3f')]=qs['filters'](_[_0x878e('0x40')](_0x104c83['query'],_0x445a79['filters']));if(_0x104c83[_0x878e('0x33')][_0x878e('0x41')]){_0x434321['where']=_[_0x878e('0x42')](_0x434321[_0x878e('0x3f')],{'$or':_[_0x878e('0x2d')](_0x434321[_0x878e('0x38')],function(_0x277a83){var _0x20cfb8={};_0x20cfb8[_0x277a83]={'$like':'%'+_0x104c83[_0x878e('0x33')][_0x878e('0x41')]+'%'};return _0x20cfb8;})});}_0x434321=_['merge']({},_0x434321,_0x104c83[_0x878e('0x49')]);return _0x768c66[_0x878e('0x4d')](_0x434321);}})['then'](function(_0x3947bd){if(_0x3947bd){_0x4418f4=_0x3947bd[_0x878e('0x3a')];if(!_0x104c83['query'][_0x878e('0x3b')]('nolimit')){_0x434321[_0x878e('0x1f')]=qs[_0x878e('0x1f')](_0x104c83[_0x878e('0x33')]['limit']);_0x434321[_0x878e('0x1e')]=qs['offset'](_0x104c83['query'][_0x878e('0x1e')]);}return _0x768c66['getFields'](_0x434321);}})[_0x878e('0x27')](function(_0x3cce07){if(_0x3cce07){return _0x3cce07?{'count':_0x4418f4,'rows':_0x3cce07}:null;}})['then'](respondWithResult(_0x48b7d1,null))[_0x878e('0x45')](handleError(_0x48b7d1,null));};exports[_0x878e('0x4f')]=function(_0x22c392,_0x264ff1,_0xba165f){var _0x513dc1={};var _0xb696cb={};var _0x4fa947;var _0x1d919d;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x22c392[_0x878e('0x47')]['id']}})[_0x878e('0x27')](handleEntityNotFound(_0x264ff1,null))[_0x878e('0x27')](function(_0x3d83b9){if(_0x3d83b9){_0x4fa947=_0x3d83b9;_0xb696cb[_0x878e('0x37')]=_[_0x878e('0x34')](db[_0x878e('0x4e')][_0x878e('0x2f')]);_0xb696cb[_0x878e('0x33')]=_['keys'](_0x22c392[_0x878e('0x33')]);_0xb696cb['filters']=_[_0x878e('0x36')](_0xb696cb[_0x878e('0x37')],_0xb696cb[_0x878e('0x33')]);_0x513dc1[_0x878e('0x38')]=_['intersection'](_0xb696cb[_0x878e('0x37')],qs[_0x878e('0x39')](_0x22c392['query'][_0x878e('0x39')]));_0x513dc1[_0x878e('0x38')]=_0x513dc1[_0x878e('0x38')][_0x878e('0x3a')]?_0x513dc1[_0x878e('0x38')]:_0xb696cb['model'];_0x513dc1[_0x878e('0x3d')]=qs[_0x878e('0x3e')](_0x22c392[_0x878e('0x33')][_0x878e('0x3e')]);_0x513dc1[_0x878e('0x3f')]=qs[_0x878e('0x35')](_[_0x878e('0x40')](_0x22c392['query'],_0xb696cb['filters']));if(_0x22c392[_0x878e('0x33')][_0x878e('0x41')]){_0x513dc1[_0x878e('0x3f')]=_[_0x878e('0x42')](_0x513dc1[_0x878e('0x3f')],{'$or':_[_0x878e('0x2d')](_0x513dc1['attributes'],function(_0x432213){var _0x11b944={};_0x11b944[_0x432213]={'$like':'%'+_0x22c392[_0x878e('0x33')]['filter']+'%'};return _0x11b944;})});}_0x513dc1=_['merge']({},_0x513dc1,_0x22c392[_0x878e('0x49')]);return _0x4fa947[_0x878e('0x4f')](_0x513dc1);}})['then'](function(_0x55c8cb){if(_0x55c8cb){_0x1d919d=_0x55c8cb[_0x878e('0x3a')];if(!_0x22c392[_0x878e('0x33')][_0x878e('0x3b')](_0x878e('0x3c'))){_0x513dc1[_0x878e('0x1f')]=qs['limit'](_0x22c392[_0x878e('0x33')]['limit']);_0x513dc1[_0x878e('0x1e')]=qs[_0x878e('0x1e')](_0x22c392[_0x878e('0x33')][_0x878e('0x1e')]);}return _0x4fa947[_0x878e('0x4f')](_0x513dc1);}})[_0x878e('0x27')](function(_0xf0d61b){if(_0xf0d61b){return _0xf0d61b?{'count':_0x1d919d,'rows':_0xf0d61b}:null;}})[_0x878e('0x27')](respondWithResult(_0x264ff1,null))[_0x878e('0x45')](handleError(_0x264ff1,null));};exports[_0x878e('0x50')]=function(_0x58bba3,_0x3d582a,_0x282e82){var _0x476a2e={};var _0x2a9b32={};var _0x40279a;var _0x39858d;return db[_0x878e('0x2e')]['findOne']({'where':{'id':_0x58bba3[_0x878e('0x47')]['id']}})[_0x878e('0x27')](handleEntityNotFound(_0x3d582a,null))[_0x878e('0x27')](function(_0x416804){if(_0x416804){_0x40279a=_0x416804;_0x2a9b32[_0x878e('0x37')]=_['keys'](db[_0x878e('0x4e')][_0x878e('0x2f')]);_0x2a9b32['query']=_[_0x878e('0x34')](_0x58bba3[_0x878e('0x33')]);_0x2a9b32[_0x878e('0x35')]=_[_0x878e('0x36')](_0x2a9b32[_0x878e('0x37')],_0x2a9b32['query']);_0x476a2e[_0x878e('0x38')]=_[_0x878e('0x36')](_0x2a9b32['model'],qs['fields'](_0x58bba3[_0x878e('0x33')][_0x878e('0x39')]));_0x476a2e[_0x878e('0x38')]=_0x476a2e['attributes']['length']?_0x476a2e[_0x878e('0x38')]:_0x2a9b32[_0x878e('0x37')];_0x476a2e[_0x878e('0x3d')]=qs[_0x878e('0x3e')](_0x58bba3[_0x878e('0x33')][_0x878e('0x3e')]);_0x476a2e[_0x878e('0x3f')]=qs['filters'](_[_0x878e('0x40')](_0x58bba3[_0x878e('0x33')],_0x2a9b32[_0x878e('0x35')]));if(_0x58bba3[_0x878e('0x33')]['filter']){_0x476a2e[_0x878e('0x3f')]=_['merge'](_0x476a2e[_0x878e('0x3f')],{'$or':_[_0x878e('0x2d')](_0x476a2e['attributes'],function(_0x32312d){var _0x3c275c={};_0x3c275c[_0x32312d]={'$like':'%'+_0x58bba3[_0x878e('0x33')]['filter']+'%'};return _0x3c275c;})});}_0x476a2e=_['merge']({},_0x476a2e,_0x58bba3['options']);return _0x40279a[_0x878e('0x50')](_0x476a2e);}})[_0x878e('0x27')](function(_0x30a44f){if(_0x30a44f){_0x39858d=_0x30a44f['length'];if(!_0x58bba3[_0x878e('0x33')][_0x878e('0x3b')](_0x878e('0x3c'))){_0x476a2e[_0x878e('0x1f')]=qs[_0x878e('0x1f')](_0x58bba3['query'][_0x878e('0x1f')]);_0x476a2e['offset']=qs['offset'](_0x58bba3[_0x878e('0x33')][_0x878e('0x1e')]);}return _0x40279a['getDescriptions'](_0x476a2e);}})['then'](function(_0x28af92){if(_0x28af92){return _0x28af92?{'count':_0x39858d,'rows':_0x28af92}:null;}})[_0x878e('0x27')](respondWithResult(_0x3d582a,null))[_0x878e('0x45')](handleError(_0x3d582a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 397c3d9..39580f1 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 _0x4775=['exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x47c74d,_0x515b4b){var _0x4b5f96=function(_0x3d7616){while(--_0x3d7616){_0x47c74d['push'](_0x47c74d['shift']());}};_0x4b5f96(++_0x515b4b);}(_0x4775,0x1cb));var _0x5477=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x4775[_0x120123];return _0x3bec4c;};'use strict';var _=require(_0x5477('0x0'));var util=require(_0x5477('0x1'));var logger=require(_0x5477('0x2'))('api');var moment=require(_0x5477('0x3'));var BPromise=require(_0x5477('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5477('0x5'));var rimraf=require(_0x5477('0x6'));var config=require(_0x5477('0x7'));var attributes=require(_0x5477('0x8'));module[_0x5477('0x9')]=function(_0x45ec92,_0x3d0d47){return _0x45ec92[_0x5477('0xa')](_0x5477('0xb'),attributes,{'tableName':_0x5477('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb986=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0xca1fe5,_0x5def05){var _0x50e423=function(_0x360e0d){while(--_0x360e0d){_0xca1fe5['push'](_0xca1fe5['shift']());}};_0x50e423(++_0x5def05);}(_0xb986,0x1b9));var _0x6b98=function(_0xe46a0c,_0x3dab15){_0xe46a0c=_0xe46a0c-0x0;var _0x2344cf=_0xb986[_0xe46a0c];return _0x2344cf;};'use strict';var _=require(_0x6b98('0x0'));var util=require(_0x6b98('0x1'));var logger=require(_0x6b98('0x2'))(_0x6b98('0x3'));var moment=require(_0x6b98('0x4'));var BPromise=require(_0x6b98('0x5'));var rp=require(_0x6b98('0x6'));var fs=require('fs');var path=require(_0x6b98('0x7'));var rimraf=require('rimraf');var config=require(_0x6b98('0x8'));var attributes=require(_0x6b98('0x9'));module[_0x6b98('0xa')]=function(_0x27dae2,_0x5dc2cf){return _0x27dae2['define'](_0x6b98('0xb'),attributes,{'tableName':_0x6b98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 825b797..b251e7e 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 _0xf337=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x588077,_0x981d25){var _0x43ea8c=function(_0x90e001){while(--_0x90e001){_0x588077['push'](_0x588077['shift']());}};_0x43ea8c(++_0x981d25);}(_0xf337,0x160));var _0x7f33=function(_0x501ddd,_0x3a5338){_0x501ddd=_0x501ddd-0x0;var _0x19be7a=_0xf337[_0x501ddd];return _0x19be7a;};'use strict';var _=require(_0x7f33('0x0'));var util=require(_0x7f33('0x1'));var moment=require(_0x7f33('0x2'));var BPromise=require(_0x7f33('0x3'));var rs=require(_0x7f33('0x4'));var fs=require('fs');var Redis=require(_0x7f33('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f33('0x6'));var logger=require(_0x7f33('0x7'))(_0x7f33('0x8'));var config=require(_0x7f33('0x9'));var jayson=require(_0x7f33('0xa'));var client=jayson[_0x7f33('0xb')][_0x7f33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a9971,_0x209214,_0x542f6c){return new BPromise(function(_0x4528e0,_0x5ef1e2){return client[_0x7f33('0xd')](_0x3a9971,_0x542f6c)['then'](function(_0x1bd7ad){logger[_0x7f33('0xe')](_0x7f33('0xf'),_0x209214,_0x7f33('0x10'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x209214,_0x7f33('0x10'),JSON[_0x7f33('0x11')](_0x1bd7ad));if(_0x1bd7ad[_0x7f33('0x12')]){if(_0x1bd7ad['error'][_0x7f33('0x13')]===0x1f4){logger[_0x7f33('0x12')](_0x7f33('0xf'),_0x209214,_0x1bd7ad[_0x7f33('0x12')][_0x7f33('0x14')]);return _0x5ef1e2(_0x1bd7ad[_0x7f33('0x12')]['message']);}logger['error'](_0x7f33('0xf'),_0x209214,_0x1bd7ad[_0x7f33('0x12')][_0x7f33('0x14')]);return _0x4528e0(_0x1bd7ad[_0x7f33('0x12')]['message']);}else{logger[_0x7f33('0xe')](_0x7f33('0xf'),_0x209214,_0x7f33('0x10'));_0x4528e0(_0x1bd7ad[_0x7f33('0x15')][_0x7f33('0x14')]);}})['catch'](function(_0x81cde0){logger[_0x7f33('0x12')](_0x7f33('0xf'),_0x209214,_0x81cde0);_0x5ef1e2(_0x81cde0);});});} \ No newline at end of file +var _0xcf43=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment'];(function(_0x4907b6,_0xa8d26c){var _0x23c21f=function(_0x395805){while(--_0x395805){_0x4907b6['push'](_0x4907b6['shift']());}};_0x23c21f(++_0xa8d26c);}(_0xcf43,0x1d9));var _0x3cf4=function(_0x295a05,_0x27a868){_0x295a05=_0x295a05-0x0;var _0x47601a=_0xcf43[_0x295a05];return _0x47601a;};'use strict';var _=require('lodash');var util=require(_0x3cf4('0x0'));var moment=require(_0x3cf4('0x1'));var BPromise=require('bluebird');var rs=require(_0x3cf4('0x2'));var fs=require('fs');var Redis=require(_0x3cf4('0x3'));var db=require(_0x3cf4('0x4'))['db'];var utils=require(_0x3cf4('0x5'));var logger=require('../../config/logger')(_0x3cf4('0x6'));var config=require('../../config/environment');var jayson=require(_0x3cf4('0x7'));var client=jayson[_0x3cf4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20ea37,_0x27a2d0,_0x2f6468){return new BPromise(function(_0xc95f27,_0x4e7b76){return client[_0x3cf4('0x9')](_0x20ea37,_0x2f6468)[_0x3cf4('0xa')](function(_0x1779c3){logger[_0x3cf4('0xb')](_0x3cf4('0xc'),_0x27a2d0,'request\x20sent');logger['debug'](_0x3cf4('0xd'),_0x27a2d0,_0x3cf4('0xe'),JSON[_0x3cf4('0xf')](_0x1779c3));if(_0x1779c3[_0x3cf4('0x10')]){if(_0x1779c3[_0x3cf4('0x10')][_0x3cf4('0x11')]===0x1f4){logger['error'](_0x3cf4('0xc'),_0x27a2d0,_0x1779c3[_0x3cf4('0x10')][_0x3cf4('0x12')]);return _0x4e7b76(_0x1779c3[_0x3cf4('0x10')][_0x3cf4('0x12')]);}logger[_0x3cf4('0x10')](_0x3cf4('0xc'),_0x27a2d0,_0x1779c3[_0x3cf4('0x10')][_0x3cf4('0x12')]);return _0xc95f27(_0x1779c3[_0x3cf4('0x10')][_0x3cf4('0x12')]);}else{logger[_0x3cf4('0xb')](_0x3cf4('0xc'),_0x27a2d0,_0x3cf4('0xe'));_0xc95f27(_0x1779c3['result'][_0x3cf4('0x12')]);}})['catch'](function(_0x239dc3){logger['error'](_0x3cf4('0xc'),_0x27a2d0,_0x239dc3);_0x4e7b76(_0x239dc3);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e7ba819..5f82ebb 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 _0x7c8e=['delete','multer','util','express','fs-extra','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create','update'];(function(_0x4a439a,_0x5a0f41){var _0x1477f0=function(_0x2ae345){while(--_0x2ae345){_0x4a439a['push'](_0x4a439a['shift']());}};_0x1477f0(++_0x5a0f41);}(_0x7c8e,0x1dd));var _0xe7c8=function(_0x48604b,_0x518ed1){_0x48604b=_0x48604b-0x0;var _0x874edb=_0x7c8e[_0x48604b];return _0x874edb;};'use strict';var multer=require(_0xe7c8('0x0'));var util=require(_0xe7c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe7c8('0x2'));var router=express['Router']();var fs_extra=require(_0xe7c8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe7c8('0x4'));var config=require('../../config/environment');var controller=require(_0xe7c8('0x5'));router[_0xe7c8('0x6')]('/',auth[_0xe7c8('0x7')](),controller[_0xe7c8('0x8')]);router['get'](_0xe7c8('0x9'),auth[_0xe7c8('0x7')](),controller[_0xe7c8('0xa')]);router['post']('/',auth[_0xe7c8('0x7')](),controller[_0xe7c8('0xb')]);router['put'](_0xe7c8('0x9'),auth[_0xe7c8('0x7')](),controller[_0xe7c8('0xc')]);router[_0xe7c8('0xd')](_0xe7c8('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd140=['./intZohoField.controller','get','isAuthenticated','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0xd140,0x108));var _0x0d14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd140[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0d14('0x0'));var util=require(_0x0d14('0x1'));var path=require(_0x0d14('0x2'));var timeout=require(_0x0d14('0x3'));var express=require(_0x0d14('0x4'));var router=express['Router']();var fs_extra=require(_0x0d14('0x5'));var auth=require(_0x0d14('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0d14('0x7'));var controller=require(_0x0d14('0x8'));router[_0x0d14('0x9')]('/',auth[_0x0d14('0xa')](),controller['index']);router[_0x0d14('0x9')](_0x0d14('0xb'),auth[_0x0d14('0xa')](),controller[_0x0d14('0xc')]);router[_0x0d14('0xd')]('/',auth[_0x0d14('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0d14('0xe')]);router[_0x0d14('0xf')]('/:id',auth[_0x0d14('0xa')](),controller['destroy']);module[_0x0d14('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index dd84027..1c72690 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 _0x7c64=['keyValue','picklist','STRING','ENUM','variable','customVariable','sequelize','exports','string'];(function(_0x3e84c7,_0x101a8e){var _0x47be67=function(_0x36e8e8){while(--_0x36e8e8){_0x3e84c7['push'](_0x3e84c7['shift']());}};_0x47be67(++_0x101a8e);}(_0x7c64,0xf0));var _0x47c6=function(_0x3db7f5,_0x5ac8b2){_0x3db7f5=_0x3db7f5-0x0;var _0x47d743=_0x7c64[_0x3db7f5];return _0x47d743;};'use strict';var Sequelize=require(_0x47c6('0x0'));module[_0x47c6('0x1')]={'type':{'type':Sequelize['ENUM'](_0x47c6('0x2'),'variable','customVariable',_0x47c6('0x3'),_0x47c6('0x4')),'defaultValue':_0x47c6('0x2')},'content':{'type':Sequelize[_0x47c6('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x47c6('0x6')]('string',_0x47c6('0x7'),_0x47c6('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x47c6('0x5')]},'nameField':{'type':Sequelize[_0x47c6('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8aed=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize'];(function(_0x37102a,_0x31ecdb){var _0x4cc513=function(_0x506830){while(--_0x506830){_0x37102a['push'](_0x37102a['shift']());}};_0x4cc513(++_0x31ecdb);}(_0x8aed,0x8b));var _0xd8ae=function(_0x31f8c8,_0x2e9fec){_0x31f8c8=_0x31f8c8-0x0;var _0x1d34e3=_0x8aed[_0x31f8c8];return _0x1d34e3;};'use strict';var Sequelize=require(_0xd8ae('0x0'));module[_0xd8ae('0x1')]={'type':{'type':Sequelize[_0xd8ae('0x2')]('string',_0xd8ae('0x3'),_0xd8ae('0x4'),_0xd8ae('0x5'),_0xd8ae('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd8ae('0x7')]},'key':{'type':Sequelize[_0xd8ae('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xd8ae('0x8'),_0xd8ae('0x3'),_0xd8ae('0x4'))},'keyContent':{'type':Sequelize[_0xd8ae('0x7')]},'idField':{'type':Sequelize[_0xd8ae('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd8ae('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd8ae('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b12b4c4..baece88 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 _0x3557=['fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','include','findAll','catch','show','params','includeAll','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','ZohoField','rawAttributes','type','key','model','keys','query','intersection','attributes'];(function(_0x1364e0,_0x439baa){var _0xa0ca3b=function(_0x3ba557){while(--_0x3ba557){_0x1364e0['push'](_0x1364e0['shift']());}};_0xa0ca3b(++_0x439baa);}(_0x3557,0x137));var _0x7355=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0x3557[_0x139b85];return _0x1e833f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7355('0x0'));var jsonpatch=require(_0x7355('0x1'));var rp=require(_0x7355('0x2'));var moment=require(_0x7355('0x3'));var BPromise=require(_0x7355('0x4'));var Mustache=require(_0x7355('0x5'));var util=require(_0x7355('0x6'));var path=require(_0x7355('0x7'));var sox=require(_0x7355('0x8'));var csv=require('to-csv');var ejs=require(_0x7355('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7355('0xa'));var squel=require(_0x7355('0xb'));var crypto=require(_0x7355('0xc'));var jsforce=require(_0x7355('0xd'));var deskjs=require(_0x7355('0xe'));var toCsv=require(_0x7355('0xf'));var querystring=require(_0x7355('0x10'));var Papa=require(_0x7355('0x11'));var Redis=require('ioredis');var authService=require(_0x7355('0x12'));var qs=require(_0x7355('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7355('0x14'));var logger=require(_0x7355('0x15'))('api');var utils=require(_0x7355('0x16'));var config=require(_0x7355('0x17'));var licenseUtil=require(_0x7355('0x18'));var db=require(_0x7355('0x19'))['db'];function respondWithStatusCode(_0x39ad86,_0x4f9eec){_0x4f9eec=_0x4f9eec||0xcc;return function(_0x4dcb8b){if(_0x4dcb8b){return _0x39ad86[_0x7355('0x1a')](_0x4f9eec);}return _0x39ad86[_0x7355('0x1b')](_0x4f9eec)[_0x7355('0x1c')]();};}function respondWithResult(_0x76b4ef,_0x3c9862){_0x3c9862=_0x3c9862||0xc8;return function(_0x38e34e){if(_0x38e34e){return _0x76b4ef[_0x7355('0x1b')](_0x3c9862)[_0x7355('0x1d')](_0x38e34e);}};}function respondWithFilteredResult(_0x2f59e9,_0x5b0ea1){return function(_0x153da3){if(_0x153da3){var _0xe7edee=typeof _0x5b0ea1['offset']==='undefined'&&typeof _0x5b0ea1[_0x7355('0x1e')]==='undefined';var _0x4dd8a0=_0x153da3['count'];var _0x32412e=_0xe7edee?0x0:_0x5b0ea1[_0x7355('0x1f')];var _0xb111a=_0xe7edee?_0x153da3[_0x7355('0x20')]:_0x5b0ea1[_0x7355('0x1f')]+_0x5b0ea1['limit'];var _0x7df38d;if(_0xb111a>=_0x4dd8a0){_0xb111a=_0x4dd8a0;_0x7df38d=0xc8;}else{_0x7df38d=0xce;}_0x2f59e9['status'](_0x7df38d);return _0x2f59e9[_0x7355('0x21')]('Content-Range',_0x32412e+'-'+_0xb111a+'/'+_0x4dd8a0)[_0x7355('0x1d')](_0x153da3);}return null;};}function patchUpdates(_0x4c0929){return function(_0x4dbcfe){try{jsonpatch[_0x7355('0x22')](_0x4dbcfe,_0x4c0929,!![]);}catch(_0x311a86){return BPromise[_0x7355('0x23')](_0x311a86);}return _0x4dbcfe[_0x7355('0x24')]();};}function saveUpdates(_0x5788af,_0x1ba300){return function(_0x27a380){if(_0x27a380){return _0x27a380[_0x7355('0x25')](_0x5788af)[_0x7355('0x26')](function(_0x1f65ec){return _0x1f65ec;});}return null;};}function removeEntity(_0x464fbf,_0x18507c){return function(_0xbb86c8){if(_0xbb86c8){return _0xbb86c8[_0x7355('0x27')]()[_0x7355('0x26')](function(){_0x464fbf[_0x7355('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28fde6,_0x64b015){return function(_0x528fe2){if(!_0x528fe2){_0x28fde6[_0x7355('0x1a')](0x194);}return _0x528fe2;};}function handleError(_0x5d7a52,_0x2e3e1c){_0x2e3e1c=_0x2e3e1c||0x1f4;return function(_0x2c38f6){logger[_0x7355('0x28')](_0x2c38f6[_0x7355('0x29')]);if(_0x2c38f6[_0x7355('0x2a')]){delete _0x2c38f6[_0x7355('0x2a')];}_0x5d7a52['status'](_0x2e3e1c)[_0x7355('0x2b')](_0x2c38f6);};}exports['index']=function(_0x7a2be4,_0xa06334){var _0x44ccba={},_0xe04de={},_0x2b307b={'count':0x0,'rows':[]};var _0x59e9e6=_[_0x7355('0x2c')](db[_0x7355('0x2d')][_0x7355('0x2e')],function(_0x3a4ae9){return{'name':_0x3a4ae9['fieldName'],'type':_0x3a4ae9[_0x7355('0x2f')][_0x7355('0x30')]};});_0xe04de[_0x7355('0x31')]=_[_0x7355('0x2c')](_0x59e9e6,'name');_0xe04de['query']=_[_0x7355('0x32')](_0x7a2be4[_0x7355('0x33')]);_0xe04de['filters']=_[_0x7355('0x34')](_0xe04de[_0x7355('0x31')],_0xe04de[_0x7355('0x33')]);_0x44ccba[_0x7355('0x35')]=_[_0x7355('0x34')](_0xe04de['model'],qs[_0x7355('0x36')](_0x7a2be4[_0x7355('0x33')][_0x7355('0x36')]));_0x44ccba[_0x7355('0x35')]=_0x44ccba['attributes'][_0x7355('0x37')]?_0x44ccba['attributes']:_0xe04de[_0x7355('0x31')];if(!_0x7a2be4[_0x7355('0x33')][_0x7355('0x38')](_0x7355('0x39'))){_0x44ccba['limit']=qs[_0x7355('0x1e')](_0x7a2be4[_0x7355('0x33')]['limit']);_0x44ccba[_0x7355('0x1f')]=qs[_0x7355('0x1f')](_0x7a2be4[_0x7355('0x33')][_0x7355('0x1f')]);}_0x44ccba['order']=qs[_0x7355('0x3a')](_0x7a2be4[_0x7355('0x33')][_0x7355('0x3a')]);_0x44ccba[_0x7355('0x3b')]=qs[_0x7355('0x3c')](_[_0x7355('0x3d')](_0x7a2be4[_0x7355('0x33')],_0xe04de['filters']),_0x59e9e6);if(_0x7a2be4[_0x7355('0x33')][_0x7355('0x3e')]){_0x44ccba[_0x7355('0x3b')]=_['merge'](_0x44ccba[_0x7355('0x3b')],{'$or':_[_0x7355('0x2c')](_0x59e9e6,function(_0x53f5c0){if(_0x53f5c0[_0x7355('0x2f')]!=='VIRTUAL'){var _0x2c0bc3={};_0x2c0bc3[_0x53f5c0['name']]={'$like':'%'+_0x7a2be4[_0x7355('0x33')][_0x7355('0x3e')]+'%'};return _0x2c0bc3;}})});}_0x44ccba=_[_0x7355('0x3f')]({},_0x44ccba,_0x7a2be4['options']);var _0xd514ab={'where':_0x44ccba['where']};return db[_0x7355('0x2d')][_0x7355('0x20')](_0xd514ab)[_0x7355('0x26')](function(_0x5cce29){_0x2b307b[_0x7355('0x20')]=_0x5cce29;if(_0x7a2be4['query']['includeAll']){_0x44ccba[_0x7355('0x40')]=[{'all':!![]}];}return db[_0x7355('0x2d')][_0x7355('0x41')](_0x44ccba);})[_0x7355('0x26')](function(_0x28e88e){_0x2b307b['rows']=_0x28e88e;return _0x2b307b;})[_0x7355('0x26')](respondWithFilteredResult(_0xa06334,_0x44ccba))[_0x7355('0x42')](handleError(_0xa06334,null));};exports[_0x7355('0x43')]=function(_0x4f8303,_0x42410){var _0x5a25b6={'raw':!![],'where':{'id':_0x4f8303[_0x7355('0x44')]['id']}},_0x177c52={};_0x177c52[_0x7355('0x31')]=_[_0x7355('0x32')](db[_0x7355('0x2d')][_0x7355('0x2e')]);_0x177c52['query']=_[_0x7355('0x32')](_0x4f8303[_0x7355('0x33')]);_0x177c52[_0x7355('0x3c')]=_[_0x7355('0x34')](_0x177c52[_0x7355('0x31')],_0x177c52[_0x7355('0x33')]);_0x5a25b6[_0x7355('0x35')]=_[_0x7355('0x34')](_0x177c52[_0x7355('0x31')],qs[_0x7355('0x36')](_0x4f8303[_0x7355('0x33')][_0x7355('0x36')]));_0x5a25b6[_0x7355('0x35')]=_0x5a25b6[_0x7355('0x35')]['length']?_0x5a25b6['attributes']:_0x177c52[_0x7355('0x31')];if(_0x4f8303[_0x7355('0x33')][_0x7355('0x45')]){_0x5a25b6[_0x7355('0x40')]=[{'all':!![]}];}_0x5a25b6=_[_0x7355('0x3f')]({},_0x5a25b6,_0x4f8303['options']);return db['ZohoField'][_0x7355('0x46')](_0x5a25b6)[_0x7355('0x26')](handleEntityNotFound(_0x42410,null))[_0x7355('0x26')](respondWithResult(_0x42410,null))[_0x7355('0x42')](handleError(_0x42410,null));};exports['create']=function(_0x4aa40f,_0x1f2261){return db[_0x7355('0x2d')][_0x7355('0x47')](_0x4aa40f[_0x7355('0x48')],{})['then'](respondWithResult(_0x1f2261,0xc9))[_0x7355('0x42')](handleError(_0x1f2261,null));};exports['update']=function(_0x2e968f,_0x297dc5){if(_0x2e968f[_0x7355('0x48')]['id']){delete _0x2e968f[_0x7355('0x48')]['id'];}return db[_0x7355('0x2d')][_0x7355('0x46')]({'where':{'id':_0x2e968f['params']['id']}})['then'](handleEntityNotFound(_0x297dc5,null))['then'](saveUpdates(_0x2e968f[_0x7355('0x48')],null))[_0x7355('0x26')](respondWithResult(_0x297dc5,null))['catch'](handleError(_0x297dc5,null));};exports['destroy']=function(_0x2c1270,_0x5090dc){return db[_0x7355('0x2d')][_0x7355('0x46')]({'where':{'id':_0x2c1270[_0x7355('0x44')]['id']}})[_0x7355('0x26')](handleEntityNotFound(_0x5090dc,null))['then'](removeEntity(_0x5090dc,null))[_0x7355('0x42')](handleError(_0x5090dc,null));}; \ No newline at end of file +var _0x52a1=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x52a1,0x1b7));var _0x152a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x52a1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x152a('0x0'));var rimraf=require(_0x152a('0x1'));var zipdir=require(_0x152a('0x2'));var jsonpatch=require(_0x152a('0x3'));var rp=require(_0x152a('0x4'));var moment=require(_0x152a('0x5'));var BPromise=require(_0x152a('0x6'));var Mustache=require('mustache');var util=require(_0x152a('0x7'));var path=require('path');var sox=require(_0x152a('0x8'));var csv=require(_0x152a('0x9'));var ejs=require(_0x152a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x152a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x152a('0xc'));var Papa=require(_0x152a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x152a('0xe'));var as=require(_0x152a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x152a('0x10'))(_0x152a('0x11'));var utils=require(_0x152a('0x12'));var config=require(_0x152a('0x13'));var licenseUtil=require(_0x152a('0x14'));var db=require(_0x152a('0x15'))['db'];function respondWithStatusCode(_0x51494a,_0x1554b9){_0x1554b9=_0x1554b9||0xcc;return function(_0x9d5d1a){if(_0x9d5d1a){return _0x51494a[_0x152a('0x16')](_0x1554b9);}return _0x51494a['status'](_0x1554b9)[_0x152a('0x17')]();};}function respondWithResult(_0x2f8817,_0x56bae6){_0x56bae6=_0x56bae6||0xc8;return function(_0x40a8d0){if(_0x40a8d0){return _0x2f8817['status'](_0x56bae6)[_0x152a('0x18')](_0x40a8d0);}};}function respondWithFilteredResult(_0x404bb8,_0x1c4b71){return function(_0x40e403){if(_0x40e403){var _0x1e411c=typeof _0x1c4b71[_0x152a('0x19')]===_0x152a('0x1a')&&typeof _0x1c4b71['limit']===_0x152a('0x1a');var _0x3f3dd4=_0x40e403['count'];var _0x32ad45=_0x1e411c?0x0:_0x1c4b71[_0x152a('0x19')];var _0x2f2539=_0x1e411c?_0x40e403[_0x152a('0x1b')]:_0x1c4b71[_0x152a('0x19')]+_0x1c4b71[_0x152a('0x1c')];var _0x30bf08;if(_0x2f2539>=_0x3f3dd4){_0x2f2539=_0x3f3dd4;_0x30bf08=0xc8;}else{_0x30bf08=0xce;}_0x404bb8['status'](_0x30bf08);return _0x404bb8['set'](_0x152a('0x1d'),_0x32ad45+'-'+_0x2f2539+'/'+_0x3f3dd4)['json'](_0x40e403);}return null;};}function patchUpdates(_0x1d1d58){return function(_0x2b94d4){try{jsonpatch[_0x152a('0x1e')](_0x2b94d4,_0x1d1d58,!![]);}catch(_0x5225b7){return BPromise[_0x152a('0x1f')](_0x5225b7);}return _0x2b94d4[_0x152a('0x20')]();};}function saveUpdates(_0x5bdbf5,_0x3897f9){return function(_0x53e96e){if(_0x53e96e){return _0x53e96e[_0x152a('0x21')](_0x5bdbf5)[_0x152a('0x22')](function(_0x53b648){return _0x53b648;});}return null;};}function removeEntity(_0x2b99c2,_0x5e7df4){return function(_0x3c57e3){if(_0x3c57e3){return _0x3c57e3[_0x152a('0x23')]()[_0x152a('0x22')](function(){_0x2b99c2[_0x152a('0x24')](0xcc)[_0x152a('0x17')]();});}};}function handleEntityNotFound(_0x1d3330,_0x1d0cf8){return function(_0x3849b4){if(!_0x3849b4){_0x1d3330[_0x152a('0x16')](0x194);}return _0x3849b4;};}function handleError(_0x109e78,_0x3ae873){_0x3ae873=_0x3ae873||0x1f4;return function(_0xa9acfc){logger[_0x152a('0x25')](_0xa9acfc[_0x152a('0x26')]);if(_0xa9acfc[_0x152a('0x27')]){delete _0xa9acfc[_0x152a('0x27')];}_0x109e78[_0x152a('0x24')](_0x3ae873)[_0x152a('0x28')](_0xa9acfc);};}exports[_0x152a('0x29')]=function(_0x3d561f,_0x3dff8d){var _0x47a162={},_0x4c8449={},_0x72727a={'count':0x0,'rows':[]};var _0x20a05b=_[_0x152a('0x2a')](db[_0x152a('0x2b')][_0x152a('0x2c')],function(_0x33636e){return{'name':_0x33636e[_0x152a('0x2d')],'type':_0x33636e[_0x152a('0x2e')]['key']};});_0x4c8449[_0x152a('0x2f')]=_[_0x152a('0x2a')](_0x20a05b,_0x152a('0x27'));_0x4c8449['query']=_['keys'](_0x3d561f[_0x152a('0x30')]);_0x4c8449[_0x152a('0x31')]=_[_0x152a('0x32')](_0x4c8449[_0x152a('0x2f')],_0x4c8449['query']);_0x47a162[_0x152a('0x33')]=_[_0x152a('0x32')](_0x4c8449[_0x152a('0x2f')],qs[_0x152a('0x34')](_0x3d561f[_0x152a('0x30')][_0x152a('0x34')]));_0x47a162['attributes']=_0x47a162[_0x152a('0x33')][_0x152a('0x35')]?_0x47a162[_0x152a('0x33')]:_0x4c8449['model'];if(!_0x3d561f[_0x152a('0x30')][_0x152a('0x36')](_0x152a('0x37'))){_0x47a162[_0x152a('0x1c')]=qs['limit'](_0x3d561f['query'][_0x152a('0x1c')]);_0x47a162[_0x152a('0x19')]=qs[_0x152a('0x19')](_0x3d561f[_0x152a('0x30')]['offset']);}_0x47a162['order']=qs[_0x152a('0x38')](_0x3d561f[_0x152a('0x30')][_0x152a('0x38')]);_0x47a162[_0x152a('0x39')]=qs[_0x152a('0x31')](_[_0x152a('0x3a')](_0x3d561f[_0x152a('0x30')],_0x4c8449[_0x152a('0x31')]),_0x20a05b);if(_0x3d561f[_0x152a('0x30')][_0x152a('0x3b')]){_0x47a162[_0x152a('0x39')]=_['merge'](_0x47a162[_0x152a('0x39')],{'$or':_[_0x152a('0x2a')](_0x20a05b,function(_0x130f6a){if(_0x130f6a[_0x152a('0x2e')]!==_0x152a('0x3c')){var _0x398efb={};_0x398efb[_0x130f6a[_0x152a('0x27')]]={'$like':'%'+_0x3d561f['query'][_0x152a('0x3b')]+'%'};return _0x398efb;}})});}_0x47a162=_[_0x152a('0x3d')]({},_0x47a162,_0x3d561f[_0x152a('0x3e')]);var _0x5950fd={'where':_0x47a162[_0x152a('0x39')]};return db[_0x152a('0x2b')]['count'](_0x5950fd)['then'](function(_0x402b46){_0x72727a[_0x152a('0x1b')]=_0x402b46;if(_0x3d561f[_0x152a('0x30')][_0x152a('0x3f')]){_0x47a162['include']=[{'all':!![]}];}return db[_0x152a('0x2b')][_0x152a('0x40')](_0x47a162);})['then'](function(_0x36d05e){_0x72727a[_0x152a('0x41')]=_0x36d05e;return _0x72727a;})['then'](respondWithFilteredResult(_0x3dff8d,_0x47a162))[_0x152a('0x42')](handleError(_0x3dff8d,null));};exports['show']=function(_0x548bde,_0x85e188){var _0x28eb98={'raw':!![],'where':{'id':_0x548bde[_0x152a('0x43')]['id']}},_0x146fc1={};_0x146fc1[_0x152a('0x2f')]=_['keys'](db[_0x152a('0x2b')][_0x152a('0x2c')]);_0x146fc1[_0x152a('0x30')]=_[_0x152a('0x44')](_0x548bde[_0x152a('0x30')]);_0x146fc1[_0x152a('0x31')]=_[_0x152a('0x32')](_0x146fc1['model'],_0x146fc1[_0x152a('0x30')]);_0x28eb98[_0x152a('0x33')]=_[_0x152a('0x32')](_0x146fc1[_0x152a('0x2f')],qs[_0x152a('0x34')](_0x548bde[_0x152a('0x30')][_0x152a('0x34')]));_0x28eb98['attributes']=_0x28eb98[_0x152a('0x33')][_0x152a('0x35')]?_0x28eb98[_0x152a('0x33')]:_0x146fc1[_0x152a('0x2f')];if(_0x548bde[_0x152a('0x30')][_0x152a('0x3f')]){_0x28eb98[_0x152a('0x45')]=[{'all':!![]}];}_0x28eb98=_[_0x152a('0x3d')]({},_0x28eb98,_0x548bde[_0x152a('0x3e')]);return db['ZohoField'][_0x152a('0x46')](_0x28eb98)[_0x152a('0x22')](handleEntityNotFound(_0x85e188,null))[_0x152a('0x22')](respondWithResult(_0x85e188,null))['catch'](handleError(_0x85e188,null));};exports[_0x152a('0x47')]=function(_0x12dc2c,_0x47582a){return db['ZohoField'][_0x152a('0x47')](_0x12dc2c[_0x152a('0x48')],{})[_0x152a('0x22')](respondWithResult(_0x47582a,0xc9))['catch'](handleError(_0x47582a,null));};exports[_0x152a('0x21')]=function(_0x468823,_0x4e598b){if(_0x468823['body']['id']){delete _0x468823[_0x152a('0x48')]['id'];}return db[_0x152a('0x2b')][_0x152a('0x46')]({'where':{'id':_0x468823[_0x152a('0x43')]['id']}})[_0x152a('0x22')](handleEntityNotFound(_0x4e598b,null))[_0x152a('0x22')](saveUpdates(_0x468823[_0x152a('0x48')],null))[_0x152a('0x22')](respondWithResult(_0x4e598b,null))['catch'](handleError(_0x4e598b,null));};exports[_0x152a('0x23')]=function(_0x9927d9,_0x3cbe3c){return db[_0x152a('0x2b')][_0x152a('0x46')]({'where':{'id':_0x9927d9['params']['id']}})[_0x152a('0x22')](handleEntityNotFound(_0x3cbe3c,null))[_0x152a('0x22')](removeEntity(_0x3cbe3c,null))[_0x152a('0x42')](handleError(_0x3cbe3c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 878bd0f..1304518 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32f4=['int_zoho_fields','idField','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField'];(function(_0x4c1716,_0x1f71a3){var _0x4ba4d5=function(_0x20516a){while(--_0x20516a){_0x4c1716['push'](_0x4c1716['shift']());}};_0x4ba4d5(++_0x1f71a3);}(_0x32f4,0x154));var _0x432f=function(_0x411fa3,_0x1299e6){_0x411fa3=_0x411fa3-0x0;var _0x283fde=_0x32f4[_0x411fa3];return _0x283fde;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require(_0x432f('0x2'))(_0x432f('0x3'));var moment=require('moment');var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));module[_0x432f('0x9')]=function(_0x2f5f03,_0x5d8cc0){return _0x2f5f03['define'](_0x432f('0xa'),attributes,{'tableName':_0x432f('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x432f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe5af=['zoho_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','ZohoField','int_zoho_fields'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe5af,0x9c));var _0xfe5a=function(_0x194c73,_0x3e8128){_0x194c73=_0x194c73-0x0;var _0xe696c=_0xe5af[_0x194c73];return _0xe696c;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var logger=require(_0xfe5a('0x1'))('api');var moment=require(_0xfe5a('0x2'));var BPromise=require(_0xfe5a('0x3'));var rp=require(_0xfe5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe5a('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0xfe5a('0x6')]=function(_0x2039cd,_0x4e418f){return _0x2039cd['define'](_0xfe5a('0x7'),attributes,{'tableName':_0xfe5a('0x8'),'paranoid':![],'indexes':[{'name':_0xfe5a('0x9'),'fields':[_0xfe5a('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 3046982..5d4ca4b 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 _0xc104=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x6c127b,_0x563160){var _0x281fb8=function(_0x2f3b02){while(--_0x2f3b02){_0x6c127b['push'](_0x6c127b['shift']());}};_0x281fb8(++_0x563160);}(_0xc104,0x172));var _0x4c10=function(_0x3d368b,_0xbbc5db){_0x3d368b=_0x3d368b-0x0;var _0x579af1=_0xc104[_0x3d368b];return _0x579af1;};'use strict';var _=require(_0x4c10('0x0'));var util=require(_0x4c10('0x1'));var moment=require('moment');var BPromise=require(_0x4c10('0x2'));var rs=require(_0x4c10('0x3'));var fs=require('fs');var Redis=require(_0x4c10('0x4'));var db=require(_0x4c10('0x5'))['db'];var utils=require(_0x4c10('0x6'));var logger=require(_0x4c10('0x7'))(_0x4c10('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c10('0x9'));var client=jayson[_0x4c10('0xa')][_0x4c10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28576a,_0x28f45b,_0x576fb2){return new BPromise(function(_0x2aff29,_0x35f93a){return client[_0x4c10('0xc')](_0x28576a,_0x576fb2)['then'](function(_0x41b653){logger[_0x4c10('0xd')](_0x4c10('0xe'),_0x28f45b,_0x4c10('0xf'));logger[_0x4c10('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x28f45b,'request\x20sent',JSON[_0x4c10('0x11')](_0x41b653));if(_0x41b653[_0x4c10('0x12')]){if(_0x41b653[_0x4c10('0x12')][_0x4c10('0x13')]===0x1f4){logger[_0x4c10('0x12')]('ZohoField,\x20%s,\x20%s',_0x28f45b,_0x41b653[_0x4c10('0x12')][_0x4c10('0x14')]);return _0x35f93a(_0x41b653[_0x4c10('0x12')][_0x4c10('0x14')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x28f45b,_0x41b653[_0x4c10('0x12')][_0x4c10('0x14')]);return _0x2aff29(_0x41b653[_0x4c10('0x12')][_0x4c10('0x14')]);}else{logger[_0x4c10('0xd')]('ZohoField,\x20%s,\x20%s',_0x28f45b,_0x4c10('0xf'));_0x2aff29(_0x41b653[_0x4c10('0x15')][_0x4c10('0x14')]);}})['catch'](function(_0x5becea){logger[_0x4c10('0x12')](_0x4c10('0xe'),_0x28f45b,_0x5becea);_0x35f93a(_0x5becea);});});} \ No newline at end of file +var _0xcc01=['request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc01,0xd2));var _0x1cc0=function(_0x1df1ea,_0x4d946b){_0x1df1ea=_0x1df1ea-0x0;var _0x2242cd=_0xcc01[_0x1df1ea];return _0x2242cd;};'use strict';var _=require(_0x1cc0('0x0'));var util=require(_0x1cc0('0x1'));var moment=require(_0x1cc0('0x2'));var BPromise=require(_0x1cc0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cc0('0x4'));var db=require(_0x1cc0('0x5'))['db'];var utils=require(_0x1cc0('0x6'));var logger=require('../../config/logger')(_0x1cc0('0x7'));var config=require('../../config/environment');var jayson=require(_0x1cc0('0x8'));var client=jayson[_0x1cc0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x366897,_0x16b71d,_0x28421a){return new BPromise(function(_0x2b7c4f,_0x21ea25){return client[_0x1cc0('0xa')](_0x366897,_0x28421a)[_0x1cc0('0xb')](function(_0x197ad2){logger[_0x1cc0('0xc')](_0x1cc0('0xd'),_0x16b71d,_0x1cc0('0xe'));logger[_0x1cc0('0xf')](_0x1cc0('0x10'),_0x16b71d,_0x1cc0('0xe'),JSON['stringify'](_0x197ad2));if(_0x197ad2[_0x1cc0('0x11')]){if(_0x197ad2[_0x1cc0('0x11')][_0x1cc0('0x12')]===0x1f4){logger['error'](_0x1cc0('0xd'),_0x16b71d,_0x197ad2[_0x1cc0('0x11')][_0x1cc0('0x13')]);return _0x21ea25(_0x197ad2[_0x1cc0('0x11')][_0x1cc0('0x13')]);}logger[_0x1cc0('0x11')](_0x1cc0('0xd'),_0x16b71d,_0x197ad2[_0x1cc0('0x11')][_0x1cc0('0x13')]);return _0x2b7c4f(_0x197ad2['error'][_0x1cc0('0x13')]);}else{logger[_0x1cc0('0xc')]('ZohoField,\x20%s,\x20%s',_0x16b71d,_0x1cc0('0xe'));_0x2b7c4f(_0x197ad2[_0x1cc0('0x14')][_0x1cc0('0x13')]);}})[_0x1cc0('0x15')](function(_0x1f1f2b){logger[_0x1cc0('0x11')]('ZohoField,\x20%s,\x20%s',_0x16b71d,_0x1f1f2b);_0x21ea25(_0x1f1f2b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2fcecff..4498c75 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5a6feb,_0x1f1e20){var _0x2a38e6=function(_0x355801){while(--_0x355801){_0x5a6feb['push'](_0x5a6feb['shift']());}};_0x2a38e6(++_0x1f1e20);}(_0xedd9,0xfc));var _0x9edd=function(_0x299831,_0x2c6340){_0x299831=_0x299831-0x0;var _0x4fe85a=_0xedd9[_0x299831];return _0x4fe85a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4b136a,_0xa8310c){var _0x51a36b=function(_0x35970e){while(--_0x35970e){_0x4b136a['push'](_0x4b136a['shift']());}};_0x51a36b(++_0xa8310c);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cd2bbca..67d7e36 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 _0xd577=['unique_name_and_version','app.js','INTEGER','sequelize','exports','STRING'];(function(_0xeeb785,_0x20c956){var _0x41a5ea=function(_0x1f6e8d){while(--_0x1f6e8d){_0xeeb785['push'](_0xeeb785['shift']());}};_0x41a5ea(++_0x20c956);}(_0xd577,0x1ef));var _0x7d57=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0xd577[_0x33ebf5];return _0x66957b;};'use strict';var Sequelize=require(_0x7d57('0x0'));module[_0x7d57('0x1')]={'name':{'type':Sequelize[_0x7d57('0x2')],'allowNull':![],'unique':_0x7d57('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x7d57('0x2')],'defaultValue':_0x7d57('0x4')},'filename':{'type':Sequelize[_0x7d57('0x2')]},'path':{'type':Sequelize[_0x7d57('0x2')]},'type':{'type':Sequelize[_0x7d57('0x2')]},'size':{'type':Sequelize[_0x7d57('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x7d57('0x2')]},'logo':{'type':Sequelize[_0x7d57('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x7d57('0x2')]},'title':{'type':Sequelize[_0x7d57('0x2')]},'remoteUri':{'type':Sequelize[_0x7d57('0x2')]},'link':{'type':Sequelize[_0x7d57('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xf793=['INTEGER','BOOLEAN','exports','STRING','unique_name_and_version','app.js'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf793,0x1ac));var _0x3f79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf793[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x3f79('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x3f79('0x1')],'allowNull':![],'unique':_0x3f79('0x2')},'main':{'type':Sequelize[_0x3f79('0x1')],'defaultValue':_0x3f79('0x3')},'filename':{'type':Sequelize[_0x3f79('0x1')]},'path':{'type':Sequelize[_0x3f79('0x1')]},'type':{'type':Sequelize[_0x3f79('0x1')]},'size':{'type':Sequelize[_0x3f79('0x4')]},'active':{'type':Sequelize[_0x3f79('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x3f79('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x3f79('0x1')]},'remoteUri':{'type':Sequelize[_0x3f79('0x1')]},'link':{'type':Sequelize[_0x3f79('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 2520edb..be67805 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 _0xafc4=['reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','Integration','includeAll','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x3dc1a0,_0xb49eae){var _0x573b60=function(_0x91986b){while(--_0x91986b){_0x3dc1a0['push'](_0x3dc1a0['shift']());}};_0x573b60(++_0xb49eae);}(_0xafc4,0x69));var _0x4afc=function(_0x4a7c5f,_0x2492b){_0x4a7c5f=_0x4a7c5f-0x0;var _0x4cb4b9=_0xafc4[_0x4a7c5f];return _0x4cb4b9;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['Integration'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['Integration']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));}; \ No newline at end of file +var _0x1623=['model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','Integration','findAll','rows','catch','show','params','length','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x1623,0xab));var _0x3162=function(_0x58cb30,_0x4f4ea2){_0x58cb30=_0x58cb30-0x0;var _0x41574a=_0x1623[_0x58cb30];return _0x41574a;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['Integration'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d2c15ab..0630ba3 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 _0x0b8d=['path','exports','Integration','integrations','lodash','util','../../config/logger','api','moment'];(function(_0x342bf0,_0x36cd82){var _0x3dd543=function(_0x4caa80){while(--_0x4caa80){_0x342bf0['push'](_0x342bf0['shift']());}};_0x3dd543(++_0x36cd82);}(_0x0b8d,0x70));var _0xd0b8=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x0b8d[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xd0b8('0x0'));var util=require(_0xd0b8('0x1'));var logger=require(_0xd0b8('0x2'))(_0xd0b8('0x3'));var moment=require(_0xd0b8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0b8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xd0b8('0x6')]=function(_0x4241df,_0x59855c){return _0x4241df['define'](_0xd0b8('0x7'),attributes,{'tableName':_0xd0b8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f33=['./integration.attributes','exports','define','integrations','lodash','util','api','bluebird','../../config/environment'];(function(_0x154aaa,_0x8b3ee0){var _0x144b2e=function(_0x55fdd3){while(--_0x55fdd3){_0x154aaa['push'](_0x154aaa['shift']());}};_0x144b2e(++_0x8b3ee0);}(_0x0f33,0x1ab));var _0x30f3=function(_0x331fe0,_0x35ae22){_0x331fe0=_0x331fe0-0x0;var _0x2e67b0=_0x0f33[_0x331fe0];return _0x2e67b0;};'use strict';var _=require(_0x30f3('0x0'));var util=require(_0x30f3('0x1'));var logger=require('../../config/logger')(_0x30f3('0x2'));var moment=require('moment');var BPromise=require(_0x30f3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x30f3('0x4'));var attributes=require(_0x30f3('0x5'));module[_0x30f3('0x6')]=function(_0x403157,_0x2f5de8){return _0x403157[_0x30f3('0x7')]('Integration',attributes,{'tableName':_0x30f3('0x8'),'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 dfeb67d..5802594 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x34b4a2,_0x1b2710){var _0x42c89b=function(_0x52f8d9){while(--_0x52f8d9){_0x34b4a2['push'](_0x34b4a2['shift']());}};_0x42c89b(++_0x1b2710);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4e4e38,_0x49d1a8){_0x4e4e38=_0x4e4e38-0x0;var _0x4294e5=_0x9f0e[_0x4e4e38];return _0x4294e5;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x2c5033,_0x2d8d31){var _0x563dc9=function(_0x47536d){while(--_0x47536d){_0x2c5033['push'](_0x2c5033['shift']());}};_0x563dc9(++_0x2d8d31);}(_0x1a85,0x178));var _0x51a8=function(_0xf785ae,_0x211032){_0xf785ae=_0xf785ae-0x0;var _0x2e9f79=_0x1a85[_0xf785ae];return _0x2e9f79;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 69af0b6..14eec7c 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x4f2e09,_0x151e23){var _0x47f295=function(_0x4f9885){while(--_0x4f9885){_0x4f2e09['push'](_0x4f2e09['shift']());}};_0x47f295(++_0x151e23);}(_0xba34,0x119));var _0x4ba3=function(_0x268278,_0x47555e){_0x268278=_0x268278-0x0;var _0xd9dd59=_0xba34[_0x268278];return _0xd9dd59;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x363615,_0x2959b2){var _0x26e911=function(_0x99f9ff){while(--_0x99f9ff){_0x363615['push'](_0x363615['shift']());}};_0x26e911(++_0x2959b2);}(_0x187d,0x93));var _0xd187=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x187d[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4ff9cf1..137bfd7 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 _0xc8c8=['TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x290de8,_0x3a808c){var _0x488227=function(_0x5c9105){while(--_0x5c9105){_0x290de8['push'](_0x290de8['shift']());}};_0x488227(++_0x3a808c);}(_0xc8c8,0x1db));var _0x8c8c=function(_0x4cefb4,_0x2bca47){_0x4cefb4=_0x4cefb4-0x0;var _0x12816d=_0xc8c8[_0x4cefb4];return _0x12816d;};'use strict';var Sequelize=require(_0x8c8c('0x0'));module['exports']={'integration':{'type':Sequelize[_0x8c8c('0x1')]},'eventChannel':{'type':Sequelize[_0x8c8c('0x1')]},'exitStatus':{'type':Sequelize[_0x8c8c('0x1')]},'ticketId':{'type':Sequelize[_0x8c8c('0x1')]},'integrationId':{'type':Sequelize[_0x8c8c('0x2')]},'contacts':{'type':Sequelize[_0x8c8c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8c8c('0x1')]},'queue':{'type':Sequelize[_0x8c8c('0x1')]},'interface':{'type':Sequelize[_0x8c8c('0x1')]},'membername':{'type':Sequelize[_0x8c8c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8c8c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8c8c('0x3')]},'holdtime':{'type':Sequelize[_0x8c8c('0x2')]},'agentcomplete':{'type':Sequelize[_0x8c8c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8c8c('0x3')]},'talktime':{'type':Sequelize[_0x8c8c('0x2')]},'agentacw':{'type':Sequelize[_0x8c8c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8c8c('0x2')]},'reason':{'type':Sequelize[_0x8c8c('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8c8c('0x3')]},'lastevent':{'type':Sequelize[_0x8c8c('0x1')]},'channel':{'type':Sequelize[_0x8c8c('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8c8c('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8c8c('0x1')]},'context':{'type':Sequelize[_0x8c8c('0x1')]},'exten':{'type':Sequelize[_0x8c8c('0x1')]},'priority':{'type':Sequelize[_0x8c8c('0x1')]},'destchannel':{'type':Sequelize[_0x8c8c('0x1')]},'destchannelstate':{'type':Sequelize[_0x8c8c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x8c8c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8c8c('0x1')]},'destcalleridname':{'type':Sequelize[_0x8c8c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8c8c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x8c8c('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8c8c('0x1')]},'destcontext':{'type':Sequelize[_0x8c8c('0x1')]},'destexten':{'type':Sequelize[_0x8c8c('0x1')]},'destpriority':{'type':Sequelize[_0x8c8c('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x8c8c('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8c8c('0x1')]},'cc':{'type':Sequelize[_0x8c8c('0x1')]},'attachment':{'type':Sequelize[_0x8c8c('0x5')]},'html':{'type':Sequelize[_0x8c8c('0x5')]},'text':{'type':Sequelize[_0x8c8c('0x5')]},'status':{'type':Sequelize['ENUM'](_0x8c8c('0x6'),_0x8c8c('0x7'),_0x8c8c('0x8'),_0x8c8c('0x9'))},'url':{'type':Sequelize[_0x8c8c('0x1')]},'app':{'type':Sequelize[_0x8c8c('0x1')]},'appdata':{'type':Sequelize[_0x8c8c('0x1')]},'projectId':{'type':Sequelize[_0x8c8c('0x2')]}}; \ No newline at end of file +var _0xe873=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','exports'];(function(_0x48b4d6,_0x6b97b9){var _0x2e8ee5=function(_0xff6ac){while(--_0xff6ac){_0x48b4d6['push'](_0x48b4d6['shift']());}};_0x2e8ee5(++_0x6b97b9);}(_0xe873,0x14f));var _0x3e87=function(_0x217744,_0x13d6c1){_0x217744=_0x217744-0x0;var _0x53ef1e=_0xe873[_0x217744];return _0x53ef1e;};'use strict';var Sequelize=require('sequelize');module[_0x3e87('0x0')]={'integration':{'type':Sequelize[_0x3e87('0x1')]},'eventChannel':{'type':Sequelize[_0x3e87('0x1')]},'exitStatus':{'type':Sequelize[_0x3e87('0x1')]},'ticketId':{'type':Sequelize[_0x3e87('0x1')]},'integrationId':{'type':Sequelize[_0x3e87('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3e87('0x1')]},'calleridnum':{'type':Sequelize[_0x3e87('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3e87('0x1')]},'interface':{'type':Sequelize[_0x3e87('0x1')]},'membername':{'type':Sequelize[_0x3e87('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3e87('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3e87('0x3')]},'holdtime':{'type':Sequelize[_0x3e87('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3e87('0x3')]},'talktime':{'type':Sequelize[_0x3e87('0x2')]},'agentacw':{'type':Sequelize[_0x3e87('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3e87('0x2')]},'reason':{'type':Sequelize[_0x3e87('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x3e87('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3e87('0x3')]},'agentdump':{'type':Sequelize[_0x3e87('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3e87('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3e87('0x1')]},'channelstate':{'type':Sequelize[_0x3e87('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e87('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e87('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e87('0x1')]},'language':{'type':Sequelize[_0x3e87('0x1')]},'accountcode':{'type':Sequelize[_0x3e87('0x1')]},'context':{'type':Sequelize[_0x3e87('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3e87('0x1')]},'destchannel':{'type':Sequelize[_0x3e87('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x3e87('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x3e87('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x3e87('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e87('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3e87('0x1')]},'destcontext':{'type':Sequelize[_0x3e87('0x1')]},'destexten':{'type':Sequelize[_0x3e87('0x1')]},'destpriority':{'type':Sequelize[_0x3e87('0x1')]},'destuniqueid':{'type':Sequelize[_0x3e87('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3e87('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x3e87('0x1')]},'to':{'type':Sequelize[_0x3e87('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x3e87('0x5')]},'html':{'type':Sequelize[_0x3e87('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x3e87('0x6')]('SENT',_0x3e87('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x3e87('0x1')]},'appdata':{'type':Sequelize[_0x3e87('0x1')]},'projectId':{'type':Sequelize[_0x3e87('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 26747a4..1b71d58 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 _0x9067=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x35ac2a,_0x54e62f){var _0x404eec=function(_0x44a457){while(--_0x44a457){_0x35ac2a['push'](_0x35ac2a['shift']());}};_0x404eec(++_0x54e62f);}(_0x9067,0x176));var _0x7906=function(_0x5e7213,_0xebb374){_0x5e7213=_0x5e7213-0x0;var _0x4c3f72=_0x9067[_0x5e7213];return _0x4c3f72;};'use strict';var emlformat=require(_0x7906('0x0'));var rimraf=require(_0x7906('0x1'));var zipdir=require(_0x7906('0x2'));var jsonpatch=require(_0x7906('0x3'));var rp=require(_0x7906('0x4'));var moment=require(_0x7906('0x5'));var BPromise=require(_0x7906('0x6'));var Mustache=require(_0x7906('0x7'));var util=require(_0x7906('0x8'));var path=require(_0x7906('0x9'));var sox=require(_0x7906('0xa'));var csv=require(_0x7906('0xb'));var ejs=require(_0x7906('0xc'));var fs=require('fs');var fs_extra=require(_0x7906('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7906('0xe'));var jsforce=require(_0x7906('0xf'));var deskjs=require(_0x7906('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7906('0x11'));var Papa=require(_0x7906('0x12'));var Redis=require(_0x7906('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7906('0x14'));var as=require(_0x7906('0x15'));var hardwareService=require(_0x7906('0x16'));var logger=require('../../config/logger')(_0x7906('0x17'));var utils=require(_0x7906('0x18'));var config=require(_0x7906('0x19'));var licenseUtil=require(_0x7906('0x1a'));var db=require(_0x7906('0x1b'))['db'];function respondWithStatusCode(_0x43488b,_0x3caa1f){_0x3caa1f=_0x3caa1f||0xcc;return function(_0x13b3d4){if(_0x13b3d4){return _0x43488b[_0x7906('0x1c')](_0x3caa1f);}return _0x43488b[_0x7906('0x1d')](_0x3caa1f)[_0x7906('0x1e')]();};}function respondWithResult(_0xc0cbaf,_0x254d71){_0x254d71=_0x254d71||0xc8;return function(_0x2b20ba){if(_0x2b20ba){return _0xc0cbaf[_0x7906('0x1d')](_0x254d71)[_0x7906('0x1f')](_0x2b20ba);}};}function respondWithFilteredResult(_0x10daa2,_0x650609){return function(_0x411e9f){if(_0x411e9f){var _0x3e86f3=typeof _0x650609[_0x7906('0x20')]===_0x7906('0x21')&&typeof _0x650609[_0x7906('0x22')]==='undefined';var _0x4b8fcc=_0x411e9f['count'];var _0x179e45=_0x3e86f3?0x0:_0x650609['offset'];var _0x4f5d42=_0x3e86f3?_0x411e9f[_0x7906('0x23')]:_0x650609[_0x7906('0x20')]+_0x650609[_0x7906('0x22')];var _0xccf29;if(_0x4f5d42>=_0x4b8fcc){_0x4f5d42=_0x4b8fcc;_0xccf29=0xc8;}else{_0xccf29=0xce;}_0x10daa2[_0x7906('0x1d')](_0xccf29);return _0x10daa2[_0x7906('0x24')]('Content-Range',_0x179e45+'-'+_0x4f5d42+'/'+_0x4b8fcc)[_0x7906('0x1f')](_0x411e9f);}return null;};}function patchUpdates(_0x4f3c34){return function(_0x54b2de){try{jsonpatch['apply'](_0x54b2de,_0x4f3c34,!![]);}catch(_0x45c77c){return BPromise['reject'](_0x45c77c);}return _0x54b2de['save']();};}function saveUpdates(_0x1d2430,_0x1cb996){return function(_0x3e72b1){if(_0x3e72b1){return _0x3e72b1[_0x7906('0x25')](_0x1d2430)[_0x7906('0x26')](function(_0x4a517a){return _0x4a517a;});}return null;};}function removeEntity(_0x20b3da,_0x4212c9){return function(_0x107e2e){if(_0x107e2e){return _0x107e2e['destroy']()[_0x7906('0x26')](function(){_0x20b3da['status'](0xcc)[_0x7906('0x1e')]();});}};}function handleEntityNotFound(_0x4a3ed2,_0x48a75c){return function(_0xc4dd32){if(!_0xc4dd32){_0x4a3ed2[_0x7906('0x1c')](0x194);}return _0xc4dd32;};}function handleError(_0x26780e,_0x4e1429){_0x4e1429=_0x4e1429||0x1f4;return function(_0x1ef671){logger[_0x7906('0x27')](_0x1ef671[_0x7906('0x28')]);if(_0x1ef671[_0x7906('0x29')]){delete _0x1ef671['name'];}_0x26780e[_0x7906('0x1d')](_0x4e1429)[_0x7906('0x2a')](_0x1ef671);};}exports['index']=function(_0x2347f5,_0x69a4db){var _0x2f4ac2={},_0x20435d={},_0x5b125f={'count':0x0,'rows':[]};var _0x2570d3=_[_0x7906('0x2b')](db[_0x7906('0x2c')][_0x7906('0x2d')],function(_0x56963b){return{'name':_0x56963b[_0x7906('0x2e')],'type':_0x56963b[_0x7906('0x2f')][_0x7906('0x30')]};});_0x20435d[_0x7906('0x31')]=_['map'](_0x2570d3,_0x7906('0x29'));_0x20435d[_0x7906('0x32')]=_[_0x7906('0x33')](_0x2347f5[_0x7906('0x32')]);_0x20435d['filters']=_[_0x7906('0x34')](_0x20435d[_0x7906('0x31')],_0x20435d[_0x7906('0x32')]);_0x2f4ac2[_0x7906('0x35')]=_[_0x7906('0x34')](_0x20435d[_0x7906('0x31')],qs[_0x7906('0x36')](_0x2347f5[_0x7906('0x32')][_0x7906('0x36')]));_0x2f4ac2[_0x7906('0x35')]=_0x2f4ac2[_0x7906('0x35')][_0x7906('0x37')]?_0x2f4ac2[_0x7906('0x35')]:_0x20435d[_0x7906('0x31')];if(!_0x2347f5[_0x7906('0x32')]['hasOwnProperty'](_0x7906('0x38'))){_0x2f4ac2[_0x7906('0x22')]=qs[_0x7906('0x22')](_0x2347f5[_0x7906('0x32')][_0x7906('0x22')]);_0x2f4ac2['offset']=qs[_0x7906('0x20')](_0x2347f5['query'][_0x7906('0x20')]);}_0x2f4ac2[_0x7906('0x39')]=qs[_0x7906('0x3a')](_0x2347f5['query']['sort']);_0x2f4ac2[_0x7906('0x3b')]=qs[_0x7906('0x3c')](_[_0x7906('0x3d')](_0x2347f5[_0x7906('0x32')],_0x20435d[_0x7906('0x3c')]),_0x2570d3);if(_0x2347f5[_0x7906('0x32')][_0x7906('0x3e')]){_0x2f4ac2['where']=_[_0x7906('0x3f')](_0x2f4ac2[_0x7906('0x3b')],{'$or':_[_0x7906('0x2b')](_0x2570d3,function(_0x17b9ac){if(_0x17b9ac[_0x7906('0x2f')]!==_0x7906('0x40')){var _0x2b59b0={};_0x2b59b0[_0x17b9ac[_0x7906('0x29')]]={'$like':'%'+_0x2347f5[_0x7906('0x32')]['filter']+'%'};return _0x2b59b0;}})});}_0x2f4ac2=_[_0x7906('0x3f')]({},_0x2f4ac2,_0x2347f5[_0x7906('0x41')]);var _0x2c0313={'where':_0x2f4ac2[_0x7906('0x3b')]};return db[_0x7906('0x2c')][_0x7906('0x23')](_0x2c0313)[_0x7906('0x26')](function(_0x50d902){_0x5b125f[_0x7906('0x23')]=_0x50d902;if(_0x2347f5[_0x7906('0x32')][_0x7906('0x42')]){_0x2f4ac2['include']=[{'all':!![]}];}return db[_0x7906('0x2c')]['findAll'](_0x2f4ac2);})[_0x7906('0x26')](function(_0x54d535){_0x5b125f[_0x7906('0x43')]=_0x54d535;return _0x5b125f;})[_0x7906('0x26')](respondWithFilteredResult(_0x69a4db,_0x2f4ac2))[_0x7906('0x44')](handleError(_0x69a4db,null));};exports[_0x7906('0x45')]=function(_0x1d85f7,_0x1b8163){var _0x2f12c0={'raw':![],'where':{'id':_0x1d85f7[_0x7906('0x46')]['id']}},_0x3b3376={};_0x3b3376[_0x7906('0x31')]=_[_0x7906('0x33')](db['IntegrationReport'][_0x7906('0x2d')]);_0x3b3376[_0x7906('0x32')]=_[_0x7906('0x33')](_0x1d85f7[_0x7906('0x32')]);_0x3b3376[_0x7906('0x3c')]=_['intersection'](_0x3b3376[_0x7906('0x31')],_0x3b3376['query']);_0x2f12c0[_0x7906('0x35')]=_[_0x7906('0x34')](_0x3b3376[_0x7906('0x31')],qs['fields'](_0x1d85f7['query'][_0x7906('0x36')]));_0x2f12c0[_0x7906('0x35')]=_0x2f12c0['attributes'][_0x7906('0x37')]?_0x2f12c0[_0x7906('0x35')]:_0x3b3376['model'];if(_0x1d85f7[_0x7906('0x32')][_0x7906('0x42')]){_0x2f12c0[_0x7906('0x47')]=[{'all':!![]}];}_0x2f12c0=_['merge']({},_0x2f12c0,_0x1d85f7[_0x7906('0x41')]);return db[_0x7906('0x2c')]['find'](_0x2f12c0)[_0x7906('0x26')](handleEntityNotFound(_0x1b8163,null))[_0x7906('0x26')](respondWithResult(_0x1b8163,null))[_0x7906('0x44')](handleError(_0x1b8163,null));};exports[_0x7906('0x48')]=function(_0x5e3139,_0x559cb5){return db['IntegrationReport'][_0x7906('0x48')](_0x5e3139[_0x7906('0x49')],{})[_0x7906('0x26')](respondWithResult(_0x559cb5,0xc9))['catch'](handleError(_0x559cb5,null));};exports[_0x7906('0x25')]=function(_0xe32490,_0x146ac8){if(_0xe32490[_0x7906('0x49')]['id']){delete _0xe32490[_0x7906('0x49')]['id'];}return db[_0x7906('0x2c')][_0x7906('0x4a')]({'where':{'id':_0xe32490[_0x7906('0x46')]['id']}})['then'](handleEntityNotFound(_0x146ac8,null))['then'](saveUpdates(_0xe32490['body'],null))[_0x7906('0x26')](respondWithResult(_0x146ac8,null))[_0x7906('0x44')](handleError(_0x146ac8,null));};exports['destroy']=function(_0x2bd79a,_0xe4f76){return db['IntegrationReport'][_0x7906('0x4a')]({'where':{'id':_0x2bd79a[_0x7906('0x46')]['id']}})[_0x7906('0x26')](handleEntityNotFound(_0xe4f76,null))[_0x7906('0x26')](removeEntity(_0xe4f76,null))[_0x7906('0x44')](handleError(_0xe4f76,null));};exports['describe']=function(_0x3d7840,_0x1e3288){return db[_0x7906('0x2c')][_0x7906('0x4b')]()['then'](respondWithResult(_0x1e3288,null))[_0x7906('0x44')](handleError(_0x1e3288,null));}; \ No newline at end of file +var _0xd1bf=['map','IntegrationReport','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index'];(function(_0x406cf1,_0xda26f1){var _0x1efaa3=function(_0x2aa91b){while(--_0x2aa91b){_0x406cf1['push'](_0x406cf1['shift']());}};_0x1efaa3(++_0xda26f1);}(_0xd1bf,0x1e1));var _0xfd1b=function(_0x57ad18,_0x30e3cb){_0x57ad18=_0x57ad18-0x0;var _0x44194e=_0xd1bf[_0x57ad18];return _0x44194e;};'use strict';var emlformat=require(_0xfd1b('0x0'));var rimraf=require(_0xfd1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd1b('0x2'));var rp=require('request-promise');var moment=require(_0xfd1b('0x3'));var BPromise=require(_0xfd1b('0x4'));var Mustache=require(_0xfd1b('0x5'));var util=require(_0xfd1b('0x6'));var path=require(_0xfd1b('0x7'));var sox=require(_0xfd1b('0x8'));var csv=require(_0xfd1b('0x9'));var ejs=require(_0xfd1b('0xa'));var fs=require('fs');var fs_extra=require(_0xfd1b('0xb'));var _=require('lodash');var squel=require(_0xfd1b('0xc'));var crypto=require(_0xfd1b('0xd'));var jsforce=require(_0xfd1b('0xe'));var deskjs=require(_0xfd1b('0xf'));var toCsv=require(_0xfd1b('0x9'));var querystring=require(_0xfd1b('0x10'));var Papa=require(_0xfd1b('0x11'));var Redis=require(_0xfd1b('0x12'));var authService=require(_0xfd1b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfd1b('0x14'));var hardwareService=require(_0xfd1b('0x15'));var logger=require(_0xfd1b('0x16'))('api');var utils=require(_0xfd1b('0x17'));var config=require(_0xfd1b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd1b('0x19'))['db'];function respondWithStatusCode(_0x1901cf,_0x5e5c43){_0x5e5c43=_0x5e5c43||0xcc;return function(_0x582149){if(_0x582149){return _0x1901cf[_0xfd1b('0x1a')](_0x5e5c43);}return _0x1901cf[_0xfd1b('0x1b')](_0x5e5c43)[_0xfd1b('0x1c')]();};}function respondWithResult(_0x27e847,_0x3d3b7c){_0x3d3b7c=_0x3d3b7c||0xc8;return function(_0x1f20b6){if(_0x1f20b6){return _0x27e847[_0xfd1b('0x1b')](_0x3d3b7c)[_0xfd1b('0x1d')](_0x1f20b6);}};}function respondWithFilteredResult(_0x5495e4,_0x589291){return function(_0x2f4042){if(_0x2f4042){var _0x162346=typeof _0x589291[_0xfd1b('0x1e')]===_0xfd1b('0x1f')&&typeof _0x589291[_0xfd1b('0x20')]==='undefined';var _0x36696e=_0x2f4042[_0xfd1b('0x21')];var _0x20483d=_0x162346?0x0:_0x589291[_0xfd1b('0x1e')];var _0x5878f0=_0x162346?_0x2f4042[_0xfd1b('0x21')]:_0x589291[_0xfd1b('0x1e')]+_0x589291[_0xfd1b('0x20')];var _0x47aae1;if(_0x5878f0>=_0x36696e){_0x5878f0=_0x36696e;_0x47aae1=0xc8;}else{_0x47aae1=0xce;}_0x5495e4[_0xfd1b('0x1b')](_0x47aae1);return _0x5495e4['set'](_0xfd1b('0x22'),_0x20483d+'-'+_0x5878f0+'/'+_0x36696e)[_0xfd1b('0x1d')](_0x2f4042);}return null;};}function patchUpdates(_0x18fe8c){return function(_0x3637b8){try{jsonpatch[_0xfd1b('0x23')](_0x3637b8,_0x18fe8c,!![]);}catch(_0x427eac){return BPromise['reject'](_0x427eac);}return _0x3637b8[_0xfd1b('0x24')]();};}function saveUpdates(_0x23cb57,_0x172b6a){return function(_0x5ad27a){if(_0x5ad27a){return _0x5ad27a[_0xfd1b('0x25')](_0x23cb57)[_0xfd1b('0x26')](function(_0x52fb63){return _0x52fb63;});}return null;};}function removeEntity(_0x7df36f,_0x528c3a){return function(_0x14fdcd){if(_0x14fdcd){return _0x14fdcd['destroy']()[_0xfd1b('0x26')](function(){_0x7df36f[_0xfd1b('0x1b')](0xcc)[_0xfd1b('0x1c')]();});}};}function handleEntityNotFound(_0x297c98,_0x45e59b){return function(_0x1ea9aa){if(!_0x1ea9aa){_0x297c98[_0xfd1b('0x1a')](0x194);}return _0x1ea9aa;};}function handleError(_0x53b904,_0x5dbc58){_0x5dbc58=_0x5dbc58||0x1f4;return function(_0x33fa24){logger[_0xfd1b('0x27')](_0x33fa24[_0xfd1b('0x28')]);if(_0x33fa24[_0xfd1b('0x29')]){delete _0x33fa24[_0xfd1b('0x29')];}_0x53b904[_0xfd1b('0x1b')](_0x5dbc58)[_0xfd1b('0x2a')](_0x33fa24);};}exports[_0xfd1b('0x2b')]=function(_0x289e83,_0xb236a7){var _0x38a004={},_0x903361={},_0x50e40f={'count':0x0,'rows':[]};var _0x422aa8=_[_0xfd1b('0x2c')](db[_0xfd1b('0x2d')]['rawAttributes'],function(_0x28a59f){return{'name':_0x28a59f['fieldName'],'type':_0x28a59f[_0xfd1b('0x2e')][_0xfd1b('0x2f')]};});_0x903361[_0xfd1b('0x30')]=_[_0xfd1b('0x2c')](_0x422aa8,_0xfd1b('0x29'));_0x903361[_0xfd1b('0x31')]=_['keys'](_0x289e83[_0xfd1b('0x31')]);_0x903361['filters']=_[_0xfd1b('0x32')](_0x903361[_0xfd1b('0x30')],_0x903361[_0xfd1b('0x31')]);_0x38a004[_0xfd1b('0x33')]=_[_0xfd1b('0x32')](_0x903361[_0xfd1b('0x30')],qs[_0xfd1b('0x34')](_0x289e83[_0xfd1b('0x31')]['fields']));_0x38a004[_0xfd1b('0x33')]=_0x38a004['attributes'][_0xfd1b('0x35')]?_0x38a004['attributes']:_0x903361[_0xfd1b('0x30')];if(!_0x289e83['query'][_0xfd1b('0x36')](_0xfd1b('0x37'))){_0x38a004[_0xfd1b('0x20')]=qs['limit'](_0x289e83[_0xfd1b('0x31')][_0xfd1b('0x20')]);_0x38a004['offset']=qs[_0xfd1b('0x1e')](_0x289e83[_0xfd1b('0x31')][_0xfd1b('0x1e')]);}_0x38a004[_0xfd1b('0x38')]=qs[_0xfd1b('0x39')](_0x289e83[_0xfd1b('0x31')][_0xfd1b('0x39')]);_0x38a004[_0xfd1b('0x3a')]=qs[_0xfd1b('0x3b')](_['pick'](_0x289e83['query'],_0x903361[_0xfd1b('0x3b')]),_0x422aa8);if(_0x289e83[_0xfd1b('0x31')][_0xfd1b('0x3c')]){_0x38a004[_0xfd1b('0x3a')]=_[_0xfd1b('0x3d')](_0x38a004[_0xfd1b('0x3a')],{'$or':_[_0xfd1b('0x2c')](_0x422aa8,function(_0x4a278b){if(_0x4a278b[_0xfd1b('0x2e')]!==_0xfd1b('0x3e')){var _0x37d28e={};_0x37d28e[_0x4a278b[_0xfd1b('0x29')]]={'$like':'%'+_0x289e83[_0xfd1b('0x31')][_0xfd1b('0x3c')]+'%'};return _0x37d28e;}})});}_0x38a004=_[_0xfd1b('0x3d')]({},_0x38a004,_0x289e83[_0xfd1b('0x3f')]);var _0x2214ab={'where':_0x38a004[_0xfd1b('0x3a')]};return db[_0xfd1b('0x2d')][_0xfd1b('0x21')](_0x2214ab)[_0xfd1b('0x26')](function(_0x11a370){_0x50e40f[_0xfd1b('0x21')]=_0x11a370;if(_0x289e83['query'][_0xfd1b('0x40')]){_0x38a004[_0xfd1b('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0xfd1b('0x42')](_0x38a004);})[_0xfd1b('0x26')](function(_0x44b3c5){_0x50e40f[_0xfd1b('0x43')]=_0x44b3c5;return _0x50e40f;})[_0xfd1b('0x26')](respondWithFilteredResult(_0xb236a7,_0x38a004))[_0xfd1b('0x44')](handleError(_0xb236a7,null));};exports['show']=function(_0x130aae,_0x1130f1){var _0x533fae={'raw':![],'where':{'id':_0x130aae['params']['id']}},_0x2095ba={};_0x2095ba[_0xfd1b('0x30')]=_[_0xfd1b('0x45')](db[_0xfd1b('0x2d')]['rawAttributes']);_0x2095ba[_0xfd1b('0x31')]=_[_0xfd1b('0x45')](_0x130aae[_0xfd1b('0x31')]);_0x2095ba['filters']=_[_0xfd1b('0x32')](_0x2095ba[_0xfd1b('0x30')],_0x2095ba['query']);_0x533fae[_0xfd1b('0x33')]=_['intersection'](_0x2095ba['model'],qs[_0xfd1b('0x34')](_0x130aae[_0xfd1b('0x31')][_0xfd1b('0x34')]));_0x533fae[_0xfd1b('0x33')]=_0x533fae['attributes']['length']?_0x533fae[_0xfd1b('0x33')]:_0x2095ba['model'];if(_0x130aae[_0xfd1b('0x31')][_0xfd1b('0x40')]){_0x533fae[_0xfd1b('0x41')]=[{'all':!![]}];}_0x533fae=_[_0xfd1b('0x3d')]({},_0x533fae,_0x130aae[_0xfd1b('0x3f')]);return db[_0xfd1b('0x2d')][_0xfd1b('0x46')](_0x533fae)[_0xfd1b('0x26')](handleEntityNotFound(_0x1130f1,null))[_0xfd1b('0x26')](respondWithResult(_0x1130f1,null))[_0xfd1b('0x44')](handleError(_0x1130f1,null));};exports['create']=function(_0x316833,_0x11d4ef){return db['IntegrationReport'][_0xfd1b('0x47')](_0x316833[_0xfd1b('0x48')],{})['then'](respondWithResult(_0x11d4ef,0xc9))[_0xfd1b('0x44')](handleError(_0x11d4ef,null));};exports[_0xfd1b('0x25')]=function(_0x52ffc8,_0x4eb88c){if(_0x52ffc8['body']['id']){delete _0x52ffc8[_0xfd1b('0x48')]['id'];}return db[_0xfd1b('0x2d')][_0xfd1b('0x46')]({'where':{'id':_0x52ffc8[_0xfd1b('0x49')]['id']}})[_0xfd1b('0x26')](handleEntityNotFound(_0x4eb88c,null))[_0xfd1b('0x26')](saveUpdates(_0x52ffc8['body'],null))[_0xfd1b('0x26')](respondWithResult(_0x4eb88c,null))[_0xfd1b('0x44')](handleError(_0x4eb88c,null));};exports['destroy']=function(_0x6f2bec,_0x1f68cf){return db[_0xfd1b('0x2d')][_0xfd1b('0x46')]({'where':{'id':_0x6f2bec[_0xfd1b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f68cf,null))[_0xfd1b('0x26')](removeEntity(_0x1f68cf,null))[_0xfd1b('0x44')](handleError(_0x1f68cf,null));};exports[_0xfd1b('0x4a')]=function(_0x3e058d,_0x5ac2c4){return db[_0xfd1b('0x2d')]['describe']()['then'](respondWithResult(_0x5ac2c4,null))['catch'](handleError(_0x5ac2c4,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index df228c9..e1d22d0 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 _0x8e3f=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash'];(function(_0x57f2c8,_0x58182c){var _0x135982=function(_0x5ad54b){while(--_0x5ad54b){_0x57f2c8['push'](_0x57f2c8['shift']());}};_0x135982(++_0x58182c);}(_0x8e3f,0x128));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require('util');var logger=require(_0xf8e3('0x1'))(_0xf8e3('0x2'));var moment=require('moment');var BPromise=require(_0xf8e3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8e3('0x4'));var rimraf=require(_0xf8e3('0x5'));var config=require(_0xf8e3('0x6'));var attributes=require(_0xf8e3('0x7'));module[_0xf8e3('0x8')]=function(_0x5e4d6c,_0x520486){return _0x5e4d6c[_0xf8e3('0x9')]('IntegrationReport',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4875=['../../config/logger','api','moment','path','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','util'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x4875,0x128));var _0x5487=function(_0x307777,_0x131c2e){_0x307777=_0x307777-0x0;var _0x3c13c6=_0x4875[_0x307777];return _0x3c13c6;};'use strict';var _=require('lodash');var util=require(_0x5487('0x0'));var logger=require(_0x5487('0x1'))(_0x5487('0x2'));var moment=require(_0x5487('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5487('0x4'));var rimraf=require('rimraf');var config=require(_0x5487('0x5'));var attributes=require(_0x5487('0x6'));module[_0x5487('0x7')]=function(_0x4539ca,_0x3877d9){return _0x4539ca['define'](_0x5487('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index c7efb5f..9ea225a 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','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','info','result'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4925f7,_0x3d4e6b){_0x4925f7=_0x4925f7-0x0;var _0x4cbb3f=_0x3f8a[_0x4925f7];return _0x4cbb3f;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x584dd6,_0x188607){var _0x452c05=function(_0x13424f){while(--_0x13424f){_0x584dd6['push'](_0x584dd6['shift']());}};_0x452c05(++_0x188607);}(_0x57ca,0x108));var _0xa57c=function(_0x324eb4,_0x376c81){_0x324eb4=_0x324eb4-0x0;var _0x469e65=_0x57ca[_0x324eb4];return _0x469e65;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 7b68b80..8fd5bc4 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 _0x5581=['isAuthenticated','index','/:id','show','get','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller'];(function(_0x312edd,_0x25f8b2){var _0x538aa2=function(_0x891bc0){while(--_0x891bc0){_0x312edd['push'](_0x312edd['shift']());}};_0x538aa2(++_0x25f8b2);}(_0x5581,0x115));var _0x1558=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5581[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x1558('0x0'));var util=require('util');var path=require(_0x1558('0x1'));var timeout=require(_0x1558('0x2'));var express=require(_0x1558('0x3'));var router=express[_0x1558('0x4')]();var fs_extra=require(_0x1558('0x5'));var auth=require(_0x1558('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1558('0x7'));var controller=require(_0x1558('0x8'));router['get']('/',auth[_0x1558('0x9')](),controller[_0x1558('0xa')]);router['get'](_0x1558('0xb'),auth[_0x1558('0x9')](),controller[_0x1558('0xc')]);router[_0x1558('0xd')](_0x1558('0xe'),auth['isAuthenticated'](),controller[_0x1558('0xf')]);router[_0x1558('0x10')]('/',auth[_0x1558('0x9')](),controller[_0x1558('0x11')]);router[_0x1558('0x10')](_0x1558('0xe'),auth[_0x1558('0x9')](),controller[_0x1558('0x12')]);router[_0x1558('0x10')](_0x1558('0x13'),auth[_0x1558('0x9')](),controller[_0x1558('0x14')]);router[_0x1558('0x15')]('/:id',auth[_0x1558('0x9')](),controller[_0x1558('0x16')]);router[_0x1558('0x17')](_0x1558('0xb'),auth[_0x1558('0x9')](),controller[_0x1558('0x18')]);module[_0x1558('0x19')]=router; \ No newline at end of file +var _0xe314=['../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','get','/:id','isAuthenticated','show','getIntervals','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xd7f314,_0x176c1a){var _0x41c0ca=function(_0x37298f){while(--_0x37298f){_0xd7f314['push'](_0xd7f314['shift']());}};_0x41c0ca(++_0x176c1a);}(_0xe314,0x7c));var _0x4e31=function(_0x45c9c3,_0x19d602){_0x45c9c3=_0x45c9c3-0x0;var _0x1f5f1d=_0xe314[_0x45c9c3];return _0x1f5f1d;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require(_0x4e31('0x3'));var router=express[_0x4e31('0x4')]();var fs_extra=require(_0x4e31('0x5'));var auth=require(_0x4e31('0x6'));var interaction=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var controller=require(_0x4e31('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e31('0xa')]);router[_0x4e31('0xb')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xb')]('/:id/sub_intervals',auth[_0x4e31('0xd')](),controller[_0x4e31('0xf')]);router[_0x4e31('0x10')]('/',auth[_0x4e31('0xd')](),controller['create']);router[_0x4e31('0x10')](_0x4e31('0x11'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x12')]);router[_0x4e31('0x10')](_0x4e31('0x13'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x14')]);router[_0x4e31('0x15')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x16')]);router[_0x4e31('0x17')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x18')]);module[_0x4e31('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index cf6c5cd..af65b1c 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 _0x7537=['exports','STRING','sequelize'];(function(_0x30b386,_0x5f03db){var _0x245f80=function(_0xd715da){while(--_0xd715da){_0x30b386['push'](_0x30b386['shift']());}};_0x245f80(++_0x5f03db);}(_0x7537,0x9e));var _0x7753=function(_0x3a9155,_0x572b67){_0x3a9155=_0x3a9155-0x0;var _0x1b9aa8=_0x7537[_0x3a9155];return _0x1b9aa8;};'use strict';var Sequelize=require(_0x7753('0x0'));module[_0x7753('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7753('0x2')]},'interval':{'type':Sequelize[_0x7753('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7e04=['sequelize','exports','STRING'];(function(_0x1e6a9e,_0x5614aa){var _0x1dedac=function(_0x387d0b){while(--_0x387d0b){_0x1e6a9e['push'](_0x1e6a9e['shift']());}};_0x1dedac(++_0x5614aa);}(_0x7e04,0x150));var _0x47e0=function(_0x4e516d,_0x482c2f){_0x4e516d=_0x4e516d-0x0;var _0x4adae3=_0x7e04[_0x4e516d];return _0x4adae3;};'use strict';var Sequelize=require(_0x47e0('0x0'));module[_0x47e0('0x1')]={'name':{'type':Sequelize[_0x47e0('0x2')]},'description':{'type':Sequelize[_0x47e0('0x2')]},'interval':{'type':Sequelize[_0x47e0('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e050acf..4f8e829 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 _0x38c8=['offset','set','Content-Range','apply','reject','save','update','then','get','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','Interval','rows','catch','show','params','find','create','body','user','Intervals','userProfileId','autoAssociation','UserProfileResource','destroy','addInterval','nolimit','getIntervals','addIntervals','findOne','sequelize','transaction','IntervalId','findAll','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','limit','undefined','count'];(function(_0x27dac1,_0x1e4190){var _0x2ead36=function(_0x914eeb){while(--_0x914eeb){_0x27dac1['push'](_0x27dac1['shift']());}};_0x2ead36(++_0x1e4190);}(_0x38c8,0x14c));var _0x838c=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x38c8[_0x12a2a6];return _0x1754ae;};'use strict';var emlformat=require(_0x838c('0x0'));var rimraf=require(_0x838c('0x1'));var zipdir=require(_0x838c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x838c('0x3'));var moment=require('moment');var BPromise=require(_0x838c('0x4'));var Mustache=require('mustache');var util=require(_0x838c('0x5'));var path=require(_0x838c('0x6'));var sox=require('sox');var csv=require(_0x838c('0x7'));var ejs=require(_0x838c('0x8'));var fs=require('fs');var fs_extra=require(_0x838c('0x9'));var _=require(_0x838c('0xa'));var squel=require(_0x838c('0xb'));var crypto=require(_0x838c('0xc'));var jsforce=require(_0x838c('0xd'));var deskjs=require(_0x838c('0xe'));var toCsv=require(_0x838c('0x7'));var querystring=require(_0x838c('0xf'));var Papa=require(_0x838c('0x10'));var Redis=require(_0x838c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x838c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x838c('0x13'));var logger=require(_0x838c('0x14'))('api');var utils=require(_0x838c('0x15'));var config=require(_0x838c('0x16'));var licenseUtil=require(_0x838c('0x17'));var db=require(_0x838c('0x18'))['db'];var extensions=require(_0x838c('0x19'));function respondWithStatusCode(_0x2db250,_0xb0709b){_0xb0709b=_0xb0709b||0xcc;return function(_0x4108d9){if(_0x4108d9){return _0x2db250[_0x838c('0x1a')](_0xb0709b);}return _0x2db250['status'](_0xb0709b)['end']();};}function respondWithResult(_0x538f26,_0x572a2c){_0x572a2c=_0x572a2c||0xc8;return function(_0x28da7b){if(_0x28da7b){return _0x538f26[_0x838c('0x1b')](_0x572a2c)[_0x838c('0x1c')](_0x28da7b);}};}function respondWithFilteredResult(_0x1bc65a,_0x348b6f){return function(_0x570ca0){if(_0x570ca0){var _0x427fca=typeof _0x348b6f['offset']==='undefined'&&typeof _0x348b6f[_0x838c('0x1d')]===_0x838c('0x1e');var _0xb74e4e=_0x570ca0[_0x838c('0x1f')];var _0x58a1fd=_0x427fca?0x0:_0x348b6f['offset'];var _0xc134bc=_0x427fca?_0x570ca0[_0x838c('0x1f')]:_0x348b6f[_0x838c('0x20')]+_0x348b6f[_0x838c('0x1d')];var _0x17299c;if(_0xc134bc>=_0xb74e4e){_0xc134bc=_0xb74e4e;_0x17299c=0xc8;}else{_0x17299c=0xce;}_0x1bc65a[_0x838c('0x1b')](_0x17299c);return _0x1bc65a[_0x838c('0x21')](_0x838c('0x22'),_0x58a1fd+'-'+_0xc134bc+'/'+_0xb74e4e)[_0x838c('0x1c')](_0x570ca0);}return null;};}function patchUpdates(_0x14eecb){return function(_0x47757e){try{jsonpatch[_0x838c('0x23')](_0x47757e,_0x14eecb,!![]);}catch(_0x3d9288){return BPromise[_0x838c('0x24')](_0x3d9288);}return _0x47757e[_0x838c('0x25')]();};}function saveUpdates(_0xa1cd17,_0xc968a5){return function(_0x2dde9a){if(_0x2dde9a){return _0x2dde9a[_0x838c('0x26')](_0xa1cd17)[_0x838c('0x27')](function(_0xdcdeec){return _0xdcdeec;});}return null;};}function removeEntity(_0x567275,_0x23602d){return function(_0x17d9c3){if(_0x17d9c3){return _0x17d9c3['destroy']()[_0x838c('0x27')](function(){var _0x2be7ef=_0x17d9c3[_0x838c('0x28')]({'plain':!![]});var _0x21736c='Intervals';return db['UserProfileResource']['destroy']({'where':{'type':_0x21736c,'resourceId':_0x2be7ef['id']}})['then'](function(){return _0x17d9c3;});})['then'](function(){_0x567275[_0x838c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x920ede,_0x3071e1){return function(_0x478e51){if(!_0x478e51){_0x920ede[_0x838c('0x1a')](0x194);}return _0x478e51;};}function handleError(_0x15d76a,_0x5a8dd1){_0x5a8dd1=_0x5a8dd1||0x1f4;return function(_0x480ce6){logger[_0x838c('0x29')](_0x480ce6[_0x838c('0x2a')]);if(_0x480ce6[_0x838c('0x2b')]){delete _0x480ce6[_0x838c('0x2b')];}_0x15d76a[_0x838c('0x1b')](_0x5a8dd1)[_0x838c('0x2c')](_0x480ce6);};}exports['index']=function(_0x33a7a6,_0x194f73){var _0x255f25={},_0x3dde18={},_0x412c76={'count':0x0,'rows':[]};var _0x839a61=_[_0x838c('0x2d')](db['Interval'][_0x838c('0x2e')],function(_0x9eefd2){return{'name':_0x9eefd2[_0x838c('0x2f')],'type':_0x9eefd2['type'][_0x838c('0x30')]};});_0x3dde18[_0x838c('0x31')]=_[_0x838c('0x2d')](_0x839a61,_0x838c('0x2b'));_0x3dde18[_0x838c('0x32')]=_[_0x838c('0x33')](_0x33a7a6[_0x838c('0x32')]);_0x3dde18[_0x838c('0x34')]=_[_0x838c('0x35')](_0x3dde18[_0x838c('0x31')],_0x3dde18[_0x838c('0x32')]);_0x255f25[_0x838c('0x36')]=_[_0x838c('0x35')](_0x3dde18[_0x838c('0x31')],qs[_0x838c('0x37')](_0x33a7a6[_0x838c('0x32')][_0x838c('0x37')]));_0x255f25['attributes']=_0x255f25['attributes'][_0x838c('0x38')]?_0x255f25[_0x838c('0x36')]:_0x3dde18[_0x838c('0x31')];if(!_0x33a7a6['query'][_0x838c('0x39')]('nolimit')){_0x255f25['limit']=qs['limit'](_0x33a7a6['query'][_0x838c('0x1d')]);_0x255f25[_0x838c('0x20')]=qs['offset'](_0x33a7a6[_0x838c('0x32')][_0x838c('0x20')]);}_0x255f25[_0x838c('0x3a')]=qs[_0x838c('0x3b')](_0x33a7a6[_0x838c('0x32')]['sort']);_0x255f25['where']=qs[_0x838c('0x34')](_[_0x838c('0x3c')](_0x33a7a6[_0x838c('0x32')],_0x3dde18[_0x838c('0x34')]),_0x839a61);if(_0x33a7a6[_0x838c('0x32')][_0x838c('0x3d')]){_0x255f25[_0x838c('0x3e')]=_[_0x838c('0x3f')](_0x255f25['where'],{'$or':_['map'](_0x839a61,function(_0x185e64){if(_0x185e64['type']!==_0x838c('0x40')){var _0x56631b={};_0x56631b[_0x185e64[_0x838c('0x2b')]]={'$like':'%'+_0x33a7a6[_0x838c('0x32')][_0x838c('0x3d')]+'%'};return _0x56631b;}})});}_0x255f25=_[_0x838c('0x3f')]({},_0x255f25,_0x33a7a6[_0x838c('0x41')]);var _0x467c52={'where':_0x255f25[_0x838c('0x3e')]};return db['Interval'][_0x838c('0x1f')](_0x467c52)[_0x838c('0x27')](function(_0x2fd846){_0x412c76[_0x838c('0x1f')]=_0x2fd846;if(_0x33a7a6[_0x838c('0x32')][_0x838c('0x42')]){_0x255f25[_0x838c('0x43')]=[{'all':!![]}];}return db[_0x838c('0x44')]['findAll'](_0x255f25);})[_0x838c('0x27')](function(_0x2ecadf){_0x412c76[_0x838c('0x45')]=_0x2ecadf;return _0x412c76;})[_0x838c('0x27')](respondWithFilteredResult(_0x194f73,_0x255f25))[_0x838c('0x46')](handleError(_0x194f73,null));};exports[_0x838c('0x47')]=function(_0xf02409,_0x37189a){var _0x38d8fa={'raw':!![],'where':{'id':_0xf02409[_0x838c('0x48')]['id']}},_0x41b2fd={};_0x41b2fd[_0x838c('0x31')]=_['keys'](db['Interval'][_0x838c('0x2e')]);_0x41b2fd['query']=_['keys'](_0xf02409['query']);_0x41b2fd['filters']=_['intersection'](_0x41b2fd[_0x838c('0x31')],_0x41b2fd[_0x838c('0x32')]);_0x38d8fa[_0x838c('0x36')]=_[_0x838c('0x35')](_0x41b2fd[_0x838c('0x31')],qs['fields'](_0xf02409['query'][_0x838c('0x37')]));_0x38d8fa[_0x838c('0x36')]=_0x38d8fa[_0x838c('0x36')][_0x838c('0x38')]?_0x38d8fa['attributes']:_0x41b2fd[_0x838c('0x31')];if(_0xf02409[_0x838c('0x32')]['includeAll']){_0x38d8fa[_0x838c('0x43')]=[{'all':!![]}];}_0x38d8fa=_[_0x838c('0x3f')]({},_0x38d8fa,_0xf02409[_0x838c('0x41')]);return db[_0x838c('0x44')][_0x838c('0x49')](_0x38d8fa)[_0x838c('0x27')](handleEntityNotFound(_0x37189a,null))[_0x838c('0x27')](respondWithResult(_0x37189a,null))['catch'](handleError(_0x37189a,null));};exports['create']=function(_0x7c929c,_0x1e9bdc){return db[_0x838c('0x44')][_0x838c('0x4a')](_0x7c929c[_0x838c('0x4b')],{})[_0x838c('0x27')](function(_0x14ffa9){var _0x4a5270=_0x7c929c[_0x838c('0x4c')][_0x838c('0x28')]({'plain':!![]});if(!_0x4a5270)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a5270['role']===_0x838c('0x4c')){var _0x34459e=_0x14ffa9['get']({'plain':!![]});var _0x4e476a=_0x838c('0x4d');return db['UserProfileSection'][_0x838c('0x49')]({'where':{'name':_0x4e476a,'userProfileId':_0x4a5270[_0x838c('0x4e')]},'raw':!![]})[_0x838c('0x27')](function(_0x16ec94){if(_0x16ec94&&_0x16ec94[_0x838c('0x4f')]===0x0){return db[_0x838c('0x50')]['create']({'name':_0x34459e['name'],'resourceId':_0x34459e['id'],'type':_0x16ec94['name'],'sectionId':_0x16ec94['id']},{})['then'](function(){return _0x14ffa9;});}else{return _0x14ffa9;}})[_0x838c('0x46')](function(_0x5e51cf){logger[_0x838c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e51cf);throw _0x5e51cf;});}return _0x14ffa9;})[_0x838c('0x27')](respondWithResult(_0x1e9bdc,0xc9))[_0x838c('0x46')](handleError(_0x1e9bdc,null));};exports[_0x838c('0x26')]=function(_0x3a66ed,_0x3cc1fd){if(_0x3a66ed['body']['id']){delete _0x3a66ed[_0x838c('0x4b')]['id'];}return db[_0x838c('0x44')][_0x838c('0x49')]({'where':{'id':_0x3a66ed[_0x838c('0x48')]['id']}})['then'](handleEntityNotFound(_0x3cc1fd,null))[_0x838c('0x27')](saveUpdates(_0x3a66ed[_0x838c('0x4b')],null))['then'](respondWithResult(_0x3cc1fd,null))[_0x838c('0x46')](handleError(_0x3cc1fd,null));};exports[_0x838c('0x51')]=function(_0xe5cc9d,_0x2b3dcf){return db[_0x838c('0x44')][_0x838c('0x49')]({'where':{'id':_0xe5cc9d[_0x838c('0x48')]['id']}})[_0x838c('0x27')](handleEntityNotFound(_0x2b3dcf,null))[_0x838c('0x27')](removeEntity(_0x2b3dcf,null))[_0x838c('0x46')](handleError(_0x2b3dcf,null));};exports[_0x838c('0x52')]=function(_0x57dfaf,_0x2ac6ff,_0xbc595e){if(_0x57dfaf['body']['id']){delete _0x57dfaf[_0x838c('0x4b')]['id'];}return db[_0x838c('0x44')][_0x838c('0x49')]({'where':{'id':_0x57dfaf[_0x838c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2ac6ff,null))['then'](function(_0x1b02b3){if(_0x1b02b3){_0x57dfaf['body']['IntervalId']=_0x1b02b3['id'];return db['Interval'][_0x838c('0x4a')](_0x57dfaf[_0x838c('0x4b')]);}})['then'](respondWithResult(_0x2ac6ff,null))[_0x838c('0x46')](handleError(_0x2ac6ff,null));};exports['getIntervals']=function(_0x71510f,_0x25aa18,_0x36b89c){var _0x3e6d5b={};var _0x57d893={};var _0x593dbd;var _0xf818ca;return db[_0x838c('0x44')]['findOne']({'where':{'id':_0x71510f[_0x838c('0x48')]['id']}})[_0x838c('0x27')](handleEntityNotFound(_0x25aa18,null))['then'](function(_0x59fe3b){if(_0x59fe3b){_0x593dbd=_0x59fe3b;_0x57d893[_0x838c('0x31')]=_['keys'](db[_0x838c('0x44')]['rawAttributes']);_0x57d893[_0x838c('0x32')]=_[_0x838c('0x33')](_0x71510f[_0x838c('0x32')]);_0x57d893[_0x838c('0x34')]=_[_0x838c('0x35')](_0x57d893[_0x838c('0x31')],_0x57d893[_0x838c('0x32')]);_0x3e6d5b['attributes']=_['intersection'](_0x57d893['model'],qs[_0x838c('0x37')](_0x71510f[_0x838c('0x32')][_0x838c('0x37')]));_0x3e6d5b[_0x838c('0x36')]=_0x3e6d5b['attributes']['length']?_0x3e6d5b['attributes']:_0x57d893[_0x838c('0x31')];_0x3e6d5b['order']=qs[_0x838c('0x3b')](_0x71510f[_0x838c('0x32')]['sort']);_0x3e6d5b[_0x838c('0x3e')]=qs[_0x838c('0x34')](_[_0x838c('0x3c')](_0x71510f[_0x838c('0x32')],_0x57d893['filters']));if(_0x71510f[_0x838c('0x32')]['filter']){_0x3e6d5b['where']=_[_0x838c('0x3f')](_0x3e6d5b[_0x838c('0x3e')],{'$or':_['map'](_0x3e6d5b[_0x838c('0x36')],function(_0x5a98d7){var _0x14d8aa={};_0x14d8aa[_0x5a98d7]={'$like':'%'+_0x71510f[_0x838c('0x32')][_0x838c('0x3d')]+'%'};return _0x14d8aa;})});}_0x3e6d5b=_[_0x838c('0x3f')]({},_0x3e6d5b,_0x71510f[_0x838c('0x41')]);return _0x593dbd['getIntervals'](_0x3e6d5b);}})[_0x838c('0x27')](function(_0x129984){if(_0x129984){_0xf818ca=_0x129984['length'];if(!_0x71510f[_0x838c('0x32')]['hasOwnProperty'](_0x838c('0x53'))){_0x3e6d5b['limit']=qs['limit'](_0x71510f[_0x838c('0x32')][_0x838c('0x1d')]);_0x3e6d5b[_0x838c('0x20')]=qs[_0x838c('0x20')](_0x71510f[_0x838c('0x32')][_0x838c('0x20')]);}return _0x593dbd[_0x838c('0x54')](_0x3e6d5b);}})[_0x838c('0x27')](function(_0x3d8ebd){if(_0x3d8ebd){return _0x3d8ebd?{'count':_0xf818ca,'rows':_0x3d8ebd}:null;}})[_0x838c('0x27')](respondWithResult(_0x25aa18,null))[_0x838c('0x46')](handleError(_0x25aa18,null));};exports[_0x838c('0x55')]=function(_0x26fa2a,_0x40a4c2,_0x500400){return db[_0x838c('0x44')][_0x838c('0x56')]({'where':{'id':_0x26fa2a[_0x838c('0x48')]['id']}})[_0x838c('0x27')](handleEntityNotFound(_0x40a4c2,null))[_0x838c('0x27')](function(_0x20fc70){if(_0x20fc70){return db[_0x838c('0x57')][_0x838c('0x58')](function(_0x4383a6){return db[_0x838c('0x44')][_0x838c('0x51')]({'where':{'IntervalId':_0x26fa2a['params']['id']},'transaction':_0x4383a6})[_0x838c('0x27')](function(_0x2db07d){var _0x154e88=_[_0x838c('0x2d')](_0x26fa2a[_0x838c('0x4b')],function(_0x1c1c4f){delete _0x1c1c4f['id'];_0x1c1c4f[_0x838c('0x59')]=_0x26fa2a[_0x838c('0x48')]['id'];return _0x1c1c4f;});return db[_0x838c('0x44')]['bulkCreate'](_0x154e88,{'transaction':_0x4383a6});});})['then'](function(){return db['Interval'][_0x838c('0x5a')]({'where':{'IntervalId':_0x26fa2a[_0x838c('0x48')]['id']}});});}})['then'](respondWithResult(_0x40a4c2,null))['catch'](handleError(_0x40a4c2,null));}; \ No newline at end of file +var _0x3aa3=['../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','Intervals','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','addIntervals','findOne','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3a8208,_0x99ea10){var _0x3733e6=function(_0x34500e){while(--_0x34500e){_0x3a8208['push'](_0x3a8208['shift']());}};_0x3733e6(++_0x99ea10);}(_0x3aa3,0x9e));var _0x33aa=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x3aa3[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33aa('0x0'));var zipdir=require(_0x33aa('0x1'));var jsonpatch=require(_0x33aa('0x2'));var rp=require(_0x33aa('0x3'));var moment=require(_0x33aa('0x4'));var BPromise=require(_0x33aa('0x5'));var Mustache=require(_0x33aa('0x6'));var util=require(_0x33aa('0x7'));var path=require(_0x33aa('0x8'));var sox=require(_0x33aa('0x9'));var csv=require(_0x33aa('0xa'));var ejs=require(_0x33aa('0xb'));var fs=require('fs');var fs_extra=require(_0x33aa('0xc'));var _=require('lodash');var squel=require(_0x33aa('0xd'));var crypto=require(_0x33aa('0xe'));var jsforce=require(_0x33aa('0xf'));var deskjs=require(_0x33aa('0x10'));var toCsv=require(_0x33aa('0xa'));var querystring=require(_0x33aa('0x11'));var Papa=require('papaparse');var Redis=require(_0x33aa('0x12'));var authService=require(_0x33aa('0x13'));var qs=require(_0x33aa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33aa('0x15'));var logger=require(_0x33aa('0x16'))(_0x33aa('0x17'));var utils=require(_0x33aa('0x18'));var config=require(_0x33aa('0x19'));var licenseUtil=require(_0x33aa('0x1a'));var db=require(_0x33aa('0x1b'))['db'];var extensions=require(_0x33aa('0x1c'));function respondWithStatusCode(_0x32a20f,_0x2ba13e){_0x2ba13e=_0x2ba13e||0xcc;return function(_0x18356f){if(_0x18356f){return _0x32a20f[_0x33aa('0x1d')](_0x2ba13e);}return _0x32a20f['status'](_0x2ba13e)['end']();};}function respondWithResult(_0x650e23,_0x151556){_0x151556=_0x151556||0xc8;return function(_0x27c971){if(_0x27c971){return _0x650e23[_0x33aa('0x1e')](_0x151556)[_0x33aa('0x1f')](_0x27c971);}};}function respondWithFilteredResult(_0x1ed697,_0x3f8608){return function(_0x24dd34){if(_0x24dd34){var _0x4b400f=typeof _0x3f8608[_0x33aa('0x20')]===_0x33aa('0x21')&&typeof _0x3f8608[_0x33aa('0x22')]===_0x33aa('0x21');var _0x11eb4a=_0x24dd34[_0x33aa('0x23')];var _0x880237=_0x4b400f?0x0:_0x3f8608[_0x33aa('0x20')];var _0x2b8d89=_0x4b400f?_0x24dd34['count']:_0x3f8608[_0x33aa('0x20')]+_0x3f8608[_0x33aa('0x22')];var _0x16ed96;if(_0x2b8d89>=_0x11eb4a){_0x2b8d89=_0x11eb4a;_0x16ed96=0xc8;}else{_0x16ed96=0xce;}_0x1ed697['status'](_0x16ed96);return _0x1ed697[_0x33aa('0x24')](_0x33aa('0x25'),_0x880237+'-'+_0x2b8d89+'/'+_0x11eb4a)[_0x33aa('0x1f')](_0x24dd34);}return null;};}function patchUpdates(_0x4d9233){return function(_0x4e37ec){try{jsonpatch['apply'](_0x4e37ec,_0x4d9233,!![]);}catch(_0x2cb280){return BPromise[_0x33aa('0x26')](_0x2cb280);}return _0x4e37ec['save']();};}function saveUpdates(_0x216d8e,_0x5bf965){return function(_0x11378c){if(_0x11378c){return _0x11378c[_0x33aa('0x27')](_0x216d8e)['then'](function(_0x4d26c4){return _0x4d26c4;});}return null;};}function removeEntity(_0x2ab669,_0x5a2e3f){return function(_0x3afac3){if(_0x3afac3){return _0x3afac3[_0x33aa('0x28')]()[_0x33aa('0x29')](function(){var _0x5638a6=_0x3afac3[_0x33aa('0x2a')]({'plain':!![]});var _0x2fda47=_0x33aa('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x2fda47,'resourceId':_0x5638a6['id']}})[_0x33aa('0x29')](function(){return _0x3afac3;});})[_0x33aa('0x29')](function(){_0x2ab669['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3738d6,_0x370dcd){return function(_0x2d981f){if(!_0x2d981f){_0x3738d6[_0x33aa('0x1d')](0x194);}return _0x2d981f;};}function handleError(_0x5b9820,_0x348ae2){_0x348ae2=_0x348ae2||0x1f4;return function(_0x551a5b){logger[_0x33aa('0x2c')](_0x551a5b[_0x33aa('0x2d')]);if(_0x551a5b[_0x33aa('0x2e')]){delete _0x551a5b[_0x33aa('0x2e')];}_0x5b9820['status'](_0x348ae2)[_0x33aa('0x2f')](_0x551a5b);};}exports[_0x33aa('0x30')]=function(_0x4c3e75,_0x5ea3ef){var _0x1660b5={},_0x4c4203={},_0x54d672={'count':0x0,'rows':[]};var _0x257946=_[_0x33aa('0x31')](db[_0x33aa('0x32')][_0x33aa('0x33')],function(_0x58f0f8){return{'name':_0x58f0f8[_0x33aa('0x34')],'type':_0x58f0f8[_0x33aa('0x35')][_0x33aa('0x36')]};});_0x4c4203[_0x33aa('0x37')]=_['map'](_0x257946,_0x33aa('0x2e'));_0x4c4203[_0x33aa('0x38')]=_[_0x33aa('0x39')](_0x4c3e75[_0x33aa('0x38')]);_0x4c4203['filters']=_['intersection'](_0x4c4203[_0x33aa('0x37')],_0x4c4203[_0x33aa('0x38')]);_0x1660b5[_0x33aa('0x3a')]=_[_0x33aa('0x3b')](_0x4c4203[_0x33aa('0x37')],qs['fields'](_0x4c3e75[_0x33aa('0x38')][_0x33aa('0x3c')]));_0x1660b5[_0x33aa('0x3a')]=_0x1660b5[_0x33aa('0x3a')][_0x33aa('0x3d')]?_0x1660b5[_0x33aa('0x3a')]:_0x4c4203[_0x33aa('0x37')];if(!_0x4c3e75[_0x33aa('0x38')][_0x33aa('0x3e')](_0x33aa('0x3f'))){_0x1660b5[_0x33aa('0x22')]=qs[_0x33aa('0x22')](_0x4c3e75[_0x33aa('0x38')][_0x33aa('0x22')]);_0x1660b5['offset']=qs['offset'](_0x4c3e75[_0x33aa('0x38')][_0x33aa('0x20')]);}_0x1660b5[_0x33aa('0x40')]=qs[_0x33aa('0x41')](_0x4c3e75[_0x33aa('0x38')][_0x33aa('0x41')]);_0x1660b5[_0x33aa('0x42')]=qs['filters'](_[_0x33aa('0x43')](_0x4c3e75[_0x33aa('0x38')],_0x4c4203[_0x33aa('0x44')]),_0x257946);if(_0x4c3e75[_0x33aa('0x38')][_0x33aa('0x45')]){_0x1660b5[_0x33aa('0x42')]=_[_0x33aa('0x46')](_0x1660b5[_0x33aa('0x42')],{'$or':_[_0x33aa('0x31')](_0x257946,function(_0x2a630e){if(_0x2a630e['type']!=='VIRTUAL'){var _0x51f06e={};_0x51f06e[_0x2a630e['name']]={'$like':'%'+_0x4c3e75[_0x33aa('0x38')]['filter']+'%'};return _0x51f06e;}})});}_0x1660b5=_['merge']({},_0x1660b5,_0x4c3e75[_0x33aa('0x47')]);var _0x14c71e={'where':_0x1660b5['where']};return db[_0x33aa('0x32')][_0x33aa('0x23')](_0x14c71e)[_0x33aa('0x29')](function(_0xde23b5){_0x54d672[_0x33aa('0x23')]=_0xde23b5;if(_0x4c3e75['query'][_0x33aa('0x48')]){_0x1660b5[_0x33aa('0x49')]=[{'all':!![]}];}return db[_0x33aa('0x32')][_0x33aa('0x4a')](_0x1660b5);})[_0x33aa('0x29')](function(_0x32867b){_0x54d672['rows']=_0x32867b;return _0x54d672;})[_0x33aa('0x29')](respondWithFilteredResult(_0x5ea3ef,_0x1660b5))[_0x33aa('0x4b')](handleError(_0x5ea3ef,null));};exports[_0x33aa('0x4c')]=function(_0x1869cd,_0x38e911){var _0x3d980c={'raw':!![],'where':{'id':_0x1869cd[_0x33aa('0x4d')]['id']}},_0x263fb4={};_0x263fb4[_0x33aa('0x37')]=_[_0x33aa('0x39')](db[_0x33aa('0x32')][_0x33aa('0x33')]);_0x263fb4[_0x33aa('0x38')]=_['keys'](_0x1869cd['query']);_0x263fb4[_0x33aa('0x44')]=_[_0x33aa('0x3b')](_0x263fb4[_0x33aa('0x37')],_0x263fb4[_0x33aa('0x38')]);_0x3d980c[_0x33aa('0x3a')]=_[_0x33aa('0x3b')](_0x263fb4[_0x33aa('0x37')],qs['fields'](_0x1869cd[_0x33aa('0x38')][_0x33aa('0x3c')]));_0x3d980c[_0x33aa('0x3a')]=_0x3d980c[_0x33aa('0x3a')][_0x33aa('0x3d')]?_0x3d980c['attributes']:_0x263fb4[_0x33aa('0x37')];if(_0x1869cd['query'][_0x33aa('0x48')]){_0x3d980c[_0x33aa('0x49')]=[{'all':!![]}];}_0x3d980c=_[_0x33aa('0x46')]({},_0x3d980c,_0x1869cd[_0x33aa('0x47')]);return db['Interval']['find'](_0x3d980c)[_0x33aa('0x29')](handleEntityNotFound(_0x38e911,null))[_0x33aa('0x29')](respondWithResult(_0x38e911,null))[_0x33aa('0x4b')](handleError(_0x38e911,null));};exports['create']=function(_0x2bac15,_0x31c3f4){return db[_0x33aa('0x32')][_0x33aa('0x4e')](_0x2bac15[_0x33aa('0x4f')],{})['then'](function(_0x736c57){var _0x19346a=_0x2bac15['user'][_0x33aa('0x2a')]({'plain':!![]});if(!_0x19346a)throw new Error(_0x33aa('0x50'));if(_0x19346a[_0x33aa('0x51')]==='user'){var _0x4c481a=_0x736c57[_0x33aa('0x2a')]({'plain':!![]});var _0x1050a5=_0x33aa('0x2b');return db[_0x33aa('0x52')][_0x33aa('0x53')]({'where':{'name':_0x1050a5,'userProfileId':_0x19346a['userProfileId']},'raw':!![]})[_0x33aa('0x29')](function(_0x5c3469){if(_0x5c3469&&_0x5c3469['autoAssociation']===0x0){return db[_0x33aa('0x54')][_0x33aa('0x4e')]({'name':_0x4c481a[_0x33aa('0x2e')],'resourceId':_0x4c481a['id'],'type':_0x5c3469[_0x33aa('0x2e')],'sectionId':_0x5c3469['id']},{})[_0x33aa('0x29')](function(){return _0x736c57;});}else{return _0x736c57;}})[_0x33aa('0x4b')](function(_0x4bf464){logger[_0x33aa('0x2c')](_0x33aa('0x55'),_0x4bf464);throw _0x4bf464;});}return _0x736c57;})['then'](respondWithResult(_0x31c3f4,0xc9))[_0x33aa('0x4b')](handleError(_0x31c3f4,null));};exports['update']=function(_0x35a23f,_0x52a56c){if(_0x35a23f[_0x33aa('0x4f')]['id']){delete _0x35a23f[_0x33aa('0x4f')]['id'];}return db['Interval'][_0x33aa('0x53')]({'where':{'id':_0x35a23f['params']['id']}})['then'](handleEntityNotFound(_0x52a56c,null))['then'](saveUpdates(_0x35a23f[_0x33aa('0x4f')],null))[_0x33aa('0x29')](respondWithResult(_0x52a56c,null))[_0x33aa('0x4b')](handleError(_0x52a56c,null));};exports[_0x33aa('0x28')]=function(_0x27ead9,_0x5e3f59){return db['Interval'][_0x33aa('0x53')]({'where':{'id':_0x27ead9[_0x33aa('0x4d')]['id']}})[_0x33aa('0x29')](handleEntityNotFound(_0x5e3f59,null))[_0x33aa('0x29')](removeEntity(_0x5e3f59,null))[_0x33aa('0x4b')](handleError(_0x5e3f59,null));};exports['addInterval']=function(_0x5749de,_0x37f978,_0x31b85e){if(_0x5749de[_0x33aa('0x4f')]['id']){delete _0x5749de['body']['id'];}return db[_0x33aa('0x32')]['find']({'where':{'id':_0x5749de[_0x33aa('0x4d')]['id']}})[_0x33aa('0x29')](handleEntityNotFound(_0x37f978,null))[_0x33aa('0x29')](function(_0x3e91fe){if(_0x3e91fe){_0x5749de[_0x33aa('0x4f')][_0x33aa('0x56')]=_0x3e91fe['id'];return db[_0x33aa('0x32')][_0x33aa('0x4e')](_0x5749de['body']);}})[_0x33aa('0x29')](respondWithResult(_0x37f978,null))['catch'](handleError(_0x37f978,null));};exports[_0x33aa('0x57')]=function(_0x1d5e73,_0x4ea9a5,_0x5e8334){var _0x301783={};var _0x3e5e89={};var _0x4f55dd;var _0x5b6768;return db[_0x33aa('0x32')]['findOne']({'where':{'id':_0x1d5e73['params']['id']}})[_0x33aa('0x29')](handleEntityNotFound(_0x4ea9a5,null))[_0x33aa('0x29')](function(_0x1de410){if(_0x1de410){_0x4f55dd=_0x1de410;_0x3e5e89[_0x33aa('0x37')]=_[_0x33aa('0x39')](db[_0x33aa('0x32')][_0x33aa('0x33')]);_0x3e5e89['query']=_[_0x33aa('0x39')](_0x1d5e73[_0x33aa('0x38')]);_0x3e5e89['filters']=_['intersection'](_0x3e5e89[_0x33aa('0x37')],_0x3e5e89[_0x33aa('0x38')]);_0x301783[_0x33aa('0x3a')]=_['intersection'](_0x3e5e89[_0x33aa('0x37')],qs[_0x33aa('0x3c')](_0x1d5e73[_0x33aa('0x38')][_0x33aa('0x3c')]));_0x301783[_0x33aa('0x3a')]=_0x301783[_0x33aa('0x3a')][_0x33aa('0x3d')]?_0x301783[_0x33aa('0x3a')]:_0x3e5e89[_0x33aa('0x37')];_0x301783[_0x33aa('0x40')]=qs[_0x33aa('0x41')](_0x1d5e73['query'][_0x33aa('0x41')]);_0x301783[_0x33aa('0x42')]=qs[_0x33aa('0x44')](_[_0x33aa('0x43')](_0x1d5e73['query'],_0x3e5e89[_0x33aa('0x44')]));if(_0x1d5e73[_0x33aa('0x38')][_0x33aa('0x45')]){_0x301783[_0x33aa('0x42')]=_[_0x33aa('0x46')](_0x301783[_0x33aa('0x42')],{'$or':_['map'](_0x301783[_0x33aa('0x3a')],function(_0x10d5be){var _0x1c6e0a={};_0x1c6e0a[_0x10d5be]={'$like':'%'+_0x1d5e73[_0x33aa('0x38')][_0x33aa('0x45')]+'%'};return _0x1c6e0a;})});}_0x301783=_[_0x33aa('0x46')]({},_0x301783,_0x1d5e73['options']);return _0x4f55dd[_0x33aa('0x57')](_0x301783);}})['then'](function(_0x17cade){if(_0x17cade){_0x5b6768=_0x17cade[_0x33aa('0x3d')];if(!_0x1d5e73[_0x33aa('0x38')][_0x33aa('0x3e')]('nolimit')){_0x301783[_0x33aa('0x22')]=qs[_0x33aa('0x22')](_0x1d5e73[_0x33aa('0x38')]['limit']);_0x301783['offset']=qs[_0x33aa('0x20')](_0x1d5e73['query'][_0x33aa('0x20')]);}return _0x4f55dd['getIntervals'](_0x301783);}})[_0x33aa('0x29')](function(_0x45d254){if(_0x45d254){return _0x45d254?{'count':_0x5b6768,'rows':_0x45d254}:null;}})[_0x33aa('0x29')](respondWithResult(_0x4ea9a5,null))[_0x33aa('0x4b')](handleError(_0x4ea9a5,null));};exports[_0x33aa('0x58')]=function(_0x4e0c11,_0x36f419,_0x493e15){return db['Interval'][_0x33aa('0x59')]({'where':{'id':_0x4e0c11['params']['id']}})['then'](handleEntityNotFound(_0x36f419,null))['then'](function(_0x26c5b3){if(_0x26c5b3){return db['sequelize'][_0x33aa('0x5a')](function(_0x175db2){return db[_0x33aa('0x32')][_0x33aa('0x28')]({'where':{'IntervalId':_0x4e0c11[_0x33aa('0x4d')]['id']},'transaction':_0x175db2})[_0x33aa('0x29')](function(_0x352296){var _0x3f003b=_['map'](_0x4e0c11[_0x33aa('0x4f')],function(_0x86615f){delete _0x86615f['id'];_0x86615f[_0x33aa('0x56')]=_0x4e0c11[_0x33aa('0x4d')]['id'];return _0x86615f;});return db[_0x33aa('0x32')][_0x33aa('0x5b')](_0x3f003b,{'transaction':_0x175db2});});})[_0x33aa('0x29')](function(){return db[_0x33aa('0x32')][_0x33aa('0x4a')]({'where':{'IntervalId':_0x4e0c11[_0x33aa('0x4d')]['id']}});});}})['then'](respondWithResult(_0x36f419,null))[_0x33aa('0x4b')](handleError(_0x36f419,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index f20830d..c356e1a 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 _0x94e7=['exports','Interval','tools_intervals','rewrite','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x94e7,0x7c));var _0x794e=function(_0x4f469c,_0x20bc35){_0x4f469c=_0x4f469c-0x0;var _0x44740d=_0x94e7[_0x4f469c];return _0x44740d;};'use strict';var _=require('lodash');var util=require(_0x794e('0x0'));var logger=require(_0x794e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x794e('0x2'));var rp=require(_0x794e('0x3'));var fs=require('fs');var path=require(_0x794e('0x4'));var rimraf=require('rimraf');var config=require(_0x794e('0x5'));var attributes=require(_0x794e('0x6'));var extensions=require(_0x794e('0x7'));module[_0x794e('0x8')]=function(_0x2116a6,_0x307e36){return _0x2116a6['define'](_0x794e('0x9'),attributes,{'tableName':_0x794e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5db7d8,_0x3db399){extensions['rewrite'](_0x2116a6,_0x5db7d8);},'afterBulkCreate':function(_0xb64b4a,_0x513953,_0x359835){_0x359835();extensions[_0x794e('0xb')](_0x2116a6,_0xb64b4a[0x0]);},'afterUpdate':function(_0x69b4fb,_0x32fd9){extensions[_0x794e('0xb')](_0x2116a6,_0x69b4fb);},'afterDestroy':function(_0x8055c3,_0x3875a0){extensions[_0x794e('0xb')](_0x2116a6,_0x8055c3);}}});}; \ No newline at end of file +var _0x8d92=['request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','bluebird'];(function(_0x272a88,_0x57e586){var _0x5c71c4=function(_0x8151b3){while(--_0x8151b3){_0x272a88['push'](_0x272a88['shift']());}};_0x5c71c4(++_0x57e586);}(_0x8d92,0x1c9));var _0x28d9=function(_0x20ceec,_0x5d61e6){_0x20ceec=_0x20ceec-0x0;var _0x567ceb=_0x8d92[_0x20ceec];return _0x567ceb;};'use strict';var _=require(_0x28d9('0x0'));var util=require(_0x28d9('0x1'));var logger=require(_0x28d9('0x2'))(_0x28d9('0x3'));var moment=require('moment');var BPromise=require(_0x28d9('0x4'));var rp=require(_0x28d9('0x5'));var fs=require('fs');var path=require(_0x28d9('0x6'));var rimraf=require(_0x28d9('0x7'));var config=require('../../config/environment');var attributes=require(_0x28d9('0x8'));var extensions=require(_0x28d9('0x9'));module[_0x28d9('0xa')]=function(_0x4b978a,_0x4726a9){return _0x4b978a[_0x28d9('0xb')]('Interval',attributes,{'tableName':_0x28d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x39fcaa,_0x36d051){extensions[_0x28d9('0xd')](_0x4b978a,_0x39fcaa);},'afterBulkCreate':function(_0x56b87f,_0x1f457d,_0x9360ab){_0x9360ab();extensions[_0x28d9('0xd')](_0x4b978a,_0x56b87f[0x0]);},'afterUpdate':function(_0x2b6e80,_0x35f2b8){extensions[_0x28d9('0xd')](_0x4b978a,_0x2b6e80);},'afterDestroy':function(_0x332d9e,_0x242f45){extensions[_0x28d9('0xd')](_0x4b978a,_0x332d9e);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8c530c9..4191a69 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(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 46a4396..0239aac 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x48324d,_0x27d8bc){var _0x1ce4db=function(_0x184cf5){while(--_0x184cf5){_0x48324d['push'](_0x48324d['shift']());}};_0x1ce4db(++_0x27d8bc);}(_0x2032,0xd9));var _0x2203=function(_0x543252,_0x2a139e){_0x543252=_0x543252-0x0;var _0x5af0c3=_0x2032[_0x543252];return _0x5af0c3;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0xa209ed,_0x46d8ab){var _0xe7e229=function(_0x13ae82){while(--_0x13ae82){_0xa209ed['push'](_0xa209ed['shift']());}};_0xe7e229(++_0x46d8ab);}(_0xdb28,0x106));var _0x8db2=function(_0x55c133,_0x1b7c60){_0x55c133=_0x55c133-0x0;var _0x18aa60=_0xdb28[_0x55c133];return _0x18aa60;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('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 eac3052..cd9ec5b 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 _0x4755=['statusCode','json','parse','error','api.jira','write','send','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','setEncoding','utf8','data','end','status'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4755,0xb8));var _0x5475=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0x4755[_0xa76664];return _0x3f7743;};'use strict';var BPromise=require(_0x5475('0x0'));var https=require(_0x5475('0x1'));var logger=require(_0x5475('0x2'))('api');var USERNAME=_0x5475('0x3');var PASSWORD=_0x5475('0x4');function openIssue(_0x430acc,_0x46e7c3){var _0xbf8c99={'fields':{'project':{'key':_0x430acc[_0x5475('0x5')]||_0x5475('0x6')},'summary':(_0x430acc['summary']||'Report')+_0x5475('0x7')+_0x430acc['ip'],'description':_0x430acc[_0x5475('0x8')]||JSON[_0x5475('0x9')](_0x430acc),'issuetype':{'name':_0x430acc['issuetype']||_0x5475('0xa')}}};_0xbf8c99[_0x5475('0xb')][_0x5475('0xc')]=_0x430acc[_0x5475('0xd')];_0xbf8c99[_0x5475('0xb')]['customfield_11501']=_0x430acc[_0x5475('0xe')];_0xbf8c99[_0x5475('0xb')][_0x5475('0xf')]=_0x430acc[_0x5475('0x10')];_0xbf8c99[_0x5475('0xb')][_0x5475('0x11')]=_0x430acc['name'];_0xbf8c99[_0x5475('0xb')][_0x5475('0x12')]=_0x430acc['reason'];_0xbf8c99[_0x5475('0xb')][_0x5475('0x13')]=_0x430acc['ip'];var _0x4ea3a6={'host':_0x5475('0x14'),'port':0x1bb,'path':_0x5475('0x15'),'method':_0x5475('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x5475('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x5475('0x18')](_0x5475('0x19'))}};var _0x12ff37=JSON[_0x5475('0x9')](_0xbf8c99);var _0x3aad3e=https['request'](_0x4ea3a6,function(_0xd2930e){_0xd2930e[_0x5475('0x1a')](_0x5475('0x1b'));var _0x107000='';_0xd2930e['on'](_0x5475('0x1c'),function(_0x1dca20){_0x107000+=_0x1dca20;});_0xd2930e['on'](_0x5475('0x1d'),function(){if(_0x46e7c3){return _0x46e7c3[_0x5475('0x1e')](_0xd2930e[_0x5475('0x1f')])[_0x5475('0x20')](JSON[_0x5475('0x21')](_0x107000));}});});_0x3aad3e['on'](_0x5475('0x22'),function(_0x5c833b){if(_0x46e7c3){return _0x46e7c3[_0x5475('0x1e')](0x1f4)[_0x5475('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x5475('0x23')}]});}});_0x3aad3e[_0x5475('0x24')](_0x12ff37);_0x3aad3e[_0x5475('0x1d')]();}exports['openIssue']=openIssue;exports[_0x5475('0x25')]=function(_0x41176a,_0x2e37e9){_0x41176a[_0x5475('0x26')]['ip']=_0x41176a[_0x5475('0x27')]['x-forwarded-for']||_0x41176a[_0x5475('0x28')][_0x5475('0x29')]||_0x41176a['socket'][_0x5475('0x29')]||_0x41176a[_0x5475('0x28')][_0x5475('0x2a')][_0x5475('0x29')];return openIssue(_0x41176a[_0x5475('0x26')],_0x2e37e9);}; \ No newline at end of file +var _0xd114=['fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','data','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','remoteAddress','connection','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','Bug'];(function(_0x14f62f,_0x4b5fcb){var _0x264ade=function(_0x276756){while(--_0x276756){_0x14f62f['push'](_0x14f62f['shift']());}};_0x264ade(++_0x4b5fcb);}(_0xd114,0x1c0));var _0x4d11=function(_0x587cf6,_0x126b14){_0x587cf6=_0x587cf6-0x0;var _0x533542=_0xd114[_0x587cf6];return _0x533542;};'use strict';var BPromise=require('bluebird');var https=require(_0x4d11('0x0'));var logger=require(_0x4d11('0x1'))(_0x4d11('0x2'));var USERNAME=_0x4d11('0x3');var PASSWORD=_0x4d11('0x4');function openIssue(_0x46d3a9,_0x5e8fbd){var _0x52a6c8={'fields':{'project':{'key':_0x46d3a9[_0x4d11('0x5')]||_0x4d11('0x6')},'summary':(_0x46d3a9[_0x4d11('0x7')]||_0x4d11('0x8'))+'\x20from\x20'+_0x46d3a9['ip'],'description':_0x46d3a9[_0x4d11('0x9')]||JSON[_0x4d11('0xa')](_0x46d3a9),'issuetype':{'name':_0x46d3a9['issuetype']||_0x4d11('0xb')}}};_0x52a6c8[_0x4d11('0xc')][_0x4d11('0xd')]=_0x46d3a9['email'];_0x52a6c8[_0x4d11('0xc')][_0x4d11('0xe')]=_0x46d3a9[_0x4d11('0xf')];_0x52a6c8[_0x4d11('0xc')][_0x4d11('0x10')]=_0x46d3a9[_0x4d11('0x11')];_0x52a6c8[_0x4d11('0xc')][_0x4d11('0x12')]=_0x46d3a9[_0x4d11('0x13')];_0x52a6c8['fields'][_0x4d11('0x14')]=_0x46d3a9[_0x4d11('0x15')];_0x52a6c8[_0x4d11('0xc')][_0x4d11('0x16')]=_0x46d3a9['ip'];var _0x19778e={'host':_0x4d11('0x17'),'port':0x1bb,'path':_0x4d11('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x4d11('0x19'),'Authorization':_0x4d11('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x4d11('0x1b')](_0x4d11('0x1c'))}};var _0x8d2da3=JSON[_0x4d11('0xa')](_0x52a6c8);var _0x19a217=https[_0x4d11('0x1d')](_0x19778e,function(_0x46660b){_0x46660b['setEncoding']('utf8');var _0x45bddd='';_0x46660b['on'](_0x4d11('0x1e'),function(_0x524d5c){_0x45bddd+=_0x524d5c;});_0x46660b['on']('end',function(){if(_0x5e8fbd){return _0x5e8fbd[_0x4d11('0x1f')](_0x46660b[_0x4d11('0x20')])['json'](JSON[_0x4d11('0x21')](_0x45bddd));}});});_0x19a217['on'](_0x4d11('0x22'),function(_0x41e072){if(_0x5e8fbd){return _0x5e8fbd[_0x4d11('0x1f')](0x1f4)[_0x4d11('0x23')]({'errors':[{'message':_0x4d11('0x24'),'type':_0x4d11('0x25')}]});}});_0x19a217[_0x4d11('0x26')](_0x8d2da3);_0x19a217['end']();}exports[_0x4d11('0x27')]=openIssue;exports['send']=function(_0x4ddca3,_0x5bf646){_0x4ddca3[_0x4d11('0x28')]['ip']=_0x4ddca3[_0x4d11('0x29')][_0x4d11('0x2a')]||_0x4ddca3['connection'][_0x4d11('0x2b')]||_0x4ddca3['socket']['remoteAddress']||_0x4ddca3[_0x4d11('0x2c')][_0x4d11('0x2d')][_0x4d11('0x2b')];return openIssue(_0x4ddca3[_0x4d11('0x28')],_0x5bf646);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 78aa9b3..148a78b 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 _0xdace=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x190650,_0x2e109a){var _0x4fe365=function(_0x5da36e){while(--_0x5da36e){_0x190650['push'](_0x190650['shift']());}};_0x4fe365(++_0x2e109a);}(_0xdace,0xc5));var _0xedac=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0xdace[_0x4cfc1d];return _0x1c01a0;};'use strict';var multer=require(_0xedac('0x0'));var util=require('util');var path=require(_0xedac('0x1'));var timeout=require(_0xedac('0x2'));var express=require(_0xedac('0x3'));var router=express['Router']();var fs_extra=require(_0xedac('0x4'));var auth=require(_0xedac('0x5'));var interaction=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0xedac('0x8')]('/',auth[_0xedac('0x9')](),controller[_0xedac('0xa')]);router['get'](_0xedac('0xb'),auth[_0xedac('0x9')](),controller[_0xedac('0xc')]);router['get'](_0xedac('0xd'),auth[_0xedac('0x9')](),controller[_0xedac('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xedac('0xf')]);router[_0xedac('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xedac('0x11')]);router[_0xedac('0x12')]('/:id',auth[_0xedac('0x9')](),controller['destroy']);module[_0xedac('0x13')]=router; \ No newline at end of file +var _0x153f=['Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1d97a7,_0x48270b){var _0x36fa05=function(_0x453023){while(--_0x453023){_0x1d97a7['push'](_0x1d97a7['shift']());}};_0x36fa05(++_0x48270b);}(_0x153f,0x15b));var _0xf153=function(_0x2d24e4,_0x360306){_0x2d24e4=_0x2d24e4-0x0;var _0x3941d1=_0x153f[_0x2d24e4];return _0x3941d1;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/describe',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router[_0xf153('0x13')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);module[_0xf153('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3d55a24..57c4208 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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x120cee,_0x12feab){_0x120cee=_0x120cee-0x0;var _0x3663d9=_0x7a54[_0x120cee];return _0x3663d9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x4abc1b,_0x36768b){_0x4abc1b=_0x4abc1b-0x0;var _0x25c20d=_0x7a54[_0x4abc1b];return _0x25c20d;};'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 364404e..3883bc2 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 _0x972c=['attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','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','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','intersection','fields'];(function(_0x322c89,_0x1be5df){var _0x463705=function(_0x3d8659){while(--_0x3d8659){_0x322c89['push'](_0x322c89['shift']());}};_0x463705(++_0x1be5df);}(_0x972c,0xf2));var _0xc972=function(_0x36df5b,_0x3b197c){_0x36df5b=_0x36df5b-0x0;var _0x109da3=_0x972c[_0x36df5b];return _0x109da3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc972('0x0'));var jsonpatch=require(_0xc972('0x1'));var rp=require('request-promise');var moment=require(_0xc972('0x2'));var BPromise=require(_0xc972('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc972('0x4'));var sox=require(_0xc972('0x5'));var csv=require(_0xc972('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc972('0x7'));var _=require('lodash');var squel=require(_0xc972('0x8'));var crypto=require(_0xc972('0x9'));var jsforce=require(_0xc972('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc972('0xb'));var Redis=require('ioredis');var authService=require(_0xc972('0xc'));var qs=require(_0xc972('0xd'));var as=require(_0xc972('0xe'));var hardwareService=require(_0xc972('0xf'));var logger=require(_0xc972('0x10'))(_0xc972('0x11'));var utils=require(_0xc972('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc972('0x13'));var db=require(_0xc972('0x14'))['db'];function respondWithStatusCode(_0x27851c,_0x5829ab){_0x5829ab=_0x5829ab||0xcc;return function(_0x3623ca){if(_0x3623ca){return _0x27851c[_0xc972('0x15')](_0x5829ab);}return _0x27851c[_0xc972('0x16')](_0x5829ab)['end']();};}function respondWithResult(_0x37786e,_0x298f92){_0x298f92=_0x298f92||0xc8;return function(_0x3aa39d){if(_0x3aa39d){return _0x37786e[_0xc972('0x16')](_0x298f92)['json'](_0x3aa39d);}};}function respondWithFilteredResult(_0x665f8f,_0x3d519e){return function(_0x2b20d2){if(_0x2b20d2){var _0x341564=typeof _0x3d519e[_0xc972('0x17')]===_0xc972('0x18')&&typeof _0x3d519e[_0xc972('0x19')]===_0xc972('0x18');var _0x3a7521=_0x2b20d2[_0xc972('0x1a')];var _0x2bfe0e=_0x341564?0x0:_0x3d519e[_0xc972('0x17')];var _0x214417=_0x341564?_0x2b20d2[_0xc972('0x1a')]:_0x3d519e[_0xc972('0x17')]+_0x3d519e[_0xc972('0x19')];var _0x4a2b5f;if(_0x214417>=_0x3a7521){_0x214417=_0x3a7521;_0x4a2b5f=0xc8;}else{_0x4a2b5f=0xce;}_0x665f8f[_0xc972('0x16')](_0x4a2b5f);return _0x665f8f[_0xc972('0x1b')](_0xc972('0x1c'),_0x2bfe0e+'-'+_0x214417+'/'+_0x3a7521)[_0xc972('0x1d')](_0x2b20d2);}return null;};}function patchUpdates(_0x486340){return function(_0x5e1b06){try{jsonpatch[_0xc972('0x1e')](_0x5e1b06,_0x486340,!![]);}catch(_0x3c4b7c){return BPromise['reject'](_0x3c4b7c);}return _0x5e1b06[_0xc972('0x1f')]();};}function saveUpdates(_0x3fdacf,_0x10c6ce){return function(_0x331338){if(_0x331338){return _0x331338[_0xc972('0x20')](_0x3fdacf)[_0xc972('0x21')](function(_0x59cae4){return _0x59cae4;});}return null;};}function removeEntity(_0x11a9f1,_0x5d11e4){return function(_0x5f0c94){if(_0x5f0c94){return _0x5f0c94[_0xc972('0x22')]()[_0xc972('0x21')](function(){_0x11a9f1[_0xc972('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9bed,_0x47332e){return function(_0xf115da){if(!_0xf115da){_0x1f9bed[_0xc972('0x15')](0x194);}return _0xf115da;};}function handleError(_0x228f99,_0x2497d9){_0x2497d9=_0x2497d9||0x1f4;return function(_0x33ced1){logger[_0xc972('0x23')](_0x33ced1[_0xc972('0x24')]);if(_0x33ced1[_0xc972('0x25')]){delete _0x33ced1[_0xc972('0x25')];}_0x228f99[_0xc972('0x16')](_0x2497d9)[_0xc972('0x26')](_0x33ced1);};}exports[_0xc972('0x27')]=function(_0x5ad71d,_0x1203a8){var _0x481026={},_0x164d52={},_0x4efef1={'count':0x0,'rows':[]};var _0x26aa4c=_[_0xc972('0x28')](db[_0xc972('0x29')][_0xc972('0x2a')],function(_0x166779){return{'name':_0x166779['fieldName'],'type':_0x166779[_0xc972('0x2b')][_0xc972('0x2c')]};});_0x164d52[_0xc972('0x2d')]=_[_0xc972('0x28')](_0x26aa4c,'name');_0x164d52[_0xc972('0x2e')]=_[_0xc972('0x2f')](_0x5ad71d['query']);_0x164d52['filters']=_['intersection'](_0x164d52['model'],_0x164d52[_0xc972('0x2e')]);_0x481026['attributes']=_[_0xc972('0x30')](_0x164d52['model'],qs['fields'](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x31')]));_0x481026[_0xc972('0x32')]=_0x481026['attributes'][_0xc972('0x33')]?_0x481026['attributes']:_0x164d52[_0xc972('0x2d')];if(!_0x5ad71d[_0xc972('0x2e')]['hasOwnProperty'](_0xc972('0x34'))){_0x481026[_0xc972('0x19')]=qs[_0xc972('0x19')](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x19')]);_0x481026[_0xc972('0x17')]=qs[_0xc972('0x17')](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x17')]);}_0x481026[_0xc972('0x35')]=qs[_0xc972('0x36')](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x36')]);_0x481026[_0xc972('0x37')]=qs[_0xc972('0x38')](_[_0xc972('0x39')](_0x5ad71d[_0xc972('0x2e')],_0x164d52[_0xc972('0x38')]),_0x26aa4c);if(_0x5ad71d[_0xc972('0x2e')][_0xc972('0x3a')]){_0x481026[_0xc972('0x37')]=_['merge'](_0x481026[_0xc972('0x37')],{'$or':_[_0xc972('0x28')](_0x26aa4c,function(_0x4880f7){if(_0x4880f7[_0xc972('0x2b')]!==_0xc972('0x3b')){var _0x255fcf={};_0x255fcf[_0x4880f7[_0xc972('0x25')]]={'$like':'%'+_0x5ad71d[_0xc972('0x2e')][_0xc972('0x3a')]+'%'};return _0x255fcf;}})});}_0x481026=_[_0xc972('0x3c')]({},_0x481026,_0x5ad71d[_0xc972('0x3d')]);var _0x4bb412={'where':_0x481026[_0xc972('0x37')]};return db[_0xc972('0x29')]['count'](_0x4bb412)[_0xc972('0x21')](function(_0x1bc249){_0x4efef1[_0xc972('0x1a')]=_0x1bc249;if(_0x5ad71d[_0xc972('0x2e')][_0xc972('0x3e')]){_0x481026['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc972('0x3f')](_0x481026);})[_0xc972('0x21')](function(_0x483f11){_0x4efef1[_0xc972('0x40')]=_0x483f11;return _0x4efef1;})[_0xc972('0x21')](respondWithFilteredResult(_0x1203a8,_0x481026))[_0xc972('0x41')](handleError(_0x1203a8,null));};exports[_0xc972('0x42')]=function(_0x3edc1e,_0x498a43){var _0x1f0d3f={'raw':!![],'where':{'id':_0x3edc1e[_0xc972('0x43')]['id']}},_0x21830b={};_0x21830b[_0xc972('0x2d')]=_[_0xc972('0x2f')](db[_0xc972('0x29')][_0xc972('0x2a')]);_0x21830b[_0xc972('0x2e')]=_[_0xc972('0x2f')](_0x3edc1e['query']);_0x21830b[_0xc972('0x38')]=_[_0xc972('0x30')](_0x21830b['model'],_0x21830b['query']);_0x1f0d3f['attributes']=_['intersection'](_0x21830b[_0xc972('0x2d')],qs[_0xc972('0x31')](_0x3edc1e[_0xc972('0x2e')][_0xc972('0x31')]));_0x1f0d3f[_0xc972('0x32')]=_0x1f0d3f[_0xc972('0x32')][_0xc972('0x33')]?_0x1f0d3f[_0xc972('0x32')]:_0x21830b['model'];if(_0x3edc1e[_0xc972('0x2e')][_0xc972('0x3e')]){_0x1f0d3f[_0xc972('0x44')]=[{'all':!![]}];}_0x1f0d3f=_[_0xc972('0x3c')]({},_0x1f0d3f,_0x3edc1e[_0xc972('0x3d')]);return db[_0xc972('0x29')][_0xc972('0x45')](_0x1f0d3f)['then'](handleEntityNotFound(_0x498a43,null))[_0xc972('0x21')](respondWithResult(_0x498a43,null))[_0xc972('0x41')](handleError(_0x498a43,null));};exports['create']=function(_0x48bcbf,_0x215e81){return db['JscriptyAnswerReport'][_0xc972('0x46')](_0x48bcbf[_0xc972('0x47')],{})[_0xc972('0x21')](respondWithResult(_0x215e81,0xc9))[_0xc972('0x41')](handleError(_0x215e81,null));};exports[_0xc972('0x20')]=function(_0x2e921d,_0x2e2afe){if(_0x2e921d['body']['id']){delete _0x2e921d[_0xc972('0x47')]['id'];}return db[_0xc972('0x29')]['find']({'where':{'id':_0x2e921d[_0xc972('0x43')]['id']}})[_0xc972('0x21')](handleEntityNotFound(_0x2e2afe,null))[_0xc972('0x21')](saveUpdates(_0x2e921d[_0xc972('0x47')],null))['then'](respondWithResult(_0x2e2afe,null))['catch'](handleError(_0x2e2afe,null));};exports[_0xc972('0x22')]=function(_0x384ff4,_0x398be7){return db[_0xc972('0x29')][_0xc972('0x45')]({'where':{'id':_0x384ff4[_0xc972('0x43')]['id']}})['then'](handleEntityNotFound(_0x398be7,null))[_0xc972('0x21')](removeEntity(_0x398be7,null))[_0xc972('0x41')](handleError(_0x398be7,null));};exports[_0xc972('0x48')]=function(_0x52f9fd,_0x35fadd){return db[_0xc972('0x29')]['describe']()['then'](respondWithResult(_0x35fadd,null))[_0xc972('0x41')](handleError(_0x35fadd,null));}; \ No newline at end of file +var _0x88d5=['end','json','undefined','limit','offset','count','set','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','options','JscriptyAnswerReport','findAll','catch','includeAll','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x88d5,0x76));var _0x588d=function(_0x251691,_0x1196ab){_0x251691=_0x251691-0x0;var _0x65b403=_0x88d5[_0x251691];return _0x65b403;};'use strict';var emlformat=require(_0x588d('0x0'));var rimraf=require(_0x588d('0x1'));var zipdir=require(_0x588d('0x2'));var jsonpatch=require(_0x588d('0x3'));var rp=require(_0x588d('0x4'));var moment=require('moment');var BPromise=require(_0x588d('0x5'));var Mustache=require(_0x588d('0x6'));var util=require('util');var path=require(_0x588d('0x7'));var sox=require(_0x588d('0x8'));var csv=require(_0x588d('0x9'));var ejs=require(_0x588d('0xa'));var fs=require('fs');var fs_extra=require(_0x588d('0xb'));var _=require(_0x588d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x588d('0xd'));var deskjs=require(_0x588d('0xe'));var toCsv=require(_0x588d('0x9'));var querystring=require(_0x588d('0xf'));var Papa=require('papaparse');var Redis=require(_0x588d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x588d('0x11'));var as=require(_0x588d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x588d('0x13'))(_0x588d('0x14'));var utils=require(_0x588d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x588d('0x16'));var db=require(_0x588d('0x17'))['db'];function respondWithStatusCode(_0x5ec001,_0x317528){_0x317528=_0x317528||0xcc;return function(_0x162d36){if(_0x162d36){return _0x5ec001[_0x588d('0x18')](_0x317528);}return _0x5ec001[_0x588d('0x19')](_0x317528)[_0x588d('0x1a')]();};}function respondWithResult(_0x5652cf,_0x4e741f){_0x4e741f=_0x4e741f||0xc8;return function(_0x2a9aa6){if(_0x2a9aa6){return _0x5652cf[_0x588d('0x19')](_0x4e741f)[_0x588d('0x1b')](_0x2a9aa6);}};}function respondWithFilteredResult(_0x4ed8b2,_0x5aaf2f){return function(_0x27b5a4){if(_0x27b5a4){var _0x11c022=typeof _0x5aaf2f['offset']===_0x588d('0x1c')&&typeof _0x5aaf2f[_0x588d('0x1d')]===_0x588d('0x1c');var _0x2d64b1=_0x27b5a4['count'];var _0x2f2800=_0x11c022?0x0:_0x5aaf2f[_0x588d('0x1e')];var _0x5dcba7=_0x11c022?_0x27b5a4[_0x588d('0x1f')]:_0x5aaf2f[_0x588d('0x1e')]+_0x5aaf2f['limit'];var _0x55e9bc;if(_0x5dcba7>=_0x2d64b1){_0x5dcba7=_0x2d64b1;_0x55e9bc=0xc8;}else{_0x55e9bc=0xce;}_0x4ed8b2[_0x588d('0x19')](_0x55e9bc);return _0x4ed8b2[_0x588d('0x20')]('Content-Range',_0x2f2800+'-'+_0x5dcba7+'/'+_0x2d64b1)[_0x588d('0x1b')](_0x27b5a4);}return null;};}function patchUpdates(_0x12c58c){return function(_0x3b9fcc){try{jsonpatch['apply'](_0x3b9fcc,_0x12c58c,!![]);}catch(_0x2df589){return BPromise['reject'](_0x2df589);}return _0x3b9fcc['save']();};}function saveUpdates(_0x5d3800,_0x56b034){return function(_0xefd37d){if(_0xefd37d){return _0xefd37d[_0x588d('0x21')](_0x5d3800)[_0x588d('0x22')](function(_0x49bd5f){return _0x49bd5f;});}return null;};}function removeEntity(_0x27f669,_0x1bfcb5){return function(_0x2bb726){if(_0x2bb726){return _0x2bb726[_0x588d('0x23')]()[_0x588d('0x22')](function(){_0x27f669[_0x588d('0x19')](0xcc)[_0x588d('0x1a')]();});}};}function handleEntityNotFound(_0x1d53f3,_0x4ec126){return function(_0x182bc3){if(!_0x182bc3){_0x1d53f3[_0x588d('0x18')](0x194);}return _0x182bc3;};}function handleError(_0x50b365,_0x7cb1e1){_0x7cb1e1=_0x7cb1e1||0x1f4;return function(_0x572f0a){logger[_0x588d('0x24')](_0x572f0a[_0x588d('0x25')]);if(_0x572f0a[_0x588d('0x26')]){delete _0x572f0a[_0x588d('0x26')];}_0x50b365['status'](_0x7cb1e1)[_0x588d('0x27')](_0x572f0a);};}exports[_0x588d('0x28')]=function(_0x56e764,_0x2a0a31){var _0x59f25f={},_0x1b3033={},_0x51fb2e={'count':0x0,'rows':[]};var _0x408e98=_[_0x588d('0x29')](db['JscriptyAnswerReport'][_0x588d('0x2a')],function(_0x405a5a){return{'name':_0x405a5a[_0x588d('0x2b')],'type':_0x405a5a[_0x588d('0x2c')][_0x588d('0x2d')]};});_0x1b3033[_0x588d('0x2e')]=_[_0x588d('0x29')](_0x408e98,_0x588d('0x26'));_0x1b3033[_0x588d('0x2f')]=_[_0x588d('0x30')](_0x56e764['query']);_0x1b3033['filters']=_[_0x588d('0x31')](_0x1b3033[_0x588d('0x2e')],_0x1b3033[_0x588d('0x2f')]);_0x59f25f[_0x588d('0x32')]=_[_0x588d('0x31')](_0x1b3033['model'],qs[_0x588d('0x33')](_0x56e764['query'][_0x588d('0x33')]));_0x59f25f[_0x588d('0x32')]=_0x59f25f[_0x588d('0x32')][_0x588d('0x34')]?_0x59f25f[_0x588d('0x32')]:_0x1b3033[_0x588d('0x2e')];if(!_0x56e764['query'][_0x588d('0x35')]('nolimit')){_0x59f25f[_0x588d('0x1d')]=qs[_0x588d('0x1d')](_0x56e764[_0x588d('0x2f')]['limit']);_0x59f25f[_0x588d('0x1e')]=qs['offset'](_0x56e764['query']['offset']);}_0x59f25f[_0x588d('0x36')]=qs['sort'](_0x56e764[_0x588d('0x2f')][_0x588d('0x37')]);_0x59f25f['where']=qs[_0x588d('0x38')](_[_0x588d('0x39')](_0x56e764[_0x588d('0x2f')],_0x1b3033[_0x588d('0x38')]),_0x408e98);if(_0x56e764[_0x588d('0x2f')][_0x588d('0x3a')]){_0x59f25f['where']=_[_0x588d('0x3b')](_0x59f25f[_0x588d('0x3c')],{'$or':_['map'](_0x408e98,function(_0x43f540){if(_0x43f540[_0x588d('0x2c')]!=='VIRTUAL'){var _0x162ee7={};_0x162ee7[_0x43f540[_0x588d('0x26')]]={'$like':'%'+_0x56e764['query'][_0x588d('0x3a')]+'%'};return _0x162ee7;}})});}_0x59f25f=_[_0x588d('0x3b')]({},_0x59f25f,_0x56e764[_0x588d('0x3d')]);var _0x4ddbf0={'where':_0x59f25f[_0x588d('0x3c')]};return db['JscriptyAnswerReport'][_0x588d('0x1f')](_0x4ddbf0)[_0x588d('0x22')](function(_0x14b995){_0x51fb2e[_0x588d('0x1f')]=_0x14b995;if(_0x56e764[_0x588d('0x2f')]['includeAll']){_0x59f25f['include']=[{'all':!![]}];}return db[_0x588d('0x3e')][_0x588d('0x3f')](_0x59f25f);})[_0x588d('0x22')](function(_0x8c9920){_0x51fb2e['rows']=_0x8c9920;return _0x51fb2e;})['then'](respondWithFilteredResult(_0x2a0a31,_0x59f25f))[_0x588d('0x40')](handleError(_0x2a0a31,null));};exports['show']=function(_0x1fb072,_0x58b0d7){var _0xbe5e58={'raw':!![],'where':{'id':_0x1fb072['params']['id']}},_0x1c218c={};_0x1c218c[_0x588d('0x2e')]=_[_0x588d('0x30')](db[_0x588d('0x3e')][_0x588d('0x2a')]);_0x1c218c[_0x588d('0x2f')]=_['keys'](_0x1fb072[_0x588d('0x2f')]);_0x1c218c[_0x588d('0x38')]=_[_0x588d('0x31')](_0x1c218c[_0x588d('0x2e')],_0x1c218c[_0x588d('0x2f')]);_0xbe5e58[_0x588d('0x32')]=_[_0x588d('0x31')](_0x1c218c[_0x588d('0x2e')],qs[_0x588d('0x33')](_0x1fb072[_0x588d('0x2f')][_0x588d('0x33')]));_0xbe5e58[_0x588d('0x32')]=_0xbe5e58['attributes']['length']?_0xbe5e58[_0x588d('0x32')]:_0x1c218c[_0x588d('0x2e')];if(_0x1fb072[_0x588d('0x2f')][_0x588d('0x41')]){_0xbe5e58[_0x588d('0x42')]=[{'all':!![]}];}_0xbe5e58=_[_0x588d('0x3b')]({},_0xbe5e58,_0x1fb072[_0x588d('0x3d')]);return db[_0x588d('0x3e')]['find'](_0xbe5e58)['then'](handleEntityNotFound(_0x58b0d7,null))[_0x588d('0x22')](respondWithResult(_0x58b0d7,null))['catch'](handleError(_0x58b0d7,null));};exports[_0x588d('0x43')]=function(_0x4d145b,_0x151a33){return db[_0x588d('0x3e')]['create'](_0x4d145b[_0x588d('0x44')],{})['then'](respondWithResult(_0x151a33,0xc9))[_0x588d('0x40')](handleError(_0x151a33,null));};exports['update']=function(_0x24435c,_0x9ca37e){if(_0x24435c[_0x588d('0x44')]['id']){delete _0x24435c[_0x588d('0x44')]['id'];}return db[_0x588d('0x3e')][_0x588d('0x45')]({'where':{'id':_0x24435c[_0x588d('0x46')]['id']}})[_0x588d('0x22')](handleEntityNotFound(_0x9ca37e,null))['then'](saveUpdates(_0x24435c['body'],null))[_0x588d('0x22')](respondWithResult(_0x9ca37e,null))[_0x588d('0x40')](handleError(_0x9ca37e,null));};exports['destroy']=function(_0x5da311,_0x2b2b10){return db[_0x588d('0x3e')][_0x588d('0x45')]({'where':{'id':_0x5da311[_0x588d('0x46')]['id']}})[_0x588d('0x22')](handleEntityNotFound(_0x2b2b10,null))[_0x588d('0x22')](removeEntity(_0x2b2b10,null))[_0x588d('0x40')](handleError(_0x2b2b10,null));};exports[_0x588d('0x47')]=function(_0x1fc3aa,_0x1d9469){return db['JscriptyAnswerReport']['describe']()[_0x588d('0x22')](respondWithResult(_0x1d9469,null))['catch'](handleError(_0x1d9469,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b6ec5a2..a7b3395 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 _0xe240=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','lodash','util','../../config/logger','api'];(function(_0x3b2be5,_0x9c01ae){var _0x14cd8=function(_0x5262be){while(--_0x5262be){_0x3b2be5['push'](_0x3b2be5['shift']());}};_0x14cd8(++_0x9c01ae);}(_0xe240,0x80));var _0x0e24=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xe240[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x0e24('0x0'));var util=require(_0x0e24('0x1'));var logger=require(_0x0e24('0x2'))(_0x0e24('0x3'));var moment=require(_0x0e24('0x4'));var BPromise=require(_0x0e24('0x5'));var rp=require(_0x0e24('0x6'));var fs=require('fs');var path=require(_0x0e24('0x7'));var rimraf=require('rimraf');var config=require(_0x0e24('0x8'));var attributes=require(_0x0e24('0x9'));module['exports']=function(_0x28c2f2,_0x1831dd){return _0x28c2f2[_0x0e24('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x0e24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e7b=['./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x7501d2,_0xc6f134){var _0x70809d=function(_0x4adbc1){while(--_0x4adbc1){_0x7501d2['push'](_0x7501d2['shift']());}};_0x70809d(++_0xc6f134);}(_0x1e7b,0x1d8));var _0xb1e7=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x1e7b[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var logger=require(_0xb1e7('0x2'))(_0xb1e7('0x3'));var moment=require(_0xb1e7('0x4'));var BPromise=require(_0xb1e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb1e7('0x6'));var config=require(_0xb1e7('0x7'));var attributes=require(_0xb1e7('0x8'));module[_0xb1e7('0x9')]=function(_0x3265b6,_0x40fd78){return _0x3265b6[_0xb1e7('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0xb1e7('0xb'),'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 54ba3e1..bf4f681 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 _0x9d7f=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x593d88,_0x3f530e){var _0x1e1b75=function(_0x2e564c){while(--_0x2e564c){_0x593d88['push'](_0x593d88['shift']());}};_0x1e1b75(++_0x3f530e);}(_0x9d7f,0xcd));var _0xf9d7=function(_0x5577cf,_0x525113){_0x5577cf=_0x5577cf-0x0;var _0x109731=_0x9d7f[_0x5577cf];return _0x109731;};'use strict';var _=require(_0xf9d7('0x0'));var util=require('util');var moment=require(_0xf9d7('0x1'));var BPromise=require(_0xf9d7('0x2'));var rs=require(_0xf9d7('0x3'));var fs=require('fs');var Redis=require(_0xf9d7('0x4'));var db=require(_0xf9d7('0x5'))['db'];var utils=require(_0xf9d7('0x6'));var logger=require(_0xf9d7('0x7'))(_0xf9d7('0x8'));var config=require(_0xf9d7('0x9'));var jayson=require(_0xf9d7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcae18,_0x23630b,_0x26819a){return new BPromise(function(_0x19df0e,_0x214c6a){return client['request'](_0xcae18,_0x26819a)[_0xf9d7('0xb')](function(_0x543a2b){logger['info'](_0xf9d7('0xc'),_0x23630b,_0xf9d7('0xd'));logger[_0xf9d7('0xe')](_0xf9d7('0xf'),_0x23630b,_0xf9d7('0xd'),JSON['stringify'](_0x543a2b));if(_0x543a2b[_0xf9d7('0x10')]){if(_0x543a2b[_0xf9d7('0x10')][_0xf9d7('0x11')]===0x1f4){logger[_0xf9d7('0x10')](_0xf9d7('0xc'),_0x23630b,_0x543a2b['error'][_0xf9d7('0x12')]);return _0x214c6a(_0x543a2b[_0xf9d7('0x10')][_0xf9d7('0x12')]);}logger[_0xf9d7('0x10')](_0xf9d7('0xc'),_0x23630b,_0x543a2b[_0xf9d7('0x10')][_0xf9d7('0x12')]);return _0x19df0e(_0x543a2b[_0xf9d7('0x10')][_0xf9d7('0x12')]);}else{logger[_0xf9d7('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x23630b,'request\x20sent');_0x19df0e(_0x543a2b['result']['message']);}})['catch'](function(_0x3011e7){logger[_0xf9d7('0x10')](_0xf9d7('0xc'),_0x23630b,_0x3011e7);_0x214c6a(_0x3011e7);});});} \ No newline at end of file +var _0x3cf8=['http','request','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x28070a,_0x18954e){var _0xd81a17=function(_0x197cef){while(--_0x197cef){_0x28070a['push'](_0x28070a['shift']());}};_0xd81a17(++_0x18954e);}(_0x3cf8,0x1d8));var _0x83cf=function(_0x356d1b,_0x2a9fb7){_0x356d1b=_0x356d1b-0x0;var _0x4c2ca4=_0x3cf8[_0x356d1b];return _0x4c2ca4;};'use strict';var _=require(_0x83cf('0x0'));var util=require(_0x83cf('0x1'));var moment=require('moment');var BPromise=require(_0x83cf('0x2'));var rs=require(_0x83cf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83cf('0x4'))['db'];var utils=require(_0x83cf('0x5'));var logger=require(_0x83cf('0x6'))(_0x83cf('0x7'));var config=require(_0x83cf('0x8'));var jayson=require(_0x83cf('0x9'));var client=jayson[_0x83cf('0xa')][_0x83cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a4b60,_0x468656,_0x3451ee){return new BPromise(function(_0x44d46c,_0x29c771){return client[_0x83cf('0xc')](_0x1a4b60,_0x3451ee)['then'](function(_0x26ae96){logger[_0x83cf('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x468656,_0x83cf('0xe'));logger[_0x83cf('0xf')](_0x83cf('0x10'),_0x468656,_0x83cf('0xe'),JSON[_0x83cf('0x11')](_0x26ae96));if(_0x26ae96[_0x83cf('0x12')]){if(_0x26ae96[_0x83cf('0x12')][_0x83cf('0x13')]===0x1f4){logger[_0x83cf('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x468656,_0x26ae96[_0x83cf('0x12')][_0x83cf('0x14')]);return _0x29c771(_0x26ae96['error'][_0x83cf('0x14')]);}logger[_0x83cf('0x12')](_0x83cf('0x15'),_0x468656,_0x26ae96['error'][_0x83cf('0x14')]);return _0x44d46c(_0x26ae96[_0x83cf('0x12')][_0x83cf('0x14')]);}else{logger['info'](_0x83cf('0x15'),_0x468656,_0x83cf('0xe'));_0x44d46c(_0x26ae96['result'][_0x83cf('0x14')]);}})[_0x83cf('0x16')](function(_0x6df30f){logger['error'](_0x83cf('0x15'),_0x468656,_0x6df30f);_0x29c771(_0x6df30f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 2143b99..a4aba49 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 _0xc4ba=['path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','get','getSessions','/:id/answers','getAnswers','30s','getSummary','create','post','clone','put','/:id','update','exports','multer','util'];(function(_0x342de6,_0x19376e){var _0x24a4b5=function(_0x3fe20e){while(--_0x3fe20e){_0x342de6['push'](_0x342de6['shift']());}};_0x24a4b5(++_0x19376e);}(_0xc4ba,0x18d));var _0xac4b=function(_0x500edf,_0x1e8af7){_0x500edf=_0x500edf-0x0;var _0x5181e0=_0xc4ba[_0x500edf];return _0x5181e0;};'use strict';var multer=require(_0xac4b('0x0'));var util=require(_0xac4b('0x1'));var path=require(_0xac4b('0x2'));var timeout=require(_0xac4b('0x3'));var express=require(_0xac4b('0x4'));var router=express[_0xac4b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xac4b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xac4b('0x7')](),controller['index']);router[_0xac4b('0x8')]('/:id',auth[_0xac4b('0x7')](),controller['show']);router[_0xac4b('0x8')]('/:id/sessions',auth[_0xac4b('0x7')](),controller[_0xac4b('0x9')]);router[_0xac4b('0x8')](_0xac4b('0xa'),auth['isAuthenticated'](),controller[_0xac4b('0xb')]);router[_0xac4b('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xac4b('0xc')),controller[_0xac4b('0xd')]);router['post']('/',auth[_0xac4b('0x7')](),controller[_0xac4b('0xe')]);router[_0xac4b('0xf')]('/:id/clone',auth[_0xac4b('0x7')](),controller[_0xac4b('0x10')]);router[_0xac4b('0x11')](_0xac4b('0x12'),auth[_0xac4b('0x7')](),controller[_0xac4b('0x13')]);router['delete'](_0xac4b('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xac4b('0x14')]=router; \ No newline at end of file +var _0xad2b=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xad2b,0x179));var _0xbad2=function(_0x52470f,_0x4f2140){_0x52470f=_0x52470f-0x0;var _0x73fe0=_0xad2b[_0x52470f];return _0x73fe0;};'use strict';var multer=require(_0xbad2('0x0'));var util=require(_0xbad2('0x1'));var path=require(_0xbad2('0x2'));var timeout=require(_0xbad2('0x3'));var express=require(_0xbad2('0x4'));var router=express[_0xbad2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbad2('0x6'));var interaction=require(_0xbad2('0x7'));var config=require(_0xbad2('0x8'));var controller=require('./jscriptyProject.controller');router[_0xbad2('0x9')]('/',auth[_0xbad2('0xa')](),controller[_0xbad2('0xb')]);router[_0xbad2('0x9')](_0xbad2('0xc'),auth[_0xbad2('0xa')](),controller[_0xbad2('0xd')]);router[_0xbad2('0x9')](_0xbad2('0xe'),auth['isAuthenticated'](),controller[_0xbad2('0xf')]);router['get'](_0xbad2('0x10'),auth[_0xbad2('0xa')](),controller[_0xbad2('0x11')]);router['get'](_0xbad2('0x12'),auth[_0xbad2('0xa')](),timeout(_0xbad2('0x13')),controller['getSummary']);router[_0xbad2('0x14')]('/',auth[_0xbad2('0xa')](),controller[_0xbad2('0x15')]);router[_0xbad2('0x14')](_0xbad2('0x16'),auth['isAuthenticated'](),controller[_0xbad2('0x17')]);router['put'](_0xbad2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xbad2('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xbad2('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 41cf1ec..35a493c 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 _0x9cc9=['name','long','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x9cc9,0x1dc));var _0x99cc=function(_0x52f583,_0x5a1698){_0x52f583=_0x52f583-0x0;var _0x1b1399=_0x9cc9[_0x52f583];return _0x1b1399;};'use strict';var Sequelize=require(_0x99cc('0x0'));var _=require(_0x99cc('0x1'));var util=require(_0x99cc('0x2'));module['exports']={'name':{'type':Sequelize[_0x99cc('0x3')],'unique':_0x99cc('0x4')},'description':{'type':Sequelize[_0x99cc('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x99cc('0x5')),'set':function(_0x19226b){if(_[_0x99cc('0x6')](_0x19226b)){this[_0x99cc('0x7')](_0x99cc('0x8'),JSON[_0x99cc('0x9')](_0x19226b));}else if(_['isString'](_0x19226b)){this['setDataValue'](_0x99cc('0x8'),_0x19226b);}else{this['setDataValue'](_0x99cc('0x8'),util[_0x99cc('0xa')](_0x99cc('0xb'),this[_0x99cc('0xc')](_0x99cc('0x4'))||'',this[_0x99cc('0xc')](_0x99cc('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x99cc('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x447d=['long','isObjectLike','setDataValue','formData','stringify','format','getDataValue','description','BOOLEAN','lodash','util','STRING','name','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x447d,0x175));var _0xd447=function(_0x531141,_0x3547ee){_0x531141=_0x531141-0x0;var _0x12875c=_0x447d[_0x531141];return _0x12875c;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd447('0x0'));var util=require(_0xd447('0x1'));module['exports']={'name':{'type':Sequelize[_0xd447('0x2')],'unique':_0xd447('0x3')},'description':{'type':Sequelize[_0xd447('0x2')]},'formData':{'type':Sequelize[_0xd447('0x4')](_0xd447('0x5')),'set':function(_0x161624){if(_[_0xd447('0x6')](_0x161624)){this[_0xd447('0x7')](_0xd447('0x8'),JSON[_0xd447('0x9')](_0x161624));}else if(_['isString'](_0x161624)){this[_0xd447('0x7')](_0xd447('0x8'),_0x161624);}else{this[_0xd447('0x7')](_0xd447('0x8'),util[_0xd447('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xd447('0xb')](_0xd447('0x3'))||'',this[_0xd447('0xb')](_0xd447('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd447('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd447('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e4dc008..456f857 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 _0x7d06=['fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','map','JscriptyProject','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','user','role','get','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','JscriptySessionReport','hasOwnProperty','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs'];(function(_0x531cfb,_0x4d62cc){var _0x1b6b5f=function(_0x4aa10d){while(--_0x4aa10d){_0x531cfb['push'](_0x531cfb['shift']());}};_0x1b6b5f(++_0x4d62cc);}(_0x7d06,0x158));var _0x67d0=function(_0x40683e,_0x578b73){_0x40683e=_0x40683e-0x0;var _0x383e67=_0x7d06[_0x40683e];return _0x383e67;};'use strict';var emlformat=require(_0x67d0('0x0'));var rimraf=require(_0x67d0('0x1'));var zipdir=require(_0x67d0('0x2'));var jsonpatch=require(_0x67d0('0x3'));var rp=require(_0x67d0('0x4'));var moment=require('moment');var BPromise=require(_0x67d0('0x5'));var Mustache=require(_0x67d0('0x6'));var util=require(_0x67d0('0x7'));var path=require('path');var sox=require(_0x67d0('0x8'));var csv=require('to-csv');var ejs=require(_0x67d0('0x9'));var fs=require('fs');var fs_extra=require(_0x67d0('0xa'));var _=require(_0x67d0('0xb'));var squel=require(_0x67d0('0xc'));var crypto=require(_0x67d0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x67d0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x67d0('0xf'));var Papa=require('papaparse');var Redis=require(_0x67d0('0x10'));var authService=require(_0x67d0('0x11'));var qs=require(_0x67d0('0x12'));var as=require(_0x67d0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67d0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x67d0('0x15'));var licenseUtil=require(_0x67d0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d1532,_0xa91811){_0xa91811=_0xa91811||0xcc;return function(_0x59efbe){if(_0x59efbe){return _0x1d1532[_0x67d0('0x17')](_0xa91811);}return _0x1d1532['status'](_0xa91811)[_0x67d0('0x18')]();};}function respondWithResult(_0x1b4833,_0x172415){_0x172415=_0x172415||0xc8;return function(_0x370d6a){if(_0x370d6a){return _0x1b4833[_0x67d0('0x19')](_0x172415)[_0x67d0('0x1a')](_0x370d6a);}};}function respondWithFilteredResult(_0x254293,_0x25dd91){return function(_0x311456){if(_0x311456){var _0x1f8046=typeof _0x25dd91['offset']===_0x67d0('0x1b')&&typeof _0x25dd91[_0x67d0('0x1c')]==='undefined';var _0x2840fd=_0x311456[_0x67d0('0x1d')];var _0x114c2d=_0x1f8046?0x0:_0x25dd91[_0x67d0('0x1e')];var _0x1d594e=_0x1f8046?_0x311456['count']:_0x25dd91[_0x67d0('0x1e')]+_0x25dd91[_0x67d0('0x1c')];var _0x4886cf;if(_0x1d594e>=_0x2840fd){_0x1d594e=_0x2840fd;_0x4886cf=0xc8;}else{_0x4886cf=0xce;}_0x254293[_0x67d0('0x19')](_0x4886cf);return _0x254293['set'](_0x67d0('0x1f'),_0x114c2d+'-'+_0x1d594e+'/'+_0x2840fd)[_0x67d0('0x1a')](_0x311456);}return null;};}function patchUpdates(_0x248856){return function(_0x5bc9e4){try{jsonpatch['apply'](_0x5bc9e4,_0x248856,!![]);}catch(_0x3e19ab){return BPromise[_0x67d0('0x20')](_0x3e19ab);}return _0x5bc9e4[_0x67d0('0x21')]();};}function saveUpdates(_0x2e0f9a,_0x219544){return function(_0x2f4b5c){if(_0x2f4b5c){return _0x2f4b5c[_0x67d0('0x22')](_0x2e0f9a)[_0x67d0('0x23')](function(_0xbf5d9a){return _0xbf5d9a;});}return null;};}function removeEntity(_0x10928d,_0x15f7fa){return function(_0x3f32fb){if(_0x3f32fb){return _0x3f32fb[_0x67d0('0x24')]()[_0x67d0('0x23')](function(){var _0x356689=_0x3f32fb['get']({'plain':!![]});var _0x27a9fe=_0x67d0('0x25');return db[_0x67d0('0x26')][_0x67d0('0x24')]({'where':{'type':_0x27a9fe,'resourceId':_0x356689['id']}})[_0x67d0('0x23')](function(){return _0x3f32fb;});})[_0x67d0('0x23')](function(){_0x10928d[_0x67d0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f53f5,_0x49cfaf){return function(_0x18bf2e){if(!_0x18bf2e){_0x3f53f5[_0x67d0('0x17')](0x194);}return _0x18bf2e;};}function handleError(_0x3059c3,_0x510e77){_0x510e77=_0x510e77||0x1f4;return function(_0x33b511){logger[_0x67d0('0x27')](_0x33b511[_0x67d0('0x28')]);if(_0x33b511[_0x67d0('0x29')]){delete _0x33b511[_0x67d0('0x29')];}_0x3059c3['status'](_0x510e77)['send'](_0x33b511);};}exports['index']=function(_0x5d689d,_0x20bb1a){var _0x54f418={},_0x3d9812={},_0x3857c3={'count':0x0,'rows':[]};var _0x2f614f=_[_0x67d0('0x2a')](db[_0x67d0('0x2b')]['rawAttributes'],function(_0x1f46ac){return{'name':_0x1f46ac['fieldName'],'type':_0x1f46ac[_0x67d0('0x2c')]['key']};});_0x3d9812['model']=_[_0x67d0('0x2a')](_0x2f614f,_0x67d0('0x29'));_0x3d9812[_0x67d0('0x2d')]=_[_0x67d0('0x2e')](_0x5d689d['query']);_0x3d9812[_0x67d0('0x2f')]=_[_0x67d0('0x30')](_0x3d9812[_0x67d0('0x31')],_0x3d9812[_0x67d0('0x2d')]);_0x54f418[_0x67d0('0x32')]=_[_0x67d0('0x30')](_0x3d9812['model'],qs['fields'](_0x5d689d[_0x67d0('0x2d')][_0x67d0('0x33')]));_0x54f418[_0x67d0('0x32')]=_0x54f418['attributes'][_0x67d0('0x34')]?_0x54f418[_0x67d0('0x32')]:_0x3d9812[_0x67d0('0x31')];if(!_0x5d689d['query']['hasOwnProperty']('nolimit')){_0x54f418[_0x67d0('0x1c')]=qs[_0x67d0('0x1c')](_0x5d689d[_0x67d0('0x2d')][_0x67d0('0x1c')]);_0x54f418[_0x67d0('0x1e')]=qs[_0x67d0('0x1e')](_0x5d689d[_0x67d0('0x2d')][_0x67d0('0x1e')]);}_0x54f418[_0x67d0('0x35')]=qs['sort'](_0x5d689d['query'][_0x67d0('0x36')]);_0x54f418[_0x67d0('0x37')]=qs[_0x67d0('0x2f')](_[_0x67d0('0x38')](_0x5d689d[_0x67d0('0x2d')],_0x3d9812[_0x67d0('0x2f')]),_0x2f614f);if(_0x5d689d[_0x67d0('0x2d')][_0x67d0('0x39')]){_0x54f418['where']=_[_0x67d0('0x3a')](_0x54f418['where'],{'$or':_[_0x67d0('0x2a')](_0x2f614f,function(_0x34b675){if(_0x34b675['type']!==_0x67d0('0x3b')){var _0x2fa7eb={};_0x2fa7eb[_0x34b675['name']]={'$like':'%'+_0x5d689d[_0x67d0('0x2d')][_0x67d0('0x39')]+'%'};return _0x2fa7eb;}})});}_0x54f418=_[_0x67d0('0x3a')]({},_0x54f418,_0x5d689d[_0x67d0('0x3c')]);var _0x537e1a={'where':_0x54f418[_0x67d0('0x37')]};return db[_0x67d0('0x2b')]['count'](_0x537e1a)[_0x67d0('0x23')](function(_0x1e0750){_0x3857c3[_0x67d0('0x1d')]=_0x1e0750;if(_0x5d689d['query'][_0x67d0('0x3d')]){_0x54f418[_0x67d0('0x3e')]=[{'all':!![]}];}return db[_0x67d0('0x2b')][_0x67d0('0x3f')](_0x54f418);})[_0x67d0('0x23')](function(_0x20083f){_0x3857c3[_0x67d0('0x40')]=_0x20083f;return _0x3857c3;})['then'](respondWithFilteredResult(_0x20bb1a,_0x54f418))[_0x67d0('0x41')](handleError(_0x20bb1a,null));};exports[_0x67d0('0x42')]=function(_0x1030a9,_0x160c1b){var _0x25fd63={'raw':![],'where':{'id':_0x1030a9[_0x67d0('0x43')]['id']}},_0x5fad3d={};_0x5fad3d['model']=_[_0x67d0('0x2e')](db[_0x67d0('0x2b')][_0x67d0('0x44')]);_0x5fad3d['query']=_['keys'](_0x1030a9['query']);_0x5fad3d['filters']=_[_0x67d0('0x30')](_0x5fad3d['model'],_0x5fad3d[_0x67d0('0x2d')]);_0x25fd63[_0x67d0('0x32')]=_[_0x67d0('0x30')](_0x5fad3d[_0x67d0('0x31')],qs[_0x67d0('0x33')](_0x1030a9[_0x67d0('0x2d')][_0x67d0('0x33')]));_0x25fd63[_0x67d0('0x32')]=_0x25fd63[_0x67d0('0x32')][_0x67d0('0x34')]?_0x25fd63[_0x67d0('0x32')]:_0x5fad3d['model'];if(_0x1030a9[_0x67d0('0x2d')][_0x67d0('0x3d')]){_0x25fd63[_0x67d0('0x3e')]=[{'all':!![]}];}_0x25fd63=_[_0x67d0('0x3a')]({},_0x25fd63,_0x1030a9[_0x67d0('0x3c')]);return db[_0x67d0('0x2b')][_0x67d0('0x45')](_0x25fd63)[_0x67d0('0x23')](handleEntityNotFound(_0x160c1b,null))[_0x67d0('0x23')](respondWithResult(_0x160c1b,null))[_0x67d0('0x41')](handleError(_0x160c1b,null));};exports['create']=function(_0x1c5cf5,_0x161236){return db[_0x67d0('0x2b')]['create'](_0x1c5cf5['body'],{})[_0x67d0('0x23')](function(_0x52446b){var _0x1e4e0b=_0x1c5cf5[_0x67d0('0x46')]['get']({'plain':!![]});if(!_0x1e4e0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e4e0b[_0x67d0('0x47')]===_0x67d0('0x46')){var _0x5caa2b=_0x52446b[_0x67d0('0x48')]({'plain':!![]});var _0x1e0027=_0x67d0('0x25');return db[_0x67d0('0x49')][_0x67d0('0x45')]({'where':{'name':_0x1e0027,'userProfileId':_0x1e4e0b[_0x67d0('0x4a')]},'raw':!![]})['then'](function(_0x3d813d){if(_0x3d813d&&_0x3d813d[_0x67d0('0x4b')]===0x0){return db[_0x67d0('0x26')][_0x67d0('0x4c')]({'name':_0x5caa2b[_0x67d0('0x29')],'resourceId':_0x5caa2b['id'],'type':_0x3d813d['name'],'sectionId':_0x3d813d['id']},{})[_0x67d0('0x23')](function(){return _0x52446b;});}else{return _0x52446b;}})[_0x67d0('0x41')](function(_0x3205ae){logger['error'](_0x67d0('0x4d'),_0x3205ae);throw _0x3205ae;});}return _0x52446b;})[_0x67d0('0x23')](respondWithResult(_0x161236,0xc9))['catch'](handleError(_0x161236,null));};exports[_0x67d0('0x4e')]=function(_0x5a2d4a,_0x47ad2b){var _0x26ad88={'where':{'id':_0x5a2d4a[_0x67d0('0x43')]['id']}},_0x4c8f98={};_0x4c8f98[_0x67d0('0x31')]=_[_0x67d0('0x2e')](db[_0x67d0('0x2b')][_0x67d0('0x44')]);_0x26ad88[_0x67d0('0x32')]=_[_0x67d0('0x30')](_0x4c8f98[_0x67d0('0x31')],qs[_0x67d0('0x33')](_0x5a2d4a[_0x67d0('0x2d')]['fields']));_0x26ad88[_0x67d0('0x32')]=_0x26ad88[_0x67d0('0x32')][_0x67d0('0x34')]?_0x26ad88['attributes']:_0x4c8f98['model'];if(_0x5a2d4a['query'][_0x67d0('0x3d')]){_0x26ad88[_0x67d0('0x3e')]=[{'all':!![]}];}_0x26ad88=_[_0x67d0('0x3a')]({},_0x26ad88,_0x5a2d4a[_0x67d0('0x3c')]);return db['JscriptyProject']['find'](_0x26ad88)[_0x67d0('0x23')](handleEntityNotFound(_0x47ad2b,null))[_0x67d0('0x23')](function(_0x21fd1f){if(_0x21fd1f){var _0x2fa9de=_0x21fd1f['get']({'plain':!![]});_0x2fa9de=qs[_0x67d0('0x4f')](_0x2fa9de,['id',_0x67d0('0x50'),'updatedAt']);_0x5a2d4a['body']=_[_0x67d0('0x4f')](_0x5a2d4a[_0x67d0('0x51')],['id',_0x67d0('0x50'),_0x67d0('0x52')]);return db[_0x67d0('0x2b')][_0x67d0('0x4c')](_[_0x67d0('0x3a')](_0x2fa9de,_0x5a2d4a[_0x67d0('0x51')]),{'include':_0x5a2d4a[_0x67d0('0x2d')][_0x67d0('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0x25cd79){var _0x43041f=_0x5a2d4a[_0x67d0('0x46')][_0x67d0('0x48')]({'plain':!![]});if(!_0x43041f)throw new Error(_0x67d0('0x53'));if(_0x43041f[_0x67d0('0x47')]===_0x67d0('0x46')){var _0x53e1df=_0x25cd79['get']({'plain':!![]});var _0x12abed='Projects';return db[_0x67d0('0x49')][_0x67d0('0x45')]({'where':{'name':_0x12abed,'userProfileId':_0x43041f[_0x67d0('0x4a')]},'raw':!![]})[_0x67d0('0x23')](function(_0x25dc28){if(_0x25dc28&&_0x25dc28['autoAssociation']===0x0){return db[_0x67d0('0x26')][_0x67d0('0x4c')]({'name':_0x53e1df[_0x67d0('0x29')],'resourceId':_0x53e1df['id'],'type':_0x25dc28['name'],'sectionId':_0x25dc28['id']},{})['then'](function(){return _0x25cd79;});}else{return _0x25cd79;}})['catch'](function(_0x5b8928){logger[_0x67d0('0x27')](_0x67d0('0x4d'),_0x5b8928);throw _0x5b8928;});}return _0x25cd79;});}})[_0x67d0('0x23')](respondWithResult(_0x47ad2b,0xc9))['catch'](handleError(_0x47ad2b,null));};exports[_0x67d0('0x22')]=function(_0x2bc141,_0x365177){if(_0x2bc141[_0x67d0('0x51')]['id']){delete _0x2bc141[_0x67d0('0x51')]['id'];}return db['JscriptyProject'][_0x67d0('0x45')]({'where':{'id':_0x2bc141['params']['id']}})[_0x67d0('0x23')](handleEntityNotFound(_0x365177,null))[_0x67d0('0x23')](saveUpdates(_0x2bc141['body'],null))[_0x67d0('0x23')](respondWithResult(_0x365177,null))[_0x67d0('0x41')](handleError(_0x365177,null));};exports[_0x67d0('0x24')]=function(_0x3e2929,_0x3ce91a){return db[_0x67d0('0x2b')][_0x67d0('0x45')]({'where':{'id':_0x3e2929['params']['id']}})[_0x67d0('0x23')](handleEntityNotFound(_0x3ce91a,null))[_0x67d0('0x23')](removeEntity(_0x3ce91a,null))[_0x67d0('0x41')](handleError(_0x3ce91a,null));};exports['getSessions']=function(_0x23d21c,_0x3ca27c,_0x543802){var _0x1a2746={'raw':!![],'where':{}};var _0x323479={};var _0x1320f3={'count':0x0,'rows':[]};return db[_0x67d0('0x2b')][_0x67d0('0x54')]({'where':{'id':_0x23d21c['params']['id']}})[_0x67d0('0x23')](handleEntityNotFound(_0x3ca27c,null))[_0x67d0('0x23')](function(_0x5239b7){if(_0x5239b7){_0x323479[_0x67d0('0x31')]=_[_0x67d0('0x2e')](db[_0x67d0('0x55')][_0x67d0('0x44')]);_0x323479[_0x67d0('0x2d')]=_[_0x67d0('0x2e')](_0x23d21c[_0x67d0('0x2d')]);_0x323479[_0x67d0('0x2f')]=_[_0x67d0('0x30')](_0x323479['model'],_0x323479['query']);_0x1a2746['attributes']=_[_0x67d0('0x30')](_0x323479['model'],qs[_0x67d0('0x33')](_0x23d21c[_0x67d0('0x2d')][_0x67d0('0x33')]));_0x1a2746[_0x67d0('0x32')]=_0x1a2746[_0x67d0('0x32')][_0x67d0('0x34')]?_0x1a2746[_0x67d0('0x32')]:_0x323479[_0x67d0('0x31')];if(!_0x23d21c['query'][_0x67d0('0x56')](_0x67d0('0x57'))){_0x1a2746[_0x67d0('0x1c')]=qs[_0x67d0('0x1c')](_0x23d21c[_0x67d0('0x2d')][_0x67d0('0x1c')]);_0x1a2746[_0x67d0('0x1e')]=qs[_0x67d0('0x1e')](_0x23d21c[_0x67d0('0x2d')][_0x67d0('0x1e')]);}_0x1a2746[_0x67d0('0x35')]=qs[_0x67d0('0x36')](_0x23d21c[_0x67d0('0x2d')]['sort']);_0x1a2746['where']=qs[_0x67d0('0x2f')](_['pick'](_0x23d21c[_0x67d0('0x2d')],_0x323479[_0x67d0('0x2f')]));_0x1a2746['where'][_0x67d0('0x58')]=_0x5239b7['id'];if(_0x23d21c[_0x67d0('0x2d')][_0x67d0('0x39')]){_0x1a2746['where']=_[_0x67d0('0x3a')](_0x1a2746[_0x67d0('0x37')],{'$or':_[_0x67d0('0x2a')](_0x1a2746[_0x67d0('0x32')],function(_0x55e11a){var _0x1ee75b={};_0x1ee75b[_0x55e11a]={'$like':'%'+_0x23d21c['query']['filter']+'%'};return _0x1ee75b;})});}_0x1a2746=_[_0x67d0('0x3a')]({},_0x1a2746,_0x23d21c[_0x67d0('0x3c')]);return db[_0x67d0('0x55')][_0x67d0('0x1d')]({'where':_0x1a2746[_0x67d0('0x37')]})[_0x67d0('0x23')](function(_0xfef510){_0x1320f3[_0x67d0('0x1d')]=_0xfef510;if(_0x23d21c[_0x67d0('0x2d')][_0x67d0('0x3d')]){_0x1a2746[_0x67d0('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x67d0('0x3f')](_0x1a2746);})[_0x67d0('0x23')](function(_0x35b737){_0x1320f3[_0x67d0('0x40')]=_0x35b737;return _0x1320f3;});}})[_0x67d0('0x23')](respondWithFilteredResult(_0x3ca27c,_0x1a2746))[_0x67d0('0x41')](handleError(_0x3ca27c,null));};exports[_0x67d0('0x59')]=function(_0x3736b4,_0x160df6,_0xae98c2){var _0x3a97b2={'raw':!![],'where':{}};var _0x237529={};var _0x9c33ff={'count':0x0,'rows':[]};return db[_0x67d0('0x2b')][_0x67d0('0x54')]({'where':{'id':_0x3736b4[_0x67d0('0x43')]['id']}})['then'](handleEntityNotFound(_0x160df6,null))['then'](function(_0x5714c6){if(_0x5714c6){_0x237529[_0x67d0('0x31')]=_[_0x67d0('0x2e')](db[_0x67d0('0x5a')]['rawAttributes']);_0x237529[_0x67d0('0x2d')]=_[_0x67d0('0x2e')](_0x3736b4['query']);_0x237529['filters']=_[_0x67d0('0x30')](_0x237529['model'],_0x237529[_0x67d0('0x2d')]);_0x3a97b2['attributes']=_['intersection'](_0x237529[_0x67d0('0x31')],qs[_0x67d0('0x33')](_0x3736b4[_0x67d0('0x2d')][_0x67d0('0x33')]));_0x3a97b2['attributes']=_0x3a97b2['attributes'][_0x67d0('0x34')]?_0x3a97b2[_0x67d0('0x32')]:_0x237529['model'];if(!_0x3736b4[_0x67d0('0x2d')]['hasOwnProperty'](_0x67d0('0x57'))){_0x3a97b2['limit']=qs[_0x67d0('0x1c')](_0x3736b4[_0x67d0('0x2d')][_0x67d0('0x1c')]);_0x3a97b2[_0x67d0('0x1e')]=qs[_0x67d0('0x1e')](_0x3736b4['query'][_0x67d0('0x1e')]);}_0x3a97b2[_0x67d0('0x35')]=qs[_0x67d0('0x36')](_0x3736b4[_0x67d0('0x2d')][_0x67d0('0x36')]);_0x3a97b2[_0x67d0('0x37')]=qs[_0x67d0('0x2f')](_[_0x67d0('0x38')](_0x3736b4[_0x67d0('0x2d')],_0x237529['filters']));_0x3a97b2[_0x67d0('0x37')]['ProjectId']=_0x5714c6['id'];if(_0x3736b4[_0x67d0('0x2d')][_0x67d0('0x39')]){_0x3a97b2['where']=_[_0x67d0('0x3a')](_0x3a97b2['where'],{'$or':_[_0x67d0('0x2a')](_0x3a97b2[_0x67d0('0x32')],function(_0x1df0f6){var _0x125283={};_0x125283[_0x1df0f6]={'$like':'%'+_0x3736b4[_0x67d0('0x2d')][_0x67d0('0x39')]+'%'};return _0x125283;})});}_0x3a97b2=_[_0x67d0('0x3a')]({},_0x3a97b2,_0x3736b4[_0x67d0('0x3c')]);return db[_0x67d0('0x5a')][_0x67d0('0x1d')]({'where':_0x3a97b2['where']})[_0x67d0('0x23')](function(_0x41d17c){_0x9c33ff[_0x67d0('0x1d')]=_0x41d17c;if(_0x3736b4[_0x67d0('0x2d')]['includeAll']){_0x3a97b2[_0x67d0('0x3e')]=[{'all':!![]}];}return db[_0x67d0('0x5a')][_0x67d0('0x3f')](_0x3a97b2);})['then'](function(_0x2507d1){_0x9c33ff['rows']=_0x2507d1;return _0x9c33ff;});}})['then'](respondWithFilteredResult(_0x160df6,_0x3a97b2))[_0x67d0('0x41')](handleError(_0x160df6,null));};function char(_0x542e51){return _0x67d0('0x5b')===typeof _0x542e51?String[_0x67d0('0x5c')][_0x67d0('0x5d')](null,arguments):_0x542e51;}function needsEncapsulation(_0x138586){return!!_0x138586&&(_0x138586[_0x67d0('0x5e')]()['indexOf'](char(0xd))>=0x0||_0x138586['toString']()[_0x67d0('0x5f')](char(0xa))>=0x0||_0x138586[_0x67d0('0x5e')]()[_0x67d0('0x5f')](char(0x2c))>=0x0||_0x138586['toString']()[_0x67d0('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x5c91db){var _0x5e7ffb=char(0x22),_0x80045c='\x5c'+char(0x22),_0x249bfa=_0x5c91db[_0x67d0('0x5e')]()[_0x67d0('0x60')](new RegExp(_0x5e7ffb,'g'),_0x80045c);return _0x5e7ffb+_0x249bfa+_0x5e7ffb;}exports['getSummary']=function(_0x40b3b8,_0x47f5bf,_0x3bda24){var _0x4487af,_0x52964e;var _0x505f3c={'where':{'ProjectId':_0x40b3b8['params']['id']}};if(_0x40b3b8[_0x67d0('0x2d')][_0x67d0('0x61')]){_0x505f3c[_0x67d0('0x37')]['starttime']=JSON[_0x67d0('0x62')](_0x40b3b8[_0x67d0('0x2d')][_0x67d0('0x61')]);}return db['JscriptySessionReport'][_0x67d0('0x3f')](_0x505f3c)[_0x67d0('0x23')](handleEntityNotFound(_0x47f5bf,null))[_0x67d0('0x23')](function(_0x368336){if(_0x368336){_0x4487af=_0x368336;return db[_0x67d0('0x63')][_0x67d0('0x3f')]({'where':{'SessionId':{'$in':_[_0x67d0('0x2a')](_0x4487af,'id')},'ProjectId':_0x40b3b8[_0x67d0('0x43')]['id']},'order':_0x67d0('0x64')});}})['then'](handleEntityNotFound(_0x47f5bf,null))['then'](function(_0x112be1){if(_0x112be1){_0x52964e=_0x112be1;var _0x35a9b1={};for(var _0x3b4a79=0x0,_0xe84fd5=_0x52964e[_0x67d0('0x34')];_0x3b4a79<_0xe84fd5;_0x3b4a79++){if(!_0x35a9b1[_0x67d0('0x56')](_0x52964e[_0x3b4a79]['questionId'])){_0x35a9b1[_0x52964e[_0x3b4a79][_0x67d0('0x65')]]=needsEncapsulation(_0x52964e[_0x3b4a79][_0x67d0('0x66')])?encapsulate(_0x52964e[_0x3b4a79]['question']):_0x52964e[_0x3b4a79][_0x67d0('0x66')];}}var _0x50b78a=[],_0x4fe46a={};for(var _0x442300=0x0,_0x5edec6=_0x4487af['length'];_0x442300<_0x5edec6;_0x442300++){_0x4fe46a={'ProjectId':_0x40b3b8['params']['id'],'SessionId':_0x4487af[_0x442300]['id'],'StartTime':moment(_0x4487af[_0x442300][_0x67d0('0x67')])[_0x67d0('0x68')](_0x67d0('0x69'))};for(var _0x478dc0=0x0,_0x2ad360=_0x52964e[_0x67d0('0x34')];_0x478dc0<_0x2ad360;_0x478dc0++){if(_0x52964e[_0x478dc0][_0x67d0('0x6a')]==_0x4487af[_0x442300]['id']&&_0x35a9b1[_0x67d0('0x56')](_0x52964e[_0x478dc0][_0x67d0('0x65')])){_0x4fe46a[_0x35a9b1[_0x52964e[_0x478dc0]['questionId']]]=_0x52964e[_0x478dc0]['answer'];}}for(var _0x20085e in _0x35a9b1){if(!_0x4fe46a['hasOwnProperty'](_0x35a9b1[_0x20085e])){_0x4fe46a[_0x35a9b1[_0x20085e]]=null;}}_0x50b78a[_0x67d0('0x6b')](_0x4fe46a);}return _0x50b78a;}})['then'](function(_0x283f4a){if(!_[_0x67d0('0x6c')](_0x283f4a)){var _0x15246a=toCsv(_0x283f4a);var _0x965ee=Date[_0x67d0('0x6d')]();fs[_0x67d0('0x6e')](util[_0x67d0('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x40b3b8[_0x67d0('0x43')]['id'],_0x965ee),_0x15246a);_0x47f5bf['setHeader'](_0x67d0('0x6f'),_0x67d0('0x70')+util[_0x67d0('0x68')](_0x67d0('0x71'),_0x40b3b8['params']['id'],_0x965ee));_0x47f5bf[_0x67d0('0x72')](_0x67d0('0x73'),_0x67d0('0x74'));return _0x47f5bf['download'](util[_0x67d0('0x68')](_0x67d0('0x75'),_0x40b3b8[_0x67d0('0x43')]['id'],_0x965ee));}else{return _0x47f5bf['sendStatus'](0xcc);}})[_0x67d0('0x41')](handleError(_0x47f5bf,null));}; \ No newline at end of file +var _0x6e90=['request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','get','Projects','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','type','VIRTUAL','JscriptyProject','includeAll','findAll','rows','catch','show','params','include','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','error','update','getSessions','JscriptySessionReport','nolimit','ProjectId','getAnswers','findOne','JscriptyAnswerReport','order','number','apply','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','rimraf','zip-dir'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6e90,0xf5));var _0x06e9=function(_0x224b46,_0xe86040){_0x224b46=_0x224b46-0x0;var _0x313137=_0x6e90[_0x224b46];return _0x313137;};'use strict';var emlformat=require(_0x06e9('0x0'));var rimraf=require(_0x06e9('0x1'));var zipdir=require(_0x06e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x06e9('0x4'));var util=require(_0x06e9('0x5'));var path=require(_0x06e9('0x6'));var sox=require(_0x06e9('0x7'));var csv=require(_0x06e9('0x8'));var ejs=require(_0x06e9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06e9('0xa'));var squel=require(_0x06e9('0xb'));var crypto=require(_0x06e9('0xc'));var jsforce=require(_0x06e9('0xd'));var deskjs=require(_0x06e9('0xe'));var toCsv=require(_0x06e9('0x8'));var querystring=require(_0x06e9('0xf'));var Papa=require(_0x06e9('0x10'));var Redis=require(_0x06e9('0x11'));var authService=require(_0x06e9('0x12'));var qs=require(_0x06e9('0x13'));var as=require(_0x06e9('0x14'));var hardwareService=require(_0x06e9('0x15'));var logger=require(_0x06e9('0x16'))(_0x06e9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06e9('0x18'));var db=require(_0x06e9('0x19'))['db'];function respondWithStatusCode(_0x3eea8d,_0xf8100a){_0xf8100a=_0xf8100a||0xcc;return function(_0x1d1e2b){if(_0x1d1e2b){return _0x3eea8d[_0x06e9('0x1a')](_0xf8100a);}return _0x3eea8d['status'](_0xf8100a)[_0x06e9('0x1b')]();};}function respondWithResult(_0x3783bd,_0x215c94){_0x215c94=_0x215c94||0xc8;return function(_0x365f2c){if(_0x365f2c){return _0x3783bd[_0x06e9('0x1c')](_0x215c94)[_0x06e9('0x1d')](_0x365f2c);}};}function respondWithFilteredResult(_0xf808b6,_0x1855b8){return function(_0x27c3b5){if(_0x27c3b5){var _0x309b7d=typeof _0x1855b8[_0x06e9('0x1e')]==='undefined'&&typeof _0x1855b8['limit']===_0x06e9('0x1f');var _0xf42c19=_0x27c3b5[_0x06e9('0x20')];var _0x54167b=_0x309b7d?0x0:_0x1855b8[_0x06e9('0x1e')];var _0x22cc1e=_0x309b7d?_0x27c3b5['count']:_0x1855b8[_0x06e9('0x1e')]+_0x1855b8[_0x06e9('0x21')];var _0x4aa3dc;if(_0x22cc1e>=_0xf42c19){_0x22cc1e=_0xf42c19;_0x4aa3dc=0xc8;}else{_0x4aa3dc=0xce;}_0xf808b6['status'](_0x4aa3dc);return _0xf808b6[_0x06e9('0x22')](_0x06e9('0x23'),_0x54167b+'-'+_0x22cc1e+'/'+_0xf42c19)[_0x06e9('0x1d')](_0x27c3b5);}return null;};}function patchUpdates(_0x3d6d4f){return function(_0x5568b5){try{jsonpatch['apply'](_0x5568b5,_0x3d6d4f,!![]);}catch(_0x4fe4f1){return BPromise[_0x06e9('0x24')](_0x4fe4f1);}return _0x5568b5[_0x06e9('0x25')]();};}function saveUpdates(_0x19b3e1,_0x5264b9){return function(_0x2d27c5){if(_0x2d27c5){return _0x2d27c5['update'](_0x19b3e1)['then'](function(_0x1862bd){return _0x1862bd;});}return null;};}function removeEntity(_0x3a6936,_0x533fd8){return function(_0x4aced4){if(_0x4aced4){return _0x4aced4[_0x06e9('0x26')]()[_0x06e9('0x27')](function(){var _0x13f5ce=_0x4aced4[_0x06e9('0x28')]({'plain':!![]});var _0x58f4be=_0x06e9('0x29');return db[_0x06e9('0x2a')][_0x06e9('0x26')]({'where':{'type':_0x58f4be,'resourceId':_0x13f5ce['id']}})[_0x06e9('0x27')](function(){return _0x4aced4;});})['then'](function(){_0x3a6936[_0x06e9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdaf290,_0x426a29){return function(_0x1f685){if(!_0x1f685){_0xdaf290[_0x06e9('0x1a')](0x194);}return _0x1f685;};}function handleError(_0x5b9317,_0x3c3f39){_0x3c3f39=_0x3c3f39||0x1f4;return function(_0x13a981){logger['error'](_0x13a981[_0x06e9('0x2b')]);if(_0x13a981['name']){delete _0x13a981[_0x06e9('0x2c')];}_0x5b9317[_0x06e9('0x1c')](_0x3c3f39)[_0x06e9('0x2d')](_0x13a981);};}exports[_0x06e9('0x2e')]=function(_0x4d1b10,_0x490377){var _0x355858={},_0x574bbf={},_0x346296={'count':0x0,'rows':[]};var _0x5936e8=_[_0x06e9('0x2f')](db['JscriptyProject'][_0x06e9('0x30')],function(_0x544f2c){return{'name':_0x544f2c[_0x06e9('0x31')],'type':_0x544f2c['type'][_0x06e9('0x32')]};});_0x574bbf[_0x06e9('0x33')]=_[_0x06e9('0x2f')](_0x5936e8,_0x06e9('0x2c'));_0x574bbf['query']=_[_0x06e9('0x34')](_0x4d1b10[_0x06e9('0x35')]);_0x574bbf['filters']=_[_0x06e9('0x36')](_0x574bbf[_0x06e9('0x33')],_0x574bbf[_0x06e9('0x35')]);_0x355858['attributes']=_[_0x06e9('0x36')](_0x574bbf['model'],qs[_0x06e9('0x37')](_0x4d1b10['query'][_0x06e9('0x37')]));_0x355858[_0x06e9('0x38')]=_0x355858[_0x06e9('0x38')][_0x06e9('0x39')]?_0x355858['attributes']:_0x574bbf['model'];if(!_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x3a')]('nolimit')){_0x355858[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x4d1b10['query'][_0x06e9('0x21')]);_0x355858[_0x06e9('0x1e')]=qs['offset'](_0x4d1b10['query']['offset']);}_0x355858['order']=qs[_0x06e9('0x3b')](_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x355858['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x4d1b10['query'],_0x574bbf[_0x06e9('0x3c')]),_0x5936e8);if(_0x4d1b10['query'][_0x06e9('0x3e')]){_0x355858[_0x06e9('0x3f')]=_[_0x06e9('0x40')](_0x355858[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x5936e8,function(_0x4e1085){if(_0x4e1085[_0x06e9('0x41')]!==_0x06e9('0x42')){var _0x21cfdf={};_0x21cfdf[_0x4e1085['name']]={'$like':'%'+_0x4d1b10['query'][_0x06e9('0x3e')]+'%'};return _0x21cfdf;}})});}_0x355858=_[_0x06e9('0x40')]({},_0x355858,_0x4d1b10['options']);var _0x27f304={'where':_0x355858[_0x06e9('0x3f')]};return db[_0x06e9('0x43')][_0x06e9('0x20')](_0x27f304)['then'](function(_0x1b5b10){_0x346296[_0x06e9('0x20')]=_0x1b5b10;if(_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x44')]){_0x355858['include']=[{'all':!![]}];}return db[_0x06e9('0x43')][_0x06e9('0x45')](_0x355858);})[_0x06e9('0x27')](function(_0x42bdbf){_0x346296[_0x06e9('0x46')]=_0x42bdbf;return _0x346296;})[_0x06e9('0x27')](respondWithFilteredResult(_0x490377,_0x355858))[_0x06e9('0x47')](handleError(_0x490377,null));};exports[_0x06e9('0x48')]=function(_0x59dd17,_0x6b41dd){var _0x178b0f={'raw':![],'where':{'id':_0x59dd17[_0x06e9('0x49')]['id']}},_0x43e06b={};_0x43e06b['model']=_[_0x06e9('0x34')](db[_0x06e9('0x43')][_0x06e9('0x30')]);_0x43e06b[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x59dd17['query']);_0x43e06b['filters']=_[_0x06e9('0x36')](_0x43e06b['model'],_0x43e06b[_0x06e9('0x35')]);_0x178b0f[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x43e06b[_0x06e9('0x33')],qs['fields'](_0x59dd17[_0x06e9('0x35')][_0x06e9('0x37')]));_0x178b0f['attributes']=_0x178b0f['attributes'][_0x06e9('0x39')]?_0x178b0f[_0x06e9('0x38')]:_0x43e06b[_0x06e9('0x33')];if(_0x59dd17[_0x06e9('0x35')][_0x06e9('0x44')]){_0x178b0f[_0x06e9('0x4a')]=[{'all':!![]}];}_0x178b0f=_[_0x06e9('0x40')]({},_0x178b0f,_0x59dd17[_0x06e9('0x4b')]);return db[_0x06e9('0x43')]['find'](_0x178b0f)[_0x06e9('0x27')](handleEntityNotFound(_0x6b41dd,null))['then'](respondWithResult(_0x6b41dd,null))[_0x06e9('0x47')](handleError(_0x6b41dd,null));};exports['create']=function(_0x587609,_0x33bfc5){return db[_0x06e9('0x43')]['create'](_0x587609[_0x06e9('0x4c')],{})['then'](function(_0x59a4bc){var _0x17ef2c=_0x587609['user'][_0x06e9('0x28')]({'plain':!![]});if(!_0x17ef2c)throw new Error(_0x06e9('0x4d'));if(_0x17ef2c[_0x06e9('0x4e')]===_0x06e9('0x4f')){var _0x50af90=_0x59a4bc[_0x06e9('0x28')]({'plain':!![]});var _0x2a39a5=_0x06e9('0x29');return db[_0x06e9('0x50')][_0x06e9('0x51')]({'where':{'name':_0x2a39a5,'userProfileId':_0x17ef2c[_0x06e9('0x52')]},'raw':!![]})['then'](function(_0xd05d6c){if(_0xd05d6c&&_0xd05d6c[_0x06e9('0x53')]===0x0){return db[_0x06e9('0x2a')]['create']({'name':_0x50af90[_0x06e9('0x2c')],'resourceId':_0x50af90['id'],'type':_0xd05d6c[_0x06e9('0x2c')],'sectionId':_0xd05d6c['id']},{})[_0x06e9('0x27')](function(){return _0x59a4bc;});}else{return _0x59a4bc;}})[_0x06e9('0x47')](function(_0x90ae69){logger['error'](_0x06e9('0x54'),_0x90ae69);throw _0x90ae69;});}return _0x59a4bc;})['then'](respondWithResult(_0x33bfc5,0xc9))[_0x06e9('0x47')](handleError(_0x33bfc5,null));};exports[_0x06e9('0x55')]=function(_0x49f60d,_0x56ef80){var _0x587b6a={'where':{'id':_0x49f60d[_0x06e9('0x49')]['id']}},_0xb73d5c={};_0xb73d5c['model']=_[_0x06e9('0x34')](db[_0x06e9('0x43')]['rawAttributes']);_0x587b6a['attributes']=_[_0x06e9('0x36')](_0xb73d5c[_0x06e9('0x33')],qs['fields'](_0x49f60d[_0x06e9('0x35')]['fields']));_0x587b6a['attributes']=_0x587b6a['attributes']['length']?_0x587b6a['attributes']:_0xb73d5c['model'];if(_0x49f60d[_0x06e9('0x35')][_0x06e9('0x44')]){_0x587b6a[_0x06e9('0x4a')]=[{'all':!![]}];}_0x587b6a=_[_0x06e9('0x40')]({},_0x587b6a,_0x49f60d[_0x06e9('0x4b')]);return db[_0x06e9('0x43')][_0x06e9('0x51')](_0x587b6a)[_0x06e9('0x27')](handleEntityNotFound(_0x56ef80,null))[_0x06e9('0x27')](function(_0x513c39){if(_0x513c39){var _0x1d25bd=_0x513c39[_0x06e9('0x28')]({'plain':!![]});_0x1d25bd=qs['omit'](_0x1d25bd,['id',_0x06e9('0x56'),_0x06e9('0x57')]);_0x49f60d[_0x06e9('0x4c')]=_[_0x06e9('0x58')](_0x49f60d['body'],['id',_0x06e9('0x56'),'updatedAt']);return db[_0x06e9('0x43')][_0x06e9('0x59')](_[_0x06e9('0x40')](_0x1d25bd,_0x49f60d[_0x06e9('0x4c')]),{'include':_0x49f60d[_0x06e9('0x35')][_0x06e9('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x1d29e7){var _0x944bb3=_0x49f60d[_0x06e9('0x4f')]['get']({'plain':!![]});if(!_0x944bb3)throw new Error(_0x06e9('0x4d'));if(_0x944bb3[_0x06e9('0x4e')]==='user'){var _0x482c83=_0x1d29e7[_0x06e9('0x28')]({'plain':!![]});var _0x2a2605='Projects';return db[_0x06e9('0x50')][_0x06e9('0x51')]({'where':{'name':_0x2a2605,'userProfileId':_0x944bb3[_0x06e9('0x52')]},'raw':!![]})['then'](function(_0x11ffe5){if(_0x11ffe5&&_0x11ffe5[_0x06e9('0x53')]===0x0){return db[_0x06e9('0x2a')][_0x06e9('0x59')]({'name':_0x482c83[_0x06e9('0x2c')],'resourceId':_0x482c83['id'],'type':_0x11ffe5[_0x06e9('0x2c')],'sectionId':_0x11ffe5['id']},{})[_0x06e9('0x27')](function(){return _0x1d29e7;});}else{return _0x1d29e7;}})[_0x06e9('0x47')](function(_0x5414d4){logger[_0x06e9('0x5a')](_0x06e9('0x54'),_0x5414d4);throw _0x5414d4;});}return _0x1d29e7;});}})['then'](respondWithResult(_0x56ef80,0xc9))['catch'](handleError(_0x56ef80,null));};exports[_0x06e9('0x5b')]=function(_0x26ac58,_0x45bf8a){if(_0x26ac58[_0x06e9('0x4c')]['id']){delete _0x26ac58[_0x06e9('0x4c')]['id'];}return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x26ac58[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x45bf8a,null))['then'](saveUpdates(_0x26ac58[_0x06e9('0x4c')],null))[_0x06e9('0x27')](respondWithResult(_0x45bf8a,null))[_0x06e9('0x47')](handleError(_0x45bf8a,null));};exports[_0x06e9('0x26')]=function(_0x14b897,_0xca7886){return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x14b897[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0xca7886,null))[_0x06e9('0x27')](removeEntity(_0xca7886,null))[_0x06e9('0x47')](handleError(_0xca7886,null));};exports[_0x06e9('0x5c')]=function(_0x2d5d36,_0x3afdff,_0x16a3df){var _0x463268={'raw':!![],'where':{}};var _0x2f319b={};var _0x3635ed={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2d5d36[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3afdff,null))[_0x06e9('0x27')](function(_0x396a2d){if(_0x396a2d){_0x2f319b[_0x06e9('0x33')]=_[_0x06e9('0x34')](db[_0x06e9('0x5d')][_0x06e9('0x30')]);_0x2f319b['query']=_[_0x06e9('0x34')](_0x2d5d36[_0x06e9('0x35')]);_0x2f319b[_0x06e9('0x3c')]=_['intersection'](_0x2f319b[_0x06e9('0x33')],_0x2f319b['query']);_0x463268['attributes']=_[_0x06e9('0x36')](_0x2f319b['model'],qs[_0x06e9('0x37')](_0x2d5d36[_0x06e9('0x35')]['fields']));_0x463268[_0x06e9('0x38')]=_0x463268[_0x06e9('0x38')][_0x06e9('0x39')]?_0x463268[_0x06e9('0x38')]:_0x2f319b[_0x06e9('0x33')];if(!_0x2d5d36[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x463268[_0x06e9('0x21')]=qs['limit'](_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x21')]);_0x463268[_0x06e9('0x1e')]=qs[_0x06e9('0x1e')](_0x2d5d36[_0x06e9('0x35')]['offset']);}_0x463268['order']=qs['sort'](_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x463268[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x2d5d36[_0x06e9('0x35')],_0x2f319b['filters']));_0x463268[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x396a2d['id'];if(_0x2d5d36['query'][_0x06e9('0x3e')]){_0x463268['where']=_[_0x06e9('0x40')](_0x463268['where'],{'$or':_[_0x06e9('0x2f')](_0x463268['attributes'],function(_0x307a93){var _0x130746={};_0x130746[_0x307a93]={'$like':'%'+_0x2d5d36[_0x06e9('0x35')]['filter']+'%'};return _0x130746;})});}_0x463268=_[_0x06e9('0x40')]({},_0x463268,_0x2d5d36[_0x06e9('0x4b')]);return db[_0x06e9('0x5d')][_0x06e9('0x20')]({'where':_0x463268['where']})[_0x06e9('0x27')](function(_0x35d8af){_0x3635ed['count']=_0x35d8af;if(_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x44')]){_0x463268[_0x06e9('0x4a')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x06e9('0x45')](_0x463268);})['then'](function(_0x10b752){_0x3635ed[_0x06e9('0x46')]=_0x10b752;return _0x3635ed;});}})[_0x06e9('0x27')](respondWithFilteredResult(_0x3afdff,_0x463268))[_0x06e9('0x47')](handleError(_0x3afdff,null));};exports[_0x06e9('0x60')]=function(_0x34b35f,_0x233cba,_0x2aaff5){var _0x56383e={'raw':!![],'where':{}};var _0x15d5f0={};var _0x3c677f={'count':0x0,'rows':[]};return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x34b35f[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x233cba,null))[_0x06e9('0x27')](function(_0x191756){if(_0x191756){_0x15d5f0[_0x06e9('0x33')]=_[_0x06e9('0x34')](db[_0x06e9('0x62')][_0x06e9('0x30')]);_0x15d5f0[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x34b35f['query']);_0x15d5f0['filters']=_[_0x06e9('0x36')](_0x15d5f0['model'],_0x15d5f0[_0x06e9('0x35')]);_0x56383e[_0x06e9('0x38')]=_['intersection'](_0x15d5f0['model'],qs[_0x06e9('0x37')](_0x34b35f[_0x06e9('0x35')]['fields']));_0x56383e[_0x06e9('0x38')]=_0x56383e[_0x06e9('0x38')]['length']?_0x56383e['attributes']:_0x15d5f0[_0x06e9('0x33')];if(!_0x34b35f[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x56383e[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x34b35f[_0x06e9('0x35')][_0x06e9('0x21')]);_0x56383e[_0x06e9('0x1e')]=qs['offset'](_0x34b35f[_0x06e9('0x35')][_0x06e9('0x1e')]);}_0x56383e[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x34b35f[_0x06e9('0x35')]['sort']);_0x56383e[_0x06e9('0x3f')]=qs['filters'](_['pick'](_0x34b35f['query'],_0x15d5f0[_0x06e9('0x3c')]));_0x56383e['where'][_0x06e9('0x5f')]=_0x191756['id'];if(_0x34b35f[_0x06e9('0x35')]['filter']){_0x56383e[_0x06e9('0x3f')]=_['merge'](_0x56383e[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x56383e[_0x06e9('0x38')],function(_0x277733){var _0x245075={};_0x245075[_0x277733]={'$like':'%'+_0x34b35f[_0x06e9('0x35')]['filter']+'%'};return _0x245075;})});}_0x56383e=_[_0x06e9('0x40')]({},_0x56383e,_0x34b35f[_0x06e9('0x4b')]);return db[_0x06e9('0x62')][_0x06e9('0x20')]({'where':_0x56383e[_0x06e9('0x3f')]})['then'](function(_0x3630e5){_0x3c677f['count']=_0x3630e5;if(_0x34b35f[_0x06e9('0x35')][_0x06e9('0x44')]){_0x56383e[_0x06e9('0x4a')]=[{'all':!![]}];}return db[_0x06e9('0x62')][_0x06e9('0x45')](_0x56383e);})['then'](function(_0x1b44b3){_0x3c677f[_0x06e9('0x46')]=_0x1b44b3;return _0x3c677f;});}})[_0x06e9('0x27')](respondWithFilteredResult(_0x233cba,_0x56383e))['catch'](handleError(_0x233cba,null));};function char(_0x4eeb31){return _0x06e9('0x64')===typeof _0x4eeb31?String['fromCharCode'][_0x06e9('0x65')](null,arguments):_0x4eeb31;}function needsEncapsulation(_0x35ab45){return!!_0x35ab45&&(_0x35ab45[_0x06e9('0x66')]()[_0x06e9('0x67')](char(0xd))>=0x0||_0x35ab45[_0x06e9('0x66')]()[_0x06e9('0x67')](char(0xa))>=0x0||_0x35ab45[_0x06e9('0x66')]()[_0x06e9('0x67')](char(0x2c))>=0x0||_0x35ab45[_0x06e9('0x66')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5ac6a3){var _0x59d11e=char(0x22),_0x219781='\x5c'+char(0x22),_0x54bdfa=_0x5ac6a3[_0x06e9('0x66')]()[_0x06e9('0x68')](new RegExp(_0x59d11e,'g'),_0x219781);return _0x59d11e+_0x54bdfa+_0x59d11e;}exports[_0x06e9('0x69')]=function(_0x204236,_0x3ef501,_0x4d515a){var _0x21355c,_0x24a3da;var _0x267f28={'where':{'ProjectId':_0x204236[_0x06e9('0x49')]['id']}};if(_0x204236[_0x06e9('0x35')]['startTime']){_0x267f28[_0x06e9('0x3f')][_0x06e9('0x6a')]=JSON[_0x06e9('0x6b')](_0x204236[_0x06e9('0x35')][_0x06e9('0x6c')]);}return db[_0x06e9('0x5d')][_0x06e9('0x45')](_0x267f28)['then'](handleEntityNotFound(_0x3ef501,null))[_0x06e9('0x27')](function(_0x2d5ee6){if(_0x2d5ee6){_0x21355c=_0x2d5ee6;return db[_0x06e9('0x6d')][_0x06e9('0x45')]({'where':{'SessionId':{'$in':_[_0x06e9('0x2f')](_0x21355c,'id')},'ProjectId':_0x204236['params']['id']},'order':'-createdAt'});}})[_0x06e9('0x27')](handleEntityNotFound(_0x3ef501,null))[_0x06e9('0x27')](function(_0x3316f4){if(_0x3316f4){_0x24a3da=_0x3316f4;var _0x24d988={};for(var _0x4f8f8d=0x0,_0x3a5427=_0x24a3da['length'];_0x4f8f8d<_0x3a5427;_0x4f8f8d++){if(!_0x24d988[_0x06e9('0x3a')](_0x24a3da[_0x4f8f8d][_0x06e9('0x6e')])){_0x24d988[_0x24a3da[_0x4f8f8d][_0x06e9('0x6e')]]=needsEncapsulation(_0x24a3da[_0x4f8f8d][_0x06e9('0x6f')])?encapsulate(_0x24a3da[_0x4f8f8d][_0x06e9('0x6f')]):_0x24a3da[_0x4f8f8d][_0x06e9('0x6f')];}}var _0x5851b4=[],_0x5bc8ca={};for(var _0x434e16=0x0,_0x527687=_0x21355c[_0x06e9('0x39')];_0x434e16<_0x527687;_0x434e16++){_0x5bc8ca={'ProjectId':_0x204236['params']['id'],'SessionId':_0x21355c[_0x434e16]['id'],'StartTime':moment(_0x21355c[_0x434e16][_0x06e9('0x6a')])[_0x06e9('0x70')](_0x06e9('0x71'))};for(var _0x44534e=0x0,_0x4e2691=_0x24a3da[_0x06e9('0x39')];_0x44534e<_0x4e2691;_0x44534e++){if(_0x24a3da[_0x44534e][_0x06e9('0x72')]==_0x21355c[_0x434e16]['id']&&_0x24d988[_0x06e9('0x3a')](_0x24a3da[_0x44534e][_0x06e9('0x6e')])){_0x5bc8ca[_0x24d988[_0x24a3da[_0x44534e][_0x06e9('0x6e')]]]=_0x24a3da[_0x44534e][_0x06e9('0x73')];}}for(var _0x480877 in _0x24d988){if(!_0x5bc8ca[_0x06e9('0x3a')](_0x24d988[_0x480877])){_0x5bc8ca[_0x24d988[_0x480877]]=null;}}_0x5851b4[_0x06e9('0x74')](_0x5bc8ca);}return _0x5851b4;}})[_0x06e9('0x27')](function(_0x3ea50a){if(!_['isEmpty'](_0x3ea50a)){var _0x3b157f=toCsv(_0x3ea50a);var _0x17dad8=Date[_0x06e9('0x75')]();fs[_0x06e9('0x76')](util['format'](_0x06e9('0x77'),_0x204236[_0x06e9('0x49')]['id'],_0x17dad8),_0x3b157f);_0x3ef501[_0x06e9('0x78')]('Content-disposition',_0x06e9('0x79')+util[_0x06e9('0x70')](_0x06e9('0x7a'),_0x204236[_0x06e9('0x49')]['id'],_0x17dad8));_0x3ef501[_0x06e9('0x78')]('Content-type',_0x06e9('0x7b'));return _0x3ef501['download'](util['format'](_0x06e9('0x77'),_0x204236['params']['id'],_0x17dad8));}else{return _0x3ef501[_0x06e9('0x1a')](0xcc);}})[_0x06e9('0x47')](handleError(_0x3ef501,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f063d48..e011695 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 _0x6dac=['../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x51aa4c,_0x143072){var _0x317af3=function(_0x41b4a){while(--_0x41b4a){_0x51aa4c['push'](_0x51aa4c['shift']());}};_0x317af3(++_0x143072);}(_0x6dac,0x16e));var _0xc6da=function(_0x404b34,_0x39a3cd){_0x404b34=_0x404b34-0x0;var _0x43bb22=_0x6dac[_0x404b34];return _0x43bb22;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require(_0xc6da('0x4'));var BPromise=require(_0xc6da('0x5'));var rp=require(_0xc6da('0x6'));var fs=require('fs');var path=require(_0xc6da('0x7'));var rimraf=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var attributes=require(_0xc6da('0xa'));module[_0xc6da('0xb')]=function(_0x325f49,_0x5caf49){return _0x325f49[_0xc6da('0xc')](_0xc6da('0xd'),attributes,{'tableName':_0xc6da('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc492=['util','../../config/logger','bluebird','rimraf','../../config/environment','exports','define','jscripty_projects','lodash'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0xc492,0xd7));var _0x2c49=function(_0x49a8c4,_0x154b12){_0x49a8c4=_0x49a8c4-0x0;var _0x545918=_0xc492[_0x49a8c4];return _0x545918;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var logger=require(_0x2c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0x2c49('0x6')]=function(_0x499c4e,_0x3ad911){return _0x499c4e[_0x2c49('0x7')]('JscriptyProject',attributes,{'tableName':_0x2c49('0x8'),'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 558b205..f33be91 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 _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x548c99,_0x3de4c5){var _0x149ca3=function(_0x46ba45){while(--_0x46ba45){_0x548c99['push'](_0x548c99['shift']());}};_0x149ca3(++_0x3de4c5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3dc4ef,_0x200ede){_0x3dc4ef=_0x3dc4ef-0x0;var _0x5572ca=_0x9bde[_0x3dc4ef];return _0x5572ca;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x5bc776,_0x1a805f){var _0x4ec339=function(_0x55dcd4){while(--_0x55dcd4){_0x5bc776['push'](_0x5bc776['shift']());}};_0x4ec339(++_0x1a805f);}(_0xe706,0xa3));var _0x6e70=function(_0x2159e6,_0x55c285){_0x2159e6=_0x2159e6-0x0;var _0x355dbb=_0xe706[_0x2159e6];return _0x355dbb;};'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']('JscriptyProject,\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']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 7b15da2..29269ee 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 _0x54e7=['show','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe'];(function(_0x70d3b5,_0x4bbd30){var _0x4f96d6=function(_0x25798d){while(--_0x25798d){_0x70d3b5['push'](_0x70d3b5['shift']());}};_0x4f96d6(++_0x4bbd30);}(_0x54e7,0x15c));var _0x754e=function(_0x306789,_0x4334df){_0x306789=_0x306789-0x0;var _0x5e7f0c=_0x54e7[_0x306789];return _0x5e7f0c;};'use strict';var multer=require(_0x754e('0x0'));var util=require(_0x754e('0x1'));var path=require('path');var timeout=require(_0x754e('0x2'));var express=require(_0x754e('0x3'));var router=express[_0x754e('0x4')]();var fs_extra=require(_0x754e('0x5'));var auth=require(_0x754e('0x6'));var interaction=require(_0x754e('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x754e('0x8')]);router[_0x754e('0x9')]('/describe',auth[_0x754e('0xa')](),controller[_0x754e('0xb')]);router['get']('/:id',auth[_0x754e('0xa')](),controller[_0x754e('0xc')]);router['post']('/',auth[_0x754e('0xa')](),controller[_0x754e('0xd')]);router['put'](_0x754e('0xe'),auth['isAuthenticated'](),controller[_0x754e('0xf')]);router['delete']('/:id',auth[_0x754e('0xa')](),controller[_0x754e('0x10')]);module[_0x754e('0x11')]=router; \ No newline at end of file +var _0x8958=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','destroy','multer'];(function(_0x4c97b5,_0x161d4a){var _0xb1b4d8=function(_0x481293){while(--_0x481293){_0x4c97b5['push'](_0x4c97b5['shift']());}};_0xb1b4d8(++_0x161d4a);}(_0x8958,0x17b));var _0x8895=function(_0x47968f,_0x5dff2e){_0x47968f=_0x47968f-0x0;var _0x138346=_0x8958[_0x47968f];return _0x138346;};'use strict';var multer=require(_0x8895('0x0'));var util=require(_0x8895('0x1'));var path=require(_0x8895('0x2'));var timeout=require(_0x8895('0x3'));var express=require(_0x8895('0x4'));var router=express[_0x8895('0x5')]();var fs_extra=require(_0x8895('0x6'));var auth=require(_0x8895('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8895('0x8'));var controller=require(_0x8895('0x9'));router[_0x8895('0xa')]('/',auth[_0x8895('0xb')](),controller['index']);router['get'](_0x8895('0xc'),auth[_0x8895('0xb')](),controller[_0x8895('0xd')]);router[_0x8895('0xa')](_0x8895('0xe'),auth[_0x8895('0xb')](),controller['show']);router[_0x8895('0xf')]('/',auth[_0x8895('0xb')](),controller[_0x8895('0x10')]);router[_0x8895('0x11')](_0x8895('0xe'),auth[_0x8895('0xb')](),controller[_0x8895('0x12')]);router['delete'](_0x8895('0xe'),auth[_0x8895('0xb')](),controller[_0x8895('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d945422..1953935 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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x296682,_0x1b6eaf){_0x296682=_0x296682-0x0;var _0x42b913=_0x7a54[_0x296682];return _0x42b913;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x4e5850,_0x331545){_0x4e5850=_0x4e5850-0x0;var _0x48de82=_0x7a54[_0x4e5850];return _0x48de82;};'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 31860a4..3653a52 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 _0x062d=['fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','then','includeAll','include','rows','catch','show','params','keys','options','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/environment','sendStatus','end','status','limit','count','offset','set','Content-Range','apply','reject','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes'];(function(_0x4e8017,_0x19ae69){var _0x478e65=function(_0x244760){while(--_0x244760){_0x4e8017['push'](_0x4e8017['shift']());}};_0x478e65(++_0x19ae69);}(_0x062d,0x18a));var _0xd062=function(_0x2adac5,_0x38fea6){_0x2adac5=_0x2adac5-0x0;var _0x1661ab=_0x062d[_0x2adac5];return _0x1661ab;};'use strict';var emlformat=require(_0xd062('0x0'));var rimraf=require(_0xd062('0x1'));var zipdir=require(_0xd062('0x2'));var jsonpatch=require(_0xd062('0x3'));var rp=require(_0xd062('0x4'));var moment=require('moment');var BPromise=require(_0xd062('0x5'));var Mustache=require('mustache');var util=require(_0xd062('0x6'));var path=require(_0xd062('0x7'));var sox=require(_0xd062('0x8'));var csv=require(_0xd062('0x9'));var ejs=require(_0xd062('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd062('0xb'));var squel=require(_0xd062('0xc'));var crypto=require(_0xd062('0xd'));var jsforce=require(_0xd062('0xe'));var deskjs=require(_0xd062('0xf'));var toCsv=require(_0xd062('0x9'));var querystring=require(_0xd062('0x10'));var Papa=require(_0xd062('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd062('0x12'));var utils=require(_0xd062('0x13'));var config=require(_0xd062('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26554d,_0x546de5){_0x546de5=_0x546de5||0xcc;return function(_0x5070ec){if(_0x5070ec){return _0x26554d[_0xd062('0x15')](_0x546de5);}return _0x26554d['status'](_0x546de5)[_0xd062('0x16')]();};}function respondWithResult(_0x225b6c,_0x2101bc){_0x2101bc=_0x2101bc||0xc8;return function(_0x42da12){if(_0x42da12){return _0x225b6c[_0xd062('0x17')](_0x2101bc)['json'](_0x42da12);}};}function respondWithFilteredResult(_0x3d99ab,_0x313ddf){return function(_0x3e5a2c){if(_0x3e5a2c){var _0x578921=typeof _0x313ddf['offset']==='undefined'&&typeof _0x313ddf[_0xd062('0x18')]==='undefined';var _0x3d922d=_0x3e5a2c[_0xd062('0x19')];var _0x265711=_0x578921?0x0:_0x313ddf[_0xd062('0x1a')];var _0x229b71=_0x578921?_0x3e5a2c['count']:_0x313ddf[_0xd062('0x1a')]+_0x313ddf[_0xd062('0x18')];var _0x31afc8;if(_0x229b71>=_0x3d922d){_0x229b71=_0x3d922d;_0x31afc8=0xc8;}else{_0x31afc8=0xce;}_0x3d99ab[_0xd062('0x17')](_0x31afc8);return _0x3d99ab[_0xd062('0x1b')](_0xd062('0x1c'),_0x265711+'-'+_0x229b71+'/'+_0x3d922d)['json'](_0x3e5a2c);}return null;};}function patchUpdates(_0x1f1144){return function(_0x56c460){try{jsonpatch[_0xd062('0x1d')](_0x56c460,_0x1f1144,!![]);}catch(_0xaa9625){return BPromise[_0xd062('0x1e')](_0xaa9625);}return _0x56c460['save']();};}function saveUpdates(_0x11d7ae,_0x464fa4){return function(_0x5bd16b){if(_0x5bd16b){return _0x5bd16b['update'](_0x11d7ae)['then'](function(_0x14b539){return _0x14b539;});}return null;};}function removeEntity(_0x28d0f6,_0x5ba095){return function(_0x6628d2){if(_0x6628d2){return _0x6628d2['destroy']()['then'](function(){_0x28d0f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ed3,_0x5827ff){return function(_0x421332){if(!_0x421332){_0x9ed3[_0xd062('0x15')](0x194);}return _0x421332;};}function handleError(_0x4beee6,_0x17ed26){_0x17ed26=_0x17ed26||0x1f4;return function(_0x1443fc){logger[_0xd062('0x1f')](_0x1443fc[_0xd062('0x20')]);if(_0x1443fc[_0xd062('0x21')]){delete _0x1443fc[_0xd062('0x21')];}_0x4beee6[_0xd062('0x17')](_0x17ed26)[_0xd062('0x22')](_0x1443fc);};}exports[_0xd062('0x23')]=function(_0x4e6a5b,_0x5f0b33){var _0x26f040={},_0x32fe7b={},_0x27571e={'count':0x0,'rows':[]};var _0x5dc526=_['map'](db[_0xd062('0x24')][_0xd062('0x25')],function(_0x3ffe93){return{'name':_0x3ffe93[_0xd062('0x26')],'type':_0x3ffe93[_0xd062('0x27')][_0xd062('0x28')]};});_0x32fe7b[_0xd062('0x29')]=_['map'](_0x5dc526,'name');_0x32fe7b[_0xd062('0x2a')]=_['keys'](_0x4e6a5b[_0xd062('0x2a')]);_0x32fe7b[_0xd062('0x2b')]=_['intersection'](_0x32fe7b[_0xd062('0x29')],_0x32fe7b[_0xd062('0x2a')]);_0x26f040['attributes']=_[_0xd062('0x2c')](_0x32fe7b[_0xd062('0x29')],qs['fields'](_0x4e6a5b[_0xd062('0x2a')][_0xd062('0x2d')]));_0x26f040[_0xd062('0x2e')]=_0x26f040[_0xd062('0x2e')]['length']?_0x26f040[_0xd062('0x2e')]:_0x32fe7b['model'];if(!_0x4e6a5b[_0xd062('0x2a')][_0xd062('0x2f')](_0xd062('0x30'))){_0x26f040['limit']=qs['limit'](_0x4e6a5b[_0xd062('0x2a')][_0xd062('0x18')]);_0x26f040[_0xd062('0x1a')]=qs[_0xd062('0x1a')](_0x4e6a5b['query'][_0xd062('0x1a')]);}_0x26f040[_0xd062('0x31')]=qs['sort'](_0x4e6a5b[_0xd062('0x2a')][_0xd062('0x32')]);_0x26f040[_0xd062('0x33')]=qs[_0xd062('0x2b')](_[_0xd062('0x34')](_0x4e6a5b['query'],_0x32fe7b[_0xd062('0x2b')]),_0x5dc526);if(_0x4e6a5b[_0xd062('0x2a')][_0xd062('0x35')]){_0x26f040[_0xd062('0x33')]=_[_0xd062('0x36')](_0x26f040['where'],{'$or':_[_0xd062('0x37')](_0x5dc526,function(_0x1178d5){if(_0x1178d5['type']!==_0xd062('0x38')){var _0x184d9a={};_0x184d9a[_0x1178d5[_0xd062('0x21')]]={'$like':'%'+_0x4e6a5b['query'][_0xd062('0x35')]+'%'};return _0x184d9a;}})});}_0x26f040=_[_0xd062('0x36')]({},_0x26f040,_0x4e6a5b['options']);var _0x4a90ff={'where':_0x26f040[_0xd062('0x33')]};return db[_0xd062('0x24')][_0xd062('0x19')](_0x4a90ff)[_0xd062('0x39')](function(_0x333323){_0x27571e['count']=_0x333323;if(_0x4e6a5b[_0xd062('0x2a')][_0xd062('0x3a')]){_0x26f040[_0xd062('0x3b')]=[{'all':!![]}];}return db[_0xd062('0x24')]['findAll'](_0x26f040);})[_0xd062('0x39')](function(_0x2af6b8){_0x27571e[_0xd062('0x3c')]=_0x2af6b8;return _0x27571e;})[_0xd062('0x39')](respondWithFilteredResult(_0x5f0b33,_0x26f040))[_0xd062('0x3d')](handleError(_0x5f0b33,null));};exports[_0xd062('0x3e')]=function(_0x3f2f1b,_0x378a68){var _0x3a0b35={'raw':!![],'where':{'id':_0x3f2f1b[_0xd062('0x3f')]['id']}},_0x4e931f={};_0x4e931f[_0xd062('0x29')]=_[_0xd062('0x40')](db['JscriptyQuestionReport'][_0xd062('0x25')]);_0x4e931f['query']=_['keys'](_0x3f2f1b['query']);_0x4e931f[_0xd062('0x2b')]=_['intersection'](_0x4e931f[_0xd062('0x29')],_0x4e931f[_0xd062('0x2a')]);_0x3a0b35['attributes']=_[_0xd062('0x2c')](_0x4e931f['model'],qs[_0xd062('0x2d')](_0x3f2f1b[_0xd062('0x2a')][_0xd062('0x2d')]));_0x3a0b35['attributes']=_0x3a0b35['attributes']['length']?_0x3a0b35[_0xd062('0x2e')]:_0x4e931f[_0xd062('0x29')];if(_0x3f2f1b[_0xd062('0x2a')][_0xd062('0x3a')]){_0x3a0b35['include']=[{'all':!![]}];}_0x3a0b35=_[_0xd062('0x36')]({},_0x3a0b35,_0x3f2f1b[_0xd062('0x41')]);return db[_0xd062('0x24')][_0xd062('0x42')](_0x3a0b35)[_0xd062('0x39')](handleEntityNotFound(_0x378a68,null))[_0xd062('0x39')](respondWithResult(_0x378a68,null))[_0xd062('0x3d')](handleError(_0x378a68,null));};exports[_0xd062('0x43')]=function(_0x5804b8,_0x4f98c2){return db['JscriptyQuestionReport'][_0xd062('0x43')](_0x5804b8[_0xd062('0x44')],{})[_0xd062('0x39')](respondWithResult(_0x4f98c2,0xc9))['catch'](handleError(_0x4f98c2,null));};exports[_0xd062('0x45')]=function(_0x45b78f,_0x5bc64b){if(_0x45b78f['body']['id']){delete _0x45b78f[_0xd062('0x44')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x45b78f[_0xd062('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5bc64b,null))['then'](saveUpdates(_0x45b78f[_0xd062('0x44')],null))['then'](respondWithResult(_0x5bc64b,null))['catch'](handleError(_0x5bc64b,null));};exports[_0xd062('0x46')]=function(_0x2e5f05,_0x5076ab){return db[_0xd062('0x24')][_0xd062('0x42')]({'where':{'id':_0x2e5f05[_0xd062('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5076ab,null))[_0xd062('0x39')](removeEntity(_0x5076ab,null))['catch'](handleError(_0x5076ab,null));};exports[_0xd062('0x47')]=function(_0x102c9a,_0x19b20a){return db[_0xd062('0x24')][_0xd062('0x47')]()['then'](respondWithResult(_0x19b20a,null))[_0xd062('0x3d')](handleError(_0x19b20a,null));}; \ No newline at end of file +var _0x2150=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x111828,_0x1cdb50){var _0x26c292=function(_0x56b054){while(--_0x56b054){_0x111828['push'](_0x111828['shift']());}};_0x26c292(++_0x1cdb50);}(_0x2150,0x128));var _0x0215=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x2150[_0x3f3f06];return _0x140feb;};'use strict';var emlformat=require(_0x0215('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0215('0x1'));var jsonpatch=require(_0x0215('0x2'));var rp=require(_0x0215('0x3'));var moment=require('moment');var BPromise=require(_0x0215('0x4'));var Mustache=require(_0x0215('0x5'));var util=require(_0x0215('0x6'));var path=require(_0x0215('0x7'));var sox=require(_0x0215('0x8'));var csv=require(_0x0215('0x9'));var ejs=require(_0x0215('0xa'));var fs=require('fs');var fs_extra=require(_0x0215('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0215('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0215('0xd'));var Papa=require(_0x0215('0xe'));var Redis=require(_0x0215('0xf'));var authService=require(_0x0215('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0215('0x11'));var hardwareService=require(_0x0215('0x12'));var logger=require('../../config/logger')(_0x0215('0x13'));var utils=require(_0x0215('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0215('0x15'));var db=require(_0x0215('0x16'))['db'];function respondWithStatusCode(_0x932239,_0x358da0){_0x358da0=_0x358da0||0xcc;return function(_0x3a0585){if(_0x3a0585){return _0x932239[_0x0215('0x17')](_0x358da0);}return _0x932239[_0x0215('0x18')](_0x358da0)[_0x0215('0x19')]();};}function respondWithResult(_0x1bf311,_0x3b98e3){_0x3b98e3=_0x3b98e3||0xc8;return function(_0x422871){if(_0x422871){return _0x1bf311['status'](_0x3b98e3)[_0x0215('0x1a')](_0x422871);}};}function respondWithFilteredResult(_0x448d61,_0x11647d){return function(_0x120b9c){if(_0x120b9c){var _0x4ffc9c=typeof _0x11647d[_0x0215('0x1b')]===_0x0215('0x1c')&&typeof _0x11647d['limit']===_0x0215('0x1c');var _0x4054ca=_0x120b9c[_0x0215('0x1d')];var _0x524530=_0x4ffc9c?0x0:_0x11647d[_0x0215('0x1b')];var _0x950c3=_0x4ffc9c?_0x120b9c[_0x0215('0x1d')]:_0x11647d[_0x0215('0x1b')]+_0x11647d[_0x0215('0x1e')];var _0x2a5365;if(_0x950c3>=_0x4054ca){_0x950c3=_0x4054ca;_0x2a5365=0xc8;}else{_0x2a5365=0xce;}_0x448d61[_0x0215('0x18')](_0x2a5365);return _0x448d61[_0x0215('0x1f')](_0x0215('0x20'),_0x524530+'-'+_0x950c3+'/'+_0x4054ca)['json'](_0x120b9c);}return null;};}function patchUpdates(_0x36a096){return function(_0x9c072c){try{jsonpatch[_0x0215('0x21')](_0x9c072c,_0x36a096,!![]);}catch(_0x5158af){return BPromise[_0x0215('0x22')](_0x5158af);}return _0x9c072c[_0x0215('0x23')]();};}function saveUpdates(_0x404bd6,_0x2e7dde){return function(_0x9222d7){if(_0x9222d7){return _0x9222d7[_0x0215('0x24')](_0x404bd6)[_0x0215('0x25')](function(_0x1c2cdc){return _0x1c2cdc;});}return null;};}function removeEntity(_0x298895,_0x136d92){return function(_0x4d6df4){if(_0x4d6df4){return _0x4d6df4['destroy']()[_0x0215('0x25')](function(){_0x298895['status'](0xcc)[_0x0215('0x19')]();});}};}function handleEntityNotFound(_0x4930e6,_0x55aa86){return function(_0x22ab3b){if(!_0x22ab3b){_0x4930e6[_0x0215('0x17')](0x194);}return _0x22ab3b;};}function handleError(_0x2c5885,_0x2930a2){_0x2930a2=_0x2930a2||0x1f4;return function(_0x3380c7){logger[_0x0215('0x26')](_0x3380c7[_0x0215('0x27')]);if(_0x3380c7[_0x0215('0x28')]){delete _0x3380c7[_0x0215('0x28')];}_0x2c5885['status'](_0x2930a2)[_0x0215('0x29')](_0x3380c7);};}exports[_0x0215('0x2a')]=function(_0x5aa19e,_0x57bbab){var _0x5b10f3={},_0x1e2a88={},_0x346747={'count':0x0,'rows':[]};var _0x4410f=_[_0x0215('0x2b')](db[_0x0215('0x2c')][_0x0215('0x2d')],function(_0x4e61f3){return{'name':_0x4e61f3[_0x0215('0x2e')],'type':_0x4e61f3[_0x0215('0x2f')][_0x0215('0x30')]};});_0x1e2a88[_0x0215('0x31')]=_[_0x0215('0x2b')](_0x4410f,_0x0215('0x28'));_0x1e2a88[_0x0215('0x32')]=_['keys'](_0x5aa19e[_0x0215('0x32')]);_0x1e2a88[_0x0215('0x33')]=_[_0x0215('0x34')](_0x1e2a88[_0x0215('0x31')],_0x1e2a88[_0x0215('0x32')]);_0x5b10f3[_0x0215('0x35')]=_[_0x0215('0x34')](_0x1e2a88[_0x0215('0x31')],qs[_0x0215('0x36')](_0x5aa19e[_0x0215('0x32')][_0x0215('0x36')]));_0x5b10f3[_0x0215('0x35')]=_0x5b10f3[_0x0215('0x35')][_0x0215('0x37')]?_0x5b10f3['attributes']:_0x1e2a88[_0x0215('0x31')];if(!_0x5aa19e['query'][_0x0215('0x38')](_0x0215('0x39'))){_0x5b10f3['limit']=qs[_0x0215('0x1e')](_0x5aa19e[_0x0215('0x32')][_0x0215('0x1e')]);_0x5b10f3[_0x0215('0x1b')]=qs['offset'](_0x5aa19e[_0x0215('0x32')][_0x0215('0x1b')]);}_0x5b10f3[_0x0215('0x3a')]=qs[_0x0215('0x3b')](_0x5aa19e[_0x0215('0x32')][_0x0215('0x3b')]);_0x5b10f3['where']=qs['filters'](_[_0x0215('0x3c')](_0x5aa19e[_0x0215('0x32')],_0x1e2a88['filters']),_0x4410f);if(_0x5aa19e[_0x0215('0x32')][_0x0215('0x3d')]){_0x5b10f3[_0x0215('0x3e')]=_[_0x0215('0x3f')](_0x5b10f3[_0x0215('0x3e')],{'$or':_[_0x0215('0x2b')](_0x4410f,function(_0x173b65){if(_0x173b65[_0x0215('0x2f')]!==_0x0215('0x40')){var _0xdc80e1={};_0xdc80e1[_0x173b65[_0x0215('0x28')]]={'$like':'%'+_0x5aa19e['query'][_0x0215('0x3d')]+'%'};return _0xdc80e1;}})});}_0x5b10f3=_['merge']({},_0x5b10f3,_0x5aa19e['options']);var _0x1144c5={'where':_0x5b10f3['where']};return db[_0x0215('0x2c')][_0x0215('0x1d')](_0x1144c5)[_0x0215('0x25')](function(_0x40e6c7){_0x346747['count']=_0x40e6c7;if(_0x5aa19e[_0x0215('0x32')][_0x0215('0x41')]){_0x5b10f3[_0x0215('0x42')]=[{'all':!![]}];}return db[_0x0215('0x2c')][_0x0215('0x43')](_0x5b10f3);})[_0x0215('0x25')](function(_0x45c4a1){_0x346747[_0x0215('0x44')]=_0x45c4a1;return _0x346747;})[_0x0215('0x25')](respondWithFilteredResult(_0x57bbab,_0x5b10f3))[_0x0215('0x45')](handleError(_0x57bbab,null));};exports[_0x0215('0x46')]=function(_0x24a4e7,_0x926619){var _0x3412d6={'raw':!![],'where':{'id':_0x24a4e7[_0x0215('0x47')]['id']}},_0x41fbf9={};_0x41fbf9[_0x0215('0x31')]=_[_0x0215('0x48')](db['JscriptyQuestionReport']['rawAttributes']);_0x41fbf9['query']=_[_0x0215('0x48')](_0x24a4e7['query']);_0x41fbf9[_0x0215('0x33')]=_['intersection'](_0x41fbf9[_0x0215('0x31')],_0x41fbf9[_0x0215('0x32')]);_0x3412d6[_0x0215('0x35')]=_[_0x0215('0x34')](_0x41fbf9['model'],qs[_0x0215('0x36')](_0x24a4e7[_0x0215('0x32')][_0x0215('0x36')]));_0x3412d6[_0x0215('0x35')]=_0x3412d6[_0x0215('0x35')]['length']?_0x3412d6['attributes']:_0x41fbf9['model'];if(_0x24a4e7[_0x0215('0x32')][_0x0215('0x41')]){_0x3412d6[_0x0215('0x42')]=[{'all':!![]}];}_0x3412d6=_[_0x0215('0x3f')]({},_0x3412d6,_0x24a4e7['options']);return db['JscriptyQuestionReport'][_0x0215('0x49')](_0x3412d6)[_0x0215('0x25')](handleEntityNotFound(_0x926619,null))[_0x0215('0x25')](respondWithResult(_0x926619,null))[_0x0215('0x45')](handleError(_0x926619,null));};exports['create']=function(_0x454f74,_0x14f407){return db[_0x0215('0x2c')][_0x0215('0x4a')](_0x454f74[_0x0215('0x4b')],{})['then'](respondWithResult(_0x14f407,0xc9))[_0x0215('0x45')](handleError(_0x14f407,null));};exports[_0x0215('0x24')]=function(_0x255426,_0x48302){if(_0x255426[_0x0215('0x4b')]['id']){delete _0x255426[_0x0215('0x4b')]['id'];}return db['JscriptyQuestionReport'][_0x0215('0x49')]({'where':{'id':_0x255426[_0x0215('0x47')]['id']}})['then'](handleEntityNotFound(_0x48302,null))['then'](saveUpdates(_0x255426['body'],null))[_0x0215('0x25')](respondWithResult(_0x48302,null))[_0x0215('0x45')](handleError(_0x48302,null));};exports[_0x0215('0x4c')]=function(_0x23bffe,_0x20a08a){return db[_0x0215('0x2c')][_0x0215('0x49')]({'where':{'id':_0x23bffe[_0x0215('0x47')]['id']}})['then'](handleEntityNotFound(_0x20a08a,null))[_0x0215('0x25')](removeEntity(_0x20a08a,null))['catch'](handleError(_0x20a08a,null));};exports['describe']=function(_0x301aef,_0x28e101){return db[_0x0215('0x2c')]['describe']()['then'](respondWithResult(_0x28e101,null))['catch'](handleError(_0x28e101,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index fcc0e8f..2fad960 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 _0xecd0=['../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util'];(function(_0xed42c8,_0x3647fb){var _0x10212e=function(_0x1687e1){while(--_0x1687e1){_0xed42c8['push'](_0xed42c8['shift']());}};_0x10212e(++_0x3647fb);}(_0xecd0,0x106));var _0x0ecd=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0xecd0[_0x16e0f5];return _0x4839d5;};'use strict';var _=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var logger=require(_0x0ecd('0x2'))(_0x0ecd('0x3'));var moment=require(_0x0ecd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ecd('0x5'));var rimraf=require(_0x0ecd('0x6'));var config=require(_0x0ecd('0x7'));var attributes=require(_0x0ecd('0x8'));module[_0x0ecd('0x9')]=function(_0x27ceb9,_0x22b6f2){return _0x27ceb9[_0x0ecd('0xa')](_0x0ecd('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b17=['lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x89da5f,_0x211162){var _0x3c8d40=function(_0x2145c6){while(--_0x2145c6){_0x89da5f['push'](_0x89da5f['shift']());}};_0x3c8d40(++_0x211162);}(_0x4b17,0xa8));var _0x74b1=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x4b17[_0x49052b];return _0x48c045;};'use strict';var _=require(_0x74b1('0x0'));var util=require(_0x74b1('0x1'));var logger=require(_0x74b1('0x2'))('api');var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74b1('0x4'));var rimraf=require(_0x74b1('0x5'));var config=require(_0x74b1('0x6'));var attributes=require(_0x74b1('0x7'));module[_0x74b1('0x8')]=function(_0x117851,_0x2816a6){return _0x117851[_0x74b1('0x9')](_0x74b1('0xa'),attributes,{'tableName':_0x74b1('0xb'),'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 f272dc5..f7fa27f 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 _0x5bd9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x1bd093,_0x5ef57a){var _0x5901d4=function(_0x5c866a){while(--_0x5c866a){_0x1bd093['push'](_0x1bd093['shift']());}};_0x5901d4(++_0x5ef57a);}(_0x5bd9,0xd4));var _0x95bd=function(_0x384192,_0x36805e){_0x384192=_0x384192-0x0;var _0x10e51f=_0x5bd9[_0x384192];return _0x10e51f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x95bd('0x0'));var BPromise=require(_0x95bd('0x1'));var rs=require(_0x95bd('0x2'));var fs=require('fs');var Redis=require(_0x95bd('0x3'));var db=require(_0x95bd('0x4'))['db'];var utils=require(_0x95bd('0x5'));var logger=require(_0x95bd('0x6'))(_0x95bd('0x7'));var config=require(_0x95bd('0x8'));var jayson=require(_0x95bd('0x9'));var client=jayson[_0x95bd('0xa')][_0x95bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1067c2,_0x1eff37,_0x21d645){return new BPromise(function(_0x1e0d21,_0x36272f){return client[_0x95bd('0xc')](_0x1067c2,_0x21d645)[_0x95bd('0xd')](function(_0x36e0a4){logger[_0x95bd('0xe')](_0x95bd('0xf'),_0x1eff37,_0x95bd('0x10'));logger[_0x95bd('0x11')](_0x95bd('0x12'),_0x1eff37,_0x95bd('0x10'),JSON['stringify'](_0x36e0a4));if(_0x36e0a4['error']){if(_0x36e0a4[_0x95bd('0x13')][_0x95bd('0x14')]===0x1f4){logger[_0x95bd('0x13')](_0x95bd('0xf'),_0x1eff37,_0x36e0a4['error']['message']);return _0x36272f(_0x36e0a4[_0x95bd('0x13')][_0x95bd('0x15')]);}logger[_0x95bd('0x13')](_0x95bd('0xf'),_0x1eff37,_0x36e0a4['error'][_0x95bd('0x15')]);return _0x1e0d21(_0x36e0a4['error'][_0x95bd('0x15')]);}else{logger[_0x95bd('0xe')](_0x95bd('0xf'),_0x1eff37,_0x95bd('0x10'));_0x1e0d21(_0x36e0a4[_0x95bd('0x16')][_0x95bd('0x15')]);}})[_0x95bd('0x17')](function(_0x4bae6c){logger['error'](_0x95bd('0xf'),_0x1eff37,_0x4bae6c);_0x36272f(_0x4bae6c);});});} \ No newline at end of file +var _0x038a=['catch','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result'];(function(_0x1428a1,_0x342a4c){var _0x56cd58=function(_0x2d5710){while(--_0x2d5710){_0x1428a1['push'](_0x1428a1['shift']());}};_0x56cd58(++_0x342a4c);}(_0x038a,0x17b));var _0xa038=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x038a[_0x33fcbb];return _0x2efe40;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa038('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa038('0x1'));var logger=require(_0xa038('0x2'))(_0xa038('0x3'));var config=require('../../config/environment');var jayson=require(_0xa038('0x4'));var client=jayson[_0xa038('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4df326,_0x415315,_0x15436e){return new BPromise(function(_0x18707d,_0x350d1e){return client[_0xa038('0x6')](_0x4df326,_0x15436e)['then'](function(_0x5a59eb){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x415315,_0xa038('0x7'));logger[_0xa038('0x8')](_0xa038('0x9'),_0x415315,_0xa038('0x7'),JSON[_0xa038('0xa')](_0x5a59eb));if(_0x5a59eb['error']){if(_0x5a59eb[_0xa038('0xb')][_0xa038('0xc')]===0x1f4){logger['error'](_0xa038('0xd'),_0x415315,_0x5a59eb[_0xa038('0xb')][_0xa038('0xe')]);return _0x350d1e(_0x5a59eb[_0xa038('0xb')][_0xa038('0xe')]);}logger['error'](_0xa038('0xd'),_0x415315,_0x5a59eb['error'][_0xa038('0xe')]);return _0x18707d(_0x5a59eb[_0xa038('0xb')][_0xa038('0xe')]);}else{logger[_0xa038('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x415315,_0xa038('0x7'));_0x18707d(_0x5a59eb[_0xa038('0x10')][_0xa038('0xe')]);}})[_0xa038('0x11')](function(_0x68a82e){logger[_0xa038('0xb')](_0xa038('0xd'),_0x415315,_0x68a82e);_0x350d1e(_0x68a82e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index b31a1d2..021381a 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 _0x1598=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id/questions','getQuestions','post','put','update','delete','/:id','destroy'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1598,0xe8));var _0x8159=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1598[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x8159('0x0'));var path=require(_0x8159('0x1'));var timeout=require(_0x8159('0x2'));var express=require(_0x8159('0x3'));var router=express[_0x8159('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8159('0x5'));var config=require(_0x8159('0x6'));var controller=require(_0x8159('0x7'));router[_0x8159('0x8')]('/',auth[_0x8159('0x9')](),controller['index']);router[_0x8159('0x8')](_0x8159('0xa'),auth['isAuthenticated'](),controller[_0x8159('0xb')]);router[_0x8159('0x8')]('/:id',auth[_0x8159('0x9')](),controller['show']);router[_0x8159('0x8')](_0x8159('0xc'),auth[_0x8159('0x9')](),controller[_0x8159('0xd')]);router[_0x8159('0xe')]('/',auth[_0x8159('0x9')](),controller['create']);router[_0x8159('0xf')]('/:id',auth[_0x8159('0x9')](),controller[_0x8159('0x10')]);router[_0x8159('0x11')](_0x8159('0x12'),auth['isAuthenticated'](),controller[_0x8159('0x13')]);module[_0x8159('0x14')]=router; \ No newline at end of file +var _0x880e=['show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x420d7f,_0x5d6d8c){var _0x2cca2c=function(_0x50cbad){while(--_0x50cbad){_0x420d7f['push'](_0x420d7f['shift']());}};_0x2cca2c(++_0x5d6d8c);}(_0x880e,0x151));var _0xe880=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x880e[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0xe880('0x0'));var util=require('util');var path=require(_0xe880('0x1'));var timeout=require(_0xe880('0x2'));var express=require(_0xe880('0x3'));var router=express[_0xe880('0x4')]();var fs_extra=require(_0xe880('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe880('0x6'));var config=require(_0xe880('0x7'));var controller=require(_0xe880('0x8'));router[_0xe880('0x9')]('/',auth['isAuthenticated'](),controller[_0xe880('0xa')]);router['get'](_0xe880('0xb'),auth['isAuthenticated'](),controller[_0xe880('0xc')]);router['get'](_0xe880('0xd'),auth[_0xe880('0xe')](),controller[_0xe880('0xf')]);router[_0xe880('0x9')]('/:id/questions',auth[_0xe880('0xe')](),controller['getQuestions']);router[_0xe880('0x10')]('/',auth[_0xe880('0xe')](),controller[_0xe880('0x11')]);router[_0xe880('0x12')](_0xe880('0xd'),auth['isAuthenticated'](),controller[_0xe880('0x13')]);router['delete'](_0xe880('0xd'),auth[_0xe880('0xe')](),controller[_0xe880('0x14')]);module[_0xe880('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a652ffc..c796bc5 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 _0xdadf=['BOOLEAN','moment','sequelize','exports','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x4a5bb8,_0x6117ec){var _0x3208dd=function(_0x370689){while(--_0x370689){_0x4a5bb8['push'](_0x4a5bb8['shift']());}};_0x3208dd(++_0x6117ec);}(_0xdadf,0xc7));var _0xfdad=function(_0x1a789e,_0x2c32e6){_0x1a789e=_0x1a789e-0x0;var _0x5bec6c=_0xdadf[_0x1a789e];return _0x5bec6c;};'use strict';var moment=require(_0xfdad('0x0'));var Sequelize=require(_0xfdad('0x1'));module[_0xfdad('0x2')]={'starttime':{'type':Sequelize[_0xfdad('0x3')],'set':function(_0x546a87){this['setDataValue'](_0xfdad('0x4'),_0x546a87);this[_0xfdad('0x5')](_0xfdad('0x6'),moment()[_0xfdad('0x7')](_0xfdad('0x8')));}},'endtime':{'type':Sequelize[_0xfdad('0x3')]},'membername':{'type':Sequelize[_0xfdad('0x9')]},'projectname':{'type':Sequelize[_0xfdad('0x9')]},'queue':{'type':Sequelize[_0xfdad('0x9')]},'uniqueid':{'type':Sequelize[_0xfdad('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xfdad('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x3210=['STRING','moment','exports','DATE','setDataValue','starttime','format'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x3210,0x19e));var _0x0321=function(_0x3a39f5,_0x13d772){_0x3a39f5=_0x3a39f5-0x0;var _0x471b3c=_0x3210[_0x3a39f5];return _0x471b3c;};'use strict';var moment=require(_0x0321('0x0'));var Sequelize=require('sequelize');module[_0x0321('0x1')]={'starttime':{'type':Sequelize[_0x0321('0x2')],'set':function(_0x5648b5){this[_0x0321('0x3')](_0x0321('0x4'),_0x5648b5);this[_0x0321('0x3')]('endtime',moment()[_0x0321('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x0321('0x2')]},'membername':{'type':Sequelize[_0x0321('0x6')]},'projectname':{'type':Sequelize[_0x0321('0x6')]},'queue':{'type':Sequelize[_0x0321('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0321('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 9672239..237faf7 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 _0x1c77=['Content-Range','apply','save','update','then','destroy','end','error','stack','send','index','JscriptySessionReport','rawAttributes','type','key','model','map','name','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','fields','options','find','create','body','catch','describe','getQuestions','JscriptyQuestionReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2dbaf2,_0x154796){var _0xaefe7c=function(_0x1a89c2){while(--_0x1a89c2){_0x2dbaf2['push'](_0x2dbaf2['shift']());}};_0xaefe7c(++_0x154796);}(_0x1c77,0x167));var _0x71c7=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x1c77[_0x217c2e];return _0x22b7d8;};'use strict';var emlformat=require(_0x71c7('0x0'));var rimraf=require(_0x71c7('0x1'));var zipdir=require(_0x71c7('0x2'));var jsonpatch=require(_0x71c7('0x3'));var rp=require(_0x71c7('0x4'));var moment=require(_0x71c7('0x5'));var BPromise=require(_0x71c7('0x6'));var Mustache=require(_0x71c7('0x7'));var util=require('util');var path=require(_0x71c7('0x8'));var sox=require('sox');var csv=require(_0x71c7('0x9'));var ejs=require(_0x71c7('0xa'));var fs=require('fs');var fs_extra=require(_0x71c7('0xb'));var _=require(_0x71c7('0xc'));var squel=require('squel');var crypto=require(_0x71c7('0xd'));var jsforce=require(_0x71c7('0xe'));var deskjs=require(_0x71c7('0xf'));var toCsv=require(_0x71c7('0x9'));var querystring=require('querystring');var Papa=require(_0x71c7('0x10'));var Redis=require('ioredis');var authService=require(_0x71c7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71c7('0x12'));var logger=require(_0x71c7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x71c7('0x14'));var licenseUtil=require(_0x71c7('0x15'));var db=require(_0x71c7('0x16'))['db'];function respondWithStatusCode(_0x1398a3,_0x30f975){_0x30f975=_0x30f975||0xcc;return function(_0x4d902b){if(_0x4d902b){return _0x1398a3[_0x71c7('0x17')](_0x30f975);}return _0x1398a3[_0x71c7('0x18')](_0x30f975)['end']();};}function respondWithResult(_0x2a3049,_0x1be61c){_0x1be61c=_0x1be61c||0xc8;return function(_0x47060d){if(_0x47060d){return _0x2a3049[_0x71c7('0x18')](_0x1be61c)[_0x71c7('0x19')](_0x47060d);}};}function respondWithFilteredResult(_0x61d42c,_0x319b96){return function(_0x51d5d8){if(_0x51d5d8){var _0xc587e=typeof _0x319b96[_0x71c7('0x1a')]===_0x71c7('0x1b')&&typeof _0x319b96[_0x71c7('0x1c')]===_0x71c7('0x1b');var _0x273e5d=_0x51d5d8[_0x71c7('0x1d')];var _0x3271d0=_0xc587e?0x0:_0x319b96[_0x71c7('0x1a')];var _0x1c8ef4=_0xc587e?_0x51d5d8['count']:_0x319b96[_0x71c7('0x1a')]+_0x319b96['limit'];var _0x9b25e7;if(_0x1c8ef4>=_0x273e5d){_0x1c8ef4=_0x273e5d;_0x9b25e7=0xc8;}else{_0x9b25e7=0xce;}_0x61d42c['status'](_0x9b25e7);return _0x61d42c[_0x71c7('0x1e')](_0x71c7('0x1f'),_0x3271d0+'-'+_0x1c8ef4+'/'+_0x273e5d)['json'](_0x51d5d8);}return null;};}function patchUpdates(_0x41c0af){return function(_0x71da58){try{jsonpatch[_0x71c7('0x20')](_0x71da58,_0x41c0af,!![]);}catch(_0xd6fc29){return BPromise['reject'](_0xd6fc29);}return _0x71da58[_0x71c7('0x21')]();};}function saveUpdates(_0x269478,_0x34ae86){return function(_0x5a23e3){if(_0x5a23e3){return _0x5a23e3[_0x71c7('0x22')](_0x269478)[_0x71c7('0x23')](function(_0x24ef21){return _0x24ef21;});}return null;};}function removeEntity(_0x21e90e,_0x332098){return function(_0x43db60){if(_0x43db60){return _0x43db60[_0x71c7('0x24')]()[_0x71c7('0x23')](function(){_0x21e90e[_0x71c7('0x18')](0xcc)[_0x71c7('0x25')]();});}};}function handleEntityNotFound(_0x4d79f3,_0x890fa){return function(_0x148356){if(!_0x148356){_0x4d79f3[_0x71c7('0x17')](0x194);}return _0x148356;};}function handleError(_0x570ec8,_0x5ad435){_0x5ad435=_0x5ad435||0x1f4;return function(_0x1225f0){logger[_0x71c7('0x26')](_0x1225f0[_0x71c7('0x27')]);if(_0x1225f0['name']){delete _0x1225f0['name'];}_0x570ec8[_0x71c7('0x18')](_0x5ad435)[_0x71c7('0x28')](_0x1225f0);};}exports[_0x71c7('0x29')]=function(_0x100d15,_0x590e95){var _0x4f979a={},_0x89454b={},_0x31d775={'count':0x0,'rows':[]};var _0x10fec1=_['map'](db[_0x71c7('0x2a')][_0x71c7('0x2b')],function(_0x2d74f6){return{'name':_0x2d74f6['fieldName'],'type':_0x2d74f6[_0x71c7('0x2c')][_0x71c7('0x2d')]};});_0x89454b[_0x71c7('0x2e')]=_[_0x71c7('0x2f')](_0x10fec1,_0x71c7('0x30'));_0x89454b[_0x71c7('0x31')]=_[_0x71c7('0x32')](_0x100d15['query']);_0x89454b['filters']=_[_0x71c7('0x33')](_0x89454b[_0x71c7('0x2e')],_0x89454b[_0x71c7('0x31')]);_0x4f979a[_0x71c7('0x34')]=_[_0x71c7('0x33')](_0x89454b[_0x71c7('0x2e')],qs['fields'](_0x100d15[_0x71c7('0x31')]['fields']));_0x4f979a[_0x71c7('0x34')]=_0x4f979a[_0x71c7('0x34')][_0x71c7('0x35')]?_0x4f979a['attributes']:_0x89454b[_0x71c7('0x2e')];if(!_0x100d15[_0x71c7('0x31')][_0x71c7('0x36')](_0x71c7('0x37'))){_0x4f979a['limit']=qs[_0x71c7('0x1c')](_0x100d15[_0x71c7('0x31')][_0x71c7('0x1c')]);_0x4f979a[_0x71c7('0x1a')]=qs[_0x71c7('0x1a')](_0x100d15[_0x71c7('0x31')][_0x71c7('0x1a')]);}_0x4f979a[_0x71c7('0x38')]=qs[_0x71c7('0x39')](_0x100d15[_0x71c7('0x31')][_0x71c7('0x39')]);_0x4f979a[_0x71c7('0x3a')]=qs[_0x71c7('0x3b')](_['pick'](_0x100d15[_0x71c7('0x31')],_0x89454b[_0x71c7('0x3b')]),_0x10fec1);if(_0x100d15['query'][_0x71c7('0x3c')]){_0x4f979a['where']=_[_0x71c7('0x3d')](_0x4f979a['where'],{'$or':_[_0x71c7('0x2f')](_0x10fec1,function(_0x5eff93){if(_0x5eff93['type']!==_0x71c7('0x3e')){var _0x14578d={};_0x14578d[_0x5eff93[_0x71c7('0x30')]]={'$like':'%'+_0x100d15[_0x71c7('0x31')][_0x71c7('0x3c')]+'%'};return _0x14578d;}})});}_0x4f979a=_[_0x71c7('0x3d')]({},_0x4f979a,_0x100d15['options']);var _0x49878e={'where':_0x4f979a[_0x71c7('0x3a')]};return db[_0x71c7('0x2a')]['count'](_0x49878e)['then'](function(_0x50c014){_0x31d775[_0x71c7('0x1d')]=_0x50c014;if(_0x100d15[_0x71c7('0x31')][_0x71c7('0x3f')]){_0x4f979a[_0x71c7('0x40')]=[{'all':!![]}];}return db[_0x71c7('0x2a')][_0x71c7('0x41')](_0x4f979a);})['then'](function(_0x34b574){_0x31d775['rows']=_0x34b574;return _0x31d775;})[_0x71c7('0x23')](respondWithFilteredResult(_0x590e95,_0x4f979a))['catch'](handleError(_0x590e95,null));};exports[_0x71c7('0x42')]=function(_0x3389d2,_0x27a4a2){var _0x2f3b0c={'raw':!![],'where':{'id':_0x3389d2[_0x71c7('0x43')]['id']}},_0x332f2b={};_0x332f2b[_0x71c7('0x2e')]=_[_0x71c7('0x32')](db[_0x71c7('0x2a')][_0x71c7('0x2b')]);_0x332f2b[_0x71c7('0x31')]=_[_0x71c7('0x32')](_0x3389d2[_0x71c7('0x31')]);_0x332f2b[_0x71c7('0x3b')]=_[_0x71c7('0x33')](_0x332f2b[_0x71c7('0x2e')],_0x332f2b['query']);_0x2f3b0c[_0x71c7('0x34')]=_[_0x71c7('0x33')](_0x332f2b[_0x71c7('0x2e')],qs['fields'](_0x3389d2[_0x71c7('0x31')][_0x71c7('0x44')]));_0x2f3b0c[_0x71c7('0x34')]=_0x2f3b0c[_0x71c7('0x34')]['length']?_0x2f3b0c[_0x71c7('0x34')]:_0x332f2b['model'];if(_0x3389d2[_0x71c7('0x31')][_0x71c7('0x3f')]){_0x2f3b0c[_0x71c7('0x40')]=[{'all':!![]}];}_0x2f3b0c=_[_0x71c7('0x3d')]({},_0x2f3b0c,_0x3389d2[_0x71c7('0x45')]);return db[_0x71c7('0x2a')][_0x71c7('0x46')](_0x2f3b0c)[_0x71c7('0x23')](handleEntityNotFound(_0x27a4a2,null))['then'](respondWithResult(_0x27a4a2,null))['catch'](handleError(_0x27a4a2,null));};exports[_0x71c7('0x47')]=function(_0x4e5c06,_0x94b680){return db[_0x71c7('0x2a')][_0x71c7('0x47')](_0x4e5c06[_0x71c7('0x48')],{})['then'](respondWithResult(_0x94b680,0xc9))[_0x71c7('0x49')](handleError(_0x94b680,null));};exports[_0x71c7('0x22')]=function(_0x9e28e4,_0x7c7732){if(_0x9e28e4['body']['id']){delete _0x9e28e4[_0x71c7('0x48')]['id'];}return db[_0x71c7('0x2a')][_0x71c7('0x46')]({'where':{'id':_0x9e28e4['params']['id']}})[_0x71c7('0x23')](handleEntityNotFound(_0x7c7732,null))[_0x71c7('0x23')](saveUpdates(_0x9e28e4[_0x71c7('0x48')],null))[_0x71c7('0x23')](respondWithResult(_0x7c7732,null))[_0x71c7('0x49')](handleError(_0x7c7732,null));};exports[_0x71c7('0x24')]=function(_0x39b634,_0x937654){return db[_0x71c7('0x2a')]['find']({'where':{'id':_0x39b634[_0x71c7('0x43')]['id']}})[_0x71c7('0x23')](handleEntityNotFound(_0x937654,null))[_0x71c7('0x23')](removeEntity(_0x937654,null))['catch'](handleError(_0x937654,null));};exports[_0x71c7('0x4a')]=function(_0x3bf483,_0x2a4ff9){return db[_0x71c7('0x2a')][_0x71c7('0x4a')]()[_0x71c7('0x23')](respondWithResult(_0x2a4ff9,null))[_0x71c7('0x49')](handleError(_0x2a4ff9,null));};exports[_0x71c7('0x4b')]=function(_0xb0b59b,_0x2bd7a7,_0x74a222){var _0x4d504f={'raw':!![],'where':{}};var _0x4ed5f6={};var _0x1e6480={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0xb0b59b[_0x71c7('0x43')]['id']}})[_0x71c7('0x23')](handleEntityNotFound(_0x2bd7a7,null))['then'](function(_0x8a2f13){if(_0x8a2f13){_0x4ed5f6[_0x71c7('0x2e')]=_['keys'](db[_0x71c7('0x4c')][_0x71c7('0x2b')]);_0x4ed5f6['query']=_['keys'](_0xb0b59b[_0x71c7('0x31')]);_0x4ed5f6[_0x71c7('0x3b')]=_[_0x71c7('0x33')](_0x4ed5f6[_0x71c7('0x2e')],_0x4ed5f6[_0x71c7('0x31')]);_0x4d504f[_0x71c7('0x34')]=_[_0x71c7('0x33')](_0x4ed5f6['model'],qs[_0x71c7('0x44')](_0xb0b59b[_0x71c7('0x31')]['fields']));_0x4d504f[_0x71c7('0x34')]=_0x4d504f[_0x71c7('0x34')][_0x71c7('0x35')]?_0x4d504f[_0x71c7('0x34')]:_0x4ed5f6[_0x71c7('0x2e')];if(!_0xb0b59b[_0x71c7('0x31')][_0x71c7('0x36')](_0x71c7('0x37'))){_0x4d504f[_0x71c7('0x1c')]=qs[_0x71c7('0x1c')](_0xb0b59b['query'][_0x71c7('0x1c')]);_0x4d504f['offset']=qs[_0x71c7('0x1a')](_0xb0b59b[_0x71c7('0x31')][_0x71c7('0x1a')]);}_0x4d504f[_0x71c7('0x38')]=qs[_0x71c7('0x39')](_0xb0b59b[_0x71c7('0x31')][_0x71c7('0x39')]);_0x4d504f[_0x71c7('0x3a')]=qs[_0x71c7('0x3b')](_['pick'](_0xb0b59b[_0x71c7('0x31')],_0x4ed5f6['filters']));_0x4d504f[_0x71c7('0x3a')]['SessionId']=_0x8a2f13['id'];if(_0xb0b59b[_0x71c7('0x31')]['filter']){_0x4d504f[_0x71c7('0x3a')]=_[_0x71c7('0x3d')](_0x4d504f[_0x71c7('0x3a')],{'$or':_['map'](_0x4d504f[_0x71c7('0x34')],function(_0x4f37d3){var _0x4bfabc={};_0x4bfabc[_0x4f37d3]={'$like':'%'+_0xb0b59b[_0x71c7('0x31')][_0x71c7('0x3c')]+'%'};return _0x4bfabc;})});}_0x4d504f=_[_0x71c7('0x3d')]({},_0x4d504f,_0xb0b59b[_0x71c7('0x45')]);return db[_0x71c7('0x4c')][_0x71c7('0x1d')]({'where':_0x4d504f[_0x71c7('0x3a')]})[_0x71c7('0x23')](function(_0x592303){_0x1e6480['count']=_0x592303;if(_0xb0b59b[_0x71c7('0x31')][_0x71c7('0x3f')]){_0x4d504f['include']=[{'all':!![]}];}return db[_0x71c7('0x4c')]['findAll'](_0x4d504f);})['then'](function(_0x5e1433){_0x1e6480[_0x71c7('0x4d')]=_0x5e1433;return _0x1e6480;});}})[_0x71c7('0x23')](respondWithFilteredResult(_0x2bd7a7,_0x4d504f))[_0x71c7('0x49')](handleError(_0x2bd7a7,null));}; \ No newline at end of file +var _0x221f=['params','keys','rawAttributes','fields','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','includeAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','JscriptySessionReport','include','findAll','rows','catch','show'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x221f,0x1b2));var _0xf221=function(_0x5e2489,_0x2fd8be){_0x5e2489=_0x5e2489-0x0;var _0xa87596=_0x221f[_0x5e2489];return _0xa87596;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf221('0x0'));var zipdir=require(_0xf221('0x1'));var jsonpatch=require(_0xf221('0x2'));var rp=require('request-promise');var moment=require(_0xf221('0x3'));var BPromise=require(_0xf221('0x4'));var Mustache=require(_0xf221('0x5'));var util=require(_0xf221('0x6'));var path=require(_0xf221('0x7'));var sox=require(_0xf221('0x8'));var csv=require(_0xf221('0x9'));var ejs=require(_0xf221('0xa'));var fs=require('fs');var fs_extra=require(_0xf221('0xb'));var _=require(_0xf221('0xc'));var squel=require(_0xf221('0xd'));var crypto=require(_0xf221('0xe'));var jsforce=require(_0xf221('0xf'));var deskjs=require(_0xf221('0x10'));var toCsv=require(_0xf221('0x9'));var querystring=require(_0xf221('0x11'));var Papa=require('papaparse');var Redis=require(_0xf221('0x12'));var authService=require(_0xf221('0x13'));var qs=require(_0xf221('0x14'));var as=require(_0xf221('0x15'));var hardwareService=require(_0xf221('0x16'));var logger=require(_0xf221('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xf221('0x18'));var licenseUtil=require(_0xf221('0x19'));var db=require(_0xf221('0x1a'))['db'];function respondWithStatusCode(_0x918ca6,_0x230002){_0x230002=_0x230002||0xcc;return function(_0x4405cf){if(_0x4405cf){return _0x918ca6[_0xf221('0x1b')](_0x230002);}return _0x918ca6[_0xf221('0x1c')](_0x230002)[_0xf221('0x1d')]();};}function respondWithResult(_0x3e8418,_0x5d962e){_0x5d962e=_0x5d962e||0xc8;return function(_0x4fb4ca){if(_0x4fb4ca){return _0x3e8418[_0xf221('0x1c')](_0x5d962e)[_0xf221('0x1e')](_0x4fb4ca);}};}function respondWithFilteredResult(_0x15336f,_0x355084){return function(_0x1958e0){if(_0x1958e0){var _0x5cad89=typeof _0x355084[_0xf221('0x1f')]===_0xf221('0x20')&&typeof _0x355084[_0xf221('0x21')]===_0xf221('0x20');var _0x4307c9=_0x1958e0[_0xf221('0x22')];var _0x24fcef=_0x5cad89?0x0:_0x355084[_0xf221('0x1f')];var _0x3b73ff=_0x5cad89?_0x1958e0[_0xf221('0x22')]:_0x355084[_0xf221('0x1f')]+_0x355084[_0xf221('0x21')];var _0x5d8852;if(_0x3b73ff>=_0x4307c9){_0x3b73ff=_0x4307c9;_0x5d8852=0xc8;}else{_0x5d8852=0xce;}_0x15336f[_0xf221('0x1c')](_0x5d8852);return _0x15336f[_0xf221('0x23')](_0xf221('0x24'),_0x24fcef+'-'+_0x3b73ff+'/'+_0x4307c9)[_0xf221('0x1e')](_0x1958e0);}return null;};}function patchUpdates(_0x358277){return function(_0x59b785){try{jsonpatch[_0xf221('0x25')](_0x59b785,_0x358277,!![]);}catch(_0x45b4eb){return BPromise[_0xf221('0x26')](_0x45b4eb);}return _0x59b785[_0xf221('0x27')]();};}function saveUpdates(_0x5cd29b,_0x3465a7){return function(_0x137704){if(_0x137704){return _0x137704[_0xf221('0x28')](_0x5cd29b)[_0xf221('0x29')](function(_0x70e7da){return _0x70e7da;});}return null;};}function removeEntity(_0x44bf3e,_0x563738){return function(_0x1efcca){if(_0x1efcca){return _0x1efcca[_0xf221('0x2a')]()[_0xf221('0x29')](function(){_0x44bf3e[_0xf221('0x1c')](0xcc)[_0xf221('0x1d')]();});}};}function handleEntityNotFound(_0x577aa7,_0x59b3b0){return function(_0x23eb21){if(!_0x23eb21){_0x577aa7[_0xf221('0x1b')](0x194);}return _0x23eb21;};}function handleError(_0x146e20,_0xa3b9c2){_0xa3b9c2=_0xa3b9c2||0x1f4;return function(_0x402df2){logger[_0xf221('0x2b')](_0x402df2['stack']);if(_0x402df2['name']){delete _0x402df2[_0xf221('0x2c')];}_0x146e20[_0xf221('0x1c')](_0xa3b9c2)[_0xf221('0x2d')](_0x402df2);};}exports[_0xf221('0x2e')]=function(_0x50c638,_0x1c6ba8){var _0x56ad3a={},_0x135d98={},_0x3eba50={'count':0x0,'rows':[]};var _0x48eff8=_[_0xf221('0x2f')](db['JscriptySessionReport']['rawAttributes'],function(_0x10d273){return{'name':_0x10d273[_0xf221('0x30')],'type':_0x10d273[_0xf221('0x31')][_0xf221('0x32')]};});_0x135d98[_0xf221('0x33')]=_[_0xf221('0x2f')](_0x48eff8,_0xf221('0x2c'));_0x135d98[_0xf221('0x34')]=_['keys'](_0x50c638[_0xf221('0x34')]);_0x135d98[_0xf221('0x35')]=_[_0xf221('0x36')](_0x135d98[_0xf221('0x33')],_0x135d98[_0xf221('0x34')]);_0x56ad3a['attributes']=_[_0xf221('0x36')](_0x135d98['model'],qs['fields'](_0x50c638[_0xf221('0x34')]['fields']));_0x56ad3a[_0xf221('0x37')]=_0x56ad3a[_0xf221('0x37')][_0xf221('0x38')]?_0x56ad3a['attributes']:_0x135d98[_0xf221('0x33')];if(!_0x50c638[_0xf221('0x34')][_0xf221('0x39')](_0xf221('0x3a'))){_0x56ad3a[_0xf221('0x21')]=qs[_0xf221('0x21')](_0x50c638[_0xf221('0x34')]['limit']);_0x56ad3a['offset']=qs[_0xf221('0x1f')](_0x50c638[_0xf221('0x34')]['offset']);}_0x56ad3a['order']=qs[_0xf221('0x3b')](_0x50c638['query'][_0xf221('0x3b')]);_0x56ad3a[_0xf221('0x3c')]=qs[_0xf221('0x35')](_[_0xf221('0x3d')](_0x50c638[_0xf221('0x34')],_0x135d98[_0xf221('0x35')]),_0x48eff8);if(_0x50c638['query'][_0xf221('0x3e')]){_0x56ad3a[_0xf221('0x3c')]=_[_0xf221('0x3f')](_0x56ad3a[_0xf221('0x3c')],{'$or':_[_0xf221('0x2f')](_0x48eff8,function(_0x1d039f){if(_0x1d039f[_0xf221('0x31')]!=='VIRTUAL'){var _0x5261f5={};_0x5261f5[_0x1d039f[_0xf221('0x2c')]]={'$like':'%'+_0x50c638[_0xf221('0x34')]['filter']+'%'};return _0x5261f5;}})});}_0x56ad3a=_['merge']({},_0x56ad3a,_0x50c638['options']);var _0x3789b4={'where':_0x56ad3a[_0xf221('0x3c')]};return db[_0xf221('0x40')][_0xf221('0x22')](_0x3789b4)['then'](function(_0x43b7c4){_0x3eba50[_0xf221('0x22')]=_0x43b7c4;if(_0x50c638[_0xf221('0x34')]['includeAll']){_0x56ad3a[_0xf221('0x41')]=[{'all':!![]}];}return db[_0xf221('0x40')][_0xf221('0x42')](_0x56ad3a);})[_0xf221('0x29')](function(_0x22390e){_0x3eba50[_0xf221('0x43')]=_0x22390e;return _0x3eba50;})[_0xf221('0x29')](respondWithFilteredResult(_0x1c6ba8,_0x56ad3a))[_0xf221('0x44')](handleError(_0x1c6ba8,null));};exports[_0xf221('0x45')]=function(_0x4849b6,_0x215b26){var _0x2a9b55={'raw':!![],'where':{'id':_0x4849b6[_0xf221('0x46')]['id']}},_0x46dda9={};_0x46dda9[_0xf221('0x33')]=_[_0xf221('0x47')](db[_0xf221('0x40')][_0xf221('0x48')]);_0x46dda9[_0xf221('0x34')]=_[_0xf221('0x47')](_0x4849b6['query']);_0x46dda9[_0xf221('0x35')]=_[_0xf221('0x36')](_0x46dda9['model'],_0x46dda9['query']);_0x2a9b55[_0xf221('0x37')]=_[_0xf221('0x36')](_0x46dda9['model'],qs[_0xf221('0x49')](_0x4849b6['query'][_0xf221('0x49')]));_0x2a9b55['attributes']=_0x2a9b55[_0xf221('0x37')][_0xf221('0x38')]?_0x2a9b55['attributes']:_0x46dda9[_0xf221('0x33')];if(_0x4849b6['query']['includeAll']){_0x2a9b55[_0xf221('0x41')]=[{'all':!![]}];}_0x2a9b55=_[_0xf221('0x3f')]({},_0x2a9b55,_0x4849b6[_0xf221('0x4a')]);return db[_0xf221('0x40')][_0xf221('0x4b')](_0x2a9b55)[_0xf221('0x29')](handleEntityNotFound(_0x215b26,null))[_0xf221('0x29')](respondWithResult(_0x215b26,null))[_0xf221('0x44')](handleError(_0x215b26,null));};exports['create']=function(_0x56377a,_0x331063){return db[_0xf221('0x40')][_0xf221('0x4c')](_0x56377a[_0xf221('0x4d')],{})[_0xf221('0x29')](respondWithResult(_0x331063,0xc9))[_0xf221('0x44')](handleError(_0x331063,null));};exports[_0xf221('0x28')]=function(_0x3cb245,_0x3f2694){if(_0x3cb245[_0xf221('0x4d')]['id']){delete _0x3cb245['body']['id'];}return db[_0xf221('0x40')][_0xf221('0x4b')]({'where':{'id':_0x3cb245[_0xf221('0x46')]['id']}})[_0xf221('0x29')](handleEntityNotFound(_0x3f2694,null))[_0xf221('0x29')](saveUpdates(_0x3cb245[_0xf221('0x4d')],null))[_0xf221('0x29')](respondWithResult(_0x3f2694,null))['catch'](handleError(_0x3f2694,null));};exports[_0xf221('0x2a')]=function(_0x20e12d,_0x35e392){return db[_0xf221('0x40')][_0xf221('0x4b')]({'where':{'id':_0x20e12d['params']['id']}})[_0xf221('0x29')](handleEntityNotFound(_0x35e392,null))[_0xf221('0x29')](removeEntity(_0x35e392,null))[_0xf221('0x44')](handleError(_0x35e392,null));};exports[_0xf221('0x4e')]=function(_0x29b185,_0x2f5fdd){return db[_0xf221('0x40')][_0xf221('0x4e')]()[_0xf221('0x29')](respondWithResult(_0x2f5fdd,null))['catch'](handleError(_0x2f5fdd,null));};exports[_0xf221('0x4f')]=function(_0xd58b8b,_0x1aff6f,_0x2648d2){var _0x274a94={'raw':!![],'where':{}};var _0x4f813d={};var _0x9f68af={'count':0x0,'rows':[]};return db[_0xf221('0x40')][_0xf221('0x50')]({'where':{'id':_0xd58b8b['params']['id']}})['then'](handleEntityNotFound(_0x1aff6f,null))['then'](function(_0x4d5447){if(_0x4d5447){_0x4f813d['model']=_['keys'](db[_0xf221('0x51')][_0xf221('0x48')]);_0x4f813d[_0xf221('0x34')]=_[_0xf221('0x47')](_0xd58b8b[_0xf221('0x34')]);_0x4f813d[_0xf221('0x35')]=_['intersection'](_0x4f813d['model'],_0x4f813d[_0xf221('0x34')]);_0x274a94[_0xf221('0x37')]=_[_0xf221('0x36')](_0x4f813d[_0xf221('0x33')],qs[_0xf221('0x49')](_0xd58b8b['query']['fields']));_0x274a94[_0xf221('0x37')]=_0x274a94[_0xf221('0x37')][_0xf221('0x38')]?_0x274a94[_0xf221('0x37')]:_0x4f813d[_0xf221('0x33')];if(!_0xd58b8b['query'][_0xf221('0x39')](_0xf221('0x3a'))){_0x274a94['limit']=qs[_0xf221('0x21')](_0xd58b8b['query'][_0xf221('0x21')]);_0x274a94[_0xf221('0x1f')]=qs[_0xf221('0x1f')](_0xd58b8b[_0xf221('0x34')]['offset']);}_0x274a94['order']=qs[_0xf221('0x3b')](_0xd58b8b[_0xf221('0x34')][_0xf221('0x3b')]);_0x274a94[_0xf221('0x3c')]=qs[_0xf221('0x35')](_[_0xf221('0x3d')](_0xd58b8b['query'],_0x4f813d[_0xf221('0x35')]));_0x274a94[_0xf221('0x3c')][_0xf221('0x52')]=_0x4d5447['id'];if(_0xd58b8b[_0xf221('0x34')]['filter']){_0x274a94['where']=_[_0xf221('0x3f')](_0x274a94[_0xf221('0x3c')],{'$or':_[_0xf221('0x2f')](_0x274a94['attributes'],function(_0x41ca45){var _0x23bbfb={};_0x23bbfb[_0x41ca45]={'$like':'%'+_0xd58b8b[_0xf221('0x34')][_0xf221('0x3e')]+'%'};return _0x23bbfb;})});}_0x274a94=_[_0xf221('0x3f')]({},_0x274a94,_0xd58b8b['options']);return db[_0xf221('0x51')]['count']({'where':_0x274a94[_0xf221('0x3c')]})[_0xf221('0x29')](function(_0x4af5da){_0x9f68af[_0xf221('0x22')]=_0x4af5da;if(_0xd58b8b[_0xf221('0x34')][_0xf221('0x53')]){_0x274a94[_0xf221('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x274a94);})[_0xf221('0x29')](function(_0x21fd73){_0x9f68af[_0xf221('0x43')]=_0x21fd73;return _0x9f68af;});}})[_0xf221('0x29')](respondWithFilteredResult(_0x1aff6f,_0x274a94))[_0xf221('0x44')](handleError(_0x1aff6f,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2245d27..d5c3053 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 _0x90b1=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2c5cc8,_0x1ee384){var _0x439d8e=function(_0x376730){while(--_0x376730){_0x2c5cc8['push'](_0x2c5cc8['shift']());}};_0x439d8e(++_0x1ee384);}(_0x90b1,0x1bb));var _0x190b=function(_0x590cf1,_0x1ed895){_0x590cf1=_0x590cf1-0x0;var _0x57e326=_0x90b1[_0x590cf1];return _0x57e326;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x39f042,_0x5244aa){var _0x1ff7e9=function(_0x32dcec){while(--_0x32dcec){_0x39f042['push'](_0x39f042['shift']());}};_0x1ff7e9(++_0x5244aa);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x15b790,_0x18d4b2){_0x15b790=_0x15b790-0x0;var _0x4cd91d=_0xbd51[_0x15b790];return _0x4cd91d;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 99c9531..fd5f28e 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 _0x7046=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x49c398,_0x54ee8f){var _0xd91b26=function(_0x2ce039){while(--_0x2ce039){_0x49c398['push'](_0x49c398['shift']());}};_0xd91b26(++_0x54ee8f);}(_0x7046,0x144));var _0x6704=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7046[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});} \ No newline at end of file +var _0x5464=['info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x350aa4,_0x29cbe7){var _0x24d9f3=function(_0x1f62fc){while(--_0x1f62fc){_0x350aa4['push'](_0x350aa4['shift']());}};_0x24d9f3(++_0x29cbe7);}(_0x5464,0x15d));var _0x4546=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0x5464[_0x3c59fc];return _0x2b78d4;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 7098b2c..1704898 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 _0x4f6c=['Router','fs-extra','../../components/auth/service','./license.controller','index','put','/:id','isAuthenticated','update','exports','multer','util','path','express'];(function(_0x304fec,_0x11dd30){var _0x4b591b=function(_0x48b84e){while(--_0x48b84e){_0x304fec['push'](_0x304fec['shift']());}};_0x4b591b(++_0x11dd30);}(_0x4f6c,0x176));var _0xc4f6=function(_0x1732a8,_0x232ad3){_0x1732a8=_0x1732a8-0x0;var _0x3036a1=_0x4f6c[_0x1732a8];return _0x3036a1;};'use strict';var multer=require(_0xc4f6('0x0'));var util=require(_0xc4f6('0x1'));var path=require(_0xc4f6('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4f6('0x3'));var router=express[_0xc4f6('0x4')]();var fs_extra=require(_0xc4f6('0x5'));var auth=require(_0xc4f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc4f6('0x7'));router['get']('/',controller[_0xc4f6('0x8')]);router[_0xc4f6('0x9')](_0xc4f6('0xa'),auth[_0xc4f6('0xb')](),controller[_0xc4f6('0xc')]);module[_0xc4f6('0xd')]=router; \ No newline at end of file +var _0x0eab=['put','/:id','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x5774f2,_0x4905bb){var _0x483f77=function(_0xc0b9f3){while(--_0xc0b9f3){_0x5774f2['push'](_0x5774f2['shift']());}};_0x483f77(++_0x4905bb);}(_0x0eab,0x1d4));var _0xb0ea=function(_0x333d48,_0xf8dcd9){_0x333d48=_0x333d48-0x0;var _0xf892b5=_0x0eab[_0x333d48];return _0xf892b5;};'use strict';var multer=require(_0xb0ea('0x0'));var util=require(_0xb0ea('0x1'));var path=require(_0xb0ea('0x2'));var timeout=require(_0xb0ea('0x3'));var express=require(_0xb0ea('0x4'));var router=express[_0xb0ea('0x5')]();var fs_extra=require(_0xb0ea('0x6'));var auth=require(_0xb0ea('0x7'));var interaction=require(_0xb0ea('0x8'));var config=require(_0xb0ea('0x9'));var controller=require('./license.controller');router[_0xb0ea('0xa')]('/',controller[_0xb0ea('0xb')]);router[_0xb0ea('0xc')](_0xb0ea('0xd'),auth[_0xb0ea('0xe')](),controller['update']);module[_0xb0ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index ed6e194..093d745 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 _0xaee4=['TEXT','STRING','INTEGER','sequelize'];(function(_0x2e0ffa,_0x451f12){var _0x24d627=function(_0x4d0f09){while(--_0x4d0f09){_0x2e0ffa['push'](_0x2e0ffa['shift']());}};_0x24d627(++_0x451f12);}(_0xaee4,0xb3));var _0x4aee=function(_0x44e9c2,_0x56efa0){_0x44e9c2=_0x44e9c2-0x0;var _0x47dafc=_0xaee4[_0x44e9c2];return _0x47dafc;};'use strict';var Sequelize=require(_0x4aee('0x0'));module['exports']={'license':{'type':Sequelize[_0x4aee('0x1')]},'data1':{'type':Sequelize[_0x4aee('0x2')]},'data2':{'type':Sequelize[_0x4aee('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x4aee('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x44e4=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x30d9e2,_0x112c43){var _0x5116bd=function(_0x1d5055){while(--_0x1d5055){_0x30d9e2['push'](_0x30d9e2['shift']());}};_0x5116bd(++_0x112c43);}(_0x44e4,0x19f));var _0x444e=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x44e4[_0x1e06f1];return _0x34f77e;};'use strict';var Sequelize=require(_0x444e('0x0'));module[_0x444e('0x1')]={'license':{'type':Sequelize[_0x444e('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x444e('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x444e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 620b51a..2ee46ad 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 _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file +var _0x5fab=['checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','then','catch','body','find','params'];(function(_0x25646f,_0xe9ca6c){var _0x5c88e5=function(_0x5c09e4){while(--_0x5c09e4){_0x25646f['push'](_0x25646f['shift']());}};_0x5c88e5(++_0xe9ca6c);}(_0x5fab,0x177));var _0xb5fa=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x5fab[_0x2bc3f4];return _0x14ac53;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}var utilLicense=require(_0xb5fa('0x18'));exports[_0xb5fa('0x2b')]=function(_0x3506a4,_0x358549){var _0x353314={'raw':!![],'where':{'id':0x1}},_0x409af9={};_0x409af9[_0xb5fa('0x2c')]=_[_0xb5fa('0x2d')](db[_0xb5fa('0x2e')][_0xb5fa('0x2f')]);_0x409af9[_0xb5fa('0x30')]=_[_0xb5fa('0x2d')](_0x3506a4[_0xb5fa('0x30')]);_0x409af9[_0xb5fa('0x31')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],_0x409af9[_0xb5fa('0x30')]);_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],qs[_0xb5fa('0x34')](_0x3506a4['query'][_0xb5fa('0x34')]));_0x353314['attributes']=_0x353314['attributes']['length']?_0x353314[_0xb5fa('0x33')]:_0x409af9['model'];_0x353314=_[_0xb5fa('0x35')]({},_0x353314,_0x3506a4['options']);return utilLicense['getLicense'](_0x353314)[_0xb5fa('0x36')](respondWithResult(_0x358549,null))[_0xb5fa('0x37')](handleError(_0x358549,null));};exports['update']=function(_0x59f41d,_0x3d73c2){if(_0x59f41d[_0xb5fa('0x38')]['id']){delete _0x59f41d[_0xb5fa('0x38')]['id'];}return db['License'][_0xb5fa('0x39')]({'where':{'id':_0x59f41d[_0xb5fa('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d73c2,null))[_0xb5fa('0x36')](function(_0x2056de){var _0x204d6b=_0x2056de['get']({'plain':!![]});return utilLicense[_0xb5fa('0x3b')](_0x204d6b,_0x59f41d[_0xb5fa('0x38')][_0xb5fa('0x3c')]);})['then'](function(_0x117694){if(!_0x117694[_0xb5fa('0x3d')]){return saveUpdates(_0x59f41d[_0xb5fa('0x38')],null);}return _0x117694;})[_0xb5fa('0x36')](respondWithResult(_0x3d73c2,null))['catch'](handleError(_0x3d73c2,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 6266ec9..17bdd0f 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 _0x53d0=['../../config/environment','define','License','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2d1e1a,_0x1550c6){var _0x7398bc=function(_0x3e38a1){while(--_0x3e38a1){_0x2d1e1a['push'](_0x2d1e1a['shift']());}};_0x7398bc(++_0x1550c6);}(_0x53d0,0x1ab));var _0x053d=function(_0x317555,_0x3929b8){_0x317555=_0x317555-0x0;var _0x2dd991=_0x53d0[_0x317555];return _0x2dd991;};'use strict';var _=require(_0x053d('0x0'));var util=require(_0x053d('0x1'));var logger=require(_0x053d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x053d('0x3'));var rp=require(_0x053d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x053d('0x5'));var attributes=require('./license.attributes');module['exports']=function(_0x1ea8b1,_0x3bafb1){return _0x1ea8b1[_0x053d('0x6')](_0x053d('0x7'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b07=['./license.attributes','exports','define','License','license','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b07,0xaa));var _0x73b0=function(_0x389d62,_0x1b587f){_0x389d62=_0x389d62-0x0;var _0x5a896d=_0x3b07[_0x389d62];return _0x5a896d;};'use strict';var _=require(_0x73b0('0x0'));var util=require('util');var logger=require(_0x73b0('0x1'))('api');var moment=require(_0x73b0('0x2'));var BPromise=require(_0x73b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73b0('0x4'));var rimraf=require(_0x73b0('0x5'));var config=require('../../config/environment');var attributes=require(_0x73b0('0x6'));module[_0x73b0('0x7')]=function(_0x1273aa,_0x4f12b8){return _0x1273aa[_0x73b0('0x8')](_0x73b0('0x9'),attributes,{'tableName':_0x73b0('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 fd8de30..ef9dfca 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 _0x403e=['error','message','result','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x403e,0x157));var _0xe403=function(_0x1fb825,_0x3592ee){_0x1fb825=_0x1fb825-0x0;var _0x2798ff=_0x403e[_0x1fb825];return _0x2798ff;};'use strict';var _=require(_0xe403('0x0'));var util=require('util');var moment=require(_0xe403('0x1'));var BPromise=require('bluebird');var rs=require(_0xe403('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe403('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe403('0x4'))(_0xe403('0x5'));var config=require(_0xe403('0x6'));var jayson=require(_0xe403('0x7'));var client=jayson['client'][_0xe403('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x341271,_0x2eaa44,_0x2af6b0){return new BPromise(function(_0x50db3e,_0x410bc0){return client[_0xe403('0x9')](_0x341271,_0x2af6b0)[_0xe403('0xa')](function(_0x4582e8){logger[_0xe403('0xb')](_0xe403('0xc'),_0x2eaa44,'request\x20sent');logger[_0xe403('0xd')](_0xe403('0xe'),_0x2eaa44,_0xe403('0xf'),JSON[_0xe403('0x10')](_0x4582e8));if(_0x4582e8[_0xe403('0x11')]){if(_0x4582e8['error']['code']===0x1f4){logger[_0xe403('0x11')](_0xe403('0xc'),_0x2eaa44,_0x4582e8['error']['message']);return _0x410bc0(_0x4582e8[_0xe403('0x11')][_0xe403('0x12')]);}logger[_0xe403('0x11')](_0xe403('0xc'),_0x2eaa44,_0x4582e8[_0xe403('0x11')][_0xe403('0x12')]);return _0x50db3e(_0x4582e8[_0xe403('0x11')][_0xe403('0x12')]);}else{logger[_0xe403('0xb')](_0xe403('0xc'),_0x2eaa44,_0xe403('0xf'));_0x50db3e(_0x4582e8[_0xe403('0x13')]['message']);}})['catch'](function(_0x495ea3){logger[_0xe403('0x11')](_0xe403('0xc'),_0x2eaa44,_0x495ea3);_0x410bc0(_0x495ea3);});});} \ No newline at end of file +var _0x009d=['stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x149be0,_0x43d7e7){var _0x5c96f7=function(_0x2a79ed){while(--_0x2a79ed){_0x149be0['push'](_0x149be0['shift']());}};_0x5c96f7(++_0x43d7e7);}(_0x009d,0x1bd));var _0xd009=function(_0x4c8597,_0x538976){_0x4c8597=_0x4c8597-0x0;var _0x57cf9b=_0x009d[_0x4c8597];return _0x57cf9b;};'use strict';var _=require(_0xd009('0x0'));var util=require(_0xd009('0x1'));var moment=require(_0xd009('0x2'));var BPromise=require(_0xd009('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd009('0x4'));var db=require(_0xd009('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd009('0x6'))('rpc');var config=require(_0xd009('0x7'));var jayson=require(_0xd009('0x8'));var client=jayson['client'][_0xd009('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51cad5,_0x10d99c,_0x2b88a3){return new BPromise(function(_0x39d823,_0x1bbe28){return client[_0xd009('0xa')](_0x51cad5,_0x2b88a3)[_0xd009('0xb')](function(_0x4f58f0){logger[_0xd009('0xc')](_0xd009('0xd'),_0x10d99c,_0xd009('0xe'));logger[_0xd009('0xf')](_0xd009('0x10'),_0x10d99c,_0xd009('0xe'),JSON[_0xd009('0x11')](_0x4f58f0));if(_0x4f58f0[_0xd009('0x12')]){if(_0x4f58f0[_0xd009('0x12')][_0xd009('0x13')]===0x1f4){logger[_0xd009('0x12')](_0xd009('0xd'),_0x10d99c,_0x4f58f0['error'][_0xd009('0x14')]);return _0x1bbe28(_0x4f58f0[_0xd009('0x12')][_0xd009('0x14')]);}logger['error'](_0xd009('0xd'),_0x10d99c,_0x4f58f0['error']['message']);return _0x39d823(_0x4f58f0[_0xd009('0x12')]['message']);}else{logger[_0xd009('0xc')](_0xd009('0xd'),_0x10d99c,_0xd009('0xe'));_0x39d823(_0x4f58f0['result'][_0xd009('0x14')]);}})[_0xd009('0x15')](function(_0x93f6e7){logger[_0xd009('0x12')](_0xd009('0xd'),_0x10d99c,_0x93f6e7);_0x1bbe28(_0x93f6e7);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0213d1f..c4d5b27 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 _0x2182=['verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeImap','destroy','removeAgents','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages'];(function(_0x33be51,_0x479faf){var _0x370705=function(_0x4f011b){while(--_0x4f011b){_0x33be51['push'](_0x33be51['shift']());}};_0x370705(++_0x479faf);}(_0x2182,0x9d));var _0x2218=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2182[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2218('0x0'));var util=require(_0x2218('0x1'));var path=require(_0x2218('0x2'));var timeout=require('connect-timeout');var express=require(_0x2218('0x3'));var router=express['Router']();var fs_extra=require(_0x2218('0x4'));var auth=require(_0x2218('0x5'));var interaction=require(_0x2218('0x6'));var config=require(_0x2218('0x7'));var controller=require('./mailAccount.controller');router[_0x2218('0x8')]('/',auth[_0x2218('0x9')](),controller[_0x2218('0xa')]);router[_0x2218('0x8')]('/describe',auth[_0x2218('0x9')](),controller[_0x2218('0xb')]);router[_0x2218('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2218('0x8')]('/:id/dispositions',auth[_0x2218('0x9')](),controller['getDispositions']);router['get'](_0x2218('0xc'),auth[_0x2218('0x9')](),controller[_0x2218('0xd')]);router['get'](_0x2218('0xe'),auth['isAuthenticated'](),controller[_0x2218('0xf')]);router[_0x2218('0x8')](_0x2218('0x10'),auth[_0x2218('0x9')](),controller[_0x2218('0x11')]);router[_0x2218('0x8')](_0x2218('0x12'),auth[_0x2218('0x9')](),controller[_0x2218('0x13')]);router[_0x2218('0x8')](_0x2218('0x14'),auth[_0x2218('0x9')](),controller['getApplications']);router[_0x2218('0x8')](_0x2218('0x15'),auth[_0x2218('0x9')](),controller[_0x2218('0x16')]);router[_0x2218('0x8')]('/:id/verify',auth['isAuthenticated'](),controller[_0x2218('0x17')]);router[_0x2218('0x8')](_0x2218('0x18'),auth['isAuthenticated'](),controller[_0x2218('0x19')]);router[_0x2218('0x1a')](_0x2218('0x1b'),auth[_0x2218('0x9')](),controller[_0x2218('0x1c')]);router[_0x2218('0x1a')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2218('0x1d')]);router[_0x2218('0x1a')]('/',auth[_0x2218('0x9')](),controller['create']);router['post'](_0x2218('0xe'),auth[_0x2218('0x9')](),controller[_0x2218('0x1e')]);router[_0x2218('0x1a')](_0x2218('0x10'),auth['isAuthenticated'](),controller[_0x2218('0x1f')]);router['post'](_0x2218('0x12'),auth[_0x2218('0x9')](),controller[_0x2218('0x20')]);router[_0x2218('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0x2218('0x21')]);router['post'](_0x2218('0x22'),auth[_0x2218('0x9')](),controller[_0x2218('0x23')]);router[_0x2218('0x1a')](_0x2218('0x18'),auth['isAuthenticated'](),controller[_0x2218('0x24')]);router[_0x2218('0x25')](_0x2218('0x26'),auth[_0x2218('0x9')](),controller[_0x2218('0x27')]);router[_0x2218('0x28')](_0x2218('0x1b'),auth[_0x2218('0x9')](),controller[_0x2218('0x29')]);router[_0x2218('0x28')](_0x2218('0xc'),auth[_0x2218('0x9')](),controller['removeAnswers']);router[_0x2218('0x28')]('/:id/in_servers',auth[_0x2218('0x9')](),controller[_0x2218('0x2a')]);router['delete'](_0x2218('0x10'),auth[_0x2218('0x9')](),controller['removeSmtp']);router[_0x2218('0x28')](_0x2218('0x26'),auth[_0x2218('0x9')](),controller[_0x2218('0x2b')]);router[_0x2218('0x28')](_0x2218('0x18'),auth['isAuthenticated'](),controller[_0x2218('0x2c')]);module['exports']=router; \ No newline at end of file +var _0x3e69=['../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','verifySmtp','/:id/users','post','addAnswer','addInteraction','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','multer','path','connect-timeout','express','fs-extra'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3e69,0x70));var _0x93e6=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x3e69[_0x91ed5c];return _0x2387d8;};'use strict';var multer=require(_0x93e6('0x0'));var util=require('util');var path=require(_0x93e6('0x1'));var timeout=require(_0x93e6('0x2'));var express=require(_0x93e6('0x3'));var router=express['Router']();var fs_extra=require(_0x93e6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x93e6('0x5'));var config=require('../../config/environment');var controller=require(_0x93e6('0x6'));router[_0x93e6('0x7')]('/',auth[_0x93e6('0x8')](),controller['index']);router[_0x93e6('0x7')](_0x93e6('0x9'),auth[_0x93e6('0x8')](),controller[_0x93e6('0xa')]);router[_0x93e6('0x7')]('/:id',auth[_0x93e6('0x8')](),controller[_0x93e6('0xb')]);router[_0x93e6('0x7')](_0x93e6('0xc'),auth[_0x93e6('0x8')](),controller[_0x93e6('0xd')]);router[_0x93e6('0x7')](_0x93e6('0xe'),auth[_0x93e6('0x8')](),controller[_0x93e6('0xf')]);router[_0x93e6('0x7')](_0x93e6('0x10'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x11')]);router[_0x93e6('0x7')](_0x93e6('0x12'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x13')]);router['get'](_0x93e6('0x14'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x15')]);router[_0x93e6('0x7')](_0x93e6('0x16'),auth[_0x93e6('0x8')](),controller['getApplications']);router[_0x93e6('0x7')]('/:id/messages',auth[_0x93e6('0x8')](),controller[_0x93e6('0x17')]);router[_0x93e6('0x7')](_0x93e6('0x18'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x19')]);router[_0x93e6('0x7')](_0x93e6('0x1a'),auth[_0x93e6('0x8')](),controller['getAgents']);router['post']('/:id/dispositions',auth[_0x93e6('0x8')](),controller['addDisposition']);router[_0x93e6('0x1b')](_0x93e6('0xe'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x1c')]);router[_0x93e6('0x1b')]('/',auth[_0x93e6('0x8')](),controller['create']);router['post'](_0x93e6('0x10'),auth[_0x93e6('0x8')](),controller['addImap']);router[_0x93e6('0x1b')]('/:id/out_servers',auth[_0x93e6('0x8')](),controller['addSmtp']);router[_0x93e6('0x1b')](_0x93e6('0x14'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x1d')]);router[_0x93e6('0x1b')](_0x93e6('0x16'),auth[_0x93e6('0x8')](),controller['addApplications']);router[_0x93e6('0x1b')]('/:id/send',auth[_0x93e6('0x8')](),controller['send']);router['post']('/:id/users',auth[_0x93e6('0x8')](),controller['addAgents']);router[_0x93e6('0x1e')](_0x93e6('0x1f'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x20')]);router[_0x93e6('0x21')]('/:id/dispositions',auth[_0x93e6('0x8')](),controller[_0x93e6('0x22')]);router[_0x93e6('0x21')](_0x93e6('0xe'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x23')]);router[_0x93e6('0x21')](_0x93e6('0x10'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x24')]);router[_0x93e6('0x21')](_0x93e6('0x12'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x25')]);router[_0x93e6('0x21')](_0x93e6('0x1f'),auth['isAuthenticated'](),controller['destroy']);router[_0x93e6('0x21')](_0x93e6('0x1a'),auth[_0x93e6('0x8')](),controller[_0x93e6('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 4781cb3..272f0a8 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 _0xfd28=['INTEGER','UNSIGNED','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xfd28,0x148));var _0x8fd2=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xfd28[_0x4c4037];return _0x357862;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'description':{'type':Sequelize[_0x8fd2('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8fd2('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x8fd2('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8fd2('0x1')],'allowNull':![],'defaultValue':_0x8fd2('0x4')},'fontSize':{'type':Sequelize[_0x8fd2('0x5')](0x2)[_0x8fd2('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8fd2('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8fd2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8fd2('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1ca2a1){if(!_0x1ca2a1)this['setDataValue'](_0x8fd2('0x7'),null);this['setDataValue'](_0x8fd2('0x8'),_0x1ca2a1);}}}; \ No newline at end of file +var _0x430e=['Arial,Helvetica,sans-serif','INTEGER','TEXT','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','exports','STRING','BOOLEAN'];(function(_0x88eaa6,_0xcd1617){var _0x1cfaa2=function(_0x1df7e5){while(--_0x1df7e5){_0x88eaa6['push'](_0x88eaa6['shift']());}};_0x1cfaa2(++_0xcd1617);}(_0x430e,0x105));var _0xe430=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0x430e[_0x35c97a];return _0x388917;};'use strict';var Sequelize=require('sequelize');module[_0xe430('0x0')]={'description':{'type':Sequelize[_0xe430('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xe430('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe430('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe430('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xe430('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xe430('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe430('0x1')],'allowNull':![],'defaultValue':_0xe430('0x3')},'fontSize':{'type':Sequelize[_0xe430('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe430('0x5')],'defaultValue':function(){return _0xe430('0x6');}},'notificationSound':{'type':Sequelize[_0xe430('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe430('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe430('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe430('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe430('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe430('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe430('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xe430('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe430('0x8'),'set':function(_0x17b2ab){if(!_0x17b2ab)this[_0xe430('0x9')](_0xe430('0xa'),null);this[_0xe430('0x9')]('mandatoryDisposition',_0x17b2ab);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 9bab9a6..838e84d 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 _0xbea3=['MailServerIn','MailServerOut','Pause','find','body','Smtp','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','where','include','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','cpassword','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getMessages','MailMessage','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','service','secure','auth','SendMail','sendMail','List\x20not\x20found','messageId','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','client','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','sendStatus','json','offset','limit','count','status','set','apply','reject','save','update','destroy','then','get','MailAccounts','UserProfileResource','end','name','index','Imap','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','options','includeAll','findAll','rows','show','params'];(function(_0x2cb447,_0x1b083c){var _0x276df4=function(_0x226594){while(--_0x226594){_0x2cb447['push'](_0x2cb447['shift']());}};_0x276df4(++_0x1b083c);}(_0xbea3,0x137));var _0x3bea=function(_0x43e71c,_0x5b09d0){_0x43e71c=_0x43e71c-0x0;var _0x501ee6=_0xbea3[_0x43e71c];return _0x501ee6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bea('0x0'));var zipdir=require(_0x3bea('0x1'));var jsonpatch=require(_0x3bea('0x2'));var rp=require(_0x3bea('0x3'));var moment=require(_0x3bea('0x4'));var BPromise=require(_0x3bea('0x5'));var Mustache=require(_0x3bea('0x6'));var util=require(_0x3bea('0x7'));var path=require(_0x3bea('0x8'));var sox=require(_0x3bea('0x9'));var csv=require('to-csv');var ejs=require(_0x3bea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bea('0xb'));var squel=require(_0x3bea('0xc'));var crypto=require(_0x3bea('0xd'));var jsforce=require(_0x3bea('0xe'));var deskjs=require(_0x3bea('0xf'));var toCsv=require(_0x3bea('0x10'));var querystring=require(_0x3bea('0x11'));var Papa=require('papaparse');var htmlToText=require(_0x3bea('0x12'));var juice=require(_0x3bea('0x13'));var Redis=require(_0x3bea('0x14'));var authService=require(_0x3bea('0x15'));var qs=require(_0x3bea('0x16'));var as=require(_0x3bea('0x17'));var hardwareService=require(_0x3bea('0x18'));var logger=require(_0x3bea('0x19'))('api');var utils=require(_0x3bea('0x1a'));var config=require(_0x3bea('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3bea('0x1c')]=_[_0x3bea('0x1d')](config[_0x3bea('0x1c')],{'host':_0x3bea('0x1e'),'port':0x18eb});var socket=require(_0x3bea('0x1f'))(new Redis(config[_0x3bea('0x1c')]));require('./mailAccount.socket')[_0x3bea('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3bea('0x21')]['http']({'port':0x232b});function respondWithRpcPromise(_0x39df74,_0x5e72e2,_0x36a92b,_0x174012){return new BPromise(function(_0x484c65,_0x36a2ab){var _0x37afff=_0x174012||client;return _0x37afff[_0x3bea('0x22')](_0x39df74,_0x36a92b)['then'](function(_0x49a465){logger['info'](_0x3bea('0x23'),_0x5e72e2,'request\x20sent');logger[_0x3bea('0x24')](_0x3bea('0x25'),_0x5e72e2,'request\x20sent',JSON[_0x3bea('0x26')](_0x49a465));if(_0x49a465[_0x3bea('0x27')]){if(_0x49a465[_0x3bea('0x27')]['code']===0x1f4){logger[_0x3bea('0x27')](_0x3bea('0x23'),_0x5e72e2,_0x49a465[_0x3bea('0x27')][_0x3bea('0x28')]);return _0x36a2ab(_0x49a465[_0x3bea('0x27')][_0x3bea('0x28')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5e72e2,_0x49a465['error']['message']);return _0x484c65(_0x49a465[_0x3bea('0x27')][_0x3bea('0x28')]);}else{logger[_0x3bea('0x29')](_0x3bea('0x23'),_0x5e72e2,_0x3bea('0x2a'));_0x484c65(_0x49a465[_0x3bea('0x2b')]['message']);}})[_0x3bea('0x2c')](function(_0x1fb741){logger[_0x3bea('0x27')]('MailAccount,\x20%s,\x20%s',_0x5e72e2,_0x1fb741);_0x36a2ab(_0x1fb741);});});}function respondWithStatusCode(_0x2d5cc7,_0x418b2b){_0x418b2b=_0x418b2b||0xcc;return function(_0x52a120){if(_0x52a120){return _0x2d5cc7[_0x3bea('0x2d')](_0x418b2b);}return _0x2d5cc7['status'](_0x418b2b)['end']();};}function respondWithResult(_0x594c52,_0x1701ef){_0x1701ef=_0x1701ef||0xc8;return function(_0x392f9e){if(_0x392f9e){return _0x594c52['status'](_0x1701ef)[_0x3bea('0x2e')](_0x392f9e);}};}function respondWithFilteredResult(_0x546a21,_0x5cdc6a){return function(_0x582eeb){if(_0x582eeb){var _0x411ac8=typeof _0x5cdc6a[_0x3bea('0x2f')]==='undefined'&&typeof _0x5cdc6a[_0x3bea('0x30')]==='undefined';var _0x2faed2=_0x582eeb[_0x3bea('0x31')];var _0x1c876d=_0x411ac8?0x0:_0x5cdc6a['offset'];var _0x5781ff=_0x411ac8?_0x582eeb[_0x3bea('0x31')]:_0x5cdc6a['offset']+_0x5cdc6a[_0x3bea('0x30')];var _0x737868;if(_0x5781ff>=_0x2faed2){_0x5781ff=_0x2faed2;_0x737868=0xc8;}else{_0x737868=0xce;}_0x546a21[_0x3bea('0x32')](_0x737868);return _0x546a21[_0x3bea('0x33')]('Content-Range',_0x1c876d+'-'+_0x5781ff+'/'+_0x2faed2)['json'](_0x582eeb);}return null;};}function patchUpdates(_0x38724c){return function(_0x13126e){try{jsonpatch[_0x3bea('0x34')](_0x13126e,_0x38724c,!![]);}catch(_0xf1f91a){return BPromise[_0x3bea('0x35')](_0xf1f91a);}return _0x13126e[_0x3bea('0x36')]();};}function saveUpdates(_0x2b0871,_0x53892a){return function(_0x354c62){if(_0x354c62){return _0x354c62[_0x3bea('0x37')](_0x2b0871)['then'](function(_0x3f8f9f){return _0x3f8f9f;});}return null;};}function removeEntity(_0x25e64e,_0x50fd76){return function(_0x5a7ee7){if(_0x5a7ee7){return _0x5a7ee7[_0x3bea('0x38')]()[_0x3bea('0x39')](function(){var _0x43d75e=_0x5a7ee7[_0x3bea('0x3a')]({'plain':!![]});var _0x115764=_0x3bea('0x3b');return db[_0x3bea('0x3c')][_0x3bea('0x38')]({'where':{'type':_0x115764,'resourceId':_0x43d75e['id']}})['then'](function(){return _0x5a7ee7;});})[_0x3bea('0x39')](function(){_0x25e64e[_0x3bea('0x32')](0xcc)[_0x3bea('0x3d')]();});}};}function handleEntityNotFound(_0xc215ab,_0x49f5a6){return function(_0x14da0d){if(!_0x14da0d){_0xc215ab[_0x3bea('0x2d')](0x194);}return _0x14da0d;};}function handleError(_0x35feeb,_0x4ba01d){_0x4ba01d=_0x4ba01d||0x1f4;return function(_0x5a24c1){logger[_0x3bea('0x27')](_0x5a24c1['stack']);if(_0x5a24c1[_0x3bea('0x3e')]){delete _0x5a24c1['name'];}_0x35feeb[_0x3bea('0x32')](_0x4ba01d)['send'](_0x5a24c1);};}exports[_0x3bea('0x3f')]=function(_0x3402a6,_0x4e769d){var _0x5bce10={'include':[{'model':db['MailServerIn'],'as':_0x3bea('0x40')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x3bea('0x41')}]},_0x5e6867={},_0x38f148={'count':0x0,'rows':[]};var _0x40e1d6=_[_0x3bea('0x42')](db[_0x3bea('0x43')][_0x3bea('0x44')],function(_0x39ac5a){return{'name':_0x39ac5a['fieldName'],'type':_0x39ac5a[_0x3bea('0x45')][_0x3bea('0x46')]};});_0x5e6867[_0x3bea('0x47')]=_[_0x3bea('0x42')](_0x40e1d6,'name');_0x5e6867['query']=_[_0x3bea('0x48')](_0x3402a6[_0x3bea('0x49')]);_0x5e6867[_0x3bea('0x4a')]=_['intersection'](_0x5e6867[_0x3bea('0x47')],_0x5e6867[_0x3bea('0x49')]);_0x5bce10['attributes']=_[_0x3bea('0x4b')](_0x5e6867[_0x3bea('0x47')],qs[_0x3bea('0x4c')](_0x3402a6[_0x3bea('0x49')][_0x3bea('0x4c')]));_0x5bce10[_0x3bea('0x4d')]=_0x5bce10['attributes'][_0x3bea('0x4e')]?_0x5bce10['attributes']:_0x5e6867[_0x3bea('0x47')];if(!_0x3402a6[_0x3bea('0x49')][_0x3bea('0x4f')](_0x3bea('0x50'))){_0x5bce10[_0x3bea('0x30')]=qs[_0x3bea('0x30')](_0x3402a6['query'][_0x3bea('0x30')]);_0x5bce10[_0x3bea('0x2f')]=qs[_0x3bea('0x2f')](_0x3402a6[_0x3bea('0x49')]['offset']);}_0x5bce10['order']=qs[_0x3bea('0x51')](_0x3402a6[_0x3bea('0x49')][_0x3bea('0x51')]);_0x5bce10['where']=qs[_0x3bea('0x4a')](_[_0x3bea('0x52')](_0x3402a6['query'],_0x5e6867[_0x3bea('0x4a')]),_0x40e1d6);if(_0x3402a6['query'][_0x3bea('0x53')]){_0x5bce10['where']=_['merge'](_0x5bce10['where'],{'$or':_[_0x3bea('0x42')](_0x40e1d6,function(_0x4c38e5){if(_0x4c38e5['type']!=='VIRTUAL'){var _0x4f7ba8={};_0x4f7ba8[_0x4c38e5[_0x3bea('0x3e')]]={'$like':'%'+_0x3402a6[_0x3bea('0x49')][_0x3bea('0x53')]+'%'};return _0x4f7ba8;}})});}_0x5bce10=_[_0x3bea('0x54')]({},_0x5bce10,_0x3402a6[_0x3bea('0x55')]);var _0x3c7708={'where':_0x5bce10['where']};return db['MailAccount'][_0x3bea('0x31')](_0x3c7708)[_0x3bea('0x39')](function(_0x538e12){_0x38f148[_0x3bea('0x31')]=_0x538e12;if(_0x3402a6[_0x3bea('0x49')][_0x3bea('0x56')]){_0x5bce10['include']=[{'all':!![]}];}return db['MailAccount'][_0x3bea('0x57')](_0x5bce10);})[_0x3bea('0x39')](function(_0x5e608d){_0x38f148[_0x3bea('0x58')]=_0x5e608d;return _0x38f148;})['then'](respondWithFilteredResult(_0x4e769d,_0x5bce10))[_0x3bea('0x2c')](handleError(_0x4e769d,null));};exports[_0x3bea('0x59')]=function(_0x9ec210,_0x3bfd70){var _0x7a8b0f={'raw':![],'where':{'id':_0x9ec210[_0x3bea('0x5a')]['id']},'include':[{'model':db[_0x3bea('0x5b')],'as':_0x3bea('0x40')},{'model':db[_0x3bea('0x5c')],'as':'Smtp'},{'model':db[_0x3bea('0x5d')],'as':_0x3bea('0x41')}]},_0x1f75af={};_0x1f75af[_0x3bea('0x47')]=_[_0x3bea('0x48')](db[_0x3bea('0x43')]['rawAttributes']);_0x1f75af[_0x3bea('0x49')]=_[_0x3bea('0x48')](_0x9ec210[_0x3bea('0x49')]);_0x1f75af['filters']=_[_0x3bea('0x4b')](_0x1f75af[_0x3bea('0x47')],_0x1f75af[_0x3bea('0x49')]);_0x7a8b0f[_0x3bea('0x4d')]=_['intersection'](_0x1f75af['model'],qs['fields'](_0x9ec210[_0x3bea('0x49')][_0x3bea('0x4c')]));_0x7a8b0f['attributes']=_0x7a8b0f['attributes'][_0x3bea('0x4e')]?_0x7a8b0f[_0x3bea('0x4d')]:_0x1f75af['model'];if(_0x9ec210[_0x3bea('0x49')][_0x3bea('0x56')]){_0x7a8b0f['include']=[{'all':!![]}];}_0x7a8b0f=_[_0x3bea('0x54')]({},_0x7a8b0f,_0x9ec210['options']);return db[_0x3bea('0x43')][_0x3bea('0x5e')](_0x7a8b0f)[_0x3bea('0x39')](handleEntityNotFound(_0x3bfd70,null))[_0x3bea('0x39')](respondWithResult(_0x3bfd70,null))[_0x3bea('0x2c')](handleError(_0x3bfd70,null));};exports[_0x3bea('0x37')]=function(_0x84f0b2,_0x9b5448){if(_0x84f0b2[_0x3bea('0x5f')]['id']){delete _0x84f0b2[_0x3bea('0x5f')]['id'];}return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x84f0b2[_0x3bea('0x5a')]['id']},'include':[{'model':db[_0x3bea('0x5b')],'as':_0x3bea('0x40')},{'model':db[_0x3bea('0x5c')],'as':_0x3bea('0x60')},{'model':db['Pause'],'as':_0x3bea('0x41')}]})[_0x3bea('0x39')](handleEntityNotFound(_0x9b5448,null))['then'](saveUpdates(_0x84f0b2['body'],null))[_0x3bea('0x39')](function(_0x39ee9c){if(_0x39ee9c&&_0x84f0b2[_0x3bea('0x5f')]['Imap']){return db[_0x3bea('0x5b')][_0x3bea('0x37')](_0x84f0b2[_0x3bea('0x5f')]['Imap'],{'where':{'MailAccountId':_0x39ee9c['id']}})['then'](function(){return _0x39ee9c;});}return _0x39ee9c;})['then'](function(_0x132cb6){if(_0x132cb6&&_0x84f0b2[_0x3bea('0x5f')][_0x3bea('0x60')]){return db[_0x3bea('0x5c')]['update'](_0x84f0b2[_0x3bea('0x5f')][_0x3bea('0x60')],{'where':{'MailAccountId':_0x132cb6['id']}})[_0x3bea('0x39')](function(){return _0x132cb6;});}return _0x132cb6;})[_0x3bea('0x39')](respondWithResult(_0x9b5448,null))[_0x3bea('0x2c')](handleError(_0x9b5448,null));};exports['describe']=function(_0x3ec895,_0xe0e8bb){return db[_0x3bea('0x43')][_0x3bea('0x61')]()[_0x3bea('0x39')](respondWithResult(_0xe0e8bb,null))[_0x3bea('0x2c')](handleError(_0xe0e8bb,null));};exports[_0x3bea('0x62')]=function(_0x527fc7,_0x4f275d,_0x11b187){if(_0x527fc7[_0x3bea('0x5f')]['id']){delete _0x527fc7[_0x3bea('0x5f')]['id'];}return db[_0x3bea('0x43')]['find']({'where':{'id':_0x527fc7[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x4f275d,null))[_0x3bea('0x39')](function(_0x11d598){if(_0x11d598){_0x527fc7[_0x3bea('0x5f')][_0x3bea('0x63')]=_0x11d598['id'];return db[_0x3bea('0x64')][_0x3bea('0x65')](_0x527fc7[_0x3bea('0x5f')]);}})[_0x3bea('0x39')](respondWithResult(_0x4f275d,null))[_0x3bea('0x2c')](handleError(_0x4f275d,null));};exports[_0x3bea('0x66')]=function(_0x242f21,_0x3ee8fb,_0x29c8c2){var _0x842951={'raw':![],'where':{}};var _0x35b6e8={};var _0x1a5ff4={'count':0x0,'rows':[]};return db[_0x3bea('0x43')][_0x3bea('0x67')]({'where':{'id':_0x242f21['params']['id']}})['then'](handleEntityNotFound(_0x3ee8fb,null))[_0x3bea('0x39')](function(_0x5797c1){if(_0x5797c1){_0x35b6e8['model']=_['keys'](db[_0x3bea('0x64')][_0x3bea('0x44')]);_0x35b6e8['query']=_['keys'](_0x242f21[_0x3bea('0x49')]);_0x35b6e8[_0x3bea('0x4a')]=_[_0x3bea('0x4b')](_0x35b6e8[_0x3bea('0x47')],_0x35b6e8[_0x3bea('0x49')]);_0x842951[_0x3bea('0x4d')]=_[_0x3bea('0x4b')](_0x35b6e8['model'],qs[_0x3bea('0x4c')](_0x242f21[_0x3bea('0x49')][_0x3bea('0x4c')]));_0x842951[_0x3bea('0x4d')]=_0x842951[_0x3bea('0x4d')][_0x3bea('0x4e')]?_0x842951[_0x3bea('0x4d')]:_0x35b6e8[_0x3bea('0x47')];if(!_0x242f21['query'][_0x3bea('0x4f')](_0x3bea('0x50'))){_0x842951[_0x3bea('0x30')]=qs[_0x3bea('0x30')](_0x242f21['query']['limit']);_0x842951['offset']=qs[_0x3bea('0x2f')](_0x242f21['query'][_0x3bea('0x2f')]);}_0x842951['order']=qs['sort'](_0x242f21[_0x3bea('0x49')][_0x3bea('0x51')]);_0x842951[_0x3bea('0x68')]=qs[_0x3bea('0x4a')](_[_0x3bea('0x52')](_0x242f21[_0x3bea('0x49')],_0x35b6e8[_0x3bea('0x4a')]));_0x842951[_0x3bea('0x68')][_0x3bea('0x63')]=_0x5797c1['id'];if(_0x242f21[_0x3bea('0x49')][_0x3bea('0x53')]){_0x842951[_0x3bea('0x68')]=_['merge'](_0x842951[_0x3bea('0x68')],{'$or':_[_0x3bea('0x42')](_0x842951[_0x3bea('0x4d')],function(_0x3f4cfe){var _0x204ded={};_0x204ded[_0x3f4cfe]={'$like':'%'+_0x242f21[_0x3bea('0x49')]['filter']+'%'};return _0x204ded;})});}_0x842951=_[_0x3bea('0x54')]({},_0x842951,_0x242f21[_0x3bea('0x55')]);return db[_0x3bea('0x64')]['count']({'where':_0x842951[_0x3bea('0x68')]})[_0x3bea('0x39')](function(_0x3e4b1a){_0x1a5ff4[_0x3bea('0x31')]=_0x3e4b1a;if(_0x242f21[_0x3bea('0x49')]['includeAll']){_0x842951[_0x3bea('0x69')]=[{'all':!![]}];}return db[_0x3bea('0x64')][_0x3bea('0x57')](_0x842951);})['then'](function(_0xd9c7b0){_0x1a5ff4[_0x3bea('0x58')]=_0xd9c7b0;return _0x1a5ff4;});}})['then'](respondWithFilteredResult(_0x3ee8fb,_0x842951))[_0x3bea('0x2c')](handleError(_0x3ee8fb,null));};exports[_0x3bea('0x6a')]=function(_0x2b31f2,_0x5a41a1,_0xb1459b){return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x2b31f2[_0x3bea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5a41a1,null))[_0x3bea('0x39')](function(_0x48477f){if(_0x48477f){return _0x48477f[_0x3bea('0x6a')](_0x2b31f2[_0x3bea('0x49')][_0x3bea('0x6b')]);}})['then'](respondWithStatusCode(_0x5a41a1,null))[_0x3bea('0x2c')](handleError(_0x5a41a1,null));};exports[_0x3bea('0x6c')]=function(_0x5d26f0,_0xfccc05,_0x66efdf){if(_0x5d26f0[_0x3bea('0x5f')]['id']){delete _0x5d26f0[_0x3bea('0x5f')]['id'];}return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x5d26f0[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0xfccc05,null))[_0x3bea('0x39')](function(_0x5a615b){if(_0x5a615b){_0x5d26f0[_0x3bea('0x5f')][_0x3bea('0x63')]=_0x5a615b['id'];return db['CannedAnswer'][_0x3bea('0x65')](_0x5d26f0['body']);}})[_0x3bea('0x39')](respondWithResult(_0xfccc05,null))['catch'](handleError(_0xfccc05,null));};exports[_0x3bea('0x6d')]=function(_0x1df1e8,_0x3f91e5,_0xeae23){var _0x1a5364={'raw':![],'where':{}};var _0x40fc86={};var _0x83a85={'count':0x0,'rows':[]};return db['MailAccount'][_0x3bea('0x67')]({'where':{'id':_0x1df1e8[_0x3bea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3f91e5,null))[_0x3bea('0x39')](function(_0x422b6d){if(_0x422b6d){_0x40fc86[_0x3bea('0x47')]=_[_0x3bea('0x48')](db[_0x3bea('0x6e')]['rawAttributes']);_0x40fc86[_0x3bea('0x49')]=_[_0x3bea('0x48')](_0x1df1e8[_0x3bea('0x49')]);_0x40fc86[_0x3bea('0x4a')]=_[_0x3bea('0x4b')](_0x40fc86['model'],_0x40fc86['query']);_0x1a5364[_0x3bea('0x4d')]=_[_0x3bea('0x4b')](_0x40fc86[_0x3bea('0x47')],qs[_0x3bea('0x4c')](_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x4c')]));_0x1a5364[_0x3bea('0x4d')]=_0x1a5364[_0x3bea('0x4d')][_0x3bea('0x4e')]?_0x1a5364[_0x3bea('0x4d')]:_0x40fc86[_0x3bea('0x47')];if(!_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x4f')]('nolimit')){_0x1a5364['limit']=qs[_0x3bea('0x30')](_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x30')]);_0x1a5364['offset']=qs[_0x3bea('0x2f')](_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x2f')]);}_0x1a5364['order']=qs['sort'](_0x1df1e8[_0x3bea('0x49')]['sort']);_0x1a5364[_0x3bea('0x68')]=qs['filters'](_[_0x3bea('0x52')](_0x1df1e8['query'],_0x40fc86[_0x3bea('0x4a')]));_0x1a5364['where'][_0x3bea('0x63')]=_0x422b6d['id'];if(_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x53')]){_0x1a5364[_0x3bea('0x68')]=_[_0x3bea('0x54')](_0x1a5364[_0x3bea('0x68')],{'$or':_[_0x3bea('0x42')](_0x1a5364['attributes'],function(_0xdd2f25){var _0x1501a9={};_0x1501a9[_0xdd2f25]={'$like':'%'+_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x53')]+'%'};return _0x1501a9;})});}_0x1a5364=_['merge']({},_0x1a5364,_0x1df1e8['options']);return db[_0x3bea('0x6e')][_0x3bea('0x31')]({'where':_0x1a5364[_0x3bea('0x68')]})[_0x3bea('0x39')](function(_0x10c0f0){_0x83a85['count']=_0x10c0f0;if(_0x1df1e8[_0x3bea('0x49')][_0x3bea('0x56')]){_0x1a5364[_0x3bea('0x69')]=[{'all':!![]}];}return db[_0x3bea('0x6e')][_0x3bea('0x57')](_0x1a5364);})['then'](function(_0x51ae92){_0x83a85[_0x3bea('0x58')]=_0x51ae92;return _0x83a85;});}})[_0x3bea('0x39')](respondWithFilteredResult(_0x3f91e5,_0x1a5364))[_0x3bea('0x2c')](handleError(_0x3f91e5,null));};exports[_0x3bea('0x6f')]=function(_0x21bd6a,_0xf786c,_0x4df939){return db[_0x3bea('0x43')]['find']({'where':{'id':_0x21bd6a[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0xf786c,null))[_0x3bea('0x39')](function(_0x29644a){if(_0x29644a){return _0x29644a[_0x3bea('0x6f')](_0x21bd6a[_0x3bea('0x49')][_0x3bea('0x6b')]);}})[_0x3bea('0x39')](respondWithStatusCode(_0xf786c,null))[_0x3bea('0x2c')](handleError(_0xf786c,null));};exports[_0x3bea('0x65')]=function(_0xf154e4,_0x374b2c){var _0x508b28={'name':_0xf154e4[_0x3bea('0x5f')]['name'],'key':_0xf154e4[_0x3bea('0x5f')]['key'],'email':_0xf154e4[_0x3bea('0x5f')]['email'],'ListId':_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x70')],'active':!_[_0x3bea('0x71')](_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x72')])?_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x72')]:!![],'description':_0xf154e4['body'][_0x3bea('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x3bea('0x71')](_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x74')])){if(_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x75')]){_0x508b28[_0x3bea('0x40')]['user']=_0x508b28[_0x3bea('0x60')][_0x3bea('0x76')]=_0xf154e4['body'][_0x3bea('0x77')];_0x508b28[_0x3bea('0x40')][_0x3bea('0x78')]=_0x508b28[_0x3bea('0x60')][_0x3bea('0x79')]=_0xf154e4[_0x3bea('0x5f')]['cpassword'];}else{_0x508b28[_0x3bea('0x40')][_0x3bea('0x7a')]=_0x508b28[_0x3bea('0x60')][_0x3bea('0x7a')]=![];}_0x508b28[_0x3bea('0x40')][_0x3bea('0x7b')]=_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x40')]['host'];_0x508b28[_0x3bea('0x40')][_0x3bea('0x7c')]=_0xf154e4['body'][_0x3bea('0x40')][_0x3bea('0x7c')];_0x508b28[_0x3bea('0x60')][_0x3bea('0x7b')]=_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x60')][_0x3bea('0x7b')];_0x508b28['Smtp'][_0x3bea('0x7c')]=_0xf154e4[_0x3bea('0x5f')][_0x3bea('0x60')]['port'];}else{_0x508b28[_0x3bea('0x40')]['service']=_0x508b28['Smtp']['service']=_0xf154e4['body'][_0x3bea('0x74')];_0x508b28[_0x3bea('0x40')][_0x3bea('0x76')]=_0x508b28['Smtp'][_0x3bea('0x76')]=_0xf154e4['body'][_0x3bea('0x77')];_0x508b28[_0x3bea('0x40')][_0x3bea('0x78')]=_0x508b28[_0x3bea('0x60')][_0x3bea('0x79')]=_0xf154e4['body'][_0x3bea('0x7d')];}return db[_0x3bea('0x43')][_0x3bea('0x65')](_0x508b28,{'include':[{'model':db[_0x3bea('0x5c')],'as':_0x3bea('0x60')},{'model':db[_0x3bea('0x5b')],'as':_0x3bea('0x40')}]})[_0x3bea('0x39')](function(_0x48e4ba){var _0x1605d0=_0xf154e4[_0x3bea('0x76')][_0x3bea('0x3a')]({'plain':!![]});if(!_0x1605d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1605d0['role']===_0x3bea('0x76')){var _0x7aefb5=_0x48e4ba[_0x3bea('0x3a')]({'plain':!![]});return db['UserProfileSection'][_0x3bea('0x5e')]({'where':{'name':_0x3bea('0x3b'),'userProfileId':_0x1605d0[_0x3bea('0x7e')]},'raw':!![]})[_0x3bea('0x39')](function(_0x53e09f){if(_0x53e09f&&_0x53e09f[_0x3bea('0x7f')]===0x0){return db[_0x3bea('0x3c')][_0x3bea('0x65')]({'name':_0x7aefb5['name'],'resourceId':_0x7aefb5['id'],'type':_0x53e09f[_0x3bea('0x3e')],'sectionId':_0x53e09f['id']},{})[_0x3bea('0x39')](function(){return _0x48e4ba;});}else{return _0x48e4ba;}})['catch'](function(_0x20958f){logger[_0x3bea('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20958f);throw _0x20958f;});}return _0x48e4ba;})[_0x3bea('0x39')](respondWithResult(_0x374b2c,0xc9))[_0x3bea('0x2c')](handleError(_0x374b2c,null));};exports['getImap']=function(_0x2e8f50,_0x1fafcf,_0x329946){return db[_0x3bea('0x43')][_0x3bea('0x67')]({'where':{'id':_0x2e8f50[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x1fafcf,null))[_0x3bea('0x39')](function(_0x1c27e6){if(_0x1c27e6){return _0x1c27e6[_0x3bea('0x80')]();}return null;})[_0x3bea('0x39')](respondWithResult(_0x1fafcf,null))[_0x3bea('0x2c')](handleError(_0x1fafcf,null));};exports['addImap']=function(_0x5637e5,_0x29cdd8,_0x4cc0ee){if(_0x5637e5[_0x3bea('0x5f')]['id']){delete _0x5637e5[_0x3bea('0x5f')]['id'];}return db[_0x3bea('0x43')]['find']({'where':{'id':_0x5637e5['params']['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x29cdd8,null))[_0x3bea('0x39')](function(_0x5d2d36){if(_0x5d2d36){_0x5637e5[_0x3bea('0x5f')]['MailAccountId']=_0x5d2d36['id'];return db[_0x3bea('0x5b')][_0x3bea('0x65')](_0x5637e5[_0x3bea('0x5f')]);}})['then'](respondWithResult(_0x29cdd8,null))[_0x3bea('0x2c')](handleError(_0x29cdd8,null));};exports[_0x3bea('0x81')]=function(_0x20d0fe,_0x3ab58d,_0x10c695){return db['MailAccount'][_0x3bea('0x67')]({'where':{'id':_0x20d0fe[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x3ab58d,null))[_0x3bea('0x39')](function(_0x2f1ab4){if(_0x2f1ab4){return _0x2f1ab4[_0x3bea('0x82')](null);}return null;})[_0x3bea('0x39')](respondWithStatusCode(_0x3ab58d,null))[_0x3bea('0x2c')](handleError(_0x3ab58d,null));};exports['getSmtp']=function(_0x4c9861,_0x31122f,_0x652606){return db['MailAccount']['findOne']({'where':{'id':_0x4c9861[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x31122f,null))[_0x3bea('0x39')](function(_0x53afd4){if(_0x53afd4){return _0x53afd4[_0x3bea('0x83')]();}return null;})[_0x3bea('0x39')](respondWithResult(_0x31122f,null))['catch'](handleError(_0x31122f,null));};exports[_0x3bea('0x84')]=function(_0x587d74,_0x1a700d,_0x206134){if(_0x587d74[_0x3bea('0x5f')]['id']){delete _0x587d74['body']['id'];}return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x587d74[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x1a700d,null))[_0x3bea('0x39')](function(_0x30cd27){if(_0x30cd27){_0x587d74['body'][_0x3bea('0x63')]=_0x30cd27['id'];return db['MailServerOut'][_0x3bea('0x65')](_0x587d74[_0x3bea('0x5f')]);}})[_0x3bea('0x39')](respondWithResult(_0x1a700d,null))[_0x3bea('0x2c')](handleError(_0x1a700d,null));};exports[_0x3bea('0x85')]=function(_0x364667,_0x357fa9,_0x3eee4a){return db['MailAccount'][_0x3bea('0x67')]({'where':{'id':_0x364667[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x357fa9,null))['then'](function(_0x451768){if(_0x451768){return _0x451768['setSmtp'](null);}return null;})[_0x3bea('0x39')](respondWithStatusCode(_0x357fa9,null))['catch'](handleError(_0x357fa9,null));};exports[_0x3bea('0x86')]=function(_0x48177b,_0xa1d0d5,_0x87b795){return db[_0x3bea('0x87')][_0x3bea('0x5e')]({'where':{'id':_0x48177b[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0xa1d0d5,null))['then'](function(_0x3cfd48){if(_0x3cfd48){return _0x3cfd48[_0x3bea('0x86')](_0x48177b[_0x3bea('0x5f')][_0x3bea('0x6b')],_['omit'](_0x48177b[_0x3bea('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0xa1d0d5,null))[_0x3bea('0x2c')](handleError(_0xa1d0d5,null));};exports[_0x3bea('0x88')]=function(_0x176c61,_0x372d1a,_0x326ce1){var _0x4fe7ab={'raw':![],'where':{}};var _0x41a7df={};var _0x5d4078={'count':0x0,'rows':[]};return db[_0x3bea('0x43')][_0x3bea('0x67')]({'where':{'id':_0x176c61[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x372d1a,null))[_0x3bea('0x39')](function(_0x49f667){if(_0x49f667){_0x41a7df[_0x3bea('0x47')]=_[_0x3bea('0x48')](db[_0x3bea('0x87')][_0x3bea('0x44')]);_0x41a7df[_0x3bea('0x49')]=_[_0x3bea('0x48')](_0x176c61['query']);_0x41a7df['filters']=_[_0x3bea('0x4b')](_0x41a7df['model'],_0x41a7df['query']);_0x4fe7ab[_0x3bea('0x4d')]=_[_0x3bea('0x4b')](_0x41a7df[_0x3bea('0x47')],qs[_0x3bea('0x4c')](_0x176c61['query'][_0x3bea('0x4c')]));_0x4fe7ab[_0x3bea('0x4d')]=_0x4fe7ab['attributes'][_0x3bea('0x4e')]?_0x4fe7ab[_0x3bea('0x4d')]:_0x41a7df['model'];if(!_0x176c61[_0x3bea('0x49')]['hasOwnProperty']('nolimit')){_0x4fe7ab[_0x3bea('0x30')]=qs['limit'](_0x176c61[_0x3bea('0x49')][_0x3bea('0x30')]);_0x4fe7ab[_0x3bea('0x2f')]=qs[_0x3bea('0x2f')](_0x176c61[_0x3bea('0x49')][_0x3bea('0x2f')]);}_0x4fe7ab['order']=qs[_0x3bea('0x51')](_0x176c61[_0x3bea('0x49')][_0x3bea('0x51')]);_0x4fe7ab[_0x3bea('0x68')]=qs[_0x3bea('0x4a')](_[_0x3bea('0x52')](_0x176c61['query'],_0x41a7df[_0x3bea('0x4a')]));_0x4fe7ab[_0x3bea('0x68')][_0x3bea('0x63')]=_0x49f667['id'];if(_0x176c61['query'][_0x3bea('0x53')]){_0x4fe7ab[_0x3bea('0x68')]=_['merge'](_0x4fe7ab['where'],{'$or':_['map'](_0x4fe7ab['attributes'],function(_0x4802c7){var _0x575d19={};_0x575d19[_0x4802c7]={'$like':'%'+_0x176c61[_0x3bea('0x49')][_0x3bea('0x53')]+'%'};return _0x575d19;})});}_0x4fe7ab=_['merge']({},_0x4fe7ab,_0x176c61[_0x3bea('0x55')]);return db[_0x3bea('0x87')][_0x3bea('0x31')]({'where':_0x4fe7ab[_0x3bea('0x68')]})['then'](function(_0x28df7b){_0x5d4078[_0x3bea('0x31')]=_0x28df7b;if(_0x176c61[_0x3bea('0x49')][_0x3bea('0x56')]){_0x4fe7ab[_0x3bea('0x69')]=[{'model':db[_0x3bea('0x89')],'as':_0x3bea('0x8a'),'required':![]},{'model':db[_0x3bea('0x8b')],'as':_0x3bea('0x8c'),'attributes':[_0x3bea('0x3e'),_0x3bea('0x8d'),_0x3bea('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x3bea('0x8f'),'attributes':['id',_0x3bea('0x3e'),_0x3bea('0x90')],'where':_0x176c61[_0x3bea('0x49')][_0x3bea('0x91')]?{'id':_0x176c61[_0x3bea('0x49')]['tag']}:undefined,'required':_0x176c61[_0x3bea('0x49')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x4fe7ab);})['then'](function(_0x59fcfe){_0x5d4078['rows']=_0x59fcfe;return _0x5d4078;});}})[_0x3bea('0x39')](respondWithFilteredResult(_0x372d1a,_0x4fe7ab))[_0x3bea('0x2c')](handleError(_0x372d1a,null));};exports[_0x3bea('0x92')]=function addApplications(_0x536199,_0x5ea4a6){var _0x2f543e=_0x536199[_0x3bea('0x5a')]['id'];var _0x4cfadf=_0x536199[_0x3bea('0x5f')];var _0x4117a7=0xc8;var _0x5ca0fb=null;return db[_0x3bea('0x93')][_0x3bea('0x94')]({'isolationLevel':db[_0x3bea('0x93')]['Transaction']['ISOLATION_LEVELS'][_0x3bea('0x95')]},function(_0x1c8ae3){return db[_0x3bea('0x43')][_0x3bea('0x67')]({'where':{'id':_0x2f543e},'transaction':_0x1c8ae3})[_0x3bea('0x39')](function(_0x23ff23){if(_0x23ff23){return db[_0x3bea('0x96')][_0x3bea('0x38')]({'where':{'MailAccountId':_0x2f543e},'transaction':_0x1c8ae3})[_0x3bea('0x39')](function(){var _0x3ed2d9=_[_0x3bea('0x42')](_0x4cfadf,function(_0x544245){_0x544245[_0x3bea('0x63')]=_0x2f543e;return _0x544245;});return db[_0x3bea('0x96')][_0x3bea('0x97')](_0x3ed2d9,{'transaction':_0x1c8ae3});});}else{_0x4117a7=0x194;_0x5ca0fb=[];}});})[_0x3bea('0x39')](function(){if(_0x4117a7!==0x194){return db[_0x3bea('0x96')][_0x3bea('0x98')]({'where':{'MailAccountId':_0x2f543e},'order':_0x3bea('0x99')})[_0x3bea('0x39')](function(_0x320762){_0x5ca0fb=_0x320762;});}})[_0x3bea('0x2c')](function(_0x4a21b8){_0x4117a7=0x1f4;logger[_0x3bea('0x27')](_0x4a21b8[_0x3bea('0x9a')]);if(_0x4a21b8[_0x3bea('0x3e')]){delete _0x4a21b8[_0x3bea('0x3e')];}_0x5ca0fb=_0x4a21b8;})[_0x3bea('0x9b')](function(){if(_0x5ca0fb===null){_0x5ea4a6[_0x3bea('0x2d')](_0x4117a7);}else{if(_0x4117a7===0x1f4){_0x5ea4a6[_0x3bea('0x32')](_0x4117a7)['send'](_0x5ca0fb);}else{_0x5ea4a6['status'](_0x4117a7)[_0x3bea('0x2e')](_0x5ca0fb);}}});};exports[_0x3bea('0x9c')]=function(_0x3b09ad,_0x391358,_0x5b8918){var _0x13f23a={};var _0x292892={};var _0x15e366;var _0x17db6f;return db[_0x3bea('0x43')][_0x3bea('0x67')]({'where':{'id':_0x3b09ad[_0x3bea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x391358,null))[_0x3bea('0x39')](function(_0x286c22){if(_0x286c22){_0x15e366=_0x286c22;_0x292892[_0x3bea('0x47')]=_[_0x3bea('0x48')](db[_0x3bea('0x96')][_0x3bea('0x44')]);_0x292892[_0x3bea('0x49')]=_[_0x3bea('0x48')](_0x3b09ad[_0x3bea('0x49')]);_0x292892[_0x3bea('0x4a')]=_[_0x3bea('0x4b')](_0x292892[_0x3bea('0x47')],_0x292892[_0x3bea('0x49')]);_0x13f23a[_0x3bea('0x4d')]=_[_0x3bea('0x4b')](_0x292892[_0x3bea('0x47')],qs[_0x3bea('0x4c')](_0x3b09ad[_0x3bea('0x49')][_0x3bea('0x4c')]));_0x13f23a[_0x3bea('0x4d')]=_0x13f23a[_0x3bea('0x4d')][_0x3bea('0x4e')]?_0x13f23a['attributes']:_0x292892[_0x3bea('0x47')];_0x13f23a['order']=qs[_0x3bea('0x51')](_0x3b09ad[_0x3bea('0x49')][_0x3bea('0x51')]);_0x13f23a[_0x3bea('0x68')]=qs[_0x3bea('0x4a')](_[_0x3bea('0x52')](_0x3b09ad[_0x3bea('0x49')],_0x292892['filters']));if(_0x3b09ad[_0x3bea('0x49')]['filter']){_0x13f23a['where']=_[_0x3bea('0x54')](_0x13f23a[_0x3bea('0x68')],{'$or':_[_0x3bea('0x42')](_0x13f23a['attributes'],function(_0x21aeac){var _0x5336f4={};_0x5336f4[_0x21aeac]={'$like':'%'+_0x3b09ad[_0x3bea('0x49')][_0x3bea('0x53')]+'%'};return _0x5336f4;})});}_0x13f23a=_['merge']({},_0x13f23a,_0x3b09ad[_0x3bea('0x55')]);return _0x15e366[_0x3bea('0x9c')](_0x13f23a);}})[_0x3bea('0x39')](function(_0x599400){if(_0x599400){_0x17db6f=_0x599400['length'];if(!_0x3b09ad[_0x3bea('0x49')][_0x3bea('0x4f')](_0x3bea('0x50'))){_0x13f23a['limit']=qs[_0x3bea('0x30')](_0x3b09ad[_0x3bea('0x49')][_0x3bea('0x30')]);_0x13f23a[_0x3bea('0x2f')]=qs['offset'](_0x3b09ad[_0x3bea('0x49')][_0x3bea('0x2f')]);}return _0x15e366['getApplications'](_0x13f23a);}})[_0x3bea('0x39')](function(_0x8e8e84){if(_0x8e8e84){return _0x8e8e84?{'count':_0x17db6f,'rows':_0x8e8e84}:null;}})[_0x3bea('0x39')](respondWithResult(_0x391358,null))[_0x3bea('0x2c')](handleError(_0x391358,null));};exports[_0x3bea('0x9d')]=function(_0x50edd0,_0x59bc56,_0x2d7547){var _0xcf7bab={'raw':!![],'where':{}};var _0x46fdcb={};var _0x1d8420={'count':0x0,'rows':[]};return db[_0x3bea('0x43')][_0x3bea('0x67')]({'where':{'id':_0x50edd0[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x59bc56,null))[_0x3bea('0x39')](function(_0x21e930){if(_0x21e930){_0x46fdcb[_0x3bea('0x47')]=_[_0x3bea('0x48')](db[_0x3bea('0x9e')][_0x3bea('0x44')]);_0x46fdcb['query']=_[_0x3bea('0x48')](_0x50edd0[_0x3bea('0x49')]);_0x46fdcb[_0x3bea('0x4a')]=_[_0x3bea('0x4b')](_0x46fdcb['model'],_0x46fdcb[_0x3bea('0x49')]);_0xcf7bab['attributes']=_['intersection'](_0x46fdcb[_0x3bea('0x47')],qs[_0x3bea('0x4c')](_0x50edd0[_0x3bea('0x49')]['fields']));_0xcf7bab[_0x3bea('0x4d')]=_0xcf7bab['attributes'][_0x3bea('0x4e')]?_0xcf7bab['attributes']:_0x46fdcb[_0x3bea('0x47')];if(!_0x50edd0[_0x3bea('0x49')][_0x3bea('0x4f')](_0x3bea('0x50'))){_0xcf7bab[_0x3bea('0x30')]=qs[_0x3bea('0x30')](_0x50edd0['query'][_0x3bea('0x30')]);_0xcf7bab[_0x3bea('0x2f')]=qs[_0x3bea('0x2f')](_0x50edd0['query'][_0x3bea('0x2f')]);}_0xcf7bab[_0x3bea('0x9f')]=qs[_0x3bea('0x51')](_0x50edd0['query']['sort']);_0xcf7bab[_0x3bea('0x68')]=qs['filters'](_[_0x3bea('0x52')](_0x50edd0[_0x3bea('0x49')],_0x46fdcb[_0x3bea('0x4a')]));_0xcf7bab[_0x3bea('0x68')][_0x3bea('0x63')]=_0x21e930['id'];if(_0x50edd0[_0x3bea('0x49')]['filter']){_0xcf7bab[_0x3bea('0x68')]=_[_0x3bea('0x54')](_0xcf7bab[_0x3bea('0x68')],{'$or':_['map'](_0xcf7bab[_0x3bea('0x4d')],function(_0x5c3239){var _0x2ff449={};_0x2ff449[_0x5c3239]={'$like':'%'+_0x50edd0['query'][_0x3bea('0x53')]+'%'};return _0x2ff449;})});}if(_0x50edd0[_0x3bea('0x49')][_0x3bea('0xa0')]){var _0x196599=_0x50edd0[_0x3bea('0x49')][_0x3bea('0xa0')][_0x3bea('0xa1')](',');var _0x3a71db={};_0x3a71db[_0x196599[0x0]]={'$gte':moment(_0x196599[0x1])[_0x3bea('0xa2')](_0x3bea('0xa3'))};_0xcf7bab[_0x3bea('0x68')]=_['merge'](_0xcf7bab[_0x3bea('0x68')],_0x3a71db);}_0xcf7bab=_[_0x3bea('0x54')]({},_0xcf7bab,_0x50edd0['options']);return db[_0x3bea('0x9e')][_0x3bea('0x31')]({'where':_0xcf7bab[_0x3bea('0x68')]})[_0x3bea('0x39')](function(_0x4b070c){_0x1d8420['count']=_0x4b070c;if(_0x50edd0['query']['includeAll']){_0xcf7bab[_0x3bea('0x69')]=[{'all':!![]}];}return db[_0x3bea('0x9e')][_0x3bea('0x57')](_0xcf7bab);})[_0x3bea('0x39')](function(_0x188124){if(_0x50edd0[_0x3bea('0x49')][_0x3bea('0xa4')]===_0x3bea('0xa5')){for(var _0x3cc6d1=0x0;_0x3cc6d1<_0x188124[_0x3bea('0x4e')];_0x3cc6d1++){_0x188124[_0x3cc6d1]['body']=juice(_0x188124[_0x3cc6d1][_0x3bea('0x5f')]);}}_0x1d8420[_0x3bea('0x58')]=_0x188124;return _0x1d8420;});}})[_0x3bea('0x39')](respondWithFilteredResult(_0x59bc56,_0xcf7bab))[_0x3bea('0x2c')](handleError(_0x59bc56,null));};exports[_0x3bea('0xa6')]=function(_0x35f346,_0x1d9b88,_0x506360){var _0x59337b,_0x41c238={},_0x56ad9b;if(_0x35f346[_0x3bea('0x5f')]['to']){_0x56ad9b=_0x35f346[_0x3bea('0x5f')]['to'][_0x3bea('0xa1')](',')[0x0];}return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x35f346['params']['id']},'include':[{'model':db[_0x3bea('0xa7')],'as':_0x3bea('0xa8'),'include':[{'model':db[_0x3bea('0x89')],'as':_0x3bea('0xa9'),'where':{'email':_0x56ad9b},'limit':0x1,'order':[[_0x3bea('0xaa'),_0x3bea('0xab')]]}]},{'model':db['MailServerOut'],'as':_0x3bea('0x60'),'raw':!![]}]})[_0x3bea('0x39')](handleEntityNotFound(_0x1d9b88,null))['then'](function(_0x5a0106){if(_0x5a0106){_0x59337b=_0x5a0106;if(_0x5a0106[_0x3bea('0x60')]){if(_['isNil'](_0x35f346[_0x3bea('0x5f')]['from'])){_0x35f346[_0x3bea('0x5f')][_0x3bea('0xac')]=util['format'](_0x3bea('0xad'),_0x5a0106[_0x3bea('0x3e')],_0x5a0106[_0x3bea('0xae')]||_0x5a0106[_0x3bea('0x60')][_0x3bea('0x76')]);}if(_0x35f346[_0x3bea('0x5f')][_0x3bea('0xaf')]&&_0x35f346['body'][_0x3bea('0xaf')][_0x3bea('0x4e')]){for(var _0x18a0a0=0x0;_0x18a0a0<_0x35f346['body'][_0x3bea('0xaf')][_0x3bea('0x4e')];_0x18a0a0+=0x1){_0x35f346[_0x3bea('0x5f')][_0x3bea('0xaf')][_0x18a0a0]={'filename':_0x35f346['body']['attachments'][_0x18a0a0]['name'],'path':path[_0x3bea('0xb0')](config[_0x3bea('0xb1')],_0x3bea('0xb2'),_0x35f346[_0x3bea('0x5f')]['attachments'][_0x18a0a0][_0x3bea('0xb3')])};}}var _0x3879f1={'tls':{'rejectUnauthorized':![]}};if(_[_0x3bea('0x71')](_0x5a0106[_0x3bea('0x60')][_0x3bea('0xb4')])){if(_0x5a0106['Smtp'][_0x3bea('0x7a')]){_0x3879f1['auth']={'user':_0x5a0106['Smtp'][_0x3bea('0x76')],'pass':_0x5a0106[_0x3bea('0x60')][_0x3bea('0x79')]};}_0x3879f1[_0x3bea('0x7b')]=_0x5a0106[_0x3bea('0x60')][_0x3bea('0x7b')];_0x3879f1['port']=_0x5a0106[_0x3bea('0x60')]['port'];_0x3879f1[_0x3bea('0xb5')]=_0x5a0106['Smtp']['secure'];}else{_0x3879f1['service']=_0x5a0106[_0x3bea('0x60')][_0x3bea('0xb4')];_0x3879f1[_0x3bea('0xb6')]={'user':_0x5a0106[_0x3bea('0x60')][_0x3bea('0x76')],'pass':_0x5a0106['Smtp'][_0x3bea('0x79')]};}return respondWithRpcPromise(_0x3bea('0xb7'),_0x3bea('0xb8'),{'account':_0x3879f1,'message':_0x35f346[_0x3bea('0x5f')]});}else{throw new Error(_0x3bea('0xb9'));}}})['then'](function(_0x160cf2){if(_0x160cf2){_0x41c238=_0x160cf2;if(_0x59337b[_0x3bea('0xa8')]){if(_0x59337b[_0x3bea('0xa8')]['Contacts'][_0x3bea('0x4e')]){return _0x59337b[_0x3bea('0xa8')][_0x3bea('0xa9')][0x0];}else{return db['CmContact'][_0x3bea('0x65')](_[_0x3bea('0x1d')](_0x35f346[_0x3bea('0x5f')],{'firstName':_0x35f346[_0x3bea('0x5f')]['to'],'email':_0x35f346[_0x3bea('0x5f')]['to'],'phone':_0x35f346['body']['to'],'ListId':_0x59337b['ListId']}));}}else{throw new Error(_0x3bea('0xb9'));}}})[_0x3bea('0x39')](function(_0x36fcac){if(_0x36fcac){var _0x2d88e3={'UserId':_0x35f346[_0x3bea('0x76')]['id'],'ContactId':_0x36fcac['id'],'MailAccountId':_0x59337b['id'],'inReplyTo':_0x41c238[_0x3bea('0xba')],'to':_0x35f346['body'][_0x3bea('0xac')],'cc':_0x35f346[_0x3bea('0x5f')]['cc'],'subject':_0x35f346[_0x3bea('0x5f')]['subject'],'attach':_0x35f346[_0x3bea('0x5f')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x3bea('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x3bea('0x54')](_0x35f346[_0x3bea('0x5f')],{'messageId':_0x41c238[_0x3bea('0xba')],'sentAt':moment()[_0x3bea('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x59337b['id'],'UserId':_0x35f346[_0x3bea('0x76')]['id'],'ContactId':_0x36fcac['id']})]};if(_0x35f346['body'][_0x3bea('0xbb')]){_0x2d88e3=_[_0x3bea('0x54')](_0x2d88e3,_0x35f346[_0x3bea('0x5f')][_0x3bea('0xbb')]);}return db['MailInteraction']['create'](_0x2d88e3,{'include':[{'model':db[_0x3bea('0x9e')],'as':'Messages'}]});}})[_0x3bea('0x39')](respondWithResult(_0x1d9b88,null))['catch'](handleError(_0x1d9b88,null));};exports[_0x3bea('0xbc')]=function(_0x3d43df,_0x1e4bcc,_0x3327b5){return db['MailAccount'][_0x3bea('0x5e')]({'where':{'id':_0x3d43df[_0x3bea('0x5a')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x3bea('0x60'),'raw':!![]}]})[_0x3bea('0x39')](handleEntityNotFound(_0x1e4bcc,null))['then'](function(_0x547991){if(_0x547991&&_0x547991[_0x3bea('0x60')]){var _0x48af5f={'id':_0x547991['id'],'tls':{'rejectUnauthorized':![]}};if(_0x547991[_0x3bea('0x60')][_0x3bea('0xb4')]){_0x48af5f['service']=_0x547991['Smtp'][_0x3bea('0xb4')];}else{_0x48af5f[_0x3bea('0x7b')]=_0x547991[_0x3bea('0x60')][_0x3bea('0x7b')];_0x48af5f[_0x3bea('0x7c')]=_0x547991[_0x3bea('0x60')][_0x3bea('0x7c')];_0x48af5f['secure']=_0x547991[_0x3bea('0x60')][_0x3bea('0xb5')];}if(_0x547991[_0x3bea('0x60')][_0x3bea('0x7a')]){_0x48af5f['auth']={'user':_0x547991[_0x3bea('0x60')]['user'],'pass':_0x547991[_0x3bea('0x60')][_0x3bea('0x79')]};}return respondWithRpcPromise(_0x3bea('0xbd'),_0x3bea('0xbc'),{'account':_0x48af5f});}})[_0x3bea('0x39')](respondWithResult(_0x1e4bcc,null))[_0x3bea('0x2c')](handleError(_0x1e4bcc,null));};exports[_0x3bea('0x38')]=function(_0x26a878,_0x32c45b){return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x26a878['params']['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x32c45b,null))[_0x3bea('0x39')](function(_0xbc59cd){if(_0xbc59cd&&_0xbc59cd[_0x3bea('0xb4')]){throw new db[(_0x3bea('0xbe'))][(_0x3bea('0xbf'))](_0x3bea('0xc0'));}return _0xbc59cd;})[_0x3bea('0x39')](removeEntity(_0x32c45b,null))[_0x3bea('0x2c')](handleError(_0x32c45b,null));};exports[_0x3bea('0xc1')]=function(_0xc0fe73,_0x4d7f9d,_0x32a3ea){return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0xc0fe73[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x4d7f9d,null))['then'](function(_0x6636a8){if(_0x6636a8){return _0x6636a8['addAgents'](_0xc0fe73[_0x3bea('0x5f')][_0x3bea('0x6b')],_[_0x3bea('0xc2')](_0xc0fe73[_0x3bea('0x5f')],[_0x3bea('0x6b'),'id'])||{})['spread'](function(_0x70b4e2){for(var _0x4568b3=0x0;_0x4568b3<_0xc0fe73[_0x3bea('0x5f')][_0x3bea('0x6b')][_0x3bea('0x4e')];_0x4568b3+=0x1){socket[_0x3bea('0xc3')](_0x3bea('0xc4'),{'UserId':Number(_0xc0fe73['body'][_0x3bea('0x6b')][_0x4568b3]),'MailAccountId':Number(_0xc0fe73[_0x3bea('0x5a')]['id'])});}return _0x70b4e2;});}})[_0x3bea('0x39')](respondWithResult(_0x4d7f9d,null))['catch'](handleError(_0x4d7f9d,null));};exports['removeAgents']=function(_0x562f96,_0x5e75d1,_0x4170a0){return db[_0x3bea('0x43')][_0x3bea('0x5e')]({'where':{'id':_0x562f96['params']['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x5e75d1,null))[_0x3bea('0x39')](function(_0x50d656){if(_0x50d656){return _0x50d656[_0x3bea('0xc5')](_0x562f96[_0x3bea('0x49')][_0x3bea('0x6b')])[_0x3bea('0x39')](function(){if(_[_0x3bea('0xc6')](_0x562f96['query'][_0x3bea('0x6b')])){for(var _0x231c74=0x0;_0x231c74<_0x562f96[_0x3bea('0x49')][_0x3bea('0x6b')][_0x3bea('0x4e')];_0x231c74+=0x1){socket[_0x3bea('0xc3')](_0x3bea('0xc7'),{'UserId':Number(_0x562f96[_0x3bea('0x49')][_0x3bea('0x6b')][_0x231c74]),'MailAccountId':Number(_0x562f96['params']['id'])});}}else{socket[_0x3bea('0xc3')](_0x3bea('0xc7'),{'UserId':Number(_0x562f96[_0x3bea('0x49')]['ids']),'MailAccountId':Number(_0x562f96[_0x3bea('0x5a')]['id'])});}});}})[_0x3bea('0x39')](respondWithStatusCode(_0x5e75d1,null))['catch'](handleError(_0x5e75d1,null));};exports[_0x3bea('0xc8')]=function(_0x5a07fb,_0x5d03ef,_0x240ad1){var _0x109cf2={};var _0x21691c={};var _0x68651d;var _0xb50b2d;return db[_0x3bea('0x43')]['findOne']({'where':{'id':_0x5a07fb[_0x3bea('0x5a')]['id']}})[_0x3bea('0x39')](handleEntityNotFound(_0x5d03ef,null))['then'](function(_0x315cbd){if(_0x315cbd){_0x68651d=_0x315cbd;_0x21691c['model']=_[_0x3bea('0x48')](db[_0x3bea('0x8b')][_0x3bea('0x44')]);_0x21691c[_0x3bea('0x49')]=_[_0x3bea('0x48')](_0x5a07fb[_0x3bea('0x49')]);_0x21691c[_0x3bea('0x4a')]=_[_0x3bea('0x4b')](_0x21691c['model'],_0x21691c[_0x3bea('0x49')]);_0x109cf2['attributes']=_[_0x3bea('0x4b')](_0x21691c[_0x3bea('0x47')],qs['fields'](_0x5a07fb[_0x3bea('0x49')][_0x3bea('0x4c')]));_0x109cf2[_0x3bea('0x4d')]=_0x109cf2[_0x3bea('0x4d')][_0x3bea('0x4e')]?_0x109cf2[_0x3bea('0x4d')]:_0x21691c[_0x3bea('0x47')];_0x109cf2['order']=qs['sort'](_0x5a07fb['query'][_0x3bea('0x51')]);_0x109cf2[_0x3bea('0x68')]=qs['filters'](_[_0x3bea('0x52')](_0x5a07fb[_0x3bea('0x49')],_0x21691c['filters']));if(_0x5a07fb[_0x3bea('0x49')][_0x3bea('0x53')]){_0x109cf2[_0x3bea('0x68')]=_[_0x3bea('0x54')](_0x109cf2[_0x3bea('0x68')],{'$or':_[_0x3bea('0x42')](_0x109cf2[_0x3bea('0x4d')],function(_0x310e51){var _0x3632bf={};_0x3632bf[_0x310e51]={'$like':'%'+_0x5a07fb['query'][_0x3bea('0x53')]+'%'};return _0x3632bf;})});}_0x109cf2=_[_0x3bea('0x54')]({},_0x109cf2,_0x5a07fb[_0x3bea('0x55')]);return _0x68651d[_0x3bea('0xc8')](_0x109cf2);}})['then'](function(_0x5cbaab){if(_0x5cbaab){_0xb50b2d=_0x5cbaab[_0x3bea('0x4e')];if(!_0x5a07fb['query'][_0x3bea('0x4f')](_0x3bea('0x50'))){_0x109cf2[_0x3bea('0x30')]=qs[_0x3bea('0x30')](_0x5a07fb['query'][_0x3bea('0x30')]);_0x109cf2[_0x3bea('0x2f')]=qs[_0x3bea('0x2f')](_0x5a07fb[_0x3bea('0x49')][_0x3bea('0x2f')]);}return _0x68651d[_0x3bea('0xc8')](_0x109cf2);}})[_0x3bea('0x39')](function(_0x12e4f8){if(_0x12e4f8){return _0x12e4f8?{'count':_0xb50b2d,'rows':_0x12e4f8}:null;}})[_0x3bea('0x39')](respondWithResult(_0x5d03ef,null))[_0x3bea('0x2c')](handleError(_0x5d03ef,null));}; \ No newline at end of file +var _0xeda0=['User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','$gte','split','format','MailMessage','inlineCss','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','secure','auth','sendMail','List\x20not\x20found','List','messageId','subject','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','show','params','Smtp','intersection','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','rows','removeAnswers','key','ListId','isNil','active','description','cservice','cauthentication','user','password','pass','authentication','host','port','service','cpassword','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact'];(function(_0x3389ec,_0x34ed7d){var _0x5958fb=function(_0x2a8d54){while(--_0x2a8d54){_0x3389ec['push'](_0x3389ec['shift']());}};_0x5958fb(++_0x34ed7d);}(_0xeda0,0x1d8));var _0x0eda=function(_0x3e27d2,_0x338a1d){_0x3e27d2=_0x3e27d2-0x0;var _0x340eba=_0xeda0[_0x3e27d2];return _0x340eba;};'use strict';var emlformat=require(_0x0eda('0x0'));var rimraf=require(_0x0eda('0x1'));var zipdir=require(_0x0eda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0eda('0x3'));var moment=require(_0x0eda('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0eda('0x5'));var path=require(_0x0eda('0x6'));var sox=require('sox');var csv=require(_0x0eda('0x7'));var ejs=require(_0x0eda('0x8'));var fs=require('fs');var fs_extra=require(_0x0eda('0x9'));var _=require(_0x0eda('0xa'));var squel=require(_0x0eda('0xb'));var crypto=require(_0x0eda('0xc'));var jsforce=require(_0x0eda('0xd'));var deskjs=require(_0x0eda('0xe'));var toCsv=require(_0x0eda('0x7'));var querystring=require('querystring');var Papa=require(_0x0eda('0xf'));var htmlToText=require(_0x0eda('0x10'));var juice=require(_0x0eda('0x11'));var Redis=require(_0x0eda('0x12'));var authService=require(_0x0eda('0x13'));var qs=require(_0x0eda('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eda('0x15'));var logger=require(_0x0eda('0x16'))(_0x0eda('0x17'));var utils=require(_0x0eda('0x18'));var config=require(_0x0eda('0x19'));var licenseUtil=require(_0x0eda('0x1a'));var db=require('../../mysqldb')['db'];config[_0x0eda('0x1b')]=_[_0x0eda('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0eda('0x1d'))(new Redis(config[_0x0eda('0x1b')]));require(_0x0eda('0x1e'))[_0x0eda('0x1f')](socket);var jayson=require(_0x0eda('0x20'));var client=jayson[_0x0eda('0x21')][_0x0eda('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x1a4df2,_0x3569ff,_0x2d2bb7,_0x9df4c5){return new BPromise(function(_0x3f6df6,_0x591866){var _0x3afa07=_0x9df4c5||client;return _0x3afa07[_0x0eda('0x23')](_0x1a4df2,_0x2d2bb7)[_0x0eda('0x24')](function(_0x5d65ae){logger['info'](_0x0eda('0x25'),_0x3569ff,_0x0eda('0x26'));logger[_0x0eda('0x27')](_0x0eda('0x28'),_0x3569ff,_0x0eda('0x26'),JSON[_0x0eda('0x29')](_0x5d65ae));if(_0x5d65ae['error']){if(_0x5d65ae[_0x0eda('0x2a')][_0x0eda('0x2b')]===0x1f4){logger[_0x0eda('0x2a')](_0x0eda('0x25'),_0x3569ff,_0x5d65ae[_0x0eda('0x2a')][_0x0eda('0x2c')]);return _0x591866(_0x5d65ae['error'][_0x0eda('0x2c')]);}logger[_0x0eda('0x2a')](_0x0eda('0x25'),_0x3569ff,_0x5d65ae['error'][_0x0eda('0x2c')]);return _0x3f6df6(_0x5d65ae[_0x0eda('0x2a')][_0x0eda('0x2c')]);}else{logger[_0x0eda('0x2d')](_0x0eda('0x25'),_0x3569ff,_0x0eda('0x26'));_0x3f6df6(_0x5d65ae[_0x0eda('0x2e')][_0x0eda('0x2c')]);}})[_0x0eda('0x2f')](function(_0x143fe7){logger[_0x0eda('0x2a')]('MailAccount,\x20%s,\x20%s',_0x3569ff,_0x143fe7);_0x591866(_0x143fe7);});});}function respondWithStatusCode(_0x1f0aae,_0x3ce208){_0x3ce208=_0x3ce208||0xcc;return function(_0x3e84da){if(_0x3e84da){return _0x1f0aae['sendStatus'](_0x3ce208);}return _0x1f0aae[_0x0eda('0x30')](_0x3ce208)[_0x0eda('0x31')]();};}function respondWithResult(_0x477100,_0x55cd04){_0x55cd04=_0x55cd04||0xc8;return function(_0x6a27e2){if(_0x6a27e2){return _0x477100['status'](_0x55cd04)[_0x0eda('0x32')](_0x6a27e2);}};}function respondWithFilteredResult(_0x28e4b3,_0x14ec7a){return function(_0x25734b){if(_0x25734b){var _0x399c02=typeof _0x14ec7a['offset']===_0x0eda('0x33')&&typeof _0x14ec7a[_0x0eda('0x34')]===_0x0eda('0x33');var _0x30c4d8=_0x25734b[_0x0eda('0x35')];var _0x552ce5=_0x399c02?0x0:_0x14ec7a[_0x0eda('0x36')];var _0x44cd45=_0x399c02?_0x25734b['count']:_0x14ec7a[_0x0eda('0x36')]+_0x14ec7a[_0x0eda('0x34')];var _0x3078cd;if(_0x44cd45>=_0x30c4d8){_0x44cd45=_0x30c4d8;_0x3078cd=0xc8;}else{_0x3078cd=0xce;}_0x28e4b3[_0x0eda('0x30')](_0x3078cd);return _0x28e4b3[_0x0eda('0x37')](_0x0eda('0x38'),_0x552ce5+'-'+_0x44cd45+'/'+_0x30c4d8)[_0x0eda('0x32')](_0x25734b);}return null;};}function patchUpdates(_0xe03f26){return function(_0x57ee33){try{jsonpatch[_0x0eda('0x39')](_0x57ee33,_0xe03f26,!![]);}catch(_0x3abc97){return BPromise['reject'](_0x3abc97);}return _0x57ee33['save']();};}function saveUpdates(_0x215ea5,_0x15ba52){return function(_0x23c26d){if(_0x23c26d){return _0x23c26d[_0x0eda('0x3a')](_0x215ea5)[_0x0eda('0x24')](function(_0x3a67eb){return _0x3a67eb;});}return null;};}function removeEntity(_0x470440,_0x220f64){return function(_0x3d609b){if(_0x3d609b){return _0x3d609b[_0x0eda('0x3b')]()[_0x0eda('0x24')](function(){var _0x326f89=_0x3d609b[_0x0eda('0x3c')]({'plain':!![]});var _0x4217e1=_0x0eda('0x3d');return db[_0x0eda('0x3e')][_0x0eda('0x3b')]({'where':{'type':_0x4217e1,'resourceId':_0x326f89['id']}})['then'](function(){return _0x3d609b;});})['then'](function(){_0x470440['status'](0xcc)[_0x0eda('0x31')]();});}};}function handleEntityNotFound(_0x557e8a,_0x22c10e){return function(_0x8d55f8){if(!_0x8d55f8){_0x557e8a[_0x0eda('0x3f')](0x194);}return _0x8d55f8;};}function handleError(_0x1c0144,_0x1ee07e){_0x1ee07e=_0x1ee07e||0x1f4;return function(_0x269a01){logger[_0x0eda('0x2a')](_0x269a01[_0x0eda('0x40')]);if(_0x269a01[_0x0eda('0x41')]){delete _0x269a01['name'];}_0x1c0144['status'](_0x1ee07e)['send'](_0x269a01);};}exports['index']=function(_0x44622a,_0x49578c){var _0x471378={'include':[{'model':db[_0x0eda('0x42')],'as':_0x0eda('0x43')},{'model':db[_0x0eda('0x44')],'as':'Smtp'},{'model':db[_0x0eda('0x45')],'as':_0x0eda('0x46')}]},_0x3eb583={},_0x231f48={'count':0x0,'rows':[]};var _0xd7341b=_['map'](db[_0x0eda('0x47')][_0x0eda('0x48')],function(_0x1a6fab){return{'name':_0x1a6fab[_0x0eda('0x49')],'type':_0x1a6fab[_0x0eda('0x4a')]['key']};});_0x3eb583[_0x0eda('0x4b')]=_[_0x0eda('0x4c')](_0xd7341b,_0x0eda('0x41'));_0x3eb583[_0x0eda('0x4d')]=_[_0x0eda('0x4e')](_0x44622a[_0x0eda('0x4d')]);_0x3eb583[_0x0eda('0x4f')]=_['intersection'](_0x3eb583[_0x0eda('0x4b')],_0x3eb583[_0x0eda('0x4d')]);_0x471378[_0x0eda('0x50')]=_['intersection'](_0x3eb583[_0x0eda('0x4b')],qs[_0x0eda('0x51')](_0x44622a[_0x0eda('0x4d')][_0x0eda('0x51')]));_0x471378[_0x0eda('0x50')]=_0x471378[_0x0eda('0x50')][_0x0eda('0x52')]?_0x471378[_0x0eda('0x50')]:_0x3eb583[_0x0eda('0x4b')];if(!_0x44622a['query'][_0x0eda('0x53')](_0x0eda('0x54'))){_0x471378[_0x0eda('0x34')]=qs[_0x0eda('0x34')](_0x44622a[_0x0eda('0x4d')][_0x0eda('0x34')]);_0x471378[_0x0eda('0x36')]=qs[_0x0eda('0x36')](_0x44622a[_0x0eda('0x4d')][_0x0eda('0x36')]);}_0x471378['order']=qs['sort'](_0x44622a[_0x0eda('0x4d')][_0x0eda('0x55')]);_0x471378[_0x0eda('0x56')]=qs[_0x0eda('0x4f')](_[_0x0eda('0x57')](_0x44622a[_0x0eda('0x4d')],_0x3eb583['filters']),_0xd7341b);if(_0x44622a[_0x0eda('0x4d')][_0x0eda('0x58')]){_0x471378[_0x0eda('0x56')]=_[_0x0eda('0x59')](_0x471378['where'],{'$or':_['map'](_0xd7341b,function(_0x43d18c){if(_0x43d18c[_0x0eda('0x4a')]!=='VIRTUAL'){var _0x3c716a={};_0x3c716a[_0x43d18c[_0x0eda('0x41')]]={'$like':'%'+_0x44622a['query']['filter']+'%'};return _0x3c716a;}})});}_0x471378=_['merge']({},_0x471378,_0x44622a[_0x0eda('0x5a')]);var _0x5579ce={'where':_0x471378[_0x0eda('0x56')]};return db[_0x0eda('0x47')][_0x0eda('0x35')](_0x5579ce)['then'](function(_0x3271af){_0x231f48['count']=_0x3271af;if(_0x44622a[_0x0eda('0x4d')]['includeAll']){_0x471378[_0x0eda('0x5b')]=[{'all':!![]}];}return db[_0x0eda('0x47')][_0x0eda('0x5c')](_0x471378);})[_0x0eda('0x24')](function(_0x983b4f){_0x231f48['rows']=_0x983b4f;return _0x231f48;})['then'](respondWithFilteredResult(_0x49578c,_0x471378))[_0x0eda('0x2f')](handleError(_0x49578c,null));};exports[_0x0eda('0x5d')]=function(_0x1274a4,_0x2069d2){var _0xfe912e={'raw':![],'where':{'id':_0x1274a4[_0x0eda('0x5e')]['id']},'include':[{'model':db[_0x0eda('0x42')],'as':_0x0eda('0x43')},{'model':db[_0x0eda('0x44')],'as':_0x0eda('0x5f')},{'model':db[_0x0eda('0x45')],'as':_0x0eda('0x46')}]},_0x30f77a={};_0x30f77a['model']=_['keys'](db[_0x0eda('0x47')][_0x0eda('0x48')]);_0x30f77a[_0x0eda('0x4d')]=_[_0x0eda('0x4e')](_0x1274a4[_0x0eda('0x4d')]);_0x30f77a['filters']=_[_0x0eda('0x60')](_0x30f77a['model'],_0x30f77a[_0x0eda('0x4d')]);_0xfe912e[_0x0eda('0x50')]=_['intersection'](_0x30f77a[_0x0eda('0x4b')],qs[_0x0eda('0x51')](_0x1274a4['query'][_0x0eda('0x51')]));_0xfe912e[_0x0eda('0x50')]=_0xfe912e[_0x0eda('0x50')][_0x0eda('0x52')]?_0xfe912e['attributes']:_0x30f77a['model'];if(_0x1274a4[_0x0eda('0x4d')][_0x0eda('0x61')]){_0xfe912e[_0x0eda('0x5b')]=[{'all':!![]}];}_0xfe912e=_['merge']({},_0xfe912e,_0x1274a4[_0x0eda('0x5a')]);return db[_0x0eda('0x47')][_0x0eda('0x62')](_0xfe912e)['then'](handleEntityNotFound(_0x2069d2,null))[_0x0eda('0x24')](respondWithResult(_0x2069d2,null))['catch'](handleError(_0x2069d2,null));};exports[_0x0eda('0x3a')]=function(_0x288d2a,_0x4d150a){if(_0x288d2a[_0x0eda('0x63')]['id']){delete _0x288d2a[_0x0eda('0x63')]['id'];}return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x288d2a[_0x0eda('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0eda('0x43')},{'model':db[_0x0eda('0x44')],'as':_0x0eda('0x5f')},{'model':db['Pause'],'as':_0x0eda('0x46')}]})[_0x0eda('0x24')](handleEntityNotFound(_0x4d150a,null))[_0x0eda('0x24')](saveUpdates(_0x288d2a['body'],null))[_0x0eda('0x24')](function(_0x2590e6){if(_0x2590e6&&_0x288d2a['body'][_0x0eda('0x43')]){return db[_0x0eda('0x42')][_0x0eda('0x3a')](_0x288d2a['body'][_0x0eda('0x43')],{'where':{'MailAccountId':_0x2590e6['id']}})[_0x0eda('0x24')](function(){return _0x2590e6;});}return _0x2590e6;})[_0x0eda('0x24')](function(_0x56f743){if(_0x56f743&&_0x288d2a[_0x0eda('0x63')][_0x0eda('0x5f')]){return db[_0x0eda('0x44')][_0x0eda('0x3a')](_0x288d2a['body']['Smtp'],{'where':{'MailAccountId':_0x56f743['id']}})[_0x0eda('0x24')](function(){return _0x56f743;});}return _0x56f743;})[_0x0eda('0x24')](respondWithResult(_0x4d150a,null))[_0x0eda('0x2f')](handleError(_0x4d150a,null));};exports[_0x0eda('0x64')]=function(_0x522644,_0x2e8bf5){return db[_0x0eda('0x47')][_0x0eda('0x64')]()['then'](respondWithResult(_0x2e8bf5,null))[_0x0eda('0x2f')](handleError(_0x2e8bf5,null));};exports[_0x0eda('0x65')]=function(_0x4351f8,_0x5828f3,_0x55139b){if(_0x4351f8[_0x0eda('0x63')]['id']){delete _0x4351f8['body']['id'];}return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x4351f8[_0x0eda('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5828f3,null))[_0x0eda('0x24')](function(_0xfeec46){if(_0xfeec46){_0x4351f8[_0x0eda('0x63')][_0x0eda('0x66')]=_0xfeec46['id'];return db[_0x0eda('0x67')]['create'](_0x4351f8[_0x0eda('0x63')]);}})[_0x0eda('0x24')](respondWithResult(_0x5828f3,null))[_0x0eda('0x2f')](handleError(_0x5828f3,null));};exports[_0x0eda('0x68')]=function(_0xfe7ee6,_0x11e67f,_0xdb18d1){var _0x2c2d1f={'raw':![],'where':{}};var _0x17850b={};var _0x1da5e4={'count':0x0,'rows':[]};return db['MailAccount'][_0x0eda('0x69')]({'where':{'id':_0xfe7ee6[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x11e67f,null))['then'](function(_0x4201e0){if(_0x4201e0){_0x17850b[_0x0eda('0x4b')]=_[_0x0eda('0x4e')](db[_0x0eda('0x67')][_0x0eda('0x48')]);_0x17850b['query']=_[_0x0eda('0x4e')](_0xfe7ee6[_0x0eda('0x4d')]);_0x17850b[_0x0eda('0x4f')]=_[_0x0eda('0x60')](_0x17850b['model'],_0x17850b['query']);_0x2c2d1f[_0x0eda('0x50')]=_[_0x0eda('0x60')](_0x17850b[_0x0eda('0x4b')],qs[_0x0eda('0x51')](_0xfe7ee6['query'][_0x0eda('0x51')]));_0x2c2d1f[_0x0eda('0x50')]=_0x2c2d1f[_0x0eda('0x50')][_0x0eda('0x52')]?_0x2c2d1f[_0x0eda('0x50')]:_0x17850b[_0x0eda('0x4b')];if(!_0xfe7ee6[_0x0eda('0x4d')][_0x0eda('0x53')](_0x0eda('0x54'))){_0x2c2d1f[_0x0eda('0x34')]=qs[_0x0eda('0x34')](_0xfe7ee6['query'][_0x0eda('0x34')]);_0x2c2d1f[_0x0eda('0x36')]=qs['offset'](_0xfe7ee6[_0x0eda('0x4d')][_0x0eda('0x36')]);}_0x2c2d1f[_0x0eda('0x6a')]=qs[_0x0eda('0x55')](_0xfe7ee6[_0x0eda('0x4d')][_0x0eda('0x55')]);_0x2c2d1f[_0x0eda('0x56')]=qs[_0x0eda('0x4f')](_[_0x0eda('0x57')](_0xfe7ee6[_0x0eda('0x4d')],_0x17850b[_0x0eda('0x4f')]));_0x2c2d1f[_0x0eda('0x56')][_0x0eda('0x66')]=_0x4201e0['id'];if(_0xfe7ee6[_0x0eda('0x4d')][_0x0eda('0x58')]){_0x2c2d1f['where']=_[_0x0eda('0x59')](_0x2c2d1f[_0x0eda('0x56')],{'$or':_['map'](_0x2c2d1f[_0x0eda('0x50')],function(_0x3c8393){var _0xba7aa1={};_0xba7aa1[_0x3c8393]={'$like':'%'+_0xfe7ee6['query'][_0x0eda('0x58')]+'%'};return _0xba7aa1;})});}_0x2c2d1f=_[_0x0eda('0x59')]({},_0x2c2d1f,_0xfe7ee6[_0x0eda('0x5a')]);return db['Disposition'][_0x0eda('0x35')]({'where':_0x2c2d1f[_0x0eda('0x56')]})[_0x0eda('0x24')](function(_0x2fa88e){_0x1da5e4[_0x0eda('0x35')]=_0x2fa88e;if(_0xfe7ee6[_0x0eda('0x4d')][_0x0eda('0x61')]){_0x2c2d1f[_0x0eda('0x5b')]=[{'all':!![]}];}return db[_0x0eda('0x67')]['findAll'](_0x2c2d1f);})['then'](function(_0x1adbbc){_0x1da5e4['rows']=_0x1adbbc;return _0x1da5e4;});}})[_0x0eda('0x24')](respondWithFilteredResult(_0x11e67f,_0x2c2d1f))['catch'](handleError(_0x11e67f,null));};exports[_0x0eda('0x6b')]=function(_0x55a990,_0x58b4e7,_0x1eb6bc){return db[_0x0eda('0x47')]['find']({'where':{'id':_0x55a990[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x58b4e7,null))[_0x0eda('0x24')](function(_0x4c0e43){if(_0x4c0e43){return _0x4c0e43[_0x0eda('0x6b')](_0x55a990[_0x0eda('0x4d')][_0x0eda('0x6c')]);}})[_0x0eda('0x24')](respondWithStatusCode(_0x58b4e7,null))[_0x0eda('0x2f')](handleError(_0x58b4e7,null));};exports[_0x0eda('0x6d')]=function(_0x4d9440,_0x352629,_0xeb405){if(_0x4d9440['body']['id']){delete _0x4d9440['body']['id'];}return db['MailAccount'][_0x0eda('0x62')]({'where':{'id':_0x4d9440[_0x0eda('0x5e')]['id']}})['then'](handleEntityNotFound(_0x352629,null))[_0x0eda('0x24')](function(_0x596ad1){if(_0x596ad1){_0x4d9440[_0x0eda('0x63')][_0x0eda('0x66')]=_0x596ad1['id'];return db[_0x0eda('0x6e')][_0x0eda('0x6f')](_0x4d9440[_0x0eda('0x63')]);}})[_0x0eda('0x24')](respondWithResult(_0x352629,null))[_0x0eda('0x2f')](handleError(_0x352629,null));};exports[_0x0eda('0x70')]=function(_0x4d1488,_0xe6eefe,_0x3a00ca){var _0x23613a={'raw':![],'where':{}};var _0x5f2c35={};var _0x25226f={'count':0x0,'rows':[]};return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x4d1488['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0xe6eefe,null))[_0x0eda('0x24')](function(_0x5520a2){if(_0x5520a2){_0x5f2c35['model']=_[_0x0eda('0x4e')](db[_0x0eda('0x6e')]['rawAttributes']);_0x5f2c35[_0x0eda('0x4d')]=_[_0x0eda('0x4e')](_0x4d1488[_0x0eda('0x4d')]);_0x5f2c35[_0x0eda('0x4f')]=_['intersection'](_0x5f2c35[_0x0eda('0x4b')],_0x5f2c35['query']);_0x23613a['attributes']=_['intersection'](_0x5f2c35[_0x0eda('0x4b')],qs[_0x0eda('0x51')](_0x4d1488[_0x0eda('0x4d')][_0x0eda('0x51')]));_0x23613a[_0x0eda('0x50')]=_0x23613a[_0x0eda('0x50')][_0x0eda('0x52')]?_0x23613a[_0x0eda('0x50')]:_0x5f2c35[_0x0eda('0x4b')];if(!_0x4d1488[_0x0eda('0x4d')][_0x0eda('0x53')](_0x0eda('0x54'))){_0x23613a[_0x0eda('0x34')]=qs['limit'](_0x4d1488[_0x0eda('0x4d')][_0x0eda('0x34')]);_0x23613a[_0x0eda('0x36')]=qs[_0x0eda('0x36')](_0x4d1488[_0x0eda('0x4d')]['offset']);}_0x23613a[_0x0eda('0x6a')]=qs[_0x0eda('0x55')](_0x4d1488['query'][_0x0eda('0x55')]);_0x23613a[_0x0eda('0x56')]=qs[_0x0eda('0x4f')](_[_0x0eda('0x57')](_0x4d1488['query'],_0x5f2c35[_0x0eda('0x4f')]));_0x23613a['where'][_0x0eda('0x66')]=_0x5520a2['id'];if(_0x4d1488[_0x0eda('0x4d')][_0x0eda('0x58')]){_0x23613a['where']=_[_0x0eda('0x59')](_0x23613a[_0x0eda('0x56')],{'$or':_[_0x0eda('0x4c')](_0x23613a['attributes'],function(_0x590fdb){var _0x42e40d={};_0x42e40d[_0x590fdb]={'$like':'%'+_0x4d1488['query']['filter']+'%'};return _0x42e40d;})});}_0x23613a=_['merge']({},_0x23613a,_0x4d1488['options']);return db[_0x0eda('0x6e')][_0x0eda('0x35')]({'where':_0x23613a[_0x0eda('0x56')]})[_0x0eda('0x24')](function(_0x393d66){_0x25226f['count']=_0x393d66;if(_0x4d1488[_0x0eda('0x4d')][_0x0eda('0x61')]){_0x23613a[_0x0eda('0x5b')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x23613a);})['then'](function(_0x3f8548){_0x25226f[_0x0eda('0x71')]=_0x3f8548;return _0x25226f;});}})[_0x0eda('0x24')](respondWithFilteredResult(_0xe6eefe,_0x23613a))[_0x0eda('0x2f')](handleError(_0xe6eefe,null));};exports[_0x0eda('0x72')]=function(_0x156a48,_0x5718ef,_0x262059){return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x156a48['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x5718ef,null))['then'](function(_0x4bfcde){if(_0x4bfcde){return _0x4bfcde[_0x0eda('0x72')](_0x156a48['query']['ids']);}})[_0x0eda('0x24')](respondWithStatusCode(_0x5718ef,null))[_0x0eda('0x2f')](handleError(_0x5718ef,null));};exports[_0x0eda('0x6f')]=function(_0x23e5c9,_0x1d8d73){var _0x210a08={'name':_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x41')],'key':_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x73')],'email':_0x23e5c9[_0x0eda('0x63')]['email'],'ListId':_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x74')],'active':!_[_0x0eda('0x75')](_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x76')])?_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x76')]:!![],'description':_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x77')]||null,'Imap':{},'Smtp':{}};if(_[_0x0eda('0x75')](_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x78')])){if(_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x79')]){_0x210a08[_0x0eda('0x43')][_0x0eda('0x7a')]=_0x210a08[_0x0eda('0x5f')][_0x0eda('0x7a')]=_0x23e5c9[_0x0eda('0x63')]['cuser'];_0x210a08[_0x0eda('0x43')][_0x0eda('0x7b')]=_0x210a08['Smtp'][_0x0eda('0x7c')]=_0x23e5c9[_0x0eda('0x63')]['cpassword'];}else{_0x210a08[_0x0eda('0x43')][_0x0eda('0x7d')]=_0x210a08[_0x0eda('0x5f')][_0x0eda('0x7d')]=![];}_0x210a08[_0x0eda('0x43')][_0x0eda('0x7e')]=_0x23e5c9[_0x0eda('0x63')]['Imap'][_0x0eda('0x7e')];_0x210a08['Imap'][_0x0eda('0x7f')]=_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x43')]['port'];_0x210a08['Smtp'][_0x0eda('0x7e')]=_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x5f')]['host'];_0x210a08[_0x0eda('0x5f')][_0x0eda('0x7f')]=_0x23e5c9[_0x0eda('0x63')]['Smtp'][_0x0eda('0x7f')];}else{_0x210a08[_0x0eda('0x43')][_0x0eda('0x80')]=_0x210a08[_0x0eda('0x5f')][_0x0eda('0x80')]=_0x23e5c9[_0x0eda('0x63')][_0x0eda('0x78')];_0x210a08[_0x0eda('0x43')]['user']=_0x210a08[_0x0eda('0x5f')][_0x0eda('0x7a')]=_0x23e5c9[_0x0eda('0x63')]['cuser'];_0x210a08[_0x0eda('0x43')]['password']=_0x210a08[_0x0eda('0x5f')][_0x0eda('0x7c')]=_0x23e5c9['body'][_0x0eda('0x81')];}return db['MailAccount'][_0x0eda('0x6f')](_0x210a08,{'include':[{'model':db[_0x0eda('0x44')],'as':'Smtp'},{'model':db[_0x0eda('0x42')],'as':'Imap'}]})[_0x0eda('0x24')](function(_0x1c1224){var _0x25ef76=_0x23e5c9[_0x0eda('0x7a')]['get']({'plain':!![]});if(!_0x25ef76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ef76[_0x0eda('0x82')]===_0x0eda('0x7a')){var _0x2fe2b7=_0x1c1224[_0x0eda('0x3c')]({'plain':!![]});return db[_0x0eda('0x83')][_0x0eda('0x62')]({'where':{'name':_0x0eda('0x3d'),'userProfileId':_0x25ef76[_0x0eda('0x84')]},'raw':!![]})[_0x0eda('0x24')](function(_0x1315b0){if(_0x1315b0&&_0x1315b0[_0x0eda('0x85')]===0x0){return db[_0x0eda('0x3e')][_0x0eda('0x6f')]({'name':_0x2fe2b7[_0x0eda('0x41')],'resourceId':_0x2fe2b7['id'],'type':_0x1315b0[_0x0eda('0x41')],'sectionId':_0x1315b0['id']},{})[_0x0eda('0x24')](function(){return _0x1c1224;});}else{return _0x1c1224;}})[_0x0eda('0x2f')](function(_0x232dfd){logger[_0x0eda('0x2a')](_0x0eda('0x86'),_0x232dfd);throw _0x232dfd;});}return _0x1c1224;})[_0x0eda('0x24')](respondWithResult(_0x1d8d73,0xc9))[_0x0eda('0x2f')](handleError(_0x1d8d73,null));};exports[_0x0eda('0x87')]=function(_0xd95ce5,_0x155c9e,_0x34da61){return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0xd95ce5['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x155c9e,null))[_0x0eda('0x24')](function(_0x4a864c){if(_0x4a864c){return _0x4a864c[_0x0eda('0x87')]();}return null;})[_0x0eda('0x24')](respondWithResult(_0x155c9e,null))[_0x0eda('0x2f')](handleError(_0x155c9e,null));};exports[_0x0eda('0x88')]=function(_0x4f29f6,_0x44139e,_0x3c4a02){if(_0x4f29f6[_0x0eda('0x63')]['id']){delete _0x4f29f6[_0x0eda('0x63')]['id'];}return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x4f29f6[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x44139e,null))[_0x0eda('0x24')](function(_0x193d09){if(_0x193d09){_0x4f29f6[_0x0eda('0x63')][_0x0eda('0x66')]=_0x193d09['id'];return db[_0x0eda('0x42')][_0x0eda('0x6f')](_0x4f29f6[_0x0eda('0x63')]);}})['then'](respondWithResult(_0x44139e,null))[_0x0eda('0x2f')](handleError(_0x44139e,null));};exports[_0x0eda('0x89')]=function(_0x3dc231,_0x16b6b2,_0x3170c0){return db[_0x0eda('0x47')]['findOne']({'where':{'id':_0x3dc231['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x16b6b2,null))[_0x0eda('0x24')](function(_0xb222c8){if(_0xb222c8){return _0xb222c8[_0x0eda('0x8a')](null);}return null;})[_0x0eda('0x24')](respondWithStatusCode(_0x16b6b2,null))[_0x0eda('0x2f')](handleError(_0x16b6b2,null));};exports['getSmtp']=function(_0x428f71,_0x5eb7d7,_0x2a78b1){return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x428f71[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x5eb7d7,null))['then'](function(_0x9c32f2){if(_0x9c32f2){return _0x9c32f2[_0x0eda('0x8b')]();}return null;})[_0x0eda('0x24')](respondWithResult(_0x5eb7d7,null))['catch'](handleError(_0x5eb7d7,null));};exports[_0x0eda('0x8c')]=function(_0x331cdb,_0x593b5b,_0x138deb){if(_0x331cdb[_0x0eda('0x63')]['id']){delete _0x331cdb[_0x0eda('0x63')]['id'];}return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x331cdb['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x593b5b,null))[_0x0eda('0x24')](function(_0x3c984c){if(_0x3c984c){_0x331cdb['body'][_0x0eda('0x66')]=_0x3c984c['id'];return db[_0x0eda('0x44')]['create'](_0x331cdb['body']);}})[_0x0eda('0x24')](respondWithResult(_0x593b5b,null))['catch'](handleError(_0x593b5b,null));};exports[_0x0eda('0x8d')]=function(_0x49f06d,_0x2ba4c0,_0x2ae0fb){return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x49f06d['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x2ba4c0,null))[_0x0eda('0x24')](function(_0x2a237f){if(_0x2a237f){return _0x2a237f[_0x0eda('0x8e')](null);}return null;})[_0x0eda('0x24')](respondWithStatusCode(_0x2ba4c0,null))[_0x0eda('0x2f')](handleError(_0x2ba4c0,null));};exports[_0x0eda('0x8f')]=function(_0x121b4d,_0x334be8,_0x5654cc){return db[_0x0eda('0x90')][_0x0eda('0x62')]({'where':{'id':_0x121b4d[_0x0eda('0x5e')]['id']}})['then'](handleEntityNotFound(_0x334be8,null))[_0x0eda('0x24')](function(_0x18088e){if(_0x18088e){return _0x18088e[_0x0eda('0x8f')](_0x121b4d['body']['ids'],_[_0x0eda('0x91')](_0x121b4d[_0x0eda('0x63')],[_0x0eda('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x334be8,null))[_0x0eda('0x2f')](handleError(_0x334be8,null));};exports[_0x0eda('0x92')]=function(_0x43d699,_0x13c899,_0x176164){var _0x2d5cfa={'raw':![],'where':{}};var _0x573ed4={};var _0x3cd00f={'count':0x0,'rows':[]};return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x43d699[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x13c899,null))['then'](function(_0x4e38c0){if(_0x4e38c0){_0x573ed4[_0x0eda('0x4b')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x573ed4[_0x0eda('0x4d')]=_[_0x0eda('0x4e')](_0x43d699[_0x0eda('0x4d')]);_0x573ed4[_0x0eda('0x4f')]=_[_0x0eda('0x60')](_0x573ed4[_0x0eda('0x4b')],_0x573ed4[_0x0eda('0x4d')]);_0x2d5cfa[_0x0eda('0x50')]=_[_0x0eda('0x60')](_0x573ed4[_0x0eda('0x4b')],qs['fields'](_0x43d699[_0x0eda('0x4d')]['fields']));_0x2d5cfa[_0x0eda('0x50')]=_0x2d5cfa[_0x0eda('0x50')][_0x0eda('0x52')]?_0x2d5cfa[_0x0eda('0x50')]:_0x573ed4['model'];if(!_0x43d699['query']['hasOwnProperty']('nolimit')){_0x2d5cfa[_0x0eda('0x34')]=qs[_0x0eda('0x34')](_0x43d699['query']['limit']);_0x2d5cfa['offset']=qs[_0x0eda('0x36')](_0x43d699[_0x0eda('0x4d')]['offset']);}_0x2d5cfa[_0x0eda('0x6a')]=qs[_0x0eda('0x55')](_0x43d699[_0x0eda('0x4d')][_0x0eda('0x55')]);_0x2d5cfa[_0x0eda('0x56')]=qs[_0x0eda('0x4f')](_[_0x0eda('0x57')](_0x43d699[_0x0eda('0x4d')],_0x573ed4[_0x0eda('0x4f')]));_0x2d5cfa['where'][_0x0eda('0x66')]=_0x4e38c0['id'];if(_0x43d699[_0x0eda('0x4d')][_0x0eda('0x58')]){_0x2d5cfa[_0x0eda('0x56')]=_[_0x0eda('0x59')](_0x2d5cfa[_0x0eda('0x56')],{'$or':_[_0x0eda('0x4c')](_0x2d5cfa['attributes'],function(_0x55907c){var _0x47a4eb={};_0x47a4eb[_0x55907c]={'$like':'%'+_0x43d699[_0x0eda('0x4d')][_0x0eda('0x58')]+'%'};return _0x47a4eb;})});}_0x2d5cfa=_[_0x0eda('0x59')]({},_0x2d5cfa,_0x43d699[_0x0eda('0x5a')]);return db['MailInteraction'][_0x0eda('0x35')]({'where':_0x2d5cfa[_0x0eda('0x56')]})['then'](function(_0x2c8c41){_0x3cd00f['count']=_0x2c8c41;if(_0x43d699[_0x0eda('0x4d')][_0x0eda('0x61')]){_0x2d5cfa[_0x0eda('0x5b')]=[{'model':db[_0x0eda('0x93')],'as':_0x0eda('0x94'),'required':![]},{'model':db[_0x0eda('0x95')],'as':_0x0eda('0x96'),'attributes':['name',_0x0eda('0x97'),_0x0eda('0x98')],'required':![]},{'model':db[_0x0eda('0x99')],'as':_0x0eda('0x9a'),'attributes':['id','name',_0x0eda('0x9b')],'where':_0x43d699[_0x0eda('0x4d')][_0x0eda('0x9c')]?{'id':_0x43d699[_0x0eda('0x4d')]['tag']}:undefined,'required':_0x43d699[_0x0eda('0x4d')][_0x0eda('0x9c')]?!![]:![]}];}return db[_0x0eda('0x90')][_0x0eda('0x5c')](_0x2d5cfa);})[_0x0eda('0x24')](function(_0xebb5a5){_0x3cd00f[_0x0eda('0x71')]=_0xebb5a5;return _0x3cd00f;});}})['then'](respondWithFilteredResult(_0x13c899,_0x2d5cfa))[_0x0eda('0x2f')](handleError(_0x13c899,null));};exports[_0x0eda('0x9d')]=function addApplications(_0x1812f3,_0x5832a1){var _0x1600ec=_0x1812f3[_0x0eda('0x5e')]['id'];var _0x5d8245=_0x1812f3[_0x0eda('0x63')];var _0x2f0bfa=0xc8;var _0x2c9b2b=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0eda('0x9e')][_0x0eda('0x9f')][_0x0eda('0xa0')]['READ_COMMITTED']},function(_0x3c35d2){return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x1600ec},'transaction':_0x3c35d2})[_0x0eda('0x24')](function(_0x546bd0){if(_0x546bd0){return db[_0x0eda('0xa1')][_0x0eda('0x3b')]({'where':{'MailAccountId':_0x1600ec},'transaction':_0x3c35d2})[_0x0eda('0x24')](function(){var _0x2d3233=_['map'](_0x5d8245,function(_0x39e802){_0x39e802[_0x0eda('0x66')]=_0x1600ec;return _0x39e802;});return db[_0x0eda('0xa1')][_0x0eda('0xa2')](_0x2d3233,{'transaction':_0x3c35d2});});}else{_0x2f0bfa=0x194;_0x2c9b2b=[];}});})['then'](function(){if(_0x2f0bfa!==0x194){return db['MailApplication'][_0x0eda('0xa3')]({'where':{'MailAccountId':_0x1600ec},'order':'priority'})[_0x0eda('0x24')](function(_0x19360f){_0x2c9b2b=_0x19360f;});}})[_0x0eda('0x2f')](function(_0x2afc92){_0x2f0bfa=0x1f4;logger['error'](_0x2afc92['stack']);if(_0x2afc92[_0x0eda('0x41')]){delete _0x2afc92[_0x0eda('0x41')];}_0x2c9b2b=_0x2afc92;})[_0x0eda('0xa4')](function(){if(_0x2c9b2b===null){_0x5832a1[_0x0eda('0x3f')](_0x2f0bfa);}else{if(_0x2f0bfa===0x1f4){_0x5832a1['status'](_0x2f0bfa)['send'](_0x2c9b2b);}else{_0x5832a1['status'](_0x2f0bfa)[_0x0eda('0x32')](_0x2c9b2b);}}});};exports[_0x0eda('0xa5')]=function(_0x5af8c5,_0x1eb021,_0x1b506c){var _0x374582={};var _0x16b97c={};var _0x3a9152;var _0x2f498b;return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x5af8c5['params']['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x1eb021,null))[_0x0eda('0x24')](function(_0x20d5d5){if(_0x20d5d5){_0x3a9152=_0x20d5d5;_0x16b97c[_0x0eda('0x4b')]=_['keys'](db[_0x0eda('0xa1')][_0x0eda('0x48')]);_0x16b97c[_0x0eda('0x4d')]=_[_0x0eda('0x4e')](_0x5af8c5['query']);_0x16b97c[_0x0eda('0x4f')]=_[_0x0eda('0x60')](_0x16b97c[_0x0eda('0x4b')],_0x16b97c[_0x0eda('0x4d')]);_0x374582[_0x0eda('0x50')]=_[_0x0eda('0x60')](_0x16b97c[_0x0eda('0x4b')],qs[_0x0eda('0x51')](_0x5af8c5['query'][_0x0eda('0x51')]));_0x374582[_0x0eda('0x50')]=_0x374582[_0x0eda('0x50')]['length']?_0x374582[_0x0eda('0x50')]:_0x16b97c[_0x0eda('0x4b')];_0x374582[_0x0eda('0x6a')]=qs[_0x0eda('0x55')](_0x5af8c5[_0x0eda('0x4d')]['sort']);_0x374582[_0x0eda('0x56')]=qs[_0x0eda('0x4f')](_[_0x0eda('0x57')](_0x5af8c5[_0x0eda('0x4d')],_0x16b97c['filters']));if(_0x5af8c5[_0x0eda('0x4d')]['filter']){_0x374582['where']=_[_0x0eda('0x59')](_0x374582[_0x0eda('0x56')],{'$or':_[_0x0eda('0x4c')](_0x374582[_0x0eda('0x50')],function(_0x15fdd8){var _0x3987f6={};_0x3987f6[_0x15fdd8]={'$like':'%'+_0x5af8c5[_0x0eda('0x4d')][_0x0eda('0x58')]+'%'};return _0x3987f6;})});}_0x374582=_[_0x0eda('0x59')]({},_0x374582,_0x5af8c5['options']);return _0x3a9152[_0x0eda('0xa5')](_0x374582);}})[_0x0eda('0x24')](function(_0x44fca3){if(_0x44fca3){_0x2f498b=_0x44fca3[_0x0eda('0x52')];if(!_0x5af8c5[_0x0eda('0x4d')][_0x0eda('0x53')]('nolimit')){_0x374582[_0x0eda('0x34')]=qs[_0x0eda('0x34')](_0x5af8c5[_0x0eda('0x4d')][_0x0eda('0x34')]);_0x374582['offset']=qs[_0x0eda('0x36')](_0x5af8c5[_0x0eda('0x4d')][_0x0eda('0x36')]);}return _0x3a9152[_0x0eda('0xa5')](_0x374582);}})[_0x0eda('0x24')](function(_0x344d41){if(_0x344d41){return _0x344d41?{'count':_0x2f498b,'rows':_0x344d41}:null;}})[_0x0eda('0x24')](respondWithResult(_0x1eb021,null))['catch'](handleError(_0x1eb021,null));};exports[_0x0eda('0xa6')]=function(_0x2039f0,_0x2a9799,_0x3b5174){var _0x15ee33={'raw':!![],'where':{}};var _0x286779={};var _0x1767b7={'count':0x0,'rows':[]};return db['MailAccount'][_0x0eda('0x69')]({'where':{'id':_0x2039f0[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x2a9799,null))[_0x0eda('0x24')](function(_0x5226b1){if(_0x5226b1){_0x286779['model']=_[_0x0eda('0x4e')](db['MailMessage'][_0x0eda('0x48')]);_0x286779['query']=_[_0x0eda('0x4e')](_0x2039f0[_0x0eda('0x4d')]);_0x286779[_0x0eda('0x4f')]=_[_0x0eda('0x60')](_0x286779['model'],_0x286779[_0x0eda('0x4d')]);_0x15ee33[_0x0eda('0x50')]=_[_0x0eda('0x60')](_0x286779[_0x0eda('0x4b')],qs[_0x0eda('0x51')](_0x2039f0[_0x0eda('0x4d')]['fields']));_0x15ee33[_0x0eda('0x50')]=_0x15ee33['attributes']['length']?_0x15ee33[_0x0eda('0x50')]:_0x286779['model'];if(!_0x2039f0[_0x0eda('0x4d')][_0x0eda('0x53')](_0x0eda('0x54'))){_0x15ee33[_0x0eda('0x34')]=qs[_0x0eda('0x34')](_0x2039f0[_0x0eda('0x4d')][_0x0eda('0x34')]);_0x15ee33[_0x0eda('0x36')]=qs[_0x0eda('0x36')](_0x2039f0['query'][_0x0eda('0x36')]);}_0x15ee33[_0x0eda('0x6a')]=qs[_0x0eda('0x55')](_0x2039f0[_0x0eda('0x4d')][_0x0eda('0x55')]);_0x15ee33[_0x0eda('0x56')]=qs[_0x0eda('0x4f')](_[_0x0eda('0x57')](_0x2039f0[_0x0eda('0x4d')],_0x286779[_0x0eda('0x4f')]));_0x15ee33['where']['MailAccountId']=_0x5226b1['id'];if(_0x2039f0[_0x0eda('0x4d')][_0x0eda('0x58')]){_0x15ee33[_0x0eda('0x56')]=_[_0x0eda('0x59')](_0x15ee33[_0x0eda('0x56')],{'$or':_['map'](_0x15ee33[_0x0eda('0x50')],function(_0x1218d1){var _0x43bc47={};_0x43bc47[_0x1218d1]={'$like':'%'+_0x2039f0[_0x0eda('0x4d')][_0x0eda('0x58')]+'%'};return _0x43bc47;})});}if(_0x2039f0[_0x0eda('0x4d')][_0x0eda('0xa7')]){var _0x41c5b5=_0x2039f0['query'][_0x0eda('0xa7')][_0x0eda('0xa8')](',');var _0x139e96={};_0x139e96[_0x41c5b5[0x0]]={'$gte':moment(_0x41c5b5[0x1])[_0x0eda('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x15ee33[_0x0eda('0x56')]=_[_0x0eda('0x59')](_0x15ee33['where'],_0x139e96);}_0x15ee33=_[_0x0eda('0x59')]({},_0x15ee33,_0x2039f0[_0x0eda('0x5a')]);return db[_0x0eda('0xaa')]['count']({'where':_0x15ee33[_0x0eda('0x56')]})[_0x0eda('0x24')](function(_0x2437b0){_0x1767b7[_0x0eda('0x35')]=_0x2437b0;if(_0x2039f0['query']['includeAll']){_0x15ee33[_0x0eda('0x5b')]=[{'all':!![]}];}return db[_0x0eda('0xaa')]['findAll'](_0x15ee33);})[_0x0eda('0x24')](function(_0x1256cf){if(_0x2039f0[_0x0eda('0x4d')][_0x0eda('0xab')]==='true'){for(var _0x4e0ba9=0x0;_0x4e0ba9<_0x1256cf[_0x0eda('0x52')];_0x4e0ba9++){_0x1256cf[_0x4e0ba9][_0x0eda('0x63')]=juice(_0x1256cf[_0x4e0ba9][_0x0eda('0x63')]);}}_0x1767b7[_0x0eda('0x71')]=_0x1256cf;return _0x1767b7;});}})['then'](respondWithFilteredResult(_0x2a9799,_0x15ee33))[_0x0eda('0x2f')](handleError(_0x2a9799,null));};exports['send']=function(_0x1b2cb8,_0x1a278a,_0x6940e){var _0x59db63,_0x31dc46={},_0xe976a5;if(_0x1b2cb8[_0x0eda('0x63')]['to']){_0xe976a5=_0x1b2cb8[_0x0eda('0x63')]['to'][_0x0eda('0xa8')](',')[0x0];}return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x1b2cb8[_0x0eda('0x5e')]['id']},'include':[{'model':db[_0x0eda('0xac')],'as':'List','include':[{'model':db[_0x0eda('0x93')],'as':_0x0eda('0xad'),'where':{'email':_0xe976a5},'limit':0x1,'order':[[_0x0eda('0xae'),_0x0eda('0xaf')]]}]},{'model':db['MailServerOut'],'as':_0x0eda('0x5f'),'raw':!![]}]})[_0x0eda('0x24')](handleEntityNotFound(_0x1a278a,null))[_0x0eda('0x24')](function(_0x33675e){if(_0x33675e){_0x59db63=_0x33675e;if(_0x33675e[_0x0eda('0x5f')]){if(_[_0x0eda('0x75')](_0x1b2cb8[_0x0eda('0x63')][_0x0eda('0xb0')])){_0x1b2cb8[_0x0eda('0x63')]['from']=util[_0x0eda('0xa9')](_0x0eda('0xb1'),_0x33675e['name'],_0x33675e[_0x0eda('0xb2')]||_0x33675e['Smtp'][_0x0eda('0x7a')]);}if(_0x1b2cb8['body']['attachments']&&_0x1b2cb8[_0x0eda('0x63')][_0x0eda('0xb3')][_0x0eda('0x52')]){for(var _0x1f2662=0x0;_0x1f2662<_0x1b2cb8[_0x0eda('0x63')][_0x0eda('0xb3')][_0x0eda('0x52')];_0x1f2662+=0x1){_0x1b2cb8[_0x0eda('0x63')][_0x0eda('0xb3')][_0x1f2662]={'filename':_0x1b2cb8[_0x0eda('0x63')]['attachments'][_0x1f2662][_0x0eda('0x41')],'path':path[_0x0eda('0xb4')](config[_0x0eda('0xb5')],_0x0eda('0xb6'),_0x1b2cb8[_0x0eda('0x63')]['attachments'][_0x1f2662][_0x0eda('0xb7')])};}}var _0x46199a={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x33675e[_0x0eda('0x5f')][_0x0eda('0x80')])){if(_0x33675e[_0x0eda('0x5f')][_0x0eda('0x7d')]){_0x46199a['auth']={'user':_0x33675e[_0x0eda('0x5f')][_0x0eda('0x7a')],'pass':_0x33675e[_0x0eda('0x5f')][_0x0eda('0x7c')]};}_0x46199a[_0x0eda('0x7e')]=_0x33675e['Smtp'][_0x0eda('0x7e')];_0x46199a[_0x0eda('0x7f')]=_0x33675e[_0x0eda('0x5f')]['port'];_0x46199a['secure']=_0x33675e['Smtp'][_0x0eda('0xb8')];}else{_0x46199a['service']=_0x33675e[_0x0eda('0x5f')]['service'];_0x46199a[_0x0eda('0xb9')]={'user':_0x33675e['Smtp'][_0x0eda('0x7a')],'pass':_0x33675e['Smtp'][_0x0eda('0x7c')]};}return respondWithRpcPromise('SendMail',_0x0eda('0xba'),{'account':_0x46199a,'message':_0x1b2cb8['body']});}else{throw new Error(_0x0eda('0xbb'));}}})[_0x0eda('0x24')](function(_0x54c1da){if(_0x54c1da){_0x31dc46=_0x54c1da;if(_0x59db63[_0x0eda('0xbc')]){if(_0x59db63[_0x0eda('0xbc')][_0x0eda('0xad')][_0x0eda('0x52')]){return _0x59db63[_0x0eda('0xbc')][_0x0eda('0xad')][0x0];}else{return db[_0x0eda('0x93')][_0x0eda('0x6f')](_['defaults'](_0x1b2cb8['body'],{'firstName':_0x1b2cb8[_0x0eda('0x63')]['to'],'email':_0x1b2cb8[_0x0eda('0x63')]['to'],'phone':_0x1b2cb8[_0x0eda('0x63')]['to'],'ListId':_0x59db63[_0x0eda('0x74')]}));}}else{throw new Error(_0x0eda('0xbb'));}}})[_0x0eda('0x24')](function(_0x46003c){if(_0x46003c){var _0x393815={'UserId':_0x1b2cb8[_0x0eda('0x7a')]['id'],'ContactId':_0x46003c['id'],'MailAccountId':_0x59db63['id'],'inReplyTo':_0x31dc46[_0x0eda('0xbd')],'to':_0x1b2cb8['body']['from'],'cc':_0x1b2cb8[_0x0eda('0x63')]['cc'],'subject':_0x1b2cb8[_0x0eda('0x63')][_0x0eda('0xbe')],'attach':_0x1b2cb8[_0x0eda('0x63')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x0eda('0xbf')),'lastMsgDirection':_0x0eda('0xc0'),'Messages':[_[_0x0eda('0x59')](_0x1b2cb8[_0x0eda('0x63')],{'messageId':_0x31dc46[_0x0eda('0xbd')],'sentAt':moment()['format'](_0x0eda('0xbf')),'read':!![],'MailAccountId':_0x59db63['id'],'UserId':_0x1b2cb8[_0x0eda('0x7a')]['id'],'ContactId':_0x46003c['id']})]};if(_0x1b2cb8['body'][_0x0eda('0xc1')]){_0x393815=_[_0x0eda('0x59')](_0x393815,_0x1b2cb8['body'][_0x0eda('0xc1')]);}return db[_0x0eda('0x90')][_0x0eda('0x6f')](_0x393815,{'include':[{'model':db[_0x0eda('0xaa')],'as':_0x0eda('0xc2')}]});}})[_0x0eda('0x24')](respondWithResult(_0x1a278a,null))[_0x0eda('0x2f')](handleError(_0x1a278a,null));};exports[_0x0eda('0xc3')]=function(_0x5783f1,_0xf0a20d,_0x519745){return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0x5783f1['params']['id']},'include':[{'model':db[_0x0eda('0x44')],'as':_0x0eda('0x5f'),'raw':!![]}]})[_0x0eda('0x24')](handleEntityNotFound(_0xf0a20d,null))['then'](function(_0x4efa0f){if(_0x4efa0f&&_0x4efa0f[_0x0eda('0x5f')]){var _0x4df122={'id':_0x4efa0f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4efa0f[_0x0eda('0x5f')]['service']){_0x4df122[_0x0eda('0x80')]=_0x4efa0f[_0x0eda('0x5f')]['service'];}else{_0x4df122[_0x0eda('0x7e')]=_0x4efa0f[_0x0eda('0x5f')]['host'];_0x4df122[_0x0eda('0x7f')]=_0x4efa0f['Smtp'][_0x0eda('0x7f')];_0x4df122[_0x0eda('0xb8')]=_0x4efa0f['Smtp']['secure'];}if(_0x4efa0f[_0x0eda('0x5f')][_0x0eda('0x7d')]){_0x4df122[_0x0eda('0xb9')]={'user':_0x4efa0f[_0x0eda('0x5f')][_0x0eda('0x7a')],'pass':_0x4efa0f[_0x0eda('0x5f')][_0x0eda('0x7c')]};}return respondWithRpcPromise(_0x0eda('0xc4'),_0x0eda('0xc3'),{'account':_0x4df122});}})[_0x0eda('0x24')](respondWithResult(_0xf0a20d,null))[_0x0eda('0x2f')](handleError(_0xf0a20d,null));};exports[_0x0eda('0x3b')]=function(_0xd6a07f,_0xba36ac){return db[_0x0eda('0x47')][_0x0eda('0x62')]({'where':{'id':_0xd6a07f[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0xba36ac,null))[_0x0eda('0x24')](function(_0x4a4a9c){if(_0x4a4a9c&&_0x4a4a9c[_0x0eda('0x80')]){throw new db[(_0x0eda('0xc5'))]['ValidationError'](_0x0eda('0xc6'));}return _0x4a4a9c;})[_0x0eda('0x24')](removeEntity(_0xba36ac,null))[_0x0eda('0x2f')](handleError(_0xba36ac,null));};exports[_0x0eda('0xc7')]=function(_0x6213cc,_0x756107,_0x5ccaaa){return db['MailAccount'][_0x0eda('0x62')]({'where':{'id':_0x6213cc[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x756107,null))['then'](function(_0x290230){if(_0x290230){return _0x290230['addAgents'](_0x6213cc[_0x0eda('0x63')][_0x0eda('0x6c')],_['omit'](_0x6213cc[_0x0eda('0x63')],[_0x0eda('0x6c'),'id'])||{})[_0x0eda('0xc8')](function(_0x2310dc){for(var _0x594a2e=0x0;_0x594a2e<_0x6213cc[_0x0eda('0x63')][_0x0eda('0x6c')][_0x0eda('0x52')];_0x594a2e+=0x1){socket[_0x0eda('0xc9')](_0x0eda('0xca'),{'UserId':Number(_0x6213cc[_0x0eda('0x63')][_0x0eda('0x6c')][_0x594a2e]),'MailAccountId':Number(_0x6213cc[_0x0eda('0x5e')]['id'])});}return _0x2310dc;});}})[_0x0eda('0x24')](respondWithResult(_0x756107,null))[_0x0eda('0x2f')](handleError(_0x756107,null));};exports[_0x0eda('0xcb')]=function(_0xef7645,_0x2da916,_0x499f6c){return db[_0x0eda('0x47')]['find']({'where':{'id':_0xef7645[_0x0eda('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2da916,null))[_0x0eda('0x24')](function(_0x42e21a){if(_0x42e21a){return _0x42e21a['removeAgents'](_0xef7645[_0x0eda('0x4d')][_0x0eda('0x6c')])[_0x0eda('0x24')](function(){if(_[_0x0eda('0xcc')](_0xef7645[_0x0eda('0x4d')]['ids'])){for(var _0x7816e3=0x0;_0x7816e3<_0xef7645[_0x0eda('0x4d')][_0x0eda('0x6c')][_0x0eda('0x52')];_0x7816e3+=0x1){socket[_0x0eda('0xc9')](_0x0eda('0xcd'),{'UserId':Number(_0xef7645[_0x0eda('0x4d')][_0x0eda('0x6c')][_0x7816e3]),'MailAccountId':Number(_0xef7645[_0x0eda('0x5e')]['id'])});}}else{socket[_0x0eda('0xc9')](_0x0eda('0xcd'),{'UserId':Number(_0xef7645[_0x0eda('0x4d')][_0x0eda('0x6c')]),'MailAccountId':Number(_0xef7645[_0x0eda('0x5e')]['id'])});}});}})[_0x0eda('0x24')](respondWithStatusCode(_0x2da916,null))[_0x0eda('0x2f')](handleError(_0x2da916,null));};exports['getAgents']=function(_0x15c1d5,_0x684a93,_0x5ce518){var _0x1996df={};var _0x50ea18={};var _0x55a495;var _0x38f8b5;return db[_0x0eda('0x47')][_0x0eda('0x69')]({'where':{'id':_0x15c1d5[_0x0eda('0x5e')]['id']}})[_0x0eda('0x24')](handleEntityNotFound(_0x684a93,null))[_0x0eda('0x24')](function(_0x1106f3){if(_0x1106f3){_0x55a495=_0x1106f3;_0x50ea18[_0x0eda('0x4b')]=_[_0x0eda('0x4e')](db[_0x0eda('0x95')][_0x0eda('0x48')]);_0x50ea18[_0x0eda('0x4d')]=_[_0x0eda('0x4e')](_0x15c1d5['query']);_0x50ea18[_0x0eda('0x4f')]=_[_0x0eda('0x60')](_0x50ea18['model'],_0x50ea18[_0x0eda('0x4d')]);_0x1996df[_0x0eda('0x50')]=_[_0x0eda('0x60')](_0x50ea18['model'],qs[_0x0eda('0x51')](_0x15c1d5[_0x0eda('0x4d')][_0x0eda('0x51')]));_0x1996df[_0x0eda('0x50')]=_0x1996df[_0x0eda('0x50')][_0x0eda('0x52')]?_0x1996df[_0x0eda('0x50')]:_0x50ea18[_0x0eda('0x4b')];_0x1996df[_0x0eda('0x6a')]=qs[_0x0eda('0x55')](_0x15c1d5['query'][_0x0eda('0x55')]);_0x1996df[_0x0eda('0x56')]=qs['filters'](_[_0x0eda('0x57')](_0x15c1d5[_0x0eda('0x4d')],_0x50ea18[_0x0eda('0x4f')]));if(_0x15c1d5['query'][_0x0eda('0x58')]){_0x1996df[_0x0eda('0x56')]=_['merge'](_0x1996df[_0x0eda('0x56')],{'$or':_[_0x0eda('0x4c')](_0x1996df[_0x0eda('0x50')],function(_0x4441a3){var _0x522ffd={};_0x522ffd[_0x4441a3]={'$like':'%'+_0x15c1d5[_0x0eda('0x4d')]['filter']+'%'};return _0x522ffd;})});}_0x1996df=_[_0x0eda('0x59')]({},_0x1996df,_0x15c1d5[_0x0eda('0x5a')]);return _0x55a495[_0x0eda('0xce')](_0x1996df);}})['then'](function(_0x75b129){if(_0x75b129){_0x38f8b5=_0x75b129[_0x0eda('0x52')];if(!_0x15c1d5[_0x0eda('0x4d')][_0x0eda('0x53')](_0x0eda('0x54'))){_0x1996df[_0x0eda('0x34')]=qs[_0x0eda('0x34')](_0x15c1d5[_0x0eda('0x4d')]['limit']);_0x1996df[_0x0eda('0x36')]=qs[_0x0eda('0x36')](_0x15c1d5[_0x0eda('0x4d')]['offset']);}return _0x55a495[_0x0eda('0xce')](_0x1996df);}})[_0x0eda('0x24')](function(_0x11ec0e){if(_0x11ec0e){return _0x11ec0e?{'count':_0x38f8b5,'rows':_0x11ec0e}:null;}})[_0x0eda('0x24')](respondWithResult(_0x684a93,null))[_0x0eda('0x2f')](handleError(_0x684a93,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index d287b06..0b39bca 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 _0x63d4=['../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ec671,_0x40c219){var _0x55422e=function(_0x3503bc){while(--_0x3503bc){_0x3ec671['push'](_0x3ec671['shift']());}};_0x55422e(++_0x40c219);}(_0x63d4,0x117));var _0x463d=function(_0x59bcb1,_0x19243e){_0x59bcb1=_0x59bcb1-0x0;var _0x489878=_0x63d4[_0x59bcb1];return _0x489878;};'use strict';var EventEmitter=require(_0x463d('0x0'));var MailAccount=require(_0x463d('0x1'))['db'][_0x463d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x463d('0x3'),'afterUpdate':_0x463d('0x4'),'afterDestroy':_0x463d('0x5')};function emitEvent(_0x138617){return function(_0x3127f4,_0x4d8b9a,_0x23693c){MailAccountEvents[_0x463d('0x6')](_0x138617+':'+_0x3127f4['id'],_0x3127f4);MailAccountEvents['emit'](_0x138617,_0x3127f4);_0x23693c(null);};}for(var e in events){if(events[_0x463d('0x7')](e)){var event=events[e];MailAccount[_0x463d('0x8')](e,emitEvent(event));}}module[_0x463d('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x21cd=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x21cd,0x6a));var _0xd21c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x21cd[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require(_0xd21c('0x0'));var MailAccount=require(_0xd21c('0x1'))['db'][_0xd21c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd21c('0x3')](0x0);var events={'afterCreate':_0xd21c('0x4'),'afterUpdate':_0xd21c('0x5'),'afterDestroy':_0xd21c('0x6')};function emitEvent(_0xd67178){return function(_0x4122cb,_0x53e0b2,_0x5902fc){MailAccountEvents[_0xd21c('0x7')](_0xd67178+':'+_0x4122cb['id'],_0x4122cb);MailAccountEvents[_0xd21c('0x7')](_0xd67178,_0x4122cb);_0x5902fc(null);};}for(var e in events){if(events[_0xd21c('0x8')](e)){var event=events[e];MailAccount[_0xd21c('0x9')](e,emitEvent(event));}}module[_0xd21c('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5f2315c..e7f3c92 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 _0xaf21=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util'];(function(_0x5a0afd,_0x113988){var _0x4899fa=function(_0x121cf5){while(--_0x121cf5){_0x5a0afd['push'](_0x5a0afd['shift']());}};_0x4899fa(++_0x113988);}(_0xaf21,0xc1));var _0x1af2=function(_0x1b147e,_0x49edc2){_0x1b147e=_0x1b147e-0x0;var _0x5a400e=_0xaf21[_0x1b147e];return _0x5a400e;};'use strict';var _=require(_0x1af2('0x0'));var util=require(_0x1af2('0x1'));var logger=require('../../config/logger')(_0x1af2('0x2'));var moment=require('moment');var BPromise=require(_0x1af2('0x3'));var rp=require(_0x1af2('0x4'));var fs=require('fs');var path=require(_0x1af2('0x5'));var rimraf=require(_0x1af2('0x6'));var config=require(_0x1af2('0x7'));var attributes=require(_0x1af2('0x8'));module[_0x1af2('0x9')]=function(_0x119149,_0x4ecf88){return _0x119149[_0x1af2('0xa')](_0x1af2('0xb'),attributes,{'tableName':_0x1af2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d08=['MailAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define'];(function(_0x5577a4,_0x37cabc){var _0x40f639=function(_0x2bb3e6){while(--_0x2bb3e6){_0x5577a4['push'](_0x5577a4['shift']());}};_0x40f639(++_0x37cabc);}(_0x8d08,0x69));var _0x88d0=function(_0xc84e3,_0xd631b){_0xc84e3=_0xc84e3-0x0;var _0x437a90=_0x8d08[_0xc84e3];return _0x437a90;};'use strict';var _=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var logger=require(_0x88d0('0x2'))(_0x88d0('0x3'));var moment=require(_0x88d0('0x4'));var BPromise=require(_0x88d0('0x5'));var rp=require(_0x88d0('0x6'));var fs=require('fs');var path=require(_0x88d0('0x7'));var rimraf=require(_0x88d0('0x8'));var config=require('../../config/environment');var attributes=require(_0x88d0('0x9'));module[_0x88d0('0xa')]=function(_0x5c8ad6,_0x4b345c){return _0x5c8ad6[_0x88d0('0xb')](_0x88d0('0xc'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index fcdda8e..0443183 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 _0xfee7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','account','omit','applications','list','priority','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','interaction','created','attachments','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0xfee7,0xd5));var _0x7fee=function(_0xfc26ae,_0x1de6fd){_0xfc26ae=_0xfc26ae-0x0;var _0x2fb46c=_0xfee7[_0xfc26ae];return _0x2fb46c;};'use strict';var _=require(_0x7fee('0x0'));var util=require(_0x7fee('0x1'));var moment=require(_0x7fee('0x2'));var BPromise=require('bluebird');var rs=require(_0x7fee('0x3'));var fs=require('fs');var Redis=require(_0x7fee('0x4'));var db=require(_0x7fee('0x5'))['db'];var utils=require(_0x7fee('0x6'));var logger=require(_0x7fee('0x7'))(_0x7fee('0x8'));var config=require(_0x7fee('0x9'));var jayson=require(_0x7fee('0xa'));var client=jayson[_0x7fee('0xb')][_0x7fee('0xc')]({'port':0x232c});config['redis']=_[_0x7fee('0xd')](config[_0x7fee('0xe')],{'host':_0x7fee('0xf'),'port':0x18eb});var socket=require(_0x7fee('0x10'))(new Redis(config[_0x7fee('0xe')]));require('./mailAccount.socket')[_0x7fee('0x11')](socket);function respondWithRpcPromise(_0x128445,_0x4078dd,_0x438498){return new BPromise(function(_0x58de3d,_0x58cdd7){return client['request'](_0x128445,_0x438498)['then'](function(_0x34fd4d){logger['info'](_0x7fee('0x12'),_0x4078dd,_0x7fee('0x13'));logger[_0x7fee('0x14')](_0x7fee('0x15'),_0x4078dd,_0x7fee('0x13'),JSON[_0x7fee('0x16')](_0x34fd4d));if(_0x34fd4d[_0x7fee('0x17')]){if(_0x34fd4d[_0x7fee('0x17')][_0x7fee('0x18')]===0x1f4){logger['error'](_0x7fee('0x12'),_0x4078dd,_0x34fd4d[_0x7fee('0x17')][_0x7fee('0x19')]);return _0x58cdd7(_0x34fd4d[_0x7fee('0x17')][_0x7fee('0x19')]);}logger['error'](_0x7fee('0x12'),_0x4078dd,_0x34fd4d[_0x7fee('0x17')][_0x7fee('0x19')]);return _0x58de3d(_0x34fd4d['error'][_0x7fee('0x19')]);}else{logger[_0x7fee('0x1a')](_0x7fee('0x12'),_0x4078dd,_0x7fee('0x13'));_0x58de3d(_0x34fd4d[_0x7fee('0x1b')][_0x7fee('0x19')]);}})[_0x7fee('0x1c')](function(_0x30102d){logger['error'](_0x7fee('0x12'),_0x4078dd,_0x30102d);_0x58cdd7(_0x30102d);});});}exports[_0x7fee('0x1d')]=function(_0x204f0d){var _0x44a97c=this;return new Promise(function(_0x38932d,_0x4e1b32){return db[_0x7fee('0x1e')][_0x7fee('0x1f')]({'raw':_0x204f0d[_0x7fee('0x20')]?_0x204f0d[_0x7fee('0x20')][_0x7fee('0x21')]===undefined?!![]:![]:!![],'where':_0x204f0d[_0x7fee('0x20')]?_0x204f0d[_0x7fee('0x20')]['where']||null:null,'attributes':_0x204f0d[_0x7fee('0x20')]?_0x204f0d[_0x7fee('0x20')][_0x7fee('0x22')]||null:null,'limit':_0x204f0d['options']?_0x204f0d[_0x7fee('0x20')][_0x7fee('0x23')]||null:null,'include':_0x204f0d[_0x7fee('0x20')]?_0x204f0d[_0x7fee('0x20')][_0x7fee('0x24')]?_[_0x7fee('0x25')](_0x204f0d[_0x7fee('0x20')][_0x7fee('0x24')],function(_0x9719c){return{'model':db[_0x9719c[_0x7fee('0x26')]],'as':_0x9719c['as'],'attributes':_0x9719c[_0x7fee('0x22')],'include':_0x9719c[_0x7fee('0x24')]?_[_0x7fee('0x25')](_0x9719c['include'],function(_0x3ad72e){return{'model':db[_0x3ad72e[_0x7fee('0x26')]],'as':_0x3ad72e['as'],'attributes':_0x3ad72e[_0x7fee('0x22')],'include':_0x3ad72e[_0x7fee('0x24')]?_[_0x7fee('0x25')](_0x3ad72e['include'],function(_0x808793){return{'model':db[_0x808793['model']],'as':_0x808793['as'],'attributes':_0x808793[_0x7fee('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7fee('0x27')](function(_0x5c8c22){logger[_0x7fee('0x1a')](_0x7fee('0x1d'),_0x204f0d);logger[_0x7fee('0x14')](_0x7fee('0x1d'),_0x204f0d,JSON[_0x7fee('0x16')](_0x5c8c22));_0x38932d(_0x5c8c22);})['catch'](function(_0x1b50fd){logger[_0x7fee('0x17')]('GetMailAccount',_0x1b50fd['message'],_0x204f0d);_0x4e1b32(_0x44a97c[_0x7fee('0x17')](0x1f4,_0x1b50fd[_0x7fee('0x19')]));});});};exports[_0x7fee('0x28')]=function(_0x3e177d){var _0x1419af=this;return new Promise(function(_0x503fe1,_0x5c09d1){return db[_0x7fee('0x1e')][_0x7fee('0x29')]({'raw':_0x3e177d['options']?_0x3e177d[_0x7fee('0x20')][_0x7fee('0x21')]===undefined?!![]:![]:!![],'where':_0x3e177d[_0x7fee('0x20')]?_0x3e177d[_0x7fee('0x20')][_0x7fee('0x2a')]||null:null,'attributes':_0x3e177d[_0x7fee('0x20')]?_0x3e177d[_0x7fee('0x20')][_0x7fee('0x22')]||null:null,'include':_0x3e177d[_0x7fee('0x20')]?_0x3e177d[_0x7fee('0x20')][_0x7fee('0x24')]?_[_0x7fee('0x25')](_0x3e177d['options'][_0x7fee('0x24')],function(_0x2b5790){return{'model':db[_0x2b5790[_0x7fee('0x26')]],'as':_0x2b5790['as'],'attributes':_0x2b5790[_0x7fee('0x22')],'include':_0x2b5790[_0x7fee('0x24')]?_[_0x7fee('0x25')](_0x2b5790[_0x7fee('0x24')],function(_0x128de3){return{'model':db[_0x128de3[_0x7fee('0x26')]],'as':_0x128de3['as'],'attributes':_0x128de3[_0x7fee('0x22')],'include':_0x128de3[_0x7fee('0x24')]?_['map'](_0x128de3[_0x7fee('0x24')],function(_0x3f53fd){return{'model':db[_0x3f53fd[_0x7fee('0x26')]],'as':_0x3f53fd['as'],'attributes':_0x3f53fd[_0x7fee('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b7607){logger[_0x7fee('0x1a')](_0x7fee('0x28'),_0x3e177d);logger[_0x7fee('0x14')]('ShowMailAccount',_0x3e177d,JSON[_0x7fee('0x16')](_0x1b7607));_0x503fe1(_0x1b7607);})[_0x7fee('0x1c')](function(_0x30f8d3){logger[_0x7fee('0x17')]('ShowMailAccount',_0x30f8d3[_0x7fee('0x19')],_0x3e177d);_0x5c09d1(_0x1419af[_0x7fee('0x17')](0x1f4,_0x30f8d3[_0x7fee('0x19')]));});});};exports[_0x7fee('0x2b')]=function(_0x15c7b7){var _0x2174d0=this;return new Promise(function(_0x1c1ce3,_0x38121c){var _0x6fe2fe={'body':_0x15c7b7[_0x7fee('0x2c')],'channel':_0x7fee('0x2d')};var _0x478078=_[_0x7fee('0x2e')](_['keys'](db[_0x7fee('0x2f')][_0x7fee('0x30')]),[_0x7fee('0x31'),_0x7fee('0x32'),_0x7fee('0x33'),_0x7fee('0x34')]);var _0x51d135=![];if(_0x15c7b7[_0x7fee('0x2c')]['id']){delete _0x15c7b7[_0x7fee('0x2c')]['id'];}if(_[_0x7fee('0x35')](_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x36')])){return _0x38121c(_0x2174d0['error'](0x1f4,_0x7fee('0x37')));}if(_[_0x7fee('0x35')](_0x15c7b7[_0x7fee('0x2c')]['body'])||_0x15c7b7[_0x7fee('0x2c')]['body']===''){return _0x38121c(_0x2174d0[_0x7fee('0x17')](0x1f4,_0x7fee('0x38')));}if(_[_0x7fee('0x35')](_0x15c7b7['body'][_0x7fee('0x39')])){return _0x38121c(_0x2174d0[_0x7fee('0x17')](0x1f4,_0x7fee('0x3a')+_0x478078));}if(!_['includes'](_0x478078,_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x39')])){return _0x38121c(_0x2174d0[_0x7fee('0x17')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x478078));}var _0x4e5fae={};_0x4e5fae[_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x39')]]=_0x15c7b7['body']['from'];return db[_0x7fee('0x1e')][_0x7fee('0x29')]({'where':{'id':_0x15c7b7['account']['id']},'include':[{'model':db[_0x7fee('0x3b')],'as':'List','include':[{'model':db[_0x7fee('0x2f')],'as':_0x7fee('0x3c'),'where':_0x4e5fae,'limit':0x1,'order':[[_0x7fee('0x32'),_0x7fee('0x3d')]]}]},{'model':db[_0x7fee('0x3e')],'as':_0x7fee('0x3f')},{'model':db[_0x7fee('0x40')],'as':_0x7fee('0x41')}]})[_0x7fee('0x27')](function(_0x411566){if(_0x411566&&_0x411566[_0x7fee('0x42')]){var _0xa33a60=_0x411566['get']({'plain':!![]});_0x6fe2fe[_0x7fee('0x43')]=_[_0x7fee('0x44')](_0xa33a60,[_0x7fee('0x3f'),_0x7fee('0x42')]);_0x6fe2fe[_0x7fee('0x45')]=_0xa33a60['Applications'];_0x6fe2fe[_0x7fee('0x46')]=_0xa33a60['List'];_0x6fe2fe[_0x7fee('0x45')]=_['orderBy'](_0x6fe2fe[_0x7fee('0x45')],[_0x7fee('0x47')],['asc']);if(_0x6fe2fe[_0x7fee('0x43')]&&_0x6fe2fe[_0x7fee('0x43')][_0x7fee('0x48')]){_0x6fe2fe['applications'][_0x7fee('0x49')]({'id':0x0,'priority':_0x6fe2fe['applications'][_0x7fee('0x4a')]+0x1,'app':_0x7fee('0x4b'),'appdata':_0x7fee('0x48'),'interval':_0x7fee('0x4c')});}if(_0x6fe2fe[_0x7fee('0x43')][_0x7fee('0x3f')]){delete _0x6fe2fe[_0x7fee('0x43')]['Applications'];}if(_0x6fe2fe[_0x7fee('0x43')][_0x7fee('0x42')]){delete _0x6fe2fe[_0x7fee('0x43')][_0x7fee('0x42')];}if(_0xa33a60[_0x7fee('0x42')]['Contacts']['length']){return _0xa33a60[_0x7fee('0x42')]['Contacts'][0x0];}var _0x3a366d=_['defaults'](_0x15c7b7['body'],{'firstName':_0x15c7b7['body'][_0x7fee('0x36')],'ListId':_0xa33a60[_0x7fee('0x34')]});_0x3a366d[_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x39')]]=_0x15c7b7[_0x7fee('0x2c')]['from'];return db['CmContact'][_0x7fee('0x4d')](_0x3a366d);}else{throw new Error(_0x7fee('0x4e'));}})[_0x7fee('0x27')](function(_0x1b34c8){_0x6fe2fe[_0x7fee('0x4f')]=_0x1b34c8;if(_0x1b34c8){if(!_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x50')]){_0x15c7b7['body'][_0x7fee('0x19')][_0x7fee('0x50')]=rs[_0x7fee('0x51')]()+'\x20'+_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x36')];}var _0x2c766c={'ContactId':_0x1b34c8['id'],'MailAccountId':_0x15c7b7['account']['id'],'inReplyTo':_0x15c7b7[_0x7fee('0x2c')]['message'][_0x7fee('0x50')],'to':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x36')],'cc':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')]['cc'],'subject':_0x15c7b7['body'][_0x7fee('0x19')][_0x7fee('0x52')],'attach':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x53')],'lastMsgAt':moment()[_0x7fee('0x54')](_0x7fee('0x55')),'lastMsgDirection':'in'};return db[_0x7fee('0x56')][_0x7fee('0x29')]({'where':{'closed':![],'MailAccountId':_0x15c7b7['account']['id']},'include':[{'model':db[_0x7fee('0x57')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x58')]}}]})[_0x7fee('0x27')](function(_0xd80e7){if(_0xd80e7){return[_0xd80e7,![]];}return db[_0x7fee('0x56')][_0x7fee('0x4d')](_0x2c766c)[_0x7fee('0x27')](function(_0x44e02b){return[_0x44e02b,!![]];});});}else{throw new Error(_0x7fee('0x59'));}})['spread'](function(_0x5525f9,_0x31cae6){if(_0x5525f9){_0x51d135=_0x31cae6;if(!_0x31cae6){return _0x5525f9['update']({'inReplyTo':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')]['messageId'],'to':_0x15c7b7['body'][_0x7fee('0x19')]['from'],'cc':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')]['cc'],'subject':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x52')],'attach':_0x5525f9[_0x7fee('0x53')]?_0x5525f9[_0x7fee('0x53')]:_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0x7fee('0x54')](_0x7fee('0x55')),'lastMsgAt':moment()[_0x7fee('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x5525f9;}}})[_0x7fee('0x27')](function(_0x4a7ee7){_0x6fe2fe[_0x7fee('0x5a')]=_0x4a7ee7['get']({'plain':!![]});_0x6fe2fe[_0x7fee('0x5a')][_0x7fee('0x5b')]=_0x51d135;return db[_0x7fee('0x57')]['create']({'body':_0x15c7b7['body'][_0x7fee('0x2c')],'MailAccountId':_0x15c7b7[_0x7fee('0x43')]['id'],'MailInteractionId':_0x4a7ee7['id'],'direction':'in','ContactId':_0x6fe2fe['contact']['id'],'messageId':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x50')],'from':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x36')],'to':_0x15c7b7['body']['message']['to'],'cc':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')]['cc'],'subject':_0x15c7b7['body'][_0x7fee('0x19')][_0x7fee('0x52')],'attach':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x53')],'Attachments':_0x15c7b7[_0x7fee('0x2c')]['message'][_0x7fee('0x5c')],'originTo':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x5d')],'originCc':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x5e')],'bcc':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x5f')],'ChatWebsiteId':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')]['ChatWebsiteId']||null,'originChannel':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x60')]||_0x7fee('0x61'),'ChatOfflineMessageId':_0x15c7b7[_0x7fee('0x2c')][_0x7fee('0x19')][_0x7fee('0x62')]||null},{'include':[{'model':db[_0x7fee('0x63')],'as':_0x7fee('0x64')}]});})[_0x7fee('0x27')](function(_0x2e139c){_0x6fe2fe[_0x7fee('0x19')]=_0x2e139c;if(_0x6fe2fe[_0x7fee('0x5a')]['UserId']){return db[_0x7fee('0x65')][_0x7fee('0x29')]({'attributes':['id','name'],'where':{'id':_0x6fe2fe[_0x7fee('0x5a')][_0x7fee('0x66')]}})['then'](function(_0x907b80){if(_0x907b80){_0x6fe2fe[_0x7fee('0x45')][_0x7fee('0x67')]({'id':0x0,'priority':0x0,'app':_0x7fee('0x68'),'appdata':_0x907b80[_0x7fee('0x69')]+','+(_0x6fe2fe[_0x7fee('0x43')][_0x7fee('0x6a')]||0xa),'interval':_0x7fee('0x4c')});}return respondWithRpcPromise(_0x7fee('0x6b'),_0x7fee('0x6c'),_0x6fe2fe);});}return respondWithRpcPromise('Start',_0x7fee('0x6c'),_0x6fe2fe);})[_0x7fee('0x27')](function(_0x5a51c7){_0x1c1ce3(_0x5a51c7);})[_0x7fee('0x1c')](function(_0x3b61e7){_0x38121c(_0x2174d0[_0x7fee('0x17')](0x1f4,_0x3b61e7[_0x7fee('0x19')]));});});}; \ No newline at end of file +var _0x6dac=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','List','DESC','Applications','MailServerOut','get','account','applications','list','orderBy','priority','length','close','autoclose','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailAccount,\x20%s,\x20%s','result','GetMailAccount','MailAccount','findAll','options','raw','where','include','map','attributes','model','catch','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','ListId','isNil','from\x20is\x20mandatory'];(function(_0x3a8d5a,_0xe54840){var _0x308361=function(_0x2e7f86){while(--_0x2e7f86){_0x3a8d5a['push'](_0x3a8d5a['shift']());}};_0x308361(++_0xe54840);}(_0x6dac,0x9f));var _0xc6da=function(_0x29ece4,_0x5360c1){_0x29ece4=_0x29ece4-0x0;var _0x503ce0=_0x6dac[_0x29ece4];return _0x503ce0;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var moment=require(_0xc6da('0x2'));var BPromise=require(_0xc6da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6da('0x4'));var db=require(_0xc6da('0x5'))['db'];var utils=require(_0xc6da('0x6'));var logger=require(_0xc6da('0x7'))(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var jayson=require(_0xc6da('0xa'));var client=jayson['client'][_0xc6da('0xb')]({'port':0x232c});config[_0xc6da('0xc')]=_[_0xc6da('0xd')](config['redis'],{'host':_0xc6da('0xe'),'port':0x18eb});var socket=require(_0xc6da('0xf'))(new Redis(config[_0xc6da('0xc')]));require(_0xc6da('0x10'))[_0xc6da('0x11')](socket);function respondWithRpcPromise(_0x670a93,_0x1a57ab,_0x46436d){return new BPromise(function(_0x247007,_0x37a7e0){return client[_0xc6da('0x12')](_0x670a93,_0x46436d)[_0xc6da('0x13')](function(_0x717cab){logger[_0xc6da('0x14')]('MailAccount,\x20%s,\x20%s',_0x1a57ab,'request\x20sent');logger['debug'](_0xc6da('0x15'),_0x1a57ab,_0xc6da('0x16'),JSON[_0xc6da('0x17')](_0x717cab));if(_0x717cab[_0xc6da('0x18')]){if(_0x717cab[_0xc6da('0x18')]['code']===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1a57ab,_0x717cab[_0xc6da('0x18')][_0xc6da('0x19')]);return _0x37a7e0(_0x717cab[_0xc6da('0x18')]['message']);}logger[_0xc6da('0x18')](_0xc6da('0x1a'),_0x1a57ab,_0x717cab[_0xc6da('0x18')]['message']);return _0x247007(_0x717cab[_0xc6da('0x18')][_0xc6da('0x19')]);}else{logger[_0xc6da('0x14')](_0xc6da('0x1a'),_0x1a57ab,'request\x20sent');_0x247007(_0x717cab[_0xc6da('0x1b')][_0xc6da('0x19')]);}})['catch'](function(_0x5914f5){logger[_0xc6da('0x18')](_0xc6da('0x1a'),_0x1a57ab,_0x5914f5);_0x37a7e0(_0x5914f5);});});}exports[_0xc6da('0x1c')]=function(_0x1ee4ac){var _0x4645a8=this;return new Promise(function(_0x3346ae,_0x9465c6){return db[_0xc6da('0x1d')][_0xc6da('0x1e')]({'raw':_0x1ee4ac[_0xc6da('0x1f')]?_0x1ee4ac[_0xc6da('0x1f')][_0xc6da('0x20')]===undefined?!![]:![]:!![],'where':_0x1ee4ac[_0xc6da('0x1f')]?_0x1ee4ac[_0xc6da('0x1f')][_0xc6da('0x21')]||null:null,'attributes':_0x1ee4ac[_0xc6da('0x1f')]?_0x1ee4ac['options']['attributes']||null:null,'limit':_0x1ee4ac['options']?_0x1ee4ac[_0xc6da('0x1f')]['limit']||null:null,'include':_0x1ee4ac[_0xc6da('0x1f')]?_0x1ee4ac[_0xc6da('0x1f')][_0xc6da('0x22')]?_[_0xc6da('0x23')](_0x1ee4ac['options'][_0xc6da('0x22')],function(_0x58e111){return{'model':db[_0x58e111['model']],'as':_0x58e111['as'],'attributes':_0x58e111[_0xc6da('0x24')],'include':_0x58e111[_0xc6da('0x22')]?_[_0xc6da('0x23')](_0x58e111[_0xc6da('0x22')],function(_0x16e311){return{'model':db[_0x16e311[_0xc6da('0x25')]],'as':_0x16e311['as'],'attributes':_0x16e311['attributes'],'include':_0x16e311['include']?_[_0xc6da('0x23')](_0x16e311[_0xc6da('0x22')],function(_0x5d0f09){return{'model':db[_0x5d0f09[_0xc6da('0x25')]],'as':_0x5d0f09['as'],'attributes':_0x5d0f09['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6da('0x13')](function(_0xd4fd39){logger[_0xc6da('0x14')]('GetMailAccount',_0x1ee4ac);logger['debug'](_0xc6da('0x1c'),_0x1ee4ac,JSON[_0xc6da('0x17')](_0xd4fd39));_0x3346ae(_0xd4fd39);})[_0xc6da('0x26')](function(_0x1494a2){logger[_0xc6da('0x18')](_0xc6da('0x1c'),_0x1494a2['message'],_0x1ee4ac);_0x9465c6(_0x4645a8[_0xc6da('0x18')](0x1f4,_0x1494a2[_0xc6da('0x19')]));});});};exports[_0xc6da('0x27')]=function(_0x53069c){var _0x1df1d6=this;return new Promise(function(_0x16369e,_0x239c2b){return db[_0xc6da('0x1d')]['find']({'raw':_0x53069c[_0xc6da('0x1f')]?_0x53069c['options']['raw']===undefined?!![]:![]:!![],'where':_0x53069c[_0xc6da('0x1f')]?_0x53069c[_0xc6da('0x1f')]['where']||null:null,'attributes':_0x53069c[_0xc6da('0x1f')]?_0x53069c[_0xc6da('0x1f')][_0xc6da('0x24')]||null:null,'include':_0x53069c[_0xc6da('0x1f')]?_0x53069c[_0xc6da('0x1f')][_0xc6da('0x22')]?_['map'](_0x53069c[_0xc6da('0x1f')][_0xc6da('0x22')],function(_0x387c66){return{'model':db[_0x387c66['model']],'as':_0x387c66['as'],'attributes':_0x387c66[_0xc6da('0x24')],'include':_0x387c66[_0xc6da('0x22')]?_['map'](_0x387c66['include'],function(_0x14b02e){return{'model':db[_0x14b02e[_0xc6da('0x25')]],'as':_0x14b02e['as'],'attributes':_0x14b02e[_0xc6da('0x24')],'include':_0x14b02e[_0xc6da('0x22')]?_[_0xc6da('0x23')](_0x14b02e[_0xc6da('0x22')],function(_0x1fdb41){return{'model':db[_0x1fdb41['model']],'as':_0x1fdb41['as'],'attributes':_0x1fdb41['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6da('0x13')](function(_0x552319){logger[_0xc6da('0x14')]('ShowMailAccount',_0x53069c);logger['debug']('ShowMailAccount',_0x53069c,JSON[_0xc6da('0x17')](_0x552319));_0x16369e(_0x552319);})[_0xc6da('0x26')](function(_0x550409){logger[_0xc6da('0x18')](_0xc6da('0x27'),_0x550409[_0xc6da('0x19')],_0x53069c);_0x239c2b(_0x1df1d6['error'](0x1f4,_0x550409[_0xc6da('0x19')]));});});};exports[_0xc6da('0x28')]=function(_0x4e028e){var _0x18a876=this;return new Promise(function(_0xa5e41b,_0x57efeb){var _0x16a77d={'body':_0x4e028e[_0xc6da('0x29')],'channel':_0xc6da('0x2a')};var _0xe850b7=_[_0xc6da('0x2b')](_[_0xc6da('0x2c')](db[_0xc6da('0x2d')][_0xc6da('0x2e')]),['createdAt',_0xc6da('0x2f'),'CompanyId',_0xc6da('0x30')]);var _0x9d2d9f=![];if(_0x4e028e[_0xc6da('0x29')]['id']){delete _0x4e028e[_0xc6da('0x29')]['id'];}if(_[_0xc6da('0x31')](_0x4e028e['body']['from'])){return _0x57efeb(_0x18a876['error'](0x1f4,_0xc6da('0x32')));}if(_[_0xc6da('0x31')](_0x4e028e[_0xc6da('0x29')][_0xc6da('0x29')])||_0x4e028e['body'][_0xc6da('0x29')]===''){return _0x57efeb(_0x18a876[_0xc6da('0x18')](0x1f4,_0xc6da('0x33')));}if(_[_0xc6da('0x31')](_0x4e028e[_0xc6da('0x29')][_0xc6da('0x34')])){return _0x57efeb(_0x18a876[_0xc6da('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe850b7));}if(!_['includes'](_0xe850b7,_0x4e028e['body'][_0xc6da('0x34')])){return _0x57efeb(_0x18a876[_0xc6da('0x18')](0x1f4,_0xc6da('0x35')+_0xe850b7));}var _0x3c54ad={};_0x3c54ad[_0x4e028e[_0xc6da('0x29')]['mapKey']]=_0x4e028e[_0xc6da('0x29')][_0xc6da('0x36')];return db[_0xc6da('0x1d')][_0xc6da('0x37')]({'where':{'id':_0x4e028e['account']['id']},'include':[{'model':db[_0xc6da('0x38')],'as':_0xc6da('0x39'),'include':[{'model':db[_0xc6da('0x2d')],'as':'Contacts','where':_0x3c54ad,'limit':0x1,'order':[[_0xc6da('0x2f'),_0xc6da('0x3a')]]}]},{'model':db['MailApplication'],'as':_0xc6da('0x3b')},{'model':db[_0xc6da('0x3c')],'as':'Smtp'}]})[_0xc6da('0x13')](function(_0x924aed){if(_0x924aed&&_0x924aed[_0xc6da('0x39')]){var _0xdbd18f=_0x924aed[_0xc6da('0x3d')]({'plain':!![]});_0x16a77d[_0xc6da('0x3e')]=_['omit'](_0xdbd18f,[_0xc6da('0x3b'),_0xc6da('0x39')]);_0x16a77d[_0xc6da('0x3f')]=_0xdbd18f[_0xc6da('0x3b')];_0x16a77d[_0xc6da('0x40')]=_0xdbd18f[_0xc6da('0x39')];_0x16a77d[_0xc6da('0x3f')]=_[_0xc6da('0x41')](_0x16a77d[_0xc6da('0x3f')],[_0xc6da('0x42')],['asc']);if(_0x16a77d['account']&&_0x16a77d[_0xc6da('0x3e')]['autoclose']){_0x16a77d[_0xc6da('0x3f')]['push']({'id':0x0,'priority':_0x16a77d[_0xc6da('0x3f')][_0xc6da('0x43')]+0x1,'app':_0xc6da('0x44'),'appdata':_0xc6da('0x45'),'interval':_0xc6da('0x46')});}if(_0x16a77d[_0xc6da('0x3e')][_0xc6da('0x3b')]){delete _0x16a77d[_0xc6da('0x3e')]['Applications'];}if(_0x16a77d[_0xc6da('0x3e')][_0xc6da('0x39')]){delete _0x16a77d[_0xc6da('0x3e')][_0xc6da('0x39')];}if(_0xdbd18f[_0xc6da('0x39')][_0xc6da('0x47')][_0xc6da('0x43')]){return _0xdbd18f[_0xc6da('0x39')][_0xc6da('0x47')][0x0];}var _0x4f4e05=_['defaults'](_0x4e028e[_0xc6da('0x29')],{'firstName':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x36')],'ListId':_0xdbd18f[_0xc6da('0x30')]});_0x4f4e05[_0x4e028e[_0xc6da('0x29')][_0xc6da('0x34')]]=_0x4e028e[_0xc6da('0x29')]['from'];return db[_0xc6da('0x2d')][_0xc6da('0x48')](_0x4f4e05);}else{throw new Error(_0xc6da('0x49'));}})[_0xc6da('0x13')](function(_0x47d5f8){_0x16a77d['contact']=_0x47d5f8;if(_0x47d5f8){if(!_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x4a')]){_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x4a')]=rs[_0xc6da('0x4b')]()+'\x20'+_0x4e028e['body'][_0xc6da('0x19')]['from'];}var _0x1500e4={'ContactId':_0x47d5f8['id'],'MailAccountId':_0x4e028e[_0xc6da('0x3e')]['id'],'inReplyTo':_0x4e028e[_0xc6da('0x29')]['message']['messageId'],'to':_0x4e028e[_0xc6da('0x29')]['message'][_0xc6da('0x36')],'cc':_0x4e028e['body']['message']['cc'],'subject':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')]['subject'],'attach':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x4c')],'lastMsgAt':moment()[_0xc6da('0x4d')](_0xc6da('0x4e')),'lastMsgDirection':'in'};return db[_0xc6da('0x4f')][_0xc6da('0x37')]({'where':{'closed':![],'MailAccountId':_0x4e028e[_0xc6da('0x3e')]['id']},'include':[{'model':db[_0xc6da('0x50')],'as':_0xc6da('0x51'),'attributes':[_0xc6da('0x4a')],'where':{'messageId':_0x4e028e[_0xc6da('0x29')]['message'][_0xc6da('0x52')]}}]})['then'](function(_0x426023){if(_0x426023){return[_0x426023,![]];}return db[_0xc6da('0x4f')]['create'](_0x1500e4)[_0xc6da('0x13')](function(_0x5f077c){return[_0x5f077c,!![]];});});}else{throw new Error(_0xc6da('0x53'));}})[_0xc6da('0x54')](function(_0x2f1dd4,_0x1e4685){if(_0x2f1dd4){_0x9d2d9f=_0x1e4685;if(!_0x1e4685){return _0x2f1dd4[_0xc6da('0x55')]({'inReplyTo':_0x4e028e['body'][_0xc6da('0x19')][_0xc6da('0x4a')],'to':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x36')],'cc':_0x4e028e[_0xc6da('0x29')]['message']['cc'],'subject':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x56')],'attach':_0x2f1dd4['attach']?_0x2f1dd4[_0xc6da('0x4c')]:_0x4e028e['body'][_0xc6da('0x19')][_0xc6da('0x4c')],'substatus':null,'substatusAt':moment()[_0xc6da('0x4d')](_0xc6da('0x4e')),'lastMsgAt':moment()['format'](_0xc6da('0x4e')),'lastMsgDirection':'in'});}else{return _0x2f1dd4;}}})[_0xc6da('0x13')](function(_0xb84f12){_0x16a77d[_0xc6da('0x57')]=_0xb84f12[_0xc6da('0x3d')]({'plain':!![]});_0x16a77d['interaction'][_0xc6da('0x58')]=_0x9d2d9f;return db[_0xc6da('0x50')][_0xc6da('0x48')]({'body':_0x4e028e['body'][_0xc6da('0x29')],'MailAccountId':_0x4e028e[_0xc6da('0x3e')]['id'],'MailInteractionId':_0xb84f12['id'],'direction':'in','ContactId':_0x16a77d['contact']['id'],'messageId':_0x4e028e[_0xc6da('0x29')]['message'][_0xc6da('0x4a')],'from':_0x4e028e['body'][_0xc6da('0x19')][_0xc6da('0x36')],'to':_0x4e028e['body'][_0xc6da('0x19')]['to'],'cc':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')]['cc'],'subject':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')]['subject'],'attach':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x4c')],'Attachments':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x59')],'originTo':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x5a')],'originCc':_0x4e028e['body'][_0xc6da('0x19')]['originCc'],'bcc':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x5b')],'ChatWebsiteId':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x5c')]||null,'originChannel':_0x4e028e[_0xc6da('0x29')][_0xc6da('0x19')][_0xc6da('0x5d')]||_0xc6da('0x5e'),'ChatOfflineMessageId':_0x4e028e[_0xc6da('0x29')]['message'][_0xc6da('0x5f')]||null},{'include':[{'model':db[_0xc6da('0x60')],'as':'Attachments'}]});})[_0xc6da('0x13')](function(_0x3e4e12){_0x16a77d['message']=_0x3e4e12;if(_0x16a77d[_0xc6da('0x57')][_0xc6da('0x61')]){return db[_0xc6da('0x62')][_0xc6da('0x37')]({'attributes':['id',_0xc6da('0x63')],'where':{'id':_0x16a77d[_0xc6da('0x57')][_0xc6da('0x61')]}})[_0xc6da('0x13')](function(_0x197049){if(_0x197049){_0x16a77d[_0xc6da('0x3f')][_0xc6da('0x64')]({'id':0x0,'priority':0x0,'app':_0xc6da('0x65'),'appdata':_0x197049[_0xc6da('0x63')]+','+(_0x16a77d[_0xc6da('0x3e')][_0xc6da('0x66')]||0xa),'interval':_0xc6da('0x46')});}return respondWithRpcPromise(_0xc6da('0x67'),'startRouting',_0x16a77d);});}return respondWithRpcPromise(_0xc6da('0x67'),_0xc6da('0x68'),_0x16a77d);})[_0xc6da('0x13')](function(_0x5ad42c){_0xa5e41b(_0x5ad42c);})[_0xc6da('0x26')](function(_0x59bdfb){_0x57efeb(_0x18a876[_0xc6da('0x18')](0x1f4,_0x59bdfb['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c9468e5..d726a7e 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 _0x68ee=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x68ee,0xd3));var _0xe68e=function(_0x44d411,_0x2cb041){_0x44d411=_0x44d411-0x0;var _0xfeda47=_0x68ee[_0x44d411];return _0xfeda47;};'use strict';var MailAccountEvents=require(_0xe68e('0x0'));var events=[_0xe68e('0x1'),_0xe68e('0x2'),_0xe68e('0x3')];function createListener(_0x3ef319,_0x1e6bd1){return function(_0x2a9702){_0x1e6bd1[_0xe68e('0x4')](_0x3ef319,_0x2a9702);};}function removeListener(_0x519e47,_0xeef40f){return function(){MailAccountEvents['removeListener'](_0x519e47,_0xeef40f);};}exports[_0xe68e('0x5')]=function(_0x11813b){for(var _0x47b72e=0x0,_0x2dfd4c=events[_0xe68e('0x6')];_0x47b72e<_0x2dfd4c;_0x47b72e++){var _0x50c4d9=events[_0x47b72e];var _0x3073e6=createListener(_0xe68e('0x7')+_0x50c4d9,_0x11813b);MailAccountEvents['on'](_0x50c4d9,_0x3073e6);}}; \ No newline at end of file +var _0x2354=['update','emit','removeListener','length','mailAccount:','save'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x2354,0x125));var _0x4235=function(_0x159fd4,_0x4f0b19){_0x159fd4=_0x159fd4-0x0;var _0x371192=_0x2354[_0x159fd4];return _0x371192;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x4235('0x0'),'remove',_0x4235('0x1')];function createListener(_0x11a9ed,_0x259461){return function(_0x11a84f){_0x259461[_0x4235('0x2')](_0x11a9ed,_0x11a84f);};}function removeListener(_0x4afd3a,_0x4b0633){return function(){MailAccountEvents[_0x4235('0x3')](_0x4afd3a,_0x4b0633);};}exports['register']=function(_0x56c2ad){for(var _0x3bb0e3=0x0,_0x24bafa=events[_0x4235('0x4')];_0x3bb0e3<_0x24bafa;_0x3bb0e3++){var _0x23f622=events[_0x3bb0e3];var _0x3380e5=createListener(_0x4235('0x5')+_0x23f622,_0x56c2ad);MailAccountEvents['on'](_0x23f622,_0x3380e5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3e55f8e..0028526 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 _0x1199=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x294050,_0x12f63d){var _0x5c16d7=function(_0x3b4e6b){while(--_0x3b4e6b){_0x294050['push'](_0x294050['shift']());}};_0x5c16d7(++_0x12f63d);}(_0x1199,0xbc));var _0x9119=function(_0xd0d97b,_0x1aadb0){_0xd0d97b=_0xd0d97b-0x0;var _0x47399f=_0x1199[_0xd0d97b];return _0x47399f;};'use strict';var multer=require(_0x9119('0x0'));var util=require(_0x9119('0x1'));var path=require('path');var timeout=require(_0x9119('0x2'));var express=require(_0x9119('0x3'));var router=express[_0x9119('0x4')]();var fs_extra=require(_0x9119('0x5'));var auth=require(_0x9119('0x6'));var interaction=require(_0x9119('0x7'));var config=require('../../config/environment');var controller=require(_0x9119('0x8'));router['get'](_0x9119('0x9'),auth[_0x9119('0xa')](),controller[_0x9119('0xb')]);router['put'](_0x9119('0x9'),auth[_0x9119('0xa')](),controller[_0x9119('0xc')]);router[_0x9119('0xd')](_0x9119('0x9'),auth['isAuthenticated'](),controller[_0x9119('0xe')]);module[_0x9119('0xf')]=router; \ No newline at end of file +var _0x029e=['../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x029e,0x12a));var _0xe029=function(_0x48a652,_0x359d75){_0x48a652=_0x48a652-0x0;var _0x28349b=_0x029e[_0x48a652];return _0x28349b;};'use strict';var multer=require('multer');var util=require(_0xe029('0x0'));var path=require(_0xe029('0x1'));var timeout=require(_0xe029('0x2'));var express=require(_0xe029('0x3'));var router=express[_0xe029('0x4')]();var fs_extra=require(_0xe029('0x5'));var auth=require(_0xe029('0x6'));var interaction=require(_0xe029('0x7'));var config=require('../../config/environment');var controller=require(_0xe029('0x8'));router[_0xe029('0x9')](_0xe029('0xa'),auth[_0xe029('0xb')](),controller[_0xe029('0xc')]);router[_0xe029('0xd')](_0xe029('0xa'),auth[_0xe029('0xb')](),controller['update']);router[_0xe029('0xe')](_0xe029('0xa'),auth['isAuthenticated'](),controller[_0xe029('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 74da6ef..d21a374 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 _0x432d=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3d1217,_0x3d3f31){var _0x27b9ec=function(_0x5e2d15){while(--_0x5e2d15){_0x3d1217['push'](_0x3d1217['shift']());}};_0x27b9ec(++_0x3d3f31);}(_0x432d,0xc7));var _0xd432=function(_0x5a2ccb,_0x4e11be){_0x5a2ccb=_0x5a2ccb-0x0;var _0x3c0045=_0x432d[_0x5a2ccb];return _0x3c0045;};'use strict';var Sequelize=require(_0xd432('0x0'));module[_0xd432('0x1')]={'priority':{'type':Sequelize[_0xd432('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd432('0x3')],'allowNull':![],'defaultValue':_0xd432('0x4')},'appdata':{'type':Sequelize[_0xd432('0x5')]()},'description':{'type':Sequelize[_0xd432('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x24b9=['STRING','*,*,*,*','exports','INTEGER','noop','TEXT'];(function(_0x5ca3c2,_0x3b45c4){var _0x1343ed=function(_0x40d227){while(--_0x40d227){_0x5ca3c2['push'](_0x5ca3c2['shift']());}};_0x1343ed(++_0x3b45c4);}(_0x24b9,0x1b2));var _0x924b=function(_0x132906,_0x2b379a){_0x132906=_0x132906-0x0;var _0x27f312=_0x24b9[_0x132906];return _0x27f312;};'use strict';var Sequelize=require('sequelize');module[_0x924b('0x0')]={'priority':{'type':Sequelize[_0x924b('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x924b('0x2')},'appdata':{'type':Sequelize[_0x924b('0x3')]()},'description':{'type':Sequelize[_0x924b('0x4')]},'interval':{'type':Sequelize[_0x924b('0x4')],'defaultValue':_0x924b('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a36f047..89ca9cd 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0xaa88[_0x10a212];return _0x23c82b;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x39e9f4,_0x7da7be){var _0x16b495=function(_0x4e126d){while(--_0x4e126d){_0x39e9f4['push'](_0x39e9f4['shift']());}};_0x16b495(++_0x7da7be);}(_0xe706,0xa3));var _0x6e70=function(_0x546d1d,_0x563949){_0x546d1d=_0x546d1d-0x0;var _0x89bcfb=_0xe706[_0x546d1d];return _0x89bcfb;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4a6771e..0012989 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 _0xae04=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3f1ff2,_0x15b7e5){var _0x9bb14f=function(_0xd290c5){while(--_0xd290c5){_0x3f1ff2['push'](_0x3f1ff2['shift']());}};_0x9bb14f(++_0x15b7e5);}(_0xae04,0x71));var _0x4ae0=function(_0x172f5d,_0x2bff0f){_0x172f5d=_0x172f5d-0x0;var _0x268a72=_0xae04[_0x172f5d];return _0x268a72;};'use strict';var _=require(_0x4ae0('0x0'));var util=require(_0x4ae0('0x1'));var logger=require(_0x4ae0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4ae0('0x3'));var rp=require(_0x4ae0('0x4'));var fs=require('fs');var path=require(_0x4ae0('0x5'));var rimraf=require(_0x4ae0('0x6'));var config=require(_0x4ae0('0x7'));var attributes=require(_0x4ae0('0x8'));module[_0x4ae0('0x9')]=function(_0x14de6f,_0x255824){return _0x14de6f[_0x4ae0('0xa')](_0x4ae0('0xb'),attributes,{'tableName':_0x4ae0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ae0('0xd'),'collate':_0x4ae0('0xe')});}; \ No newline at end of file +var _0x24ee=['request-promise','path','rimraf','exports','define','MailApplication','mail_applications','utf8mb4','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x24ee,0x13e));var _0xe24e=function(_0x238202,_0x10da07){_0x238202=_0x238202-0x0;var _0x217367=_0x24ee[_0x238202];return _0x217367;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe24e('0x0'));var BPromise=require(_0xe24e('0x1'));var rp=require(_0xe24e('0x2'));var fs=require('fs');var path=require(_0xe24e('0x3'));var rimraf=require(_0xe24e('0x4'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xe24e('0x5')]=function(_0x53fbc9,_0x84baf0){return _0x53fbc9[_0xe24e('0x6')](_0xe24e('0x7'),attributes,{'tableName':_0xe24e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe24e('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f94229f..e523fe9 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 _0x9fd6=['error','code','message','result','catch','MailApplication','update','options','raw','where','attributes','then','UpdateMailApplication','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c5c87,_0x1f3c00){var _0x5762b5=function(_0x5da2d9){while(--_0x5da2d9){_0x4c5c87['push'](_0x4c5c87['shift']());}};_0x5762b5(++_0x1f3c00);}(_0x9fd6,0xb6));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 moment=require('moment');var BPromise=require(_0x69fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69fd('0x2'));var db=require(_0x69fd('0x3'))['db'];var utils=require(_0x69fd('0x4'));var logger=require(_0x69fd('0x5'))('rpc');var config=require(_0x69fd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x69fd('0x7')][_0x69fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53391e,_0x212548,_0x4feca7){return new BPromise(function(_0x4fc8f5,_0x3c8eee){return client['request'](_0x53391e,_0x4feca7)['then'](function(_0x3cb871){logger[_0x69fd('0x9')](_0x69fd('0xa'),_0x212548,_0x69fd('0xb'));logger['debug'](_0x69fd('0xc'),_0x212548,_0x69fd('0xb'),JSON[_0x69fd('0xd')](_0x3cb871));if(_0x3cb871[_0x69fd('0xe')]){if(_0x3cb871[_0x69fd('0xe')][_0x69fd('0xf')]===0x1f4){logger[_0x69fd('0xe')](_0x69fd('0xa'),_0x212548,_0x3cb871[_0x69fd('0xe')][_0x69fd('0x10')]);return _0x3c8eee(_0x3cb871[_0x69fd('0xe')][_0x69fd('0x10')]);}logger[_0x69fd('0xe')](_0x69fd('0xa'),_0x212548,_0x3cb871[_0x69fd('0xe')][_0x69fd('0x10')]);return _0x4fc8f5(_0x3cb871[_0x69fd('0xe')][_0x69fd('0x10')]);}else{logger[_0x69fd('0x9')](_0x69fd('0xa'),_0x212548,'request\x20sent');_0x4fc8f5(_0x3cb871[_0x69fd('0x11')][_0x69fd('0x10')]);}})[_0x69fd('0x12')](function(_0x5446d4){logger[_0x69fd('0xe')](_0x69fd('0xa'),_0x212548,_0x5446d4);_0x3c8eee(_0x5446d4);});});}exports['UpdateMailApplication']=function(_0x25c5a5){var _0x5a264b=this;return new Promise(function(_0x5dedbf,_0x3e9279){return db[_0x69fd('0x13')][_0x69fd('0x14')](_0x25c5a5['body'],{'raw':_0x25c5a5[_0x69fd('0x15')]?_0x25c5a5[_0x69fd('0x15')][_0x69fd('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25c5a5[_0x69fd('0x15')]?_0x25c5a5['options'][_0x69fd('0x17')]||null:null,'attributes':_0x25c5a5[_0x69fd('0x15')]?_0x25c5a5[_0x69fd('0x15')][_0x69fd('0x18')]||null:null,'limit':_0x25c5a5[_0x69fd('0x15')]?_0x25c5a5[_0x69fd('0x15')]['limit']||null:null})[_0x69fd('0x19')](function(_0x2bd81b){logger['info'](_0x69fd('0x1a'),_0x25c5a5);logger[_0x69fd('0x1b')](_0x69fd('0x1a'),_0x25c5a5,JSON['stringify'](_0x2bd81b));_0x5dedbf(_0x2bd81b);})[_0x69fd('0x12')](function(_0x458f7a){logger[_0x69fd('0xe')]('UpdateMailApplication',_0x458f7a[_0x69fd('0x10')],_0x25c5a5);_0x3e9279(_0x5a264b[_0x69fd('0xe')](0x1f4,_0x458f7a['message']));});});}; \ No newline at end of file +var _0x1cf7=['../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x411acd,_0x410c03){var _0x5182ba=function(_0x2a0fe6){while(--_0x2a0fe6){_0x411acd['push'](_0x411acd['shift']());}};_0x5182ba(++_0x410c03);}(_0x1cf7,0x163));var _0x71cf=function(_0x3ea4e3,_0x192302){_0x3ea4e3=_0x3ea4e3-0x0;var _0x57fac3=_0x1cf7[_0x3ea4e3];return _0x57fac3;};'use strict';var _=require(_0x71cf('0x0'));var util=require(_0x71cf('0x1'));var moment=require(_0x71cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x71cf('0x3'));var fs=require('fs');var Redis=require(_0x71cf('0x4'));var db=require(_0x71cf('0x5'))['db'];var utils=require(_0x71cf('0x6'));var logger=require(_0x71cf('0x7'))('rpc');var config=require(_0x71cf('0x8'));var jayson=require(_0x71cf('0x9'));var client=jayson['client'][_0x71cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e3917,_0x1d4889,_0x3f5d8c){return new BPromise(function(_0x4fb6bd,_0x426231){return client[_0x71cf('0xb')](_0x2e3917,_0x3f5d8c)[_0x71cf('0xc')](function(_0x2e843b){logger[_0x71cf('0xd')](_0x71cf('0xe'),_0x1d4889,_0x71cf('0xf'));logger[_0x71cf('0x10')](_0x71cf('0x11'),_0x1d4889,_0x71cf('0xf'),JSON['stringify'](_0x2e843b));if(_0x2e843b['error']){if(_0x2e843b['error'][_0x71cf('0x12')]===0x1f4){logger[_0x71cf('0x13')]('MailApplication,\x20%s,\x20%s',_0x1d4889,_0x2e843b[_0x71cf('0x13')][_0x71cf('0x14')]);return _0x426231(_0x2e843b[_0x71cf('0x13')]['message']);}logger[_0x71cf('0x13')](_0x71cf('0xe'),_0x1d4889,_0x2e843b[_0x71cf('0x13')][_0x71cf('0x14')]);return _0x4fb6bd(_0x2e843b[_0x71cf('0x13')]['message']);}else{logger[_0x71cf('0xd')]('MailApplication,\x20%s,\x20%s',_0x1d4889,_0x71cf('0xf'));_0x4fb6bd(_0x2e843b[_0x71cf('0x15')][_0x71cf('0x14')]);}})[_0x71cf('0x16')](function(_0x427cbb){logger[_0x71cf('0x13')](_0x71cf('0xe'),_0x1d4889,_0x427cbb);_0x426231(_0x427cbb);});});}exports[_0x71cf('0x17')]=function(_0x129416){var _0x510245=this;return new Promise(function(_0x29e80,_0x34f607){return db[_0x71cf('0x18')][_0x71cf('0x19')](_0x129416[_0x71cf('0x1a')],{'raw':_0x129416[_0x71cf('0x1b')]?_0x129416['options'][_0x71cf('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129416[_0x71cf('0x1b')]?_0x129416['options'][_0x71cf('0x1d')]||null:null,'attributes':_0x129416[_0x71cf('0x1b')]?_0x129416[_0x71cf('0x1b')][_0x71cf('0x1e')]||null:null,'limit':_0x129416[_0x71cf('0x1b')]?_0x129416[_0x71cf('0x1b')][_0x71cf('0x1f')]||null:null})[_0x71cf('0xc')](function(_0x3f9463){logger[_0x71cf('0xd')](_0x71cf('0x17'),_0x129416);logger[_0x71cf('0x10')](_0x71cf('0x17'),_0x129416,JSON[_0x71cf('0x20')](_0x3f9463));_0x29e80(_0x3f9463);})[_0x71cf('0x16')](function(_0x19d002){logger[_0x71cf('0x13')]('UpdateMailApplication',_0x19d002[_0x71cf('0x14')],_0x129416);_0x34f607(_0x510245[_0x71cf('0x13')](0x1f4,_0x19d002[_0x71cf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 11b799c..a3841b5 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 _0x5ddf=['isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','/:id','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get'];(function(_0x5b19ae,_0x2fef9e){var _0x367f6a=function(_0x1bcbf1){while(--_0x1bcbf1){_0x5b19ae['push'](_0x5b19ae['shift']());}};_0x367f6a(++_0x2fef9e);}(_0x5ddf,0x13e));var _0xf5dd=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5ddf[_0xfae23b];return _0x200640;};'use strict';var express=require(_0xf5dd('0x0'));var router=express[_0xf5dd('0x1')]();var auth=require(_0xf5dd('0x2'));var interaction=require(_0xf5dd('0x3'));var controller=require(_0xf5dd('0x4'));router[_0xf5dd('0x5')]('/',auth[_0xf5dd('0x6')](),controller[_0xf5dd('0x7')]);router[_0xf5dd('0x5')](_0xf5dd('0x8'),auth[_0xf5dd('0x6')](),controller['describe']);router[_0xf5dd('0x5')]('/:id',auth[_0xf5dd('0x6')](),controller[_0xf5dd('0x9')]);router['get'](_0xf5dd('0xa'),auth[_0xf5dd('0x6')](),controller[_0xf5dd('0xb')]);router[_0xf5dd('0x5')](_0xf5dd('0xc'),auth[_0xf5dd('0x6')](),controller['download']);router[_0xf5dd('0xd')]('/',auth[_0xf5dd('0x6')](),controller[_0xf5dd('0xe')]);router[_0xf5dd('0xd')](_0xf5dd('0xa'),auth[_0xf5dd('0x6')](),controller[_0xf5dd('0xf')]);router[_0xf5dd('0xd')](_0xf5dd('0x10'),auth[_0xf5dd('0x6')](),interaction[_0xf5dd('0x11')](_0xf5dd('0x12'),_0xf5dd('0x13')),controller[_0xf5dd('0x14')]);router[_0xf5dd('0x15')]('/:id',auth[_0xf5dd('0x6')](),interaction[_0xf5dd('0x11')](_0xf5dd('0x12'),'mailinteraction:update'),controller[_0xf5dd('0x16')]);router[_0xf5dd('0x17')](_0xf5dd('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0xf5dd('0x12'),'mailinteraction:destroy'),controller['destroy']);router['delete'](_0xf5dd('0x10'),auth['isAuthenticated'](),controller[_0xf5dd('0x19')]);module[_0xf5dd('0x1a')]=router; \ No newline at end of file +var _0xb5a7=['getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages'];(function(_0x33fd1f,_0x2e5d7f){var _0x107dc2=function(_0x1a04cc){while(--_0x1a04cc){_0x33fd1f['push'](_0x33fd1f['shift']());}};_0x107dc2(++_0x2e5d7f);}(_0xb5a7,0x80));var _0x7b5a=function(_0xc56feb,_0x1b1afe){_0xc56feb=_0xc56feb-0x0;var _0x2235d7=_0xb5a7[_0xc56feb];return _0x2235d7;};'use strict';var express=require(_0x7b5a('0x0'));var router=express[_0x7b5a('0x1')]();var auth=require(_0x7b5a('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x7b5a('0x3'));router[_0x7b5a('0x4')]('/',auth['isAuthenticated'](),controller[_0x7b5a('0x5')]);router[_0x7b5a('0x4')](_0x7b5a('0x6'),auth[_0x7b5a('0x7')](),controller[_0x7b5a('0x8')]);router[_0x7b5a('0x4')](_0x7b5a('0x9'),auth[_0x7b5a('0x7')](),controller[_0x7b5a('0xa')]);router[_0x7b5a('0x4')](_0x7b5a('0xb'),auth[_0x7b5a('0x7')](),controller[_0x7b5a('0xc')]);router[_0x7b5a('0x4')]('/:id/download',auth[_0x7b5a('0x7')](),controller[_0x7b5a('0xd')]);router['post']('/',auth[_0x7b5a('0x7')](),controller[_0x7b5a('0xe')]);router[_0x7b5a('0xf')](_0x7b5a('0xb'),auth[_0x7b5a('0x7')](),controller[_0x7b5a('0x10')]);router[_0x7b5a('0xf')](_0x7b5a('0x11'),auth['isAuthenticated'](),interaction[_0x7b5a('0x12')](_0x7b5a('0x13'),'mailinteraction:addtags'),controller[_0x7b5a('0x14')]);router[_0x7b5a('0x15')](_0x7b5a('0x9'),auth[_0x7b5a('0x7')](),interaction['tracked']('mail',_0x7b5a('0x16')),controller[_0x7b5a('0x17')]);router['delete']('/:id',auth[_0x7b5a('0x7')](),interaction[_0x7b5a('0x12')](_0x7b5a('0x13'),_0x7b5a('0x18')),controller[_0x7b5a('0x19')]);router[_0x7b5a('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7b5a('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 8e5054c..8b8f371 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 _0x00a1=['long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x12cef9,_0x1f20ac){var _0x46cb5=function(_0x39a4a2){while(--_0x39a4a2){_0x12cef9['push'](_0x12cef9['shift']());}};_0x46cb5(++_0x1f20ac);}(_0x00a1,0x7b));var _0x100a=function(_0x53b8a6,_0x4b7b12){_0x53b8a6=_0x53b8a6-0x0;var _0x256932=_0x00a1[_0x53b8a6];return _0x256932;};'use strict';var Sequelize=require(_0x100a('0x0'));var iconv=require(_0x100a('0x1'));module[_0x100a('0x2')]={'closed':{'type':Sequelize[_0x100a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x100a('0x4')]},'disposition':{'type':Sequelize[_0x100a('0x5')]},'secondDisposition':{'type':Sequelize[_0x100a('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x100a('0x5')]},'inReplyTo':{'type':Sequelize[_0x100a('0x5')](0x1fe)},'to':{'type':Sequelize[_0x100a('0x5')]},'cc':{'type':Sequelize[_0x100a('0x6')](_0x100a('0x7'))},'subject':{'type':Sequelize[_0x100a('0x6')]()},'attach':{'type':Sequelize[_0x100a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x100a('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x100a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x100a('0x8')]('in',_0x100a('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x100a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x100a('0x8')]('in',_0x100a('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x100a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xcea0=['iconv','exports','DATE','STRING','TEXT','long','out','BOOLEAN','sequelize'];(function(_0x5917f5,_0x6e3002){var _0xd2eb81=function(_0x3876ab){while(--_0x3876ab){_0x5917f5['push'](_0x5917f5['shift']());}};_0xd2eb81(++_0x6e3002);}(_0xcea0,0x194));var _0x0cea=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcea0[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x0cea('0x0'));var iconv=require(_0x0cea('0x1'));module[_0x0cea('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0cea('0x3')]},'disposition':{'type':Sequelize[_0x0cea('0x4')]},'secondDisposition':{'type':Sequelize[_0x0cea('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0cea('0x4')]},'inReplyTo':{'type':Sequelize[_0x0cea('0x4')](0x1fe)},'to':{'type':Sequelize[_0x0cea('0x4')]},'cc':{'type':Sequelize[_0x0cea('0x5')](_0x0cea('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0cea('0x3')]},'substatus':{'type':Sequelize[_0x0cea('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0cea('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0cea('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0cea('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0cea('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0cea('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ea71371..158f27a 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 _0xa4b0=['Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','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.createdAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','show','params','includeAll','include','create','body','describe','addMessage','ids','omit','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','inlineCss','true','rows','addTags','setTags','spread','findAll','emit','mailInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','download','unlinkSync','eml-format','zip-dir','moment','util','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','name','send','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','-id','trimStart','catch','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','from','tools_tags','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','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa4b0,0x88));var _0x0a4b=function(_0x2d74be,_0x1b6e9a){_0x2d74be=_0x2d74be-0x0;var _0x271be1=_0xa4b0[_0x2d74be];return _0x271be1;};'use strict';var emlformat=require(_0x0a4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a4b('0x1'));var moment=require(_0x0a4b('0x2'));var BPromise=require('bluebird');var util=require(_0x0a4b('0x3'));var path=require(_0x0a4b('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0a4b('0x5'));var juice=require(_0x0a4b('0x6'));var Redis=require(_0x0a4b('0x7'));var qs=require(_0x0a4b('0x8'));var as=require(_0x0a4b('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x0a4b('0xa'));var db=require(_0x0a4b('0xb'))['db'];var htmlEntities=require(_0x0a4b('0xc'));config[_0x0a4b('0xd')]=_[_0x0a4b('0xe')](config['redis'],{'host':_0x0a4b('0xf'),'port':0x18eb});var socket=require(_0x0a4b('0x10'))(new Redis(config[_0x0a4b('0xd')]));require(_0x0a4b('0x11'))['register'](socket);function respondWithStatusCode(_0x43f9d7,_0x3dd690){_0x3dd690=_0x3dd690||0xcc;return function(_0x595e46){if(_0x595e46){return _0x43f9d7[_0x0a4b('0x12')](_0x3dd690);}return _0x43f9d7['status'](_0x3dd690)[_0x0a4b('0x13')]();};}function respondWithResult(_0x22499f,_0x3bde3e){_0x3bde3e=_0x3bde3e||0xc8;return function(_0x3a5e58){if(_0x3a5e58){return _0x22499f[_0x0a4b('0x14')](_0x3bde3e)[_0x0a4b('0x15')](_0x3a5e58);}};}function respondWithFilteredResult(_0x566f1f,_0x41df2a){return function(_0x4fbcdc){if(_0x4fbcdc){var _0x4e50e7=typeof _0x41df2a[_0x0a4b('0x16')]===_0x0a4b('0x17')&&typeof _0x41df2a[_0x0a4b('0x18')]===_0x0a4b('0x17');var _0x3350b8=_0x4fbcdc[_0x0a4b('0x19')];var _0x502712=_0x4e50e7?0x0:_0x41df2a[_0x0a4b('0x16')];var _0x1720dd=_0x4e50e7?_0x4fbcdc[_0x0a4b('0x19')]:_0x41df2a[_0x0a4b('0x16')]+_0x41df2a[_0x0a4b('0x18')];var _0x5bc41c;if(_0x1720dd>=_0x3350b8){_0x1720dd=_0x3350b8;_0x5bc41c=0xc8;}else{_0x5bc41c=0xce;}_0x566f1f[_0x0a4b('0x14')](_0x5bc41c);return _0x566f1f[_0x0a4b('0x1a')](_0x0a4b('0x1b'),_0x502712+'-'+_0x1720dd+'/'+_0x3350b8)[_0x0a4b('0x15')](_0x4fbcdc);}return null;};}function saveUpdates(_0x755b87){return function(_0x1ee8ac){if(_0x1ee8ac){return _0x1ee8ac[_0x0a4b('0x1c')](_0x755b87)[_0x0a4b('0x1d')](function(_0x5413c0){return _0x5413c0;});}return null;};}function removeEntity(_0x14eb90){return function(_0x1e1d94){if(_0x1e1d94){return _0x1e1d94['destroy']()[_0x0a4b('0x1d')](function(){_0x14eb90[_0x0a4b('0x14')](0xcc)[_0x0a4b('0x13')]();});}};}function handleEntityNotFound(_0xcb1c57){return function(_0x773a67){if(!_0x773a67){_0xcb1c57[_0x0a4b('0x12')](0x194);}return _0x773a67;};}function handleError(_0x2f3070,_0x3117a5){_0x3117a5=_0x3117a5||0x1f4;return function(_0x3ca082){logger[_0x0a4b('0x1e')](_0x3ca082['stack']);if(_0x3ca082[_0x0a4b('0x1f')]){delete _0x3ca082[_0x0a4b('0x1f')];}_0x2f3070[_0x0a4b('0x14')](_0x3117a5)[_0x0a4b('0x20')](_0x3ca082);};}function getInteractionUsers(_0x3d8ad1,_0x218ccf){return new BPromise(function(_0x25539c,_0x3e5869){try{if(_0x218ccf[_0x3d8ad1['id']]){_0x3d8ad1['Users']=_[_0x0a4b('0x21')](_0x218ccf[_0x3d8ad1['id']],function(_0x12203c){return{'id':_0x12203c['id'],'fullname':_0x12203c[_0x0a4b('0x22')]};});}}catch(_0x2cf136){_0x3e5869(_0x2cf136);}_0x25539c(_0x3d8ad1);});}function getInteractionTags(_0x5807e2,_0x4ee996){return new BPromise(function(_0x5ab279,_0x32ad3a){try{if(_0x5807e2[_0x0a4b('0x23')]){_0x5807e2[_0x0a4b('0x24')]=[];_0x5807e2['TagIds'][_0x0a4b('0x25')](',')['forEach'](function(_0x36f4ac){_0x5807e2[_0x0a4b('0x24')][_0x0a4b('0x26')](_0x4ee996[_0x36f4ac]);});}delete _0x5807e2[_0x0a4b('0x23')];}catch(_0x480a57){_0x32ad3a(_0x480a57);}_0x5ab279(_0x5807e2);});}function getLastMessageText(_0x34cdd0){return new BPromise(function(_0x4c09b1,_0x2e1bf5){return db[_0x0a4b('0x27')][_0x0a4b('0x28')]({'where':{'$and':[{'MailInteractionId':_0x34cdd0['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a4b('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x0a4b('0x2a')],'order':_0x0a4b('0x2b'),'raw':!![]})['then'](function(_0x4d8941){if(_0x4d8941&&_0x4d8941[_0x0a4b('0x2a')]){_0x34cdd0['lastMsgText']=_[_0x0a4b('0x2c')](_0x4d8941[_0x0a4b('0x2a')]);}_0x4c09b1(_0x34cdd0);})[_0x0a4b('0x2d')](function(_0x5e0092){_0x2e1bf5(_0x5e0092);});});}function updateMailInteraction(_0x1607af,_0x524835,_0xd6b6d0,_0x793c3f){return new BPromise(function(_0x286b2b,_0x2d6b59){return getInteractionUsers(_0x1607af,_0xd6b6d0)[_0x0a4b('0x1d')](function(_0x4bd9b3){return getInteractionTags(_0x4bd9b3,_0x524835);})[_0x0a4b('0x1d')](function(_0xe19687){if(_0x793c3f){_0x286b2b(getLastMessageText(_0xe19687));}else{_0x286b2b(_0xe19687);}})['catch'](function(_0x14af29){_0x2d6b59(_0x14af29);});});}exports['index']=function(_0x3d18e2,_0x136fa7){var _0x1c83e2={},_0xf55b9e={},_0x54e2ea={'count':0x0,'rows':[]};var _0x35132d=_[_0x0a4b('0x21')](db[_0x0a4b('0x2e')][_0x0a4b('0x2f')],function(_0x33cf7a){return{'name':_0x33cf7a[_0x0a4b('0x30')],'type':_0x33cf7a[_0x0a4b('0x31')]['key']};});_0xf55b9e[_0x0a4b('0x32')]=_[_0x0a4b('0x21')](_0x35132d,_0x0a4b('0x1f'));_0xf55b9e[_0x0a4b('0x33')]=_[_0x0a4b('0x34')](_0x3d18e2[_0x0a4b('0x33')]);_0xf55b9e[_0x0a4b('0x35')]=_[_0x0a4b('0x36')](_0xf55b9e[_0x0a4b('0x32')],_0xf55b9e[_0x0a4b('0x33')]);_0x1c83e2[_0x0a4b('0x37')]=_['intersection'](_0xf55b9e[_0x0a4b('0x32')],qs[_0x0a4b('0x38')](_0x3d18e2['query'][_0x0a4b('0x38')]));_0x1c83e2[_0x0a4b('0x37')]=_0x1c83e2[_0x0a4b('0x37')][_0x0a4b('0x39')]?_0x1c83e2[_0x0a4b('0x37')]:_0xf55b9e[_0x0a4b('0x32')];if(!_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x3a')]('nolimit')){_0x1c83e2[_0x0a4b('0x18')]=qs[_0x0a4b('0x18')](_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x18')]);_0x1c83e2['offset']=qs['offset'](_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x16')]);}_0x1c83e2[_0x0a4b('0x3b')]=qs[_0x0a4b('0x3c')](_0x3d18e2['query'][_0x0a4b('0x3c')]);_0x1c83e2[_0x0a4b('0x3d')]=qs['filters'](_['pick'](_0x3d18e2[_0x0a4b('0x33')],_0xf55b9e['filters']),_0x35132d);var _0x26fb2b=[];var _0x554f38=squel[_0x0a4b('0x3e')]()[_0x0a4b('0x3f')]('id')[_0x0a4b('0x3f')]('name')[_0x0a4b('0x3f')]('color')[_0x0a4b('0x40')](_0x0a4b('0x41'));var _0x3ce962=squel[_0x0a4b('0x3e')]()[_0x0a4b('0x3f')]('u.id')[_0x0a4b('0x3f')](_0x0a4b('0x42'))[_0x0a4b('0x3f')](_0x0a4b('0x43'))[_0x0a4b('0x40')](_0x0a4b('0x44'),'ui')[_0x0a4b('0x45')](_0x0a4b('0x46'),'u',_0x0a4b('0x47'));var _0x453dc0=squel[_0x0a4b('0x3e')]()[_0x0a4b('0x40')](_0x0a4b('0x48'),'i')[_0x0a4b('0x45')](_0x0a4b('0x49'),'c',_0x0a4b('0x4a'))[_0x0a4b('0x45')](_0x0a4b('0x46'),'o',_0x0a4b('0x4b'))[_0x0a4b('0x45')]('mail_accounts','a',_0x0a4b('0x4c'))['left_join'](_0x0a4b('0x4d'),'me',_0x0a4b('0x4e'))[_0x0a4b('0x45')](_0x0a4b('0x4f'),'it',_0x0a4b('0x50'))[_0x0a4b('0x45')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x59d8ff=squel[_0x0a4b('0x51')]();var _0x69a5f6=[];var _0x490769=squel[_0x0a4b('0x51')]();var _0x26056b;if(_0x3d18e2['query'][_0x0a4b('0x52')]){_0x26056b=as['parseSearch'](_0x3d18e2['query'][_0x0a4b('0x52')]);var _0x5437c5=_0x26056b[_0x0a4b('0x53')];for(var _0x5f00b6=0x0;_0x5f00b6<_0x26056b[_0x0a4b('0x54')][_0x0a4b('0x39')];_0x5f00b6++){var _0x36696d=_0x26056b[_0x0a4b('0x54')][_0x5f00b6];var _0x2f0ac5='i';var _0x36f7d6=_[_0x0a4b('0x55')](_0x35132d,[_0x0a4b('0x1f'),_0x36696d[_0x0a4b('0x3f')]]);if(!_0x36f7d6){switch(_0x36696d[_0x0a4b('0x3f')]){case _0x0a4b('0x56'):if(_0x36696d['value']==0x1){_0x453dc0[_0x0a4b('0x57')]('`'+_0x36696d[_0x0a4b('0x3f')]+'`\x20=\x200');}else{_0x453dc0[_0x0a4b('0x57')]('`'+_0x36696d[_0x0a4b('0x3f')]+_0x0a4b('0x58'));}break;case _0x0a4b('0x59'):if(_0x36696d[_0x0a4b('0x5a')]===_0x0a4b('0x5b')){if(_0x36696d[_0x0a4b('0x5c')][_0x0a4b('0x25')]('\x20')[_0x0a4b('0x39')]>0x1){_0x59d8ff[_0x5437c5](_0x0a4b('0x5d'),qs['getFullTextValue'](_0x36696d[_0x0a4b('0x5c')]),null);}else{var _0x4072de='%'+_0x36696d[_0x0a4b('0x5c')]+'%';_0x59d8ff[_0x5437c5](_0x0a4b('0x5e'),_0x4072de,_0x4072de,_0x4072de);}}else{_0x36f7d6=_[_0x0a4b('0x55')](_0x35132d,['name',_0x0a4b('0x5f')]);_0x36696d[_0x0a4b('0x3f')]=_0x0a4b('0x5f');_0x16e3c9=as[_0x0a4b('0x60')](_0x2f0ac5,_0x36f7d6[_0x0a4b('0x31')],_0x36696d);_0x59d8ff[_0x5437c5](_0x16e3c9[_0x0a4b('0x61')],_0x16e3c9[_0x0a4b('0x5c')][_0x0a4b('0x62')],_0x16e3c9[_0x0a4b('0x5c')][_0x0a4b('0x13')]);}break;case _0x0a4b('0x63'):var _0x659f91=_0x36696d[_0x0a4b('0x5c')]['split'](',')[_0x0a4b('0x21')](function(_0x189dca){return Number(_0x189dca);});_0x659f91[_0x0a4b('0x64')](function(_0x4bcbd6){_0x490769['or'](_0x0a4b('0x65'),'%,'+_0x4bcbd6+',%');});_0x69a5f6=_['union'](_0x69a5f6,_0x659f91);break;case _0x0a4b('0x66'):if(_0x36696d[_0x0a4b('0x5a')]==='$substring'){_0x59d8ff[_0x5437c5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x36696d[_0x0a4b('0x5c')]+'%',null);}else{_0x36f7d6=_['find'](_0x35132d,[_0x0a4b('0x1f'),'UserId']);_0x36696d[_0x0a4b('0x3f')]=_0x0a4b('0x67');_0x16e3c9=as['buildExpression'](_0x2f0ac5,_0x36f7d6[_0x0a4b('0x31')],_0x36696d);_0x59d8ff[_0x5437c5](_0x16e3c9[_0x0a4b('0x61')],_0x16e3c9[_0x0a4b('0x5c')][_0x0a4b('0x62')],_0x16e3c9[_0x0a4b('0x5c')][_0x0a4b('0x13')]);}break;case _0x0a4b('0x2a'):_0x16e3c9=as['buildExpression']('me',null,_0x36696d);_0x59d8ff[_0x5437c5](_0x16e3c9[_0x0a4b('0x61')],_0x16e3c9['value']['start'],_0x16e3c9[_0x0a4b('0x5c')][_0x0a4b('0x13')]);break;}}else{var _0x16e3c9=as[_0x0a4b('0x60')](_0x2f0ac5,_0x36f7d6[_0x0a4b('0x31')],_0x36696d);_0x59d8ff[_0x5437c5](_0x16e3c9[_0x0a4b('0x61')],_0x16e3c9[_0x0a4b('0x5c')][_0x0a4b('0x62')],_0x16e3c9['value']['end']);}}}else{var _0x3f21ea=_(_0x3d18e2[_0x0a4b('0x33')])[_0x0a4b('0x34')]()['map'](function(_0x217943){return _[_0x0a4b('0x68')](_0x35132d,[_0x0a4b('0x1f'),_0x217943])?_0x217943:undefined;})[_0x0a4b('0x69')]()[_0x0a4b('0x5c')]();if(!_[_0x0a4b('0x6a')](_0x3f21ea)){_0x3f21ea['forEach'](function(_0x5db79c){if(_0x5db79c===_0x0a4b('0x6b')){_0x453dc0[_0x0a4b('0x3d')](_0x0a4b('0x6c'),[][_0x0a4b('0x6d')](_0x3d18e2[_0x0a4b('0x33')][_0x5db79c]));}else if(_0x5db79c===_0x0a4b('0x6e')){var _0x56cf03=JSON[_0x0a4b('0x6f')](_0x3d18e2['query'][_0x5db79c])[_0x0a4b('0x70')];var _0x5ee1f5=JSON[_0x0a4b('0x6f')](_0x3d18e2[_0x0a4b('0x33')][_0x5db79c])['$lte'];_0x453dc0[_0x0a4b('0x3d')](_0x0a4b('0x71'),_0x56cf03,_0x5ee1f5);}else{if(_0x3d18e2[_0x0a4b('0x33')][_0x5db79c]===_0x0a4b('0x72')){_0x453dc0[_0x0a4b('0x3d')]('i.'+_0x5db79c+_0x0a4b('0x73'));}else{_0x453dc0[_0x0a4b('0x3d')]('i.'+_0x5db79c+_0x0a4b('0x74'),_0x3d18e2['query'][_0x5db79c]);}}});}if(_0x3d18e2[_0x0a4b('0x33')]['read']){if(_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x75')]==0x1){_0x453dc0[_0x0a4b('0x57')](_0x0a4b('0x76'));}else{_0x453dc0[_0x0a4b('0x57')](_0x0a4b('0x77'));}}if(_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x78')]){_0x69a5f6=_[_0x0a4b('0x79')](_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x78')])?_0x3d18e2['query'][_0x0a4b('0x78')]:new Array(_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x78')]);_0x69a5f6[_0x0a4b('0x64')](function(_0x40808a){_0x490769['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x40808a+',%');});}if(_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x7a')]){var _0x161585=_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x7a')][_0x0a4b('0x7b')]('\x5c','\x5c\x5c')[_0x0a4b('0x7b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x161585)){_0x59d8ff['or'](_0x0a4b('0x7c'),_0x161585+'%');}else if(qs[_0x0a4b('0x7d')](_0x161585)){_0x59d8ff['or'](_0x0a4b('0x7e'),_0x161585+'%');}else{_0x59d8ff['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a4b('0x7f')](_0x161585))['or'](_0x0a4b('0x80'),qs[_0x0a4b('0x7f')](_0x161585));}}}_0x453dc0[_0x0a4b('0x3d')](_0x59d8ff);_0x453dc0[_0x0a4b('0x81')](_0x0a4b('0x82'));var _0x34e148={'type':db[_0x0a4b('0x83')][_0x0a4b('0x84')]['SELECT'],'raw':!![]};var _0x4d658d=_0x453dc0[_0x0a4b('0x85')]();_0x4d658d[_0x0a4b('0x3f')]('i.id');_0x4d658d[_0x0a4b('0x3f')](_0x0a4b('0x86'),'unreadMessages');if(_0x1c83e2[_0x0a4b('0x3b')]){_0x1c83e2['order'][_0x0a4b('0x64')](function(_0x47f93a){var _0x455fc7=_0x47f93a[0x0]===_0x0a4b('0x87')?_0x47f93a[0x0]:'i.'+_0x47f93a[0x0];_0x453dc0[_0x0a4b('0x3b')](_0x455fc7,_0x47f93a[0x1]===_0x0a4b('0x88')?![]:!![]);});}if(!_[_0x0a4b('0x6a')](_0x69a5f6)){_0x453dc0[_0x0a4b('0x57')](_0x490769);_0x4d658d[_0x0a4b('0x3d')](_0x0a4b('0x89'),_0x69a5f6);}BPromise[_0x0a4b('0x8a')]()[_0x0a4b('0x1d')](function(){if(!_0x26056b){if(_0x3d18e2[_0x0a4b('0x33')]['MailAccountId'])return;_0x4d658d[_0x0a4b('0x3d')](_0x0a4b('0x8b'));_0x453dc0['where'](_0x0a4b('0x8b'));return;}if(_0x3d18e2[_0x0a4b('0x8c')][_0x0a4b('0x8d')]!==_0x0a4b('0x8e'))return;return _0x3d18e2['user'][_0x0a4b('0x8f')]({'attributes':['id'],'raw':!![]})[_0x0a4b('0x1d')](function(_0x495d3f){if(_[_0x0a4b('0x6a')](_0x495d3f)){_0x4d658d[_0x0a4b('0x3d')]('i.MailAccountId\x20IS\x20NULL');_0x453dc0[_0x0a4b('0x3d')](_0x0a4b('0x90'));}else{_0x4d658d[_0x0a4b('0x3d')](_0x0a4b('0x6c'),_[_0x0a4b('0x21')](_0x495d3f,'id'));_0x453dc0['where']('i.MailAccountId\x20IN\x20?',_[_0x0a4b('0x21')](_0x495d3f,'id'));}});})[_0x0a4b('0x1d')](function(){if(_0x3d18e2[_0x0a4b('0x8c')][_0x0a4b('0x8d')]===_0x0a4b('0x8e')&&!_0x26056b&&!_0x3d18e2[_0x0a4b('0x33')][_0x0a4b('0x6b')])return[];return db[_0x0a4b('0x91')][_0x0a4b('0x33')](_0x4d658d[_0x0a4b('0x92')](),_0x34e148);})[_0x0a4b('0x1d')](function(_0x3de12d){_0x54e2ea['count']=_0x3de12d[_0x0a4b('0x39')];if(_0x54e2ea[_0x0a4b('0x19')]===0x0)return[];return db['sequelize'][_0x0a4b('0x33')](_0x554f38['toString'](),_0x34e148)[_0x0a4b('0x1d')](function(_0x18dafc){_0x26fb2b=_['keyBy'](_0x18dafc,'id');_0x34e148=_[_0x0a4b('0x93')](_0x34e148,{'model':db[_0x0a4b('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d18e2['query']['fields']){_0x1c83e2[_0x0a4b('0x37')]['forEach'](function(_0x3f87a3){_0x453dc0['field']('i.'+_0x3f87a3);});}else{_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x86'),_0x0a4b('0x56'));_0x453dc0['field'](_0x0a4b('0x94'),_0x0a4b('0x95'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x96'),'Account.mandatoryDisposition');_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x97'),'contactName');_0x453dc0[_0x0a4b('0x3f')]('i.id');_0x453dc0['field'](_0x0a4b('0x98'));_0x453dc0['field']('i.updatedAt');_0x453dc0['field']('i.closed');_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x99'));_0x453dc0['field'](_0x0a4b('0x9a'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x9b'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x9c'));_0x453dc0['field'](_0x0a4b('0x9d'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x9e'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0x9f'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xa0'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xa1'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xa2'));_0x453dc0[_0x0a4b('0x3f')]('i.ContactId');_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xa3'));_0x453dc0['field'](_0x0a4b('0xa4'));_0x453dc0['field'](_0x0a4b('0xa5'),_0x0a4b('0xa6'));_0x453dc0['field'](_0x0a4b('0xa7'),_0x0a4b('0xa8'));_0x453dc0['field']('c.email',_0x0a4b('0xa9'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xaa'),_0x0a4b('0xab'));_0x453dc0[_0x0a4b('0x3f')]('c.mobile',_0x0a4b('0xac'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xad'),_0x0a4b('0xae'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xaf'),'Owner.fullname');_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xb0'),_0x0a4b('0xb1'));_0x453dc0[_0x0a4b('0x3f')](_0x0a4b('0xb2'),_0x0a4b('0x23'));}if(_0x1c83e2['limit'])_0x453dc0[_0x0a4b('0x18')](_0x1c83e2[_0x0a4b('0x18')]);if(_0x1c83e2['offset'])_0x453dc0[_0x0a4b('0x16')](_0x1c83e2[_0x0a4b('0x16')]);return db[_0x0a4b('0x91')][_0x0a4b('0x33')](_0x453dc0['toString'](),_0x34e148);})['then'](function(_0x1de695){if(_0x1de695[_0x0a4b('0x39')]>0x0)_0x3ce962[_0x0a4b('0x3d')](_0x0a4b('0xb3'),_[_0x0a4b('0x21')](_0x1de695,'id'));return db[_0x0a4b('0x91')][_0x0a4b('0x33')](_0x3ce962[_0x0a4b('0x92')](),_0x34e148)['then'](function(_0x34635b){var _0x433054=_[_0x0a4b('0xb4')](_0x34635b,_0x0a4b('0xb5'));var _0x56ab1a=[];return db[_0x0a4b('0xb6')]['findOne']({'attributes':[_0x0a4b('0xb7')],'raw':!![]})[_0x0a4b('0x1d')](function(_0x5af0ff){var _0x2c78c2=_0x5af0ff[_0x0a4b('0xb7')];_0x1de695['forEach'](function(_0xbd1a89){_0x56ab1a[_0x0a4b('0x26')](updateMailInteraction(_0xbd1a89,_0x26fb2b,_0x433054,_0x2c78c2));});return BPromise['all'](_0x56ab1a);});});});})['then'](function(_0x42b177){_0x54e2ea['rows']=_0x42b177;return _0x54e2ea;})[_0x0a4b('0x1d')](respondWithFilteredResult(_0x136fa7,_0x1c83e2))[_0x0a4b('0x2d')](handleError(_0x136fa7,null));};exports[_0x0a4b('0xb8')]=function(_0x300b64,_0x738cce){var _0x2195b8={'raw':![],'where':{'id':_0x300b64[_0x0a4b('0xb9')]['id']}},_0x594756={};_0x594756['model']=_['keys'](db[_0x0a4b('0x2e')][_0x0a4b('0x2f')]);_0x594756[_0x0a4b('0x33')]=_[_0x0a4b('0x34')](_0x300b64[_0x0a4b('0x33')]);_0x594756['filters']=_[_0x0a4b('0x36')](_0x594756['model'],_0x594756[_0x0a4b('0x33')]);_0x2195b8[_0x0a4b('0x37')]=_[_0x0a4b('0x36')](_0x594756[_0x0a4b('0x32')],qs[_0x0a4b('0x38')](_0x300b64[_0x0a4b('0x33')][_0x0a4b('0x38')]));_0x2195b8['attributes']=_0x2195b8['attributes']['length']?_0x2195b8[_0x0a4b('0x37')]:_0x594756[_0x0a4b('0x32')];if(_0x300b64[_0x0a4b('0x33')][_0x0a4b('0xba')]){_0x2195b8[_0x0a4b('0xbb')]=[{'all':!![]}];}_0x2195b8=_[_0x0a4b('0x93')]({},_0x2195b8,_0x300b64['options']);return db[_0x0a4b('0x2e')][_0x0a4b('0x55')](_0x2195b8)[_0x0a4b('0x1d')](handleEntityNotFound(_0x738cce,null))[_0x0a4b('0x1d')](respondWithResult(_0x738cce,null))['catch'](handleError(_0x738cce,null));};exports[_0x0a4b('0xbc')]=function(_0x5d4f9c,_0x53b1bb){return db[_0x0a4b('0x2e')][_0x0a4b('0xbc')](_0x5d4f9c['body'],{})[_0x0a4b('0x1d')](respondWithResult(_0x53b1bb,0xc9))[_0x0a4b('0x2d')](handleError(_0x53b1bb,null));};exports['update']=function(_0x47bac9,_0x1ad9ca){if(_0x47bac9[_0x0a4b('0xbd')]['id']){delete _0x47bac9[_0x0a4b('0xbd')]['id'];}return db[_0x0a4b('0x2e')][_0x0a4b('0x55')]({'where':{'id':_0x47bac9[_0x0a4b('0xb9')]['id']}})[_0x0a4b('0x1d')](handleEntityNotFound(_0x1ad9ca,null))[_0x0a4b('0x1d')](saveUpdates(_0x47bac9[_0x0a4b('0xbd')],null))[_0x0a4b('0x1d')](respondWithResult(_0x1ad9ca,null))['catch'](handleError(_0x1ad9ca,null));};exports['destroy']=function(_0x4caa56,_0x531d2c){return db[_0x0a4b('0x2e')][_0x0a4b('0x55')]({'where':{'id':_0x4caa56[_0x0a4b('0xb9')]['id']}})[_0x0a4b('0x1d')](handleEntityNotFound(_0x531d2c,null))[_0x0a4b('0x1d')](removeEntity(_0x531d2c,null))[_0x0a4b('0x2d')](handleError(_0x531d2c,null));};exports[_0x0a4b('0xbe')]=function(_0x3cd7a9,_0x5572aa){return db['MailInteraction'][_0x0a4b('0xbe')]()[_0x0a4b('0x1d')](respondWithResult(_0x5572aa,null))[_0x0a4b('0x2d')](handleError(_0x5572aa,null));};exports[_0x0a4b('0xbf')]=function(_0x3b84ec,_0x1f691b){return db[_0x0a4b('0x27')][_0x0a4b('0x55')]({'where':{'id':_0x3b84ec[_0x0a4b('0xb9')]['id']}})[_0x0a4b('0x1d')](handleEntityNotFound(_0x1f691b,null))[_0x0a4b('0x1d')](function(_0x4815f1){if(_0x4815f1){return _0x4815f1[_0x0a4b('0xbf')](_0x3b84ec['body'][_0x0a4b('0xc0')],_[_0x0a4b('0xc1')](_0x3b84ec[_0x0a4b('0xbd')],[_0x0a4b('0xc0'),'id'])||{});}})[_0x0a4b('0x1d')](respondWithResult(_0x1f691b,null))['catch'](handleError(_0x1f691b,null));};exports['getMessages']=function(_0x8f7701,_0x31c035){var _0x1372c0={'raw':![],'where':{}};var _0x580561={};var _0xfd50b9={'count':0x0,'rows':[]};return db[_0x0a4b('0x2e')]['findOne']({'where':{'id':_0x8f7701['params']['id']}})['then'](handleEntityNotFound(_0x31c035,null))[_0x0a4b('0x1d')](function(_0x4c2154){if(_0x4c2154){_0x580561['model']=_[_0x0a4b('0x34')](db['MailMessage']['rawAttributes']);_0x580561[_0x0a4b('0x33')]=_[_0x0a4b('0x34')](_0x8f7701[_0x0a4b('0x33')]);_0x580561['filters']=_[_0x0a4b('0x36')](_0x580561[_0x0a4b('0x32')],_0x580561['query']);_0x1372c0['attributes']=_[_0x0a4b('0x36')](_0x580561[_0x0a4b('0x32')],qs[_0x0a4b('0x38')](_0x8f7701[_0x0a4b('0x33')][_0x0a4b('0x38')]));_0x1372c0[_0x0a4b('0x37')]=_0x1372c0['attributes'][_0x0a4b('0x39')]?_0x1372c0[_0x0a4b('0x37')]:_0x580561[_0x0a4b('0x32')];if(!_0x8f7701[_0x0a4b('0x33')]['hasOwnProperty'](_0x0a4b('0xc2'))){_0x1372c0[_0x0a4b('0x18')]=qs[_0x0a4b('0x18')](_0x8f7701[_0x0a4b('0x33')][_0x0a4b('0x18')]);_0x1372c0[_0x0a4b('0x16')]=qs[_0x0a4b('0x16')](_0x8f7701[_0x0a4b('0x33')][_0x0a4b('0x16')]);}_0x1372c0['order']=qs[_0x0a4b('0x3c')](_0x8f7701[_0x0a4b('0x33')][_0x0a4b('0x3c')]);_0x1372c0[_0x0a4b('0x3d')]=qs[_0x0a4b('0x35')](_[_0x0a4b('0xc3')](_0x8f7701['query'],_0x580561['filters']));_0x1372c0[_0x0a4b('0x3d')][_0x0a4b('0xb5')]=_0x4c2154['id'];if(_0x8f7701[_0x0a4b('0x33')][_0x0a4b('0x7a')]){_0x1372c0[_0x0a4b('0x3d')]=_[_0x0a4b('0x93')](_0x1372c0[_0x0a4b('0x3d')],{'$or':_[_0x0a4b('0x21')](_0x1372c0[_0x0a4b('0x37')],function(_0x2272ab){var _0x4e24c8={};_0x4e24c8[_0x2272ab]={'$like':'%'+_0x8f7701[_0x0a4b('0x33')]['filter']+'%'};return _0x4e24c8;})});}if(_0x8f7701['query'][_0x0a4b('0x70')]){var _0x564fef=_0x8f7701[_0x0a4b('0x33')][_0x0a4b('0x70')][_0x0a4b('0x25')](',');var _0x643536={};_0x643536[_0x564fef[0x0]]={'$gte':moment(_0x564fef[0x1])[_0x0a4b('0xc4')](_0x0a4b('0xc5'))};_0x1372c0[_0x0a4b('0x3d')]=_['merge'](_0x1372c0[_0x0a4b('0x3d')],_0x643536);}_0x1372c0=_[_0x0a4b('0x93')]({},_0x1372c0,_0x8f7701[_0x0a4b('0xc6')]);return db[_0x0a4b('0x27')][_0x0a4b('0x19')]({'where':_0x1372c0[_0x0a4b('0x3d')]})[_0x0a4b('0x1d')](function(_0x236341){_0xfd50b9[_0x0a4b('0x19')]=_0x236341;if(_0x8f7701['query'][_0x0a4b('0xba')]){_0x1372c0[_0x0a4b('0xbb')]=[{'all':!![]}];}return db[_0x0a4b('0x27')]['findAll'](_0x1372c0);})[_0x0a4b('0x1d')](function(_0x164aee){if(_0x8f7701['query'][_0x0a4b('0xc7')]===_0x0a4b('0xc8')){for(var _0x2b40a=0x0;_0x2b40a<_0x164aee[_0x0a4b('0x39')];_0x2b40a++){_0x164aee[_0x2b40a][_0x0a4b('0xbd')]=juice(_0x164aee[_0x2b40a]['body']);}}_0xfd50b9[_0x0a4b('0xc9')]=_0x164aee;return _0xfd50b9;});}})[_0x0a4b('0x1d')](respondWithFilteredResult(_0x31c035,_0x1372c0))[_0x0a4b('0x2d')](handleError(_0x31c035,null));};exports[_0x0a4b('0xca')]=function(_0x5ef0df,_0x17ca19){return db[_0x0a4b('0x2e')][_0x0a4b('0x55')]({'where':{'id':_0x5ef0df[_0x0a4b('0xb9')]['id']}})[_0x0a4b('0x1d')](handleEntityNotFound(_0x17ca19,null))[_0x0a4b('0x1d')](function(_0x5f0ee0){if(_0x5f0ee0){return _0x5f0ee0[_0x0a4b('0xcb')](_0x5ef0df[_0x0a4b('0xbd')][_0x0a4b('0xc0')],_[_0x0a4b('0xc1')](_0x5ef0df['body'],[_0x0a4b('0xc0'),'id'])||{})[_0x0a4b('0xcc')](function(){return db['Tag'][_0x0a4b('0xcd')]({'attributes':['id',_0x0a4b('0x1f'),'color'],'where':{'id':_0x5ef0df['body']['ids']}});})[_0x0a4b('0x1d')](function(_0x26a3d0){socket[_0x0a4b('0xce')](_0x0a4b('0xcf'),{'id':Number(_0x5ef0df[_0x0a4b('0xb9')]['id']),'tags':_0x26a3d0||[]});return{'id':Number(_0x5ef0df[_0x0a4b('0xb9')]['id']),'tags':_0x26a3d0||[]};});}})['then'](respondWithResult(_0x17ca19,null))[_0x0a4b('0x2d')](handleError(_0x17ca19,null));};exports['removeTags']=function(_0x165f91,_0x1c8ae6){return db[_0x0a4b('0x2e')][_0x0a4b('0x55')]({'where':{'id':_0x165f91['params']['id']}})[_0x0a4b('0x1d')](handleEntityNotFound(_0x1c8ae6,null))['then'](function(_0x1f48d1){if(_0x1f48d1){return _0x1f48d1[_0x0a4b('0xd0')](_0x165f91[_0x0a4b('0x33')][_0x0a4b('0xc0')]);}})[_0x0a4b('0x1d')](respondWithStatusCode(_0x1c8ae6,null))[_0x0a4b('0x2d')](handleError(_0x1c8ae6,null));};exports['download']=function(_0xc522ed,_0x594c0b){var _0x4d8d02=moment()[_0x0a4b('0xd1')]()[_0x0a4b('0x92')]();var _0x45e659=path['join'](config[_0x0a4b('0xd2')],_0x0a4b('0xd3'),_0x0a4b('0xd4'),_0x0a4b('0xd5'));var _0x48f6a2=path[_0x0a4b('0xd6')](config[_0x0a4b('0xd2')],_0x0a4b('0xd3'),_0x0a4b('0xd4'),_0x0a4b('0xd7'));var _0x1ac75e=path['join'](_0x45e659,_0x4d8d02);var _0xca58fd=util[_0x0a4b('0xc4')](_0x0a4b('0xd8'),_0xc522ed[_0x0a4b('0xb9')]['id'],_0x4d8d02);var _0x5b2f3e=path[_0x0a4b('0xd6')](_0x45e659,_0xca58fd);var _0x357962=[];if(_0xc522ed['query'][_0x0a4b('0xd7')]){_0x357962[_0x0a4b('0x26')]({'model':db[_0x0a4b('0xd9')],'as':_0x0a4b('0xda'),'raw':!![]});}var _0x354f59=[{'model':db['MailMessage'],'as':_0x0a4b('0xdb'),'attributes':['id','body','from','to','cc',_0x0a4b('0xdc'),_0x0a4b('0xdd'),_0x0a4b('0x6e')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x357962}];return db[_0x0a4b('0x2e')][_0x0a4b('0x55')]({'where':{'id':_0xc522ed['params']['id']},'include':_0x354f59})[_0x0a4b('0x1d')](handleEntityNotFound(_0x594c0b,null))[_0x0a4b('0x1d')](function(_0x569451){if(_0x569451&&_0x569451[_0x0a4b('0xdb')]){var _0x50f867=_0x569451[_0x0a4b('0xde')]({'plain':!![]});fs[_0x0a4b('0xdf')](_0x1ac75e);return BPromise[_0x0a4b('0xe0')](_0x50f867[_0x0a4b('0xdb')],function(_0x840849,_0x24d075){var _0x2147f9={'from':_0x840849[_0x0a4b('0x40')],'to':_0x840849['to'],'subject':_0x840849[_0x0a4b('0xdd')],'html':htmlEntities[_0x0a4b('0xe1')](_0x840849[_0x0a4b('0xbd')]),'headers':{'Date':moment(_0x840849[_0x0a4b('0x6e')])[_0x0a4b('0xc4')](_0x0a4b('0xe2'))},'attachments':[]};if(_0x840849['cc']){_0x2147f9[_0x0a4b('0xe3')]['Cc']=_0x840849['cc'];}if(_0x840849['bcc']){_0x2147f9[_0x0a4b('0xe3')][_0x0a4b('0xe4')]=_0x840849['bcc'];}return new BPromise(function(_0x479782,_0x476cc4){if(_0x840849[_0x0a4b('0xda')]){for(var _0x30c4a1=0x0;_0x30c4a1<_0x840849[_0x0a4b('0xda')][_0x0a4b('0x39')];_0x30c4a1++){var _0x16e8ad=_0x840849['Attachments'][_0x30c4a1];var _0x5c639c=path[_0x0a4b('0xd6')](_0x48f6a2,_0x16e8ad[_0x0a4b('0xe5')]);if(fs[_0x0a4b('0xe6')](_0x5c639c)){_0x2147f9[_0x0a4b('0xd7')][_0x0a4b('0x26')]({'name':_0x16e8ad[_0x0a4b('0x1f')],'contentType':_0x16e8ad[_0x0a4b('0x31')],'data':fs['readFileSync'](_0x5c639c)});}}}emlformat[_0x0a4b('0xe7')](_0x2147f9,function(_0x5c6219,_0x21a51d){if(_0x5c6219)return _0x476cc4(_0x5c6219);fs[_0x0a4b('0xe8')](path['join'](_0x1ac75e,util['format']('message%d.eml',_0x24d075)),_0x21a51d);return _0x479782(_0x21a51d);});});})[_0x0a4b('0x1d')](function(){return new BPromise(function(_0x475cdf,_0x40ac0c){zipdir(_0x1ac75e,{'saveTo':_0x5b2f3e},function(_0x5b99ef,_0x10f2ec){if(_0x5b99ef)return _0x40ac0c(_0x5b99ef);return _0x475cdf(_0x10f2ec);});})[_0x0a4b('0x1d')](function(){return new BPromise(function(_0x545934,_0x193724){rimraf(_0x1ac75e,function(_0x1d82ae){if(_0x1d82ae)_0x193724(_0x1d82ae);return _0x545934();});});})[_0x0a4b('0x1d')](function(){return _0x594c0b[_0x0a4b('0xe9')](_0x5b2f3e,_0xca58fd,function(_0x2760aa){if(!_0x2760aa)fs[_0x0a4b('0xea')](_0x5b2f3e);});});});}else{return _0x594c0b[_0x0a4b('0x12')](0xc8);}})[_0x0a4b('0x2d')](handleError(_0x594c0b,null));}; \ No newline at end of file +var _0xbe13=['omit','hasOwnProperty','$gte','format','findAll','true','addTags','setTags','spread','mailInteractionTags:save','removeTags','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','get','mkdirSync','each','createdAt','headers','basename','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','zip-dir','moment','path','lodash','squel','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','offset','undefined','count','set','json','update','then','destroy','send','Users','Tags','TagIds','split','push','findOne','out','plainBody','-id','catch','map','MailInteraction','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','field','from','select','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','end','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','SELECT','clone','i.id','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','all','rows','show','rawAttributes','includeAll','include','options','create','body','params','describe','MailMessage','addMessage','ids'];(function(_0x3fca9c,_0x2f15e2){var _0x5a5f88=function(_0x557241){while(--_0x557241){_0x3fca9c['push'](_0x3fca9c['shift']());}};_0x5a5f88(++_0x2f15e2);}(_0xbe13,0xf9));var _0x3be1=function(_0x55dc5f,_0x1f93e9){_0x55dc5f=_0x55dc5f-0x0;var _0xd06ec6=_0xbe13[_0x55dc5f];return _0xd06ec6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3be1('0x0'));var moment=require(_0x3be1('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x3be1('0x2'));var fs=require('fs');var _=require(_0x3be1('0x3'));var squel=require(_0x3be1('0x4'));var juice=require(_0x3be1('0x5'));var Redis=require('ioredis');var qs=require(_0x3be1('0x6'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0x3be1('0x7'));var config=require(_0x3be1('0x8'));var db=require(_0x3be1('0x9'))['db'];var htmlEntities=require('html-entities');config[_0x3be1('0xa')]=_[_0x3be1('0xb')](config[_0x3be1('0xa')],{'host':_0x3be1('0xc'),'port':0x18eb});var socket=require(_0x3be1('0xd'))(new Redis(config[_0x3be1('0xa')]));require(_0x3be1('0xe'))[_0x3be1('0xf')](socket);function respondWithStatusCode(_0x46c949,_0x43abe0){_0x43abe0=_0x43abe0||0xcc;return function(_0x1ba037){if(_0x1ba037){return _0x46c949[_0x3be1('0x10')](_0x43abe0);}return _0x46c949[_0x3be1('0x11')](_0x43abe0)['end']();};}function respondWithResult(_0x494fa7,_0x2f303){_0x2f303=_0x2f303||0xc8;return function(_0x25d441){if(_0x25d441){return _0x494fa7['status'](_0x2f303)['json'](_0x25d441);}};}function respondWithFilteredResult(_0xf6671c,_0x2954cf){return function(_0x49ebe4){if(_0x49ebe4){var _0x9cbf6b=typeof _0x2954cf[_0x3be1('0x12')]===_0x3be1('0x13')&&typeof _0x2954cf['limit']==='undefined';var _0x163813=_0x49ebe4[_0x3be1('0x14')];var _0x153e64=_0x9cbf6b?0x0:_0x2954cf[_0x3be1('0x12')];var _0x324588=_0x9cbf6b?_0x49ebe4[_0x3be1('0x14')]:_0x2954cf['offset']+_0x2954cf['limit'];var _0x421da8;if(_0x324588>=_0x163813){_0x324588=_0x163813;_0x421da8=0xc8;}else{_0x421da8=0xce;}_0xf6671c[_0x3be1('0x11')](_0x421da8);return _0xf6671c[_0x3be1('0x15')]('Content-Range',_0x153e64+'-'+_0x324588+'/'+_0x163813)[_0x3be1('0x16')](_0x49ebe4);}return null;};}function saveUpdates(_0x3bf81a){return function(_0x4b9491){if(_0x4b9491){return _0x4b9491[_0x3be1('0x17')](_0x3bf81a)[_0x3be1('0x18')](function(_0x24dcbc){return _0x24dcbc;});}return null;};}function removeEntity(_0x946f37){return function(_0x20b1ed){if(_0x20b1ed){return _0x20b1ed[_0x3be1('0x19')]()[_0x3be1('0x18')](function(){_0x946f37[_0x3be1('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd7290e){return function(_0x4b86c9){if(!_0x4b86c9){_0xd7290e[_0x3be1('0x10')](0x194);}return _0x4b86c9;};}function handleError(_0x2942a0,_0x2c671e){_0x2c671e=_0x2c671e||0x1f4;return function(_0x2fd6d6){logger['error'](_0x2fd6d6['stack']);if(_0x2fd6d6['name']){delete _0x2fd6d6['name'];}_0x2942a0['status'](_0x2c671e)[_0x3be1('0x1a')](_0x2fd6d6);};}function getInteractionUsers(_0x149097,_0x5ee74f){return new BPromise(function(_0x46b787,_0x30ab2d){try{if(_0x5ee74f[_0x149097['id']]){_0x149097[_0x3be1('0x1b')]=_['map'](_0x5ee74f[_0x149097['id']],function(_0x3dc3c3){return{'id':_0x3dc3c3['id'],'fullname':_0x3dc3c3['fullname']};});}}catch(_0x20f12e){_0x30ab2d(_0x20f12e);}_0x46b787(_0x149097);});}function getInteractionTags(_0x49cd89,_0x250010){return new BPromise(function(_0x358e74,_0x2460be){try{if(_0x49cd89['TagIds']){_0x49cd89[_0x3be1('0x1c')]=[];_0x49cd89[_0x3be1('0x1d')][_0x3be1('0x1e')](',')['forEach'](function(_0x2d10c7){_0x49cd89[_0x3be1('0x1c')][_0x3be1('0x1f')](_0x250010[_0x2d10c7]);});}delete _0x49cd89['TagIds'];}catch(_0x48cbd2){_0x2460be(_0x48cbd2);}_0x358e74(_0x49cd89);});}function getLastMessageText(_0x169be1){return new BPromise(function(_0xb4a6aa,_0x4b2dbb){return db['MailMessage'][_0x3be1('0x20')]({'where':{'$and':[{'MailInteractionId':_0x169be1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x3be1('0x21')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3be1('0x22')],'order':_0x3be1('0x23'),'raw':!![]})[_0x3be1('0x18')](function(_0x1c3527){if(_0x1c3527&&_0x1c3527[_0x3be1('0x22')]){_0x169be1['lastMsgText']=_['trimStart'](_0x1c3527[_0x3be1('0x22')]);}_0xb4a6aa(_0x169be1);})['catch'](function(_0x89db6d){_0x4b2dbb(_0x89db6d);});});}function updateMailInteraction(_0xcef8ad,_0xc3438b,_0x2e6982,_0x10c54b){return new BPromise(function(_0x2c8fc6,_0x499c58){return getInteractionUsers(_0xcef8ad,_0x2e6982)[_0x3be1('0x18')](function(_0x27476d){return getInteractionTags(_0x27476d,_0xc3438b);})[_0x3be1('0x18')](function(_0x466d90){if(_0x10c54b){_0x2c8fc6(getLastMessageText(_0x466d90));}else{_0x2c8fc6(_0x466d90);}})[_0x3be1('0x24')](function(_0x52a53b){_0x499c58(_0x52a53b);});});}exports['index']=function(_0x4afe64,_0xe135d0){var _0x2883c6={},_0x22057a={},_0x1e0d2e={'count':0x0,'rows':[]};var _0x576cda=_[_0x3be1('0x25')](db[_0x3be1('0x26')]['rawAttributes'],function(_0xbfe716){return{'name':_0xbfe716['fieldName'],'type':_0xbfe716[_0x3be1('0x27')]['key']};});_0x22057a[_0x3be1('0x28')]=_[_0x3be1('0x25')](_0x576cda,_0x3be1('0x29'));_0x22057a[_0x3be1('0x2a')]=_[_0x3be1('0x2b')](_0x4afe64[_0x3be1('0x2a')]);_0x22057a[_0x3be1('0x2c')]=_[_0x3be1('0x2d')](_0x22057a[_0x3be1('0x28')],_0x22057a[_0x3be1('0x2a')]);_0x2883c6[_0x3be1('0x2e')]=_[_0x3be1('0x2d')](_0x22057a[_0x3be1('0x28')],qs[_0x3be1('0x2f')](_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x2f')]));_0x2883c6[_0x3be1('0x2e')]=_0x2883c6['attributes'][_0x3be1('0x30')]?_0x2883c6[_0x3be1('0x2e')]:_0x22057a['model'];if(!_0x4afe64['query']['hasOwnProperty'](_0x3be1('0x31'))){_0x2883c6['limit']=qs[_0x3be1('0x32')](_0x4afe64['query']['limit']);_0x2883c6[_0x3be1('0x12')]=qs[_0x3be1('0x12')](_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x12')]);}_0x2883c6[_0x3be1('0x33')]=qs['sort'](_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x34')]);_0x2883c6['where']=qs[_0x3be1('0x2c')](_[_0x3be1('0x35')](_0x4afe64[_0x3be1('0x2a')],_0x22057a[_0x3be1('0x2c')]),_0x576cda);var _0x30c880=[];var _0x29b661=squel['select']()[_0x3be1('0x36')]('id')[_0x3be1('0x36')]('name')[_0x3be1('0x36')]('color')[_0x3be1('0x37')]('tools_tags');var _0x347801=squel[_0x3be1('0x38')]()[_0x3be1('0x36')](_0x3be1('0x39'))[_0x3be1('0x36')](_0x3be1('0x3a'))[_0x3be1('0x36')](_0x3be1('0x3b'))[_0x3be1('0x37')]('user_has_mail_interactions','ui')[_0x3be1('0x3c')](_0x3be1('0x3d'),'u',_0x3be1('0x3e'));var _0x45f4d6=squel[_0x3be1('0x38')]()[_0x3be1('0x37')]('mail_interactions','i')['left_join'](_0x3be1('0x3f'),'c',_0x3be1('0x40'))['left_join'](_0x3be1('0x3d'),'o',_0x3be1('0x41'))[_0x3be1('0x3c')](_0x3be1('0x42'),'a',_0x3be1('0x43'))[_0x3be1('0x3c')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0x3be1('0x44'),'it',_0x3be1('0x45'))[_0x3be1('0x3c')](_0x3be1('0x46'),'t','t.id\x20=\x20it.TagId');var _0x1fedd8=squel['expr']();var _0x703e79=[];var _0x30300b=squel[_0x3be1('0x47')]();var _0x318683;if(_0x4afe64['query'][_0x3be1('0x48')]){_0x318683=as['parseSearch'](_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x48')]);var _0x3ae41d=_0x318683[_0x3be1('0x49')];for(var _0x167fff=0x0;_0x167fff<_0x318683[_0x3be1('0x4a')][_0x3be1('0x30')];_0x167fff++){var _0x5d64c5=_0x318683[_0x3be1('0x4a')][_0x167fff];var _0x29a7a3='i';var _0x3fc0ad=_[_0x3be1('0x4b')](_0x576cda,[_0x3be1('0x29'),_0x5d64c5[_0x3be1('0x36')]]);if(!_0x3fc0ad){switch(_0x5d64c5['field']){case _0x3be1('0x4c'):if(_0x5d64c5[_0x3be1('0x4d')]==0x1){_0x45f4d6['having']('`'+_0x5d64c5[_0x3be1('0x36')]+_0x3be1('0x4e'));}else{_0x45f4d6[_0x3be1('0x4f')]('`'+_0x5d64c5['field']+'`\x20>\x200');}break;case _0x3be1('0x50'):if(_0x5d64c5[_0x3be1('0x51')]===_0x3be1('0x52')){if(_0x5d64c5[_0x3be1('0x4d')]['split']('\x20')['length']>0x1){_0x1fedd8[_0x3ae41d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5d64c5['value']),null);}else{var _0x3bbd65='%'+_0x5d64c5[_0x3be1('0x4d')]+'%';_0x1fedd8[_0x3ae41d](_0x3be1('0x53'),_0x3bbd65,_0x3bbd65,_0x3bbd65);}}else{_0x3fc0ad=_['find'](_0x576cda,[_0x3be1('0x29'),_0x3be1('0x54')]);_0x5d64c5[_0x3be1('0x36')]=_0x3be1('0x54');_0x12a7ad=as[_0x3be1('0x55')](_0x29a7a3,_0x3fc0ad[_0x3be1('0x27')],_0x5d64c5);_0x1fedd8[_0x3ae41d](_0x12a7ad[_0x3be1('0x56')],_0x12a7ad[_0x3be1('0x4d')]['start'],_0x12a7ad[_0x3be1('0x4d')][_0x3be1('0x57')]);}break;case _0x3be1('0x58'):var _0xb8b2a7=_0x5d64c5[_0x3be1('0x4d')]['split'](',')[_0x3be1('0x25')](function(_0x720439){return Number(_0x720439);});_0xb8b2a7[_0x3be1('0x59')](function(_0x15a306){_0x30300b['or'](_0x3be1('0x5a'),'%,'+_0x15a306+',%');});_0x703e79=_[_0x3be1('0x5b')](_0x703e79,_0xb8b2a7);break;case _0x3be1('0x5c'):if(_0x5d64c5['operator']===_0x3be1('0x52')){_0x1fedd8[_0x3ae41d](_0x3be1('0x5d'),'%'+_0x5d64c5[_0x3be1('0x4d')]+'%',null);}else{_0x3fc0ad=_[_0x3be1('0x4b')](_0x576cda,[_0x3be1('0x29'),_0x3be1('0x5e')]);_0x5d64c5[_0x3be1('0x36')]=_0x3be1('0x5e');_0x12a7ad=as[_0x3be1('0x55')](_0x29a7a3,_0x3fc0ad[_0x3be1('0x27')],_0x5d64c5);_0x1fedd8[_0x3ae41d](_0x12a7ad[_0x3be1('0x56')],_0x12a7ad['value'][_0x3be1('0x5f')],_0x12a7ad[_0x3be1('0x4d')]['end']);}break;case _0x3be1('0x22'):_0x12a7ad=as['buildExpression']('me',null,_0x5d64c5);_0x1fedd8[_0x3ae41d](_0x12a7ad[_0x3be1('0x56')],_0x12a7ad[_0x3be1('0x4d')][_0x3be1('0x5f')],_0x12a7ad[_0x3be1('0x4d')][_0x3be1('0x57')]);break;}}else{var _0x12a7ad=as[_0x3be1('0x55')](_0x29a7a3,_0x3fc0ad[_0x3be1('0x27')],_0x5d64c5);_0x1fedd8[_0x3ae41d](_0x12a7ad[_0x3be1('0x56')],_0x12a7ad[_0x3be1('0x4d')]['start'],_0x12a7ad[_0x3be1('0x4d')][_0x3be1('0x57')]);}}}else{var _0x25c590=_(_0x4afe64[_0x3be1('0x2a')])[_0x3be1('0x2b')]()[_0x3be1('0x25')](function(_0x9e69f6){return _[_0x3be1('0x60')](_0x576cda,['name',_0x9e69f6])?_0x9e69f6:undefined;})['compact']()[_0x3be1('0x4d')]();if(!_[_0x3be1('0x61')](_0x25c590)){_0x25c590[_0x3be1('0x59')](function(_0x422a0c){if(_0x422a0c===_0x3be1('0x62')){_0x45f4d6[_0x3be1('0x63')](_0x3be1('0x64'),[]['concat'](_0x4afe64['query'][_0x422a0c]));}else if(_0x422a0c==='createdAt'){var _0x35da53=JSON[_0x3be1('0x65')](_0x4afe64['query'][_0x422a0c])['$gte'];var _0x2efb2f=JSON[_0x3be1('0x65')](_0x4afe64[_0x3be1('0x2a')][_0x422a0c])[_0x3be1('0x66')];_0x45f4d6[_0x3be1('0x63')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x35da53,_0x2efb2f);}else{if(_0x4afe64[_0x3be1('0x2a')][_0x422a0c]===_0x3be1('0x67')){_0x45f4d6['where']('i.'+_0x422a0c+_0x3be1('0x68'));}else{_0x45f4d6['where']('i.'+_0x422a0c+_0x3be1('0x69'),_0x4afe64[_0x3be1('0x2a')][_0x422a0c]);}}});}if(_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x6a')]){if(_0x4afe64[_0x3be1('0x2a')]['read']==0x1){_0x45f4d6['having'](_0x3be1('0x6b'));}else{_0x45f4d6[_0x3be1('0x4f')]('`unreadMessages`\x20>\x200');}}if(_0x4afe64[_0x3be1('0x2a')]['tag']){_0x703e79=_[_0x3be1('0x6c')](_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x6d')])?_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x6d')]:new Array(_0x4afe64['query'][_0x3be1('0x6d')]);_0x703e79['forEach'](function(_0x5f5b1c){_0x30300b['or'](_0x3be1('0x5a'),'%,'+_0x5f5b1c+',%');});}if(_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x6e')]){var _0xa0ee50=_0x4afe64['query']['filter'][_0x3be1('0x6f')]('\x5c','\x5c\x5c')[_0x3be1('0x6f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xa0ee50)){_0x1fedd8['or'](_0x3be1('0x70'),_0xa0ee50+'%');}else if(qs[_0x3be1('0x71')](_0xa0ee50)){_0x1fedd8['or']('c.email\x20LIKE\x20?',_0xa0ee50+'%');}else{_0x1fedd8['or'](_0x3be1('0x72'),qs['getFullTextValue'](_0xa0ee50))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3be1('0x73')](_0xa0ee50));}}}_0x45f4d6[_0x3be1('0x63')](_0x1fedd8);_0x45f4d6[_0x3be1('0x74')]('i.id');var _0x3d7c8b={'type':db[_0x3be1('0x75')]['QueryTypes'][_0x3be1('0x76')],'raw':!![]};var _0x36f89e=_0x45f4d6[_0x3be1('0x77')]();_0x36f89e[_0x3be1('0x36')](_0x3be1('0x78'));_0x36f89e['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3be1('0x4c'));if(_0x2883c6[_0x3be1('0x33')]){_0x2883c6[_0x3be1('0x33')][_0x3be1('0x59')](function(_0x270282){var _0x509bd3=_0x270282[0x0]===_0x3be1('0x79')?_0x270282[0x0]:'i.'+_0x270282[0x0];_0x45f4d6[_0x3be1('0x33')](_0x509bd3,_0x270282[0x1]===_0x3be1('0x7a')?![]:!![]);});}if(!_[_0x3be1('0x61')](_0x703e79)){_0x45f4d6[_0x3be1('0x4f')](_0x30300b);_0x36f89e[_0x3be1('0x63')](_0x3be1('0x7b'),_0x703e79);}BPromise[_0x3be1('0x7c')]()[_0x3be1('0x18')](function(){if(!_0x318683){if(_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x62')])return;_0x36f89e[_0x3be1('0x63')](_0x3be1('0x7d'));_0x45f4d6[_0x3be1('0x63')](_0x3be1('0x7d'));return;}if(_0x4afe64['user']['role']!=='agent')return;return _0x4afe64[_0x3be1('0x7e')][_0x3be1('0x7f')]({'attributes':['id'],'raw':!![]})[_0x3be1('0x18')](function(_0xaa5f4a){if(_[_0x3be1('0x61')](_0xaa5f4a)){_0x36f89e[_0x3be1('0x63')](_0x3be1('0x80'));_0x45f4d6[_0x3be1('0x63')](_0x3be1('0x80'));}else{_0x36f89e[_0x3be1('0x63')](_0x3be1('0x64'),_[_0x3be1('0x25')](_0xaa5f4a,'id'));_0x45f4d6[_0x3be1('0x63')]('i.MailAccountId\x20IN\x20?',_[_0x3be1('0x25')](_0xaa5f4a,'id'));}});})[_0x3be1('0x18')](function(){if(_0x4afe64['user'][_0x3be1('0x81')]===_0x3be1('0x82')&&!_0x318683&&!_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x62')])return[];return db[_0x3be1('0x83')][_0x3be1('0x2a')](_0x36f89e[_0x3be1('0x84')](),_0x3d7c8b);})[_0x3be1('0x18')](function(_0xf277f4){_0x1e0d2e['count']=_0xf277f4[_0x3be1('0x30')];if(_0x1e0d2e[_0x3be1('0x14')]===0x0)return[];return db[_0x3be1('0x83')][_0x3be1('0x2a')](_0x29b661[_0x3be1('0x84')](),_0x3d7c8b)[_0x3be1('0x18')](function(_0x575fd5){_0x30c880=_[_0x3be1('0x85')](_0x575fd5,'id');_0x3d7c8b=_[_0x3be1('0x86')](_0x3d7c8b,{'model':db[_0x3be1('0x26')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4afe64[_0x3be1('0x2a')][_0x3be1('0x2f')]){_0x2883c6['attributes'][_0x3be1('0x59')](function(_0x4f1b8e){_0x45f4d6['field']('i.'+_0x4f1b8e);});}else{_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x87'),_0x3be1('0x4c'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x88'),'Account.key');_0x45f4d6[_0x3be1('0x36')]('a.mandatoryDisposition',_0x3be1('0x89'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x8a'),_0x3be1('0x79'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x78'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x8b'));_0x45f4d6['field'](_0x3be1('0x8c'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x8d'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x8e'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x8f'));_0x45f4d6['field'](_0x3be1('0x90'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x91'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x92'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x93'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x94'));_0x45f4d6['field'](_0x3be1('0x95'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x96'));_0x45f4d6['field']('i.to');_0x45f4d6['field'](_0x3be1('0x97'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x98'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x99'));_0x45f4d6['field'](_0x3be1('0x9a'),_0x3be1('0x9b'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0x9c'),_0x3be1('0x9d'));_0x45f4d6[_0x3be1('0x36')]('c.email','Contact.email');_0x45f4d6['field'](_0x3be1('0x9e'),'Contact.phone');_0x45f4d6[_0x3be1('0x36')]('c.mobile',_0x3be1('0x9f'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0xa0'),'Contact.fax');_0x45f4d6[_0x3be1('0x36')](_0x3be1('0xa1'),_0x3be1('0xa2'));_0x45f4d6[_0x3be1('0x36')](_0x3be1('0xa3'),_0x3be1('0xa4'));_0x45f4d6['field'](_0x3be1('0xa5'),_0x3be1('0x1d'));}if(_0x2883c6[_0x3be1('0x32')])_0x45f4d6[_0x3be1('0x32')](_0x2883c6[_0x3be1('0x32')]);if(_0x2883c6[_0x3be1('0x12')])_0x45f4d6['offset'](_0x2883c6['offset']);return db['sequelize'][_0x3be1('0x2a')](_0x45f4d6[_0x3be1('0x84')](),_0x3d7c8b);})['then'](function(_0x42a417){if(_0x42a417[_0x3be1('0x30')]>0x0)_0x347801[_0x3be1('0x63')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x42a417,'id'));return db[_0x3be1('0x83')][_0x3be1('0x2a')](_0x347801['toString'](),_0x3d7c8b)['then'](function(_0x37cee5){var _0x32fb5c=_[_0x3be1('0xa6')](_0x37cee5,_0x3be1('0xa7'));var _0x277715=[];return db[_0x3be1('0xa8')][_0x3be1('0x20')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x3be1('0x18')](function(_0xd47be0){var _0x92afca=_0xd47be0['enableEmailPreview'];_0x42a417[_0x3be1('0x59')](function(_0x15de25){_0x277715[_0x3be1('0x1f')](updateMailInteraction(_0x15de25,_0x30c880,_0x32fb5c,_0x92afca));});return BPromise[_0x3be1('0xa9')](_0x277715);});});});})[_0x3be1('0x18')](function(_0x5999a0){_0x1e0d2e[_0x3be1('0xaa')]=_0x5999a0;return _0x1e0d2e;})[_0x3be1('0x18')](respondWithFilteredResult(_0xe135d0,_0x2883c6))[_0x3be1('0x24')](handleError(_0xe135d0,null));};exports[_0x3be1('0xab')]=function(_0x335911,_0xfed715){var _0x1350fd={'raw':![],'where':{'id':_0x335911['params']['id']}},_0x1878b4={};_0x1878b4['model']=_[_0x3be1('0x2b')](db[_0x3be1('0x26')][_0x3be1('0xac')]);_0x1878b4['query']=_['keys'](_0x335911[_0x3be1('0x2a')]);_0x1878b4[_0x3be1('0x2c')]=_[_0x3be1('0x2d')](_0x1878b4[_0x3be1('0x28')],_0x1878b4[_0x3be1('0x2a')]);_0x1350fd[_0x3be1('0x2e')]=_[_0x3be1('0x2d')](_0x1878b4['model'],qs[_0x3be1('0x2f')](_0x335911[_0x3be1('0x2a')]['fields']));_0x1350fd[_0x3be1('0x2e')]=_0x1350fd[_0x3be1('0x2e')][_0x3be1('0x30')]?_0x1350fd['attributes']:_0x1878b4['model'];if(_0x335911[_0x3be1('0x2a')][_0x3be1('0xad')]){_0x1350fd[_0x3be1('0xae')]=[{'all':!![]}];}_0x1350fd=_['merge']({},_0x1350fd,_0x335911[_0x3be1('0xaf')]);return db['MailInteraction']['find'](_0x1350fd)[_0x3be1('0x18')](handleEntityNotFound(_0xfed715,null))[_0x3be1('0x18')](respondWithResult(_0xfed715,null))['catch'](handleError(_0xfed715,null));};exports[_0x3be1('0xb0')]=function(_0x524ac8,_0x575201){return db[_0x3be1('0x26')][_0x3be1('0xb0')](_0x524ac8['body'],{})[_0x3be1('0x18')](respondWithResult(_0x575201,0xc9))[_0x3be1('0x24')](handleError(_0x575201,null));};exports['update']=function(_0xe19268,_0x71f3bf){if(_0xe19268[_0x3be1('0xb1')]['id']){delete _0xe19268[_0x3be1('0xb1')]['id'];}return db[_0x3be1('0x26')][_0x3be1('0x4b')]({'where':{'id':_0xe19268[_0x3be1('0xb2')]['id']}})[_0x3be1('0x18')](handleEntityNotFound(_0x71f3bf,null))[_0x3be1('0x18')](saveUpdates(_0xe19268[_0x3be1('0xb1')],null))['then'](respondWithResult(_0x71f3bf,null))[_0x3be1('0x24')](handleError(_0x71f3bf,null));};exports[_0x3be1('0x19')]=function(_0x292005,_0x1faacc){return db[_0x3be1('0x26')]['find']({'where':{'id':_0x292005[_0x3be1('0xb2')]['id']}})[_0x3be1('0x18')](handleEntityNotFound(_0x1faacc,null))['then'](removeEntity(_0x1faacc,null))[_0x3be1('0x24')](handleError(_0x1faacc,null));};exports['describe']=function(_0xa0994e,_0x22d6b2){return db[_0x3be1('0x26')][_0x3be1('0xb3')]()[_0x3be1('0x18')](respondWithResult(_0x22d6b2,null))[_0x3be1('0x24')](handleError(_0x22d6b2,null));};exports['addMessage']=function(_0x14da61,_0x45f55d){return db[_0x3be1('0xb4')][_0x3be1('0x4b')]({'where':{'id':_0x14da61[_0x3be1('0xb2')]['id']}})[_0x3be1('0x18')](handleEntityNotFound(_0x45f55d,null))[_0x3be1('0x18')](function(_0x14c457){if(_0x14c457){return _0x14c457[_0x3be1('0xb5')](_0x14da61['body'][_0x3be1('0xb6')],_[_0x3be1('0xb7')](_0x14da61['body'],['ids','id'])||{});}})[_0x3be1('0x18')](respondWithResult(_0x45f55d,null))[_0x3be1('0x24')](handleError(_0x45f55d,null));};exports['getMessages']=function(_0x1dcf8b,_0x2742a4){var _0x21be9b={'raw':![],'where':{}};var _0xbfddce={};var _0x41cf41={'count':0x0,'rows':[]};return db['MailInteraction'][_0x3be1('0x20')]({'where':{'id':_0x1dcf8b[_0x3be1('0xb2')]['id']}})[_0x3be1('0x18')](handleEntityNotFound(_0x2742a4,null))[_0x3be1('0x18')](function(_0x3d81a5){if(_0x3d81a5){_0xbfddce[_0x3be1('0x28')]=_[_0x3be1('0x2b')](db[_0x3be1('0xb4')][_0x3be1('0xac')]);_0xbfddce[_0x3be1('0x2a')]=_[_0x3be1('0x2b')](_0x1dcf8b[_0x3be1('0x2a')]);_0xbfddce[_0x3be1('0x2c')]=_[_0x3be1('0x2d')](_0xbfddce[_0x3be1('0x28')],_0xbfddce['query']);_0x21be9b[_0x3be1('0x2e')]=_[_0x3be1('0x2d')](_0xbfddce[_0x3be1('0x28')],qs[_0x3be1('0x2f')](_0x1dcf8b[_0x3be1('0x2a')][_0x3be1('0x2f')]));_0x21be9b[_0x3be1('0x2e')]=_0x21be9b[_0x3be1('0x2e')][_0x3be1('0x30')]?_0x21be9b[_0x3be1('0x2e')]:_0xbfddce[_0x3be1('0x28')];if(!_0x1dcf8b['query'][_0x3be1('0xb8')](_0x3be1('0x31'))){_0x21be9b[_0x3be1('0x32')]=qs[_0x3be1('0x32')](_0x1dcf8b['query'][_0x3be1('0x32')]);_0x21be9b[_0x3be1('0x12')]=qs[_0x3be1('0x12')](_0x1dcf8b[_0x3be1('0x2a')][_0x3be1('0x12')]);}_0x21be9b['order']=qs[_0x3be1('0x34')](_0x1dcf8b[_0x3be1('0x2a')]['sort']);_0x21be9b[_0x3be1('0x63')]=qs[_0x3be1('0x2c')](_['pick'](_0x1dcf8b[_0x3be1('0x2a')],_0xbfddce[_0x3be1('0x2c')]));_0x21be9b[_0x3be1('0x63')][_0x3be1('0xa7')]=_0x3d81a5['id'];if(_0x1dcf8b[_0x3be1('0x2a')]['filter']){_0x21be9b[_0x3be1('0x63')]=_[_0x3be1('0x86')](_0x21be9b[_0x3be1('0x63')],{'$or':_[_0x3be1('0x25')](_0x21be9b[_0x3be1('0x2e')],function(_0x4ef614){var _0x1467a1={};_0x1467a1[_0x4ef614]={'$like':'%'+_0x1dcf8b[_0x3be1('0x2a')]['filter']+'%'};return _0x1467a1;})});}if(_0x1dcf8b[_0x3be1('0x2a')][_0x3be1('0xb9')]){var _0x4cca9c=_0x1dcf8b['query'][_0x3be1('0xb9')][_0x3be1('0x1e')](',');var _0x265e7e={};_0x265e7e[_0x4cca9c[0x0]]={'$gte':moment(_0x4cca9c[0x1])[_0x3be1('0xba')]('YYYY-MM-DD\x20HH:mm:ss')};_0x21be9b[_0x3be1('0x63')]=_[_0x3be1('0x86')](_0x21be9b[_0x3be1('0x63')],_0x265e7e);}_0x21be9b=_['merge']({},_0x21be9b,_0x1dcf8b['options']);return db[_0x3be1('0xb4')][_0x3be1('0x14')]({'where':_0x21be9b['where']})['then'](function(_0x2a2330){_0x41cf41[_0x3be1('0x14')]=_0x2a2330;if(_0x1dcf8b['query'][_0x3be1('0xad')]){_0x21be9b[_0x3be1('0xae')]=[{'all':!![]}];}return db[_0x3be1('0xb4')][_0x3be1('0xbb')](_0x21be9b);})[_0x3be1('0x18')](function(_0x54bd43){if(_0x1dcf8b[_0x3be1('0x2a')]['inlineCss']===_0x3be1('0xbc')){for(var _0x30efb2=0x0;_0x30efb2<_0x54bd43['length'];_0x30efb2++){_0x54bd43[_0x30efb2][_0x3be1('0xb1')]=juice(_0x54bd43[_0x30efb2][_0x3be1('0xb1')]);}}_0x41cf41[_0x3be1('0xaa')]=_0x54bd43;return _0x41cf41;});}})['then'](respondWithFilteredResult(_0x2742a4,_0x21be9b))['catch'](handleError(_0x2742a4,null));};exports[_0x3be1('0xbd')]=function(_0x291771,_0x5139e5){return db['MailInteraction'][_0x3be1('0x4b')]({'where':{'id':_0x291771[_0x3be1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5139e5,null))[_0x3be1('0x18')](function(_0x5ebc7d){if(_0x5ebc7d){return _0x5ebc7d[_0x3be1('0xbe')](_0x291771[_0x3be1('0xb1')][_0x3be1('0xb6')],_[_0x3be1('0xb7')](_0x291771['body'],[_0x3be1('0xb6'),'id'])||{})[_0x3be1('0xbf')](function(){return db[_0x3be1('0x58')][_0x3be1('0xbb')]({'attributes':['id',_0x3be1('0x29'),'color'],'where':{'id':_0x291771['body'][_0x3be1('0xb6')]}});})[_0x3be1('0x18')](function(_0x57c89f){socket['emit'](_0x3be1('0xc0'),{'id':Number(_0x291771[_0x3be1('0xb2')]['id']),'tags':_0x57c89f||[]});return{'id':Number(_0x291771[_0x3be1('0xb2')]['id']),'tags':_0x57c89f||[]};});}})[_0x3be1('0x18')](respondWithResult(_0x5139e5,null))['catch'](handleError(_0x5139e5,null));};exports[_0x3be1('0xc1')]=function(_0x31d49e,_0x3608b3){return db[_0x3be1('0x26')]['find']({'where':{'id':_0x31d49e['params']['id']}})[_0x3be1('0x18')](handleEntityNotFound(_0x3608b3,null))[_0x3be1('0x18')](function(_0x4ade96){if(_0x4ade96){return _0x4ade96[_0x3be1('0xc1')](_0x31d49e[_0x3be1('0x2a')][_0x3be1('0xb6')]);}})[_0x3be1('0x18')](respondWithStatusCode(_0x3608b3,null))['catch'](handleError(_0x3608b3,null));};exports['download']=function(_0xaaf4e4,_0x1cacd2){var _0x1aeb09=moment()[_0x3be1('0xc2')]()[_0x3be1('0x84')]();var _0x4075fe=path[_0x3be1('0xc3')](config[_0x3be1('0xc4')],_0x3be1('0xc5'),'files',_0x3be1('0xc6'));var _0x246c65=path[_0x3be1('0xc3')](config[_0x3be1('0xc4')],_0x3be1('0xc5'),'files',_0x3be1('0xc7'));var _0x302f9b=path[_0x3be1('0xc3')](_0x4075fe,_0x1aeb09);var _0x34bd46=util[_0x3be1('0xba')](_0x3be1('0xc8'),_0xaaf4e4[_0x3be1('0xb2')]['id'],_0x1aeb09);var _0x36ccec=path[_0x3be1('0xc3')](_0x4075fe,_0x34bd46);var _0x266c00=[];if(_0xaaf4e4[_0x3be1('0x2a')]['attachments']){_0x266c00[_0x3be1('0x1f')]({'model':db['Attachment'],'as':_0x3be1('0xc9'),'raw':!![]});}var _0x41a68e=[{'model':db[_0x3be1('0xb4')],'as':_0x3be1('0xca'),'attributes':['id',_0x3be1('0xb1'),_0x3be1('0x37'),'to','cc',_0x3be1('0xcb'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x3be1('0x34')]('id'),'include':_0x266c00}];return db[_0x3be1('0x26')][_0x3be1('0x4b')]({'where':{'id':_0xaaf4e4[_0x3be1('0xb2')]['id']},'include':_0x41a68e})[_0x3be1('0x18')](handleEntityNotFound(_0x1cacd2,null))[_0x3be1('0x18')](function(_0x4a17bd){if(_0x4a17bd&&_0x4a17bd[_0x3be1('0xca')]){var _0xcf68cf=_0x4a17bd[_0x3be1('0xcc')]({'plain':!![]});fs[_0x3be1('0xcd')](_0x302f9b);return BPromise[_0x3be1('0xce')](_0xcf68cf[_0x3be1('0xca')],function(_0x571240,_0x3e4cb4){var _0x5a94a7={'from':_0x571240[_0x3be1('0x37')],'to':_0x571240['to'],'subject':_0x571240['subject'],'html':htmlEntities['decode'](_0x571240[_0x3be1('0xb1')]),'headers':{'Date':moment(_0x571240[_0x3be1('0xcf')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x571240['cc']){_0x5a94a7['headers']['Cc']=_0x571240['cc'];}if(_0x571240[_0x3be1('0xcb')]){_0x5a94a7[_0x3be1('0xd0')]['Bcc']=_0x571240[_0x3be1('0xcb')];}return new BPromise(function(_0x4c00f1,_0x4ce12b){if(_0x571240[_0x3be1('0xc9')]){for(var _0x2e2fb1=0x0;_0x2e2fb1<_0x571240[_0x3be1('0xc9')][_0x3be1('0x30')];_0x2e2fb1++){var _0x324828=_0x571240['Attachments'][_0x2e2fb1];var _0xbfa884=path[_0x3be1('0xc3')](_0x246c65,_0x324828[_0x3be1('0xd1')]);if(fs['existsSync'](_0xbfa884)){_0x5a94a7[_0x3be1('0xc7')]['push']({'name':_0x324828[_0x3be1('0x29')],'contentType':_0x324828['type'],'data':fs[_0x3be1('0xd2')](_0xbfa884)});}}}emlformat[_0x3be1('0xd3')](_0x5a94a7,function(_0x448ab6,_0xcc84f5){if(_0x448ab6)return _0x4ce12b(_0x448ab6);fs[_0x3be1('0xd4')](path[_0x3be1('0xc3')](_0x302f9b,util[_0x3be1('0xba')](_0x3be1('0xd5'),_0x3e4cb4)),_0xcc84f5);return _0x4c00f1(_0xcc84f5);});});})[_0x3be1('0x18')](function(){return new BPromise(function(_0x503e79,_0x474d85){zipdir(_0x302f9b,{'saveTo':_0x36ccec},function(_0x31bedf,_0x298342){if(_0x31bedf)return _0x474d85(_0x31bedf);return _0x503e79(_0x298342);});})[_0x3be1('0x18')](function(){return new BPromise(function(_0x5173e2,_0x361f6e){rimraf(_0x302f9b,function(_0x55cebb){if(_0x55cebb)_0x361f6e(_0x55cebb);return _0x5173e2();});});})[_0x3be1('0x18')](function(){return _0x1cacd2[_0x3be1('0xd6')](_0x36ccec,_0x34bd46,function(_0x3aaf0d){if(!_0x3aaf0d)fs[_0x3be1('0xd7')](_0x36ccec);});});});}else{return _0x1cacd2['sendStatus'](0xc8);}})[_0x3be1('0x24')](handleError(_0x1cacd2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c5733ee..ee2dd2d 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 _0xf808=['map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','getUsers','then','setDataValue','Users'];(function(_0x30be03,_0x2705d2){var _0x4e6a6c=function(_0x3fbf5b){while(--_0x3fbf5b){_0x30be03['push'](_0x30be03['shift']());}};_0x4e6a6c(++_0x2705d2);}(_0xf808,0x106));var _0x8f80=function(_0x54d5dc,_0x539815){_0x54d5dc=_0x54d5dc-0x0;var _0x424432=_0xf808[_0x54d5dc];return _0x424432;};'use strict';var EventEmitter=require(_0x8f80('0x0'));var MailInteraction=require(_0x8f80('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8f80('0x2')](0x0);var events={'afterCreate':_0x8f80('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xada5e1){return function(_0x4fec73,_0x32c7e6,_0x4bb68f){_0x4fec73[_0x8f80('0x4')]({'attributes':['id'],'raw':!![]})[_0x8f80('0x5')](function(_0x301ea3){_0x4fec73[_0x8f80('0x6')](_0x8f80('0x7'),_0x301ea3[_0x8f80('0x8')](function(_0x27007d){return{'id':_0x27007d['id']};}));return MailMessage[_0x8f80('0x9')]({'where':{'MailInteractionId':_0x4fec73['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8f80('0x5')](function(_0x14009a){_0x4fec73['setDataValue'](_0x8f80('0xa'),_0x14009a[_0x8f80('0xb')]);MailInteractionEvents[_0x8f80('0xc')](_0xada5e1+':'+_0x4fec73['id'],_0x4fec73);MailInteractionEvents[_0x8f80('0xc')](_0xada5e1,_0x4fec73);_0x4bb68f(null);})['catch'](_0x4bb68f(null));};}for(var e in events){if(events[_0x8f80('0xd')](e)){var event=events[e];MailInteraction[_0x8f80('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x21fd=['exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook'];(function(_0x54a32c,_0x5186ff){var _0x5ae4fe=function(_0x1fe166){while(--_0x1fe166){_0x54a32c['push'](_0x54a32c['shift']());}};_0x5ae4fe(++_0x5186ff);}(_0x21fd,0x1d5));var _0xd21f=function(_0x349f63,_0x4abe79){_0x349f63=_0x349f63-0x0;var _0x1b67ec=_0x21fd[_0x349f63];return _0x1b67ec;};'use strict';var EventEmitter=require(_0xd21f('0x0'));var MailInteraction=require(_0xd21f('0x1'))['db'][_0xd21f('0x2')];var MailMessage=require(_0xd21f('0x1'))['db'][_0xd21f('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd21f('0x4')](0x0);var events={'afterCreate':_0xd21f('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f8ba7){return function(_0x476205,_0x4c7287,_0x515dd6){_0x476205[_0xd21f('0x6')]({'attributes':['id'],'raw':!![]})[_0xd21f('0x7')](function(_0x5151d3){_0x476205['setDataValue'](_0xd21f('0x8'),_0x5151d3[_0xd21f('0x9')](function(_0x19762b){return{'id':_0x19762b['id']};}));return MailMessage[_0xd21f('0xa')]({'where':{'MailInteractionId':_0x476205['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd21f('0x7')](function(_0x5512e0){_0x476205[_0xd21f('0xb')]('unreadMessages',_0x5512e0[_0xd21f('0xc')]);MailInteractionEvents[_0xd21f('0xd')](_0x2f8ba7+':'+_0x476205['id'],_0x476205);MailInteractionEvents['emit'](_0x2f8ba7,_0x476205);_0x515dd6(null);})[_0xd21f('0xe')](_0x515dd6(null));};}for(var e in events){if(events[_0xd21f('0xf')](e)){var event=events[e];MailInteraction[_0xd21f('0x10')](e,emitEvent(event));}}module[_0xd21f('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 26439da..28e3b72 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 _0xd421=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','closed','MailMessage','update','then','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x46aebd,_0x488973){var _0x549577=function(_0x1dbcda){while(--_0x1dbcda){_0x46aebd['push'](_0x46aebd['shift']());}};_0x549577(++_0x488973);}(_0xd421,0xa5));var _0x1d42=function(_0x278262,_0x4d03a3){_0x278262=_0x278262-0x0;var _0x5025fa=_0xd421[_0x278262];return _0x5025fa;};'use strict';var _=require(_0x1d42('0x0'));var util=require(_0x1d42('0x1'));var logger=require(_0x1d42('0x2'))('api');var moment=require(_0x1d42('0x3'));var BPromise=require(_0x1d42('0x4'));var rp=require(_0x1d42('0x5'));var fs=require('fs');var path=require(_0x1d42('0x6'));var rimraf=require(_0x1d42('0x7'));var config=require(_0x1d42('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x1d42('0x9')]=function(_0x4439c7,_0x370036){return _0x4439c7[_0x1d42('0xa')](_0x1d42('0xb'),attributes,{'tableName':_0x1d42('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1d42('0xd'),'to'],'type':_0x1d42('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52aa2f,_0x5c5fb4,_0x55c715){if(_0x52aa2f[_0x1d42('0xf')]){_0x52aa2f[_0x1d42('0x10')]=moment()[_0x1d42('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x52aa2f['closed']){_0x52aa2f[_0x1d42('0x12')]=moment()[_0x1d42('0x11')](_0x1d42('0x13'));}_0x55c715(null,_0x5c5fb4);},'beforeUpdate':function(_0x39c314,_0x218871,_0x4eb401){if(_0x39c314['changed'](_0x1d42('0xf'))){_0x39c314['substatusAt']=_0x39c314[_0x1d42('0xf')]?moment()[_0x1d42('0x11')](_0x1d42('0x13')):null;}if(_0x39c314[_0x1d42('0x14')]('closed')){_0x39c314[_0x1d42('0x12')]=moment()[_0x1d42('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x39c314['substatus']=null;_0x39c314['substatusAt']=null;}_0x4eb401(null,_0x39c314);},'afterUpdate':function(_0x7f20f5,_0x4e2503,_0xbec3b0){var _0x3b2e7a=_0x4439c7[_0x1d42('0x15')];var _0x3e5d6a=_0x7f20f5[_0x1d42('0x16')]({'plain':!![]});if(_0x3e5d6a[_0x1d42('0x17')]){return _0x3b2e7a[_0x1d42('0x18')][_0x1d42('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x3e5d6a['id']}})[_0x1d42('0x1a')](function(){_0xbec3b0();})['catch'](function(_0x31f006){_0xbec3b0(_0x31f006);});}else{_0xbec3b0();}}},'charset':'utf8mb4','collate':_0x1d42('0x1b')});}; \ No newline at end of file +var _0x71d8=['path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','closedAt','MailMessage','update','then','catch','utf8mb4','lodash','../../config/logger','moment','bluebird'];(function(_0x9ebaa2,_0x58815f){var _0x5e2be6=function(_0x32bfbb){while(--_0x32bfbb){_0x9ebaa2['push'](_0x9ebaa2['shift']());}};_0x5e2be6(++_0x58815f);}(_0x71d8,0xbc));var _0x871d=function(_0xb79850,_0x14be56){_0xb79850=_0xb79850-0x0;var _0x5a1b2d=_0x71d8[_0xb79850];return _0x5a1b2d;};'use strict';var _=require(_0x871d('0x0'));var util=require('util');var logger=require(_0x871d('0x1'))('api');var moment=require(_0x871d('0x2'));var BPromise=require(_0x871d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x871d('0x4'));var rimraf=require('rimraf');var config=require(_0x871d('0x5'));var attributes=require(_0x871d('0x6'));module[_0x871d('0x7')]=function(_0x4965fd,_0x5d1f63){return _0x4965fd['define'](_0x871d('0x8'),attributes,{'tableName':_0x871d('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x871d('0xa'),'to'],'type':_0x871d('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3360a3,_0x19c03c,_0x1dc850){if(_0x3360a3['substatus']){_0x3360a3[_0x871d('0xc')]=moment()[_0x871d('0xd')](_0x871d('0xe'));}if(_0x3360a3[_0x871d('0xf')]){_0x3360a3['closedAt']=moment()[_0x871d('0xd')](_0x871d('0xe'));}_0x1dc850(null,_0x19c03c);},'beforeUpdate':function(_0x1ec65a,_0x335ff5,_0x7bb4a4){if(_0x1ec65a[_0x871d('0x10')](_0x871d('0x11'))){_0x1ec65a[_0x871d('0xc')]=_0x1ec65a[_0x871d('0x11')]?moment()[_0x871d('0xd')](_0x871d('0xe')):null;}if(_0x1ec65a[_0x871d('0x10')](_0x871d('0xf'))){_0x1ec65a[_0x871d('0x12')]=moment()[_0x871d('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ec65a[_0x871d('0x11')]=null;_0x1ec65a[_0x871d('0xc')]=null;}_0x7bb4a4(null,_0x1ec65a);},'afterUpdate':function(_0x47b4f5,_0x30a7f3,_0xa07e6){var _0x397309=_0x4965fd['models'];var _0x87eed8=_0x47b4f5['get']({'plain':!![]});if(_0x87eed8['closed']){return _0x397309[_0x871d('0x13')][_0x871d('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x87eed8['id']}})[_0x871d('0x15')](function(){_0xa07e6();})[_0x871d('0x16')](function(_0x25187d){_0xa07e6(_0x25187d);});}else{_0xa07e6();}}},'charset':_0x871d('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8d1e70f..220fc99 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 _0xa751=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','limit','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x337705,_0x5c1f24){var _0x3f9785=function(_0x2da585){while(--_0x2da585){_0x337705['push'](_0x337705['shift']());}};_0x3f9785(++_0x5c1f24);}(_0xa751,0x175));var _0x1a75=function(_0x426248,_0x345f0d){_0x426248=_0x426248-0x0;var _0x15b77a=_0xa751[_0x426248];return _0x15b77a;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});config[_0x1a75('0xb')]=_[_0x1a75('0xc')](config[_0x1a75('0xb')],{'host':_0x1a75('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x1a75('0xe')](socket);function respondWithRpcPromise(_0x377b3b,_0x1d7819,_0x271286){return new BPromise(function(_0x15b4cc,_0xd150fc){return client[_0x1a75('0xf')](_0x377b3b,_0x271286)[_0x1a75('0x10')](function(_0x5b615f){logger['info']('MailInteraction,\x20%s,\x20%s',_0x1d7819,_0x1a75('0x11'));logger[_0x1a75('0x12')](_0x1a75('0x13'),_0x1d7819,_0x1a75('0x11'),JSON['stringify'](_0x5b615f));if(_0x5b615f['error']){if(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x15')]===0x1f4){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x5b615f[_0x1a75('0x14')]['message']);return _0xd150fc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}logger[_0x1a75('0x14')]('MailInteraction,\x20%s,\x20%s',_0x1d7819,_0x5b615f['error']['message']);return _0x15b4cc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}else{logger[_0x1a75('0x18')](_0x1a75('0x16'),_0x1d7819,_0x1a75('0x11'));_0x15b4cc(_0x5b615f[_0x1a75('0x19')]['message']);}})[_0x1a75('0x1a')](function(_0x490e1f){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x490e1f);_0xd150fc(_0x490e1f);});});}exports[_0x1a75('0x1b')]=function(_0x5ae0f4){var _0x42d283=this;return new Promise(function(_0x4d877c,_0x4699c9){return db[_0x1a75('0x1c')][_0x1a75('0x1d')](_0x5ae0f4[_0x1a75('0x1e')],{'raw':_0x5ae0f4[_0x1a75('0x1f')]?_0x5ae0f4[_0x1a75('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ae0f4[_0x1a75('0x1f')]?_0x5ae0f4['options'][_0x1a75('0x20')]||null:null,'attributes':_0x5ae0f4[_0x1a75('0x1f')]?_0x5ae0f4[_0x1a75('0x1f')]['attributes']||null:null,'limit':_0x5ae0f4[_0x1a75('0x1f')]?_0x5ae0f4['options'][_0x1a75('0x21')]||null:null})[_0x1a75('0x10')](function(_0x3dd52d){logger['info'](_0x1a75('0x1b'),_0x5ae0f4);logger[_0x1a75('0x12')]('UpdateMailInteraction',_0x5ae0f4,JSON[_0x1a75('0x22')](_0x3dd52d));_0x4d877c(_0x3dd52d);})[_0x1a75('0x1a')](function(_0x5a6acc){logger[_0x1a75('0x14')](_0x1a75('0x1b'),_0x5a6acc[_0x1a75('0x17')],_0x5ae0f4);_0x4699c9(_0x42d283[_0x1a75('0x14')](0x1f4,_0x5a6acc['message']));});});};exports[_0x1a75('0x23')]=function(_0x2744ab){return new Promise(function(_0x19dc59,_0x2f5ac9){return db[_0x1a75('0x1c')][_0x1a75('0x24')]({'where':_0x2744ab[_0x1a75('0x1f')]?_0x2744ab[_0x1a75('0x1f')]['where']||null:null})['then'](function(_0x6f60ba){if(_0x6f60ba){return _0x6f60ba[_0x1a75('0x25')](_0x2744ab[_0x1a75('0x1e')][_0x1a75('0x26')],_[_0x1a75('0x27')](_0x2744ab[_0x1a75('0x1e')],[_0x1a75('0x26'),'id'])||{});}})[_0x1a75('0x28')](function(_0x531c2e){logger['info']('AddTags',_0x2744ab);logger[_0x1a75('0x12')](_0x1a75('0x29'),_0x2744ab,JSON[_0x1a75('0x22')](_0x531c2e));_0x19dc59(_0x531c2e);})[_0x1a75('0x1a')](function(_0x534fab){logger['error']('AddTags',_0x534fab[_0x1a75('0x17')],_0x2744ab);_0x2f5ac9(_this[_0x1a75('0x14')](0x1f4,_0x534fab['message']));});});}; \ No newline at end of file +var _0xcdcb=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailInteraction','MailInteraction','options','raw','where','attributes','limit','then','AddTagsToMailInteraction','find','addTags','body','ids','spread','AddTags','debug'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xcdcb,0x75));var _0xbcdc=function(_0x31a113,_0x280f77){_0x31a113=_0x31a113-0x0;var _0x8dab29=_0xcdcb[_0x31a113];return _0x8dab29;};'use strict';var _=require('lodash');var util=require(_0xbcdc('0x0'));var moment=require(_0xbcdc('0x1'));var BPromise=require(_0xbcdc('0x2'));var rs=require(_0xbcdc('0x3'));var fs=require('fs');var Redis=require(_0xbcdc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcdc('0x5'));var logger=require(_0xbcdc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcdc('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xbcdc('0x8')]=_[_0xbcdc('0x9')](config['redis'],{'host':_0xbcdc('0xa'),'port':0x18eb});var socket=require(_0xbcdc('0xb'))(new Redis(config[_0xbcdc('0x8')]));require(_0xbcdc('0xc'))[_0xbcdc('0xd')](socket);function respondWithRpcPromise(_0x324cff,_0xcc3469,_0x28c333){return new BPromise(function(_0x474df0,_0x500261){return client[_0xbcdc('0xe')](_0x324cff,_0x28c333)['then'](function(_0x2a86a8){logger[_0xbcdc('0xf')](_0xbcdc('0x10'),_0xcc3469,_0xbcdc('0x11'));logger['debug'](_0xbcdc('0x12'),_0xcc3469,_0xbcdc('0x11'),JSON[_0xbcdc('0x13')](_0x2a86a8));if(_0x2a86a8[_0xbcdc('0x14')]){if(_0x2a86a8[_0xbcdc('0x14')][_0xbcdc('0x15')]===0x1f4){logger[_0xbcdc('0x14')]('MailInteraction,\x20%s,\x20%s',_0xcc3469,_0x2a86a8[_0xbcdc('0x14')]['message']);return _0x500261(_0x2a86a8['error']['message']);}logger[_0xbcdc('0x14')](_0xbcdc('0x10'),_0xcc3469,_0x2a86a8['error']['message']);return _0x474df0(_0x2a86a8[_0xbcdc('0x14')][_0xbcdc('0x16')]);}else{logger[_0xbcdc('0xf')](_0xbcdc('0x10'),_0xcc3469,_0xbcdc('0x11'));_0x474df0(_0x2a86a8['result'][_0xbcdc('0x16')]);}})['catch'](function(_0x1779a5){logger[_0xbcdc('0x14')]('MailInteraction,\x20%s,\x20%s',_0xcc3469,_0x1779a5);_0x500261(_0x1779a5);});});}exports[_0xbcdc('0x17')]=function(_0x58887b){var _0x26c219=this;return new Promise(function(_0x74cba8,_0x461a81){return db[_0xbcdc('0x18')]['update'](_0x58887b['body'],{'raw':_0x58887b[_0xbcdc('0x19')]?_0x58887b[_0xbcdc('0x19')][_0xbcdc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58887b['options']?_0x58887b[_0xbcdc('0x19')][_0xbcdc('0x1b')]||null:null,'attributes':_0x58887b[_0xbcdc('0x19')]?_0x58887b[_0xbcdc('0x19')][_0xbcdc('0x1c')]||null:null,'limit':_0x58887b[_0xbcdc('0x19')]?_0x58887b[_0xbcdc('0x19')][_0xbcdc('0x1d')]||null:null})[_0xbcdc('0x1e')](function(_0x53b2da){logger[_0xbcdc('0xf')]('UpdateMailInteraction',_0x58887b);logger['debug'](_0xbcdc('0x17'),_0x58887b,JSON[_0xbcdc('0x13')](_0x53b2da));_0x74cba8(_0x53b2da);})['catch'](function(_0xabf396){logger[_0xbcdc('0x14')](_0xbcdc('0x17'),_0xabf396['message'],_0x58887b);_0x461a81(_0x26c219[_0xbcdc('0x14')](0x1f4,_0xabf396[_0xbcdc('0x16')]));});});};exports[_0xbcdc('0x1f')]=function(_0x599cf0){return new Promise(function(_0x3017a4,_0x179b1c){return db[_0xbcdc('0x18')][_0xbcdc('0x20')]({'where':_0x599cf0[_0xbcdc('0x19')]?_0x599cf0[_0xbcdc('0x19')][_0xbcdc('0x1b')]||null:null})[_0xbcdc('0x1e')](function(_0x245834){if(_0x245834){return _0x245834[_0xbcdc('0x21')](_0x599cf0[_0xbcdc('0x22')][_0xbcdc('0x23')],_['omit'](_0x599cf0[_0xbcdc('0x22')],[_0xbcdc('0x23'),'id'])||{});}})[_0xbcdc('0x24')](function(_0x1cca11){logger[_0xbcdc('0xf')](_0xbcdc('0x25'),_0x599cf0);logger[_0xbcdc('0x26')](_0xbcdc('0x25'),_0x599cf0,JSON[_0xbcdc('0x13')](_0x1cca11));_0x3017a4(_0x1cca11);})['catch'](function(_0x23bfca){logger[_0xbcdc('0x14')](_0xbcdc('0x25'),_0x23bfca['message'],_0x599cf0);_0x179b1c(_this[_0xbcdc('0x14')](0x1f4,_0x23bfca[_0xbcdc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 3e13a9b..cdad4ed 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 _0x6607=['save','remove','register','length','mailInteraction:'];(function(_0x4aa5a4,_0x580903){var _0x584cf1=function(_0x1b37d0){while(--_0x1b37d0){_0x4aa5a4['push'](_0x4aa5a4['shift']());}};_0x584cf1(++_0x580903);}(_0x6607,0x104));var _0x7660=function(_0x49b9fc,_0x38e991){_0x49b9fc=_0x49b9fc-0x0;var _0x14e99e=_0x6607[_0x49b9fc];return _0x14e99e;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x7660('0x0'),_0x7660('0x1'),'update'];function createListener(_0x2a82e7,_0x3dafc9){return function(_0xfbe374){_0x3dafc9['emit'](_0x2a82e7,_0xfbe374);};}function removeListener(_0x2c103e,_0x123bd0){return function(){MailInteractionEvents['removeListener'](_0x2c103e,_0x123bd0);};}exports[_0x7660('0x2')]=function(_0xbffdd4){for(var _0x58f577=0x0,_0x5604d2=events[_0x7660('0x3')];_0x58f577<_0x5604d2;_0x58f577++){var _0x3c75f2=events[_0x58f577];var _0x495425=createListener(_0x7660('0x4')+_0x3c75f2,_0xbffdd4);MailInteractionEvents['on'](_0x3c75f2,_0x495425);}}; \ No newline at end of file +var _0x3844=['save','remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x28e824,_0x5707bf){var _0x3de571=function(_0x1152c4){while(--_0x1152c4){_0x28e824['push'](_0x28e824['shift']());}};_0x3de571(++_0x5707bf);}(_0x3844,0x74));var _0x4384=function(_0x3a0688,_0x2122ba){_0x3a0688=_0x3a0688-0x0;var _0x324a11=_0x3844[_0x3a0688];return _0x324a11;};'use strict';var MailInteractionEvents=require(_0x4384('0x0'));var events=[_0x4384('0x1'),_0x4384('0x2'),_0x4384('0x3')];function createListener(_0x3f6dd5,_0x35a08d){return function(_0x323848){_0x35a08d[_0x4384('0x4')](_0x3f6dd5,_0x323848);};}function removeListener(_0x5bcc56,_0x50177d){return function(){MailInteractionEvents[_0x4384('0x5')](_0x5bcc56,_0x50177d);};}exports[_0x4384('0x6')]=function(_0x46cae6){for(var _0x5e3d3b=0x0,_0xec394=events[_0x4384('0x7')];_0x5e3d3b<_0xec394;_0x5e3d3b++){var _0x55fbd0=events[_0x5e3d3b];var _0x58a9f7=createListener(_0x4384('0x8')+_0x55fbd0,_0x46cae6);MailInteractionEvents['on'](_0x55fbd0,_0x58a9f7);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f8024f8..837b742 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 _0x0269=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','download','post','tracked','mailmessage:create','create','put','/:id','update','/:id/reject','reject','delete','destroy','multer','path','express'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0x0269,0x135));var _0x9026=function(_0x2c8504,_0x37986d){_0x2c8504=_0x2c8504-0x0;var _0x40a935=_0x0269[_0x2c8504];return _0x40a935;};'use strict';var multer=require(_0x9026('0x0'));var util=require('util');var path=require(_0x9026('0x1'));var timeout=require('connect-timeout');var express=require(_0x9026('0x2'));var router=express['Router']();var fs_extra=require(_0x9026('0x3'));var auth=require(_0x9026('0x4'));var interaction=require(_0x9026('0x5'));var config=require(_0x9026('0x6'));var controller=require('./mailMessage.controller');router[_0x9026('0x7')]('/',auth[_0x9026('0x8')](),controller['index']);router['get'](_0x9026('0x9'),auth[_0x9026('0x8')](),controller[_0x9026('0xa')]);router[_0x9026('0x7')]('/:id',auth[_0x9026('0x8')](),controller[_0x9026('0xb')]);router[_0x9026('0x7')]('/:id/download',auth[_0x9026('0x8')](),controller[_0x9026('0xc')]);router[_0x9026('0xd')]('/',auth['isAuthenticated'](),interaction[_0x9026('0xe')]('mail',_0x9026('0xf')),controller[_0x9026('0x10')]);router[_0x9026('0x11')](_0x9026('0x12'),auth[_0x9026('0x8')](),controller[_0x9026('0x13')]);router[_0x9026('0x11')]('/:id/accept',auth[_0x9026('0x8')](),controller['accept']);router[_0x9026('0x11')](_0x9026('0x14'),auth[_0x9026('0x8')](),controller[_0x9026('0x15')]);router[_0x9026('0x16')](_0x9026('0x12'),auth[_0x9026('0x8')](),controller[_0x9026('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf675=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','put','/:id/accept','accept','/:id/reject','destroy','exports','multer','util'];(function(_0x311019,_0x32553c){var _0x44fddf=function(_0x43ca27){while(--_0x43ca27){_0x311019['push'](_0x311019['shift']());}};_0x44fddf(++_0x32553c);}(_0xf675,0x15d));var _0x5f67=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xf675[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var path=require(_0x5f67('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f67('0x3'));var router=express[_0x5f67('0x4')]();var fs_extra=require(_0x5f67('0x5'));var auth=require(_0x5f67('0x6'));var interaction=require(_0x5f67('0x7'));var config=require(_0x5f67('0x8'));var controller=require(_0x5f67('0x9'));router['get']('/',auth[_0x5f67('0xa')](),controller[_0x5f67('0xb')]);router[_0x5f67('0xc')](_0x5f67('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x5f67('0xc')](_0x5f67('0xe'),auth[_0x5f67('0xa')](),controller[_0x5f67('0xf')]);router['get'](_0x5f67('0x10'),auth[_0x5f67('0xa')](),controller['download']);router[_0x5f67('0x11')]('/',auth[_0x5f67('0xa')](),interaction[_0x5f67('0x12')](_0x5f67('0x13'),_0x5f67('0x14')),controller['create']);router[_0x5f67('0x15')](_0x5f67('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5f67('0x15')](_0x5f67('0x16'),auth['isAuthenticated'](),controller[_0x5f67('0x17')]);router[_0x5f67('0x15')](_0x5f67('0x18'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x5f67('0xe'),auth[_0x5f67('0xa')](),controller[_0x5f67('0x19')]);module[_0x5f67('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 89457fd..855e18c 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 _0x3a60=['TEXT','medium','out','STRING','long','DATE','INTEGER','BOOLEAN','ENUM','Email','Chat','lodash','exports'];(function(_0x27f4d7,_0x1fe213){var _0x127ab2=function(_0x3f3496){while(--_0x3f3496){_0x27f4d7['push'](_0x27f4d7['shift']());}};_0x127ab2(++_0x1fe213);}(_0x3a60,0x1b8));var _0x03a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a60[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0x03a6('0x0'));module[_0x03a6('0x1')]={'body':{'type':Sequelize[_0x03a6('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x03a6('0x2')](_0x03a6('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x03a6('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x03a6('0x5')](0x1fe)},'from':{'type':Sequelize[_0x03a6('0x5')]},'to':{'type':Sequelize['TEXT'](_0x03a6('0x6'))},'cc':{'type':Sequelize[_0x03a6('0x2')](_0x03a6('0x6'))},'bcc':{'type':Sequelize[_0x03a6('0x2')](_0x03a6('0x6'))},'subject':{'type':Sequelize[_0x03a6('0x2')]},'sentAt':{'type':Sequelize[_0x03a6('0x7')]},'attach':{'type':Sequelize[_0x03a6('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x03a6('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x03a6('0x7')]},'originTo':{'type':Sequelize[_0x03a6('0x2')](_0x03a6('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x03a6('0x6'))},'originChannel':{'type':Sequelize[_0x03a6('0xa')](_0x03a6('0xb'),_0x03a6('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x012b=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','exports','long'];(function(_0x25b779,_0x3a1ff4){var _0x29c606=function(_0x572600){while(--_0x572600){_0x25b779['push'](_0x25b779['shift']());}};_0x29c606(++_0x3a1ff4);}(_0x012b,0x11c));var _0xb012=function(_0x4ab540,_0x1ba92){_0x4ab540=_0x4ab540-0x0;var _0x51ad5a=_0x012b[_0x4ab540];return _0x51ad5a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xb012('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb012('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb012('0x2')](_0xb012('0x3'))},'read':{'type':Sequelize[_0xb012('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb012('0x5')]('in',_0xb012('0x6')),'defaultValue':_0xb012('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb012('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xb012('0x2')]('long')},'cc':{'type':Sequelize[_0xb012('0x2')](_0xb012('0x1'))},'bcc':{'type':Sequelize[_0xb012('0x2')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb012('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb012('0x8')]},'originTo':{'type':Sequelize[_0xb012('0x2')]('long')},'originCc':{'type':Sequelize[_0xb012('0x2')](_0xb012('0x1'))},'originChannel':{'type':Sequelize[_0xb012('0x5')](_0xb012('0x9'),_0xb012('0xa')),'defaultValue':_0xb012('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8daf156..0d4d9d5 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 _0x1944=['keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','body','params','destroy','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','format','UserId','agent','get','MailInteraction','find','MailInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','ContactId','User','rejectmessage','download','toString','server','files','tmp','message-%s.eml','createdAt','Attachment','Attachments','from','subject','bcc','headers','basename','push','type','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','../../config/logger','api','mail-interactions','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','limit','undefined','count','Content-Range','update','end','stack','name','send','MailMessage','rawAttributes','fieldName','key','map','query'];(function(_0x399131,_0x2db855){var _0xce76e2=function(_0x175a64){while(--_0x175a64){_0x399131['push'](_0x399131['shift']());}};_0xce76e2(++_0x2db855);}(_0x1944,0x1bc));var _0x4194=function(_0x8d1858,_0x23dff6){_0x8d1858=_0x8d1858-0x0;var _0x45e135=_0x1944[_0x8d1858];return _0x45e135;};'use strict';var emlformat=require(_0x4194('0x0'));var moment=require(_0x4194('0x1'));var BPromise=require(_0x4194('0x2'));var util=require(_0x4194('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x4194('0x4'));var Redis=require(_0x4194('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x4194('0x6'))(_0x4194('0x7'));var interaction_log=require(_0x4194('0x6'))(_0x4194('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4194('0x9')]=_['defaults'](config['redis'],{'host':_0x4194('0xa'),'port':0x18eb});var socket=require(_0x4194('0xb'))(new Redis(config[_0x4194('0x9')]));var htmlEntities=require(_0x4194('0xc'));require(_0x4194('0xd'))[_0x4194('0xe')](socket);var jayson=require(_0x4194('0xf'));var client=jayson[_0x4194('0x10')]['http']({'port':0x232c});var client9003=jayson[_0x4194('0x10')][_0x4194('0x11')]({'port':0x232b});var client9002=jayson[_0x4194('0x10')][_0x4194('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x4e74bf,_0x299f26,_0x2cbd25,_0x11f9c1){return new BPromise(function(_0x196430,_0x43130d){var _0x5e53c0=_0x11f9c1||client;return _0x5e53c0[_0x4194('0x12')](_0x4e74bf,_0x2cbd25)[_0x4194('0x13')](function(_0x4ff8a6){logger[_0x4194('0x14')](_0x4194('0x15'),_0x299f26,_0x4194('0x16'));logger[_0x4194('0x17')](_0x4194('0x18'),_0x299f26,_0x4194('0x16'),JSON[_0x4194('0x19')](_0x4ff8a6));if(_0x4ff8a6[_0x4194('0x1a')]){if(_0x4ff8a6['error'][_0x4194('0x1b')]===0x1f4){logger[_0x4194('0x1a')](_0x4194('0x15'),_0x299f26,_0x4ff8a6['error'][_0x4194('0x1c')]);return _0x43130d(_0x4ff8a6[_0x4194('0x1a')]['message']);}logger['error'](_0x4194('0x15'),_0x299f26,_0x4ff8a6[_0x4194('0x1a')]['message']);return _0x196430(_0x4ff8a6[_0x4194('0x1a')][_0x4194('0x1c')]);}else{logger[_0x4194('0x14')](_0x4194('0x15'),_0x299f26,_0x4194('0x16'));_0x196430(_0x4ff8a6['result']['message']);}})[_0x4194('0x1d')](function(_0xae3a){logger[_0x4194('0x1a')]('MailMessage,\x20%s,\x20%s',_0x299f26,_0xae3a);_0x43130d(_0xae3a);});});}function respondWithResult(_0x55b0ce,_0x5d317d){_0x5d317d=_0x5d317d||0xc8;return function(_0xea230e){if(_0xea230e){return _0x55b0ce[_0x4194('0x1e')](_0x5d317d)[_0x4194('0x1f')](_0xea230e);}};}function respondWithFilteredResult(_0x13b165,_0x287cfc){return function(_0xe274d){if(_0xe274d){var _0x4ff423=typeof _0x287cfc[_0x4194('0x20')]==='undefined'&&typeof _0x287cfc[_0x4194('0x21')]===_0x4194('0x22');var _0x35b34b=_0xe274d[_0x4194('0x23')];var _0xfcf912=_0x4ff423?0x0:_0x287cfc[_0x4194('0x20')];var _0x4862b4=_0x4ff423?_0xe274d[_0x4194('0x23')]:_0x287cfc[_0x4194('0x20')]+_0x287cfc[_0x4194('0x21')];var _0x2949de;if(_0x4862b4>=_0x35b34b){_0x4862b4=_0x35b34b;_0x2949de=0xc8;}else{_0x2949de=0xce;}_0x13b165[_0x4194('0x1e')](_0x2949de);return _0x13b165['set'](_0x4194('0x24'),_0xfcf912+'-'+_0x4862b4+'/'+_0x35b34b)[_0x4194('0x1f')](_0xe274d);}return null;};}function saveUpdates(_0x281694){return function(_0xac9995){if(_0xac9995){return _0xac9995[_0x4194('0x25')](_0x281694)[_0x4194('0x13')](function(_0x592678){return _0x592678;});}return null;};}function removeEntity(_0x5cc2fb){return function(_0x48c55d){if(_0x48c55d){return _0x48c55d['destroy']()[_0x4194('0x13')](function(){_0x5cc2fb[_0x4194('0x1e')](0xcc)[_0x4194('0x26')]();});}};}function handleEntityNotFound(_0x1e5aa1){return function(_0x2d43c5){if(!_0x2d43c5){_0x1e5aa1['sendStatus'](0x194);}return _0x2d43c5;};}function handleError(_0x16336f,_0x501a9d){_0x501a9d=_0x501a9d||0x1f4;return function(_0x5bd780){logger['error'](_0x5bd780[_0x4194('0x27')]);if(_0x5bd780[_0x4194('0x28')]){delete _0x5bd780['name'];}_0x16336f['status'](_0x501a9d)[_0x4194('0x29')](_0x5bd780);};}exports['index']=function(_0x227d68,_0x27a291){var _0x5d58ad={},_0x595393={},_0x34a55a={'count':0x0,'rows':[]};var _0x10249a=_['map'](db[_0x4194('0x2a')][_0x4194('0x2b')],function(_0x4557a3){return{'name':_0x4557a3[_0x4194('0x2c')],'type':_0x4557a3['type'][_0x4194('0x2d')]};});_0x595393['model']=_[_0x4194('0x2e')](_0x10249a,'name');_0x595393[_0x4194('0x2f')]=_[_0x4194('0x30')](_0x227d68[_0x4194('0x2f')]);_0x595393[_0x4194('0x31')]=_['intersection'](_0x595393['model'],_0x595393[_0x4194('0x2f')]);_0x5d58ad['attributes']=_[_0x4194('0x32')](_0x595393[_0x4194('0x33')],qs[_0x4194('0x34')](_0x227d68[_0x4194('0x2f')]['fields']));_0x5d58ad[_0x4194('0x35')]=_0x5d58ad[_0x4194('0x35')][_0x4194('0x36')]?_0x5d58ad['attributes']:_0x595393['model'];if(!_0x227d68[_0x4194('0x2f')][_0x4194('0x37')](_0x4194('0x38'))){_0x5d58ad[_0x4194('0x21')]=qs['limit'](_0x227d68[_0x4194('0x2f')]['limit']);_0x5d58ad[_0x4194('0x20')]=qs['offset'](_0x227d68[_0x4194('0x2f')][_0x4194('0x20')]);}_0x5d58ad[_0x4194('0x39')]=qs[_0x4194('0x3a')](_0x227d68[_0x4194('0x2f')][_0x4194('0x3a')]);_0x5d58ad[_0x4194('0x3b')]=qs['filters'](_['pick'](_0x227d68[_0x4194('0x2f')],_0x595393[_0x4194('0x31')]),_0x10249a);if(_0x227d68[_0x4194('0x2f')][_0x4194('0x3c')]){_0x5d58ad['where']=_['merge'](_0x5d58ad[_0x4194('0x3b')],{'$or':_[_0x4194('0x2e')](_0x10249a,function(_0x2664b0){if(_0x2664b0['type']!==_0x4194('0x3d')){var _0x35c1fc={};_0x35c1fc[_0x2664b0[_0x4194('0x28')]]={'$like':'%'+_0x227d68['query']['filter']+'%'};return _0x35c1fc;}})});}_0x5d58ad=_[_0x4194('0x3e')]({},_0x5d58ad,_0x227d68[_0x4194('0x3f')]);var _0x4c4118={'where':_0x5d58ad[_0x4194('0x3b')]};return db[_0x4194('0x2a')][_0x4194('0x23')](_0x4c4118)[_0x4194('0x13')](function(_0x39b2da){_0x34a55a[_0x4194('0x23')]=_0x39b2da;if(_0x227d68[_0x4194('0x2f')][_0x4194('0x40')]){_0x5d58ad[_0x4194('0x41')]=[{'all':!![]}];}return db[_0x4194('0x2a')][_0x4194('0x42')](_0x5d58ad);})[_0x4194('0x13')](function(_0x30c715){_0x34a55a[_0x4194('0x43')]=_0x30c715;return _0x34a55a;})['then'](respondWithFilteredResult(_0x27a291,_0x5d58ad))[_0x4194('0x1d')](handleError(_0x27a291,null));};exports[_0x4194('0x44')]=function(_0x18c9c,_0x20a6f5){var _0x1ae23a={'raw':!![],'where':{'id':_0x18c9c['params']['id']}},_0x4d64fb={};_0x4d64fb['model']=_[_0x4194('0x30')](db[_0x4194('0x2a')]['rawAttributes']);_0x4d64fb[_0x4194('0x2f')]=_['keys'](_0x18c9c[_0x4194('0x2f')]);_0x4d64fb[_0x4194('0x31')]=_[_0x4194('0x32')](_0x4d64fb[_0x4194('0x33')],_0x4d64fb['query']);_0x1ae23a[_0x4194('0x35')]=_[_0x4194('0x32')](_0x4d64fb['model'],qs['fields'](_0x18c9c['query'][_0x4194('0x34')]));_0x1ae23a[_0x4194('0x35')]=_0x1ae23a['attributes'][_0x4194('0x36')]?_0x1ae23a['attributes']:_0x4d64fb[_0x4194('0x33')];if(_0x18c9c[_0x4194('0x2f')][_0x4194('0x40')]){_0x1ae23a[_0x4194('0x41')]=[{'all':!![]}];}_0x1ae23a=_[_0x4194('0x3e')]({},_0x1ae23a,_0x18c9c['options']);return db[_0x4194('0x2a')]['find'](_0x1ae23a)['then'](handleEntityNotFound(_0x20a6f5,null))[_0x4194('0x13')](respondWithResult(_0x20a6f5,null))['catch'](handleError(_0x20a6f5,null));};exports[_0x4194('0x25')]=function(_0x462fee,_0x5e020d){if(_0x462fee['body']['id']){delete _0x462fee[_0x4194('0x45')]['id'];}return db[_0x4194('0x2a')]['find']({'where':{'id':_0x462fee[_0x4194('0x46')]['id']}})[_0x4194('0x13')](handleEntityNotFound(_0x5e020d,null))[_0x4194('0x13')](saveUpdates(_0x462fee[_0x4194('0x45')],null))[_0x4194('0x13')](respondWithResult(_0x5e020d,null))['catch'](handleError(_0x5e020d,null));};exports[_0x4194('0x47')]=function(_0x26f917,_0x46f2e0){return db[_0x4194('0x2a')]['find']({'where':{'id':_0x26f917[_0x4194('0x46')]['id']}})[_0x4194('0x13')](handleEntityNotFound(_0x46f2e0,null))[_0x4194('0x13')](removeEntity(_0x46f2e0,null))[_0x4194('0x1d')](handleError(_0x46f2e0,null));};exports[_0x4194('0x48')]=function(_0x3b890a,_0x532b43){return db['MailMessage'][_0x4194('0x48')]()[_0x4194('0x13')](respondWithResult(_0x532b43,null))[_0x4194('0x1d')](handleError(_0x532b43,null));};exports[_0x4194('0x49')]=function(_0x1c5e93,_0x4bbf50){return db['MailMessage']['create'](_0x1c5e93[_0x4194('0x45')])['then'](function(_0x107413){if(_0x107413){if(_0x107413['direction']===_0x4194('0x4a')&&!_0x107413[_0x4194('0x4b')]){var _0xf61dd1,_0x3e661f,_0x5908c4;if(_0x1c5e93[_0x4194('0x45')]['to']){_0x3e661f=_0x1c5e93[_0x4194('0x45')]['to'][_0x4194('0x4c')](',')[0x0];}return db[_0x4194('0x4d')][_0x4194('0x4e')]({'where':{'id':_0x107413[_0x4194('0x4f')]},'include':[{'model':db[_0x4194('0x50')],'as':_0x4194('0x51'),'include':[{'model':db['CmContact'],'as':_0x4194('0x52'),'where':{'email':_0x3e661f},'limit':0x1,'order':[[_0x4194('0x53'),_0x4194('0x54')]]}]},{'model':db[_0x4194('0x55')],'as':'Smtp','raw':!![]}]})[_0x4194('0x13')](function(_0xda521b){_0xf61dd1=_0xda521b;if(_0xf61dd1&&_0xf61dd1['Smtp']){var _0x4b6839={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xf61dd1[_0x4194('0x56')][_0x4194('0x57')])){_0x4b6839[_0x4194('0x58')]=_0xf61dd1[_0x4194('0x56')][_0x4194('0x58')];_0x4b6839['port']=_0xf61dd1[_0x4194('0x56')][_0x4194('0x59')];_0x4b6839[_0x4194('0x5a')]=_0xf61dd1[_0x4194('0x56')]['secure'];if(_0xf61dd1[_0x4194('0x56')][_0x4194('0x5b')]){_0x4b6839[_0x4194('0x5c')]={'user':_0xf61dd1[_0x4194('0x56')]['user'],'pass':_0xf61dd1['Smtp'][_0x4194('0x5d')]};}}else{_0x4b6839['service']=_0xf61dd1[_0x4194('0x56')]['service'];_0x4b6839['auth']={'user':_0xf61dd1[_0x4194('0x56')][_0x4194('0x5e')],'pass':_0xf61dd1[_0x4194('0x56')][_0x4194('0x5d')]};_0x4b6839[_0x4194('0x5a')]=_0xf61dd1['Smtp'][_0x4194('0x5a')];}if(_0x1c5e93[_0x4194('0x45')][_0x4194('0x5f')]&&_0x1c5e93[_0x4194('0x45')][_0x4194('0x5f')][_0x4194('0x36')]){for(var _0x1f4014=0x0;_0x1f4014<_0x1c5e93[_0x4194('0x45')][_0x4194('0x5f')][_0x4194('0x36')];_0x1f4014+=0x1){_0x1c5e93[_0x4194('0x45')]['attachments'][_0x1f4014]={'filename':_0x1c5e93[_0x4194('0x45')]['attachments'][_0x1f4014][_0x4194('0x28')],'path':path[_0x4194('0x60')](config[_0x4194('0x61')],_0x4194('0x62'),_0x1c5e93['body'][_0x4194('0x5f')][_0x1f4014]['basename'])};}}_0x5908c4={'account':_0x4b6839,'message':_0x1c5e93[_0x4194('0x45')]};return;}})[_0x4194('0x13')](function(){if(_0xf61dd1[_0x4194('0x51')]){if(_0xf61dd1[_0x4194('0x51')][_0x4194('0x52')][_0x4194('0x36')]){return _0xf61dd1['List'][_0x4194('0x52')][0x0];}else{return db['CmContact']['create'](_[_0x4194('0x63')](_0x1c5e93[_0x4194('0x45')],{'firstName':_0x1c5e93[_0x4194('0x45')]['to'],'email':_0x1c5e93['body']['to'],'phone':_0x1c5e93['body']['to'],'ListId':_0xf61dd1[_0x4194('0x64')]}));}}else{throw new Error(_0x4194('0x65'));}})[_0x4194('0x13')](function(){if(_0x5908c4){return respondWithRpcPromise(_0x4194('0x66'),_0x4194('0x67'),_0x5908c4,client9003)[_0x4194('0x13')](function(_0x25231b){return _0x107413['update']({'read':!![],'messageId':_0x25231b[_0x4194('0x68')],'sentAt':moment()['format'](_0x4194('0x69'))});})['catch'](function(_0x3e7583){logger[_0x4194('0x1a')]('%s',JSON[_0x4194('0x19')](_0x3e7583));return _0x107413;});}return _0x107413;});}return _0x107413;}})[_0x4194('0x13')](respondWithResult(_0x4bbf50,0xc9))[_0x4194('0x1d')](handleError(_0x4bbf50,null));};exports[_0x4194('0x6a')]=function(_0x19bc8a,_0x342aed){var _0x265ff0={'agent':{},'channel':'mail'};if(_0x19bc8a[_0x4194('0x45')]['id']){delete _0x19bc8a[_0x4194('0x45')]['id'];}_0x19bc8a['body'][_0x4194('0x6b')]=!![];_0x19bc8a['body'][_0x4194('0x6c')]=moment()[_0x4194('0x6d')]('YYYY-MM-DD\x20HH:mm:ss');_0x19bc8a['body'][_0x4194('0x6e')]=_0x19bc8a[_0x4194('0x45')]['UserId']||_0x19bc8a['user']['id'];_0x265ff0[_0x4194('0x6f')]['id']=_0x19bc8a[_0x4194('0x45')][_0x4194('0x6e')];return db[_0x4194('0x2a')]['find']({'where':{'id':_0x19bc8a['params']['id'],'UserId':null}})[_0x4194('0x13')](handleEntityNotFound(_0x342aed,null))[_0x4194('0x13')](saveUpdates(_0x19bc8a['body'],null))['then'](function(_0x59ee4d){if(_0x59ee4d){_0x265ff0['message']=_0x59ee4d[_0x4194('0x70')]({'plain':!![]});return db[_0x4194('0x71')][_0x4194('0x72')]({'where':{'id':_0x59ee4d[_0x4194('0x73')]}});}return null;})[_0x4194('0x13')](handleEntityNotFound(_0x342aed,null))['then'](function(_0x278e5f){if(_0x278e5f){return _0x278e5f['update']({'UserId':_0x19bc8a['body']['UserId'],'read1stAt':_[_0x4194('0x74')](_0x278e5f[_0x4194('0x75')])?moment()[_0x4194('0x6d')](_0x4194('0x69')):undefined});}return null;})[_0x4194('0x13')](function(_0x4bad4b){if(_0x4bad4b){_0x265ff0[_0x4194('0x76')]=_0x4bad4b[_0x4194('0x70')]({'plain':!![]});interaction_log[_0x4194('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19bc8a[_0x4194('0x5e')]['id'],_0x19bc8a[_0x4194('0x5e')]['name'],_0x19bc8a[_0x4194('0x5e')][_0x4194('0x77')],_0x265ff0['interaction']['id'],_0x19bc8a[_0x4194('0x45')]?JSON[_0x4194('0x19')](_0x19bc8a[_0x4194('0x45')]):_0x4194('0x78'));return respondWithRpcPromise(_0x4194('0x79'),_0x4194('0x7a'),_0x265ff0);}return null;})['then'](function(_0x377002){var _0x218fa0=_0x4194('0x7b')+_0x377002[_0x4194('0x1c')]['ContactId'];return db[_0x4194('0x7c')][_0x4194('0x2f')](_0x218fa0,{'type':db[_0x4194('0x7d')][_0x4194('0x7e')][_0x4194('0x7f')],'raw':!![]})[_0x4194('0x13')](function(_0x35dc24){return _0x35dc24;});})[_0x4194('0x13')](function(_0x722a40){if(_0x722a40){_0x265ff0[_0x4194('0x1c')][_0x4194('0x80')]=_0x722a40[0x0];if(!_0x19bc8a[_0x4194('0x45')][_0x4194('0x6e')])return;return db['User']['find']({'where':{'id':_0x19bc8a['body'][_0x4194('0x6e')],'role':'agent'},'attributes':['id','name',_0x4194('0x81'),_0x4194('0x82'),_0x4194('0x83')],'raw':!![]});}return null;})[_0x4194('0x13')](function(_0x5d8dec){if(!_0x5d8dec)return null;_0x265ff0[_0x4194('0x1c')][_0x4194('0x6f')]=_0x5d8dec;return _0x265ff0;})[_0x4194('0x13')](function(_0x408a84){if(_0x408a84){if(_0x19bc8a[_0x4194('0x45')]['manual']){_0x265ff0[_0x4194('0x1c')]['interface']=util[_0x4194('0x6d')](_0x4194('0x84'),_0x19bc8a[_0x4194('0x5e')][_0x4194('0x28')]);_0x265ff0[_0x4194('0x1c')][_0x4194('0x85')]=_0x265ff0['channel'];_0x265ff0[_0x4194('0x1c')][_0x4194('0x86')]=_0x265ff0[_0x4194('0x85')];_0x265ff0[_0x4194('0x1c')][_0x4194('0x87')]=_0x4194('0x6a');_0x265ff0[_0x4194('0x1c')][_0x4194('0x45')]=htmlToText[_0x4194('0x88')](_0x265ff0[_0x4194('0x1c')][_0x4194('0x45')]);return respondWithRpcPromise(_0x4194('0x89'),_0x4194('0x89'),{'event':_0x4194('0x8a'),'message':_0x265ff0[_0x4194('0x1c')]},client9002)[_0x4194('0x13')](function(){return _0x265ff0;});}return _0x265ff0;}return null;})[_0x4194('0x13')](respondWithResult(_0x342aed,null))[_0x4194('0x1d')](handleError(_0x342aed,null));};exports[_0x4194('0x8b')]=function(_0x24767e,_0x42c378){var _0x262ebd={'agent':{},'channel':_0x4194('0x8c')};if(_0x24767e[_0x4194('0x45')]['id']){delete _0x24767e[_0x4194('0x45')]['id'];}_0x24767e['body'][_0x4194('0x6e')]=_0x24767e[_0x4194('0x45')][_0x4194('0x6e')]||_0x24767e[_0x4194('0x5e')]['id'];_0x262ebd[_0x4194('0x6f')]['id']=_0x24767e[_0x4194('0x45')]['UserId'];return db[_0x4194('0x2a')][_0x4194('0x72')]({'where':{'id':_0x24767e[_0x4194('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x42c378,null))[_0x4194('0x13')](function(_0x84cdfc){if(_0x84cdfc){_0x262ebd[_0x4194('0x1c')]=_0x84cdfc['get']({'plain':!![]});return db[_0x4194('0x71')]['find']({'where':{'id':_0x84cdfc[_0x4194('0x73')]}});}return null;})[_0x4194('0x13')](handleEntityNotFound(_0x42c378,null))['then'](function(_0x44432a){if(_0x44432a){_0x262ebd[_0x4194('0x76')]=_0x44432a[_0x4194('0x70')]({'plain':!![]});interaction_log[_0x4194('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x24767e[_0x4194('0x5e')]['id'],_0x24767e[_0x4194('0x5e')][_0x4194('0x28')],_0x24767e[_0x4194('0x5e')][_0x4194('0x77')],_0x262ebd[_0x4194('0x76')]['id'],_0x24767e[_0x4194('0x45')]?JSON[_0x4194('0x19')](_0x24767e[_0x4194('0x45')]):_0x4194('0x78'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x262ebd);}return null;})[_0x4194('0x13')](function(_0x18f518){var _0x1f53b5=_0x4194('0x7b')+_0x18f518[_0x4194('0x1c')][_0x4194('0x8d')];return db[_0x4194('0x7c')]['query'](_0x1f53b5,{'type':db[_0x4194('0x7d')][_0x4194('0x7e')][_0x4194('0x7f')],'raw':!![]})[_0x4194('0x13')](function(_0x4277c1){return _0x4277c1;});})['then'](function(_0x2bbf1e){if(_0x2bbf1e){_0x262ebd[_0x4194('0x1c')][_0x4194('0x80')]=_0x2bbf1e[0x0];if(!_0x24767e[_0x4194('0x45')][_0x4194('0x6e')])return;return db[_0x4194('0x8e')][_0x4194('0x72')]({'where':{'id':_0x24767e[_0x4194('0x45')][_0x4194('0x6e')],'role':_0x4194('0x6f')},'attributes':['id',_0x4194('0x28'),_0x4194('0x81'),_0x4194('0x82'),'internal'],'raw':!![]});}return null;})['then'](function(_0xa693c9){if(!_0xa693c9)return null;_0x262ebd[_0x4194('0x1c')][_0x4194('0x6f')]=_0xa693c9;return _0x262ebd;})[_0x4194('0x13')](function(_0x2ab1e6){if(_0x2ab1e6){_0x2ab1e6[_0x4194('0x1c')]['interface']=util[_0x4194('0x6d')](_0x4194('0x84'),_0x24767e[_0x4194('0x5e')]['name']);_0x2ab1e6['message'][_0x4194('0x85')]=_0x262ebd[_0x4194('0x85')];_0x2ab1e6[_0x4194('0x1c')][_0x4194('0x86')]=_0x262ebd[_0x4194('0x85')];_0x2ab1e6['message'][_0x4194('0x87')]=_0x4194('0x8b');_0x2ab1e6[_0x4194('0x1c')][_0x4194('0x45')]=htmlToText[_0x4194('0x88')](_0x262ebd[_0x4194('0x1c')][_0x4194('0x45')]);respondWithRpcPromise('EventManager',_0x4194('0x89'),{'event':_0x4194('0x8f'),'message':_0x2ab1e6['message']},client9002);return _0x262ebd;}return null;})['then'](respondWithResult(_0x42c378,null))[_0x4194('0x1d')](handleError(_0x42c378,null));};exports[_0x4194('0x90')]=function(_0x3e8bf1,_0x460019){var _0x7e468=moment()['unix']()[_0x4194('0x91')]();var _0x520cb2=path[_0x4194('0x60')](config[_0x4194('0x61')],_0x4194('0x92'),_0x4194('0x93'),_0x4194('0x94'));var _0x2ac27f=path[_0x4194('0x60')](config[_0x4194('0x61')],_0x4194('0x92'),_0x4194('0x93'),_0x4194('0x5f'));var _0x42f44c=util[_0x4194('0x6d')](_0x4194('0x95'),_0x7e468);return db[_0x4194('0x2a')][_0x4194('0x72')]({'where':{'id':_0x3e8bf1[_0x4194('0x46')]['id']},'attributes':['id','body','from','to','cc','bcc','subject',_0x4194('0x96')],'include':_0x3e8bf1[_0x4194('0x2f')][_0x4194('0x5f')]?[{'model':db[_0x4194('0x97')],'as':_0x4194('0x98')}]:undefined})['then'](handleEntityNotFound(_0x460019,null))['then'](function(_0x47fdbd){if(_0x47fdbd){var _0x2701b7=_0x47fdbd;var _0x464869={'from':_0x2701b7[_0x4194('0x99')],'to':_0x2701b7['to'],'subject':_0x2701b7[_0x4194('0x9a')],'html':htmlEntities['decode'](_0x2701b7[_0x4194('0x45')]),'headers':{'Date':moment(_0x2701b7['createdAt'])[_0x4194('0x6d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x47fdbd['cc']){_0x464869['headers']['Cc']=_0x47fdbd['cc'];}if(_0x47fdbd[_0x4194('0x9b')]){_0x464869[_0x4194('0x9c')]['Bcc']=_0x47fdbd['bcc'];}return new BPromise(function(_0x237175,_0x1fa4d9){if(_0x47fdbd[_0x4194('0x98')]){for(var _0x4ecc90=0x0;_0x4ecc90<_0x47fdbd[_0x4194('0x98')][_0x4194('0x36')];_0x4ecc90++){var _0x4ba3a4=_0x47fdbd[_0x4194('0x98')][_0x4ecc90];var _0x1e07d0=path[_0x4194('0x60')](_0x2ac27f,_0x4ba3a4[_0x4194('0x9d')]);if(fs['existsSync'](_0x1e07d0)){_0x464869['attachments'][_0x4194('0x9e')]({'name':_0x4ba3a4['name'],'contentType':_0x4ba3a4[_0x4194('0x9f')],'data':fs[_0x4194('0xa0')](_0x1e07d0)});}}}emlformat[_0x4194('0xa1')](_0x464869,function(_0x5a1d87,_0x4ee99a){if(_0x5a1d87)return _0x1fa4d9(_0x5a1d87);fs[_0x4194('0xa2')](path[_0x4194('0x60')](_0x520cb2,_0x42f44c),_0x4ee99a);return _0x237175(_0x4ee99a);});});}})[_0x4194('0x13')](function(_0x221427){if(_0x221427){return _0x460019[_0x4194('0x90')](path['join'](_0x520cb2,_0x42f44c),_0x42f44c,function(_0x130861){if(!_0x130861)fs[_0x4194('0xa3')](path['join'](_0x520cb2,_0x42f44c));});}})[_0x4194('0x1d')](handleError(_0x460019,null));}; \ No newline at end of file +var _0xe8d9=['agent','email','internal','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','rejectmessage','download','unix','root','server','files','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','undefined','limit','count','offset','Content-Range','json','update','destroy','sendStatus','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','VIRTUAL','merge','options','MailMessage','include','findAll','rows','show','params','rawAttributes','includeAll','find','body','catch','describe','create','direction','split','findOne','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','read','format','UserId','MailInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xe8d9,0xba));var _0x9e8d=function(_0x507b37,_0x1a96fa){_0x507b37=_0x507b37-0x0;var _0x197d50=_0xe8d9[_0x507b37];return _0x197d50;};'use strict';var emlformat=require(_0x9e8d('0x0'));var moment=require(_0x9e8d('0x1'));var BPromise=require(_0x9e8d('0x2'));var util=require('util');var path=require(_0x9e8d('0x3'));var fs=require('fs');var _=require(_0x9e8d('0x4'));var Redis=require(_0x9e8d('0x5'));var htmlToText=require(_0x9e8d('0x6'));var qs=require(_0x9e8d('0x7'));var logger=require(_0x9e8d('0x8'))(_0x9e8d('0x9'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x9e8d('0xa'));var db=require(_0x9e8d('0xb'))['db'];config[_0x9e8d('0xc')]=_['defaults'](config[_0x9e8d('0xc')],{'host':_0x9e8d('0xd'),'port':0x18eb});var socket=require(_0x9e8d('0xe'))(new Redis(config[_0x9e8d('0xc')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x9e8d('0xf')](socket);var jayson=require(_0x9e8d('0x10'));var client=jayson[_0x9e8d('0x11')][_0x9e8d('0x12')]({'port':0x232c});var client9003=jayson[_0x9e8d('0x11')][_0x9e8d('0x12')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9faf,_0x3e71bf,_0x1ce68f,_0x1aed1b){return new BPromise(function(_0x17696f,_0xcfbd45){var _0x28ced1=_0x1aed1b||client;return _0x28ced1[_0x9e8d('0x13')](_0x1c9faf,_0x1ce68f)[_0x9e8d('0x14')](function(_0x5c70cb){logger[_0x9e8d('0x15')](_0x9e8d('0x16'),_0x3e71bf,'request\x20sent');logger['debug'](_0x9e8d('0x17'),_0x3e71bf,_0x9e8d('0x18'),JSON[_0x9e8d('0x19')](_0x5c70cb));if(_0x5c70cb['error']){if(_0x5c70cb[_0x9e8d('0x1a')]['code']===0x1f4){logger[_0x9e8d('0x1a')](_0x9e8d('0x16'),_0x3e71bf,_0x5c70cb['error']['message']);return _0xcfbd45(_0x5c70cb[_0x9e8d('0x1a')][_0x9e8d('0x1b')]);}logger[_0x9e8d('0x1a')](_0x9e8d('0x16'),_0x3e71bf,_0x5c70cb['error'][_0x9e8d('0x1b')]);return _0x17696f(_0x5c70cb[_0x9e8d('0x1a')][_0x9e8d('0x1b')]);}else{logger[_0x9e8d('0x15')](_0x9e8d('0x16'),_0x3e71bf,_0x9e8d('0x18'));_0x17696f(_0x5c70cb[_0x9e8d('0x1c')][_0x9e8d('0x1b')]);}})['catch'](function(_0x3078e8){logger[_0x9e8d('0x1a')]('MailMessage,\x20%s,\x20%s',_0x3e71bf,_0x3078e8);_0xcfbd45(_0x3078e8);});});}function respondWithResult(_0x4c900b,_0x4d7739){_0x4d7739=_0x4d7739||0xc8;return function(_0x100c97){if(_0x100c97){return _0x4c900b[_0x9e8d('0x1d')](_0x4d7739)['json'](_0x100c97);}};}function respondWithFilteredResult(_0x2f40b,_0x31afe1){return function(_0x5c6cde){if(_0x5c6cde){var _0x1839dd=typeof _0x31afe1['offset']===_0x9e8d('0x1e')&&typeof _0x31afe1[_0x9e8d('0x1f')]==='undefined';var _0x1efcc8=_0x5c6cde[_0x9e8d('0x20')];var _0x4caf00=_0x1839dd?0x0:_0x31afe1[_0x9e8d('0x21')];var _0x7de16d=_0x1839dd?_0x5c6cde['count']:_0x31afe1[_0x9e8d('0x21')]+_0x31afe1['limit'];var _0xa28753;if(_0x7de16d>=_0x1efcc8){_0x7de16d=_0x1efcc8;_0xa28753=0xc8;}else{_0xa28753=0xce;}_0x2f40b['status'](_0xa28753);return _0x2f40b['set'](_0x9e8d('0x22'),_0x4caf00+'-'+_0x7de16d+'/'+_0x1efcc8)[_0x9e8d('0x23')](_0x5c6cde);}return null;};}function saveUpdates(_0x5e114f){return function(_0x49d0e6){if(_0x49d0e6){return _0x49d0e6[_0x9e8d('0x24')](_0x5e114f)[_0x9e8d('0x14')](function(_0xb16abe){return _0xb16abe;});}return null;};}function removeEntity(_0xdee5d2){return function(_0x16a011){if(_0x16a011){return _0x16a011[_0x9e8d('0x25')]()[_0x9e8d('0x14')](function(){_0xdee5d2[_0x9e8d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14709b){return function(_0x3fbab6){if(!_0x3fbab6){_0x14709b[_0x9e8d('0x26')](0x194);}return _0x3fbab6;};}function handleError(_0x56e91a,_0x3f50a4){_0x3f50a4=_0x3f50a4||0x1f4;return function(_0x5d286b){logger[_0x9e8d('0x1a')](_0x5d286b[_0x9e8d('0x27')]);if(_0x5d286b['name']){delete _0x5d286b[_0x9e8d('0x28')];}_0x56e91a[_0x9e8d('0x1d')](_0x3f50a4)[_0x9e8d('0x29')](_0x5d286b);};}exports[_0x9e8d('0x2a')]=function(_0x517f73,_0x8da3f8){var _0x5e2799={},_0x26d647={},_0x47ec6e={'count':0x0,'rows':[]};var _0x502e1f=_[_0x9e8d('0x2b')](db['MailMessage']['rawAttributes'],function(_0x4f8496){return{'name':_0x4f8496['fieldName'],'type':_0x4f8496[_0x9e8d('0x2c')][_0x9e8d('0x2d')]};});_0x26d647[_0x9e8d('0x2e')]=_[_0x9e8d('0x2b')](_0x502e1f,_0x9e8d('0x28'));_0x26d647[_0x9e8d('0x2f')]=_[_0x9e8d('0x30')](_0x517f73[_0x9e8d('0x2f')]);_0x26d647['filters']=_[_0x9e8d('0x31')](_0x26d647[_0x9e8d('0x2e')],_0x26d647[_0x9e8d('0x2f')]);_0x5e2799[_0x9e8d('0x32')]=_['intersection'](_0x26d647[_0x9e8d('0x2e')],qs[_0x9e8d('0x33')](_0x517f73[_0x9e8d('0x2f')]['fields']));_0x5e2799[_0x9e8d('0x32')]=_0x5e2799[_0x9e8d('0x32')][_0x9e8d('0x34')]?_0x5e2799[_0x9e8d('0x32')]:_0x26d647[_0x9e8d('0x2e')];if(!_0x517f73[_0x9e8d('0x2f')][_0x9e8d('0x35')](_0x9e8d('0x36'))){_0x5e2799['limit']=qs[_0x9e8d('0x1f')](_0x517f73[_0x9e8d('0x2f')][_0x9e8d('0x1f')]);_0x5e2799[_0x9e8d('0x21')]=qs[_0x9e8d('0x21')](_0x517f73['query'][_0x9e8d('0x21')]);}_0x5e2799['order']=qs['sort'](_0x517f73[_0x9e8d('0x2f')]['sort']);_0x5e2799[_0x9e8d('0x37')]=qs[_0x9e8d('0x38')](_[_0x9e8d('0x39')](_0x517f73[_0x9e8d('0x2f')],_0x26d647[_0x9e8d('0x38')]),_0x502e1f);if(_0x517f73[_0x9e8d('0x2f')][_0x9e8d('0x3a')]){_0x5e2799[_0x9e8d('0x37')]=_['merge'](_0x5e2799[_0x9e8d('0x37')],{'$or':_['map'](_0x502e1f,function(_0x12737b){if(_0x12737b[_0x9e8d('0x2c')]!==_0x9e8d('0x3b')){var _0x6e9de5={};_0x6e9de5[_0x12737b[_0x9e8d('0x28')]]={'$like':'%'+_0x517f73[_0x9e8d('0x2f')][_0x9e8d('0x3a')]+'%'};return _0x6e9de5;}})});}_0x5e2799=_[_0x9e8d('0x3c')]({},_0x5e2799,_0x517f73[_0x9e8d('0x3d')]);var _0x2885a7={'where':_0x5e2799[_0x9e8d('0x37')]};return db[_0x9e8d('0x3e')][_0x9e8d('0x20')](_0x2885a7)[_0x9e8d('0x14')](function(_0x18a93e){_0x47ec6e[_0x9e8d('0x20')]=_0x18a93e;if(_0x517f73[_0x9e8d('0x2f')]['includeAll']){_0x5e2799[_0x9e8d('0x3f')]=[{'all':!![]}];}return db['MailMessage'][_0x9e8d('0x40')](_0x5e2799);})[_0x9e8d('0x14')](function(_0x2a8961){_0x47ec6e[_0x9e8d('0x41')]=_0x2a8961;return _0x47ec6e;})[_0x9e8d('0x14')](respondWithFilteredResult(_0x8da3f8,_0x5e2799))['catch'](handleError(_0x8da3f8,null));};exports[_0x9e8d('0x42')]=function(_0x419087,_0x34ad20){var _0x4a0d95={'raw':!![],'where':{'id':_0x419087[_0x9e8d('0x43')]['id']}},_0x98dffe={};_0x98dffe[_0x9e8d('0x2e')]=_[_0x9e8d('0x30')](db[_0x9e8d('0x3e')][_0x9e8d('0x44')]);_0x98dffe[_0x9e8d('0x2f')]=_[_0x9e8d('0x30')](_0x419087[_0x9e8d('0x2f')]);_0x98dffe['filters']=_['intersection'](_0x98dffe[_0x9e8d('0x2e')],_0x98dffe[_0x9e8d('0x2f')]);_0x4a0d95[_0x9e8d('0x32')]=_[_0x9e8d('0x31')](_0x98dffe[_0x9e8d('0x2e')],qs[_0x9e8d('0x33')](_0x419087[_0x9e8d('0x2f')][_0x9e8d('0x33')]));_0x4a0d95['attributes']=_0x4a0d95[_0x9e8d('0x32')][_0x9e8d('0x34')]?_0x4a0d95[_0x9e8d('0x32')]:_0x98dffe[_0x9e8d('0x2e')];if(_0x419087[_0x9e8d('0x2f')][_0x9e8d('0x45')]){_0x4a0d95['include']=[{'all':!![]}];}_0x4a0d95=_[_0x9e8d('0x3c')]({},_0x4a0d95,_0x419087[_0x9e8d('0x3d')]);return db[_0x9e8d('0x3e')][_0x9e8d('0x46')](_0x4a0d95)[_0x9e8d('0x14')](handleEntityNotFound(_0x34ad20,null))[_0x9e8d('0x14')](respondWithResult(_0x34ad20,null))['catch'](handleError(_0x34ad20,null));};exports[_0x9e8d('0x24')]=function(_0x6be3b,_0x34e052){if(_0x6be3b[_0x9e8d('0x47')]['id']){delete _0x6be3b['body']['id'];}return db[_0x9e8d('0x3e')]['find']({'where':{'id':_0x6be3b[_0x9e8d('0x43')]['id']}})['then'](handleEntityNotFound(_0x34e052,null))[_0x9e8d('0x14')](saveUpdates(_0x6be3b[_0x9e8d('0x47')],null))['then'](respondWithResult(_0x34e052,null))[_0x9e8d('0x48')](handleError(_0x34e052,null));};exports['destroy']=function(_0x5f0605,_0x5038c4){return db['MailMessage'][_0x9e8d('0x46')]({'where':{'id':_0x5f0605[_0x9e8d('0x43')]['id']}})[_0x9e8d('0x14')](handleEntityNotFound(_0x5038c4,null))[_0x9e8d('0x14')](removeEntity(_0x5038c4,null))['catch'](handleError(_0x5038c4,null));};exports['describe']=function(_0x201bab,_0x159bf0){return db[_0x9e8d('0x3e')][_0x9e8d('0x49')]()[_0x9e8d('0x14')](respondWithResult(_0x159bf0,null))[_0x9e8d('0x48')](handleError(_0x159bf0,null));};exports['create']=function(_0x393eb9,_0x4576e4){return db['MailMessage'][_0x9e8d('0x4a')](_0x393eb9[_0x9e8d('0x47')])[_0x9e8d('0x14')](function(_0x589ca5){if(_0x589ca5){if(_0x589ca5[_0x9e8d('0x4b')]==='out'&&!_0x589ca5['secret']){var _0x58b8cb,_0xb6cd4a,_0x404ea4;if(_0x393eb9['body']['to']){_0xb6cd4a=_0x393eb9[_0x9e8d('0x47')]['to'][_0x9e8d('0x4c')](',')[0x0];}return db['MailAccount'][_0x9e8d('0x4d')]({'where':{'id':_0x589ca5[_0x9e8d('0x4e')]},'include':[{'model':db[_0x9e8d('0x4f')],'as':_0x9e8d('0x50'),'include':[{'model':db['CmContact'],'as':_0x9e8d('0x51'),'where':{'email':_0xb6cd4a},'limit':0x1,'order':[['updatedAt',_0x9e8d('0x52')]]}]},{'model':db[_0x9e8d('0x53')],'as':_0x9e8d('0x54'),'raw':!![]}]})[_0x9e8d('0x14')](function(_0x3ff2b7){_0x58b8cb=_0x3ff2b7;if(_0x58b8cb&&_0x58b8cb['Smtp']){var _0x1388eb={'tls':{'rejectUnauthorized':![]}};if(_[_0x9e8d('0x55')](_0x58b8cb[_0x9e8d('0x54')][_0x9e8d('0x56')])){_0x1388eb[_0x9e8d('0x57')]=_0x58b8cb['Smtp'][_0x9e8d('0x57')];_0x1388eb[_0x9e8d('0x58')]=_0x58b8cb['Smtp'][_0x9e8d('0x58')];_0x1388eb[_0x9e8d('0x59')]=_0x58b8cb[_0x9e8d('0x54')][_0x9e8d('0x59')];if(_0x58b8cb['Smtp']['authentication']){_0x1388eb[_0x9e8d('0x5a')]={'user':_0x58b8cb[_0x9e8d('0x54')][_0x9e8d('0x5b')],'pass':_0x58b8cb[_0x9e8d('0x54')][_0x9e8d('0x5c')]};}}else{_0x1388eb[_0x9e8d('0x56')]=_0x58b8cb['Smtp'][_0x9e8d('0x56')];_0x1388eb[_0x9e8d('0x5a')]={'user':_0x58b8cb[_0x9e8d('0x54')][_0x9e8d('0x5b')],'pass':_0x58b8cb[_0x9e8d('0x54')]['pass']};_0x1388eb['secure']=_0x58b8cb[_0x9e8d('0x54')][_0x9e8d('0x59')];}if(_0x393eb9[_0x9e8d('0x47')][_0x9e8d('0x5d')]&&_0x393eb9[_0x9e8d('0x47')][_0x9e8d('0x5d')][_0x9e8d('0x34')]){for(var _0xa2353d=0x0;_0xa2353d<_0x393eb9[_0x9e8d('0x47')][_0x9e8d('0x5d')][_0x9e8d('0x34')];_0xa2353d+=0x1){_0x393eb9[_0x9e8d('0x47')][_0x9e8d('0x5d')][_0xa2353d]={'filename':_0x393eb9['body'][_0x9e8d('0x5d')][_0xa2353d][_0x9e8d('0x28')],'path':path[_0x9e8d('0x5e')](config['root'],_0x9e8d('0x5f'),_0x393eb9[_0x9e8d('0x47')]['attachments'][_0xa2353d][_0x9e8d('0x60')])};}}_0x404ea4={'account':_0x1388eb,'message':_0x393eb9[_0x9e8d('0x47')]};return;}})[_0x9e8d('0x14')](function(){if(_0x58b8cb['List']){if(_0x58b8cb[_0x9e8d('0x50')]['Contacts'][_0x9e8d('0x34')]){return _0x58b8cb[_0x9e8d('0x50')][_0x9e8d('0x51')][0x0];}else{return db[_0x9e8d('0x61')][_0x9e8d('0x4a')](_['defaults'](_0x393eb9['body'],{'firstName':_0x393eb9['body']['to'],'email':_0x393eb9[_0x9e8d('0x47')]['to'],'phone':_0x393eb9[_0x9e8d('0x47')]['to'],'ListId':_0x58b8cb[_0x9e8d('0x62')]}));}}else{throw new Error(_0x9e8d('0x63'));}})['then'](function(){if(_0x404ea4){return respondWithRpcPromise(_0x9e8d('0x64'),_0x9e8d('0x65'),_0x404ea4,client9003)[_0x9e8d('0x14')](function(_0x29aa4c){return _0x589ca5['update']({'read':!![],'messageId':_0x29aa4c[_0x9e8d('0x66')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9e8d('0x48')](function(_0x1173e5){logger[_0x9e8d('0x1a')]('%s',JSON[_0x9e8d('0x19')](_0x1173e5));return _0x589ca5;});}return _0x589ca5;});}return _0x589ca5;}})[_0x9e8d('0x14')](respondWithResult(_0x4576e4,0xc9))[_0x9e8d('0x48')](handleError(_0x4576e4,null));};exports['accept']=function(_0x1932e0,_0x4a404f){var _0x21ba27={'agent':{},'channel':'mail'};if(_0x1932e0['body']['id']){delete _0x1932e0[_0x9e8d('0x47')]['id'];}_0x1932e0[_0x9e8d('0x47')][_0x9e8d('0x67')]=!![];_0x1932e0['body']['readAt']=moment()[_0x9e8d('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x1932e0[_0x9e8d('0x47')][_0x9e8d('0x69')]=_0x1932e0[_0x9e8d('0x47')]['UserId']||_0x1932e0['user']['id'];_0x21ba27['agent']['id']=_0x1932e0[_0x9e8d('0x47')][_0x9e8d('0x69')];return db[_0x9e8d('0x3e')][_0x9e8d('0x46')]({'where':{'id':_0x1932e0['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a404f,null))[_0x9e8d('0x14')](saveUpdates(_0x1932e0['body'],null))[_0x9e8d('0x14')](function(_0x57f9e9){if(_0x57f9e9){_0x21ba27[_0x9e8d('0x1b')]=_0x57f9e9['get']({'plain':!![]});return db['MailInteraction'][_0x9e8d('0x46')]({'where':{'id':_0x57f9e9[_0x9e8d('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x4a404f,null))[_0x9e8d('0x14')](function(_0x501419){if(_0x501419){return _0x501419[_0x9e8d('0x24')]({'UserId':_0x1932e0['body'][_0x9e8d('0x69')],'read1stAt':_[_0x9e8d('0x55')](_0x501419[_0x9e8d('0x6b')])?moment()[_0x9e8d('0x68')](_0x9e8d('0x6c')):undefined});}return null;})[_0x9e8d('0x14')](function(_0x18383b){if(_0x18383b){_0x21ba27[_0x9e8d('0x6d')]=_0x18383b[_0x9e8d('0x6e')]({'plain':!![]});interaction_log[_0x9e8d('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1932e0[_0x9e8d('0x5b')]['id'],_0x1932e0['user'][_0x9e8d('0x28')],_0x1932e0[_0x9e8d('0x5b')][_0x9e8d('0x6f')],_0x21ba27[_0x9e8d('0x6d')]['id'],_0x1932e0[_0x9e8d('0x47')]?JSON[_0x9e8d('0x19')](_0x1932e0[_0x9e8d('0x47')]):_0x9e8d('0x70'));return respondWithRpcPromise(_0x9e8d('0x71'),_0x9e8d('0x72'),_0x21ba27);}return null;})[_0x9e8d('0x14')](function(_0x10186a){var _0x323c12='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x10186a[_0x9e8d('0x1b')][_0x9e8d('0x73')];return db[_0x9e8d('0x74')][_0x9e8d('0x2f')](_0x323c12,{'type':db[_0x9e8d('0x75')][_0x9e8d('0x76')][_0x9e8d('0x77')],'raw':!![]})[_0x9e8d('0x14')](function(_0x43b782){return _0x43b782;});})[_0x9e8d('0x14')](function(_0x513cb0){if(_0x513cb0){_0x21ba27[_0x9e8d('0x1b')][_0x9e8d('0x78')]=_0x513cb0[0x0];if(!_0x1932e0[_0x9e8d('0x47')][_0x9e8d('0x69')])return;return db[_0x9e8d('0x79')][_0x9e8d('0x46')]({'where':{'id':_0x1932e0[_0x9e8d('0x47')][_0x9e8d('0x69')],'role':_0x9e8d('0x7a')},'attributes':['id',_0x9e8d('0x28'),'fullname',_0x9e8d('0x7b'),_0x9e8d('0x7c')],'raw':!![]});}return null;})[_0x9e8d('0x14')](function(_0x4783db){if(!_0x4783db)return null;_0x21ba27[_0x9e8d('0x1b')][_0x9e8d('0x7a')]=_0x4783db;return _0x21ba27;})[_0x9e8d('0x14')](function(_0x18f477){if(_0x18f477){if(_0x1932e0[_0x9e8d('0x47')]['manual']){_0x21ba27[_0x9e8d('0x1b')]['interface']=util[_0x9e8d('0x68')](_0x9e8d('0x7d'),_0x1932e0[_0x9e8d('0x5b')][_0x9e8d('0x28')]);_0x21ba27[_0x9e8d('0x1b')]['channel']=_0x21ba27[_0x9e8d('0x7e')];_0x21ba27[_0x9e8d('0x1b')][_0x9e8d('0x7f')]=_0x21ba27[_0x9e8d('0x7e')];_0x21ba27[_0x9e8d('0x1b')][_0x9e8d('0x80')]='accept';_0x21ba27[_0x9e8d('0x1b')]['body']=htmlToText[_0x9e8d('0x81')](_0x21ba27[_0x9e8d('0x1b')][_0x9e8d('0x47')]);return respondWithRpcPromise(_0x9e8d('0x82'),_0x9e8d('0x82'),{'event':_0x9e8d('0x83'),'message':_0x21ba27['message']},client9002)[_0x9e8d('0x14')](function(){return _0x21ba27;});}return _0x21ba27;}return null;})[_0x9e8d('0x14')](respondWithResult(_0x4a404f,null))['catch'](handleError(_0x4a404f,null));};exports[_0x9e8d('0x84')]=function(_0xaa7775,_0x2f2634){var _0x3393c3={'agent':{},'channel':_0x9e8d('0x85')};if(_0xaa7775[_0x9e8d('0x47')]['id']){delete _0xaa7775[_0x9e8d('0x47')]['id'];}_0xaa7775[_0x9e8d('0x47')][_0x9e8d('0x69')]=_0xaa7775[_0x9e8d('0x47')]['UserId']||_0xaa7775[_0x9e8d('0x5b')]['id'];_0x3393c3['agent']['id']=_0xaa7775[_0x9e8d('0x47')][_0x9e8d('0x69')];return db[_0x9e8d('0x3e')]['find']({'where':{'id':_0xaa7775['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f2634,null))['then'](function(_0x4fbe0b){if(_0x4fbe0b){_0x3393c3[_0x9e8d('0x1b')]=_0x4fbe0b[_0x9e8d('0x6e')]({'plain':!![]});return db[_0x9e8d('0x86')][_0x9e8d('0x46')]({'where':{'id':_0x4fbe0b[_0x9e8d('0x6a')]}});}return null;})[_0x9e8d('0x14')](handleEntityNotFound(_0x2f2634,null))[_0x9e8d('0x14')](function(_0x4913f5){if(_0x4913f5){_0x3393c3[_0x9e8d('0x6d')]=_0x4913f5[_0x9e8d('0x6e')]({'plain':!![]});interaction_log['info'](_0x9e8d('0x87'),_0xaa7775[_0x9e8d('0x5b')]['id'],_0xaa7775[_0x9e8d('0x5b')][_0x9e8d('0x28')],_0xaa7775[_0x9e8d('0x5b')][_0x9e8d('0x6f')],_0x3393c3[_0x9e8d('0x6d')]['id'],_0xaa7775[_0x9e8d('0x47')]?JSON[_0x9e8d('0x19')](_0xaa7775[_0x9e8d('0x47')]):_0x9e8d('0x70'));return respondWithRpcPromise(_0x9e8d('0x88'),'rejectMessage',_0x3393c3);}return null;})[_0x9e8d('0x14')](function(_0x34a9d2){var _0x1b73b0=_0x9e8d('0x89')+_0x34a9d2[_0x9e8d('0x1b')]['ContactId'];return db[_0x9e8d('0x74')][_0x9e8d('0x2f')](_0x1b73b0,{'type':db[_0x9e8d('0x75')][_0x9e8d('0x76')]['SELECT'],'raw':!![]})[_0x9e8d('0x14')](function(_0x5ef414){return _0x5ef414;});})['then'](function(_0x4f2e3e){if(_0x4f2e3e){_0x3393c3[_0x9e8d('0x1b')][_0x9e8d('0x78')]=_0x4f2e3e[0x0];if(!_0xaa7775['body'][_0x9e8d('0x69')])return;return db[_0x9e8d('0x79')][_0x9e8d('0x46')]({'where':{'id':_0xaa7775[_0x9e8d('0x47')]['UserId'],'role':'agent'},'attributes':['id',_0x9e8d('0x28'),_0x9e8d('0x8a'),_0x9e8d('0x7b'),_0x9e8d('0x7c')],'raw':!![]});}return null;})['then'](function(_0x31fb7a){if(!_0x31fb7a)return null;_0x3393c3[_0x9e8d('0x1b')][_0x9e8d('0x7a')]=_0x31fb7a;return _0x3393c3;})['then'](function(_0x5c7481){if(_0x5c7481){_0x5c7481[_0x9e8d('0x1b')]['interface']=util[_0x9e8d('0x68')](_0x9e8d('0x7d'),_0xaa7775[_0x9e8d('0x5b')][_0x9e8d('0x28')]);_0x5c7481['message'][_0x9e8d('0x7e')]=_0x3393c3[_0x9e8d('0x7e')];_0x5c7481[_0x9e8d('0x1b')][_0x9e8d('0x7f')]=_0x3393c3['channel'];_0x5c7481[_0x9e8d('0x1b')][_0x9e8d('0x80')]=_0x9e8d('0x84');_0x5c7481['message'][_0x9e8d('0x47')]=htmlToText[_0x9e8d('0x81')](_0x3393c3[_0x9e8d('0x1b')][_0x9e8d('0x47')]);respondWithRpcPromise(_0x9e8d('0x82'),_0x9e8d('0x82'),{'event':_0x9e8d('0x8b'),'message':_0x5c7481[_0x9e8d('0x1b')]},client9002);return _0x3393c3;}return null;})[_0x9e8d('0x14')](respondWithResult(_0x2f2634,null))[_0x9e8d('0x48')](handleError(_0x2f2634,null));};exports[_0x9e8d('0x8c')]=function(_0x5942aa,_0x1d8fff){var _0xdc16db=moment()[_0x9e8d('0x8d')]()['toString']();var _0x2f13f0=path[_0x9e8d('0x5e')](config[_0x9e8d('0x8e')],_0x9e8d('0x8f'),_0x9e8d('0x90'),'tmp');var _0x551bae=path[_0x9e8d('0x5e')](config['root'],_0x9e8d('0x8f'),_0x9e8d('0x90'),_0x9e8d('0x5d'));var _0x50771a=util[_0x9e8d('0x68')]('message-%s.eml',_0xdc16db);return db['MailMessage'][_0x9e8d('0x46')]({'where':{'id':_0x5942aa[_0x9e8d('0x43')]['id']},'attributes':['id',_0x9e8d('0x47'),'from','to','cc','bcc',_0x9e8d('0x91'),_0x9e8d('0x92')],'include':_0x5942aa[_0x9e8d('0x2f')][_0x9e8d('0x5d')]?[{'model':db[_0x9e8d('0x93')],'as':'Attachments'}]:undefined})[_0x9e8d('0x14')](handleEntityNotFound(_0x1d8fff,null))[_0x9e8d('0x14')](function(_0x4b6903){if(_0x4b6903){var _0x172687=_0x4b6903;var _0x1fbc1c={'from':_0x172687['from'],'to':_0x172687['to'],'subject':_0x172687['subject'],'html':htmlEntities[_0x9e8d('0x94')](_0x172687[_0x9e8d('0x47')]),'headers':{'Date':moment(_0x172687[_0x9e8d('0x92')])[_0x9e8d('0x68')](_0x9e8d('0x95'))},'attachments':[]};if(_0x4b6903['cc']){_0x1fbc1c[_0x9e8d('0x96')]['Cc']=_0x4b6903['cc'];}if(_0x4b6903[_0x9e8d('0x97')]){_0x1fbc1c[_0x9e8d('0x96')]['Bcc']=_0x4b6903['bcc'];}return new BPromise(function(_0x2f7bcc,_0x4fee61){if(_0x4b6903[_0x9e8d('0x98')]){for(var _0x3ded87=0x0;_0x3ded87<_0x4b6903[_0x9e8d('0x98')]['length'];_0x3ded87++){var _0x2253da=_0x4b6903[_0x9e8d('0x98')][_0x3ded87];var _0x406c18=path[_0x9e8d('0x5e')](_0x551bae,_0x2253da['basename']);if(fs['existsSync'](_0x406c18)){_0x1fbc1c[_0x9e8d('0x5d')]['push']({'name':_0x2253da[_0x9e8d('0x28')],'contentType':_0x2253da[_0x9e8d('0x2c')],'data':fs['readFileSync'](_0x406c18)});}}}emlformat['build'](_0x1fbc1c,function(_0x3df6f5,_0x47f727){if(_0x3df6f5)return _0x4fee61(_0x3df6f5);fs['writeFileSync'](path['join'](_0x2f13f0,_0x50771a),_0x47f727);return _0x2f7bcc(_0x47f727);});});}})[_0x9e8d('0x14')](function(_0x23a283){if(_0x23a283){return _0x1d8fff[_0x9e8d('0x8c')](path[_0x9e8d('0x5e')](_0x2f13f0,_0x50771a),_0x50771a,function(_0x55f1c3){if(!_0x55f1c3)fs[_0x9e8d('0x99')](path['join'](_0x2f13f0,_0x50771a));});}})[_0x9e8d('0x48')](handleError(_0x1d8fff,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 69af6c0..9ca275e 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 _0x21ed=['exports','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x542ae0,_0x30bd7a){var _0x32044d=function(_0x22c8c0){while(--_0x22c8c0){_0x542ae0['push'](_0x542ae0['shift']());}};_0x32044d(++_0x30bd7a);}(_0x21ed,0x119));var _0xd21e=function(_0x91b592,_0x248449){_0x91b592=_0x91b592-0x0;var _0x194ea1=_0x21ed[_0x91b592];return _0x194ea1;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xd21e('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd21e('0x1')](0x0);var events={'afterCreate':_0xd21e('0x2'),'afterUpdate':'update','afterDestroy':_0xd21e('0x3')};function emitEvent(_0x2d4371){return function(_0x5bb2a9,_0x1c5dd4,_0x2e0114){MailMessageEvents[_0xd21e('0x4')](_0x2d4371+':'+_0x5bb2a9['id'],_0x5bb2a9);MailMessageEvents['emit'](_0x2d4371,_0x5bb2a9);_0x2e0114(null);};}for(var e in events){if(events[_0xd21e('0x5')](e)){var event=events[e];MailMessage[_0xd21e('0x6')](e,emitEvent(event));}}module[_0xd21e('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x3a34=['emit','hasOwnProperty','hook','exports','MailMessage','setMaxListeners','save','update'];(function(_0xaed073,_0x4fe347){var _0x5620b9=function(_0x4bb56d){while(--_0x4bb56d){_0xaed073['push'](_0xaed073['shift']());}};_0x5620b9(++_0x4fe347);}(_0x3a34,0x17c));var _0x43a3=function(_0x1d97e0,_0x972e19){_0x1d97e0=_0x1d97e0-0x0;var _0x49e16e=_0x3a34[_0x1d97e0];return _0x49e16e;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x43a3('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x43a3('0x1')](0x0);var events={'afterCreate':_0x43a3('0x2'),'afterUpdate':_0x43a3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e6599){return function(_0x2a6bed,_0x5b8459,_0x3fbc03){MailMessageEvents[_0x43a3('0x4')](_0x3e6599+':'+_0x2a6bed['id'],_0x2a6bed);MailMessageEvents[_0x43a3('0x4')](_0x3e6599,_0x2a6bed);_0x3fbc03(null);};}for(var e in events){if(events[_0x43a3('0x5')](e)){var event=events[e];MailMessage[_0x43a3('0x6')](e,emitEvent(event));}}module[_0x43a3('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 14c81d7..a9f171b 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 _0x1c0b=['direction','toLowerCase','out','isNil','MailInteraction','findOne','MailInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get'];(function(_0xb2e670,_0x436e56){var _0x598b6b=function(_0x5ecdd8){while(--_0x5ecdd8){_0xb2e670['push'](_0xb2e670['shift']());}};_0x598b6b(++_0x436e56);}(_0x1c0b,0xec));var _0xb1c0=function(_0x404b6d,_0x37d028){_0x404b6d=_0x404b6d-0x0;var _0x2e910a=_0x1c0b[_0x404b6d];return _0x2e910a;};'use strict';var _=require(_0xb1c0('0x0'));var util=require(_0xb1c0('0x1'));var logger=require(_0xb1c0('0x2'))(_0xb1c0('0x3'));var moment=require('moment');var BPromise=require(_0xb1c0('0x4'));var rp=require('request-promise');var htmlToText=require(_0xb1c0('0x5'));var fs=require('fs');var path=require(_0xb1c0('0x6'));var rimraf=require(_0xb1c0('0x7'));var config=require(_0xb1c0('0x8'));var attributes=require(_0xb1c0('0x9'));module['exports']=function(_0x2e44a7,_0x2639df){return _0x2e44a7['define'](_0xb1c0('0xa'),attributes,{'tableName':_0xb1c0('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xb1c0('0xc'),'fields':[_0xb1c0('0xd'),_0xb1c0('0xe')],'type':_0xb1c0('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f107c,_0x8fef5b,_0x23f0a9){if(_0x2f107c[_0xb1c0('0x10')]){_0x2f107c[_0xb1c0('0xd')]=htmlToText[_0xb1c0('0x11')](_0x2f107c[_0xb1c0('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x23f0a9(null,_0x8fef5b);},'afterCreate':function(_0x33f756,_0xced5c6,_0x23f1a6){var _0x47dff7=_0x2e44a7[_0xb1c0('0x12')];var _0x297e4e=_0x33f756[_0xb1c0('0x13')]({'plain':!![]});if(_0x297e4e[_0xb1c0('0x14')][_0xb1c0('0x15')]()==='in'||_0x297e4e[_0xb1c0('0x14')]['toLowerCase']()===_0xb1c0('0x16')&&!_0x297e4e['secret']&&!_[_0xb1c0('0x17')](_0x297e4e['UserId'])){_0x47dff7[_0xb1c0('0x18')][_0xb1c0('0x19')]({'where':{'id':_0x297e4e[_0xb1c0('0x1a')]}})[_0xb1c0('0x1b')](function(_0x520aa4){if(_0x520aa4){_0x520aa4['update']({'lastMsgAt':_0x297e4e['createdAt'],'lastMsgDirection':_0x297e4e[_0xb1c0('0x14')][_0xb1c0('0x15')]()});}})[_0xb1c0('0x1c')](function(_0x3a5522){console[_0xb1c0('0x1d')](_0x3a5522);});}_0x23f1a6();}},'charset':_0xb1c0('0x1e'),'collate':_0xb1c0('0x1f')});}; \ No newline at end of file +var _0xc569=['get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models'];(function(_0x5dccda,_0x244552){var _0x4e8c52=function(_0x168253){while(--_0x168253){_0x5dccda['push'](_0x5dccda['shift']());}};_0x4e8c52(++_0x244552);}(_0xc569,0x1af));var _0x9c56=function(_0x1d263c,_0x211b32){_0x1d263c=_0x1d263c-0x0;var _0x110b9d=_0xc569[_0x1d263c];return _0x110b9d;};'use strict';var _=require('lodash');var util=require(_0x9c56('0x0'));var logger=require(_0x9c56('0x1'))(_0x9c56('0x2'));var moment=require(_0x9c56('0x3'));var BPromise=require(_0x9c56('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c56('0x5'));var config=require(_0x9c56('0x6'));var attributes=require(_0x9c56('0x7'));module['exports']=function(_0xe2b566,_0x5db97e){return _0xe2b566['define'](_0x9c56('0x8'),attributes,{'tableName':_0x9c56('0x9'),'paranoid':![],'indexes':[{'name':_0x9c56('0xa'),'fields':[_0x9c56('0xa')]},{'name':_0x9c56('0xb'),'fields':[_0x9c56('0xc'),_0x9c56('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40b70b,_0xc7d001,_0x275ab6){if(_0x40b70b[_0x9c56('0xe')]){_0x40b70b[_0x9c56('0xc')]=htmlToText[_0x9c56('0xf')](_0x40b70b[_0x9c56('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x275ab6(null,_0xc7d001);},'afterCreate':function(_0x594b74,_0x3827e3,_0x109cf7){var _0x185a62=_0xe2b566[_0x9c56('0x10')];var _0x2d30f5=_0x594b74[_0x9c56('0x11')]({'plain':!![]});if(_0x2d30f5[_0x9c56('0x12')][_0x9c56('0x13')]()==='in'||_0x2d30f5[_0x9c56('0x12')][_0x9c56('0x13')]()===_0x9c56('0x14')&&!_0x2d30f5[_0x9c56('0x15')]&&!_['isNil'](_0x2d30f5[_0x9c56('0x16')])){_0x185a62[_0x9c56('0x17')][_0x9c56('0x18')]({'where':{'id':_0x2d30f5[_0x9c56('0x19')]}})[_0x9c56('0x1a')](function(_0x3dc679){if(_0x3dc679){_0x3dc679[_0x9c56('0x1b')]({'lastMsgAt':_0x2d30f5[_0x9c56('0x1c')],'lastMsgDirection':_0x2d30f5[_0x9c56('0x12')]['toLowerCase']()});}})[_0x9c56('0x1d')](function(_0x1e4661){console['error'](_0x1e4661);});}_0x109cf7();}},'charset':_0x9c56('0x1e'),'collate':_0x9c56('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 390b13a..b5fba1c 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 _0xef0f=['code','message','result','catch','CreateMailMessage','create','options','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c9f3e,_0x1ae545){var _0x31867e=function(_0x4b51dd){while(--_0x4b51dd){_0x2c9f3e['push'](_0x2c9f3e['shift']());}};_0x31867e(++_0x1ae545);}(_0xef0f,0x168));var _0xfef0=function(_0x572b30,_0x11aafd){_0x572b30=_0x572b30-0x0;var _0x12478d=_0xef0f[_0x572b30];return _0x12478d;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}exports[_0xfef0('0x1c')]=function(_0x4e24de){var _0x20826b=this;return new Promise(function(_0x1a0aa0,_0x28dee1){return db['MailMessage'][_0xfef0('0x1d')](_0x4e24de['body'],{'raw':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b8b22){logger[_0xfef0('0x12')]('CreateMailMessage',_0x4e24de);logger[_0xfef0('0x1f')](_0xfef0('0x1c'),_0x4e24de,JSON[_0xfef0('0x16')](_0x4b8b22));_0x1a0aa0(_0x4b8b22);})[_0xfef0('0x1b')](function(_0x249fe4){logger[_0xfef0('0x17')]('CreateMailMessage',_0x249fe4['message'],_0x4e24de);_0x28dee1(_0x20826b[_0xfef0('0x17')](0x1f4,_0x249fe4[_0xfef0('0x19')]));});});}; \ No newline at end of file +var _0x6cb4=['result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cb4,0xff));var _0x46cb=function(_0x2ab000,_0x184778){_0x2ab000=_0x2ab000-0x0;var _0x505991=_0x6cb4[_0x2ab000];return _0x505991;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});config[_0x46cb('0xb')]=_[_0x46cb('0xc')](config[_0x46cb('0xb')],{'host':_0x46cb('0xd'),'port':0x18eb});var socket=require(_0x46cb('0xe'))(new Redis(config[_0x46cb('0xb')]));require('./mailMessage.socket')[_0x46cb('0xf')](socket);function respondWithRpcPromise(_0x34f9e9,_0x48101c,_0x206f10){return new BPromise(function(_0x106a87,_0x4a60b2){return client[_0x46cb('0x10')](_0x34f9e9,_0x206f10)[_0x46cb('0x11')](function(_0x570cfd){logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,_0x46cb('0x12'));logger[_0x46cb('0x13')](_0x46cb('0x14'),_0x48101c,_0x46cb('0x12'),JSON['stringify'](_0x570cfd));if(_0x570cfd[_0x46cb('0x15')]){if(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x16')]===0x1f4){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);return _0x4a60b2(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);}logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd['error'][_0x46cb('0x18')]);return _0x106a87(_0x570cfd['error'][_0x46cb('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,'request\x20sent');_0x106a87(_0x570cfd[_0x46cb('0x19')][_0x46cb('0x18')]);}})[_0x46cb('0x1a')](function(_0xcc8e2){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0xcc8e2);_0x4a60b2(_0xcc8e2);});});}exports[_0x46cb('0x1b')]=function(_0x32e9fe){var _0x90cd50=this;return new Promise(function(_0xfc9064,_0x149483){return db[_0x46cb('0x1c')][_0x46cb('0x1d')](_0x32e9fe[_0x46cb('0x1e')],{'raw':_0x32e9fe[_0x46cb('0x1f')]?_0x32e9fe[_0x46cb('0x1f')][_0x46cb('0x20')]===undefined?!![]:![]:!![]})[_0x46cb('0x11')](function(_0x41ecd2){logger[_0x46cb('0x21')](_0x46cb('0x1b'),_0x32e9fe);logger[_0x46cb('0x13')](_0x46cb('0x1b'),_0x32e9fe,JSON[_0x46cb('0x22')](_0x41ecd2));_0xfc9064(_0x41ecd2);})[_0x46cb('0x1a')](function(_0x5a1338){logger['error'](_0x46cb('0x1b'),_0x5a1338[_0x46cb('0x18')],_0x32e9fe);_0x149483(_0x90cd50[_0x46cb('0x15')](0x1f4,_0x5a1338[_0x46cb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 78b41a8..5039e1e 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 _0xad7c=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x2f3c2b,_0x5c96b2){var _0x509a62=function(_0x159102){while(--_0x159102){_0x2f3c2b['push'](_0x2f3c2b['shift']());}};_0x509a62(++_0x5c96b2);}(_0xad7c,0x8c));var _0xcad7=function(_0x17704e,_0x1f0c49){_0x17704e=_0x17704e-0x0;var _0x3d9986=_0xad7c[_0x17704e];return _0x3d9986;};'use strict';var MailMessageEvents=require(_0xcad7('0x0'));var events=[_0xcad7('0x1'),_0xcad7('0x2'),_0xcad7('0x3')];function createListener(_0x14bae9,_0x4aee90){return function(_0x3adb36){_0x4aee90[_0xcad7('0x4')](_0x14bae9,_0x3adb36);};}function removeListener(_0x1feec8,_0x1596e9){return function(){MailMessageEvents[_0xcad7('0x5')](_0x1feec8,_0x1596e9);};}exports[_0xcad7('0x6')]=function(_0x4249be){for(var _0x5a546c=0x0,_0xf9b48e=events[_0xcad7('0x7')];_0x5a546c<_0xf9b48e;_0x5a546c++){var _0x483fa0=events[_0x5a546c];var _0x1575a3=createListener(_0xcad7('0x8')+_0x483fa0,_0x4249be);MailMessageEvents['on'](_0x483fa0,_0x1575a3);}}; \ No newline at end of file +var _0xadb5=['save','remove','update','emit','removeListener','mailMessage:','./mailMessage.events'];(function(_0x899a7b,_0x47f3fe){var _0x501574=function(_0x721be2){while(--_0x721be2){_0x899a7b['push'](_0x899a7b['shift']());}};_0x501574(++_0x47f3fe);}(_0xadb5,0x8b));var _0x5adb=function(_0x18fa0a,_0x29378a){_0x18fa0a=_0x18fa0a-0x0;var _0x106055=_0xadb5[_0x18fa0a];return _0x106055;};'use strict';var MailMessageEvents=require(_0x5adb('0x0'));var events=[_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3')];function createListener(_0x136bb6,_0x77cb14){return function(_0x1a807e){_0x77cb14[_0x5adb('0x4')](_0x136bb6,_0x1a807e);};}function removeListener(_0x5c223a,_0xae4f1d){return function(){MailMessageEvents[_0x5adb('0x5')](_0x5c223a,_0xae4f1d);};}exports['register']=function(_0x11d858){for(var _0x23efff=0x0,_0x4bc948=events['length'];_0x23efff<_0x4bc948;_0x23efff++){var _0x4a2e71=events[_0x23efff];var _0x3e2a1a=createListener(_0x5adb('0x6')+_0x4a2e71,_0x11d858);MailMessageEvents['on'](_0x4a2e71,_0x3e2a1a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 084605c..fffe1bf 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 _0xf01a=['../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','getMembers','/:id/users','getAgents','post','/:id/teams','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x1c3298,_0x181991){var _0x3ca1c5=function(_0x14c537){while(--_0x14c537){_0x1c3298['push'](_0x1c3298['shift']());}};_0x3ca1c5(++_0x181991);}(_0xf01a,0x140));var _0xaf01=function(_0x435b27,_0x2b755c){_0x435b27=_0x435b27-0x0;var _0x34636c=_0xf01a[_0x435b27];return _0x34636c;};'use strict';var multer=require('multer');var util=require(_0xaf01('0x0'));var path=require(_0xaf01('0x1'));var timeout=require(_0xaf01('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xaf01('0x3'));var auth=require(_0xaf01('0x4'));var interaction=require(_0xaf01('0x5'));var config=require('../../config/environment');var controller=require(_0xaf01('0x6'));router[_0xaf01('0x7')]('/',auth[_0xaf01('0x8')](),controller['index']);router[_0xaf01('0x7')](_0xaf01('0x9'),auth[_0xaf01('0x8')](),controller[_0xaf01('0xa')]);router[_0xaf01('0x7')](_0xaf01('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth[_0xaf01('0x8')](),controller[_0xaf01('0xc')]);router[_0xaf01('0x7')]('/:id/teams',auth[_0xaf01('0x8')](),controller['getTeams']);router['get'](_0xaf01('0xd'),auth[_0xaf01('0x8')](),controller[_0xaf01('0xe')]);router['post']('/',auth[_0xaf01('0x8')](),controller['create']);router[_0xaf01('0xf')](_0xaf01('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0xaf01('0xf')]('/:id/users',auth[_0xaf01('0x8')](),controller[_0xaf01('0x11')]);router[_0xaf01('0x12')](_0xaf01('0xb'),auth['isAuthenticated'](),controller[_0xaf01('0x13')]);router['delete'](_0xaf01('0xb'),auth[_0xaf01('0x8')](),controller[_0xaf01('0x14')]);router['delete'](_0xaf01('0x10'),auth[_0xaf01('0x8')](),controller[_0xaf01('0x15')]);router[_0xaf01('0x16')](_0xaf01('0xd'),auth[_0xaf01('0x8')](),controller[_0xaf01('0x17')]);module[_0xaf01('0x18')]=router; \ No newline at end of file +var _0x432c=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','update','delete','destroy','removeTeams'];(function(_0x172a34,_0x587d42){var _0x5d2b80=function(_0x3fa9e3){while(--_0x3fa9e3){_0x172a34['push'](_0x172a34['shift']());}};_0x5d2b80(++_0x587d42);}(_0x432c,0x9d));var _0xc432=function(_0x405ff2,_0x1d189a){_0x405ff2=_0x405ff2-0x0;var _0x181adc=_0x432c[_0x405ff2];return _0x181adc;};'use strict';var multer=require(_0xc432('0x0'));var util=require(_0xc432('0x1'));var path=require('path');var timeout=require(_0xc432('0x2'));var express=require(_0xc432('0x3'));var router=express[_0xc432('0x4')]();var fs_extra=require(_0xc432('0x5'));var auth=require(_0xc432('0x6'));var interaction=require(_0xc432('0x7'));var config=require(_0xc432('0x8'));var controller=require(_0xc432('0x9'));router[_0xc432('0xa')]('/',auth[_0xc432('0xb')](),controller['index']);router[_0xc432('0xa')](_0xc432('0xc'),auth['isAuthenticated'](),controller[_0xc432('0xd')]);router[_0xc432('0xa')](_0xc432('0xe'),auth[_0xc432('0xb')](),controller['show']);router[_0xc432('0xa')]('/:id/members',auth[_0xc432('0xb')](),controller['getMembers']);router[_0xc432('0xa')](_0xc432('0xf'),auth['isAuthenticated'](),controller[_0xc432('0x10')]);router[_0xc432('0xa')]('/:id/users',auth[_0xc432('0xb')](),controller[_0xc432('0x11')]);router['post']('/',auth[_0xc432('0xb')](),controller['create']);router[_0xc432('0x12')]('/:id/teams',auth[_0xc432('0xb')](),controller[_0xc432('0x13')]);router[_0xc432('0x12')](_0xc432('0x14'),auth[_0xc432('0xb')](),controller['addAgents']);router['put'](_0xc432('0xe'),auth['isAuthenticated'](),controller[_0xc432('0x15')]);router[_0xc432('0x16')](_0xc432('0xe'),auth['isAuthenticated'](),controller[_0xc432('0x17')]);router['delete']('/:id/teams',auth[_0xc432('0xb')](),controller[_0xc432('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc432('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 5faa1eb..03248f4 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 _0x5a47=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3ce1bc,_0x32b473){var _0x1065ca=function(_0x15659f){while(--_0x15659f){_0x3ce1bc['push'](_0x3ce1bc['shift']());}};_0x1065ca(++_0x32b473);}(_0x5a47,0x198));var _0x75a4=function(_0x250556,_0x3e65e5){_0x250556=_0x250556-0x0;var _0x3b0716=_0x5a47[_0x250556];return _0x3b0716;};'use strict';var Sequelize=require(_0x75a4('0x0'));module[_0x75a4('0x1')]={'name':{'type':Sequelize[_0x75a4('0x2')],'unique':_0x75a4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x75a4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x75a4('0x5')](_0x75a4('0x6'),_0x75a4('0x7'),_0x75a4('0x8'))}}; \ No newline at end of file +var _0x3026=['INTEGER','ENUM','rrmemory','beepall','exports','STRING'];(function(_0xb5d0bf,_0x38bc12){var _0x246cca=function(_0x115679){while(--_0x115679){_0xb5d0bf['push'](_0xb5d0bf['shift']());}};_0x246cca(++_0x38bc12);}(_0x3026,0xe8));var _0x6302=function(_0x5ea9e1,_0x27b1e9){_0x5ea9e1=_0x5ea9e1-0x0;var _0x5a2e4c=_0x3026[_0x5ea9e1];return _0x5a2e4c;};'use strict';var Sequelize=require('sequelize');module[_0x6302('0x0')]={'name':{'type':Sequelize[_0x6302('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6302('0x1')]},'timeout':{'type':Sequelize[_0x6302('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6302('0x3')](_0x6302('0x4'),_0x6302('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 9519a22..48a7a54 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 _0x0662=['VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','voicePause','interface','transaction','addTeams','each','UserMailQueue','forEach','userMailQueue:save','removeTeams','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','removeAgents','emit','addAgents','omit','isArray','userMailQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','get','MailQueues','destroy','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type'];(function(_0x2bcd00,_0x599435){var _0x571611=function(_0x524b20){while(--_0x524b20){_0x2bcd00['push'](_0x2bcd00['shift']());}};_0x571611(++_0x599435);}(_0x0662,0x175));var _0x2066=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0662[_0x618414];return _0x21c19a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2066('0x0'));var zipdir=require(_0x2066('0x1'));var jsonpatch=require(_0x2066('0x2'));var rp=require(_0x2066('0x3'));var moment=require('moment');var BPromise=require(_0x2066('0x4'));var Mustache=require(_0x2066('0x5'));var util=require(_0x2066('0x6'));var path=require(_0x2066('0x7'));var sox=require(_0x2066('0x8'));var csv=require(_0x2066('0x9'));var ejs=require(_0x2066('0xa'));var fs=require('fs');var fs_extra=require(_0x2066('0xb'));var _=require(_0x2066('0xc'));var squel=require(_0x2066('0xd'));var crypto=require(_0x2066('0xe'));var jsforce=require(_0x2066('0xf'));var deskjs=require(_0x2066('0x10'));var toCsv=require(_0x2066('0x9'));var querystring=require(_0x2066('0x11'));var Papa=require(_0x2066('0x12'));var Redis=require(_0x2066('0x13'));var authService=require(_0x2066('0x14'));var qs=require(_0x2066('0x15'));var as=require(_0x2066('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2066('0x17'))(_0x2066('0x18'));var utils=require(_0x2066('0x19'));var config=require(_0x2066('0x1a'));var licenseUtil=require(_0x2066('0x1b'));var db=require(_0x2066('0x1c'))['db'];config[_0x2066('0x1d')]=_[_0x2066('0x1e')](config[_0x2066('0x1d')],{'host':_0x2066('0x1f'),'port':0x18eb});var socket=require(_0x2066('0x20'))(new Redis(config[_0x2066('0x1d')]));require(_0x2066('0x21'))[_0x2066('0x22')](socket);function respondWithStatusCode(_0xb2f61d,_0x279782){_0x279782=_0x279782||0xcc;return function(_0x4da66e){if(_0x4da66e){return _0xb2f61d['sendStatus'](_0x279782);}return _0xb2f61d[_0x2066('0x23')](_0x279782)[_0x2066('0x24')]();};}function respondWithResult(_0x469c67,_0x5b35ee){_0x5b35ee=_0x5b35ee||0xc8;return function(_0x5cec05){if(_0x5cec05){return _0x469c67[_0x2066('0x23')](_0x5b35ee)[_0x2066('0x25')](_0x5cec05);}};}function respondWithFilteredResult(_0x16a916,_0x28109a){return function(_0x2aa9ea){if(_0x2aa9ea){var _0x129813=typeof _0x28109a[_0x2066('0x26')]===_0x2066('0x27')&&typeof _0x28109a['limit']==='undefined';var _0x542323=_0x2aa9ea[_0x2066('0x28')];var _0x4d1c20=_0x129813?0x0:_0x28109a[_0x2066('0x26')];var _0x5ee833=_0x129813?_0x2aa9ea['count']:_0x28109a['offset']+_0x28109a['limit'];var _0x568a6b;if(_0x5ee833>=_0x542323){_0x5ee833=_0x542323;_0x568a6b=0xc8;}else{_0x568a6b=0xce;}_0x16a916[_0x2066('0x23')](_0x568a6b);return _0x16a916['set'](_0x2066('0x29'),_0x4d1c20+'-'+_0x5ee833+'/'+_0x542323)[_0x2066('0x25')](_0x2aa9ea);}return null;};}function patchUpdates(_0x214f5d){return function(_0x10512d){try{jsonpatch[_0x2066('0x2a')](_0x10512d,_0x214f5d,!![]);}catch(_0x1f0d49){return BPromise[_0x2066('0x2b')](_0x1f0d49);}return _0x10512d['save']();};}function saveUpdates(_0x807bf4,_0x282ca3){return function(_0x342d1d){if(_0x342d1d){return _0x342d1d[_0x2066('0x2c')](_0x807bf4)[_0x2066('0x2d')](function(_0x17cbd7){return _0x17cbd7;});}return null;};}function removeEntity(_0x5c361c,_0x5ceb79){return function(_0x33351c){if(_0x33351c){return _0x33351c['destroy']()[_0x2066('0x2d')](function(){var _0xe1e656=_0x33351c[_0x2066('0x2e')]({'plain':!![]});var _0x60b7aa=_0x2066('0x2f');return db['UserProfileResource'][_0x2066('0x30')]({'where':{'type':_0x60b7aa,'resourceId':_0xe1e656['id']}})['then'](function(){return _0x33351c;});})[_0x2066('0x2d')](function(){_0x5c361c['status'](0xcc)[_0x2066('0x24')]();});}};}function handleEntityNotFound(_0x4de5d7,_0x1e7e20){return function(_0x2fdd8a){if(!_0x2fdd8a){_0x4de5d7[_0x2066('0x31')](0x194);}return _0x2fdd8a;};}function handleError(_0x4a6b83,_0x32563b){_0x32563b=_0x32563b||0x1f4;return function(_0x2c1b2a){logger[_0x2066('0x32')](_0x2c1b2a[_0x2066('0x33')]);if(_0x2c1b2a[_0x2066('0x34')]){delete _0x2c1b2a[_0x2066('0x34')];}_0x4a6b83[_0x2066('0x23')](_0x32563b)[_0x2066('0x35')](_0x2c1b2a);};}exports[_0x2066('0x36')]=function(_0x2e0bfb,_0x57370c){var _0x50d222={},_0x160149={},_0x4a63c6={'count':0x0,'rows':[]};var _0x4b543a=_['map'](db[_0x2066('0x37')][_0x2066('0x38')],function(_0x23f418){return{'name':_0x23f418[_0x2066('0x39')],'type':_0x23f418['type'][_0x2066('0x3a')]};});_0x160149['model']=_['map'](_0x4b543a,_0x2066('0x34'));_0x160149['query']=_[_0x2066('0x3b')](_0x2e0bfb[_0x2066('0x3c')]);_0x160149[_0x2066('0x3d')]=_[_0x2066('0x3e')](_0x160149[_0x2066('0x3f')],_0x160149[_0x2066('0x3c')]);_0x50d222['attributes']=_[_0x2066('0x3e')](_0x160149[_0x2066('0x3f')],qs['fields'](_0x2e0bfb[_0x2066('0x3c')]['fields']));_0x50d222[_0x2066('0x40')]=_0x50d222[_0x2066('0x40')][_0x2066('0x41')]?_0x50d222[_0x2066('0x40')]:_0x160149['model'];if(!_0x2e0bfb[_0x2066('0x3c')][_0x2066('0x42')](_0x2066('0x43'))){_0x50d222[_0x2066('0x44')]=qs[_0x2066('0x44')](_0x2e0bfb[_0x2066('0x3c')][_0x2066('0x44')]);_0x50d222[_0x2066('0x26')]=qs[_0x2066('0x26')](_0x2e0bfb[_0x2066('0x3c')][_0x2066('0x26')]);}_0x50d222[_0x2066('0x45')]=qs[_0x2066('0x46')](_0x2e0bfb[_0x2066('0x3c')][_0x2066('0x46')]);_0x50d222[_0x2066('0x47')]=qs[_0x2066('0x3d')](_[_0x2066('0x48')](_0x2e0bfb[_0x2066('0x3c')],_0x160149[_0x2066('0x3d')]),_0x4b543a);if(_0x2e0bfb['query'][_0x2066('0x49')]){_0x50d222[_0x2066('0x47')]=_[_0x2066('0x4a')](_0x50d222['where'],{'$or':_[_0x2066('0x4b')](_0x4b543a,function(_0x584299){if(_0x584299[_0x2066('0x4c')]!==_0x2066('0x4d')){var _0x4c38ef={};_0x4c38ef[_0x584299[_0x2066('0x34')]]={'$like':'%'+_0x2e0bfb[_0x2066('0x3c')][_0x2066('0x49')]+'%'};return _0x4c38ef;}})});}_0x50d222=_[_0x2066('0x4a')]({},_0x50d222,_0x2e0bfb[_0x2066('0x4e')]);var _0x18e939={'where':_0x50d222[_0x2066('0x47')]};return db['MailQueue']['count'](_0x18e939)[_0x2066('0x2d')](function(_0x5d1d94){_0x4a63c6[_0x2066('0x28')]=_0x5d1d94;if(_0x2e0bfb[_0x2066('0x3c')]['includeAll']){_0x50d222[_0x2066('0x4f')]=[{'all':!![]}];}return db[_0x2066('0x37')][_0x2066('0x50')](_0x50d222);})[_0x2066('0x2d')](function(_0x21d24a){_0x4a63c6[_0x2066('0x51')]=_0x21d24a;return _0x4a63c6;})[_0x2066('0x2d')](respondWithFilteredResult(_0x57370c,_0x50d222))[_0x2066('0x52')](handleError(_0x57370c,null));};exports[_0x2066('0x53')]=function(_0xad4b0e,_0x557e54){var _0x18f7e6={'raw':!![],'where':{'id':_0xad4b0e[_0x2066('0x54')]['id']}},_0x5ea4ca={};_0x5ea4ca[_0x2066('0x3f')]=_['keys'](db[_0x2066('0x37')][_0x2066('0x38')]);_0x5ea4ca[_0x2066('0x3c')]=_[_0x2066('0x3b')](_0xad4b0e[_0x2066('0x3c')]);_0x5ea4ca[_0x2066('0x3d')]=_[_0x2066('0x3e')](_0x5ea4ca[_0x2066('0x3f')],_0x5ea4ca[_0x2066('0x3c')]);_0x18f7e6[_0x2066('0x40')]=_[_0x2066('0x3e')](_0x5ea4ca['model'],qs[_0x2066('0x55')](_0xad4b0e[_0x2066('0x3c')][_0x2066('0x55')]));_0x18f7e6[_0x2066('0x40')]=_0x18f7e6['attributes']['length']?_0x18f7e6[_0x2066('0x40')]:_0x5ea4ca[_0x2066('0x3f')];if(_0xad4b0e[_0x2066('0x3c')][_0x2066('0x56')]){_0x18f7e6['include']=[{'all':!![]}];}_0x18f7e6=_[_0x2066('0x4a')]({},_0x18f7e6,_0xad4b0e[_0x2066('0x4e')]);return db['MailQueue'][_0x2066('0x57')](_0x18f7e6)[_0x2066('0x2d')](handleEntityNotFound(_0x557e54,null))[_0x2066('0x2d')](respondWithResult(_0x557e54,null))[_0x2066('0x52')](handleError(_0x557e54,null));};exports[_0x2066('0x58')]=function(_0x40d386,_0x1edf4a){return db['MailQueue'][_0x2066('0x58')](_0x40d386[_0x2066('0x59')],{})[_0x2066('0x2d')](function(_0x19f9ef){var _0x4c71f1=_0x40d386['user'][_0x2066('0x2e')]({'plain':!![]});if(!_0x4c71f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c71f1[_0x2066('0x5a')]===_0x2066('0x5b')){var _0x312355=_0x19f9ef[_0x2066('0x2e')]({'plain':!![]});var _0x297684='MailQueues';return db['UserProfileSection'][_0x2066('0x57')]({'where':{'name':_0x297684,'userProfileId':_0x4c71f1[_0x2066('0x5c')]},'raw':!![]})[_0x2066('0x2d')](function(_0x3dcdaf){if(_0x3dcdaf&&_0x3dcdaf[_0x2066('0x5d')]===0x0){return db[_0x2066('0x5e')][_0x2066('0x58')]({'name':_0x312355[_0x2066('0x34')],'resourceId':_0x312355['id'],'type':_0x3dcdaf['name'],'sectionId':_0x3dcdaf['id']},{})[_0x2066('0x2d')](function(){return _0x19f9ef;});}else{return _0x19f9ef;}})[_0x2066('0x52')](function(_0x155c69){logger[_0x2066('0x32')](_0x2066('0x5f'),_0x155c69);throw _0x155c69;});}return _0x19f9ef;})[_0x2066('0x2d')](respondWithResult(_0x1edf4a,0xc9))['catch'](handleError(_0x1edf4a,null));};exports[_0x2066('0x2c')]=function(_0x19cf9f,_0x4b84b3){if(_0x19cf9f['body']['id']){delete _0x19cf9f[_0x2066('0x59')]['id'];}return db['MailQueue'][_0x2066('0x57')]({'where':{'id':_0x19cf9f[_0x2066('0x54')]['id']}})[_0x2066('0x2d')](handleEntityNotFound(_0x4b84b3,null))['then'](saveUpdates(_0x19cf9f[_0x2066('0x59')],null))['then'](respondWithResult(_0x4b84b3,null))[_0x2066('0x52')](handleError(_0x4b84b3,null));};exports[_0x2066('0x30')]=function(_0x125ed3,_0x4c3de6){return db[_0x2066('0x37')][_0x2066('0x57')]({'where':{'id':_0x125ed3[_0x2066('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c3de6,null))[_0x2066('0x2d')](removeEntity(_0x4c3de6,null))[_0x2066('0x52')](handleError(_0x4c3de6,null));};exports[_0x2066('0x60')]=function(_0x2ab9b7,_0x3c043e){return db['MailQueue']['describe']()[_0x2066('0x2d')](respondWithResult(_0x3c043e,null))[_0x2066('0x52')](handleError(_0x3c043e,null));};exports[_0x2066('0x61')]=function(_0x37bb4d,_0x4936a9,_0x21c7a8){var _0x2a0a85={'raw':!![],'where':{}},_0x52ee4e={},_0x51db08;return db[_0x2066('0x37')][_0x2066('0x62')]({'where':{'id':_0x37bb4d['params']['id']}})[_0x2066('0x2d')](handleEntityNotFound(_0x4936a9,null))[_0x2066('0x2d')](function(_0x224161){if(_0x224161){_0x51db08=_0x224161[_0x2066('0x2e')]({'plain':!![]});_0x52ee4e['model']=_[_0x2066('0x3b')](db['UserMailQueue'][_0x2066('0x38')]);_0x52ee4e[_0x2066('0x3c')]=_[_0x2066('0x3b')](_0x37bb4d[_0x2066('0x3c')]);_0x52ee4e[_0x2066('0x3d')]=_[_0x2066('0x3e')](_0x52ee4e['model'],_0x52ee4e['query']);_0x2a0a85['attributes']=_[_0x2066('0x3e')](_0x52ee4e[_0x2066('0x3f')],qs[_0x2066('0x55')](_0x37bb4d[_0x2066('0x3c')][_0x2066('0x55')]));_0x2a0a85[_0x2066('0x40')]=_0x2a0a85[_0x2066('0x40')]['length']?_0x2a0a85[_0x2066('0x40')]:_0x52ee4e[_0x2066('0x3f')];if(!_0x37bb4d[_0x2066('0x3c')]['hasOwnProperty'](_0x2066('0x43'))){_0x2a0a85[_0x2066('0x44')]=qs['limit'](_0x37bb4d['query'][_0x2066('0x44')]);_0x2a0a85['offset']=qs[_0x2066('0x26')](_0x37bb4d[_0x2066('0x3c')]['offset']);}_0x2a0a85[_0x2066('0x45')]=qs['sort'](_0x37bb4d[_0x2066('0x3c')][_0x2066('0x46')]);_0x2a0a85[_0x2066('0x47')]=qs[_0x2066('0x3d')](_[_0x2066('0x48')](_0x37bb4d[_0x2066('0x3c')],_0x52ee4e[_0x2066('0x3d')]));_0x2a0a85[_0x2066('0x47')][_0x2066('0x63')]=_0x224161['id'];if(_0x37bb4d['query'][_0x2066('0x49')]){_0x2a0a85[_0x2066('0x47')]=_['merge'](_0x2a0a85[_0x2066('0x47')],{'$or':_[_0x2066('0x4b')](_0x2a0a85[_0x2066('0x40')],function(_0x2282c5){var _0x17da5d={};_0x17da5d[_0x2282c5]={'$like':'%'+_0x37bb4d[_0x2066('0x3c')][_0x2066('0x49')]+'%'};return _0x17da5d;})});}_0x2a0a85=_[_0x2066('0x4a')]({},_0x2a0a85,_0x37bb4d['options']);return db['UserMailQueue'][_0x2066('0x50')](_0x2a0a85);}})[_0x2066('0x2d')](function(_0x1ed4d5){if(_0x1ed4d5){return db[_0x2066('0x64')][_0x2066('0x65')]({'where':{'id':_['map'](_0x1ed4d5,'UserId'),'role':_0x2066('0x66')},'attributes':['id',_0x2066('0x34'),_0x2066('0x67'),_0x2066('0x68'),'createdAt']});}})[_0x2066('0x2d')](function(_0x3e06b5){if(_0x3e06b5){return{'count':_0x3e06b5['count'],'rows':_[_0x2066('0x4b')](_0x3e06b5[_0x2066('0x51')],function(_0x4a9e98){return{'membername':_0x4a9e98[_0x2066('0x34')],'UserId':_0x4a9e98['id'],'queue_name':_0x51db08[_0x2066('0x34')],'MailQueueId':_0x51db08['id'],'interface':util[_0x2066('0x69')](_0x2066('0x6a'),_0x2066('0x6b'),_0x4a9e98[_0x2066('0x34')]),'penalty':0x0,'paused':_0x4a9e98[_0x2066('0x67')],'createdAt':_0x4a9e98[_0x2066('0x6c')],'updatedAt':_0x4a9e98['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2066('0x2d')](respondWithFilteredResult(_0x4936a9,_0x2a0a85))[_0x2066('0x52')](handleError(_0x4936a9,null));};exports[_0x2066('0x6d')]=function(_0x4e4515,_0x21104e,_0x31f35a){var _0xfcb0bf={};var _0x3d963c={};var _0xba00fc;var _0x4d8df2;return db[_0x2066('0x37')][_0x2066('0x62')]({'where':{'id':_0x4e4515[_0x2066('0x54')]['id']}})[_0x2066('0x2d')](handleEntityNotFound(_0x21104e,null))[_0x2066('0x2d')](function(_0x4b9a9d){if(_0x4b9a9d){_0xba00fc=_0x4b9a9d;_0x3d963c['model']=_[_0x2066('0x3b')](db[_0x2066('0x6e')][_0x2066('0x38')]);_0x3d963c[_0x2066('0x3c')]=_[_0x2066('0x3b')](_0x4e4515[_0x2066('0x3c')]);_0x3d963c['filters']=_[_0x2066('0x3e')](_0x3d963c['model'],_0x3d963c[_0x2066('0x3c')]);_0xfcb0bf[_0x2066('0x40')]=_['intersection'](_0x3d963c[_0x2066('0x3f')],qs['fields'](_0x4e4515[_0x2066('0x3c')]['fields']));_0xfcb0bf[_0x2066('0x40')]=_0xfcb0bf[_0x2066('0x40')][_0x2066('0x41')]?_0xfcb0bf[_0x2066('0x40')]:_0x3d963c['model'];_0xfcb0bf[_0x2066('0x45')]=qs[_0x2066('0x46')](_0x4e4515[_0x2066('0x3c')][_0x2066('0x46')]);_0xfcb0bf['where']=qs['filters'](_[_0x2066('0x48')](_0x4e4515['query'],_0x3d963c['filters']));if(_0x4e4515[_0x2066('0x3c')]['filter']){_0xfcb0bf['where']=_[_0x2066('0x4a')](_0xfcb0bf[_0x2066('0x47')],{'$or':_['map'](_0xfcb0bf[_0x2066('0x40')],function(_0x4da12c){var _0x41a83b={};_0x41a83b[_0x4da12c]={'$like':'%'+_0x4e4515[_0x2066('0x3c')][_0x2066('0x49')]+'%'};return _0x41a83b;})});}_0xfcb0bf=_[_0x2066('0x4a')]({},_0xfcb0bf,_0x4e4515[_0x2066('0x4e')]);return _0xba00fc['getTeams'](_0xfcb0bf);}})[_0x2066('0x2d')](function(_0x163c84){if(_0x163c84){_0x4d8df2=_0x163c84[_0x2066('0x41')];if(!_0x4e4515[_0x2066('0x3c')][_0x2066('0x42')](_0x2066('0x43'))){_0xfcb0bf[_0x2066('0x44')]=qs[_0x2066('0x44')](_0x4e4515[_0x2066('0x3c')][_0x2066('0x44')]);_0xfcb0bf['offset']=qs['offset'](_0x4e4515[_0x2066('0x3c')][_0x2066('0x26')]);}return _0xba00fc[_0x2066('0x6d')](_0xfcb0bf);}})[_0x2066('0x2d')](function(_0x4d5e53){if(_0x4d5e53){return _0x4d5e53?{'count':_0x4d8df2,'rows':_0x4d5e53}:null;}})[_0x2066('0x2d')](respondWithResult(_0x21104e,null))[_0x2066('0x52')](handleError(_0x21104e,null));};exports['addTeams']=function(_0x21e4f5,_0x37251,_0x43f7bd){var _0x5f13b3=_0x21e4f5['body'][_0x2066('0x6f')];return db['Team'][_0x2066('0x50')]({'where':{'id':_0x5f13b3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2066('0x70'),'attributes':['id','name','online',_0x2066('0x71'),_0x2066('0x72')],'raw':!![]}]})[_0x2066('0x2d')](function(_0x5f2bed){if(_0x5f2bed){var _0x528c71=_['flatMap'](_0x5f2bed,function(_0x2ea98e){var _0x4b5293=_0x2ea98e['get']({'plain':!![]});return _0x4b5293[_0x2066('0x70')];});return db[_0x2066('0x37')]['find']({'where':{'id':_0x21e4f5[_0x2066('0x54')]['id']}})[_0x2066('0x2d')](function(_0x1c04c5){return db['sequelize'][_0x2066('0x73')](function(_0x145df3){return _0x1c04c5[_0x2066('0x74')](_0x5f13b3,{'transaction':_0x145df3})[_0x2066('0x2d')](function(){return BPromise[_0x2066('0x75')](_0x528c71,function(_0x4204c6){return db[_0x2066('0x76')]['findOrCreate']({'where':{'UserId':_0x4204c6['id'],'MailQueueId':_0x21e4f5[_0x2066('0x54')]['id']},'transaction':_0x145df3});});})['then'](function(){_0x528c71[_0x2066('0x77')](function(_0x3e089e){socket['emit'](_0x2066('0x78'),{'UserId':_0x3e089e['id'],'MailQueueId':_0x1c04c5['id']});});});});});}})[_0x2066('0x2d')](respondWithStatusCode(_0x37251,null))['catch'](handleError(_0x37251,null));};exports[_0x2066('0x79')]=function(_0x48210b,_0x166eb4,_0x51f560){return db['Team']['findAll']({'where':{'id':_0x48210b[_0x2066('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2066('0x64')],'as':_0x2066('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x166eb4,null))[_0x2066('0x2d')](function(_0x3ac595){var _0xb9e449=_[_0x2066('0x4b')](_0x3ac595,'id');var _0x5c4471=[];var _0x52e394=[];var _0x62c5de=squel[_0x2066('0x7a')]();_0x62c5de['field'](_0x2066('0x7b'))[_0x2066('0x7c')](_0x2066('0x7d'),'tq')[_0x2066('0x7e')](_0x2066('0x7f'),'ut',_0x2066('0x80'))[_0x2066('0x47')](_0x2066('0x81'),_0x48210b['params']['id']);for(var _0x691676=0x0;_0x691676<_0x3ac595[_0x2066('0x41')];_0x691676+=0x1){let _0x1374d6=_0x3ac595[_0x691676];for(var _0x2ce643=0x0;_0x2ce643<_0x1374d6[_0x2066('0x70')]['length'];_0x2ce643+=0x1){let _0x412163=_0x1374d6['Agents'][_0x2ce643];var _0x13b1e9=_0x62c5de[_0x2066('0x82')]();_0x13b1e9[_0x2066('0x47')](_0x2066('0x83'),_0x412163['id']);_0x52e394[_0x2066('0x84')](db['sequelize']['query'](_0x13b1e9[_0x2066('0x85')](),{'type':db[_0x2066('0x86')][_0x2066('0x87')][_0x2066('0x88')]})[_0x2066('0x2d')](function(_0x30c643){if(_0x30c643[_0x2066('0x41')]===0x1){return _0x412163['id'];}else{var _0x2683a9=_['every'](_['map'](_0x30c643,_0x2066('0x89')),function(_0x1c316c){return _[_0x2066('0x8a')](_0xb9e449,_0x1c316c);});if(_0x2683a9){return _0x412163['id'];}}}));}}return BPromise[_0x2066('0x8b')](_0x52e394)['then'](function(_0x59c20a){_0x5c4471=_(_0x5c4471)[_0x2066('0x8c')](_0x59c20a)[_0x2066('0x8d')]()['value']();return db[_0x2066('0x37')][_0x2066('0x57')]({'where':{'id':_0x48210b[_0x2066('0x54')]['id']}})[_0x2066('0x2d')](function(_0x521625){return db['sequelize'][_0x2066('0x73')](function(_0x311ecf){return _0x521625[_0x2066('0x79')](_0x48210b[_0x2066('0x3c')]['ids'],{'transaction':_0x311ecf})[_0x2066('0x2d')](function(){if(!_[_0x2066('0x8e')](_0x5c4471)){return _0x521625[_0x2066('0x8f')](_0x5c4471,{'transaction':_0x311ecf});}})['then'](function(){_0x5c4471[_0x2066('0x77')](function(_0x3effdc){socket[_0x2066('0x90')]('userMailQueue:remove',{'UserId':_0x3effdc,'MailQueueId':_0x521625['id']});});});});});});})[_0x2066('0x2d')](respondWithStatusCode(_0x166eb4,null))[_0x2066('0x52')](handleError(_0x166eb4,null));};exports[_0x2066('0x91')]=function(_0x5cb237,_0x15c9e0,_0x41e118){return db[_0x2066('0x37')][_0x2066('0x57')]({'where':{'id':_0x5cb237[_0x2066('0x54')]['id']}})[_0x2066('0x2d')](handleEntityNotFound(_0x15c9e0,null))['then'](function(_0x3e2c12){if(_0x3e2c12){return _0x3e2c12[_0x2066('0x91')](_0x5cb237[_0x2066('0x59')][_0x2066('0x6f')],_[_0x2066('0x92')](_0x5cb237['body'],[_0x2066('0x6f'),'id'])||{})['spread'](function(_0x1a0ecb){for(var _0xe733e1=0x0;_0xe733e1<_0x5cb237[_0x2066('0x59')][_0x2066('0x6f')][_0x2066('0x41')];_0xe733e1+=0x1){socket['emit'](_0x2066('0x78'),{'UserId':Number(_0x5cb237[_0x2066('0x59')]['ids'][_0xe733e1]),'MailQueueId':Number(_0x5cb237['params']['id'])});}return _0x1a0ecb;});}})[_0x2066('0x2d')](respondWithResult(_0x15c9e0,null))[_0x2066('0x52')](handleError(_0x15c9e0,null));};exports[_0x2066('0x8f')]=function(_0x52d5a4,_0x12ecc9,_0x4b8735){return db['MailQueue'][_0x2066('0x57')]({'where':{'id':_0x52d5a4[_0x2066('0x54')]['id']}})['then'](handleEntityNotFound(_0x12ecc9,null))['then'](function(_0x2c5411){if(_0x2c5411){return _0x2c5411[_0x2066('0x8f')](_0x52d5a4['query'][_0x2066('0x6f')])[_0x2066('0x2d')](function(){if(_[_0x2066('0x93')](_0x52d5a4[_0x2066('0x3c')]['ids'])){for(var _0x8aa93=0x0;_0x8aa93<_0x52d5a4[_0x2066('0x3c')]['ids'][_0x2066('0x41')];_0x8aa93+=0x1){socket[_0x2066('0x90')](_0x2066('0x94'),{'UserId':Number(_0x52d5a4['query'][_0x2066('0x6f')][_0x8aa93]),'MailQueueId':Number(_0x52d5a4[_0x2066('0x54')]['id'])});}}else{socket[_0x2066('0x90')](_0x2066('0x94'),{'UserId':Number(_0x52d5a4[_0x2066('0x3c')][_0x2066('0x6f')]),'MailQueueId':Number(_0x52d5a4[_0x2066('0x54')]['id'])});}});}})[_0x2066('0x2d')](respondWithStatusCode(_0x12ecc9,null))[_0x2066('0x52')](handleError(_0x12ecc9,null));};exports[_0x2066('0x95')]=function(_0x38946d,_0x55e299,_0x3f1f3d){var _0x17d9ce={};var _0x1cb6a8={};var _0x11eefa;var _0x1b8c0b;return db[_0x2066('0x37')][_0x2066('0x62')]({'where':{'id':_0x38946d[_0x2066('0x54')]['id']}})[_0x2066('0x2d')](handleEntityNotFound(_0x55e299,null))[_0x2066('0x2d')](function(_0x5d0f54){if(_0x5d0f54){_0x11eefa=_0x5d0f54;_0x1cb6a8['model']=_[_0x2066('0x3b')](db['User']['rawAttributes']);_0x1cb6a8[_0x2066('0x3c')]=_[_0x2066('0x3b')](_0x38946d[_0x2066('0x3c')]);_0x1cb6a8['filters']=_[_0x2066('0x3e')](_0x1cb6a8[_0x2066('0x3f')],_0x1cb6a8[_0x2066('0x3c')]);_0x17d9ce[_0x2066('0x40')]=_[_0x2066('0x3e')](_0x1cb6a8[_0x2066('0x3f')],qs['fields'](_0x38946d[_0x2066('0x3c')][_0x2066('0x55')]));_0x17d9ce['attributes']=_0x17d9ce['attributes'][_0x2066('0x41')]?_0x17d9ce['attributes']:_0x1cb6a8['model'];_0x17d9ce[_0x2066('0x45')]=qs[_0x2066('0x46')](_0x38946d[_0x2066('0x3c')][_0x2066('0x46')]);_0x17d9ce[_0x2066('0x47')]=qs['filters'](_[_0x2066('0x48')](_0x38946d['query'],_0x1cb6a8[_0x2066('0x3d')]));if(_0x38946d[_0x2066('0x3c')][_0x2066('0x49')]){_0x17d9ce['where']=_[_0x2066('0x4a')](_0x17d9ce[_0x2066('0x47')],{'$or':_[_0x2066('0x4b')](_0x17d9ce[_0x2066('0x40')],function(_0x3deeb5){var _0x13806d={};_0x13806d[_0x3deeb5]={'$like':'%'+_0x38946d[_0x2066('0x3c')][_0x2066('0x49')]+'%'};return _0x13806d;})});}_0x17d9ce=_['merge']({},_0x17d9ce,_0x38946d['options']);return _0x11eefa[_0x2066('0x95')](_0x17d9ce);}})[_0x2066('0x2d')](function(_0x56edbe){if(_0x56edbe){_0x1b8c0b=_0x56edbe['length'];if(!_0x38946d[_0x2066('0x3c')][_0x2066('0x42')]('nolimit')){_0x17d9ce['limit']=qs[_0x2066('0x44')](_0x38946d[_0x2066('0x3c')][_0x2066('0x44')]);_0x17d9ce[_0x2066('0x26')]=qs[_0x2066('0x26')](_0x38946d[_0x2066('0x3c')][_0x2066('0x26')]);}return _0x11eefa[_0x2066('0x95')](_0x17d9ce);}})[_0x2066('0x2d')](function(_0x143e85){if(_0x143e85){return _0x143e85?{'count':_0x1b8c0b,'rows':_0x143e85}:null;}})['then'](respondWithResult(_0x55e299,null))['catch'](handleError(_0x55e299,null));}; \ No newline at end of file +var _0xaaf7=['defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','where','pick','VIRTUAL','filter','merge','options','MailQueue','includeAll','include','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','hasOwnProperty','sort','MailQueueId','User','findAndCountAll','mailPause','updatedAt','format','%s/%s','createdAt','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis'];(function(_0x3c3fee,_0x2c9db4){var _0x5a0477=function(_0x10f5df){while(--_0x10f5df){_0x3c3fee['push'](_0x3c3fee['shift']());}};_0x5a0477(++_0x2c9db4);}(_0xaaf7,0x79));var _0x7aaf=function(_0x4034ba,_0x56d675){_0x4034ba=_0x4034ba-0x0;var _0x435241=_0xaaf7[_0x4034ba];return _0x435241;};'use strict';var emlformat=require(_0x7aaf('0x0'));var rimraf=require(_0x7aaf('0x1'));var zipdir=require(_0x7aaf('0x2'));var jsonpatch=require(_0x7aaf('0x3'));var rp=require(_0x7aaf('0x4'));var moment=require(_0x7aaf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7aaf('0x6'));var util=require(_0x7aaf('0x7'));var path=require('path');var sox=require(_0x7aaf('0x8'));var csv=require(_0x7aaf('0x9'));var ejs=require(_0x7aaf('0xa'));var fs=require('fs');var fs_extra=require(_0x7aaf('0xb'));var _=require(_0x7aaf('0xc'));var squel=require(_0x7aaf('0xd'));var crypto=require(_0x7aaf('0xe'));var jsforce=require(_0x7aaf('0xf'));var deskjs=require(_0x7aaf('0x10'));var toCsv=require(_0x7aaf('0x9'));var querystring=require(_0x7aaf('0x11'));var Papa=require('papaparse');var Redis=require(_0x7aaf('0x12'));var authService=require(_0x7aaf('0x13'));var qs=require(_0x7aaf('0x14'));var as=require(_0x7aaf('0x15'));var hardwareService=require(_0x7aaf('0x16'));var logger=require(_0x7aaf('0x17'))(_0x7aaf('0x18'));var utils=require(_0x7aaf('0x19'));var config=require(_0x7aaf('0x1a'));var licenseUtil=require(_0x7aaf('0x1b'));var db=require('../../mysqldb')['db'];config[_0x7aaf('0x1c')]=_[_0x7aaf('0x1d')](config[_0x7aaf('0x1c')],{'host':_0x7aaf('0x1e'),'port':0x18eb});var socket=require(_0x7aaf('0x1f'))(new Redis(config[_0x7aaf('0x1c')]));require(_0x7aaf('0x20'))[_0x7aaf('0x21')](socket);function respondWithStatusCode(_0x525105,_0x30ec78){_0x30ec78=_0x30ec78||0xcc;return function(_0x455f14){if(_0x455f14){return _0x525105[_0x7aaf('0x22')](_0x30ec78);}return _0x525105[_0x7aaf('0x23')](_0x30ec78)[_0x7aaf('0x24')]();};}function respondWithResult(_0x51355b,_0x234949){_0x234949=_0x234949||0xc8;return function(_0x493e11){if(_0x493e11){return _0x51355b[_0x7aaf('0x23')](_0x234949)[_0x7aaf('0x25')](_0x493e11);}};}function respondWithFilteredResult(_0x54751d,_0x4e38b1){return function(_0x2f973){if(_0x2f973){var _0x25febf=typeof _0x4e38b1[_0x7aaf('0x26')]===_0x7aaf('0x27')&&typeof _0x4e38b1['limit']==='undefined';var _0x244e42=_0x2f973[_0x7aaf('0x28')];var _0x41f91e=_0x25febf?0x0:_0x4e38b1[_0x7aaf('0x26')];var _0xfdd2bd=_0x25febf?_0x2f973[_0x7aaf('0x28')]:_0x4e38b1['offset']+_0x4e38b1[_0x7aaf('0x29')];var _0x1dcbba;if(_0xfdd2bd>=_0x244e42){_0xfdd2bd=_0x244e42;_0x1dcbba=0xc8;}else{_0x1dcbba=0xce;}_0x54751d[_0x7aaf('0x23')](_0x1dcbba);return _0x54751d[_0x7aaf('0x2a')](_0x7aaf('0x2b'),_0x41f91e+'-'+_0xfdd2bd+'/'+_0x244e42)['json'](_0x2f973);}return null;};}function patchUpdates(_0x55d829){return function(_0xa4690b){try{jsonpatch[_0x7aaf('0x2c')](_0xa4690b,_0x55d829,!![]);}catch(_0x164b10){return BPromise[_0x7aaf('0x2d')](_0x164b10);}return _0xa4690b[_0x7aaf('0x2e')]();};}function saveUpdates(_0x26834e,_0x50238b){return function(_0x3d9387){if(_0x3d9387){return _0x3d9387[_0x7aaf('0x2f')](_0x26834e)[_0x7aaf('0x30')](function(_0x233fb7){return _0x233fb7;});}return null;};}function removeEntity(_0x3921e6,_0x3a43f7){return function(_0x2c6a6a){if(_0x2c6a6a){return _0x2c6a6a[_0x7aaf('0x31')]()['then'](function(){var _0x284677=_0x2c6a6a[_0x7aaf('0x32')]({'plain':!![]});var _0x49aa9e=_0x7aaf('0x33');return db['UserProfileResource'][_0x7aaf('0x31')]({'where':{'type':_0x49aa9e,'resourceId':_0x284677['id']}})[_0x7aaf('0x30')](function(){return _0x2c6a6a;});})[_0x7aaf('0x30')](function(){_0x3921e6[_0x7aaf('0x23')](0xcc)[_0x7aaf('0x24')]();});}};}function handleEntityNotFound(_0x596b9e,_0x3bb028){return function(_0x5ba6a4){if(!_0x5ba6a4){_0x596b9e[_0x7aaf('0x22')](0x194);}return _0x5ba6a4;};}function handleError(_0x2c2d83,_0x1ca719){_0x1ca719=_0x1ca719||0x1f4;return function(_0x2b7b27){logger['error'](_0x2b7b27[_0x7aaf('0x34')]);if(_0x2b7b27[_0x7aaf('0x35')]){delete _0x2b7b27['name'];}_0x2c2d83['status'](_0x1ca719)[_0x7aaf('0x36')](_0x2b7b27);};}exports[_0x7aaf('0x37')]=function(_0x536fcf,_0x1414ae){var _0x20728f={},_0x43c577={},_0x4c6969={'count':0x0,'rows':[]};var _0xb09c8=_[_0x7aaf('0x38')](db['MailQueue'][_0x7aaf('0x39')],function(_0x231f9f){return{'name':_0x231f9f[_0x7aaf('0x3a')],'type':_0x231f9f[_0x7aaf('0x3b')][_0x7aaf('0x3c')]};});_0x43c577['model']=_['map'](_0xb09c8,'name');_0x43c577[_0x7aaf('0x3d')]=_[_0x7aaf('0x3e')](_0x536fcf['query']);_0x43c577[_0x7aaf('0x3f')]=_['intersection'](_0x43c577[_0x7aaf('0x40')],_0x43c577['query']);_0x20728f[_0x7aaf('0x41')]=_[_0x7aaf('0x42')](_0x43c577[_0x7aaf('0x40')],qs[_0x7aaf('0x43')](_0x536fcf['query'][_0x7aaf('0x43')]));_0x20728f[_0x7aaf('0x41')]=_0x20728f[_0x7aaf('0x41')][_0x7aaf('0x44')]?_0x20728f['attributes']:_0x43c577['model'];if(!_0x536fcf[_0x7aaf('0x3d')]['hasOwnProperty'](_0x7aaf('0x45'))){_0x20728f[_0x7aaf('0x29')]=qs[_0x7aaf('0x29')](_0x536fcf['query'][_0x7aaf('0x29')]);_0x20728f[_0x7aaf('0x26')]=qs[_0x7aaf('0x26')](_0x536fcf[_0x7aaf('0x3d')][_0x7aaf('0x26')]);}_0x20728f[_0x7aaf('0x46')]=qs['sort'](_0x536fcf[_0x7aaf('0x3d')]['sort']);_0x20728f[_0x7aaf('0x47')]=qs['filters'](_[_0x7aaf('0x48')](_0x536fcf[_0x7aaf('0x3d')],_0x43c577[_0x7aaf('0x3f')]),_0xb09c8);if(_0x536fcf[_0x7aaf('0x3d')]['filter']){_0x20728f[_0x7aaf('0x47')]=_['merge'](_0x20728f[_0x7aaf('0x47')],{'$or':_['map'](_0xb09c8,function(_0x2f6e1f){if(_0x2f6e1f[_0x7aaf('0x3b')]!==_0x7aaf('0x49')){var _0x3c0afa={};_0x3c0afa[_0x2f6e1f[_0x7aaf('0x35')]]={'$like':'%'+_0x536fcf[_0x7aaf('0x3d')][_0x7aaf('0x4a')]+'%'};return _0x3c0afa;}})});}_0x20728f=_[_0x7aaf('0x4b')]({},_0x20728f,_0x536fcf[_0x7aaf('0x4c')]);var _0x17ee41={'where':_0x20728f[_0x7aaf('0x47')]};return db[_0x7aaf('0x4d')][_0x7aaf('0x28')](_0x17ee41)[_0x7aaf('0x30')](function(_0x42fb1c){_0x4c6969[_0x7aaf('0x28')]=_0x42fb1c;if(_0x536fcf[_0x7aaf('0x3d')][_0x7aaf('0x4e')]){_0x20728f[_0x7aaf('0x4f')]=[{'all':!![]}];}return db[_0x7aaf('0x4d')][_0x7aaf('0x50')](_0x20728f);})[_0x7aaf('0x30')](function(_0x36f757){_0x4c6969[_0x7aaf('0x51')]=_0x36f757;return _0x4c6969;})[_0x7aaf('0x30')](respondWithFilteredResult(_0x1414ae,_0x20728f))['catch'](handleError(_0x1414ae,null));};exports[_0x7aaf('0x52')]=function(_0x121710,_0x506c51){var _0x50cd10={'raw':!![],'where':{'id':_0x121710[_0x7aaf('0x53')]['id']}},_0x5a7cc9={};_0x5a7cc9[_0x7aaf('0x40')]=_['keys'](db[_0x7aaf('0x4d')][_0x7aaf('0x39')]);_0x5a7cc9[_0x7aaf('0x3d')]=_[_0x7aaf('0x3e')](_0x121710['query']);_0x5a7cc9[_0x7aaf('0x3f')]=_[_0x7aaf('0x42')](_0x5a7cc9[_0x7aaf('0x40')],_0x5a7cc9['query']);_0x50cd10['attributes']=_[_0x7aaf('0x42')](_0x5a7cc9[_0x7aaf('0x40')],qs[_0x7aaf('0x43')](_0x121710['query'][_0x7aaf('0x43')]));_0x50cd10[_0x7aaf('0x41')]=_0x50cd10[_0x7aaf('0x41')][_0x7aaf('0x44')]?_0x50cd10['attributes']:_0x5a7cc9[_0x7aaf('0x40')];if(_0x121710[_0x7aaf('0x3d')][_0x7aaf('0x4e')]){_0x50cd10['include']=[{'all':!![]}];}_0x50cd10=_[_0x7aaf('0x4b')]({},_0x50cd10,_0x121710['options']);return db[_0x7aaf('0x4d')][_0x7aaf('0x54')](_0x50cd10)[_0x7aaf('0x30')](handleEntityNotFound(_0x506c51,null))[_0x7aaf('0x30')](respondWithResult(_0x506c51,null))[_0x7aaf('0x55')](handleError(_0x506c51,null));};exports[_0x7aaf('0x56')]=function(_0x3ad1a5,_0xeec729){return db[_0x7aaf('0x4d')][_0x7aaf('0x56')](_0x3ad1a5[_0x7aaf('0x57')],{})['then'](function(_0x525e92){var _0x4beacd=_0x3ad1a5['user'][_0x7aaf('0x32')]({'plain':!![]});if(!_0x4beacd)throw new Error(_0x7aaf('0x58'));if(_0x4beacd['role']===_0x7aaf('0x59')){var _0x852c61=_0x525e92[_0x7aaf('0x32')]({'plain':!![]});var _0x58d73e=_0x7aaf('0x33');return db[_0x7aaf('0x5a')]['find']({'where':{'name':_0x58d73e,'userProfileId':_0x4beacd['userProfileId']},'raw':!![]})['then'](function(_0x3eabf6){if(_0x3eabf6&&_0x3eabf6[_0x7aaf('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x852c61[_0x7aaf('0x35')],'resourceId':_0x852c61['id'],'type':_0x3eabf6[_0x7aaf('0x35')],'sectionId':_0x3eabf6['id']},{})[_0x7aaf('0x30')](function(){return _0x525e92;});}else{return _0x525e92;}})['catch'](function(_0x2064a4){logger[_0x7aaf('0x5c')](_0x7aaf('0x5d'),_0x2064a4);throw _0x2064a4;});}return _0x525e92;})[_0x7aaf('0x30')](respondWithResult(_0xeec729,0xc9))[_0x7aaf('0x55')](handleError(_0xeec729,null));};exports[_0x7aaf('0x2f')]=function(_0x152aab,_0x321a22){if(_0x152aab['body']['id']){delete _0x152aab[_0x7aaf('0x57')]['id'];}return db[_0x7aaf('0x4d')][_0x7aaf('0x54')]({'where':{'id':_0x152aab['params']['id']}})[_0x7aaf('0x30')](handleEntityNotFound(_0x321a22,null))[_0x7aaf('0x30')](saveUpdates(_0x152aab[_0x7aaf('0x57')],null))[_0x7aaf('0x30')](respondWithResult(_0x321a22,null))[_0x7aaf('0x55')](handleError(_0x321a22,null));};exports[_0x7aaf('0x31')]=function(_0x1ae0c3,_0x292fd8){return db['MailQueue'][_0x7aaf('0x54')]({'where':{'id':_0x1ae0c3['params']['id']}})[_0x7aaf('0x30')](handleEntityNotFound(_0x292fd8,null))[_0x7aaf('0x30')](removeEntity(_0x292fd8,null))[_0x7aaf('0x55')](handleError(_0x292fd8,null));};exports['describe']=function(_0x184805,_0x312cda){return db[_0x7aaf('0x4d')][_0x7aaf('0x5e')]()['then'](respondWithResult(_0x312cda,null))[_0x7aaf('0x55')](handleError(_0x312cda,null));};exports[_0x7aaf('0x5f')]=function(_0x11dafa,_0x4b79b9,_0x1d748b){var _0x4517a8={'raw':!![],'where':{}},_0x590409={},_0x13c783;return db[_0x7aaf('0x4d')]['findOne']({'where':{'id':_0x11dafa['params']['id']}})['then'](handleEntityNotFound(_0x4b79b9,null))[_0x7aaf('0x30')](function(_0x2cc213){if(_0x2cc213){_0x13c783=_0x2cc213['get']({'plain':!![]});_0x590409[_0x7aaf('0x40')]=_['keys'](db[_0x7aaf('0x60')][_0x7aaf('0x39')]);_0x590409[_0x7aaf('0x3d')]=_['keys'](_0x11dafa[_0x7aaf('0x3d')]);_0x590409['filters']=_['intersection'](_0x590409[_0x7aaf('0x40')],_0x590409[_0x7aaf('0x3d')]);_0x4517a8[_0x7aaf('0x41')]=_[_0x7aaf('0x42')](_0x590409[_0x7aaf('0x40')],qs[_0x7aaf('0x43')](_0x11dafa[_0x7aaf('0x3d')][_0x7aaf('0x43')]));_0x4517a8[_0x7aaf('0x41')]=_0x4517a8[_0x7aaf('0x41')][_0x7aaf('0x44')]?_0x4517a8[_0x7aaf('0x41')]:_0x590409[_0x7aaf('0x40')];if(!_0x11dafa[_0x7aaf('0x3d')][_0x7aaf('0x61')]('nolimit')){_0x4517a8[_0x7aaf('0x29')]=qs[_0x7aaf('0x29')](_0x11dafa[_0x7aaf('0x3d')][_0x7aaf('0x29')]);_0x4517a8[_0x7aaf('0x26')]=qs[_0x7aaf('0x26')](_0x11dafa[_0x7aaf('0x3d')][_0x7aaf('0x26')]);}_0x4517a8[_0x7aaf('0x46')]=qs[_0x7aaf('0x62')](_0x11dafa[_0x7aaf('0x3d')][_0x7aaf('0x62')]);_0x4517a8['where']=qs['filters'](_[_0x7aaf('0x48')](_0x11dafa[_0x7aaf('0x3d')],_0x590409['filters']));_0x4517a8[_0x7aaf('0x47')][_0x7aaf('0x63')]=_0x2cc213['id'];if(_0x11dafa['query'][_0x7aaf('0x4a')]){_0x4517a8[_0x7aaf('0x47')]=_[_0x7aaf('0x4b')](_0x4517a8['where'],{'$or':_[_0x7aaf('0x38')](_0x4517a8['attributes'],function(_0x12a746){var _0x433722={};_0x433722[_0x12a746]={'$like':'%'+_0x11dafa[_0x7aaf('0x3d')][_0x7aaf('0x4a')]+'%'};return _0x433722;})});}_0x4517a8=_[_0x7aaf('0x4b')]({},_0x4517a8,_0x11dafa[_0x7aaf('0x4c')]);return db[_0x7aaf('0x60')]['findAll'](_0x4517a8);}})[_0x7aaf('0x30')](function(_0x29b50a){if(_0x29b50a){return db[_0x7aaf('0x64')][_0x7aaf('0x65')]({'where':{'id':_['map'](_0x29b50a,'UserId'),'role':'agent'},'attributes':['id',_0x7aaf('0x35'),_0x7aaf('0x66'),_0x7aaf('0x67'),'createdAt']});}})['then'](function(_0x6b5b92){if(_0x6b5b92){return{'count':_0x6b5b92[_0x7aaf('0x28')],'rows':_['map'](_0x6b5b92[_0x7aaf('0x51')],function(_0x2d4266){return{'membername':_0x2d4266[_0x7aaf('0x35')],'UserId':_0x2d4266['id'],'queue_name':_0x13c783['name'],'MailQueueId':_0x13c783['id'],'interface':util[_0x7aaf('0x68')](_0x7aaf('0x69'),'SIP',_0x2d4266[_0x7aaf('0x35')]),'penalty':0x0,'paused':_0x2d4266[_0x7aaf('0x66')],'createdAt':_0x2d4266[_0x7aaf('0x6a')],'updatedAt':_0x2d4266[_0x7aaf('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7aaf('0x30')](respondWithFilteredResult(_0x4b79b9,_0x4517a8))[_0x7aaf('0x55')](handleError(_0x4b79b9,null));};exports['getTeams']=function(_0x41077d,_0x5ed628,_0x583a96){var _0x301738={};var _0x4dbf5d={};var _0xd292d9;var _0x2091aa;return db[_0x7aaf('0x4d')][_0x7aaf('0x6b')]({'where':{'id':_0x41077d['params']['id']}})[_0x7aaf('0x30')](handleEntityNotFound(_0x5ed628,null))[_0x7aaf('0x30')](function(_0x4bef13){if(_0x4bef13){_0xd292d9=_0x4bef13;_0x4dbf5d[_0x7aaf('0x40')]=_[_0x7aaf('0x3e')](db[_0x7aaf('0x6c')][_0x7aaf('0x39')]);_0x4dbf5d[_0x7aaf('0x3d')]=_['keys'](_0x41077d[_0x7aaf('0x3d')]);_0x4dbf5d['filters']=_[_0x7aaf('0x42')](_0x4dbf5d['model'],_0x4dbf5d['query']);_0x301738[_0x7aaf('0x41')]=_[_0x7aaf('0x42')](_0x4dbf5d[_0x7aaf('0x40')],qs[_0x7aaf('0x43')](_0x41077d[_0x7aaf('0x3d')][_0x7aaf('0x43')]));_0x301738[_0x7aaf('0x41')]=_0x301738[_0x7aaf('0x41')][_0x7aaf('0x44')]?_0x301738[_0x7aaf('0x41')]:_0x4dbf5d[_0x7aaf('0x40')];_0x301738[_0x7aaf('0x46')]=qs[_0x7aaf('0x62')](_0x41077d[_0x7aaf('0x3d')]['sort']);_0x301738[_0x7aaf('0x47')]=qs[_0x7aaf('0x3f')](_[_0x7aaf('0x48')](_0x41077d[_0x7aaf('0x3d')],_0x4dbf5d[_0x7aaf('0x3f')]));if(_0x41077d[_0x7aaf('0x3d')][_0x7aaf('0x4a')]){_0x301738[_0x7aaf('0x47')]=_[_0x7aaf('0x4b')](_0x301738[_0x7aaf('0x47')],{'$or':_[_0x7aaf('0x38')](_0x301738[_0x7aaf('0x41')],function(_0x5050a0){var _0x26c816={};_0x26c816[_0x5050a0]={'$like':'%'+_0x41077d[_0x7aaf('0x3d')][_0x7aaf('0x4a')]+'%'};return _0x26c816;})});}_0x301738=_[_0x7aaf('0x4b')]({},_0x301738,_0x41077d['options']);return _0xd292d9['getTeams'](_0x301738);}})[_0x7aaf('0x30')](function(_0x2ecace){if(_0x2ecace){_0x2091aa=_0x2ecace[_0x7aaf('0x44')];if(!_0x41077d['query']['hasOwnProperty']('nolimit')){_0x301738['limit']=qs['limit'](_0x41077d['query']['limit']);_0x301738[_0x7aaf('0x26')]=qs[_0x7aaf('0x26')](_0x41077d[_0x7aaf('0x3d')][_0x7aaf('0x26')]);}return _0xd292d9[_0x7aaf('0x6d')](_0x301738);}})[_0x7aaf('0x30')](function(_0x2a1e51){if(_0x2a1e51){return _0x2a1e51?{'count':_0x2091aa,'rows':_0x2a1e51}:null;}})[_0x7aaf('0x30')](respondWithResult(_0x5ed628,null))[_0x7aaf('0x55')](handleError(_0x5ed628,null));};exports[_0x7aaf('0x6e')]=function(_0xdb7fad,_0xcfb7ec,_0x3f8fb6){var _0x8d14a6=_0xdb7fad[_0x7aaf('0x57')][_0x7aaf('0x6f')];return db[_0x7aaf('0x6c')]['findAll']({'where':{'id':_0x8d14a6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7aaf('0x70'),'attributes':['id',_0x7aaf('0x35'),_0x7aaf('0x71'),_0x7aaf('0x72'),_0x7aaf('0x73')],'raw':!![]}]})[_0x7aaf('0x30')](function(_0xc7fcbb){if(_0xc7fcbb){var _0x326539=_[_0x7aaf('0x74')](_0xc7fcbb,function(_0x2bfbf4){var _0x5473ff=_0x2bfbf4[_0x7aaf('0x32')]({'plain':!![]});return _0x5473ff[_0x7aaf('0x70')];});return db[_0x7aaf('0x4d')][_0x7aaf('0x54')]({'where':{'id':_0xdb7fad[_0x7aaf('0x53')]['id']}})[_0x7aaf('0x30')](function(_0x526005){return db['sequelize'][_0x7aaf('0x75')](function(_0x3223b0){return _0x526005[_0x7aaf('0x6e')](_0x8d14a6,{'transaction':_0x3223b0})[_0x7aaf('0x30')](function(){return BPromise[_0x7aaf('0x76')](_0x326539,function(_0x4391a1){return db[_0x7aaf('0x60')][_0x7aaf('0x77')]({'where':{'UserId':_0x4391a1['id'],'MailQueueId':_0xdb7fad['params']['id']},'transaction':_0x3223b0});});})['then'](function(){_0x326539[_0x7aaf('0x78')](function(_0x4b3ab1){socket['emit'](_0x7aaf('0x79'),{'UserId':_0x4b3ab1['id'],'MailQueueId':_0x526005['id']});});});});});}})[_0x7aaf('0x30')](respondWithStatusCode(_0xcfb7ec,null))[_0x7aaf('0x55')](handleError(_0xcfb7ec,null));};exports['removeTeams']=function(_0x199538,_0x147a2a,_0x4c8ed8){return db[_0x7aaf('0x6c')]['findAll']({'where':{'id':_0x199538['query'][_0x7aaf('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x7aaf('0x64')],'as':_0x7aaf('0x70'),'attributes':['id'],'raw':!![]}]})[_0x7aaf('0x30')](handleEntityNotFound(_0x147a2a,null))[_0x7aaf('0x30')](function(_0x4e90d4){var _0x2c5c11=_[_0x7aaf('0x38')](_0x4e90d4,'id');var _0xed814b=[];var _0x54f634=[];var _0x3cf4ee=squel[_0x7aaf('0x7a')]();_0x3cf4ee[_0x7aaf('0x7b')](_0x7aaf('0x7c'))[_0x7aaf('0x7d')](_0x7aaf('0x7e'),'tq')[_0x7aaf('0x7f')](_0x7aaf('0x80'),'ut',_0x7aaf('0x81'))[_0x7aaf('0x47')](_0x7aaf('0x82'),_0x199538[_0x7aaf('0x53')]['id']);for(var _0x4107bf=0x0;_0x4107bf<_0x4e90d4[_0x7aaf('0x44')];_0x4107bf+=0x1){let _0x1a3046=_0x4e90d4[_0x4107bf];for(var _0x255136=0x0;_0x255136<_0x1a3046[_0x7aaf('0x70')][_0x7aaf('0x44')];_0x255136+=0x1){let _0x39be39=_0x1a3046[_0x7aaf('0x70')][_0x255136];var _0x190d5e=_0x3cf4ee[_0x7aaf('0x83')]();_0x190d5e[_0x7aaf('0x47')](_0x7aaf('0x84'),_0x39be39['id']);_0x54f634['push'](db['sequelize'][_0x7aaf('0x3d')](_0x190d5e['toString'](),{'type':db[_0x7aaf('0x85')][_0x7aaf('0x86')][_0x7aaf('0x87')]})['then'](function(_0x110f2c){if(_0x110f2c['length']===0x1){return _0x39be39['id'];}else{var _0x23421e=_['every'](_[_0x7aaf('0x38')](_0x110f2c,_0x7aaf('0x88')),function(_0x2cc811){return _[_0x7aaf('0x89')](_0x2c5c11,_0x2cc811);});if(_0x23421e){return _0x39be39['id'];}}}));}}return BPromise[_0x7aaf('0x8a')](_0x54f634)[_0x7aaf('0x30')](function(_0x443479){_0xed814b=_(_0xed814b)[_0x7aaf('0x8b')](_0x443479)[_0x7aaf('0x8c')]()[_0x7aaf('0x8d')]();return db[_0x7aaf('0x4d')][_0x7aaf('0x54')]({'where':{'id':_0x199538[_0x7aaf('0x53')]['id']}})['then'](function(_0x46dcfb){return db[_0x7aaf('0x85')][_0x7aaf('0x75')](function(_0x3ff773){return _0x46dcfb[_0x7aaf('0x8e')](_0x199538[_0x7aaf('0x3d')][_0x7aaf('0x6f')],{'transaction':_0x3ff773})[_0x7aaf('0x30')](function(){if(!_[_0x7aaf('0x8f')](_0xed814b)){return _0x46dcfb[_0x7aaf('0x90')](_0xed814b,{'transaction':_0x3ff773});}})['then'](function(){_0xed814b[_0x7aaf('0x78')](function(_0x35aa1c){socket[_0x7aaf('0x91')](_0x7aaf('0x92'),{'UserId':_0x35aa1c,'MailQueueId':_0x46dcfb['id']});});});});});});})['then'](respondWithStatusCode(_0x147a2a,null))[_0x7aaf('0x55')](handleError(_0x147a2a,null));};exports[_0x7aaf('0x93')]=function(_0x2a9c67,_0x22845e,_0x495ed3){return db[_0x7aaf('0x4d')][_0x7aaf('0x54')]({'where':{'id':_0x2a9c67['params']['id']}})[_0x7aaf('0x30')](handleEntityNotFound(_0x22845e,null))[_0x7aaf('0x30')](function(_0x52bb5e){if(_0x52bb5e){return _0x52bb5e[_0x7aaf('0x93')](_0x2a9c67[_0x7aaf('0x57')][_0x7aaf('0x6f')],_[_0x7aaf('0x94')](_0x2a9c67[_0x7aaf('0x57')],[_0x7aaf('0x6f'),'id'])||{})['spread'](function(_0x2cc70e){for(var _0x448e86=0x0;_0x448e86<_0x2a9c67['body']['ids'][_0x7aaf('0x44')];_0x448e86+=0x1){socket[_0x7aaf('0x91')]('userMailQueue:save',{'UserId':Number(_0x2a9c67[_0x7aaf('0x57')]['ids'][_0x448e86]),'MailQueueId':Number(_0x2a9c67[_0x7aaf('0x53')]['id'])});}return _0x2cc70e;});}})[_0x7aaf('0x30')](respondWithResult(_0x22845e,null))['catch'](handleError(_0x22845e,null));};exports[_0x7aaf('0x90')]=function(_0x15aa69,_0x58b626,_0x22c95a){return db['MailQueue'][_0x7aaf('0x54')]({'where':{'id':_0x15aa69[_0x7aaf('0x53')]['id']}})[_0x7aaf('0x30')](handleEntityNotFound(_0x58b626,null))['then'](function(_0x50d56f){if(_0x50d56f){return _0x50d56f[_0x7aaf('0x90')](_0x15aa69[_0x7aaf('0x3d')][_0x7aaf('0x6f')])[_0x7aaf('0x30')](function(){if(_['isArray'](_0x15aa69[_0x7aaf('0x3d')][_0x7aaf('0x6f')])){for(var _0x36093a=0x0;_0x36093a<_0x15aa69[_0x7aaf('0x3d')][_0x7aaf('0x6f')]['length'];_0x36093a+=0x1){socket[_0x7aaf('0x91')](_0x7aaf('0x92'),{'UserId':Number(_0x15aa69[_0x7aaf('0x3d')][_0x7aaf('0x6f')][_0x36093a]),'MailQueueId':Number(_0x15aa69[_0x7aaf('0x53')]['id'])});}}else{socket[_0x7aaf('0x91')](_0x7aaf('0x92'),{'UserId':Number(_0x15aa69['query'][_0x7aaf('0x6f')]),'MailQueueId':Number(_0x15aa69[_0x7aaf('0x53')]['id'])});}});}})[_0x7aaf('0x30')](respondWithStatusCode(_0x58b626,null))[_0x7aaf('0x55')](handleError(_0x58b626,null));};exports[_0x7aaf('0x95')]=function(_0x29b184,_0x4bea34,_0x157426){var _0x1f0f2d={};var _0x4ef6a6={};var _0x3b0feb;var _0x50ec1c;return db[_0x7aaf('0x4d')]['findOne']({'where':{'id':_0x29b184[_0x7aaf('0x53')]['id']}})[_0x7aaf('0x30')](handleEntityNotFound(_0x4bea34,null))['then'](function(_0x19fe29){if(_0x19fe29){_0x3b0feb=_0x19fe29;_0x4ef6a6[_0x7aaf('0x40')]=_[_0x7aaf('0x3e')](db[_0x7aaf('0x64')][_0x7aaf('0x39')]);_0x4ef6a6[_0x7aaf('0x3d')]=_['keys'](_0x29b184[_0x7aaf('0x3d')]);_0x4ef6a6[_0x7aaf('0x3f')]=_[_0x7aaf('0x42')](_0x4ef6a6[_0x7aaf('0x40')],_0x4ef6a6[_0x7aaf('0x3d')]);_0x1f0f2d[_0x7aaf('0x41')]=_[_0x7aaf('0x42')](_0x4ef6a6[_0x7aaf('0x40')],qs[_0x7aaf('0x43')](_0x29b184[_0x7aaf('0x3d')]['fields']));_0x1f0f2d[_0x7aaf('0x41')]=_0x1f0f2d[_0x7aaf('0x41')]['length']?_0x1f0f2d[_0x7aaf('0x41')]:_0x4ef6a6[_0x7aaf('0x40')];_0x1f0f2d[_0x7aaf('0x46')]=qs[_0x7aaf('0x62')](_0x29b184['query'][_0x7aaf('0x62')]);_0x1f0f2d[_0x7aaf('0x47')]=qs['filters'](_[_0x7aaf('0x48')](_0x29b184[_0x7aaf('0x3d')],_0x4ef6a6['filters']));if(_0x29b184[_0x7aaf('0x3d')][_0x7aaf('0x4a')]){_0x1f0f2d[_0x7aaf('0x47')]=_['merge'](_0x1f0f2d[_0x7aaf('0x47')],{'$or':_[_0x7aaf('0x38')](_0x1f0f2d[_0x7aaf('0x41')],function(_0x2508c9){var _0x298aae={};_0x298aae[_0x2508c9]={'$like':'%'+_0x29b184[_0x7aaf('0x3d')][_0x7aaf('0x4a')]+'%'};return _0x298aae;})});}_0x1f0f2d=_[_0x7aaf('0x4b')]({},_0x1f0f2d,_0x29b184[_0x7aaf('0x4c')]);return _0x3b0feb[_0x7aaf('0x95')](_0x1f0f2d);}})[_0x7aaf('0x30')](function(_0x16766b){if(_0x16766b){_0x50ec1c=_0x16766b['length'];if(!_0x29b184['query'][_0x7aaf('0x61')]('nolimit')){_0x1f0f2d[_0x7aaf('0x29')]=qs[_0x7aaf('0x29')](_0x29b184[_0x7aaf('0x3d')][_0x7aaf('0x29')]);_0x1f0f2d[_0x7aaf('0x26')]=qs[_0x7aaf('0x26')](_0x29b184[_0x7aaf('0x3d')][_0x7aaf('0x26')]);}return _0x3b0feb[_0x7aaf('0x95')](_0x1f0f2d);}})[_0x7aaf('0x30')](function(_0xc51b3f){if(_0xc51b3f){return _0xc51b3f?{'count':_0x50ec1c,'rows':_0xc51b3f}:null;}})[_0x7aaf('0x30')](respondWithResult(_0x4bea34,null))[_0x7aaf('0x55')](handleError(_0x4bea34,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f4b51fb..12ec19c 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 _0x2363=['hook','exports','events','MailQueue','save','emit','hasOwnProperty'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x2363,0x1f3));var _0x3236=function(_0x55307b,_0x26ebd6){_0x55307b=_0x55307b-0x0;var _0x50001c=_0x2363[_0x55307b];return _0x50001c;};'use strict';var EventEmitter=require(_0x3236('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x3236('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3236('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x682933){return function(_0x49c054,_0x58eeb8,_0x5a1282){MailQueueEvents[_0x3236('0x3')](_0x682933+':'+_0x49c054['id'],_0x49c054);MailQueueEvents[_0x3236('0x3')](_0x682933,_0x49c054);_0x5a1282(null);};}for(var e in events){if(events[_0x3236('0x4')](e)){var event=events[e];MailQueue[_0x3236('0x5')](e,emitEvent(event));}}module[_0x3236('0x6')]=MailQueueEvents; \ No newline at end of file +var _0xf7f1=['save','update','remove','emit','hasOwnProperty','hook','exports','events','MailQueue','setMaxListeners'];(function(_0x5d3a7b,_0x1146fa){var _0x19f27b=function(_0x3f0a21){while(--_0x3f0a21){_0x5d3a7b['push'](_0x5d3a7b['shift']());}};_0x19f27b(++_0x1146fa);}(_0xf7f1,0x165));var _0x1f7f=function(_0x18f1f5,_0x1ffa7a){_0x18f1f5=_0x18f1f5-0x0;var _0x2c9c15=_0xf7f1[_0x18f1f5];return _0x2c9c15;};'use strict';var EventEmitter=require(_0x1f7f('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x1f7f('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1f7f('0x2')](0x0);var events={'afterCreate':_0x1f7f('0x3'),'afterUpdate':_0x1f7f('0x4'),'afterDestroy':_0x1f7f('0x5')};function emitEvent(_0xe37372){return function(_0x3bfab7,_0x70cb64,_0x532ed5){MailQueueEvents[_0x1f7f('0x6')](_0xe37372+':'+_0x3bfab7['id'],_0x3bfab7);MailQueueEvents[_0x1f7f('0x6')](_0xe37372,_0x3bfab7);_0x532ed5(null);};}for(var e in events){if(events[_0x1f7f('0x7')](e)){var event=events[e];MailQueue[_0x1f7f('0x8')](e,emitEvent(event));}}module[_0x1f7f('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c762211..2050302 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 _0xd8c2=['MailQueue','mail_queues','lodash','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','define'];(function(_0x73b912,_0x5ea3a3){var _0xad5977=function(_0x15100c){while(--_0x15100c){_0x73b912['push'](_0x73b912['shift']());}};_0xad5977(++_0x5ea3a3);}(_0xd8c2,0xf4));var _0x2d8c=function(_0x1c8ec8,_0x232c62){_0x1c8ec8=_0x1c8ec8-0x0;var _0x5bb62c=_0xd8c2[_0x1c8ec8];return _0x5bb62c;};'use strict';var _=require(_0x2d8c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2d8c('0x1'));var BPromise=require(_0x2d8c('0x2'));var rp=require(_0x2d8c('0x3'));var fs=require('fs');var path=require(_0x2d8c('0x4'));var rimraf=require(_0x2d8c('0x5'));var config=require('../../config/environment');var attributes=require(_0x2d8c('0x6'));module[_0x2d8c('0x7')]=function(_0x9670bb,_0x1577a2){return _0x9670bb[_0x2d8c('0x8')](_0x2d8c('0x9'),attributes,{'tableName':_0x2d8c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf57=['bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','../../config/logger','moment'];(function(_0x255170,_0x1468a3){var _0x52e36e=function(_0x397c35){while(--_0x397c35){_0x255170['push'](_0x255170['shift']());}};_0x52e36e(++_0x1468a3);}(_0xdf57,0x8c));var _0x7df5=function(_0x1d60d0,_0x2cfa88){_0x1d60d0=_0x1d60d0-0x0;var _0x1a0917=_0xdf57[_0x1d60d0];return _0x1a0917;};'use strict';var _=require(_0x7df5('0x0'));var util=require(_0x7df5('0x1'));var logger=require(_0x7df5('0x2'))('api');var moment=require(_0x7df5('0x3'));var BPromise=require(_0x7df5('0x4'));var rp=require(_0x7df5('0x5'));var fs=require('fs');var path=require(_0x7df5('0x6'));var rimraf=require('rimraf');var config=require(_0x7df5('0x7'));var attributes=require(_0x7df5('0x8'));module[_0x7df5('0x9')]=function(_0xb07e67,_0x5e04c0){return _0xb07e67['define'](_0x7df5('0xa'),attributes,{'tableName':_0x7df5('0xb'),'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 9ea3d5e..5c77530 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 _0x2739=['jayson/promise','client','http','defaults','redis','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2739,0x14e));var _0x9273=function(_0x29102c,_0x28231e){_0x29102c=_0x29102c-0x0;var _0x1a2d9e=_0x2739[_0x29102c];return _0x1a2d9e;};'use strict';var _=require('lodash');var util=require(_0x9273('0x0'));var moment=require(_0x9273('0x1'));var BPromise=require(_0x9273('0x2'));var rs=require(_0x9273('0x3'));var fs=require('fs');var Redis=require(_0x9273('0x4'));var db=require(_0x9273('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9273('0x6'))('rpc');var config=require(_0x9273('0x7'));var jayson=require(_0x9273('0x8'));var client=jayson[_0x9273('0x9')][_0x9273('0xa')]({'port':0x232a});config['redis']=_[_0x9273('0xb')](config[_0x9273('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9273('0xc')]));require(_0x9273('0xd'))[_0x9273('0xe')](socket);function respondWithRpcPromise(_0x53ced0,_0x4f7c39,_0x3dae6f){return new BPromise(function(_0xcdd801,_0x2e9649){return client['request'](_0x53ced0,_0x3dae6f)[_0x9273('0xf')](function(_0x18582e){logger[_0x9273('0x10')](_0x9273('0x11'),_0x4f7c39,'request\x20sent');logger['debug'](_0x9273('0x12'),_0x4f7c39,_0x9273('0x13'),JSON[_0x9273('0x14')](_0x18582e));if(_0x18582e[_0x9273('0x15')]){if(_0x18582e[_0x9273('0x15')][_0x9273('0x16')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4f7c39,_0x18582e['error'][_0x9273('0x17')]);return _0x2e9649(_0x18582e[_0x9273('0x15')]['message']);}logger['error'](_0x9273('0x11'),_0x4f7c39,_0x18582e[_0x9273('0x15')]['message']);return _0xcdd801(_0x18582e[_0x9273('0x15')][_0x9273('0x17')]);}else{logger[_0x9273('0x10')]('MailQueue,\x20%s,\x20%s',_0x4f7c39,_0x9273('0x13'));_0xcdd801(_0x18582e['result'][_0x9273('0x17')]);}})[_0x9273('0x18')](function(_0x52ce6d){logger[_0x9273('0x15')](_0x9273('0x11'),_0x4f7c39,_0x52ce6d);_0x2e9649(_0x52ce6d);});});}exports[_0x9273('0x19')]=function(_0x53f103){var _0x202770=this;return new Promise(function(_0x7c8bff,_0x4e51c8){return db['MailQueue'][_0x9273('0x1a')]({'raw':_0x53f103[_0x9273('0x1b')]?_0x53f103['options'][_0x9273('0x1c')]===undefined?!![]:![]:!![],'where':_0x53f103['options']?_0x53f103[_0x9273('0x1b')][_0x9273('0x1d')]||null:null,'attributes':_0x53f103[_0x9273('0x1b')]?_0x53f103[_0x9273('0x1b')][_0x9273('0x1e')]||null:null,'limit':_0x53f103[_0x9273('0x1b')]?_0x53f103['options'][_0x9273('0x1f')]||null:null,'include':_0x53f103[_0x9273('0x1b')]?_0x53f103['options'][_0x9273('0x20')]?_['map'](_0x53f103[_0x9273('0x1b')][_0x9273('0x20')],function(_0x1e3d89){return{'model':db[_0x1e3d89[_0x9273('0x21')]],'as':_0x1e3d89['as'],'attributes':_0x1e3d89[_0x9273('0x1e')],'include':_0x1e3d89[_0x9273('0x20')]?_[_0x9273('0x22')](_0x1e3d89[_0x9273('0x20')],function(_0x927d52){return{'model':db[_0x927d52[_0x9273('0x21')]],'as':_0x927d52['as'],'attributes':_0x927d52['attributes'],'include':_0x927d52[_0x9273('0x20')]?_[_0x9273('0x22')](_0x927d52[_0x9273('0x20')],function(_0x3294e8){return{'model':db[_0x3294e8[_0x9273('0x21')]],'as':_0x3294e8['as'],'attributes':_0x3294e8[_0x9273('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9273('0xf')](function(_0x4099ae){logger[_0x9273('0x10')](_0x9273('0x19'),_0x53f103);logger[_0x9273('0x23')](_0x9273('0x19'),_0x53f103,JSON[_0x9273('0x14')](_0x4099ae));_0x7c8bff(_0x4099ae);})['catch'](function(_0x5c7a79){logger[_0x9273('0x15')](_0x9273('0x19'),_0x5c7a79['message'],_0x53f103);_0x4e51c8(_0x202770['error'](0x1f4,_0x5c7a79[_0x9273('0x17')]));});});};exports[_0x9273('0x24')]=function(_0x368eff){var _0x3be7d4=this;return new Promise(function(_0x12f0b9,_0x2c7196){return db['MailQueue'][_0x9273('0x25')]({'raw':_0x368eff[_0x9273('0x1b')]?_0x368eff[_0x9273('0x1b')][_0x9273('0x1c')]===undefined?!![]:![]:!![],'where':_0x368eff[_0x9273('0x1b')]?_0x368eff[_0x9273('0x1b')][_0x9273('0x1d')]||null:null,'attributes':_0x368eff[_0x9273('0x1b')]?_0x368eff[_0x9273('0x1b')][_0x9273('0x1e')]||null:null,'include':_0x368eff['options']?_0x368eff[_0x9273('0x1b')][_0x9273('0x20')]?_[_0x9273('0x22')](_0x368eff[_0x9273('0x1b')][_0x9273('0x20')],function(_0x2b4f45){return{'model':db[_0x2b4f45[_0x9273('0x21')]],'as':_0x2b4f45['as'],'attributes':_0x2b4f45[_0x9273('0x1e')],'include':_0x2b4f45[_0x9273('0x20')]?_[_0x9273('0x22')](_0x2b4f45[_0x9273('0x20')],function(_0x521233){return{'model':db[_0x521233[_0x9273('0x21')]],'as':_0x521233['as'],'attributes':_0x521233[_0x9273('0x1e')],'include':_0x521233[_0x9273('0x20')]?_[_0x9273('0x22')](_0x521233[_0x9273('0x20')],function(_0x37bdf8){return{'model':db[_0x37bdf8[_0x9273('0x21')]],'as':_0x37bdf8['as'],'attributes':_0x37bdf8[_0x9273('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9273('0xf')](function(_0x2a2aa4){logger[_0x9273('0x10')]('ShowMailQueue',_0x368eff);logger['debug']('ShowMailQueue',_0x368eff,JSON[_0x9273('0x14')](_0x2a2aa4));_0x12f0b9(_0x2a2aa4);})['catch'](function(_0x4d2a0d){logger[_0x9273('0x15')](_0x9273('0x24'),_0x4d2a0d[_0x9273('0x17')],_0x368eff);_0x2c7196(_0x3be7d4['error'](0x1f4,_0x4d2a0d[_0x9273('0x17')]));});});}; \ No newline at end of file +var _0x4849=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','raw','options','attributes','limit','include','map','model','where','ShowMailQueue','lodash','util','bluebird','randomstring'];(function(_0x35f58d,_0x56c821){var _0xbca79b=function(_0x3d09d4){while(--_0x3d09d4){_0x35f58d['push'](_0x35f58d['shift']());}};_0xbca79b(++_0x56c821);}(_0x4849,0x152));var _0x9484=function(_0x385116,_0x2b7075){_0x385116=_0x385116-0x0;var _0x3a54ff=_0x4849[_0x385116];return _0x3a54ff;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var moment=require('moment');var BPromise=require(_0x9484('0x2'));var rs=require(_0x9484('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9484('0x4'))['db'];var utils=require(_0x9484('0x5'));var logger=require(_0x9484('0x6'))('rpc');var config=require(_0x9484('0x7'));var jayson=require(_0x9484('0x8'));var client=jayson[_0x9484('0x9')]['http']({'port':0x232a});config[_0x9484('0xa')]=_[_0x9484('0xb')](config[_0x9484('0xa')],{'host':_0x9484('0xc'),'port':0x18eb});var socket=require(_0x9484('0xd'))(new Redis(config[_0x9484('0xa')]));require(_0x9484('0xe'))['register'](socket);function respondWithRpcPromise(_0x288fff,_0x39e366,_0x1b0e4c){return new BPromise(function(_0x543292,_0x402974){return client['request'](_0x288fff,_0x1b0e4c)[_0x9484('0xf')](function(_0x5e2ae7){logger[_0x9484('0x10')](_0x9484('0x11'),_0x39e366,_0x9484('0x12'));logger[_0x9484('0x13')](_0x9484('0x14'),_0x39e366,'request\x20sent',JSON[_0x9484('0x15')](_0x5e2ae7));if(_0x5e2ae7[_0x9484('0x16')]){if(_0x5e2ae7[_0x9484('0x16')][_0x9484('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x39e366,_0x5e2ae7['error'][_0x9484('0x18')]);return _0x402974(_0x5e2ae7[_0x9484('0x16')][_0x9484('0x18')]);}logger[_0x9484('0x16')](_0x9484('0x11'),_0x39e366,_0x5e2ae7[_0x9484('0x16')][_0x9484('0x18')]);return _0x543292(_0x5e2ae7[_0x9484('0x16')][_0x9484('0x18')]);}else{logger[_0x9484('0x10')](_0x9484('0x11'),_0x39e366,_0x9484('0x12'));_0x543292(_0x5e2ae7[_0x9484('0x19')][_0x9484('0x18')]);}})[_0x9484('0x1a')](function(_0x268ced){logger[_0x9484('0x16')](_0x9484('0x11'),_0x39e366,_0x268ced);_0x402974(_0x268ced);});});}exports[_0x9484('0x1b')]=function(_0x1f3724){var _0x599a86=this;return new Promise(function(_0x3ac59f,_0x342dae){return db[_0x9484('0x1c')]['findAll']({'raw':_0x1f3724['options']?_0x1f3724['options'][_0x9484('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f3724[_0x9484('0x1e')]?_0x1f3724[_0x9484('0x1e')]['where']||null:null,'attributes':_0x1f3724[_0x9484('0x1e')]?_0x1f3724[_0x9484('0x1e')][_0x9484('0x1f')]||null:null,'limit':_0x1f3724[_0x9484('0x1e')]?_0x1f3724['options'][_0x9484('0x20')]||null:null,'include':_0x1f3724[_0x9484('0x1e')]?_0x1f3724[_0x9484('0x1e')]['include']?_['map'](_0x1f3724[_0x9484('0x1e')][_0x9484('0x21')],function(_0xee4f1c){return{'model':db[_0xee4f1c['model']],'as':_0xee4f1c['as'],'attributes':_0xee4f1c[_0x9484('0x1f')],'include':_0xee4f1c[_0x9484('0x21')]?_[_0x9484('0x22')](_0xee4f1c[_0x9484('0x21')],function(_0x5a4167){return{'model':db[_0x5a4167[_0x9484('0x23')]],'as':_0x5a4167['as'],'attributes':_0x5a4167['attributes'],'include':_0x5a4167[_0x9484('0x21')]?_[_0x9484('0x22')](_0x5a4167[_0x9484('0x21')],function(_0xd9cdd5){return{'model':db[_0xd9cdd5[_0x9484('0x23')]],'as':_0xd9cdd5['as'],'attributes':_0xd9cdd5[_0x9484('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9484('0xf')](function(_0x1b1f4d){logger[_0x9484('0x10')]('GetMailQueue',_0x1f3724);logger['debug'](_0x9484('0x1b'),_0x1f3724,JSON[_0x9484('0x15')](_0x1b1f4d));_0x3ac59f(_0x1b1f4d);})['catch'](function(_0x220d37){logger['error'](_0x9484('0x1b'),_0x220d37[_0x9484('0x18')],_0x1f3724);_0x342dae(_0x599a86['error'](0x1f4,_0x220d37[_0x9484('0x18')]));});});};exports['ShowMailQueue']=function(_0x57bf7f){var _0x3a7d78=this;return new Promise(function(_0x164e78,_0x561e19){return db[_0x9484('0x1c')]['find']({'raw':_0x57bf7f[_0x9484('0x1e')]?_0x57bf7f[_0x9484('0x1e')][_0x9484('0x1d')]===undefined?!![]:![]:!![],'where':_0x57bf7f[_0x9484('0x1e')]?_0x57bf7f[_0x9484('0x1e')][_0x9484('0x24')]||null:null,'attributes':_0x57bf7f['options']?_0x57bf7f[_0x9484('0x1e')][_0x9484('0x1f')]||null:null,'include':_0x57bf7f['options']?_0x57bf7f[_0x9484('0x1e')]['include']?_['map'](_0x57bf7f['options']['include'],function(_0x117f90){return{'model':db[_0x117f90[_0x9484('0x23')]],'as':_0x117f90['as'],'attributes':_0x117f90[_0x9484('0x1f')],'include':_0x117f90[_0x9484('0x21')]?_[_0x9484('0x22')](_0x117f90[_0x9484('0x21')],function(_0x4befdf){return{'model':db[_0x4befdf[_0x9484('0x23')]],'as':_0x4befdf['as'],'attributes':_0x4befdf[_0x9484('0x1f')],'include':_0x4befdf['include']?_[_0x9484('0x22')](_0x4befdf[_0x9484('0x21')],function(_0x4b33b6){return{'model':db[_0x4b33b6['model']],'as':_0x4b33b6['as'],'attributes':_0x4b33b6[_0x9484('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9484('0xf')](function(_0xf8db33){logger[_0x9484('0x10')](_0x9484('0x25'),_0x57bf7f);logger[_0x9484('0x13')]('ShowMailQueue',_0x57bf7f,JSON[_0x9484('0x15')](_0xf8db33));_0x164e78(_0xf8db33);})['catch'](function(_0x11e7d6){logger[_0x9484('0x16')](_0x9484('0x25'),_0x11e7d6[_0x9484('0x18')],_0x57bf7f);_0x561e19(_0x3a7d78[_0x9484('0x16')](0x1f4,_0x11e7d6[_0x9484('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index acca2bb..4892115 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 _0x6eeb=['./mailQueue.events','save','remove','update','removeListener','register','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6eeb,0x1f1));var _0xb6ee=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0x6eeb[_0x2f1908];return _0x357795;};'use strict';var MailQueueEvents=require(_0xb6ee('0x0'));var events=[_0xb6ee('0x1'),_0xb6ee('0x2'),_0xb6ee('0x3')];function createListener(_0x34392b,_0x5d906b){return function(_0x33a382){_0x5d906b['emit'](_0x34392b,_0x33a382);};}function removeListener(_0x64e107,_0x5e9f7e){return function(){MailQueueEvents[_0xb6ee('0x4')](_0x64e107,_0x5e9f7e);};}exports[_0xb6ee('0x5')]=function(_0x28780b){for(var _0x38587d=0x0,_0x2c0c28=events[_0xb6ee('0x6')];_0x38587d<_0x2c0c28;_0x38587d++){var _0x34f9c7=events[_0x38587d];var _0x433f82=createListener('mailQueue:'+_0x34f9c7,_0x28780b);MailQueueEvents['on'](_0x34f9c7,_0x433f82);}}; \ No newline at end of file +var _0x1ba2=['emit','removeListener','register','length','mailQueue:','./mailQueue.events','remove'];(function(_0x25a330,_0x379ccb){var _0x189b70=function(_0x4bd60a){while(--_0x4bd60a){_0x25a330['push'](_0x25a330['shift']());}};_0x189b70(++_0x379ccb);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var MailQueueEvents=require(_0x21ba('0x0'));var events=['save',_0x21ba('0x1'),'update'];function createListener(_0x31494a,_0x349a68){return function(_0x46eb26){_0x349a68[_0x21ba('0x2')](_0x31494a,_0x46eb26);};}function removeListener(_0x3661dd,_0x527ad5){return function(){MailQueueEvents[_0x21ba('0x3')](_0x3661dd,_0x527ad5);};}exports[_0x21ba('0x4')]=function(_0x4a07e8){for(var _0x10dae1=0x0,_0x53b3e0=events[_0x21ba('0x5')];_0x10dae1<_0x53b3e0;_0x10dae1++){var _0x23c3b7=events[_0x10dae1];var _0x5c50aa=createListener(_0x21ba('0x6')+_0x23c3b7,_0x4a07e8);MailQueueEvents['on'](_0x23c3b7,_0x5c50aa);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ae3dd31..00a1581 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 _0x7f8c=['/:id','show','create','put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x7f8c,0x1c0));var _0xc7f8=function(_0x2c4ead,_0x2fb34c){_0x2c4ead=_0x2c4ead-0x0;var _0x38749f=_0x7f8c[_0x2c4ead];return _0x38749f;};'use strict';var multer=require(_0xc7f8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7f8('0x1'));var router=express['Router']();var fs_extra=require(_0xc7f8('0x2'));var auth=require(_0xc7f8('0x3'));var interaction=require(_0xc7f8('0x4'));var config=require(_0xc7f8('0x5'));var controller=require(_0xc7f8('0x6'));router['get']('/',auth[_0xc7f8('0x7')](),controller[_0xc7f8('0x8')]);router[_0xc7f8('0x9')](_0xc7f8('0xa'),auth['isAuthenticated'](),controller[_0xc7f8('0xb')]);router[_0xc7f8('0x9')](_0xc7f8('0xc'),auth[_0xc7f8('0x7')](),controller[_0xc7f8('0xd')]);router['post']('/',auth[_0xc7f8('0x7')](),controller[_0xc7f8('0xe')]);router[_0xc7f8('0xf')](_0xc7f8('0xc'),auth['isAuthenticated'](),controller[_0xc7f8('0x10')]);router[_0xc7f8('0x11')](_0xc7f8('0xc'),auth[_0xc7f8('0x7')](),controller[_0xc7f8('0x12')]);module[_0xc7f8('0x13')]=router; \ No newline at end of file +var _0xbece=['../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x288dad,_0x286fc7){var _0x424213=function(_0x58786c){while(--_0x58786c){_0x288dad['push'](_0x288dad['shift']());}};_0x424213(++_0x286fc7);}(_0xbece,0x148));var _0xebec=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbece[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xebec('0x0'));var util=require(_0xebec('0x1'));var path=require(_0xebec('0x2'));var timeout=require(_0xebec('0x3'));var express=require(_0xebec('0x4'));var router=express[_0xebec('0x5')]();var fs_extra=require(_0xebec('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xebec('0x7'));var config=require(_0xebec('0x8'));var controller=require(_0xebec('0x9'));router[_0xebec('0xa')]('/',auth[_0xebec('0xb')](),controller[_0xebec('0xc')]);router[_0xebec('0xa')](_0xebec('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xebec('0xa')](_0xebec('0xe'),auth[_0xebec('0xb')](),controller['show']);router[_0xebec('0xf')]('/',auth['isAuthenticated'](),controller[_0xebec('0x10')]);router['put'](_0xebec('0xe'),auth[_0xebec('0xb')](),controller[_0xebec('0x11')]);router[_0xebec('0x12')](_0xebec('0xe'),auth[_0xebec('0xb')](),controller[_0xebec('0x13')]);module[_0xebec('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 27b3ecb..98a392f 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 _0x8d05=['sequelize','exports','STRING','DATE','moment'];(function(_0x4bc703,_0x2cebaf){var _0x4e93dc=function(_0x1e764e){while(--_0x1e764e){_0x4bc703['push'](_0x4bc703['shift']());}};_0x4e93dc(++_0x2cebaf);}(_0x8d05,0x1ad));var _0x58d0=function(_0xda5bf2,_0x1e199b){_0xda5bf2=_0xda5bf2-0x0;var _0x2b41a1=_0x8d05[_0xda5bf2];return _0x2b41a1;};'use strict';var moment=require(_0x58d0('0x0'));var Sequelize=require(_0x58d0('0x1'));module[_0x58d0('0x2')]={'uniqueid':{'type':Sequelize[_0x58d0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x58d0('0x3')]},'joinAt':{'type':Sequelize[_0x58d0('0x4')]},'leaveAt':{'type':Sequelize[_0x58d0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x58d0('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac22=['sequelize','exports','STRING','DATE'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xac22,0x138));var _0x2ac2=function(_0x5c0df8,_0x50f4fa){_0x5c0df8=_0x5c0df8-0x0;var _0x421c0b=_0xac22[_0x5c0df8];return _0x421c0b;};'use strict';var moment=require('moment');var Sequelize=require(_0x2ac2('0x0'));module[_0x2ac2('0x1')]={'uniqueid':{'type':Sequelize[_0x2ac2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2ac2('0x2')]},'joinAt':{'type':Sequelize[_0x2ac2('0x3')]},'leaveAt':{'type':Sequelize[_0x2ac2('0x3')]},'acceptAt':{'type':Sequelize[_0x2ac2('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2ac2('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 54a9bbf..f149847 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 _0xcf2f=['sort','pick','where','merge','VIRTUAL','filter','options','MailQueueReport','includeAll','include','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x3f3950,_0x177072){_0x3f3950=_0x3f3950-0x0;var _0x469083=_0xcf2f[_0x3f3950];return _0x469083;};'use strict';var emlformat=require(_0xfcf2('0x0'));var rimraf=require(_0xfcf2('0x1'));var zipdir=require(_0xfcf2('0x2'));var jsonpatch=require(_0xfcf2('0x3'));var rp=require(_0xfcf2('0x4'));var moment=require('moment');var BPromise=require(_0xfcf2('0x5'));var Mustache=require(_0xfcf2('0x6'));var util=require(_0xfcf2('0x7'));var path=require(_0xfcf2('0x8'));var sox=require(_0xfcf2('0x9'));var csv=require(_0xfcf2('0xa'));var ejs=require(_0xfcf2('0xb'));var fs=require('fs');var fs_extra=require(_0xfcf2('0xc'));var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfcf2('0x18'))['db'];function respondWithStatusCode(_0x1ba610,_0x175ac9){_0x175ac9=_0x175ac9||0xcc;return function(_0x1be8cc){if(_0x1be8cc){return _0x1ba610['sendStatus'](_0x175ac9);}return _0x1ba610[_0xfcf2('0x19')](_0x175ac9)['end']();};}function respondWithResult(_0x5b414a,_0x5dc04b){_0x5dc04b=_0x5dc04b||0xc8;return function(_0xc87ff4){if(_0xc87ff4){return _0x5b414a['status'](_0x5dc04b)[_0xfcf2('0x1a')](_0xc87ff4);}};}function respondWithFilteredResult(_0x1febf8,_0x245f9a){return function(_0x21f7d1){if(_0x21f7d1){var _0x315b2f=typeof _0x245f9a[_0xfcf2('0x1b')]===_0xfcf2('0x1c')&&typeof _0x245f9a['limit']===_0xfcf2('0x1c');var _0x213125=_0x21f7d1[_0xfcf2('0x1d')];var _0x581d78=_0x315b2f?0x0:_0x245f9a[_0xfcf2('0x1b')];var _0x1b3c89=_0x315b2f?_0x21f7d1[_0xfcf2('0x1d')]:_0x245f9a[_0xfcf2('0x1b')]+_0x245f9a[_0xfcf2('0x1e')];var _0x53c406;if(_0x1b3c89>=_0x213125){_0x1b3c89=_0x213125;_0x53c406=0xc8;}else{_0x53c406=0xce;}_0x1febf8[_0xfcf2('0x19')](_0x53c406);return _0x1febf8[_0xfcf2('0x1f')]('Content-Range',_0x581d78+'-'+_0x1b3c89+'/'+_0x213125)[_0xfcf2('0x1a')](_0x21f7d1);}return null;};}function patchUpdates(_0x23c079){return function(_0x206738){try{jsonpatch[_0xfcf2('0x20')](_0x206738,_0x23c079,!![]);}catch(_0x51e0b7){return BPromise[_0xfcf2('0x21')](_0x51e0b7);}return _0x206738[_0xfcf2('0x22')]();};}function saveUpdates(_0x422c5a,_0x1eeebd){return function(_0x5afab5){if(_0x5afab5){return _0x5afab5[_0xfcf2('0x23')](_0x422c5a)[_0xfcf2('0x24')](function(_0x232f6f){return _0x232f6f;});}return null;};}function removeEntity(_0x584e76,_0x26641a){return function(_0x151aa8){if(_0x151aa8){return _0x151aa8['destroy']()[_0xfcf2('0x24')](function(){_0x584e76[_0xfcf2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6f14,_0x26bfcc){return function(_0x1f0f07){if(!_0x1f0f07){_0x1e6f14[_0xfcf2('0x25')](0x194);}return _0x1f0f07;};}function handleError(_0x5bb384,_0x1deca3){_0x1deca3=_0x1deca3||0x1f4;return function(_0x448222){logger[_0xfcf2('0x26')](_0x448222[_0xfcf2('0x27')]);if(_0x448222[_0xfcf2('0x28')]){delete _0x448222[_0xfcf2('0x28')];}_0x5bb384[_0xfcf2('0x19')](_0x1deca3)[_0xfcf2('0x29')](_0x448222);};}exports[_0xfcf2('0x2a')]=function(_0x56f839,_0x4c2935){var _0x695f31={},_0x878504={},_0x3308c3={'count':0x0,'rows':[]};var _0x532db6=_[_0xfcf2('0x2b')](db['MailQueueReport'][_0xfcf2('0x2c')],function(_0x26651e){return{'name':_0x26651e[_0xfcf2('0x2d')],'type':_0x26651e[_0xfcf2('0x2e')][_0xfcf2('0x2f')]};});_0x878504[_0xfcf2('0x30')]=_[_0xfcf2('0x2b')](_0x532db6,'name');_0x878504['query']=_[_0xfcf2('0x31')](_0x56f839[_0xfcf2('0x32')]);_0x878504[_0xfcf2('0x33')]=_[_0xfcf2('0x34')](_0x878504['model'],_0x878504['query']);_0x695f31[_0xfcf2('0x35')]=_['intersection'](_0x878504[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x56f839['query'][_0xfcf2('0x36')]));_0x695f31[_0xfcf2('0x35')]=_0x695f31[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x695f31[_0xfcf2('0x35')]:_0x878504[_0xfcf2('0x30')];if(!_0x56f839[_0xfcf2('0x32')]['hasOwnProperty'](_0xfcf2('0x38'))){_0x695f31[_0xfcf2('0x1e')]=qs['limit'](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x1e')]);_0x695f31['offset']=qs[_0xfcf2('0x1b')](_0x56f839[_0xfcf2('0x32')]['offset']);}_0x695f31[_0xfcf2('0x39')]=qs[_0xfcf2('0x3a')](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3a')]);_0x695f31['where']=qs[_0xfcf2('0x33')](_[_0xfcf2('0x3b')](_0x56f839[_0xfcf2('0x32')],_0x878504[_0xfcf2('0x33')]),_0x532db6);if(_0x56f839[_0xfcf2('0x32')]['filter']){_0x695f31[_0xfcf2('0x3c')]=_[_0xfcf2('0x3d')](_0x695f31[_0xfcf2('0x3c')],{'$or':_[_0xfcf2('0x2b')](_0x532db6,function(_0x41cac2){if(_0x41cac2['type']!==_0xfcf2('0x3e')){var _0x4dfc61={};_0x4dfc61[_0x41cac2[_0xfcf2('0x28')]]={'$like':'%'+_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3f')]+'%'};return _0x4dfc61;}})});}_0x695f31=_[_0xfcf2('0x3d')]({},_0x695f31,_0x56f839[_0xfcf2('0x40')]);var _0x59b404={'where':_0x695f31[_0xfcf2('0x3c')]};return db[_0xfcf2('0x41')][_0xfcf2('0x1d')](_0x59b404)['then'](function(_0x1e8e71){_0x3308c3[_0xfcf2('0x1d')]=_0x1e8e71;if(_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x695f31[_0xfcf2('0x43')]=[{'all':!![]}];}return db[_0xfcf2('0x41')]['findAll'](_0x695f31);})['then'](function(_0x526c42){_0x3308c3[_0xfcf2('0x44')]=_0x526c42;return _0x3308c3;})[_0xfcf2('0x24')](respondWithFilteredResult(_0x4c2935,_0x695f31))[_0xfcf2('0x45')](handleError(_0x4c2935,null));};exports['show']=function(_0x559aea,_0x5efb5c){var _0x3fb288={'raw':!![],'where':{'id':_0x559aea[_0xfcf2('0x46')]['id']}},_0xab0747={};_0xab0747[_0xfcf2('0x30')]=_[_0xfcf2('0x31')](db[_0xfcf2('0x41')][_0xfcf2('0x2c')]);_0xab0747[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x559aea[_0xfcf2('0x32')]);_0xab0747[_0xfcf2('0x33')]=_['intersection'](_0xab0747['model'],_0xab0747[_0xfcf2('0x32')]);_0x3fb288[_0xfcf2('0x35')]=_[_0xfcf2('0x34')](_0xab0747[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x3fb288[_0xfcf2('0x35')]=_0x3fb288[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x3fb288[_0xfcf2('0x35')]:_0xab0747[_0xfcf2('0x30')];if(_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x3fb288[_0xfcf2('0x43')]=[{'all':!![]}];}_0x3fb288=_[_0xfcf2('0x3d')]({},_0x3fb288,_0x559aea[_0xfcf2('0x40')]);return db['MailQueueReport'][_0xfcf2('0x47')](_0x3fb288)[_0xfcf2('0x24')](handleEntityNotFound(_0x5efb5c,null))['then'](respondWithResult(_0x5efb5c,null))[_0xfcf2('0x45')](handleError(_0x5efb5c,null));};exports['create']=function(_0x12eef4,_0xe85e89){return db[_0xfcf2('0x41')][_0xfcf2('0x48')](_0x12eef4['body'],{})['then'](respondWithResult(_0xe85e89,0xc9))['catch'](handleError(_0xe85e89,null));};exports[_0xfcf2('0x23')]=function(_0x37d4bb,_0x20fcab){if(_0x37d4bb[_0xfcf2('0x49')]['id']){delete _0x37d4bb['body']['id'];}return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x37d4bb[_0xfcf2('0x46')]['id']}})['then'](handleEntityNotFound(_0x20fcab,null))[_0xfcf2('0x24')](saveUpdates(_0x37d4bb[_0xfcf2('0x49')],null))[_0xfcf2('0x24')](respondWithResult(_0x20fcab,null))[_0xfcf2('0x45')](handleError(_0x20fcab,null));};exports[_0xfcf2('0x4a')]=function(_0x4af270,_0x4c14d){return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x4af270[_0xfcf2('0x46')]['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x4c14d,null))[_0xfcf2('0x24')](removeEntity(_0x4c14d,null))['catch'](handleError(_0x4c14d,null));};exports['describe']=function(_0x4aa02f,_0x37c8b4){return db[_0xfcf2('0x41')]['describe']()['then'](respondWithResult(_0x37c8b4,null))[_0xfcf2('0x45')](handleError(_0x37c8b4,null));}; \ No newline at end of file +var _0x6a95=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','MailQueueReport','includeAll','include','findAll','rows','show','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model'];(function(_0x1bda6c,_0x5440b1){var _0x501a86=function(_0x1de54c){while(--_0x1de54c){_0x1bda6c['push'](_0x1bda6c['shift']());}};_0x501a86(++_0x5440b1);}(_0x6a95,0x1db));var _0x56a9=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x6a95[_0x4d07cc];return _0x42de3b;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2c7f,_0x4552ce){_0x4552ce=_0x4552ce||0xcc;return function(_0x420667){if(_0x420667){return _0x2b2c7f[_0x56a9('0x19')](_0x4552ce);}return _0x2b2c7f[_0x56a9('0x1a')](_0x4552ce)[_0x56a9('0x1b')]();};}function respondWithResult(_0x124ab8,_0x1a2eb4){_0x1a2eb4=_0x1a2eb4||0xc8;return function(_0x40b2cb){if(_0x40b2cb){return _0x124ab8['status'](_0x1a2eb4)['json'](_0x40b2cb);}};}function respondWithFilteredResult(_0x2e0dfd,_0x2a0714){return function(_0x42007b){if(_0x42007b){var _0x46f854=typeof _0x2a0714['offset']===_0x56a9('0x1c')&&typeof _0x2a0714['limit']==='undefined';var _0x4e292f=_0x42007b[_0x56a9('0x1d')];var _0x576bdf=_0x46f854?0x0:_0x2a0714[_0x56a9('0x1e')];var _0x105fe5=_0x46f854?_0x42007b[_0x56a9('0x1d')]:_0x2a0714[_0x56a9('0x1e')]+_0x2a0714[_0x56a9('0x1f')];var _0xbfeb1a;if(_0x105fe5>=_0x4e292f){_0x105fe5=_0x4e292f;_0xbfeb1a=0xc8;}else{_0xbfeb1a=0xce;}_0x2e0dfd[_0x56a9('0x1a')](_0xbfeb1a);return _0x2e0dfd[_0x56a9('0x20')](_0x56a9('0x21'),_0x576bdf+'-'+_0x105fe5+'/'+_0x4e292f)[_0x56a9('0x22')](_0x42007b);}return null;};}function patchUpdates(_0x5f145f){return function(_0x5bc03a){try{jsonpatch[_0x56a9('0x23')](_0x5bc03a,_0x5f145f,!![]);}catch(_0x16f9de){return BPromise[_0x56a9('0x24')](_0x16f9de);}return _0x5bc03a[_0x56a9('0x25')]();};}function saveUpdates(_0x4a09e5,_0x6100fe){return function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x56a9('0x26')](_0x4a09e5)[_0x56a9('0x27')](function(_0x5a82e0){return _0x5a82e0;});}return null;};}function removeEntity(_0x44762e,_0x32839b){return function(_0x21ab38){if(_0x21ab38){return _0x21ab38[_0x56a9('0x28')]()[_0x56a9('0x27')](function(){_0x44762e['status'](0xcc)[_0x56a9('0x1b')]();});}};}function handleEntityNotFound(_0x217bda,_0x35fe6d){return function(_0x5e3052){if(!_0x5e3052){_0x217bda[_0x56a9('0x19')](0x194);}return _0x5e3052;};}function handleError(_0x583b22,_0x22744f){_0x22744f=_0x22744f||0x1f4;return function(_0x8d41d6){logger[_0x56a9('0x29')](_0x8d41d6[_0x56a9('0x2a')]);if(_0x8d41d6[_0x56a9('0x2b')]){delete _0x8d41d6[_0x56a9('0x2b')];}_0x583b22[_0x56a9('0x1a')](_0x22744f)[_0x56a9('0x2c')](_0x8d41d6);};}exports['index']=function(_0x437ccf,_0x2bb1eb){var _0x5f23e1={},_0x4441ce={},_0x4f9be1={'count':0x0,'rows':[]};var _0x54a343=_[_0x56a9('0x2d')](db['MailQueueReport'][_0x56a9('0x2e')],function(_0x11002a){return{'name':_0x11002a[_0x56a9('0x2f')],'type':_0x11002a[_0x56a9('0x30')]['key']};});_0x4441ce[_0x56a9('0x31')]=_[_0x56a9('0x2d')](_0x54a343,_0x56a9('0x2b'));_0x4441ce[_0x56a9('0x32')]=_[_0x56a9('0x33')](_0x437ccf[_0x56a9('0x32')]);_0x4441ce[_0x56a9('0x34')]=_[_0x56a9('0x35')](_0x4441ce[_0x56a9('0x31')],_0x4441ce[_0x56a9('0x32')]);_0x5f23e1[_0x56a9('0x36')]=_[_0x56a9('0x35')](_0x4441ce['model'],qs[_0x56a9('0x37')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x37')]));_0x5f23e1['attributes']=_0x5f23e1[_0x56a9('0x36')]['length']?_0x5f23e1['attributes']:_0x4441ce['model'];if(!_0x437ccf[_0x56a9('0x32')][_0x56a9('0x38')]('nolimit')){_0x5f23e1['limit']=qs[_0x56a9('0x1f')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x1f')]);_0x5f23e1[_0x56a9('0x1e')]=qs[_0x56a9('0x1e')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x1e')]);}_0x5f23e1[_0x56a9('0x39')]=qs[_0x56a9('0x3a')](_0x437ccf[_0x56a9('0x32')]['sort']);_0x5f23e1['where']=qs['filters'](_['pick'](_0x437ccf[_0x56a9('0x32')],_0x4441ce[_0x56a9('0x34')]),_0x54a343);if(_0x437ccf['query'][_0x56a9('0x3b')]){_0x5f23e1[_0x56a9('0x3c')]=_[_0x56a9('0x3d')](_0x5f23e1[_0x56a9('0x3c')],{'$or':_[_0x56a9('0x2d')](_0x54a343,function(_0x38932){if(_0x38932[_0x56a9('0x30')]!=='VIRTUAL'){var _0x4630c7={};_0x4630c7[_0x38932[_0x56a9('0x2b')]]={'$like':'%'+_0x437ccf['query']['filter']+'%'};return _0x4630c7;}})});}_0x5f23e1=_[_0x56a9('0x3d')]({},_0x5f23e1,_0x437ccf[_0x56a9('0x3e')]);var _0x1534d7={'where':_0x5f23e1[_0x56a9('0x3c')]};return db[_0x56a9('0x3f')][_0x56a9('0x1d')](_0x1534d7)[_0x56a9('0x27')](function(_0x26b251){_0x4f9be1[_0x56a9('0x1d')]=_0x26b251;if(_0x437ccf[_0x56a9('0x32')][_0x56a9('0x40')]){_0x5f23e1[_0x56a9('0x41')]=[{'all':!![]}];}return db[_0x56a9('0x3f')][_0x56a9('0x42')](_0x5f23e1);})[_0x56a9('0x27')](function(_0xe57cfb){_0x4f9be1[_0x56a9('0x43')]=_0xe57cfb;return _0x4f9be1;})[_0x56a9('0x27')](respondWithFilteredResult(_0x2bb1eb,_0x5f23e1))['catch'](handleError(_0x2bb1eb,null));};exports[_0x56a9('0x44')]=function(_0x43acf6,_0xfc1800){var _0x5ce001={'raw':!![],'where':{'id':_0x43acf6['params']['id']}},_0x1f8b30={};_0x1f8b30[_0x56a9('0x31')]=_['keys'](db[_0x56a9('0x3f')][_0x56a9('0x2e')]);_0x1f8b30[_0x56a9('0x32')]=_[_0x56a9('0x33')](_0x43acf6['query']);_0x1f8b30['filters']=_['intersection'](_0x1f8b30[_0x56a9('0x31')],_0x1f8b30[_0x56a9('0x32')]);_0x5ce001[_0x56a9('0x36')]=_[_0x56a9('0x35')](_0x1f8b30[_0x56a9('0x31')],qs[_0x56a9('0x37')](_0x43acf6[_0x56a9('0x32')][_0x56a9('0x37')]));_0x5ce001[_0x56a9('0x36')]=_0x5ce001[_0x56a9('0x36')][_0x56a9('0x45')]?_0x5ce001[_0x56a9('0x36')]:_0x1f8b30[_0x56a9('0x31')];if(_0x43acf6[_0x56a9('0x32')]['includeAll']){_0x5ce001[_0x56a9('0x41')]=[{'all':!![]}];}_0x5ce001=_[_0x56a9('0x3d')]({},_0x5ce001,_0x43acf6[_0x56a9('0x3e')]);return db['MailQueueReport'][_0x56a9('0x46')](_0x5ce001)[_0x56a9('0x27')](handleEntityNotFound(_0xfc1800,null))['then'](respondWithResult(_0xfc1800,null))[_0x56a9('0x47')](handleError(_0xfc1800,null));};exports[_0x56a9('0x48')]=function(_0x4186e0,_0x208452){return db['MailQueueReport'][_0x56a9('0x48')](_0x4186e0[_0x56a9('0x49')],{})[_0x56a9('0x27')](respondWithResult(_0x208452,0xc9))[_0x56a9('0x47')](handleError(_0x208452,null));};exports[_0x56a9('0x26')]=function(_0x3942d8,_0x31aaf5){if(_0x3942d8[_0x56a9('0x49')]['id']){delete _0x3942d8[_0x56a9('0x49')]['id'];}return db[_0x56a9('0x3f')][_0x56a9('0x46')]({'where':{'id':_0x3942d8['params']['id']}})['then'](handleEntityNotFound(_0x31aaf5,null))[_0x56a9('0x27')](saveUpdates(_0x3942d8[_0x56a9('0x49')],null))[_0x56a9('0x27')](respondWithResult(_0x31aaf5,null))[_0x56a9('0x47')](handleError(_0x31aaf5,null));};exports['destroy']=function(_0x1986f2,_0x942bee){return db[_0x56a9('0x3f')][_0x56a9('0x46')]({'where':{'id':_0x1986f2['params']['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x942bee,null))[_0x56a9('0x27')](removeEntity(_0x942bee,null))['catch'](handleError(_0x942bee,null));};exports[_0x56a9('0x4a')]=function(_0x14dea7,_0x4d68d7){return db[_0x56a9('0x3f')][_0x56a9('0x4a')]()[_0x56a9('0x27')](respondWithResult(_0x4d68d7,null))[_0x56a9('0x47')](handleError(_0x4d68d7,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 2c1b87f..0da9bcf 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 _0x4a45=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x1d8b31,_0xef220e){var _0x2548ce=function(_0x2cb76a){while(--_0x2cb76a){_0x1d8b31['push'](_0x1d8b31['shift']());}};_0x2548ce(++_0xef220e);}(_0x4a45,0xa4));var _0x54a4=function(_0x142d38,_0x4945a9){_0x142d38=_0x142d38-0x0;var _0x4d953a=_0x4a45[_0x142d38];return _0x4d953a;};'use strict';var _=require(_0x54a4('0x0'));var util=require(_0x54a4('0x1'));var logger=require(_0x54a4('0x2'))(_0x54a4('0x3'));var moment=require(_0x54a4('0x4'));var BPromise=require(_0x54a4('0x5'));var rp=require(_0x54a4('0x6'));var fs=require('fs');var path=require(_0x54a4('0x7'));var rimraf=require(_0x54a4('0x8'));var config=require(_0x54a4('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0x54a4('0xa')]=function(_0x77c044,_0x55da41){return _0x77c044[_0x54a4('0xb')](_0x54a4('0xc'),attributes,{'tableName':_0x54a4('0xd'),'paranoid':![],'indexes':[{'name':_0x54a4('0xe'),'fields':[_0x54a4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x101e=['MailQueueReport','../../config/logger','moment','path','../../config/environment','exports','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x101e,0xbe));var _0xe101=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x101e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe101('0x0'))('api');var moment=require(_0xe101('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe101('0x2'));var rimraf=require('rimraf');var config=require(_0xe101('0x3'));var attributes=require('./mailQueueReport.attributes');module[_0xe101('0x4')]=function(_0x604cae,_0x2fcf7a){return _0x604cae[_0xe101('0x5')](_0xe101('0x6'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 80b4321..e33ced3 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3ccf97,_0x21ac7a){var _0x32d703=function(_0x436d48){while(--_0x436d48){_0x3ccf97['push'](_0x3ccf97['shift']());}};_0x32d703(++_0x21ac7a);}(_0x1261,0x144));var _0x1126=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x1261[_0x37d3f3];return _0x185c9c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x5ee3f0,_0xbb05d0){var _0x2c5cd0=function(_0x265fe0){while(--_0x265fe0){_0x5ee3f0['push'](_0x5ee3f0['shift']());}};_0x2c5cd0(++_0xbb05d0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x47c334,_0x5d003e){_0x47c334=_0x47c334-0x0;var _0x54baf0=_0x5f2f[_0x47c334];return _0x54baf0;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index c6a2590..7f77c1a 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5cf99f,_0x450e05){var _0xeedf3a=function(_0x21f600){while(--_0x21f600){_0x5cf99f['push'](_0x5cf99f['shift']());}};_0xeedf3a(++_0x450e05);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x9905f3,_0x477333){var _0x470d68=function(_0x34c7d0){while(--_0x34c7d0){_0x9905f3['push'](_0x9905f3['shift']());}};_0x470d68(++_0x477333);}(_0xe706,0xa3));var _0x6e70=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xe706[_0x5caf7e];return _0x5c3435;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index bbfaedd..ddb992c 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 _0x0427=['INTEGER','BOOLEAN','INBOX','STRING'];(function(_0x3bfa22,_0x19cc7d){var _0x15d710=function(_0x2602a2){while(--_0x2602a2){_0x3bfa22['push'](_0x3bfa22['shift']());}};_0x15d710(++_0x19cc7d);}(_0x0427,0x137));var _0x7042=function(_0x4b170d,_0x48b0e2){_0x4b170d=_0x4b170d-0x0;var _0x46139b=_0x0427[_0x4b170d];return _0x46139b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7042('0x0')]},'host':{'type':Sequelize[_0x7042('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x7042('0x0')]},'password':{'type':Sequelize[_0x7042('0x0')]},'port':{'type':Sequelize[_0x7042('0x1')]},'tls':{'type':Sequelize[_0x7042('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7042('0x0')],'defaultValue':_0x7042('0x3')},'connTimeout':{'type':Sequelize[_0x7042('0x1')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7042('0x0')]}}; \ No newline at end of file +var _0x9aea=['INBOX','sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x607caa,_0x57ba3b){var _0x475037=function(_0x571949){while(--_0x571949){_0x607caa['push'](_0x607caa['shift']());}};_0x475037(++_0x57ba3b);}(_0x9aea,0xdd));var _0xa9ae=function(_0x1ab07f,_0x2fc1c8){_0x1ab07f=_0x1ab07f-0x0;var _0x1ba903=_0x9aea[_0x1ab07f];return _0x1ba903;};'use strict';var Sequelize=require(_0xa9ae('0x0'));module['exports']={'description':{'type':Sequelize[_0xa9ae('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xa9ae('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa9ae('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa9ae('0x3')]},'tls':{'type':Sequelize[_0xa9ae('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa9ae('0x1')],'defaultValue':_0xa9ae('0x4')},'connTimeout':{'type':Sequelize[_0xa9ae('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xa9ae('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e8058ce..b42ee36 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 _0x4027=['mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0x4027,0x156));var _0x7402=function(_0x2aa03f,_0x4fb0eb){_0x2aa03f=_0x2aa03f-0x0;var _0x555f49=_0x4027[_0x2aa03f];return _0x555f49;};'use strict';var _=require(_0x7402('0x0'));var util=require(_0x7402('0x1'));var logger=require(_0x7402('0x2'))('api');var moment=require(_0x7402('0x3'));var BPromise=require(_0x7402('0x4'));var rp=require(_0x7402('0x5'));var fs=require('fs');var path=require(_0x7402('0x6'));var rimraf=require('rimraf');var config=require(_0x7402('0x7'));var attributes=require(_0x7402('0x8'));module[_0x7402('0x9')]=function(_0x4c6370,_0x13e761){return _0x4c6370['define']('MailServerIn',attributes,{'tableName':_0x7402('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75c5=['path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d3df2,_0x2f9498){var _0x347bda=function(_0x55a196){while(--_0x55a196){_0x2d3df2['push'](_0x2d3df2['shift']());}};_0x347bda(++_0x2f9498);}(_0x75c5,0x1e8));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x575c('0x0'));var util=require('util');var logger=require(_0x575c('0x1'))(_0x575c('0x2'));var moment=require(_0x575c('0x3'));var BPromise=require(_0x575c('0x4'));var rp=require(_0x575c('0x5'));var fs=require('fs');var path=require(_0x575c('0x6'));var rimraf=require(_0x575c('0x7'));var config=require('../../config/environment');var attributes=require(_0x575c('0x8'));module[_0x575c('0x9')]=function(_0xc386d5,_0x112ed3){return _0xc386d5[_0x575c('0xa')](_0x575c('0xb'),attributes,{'tableName':_0x575c('0xc'),'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 09bd35d..ad2dea8 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 _0x51b9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include','map','model','info','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51b9,0x11b));var _0x951b=function(_0x207a0a,_0x10eceb){_0x207a0a=_0x207a0a-0x0;var _0x50445c=_0x51b9[_0x207a0a];return _0x50445c;};'use strict';var _=require(_0x951b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x951b('0x1'));var rs=require(_0x951b('0x2'));var fs=require('fs');var Redis=require(_0x951b('0x3'));var db=require(_0x951b('0x4'))['db'];var utils=require(_0x951b('0x5'));var logger=require(_0x951b('0x6'))(_0x951b('0x7'));var config=require(_0x951b('0x8'));var jayson=require(_0x951b('0x9'));var client=jayson[_0x951b('0xa')][_0x951b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51e22e,_0x13475f,_0xcd534d){return new BPromise(function(_0x52e54d,_0x16f04a){return client['request'](_0x51e22e,_0xcd534d)['then'](function(_0x5113c4){logger['info'](_0x951b('0xc'),_0x13475f,'request\x20sent');logger[_0x951b('0xd')](_0x951b('0xe'),_0x13475f,'request\x20sent',JSON[_0x951b('0xf')](_0x5113c4));if(_0x5113c4['error']){if(_0x5113c4[_0x951b('0x10')][_0x951b('0x11')]===0x1f4){logger[_0x951b('0x10')]('MailServerIn,\x20%s,\x20%s',_0x13475f,_0x5113c4[_0x951b('0x10')]['message']);return _0x16f04a(_0x5113c4[_0x951b('0x10')]['message']);}logger[_0x951b('0x10')]('MailServerIn,\x20%s,\x20%s',_0x13475f,_0x5113c4[_0x951b('0x10')][_0x951b('0x12')]);return _0x52e54d(_0x5113c4[_0x951b('0x10')][_0x951b('0x12')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x13475f,_0x951b('0x13'));_0x52e54d(_0x5113c4['result'][_0x951b('0x12')]);}})[_0x951b('0x14')](function(_0x5511fd){logger[_0x951b('0x10')](_0x951b('0xc'),_0x13475f,_0x5511fd);_0x16f04a(_0x5511fd);});});}exports[_0x951b('0x15')]=function(_0x49f5af){var _0x475039=this;return new Promise(function(_0x7f4d9e,_0x523e43){return db['MailServerIn'][_0x951b('0x16')]({'raw':_0x49f5af['options']?_0x49f5af['options'][_0x951b('0x17')]===undefined?!![]:![]:!![],'where':_0x49f5af[_0x951b('0x18')]?_0x49f5af[_0x951b('0x18')][_0x951b('0x19')]||null:null,'attributes':_0x49f5af[_0x951b('0x18')]?_0x49f5af[_0x951b('0x18')][_0x951b('0x1a')]||null:null,'limit':_0x49f5af['options']?_0x49f5af[_0x951b('0x18')][_0x951b('0x1b')]||null:null,'include':_0x49f5af['options']?_0x49f5af[_0x951b('0x18')][_0x951b('0x1c')]?_[_0x951b('0x1d')](_0x49f5af['options'][_0x951b('0x1c')],function(_0x50a0d5){return{'model':db[_0x50a0d5['model']],'as':_0x50a0d5['as'],'attributes':_0x50a0d5[_0x951b('0x1a')],'include':_0x50a0d5['include']?_[_0x951b('0x1d')](_0x50a0d5[_0x951b('0x1c')],function(_0x37b1ad){return{'model':db[_0x37b1ad[_0x951b('0x1e')]],'as':_0x37b1ad['as'],'attributes':_0x37b1ad[_0x951b('0x1a')],'include':_0x37b1ad[_0x951b('0x1c')]?_[_0x951b('0x1d')](_0x37b1ad['include'],function(_0x2d3022){return{'model':db[_0x2d3022[_0x951b('0x1e')]],'as':_0x2d3022['as'],'attributes':_0x2d3022[_0x951b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10270b){logger[_0x951b('0x1f')](_0x951b('0x15'),_0x49f5af);logger[_0x951b('0xd')](_0x951b('0x15'),_0x49f5af,JSON[_0x951b('0xf')](_0x10270b));_0x7f4d9e(_0x10270b);})[_0x951b('0x14')](function(_0x3b199d){logger[_0x951b('0x10')](_0x951b('0x15'),_0x3b199d[_0x951b('0x12')],_0x49f5af);_0x523e43(_0x475039[_0x951b('0x10')](0x1f4,_0x3b199d['message']));});});}; \ No newline at end of file +var _0x4458=['MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x182c5a,_0x59f997){var _0x506d87=function(_0x48f79f){while(--_0x48f79f){_0x182c5a['push'](_0x182c5a['shift']());}};_0x506d87(++_0x59f997);}(_0x4458,0x1e4));var _0x8445=function(_0x4c5064,_0x2409f2){_0x4c5064=_0x4c5064-0x0;var _0x5f2c5c=_0x4458[_0x4c5064];return _0x5f2c5c;};'use strict';var _=require(_0x8445('0x0'));var util=require(_0x8445('0x1'));var moment=require(_0x8445('0x2'));var BPromise=require(_0x8445('0x3'));var rs=require(_0x8445('0x4'));var fs=require('fs');var Redis=require(_0x8445('0x5'));var db=require(_0x8445('0x6'))['db'];var utils=require(_0x8445('0x7'));var logger=require(_0x8445('0x8'))(_0x8445('0x9'));var config=require(_0x8445('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8445('0xb')][_0x8445('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc713e,_0x4b0acb,_0x4c98b8){return new BPromise(function(_0x317fbe,_0xe8aca6){return client[_0x8445('0xd')](_0xc713e,_0x4c98b8)['then'](function(_0x416434){logger[_0x8445('0xe')]('MailServerIn,\x20%s,\x20%s',_0x4b0acb,_0x8445('0xf'));logger[_0x8445('0x10')](_0x8445('0x11'),_0x4b0acb,'request\x20sent',JSON['stringify'](_0x416434));if(_0x416434[_0x8445('0x12')]){if(_0x416434[_0x8445('0x12')][_0x8445('0x13')]===0x1f4){logger[_0x8445('0x12')](_0x8445('0x14'),_0x4b0acb,_0x416434[_0x8445('0x12')][_0x8445('0x15')]);return _0xe8aca6(_0x416434['error'][_0x8445('0x15')]);}logger[_0x8445('0x12')](_0x8445('0x14'),_0x4b0acb,_0x416434[_0x8445('0x12')][_0x8445('0x15')]);return _0x317fbe(_0x416434[_0x8445('0x12')][_0x8445('0x15')]);}else{logger[_0x8445('0xe')](_0x8445('0x14'),_0x4b0acb,_0x8445('0xf'));_0x317fbe(_0x416434[_0x8445('0x16')][_0x8445('0x15')]);}})[_0x8445('0x17')](function(_0x34fd10){logger['error'](_0x8445('0x14'),_0x4b0acb,_0x34fd10);_0xe8aca6(_0x34fd10);});});}exports[_0x8445('0x18')]=function(_0x4b4a80){var _0x2b77f8=this;return new Promise(function(_0x50bc4c,_0x412937){return db[_0x8445('0x19')][_0x8445('0x1a')]({'raw':_0x4b4a80[_0x8445('0x1b')]?_0x4b4a80['options'][_0x8445('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b4a80['options']?_0x4b4a80[_0x8445('0x1b')][_0x8445('0x1d')]||null:null,'attributes':_0x4b4a80[_0x8445('0x1b')]?_0x4b4a80['options'][_0x8445('0x1e')]||null:null,'limit':_0x4b4a80[_0x8445('0x1b')]?_0x4b4a80[_0x8445('0x1b')][_0x8445('0x1f')]||null:null,'include':_0x4b4a80[_0x8445('0x1b')]?_0x4b4a80[_0x8445('0x1b')][_0x8445('0x20')]?_['map'](_0x4b4a80[_0x8445('0x1b')][_0x8445('0x20')],function(_0x476509){return{'model':db[_0x476509[_0x8445('0x21')]],'as':_0x476509['as'],'attributes':_0x476509[_0x8445('0x1e')],'include':_0x476509['include']?_[_0x8445('0x22')](_0x476509['include'],function(_0x1485fa){return{'model':db[_0x1485fa['model']],'as':_0x1485fa['as'],'attributes':_0x1485fa[_0x8445('0x1e')],'include':_0x1485fa[_0x8445('0x20')]?_[_0x8445('0x22')](_0x1485fa['include'],function(_0x363b7d){return{'model':db[_0x363b7d[_0x8445('0x21')]],'as':_0x363b7d['as'],'attributes':_0x363b7d[_0x8445('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8445('0x23')](function(_0x559d5b){logger[_0x8445('0xe')](_0x8445('0x18'),_0x4b4a80);logger[_0x8445('0x10')](_0x8445('0x18'),_0x4b4a80,JSON['stringify'](_0x559d5b));_0x50bc4c(_0x559d5b);})['catch'](function(_0x2cd27c){logger[_0x8445('0x12')]('GetMailServerIn',_0x2cd27c[_0x8445('0x15')],_0x4b4a80);_0x412937(_0x2b77f8['error'](0x1f4,_0x2cd27c[_0x8445('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 58a4d11..22c1cb4 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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x58770d,_0x59105a){_0x58770d=_0x58770d-0x0;var _0x31b270=_0x7a54[_0x58770d];return _0x31b270;};'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(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0xba476b,_0x50b0dc){_0xba476b=_0xba476b-0x0;var _0x4f853d=_0x7a54[_0xba476b];return _0x4f853d;};'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 366d2e1..23694a4 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 _0x6797=['sequelize','exports','STRING','BOOLEAN'];(function(_0x215913,_0x338380){var _0x468591=function(_0x36eb36){while(--_0x36eb36){_0x215913['push'](_0x215913['shift']());}};_0x468591(++_0x338380);}(_0x6797,0x1b0));var _0x7679=function(_0x43925e,_0x16a0d2){_0x43925e=_0x43925e-0x0;var _0x58f55c=_0x6797[_0x43925e];return _0x58f55c;};'use strict';var Sequelize=require(_0x7679('0x0'));module[_0x7679('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7679('0x2')]},'user':{'type':Sequelize[_0x7679('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x7679('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x7679('0x2')]},'authentication':{'type':Sequelize[_0x7679('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf5a1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1a17b1,_0x543ccb){var _0x213a06=function(_0x4609f5){while(--_0x4609f5){_0x1a17b1['push'](_0x1a17b1['shift']());}};_0x213a06(++_0x543ccb);}(_0xf5a1,0x1bf));var _0x1f5a=function(_0xc74824,_0x32ea3c){_0xc74824=_0xc74824-0x0;var _0x537e30=_0xf5a1[_0xc74824];return _0x537e30;};'use strict';var Sequelize=require(_0x1f5a('0x0'));module[_0x1f5a('0x1')]={'description':{'type':Sequelize[_0x1f5a('0x2')]},'host':{'type':Sequelize[_0x1f5a('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1f5a('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x1f5a('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1f5a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index b878b8e..b9a7739 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 _0x19dd=['include','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0xdc4996,_0x15bedc){var _0x20fbb9=function(_0x47c811){while(--_0x47c811){_0xdc4996['push'](_0xdc4996['shift']());}};_0x20fbb9(++_0x15bedc);}(_0x19dd,0x1f4));var _0xd19d=function(_0x49a456,_0x76c6d6){_0x49a456=_0x49a456-0x0;var _0x5818aa=_0x19dd[_0x49a456];return _0x5818aa;};'use strict';var emlformat=require(_0xd19d('0x0'));var rimraf=require(_0xd19d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd19d('0x2'));var rp=require(_0xd19d('0x3'));var moment=require('moment');var BPromise=require(_0xd19d('0x4'));var Mustache=require(_0xd19d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd19d('0x6'));var csv=require('to-csv');var ejs=require(_0xd19d('0x7'));var fs=require('fs');var fs_extra=require(_0xd19d('0x8'));var _=require(_0xd19d('0x9'));var squel=require(_0xd19d('0xa'));var crypto=require(_0xd19d('0xb'));var jsforce=require(_0xd19d('0xc'));var deskjs=require(_0xd19d('0xd'));var toCsv=require(_0xd19d('0xe'));var querystring=require('querystring');var Papa=require(_0xd19d('0xf'));var Redis=require('ioredis');var authService=require(_0xd19d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd19d('0x11'));var hardwareService=require(_0xd19d('0x12'));var logger=require('../../config/logger')(_0xd19d('0x13'));var utils=require('../../config/utils');var config=require(_0xd19d('0x14'));var licenseUtil=require(_0xd19d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39bf02,_0xe40ffe){_0xe40ffe=_0xe40ffe||0xcc;return function(_0x338bd0){if(_0x338bd0){return _0x39bf02[_0xd19d('0x16')](_0xe40ffe);}return _0x39bf02[_0xd19d('0x17')](_0xe40ffe)[_0xd19d('0x18')]();};}function respondWithResult(_0x1b6c06,_0xffcc6b){_0xffcc6b=_0xffcc6b||0xc8;return function(_0x542c6b){if(_0x542c6b){return _0x1b6c06['status'](_0xffcc6b)[_0xd19d('0x19')](_0x542c6b);}};}function respondWithFilteredResult(_0x25ef68,_0x22cdc9){return function(_0xfa014c){if(_0xfa014c){var _0x96eb5c=typeof _0x22cdc9['offset']==='undefined'&&typeof _0x22cdc9[_0xd19d('0x1a')]===_0xd19d('0x1b');var _0x3fefc5=_0xfa014c[_0xd19d('0x1c')];var _0x24f11f=_0x96eb5c?0x0:_0x22cdc9[_0xd19d('0x1d')];var _0x1dd6be=_0x96eb5c?_0xfa014c[_0xd19d('0x1c')]:_0x22cdc9[_0xd19d('0x1d')]+_0x22cdc9[_0xd19d('0x1a')];var _0x131990;if(_0x1dd6be>=_0x3fefc5){_0x1dd6be=_0x3fefc5;_0x131990=0xc8;}else{_0x131990=0xce;}_0x25ef68[_0xd19d('0x17')](_0x131990);return _0x25ef68[_0xd19d('0x1e')]('Content-Range',_0x24f11f+'-'+_0x1dd6be+'/'+_0x3fefc5)[_0xd19d('0x19')](_0xfa014c);}return null;};}function patchUpdates(_0xec4a7a){return function(_0x5c1302){try{jsonpatch[_0xd19d('0x1f')](_0x5c1302,_0xec4a7a,!![]);}catch(_0x5a7c0c){return BPromise[_0xd19d('0x20')](_0x5a7c0c);}return _0x5c1302[_0xd19d('0x21')]();};}function saveUpdates(_0x14ca5a,_0x3f7cf9){return function(_0x2ee110){if(_0x2ee110){return _0x2ee110['update'](_0x14ca5a)[_0xd19d('0x22')](function(_0x3fdb7c){return _0x3fdb7c;});}return null;};}function removeEntity(_0x1a013e,_0x18f71c){return function(_0x7162cb){if(_0x7162cb){return _0x7162cb[_0xd19d('0x23')]()[_0xd19d('0x22')](function(){_0x1a013e['status'](0xcc)[_0xd19d('0x18')]();});}};}function handleEntityNotFound(_0x2a43cb,_0x11a969){return function(_0x3ffa21){if(!_0x3ffa21){_0x2a43cb[_0xd19d('0x16')](0x194);}return _0x3ffa21;};}function handleError(_0x14cc59,_0x21f20b){_0x21f20b=_0x21f20b||0x1f4;return function(_0xb302b9){logger['error'](_0xb302b9[_0xd19d('0x24')]);if(_0xb302b9[_0xd19d('0x25')]){delete _0xb302b9[_0xd19d('0x25')];}_0x14cc59[_0xd19d('0x17')](_0x21f20b)['send'](_0xb302b9);};}exports[_0xd19d('0x26')]=function(_0x88b9f6,_0x13de91){var _0x5f2c69={},_0x5e85ec={},_0x25b25f={'count':0x0,'rows':[]};var _0x37fea7=_[_0xd19d('0x27')](db[_0xd19d('0x28')][_0xd19d('0x29')],function(_0x5d8460){return{'name':_0x5d8460[_0xd19d('0x2a')],'type':_0x5d8460[_0xd19d('0x2b')]['key']};});_0x5e85ec['model']=_[_0xd19d('0x27')](_0x37fea7,_0xd19d('0x25'));_0x5e85ec[_0xd19d('0x2c')]=_['keys'](_0x88b9f6[_0xd19d('0x2c')]);_0x5e85ec[_0xd19d('0x2d')]=_[_0xd19d('0x2e')](_0x5e85ec[_0xd19d('0x2f')],_0x5e85ec[_0xd19d('0x2c')]);_0x5f2c69[_0xd19d('0x30')]=_['intersection'](_0x5e85ec[_0xd19d('0x2f')],qs['fields'](_0x88b9f6['query'][_0xd19d('0x31')]));_0x5f2c69[_0xd19d('0x30')]=_0x5f2c69[_0xd19d('0x30')][_0xd19d('0x32')]?_0x5f2c69[_0xd19d('0x30')]:_0x5e85ec[_0xd19d('0x2f')];if(!_0x88b9f6[_0xd19d('0x2c')][_0xd19d('0x33')]('nolimit')){_0x5f2c69['limit']=qs[_0xd19d('0x1a')](_0x88b9f6['query'][_0xd19d('0x1a')]);_0x5f2c69[_0xd19d('0x1d')]=qs['offset'](_0x88b9f6[_0xd19d('0x2c')][_0xd19d('0x1d')]);}_0x5f2c69['order']=qs[_0xd19d('0x34')](_0x88b9f6[_0xd19d('0x2c')][_0xd19d('0x34')]);_0x5f2c69[_0xd19d('0x35')]=qs[_0xd19d('0x2d')](_[_0xd19d('0x36')](_0x88b9f6['query'],_0x5e85ec[_0xd19d('0x2d')]),_0x37fea7);if(_0x88b9f6[_0xd19d('0x2c')][_0xd19d('0x37')]){_0x5f2c69[_0xd19d('0x35')]=_[_0xd19d('0x38')](_0x5f2c69[_0xd19d('0x35')],{'$or':_[_0xd19d('0x27')](_0x37fea7,function(_0x18f4fc){if(_0x18f4fc[_0xd19d('0x2b')]!==_0xd19d('0x39')){var _0x46e54b={};_0x46e54b[_0x18f4fc[_0xd19d('0x25')]]={'$like':'%'+_0x88b9f6[_0xd19d('0x2c')][_0xd19d('0x37')]+'%'};return _0x46e54b;}})});}_0x5f2c69=_[_0xd19d('0x38')]({},_0x5f2c69,_0x88b9f6[_0xd19d('0x3a')]);var _0x22fb9a={'where':_0x5f2c69['where']};return db['MailServerOut'][_0xd19d('0x1c')](_0x22fb9a)['then'](function(_0xfe5ad9){_0x25b25f[_0xd19d('0x1c')]=_0xfe5ad9;if(_0x88b9f6[_0xd19d('0x2c')][_0xd19d('0x3b')]){_0x5f2c69[_0xd19d('0x3c')]=[{'all':!![]}];}return db[_0xd19d('0x28')]['findAll'](_0x5f2c69);})[_0xd19d('0x22')](function(_0x5e34a1){_0x25b25f[_0xd19d('0x3d')]=_0x5e34a1;return _0x25b25f;})[_0xd19d('0x22')](respondWithFilteredResult(_0x13de91,_0x5f2c69))[_0xd19d('0x3e')](handleError(_0x13de91,null));};exports[_0xd19d('0x3f')]=function(_0x1c8de3,_0x1db19e){var _0x280589={'raw':!![],'where':{'id':_0x1c8de3[_0xd19d('0x40')]['id']}},_0x552fee={};_0x552fee[_0xd19d('0x2f')]=_[_0xd19d('0x41')](db[_0xd19d('0x28')][_0xd19d('0x29')]);_0x552fee['query']=_['keys'](_0x1c8de3[_0xd19d('0x2c')]);_0x552fee['filters']=_[_0xd19d('0x2e')](_0x552fee[_0xd19d('0x2f')],_0x552fee['query']);_0x280589[_0xd19d('0x30')]=_['intersection'](_0x552fee[_0xd19d('0x2f')],qs[_0xd19d('0x31')](_0x1c8de3[_0xd19d('0x2c')]['fields']));_0x280589['attributes']=_0x280589[_0xd19d('0x30')][_0xd19d('0x32')]?_0x280589['attributes']:_0x552fee['model'];if(_0x1c8de3['query'][_0xd19d('0x3b')]){_0x280589[_0xd19d('0x3c')]=[{'all':!![]}];}_0x280589=_[_0xd19d('0x38')]({},_0x280589,_0x1c8de3[_0xd19d('0x3a')]);return db[_0xd19d('0x28')][_0xd19d('0x42')](_0x280589)['then'](handleEntityNotFound(_0x1db19e,null))[_0xd19d('0x22')](respondWithResult(_0x1db19e,null))['catch'](handleError(_0x1db19e,null));};exports[_0xd19d('0x43')]=function(_0x4f406a,_0x2f7686){return db['MailServerOut'][_0xd19d('0x43')](_0x4f406a[_0xd19d('0x44')],{})[_0xd19d('0x22')](respondWithResult(_0x2f7686,0xc9))[_0xd19d('0x3e')](handleError(_0x2f7686,null));};exports[_0xd19d('0x45')]=function(_0x133daf,_0xea9432){if(_0x133daf[_0xd19d('0x44')]['id']){delete _0x133daf[_0xd19d('0x44')]['id'];}return db[_0xd19d('0x28')][_0xd19d('0x42')]({'where':{'id':_0x133daf[_0xd19d('0x40')]['id']}})[_0xd19d('0x22')](handleEntityNotFound(_0xea9432,null))[_0xd19d('0x22')](saveUpdates(_0x133daf[_0xd19d('0x44')],null))[_0xd19d('0x22')](respondWithResult(_0xea9432,null))[_0xd19d('0x3e')](handleError(_0xea9432,null));};exports[_0xd19d('0x23')]=function(_0x299359,_0x12898f){return db[_0xd19d('0x28')][_0xd19d('0x42')]({'where':{'id':_0x299359['params']['id']}})[_0xd19d('0x22')](handleEntityNotFound(_0x12898f,null))['then'](removeEntity(_0x12898f,null))[_0xd19d('0x3e')](handleError(_0x12898f,null));}; \ No newline at end of file +var _0xe728=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','update','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils'];(function(_0x44ac2b,_0x37eb5a){var _0x2aba3b=function(_0xf9143c){while(--_0xf9143c){_0x44ac2b['push'](_0x44ac2b['shift']());}};_0x2aba3b(++_0x37eb5a);}(_0xe728,0xfd));var _0x8e72=function(_0x3b633b,_0x24cdb5){_0x3b633b=_0x3b633b-0x0;var _0x1c0ef0=_0xe728[_0x3b633b];return _0x1c0ef0;};'use strict';var emlformat=require(_0x8e72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e72('0x1'));var jsonpatch=require(_0x8e72('0x2'));var rp=require(_0x8e72('0x3'));var moment=require(_0x8e72('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8e72('0x5'));var util=require(_0x8e72('0x6'));var path=require(_0x8e72('0x7'));var sox=require(_0x8e72('0x8'));var csv=require('to-csv');var ejs=require(_0x8e72('0x9'));var fs=require('fs');var fs_extra=require(_0x8e72('0xa'));var _=require(_0x8e72('0xb'));var squel=require('squel');var crypto=require(_0x8e72('0xc'));var jsforce=require(_0x8e72('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8e72('0xe'));var Papa=require('papaparse');var Redis=require(_0x8e72('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8e72('0x10'));var as=require(_0x8e72('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8e72('0x12'));var config=require(_0x8e72('0x13'));var licenseUtil=require(_0x8e72('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200352,_0x1ee30d){_0x1ee30d=_0x1ee30d||0xcc;return function(_0x250142){if(_0x250142){return _0x200352[_0x8e72('0x15')](_0x1ee30d);}return _0x200352[_0x8e72('0x16')](_0x1ee30d)[_0x8e72('0x17')]();};}function respondWithResult(_0x20883c,_0x5f43ec){_0x5f43ec=_0x5f43ec||0xc8;return function(_0x560066){if(_0x560066){return _0x20883c['status'](_0x5f43ec)[_0x8e72('0x18')](_0x560066);}};}function respondWithFilteredResult(_0x352fcd,_0xfbdbc0){return function(_0xc1f62c){if(_0xc1f62c){var _0x245afb=typeof _0xfbdbc0['offset']===_0x8e72('0x19')&&typeof _0xfbdbc0[_0x8e72('0x1a')]==='undefined';var _0x278b77=_0xc1f62c[_0x8e72('0x1b')];var _0x22b92d=_0x245afb?0x0:_0xfbdbc0[_0x8e72('0x1c')];var _0xdbc1ca=_0x245afb?_0xc1f62c[_0x8e72('0x1b')]:_0xfbdbc0['offset']+_0xfbdbc0[_0x8e72('0x1a')];var _0x124a1b;if(_0xdbc1ca>=_0x278b77){_0xdbc1ca=_0x278b77;_0x124a1b=0xc8;}else{_0x124a1b=0xce;}_0x352fcd[_0x8e72('0x16')](_0x124a1b);return _0x352fcd[_0x8e72('0x1d')]('Content-Range',_0x22b92d+'-'+_0xdbc1ca+'/'+_0x278b77)[_0x8e72('0x18')](_0xc1f62c);}return null;};}function patchUpdates(_0x137145){return function(_0x340871){try{jsonpatch['apply'](_0x340871,_0x137145,!![]);}catch(_0x32b64c){return BPromise[_0x8e72('0x1e')](_0x32b64c);}return _0x340871[_0x8e72('0x1f')]();};}function saveUpdates(_0x455526,_0x4fb4e1){return function(_0x2a97f9){if(_0x2a97f9){return _0x2a97f9['update'](_0x455526)[_0x8e72('0x20')](function(_0x3006a6){return _0x3006a6;});}return null;};}function removeEntity(_0x19679f,_0x30765e){return function(_0x127213){if(_0x127213){return _0x127213[_0x8e72('0x21')]()[_0x8e72('0x20')](function(){_0x19679f[_0x8e72('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd8ce6a,_0x9f16fd){return function(_0x3983b1){if(!_0x3983b1){_0xd8ce6a[_0x8e72('0x15')](0x194);}return _0x3983b1;};}function handleError(_0x55dff0,_0x926d37){_0x926d37=_0x926d37||0x1f4;return function(_0x344072){logger[_0x8e72('0x22')](_0x344072['stack']);if(_0x344072[_0x8e72('0x23')]){delete _0x344072[_0x8e72('0x23')];}_0x55dff0['status'](_0x926d37)[_0x8e72('0x24')](_0x344072);};}exports[_0x8e72('0x25')]=function(_0x54d064,_0x390309){var _0x46fb96={},_0x1d6294={},_0x4f9f4f={'count':0x0,'rows':[]};var _0x1db170=_[_0x8e72('0x26')](db[_0x8e72('0x27')][_0x8e72('0x28')],function(_0x2914da){return{'name':_0x2914da['fieldName'],'type':_0x2914da[_0x8e72('0x29')][_0x8e72('0x2a')]};});_0x1d6294[_0x8e72('0x2b')]=_['map'](_0x1db170,_0x8e72('0x23'));_0x1d6294['query']=_[_0x8e72('0x2c')](_0x54d064['query']);_0x1d6294['filters']=_['intersection'](_0x1d6294[_0x8e72('0x2b')],_0x1d6294[_0x8e72('0x2d')]);_0x46fb96[_0x8e72('0x2e')]=_[_0x8e72('0x2f')](_0x1d6294[_0x8e72('0x2b')],qs[_0x8e72('0x30')](_0x54d064[_0x8e72('0x2d')][_0x8e72('0x30')]));_0x46fb96['attributes']=_0x46fb96['attributes'][_0x8e72('0x31')]?_0x46fb96[_0x8e72('0x2e')]:_0x1d6294[_0x8e72('0x2b')];if(!_0x54d064[_0x8e72('0x2d')]['hasOwnProperty'](_0x8e72('0x32'))){_0x46fb96['limit']=qs[_0x8e72('0x1a')](_0x54d064['query'][_0x8e72('0x1a')]);_0x46fb96['offset']=qs['offset'](_0x54d064[_0x8e72('0x2d')][_0x8e72('0x1c')]);}_0x46fb96['order']=qs[_0x8e72('0x33')](_0x54d064[_0x8e72('0x2d')]['sort']);_0x46fb96[_0x8e72('0x34')]=qs[_0x8e72('0x35')](_['pick'](_0x54d064[_0x8e72('0x2d')],_0x1d6294[_0x8e72('0x35')]),_0x1db170);if(_0x54d064[_0x8e72('0x2d')][_0x8e72('0x36')]){_0x46fb96[_0x8e72('0x34')]=_[_0x8e72('0x37')](_0x46fb96[_0x8e72('0x34')],{'$or':_[_0x8e72('0x26')](_0x1db170,function(_0x5d6f7d){if(_0x5d6f7d[_0x8e72('0x29')]!==_0x8e72('0x38')){var _0x5e531d={};_0x5e531d[_0x5d6f7d[_0x8e72('0x23')]]={'$like':'%'+_0x54d064[_0x8e72('0x2d')][_0x8e72('0x36')]+'%'};return _0x5e531d;}})});}_0x46fb96=_['merge']({},_0x46fb96,_0x54d064[_0x8e72('0x39')]);var _0xb2eb63={'where':_0x46fb96[_0x8e72('0x34')]};return db[_0x8e72('0x27')]['count'](_0xb2eb63)[_0x8e72('0x20')](function(_0x36590c){_0x4f9f4f[_0x8e72('0x1b')]=_0x36590c;if(_0x54d064['query'][_0x8e72('0x3a')]){_0x46fb96[_0x8e72('0x3b')]=[{'all':!![]}];}return db[_0x8e72('0x27')][_0x8e72('0x3c')](_0x46fb96);})[_0x8e72('0x20')](function(_0x1b2a9c){_0x4f9f4f[_0x8e72('0x3d')]=_0x1b2a9c;return _0x4f9f4f;})['then'](respondWithFilteredResult(_0x390309,_0x46fb96))[_0x8e72('0x3e')](handleError(_0x390309,null));};exports[_0x8e72('0x3f')]=function(_0x407c04,_0x1bdbb8){var _0x2a01a0={'raw':!![],'where':{'id':_0x407c04['params']['id']}},_0xe5f8f0={};_0xe5f8f0['model']=_['keys'](db['MailServerOut'][_0x8e72('0x28')]);_0xe5f8f0[_0x8e72('0x2d')]=_[_0x8e72('0x2c')](_0x407c04[_0x8e72('0x2d')]);_0xe5f8f0[_0x8e72('0x35')]=_[_0x8e72('0x2f')](_0xe5f8f0[_0x8e72('0x2b')],_0xe5f8f0[_0x8e72('0x2d')]);_0x2a01a0[_0x8e72('0x2e')]=_[_0x8e72('0x2f')](_0xe5f8f0['model'],qs['fields'](_0x407c04[_0x8e72('0x2d')]['fields']));_0x2a01a0[_0x8e72('0x2e')]=_0x2a01a0[_0x8e72('0x2e')]['length']?_0x2a01a0[_0x8e72('0x2e')]:_0xe5f8f0[_0x8e72('0x2b')];if(_0x407c04[_0x8e72('0x2d')][_0x8e72('0x3a')]){_0x2a01a0[_0x8e72('0x3b')]=[{'all':!![]}];}_0x2a01a0=_['merge']({},_0x2a01a0,_0x407c04[_0x8e72('0x39')]);return db[_0x8e72('0x27')][_0x8e72('0x40')](_0x2a01a0)[_0x8e72('0x20')](handleEntityNotFound(_0x1bdbb8,null))['then'](respondWithResult(_0x1bdbb8,null))[_0x8e72('0x3e')](handleError(_0x1bdbb8,null));};exports['create']=function(_0x139382,_0x53c04c){return db[_0x8e72('0x27')]['create'](_0x139382['body'],{})[_0x8e72('0x20')](respondWithResult(_0x53c04c,0xc9))['catch'](handleError(_0x53c04c,null));};exports[_0x8e72('0x41')]=function(_0x489faf,_0x569968){if(_0x489faf['body']['id']){delete _0x489faf[_0x8e72('0x42')]['id'];}return db['MailServerOut'][_0x8e72('0x40')]({'where':{'id':_0x489faf[_0x8e72('0x43')]['id']}})[_0x8e72('0x20')](handleEntityNotFound(_0x569968,null))['then'](saveUpdates(_0x489faf['body'],null))[_0x8e72('0x20')](respondWithResult(_0x569968,null))[_0x8e72('0x3e')](handleError(_0x569968,null));};exports[_0x8e72('0x21')]=function(_0x14e71e,_0x389199){return db[_0x8e72('0x27')][_0x8e72('0x40')]({'where':{'id':_0x14e71e[_0x8e72('0x43')]['id']}})[_0x8e72('0x20')](handleEntityNotFound(_0x389199,null))[_0x8e72('0x20')](removeEntity(_0x389199,null))[_0x8e72('0x3e')](handleError(_0x389199,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d8bd184..f5e4032 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 _0x1471=['bluebird','path','rimraf','../../config/environment','define','MailServerOut','lodash','util','../../config/logger','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1471,0x16e));var _0x1147=function(_0x1df93d,_0xd82a8a){_0x1df93d=_0x1df93d-0x0;var _0x3ced2c=_0x1471[_0x1df93d];return _0x3ced2c;};'use strict';var _=require(_0x1147('0x0'));var util=require(_0x1147('0x1'));var logger=require(_0x1147('0x2'))(_0x1147('0x3'));var moment=require('moment');var BPromise=require(_0x1147('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1147('0x5'));var rimraf=require(_0x1147('0x6'));var config=require(_0x1147('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x26beac,_0x58d4f5){return _0x26beac[_0x1147('0x8')](_0x1147('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd75=['moment','bluebird','request-promise','path','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger'];(function(_0x4967d1,_0x24fae4){var _0x47ad88=function(_0x2f7978){while(--_0x2f7978){_0x4967d1['push'](_0x4967d1['shift']());}};_0x47ad88(++_0x24fae4);}(_0xfd75,0xfb));var _0x5fd7=function(_0x5e608c,_0x453591){_0x5e608c=_0x5e608c-0x0;var _0x44d7fc=_0xfd75[_0x5e608c];return _0x44d7fc;};'use strict';var _=require(_0x5fd7('0x0'));var util=require('util');var logger=require(_0x5fd7('0x1'))('api');var moment=require(_0x5fd7('0x2'));var BPromise=require(_0x5fd7('0x3'));var rp=require(_0x5fd7('0x4'));var fs=require('fs');var path=require(_0x5fd7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5fd7('0x6'));module[_0x5fd7('0x7')]=function(_0x500115,_0x3500e5){return _0x500115[_0x5fd7('0x8')](_0x5fd7('0x9'),attributes,{'tableName':_0x5fd7('0xa'),'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 ec236ab..e3d8c5d 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1e31f2,_0x3e48d1){var _0x3df225=function(_0x1d0985){while(--_0x1d0985){_0x1e31f2['push'](_0x1e31f2['shift']());}};_0x3df225(++_0x3e48d1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4dee28,_0x4ba755){var _0x37037d=function(_0x5a32d7){while(--_0x5a32d7){_0x4dee28['push'](_0x4dee28['shift']());}};_0x37037d(++_0x4ba755);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2de5a4,_0x1256d3){_0x2de5a4=_0x2de5a4-0x0;var _0x48a713=_0x5f2f[_0x2de5a4];return _0x48a713;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 84fc986..89be530 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 _0x4426=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x5d917c,_0x7846a){var _0x4e850f=function(_0x5409f2){while(--_0x5409f2){_0x5d917c['push'](_0x5d917c['shift']());}};_0x4e850f(++_0x7846a);}(_0x4426,0x1b5));var _0x6442=function(_0x278f72,_0x5780a9){_0x278f72=_0x278f72-0x0;var _0x43f343=_0x4426[_0x278f72];return _0x43f343;};'use strict';var multer=require('multer');var util=require(_0x6442('0x0'));var path=require(_0x6442('0x1'));var timeout=require(_0x6442('0x2'));var express=require(_0x6442('0x3'));var router=express[_0x6442('0x4')]();var fs_extra=require(_0x6442('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6442('0x6'));var config=require(_0x6442('0x7'));var controller=require(_0x6442('0x8'));router[_0x6442('0x9')]('/',auth[_0x6442('0xa')](),controller['index']);router[_0x6442('0x9')](_0x6442('0xb'),auth[_0x6442('0xa')](),controller[_0x6442('0xc')]);router[_0x6442('0x9')](_0x6442('0xd'),auth['isAuthenticated'](),controller[_0x6442('0xe')]);router[_0x6442('0xf')]('/',auth['isAuthenticated'](),controller[_0x6442('0x10')]);router[_0x6442('0x11')](_0x6442('0xd'),auth[_0x6442('0xa')](),controller[_0x6442('0x12')]);router['delete']('/:id',auth[_0x6442('0xa')](),controller[_0x6442('0x13')]);module[_0x6442('0x14')]=router; \ No newline at end of file +var _0xc823=['isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc823,0x16f));var _0x3c82=function(_0x5e7f6f,_0x48c204){_0x5e7f6f=_0x5e7f6f-0x0;var _0xa5cab2=_0xc823[_0x5e7f6f];return _0xa5cab2;};'use strict';var multer=require(_0x3c82('0x0'));var util=require(_0x3c82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c82('0x2'));var router=express[_0x3c82('0x3')]();var fs_extra=require(_0x3c82('0x4'));var auth=require(_0x3c82('0x5'));var interaction=require(_0x3c82('0x6'));var config=require('../../config/environment');var controller=require(_0x3c82('0x7'));router[_0x3c82('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c82('0x9')]);router['get'](_0x3c82('0xa'),auth[_0x3c82('0xb')](),controller[_0x3c82('0xc')]);router[_0x3c82('0x8')]('/:id',auth[_0x3c82('0xb')](),controller[_0x3c82('0xd')]);router[_0x3c82('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3c82('0xf')](_0x3c82('0x10'),auth[_0x3c82('0xb')](),controller[_0x3c82('0x11')]);router[_0x3c82('0x12')](_0x3c82('0x10'),auth[_0x3c82('0xb')](),controller[_0x3c82('0x13')]);module[_0x3c82('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 740346e..33f90dc 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 _0x2675=['STRING','sequelize'];(function(_0x5284f4,_0x38f8ec){var _0x345c76=function(_0x55c055){while(--_0x55c055){_0x5284f4['push'](_0x5284f4['shift']());}};_0x345c76(++_0x38f8ec);}(_0x2675,0x75));var _0x5267=function(_0x39ac54,_0x327942){_0x39ac54=_0x39ac54-0x0;var _0x544ff9=_0x2675[_0x39ac54];return _0x544ff9;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5267('0x1')]}}; \ No newline at end of file +var _0x0d4d=['STRING','name','sequelize','exports'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0x0d4d,0x132));var _0xd0d4=function(_0x1fcc1e,_0x2e1a46){_0x1fcc1e=_0x1fcc1e-0x0;var _0x447e70=_0x0d4d[_0x1fcc1e];return _0x447e70;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':_0xd0d4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 482ca6f..cedebfe 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 _0x7f5d=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','json','reject','save','then','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','describe'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x7f5d,0x1c8));var _0xd7f5=function(_0x270935,_0xd549a5){_0x270935=_0x270935-0x0;var _0x560e7a=_0x7f5d[_0x270935];return _0x560e7a;};'use strict';var emlformat=require(_0xd7f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7f5('0x1'));var jsonpatch=require(_0xd7f5('0x2'));var rp=require(_0xd7f5('0x3'));var moment=require(_0xd7f5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd7f5('0x5'));var util=require(_0xd7f5('0x6'));var path=require(_0xd7f5('0x7'));var sox=require(_0xd7f5('0x8'));var csv=require(_0xd7f5('0x9'));var ejs=require(_0xd7f5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7f5('0xb'));var squel=require(_0xd7f5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd7f5('0xd'));var Papa=require(_0xd7f5('0xe'));var Redis=require(_0xd7f5('0xf'));var authService=require(_0xd7f5('0x10'));var qs=require(_0xd7f5('0x11'));var as=require(_0xd7f5('0x12'));var hardwareService=require(_0xd7f5('0x13'));var logger=require('../../config/logger')(_0xd7f5('0x14'));var utils=require(_0xd7f5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd7f5('0x16'));var db=require(_0xd7f5('0x17'))['db'];function respondWithStatusCode(_0x384a9a,_0x3d6608){_0x3d6608=_0x3d6608||0xcc;return function(_0x14414c){if(_0x14414c){return _0x384a9a['sendStatus'](_0x3d6608);}return _0x384a9a[_0xd7f5('0x18')](_0x3d6608)[_0xd7f5('0x19')]();};}function respondWithResult(_0x5ec8c9,_0x8c86b7){_0x8c86b7=_0x8c86b7||0xc8;return function(_0x2da996){if(_0x2da996){return _0x5ec8c9[_0xd7f5('0x18')](_0x8c86b7)['json'](_0x2da996);}};}function respondWithFilteredResult(_0x18fff1,_0x1598af){return function(_0x3951b7){if(_0x3951b7){var _0x4fc970=typeof _0x1598af[_0xd7f5('0x1a')]==='undefined'&&typeof _0x1598af[_0xd7f5('0x1b')]===_0xd7f5('0x1c');var _0x54de5f=_0x3951b7[_0xd7f5('0x1d')];var _0x59ba77=_0x4fc970?0x0:_0x1598af[_0xd7f5('0x1a')];var _0x15662a=_0x4fc970?_0x3951b7[_0xd7f5('0x1d')]:_0x1598af[_0xd7f5('0x1a')]+_0x1598af[_0xd7f5('0x1b')];var _0x45c3b2;if(_0x15662a>=_0x54de5f){_0x15662a=_0x54de5f;_0x45c3b2=0xc8;}else{_0x45c3b2=0xce;}_0x18fff1[_0xd7f5('0x18')](_0x45c3b2);return _0x18fff1[_0xd7f5('0x1e')]('Content-Range',_0x59ba77+'-'+_0x15662a+'/'+_0x54de5f)[_0xd7f5('0x1f')](_0x3951b7);}return null;};}function patchUpdates(_0x433175){return function(_0x3e5eb3){try{jsonpatch['apply'](_0x3e5eb3,_0x433175,!![]);}catch(_0x160680){return BPromise[_0xd7f5('0x20')](_0x160680);}return _0x3e5eb3[_0xd7f5('0x21')]();};}function saveUpdates(_0x1c1077,_0x624198){return function(_0x382607){if(_0x382607){return _0x382607['update'](_0x1c1077)[_0xd7f5('0x22')](function(_0x1d3396){return _0x1d3396;});}return null;};}function removeEntity(_0x3c2af4,_0xf98aac){return function(_0x19f479){if(_0x19f479){return _0x19f479['destroy']()['then'](function(){_0x3c2af4[_0xd7f5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cf924,_0x5ae6f9){return function(_0x4f4ce1){if(!_0x4f4ce1){_0x3cf924[_0xd7f5('0x23')](0x194);}return _0x4f4ce1;};}function handleError(_0x4b16d6,_0x1f2aa4){_0x1f2aa4=_0x1f2aa4||0x1f4;return function(_0x2f8c78){logger[_0xd7f5('0x24')](_0x2f8c78[_0xd7f5('0x25')]);if(_0x2f8c78[_0xd7f5('0x26')]){delete _0x2f8c78[_0xd7f5('0x26')];}_0x4b16d6['status'](_0x1f2aa4)[_0xd7f5('0x27')](_0x2f8c78);};}exports[_0xd7f5('0x28')]=function(_0x35c340,_0x17cb6b){var _0x425bc5={},_0x4a9d9f={},_0x1e323d={'count':0x0,'rows':[]};var _0x5ea0ea=_[_0xd7f5('0x29')](db[_0xd7f5('0x2a')][_0xd7f5('0x2b')],function(_0x2b5bed){return{'name':_0x2b5bed[_0xd7f5('0x2c')],'type':_0x2b5bed[_0xd7f5('0x2d')][_0xd7f5('0x2e')]};});_0x4a9d9f['model']=_[_0xd7f5('0x29')](_0x5ea0ea,_0xd7f5('0x26'));_0x4a9d9f[_0xd7f5('0x2f')]=_[_0xd7f5('0x30')](_0x35c340[_0xd7f5('0x2f')]);_0x4a9d9f['filters']=_[_0xd7f5('0x31')](_0x4a9d9f[_0xd7f5('0x32')],_0x4a9d9f[_0xd7f5('0x2f')]);_0x425bc5[_0xd7f5('0x33')]=_[_0xd7f5('0x31')](_0x4a9d9f[_0xd7f5('0x32')],qs[_0xd7f5('0x34')](_0x35c340['query'][_0xd7f5('0x34')]));_0x425bc5['attributes']=_0x425bc5[_0xd7f5('0x33')][_0xd7f5('0x35')]?_0x425bc5[_0xd7f5('0x33')]:_0x4a9d9f[_0xd7f5('0x32')];if(!_0x35c340[_0xd7f5('0x2f')][_0xd7f5('0x36')](_0xd7f5('0x37'))){_0x425bc5[_0xd7f5('0x1b')]=qs['limit'](_0x35c340[_0xd7f5('0x2f')][_0xd7f5('0x1b')]);_0x425bc5[_0xd7f5('0x1a')]=qs[_0xd7f5('0x1a')](_0x35c340['query'][_0xd7f5('0x1a')]);}_0x425bc5[_0xd7f5('0x38')]=qs[_0xd7f5('0x39')](_0x35c340[_0xd7f5('0x2f')][_0xd7f5('0x39')]);_0x425bc5[_0xd7f5('0x3a')]=qs[_0xd7f5('0x3b')](_['pick'](_0x35c340[_0xd7f5('0x2f')],_0x4a9d9f['filters']),_0x5ea0ea);if(_0x35c340[_0xd7f5('0x2f')][_0xd7f5('0x3c')]){_0x425bc5[_0xd7f5('0x3a')]=_['merge'](_0x425bc5['where'],{'$or':_[_0xd7f5('0x29')](_0x5ea0ea,function(_0x4c15d1){if(_0x4c15d1['type']!==_0xd7f5('0x3d')){var _0x15067b={};_0x15067b[_0x4c15d1[_0xd7f5('0x26')]]={'$like':'%'+_0x35c340[_0xd7f5('0x2f')][_0xd7f5('0x3c')]+'%'};return _0x15067b;}})});}_0x425bc5=_[_0xd7f5('0x3e')]({},_0x425bc5,_0x35c340[_0xd7f5('0x3f')]);var _0x367e0d={'where':_0x425bc5['where']};return db[_0xd7f5('0x2a')][_0xd7f5('0x1d')](_0x367e0d)[_0xd7f5('0x22')](function(_0x45987d){_0x1e323d[_0xd7f5('0x1d')]=_0x45987d;if(_0x35c340[_0xd7f5('0x2f')][_0xd7f5('0x40')]){_0x425bc5[_0xd7f5('0x41')]=[{'all':!![]}];}return db[_0xd7f5('0x2a')][_0xd7f5('0x42')](_0x425bc5);})['then'](function(_0x240e91){_0x1e323d[_0xd7f5('0x43')]=_0x240e91;return _0x1e323d;})['then'](respondWithFilteredResult(_0x17cb6b,_0x425bc5))[_0xd7f5('0x44')](handleError(_0x17cb6b,null));};exports['show']=function(_0x5aca1b,_0x3967d4){var _0x3fbb07={'raw':!![],'where':{'id':_0x5aca1b[_0xd7f5('0x45')]['id']}},_0x255e96={};_0x255e96[_0xd7f5('0x32')]=_[_0xd7f5('0x30')](db[_0xd7f5('0x2a')][_0xd7f5('0x2b')]);_0x255e96[_0xd7f5('0x2f')]=_[_0xd7f5('0x30')](_0x5aca1b['query']);_0x255e96[_0xd7f5('0x3b')]=_[_0xd7f5('0x31')](_0x255e96[_0xd7f5('0x32')],_0x255e96[_0xd7f5('0x2f')]);_0x3fbb07['attributes']=_['intersection'](_0x255e96[_0xd7f5('0x32')],qs['fields'](_0x5aca1b['query'][_0xd7f5('0x34')]));_0x3fbb07[_0xd7f5('0x33')]=_0x3fbb07[_0xd7f5('0x33')][_0xd7f5('0x35')]?_0x3fbb07['attributes']:_0x255e96[_0xd7f5('0x32')];if(_0x5aca1b[_0xd7f5('0x2f')][_0xd7f5('0x40')]){_0x3fbb07[_0xd7f5('0x41')]=[{'all':!![]}];}_0x3fbb07=_['merge']({},_0x3fbb07,_0x5aca1b[_0xd7f5('0x3f')]);return db['MailSubstatus'][_0xd7f5('0x46')](_0x3fbb07)[_0xd7f5('0x22')](handleEntityNotFound(_0x3967d4,null))['then'](respondWithResult(_0x3967d4,null))['catch'](handleError(_0x3967d4,null));};exports[_0xd7f5('0x47')]=function(_0x26f15e,_0x380049){return db[_0xd7f5('0x2a')][_0xd7f5('0x47')](_0x26f15e[_0xd7f5('0x48')],{})[_0xd7f5('0x22')](respondWithResult(_0x380049,0xc9))['catch'](handleError(_0x380049,null));};exports[_0xd7f5('0x49')]=function(_0x35e222,_0x370c60){if(_0x35e222[_0xd7f5('0x48')]['id']){delete _0x35e222[_0xd7f5('0x48')]['id'];}return db[_0xd7f5('0x2a')][_0xd7f5('0x46')]({'where':{'id':_0x35e222[_0xd7f5('0x45')]['id']}})[_0xd7f5('0x22')](handleEntityNotFound(_0x370c60,null))[_0xd7f5('0x22')](saveUpdates(_0x35e222[_0xd7f5('0x48')],null))['then'](respondWithResult(_0x370c60,null))[_0xd7f5('0x44')](handleError(_0x370c60,null));};exports[_0xd7f5('0x4a')]=function(_0x4733e9,_0x1d7277){return db[_0xd7f5('0x2a')][_0xd7f5('0x46')]({'where':{'id':_0x4733e9[_0xd7f5('0x45')]['id']}})[_0xd7f5('0x22')](handleEntityNotFound(_0x1d7277,null))['then'](removeEntity(_0x1d7277,null))[_0xd7f5('0x44')](handleError(_0x1d7277,null));};exports[_0xd7f5('0x4b')]=function(_0x450e1b,_0x3f794b){return db[_0xd7f5('0x2a')][_0xd7f5('0x4b')]()[_0xd7f5('0x22')](respondWithResult(_0x3f794b,null))[_0xd7f5('0x44')](handleError(_0x3f794b,null));}; \ No newline at end of file +var _0xd143=['sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','VIRTUAL','findAll','then','rows','show','keys','include','merge','options','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xd143,0xbc));var _0x3d14=function(_0xc55a7d,_0x2ebbe8){_0xc55a7d=_0xc55a7d-0x0;var _0x58bae7=_0xd143[_0xc55a7d];return _0x58bae7;};'use strict';var emlformat=require(_0x3d14('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d14('0x1'));var jsonpatch=require(_0x3d14('0x2'));var rp=require(_0x3d14('0x3'));var moment=require(_0x3d14('0x4'));var BPromise=require(_0x3d14('0x5'));var Mustache=require(_0x3d14('0x6'));var util=require(_0x3d14('0x7'));var path=require(_0x3d14('0x8'));var sox=require('sox');var csv=require(_0x3d14('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d14('0xa'));var _=require(_0x3d14('0xb'));var squel=require(_0x3d14('0xc'));var crypto=require(_0x3d14('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3d14('0xe'));var toCsv=require(_0x3d14('0x9'));var querystring=require('querystring');var Papa=require(_0x3d14('0xf'));var Redis=require(_0x3d14('0x10'));var authService=require(_0x3d14('0x11'));var qs=require(_0x3d14('0x12'));var as=require(_0x3d14('0x13'));var hardwareService=require(_0x3d14('0x14'));var logger=require(_0x3d14('0x15'))(_0x3d14('0x16'));var utils=require('../../config/utils');var config=require(_0x3d14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d14('0x18'))['db'];function respondWithStatusCode(_0x202580,_0x119c88){_0x119c88=_0x119c88||0xcc;return function(_0x997394){if(_0x997394){return _0x202580['sendStatus'](_0x119c88);}return _0x202580[_0x3d14('0x19')](_0x119c88)[_0x3d14('0x1a')]();};}function respondWithResult(_0x30eb56,_0x64e1d1){_0x64e1d1=_0x64e1d1||0xc8;return function(_0x3a836c){if(_0x3a836c){return _0x30eb56['status'](_0x64e1d1)[_0x3d14('0x1b')](_0x3a836c);}};}function respondWithFilteredResult(_0x2ecc5f,_0x309cef){return function(_0x943b4d){if(_0x943b4d){var _0x12c654=typeof _0x309cef[_0x3d14('0x1c')]==='undefined'&&typeof _0x309cef[_0x3d14('0x1d')]===_0x3d14('0x1e');var _0x3954e1=_0x943b4d[_0x3d14('0x1f')];var _0xf46c7c=_0x12c654?0x0:_0x309cef[_0x3d14('0x1c')];var _0x4c30fd=_0x12c654?_0x943b4d[_0x3d14('0x1f')]:_0x309cef[_0x3d14('0x1c')]+_0x309cef[_0x3d14('0x1d')];var _0x17700a;if(_0x4c30fd>=_0x3954e1){_0x4c30fd=_0x3954e1;_0x17700a=0xc8;}else{_0x17700a=0xce;}_0x2ecc5f['status'](_0x17700a);return _0x2ecc5f['set'](_0x3d14('0x20'),_0xf46c7c+'-'+_0x4c30fd+'/'+_0x3954e1)[_0x3d14('0x1b')](_0x943b4d);}return null;};}function patchUpdates(_0x29f86c){return function(_0x35ce35){try{jsonpatch[_0x3d14('0x21')](_0x35ce35,_0x29f86c,!![]);}catch(_0x4cf2e6){return BPromise[_0x3d14('0x22')](_0x4cf2e6);}return _0x35ce35[_0x3d14('0x23')]();};}function saveUpdates(_0x379745,_0x1c9500){return function(_0x58ffb0){if(_0x58ffb0){return _0x58ffb0['update'](_0x379745)['then'](function(_0x141cca){return _0x141cca;});}return null;};}function removeEntity(_0x1822cc,_0x213a6c){return function(_0x232892){if(_0x232892){return _0x232892[_0x3d14('0x24')]()['then'](function(){_0x1822cc[_0x3d14('0x19')](0xcc)[_0x3d14('0x1a')]();});}};}function handleEntityNotFound(_0x543041,_0x2194da){return function(_0x4c1eac){if(!_0x4c1eac){_0x543041[_0x3d14('0x25')](0x194);}return _0x4c1eac;};}function handleError(_0x54b8d8,_0x338b5d){_0x338b5d=_0x338b5d||0x1f4;return function(_0x2de3f9){logger[_0x3d14('0x26')](_0x2de3f9[_0x3d14('0x27')]);if(_0x2de3f9[_0x3d14('0x28')]){delete _0x2de3f9['name'];}_0x54b8d8['status'](_0x338b5d)[_0x3d14('0x29')](_0x2de3f9);};}exports[_0x3d14('0x2a')]=function(_0x5390d6,_0x3b506e){var _0xbaafa3={},_0x3ca15f={},_0xbec71a={'count':0x0,'rows':[]};var _0x3e4e27=_[_0x3d14('0x2b')](db[_0x3d14('0x2c')][_0x3d14('0x2d')],function(_0x43782b){return{'name':_0x43782b['fieldName'],'type':_0x43782b[_0x3d14('0x2e')][_0x3d14('0x2f')]};});_0x3ca15f[_0x3d14('0x30')]=_['map'](_0x3e4e27,_0x3d14('0x28'));_0x3ca15f[_0x3d14('0x31')]=_['keys'](_0x5390d6[_0x3d14('0x31')]);_0x3ca15f[_0x3d14('0x32')]=_['intersection'](_0x3ca15f[_0x3d14('0x30')],_0x3ca15f[_0x3d14('0x31')]);_0xbaafa3['attributes']=_[_0x3d14('0x33')](_0x3ca15f[_0x3d14('0x30')],qs['fields'](_0x5390d6[_0x3d14('0x31')][_0x3d14('0x34')]));_0xbaafa3[_0x3d14('0x35')]=_0xbaafa3[_0x3d14('0x35')]['length']?_0xbaafa3[_0x3d14('0x35')]:_0x3ca15f[_0x3d14('0x30')];if(!_0x5390d6['query']['hasOwnProperty']('nolimit')){_0xbaafa3[_0x3d14('0x1d')]=qs['limit'](_0x5390d6[_0x3d14('0x31')][_0x3d14('0x1d')]);_0xbaafa3['offset']=qs[_0x3d14('0x1c')](_0x5390d6[_0x3d14('0x31')][_0x3d14('0x1c')]);}_0xbaafa3[_0x3d14('0x36')]=qs[_0x3d14('0x37')](_0x5390d6[_0x3d14('0x31')]['sort']);_0xbaafa3[_0x3d14('0x38')]=qs['filters'](_[_0x3d14('0x39')](_0x5390d6[_0x3d14('0x31')],_0x3ca15f['filters']),_0x3e4e27);if(_0x5390d6[_0x3d14('0x31')][_0x3d14('0x3a')]){_0xbaafa3['where']=_['merge'](_0xbaafa3['where'],{'$or':_[_0x3d14('0x2b')](_0x3e4e27,function(_0x32971f){if(_0x32971f[_0x3d14('0x2e')]!==_0x3d14('0x3b')){var _0x25fcd1={};_0x25fcd1[_0x32971f[_0x3d14('0x28')]]={'$like':'%'+_0x5390d6['query'][_0x3d14('0x3a')]+'%'};return _0x25fcd1;}})});}_0xbaafa3=_['merge']({},_0xbaafa3,_0x5390d6['options']);var _0x552795={'where':_0xbaafa3[_0x3d14('0x38')]};return db[_0x3d14('0x2c')]['count'](_0x552795)['then'](function(_0x3d1039){_0xbec71a[_0x3d14('0x1f')]=_0x3d1039;if(_0x5390d6[_0x3d14('0x31')]['includeAll']){_0xbaafa3['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x3d14('0x3c')](_0xbaafa3);})[_0x3d14('0x3d')](function(_0x397314){_0xbec71a[_0x3d14('0x3e')]=_0x397314;return _0xbec71a;})['then'](respondWithFilteredResult(_0x3b506e,_0xbaafa3))['catch'](handleError(_0x3b506e,null));};exports[_0x3d14('0x3f')]=function(_0x51fefb,_0x616d7){var _0x188b7e={'raw':!![],'where':{'id':_0x51fefb['params']['id']}},_0x392d14={};_0x392d14[_0x3d14('0x30')]=_[_0x3d14('0x40')](db[_0x3d14('0x2c')]['rawAttributes']);_0x392d14[_0x3d14('0x31')]=_['keys'](_0x51fefb[_0x3d14('0x31')]);_0x392d14['filters']=_[_0x3d14('0x33')](_0x392d14[_0x3d14('0x30')],_0x392d14['query']);_0x188b7e[_0x3d14('0x35')]=_[_0x3d14('0x33')](_0x392d14[_0x3d14('0x30')],qs[_0x3d14('0x34')](_0x51fefb[_0x3d14('0x31')]['fields']));_0x188b7e[_0x3d14('0x35')]=_0x188b7e[_0x3d14('0x35')]['length']?_0x188b7e[_0x3d14('0x35')]:_0x392d14['model'];if(_0x51fefb[_0x3d14('0x31')]['includeAll']){_0x188b7e[_0x3d14('0x41')]=[{'all':!![]}];}_0x188b7e=_[_0x3d14('0x42')]({},_0x188b7e,_0x51fefb[_0x3d14('0x43')]);return db[_0x3d14('0x2c')][_0x3d14('0x44')](_0x188b7e)[_0x3d14('0x3d')](handleEntityNotFound(_0x616d7,null))[_0x3d14('0x3d')](respondWithResult(_0x616d7,null))[_0x3d14('0x45')](handleError(_0x616d7,null));};exports['create']=function(_0x45c2af,_0xeaa23d){return db[_0x3d14('0x2c')][_0x3d14('0x46')](_0x45c2af[_0x3d14('0x47')],{})[_0x3d14('0x3d')](respondWithResult(_0xeaa23d,0xc9))[_0x3d14('0x45')](handleError(_0xeaa23d,null));};exports[_0x3d14('0x48')]=function(_0x38cb14,_0x8d76d0){if(_0x38cb14[_0x3d14('0x47')]['id']){delete _0x38cb14['body']['id'];}return db[_0x3d14('0x2c')]['find']({'where':{'id':_0x38cb14[_0x3d14('0x49')]['id']}})[_0x3d14('0x3d')](handleEntityNotFound(_0x8d76d0,null))[_0x3d14('0x3d')](saveUpdates(_0x38cb14['body'],null))[_0x3d14('0x3d')](respondWithResult(_0x8d76d0,null))[_0x3d14('0x45')](handleError(_0x8d76d0,null));};exports[_0x3d14('0x24')]=function(_0x678e5e,_0x230e60){return db[_0x3d14('0x2c')][_0x3d14('0x44')]({'where':{'id':_0x678e5e[_0x3d14('0x49')]['id']}})[_0x3d14('0x3d')](handleEntityNotFound(_0x230e60,null))[_0x3d14('0x3d')](removeEntity(_0x230e60,null))[_0x3d14('0x45')](handleError(_0x230e60,null));};exports[_0x3d14('0x4a')]=function(_0x12168f,_0x3c9b6d){return db[_0x3d14('0x2c')][_0x3d14('0x4a')]()['then'](respondWithResult(_0x3c9b6d,null))[_0x3d14('0x45')](handleError(_0x3c9b6d,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 29ee371..d82a880 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 _0xe658=['bluebird','request-promise','rimraf','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment'];(function(_0x56085e,_0x5c69e9){var _0x4de130=function(_0x120b34){while(--_0x120b34){_0x56085e['push'](_0x56085e['shift']());}};_0x4de130(++_0x5c69e9);}(_0xe658,0xaf));var _0x8e65=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe658[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8e65('0x0'));var util=require(_0x8e65('0x1'));var logger=require(_0x8e65('0x2'))(_0x8e65('0x3'));var moment=require(_0x8e65('0x4'));var BPromise=require(_0x8e65('0x5'));var rp=require(_0x8e65('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e65('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e65('0x8'));module[_0x8e65('0x9')]=function(_0x445646,_0x3b3d3b){return _0x445646['define'](_0x8e65('0xa'),attributes,{'tableName':_0x8e65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3df4=['rimraf','exports','define','MailSubstatus','lodash','util','../../config/logger','moment','bluebird'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x3df4,0xdc));var _0x43df=function(_0xb3d0ca,_0x28b0bc){_0xb3d0ca=_0xb3d0ca-0x0;var _0x5dc753=_0x3df4[_0xb3d0ca];return _0x5dc753;};'use strict';var _=require(_0x43df('0x0'));var util=require(_0x43df('0x1'));var logger=require(_0x43df('0x2'))('api');var moment=require(_0x43df('0x3'));var BPromise=require(_0x43df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x43df('0x5'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0x43df('0x6')]=function(_0x156970,_0x128b8e){return _0x156970[_0x43df('0x7')](_0x43df('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 34ec065..0730b4a 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 _0x04b7=['MailSubstatus,\x20%s,\x20%s','request\x20sent','error','message','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x04b7,0x105));var _0x704b=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0x04b7[_0x233cb1];return _0x29ee7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x704b('0x0'));var fs=require('fs');var Redis=require(_0x704b('0x1'));var db=require(_0x704b('0x2'))['db'];var utils=require(_0x704b('0x3'));var logger=require(_0x704b('0x4'))(_0x704b('0x5'));var config=require('../../config/environment');var jayson=require(_0x704b('0x6'));var client=jayson['client'][_0x704b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1232d5,_0x2bf046,_0x5a3661){return new BPromise(function(_0x62a821,_0x3a8ce5){return client[_0x704b('0x8')](_0x1232d5,_0x5a3661)[_0x704b('0x9')](function(_0x3c9d7e){logger[_0x704b('0xa')](_0x704b('0xb'),_0x2bf046,_0x704b('0xc'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2bf046,_0x704b('0xc'),JSON['stringify'](_0x3c9d7e));if(_0x3c9d7e[_0x704b('0xd')]){if(_0x3c9d7e[_0x704b('0xd')]['code']===0x1f4){logger[_0x704b('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x2bf046,_0x3c9d7e[_0x704b('0xd')]['message']);return _0x3a8ce5(_0x3c9d7e['error'][_0x704b('0xe')]);}logger[_0x704b('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x2bf046,_0x3c9d7e[_0x704b('0xd')][_0x704b('0xe')]);return _0x62a821(_0x3c9d7e[_0x704b('0xd')][_0x704b('0xe')]);}else{logger[_0x704b('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x2bf046,_0x704b('0xc'));_0x62a821(_0x3c9d7e['result'][_0x704b('0xe')]);}})[_0x704b('0xf')](function(_0x21dbab){logger[_0x704b('0xd')](_0x704b('0xb'),_0x2bf046,_0x21dbab);_0x3a8ce5(_0x21dbab);});});} \ No newline at end of file +var _0xb109=['MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0xb109,0xf7));var _0x9b10=function(_0x5b3496,_0x31c442){_0x5b3496=_0x5b3496-0x0;var _0x216727=_0xb109[_0x5b3496];return _0x216727;};'use strict';var _=require('lodash');var util=require(_0x9b10('0x0'));var moment=require(_0x9b10('0x1'));var BPromise=require(_0x9b10('0x2'));var rs=require(_0x9b10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b10('0x4'))['db'];var utils=require(_0x9b10('0x5'));var logger=require(_0x9b10('0x6'))(_0x9b10('0x7'));var config=require(_0x9b10('0x8'));var jayson=require(_0x9b10('0x9'));var client=jayson[_0x9b10('0xa')][_0x9b10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x233b8f,_0x9e2291,_0x4275d3){return new BPromise(function(_0x3d7bba,_0x2a5e43){return client[_0x9b10('0xc')](_0x233b8f,_0x4275d3)[_0x9b10('0xd')](function(_0x418c59){logger[_0x9b10('0xe')](_0x9b10('0xf'),_0x9e2291,'request\x20sent');logger[_0x9b10('0x10')](_0x9b10('0x11'),_0x9e2291,_0x9b10('0x12'),JSON['stringify'](_0x418c59));if(_0x418c59[_0x9b10('0x13')]){if(_0x418c59[_0x9b10('0x13')]['code']===0x1f4){logger[_0x9b10('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x9e2291,_0x418c59[_0x9b10('0x13')][_0x9b10('0x14')]);return _0x2a5e43(_0x418c59[_0x9b10('0x13')][_0x9b10('0x14')]);}logger[_0x9b10('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x9e2291,_0x418c59[_0x9b10('0x13')]['message']);return _0x3d7bba(_0x418c59[_0x9b10('0x13')][_0x9b10('0x14')]);}else{logger[_0x9b10('0xe')](_0x9b10('0xf'),_0x9e2291,_0x9b10('0x12'));_0x3d7bba(_0x418c59[_0x9b10('0x15')][_0x9b10('0x14')]);}})['catch'](function(_0xd3d38e){logger['error'](_0x9b10('0xf'),_0x9e2291,_0xd3d38e);_0x2a5e43(_0xd3d38e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d5e1f4c..7c0ddb6 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 _0xd182=['describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailTransferReport.controller','get','index','/describe'];(function(_0x50b7a6,_0x287986){var _0x5441f5=function(_0x50523c){while(--_0x50523c){_0x50b7a6['push'](_0x50b7a6['shift']());}};_0x5441f5(++_0x287986);}(_0xd182,0x1c0));var _0x2d18=function(_0x5af0c2,_0x76a73d){_0x5af0c2=_0x5af0c2-0x0;var _0x48da88=_0xd182[_0x5af0c2];return _0x48da88;};'use strict';var multer=require(_0x2d18('0x0'));var util=require(_0x2d18('0x1'));var path=require(_0x2d18('0x2'));var timeout=require(_0x2d18('0x3'));var express=require(_0x2d18('0x4'));var router=express[_0x2d18('0x5')]();var fs_extra=require(_0x2d18('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d18('0x7'));var controller=require(_0x2d18('0x8'));router[_0x2d18('0x9')]('/',auth['isAuthenticated'](),controller[_0x2d18('0xa')]);router[_0x2d18('0x9')](_0x2d18('0xb'),auth['isAuthenticated'](),controller[_0x2d18('0xc')]);router[_0x2d18('0x9')](_0x2d18('0xd'),auth[_0x2d18('0xe')](),controller[_0x2d18('0xf')]);router[_0x2d18('0x10')]('/',auth['isAuthenticated'](),controller[_0x2d18('0x11')]);router[_0x2d18('0x12')](_0x2d18('0xd'),auth['isAuthenticated'](),controller[_0x2d18('0x13')]);router[_0x2d18('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x2d18('0x15')]);module[_0x2d18('0x16')]=router; \ No newline at end of file +var _0x6ca2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ca2,0x1b2));var _0x26ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6ca2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x26ca('0x0'));var util=require(_0x26ca('0x1'));var path=require(_0x26ca('0x2'));var timeout=require(_0x26ca('0x3'));var express=require(_0x26ca('0x4'));var router=express[_0x26ca('0x5')]();var fs_extra=require(_0x26ca('0x6'));var auth=require(_0x26ca('0x7'));var interaction=require(_0x26ca('0x8'));var config=require(_0x26ca('0x9'));var controller=require(_0x26ca('0xa'));router[_0x26ca('0xb')]('/',auth[_0x26ca('0xc')](),controller[_0x26ca('0xd')]);router[_0x26ca('0xb')](_0x26ca('0xe'),auth[_0x26ca('0xc')](),controller['describe']);router['get'](_0x26ca('0xf'),auth[_0x26ca('0xc')](),controller[_0x26ca('0x10')]);router['post']('/',auth[_0x26ca('0xc')](),controller[_0x26ca('0x11')]);router[_0x26ca('0x12')](_0x26ca('0xf'),auth[_0x26ca('0xc')](),controller['update']);router[_0x26ca('0x13')](_0x26ca('0xf'),auth[_0x26ca('0xc')](),controller[_0x26ca('0x14')]);module[_0x26ca('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d9fb4ff..ab80f50 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(_0x2f3a46,_0x25335f){var _0x98fa2f=function(_0x377b08){while(--_0x377b08){_0x2f3a46['push'](_0x2f3a46['shift']());}};_0x98fa2f(++_0x25335f);}(_0x34e8,0x12c));var _0x834e=function(_0x2a0115,_0x506eb6){_0x2a0115=_0x2a0115-0x0;var _0x3c76d6=_0x34e8[_0x2a0115];return _0x3c76d6;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x35a193,_0x12de92){var _0x3fd20d=function(_0x134658){while(--_0x134658){_0x35a193['push'](_0x35a193['shift']());}};_0x3fd20d(++_0x12de92);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xdb4e73,_0x30b446){_0xdb4e73=_0xdb4e73-0x0;var _0x4578b4=_0xf3cd[_0xdb4e73];return _0x4578b4;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ec1da98..fe24763 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 _0x4f75=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','catch','show','params','length','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x555c0b,_0x2a5cae){var _0x7f508=function(_0x1b511b){while(--_0x1b511b){_0x555c0b['push'](_0x555c0b['shift']());}};_0x7f508(++_0x2a5cae);}(_0x4f75,0x7c));var _0x54f7=function(_0x3ae48e,_0x57ece9){_0x3ae48e=_0x3ae48e-0x0;var _0x259f3a=_0x4f75[_0x3ae48e];return _0x259f3a;};'use strict';var emlformat=require(_0x54f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54f7('0x1'));var jsonpatch=require(_0x54f7('0x2'));var rp=require(_0x54f7('0x3'));var moment=require(_0x54f7('0x4'));var BPromise=require(_0x54f7('0x5'));var Mustache=require(_0x54f7('0x6'));var util=require(_0x54f7('0x7'));var path=require('path');var sox=require(_0x54f7('0x8'));var csv=require(_0x54f7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54f7('0xa'));var _=require(_0x54f7('0xb'));var squel=require('squel');var crypto=require(_0x54f7('0xc'));var jsforce=require(_0x54f7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x54f7('0x9'));var querystring=require('querystring');var Papa=require(_0x54f7('0xe'));var Redis=require(_0x54f7('0xf'));var authService=require(_0x54f7('0x10'));var qs=require(_0x54f7('0x11'));var as=require(_0x54f7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54f7('0x13'))(_0x54f7('0x14'));var utils=require(_0x54f7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x54f7('0x16'));var db=require(_0x54f7('0x17'))['db'];function respondWithStatusCode(_0x502a25,_0x4c7c8b){_0x4c7c8b=_0x4c7c8b||0xcc;return function(_0x23bff0){if(_0x23bff0){return _0x502a25[_0x54f7('0x18')](_0x4c7c8b);}return _0x502a25[_0x54f7('0x19')](_0x4c7c8b)[_0x54f7('0x1a')]();};}function respondWithResult(_0x142b01,_0x54dcb7){_0x54dcb7=_0x54dcb7||0xc8;return function(_0x222e16){if(_0x222e16){return _0x142b01[_0x54f7('0x19')](_0x54dcb7)[_0x54f7('0x1b')](_0x222e16);}};}function respondWithFilteredResult(_0x3da93a,_0x2a913e){return function(_0x2a6049){if(_0x2a6049){var _0xc892f7=typeof _0x2a913e[_0x54f7('0x1c')]===_0x54f7('0x1d')&&typeof _0x2a913e[_0x54f7('0x1e')]===_0x54f7('0x1d');var _0x455fcd=_0x2a6049['count'];var _0x3df305=_0xc892f7?0x0:_0x2a913e['offset'];var _0xa438b6=_0xc892f7?_0x2a6049[_0x54f7('0x1f')]:_0x2a913e['offset']+_0x2a913e[_0x54f7('0x1e')];var _0x5cfcea;if(_0xa438b6>=_0x455fcd){_0xa438b6=_0x455fcd;_0x5cfcea=0xc8;}else{_0x5cfcea=0xce;}_0x3da93a[_0x54f7('0x19')](_0x5cfcea);return _0x3da93a[_0x54f7('0x20')](_0x54f7('0x21'),_0x3df305+'-'+_0xa438b6+'/'+_0x455fcd)[_0x54f7('0x1b')](_0x2a6049);}return null;};}function patchUpdates(_0x524ab8){return function(_0x4540e5){try{jsonpatch[_0x54f7('0x22')](_0x4540e5,_0x524ab8,!![]);}catch(_0x378405){return BPromise['reject'](_0x378405);}return _0x4540e5['save']();};}function saveUpdates(_0x448ecf,_0x16bf4e){return function(_0x265e86){if(_0x265e86){return _0x265e86[_0x54f7('0x23')](_0x448ecf)[_0x54f7('0x24')](function(_0x42ac87){return _0x42ac87;});}return null;};}function removeEntity(_0x2e2240,_0x5c4d52){return function(_0x3b3c4e){if(_0x3b3c4e){return _0x3b3c4e[_0x54f7('0x25')]()[_0x54f7('0x24')](function(){_0x2e2240[_0x54f7('0x19')](0xcc)[_0x54f7('0x1a')]();});}};}function handleEntityNotFound(_0x1f21f1,_0x5eab49){return function(_0x338654){if(!_0x338654){_0x1f21f1[_0x54f7('0x18')](0x194);}return _0x338654;};}function handleError(_0x5ae8cc,_0x340896){_0x340896=_0x340896||0x1f4;return function(_0x350d12){logger[_0x54f7('0x26')](_0x350d12[_0x54f7('0x27')]);if(_0x350d12['name']){delete _0x350d12[_0x54f7('0x28')];}_0x5ae8cc[_0x54f7('0x19')](_0x340896)[_0x54f7('0x29')](_0x350d12);};}exports[_0x54f7('0x2a')]=function(_0xa7b11b,_0x13cf50){var _0x3c158b={},_0x5d0c51={},_0x5b8823={'count':0x0,'rows':[]};var _0x7633b7=_[_0x54f7('0x2b')](db[_0x54f7('0x2c')][_0x54f7('0x2d')],function(_0x181d48){return{'name':_0x181d48[_0x54f7('0x2e')],'type':_0x181d48[_0x54f7('0x2f')][_0x54f7('0x30')]};});_0x5d0c51[_0x54f7('0x31')]=_[_0x54f7('0x2b')](_0x7633b7,_0x54f7('0x28'));_0x5d0c51[_0x54f7('0x32')]=_[_0x54f7('0x33')](_0xa7b11b[_0x54f7('0x32')]);_0x5d0c51[_0x54f7('0x34')]=_[_0x54f7('0x35')](_0x5d0c51['model'],_0x5d0c51['query']);_0x3c158b[_0x54f7('0x36')]=_['intersection'](_0x5d0c51[_0x54f7('0x31')],qs[_0x54f7('0x37')](_0xa7b11b['query']['fields']));_0x3c158b[_0x54f7('0x36')]=_0x3c158b[_0x54f7('0x36')]['length']?_0x3c158b['attributes']:_0x5d0c51[_0x54f7('0x31')];if(!_0xa7b11b[_0x54f7('0x32')][_0x54f7('0x38')](_0x54f7('0x39'))){_0x3c158b['limit']=qs[_0x54f7('0x1e')](_0xa7b11b[_0x54f7('0x32')][_0x54f7('0x1e')]);_0x3c158b[_0x54f7('0x1c')]=qs[_0x54f7('0x1c')](_0xa7b11b[_0x54f7('0x32')][_0x54f7('0x1c')]);}_0x3c158b[_0x54f7('0x3a')]=qs[_0x54f7('0x3b')](_0xa7b11b[_0x54f7('0x32')][_0x54f7('0x3b')]);_0x3c158b[_0x54f7('0x3c')]=qs[_0x54f7('0x34')](_[_0x54f7('0x3d')](_0xa7b11b[_0x54f7('0x32')],_0x5d0c51['filters']),_0x7633b7);if(_0xa7b11b[_0x54f7('0x32')]['filter']){_0x3c158b['where']=_[_0x54f7('0x3e')](_0x3c158b['where'],{'$or':_['map'](_0x7633b7,function(_0x19d1a5){if(_0x19d1a5[_0x54f7('0x2f')]!==_0x54f7('0x3f')){var _0x247fdd={};_0x247fdd[_0x19d1a5[_0x54f7('0x28')]]={'$like':'%'+_0xa7b11b[_0x54f7('0x32')][_0x54f7('0x40')]+'%'};return _0x247fdd;}})});}_0x3c158b=_[_0x54f7('0x3e')]({},_0x3c158b,_0xa7b11b['options']);var _0x124f8c={'where':_0x3c158b[_0x54f7('0x3c')]};return db['MailTransferReport']['count'](_0x124f8c)[_0x54f7('0x24')](function(_0x4b9a2f){_0x5b8823[_0x54f7('0x1f')]=_0x4b9a2f;if(_0xa7b11b['query']['includeAll']){_0x3c158b['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x3c158b);})[_0x54f7('0x24')](function(_0x13d136){_0x5b8823['rows']=_0x13d136;return _0x5b8823;})[_0x54f7('0x24')](respondWithFilteredResult(_0x13cf50,_0x3c158b))[_0x54f7('0x41')](handleError(_0x13cf50,null));};exports[_0x54f7('0x42')]=function(_0x25206a,_0x4675ad){var _0x281f15={'raw':!![],'where':{'id':_0x25206a[_0x54f7('0x43')]['id']}},_0x175ed6={};_0x175ed6[_0x54f7('0x31')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x175ed6[_0x54f7('0x32')]=_[_0x54f7('0x33')](_0x25206a['query']);_0x175ed6[_0x54f7('0x34')]=_[_0x54f7('0x35')](_0x175ed6['model'],_0x175ed6[_0x54f7('0x32')]);_0x281f15['attributes']=_['intersection'](_0x175ed6['model'],qs[_0x54f7('0x37')](_0x25206a[_0x54f7('0x32')][_0x54f7('0x37')]));_0x281f15['attributes']=_0x281f15[_0x54f7('0x36')][_0x54f7('0x44')]?_0x281f15[_0x54f7('0x36')]:_0x175ed6[_0x54f7('0x31')];if(_0x25206a[_0x54f7('0x32')]['includeAll']){_0x281f15['include']=[{'all':!![]}];}_0x281f15=_['merge']({},_0x281f15,_0x25206a[_0x54f7('0x45')]);return db[_0x54f7('0x2c')]['find'](_0x281f15)[_0x54f7('0x24')](handleEntityNotFound(_0x4675ad,null))[_0x54f7('0x24')](respondWithResult(_0x4675ad,null))['catch'](handleError(_0x4675ad,null));};exports[_0x54f7('0x46')]=function(_0x592a61,_0x44017b){return db['MailTransferReport'][_0x54f7('0x46')](_0x592a61[_0x54f7('0x47')],{})[_0x54f7('0x24')](respondWithResult(_0x44017b,0xc9))[_0x54f7('0x41')](handleError(_0x44017b,null));};exports[_0x54f7('0x23')]=function(_0x2d2dba,_0x4ccec8){if(_0x2d2dba[_0x54f7('0x47')]['id']){delete _0x2d2dba['body']['id'];}return db[_0x54f7('0x2c')][_0x54f7('0x48')]({'where':{'id':_0x2d2dba[_0x54f7('0x43')]['id']}})[_0x54f7('0x24')](handleEntityNotFound(_0x4ccec8,null))['then'](saveUpdates(_0x2d2dba[_0x54f7('0x47')],null))[_0x54f7('0x24')](respondWithResult(_0x4ccec8,null))[_0x54f7('0x41')](handleError(_0x4ccec8,null));};exports[_0x54f7('0x25')]=function(_0x7dbd9f,_0xc3d213){return db[_0x54f7('0x2c')][_0x54f7('0x48')]({'where':{'id':_0x7dbd9f['params']['id']}})[_0x54f7('0x24')](handleEntityNotFound(_0xc3d213,null))[_0x54f7('0x24')](removeEntity(_0xc3d213,null))[_0x54f7('0x41')](handleError(_0xc3d213,null));};exports['describe']=function(_0x18c1a5,_0x3b248d){return db[_0x54f7('0x2c')][_0x54f7('0x49')]()['then'](respondWithResult(_0x3b248d,null))['catch'](handleError(_0x3b248d,null));}; \ No newline at end of file +var _0x6a56=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','MailTransferReport','count','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys'];(function(_0x3bdd65,_0x3d187e){var _0x4c7ec6=function(_0x447e50){while(--_0x447e50){_0x3bdd65['push'](_0x3bdd65['shift']());}};_0x4c7ec6(++_0x3d187e);}(_0x6a56,0x13d));var _0x66a5=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x6a56[_0x217c2e];return _0x22b7d8;};'use strict';var emlformat=require(_0x66a5('0x0'));var rimraf=require(_0x66a5('0x1'));var zipdir=require(_0x66a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66a5('0x3'));var moment=require('moment');var BPromise=require(_0x66a5('0x4'));var Mustache=require('mustache');var util=require(_0x66a5('0x5'));var path=require(_0x66a5('0x6'));var sox=require(_0x66a5('0x7'));var csv=require(_0x66a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66a5('0x9'));var _=require('lodash');var squel=require(_0x66a5('0xa'));var crypto=require('crypto');var jsforce=require(_0x66a5('0xb'));var deskjs=require(_0x66a5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x66a5('0xd'));var Papa=require(_0x66a5('0xe'));var Redis=require('ioredis');var authService=require(_0x66a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x66a5('0x10'));var hardwareService=require(_0x66a5('0x11'));var logger=require(_0x66a5('0x12'))(_0x66a5('0x13'));var utils=require(_0x66a5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x66a5('0x15'));var db=require(_0x66a5('0x16'))['db'];function respondWithStatusCode(_0x38ef08,_0x2453b7){_0x2453b7=_0x2453b7||0xcc;return function(_0xd58783){if(_0xd58783){return _0x38ef08[_0x66a5('0x17')](_0x2453b7);}return _0x38ef08[_0x66a5('0x18')](_0x2453b7)['end']();};}function respondWithResult(_0x1254ef,_0x458827){_0x458827=_0x458827||0xc8;return function(_0x5cf16a){if(_0x5cf16a){return _0x1254ef[_0x66a5('0x18')](_0x458827)[_0x66a5('0x19')](_0x5cf16a);}};}function respondWithFilteredResult(_0x48f083,_0x6d7829){return function(_0x3afc6d){if(_0x3afc6d){var _0x2c97f0=typeof _0x6d7829[_0x66a5('0x1a')]===_0x66a5('0x1b')&&typeof _0x6d7829[_0x66a5('0x1c')]===_0x66a5('0x1b');var _0x2951e2=_0x3afc6d['count'];var _0x32f121=_0x2c97f0?0x0:_0x6d7829[_0x66a5('0x1a')];var _0x490ae3=_0x2c97f0?_0x3afc6d['count']:_0x6d7829['offset']+_0x6d7829[_0x66a5('0x1c')];var _0x446878;if(_0x490ae3>=_0x2951e2){_0x490ae3=_0x2951e2;_0x446878=0xc8;}else{_0x446878=0xce;}_0x48f083[_0x66a5('0x18')](_0x446878);return _0x48f083['set']('Content-Range',_0x32f121+'-'+_0x490ae3+'/'+_0x2951e2)['json'](_0x3afc6d);}return null;};}function patchUpdates(_0x583a08){return function(_0x828cd7){try{jsonpatch[_0x66a5('0x1d')](_0x828cd7,_0x583a08,!![]);}catch(_0x4fcd1f){return BPromise[_0x66a5('0x1e')](_0x4fcd1f);}return _0x828cd7[_0x66a5('0x1f')]();};}function saveUpdates(_0x5762e6,_0x1392bc){return function(_0xd0d02){if(_0xd0d02){return _0xd0d02[_0x66a5('0x20')](_0x5762e6)['then'](function(_0x50fee7){return _0x50fee7;});}return null;};}function removeEntity(_0x526f1a,_0x576e20){return function(_0x2136b8){if(_0x2136b8){return _0x2136b8[_0x66a5('0x21')]()[_0x66a5('0x22')](function(){_0x526f1a[_0x66a5('0x18')](0xcc)[_0x66a5('0x23')]();});}};}function handleEntityNotFound(_0xde124b,_0x27de5b){return function(_0x129cf4){if(!_0x129cf4){_0xde124b[_0x66a5('0x17')](0x194);}return _0x129cf4;};}function handleError(_0x395842,_0x20cfad){_0x20cfad=_0x20cfad||0x1f4;return function(_0x30aa59){logger[_0x66a5('0x24')](_0x30aa59[_0x66a5('0x25')]);if(_0x30aa59[_0x66a5('0x26')]){delete _0x30aa59['name'];}_0x395842['status'](_0x20cfad)[_0x66a5('0x27')](_0x30aa59);};}exports[_0x66a5('0x28')]=function(_0x358180,_0x4b0a27){var _0xa6e136={},_0x43e88c={},_0x310e54={'count':0x0,'rows':[]};var _0x5ce03c=_[_0x66a5('0x29')](db['MailTransferReport'][_0x66a5('0x2a')],function(_0x306eff){return{'name':_0x306eff[_0x66a5('0x2b')],'type':_0x306eff[_0x66a5('0x2c')]['key']};});_0x43e88c[_0x66a5('0x2d')]=_['map'](_0x5ce03c,_0x66a5('0x26'));_0x43e88c[_0x66a5('0x2e')]=_[_0x66a5('0x2f')](_0x358180[_0x66a5('0x2e')]);_0x43e88c[_0x66a5('0x30')]=_[_0x66a5('0x31')](_0x43e88c[_0x66a5('0x2d')],_0x43e88c['query']);_0xa6e136['attributes']=_[_0x66a5('0x31')](_0x43e88c[_0x66a5('0x2d')],qs['fields'](_0x358180[_0x66a5('0x2e')]['fields']));_0xa6e136[_0x66a5('0x32')]=_0xa6e136[_0x66a5('0x32')][_0x66a5('0x33')]?_0xa6e136[_0x66a5('0x32')]:_0x43e88c['model'];if(!_0x358180[_0x66a5('0x2e')][_0x66a5('0x34')](_0x66a5('0x35'))){_0xa6e136['limit']=qs[_0x66a5('0x1c')](_0x358180[_0x66a5('0x2e')]['limit']);_0xa6e136[_0x66a5('0x1a')]=qs['offset'](_0x358180['query']['offset']);}_0xa6e136[_0x66a5('0x36')]=qs[_0x66a5('0x37')](_0x358180['query'][_0x66a5('0x37')]);_0xa6e136[_0x66a5('0x38')]=qs['filters'](_[_0x66a5('0x39')](_0x358180[_0x66a5('0x2e')],_0x43e88c[_0x66a5('0x30')]),_0x5ce03c);if(_0x358180[_0x66a5('0x2e')]['filter']){_0xa6e136[_0x66a5('0x38')]=_[_0x66a5('0x3a')](_0xa6e136[_0x66a5('0x38')],{'$or':_[_0x66a5('0x29')](_0x5ce03c,function(_0x117295){if(_0x117295[_0x66a5('0x2c')]!=='VIRTUAL'){var _0x5c4f60={};_0x5c4f60[_0x117295[_0x66a5('0x26')]]={'$like':'%'+_0x358180[_0x66a5('0x2e')][_0x66a5('0x3b')]+'%'};return _0x5c4f60;}})});}_0xa6e136=_[_0x66a5('0x3a')]({},_0xa6e136,_0x358180[_0x66a5('0x3c')]);var _0x2d7a70={'where':_0xa6e136['where']};return db[_0x66a5('0x3d')][_0x66a5('0x3e')](_0x2d7a70)['then'](function(_0x3cccaf){_0x310e54[_0x66a5('0x3e')]=_0x3cccaf;if(_0x358180['query'][_0x66a5('0x3f')]){_0xa6e136[_0x66a5('0x40')]=[{'all':!![]}];}return db['MailTransferReport'][_0x66a5('0x41')](_0xa6e136);})['then'](function(_0x31acf8){_0x310e54['rows']=_0x31acf8;return _0x310e54;})[_0x66a5('0x22')](respondWithFilteredResult(_0x4b0a27,_0xa6e136))[_0x66a5('0x42')](handleError(_0x4b0a27,null));};exports[_0x66a5('0x43')]=function(_0x7dfcd5,_0x3a440a){var _0x42422d={'raw':!![],'where':{'id':_0x7dfcd5[_0x66a5('0x44')]['id']}},_0xe37735={};_0xe37735['model']=_[_0x66a5('0x2f')](db['MailTransferReport']['rawAttributes']);_0xe37735[_0x66a5('0x2e')]=_[_0x66a5('0x2f')](_0x7dfcd5[_0x66a5('0x2e')]);_0xe37735['filters']=_[_0x66a5('0x31')](_0xe37735[_0x66a5('0x2d')],_0xe37735[_0x66a5('0x2e')]);_0x42422d[_0x66a5('0x32')]=_[_0x66a5('0x31')](_0xe37735['model'],qs[_0x66a5('0x45')](_0x7dfcd5[_0x66a5('0x2e')][_0x66a5('0x45')]));_0x42422d[_0x66a5('0x32')]=_0x42422d[_0x66a5('0x32')][_0x66a5('0x33')]?_0x42422d[_0x66a5('0x32')]:_0xe37735[_0x66a5('0x2d')];if(_0x7dfcd5['query'][_0x66a5('0x3f')]){_0x42422d['include']=[{'all':!![]}];}_0x42422d=_[_0x66a5('0x3a')]({},_0x42422d,_0x7dfcd5[_0x66a5('0x3c')]);return db[_0x66a5('0x3d')][_0x66a5('0x46')](_0x42422d)[_0x66a5('0x22')](handleEntityNotFound(_0x3a440a,null))['then'](respondWithResult(_0x3a440a,null))[_0x66a5('0x42')](handleError(_0x3a440a,null));};exports[_0x66a5('0x47')]=function(_0x1f1f1c,_0x2533fb){return db[_0x66a5('0x3d')]['create'](_0x1f1f1c[_0x66a5('0x48')],{})[_0x66a5('0x22')](respondWithResult(_0x2533fb,0xc9))['catch'](handleError(_0x2533fb,null));};exports[_0x66a5('0x20')]=function(_0x2e3428,_0x31d04e){if(_0x2e3428[_0x66a5('0x48')]['id']){delete _0x2e3428[_0x66a5('0x48')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x2e3428[_0x66a5('0x44')]['id']}})[_0x66a5('0x22')](handleEntityNotFound(_0x31d04e,null))[_0x66a5('0x22')](saveUpdates(_0x2e3428[_0x66a5('0x48')],null))[_0x66a5('0x22')](respondWithResult(_0x31d04e,null))[_0x66a5('0x42')](handleError(_0x31d04e,null));};exports['destroy']=function(_0x1b93cc,_0x79828){return db['MailTransferReport'][_0x66a5('0x46')]({'where':{'id':_0x1b93cc[_0x66a5('0x44')]['id']}})[_0x66a5('0x22')](handleEntityNotFound(_0x79828,null))[_0x66a5('0x22')](removeEntity(_0x79828,null))[_0x66a5('0x42')](handleError(_0x79828,null));};exports['describe']=function(_0x5c3ea1,_0x573e43){return db[_0x66a5('0x3d')]['describe']()['then'](respondWithResult(_0x573e43,null))[_0x66a5('0x42')](handleError(_0x573e43,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1062e4f..953fa5f 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 _0xb1a3=['exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x45940b,_0x392fab){var _0x49946a=function(_0x5aa855){while(--_0x5aa855){_0x45940b['push'](_0x45940b['shift']());}};_0x49946a(++_0x392fab);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xb1a3[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var logger=require(_0x3b1a('0x2'))('api');var moment=require(_0x3b1a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b1a('0x4'));var rimraf=require(_0x3b1a('0x5'));var config=require(_0x3b1a('0x6'));var attributes=require(_0x3b1a('0x7'));module[_0x3b1a('0x8')]=function(_0xe6490d,_0x208d05){return _0xe6490d['define'](_0x3b1a('0x9'),attributes,{'tableName':_0x3b1a('0xa'),'paranoid':![],'indexes':[{'name':_0x3b1a('0xb'),'fields':[_0x3b1a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c06=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','report_mail_transfer','uniqueid'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0x3c06,0xf7));var _0x63c0=function(_0x7a9ece,_0x3b4720){_0x7a9ece=_0x7a9ece-0x0;var _0x103af1=_0x3c06[_0x7a9ece];return _0x103af1;};'use strict';var _=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var logger=require(_0x63c0('0x2'))(_0x63c0('0x3'));var moment=require(_0x63c0('0x4'));var BPromise=require(_0x63c0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63c0('0x6'));var rimraf=require(_0x63c0('0x7'));var config=require(_0x63c0('0x8'));var attributes=require(_0x63c0('0x9'));module[_0x63c0('0xa')]=function(_0x4474bd,_0x2fe268){return _0x4474bd['define']('MailTransferReport',attributes,{'tableName':_0x63c0('0xb'),'paranoid':![],'indexes':[{'name':_0x63c0('0xc'),'fields':[_0x63c0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 59ecf84..1afffb3 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 _0x0517=['MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x0517,0x168));var _0x7051=function(_0x3c45fc,_0x4a774f){_0x3c45fc=_0x3c45fc-0x0;var _0x1f6ae9=_0x0517[_0x3c45fc];return _0x1f6ae9;};'use strict';var _=require(_0x7051('0x0'));var util=require(_0x7051('0x1'));var moment=require(_0x7051('0x2'));var BPromise=require(_0x7051('0x3'));var rs=require(_0x7051('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7051('0x5'));var logger=require(_0x7051('0x6'))('rpc');var config=require(_0x7051('0x7'));var jayson=require(_0x7051('0x8'));var client=jayson[_0x7051('0x9')][_0x7051('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18bb97,_0x4f871b,_0x375cbd){return new BPromise(function(_0x301ba4,_0x50e9b5){return client[_0x7051('0xb')](_0x18bb97,_0x375cbd)[_0x7051('0xc')](function(_0x149df9){logger[_0x7051('0xd')](_0x7051('0xe'),_0x4f871b,_0x7051('0xf'));logger['debug'](_0x7051('0x10'),_0x4f871b,_0x7051('0xf'),JSON[_0x7051('0x11')](_0x149df9));if(_0x149df9['error']){if(_0x149df9[_0x7051('0x12')]['code']===0x1f4){logger[_0x7051('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4f871b,_0x149df9['error'][_0x7051('0x13')]);return _0x50e9b5(_0x149df9[_0x7051('0x12')][_0x7051('0x13')]);}logger[_0x7051('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4f871b,_0x149df9[_0x7051('0x12')]['message']);return _0x301ba4(_0x149df9['error'][_0x7051('0x13')]);}else{logger['info'](_0x7051('0xe'),_0x4f871b,_0x7051('0xf'));_0x301ba4(_0x149df9[_0x7051('0x14')]['message']);}})[_0x7051('0x15')](function(_0x5cc039){logger[_0x7051('0x12')](_0x7051('0xe'),_0x4f871b,_0x5cc039);_0x50e9b5(_0x5cc039);});});} \ No newline at end of file +var _0x7918=['rpc','jayson/promise','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7918,0x109));var _0x8791=function(_0x59d2f3,_0x9235af){_0x59d2f3=_0x59d2f3-0x0;var _0x1f6528=_0x7918[_0x59d2f3];return _0x1f6528;};'use strict';var _=require('lodash');var util=require(_0x8791('0x0'));var moment=require(_0x8791('0x1'));var BPromise=require(_0x8791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8791('0x3'));var logger=require(_0x8791('0x4'))(_0x8791('0x5'));var config=require('../../config/environment');var jayson=require(_0x8791('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1626a9,_0x92e985,_0x4a7364){return new BPromise(function(_0x386efe,_0x34bcba){return client['request'](_0x1626a9,_0x4a7364)[_0x8791('0x7')](function(_0x45e7f1){logger[_0x8791('0x8')]('MailTransferReport,\x20%s,\x20%s',_0x92e985,_0x8791('0x9'));logger[_0x8791('0xa')](_0x8791('0xb'),_0x92e985,_0x8791('0x9'),JSON[_0x8791('0xc')](_0x45e7f1));if(_0x45e7f1[_0x8791('0xd')]){if(_0x45e7f1[_0x8791('0xd')][_0x8791('0xe')]===0x1f4){logger[_0x8791('0xd')](_0x8791('0xf'),_0x92e985,_0x45e7f1[_0x8791('0xd')]['message']);return _0x34bcba(_0x45e7f1['error']['message']);}logger[_0x8791('0xd')](_0x8791('0xf'),_0x92e985,_0x45e7f1[_0x8791('0xd')][_0x8791('0x10')]);return _0x386efe(_0x45e7f1[_0x8791('0xd')][_0x8791('0x10')]);}else{logger['info'](_0x8791('0xf'),_0x92e985,_0x8791('0x9'));_0x386efe(_0x45e7f1['result'][_0x8791('0x10')]);}})[_0x8791('0x11')](function(_0x113ec7){logger[_0x8791('0xd')](_0x8791('0xf'),_0x92e985,_0x113ec7);_0x34bcba(_0x113ec7);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b7c1cf6..b31c61f 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 _0x57d9=['delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update'];(function(_0x3fb384,_0x5cd5f5){var _0xbbd642=function(_0x8feb35){while(--_0x8feb35){_0x3fb384['push'](_0x3fb384['shift']());}};_0xbbd642(++_0x5cd5f5);}(_0x57d9,0x11a));var _0x957d=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x57d9[_0x454e6d];return _0x4bc294;};'use strict';var multer=require(_0x957d('0x0'));var util=require(_0x957d('0x1'));var path=require(_0x957d('0x2'));var timeout=require('connect-timeout');var express=require(_0x957d('0x3'));var router=express['Router']();var fs_extra=require(_0x957d('0x4'));var auth=require(_0x957d('0x5'));var interaction=require(_0x957d('0x6'));var config=require('../../config/environment');var controller=require(_0x957d('0x7'));router[_0x957d('0x8')]('/',auth[_0x957d('0x9')](),controller[_0x957d('0xa')]);router['get'](_0x957d('0xb'),auth[_0x957d('0x9')](),controller[_0x957d('0xc')]);router[_0x957d('0x8')](_0x957d('0xd'),auth['isAuthenticated'](),controller[_0x957d('0xe')]);router['post']('/',auth[_0x957d('0x9')](),controller[_0x957d('0xf')]);router[_0x957d('0x10')](_0x957d('0xd'),auth[_0x957d('0x9')](),controller[_0x957d('0x11')]);router[_0x957d('0x12')](_0x957d('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x957d('0x13')]=router; \ No newline at end of file +var _0xf2f8=['../../components/auth/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','destroy','path','connect-timeout','express','Router','fs-extra'];(function(_0x266e2c,_0x57b6ab){var _0xb19c8b=function(_0x4b9f49){while(--_0x4b9f49){_0x266e2c['push'](_0x266e2c['shift']());}};_0xb19c8b(++_0x57b6ab);}(_0xf2f8,0x13f));var _0x8f2f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf2f8[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8f2f('0x0'));var timeout=require(_0x8f2f('0x1'));var express=require(_0x8f2f('0x2'));var router=express[_0x8f2f('0x3')]();var fs_extra=require(_0x8f2f('0x4'));var auth=require(_0x8f2f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8f2f('0x6'));var controller=require(_0x8f2f('0x7'));router[_0x8f2f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f2f('0x9'),auth[_0x8f2f('0xa')](),controller[_0x8f2f('0xb')]);router[_0x8f2f('0x8')]('/:id',auth[_0x8f2f('0xa')](),controller[_0x8f2f('0xc')]);router[_0x8f2f('0xd')]('/',auth['isAuthenticated'](),controller[_0x8f2f('0xe')]);router[_0x8f2f('0xf')](_0x8f2f('0x10'),auth[_0x8f2f('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8f2f('0x11')]);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 2e2f4b7..0ec49e2 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 _0x7d86=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports'];(function(_0x4da936,_0x1f1a1b){var _0x597e65=function(_0x5c729c){while(--_0x5c729c){_0x4da936['push'](_0x4da936['shift']());}};_0x597e65(++_0x1f1a1b);}(_0x7d86,0x86));var _0x67d8=function(_0x64a6bf,_0x185808){_0x64a6bf=_0x64a6bf-0x0;var _0x5b75a3=_0x7d86[_0x64a6bf];return _0x5b75a3;};'use strict';var Sequelize=require(_0x67d8('0x0'));var moment=require('moment');module[_0x67d8('0x1')]={'channel':{'type':Sequelize[_0x67d8('0x2')]},'membername':{'type':Sequelize[_0x67d8('0x2')]},'interface':{'type':Sequelize[_0x67d8('0x2')]},'type':{'type':Sequelize[_0x67d8('0x2')],'defaultValue':_0x67d8('0x3'),'comment':_0x67d8('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x67d8('0x5')]},'exitAt':{'type':Sequelize[_0x67d8('0x5')],'set':function(_0x8dd593){var _0x2bc414=moment(_0x8dd593);var _0x2485fa=moment(this[_0x67d8('0x6')](_0x67d8('0x7')));var _0x16e834=_0x2bc414[_0x67d8('0x8')](_0x2485fa,_0x67d8('0x9'));this[_0x67d8('0xa')](_0x67d8('0xb'),_0x8dd593);this[_0x67d8('0xa')](_0x67d8('0xc'),_0x16e834||null);}},'data1':{'type':Sequelize[_0x67d8('0x2')],'comment':_0x67d8('0xd')},'data2':{'type':Sequelize[_0x67d8('0x2')],'comment':_0x67d8('0xe')},'data3':{'type':Sequelize[_0x67d8('0x2')],'comment':_0x67d8('0xf')},'data4':{'type':Sequelize[_0x67d8('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x67d8('0x2')],'comment':_0x67d8('0x10')},'role':{'type':Sequelize[_0x67d8('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x67d8('0x2')]}}; \ No newline at end of file +var _0x2bd6=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','seconds','setDataValue'];(function(_0x56a1f0,_0x211471){var _0xc48f6=function(_0x463379){while(--_0x463379){_0x56a1f0['push'](_0x56a1f0['shift']());}};_0xc48f6(++_0x211471);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x2bd6[_0x27dba4];return _0x35ec9d;};'use strict';var Sequelize=require(_0x62bd('0x0'));var moment=require(_0x62bd('0x1'));module[_0x62bd('0x2')]={'channel':{'type':Sequelize[_0x62bd('0x3')]},'membername':{'type':Sequelize[_0x62bd('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x62bd('0x3')],'defaultValue':_0x62bd('0x4'),'comment':_0x62bd('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x62bd('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4b8aa7){var _0x3c267e=moment(_0x4b8aa7);var _0x39af04=moment(this['getDataValue'](_0x62bd('0x7')));var _0x11af94=_0x3c267e['diff'](_0x39af04,_0x62bd('0x8'));this[_0x62bd('0x9')](_0x62bd('0xa'),_0x4b8aa7);this[_0x62bd('0x9')](_0x62bd('0xb'),_0x11af94||null);}},'data1':{'type':Sequelize[_0x62bd('0x3')],'comment':_0x62bd('0xc')},'data2':{'type':Sequelize[_0x62bd('0x3')],'comment':_0x62bd('0xd')},'data3':{'type':Sequelize[_0x62bd('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x62bd('0xe')},'data5':{'type':Sequelize[_0x62bd('0x3')],'comment':_0x62bd('0xf')},'role':{'type':Sequelize[_0x62bd('0x3')]},'internal':{'type':Sequelize[_0x62bd('0x10')]},'uniqueid':{'type':Sequelize[_0x62bd('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index e4f13d6..310acfb 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x49e734,_0xc04f4f){var _0x2a2d42=function(_0x564e55){while(--_0x564e55){_0x49e734['push'](_0x49e734['shift']());}};_0x2a2d42(++_0xc04f4f);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x34e8,0x12c));var _0x834e=function(_0x36170e,_0x295d7a){_0x36170e=_0x36170e-0x0;var _0x1b55b3=_0x34e8[_0x36170e];return _0x1b55b3;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 7e20bcd..9480a3d 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 _0x43e7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','define','report_member','membername_interface','interface'];(function(_0x33bfc6,_0x552373){var _0x859189=function(_0x5d41ec){while(--_0x5d41ec){_0x33bfc6['push'](_0x33bfc6['shift']());}};_0x859189(++_0x552373);}(_0x43e7,0xb6));var _0x743e=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x43e7[_0x5280f4];return _0xba93e7;};'use strict';var _=require('lodash');var util=require(_0x743e('0x0'));var logger=require(_0x743e('0x1'))(_0x743e('0x2'));var moment=require(_0x743e('0x3'));var BPromise=require(_0x743e('0x4'));var rp=require(_0x743e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x743e('0x6'));var config=require(_0x743e('0x7'));var attributes=require(_0x743e('0x8'));module['exports']=function(_0xc93428,_0xddaac8){return _0xc93428[_0x743e('0x9')]('MemberReport',attributes,{'tableName':_0x743e('0xa'),'paranoid':![],'indexes':[{'name':_0x743e('0xb'),'fields':['membername',_0x743e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb87=['moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','../../config/logger','api'];(function(_0x18b47b,_0x1e9705){var _0x429d09=function(_0x57c966){while(--_0x57c966){_0x18b47b['push'](_0x18b47b['shift']());}};_0x429d09(++_0x1e9705);}(_0xdb87,0x11d));var _0x7db8=function(_0x11eecd,_0x43356b){_0x11eecd=_0x11eecd-0x0;var _0x373fcb=_0xdb87[_0x11eecd];return _0x373fcb;};'use strict';var _=require(_0x7db8('0x0'));var util=require('util');var logger=require(_0x7db8('0x1'))(_0x7db8('0x2'));var moment=require(_0x7db8('0x3'));var BPromise=require(_0x7db8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7db8('0x5'));var rimraf=require(_0x7db8('0x6'));var config=require(_0x7db8('0x7'));var attributes=require(_0x7db8('0x8'));module[_0x7db8('0x9')]=function(_0x2d061e,_0x259a8f){return _0x2d061e[_0x7db8('0xa')](_0x7db8('0xb'),attributes,{'tableName':_0x7db8('0xc'),'paranoid':![],'indexes':[{'name':_0x7db8('0xd'),'fields':[_0x7db8('0xe'),_0x7db8('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ae486bb..2b233bb 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 _0x7c49=['GetMemberReport','MemberReport','options','raw','where','limit','include','map','model','attributes','debug','CreateMemberReport','create','body','UpdateMemberReport','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2fd892,_0x45e469){var _0x5a0254=function(_0x836fe9){while(--_0x836fe9){_0x2fd892['push'](_0x2fd892['shift']());}};_0x5a0254(++_0x45e469);}(_0x7c49,0x141));var _0x97c4=function(_0x1c29ec,_0x5303c4){_0x1c29ec=_0x1c29ec-0x0;var _0x2b8d1c=_0x7c49[_0x1c29ec];return _0x2b8d1c;};'use strict';var _=require(_0x97c4('0x0'));var util=require(_0x97c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x97c4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97c4('0x3'))['db'];var utils=require(_0x97c4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x97c4('0x5'));var jayson=require(_0x97c4('0x6'));var client=jayson[_0x97c4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x249c86,_0x165334,_0x585222){return new BPromise(function(_0x373855,_0x339817){return client[_0x97c4('0x8')](_0x249c86,_0x585222)[_0x97c4('0x9')](function(_0x12e98d){logger[_0x97c4('0xa')](_0x97c4('0xb'),_0x165334,_0x97c4('0xc'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x165334,_0x97c4('0xc'),JSON[_0x97c4('0xd')](_0x12e98d));if(_0x12e98d['error']){if(_0x12e98d[_0x97c4('0xe')][_0x97c4('0xf')]===0x1f4){logger[_0x97c4('0xe')]('MemberReport,\x20%s,\x20%s',_0x165334,_0x12e98d['error'][_0x97c4('0x10')]);return _0x339817(_0x12e98d[_0x97c4('0xe')]['message']);}logger[_0x97c4('0xe')]('MemberReport,\x20%s,\x20%s',_0x165334,_0x12e98d[_0x97c4('0xe')][_0x97c4('0x10')]);return _0x373855(_0x12e98d[_0x97c4('0xe')][_0x97c4('0x10')]);}else{logger[_0x97c4('0xa')](_0x97c4('0xb'),_0x165334,'request\x20sent');_0x373855(_0x12e98d[_0x97c4('0x11')]['message']);}})[_0x97c4('0x12')](function(_0x465c79){logger[_0x97c4('0xe')](_0x97c4('0xb'),_0x165334,_0x465c79);_0x339817(_0x465c79);});});}exports[_0x97c4('0x13')]=function(_0x142f94){var _0xdeb273=this;return new Promise(function(_0x1ce103,_0x3057f0){return db[_0x97c4('0x14')]['findAll']({'raw':_0x142f94[_0x97c4('0x15')]?_0x142f94[_0x97c4('0x15')][_0x97c4('0x16')]===undefined?!![]:![]:!![],'where':_0x142f94['options']?_0x142f94[_0x97c4('0x15')][_0x97c4('0x17')]||null:null,'attributes':_0x142f94[_0x97c4('0x15')]?_0x142f94['options']['attributes']||null:null,'limit':_0x142f94['options']?_0x142f94['options'][_0x97c4('0x18')]||null:null,'include':_0x142f94[_0x97c4('0x15')]?_0x142f94[_0x97c4('0x15')][_0x97c4('0x19')]?_[_0x97c4('0x1a')](_0x142f94[_0x97c4('0x15')][_0x97c4('0x19')],function(_0x3c00aa){return{'model':db[_0x3c00aa[_0x97c4('0x1b')]],'as':_0x3c00aa['as'],'attributes':_0x3c00aa[_0x97c4('0x1c')],'include':_0x3c00aa[_0x97c4('0x19')]?_[_0x97c4('0x1a')](_0x3c00aa[_0x97c4('0x19')],function(_0x4afb57){return{'model':db[_0x4afb57[_0x97c4('0x1b')]],'as':_0x4afb57['as'],'attributes':_0x4afb57[_0x97c4('0x1c')],'include':_0x4afb57[_0x97c4('0x19')]?_['map'](_0x4afb57[_0x97c4('0x19')],function(_0x531c31){return{'model':db[_0x531c31[_0x97c4('0x1b')]],'as':_0x531c31['as'],'attributes':_0x531c31[_0x97c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c4('0x9')](function(_0x40be2d){logger[_0x97c4('0xa')](_0x97c4('0x13'),_0x142f94);logger[_0x97c4('0x1d')](_0x97c4('0x13'),_0x142f94,JSON[_0x97c4('0xd')](_0x40be2d));_0x1ce103(_0x40be2d);})[_0x97c4('0x12')](function(_0x3bc0d2){logger['error'](_0x97c4('0x13'),_0x3bc0d2[_0x97c4('0x10')],_0x142f94);_0x3057f0(_0xdeb273['error'](0x1f4,_0x3bc0d2['message']));});});};exports[_0x97c4('0x1e')]=function(_0x4b7ed9){var _0x282b50=this;return new Promise(function(_0x4f361e,_0x338254){return db[_0x97c4('0x14')][_0x97c4('0x1f')](_0x4b7ed9[_0x97c4('0x20')],{'raw':_0x4b7ed9[_0x97c4('0x15')]?_0x4b7ed9[_0x97c4('0x15')][_0x97c4('0x16')]===undefined?!![]:![]:!![]})[_0x97c4('0x9')](function(_0x41d5bc){logger['info']('CreateMemberReport',_0x4b7ed9);logger[_0x97c4('0x1d')](_0x97c4('0x1e'),_0x4b7ed9,JSON[_0x97c4('0xd')](_0x41d5bc));_0x4f361e(_0x41d5bc);})[_0x97c4('0x12')](function(_0x36a066){logger[_0x97c4('0xe')](_0x97c4('0x1e'),_0x36a066[_0x97c4('0x10')],_0x4b7ed9);_0x338254(_0x282b50['error'](0x1f4,_0x36a066[_0x97c4('0x10')]));});});};exports[_0x97c4('0x21')]=function(_0xa9b340){var _0x44412f=this;return new Promise(function(_0x288b76,_0x2d391d){return db[_0x97c4('0x14')]['update'](_0xa9b340[_0x97c4('0x20')],{'raw':_0xa9b340['options']?_0xa9b340['options'][_0x97c4('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa9b340[_0x97c4('0x15')]?_0xa9b340[_0x97c4('0x15')][_0x97c4('0x17')]||null:null,'attributes':_0xa9b340[_0x97c4('0x15')]?_0xa9b340['options']['attributes']||null:null,'limit':_0xa9b340['options']?_0xa9b340['options'][_0x97c4('0x18')]||null:null})[_0x97c4('0x9')](function(_0x3ecf7b){logger[_0x97c4('0xa')](_0x97c4('0x21'),_0xa9b340);logger[_0x97c4('0x1d')](_0x97c4('0x21'),_0xa9b340,JSON['stringify'](_0x3ecf7b));_0x288b76(_0x3ecf7b);})['catch'](function(_0x10a807){logger[_0x97c4('0xe')]('UpdateMemberReport',_0x10a807[_0x97c4('0x10')],_0xa9b340);_0x2d391d(_0x44412f['error'](0x1f4,_0x10a807[_0x97c4('0x10')]));});});}; \ No newline at end of file +var _0xbcc7=['raw','where','limit','include','map','model','attributes','debug','catch','create','CreateMemberReport','UpdateMemberReport','update','body','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options'];(function(_0x16fa93,_0x5842d5){var _0x3f2b14=function(_0x4a395f){while(--_0x4a395f){_0x16fa93['push'](_0x16fa93['shift']());}};_0x3f2b14(++_0x5842d5);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x4b1215,_0x25f98e){_0x4b1215=_0x4b1215-0x0;var _0x163d68=_0xbcc7[_0x4b1215];return _0x163d68;};'use strict';var _=require(_0x7bcc('0x0'));var util=require(_0x7bcc('0x1'));var moment=require('moment');var BPromise=require(_0x7bcc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bcc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bcc('0x4'))(_0x7bcc('0x5'));var config=require('../../config/environment');var jayson=require(_0x7bcc('0x6'));var client=jayson[_0x7bcc('0x7')][_0x7bcc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f1cb3,_0x127f68,_0x33ea35){return new BPromise(function(_0x5534d5,_0x18939b){return client['request'](_0x2f1cb3,_0x33ea35)[_0x7bcc('0x9')](function(_0x3524cc){logger['info'](_0x7bcc('0xa'),_0x127f68,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x127f68,_0x7bcc('0xb'),JSON[_0x7bcc('0xc')](_0x3524cc));if(_0x3524cc[_0x7bcc('0xd')]){if(_0x3524cc[_0x7bcc('0xd')][_0x7bcc('0xe')]===0x1f4){logger[_0x7bcc('0xd')](_0x7bcc('0xa'),_0x127f68,_0x3524cc['error'][_0x7bcc('0xf')]);return _0x18939b(_0x3524cc[_0x7bcc('0xd')][_0x7bcc('0xf')]);}logger[_0x7bcc('0xd')](_0x7bcc('0xa'),_0x127f68,_0x3524cc[_0x7bcc('0xd')]['message']);return _0x5534d5(_0x3524cc[_0x7bcc('0xd')][_0x7bcc('0xf')]);}else{logger[_0x7bcc('0x10')](_0x7bcc('0xa'),_0x127f68,_0x7bcc('0xb'));_0x5534d5(_0x3524cc[_0x7bcc('0x11')][_0x7bcc('0xf')]);}})['catch'](function(_0x20105e){logger['error'](_0x7bcc('0xa'),_0x127f68,_0x20105e);_0x18939b(_0x20105e);});});}exports[_0x7bcc('0x12')]=function(_0x340bd6){var _0x323525=this;return new Promise(function(_0x49168c,_0x51e08d){return db[_0x7bcc('0x13')][_0x7bcc('0x14')]({'raw':_0x340bd6[_0x7bcc('0x15')]?_0x340bd6[_0x7bcc('0x15')][_0x7bcc('0x16')]===undefined?!![]:![]:!![],'where':_0x340bd6[_0x7bcc('0x15')]?_0x340bd6[_0x7bcc('0x15')][_0x7bcc('0x17')]||null:null,'attributes':_0x340bd6[_0x7bcc('0x15')]?_0x340bd6['options']['attributes']||null:null,'limit':_0x340bd6[_0x7bcc('0x15')]?_0x340bd6[_0x7bcc('0x15')][_0x7bcc('0x18')]||null:null,'include':_0x340bd6[_0x7bcc('0x15')]?_0x340bd6[_0x7bcc('0x15')][_0x7bcc('0x19')]?_[_0x7bcc('0x1a')](_0x340bd6[_0x7bcc('0x15')][_0x7bcc('0x19')],function(_0x54c611){return{'model':db[_0x54c611[_0x7bcc('0x1b')]],'as':_0x54c611['as'],'attributes':_0x54c611[_0x7bcc('0x1c')],'include':_0x54c611[_0x7bcc('0x19')]?_[_0x7bcc('0x1a')](_0x54c611[_0x7bcc('0x19')],function(_0x1d085c){return{'model':db[_0x1d085c['model']],'as':_0x1d085c['as'],'attributes':_0x1d085c['attributes'],'include':_0x1d085c[_0x7bcc('0x19')]?_['map'](_0x1d085c['include'],function(_0xd3ca3b){return{'model':db[_0xd3ca3b['model']],'as':_0xd3ca3b['as'],'attributes':_0xd3ca3b[_0x7bcc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7bcc('0x9')](function(_0x1725e5){logger['info'](_0x7bcc('0x12'),_0x340bd6);logger[_0x7bcc('0x1d')](_0x7bcc('0x12'),_0x340bd6,JSON[_0x7bcc('0xc')](_0x1725e5));_0x49168c(_0x1725e5);})[_0x7bcc('0x1e')](function(_0x1ecf95){logger[_0x7bcc('0xd')]('GetMemberReport',_0x1ecf95[_0x7bcc('0xf')],_0x340bd6);_0x51e08d(_0x323525[_0x7bcc('0xd')](0x1f4,_0x1ecf95['message']));});});};exports['CreateMemberReport']=function(_0x472b73){var _0x5010ab=this;return new Promise(function(_0x19bda9,_0x284476){return db[_0x7bcc('0x13')][_0x7bcc('0x1f')](_0x472b73['body'],{'raw':_0x472b73[_0x7bcc('0x15')]?_0x472b73[_0x7bcc('0x15')][_0x7bcc('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x65e320){logger[_0x7bcc('0x10')](_0x7bcc('0x20'),_0x472b73);logger[_0x7bcc('0x1d')](_0x7bcc('0x20'),_0x472b73,JSON[_0x7bcc('0xc')](_0x65e320));_0x19bda9(_0x65e320);})[_0x7bcc('0x1e')](function(_0x178b27){logger[_0x7bcc('0xd')](_0x7bcc('0x20'),_0x178b27[_0x7bcc('0xf')],_0x472b73);_0x284476(_0x5010ab['error'](0x1f4,_0x178b27[_0x7bcc('0xf')]));});});};exports[_0x7bcc('0x21')]=function(_0x42b568){var _0x51b9e8=this;return new Promise(function(_0x47f8f6,_0x409ff4){return db[_0x7bcc('0x13')][_0x7bcc('0x22')](_0x42b568[_0x7bcc('0x23')],{'raw':_0x42b568[_0x7bcc('0x15')]?_0x42b568[_0x7bcc('0x15')][_0x7bcc('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42b568['options']?_0x42b568['options']['where']||null:null,'attributes':_0x42b568['options']?_0x42b568[_0x7bcc('0x15')][_0x7bcc('0x1c')]||null:null,'limit':_0x42b568[_0x7bcc('0x15')]?_0x42b568['options'][_0x7bcc('0x18')]||null:null})[_0x7bcc('0x9')](function(_0x12f9c6){logger['info']('UpdateMemberReport',_0x42b568);logger[_0x7bcc('0x1d')](_0x7bcc('0x21'),_0x42b568,JSON[_0x7bcc('0xc')](_0x12f9c6));_0x47f8f6(_0x12f9c6);})['catch'](function(_0x5be330){logger[_0x7bcc('0xd')](_0x7bcc('0x21'),_0x5be330[_0x7bcc('0xf')],_0x42b568);_0x409ff4(_0x51b9e8['error'](0x1f4,_0x5be330[_0x7bcc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index cad3ddb..d50ae63 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 _0x4dc8=['connect-timeout','express','Router','../../components/interaction/service','./migration.controller','index','exports','multer','util','path'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x4dc8,0x1e7));var _0x84dc=function(_0x3859f5,_0x22db78){_0x3859f5=_0x3859f5-0x0;var _0x2025df=_0x4dc8[_0x3859f5];return _0x2025df;};'use strict';var multer=require(_0x84dc('0x0'));var util=require(_0x84dc('0x1'));var path=require(_0x84dc('0x2'));var timeout=require(_0x84dc('0x3'));var express=require(_0x84dc('0x4'));var router=express[_0x84dc('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x84dc('0x6'));var config=require('../../config/environment');var controller=require(_0x84dc('0x7'));router['get']('/',controller[_0x84dc('0x8')]);module[_0x84dc('0x9')]=router; \ No newline at end of file +var _0x7db4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','util','path','connect-timeout','express'];(function(_0x2083ba,_0x254ed8){var _0x2f8390=function(_0x43d65f){while(--_0x43d65f){_0x2083ba['push'](_0x2083ba['shift']());}};_0x2f8390(++_0x254ed8);}(_0x7db4,0x127));var _0x47db=function(_0x8d6c19,_0x513845){_0x8d6c19=_0x8d6c19-0x0;var _0x10ad87=_0x7db4[_0x8d6c19];return _0x10ad87;};'use strict';var multer=require(_0x47db('0x0'));var util=require(_0x47db('0x1'));var path=require(_0x47db('0x2'));var timeout=require(_0x47db('0x3'));var express=require(_0x47db('0x4'));var router=express[_0x47db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x47db('0x6'));var interaction=require(_0x47db('0x7'));var config=require(_0x47db('0x8'));var controller=require('./migration.controller');router[_0x47db('0x9')]('/',controller[_0x47db('0xa')]);module[_0x47db('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f6e1499..05f369a 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 _0xe9e5=['sequelize','STRING','version'];(function(_0x16730a,_0x4a0f4e){var _0x2a7cae=function(_0x2a50ba){while(--_0x2a50ba){_0x16730a['push'](_0x16730a['shift']());}};_0x2a7cae(++_0x4a0f4e);}(_0xe9e5,0x186));var _0x5e9e=function(_0x6850f7,_0x5e24be){_0x6850f7=_0x6850f7-0x0;var _0x2a9f0a=_0xe9e5[_0x6850f7];return _0x2a9f0a;};'use strict';var Sequelize=require(_0x5e9e('0x0'));module['exports']={'version':{'type':Sequelize[_0x5e9e('0x1')],'unique':_0x5e9e('0x2')}}; \ No newline at end of file +var _0x59ba=['version','exports','STRING'];(function(_0x54ae2a,_0x328186){var _0x4ad336=function(_0x2b44e4){while(--_0x2b44e4){_0x54ae2a['push'](_0x54ae2a['shift']());}};_0x4ad336(++_0x328186);}(_0x59ba,0x1ea));var _0xa59b=function(_0xa9f86c,_0x317da5){_0xa9f86c=_0xa9f86c-0x0;var _0x108b8c=_0x59ba[_0xa9f86c];return _0x108b8c;};'use strict';var Sequelize=require('sequelize');module[_0xa59b('0x0')]={'version':{'type':Sequelize[_0xa59b('0x1')],'unique':_0xa59b('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1a08135..b9da79a 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 _0x643e=['error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','zip-dir','request-promise','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x643e,0x193));var _0xe643=function(_0x53d5f4,_0x267d22){_0x53d5f4=_0x53d5f4-0x0;var _0x4cc9fe=_0x643e[_0x53d5f4];return _0x4cc9fe;};'use strict';var emlformat=require(_0xe643('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe643('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe643('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe643('0x3'));var util=require(_0xe643('0x4'));var path=require(_0xe643('0x5'));var sox=require(_0xe643('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe643('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe643('0x8'));var jsforce=require(_0xe643('0x9'));var deskjs=require(_0xe643('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe643('0xb'));var Papa=require('papaparse');var Redis=require(_0xe643('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xe643('0xd'));var as=require(_0xe643('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe643('0xf'));var utils=require(_0xe643('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7c321b,_0x3a01e6){_0x3a01e6=_0x3a01e6||0xcc;return function(_0xb6d40e){if(_0xb6d40e){return _0x7c321b[_0xe643('0x11')](_0x3a01e6);}return _0x7c321b[_0xe643('0x12')](_0x3a01e6)[_0xe643('0x13')]();};}function respondWithResult(_0x3e0894,_0x4cc40d){_0x4cc40d=_0x4cc40d||0xc8;return function(_0x234458){if(_0x234458){return _0x3e0894[_0xe643('0x12')](_0x4cc40d)[_0xe643('0x14')](_0x234458);}};}function respondWithFilteredResult(_0x31a627,_0x321cf7){return function(_0x4b249c){if(_0x4b249c){var _0x1cdc0d=typeof _0x321cf7[_0xe643('0x15')]===_0xe643('0x16')&&typeof _0x321cf7[_0xe643('0x17')]===_0xe643('0x16');var _0x5a375c=_0x4b249c[_0xe643('0x18')];var _0x226058=_0x1cdc0d?0x0:_0x321cf7[_0xe643('0x15')];var _0x1e4790=_0x1cdc0d?_0x4b249c[_0xe643('0x18')]:_0x321cf7[_0xe643('0x15')]+_0x321cf7[_0xe643('0x17')];var _0x2faeab;if(_0x1e4790>=_0x5a375c){_0x1e4790=_0x5a375c;_0x2faeab=0xc8;}else{_0x2faeab=0xce;}_0x31a627[_0xe643('0x12')](_0x2faeab);return _0x31a627[_0xe643('0x19')]('Content-Range',_0x226058+'-'+_0x1e4790+'/'+_0x5a375c)[_0xe643('0x14')](_0x4b249c);}return null;};}function patchUpdates(_0x3041f5){return function(_0x43fb22){try{jsonpatch[_0xe643('0x1a')](_0x43fb22,_0x3041f5,!![]);}catch(_0x12aff3){return BPromise['reject'](_0x12aff3);}return _0x43fb22[_0xe643('0x1b')]();};}function saveUpdates(_0x4d06e7,_0x36799b){return function(_0x59b45a){if(_0x59b45a){return _0x59b45a[_0xe643('0x1c')](_0x4d06e7)[_0xe643('0x1d')](function(_0x4433ea){return _0x4433ea;});}return null;};}function removeEntity(_0x22e121,_0x588410){return function(_0x4eaebd){if(_0x4eaebd){return _0x4eaebd[_0xe643('0x1e')]()[_0xe643('0x1d')](function(){_0x22e121[_0xe643('0x12')](0xcc)[_0xe643('0x13')]();});}};}function handleEntityNotFound(_0xe11e2a,_0x2992b3){return function(_0x16ba82){if(!_0x16ba82){_0xe11e2a[_0xe643('0x11')](0x194);}return _0x16ba82;};}function handleError(_0x483a09,_0x38c51f){_0x38c51f=_0x38c51f||0x1f4;return function(_0xc03aec){logger[_0xe643('0x1f')](_0xc03aec[_0xe643('0x20')]);if(_0xc03aec[_0xe643('0x21')]){delete _0xc03aec[_0xe643('0x21')];}_0x483a09[_0xe643('0x12')](_0x38c51f)[_0xe643('0x22')](_0xc03aec);};}exports[_0xe643('0x23')]=function(_0x5ee22b,_0x4b1061){var _0x5afc42={},_0x4bcb4a={},_0x1386bd={'count':0x0,'rows':[]};var _0x2d9f13=_[_0xe643('0x24')](db[_0xe643('0x25')][_0xe643('0x26')],function(_0x3b26cf){return{'name':_0x3b26cf[_0xe643('0x27')],'type':_0x3b26cf[_0xe643('0x28')]['key']};});_0x4bcb4a['model']=_[_0xe643('0x24')](_0x2d9f13,_0xe643('0x21'));_0x4bcb4a[_0xe643('0x29')]=_[_0xe643('0x2a')](_0x5ee22b[_0xe643('0x29')]);_0x4bcb4a[_0xe643('0x2b')]=_[_0xe643('0x2c')](_0x4bcb4a[_0xe643('0x2d')],_0x4bcb4a[_0xe643('0x29')]);_0x5afc42[_0xe643('0x2e')]=_[_0xe643('0x2c')](_0x4bcb4a[_0xe643('0x2d')],qs[_0xe643('0x2f')](_0x5ee22b[_0xe643('0x29')]['fields']));_0x5afc42[_0xe643('0x2e')]=_0x5afc42[_0xe643('0x2e')][_0xe643('0x30')]?_0x5afc42[_0xe643('0x2e')]:_0x4bcb4a[_0xe643('0x2d')];if(!_0x5ee22b[_0xe643('0x29')]['hasOwnProperty']('nolimit')){_0x5afc42['limit']=qs[_0xe643('0x17')](_0x5ee22b[_0xe643('0x29')][_0xe643('0x17')]);_0x5afc42[_0xe643('0x15')]=qs[_0xe643('0x15')](_0x5ee22b[_0xe643('0x29')][_0xe643('0x15')]);}_0x5afc42[_0xe643('0x31')]=qs[_0xe643('0x32')](_0x5ee22b[_0xe643('0x29')][_0xe643('0x32')]);_0x5afc42[_0xe643('0x33')]=qs[_0xe643('0x2b')](_[_0xe643('0x34')](_0x5ee22b[_0xe643('0x29')],_0x4bcb4a[_0xe643('0x2b')]),_0x2d9f13);if(_0x5ee22b['query'][_0xe643('0x35')]){_0x5afc42['where']=_[_0xe643('0x36')](_0x5afc42[_0xe643('0x33')],{'$or':_['map'](_0x2d9f13,function(_0x5cbdfd){if(_0x5cbdfd[_0xe643('0x28')]!==_0xe643('0x37')){var _0xbbd3f={};_0xbbd3f[_0x5cbdfd[_0xe643('0x21')]]={'$like':'%'+_0x5ee22b[_0xe643('0x29')]['filter']+'%'};return _0xbbd3f;}})});}_0x5afc42=_[_0xe643('0x36')]({},_0x5afc42,_0x5ee22b[_0xe643('0x38')]);var _0xaaab47={'where':_0x5afc42[_0xe643('0x33')]};return db[_0xe643('0x25')][_0xe643('0x18')](_0xaaab47)[_0xe643('0x1d')](function(_0x19eb67){_0x1386bd[_0xe643('0x18')]=_0x19eb67;if(_0x5ee22b[_0xe643('0x29')][_0xe643('0x39')]){_0x5afc42[_0xe643('0x3a')]=[{'all':!![]}];}return db[_0xe643('0x25')][_0xe643('0x3b')](_0x5afc42);})['then'](function(_0x3e6e82){_0x1386bd[_0xe643('0x3c')]=_0x3e6e82;return _0x1386bd;})[_0xe643('0x1d')](respondWithFilteredResult(_0x4b1061,_0x5afc42))[_0xe643('0x3d')](handleError(_0x4b1061,null));}; \ No newline at end of file +var _0x1b55=['merge','options','include','findAll','rows','catch','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','Migration','rawAttributes','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type'];(function(_0x2e4e99,_0x2e55ab){var _0x47b515=function(_0xb2a2f){while(--_0xb2a2f){_0x2e4e99['push'](_0x2e4e99['shift']());}};_0x47b515(++_0x2e55ab);}(_0x1b55,0x1f0));var _0x51b5=function(_0x284d42,_0x308275){_0x284d42=_0x284d42-0x0;var _0x23c5da=_0x1b55[_0x284d42];return _0x23c5da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51b5('0x0'));var jsonpatch=require(_0x51b5('0x1'));var rp=require(_0x51b5('0x2'));var moment=require('moment');var BPromise=require(_0x51b5('0x3'));var Mustache=require(_0x51b5('0x4'));var util=require(_0x51b5('0x5'));var path=require(_0x51b5('0x6'));var sox=require(_0x51b5('0x7'));var csv=require(_0x51b5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51b5('0x9'));var _=require(_0x51b5('0xa'));var squel=require(_0x51b5('0xb'));var crypto=require(_0x51b5('0xc'));var jsforce=require(_0x51b5('0xd'));var deskjs=require(_0x51b5('0xe'));var toCsv=require(_0x51b5('0x8'));var querystring=require(_0x51b5('0xf'));var Papa=require('papaparse');var Redis=require(_0x51b5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x51b5('0x11'));var as=require(_0x51b5('0x12'));var hardwareService=require(_0x51b5('0x13'));var logger=require(_0x51b5('0x14'))(_0x51b5('0x15'));var utils=require(_0x51b5('0x16'));var config=require(_0x51b5('0x17'));var licenseUtil=require(_0x51b5('0x18'));var db=require(_0x51b5('0x19'))['db'];function respondWithStatusCode(_0x469404,_0xbff18e){_0xbff18e=_0xbff18e||0xcc;return function(_0x3d37d8){if(_0x3d37d8){return _0x469404['sendStatus'](_0xbff18e);}return _0x469404[_0x51b5('0x1a')](_0xbff18e)[_0x51b5('0x1b')]();};}function respondWithResult(_0x47f32d,_0x25a63c){_0x25a63c=_0x25a63c||0xc8;return function(_0x24e5df){if(_0x24e5df){return _0x47f32d[_0x51b5('0x1a')](_0x25a63c)[_0x51b5('0x1c')](_0x24e5df);}};}function respondWithFilteredResult(_0x387785,_0x2d4567){return function(_0xb0f468){if(_0xb0f468){var _0xba5e2f=typeof _0x2d4567['offset']==='undefined'&&typeof _0x2d4567[_0x51b5('0x1d')]===_0x51b5('0x1e');var _0x20eba5=_0xb0f468[_0x51b5('0x1f')];var _0x4f0e0c=_0xba5e2f?0x0:_0x2d4567[_0x51b5('0x20')];var _0x916210=_0xba5e2f?_0xb0f468[_0x51b5('0x1f')]:_0x2d4567[_0x51b5('0x20')]+_0x2d4567[_0x51b5('0x1d')];var _0x30dd48;if(_0x916210>=_0x20eba5){_0x916210=_0x20eba5;_0x30dd48=0xc8;}else{_0x30dd48=0xce;}_0x387785[_0x51b5('0x1a')](_0x30dd48);return _0x387785[_0x51b5('0x21')](_0x51b5('0x22'),_0x4f0e0c+'-'+_0x916210+'/'+_0x20eba5)[_0x51b5('0x1c')](_0xb0f468);}return null;};}function patchUpdates(_0x408386){return function(_0xec58b4){try{jsonpatch[_0x51b5('0x23')](_0xec58b4,_0x408386,!![]);}catch(_0x9fd115){return BPromise['reject'](_0x9fd115);}return _0xec58b4[_0x51b5('0x24')]();};}function saveUpdates(_0x229e14,_0x106fa0){return function(_0x63b04a){if(_0x63b04a){return _0x63b04a[_0x51b5('0x25')](_0x229e14)[_0x51b5('0x26')](function(_0x576a7b){return _0x576a7b;});}return null;};}function removeEntity(_0xac46d3,_0x3c7720){return function(_0x16aa0e){if(_0x16aa0e){return _0x16aa0e[_0x51b5('0x27')]()[_0x51b5('0x26')](function(){_0xac46d3[_0x51b5('0x1a')](0xcc)[_0x51b5('0x1b')]();});}};}function handleEntityNotFound(_0x56aa62,_0x5e6a1c){return function(_0x5e4383){if(!_0x5e4383){_0x56aa62[_0x51b5('0x28')](0x194);}return _0x5e4383;};}function handleError(_0x2285c5,_0x328fe5){_0x328fe5=_0x328fe5||0x1f4;return function(_0x2fa296){logger['error'](_0x2fa296[_0x51b5('0x29')]);if(_0x2fa296[_0x51b5('0x2a')]){delete _0x2fa296[_0x51b5('0x2a')];}_0x2285c5[_0x51b5('0x1a')](_0x328fe5)[_0x51b5('0x2b')](_0x2fa296);};}exports[_0x51b5('0x2c')]=function(_0x1c3ce8,_0x17f3f3){var _0x40fd5b={},_0x1a7d83={},_0x44a23c={'count':0x0,'rows':[]};var _0x61b551=_[_0x51b5('0x2d')](db[_0x51b5('0x2e')][_0x51b5('0x2f')],function(_0x23da65){return{'name':_0x23da65['fieldName'],'type':_0x23da65['type'][_0x51b5('0x30')]};});_0x1a7d83[_0x51b5('0x31')]=_['map'](_0x61b551,_0x51b5('0x2a'));_0x1a7d83['query']=_[_0x51b5('0x32')](_0x1c3ce8[_0x51b5('0x33')]);_0x1a7d83['filters']=_['intersection'](_0x1a7d83[_0x51b5('0x31')],_0x1a7d83[_0x51b5('0x33')]);_0x40fd5b[_0x51b5('0x34')]=_[_0x51b5('0x35')](_0x1a7d83[_0x51b5('0x31')],qs['fields'](_0x1c3ce8[_0x51b5('0x33')][_0x51b5('0x36')]));_0x40fd5b['attributes']=_0x40fd5b[_0x51b5('0x34')]['length']?_0x40fd5b[_0x51b5('0x34')]:_0x1a7d83[_0x51b5('0x31')];if(!_0x1c3ce8[_0x51b5('0x33')][_0x51b5('0x37')](_0x51b5('0x38'))){_0x40fd5b['limit']=qs[_0x51b5('0x1d')](_0x1c3ce8['query'][_0x51b5('0x1d')]);_0x40fd5b[_0x51b5('0x20')]=qs[_0x51b5('0x20')](_0x1c3ce8[_0x51b5('0x33')][_0x51b5('0x20')]);}_0x40fd5b[_0x51b5('0x39')]=qs[_0x51b5('0x3a')](_0x1c3ce8['query'][_0x51b5('0x3a')]);_0x40fd5b[_0x51b5('0x3b')]=qs['filters'](_[_0x51b5('0x3c')](_0x1c3ce8[_0x51b5('0x33')],_0x1a7d83[_0x51b5('0x3d')]),_0x61b551);if(_0x1c3ce8[_0x51b5('0x33')][_0x51b5('0x3e')]){_0x40fd5b['where']=_['merge'](_0x40fd5b[_0x51b5('0x3b')],{'$or':_[_0x51b5('0x2d')](_0x61b551,function(_0xa42f5a){if(_0xa42f5a[_0x51b5('0x3f')]!=='VIRTUAL'){var _0x6273d9={};_0x6273d9[_0xa42f5a[_0x51b5('0x2a')]]={'$like':'%'+_0x1c3ce8[_0x51b5('0x33')][_0x51b5('0x3e')]+'%'};return _0x6273d9;}})});}_0x40fd5b=_[_0x51b5('0x40')]({},_0x40fd5b,_0x1c3ce8[_0x51b5('0x41')]);var _0x47b0d1={'where':_0x40fd5b[_0x51b5('0x3b')]};return db[_0x51b5('0x2e')][_0x51b5('0x1f')](_0x47b0d1)[_0x51b5('0x26')](function(_0xa89f45){_0x44a23c[_0x51b5('0x1f')]=_0xa89f45;if(_0x1c3ce8['query']['includeAll']){_0x40fd5b[_0x51b5('0x42')]=[{'all':!![]}];}return db[_0x51b5('0x2e')][_0x51b5('0x43')](_0x40fd5b);})[_0x51b5('0x26')](function(_0x318d74){_0x44a23c[_0x51b5('0x44')]=_0x318d74;return _0x44a23c;})[_0x51b5('0x26')](respondWithFilteredResult(_0x17f3f3,_0x40fd5b))[_0x51b5('0x45')](handleError(_0x17f3f3,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 921bd39..849d246 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 _0x51fe=['moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','Migration','lodash','util','../../config/logger','api'];(function(_0xe99253,_0x3a3b1e){var _0x2b5bd7=function(_0x1151b2){while(--_0x1151b2){_0xe99253['push'](_0xe99253['shift']());}};_0x2b5bd7(++_0x3a3b1e);}(_0x51fe,0x158));var _0xe51f=function(_0x177091,_0x15adab){_0x177091=_0x177091-0x0;var _0x2297af=_0x51fe[_0x177091];return _0x2297af;};'use strict';var _=require(_0xe51f('0x0'));var util=require(_0xe51f('0x1'));var logger=require(_0xe51f('0x2'))(_0xe51f('0x3'));var moment=require(_0xe51f('0x4'));var BPromise=require(_0xe51f('0x5'));var rp=require(_0xe51f('0x6'));var fs=require('fs');var path=require(_0xe51f('0x7'));var rimraf=require('rimraf');var config=require(_0xe51f('0x8'));var attributes=require(_0xe51f('0x9'));module[_0xe51f('0xa')]=function(_0x1c6d65,_0x58202e){return _0x1c6d65['define'](_0xe51f('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2471=['migrations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','Migration'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2471,0x177));var _0x1247=function(_0x53bd78,_0x10d751){_0x53bd78=_0x53bd78-0x0;var _0x9adfcd=_0x2471[_0x53bd78];return _0x9adfcd;};'use strict';var _=require(_0x1247('0x0'));var util=require(_0x1247('0x1'));var logger=require(_0x1247('0x2'))(_0x1247('0x3'));var moment=require(_0x1247('0x4'));var BPromise=require('bluebird');var rp=require(_0x1247('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1247('0x6'));var config=require(_0x1247('0x7'));var attributes=require('./migration.attributes');module[_0x1247('0x8')]=function(_0xd5d6eb,_0x63e509){return _0xd5d6eb['define'](_0x1247('0x9'),attributes,{'tableName':_0x1247('0xa'),'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 0b5c644..48cceb9 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 _0xf2a6=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Migration,\x20%s,\x20%s','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x27a91b,_0x13f7e9){_0x27a91b=_0x27a91b-0x0;var _0x42f274=_0xf2a6[_0x27a91b];return _0x42f274;};'use strict';var _=require(_0x6f2a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f2a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f2a('0x2'))['db'];var utils=require(_0x6f2a('0x3'));var logger=require(_0x6f2a('0x4'))(_0x6f2a('0x5'));var config=require(_0x6f2a('0x6'));var jayson=require(_0x6f2a('0x7'));var client=jayson[_0x6f2a('0x8')][_0x6f2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1efd8,_0x424ebd,_0x4b4fde){return new BPromise(function(_0x379b80,_0xda4179){return client[_0x6f2a('0xa')](_0x1efd8,_0x4b4fde)[_0x6f2a('0xb')](function(_0x5b1229){logger[_0x6f2a('0xc')]('Migration,\x20%s,\x20%s',_0x424ebd,_0x6f2a('0xd'));logger[_0x6f2a('0xe')](_0x6f2a('0xf'),_0x424ebd,'request\x20sent',JSON[_0x6f2a('0x10')](_0x5b1229));if(_0x5b1229['error']){if(_0x5b1229[_0x6f2a('0x11')][_0x6f2a('0x12')]===0x1f4){logger[_0x6f2a('0x11')]('Migration,\x20%s,\x20%s',_0x424ebd,_0x5b1229[_0x6f2a('0x11')]['message']);return _0xda4179(_0x5b1229[_0x6f2a('0x11')][_0x6f2a('0x13')]);}logger[_0x6f2a('0x11')](_0x6f2a('0x14'),_0x424ebd,_0x5b1229[_0x6f2a('0x11')]['message']);return _0x379b80(_0x5b1229[_0x6f2a('0x11')][_0x6f2a('0x13')]);}else{logger[_0x6f2a('0xc')](_0x6f2a('0x14'),_0x424ebd,_0x6f2a('0xd'));_0x379b80(_0x5b1229[_0x6f2a('0x15')][_0x6f2a('0x13')]);}})[_0x6f2a('0x16')](function(_0x2cf5de){logger[_0x6f2a('0x11')](_0x6f2a('0x14'),_0x424ebd,_0x2cf5de);_0xda4179(_0x2cf5de);});});} \ No newline at end of file +var _0xffaa=['http','request','Migration,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffaa,0x130));var _0xaffa=function(_0x1fc6c1,_0x13e06e){_0x1fc6c1=_0x1fc6c1-0x0;var _0x2dcc45=_0xffaa[_0x1fc6c1];return _0x2dcc45;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaffa('0x3'));var db=require(_0xaffa('0x4'))['db'];var utils=require(_0xaffa('0x5'));var logger=require(_0xaffa('0x6'))(_0xaffa('0x7'));var config=require(_0xaffa('0x8'));var jayson=require(_0xaffa('0x9'));var client=jayson[_0xaffa('0xa')][_0xaffa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x281191,_0x48320d,_0xa081be){return new BPromise(function(_0x7c018f,_0x10be9f){return client[_0xaffa('0xc')](_0x281191,_0xa081be)['then'](function(_0x32eeca){logger['info'](_0xaffa('0xd'),_0x48320d,_0xaffa('0xe'));logger[_0xaffa('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x48320d,_0xaffa('0xe'),JSON['stringify'](_0x32eeca));if(_0x32eeca['error']){if(_0x32eeca['error'][_0xaffa('0x10')]===0x1f4){logger[_0xaffa('0x11')](_0xaffa('0xd'),_0x48320d,_0x32eeca['error'][_0xaffa('0x12')]);return _0x10be9f(_0x32eeca['error'][_0xaffa('0x12')]);}logger['error'](_0xaffa('0xd'),_0x48320d,_0x32eeca[_0xaffa('0x11')][_0xaffa('0x12')]);return _0x7c018f(_0x32eeca[_0xaffa('0x11')][_0xaffa('0x12')]);}else{logger[_0xaffa('0x13')](_0xaffa('0xd'),_0x48320d,_0xaffa('0xe'));_0x7c018f(_0x32eeca['result'][_0xaffa('0x12')]);}})[_0xaffa('0x14')](function(_0x4b7d89){logger[_0xaffa('0x11')]('Migration,\x20%s,\x20%s',_0x48320d,_0x4b7d89);_0x10be9f(_0x4b7d89);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e90f2f9..c6a4b60 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 _0x7d37=['fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','update','destroy','exports','multer','util','path','express','Router'];(function(_0xfdf6b5,_0x3eb334){var _0x35fb54=function(_0x370b61){while(--_0x370b61){_0xfdf6b5['push'](_0xfdf6b5['shift']());}};_0x35fb54(++_0x3eb334);}(_0x7d37,0x1db));var _0x77d3=function(_0x75ecea,_0x489cb7){_0x75ecea=_0x75ecea-0x0;var _0x4c3a49=_0x7d37[_0x75ecea];return _0x4c3a49;};'use strict';var multer=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var path=require(_0x77d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x77d3('0x3'));var router=express[_0x77d3('0x4')]();var fs_extra=require(_0x77d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77d3('0x6'));var config=require(_0x77d3('0x7'));var controller=require('./network.controller');router[_0x77d3('0x8')]('/',auth['isAuthenticated'](),controller[_0x77d3('0x9')]);router['get'](_0x77d3('0xa'),auth[_0x77d3('0xb')](),controller['show']);router['post']('/',auth[_0x77d3('0xb')](),controller[_0x77d3('0xc')]);router['put'](_0x77d3('0xa'),auth['isAuthenticated'](),controller[_0x77d3('0xd')]);router['delete'](_0x77d3('0xa'),auth['isAuthenticated'](),controller[_0x77d3('0xe')]);module[_0x77d3('0xf')]=router; \ No newline at end of file +var _0x01db=['./network.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2411fd,_0x4005bb){var _0x57c92c=function(_0x52c2b4){while(--_0x52c2b4){_0x2411fd['push'](_0x2411fd['shift']());}};_0x57c92c(++_0x4005bb);}(_0x01db,0x171));var _0xb01d=function(_0x8e864f,_0x3e56c7){_0x8e864f=_0x8e864f-0x0;var _0x43876e=_0x01db[_0x8e864f];return _0x43876e;};'use strict';var multer=require(_0xb01d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb01d('0x1'));var express=require(_0xb01d('0x2'));var router=express[_0xb01d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb01d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb01d('0x5'));router[_0xb01d('0x6')]('/',auth[_0xb01d('0x7')](),controller[_0xb01d('0x8')]);router[_0xb01d('0x6')](_0xb01d('0x9'),auth[_0xb01d('0x7')](),controller[_0xb01d('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb01d('0xb')]);router[_0xb01d('0xc')](_0xb01d('0x9'),auth[_0xb01d('0x7')](),controller[_0xb01d('0xd')]);router[_0xb01d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb01d('0xf')]);module[_0xb01d('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 202b274..e398fb9 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 _0xbffe=['STRING','sequelize','ENUM','localnet','stun','turn'];(function(_0x561ac5,_0x5931e7){var _0x17a30e=function(_0x58be2b){while(--_0x58be2b){_0x561ac5['push'](_0x561ac5['shift']());}};_0x17a30e(++_0x5931e7);}(_0xbffe,0x85));var _0xebff=function(_0x3ae176,_0x5c3182){_0x3ae176=_0x3ae176-0x0;var _0x56d486=_0xbffe[_0x3ae176];return _0x56d486;};'use strict';var Sequelize=require(_0xebff('0x0'));module['exports']={'type':{'type':Sequelize[_0xebff('0x1')](_0xebff('0x2'),'externip',_0xebff('0x3'),_0xebff('0x4'))},'value':{'type':Sequelize[_0xebff('0x5')]},'username':{'type':Sequelize[_0xebff('0x5')]},'password':{'type':Sequelize[_0xebff('0x5')]}}; \ No newline at end of file +var _0xa7ea=['localnet','externip','stun','turn','STRING','exports','ENUM'];(function(_0x10a889,_0x220612){var _0x3b5ed3=function(_0x4f0137){while(--_0x4f0137){_0x10a889['push'](_0x10a889['shift']());}};_0x3b5ed3(++_0x220612);}(_0xa7ea,0x83));var _0xaa7e=function(_0x49f9cf,_0x33b5e6){_0x49f9cf=_0x49f9cf-0x0;var _0x1595c1=_0xa7ea[_0x49f9cf];return _0x1595c1;};'use strict';var Sequelize=require('sequelize');module[_0xaa7e('0x0')]={'type':{'type':Sequelize[_0xaa7e('0x1')](_0xaa7e('0x2'),_0xaa7e('0x3'),_0xaa7e('0x4'),_0xaa7e('0x5'))},'value':{'type':Sequelize[_0xaa7e('0x6')]},'username':{'type':Sequelize[_0xaa7e('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 1bee706..2fce05c 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 _0x7118=['VIRTUAL','include','catch','keys','includeAll','options','find','create','sequelize','findAll','STUN','readFileSync','join','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','TURN','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','body','server/files/templates/stun_multiple.ejs','res_stun_monitor.so','params','destroy','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/license/util','../../mysqldb','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','end','stack','name','send','map','Network','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7118,0x159));var _0x8711=function(_0x5063b7,_0xbe05a3){_0x5063b7=_0x5063b7-0x0;var _0x28beba=_0x7118[_0x5063b7];return _0x28beba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8711('0x0'));var jsonpatch=require(_0x8711('0x1'));var rp=require('request-promise');var moment=require(_0x8711('0x2'));var BPromise=require(_0x8711('0x3'));var Mustache=require(_0x8711('0x4'));var util=require(_0x8711('0x5'));var path=require(_0x8711('0x6'));var sox=require(_0x8711('0x7'));var csv=require(_0x8711('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8711('0x9'));var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0x8'));var querystring=require(_0x8711('0xf'));var Papa=require(_0x8711('0x10'));var Redis=require(_0x8711('0x11'));var authService=require(_0x8711('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x13'));var logger=require(_0x8711('0x14'))(_0x8711('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8711('0x16'));var db=require(_0x8711('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x8711('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3403f5,_0x25a608,_0x2758ee,_0xc0a891){return new BPromise(function(_0x22f434,_0x16b742){var _0x4a2330=_0xc0a891||client;return _0x4a2330[_0x8711('0x19')](_0x3403f5,_0x2758ee)[_0x8711('0x1a')](function(_0x13f394){logger[_0x8711('0x1b')](_0x8711('0x1c'),_0x25a608,_0x8711('0x1d'));logger['debug'](_0x8711('0x1e'),_0x25a608,_0x8711('0x1d'),JSON[_0x8711('0x1f')](_0x13f394));if(_0x13f394[_0x8711('0x20')]){if(_0x13f394[_0x8711('0x20')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x25a608,_0x13f394[_0x8711('0x20')][_0x8711('0x21')]);return _0x16b742(_0x13f394[_0x8711('0x20')]['message']);}logger['error'](_0x8711('0x1c'),_0x25a608,_0x13f394[_0x8711('0x20')][_0x8711('0x21')]);return _0x22f434(_0x13f394[_0x8711('0x20')][_0x8711('0x21')]);}else{logger[_0x8711('0x1b')](_0x8711('0x1c'),_0x25a608,_0x8711('0x1d'));_0x22f434(_0x13f394[_0x8711('0x22')][_0x8711('0x21')]);}})['catch'](function(_0x2613de){logger[_0x8711('0x20')](_0x8711('0x1c'),_0x25a608,_0x2613de);_0x16b742(_0x2613de);});});}function respondWithStatusCode(_0x939ef3,_0x4cf830){_0x4cf830=_0x4cf830||0xcc;return function(_0x27cafd){if(_0x27cafd){return _0x939ef3[_0x8711('0x23')](_0x4cf830);}return _0x939ef3[_0x8711('0x24')](_0x4cf830)['end']();};}function respondWithResult(_0xb20da2,_0x17bf7f){_0x17bf7f=_0x17bf7f||0xc8;return function(_0x3e8281){if(_0x3e8281){return _0xb20da2[_0x8711('0x24')](_0x17bf7f)[_0x8711('0x25')](_0x3e8281);}};}function respondWithFilteredResult(_0x514956,_0x494683){return function(_0x515a74){if(_0x515a74){var _0x2ad1fa=typeof _0x494683[_0x8711('0x26')]===_0x8711('0x27')&&typeof _0x494683[_0x8711('0x28')]===_0x8711('0x27');var _0x254b35=_0x515a74[_0x8711('0x29')];var _0x3ca2b5=_0x2ad1fa?0x0:_0x494683[_0x8711('0x26')];var _0x47e7b7=_0x2ad1fa?_0x515a74[_0x8711('0x29')]:_0x494683['offset']+_0x494683[_0x8711('0x28')];var _0xd0c671;if(_0x47e7b7>=_0x254b35){_0x47e7b7=_0x254b35;_0xd0c671=0xc8;}else{_0xd0c671=0xce;}_0x514956[_0x8711('0x24')](_0xd0c671);return _0x514956['set'](_0x8711('0x2a'),_0x3ca2b5+'-'+_0x47e7b7+'/'+_0x254b35)['json'](_0x515a74);}return null;};}function patchUpdates(_0x2c4ba3){return function(_0xa85687){try{jsonpatch[_0x8711('0x2b')](_0xa85687,_0x2c4ba3,!![]);}catch(_0x5c4fcc){return BPromise['reject'](_0x5c4fcc);}return _0xa85687[_0x8711('0x2c')]();};}function saveUpdates(_0x31efa0,_0x35af69){return function(_0x6ab2c7){if(_0x6ab2c7){return _0x6ab2c7[_0x8711('0x2d')](_0x31efa0)[_0x8711('0x1a')](function(_0xc0e73f){return _0xc0e73f;});}return null;};}function removeEntity(_0x64cf25,_0x356303){return function(_0x36f3bd){if(_0x36f3bd){return _0x36f3bd['destroy']()[_0x8711('0x1a')](function(){_0x64cf25[_0x8711('0x24')](0xcc)[_0x8711('0x2e')]();});}};}function handleEntityNotFound(_0x285390,_0x11e2fc){return function(_0x23a78b){if(!_0x23a78b){_0x285390[_0x8711('0x23')](0x194);}return _0x23a78b;};}function handleError(_0x456a23,_0x31a450){_0x31a450=_0x31a450||0x1f4;return function(_0x2c90f0){logger['error'](_0x2c90f0[_0x8711('0x2f')]);if(_0x2c90f0[_0x8711('0x30')]){delete _0x2c90f0[_0x8711('0x30')];}_0x456a23[_0x8711('0x24')](_0x31a450)[_0x8711('0x31')](_0x2c90f0);};}exports['index']=function(_0xe54c38,_0xc4fe93){var _0xa31bb6={},_0x59486c={},_0xee57e={'count':0x0,'rows':[]};var _0x37fc30=_[_0x8711('0x32')](db[_0x8711('0x33')][_0x8711('0x34')],function(_0x14922d){return{'name':_0x14922d[_0x8711('0x35')],'type':_0x14922d['type'][_0x8711('0x36')]};});_0x59486c[_0x8711('0x37')]=_[_0x8711('0x32')](_0x37fc30,_0x8711('0x30'));_0x59486c['query']=_['keys'](_0xe54c38[_0x8711('0x38')]);_0x59486c[_0x8711('0x39')]=_[_0x8711('0x3a')](_0x59486c[_0x8711('0x37')],_0x59486c[_0x8711('0x38')]);_0xa31bb6[_0x8711('0x3b')]=_[_0x8711('0x3a')](_0x59486c[_0x8711('0x37')],qs[_0x8711('0x3c')](_0xe54c38[_0x8711('0x38')][_0x8711('0x3c')]));_0xa31bb6[_0x8711('0x3b')]=_0xa31bb6[_0x8711('0x3b')][_0x8711('0x3d')]?_0xa31bb6[_0x8711('0x3b')]:_0x59486c[_0x8711('0x37')];if(!_0xe54c38[_0x8711('0x38')][_0x8711('0x3e')](_0x8711('0x3f'))){_0xa31bb6[_0x8711('0x28')]=qs[_0x8711('0x28')](_0xe54c38['query'][_0x8711('0x28')]);_0xa31bb6['offset']=qs[_0x8711('0x26')](_0xe54c38[_0x8711('0x38')][_0x8711('0x26')]);}_0xa31bb6[_0x8711('0x40')]=qs['sort'](_0xe54c38[_0x8711('0x38')][_0x8711('0x41')]);_0xa31bb6[_0x8711('0x42')]=qs[_0x8711('0x39')](_[_0x8711('0x43')](_0xe54c38[_0x8711('0x38')],_0x59486c['filters']),_0x37fc30);if(_0xe54c38[_0x8711('0x38')][_0x8711('0x44')]){_0xa31bb6[_0x8711('0x42')]=_[_0x8711('0x45')](_0xa31bb6['where'],{'$or':_[_0x8711('0x32')](_0x37fc30,function(_0x2edbb6){if(_0x2edbb6[_0x8711('0x46')]!==_0x8711('0x47')){var _0x304781={};_0x304781[_0x2edbb6['name']]={'$like':'%'+_0xe54c38['query'][_0x8711('0x44')]+'%'};return _0x304781;}})});}_0xa31bb6=_[_0x8711('0x45')]({},_0xa31bb6,_0xe54c38['options']);var _0x9fba5c={'where':_0xa31bb6[_0x8711('0x42')]};return db[_0x8711('0x33')][_0x8711('0x29')](_0x9fba5c)['then'](function(_0x34ef5a){_0xee57e[_0x8711('0x29')]=_0x34ef5a;if(_0xe54c38[_0x8711('0x38')]['includeAll']){_0xa31bb6[_0x8711('0x48')]=[{'all':!![]}];}return db[_0x8711('0x33')]['findAll'](_0xa31bb6);})[_0x8711('0x1a')](function(_0x14a815){_0xee57e['rows']=_0x14a815;return _0xee57e;})[_0x8711('0x1a')](respondWithFilteredResult(_0xc4fe93,_0xa31bb6))[_0x8711('0x49')](handleError(_0xc4fe93,null));};exports['show']=function(_0x2422b1,_0x3056ae){var _0x1c55d8={'raw':!![],'where':{'id':_0x2422b1['params']['id']}},_0x17a3f5={};_0x17a3f5[_0x8711('0x37')]=_[_0x8711('0x4a')](db['Network'][_0x8711('0x34')]);_0x17a3f5[_0x8711('0x38')]=_['keys'](_0x2422b1['query']);_0x17a3f5['filters']=_['intersection'](_0x17a3f5[_0x8711('0x37')],_0x17a3f5[_0x8711('0x38')]);_0x1c55d8[_0x8711('0x3b')]=_[_0x8711('0x3a')](_0x17a3f5[_0x8711('0x37')],qs[_0x8711('0x3c')](_0x2422b1[_0x8711('0x38')]['fields']));_0x1c55d8['attributes']=_0x1c55d8['attributes'][_0x8711('0x3d')]?_0x1c55d8[_0x8711('0x3b')]:_0x17a3f5[_0x8711('0x37')];if(_0x2422b1[_0x8711('0x38')][_0x8711('0x4b')]){_0x1c55d8[_0x8711('0x48')]=[{'all':!![]}];}_0x1c55d8=_['merge']({},_0x1c55d8,_0x2422b1[_0x8711('0x4c')]);return db[_0x8711('0x33')][_0x8711('0x4d')](_0x1c55d8)['then'](handleEntityNotFound(_0x3056ae,null))[_0x8711('0x1a')](respondWithResult(_0x3056ae,null))[_0x8711('0x49')](handleError(_0x3056ae,null));};exports[_0x8711('0x4e')]=function(_0x152e24,_0x449e3d,_0xac94c0){var _0x2cfecd;return db[_0x8711('0x4f')]['transaction'](function(_0x191eea){return db['Network'][_0x8711('0x4e')](_0x152e24['body'],{'raw':!![]})['then'](function(_0x4f6f3d){_0x2cfecd=_0x4f6f3d;return db[_0x8711('0x33')][_0x8711('0x50')]({'where':{'type':_0x152e24['body'][_0x8711('0x46')]},'raw':!![]});})['then'](function(_0x30f839){if(_0x2cfecd[_0x8711('0x46')]['toUpperCase']()==_0x8711('0x51')){var _0x4fa011=fs[_0x8711('0x52')](path[_0x8711('0x53')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x8711('0x54'));var _0x4b9972=ejs[_0x8711('0x55')](_0x4fa011,{'networks':_0x30f839||[]});fs[_0x8711('0x56')](_0x8711('0x57'),_0x4b9972);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x4e'),{'module':'res_stun_monitor.so'});}else if(_0x2cfecd[_0x8711('0x46')][_0x8711('0x59')]()==_0x8711('0x5a')){var _0x42111c=fs[_0x8711('0x52')](path['join'](config[_0x8711('0x5b')],_0x8711('0x5c')),_0x8711('0x54'));var _0x5d9978=ejs['render'](_0x42111c,{'networks':_0x30f839||[]});fs[_0x8711('0x56')](_0x8711('0x5d'),_0x5d9978);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else{var _0x11ffda=fs[_0x8711('0x52')](path[_0x8711('0x53')](config[_0x8711('0x5b')],_0x8711('0x5e')),_0x8711('0x54'));var _0xc2e94b=ejs[_0x8711('0x55')](_0x11ffda,{'networks':_0x30f839||[]});fs[_0x8711('0x56')](util[_0x8711('0x5f')](_0x8711('0x60'),_0x152e24['body'][_0x8711('0x46')][_0x8711('0x61')]()),_0xc2e94b);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x4e'),{'module':_0x8711('0x62')});}return null;})[_0x8711('0x1a')](function(){return _0x2cfecd;});})[_0x8711('0x1a')](respondWithResult(_0x449e3d,0xc9))[_0x8711('0x49')](handleError(_0x449e3d,null));};exports[_0x8711('0x2d')]=function(_0x397c02,_0x5706f5,_0x2d4142){var _0x334308;return db[_0x8711('0x4f')]['transaction'](function(_0x1ef017){return db[_0x8711('0x33')][_0x8711('0x4d')]({'where':{'id':_0x397c02['params']['id']}})['then'](handleEntityNotFound(_0x5706f5,null))['then'](saveUpdates(_0x397c02[_0x8711('0x63')],null))[_0x8711('0x1a')](function(_0x53f8da){if(_0x53f8da){_0x334308=_0x53f8da;return db[_0x8711('0x33')][_0x8711('0x50')]({'where':{'type':_0x334308['type']},'raw':!![]});}return null;})[_0x8711('0x1a')](function(_0x37b23a){if(_0x334308[_0x8711('0x46')][_0x8711('0x59')]()=='STUN'){var _0x2a466c=fs[_0x8711('0x52')](path['join'](config[_0x8711('0x5b')],_0x8711('0x64')),'utf8');var _0x1dc582=ejs['render'](_0x2a466c,{'networks':_0x37b23a||[]});fs[_0x8711('0x56')](_0x8711('0x57'),_0x1dc582);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x2d'),{'module':_0x8711('0x65')});}else if(_0x334308[_0x8711('0x46')][_0x8711('0x59')]()==_0x8711('0x5a')){var _0x11ae51=fs[_0x8711('0x52')](path[_0x8711('0x53')](config[_0x8711('0x5b')],_0x8711('0x5c')),_0x8711('0x54'));var _0x140d54=ejs[_0x8711('0x55')](_0x11ae51,{'networks':_0x37b23a||[]});fs[_0x8711('0x56')]('/etc/asterisk/turn_xcally.conf',_0x140d54);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x2d'),{'module':_0x8711('0x65')});}else{var _0x516837=fs['readFileSync'](path[_0x8711('0x53')](config[_0x8711('0x5b')],_0x8711('0x5e')),'utf8');var _0x2e8c95=ejs['render'](_0x516837,{'networks':_0x37b23a||[]});fs[_0x8711('0x56')](util[_0x8711('0x5f')](_0x8711('0x60'),_0x397c02[_0x8711('0x63')]['type'][_0x8711('0x61')]()),_0x2e8c95);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x2d'),{'module':'chan_sip.so'});}return null;})[_0x8711('0x1a')](function(_0x56d0cb){if(_0x56d0cb){return _0x334308;}return null;});})[_0x8711('0x1a')](respondWithResult(_0x5706f5,null))[_0x8711('0x49')](handleError(_0x5706f5,null));};exports['destroy']=function(_0x5a8751,_0xf0f92e,_0xe6acca){var _0x2e1112;return db[_0x8711('0x33')][_0x8711('0x4d')]({'where':{'id':_0x5a8751[_0x8711('0x66')]['id']}})[_0x8711('0x1a')](function(_0x3bb1e1){_0x2e1112=_0x3bb1e1;return _0x3bb1e1;})[_0x8711('0x1a')](handleEntityNotFound(_0xf0f92e,null))['then'](removeEntity(_0xf0f92e,null))[_0x8711('0x1a')](function(){if(_0x2e1112){return db['Network']['findAll']({'where':{'type':_0x2e1112[_0x8711('0x46')]},'raw':!![]});}})['then'](function(_0x3b46ac){if(_0x2e1112[_0x8711('0x46')][_0x8711('0x59')]()==_0x8711('0x51')){var _0xa7bb67=fs[_0x8711('0x52')](path[_0x8711('0x53')](config[_0x8711('0x5b')],_0x8711('0x64')),_0x8711('0x54'));var _0x357abf=ejs[_0x8711('0x55')](_0xa7bb67,{'networks':_0x3b46ac||[]});fs[_0x8711('0x56')](_0x8711('0x57'),_0x357abf);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x67'),{'module':_0x8711('0x65')});}else if(_0x2e1112['type'][_0x8711('0x59')]()==_0x8711('0x5a')){var _0x449713=fs['readFileSync'](path['join'](config['root'],_0x8711('0x5c')),_0x8711('0x54'));var _0x510081=ejs[_0x8711('0x55')](_0x449713,{'networks':_0x3b46ac||[]});fs[_0x8711('0x56')]('/etc/asterisk/turn_xcally.conf',_0x510081);return respondWithRpcPromise('Reload',_0x8711('0x67'),{'module':_0x8711('0x65')});}else{var _0x2b167c=fs[_0x8711('0x52')](path[_0x8711('0x53')](config[_0x8711('0x5b')],_0x8711('0x5e')),_0x8711('0x54'));var _0x2ad62e=ejs[_0x8711('0x55')](_0x2b167c,{'networks':_0x3b46ac||[]});fs[_0x8711('0x56')](util[_0x8711('0x5f')](_0x8711('0x60'),_0x5a8751[_0x8711('0x63')]['type'][_0x8711('0x61')]()),_0x2ad62e);return respondWithRpcPromise(_0x8711('0x58'),_0x8711('0x67'),{'module':'chan_sip.so'});}return null;})[_0x8711('0x49')](handleError(_0xf0f92e,null));}; \ No newline at end of file +var _0x2392=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','end','stack','name','index','map','Network','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','limit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','params','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/turn_multiple.ejs','Reload','res_stun_monitor.so','utf8','render','writeFileSync','format','toLowerCase','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','destroy'];(function(_0xb0cf4e,_0x1b5e28){var _0x2ae5e0=function(_0x5c28bd){while(--_0x5c28bd){_0xb0cf4e['push'](_0xb0cf4e['shift']());}};_0x2ae5e0(++_0x1b5e28);}(_0x2392,0xd0));var _0x2239=function(_0x113d9b,_0x35f891){_0x113d9b=_0x113d9b-0x0;var _0x2f7a26=_0x2392[_0x113d9b];return _0x2f7a26;};'use strict';var emlformat=require(_0x2239('0x0'));var rimraf=require(_0x2239('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2239('0x2'));var rp=require(_0x2239('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2239('0x4'));var util=require(_0x2239('0x5'));var path=require(_0x2239('0x6'));var sox=require(_0x2239('0x7'));var csv=require(_0x2239('0x8'));var ejs=require(_0x2239('0x9'));var fs=require('fs');var fs_extra=require(_0x2239('0xa'));var _=require(_0x2239('0xb'));var squel=require(_0x2239('0xc'));var crypto=require(_0x2239('0xd'));var jsforce=require(_0x2239('0xe'));var deskjs=require(_0x2239('0xf'));var toCsv=require(_0x2239('0x8'));var querystring=require('querystring');var Papa=require(_0x2239('0x10'));var Redis=require(_0x2239('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2239('0x12'));var hardwareService=require(_0x2239('0x13'));var logger=require(_0x2239('0x14'))(_0x2239('0x15'));var utils=require(_0x2239('0x16'));var config=require(_0x2239('0x17'));var licenseUtil=require(_0x2239('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2239('0x19'));var client=jayson[_0x2239('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22e6af,_0x13e54e,_0x4508dc,_0x3338b0){return new BPromise(function(_0x5165dc,_0x367c82){var _0x50be7b=_0x3338b0||client;return _0x50be7b[_0x2239('0x1b')](_0x22e6af,_0x4508dc)[_0x2239('0x1c')](function(_0x4236da){logger[_0x2239('0x1d')]('Network,\x20%s,\x20%s',_0x13e54e,_0x2239('0x1e'));logger[_0x2239('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x13e54e,_0x2239('0x1e'),JSON['stringify'](_0x4236da));if(_0x4236da[_0x2239('0x20')]){if(_0x4236da['error'][_0x2239('0x21')]===0x1f4){logger['error'](_0x2239('0x22'),_0x13e54e,_0x4236da[_0x2239('0x20')][_0x2239('0x23')]);return _0x367c82(_0x4236da[_0x2239('0x20')]['message']);}logger[_0x2239('0x20')]('Network,\x20%s,\x20%s',_0x13e54e,_0x4236da[_0x2239('0x20')]['message']);return _0x5165dc(_0x4236da[_0x2239('0x20')][_0x2239('0x23')]);}else{logger[_0x2239('0x1d')]('Network,\x20%s,\x20%s',_0x13e54e,'request\x20sent');_0x5165dc(_0x4236da[_0x2239('0x24')]['message']);}})[_0x2239('0x25')](function(_0x34bbb8){logger[_0x2239('0x20')](_0x2239('0x22'),_0x13e54e,_0x34bbb8);_0x367c82(_0x34bbb8);});});}function respondWithStatusCode(_0x54af84,_0x1f1f49){_0x1f1f49=_0x1f1f49||0xcc;return function(_0x12133e){if(_0x12133e){return _0x54af84[_0x2239('0x26')](_0x1f1f49);}return _0x54af84[_0x2239('0x27')](_0x1f1f49)['end']();};}function respondWithResult(_0x3e2493,_0x44e671){_0x44e671=_0x44e671||0xc8;return function(_0x18ae1b){if(_0x18ae1b){return _0x3e2493['status'](_0x44e671)[_0x2239('0x28')](_0x18ae1b);}};}function respondWithFilteredResult(_0x3c809e,_0x5bd318){return function(_0x1c179e){if(_0x1c179e){var _0x1ba564=typeof _0x5bd318[_0x2239('0x29')]===_0x2239('0x2a')&&typeof _0x5bd318['limit']==='undefined';var _0x4a970a=_0x1c179e['count'];var _0x576ac9=_0x1ba564?0x0:_0x5bd318[_0x2239('0x29')];var _0x1ba5ad=_0x1ba564?_0x1c179e[_0x2239('0x2b')]:_0x5bd318[_0x2239('0x29')]+_0x5bd318['limit'];var _0x37adc3;if(_0x1ba5ad>=_0x4a970a){_0x1ba5ad=_0x4a970a;_0x37adc3=0xc8;}else{_0x37adc3=0xce;}_0x3c809e[_0x2239('0x27')](_0x37adc3);return _0x3c809e[_0x2239('0x2c')](_0x2239('0x2d'),_0x576ac9+'-'+_0x1ba5ad+'/'+_0x4a970a)[_0x2239('0x28')](_0x1c179e);}return null;};}function patchUpdates(_0xac6fe8){return function(_0x26f3f2){try{jsonpatch['apply'](_0x26f3f2,_0xac6fe8,!![]);}catch(_0x441eba){return BPromise[_0x2239('0x2e')](_0x441eba);}return _0x26f3f2[_0x2239('0x2f')]();};}function saveUpdates(_0x3cc74c,_0x3ad5ca){return function(_0x50d262){if(_0x50d262){return _0x50d262[_0x2239('0x30')](_0x3cc74c)[_0x2239('0x1c')](function(_0x539e06){return _0x539e06;});}return null;};}function removeEntity(_0x57f077,_0x48d661){return function(_0x502c3f){if(_0x502c3f){return _0x502c3f['destroy']()[_0x2239('0x1c')](function(){_0x57f077[_0x2239('0x27')](0xcc)[_0x2239('0x31')]();});}};}function handleEntityNotFound(_0x20bcea,_0x293974){return function(_0x598395){if(!_0x598395){_0x20bcea[_0x2239('0x26')](0x194);}return _0x598395;};}function handleError(_0x441ed3,_0x27fd3b){_0x27fd3b=_0x27fd3b||0x1f4;return function(_0x59fdc8){logger[_0x2239('0x20')](_0x59fdc8[_0x2239('0x32')]);if(_0x59fdc8[_0x2239('0x33')]){delete _0x59fdc8['name'];}_0x441ed3['status'](_0x27fd3b)['send'](_0x59fdc8);};}exports[_0x2239('0x34')]=function(_0x13663d,_0x357c91){var _0x4b0ea8={},_0x54bc5b={},_0x37dcfd={'count':0x0,'rows':[]};var _0x4f7a1a=_[_0x2239('0x35')](db[_0x2239('0x36')][_0x2239('0x37')],function(_0x3bacf1){return{'name':_0x3bacf1['fieldName'],'type':_0x3bacf1[_0x2239('0x38')][_0x2239('0x39')]};});_0x54bc5b[_0x2239('0x3a')]=_[_0x2239('0x35')](_0x4f7a1a,_0x2239('0x33'));_0x54bc5b[_0x2239('0x3b')]=_[_0x2239('0x3c')](_0x13663d[_0x2239('0x3b')]);_0x54bc5b['filters']=_[_0x2239('0x3d')](_0x54bc5b[_0x2239('0x3a')],_0x54bc5b[_0x2239('0x3b')]);_0x4b0ea8[_0x2239('0x3e')]=_[_0x2239('0x3d')](_0x54bc5b[_0x2239('0x3a')],qs[_0x2239('0x3f')](_0x13663d[_0x2239('0x3b')][_0x2239('0x3f')]));_0x4b0ea8[_0x2239('0x3e')]=_0x4b0ea8['attributes'][_0x2239('0x40')]?_0x4b0ea8[_0x2239('0x3e')]:_0x54bc5b[_0x2239('0x3a')];if(!_0x13663d[_0x2239('0x3b')]['hasOwnProperty']('nolimit')){_0x4b0ea8[_0x2239('0x41')]=qs['limit'](_0x13663d[_0x2239('0x3b')]['limit']);_0x4b0ea8[_0x2239('0x29')]=qs[_0x2239('0x29')](_0x13663d['query']['offset']);}_0x4b0ea8['order']=qs[_0x2239('0x42')](_0x13663d['query'][_0x2239('0x42')]);_0x4b0ea8[_0x2239('0x43')]=qs['filters'](_[_0x2239('0x44')](_0x13663d[_0x2239('0x3b')],_0x54bc5b[_0x2239('0x45')]),_0x4f7a1a);if(_0x13663d[_0x2239('0x3b')][_0x2239('0x46')]){_0x4b0ea8[_0x2239('0x43')]=_[_0x2239('0x47')](_0x4b0ea8[_0x2239('0x43')],{'$or':_[_0x2239('0x35')](_0x4f7a1a,function(_0x529f56){if(_0x529f56[_0x2239('0x38')]!=='VIRTUAL'){var _0x37f614={};_0x37f614[_0x529f56['name']]={'$like':'%'+_0x13663d[_0x2239('0x3b')][_0x2239('0x46')]+'%'};return _0x37f614;}})});}_0x4b0ea8=_['merge']({},_0x4b0ea8,_0x13663d[_0x2239('0x48')]);var _0x5ddfca={'where':_0x4b0ea8[_0x2239('0x43')]};return db[_0x2239('0x36')][_0x2239('0x2b')](_0x5ddfca)['then'](function(_0x5f1187){_0x37dcfd['count']=_0x5f1187;if(_0x13663d[_0x2239('0x3b')][_0x2239('0x49')]){_0x4b0ea8[_0x2239('0x4a')]=[{'all':!![]}];}return db[_0x2239('0x36')][_0x2239('0x4b')](_0x4b0ea8);})[_0x2239('0x1c')](function(_0x4f6beb){_0x37dcfd[_0x2239('0x4c')]=_0x4f6beb;return _0x37dcfd;})[_0x2239('0x1c')](respondWithFilteredResult(_0x357c91,_0x4b0ea8))[_0x2239('0x25')](handleError(_0x357c91,null));};exports['show']=function(_0xad617e,_0x55a22c){var _0x4a9c3c={'raw':!![],'where':{'id':_0xad617e[_0x2239('0x4d')]['id']}},_0x410bc6={};_0x410bc6[_0x2239('0x3a')]=_[_0x2239('0x3c')](db[_0x2239('0x36')]['rawAttributes']);_0x410bc6[_0x2239('0x3b')]=_[_0x2239('0x3c')](_0xad617e['query']);_0x410bc6['filters']=_['intersection'](_0x410bc6[_0x2239('0x3a')],_0x410bc6['query']);_0x4a9c3c[_0x2239('0x3e')]=_['intersection'](_0x410bc6[_0x2239('0x3a')],qs[_0x2239('0x3f')](_0xad617e[_0x2239('0x3b')][_0x2239('0x3f')]));_0x4a9c3c['attributes']=_0x4a9c3c['attributes'][_0x2239('0x40')]?_0x4a9c3c[_0x2239('0x3e')]:_0x410bc6[_0x2239('0x3a')];if(_0xad617e[_0x2239('0x3b')][_0x2239('0x49')]){_0x4a9c3c['include']=[{'all':!![]}];}_0x4a9c3c=_[_0x2239('0x47')]({},_0x4a9c3c,_0xad617e[_0x2239('0x48')]);return db[_0x2239('0x36')][_0x2239('0x4e')](_0x4a9c3c)[_0x2239('0x1c')](handleEntityNotFound(_0x55a22c,null))['then'](respondWithResult(_0x55a22c,null))[_0x2239('0x25')](handleError(_0x55a22c,null));};exports[_0x2239('0x4f')]=function(_0x4bf50f,_0x2306ad,_0xe42d3a){var _0x4a1f9e;return db[_0x2239('0x50')][_0x2239('0x51')](function(_0x5741e1){return db[_0x2239('0x36')][_0x2239('0x4f')](_0x4bf50f['body'],{'raw':!![]})[_0x2239('0x1c')](function(_0x26796e){_0x4a1f9e=_0x26796e;return db[_0x2239('0x36')][_0x2239('0x4b')]({'where':{'type':_0x4bf50f[_0x2239('0x52')][_0x2239('0x38')]},'raw':!![]});})[_0x2239('0x1c')](function(_0x1e0730){if(_0x4a1f9e[_0x2239('0x38')][_0x2239('0x53')]()==_0x2239('0x54')){var _0x249a24=fs[_0x2239('0x55')](path[_0x2239('0x56')](config[_0x2239('0x57')],_0x2239('0x58')),'utf8');var _0x476647=ejs['render'](_0x249a24,{'networks':_0x1e0730||[]});fs['writeFileSync'](_0x2239('0x59'),_0x476647);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else if(_0x4a1f9e[_0x2239('0x38')][_0x2239('0x53')]()==_0x2239('0x5a')){var _0x28b967=fs[_0x2239('0x55')](path[_0x2239('0x56')](config[_0x2239('0x57')],_0x2239('0x5b')),'utf8');var _0x45a8e0=ejs['render'](_0x28b967,{'networks':_0x1e0730||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x45a8e0);return respondWithRpcPromise(_0x2239('0x5c'),'create',{'module':_0x2239('0x5d')});}else{var _0x6dcce6=fs[_0x2239('0x55')](path[_0x2239('0x56')](config['root'],'server/files/templates/network.ejs'),_0x2239('0x5e'));var _0x512d14=ejs[_0x2239('0x5f')](_0x6dcce6,{'networks':_0x1e0730||[]});fs[_0x2239('0x60')](util[_0x2239('0x61')]('/etc/asterisk/sip_xcally_%s.conf',_0x4bf50f[_0x2239('0x52')][_0x2239('0x38')][_0x2239('0x62')]()),_0x512d14);return respondWithRpcPromise(_0x2239('0x5c'),'create',{'module':'chan_sip.so'});}return null;})[_0x2239('0x1c')](function(){return _0x4a1f9e;});})[_0x2239('0x1c')](respondWithResult(_0x2306ad,0xc9))[_0x2239('0x25')](handleError(_0x2306ad,null));};exports[_0x2239('0x30')]=function(_0x299175,_0xf0041b,_0x5b9f36){var _0x543485;return db[_0x2239('0x50')]['transaction'](function(_0xf731f9){return db[_0x2239('0x36')][_0x2239('0x4e')]({'where':{'id':_0x299175['params']['id']}})[_0x2239('0x1c')](handleEntityNotFound(_0xf0041b,null))[_0x2239('0x1c')](saveUpdates(_0x299175[_0x2239('0x52')],null))['then'](function(_0x500125){if(_0x500125){_0x543485=_0x500125;return db[_0x2239('0x36')][_0x2239('0x4b')]({'where':{'type':_0x543485['type']},'raw':!![]});}return null;})[_0x2239('0x1c')](function(_0x452467){if(_0x543485[_0x2239('0x38')]['toUpperCase']()==_0x2239('0x54')){var _0x3d7cb9=fs['readFileSync'](path[_0x2239('0x56')](config[_0x2239('0x57')],'server/files/templates/stun_multiple.ejs'),_0x2239('0x5e'));var _0x413130=ejs['render'](_0x3d7cb9,{'networks':_0x452467||[]});fs['writeFileSync'](_0x2239('0x59'),_0x413130);return respondWithRpcPromise(_0x2239('0x5c'),_0x2239('0x30'),{'module':_0x2239('0x5d')});}else if(_0x543485[_0x2239('0x38')][_0x2239('0x53')]()==_0x2239('0x5a')){var _0x3044e0=fs['readFileSync'](path[_0x2239('0x56')](config['root'],_0x2239('0x5b')),_0x2239('0x5e'));var _0x26d85a=ejs[_0x2239('0x5f')](_0x3044e0,{'networks':_0x452467||[]});fs[_0x2239('0x60')](_0x2239('0x63'),_0x26d85a);return respondWithRpcPromise(_0x2239('0x5c'),_0x2239('0x30'),{'module':_0x2239('0x5d')});}else{var _0x4499f2=fs[_0x2239('0x55')](path[_0x2239('0x56')](config['root'],_0x2239('0x64')),'utf8');var _0x5b8ed1=ejs[_0x2239('0x5f')](_0x4499f2,{'networks':_0x452467||[]});fs[_0x2239('0x60')](util[_0x2239('0x61')](_0x2239('0x65'),_0x299175['body'][_0x2239('0x38')][_0x2239('0x62')]()),_0x5b8ed1);return respondWithRpcPromise(_0x2239('0x5c'),'update',{'module':_0x2239('0x66')});}return null;})['then'](function(_0x3e0838){if(_0x3e0838){return _0x543485;}return null;});})['then'](respondWithResult(_0xf0041b,null))[_0x2239('0x25')](handleError(_0xf0041b,null));};exports[_0x2239('0x67')]=function(_0x42d73a,_0x37719f,_0x5f5791){var _0x39cb32;return db[_0x2239('0x36')][_0x2239('0x4e')]({'where':{'id':_0x42d73a[_0x2239('0x4d')]['id']}})[_0x2239('0x1c')](function(_0x31a331){_0x39cb32=_0x31a331;return _0x31a331;})[_0x2239('0x1c')](handleEntityNotFound(_0x37719f,null))[_0x2239('0x1c')](removeEntity(_0x37719f,null))[_0x2239('0x1c')](function(){if(_0x39cb32){return db[_0x2239('0x36')][_0x2239('0x4b')]({'where':{'type':_0x39cb32[_0x2239('0x38')]},'raw':!![]});}})[_0x2239('0x1c')](function(_0x475ac2){if(_0x39cb32[_0x2239('0x38')][_0x2239('0x53')]()==_0x2239('0x54')){var _0x2350da=fs[_0x2239('0x55')](path[_0x2239('0x56')](config[_0x2239('0x57')],_0x2239('0x58')),_0x2239('0x5e'));var _0x3371eb=ejs[_0x2239('0x5f')](_0x2350da,{'networks':_0x475ac2||[]});fs[_0x2239('0x60')](_0x2239('0x59'),_0x3371eb);return respondWithRpcPromise(_0x2239('0x5c'),'destroy',{'module':_0x2239('0x5d')});}else if(_0x39cb32[_0x2239('0x38')][_0x2239('0x53')]()=='TURN'){var _0x2f3b07=fs[_0x2239('0x55')](path[_0x2239('0x56')](config[_0x2239('0x57')],'server/files/templates/turn_multiple.ejs'),_0x2239('0x5e'));var _0x288ed0=ejs['render'](_0x2f3b07,{'networks':_0x475ac2||[]});fs[_0x2239('0x60')](_0x2239('0x63'),_0x288ed0);return respondWithRpcPromise('Reload',_0x2239('0x67'),{'module':_0x2239('0x5d')});}else{var _0x3e19a8=fs[_0x2239('0x55')](path[_0x2239('0x56')](config[_0x2239('0x57')],_0x2239('0x64')),_0x2239('0x5e'));var _0x30311e=ejs[_0x2239('0x5f')](_0x3e19a8,{'networks':_0x475ac2||[]});fs[_0x2239('0x60')](util[_0x2239('0x61')](_0x2239('0x65'),_0x42d73a[_0x2239('0x52')][_0x2239('0x38')][_0x2239('0x62')]()),_0x30311e);return respondWithRpcPromise(_0x2239('0x5c'),_0x2239('0x67'),{'module':_0x2239('0x66')});}return null;})[_0x2239('0x25')](handleError(_0x37719f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8371d38..41c08fb 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 _0x823c=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','exports','Network','network','lodash'];(function(_0xe2314,_0xdbd81){var _0xcbb8f=function(_0xa1f6b1){while(--_0xa1f6b1){_0xe2314['push'](_0xe2314['shift']());}};_0xcbb8f(++_0xdbd81);}(_0x823c,0x143));var _0xc823=function(_0x580589,_0x3a3c81){_0x580589=_0x580589-0x0;var _0x4654be=_0x823c[_0x580589];return _0x4654be;};'use strict';var _=require(_0xc823('0x0'));var util=require('util');var logger=require(_0xc823('0x1'))(_0xc823('0x2'));var moment=require(_0xc823('0x3'));var BPromise=require(_0xc823('0x4'));var rp=require(_0xc823('0x5'));var fs=require('fs');var path=require(_0xc823('0x6'));var rimraf=require('rimraf');var config=require(_0xc823('0x7'));var attributes=require(_0xc823('0x8'));module[_0xc823('0x9')]=function(_0x42e0c0,_0x380607){return _0x42e0c0['define'](_0xc823('0xa'),attributes,{'tableName':_0xc823('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf45e=['exports','define','Network','network','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xf45e,0x115));var _0xef45=function(_0x2c8113,_0x46dc97){_0x2c8113=_0x2c8113-0x0;var _0x1013f7=_0xf45e[_0x2c8113];return _0x1013f7;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var logger=require(_0xef45('0x1'))('api');var moment=require(_0xef45('0x2'));var BPromise=require(_0xef45('0x3'));var rp=require(_0xef45('0x4'));var fs=require('fs');var path=require(_0xef45('0x5'));var rimraf=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var attributes=require(_0xef45('0x8'));module[_0xef45('0x9')]=function(_0x338960,_0x315b84){return _0x338960[_0xef45('0xa')](_0xef45('0xb'),attributes,{'tableName':_0xef45('0xc'),'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 a022fcc..e3241be 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x39ecb7,_0x5e9df5){_0x39ecb7=_0x39ecb7-0x0;var _0x10ba0a=_0x7a54[_0x39ecb7];return _0x10ba0a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2f139e,_0x53d944){var _0xe5ff30=function(_0xbeac72){while(--_0xbeac72){_0x2f139e['push'](_0x2f139e['shift']());}};_0xe5ff30(++_0x53d944);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 72a39c9..86d84a6 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 _0xd3bc=['removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','/:id/users','/:id/send','send','put','/:id','update','delete'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0xd3bc,0x175));var _0xcd3b=function(_0x5d26e8,_0x3c6672){_0x5d26e8=_0x5d26e8-0x0;var _0x293a91=_0xd3bc[_0x5d26e8];return _0x293a91;};'use strict';var multer=require(_0xcd3b('0x0'));var util=require(_0xcd3b('0x1'));var path=require('path');var timeout=require(_0xcd3b('0x2'));var express=require(_0xcd3b('0x3'));var router=express[_0xcd3b('0x4')]();var fs_extra=require(_0xcd3b('0x5'));var auth=require(_0xcd3b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd3b('0x7'));var controller=require(_0xcd3b('0x8'));router[_0xcd3b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd3b('0x9')](_0xcd3b('0xa'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcd3b('0xd')]);router[_0xcd3b('0x9')](_0xcd3b('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xcd3b('0x9')](_0xcd3b('0xf'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x10')]);router[_0xcd3b('0x9')](_0xcd3b('0x11'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0xcd3b('0x12'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x13')]);router[_0xcd3b('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xcd3b('0x14')]);router[_0xcd3b('0x15')]('/',auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x16')]);router[_0xcd3b('0x15')](_0xcd3b('0xe'),auth[_0xcd3b('0xb')](),controller['addDisposition']);router[_0xcd3b('0x15')]('/:id/canned_answers',auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x17')]);router[_0xcd3b('0x15')](_0xcd3b('0x18'),controller[_0xcd3b('0x19')]);router[_0xcd3b('0x15')](_0xcd3b('0x11'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x1a')]);router[_0xcd3b('0x15')](_0xcd3b('0x1b'),auth[_0xcd3b('0xb')](),controller['addAgents']);router['post'](_0xcd3b('0x1c'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x1d')]);router[_0xcd3b('0x1e')](_0xcd3b('0x1f'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x20')]);router[_0xcd3b('0x21')](_0xcd3b('0x1f'),auth[_0xcd3b('0xb')](),controller['destroy']);router[_0xcd3b('0x21')](_0xcd3b('0xe'),auth[_0xcd3b('0xb')](),controller['removeDispositions']);router[_0xcd3b('0x21')](_0xcd3b('0xf'),auth['isAuthenticated'](),controller[_0xcd3b('0x22')]);router['delete'](_0xcd3b('0x1b'),auth[_0xcd3b('0xb')](),controller[_0xcd3b('0x23')]);module[_0xcd3b('0x24')]=router; \ No newline at end of file +var _0x332c=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/users','send','update','delete','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0xbfb71b,_0x121bc2){var _0x12d390=function(_0x104c81){while(--_0x104c81){_0xbfb71b['push'](_0xbfb71b['shift']());}};_0x12d390(++_0x121bc2);}(_0x332c,0x17c));var _0xc332=function(_0x1c6a90,_0x65a557){_0x1c6a90=_0x1c6a90-0x0;var _0x29b97d=_0x332c[_0x1c6a90];return _0x29b97d;};'use strict';var multer=require(_0xc332('0x0'));var util=require(_0xc332('0x1'));var path=require('path');var timeout=require(_0xc332('0x2'));var express=require(_0xc332('0x3'));var router=express[_0xc332('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc332('0x5'));var interaction=require(_0xc332('0x6'));var config=require(_0xc332('0x7'));var controller=require(_0xc332('0x8'));router[_0xc332('0x9')]('/',auth['isAuthenticated'](),controller[_0xc332('0xa')]);router['get'](_0xc332('0xb'),auth[_0xc332('0xc')](),controller[_0xc332('0xd')]);router[_0xc332('0x9')](_0xc332('0xe'),auth[_0xc332('0xc')](),controller['show']);router[_0xc332('0x9')](_0xc332('0xf'),auth[_0xc332('0xc')](),controller[_0xc332('0x10')]);router[_0xc332('0x9')](_0xc332('0x11'),auth[_0xc332('0xc')](),controller[_0xc332('0x12')]);router[_0xc332('0x9')](_0xc332('0x13'),auth['isAuthenticated'](),controller[_0xc332('0x14')]);router[_0xc332('0x9')](_0xc332('0x15'),auth['isAuthenticated'](),controller[_0xc332('0x16')]);router['get']('/:id/users',auth[_0xc332('0xc')](),controller[_0xc332('0x17')]);router[_0xc332('0x18')]('/',auth[_0xc332('0xc')](),controller[_0xc332('0x19')]);router[_0xc332('0x18')](_0xc332('0xf'),auth[_0xc332('0xc')](),controller[_0xc332('0x1a')]);router[_0xc332('0x18')](_0xc332('0x11'),auth[_0xc332('0xc')](),controller[_0xc332('0x1b')]);router[_0xc332('0x18')](_0xc332('0x1c'),controller[_0xc332('0x1d')]);router[_0xc332('0x18')]('/:id/applications',auth[_0xc332('0xc')](),controller['addApplications']);router[_0xc332('0x18')](_0xc332('0x1e'),auth[_0xc332('0xc')](),controller['addAgents']);router['post']('/:id/send',auth[_0xc332('0xc')](),controller[_0xc332('0x1f')]);router['put'](_0xc332('0xe'),auth[_0xc332('0xc')](),controller[_0xc332('0x20')]);router[_0xc332('0x21')]('/:id',auth[_0xc332('0xc')](),controller['destroy']);router[_0xc332('0x21')](_0xc332('0xf'),auth[_0xc332('0xc')](),controller[_0xc332('0x22')]);router[_0xc332('0x21')](_0xc332('0x11'),auth[_0xc332('0xc')](),controller[_0xc332('0x23')]);router[_0xc332('0x21')](_0xc332('0x1e'),auth['isAuthenticated'](),controller[_0xc332('0x24')]);module[_0xc332('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 772bae0..d1057a1 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 _0x86b6=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x510c44,_0x30ec2e){var _0x32342b=function(_0x5f00e6){while(--_0x5f00e6){_0x510c44['push'](_0x510c44['shift']());}};_0x32342b(++_0x30ec2e);}(_0x86b6,0x18d));var _0x686b=function(_0x5e1855,_0x17161e){_0x5e1855=_0x5e1855-0x0;var _0x4faf68=_0x86b6[_0x5e1855];return _0x4faf68;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x686b('0x0'));module[_0x686b('0x1')]={'name':{'type':Sequelize[_0x686b('0x2')],'unique':_0x686b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x686b('0x2')],'defaultValue':function(){return rs[_0x686b('0x4')]();}},'replyUri':{'type':Sequelize[_0x686b('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x686b('0x5')],'defaultValue':function(){return _0x686b('0x6');}},'notificationSound':{'type':Sequelize[_0x686b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x686b('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x686b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x686b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x686b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x686b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x686b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x686b('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x686b('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x686b('0x7')],'defaultValue':![],'comment':_0x686b('0xa'),'set':function(_0x473976){if(!_0x473976)this[_0x686b('0xb')](_0x686b('0xc'),null);this[_0x686b('0xb')](_0x686b('0xd'),_0x473976);}}}; \ No newline at end of file +var _0xfdac=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xa2d65d,_0x416fcc){var _0x3efeb6=function(_0x10e491){while(--_0x10e491){_0xa2d65d['push'](_0xa2d65d['shift']());}};_0x3efeb6(++_0x416fcc);}(_0xfdac,0x68));var _0xcfda=function(_0x5a90fc,_0x410575){_0x5a90fc=_0x5a90fc-0x0;var _0x441c21=_0xfdac[_0x5a90fc];return _0x441c21;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xcfda('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcfda('0x0')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcfda('0x1')]();}},'replyUri':{'type':Sequelize[_0xcfda('0x0')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcfda('0x2')],'defaultValue':function(){return _0xcfda('0x3');}},'notificationSound':{'type':Sequelize[_0xcfda('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcfda('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcfda('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcfda('0x0')]},'queueTransfer':{'type':Sequelize[_0xcfda('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcfda('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcfda('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcfda('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xcfda('0x6')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3a1d08){if(!_0x3a1d08)this['setDataValue'](_0xcfda('0x7'),null);this['setDataValue'](_0xcfda('0x8'),_0x3a1d08);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index dc6e955..92c2d21 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 _0x5572=['openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','spread','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','update','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5572,0x1c1));var _0x2557=function(_0xe891c3,_0xf623a0){_0xe891c3=_0xe891c3-0x0;var _0x2c441f=_0x5572[_0xe891c3];return _0x2c441f;};'use strict';var emlformat=require(_0x2557('0x0'));var rimraf=require(_0x2557('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2557('0x2'));var rp=require(_0x2557('0x3'));var moment=require(_0x2557('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2557('0x5'));var util=require(_0x2557('0x6'));var path=require(_0x2557('0x7'));var sox=require(_0x2557('0x8'));var csv=require('to-csv');var ejs=require(_0x2557('0x9'));var fs=require('fs');var fs_extra=require(_0x2557('0xa'));var _=require(_0x2557('0xb'));var squel=require(_0x2557('0xc'));var crypto=require(_0x2557('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2557('0xe'));var toCsv=require(_0x2557('0xf'));var querystring=require(_0x2557('0x10'));var Papa=require(_0x2557('0x11'));var Redis=require(_0x2557('0x12'));var authService=require(_0x2557('0x13'));var qs=require(_0x2557('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2557('0x15'));var logger=require(_0x2557('0x16'))(_0x2557('0x17'));var utils=require(_0x2557('0x18'));var config=require(_0x2557('0x19'));var licenseUtil=require(_0x2557('0x1a'));var db=require('../../mysqldb')['db'];config[_0x2557('0x1b')]=_['defaults'](config[_0x2557('0x1b')],{'host':_0x2557('0x1c'),'port':0x18eb});var socket=require(_0x2557('0x1d'))(new Redis(config[_0x2557('0x1b')]));require('./openchannelAccount.socket')[_0x2557('0x1e')](socket);var jayson=require(_0x2557('0x1f'));var client=jayson[_0x2557('0x20')][_0x2557('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24fc05,_0x3ea3f2,_0x46d080,_0x1000bf){return new BPromise(function(_0x2f6080,_0x18b10e){var _0x2b8234=_0x1000bf||client;return _0x2b8234[_0x2557('0x22')](_0x24fc05,_0x46d080)['then'](function(_0x17826a){logger[_0x2557('0x23')](_0x2557('0x24'),_0x3ea3f2,_0x2557('0x25'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3ea3f2,_0x2557('0x25'),JSON[_0x2557('0x26')](_0x17826a));if(_0x17826a[_0x2557('0x27')]){if(_0x17826a[_0x2557('0x27')][_0x2557('0x28')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3ea3f2,_0x17826a[_0x2557('0x27')][_0x2557('0x29')]);return _0x18b10e(_0x17826a['error'][_0x2557('0x29')]);}logger['error'](_0x2557('0x24'),_0x3ea3f2,_0x17826a['error'][_0x2557('0x29')]);return _0x2f6080(_0x17826a['error'][_0x2557('0x29')]);}else{logger[_0x2557('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x3ea3f2,_0x2557('0x25'));_0x2f6080(_0x17826a[_0x2557('0x2a')][_0x2557('0x29')]);}})[_0x2557('0x2b')](function(_0x476119){logger['error'](_0x2557('0x24'),_0x3ea3f2,_0x476119);_0x18b10e(_0x476119);});});}function respondWithStatusCode(_0x4430a7,_0x37e3ee){_0x37e3ee=_0x37e3ee||0xcc;return function(_0x5336eb){if(_0x5336eb){return _0x4430a7[_0x2557('0x2c')](_0x37e3ee);}return _0x4430a7[_0x2557('0x2d')](_0x37e3ee)[_0x2557('0x2e')]();};}function respondWithResult(_0x34bbf0,_0x377efb){_0x377efb=_0x377efb||0xc8;return function(_0x1ad76d){if(_0x1ad76d){return _0x34bbf0['status'](_0x377efb)[_0x2557('0x2f')](_0x1ad76d);}};}function respondWithFilteredResult(_0x439aa5,_0x41130f){return function(_0x19e063){if(_0x19e063){var _0x580295=typeof _0x41130f[_0x2557('0x30')]===_0x2557('0x31')&&typeof _0x41130f[_0x2557('0x32')]==='undefined';var _0x191d18=_0x19e063['count'];var _0x49f6b8=_0x580295?0x0:_0x41130f[_0x2557('0x30')];var _0x3d0ce0=_0x580295?_0x19e063[_0x2557('0x33')]:_0x41130f[_0x2557('0x30')]+_0x41130f[_0x2557('0x32')];var _0x4bd254;if(_0x3d0ce0>=_0x191d18){_0x3d0ce0=_0x191d18;_0x4bd254=0xc8;}else{_0x4bd254=0xce;}_0x439aa5[_0x2557('0x2d')](_0x4bd254);return _0x439aa5[_0x2557('0x34')]('Content-Range',_0x49f6b8+'-'+_0x3d0ce0+'/'+_0x191d18)['json'](_0x19e063);}return null;};}function patchUpdates(_0x3bb9dc){return function(_0x3ca243){try{jsonpatch[_0x2557('0x35')](_0x3ca243,_0x3bb9dc,!![]);}catch(_0x1d62e4){return BPromise[_0x2557('0x36')](_0x1d62e4);}return _0x3ca243['save']();};}function saveUpdates(_0x2b9f49,_0x215405){return function(_0x3f0673){if(_0x3f0673){return _0x3f0673['update'](_0x2b9f49)[_0x2557('0x37')](function(_0xb49fc8){return _0xb49fc8;});}return null;};}function removeEntity(_0x3de921,_0x23aa46){return function(_0x57a8ab){if(_0x57a8ab){return _0x57a8ab[_0x2557('0x38')]()[_0x2557('0x37')](function(){var _0x2261cf=_0x57a8ab[_0x2557('0x39')]({'plain':!![]});var _0x395a83=_0x2557('0x3a');return db['UserProfileResource'][_0x2557('0x38')]({'where':{'type':_0x395a83,'resourceId':_0x2261cf['id']}})[_0x2557('0x37')](function(){return _0x57a8ab;});})[_0x2557('0x37')](function(){_0x3de921[_0x2557('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d16bc,_0x2016ba){return function(_0x388086){if(!_0x388086){_0x2d16bc[_0x2557('0x2c')](0x194);}return _0x388086;};}function handleError(_0x4549e6,_0x576261){_0x576261=_0x576261||0x1f4;return function(_0x1feff7){logger['error'](_0x1feff7[_0x2557('0x3b')]);if(_0x1feff7[_0x2557('0x3c')]){delete _0x1feff7[_0x2557('0x3c')];}_0x4549e6['status'](_0x576261)[_0x2557('0x3d')](_0x1feff7);};}exports[_0x2557('0x3e')]=function(_0x3ec7d4,_0x17dd8d){var _0x57784c={'include':[{'model':db[_0x2557('0x3f')],'as':_0x2557('0x40')}]},_0x4053b8={},_0x439861={'count':0x0,'rows':[]};var _0x54c2db=_[_0x2557('0x41')](db[_0x2557('0x42')][_0x2557('0x43')],function(_0x3f5431){return{'name':_0x3f5431[_0x2557('0x44')],'type':_0x3f5431['type'][_0x2557('0x45')]};});_0x4053b8[_0x2557('0x46')]=_[_0x2557('0x41')](_0x54c2db,'name');_0x4053b8['query']=_['keys'](_0x3ec7d4[_0x2557('0x47')]);_0x4053b8['filters']=_[_0x2557('0x48')](_0x4053b8[_0x2557('0x46')],_0x4053b8[_0x2557('0x47')]);_0x57784c[_0x2557('0x49')]=_[_0x2557('0x48')](_0x4053b8['model'],qs[_0x2557('0x4a')](_0x3ec7d4['query']['fields']));_0x57784c[_0x2557('0x49')]=_0x57784c[_0x2557('0x49')]['length']?_0x57784c['attributes']:_0x4053b8['model'];if(!_0x3ec7d4[_0x2557('0x47')][_0x2557('0x4b')](_0x2557('0x4c'))){_0x57784c['limit']=qs[_0x2557('0x32')](_0x3ec7d4['query'][_0x2557('0x32')]);_0x57784c[_0x2557('0x30')]=qs['offset'](_0x3ec7d4[_0x2557('0x47')][_0x2557('0x30')]);}_0x57784c[_0x2557('0x4d')]=qs['sort'](_0x3ec7d4['query'][_0x2557('0x4e')]);_0x57784c[_0x2557('0x4f')]=qs[_0x2557('0x50')](_[_0x2557('0x51')](_0x3ec7d4[_0x2557('0x47')],_0x4053b8['filters']),_0x54c2db);if(_0x3ec7d4[_0x2557('0x47')][_0x2557('0x52')]){_0x57784c[_0x2557('0x4f')]=_[_0x2557('0x53')](_0x57784c[_0x2557('0x4f')],{'$or':_[_0x2557('0x41')](_0x54c2db,function(_0x3c889e){if(_0x3c889e[_0x2557('0x54')]!==_0x2557('0x55')){var _0x1cf89d={};_0x1cf89d[_0x3c889e[_0x2557('0x3c')]]={'$like':'%'+_0x3ec7d4['query'][_0x2557('0x52')]+'%'};return _0x1cf89d;}})});}_0x57784c=_[_0x2557('0x53')]({},_0x57784c,_0x3ec7d4[_0x2557('0x56')]);var _0x4cb3c3={'where':_0x57784c[_0x2557('0x4f')]};return db[_0x2557('0x42')][_0x2557('0x33')](_0x4cb3c3)[_0x2557('0x37')](function(_0x5c7a25){_0x439861[_0x2557('0x33')]=_0x5c7a25;if(_0x3ec7d4[_0x2557('0x47')][_0x2557('0x57')]){_0x57784c[_0x2557('0x58')]=[{'all':!![]}];}return db[_0x2557('0x42')][_0x2557('0x59')](_0x57784c);})['then'](function(_0x127d64){_0x439861[_0x2557('0x5a')]=_0x127d64;return _0x439861;})[_0x2557('0x37')](respondWithFilteredResult(_0x17dd8d,_0x57784c))['catch'](handleError(_0x17dd8d,null));};exports['show']=function(_0x2b6432,_0x22b668){var _0x1a2adc={'raw':![],'where':{'id':_0x2b6432[_0x2557('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x2557('0x40')}]},_0x534fc1={};_0x534fc1[_0x2557('0x46')]=_[_0x2557('0x5c')](db[_0x2557('0x42')][_0x2557('0x43')]);_0x534fc1['query']=_[_0x2557('0x5c')](_0x2b6432[_0x2557('0x47')]);_0x534fc1[_0x2557('0x50')]=_[_0x2557('0x48')](_0x534fc1[_0x2557('0x46')],_0x534fc1[_0x2557('0x47')]);_0x1a2adc[_0x2557('0x49')]=_[_0x2557('0x48')](_0x534fc1[_0x2557('0x46')],qs[_0x2557('0x4a')](_0x2b6432[_0x2557('0x47')]['fields']));_0x1a2adc[_0x2557('0x49')]=_0x1a2adc[_0x2557('0x49')][_0x2557('0x5d')]?_0x1a2adc['attributes']:_0x534fc1[_0x2557('0x46')];if(_0x2b6432[_0x2557('0x47')][_0x2557('0x57')]){_0x1a2adc[_0x2557('0x58')]=[{'all':!![]}];}_0x1a2adc=_[_0x2557('0x53')]({},_0x1a2adc,_0x2b6432[_0x2557('0x56')]);return db['OpenchannelAccount'][_0x2557('0x5e')](_0x1a2adc)[_0x2557('0x37')](handleEntityNotFound(_0x22b668,null))[_0x2557('0x37')](respondWithResult(_0x22b668,null))['catch'](handleError(_0x22b668,null));};exports[_0x2557('0x5f')]=function(_0x359731,_0x430e19){return db[_0x2557('0x42')][_0x2557('0x5f')](_0x359731[_0x2557('0x60')],{})[_0x2557('0x37')](function(_0x1a9380){var _0x2e33aa=_0x359731[_0x2557('0x61')][_0x2557('0x39')]({'plain':!![]});if(!_0x2e33aa)throw new Error(_0x2557('0x62'));if(_0x2e33aa['role']==='user'){var _0x4dbd52=_0x1a9380[_0x2557('0x39')]({'plain':!![]});var _0x1e4630=_0x2557('0x3a');return db[_0x2557('0x63')][_0x2557('0x5e')]({'where':{'name':_0x1e4630,'userProfileId':_0x2e33aa[_0x2557('0x64')]},'raw':!![]})['then'](function(_0x54015a){if(_0x54015a&&_0x54015a['autoAssociation']===0x0){return db[_0x2557('0x65')][_0x2557('0x5f')]({'name':_0x4dbd52[_0x2557('0x3c')],'resourceId':_0x4dbd52['id'],'type':_0x54015a[_0x2557('0x3c')],'sectionId':_0x54015a['id']},{})['then'](function(){return _0x1a9380;});}else{return _0x1a9380;}})[_0x2557('0x2b')](function(_0x241dcc){logger[_0x2557('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x241dcc);throw _0x241dcc;});}return _0x1a9380;})['then'](respondWithResult(_0x430e19,0xc9))['catch'](handleError(_0x430e19,null));};exports[_0x2557('0x66')]=function(_0xe8104e,_0x435a7e){if(_0xe8104e['body']['id']){delete _0xe8104e[_0x2557('0x60')]['id'];}return db[_0x2557('0x42')][_0x2557('0x5e')]({'where':{'id':_0xe8104e[_0x2557('0x5b')]['id']},'include':[{'model':db[_0x2557('0x3f')],'as':_0x2557('0x40')}]})[_0x2557('0x37')](handleEntityNotFound(_0x435a7e,null))[_0x2557('0x37')](saveUpdates(_0xe8104e[_0x2557('0x60')],null))[_0x2557('0x37')](respondWithResult(_0x435a7e,null))[_0x2557('0x2b')](handleError(_0x435a7e,null));};exports[_0x2557('0x38')]=function(_0x43e926,_0x2d47f1){return db[_0x2557('0x42')]['find']({'where':{'id':_0x43e926[_0x2557('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2d47f1,null))['then'](removeEntity(_0x2d47f1,null))[_0x2557('0x2b')](handleError(_0x2d47f1,null));};exports['describe']=function(_0x3d1e4a,_0x11fbeb){return db[_0x2557('0x42')][_0x2557('0x67')]()[_0x2557('0x37')](respondWithResult(_0x11fbeb,null))['catch'](handleError(_0x11fbeb,null));};exports['addDisposition']=function(_0xf8458c,_0x1e0e8f,_0x4b5f00){if(_0xf8458c[_0x2557('0x60')]['id']){delete _0xf8458c[_0x2557('0x60')]['id'];}return db[_0x2557('0x42')][_0x2557('0x5e')]({'where':{'id':_0xf8458c[_0x2557('0x5b')]['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x1e0e8f,null))['then'](function(_0xbe2966){if(_0xbe2966){_0xf8458c[_0x2557('0x60')][_0x2557('0x68')]=_0xbe2966['id'];return db[_0x2557('0x69')][_0x2557('0x5f')](_0xf8458c[_0x2557('0x60')]);}})[_0x2557('0x37')](respondWithResult(_0x1e0e8f,null))[_0x2557('0x2b')](handleError(_0x1e0e8f,null));};exports[_0x2557('0x6a')]=function(_0x416cfc,_0x2c87c7,_0x2bce5a){var _0x5a8bbd={'raw':![],'where':{}};var _0x11f7ec={};var _0x10bd0c={'count':0x0,'rows':[]};return db[_0x2557('0x42')][_0x2557('0x6b')]({'where':{'id':_0x416cfc['params']['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x2c87c7,null))[_0x2557('0x37')](function(_0x3d9e3e){if(_0x3d9e3e){_0x11f7ec['model']=_[_0x2557('0x5c')](db[_0x2557('0x69')][_0x2557('0x43')]);_0x11f7ec[_0x2557('0x47')]=_[_0x2557('0x5c')](_0x416cfc[_0x2557('0x47')]);_0x11f7ec[_0x2557('0x50')]=_[_0x2557('0x48')](_0x11f7ec[_0x2557('0x46')],_0x11f7ec[_0x2557('0x47')]);_0x5a8bbd[_0x2557('0x49')]=_['intersection'](_0x11f7ec[_0x2557('0x46')],qs[_0x2557('0x4a')](_0x416cfc['query'][_0x2557('0x4a')]));_0x5a8bbd[_0x2557('0x49')]=_0x5a8bbd[_0x2557('0x49')][_0x2557('0x5d')]?_0x5a8bbd[_0x2557('0x49')]:_0x11f7ec[_0x2557('0x46')];if(!_0x416cfc[_0x2557('0x47')][_0x2557('0x4b')](_0x2557('0x4c'))){_0x5a8bbd['limit']=qs['limit'](_0x416cfc[_0x2557('0x47')]['limit']);_0x5a8bbd[_0x2557('0x30')]=qs[_0x2557('0x30')](_0x416cfc['query'][_0x2557('0x30')]);}_0x5a8bbd[_0x2557('0x4d')]=qs['sort'](_0x416cfc[_0x2557('0x47')]['sort']);_0x5a8bbd['where']=qs['filters'](_[_0x2557('0x51')](_0x416cfc[_0x2557('0x47')],_0x11f7ec[_0x2557('0x50')]));_0x5a8bbd[_0x2557('0x4f')][_0x2557('0x68')]=_0x3d9e3e['id'];if(_0x416cfc['query'][_0x2557('0x52')]){_0x5a8bbd['where']=_[_0x2557('0x53')](_0x5a8bbd[_0x2557('0x4f')],{'$or':_[_0x2557('0x41')](_0x5a8bbd[_0x2557('0x49')],function(_0x17c8ee){var _0x302ccd={};_0x302ccd[_0x17c8ee]={'$like':'%'+_0x416cfc[_0x2557('0x47')][_0x2557('0x52')]+'%'};return _0x302ccd;})});}_0x5a8bbd=_[_0x2557('0x53')]({},_0x5a8bbd,_0x416cfc[_0x2557('0x56')]);return db[_0x2557('0x69')][_0x2557('0x33')]({'where':_0x5a8bbd[_0x2557('0x4f')]})['then'](function(_0x1ce5db){_0x10bd0c['count']=_0x1ce5db;if(_0x416cfc['query'][_0x2557('0x57')]){_0x5a8bbd[_0x2557('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5a8bbd);})['then'](function(_0x50b1a7){_0x10bd0c[_0x2557('0x5a')]=_0x50b1a7;return _0x10bd0c;});}})[_0x2557('0x37')](respondWithFilteredResult(_0x2c87c7,_0x5a8bbd))[_0x2557('0x2b')](handleError(_0x2c87c7,null));};exports[_0x2557('0x6c')]=function(_0x182a96,_0xf92753,_0x51e4c4){return db[_0x2557('0x42')][_0x2557('0x5e')]({'where':{'id':_0x182a96['params']['id']}})[_0x2557('0x37')](handleEntityNotFound(_0xf92753,null))[_0x2557('0x37')](function(_0x28a8cd){if(_0x28a8cd){return _0x28a8cd[_0x2557('0x6c')](_0x182a96[_0x2557('0x47')][_0x2557('0x6d')]);}})[_0x2557('0x37')](respondWithStatusCode(_0xf92753,null))[_0x2557('0x2b')](handleError(_0xf92753,null));};exports[_0x2557('0x6e')]=function(_0x3c1aa7,_0x593018,_0x402ca3){if(_0x3c1aa7[_0x2557('0x60')]['id']){delete _0x3c1aa7[_0x2557('0x60')]['id'];}return db[_0x2557('0x42')][_0x2557('0x5e')]({'where':{'id':_0x3c1aa7[_0x2557('0x5b')]['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x593018,null))[_0x2557('0x37')](function(_0x13439b){if(_0x13439b){_0x3c1aa7[_0x2557('0x60')][_0x2557('0x68')]=_0x13439b['id'];return db[_0x2557('0x6f')]['create'](_0x3c1aa7['body']);}})[_0x2557('0x37')](respondWithResult(_0x593018,null))['catch'](handleError(_0x593018,null));};exports[_0x2557('0x70')]=function(_0x157519,_0x29c6ba,_0xf9512d){var _0x1da92f={'raw':![],'where':{}};var _0x5dd67a={};var _0x3b6099={'count':0x0,'rows':[]};return db[_0x2557('0x42')][_0x2557('0x6b')]({'where':{'id':_0x157519[_0x2557('0x5b')]['id']}})['then'](handleEntityNotFound(_0x29c6ba,null))[_0x2557('0x37')](function(_0x4d088e){if(_0x4d088e){_0x5dd67a[_0x2557('0x46')]=_[_0x2557('0x5c')](db[_0x2557('0x6f')][_0x2557('0x43')]);_0x5dd67a[_0x2557('0x47')]=_[_0x2557('0x5c')](_0x157519[_0x2557('0x47')]);_0x5dd67a[_0x2557('0x50')]=_[_0x2557('0x48')](_0x5dd67a[_0x2557('0x46')],_0x5dd67a[_0x2557('0x47')]);_0x1da92f[_0x2557('0x49')]=_['intersection'](_0x5dd67a['model'],qs[_0x2557('0x4a')](_0x157519['query'][_0x2557('0x4a')]));_0x1da92f[_0x2557('0x49')]=_0x1da92f['attributes']['length']?_0x1da92f[_0x2557('0x49')]:_0x5dd67a[_0x2557('0x46')];if(!_0x157519[_0x2557('0x47')][_0x2557('0x4b')](_0x2557('0x4c'))){_0x1da92f['limit']=qs['limit'](_0x157519['query'][_0x2557('0x32')]);_0x1da92f[_0x2557('0x30')]=qs[_0x2557('0x30')](_0x157519[_0x2557('0x47')][_0x2557('0x30')]);}_0x1da92f[_0x2557('0x4d')]=qs[_0x2557('0x4e')](_0x157519['query'][_0x2557('0x4e')]);_0x1da92f[_0x2557('0x4f')]=qs[_0x2557('0x50')](_['pick'](_0x157519[_0x2557('0x47')],_0x5dd67a[_0x2557('0x50')]));_0x1da92f['where'][_0x2557('0x68')]=_0x4d088e['id'];if(_0x157519[_0x2557('0x47')]['filter']){_0x1da92f[_0x2557('0x4f')]=_[_0x2557('0x53')](_0x1da92f[_0x2557('0x4f')],{'$or':_['map'](_0x1da92f[_0x2557('0x49')],function(_0x4dfb9c){var _0xce581={};_0xce581[_0x4dfb9c]={'$like':'%'+_0x157519[_0x2557('0x47')][_0x2557('0x52')]+'%'};return _0xce581;})});}_0x1da92f=_[_0x2557('0x53')]({},_0x1da92f,_0x157519[_0x2557('0x56')]);return db['CannedAnswer'][_0x2557('0x33')]({'where':_0x1da92f['where']})['then'](function(_0x512e32){_0x3b6099[_0x2557('0x33')]=_0x512e32;if(_0x157519['query'][_0x2557('0x57')]){_0x1da92f[_0x2557('0x58')]=[{'all':!![]}];}return db[_0x2557('0x6f')][_0x2557('0x59')](_0x1da92f);})[_0x2557('0x37')](function(_0x35a1db){_0x3b6099['rows']=_0x35a1db;return _0x3b6099;});}})[_0x2557('0x37')](respondWithFilteredResult(_0x29c6ba,_0x1da92f))[_0x2557('0x2b')](handleError(_0x29c6ba,null));};exports[_0x2557('0x71')]=function(_0x41f308,_0x1befc7,_0x2ac350){return db[_0x2557('0x42')]['find']({'where':{'id':_0x41f308[_0x2557('0x5b')]['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x1befc7,null))[_0x2557('0x37')](function(_0xde6915){if(_0xde6915){return _0xde6915[_0x2557('0x71')](_0x41f308[_0x2557('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x1befc7,null))['catch'](handleError(_0x1befc7,null));};exports[_0x2557('0x72')]=function(_0x35fb0f,_0x45a236,_0x3fd085){var _0x165ea7={'body':_0x35fb0f[_0x2557('0x60')],'channel':_0x2557('0x73')};var _0x2a327e=[];var _0x4fae67=[];var _0x266b60={};var _0x1084fd=![];return db[_0x2557('0x74')][_0x2557('0x67')]()[_0x2557('0x37')](function(_0x40f0ca){if(!_0x40f0ca){throw new db[(_0x2557('0x75'))][(_0x2557('0x76'))]('no\x20available\x20attributes');}_0x2a327e=_[_0x2557('0x77')](_[_0x2557('0x5c')](_0x40f0ca),[_0x2557('0x78'),_0x2557('0x79')]);_0x4fae67=_[_0x2557('0x77')](_[_0x2557('0x5c')](_0x40f0ca),['createdAt',_0x2557('0x79'),_0x2557('0x7a'),_0x2557('0x7b')]);if(_0x35fb0f[_0x2557('0x60')]['id']){delete _0x35fb0f['body']['id'];}if(_[_0x2557('0x7c')](_0x35fb0f[_0x2557('0x60')]['from'])){throw new db[(_0x2557('0x75'))]['ValidationError'](_0x2557('0x7d'));}if(_[_0x2557('0x7c')](_0x35fb0f['body'][_0x2557('0x60')])||_0x35fb0f[_0x2557('0x60')][_0x2557('0x60')]===''){throw new db[(_0x2557('0x75'))][(_0x2557('0x76'))](_0x2557('0x7e'));}if(_[_0x2557('0x7c')](_0x35fb0f[_0x2557('0x60')][_0x2557('0x7f')])){throw new db[(_0x2557('0x75'))]['ValidationError'](_0x2557('0x80')+_0x4fae67);}if(!_['includes'](_0x4fae67,_0x35fb0f[_0x2557('0x60')][_0x2557('0x7f')])){throw new db[(_0x2557('0x75'))][(_0x2557('0x76'))](_0x2557('0x81')+_0x4fae67);}_0x266b60[_0x35fb0f[_0x2557('0x60')][_0x2557('0x7f')]]=_0x35fb0f[_0x2557('0x60')][_0x2557('0x82')];})['then'](function(){return db[_0x2557('0x42')]['find']({'where':{'id':_0x35fb0f[_0x2557('0x5b')]['id']},'include':[{'model':db[_0x2557('0x83')],'as':_0x2557('0x84'),'include':[{'model':db[_0x2557('0x74')],'as':_0x2557('0x85'),'where':_0x266b60,'limit':0x1,'order':[[_0x2557('0x79'),_0x2557('0x86')]]}]},{'model':db[_0x2557('0x87')],'as':_0x2557('0x88')}]});})[_0x2557('0x37')](handleEntityNotFound(_0x45a236,null))[_0x2557('0x37')](function(_0x142312){if(_0x142312&&_0x142312['List']){_0x165ea7[_0x2557('0x89')]=_0x142312;_0x165ea7[_0x2557('0x8a')]=_0x142312['Applications'];_0x165ea7['list']=_0x142312[_0x2557('0x84')];_0x165ea7[_0x2557('0x8a')]=_[_0x2557('0x8b')](_0x165ea7['applications'],[_0x2557('0x8c')],[_0x2557('0x8d')]);if(_0x165ea7['account'][_0x2557('0x88')]){delete _0x165ea7[_0x2557('0x89')][_0x2557('0x88')];}if(_0x165ea7['account'][_0x2557('0x84')]&&_0x165ea7[_0x2557('0x89')][_0x2557('0x84')]['Contacts']['length']){return _0x165ea7[_0x2557('0x89')][_0x2557('0x84')][_0x2557('0x85')][0x0];}var _0x197dd5=_[_0x2557('0x8e')](_0x35fb0f[_0x2557('0x60')],{'firstName':_0x35fb0f[_0x2557('0x60')][_0x2557('0x82')],'ListId':_0x142312[_0x2557('0x7b')]});_0x197dd5[_0x35fb0f[_0x2557('0x60')]['mapKey']]=_0x35fb0f[_0x2557('0x60')][_0x2557('0x82')];return db['CmContact'][_0x2557('0x5f')](_0x197dd5,{'fields':_0x2a327e,'raw':!![]});}})[_0x2557('0x37')](handleEntityNotFound(_0x45a236,null))['then'](function(_0x55a5fe){_0x165ea7[_0x2557('0x8f')]=_0x55a5fe;if(_0x55a5fe){var _0x11fe82={'ContactId':_0x55a5fe['id'],'OpenchannelAccountId':_0x35fb0f[_0x2557('0x5b')]['id'],'from':(_0x55a5fe[_0x2557('0x90')]||'')+'\x20'+(_0x55a5fe[_0x2557('0x91')]||'')};var _0x195280={'OpenchannelAccountId':_0x35fb0f[_0x2557('0x5b')]['id'],'closed':![]};if(_0x35fb0f['body'][_0x2557('0x92')]){_0x195280[_0x2557('0x92')]=_0x35fb0f[_0x2557('0x60')][_0x2557('0x92')];return db[_0x2557('0x93')][_0x2557('0x5e')]({'where':_0x195280})[_0x2557('0x37')](function(_0xc7fd3b){if(_0xc7fd3b){return[_0xc7fd3b,![]];}_0x11fe82[_0x2557('0x92')]=_0x35fb0f[_0x2557('0x60')][_0x2557('0x92')];_0x11fe82[_0x2557('0x94')]=_0x35fb0f[_0x2557('0x60')][_0x2557('0x94')];return db[_0x2557('0x93')][_0x2557('0x5f')](_0x11fe82)['then'](function(_0x400766){return[_0x400766,!![]];});});}else{_0x195280[_0x2557('0x92')]=null;}_0x195280[_0x2557('0x95')]=_0x55a5fe['id'];return db['OpenchannelInteraction'][_0x2557('0x5e')]({'where':_0x195280})[_0x2557('0x37')](function(_0x1dc50d){if(_0x1dc50d){return[_0x1dc50d,![]];}return db[_0x2557('0x93')][_0x2557('0x5f')](_0x11fe82)[_0x2557('0x37')](function(_0x3c7e8a){return[_0x3c7e8a,!![]];});});}})['spread'](function(_0x3affec,_0x1c39ae){if(_0x3affec){_0x1084fd=_0x1c39ae;if(!_0x1c39ae){var _0x448ba9={'from':(_0x165ea7[_0x2557('0x8f')][_0x2557('0x90')]||'')+'\x20'+(_0x165ea7[_0x2557('0x8f')]['lastName']||'')};if(_0x35fb0f[_0x2557('0x60')][_0x2557('0x92')]&&_0x35fb0f['body'][_0x2557('0x96')]&&_0x35fb0f['body'][_0x2557('0x92')]!=_0x35fb0f[_0x2557('0x60')][_0x2557('0x96')]){_0x448ba9[_0x2557('0x92')]=_0x35fb0f['body'][_0x2557('0x96')];}return _0x3affec[_0x2557('0x66')](_0x448ba9);}else{return _0x3affec;}}})['then'](function(_0x23c3d4){_0x165ea7['interaction']=_0x23c3d4[_0x2557('0x39')]({'plain':!![]});_0x165ea7[_0x2557('0x97')][_0x2557('0x98')]=_0x1084fd;if(_0x165ea7['interaction'][_0x2557('0x98')]){if(_0x165ea7['account']['autoclose']){_0x165ea7['applications'][_0x2557('0x99')]({'id':0x0,'priority':_0x165ea7[_0x2557('0x8a')][_0x2557('0x5d')]+0x1,'app':_0x2557('0x9a'),'appdata':_0x2557('0x9b'),'interval':_0x2557('0x9c')});}}return db['OpenchannelMessage'][_0x2557('0x5f')]({'body':_0x35fb0f[_0x2557('0x60')][_0x2557('0x60')],'OpenchannelAccountId':_0x35fb0f[_0x2557('0x5b')]['id'],'OpenchannelInteractionId':_0x23c3d4['id'],'direction':'in','ContactId':_0x165ea7[_0x2557('0x8f')]['id'],'AttachmentId':_0x35fb0f[_0x2557('0x60')][_0x2557('0x9d')]});})['then'](function(_0x10e6e7){_0x165ea7['message']=_0x10e6e7;if(_0x165ea7[_0x2557('0x97')][_0x2557('0x9e')]){return db[_0x2557('0x9f')]['find']({'attributes':['id',_0x2557('0x3c')],'where':{'id':_0x165ea7[_0x2557('0x97')][_0x2557('0x9e')]}})[_0x2557('0x37')](function(_0x3c9a61){if(_0x3c9a61){_0x165ea7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2557('0xa0'),'appdata':_0x3c9a61[_0x2557('0x3c')]+','+(_0x165ea7[_0x2557('0x89')][_0x2557('0xa1')]||0xa),'interval':'*,*,*,*'});_0x165ea7[_0x2557('0xa2')]=![];}return respondWithRpcPromise('Start',_0x2557('0xa3'),_0x165ea7);});}return respondWithRpcPromise('Start',_0x2557('0xa3'),_0x165ea7);})[_0x2557('0x37')](function(_0x2df510){respondWithRpcPromise('EventManager',_0x2557('0xa4'),{'event':_0x2557('0x72'),'message':_0x2df510},client9002);return _0x2df510;})[_0x2557('0x37')](respondWithResult(_0x45a236,null))['catch'](handleError(_0x45a236,null));};exports[_0x2557('0xa5')]=function(_0xefbfdd,_0x4c8e13,_0x1633e6){return db['OpenchannelAccount']['findOne']({'where':{'id':_0xefbfdd[_0x2557('0x5b')]['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x4c8e13,null))['then'](function(_0x13585a){if(_0x13585a){return db['sequelize'][_0x2557('0xa6')](function(_0x2a583a){return db[_0x2557('0x87')][_0x2557('0x38')]({'where':{'OpenchannelAccountId':_0xefbfdd[_0x2557('0x5b')]['id']},'transaction':_0x2a583a})[_0x2557('0x37')](function(_0x51fa7c){var _0x356994=_[_0x2557('0x41')](_0xefbfdd[_0x2557('0x60')],function(_0x238ba8){_0x238ba8[_0x2557('0x68')]=_0xefbfdd[_0x2557('0x5b')]['id'];return _0x238ba8;});return db[_0x2557('0x87')][_0x2557('0xa7')](_0x356994,{'transaction':_0x2a583a});});})[_0x2557('0x37')](function(){return db[_0x2557('0x87')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0xefbfdd['params']['id']},'order':_0x2557('0x8c')});});}})[_0x2557('0x37')](respondWithResult(_0x4c8e13,null))[_0x2557('0x2b')](handleError(_0x4c8e13,null));};exports[_0x2557('0xa8')]=function(_0x7a1e35,_0xb15634,_0x4d693b){var _0x172002={};var _0x274caf={};var _0x7edce7;var _0x3ef31d;return db[_0x2557('0x42')][_0x2557('0x6b')]({'where':{'id':_0x7a1e35[_0x2557('0x5b')]['id']}})['then'](handleEntityNotFound(_0xb15634,null))[_0x2557('0x37')](function(_0x37b9fd){if(_0x37b9fd){_0x7edce7=_0x37b9fd;_0x274caf[_0x2557('0x46')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x274caf[_0x2557('0x47')]=_[_0x2557('0x5c')](_0x7a1e35['query']);_0x274caf[_0x2557('0x50')]=_[_0x2557('0x48')](_0x274caf[_0x2557('0x46')],_0x274caf[_0x2557('0x47')]);_0x172002['attributes']=_[_0x2557('0x48')](_0x274caf['model'],qs['fields'](_0x7a1e35['query'][_0x2557('0x4a')]));_0x172002[_0x2557('0x49')]=_0x172002[_0x2557('0x49')][_0x2557('0x5d')]?_0x172002[_0x2557('0x49')]:_0x274caf['model'];_0x172002['order']=qs[_0x2557('0x4e')](_0x7a1e35[_0x2557('0x47')][_0x2557('0x4e')]);_0x172002[_0x2557('0x4f')]=qs[_0x2557('0x50')](_['pick'](_0x7a1e35[_0x2557('0x47')],_0x274caf[_0x2557('0x50')]));if(_0x7a1e35[_0x2557('0x47')][_0x2557('0x52')]){_0x172002[_0x2557('0x4f')]=_[_0x2557('0x53')](_0x172002['where'],{'$or':_[_0x2557('0x41')](_0x172002[_0x2557('0x49')],function(_0xad76c2){var _0x44feb6={};_0x44feb6[_0xad76c2]={'$like':'%'+_0x7a1e35[_0x2557('0x47')][_0x2557('0x52')]+'%'};return _0x44feb6;})});}_0x172002=_['merge']({},_0x172002,_0x7a1e35[_0x2557('0x56')]);return _0x7edce7['getApplications'](_0x172002);}})[_0x2557('0x37')](function(_0x53d9a5){if(_0x53d9a5){_0x3ef31d=_0x53d9a5[_0x2557('0x5d')];if(!_0x7a1e35['query'][_0x2557('0x4b')]('nolimit')){_0x172002[_0x2557('0x32')]=qs[_0x2557('0x32')](_0x7a1e35['query'][_0x2557('0x32')]);_0x172002['offset']=qs[_0x2557('0x30')](_0x7a1e35[_0x2557('0x47')]['offset']);}return _0x7edce7[_0x2557('0xa8')](_0x172002);}})[_0x2557('0x37')](function(_0x318512){if(_0x318512){return _0x318512?{'count':_0x3ef31d,'rows':_0x318512}:null;}})[_0x2557('0x37')](respondWithResult(_0xb15634,null))[_0x2557('0x2b')](handleError(_0xb15634,null));};exports[_0x2557('0xa9')]=function(_0x4495be,_0x1ddf71,_0x2ac700){var _0x4ce1b2={'raw':![],'where':{}};var _0x37cfaa={};var _0x4ee608={'count':0x0,'rows':[]};return db[_0x2557('0x42')][_0x2557('0x6b')]({'where':{'id':_0x4495be['params']['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x1ddf71,null))['then'](function(_0x4f53d9){if(_0x4f53d9){_0x37cfaa[_0x2557('0x46')]=_['keys'](db[_0x2557('0x93')][_0x2557('0x43')]);_0x37cfaa['query']=_['keys'](_0x4495be[_0x2557('0x47')]);_0x37cfaa[_0x2557('0x50')]=_[_0x2557('0x48')](_0x37cfaa['model'],_0x37cfaa[_0x2557('0x47')]);_0x4ce1b2[_0x2557('0x49')]=_[_0x2557('0x48')](_0x37cfaa['model'],qs['fields'](_0x4495be[_0x2557('0x47')][_0x2557('0x4a')]));_0x4ce1b2[_0x2557('0x49')]=_0x4ce1b2[_0x2557('0x49')]['length']?_0x4ce1b2[_0x2557('0x49')]:_0x37cfaa[_0x2557('0x46')];if(!_0x4495be[_0x2557('0x47')][_0x2557('0x4b')](_0x2557('0x4c'))){_0x4ce1b2[_0x2557('0x32')]=qs[_0x2557('0x32')](_0x4495be[_0x2557('0x47')]['limit']);_0x4ce1b2[_0x2557('0x30')]=qs['offset'](_0x4495be[_0x2557('0x47')][_0x2557('0x30')]);}_0x4ce1b2[_0x2557('0x4d')]=qs['sort'](_0x4495be[_0x2557('0x47')][_0x2557('0x4e')]);_0x4ce1b2[_0x2557('0x4f')]=qs[_0x2557('0x50')](_['pick'](_0x4495be[_0x2557('0x47')],_0x37cfaa['filters']));_0x4ce1b2[_0x2557('0x4f')][_0x2557('0x68')]=_0x4f53d9['id'];if(_0x4495be[_0x2557('0x47')][_0x2557('0x52')]){_0x4ce1b2[_0x2557('0x4f')]=_['merge'](_0x4ce1b2[_0x2557('0x4f')],{'$or':_[_0x2557('0x41')](_0x4ce1b2['attributes'],function(_0x19ca3b){var _0x4a7cab={};_0x4a7cab[_0x19ca3b]={'$like':'%'+_0x4495be[_0x2557('0x47')][_0x2557('0x52')]+'%'};return _0x4a7cab;})});}_0x4ce1b2=_[_0x2557('0x53')]({},_0x4ce1b2,_0x4495be[_0x2557('0x56')]);return db['OpenchannelInteraction']['count']({'where':_0x4ce1b2['where']})['then'](function(_0x48c654){_0x4ee608[_0x2557('0x33')]=_0x48c654;if(_0x4495be[_0x2557('0x47')]['includeAll']){_0x4ce1b2['include']=[{'model':db[_0x2557('0x74')],'as':_0x2557('0xaa'),'required':![]},{'model':db[_0x2557('0x9f')],'as':_0x2557('0xab'),'attributes':[_0x2557('0x3c'),'fullname',_0x2557('0xac')],'required':![]},{'model':db[_0x2557('0xad')],'as':_0x2557('0xae'),'attributes':['id','name',_0x2557('0xaf')],'where':_0x4495be[_0x2557('0x47')]['tag']?{'id':_0x4495be['query'][_0x2557('0xb0')]}:undefined,'required':_0x4495be[_0x2557('0x47')][_0x2557('0xb0')]?!![]:![]}];}return db[_0x2557('0x93')][_0x2557('0x59')](_0x4ce1b2);})['then'](function(_0xa82eb8){_0x4ee608[_0x2557('0x5a')]=_0xa82eb8;return _0x4ee608;});}})[_0x2557('0x37')](respondWithFilteredResult(_0x1ddf71,_0x4ce1b2))['catch'](handleError(_0x1ddf71,null));};exports[_0x2557('0xb1')]=function(_0x3c3dfc,_0x310818,_0x578a47){return db[_0x2557('0x42')][_0x2557('0x5e')]({'where':{'id':_0x3c3dfc['params']['id']}})['then'](handleEntityNotFound(_0x310818,null))[_0x2557('0x37')](function(_0x4b099c){if(_0x4b099c){return _0x4b099c[_0x2557('0xb1')](_0x3c3dfc[_0x2557('0x60')][_0x2557('0x6d')],_['omit'](_0x3c3dfc['body'],[_0x2557('0x6d'),'id'])||{})[_0x2557('0xb2')](function(_0x505534){for(var _0x5a3da7=0x0;_0x5a3da7<_0x3c3dfc['body'][_0x2557('0x6d')]['length'];_0x5a3da7+=0x1){socket['emit'](_0x2557('0xb3'),{'UserId':Number(_0x3c3dfc[_0x2557('0x60')][_0x2557('0x6d')][_0x5a3da7]),'OpenchannelAccountId':Number(_0x3c3dfc[_0x2557('0x5b')]['id'])});}return _0x505534;});}})[_0x2557('0x37')](respondWithResult(_0x310818,null))[_0x2557('0x2b')](handleError(_0x310818,null));};exports[_0x2557('0xb4')]=function(_0x53b3f4,_0x2fc68e,_0x3ea21c){return db[_0x2557('0x42')]['find']({'where':{'id':_0x53b3f4[_0x2557('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2fc68e,null))[_0x2557('0x37')](function(_0x5d3b52){if(_0x5d3b52){return _0x5d3b52[_0x2557('0xb4')](_0x53b3f4[_0x2557('0x47')]['ids'])[_0x2557('0x37')](function(){if(_['isArray'](_0x53b3f4[_0x2557('0x47')][_0x2557('0x6d')])){for(var _0x44e2ee=0x0;_0x44e2ee<_0x53b3f4[_0x2557('0x47')]['ids'][_0x2557('0x5d')];_0x44e2ee+=0x1){socket[_0x2557('0xb5')](_0x2557('0xb6'),{'UserId':Number(_0x53b3f4[_0x2557('0x47')][_0x2557('0x6d')][_0x44e2ee]),'OpenchannelAccountId':Number(_0x53b3f4[_0x2557('0x5b')]['id'])});}}else{socket[_0x2557('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x53b3f4[_0x2557('0x47')][_0x2557('0x6d')]),'OpenchannelAccountId':Number(_0x53b3f4[_0x2557('0x5b')]['id'])});}});}})[_0x2557('0x37')](respondWithStatusCode(_0x2fc68e,null))[_0x2557('0x2b')](handleError(_0x2fc68e,null));};exports[_0x2557('0xb7')]=function(_0x2338fd,_0x5e9569,_0x87e224){var _0x144c29={};var _0x57fb97={};var _0x292703;var _0x50c4f5;return db[_0x2557('0x42')][_0x2557('0x6b')]({'where':{'id':_0x2338fd[_0x2557('0x5b')]['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x5e9569,null))[_0x2557('0x37')](function(_0x376731){if(_0x376731){_0x292703=_0x376731;_0x57fb97[_0x2557('0x46')]=_[_0x2557('0x5c')](db[_0x2557('0x9f')][_0x2557('0x43')]);_0x57fb97[_0x2557('0x47')]=_['keys'](_0x2338fd[_0x2557('0x47')]);_0x57fb97[_0x2557('0x50')]=_[_0x2557('0x48')](_0x57fb97[_0x2557('0x46')],_0x57fb97['query']);_0x144c29[_0x2557('0x49')]=_[_0x2557('0x48')](_0x57fb97[_0x2557('0x46')],qs[_0x2557('0x4a')](_0x2338fd[_0x2557('0x47')]['fields']));_0x144c29[_0x2557('0x49')]=_0x144c29['attributes'][_0x2557('0x5d')]?_0x144c29[_0x2557('0x49')]:_0x57fb97['model'];_0x144c29[_0x2557('0x4d')]=qs['sort'](_0x2338fd[_0x2557('0x47')][_0x2557('0x4e')]);_0x144c29['where']=qs[_0x2557('0x50')](_[_0x2557('0x51')](_0x2338fd[_0x2557('0x47')],_0x57fb97[_0x2557('0x50')]));if(_0x2338fd[_0x2557('0x47')][_0x2557('0x52')]){_0x144c29[_0x2557('0x4f')]=_[_0x2557('0x53')](_0x144c29[_0x2557('0x4f')],{'$or':_[_0x2557('0x41')](_0x144c29[_0x2557('0x49')],function(_0x44528b){var _0x49b919={};_0x49b919[_0x44528b]={'$like':'%'+_0x2338fd[_0x2557('0x47')][_0x2557('0x52')]+'%'};return _0x49b919;})});}_0x144c29=_[_0x2557('0x53')]({},_0x144c29,_0x2338fd[_0x2557('0x56')]);return _0x292703[_0x2557('0xb7')](_0x144c29);}})[_0x2557('0x37')](function(_0x5735a3){if(_0x5735a3){_0x50c4f5=_0x5735a3[_0x2557('0x5d')];if(!_0x2338fd[_0x2557('0x47')][_0x2557('0x4b')](_0x2557('0x4c'))){_0x144c29[_0x2557('0x32')]=qs[_0x2557('0x32')](_0x2338fd[_0x2557('0x47')]['limit']);_0x144c29[_0x2557('0x30')]=qs[_0x2557('0x30')](_0x2338fd[_0x2557('0x47')]['offset']);}return _0x292703[_0x2557('0xb7')](_0x144c29);}})[_0x2557('0x37')](function(_0x4e91c0){if(_0x4e91c0){return _0x4e91c0?{'count':_0x50c4f5,'rows':_0x4e91c0}:null;}})[_0x2557('0x37')](respondWithResult(_0x5e9569,null))[_0x2557('0x2b')](handleError(_0x5e9569,null));};exports['send']=function(_0x2775c5,_0x3ff683,_0x1fe897){var _0x16e0cb,_0x50e820,_0x3ef62c;if(_[_0x2557('0x7c')](_0x2775c5['body'][_0x2557('0x60')])||_0x2775c5[_0x2557('0x60')][_0x2557('0x60')]===''){throw new db[(_0x2557('0x75'))][(_0x2557('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2557('0x7c')](_0x2775c5[_0x2557('0x60')]['to'])){}_0x16e0cb=_0x2775c5[_0x2557('0x60')]['to'];return db[_0x2557('0x42')][_0x2557('0x6b')]({'where':{'id':_0x2775c5['params']['id']}})[_0x2557('0x37')](handleEntityNotFound(_0x3ff683,null))['then'](function(_0xdab5e5){if(_0xdab5e5){return db[_0x2557('0x42')]['find']({'where':{'id':_0xdab5e5['id']},'include':[{'model':db[_0x2557('0x83')],'as':'List','include':[{'model':db[_0x2557('0x74')],'as':_0x2557('0x85'),'where':{[_0xdab5e5[_0x2557('0x7f')]]:_0x16e0cb},'limit':0x1,'order':[['updatedAt',_0x2557('0x86')]]}]}]})[_0x2557('0x37')](handleEntityNotFound(_0x3ff683,null))[_0x2557('0x37')](function(_0x3ab4ae){if(_0x3ab4ae&&_0x3ab4ae[_0x2557('0x84')]){_0x50e820=_0x3ab4ae[_0x2557('0x39')]({'plain':!![]});if(_0x50e820['List']&&_0x50e820[_0x2557('0x84')][_0x2557('0x85')][_0x2557('0x5d')]){return _0x50e820['List'][_0x2557('0x85')][0x0];}return db['CmContact']['create'](_[_0x2557('0x8e')](_0x2775c5[_0x2557('0x60')],{'firstName':_0x16e0cb,[_0x3ab4ae[_0x2557('0x7f')]]:_0x16e0cb,'phone':_0x16e0cb,'ListId':_0x50e820[_0x2557('0x7b')]}));}})['then'](handleEntityNotFound(_0x3ff683,null))[_0x2557('0x37')](function(_0x7d2169){if(_0x7d2169){_0x3ef62c=_0x7d2169;return db[_0x2557('0x93')]['find']({'where':{'ContactId':_0x3ef62c['id'],'closed':![],'OpenchannelAccountId':_0x50e820['id']}})[_0x2557('0x37')](function(_0x293173){if(_0x293173){return[_0x293173,![]];}return db[_0x2557('0x93')][_0x2557('0x5f')]({'UserId':_0x2775c5[_0x2557('0x61')]['id'],'ContactId':_0x3ef62c['id'],'OpenchannelAccountId':_0x50e820['id'],'lastMsgDirection':_0x2557('0xb8'),'Messages':[_[_0x2557('0x53')](_0x2775c5[_0x2557('0x60')],{'read':![],'body':_0x2775c5[_0x2557('0x60')][_0x2557('0x60')],'OpenchannelAccountId':_0x50e820['id'],'UserId':_0x2775c5[_0x2557('0x61')]['id'],'ContactId':_0x3ef62c['id']})]},{'include':[{'model':db[_0x2557('0xb9')],'as':_0x2557('0xba')}]})[_0x2557('0x37')](function(_0x449453){return[_0x449453,!![]];});});}})[_0x2557('0xb2')](function(_0xc9ea01,_0x3e1ae0){if(_0x3e1ae0){return _0xc9ea01;}return db['OpenchannelMessage'][_0x2557('0x5f')](_[_0x2557('0x53')](_0x2775c5[_0x2557('0x60')],{'read':![],'body':_0x2775c5['body'][_0x2557('0x60')],'OpenchannelAccountId':_0x50e820['id'],'OpenchannelInteractionId':_0xc9ea01['id'],'UserId':_0x2775c5[_0x2557('0x61')]['id'],'ContactId':_0x3ef62c['id']}))[_0x2557('0x37')](function(_0x54d010){_0xc9ea01[_0x2557('0xbb')][_0x2557('0xba')]=[];_0xc9ea01[_0x2557('0xbb')][_0x2557('0xba')][_0x2557('0x99')](_0x54d010[_0x2557('0xbb')]);return _0xc9ea01;});});}})[_0x2557('0x37')](respondWithResult(_0x3ff683,null))[_0x2557('0x2b')](handleError(_0x3ff683,null));}; \ No newline at end of file +var _0x8bfa=['priority','account','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','transaction','getApplications','Contact','fullname','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','jayson/promise','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','get','OpenchannelAccounts','destroy','stack','name','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','show','params','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','findAll','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','OpenchannelApplication','Applications','applications','list','orderBy'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x8bfa,0xde));var _0xa8bf=function(_0x5585ca,_0x4c6c65){_0x5585ca=_0x5585ca-0x0;var _0x415be9=_0x8bfa[_0x5585ca];return _0x415be9;};'use strict';var emlformat=require(_0xa8bf('0x0'));var rimraf=require(_0xa8bf('0x1'));var zipdir=require(_0xa8bf('0x2'));var jsonpatch=require(_0xa8bf('0x3'));var rp=require(_0xa8bf('0x4'));var moment=require('moment');var BPromise=require(_0xa8bf('0x5'));var Mustache=require(_0xa8bf('0x6'));var util=require('util');var path=require(_0xa8bf('0x7'));var sox=require(_0xa8bf('0x8'));var csv=require(_0xa8bf('0x9'));var ejs=require(_0xa8bf('0xa'));var fs=require('fs');var fs_extra=require(_0xa8bf('0xb'));var _=require(_0xa8bf('0xc'));var squel=require(_0xa8bf('0xd'));var crypto=require(_0xa8bf('0xe'));var jsforce=require(_0xa8bf('0xf'));var deskjs=require(_0xa8bf('0x10'));var toCsv=require(_0xa8bf('0x9'));var querystring=require(_0xa8bf('0x11'));var Papa=require(_0xa8bf('0x12'));var Redis=require('ioredis');var authService=require(_0xa8bf('0x13'));var qs=require(_0xa8bf('0x14'));var as=require(_0xa8bf('0x15'));var hardwareService=require(_0xa8bf('0x16'));var logger=require(_0xa8bf('0x17'))('api');var utils=require(_0xa8bf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa8bf('0x19'));var db=require(_0xa8bf('0x1a'))['db'];config[_0xa8bf('0x1b')]=_[_0xa8bf('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa8bf('0x1d'))['register'](socket);var jayson=require(_0xa8bf('0x1e'));var client=jayson['client'][_0xa8bf('0x1f')]({'port':0x232c});var client9002=jayson[_0xa8bf('0x20')][_0xa8bf('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x33cadb,_0x408cc9,_0x3ee641,_0x454539){return new BPromise(function(_0x296f13,_0x4b3555){var _0x11f483=_0x454539||client;return _0x11f483['request'](_0x33cadb,_0x3ee641)[_0xa8bf('0x21')](function(_0x5acddc){logger[_0xa8bf('0x22')](_0xa8bf('0x23'),_0x408cc9,_0xa8bf('0x24'));logger[_0xa8bf('0x25')](_0xa8bf('0x26'),_0x408cc9,'request\x20sent',JSON[_0xa8bf('0x27')](_0x5acddc));if(_0x5acddc[_0xa8bf('0x28')]){if(_0x5acddc['error']['code']===0x1f4){logger[_0xa8bf('0x28')](_0xa8bf('0x23'),_0x408cc9,_0x5acddc['error'][_0xa8bf('0x29')]);return _0x4b3555(_0x5acddc[_0xa8bf('0x28')]['message']);}logger[_0xa8bf('0x28')](_0xa8bf('0x23'),_0x408cc9,_0x5acddc[_0xa8bf('0x28')][_0xa8bf('0x29')]);return _0x296f13(_0x5acddc[_0xa8bf('0x28')][_0xa8bf('0x29')]);}else{logger[_0xa8bf('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x408cc9,_0xa8bf('0x24'));_0x296f13(_0x5acddc[_0xa8bf('0x2a')]['message']);}})[_0xa8bf('0x2b')](function(_0x46d068){logger[_0xa8bf('0x28')](_0xa8bf('0x23'),_0x408cc9,_0x46d068);_0x4b3555(_0x46d068);});});}function respondWithStatusCode(_0xc59ab1,_0x311c26){_0x311c26=_0x311c26||0xcc;return function(_0x5ae1b9){if(_0x5ae1b9){return _0xc59ab1[_0xa8bf('0x2c')](_0x311c26);}return _0xc59ab1[_0xa8bf('0x2d')](_0x311c26)[_0xa8bf('0x2e')]();};}function respondWithResult(_0x4b87ba,_0x3f959c){_0x3f959c=_0x3f959c||0xc8;return function(_0x3e5eef){if(_0x3e5eef){return _0x4b87ba['status'](_0x3f959c)[_0xa8bf('0x2f')](_0x3e5eef);}};}function respondWithFilteredResult(_0x25eb5a,_0x3d6eb6){return function(_0x36cee8){if(_0x36cee8){var _0x25975c=typeof _0x3d6eb6['offset']==='undefined'&&typeof _0x3d6eb6[_0xa8bf('0x30')]===_0xa8bf('0x31');var _0x38a8b3=_0x36cee8[_0xa8bf('0x32')];var _0x4cdd51=_0x25975c?0x0:_0x3d6eb6['offset'];var _0x3c0030=_0x25975c?_0x36cee8['count']:_0x3d6eb6[_0xa8bf('0x33')]+_0x3d6eb6[_0xa8bf('0x30')];var _0x15e072;if(_0x3c0030>=_0x38a8b3){_0x3c0030=_0x38a8b3;_0x15e072=0xc8;}else{_0x15e072=0xce;}_0x25eb5a['status'](_0x15e072);return _0x25eb5a['set'](_0xa8bf('0x34'),_0x4cdd51+'-'+_0x3c0030+'/'+_0x38a8b3)[_0xa8bf('0x2f')](_0x36cee8);}return null;};}function patchUpdates(_0x46e6b0){return function(_0x181289){try{jsonpatch[_0xa8bf('0x35')](_0x181289,_0x46e6b0,!![]);}catch(_0x30323f){return BPromise[_0xa8bf('0x36')](_0x30323f);}return _0x181289[_0xa8bf('0x37')]();};}function saveUpdates(_0x42743c,_0x3807d3){return function(_0x440852){if(_0x440852){return _0x440852[_0xa8bf('0x38')](_0x42743c)[_0xa8bf('0x21')](function(_0x2e9db8){return _0x2e9db8;});}return null;};}function removeEntity(_0x4a6c7f,_0x4137e6){return function(_0x5ab026){if(_0x5ab026){return _0x5ab026['destroy']()[_0xa8bf('0x21')](function(){var _0x2b91a5=_0x5ab026[_0xa8bf('0x39')]({'plain':!![]});var _0x2e12ad=_0xa8bf('0x3a');return db['UserProfileResource'][_0xa8bf('0x3b')]({'where':{'type':_0x2e12ad,'resourceId':_0x2b91a5['id']}})[_0xa8bf('0x21')](function(){return _0x5ab026;});})[_0xa8bf('0x21')](function(){_0x4a6c7f['status'](0xcc)[_0xa8bf('0x2e')]();});}};}function handleEntityNotFound(_0x319250,_0x32c13a){return function(_0x19b8ee){if(!_0x19b8ee){_0x319250[_0xa8bf('0x2c')](0x194);}return _0x19b8ee;};}function handleError(_0x20c5e4,_0x209f93){_0x209f93=_0x209f93||0x1f4;return function(_0x1a3a1b){logger[_0xa8bf('0x28')](_0x1a3a1b[_0xa8bf('0x3c')]);if(_0x1a3a1b[_0xa8bf('0x3d')]){delete _0x1a3a1b[_0xa8bf('0x3d')];}_0x20c5e4['status'](_0x209f93)[_0xa8bf('0x3e')](_0x1a3a1b);};}exports['index']=function(_0x154c46,_0xbd7941){var _0x28aeec={'include':[{'model':db[_0xa8bf('0x3f')],'as':_0xa8bf('0x40')}]},_0x48c893={},_0x19ce59={'count':0x0,'rows':[]};var _0xe8308=_[_0xa8bf('0x41')](db[_0xa8bf('0x42')]['rawAttributes'],function(_0x1ab4a3){return{'name':_0x1ab4a3['fieldName'],'type':_0x1ab4a3[_0xa8bf('0x43')][_0xa8bf('0x44')]};});_0x48c893[_0xa8bf('0x45')]=_[_0xa8bf('0x41')](_0xe8308,_0xa8bf('0x3d'));_0x48c893[_0xa8bf('0x46')]=_[_0xa8bf('0x47')](_0x154c46['query']);_0x48c893[_0xa8bf('0x48')]=_[_0xa8bf('0x49')](_0x48c893['model'],_0x48c893[_0xa8bf('0x46')]);_0x28aeec[_0xa8bf('0x4a')]=_[_0xa8bf('0x49')](_0x48c893[_0xa8bf('0x45')],qs[_0xa8bf('0x4b')](_0x154c46[_0xa8bf('0x46')][_0xa8bf('0x4b')]));_0x28aeec[_0xa8bf('0x4a')]=_0x28aeec[_0xa8bf('0x4a')][_0xa8bf('0x4c')]?_0x28aeec[_0xa8bf('0x4a')]:_0x48c893['model'];if(!_0x154c46[_0xa8bf('0x46')]['hasOwnProperty'](_0xa8bf('0x4d'))){_0x28aeec[_0xa8bf('0x30')]=qs[_0xa8bf('0x30')](_0x154c46['query'][_0xa8bf('0x30')]);_0x28aeec[_0xa8bf('0x33')]=qs[_0xa8bf('0x33')](_0x154c46[_0xa8bf('0x46')][_0xa8bf('0x33')]);}_0x28aeec[_0xa8bf('0x4e')]=qs[_0xa8bf('0x4f')](_0x154c46['query'][_0xa8bf('0x4f')]);_0x28aeec[_0xa8bf('0x50')]=qs[_0xa8bf('0x48')](_[_0xa8bf('0x51')](_0x154c46[_0xa8bf('0x46')],_0x48c893[_0xa8bf('0x48')]),_0xe8308);if(_0x154c46[_0xa8bf('0x46')]['filter']){_0x28aeec[_0xa8bf('0x50')]=_[_0xa8bf('0x52')](_0x28aeec[_0xa8bf('0x50')],{'$or':_[_0xa8bf('0x41')](_0xe8308,function(_0x349f00){if(_0x349f00['type']!==_0xa8bf('0x53')){var _0x2170f2={};_0x2170f2[_0x349f00[_0xa8bf('0x3d')]]={'$like':'%'+_0x154c46['query'][_0xa8bf('0x54')]+'%'};return _0x2170f2;}})});}_0x28aeec=_[_0xa8bf('0x52')]({},_0x28aeec,_0x154c46['options']);var _0x575e22={'where':_0x28aeec['where']};return db[_0xa8bf('0x42')][_0xa8bf('0x32')](_0x575e22)[_0xa8bf('0x21')](function(_0x6df215){_0x19ce59[_0xa8bf('0x32')]=_0x6df215;if(_0x154c46[_0xa8bf('0x46')][_0xa8bf('0x55')]){_0x28aeec['include']=[{'all':!![]}];}return db[_0xa8bf('0x42')]['findAll'](_0x28aeec);})['then'](function(_0x15e06b){_0x19ce59[_0xa8bf('0x56')]=_0x15e06b;return _0x19ce59;})['then'](respondWithFilteredResult(_0xbd7941,_0x28aeec))['catch'](handleError(_0xbd7941,null));};exports[_0xa8bf('0x57')]=function(_0x87b3e9,_0x45eef1){var _0x1a7ae9={'raw':![],'where':{'id':_0x87b3e9[_0xa8bf('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xa8bf('0x40')}]},_0x57431d={};_0x57431d['model']=_['keys'](db[_0xa8bf('0x42')][_0xa8bf('0x59')]);_0x57431d['query']=_[_0xa8bf('0x47')](_0x87b3e9['query']);_0x57431d[_0xa8bf('0x48')]=_[_0xa8bf('0x49')](_0x57431d[_0xa8bf('0x45')],_0x57431d[_0xa8bf('0x46')]);_0x1a7ae9[_0xa8bf('0x4a')]=_[_0xa8bf('0x49')](_0x57431d[_0xa8bf('0x45')],qs[_0xa8bf('0x4b')](_0x87b3e9['query'][_0xa8bf('0x4b')]));_0x1a7ae9[_0xa8bf('0x4a')]=_0x1a7ae9[_0xa8bf('0x4a')]['length']?_0x1a7ae9[_0xa8bf('0x4a')]:_0x57431d[_0xa8bf('0x45')];if(_0x87b3e9[_0xa8bf('0x46')][_0xa8bf('0x55')]){_0x1a7ae9[_0xa8bf('0x5a')]=[{'all':!![]}];}_0x1a7ae9=_[_0xa8bf('0x52')]({},_0x1a7ae9,_0x87b3e9[_0xa8bf('0x5b')]);return db['OpenchannelAccount'][_0xa8bf('0x5c')](_0x1a7ae9)[_0xa8bf('0x21')](handleEntityNotFound(_0x45eef1,null))[_0xa8bf('0x21')](respondWithResult(_0x45eef1,null))[_0xa8bf('0x2b')](handleError(_0x45eef1,null));};exports[_0xa8bf('0x5d')]=function(_0x3a031c,_0x5defc5){return db[_0xa8bf('0x42')][_0xa8bf('0x5d')](_0x3a031c[_0xa8bf('0x5e')],{})['then'](function(_0x18dfa3){var _0x726688=_0x3a031c[_0xa8bf('0x5f')]['get']({'plain':!![]});if(!_0x726688)throw new Error(_0xa8bf('0x60'));if(_0x726688[_0xa8bf('0x61')]===_0xa8bf('0x5f')){var _0x5a1c6f=_0x18dfa3[_0xa8bf('0x39')]({'plain':!![]});var _0x35dfd1='OpenchannelAccounts';return db[_0xa8bf('0x62')][_0xa8bf('0x5c')]({'where':{'name':_0x35dfd1,'userProfileId':_0x726688['userProfileId']},'raw':!![]})[_0xa8bf('0x21')](function(_0x9c6634){if(_0x9c6634&&_0x9c6634[_0xa8bf('0x63')]===0x0){return db[_0xa8bf('0x64')][_0xa8bf('0x5d')]({'name':_0x5a1c6f['name'],'resourceId':_0x5a1c6f['id'],'type':_0x9c6634[_0xa8bf('0x3d')],'sectionId':_0x9c6634['id']},{})[_0xa8bf('0x21')](function(){return _0x18dfa3;});}else{return _0x18dfa3;}})[_0xa8bf('0x2b')](function(_0x17d1d9){logger[_0xa8bf('0x28')](_0xa8bf('0x65'),_0x17d1d9);throw _0x17d1d9;});}return _0x18dfa3;})['then'](respondWithResult(_0x5defc5,0xc9))[_0xa8bf('0x2b')](handleError(_0x5defc5,null));};exports[_0xa8bf('0x38')]=function(_0x2ed9a0,_0xfdbd10){if(_0x2ed9a0[_0xa8bf('0x5e')]['id']){delete _0x2ed9a0[_0xa8bf('0x5e')]['id'];}return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x2ed9a0[_0xa8bf('0x58')]['id']},'include':[{'model':db[_0xa8bf('0x3f')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xfdbd10,null))[_0xa8bf('0x21')](saveUpdates(_0x2ed9a0[_0xa8bf('0x5e')],null))['then'](respondWithResult(_0xfdbd10,null))[_0xa8bf('0x2b')](handleError(_0xfdbd10,null));};exports[_0xa8bf('0x3b')]=function(_0x31c38a,_0x2b7b52){return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x31c38a[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x2b7b52,null))['then'](removeEntity(_0x2b7b52,null))[_0xa8bf('0x2b')](handleError(_0x2b7b52,null));};exports[_0xa8bf('0x66')]=function(_0x4f5d2c,_0xf7ac45){return db[_0xa8bf('0x42')][_0xa8bf('0x66')]()[_0xa8bf('0x21')](respondWithResult(_0xf7ac45,null))[_0xa8bf('0x2b')](handleError(_0xf7ac45,null));};exports[_0xa8bf('0x67')]=function(_0x13ab37,_0x59200c,_0x13f92d){if(_0x13ab37[_0xa8bf('0x5e')]['id']){delete _0x13ab37[_0xa8bf('0x5e')]['id'];}return db['OpenchannelAccount'][_0xa8bf('0x5c')]({'where':{'id':_0x13ab37[_0xa8bf('0x58')]['id']}})['then'](handleEntityNotFound(_0x59200c,null))[_0xa8bf('0x21')](function(_0x397dc1){if(_0x397dc1){_0x13ab37[_0xa8bf('0x5e')][_0xa8bf('0x68')]=_0x397dc1['id'];return db[_0xa8bf('0x69')][_0xa8bf('0x5d')](_0x13ab37[_0xa8bf('0x5e')]);}})[_0xa8bf('0x21')](respondWithResult(_0x59200c,null))[_0xa8bf('0x2b')](handleError(_0x59200c,null));};exports[_0xa8bf('0x6a')]=function(_0x2f7623,_0x199d10,_0x55d291){var _0x1eaa2e={'raw':![],'where':{}};var _0x3e0b88={};var _0x3bb5ab={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa8bf('0x6b')]({'where':{'id':_0x2f7623[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x199d10,null))[_0xa8bf('0x21')](function(_0x642ba4){if(_0x642ba4){_0x3e0b88['model']=_['keys'](db[_0xa8bf('0x69')][_0xa8bf('0x59')]);_0x3e0b88[_0xa8bf('0x46')]=_['keys'](_0x2f7623[_0xa8bf('0x46')]);_0x3e0b88['filters']=_[_0xa8bf('0x49')](_0x3e0b88[_0xa8bf('0x45')],_0x3e0b88[_0xa8bf('0x46')]);_0x1eaa2e[_0xa8bf('0x4a')]=_[_0xa8bf('0x49')](_0x3e0b88[_0xa8bf('0x45')],qs[_0xa8bf('0x4b')](_0x2f7623[_0xa8bf('0x46')][_0xa8bf('0x4b')]));_0x1eaa2e[_0xa8bf('0x4a')]=_0x1eaa2e[_0xa8bf('0x4a')]['length']?_0x1eaa2e[_0xa8bf('0x4a')]:_0x3e0b88[_0xa8bf('0x45')];if(!_0x2f7623[_0xa8bf('0x46')][_0xa8bf('0x6c')](_0xa8bf('0x4d'))){_0x1eaa2e[_0xa8bf('0x30')]=qs[_0xa8bf('0x30')](_0x2f7623['query'][_0xa8bf('0x30')]);_0x1eaa2e[_0xa8bf('0x33')]=qs['offset'](_0x2f7623['query']['offset']);}_0x1eaa2e['order']=qs[_0xa8bf('0x4f')](_0x2f7623[_0xa8bf('0x46')]['sort']);_0x1eaa2e['where']=qs['filters'](_[_0xa8bf('0x51')](_0x2f7623[_0xa8bf('0x46')],_0x3e0b88[_0xa8bf('0x48')]));_0x1eaa2e[_0xa8bf('0x50')][_0xa8bf('0x68')]=_0x642ba4['id'];if(_0x2f7623[_0xa8bf('0x46')][_0xa8bf('0x54')]){_0x1eaa2e['where']=_['merge'](_0x1eaa2e[_0xa8bf('0x50')],{'$or':_['map'](_0x1eaa2e[_0xa8bf('0x4a')],function(_0x582ff4){var _0x533876={};_0x533876[_0x582ff4]={'$like':'%'+_0x2f7623['query'][_0xa8bf('0x54')]+'%'};return _0x533876;})});}_0x1eaa2e=_['merge']({},_0x1eaa2e,_0x2f7623[_0xa8bf('0x5b')]);return db['Disposition']['count']({'where':_0x1eaa2e[_0xa8bf('0x50')]})[_0xa8bf('0x21')](function(_0x4700ec){_0x3bb5ab[_0xa8bf('0x32')]=_0x4700ec;if(_0x2f7623['query'][_0xa8bf('0x55')]){_0x1eaa2e[_0xa8bf('0x5a')]=[{'all':!![]}];}return db[_0xa8bf('0x69')][_0xa8bf('0x6d')](_0x1eaa2e);})[_0xa8bf('0x21')](function(_0x3d8fdc){_0x3bb5ab['rows']=_0x3d8fdc;return _0x3bb5ab;});}})['then'](respondWithFilteredResult(_0x199d10,_0x1eaa2e))[_0xa8bf('0x2b')](handleError(_0x199d10,null));};exports['removeDispositions']=function(_0x20f394,_0x7c4327,_0x24b4c2){return db['OpenchannelAccount'][_0xa8bf('0x5c')]({'where':{'id':_0x20f394[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x7c4327,null))[_0xa8bf('0x21')](function(_0x1c7304){if(_0x1c7304){return _0x1c7304['removeDispositions'](_0x20f394[_0xa8bf('0x46')][_0xa8bf('0x6e')]);}})[_0xa8bf('0x21')](respondWithStatusCode(_0x7c4327,null))[_0xa8bf('0x2b')](handleError(_0x7c4327,null));};exports['addAnswer']=function(_0x1d7e89,_0x382126,_0x4ab094){if(_0x1d7e89[_0xa8bf('0x5e')]['id']){delete _0x1d7e89[_0xa8bf('0x5e')]['id'];}return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x1d7e89[_0xa8bf('0x58')]['id']}})['then'](handleEntityNotFound(_0x382126,null))[_0xa8bf('0x21')](function(_0x3f168e){if(_0x3f168e){_0x1d7e89[_0xa8bf('0x5e')][_0xa8bf('0x68')]=_0x3f168e['id'];return db[_0xa8bf('0x6f')][_0xa8bf('0x5d')](_0x1d7e89[_0xa8bf('0x5e')]);}})[_0xa8bf('0x21')](respondWithResult(_0x382126,null))['catch'](handleError(_0x382126,null));};exports[_0xa8bf('0x70')]=function(_0xd31ac0,_0x4bb88d,_0x58871a){var _0x228bc2={'raw':![],'where':{}};var _0x52ecea={};var _0x45e67a={'count':0x0,'rows':[]};return db[_0xa8bf('0x42')][_0xa8bf('0x6b')]({'where':{'id':_0xd31ac0[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x4bb88d,null))[_0xa8bf('0x21')](function(_0x3a62b9){if(_0x3a62b9){_0x52ecea['model']=_['keys'](db[_0xa8bf('0x6f')][_0xa8bf('0x59')]);_0x52ecea[_0xa8bf('0x46')]=_[_0xa8bf('0x47')](_0xd31ac0[_0xa8bf('0x46')]);_0x52ecea['filters']=_[_0xa8bf('0x49')](_0x52ecea[_0xa8bf('0x45')],_0x52ecea[_0xa8bf('0x46')]);_0x228bc2['attributes']=_[_0xa8bf('0x49')](_0x52ecea[_0xa8bf('0x45')],qs['fields'](_0xd31ac0[_0xa8bf('0x46')][_0xa8bf('0x4b')]));_0x228bc2[_0xa8bf('0x4a')]=_0x228bc2[_0xa8bf('0x4a')][_0xa8bf('0x4c')]?_0x228bc2[_0xa8bf('0x4a')]:_0x52ecea[_0xa8bf('0x45')];if(!_0xd31ac0[_0xa8bf('0x46')]['hasOwnProperty'](_0xa8bf('0x4d'))){_0x228bc2[_0xa8bf('0x30')]=qs[_0xa8bf('0x30')](_0xd31ac0[_0xa8bf('0x46')][_0xa8bf('0x30')]);_0x228bc2[_0xa8bf('0x33')]=qs[_0xa8bf('0x33')](_0xd31ac0[_0xa8bf('0x46')][_0xa8bf('0x33')]);}_0x228bc2[_0xa8bf('0x4e')]=qs[_0xa8bf('0x4f')](_0xd31ac0[_0xa8bf('0x46')][_0xa8bf('0x4f')]);_0x228bc2[_0xa8bf('0x50')]=qs['filters'](_[_0xa8bf('0x51')](_0xd31ac0[_0xa8bf('0x46')],_0x52ecea[_0xa8bf('0x48')]));_0x228bc2[_0xa8bf('0x50')][_0xa8bf('0x68')]=_0x3a62b9['id'];if(_0xd31ac0['query'][_0xa8bf('0x54')]){_0x228bc2[_0xa8bf('0x50')]=_[_0xa8bf('0x52')](_0x228bc2[_0xa8bf('0x50')],{'$or':_['map'](_0x228bc2[_0xa8bf('0x4a')],function(_0xcdc87b){var _0x32de32={};_0x32de32[_0xcdc87b]={'$like':'%'+_0xd31ac0[_0xa8bf('0x46')][_0xa8bf('0x54')]+'%'};return _0x32de32;})});}_0x228bc2=_['merge']({},_0x228bc2,_0xd31ac0[_0xa8bf('0x5b')]);return db[_0xa8bf('0x6f')][_0xa8bf('0x32')]({'where':_0x228bc2['where']})[_0xa8bf('0x21')](function(_0x5e194c){_0x45e67a[_0xa8bf('0x32')]=_0x5e194c;if(_0xd31ac0['query'][_0xa8bf('0x55')]){_0x228bc2[_0xa8bf('0x5a')]=[{'all':!![]}];}return db[_0xa8bf('0x6f')][_0xa8bf('0x6d')](_0x228bc2);})[_0xa8bf('0x21')](function(_0x5484ec){_0x45e67a[_0xa8bf('0x56')]=_0x5484ec;return _0x45e67a;});}})[_0xa8bf('0x21')](respondWithFilteredResult(_0x4bb88d,_0x228bc2))[_0xa8bf('0x2b')](handleError(_0x4bb88d,null));};exports['removeAnswers']=function(_0x205f1e,_0x454ece,_0x356560){return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x205f1e[_0xa8bf('0x58')]['id']}})['then'](handleEntityNotFound(_0x454ece,null))['then'](function(_0x23bf44){if(_0x23bf44){return _0x23bf44[_0xa8bf('0x71')](_0x205f1e[_0xa8bf('0x46')][_0xa8bf('0x6e')]);}})[_0xa8bf('0x21')](respondWithStatusCode(_0x454ece,null))[_0xa8bf('0x2b')](handleError(_0x454ece,null));};exports[_0xa8bf('0x72')]=function(_0x165a77,_0x1f1a5d,_0x3a29be){var _0xa8821f={'body':_0x165a77[_0xa8bf('0x5e')],'channel':_0xa8bf('0x73')};var _0x557ccf=[];var _0x32465b=[];var _0x1c5fe2={};var _0x423e11=![];return db[_0xa8bf('0x74')][_0xa8bf('0x66')]()[_0xa8bf('0x21')](function(_0x4b0364){if(!_0x4b0364){throw new db[(_0xa8bf('0x75'))][(_0xa8bf('0x76'))](_0xa8bf('0x77'));}_0x557ccf=_['difference'](_['keys'](_0x4b0364),[_0xa8bf('0x78'),_0xa8bf('0x79')]);_0x32465b=_[_0xa8bf('0x7a')](_[_0xa8bf('0x47')](_0x4b0364),[_0xa8bf('0x78'),_0xa8bf('0x79'),_0xa8bf('0x7b'),_0xa8bf('0x7c')]);if(_0x165a77[_0xa8bf('0x5e')]['id']){delete _0x165a77[_0xa8bf('0x5e')]['id'];}if(_[_0xa8bf('0x7d')](_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x7e')])){throw new db[(_0xa8bf('0x75'))][(_0xa8bf('0x76'))](_0xa8bf('0x7f'));}if(_['isNil'](_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x5e')])||_0x165a77['body'][_0xa8bf('0x5e')]===''){throw new db[(_0xa8bf('0x75'))]['ValidationError'](_0xa8bf('0x80'));}if(_[_0xa8bf('0x7d')](_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x81')])){throw new db[(_0xa8bf('0x75'))][(_0xa8bf('0x76'))](_0xa8bf('0x82')+_0x32465b);}if(!_[_0xa8bf('0x83')](_0x32465b,_0x165a77['body'][_0xa8bf('0x81')])){throw new db[(_0xa8bf('0x75'))][(_0xa8bf('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32465b);}_0x1c5fe2[_0x165a77['body']['mapKey']]=_0x165a77['body']['from'];})[_0xa8bf('0x21')](function(){return db[_0xa8bf('0x42')]['find']({'where':{'id':_0x165a77['params']['id']},'include':[{'model':db[_0xa8bf('0x84')],'as':_0xa8bf('0x85'),'include':[{'model':db[_0xa8bf('0x74')],'as':'Contacts','where':_0x1c5fe2,'limit':0x1,'order':[[_0xa8bf('0x79'),_0xa8bf('0x86')]]}]},{'model':db[_0xa8bf('0x87')],'as':_0xa8bf('0x88')}]});})[_0xa8bf('0x21')](handleEntityNotFound(_0x1f1a5d,null))[_0xa8bf('0x21')](function(_0x35b58c){if(_0x35b58c&&_0x35b58c[_0xa8bf('0x85')]){_0xa8821f['account']=_0x35b58c;_0xa8821f[_0xa8bf('0x89')]=_0x35b58c['Applications'];_0xa8821f[_0xa8bf('0x8a')]=_0x35b58c[_0xa8bf('0x85')];_0xa8821f[_0xa8bf('0x89')]=_[_0xa8bf('0x8b')](_0xa8821f[_0xa8bf('0x89')],[_0xa8bf('0x8c')],['asc']);if(_0xa8821f[_0xa8bf('0x8d')]['Applications']){delete _0xa8821f[_0xa8bf('0x8d')][_0xa8bf('0x88')];}if(_0xa8821f['account']['List']&&_0xa8821f['account'][_0xa8bf('0x85')][_0xa8bf('0x8e')][_0xa8bf('0x4c')]){return _0xa8821f[_0xa8bf('0x8d')][_0xa8bf('0x85')][_0xa8bf('0x8e')][0x0];}var _0xb0eb1e=_['defaults'](_0x165a77[_0xa8bf('0x5e')],{'firstName':_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x7e')],'ListId':_0x35b58c['ListId']});_0xb0eb1e[_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x81')]]=_0x165a77[_0xa8bf('0x5e')]['from'];return db[_0xa8bf('0x74')][_0xa8bf('0x5d')](_0xb0eb1e,{'fields':_0x557ccf,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f1a5d,null))['then'](function(_0x2bb02){_0xa8821f[_0xa8bf('0x8f')]=_0x2bb02;if(_0x2bb02){var _0x5b0a97={'ContactId':_0x2bb02['id'],'OpenchannelAccountId':_0x165a77['params']['id'],'from':(_0x2bb02[_0xa8bf('0x90')]||'')+'\x20'+(_0x2bb02[_0xa8bf('0x91')]||'')};var _0x5a3be5={'OpenchannelAccountId':_0x165a77[_0xa8bf('0x58')]['id'],'closed':![]};if(_0x165a77['body'][_0xa8bf('0x92')]){_0x5a3be5['threadId']=_0x165a77[_0xa8bf('0x5e')]['threadId'];return db[_0xa8bf('0x93')][_0xa8bf('0x5c')]({'where':_0x5a3be5})[_0xa8bf('0x21')](function(_0x1ae536){if(_0x1ae536){return[_0x1ae536,![]];}_0x5b0a97['threadId']=_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x92')];_0x5b0a97['externalUrl']=_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x94')];return db[_0xa8bf('0x93')][_0xa8bf('0x5d')](_0x5b0a97)[_0xa8bf('0x21')](function(_0x189c7b){return[_0x189c7b,!![]];});});}else{_0x5a3be5[_0xa8bf('0x92')]=null;}_0x5a3be5['ContactId']=_0x2bb02['id'];return db[_0xa8bf('0x93')][_0xa8bf('0x5c')]({'where':_0x5a3be5})[_0xa8bf('0x21')](function(_0x263409){if(_0x263409){return[_0x263409,![]];}return db[_0xa8bf('0x93')]['create'](_0x5b0a97)[_0xa8bf('0x21')](function(_0x1c411a){return[_0x1c411a,!![]];});});}})['spread'](function(_0x428fd5,_0x291636){if(_0x428fd5){_0x423e11=_0x291636;if(!_0x291636){var _0x1febf2={'from':(_0xa8821f['contact'][_0xa8bf('0x90')]||'')+'\x20'+(_0xa8821f[_0xa8bf('0x8f')]['lastName']||'')};if(_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x92')]&&_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x95')]&&_0x165a77[_0xa8bf('0x5e')]['threadId']!=_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x95')]){_0x1febf2[_0xa8bf('0x92')]=_0x165a77[_0xa8bf('0x5e')][_0xa8bf('0x95')];}return _0x428fd5[_0xa8bf('0x38')](_0x1febf2);}else{return _0x428fd5;}}})[_0xa8bf('0x21')](function(_0x5cb05e){_0xa8821f[_0xa8bf('0x96')]=_0x5cb05e['get']({'plain':!![]});_0xa8821f[_0xa8bf('0x96')][_0xa8bf('0x97')]=_0x423e11;if(_0xa8821f[_0xa8bf('0x96')][_0xa8bf('0x97')]){if(_0xa8821f['account'][_0xa8bf('0x98')]){_0xa8821f[_0xa8bf('0x89')][_0xa8bf('0x99')]({'id':0x0,'priority':_0xa8821f[_0xa8bf('0x89')][_0xa8bf('0x4c')]+0x1,'app':_0xa8bf('0x9a'),'appdata':_0xa8bf('0x9b'),'interval':_0xa8bf('0x9c')});}}return db[_0xa8bf('0x9d')][_0xa8bf('0x5d')]({'body':_0x165a77['body'][_0xa8bf('0x5e')],'OpenchannelAccountId':_0x165a77[_0xa8bf('0x58')]['id'],'OpenchannelInteractionId':_0x5cb05e['id'],'direction':'in','ContactId':_0xa8821f[_0xa8bf('0x8f')]['id'],'AttachmentId':_0x165a77[_0xa8bf('0x5e')]['AttachmentId']});})[_0xa8bf('0x21')](function(_0x1b491f){_0xa8821f[_0xa8bf('0x29')]=_0x1b491f;if(_0xa8821f[_0xa8bf('0x96')][_0xa8bf('0x9e')]){return db[_0xa8bf('0x9f')]['find']({'attributes':['id',_0xa8bf('0x3d')],'where':{'id':_0xa8821f[_0xa8bf('0x96')][_0xa8bf('0x9e')]}})[_0xa8bf('0x21')](function(_0x3d469){if(_0x3d469){_0xa8821f[_0xa8bf('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3d469[_0xa8bf('0x3d')]+','+(_0xa8821f[_0xa8bf('0x8d')][_0xa8bf('0xa0')]||0xa),'interval':'*,*,*,*'});_0xa8821f['forcedOwnership']=![];}return respondWithRpcPromise(_0xa8bf('0xa1'),_0xa8bf('0xa2'),_0xa8821f);});}return respondWithRpcPromise(_0xa8bf('0xa1'),_0xa8bf('0xa2'),_0xa8821f);})['then'](function(_0x242295){respondWithRpcPromise(_0xa8bf('0xa3'),_0xa8bf('0xa3'),{'event':_0xa8bf('0x72'),'message':_0x242295},client9002);return _0x242295;})['then'](respondWithResult(_0x1f1a5d,null))[_0xa8bf('0x2b')](handleError(_0x1f1a5d,null));};exports['addApplications']=function(_0x35b7c2,_0x221f22,_0x2037dd){return db[_0xa8bf('0x42')][_0xa8bf('0x6b')]({'where':{'id':_0x35b7c2['params']['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x221f22,null))['then'](function(_0x4abf1e){if(_0x4abf1e){return db[_0xa8bf('0xa4')][_0xa8bf('0xa5')](function(_0x1e984e){return db[_0xa8bf('0x87')][_0xa8bf('0x3b')]({'where':{'OpenchannelAccountId':_0x35b7c2[_0xa8bf('0x58')]['id']},'transaction':_0x1e984e})[_0xa8bf('0x21')](function(_0x26c6cd){var _0x3dc08d=_[_0xa8bf('0x41')](_0x35b7c2[_0xa8bf('0x5e')],function(_0x210c76){_0x210c76['OpenchannelAccountId']=_0x35b7c2['params']['id'];return _0x210c76;});return db['OpenchannelApplication']['bulkCreate'](_0x3dc08d,{'transaction':_0x1e984e});});})['then'](function(){return db[_0xa8bf('0x87')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x35b7c2[_0xa8bf('0x58')]['id']},'order':'priority'});});}})[_0xa8bf('0x21')](respondWithResult(_0x221f22,null))[_0xa8bf('0x2b')](handleError(_0x221f22,null));};exports[_0xa8bf('0xa6')]=function(_0x520509,_0x264ff8,_0x1faa35){var _0x2b977d={};var _0x2611af={};var _0x30b717;var _0x2c7151;return db[_0xa8bf('0x42')][_0xa8bf('0x6b')]({'where':{'id':_0x520509[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x264ff8,null))[_0xa8bf('0x21')](function(_0x4b02e4){if(_0x4b02e4){_0x30b717=_0x4b02e4;_0x2611af['model']=_[_0xa8bf('0x47')](db[_0xa8bf('0x87')]['rawAttributes']);_0x2611af[_0xa8bf('0x46')]=_['keys'](_0x520509[_0xa8bf('0x46')]);_0x2611af[_0xa8bf('0x48')]=_[_0xa8bf('0x49')](_0x2611af[_0xa8bf('0x45')],_0x2611af[_0xa8bf('0x46')]);_0x2b977d[_0xa8bf('0x4a')]=_[_0xa8bf('0x49')](_0x2611af[_0xa8bf('0x45')],qs[_0xa8bf('0x4b')](_0x520509[_0xa8bf('0x46')][_0xa8bf('0x4b')]));_0x2b977d[_0xa8bf('0x4a')]=_0x2b977d[_0xa8bf('0x4a')][_0xa8bf('0x4c')]?_0x2b977d['attributes']:_0x2611af[_0xa8bf('0x45')];_0x2b977d[_0xa8bf('0x4e')]=qs[_0xa8bf('0x4f')](_0x520509[_0xa8bf('0x46')][_0xa8bf('0x4f')]);_0x2b977d[_0xa8bf('0x50')]=qs[_0xa8bf('0x48')](_[_0xa8bf('0x51')](_0x520509['query'],_0x2611af[_0xa8bf('0x48')]));if(_0x520509[_0xa8bf('0x46')][_0xa8bf('0x54')]){_0x2b977d[_0xa8bf('0x50')]=_['merge'](_0x2b977d[_0xa8bf('0x50')],{'$or':_[_0xa8bf('0x41')](_0x2b977d[_0xa8bf('0x4a')],function(_0x49bb77){var _0x248d9b={};_0x248d9b[_0x49bb77]={'$like':'%'+_0x520509[_0xa8bf('0x46')][_0xa8bf('0x54')]+'%'};return _0x248d9b;})});}_0x2b977d=_[_0xa8bf('0x52')]({},_0x2b977d,_0x520509['options']);return _0x30b717[_0xa8bf('0xa6')](_0x2b977d);}})['then'](function(_0x59356e){if(_0x59356e){_0x2c7151=_0x59356e['length'];if(!_0x520509['query']['hasOwnProperty'](_0xa8bf('0x4d'))){_0x2b977d[_0xa8bf('0x30')]=qs[_0xa8bf('0x30')](_0x520509[_0xa8bf('0x46')]['limit']);_0x2b977d[_0xa8bf('0x33')]=qs['offset'](_0x520509[_0xa8bf('0x46')]['offset']);}return _0x30b717[_0xa8bf('0xa6')](_0x2b977d);}})[_0xa8bf('0x21')](function(_0x463ac7){if(_0x463ac7){return _0x463ac7?{'count':_0x2c7151,'rows':_0x463ac7}:null;}})['then'](respondWithResult(_0x264ff8,null))[_0xa8bf('0x2b')](handleError(_0x264ff8,null));};exports['getInteractions']=function(_0x4bc3c9,_0xe7b9db,_0x1a6551){var _0x474204={'raw':![],'where':{}};var _0x1bc3e6={};var _0x457b6a={'count':0x0,'rows':[]};return db[_0xa8bf('0x42')][_0xa8bf('0x6b')]({'where':{'id':_0x4bc3c9['params']['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0xe7b9db,null))[_0xa8bf('0x21')](function(_0x12bb87){if(_0x12bb87){_0x1bc3e6[_0xa8bf('0x45')]=_[_0xa8bf('0x47')](db[_0xa8bf('0x93')][_0xa8bf('0x59')]);_0x1bc3e6['query']=_[_0xa8bf('0x47')](_0x4bc3c9[_0xa8bf('0x46')]);_0x1bc3e6[_0xa8bf('0x48')]=_[_0xa8bf('0x49')](_0x1bc3e6[_0xa8bf('0x45')],_0x1bc3e6[_0xa8bf('0x46')]);_0x474204[_0xa8bf('0x4a')]=_[_0xa8bf('0x49')](_0x1bc3e6['model'],qs['fields'](_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0x4b')]));_0x474204[_0xa8bf('0x4a')]=_0x474204['attributes'][_0xa8bf('0x4c')]?_0x474204[_0xa8bf('0x4a')]:_0x1bc3e6[_0xa8bf('0x45')];if(!_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0x6c')](_0xa8bf('0x4d'))){_0x474204['limit']=qs[_0xa8bf('0x30')](_0x4bc3c9[_0xa8bf('0x46')]['limit']);_0x474204[_0xa8bf('0x33')]=qs[_0xa8bf('0x33')](_0x4bc3c9['query'][_0xa8bf('0x33')]);}_0x474204[_0xa8bf('0x4e')]=qs['sort'](_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0x4f')]);_0x474204['where']=qs['filters'](_[_0xa8bf('0x51')](_0x4bc3c9['query'],_0x1bc3e6[_0xa8bf('0x48')]));_0x474204[_0xa8bf('0x50')][_0xa8bf('0x68')]=_0x12bb87['id'];if(_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0x54')]){_0x474204[_0xa8bf('0x50')]=_[_0xa8bf('0x52')](_0x474204[_0xa8bf('0x50')],{'$or':_[_0xa8bf('0x41')](_0x474204[_0xa8bf('0x4a')],function(_0xd374f){var _0x3954d7={};_0x3954d7[_0xd374f]={'$like':'%'+_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0x54')]+'%'};return _0x3954d7;})});}_0x474204=_[_0xa8bf('0x52')]({},_0x474204,_0x4bc3c9[_0xa8bf('0x5b')]);return db['OpenchannelInteraction']['count']({'where':_0x474204[_0xa8bf('0x50')]})[_0xa8bf('0x21')](function(_0x6c6f4b){_0x457b6a['count']=_0x6c6f4b;if(_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0x55')]){_0x474204[_0xa8bf('0x5a')]=[{'model':db[_0xa8bf('0x74')],'as':_0xa8bf('0xa7'),'required':![]},{'model':db[_0xa8bf('0x9f')],'as':'Owner','attributes':[_0xa8bf('0x3d'),_0xa8bf('0xa8'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa8bf('0x3d'),_0xa8bf('0xa9')],'where':_0x4bc3c9['query'][_0xa8bf('0xaa')]?{'id':_0x4bc3c9['query'][_0xa8bf('0xaa')]}:undefined,'required':_0x4bc3c9[_0xa8bf('0x46')][_0xa8bf('0xaa')]?!![]:![]}];}return db[_0xa8bf('0x93')][_0xa8bf('0x6d')](_0x474204);})[_0xa8bf('0x21')](function(_0x4f2151){_0x457b6a[_0xa8bf('0x56')]=_0x4f2151;return _0x457b6a;});}})[_0xa8bf('0x21')](respondWithFilteredResult(_0xe7b9db,_0x474204))['catch'](handleError(_0xe7b9db,null));};exports[_0xa8bf('0xab')]=function(_0x55152c,_0x33554c,_0x4d408f){return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x55152c[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x33554c,null))['then'](function(_0x18fde8){if(_0x18fde8){return _0x18fde8['addAgents'](_0x55152c[_0xa8bf('0x5e')]['ids'],_['omit'](_0x55152c[_0xa8bf('0x5e')],['ids','id'])||{})[_0xa8bf('0xac')](function(_0x2f5d3a){for(var _0x34c229=0x0;_0x34c229<_0x55152c[_0xa8bf('0x5e')][_0xa8bf('0x6e')]['length'];_0x34c229+=0x1){socket[_0xa8bf('0xad')](_0xa8bf('0xae'),{'UserId':Number(_0x55152c[_0xa8bf('0x5e')][_0xa8bf('0x6e')][_0x34c229]),'OpenchannelAccountId':Number(_0x55152c[_0xa8bf('0x58')]['id'])});}return _0x2f5d3a;});}})['then'](respondWithResult(_0x33554c,null))[_0xa8bf('0x2b')](handleError(_0x33554c,null));};exports[_0xa8bf('0xaf')]=function(_0x456981,_0x2d812d,_0x306d54){return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x456981[_0xa8bf('0x58')]['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0x2d812d,null))[_0xa8bf('0x21')](function(_0x54ea9e){if(_0x54ea9e){return _0x54ea9e[_0xa8bf('0xaf')](_0x456981[_0xa8bf('0x46')][_0xa8bf('0x6e')])[_0xa8bf('0x21')](function(){if(_['isArray'](_0x456981['query'][_0xa8bf('0x6e')])){for(var _0x2b08ae=0x0;_0x2b08ae<_0x456981[_0xa8bf('0x46')][_0xa8bf('0x6e')][_0xa8bf('0x4c')];_0x2b08ae+=0x1){socket[_0xa8bf('0xad')](_0xa8bf('0xb0'),{'UserId':Number(_0x456981[_0xa8bf('0x46')][_0xa8bf('0x6e')][_0x2b08ae]),'OpenchannelAccountId':Number(_0x456981[_0xa8bf('0x58')]['id'])});}}else{socket['emit'](_0xa8bf('0xb0'),{'UserId':Number(_0x456981[_0xa8bf('0x46')][_0xa8bf('0x6e')]),'OpenchannelAccountId':Number(_0x456981[_0xa8bf('0x58')]['id'])});}});}})[_0xa8bf('0x21')](respondWithStatusCode(_0x2d812d,null))['catch'](handleError(_0x2d812d,null));};exports[_0xa8bf('0xb1')]=function(_0x784fd1,_0xa7eac0,_0x3b750b){var _0x183316={};var _0x4362df={};var _0x32c0ee;var _0x50a96a;return db[_0xa8bf('0x42')][_0xa8bf('0x6b')]({'where':{'id':_0x784fd1['params']['id']}})[_0xa8bf('0x21')](handleEntityNotFound(_0xa7eac0,null))[_0xa8bf('0x21')](function(_0x15ab7f){if(_0x15ab7f){_0x32c0ee=_0x15ab7f;_0x4362df[_0xa8bf('0x45')]=_['keys'](db[_0xa8bf('0x9f')][_0xa8bf('0x59')]);_0x4362df[_0xa8bf('0x46')]=_[_0xa8bf('0x47')](_0x784fd1[_0xa8bf('0x46')]);_0x4362df[_0xa8bf('0x48')]=_[_0xa8bf('0x49')](_0x4362df[_0xa8bf('0x45')],_0x4362df['query']);_0x183316[_0xa8bf('0x4a')]=_[_0xa8bf('0x49')](_0x4362df[_0xa8bf('0x45')],qs['fields'](_0x784fd1['query'][_0xa8bf('0x4b')]));_0x183316[_0xa8bf('0x4a')]=_0x183316[_0xa8bf('0x4a')][_0xa8bf('0x4c')]?_0x183316[_0xa8bf('0x4a')]:_0x4362df[_0xa8bf('0x45')];_0x183316['order']=qs[_0xa8bf('0x4f')](_0x784fd1[_0xa8bf('0x46')]['sort']);_0x183316[_0xa8bf('0x50')]=qs[_0xa8bf('0x48')](_[_0xa8bf('0x51')](_0x784fd1[_0xa8bf('0x46')],_0x4362df['filters']));if(_0x784fd1[_0xa8bf('0x46')][_0xa8bf('0x54')]){_0x183316['where']=_[_0xa8bf('0x52')](_0x183316[_0xa8bf('0x50')],{'$or':_[_0xa8bf('0x41')](_0x183316[_0xa8bf('0x4a')],function(_0x30e008){var _0x3792ce={};_0x3792ce[_0x30e008]={'$like':'%'+_0x784fd1['query']['filter']+'%'};return _0x3792ce;})});}_0x183316=_[_0xa8bf('0x52')]({},_0x183316,_0x784fd1[_0xa8bf('0x5b')]);return _0x32c0ee[_0xa8bf('0xb1')](_0x183316);}})[_0xa8bf('0x21')](function(_0x3a54e3){if(_0x3a54e3){_0x50a96a=_0x3a54e3[_0xa8bf('0x4c')];if(!_0x784fd1['query'][_0xa8bf('0x6c')]('nolimit')){_0x183316['limit']=qs[_0xa8bf('0x30')](_0x784fd1['query']['limit']);_0x183316['offset']=qs[_0xa8bf('0x33')](_0x784fd1[_0xa8bf('0x46')]['offset']);}return _0x32c0ee[_0xa8bf('0xb1')](_0x183316);}})[_0xa8bf('0x21')](function(_0x2646de){if(_0x2646de){return _0x2646de?{'count':_0x50a96a,'rows':_0x2646de}:null;}})['then'](respondWithResult(_0xa7eac0,null))['catch'](handleError(_0xa7eac0,null));};exports[_0xa8bf('0x3e')]=function(_0x2cbbdd,_0x2e8440,_0x268d24){var _0x5d9f9f,_0xbad032,_0x379609;if(_[_0xa8bf('0x7d')](_0x2cbbdd[_0xa8bf('0x5e')][_0xa8bf('0x5e')])||_0x2cbbdd[_0xa8bf('0x5e')][_0xa8bf('0x5e')]===''){throw new db[(_0xa8bf('0x75'))][(_0xa8bf('0x76'))](_0xa8bf('0x80'));}if(_[_0xa8bf('0x7d')](_0x2cbbdd[_0xa8bf('0x5e')]['to'])){}_0x5d9f9f=_0x2cbbdd[_0xa8bf('0x5e')]['to'];return db['OpenchannelAccount'][_0xa8bf('0x6b')]({'where':{'id':_0x2cbbdd[_0xa8bf('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e8440,null))[_0xa8bf('0x21')](function(_0x5b5e53){if(_0x5b5e53){return db[_0xa8bf('0x42')][_0xa8bf('0x5c')]({'where':{'id':_0x5b5e53['id']},'include':[{'model':db[_0xa8bf('0x84')],'as':_0xa8bf('0x85'),'include':[{'model':db[_0xa8bf('0x74')],'as':_0xa8bf('0x8e'),'where':{[_0x5b5e53[_0xa8bf('0x81')]]:_0x5d9f9f},'limit':0x1,'order':[[_0xa8bf('0x79'),_0xa8bf('0x86')]]}]}]})[_0xa8bf('0x21')](handleEntityNotFound(_0x2e8440,null))[_0xa8bf('0x21')](function(_0x47f573){if(_0x47f573&&_0x47f573[_0xa8bf('0x85')]){_0xbad032=_0x47f573[_0xa8bf('0x39')]({'plain':!![]});if(_0xbad032[_0xa8bf('0x85')]&&_0xbad032[_0xa8bf('0x85')][_0xa8bf('0x8e')][_0xa8bf('0x4c')]){return _0xbad032['List'][_0xa8bf('0x8e')][0x0];}return db['CmContact'][_0xa8bf('0x5d')](_[_0xa8bf('0x1c')](_0x2cbbdd[_0xa8bf('0x5e')],{'firstName':_0x5d9f9f,[_0x47f573['mapKey']]:_0x5d9f9f,'phone':_0x5d9f9f,'ListId':_0xbad032[_0xa8bf('0x7c')]}));}})['then'](handleEntityNotFound(_0x2e8440,null))[_0xa8bf('0x21')](function(_0x1ec35b){if(_0x1ec35b){_0x379609=_0x1ec35b;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x379609['id'],'closed':![],'OpenchannelAccountId':_0xbad032['id']}})[_0xa8bf('0x21')](function(_0x52170b){if(_0x52170b){return[_0x52170b,![]];}return db[_0xa8bf('0x93')][_0xa8bf('0x5d')]({'UserId':_0x2cbbdd['user']['id'],'ContactId':_0x379609['id'],'OpenchannelAccountId':_0xbad032['id'],'lastMsgDirection':_0xa8bf('0xb2'),'Messages':[_['merge'](_0x2cbbdd[_0xa8bf('0x5e')],{'read':![],'body':_0x2cbbdd['body'][_0xa8bf('0x5e')],'OpenchannelAccountId':_0xbad032['id'],'UserId':_0x2cbbdd[_0xa8bf('0x5f')]['id'],'ContactId':_0x379609['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xa8bf('0x21')](function(_0x34f963){return[_0x34f963,!![]];});});}})['spread'](function(_0x6c87ad,_0x507221){if(_0x507221){return _0x6c87ad;}return db[_0xa8bf('0x9d')][_0xa8bf('0x5d')](_[_0xa8bf('0x52')](_0x2cbbdd[_0xa8bf('0x5e')],{'read':![],'body':_0x2cbbdd[_0xa8bf('0x5e')][_0xa8bf('0x5e')],'OpenchannelAccountId':_0xbad032['id'],'OpenchannelInteractionId':_0x6c87ad['id'],'UserId':_0x2cbbdd[_0xa8bf('0x5f')]['id'],'ContactId':_0x379609['id']}))[_0xa8bf('0x21')](function(_0x4fe993){_0x6c87ad[_0xa8bf('0xb3')]['Messages']=[];_0x6c87ad[_0xa8bf('0xb3')][_0xa8bf('0xb4')][_0xa8bf('0x99')](_0x4fe993[_0xa8bf('0xb3')]);return _0x6c87ad;});});}})[_0xa8bf('0x21')](respondWithResult(_0x2e8440,null))[_0xa8bf('0x2b')](handleError(_0x2e8440,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index be69636..68aa703 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 _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x350034,_0x341770){var _0x303eb4=function(_0x306295){while(--_0x306295){_0x350034['push'](_0x350034['shift']());}};_0x303eb4(++_0x341770);}(_0x5b02,0xe9));var _0x25b0=function(_0x4e7a8b,_0x876ad1){_0x4e7a8b=_0x4e7a8b-0x0;var _0xb02368=_0x5b02[_0x4e7a8b];return _0xb02368;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x5ff3=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','remove'];(function(_0xe9bff1,_0x4afb63){var _0x3794bd=function(_0x4325a2){while(--_0x4325a2){_0xe9bff1['push'](_0xe9bff1['shift']());}};_0x3794bd(++_0x4afb63);}(_0x5ff3,0x17d));var _0x35ff=function(_0x461318,_0x519af0){_0x461318=_0x461318-0x0;var _0x5e5639=_0x5ff3[_0x461318];return _0x5e5639;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x35ff('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x35ff('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35ff('0x2'),'afterDestroy':_0x35ff('0x3')};function emitEvent(_0x3bd66a){return function(_0xd0846d,_0x551514,_0x2fcb74){OpenchannelAccountEvents[_0x35ff('0x4')](_0x3bd66a+':'+_0xd0846d['id'],_0xd0846d);OpenchannelAccountEvents[_0x35ff('0x4')](_0x3bd66a,_0xd0846d);_0x2fcb74(null);};}for(var e in events){if(events[_0x35ff('0x5')](e)){var event=events[e];OpenchannelAccount[_0x35ff('0x6')](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 b1adbdd..b6e03a7 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(_0x1bd181,_0x25eeda){var _0x2d9b67=function(_0xa95afc){while(--_0xa95afc){_0x1bd181['push'](_0x1bd181['shift']());}};_0x2d9b67(++_0x25eeda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x2f8bf1,_0x2d421c){var _0x45de4c=function(_0x1a8bb9){while(--_0x1a8bb9){_0x2f8bf1['push'](_0x2f8bf1['shift']());}};_0x45de4c(++_0x2d421c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 8b2d32e..1a90171 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 _0xb574=['info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x3b93da,_0x31c981){var _0x293266=function(_0x639d67){while(--_0x639d67){_0x3b93da['push'](_0x3b93da['shift']());}};_0x293266(++_0x31c981);}(_0xb574,0x106));var _0x4b57=function(_0x2536cc,_0x2adbb6){_0x2536cc=_0x2536cc-0x0;var _0x1e1edf=_0xb574[_0x2536cc];return _0x1e1edf;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config[_0x4b57('0xb')]));require(_0x4b57('0xc'))[_0x4b57('0xd')](socket);function respondWithRpcPromise(_0xce47ad,_0x116958,_0x1db79a){return new BPromise(function(_0x43b108,_0x5593b8){return client[_0x4b57('0xe')](_0xce47ad,_0x1db79a)[_0x4b57('0xf')](function(_0x274912){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x4b57('0x10'));logger[_0x4b57('0x11')](_0x4b57('0x12'),_0x116958,_0x4b57('0x10'),JSON[_0x4b57('0x13')](_0x274912));if(_0x274912[_0x4b57('0x14')]){if(_0x274912[_0x4b57('0x14')][_0x4b57('0x15')]===0x1f4){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x5593b8(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}logger['error'](_0x4b57('0x17'),_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x43b108(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}else{logger[_0x4b57('0x18')](_0x4b57('0x17'),_0x116958,_0x4b57('0x10'));_0x43b108(_0x274912['result'][_0x4b57('0x16')]);}})[_0x4b57('0x19')](function(_0x53f29a){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x53f29a);_0x5593b8(_0x53f29a);});});} \ No newline at end of file +var _0x6599=['request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','register','then','info','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x11d10f,_0x275d65){var _0x4f3a86=function(_0x32bc32){while(--_0x32bc32){_0x11d10f['push'](_0x11d10f['shift']());}};_0x4f3a86(++_0x275d65);}(_0x6599,0xb0));var _0x9659=function(_0x5d5bcb,_0x25e2ea){_0x5d5bcb=_0x5d5bcb-0x0;var _0x4ea5eb=_0x6599[_0x5d5bcb];return _0x4ea5eb;};'use strict';var _=require('lodash');var util=require(_0x9659('0x0'));var moment=require(_0x9659('0x1'));var BPromise=require(_0x9659('0x2'));var rs=require(_0x9659('0x3'));var fs=require('fs');var Redis=require(_0x9659('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9659('0x5'));var logger=require('../../config/logger')(_0x9659('0x6'));var config=require('../../config/environment');var jayson=require(_0x9659('0x7'));var client=jayson[_0x9659('0x8')][_0x9659('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9659('0xa')],{'host':_0x9659('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9659('0xa')]));require('./openchannelAccount.socket')[_0x9659('0xc')](socket);function respondWithRpcPromise(_0x194d48,_0x58552a,_0x147cac){return new BPromise(function(_0x25a460,_0x349cfb){return client['request'](_0x194d48,_0x147cac)[_0x9659('0xd')](function(_0x520848){logger[_0x9659('0xe')](_0x9659('0xf'),_0x58552a,_0x9659('0x10'));logger['debug'](_0x9659('0x11'),_0x58552a,_0x9659('0x10'),JSON[_0x9659('0x12')](_0x520848));if(_0x520848[_0x9659('0x13')]){if(_0x520848[_0x9659('0x13')][_0x9659('0x14')]===0x1f4){logger[_0x9659('0x13')](_0x9659('0xf'),_0x58552a,_0x520848[_0x9659('0x13')][_0x9659('0x15')]);return _0x349cfb(_0x520848[_0x9659('0x13')][_0x9659('0x15')]);}logger[_0x9659('0x13')](_0x9659('0xf'),_0x58552a,_0x520848['error'][_0x9659('0x15')]);return _0x25a460(_0x520848[_0x9659('0x13')][_0x9659('0x15')]);}else{logger[_0x9659('0xe')](_0x9659('0xf'),_0x58552a,_0x9659('0x10'));_0x25a460(_0x520848[_0x9659('0x16')][_0x9659('0x15')]);}})[_0x9659('0x17')](function(_0x525d27){logger[_0x9659('0x13')](_0x9659('0xf'),_0x58552a,_0x525d27);_0x349cfb(_0x525d27);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9d89d24..b9eca4d 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 _0x24a6=['remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x318ef6,_0x211170){var _0x14b48d=function(_0x34c263){while(--_0x34c263){_0x318ef6['push'](_0x318ef6['shift']());}};_0x14b48d(++_0x211170);}(_0x24a6,0x14f));var _0x624a=function(_0x1be8ad,_0x2fff4b){_0x1be8ad=_0x1be8ad-0x0;var _0x547286=_0x24a6[_0x1be8ad];return _0x547286;};'use strict';var OpenchannelAccountEvents=require(_0x624a('0x0'));var events=['save',_0x624a('0x1'),_0x624a('0x2')];function createListener(_0x1d3f5e,_0x346672){return function(_0x3074cb){_0x346672[_0x624a('0x3')](_0x1d3f5e,_0x3074cb);};}function removeListener(_0x389f10,_0x1355d3){return function(){OpenchannelAccountEvents[_0x624a('0x4')](_0x389f10,_0x1355d3);};}exports[_0x624a('0x5')]=function(_0x14fc3e){for(var _0x325aea=0x0,_0x1af370=events[_0x624a('0x6')];_0x325aea<_0x1af370;_0x325aea++){var _0x58243=events[_0x325aea];var _0x40cb85=createListener(_0x624a('0x7')+_0x58243,_0x14fc3e);OpenchannelAccountEvents['on'](_0x58243,_0x40cb85);}}; \ No newline at end of file +var _0x7834=['openchannelAccount:','./openchannelAccount.events','update','emit','removeListener','register'];(function(_0x1d620c,_0x174282){var _0x57e44f=function(_0x2eb0e4){while(--_0x2eb0e4){_0x1d620c['push'](_0x1d620c['shift']());}};_0x57e44f(++_0x174282);}(_0x7834,0x13f));var _0x4783=function(_0x361b7e,_0x2d6399){_0x361b7e=_0x361b7e-0x0;var _0x37448e=_0x7834[_0x361b7e];return _0x37448e;};'use strict';var OpenchannelAccountEvents=require(_0x4783('0x0'));var events=['save','remove',_0x4783('0x1')];function createListener(_0x51b60a,_0x15dbb4){return function(_0x30c3ee){_0x15dbb4[_0x4783('0x2')](_0x51b60a,_0x30c3ee);};}function removeListener(_0x2ebef6,_0x29566c){return function(){OpenchannelAccountEvents[_0x4783('0x3')](_0x2ebef6,_0x29566c);};}exports[_0x4783('0x4')]=function(_0x49114c){for(var _0x1cb674=0x0,_0xf8c030=events['length'];_0x1cb674<_0xf8c030;_0x1cb674++){var _0x2dcf46=events[_0x1cb674];var _0x16c83e=createListener(_0x4783('0x5')+_0x2dcf46,_0x49114c);OpenchannelAccountEvents['on'](_0x2dcf46,_0x16c83e);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 78d6d33..ce4f385 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 _0x4ac2=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x40f38b,_0x22bcd2){var _0x5486c1=function(_0x56c4d4){while(--_0x56c4d4){_0x40f38b['push'](_0x40f38b['shift']());}};_0x5486c1(++_0x22bcd2);}(_0x4ac2,0x18c));var _0x24ac=function(_0x3c6bd3,_0x5345b5){_0x3c6bd3=_0x3c6bd3-0x0;var _0x375496=_0x4ac2[_0x3c6bd3];return _0x375496;};'use strict';var multer=require(_0x24ac('0x0'));var util=require(_0x24ac('0x1'));var path=require(_0x24ac('0x2'));var timeout=require(_0x24ac('0x3'));var express=require(_0x24ac('0x4'));var router=express[_0x24ac('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x24ac('0x6'));var interaction=require(_0x24ac('0x7'));var config=require(_0x24ac('0x8'));var controller=require('./openchannelApplication.controller');router[_0x24ac('0x9')]('/',auth['isAuthenticated'](),controller[_0x24ac('0xa')]);router['get']('/:id',auth[_0x24ac('0xb')](),controller[_0x24ac('0xc')]);router[_0x24ac('0xd')]('/',auth[_0x24ac('0xb')](),controller[_0x24ac('0xe')]);router[_0x24ac('0xf')](_0x24ac('0x10'),auth[_0x24ac('0xb')](),controller[_0x24ac('0x11')]);router[_0x24ac('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x24ac('0x13')]);module[_0x24ac('0x14')]=router; \ No newline at end of file +var _0x3cb1=['fs-extra','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3985a9,_0x3e1edb){var _0x40bdc6=function(_0x5c3b44){while(--_0x5c3b44){_0x3985a9['push'](_0x3985a9['shift']());}};_0x40bdc6(++_0x3e1edb);}(_0x3cb1,0x17a));var _0x13cb=function(_0x5493f2,_0x1c70c5){_0x5493f2=_0x5493f2-0x0;var _0x5bee6d=_0x3cb1[_0x5493f2];return _0x5bee6d;};'use strict';var multer=require(_0x13cb('0x0'));var util=require(_0x13cb('0x1'));var path=require(_0x13cb('0x2'));var timeout=require(_0x13cb('0x3'));var express=require(_0x13cb('0x4'));var router=express[_0x13cb('0x5')]();var fs_extra=require(_0x13cb('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13cb('0x7'));var controller=require(_0x13cb('0x8'));router['get']('/',auth[_0x13cb('0x9')](),controller[_0x13cb('0xa')]);router[_0x13cb('0xb')](_0x13cb('0xc'),auth[_0x13cb('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x13cb('0x9')](),controller[_0x13cb('0xd')]);router[_0x13cb('0xe')](_0x13cb('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x13cb('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index a2dc6e1..f2d766e 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 _0xf0aa=['exports','STRING','*,*,*,*','sequelize'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xf0aa,0x1b3));var _0xaf0a=function(_0x3c03fc,_0x490c2f){_0x3c03fc=_0x3c03fc-0x0;var _0xbb13a3=_0xf0aa[_0x3c03fc];return _0xbb13a3;};'use strict';var Sequelize=require(_0xaf0a('0x0'));module[_0xaf0a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xaf0a('0x2')]},'interval':{'type':Sequelize[_0xaf0a('0x2')],'defaultValue':_0xaf0a('0x3')}}; \ No newline at end of file +var _0x4895=['STRING','*,*,*,*','sequelize','exports','TEXT'];(function(_0x3b6e65,_0xda3bc2){var _0x2ad661=function(_0x3cbb72){while(--_0x3cbb72){_0x3b6e65['push'](_0x3b6e65['shift']());}};_0x2ad661(++_0xda3bc2);}(_0x4895,0x1a6));var _0x5489=function(_0x4580f4,_0x5d01a7){_0x4580f4=_0x4580f4-0x0;var _0x528053=_0x4895[_0x4580f4];return _0x528053;};'use strict';var Sequelize=require(_0x5489('0x0'));module[_0x5489('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5489('0x2')]()},'description':{'type':Sequelize[_0x5489('0x3')]},'interval':{'type':Sequelize[_0x5489('0x3')],'defaultValue':_0x5489('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 1601483..a7ac823 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 _0x2d84=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','stack','name','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x2d84,0x82));var _0x42d8=function(_0x1c17f4,_0x302229){_0x1c17f4=_0x1c17f4-0x0;var _0x518c10=_0x2d84[_0x1c17f4];return _0x518c10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42d8('0x0'));var zipdir=require(_0x42d8('0x1'));var jsonpatch=require(_0x42d8('0x2'));var rp=require(_0x42d8('0x3'));var moment=require(_0x42d8('0x4'));var BPromise=require(_0x42d8('0x5'));var Mustache=require(_0x42d8('0x6'));var util=require('util');var path=require(_0x42d8('0x7'));var sox=require(_0x42d8('0x8'));var csv=require(_0x42d8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42d8('0xa'));var squel=require(_0x42d8('0xb'));var crypto=require(_0x42d8('0xc'));var jsforce=require(_0x42d8('0xd'));var deskjs=require(_0x42d8('0xe'));var toCsv=require(_0x42d8('0x9'));var querystring=require(_0x42d8('0xf'));var Papa=require(_0x42d8('0x10'));var Redis=require('ioredis');var authService=require(_0x42d8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x42d8('0x12'));var hardwareService=require(_0x42d8('0x13'));var logger=require(_0x42d8('0x14'))('api');var utils=require(_0x42d8('0x15'));var config=require(_0x42d8('0x16'));var licenseUtil=require(_0x42d8('0x17'));var db=require(_0x42d8('0x18'))['db'];function respondWithStatusCode(_0x2438da,_0xa2b726){_0xa2b726=_0xa2b726||0xcc;return function(_0x16e4c6){if(_0x16e4c6){return _0x2438da[_0x42d8('0x19')](_0xa2b726);}return _0x2438da[_0x42d8('0x1a')](_0xa2b726)[_0x42d8('0x1b')]();};}function respondWithResult(_0x330110,_0x3cd3c9){_0x3cd3c9=_0x3cd3c9||0xc8;return function(_0x4ad123){if(_0x4ad123){return _0x330110['status'](_0x3cd3c9)[_0x42d8('0x1c')](_0x4ad123);}};}function respondWithFilteredResult(_0x555a9b,_0x4fe7fb){return function(_0x517c50){if(_0x517c50){var _0x41f448=typeof _0x4fe7fb[_0x42d8('0x1d')]==='undefined'&&typeof _0x4fe7fb[_0x42d8('0x1e')]===_0x42d8('0x1f');var _0x192f3e=_0x517c50[_0x42d8('0x20')];var _0xcede57=_0x41f448?0x0:_0x4fe7fb[_0x42d8('0x1d')];var _0x45b2d8=_0x41f448?_0x517c50['count']:_0x4fe7fb['offset']+_0x4fe7fb[_0x42d8('0x1e')];var _0xb60fce;if(_0x45b2d8>=_0x192f3e){_0x45b2d8=_0x192f3e;_0xb60fce=0xc8;}else{_0xb60fce=0xce;}_0x555a9b[_0x42d8('0x1a')](_0xb60fce);return _0x555a9b['set'](_0x42d8('0x21'),_0xcede57+'-'+_0x45b2d8+'/'+_0x192f3e)[_0x42d8('0x1c')](_0x517c50);}return null;};}function patchUpdates(_0x385efb){return function(_0x48589a){try{jsonpatch[_0x42d8('0x22')](_0x48589a,_0x385efb,!![]);}catch(_0x11c339){return BPromise[_0x42d8('0x23')](_0x11c339);}return _0x48589a['save']();};}function saveUpdates(_0x57bdd0,_0x42bf27){return function(_0x4d9249){if(_0x4d9249){return _0x4d9249['update'](_0x57bdd0)[_0x42d8('0x24')](function(_0x2aaa56){return _0x2aaa56;});}return null;};}function removeEntity(_0x24af2d,_0x150404){return function(_0x17dcd8){if(_0x17dcd8){return _0x17dcd8[_0x42d8('0x25')]()[_0x42d8('0x24')](function(){_0x24af2d[_0x42d8('0x1a')](0xcc)[_0x42d8('0x1b')]();});}};}function handleEntityNotFound(_0x4760c2,_0x5a9a22){return function(_0x1bf0a1){if(!_0x1bf0a1){_0x4760c2[_0x42d8('0x19')](0x194);}return _0x1bf0a1;};}function handleError(_0x38ebd1,_0x128113){_0x128113=_0x128113||0x1f4;return function(_0x285e6d){logger['error'](_0x285e6d[_0x42d8('0x26')]);if(_0x285e6d[_0x42d8('0x27')]){delete _0x285e6d[_0x42d8('0x27')];}_0x38ebd1[_0x42d8('0x1a')](_0x128113)['send'](_0x285e6d);};}exports['index']=function(_0x27ce3f,_0x5279d4){var _0x5449fc={},_0x2e5ffc={},_0xeda358={'count':0x0,'rows':[]};var _0x29b2ca=_[_0x42d8('0x28')](db[_0x42d8('0x29')][_0x42d8('0x2a')],function(_0x12a76f){return{'name':_0x12a76f[_0x42d8('0x2b')],'type':_0x12a76f['type'][_0x42d8('0x2c')]};});_0x2e5ffc[_0x42d8('0x2d')]=_[_0x42d8('0x28')](_0x29b2ca,_0x42d8('0x27'));_0x2e5ffc['query']=_['keys'](_0x27ce3f[_0x42d8('0x2e')]);_0x2e5ffc['filters']=_[_0x42d8('0x2f')](_0x2e5ffc[_0x42d8('0x2d')],_0x2e5ffc[_0x42d8('0x2e')]);_0x5449fc[_0x42d8('0x30')]=_[_0x42d8('0x2f')](_0x2e5ffc[_0x42d8('0x2d')],qs[_0x42d8('0x31')](_0x27ce3f[_0x42d8('0x2e')]['fields']));_0x5449fc[_0x42d8('0x30')]=_0x5449fc['attributes'][_0x42d8('0x32')]?_0x5449fc[_0x42d8('0x30')]:_0x2e5ffc[_0x42d8('0x2d')];if(!_0x27ce3f[_0x42d8('0x2e')]['hasOwnProperty'](_0x42d8('0x33'))){_0x5449fc[_0x42d8('0x1e')]=qs['limit'](_0x27ce3f['query'][_0x42d8('0x1e')]);_0x5449fc[_0x42d8('0x1d')]=qs[_0x42d8('0x1d')](_0x27ce3f['query'][_0x42d8('0x1d')]);}_0x5449fc[_0x42d8('0x34')]=qs[_0x42d8('0x35')](_0x27ce3f[_0x42d8('0x2e')][_0x42d8('0x35')]);_0x5449fc['where']=qs[_0x42d8('0x36')](_['pick'](_0x27ce3f[_0x42d8('0x2e')],_0x2e5ffc[_0x42d8('0x36')]),_0x29b2ca);if(_0x27ce3f[_0x42d8('0x2e')][_0x42d8('0x37')]){_0x5449fc[_0x42d8('0x38')]=_[_0x42d8('0x39')](_0x5449fc[_0x42d8('0x38')],{'$or':_[_0x42d8('0x28')](_0x29b2ca,function(_0xdbed2d){if(_0xdbed2d[_0x42d8('0x3a')]!==_0x42d8('0x3b')){var _0x2f57df={};_0x2f57df[_0xdbed2d[_0x42d8('0x27')]]={'$like':'%'+_0x27ce3f[_0x42d8('0x2e')][_0x42d8('0x37')]+'%'};return _0x2f57df;}})});}_0x5449fc=_[_0x42d8('0x39')]({},_0x5449fc,_0x27ce3f['options']);var _0xbee1c7={'where':_0x5449fc[_0x42d8('0x38')]};return db[_0x42d8('0x29')][_0x42d8('0x20')](_0xbee1c7)['then'](function(_0x5da03e){_0xeda358['count']=_0x5da03e;if(_0x27ce3f['query'][_0x42d8('0x3c')]){_0x5449fc[_0x42d8('0x3d')]=[{'all':!![]}];}return db[_0x42d8('0x29')][_0x42d8('0x3e')](_0x5449fc);})[_0x42d8('0x24')](function(_0x5e79d3){_0xeda358[_0x42d8('0x3f')]=_0x5e79d3;return _0xeda358;})['then'](respondWithFilteredResult(_0x5279d4,_0x5449fc))['catch'](handleError(_0x5279d4,null));};exports['show']=function(_0x49374b,_0x428eda){var _0x519c80={'raw':!![],'where':{'id':_0x49374b[_0x42d8('0x40')]['id']}},_0x57cdf0={};_0x57cdf0[_0x42d8('0x2d')]=_[_0x42d8('0x41')](db[_0x42d8('0x29')][_0x42d8('0x2a')]);_0x57cdf0['query']=_[_0x42d8('0x41')](_0x49374b[_0x42d8('0x2e')]);_0x57cdf0[_0x42d8('0x36')]=_[_0x42d8('0x2f')](_0x57cdf0['model'],_0x57cdf0[_0x42d8('0x2e')]);_0x519c80[_0x42d8('0x30')]=_['intersection'](_0x57cdf0[_0x42d8('0x2d')],qs[_0x42d8('0x31')](_0x49374b[_0x42d8('0x2e')][_0x42d8('0x31')]));_0x519c80[_0x42d8('0x30')]=_0x519c80[_0x42d8('0x30')]['length']?_0x519c80[_0x42d8('0x30')]:_0x57cdf0[_0x42d8('0x2d')];if(_0x49374b[_0x42d8('0x2e')][_0x42d8('0x3c')]){_0x519c80[_0x42d8('0x3d')]=[{'all':!![]}];}_0x519c80=_[_0x42d8('0x39')]({},_0x519c80,_0x49374b[_0x42d8('0x42')]);return db['OpenchannelApplication'][_0x42d8('0x43')](_0x519c80)[_0x42d8('0x24')](handleEntityNotFound(_0x428eda,null))[_0x42d8('0x24')](respondWithResult(_0x428eda,null))[_0x42d8('0x44')](handleError(_0x428eda,null));};exports[_0x42d8('0x45')]=function(_0x2f8878,_0x102b5a){return db[_0x42d8('0x29')][_0x42d8('0x45')](_0x2f8878[_0x42d8('0x46')],{})[_0x42d8('0x24')](respondWithResult(_0x102b5a,0xc9))[_0x42d8('0x44')](handleError(_0x102b5a,null));};exports[_0x42d8('0x47')]=function(_0x181fda,_0x1d25d7){if(_0x181fda[_0x42d8('0x46')]['id']){delete _0x181fda[_0x42d8('0x46')]['id'];}return db[_0x42d8('0x29')][_0x42d8('0x43')]({'where':{'id':_0x181fda[_0x42d8('0x40')]['id']}})[_0x42d8('0x24')](handleEntityNotFound(_0x1d25d7,null))[_0x42d8('0x24')](saveUpdates(_0x181fda['body'],null))['then'](respondWithResult(_0x1d25d7,null))['catch'](handleError(_0x1d25d7,null));};exports[_0x42d8('0x25')]=function(_0x2b37d5,_0x1a516e){return db['OpenchannelApplication'][_0x42d8('0x43')]({'where':{'id':_0x2b37d5[_0x42d8('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a516e,null))[_0x42d8('0x24')](removeEntity(_0x1a516e,null))[_0x42d8('0x44')](handleError(_0x1a516e,null));}; \ No newline at end of file +var _0x356f=['intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','OpenchannelApplication','includeAll','findAll','catch','show','params','length','include','options','create','body','find','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes'];(function(_0x23d96f,_0x1153b7){var _0x2db681=function(_0x14167c){while(--_0x14167c){_0x23d96f['push'](_0x23d96f['shift']());}};_0x2db681(++_0x1153b7);}(_0x356f,0x13e));var _0xf356=function(_0x2adbef,_0x3ef64f){_0x2adbef=_0x2adbef-0x0;var _0x5df123=_0x356f[_0x2adbef];return _0x5df123;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf356('0x0'));var zipdir=require(_0xf356('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf356('0x2'));var moment=require('moment');var BPromise=require(_0xf356('0x3'));var Mustache=require(_0xf356('0x4'));var util=require(_0xf356('0x5'));var path=require(_0xf356('0x6'));var sox=require(_0xf356('0x7'));var csv=require(_0xf356('0x8'));var ejs=require(_0xf356('0x9'));var fs=require('fs');var fs_extra=require(_0xf356('0xa'));var _=require(_0xf356('0xb'));var squel=require('squel');var crypto=require(_0xf356('0xc'));var jsforce=require(_0xf356('0xd'));var deskjs=require(_0xf356('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf356('0xf'));var Papa=require(_0xf356('0x10'));var Redis=require(_0xf356('0x11'));var authService=require(_0xf356('0x12'));var qs=require(_0xf356('0x13'));var as=require(_0xf356('0x14'));var hardwareService=require(_0xf356('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf356('0x16'));var licenseUtil=require(_0xf356('0x17'));var db=require(_0xf356('0x18'))['db'];function respondWithStatusCode(_0x4a19bf,_0x58d5ea){_0x58d5ea=_0x58d5ea||0xcc;return function(_0x3107f4){if(_0x3107f4){return _0x4a19bf[_0xf356('0x19')](_0x58d5ea);}return _0x4a19bf[_0xf356('0x1a')](_0x58d5ea)[_0xf356('0x1b')]();};}function respondWithResult(_0x589507,_0x5bc759){_0x5bc759=_0x5bc759||0xc8;return function(_0x3a464f){if(_0x3a464f){return _0x589507[_0xf356('0x1a')](_0x5bc759)['json'](_0x3a464f);}};}function respondWithFilteredResult(_0x414626,_0x252fbe){return function(_0x1b7645){if(_0x1b7645){var _0x5d3c71=typeof _0x252fbe[_0xf356('0x1c')]===_0xf356('0x1d')&&typeof _0x252fbe[_0xf356('0x1e')]===_0xf356('0x1d');var _0x467c87=_0x1b7645[_0xf356('0x1f')];var _0x49d60f=_0x5d3c71?0x0:_0x252fbe[_0xf356('0x1c')];var _0x496435=_0x5d3c71?_0x1b7645['count']:_0x252fbe[_0xf356('0x1c')]+_0x252fbe[_0xf356('0x1e')];var _0xce7bf1;if(_0x496435>=_0x467c87){_0x496435=_0x467c87;_0xce7bf1=0xc8;}else{_0xce7bf1=0xce;}_0x414626['status'](_0xce7bf1);return _0x414626[_0xf356('0x20')]('Content-Range',_0x49d60f+'-'+_0x496435+'/'+_0x467c87)[_0xf356('0x21')](_0x1b7645);}return null;};}function patchUpdates(_0x2241e1){return function(_0x86780a){try{jsonpatch[_0xf356('0x22')](_0x86780a,_0x2241e1,!![]);}catch(_0x4f6c64){return BPromise[_0xf356('0x23')](_0x4f6c64);}return _0x86780a['save']();};}function saveUpdates(_0x307e7e,_0x1bdc38){return function(_0x38b68b){if(_0x38b68b){return _0x38b68b[_0xf356('0x24')](_0x307e7e)['then'](function(_0x43beca){return _0x43beca;});}return null;};}function removeEntity(_0x59ac53,_0x480d80){return function(_0x45531b){if(_0x45531b){return _0x45531b[_0xf356('0x25')]()[_0xf356('0x26')](function(){_0x59ac53['status'](0xcc)[_0xf356('0x1b')]();});}};}function handleEntityNotFound(_0x307158,_0x492439){return function(_0x1baf8b){if(!_0x1baf8b){_0x307158[_0xf356('0x19')](0x194);}return _0x1baf8b;};}function handleError(_0x2aed5e,_0x23c228){_0x23c228=_0x23c228||0x1f4;return function(_0x4f053b){logger['error'](_0x4f053b[_0xf356('0x27')]);if(_0x4f053b[_0xf356('0x28')]){delete _0x4f053b[_0xf356('0x28')];}_0x2aed5e[_0xf356('0x1a')](_0x23c228)[_0xf356('0x29')](_0x4f053b);};}exports[_0xf356('0x2a')]=function(_0x127745,_0xc93ff0){var _0x47a03e={},_0x2d1c19={},_0x4a92eb={'count':0x0,'rows':[]};var _0x53784b=_['map'](db['OpenchannelApplication'][_0xf356('0x2b')],function(_0x5f3698){return{'name':_0x5f3698[_0xf356('0x2c')],'type':_0x5f3698[_0xf356('0x2d')][_0xf356('0x2e')]};});_0x2d1c19['model']=_['map'](_0x53784b,'name');_0x2d1c19[_0xf356('0x2f')]=_[_0xf356('0x30')](_0x127745[_0xf356('0x2f')]);_0x2d1c19[_0xf356('0x31')]=_['intersection'](_0x2d1c19[_0xf356('0x32')],_0x2d1c19['query']);_0x47a03e[_0xf356('0x33')]=_[_0xf356('0x34')](_0x2d1c19[_0xf356('0x32')],qs[_0xf356('0x35')](_0x127745[_0xf356('0x2f')][_0xf356('0x35')]));_0x47a03e['attributes']=_0x47a03e['attributes']['length']?_0x47a03e[_0xf356('0x33')]:_0x2d1c19[_0xf356('0x32')];if(!_0x127745[_0xf356('0x2f')][_0xf356('0x36')](_0xf356('0x37'))){_0x47a03e[_0xf356('0x1e')]=qs[_0xf356('0x1e')](_0x127745[_0xf356('0x2f')]['limit']);_0x47a03e[_0xf356('0x1c')]=qs[_0xf356('0x1c')](_0x127745['query'][_0xf356('0x1c')]);}_0x47a03e['order']=qs[_0xf356('0x38')](_0x127745[_0xf356('0x2f')][_0xf356('0x38')]);_0x47a03e[_0xf356('0x39')]=qs['filters'](_[_0xf356('0x3a')](_0x127745[_0xf356('0x2f')],_0x2d1c19[_0xf356('0x31')]),_0x53784b);if(_0x127745['query'][_0xf356('0x3b')]){_0x47a03e[_0xf356('0x39')]=_[_0xf356('0x3c')](_0x47a03e[_0xf356('0x39')],{'$or':_['map'](_0x53784b,function(_0x5ac7c9){if(_0x5ac7c9['type']!==_0xf356('0x3d')){var _0x33cd4a={};_0x33cd4a[_0x5ac7c9[_0xf356('0x28')]]={'$like':'%'+_0x127745['query'][_0xf356('0x3b')]+'%'};return _0x33cd4a;}})});}_0x47a03e=_[_0xf356('0x3c')]({},_0x47a03e,_0x127745['options']);var _0x4905e7={'where':_0x47a03e[_0xf356('0x39')]};return db[_0xf356('0x3e')][_0xf356('0x1f')](_0x4905e7)[_0xf356('0x26')](function(_0xfb16e6){_0x4a92eb[_0xf356('0x1f')]=_0xfb16e6;if(_0x127745[_0xf356('0x2f')][_0xf356('0x3f')]){_0x47a03e['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xf356('0x40')](_0x47a03e);})[_0xf356('0x26')](function(_0x11b9b1){_0x4a92eb['rows']=_0x11b9b1;return _0x4a92eb;})[_0xf356('0x26')](respondWithFilteredResult(_0xc93ff0,_0x47a03e))[_0xf356('0x41')](handleError(_0xc93ff0,null));};exports[_0xf356('0x42')]=function(_0x2e1810,_0x175569){var _0x5d1c7b={'raw':!![],'where':{'id':_0x2e1810[_0xf356('0x43')]['id']}},_0x1d9be0={};_0x1d9be0[_0xf356('0x32')]=_['keys'](db[_0xf356('0x3e')]['rawAttributes']);_0x1d9be0['query']=_[_0xf356('0x30')](_0x2e1810[_0xf356('0x2f')]);_0x1d9be0[_0xf356('0x31')]=_[_0xf356('0x34')](_0x1d9be0[_0xf356('0x32')],_0x1d9be0[_0xf356('0x2f')]);_0x5d1c7b[_0xf356('0x33')]=_[_0xf356('0x34')](_0x1d9be0['model'],qs[_0xf356('0x35')](_0x2e1810[_0xf356('0x2f')][_0xf356('0x35')]));_0x5d1c7b[_0xf356('0x33')]=_0x5d1c7b[_0xf356('0x33')][_0xf356('0x44')]?_0x5d1c7b[_0xf356('0x33')]:_0x1d9be0[_0xf356('0x32')];if(_0x2e1810[_0xf356('0x2f')][_0xf356('0x3f')]){_0x5d1c7b[_0xf356('0x45')]=[{'all':!![]}];}_0x5d1c7b=_[_0xf356('0x3c')]({},_0x5d1c7b,_0x2e1810[_0xf356('0x46')]);return db[_0xf356('0x3e')]['find'](_0x5d1c7b)[_0xf356('0x26')](handleEntityNotFound(_0x175569,null))[_0xf356('0x26')](respondWithResult(_0x175569,null))[_0xf356('0x41')](handleError(_0x175569,null));};exports[_0xf356('0x47')]=function(_0x341a62,_0xaf077e){return db[_0xf356('0x3e')][_0xf356('0x47')](_0x341a62['body'],{})['then'](respondWithResult(_0xaf077e,0xc9))['catch'](handleError(_0xaf077e,null));};exports[_0xf356('0x24')]=function(_0x50ed94,_0x419182){if(_0x50ed94[_0xf356('0x48')]['id']){delete _0x50ed94['body']['id'];}return db[_0xf356('0x3e')][_0xf356('0x49')]({'where':{'id':_0x50ed94[_0xf356('0x43')]['id']}})[_0xf356('0x26')](handleEntityNotFound(_0x419182,null))[_0xf356('0x26')](saveUpdates(_0x50ed94['body'],null))['then'](respondWithResult(_0x419182,null))[_0xf356('0x41')](handleError(_0x419182,null));};exports['destroy']=function(_0x3ca734,_0x3c70de){return db[_0xf356('0x3e')]['find']({'where':{'id':_0x3ca734['params']['id']}})[_0xf356('0x26')](handleEntityNotFound(_0x3c70de,null))['then'](removeEntity(_0x3c70de,null))[_0xf356('0x41')](handleError(_0x3c70de,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 876abdf..21eb4d4 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 _0x77b9=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3a8440,_0x33a6fa){var _0x31df45=function(_0x59a718){while(--_0x59a718){_0x3a8440['push'](_0x3a8440['shift']());}};_0x31df45(++_0x33a6fa);}(_0x77b9,0x132));var _0x977b=function(_0x8feea9,_0x4839fd){_0x8feea9=_0x8feea9-0x0;var _0x1272f1=_0x77b9[_0x8feea9];return _0x1272f1;};'use strict';var _=require(_0x977b('0x0'));var util=require(_0x977b('0x1'));var logger=require(_0x977b('0x2'))(_0x977b('0x3'));var moment=require(_0x977b('0x4'));var BPromise=require(_0x977b('0x5'));var rp=require(_0x977b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x977b('0x7'));var config=require(_0x977b('0x8'));var attributes=require(_0x977b('0x9'));module[_0x977b('0xa')]=function(_0x3b6555,_0x3c9640){return _0x3b6555[_0x977b('0xb')](_0x977b('0xc'),attributes,{'tableName':_0x977b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x977b('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf5b5=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf5b5,0x13c));var _0x5f5b=function(_0xfbc99c,_0x103aad){_0xfbc99c=_0xfbc99c-0x0;var _0x229e05=_0xf5b5[_0xfbc99c];return _0x229e05;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5f5b('0x0'))(_0x5f5b('0x1'));var moment=require(_0x5f5b('0x2'));var BPromise=require(_0x5f5b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f5b('0x4'));var rimraf=require(_0x5f5b('0x5'));var config=require(_0x5f5b('0x6'));var attributes=require(_0x5f5b('0x7'));module[_0x5f5b('0x8')]=function(_0x147931,_0x18deb8){return _0x147931[_0x5f5b('0x9')](_0x5f5b('0xa'),attributes,{'tableName':_0x5f5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f5b('0xc'),'collate':_0x5f5b('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 6594267..db79304 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 _0x17db=['message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4ccb3f,_0x2f4985){var _0x5c2a33=function(_0x32483e){while(--_0x32483e){_0x4ccb3f['push'](_0x4ccb3f['shift']());}};_0x5c2a33(++_0x2f4985);}(_0x17db,0x65));var _0xb17d=function(_0x48ab9f,_0x391b72){_0x48ab9f=_0x48ab9f-0x0;var _0x2ea9ac=_0x17db[_0x48ab9f];return _0x2ea9ac;};'use strict';var _=require(_0xb17d('0x0'));var util=require(_0xb17d('0x1'));var moment=require('moment');var BPromise=require(_0xb17d('0x2'));var rs=require(_0xb17d('0x3'));var fs=require('fs');var Redis=require(_0xb17d('0x4'));var db=require(_0xb17d('0x5'))['db'];var utils=require(_0xb17d('0x6'));var logger=require(_0xb17d('0x7'))(_0xb17d('0x8'));var config=require('../../config/environment');var jayson=require(_0xb17d('0x9'));var client=jayson[_0xb17d('0xa')][_0xb17d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57df29,_0x51c39e,_0x43bd12){return new BPromise(function(_0x321657,_0x866e94){return client[_0xb17d('0xc')](_0x57df29,_0x43bd12)['then'](function(_0x35d2d7){logger['info'](_0xb17d('0xd'),_0x51c39e,_0xb17d('0xe'));logger[_0xb17d('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x51c39e,'request\x20sent',JSON[_0xb17d('0x10')](_0x35d2d7));if(_0x35d2d7[_0xb17d('0x11')]){if(_0x35d2d7['error'][_0xb17d('0x12')]===0x1f4){logger[_0xb17d('0x11')](_0xb17d('0xd'),_0x51c39e,_0x35d2d7[_0xb17d('0x11')]['message']);return _0x866e94(_0x35d2d7[_0xb17d('0x11')][_0xb17d('0x13')]);}logger['error'](_0xb17d('0xd'),_0x51c39e,_0x35d2d7['error'][_0xb17d('0x13')]);return _0x321657(_0x35d2d7[_0xb17d('0x11')][_0xb17d('0x13')]);}else{logger[_0xb17d('0x14')](_0xb17d('0xd'),_0x51c39e,_0xb17d('0xe'));_0x321657(_0x35d2d7[_0xb17d('0x15')][_0xb17d('0x13')]);}})[_0xb17d('0x16')](function(_0x509836){logger[_0xb17d('0x11')](_0xb17d('0xd'),_0x51c39e,_0x509836);_0x866e94(_0x509836);});});}exports[_0xb17d('0x17')]=function(_0x389ad2){var _0x1d1e60=this;return new Promise(function(_0x141b45,_0x52087e){return db[_0xb17d('0x18')]['update'](_0x389ad2[_0xb17d('0x19')],{'raw':_0x389ad2[_0xb17d('0x1a')]?_0x389ad2[_0xb17d('0x1a')][_0xb17d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x389ad2['options']?_0x389ad2[_0xb17d('0x1a')]['where']||null:null,'attributes':_0x389ad2[_0xb17d('0x1a')]?_0x389ad2['options'][_0xb17d('0x1c')]||null:null,'limit':_0x389ad2[_0xb17d('0x1a')]?_0x389ad2['options']['limit']||null:null})[_0xb17d('0x1d')](function(_0x364060){logger[_0xb17d('0x14')]('UpdateOpenchannelApplication',_0x389ad2);logger['debug'](_0xb17d('0x17'),_0x389ad2,JSON[_0xb17d('0x10')](_0x364060));_0x141b45(_0x364060);})['catch'](function(_0x1bf1af){logger[_0xb17d('0x11')](_0xb17d('0x17'),_0x1bf1af['message'],_0x389ad2);_0x52087e(_0x1d1e60['error'](0x1f4,_0x1bf1af[_0xb17d('0x13')]));});});}; \ No newline at end of file +var _0x0bae=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x2c6d46,_0x14f4db){var _0x4c129b=function(_0x370f9a){while(--_0x370f9a){_0x2c6d46['push'](_0x2c6d46['shift']());}};_0x4c129b(++_0x14f4db);}(_0x0bae,0x1b0));var _0xe0ba=function(_0x199052,_0x456d3b){_0x199052=_0x199052-0x0;var _0x527a86=_0x0bae[_0x199052];return _0x527a86;};'use strict';var _=require(_0xe0ba('0x0'));var util=require(_0xe0ba('0x1'));var moment=require(_0xe0ba('0x2'));var BPromise=require(_0xe0ba('0x3'));var rs=require(_0xe0ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0ba('0x5'))['db'];var utils=require(_0xe0ba('0x6'));var logger=require(_0xe0ba('0x7'))(_0xe0ba('0x8'));var config=require(_0xe0ba('0x9'));var jayson=require(_0xe0ba('0xa'));var client=jayson['client'][_0xe0ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc155d2,_0x2836f1,_0x29707e){return new BPromise(function(_0x442a2c,_0x3b2e56){return client[_0xe0ba('0xc')](_0xc155d2,_0x29707e)[_0xe0ba('0xd')](function(_0x56b722){logger[_0xe0ba('0xe')](_0xe0ba('0xf'),_0x2836f1,_0xe0ba('0x10'));logger[_0xe0ba('0x11')](_0xe0ba('0x12'),_0x2836f1,_0xe0ba('0x10'),JSON[_0xe0ba('0x13')](_0x56b722));if(_0x56b722[_0xe0ba('0x14')]){if(_0x56b722[_0xe0ba('0x14')][_0xe0ba('0x15')]===0x1f4){logger[_0xe0ba('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x2836f1,_0x56b722['error'][_0xe0ba('0x16')]);return _0x3b2e56(_0x56b722[_0xe0ba('0x14')][_0xe0ba('0x16')]);}logger['error'](_0xe0ba('0xf'),_0x2836f1,_0x56b722[_0xe0ba('0x14')]['message']);return _0x442a2c(_0x56b722['error'][_0xe0ba('0x16')]);}else{logger[_0xe0ba('0xe')](_0xe0ba('0xf'),_0x2836f1,_0xe0ba('0x10'));_0x442a2c(_0x56b722[_0xe0ba('0x17')]['message']);}})['catch'](function(_0x375d4a){logger[_0xe0ba('0x14')](_0xe0ba('0xf'),_0x2836f1,_0x375d4a);_0x3b2e56(_0x375d4a);});});}exports[_0xe0ba('0x18')]=function(_0x5399be){var _0x4a73e0=this;return new Promise(function(_0x2291fc,_0xe968be){return db[_0xe0ba('0x19')][_0xe0ba('0x1a')](_0x5399be[_0xe0ba('0x1b')],{'raw':_0x5399be[_0xe0ba('0x1c')]?_0x5399be['options'][_0xe0ba('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5399be[_0xe0ba('0x1c')]?_0x5399be[_0xe0ba('0x1c')][_0xe0ba('0x1e')]||null:null,'attributes':_0x5399be[_0xe0ba('0x1c')]?_0x5399be[_0xe0ba('0x1c')][_0xe0ba('0x1f')]||null:null,'limit':_0x5399be[_0xe0ba('0x1c')]?_0x5399be[_0xe0ba('0x1c')]['limit']||null:null})[_0xe0ba('0xd')](function(_0x2fb401){logger[_0xe0ba('0xe')](_0xe0ba('0x18'),_0x5399be);logger[_0xe0ba('0x11')](_0xe0ba('0x18'),_0x5399be,JSON[_0xe0ba('0x13')](_0x2fb401));_0x2291fc(_0x2fb401);})['catch'](function(_0x18fcf9){logger[_0xe0ba('0x14')](_0xe0ba('0x18'),_0x18fcf9['message'],_0x5399be);_0xe968be(_0x4a73e0[_0xe0ba('0x14')](0x1f4,_0x18fcf9[_0xe0ba('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index def3f43..acc8259 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 _0xa544=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','show','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','destroy','delete','removeTags','exports','multer'];(function(_0x200c6b,_0x2752a9){var _0x475d01=function(_0x38cf65){while(--_0x38cf65){_0x200c6b['push'](_0x200c6b['shift']());}};_0x475d01(++_0x2752a9);}(_0xa544,0xdf));var _0x4a54=function(_0x5ba78d,_0x174234){_0x5ba78d=_0x5ba78d-0x0;var _0x30c092=_0xa544[_0x5ba78d];return _0x30c092;};'use strict';var multer=require(_0x4a54('0x0'));var util=require(_0x4a54('0x1'));var path=require(_0x4a54('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a54('0x3'));var router=express[_0x4a54('0x4')]();var fs_extra=require(_0x4a54('0x5'));var auth=require(_0x4a54('0x6'));var interaction=require(_0x4a54('0x7'));var config=require('../../config/environment');var controller=require(_0x4a54('0x8'));router[_0x4a54('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a54('0xa')]);router['get'](_0x4a54('0xb'),auth[_0x4a54('0xc')](),controller[_0x4a54('0xd')]);router[_0x4a54('0x9')]('/:id',auth[_0x4a54('0xc')](),controller[_0x4a54('0xe')]);router[_0x4a54('0x9')]('/:id/messages',auth[_0x4a54('0xc')](),controller[_0x4a54('0xf')]);router['get']('/:id/download',auth[_0x4a54('0xc')](),controller[_0x4a54('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4a54('0x11')]('/:id/messages',auth[_0x4a54('0xc')](),controller[_0x4a54('0x12')]);router['post'](_0x4a54('0x13'),auth['isAuthenticated'](),interaction[_0x4a54('0x14')](_0x4a54('0x15'),_0x4a54('0x16')),controller[_0x4a54('0x17')]);router[_0x4a54('0x18')](_0x4a54('0x19'),auth[_0x4a54('0xc')](),interaction[_0x4a54('0x14')](_0x4a54('0x15'),_0x4a54('0x1a')),controller[_0x4a54('0x1b')]);router['delete'](_0x4a54('0x19'),auth[_0x4a54('0xc')](),interaction[_0x4a54('0x14')](_0x4a54('0x15'),'openchannelinteraction:destroy'),controller[_0x4a54('0x1c')]);router[_0x4a54('0x1d')](_0x4a54('0x13'),auth['isAuthenticated'](),controller[_0x4a54('0x1e')]);module[_0x4a54('0x1f')]=router; \ No newline at end of file +var _0x94e6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','openchannelinteraction:addtags','put','tracked','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x94e6,0x12d));var _0x694e=function(_0x5aaea8,_0x13db4d){_0x5aaea8=_0x5aaea8-0x0;var _0x369171=_0x94e6[_0x5aaea8];return _0x369171;};'use strict';var multer=require(_0x694e('0x0'));var util=require(_0x694e('0x1'));var path=require(_0x694e('0x2'));var timeout=require(_0x694e('0x3'));var express=require('express');var router=express[_0x694e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x694e('0x5'));var interaction=require(_0x694e('0x6'));var config=require(_0x694e('0x7'));var controller=require(_0x694e('0x8'));router[_0x694e('0x9')]('/',auth[_0x694e('0xa')](),controller['index']);router[_0x694e('0x9')](_0x694e('0xb'),auth[_0x694e('0xa')](),controller[_0x694e('0xc')]);router['get'](_0x694e('0xd'),auth[_0x694e('0xa')](),controller[_0x694e('0xe')]);router['get']('/:id/messages',auth[_0x694e('0xa')](),controller[_0x694e('0xf')]);router[_0x694e('0x9')](_0x694e('0x10'),auth[_0x694e('0xa')](),controller[_0x694e('0x11')]);router[_0x694e('0x12')]('/',auth['isAuthenticated'](),controller[_0x694e('0x13')]);router['post'](_0x694e('0x14'),auth[_0x694e('0xa')](),controller[_0x694e('0x15')]);router[_0x694e('0x12')](_0x694e('0x16'),auth[_0x694e('0xa')](),interaction['tracked']('openchannel',_0x694e('0x17')),controller['addTags']);router[_0x694e('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x694e('0x19')](_0x694e('0x1a'),_0x694e('0x1b')),controller[_0x694e('0x1c')]);router[_0x694e('0x1d')](_0x694e('0xd'),auth[_0x694e('0xa')](),interaction[_0x694e('0x19')](_0x694e('0x1a'),_0x694e('0x1e')),controller[_0x694e('0x1f')]);router[_0x694e('0x1d')](_0x694e('0x16'),auth['isAuthenticated'](),controller[_0x694e('0x20')]);module[_0x694e('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 84f0867..7112f3f 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 _0xa198=['out','BOOLEAN','sequelize','DATE','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa198,0x7f));var _0x8a19=function(_0xc76d19,_0x135d27){_0xc76d19=_0xc76d19-0x0;var _0x78bc42=_0xa198[_0xc76d19];return _0x78bc42;};'use strict';var Sequelize=require(_0x8a19('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a19('0x1')]},'disposition':{'type':Sequelize[_0x8a19('0x2')]},'secondDisposition':{'type':Sequelize[_0x8a19('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8a19('0x2')]},'note':{'type':Sequelize[_0x8a19('0x2')]},'read1stAt':{'type':Sequelize[_0x8a19('0x1')]},'threadId':{'type':Sequelize[_0x8a19('0x2')]},'externalUrl':{'type':Sequelize[_0x8a19('0x2')]},'lastMsgAt':{'type':Sequelize[_0x8a19('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8a19('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x8a19('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x1a66=['BOOLEAN','DATE','STRING','sequelize','exports'];(function(_0x1ddc48,_0x286127){var _0x4bca3f=function(_0x1fc9ca){while(--_0x1fc9ca){_0x1ddc48['push'](_0x1ddc48['shift']());}};_0x4bca3f(++_0x286127);}(_0x1a66,0x102));var _0x61a6=function(_0x586fbf,_0x3bd6d9){_0x586fbf=_0x586fbf-0x0;var _0x36da27=_0x1a66[_0x586fbf];return _0x36da27;};'use strict';var Sequelize=require(_0x61a6('0x0'));module[_0x61a6('0x1')]={'closed':{'type':Sequelize[_0x61a6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x61a6('0x3')]},'disposition':{'type':Sequelize[_0x61a6('0x4')]},'secondDisposition':{'type':Sequelize[_0x61a6('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x61a6('0x3')]},'threadId':{'type':Sequelize[_0x61a6('0x4')]},'externalUrl':{'type':Sequelize[_0x61a6('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x61a6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 9815188..38166ae 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 _0xadc8=['../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','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','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','OpenchannelAccountId','sequelize','toString','merge','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','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','groupBy','OpenchannelInteractionId','push','all','rows','show','includeAll','options','create','params','describe','addMessage','OpenchannelMessage','omit','ids','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','color','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','CmContact','firstName','lastName','attachments','Attachment','direction','secret','OpenchannelAccount','Account','get','Openchannel','Owner','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','views','downloadInteraction.ejs','transcript-','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x367fc9,_0x5c35f6){var _0x2964f5=function(_0x18d45a){while(--_0x18d45a){_0x367fc9['push'](_0x367fc9['shift']());}};_0x2964f5(++_0x5c35f6);}(_0xadc8,0xce));var _0x8adc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadc8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8adc('0x0'));var rimraf=require(_0x8adc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8adc('0x2'));var rp=require('request-promise');var moment=require(_0x8adc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8adc('0x4'));var util=require(_0x8adc('0x5'));var path=require(_0x8adc('0x6'));var sox=require(_0x8adc('0x7'));var csv=require(_0x8adc('0x8'));var ejs=require(_0x8adc('0x9'));var fs=require('fs');var fs_extra=require(_0x8adc('0xa'));var _=require(_0x8adc('0xb'));var squel=require(_0x8adc('0xc'));var crypto=require('crypto');var jsforce=require(_0x8adc('0xd'));var deskjs=require(_0x8adc('0xe'));var toCsv=require(_0x8adc('0x8'));var querystring=require(_0x8adc('0xf'));var Papa=require(_0x8adc('0x10'));var Redis=require('ioredis');var authService=require(_0x8adc('0x11'));var qs=require(_0x8adc('0x12'));var as=require(_0x8adc('0x13'));var pdf=require(_0x8adc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8adc('0x15'))('api');var utils=require(_0x8adc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8adc('0x17'));var db=require(_0x8adc('0x18'))['db'];config[_0x8adc('0x19')]=_['defaults'](config[_0x8adc('0x19')],{'host':_0x8adc('0x1a'),'port':0x18eb});var socket=require(_0x8adc('0x1b'))(new Redis(config[_0x8adc('0x19')]));require(_0x8adc('0x1c'))[_0x8adc('0x1d')](socket);function respondWithStatusCode(_0x16c1ba,_0x27ce93){_0x27ce93=_0x27ce93||0xcc;return function(_0x2ca7dc){if(_0x2ca7dc){return _0x16c1ba[_0x8adc('0x1e')](_0x27ce93);}return _0x16c1ba[_0x8adc('0x1f')](_0x27ce93)[_0x8adc('0x20')]();};}function respondWithResult(_0x4172cd,_0x543af6){_0x543af6=_0x543af6||0xc8;return function(_0x43d94e){if(_0x43d94e){return _0x4172cd['status'](_0x543af6)[_0x8adc('0x21')](_0x43d94e);}};}function respondWithFilteredResult(_0x1ed22e,_0xc96cb0){return function(_0x170144){if(_0x170144){var _0x2f2153=typeof _0xc96cb0[_0x8adc('0x22')]==='undefined'&&typeof _0xc96cb0[_0x8adc('0x23')]===_0x8adc('0x24');var _0x5d3208=_0x170144[_0x8adc('0x25')];var _0x15edc0=_0x2f2153?0x0:_0xc96cb0['offset'];var _0x27994a=_0x2f2153?_0x170144[_0x8adc('0x25')]:_0xc96cb0['offset']+_0xc96cb0[_0x8adc('0x23')];var _0x5b0e36;if(_0x27994a>=_0x5d3208){_0x27994a=_0x5d3208;_0x5b0e36=0xc8;}else{_0x5b0e36=0xce;}_0x1ed22e[_0x8adc('0x1f')](_0x5b0e36);return _0x1ed22e['set']('Content-Range',_0x15edc0+'-'+_0x27994a+'/'+_0x5d3208)[_0x8adc('0x21')](_0x170144);}return null;};}function patchUpdates(_0x56365e){return function(_0x22327f){try{jsonpatch[_0x8adc('0x26')](_0x22327f,_0x56365e,!![]);}catch(_0xe31639){return BPromise[_0x8adc('0x27')](_0xe31639);}return _0x22327f[_0x8adc('0x28')]();};}function saveUpdates(_0x25d5f7,_0x1d4902){return function(_0x291559){if(_0x291559){return _0x291559[_0x8adc('0x29')](_0x25d5f7)[_0x8adc('0x2a')](function(_0x4ec9ea){return _0x4ec9ea;});}return null;};}function removeEntity(_0x53bf34,_0x505d0b){return function(_0x26d612){if(_0x26d612){return _0x26d612[_0x8adc('0x2b')]()[_0x8adc('0x2a')](function(){_0x53bf34['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2864dd,_0x2a91b3){return function(_0x162907){if(!_0x162907){_0x2864dd[_0x8adc('0x1e')](0x194);}return _0x162907;};}function handleError(_0x523711,_0x539b2a){_0x539b2a=_0x539b2a||0x1f4;return function(_0x5b3b20){logger[_0x8adc('0x2c')](_0x5b3b20['stack']);if(_0x5b3b20[_0x8adc('0x2d')]){delete _0x5b3b20[_0x8adc('0x2d')];}_0x523711[_0x8adc('0x1f')](_0x539b2a)[_0x8adc('0x2e')](_0x5b3b20);};}function getInteractionUsers(_0xd78c06,_0x503851){return new BPromise(function(_0x4ee5c9,_0x10ff55){try{if(_0x503851[_0xd78c06['id']]){_0xd78c06[_0x8adc('0x2f')]=_[_0x8adc('0x30')](_0x503851[_0xd78c06['id']],function(_0x78ae8f){return{'id':_0x78ae8f['id'],'fullname':_0x78ae8f[_0x8adc('0x31')]};});}}catch(_0x31efcc){_0x10ff55(_0x31efcc);}_0x4ee5c9(_0xd78c06);});}function getInteractionTags(_0x3b27ca,_0x4428e8){return new BPromise(function(_0x196a10,_0x5d6ae8){try{if(_0x3b27ca[_0x8adc('0x32')]){_0x3b27ca[_0x8adc('0x33')]=[];_0x3b27ca[_0x8adc('0x32')][_0x8adc('0x34')](',')[_0x8adc('0x35')](function(_0x589dc6){_0x3b27ca[_0x8adc('0x33')]['push'](_0x4428e8[_0x589dc6]);});}delete _0x3b27ca[_0x8adc('0x32')];}catch(_0x56a8d9){_0x5d6ae8(_0x56a8d9);}_0x196a10(_0x3b27ca);});}function updateOpenchannelInteraction(_0x2816cd,_0xa9b283,_0x493d5f){return new BPromise(function(_0x581fb0,_0x21a544){return getInteractionUsers(_0x2816cd,_0x493d5f)['then'](function(_0x4658be){return getInteractionTags(_0x4658be,_0xa9b283);})[_0x8adc('0x2a')](function(_0x26b0dd){_0x581fb0(_0x26b0dd);})[_0x8adc('0x36')](function(_0x4a2ad1){_0x21a544(_0x4a2ad1);});});}exports[_0x8adc('0x37')]=function(_0x2d6476,_0x26365c){var _0x37c37e={},_0x1d1760={},_0xe43bc={'count':0x0,'rows':[]};var _0x47ce17=_[_0x8adc('0x30')](db[_0x8adc('0x38')][_0x8adc('0x39')],function(_0x3e408a){return{'name':_0x3e408a[_0x8adc('0x3a')],'type':_0x3e408a[_0x8adc('0x3b')][_0x8adc('0x3c')]};});_0x1d1760[_0x8adc('0x3d')]=_[_0x8adc('0x30')](_0x47ce17,_0x8adc('0x2d'));_0x1d1760[_0x8adc('0x3e')]=_['keys'](_0x2d6476[_0x8adc('0x3e')]);_0x1d1760['filters']=_['intersection'](_0x1d1760[_0x8adc('0x3d')],_0x1d1760[_0x8adc('0x3e')]);_0x37c37e[_0x8adc('0x3f')]=_[_0x8adc('0x40')](_0x1d1760[_0x8adc('0x3d')],qs[_0x8adc('0x41')](_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x41')]));_0x37c37e[_0x8adc('0x3f')]=_0x37c37e['attributes'][_0x8adc('0x42')]?_0x37c37e[_0x8adc('0x3f')]:_0x1d1760[_0x8adc('0x3d')];if(!_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x43')](_0x8adc('0x44'))){_0x37c37e[_0x8adc('0x23')]=qs['limit'](_0x2d6476[_0x8adc('0x3e')]['limit']);_0x37c37e[_0x8adc('0x22')]=qs[_0x8adc('0x22')](_0x2d6476[_0x8adc('0x3e')]['offset']);}_0x37c37e[_0x8adc('0x45')]=qs['sort'](_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x46')]);_0x37c37e[_0x8adc('0x47')]=qs[_0x8adc('0x48')](_[_0x8adc('0x49')](_0x2d6476[_0x8adc('0x3e')],_0x1d1760[_0x8adc('0x48')]),_0x47ce17);var _0x355a10=[];var _0x221af1=squel[_0x8adc('0x4a')]()[_0x8adc('0x4b')]('id')[_0x8adc('0x4b')]('name')[_0x8adc('0x4b')]('color')[_0x8adc('0x4c')](_0x8adc('0x4d'));var _0x411ce9=squel[_0x8adc('0x4a')]()[_0x8adc('0x4b')](_0x8adc('0x4e'))['field'](_0x8adc('0x4f'))[_0x8adc('0x4b')]('ui.OpenchannelInteractionId')[_0x8adc('0x4c')]('user_has_openchannel_interactions','ui')[_0x8adc('0x50')](_0x8adc('0x51'),'u',_0x8adc('0x52'));var _0x135637=squel[_0x8adc('0x4a')]()[_0x8adc('0x4c')](_0x8adc('0x53'),'i')[_0x8adc('0x50')](_0x8adc('0x54'),'c',_0x8adc('0x55'))['left_join'](_0x8adc('0x51'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x8adc('0x56'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x8adc('0x50')](_0x8adc('0x57'),'me',_0x8adc('0x58'))[_0x8adc('0x50')](_0x8adc('0x59'),'it',_0x8adc('0x5a'))[_0x8adc('0x50')](_0x8adc('0x4d'),'t',_0x8adc('0x5b'));var _0x3dec55=squel[_0x8adc('0x5c')]();var _0x538212=[];var _0x4fbea6=squel[_0x8adc('0x5c')]();var _0x3c7fcf;if(_0x2d6476['query'][_0x8adc('0x5d')]){_0x3c7fcf=as[_0x8adc('0x5e')](_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x5d')]);var _0x43dd62=_0x3c7fcf[_0x8adc('0x5f')];for(var _0x2cf73f=0x0;_0x2cf73f<_0x3c7fcf[_0x8adc('0x60')][_0x8adc('0x42')];_0x2cf73f++){var _0x8252be=_0x3c7fcf[_0x8adc('0x60')][_0x2cf73f];var _0x302c9a='i';var _0x410b03=_[_0x8adc('0x61')](_0x47ce17,[_0x8adc('0x2d'),_0x8252be['field']]);if(!_0x410b03){switch(_0x8252be[_0x8adc('0x4b')]){case _0x8adc('0x62'):if(_0x8252be[_0x8adc('0x63')]==0x1){_0x135637[_0x8adc('0x64')]('`'+_0x8252be['field']+_0x8adc('0x65'));}else{_0x135637[_0x8adc('0x64')]('`'+_0x8252be[_0x8adc('0x4b')]+_0x8adc('0x66'));}break;case _0x8adc('0x67'):if(_0x8252be[_0x8adc('0x68')]===_0x8adc('0x69')){if(_0x8252be[_0x8adc('0x63')][_0x8adc('0x34')]('\x20')[_0x8adc('0x42')]>0x1){_0x3dec55[_0x43dd62]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8adc('0x6a')](_0x8252be['value']),null);}else{var _0x218919='%'+_0x8252be[_0x8adc('0x63')]+'%';_0x3dec55[_0x43dd62](_0x8adc('0x6b'),_0x218919,_0x218919,_0x218919);}}else{_0x410b03=_[_0x8adc('0x61')](_0x47ce17,[_0x8adc('0x2d'),_0x8adc('0x6c')]);_0x8252be[_0x8adc('0x4b')]='ContactId';_0x56b8f0=as[_0x8adc('0x6d')](_0x302c9a,_0x410b03[_0x8adc('0x3b')],_0x8252be);_0x3dec55[_0x43dd62](_0x56b8f0[_0x8adc('0x6e')],_0x56b8f0[_0x8adc('0x63')][_0x8adc('0x6f')],_0x56b8f0['value'][_0x8adc('0x20')]);}break;case _0x8adc('0x70'):var _0x4467ae=_0x8252be[_0x8adc('0x63')][_0x8adc('0x34')](',')[_0x8adc('0x30')](function(_0x107a53){return Number(_0x107a53);});_0x4467ae[_0x8adc('0x35')](function(_0xe23caa){_0x4fbea6['or'](_0x8adc('0x71'),'%,'+_0xe23caa+',%');});_0x538212=_[_0x8adc('0x72')](_0x538212,_0x4467ae);break;case _0x8adc('0x73'):if(_0x8252be['operator']==='$substring'){_0x3dec55[_0x43dd62](_0x8adc('0x74'),'%'+_0x8252be[_0x8adc('0x63')]+'%',null);}else{_0x410b03=_[_0x8adc('0x61')](_0x47ce17,[_0x8adc('0x2d'),_0x8adc('0x75')]);_0x8252be['field']=_0x8adc('0x75');_0x56b8f0=as['buildExpression'](_0x302c9a,_0x410b03[_0x8adc('0x3b')],_0x8252be);_0x3dec55[_0x43dd62](_0x56b8f0[_0x8adc('0x6e')],_0x56b8f0[_0x8adc('0x63')][_0x8adc('0x6f')],_0x56b8f0[_0x8adc('0x63')][_0x8adc('0x20')]);}break;case _0x8adc('0x76'):_0x56b8f0=as[_0x8adc('0x6d')]('me',null,_0x8252be);_0x3dec55[_0x43dd62](_0x56b8f0[_0x8adc('0x6e')],_0x56b8f0[_0x8adc('0x63')]['start'],_0x56b8f0[_0x8adc('0x63')][_0x8adc('0x20')]);break;}}else{var _0x56b8f0=as[_0x8adc('0x6d')](_0x302c9a,_0x410b03[_0x8adc('0x3b')],_0x8252be);_0x3dec55[_0x43dd62](_0x56b8f0[_0x8adc('0x6e')],_0x56b8f0['value'][_0x8adc('0x6f')],_0x56b8f0[_0x8adc('0x63')][_0x8adc('0x20')]);}}}else{var _0x327e89=_(_0x2d6476[_0x8adc('0x3e')])[_0x8adc('0x77')]()['map'](function(_0xcc4756){return _[_0x8adc('0x78')](_0x47ce17,[_0x8adc('0x2d'),_0xcc4756])?_0xcc4756:undefined;})[_0x8adc('0x79')]()[_0x8adc('0x63')]();if(!_[_0x8adc('0x7a')](_0x327e89)){_0x327e89[_0x8adc('0x35')](function(_0x11493e){if(_0x11493e==='OpenchannelAccountId'){_0x135637[_0x8adc('0x47')](_0x8adc('0x7b'),[][_0x8adc('0x7c')](_0x2d6476['query'][_0x11493e]));}else if(_0x11493e===_0x8adc('0x7d')){var _0x5509ef=JSON[_0x8adc('0x7e')](_0x2d6476[_0x8adc('0x3e')][_0x11493e])[_0x8adc('0x7f')];var _0x577070=JSON[_0x8adc('0x7e')](_0x2d6476[_0x8adc('0x3e')][_0x11493e])['$lte'];_0x135637[_0x8adc('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5509ef,_0x577070);}else{if(_0x2d6476[_0x8adc('0x3e')][_0x11493e]===_0x8adc('0x80')){_0x135637[_0x8adc('0x47')]('i.'+_0x11493e+_0x8adc('0x81'));}else{_0x135637[_0x8adc('0x47')]('i.'+_0x11493e+'\x20=\x20?',_0x2d6476[_0x8adc('0x3e')][_0x11493e]);}}});}if(_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x82')]){if(_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x82')]==0x1){_0x135637[_0x8adc('0x64')](_0x8adc('0x83'));}else{_0x135637[_0x8adc('0x64')](_0x8adc('0x84'));}}if(_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x85')]){_0x538212=_[_0x8adc('0x86')](_0x2d6476[_0x8adc('0x3e')]['tag'])?_0x2d6476['query'][_0x8adc('0x85')]:new Array(_0x2d6476['query']['tag']);_0x538212[_0x8adc('0x35')](function(_0x45f813){_0x4fbea6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x45f813+',%');});}if(_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x87')]){var _0x3e246d=_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x87')][_0x8adc('0x88')]('\x5c','\x5c\x5c')[_0x8adc('0x88')](/'/g,'\x27\x27');if(qs[_0x8adc('0x89')](_0x3e246d)){_0x3dec55['or'](_0x8adc('0x8a'),_0x3e246d+'%');}else{_0x3dec55['or'](_0x8adc('0x8b'),qs['getFullTextValue'](_0x3e246d))['or']('i.from\x20LIKE\x20?',_0x3e246d+'%')['or'](_0x8adc('0x8c'),_0x3e246d+'%');}}}_0x135637[_0x8adc('0x47')](_0x3dec55);_0x135637['group']('i.id');var _0x41027b={'type':db[_0x8adc('0x8d')][_0x8adc('0x8e')]['SELECT'],'raw':!![]};var _0x324be7=_0x135637[_0x8adc('0x8f')]();_0x324be7['field'](_0x8adc('0x90'));_0x324be7[_0x8adc('0x4b')](_0x8adc('0x91'),_0x8adc('0x62'));if(_0x37c37e[_0x8adc('0x45')]){_0x37c37e['order'][_0x8adc('0x35')](function(_0x52e17b){var _0x27cbfc=_0x52e17b[0x0]===_0x8adc('0x92')?_0x52e17b[0x0]:'i.'+_0x52e17b[0x0];_0x135637['order'](_0x27cbfc,_0x52e17b[0x1]===_0x8adc('0x93')?![]:!![]);});}if(!_[_0x8adc('0x7a')](_0x538212)){_0x135637['having'](_0x4fbea6);_0x324be7[_0x8adc('0x47')](_0x8adc('0x94'),_0x538212);}BPromise['resolve']()[_0x8adc('0x2a')](function(){if(!_0x3c7fcf){if(_0x2d6476['query']['OpenchannelAccountId'])return;_0x324be7[_0x8adc('0x47')](_0x8adc('0x95'));_0x135637[_0x8adc('0x47')](_0x8adc('0x95'));return;}if(_0x2d6476['user'][_0x8adc('0x96')]!=='agent')return;return _0x2d6476[_0x8adc('0x97')][_0x8adc('0x98')]({'attributes':['id'],'raw':!![]})[_0x8adc('0x2a')](function(_0xe82dd5){if(_[_0x8adc('0x7a')](_0xe82dd5)){_0x324be7['where'](_0x8adc('0x99'));_0x135637[_0x8adc('0x47')](_0x8adc('0x99'));}else{_0x324be7[_0x8adc('0x47')](_0x8adc('0x7b'),_[_0x8adc('0x30')](_0xe82dd5,'id'));_0x135637[_0x8adc('0x47')](_0x8adc('0x7b'),_[_0x8adc('0x30')](_0xe82dd5,'id'));}});})['then'](function(){if(_0x2d6476[_0x8adc('0x97')][_0x8adc('0x96')]==='agent'&&!_0x3c7fcf&&!_0x2d6476[_0x8adc('0x3e')][_0x8adc('0x9a')])return[];return db[_0x8adc('0x9b')]['query'](_0x324be7[_0x8adc('0x9c')](),_0x41027b);})[_0x8adc('0x2a')](function(_0x42cbf9){_0xe43bc[_0x8adc('0x25')]=_0x42cbf9[_0x8adc('0x42')];if(_0xe43bc[_0x8adc('0x25')]===0x0)return[];return db[_0x8adc('0x9b')][_0x8adc('0x3e')](_0x221af1[_0x8adc('0x9c')](),_0x41027b)['then'](function(_0x36234c){_0x355a10=_['keyBy'](_0x36234c,'id');_0x41027b=_[_0x8adc('0x9d')](_0x41027b,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2d6476[_0x8adc('0x3e')]['fields']){_0x37c37e[_0x8adc('0x3f')]['forEach'](function(_0x5a8f2c){_0x135637[_0x8adc('0x4b')]('i.'+_0x5a8f2c);});}else{_0x135637[_0x8adc('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x135637[_0x8adc('0x4b')](_0x8adc('0x9e'),_0x8adc('0x9f'));_0x135637[_0x8adc('0x4b')](_0x8adc('0xa0'),'Account.mandatoryDisposition');_0x135637[_0x8adc('0x4b')](_0x8adc('0xa1'),_0x8adc('0x92'));_0x135637[_0x8adc('0x4b')](_0x8adc('0xa2'));_0x135637[_0x8adc('0x4b')](_0x8adc('0xa3'),'Contact.firstName');_0x135637['field'](_0x8adc('0xa4'),'Contact.lastName');_0x135637[_0x8adc('0x4b')](_0x8adc('0xa5'),_0x8adc('0xa6'));_0x135637[_0x8adc('0x4b')](_0x8adc('0xa7'),_0x8adc('0xa8'));_0x135637[_0x8adc('0x4b')]('c.mobile',_0x8adc('0xa9'));_0x135637['field'](_0x8adc('0xaa'),_0x8adc('0xab'));_0x135637['field'](_0x8adc('0xac'),'Owner.fullname');_0x135637[_0x8adc('0x4b')](_0x8adc('0xad'),_0x8adc('0xae'));_0x135637['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8adc('0x32'));}if(_0x37c37e[_0x8adc('0x23')])_0x135637[_0x8adc('0x23')](_0x37c37e[_0x8adc('0x23')]);if(_0x37c37e[_0x8adc('0x22')])_0x135637[_0x8adc('0x22')](_0x37c37e['offset']);return db[_0x8adc('0x9b')][_0x8adc('0x3e')](_0x135637[_0x8adc('0x9c')](),_0x41027b);})['then'](function(_0xd85efd){if(_0xd85efd[_0x8adc('0x42')]>0x0)_0x411ce9[_0x8adc('0x47')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x8adc('0x30')](_0xd85efd,'id'));return db['sequelize']['query'](_0x411ce9['toString'](),_0x41027b)['then'](function(_0x31648e){var _0x2dee3f=_[_0x8adc('0xaf')](_0x31648e,_0x8adc('0xb0'));var _0x734d1a=[];_0xd85efd[_0x8adc('0x35')](function(_0x11e3ea){_0x734d1a[_0x8adc('0xb1')](updateOpenchannelInteraction(_0x11e3ea,_0x355a10,_0x2dee3f));});return BPromise[_0x8adc('0xb2')](_0x734d1a);});});})[_0x8adc('0x2a')](function(_0x4333d7){_0xe43bc[_0x8adc('0xb3')]=_0x4333d7;return _0xe43bc;})[_0x8adc('0x2a')](respondWithFilteredResult(_0x26365c,_0x37c37e))['catch'](handleError(_0x26365c,null));};exports[_0x8adc('0xb4')]=function(_0x3f73ed,_0xbc52b){var _0x1671a7={};if(_0x3f73ed[_0x8adc('0x3e')][_0x8adc('0x3b')]&&_0x3f73ed[_0x8adc('0x3e')][_0x8adc('0x3b')]===_0x8adc('0x4c')){_0x1671a7[_0x8adc('0x4c')]=_0x3f73ed['params']['id'];}else{_0x1671a7['id']=_0x3f73ed['params']['id'];}var _0x446e7e={'raw':![],'where':_0x1671a7},_0x4786a4={};_0x4786a4[_0x8adc('0x3d')]=_['keys'](db['OpenchannelInteraction'][_0x8adc('0x39')]);_0x4786a4[_0x8adc('0x3e')]=_[_0x8adc('0x77')](_0x3f73ed[_0x8adc('0x3e')]);_0x4786a4[_0x8adc('0x48')]=_[_0x8adc('0x40')](_0x4786a4[_0x8adc('0x3d')],_0x4786a4[_0x8adc('0x3e')]);_0x446e7e['attributes']=_[_0x8adc('0x40')](_0x4786a4[_0x8adc('0x3d')],qs[_0x8adc('0x41')](_0x3f73ed['query'][_0x8adc('0x41')]));_0x446e7e[_0x8adc('0x3f')]=_0x446e7e[_0x8adc('0x3f')]['length']?_0x446e7e[_0x8adc('0x3f')]:_0x4786a4[_0x8adc('0x3d')];if(_0x3f73ed[_0x8adc('0x3e')][_0x8adc('0xb5')]){_0x446e7e['include']=[{'all':!![]}];}_0x446e7e=_[_0x8adc('0x9d')]({},_0x446e7e,_0x3f73ed[_0x8adc('0xb6')]);return db[_0x8adc('0x38')][_0x8adc('0x61')](_0x446e7e)[_0x8adc('0x2a')](handleEntityNotFound(_0xbc52b,null))['then'](respondWithResult(_0xbc52b,null))['catch'](handleError(_0xbc52b,null));};exports[_0x8adc('0xb7')]=function(_0x54c93c,_0x1b31b4){return db['OpenchannelInteraction'][_0x8adc('0xb7')](_0x54c93c[_0x8adc('0x76')],{})['then'](respondWithResult(_0x1b31b4,0xc9))[_0x8adc('0x36')](handleError(_0x1b31b4,null));};exports[_0x8adc('0x29')]=function(_0x597ae0,_0xff5b93){if(_0x597ae0['body']['id']){delete _0x597ae0[_0x8adc('0x76')]['id'];}return db[_0x8adc('0x38')][_0x8adc('0x61')]({'where':{'id':_0x597ae0[_0x8adc('0xb8')]['id']}})[_0x8adc('0x2a')](handleEntityNotFound(_0xff5b93,null))['then'](saveUpdates(_0x597ae0['body'],null))[_0x8adc('0x2a')](respondWithResult(_0xff5b93,null))[_0x8adc('0x36')](handleError(_0xff5b93,null));};exports['destroy']=function(_0xdf1054,_0x4020ac){return db['OpenchannelInteraction'][_0x8adc('0x61')]({'where':{'id':_0xdf1054['params']['id']}})['then'](handleEntityNotFound(_0x4020ac,null))[_0x8adc('0x2a')](removeEntity(_0x4020ac,null))[_0x8adc('0x36')](handleError(_0x4020ac,null));};exports[_0x8adc('0xb9')]=function(_0x40c08a,_0xb8d05e){return db[_0x8adc('0x38')]['describe']()[_0x8adc('0x2a')](respondWithResult(_0xb8d05e,null))[_0x8adc('0x36')](handleError(_0xb8d05e,null));};exports[_0x8adc('0xba')]=function(_0x20dfa2,_0x208fa1,_0x2439e6){return db[_0x8adc('0xbb')][_0x8adc('0x61')]({'where':{'id':_0x20dfa2[_0x8adc('0xb8')]['id']}})[_0x8adc('0x2a')](handleEntityNotFound(_0x208fa1,null))[_0x8adc('0x2a')](function(_0x9a811){if(_0x9a811){return _0x9a811[_0x8adc('0xba')](_0x20dfa2[_0x8adc('0x76')]['ids'],_[_0x8adc('0xbc')](_0x20dfa2[_0x8adc('0x76')],[_0x8adc('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x208fa1,null))[_0x8adc('0x36')](handleError(_0x208fa1,null));};exports['getMessages']=function(_0x210358,_0x35ab77,_0x1ae0d2){var _0x51589a={'raw':![],'where':{}};var _0x42482e={};var _0x3eee7a={'count':0x0,'rows':[]};return db[_0x8adc('0x38')]['findOne']({'where':{'id':_0x210358[_0x8adc('0xb8')]['id']}})[_0x8adc('0x2a')](handleEntityNotFound(_0x35ab77,null))[_0x8adc('0x2a')](function(_0x4ad040){if(_0x4ad040){_0x42482e['model']=_[_0x8adc('0x77')](db[_0x8adc('0xbb')][_0x8adc('0x39')]);_0x42482e[_0x8adc('0x3e')]=_['keys'](_0x210358['query']);_0x42482e['filters']=_['intersection'](_0x42482e[_0x8adc('0x3d')],_0x42482e['query']);_0x51589a['attributes']=_[_0x8adc('0x40')](_0x42482e['model'],qs[_0x8adc('0x41')](_0x210358[_0x8adc('0x3e')][_0x8adc('0x41')]));_0x51589a[_0x8adc('0x3f')]=_0x51589a[_0x8adc('0x3f')][_0x8adc('0x42')]?_0x51589a[_0x8adc('0x3f')]:_0x42482e['model'];if(!_0x210358['query']['hasOwnProperty'](_0x8adc('0x44'))){_0x51589a[_0x8adc('0x23')]=qs[_0x8adc('0x23')](_0x210358[_0x8adc('0x3e')][_0x8adc('0x23')]);_0x51589a[_0x8adc('0x22')]=qs['offset'](_0x210358[_0x8adc('0x3e')]['offset']);}_0x51589a['order']=qs[_0x8adc('0x46')](_0x210358['query']['sort']);_0x51589a[_0x8adc('0x47')]=qs[_0x8adc('0x48')](_[_0x8adc('0x49')](_0x210358[_0x8adc('0x3e')],_0x42482e[_0x8adc('0x48')]));_0x51589a[_0x8adc('0x47')][_0x8adc('0xb0')]=_0x4ad040['id'];if(_0x210358[_0x8adc('0x3e')][_0x8adc('0x87')]){_0x51589a[_0x8adc('0x47')]=_[_0x8adc('0x9d')](_0x51589a[_0x8adc('0x47')],{'$or':_[_0x8adc('0x30')](_0x51589a[_0x8adc('0x3f')],function(_0x284500){var _0x13522d={};_0x13522d[_0x284500]={'$like':'%'+_0x210358[_0x8adc('0x3e')][_0x8adc('0x87')]+'%'};return _0x13522d;})});}if(_0x210358[_0x8adc('0x3e')]['$gte']){var _0x1eb41a=_0x210358['query'][_0x8adc('0x7f')][_0x8adc('0x34')](',');var _0x236d12={};_0x236d12[_0x1eb41a[0x0]]={'$gte':moment(_0x1eb41a[0x1])[_0x8adc('0xbe')](_0x8adc('0xbf'))};_0x51589a[_0x8adc('0x47')]=_['merge'](_0x51589a[_0x8adc('0x47')],_0x236d12);}_0x51589a=_[_0x8adc('0x9d')]({},_0x51589a,_0x210358[_0x8adc('0xb6')]);return db['OpenchannelMessage']['count']({'where':_0x51589a[_0x8adc('0x47')]})['then'](function(_0x304ffb){_0x3eee7a['count']=_0x304ffb;if(_0x210358[_0x8adc('0x3e')][_0x8adc('0xb5')]){_0x51589a[_0x8adc('0xc0')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x51589a);})[_0x8adc('0x2a')](function(_0x148742){_0x3eee7a[_0x8adc('0xb3')]=_0x148742;return _0x3eee7a;});}})[_0x8adc('0x2a')](respondWithFilteredResult(_0x35ab77,_0x51589a))[_0x8adc('0x36')](handleError(_0x35ab77,null));};exports[_0x8adc('0xc1')]=function(_0x316eb8,_0x8dbb5a,_0x5af07a){return db[_0x8adc('0x38')][_0x8adc('0x61')]({'where':{'id':_0x316eb8[_0x8adc('0xb8')]['id']}})[_0x8adc('0x2a')](handleEntityNotFound(_0x8dbb5a,null))[_0x8adc('0x2a')](function(_0x43cf51){if(_0x43cf51){return _0x43cf51[_0x8adc('0xc2')](_0x316eb8['body'][_0x8adc('0xbd')],_['omit'](_0x316eb8[_0x8adc('0x76')],['ids','id'])||{})['spread'](function(){return db[_0x8adc('0x70')]['findAll']({'attributes':['id',_0x8adc('0x2d'),_0x8adc('0xc3')],'where':{'id':_0x316eb8[_0x8adc('0x76')][_0x8adc('0xbd')]}});})[_0x8adc('0x2a')](function(_0x1ffbd3){socket['emit'](_0x8adc('0xc4'),{'id':Number(_0x316eb8[_0x8adc('0xb8')]['id']),'tags':_0x1ffbd3||[]});return{'id':Number(_0x316eb8[_0x8adc('0xb8')]['id']),'tags':_0x1ffbd3||[]};});}})['then'](respondWithResult(_0x8dbb5a,null))['catch'](handleError(_0x8dbb5a,null));};exports[_0x8adc('0xc5')]=function(_0x205f78,_0xc730ec,_0x1b9d22){return db[_0x8adc('0x38')]['find']({'where':{'id':_0x205f78[_0x8adc('0xb8')]['id']}})[_0x8adc('0x2a')](handleEntityNotFound(_0xc730ec,null))[_0x8adc('0x2a')](function(_0x45b304){if(_0x45b304){return _0x45b304[_0x8adc('0xc5')](_0x205f78[_0x8adc('0x3e')][_0x8adc('0xbd')]);}})[_0x8adc('0x2a')](respondWithStatusCode(_0xc730ec,null))[_0x8adc('0x36')](handleError(_0xc730ec,null));};exports[_0x8adc('0xc6')]=function(_0x50cf0b,_0x39b504){var _0x433589=moment()[_0x8adc('0xc7')]()['toString']();var _0x177653=path[_0x8adc('0xc8')](config['root'],_0x8adc('0xc9'),_0x8adc('0xca'),_0x8adc('0xcb'));var _0x3ec956=path[_0x8adc('0xc8')](config['root'],_0x8adc('0xc9'),_0x8adc('0xca'),'attachments');var _0x4a0889=path['join'](_0x177653,_0x433589);var _0x4f0a26=util[_0x8adc('0xbe')]('transcript-%d-%s.zip',_0x50cf0b['params']['id'],_0x433589);var _0x470fd3=path[_0x8adc('0xc8')](_0x177653,_0x4f0a26);var _0x732d8b=[];_0x732d8b['push']({'model':db[_0x8adc('0x73')],'as':_0x8adc('0x73'),'attributes':['id','fullname'],'raw':!![]});_0x732d8b[_0x8adc('0xb1')]({'model':db[_0x8adc('0xcc')],'as':_0x8adc('0x67'),'attributes':['id',_0x8adc('0xcd'),_0x8adc('0xce')],'raw':!![]});if(_0x50cf0b[_0x8adc('0x3e')][_0x8adc('0xcf')]){_0x732d8b[_0x8adc('0xb1')]({'model':db[_0x8adc('0xd0')],'as':_0x8adc('0xd0'),'raw':!![]});}var _0xd396b0=[{'model':db[_0x8adc('0xbb')],'as':'Messages','attributes':['id',_0x8adc('0x76'),_0x8adc('0x7d'),_0x8adc('0xd1'),_0x8adc('0xd2'),_0x8adc('0x82')],'include':_0x732d8b}];_0xd396b0['push']({'model':db[_0x8adc('0xd3')],'as':_0x8adc('0xd4'),'attributes':['id',_0x8adc('0x2d')]});_0xd396b0[_0x8adc('0xb1')]({'model':db[_0x8adc('0x73')],'as':'Owner','attributes':['id',_0x8adc('0x31')]});return db['OpenchannelInteraction'][_0x8adc('0x61')]({'where':{'id':_0x50cf0b[_0x8adc('0xb8')]['id']},'include':_0xd396b0})[_0x8adc('0x2a')](handleEntityNotFound(_0x39b504,null))[_0x8adc('0x2a')](function(_0x292635){if(_0x292635){var _0x11d720=_0x292635[_0x8adc('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x4a0889);var _0x3cb6ea={'channel':_0x8adc('0xd6'),'account':_0x11d720['Account'][_0x8adc('0x2d')],'agent':_0x11d720[_0x8adc('0xd7')]?_0x11d720[_0x8adc('0xd7')]['fullname']:'N.A.','createdAt':moment(_0x11d720[_0x8adc('0x7d')])['format'](_0x8adc('0xbf'))[_0x8adc('0x9c')](),'closedAt':_0x11d720[_0x8adc('0xd8')]?moment(_0x11d720[_0x8adc('0xd9')])[_0x8adc('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x11d720['disposition'],'visibility':_0x11d720['threadId']?'Public':'Private','messages':_(_0x11d720['Messages'])[_0x8adc('0x87')]({'secret':![]})['map'](function(_0x9ac21d){if(_0x9ac21d[_0x8adc('0xd0')]){var _0x3be209=path[_0x8adc('0xc8')](_0x3ec956,_0x9ac21d[_0x8adc('0xd0')][_0x8adc('0xda')]);if(fs[_0x8adc('0xdb')](_0x3be209)){fs[_0x8adc('0xdc')](_0x3be209)[_0x8adc('0xdd')](fs[_0x8adc('0xde')](path['join'](_0x4a0889,_0x9ac21d[_0x8adc('0xd0')][_0x8adc('0xda')])));}}return{'date':moment(_0x9ac21d['createdAt'])[_0x8adc('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8adc('0x9c')](),'sender':_0x9ac21d[_0x8adc('0xd1')]==='out'?_0x9ac21d[_0x8adc('0x73')]?_0x9ac21d[_0x8adc('0x73')][_0x8adc('0x31')]:_0x8adc('0xdf'):_0x9ac21d[_0x8adc('0x67')]['firstName']+(_0x9ac21d[_0x8adc('0x67')][_0x8adc('0xce')]?'\x20'+_0x9ac21d[_0x8adc('0x67')][_0x8adc('0xce')]:''),'body':_0x9ac21d['Attachment']?_0x9ac21d[_0x8adc('0xd0')]['basename']:_0x9ac21d[_0x8adc('0x76')],'direction':_0x9ac21d[_0x8adc('0xd1')]===_0x8adc('0xe0')?'A':'C','secret':_0x9ac21d[_0x8adc('0xd2')],'read':_0x9ac21d['read'],'attachment':_0x9ac21d[_0x8adc('0xd0')]};})['value']()};return ejs['renderFile'](path[_0x8adc('0xc8')](config['root'],'server',_0x8adc('0xe1'),_0x8adc('0xe2')),{'interaction':_0x3cb6ea})[_0x8adc('0x2a')](function(_0x4ad780){var _0xe9fb09=path[_0x8adc('0xc8')](_0x4a0889,_0x8adc('0xe3')+_0x11d720['id']+'-'+_0x433589+'.pdf');var _0x4febcc={'path':_0xe9fb09,'channel':_0x8adc('0xd6'),'interactionId':_0x11d720['id']};return pdf['createPdfFromHTML'](_0x4ad780,_0x4febcc);})['then'](function(){return new BPromise(function(_0x3ac459,_0x55565a){zipdir(_0x4a0889,{'saveTo':_0x470fd3},function(_0x22b40f,_0x4e56e7){if(_0x22b40f)return _0x55565a(_0x22b40f);return _0x3ac459(_0x4e56e7);});})[_0x8adc('0x2a')](function(){return new BPromise(function(_0x43bfb5,_0x1b032b){rimraf(_0x4a0889,function(_0x1ead39){if(_0x1ead39)_0x1b032b(_0x1ead39);return _0x43bfb5();});});})[_0x8adc('0x2a')](function(){return _0x39b504[_0x8adc('0xc6')](_0x470fd3,_0x4f0a26,function(_0x5f06c3){if(_0x5f06c3){console['log'](_0x8adc('0xe4'),_0x5f06c3);}else{fs[_0x8adc('0xe5')](_0x470fd3);}});});});}else{return _0x39b504[_0x8adc('0x1e')](0xc8);}})['catch'](handleError(_0x39b504,null));}; \ No newline at end of file +var _0x11e5=['.pdf','Openchannel','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','index','OpenchannelInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','field','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','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','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','show','from','params','rawAttributes','include','options','create','describe','addMessage','OpenchannelMessage','ids','omit','findOne','includeAll','addTags','spread','findAll','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','tmp','server','files','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','Owner','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Public','Private','basename','createReadStream','pipe','createWriteStream','direction','out','System','Contact','renderFile','transcript-'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x11e5,0x1e9));var _0x511e=function(_0x219935,_0x5b7d02){_0x219935=_0x219935-0x0;var _0x130409=_0x11e5[_0x219935];return _0x130409;};'use strict';var emlformat=require(_0x511e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x511e('0x1'));var jsonpatch=require(_0x511e('0x2'));var rp=require('request-promise');var moment=require(_0x511e('0x3'));var BPromise=require(_0x511e('0x4'));var Mustache=require(_0x511e('0x5'));var util=require(_0x511e('0x6'));var path=require(_0x511e('0x7'));var sox=require('sox');var csv=require(_0x511e('0x8'));var ejs=require(_0x511e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x511e('0xa'));var squel=require('squel');var crypto=require(_0x511e('0xb'));var jsforce=require(_0x511e('0xc'));var deskjs=require(_0x511e('0xd'));var toCsv=require(_0x511e('0x8'));var querystring=require(_0x511e('0xe'));var Papa=require(_0x511e('0xf'));var Redis=require(_0x511e('0x10'));var authService=require(_0x511e('0x11'));var qs=require(_0x511e('0x12'));var as=require(_0x511e('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x511e('0x14'))(_0x511e('0x15'));var utils=require(_0x511e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x511e('0x17'));var db=require(_0x511e('0x18'))['db'];config[_0x511e('0x19')]=_[_0x511e('0x1a')](config[_0x511e('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x511e('0x1b'))(new Redis(config[_0x511e('0x19')]));require(_0x511e('0x1c'))[_0x511e('0x1d')](socket);function respondWithStatusCode(_0x646d24,_0x1fe6d8){_0x1fe6d8=_0x1fe6d8||0xcc;return function(_0x29d4d8){if(_0x29d4d8){return _0x646d24[_0x511e('0x1e')](_0x1fe6d8);}return _0x646d24[_0x511e('0x1f')](_0x1fe6d8)['end']();};}function respondWithResult(_0x2d36c3,_0x1a844b){_0x1a844b=_0x1a844b||0xc8;return function(_0x17b7d8){if(_0x17b7d8){return _0x2d36c3[_0x511e('0x1f')](_0x1a844b)[_0x511e('0x20')](_0x17b7d8);}};}function respondWithFilteredResult(_0x1490e2,_0x38482b){return function(_0x2106d1){if(_0x2106d1){var _0x2e1d09=typeof _0x38482b[_0x511e('0x21')]==='undefined'&&typeof _0x38482b['limit']===_0x511e('0x22');var _0x369664=_0x2106d1[_0x511e('0x23')];var _0xedadae=_0x2e1d09?0x0:_0x38482b['offset'];var _0x192c3c=_0x2e1d09?_0x2106d1[_0x511e('0x23')]:_0x38482b[_0x511e('0x21')]+_0x38482b['limit'];var _0x3f79c6;if(_0x192c3c>=_0x369664){_0x192c3c=_0x369664;_0x3f79c6=0xc8;}else{_0x3f79c6=0xce;}_0x1490e2[_0x511e('0x1f')](_0x3f79c6);return _0x1490e2[_0x511e('0x24')]('Content-Range',_0xedadae+'-'+_0x192c3c+'/'+_0x369664)[_0x511e('0x20')](_0x2106d1);}return null;};}function patchUpdates(_0x38ea47){return function(_0x192521){try{jsonpatch[_0x511e('0x25')](_0x192521,_0x38ea47,!![]);}catch(_0x4e0465){return BPromise[_0x511e('0x26')](_0x4e0465);}return _0x192521[_0x511e('0x27')]();};}function saveUpdates(_0x1be5a1,_0x413335){return function(_0x5cc7e3){if(_0x5cc7e3){return _0x5cc7e3[_0x511e('0x28')](_0x1be5a1)[_0x511e('0x29')](function(_0x2a4a06){return _0x2a4a06;});}return null;};}function removeEntity(_0x130ef7,_0x27c875){return function(_0x4bde1e){if(_0x4bde1e){return _0x4bde1e[_0x511e('0x2a')]()['then'](function(){_0x130ef7[_0x511e('0x1f')](0xcc)[_0x511e('0x2b')]();});}};}function handleEntityNotFound(_0x572f29,_0x433869){return function(_0x2cb121){if(!_0x2cb121){_0x572f29[_0x511e('0x1e')](0x194);}return _0x2cb121;};}function handleError(_0x2bbd46,_0x4749e7){_0x4749e7=_0x4749e7||0x1f4;return function(_0x7d685d){logger[_0x511e('0x2c')](_0x7d685d[_0x511e('0x2d')]);if(_0x7d685d[_0x511e('0x2e')]){delete _0x7d685d[_0x511e('0x2e')];}_0x2bbd46['status'](_0x4749e7)[_0x511e('0x2f')](_0x7d685d);};}function getInteractionUsers(_0x958fb2,_0x270977){return new BPromise(function(_0x3885da,_0x346152){try{if(_0x270977[_0x958fb2['id']]){_0x958fb2[_0x511e('0x30')]=_[_0x511e('0x31')](_0x270977[_0x958fb2['id']],function(_0x4e28c3){return{'id':_0x4e28c3['id'],'fullname':_0x4e28c3[_0x511e('0x32')]};});}}catch(_0x51889e){_0x346152(_0x51889e);}_0x3885da(_0x958fb2);});}function getInteractionTags(_0x47c730,_0x4dbe06){return new BPromise(function(_0xa6dc1c,_0x13214e){try{if(_0x47c730[_0x511e('0x33')]){_0x47c730['Tags']=[];_0x47c730[_0x511e('0x33')][_0x511e('0x34')](',')[_0x511e('0x35')](function(_0x51f21e){_0x47c730[_0x511e('0x36')][_0x511e('0x37')](_0x4dbe06[_0x51f21e]);});}delete _0x47c730[_0x511e('0x33')];}catch(_0x2b1e5b){_0x13214e(_0x2b1e5b);}_0xa6dc1c(_0x47c730);});}function updateOpenchannelInteraction(_0x1d21d0,_0x271068,_0x403fbb){return new BPromise(function(_0x6ed325,_0x116a75){return getInteractionUsers(_0x1d21d0,_0x403fbb)[_0x511e('0x29')](function(_0x20c86f){return getInteractionTags(_0x20c86f,_0x271068);})[_0x511e('0x29')](function(_0x5e9386){_0x6ed325(_0x5e9386);})[_0x511e('0x38')](function(_0x398a95){_0x116a75(_0x398a95);});});}exports[_0x511e('0x39')]=function(_0x3ea765,_0x1525bd){var _0x51d859={},_0x58f8dd={},_0xbd83e4={'count':0x0,'rows':[]};var _0x1cc94a=_[_0x511e('0x31')](db[_0x511e('0x3a')]['rawAttributes'],function(_0x363e19){return{'name':_0x363e19['fieldName'],'type':_0x363e19[_0x511e('0x3b')][_0x511e('0x3c')]};});_0x58f8dd[_0x511e('0x3d')]=_[_0x511e('0x31')](_0x1cc94a,'name');_0x58f8dd[_0x511e('0x3e')]=_[_0x511e('0x3f')](_0x3ea765['query']);_0x58f8dd[_0x511e('0x40')]=_[_0x511e('0x41')](_0x58f8dd['model'],_0x58f8dd['query']);_0x51d859[_0x511e('0x42')]=_[_0x511e('0x41')](_0x58f8dd['model'],qs[_0x511e('0x43')](_0x3ea765[_0x511e('0x3e')]['fields']));_0x51d859[_0x511e('0x42')]=_0x51d859[_0x511e('0x42')][_0x511e('0x44')]?_0x51d859[_0x511e('0x42')]:_0x58f8dd['model'];if(!_0x3ea765[_0x511e('0x3e')]['hasOwnProperty'](_0x511e('0x45'))){_0x51d859[_0x511e('0x46')]=qs[_0x511e('0x46')](_0x3ea765[_0x511e('0x3e')][_0x511e('0x46')]);_0x51d859[_0x511e('0x21')]=qs[_0x511e('0x21')](_0x3ea765[_0x511e('0x3e')][_0x511e('0x21')]);}_0x51d859['order']=qs[_0x511e('0x47')](_0x3ea765[_0x511e('0x3e')][_0x511e('0x47')]);_0x51d859[_0x511e('0x48')]=qs[_0x511e('0x40')](_[_0x511e('0x49')](_0x3ea765['query'],_0x58f8dd[_0x511e('0x40')]),_0x1cc94a);var _0x8fe724=[];var _0x22e072=squel['select']()[_0x511e('0x4a')]('id')['field'](_0x511e('0x2e'))[_0x511e('0x4a')]('color')['from'](_0x511e('0x4b'));var _0x335256=squel[_0x511e('0x4c')]()['field']('u.id')[_0x511e('0x4a')](_0x511e('0x4d'))[_0x511e('0x4a')](_0x511e('0x4e'))['from'](_0x511e('0x4f'),'ui')['left_join'](_0x511e('0x50'),'u',_0x511e('0x51'));var _0x9afb04=squel[_0x511e('0x4c')]()['from'](_0x511e('0x52'),'i')[_0x511e('0x53')](_0x511e('0x54'),'c',_0x511e('0x55'))['left_join']('users','o',_0x511e('0x56'))[_0x511e('0x53')]('openchannel_accounts','a',_0x511e('0x57'))[_0x511e('0x53')]('openchannel_messages','me',_0x511e('0x58'))[_0x511e('0x53')]('openchannel_interaction_has_tags','it',_0x511e('0x59'))[_0x511e('0x53')](_0x511e('0x4b'),'t',_0x511e('0x5a'));var _0x3e0e82=squel[_0x511e('0x5b')]();var _0x40a4f3=[];var _0x496384=squel['expr']();var _0x469856;if(_0x3ea765[_0x511e('0x3e')][_0x511e('0x5c')]){_0x469856=as[_0x511e('0x5d')](_0x3ea765[_0x511e('0x3e')]['search']);var _0x33d01c=_0x469856[_0x511e('0x5e')];for(var _0x19af40=0x0;_0x19af40<_0x469856['conditions'][_0x511e('0x44')];_0x19af40++){var _0xa5849d=_0x469856[_0x511e('0x5f')][_0x19af40];var _0x401887='i';var _0x1576e6=_[_0x511e('0x60')](_0x1cc94a,[_0x511e('0x2e'),_0xa5849d[_0x511e('0x4a')]]);if(!_0x1576e6){switch(_0xa5849d[_0x511e('0x4a')]){case _0x511e('0x61'):if(_0xa5849d[_0x511e('0x62')]==0x1){_0x9afb04[_0x511e('0x63')]('`'+_0xa5849d[_0x511e('0x4a')]+_0x511e('0x64'));}else{_0x9afb04[_0x511e('0x63')]('`'+_0xa5849d[_0x511e('0x4a')]+_0x511e('0x65'));}break;case'Contact':if(_0xa5849d[_0x511e('0x66')]==='$substring'){if(_0xa5849d['value']['split']('\x20')['length']>0x1){_0x3e0e82[_0x33d01c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xa5849d[_0x511e('0x62')]),null);}else{var _0x377c92='%'+_0xa5849d['value']+'%';_0x3e0e82[_0x33d01c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x377c92,_0x377c92,_0x377c92);}}else{_0x1576e6=_[_0x511e('0x60')](_0x1cc94a,[_0x511e('0x2e'),_0x511e('0x67')]);_0xa5849d[_0x511e('0x4a')]='ContactId';_0x404f9a=as[_0x511e('0x68')](_0x401887,_0x1576e6[_0x511e('0x3b')],_0xa5849d);_0x3e0e82[_0x33d01c](_0x404f9a[_0x511e('0x69')],_0x404f9a['value'][_0x511e('0x6a')],_0x404f9a[_0x511e('0x62')][_0x511e('0x2b')]);}break;case _0x511e('0x6b'):var _0x3ad970=_0xa5849d[_0x511e('0x62')]['split'](',')['map'](function(_0x4204b){return Number(_0x4204b);});_0x3ad970['forEach'](function(_0xb0115){_0x496384['or'](_0x511e('0x6c'),'%,'+_0xb0115+',%');});_0x40a4f3=_[_0x511e('0x6d')](_0x40a4f3,_0x3ad970);break;case _0x511e('0x6e'):if(_0xa5849d[_0x511e('0x66')]==='$substring'){_0x3e0e82[_0x33d01c](_0x511e('0x6f'),'%'+_0xa5849d['value']+'%',null);}else{_0x1576e6=_[_0x511e('0x60')](_0x1cc94a,['name','UserId']);_0xa5849d[_0x511e('0x4a')]='UserId';_0x404f9a=as[_0x511e('0x68')](_0x401887,_0x1576e6['type'],_0xa5849d);_0x3e0e82[_0x33d01c](_0x404f9a[_0x511e('0x69')],_0x404f9a['value'][_0x511e('0x6a')],_0x404f9a[_0x511e('0x62')]['end']);}break;case _0x511e('0x70'):_0x404f9a=as[_0x511e('0x68')]('me',null,_0xa5849d);_0x3e0e82[_0x33d01c](_0x404f9a[_0x511e('0x69')],_0x404f9a[_0x511e('0x62')][_0x511e('0x6a')],_0x404f9a[_0x511e('0x62')][_0x511e('0x2b')]);break;}}else{var _0x404f9a=as[_0x511e('0x68')](_0x401887,_0x1576e6[_0x511e('0x3b')],_0xa5849d);_0x3e0e82[_0x33d01c](_0x404f9a['text'],_0x404f9a[_0x511e('0x62')][_0x511e('0x6a')],_0x404f9a[_0x511e('0x62')]['end']);}}}else{var _0x275bb6=_(_0x3ea765[_0x511e('0x3e')])[_0x511e('0x3f')]()['map'](function(_0x3ca8fa){return _[_0x511e('0x71')](_0x1cc94a,['name',_0x3ca8fa])?_0x3ca8fa:undefined;})[_0x511e('0x72')]()[_0x511e('0x62')]();if(!_['isEmpty'](_0x275bb6)){_0x275bb6[_0x511e('0x35')](function(_0x3bb06d){if(_0x3bb06d===_0x511e('0x73')){_0x9afb04[_0x511e('0x48')](_0x511e('0x74'),[][_0x511e('0x75')](_0x3ea765[_0x511e('0x3e')][_0x3bb06d]));}else if(_0x3bb06d==='createdAt'){var _0x499334=JSON[_0x511e('0x76')](_0x3ea765['query'][_0x3bb06d])[_0x511e('0x77')];var _0x592ec4=JSON['parse'](_0x3ea765[_0x511e('0x3e')][_0x3bb06d])[_0x511e('0x78')];_0x9afb04[_0x511e('0x48')](_0x511e('0x79'),_0x499334,_0x592ec4);}else{if(_0x3ea765[_0x511e('0x3e')][_0x3bb06d]===_0x511e('0x7a')){_0x9afb04[_0x511e('0x48')]('i.'+_0x3bb06d+_0x511e('0x7b'));}else{_0x9afb04[_0x511e('0x48')]('i.'+_0x3bb06d+'\x20=\x20?',_0x3ea765[_0x511e('0x3e')][_0x3bb06d]);}}});}if(_0x3ea765[_0x511e('0x3e')]['read']){if(_0x3ea765[_0x511e('0x3e')][_0x511e('0x7c')]==0x1){_0x9afb04[_0x511e('0x63')](_0x511e('0x7d'));}else{_0x9afb04[_0x511e('0x63')](_0x511e('0x7e'));}}if(_0x3ea765[_0x511e('0x3e')][_0x511e('0x7f')]){_0x40a4f3=_[_0x511e('0x80')](_0x3ea765[_0x511e('0x3e')]['tag'])?_0x3ea765[_0x511e('0x3e')]['tag']:new Array(_0x3ea765[_0x511e('0x3e')][_0x511e('0x7f')]);_0x40a4f3[_0x511e('0x35')](function(_0x776009){_0x496384['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x776009+',%');});}if(_0x3ea765[_0x511e('0x3e')][_0x511e('0x81')]){var _0x3c429d=_0x3ea765[_0x511e('0x3e')]['filter'][_0x511e('0x82')]('\x5c','\x5c\x5c')[_0x511e('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3c429d)){_0x3e0e82['or'](_0x511e('0x83'),_0x3c429d+'%');}else{_0x3e0e82['or'](_0x511e('0x84'),qs[_0x511e('0x85')](_0x3c429d))['or'](_0x511e('0x86'),_0x3c429d+'%')['or'](_0x511e('0x87'),_0x3c429d+'%');}}}_0x9afb04[_0x511e('0x48')](_0x3e0e82);_0x9afb04['group'](_0x511e('0x88'));var _0x5e5755={'type':db[_0x511e('0x89')][_0x511e('0x8a')][_0x511e('0x8b')],'raw':!![]};var _0x180976=_0x9afb04[_0x511e('0x8c')]();_0x180976[_0x511e('0x4a')]('i.id');_0x180976[_0x511e('0x4a')](_0x511e('0x8d'),_0x511e('0x61'));if(_0x51d859[_0x511e('0x8e')]){_0x51d859[_0x511e('0x8e')][_0x511e('0x35')](function(_0x2b3d55){var _0x14c5a3=_0x2b3d55[0x0]==='contactName'?_0x2b3d55[0x0]:'i.'+_0x2b3d55[0x0];_0x9afb04[_0x511e('0x8e')](_0x14c5a3,_0x2b3d55[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x40a4f3)){_0x9afb04['having'](_0x496384);_0x180976[_0x511e('0x48')](_0x511e('0x8f'),_0x40a4f3);}BPromise['resolve']()[_0x511e('0x29')](function(){if(!_0x469856){if(_0x3ea765[_0x511e('0x3e')][_0x511e('0x73')])return;_0x180976[_0x511e('0x48')](_0x511e('0x90'));_0x9afb04[_0x511e('0x48')](_0x511e('0x90'));return;}if(_0x3ea765[_0x511e('0x91')][_0x511e('0x92')]!=='agent')return;return _0x3ea765[_0x511e('0x91')][_0x511e('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5a4842){if(_[_0x511e('0x94')](_0x5a4842)){_0x180976['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x9afb04[_0x511e('0x48')](_0x511e('0x95'));}else{_0x180976[_0x511e('0x48')](_0x511e('0x74'),_[_0x511e('0x31')](_0x5a4842,'id'));_0x9afb04['where'](_0x511e('0x74'),_[_0x511e('0x31')](_0x5a4842,'id'));}});})[_0x511e('0x29')](function(){if(_0x3ea765[_0x511e('0x91')][_0x511e('0x92')]===_0x511e('0x96')&&!_0x469856&&!_0x3ea765[_0x511e('0x3e')][_0x511e('0x73')])return[];return db[_0x511e('0x97')]['query'](_0x180976[_0x511e('0x98')](),_0x5e5755);})[_0x511e('0x29')](function(_0x1264e3){_0xbd83e4['count']=_0x1264e3['length'];if(_0xbd83e4[_0x511e('0x23')]===0x0)return[];return db[_0x511e('0x97')]['query'](_0x22e072[_0x511e('0x98')](),_0x5e5755)[_0x511e('0x29')](function(_0x4706ce){_0x8fe724=_[_0x511e('0x99')](_0x4706ce,'id');_0x5e5755=_[_0x511e('0x9a')](_0x5e5755,{'model':db[_0x511e('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ea765[_0x511e('0x3e')]['fields']){_0x51d859['attributes'][_0x511e('0x35')](function(_0xc3913e){_0x9afb04[_0x511e('0x4a')]('i.'+_0xc3913e);});}else{_0x9afb04[_0x511e('0x4a')](_0x511e('0x8d'),_0x511e('0x61'));_0x9afb04[_0x511e('0x4a')](_0x511e('0x9b'),_0x511e('0x9c'));_0x9afb04[_0x511e('0x4a')](_0x511e('0x9d'),'Account.mandatoryDisposition');_0x9afb04['field'](_0x511e('0x9e'),'contactName');_0x9afb04['field'](_0x511e('0x9f'));_0x9afb04[_0x511e('0x4a')](_0x511e('0xa0'),_0x511e('0xa1'));_0x9afb04[_0x511e('0x4a')]('c.lastName',_0x511e('0xa2'));_0x9afb04[_0x511e('0x4a')]('c.email',_0x511e('0xa3'));_0x9afb04[_0x511e('0x4a')](_0x511e('0xa4'),'Contact.phone');_0x9afb04[_0x511e('0x4a')](_0x511e('0xa5'),_0x511e('0xa6'));_0x9afb04[_0x511e('0x4a')](_0x511e('0xa7'),_0x511e('0xa8'));_0x9afb04[_0x511e('0x4a')](_0x511e('0xa9'),_0x511e('0xaa'));_0x9afb04[_0x511e('0x4a')](_0x511e('0xab'),_0x511e('0xac'));_0x9afb04[_0x511e('0x4a')](_0x511e('0xad'),_0x511e('0x33'));}if(_0x51d859['limit'])_0x9afb04[_0x511e('0x46')](_0x51d859[_0x511e('0x46')]);if(_0x51d859[_0x511e('0x21')])_0x9afb04[_0x511e('0x21')](_0x51d859[_0x511e('0x21')]);return db['sequelize'][_0x511e('0x3e')](_0x9afb04[_0x511e('0x98')](),_0x5e5755);})[_0x511e('0x29')](function(_0x1a25fb){if(_0x1a25fb[_0x511e('0x44')]>0x0)_0x335256[_0x511e('0x48')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x511e('0x31')](_0x1a25fb,'id'));return db[_0x511e('0x97')][_0x511e('0x3e')](_0x335256[_0x511e('0x98')](),_0x5e5755)[_0x511e('0x29')](function(_0x5eb7f7){var _0x488480=_[_0x511e('0xae')](_0x5eb7f7,_0x511e('0xaf'));var _0x388bd3=[];_0x1a25fb[_0x511e('0x35')](function(_0xb90766){_0x388bd3[_0x511e('0x37')](updateOpenchannelInteraction(_0xb90766,_0x8fe724,_0x488480));});return BPromise[_0x511e('0xb0')](_0x388bd3);});});})[_0x511e('0x29')](function(_0x4350cc){_0xbd83e4[_0x511e('0xb1')]=_0x4350cc;return _0xbd83e4;})[_0x511e('0x29')](respondWithFilteredResult(_0x1525bd,_0x51d859))[_0x511e('0x38')](handleError(_0x1525bd,null));};exports[_0x511e('0xb2')]=function(_0xeb86ea,_0x43f09){var _0x1eefef={};if(_0xeb86ea[_0x511e('0x3e')][_0x511e('0x3b')]&&_0xeb86ea[_0x511e('0x3e')]['type']===_0x511e('0xb3')){_0x1eefef['from']=_0xeb86ea['params']['id'];}else{_0x1eefef['id']=_0xeb86ea[_0x511e('0xb4')]['id'];}var _0x89822e={'raw':![],'where':_0x1eefef},_0x3dff4d={};_0x3dff4d[_0x511e('0x3d')]=_[_0x511e('0x3f')](db[_0x511e('0x3a')][_0x511e('0xb5')]);_0x3dff4d['query']=_[_0x511e('0x3f')](_0xeb86ea['query']);_0x3dff4d['filters']=_['intersection'](_0x3dff4d['model'],_0x3dff4d[_0x511e('0x3e')]);_0x89822e[_0x511e('0x42')]=_['intersection'](_0x3dff4d[_0x511e('0x3d')],qs[_0x511e('0x43')](_0xeb86ea['query'][_0x511e('0x43')]));_0x89822e[_0x511e('0x42')]=_0x89822e[_0x511e('0x42')][_0x511e('0x44')]?_0x89822e['attributes']:_0x3dff4d['model'];if(_0xeb86ea['query']['includeAll']){_0x89822e[_0x511e('0xb6')]=[{'all':!![]}];}_0x89822e=_[_0x511e('0x9a')]({},_0x89822e,_0xeb86ea[_0x511e('0xb7')]);return db['OpenchannelInteraction'][_0x511e('0x60')](_0x89822e)[_0x511e('0x29')](handleEntityNotFound(_0x43f09,null))[_0x511e('0x29')](respondWithResult(_0x43f09,null))['catch'](handleError(_0x43f09,null));};exports[_0x511e('0xb8')]=function(_0x189c8a,_0xf7edbe){return db[_0x511e('0x3a')][_0x511e('0xb8')](_0x189c8a[_0x511e('0x70')],{})['then'](respondWithResult(_0xf7edbe,0xc9))[_0x511e('0x38')](handleError(_0xf7edbe,null));};exports[_0x511e('0x28')]=function(_0x336ae3,_0x1ee6c8){if(_0x336ae3[_0x511e('0x70')]['id']){delete _0x336ae3[_0x511e('0x70')]['id'];}return db['OpenchannelInteraction'][_0x511e('0x60')]({'where':{'id':_0x336ae3[_0x511e('0xb4')]['id']}})[_0x511e('0x29')](handleEntityNotFound(_0x1ee6c8,null))[_0x511e('0x29')](saveUpdates(_0x336ae3['body'],null))[_0x511e('0x29')](respondWithResult(_0x1ee6c8,null))[_0x511e('0x38')](handleError(_0x1ee6c8,null));};exports['destroy']=function(_0x2afc96,_0x35fb68){return db['OpenchannelInteraction'][_0x511e('0x60')]({'where':{'id':_0x2afc96[_0x511e('0xb4')]['id']}})[_0x511e('0x29')](handleEntityNotFound(_0x35fb68,null))['then'](removeEntity(_0x35fb68,null))[_0x511e('0x38')](handleError(_0x35fb68,null));};exports['describe']=function(_0x5af211,_0x2b4c7b){return db[_0x511e('0x3a')][_0x511e('0xb9')]()['then'](respondWithResult(_0x2b4c7b,null))[_0x511e('0x38')](handleError(_0x2b4c7b,null));};exports[_0x511e('0xba')]=function(_0xec134a,_0x233fc6,_0x437fbd){return db[_0x511e('0xbb')][_0x511e('0x60')]({'where':{'id':_0xec134a[_0x511e('0xb4')]['id']}})['then'](handleEntityNotFound(_0x233fc6,null))[_0x511e('0x29')](function(_0x307cbb){if(_0x307cbb){return _0x307cbb[_0x511e('0xba')](_0xec134a['body'][_0x511e('0xbc')],_[_0x511e('0xbd')](_0xec134a[_0x511e('0x70')],['ids','id'])||{});}})[_0x511e('0x29')](respondWithResult(_0x233fc6,null))[_0x511e('0x38')](handleError(_0x233fc6,null));};exports['getMessages']=function(_0x2935d1,_0x18feb0,_0x56d8c4){var _0x5e623e={'raw':![],'where':{}};var _0x39d641={};var _0x262928={'count':0x0,'rows':[]};return db[_0x511e('0x3a')][_0x511e('0xbe')]({'where':{'id':_0x2935d1[_0x511e('0xb4')]['id']}})[_0x511e('0x29')](handleEntityNotFound(_0x18feb0,null))[_0x511e('0x29')](function(_0x39bf9b){if(_0x39bf9b){_0x39d641[_0x511e('0x3d')]=_[_0x511e('0x3f')](db[_0x511e('0xbb')]['rawAttributes']);_0x39d641[_0x511e('0x3e')]=_[_0x511e('0x3f')](_0x2935d1['query']);_0x39d641[_0x511e('0x40')]=_['intersection'](_0x39d641[_0x511e('0x3d')],_0x39d641['query']);_0x5e623e[_0x511e('0x42')]=_[_0x511e('0x41')](_0x39d641[_0x511e('0x3d')],qs['fields'](_0x2935d1[_0x511e('0x3e')][_0x511e('0x43')]));_0x5e623e[_0x511e('0x42')]=_0x5e623e[_0x511e('0x42')][_0x511e('0x44')]?_0x5e623e[_0x511e('0x42')]:_0x39d641[_0x511e('0x3d')];if(!_0x2935d1[_0x511e('0x3e')]['hasOwnProperty']('nolimit')){_0x5e623e[_0x511e('0x46')]=qs[_0x511e('0x46')](_0x2935d1['query'][_0x511e('0x46')]);_0x5e623e['offset']=qs['offset'](_0x2935d1[_0x511e('0x3e')][_0x511e('0x21')]);}_0x5e623e[_0x511e('0x8e')]=qs['sort'](_0x2935d1[_0x511e('0x3e')][_0x511e('0x47')]);_0x5e623e[_0x511e('0x48')]=qs[_0x511e('0x40')](_['pick'](_0x2935d1[_0x511e('0x3e')],_0x39d641[_0x511e('0x40')]));_0x5e623e[_0x511e('0x48')][_0x511e('0xaf')]=_0x39bf9b['id'];if(_0x2935d1[_0x511e('0x3e')]['filter']){_0x5e623e['where']=_[_0x511e('0x9a')](_0x5e623e[_0x511e('0x48')],{'$or':_[_0x511e('0x31')](_0x5e623e[_0x511e('0x42')],function(_0x86d8fc){var _0x10fabd={};_0x10fabd[_0x86d8fc]={'$like':'%'+_0x2935d1[_0x511e('0x3e')][_0x511e('0x81')]+'%'};return _0x10fabd;})});}if(_0x2935d1[_0x511e('0x3e')][_0x511e('0x77')]){var _0x341e95=_0x2935d1[_0x511e('0x3e')][_0x511e('0x77')][_0x511e('0x34')](',');var _0x25d588={};_0x25d588[_0x341e95[0x0]]={'$gte':moment(_0x341e95[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5e623e[_0x511e('0x48')]=_[_0x511e('0x9a')](_0x5e623e[_0x511e('0x48')],_0x25d588);}_0x5e623e=_['merge']({},_0x5e623e,_0x2935d1[_0x511e('0xb7')]);return db[_0x511e('0xbb')]['count']({'where':_0x5e623e[_0x511e('0x48')]})[_0x511e('0x29')](function(_0x44ea3d){_0x262928[_0x511e('0x23')]=_0x44ea3d;if(_0x2935d1[_0x511e('0x3e')][_0x511e('0xbf')]){_0x5e623e['include']=[{'all':!![]}];}return db[_0x511e('0xbb')]['findAll'](_0x5e623e);})[_0x511e('0x29')](function(_0x5b8a45){_0x262928[_0x511e('0xb1')]=_0x5b8a45;return _0x262928;});}})[_0x511e('0x29')](respondWithFilteredResult(_0x18feb0,_0x5e623e))[_0x511e('0x38')](handleError(_0x18feb0,null));};exports[_0x511e('0xc0')]=function(_0x36883e,_0x36d0a9,_0x5e45ee){return db[_0x511e('0x3a')][_0x511e('0x60')]({'where':{'id':_0x36883e[_0x511e('0xb4')]['id']}})[_0x511e('0x29')](handleEntityNotFound(_0x36d0a9,null))['then'](function(_0x547f6f){if(_0x547f6f){return _0x547f6f['setTags'](_0x36883e['body'][_0x511e('0xbc')],_[_0x511e('0xbd')](_0x36883e[_0x511e('0x70')],[_0x511e('0xbc'),'id'])||{})[_0x511e('0xc1')](function(){return db[_0x511e('0x6b')][_0x511e('0xc2')]({'attributes':['id',_0x511e('0x2e'),_0x511e('0xc3')],'where':{'id':_0x36883e[_0x511e('0x70')][_0x511e('0xbc')]}});})[_0x511e('0x29')](function(_0x3c3cca){socket[_0x511e('0xc4')](_0x511e('0xc5'),{'id':Number(_0x36883e[_0x511e('0xb4')]['id']),'tags':_0x3c3cca||[]});return{'id':Number(_0x36883e[_0x511e('0xb4')]['id']),'tags':_0x3c3cca||[]};});}})[_0x511e('0x29')](respondWithResult(_0x36d0a9,null))[_0x511e('0x38')](handleError(_0x36d0a9,null));};exports['removeTags']=function(_0x3ba9c8,_0x1e11fa,_0x13bdbb){return db[_0x511e('0x3a')][_0x511e('0x60')]({'where':{'id':_0x3ba9c8[_0x511e('0xb4')]['id']}})[_0x511e('0x29')](handleEntityNotFound(_0x1e11fa,null))[_0x511e('0x29')](function(_0x48dde7){if(_0x48dde7){return _0x48dde7[_0x511e('0xc6')](_0x3ba9c8[_0x511e('0x3e')]['ids']);}})[_0x511e('0x29')](respondWithStatusCode(_0x1e11fa,null))['catch'](handleError(_0x1e11fa,null));};exports[_0x511e('0xc7')]=function(_0x516299,_0x146d0d){var _0xae7f2a=moment()[_0x511e('0xc8')]()['toString']();var _0x26ab41=path[_0x511e('0xc9')](config[_0x511e('0xca')],'server','files',_0x511e('0xcb'));var _0xa167bc=path[_0x511e('0xc9')](config['root'],_0x511e('0xcc'),_0x511e('0xcd'),_0x511e('0xce'));var _0x184946=path[_0x511e('0xc9')](_0x26ab41,_0xae7f2a);var _0x3af9ea=util[_0x511e('0xcf')](_0x511e('0xd0'),_0x516299[_0x511e('0xb4')]['id'],_0xae7f2a);var _0x5cb432=path['join'](_0x26ab41,_0x3af9ea);var _0xf8d72e=[];_0xf8d72e[_0x511e('0x37')]({'model':db[_0x511e('0x6e')],'as':_0x511e('0x6e'),'attributes':['id',_0x511e('0x32')],'raw':!![]});_0xf8d72e[_0x511e('0x37')]({'model':db[_0x511e('0xd1')],'as':'Contact','attributes':['id',_0x511e('0xd2'),_0x511e('0xd3')],'raw':!![]});if(_0x516299[_0x511e('0x3e')][_0x511e('0xce')]){_0xf8d72e[_0x511e('0x37')]({'model':db[_0x511e('0xd4')],'as':_0x511e('0xd4'),'raw':!![]});}var _0xcbbabc=[{'model':db[_0x511e('0xbb')],'as':_0x511e('0xd5'),'attributes':['id',_0x511e('0x70'),_0x511e('0xd6'),'direction',_0x511e('0xd7'),_0x511e('0x7c')],'include':_0xf8d72e}];_0xcbbabc[_0x511e('0x37')]({'model':db[_0x511e('0xd8')],'as':_0x511e('0xd9'),'attributes':['id',_0x511e('0x2e')]});_0xcbbabc[_0x511e('0x37')]({'model':db['User'],'as':_0x511e('0xda'),'attributes':['id',_0x511e('0x32')]});return db[_0x511e('0x3a')][_0x511e('0x60')]({'where':{'id':_0x516299[_0x511e('0xb4')]['id']},'include':_0xcbbabc})[_0x511e('0x29')](handleEntityNotFound(_0x146d0d,null))[_0x511e('0x29')](function(_0x52ed77){if(_0x52ed77){var _0x149f7d=_0x52ed77['get']({'plain':!![]});fs[_0x511e('0xdb')](_0x184946);var _0xa75cd8={'channel':'Openchannel','account':_0x149f7d[_0x511e('0xd9')][_0x511e('0x2e')],'agent':_0x149f7d[_0x511e('0xda')]?_0x149f7d['Owner'][_0x511e('0x32')]:_0x511e('0xdc'),'createdAt':moment(_0x149f7d[_0x511e('0xd6')])[_0x511e('0xcf')](_0x511e('0xdd'))[_0x511e('0x98')](),'closedAt':_0x149f7d[_0x511e('0xde')]?moment(_0x149f7d[_0x511e('0xdf')])[_0x511e('0xcf')](_0x511e('0xdd'))[_0x511e('0x98')]():'','disposition':_0x149f7d[_0x511e('0xe0')],'visibility':_0x149f7d['threadId']?_0x511e('0xe1'):_0x511e('0xe2'),'messages':_(_0x149f7d['Messages'])[_0x511e('0x81')]({'secret':![]})[_0x511e('0x31')](function(_0x4caef9){if(_0x4caef9[_0x511e('0xd4')]){var _0x54fb7d=path[_0x511e('0xc9')](_0xa167bc,_0x4caef9[_0x511e('0xd4')][_0x511e('0xe3')]);if(fs['existsSync'](_0x54fb7d)){fs[_0x511e('0xe4')](_0x54fb7d)[_0x511e('0xe5')](fs[_0x511e('0xe6')](path['join'](_0x184946,_0x4caef9['Attachment']['basename'])));}}return{'date':moment(_0x4caef9[_0x511e('0xd6')])[_0x511e('0xcf')](_0x511e('0xdd'))[_0x511e('0x98')](),'sender':_0x4caef9[_0x511e('0xe7')]===_0x511e('0xe8')?_0x4caef9[_0x511e('0x6e')]?_0x4caef9[_0x511e('0x6e')][_0x511e('0x32')]:_0x511e('0xe9'):_0x4caef9[_0x511e('0xea')][_0x511e('0xd2')]+(_0x4caef9['Contact'][_0x511e('0xd3')]?'\x20'+_0x4caef9[_0x511e('0xea')][_0x511e('0xd3')]:''),'body':_0x4caef9[_0x511e('0xd4')]?_0x4caef9[_0x511e('0xd4')]['basename']:_0x4caef9[_0x511e('0x70')],'direction':_0x4caef9[_0x511e('0xe7')]===_0x511e('0xe8')?'A':'C','secret':_0x4caef9['secret'],'read':_0x4caef9[_0x511e('0x7c')],'attachment':_0x4caef9['Attachment']};})[_0x511e('0x62')]()};return ejs[_0x511e('0xeb')](path[_0x511e('0xc9')](config[_0x511e('0xca')],'server','views','downloadInteraction.ejs'),{'interaction':_0xa75cd8})[_0x511e('0x29')](function(_0x1c5cc4){var _0xd3a838=path[_0x511e('0xc9')](_0x184946,_0x511e('0xec')+_0x149f7d['id']+'-'+_0xae7f2a+_0x511e('0xed'));var _0x1e7807={'path':_0xd3a838,'channel':_0x511e('0xee'),'interactionId':_0x149f7d['id']};return pdf[_0x511e('0xef')](_0x1c5cc4,_0x1e7807);})[_0x511e('0x29')](function(){return new BPromise(function(_0xf0e27f,_0x44d7fd){zipdir(_0x184946,{'saveTo':_0x5cb432},function(_0xe224fd,_0x26a7a4){if(_0xe224fd)return _0x44d7fd(_0xe224fd);return _0xf0e27f(_0x26a7a4);});})[_0x511e('0x29')](function(){return new BPromise(function(_0x32d64b,_0x4087ce){rimraf(_0x184946,function(_0xfd886c){if(_0xfd886c)_0x4087ce(_0xfd886c);return _0x32d64b();});});})[_0x511e('0x29')](function(){return _0x146d0d[_0x511e('0xc7')](_0x5cb432,_0x3af9ea,function(_0x9009ea){if(_0x9009ea){console['log'](_0x511e('0xf0'),_0x9009ea);}else{fs[_0x511e('0xf1')](_0x5cb432);}});});});}else{return _0x146d0d['sendStatus'](0xc8);}})['catch'](handleError(_0x146d0d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 648a109..6388a19 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 _0xebe6=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','setDataValue','Users','findAll','then','unreadMessages','length'];(function(_0x3e7fa3,_0x4c789d){var _0x2d738e=function(_0x3a9252){while(--_0x3a9252){_0x3e7fa3['push'](_0x3e7fa3['shift']());}};_0x2d738e(++_0x4c789d);}(_0xebe6,0x64));var _0x6ebe=function(_0x476b5f,_0x1f9952){_0x476b5f=_0x476b5f-0x0;var _0x5a23d8=_0xebe6[_0x476b5f];return _0x5a23d8;};'use strict';var EventEmitter=require(_0x6ebe('0x0'));var OpenchannelInteraction=require(_0x6ebe('0x1'))['db'][_0x6ebe('0x2')];var OpenchannelMessage=require(_0x6ebe('0x1'))['db'][_0x6ebe('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6ebe('0x4')](0x0);var events={'afterCreate':_0x6ebe('0x5'),'afterUpdate':_0x6ebe('0x6'),'afterDestroy':_0x6ebe('0x7')};function emitEvent(_0x522916){return function(_0x1084e5,_0x4313a0,_0x437bf5){_0x1084e5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xccb201){_0x1084e5[_0x6ebe('0x8')](_0x6ebe('0x9'),_0xccb201['map'](function(_0x323738){return{'id':_0x323738['id']};}));return OpenchannelMessage[_0x6ebe('0xa')]({'where':{'OpenchannelInteractionId':_0x1084e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6ebe('0xb')](function(_0x4321f7){_0x1084e5[_0x6ebe('0x8')](_0x6ebe('0xc'),_0x4321f7[_0x6ebe('0xd')]);OpenchannelInteractionEvents[_0x6ebe('0xe')](_0x522916+':'+_0x1084e5['id'],_0x1084e5);OpenchannelInteractionEvents['emit'](_0x522916,_0x1084e5);_0x437bf5(null);})[_0x6ebe('0xf')](_0x437bf5(null));};}for(var e in events){if(events[_0x6ebe('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x6ebe('0x11')](e,emitEvent(event));}}module[_0x6ebe('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7130=['update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7130,0xaf));var _0x0713=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7130[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0x0713('0x0'));var OpenchannelInteraction=require(_0x0713('0x1'))['db'][_0x0713('0x2')];var OpenchannelMessage=require(_0x0713('0x1'))['db'][_0x0713('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0713('0x4'),'afterUpdate':_0x0713('0x5'),'afterDestroy':_0x0713('0x6')};function emitEvent(_0x548b77){return function(_0x418461,_0x543022,_0x2c3f44){_0x418461[_0x0713('0x7')]({'attributes':['id'],'raw':!![]})[_0x0713('0x8')](function(_0x35745b){_0x418461[_0x0713('0x9')](_0x0713('0xa'),_0x35745b[_0x0713('0xb')](function(_0x28dfd2){return{'id':_0x28dfd2['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x418461['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1cf4d9){_0x418461[_0x0713('0x9')]('unreadMessages',_0x1cf4d9[_0x0713('0xc')]);OpenchannelInteractionEvents['emit'](_0x548b77+':'+_0x418461['id'],_0x418461);OpenchannelInteractionEvents[_0x0713('0xd')](_0x548b77,_0x418461);_0x2c3f44(null);})[_0x0713('0xe')](_0x2c3f44(null));};}for(var e in events){if(events[_0x0713('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x0713('0x10')](e,emitEvent(event));}}module[_0x0713('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f8b16ec..85d0394 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 _0x5888=['exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5888,0x15f));var _0x8588=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x5888[_0x100e36];return _0x1df0c9;};'use strict';var _=require(_0x8588('0x0'));var util=require(_0x8588('0x1'));var logger=require(_0x8588('0x2'))('api');var moment=require(_0x8588('0x3'));var BPromise=require(_0x8588('0x4'));var rp=require(_0x8588('0x5'));var fs=require('fs');var path=require(_0x8588('0x6'));var rimraf=require(_0x8588('0x7'));var config=require(_0x8588('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x8588('0x9')]=function(_0x338dc0,_0x2aef48){return _0x338dc0[_0x8588('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x7c573c,_0x37e90d,_0x4ab05f){if(_0x7c573c[_0x8588('0xb')](_0x8588('0xc'))){_0x7c573c['closedAt']=moment()[_0x8588('0xd')](_0x8588('0xe'));}_0x4ab05f(null,_0x7c573c);}}});}; \ No newline at end of file +var _0xa22a=['utf8mb4','utf8mb4_unicode_ci','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions'];(function(_0x2d84f8,_0xe1eb98){var _0x1ee49c=function(_0x562b61){while(--_0x562b61){_0x2d84f8['push'](_0x2d84f8['shift']());}};_0x1ee49c(++_0xe1eb98);}(_0xa22a,0xe0));var _0xaa22=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa22a[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xaa22('0x0'));var logger=require(_0xaa22('0x1'))(_0xaa22('0x2'));var moment=require(_0xaa22('0x3'));var BPromise=require(_0xaa22('0x4'));var rp=require(_0xaa22('0x5'));var fs=require('fs');var path=require(_0xaa22('0x6'));var rimraf=require(_0xaa22('0x7'));var config=require(_0xaa22('0x8'));var attributes=require(_0xaa22('0x9'));module[_0xaa22('0xa')]=function(_0x1da2d5,_0x589456){return _0x1da2d5[_0xaa22('0xb')](_0xaa22('0xc'),attributes,{'tableName':_0xaa22('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa22('0xe'),'collate':_0xaa22('0xf'),'hooks':{'beforeUpdate':function(_0x337b6c,_0x507980,_0x437587){if(_0x337b6c['changed']('closed')){_0x337b6c['closedAt']=moment()['format'](_0xaa22('0x10'));}_0x437587(null,_0x337b6c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ef4a5b1..f91eb92 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 _0x39e2=['client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateOpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1ee35d,_0x56b6a8){var _0x1338d2=function(_0x16820d){while(--_0x16820d){_0x1ee35d['push'](_0x1ee35d['shift']());}};_0x1338d2(++_0x56b6a8);}(_0x39e2,0x72));var _0x239e=function(_0xb81e45,_0x32f5dd){_0xb81e45=_0xb81e45-0x0;var _0x3f96cf=_0x39e2[_0xb81e45];return _0x3f96cf;};'use strict';var _=require(_0x239e('0x0'));var util=require(_0x239e('0x1'));var moment=require('moment');var BPromise=require(_0x239e('0x2'));var rs=require(_0x239e('0x3'));var fs=require('fs');var Redis=require(_0x239e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x239e('0x5'));var logger=require(_0x239e('0x6'))('rpc');var config=require(_0x239e('0x7'));var jayson=require(_0x239e('0x8'));var client=jayson[_0x239e('0x9')][_0x239e('0xa')]({'port':0x232a});config[_0x239e('0xb')]=_['defaults'](config[_0x239e('0xb')],{'host':_0x239e('0xc'),'port':0x18eb});var socket=require(_0x239e('0xd'))(new Redis(config['redis']));require(_0x239e('0xe'))[_0x239e('0xf')](socket);function respondWithRpcPromise(_0x3e0880,_0x53d9f2,_0x25b65){return new BPromise(function(_0x56425f,_0x503a84){return client[_0x239e('0x10')](_0x3e0880,_0x25b65)[_0x239e('0x11')](function(_0xc3a253){logger['info'](_0x239e('0x12'),_0x53d9f2,_0x239e('0x13'));logger['debug'](_0x239e('0x14'),_0x53d9f2,_0x239e('0x13'),JSON[_0x239e('0x15')](_0xc3a253));if(_0xc3a253['error']){if(_0xc3a253[_0x239e('0x16')]['code']===0x1f4){logger[_0x239e('0x16')](_0x239e('0x12'),_0x53d9f2,_0xc3a253[_0x239e('0x16')][_0x239e('0x17')]);return _0x503a84(_0xc3a253[_0x239e('0x16')][_0x239e('0x17')]);}logger[_0x239e('0x16')](_0x239e('0x12'),_0x53d9f2,_0xc3a253[_0x239e('0x16')][_0x239e('0x17')]);return _0x56425f(_0xc3a253[_0x239e('0x16')]['message']);}else{logger[_0x239e('0x18')](_0x239e('0x12'),_0x53d9f2,'request\x20sent');_0x56425f(_0xc3a253[_0x239e('0x19')][_0x239e('0x17')]);}})[_0x239e('0x1a')](function(_0x388409){logger[_0x239e('0x16')](_0x239e('0x12'),_0x53d9f2,_0x388409);_0x503a84(_0x388409);});});}exports[_0x239e('0x1b')]=function(_0x1a853e){var _0x186cff=this;return new Promise(function(_0x2d6f3e,_0x27c214){return db['OpenchannelInteraction'][_0x239e('0x1c')](_0x1a853e[_0x239e('0x1d')],{'raw':_0x1a853e['options']?_0x1a853e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a853e[_0x239e('0x1e')]?_0x1a853e['options'][_0x239e('0x1f')]||null:null,'attributes':_0x1a853e[_0x239e('0x1e')]?_0x1a853e[_0x239e('0x1e')][_0x239e('0x20')]||null:null,'limit':_0x1a853e[_0x239e('0x1e')]?_0x1a853e['options'][_0x239e('0x21')]||null:null})[_0x239e('0x11')](function(_0x50fe54){logger['info'](_0x239e('0x1b'),_0x1a853e);logger['debug'](_0x239e('0x1b'),_0x1a853e,JSON['stringify'](_0x50fe54));_0x2d6f3e(_0x50fe54);})['catch'](function(_0x31a462){logger[_0x239e('0x16')](_0x239e('0x1b'),_0x31a462['message'],_0x1a853e);_0x27c214(_0x186cff[_0x239e('0x16')](0x1f4,_0x31a462[_0x239e('0x17')]));});});};exports[_0x239e('0x22')]=function(_0x69e130){return new Promise(function(_0x59db69,_0x254415){return db['OpenchannelInteraction']['find']({'where':_0x69e130['options']?_0x69e130[_0x239e('0x1e')][_0x239e('0x1f')]||null:null})[_0x239e('0x11')](function(_0x509b72){if(_0x509b72){return _0x509b72[_0x239e('0x23')](_0x69e130['body'][_0x239e('0x24')],_[_0x239e('0x25')](_0x69e130['body'],[_0x239e('0x24'),'id'])||{});}})[_0x239e('0x26')](function(_0x28898d){logger['info'](_0x239e('0x27'),_0x69e130);logger[_0x239e('0x28')](_0x239e('0x27'),_0x69e130,JSON['stringify'](_0x28898d));_0x59db69(_0x28898d);})[_0x239e('0x1a')](function(_0x2c6ff4){logger[_0x239e('0x16')](_0x239e('0x27'),_0x2c6ff4[_0x239e('0x17')],_0x69e130);_0x254415(_this[_0x239e('0x16')](0x1f4,_0x2c6ff4[_0x239e('0x17')]));});});}; \ No newline at end of file +var _0x8e63=['register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateOpenchannelInteraction','body','options','raw','limit','stringify','catch','OpenchannelInteraction','where','addTags','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket'];(function(_0x1f9828,_0x59ee2d){var _0x5779c0=function(_0x15c40f){while(--_0x15c40f){_0x1f9828['push'](_0x1f9828['shift']());}};_0x5779c0(++_0x59ee2d);}(_0x8e63,0x1b7));var _0x38e6=function(_0x137048,_0x2e4aa2){_0x137048=_0x137048-0x0;var _0x27c94f=_0x8e63[_0x137048];return _0x27c94f;};'use strict';var _=require('lodash');var util=require(_0x38e6('0x0'));var moment=require(_0x38e6('0x1'));var BPromise=require(_0x38e6('0x2'));var rs=require(_0x38e6('0x3'));var fs=require('fs');var Redis=require(_0x38e6('0x4'));var db=require(_0x38e6('0x5'))['db'];var utils=require(_0x38e6('0x6'));var logger=require(_0x38e6('0x7'))('rpc');var config=require(_0x38e6('0x8'));var jayson=require(_0x38e6('0x9'));var client=jayson[_0x38e6('0xa')][_0x38e6('0xb')]({'port':0x232a});config['redis']=_[_0x38e6('0xc')](config[_0x38e6('0xd')],{'host':_0x38e6('0xe'),'port':0x18eb});var socket=require(_0x38e6('0xf'))(new Redis(config[_0x38e6('0xd')]));require(_0x38e6('0x10'))[_0x38e6('0x11')](socket);function respondWithRpcPromise(_0x38cdcb,_0x5bacf3,_0x47761e){return new BPromise(function(_0x319321,_0x542766){return client['request'](_0x38cdcb,_0x47761e)[_0x38e6('0x12')](function(_0x44abf5){logger[_0x38e6('0x13')](_0x38e6('0x14'),_0x5bacf3,_0x38e6('0x15'));logger[_0x38e6('0x16')](_0x38e6('0x17'),_0x5bacf3,_0x38e6('0x15'),JSON['stringify'](_0x44abf5));if(_0x44abf5['error']){if(_0x44abf5[_0x38e6('0x18')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5bacf3,_0x44abf5[_0x38e6('0x18')][_0x38e6('0x19')]);return _0x542766(_0x44abf5[_0x38e6('0x18')][_0x38e6('0x19')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5bacf3,_0x44abf5[_0x38e6('0x18')][_0x38e6('0x19')]);return _0x319321(_0x44abf5[_0x38e6('0x18')][_0x38e6('0x19')]);}else{logger[_0x38e6('0x13')](_0x38e6('0x14'),_0x5bacf3,'request\x20sent');_0x319321(_0x44abf5['result'][_0x38e6('0x19')]);}})['catch'](function(_0x2a77db){logger[_0x38e6('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5bacf3,_0x2a77db);_0x542766(_0x2a77db);});});}exports[_0x38e6('0x1a')]=function(_0xd122c5){var _0x230395=this;return new Promise(function(_0x1bd2b7,_0x1baf24){return db['OpenchannelInteraction']['update'](_0xd122c5[_0x38e6('0x1b')],{'raw':_0xd122c5[_0x38e6('0x1c')]?_0xd122c5[_0x38e6('0x1c')][_0x38e6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd122c5[_0x38e6('0x1c')]?_0xd122c5[_0x38e6('0x1c')]['where']||null:null,'attributes':_0xd122c5['options']?_0xd122c5[_0x38e6('0x1c')]['attributes']||null:null,'limit':_0xd122c5['options']?_0xd122c5[_0x38e6('0x1c')][_0x38e6('0x1e')]||null:null})['then'](function(_0x1204ca){logger[_0x38e6('0x13')]('UpdateOpenchannelInteraction',_0xd122c5);logger[_0x38e6('0x16')](_0x38e6('0x1a'),_0xd122c5,JSON[_0x38e6('0x1f')](_0x1204ca));_0x1bd2b7(_0x1204ca);})[_0x38e6('0x20')](function(_0x1c1061){logger[_0x38e6('0x18')](_0x38e6('0x1a'),_0x1c1061[_0x38e6('0x19')],_0xd122c5);_0x1baf24(_0x230395['error'](0x1f4,_0x1c1061[_0x38e6('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x3abf22){return new Promise(function(_0x4f1494,_0x58a40a){return db[_0x38e6('0x21')]['find']({'where':_0x3abf22['options']?_0x3abf22[_0x38e6('0x1c')][_0x38e6('0x22')]||null:null})['then'](function(_0x3b9ac3){if(_0x3b9ac3){return _0x3b9ac3[_0x38e6('0x23')](_0x3abf22['body'][_0x38e6('0x24')],_['omit'](_0x3abf22['body'],['ids','id'])||{});}})['spread'](function(_0x420ba9){logger[_0x38e6('0x13')](_0x38e6('0x25'),_0x3abf22);logger[_0x38e6('0x16')](_0x38e6('0x25'),_0x3abf22,JSON['stringify'](_0x420ba9));_0x4f1494(_0x420ba9);})[_0x38e6('0x20')](function(_0x1b823f){logger[_0x38e6('0x18')](_0x38e6('0x25'),_0x1b823f['message'],_0x3abf22);_0x58a40a(_this[_0x38e6('0x18')](0x1f4,_0x1b823f[_0x38e6('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a21af3f..e235b8e 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 _0xb14d=['./openchannelInteraction.events','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x434fce,_0x40f017){var _0x1f8494=function(_0x3a8c9c){while(--_0x3a8c9c){_0x434fce['push'](_0x434fce['shift']());}};_0x1f8494(++_0x40f017);}(_0xb14d,0x17a));var _0xdb14=function(_0x302c7e,_0x1630f2){_0x302c7e=_0x302c7e-0x0;var _0x44e461=_0xb14d[_0x302c7e];return _0x44e461;};'use strict';var OpenchannelInteractionEvents=require(_0xdb14('0x0'));var events=['save','remove',_0xdb14('0x1')];function createListener(_0x4fddf2,_0x4df0ff){return function(_0x36fc75){_0x4df0ff[_0xdb14('0x2')](_0x4fddf2,_0x36fc75);};}function removeListener(_0x5ddeec,_0x5041c1){return function(){OpenchannelInteractionEvents[_0xdb14('0x3')](_0x5ddeec,_0x5041c1);};}exports[_0xdb14('0x4')]=function(_0x2876f6){for(var _0xfe5390=0x0,_0x39d720=events[_0xdb14('0x5')];_0xfe5390<_0x39d720;_0xfe5390++){var _0x45dcab=events[_0xfe5390];var _0x260072=createListener(_0xdb14('0x6')+_0x45dcab,_0x2876f6);OpenchannelInteractionEvents['on'](_0x45dcab,_0x260072);}}; \ No newline at end of file +var _0x0ee1=['register','openchannelInteraction:','removeListener'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x0ee1,0x128));var _0x10ee=function(_0x546261,_0x44b70f){_0x546261=_0x546261-0x0;var _0x1c6263=_0x0ee1[_0x546261];return _0x1c6263;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove','update'];function createListener(_0x18b618,_0x306cc1){return function(_0x12979b){_0x306cc1['emit'](_0x18b618,_0x12979b);};}function removeListener(_0x56f84a,_0x2a8277){return function(){OpenchannelInteractionEvents[_0x10ee('0x0')](_0x56f84a,_0x2a8277);};}exports[_0x10ee('0x1')]=function(_0x4b7103){for(var _0x2a66d8=0x0,_0x272edf=events['length'];_0x2a66d8<_0x272edf;_0x2a66d8++){var _0x3bbb4b=events[_0x2a66d8];var _0x53c69b=createListener(_0x10ee('0x2')+_0x3bbb4b,_0x4b7103);OpenchannelInteractionEvents['on'](_0x3bbb4b,_0x53c69b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3b05859..a36bb12 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 368c78b..546e5ca 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 _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x2e7b03,_0x35c04d){var _0x556e23=function(_0x4b0547){while(--_0x4b0547){_0x2e7b03['push'](_0x2e7b03['shift']());}};_0x556e23(++_0x35c04d);}(_0x1bd1,0x123));var _0x11bd=function(_0xd0a0ae,_0x239a61){_0xd0a0ae=_0xd0a0ae-0x0;var _0x4da1a4=_0x1bd1[_0xd0a0ae];return _0x4da1a4;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}}; \ No newline at end of file +var _0x8164=['out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x80f605,_0xe7b3df){var _0x44c2e1=function(_0x14c347){while(--_0x14c347){_0x80f605['push'](_0x80f605['shift']());}};_0x44c2e1(++_0xe7b3df);}(_0x8164,0x170));var _0x4816=function(_0x28087c,_0x895c0f){_0x28087c=_0x28087c-0x0;var _0x329122=_0x8164[_0x28087c];return _0x329122;};'use strict';var Sequelize=require(_0x4816('0x0'));module[_0x4816('0x1')]={'body':{'type':Sequelize[_0x4816('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4816('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4816('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4816('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4816('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index cdb176d..55e76a9 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 _0x887f=['SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelMessage.socket','register','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','OpenchannelMessage','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','isNil','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','Sequelize'];(function(_0x55e77d,_0x59df1c){var _0x3f271e=function(_0x542491){while(--_0x542491){_0x55e77d['push'](_0x55e77d['shift']());}};_0x3f271e(++_0x59df1c);}(_0x887f,0x116));var _0xf887=function(_0x45f8a0,_0x4a321a){_0x45f8a0=_0x45f8a0-0x0;var _0x163e56=_0x887f[_0x45f8a0];return _0x163e56;};'use strict';var emlformat=require(_0xf887('0x0'));var rimraf=require(_0xf887('0x1'));var zipdir=require(_0xf887('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf887('0x3'));var moment=require(_0xf887('0x4'));var BPromise=require(_0xf887('0x5'));var Mustache=require(_0xf887('0x6'));var util=require(_0xf887('0x7'));var path=require('path');var sox=require(_0xf887('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf887('0x9'));var _=require(_0xf887('0xa'));var squel=require('squel');var crypto=require(_0xf887('0xb'));var jsforce=require(_0xf887('0xc'));var deskjs=require(_0xf887('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf887('0xe'));var Papa=require(_0xf887('0xf'));var Redis=require(_0xf887('0x10'));var authService=require(_0xf887('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf887('0x12'));var logger=require('../../config/logger')(_0xf887('0x13'));var utils=require(_0xf887('0x14'));var config=require(_0xf887('0x15'));var licenseUtil=require(_0xf887('0x16'));var db=require(_0xf887('0x17'))['db'];config[_0xf887('0x18')]=_['defaults'](config['redis'],{'host':_0xf887('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf887('0x18')]));require(_0xf887('0x1a'))[_0xf887('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf887('0x1c')][_0xf887('0x1d')]({'port':0x232c});var client9002=jayson[_0xf887('0x1c')][_0xf887('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x30ee7c,_0x3c588f,_0x53b199,_0x4ebe11){return new BPromise(function(_0x31a314,_0x12202d){var _0x5b61e4=_0x4ebe11||client;return _0x5b61e4['request'](_0x30ee7c,_0x53b199)[_0xf887('0x1e')](function(_0x3ae142){logger[_0xf887('0x1f')](_0xf887('0x20'),_0x3c588f,_0xf887('0x21'));logger[_0xf887('0x22')](_0xf887('0x23'),_0x3c588f,'request\x20sent',JSON[_0xf887('0x24')](_0x3ae142));if(_0x3ae142[_0xf887('0x25')]){if(_0x3ae142[_0xf887('0x25')][_0xf887('0x26')]===0x1f4){logger['error'](_0xf887('0x20'),_0x3c588f,_0x3ae142['error'][_0xf887('0x27')]);return _0x12202d(_0x3ae142['error'][_0xf887('0x27')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3c588f,_0x3ae142[_0xf887('0x25')][_0xf887('0x27')]);return _0x31a314(_0x3ae142['error'][_0xf887('0x27')]);}else{logger[_0xf887('0x1f')](_0xf887('0x20'),_0x3c588f,_0xf887('0x21'));_0x31a314(_0x3ae142['result'][_0xf887('0x27')]);}})[_0xf887('0x28')](function(_0x1fd738){logger[_0xf887('0x25')](_0xf887('0x20'),_0x3c588f,_0x1fd738);_0x12202d(_0x1fd738);});});}function respondWithStatusCode(_0x93c9b0,_0x434664){_0x434664=_0x434664||0xcc;return function(_0x110544){if(_0x110544){return _0x93c9b0['sendStatus'](_0x434664);}return _0x93c9b0['status'](_0x434664)[_0xf887('0x29')]();};}function respondWithResult(_0x3cf1d7,_0x323cfd){_0x323cfd=_0x323cfd||0xc8;return function(_0x594c1a){if(_0x594c1a){return _0x3cf1d7[_0xf887('0x2a')](_0x323cfd)[_0xf887('0x2b')](_0x594c1a);}};}function respondWithFilteredResult(_0x3852e5,_0x526a9d){return function(_0x5e950a){if(_0x5e950a){var _0x460778=typeof _0x526a9d[_0xf887('0x2c')]==='undefined'&&typeof _0x526a9d[_0xf887('0x2d')]===_0xf887('0x2e');var _0x54fd81=_0x5e950a[_0xf887('0x2f')];var _0x4b5105=_0x460778?0x0:_0x526a9d[_0xf887('0x2c')];var _0x4155bd=_0x460778?_0x5e950a[_0xf887('0x2f')]:_0x526a9d['offset']+_0x526a9d[_0xf887('0x2d')];var _0x1cf504;if(_0x4155bd>=_0x54fd81){_0x4155bd=_0x54fd81;_0x1cf504=0xc8;}else{_0x1cf504=0xce;}_0x3852e5[_0xf887('0x2a')](_0x1cf504);return _0x3852e5[_0xf887('0x30')](_0xf887('0x31'),_0x4b5105+'-'+_0x4155bd+'/'+_0x54fd81)['json'](_0x5e950a);}return null;};}function patchUpdates(_0x30ab26){return function(_0x3c784a){try{jsonpatch[_0xf887('0x32')](_0x3c784a,_0x30ab26,!![]);}catch(_0x381d79){return BPromise[_0xf887('0x33')](_0x381d79);}return _0x3c784a[_0xf887('0x34')]();};}function saveUpdates(_0x387c16,_0x16eeaf){return function(_0x1d32a4){if(_0x1d32a4){return _0x1d32a4[_0xf887('0x35')](_0x387c16)[_0xf887('0x1e')](function(_0x30093f){return _0x30093f;});}return null;};}function removeEntity(_0x2c5110,_0x90910f){return function(_0x5aa970){if(_0x5aa970){return _0x5aa970[_0xf887('0x36')]()[_0xf887('0x1e')](function(){_0x2c5110[_0xf887('0x2a')](0xcc)[_0xf887('0x29')]();});}};}function handleEntityNotFound(_0x258a4a,_0x2b40b8){return function(_0x15e3f1){if(!_0x15e3f1){_0x258a4a[_0xf887('0x37')](0x194);}return _0x15e3f1;};}function handleError(_0x281ef4,_0x585d34){_0x585d34=_0x585d34||0x1f4;return function(_0x191fd5){logger['error'](_0x191fd5[_0xf887('0x38')]);if(_0x191fd5['name']){delete _0x191fd5[_0xf887('0x39')];}_0x281ef4[_0xf887('0x2a')](_0x585d34)[_0xf887('0x3a')](_0x191fd5);};}exports['index']=function(_0x645883,_0x2b8efb){var _0x446cb9={},_0x3ddc26={},_0x4aefad={'count':0x0,'rows':[]};var _0x501bc1=_['map'](db[_0xf887('0x3b')][_0xf887('0x3c')],function(_0x315f60){return{'name':_0x315f60[_0xf887('0x3d')],'type':_0x315f60['type'][_0xf887('0x3e')]};});_0x3ddc26[_0xf887('0x3f')]=_[_0xf887('0x40')](_0x501bc1,_0xf887('0x39'));_0x3ddc26['query']=_[_0xf887('0x41')](_0x645883[_0xf887('0x42')]);_0x3ddc26[_0xf887('0x43')]=_['intersection'](_0x3ddc26['model'],_0x3ddc26['query']);_0x446cb9[_0xf887('0x44')]=_[_0xf887('0x45')](_0x3ddc26['model'],qs[_0xf887('0x46')](_0x645883[_0xf887('0x42')][_0xf887('0x46')]));_0x446cb9['attributes']=_0x446cb9[_0xf887('0x44')][_0xf887('0x47')]?_0x446cb9['attributes']:_0x3ddc26[_0xf887('0x3f')];if(!_0x645883[_0xf887('0x42')][_0xf887('0x48')](_0xf887('0x49'))){_0x446cb9['limit']=qs[_0xf887('0x2d')](_0x645883[_0xf887('0x42')]['limit']);_0x446cb9[_0xf887('0x2c')]=qs['offset'](_0x645883[_0xf887('0x42')][_0xf887('0x2c')]);}_0x446cb9[_0xf887('0x4a')]=qs[_0xf887('0x4b')](_0x645883[_0xf887('0x42')][_0xf887('0x4b')]);_0x446cb9[_0xf887('0x4c')]=qs[_0xf887('0x43')](_[_0xf887('0x4d')](_0x645883['query'],_0x3ddc26[_0xf887('0x43')]),_0x501bc1);if(_0x645883[_0xf887('0x42')][_0xf887('0x4e')]){_0x446cb9[_0xf887('0x4c')]=_[_0xf887('0x4f')](_0x446cb9[_0xf887('0x4c')],{'$or':_[_0xf887('0x40')](_0x501bc1,function(_0x32e3c4){if(_0x32e3c4['type']!==_0xf887('0x50')){var _0x4973af={};_0x4973af[_0x32e3c4['name']]={'$like':'%'+_0x645883[_0xf887('0x42')][_0xf887('0x4e')]+'%'};return _0x4973af;}})});}_0x446cb9=_['merge']({},_0x446cb9,_0x645883[_0xf887('0x51')]);var _0x55f951={'where':_0x446cb9['where']};return db[_0xf887('0x3b')][_0xf887('0x2f')](_0x55f951)[_0xf887('0x1e')](function(_0x7ca821){_0x4aefad['count']=_0x7ca821;if(_0x645883[_0xf887('0x42')][_0xf887('0x52')]){_0x446cb9[_0xf887('0x53')]=[{'all':!![]}];}return db[_0xf887('0x3b')][_0xf887('0x54')](_0x446cb9);})[_0xf887('0x1e')](function(_0x2b0e64){_0x4aefad['rows']=_0x2b0e64;return _0x4aefad;})[_0xf887('0x1e')](respondWithFilteredResult(_0x2b8efb,_0x446cb9))[_0xf887('0x28')](handleError(_0x2b8efb,null));};exports[_0xf887('0x55')]=function(_0x2ef070,_0x1cd18d){var _0x3c7248={'raw':!![],'where':{'id':_0x2ef070[_0xf887('0x56')]['id']}},_0xa56ccd={};_0xa56ccd[_0xf887('0x3f')]=_[_0xf887('0x41')](db['OpenchannelMessage'][_0xf887('0x3c')]);_0xa56ccd[_0xf887('0x42')]=_[_0xf887('0x41')](_0x2ef070[_0xf887('0x42')]);_0xa56ccd['filters']=_['intersection'](_0xa56ccd['model'],_0xa56ccd[_0xf887('0x42')]);_0x3c7248['attributes']=_[_0xf887('0x45')](_0xa56ccd[_0xf887('0x3f')],qs[_0xf887('0x46')](_0x2ef070[_0xf887('0x42')]['fields']));_0x3c7248['attributes']=_0x3c7248[_0xf887('0x44')]['length']?_0x3c7248['attributes']:_0xa56ccd[_0xf887('0x3f')];if(_0x2ef070['query'][_0xf887('0x52')]){_0x3c7248[_0xf887('0x53')]=[{'all':!![]}];}_0x3c7248=_[_0xf887('0x4f')]({},_0x3c7248,_0x2ef070[_0xf887('0x51')]);return db['OpenchannelMessage']['find'](_0x3c7248)[_0xf887('0x1e')](handleEntityNotFound(_0x1cd18d,null))[_0xf887('0x1e')](respondWithResult(_0x1cd18d,null))['catch'](handleError(_0x1cd18d,null));};exports[_0xf887('0x57')]=function(_0xb45e0b,_0x327c68){return db[_0xf887('0x3b')]['create'](_0xb45e0b[_0xf887('0x58')],{})[_0xf887('0x1e')](respondWithResult(_0x327c68,0xc9))[_0xf887('0x28')](handleError(_0x327c68,null));};exports[_0xf887('0x35')]=function(_0x23db97,_0x120f11){if(_0x23db97['body']['id']){delete _0x23db97[_0xf887('0x58')]['id'];}return db[_0xf887('0x3b')][_0xf887('0x59')]({'where':{'id':_0x23db97[_0xf887('0x56')]['id']}})[_0xf887('0x1e')](handleEntityNotFound(_0x120f11,null))[_0xf887('0x1e')](saveUpdates(_0x23db97['body'],null))[_0xf887('0x1e')](respondWithResult(_0x120f11,null))[_0xf887('0x28')](handleError(_0x120f11,null));};exports['destroy']=function(_0x8dfae5,_0x3fa124){return db[_0xf887('0x3b')][_0xf887('0x59')]({'where':{'id':_0x8dfae5[_0xf887('0x56')]['id']}})['then'](handleEntityNotFound(_0x3fa124,null))[_0xf887('0x1e')](removeEntity(_0x3fa124,null))[_0xf887('0x28')](handleError(_0x3fa124,null));};exports[_0xf887('0x5a')]=function(_0x28f021,_0x4834b6){return db['OpenchannelMessage']['describe']()[_0xf887('0x1e')](respondWithResult(_0x4834b6,null))['catch'](handleError(_0x4834b6,null));};var interaction_log=require(_0xf887('0x5b'))(_0xf887('0x5c'));exports[_0xf887('0x5d')]=function(_0x12a4a7,_0x4cc447,_0x1afeed){var _0x488120={'agent':{},'channel':_0xf887('0x5e')};if(_0x12a4a7[_0xf887('0x58')]['id']){delete _0x12a4a7[_0xf887('0x58')]['id'];}_0x12a4a7[_0xf887('0x58')][_0xf887('0x5f')]=!![];_0x12a4a7[_0xf887('0x58')][_0xf887('0x60')]=moment()[_0xf887('0x61')](_0xf887('0x62'));_0x12a4a7['body'][_0xf887('0x63')]=_0x12a4a7[_0xf887('0x58')][_0xf887('0x63')]||_0x12a4a7['user']['id'];_0x488120[_0xf887('0x64')]['id']=_0x12a4a7['body'][_0xf887('0x63')];return db[_0xf887('0x3b')][_0xf887('0x59')]({'where':{'id':_0x12a4a7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cc447,null))[_0xf887('0x1e')](saveUpdates(_0x12a4a7[_0xf887('0x58')],null))['then'](function(_0x3117c8){if(_0x3117c8){_0x488120['message']=_0x3117c8[_0xf887('0x65')]({'plain':!![]});return db[_0xf887('0x66')][_0xf887('0x59')]({'where':{'id':_0x3117c8['OpenchannelInteractionId']}});}return null;})[_0xf887('0x1e')](handleEntityNotFound(_0x4cc447,null))[_0xf887('0x1e')](function(_0x333fb4){if(_0x333fb4){return _0x333fb4[_0xf887('0x35')]({'UserId':_0x12a4a7[_0xf887('0x58')][_0xf887('0x63')],'read1stAt':_[_0xf887('0x67')](_0x333fb4['read1stAt'])?moment()[_0xf887('0x61')](_0xf887('0x62')):undefined});}return null;})[_0xf887('0x1e')](function(_0x541f41){if(_0x541f41){_0x488120['interaction']=_0x541f41['get']({'plain':!![]});interaction_log[_0xf887('0x1f')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12a4a7['user']['id'],_0x12a4a7[_0xf887('0x68')]['name'],_0x12a4a7['user'][_0xf887('0x69')],_0x488120[_0xf887('0x6a')]['id'],_0x12a4a7[_0xf887('0x58')]?JSON['stringify'](_0x12a4a7[_0xf887('0x58')]):_0xf887('0x6b'));return respondWithRpcPromise(_0xf887('0x6c'),_0xf887('0x6d'),_0x488120);}return null;})[_0xf887('0x1e')](function(_0x20f9ef){var _0x38faaf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20f9ef[_0xf887('0x27')][_0xf887('0x6e')];return db['sequelize'][_0xf887('0x42')](_0x38faaf,{'type':db[_0xf887('0x6f')]['QueryTypes'][_0xf887('0x70')],'raw':!![]})['then'](function(_0x44376c){return _0x44376c;});})[_0xf887('0x1e')](function(_0x4c6cab){if(_0x4c6cab){_0x488120[_0xf887('0x27')][_0xf887('0x71')]=_0x4c6cab[0x0];if(!_0x12a4a7[_0xf887('0x58')][_0xf887('0x63')])return;return db['User'][_0xf887('0x59')]({'where':{'id':_0x12a4a7[_0xf887('0x58')][_0xf887('0x63')],'role':'agent'},'attributes':['id',_0xf887('0x39'),_0xf887('0x72'),_0xf887('0x73'),_0xf887('0x74')],'raw':!![]});}return null;})[_0xf887('0x1e')](function(_0x3503dc){if(!_0x3503dc)return null;_0x488120[_0xf887('0x27')][_0xf887('0x64')]=_0x3503dc;return _0x488120;})[_0xf887('0x1e')](function(_0x5c8452){if(_0x5c8452){if(_0x12a4a7[_0xf887('0x58')][_0xf887('0x75')]){_0x488120[_0xf887('0x27')][_0xf887('0x76')]=util['format'](_0xf887('0x77'),_0x12a4a7[_0xf887('0x68')]['name']);_0x488120[_0xf887('0x27')][_0xf887('0x78')]=_0x488120['channel'];_0x488120['message']['motionChannel']=_0x488120[_0xf887('0x78')];_0x488120['message'][_0xf887('0x79')]=_0xf887('0x5d');return respondWithRpcPromise(_0xf887('0x7a'),_0xf887('0x7a'),{'event':_0xf887('0x7b'),'message':_0x488120[_0xf887('0x27')]},client9002)[_0xf887('0x1e')](function(){return _0x488120;});}return _0x488120;}return null;})['then'](respondWithResult(_0x4cc447,null))['catch'](handleError(_0x4cc447,null));};var interaction_log=require(_0xf887('0x5b'))(_0xf887('0x5c'));exports['reject']=function(_0x2a84ce,_0x1f97c5,_0x2b7947){var _0x108b62={'agent':{},'channel':_0xf887('0x5e')};if(_0x2a84ce['body']['id']){delete _0x2a84ce['body']['id'];}_0x2a84ce[_0xf887('0x58')][_0xf887('0x63')]=_0x2a84ce['body'][_0xf887('0x63')]||_0x2a84ce[_0xf887('0x68')]['id'];_0x108b62['agent']['id']=_0x2a84ce[_0xf887('0x58')]['UserId'];return db['OpenchannelMessage'][_0xf887('0x59')]({'where':{'id':_0x2a84ce[_0xf887('0x56')]['id'],'UserId':null}})[_0xf887('0x1e')](handleEntityNotFound(_0x1f97c5,null))[_0xf887('0x1e')](function(_0x2c62d2){if(_0x2c62d2){_0x108b62[_0xf887('0x27')]=_0x2c62d2[_0xf887('0x65')]({'plain':!![]});return db[_0xf887('0x66')][_0xf887('0x59')]({'where':{'id':_0x2c62d2['OpenchannelInteractionId']}});}return null;})[_0xf887('0x1e')](handleEntityNotFound(_0x1f97c5,null))[_0xf887('0x1e')](function(_0x26e57c){if(_0x26e57c){_0x108b62[_0xf887('0x6a')]=_0x26e57c[_0xf887('0x65')]({'plain':!![]});interaction_log[_0xf887('0x1f')](_0xf887('0x7c'),_0x2a84ce[_0xf887('0x68')]['id'],_0x2a84ce[_0xf887('0x68')]['name'],_0x2a84ce[_0xf887('0x68')][_0xf887('0x69')],_0x108b62['interaction']['id'],_0x2a84ce[_0xf887('0x58')]?JSON['stringify'](_0x2a84ce['body']):_0xf887('0x6b'));return respondWithRpcPromise('RejectMessage',_0xf887('0x7d'),_0x108b62);}return null;})[_0xf887('0x1e')](function(_0x134871){var _0x243af0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x134871[_0xf887('0x27')][_0xf887('0x6e')];return db[_0xf887('0x7e')][_0xf887('0x42')](_0x243af0,{'type':db[_0xf887('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf887('0x1e')](function(_0x483bdb){return _0x483bdb;});})[_0xf887('0x1e')](function(_0xebc22e){if(_0xebc22e){_0x108b62[_0xf887('0x27')][_0xf887('0x71')]=_0xebc22e[0x0];if(!_0x2a84ce[_0xf887('0x58')][_0xf887('0x63')])return;return db[_0xf887('0x7f')]['find']({'where':{'id':_0x2a84ce[_0xf887('0x58')][_0xf887('0x63')],'role':_0xf887('0x64')},'attributes':['id','name',_0xf887('0x72'),_0xf887('0x73'),'internal'],'raw':!![]});}return null;})[_0xf887('0x1e')](function(_0x10e9b6){if(!_0x10e9b6)return null;_0x108b62[_0xf887('0x27')][_0xf887('0x64')]=_0x10e9b6;return _0x108b62;})[_0xf887('0x1e')](function(_0x1a3913){if(_0x1a3913){_0x1a3913['message'][_0xf887('0x76')]=util[_0xf887('0x61')](_0xf887('0x77'),_0x2a84ce[_0xf887('0x68')][_0xf887('0x39')]);_0x1a3913['message'][_0xf887('0x78')]=_0x108b62['channel'];_0x1a3913['message'][_0xf887('0x80')]=_0x108b62[_0xf887('0x78')];_0x1a3913[_0xf887('0x27')][_0xf887('0x79')]=_0xf887('0x33');respondWithRpcPromise(_0xf887('0x7a'),_0xf887('0x7a'),{'event':_0xf887('0x81'),'message':_0x1a3913['message']},client9002);return _0x108b62;}return null;})[_0xf887('0x1e')](respondWithResult(_0x1f97c5,null))[_0xf887('0x28')](handleError(_0x1f97c5,null));}; \ No newline at end of file +var _0xdf32=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','create','body','find','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','User','agent','SIP/%s','rejectmessage','rimraf','zip-dir','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','jayson/promise','http','client','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','OpenchannelMessage','fieldName','type','model','keys','query'];(function(_0x58d63c,_0x33730f){var _0x4dab8c=function(_0x5a1569){while(--_0x5a1569){_0x58d63c['push'](_0x58d63c['shift']());}};_0x4dab8c(++_0x33730f);}(_0xdf32,0x1bc));var _0x2df3=function(_0x5a51bb,_0x3cfc73){_0x5a51bb=_0x5a51bb-0x0;var _0x52b4a2=_0xdf32[_0x5a51bb];return _0x52b4a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2df3('0x0'));var zipdir=require(_0x2df3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2df3('0x2'));var BPromise=require(_0x2df3('0x3'));var Mustache=require(_0x2df3('0x4'));var util=require('util');var path=require(_0x2df3('0x5'));var sox=require(_0x2df3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2df3('0x7'));var _=require(_0x2df3('0x8'));var squel=require(_0x2df3('0x9'));var crypto=require(_0x2df3('0xa'));var jsforce=require(_0x2df3('0xb'));var deskjs=require(_0x2df3('0xc'));var toCsv=require(_0x2df3('0xd'));var querystring=require(_0x2df3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2df3('0xf'));var as=require(_0x2df3('0x10'));var hardwareService=require(_0x2df3('0x11'));var logger=require(_0x2df3('0x12'))('api');var utils=require(_0x2df3('0x13'));var config=require(_0x2df3('0x14'));var licenseUtil=require(_0x2df3('0x15'));var db=require('../../mysqldb')['db'];config[_0x2df3('0x16')]=_[_0x2df3('0x17')](config[_0x2df3('0x16')],{'host':_0x2df3('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2df3('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x2df3('0x19'));var client=jayson['client'][_0x2df3('0x1a')]({'port':0x232c});var client9002=jayson[_0x2df3('0x1b')][_0x2df3('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x457c22,_0x13db5b,_0x4695bf,_0x53127b){return new BPromise(function(_0x2e487b,_0x16ee36){var _0x2e70e3=_0x53127b||client;return _0x2e70e3[_0x2df3('0x1c')](_0x457c22,_0x4695bf)['then'](function(_0x5d55ba){logger['info'](_0x2df3('0x1d'),_0x13db5b,_0x2df3('0x1e'));logger[_0x2df3('0x1f')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x13db5b,'request\x20sent',JSON[_0x2df3('0x20')](_0x5d55ba));if(_0x5d55ba[_0x2df3('0x21')]){if(_0x5d55ba[_0x2df3('0x21')][_0x2df3('0x22')]===0x1f4){logger[_0x2df3('0x21')](_0x2df3('0x1d'),_0x13db5b,_0x5d55ba[_0x2df3('0x21')][_0x2df3('0x23')]);return _0x16ee36(_0x5d55ba[_0x2df3('0x21')]['message']);}logger['error'](_0x2df3('0x1d'),_0x13db5b,_0x5d55ba[_0x2df3('0x21')][_0x2df3('0x23')]);return _0x2e487b(_0x5d55ba[_0x2df3('0x21')][_0x2df3('0x23')]);}else{logger[_0x2df3('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x13db5b,_0x2df3('0x1e'));_0x2e487b(_0x5d55ba[_0x2df3('0x25')][_0x2df3('0x23')]);}})[_0x2df3('0x26')](function(_0x76d4f8){logger[_0x2df3('0x21')](_0x2df3('0x1d'),_0x13db5b,_0x76d4f8);_0x16ee36(_0x76d4f8);});});}function respondWithStatusCode(_0x394504,_0x5cf6a2){_0x5cf6a2=_0x5cf6a2||0xcc;return function(_0x223a31){if(_0x223a31){return _0x394504['sendStatus'](_0x5cf6a2);}return _0x394504['status'](_0x5cf6a2)['end']();};}function respondWithResult(_0x2eb363,_0x3d310e){_0x3d310e=_0x3d310e||0xc8;return function(_0x3b1a92){if(_0x3b1a92){return _0x2eb363['status'](_0x3d310e)[_0x2df3('0x27')](_0x3b1a92);}};}function respondWithFilteredResult(_0x2634bb,_0x41cdfa){return function(_0x2a224b){if(_0x2a224b){var _0x2bc077=typeof _0x41cdfa[_0x2df3('0x28')]==='undefined'&&typeof _0x41cdfa['limit']===_0x2df3('0x29');var _0x5c011e=_0x2a224b['count'];var _0x2270a5=_0x2bc077?0x0:_0x41cdfa['offset'];var _0x3641ce=_0x2bc077?_0x2a224b[_0x2df3('0x2a')]:_0x41cdfa[_0x2df3('0x28')]+_0x41cdfa['limit'];var _0x22ea8f;if(_0x3641ce>=_0x5c011e){_0x3641ce=_0x5c011e;_0x22ea8f=0xc8;}else{_0x22ea8f=0xce;}_0x2634bb[_0x2df3('0x2b')](_0x22ea8f);return _0x2634bb[_0x2df3('0x2c')](_0x2df3('0x2d'),_0x2270a5+'-'+_0x3641ce+'/'+_0x5c011e)[_0x2df3('0x27')](_0x2a224b);}return null;};}function patchUpdates(_0x297786){return function(_0x980b15){try{jsonpatch[_0x2df3('0x2e')](_0x980b15,_0x297786,!![]);}catch(_0x286e5b){return BPromise[_0x2df3('0x2f')](_0x286e5b);}return _0x980b15[_0x2df3('0x30')]();};}function saveUpdates(_0x3c011e,_0x4893d3){return function(_0x38661a){if(_0x38661a){return _0x38661a[_0x2df3('0x31')](_0x3c011e)[_0x2df3('0x32')](function(_0x4b3104){return _0x4b3104;});}return null;};}function removeEntity(_0x53379c,_0x154c88){return function(_0x3f50a5){if(_0x3f50a5){return _0x3f50a5[_0x2df3('0x33')]()[_0x2df3('0x32')](function(){_0x53379c[_0x2df3('0x2b')](0xcc)[_0x2df3('0x34')]();});}};}function handleEntityNotFound(_0x2b96b2,_0x3c58e3){return function(_0x33c27b){if(!_0x33c27b){_0x2b96b2[_0x2df3('0x35')](0x194);}return _0x33c27b;};}function handleError(_0x5ecda8,_0x13e5bd){_0x13e5bd=_0x13e5bd||0x1f4;return function(_0x5568a3){logger[_0x2df3('0x21')](_0x5568a3[_0x2df3('0x36')]);if(_0x5568a3[_0x2df3('0x37')]){delete _0x5568a3['name'];}_0x5ecda8[_0x2df3('0x2b')](_0x13e5bd)['send'](_0x5568a3);};}exports[_0x2df3('0x38')]=function(_0x533c37,_0x5e6b43){var _0xae43bd={},_0x408868={},_0x13f9b5={'count':0x0,'rows':[]};var _0x152a2a=_[_0x2df3('0x39')](db[_0x2df3('0x3a')]['rawAttributes'],function(_0x2d5cd9){return{'name':_0x2d5cd9[_0x2df3('0x3b')],'type':_0x2d5cd9[_0x2df3('0x3c')]['key']};});_0x408868[_0x2df3('0x3d')]=_[_0x2df3('0x39')](_0x152a2a,'name');_0x408868['query']=_[_0x2df3('0x3e')](_0x533c37[_0x2df3('0x3f')]);_0x408868[_0x2df3('0x40')]=_[_0x2df3('0x41')](_0x408868['model'],_0x408868[_0x2df3('0x3f')]);_0xae43bd[_0x2df3('0x42')]=_[_0x2df3('0x41')](_0x408868['model'],qs[_0x2df3('0x43')](_0x533c37[_0x2df3('0x3f')][_0x2df3('0x43')]));_0xae43bd[_0x2df3('0x42')]=_0xae43bd[_0x2df3('0x42')][_0x2df3('0x44')]?_0xae43bd[_0x2df3('0x42')]:_0x408868[_0x2df3('0x3d')];if(!_0x533c37[_0x2df3('0x3f')][_0x2df3('0x45')](_0x2df3('0x46'))){_0xae43bd[_0x2df3('0x47')]=qs[_0x2df3('0x47')](_0x533c37[_0x2df3('0x3f')]['limit']);_0xae43bd[_0x2df3('0x28')]=qs[_0x2df3('0x28')](_0x533c37['query'][_0x2df3('0x28')]);}_0xae43bd[_0x2df3('0x48')]=qs[_0x2df3('0x49')](_0x533c37['query'][_0x2df3('0x49')]);_0xae43bd[_0x2df3('0x4a')]=qs[_0x2df3('0x40')](_['pick'](_0x533c37['query'],_0x408868[_0x2df3('0x40')]),_0x152a2a);if(_0x533c37[_0x2df3('0x3f')][_0x2df3('0x4b')]){_0xae43bd[_0x2df3('0x4a')]=_[_0x2df3('0x4c')](_0xae43bd['where'],{'$or':_[_0x2df3('0x39')](_0x152a2a,function(_0x1eab5d){if(_0x1eab5d[_0x2df3('0x3c')]!==_0x2df3('0x4d')){var _0x47f760={};_0x47f760[_0x1eab5d[_0x2df3('0x37')]]={'$like':'%'+_0x533c37[_0x2df3('0x3f')]['filter']+'%'};return _0x47f760;}})});}_0xae43bd=_['merge']({},_0xae43bd,_0x533c37[_0x2df3('0x4e')]);var _0x1fcb52={'where':_0xae43bd[_0x2df3('0x4a')]};return db[_0x2df3('0x3a')]['count'](_0x1fcb52)['then'](function(_0xedf460){_0x13f9b5[_0x2df3('0x2a')]=_0xedf460;if(_0x533c37[_0x2df3('0x3f')][_0x2df3('0x4f')]){_0xae43bd[_0x2df3('0x50')]=[{'all':!![]}];}return db[_0x2df3('0x3a')][_0x2df3('0x51')](_0xae43bd);})[_0x2df3('0x32')](function(_0x4eeba2){_0x13f9b5[_0x2df3('0x52')]=_0x4eeba2;return _0x13f9b5;})[_0x2df3('0x32')](respondWithFilteredResult(_0x5e6b43,_0xae43bd))[_0x2df3('0x26')](handleError(_0x5e6b43,null));};exports['show']=function(_0x40b227,_0x33e766){var _0x2a991c={'raw':!![],'where':{'id':_0x40b227[_0x2df3('0x53')]['id']}},_0x53b066={};_0x53b066[_0x2df3('0x3d')]=_[_0x2df3('0x3e')](db[_0x2df3('0x3a')][_0x2df3('0x54')]);_0x53b066[_0x2df3('0x3f')]=_[_0x2df3('0x3e')](_0x40b227[_0x2df3('0x3f')]);_0x53b066[_0x2df3('0x40')]=_['intersection'](_0x53b066[_0x2df3('0x3d')],_0x53b066[_0x2df3('0x3f')]);_0x2a991c[_0x2df3('0x42')]=_[_0x2df3('0x41')](_0x53b066[_0x2df3('0x3d')],qs[_0x2df3('0x43')](_0x40b227[_0x2df3('0x3f')][_0x2df3('0x43')]));_0x2a991c[_0x2df3('0x42')]=_0x2a991c[_0x2df3('0x42')][_0x2df3('0x44')]?_0x2a991c['attributes']:_0x53b066[_0x2df3('0x3d')];if(_0x40b227[_0x2df3('0x3f')]['includeAll']){_0x2a991c[_0x2df3('0x50')]=[{'all':!![]}];}_0x2a991c=_[_0x2df3('0x4c')]({},_0x2a991c,_0x40b227[_0x2df3('0x4e')]);return db[_0x2df3('0x3a')]['find'](_0x2a991c)['then'](handleEntityNotFound(_0x33e766,null))[_0x2df3('0x32')](respondWithResult(_0x33e766,null))[_0x2df3('0x26')](handleError(_0x33e766,null));};exports[_0x2df3('0x55')]=function(_0x391c28,_0x548dfc){return db[_0x2df3('0x3a')]['create'](_0x391c28['body'],{})[_0x2df3('0x32')](respondWithResult(_0x548dfc,0xc9))[_0x2df3('0x26')](handleError(_0x548dfc,null));};exports[_0x2df3('0x31')]=function(_0x1cee6e,_0x588068){if(_0x1cee6e[_0x2df3('0x56')]['id']){delete _0x1cee6e['body']['id'];}return db['OpenchannelMessage'][_0x2df3('0x57')]({'where':{'id':_0x1cee6e['params']['id']}})[_0x2df3('0x32')](handleEntityNotFound(_0x588068,null))['then'](saveUpdates(_0x1cee6e[_0x2df3('0x56')],null))['then'](respondWithResult(_0x588068,null))[_0x2df3('0x26')](handleError(_0x588068,null));};exports[_0x2df3('0x33')]=function(_0x527250,_0x3cb687){return db[_0x2df3('0x3a')][_0x2df3('0x57')]({'where':{'id':_0x527250['params']['id']}})[_0x2df3('0x32')](handleEntityNotFound(_0x3cb687,null))[_0x2df3('0x32')](removeEntity(_0x3cb687,null))[_0x2df3('0x26')](handleError(_0x3cb687,null));};exports[_0x2df3('0x58')]=function(_0x574b46,_0x3d11e3){return db[_0x2df3('0x3a')][_0x2df3('0x58')]()[_0x2df3('0x32')](respondWithResult(_0x3d11e3,null))['catch'](handleError(_0x3d11e3,null));};var interaction_log=require(_0x2df3('0x12'))(_0x2df3('0x59'));exports[_0x2df3('0x5a')]=function(_0x367172,_0x111b81,_0x55546f){var _0x131ff9={'agent':{},'channel':_0x2df3('0x5b')};if(_0x367172[_0x2df3('0x56')]['id']){delete _0x367172[_0x2df3('0x56')]['id'];}_0x367172[_0x2df3('0x56')]['read']=!![];_0x367172[_0x2df3('0x56')][_0x2df3('0x5c')]=moment()[_0x2df3('0x5d')](_0x2df3('0x5e'));_0x367172[_0x2df3('0x56')]['UserId']=_0x367172[_0x2df3('0x56')][_0x2df3('0x5f')]||_0x367172[_0x2df3('0x60')]['id'];_0x131ff9['agent']['id']=_0x367172[_0x2df3('0x56')][_0x2df3('0x5f')];return db[_0x2df3('0x3a')][_0x2df3('0x57')]({'where':{'id':_0x367172['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x111b81,null))[_0x2df3('0x32')](saveUpdates(_0x367172[_0x2df3('0x56')],null))[_0x2df3('0x32')](function(_0x23d7ff){if(_0x23d7ff){_0x131ff9[_0x2df3('0x23')]=_0x23d7ff[_0x2df3('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2df3('0x57')]({'where':{'id':_0x23d7ff[_0x2df3('0x62')]}});}return null;})[_0x2df3('0x32')](handleEntityNotFound(_0x111b81,null))[_0x2df3('0x32')](function(_0x544710){if(_0x544710){return _0x544710[_0x2df3('0x31')]({'UserId':_0x367172['body']['UserId'],'read1stAt':_[_0x2df3('0x63')](_0x544710['read1stAt'])?moment()['format'](_0x2df3('0x5e')):undefined});}return null;})[_0x2df3('0x32')](function(_0x2eee0e){if(_0x2eee0e){_0x131ff9['interaction']=_0x2eee0e[_0x2df3('0x61')]({'plain':!![]});interaction_log[_0x2df3('0x24')](_0x2df3('0x64'),_0x367172['user']['id'],_0x367172[_0x2df3('0x60')][_0x2df3('0x37')],_0x367172['user'][_0x2df3('0x65')],_0x131ff9[_0x2df3('0x66')]['id'],_0x367172[_0x2df3('0x56')]?JSON['stringify'](_0x367172['body']):_0x2df3('0x67'));return respondWithRpcPromise('AcceptMessage',_0x2df3('0x68'),_0x131ff9);}return null;})['then'](function(_0x13a204){var _0x2eb4ca=_0x2df3('0x69')+_0x13a204['message']['ContactId'];return db['sequelize'][_0x2df3('0x3f')](_0x2eb4ca,{'type':db['Sequelize'][_0x2df3('0x6a')][_0x2df3('0x6b')],'raw':!![]})[_0x2df3('0x32')](function(_0x23138d){return _0x23138d;});})[_0x2df3('0x32')](function(_0x56632a){if(_0x56632a){_0x131ff9[_0x2df3('0x23')][_0x2df3('0x6c')]=_0x56632a[0x0];if(!_0x367172[_0x2df3('0x56')]['UserId'])return;return db['User']['find']({'where':{'id':_0x367172['body'][_0x2df3('0x5f')],'role':'agent'},'attributes':['id','name','fullname',_0x2df3('0x6d'),_0x2df3('0x6e')],'raw':!![]});}return null;})['then'](function(_0x494a51){if(!_0x494a51)return null;_0x131ff9['message']['agent']=_0x494a51;return _0x131ff9;})[_0x2df3('0x32')](function(_0x7ca4a9){if(_0x7ca4a9){if(_0x367172[_0x2df3('0x56')][_0x2df3('0x6f')]){_0x131ff9[_0x2df3('0x23')]['interface']=util['format']('SIP/%s',_0x367172[_0x2df3('0x60')]['name']);_0x131ff9['message'][_0x2df3('0x70')]=_0x131ff9[_0x2df3('0x70')];_0x131ff9[_0x2df3('0x23')][_0x2df3('0x71')]=_0x131ff9[_0x2df3('0x70')];_0x131ff9[_0x2df3('0x23')][_0x2df3('0x72')]=_0x2df3('0x5a');return respondWithRpcPromise(_0x2df3('0x73'),_0x2df3('0x73'),{'event':_0x2df3('0x74'),'message':_0x131ff9[_0x2df3('0x23')]},client9002)['then'](function(){return _0x131ff9;});}return _0x131ff9;}return null;})[_0x2df3('0x32')](respondWithResult(_0x111b81,null))[_0x2df3('0x26')](handleError(_0x111b81,null));};var interaction_log=require(_0x2df3('0x12'))('openchannel-interactions');exports[_0x2df3('0x2f')]=function(_0x2d156f,_0x2c8207,_0x3072f3){var _0x197f0e={'agent':{},'channel':_0x2df3('0x5b')};if(_0x2d156f[_0x2df3('0x56')]['id']){delete _0x2d156f[_0x2df3('0x56')]['id'];}_0x2d156f[_0x2df3('0x56')]['UserId']=_0x2d156f['body'][_0x2df3('0x5f')]||_0x2d156f['user']['id'];_0x197f0e['agent']['id']=_0x2d156f[_0x2df3('0x56')][_0x2df3('0x5f')];return db[_0x2df3('0x3a')][_0x2df3('0x57')]({'where':{'id':_0x2d156f[_0x2df3('0x53')]['id'],'UserId':null}})[_0x2df3('0x32')](handleEntityNotFound(_0x2c8207,null))[_0x2df3('0x32')](function(_0x386337){if(_0x386337){_0x197f0e['message']=_0x386337[_0x2df3('0x61')]({'plain':!![]});return db[_0x2df3('0x75')][_0x2df3('0x57')]({'where':{'id':_0x386337['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2c8207,null))[_0x2df3('0x32')](function(_0x4ca619){if(_0x4ca619){_0x197f0e[_0x2df3('0x66')]=_0x4ca619[_0x2df3('0x61')]({'plain':!![]});interaction_log[_0x2df3('0x24')](_0x2df3('0x76'),_0x2d156f[_0x2df3('0x60')]['id'],_0x2d156f[_0x2df3('0x60')][_0x2df3('0x37')],_0x2d156f[_0x2df3('0x60')][_0x2df3('0x65')],_0x197f0e[_0x2df3('0x66')]['id'],_0x2d156f[_0x2df3('0x56')]?JSON[_0x2df3('0x20')](_0x2d156f[_0x2df3('0x56')]):'null');return respondWithRpcPromise(_0x2df3('0x77'),_0x2df3('0x78'),_0x197f0e);}return null;})[_0x2df3('0x32')](function(_0x510300){var _0x5818dc=_0x2df3('0x69')+_0x510300[_0x2df3('0x23')][_0x2df3('0x79')];return db['sequelize'][_0x2df3('0x3f')](_0x5818dc,{'type':db[_0x2df3('0x7a')][_0x2df3('0x6a')][_0x2df3('0x6b')],'raw':!![]})[_0x2df3('0x32')](function(_0x1e10e9){return _0x1e10e9;});})[_0x2df3('0x32')](function(_0x3882d5){if(_0x3882d5){_0x197f0e[_0x2df3('0x23')]['contact']=_0x3882d5[0x0];if(!_0x2d156f[_0x2df3('0x56')][_0x2df3('0x5f')])return;return db[_0x2df3('0x7b')][_0x2df3('0x57')]({'where':{'id':_0x2d156f['body'][_0x2df3('0x5f')],'role':_0x2df3('0x7c')},'attributes':['id',_0x2df3('0x37'),'fullname','email',_0x2df3('0x6e')],'raw':!![]});}return null;})[_0x2df3('0x32')](function(_0x5bcf37){if(!_0x5bcf37)return null;_0x197f0e['message'][_0x2df3('0x7c')]=_0x5bcf37;return _0x197f0e;})[_0x2df3('0x32')](function(_0x42c4f4){if(_0x42c4f4){_0x42c4f4[_0x2df3('0x23')]['interface']=util[_0x2df3('0x5d')](_0x2df3('0x7d'),_0x2d156f['user'][_0x2df3('0x37')]);_0x42c4f4[_0x2df3('0x23')][_0x2df3('0x70')]=_0x197f0e[_0x2df3('0x70')];_0x42c4f4[_0x2df3('0x23')][_0x2df3('0x71')]=_0x197f0e[_0x2df3('0x70')];_0x42c4f4[_0x2df3('0x23')]['event']=_0x2df3('0x2f');respondWithRpcPromise(_0x2df3('0x73'),'EventManager',{'event':_0x2df3('0x7e'),'message':_0x42c4f4[_0x2df3('0x23')]},client9002);return _0x197f0e;}return null;})[_0x2df3('0x32')](respondWithResult(_0x2c8207,null))[_0x2df3('0x26')](handleError(_0x2c8207,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c81c8aa..a5ac252 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 _0x9d04=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1f2f06,_0x1cf6bf){var _0x329390=function(_0x579077){while(--_0x579077){_0x1f2f06['push'](_0x1f2f06['shift']());}};_0x329390(++_0x1cf6bf);}(_0x9d04,0x18e));var _0x49d0=function(_0x4ff91f,_0x126612){_0x4ff91f=_0x4ff91f-0x0;var _0x801e5d=_0x9d04[_0x4ff91f];return _0x801e5d;};'use strict';var EventEmitter=require(_0x49d0('0x0'));var OpenchannelMessage=require(_0x49d0('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x49d0('0x2')](0x0);var events={'afterCreate':_0x49d0('0x3'),'afterUpdate':_0x49d0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ee6ce){return function(_0x58b781,_0x1ca11f,_0x1615c0){OpenchannelMessageEvents[_0x49d0('0x5')](_0x1ee6ce+':'+_0x58b781['id'],_0x58b781);OpenchannelMessageEvents[_0x49d0('0x5')](_0x1ee6ce,_0x58b781);_0x1615c0(null);};}for(var e in events){if(events[_0x49d0('0x6')](e)){var event=events[e];OpenchannelMessage[_0x49d0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xc4d4=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners','save'];(function(_0x3dc105,_0x5301c8){var _0x3a332a=function(_0x413f26){while(--_0x413f26){_0x3dc105['push'](_0x3dc105['shift']());}};_0x3a332a(++_0x5301c8);}(_0xc4d4,0xf8));var _0x4c4d=function(_0x40d79b,_0x22a83d){_0x40d79b=_0x40d79b-0x0;var _0x3ff7a7=_0xc4d4[_0x40d79b];return _0x3ff7a7;};'use strict';var EventEmitter=require(_0x4c4d('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x4c4d('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4c4d('0x2')](0x0);var events={'afterCreate':_0x4c4d('0x3'),'afterUpdate':'update','afterDestroy':_0x4c4d('0x4')};function emitEvent(_0x139603){return function(_0x567760,_0x527236,_0x3eea09){OpenchannelMessageEvents[_0x4c4d('0x5')](_0x139603+':'+_0x567760['id'],_0x567760);OpenchannelMessageEvents[_0x4c4d('0x5')](_0x139603,_0x567760);_0x3eea09(null);};}for(var e in events){if(events[_0x4c4d('0x6')](e)){var event=events[e];OpenchannelMessage[_0x4c4d('0x7')](e,emitEvent(event));}}module[_0x4c4d('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 2300aa2..ed7d14f 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 _0x0b0e=['get','toLowerCase','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','omit','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','FULLTEXT'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0x0b0e,0x187));var _0xe0b0=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x0b0e[_0xa45395];return _0x3c83d2;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe0b0('0xb'),'fields':[_0xe0b0('0xc')],'type':_0xe0b0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ac27e,_0x4c24f9,_0x338e7c){var _0x1dd3b8=_0x30e20d['models'];var _0x1fef28=_0x2ac27e[_0xe0b0('0xe')]({'plain':!![]});if(_0x1fef28['direction'][_0xe0b0('0xf')]()==='in'||_0x1fef28[_0xe0b0('0x10')][_0xe0b0('0xf')]()==='out'&&!_0x1fef28[_0xe0b0('0x11')]&&!_[_0xe0b0('0x12')](_0x1fef28[_0xe0b0('0x13')])){_0x1dd3b8[_0xe0b0('0x14')][_0xe0b0('0x15')]({'where':{'id':_0x1fef28['OpenchannelInteractionId']}})[_0xe0b0('0x16')](function(_0x154de6){if(_0x154de6){_0x154de6[_0xe0b0('0x17')]({'lastMsgAt':_0x1fef28[_0xe0b0('0x18')],'lastMsgDirection':_0x1fef28[_0xe0b0('0x10')]['toLowerCase']()});}})[_0xe0b0('0x19')](function(_0x5adb01){console[_0xe0b0('0x1a')](_0x5adb01);});}if(_0x1fef28[_0xe0b0('0x10')]==='out'&&!_0x1fef28[_0xe0b0('0x11')]){var _0x4a4cc0;_0x1dd3b8[_0xe0b0('0x1b')][_0xe0b0('0x1c')]()['then'](function(_0x54a3eb){return _0x1dd3b8[_0xe0b0('0x1d')]['find']({'where':{'id':_0x1fef28['OpenchannelAccountId']},'include':[{'model':_0x1dd3b8['OpenchannelInteraction'],'as':_0xe0b0('0x1e'),'where':{'id':_0x1fef28['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1dd3b8['CmContact'],'as':_0xe0b0('0x1f'),'attributes':_['keys'](_0x54a3eb)}]}]});})[_0xe0b0('0x16')](function(_0x5dba2f){_0x4a4cc0=_0x5dba2f[_0xe0b0('0xe')]({'plain':!![]});if(_0x4a4cc0&&_0x4a4cc0[_0xe0b0('0x20')]){logger[_0xe0b0('0x21')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x1fef28['id'],_0x4a4cc0[_0xe0b0('0x20')]));if(_0x4a4cc0['Interactions']&&_0x4a4cc0[_0xe0b0('0x1e')][_0xe0b0('0x24')]){_0x1fef28['Interaction']=_[_0xe0b0('0x25')](_0x4a4cc0['Interactions'][0x0],_0xe0b0('0x1f'));_0x1fef28['Contact']=_0x4a4cc0[_0xe0b0('0x1e')][0x0]['Contact'];}var _0x4c24f9={'method':'POST','uri':encodeURI(_0x4a4cc0[_0xe0b0('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4c24f9['method']){case _0xe0b0('0x26'):_0x4c24f9['qs']=_0x1fef28;break;case'POST':_0x4c24f9[_0xe0b0('0xc')]=_0x1fef28;break;}return rp(_0x4c24f9)[_0xe0b0('0x16')](function(_0x1f1ebd){logger[_0xe0b0('0x21')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['format'](_0xe0b0('0x27'),_0x1fef28['id'],_0x4a4cc0[_0xe0b0('0x20')]));if(_0x1f1ebd['body'][_0xe0b0('0x28')]&&_0x1f1ebd[_0xe0b0('0xc')][_0xe0b0('0x28')]!=_0x1fef28[_0xe0b0('0x29')][_0xe0b0('0x28')]){return _0x1dd3b8[_0xe0b0('0x14')][_0xe0b0('0x17')]({'threadId':_0x1f1ebd['body'][_0xe0b0('0x28')]},{'logging':!![],'where':{'id':_0x1fef28[_0xe0b0('0x29')]['id']}});}else{return;}})['then'](function(){return _0x2ac27e['update']({'read':!![]});})[_0xe0b0('0x19')](function(_0x33e672){logger[_0xe0b0('0x1a')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['inspect'](_0x33e672,{'showHidden':![],'depth':null}));_0x338e7c();});}else{_0x338e7c();}})[_0xe0b0('0x2a')](function(){_0x338e7c();});}else{_0x338e7c();}}},'charset':_0xe0b0('0x2b'),'collate':_0xe0b0('0x2c')});}; \ No newline at end of file +var _0x14a0=['fti_openchannel_messages','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','inspect','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages'];(function(_0x262fca,_0x416500){var _0x4453e9=function(_0x215e58){while(--_0x215e58){_0x262fca['push'](_0x262fca['shift']());}};_0x4453e9(++_0x416500);}(_0x14a0,0x8e));var _0x014a=function(_0x10810d,_0x2bb716){_0x10810d=_0x10810d-0x0;var _0x2e309c=_0x14a0[_0x10810d];return _0x2e309c;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'paranoid':![],'indexes':[{'name':_0x014a('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2519e3,_0x4f5506,_0x490ea2){var _0x5aa52f=_0x38a22c['models'];var _0x330469=_0x2519e3['get']({'plain':!![]});if(_0x330469[_0x014a('0xc')][_0x014a('0xd')]()==='in'||_0x330469['direction'][_0x014a('0xd')]()===_0x014a('0xe')&&!_0x330469[_0x014a('0xf')]&&!_[_0x014a('0x10')](_0x330469[_0x014a('0x11')])){_0x5aa52f[_0x014a('0x12')][_0x014a('0x13')]({'where':{'id':_0x330469[_0x014a('0x14')]}})[_0x014a('0x15')](function(_0x71535d){if(_0x71535d){_0x71535d[_0x014a('0x16')]({'lastMsgAt':_0x330469[_0x014a('0x17')],'lastMsgDirection':_0x330469['direction'][_0x014a('0xd')]()});}})[_0x014a('0x18')](function(_0x59f207){console[_0x014a('0x19')](_0x59f207);});}if(_0x330469[_0x014a('0xc')]==='out'&&!_0x330469[_0x014a('0xf')]){var _0x17e4be;_0x5aa52f[_0x014a('0x1a')][_0x014a('0x1b')]()[_0x014a('0x15')](function(_0x12d339){return _0x5aa52f[_0x014a('0x1c')][_0x014a('0x1d')]({'where':{'id':_0x330469[_0x014a('0x1e')]},'include':[{'model':_0x5aa52f[_0x014a('0x12')],'as':_0x014a('0x1f'),'where':{'id':_0x330469[_0x014a('0x14')]},'limit':0x1,'include':[{'model':_0x5aa52f[_0x014a('0x1a')],'as':_0x014a('0x20'),'attributes':_['keys'](_0x12d339)}]}]});})[_0x014a('0x15')](function(_0x109a9c){_0x17e4be=_0x109a9c[_0x014a('0x21')]({'plain':!![]});if(_0x17e4be&&_0x17e4be[_0x014a('0x22')]){logger[_0x014a('0x23')](_0x014a('0x24'),_0x014a('0x25'),util[_0x014a('0x26')](_0x014a('0x27'),_0x330469['id'],_0x17e4be['replyUri']));if(_0x17e4be[_0x014a('0x1f')]&&_0x17e4be['Interactions'][_0x014a('0x28')]){_0x330469[_0x014a('0x29')]=_[_0x014a('0x2a')](_0x17e4be[_0x014a('0x1f')][0x0],_0x014a('0x20'));_0x330469[_0x014a('0x20')]=_0x17e4be[_0x014a('0x1f')][0x0][_0x014a('0x20')];}var _0x4f5506={'method':'POST','uri':encodeURI(_0x17e4be[_0x014a('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4f5506['method']){case _0x014a('0x2b'):_0x4f5506['qs']=_0x330469;break;case _0x014a('0x2c'):_0x4f5506['body']=_0x330469;break;}return rp(_0x4f5506)['then'](function(_0x9a901f){logger[_0x014a('0x23')](_0x014a('0x24'),'afterCreate',util[_0x014a('0x26')](_0x014a('0x2d'),_0x330469['id'],_0x17e4be['replyUri']));if(_0x9a901f[_0x014a('0x2e')][_0x014a('0x2f')]&&_0x9a901f['body']['threadId']!=_0x330469[_0x014a('0x29')][_0x014a('0x2f')]){return _0x5aa52f[_0x014a('0x12')][_0x014a('0x16')]({'threadId':_0x9a901f['body'][_0x014a('0x2f')]},{'logging':!![],'where':{'id':_0x330469[_0x014a('0x29')]['id']}});}else{return;}})[_0x014a('0x15')](function(){return _0x2519e3[_0x014a('0x16')]({'read':!![]});})[_0x014a('0x18')](function(_0x1eb007){logger[_0x014a('0x19')](_0x014a('0x24'),_0x014a('0x25'),util[_0x014a('0x30')](_0x1eb007,{'showHidden':![],'depth':null}));_0x490ea2();});}else{_0x490ea2();}})[_0x014a('0x31')](function(){_0x490ea2();});}else{_0x490ea2();}}},'charset':'utf8mb4','collate':_0x014a('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 1b68826..03ec480 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x33029e,_0x50d418){var _0x5aecf4=function(_0x23e3cb){while(--_0x23e3cb){_0x33029e['push'](_0x33029e['shift']());}};_0x5aecf4(++_0x50d418);}(_0x2ef3,0xba));var _0x32ef=function(_0x274b3a,_0xde69e9){_0x274b3a=_0x274b3a-0x0;var _0x5148a6=_0x2ef3[_0x274b3a];return _0x5148a6;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x322164,_0x5b4bc5){var _0x2f1e49=function(_0x2ed0dd){while(--_0x2ed0dd){_0x322164['push'](_0x322164['shift']());}};_0x2f1e49(++_0x5b4bc5);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 842efde..6953c01 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 _0xbcba=['length','./openchannelMessage.events','save','update','emit','register'];(function(_0x2daf23,_0x5235b6){var _0x4a1f26=function(_0x10d596){while(--_0x10d596){_0x2daf23['push'](_0x2daf23['shift']());}};_0x4a1f26(++_0x5235b6);}(_0xbcba,0x6d));var _0xabcb=function(_0xc23417,_0x4094b2){_0xc23417=_0xc23417-0x0;var _0x380cbd=_0xbcba[_0xc23417];return _0x380cbd;};'use strict';var OpenchannelMessageEvents=require(_0xabcb('0x0'));var events=[_0xabcb('0x1'),'remove',_0xabcb('0x2')];function createListener(_0x2c9ee7,_0x2034d2){return function(_0xcbe337){_0x2034d2[_0xabcb('0x3')](_0x2c9ee7,_0xcbe337);};}function removeListener(_0x3e3b9b,_0x5e10df){return function(){OpenchannelMessageEvents['removeListener'](_0x3e3b9b,_0x5e10df);};}exports[_0xabcb('0x4')]=function(_0x1290b2){for(var _0x5c706e=0x0,_0x5322e7=events[_0xabcb('0x5')];_0x5c706e<_0x5322e7;_0x5c706e++){var _0x192b36=events[_0x5c706e];var _0x5e693d=createListener('openchannelMessage:'+_0x192b36,_0x1290b2);OpenchannelMessageEvents['on'](_0x192b36,_0x5e693d);}}; \ No newline at end of file +var _0x229a=['./openchannelMessage.events','save','remove','update','emit','register','openchannelMessage:'];(function(_0x297c0b,_0x4c5d12){var _0x2c0de3=function(_0x59ca28){while(--_0x59ca28){_0x297c0b['push'](_0x297c0b['shift']());}};_0x2c0de3(++_0x4c5d12);}(_0x229a,0x1ea));var _0xa229=function(_0x5a5ae3,_0x32ce80){_0x5a5ae3=_0x5a5ae3-0x0;var _0x44745c=_0x229a[_0x5a5ae3];return _0x44745c;};'use strict';var OpenchannelMessageEvents=require(_0xa229('0x0'));var events=[_0xa229('0x1'),_0xa229('0x2'),_0xa229('0x3')];function createListener(_0x1fab41,_0x23d2d0){return function(_0x83adc9){_0x23d2d0[_0xa229('0x4')](_0x1fab41,_0x83adc9);};}function removeListener(_0x59d505,_0x1713fd){return function(){OpenchannelMessageEvents['removeListener'](_0x59d505,_0x1713fd);};}exports[_0xa229('0x5')]=function(_0x6b31c9){for(var _0x24bad7=0x0,_0x2e0cd0=events['length'];_0x24bad7<_0x2e0cd0;_0x24bad7++){var _0x209bfa=events[_0x24bad7];var _0x213778=createListener(_0xa229('0x6')+_0x209bfa,_0x6b31c9);OpenchannelMessageEvents['on'](_0x209bfa,_0x213778);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 45d22eb..93928e6 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 _0xe9ad=['get','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index'];(function(_0x525d35,_0xe67489){var _0x4813d2=function(_0x4a6dc8){while(--_0x4a6dc8){_0x525d35['push'](_0x525d35['shift']());}};_0x4813d2(++_0xe67489);}(_0xe9ad,0x6e));var _0xde9a=function(_0x2b3a40,_0x386ecd){_0x2b3a40=_0x2b3a40-0x0;var _0x2ad588=_0xe9ad[_0x2b3a40];return _0x2ad588;};'use strict';var multer=require('multer');var util=require(_0xde9a('0x0'));var path=require('path');var timeout=require(_0xde9a('0x1'));var express=require(_0xde9a('0x2'));var router=express[_0xde9a('0x3')]();var fs_extra=require(_0xde9a('0x4'));var auth=require(_0xde9a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde9a('0x6'));var controller=require(_0xde9a('0x7'));router['get']('/',auth[_0xde9a('0x8')](),controller[_0xde9a('0x9')]);router[_0xde9a('0xa')](_0xde9a('0xb'),auth[_0xde9a('0x8')](),controller[_0xde9a('0xc')]);router['get']('/:id',auth[_0xde9a('0x8')](),controller[_0xde9a('0xd')]);router['get'](_0xde9a('0xe'),auth[_0xde9a('0x8')](),controller[_0xde9a('0xf')]);router['get'](_0xde9a('0x10'),auth[_0xde9a('0x8')](),controller['getTeams']);router['get'](_0xde9a('0x11'),auth['isAuthenticated'](),controller[_0xde9a('0x12')]);router[_0xde9a('0x13')]('/',auth['isAuthenticated'](),controller[_0xde9a('0x14')]);router[_0xde9a('0x13')](_0xde9a('0x10'),auth[_0xde9a('0x8')](),controller['addTeams']);router[_0xde9a('0x13')](_0xde9a('0x11'),auth[_0xde9a('0x8')](),controller[_0xde9a('0x15')]);router[_0xde9a('0x16')](_0xde9a('0x17'),auth[_0xde9a('0x8')](),controller[_0xde9a('0x18')]);router[_0xde9a('0x19')]('/:id',auth[_0xde9a('0x8')](),controller[_0xde9a('0x1a')]);router['delete'](_0xde9a('0x10'),auth[_0xde9a('0x8')](),controller[_0xde9a('0x1b')]);router[_0xde9a('0x19')](_0xde9a('0x11'),auth[_0xde9a('0x8')](),controller[_0xde9a('0x1c')]);module[_0xde9a('0x1d')]=router; \ No newline at end of file +var _0x2637=['get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','./openchannelQueue.controller'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x2637,0xfd));var _0x7263=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x2637[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x7263('0x0'));var util=require(_0x7263('0x1'));var path=require('path');var timeout=require(_0x7263('0x2'));var express=require(_0x7263('0x3'));var router=express[_0x7263('0x4')]();var fs_extra=require(_0x7263('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7263('0x6'));router[_0x7263('0x7')]('/',auth[_0x7263('0x8')](),controller[_0x7263('0x9')]);router[_0x7263('0x7')]('/describe',auth[_0x7263('0x8')](),controller[_0x7263('0xa')]);router[_0x7263('0x7')](_0x7263('0xb'),auth[_0x7263('0x8')](),controller[_0x7263('0xc')]);router['get'](_0x7263('0xd'),auth[_0x7263('0x8')](),controller[_0x7263('0xe')]);router[_0x7263('0x7')](_0x7263('0xf'),auth[_0x7263('0x8')](),controller['getTeams']);router[_0x7263('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x7263('0x10')]('/',auth[_0x7263('0x8')](),controller[_0x7263('0x11')]);router[_0x7263('0x10')]('/:id/teams',auth[_0x7263('0x8')](),controller[_0x7263('0x12')]);router['post'](_0x7263('0x13'),auth[_0x7263('0x8')](),controller[_0x7263('0x14')]);router['put'](_0x7263('0xb'),auth['isAuthenticated'](),controller[_0x7263('0x15')]);router[_0x7263('0x16')](_0x7263('0xb'),auth['isAuthenticated'](),controller[_0x7263('0x17')]);router[_0x7263('0x16')](_0x7263('0xf'),auth[_0x7263('0x8')](),controller['removeTeams']);router[_0x7263('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x7263('0x18')]);module[_0x7263('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 120c4c2..bfebed8 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 _0xa72a=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa72a,0x12b));var _0xaa72=function(_0x16f026,_0x2baae7){_0x16f026=_0x16f026-0x0;var _0x380606=_0xa72a[_0x16f026];return _0x380606;};'use strict';var Sequelize=require(_0xaa72('0x0'));module[_0xaa72('0x1')]={'name':{'type':Sequelize[_0xaa72('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaa72('0x3')](_0xaa72('0x4'),_0xaa72('0x5'),_0xaa72('0x6'))}}; \ No newline at end of file +var _0x8ff2=['rrmemory','beepall','exports','STRING','INTEGER','ENUM'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x8ff2,0x1d6));var _0x28ff=function(_0x198f8b,_0x39ee88){_0x198f8b=_0x198f8b-0x0;var _0x463aa3=_0x8ff2[_0x198f8b];return _0x463aa3;};'use strict';var Sequelize=require('sequelize');module[_0x28ff('0x0')]={'name':{'type':Sequelize[_0x28ff('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x28ff('0x1')]},'timeout':{'type':Sequelize[_0x28ff('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x28ff('0x3')](_0x28ff('0x4'),_0x28ff('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 7af5cc7..857fcf4 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 _0x1bef=['./openchannelQueue.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','VIRTUAL','merge','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','options','create','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','Agents','interface','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','field','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','getAgents','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults'];(function(_0x5aa1e2,_0x2b5adb){var _0x399098=function(_0xb129fb){while(--_0xb129fb){_0x5aa1e2['push'](_0x5aa1e2['shift']());}};_0x399098(++_0x2b5adb);}(_0x1bef,0x74));var _0xf1be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bef[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1be('0x1'));var moment=require('moment');var BPromise=require(_0xf1be('0x2'));var Mustache=require(_0xf1be('0x3'));var util=require('util');var path=require(_0xf1be('0x4'));var sox=require('sox');var csv=require(_0xf1be('0x5'));var ejs=require(_0xf1be('0x6'));var fs=require('fs');var fs_extra=require(_0xf1be('0x7'));var _=require(_0xf1be('0x8'));var squel=require(_0xf1be('0x9'));var crypto=require('crypto');var jsforce=require(_0xf1be('0xa'));var deskjs=require(_0xf1be('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf1be('0xc'));var authService=require(_0xf1be('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf1be('0xe'));var hardwareService=require(_0xf1be('0xf'));var logger=require(_0xf1be('0x10'))(_0xf1be('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1be('0x12'));var db=require('../../mysqldb')['db'];config[_0xf1be('0x13')]=_[_0xf1be('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1be('0x13')]));require(_0xf1be('0x15'))[_0xf1be('0x16')](socket);function respondWithStatusCode(_0x51cf59,_0x56cddb){_0x56cddb=_0x56cddb||0xcc;return function(_0x4beb19){if(_0x4beb19){return _0x51cf59['sendStatus'](_0x56cddb);}return _0x51cf59[_0xf1be('0x17')](_0x56cddb)[_0xf1be('0x18')]();};}function respondWithResult(_0x441ec0,_0xdaadaa){_0xdaadaa=_0xdaadaa||0xc8;return function(_0xb3142a){if(_0xb3142a){return _0x441ec0[_0xf1be('0x17')](_0xdaadaa)[_0xf1be('0x19')](_0xb3142a);}};}function respondWithFilteredResult(_0x5715a5,_0x3c2993){return function(_0x26703e){if(_0x26703e){var _0x126407=typeof _0x3c2993[_0xf1be('0x1a')]===_0xf1be('0x1b')&&typeof _0x3c2993['limit']===_0xf1be('0x1b');var _0xf87460=_0x26703e[_0xf1be('0x1c')];var _0x736c8=_0x126407?0x0:_0x3c2993[_0xf1be('0x1a')];var _0x3ae8af=_0x126407?_0x26703e[_0xf1be('0x1c')]:_0x3c2993[_0xf1be('0x1a')]+_0x3c2993[_0xf1be('0x1d')];var _0x50fd97;if(_0x3ae8af>=_0xf87460){_0x3ae8af=_0xf87460;_0x50fd97=0xc8;}else{_0x50fd97=0xce;}_0x5715a5['status'](_0x50fd97);return _0x5715a5[_0xf1be('0x1e')]('Content-Range',_0x736c8+'-'+_0x3ae8af+'/'+_0xf87460)[_0xf1be('0x19')](_0x26703e);}return null;};}function patchUpdates(_0x2c347a){return function(_0x2e6ff5){try{jsonpatch[_0xf1be('0x1f')](_0x2e6ff5,_0x2c347a,!![]);}catch(_0x2f1d37){return BPromise[_0xf1be('0x20')](_0x2f1d37);}return _0x2e6ff5[_0xf1be('0x21')]();};}function saveUpdates(_0x764ca9,_0x310fa8){return function(_0xae4f4b){if(_0xae4f4b){return _0xae4f4b[_0xf1be('0x22')](_0x764ca9)[_0xf1be('0x23')](function(_0x519212){return _0x519212;});}return null;};}function removeEntity(_0x104198,_0x35cc77){return function(_0x1a8abe){if(_0x1a8abe){return _0x1a8abe[_0xf1be('0x24')]()[_0xf1be('0x23')](function(){var _0x1ee0b1=_0x1a8abe[_0xf1be('0x25')]({'plain':!![]});var _0x577834=_0xf1be('0x26');return db[_0xf1be('0x27')][_0xf1be('0x24')]({'where':{'type':_0x577834,'resourceId':_0x1ee0b1['id']}})['then'](function(){return _0x1a8abe;});})[_0xf1be('0x23')](function(){_0x104198[_0xf1be('0x17')](0xcc)[_0xf1be('0x18')]();});}};}function handleEntityNotFound(_0x1f8f3e,_0x4022f4){return function(_0x47f9ac){if(!_0x47f9ac){_0x1f8f3e[_0xf1be('0x28')](0x194);}return _0x47f9ac;};}function handleError(_0x42469f,_0x15bd48){_0x15bd48=_0x15bd48||0x1f4;return function(_0x255ce3){logger[_0xf1be('0x29')](_0x255ce3[_0xf1be('0x2a')]);if(_0x255ce3[_0xf1be('0x2b')]){delete _0x255ce3[_0xf1be('0x2b')];}_0x42469f[_0xf1be('0x17')](_0x15bd48)[_0xf1be('0x2c')](_0x255ce3);};}exports[_0xf1be('0x2d')]=function(_0x1ad9b0,_0x2d7ce9){var _0x25a645={},_0x3e6aa0={},_0x25e6ea={'count':0x0,'rows':[]};var _0x788e55=_[_0xf1be('0x2e')](db['OpenchannelQueue'][_0xf1be('0x2f')],function(_0x492232){return{'name':_0x492232[_0xf1be('0x30')],'type':_0x492232[_0xf1be('0x31')]['key']};});_0x3e6aa0[_0xf1be('0x32')]=_[_0xf1be('0x2e')](_0x788e55,'name');_0x3e6aa0['query']=_[_0xf1be('0x33')](_0x1ad9b0[_0xf1be('0x34')]);_0x3e6aa0['filters']=_[_0xf1be('0x35')](_0x3e6aa0[_0xf1be('0x32')],_0x3e6aa0[_0xf1be('0x34')]);_0x25a645[_0xf1be('0x36')]=_['intersection'](_0x3e6aa0[_0xf1be('0x32')],qs[_0xf1be('0x37')](_0x1ad9b0['query'][_0xf1be('0x37')]));_0x25a645[_0xf1be('0x36')]=_0x25a645[_0xf1be('0x36')][_0xf1be('0x38')]?_0x25a645[_0xf1be('0x36')]:_0x3e6aa0[_0xf1be('0x32')];if(!_0x1ad9b0[_0xf1be('0x34')]['hasOwnProperty']('nolimit')){_0x25a645[_0xf1be('0x1d')]=qs[_0xf1be('0x1d')](_0x1ad9b0[_0xf1be('0x34')][_0xf1be('0x1d')]);_0x25a645[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x1ad9b0[_0xf1be('0x34')][_0xf1be('0x1a')]);}_0x25a645[_0xf1be('0x39')]=qs[_0xf1be('0x3a')](_0x1ad9b0[_0xf1be('0x34')][_0xf1be('0x3a')]);_0x25a645['where']=qs[_0xf1be('0x3b')](_[_0xf1be('0x3c')](_0x1ad9b0['query'],_0x3e6aa0[_0xf1be('0x3b')]),_0x788e55);if(_0x1ad9b0[_0xf1be('0x34')][_0xf1be('0x3d')]){_0x25a645[_0xf1be('0x3e')]=_['merge'](_0x25a645[_0xf1be('0x3e')],{'$or':_[_0xf1be('0x2e')](_0x788e55,function(_0x196b7a){if(_0x196b7a['type']!==_0xf1be('0x3f')){var _0x5c62ff={};_0x5c62ff[_0x196b7a['name']]={'$like':'%'+_0x1ad9b0[_0xf1be('0x34')][_0xf1be('0x3d')]+'%'};return _0x5c62ff;}})});}_0x25a645=_[_0xf1be('0x40')]({},_0x25a645,_0x1ad9b0['options']);var _0x4fd7ab={'where':_0x25a645[_0xf1be('0x3e')]};return db[_0xf1be('0x41')][_0xf1be('0x1c')](_0x4fd7ab)[_0xf1be('0x23')](function(_0x13545a){_0x25e6ea[_0xf1be('0x1c')]=_0x13545a;if(_0x1ad9b0['query'][_0xf1be('0x42')]){_0x25a645[_0xf1be('0x43')]=[{'all':!![]}];}return db[_0xf1be('0x41')][_0xf1be('0x44')](_0x25a645);})[_0xf1be('0x23')](function(_0x87d956){_0x25e6ea[_0xf1be('0x45')]=_0x87d956;return _0x25e6ea;})[_0xf1be('0x23')](respondWithFilteredResult(_0x2d7ce9,_0x25a645))[_0xf1be('0x46')](handleError(_0x2d7ce9,null));};exports[_0xf1be('0x47')]=function(_0x3bc74f,_0xf386b4){var _0x2ae13b={'raw':!![],'where':{'id':_0x3bc74f[_0xf1be('0x48')]['id']}},_0x56e89b={};_0x56e89b[_0xf1be('0x32')]=_[_0xf1be('0x33')](db[_0xf1be('0x41')][_0xf1be('0x2f')]);_0x56e89b['query']=_[_0xf1be('0x33')](_0x3bc74f[_0xf1be('0x34')]);_0x56e89b[_0xf1be('0x3b')]=_[_0xf1be('0x35')](_0x56e89b[_0xf1be('0x32')],_0x56e89b['query']);_0x2ae13b[_0xf1be('0x36')]=_[_0xf1be('0x35')](_0x56e89b['model'],qs[_0xf1be('0x37')](_0x3bc74f['query'][_0xf1be('0x37')]));_0x2ae13b[_0xf1be('0x36')]=_0x2ae13b[_0xf1be('0x36')][_0xf1be('0x38')]?_0x2ae13b[_0xf1be('0x36')]:_0x56e89b['model'];if(_0x3bc74f['query']['includeAll']){_0x2ae13b['include']=[{'all':!![]}];}_0x2ae13b=_['merge']({},_0x2ae13b,_0x3bc74f[_0xf1be('0x49')]);return db[_0xf1be('0x41')]['find'](_0x2ae13b)[_0xf1be('0x23')](handleEntityNotFound(_0xf386b4,null))[_0xf1be('0x23')](respondWithResult(_0xf386b4,null))[_0xf1be('0x46')](handleError(_0xf386b4,null));};exports[_0xf1be('0x4a')]=function(_0x5ab1cc,_0x303bac){return db[_0xf1be('0x41')]['create'](_0x5ab1cc['body'],{})[_0xf1be('0x23')](function(_0x100715){var _0x14dfa5=_0x5ab1cc[_0xf1be('0x4b')]['get']({'plain':!![]});if(!_0x14dfa5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14dfa5[_0xf1be('0x4c')]==='user'){var _0x580c03=_0x100715[_0xf1be('0x25')]({'plain':!![]});var _0x45d732='OpenchannelQueues';return db[_0xf1be('0x4d')][_0xf1be('0x4e')]({'where':{'name':_0x45d732,'userProfileId':_0x14dfa5[_0xf1be('0x4f')]},'raw':!![]})[_0xf1be('0x23')](function(_0x2fbcf7){if(_0x2fbcf7&&_0x2fbcf7['autoAssociation']===0x0){return db[_0xf1be('0x27')][_0xf1be('0x4a')]({'name':_0x580c03[_0xf1be('0x2b')],'resourceId':_0x580c03['id'],'type':_0x2fbcf7['name'],'sectionId':_0x2fbcf7['id']},{})['then'](function(){return _0x100715;});}else{return _0x100715;}})[_0xf1be('0x46')](function(_0x3b83c1){logger['error'](_0xf1be('0x50'),_0x3b83c1);throw _0x3b83c1;});}return _0x100715;})[_0xf1be('0x23')](respondWithResult(_0x303bac,0xc9))[_0xf1be('0x46')](handleError(_0x303bac,null));};exports['update']=function(_0x20d07a,_0x1699ed){if(_0x20d07a[_0xf1be('0x51')]['id']){delete _0x20d07a[_0xf1be('0x51')]['id'];}return db[_0xf1be('0x41')][_0xf1be('0x4e')]({'where':{'id':_0x20d07a[_0xf1be('0x48')]['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0x1699ed,null))['then'](saveUpdates(_0x20d07a['body'],null))[_0xf1be('0x23')](respondWithResult(_0x1699ed,null))[_0xf1be('0x46')](handleError(_0x1699ed,null));};exports[_0xf1be('0x24')]=function(_0x19a8d9,_0x4fbbb6){return db['OpenchannelQueue'][_0xf1be('0x4e')]({'where':{'id':_0x19a8d9['params']['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0x4fbbb6,null))[_0xf1be('0x23')](removeEntity(_0x4fbbb6,null))['catch'](handleError(_0x4fbbb6,null));};exports[_0xf1be('0x52')]=function(_0x3ffb7b,_0x52851e){return db[_0xf1be('0x41')][_0xf1be('0x52')]()['then'](respondWithResult(_0x52851e,null))['catch'](handleError(_0x52851e,null));};exports[_0xf1be('0x53')]=function(_0x5d8a14,_0xf7350b,_0x3ab117){var _0x1008f4={'raw':!![],'where':{}},_0x42e595={},_0x333843;return db[_0xf1be('0x41')]['findOne']({'where':{'id':_0x5d8a14[_0xf1be('0x48')]['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0xf7350b,null))[_0xf1be('0x23')](function(_0xc789e5){if(_0xc789e5){_0x333843=_0xc789e5['get']({'plain':!![]});_0x42e595[_0xf1be('0x32')]=_[_0xf1be('0x33')](db[_0xf1be('0x54')][_0xf1be('0x2f')]);_0x42e595[_0xf1be('0x34')]=_[_0xf1be('0x33')](_0x5d8a14[_0xf1be('0x34')]);_0x42e595[_0xf1be('0x3b')]=_[_0xf1be('0x35')](_0x42e595['model'],_0x42e595[_0xf1be('0x34')]);_0x1008f4[_0xf1be('0x36')]=_[_0xf1be('0x35')](_0x42e595[_0xf1be('0x32')],qs[_0xf1be('0x37')](_0x5d8a14[_0xf1be('0x34')][_0xf1be('0x37')]));_0x1008f4[_0xf1be('0x36')]=_0x1008f4[_0xf1be('0x36')][_0xf1be('0x38')]?_0x1008f4[_0xf1be('0x36')]:_0x42e595[_0xf1be('0x32')];if(!_0x5d8a14['query'][_0xf1be('0x55')](_0xf1be('0x56'))){_0x1008f4[_0xf1be('0x1d')]=qs[_0xf1be('0x1d')](_0x5d8a14[_0xf1be('0x34')][_0xf1be('0x1d')]);_0x1008f4[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x5d8a14[_0xf1be('0x34')]['offset']);}_0x1008f4[_0xf1be('0x39')]=qs[_0xf1be('0x3a')](_0x5d8a14[_0xf1be('0x34')][_0xf1be('0x3a')]);_0x1008f4[_0xf1be('0x3e')]=qs[_0xf1be('0x3b')](_[_0xf1be('0x3c')](_0x5d8a14['query'],_0x42e595['filters']));_0x1008f4[_0xf1be('0x3e')][_0xf1be('0x57')]=_0xc789e5['id'];if(_0x5d8a14['query'][_0xf1be('0x3d')]){_0x1008f4[_0xf1be('0x3e')]=_[_0xf1be('0x40')](_0x1008f4[_0xf1be('0x3e')],{'$or':_[_0xf1be('0x2e')](_0x1008f4[_0xf1be('0x36')],function(_0x4a1333){var _0x3c37a1={};_0x3c37a1[_0x4a1333]={'$like':'%'+_0x5d8a14[_0xf1be('0x34')][_0xf1be('0x3d')]+'%'};return _0x3c37a1;})});}_0x1008f4=_[_0xf1be('0x40')]({},_0x1008f4,_0x5d8a14['options']);return db[_0xf1be('0x54')][_0xf1be('0x44')](_0x1008f4);}})[_0xf1be('0x23')](function(_0x56ee39){if(_0x56ee39){return db[_0xf1be('0x58')][_0xf1be('0x59')]({'where':{'id':_[_0xf1be('0x2e')](_0x56ee39,_0xf1be('0x5a')),'role':_0xf1be('0x5b')},'attributes':['id','name',_0xf1be('0x5c'),_0xf1be('0x5d'),_0xf1be('0x5e')]});}})[_0xf1be('0x23')](function(_0x3aa41c){if(_0x3aa41c){return{'count':_0x3aa41c[_0xf1be('0x1c')],'rows':_['map'](_0x3aa41c['rows'],function(_0x9f36f0){return{'membername':_0x9f36f0[_0xf1be('0x2b')],'UserId':_0x9f36f0['id'],'queue_name':_0x333843['name'],'OpenchannelQueueId':_0x333843['id'],'interface':util[_0xf1be('0x5f')](_0xf1be('0x60'),_0xf1be('0x61'),_0x9f36f0[_0xf1be('0x2b')]),'penalty':0x0,'paused':_0x9f36f0['openchannelPause'],'createdAt':_0x9f36f0[_0xf1be('0x5e')],'updatedAt':_0x9f36f0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf1be('0x23')](respondWithFilteredResult(_0xf7350b,_0x1008f4))[_0xf1be('0x46')](handleError(_0xf7350b,null));};exports['getTeams']=function(_0x4748ba,_0x480077,_0x4019e8){var _0x402125={};var _0x33d017={};var _0x84c869;var _0x662266;return db[_0xf1be('0x41')][_0xf1be('0x62')]({'where':{'id':_0x4748ba[_0xf1be('0x48')]['id']}})['then'](handleEntityNotFound(_0x480077,null))[_0xf1be('0x23')](function(_0x808d6){if(_0x808d6){_0x84c869=_0x808d6;_0x33d017[_0xf1be('0x32')]=_[_0xf1be('0x33')](db[_0xf1be('0x63')][_0xf1be('0x2f')]);_0x33d017[_0xf1be('0x34')]=_[_0xf1be('0x33')](_0x4748ba[_0xf1be('0x34')]);_0x33d017['filters']=_[_0xf1be('0x35')](_0x33d017['model'],_0x33d017['query']);_0x402125[_0xf1be('0x36')]=_[_0xf1be('0x35')](_0x33d017['model'],qs[_0xf1be('0x37')](_0x4748ba['query'][_0xf1be('0x37')]));_0x402125[_0xf1be('0x36')]=_0x402125[_0xf1be('0x36')][_0xf1be('0x38')]?_0x402125[_0xf1be('0x36')]:_0x33d017[_0xf1be('0x32')];_0x402125[_0xf1be('0x39')]=qs[_0xf1be('0x3a')](_0x4748ba['query']['sort']);_0x402125[_0xf1be('0x3e')]=qs[_0xf1be('0x3b')](_[_0xf1be('0x3c')](_0x4748ba[_0xf1be('0x34')],_0x33d017[_0xf1be('0x3b')]));if(_0x4748ba[_0xf1be('0x34')][_0xf1be('0x3d')]){_0x402125['where']=_['merge'](_0x402125['where'],{'$or':_[_0xf1be('0x2e')](_0x402125[_0xf1be('0x36')],function(_0x427220){var _0x327826={};_0x327826[_0x427220]={'$like':'%'+_0x4748ba[_0xf1be('0x34')][_0xf1be('0x3d')]+'%'};return _0x327826;})});}_0x402125=_[_0xf1be('0x40')]({},_0x402125,_0x4748ba['options']);return _0x84c869[_0xf1be('0x64')](_0x402125);}})[_0xf1be('0x23')](function(_0x1e6ce5){if(_0x1e6ce5){_0x662266=_0x1e6ce5[_0xf1be('0x38')];if(!_0x4748ba[_0xf1be('0x34')]['hasOwnProperty'](_0xf1be('0x56'))){_0x402125[_0xf1be('0x1d')]=qs[_0xf1be('0x1d')](_0x4748ba[_0xf1be('0x34')]['limit']);_0x402125[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x4748ba[_0xf1be('0x34')]['offset']);}return _0x84c869['getTeams'](_0x402125);}})[_0xf1be('0x23')](function(_0x37a68a){if(_0x37a68a){return _0x37a68a?{'count':_0x662266,'rows':_0x37a68a}:null;}})['then'](respondWithResult(_0x480077,null))['catch'](handleError(_0x480077,null));};exports[_0xf1be('0x65')]=function(_0x54dfd0,_0xbf5865,_0x3de452){var _0x567feb=_0x54dfd0[_0xf1be('0x51')]['ids'];return db['Team']['findAll']({'where':{'id':_0x567feb},'attributes':['id'],'include':[{'model':db[_0xf1be('0x58')],'as':_0xf1be('0x66'),'attributes':['id',_0xf1be('0x2b'),'online','voicePause',_0xf1be('0x67')],'raw':!![]}]})['then'](function(_0x2e2063){if(_0x2e2063){var _0x42e77d=_['flatMap'](_0x2e2063,function(_0x5def19){var _0xf81c71=_0x5def19['get']({'plain':!![]});return _0xf81c71['Agents'];});return db[_0xf1be('0x41')][_0xf1be('0x4e')]({'where':{'id':_0x54dfd0[_0xf1be('0x48')]['id']}})[_0xf1be('0x23')](function(_0x3fa1bb){return db['sequelize'][_0xf1be('0x68')](function(_0x24c468){return _0x3fa1bb[_0xf1be('0x65')](_0x567feb,{'transaction':_0x24c468})[_0xf1be('0x23')](function(){return BPromise[_0xf1be('0x69')](_0x42e77d,function(_0x10546e){return db[_0xf1be('0x54')][_0xf1be('0x6a')]({'where':{'UserId':_0x10546e['id'],'OpenchannelQueueId':_0x54dfd0[_0xf1be('0x48')]['id']},'transaction':_0x24c468});});})[_0xf1be('0x23')](function(){_0x42e77d[_0xf1be('0x6b')](function(_0x3138dc){socket[_0xf1be('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x3138dc['id'],'OpenchannelQueueId':_0x3fa1bb['id']});});});});});}})[_0xf1be('0x23')](respondWithStatusCode(_0xbf5865,null))[_0xf1be('0x46')](handleError(_0xbf5865,null));};exports[_0xf1be('0x6d')]=function(_0x1d4100,_0x23abde,_0x34d656){return db['Team']['findAll']({'where':{'id':_0x1d4100[_0xf1be('0x34')][_0xf1be('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf1be('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf1be('0x23')](handleEntityNotFound(_0x23abde,null))[_0xf1be('0x23')](function(_0x249513){var _0x1ee5bd=_[_0xf1be('0x2e')](_0x249513,'id');var _0x29f76=[];var _0x442007=[];var _0x4eb91c=squel[_0xf1be('0x6f')]();_0x4eb91c[_0xf1be('0x70')]('tq.TeamId')[_0xf1be('0x71')](_0xf1be('0x72'),'tq')[_0xf1be('0x73')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf1be('0x3e')](_0xf1be('0x74'),_0x1d4100[_0xf1be('0x48')]['id']);for(var _0x420758=0x0;_0x420758<_0x249513['length'];_0x420758+=0x1){let _0xae9d10=_0x249513[_0x420758];for(var _0x14f7fb=0x0;_0x14f7fb<_0xae9d10[_0xf1be('0x66')]['length'];_0x14f7fb+=0x1){let _0x22464d=_0xae9d10[_0xf1be('0x66')][_0x14f7fb];var _0x269f47=_0x4eb91c[_0xf1be('0x75')]();_0x269f47[_0xf1be('0x3e')]('ut.UserId\x20=\x20?',_0x22464d['id']);_0x442007[_0xf1be('0x76')](db['sequelize'][_0xf1be('0x34')](_0x269f47[_0xf1be('0x77')](),{'type':db[_0xf1be('0x78')][_0xf1be('0x79')][_0xf1be('0x7a')]})[_0xf1be('0x23')](function(_0x5d0666){if(_0x5d0666['length']===0x1){return _0x22464d['id'];}else{var _0x57b727=_[_0xf1be('0x7b')](_[_0xf1be('0x2e')](_0x5d0666,_0xf1be('0x7c')),function(_0x40d34a){return _[_0xf1be('0x7d')](_0x1ee5bd,_0x40d34a);});if(_0x57b727){return _0x22464d['id'];}}}));}}return BPromise[_0xf1be('0x7e')](_0x442007)[_0xf1be('0x23')](function(_0x571af5){_0x29f76=_(_0x29f76)[_0xf1be('0x7f')](_0x571af5)[_0xf1be('0x80')]()['value']();return db[_0xf1be('0x41')]['find']({'where':{'id':_0x1d4100[_0xf1be('0x48')]['id']}})[_0xf1be('0x23')](function(_0x3618c3){return db[_0xf1be('0x78')][_0xf1be('0x68')](function(_0x5058c6){return _0x3618c3[_0xf1be('0x6d')](_0x1d4100[_0xf1be('0x34')][_0xf1be('0x6e')],{'transaction':_0x5058c6})['then'](function(){if(!_[_0xf1be('0x81')](_0x29f76)){return _0x3618c3['removeAgents'](_0x29f76,{'transaction':_0x5058c6});}})[_0xf1be('0x23')](function(){_0x29f76['forEach'](function(_0x3526ef){socket[_0xf1be('0x6c')](_0xf1be('0x82'),{'UserId':_0x3526ef,'OpenchannelQueueId':_0x3618c3['id']});});});});});});})[_0xf1be('0x23')](respondWithStatusCode(_0x23abde,null))[_0xf1be('0x46')](handleError(_0x23abde,null));};exports[_0xf1be('0x83')]=function(_0x45ceff,_0x58651e,_0x553449){return db['OpenchannelQueue'][_0xf1be('0x4e')]({'where':{'id':_0x45ceff['params']['id']}})['then'](handleEntityNotFound(_0x58651e,null))[_0xf1be('0x23')](function(_0x41f19f){if(_0x41f19f){return _0x41f19f['addAgents'](_0x45ceff['body'][_0xf1be('0x6e')],_[_0xf1be('0x84')](_0x45ceff[_0xf1be('0x51')],[_0xf1be('0x6e'),'id'])||{})[_0xf1be('0x85')](function(_0x2d5c30){for(var _0x12b69b=0x0;_0x12b69b<_0x45ceff[_0xf1be('0x51')][_0xf1be('0x6e')][_0xf1be('0x38')];_0x12b69b+=0x1){socket[_0xf1be('0x6c')](_0xf1be('0x86'),{'UserId':Number(_0x45ceff[_0xf1be('0x51')][_0xf1be('0x6e')][_0x12b69b]),'OpenchannelQueueId':Number(_0x45ceff[_0xf1be('0x48')]['id'])});}return _0x2d5c30;});}})[_0xf1be('0x23')](respondWithResult(_0x58651e,null))[_0xf1be('0x46')](handleError(_0x58651e,null));};exports[_0xf1be('0x87')]=function(_0x4967b1,_0xe8e145,_0x4a8dd){return db[_0xf1be('0x41')]['find']({'where':{'id':_0x4967b1[_0xf1be('0x48')]['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0xe8e145,null))['then'](function(_0x52429d){if(_0x52429d){return _0x52429d[_0xf1be('0x87')](_0x4967b1[_0xf1be('0x34')]['ids'])[_0xf1be('0x23')](function(){if(_['isArray'](_0x4967b1[_0xf1be('0x34')]['ids'])){for(var _0x2d4526=0x0;_0x2d4526<_0x4967b1[_0xf1be('0x34')][_0xf1be('0x6e')]['length'];_0x2d4526+=0x1){socket[_0xf1be('0x6c')](_0xf1be('0x82'),{'UserId':Number(_0x4967b1[_0xf1be('0x34')][_0xf1be('0x6e')][_0x2d4526]),'OpenchannelQueueId':Number(_0x4967b1[_0xf1be('0x48')]['id'])});}}else{socket[_0xf1be('0x6c')](_0xf1be('0x82'),{'UserId':Number(_0x4967b1[_0xf1be('0x34')][_0xf1be('0x6e')]),'OpenchannelQueueId':Number(_0x4967b1['params']['id'])});}});}})[_0xf1be('0x23')](respondWithStatusCode(_0xe8e145,null))[_0xf1be('0x46')](handleError(_0xe8e145,null));};exports[_0xf1be('0x88')]=function(_0x2c66c0,_0x3511d6,_0x2ebba6){var _0x1ef36d={};var _0x3b4070={};var _0x5087fd;var _0x51524b;return db[_0xf1be('0x41')]['findOne']({'where':{'id':_0x2c66c0[_0xf1be('0x48')]['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0x3511d6,null))['then'](function(_0x5d6b09){if(_0x5d6b09){_0x5087fd=_0x5d6b09;_0x3b4070[_0xf1be('0x32')]=_[_0xf1be('0x33')](db[_0xf1be('0x58')][_0xf1be('0x2f')]);_0x3b4070['query']=_['keys'](_0x2c66c0[_0xf1be('0x34')]);_0x3b4070['filters']=_[_0xf1be('0x35')](_0x3b4070[_0xf1be('0x32')],_0x3b4070[_0xf1be('0x34')]);_0x1ef36d['attributes']=_[_0xf1be('0x35')](_0x3b4070[_0xf1be('0x32')],qs[_0xf1be('0x37')](_0x2c66c0['query'][_0xf1be('0x37')]));_0x1ef36d[_0xf1be('0x36')]=_0x1ef36d[_0xf1be('0x36')]['length']?_0x1ef36d[_0xf1be('0x36')]:_0x3b4070[_0xf1be('0x32')];_0x1ef36d[_0xf1be('0x39')]=qs[_0xf1be('0x3a')](_0x2c66c0['query'][_0xf1be('0x3a')]);_0x1ef36d[_0xf1be('0x3e')]=qs[_0xf1be('0x3b')](_['pick'](_0x2c66c0['query'],_0x3b4070[_0xf1be('0x3b')]));if(_0x2c66c0['query'][_0xf1be('0x3d')]){_0x1ef36d[_0xf1be('0x3e')]=_['merge'](_0x1ef36d[_0xf1be('0x3e')],{'$or':_['map'](_0x1ef36d[_0xf1be('0x36')],function(_0xb306e6){var _0x591792={};_0x591792[_0xb306e6]={'$like':'%'+_0x2c66c0['query'][_0xf1be('0x3d')]+'%'};return _0x591792;})});}_0x1ef36d=_[_0xf1be('0x40')]({},_0x1ef36d,_0x2c66c0[_0xf1be('0x49')]);return _0x5087fd['getAgents'](_0x1ef36d);}})[_0xf1be('0x23')](function(_0x38da5b){if(_0x38da5b){_0x51524b=_0x38da5b[_0xf1be('0x38')];if(!_0x2c66c0[_0xf1be('0x34')]['hasOwnProperty'](_0xf1be('0x56'))){_0x1ef36d[_0xf1be('0x1d')]=qs[_0xf1be('0x1d')](_0x2c66c0['query'][_0xf1be('0x1d')]);_0x1ef36d[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x2c66c0[_0xf1be('0x34')][_0xf1be('0x1a')]);}return _0x5087fd['getAgents'](_0x1ef36d);}})[_0xf1be('0x23')](function(_0x34169d){if(_0x34169d){return _0x34169d?{'count':_0x51524b,'rows':_0x34169d}:null;}})[_0xf1be('0x23')](respondWithResult(_0x3511d6,null))['catch'](handleError(_0x3511d6,null));}; \ No newline at end of file +var _0x757f=['removeAgents','userOpenchannelQueue:remove','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','rows','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAndCountAll','UserId','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','nolimit','addTeams','ids','findAll','User','Agents','online','voicePause','sequelize','transaction','each','forEach','emit','removeTeams','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','SELECT','every','TeamId','includes','compact','value'];(function(_0x5a7c07,_0x47a76c){var _0xfc72b9=function(_0xb47a3e){while(--_0xb47a3e){_0x5a7c07['push'](_0x5a7c07['shift']());}};_0xfc72b9(++_0x47a76c);}(_0x757f,0x10b));var _0xf757=function(_0x21d0e6,_0x5a7aa6){_0x21d0e6=_0x21d0e6-0x0;var _0x1cc2d1=_0x757f[_0x21d0e6];return _0x1cc2d1;};'use strict';var emlformat=require(_0xf757('0x0'));var rimraf=require(_0xf757('0x1'));var zipdir=require(_0xf757('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf757('0x3'));var BPromise=require(_0xf757('0x4'));var Mustache=require(_0xf757('0x5'));var util=require('util');var path=require(_0xf757('0x6'));var sox=require(_0xf757('0x7'));var csv=require(_0xf757('0x8'));var ejs=require(_0xf757('0x9'));var fs=require('fs');var fs_extra=require(_0xf757('0xa'));var _=require(_0xf757('0xb'));var squel=require('squel');var crypto=require(_0xf757('0xc'));var jsforce=require(_0xf757('0xd'));var deskjs=require(_0xf757('0xe'));var toCsv=require(_0xf757('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf757('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf757('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf757('0x11'));var logger=require(_0xf757('0x12'))(_0xf757('0x13'));var utils=require('../../config/utils');var config=require(_0xf757('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf757('0x15'))['db'];config['redis']=_['defaults'](config[_0xf757('0x16')],{'host':_0xf757('0x17'),'port':0x18eb});var socket=require(_0xf757('0x18'))(new Redis(config[_0xf757('0x16')]));require('./openchannelQueue.socket')[_0xf757('0x19')](socket);function respondWithStatusCode(_0x2f05ae,_0x554f83){_0x554f83=_0x554f83||0xcc;return function(_0x19ba9d){if(_0x19ba9d){return _0x2f05ae[_0xf757('0x1a')](_0x554f83);}return _0x2f05ae[_0xf757('0x1b')](_0x554f83)['end']();};}function respondWithResult(_0x5ca1b1,_0x4183b4){_0x4183b4=_0x4183b4||0xc8;return function(_0x2ca867){if(_0x2ca867){return _0x5ca1b1['status'](_0x4183b4)[_0xf757('0x1c')](_0x2ca867);}};}function respondWithFilteredResult(_0x31fb6f,_0x36be5b){return function(_0x45361b){if(_0x45361b){var _0x351f53=typeof _0x36be5b[_0xf757('0x1d')]==='undefined'&&typeof _0x36be5b[_0xf757('0x1e')]===_0xf757('0x1f');var _0x29d76f=_0x45361b['count'];var _0x489024=_0x351f53?0x0:_0x36be5b[_0xf757('0x1d')];var _0x28fa0e=_0x351f53?_0x45361b[_0xf757('0x20')]:_0x36be5b[_0xf757('0x1d')]+_0x36be5b['limit'];var _0x115c96;if(_0x28fa0e>=_0x29d76f){_0x28fa0e=_0x29d76f;_0x115c96=0xc8;}else{_0x115c96=0xce;}_0x31fb6f[_0xf757('0x1b')](_0x115c96);return _0x31fb6f[_0xf757('0x21')](_0xf757('0x22'),_0x489024+'-'+_0x28fa0e+'/'+_0x29d76f)[_0xf757('0x1c')](_0x45361b);}return null;};}function patchUpdates(_0x15f5cf){return function(_0x36f509){try{jsonpatch[_0xf757('0x23')](_0x36f509,_0x15f5cf,!![]);}catch(_0x35a886){return BPromise[_0xf757('0x24')](_0x35a886);}return _0x36f509[_0xf757('0x25')]();};}function saveUpdates(_0x13b462,_0x2104c8){return function(_0x37e282){if(_0x37e282){return _0x37e282['update'](_0x13b462)[_0xf757('0x26')](function(_0x530dbc){return _0x530dbc;});}return null;};}function removeEntity(_0x3e61df,_0x4b1388){return function(_0x166d01){if(_0x166d01){return _0x166d01['destroy']()[_0xf757('0x26')](function(){var _0x5f475a=_0x166d01[_0xf757('0x27')]({'plain':!![]});var _0x185447='OpenchannelQueues';return db[_0xf757('0x28')]['destroy']({'where':{'type':_0x185447,'resourceId':_0x5f475a['id']}})[_0xf757('0x26')](function(){return _0x166d01;});})[_0xf757('0x26')](function(){_0x3e61df[_0xf757('0x1b')](0xcc)[_0xf757('0x29')]();});}};}function handleEntityNotFound(_0x26a193,_0x39e355){return function(_0x10d593){if(!_0x10d593){_0x26a193['sendStatus'](0x194);}return _0x10d593;};}function handleError(_0x3b1479,_0x4cec5e){_0x4cec5e=_0x4cec5e||0x1f4;return function(_0x27404a){logger[_0xf757('0x2a')](_0x27404a[_0xf757('0x2b')]);if(_0x27404a[_0xf757('0x2c')]){delete _0x27404a[_0xf757('0x2c')];}_0x3b1479['status'](_0x4cec5e)[_0xf757('0x2d')](_0x27404a);};}exports[_0xf757('0x2e')]=function(_0x2656c5,_0x335c44){var _0x14e5bb={},_0x5e18a9={},_0x6ddd4d={'count':0x0,'rows':[]};var _0x50d743=_[_0xf757('0x2f')](db[_0xf757('0x30')][_0xf757('0x31')],function(_0x127de4){return{'name':_0x127de4[_0xf757('0x32')],'type':_0x127de4[_0xf757('0x33')]['key']};});_0x5e18a9['model']=_['map'](_0x50d743,_0xf757('0x2c'));_0x5e18a9[_0xf757('0x34')]=_['keys'](_0x2656c5[_0xf757('0x34')]);_0x5e18a9[_0xf757('0x35')]=_[_0xf757('0x36')](_0x5e18a9['model'],_0x5e18a9[_0xf757('0x34')]);_0x14e5bb[_0xf757('0x37')]=_['intersection'](_0x5e18a9[_0xf757('0x38')],qs[_0xf757('0x39')](_0x2656c5[_0xf757('0x34')][_0xf757('0x39')]));_0x14e5bb['attributes']=_0x14e5bb[_0xf757('0x37')][_0xf757('0x3a')]?_0x14e5bb[_0xf757('0x37')]:_0x5e18a9[_0xf757('0x38')];if(!_0x2656c5[_0xf757('0x34')][_0xf757('0x3b')]('nolimit')){_0x14e5bb[_0xf757('0x1e')]=qs[_0xf757('0x1e')](_0x2656c5['query'][_0xf757('0x1e')]);_0x14e5bb[_0xf757('0x1d')]=qs[_0xf757('0x1d')](_0x2656c5[_0xf757('0x34')][_0xf757('0x1d')]);}_0x14e5bb[_0xf757('0x3c')]=qs[_0xf757('0x3d')](_0x2656c5[_0xf757('0x34')][_0xf757('0x3d')]);_0x14e5bb[_0xf757('0x3e')]=qs[_0xf757('0x35')](_[_0xf757('0x3f')](_0x2656c5[_0xf757('0x34')],_0x5e18a9['filters']),_0x50d743);if(_0x2656c5[_0xf757('0x34')][_0xf757('0x40')]){_0x14e5bb['where']=_[_0xf757('0x41')](_0x14e5bb[_0xf757('0x3e')],{'$or':_[_0xf757('0x2f')](_0x50d743,function(_0x5e0ad1){if(_0x5e0ad1['type']!=='VIRTUAL'){var _0x4e48af={};_0x4e48af[_0x5e0ad1[_0xf757('0x2c')]]={'$like':'%'+_0x2656c5[_0xf757('0x34')]['filter']+'%'};return _0x4e48af;}})});}_0x14e5bb=_[_0xf757('0x41')]({},_0x14e5bb,_0x2656c5[_0xf757('0x42')]);var _0x9aec5e={'where':_0x14e5bb[_0xf757('0x3e')]};return db['OpenchannelQueue'][_0xf757('0x20')](_0x9aec5e)[_0xf757('0x26')](function(_0x36d3d6){_0x6ddd4d[_0xf757('0x20')]=_0x36d3d6;if(_0x2656c5[_0xf757('0x34')][_0xf757('0x43')]){_0x14e5bb['include']=[{'all':!![]}];}return db[_0xf757('0x30')]['findAll'](_0x14e5bb);})['then'](function(_0x13a096){_0x6ddd4d[_0xf757('0x44')]=_0x13a096;return _0x6ddd4d;})[_0xf757('0x26')](respondWithFilteredResult(_0x335c44,_0x14e5bb))['catch'](handleError(_0x335c44,null));};exports['show']=function(_0x2b4370,_0x1d7d0b){var _0x30e78d={'raw':!![],'where':{'id':_0x2b4370[_0xf757('0x45')]['id']}},_0x1dcfef={};_0x1dcfef[_0xf757('0x38')]=_[_0xf757('0x46')](db[_0xf757('0x30')][_0xf757('0x31')]);_0x1dcfef['query']=_[_0xf757('0x46')](_0x2b4370[_0xf757('0x34')]);_0x1dcfef['filters']=_[_0xf757('0x36')](_0x1dcfef[_0xf757('0x38')],_0x1dcfef['query']);_0x30e78d[_0xf757('0x37')]=_[_0xf757('0x36')](_0x1dcfef[_0xf757('0x38')],qs[_0xf757('0x39')](_0x2b4370['query']['fields']));_0x30e78d[_0xf757('0x37')]=_0x30e78d[_0xf757('0x37')][_0xf757('0x3a')]?_0x30e78d[_0xf757('0x37')]:_0x1dcfef[_0xf757('0x38')];if(_0x2b4370[_0xf757('0x34')][_0xf757('0x43')]){_0x30e78d['include']=[{'all':!![]}];}_0x30e78d=_[_0xf757('0x41')]({},_0x30e78d,_0x2b4370[_0xf757('0x42')]);return db[_0xf757('0x30')][_0xf757('0x47')](_0x30e78d)[_0xf757('0x26')](handleEntityNotFound(_0x1d7d0b,null))[_0xf757('0x26')](respondWithResult(_0x1d7d0b,null))[_0xf757('0x48')](handleError(_0x1d7d0b,null));};exports['create']=function(_0x566fac,_0x2fc964){return db[_0xf757('0x30')][_0xf757('0x49')](_0x566fac[_0xf757('0x4a')],{})[_0xf757('0x26')](function(_0x9f3b48){var _0x2a572c=_0x566fac['user'][_0xf757('0x27')]({'plain':!![]});if(!_0x2a572c)throw new Error(_0xf757('0x4b'));if(_0x2a572c[_0xf757('0x4c')]===_0xf757('0x4d')){var _0x32658c=_0x9f3b48['get']({'plain':!![]});var _0x257247=_0xf757('0x4e');return db[_0xf757('0x4f')]['find']({'where':{'name':_0x257247,'userProfileId':_0x2a572c[_0xf757('0x50')]},'raw':!![]})['then'](function(_0x288c82){if(_0x288c82&&_0x288c82[_0xf757('0x51')]===0x0){return db[_0xf757('0x28')]['create']({'name':_0x32658c[_0xf757('0x2c')],'resourceId':_0x32658c['id'],'type':_0x288c82[_0xf757('0x2c')],'sectionId':_0x288c82['id']},{})['then'](function(){return _0x9f3b48;});}else{return _0x9f3b48;}})[_0xf757('0x48')](function(_0x3dfdf4){logger['error'](_0xf757('0x52'),_0x3dfdf4);throw _0x3dfdf4;});}return _0x9f3b48;})['then'](respondWithResult(_0x2fc964,0xc9))[_0xf757('0x48')](handleError(_0x2fc964,null));};exports['update']=function(_0x3363af,_0x3925f3){if(_0x3363af['body']['id']){delete _0x3363af[_0xf757('0x4a')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x3363af[_0xf757('0x45')]['id']}})[_0xf757('0x26')](handleEntityNotFound(_0x3925f3,null))[_0xf757('0x26')](saveUpdates(_0x3363af[_0xf757('0x4a')],null))[_0xf757('0x26')](respondWithResult(_0x3925f3,null))[_0xf757('0x48')](handleError(_0x3925f3,null));};exports['destroy']=function(_0x163f7c,_0xa2ecf1){return db[_0xf757('0x30')][_0xf757('0x47')]({'where':{'id':_0x163f7c['params']['id']}})[_0xf757('0x26')](handleEntityNotFound(_0xa2ecf1,null))[_0xf757('0x26')](removeEntity(_0xa2ecf1,null))[_0xf757('0x48')](handleError(_0xa2ecf1,null));};exports[_0xf757('0x53')]=function(_0x409295,_0x3948c9){return db['OpenchannelQueue'][_0xf757('0x53')]()[_0xf757('0x26')](respondWithResult(_0x3948c9,null))[_0xf757('0x48')](handleError(_0x3948c9,null));};exports['getMembers']=function(_0x19f7bd,_0xd37fc9,_0x54e938){var _0x38abb8={'raw':!![],'where':{}},_0xe307ac={},_0x3d1a8c;return db[_0xf757('0x30')][_0xf757('0x54')]({'where':{'id':_0x19f7bd[_0xf757('0x45')]['id']}})[_0xf757('0x26')](handleEntityNotFound(_0xd37fc9,null))[_0xf757('0x26')](function(_0xecdde8){if(_0xecdde8){_0x3d1a8c=_0xecdde8['get']({'plain':!![]});_0xe307ac[_0xf757('0x38')]=_['keys'](db[_0xf757('0x55')][_0xf757('0x31')]);_0xe307ac['query']=_[_0xf757('0x46')](_0x19f7bd[_0xf757('0x34')]);_0xe307ac[_0xf757('0x35')]=_[_0xf757('0x36')](_0xe307ac[_0xf757('0x38')],_0xe307ac[_0xf757('0x34')]);_0x38abb8[_0xf757('0x37')]=_[_0xf757('0x36')](_0xe307ac[_0xf757('0x38')],qs[_0xf757('0x39')](_0x19f7bd[_0xf757('0x34')][_0xf757('0x39')]));_0x38abb8[_0xf757('0x37')]=_0x38abb8['attributes'][_0xf757('0x3a')]?_0x38abb8[_0xf757('0x37')]:_0xe307ac[_0xf757('0x38')];if(!_0x19f7bd[_0xf757('0x34')]['hasOwnProperty']('nolimit')){_0x38abb8[_0xf757('0x1e')]=qs[_0xf757('0x1e')](_0x19f7bd[_0xf757('0x34')]['limit']);_0x38abb8[_0xf757('0x1d')]=qs[_0xf757('0x1d')](_0x19f7bd[_0xf757('0x34')]['offset']);}_0x38abb8['order']=qs['sort'](_0x19f7bd['query'][_0xf757('0x3d')]);_0x38abb8['where']=qs[_0xf757('0x35')](_[_0xf757('0x3f')](_0x19f7bd['query'],_0xe307ac[_0xf757('0x35')]));_0x38abb8[_0xf757('0x3e')][_0xf757('0x56')]=_0xecdde8['id'];if(_0x19f7bd[_0xf757('0x34')][_0xf757('0x40')]){_0x38abb8[_0xf757('0x3e')]=_[_0xf757('0x41')](_0x38abb8[_0xf757('0x3e')],{'$or':_[_0xf757('0x2f')](_0x38abb8[_0xf757('0x37')],function(_0x38a4a5){var _0x360eeb={};_0x360eeb[_0x38a4a5]={'$like':'%'+_0x19f7bd[_0xf757('0x34')][_0xf757('0x40')]+'%'};return _0x360eeb;})});}_0x38abb8=_[_0xf757('0x41')]({},_0x38abb8,_0x19f7bd[_0xf757('0x42')]);return db[_0xf757('0x55')]['findAll'](_0x38abb8);}})['then'](function(_0x154d26){if(_0x154d26){return db['User'][_0xf757('0x57')]({'where':{'id':_[_0xf757('0x2f')](_0x154d26,_0xf757('0x58')),'role':'agent'},'attributes':['id',_0xf757('0x2c'),_0xf757('0x59'),_0xf757('0x5a'),'createdAt']});}})[_0xf757('0x26')](function(_0x39046e){if(_0x39046e){return{'count':_0x39046e[_0xf757('0x20')],'rows':_[_0xf757('0x2f')](_0x39046e['rows'],function(_0x54e1d4){return{'membername':_0x54e1d4[_0xf757('0x2c')],'UserId':_0x54e1d4['id'],'queue_name':_0x3d1a8c[_0xf757('0x2c')],'OpenchannelQueueId':_0x3d1a8c['id'],'interface':util[_0xf757('0x5b')](_0xf757('0x5c'),_0xf757('0x5d'),_0x54e1d4[_0xf757('0x2c')]),'penalty':0x0,'paused':_0x54e1d4[_0xf757('0x59')],'createdAt':_0x54e1d4[_0xf757('0x5e')],'updatedAt':_0x54e1d4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xd37fc9,_0x38abb8))[_0xf757('0x48')](handleError(_0xd37fc9,null));};exports[_0xf757('0x5f')]=function(_0x3950b3,_0x22ddc6,_0x265a27){var _0x3cb450={};var _0x382707={};var _0xd0d214;var _0x4f96fd;return db[_0xf757('0x30')][_0xf757('0x54')]({'where':{'id':_0x3950b3['params']['id']}})[_0xf757('0x26')](handleEntityNotFound(_0x22ddc6,null))[_0xf757('0x26')](function(_0x2b3b92){if(_0x2b3b92){_0xd0d214=_0x2b3b92;_0x382707[_0xf757('0x38')]=_[_0xf757('0x46')](db[_0xf757('0x60')][_0xf757('0x31')]);_0x382707[_0xf757('0x34')]=_[_0xf757('0x46')](_0x3950b3[_0xf757('0x34')]);_0x382707[_0xf757('0x35')]=_[_0xf757('0x36')](_0x382707['model'],_0x382707[_0xf757('0x34')]);_0x3cb450[_0xf757('0x37')]=_[_0xf757('0x36')](_0x382707[_0xf757('0x38')],qs[_0xf757('0x39')](_0x3950b3['query'][_0xf757('0x39')]));_0x3cb450[_0xf757('0x37')]=_0x3cb450['attributes'][_0xf757('0x3a')]?_0x3cb450[_0xf757('0x37')]:_0x382707[_0xf757('0x38')];_0x3cb450['order']=qs[_0xf757('0x3d')](_0x3950b3['query']['sort']);_0x3cb450[_0xf757('0x3e')]=qs['filters'](_['pick'](_0x3950b3['query'],_0x382707[_0xf757('0x35')]));if(_0x3950b3[_0xf757('0x34')][_0xf757('0x40')]){_0x3cb450['where']=_['merge'](_0x3cb450[_0xf757('0x3e')],{'$or':_['map'](_0x3cb450[_0xf757('0x37')],function(_0x4d4a82){var _0x2d7d3c={};_0x2d7d3c[_0x4d4a82]={'$like':'%'+_0x3950b3[_0xf757('0x34')]['filter']+'%'};return _0x2d7d3c;})});}_0x3cb450=_[_0xf757('0x41')]({},_0x3cb450,_0x3950b3[_0xf757('0x42')]);return _0xd0d214['getTeams'](_0x3cb450);}})['then'](function(_0x472672){if(_0x472672){_0x4f96fd=_0x472672[_0xf757('0x3a')];if(!_0x3950b3[_0xf757('0x34')][_0xf757('0x3b')](_0xf757('0x61'))){_0x3cb450[_0xf757('0x1e')]=qs['limit'](_0x3950b3[_0xf757('0x34')][_0xf757('0x1e')]);_0x3cb450[_0xf757('0x1d')]=qs[_0xf757('0x1d')](_0x3950b3['query'][_0xf757('0x1d')]);}return _0xd0d214[_0xf757('0x5f')](_0x3cb450);}})[_0xf757('0x26')](function(_0x3b19bc){if(_0x3b19bc){return _0x3b19bc?{'count':_0x4f96fd,'rows':_0x3b19bc}:null;}})[_0xf757('0x26')](respondWithResult(_0x22ddc6,null))[_0xf757('0x48')](handleError(_0x22ddc6,null));};exports[_0xf757('0x62')]=function(_0xfb3acd,_0x42d2c7,_0x597762){var _0x3587ae=_0xfb3acd['body'][_0xf757('0x63')];return db[_0xf757('0x60')][_0xf757('0x64')]({'where':{'id':_0x3587ae},'attributes':['id'],'include':[{'model':db[_0xf757('0x65')],'as':_0xf757('0x66'),'attributes':['id',_0xf757('0x2c'),_0xf757('0x67'),_0xf757('0x68'),'interface'],'raw':!![]}]})[_0xf757('0x26')](function(_0xe6e7e6){if(_0xe6e7e6){var _0x650fee=_['flatMap'](_0xe6e7e6,function(_0x2c8b43){var _0x37ff7d=_0x2c8b43[_0xf757('0x27')]({'plain':!![]});return _0x37ff7d['Agents'];});return db[_0xf757('0x30')][_0xf757('0x47')]({'where':{'id':_0xfb3acd[_0xf757('0x45')]['id']}})[_0xf757('0x26')](function(_0x3fd9e0){return db[_0xf757('0x69')][_0xf757('0x6a')](function(_0x5601a9){return _0x3fd9e0['addTeams'](_0x3587ae,{'transaction':_0x5601a9})[_0xf757('0x26')](function(){return BPromise[_0xf757('0x6b')](_0x650fee,function(_0x218c0a){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x218c0a['id'],'OpenchannelQueueId':_0xfb3acd['params']['id']},'transaction':_0x5601a9});});})[_0xf757('0x26')](function(){_0x650fee[_0xf757('0x6c')](function(_0x40b283){socket[_0xf757('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x40b283['id'],'OpenchannelQueueId':_0x3fd9e0['id']});});});});});}})[_0xf757('0x26')](respondWithStatusCode(_0x42d2c7,null))['catch'](handleError(_0x42d2c7,null));};exports[_0xf757('0x6e')]=function(_0x13a641,_0x926513,_0x1c9162){return db[_0xf757('0x60')][_0xf757('0x64')]({'where':{'id':_0x13a641[_0xf757('0x34')][_0xf757('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf757('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf757('0x26')](handleEntityNotFound(_0x926513,null))['then'](function(_0x807d23){var _0xc35e12=_['map'](_0x807d23,'id');var _0x15c360=[];var _0x5dbe89=[];var _0x14d1ff=squel['select']();_0x14d1ff['field']('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0xf757('0x6f')](_0xf757('0x70'),'ut',_0xf757('0x71'))[_0xf757('0x3e')](_0xf757('0x72'),_0x13a641[_0xf757('0x45')]['id']);for(var _0x26440f=0x0;_0x26440f<_0x807d23[_0xf757('0x3a')];_0x26440f+=0x1){let _0x52d52f=_0x807d23[_0x26440f];for(var _0x163e19=0x0;_0x163e19<_0x52d52f[_0xf757('0x66')][_0xf757('0x3a')];_0x163e19+=0x1){let _0x1550f9=_0x52d52f[_0xf757('0x66')][_0x163e19];var _0x427a25=_0x14d1ff[_0xf757('0x73')]();_0x427a25[_0xf757('0x3e')]('ut.UserId\x20=\x20?',_0x1550f9['id']);_0x5dbe89[_0xf757('0x74')](db['sequelize'][_0xf757('0x34')](_0x427a25['toString'](),{'type':db[_0xf757('0x69')]['QueryTypes'][_0xf757('0x75')]})[_0xf757('0x26')](function(_0x2eaa4c){if(_0x2eaa4c['length']===0x1){return _0x1550f9['id'];}else{var _0x55c021=_[_0xf757('0x76')](_[_0xf757('0x2f')](_0x2eaa4c,_0xf757('0x77')),function(_0x1059bc){return _[_0xf757('0x78')](_0xc35e12,_0x1059bc);});if(_0x55c021){return _0x1550f9['id'];}}}));}}return BPromise['all'](_0x5dbe89)[_0xf757('0x26')](function(_0x334db4){_0x15c360=_(_0x15c360)['union'](_0x334db4)[_0xf757('0x79')]()[_0xf757('0x7a')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x13a641['params']['id']}})[_0xf757('0x26')](function(_0x5c8960){return db['sequelize'][_0xf757('0x6a')](function(_0x4bae42){return _0x5c8960[_0xf757('0x6e')](_0x13a641[_0xf757('0x34')][_0xf757('0x63')],{'transaction':_0x4bae42})[_0xf757('0x26')](function(){if(!_['isEmpty'](_0x15c360)){return _0x5c8960[_0xf757('0x7b')](_0x15c360,{'transaction':_0x4bae42});}})[_0xf757('0x26')](function(){_0x15c360[_0xf757('0x6c')](function(_0x1a8f70){socket[_0xf757('0x6d')](_0xf757('0x7c'),{'UserId':_0x1a8f70,'OpenchannelQueueId':_0x5c8960['id']});});});});});});})[_0xf757('0x26')](respondWithStatusCode(_0x926513,null))[_0xf757('0x48')](handleError(_0x926513,null));};exports['addAgents']=function(_0x22d8cc,_0x2dafd9,_0x17bcf6){return db[_0xf757('0x30')][_0xf757('0x47')]({'where':{'id':_0x22d8cc[_0xf757('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dafd9,null))[_0xf757('0x26')](function(_0x19fdee){if(_0x19fdee){return _0x19fdee['addAgents'](_0x22d8cc[_0xf757('0x4a')]['ids'],_[_0xf757('0x7d')](_0x22d8cc[_0xf757('0x4a')],[_0xf757('0x63'),'id'])||{})[_0xf757('0x7e')](function(_0x4607cb){for(var _0x3b33b3=0x0;_0x3b33b3<_0x22d8cc[_0xf757('0x4a')][_0xf757('0x63')][_0xf757('0x3a')];_0x3b33b3+=0x1){socket[_0xf757('0x6d')](_0xf757('0x7f'),{'UserId':Number(_0x22d8cc[_0xf757('0x4a')]['ids'][_0x3b33b3]),'OpenchannelQueueId':Number(_0x22d8cc[_0xf757('0x45')]['id'])});}return _0x4607cb;});}})[_0xf757('0x26')](respondWithResult(_0x2dafd9,null))[_0xf757('0x48')](handleError(_0x2dafd9,null));};exports['removeAgents']=function(_0x2abaa8,_0x2534d6,_0x16a79d){return db[_0xf757('0x30')][_0xf757('0x47')]({'where':{'id':_0x2abaa8[_0xf757('0x45')]['id']}})['then'](handleEntityNotFound(_0x2534d6,null))[_0xf757('0x26')](function(_0x1ea5e1){if(_0x1ea5e1){return _0x1ea5e1[_0xf757('0x7b')](_0x2abaa8[_0xf757('0x34')][_0xf757('0x63')])[_0xf757('0x26')](function(){if(_[_0xf757('0x80')](_0x2abaa8[_0xf757('0x34')][_0xf757('0x63')])){for(var _0xe6ed64=0x0;_0xe6ed64<_0x2abaa8['query'][_0xf757('0x63')][_0xf757('0x3a')];_0xe6ed64+=0x1){socket['emit'](_0xf757('0x7c'),{'UserId':Number(_0x2abaa8[_0xf757('0x34')][_0xf757('0x63')][_0xe6ed64]),'OpenchannelQueueId':Number(_0x2abaa8['params']['id'])});}}else{socket[_0xf757('0x6d')](_0xf757('0x7c'),{'UserId':Number(_0x2abaa8[_0xf757('0x34')][_0xf757('0x63')]),'OpenchannelQueueId':Number(_0x2abaa8['params']['id'])});}});}})[_0xf757('0x26')](respondWithStatusCode(_0x2534d6,null))[_0xf757('0x48')](handleError(_0x2534d6,null));};exports[_0xf757('0x81')]=function(_0x1b60e0,_0x3a9088,_0x4e79e5){var _0x130725={};var _0x49b7a1={};var _0x4ee07a;var _0x1b769d;return db[_0xf757('0x30')][_0xf757('0x54')]({'where':{'id':_0x1b60e0[_0xf757('0x45')]['id']}})[_0xf757('0x26')](handleEntityNotFound(_0x3a9088,null))[_0xf757('0x26')](function(_0x125743){if(_0x125743){_0x4ee07a=_0x125743;_0x49b7a1[_0xf757('0x38')]=_[_0xf757('0x46')](db['User'][_0xf757('0x31')]);_0x49b7a1[_0xf757('0x34')]=_[_0xf757('0x46')](_0x1b60e0[_0xf757('0x34')]);_0x49b7a1[_0xf757('0x35')]=_[_0xf757('0x36')](_0x49b7a1[_0xf757('0x38')],_0x49b7a1[_0xf757('0x34')]);_0x130725[_0xf757('0x37')]=_[_0xf757('0x36')](_0x49b7a1[_0xf757('0x38')],qs[_0xf757('0x39')](_0x1b60e0[_0xf757('0x34')]['fields']));_0x130725[_0xf757('0x37')]=_0x130725[_0xf757('0x37')][_0xf757('0x3a')]?_0x130725['attributes']:_0x49b7a1[_0xf757('0x38')];_0x130725['order']=qs[_0xf757('0x3d')](_0x1b60e0[_0xf757('0x34')][_0xf757('0x3d')]);_0x130725[_0xf757('0x3e')]=qs[_0xf757('0x35')](_[_0xf757('0x3f')](_0x1b60e0[_0xf757('0x34')],_0x49b7a1[_0xf757('0x35')]));if(_0x1b60e0[_0xf757('0x34')][_0xf757('0x40')]){_0x130725['where']=_[_0xf757('0x41')](_0x130725['where'],{'$or':_[_0xf757('0x2f')](_0x130725[_0xf757('0x37')],function(_0x2b5506){var _0x5b1fb0={};_0x5b1fb0[_0x2b5506]={'$like':'%'+_0x1b60e0[_0xf757('0x34')]['filter']+'%'};return _0x5b1fb0;})});}_0x130725=_[_0xf757('0x41')]({},_0x130725,_0x1b60e0['options']);return _0x4ee07a[_0xf757('0x81')](_0x130725);}})[_0xf757('0x26')](function(_0x5d7028){if(_0x5d7028){_0x1b769d=_0x5d7028['length'];if(!_0x1b60e0[_0xf757('0x34')][_0xf757('0x3b')](_0xf757('0x61'))){_0x130725[_0xf757('0x1e')]=qs[_0xf757('0x1e')](_0x1b60e0[_0xf757('0x34')]['limit']);_0x130725[_0xf757('0x1d')]=qs[_0xf757('0x1d')](_0x1b60e0['query']['offset']);}return _0x4ee07a[_0xf757('0x81')](_0x130725);}})[_0xf757('0x26')](function(_0x251653){if(_0x251653){return _0x251653?{'count':_0x1b769d,'rows':_0x251653}:null;}})['then'](respondWithResult(_0x3a9088,null))[_0xf757('0x48')](handleError(_0x3a9088,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 24890ea..9e8a6cc 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 _0x629d=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','save','update'];(function(_0x26f400,_0x6fda82){var _0x331f57=function(_0x19556b){while(--_0x19556b){_0x26f400['push'](_0x26f400['shift']());}};_0x331f57(++_0x6fda82);}(_0x629d,0x140));var _0xd629=function(_0x197115,_0x14d69a){_0x197115=_0x197115-0x0;var _0x19d830=_0x629d[_0x197115];return _0x19d830;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xd629('0x0'))['db'][_0xd629('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd629('0x2'),'afterUpdate':_0xd629('0x3'),'afterDestroy':_0xd629('0x4')};function emitEvent(_0x1d20ff){return function(_0x1e436b,_0x17a7ee,_0x152c38){OpenchannelQueueEvents[_0xd629('0x5')](_0x1d20ff+':'+_0x1e436b['id'],_0x1e436b);OpenchannelQueueEvents[_0xd629('0x5')](_0x1d20ff,_0x1e436b);_0x152c38(null);};}for(var e in events){if(events[_0xd629('0x6')](e)){var event=events[e];OpenchannelQueue[_0xd629('0x7')](e,emitEvent(event));}}module[_0xd629('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xd883=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x206da2,_0x47ac76){var _0x4b8e38=function(_0xb2c4df){while(--_0xb2c4df){_0x206da2['push'](_0x206da2['shift']());}};_0x4b8e38(++_0x47ac76);}(_0xd883,0xb4));var _0x3d88=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xd883[_0x1928c9];return _0x51b5fb;};'use strict';var EventEmitter=require(_0x3d88('0x0'));var OpenchannelQueue=require(_0x3d88('0x1'))['db'][_0x3d88('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3d88('0x3')](0x0);var events={'afterCreate':_0x3d88('0x4'),'afterUpdate':'update','afterDestroy':_0x3d88('0x5')};function emitEvent(_0x4973d4){return function(_0x42acc1,_0x296f70,_0x39c268){OpenchannelQueueEvents[_0x3d88('0x6')](_0x4973d4+':'+_0x42acc1['id'],_0x42acc1);OpenchannelQueueEvents[_0x3d88('0x6')](_0x4973d4,_0x42acc1);_0x39c268(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x3d88('0x7')](e,emitEvent(event));}}module[_0x3d88('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 abdae9d..0cfa32d 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 _0x7305=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x416aa5,_0x51abb0){var _0x46779a=function(_0x21e1fa){while(--_0x21e1fa){_0x416aa5['push'](_0x416aa5['shift']());}};_0x46779a(++_0x51abb0);}(_0x7305,0x1e8));var _0x5730=function(_0x15065e,_0x108051){_0x15065e=_0x15065e-0x0;var _0x36f316=_0x7305[_0x15065e];return _0x36f316;};'use strict';var _=require(_0x5730('0x0'));var util=require(_0x5730('0x1'));var logger=require(_0x5730('0x2'))('api');var moment=require(_0x5730('0x3'));var BPromise=require(_0x5730('0x4'));var rp=require(_0x5730('0x5'));var fs=require('fs');var path=require(_0x5730('0x6'));var rimraf=require(_0x5730('0x7'));var config=require(_0x5730('0x8'));var attributes=require(_0x5730('0x9'));module[_0x5730('0xa')]=function(_0x2c87fe,_0x8330f6){return _0x2c87fe[_0x5730('0xb')](_0x5730('0xc'),attributes,{'tableName':_0x5730('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fa4=['bluebird','path','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','../../config/logger','moment'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x7fa4,0xcd));var _0x47fa=function(_0x466ace,_0x2baf83){_0x466ace=_0x466ace-0x0;var _0x1cfcc0=_0x7fa4[_0x466ace];return _0x1cfcc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x47fa('0x0'))('api');var moment=require(_0x47fa('0x1'));var BPromise=require(_0x47fa('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47fa('0x3'));var rimraf=require('rimraf');var config=require(_0x47fa('0x4'));var attributes=require(_0x47fa('0x5'));module['exports']=function(_0x429e86,_0x17cb10){return _0x429e86[_0x47fa('0x6')](_0x47fa('0x7'),attributes,{'tableName':_0x47fa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 3470db6..85a5911 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 _0xb598=['lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowOpenchannelQueue','OpenchannelQueue','find'];(function(_0x2584ab,_0x1ec43){var _0x1defda=function(_0x31ed7c){while(--_0x31ed7c){_0x2584ab['push'](_0x2584ab['shift']());}};_0x1defda(++_0x1ec43);}(_0xb598,0xaf));var _0x8b59=function(_0x5544b2,_0x43bd4f){_0x5544b2=_0x5544b2-0x0;var _0x12a193=_0xb598[_0x5544b2];return _0x12a193;};'use strict';var _=require(_0x8b59('0x0'));var util=require('util');var moment=require(_0x8b59('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b59('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b59('0x3'))(_0x8b59('0x4'));var config=require(_0x8b59('0x5'));var jayson=require(_0x8b59('0x6'));var client=jayson[_0x8b59('0x7')]['http']({'port':0x232a});config[_0x8b59('0x8')]=_['defaults'](config[_0x8b59('0x8')],{'host':_0x8b59('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b59('0x8')]));require('./openchannelQueue.socket')[_0x8b59('0xa')](socket);function respondWithRpcPromise(_0x33fde0,_0x5a2370,_0x13b808){return new BPromise(function(_0x4422e3,_0x59ed07){return client[_0x8b59('0xb')](_0x33fde0,_0x13b808)[_0x8b59('0xc')](function(_0x589dfe){logger[_0x8b59('0xd')](_0x8b59('0xe'),_0x5a2370,_0x8b59('0xf'));logger['debug'](_0x8b59('0x10'),_0x5a2370,_0x8b59('0xf'),JSON[_0x8b59('0x11')](_0x589dfe));if(_0x589dfe[_0x8b59('0x12')]){if(_0x589dfe[_0x8b59('0x12')]['code']===0x1f4){logger[_0x8b59('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x5a2370,_0x589dfe['error'][_0x8b59('0x13')]);return _0x59ed07(_0x589dfe['error']['message']);}logger['error'](_0x8b59('0xe'),_0x5a2370,_0x589dfe[_0x8b59('0x12')][_0x8b59('0x13')]);return _0x4422e3(_0x589dfe[_0x8b59('0x12')][_0x8b59('0x13')]);}else{logger[_0x8b59('0xd')](_0x8b59('0xe'),_0x5a2370,_0x8b59('0xf'));_0x4422e3(_0x589dfe[_0x8b59('0x14')][_0x8b59('0x13')]);}})[_0x8b59('0x15')](function(_0x54b243){logger[_0x8b59('0x12')](_0x8b59('0xe'),_0x5a2370,_0x54b243);_0x59ed07(_0x54b243);});});}exports[_0x8b59('0x16')]=function(_0x1ca34f){var _0x4029ba=this;return new Promise(function(_0x3829c9,_0x2802eb){return db['OpenchannelQueue']['findAll']({'raw':_0x1ca34f[_0x8b59('0x17')]?_0x1ca34f[_0x8b59('0x17')][_0x8b59('0x18')]===undefined?!![]:![]:!![],'where':_0x1ca34f[_0x8b59('0x17')]?_0x1ca34f[_0x8b59('0x17')][_0x8b59('0x19')]||null:null,'attributes':_0x1ca34f[_0x8b59('0x17')]?_0x1ca34f[_0x8b59('0x17')][_0x8b59('0x1a')]||null:null,'limit':_0x1ca34f[_0x8b59('0x17')]?_0x1ca34f[_0x8b59('0x17')][_0x8b59('0x1b')]||null:null,'include':_0x1ca34f[_0x8b59('0x17')]?_0x1ca34f['options'][_0x8b59('0x1c')]?_[_0x8b59('0x1d')](_0x1ca34f['options']['include'],function(_0x1d8128){return{'model':db[_0x1d8128[_0x8b59('0x1e')]],'as':_0x1d8128['as'],'attributes':_0x1d8128[_0x8b59('0x1a')],'include':_0x1d8128[_0x8b59('0x1c')]?_[_0x8b59('0x1d')](_0x1d8128[_0x8b59('0x1c')],function(_0x145a93){return{'model':db[_0x145a93[_0x8b59('0x1e')]],'as':_0x145a93['as'],'attributes':_0x145a93['attributes'],'include':_0x145a93[_0x8b59('0x1c')]?_[_0x8b59('0x1d')](_0x145a93[_0x8b59('0x1c')],function(_0x5bb64d){return{'model':db[_0x5bb64d['model']],'as':_0x5bb64d['as'],'attributes':_0x5bb64d[_0x8b59('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8b59('0xc')](function(_0x51bce2){logger[_0x8b59('0xd')](_0x8b59('0x16'),_0x1ca34f);logger[_0x8b59('0x1f')](_0x8b59('0x16'),_0x1ca34f,JSON[_0x8b59('0x11')](_0x51bce2));_0x3829c9(_0x51bce2);})[_0x8b59('0x15')](function(_0x3ad2ac){logger[_0x8b59('0x12')](_0x8b59('0x16'),_0x3ad2ac[_0x8b59('0x13')],_0x1ca34f);_0x2802eb(_0x4029ba[_0x8b59('0x12')](0x1f4,_0x3ad2ac['message']));});});};exports[_0x8b59('0x20')]=function(_0xe10bd0){var _0x460a27=this;return new Promise(function(_0x3e8f45,_0x4d8f5b){return db[_0x8b59('0x21')][_0x8b59('0x22')]({'raw':_0xe10bd0[_0x8b59('0x17')]?_0xe10bd0[_0x8b59('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe10bd0['options']?_0xe10bd0[_0x8b59('0x17')][_0x8b59('0x19')]||null:null,'attributes':_0xe10bd0[_0x8b59('0x17')]?_0xe10bd0[_0x8b59('0x17')][_0x8b59('0x1a')]||null:null,'include':_0xe10bd0[_0x8b59('0x17')]?_0xe10bd0[_0x8b59('0x17')][_0x8b59('0x1c')]?_[_0x8b59('0x1d')](_0xe10bd0['options']['include'],function(_0x3d11c3){return{'model':db[_0x3d11c3['model']],'as':_0x3d11c3['as'],'attributes':_0x3d11c3[_0x8b59('0x1a')],'include':_0x3d11c3[_0x8b59('0x1c')]?_['map'](_0x3d11c3[_0x8b59('0x1c')],function(_0x441b45){return{'model':db[_0x441b45[_0x8b59('0x1e')]],'as':_0x441b45['as'],'attributes':_0x441b45[_0x8b59('0x1a')],'include':_0x441b45[_0x8b59('0x1c')]?_[_0x8b59('0x1d')](_0x441b45[_0x8b59('0x1c')],function(_0x76dd1e){return{'model':db[_0x76dd1e[_0x8b59('0x1e')]],'as':_0x76dd1e['as'],'attributes':_0x76dd1e[_0x8b59('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8b59('0xc')](function(_0x1ffc0e){logger[_0x8b59('0xd')](_0x8b59('0x20'),_0xe10bd0);logger[_0x8b59('0x1f')](_0x8b59('0x20'),_0xe10bd0,JSON[_0x8b59('0x11')](_0x1ffc0e));_0x3e8f45(_0x1ffc0e);})[_0x8b59('0x15')](function(_0x3878f9){logger[_0x8b59('0x12')](_0x8b59('0x20'),_0x3878f9[_0x8b59('0x13')],_0xe10bd0);_0x4d8f5b(_0x460a27[_0x8b59('0x12')](0x1f4,_0x3878f9['message']));});});}; \ No newline at end of file +var _0xabcd=['debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','options','raw','where','attributes','limit','include','map','model','then','ShowOpenchannelQueue','OpenchannelQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3838a4,_0x2ae1e6){var _0x3c56b4=function(_0x4cbf64){while(--_0x4cbf64){_0x3838a4['push'](_0x3838a4['shift']());}};_0x3c56b4(++_0x2ae1e6);}(_0xabcd,0x143));var _0xdabc=function(_0x2ea3cf,_0x5a0d9e){_0x2ea3cf=_0x2ea3cf-0x0;var _0xd905e9=_0xabcd[_0x2ea3cf];return _0xd905e9;};'use strict';var _=require(_0xdabc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdabc('0x1'));var rs=require(_0xdabc('0x2'));var fs=require('fs');var Redis=require(_0xdabc('0x3'));var db=require(_0xdabc('0x4'))['db'];var utils=require(_0xdabc('0x5'));var logger=require(_0xdabc('0x6'))(_0xdabc('0x7'));var config=require('../../config/environment');var jayson=require(_0xdabc('0x8'));var client=jayson[_0xdabc('0x9')][_0xdabc('0xa')]({'port':0x232a});config[_0xdabc('0xb')]=_[_0xdabc('0xc')](config[_0xdabc('0xb')],{'host':_0xdabc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdabc('0xb')]));require('./openchannelQueue.socket')[_0xdabc('0xe')](socket);function respondWithRpcPromise(_0x2f7f05,_0x4830eb,_0xbd2f14){return new BPromise(function(_0x2ac594,_0x33f04a){return client[_0xdabc('0xf')](_0x2f7f05,_0xbd2f14)['then'](function(_0x4de267){logger[_0xdabc('0x10')](_0xdabc('0x11'),_0x4830eb,_0xdabc('0x12'));logger[_0xdabc('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4830eb,_0xdabc('0x12'),JSON[_0xdabc('0x14')](_0x4de267));if(_0x4de267[_0xdabc('0x15')]){if(_0x4de267[_0xdabc('0x15')][_0xdabc('0x16')]===0x1f4){logger[_0xdabc('0x15')](_0xdabc('0x11'),_0x4830eb,_0x4de267[_0xdabc('0x15')][_0xdabc('0x17')]);return _0x33f04a(_0x4de267[_0xdabc('0x15')][_0xdabc('0x17')]);}logger[_0xdabc('0x15')](_0xdabc('0x11'),_0x4830eb,_0x4de267[_0xdabc('0x15')][_0xdabc('0x17')]);return _0x2ac594(_0x4de267[_0xdabc('0x15')][_0xdabc('0x17')]);}else{logger[_0xdabc('0x10')](_0xdabc('0x11'),_0x4830eb,_0xdabc('0x12'));_0x2ac594(_0x4de267[_0xdabc('0x18')][_0xdabc('0x17')]);}})[_0xdabc('0x19')](function(_0xc2e45f){logger['error'](_0xdabc('0x11'),_0x4830eb,_0xc2e45f);_0x33f04a(_0xc2e45f);});});}exports[_0xdabc('0x1a')]=function(_0x14ac71){var _0x33af02=this;return new Promise(function(_0x4ca599,_0x3f6786){return db['OpenchannelQueue']['findAll']({'raw':_0x14ac71['options']?_0x14ac71[_0xdabc('0x1b')][_0xdabc('0x1c')]===undefined?!![]:![]:!![],'where':_0x14ac71[_0xdabc('0x1b')]?_0x14ac71[_0xdabc('0x1b')][_0xdabc('0x1d')]||null:null,'attributes':_0x14ac71[_0xdabc('0x1b')]?_0x14ac71[_0xdabc('0x1b')][_0xdabc('0x1e')]||null:null,'limit':_0x14ac71[_0xdabc('0x1b')]?_0x14ac71[_0xdabc('0x1b')][_0xdabc('0x1f')]||null:null,'include':_0x14ac71['options']?_0x14ac71[_0xdabc('0x1b')][_0xdabc('0x20')]?_[_0xdabc('0x21')](_0x14ac71['options'][_0xdabc('0x20')],function(_0x1482de){return{'model':db[_0x1482de[_0xdabc('0x22')]],'as':_0x1482de['as'],'attributes':_0x1482de['attributes'],'include':_0x1482de['include']?_[_0xdabc('0x21')](_0x1482de[_0xdabc('0x20')],function(_0x5d3049){return{'model':db[_0x5d3049[_0xdabc('0x22')]],'as':_0x5d3049['as'],'attributes':_0x5d3049['attributes'],'include':_0x5d3049[_0xdabc('0x20')]?_['map'](_0x5d3049[_0xdabc('0x20')],function(_0x4d4334){return{'model':db[_0x4d4334[_0xdabc('0x22')]],'as':_0x4d4334['as'],'attributes':_0x4d4334[_0xdabc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdabc('0x23')](function(_0x4af06b){logger[_0xdabc('0x10')](_0xdabc('0x1a'),_0x14ac71);logger[_0xdabc('0x13')](_0xdabc('0x1a'),_0x14ac71,JSON[_0xdabc('0x14')](_0x4af06b));_0x4ca599(_0x4af06b);})[_0xdabc('0x19')](function(_0x3d3ca4){logger[_0xdabc('0x15')](_0xdabc('0x1a'),_0x3d3ca4[_0xdabc('0x17')],_0x14ac71);_0x3f6786(_0x33af02['error'](0x1f4,_0x3d3ca4[_0xdabc('0x17')]));});});};exports[_0xdabc('0x24')]=function(_0xa21043){var _0x4aaf4d=this;return new Promise(function(_0x2eea7a,_0x5a154e){return db[_0xdabc('0x25')]['find']({'raw':_0xa21043[_0xdabc('0x1b')]?_0xa21043[_0xdabc('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xa21043['options']?_0xa21043[_0xdabc('0x1b')]['where']||null:null,'attributes':_0xa21043[_0xdabc('0x1b')]?_0xa21043['options'][_0xdabc('0x1e')]||null:null,'include':_0xa21043['options']?_0xa21043['options'][_0xdabc('0x20')]?_[_0xdabc('0x21')](_0xa21043[_0xdabc('0x1b')][_0xdabc('0x20')],function(_0x247b58){return{'model':db[_0x247b58[_0xdabc('0x22')]],'as':_0x247b58['as'],'attributes':_0x247b58['attributes'],'include':_0x247b58[_0xdabc('0x20')]?_['map'](_0x247b58[_0xdabc('0x20')],function(_0x5b6528){return{'model':db[_0x5b6528[_0xdabc('0x22')]],'as':_0x5b6528['as'],'attributes':_0x5b6528[_0xdabc('0x1e')],'include':_0x5b6528[_0xdabc('0x20')]?_[_0xdabc('0x21')](_0x5b6528[_0xdabc('0x20')],function(_0x43234a){return{'model':db[_0x43234a['model']],'as':_0x43234a['as'],'attributes':_0x43234a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdabc('0x23')](function(_0x5af3c6){logger['info'](_0xdabc('0x24'),_0xa21043);logger[_0xdabc('0x13')](_0xdabc('0x24'),_0xa21043,JSON[_0xdabc('0x14')](_0x5af3c6));_0x2eea7a(_0x5af3c6);})[_0xdabc('0x19')](function(_0x349436){logger[_0xdabc('0x15')](_0xdabc('0x24'),_0x349436[_0xdabc('0x17')],_0xa21043);_0x5a154e(_0x4aaf4d['error'](0x1f4,_0x349436['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index dad5beb..2f5336e 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 _0x9735=['register','length','./openchannelQueue.events','remove','update','removeListener'];(function(_0xb1937e,_0x330b2f){var _0x44474f=function(_0x4336e0){while(--_0x4336e0){_0xb1937e['push'](_0xb1937e['shift']());}};_0x44474f(++_0x330b2f);}(_0x9735,0x1be));var _0x5973=function(_0x5a8ee3,_0x3bfa19){_0x5a8ee3=_0x5a8ee3-0x0;var _0x5d789b=_0x9735[_0x5a8ee3];return _0x5d789b;};'use strict';var OpenchannelQueueEvents=require(_0x5973('0x0'));var events=['save',_0x5973('0x1'),_0x5973('0x2')];function createListener(_0x1741e2,_0x2a4772){return function(_0x25a0d5){_0x2a4772['emit'](_0x1741e2,_0x25a0d5);};}function removeListener(_0xa200ed,_0x4106f8){return function(){OpenchannelQueueEvents[_0x5973('0x3')](_0xa200ed,_0x4106f8);};}exports[_0x5973('0x4')]=function(_0x81c96a){for(var _0xd44e8b=0x0,_0x4b8398=events[_0x5973('0x5')];_0xd44e8b<_0x4b8398;_0xd44e8b++){var _0x4e9275=events[_0xd44e8b];var _0x5db6bf=createListener('openchannelQueue:'+_0x4e9275,_0x81c96a);OpenchannelQueueEvents['on'](_0x4e9275,_0x5db6bf);}}; \ No newline at end of file +var _0x1b89=['remove','update','register','length','./openchannelQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b89,0x70));var _0x91b8=function(_0x5e04b2,_0x43fb21){_0x5e04b2=_0x5e04b2-0x0;var _0xe90c3e=_0x1b89[_0x5e04b2];return _0xe90c3e;};'use strict';var OpenchannelQueueEvents=require(_0x91b8('0x0'));var events=[_0x91b8('0x1'),_0x91b8('0x2'),_0x91b8('0x3')];function createListener(_0x1a8469,_0x39f974){return function(_0x21787e){_0x39f974['emit'](_0x1a8469,_0x21787e);};}function removeListener(_0x7d2b08,_0x1b4d96){return function(){OpenchannelQueueEvents['removeListener'](_0x7d2b08,_0x1b4d96);};}exports[_0x91b8('0x4')]=function(_0xfb066b){for(var _0x276de9=0x0,_0x56f9bd=events[_0x91b8('0x5')];_0x276de9<_0x56f9bd;_0x276de9++){var _0x475965=events[_0x276de9];var _0x1772ab=createListener('openchannelQueue:'+_0x475965,_0xfb066b);OpenchannelQueueEvents['on'](_0x475965,_0x1772ab);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 0e7a934..10b211d 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 _0x20b5=['put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x20b5,0x138));var _0x520b=function(_0x5875ad,_0x3597b8){_0x5875ad=_0x5875ad-0x0;var _0x32a922=_0x20b5[_0x5875ad];return _0x32a922;};'use strict';var multer=require('multer');var util=require(_0x520b('0x0'));var path=require(_0x520b('0x1'));var timeout=require(_0x520b('0x2'));var express=require(_0x520b('0x3'));var router=express[_0x520b('0x4')]();var fs_extra=require(_0x520b('0x5'));var auth=require(_0x520b('0x6'));var interaction=require(_0x520b('0x7'));var config=require(_0x520b('0x8'));var controller=require(_0x520b('0x9'));router[_0x520b('0xa')]('/',auth[_0x520b('0xb')](),controller[_0x520b('0xc')]);router[_0x520b('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x520b('0xd')]);router[_0x520b('0xa')](_0x520b('0xe'),auth[_0x520b('0xb')](),controller[_0x520b('0xf')]);router[_0x520b('0x10')]('/',auth[_0x520b('0xb')](),controller[_0x520b('0x11')]);router[_0x520b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x520b('0x13')]);router[_0x520b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x520b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7c39=['get','/describe','describe','/:id','show','post','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index'];(function(_0x44ad9f,_0x12d27e){var _0x377430=function(_0x58473a){while(--_0x58473a){_0x44ad9f['push'](_0x44ad9f['shift']());}};_0x377430(++_0x12d27e);}(_0x7c39,0xc5));var _0x97c3=function(_0x604fc6,_0x35e640){_0x604fc6=_0x604fc6-0x0;var _0xdaa9ba=_0x7c39[_0x604fc6];return _0xdaa9ba;};'use strict';var multer=require(_0x97c3('0x0'));var util=require(_0x97c3('0x1'));var path=require(_0x97c3('0x2'));var timeout=require(_0x97c3('0x3'));var express=require(_0x97c3('0x4'));var router=express[_0x97c3('0x5')]();var fs_extra=require(_0x97c3('0x6'));var auth=require(_0x97c3('0x7'));var interaction=require(_0x97c3('0x8'));var config=require(_0x97c3('0x9'));var controller=require(_0x97c3('0xa'));router['get']('/',auth[_0x97c3('0xb')](),controller[_0x97c3('0xc')]);router[_0x97c3('0xd')](_0x97c3('0xe'),auth[_0x97c3('0xb')](),controller[_0x97c3('0xf')]);router['get'](_0x97c3('0x10'),auth['isAuthenticated'](),controller[_0x97c3('0x11')]);router[_0x97c3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x97c3('0x10'),auth[_0x97c3('0xb')](),controller[_0x97c3('0x13')]);router['delete']('/:id',auth[_0x97c3('0xb')](),controller['destroy']);module[_0x97c3('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 46aa8ac..d289c67 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 _0xcb14=['DATE','STRING','moment','sequelize','exports'];(function(_0x2ce715,_0x22e80c){var _0x41c7bb=function(_0x3b8b6c){while(--_0x3b8b6c){_0x2ce715['push'](_0x2ce715['shift']());}};_0x41c7bb(++_0x22e80c);}(_0xcb14,0x106));var _0x4cb1=function(_0x48c03c,_0x3a0d41){_0x48c03c=_0x48c03c-0x0;var _0x33b898=_0xcb14[_0x48c03c];return _0x33b898;};'use strict';var moment=require(_0x4cb1('0x0'));var Sequelize=require(_0x4cb1('0x1'));module[_0x4cb1('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4cb1('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4cb1('0x3')]},'exitAt':{'type':Sequelize[_0x4cb1('0x3')]},'reason':{'type':Sequelize[_0x4cb1('0x4')]}}; \ No newline at end of file +var _0xce21=['sequelize','STRING','DATE','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xce21,0x9f));var _0x1ce2=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0xce21[_0x2ef44b];return _0x2405b9;};'use strict';var moment=require(_0x1ce2('0x0'));var Sequelize=require(_0x1ce2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1ce2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1ce2('0x2')]},'joinAt':{'type':Sequelize[_0x1ce2('0x3')]},'leaveAt':{'type':Sequelize[_0x1ce2('0x3')]},'acceptAt':{'type':Sequelize[_0x1ce2('0x3')]},'exitAt':{'type':Sequelize[_0x1ce2('0x3')]},'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 b1ed7b1..95aa004 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 _0xa03c=['params','length','includeAll','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','OpenchannelQueueReport','findAll','rows','catch'];(function(_0x3b935b,_0x143d18){var _0xb9eaf9=function(_0x5e803d){while(--_0x5e803d){_0x3b935b['push'](_0x3b935b['shift']());}};_0xb9eaf9(++_0x143d18);}(_0xa03c,0x18a));var _0xca03=function(_0x21ce7a,_0x33bc32){_0x21ce7a=_0x21ce7a-0x0;var _0x222227=_0xa03c[_0x21ce7a];return _0x222227;};'use strict';var emlformat=require(_0xca03('0x0'));var rimraf=require(_0xca03('0x1'));var zipdir=require(_0xca03('0x2'));var jsonpatch=require(_0xca03('0x3'));var rp=require(_0xca03('0x4'));var moment=require('moment');var BPromise=require(_0xca03('0x5'));var Mustache=require(_0xca03('0x6'));var util=require('util');var path=require('path');var sox=require(_0xca03('0x7'));var csv=require(_0xca03('0x8'));var ejs=require(_0xca03('0x9'));var fs=require('fs');var fs_extra=require(_0xca03('0xa'));var _=require(_0xca03('0xb'));var squel=require(_0xca03('0xc'));var crypto=require(_0xca03('0xd'));var jsforce=require(_0xca03('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xca03('0x8'));var querystring=require(_0xca03('0xf'));var Papa=require(_0xca03('0x10'));var Redis=require(_0xca03('0x11'));var authService=require(_0xca03('0x12'));var qs=require(_0xca03('0x13'));var as=require(_0xca03('0x14'));var hardwareService=require(_0xca03('0x15'));var logger=require(_0xca03('0x16'))(_0xca03('0x17'));var utils=require('../../config/utils');var config=require(_0xca03('0x18'));var licenseUtil=require(_0xca03('0x19'));var db=require(_0xca03('0x1a'))['db'];function respondWithStatusCode(_0x6773d6,_0x16f11f){_0x16f11f=_0x16f11f||0xcc;return function(_0xdd28eb){if(_0xdd28eb){return _0x6773d6['sendStatus'](_0x16f11f);}return _0x6773d6[_0xca03('0x1b')](_0x16f11f)['end']();};}function respondWithResult(_0x15cf65,_0x3fbd2c){_0x3fbd2c=_0x3fbd2c||0xc8;return function(_0x580732){if(_0x580732){return _0x15cf65[_0xca03('0x1b')](_0x3fbd2c)[_0xca03('0x1c')](_0x580732);}};}function respondWithFilteredResult(_0x166a04,_0x245b97){return function(_0x2c4a87){if(_0x2c4a87){var _0x14f653=typeof _0x245b97[_0xca03('0x1d')]===_0xca03('0x1e')&&typeof _0x245b97[_0xca03('0x1f')]===_0xca03('0x1e');var _0x196bda=_0x2c4a87[_0xca03('0x20')];var _0x406eeb=_0x14f653?0x0:_0x245b97[_0xca03('0x1d')];var _0x32227d=_0x14f653?_0x2c4a87[_0xca03('0x20')]:_0x245b97['offset']+_0x245b97[_0xca03('0x1f')];var _0x2d01e8;if(_0x32227d>=_0x196bda){_0x32227d=_0x196bda;_0x2d01e8=0xc8;}else{_0x2d01e8=0xce;}_0x166a04[_0xca03('0x1b')](_0x2d01e8);return _0x166a04['set'](_0xca03('0x21'),_0x406eeb+'-'+_0x32227d+'/'+_0x196bda)[_0xca03('0x1c')](_0x2c4a87);}return null;};}function patchUpdates(_0x39e9e8){return function(_0x18c873){try{jsonpatch['apply'](_0x18c873,_0x39e9e8,!![]);}catch(_0x573db1){return BPromise[_0xca03('0x22')](_0x573db1);}return _0x18c873['save']();};}function saveUpdates(_0x3cd647,_0x212940){return function(_0x94b91a){if(_0x94b91a){return _0x94b91a['update'](_0x3cd647)[_0xca03('0x23')](function(_0x49b137){return _0x49b137;});}return null;};}function removeEntity(_0x917008,_0x1bb09a){return function(_0x3b5557){if(_0x3b5557){return _0x3b5557[_0xca03('0x24')]()[_0xca03('0x23')](function(){_0x917008[_0xca03('0x1b')](0xcc)[_0xca03('0x25')]();});}};}function handleEntityNotFound(_0x500cad,_0x52023f){return function(_0x398253){if(!_0x398253){_0x500cad[_0xca03('0x26')](0x194);}return _0x398253;};}function handleError(_0x7a2517,_0x57d2b4){_0x57d2b4=_0x57d2b4||0x1f4;return function(_0xf83a8){logger['error'](_0xf83a8[_0xca03('0x27')]);if(_0xf83a8[_0xca03('0x28')]){delete _0xf83a8[_0xca03('0x28')];}_0x7a2517['status'](_0x57d2b4)[_0xca03('0x29')](_0xf83a8);};}exports[_0xca03('0x2a')]=function(_0x57258e,_0x372383){var _0x294c25={},_0x270c6a={},_0x1f9cd6={'count':0x0,'rows':[]};var _0x244271=_[_0xca03('0x2b')](db['OpenchannelQueueReport'][_0xca03('0x2c')],function(_0x2611b7){return{'name':_0x2611b7[_0xca03('0x2d')],'type':_0x2611b7[_0xca03('0x2e')][_0xca03('0x2f')]};});_0x270c6a[_0xca03('0x30')]=_[_0xca03('0x2b')](_0x244271,'name');_0x270c6a[_0xca03('0x31')]=_[_0xca03('0x32')](_0x57258e[_0xca03('0x31')]);_0x270c6a[_0xca03('0x33')]=_[_0xca03('0x34')](_0x270c6a[_0xca03('0x30')],_0x270c6a[_0xca03('0x31')]);_0x294c25[_0xca03('0x35')]=_['intersection'](_0x270c6a[_0xca03('0x30')],qs[_0xca03('0x36')](_0x57258e[_0xca03('0x31')]['fields']));_0x294c25[_0xca03('0x35')]=_0x294c25[_0xca03('0x35')]['length']?_0x294c25[_0xca03('0x35')]:_0x270c6a[_0xca03('0x30')];if(!_0x57258e['query']['hasOwnProperty'](_0xca03('0x37'))){_0x294c25[_0xca03('0x1f')]=qs[_0xca03('0x1f')](_0x57258e['query']['limit']);_0x294c25[_0xca03('0x1d')]=qs[_0xca03('0x1d')](_0x57258e[_0xca03('0x31')][_0xca03('0x1d')]);}_0x294c25[_0xca03('0x38')]=qs['sort'](_0x57258e[_0xca03('0x31')][_0xca03('0x39')]);_0x294c25['where']=qs['filters'](_[_0xca03('0x3a')](_0x57258e['query'],_0x270c6a[_0xca03('0x33')]),_0x244271);if(_0x57258e[_0xca03('0x31')][_0xca03('0x3b')]){_0x294c25[_0xca03('0x3c')]=_['merge'](_0x294c25[_0xca03('0x3c')],{'$or':_['map'](_0x244271,function(_0x5eada9){if(_0x5eada9['type']!==_0xca03('0x3d')){var _0x1d442b={};_0x1d442b[_0x5eada9[_0xca03('0x28')]]={'$like':'%'+_0x57258e[_0xca03('0x31')][_0xca03('0x3b')]+'%'};return _0x1d442b;}})});}_0x294c25=_[_0xca03('0x3e')]({},_0x294c25,_0x57258e['options']);var _0x59541d={'where':_0x294c25[_0xca03('0x3c')]};return db['OpenchannelQueueReport'][_0xca03('0x20')](_0x59541d)[_0xca03('0x23')](function(_0x1b6c94){_0x1f9cd6[_0xca03('0x20')]=_0x1b6c94;if(_0x57258e[_0xca03('0x31')]['includeAll']){_0x294c25[_0xca03('0x3f')]=[{'all':!![]}];}return db[_0xca03('0x40')][_0xca03('0x41')](_0x294c25);})[_0xca03('0x23')](function(_0x12730c){_0x1f9cd6[_0xca03('0x42')]=_0x12730c;return _0x1f9cd6;})[_0xca03('0x23')](respondWithFilteredResult(_0x372383,_0x294c25))[_0xca03('0x43')](handleError(_0x372383,null));};exports['show']=function(_0x25c67a,_0x418015){var _0x5b427b={'raw':!![],'where':{'id':_0x25c67a[_0xca03('0x44')]['id']}},_0x4ccf19={};_0x4ccf19['model']=_[_0xca03('0x32')](db[_0xca03('0x40')][_0xca03('0x2c')]);_0x4ccf19[_0xca03('0x31')]=_[_0xca03('0x32')](_0x25c67a[_0xca03('0x31')]);_0x4ccf19[_0xca03('0x33')]=_[_0xca03('0x34')](_0x4ccf19[_0xca03('0x30')],_0x4ccf19['query']);_0x5b427b['attributes']=_[_0xca03('0x34')](_0x4ccf19[_0xca03('0x30')],qs['fields'](_0x25c67a[_0xca03('0x31')][_0xca03('0x36')]));_0x5b427b[_0xca03('0x35')]=_0x5b427b['attributes'][_0xca03('0x45')]?_0x5b427b[_0xca03('0x35')]:_0x4ccf19[_0xca03('0x30')];if(_0x25c67a[_0xca03('0x31')][_0xca03('0x46')]){_0x5b427b['include']=[{'all':!![]}];}_0x5b427b=_[_0xca03('0x3e')]({},_0x5b427b,_0x25c67a[_0xca03('0x47')]);return db[_0xca03('0x40')][_0xca03('0x48')](_0x5b427b)[_0xca03('0x23')](handleEntityNotFound(_0x418015,null))[_0xca03('0x23')](respondWithResult(_0x418015,null))[_0xca03('0x43')](handleError(_0x418015,null));};exports['create']=function(_0x4fd10b,_0x431e8d){return db[_0xca03('0x40')][_0xca03('0x49')](_0x4fd10b[_0xca03('0x4a')],{})[_0xca03('0x23')](respondWithResult(_0x431e8d,0xc9))[_0xca03('0x43')](handleError(_0x431e8d,null));};exports[_0xca03('0x4b')]=function(_0x243a89,_0x53a024){if(_0x243a89['body']['id']){delete _0x243a89['body']['id'];}return db[_0xca03('0x40')]['find']({'where':{'id':_0x243a89['params']['id']}})[_0xca03('0x23')](handleEntityNotFound(_0x53a024,null))['then'](saveUpdates(_0x243a89[_0xca03('0x4a')],null))['then'](respondWithResult(_0x53a024,null))[_0xca03('0x43')](handleError(_0x53a024,null));};exports[_0xca03('0x24')]=function(_0x3daf4c,_0x4a54ba){return db[_0xca03('0x40')][_0xca03('0x48')]({'where':{'id':_0x3daf4c['params']['id']}})[_0xca03('0x23')](handleEntityNotFound(_0x4a54ba,null))[_0xca03('0x23')](removeEntity(_0x4a54ba,null))[_0xca03('0x43')](handleError(_0x4a54ba,null));};exports[_0xca03('0x4c')]=function(_0x17b92,_0x6bd12a){return db[_0xca03('0x40')][_0xca03('0x4c')]()['then'](respondWithResult(_0x6bd12a,null))[_0xca03('0x43')](handleError(_0x6bd12a,null));}; \ No newline at end of file +var _0xc480=['name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x3d7fa5,_0x49ce57){var _0x30fceb=function(_0x569654){while(--_0x569654){_0x3d7fa5['push'](_0x3d7fa5['shift']());}};_0x30fceb(++_0x49ce57);}(_0xc480,0xb3));var _0x0c48=function(_0x3ae5bd,_0xcd5169){_0x3ae5bd=_0x3ae5bd-0x0;var _0x1ae658=_0xc480[_0x3ae5bd];return _0x1ae658;};'use strict';var emlformat=require(_0x0c48('0x0'));var rimraf=require(_0x0c48('0x1'));var zipdir=require(_0x0c48('0x2'));var jsonpatch=require(_0x0c48('0x3'));var rp=require(_0x0c48('0x4'));var moment=require(_0x0c48('0x5'));var BPromise=require(_0x0c48('0x6'));var Mustache=require(_0x0c48('0x7'));var util=require(_0x0c48('0x8'));var path=require(_0x0c48('0x9'));var sox=require(_0x0c48('0xa'));var csv=require(_0x0c48('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c48('0xc'));var _=require('lodash');var squel=require(_0x0c48('0xd'));var crypto=require(_0x0c48('0xe'));var jsforce=require(_0x0c48('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0c48('0x10'));var Papa=require(_0x0c48('0x11'));var Redis=require(_0x0c48('0x12'));var authService=require(_0x0c48('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c48('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0c48('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0c48('0x16'));var db=require(_0x0c48('0x17'))['db'];function respondWithStatusCode(_0x3d65a4,_0x269b99){_0x269b99=_0x269b99||0xcc;return function(_0x796cf9){if(_0x796cf9){return _0x3d65a4[_0x0c48('0x18')](_0x269b99);}return _0x3d65a4[_0x0c48('0x19')](_0x269b99)[_0x0c48('0x1a')]();};}function respondWithResult(_0x77c921,_0x718f65){_0x718f65=_0x718f65||0xc8;return function(_0x4b3532){if(_0x4b3532){return _0x77c921[_0x0c48('0x19')](_0x718f65)[_0x0c48('0x1b')](_0x4b3532);}};}function respondWithFilteredResult(_0x5031d4,_0x323cec){return function(_0x2b536){if(_0x2b536){var _0x510e08=typeof _0x323cec[_0x0c48('0x1c')]===_0x0c48('0x1d')&&typeof _0x323cec[_0x0c48('0x1e')]==='undefined';var _0x43c03d=_0x2b536['count'];var _0x431568=_0x510e08?0x0:_0x323cec[_0x0c48('0x1c')];var _0x1b8260=_0x510e08?_0x2b536[_0x0c48('0x1f')]:_0x323cec[_0x0c48('0x1c')]+_0x323cec[_0x0c48('0x1e')];var _0x1f8d71;if(_0x1b8260>=_0x43c03d){_0x1b8260=_0x43c03d;_0x1f8d71=0xc8;}else{_0x1f8d71=0xce;}_0x5031d4[_0x0c48('0x19')](_0x1f8d71);return _0x5031d4['set'](_0x0c48('0x20'),_0x431568+'-'+_0x1b8260+'/'+_0x43c03d)['json'](_0x2b536);}return null;};}function patchUpdates(_0x518083){return function(_0xac3ee5){try{jsonpatch['apply'](_0xac3ee5,_0x518083,!![]);}catch(_0x5a1ef5){return BPromise[_0x0c48('0x21')](_0x5a1ef5);}return _0xac3ee5[_0x0c48('0x22')]();};}function saveUpdates(_0x2a6dbb,_0x35adf7){return function(_0x8ebffb){if(_0x8ebffb){return _0x8ebffb[_0x0c48('0x23')](_0x2a6dbb)[_0x0c48('0x24')](function(_0x61a2a){return _0x61a2a;});}return null;};}function removeEntity(_0x2e6f7c,_0x2b5fc3){return function(_0x28180d){if(_0x28180d){return _0x28180d[_0x0c48('0x25')]()['then'](function(){_0x2e6f7c[_0x0c48('0x19')](0xcc)[_0x0c48('0x1a')]();});}};}function handleEntityNotFound(_0x4a1117,_0x151c54){return function(_0x6f6add){if(!_0x6f6add){_0x4a1117['sendStatus'](0x194);}return _0x6f6add;};}function handleError(_0x19c75b,_0x7156a2){_0x7156a2=_0x7156a2||0x1f4;return function(_0x2b4e11){logger[_0x0c48('0x26')](_0x2b4e11[_0x0c48('0x27')]);if(_0x2b4e11[_0x0c48('0x28')]){delete _0x2b4e11[_0x0c48('0x28')];}_0x19c75b[_0x0c48('0x19')](_0x7156a2)[_0x0c48('0x29')](_0x2b4e11);};}exports[_0x0c48('0x2a')]=function(_0x10c5a4,_0x1042aa){var _0x1c8b09={},_0x5de5b6={},_0x4e246d={'count':0x0,'rows':[]};var _0x236fd6=_[_0x0c48('0x2b')](db[_0x0c48('0x2c')][_0x0c48('0x2d')],function(_0x598dd3){return{'name':_0x598dd3[_0x0c48('0x2e')],'type':_0x598dd3[_0x0c48('0x2f')][_0x0c48('0x30')]};});_0x5de5b6[_0x0c48('0x31')]=_[_0x0c48('0x2b')](_0x236fd6,_0x0c48('0x28'));_0x5de5b6[_0x0c48('0x32')]=_[_0x0c48('0x33')](_0x10c5a4[_0x0c48('0x32')]);_0x5de5b6['filters']=_[_0x0c48('0x34')](_0x5de5b6[_0x0c48('0x31')],_0x5de5b6[_0x0c48('0x32')]);_0x1c8b09['attributes']=_[_0x0c48('0x34')](_0x5de5b6[_0x0c48('0x31')],qs[_0x0c48('0x35')](_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x35')]));_0x1c8b09[_0x0c48('0x36')]=_0x1c8b09['attributes'][_0x0c48('0x37')]?_0x1c8b09[_0x0c48('0x36')]:_0x5de5b6[_0x0c48('0x31')];if(!_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x38')](_0x0c48('0x39'))){_0x1c8b09['limit']=qs['limit'](_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x1e')]);_0x1c8b09[_0x0c48('0x1c')]=qs[_0x0c48('0x1c')](_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x1c')]);}_0x1c8b09['order']=qs[_0x0c48('0x3a')](_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x3a')]);_0x1c8b09['where']=qs['filters'](_[_0x0c48('0x3b')](_0x10c5a4['query'],_0x5de5b6['filters']),_0x236fd6);if(_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x3c')]){_0x1c8b09[_0x0c48('0x3d')]=_[_0x0c48('0x3e')](_0x1c8b09['where'],{'$or':_[_0x0c48('0x2b')](_0x236fd6,function(_0xa8434c){if(_0xa8434c[_0x0c48('0x2f')]!=='VIRTUAL'){var _0x3b00c1={};_0x3b00c1[_0xa8434c[_0x0c48('0x28')]]={'$like':'%'+_0x10c5a4[_0x0c48('0x32')][_0x0c48('0x3c')]+'%'};return _0x3b00c1;}})});}_0x1c8b09=_[_0x0c48('0x3e')]({},_0x1c8b09,_0x10c5a4[_0x0c48('0x3f')]);var _0xcc34e3={'where':_0x1c8b09[_0x0c48('0x3d')]};return db[_0x0c48('0x2c')][_0x0c48('0x1f')](_0xcc34e3)[_0x0c48('0x24')](function(_0x44b138){_0x4e246d[_0x0c48('0x1f')]=_0x44b138;if(_0x10c5a4[_0x0c48('0x32')]['includeAll']){_0x1c8b09[_0x0c48('0x40')]=[{'all':!![]}];}return db[_0x0c48('0x2c')][_0x0c48('0x41')](_0x1c8b09);})[_0x0c48('0x24')](function(_0x18dd91){_0x4e246d[_0x0c48('0x42')]=_0x18dd91;return _0x4e246d;})['then'](respondWithFilteredResult(_0x1042aa,_0x1c8b09))[_0x0c48('0x43')](handleError(_0x1042aa,null));};exports['show']=function(_0x5bb168,_0x143cb1){var _0x4c0b91={'raw':!![],'where':{'id':_0x5bb168['params']['id']}},_0x525512={};_0x525512[_0x0c48('0x31')]=_[_0x0c48('0x33')](db[_0x0c48('0x2c')][_0x0c48('0x2d')]);_0x525512[_0x0c48('0x32')]=_[_0x0c48('0x33')](_0x5bb168[_0x0c48('0x32')]);_0x525512['filters']=_[_0x0c48('0x34')](_0x525512[_0x0c48('0x31')],_0x525512['query']);_0x4c0b91[_0x0c48('0x36')]=_[_0x0c48('0x34')](_0x525512[_0x0c48('0x31')],qs[_0x0c48('0x35')](_0x5bb168['query']['fields']));_0x4c0b91['attributes']=_0x4c0b91[_0x0c48('0x36')][_0x0c48('0x37')]?_0x4c0b91[_0x0c48('0x36')]:_0x525512[_0x0c48('0x31')];if(_0x5bb168[_0x0c48('0x32')][_0x0c48('0x44')]){_0x4c0b91[_0x0c48('0x40')]=[{'all':!![]}];}_0x4c0b91=_['merge']({},_0x4c0b91,_0x5bb168['options']);return db[_0x0c48('0x2c')]['find'](_0x4c0b91)[_0x0c48('0x24')](handleEntityNotFound(_0x143cb1,null))['then'](respondWithResult(_0x143cb1,null))['catch'](handleError(_0x143cb1,null));};exports[_0x0c48('0x45')]=function(_0x54e7a3,_0xba51c6){return db[_0x0c48('0x2c')][_0x0c48('0x45')](_0x54e7a3['body'],{})[_0x0c48('0x24')](respondWithResult(_0xba51c6,0xc9))[_0x0c48('0x43')](handleError(_0xba51c6,null));};exports['update']=function(_0x565d3d,_0x4cf63e){if(_0x565d3d[_0x0c48('0x46')]['id']){delete _0x565d3d[_0x0c48('0x46')]['id'];}return db[_0x0c48('0x2c')]['find']({'where':{'id':_0x565d3d[_0x0c48('0x47')]['id']}})[_0x0c48('0x24')](handleEntityNotFound(_0x4cf63e,null))[_0x0c48('0x24')](saveUpdates(_0x565d3d['body'],null))[_0x0c48('0x24')](respondWithResult(_0x4cf63e,null))['catch'](handleError(_0x4cf63e,null));};exports[_0x0c48('0x25')]=function(_0xf085ee,_0x3d031b){return db['OpenchannelQueueReport']['find']({'where':{'id':_0xf085ee['params']['id']}})[_0x0c48('0x24')](handleEntityNotFound(_0x3d031b,null))[_0x0c48('0x24')](removeEntity(_0x3d031b,null))[_0x0c48('0x43')](handleError(_0x3d031b,null));};exports[_0x0c48('0x48')]=function(_0x28a47c,_0x50d57d){return db[_0x0c48('0x2c')][_0x0c48('0x48')]()[_0x0c48('0x24')](respondWithResult(_0x50d57d,null))['catch'](handleError(_0x50d57d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4f8e10c..05b9ec3 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x45e389,_0x1b0766){var _0x49bae5=function(_0x34ab37){while(--_0x34ab37){_0x45e389['push'](_0x45e389['shift']());}};_0x49bae5(++_0x1b0766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x5fc3[_0x51b1a5];return _0x15c738;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x46be3b,_0x59f8c5){var _0x2411b7=function(_0xb31bbd){while(--_0xb31bbd){_0x46be3b['push'](_0x46be3b['shift']());}};_0x2411b7(++_0x59f8c5);}(_0xe14b,0x93));var _0xbe14=function(_0x29fdd7,_0x851ec3){_0x29fdd7=_0x29fdd7-0x0;var _0x4f9bb8=_0xe14b[_0x29fdd7];return _0x4f9bb8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 885d22f..9880cbb 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 _0x26f9=['rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','options','CreateOpenchannelQueueReport','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x3db003,_0x416547){var _0x1e67cc=function(_0x5e07e5){while(--_0x5e07e5){_0x3db003['push'](_0x3db003['shift']());}};_0x1e67cc(++_0x416547);}(_0x26f9,0x16f));var _0x926f=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0x26f9[_0x533132];return _0x1a7447;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});}exports['CreateOpenchannelQueueReport']=function(_0x36ead3){var _0xab29b3=this;return new Promise(function(_0x4f25e3,_0x3ed07d){return db[_0x926f('0x16')][_0x926f('0x17')](_0x36ead3['body'],{'raw':_0x36ead3[_0x926f('0x18')]?_0x36ead3[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x926f('0xa')](function(_0x4241ac){logger['info'](_0x926f('0x19'),_0x36ead3);logger[_0x926f('0xd')](_0x926f('0x19'),_0x36ead3,JSON[_0x926f('0x10')](_0x4241ac));_0x4f25e3(_0x4241ac);})[_0x926f('0x15')](function(_0x3b7179){logger[_0x926f('0x11')](_0x926f('0x19'),_0x3b7179[_0x926f('0x13')],_0x36ead3);_0x3ed07d(_0xab29b3[_0x926f('0x11')](0x1f4,_0x3b7179[_0x926f('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2d76eb){var _0x151f71=this;return new Promise(function(_0x53f10c,_0x640fe0){return db[_0x926f('0x16')][_0x926f('0x1a')](_0x2d76eb[_0x926f('0x1b')],{'raw':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb['options'][_0x926f('0x1c')]||null:null,'attributes':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')][_0x926f('0x1d')]||null:null,'limit':_0x2d76eb['options']?_0x2d76eb[_0x926f('0x18')]['limit']||null:null})[_0x926f('0xa')](function(_0x2556ce){logger['info']('UpdateOpenchannelQueueReport',_0x2d76eb);logger[_0x926f('0xd')](_0x926f('0x1e'),_0x2d76eb,JSON['stringify'](_0x2556ce));_0x53f10c(_0x2556ce);})[_0x926f('0x15')](function(_0xb6b509){logger['error']('UpdateOpenchannelQueueReport',_0xb6b509[_0x926f('0x13')],_0x2d76eb);_0x640fe0(_0x151f71[_0x926f('0x11')](0x1f4,_0xb6b509[_0x926f('0x13')]));});});}; \ No newline at end of file +var _0xfff0=['../../config/environment','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','update','where','attributes','limit','info','UpdateOpenchannelQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x436a9b,_0xfe3d6f){var _0x2aecd2=function(_0x28c7e8){while(--_0x28c7e8){_0x436a9b['push'](_0x436a9b['shift']());}};_0x2aecd2(++_0xfe3d6f);}(_0xfff0,0x139));var _0x0fff=function(_0x3604c5,_0xd80c05){_0x3604c5=_0x3604c5-0x0;var _0x1a979f=_0xfff0[_0x3604c5];return _0x1a979f;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}exports['CreateOpenchannelQueueReport']=function(_0x48f36d){var _0x2337f=this;return new Promise(function(_0x606792,_0x46a02d){return db[_0x0fff('0x14')][_0x0fff('0x15')](_0x48f36d[_0x0fff('0x16')],{'raw':_0x48f36d['options']?_0x48f36d[_0x0fff('0x17')][_0x0fff('0x18')]===undefined?!![]:![]:!![]})[_0x0fff('0xa')](function(_0x49d211){logger['info'](_0x0fff('0x19'),_0x48f36d);logger[_0x0fff('0xd')](_0x0fff('0x19'),_0x48f36d,JSON[_0x0fff('0xf')](_0x49d211));_0x606792(_0x49d211);})['catch'](function(_0x155132){logger[_0x0fff('0x10')](_0x0fff('0x19'),_0x155132[_0x0fff('0x12')],_0x48f36d);_0x46a02d(_0x2337f[_0x0fff('0x10')](0x1f4,_0x155132[_0x0fff('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x6a116c){var _0x29f702=this;return new Promise(function(_0x37e090,_0x24cd18){return db[_0x0fff('0x14')][_0x0fff('0x1a')](_0x6a116c['body'],{'raw':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x1b')]||null:null,'attributes':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x1c')]||null:null,'limit':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x1d')]||null:null})['then'](function(_0x7046a3){logger[_0x0fff('0x1e')](_0x0fff('0x1f'),_0x6a116c);logger[_0x0fff('0xd')](_0x0fff('0x1f'),_0x6a116c,JSON[_0x0fff('0xf')](_0x7046a3));_0x37e090(_0x7046a3);})['catch'](function(_0x31f9a4){logger[_0x0fff('0x10')](_0x0fff('0x1f'),_0x31f9a4['message'],_0x6a116c);_0x24cd18(_0x29f702[_0x0fff('0x10')](0x1f4,_0x31f9a4[_0x0fff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index a46221a..2dbccf1 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 _0x2f0a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer'];(function(_0x1d5407,_0x10f1c4){var _0x1f0768=function(_0x24e19f){while(--_0x24e19f){_0x1d5407['push'](_0x1d5407['shift']());}};_0x1f0768(++_0x10f1c4);}(_0x2f0a,0x6d));var _0xa2f0=function(_0x3f27b3,_0x3140bb){_0x3f27b3=_0x3f27b3-0x0;var _0x23362c=_0x2f0a[_0x3f27b3];return _0x23362c;};'use strict';var multer=require(_0xa2f0('0x0'));var util=require(_0xa2f0('0x1'));var path=require(_0xa2f0('0x2'));var timeout=require(_0xa2f0('0x3'));var express=require(_0xa2f0('0x4'));var router=express[_0xa2f0('0x5')]();var fs_extra=require(_0xa2f0('0x6'));var auth=require(_0xa2f0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa2f0('0x8'));var controller=require(_0xa2f0('0x9'));router[_0xa2f0('0xa')]('/',auth[_0xa2f0('0xb')](),controller[_0xa2f0('0xc')]);router[_0xa2f0('0xa')](_0xa2f0('0xd'),auth[_0xa2f0('0xb')](),controller[_0xa2f0('0xe')]);router['get'](_0xa2f0('0xf'),auth[_0xa2f0('0xb')](),controller[_0xa2f0('0x10')]);router[_0xa2f0('0x11')]('/',auth[_0xa2f0('0xb')](),controller[_0xa2f0('0x12')]);router[_0xa2f0('0x13')](_0xa2f0('0xf'),auth[_0xa2f0('0xb')](),controller[_0xa2f0('0x14')]);router[_0xa2f0('0x15')](_0xa2f0('0xf'),auth[_0xa2f0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2e05=['create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x1ffd6d,_0x2dbada){var _0x58f2d5=function(_0x45a619){while(--_0x45a619){_0x1ffd6d['push'](_0x1ffd6d['shift']());}};_0x58f2d5(++_0x2dbada);}(_0x2e05,0x64));var _0x52e0=function(_0x329eb2,_0x18823e){_0x329eb2=_0x329eb2-0x0;var _0x46c655=_0x2e05[_0x329eb2];return _0x46c655;};'use strict';var multer=require(_0x52e0('0x0'));var util=require(_0x52e0('0x1'));var path=require(_0x52e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x52e0('0x3'));var router=express[_0x52e0('0x4')]();var fs_extra=require(_0x52e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x52e0('0x6'));var config=require('../../config/environment');var controller=require(_0x52e0('0x7'));router['get']('/',auth[_0x52e0('0x8')](),controller[_0x52e0('0x9')]);router['get'](_0x52e0('0xa'),auth['isAuthenticated'](),controller[_0x52e0('0xb')]);router['get'](_0x52e0('0xc'),auth[_0x52e0('0x8')](),controller['show']);router[_0x52e0('0xd')]('/',auth[_0x52e0('0x8')](),controller[_0x52e0('0xe')]);router[_0x52e0('0xf')](_0x52e0('0xc'),auth[_0x52e0('0x8')](),controller[_0x52e0('0x10')]);router[_0x52e0('0x11')]('/:id',auth[_0x52e0('0x8')](),controller['destroy']);module[_0x52e0('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 0750f45..bc79d6c 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x159773,_0x189cd2){var _0x3b9dba=function(_0x11f4e1){while(--_0x11f4e1){_0x159773['push'](_0x159773['shift']());}};_0x3b9dba(++_0x189cd2);}(_0x70e0,0x17b));var _0x070e=function(_0x18daad,_0x1e044a){_0x18daad=_0x18daad-0x0;var _0x1e4cb8=_0x70e0[_0x18daad];return _0x1e4cb8;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1a3e4d,_0x303b8e){var _0x51257b=function(_0x3da9d8){while(--_0x3da9d8){_0x1a3e4d['push'](_0x1a3e4d['shift']());}};_0x51257b(++_0x303b8e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ebacf93..cc909bd 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 _0xa50a=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','error','stack','name','send','OpenchannelTransferReport','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','params','rawAttributes','length','includeAll','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5eda7e,_0x55bddb){var _0x28a48c=function(_0x1d1e80){while(--_0x1d1e80){_0x5eda7e['push'](_0x5eda7e['shift']());}};_0x28a48c(++_0x55bddb);}(_0xa50a,0x1e5));var _0xaa50=function(_0x2bad21,_0x2e531a){_0x2bad21=_0x2bad21-0x0;var _0x3f923c=_0xa50a[_0x2bad21];return _0x3f923c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa50('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa50('0x1'));var rp=require(_0xaa50('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa50('0x3'));var util=require('util');var path=require(_0xaa50('0x4'));var sox=require(_0xaa50('0x5'));var csv=require(_0xaa50('0x6'));var ejs=require(_0xaa50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa50('0x8'));var squel=require(_0xaa50('0x9'));var crypto=require(_0xaa50('0xa'));var jsforce=require(_0xaa50('0xb'));var deskjs=require(_0xaa50('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaa50('0xd'));var Papa=require(_0xaa50('0xe'));var Redis=require(_0xaa50('0xf'));var authService=require(_0xaa50('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaa50('0x11'));var hardwareService=require(_0xaa50('0x12'));var logger=require(_0xaa50('0x13'))(_0xaa50('0x14'));var utils=require(_0xaa50('0x15'));var config=require(_0xaa50('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa50('0x17'))['db'];function respondWithStatusCode(_0x4215d2,_0x1e5a60){_0x1e5a60=_0x1e5a60||0xcc;return function(_0x50d740){if(_0x50d740){return _0x4215d2[_0xaa50('0x18')](_0x1e5a60);}return _0x4215d2[_0xaa50('0x19')](_0x1e5a60)[_0xaa50('0x1a')]();};}function respondWithResult(_0x265996,_0x51806d){_0x51806d=_0x51806d||0xc8;return function(_0x2de3ce){if(_0x2de3ce){return _0x265996[_0xaa50('0x19')](_0x51806d)['json'](_0x2de3ce);}};}function respondWithFilteredResult(_0xd2afa,_0x45fdf0){return function(_0x54dfe1){if(_0x54dfe1){var _0x2b10be=typeof _0x45fdf0[_0xaa50('0x1b')]===_0xaa50('0x1c')&&typeof _0x45fdf0[_0xaa50('0x1d')]===_0xaa50('0x1c');var _0xa9f6d2=_0x54dfe1[_0xaa50('0x1e')];var _0x5ae0e0=_0x2b10be?0x0:_0x45fdf0['offset'];var _0x5620fa=_0x2b10be?_0x54dfe1['count']:_0x45fdf0['offset']+_0x45fdf0[_0xaa50('0x1d')];var _0x1865c0;if(_0x5620fa>=_0xa9f6d2){_0x5620fa=_0xa9f6d2;_0x1865c0=0xc8;}else{_0x1865c0=0xce;}_0xd2afa[_0xaa50('0x19')](_0x1865c0);return _0xd2afa['set'](_0xaa50('0x1f'),_0x5ae0e0+'-'+_0x5620fa+'/'+_0xa9f6d2)[_0xaa50('0x20')](_0x54dfe1);}return null;};}function patchUpdates(_0x57d879){return function(_0x1360fb){try{jsonpatch[_0xaa50('0x21')](_0x1360fb,_0x57d879,!![]);}catch(_0x12edfb){return BPromise['reject'](_0x12edfb);}return _0x1360fb['save']();};}function saveUpdates(_0x5cd4b7,_0x3b916d){return function(_0x425c41){if(_0x425c41){return _0x425c41[_0xaa50('0x22')](_0x5cd4b7)[_0xaa50('0x23')](function(_0x3b4257){return _0x3b4257;});}return null;};}function removeEntity(_0x39223c,_0x545168){return function(_0x4d7470){if(_0x4d7470){return _0x4d7470[_0xaa50('0x24')]()[_0xaa50('0x23')](function(){_0x39223c[_0xaa50('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9864,_0x2bd3e9){return function(_0x231ad1){if(!_0x231ad1){_0x3f9864[_0xaa50('0x18')](0x194);}return _0x231ad1;};}function handleError(_0x493287,_0x3c8f69){_0x3c8f69=_0x3c8f69||0x1f4;return function(_0x4b472d){logger[_0xaa50('0x25')](_0x4b472d[_0xaa50('0x26')]);if(_0x4b472d[_0xaa50('0x27')]){delete _0x4b472d[_0xaa50('0x27')];}_0x493287[_0xaa50('0x19')](_0x3c8f69)[_0xaa50('0x28')](_0x4b472d);};}exports['index']=function(_0x4730a9,_0x17873f){var _0x44a375={},_0x201fd4={},_0x598afb={'count':0x0,'rows':[]};var _0x251c4c=_['map'](db[_0xaa50('0x29')]['rawAttributes'],function(_0x473980){return{'name':_0x473980[_0xaa50('0x2a')],'type':_0x473980[_0xaa50('0x2b')]['key']};});_0x201fd4[_0xaa50('0x2c')]=_[_0xaa50('0x2d')](_0x251c4c,'name');_0x201fd4[_0xaa50('0x2e')]=_[_0xaa50('0x2f')](_0x4730a9['query']);_0x201fd4[_0xaa50('0x30')]=_['intersection'](_0x201fd4[_0xaa50('0x2c')],_0x201fd4[_0xaa50('0x2e')]);_0x44a375['attributes']=_[_0xaa50('0x31')](_0x201fd4[_0xaa50('0x2c')],qs[_0xaa50('0x32')](_0x4730a9[_0xaa50('0x2e')]['fields']));_0x44a375[_0xaa50('0x33')]=_0x44a375[_0xaa50('0x33')]['length']?_0x44a375[_0xaa50('0x33')]:_0x201fd4[_0xaa50('0x2c')];if(!_0x4730a9['query'][_0xaa50('0x34')]('nolimit')){_0x44a375['limit']=qs[_0xaa50('0x1d')](_0x4730a9[_0xaa50('0x2e')][_0xaa50('0x1d')]);_0x44a375[_0xaa50('0x1b')]=qs['offset'](_0x4730a9[_0xaa50('0x2e')][_0xaa50('0x1b')]);}_0x44a375[_0xaa50('0x35')]=qs[_0xaa50('0x36')](_0x4730a9['query']['sort']);_0x44a375[_0xaa50('0x37')]=qs[_0xaa50('0x30')](_['pick'](_0x4730a9[_0xaa50('0x2e')],_0x201fd4[_0xaa50('0x30')]),_0x251c4c);if(_0x4730a9[_0xaa50('0x2e')][_0xaa50('0x38')]){_0x44a375['where']=_[_0xaa50('0x39')](_0x44a375['where'],{'$or':_[_0xaa50('0x2d')](_0x251c4c,function(_0x47ac97){if(_0x47ac97[_0xaa50('0x2b')]!==_0xaa50('0x3a')){var _0x241201={};_0x241201[_0x47ac97['name']]={'$like':'%'+_0x4730a9[_0xaa50('0x2e')][_0xaa50('0x38')]+'%'};return _0x241201;}})});}_0x44a375=_[_0xaa50('0x39')]({},_0x44a375,_0x4730a9[_0xaa50('0x3b')]);var _0x43c08f={'where':_0x44a375['where']};return db[_0xaa50('0x29')][_0xaa50('0x1e')](_0x43c08f)['then'](function(_0x575e02){_0x598afb[_0xaa50('0x1e')]=_0x575e02;if(_0x4730a9[_0xaa50('0x2e')]['includeAll']){_0x44a375[_0xaa50('0x3c')]=[{'all':!![]}];}return db[_0xaa50('0x29')][_0xaa50('0x3d')](_0x44a375);})[_0xaa50('0x23')](function(_0x45109f){_0x598afb[_0xaa50('0x3e')]=_0x45109f;return _0x598afb;})['then'](respondWithFilteredResult(_0x17873f,_0x44a375))['catch'](handleError(_0x17873f,null));};exports['show']=function(_0xe81786,_0x530dbd){var _0x3ba460={'raw':!![],'where':{'id':_0xe81786[_0xaa50('0x3f')]['id']}},_0x1b29e3={};_0x1b29e3[_0xaa50('0x2c')]=_[_0xaa50('0x2f')](db['OpenchannelTransferReport'][_0xaa50('0x40')]);_0x1b29e3[_0xaa50('0x2e')]=_[_0xaa50('0x2f')](_0xe81786[_0xaa50('0x2e')]);_0x1b29e3[_0xaa50('0x30')]=_[_0xaa50('0x31')](_0x1b29e3[_0xaa50('0x2c')],_0x1b29e3[_0xaa50('0x2e')]);_0x3ba460[_0xaa50('0x33')]=_[_0xaa50('0x31')](_0x1b29e3[_0xaa50('0x2c')],qs[_0xaa50('0x32')](_0xe81786[_0xaa50('0x2e')][_0xaa50('0x32')]));_0x3ba460['attributes']=_0x3ba460[_0xaa50('0x33')][_0xaa50('0x41')]?_0x3ba460[_0xaa50('0x33')]:_0x1b29e3[_0xaa50('0x2c')];if(_0xe81786['query'][_0xaa50('0x42')]){_0x3ba460[_0xaa50('0x3c')]=[{'all':!![]}];}_0x3ba460=_[_0xaa50('0x39')]({},_0x3ba460,_0xe81786['options']);return db['OpenchannelTransferReport'][_0xaa50('0x43')](_0x3ba460)[_0xaa50('0x23')](handleEntityNotFound(_0x530dbd,null))[_0xaa50('0x23')](respondWithResult(_0x530dbd,null))[_0xaa50('0x44')](handleError(_0x530dbd,null));};exports[_0xaa50('0x45')]=function(_0x32f1ca,_0x38b8b1){return db[_0xaa50('0x29')]['create'](_0x32f1ca['body'],{})[_0xaa50('0x23')](respondWithResult(_0x38b8b1,0xc9))[_0xaa50('0x44')](handleError(_0x38b8b1,null));};exports['update']=function(_0x2399d4,_0x306fcb){if(_0x2399d4[_0xaa50('0x46')]['id']){delete _0x2399d4[_0xaa50('0x46')]['id'];}return db['OpenchannelTransferReport'][_0xaa50('0x43')]({'where':{'id':_0x2399d4[_0xaa50('0x3f')]['id']}})['then'](handleEntityNotFound(_0x306fcb,null))[_0xaa50('0x23')](saveUpdates(_0x2399d4[_0xaa50('0x46')],null))['then'](respondWithResult(_0x306fcb,null))['catch'](handleError(_0x306fcb,null));};exports['destroy']=function(_0x3a2a8b,_0x4e041c){return db[_0xaa50('0x29')][_0xaa50('0x43')]({'where':{'id':_0x3a2a8b[_0xaa50('0x3f')]['id']}})[_0xaa50('0x23')](handleEntityNotFound(_0x4e041c,null))[_0xaa50('0x23')](removeEntity(_0x4e041c,null))[_0xaa50('0x44')](handleError(_0x4e041c,null));};exports[_0xaa50('0x47')]=function(_0x3cad9e,_0x286c35){return db['OpenchannelTransferReport'][_0xaa50('0x47')]()[_0xaa50('0x23')](respondWithResult(_0x286c35,null))[_0xaa50('0x44')](handleError(_0x286c35,null));}; \ No newline at end of file +var _0x4f6f=['query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','count','set','apply','reject','update','then','destroy','status','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x4f6f,0x66));var _0xf4f6=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0x4f6f[_0xbf5e16];return _0x5975a5;};'use strict';var emlformat=require(_0xf4f6('0x0'));var rimraf=require(_0xf4f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4f6('0x2'));var rp=require(_0xf4f6('0x3'));var moment=require(_0xf4f6('0x4'));var BPromise=require(_0xf4f6('0x5'));var Mustache=require(_0xf4f6('0x6'));var util=require(_0xf4f6('0x7'));var path=require(_0xf4f6('0x8'));var sox=require(_0xf4f6('0x9'));var csv=require(_0xf4f6('0xa'));var ejs=require(_0xf4f6('0xb'));var fs=require('fs');var fs_extra=require(_0xf4f6('0xc'));var _=require(_0xf4f6('0xd'));var squel=require(_0xf4f6('0xe'));var crypto=require(_0xf4f6('0xf'));var jsforce=require(_0xf4f6('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4f6('0x11'));var Papa=require('papaparse');var Redis=require(_0xf4f6('0x12'));var authService=require(_0xf4f6('0x13'));var qs=require(_0xf4f6('0x14'));var as=require(_0xf4f6('0x15'));var hardwareService=require(_0xf4f6('0x16'));var logger=require(_0xf4f6('0x17'))(_0xf4f6('0x18'));var utils=require(_0xf4f6('0x19'));var config=require(_0xf4f6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4f6('0x1b'))['db'];function respondWithStatusCode(_0x43a52c,_0x45c83b){_0x45c83b=_0x45c83b||0xcc;return function(_0x43398d){if(_0x43398d){return _0x43a52c[_0xf4f6('0x1c')](_0x45c83b);}return _0x43a52c['status'](_0x45c83b)[_0xf4f6('0x1d')]();};}function respondWithResult(_0x11c6f4,_0x3f1617){_0x3f1617=_0x3f1617||0xc8;return function(_0x496d5a){if(_0x496d5a){return _0x11c6f4['status'](_0x3f1617)[_0xf4f6('0x1e')](_0x496d5a);}};}function respondWithFilteredResult(_0x2b0b7c,_0x1f48a2){return function(_0x4a5e18){if(_0x4a5e18){var _0x4e2de1=typeof _0x1f48a2[_0xf4f6('0x1f')]==='undefined'&&typeof _0x1f48a2[_0xf4f6('0x20')]==='undefined';var _0x6278f6=_0x4a5e18['count'];var _0x4af372=_0x4e2de1?0x0:_0x1f48a2[_0xf4f6('0x1f')];var _0x337245=_0x4e2de1?_0x4a5e18[_0xf4f6('0x21')]:_0x1f48a2[_0xf4f6('0x1f')]+_0x1f48a2[_0xf4f6('0x20')];var _0x506364;if(_0x337245>=_0x6278f6){_0x337245=_0x6278f6;_0x506364=0xc8;}else{_0x506364=0xce;}_0x2b0b7c['status'](_0x506364);return _0x2b0b7c[_0xf4f6('0x22')]('Content-Range',_0x4af372+'-'+_0x337245+'/'+_0x6278f6)[_0xf4f6('0x1e')](_0x4a5e18);}return null;};}function patchUpdates(_0x5ce426){return function(_0x4bbb71){try{jsonpatch[_0xf4f6('0x23')](_0x4bbb71,_0x5ce426,!![]);}catch(_0x238f2c){return BPromise[_0xf4f6('0x24')](_0x238f2c);}return _0x4bbb71['save']();};}function saveUpdates(_0x48b45b,_0x2b4084){return function(_0x83b163){if(_0x83b163){return _0x83b163[_0xf4f6('0x25')](_0x48b45b)[_0xf4f6('0x26')](function(_0x3ef4b4){return _0x3ef4b4;});}return null;};}function removeEntity(_0x391b7f,_0x286e76){return function(_0xdeeee3){if(_0xdeeee3){return _0xdeeee3[_0xf4f6('0x27')]()[_0xf4f6('0x26')](function(){_0x391b7f[_0xf4f6('0x28')](0xcc)[_0xf4f6('0x1d')]();});}};}function handleEntityNotFound(_0x490108,_0x46c5c3){return function(_0x9a3dd6){if(!_0x9a3dd6){_0x490108[_0xf4f6('0x1c')](0x194);}return _0x9a3dd6;};}function handleError(_0x50a2c8,_0x54e6a1){_0x54e6a1=_0x54e6a1||0x1f4;return function(_0x37f4ec){logger[_0xf4f6('0x29')](_0x37f4ec['stack']);if(_0x37f4ec[_0xf4f6('0x2a')]){delete _0x37f4ec[_0xf4f6('0x2a')];}_0x50a2c8['status'](_0x54e6a1)[_0xf4f6('0x2b')](_0x37f4ec);};}exports[_0xf4f6('0x2c')]=function(_0x23450a,_0x3922da){var _0x438e53={},_0x2fb593={},_0x5dce49={'count':0x0,'rows':[]};var _0x242a7d=_[_0xf4f6('0x2d')](db[_0xf4f6('0x2e')][_0xf4f6('0x2f')],function(_0x5a264b){return{'name':_0x5a264b['fieldName'],'type':_0x5a264b['type'][_0xf4f6('0x30')]};});_0x2fb593[_0xf4f6('0x31')]=_[_0xf4f6('0x2d')](_0x242a7d,_0xf4f6('0x2a'));_0x2fb593[_0xf4f6('0x32')]=_[_0xf4f6('0x33')](_0x23450a[_0xf4f6('0x32')]);_0x2fb593['filters']=_[_0xf4f6('0x34')](_0x2fb593[_0xf4f6('0x31')],_0x2fb593[_0xf4f6('0x32')]);_0x438e53['attributes']=_['intersection'](_0x2fb593[_0xf4f6('0x31')],qs[_0xf4f6('0x35')](_0x23450a[_0xf4f6('0x32')][_0xf4f6('0x35')]));_0x438e53[_0xf4f6('0x36')]=_0x438e53['attributes']['length']?_0x438e53[_0xf4f6('0x36')]:_0x2fb593[_0xf4f6('0x31')];if(!_0x23450a[_0xf4f6('0x32')][_0xf4f6('0x37')]('nolimit')){_0x438e53[_0xf4f6('0x20')]=qs['limit'](_0x23450a['query'][_0xf4f6('0x20')]);_0x438e53[_0xf4f6('0x1f')]=qs['offset'](_0x23450a[_0xf4f6('0x32')][_0xf4f6('0x1f')]);}_0x438e53[_0xf4f6('0x38')]=qs[_0xf4f6('0x39')](_0x23450a['query']['sort']);_0x438e53[_0xf4f6('0x3a')]=qs[_0xf4f6('0x3b')](_[_0xf4f6('0x3c')](_0x23450a['query'],_0x2fb593[_0xf4f6('0x3b')]),_0x242a7d);if(_0x23450a[_0xf4f6('0x32')][_0xf4f6('0x3d')]){_0x438e53[_0xf4f6('0x3a')]=_[_0xf4f6('0x3e')](_0x438e53['where'],{'$or':_['map'](_0x242a7d,function(_0x3d6ab2){if(_0x3d6ab2[_0xf4f6('0x3f')]!=='VIRTUAL'){var _0x2b19ed={};_0x2b19ed[_0x3d6ab2[_0xf4f6('0x2a')]]={'$like':'%'+_0x23450a['query'][_0xf4f6('0x3d')]+'%'};return _0x2b19ed;}})});}_0x438e53=_[_0xf4f6('0x3e')]({},_0x438e53,_0x23450a['options']);var _0x599c20={'where':_0x438e53[_0xf4f6('0x3a')]};return db[_0xf4f6('0x2e')][_0xf4f6('0x21')](_0x599c20)[_0xf4f6('0x26')](function(_0x4a7646){_0x5dce49[_0xf4f6('0x21')]=_0x4a7646;if(_0x23450a[_0xf4f6('0x32')][_0xf4f6('0x40')]){_0x438e53[_0xf4f6('0x41')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xf4f6('0x42')](_0x438e53);})[_0xf4f6('0x26')](function(_0x1a79d2){_0x5dce49[_0xf4f6('0x43')]=_0x1a79d2;return _0x5dce49;})['then'](respondWithFilteredResult(_0x3922da,_0x438e53))['catch'](handleError(_0x3922da,null));};exports[_0xf4f6('0x44')]=function(_0x36cba0,_0x217825){var _0x1f614e={'raw':!![],'where':{'id':_0x36cba0[_0xf4f6('0x45')]['id']}},_0x39a9c3={};_0x39a9c3[_0xf4f6('0x31')]=_['keys'](db['OpenchannelTransferReport'][_0xf4f6('0x2f')]);_0x39a9c3[_0xf4f6('0x32')]=_['keys'](_0x36cba0['query']);_0x39a9c3['filters']=_[_0xf4f6('0x34')](_0x39a9c3[_0xf4f6('0x31')],_0x39a9c3[_0xf4f6('0x32')]);_0x1f614e[_0xf4f6('0x36')]=_[_0xf4f6('0x34')](_0x39a9c3[_0xf4f6('0x31')],qs['fields'](_0x36cba0[_0xf4f6('0x32')][_0xf4f6('0x35')]));_0x1f614e[_0xf4f6('0x36')]=_0x1f614e['attributes'][_0xf4f6('0x46')]?_0x1f614e[_0xf4f6('0x36')]:_0x39a9c3[_0xf4f6('0x31')];if(_0x36cba0[_0xf4f6('0x32')]['includeAll']){_0x1f614e[_0xf4f6('0x41')]=[{'all':!![]}];}_0x1f614e=_[_0xf4f6('0x3e')]({},_0x1f614e,_0x36cba0['options']);return db['OpenchannelTransferReport'][_0xf4f6('0x47')](_0x1f614e)['then'](handleEntityNotFound(_0x217825,null))[_0xf4f6('0x26')](respondWithResult(_0x217825,null))[_0xf4f6('0x48')](handleError(_0x217825,null));};exports['create']=function(_0x2c1e3a,_0x49643e){return db[_0xf4f6('0x2e')][_0xf4f6('0x49')](_0x2c1e3a['body'],{})[_0xf4f6('0x26')](respondWithResult(_0x49643e,0xc9))[_0xf4f6('0x48')](handleError(_0x49643e,null));};exports[_0xf4f6('0x25')]=function(_0x204a0f,_0xf53f98){if(_0x204a0f[_0xf4f6('0x4a')]['id']){delete _0x204a0f[_0xf4f6('0x4a')]['id'];}return db[_0xf4f6('0x2e')]['find']({'where':{'id':_0x204a0f[_0xf4f6('0x45')]['id']}})[_0xf4f6('0x26')](handleEntityNotFound(_0xf53f98,null))[_0xf4f6('0x26')](saveUpdates(_0x204a0f[_0xf4f6('0x4a')],null))[_0xf4f6('0x26')](respondWithResult(_0xf53f98,null))[_0xf4f6('0x48')](handleError(_0xf53f98,null));};exports['destroy']=function(_0x20597a,_0x180b74){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x20597a[_0xf4f6('0x45')]['id']}})[_0xf4f6('0x26')](handleEntityNotFound(_0x180b74,null))[_0xf4f6('0x26')](removeEntity(_0x180b74,null))[_0xf4f6('0x48')](handleError(_0x180b74,null));};exports[_0xf4f6('0x4b')]=function(_0x1b9695,_0x141a0d){return db['OpenchannelTransferReport'][_0xf4f6('0x4b')]()['then'](respondWithResult(_0x141a0d,null))[_0xf4f6('0x48')](handleError(_0x141a0d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 578cb51..8eb8269 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 _0xb4ac=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelTransferReport.attributes'];(function(_0xb21c6e,_0x20aa1d){var _0x45289b=function(_0x52366f){while(--_0x52366f){_0xb21c6e['push'](_0xb21c6e['shift']());}};_0x45289b(++_0x20aa1d);}(_0xb4ac,0xa0));var _0xcb4a=function(_0x5121fc,_0x331bed){_0x5121fc=_0x5121fc-0x0;var _0x4f3267=_0xb4ac[_0x5121fc];return _0x4f3267;};'use strict';var _=require(_0xcb4a('0x0'));var util=require(_0xcb4a('0x1'));var logger=require(_0xcb4a('0x2'))(_0xcb4a('0x3'));var moment=require(_0xcb4a('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb4a('0x5'));var fs=require('fs');var path=require(_0xcb4a('0x6'));var rimraf=require(_0xcb4a('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb4a('0x8'));module['exports']=function(_0x749d10,_0x2527d5){return _0x749d10[_0xcb4a('0x9')](_0xcb4a('0xa'),attributes,{'tableName':_0xcb4a('0xb'),'paranoid':![],'indexes':[{'name':_0xcb4a('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x58c1=['exports','OpenchannelTransferReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes'];(function(_0xdfe3bd,_0x2e52e5){var _0x3ddcd2=function(_0xb2003f){while(--_0xb2003f){_0xdfe3bd['push'](_0xdfe3bd['shift']());}};_0x3ddcd2(++_0x2e52e5);}(_0x58c1,0xc3));var _0x158c=function(_0xc030c8,_0x24e688){_0xc030c8=_0xc030c8-0x0;var _0x4e60e7=_0x58c1[_0xc030c8];return _0x4e60e7;};'use strict';var _=require(_0x158c('0x0'));var util=require(_0x158c('0x1'));var logger=require('../../config/logger')(_0x158c('0x2'));var moment=require(_0x158c('0x3'));var BPromise=require(_0x158c('0x4'));var rp=require(_0x158c('0x5'));var fs=require('fs');var path=require(_0x158c('0x6'));var rimraf=require('rimraf');var config=require(_0x158c('0x7'));var attributes=require(_0x158c('0x8'));module[_0x158c('0x9')]=function(_0x5ce636,_0x116e02){return _0x5ce636['define'](_0x158c('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x158c('0xb'),'fields':[_0x158c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index e1058a2..2df535e 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 _0xdb70=['rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xdb70,0xa0));var _0x0db7=function(_0x3b6910,_0x3286e8){_0x3b6910=_0x3b6910-0x0;var _0x1a767c=_0xdb70[_0x3b6910];return _0x1a767c;};'use strict';var _=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var moment=require(_0x0db7('0x2'));var BPromise=require('bluebird');var rs=require(_0x0db7('0x3'));var fs=require('fs');var Redis=require(_0x0db7('0x4'));var db=require(_0x0db7('0x5'))['db'];var utils=require(_0x0db7('0x6'));var logger=require(_0x0db7('0x7'))(_0x0db7('0x8'));var config=require(_0x0db7('0x9'));var jayson=require(_0x0db7('0xa'));var client=jayson[_0x0db7('0xb')][_0x0db7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x191a8e,_0x4c404e,_0x399095){return new BPromise(function(_0x1db9fe,_0x196b91){return client[_0x0db7('0xd')](_0x191a8e,_0x399095)[_0x0db7('0xe')](function(_0x3d43d6){logger['info'](_0x0db7('0xf'),_0x4c404e,_0x0db7('0x10'));logger['debug'](_0x0db7('0x11'),_0x4c404e,_0x0db7('0x10'),JSON[_0x0db7('0x12')](_0x3d43d6));if(_0x3d43d6[_0x0db7('0x13')]){if(_0x3d43d6['error'][_0x0db7('0x14')]===0x1f4){logger['error'](_0x0db7('0xf'),_0x4c404e,_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);return _0x196b91(_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);}logger['error'](_0x0db7('0xf'),_0x4c404e,_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);return _0x1db9fe(_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);}else{logger[_0x0db7('0x16')](_0x0db7('0xf'),_0x4c404e,_0x0db7('0x10'));_0x1db9fe(_0x3d43d6[_0x0db7('0x17')][_0x0db7('0x15')]);}})['catch'](function(_0x21cd17){logger[_0x0db7('0x13')](_0x0db7('0xf'),_0x4c404e,_0x21cd17);_0x196b91(_0x21cd17);});});} \ No newline at end of file +var _0x79d3=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','info','result','catch','lodash'];(function(_0x5412c2,_0x2f3149){var _0x5766d0=function(_0xc6de7d){while(--_0xc6de7d){_0x5412c2['push'](_0x5412c2['shift']());}};_0x5766d0(++_0x2f3149);}(_0x79d3,0x15f));var _0x379d=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0x79d3[_0x3a8b7c];return _0x40eb80;};'use strict';var _=require(_0x379d('0x0'));var util=require('util');var moment=require(_0x379d('0x1'));var BPromise=require('bluebird');var rs=require(_0x379d('0x2'));var fs=require('fs');var Redis=require(_0x379d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x379d('0x4'));var logger=require(_0x379d('0x5'))(_0x379d('0x6'));var config=require(_0x379d('0x7'));var jayson=require(_0x379d('0x8'));var client=jayson[_0x379d('0x9')][_0x379d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d1b1e,_0x1d344d,_0x4ecccf){return new BPromise(function(_0x3e6051,_0x49bfeb){return client[_0x379d('0xb')](_0x5d1b1e,_0x4ecccf)['then'](function(_0x11b47b){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1d344d,'request\x20sent');logger[_0x379d('0xc')](_0x379d('0xd'),_0x1d344d,_0x379d('0xe'),JSON['stringify'](_0x11b47b));if(_0x11b47b[_0x379d('0xf')]){if(_0x11b47b[_0x379d('0xf')][_0x379d('0x10')]===0x1f4){logger[_0x379d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1d344d,_0x11b47b[_0x379d('0xf')][_0x379d('0x11')]);return _0x49bfeb(_0x11b47b[_0x379d('0xf')][_0x379d('0x11')]);}logger[_0x379d('0xf')](_0x379d('0x12'),_0x1d344d,_0x11b47b['error']['message']);return _0x3e6051(_0x11b47b[_0x379d('0xf')]['message']);}else{logger[_0x379d('0x13')](_0x379d('0x12'),_0x1d344d,_0x379d('0xe'));_0x3e6051(_0x11b47b[_0x379d('0x14')]['message']);}})[_0x379d('0x15')](function(_0x5785b5){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1d344d,_0x5785b5);_0x49bfeb(_0x5785b5);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3d36cf7..dda212c 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 _0x4a8c=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show','create','put','update'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x4a8c,0x12f));var _0xc4a8=function(_0x467c6f,_0x4e854a){_0x467c6f=_0x467c6f-0x0;var _0x23c0c4=_0x4a8c[_0x467c6f];return _0x23c0c4;};'use strict';var multer=require(_0xc4a8('0x0'));var util=require(_0xc4a8('0x1'));var path=require(_0xc4a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4a8('0x3'));var router=express[_0xc4a8('0x4')]();var fs_extra=require(_0xc4a8('0x5'));var auth=require(_0xc4a8('0x6'));var interaction=require(_0xc4a8('0x7'));var config=require(_0xc4a8('0x8'));var controller=require(_0xc4a8('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc4a8('0xa')](_0xc4a8('0xb'),auth[_0xc4a8('0xc')](),controller[_0xc4a8('0xd')]);router['post']('/',auth[_0xc4a8('0xc')](),controller[_0xc4a8('0xe')]);router[_0xc4a8('0xf')](_0xc4a8('0xb'),auth[_0xc4a8('0xc')](),controller[_0xc4a8('0x10')]);router[_0xc4a8('0x11')]('/:id',auth[_0xc4a8('0xc')](),controller[_0xc4a8('0x12')]);module[_0xc4a8('0x13')]=router; \ No newline at end of file +var _0xa98b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xa98b,0x16f));var _0xba98=function(_0x65adc0,_0x19b161){_0x65adc0=_0x65adc0-0x0;var _0x4b13d0=_0xa98b[_0x65adc0];return _0x4b13d0;};'use strict';var multer=require(_0xba98('0x0'));var util=require(_0xba98('0x1'));var path=require(_0xba98('0x2'));var timeout=require(_0xba98('0x3'));var express=require(_0xba98('0x4'));var router=express[_0xba98('0x5')]();var fs_extra=require(_0xba98('0x6'));var auth=require(_0xba98('0x7'));var interaction=require(_0xba98('0x8'));var config=require(_0xba98('0x9'));var controller=require(_0xba98('0xa'));router['get']('/',auth[_0xba98('0xb')](),controller[_0xba98('0xc')]);router[_0xba98('0xd')]('/:id',auth[_0xba98('0xb')](),controller[_0xba98('0xe')]);router[_0xba98('0xf')]('/',auth[_0xba98('0xb')](),controller[_0xba98('0x10')]);router[_0xba98('0x11')](_0xba98('0x12'),auth[_0xba98('0xb')](),controller[_0xba98('0x13')]);router[_0xba98('0x14')](_0xba98('0x12'),auth[_0xba98('0xb')](),controller[_0xba98('0x15')]);module[_0xba98('0x16')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 60aaee6..b7d1e1d 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 _0x05e2=['sequelize','name','STRING'];(function(_0x682cd2,_0x38817d){var _0x3aacb7=function(_0x3be7ef){while(--_0x3be7ef){_0x682cd2['push'](_0x682cd2['shift']());}};_0x3aacb7(++_0x38817d);}(_0x05e2,0xab));var _0x205e=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0x05e2[_0x1df473];return _0x1bdd49;};'use strict';var Sequelize=require(_0x205e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x205e('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x205e('0x2')]}}; \ No newline at end of file +var _0x0869=['STRING','sequelize','exports'];(function(_0x124f8a,_0x117c26){var _0x50c557=function(_0x35b8a8){while(--_0x35b8a8){_0x124f8a['push'](_0x124f8a['shift']());}};_0x50c557(++_0x117c26);}(_0x0869,0x14b));var _0x9086=function(_0x43bd96,_0x921a72){_0x43bd96=_0x43bd96-0x0;var _0x3a1446=_0x0869[_0x43bd96];return _0x3a1446;};'use strict';var Sequelize=require(_0x9086('0x0'));module[_0x9086('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9086('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index e325edb..0d2aca0 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 _0xe982=['nolimit','sort','where','filter','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xce7f4a,_0x91edae){var _0x152a62=function(_0x7a2312){while(--_0x7a2312){_0xce7f4a['push'](_0xce7f4a['shift']());}};_0x152a62(++_0x91edae);}(_0xe982,0x16e));var _0x2e98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe982[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x2e98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e98('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2e98('0x3'));var path=require(_0x2e98('0x4'));var sox=require(_0x2e98('0x5'));var csv=require(_0x2e98('0x6'));var ejs=require(_0x2e98('0x7'));var fs=require('fs');var fs_extra=require(_0x2e98('0x8'));var _=require(_0x2e98('0x9'));var squel=require(_0x2e98('0xa'));var crypto=require(_0x2e98('0xb'));var jsforce=require(_0x2e98('0xc'));var deskjs=require(_0x2e98('0xd'));var toCsv=require(_0x2e98('0x6'));var querystring=require(_0x2e98('0xe'));var Papa=require(_0x2e98('0xf'));var Redis=require(_0x2e98('0x10'));var authService=require(_0x2e98('0x11'));var qs=require(_0x2e98('0x12'));var as=require(_0x2e98('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e98('0x14'))(_0x2e98('0x15'));var utils=require(_0x2e98('0x16'));var config=require(_0x2e98('0x17'));var licenseUtil=require(_0x2e98('0x18'));var db=require(_0x2e98('0x19'))['db'];function respondWithStatusCode(_0x3505bf,_0x40bae1){_0x40bae1=_0x40bae1||0xcc;return function(_0x302de5){if(_0x302de5){return _0x3505bf[_0x2e98('0x1a')](_0x40bae1);}return _0x3505bf['status'](_0x40bae1)[_0x2e98('0x1b')]();};}function respondWithResult(_0x495a18,_0x1c1264){_0x1c1264=_0x1c1264||0xc8;return function(_0x5b7357){if(_0x5b7357){return _0x495a18['status'](_0x1c1264)[_0x2e98('0x1c')](_0x5b7357);}};}function respondWithFilteredResult(_0x20ceb3,_0xf8a179){return function(_0xda6acf){if(_0xda6acf){var _0x3e4959=typeof _0xf8a179[_0x2e98('0x1d')]===_0x2e98('0x1e')&&typeof _0xf8a179[_0x2e98('0x1f')]===_0x2e98('0x1e');var _0x5491b2=_0xda6acf[_0x2e98('0x20')];var _0x1c9042=_0x3e4959?0x0:_0xf8a179[_0x2e98('0x1d')];var _0x21ead6=_0x3e4959?_0xda6acf[_0x2e98('0x20')]:_0xf8a179['offset']+_0xf8a179['limit'];var _0x5063eb;if(_0x21ead6>=_0x5491b2){_0x21ead6=_0x5491b2;_0x5063eb=0xc8;}else{_0x5063eb=0xce;}_0x20ceb3[_0x2e98('0x21')](_0x5063eb);return _0x20ceb3[_0x2e98('0x22')](_0x2e98('0x23'),_0x1c9042+'-'+_0x21ead6+'/'+_0x5491b2)['json'](_0xda6acf);}return null;};}function patchUpdates(_0x8c7446){return function(_0x5085d7){try{jsonpatch['apply'](_0x5085d7,_0x8c7446,!![]);}catch(_0xe8889a){return BPromise[_0x2e98('0x24')](_0xe8889a);}return _0x5085d7[_0x2e98('0x25')]();};}function saveUpdates(_0xd9a416,_0x305398){return function(_0x2c8929){if(_0x2c8929){return _0x2c8929[_0x2e98('0x26')](_0xd9a416)[_0x2e98('0x27')](function(_0x321e74){return _0x321e74;});}return null;};}function removeEntity(_0x148723,_0x4ff5bc){return function(_0x31c773){if(_0x31c773){return _0x31c773['destroy']()[_0x2e98('0x27')](function(){var _0x45ba98=_0x31c773['get']({'plain':!![]});var _0x2eb1da='Pauses';return db[_0x2e98('0x28')][_0x2e98('0x29')]({'where':{'type':_0x2eb1da,'resourceId':_0x45ba98['id']}})[_0x2e98('0x27')](function(){return _0x31c773;});})[_0x2e98('0x27')](function(){_0x148723[_0x2e98('0x21')](0xcc)[_0x2e98('0x1b')]();});}};}function handleEntityNotFound(_0x23b9e8,_0x16cde1){return function(_0x5830da){if(!_0x5830da){_0x23b9e8[_0x2e98('0x1a')](0x194);}return _0x5830da;};}function handleError(_0x4814cc,_0x18207e){_0x18207e=_0x18207e||0x1f4;return function(_0x2afbf2){logger[_0x2e98('0x2a')](_0x2afbf2[_0x2e98('0x2b')]);if(_0x2afbf2[_0x2e98('0x2c')]){delete _0x2afbf2[_0x2e98('0x2c')];}_0x4814cc[_0x2e98('0x21')](_0x18207e)[_0x2e98('0x2d')](_0x2afbf2);};}exports[_0x2e98('0x2e')]=function(_0x296f8e,_0x18b12f){var _0x6ddfeb={},_0x44d4b7={},_0x2ef704={'count':0x0,'rows':[]};var _0x22e3c6=_[_0x2e98('0x2f')](db['Pause'][_0x2e98('0x30')],function(_0x32b083){return{'name':_0x32b083['fieldName'],'type':_0x32b083[_0x2e98('0x31')][_0x2e98('0x32')]};});_0x44d4b7[_0x2e98('0x33')]=_[_0x2e98('0x2f')](_0x22e3c6,'name');_0x44d4b7[_0x2e98('0x34')]=_['keys'](_0x296f8e[_0x2e98('0x34')]);_0x44d4b7[_0x2e98('0x35')]=_[_0x2e98('0x36')](_0x44d4b7[_0x2e98('0x33')],_0x44d4b7[_0x2e98('0x34')]);_0x6ddfeb[_0x2e98('0x37')]=_[_0x2e98('0x36')](_0x44d4b7['model'],qs[_0x2e98('0x38')](_0x296f8e[_0x2e98('0x34')]['fields']));_0x6ddfeb['attributes']=_0x6ddfeb['attributes'][_0x2e98('0x39')]?_0x6ddfeb[_0x2e98('0x37')]:_0x44d4b7['model'];if(!_0x296f8e[_0x2e98('0x34')][_0x2e98('0x3a')](_0x2e98('0x3b'))){_0x6ddfeb['limit']=qs[_0x2e98('0x1f')](_0x296f8e['query'][_0x2e98('0x1f')]);_0x6ddfeb[_0x2e98('0x1d')]=qs[_0x2e98('0x1d')](_0x296f8e[_0x2e98('0x34')][_0x2e98('0x1d')]);}_0x6ddfeb['order']=qs[_0x2e98('0x3c')](_0x296f8e[_0x2e98('0x34')]['sort']);_0x6ddfeb[_0x2e98('0x3d')]=qs['filters'](_['pick'](_0x296f8e['query'],_0x44d4b7[_0x2e98('0x35')]),_0x22e3c6);if(_0x296f8e[_0x2e98('0x34')][_0x2e98('0x3e')]){_0x6ddfeb['where']=_[_0x2e98('0x3f')](_0x6ddfeb[_0x2e98('0x3d')],{'$or':_['map'](_0x22e3c6,function(_0x3313f0){if(_0x3313f0[_0x2e98('0x31')]!==_0x2e98('0x40')){var _0x61e83e={};_0x61e83e[_0x3313f0[_0x2e98('0x2c')]]={'$like':'%'+_0x296f8e[_0x2e98('0x34')]['filter']+'%'};return _0x61e83e;}})});}_0x6ddfeb=_[_0x2e98('0x3f')]({},_0x6ddfeb,_0x296f8e[_0x2e98('0x41')]);var _0x54320d={'where':_0x6ddfeb[_0x2e98('0x3d')]};return db[_0x2e98('0x42')]['count'](_0x54320d)['then'](function(_0x59ed60){_0x2ef704[_0x2e98('0x20')]=_0x59ed60;if(_0x296f8e[_0x2e98('0x34')][_0x2e98('0x43')]){_0x6ddfeb['include']=[{'all':!![]}];}return db['Pause'][_0x2e98('0x44')](_0x6ddfeb);})[_0x2e98('0x27')](function(_0x16b02b){_0x2ef704[_0x2e98('0x45')]=_0x16b02b;return _0x2ef704;})[_0x2e98('0x27')](respondWithFilteredResult(_0x18b12f,_0x6ddfeb))[_0x2e98('0x46')](handleError(_0x18b12f,null));};exports[_0x2e98('0x47')]=function(_0x3fca8b,_0x711ed){var _0x5991ce={'raw':!![],'where':{'id':_0x3fca8b[_0x2e98('0x48')]['id']}},_0x18fede={};_0x18fede[_0x2e98('0x33')]=_[_0x2e98('0x49')](db[_0x2e98('0x42')][_0x2e98('0x30')]);_0x18fede[_0x2e98('0x34')]=_[_0x2e98('0x49')](_0x3fca8b[_0x2e98('0x34')]);_0x18fede['filters']=_['intersection'](_0x18fede[_0x2e98('0x33')],_0x18fede[_0x2e98('0x34')]);_0x5991ce['attributes']=_[_0x2e98('0x36')](_0x18fede['model'],qs['fields'](_0x3fca8b['query'][_0x2e98('0x38')]));_0x5991ce[_0x2e98('0x37')]=_0x5991ce[_0x2e98('0x37')]['length']?_0x5991ce[_0x2e98('0x37')]:_0x18fede['model'];if(_0x3fca8b[_0x2e98('0x34')]['includeAll']){_0x5991ce[_0x2e98('0x4a')]=[{'all':!![]}];}_0x5991ce=_[_0x2e98('0x3f')]({},_0x5991ce,_0x3fca8b[_0x2e98('0x41')]);return db[_0x2e98('0x42')][_0x2e98('0x4b')](_0x5991ce)['then'](handleEntityNotFound(_0x711ed,null))[_0x2e98('0x27')](respondWithResult(_0x711ed,null))[_0x2e98('0x46')](handleError(_0x711ed,null));};exports[_0x2e98('0x4c')]=function(_0x22f71d,_0xd377a6){return db[_0x2e98('0x42')]['create'](_0x22f71d[_0x2e98('0x4d')],{})['then'](function(_0x4d23d0){var _0x9385ae=_0x22f71d[_0x2e98('0x4e')][_0x2e98('0x4f')]({'plain':!![]});if(!_0x9385ae)throw new Error(_0x2e98('0x50'));if(_0x9385ae['role']===_0x2e98('0x4e')){var _0x1baca3=_0x4d23d0[_0x2e98('0x4f')]({'plain':!![]});var _0x45ee15=_0x2e98('0x51');return db['UserProfileSection'][_0x2e98('0x4b')]({'where':{'name':_0x45ee15,'userProfileId':_0x9385ae[_0x2e98('0x52')]},'raw':!![]})['then'](function(_0x20eac7){if(_0x20eac7&&_0x20eac7[_0x2e98('0x53')]===0x0){return db[_0x2e98('0x28')]['create']({'name':_0x1baca3[_0x2e98('0x2c')],'resourceId':_0x1baca3['id'],'type':_0x20eac7[_0x2e98('0x2c')],'sectionId':_0x20eac7['id']},{})[_0x2e98('0x27')](function(){return _0x4d23d0;});}else{return _0x4d23d0;}})[_0x2e98('0x46')](function(_0x1399a3){logger['error'](_0x2e98('0x54'),_0x1399a3);throw _0x1399a3;});}return _0x4d23d0;})[_0x2e98('0x27')](respondWithResult(_0xd377a6,0xc9))[_0x2e98('0x46')](handleError(_0xd377a6,null));};exports['update']=function(_0x216e1f,_0x393e81){if(_0x216e1f[_0x2e98('0x4d')]['id']){delete _0x216e1f[_0x2e98('0x4d')]['id'];}return db[_0x2e98('0x42')]['find']({'where':{'id':_0x216e1f['params']['id']}})[_0x2e98('0x27')](handleEntityNotFound(_0x393e81,null))[_0x2e98('0x27')](saveUpdates(_0x216e1f[_0x2e98('0x4d')],null))[_0x2e98('0x27')](respondWithResult(_0x393e81,null))[_0x2e98('0x46')](handleError(_0x393e81,null));};exports[_0x2e98('0x29')]=function(_0x297797,_0x37e7d1){return db['Pause']['find']({'where':{'id':_0x297797[_0x2e98('0x48')]['id']}})['then'](handleEntityNotFound(_0x37e7d1,null))[_0x2e98('0x27')](removeEntity(_0x37e7d1,null))[_0x2e98('0x46')](handleError(_0x37e7d1,null));}; \ No newline at end of file +var _0x26b1=['userProfileId','autoAssociation','params','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x38a6c6,_0x4062ca){var _0x142f0a=function(_0x1531ce){while(--_0x1531ce){_0x38a6c6['push'](_0x38a6c6['shift']());}};_0x142f0a(++_0x4062ca);}(_0x26b1,0x1e3));var _0x126b=function(_0x2eafe2,_0x2f3aba){_0x2eafe2=_0x2eafe2-0x0;var _0x259112=_0x26b1[_0x2eafe2];return _0x259112;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x126b('0x0'));var jsonpatch=require(_0x126b('0x1'));var rp=require(_0x126b('0x2'));var moment=require(_0x126b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x126b('0x4'));var util=require('util');var path=require(_0x126b('0x5'));var sox=require('sox');var csv=require(_0x126b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x126b('0x7'));var _=require(_0x126b('0x8'));var squel=require('squel');var crypto=require(_0x126b('0x9'));var jsforce=require(_0x126b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x126b('0x6'));var querystring=require('querystring');var Papa=require(_0x126b('0xb'));var Redis=require(_0x126b('0xc'));var authService=require(_0x126b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x126b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x126b('0xf'))(_0x126b('0x10'));var utils=require(_0x126b('0x11'));var config=require(_0x126b('0x12'));var licenseUtil=require(_0x126b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2efe19,_0x3abe35){_0x3abe35=_0x3abe35||0xcc;return function(_0x310085){if(_0x310085){return _0x2efe19[_0x126b('0x14')](_0x3abe35);}return _0x2efe19[_0x126b('0x15')](_0x3abe35)[_0x126b('0x16')]();};}function respondWithResult(_0x202edf,_0x3632a2){_0x3632a2=_0x3632a2||0xc8;return function(_0x25a7cb){if(_0x25a7cb){return _0x202edf[_0x126b('0x15')](_0x3632a2)['json'](_0x25a7cb);}};}function respondWithFilteredResult(_0xf502ef,_0x1e18dd){return function(_0x19441b){if(_0x19441b){var _0x2e2c85=typeof _0x1e18dd[_0x126b('0x17')]===_0x126b('0x18')&&typeof _0x1e18dd[_0x126b('0x19')]==='undefined';var _0xff35dd=_0x19441b[_0x126b('0x1a')];var _0x2e9c39=_0x2e2c85?0x0:_0x1e18dd['offset'];var _0xd5ff47=_0x2e2c85?_0x19441b[_0x126b('0x1a')]:_0x1e18dd[_0x126b('0x17')]+_0x1e18dd[_0x126b('0x19')];var _0x410e93;if(_0xd5ff47>=_0xff35dd){_0xd5ff47=_0xff35dd;_0x410e93=0xc8;}else{_0x410e93=0xce;}_0xf502ef[_0x126b('0x15')](_0x410e93);return _0xf502ef[_0x126b('0x1b')](_0x126b('0x1c'),_0x2e9c39+'-'+_0xd5ff47+'/'+_0xff35dd)['json'](_0x19441b);}return null;};}function patchUpdates(_0x59a70a){return function(_0x38ba6b){try{jsonpatch[_0x126b('0x1d')](_0x38ba6b,_0x59a70a,!![]);}catch(_0xb47439){return BPromise[_0x126b('0x1e')](_0xb47439);}return _0x38ba6b[_0x126b('0x1f')]();};}function saveUpdates(_0x10c9a9,_0x114702){return function(_0x4257c4){if(_0x4257c4){return _0x4257c4[_0x126b('0x20')](_0x10c9a9)[_0x126b('0x21')](function(_0x239517){return _0x239517;});}return null;};}function removeEntity(_0x3843b4,_0x16481b){return function(_0x4c5947){if(_0x4c5947){return _0x4c5947[_0x126b('0x22')]()[_0x126b('0x21')](function(){var _0x4ac9df=_0x4c5947[_0x126b('0x23')]({'plain':!![]});var _0x8cfa61=_0x126b('0x24');return db[_0x126b('0x25')][_0x126b('0x22')]({'where':{'type':_0x8cfa61,'resourceId':_0x4ac9df['id']}})[_0x126b('0x21')](function(){return _0x4c5947;});})[_0x126b('0x21')](function(){_0x3843b4[_0x126b('0x15')](0xcc)[_0x126b('0x16')]();});}};}function handleEntityNotFound(_0x22f55c,_0x593872){return function(_0x650cac){if(!_0x650cac){_0x22f55c[_0x126b('0x14')](0x194);}return _0x650cac;};}function handleError(_0x134327,_0x3231dd){_0x3231dd=_0x3231dd||0x1f4;return function(_0x39726d){logger[_0x126b('0x26')](_0x39726d[_0x126b('0x27')]);if(_0x39726d[_0x126b('0x28')]){delete _0x39726d[_0x126b('0x28')];}_0x134327[_0x126b('0x15')](_0x3231dd)[_0x126b('0x29')](_0x39726d);};}exports[_0x126b('0x2a')]=function(_0x119bc8,_0x54fb22){var _0x174db7={},_0x5527ae={},_0x1a008e={'count':0x0,'rows':[]};var _0x31b6e7=_['map'](db[_0x126b('0x2b')][_0x126b('0x2c')],function(_0x4aa7e4){return{'name':_0x4aa7e4[_0x126b('0x2d')],'type':_0x4aa7e4[_0x126b('0x2e')]['key']};});_0x5527ae[_0x126b('0x2f')]=_[_0x126b('0x30')](_0x31b6e7,_0x126b('0x28'));_0x5527ae[_0x126b('0x31')]=_[_0x126b('0x32')](_0x119bc8[_0x126b('0x31')]);_0x5527ae[_0x126b('0x33')]=_[_0x126b('0x34')](_0x5527ae[_0x126b('0x2f')],_0x5527ae[_0x126b('0x31')]);_0x174db7[_0x126b('0x35')]=_[_0x126b('0x34')](_0x5527ae['model'],qs['fields'](_0x119bc8['query'][_0x126b('0x36')]));_0x174db7[_0x126b('0x35')]=_0x174db7[_0x126b('0x35')][_0x126b('0x37')]?_0x174db7[_0x126b('0x35')]:_0x5527ae[_0x126b('0x2f')];if(!_0x119bc8[_0x126b('0x31')][_0x126b('0x38')](_0x126b('0x39'))){_0x174db7[_0x126b('0x19')]=qs[_0x126b('0x19')](_0x119bc8[_0x126b('0x31')][_0x126b('0x19')]);_0x174db7[_0x126b('0x17')]=qs[_0x126b('0x17')](_0x119bc8[_0x126b('0x31')]['offset']);}_0x174db7[_0x126b('0x3a')]=qs[_0x126b('0x3b')](_0x119bc8[_0x126b('0x31')][_0x126b('0x3b')]);_0x174db7['where']=qs[_0x126b('0x33')](_[_0x126b('0x3c')](_0x119bc8[_0x126b('0x31')],_0x5527ae[_0x126b('0x33')]),_0x31b6e7);if(_0x119bc8[_0x126b('0x31')][_0x126b('0x3d')]){_0x174db7[_0x126b('0x3e')]=_[_0x126b('0x3f')](_0x174db7[_0x126b('0x3e')],{'$or':_[_0x126b('0x30')](_0x31b6e7,function(_0x47a2b3){if(_0x47a2b3[_0x126b('0x2e')]!==_0x126b('0x40')){var _0x209950={};_0x209950[_0x47a2b3[_0x126b('0x28')]]={'$like':'%'+_0x119bc8[_0x126b('0x31')][_0x126b('0x3d')]+'%'};return _0x209950;}})});}_0x174db7=_[_0x126b('0x3f')]({},_0x174db7,_0x119bc8[_0x126b('0x41')]);var _0x36c93c={'where':_0x174db7[_0x126b('0x3e')]};return db[_0x126b('0x2b')][_0x126b('0x1a')](_0x36c93c)[_0x126b('0x21')](function(_0x59a72b){_0x1a008e['count']=_0x59a72b;if(_0x119bc8[_0x126b('0x31')][_0x126b('0x42')]){_0x174db7[_0x126b('0x43')]=[{'all':!![]}];}return db[_0x126b('0x2b')][_0x126b('0x44')](_0x174db7);})['then'](function(_0x22c44e){_0x1a008e['rows']=_0x22c44e;return _0x1a008e;})['then'](respondWithFilteredResult(_0x54fb22,_0x174db7))[_0x126b('0x45')](handleError(_0x54fb22,null));};exports[_0x126b('0x46')]=function(_0x2a4626,_0xda924){var _0x59ef24={'raw':!![],'where':{'id':_0x2a4626['params']['id']}},_0x39249b={};_0x39249b['model']=_[_0x126b('0x32')](db[_0x126b('0x2b')][_0x126b('0x2c')]);_0x39249b[_0x126b('0x31')]=_[_0x126b('0x32')](_0x2a4626['query']);_0x39249b[_0x126b('0x33')]=_[_0x126b('0x34')](_0x39249b['model'],_0x39249b[_0x126b('0x31')]);_0x59ef24[_0x126b('0x35')]=_['intersection'](_0x39249b['model'],qs[_0x126b('0x36')](_0x2a4626[_0x126b('0x31')][_0x126b('0x36')]));_0x59ef24['attributes']=_0x59ef24[_0x126b('0x35')][_0x126b('0x37')]?_0x59ef24[_0x126b('0x35')]:_0x39249b[_0x126b('0x2f')];if(_0x2a4626[_0x126b('0x31')][_0x126b('0x42')]){_0x59ef24[_0x126b('0x43')]=[{'all':!![]}];}_0x59ef24=_[_0x126b('0x3f')]({},_0x59ef24,_0x2a4626[_0x126b('0x41')]);return db[_0x126b('0x2b')][_0x126b('0x47')](_0x59ef24)['then'](handleEntityNotFound(_0xda924,null))[_0x126b('0x21')](respondWithResult(_0xda924,null))[_0x126b('0x45')](handleError(_0xda924,null));};exports[_0x126b('0x48')]=function(_0x2859e0,_0x56d013){return db[_0x126b('0x2b')][_0x126b('0x48')](_0x2859e0[_0x126b('0x49')],{})[_0x126b('0x21')](function(_0x17fdb3){var _0x1de4bb=_0x2859e0[_0x126b('0x4a')][_0x126b('0x23')]({'plain':!![]});if(!_0x1de4bb)throw new Error(_0x126b('0x4b'));if(_0x1de4bb['role']===_0x126b('0x4a')){var _0x20b29f=_0x17fdb3['get']({'plain':!![]});var _0x46d755=_0x126b('0x24');return db[_0x126b('0x4c')][_0x126b('0x47')]({'where':{'name':_0x46d755,'userProfileId':_0x1de4bb[_0x126b('0x4d')]},'raw':!![]})['then'](function(_0x5f3cd2){if(_0x5f3cd2&&_0x5f3cd2[_0x126b('0x4e')]===0x0){return db[_0x126b('0x25')]['create']({'name':_0x20b29f['name'],'resourceId':_0x20b29f['id'],'type':_0x5f3cd2[_0x126b('0x28')],'sectionId':_0x5f3cd2['id']},{})[_0x126b('0x21')](function(){return _0x17fdb3;});}else{return _0x17fdb3;}})[_0x126b('0x45')](function(_0x239759){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x239759);throw _0x239759;});}return _0x17fdb3;})[_0x126b('0x21')](respondWithResult(_0x56d013,0xc9))[_0x126b('0x45')](handleError(_0x56d013,null));};exports['update']=function(_0x2e439f,_0xa561c7){if(_0x2e439f[_0x126b('0x49')]['id']){delete _0x2e439f['body']['id'];}return db[_0x126b('0x2b')][_0x126b('0x47')]({'where':{'id':_0x2e439f[_0x126b('0x4f')]['id']}})[_0x126b('0x21')](handleEntityNotFound(_0xa561c7,null))['then'](saveUpdates(_0x2e439f['body'],null))[_0x126b('0x21')](respondWithResult(_0xa561c7,null))[_0x126b('0x45')](handleError(_0xa561c7,null));};exports['destroy']=function(_0x47202b,_0x108a73){return db[_0x126b('0x2b')][_0x126b('0x47')]({'where':{'id':_0x47202b[_0x126b('0x4f')]['id']}})[_0x126b('0x21')](handleEntityNotFound(_0x108a73,null))[_0x126b('0x21')](removeEntity(_0x108a73,null))[_0x126b('0x45')](handleError(_0x108a73,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1928b7c..0af46d8 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x834e42,_0x44efee){var _0x10517b=function(_0xce6924){while(--_0xce6924){_0x834e42['push'](_0x834e42['shift']());}};_0x10517b(++_0x44efee);}(_0x53ec,0x192));var _0xc53e=function(_0x37222f,_0x25a5ab){_0x37222f=_0x37222f-0x0;var _0x5c5a6d=_0x53ec[_0x37222f];return _0x5c5a6d;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x4223ab,_0x4778bc){var _0x30d94c=function(_0x1ddec3){while(--_0x1ddec3){_0x4223ab['push'](_0x4223ab['shift']());}};_0x30d94c(++_0x4778bc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2bf4ec,_0x52c399){_0x2bf4ec=_0x2bf4ec-0x0;var _0x1d5d96=_0x8ef6[_0x2bf4ec];return _0x1d5d96;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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 78f56c5..34df299 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(_0x45eb6e,_0x2a717b){var _0x2f7f37=function(_0x55f81f){while(--_0x55f81f){_0x45eb6e['push'](_0x45eb6e['shift']());}};_0x2f7f37(++_0x2a717b);}(_0x7a54,0x106));var _0x47a5=function(_0x4b334c,_0x16f5b1){_0x4b334c=_0x4b334c-0x0;var _0x4ada67=_0x7a54[_0x4b334c];return _0x4ada67;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x173523,_0xc2cad0){var _0x119598=function(_0x2e5601){while(--_0x2e5601){_0x173523['push'](_0x173523['shift']());}};_0x119598(++_0xc2cad0);}(_0xb10b,0x12a));var _0xbb10=function(_0x16eadc,_0x3fc953){_0x16eadc=_0x16eadc-0x0;var _0x5b05c8=_0xb10b[_0x16eadc];return _0x5b05c8;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 922a41d..5434f0b 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 _0x0c02=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/:id','show','/:id/download','join','root','server/files/plugins','replace','format','%s-%s%s','basename','originalname','extname','now','post','single','file','upload','/webhook','update','delete','exports'];(function(_0xf31854,_0x31e29b){var _0x14dd15=function(_0x466eb3){while(--_0x466eb3){_0xf31854['push'](_0xf31854['shift']());}};_0x14dd15(++_0x31e29b);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0x9')](_0x20c0('0xe'),auth[_0x20c0('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52eb0d,_0x578592,_0x56770a){_0x56770a(null,path[_0x20c0('0xf')](config[_0x20c0('0x10')],_0x20c0('0x11')));},'filename':function(_0x207b1e,_0x4ed79e,_0x56fa09){_0x4ed79e['originalname']=_0x4ed79e['originalname'][_0x20c0('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56fa09(null,util[_0x20c0('0x13')](_0x20c0('0x14'),path[_0x20c0('0x15')](_0x4ed79e[_0x20c0('0x16')],path[_0x20c0('0x17')](_0x4ed79e[_0x20c0('0x16')])),Date[_0x20c0('0x18')](),path[_0x20c0('0x17')](_0x4ed79e['originalname'])));}})});router[_0x20c0('0x19')]('/',upload[_0x20c0('0x1a')](_0x20c0('0x1b')),controller[_0x20c0('0x1c')]);router[_0x20c0('0x19')](_0x20c0('0x1d'),controller['webhookPost']);router['put']('/:id',auth[_0x20c0('0xa')](),controller[_0x20c0('0x1e')]);router[_0x20c0('0x1f')](_0x20c0('0xc'),auth['isAuthenticated'](),controller[_0x20c0('0x1f')]);module[_0x20c0('0x20')]=router; \ No newline at end of file +var _0x207c=['file','upload','post','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/webhook','/:id','isAuthenticated','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','extname','now','single'];(function(_0xcc9818,_0x65a418){var _0x7b8625=function(_0x31b5cf){while(--_0x31b5cf){_0xcc9818['push'](_0xcc9818['shift']());}};_0x7b8625(++_0x65a418);}(_0x207c,0x1e8));var _0xc207=function(_0x22fefb,_0x105065){_0x22fefb=_0x22fefb-0x0;var _0x49a5e0=_0x207c[_0x22fefb];return _0x49a5e0;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),controller['webhookGet']);router[_0xc207('0x9')](_0xc207('0xb'),auth[_0xc207('0xc')](),controller['show']);router[_0xc207('0x9')](_0xc207('0xd'),auth[_0xc207('0xc')](),controller[_0xc207('0xe')]);var upload=multer({'storage':multer[_0xc207('0xf')]({'destination':function(_0x347549,_0x487d95,_0x574425){_0x574425(null,path['join'](config[_0xc207('0x10')],'server/files/plugins'));},'filename':function(_0x2741f3,_0x2782ce,_0x59d401){_0x2782ce[_0xc207('0x11')]=_0x2782ce[_0xc207('0x11')][_0xc207('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59d401(null,util[_0xc207('0x13')](_0xc207('0x14'),path['basename'](_0x2782ce[_0xc207('0x11')],path[_0xc207('0x15')](_0x2782ce[_0xc207('0x11')])),Date[_0xc207('0x16')](),path['extname'](_0x2782ce['originalname'])));}})});router['post']('/',upload[_0xc207('0x17')](_0xc207('0x18')),controller[_0xc207('0x19')]);router[_0xc207('0x1a')]('/webhook',controller[_0xc207('0x1b')]);router[_0xc207('0x1c')](_0xc207('0xb'),auth['isAuthenticated'](),controller[_0xc207('0x1d')]);router['delete'](_0xc207('0xb'),auth[_0xc207('0xc')](),controller[_0xc207('0x1e')]);module[_0xc207('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 44aa603..f7c641c 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 _0x0278=['agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x535a96,_0x29c3cd){var _0x3b789c=function(_0x198d24){while(--_0x198d24){_0x535a96['push'](_0x535a96['shift']());}};_0x3b789c(++_0x29c3cd);}(_0x0278,0x71));var _0x8027=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x0278[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x8027('0x0'));module[_0x8027('0x1')]={'name':{'type':Sequelize[_0x8027('0x2')]},'type':{'type':Sequelize['ENUM'](_0x8027('0x3'),_0x8027('0x4'))},'description':{'type':Sequelize[_0x8027('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x8027('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x8027('0x6')],'defaultValue':0x0,'comment':_0x8027('0x7')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x8027('0x8'),_0x8027('0x9'),'never'),'defaultValue':_0x8027('0x9'),'comment':_0x8027('0xa')},'icon':{'type':Sequelize[_0x8027('0x2')]},'adminUrl':{'type':Sequelize[_0x8027('0x2')]},'agentUrl':{'type':Sequelize[_0x8027('0x2')]},'scriptName':{'type':Sequelize[_0x8027('0x2')]},'scriptPath':{'type':Sequelize[_0x8027('0x2')]}}; \ No newline at end of file +var _0x787c=['TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x787c,0xbe));var _0xc787=function(_0x14c598,_0x46f7a4){_0x14c598=_0x14c598-0x0;var _0x1bbfd6=_0x787c[_0x14c598];return _0x1bbfd6;};'use strict';var Sequelize=require(_0xc787('0x0'));module[_0xc787('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc787('0x2')](_0xc787('0x3'),_0xc787('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc787('0x5')]},'path':{'type':Sequelize[_0xc787('0x6')],'comment':_0xc787('0x7')},'active':{'type':Sequelize[_0xc787('0x8')],'defaultValue':0x0,'comment':_0xc787('0x9')},'sidebar':{'type':Sequelize[_0xc787('0x2')](_0xc787('0xa'),'agentOnly','always','never'),'defaultValue':_0xc787('0xb'),'comment':_0xc787('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xc787('0x6')]},'agentUrl':{'type':Sequelize[_0xc787('0x6')]},'scriptName':{'type':Sequelize[_0xc787('0x6')]},'scriptPath':{'type':Sequelize[_0xc787('0x6')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 6256be5..1f14fda 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 _0x4a9b=['Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','join','dirname','attachments/**/*','finalize','existsSync','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','end','sendStatus','stack','name','send','index','map','Plugin','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','rawAttributes','fields','include','find','catch','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','ENOENT','error','Error'];(function(_0x31b051,_0x198e58){var _0x32deed=function(_0x104014){while(--_0x104014){_0x31b051['push'](_0x31b051['shift']());}};_0x32deed(++_0x198e58);}(_0x4a9b,0x102));var _0xb4a9=function(_0x66e8c6,_0x559e25){_0x66e8c6=_0x66e8c6-0x0;var _0x3af129=_0x4a9b[_0x66e8c6];return _0x3af129;};'use strict';var emlformat=require(_0xb4a9('0x0'));var rimraf=require(_0xb4a9('0x1'));var zipdir=require(_0xb4a9('0x2'));var jsonpatch=require(_0xb4a9('0x3'));var rp=require('request-promise');var moment=require(_0xb4a9('0x4'));var BPromise=require(_0xb4a9('0x5'));var Mustache=require(_0xb4a9('0x6'));var util=require('util');var path=require(_0xb4a9('0x7'));var sox=require(_0xb4a9('0x8'));var csv=require(_0xb4a9('0x9'));var ejs=require(_0xb4a9('0xa'));var fs=require('fs');var fs_extra=require(_0xb4a9('0xb'));var _=require(_0xb4a9('0xc'));var squel=require(_0xb4a9('0xd'));var crypto=require('crypto');var jsforce=require(_0xb4a9('0xe'));var deskjs=require(_0xb4a9('0xf'));var toCsv=require(_0xb4a9('0x9'));var querystring=require('querystring');var Papa=require(_0xb4a9('0x10'));var extract=require('extract-zip');var rimraf=require(_0xb4a9('0x1'));var archiver=require(_0xb4a9('0x11'));var Redis=require(_0xb4a9('0x12'));var authService=require(_0xb4a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb4a9('0x14'));var hardwareService=require(_0xb4a9('0x15'));var logger=require(_0xb4a9('0x16'))('api');var utils=require(_0xb4a9('0x17'));var config=require(_0xb4a9('0x18'));var licenseUtil=require(_0xb4a9('0x19'));var db=require(_0xb4a9('0x1a'))['db'];config['redis']=_[_0xb4a9('0x1b')](config[_0xb4a9('0x1c')],{'host':_0xb4a9('0x1d'),'port':0x18eb});var socket=require(_0xb4a9('0x1e'))(new Redis(config[_0xb4a9('0x1c')]));require('./plugin.socket')[_0xb4a9('0x1f')](socket);function respondWithStatusCode(_0x5dce55,_0x4a9491){_0x4a9491=_0x4a9491||0xcc;return function(_0x3e3e28){if(_0x3e3e28){return _0x5dce55['sendStatus'](_0x4a9491);}return _0x5dce55[_0xb4a9('0x20')](_0x4a9491)['end']();};}function respondWithResult(_0x3f1b0b,_0x12f695){_0x12f695=_0x12f695||0xc8;return function(_0xd019f9){if(_0xd019f9){return _0x3f1b0b[_0xb4a9('0x20')](_0x12f695)['json'](_0xd019f9);}};}function respondWithFilteredResult(_0x4e7ae4,_0xd251f1){return function(_0x535207){if(_0x535207){var _0x5db2aa=typeof _0xd251f1[_0xb4a9('0x21')]===_0xb4a9('0x22')&&typeof _0xd251f1[_0xb4a9('0x23')]===_0xb4a9('0x22');var _0x38d166=_0x535207['count'];var _0x44058e=_0x5db2aa?0x0:_0xd251f1['offset'];var _0x534ab8=_0x5db2aa?_0x535207[_0xb4a9('0x24')]:_0xd251f1[_0xb4a9('0x21')]+_0xd251f1['limit'];var _0x351dac;if(_0x534ab8>=_0x38d166){_0x534ab8=_0x38d166;_0x351dac=0xc8;}else{_0x351dac=0xce;}_0x4e7ae4[_0xb4a9('0x20')](_0x351dac);return _0x4e7ae4['set'](_0xb4a9('0x25'),_0x44058e+'-'+_0x534ab8+'/'+_0x38d166)[_0xb4a9('0x26')](_0x535207);}return null;};}function patchUpdates(_0x32b83a){return function(_0xc33a81){try{jsonpatch[_0xb4a9('0x27')](_0xc33a81,_0x32b83a,!![]);}catch(_0x42556a){return BPromise[_0xb4a9('0x28')](_0x42556a);}return _0xc33a81[_0xb4a9('0x29')]();};}function saveUpdates(_0x438264,_0x104202){return function(_0xa237df){if(_0xa237df){return _0xa237df[_0xb4a9('0x2a')](_0x438264)[_0xb4a9('0x2b')](function(_0x125b48){return _0x125b48;});}return null;};}function removeEntity(_0x284ef7,_0x20e07c){return function(_0x5c854d){if(_0x5c854d){return _0x5c854d[_0xb4a9('0x2c')]()[_0xb4a9('0x2b')](function(){var _0x113b32=_0x5c854d['get']({'plain':!![]});var _0x6a8926=_0xb4a9('0x2d');return db[_0xb4a9('0x2e')]['destroy']({'where':{'type':_0x6a8926,'resourceId':_0x113b32['id']}})[_0xb4a9('0x2b')](function(){return _0x5c854d;});})[_0xb4a9('0x2b')](function(){_0x284ef7[_0xb4a9('0x20')](0xcc)[_0xb4a9('0x2f')]();});}};}function handleEntityNotFound(_0x532200,_0x312a44){return function(_0x4be2b7){if(!_0x4be2b7){_0x532200[_0xb4a9('0x30')](0x194);}return _0x4be2b7;};}function handleError(_0x2980d6,_0x45cd3b){_0x45cd3b=_0x45cd3b||0x1f4;return function(_0x97d333){logger['error'](_0x97d333[_0xb4a9('0x31')]);if(_0x97d333['name']){delete _0x97d333[_0xb4a9('0x32')];}_0x2980d6[_0xb4a9('0x20')](_0x45cd3b)[_0xb4a9('0x33')](_0x97d333);};}exports[_0xb4a9('0x34')]=function(_0x53707c,_0x5bb68d){var _0x528d8d={},_0x38f689={},_0x17cbca={'count':0x0,'rows':[]};var _0x4ae6f9=_[_0xb4a9('0x35')](db[_0xb4a9('0x36')]['rawAttributes'],function(_0x252eee){return{'name':_0x252eee[_0xb4a9('0x37')],'type':_0x252eee[_0xb4a9('0x38')]['key']};});_0x38f689[_0xb4a9('0x39')]=_['map'](_0x4ae6f9,'name');_0x38f689[_0xb4a9('0x3a')]=_[_0xb4a9('0x3b')](_0x53707c[_0xb4a9('0x3a')]);_0x38f689[_0xb4a9('0x3c')]=_[_0xb4a9('0x3d')](_0x38f689['model'],_0x38f689[_0xb4a9('0x3a')]);_0x528d8d['attributes']=_[_0xb4a9('0x3d')](_0x38f689[_0xb4a9('0x39')],qs['fields'](_0x53707c[_0xb4a9('0x3a')]['fields']));_0x528d8d[_0xb4a9('0x3e')]=_0x528d8d[_0xb4a9('0x3e')][_0xb4a9('0x3f')]?_0x528d8d[_0xb4a9('0x3e')]:_0x38f689[_0xb4a9('0x39')];if(!_0x53707c[_0xb4a9('0x3a')]['hasOwnProperty'](_0xb4a9('0x40'))){_0x528d8d[_0xb4a9('0x23')]=qs[_0xb4a9('0x23')](_0x53707c[_0xb4a9('0x3a')][_0xb4a9('0x23')]);_0x528d8d[_0xb4a9('0x21')]=qs[_0xb4a9('0x21')](_0x53707c[_0xb4a9('0x3a')][_0xb4a9('0x21')]);}_0x528d8d[_0xb4a9('0x41')]=qs[_0xb4a9('0x42')](_0x53707c['query'][_0xb4a9('0x42')]);_0x528d8d[_0xb4a9('0x43')]=qs[_0xb4a9('0x3c')](_[_0xb4a9('0x44')](_0x53707c[_0xb4a9('0x3a')],_0x38f689[_0xb4a9('0x3c')]),_0x4ae6f9);if(_0x53707c[_0xb4a9('0x3a')]['filter']){_0x528d8d['where']=_['merge'](_0x528d8d[_0xb4a9('0x43')],{'$or':_[_0xb4a9('0x35')](_0x4ae6f9,function(_0x126c80){if(_0x126c80[_0xb4a9('0x38')]!==_0xb4a9('0x45')){var _0x4fbb08={};_0x4fbb08[_0x126c80[_0xb4a9('0x32')]]={'$like':'%'+_0x53707c[_0xb4a9('0x3a')]['filter']+'%'};return _0x4fbb08;}})});}_0x528d8d=_[_0xb4a9('0x46')]({},_0x528d8d,_0x53707c[_0xb4a9('0x47')]);var _0x400a7c={'where':_0x528d8d[_0xb4a9('0x43')]};return db[_0xb4a9('0x36')]['count'](_0x400a7c)[_0xb4a9('0x2b')](function(_0x44dd42){_0x17cbca[_0xb4a9('0x24')]=_0x44dd42;if(_0x53707c[_0xb4a9('0x3a')][_0xb4a9('0x48')]){_0x528d8d['include']=[{'all':!![]}];}return db[_0xb4a9('0x36')][_0xb4a9('0x49')](_0x528d8d);})[_0xb4a9('0x2b')](function(_0x344bc5){_0x17cbca[_0xb4a9('0x4a')]=_0x344bc5;return _0x17cbca;})[_0xb4a9('0x2b')](respondWithFilteredResult(_0x5bb68d,_0x528d8d))['catch'](handleError(_0x5bb68d,null));};exports[_0xb4a9('0x4b')]=function(_0x448c29,_0x21698c){var _0x4ef095={'raw':!![],'where':{'id':_0x448c29[_0xb4a9('0x4c')]['id']}},_0x15bf3f={};_0x15bf3f[_0xb4a9('0x39')]=_[_0xb4a9('0x3b')](db['Plugin'][_0xb4a9('0x4d')]);_0x15bf3f[_0xb4a9('0x3a')]=_[_0xb4a9('0x3b')](_0x448c29[_0xb4a9('0x3a')]);_0x15bf3f[_0xb4a9('0x3c')]=_[_0xb4a9('0x3d')](_0x15bf3f[_0xb4a9('0x39')],_0x15bf3f[_0xb4a9('0x3a')]);_0x4ef095[_0xb4a9('0x3e')]=_['intersection'](_0x15bf3f[_0xb4a9('0x39')],qs[_0xb4a9('0x4e')](_0x448c29[_0xb4a9('0x3a')][_0xb4a9('0x4e')]));_0x4ef095[_0xb4a9('0x3e')]=_0x4ef095[_0xb4a9('0x3e')][_0xb4a9('0x3f')]?_0x4ef095[_0xb4a9('0x3e')]:_0x15bf3f[_0xb4a9('0x39')];if(_0x448c29[_0xb4a9('0x3a')][_0xb4a9('0x48')]){_0x4ef095[_0xb4a9('0x4f')]=[{'all':!![]}];}_0x4ef095=_[_0xb4a9('0x46')]({},_0x4ef095,_0x448c29[_0xb4a9('0x47')]);return db['Plugin'][_0xb4a9('0x50')](_0x4ef095)[_0xb4a9('0x2b')](handleEntityNotFound(_0x21698c,null))[_0xb4a9('0x2b')](respondWithResult(_0x21698c,null))[_0xb4a9('0x51')](handleError(_0x21698c,null));};exports['download']=function(_0x141901,_0x1c3760,_0x8eb10c){return db[_0xb4a9('0x36')][_0xb4a9('0x50')]({'where':{'id':_0x141901[_0xb4a9('0x4c')]['id']},'attributes':[_0xb4a9('0x32'),_0xb4a9('0x7')],'raw':!![]})[_0xb4a9('0x2b')](handleEntityNotFound(_0x1c3760,null))[_0xb4a9('0x2b')](function(_0x2f54c8){if(_0x2f54c8){var _0x2e26f3=path['join'](config[_0xb4a9('0x52')],_0xb4a9('0x53'),util[_0xb4a9('0x54')](_0xb4a9('0x55'),path[_0xb4a9('0x56')](_0x2f54c8[_0xb4a9('0x7')])));var _0xe5dc59=fs[_0xb4a9('0x57')](_0x2e26f3);var _0x2c6c3d=archiver('zip',{'zlib':{'level':0x9}});_0x2c6c3d['on'](_0xb4a9('0x58'),function(_0x1ac9d7){if(_0x1ac9d7['code']===_0xb4a9('0x59')){logger[_0xb4a9('0x5a')](_0x1ac9d7);}else{throw new db['Sequelize'][(_0xb4a9('0x5b'))](_0xb4a9('0x5c'));}});_0x2c6c3d['on']('error',function(_0xea5788){throw new db[(_0xb4a9('0x5d'))][(_0xb4a9('0x5b'))](_0xb4a9('0x5c'));});_0x2c6c3d[_0xb4a9('0x5e')](_0xe5dc59);_0x2c6c3d[_0xb4a9('0x5f')](_0xb4a9('0x60'),{'cwd':path[_0xb4a9('0x61')](config[_0xb4a9('0x52')],'server/files/plugins',path[_0xb4a9('0x62')](_0x2f54c8['path'])),'ignore':[path['join'](path[_0xb4a9('0x56')](_0x2f54c8[_0xb4a9('0x7')]),'node_modules/**/*'),path[_0xb4a9('0x61')](path['basename'](_0x2f54c8[_0xb4a9('0x7')]),_0xb4a9('0x63'))],'nodir':!![]})[_0xb4a9('0x64')]();_0xe5dc59['on']('close',function(){if(!fs[_0xb4a9('0x65')](_0x2e26f3)){throw new db['Sequelize'][(_0xb4a9('0x5b'))]('Plugin\x20not\x20found');}return _0x1c3760[_0xb4a9('0x66')](_0x2e26f3,util['format'](_0xb4a9('0x55'),path['basename'](_0x2f54c8[_0xb4a9('0x7')])),function(_0x2b30ab){if(_0x2b30ab){throw new db['Sequelize'][(_0xb4a9('0x5b'))](_0xb4a9('0x67'));}fs[_0xb4a9('0x68')](_0x2e26f3);logger[_0xb4a9('0x69')]('Download\x20completed');logger[_0xb4a9('0x69')](_0xb4a9('0x6a'));});});}return null;})['catch'](handleError(_0x1c3760,null));};exports['upload']=function(_0x594324,_0x49333d,_0xc46726){var _0x469982=path['basename'](_0x594324[_0xb4a9('0x6b')][_0xb4a9('0x6c')],path[_0xb4a9('0x6d')](_0x594324[_0xb4a9('0x6b')][_0xb4a9('0x6c')]));var _0x803380=path[_0xb4a9('0x61')](config[_0xb4a9('0x52')],_0xb4a9('0x53'),_0x594324[_0xb4a9('0x6b')][_0xb4a9('0x6c')]);var _0x202676=path[_0xb4a9('0x61')](config[_0xb4a9('0x52')],_0xb4a9('0x53'),_0x469982);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x803380);logger['info'](_0xb4a9('0x6e'),_0x202676);try{fs[_0xb4a9('0x6f')](_0x803380,parseInt(_0xb4a9('0x70'),0x8));extract(_0x803380,{'dir':_0x202676},function(_0x471268){if(_0x471268){logger[_0xb4a9('0x5a')](_0x471268);handleError(_0x471268,!![]);};var _0x48762f=fs[_0xb4a9('0x71')](_0x202676);if(_0x48762f[_0xb4a9('0x3f')]>0x1){removeReferences(_0x803380,_0x202676);logger[_0xb4a9('0x5a')](_0xb4a9('0x72'));return _0xc46726(new Error(_0xb4a9('0x72')));}var _0x15f825=fs[_0xb4a9('0x73')](path[_0xb4a9('0x61')](_0x202676,_0x48762f[0x0]));if(_0x15f825[_0xb4a9('0x74')]()){removeReferences(_0x803380,_0x202676);logger[_0xb4a9('0x5a')](_0xb4a9('0x72'));return _0xc46726(new Error('Invalid\x20plugin\x20structure'));}if(_0x15f825[_0xb4a9('0x75')]()){var _0x27f7f3=fs['readdirSync'](path[_0xb4a9('0x61')](_0x202676,_0x48762f[0x0]));if(_0x27f7f3[_0xb4a9('0x3f')]===0x0){removeReferences(_0x803380,_0x202676);logger['error'](_0xb4a9('0x72'));return _0xc46726(new Error(_0xb4a9('0x72')));}var _0xdd982=_0x27f7f3[_0xb4a9('0x76')](function(_0x2aa019){return _0x2aa019===_0xb4a9('0x77');});if(!_0xdd982){return _0xc46726(new Error('Plugin\x20manifest\x20missing'));}var _0x31f501=fs[_0xb4a9('0x78')](path['join'](_0x202676,_0x48762f[0x0],_0xb4a9('0x77')));var _0x354f28=JSON[_0xb4a9('0x79')](_0x31f501);if(_0xb4a9('0x22')==typeof _0x354f28['name']){return _0xc46726(new Error(_0xb4a9('0x7a')));}if(_0xb4a9('0x22')==typeof _0x354f28['type']){return _0xc46726(new Error(_0xb4a9('0x7b')));}if(_0xb4a9('0x22')==typeof _0x354f28[_0xb4a9('0x7c')]){return _0xc46726(new Error(_0xb4a9('0x7d')));}if('undefined'==typeof _0x354f28[_0xb4a9('0x7e')]){return _0xc46726(new Error(_0xb4a9('0x7f')));}if(_0x354f28['type']===_0xb4a9('0x80')){if(_0xb4a9('0x22')==typeof _0x354f28['parameters'][_0xb4a9('0x81')]){return _0xc46726(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xb4a9('0x22')==typeof _0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x81')][_0xb4a9('0x82')]&&_0xb4a9('0x22')==typeof _0x354f28[_0xb4a9('0x7e')]['views'][_0xb4a9('0x83')]){return _0xc46726(new Error(_0xb4a9('0x84')));}}else if(_0x354f28[_0xb4a9('0x38')]===_0xb4a9('0x85')){if(_0xb4a9('0x22')==typeof _0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x86')]){return _0xc46726(new Error(_0xb4a9('0x87')));}if(_0xb4a9('0x22')==typeof _0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x88')]){return _0xc46726(new Error(_0xb4a9('0x89')));}}else{return _0xc46726(new Error(_0xb4a9('0x8a')));}var _0x13c2e8=_0x354f28[_0xb4a9('0x32')];var _0x83f49d=_0x354f28[_0xb4a9('0x8b')];var _0x3eab57=_0x354f28['type'];var _0x1b5870=_0x354f28[_0xb4a9('0x8c')]?_0x354f28[_0xb4a9('0x8c')]:_0xb4a9('0x8d');var _0x1fcc03=_0x354f28[_0xb4a9('0x8e')]?_0x354f28[_0xb4a9('0x8e')]:_0xb4a9('0x8f');var _0x8eef51='';var _0x4ac625='';var _0x45cfa2='';var _0x50f235='';var _0x5d753e=_0x354f28[_0xb4a9('0x7c')];if(_0x3eab57===_0xb4a9('0x80')){if(_0xb4a9('0x22')!=typeof _0x354f28[_0xb4a9('0x7e')]['views'][_0xb4a9('0x82')]){var _0x359725=_0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb4a9('0x90')](_0x359725)){_0x8eef51=path[_0xb4a9('0x61')]('plugins',_0x469982,_0x48762f[0x0],_0x359725);}else{_0x8eef51=_0x359725;}}else{logger[_0xb4a9('0x69')](_0xb4a9('0x91'));}if('undefined'!=typeof _0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x81')]['agent']){var _0x480fca=_0x354f28['parameters'][_0xb4a9('0x81')][_0xb4a9('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x480fca)){_0x4ac625=path[_0xb4a9('0x61')](_0xb4a9('0x92'),_0x469982,_0x48762f[0x0],_0x480fca);}else{_0x4ac625=_0x480fca;}}else{logger[_0xb4a9('0x69')](_0xb4a9('0x93'));}}else if(_0x3eab57===_0xb4a9('0x85')){_0x45cfa2=_0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x86')];_0x50f235=_0x354f28[_0xb4a9('0x7e')]['scriptPath'];if('undefined'!=typeof _0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x81')]){if(_0xb4a9('0x22')!=typeof _0x354f28['parameters']['views']['admin']){var _0x359725=_0x354f28['parameters'][_0xb4a9('0x81')][_0xb4a9('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x359725)){_0x8eef51=path[_0xb4a9('0x61')](_0xb4a9('0x92'),_0x469982,_0x48762f[0x0],_0x359725);}else{_0x8eef51=_0x359725;}}if('undefined'!=typeof _0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x81')][_0xb4a9('0x83')]){var _0x480fca=_0x354f28[_0xb4a9('0x7e')][_0xb4a9('0x81')][_0xb4a9('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xb4a9('0x90')](_0x480fca)){_0x4ac625=path[_0xb4a9('0x61')]('plugins',_0x469982,_0x48762f[0x0],_0x480fca);}else{_0x4ac625=_0x480fca;}}}}var _0xbb84c6={'name':_0x13c2e8,'description':_0x83f49d,'path':path[_0xb4a9('0x61')](_0x469982,_0x48762f[0x0]),'type':_0x3eab57,'sidebar':_0x1b5870,'icon':_0x1fcc03,'adminUrl':_0x8eef51,'agentUrl':_0x4ac625,'scriptName':_0x45cfa2,'scriptPath':_0x50f235,'version':_0x5d753e};removeReferences(_0x803380,null);return db[_0xb4a9('0x36')]['create'](_0xbb84c6)[_0xb4a9('0x2b')](function(_0x33cbf2){var _0x5287d3={'role':_0x594324[_0xb4a9('0x94')][_0xb4a9('0x95')],'userProfileId':_0x594324[_0xb4a9('0x94')][_0xb4a9('0x96')]};if(!_0x5287d3)throw new Error(_0xb4a9('0x97'));if(_0x5287d3[_0xb4a9('0x95')]===_0xb4a9('0x98')){var _0x2ee889=_0x33cbf2['get']({'plain':!![]});return db[_0xb4a9('0x99')][_0xb4a9('0x50')]({'where':{'name':_0xb4a9('0x2d'),'userProfileId':_0x5287d3[_0xb4a9('0x96')]},'raw':!![]})[_0xb4a9('0x2b')](function(_0x3ae3cd){if(_0x3ae3cd&&_0x3ae3cd['autoAssociation']===0x0){return db[_0xb4a9('0x2e')]['create']({'name':_0x2ee889[_0xb4a9('0x32')],'resourceId':_0x2ee889['id'],'type':_0x3ae3cd['name'],'sectionId':_0x3ae3cd['id']},{})[_0xb4a9('0x2b')](function(){return _0x33cbf2;});}else{return _0x33cbf2;}})[_0xb4a9('0x51')](function(_0xf336f7){logger[_0xb4a9('0x5a')](_0xb4a9('0x9a'),_0xf336f7);throw _0xf336f7;});}return _0x33cbf2;})[_0xb4a9('0x2b')](respondWithResult(_0x49333d,null))[_0xb4a9('0x51')](handleError(_0x49333d,null));}});}catch(_0x4d6a61){_0x49333d['status'](0x1f4)[_0xb4a9('0x33')](_0x4d6a61);}};function removeReferences(_0x5e9989,_0x75c0ea){try{if(_0x5e9989){fs['unlinkSync'](_0x5e9989);logger[_0xb4a9('0x69')](_0xb4a9('0x9b'));}if(_0x75c0ea){rimraf(_0x75c0ea,function(){});logger[_0xb4a9('0x69')](_0xb4a9('0x9c'));}}catch(_0x5f1b8a){logger['error'](_0x5f1b8a);}}exports[_0xb4a9('0x2a')]=function(_0x3a58d9,_0x2535fe,_0x1feb13){return db[_0xb4a9('0x36')][_0xb4a9('0x50')]({'where':{'id':_0x3a58d9[_0xb4a9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2535fe,null))[_0xb4a9('0x2b')](saveUpdates(_0x3a58d9[_0xb4a9('0x94')],null))[_0xb4a9('0x2b')](respondWithResult(_0x2535fe,null))[_0xb4a9('0x51')](handleError(_0x2535fe,null));};exports[_0xb4a9('0x9d')]=function(_0xf5144c,_0x46ec9a,_0x4c72dc){return db['Plugin'][_0xb4a9('0x50')]({'where':{'id':_0xf5144c[_0xb4a9('0x4c')]['id']}})[_0xb4a9('0x2b')](function(_0x31d9f5){if(_0x31d9f5){return _0x31d9f5[_0xb4a9('0x2c')]();}})[_0xb4a9('0x2b')](function(_0x39efdb){rimraf(path[_0xb4a9('0x61')](config[_0xb4a9('0x52')],_0xb4a9('0x53'),path[_0xb4a9('0x62')](_0x39efdb['path'])),function(){});return _0x39efdb;})[_0xb4a9('0x2b')](handleEntityNotFound(_0x46ec9a,null))[_0xb4a9('0x2b')](respondWithStatusCode(_0x46ec9a,null))[_0xb4a9('0x51')](handleError(_0x46ec9a,null));};exports[_0xb4a9('0x9e')]=function(_0x55ad1a,_0x4fe942,_0x25afc7){return BPromise[_0xb4a9('0x9f')]()[_0xb4a9('0x2b')](function(){if(!_0x55ad1a[_0xb4a9('0x3a')][_0xb4a9('0x7')]){throw new Error(_0xb4a9('0xa0'));}if(!_0x55ad1a[_0xb4a9('0x3a')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x49be15=_0x55ad1a[_0xb4a9('0x3a')][_0xb4a9('0xa1')]?_0x55ad1a[_0xb4a9('0x3a')][_0xb4a9('0xa1')]+':'+_0x55ad1a['query'][_0xb4a9('0xa2')]:_0xb4a9('0xa3')+_0x55ad1a[_0xb4a9('0x3a')]['port'];var _0x100062=_0x55ad1a[_0xb4a9('0x3a')]['json']?_0x55ad1a[_0xb4a9('0x3a')][_0xb4a9('0x26')]:!![];var _0x442782=_0x55ad1a[_0xb4a9('0x3a')][_0xb4a9('0xa4')]?_0x55ad1a['query'][_0xb4a9('0xa4')]:null;var _0x537c92={'method':_0x55ad1a[_0xb4a9('0xa5')],'uri':util[_0xb4a9('0x54')](_0xb4a9('0xa6'),_0x49be15,_0x55ad1a['query'][_0xb4a9('0x7')]),'json':_0x100062,'resolveWithFullResponse':!![],'encoding':_0x442782,'qs':_0x55ad1a[_0xb4a9('0x3a')]};if(_0x55ad1a[_0xb4a9('0xa7')]){_0x537c92['headers']=_0x55ad1a[_0xb4a9('0xa7')];if(_0x537c92[_0xb4a9('0xa7')][_0xb4a9('0xa8')]){delete _0x537c92[_0xb4a9('0xa7')][_0xb4a9('0xa8')];}}if(_0x537c92['headers'][_0xb4a9('0xa9')]){delete _0x537c92[_0xb4a9('0xa7')][_0xb4a9('0xa9')];}return rp(_0x537c92);})[_0xb4a9('0x2b')](function(_0x2bd707){if(_0x2bd707){_0x4fe942[_0xb4a9('0xaa')](_0x2bd707['headers']);logger[_0xb4a9('0x69')](_0x2bd707[_0xb4a9('0x94')]);if(_[_0xb4a9('0xab')](_0x55ad1a['query'][_0xb4a9('0x7')],'download')&&_0x2bd707[_0xb4a9('0xac')]==0x1f4){return _0x4fe942[_0xb4a9('0x30')](_0x2bd707[_0xb4a9('0xac')]);}else{return _0x4fe942[_0xb4a9('0x20')](_0x2bd707[_0xb4a9('0xac')])[_0xb4a9('0x33')](_0x2bd707[_0xb4a9('0x94')]);}}else{return _0x4fe942[_0xb4a9('0x30')](0xc8);}})['catch'](handleError(_0x4fe942,null));};exports[_0xb4a9('0xad')]=function(_0xcb3482,_0x5ac29f,_0x2e5d1b){return BPromise[_0xb4a9('0x9f')]()[_0xb4a9('0x2b')](function(){if(!_0xcb3482[_0xb4a9('0x3a')]['path']){throw new Error(_0xb4a9('0xa0'));}if(!_0xcb3482['query'][_0xb4a9('0xa2')]){throw new Error(_0xb4a9('0xae'));}var _0x38170d=_0xcb3482[_0xb4a9('0x3a')]['hostname']?_0xcb3482['query'][_0xb4a9('0xa1')]+':'+_0xcb3482[_0xb4a9('0x3a')]['port']:_0xb4a9('0xa3')+_0xcb3482[_0xb4a9('0x3a')]['port'];var _0xff88a3=_0xcb3482[_0xb4a9('0x3a')][_0xb4a9('0x26')]?_0xcb3482[_0xb4a9('0x3a')][_0xb4a9('0x26')]:!![];var _0x4cc022=_0xcb3482[_0xb4a9('0x3a')][_0xb4a9('0xa4')]?_0xcb3482[_0xb4a9('0x3a')][_0xb4a9('0xa4')]:null;var _0x61c9d3={'method':_0xcb3482[_0xb4a9('0xa5')],'uri':util[_0xb4a9('0x54')]('%s%s',_0x38170d,_0xcb3482[_0xb4a9('0x3a')][_0xb4a9('0x7')]),'json':_0xff88a3,'resolveWithFullResponse':!![],'encoding':_0x4cc022,'body':_0xcb3482[_0xb4a9('0x94')]};if(_0xcb3482[_0xb4a9('0xa7')]){_0x61c9d3['headers']=_0xcb3482[_0xb4a9('0xa7')];if(_0x61c9d3[_0xb4a9('0xa7')][_0xb4a9('0xa8')]){delete _0x61c9d3['headers'][_0xb4a9('0xa8')];}}if(_0x61c9d3[_0xb4a9('0xa7')][_0xb4a9('0xa9')]){delete _0x61c9d3[_0xb4a9('0xa7')]['content-type'];}return rp(_0x61c9d3);})['then'](function(_0x1837ab){if(_0x1837ab){_0x5ac29f[_0xb4a9('0xaa')](_0x1837ab[_0xb4a9('0xa7')]);logger[_0xb4a9('0x69')](_0x1837ab[_0xb4a9('0x94')]);return _0x5ac29f[_0xb4a9('0x20')](_0x1837ab[_0xb4a9('0xac')])[_0xb4a9('0x33')](_0x1837ab[_0xb4a9('0x94')]);}else{return _0x5ac29f[_0xb4a9('0x30')](0xc8);}})[_0xb4a9('0x51')](handleError(_0x5ac29f,null));}; \ No newline at end of file +var _0x99a1=['0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','type','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','test','plugins','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Plugins','sendStatus','stack','name','send','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','Plugin','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','download','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','**/*','join','root','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync'];(function(_0x200a9b,_0x2f3fec){var _0x477efb=function(_0x26d777){while(--_0x26d777){_0x200a9b['push'](_0x200a9b['shift']());}};_0x477efb(++_0x2f3fec);}(_0x99a1,0x1a3));var _0x199a=function(_0x2ded45,_0x4d9a2c){_0x2ded45=_0x2ded45-0x0;var _0x983328=_0x99a1[_0x2ded45];return _0x983328;};'use strict';var emlformat=require(_0x199a('0x0'));var rimraf=require(_0x199a('0x1'));var zipdir=require(_0x199a('0x2'));var jsonpatch=require(_0x199a('0x3'));var rp=require(_0x199a('0x4'));var moment=require('moment');var BPromise=require(_0x199a('0x5'));var Mustache=require(_0x199a('0x6'));var util=require('util');var path=require(_0x199a('0x7'));var sox=require(_0x199a('0x8'));var csv=require(_0x199a('0x9'));var ejs=require(_0x199a('0xa'));var fs=require('fs');var fs_extra=require(_0x199a('0xb'));var _=require(_0x199a('0xc'));var squel=require('squel');var crypto=require(_0x199a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x199a('0x9'));var querystring=require(_0x199a('0xe'));var Papa=require(_0x199a('0xf'));var extract=require(_0x199a('0x10'));var rimraf=require(_0x199a('0x1'));var archiver=require('archiver');var Redis=require(_0x199a('0x11'));var authService=require(_0x199a('0x12'));var qs=require(_0x199a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x199a('0x14'));var logger=require(_0x199a('0x15'))(_0x199a('0x16'));var utils=require(_0x199a('0x17'));var config=require(_0x199a('0x18'));var licenseUtil=require(_0x199a('0x19'));var db=require(_0x199a('0x1a'))['db'];config['redis']=_[_0x199a('0x1b')](config[_0x199a('0x1c')],{'host':_0x199a('0x1d'),'port':0x18eb});var socket=require(_0x199a('0x1e'))(new Redis(config['redis']));require(_0x199a('0x1f'))[_0x199a('0x20')](socket);function respondWithStatusCode(_0x15a41b,_0x1c079b){_0x1c079b=_0x1c079b||0xcc;return function(_0x17f142){if(_0x17f142){return _0x15a41b['sendStatus'](_0x1c079b);}return _0x15a41b[_0x199a('0x21')](_0x1c079b)[_0x199a('0x22')]();};}function respondWithResult(_0x4bc742,_0x3d45e2){_0x3d45e2=_0x3d45e2||0xc8;return function(_0x23b306){if(_0x23b306){return _0x4bc742[_0x199a('0x21')](_0x3d45e2)[_0x199a('0x23')](_0x23b306);}};}function respondWithFilteredResult(_0x596daf,_0x56c626){return function(_0x2ac5f1){if(_0x2ac5f1){var _0x26f1a6=typeof _0x56c626[_0x199a('0x24')]===_0x199a('0x25')&&typeof _0x56c626[_0x199a('0x26')]==='undefined';var _0x3e6cfb=_0x2ac5f1['count'];var _0x21401=_0x26f1a6?0x0:_0x56c626[_0x199a('0x24')];var _0x5d4ea8=_0x26f1a6?_0x2ac5f1[_0x199a('0x27')]:_0x56c626[_0x199a('0x24')]+_0x56c626['limit'];var _0x5c6cff;if(_0x5d4ea8>=_0x3e6cfb){_0x5d4ea8=_0x3e6cfb;_0x5c6cff=0xc8;}else{_0x5c6cff=0xce;}_0x596daf[_0x199a('0x21')](_0x5c6cff);return _0x596daf[_0x199a('0x28')](_0x199a('0x29'),_0x21401+'-'+_0x5d4ea8+'/'+_0x3e6cfb)['json'](_0x2ac5f1);}return null;};}function patchUpdates(_0xcd1160){return function(_0x342c6d){try{jsonpatch['apply'](_0x342c6d,_0xcd1160,!![]);}catch(_0x24ebfb){return BPromise[_0x199a('0x2a')](_0x24ebfb);}return _0x342c6d[_0x199a('0x2b')]();};}function saveUpdates(_0x466932,_0x1a1991){return function(_0x198aac){if(_0x198aac){return _0x198aac[_0x199a('0x2c')](_0x466932)[_0x199a('0x2d')](function(_0x3e7b80){return _0x3e7b80;});}return null;};}function removeEntity(_0x1185ae,_0x53f856){return function(_0x359309){if(_0x359309){return _0x359309[_0x199a('0x2e')]()[_0x199a('0x2d')](function(){var _0x48220f=_0x359309[_0x199a('0x2f')]({'plain':!![]});var _0x14e501=_0x199a('0x30');return db['UserProfileResource'][_0x199a('0x2e')]({'where':{'type':_0x14e501,'resourceId':_0x48220f['id']}})['then'](function(){return _0x359309;});})['then'](function(){_0x1185ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f305,_0x1efc93){return function(_0x2e808c){if(!_0x2e808c){_0x51f305[_0x199a('0x31')](0x194);}return _0x2e808c;};}function handleError(_0x4fb8e9,_0x3f4c60){_0x3f4c60=_0x3f4c60||0x1f4;return function(_0x2b6fe4){logger['error'](_0x2b6fe4[_0x199a('0x32')]);if(_0x2b6fe4[_0x199a('0x33')]){delete _0x2b6fe4['name'];}_0x4fb8e9[_0x199a('0x21')](_0x3f4c60)[_0x199a('0x34')](_0x2b6fe4);};}exports[_0x199a('0x35')]=function(_0x3e45be,_0xf9d444){var _0x66befd={},_0x1c408c={},_0x8bcc5b={'count':0x0,'rows':[]};var _0x4dc740=_[_0x199a('0x36')](db['Plugin']['rawAttributes'],function(_0x3f63d2){return{'name':_0x3f63d2[_0x199a('0x37')],'type':_0x3f63d2['type'][_0x199a('0x38')]};});_0x1c408c['model']=_[_0x199a('0x36')](_0x4dc740,_0x199a('0x33'));_0x1c408c[_0x199a('0x39')]=_[_0x199a('0x3a')](_0x3e45be[_0x199a('0x39')]);_0x1c408c['filters']=_[_0x199a('0x3b')](_0x1c408c[_0x199a('0x3c')],_0x1c408c[_0x199a('0x39')]);_0x66befd[_0x199a('0x3d')]=_[_0x199a('0x3b')](_0x1c408c[_0x199a('0x3c')],qs[_0x199a('0x3e')](_0x3e45be[_0x199a('0x39')][_0x199a('0x3e')]));_0x66befd[_0x199a('0x3d')]=_0x66befd[_0x199a('0x3d')][_0x199a('0x3f')]?_0x66befd[_0x199a('0x3d')]:_0x1c408c[_0x199a('0x3c')];if(!_0x3e45be['query'][_0x199a('0x40')](_0x199a('0x41'))){_0x66befd[_0x199a('0x26')]=qs[_0x199a('0x26')](_0x3e45be[_0x199a('0x39')][_0x199a('0x26')]);_0x66befd[_0x199a('0x24')]=qs['offset'](_0x3e45be[_0x199a('0x39')][_0x199a('0x24')]);}_0x66befd['order']=qs[_0x199a('0x42')](_0x3e45be[_0x199a('0x39')][_0x199a('0x42')]);_0x66befd[_0x199a('0x43')]=qs['filters'](_['pick'](_0x3e45be[_0x199a('0x39')],_0x1c408c[_0x199a('0x44')]),_0x4dc740);if(_0x3e45be[_0x199a('0x39')][_0x199a('0x45')]){_0x66befd['where']=_[_0x199a('0x46')](_0x66befd[_0x199a('0x43')],{'$or':_[_0x199a('0x36')](_0x4dc740,function(_0x100fc6){if(_0x100fc6['type']!==_0x199a('0x47')){var _0x20cfa1={};_0x20cfa1[_0x100fc6[_0x199a('0x33')]]={'$like':'%'+_0x3e45be[_0x199a('0x39')][_0x199a('0x45')]+'%'};return _0x20cfa1;}})});}_0x66befd=_[_0x199a('0x46')]({},_0x66befd,_0x3e45be[_0x199a('0x48')]);var _0x18ecc1={'where':_0x66befd[_0x199a('0x43')]};return db[_0x199a('0x49')][_0x199a('0x27')](_0x18ecc1)['then'](function(_0x496fd5){_0x8bcc5b[_0x199a('0x27')]=_0x496fd5;if(_0x3e45be[_0x199a('0x39')]['includeAll']){_0x66befd['include']=[{'all':!![]}];}return db[_0x199a('0x49')][_0x199a('0x4a')](_0x66befd);})[_0x199a('0x2d')](function(_0x3bbef1){_0x8bcc5b[_0x199a('0x4b')]=_0x3bbef1;return _0x8bcc5b;})['then'](respondWithFilteredResult(_0xf9d444,_0x66befd))[_0x199a('0x4c')](handleError(_0xf9d444,null));};exports[_0x199a('0x4d')]=function(_0x528980,_0x13dee3){var _0x2b9fbb={'raw':!![],'where':{'id':_0x528980[_0x199a('0x4e')]['id']}},_0x4ee211={};_0x4ee211[_0x199a('0x3c')]=_[_0x199a('0x3a')](db[_0x199a('0x49')][_0x199a('0x4f')]);_0x4ee211[_0x199a('0x39')]=_['keys'](_0x528980['query']);_0x4ee211[_0x199a('0x44')]=_[_0x199a('0x3b')](_0x4ee211[_0x199a('0x3c')],_0x4ee211[_0x199a('0x39')]);_0x2b9fbb[_0x199a('0x3d')]=_[_0x199a('0x3b')](_0x4ee211[_0x199a('0x3c')],qs[_0x199a('0x3e')](_0x528980[_0x199a('0x39')][_0x199a('0x3e')]));_0x2b9fbb['attributes']=_0x2b9fbb[_0x199a('0x3d')]['length']?_0x2b9fbb[_0x199a('0x3d')]:_0x4ee211[_0x199a('0x3c')];if(_0x528980[_0x199a('0x39')][_0x199a('0x50')]){_0x2b9fbb[_0x199a('0x51')]=[{'all':!![]}];}_0x2b9fbb=_[_0x199a('0x46')]({},_0x2b9fbb,_0x528980['options']);return db[_0x199a('0x49')][_0x199a('0x52')](_0x2b9fbb)['then'](handleEntityNotFound(_0x13dee3,null))[_0x199a('0x2d')](respondWithResult(_0x13dee3,null))[_0x199a('0x4c')](handleError(_0x13dee3,null));};exports[_0x199a('0x53')]=function(_0x331a63,_0x23649c,_0x53f0ea){return db[_0x199a('0x49')][_0x199a('0x52')]({'where':{'id':_0x331a63[_0x199a('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0x199a('0x2d')](handleEntityNotFound(_0x23649c,null))[_0x199a('0x2d')](function(_0x4a6202){if(_0x4a6202){var _0x975e37=path['join'](config['root'],_0x199a('0x54'),util[_0x199a('0x55')](_0x199a('0x56'),path['basename'](_0x4a6202[_0x199a('0x7')])));var _0x35623e=fs[_0x199a('0x57')](_0x975e37);var _0x184422=archiver(_0x199a('0x58'),{'zlib':{'level':0x9}});_0x184422['on'](_0x199a('0x59'),function(_0x1f5d8d){if(_0x1f5d8d['code']===_0x199a('0x5a')){logger[_0x199a('0x5b')](_0x1f5d8d);}else{throw new db['Sequelize'][(_0x199a('0x5c'))](_0x199a('0x5d'));}});_0x184422['on'](_0x199a('0x5b'),function(_0x34d924){throw new db[(_0x199a('0x5e'))][(_0x199a('0x5c'))](_0x199a('0x5d'));});_0x184422['pipe'](_0x35623e);_0x184422[_0x199a('0x5f')](_0x199a('0x60'),{'cwd':path[_0x199a('0x61')](config[_0x199a('0x62')],'server/files/plugins',path['dirname'](_0x4a6202[_0x199a('0x7')])),'ignore':[path[_0x199a('0x61')](path[_0x199a('0x63')](_0x4a6202[_0x199a('0x7')]),_0x199a('0x64')),path['join'](path[_0x199a('0x63')](_0x4a6202[_0x199a('0x7')]),_0x199a('0x65'))],'nodir':!![]})[_0x199a('0x66')]();_0x35623e['on'](_0x199a('0x67'),function(){if(!fs[_0x199a('0x68')](_0x975e37)){throw new db[(_0x199a('0x5e'))][(_0x199a('0x5c'))]('Plugin\x20not\x20found');}return _0x23649c['download'](_0x975e37,util[_0x199a('0x55')](_0x199a('0x56'),path[_0x199a('0x63')](_0x4a6202[_0x199a('0x7')])),function(_0x3563c6){if(_0x3563c6){throw new db[(_0x199a('0x5e'))][(_0x199a('0x5c'))](_0x199a('0x69'));}fs[_0x199a('0x6a')](_0x975e37);logger['info']('Download\x20completed');logger[_0x199a('0x6b')](_0x199a('0x6c'));});});}return null;})[_0x199a('0x4c')](handleError(_0x23649c,null));};exports[_0x199a('0x6d')]=function(_0x3ea8e1,_0x35b51c,_0x168aa9){var _0x114fe1=path[_0x199a('0x63')](_0x3ea8e1[_0x199a('0x6e')][_0x199a('0x6f')],path['extname'](_0x3ea8e1['file'][_0x199a('0x6f')]));var _0x2a1a2a=path['join'](config[_0x199a('0x62')],_0x199a('0x54'),_0x3ea8e1[_0x199a('0x6e')][_0x199a('0x6f')]);var _0x3d3030=path[_0x199a('0x61')](config['root'],'server/files/plugins',_0x114fe1);logger[_0x199a('0x6b')](_0x199a('0x70'),_0x2a1a2a);logger['info'](_0x199a('0x71'),_0x3d3030);try{fs[_0x199a('0x72')](_0x2a1a2a,parseInt(_0x199a('0x73'),0x8));extract(_0x2a1a2a,{'dir':_0x3d3030},function(_0x1a5bda){if(_0x1a5bda){logger[_0x199a('0x5b')](_0x1a5bda);handleError(_0x1a5bda,!![]);};var _0x54a3f3=fs[_0x199a('0x74')](_0x3d3030);if(_0x54a3f3['length']>0x1){removeReferences(_0x2a1a2a,_0x3d3030);logger['error'](_0x199a('0x75'));return _0x168aa9(new Error('Invalid\x20plugin\x20structure'));}var _0x11989b=fs[_0x199a('0x76')](path[_0x199a('0x61')](_0x3d3030,_0x54a3f3[0x0]));if(_0x11989b[_0x199a('0x77')]()){removeReferences(_0x2a1a2a,_0x3d3030);logger[_0x199a('0x5b')](_0x199a('0x75'));return _0x168aa9(new Error(_0x199a('0x75')));}if(_0x11989b[_0x199a('0x78')]()){var _0x55652d=fs[_0x199a('0x74')](path['join'](_0x3d3030,_0x54a3f3[0x0]));if(_0x55652d[_0x199a('0x3f')]===0x0){removeReferences(_0x2a1a2a,_0x3d3030);logger[_0x199a('0x5b')](_0x199a('0x75'));return _0x168aa9(new Error('Invalid\x20plugin\x20structure'));}var _0x5d1d4c=_0x55652d[_0x199a('0x79')](function(_0x556f84){return _0x556f84===_0x199a('0x7a');});if(!_0x5d1d4c){return _0x168aa9(new Error(_0x199a('0x7b')));}var _0x1166bd=fs[_0x199a('0x7c')](path[_0x199a('0x61')](_0x3d3030,_0x54a3f3[0x0],_0x199a('0x7a')));var _0x321f68=JSON[_0x199a('0x7d')](_0x1166bd);if(_0x199a('0x25')==typeof _0x321f68['name']){return _0x168aa9(new Error(_0x199a('0x7e')));}if('undefined'==typeof _0x321f68[_0x199a('0x7f')]){return _0x168aa9(new Error(_0x199a('0x80')));}if(_0x199a('0x25')==typeof _0x321f68[_0x199a('0x81')]){return _0x168aa9(new Error(_0x199a('0x82')));}if('undefined'==typeof _0x321f68[_0x199a('0x83')]){return _0x168aa9(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x321f68[_0x199a('0x7f')]===_0x199a('0x84')){if(_0x199a('0x25')==typeof _0x321f68[_0x199a('0x83')][_0x199a('0x85')]){return _0x168aa9(new Error(_0x199a('0x86')));}if(_0x199a('0x25')==typeof _0x321f68[_0x199a('0x83')]['views']['admin']&&'undefined'==typeof _0x321f68[_0x199a('0x83')][_0x199a('0x85')]['agent']){return _0x168aa9(new Error(_0x199a('0x87')));}}else if(_0x321f68['type']===_0x199a('0x88')){if(_0x199a('0x25')==typeof _0x321f68[_0x199a('0x83')]['scriptName']){return _0x168aa9(new Error(_0x199a('0x89')));}if(_0x199a('0x25')==typeof _0x321f68[_0x199a('0x83')][_0x199a('0x8a')]){return _0x168aa9(new Error(_0x199a('0x8b')));}}else{return _0x168aa9(new Error(_0x199a('0x8c')));}var _0x583af0=_0x321f68['name'];var _0x18fe65=_0x321f68[_0x199a('0x8d')];var _0x30e81e=_0x321f68[_0x199a('0x7f')];var _0x5a0baa=_0x321f68['sidebar']?_0x321f68[_0x199a('0x8e')]:_0x199a('0x8f');var _0xf974ad=_0x321f68[_0x199a('0x90')]?_0x321f68[_0x199a('0x90')]:_0x199a('0x91');var _0x223d38='';var _0x1b0986='';var _0x1cb715='';var _0x18d9dd='';var _0x26fafe=_0x321f68[_0x199a('0x81')];if(_0x30e81e==='html'){if(_0x199a('0x25')!=typeof _0x321f68[_0x199a('0x83')][_0x199a('0x85')][_0x199a('0x92')]){var _0x3c0aff=_0x321f68['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3c0aff)){_0x223d38=path[_0x199a('0x61')]('plugins',_0x114fe1,_0x54a3f3[0x0],_0x3c0aff);}else{_0x223d38=_0x3c0aff;}}else{logger[_0x199a('0x6b')](_0x199a('0x93'));}if(_0x199a('0x25')!=typeof _0x321f68[_0x199a('0x83')]['views'][_0x199a('0x94')]){var _0x3d9a22=_0x321f68[_0x199a('0x83')][_0x199a('0x85')][_0x199a('0x94')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3d9a22)){_0x1b0986=path[_0x199a('0x61')]('plugins',_0x114fe1,_0x54a3f3[0x0],_0x3d9a22);}else{_0x1b0986=_0x3d9a22;}}else{logger[_0x199a('0x6b')](_0x199a('0x95'));}}else if(_0x30e81e==='script'){_0x1cb715=_0x321f68[_0x199a('0x83')][_0x199a('0x96')];_0x18d9dd=_0x321f68[_0x199a('0x83')]['scriptPath'];if(_0x199a('0x25')!=typeof _0x321f68[_0x199a('0x83')][_0x199a('0x85')]){if(_0x199a('0x25')!=typeof _0x321f68[_0x199a('0x83')][_0x199a('0x85')]['admin']){var _0x3c0aff=_0x321f68[_0x199a('0x83')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x199a('0x97')](_0x3c0aff)){_0x223d38=path['join'](_0x199a('0x98'),_0x114fe1,_0x54a3f3[0x0],_0x3c0aff);}else{_0x223d38=_0x3c0aff;}}if(_0x199a('0x25')!=typeof _0x321f68[_0x199a('0x83')][_0x199a('0x85')][_0x199a('0x94')]){var _0x3d9a22=_0x321f68[_0x199a('0x83')][_0x199a('0x85')][_0x199a('0x94')];if(!/^(f|ht)tps?:\/\//i[_0x199a('0x97')](_0x3d9a22)){_0x1b0986=path[_0x199a('0x61')](_0x199a('0x98'),_0x114fe1,_0x54a3f3[0x0],_0x3d9a22);}else{_0x1b0986=_0x3d9a22;}}}}var _0x118ae3={'name':_0x583af0,'description':_0x18fe65,'path':path[_0x199a('0x61')](_0x114fe1,_0x54a3f3[0x0]),'type':_0x30e81e,'sidebar':_0x5a0baa,'icon':_0xf974ad,'adminUrl':_0x223d38,'agentUrl':_0x1b0986,'scriptName':_0x1cb715,'scriptPath':_0x18d9dd,'version':_0x26fafe};removeReferences(_0x2a1a2a,null);return db[_0x199a('0x49')]['create'](_0x118ae3)[_0x199a('0x2d')](function(_0x337a79){var _0x2dbf55={'role':_0x3ea8e1[_0x199a('0x99')][_0x199a('0x9a')],'userProfileId':_0x3ea8e1[_0x199a('0x99')][_0x199a('0x9b')]};if(!_0x2dbf55)throw new Error(_0x199a('0x9c'));if(_0x2dbf55[_0x199a('0x9a')]===_0x199a('0x9d')){var _0x53cc99=_0x337a79[_0x199a('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0x199a('0x52')]({'where':{'name':_0x199a('0x30'),'userProfileId':_0x2dbf55['userProfileId']},'raw':!![]})['then'](function(_0x3ec0d2){if(_0x3ec0d2&&_0x3ec0d2['autoAssociation']===0x0){return db[_0x199a('0x9e')]['create']({'name':_0x53cc99['name'],'resourceId':_0x53cc99['id'],'type':_0x3ec0d2['name'],'sectionId':_0x3ec0d2['id']},{})[_0x199a('0x2d')](function(){return _0x337a79;});}else{return _0x337a79;}})[_0x199a('0x4c')](function(_0x35b493){logger[_0x199a('0x5b')](_0x199a('0x9f'),_0x35b493);throw _0x35b493;});}return _0x337a79;})['then'](respondWithResult(_0x35b51c,null))['catch'](handleError(_0x35b51c,null));}});}catch(_0x13c111){_0x35b51c[_0x199a('0x21')](0x1f4)[_0x199a('0x34')](_0x13c111);}};function removeReferences(_0x21850f,_0x12ab99){try{if(_0x21850f){fs['unlinkSync'](_0x21850f);logger[_0x199a('0x6b')](_0x199a('0xa0'));}if(_0x12ab99){rimraf(_0x12ab99,function(){});logger[_0x199a('0x6b')](_0x199a('0xa1'));}}catch(_0x53cce5){logger[_0x199a('0x5b')](_0x53cce5);}}exports[_0x199a('0x2c')]=function(_0x5d83c8,_0x2ec12e,_0x1ef10c){return db[_0x199a('0x49')][_0x199a('0x52')]({'where':{'id':_0x5d83c8[_0x199a('0x4e')]['id']}})[_0x199a('0x2d')](handleEntityNotFound(_0x2ec12e,null))[_0x199a('0x2d')](saveUpdates(_0x5d83c8[_0x199a('0x99')],null))[_0x199a('0x2d')](respondWithResult(_0x2ec12e,null))['catch'](handleError(_0x2ec12e,null));};exports[_0x199a('0xa2')]=function(_0x451d17,_0x53d88c,_0x2c03fc){return db[_0x199a('0x49')][_0x199a('0x52')]({'where':{'id':_0x451d17[_0x199a('0x4e')]['id']}})[_0x199a('0x2d')](function(_0x5a5a1a){if(_0x5a5a1a){return _0x5a5a1a[_0x199a('0x2e')]();}})[_0x199a('0x2d')](function(_0x1bd4cb){rimraf(path[_0x199a('0x61')](config[_0x199a('0x62')],_0x199a('0x54'),path[_0x199a('0xa3')](_0x1bd4cb[_0x199a('0x7')])),function(){});return _0x1bd4cb;})[_0x199a('0x2d')](handleEntityNotFound(_0x53d88c,null))[_0x199a('0x2d')](respondWithStatusCode(_0x53d88c,null))['catch'](handleError(_0x53d88c,null));};exports['webhookGet']=function(_0x31d63a,_0x40ac9a,_0xa97f50){return BPromise['resolve']()[_0x199a('0x2d')](function(){if(!_0x31d63a[_0x199a('0x39')][_0x199a('0x7')]){throw new Error(_0x199a('0xa4'));}if(!_0x31d63a['query'][_0x199a('0xa5')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0xa9c623=_0x31d63a[_0x199a('0x39')][_0x199a('0xa6')]?_0x31d63a[_0x199a('0x39')]['hostname']+':'+_0x31d63a[_0x199a('0x39')][_0x199a('0xa5')]:_0x199a('0xa7')+_0x31d63a[_0x199a('0x39')]['port'];var _0x37e889=_0x31d63a[_0x199a('0x39')]['json']?_0x31d63a[_0x199a('0x39')][_0x199a('0x23')]:!![];var _0x47deee=_0x31d63a[_0x199a('0x39')][_0x199a('0xa8')]?_0x31d63a['query'][_0x199a('0xa8')]:null;var _0x4dbee8={'method':_0x31d63a[_0x199a('0xa9')],'uri':util[_0x199a('0x55')]('%s%s',_0xa9c623,_0x31d63a[_0x199a('0x39')][_0x199a('0x7')]),'json':_0x37e889,'resolveWithFullResponse':!![],'encoding':_0x47deee,'qs':_0x31d63a[_0x199a('0x39')]};if(_0x31d63a[_0x199a('0xaa')]){_0x4dbee8[_0x199a('0xaa')]=_0x31d63a[_0x199a('0xaa')];if(_0x4dbee8[_0x199a('0xaa')]['content-length']){delete _0x4dbee8[_0x199a('0xaa')][_0x199a('0xab')];}}if(_0x4dbee8[_0x199a('0xaa')]['content-type']){delete _0x4dbee8[_0x199a('0xaa')][_0x199a('0xac')];}return rp(_0x4dbee8);})[_0x199a('0x2d')](function(_0x34f6c7){if(_0x34f6c7){_0x40ac9a[_0x199a('0x28')](_0x34f6c7['headers']);logger[_0x199a('0x6b')](_0x34f6c7['body']);if(_[_0x199a('0xad')](_0x31d63a[_0x199a('0x39')]['path'],_0x199a('0x53'))&&_0x34f6c7[_0x199a('0xae')]==0x1f4){return _0x40ac9a[_0x199a('0x31')](_0x34f6c7[_0x199a('0xae')]);}else{return _0x40ac9a[_0x199a('0x21')](_0x34f6c7[_0x199a('0xae')])['send'](_0x34f6c7[_0x199a('0x99')]);}}else{return _0x40ac9a[_0x199a('0x31')](0xc8);}})[_0x199a('0x4c')](handleError(_0x40ac9a,null));};exports[_0x199a('0xaf')]=function(_0x4d589b,_0xcc2fb7,_0x236c95){return BPromise['resolve']()[_0x199a('0x2d')](function(){if(!_0x4d589b['query'][_0x199a('0x7')]){throw new Error(_0x199a('0xa4'));}if(!_0x4d589b[_0x199a('0x39')]['port']){throw new Error(_0x199a('0xb0'));}var _0x4f4c26=_0x4d589b['query']['hostname']?_0x4d589b[_0x199a('0x39')][_0x199a('0xa6')]+':'+_0x4d589b['query']['port']:_0x199a('0xa7')+_0x4d589b['query'][_0x199a('0xa5')];var _0x490aff=_0x4d589b[_0x199a('0x39')][_0x199a('0x23')]?_0x4d589b[_0x199a('0x39')][_0x199a('0x23')]:!![];var _0x1072e5=_0x4d589b[_0x199a('0x39')][_0x199a('0xa8')]?_0x4d589b['query'][_0x199a('0xa8')]:null;var _0x134291={'method':_0x4d589b['method'],'uri':util[_0x199a('0x55')](_0x199a('0xb1'),_0x4f4c26,_0x4d589b['query']['path']),'json':_0x490aff,'resolveWithFullResponse':!![],'encoding':_0x1072e5,'body':_0x4d589b[_0x199a('0x99')]};if(_0x4d589b['headers']){_0x134291['headers']=_0x4d589b['headers'];if(_0x134291[_0x199a('0xaa')][_0x199a('0xab')]){delete _0x134291['headers'][_0x199a('0xab')];}}if(_0x134291[_0x199a('0xaa')][_0x199a('0xac')]){delete _0x134291[_0x199a('0xaa')][_0x199a('0xac')];}return rp(_0x134291);})[_0x199a('0x2d')](function(_0x12b14a){if(_0x12b14a){_0xcc2fb7[_0x199a('0x28')](_0x12b14a[_0x199a('0xaa')]);logger[_0x199a('0x6b')](_0x12b14a[_0x199a('0x99')]);return _0xcc2fb7[_0x199a('0x21')](_0x12b14a[_0x199a('0xae')])[_0x199a('0x34')](_0x12b14a[_0x199a('0x99')]);}else{return _0xcc2fb7[_0x199a('0x31')](0xc8);}})[_0x199a('0x4c')](handleError(_0xcc2fb7,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c69a254..bab3604 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 _0x46e1=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x25cf41,_0xb7f41f){var _0x3b9ed6=function(_0x123e04){while(--_0x123e04){_0x25cf41['push'](_0x25cf41['shift']());}};_0x3b9ed6(++_0xb7f41f);}(_0x46e1,0x155));var _0x146e=function(_0x37ea31,_0x2f6c7a){_0x37ea31=_0x37ea31-0x0;var _0x5c4fed=_0x46e1[_0x37ea31];return _0x5c4fed;};'use strict';var EventEmitter=require(_0x146e('0x0'));var Plugin=require(_0x146e('0x1'))['db'][_0x146e('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x146e('0x3')](0x0);var events={'afterCreate':_0x146e('0x4'),'afterUpdate':_0x146e('0x5'),'afterDestroy':_0x146e('0x6')};function emitEvent(_0x186d9b){return function(_0x18dab9,_0x3bbaec,_0x5e0b03){PluginEvents[_0x146e('0x7')](_0x186d9b+':'+_0x18dab9['id'],_0x18dab9);PluginEvents[_0x146e('0x7')](_0x186d9b,_0x18dab9);_0x5e0b03(null);};}for(var e in events){if(events[_0x146e('0x8')](e)){var event=events[e];Plugin[_0x146e('0x9')](e,emitEvent(event));}}module[_0x146e('0xa')]=PluginEvents; \ No newline at end of file +var _0xc029=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x3f3423,_0x28ddf9){var _0x472654=function(_0x1622da){while(--_0x1622da){_0x3f3423['push'](_0x3f3423['shift']());}};_0x472654(++_0x28ddf9);}(_0xc029,0x1df));var _0x9c02=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0xc029[_0x1139d0];return _0xcc01a6;};'use strict';var EventEmitter=require(_0x9c02('0x0'));var Plugin=require(_0x9c02('0x1'))['db'][_0x9c02('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x9c02('0x3')](0x0);var events={'afterCreate':_0x9c02('0x4'),'afterUpdate':_0x9c02('0x5'),'afterDestroy':_0x9c02('0x6')};function emitEvent(_0x291f30){return function(_0x39c897,_0x2a96cd,_0x283c37){PluginEvents[_0x9c02('0x7')](_0x291f30+':'+_0x39c897['id'],_0x39c897);PluginEvents[_0x9c02('0x7')](_0x291f30,_0x39c897);_0x283c37(null);};}for(var e in events){if(events[_0x9c02('0x8')](e)){var event=events[e];Plugin[_0x9c02('0x9')](e,emitEvent(event));}}module[_0x9c02('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index f2206a7..6036490 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 _0xae63=['path','../../config/environment','./plugin.attributes','Plugin','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2c3d7d,_0xd716a0){var _0x51e321=function(_0x4addf5){while(--_0x4addf5){_0x2c3d7d['push'](_0x2c3d7d['shift']());}};_0x51e321(++_0xd716a0);}(_0xae63,0x16c));var _0x3ae6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ae6('0x0'));var util=require(_0x3ae6('0x1'));var logger=require(_0x3ae6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3ae6('0x3'));var rp=require(_0x3ae6('0x4'));var fs=require('fs');var path=require(_0x3ae6('0x5'));var rimraf=require('rimraf');var config=require(_0x3ae6('0x6'));var attributes=require(_0x3ae6('0x7'));module['exports']=function(_0x2c2da0,_0x162b04){return _0x2c2da0['define'](_0x3ae6('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd3d=['Plugin','lodash','util','../../config/logger','api','moment','path','rimraf','./plugin.attributes','define'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xbd3d,0xd3));var _0xdbd3=function(_0x3ef339,_0x32f77e){_0x3ef339=_0x3ef339-0x0;var _0x419d24=_0xbd3d[_0x3ef339];return _0x419d24;};'use strict';var _=require(_0xdbd3('0x0'));var util=require(_0xdbd3('0x1'));var logger=require(_0xdbd3('0x2'))(_0xdbd3('0x3'));var moment=require(_0xdbd3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbd3('0x5'));var rimraf=require(_0xdbd3('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbd3('0x7'));module['exports']=function(_0x28994a,_0x3e72c4){return _0x28994a[_0xdbd3('0x8')](_0xdbd3('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index ec2b9f6..a5103e6 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 _0x9cab=['error','code','message','catch','CreatePlugin','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x4f964a,_0x41f80b){var _0x22142b=function(_0x2c969c){while(--_0x2c969c){_0x4f964a['push'](_0x4f964a['shift']());}};_0x22142b(++_0x41f80b);}(_0x9cab,0x1e7));var _0xb9ca=function(_0x4919bd,_0x327cc3){_0x4919bd=_0x4919bd-0x0;var _0x430707=_0x9cab[_0x4919bd];return _0x430707;};'use strict';var _=require('lodash');var util=require(_0xb9ca('0x0'));var moment=require(_0xb9ca('0x1'));var BPromise=require(_0xb9ca('0x2'));var rs=require(_0xb9ca('0x3'));var fs=require('fs');var Redis=require(_0xb9ca('0x4'));var db=require(_0xb9ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9ca('0x6'))(_0xb9ca('0x7'));var config=require('../../config/environment');var jayson=require(_0xb9ca('0x8'));var client=jayson[_0xb9ca('0x9')][_0xb9ca('0xa')]({'port':0x232a});config[_0xb9ca('0xb')]=_[_0xb9ca('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb9ca('0xd'))(new Redis(config[_0xb9ca('0xb')]));require(_0xb9ca('0xe'))[_0xb9ca('0xf')](socket);function respondWithRpcPromise(_0x534f2d,_0x169f54,_0x338e87){return new BPromise(function(_0x14f755,_0x5c3ba6){return client[_0xb9ca('0x10')](_0x534f2d,_0x338e87)[_0xb9ca('0x11')](function(_0x54682d){logger[_0xb9ca('0x12')](_0xb9ca('0x13'),_0x169f54,'request\x20sent');logger[_0xb9ca('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x169f54,_0xb9ca('0x15'),JSON[_0xb9ca('0x16')](_0x54682d));if(_0x54682d['error']){if(_0x54682d[_0xb9ca('0x17')][_0xb9ca('0x18')]===0x1f4){logger[_0xb9ca('0x17')](_0xb9ca('0x13'),_0x169f54,_0x54682d[_0xb9ca('0x17')][_0xb9ca('0x19')]);return _0x5c3ba6(_0x54682d[_0xb9ca('0x17')][_0xb9ca('0x19')]);}logger['error'](_0xb9ca('0x13'),_0x169f54,_0x54682d[_0xb9ca('0x17')][_0xb9ca('0x19')]);return _0x14f755(_0x54682d[_0xb9ca('0x17')][_0xb9ca('0x19')]);}else{logger[_0xb9ca('0x12')](_0xb9ca('0x13'),_0x169f54,'request\x20sent');_0x14f755(_0x54682d['result']['message']);}})[_0xb9ca('0x1a')](function(_0xa2bca1){logger[_0xb9ca('0x17')]('Plugin,\x20%s,\x20%s',_0x169f54,_0xa2bca1);_0x5c3ba6(_0xa2bca1);});});}exports[_0xb9ca('0x1b')]=function(_0x311435){var _0x370003=this;return new Promise(function(_0x2f8fa5,_0x209ac5){return db['Plugin']['create'](_0x311435[_0xb9ca('0x1c')],{'raw':_0x311435[_0xb9ca('0x1d')]?_0x311435[_0xb9ca('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e9427){logger['info'](_0xb9ca('0x1b'),_0x311435);logger[_0xb9ca('0x14')](_0xb9ca('0x1b'),_0x311435,JSON[_0xb9ca('0x16')](_0x1e9427));_0x2f8fa5(_0x1e9427);})[_0xb9ca('0x1a')](function(_0x27b825){logger[_0xb9ca('0x17')](_0xb9ca('0x1b'),_0x27b825[_0xb9ca('0x19')],_0x311435);_0x209ac5(_0x370003[_0xb9ca('0x17')](0x1f4,_0x27b825[_0xb9ca('0x19')]));});});}; \ No newline at end of file +var _0x6402=['info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','Plugin','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x1f9213,_0x466ad2){var _0x1917e6=function(_0x18730e){while(--_0x18730e){_0x1f9213['push'](_0x1f9213['shift']());}};_0x1917e6(++_0x466ad2);}(_0x6402,0xb4));var _0x2640=function(_0x26d131,_0x282df8){_0x26d131=_0x26d131-0x0;var _0x18c8da=_0x6402[_0x26d131];return _0x18c8da;};'use strict';var _=require(_0x2640('0x0'));var util=require(_0x2640('0x1'));var moment=require(_0x2640('0x2'));var BPromise=require('bluebird');var rs=require(_0x2640('0x3'));var fs=require('fs');var Redis=require(_0x2640('0x4'));var db=require(_0x2640('0x5'))['db'];var utils=require(_0x2640('0x6'));var logger=require(_0x2640('0x7'))(_0x2640('0x8'));var config=require('../../config/environment');var jayson=require(_0x2640('0x9'));var client=jayson['client'][_0x2640('0xa')]({'port':0x232a});config[_0x2640('0xb')]=_[_0x2640('0xc')](config['redis'],{'host':_0x2640('0xd'),'port':0x18eb});var socket=require(_0x2640('0xe'))(new Redis(config[_0x2640('0xb')]));require('./plugin.socket')[_0x2640('0xf')](socket);function respondWithRpcPromise(_0x402fcb,_0x4ce6cb,_0x3cea01){return new BPromise(function(_0x43c708,_0xdbc4d0){return client[_0x2640('0x10')](_0x402fcb,_0x3cea01)[_0x2640('0x11')](function(_0x476b12){logger[_0x2640('0x12')](_0x2640('0x13'),_0x4ce6cb,_0x2640('0x14'));logger[_0x2640('0x15')](_0x2640('0x16'),_0x4ce6cb,_0x2640('0x14'),JSON[_0x2640('0x17')](_0x476b12));if(_0x476b12[_0x2640('0x18')]){if(_0x476b12[_0x2640('0x18')][_0x2640('0x19')]===0x1f4){logger[_0x2640('0x18')](_0x2640('0x13'),_0x4ce6cb,_0x476b12[_0x2640('0x18')][_0x2640('0x1a')]);return _0xdbc4d0(_0x476b12[_0x2640('0x18')][_0x2640('0x1a')]);}logger['error'](_0x2640('0x13'),_0x4ce6cb,_0x476b12[_0x2640('0x18')][_0x2640('0x1a')]);return _0x43c708(_0x476b12[_0x2640('0x18')][_0x2640('0x1a')]);}else{logger[_0x2640('0x12')]('Plugin,\x20%s,\x20%s',_0x4ce6cb,'request\x20sent');_0x43c708(_0x476b12[_0x2640('0x1b')]['message']);}})['catch'](function(_0x32f5c6){logger[_0x2640('0x18')]('Plugin,\x20%s,\x20%s',_0x4ce6cb,_0x32f5c6);_0xdbc4d0(_0x32f5c6);});});}exports[_0x2640('0x1c')]=function(_0x4155e2){var _0x28829a=this;return new Promise(function(_0x21102c,_0x595ee3){return db[_0x2640('0x1d')]['create'](_0x4155e2[_0x2640('0x1e')],{'raw':_0x4155e2['options']?_0x4155e2[_0x2640('0x1f')][_0x2640('0x20')]===undefined?!![]:![]:!![]})[_0x2640('0x11')](function(_0x4af3dc){logger[_0x2640('0x12')]('CreatePlugin',_0x4155e2);logger[_0x2640('0x15')](_0x2640('0x1c'),_0x4155e2,JSON[_0x2640('0x17')](_0x4af3dc));_0x21102c(_0x4af3dc);})['catch'](function(_0x19b4be){logger[_0x2640('0x18')](_0x2640('0x1c'),_0x19b4be[_0x2640('0x1a')],_0x4155e2);_0x595ee3(_0x28829a[_0x2640('0x18')](0x1f4,_0x19b4be[_0x2640('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b324f44..621a2e4 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 _0x6f83=['register','plugin:','save','remove','update','emit','removeListener'];(function(_0x532098,_0x518a84){var _0x300dd8=function(_0x422440){while(--_0x422440){_0x532098['push'](_0x532098['shift']());}};_0x300dd8(++_0x518a84);}(_0x6f83,0x159));var _0x36f8=function(_0x5890d0,_0x221859){_0x5890d0=_0x5890d0-0x0;var _0x4d47df=_0x6f83[_0x5890d0];return _0x4d47df;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x36f8('0x0'),_0x36f8('0x1'),_0x36f8('0x2')];function createListener(_0x27ea7d,_0x127bd1){return function(_0x270db8){_0x127bd1[_0x36f8('0x3')](_0x27ea7d,_0x270db8);};}function removeListener(_0x5cf2ce,_0xb350c8){return function(){PluginEvents[_0x36f8('0x4')](_0x5cf2ce,_0xb350c8);};}exports[_0x36f8('0x5')]=function(_0x37d661){for(var _0x3ed877=0x0,_0x1625a3=events['length'];_0x3ed877<_0x1625a3;_0x3ed877++){var _0x18862c=events[_0x3ed877];var _0x51d3fd=createListener(_0x36f8('0x6')+_0x18862c,_0x37d661);PluginEvents['on'](_0x18862c,_0x51d3fd);}}; \ No newline at end of file +var _0x0328=['remove','removeListener','register','length','plugin:','./plugin.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0328,0x18d));var _0x8032=function(_0x2fb4d2,_0x3ebaf8){_0x2fb4d2=_0x2fb4d2-0x0;var _0x466f96=_0x0328[_0x2fb4d2];return _0x466f96;};'use strict';var PluginEvents=require(_0x8032('0x0'));var events=[_0x8032('0x1'),_0x8032('0x2'),'update'];function createListener(_0x26b788,_0x2bddb2){return function(_0x77d3cd){_0x2bddb2['emit'](_0x26b788,_0x77d3cd);};}function removeListener(_0x36f99c,_0x1ff1f6){return function(){PluginEvents[_0x8032('0x3')](_0x36f99c,_0x1ff1f6);};}exports[_0x8032('0x4')]=function(_0x480896){for(var _0x3c3da8=0x0,_0x30d2f7=events[_0x8032('0x5')];_0x3c3da8<_0x30d2f7;_0x3c3da8++){var _0x36e575=events[_0x3c3da8];var _0x3d0ef6=createListener(_0x8032('0x6')+_0x36e575,_0x480896);PluginEvents['on'](_0x36e575,_0x3d0ef6);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index bd7296e..e35a63c 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(_0x24d598,_0x3e74b0){var _0x183847=function(_0x422290){while(--_0x422290){_0x24d598['push'](_0x24d598['shift']());}};_0x183847(++_0x3e74b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x1a9a31,_0x310d48){var _0x56d4da=function(_0x4fdc76){while(--_0x4fdc76){_0x1a9a31['push'](_0x1a9a31['shift']());}};_0x56d4da(++_0x310d48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 633dd17..d740ee2 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 _0xd404=['stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','api','path','exec','bluebird','sendStatus','json','name','status','send','npm\x20install','info','error','index','list','then','express','motion2','length','catch','show','describe','params','body','join','script','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x8eb327,_0x2e032f){var _0x393b21=function(_0x2f1bae){while(--_0x2f1bae){_0x8eb327['push'](_0x8eb327['shift']());}};_0x393b21(++_0x2e032f);}(_0xd404,0x15b));var _0x4d40=function(_0x551f8b,_0x15fac5){_0x551f8b=_0x551f8b-0x0;var _0x28a22c=_0xd404[_0x551f8b];return _0x28a22c;};'use strict';var _=require(_0x4d40('0x0'));var pm2=require(_0x4d40('0x1'));var logger=require('../../config/logger')(_0x4d40('0x2'));var path=require(_0x4d40('0x3'));var exec=require('child_process')[_0x4d40('0x4')];var BPromise=require(_0x4d40('0x5'));function handleEntityNotFound(_0xba821,_0x8bde12){return function(_0xbfb4c6){if(!_0xbfb4c6){_0xba821[_0x4d40('0x6')](0x194);;}return _0xbfb4c6;};}function respondWithResult(_0xc2a9db,_0x24a237){_0x24a237=_0x24a237||0xc8;return function(_0x2e4bd8){if(_0x2e4bd8){return _0xc2a9db['status'](_0x24a237)[_0x4d40('0x7')](_0x2e4bd8);}return null;};}function handleError(_0x116941,_0x5a23a2){_0x5a23a2=_0x5a23a2||0x1f4;return function(_0x3bf81a){logger['error'](_0x3bf81a['stack']);if(_0x3bf81a[_0x4d40('0x8')]){delete _0x3bf81a[_0x4d40('0x8')];}_0x116941[_0x4d40('0x9')](_0x5a23a2)[_0x4d40('0xa')](_0x3bf81a);};}function execChildProcess(){return new BPromise(function(_0x1d00cf,_0x357abf){exec(_0x4d40('0xb'),function(_0x2eab7a,_0x1e18bc,_0x3f5c29){logger[_0x4d40('0xc')](_0x1e18bc);logger[_0x4d40('0xc')](_0x3f5c29);if(_0x2eab7a){logger[_0x4d40('0xd')](_0x2eab7a);return _0x357abf(_0x2eab7a);}return _0x1d00cf(_0x1e18bc);});});}exports[_0x4d40('0xe')]=function(_0x5162f9,_0xa644d2){return pm2[_0x4d40('0xf')]()[_0x4d40('0x10')](function(_0x2083bd){if(_0x2083bd){var _0x477a91=_['reject'](_0x2083bd,function(_0x23de7b){return _0x23de7b[_0x4d40('0x8')]===_0x4d40('0x11')||_0x23de7b[_0x4d40('0x8')]===_0x4d40('0x12');});return{'rows':_0x477a91,'count':_0x477a91[_0x4d40('0x13')]};}return null;})[_0x4d40('0x10')](respondWithResult(_0xa644d2,null))[_0x4d40('0x14')](handleError(_0xa644d2,null));};exports[_0x4d40('0x15')]=function(_0x4b5d23,_0x535989){return pm2[_0x4d40('0x16')](_0x4b5d23[_0x4d40('0x17')]['id'])['then'](respondWithResult(_0x535989,null))[_0x4d40('0x10')](handleEntityNotFound(_0x535989,null))[_0x4d40('0x14')](handleError(_0x535989,null));};exports['create']=function(_0x36d031,_0x5a77e0){if(_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')]&&_0x36d031['body']['script']){var _0x375ce0=path[_0x4d40('0x19')](__dirname,'../../files/plugins',_0x36d031[_0x4d40('0x18')][_0x4d40('0x1a')]);var _0x30f058=process['cwd']();process[_0x4d40('0x1b')](path[_0x4d40('0x1c')](_0x375ce0));return execChildProcess()[_0x4d40('0x10')](function(_0x5ca0a0){process['chdir'](_0x30f058);return pm2[_0x4d40('0x1d')]({'name':_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')],'script':_0x375ce0});})[_0x4d40('0x10')](function(_0x4677c9){pm2['dump']();return _0x4677c9[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a77e0,0xc9))[_0x4d40('0x14')](handleError(_0x5a77e0,null));}else{return _0x5a77e0['status'](0x1f4)['send']({'message':_0x4d40('0x1e')});}};exports[_0x4d40('0x1f')]=function(_0x3fa83e,_0x3ad1d7){if(_0x3fa83e[_0x4d40('0x18')]['id']){delete _0x3fa83e[_0x4d40('0x18')]['id'];}var _0x105635={'online':_0x4d40('0x20'),'stopped':_0x4d40('0x21')};if(_0x105635[_0x4d40('0x22')](_0x3fa83e[_0x4d40('0x18')]['status'])){return pm2[_0x105635[_0x3fa83e['body']['status']]](_0x3fa83e[_0x4d40('0x17')]['id'])[_0x4d40('0x10')](respondWithResult(_0x3ad1d7,0xc8))[_0x4d40('0x14')](handleError(_0x3ad1d7,null));}else{return _0x3ad1d7[_0x4d40('0x9')](0x1f4)['send']({'message':_0x4d40('0x23')});}};exports[_0x4d40('0x24')]=function(_0x429da9,_0x5a6aff){if(_0x429da9[_0x4d40('0x18')]['id']){delete _0x429da9[_0x4d40('0x18')]['id'];}if(_0x429da9[_0x4d40('0x17')]['id']){return pm2[_0x4d40('0x25')](_0x429da9[_0x4d40('0x17')]['id'])['then'](function(_0x2f4b22){pm2['dump']();return _0x2f4b22[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a6aff,null))[_0x4d40('0x14')](handleError(_0x5a6aff,null));}else{return _0x5a6aff[_0x4d40('0x9')](0x1f4)[_0x4d40('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x222f=['dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','stack','name','status','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','body','join','../../files/plugins','script','chdir','dirname','start'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x222f,0x1a4));var _0xf222=function(_0xcbe787,_0x401e4c){_0xcbe787=_0xcbe787-0x0;var _0x4c78fa=_0x222f[_0xcbe787];return _0x4c78fa;};'use strict';var _=require(_0xf222('0x0'));var pm2=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var path=require('path');var exec=require('child_process')[_0xf222('0x4')];var BPromise=require(_0xf222('0x5'));function handleEntityNotFound(_0x307791,_0x7b187d){return function(_0x59a619){if(!_0x59a619){_0x307791[_0xf222('0x6')](0x194);;}return _0x59a619;};}function respondWithResult(_0x54a758,_0x112e6d){_0x112e6d=_0x112e6d||0xc8;return function(_0x26f129){if(_0x26f129){return _0x54a758['status'](_0x112e6d)[_0xf222('0x7')](_0x26f129);}return null;};}function handleError(_0x302d7a,_0x4aceb4){_0x4aceb4=_0x4aceb4||0x1f4;return function(_0x31c027){logger[_0xf222('0x8')](_0x31c027[_0xf222('0x9')]);if(_0x31c027[_0xf222('0xa')]){delete _0x31c027[_0xf222('0xa')];}_0x302d7a[_0xf222('0xb')](_0x4aceb4)['send'](_0x31c027);};}function execChildProcess(){return new BPromise(function(_0x2e29ad,_0x405080){exec(_0xf222('0xc'),function(_0x182bc3,_0x48f740,_0x3c9b96){logger[_0xf222('0xd')](_0x48f740);logger[_0xf222('0xd')](_0x3c9b96);if(_0x182bc3){logger[_0xf222('0x8')](_0x182bc3);return _0x405080(_0x182bc3);}return _0x2e29ad(_0x48f740);});});}exports[_0xf222('0xe')]=function(_0x334017,_0x11fca0){return pm2[_0xf222('0xf')]()['then'](function(_0x5b8f97){if(_0x5b8f97){var _0x1feb86=_[_0xf222('0x10')](_0x5b8f97,function(_0x4c2314){return _0x4c2314[_0xf222('0xa')]===_0xf222('0x11')||_0x4c2314[_0xf222('0xa')]===_0xf222('0x12');});return{'rows':_0x1feb86,'count':_0x1feb86[_0xf222('0x13')]};}return null;})[_0xf222('0x14')](respondWithResult(_0x11fca0,null))[_0xf222('0x15')](handleError(_0x11fca0,null));};exports['show']=function(_0x1efa9f,_0x823314){return pm2[_0xf222('0x16')](_0x1efa9f[_0xf222('0x17')]['id'])[_0xf222('0x14')](respondWithResult(_0x823314,null))[_0xf222('0x14')](handleEntityNotFound(_0x823314,null))[_0xf222('0x15')](handleError(_0x823314,null));};exports['create']=function(_0xf26a16,_0x1bdd0a){if(_0xf26a16[_0xf222('0x18')][_0xf222('0xa')]&&_0xf26a16['body']['script']){var _0x398ff4=path[_0xf222('0x19')](__dirname,_0xf222('0x1a'),_0xf26a16[_0xf222('0x18')][_0xf222('0x1b')]);var _0x151a89=process['cwd']();process[_0xf222('0x1c')](path[_0xf222('0x1d')](_0x398ff4));return execChildProcess()[_0xf222('0x14')](function(_0x12d443){process[_0xf222('0x1c')](_0x151a89);return pm2[_0xf222('0x1e')]({'name':_0xf26a16[_0xf222('0x18')][_0xf222('0xa')],'script':_0x398ff4});})['then'](function(_0x145e2e){pm2[_0xf222('0x1f')]();return _0x145e2e[0x0];})[_0xf222('0x14')](respondWithResult(_0x1bdd0a,0xc9))[_0xf222('0x15')](handleError(_0x1bdd0a,null));}else{return _0x1bdd0a[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x21')});}};exports[_0xf222('0x22')]=function(_0x15bf4e,_0x2ec2e9){if(_0x15bf4e[_0xf222('0x18')]['id']){delete _0x15bf4e['body']['id'];}var _0x14b2b1={'online':_0xf222('0x23'),'stopped':_0xf222('0x24')};if(_0x14b2b1[_0xf222('0x25')](_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')])){return pm2[_0x14b2b1[_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')]]](_0x15bf4e[_0xf222('0x17')]['id'])['then'](respondWithResult(_0x2ec2e9,0xc8))[_0xf222('0x15')](handleError(_0x2ec2e9,null));}else{return _0x2ec2e9[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf222('0x26')]=function(_0x5d5963,_0x40c7e7){if(_0x5d5963[_0xf222('0x18')]['id']){delete _0x5d5963[_0xf222('0x18')]['id'];}if(_0x5d5963[_0xf222('0x17')]['id']){return pm2[_0xf222('0x27')](_0x5d5963[_0xf222('0x17')]['id'])[_0xf222('0x14')](function(_0x5075ad){pm2['dump']();return _0x5075ad[0x0];})[_0xf222('0x14')](respondWithResult(_0x40c7e7,null))[_0xf222('0x15')](handleError(_0x40c7e7,null));}else{return _0x40c7e7[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index e4fe3a2..b0746e8 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 _0xf832=['./realtime.controller','get','isAuthenticated','/queues','exports','express','Router','../../components/auth/service'];(function(_0x1e4250,_0x5509e2){var _0x2037f5=function(_0x3f2110){while(--_0x3f2110){_0x1e4250['push'](_0x1e4250['shift']());}};_0x2037f5(++_0x5509e2);}(_0xf832,0x175));var _0x2f83=function(_0x37870a,_0x76e56c){_0x37870a=_0x37870a-0x0;var _0x56d839=_0xf832[_0x37870a];return _0x56d839;};'use strict';var express=require(_0x2f83('0x0'));var router=express[_0x2f83('0x1')]();var auth=require(_0x2f83('0x2'));var controller=require(_0x2f83('0x3'));router[_0x2f83('0x4')]('/agents',auth[_0x2f83('0x5')](),controller['getAgents']);router[_0x2f83('0x4')](_0x2f83('0x6'),auth[_0x2f83('0x5')](),controller['getQueues']);module[_0x2f83('0x7')]=router; \ No newline at end of file +var _0xa5e4=['get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','Router','./realtime.controller'];(function(_0x2417c6,_0xc2f400){var _0x29f6d5=function(_0x4ba66b){while(--_0x4ba66b){_0x2417c6['push'](_0x2417c6['shift']());}};_0x29f6d5(++_0xc2f400);}(_0xa5e4,0xcd));var _0x4a5e=function(_0x2d3800,_0x1ba30e){_0x2d3800=_0x2d3800-0x0;var _0x4e15b8=_0xa5e4[_0x2d3800];return _0x4e15b8;};'use strict';var express=require('express');var router=express[_0x4a5e('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x4a5e('0x1'));router[_0x4a5e('0x2')](_0x4a5e('0x3'),auth[_0x4a5e('0x4')](),controller[_0x4a5e('0x5')]);router['get'](_0x4a5e('0x6'),auth[_0x4a5e('0x4')](),controller[_0x4a5e('0x7')]);module[_0x4a5e('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d36242a..25d0d67 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 _0x14ad=['originated','dialActive','Trunk','startProgressive','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','loggedInDb','loggedIn','busy','find','filter','queue','length','some','connectedlinenum','internal','getMembers','UserId','accountcode','online','voiceStatus','agents','push','Pause','findAll','QueueId','unknown','isNil','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','idle','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastPauseAt','pauseType','address','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','chatPause','resolve','User','rawAttributes','fieldName','type','key','query','role','agent','getOptions','raw','user','nolimit','sort','getResources','rows','map','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','openchannel','fax','whatsapp','includes','channel','toLowerCase','Queue','userProfileId','QueueCampaigns','UserProfile','findAndCountAll','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','json','stack','name','send','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','available','waiting','talking','paused','voice','outbound','pTalking'];(function(_0x2627fe,_0xa85d7a){var _0x27849d=function(_0x6ef920){while(--_0x6ef920){_0x2627fe['push'](_0x2627fe['shift']());}};_0x27849d(++_0xa85d7a);}(_0x14ad,0x70));var _0xd14a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x14ad[_0x422905];return _0x33dc6c;};'use strict';var util=require(_0xd14a('0x0'));var _=require(_0xd14a('0x1'));var jayson=require(_0xd14a('0x2'));var qs=require(_0xd14a('0x3'));var logger=require(_0xd14a('0x4'))(_0xd14a('0x5'));var db=require(_0xd14a('0x6'))['db'];var amiClient=jayson[_0xd14a('0x7')][_0xd14a('0x8')]({'port':0x232a});var routingClient=jayson[_0xd14a('0x7')]['http']({'port':0x232c});function respondWithFilteredResult(_0x43d0f0,_0x202aa1){return function(_0x3f0b0e){if(_0x3f0b0e){var _0x5564a3=typeof _0x202aa1[_0xd14a('0x9')]===_0xd14a('0xa')&&typeof _0x202aa1['limit']===_0xd14a('0xa');var _0x54debc=_0x3f0b0e[_0xd14a('0xb')];var _0x1a39d6=_0x5564a3?0x0:_0x202aa1[_0xd14a('0x9')];var _0x53d8d7=_0x5564a3?_0x3f0b0e[_0xd14a('0xb')]:_0x202aa1['offset']+_0x202aa1[_0xd14a('0xc')];var _0x4da4a2;if(_0x53d8d7>=_0x54debc){_0x53d8d7=_0x54debc;_0x4da4a2=0xc8;}else{_0x4da4a2=0xce;}_0x43d0f0[_0xd14a('0xd')](_0x4da4a2);return _0x43d0f0[_0xd14a('0xe')](_0xd14a('0xf'),_0x1a39d6+'-'+_0x53d8d7+'/'+_0x54debc)[_0xd14a('0x10')](_0x3f0b0e);}return null;};}function handleError(_0x1f8b77,_0x407414){_0x407414=_0x407414||0x1f4;return function(_0x4ae33b){logger['error'](_0x4ae33b[_0xd14a('0x11')]);if(_0x4ae33b[_0xd14a('0x12')]){delete _0x4ae33b['name'];}_0x1f8b77[_0xd14a('0xd')](_0x407414)[_0xd14a('0x13')](_0x4ae33b);};}function getRealtimeAgents(){return new Promise(function(_0x431d5b,_0x48e261){return amiClient[_0xd14a('0x14')](_0xd14a('0x15'),{})[_0xd14a('0x16')](function(_0x51aa71){if(_0x51aa71[_0xd14a('0x17')])throw new Error(_0xd14a('0x18'));var _0x529b9e=_0x51aa71[_0xd14a('0x19')];return routingClient[_0xd14a('0x14')](_0xd14a('0x15'),{})[_0xd14a('0x16')](function(_0x589657){if(_0x589657['error'])throw new Error(_0xd14a('0x1a'));var _0x11c759=_0x589657['result'];return _0x431d5b(_[_0xd14a('0x1b')]({},_0x529b9e,_0x11c759));});})[_0xd14a('0x1c')](function(_0x3c5e79){_0x48e261(_0x3c5e79);});});}function getRealtimeQueues(_0x57b76d,_0x2c851e){return new Promise(function(_0x53732,_0xfefa63){var _0x391680=_0x2c851e==='voice'?amiClient:routingClient;return _0x391680['request'](_[_0xd14a('0x1d')](_0x2c851e)+_0xd14a('0x1e'),_0x57b76d)[_0xd14a('0x16')](function(_0x2f3411){if(_0x2f3411['error'])throw new Error(util[_0xd14a('0x1f')](_0xd14a('0x20'),_0x2c851e));return _0x53732(_0x2f3411['result']);})[_0xd14a('0x1c')](function(_0x302794){_0xfefa63(_0x302794);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3d24b6,_0x566259){return amiClient['request']('VoiceQueuesChannels',{})[_0xd14a('0x16')](function(_0x12e701){if(_0x12e701[_0xd14a('0x17')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x3d24b6(_0x12e701[_0xd14a('0x19')]);})['catch'](function(_0x2cd504){_0x566259(_0x2cd504);});});}function initializeQueues(_0x58ac2a,_0xb8962e,_0x32a072,_0x2af461){var _0x4e1ae6=['loggedIn',_0xd14a('0x21'),_0xd14a('0x22'),_0xd14a('0x23'),_0xd14a('0x24')];if(_0x32a072===_0xd14a('0x25')&&_0x2af461===_0xd14a('0x26')){_0x4e1ae6['push'](_0xd14a('0x27'),_0xd14a('0x28'),'message',_0xd14a('0x29'),'dialMethod',_0xd14a('0x2a'),'startPredictive',_0xd14a('0x2b'),'erlangCalls','erlangCallToSecond',_0xd14a('0x2c'),'erlangBusyFactor','dialPredictiveInterval',_0xd14a('0x2d'),_0xd14a('0x2e'),_0xd14a('0x2f'),_0xd14a('0x30'),_0xd14a('0x31'),_0xd14a('0x32'),_0xd14a('0x33'),_0xd14a('0x34'),_0xd14a('0x35'));}return _0x58ac2a['map'](function(_0x23556a){var _0x5a2ba7=_0x23556a[_0xd14a('0x36')]({'plain':!![]});_0x5a2ba7['agents']=[];_0x5a2ba7[_0xd14a('0x24')]=0x0;_0x5a2ba7[_0xd14a('0x37')]=0x0;_0x5a2ba7[_0xd14a('0x38')]=0x0;_0x5a2ba7[_0xd14a('0x21')]=0x0;_0x5a2ba7[_0xd14a('0x22')]=0x0;if(_0x32a072===_0xd14a('0x25')){_0x5a2ba7['talking']=0x0;_0x5a2ba7[_0xd14a('0x39')]=0x0;if(_0x2af461==='outbound'){_0x5a2ba7[_0xd14a('0x27')]=0x0;_0x5a2ba7[_0xd14a('0x28')]=0x0;}}var _0x459268=_[_0xd14a('0x3a')](_0xb8962e,['id',_0x5a2ba7['id']]);if(_0x459268)_['merge'](_0x5a2ba7,_['pick'](_0x459268,_0x4e1ae6));return _0x5a2ba7;});}function updateAgentVoiceStatus(_0x387c56,_0x2532a9,_0x1c2c72){var _0x23632d=_[_0xd14a('0x3b')](_0x1c2c72,[_0xd14a('0x3c'),_0x2532a9[_0xd14a('0x12')]]);if(_0x23632d[_0xd14a('0x3d')]===0x0)return _0x387c56['busy']=!![];if(_[_0xd14a('0x3e')](_0x23632d,[_0xd14a('0x3f'),_0x387c56[_0xd14a('0x40')]['toString']()]))return _0x387c56['talking']=!![];if(!_0x387c56[_0xd14a('0x23')])return _0x387c56[_0xd14a('0x39')]=!![];}function getVoiceQueueAgents(_0x313812,_0x5796f0,_0x165a71,_0x46d346){var _0x49427a=_[_0xd14a('0x3a')](_0x5796f0,['id',_0x313812['id']]);if(!_0x49427a)return _0x313812;return _0x49427a[_0xd14a('0x41')]({'raw':!![]})[_0xd14a('0x16')](function(_0x2ac20e){for(var _0x66892e=0x0;_0x66892e<_0x2ac20e[_0xd14a('0x3d')];_0x66892e++){var _0xdc010e=_[_0xd14a('0x3a')](_0x165a71,['id',_0x2ac20e[_0x66892e][_0xd14a('0x42')]]);if(!_0xdc010e){_0xdc010e={'id':_0x2ac20e[_0x66892e][_0xd14a('0x42')],'name':_0x2ac20e[_0x66892e][_0xd14a('0x42')],'accountcode':'','online':![]};}var _0x469747={'id':_0xdc010e['id'],'name':_0xdc010e[_0xd14a('0x12')],'internal':_0xdc010e[_0xd14a('0x43')],'online':Boolean(_0xdc010e[_0xd14a('0x44')]),'paused':Boolean(_0x2ac20e[_0x66892e][_0xd14a('0x24')])};if(_0xdc010e[_0xd14a('0x45')]===_0xd14a('0x23'))updateAgentVoiceStatus(_0x469747,_0x313812,_0x46d346);if(_0x469747[_0xd14a('0x44')])_0x313812[_0xd14a('0x37')]++;if(_0x469747[_0xd14a('0x39')])_0x313812[_0xd14a('0x39')]++;if(_0x469747['paused']&&!_0x469747[_0xd14a('0x39')]&&!_0x469747[_0xd14a('0x23')])_0x313812['paused']++;_0x313812[_0xd14a('0x46')][_0xd14a('0x47')](_0x469747);}return _0x313812;});}function getQueueAgents(_0x3beaf2,_0x27b97e,_0x5b6924){var _0x5632da='User'+_[_0xd14a('0x1d')](_0x5b6924)+'Queue';var _0x4ca2c8=_0x5b6924+_0xd14a('0x48');return db[_0x5632da][_0xd14a('0x49')]({'where':{[_[_0xd14a('0x1d')](_0x5b6924)+_0xd14a('0x4a')]:_0x3beaf2['id']},'raw':!![]})[_0xd14a('0x16')](function(_0x19d939){for(var _0x2d4ece=0x0;_0x2d4ece<_0x19d939[_0xd14a('0x3d')];_0x2d4ece++){var _0x4d7c74=_['find'](_0x27b97e,['id',_0x19d939[_0x2d4ece][_0xd14a('0x42')]]);if(!_0x4d7c74){_0x4d7c74={'id':_0x19d939[_0x2d4ece][_0xd14a('0x42')],'name':_0x19d939[_0x2d4ece][_0xd14a('0x42')],'online':![],['pauseField']:![]};}var _0x267284={'id':_0x4d7c74['id'],'name':_0x4d7c74[_0xd14a('0x12')],'online':Boolean(_0x4d7c74['online']),'paused':Boolean(_0x4d7c74[_0x4ca2c8])};if(_0x267284[_0xd14a('0x44')])_0x3beaf2['loggedInDb']++;_0x3beaf2['agents'][_0xd14a('0x47')](_0x267284);}return _0x3beaf2;});}function isIdle(_0x523213){return _0x523213==='idle'||_0x523213===_0xd14a('0x4b')||_0x523213==='unavailable'||_0x523213==='ringing'||_[_0xd14a('0x4c')](_0x523213);}function isAgentPaused(_0x35fe98,_0x591b9e){var _0x591af9=[_0x35fe98['chatPause'],_0x35fe98[_0xd14a('0x4d')],_0x35fe98[_0xd14a('0x4e')],_0x35fe98[_0xd14a('0x4f')],_0x35fe98[_0xd14a('0x50')],_0x35fe98[_0xd14a('0x51')],_0x35fe98[_0xd14a('0x52')]];if(!_0x591b9e)return _[_0xd14a('0x53')](_0x591af9);var _0x40894d=_[_0xd14a('0x3b')](_0x591af9);return _0x40894d['length']>0x0&&_0x40894d[_0xd14a('0x3d')]<_0x591af9[_0xd14a('0x3d')]?!![]:![];}function isAgentIdle(_0x5e955d){if(_0x5e955d[_0xd14a('0x45')]!==_0xd14a('0x54')&&_0x5e955d[_0xd14a('0x51')]){_0x5e955d[_0xd14a('0x45')]=_0xd14a('0x55');return![];}return _['every']([_0x5e955d['chatStatus'],_0x5e955d[_0xd14a('0x56')],_0x5e955d[_0xd14a('0x57')],_0x5e955d[_0xd14a('0x58')],_0x5e955d[_0xd14a('0x59')],_0x5e955d[_0xd14a('0x45')],_0x5e955d[_0xd14a('0x5a')]],isIdle);}function getAgentStatus(_0x184e9b){var _0x32f7f5=_0xd14a('0x4b');if(isAgentPaused(_0x184e9b))_0x32f7f5=_0xd14a('0x55');else if(isAgentPaused(_0x184e9b,!![]))_0x32f7f5=_0xd14a('0x5b');else if(isAgentIdle(_0x184e9b))_0x32f7f5='idle';else _0x32f7f5=_0xd14a('0x39');return _0x32f7f5;}exports[_0xd14a('0x5c')]=function(_0x356e5a,_0x946aba){var _0x408b3a={'count':0x0,'rows':[]},_0x4abe8c={},_0x39c98e,_0x327870,_0x15c8d9=[_0xd14a('0x5d'),'online','lastLoginAt',_0xd14a('0x5e'),_0xd14a('0x5f'),_0xd14a('0x5e'),'internal',_0xd14a('0x60'),'chatPause','openchannelPause','mailPause',_0xd14a('0x50'),_0xd14a('0x52'),_0xd14a('0x4d'),_0xd14a('0x51'),_0xd14a('0x61'),_0xd14a('0x62'),_0xd14a('0x63'),'smsCapacity','whatsappCapacity',_0xd14a('0x64'),_0xd14a('0x65'),_0xd14a('0x66'),'mailCurrentCapacity',_0xd14a('0x67'),_0xd14a('0x68'),_0xd14a('0x69'),_0xd14a('0x6a'),_0xd14a('0x58'),_0xd14a('0x57'),'smsStatus','whatsappStatus','faxStatus','voiceStatus',_0xd14a('0x6b'),_0xd14a('0x6c'),_0xd14a('0x6d'),'smsStatusTime',_0xd14a('0x6e'),_0xd14a('0x6f'),'voiceStatusTime','queue','destconnectedlinenum','screenrecording',_0xd14a('0x70'),_0xd14a('0x71'),_0xd14a('0x72')],_0x5f326b=[_0xd14a('0x73'),'openchannelPause',_0xd14a('0x4e'),_0xd14a('0x50'),_0xd14a('0x52'),_0xd14a('0x4d'),_0xd14a('0x51'),_0xd14a('0x44')];Promise[_0xd14a('0x74')]()[_0xd14a('0x16')](function(){var _0x416ccf=_['map'](db[_0xd14a('0x75')][_0xd14a('0x76')],function(_0x3ef6f3){return{'name':_0x3ef6f3[_0xd14a('0x77')],'type':_0x3ef6f3[_0xd14a('0x78')][_0xd14a('0x79')]};});_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x7b')]=_0xd14a('0x7c');_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x44')]=!![];_0x4abe8c=qs[_0xd14a('0x7d')](_0x416ccf,_0x356e5a);_0x4abe8c[_0xd14a('0x7e')]=!![];if(_0x356e5a[_0xd14a('0x7f')]['role']===_0xd14a('0x7f')){var _0x262359={'params':{'id':_0x356e5a[_0xd14a('0x7f')]['userProfileId']},'query':{'section':_0xd14a('0x15'),'role':'agent','online':!![],'nolimit':_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x80')],'sort':_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x81')],'filter':_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x3b')]},'raw':!![]};return db['UserProfile'][_0xd14a('0x82')](_0x262359);}return db[_0xd14a('0x75')]['findAndCountAll'](_0x4abe8c);})[_0xd14a('0x16')](function(_0xeafded){_0x408b3a[_0xd14a('0xb')]=_0xeafded[_0xd14a('0xb')];_0x39c98e=_0xeafded[_0xd14a('0x83')];return getRealtimeAgents();})[_0xd14a('0x16')](function(_0x5b6619){_0x327870=_0x5b6619[_0xd14a('0x83')];return _0x39c98e[_0xd14a('0x84')](function(_0x7b028){var _0x287bf2=_[_0xd14a('0x3a')](_0x327870,['id',_0x7b028['id']]);if(_0x287bf2)_[_0xd14a('0x1b')](_0x7b028,_['pick'](_[_0xd14a('0x85')](_0x287bf2,_0x5f326b),_0x15c8d9));_0x7b028[_0xd14a('0x86')]=getAgentStatus(_0x7b028);return _0x7b028;});})[_0xd14a('0x16')](function(_0x2461a0){if(_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x87')]){var _0x47cad3=_['filter'](_0x2461a0,[_0xd14a('0x86'),_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x87')]]);if(_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x88')]){_0x47cad3=_[_0xd14a('0x3b')](_0x47cad3,[_0xd14a('0x5f'),_0x356e5a[_0xd14a('0x7a')][_0xd14a('0x88')]]);}}_0x408b3a[_0xd14a('0x83')]=_0x47cad3||_0x2461a0;return _0x408b3a;})['then'](respondWithFilteredResult(_0x946aba,_0x4abe8c))['catch'](handleError(_0x946aba,null));};exports[_0xd14a('0x89')]=function(_0x3f7f81,_0x4fadf9){var _0x1aa987=[_0xd14a('0x8a'),_0xd14a('0x8b'),'sms',_0xd14a('0x8c'),_0xd14a('0x8d'),_0xd14a('0x8e'),_0xd14a('0x25')];var _0x3b0c43={'count':0x0,'rows':[]},_0x34a18e={},_0x27cf99,_0x4ce630,_0x460ce,_0x1a4dda,_0x226ecd;Promise['resolve']()[_0xd14a('0x16')](function(){if(_0x3f7f81[_0xd14a('0x7a')]['channel']){if(!_[_0xd14a('0x8f')](_0x1aa987,_0x3f7f81[_0xd14a('0x7a')][_0xd14a('0x90')][_0xd14a('0x91')]()))throw new Error('Invalid\x20channel');_0x27cf99=_0x3f7f81[_0xd14a('0x7a')][_0xd14a('0x90')][_0xd14a('0x91')]();}var _0x5dc43e=_[_0xd14a('0x1d')](_0x27cf99)+_0xd14a('0x92');var _0x258a0d=_[_0xd14a('0x84')](db[_0x5dc43e][_0xd14a('0x76')],function(_0x2a1ce6){return{'name':_0x2a1ce6['fieldName'],'type':_0x2a1ce6[_0xd14a('0x78')][_0xd14a('0x79')]};});_0x34a18e=qs['getOptions'](_0x258a0d,_0x3f7f81);if(_0x3f7f81[_0xd14a('0x7f')][_0xd14a('0x7b')]===_0xd14a('0x7f')){var _0xd8c5e0={'params':{'id':_0x3f7f81[_0xd14a('0x7f')][_0xd14a('0x93')]},'query':{'section':_0x27cf99===_0xd14a('0x25')&&_0x3f7f81[_0xd14a('0x7a')][_0xd14a('0x78')]===_0xd14a('0x26')?_0xd14a('0x94'):_[_0xd14a('0x1d')](_0x27cf99)+'Queues','type':_0x3f7f81['query'][_0xd14a('0x78')],'nolimit':!![],'sort':_0xd14a('0x12'),'filter':_0x3f7f81[_0xd14a('0x7a')][_0xd14a('0x3b')]}};return db[_0xd14a('0x95')][_0xd14a('0x82')](_0xd8c5e0);}return db[_0x5dc43e][_0xd14a('0x96')](_0x34a18e);})['then'](function(_0xd1b15d){_0x3b0c43[_0xd14a('0xb')]=_0xd1b15d[_0xd14a('0xb')];_0x4ce630=_0xd1b15d['rows'];return getRealtimeQueues(_0x3f7f81,_0x27cf99);})[_0xd14a('0x16')](function(_0x338abd){_0x1a4dda=_0x338abd[_0xd14a('0x83')];return getRealtimeAgents();})[_0xd14a('0x16')](function(_0x550325){_0x460ce=_0x550325[_0xd14a('0x83')];if(_0x27cf99!=_0xd14a('0x25'))return;return getRealtimeVoiceQueueChannels();})[_0xd14a('0x16')](function(_0x5403b0){_0x226ecd=_0x5403b0?_0x5403b0[_0xd14a('0x83')]:[];return initializeQueues(_0x4ce630,_0x1a4dda,_0x27cf99,_0x3f7f81[_0xd14a('0x7a')][_0xd14a('0x78')]);})[_0xd14a('0x16')](function(_0x5cc5ed){var _0xa5982e=_0x5cc5ed[_0xd14a('0x84')](function(_0x306c8e){if(_0x27cf99==='voice')return getVoiceQueueAgents(_0x306c8e,_0x4ce630,_0x460ce,_0x226ecd);else return getQueueAgents(_0x306c8e,_0x460ce,_0x27cf99);});return Promise[_0xd14a('0x97')](_0xa5982e);})[_0xd14a('0x16')](function(_0x2f48a9){_0x3b0c43[_0xd14a('0x83')]=_0x2f48a9;return _0x3b0c43;})[_0xd14a('0x16')](respondWithFilteredResult(_0x4fadf9,_0x34a18e))[_0xd14a('0x1c')](handleError(_0x4fadf9,null));}; \ No newline at end of file +var _0x85a7=['pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','type','QueueCampaigns','findAndCountAll','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','client','offset','undefined','limit','count','Content-Range','json','error','stack','name','status','send','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','outbound','pick','queue','internal','toString','find','getMembers','UserId','accountcode','voiceStatus','User','Queue','Pause','findAll','length','online','unavailable','ringing','isNil','faxPause','mailPause','smsPause','whatsappPause','every','filter','idle','voicePause','pause','chatStatus','faxStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','chatPause','openchannelPause','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','mailStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','rawAttributes','fieldName','key','query','role','agent','getOptions','raw','user','userProfileId','nolimit','sort','UserProfile','getResources','rows','merge','globalStatusFilter'];(function(_0x36936c,_0x4650c9){var _0x36c512=function(_0x3a96f3){while(--_0x3a96f3){_0x36936c['push'](_0x36936c['shift']());}};_0x36c512(++_0x4650c9);}(_0x85a7,0x1e9));var _0x785a=function(_0xbe781f,_0x1b685a){_0xbe781f=_0xbe781f-0x0;var _0x4580ee=_0x85a7[_0xbe781f];return _0x4580ee;};'use strict';var util=require(_0x785a('0x0'));var _=require('lodash');var jayson=require(_0x785a('0x1'));var qs=require(_0x785a('0x2'));var logger=require(_0x785a('0x3'))(_0x785a('0x4'));var db=require(_0x785a('0x5'))['db'];var amiClient=jayson['client'][_0x785a('0x6')]({'port':0x232a});var routingClient=jayson[_0x785a('0x7')][_0x785a('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x3241ec,_0x4a9eb1){return function(_0x207306){if(_0x207306){var _0x1db648=typeof _0x4a9eb1[_0x785a('0x8')]===_0x785a('0x9')&&typeof _0x4a9eb1[_0x785a('0xa')]==='undefined';var _0x4d86a8=_0x207306[_0x785a('0xb')];var _0x3218eb=_0x1db648?0x0:_0x4a9eb1[_0x785a('0x8')];var _0x5dea32=_0x1db648?_0x207306[_0x785a('0xb')]:_0x4a9eb1[_0x785a('0x8')]+_0x4a9eb1[_0x785a('0xa')];var _0xe1510d;if(_0x5dea32>=_0x4d86a8){_0x5dea32=_0x4d86a8;_0xe1510d=0xc8;}else{_0xe1510d=0xce;}_0x3241ec['status'](_0xe1510d);return _0x3241ec['set'](_0x785a('0xc'),_0x3218eb+'-'+_0x5dea32+'/'+_0x4d86a8)[_0x785a('0xd')](_0x207306);}return null;};}function handleError(_0xb7399,_0x2fb06d){_0x2fb06d=_0x2fb06d||0x1f4;return function(_0x42a9a6){logger[_0x785a('0xe')](_0x42a9a6[_0x785a('0xf')]);if(_0x42a9a6[_0x785a('0x10')]){delete _0x42a9a6[_0x785a('0x10')];}_0xb7399[_0x785a('0x11')](_0x2fb06d)[_0x785a('0x12')](_0x42a9a6);};}function getRealtimeAgents(){return new Promise(function(_0x1cf893,_0x491962){return amiClient[_0x785a('0x13')](_0x785a('0x14'),{})['then'](function(_0x5be525){if(_0x5be525[_0x785a('0xe')])throw new Error(_0x785a('0x15'));var _0x5e9215=_0x5be525[_0x785a('0x16')];return routingClient[_0x785a('0x13')](_0x785a('0x14'),{})['then'](function(_0x2a2732){if(_0x2a2732[_0x785a('0xe')])throw new Error(_0x785a('0x17'));var _0x146a17=_0x2a2732[_0x785a('0x16')];return _0x1cf893(_['merge']({},_0x5e9215,_0x146a17));});})[_0x785a('0x18')](function(_0x585b6f){_0x491962(_0x585b6f);});});}function getRealtimeQueues(_0x14820a,_0x1540c6){return new Promise(function(_0x4fecc8,_0x185c23){var _0x97b1c3=_0x1540c6===_0x785a('0x19')?amiClient:routingClient;return _0x97b1c3['request'](_[_0x785a('0x1a')](_0x1540c6)+_0x785a('0x1b'),_0x14820a)[_0x785a('0x1c')](function(_0x4b5633){if(_0x4b5633[_0x785a('0xe')])throw new Error(util[_0x785a('0x1d')](_0x785a('0x1e'),_0x1540c6));return _0x4fecc8(_0x4b5633['result']);})[_0x785a('0x18')](function(_0x39fd14){_0x185c23(_0x39fd14);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5e9f14,_0x2384a0){return amiClient[_0x785a('0x13')](_0x785a('0x1f'),{})['then'](function(_0x46f175){if(_0x46f175[_0x785a('0xe')])throw new Error(_0x785a('0x20'));return _0x5e9f14(_0x46f175[_0x785a('0x16')]);})[_0x785a('0x18')](function(_0x375856){_0x2384a0(_0x375856);});});}function initializeQueues(_0x139771,_0x1c0364,_0x1d69e0,_0x969ed3){var _0x476774=[_0x785a('0x21'),_0x785a('0x22'),'waiting',_0x785a('0x23'),_0x785a('0x24')];if(_0x1d69e0===_0x785a('0x19')&&_0x969ed3==='outbound'){_0x476774[_0x785a('0x25')](_0x785a('0x26'),_0x785a('0x27'),_0x785a('0x28'),_0x785a('0x29'),_0x785a('0x2a'),_0x785a('0x2b'),_0x785a('0x2c'),_0x785a('0x2d'),_0x785a('0x2e'),_0x785a('0x2f'),_0x785a('0x30'),_0x785a('0x31'),'dialPredictiveInterval',_0x785a('0x32'),'dialPredictiveIntervalMinThreshold',_0x785a('0x33'),_0x785a('0x34'),_0x785a('0x35'),_0x785a('0x36'),_0x785a('0x37'),_0x785a('0x38'),_0x785a('0x39'));}return _0x139771[_0x785a('0x3a')](function(_0x2356ba){var _0x2a1e2b=_0x2356ba[_0x785a('0x3b')]({'plain':!![]});_0x2a1e2b[_0x785a('0x3c')]=[];_0x2a1e2b[_0x785a('0x24')]=0x0;_0x2a1e2b[_0x785a('0x3d')]=0x0;_0x2a1e2b[_0x785a('0x21')]=0x0;_0x2a1e2b[_0x785a('0x22')]=0x0;_0x2a1e2b['waiting']=0x0;if(_0x1d69e0===_0x785a('0x19')){_0x2a1e2b[_0x785a('0x23')]=0x0;_0x2a1e2b[_0x785a('0x3e')]=0x0;if(_0x969ed3===_0x785a('0x3f')){_0x2a1e2b[_0x785a('0x26')]=0x0;_0x2a1e2b['originated']=0x0;}}var _0x1d0884=_['find'](_0x1c0364,['id',_0x2a1e2b['id']]);if(_0x1d0884)_['merge'](_0x2a1e2b,_[_0x785a('0x40')](_0x1d0884,_0x476774));return _0x2a1e2b;});}function updateAgentVoiceStatus(_0x4ee258,_0x1e94af,_0x24ff37){var _0x5968a3=_['filter'](_0x24ff37,[_0x785a('0x41'),_0x1e94af[_0x785a('0x10')]]);if(_0x5968a3['length']===0x0)return _0x4ee258['busy']=!![];if(_['some'](_0x5968a3,['connectedlinenum',_0x4ee258[_0x785a('0x42')][_0x785a('0x43')]()]))return _0x4ee258[_0x785a('0x23')]=!![];if(!_0x4ee258['talking'])return _0x4ee258['busy']=!![];}function getVoiceQueueAgents(_0x2f8a14,_0x2120e5,_0x2e0a35,_0x2a4c72){var _0x902716=_[_0x785a('0x44')](_0x2120e5,['id',_0x2f8a14['id']]);if(!_0x902716)return _0x2f8a14;return _0x902716[_0x785a('0x45')]({'raw':!![]})[_0x785a('0x1c')](function(_0x4d8b4f){for(var _0x1de089=0x0;_0x1de089<_0x4d8b4f['length'];_0x1de089++){var _0x13e65b=_[_0x785a('0x44')](_0x2e0a35,['id',_0x4d8b4f[_0x1de089][_0x785a('0x46')]]);if(!_0x13e65b){_0x13e65b={'id':_0x4d8b4f[_0x1de089][_0x785a('0x46')],'name':_0x4d8b4f[_0x1de089][_0x785a('0x46')],'accountcode':'','online':![]};}var _0x51df0e={'id':_0x13e65b['id'],'name':_0x13e65b[_0x785a('0x10')],'internal':_0x13e65b[_0x785a('0x47')],'online':Boolean(_0x13e65b['online']),'paused':Boolean(_0x4d8b4f[_0x1de089]['paused'])};if(_0x13e65b[_0x785a('0x48')]==='talking')updateAgentVoiceStatus(_0x51df0e,_0x2f8a14,_0x2a4c72);if(_0x51df0e['online'])_0x2f8a14['loggedInDb']++;if(_0x51df0e[_0x785a('0x3e')])_0x2f8a14[_0x785a('0x3e')]++;if(_0x51df0e[_0x785a('0x24')]&&!_0x51df0e[_0x785a('0x3e')]&&!_0x51df0e[_0x785a('0x23')])_0x2f8a14[_0x785a('0x24')]++;_0x2f8a14[_0x785a('0x3c')][_0x785a('0x25')](_0x51df0e);}return _0x2f8a14;});}function getQueueAgents(_0x4ba716,_0x4ff8d6,_0x1a92aa){var _0x511a7a=_0x785a('0x49')+_[_0x785a('0x1a')](_0x1a92aa)+_0x785a('0x4a');var _0x1cf18d=_0x1a92aa+_0x785a('0x4b');return db[_0x511a7a][_0x785a('0x4c')]({'where':{[_[_0x785a('0x1a')](_0x1a92aa)+'QueueId']:_0x4ba716['id']},'raw':!![]})[_0x785a('0x1c')](function(_0x8bb01f){for(var _0x2ba795=0x0;_0x2ba795<_0x8bb01f[_0x785a('0x4d')];_0x2ba795++){var _0x886ce1=_[_0x785a('0x44')](_0x4ff8d6,['id',_0x8bb01f[_0x2ba795][_0x785a('0x46')]]);if(!_0x886ce1){_0x886ce1={'id':_0x8bb01f[_0x2ba795][_0x785a('0x46')],'name':_0x8bb01f[_0x2ba795][_0x785a('0x46')],'online':![],['pauseField']:![]};}var _0xc0fde0={'id':_0x886ce1['id'],'name':_0x886ce1[_0x785a('0x10')],'online':Boolean(_0x886ce1[_0x785a('0x4e')]),'paused':Boolean(_0x886ce1[_0x1cf18d])};if(_0xc0fde0[_0x785a('0x4e')])_0x4ba716[_0x785a('0x3d')]++;_0x4ba716[_0x785a('0x3c')][_0x785a('0x25')](_0xc0fde0);}return _0x4ba716;});}function isIdle(_0x55e8ce){return _0x55e8ce==='idle'||_0x55e8ce==='unknown'||_0x55e8ce===_0x785a('0x4f')||_0x55e8ce===_0x785a('0x50')||_[_0x785a('0x51')](_0x55e8ce);}function isAgentPaused(_0xdcace,_0x330a16){var _0x533d40=[_0xdcace['chatPause'],_0xdcace[_0x785a('0x52')],_0xdcace[_0x785a('0x53')],_0xdcace['openchannelPause'],_0xdcace[_0x785a('0x54')],_0xdcace['voicePause'],_0xdcace[_0x785a('0x55')]];if(!_0x330a16)return _[_0x785a('0x56')](_0x533d40);var _0x4f18c3=_[_0x785a('0x57')](_0x533d40);return _0x4f18c3[_0x785a('0x4d')]>0x0&&_0x4f18c3[_0x785a('0x4d')]<_0x533d40[_0x785a('0x4d')]?!![]:![];}function isAgentIdle(_0x39e9ec){if(_0x39e9ec['voiceStatus']!==_0x785a('0x58')&&_0x39e9ec[_0x785a('0x59')]){_0x39e9ec[_0x785a('0x48')]=_0x785a('0x5a');return![];}return _[_0x785a('0x56')]([_0x39e9ec[_0x785a('0x5b')],_0x39e9ec[_0x785a('0x5c')],_0x39e9ec['mailStatus'],_0x39e9ec['openchannelStatus'],_0x39e9ec[_0x785a('0x5d')],_0x39e9ec[_0x785a('0x48')],_0x39e9ec[_0x785a('0x5e')]],isIdle);}function getAgentStatus(_0x509120){var _0x7468d0='unknown';if(isAgentPaused(_0x509120))_0x7468d0='pause';else if(isAgentPaused(_0x509120,!![]))_0x7468d0=_0x785a('0x5f');else if(isAgentIdle(_0x509120))_0x7468d0=_0x785a('0x58');else _0x7468d0=_0x785a('0x3e');return _0x7468d0;}exports[_0x785a('0x60')]=function(_0x1e3560,_0x56cadc){var _0x5f0c0c={'count':0x0,'rows':[]},_0x3d40fb={},_0xc27ee8,_0x1bc3a0,_0x1f0a3c=[_0x785a('0x61'),_0x785a('0x4e'),_0x785a('0x62'),_0x785a('0x63'),_0x785a('0x64'),'lastPauseAt',_0x785a('0x42'),_0x785a('0x65'),_0x785a('0x66'),_0x785a('0x67'),_0x785a('0x53'),_0x785a('0x54'),_0x785a('0x55'),'faxPause',_0x785a('0x59'),_0x785a('0x68'),'openchannelCapacity',_0x785a('0x69'),_0x785a('0x6a'),_0x785a('0x6b'),'faxCapacity',_0x785a('0x6c'),_0x785a('0x6d'),_0x785a('0x6e'),_0x785a('0x6f'),_0x785a('0x70'),'faxCurrentCapacity',_0x785a('0x5b'),_0x785a('0x71'),_0x785a('0x72'),_0x785a('0x5d'),_0x785a('0x5e'),_0x785a('0x5c'),_0x785a('0x48'),_0x785a('0x73'),_0x785a('0x74'),'mailStatusTime',_0x785a('0x75'),_0x785a('0x76'),_0x785a('0x77'),_0x785a('0x78'),'queue',_0x785a('0x79'),_0x785a('0x7a'),_0x785a('0x7b'),_0x785a('0x7c'),_0x785a('0x7d')],_0x1979df=[_0x785a('0x66'),_0x785a('0x67'),'mailPause',_0x785a('0x54'),'whatsappPause','faxPause',_0x785a('0x59'),_0x785a('0x4e')];Promise['resolve']()[_0x785a('0x1c')](function(){var _0x5764f7=_[_0x785a('0x3a')](db['User'][_0x785a('0x7e')],function(_0x4d92fc){return{'name':_0x4d92fc[_0x785a('0x7f')],'type':_0x4d92fc['type'][_0x785a('0x80')]};});_0x1e3560[_0x785a('0x81')][_0x785a('0x82')]=_0x785a('0x83');_0x1e3560[_0x785a('0x81')][_0x785a('0x4e')]=!![];_0x3d40fb=qs[_0x785a('0x84')](_0x5764f7,_0x1e3560);_0x3d40fb[_0x785a('0x85')]=!![];if(_0x1e3560[_0x785a('0x86')][_0x785a('0x82')]===_0x785a('0x86')){var _0x76724f={'params':{'id':_0x1e3560[_0x785a('0x86')][_0x785a('0x87')]},'query':{'section':_0x785a('0x14'),'role':'agent','online':!![],'nolimit':_0x1e3560[_0x785a('0x81')][_0x785a('0x88')],'sort':_0x1e3560[_0x785a('0x81')][_0x785a('0x89')],'filter':_0x1e3560[_0x785a('0x81')][_0x785a('0x57')]},'raw':!![]};return db[_0x785a('0x8a')][_0x785a('0x8b')](_0x76724f);}return db[_0x785a('0x49')]['findAndCountAll'](_0x3d40fb);})[_0x785a('0x1c')](function(_0x1650c2){_0x5f0c0c['count']=_0x1650c2[_0x785a('0xb')];_0xc27ee8=_0x1650c2['rows'];return getRealtimeAgents();})[_0x785a('0x1c')](function(_0x1cd3d5){_0x1bc3a0=_0x1cd3d5[_0x785a('0x8c')];return _0xc27ee8[_0x785a('0x3a')](function(_0x40aefd){var _0x35a0fc=_[_0x785a('0x44')](_0x1bc3a0,['id',_0x40aefd['id']]);if(_0x35a0fc)_[_0x785a('0x8d')](_0x40aefd,_[_0x785a('0x40')](_['omit'](_0x35a0fc,_0x1979df),_0x1f0a3c));_0x40aefd['globalStatus']=getAgentStatus(_0x40aefd);return _0x40aefd;});})[_0x785a('0x1c')](function(_0x2243d0){if(_0x1e3560['query'][_0x785a('0x8e')]){var _0x5ef5b9=_['filter'](_0x2243d0,['globalStatus',_0x1e3560['query']['globalStatusFilter']]);if(_0x1e3560[_0x785a('0x81')][_0x785a('0x8f')]){_0x5ef5b9=_[_0x785a('0x57')](_0x5ef5b9,[_0x785a('0x64'),_0x1e3560['query']['pauseTypeFilter']]);}}_0x5f0c0c[_0x785a('0x8c')]=_0x5ef5b9||_0x2243d0;return _0x5f0c0c;})[_0x785a('0x1c')](respondWithFilteredResult(_0x56cadc,_0x3d40fb))[_0x785a('0x18')](handleError(_0x56cadc,null));};exports[_0x785a('0x90')]=function(_0x48c7b4,_0xcc8718){var _0x6f81aa=[_0x785a('0x91'),_0x785a('0x92'),_0x785a('0x93'),_0x785a('0x94'),_0x785a('0x95'),_0x785a('0x96'),_0x785a('0x19')];var _0x2a19b7={'count':0x0,'rows':[]},_0x48ecfa={},_0x20b98d,_0x590c95,_0x51a571,_0x5170e1,_0x508591;Promise['resolve']()[_0x785a('0x1c')](function(){if(_0x48c7b4['query'][_0x785a('0x97')]){if(!_[_0x785a('0x98')](_0x6f81aa,_0x48c7b4[_0x785a('0x81')]['channel'][_0x785a('0x99')]()))throw new Error(_0x785a('0x9a'));_0x20b98d=_0x48c7b4[_0x785a('0x81')][_0x785a('0x97')][_0x785a('0x99')]();}var _0x59a190=_[_0x785a('0x1a')](_0x20b98d)+_0x785a('0x4a');var _0x30249b=_[_0x785a('0x3a')](db[_0x59a190][_0x785a('0x7e')],function(_0x104c6d){return{'name':_0x104c6d[_0x785a('0x7f')],'type':_0x104c6d[_0x785a('0x9b')][_0x785a('0x80')]};});_0x48ecfa=qs[_0x785a('0x84')](_0x30249b,_0x48c7b4);if(_0x48c7b4[_0x785a('0x86')][_0x785a('0x82')]===_0x785a('0x86')){var _0x1d8e30={'params':{'id':_0x48c7b4[_0x785a('0x86')][_0x785a('0x87')]},'query':{'section':_0x20b98d==='voice'&&_0x48c7b4[_0x785a('0x81')]['type']===_0x785a('0x3f')?_0x785a('0x9c'):_[_0x785a('0x1a')](_0x20b98d)+_0x785a('0x1b'),'type':_0x48c7b4[_0x785a('0x81')][_0x785a('0x9b')],'nolimit':!![],'sort':_0x785a('0x10'),'filter':_0x48c7b4['query'][_0x785a('0x57')]}};return db[_0x785a('0x8a')][_0x785a('0x8b')](_0x1d8e30);}return db[_0x59a190][_0x785a('0x9d')](_0x48ecfa);})['then'](function(_0x4936cd){_0x2a19b7[_0x785a('0xb')]=_0x4936cd[_0x785a('0xb')];_0x590c95=_0x4936cd['rows'];return getRealtimeQueues(_0x48c7b4,_0x20b98d);})['then'](function(_0x594712){_0x5170e1=_0x594712[_0x785a('0x8c')];return getRealtimeAgents();})['then'](function(_0xa56206){_0x51a571=_0xa56206[_0x785a('0x8c')];if(_0x20b98d!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x785a('0x1c')](function(_0x3cf3de){_0x508591=_0x3cf3de?_0x3cf3de[_0x785a('0x8c')]:[];return initializeQueues(_0x590c95,_0x5170e1,_0x20b98d,_0x48c7b4[_0x785a('0x81')][_0x785a('0x9b')]);})['then'](function(_0x2e9eaf){var _0x31f3d0=_0x2e9eaf[_0x785a('0x3a')](function(_0x4f609f){if(_0x20b98d==='voice')return getVoiceQueueAgents(_0x4f609f,_0x590c95,_0x51a571,_0x508591);else return getQueueAgents(_0x4f609f,_0x51a571,_0x20b98d);});return Promise['all'](_0x31f3d0);})[_0x785a('0x1c')](function(_0x51b870){_0x2a19b7[_0x785a('0x8c')]=_0x51b870;return _0x2a19b7;})[_0x785a('0x1c')](respondWithFilteredResult(_0xcc8718,_0x48ecfa))[_0x785a('0x18')](handleError(_0xcc8718,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ab2eaa9..a8c5110 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x666eb9,_0x5a9e90){var _0x3fc80b=function(_0x4ec6ff){while(--_0x4ec6ff){_0x666eb9['push'](_0x666eb9['shift']());}};_0x3fc80b(++_0x5a9e90);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x280b5a,_0x1768fc){var _0xfff2c3=function(_0x34a7c5){while(--_0x34a7c5){_0x280b5a['push'](_0x280b5a['shift']());}};_0xfff2c3(++_0x1768fc);}(_0x70e0,0x17b));var _0x070e=function(_0x367c9a,_0x14c6af){_0x367c9a=_0x367c9a-0x0;var _0x266256=_0x70e0[_0x367c9a];return _0x266256;};'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 d9ce811..f55080c 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 _0x6075=['DATE','exports','INTEGER','STRING'];(function(_0x2c388a,_0x452f8c){var _0xf2402b=function(_0x58a7d8){while(--_0x58a7d8){_0x2c388a['push'](_0x2c388a['shift']());}};_0xf2402b(++_0x452f8c);}(_0x6075,0x191));var _0x5607=function(_0x1d5bc7,_0x5da721){_0x1d5bc7=_0x1d5bc7-0x0;var _0x593364=_0x6075[_0x1d5bc7];return _0x593364;};'use strict';var Sequelize=require('sequelize');module[_0x5607('0x0')]={'state':{'type':Sequelize[_0x5607('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5607('0x2')]},'scheduledat':{'type':Sequelize[_0x5607('0x3')]},'uniqueid':{'type':Sequelize[_0x5607('0x2')]},'starttime':{'type':Sequelize[_0x5607('0x3')]},'responsetime':{'type':Sequelize[_0x5607('0x3')]},'ringtime':{'type':Sequelize[_0x5607('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5607('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5607('0x2')]}}; \ No newline at end of file +var _0x2af8=['STRING','DATE','sequelize','INTEGER'];(function(_0x3636e0,_0x419de2){var _0x4b27ee=function(_0x28d061){while(--_0x28d061){_0x3636e0['push'](_0x3636e0['shift']());}};_0x4b27ee(++_0x419de2);}(_0x2af8,0xf6));var _0x82af=function(_0x15fdff,_0x40d5b2){_0x15fdff=_0x15fdff-0x0;var _0x5450ed=_0x2af8[_0x15fdff];return _0x5450ed;};'use strict';var Sequelize=require(_0x82af('0x0'));module['exports']={'state':{'type':Sequelize[_0x82af('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x82af('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x82af('0x2')]},'starttime':{'type':Sequelize[_0x82af('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x82af('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x82af('0x2')]},'membername':{'type':Sequelize[_0x82af('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 4ccc23e..8c24220 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 _0x5ac4=['exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./reportAgentPreview.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ac4,0x10c));var _0x45ac=function(_0x5373d5,_0x2aacd1){_0x5373d5=_0x5373d5-0x0;var _0x39cdeb=_0x5ac4[_0x5373d5];return _0x39cdeb;};'use strict';var _=require(_0x45ac('0x0'));var util=require('util');var logger=require(_0x45ac('0x1'))(_0x45ac('0x2'));var moment=require(_0x45ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x45ac('0x4'));var fs=require('fs');var path=require(_0x45ac('0x5'));var rimraf=require(_0x45ac('0x6'));var config=require('../../config/environment');var attributes=require(_0x45ac('0x7'));module[_0x45ac('0x8')]=function(_0x213188,_0x3cae9c){return _0x213188[_0x45ac('0x9')](_0x45ac('0xa'),attributes,{'tableName':_0x45ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab3c=['moment','rimraf','exports','report_agent_preview','lodash','util','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xab3c,0x1bd));var _0xcab3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab3c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcab3('0x0'));var util=require(_0xcab3('0x1'));var logger=require('../../config/logger')(_0xcab3('0x2'));var moment=require(_0xcab3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcab3('0x4'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xcab3('0x5')]=function(_0x21b6fe,_0x1cc03a){return _0x21b6fe['define']('ReportAgentPreview',attributes,{'tableName':_0xcab3('0x6'),'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 1ab266a..003dab1 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 _0x9580=['catch','ReportAgentPreview','options','raw','then','CreateReportAgentPreview','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0x9580,0xa0));var _0x0958=function(_0x496fd7,_0x30a991){_0x496fd7=_0x496fd7-0x0;var _0x1a280e=_0x9580[_0x496fd7];return _0x1a280e;};'use strict';var _=require(_0x0958('0x0'));var util=require('util');var moment=require(_0x0958('0x1'));var BPromise=require('bluebird');var rs=require(_0x0958('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0958('0x3'))['db'];var utils=require(_0x0958('0x4'));var logger=require(_0x0958('0x5'))(_0x0958('0x6'));var config=require(_0x0958('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0958('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4615,_0x1fdf82,_0x4a9bfb){return new BPromise(function(_0x486a1b,_0x3c6cdc){return client['request'](_0x1b4615,_0x4a9bfb)['then'](function(_0x2c3b2c){logger[_0x0958('0x9')](_0x0958('0xa'),_0x1fdf82,'request\x20sent');logger[_0x0958('0xb')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1fdf82,_0x0958('0xc'),JSON['stringify'](_0x2c3b2c));if(_0x2c3b2c[_0x0958('0xd')]){if(_0x2c3b2c[_0x0958('0xd')][_0x0958('0xe')]===0x1f4){logger[_0x0958('0xd')](_0x0958('0xa'),_0x1fdf82,_0x2c3b2c[_0x0958('0xd')][_0x0958('0xf')]);return _0x3c6cdc(_0x2c3b2c['error'][_0x0958('0xf')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1fdf82,_0x2c3b2c[_0x0958('0xd')]['message']);return _0x486a1b(_0x2c3b2c[_0x0958('0xd')][_0x0958('0xf')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x1fdf82,_0x0958('0xc'));_0x486a1b(_0x2c3b2c['result'][_0x0958('0xf')]);}})[_0x0958('0x10')](function(_0x1e17da){logger[_0x0958('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x1fdf82,_0x1e17da);_0x3c6cdc(_0x1e17da);});});}exports['CreateReportAgentPreview']=function(_0x546d26){var _0x6d5994=this;return new Promise(function(_0x18ceac,_0x206853){return db[_0x0958('0x11')]['create'](_0x546d26['body'],{'raw':_0x546d26[_0x0958('0x12')]?_0x546d26[_0x0958('0x12')][_0x0958('0x13')]===undefined?!![]:![]:!![]})[_0x0958('0x14')](function(_0x39edda){logger[_0x0958('0x9')](_0x0958('0x15'),_0x546d26);logger[_0x0958('0xb')]('CreateReportAgentPreview',_0x546d26,JSON['stringify'](_0x39edda));_0x18ceac(_0x39edda);})['catch'](function(_0x1c02ab){logger[_0x0958('0xd')]('CreateReportAgentPreview',_0x1c02ab[_0x0958('0xf')],_0x546d26);_0x206853(_0x6d5994[_0x0958('0xd')](0x1f4,_0x1c02ab[_0x0958('0xf')]));});});}; \ No newline at end of file +var _0xec5b=['raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options'];(function(_0x5159a9,_0x590140){var _0x73a1a9=function(_0x570dd3){while(--_0x570dd3){_0x5159a9['push'](_0x5159a9['shift']());}};_0x73a1a9(++_0x590140);}(_0xec5b,0x137));var _0xbec5=function(_0x15b4a1,_0x4d5f97){_0x15b4a1=_0x15b4a1-0x0;var _0x307a63=_0xec5b[_0x15b4a1];return _0x307a63;};'use strict';var _=require(_0xbec5('0x0'));var util=require(_0xbec5('0x1'));var moment=require(_0xbec5('0x2'));var BPromise=require(_0xbec5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbec5('0x4'));var db=require(_0xbec5('0x5'))['db'];var utils=require(_0xbec5('0x6'));var logger=require(_0xbec5('0x7'))(_0xbec5('0x8'));var config=require(_0xbec5('0x9'));var jayson=require(_0xbec5('0xa'));var client=jayson[_0xbec5('0xb')][_0xbec5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2624f3,_0x24855f,_0x4e0809){return new BPromise(function(_0x1ff9a2,_0xaba839){return client[_0xbec5('0xd')](_0x2624f3,_0x4e0809)[_0xbec5('0xe')](function(_0x4c4aba){logger[_0xbec5('0xf')](_0xbec5('0x10'),_0x24855f,'request\x20sent');logger[_0xbec5('0x11')](_0xbec5('0x12'),_0x24855f,_0xbec5('0x13'),JSON[_0xbec5('0x14')](_0x4c4aba));if(_0x4c4aba['error']){if(_0x4c4aba[_0xbec5('0x15')][_0xbec5('0x16')]===0x1f4){logger[_0xbec5('0x15')](_0xbec5('0x10'),_0x24855f,_0x4c4aba[_0xbec5('0x15')][_0xbec5('0x17')]);return _0xaba839(_0x4c4aba[_0xbec5('0x15')][_0xbec5('0x17')]);}logger[_0xbec5('0x15')](_0xbec5('0x10'),_0x24855f,_0x4c4aba[_0xbec5('0x15')][_0xbec5('0x17')]);return _0x1ff9a2(_0x4c4aba[_0xbec5('0x15')][_0xbec5('0x17')]);}else{logger['info'](_0xbec5('0x10'),_0x24855f,_0xbec5('0x13'));_0x1ff9a2(_0x4c4aba[_0xbec5('0x18')][_0xbec5('0x17')]);}})[_0xbec5('0x19')](function(_0xb832ac){logger[_0xbec5('0x15')](_0xbec5('0x10'),_0x24855f,_0xb832ac);_0xaba839(_0xb832ac);});});}exports[_0xbec5('0x1a')]=function(_0x47ebac){var _0x5c63e2=this;return new Promise(function(_0x573d18,_0x159985){return db[_0xbec5('0x1b')][_0xbec5('0x1c')](_0x47ebac['body'],{'raw':_0x47ebac['options']?_0x47ebac[_0xbec5('0x1d')][_0xbec5('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x40a418){logger['info'](_0xbec5('0x1a'),_0x47ebac);logger['debug'](_0xbec5('0x1a'),_0x47ebac,JSON['stringify'](_0x40a418));_0x573d18(_0x40a418);})[_0xbec5('0x19')](function(_0x4e97e7){logger['error'](_0xbec5('0x1a'),_0x4e97e7[_0xbec5('0x17')],_0x47ebac);_0x159985(_0x5c63e2[_0xbec5('0x15')](0x1f4,_0x4e97e7[_0xbec5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index d9d1f97..294ecc7 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 _0xab06=['mail','/mail/queues/:id','showMailQueues','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','util','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','/campaigns','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify'];(function(_0x32e920,_0x4b21fd){var _0x4e9128=function(_0x40e0e5){while(--_0x40e0e5){_0x32e920['push'](_0x32e920['shift']());}};_0x4e9128(++_0x4b21fd);}(_0xab06,0x1e7));var _0x6ab0=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0xab06[_0x12ca5f];return _0xfc3ae9;};'use strict';var multer=require('multer');var util=require(_0x6ab0('0x0'));var path=require('path');var express=require(_0x6ab0('0x1'));var router=express[_0x6ab0('0x2')]();var auth=require(_0x6ab0('0x3'));var controller=require('./rpc.controller');router['get'](_0x6ab0('0x4'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x6')]);router[_0x6ab0('0x7')](_0x6ab0('0x8'),auth['isAuthenticated'](),controller[_0x6ab0('0x9')]);router[_0x6ab0('0x7')](_0x6ab0('0xa'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0xb')]);router[_0x6ab0('0x7')](_0x6ab0('0xc'),auth['isAuthenticated'](),controller[_0x6ab0('0xd')]);router[_0x6ab0('0x7')](_0x6ab0('0xe'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0xf')]);router['get'](_0x6ab0('0x10'),auth['isAuthenticated'](),controller[_0x6ab0('0x11')]);router[_0x6ab0('0x7')](_0x6ab0('0x12'),auth[_0x6ab0('0x5')](),controller['mailAccounts']);router[_0x6ab0('0x7')](_0x6ab0('0x13'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x14')]);router[_0x6ab0('0x7')]('/sms/queues',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x15')]);router[_0x6ab0('0x7')](_0x6ab0('0x16'),auth[_0x6ab0('0x5')](),controller['whatsappQueues']);router[_0x6ab0('0x7')](_0x6ab0('0x17'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x18')]);router[_0x6ab0('0x7')](_0x6ab0('0x19'),auth[_0x6ab0('0x5')](),controller['voiceQueuesPreview']);router['get']('/voice/queues/channels',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x1a')]);router[_0x6ab0('0x7')](_0x6ab0('0x1b'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x1c')]);router[_0x6ab0('0x7')](_0x6ab0('0x1d'),auth['isAuthenticated'](),controller[_0x6ab0('0x1e')]);router[_0x6ab0('0x7')](_0x6ab0('0x1f'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x20')]);router[_0x6ab0('0x7')](_0x6ab0('0x21'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x22')]);router[_0x6ab0('0x23')](_0x6ab0('0x21'),auth[_0x6ab0('0x5')](),controller['updateVoiceQueue']);router[_0x6ab0('0x7')]('/outbound',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x24')]);router[_0x6ab0('0x7')](_0x6ab0('0x25'),auth[_0x6ab0('0x5')](),controller['outboundChannels']);router[_0x6ab0('0x7')](_0x6ab0('0x26'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x27')]);router['put'](_0x6ab0('0x28'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x29')]);router[_0x6ab0('0x7')](_0x6ab0('0x2a'),auth['isAuthenticated'](),controller['telephones']);router[_0x6ab0('0x7')](_0x6ab0('0x2b'),auth[_0x6ab0('0x5')](),controller['trunks']);router[_0x6ab0('0x7')](_0x6ab0('0x2c'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x2d')]);router['get'](_0x6ab0('0x2e'),auth[_0x6ab0('0x5')](),controller['faxAccounts']);router[_0x6ab0('0x7')]('/chat/queues/waitinginteractions',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x2f')]);router[_0x6ab0('0x7')](_0x6ab0('0x30'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x6ab0('0x7')](_0x6ab0('0x31'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x32')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x6ab0('0x33')]);router[_0x6ab0('0x7')](_0x6ab0('0x34'),auth['isAuthenticated'](),controller[_0x6ab0('0x35')]);router['get'](_0x6ab0('0x36'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x37')]);router[_0x6ab0('0x7')](_0x6ab0('0x38'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x6ab0('0x39')]('/mail/queues/:id/notify',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x3a')](_0x6ab0('0x3b')));router['get'](_0x6ab0('0x3c'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x3d')]);router[_0x6ab0('0x39')]('/chat/queues/:id/notify',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x3a')]('chat'));router['get'](_0x6ab0('0x3e'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x3f')]);router[_0x6ab0('0x39')](_0x6ab0('0x40'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x3a')]('fax'));router['get']('/fax/queues/:id',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x41')]);router[_0x6ab0('0x39')]('/openchannel/queues/:id/notify',auth[_0x6ab0('0x5')](),controller['queueNotify'](_0x6ab0('0x42')));router[_0x6ab0('0x7')](_0x6ab0('0x43'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x44')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x6ab0('0x45')));router[_0x6ab0('0x39')](_0x6ab0('0x46'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x3a')](_0x6ab0('0x47')));router['get'](_0x6ab0('0x48'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x49')]);router[_0x6ab0('0x7')](_0x6ab0('0x4a'),auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x4b')]);router[_0x6ab0('0x39')]('/agents/:id/notify',auth[_0x6ab0('0x5')](),controller[_0x6ab0('0x4c')]);module[_0x6ab0('0x4d')]=router; \ No newline at end of file +var _0xdce6=['/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','get','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue'];(function(_0xea0e01,_0x34f32b){var _0x237450=function(_0x20c9a2){while(--_0x20c9a2){_0xea0e01['push'](_0xea0e01['shift']());}};_0x237450(++_0x34f32b);}(_0xdce6,0x1a7));var _0x6dce=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xdce6[_0x618414];return _0x21c19a;};'use strict';var multer=require('multer');var util=require(_0x6dce('0x0'));var path=require(_0x6dce('0x1'));var express=require(_0x6dce('0x2'));var router=express[_0x6dce('0x3')]();var auth=require(_0x6dce('0x4'));var controller=require('./rpc.controller');router[_0x6dce('0x5')]('/voice/channels',auth[_0x6dce('0x6')](),controller[_0x6dce('0x7')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x6dce('0x8')]);router[_0x6dce('0x5')](_0x6dce('0x9'),auth[_0x6dce('0x6')](),controller[_0x6dce('0xa')]);router[_0x6dce('0x5')]('/voice/queues',auth['isAuthenticated'](),controller[_0x6dce('0xb')]);router[_0x6dce('0x5')]('/chat/queues',auth[_0x6dce('0x6')](),controller[_0x6dce('0xc')]);router['get'](_0x6dce('0xd'),auth[_0x6dce('0x6')](),controller[_0x6dce('0xe')]);router[_0x6dce('0x5')]('/mail/accounts',auth[_0x6dce('0x6')](),controller['mailAccounts']);router[_0x6dce('0x5')](_0x6dce('0xf'),auth[_0x6dce('0x6')](),controller['openchannelQueues']);router[_0x6dce('0x5')](_0x6dce('0x10'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x11')]);router[_0x6dce('0x5')](_0x6dce('0x12'),auth[_0x6dce('0x6')](),controller['whatsappQueues']);router[_0x6dce('0x5')](_0x6dce('0x13'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x14')]);router[_0x6dce('0x5')](_0x6dce('0x15'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x16')]);router['get']('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x6dce('0x17')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x6dce('0x18')]);router['get'](_0x6dce('0x19'),auth['isAuthenticated'](),controller[_0x6dce('0x1a')]);router[_0x6dce('0x5')](_0x6dce('0x1b'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x1c')]);router[_0x6dce('0x5')](_0x6dce('0x1d'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x1e')]);router[_0x6dce('0x1f')](_0x6dce('0x1d'),auth['isAuthenticated'](),controller[_0x6dce('0x20')]);router[_0x6dce('0x5')](_0x6dce('0x21'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x22')]);router[_0x6dce('0x5')](_0x6dce('0x23'),auth['isAuthenticated'](),controller[_0x6dce('0x24')]);router['get'](_0x6dce('0x25'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x26')]);router['put'](_0x6dce('0x27'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x28')]);router[_0x6dce('0x5')]('/telephones',auth[_0x6dce('0x6')](),controller[_0x6dce('0x29')]);router[_0x6dce('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0x6dce('0x2a')]);router['get'](_0x6dce('0x2b'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x2c')]);router[_0x6dce('0x5')](_0x6dce('0x2d'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x2e')]);router['get']('/chat/queues/waitinginteractions',auth[_0x6dce('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x6dce('0x5')](_0x6dce('0x2f'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x30')]);router['get']('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x6dce('0x31')]);router[_0x6dce('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x6dce('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x6dce('0x5')]('/sms/queues/waitinginteractions',auth[_0x6dce('0x6')](),controller[_0x6dce('0x32')]);router[_0x6dce('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x6dce('0x6')](),controller[_0x6dce('0x33')]);router['get'](_0x6dce('0x34'),auth['isAuthenticated'](),controller[_0x6dce('0x35')]);router['post'](_0x6dce('0x36'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x37')](_0x6dce('0x38')));router['get'](_0x6dce('0x39'),auth['isAuthenticated'](),controller[_0x6dce('0x3a')]);router[_0x6dce('0x3b')](_0x6dce('0x3c'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x37')](_0x6dce('0x3d')));router[_0x6dce('0x5')](_0x6dce('0x3e'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x6dce('0x3b')](_0x6dce('0x3f'),auth['isAuthenticated'](),controller[_0x6dce('0x37')](_0x6dce('0x40')));router[_0x6dce('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x6dce('0x41')]);router[_0x6dce('0x3b')]('/openchannel/queues/:id/notify',auth[_0x6dce('0x6')](),controller[_0x6dce('0x37')](_0x6dce('0x42')));router[_0x6dce('0x5')]('/openchannel/queues/:id',auth[_0x6dce('0x6')](),controller['showOpenchannelQueues']);router[_0x6dce('0x3b')](_0x6dce('0x43'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x37')](_0x6dce('0x44')));router[_0x6dce('0x3b')](_0x6dce('0x45'),auth['isAuthenticated'](),controller[_0x6dce('0x37')]('whatsapp'));router[_0x6dce('0x5')](_0x6dce('0x46'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x6dce('0x5')](_0x6dce('0x47'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x48')]);router['post'](_0x6dce('0x49'),auth[_0x6dce('0x6')](),controller[_0x6dce('0x4a')]);module[_0x6dce('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index e4cd735..3dcf4e5 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 _0x98a8=['openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','QueueId','TransferReport','create','Start','Account','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','messageId','From','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','result','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions'];(function(_0x1142b3,_0x34a998){var _0xbae400=function(_0x3a4908){while(--_0x3a4908){_0x1142b3['push'](_0x1142b3['shift']());}};_0xbae400(++_0x34a998);}(_0x98a8,0x12c));var _0x898a=function(_0x142bd2,_0x2d843f){_0x142bd2=_0x142bd2-0x0;var _0x3e30de=_0x98a8[_0x142bd2];return _0x3e30de;};'use strict';var BPromise=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));var _=require(_0x898a('0x2'));var util=require(_0x898a('0x3'));var db=require(_0x898a('0x4'))['db'];var logger=require(_0x898a('0x5'))(_0x898a('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232a});var mailClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232b});var routingClient=jayson[_0x898a('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){var _0x283c5=_0xfa8c50?_0xfa8c50:amiClient;return _0x283c5[_0x898a('0x9')](_0x3aadc2,_0x564583)[_0x898a('0xa')](function(_0x3150df){if(_0x3150df[_0x898a('0xb')]){if(_0x3150df[_0x898a('0xb')][_0x898a('0xc')]===0x1f4){return _0x42021d(_0x3150df[_0x898a('0xb')]['message']);}return _0x4fbce5(_0x3150df[_0x898a('0xb')]['message']);}else{_0x4fbce5(_0x3150df[_0x898a('0xd')]);}})['catch'](function(_0x25d7f2){_0x42021d(_0x25d7f2);});});}function respondWithResult(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xc8;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['status'](_0x364a23)['json'](_0x5f5e06);}return _0x2c76b7[_0x898a('0xe')](0x194);};}function handleError(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0x1f4;return function(_0x116fbe){logger[_0x898a('0xb')](_0x116fbe[_0x898a('0xf')]);if(_0x116fbe['name']){delete _0x116fbe[_0x898a('0x10')];}_0x1f5be4['status'](_0xb24335)[_0x898a('0x11')](_0x116fbe);};}function findById(_0x5c96a6){return function(_0x303321){if(!_['isNil'](_0x5c96a6)&&!_[_0x898a('0x12')](_0x303321)&&!_['isNil'](_0x303321[_0x898a('0x13')])){return _[_0x898a('0x14')](_0x303321[_0x898a('0x13')],function(_0x4ddd4d){return _0x4ddd4d['id']==_0x5c96a6;});}return null;};}exports[_0x898a('0x15')]=function(_0x5960e0,_0x54c8f3){return respondWithRpcPromise(_0x898a('0x16'),_0x5960e0[_0x898a('0x17')])['then'](respondWithResult(_0x54c8f3,null))['catch'](handleError(_0x54c8f3,null));};exports[_0x898a('0x18')]=function(_0x26449a,_0x38a8f0){return respondWithRpcPromise(_0x898a('0x19'),_[_0x898a('0x1a')](_0x26449a[_0x898a('0x17')],_0x26449a[_0x898a('0x1b')]))['then'](respondWithResult(_0x38a8f0,null))[_0x898a('0x1c')](handleError(_0x38a8f0,null));};exports[_0x898a('0x1d')]=function(_0x11cae2,_0x3cfd9c){return respondWithRpcPromise(_0x898a('0x1e'),_[_0x898a('0x1a')](_0x11cae2['query'],_0x11cae2[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x3cfd9c,null))[_0x898a('0x1c')](handleError(_0x3cfd9c,null));};exports[_0x898a('0x1f')]=function(_0x3901ab,_0x1426e3){return respondWithRpcPromise('VoiceQueues',_0x3901ab[_0x898a('0x17')])['then'](respondWithResult(_0x1426e3,null))['catch'](handleError(_0x1426e3,null));};exports['showVoiceQueues']=function(_0x3678be,_0x1f4d86){return respondWithRpcPromise(_0x898a('0x20'),_0x3678be[_0x898a('0x17')])[_0x898a('0xa')](findById(_0x3678be[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x1f4d86,null))[_0x898a('0x1c')](handleError(_0x1f4d86,null));};exports[_0x898a('0x21')]=function(_0x58149d,_0x4b3e68){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x898a('0x1a')](_0x58149d[_0x898a('0x22')],_0x58149d[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4b3e68,null))[_0x898a('0x1c')](handleError(_0x4b3e68,null));};exports[_0x898a('0x23')]=function(_0xe3c983,_0xf74645){return respondWithRpcPromise(_0x898a('0x24'),_[_0x898a('0x1a')](_0xe3c983[_0x898a('0x17')],_0xe3c983[_0x898a('0x1b')]))['then'](respondWithResult(_0xf74645,null))[_0x898a('0x1c')](handleError(_0xf74645,null));};exports[_0x898a('0x25')]=function(_0x26eead,_0x17a980){return respondWithRpcPromise(_0x898a('0x26'),_0x26eead['query'])['then'](respondWithResult(_0x17a980,null))[_0x898a('0x1c')](handleError(_0x17a980,null));};exports[_0x898a('0x27')]=function(_0x1d6d66,_0x4de9bf){return respondWithRpcPromise(_0x898a('0x28'),_[_0x898a('0x1a')](_0x1d6d66[_0x898a('0x17')],_0x1d6d66[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4de9bf,null))[_0x898a('0x1c')](handleError(_0x4de9bf,null));};exports[_0x898a('0x29')]=function(_0x146f32,_0x50bb4b){return respondWithRpcPromise(_0x898a('0x2a'),_['merge'](_0x146f32['query'],_0x146f32[_0x898a('0x1b')]))['then'](respondWithResult(_0x50bb4b,null))[_0x898a('0x1c')](handleError(_0x50bb4b,null));};exports['voiceQueuesChannelRedirect']=function(_0x37cb11,_0x4f202c){return respondWithRpcPromise(_0x898a('0x2b'),_[_0x898a('0x1a')](_0x37cb11[_0x898a('0x17')],_0x37cb11['params']))['then'](respondWithResult(_0x4f202c,null))['catch'](handleError(_0x4f202c,null));};exports[_0x898a('0x2c')]=function(_0x429c32,_0x5a228f){return respondWithRpcPromise(_0x898a('0x2d'),_0x429c32[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x5a228f,null))[_0x898a('0x1c')](handleError(_0x5a228f,null));};exports['outboundChannels']=function(_0x4b07bc,_0x3aed01){return respondWithRpcPromise(_0x898a('0x2e'),_0x4b07bc['query'])['then'](respondWithResult(_0x3aed01,null))[_0x898a('0x1c')](handleError(_0x3aed01,null));};exports[_0x898a('0x2f')]=function(_0x181cc8,_0xa45405){var _0x51681f;return respondWithRpcPromise(_0x898a('0x30'),_0x181cc8[_0x898a('0x17')])['then'](function(_0x516b8c){_0x51681f=_0x516b8c;return respondWithRpcPromise('Agents',_0x181cc8[_0x898a('0x17')],routingClient);})[_0x898a('0xa')](function(_0x35d767){return _[_0x898a('0x1a')]({},_0x35d767,_0x51681f);})[_0x898a('0xa')](respondWithResult(_0xa45405,null))[_0x898a('0x1c')](handleError(_0xa45405,null));};exports[_0x898a('0x31')]=function(_0x1432ec,_0x3292c2){if(_0x1432ec[_0x898a('0x22')]&&_0x1432ec[_0x898a('0x22')][_0x898a('0x32')]&&_0x1432ec[_0x898a('0x33')]&&_0x1432ec[_0x898a('0x33')][_0x898a('0x10')]){for(var _0x4c8628 in _0x1432ec[_0x898a('0x22')][_0x898a('0x32')]){if(_0x1432ec[_0x898a('0x22')]['interaction'][_0x898a('0x34')](_0x4c8628)){db[_0x898a('0x35')][_0x898a('0x36')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')][_0x898a('0x10')],'type':_0x898a('0x37'),'exitAt':null,'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]&&_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')]?{'$notIn':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]}:{'$ne':null}}})['then'](function(_0x3d5fba){var _0x152060=moment()['format'](_0x898a('0x39'));for(var _0x4ce00e=0x0,_0x56a40c=_0x3d5fba['length'];_0x4ce00e<_0x56a40c;_0x4ce00e+=0x1){_0x3d5fba[_0x4ce00e]['updateAttributes']({'exitAt':_0x152060});}});for(var _0x322ecc=0x0;_0x322ecc<_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')];_0x322ecc+=0x1){db['MemberReport'][_0x898a('0x3a')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'type':_0x898a('0x37'),'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628][_0x322ecc],'exitAt':null},'defaults':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'interface':_[_0x898a('0x12')](_0x1432ec[_0x898a('0x33')]['interface'])?util[_0x898a('0x3b')](_0x898a('0x3c'),_0x1432ec['user'][_0x898a('0x10')]):_0x1432ec['user'][_0x898a('0x3d')],'type':_0x898a('0x37'),'enterAt':moment()[_0x898a('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x898a('0x3e'),'internal':_0x1432ec[_0x898a('0x33')][_0x898a('0x3f')],'uniqueid':_0x1432ec[_0x898a('0x22')]['interaction'][_0x4c8628][_0x322ecc]}});}}}}return respondWithRpcPromise(_0x898a('0x40'),{'id':_0x1432ec['params']['id'],'capacity':_0x1432ec[_0x898a('0x22')][_0x898a('0x41')]},routingClient)[_0x898a('0xa')](respondWithResult(_0x3292c2,null))['catch'](handleError(_0x3292c2,null));};exports[_0x898a('0x42')]=function(_0x3c4db0,_0x195ac2){return respondWithRpcPromise('Telephones',_0x3c4db0['query'])[_0x898a('0xa')](respondWithResult(_0x195ac2,null))[_0x898a('0x1c')](handleError(_0x195ac2,null));};exports[_0x898a('0x43')]=function(_0x295f1e,_0x28b8c9){return respondWithRpcPromise(_0x898a('0x44'),_0x295f1e[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x28b8c9,null))[_0x898a('0x1c')](handleError(_0x28b8c9,null));};exports[_0x898a('0x45')]=function(_0x2382a9,_0x5e9329){return respondWithRpcPromise(_0x898a('0x46'),_0x2382a9[_0x898a('0x17')])['then'](respondWithResult(_0x5e9329,null))[_0x898a('0x1c')](handleError(_0x5e9329,null));};exports['chatQueues']=function(_0x54c44b,_0x15f11e){return respondWithRpcPromise(_0x898a('0x47'),_0x54c44b[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x15f11e,null))['catch'](handleError(_0x15f11e,null));};exports[_0x898a('0x48')]=function(_0x1f5e4b,_0x515725){return respondWithRpcPromise(_0x898a('0x47'),_0x1f5e4b[_0x898a('0x17')],routingClient)['then'](findById(_0x1f5e4b[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x515725,null))[_0x898a('0x1c')](handleError(_0x515725,null));};exports['mailQueues']=function(_0xf29714,_0x2ef2f1){return respondWithRpcPromise(_0x898a('0x49'),_0xf29714[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2ef2f1,null))[_0x898a('0x1c')](handleError(_0x2ef2f1,null));};exports['showMailQueues']=function(_0x22a08a,_0x4df5f0){return respondWithRpcPromise(_0x898a('0x49'),_0x22a08a[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x22a08a[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x4df5f0,null))[_0x898a('0x1c')](handleError(_0x4df5f0,null));};exports[_0x898a('0x4a')]=function(_0x75ff57,_0x3c761c){return respondWithRpcPromise('MailAccounts',_0x75ff57[_0x898a('0x17')],mailClient)[_0x898a('0xa')](respondWithResult(_0x3c761c,null))[_0x898a('0x1c')](handleError(_0x3c761c,null));};exports[_0x898a('0x4b')]=function(_0x219976,_0x2a1345){return respondWithRpcPromise(_0x898a('0x4c'),_0x219976[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2a1345,null))[_0x898a('0x1c')](handleError(_0x2a1345,null));};exports[_0x898a('0x4d')]=function(_0x217dda,_0x3331c0){return respondWithRpcPromise(_0x898a('0x4c'),_0x217dda[_0x898a('0x17')],routingClient)['then'](findById(_0x217dda[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x3331c0,null))['catch'](handleError(_0x3331c0,null));};exports[_0x898a('0x4e')]=function(_0x4583a1,_0x5f0944){return respondWithRpcPromise(_0x898a('0x4f'),_0x4583a1[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5f0944,null))[_0x898a('0x1c')](handleError(_0x5f0944,null));};exports['showSmsQueues']=function(_0xdc0cc4,_0x11def5){return respondWithRpcPromise(_0x898a('0x4f'),_0xdc0cc4[_0x898a('0x17')],routingClient)['then'](findById(_0xdc0cc4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x11def5,null))['catch'](handleError(_0x11def5,null));};exports[_0x898a('0x50')]=function(_0x3c0bf6,_0x5b7019){return respondWithRpcPromise(_0x898a('0x51'),_0x3c0bf6['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5b7019,null))['catch'](handleError(_0x5b7019,null));};exports['showWhatsappQueues']=function(_0x5ed35e,_0xfdd6d8){return respondWithRpcPromise(_0x898a('0x51'),_0x5ed35e[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x5ed35e['params']['id']))['then'](respondWithResult(_0xfdd6d8,null))[_0x898a('0x1c')](handleError(_0xfdd6d8,null));};exports[_0x898a('0x52')]=function(_0x1c2661,_0x5dc44e){return respondWithRpcPromise(_0x898a('0x53'),_0x1c2661[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5dc44e,null))[_0x898a('0x1c')](handleError(_0x5dc44e,null));};exports['showFaxQueues']=function(_0xaac6d4,_0x43bf93){return respondWithRpcPromise('FaxQueues',_0xaac6d4[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0xaac6d4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x43bf93,null))[_0x898a('0x1c')](handleError(_0x43bf93,null));};exports[_0x898a('0x54')]=function(_0x3bcc3d,_0x2dc61c){return respondWithRpcPromise(_0x898a('0x55'),_0x3bcc3d[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x2dc61c,null))[_0x898a('0x1c')](handleError(_0x2dc61c,null));};exports[_0x898a('0x56')]=function(_0x4a7705,_0x2d9a9c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4a7705[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2d9a9c,null))[_0x898a('0x1c')](handleError(_0x2d9a9c,null));};exports['mailQueuesWaitingInteractions']=function(_0x31102d,_0x3f0d9f){return respondWithRpcPromise(_0x898a('0x57'),_0x31102d[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x3f0d9f,null))['catch'](handleError(_0x3f0d9f,null));};exports[_0x898a('0x58')]=function(_0x352ebb,_0x37b1d0){return respondWithRpcPromise(_0x898a('0x59'),_0x352ebb[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x37b1d0,null))[_0x898a('0x1c')](handleError(_0x37b1d0,null));};exports[_0x898a('0x5a')]=function(_0x474029,_0x37d205){return respondWithRpcPromise(_0x898a('0x59'),_0x474029[_0x898a('0x17')],routingClient)[_0x898a('0xa')](function(_0x1b0c09){if(_0x474029['query'][_0x898a('0x5b')]!==undefined){var _0x4607e1=_(_0x1b0c09['rows'])[_0x898a('0x5c')]([_0x474029['query'][_0x898a('0x5b')],_0x474029['params']['id']])[_0x898a('0x5d')](_0x898a('0x5e'))[_0x898a('0x5f')]()[_0x898a('0x60')]();return _0x1b0c09[_0x898a('0x13')][_0x898a('0x5c')](function(_0x170267){return _0x4607e1[_0x898a('0x61')](_0x170267[_0x898a('0x5e')])>-0x1;});}else{return _0x1b0c09['rows'][_0x898a('0x5c')](function(_0xd627d0){return _0xd627d0[_0x898a('0x5e')]===parseInt(_0x474029[_0x898a('0x1b')]['id']);});}})[_0x898a('0xa')](respondWithResult(_0x37d205,null))[_0x898a('0x1c')](handleError(_0x37d205,null));};exports[_0x898a('0x62')]=function(_0x4bcf85,_0x380f8c){return respondWithRpcPromise(_0x898a('0x63'),_0x4bcf85['query'],routingClient)['then'](respondWithResult(_0x380f8c,null))[_0x898a('0x1c')](handleError(_0x380f8c,null));};exports[_0x898a('0x64')]=function(_0x48e9c2,_0x5710a0){return respondWithRpcPromise(_0x898a('0x65'),_0x48e9c2['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5710a0,null))[_0x898a('0x1c')](handleError(_0x5710a0,null));};exports['faxQueuesWaitingInteractions']=function(_0x3f6815,_0x1c782e){return respondWithRpcPromise(_0x898a('0x66'),_0x3f6815[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x1c782e,null))[_0x898a('0x1c')](handleError(_0x1c782e,null));};exports[_0x898a('0x67')]=function(_0x49f8ac){return function(_0x3237e8,_0x1efe1e){var _0x37ee4d,_0x50d978;var _0x27560f=_[_0x898a('0x68')](_0x49f8ac);var _0x5c6247=_0x49f8ac===_0x898a('0x69')?'Website':'Account';return db[_0x27560f+'Queue'][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3237e8[_0x898a('0x1b')]['id']}})[_0x898a('0xa')](function(_0x2079d0){if(_[_0x898a('0x12')](_0x2079d0)){throw new Error(_0x27560f+_0x898a('0x6b'));}_0x37ee4d=_0x2079d0;return db[_0x27560f+_0x898a('0x6c')]['findOne']({'where':{'id':_0x3237e8[_0x898a('0x22')]['messageId']},'include':[{'model':db[_0x27560f+_0x898a('0x6d')],'as':_0x898a('0x6d')},{'model':db[_0x27560f+_0x5c6247],'as':'Account'}]});})[_0x898a('0xa')](function(_0x2269fb){if(_[_0x898a('0x12')](_0x2269fb)){throw new Error(_0x27560f+_0x898a('0x6e'));}_0x50d978=_0x2269fb;return _0x2269fb[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5847cb={'uniqueid':_0x49f8ac+'.'+_0x50d978['id']+'.'+_0x50d978['Interaction']['id'],'FromUserId':_0x3237e8[_0x898a('0x33')]['id'],'type':_0x898a('0x70')};_0x5847cb[_0x27560f+_0x898a('0x71')]=_0x50d978['id'];_0x5847cb[_0x27560f+'InteractionId']=_0x50d978[_0x898a('0x6d')]['id'];_0x5847cb['From'+_0x27560f+_0x5c6247+'Id']=_0x50d978['Account']['id'];_0x5847cb['To'+_0x27560f+_0x898a('0x72')]=_0x37ee4d['id'];return db[_0x27560f+_0x898a('0x73')][_0x898a('0x74')](_0x5847cb);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0x49f8ac,'interaction':_0x50d978[_0x898a('0x6d')],'message':_0x50d978,'account':_0x50d978[_0x898a('0x76')],'applications':[{'id':0x0,'priority':0x1,'app':_0x898a('0x70'),'appdata':_0x37ee4d[_0x898a('0x10')]+','+(_0x50d978[_0x898a('0x76')][_0x898a('0x77')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x1efe1e,null))[_0x898a('0x1c')](handleError(_0x1efe1e,null));};};exports[_0x898a('0x79')]=function(_0x3d9634,_0x54c440){var _0x435689,_0x3eaf3e;if(_[_0x898a('0x12')](_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')])){throw new Error(_0x898a('0x7b'));}var _0xd45b78=_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')];var _0x427eff=_[_0x898a('0x68')](_0xd45b78);var _0x381071=_0xd45b78==='chat'?_0x898a('0x7c'):'Account';return db[_0x898a('0x7d')][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3d9634[_0x898a('0x1b')]['id'],'role':'agent'}})[_0x898a('0xa')](function(_0x223775){if(_['isNil'](_0x223775)){throw new Error(_0x898a('0x7e'));}_0x435689=_0x223775;return db[_0x427eff+_0x898a('0x6c')][_0x898a('0x6a')]({'where':{'id':_0x3d9634[_0x898a('0x22')][_0x898a('0x7f')]},'include':[{'model':db[_0x427eff+_0x898a('0x6d')],'as':'Interaction'},{'model':db[_0x427eff+_0x381071],'as':'Account'}]});})[_0x898a('0xa')](function(_0x4b7334){if(_[_0x898a('0x12')](_0x4b7334)){throw new Error(_0x427eff+_0x898a('0x6e'));}_0x3eaf3e=_0x4b7334;return _0x4b7334[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x898a('0xa')](function(){var _0x13b3f9={'uniqueid':_0xd45b78+'.'+_0x3eaf3e['id']+'.'+_0x3eaf3e[_0x898a('0x6d')]['id'],'FromUserId':_0x3d9634['user']['id'],'type':'queue','ToUserId':_0x435689['id']};_0x13b3f9[_0x427eff+_0x898a('0x71')]=_0x3eaf3e['id'];_0x13b3f9[_0x427eff+'InteractionId']=_0x3eaf3e[_0x898a('0x6d')]['id'];_0x13b3f9[_0x898a('0x80')+_0x427eff+_0x381071+'Id']=_0x3eaf3e['Account']['id'];return db[_0x427eff+_0x898a('0x73')]['create'](_0x13b3f9);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0xd45b78,'interaction':_0x3eaf3e[_0x898a('0x6d')],'message':_0x3eaf3e,'account':_0x3eaf3e['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x435689['name']+','+(_0x3eaf3e[_0x898a('0x76')][_0x898a('0x81')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x54c440,null))[_0x898a('0x1c')](handleError(_0x54c440,null));}; \ No newline at end of file +var _0xa41a=['name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','user','INTERACTION','interface','SIP/%s','agent','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','Account','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack'];(function(_0x110467,_0x51d448){var _0x26dd2b=function(_0x3c425c){while(--_0x3c425c){_0x110467['push'](_0x110467['shift']());}};_0x26dd2b(++_0x51d448);}(_0xa41a,0x6b));var _0xaa41=function(_0x2a6244,_0x39182e){_0x2a6244=_0x2a6244-0x0;var _0x181cad=_0xa41a[_0x2a6244];return _0x181cad;};'use strict';var BPromise=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var _=require('lodash');var util=require(_0xaa41('0x2'));var db=require(_0xaa41('0x3'))['db'];var logger=require(_0xaa41('0x4'))(_0xaa41('0x5'));var jayson=require(_0xaa41('0x6'));var amiClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa41('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){var _0x31df43=_0x179545?_0x179545:amiClient;return _0x31df43[_0xaa41('0x9')](_0x54bc5a,_0x5b1fff)[_0xaa41('0xa')](function(_0x1cc344){if(_0x1cc344[_0xaa41('0xb')]){if(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xc')]===0x1f4){return _0x588ab4(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xd')]);}return _0x202cce(_0x1cc344['error'][_0xaa41('0xd')]);}else{_0x202cce(_0x1cc344[_0xaa41('0xe')]);}})['catch'](function(_0x54827c){_0x588ab4(_0x54827c);});});}function respondWithResult(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xc8;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0xf')](_0x518b5b)[_0xaa41('0x10')](_0x19bd69);}return _0x1d0a54[_0xaa41('0x11')](0x194);};}function handleError(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0x1f4;return function(_0x1e9d7f){logger[_0xaa41('0xb')](_0x1e9d7f[_0xaa41('0x12')]);if(_0x1e9d7f[_0xaa41('0x13')]){delete _0x1e9d7f[_0xaa41('0x13')];}_0x6f9ade[_0xaa41('0xf')](_0x4eaf81)[_0xaa41('0x14')](_0x1e9d7f);};}function findById(_0x550ad5){return function(_0x2d868a){if(!_[_0xaa41('0x15')](_0x550ad5)&&!_[_0xaa41('0x15')](_0x2d868a)&&!_[_0xaa41('0x15')](_0x2d868a[_0xaa41('0x16')])){return _[_0xaa41('0x17')](_0x2d868a[_0xaa41('0x16')],function(_0x46e6d3){return _0x46e6d3['id']==_0x550ad5;});}return null;};}exports[_0xaa41('0x18')]=function(_0x4fe1a4,_0x5cd936){return respondWithRpcPromise(_0xaa41('0x19'),_0x4fe1a4[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5cd936,null))['catch'](handleError(_0x5cd936,null));};exports[_0xaa41('0x1b')]=function(_0x1f692b,_0x4e768e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xaa41('0x1c')](_0x1f692b['query'],_0x1f692b[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4e768e,null))[_0xaa41('0x1e')](handleError(_0x4e768e,null));};exports[_0xaa41('0x1f')]=function(_0x1d623c,_0x4eb01f){return respondWithRpcPromise(_0xaa41('0x20'),_[_0xaa41('0x1c')](_0x1d623c[_0xaa41('0x1a')],_0x1d623c[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4eb01f,null))[_0xaa41('0x1e')](handleError(_0x4eb01f,null));};exports['voiceQueues']=function(_0x5795f4,_0x16aec5){return respondWithRpcPromise('VoiceQueues',_0x5795f4['query'])[_0xaa41('0xa')](respondWithResult(_0x16aec5,null))['catch'](handleError(_0x16aec5,null));};exports['showVoiceQueues']=function(_0x2d0ac0,_0x9c8c21){return respondWithRpcPromise(_0xaa41('0x21'),_0x2d0ac0[_0xaa41('0x1a')])[_0xaa41('0xa')](findById(_0x2d0ac0[_0xaa41('0x1d')]['id']))['then'](respondWithResult(_0x9c8c21,null))[_0xaa41('0x1e')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x22')]=function(_0x63c18c,_0x9a16e3){return respondWithRpcPromise(_0xaa41('0x23'),_[_0xaa41('0x1c')](_0x63c18c[_0xaa41('0x24')],_0x63c18c[_0xaa41('0x1d')]))['then'](respondWithResult(_0x9a16e3,null))[_0xaa41('0x1e')](handleError(_0x9a16e3,null));};exports['voiceQueuesPreview']=function(_0x5dad80,_0x714537){return respondWithRpcPromise(_0xaa41('0x25'),_['merge'](_0x5dad80[_0xaa41('0x1a')],_0x5dad80[_0xaa41('0x1d')]))['then'](respondWithResult(_0x714537,null))['catch'](handleError(_0x714537,null));};exports['voiceQueuesChannels']=function(_0x1cf3da,_0x2f5cc0){return respondWithRpcPromise(_0xaa41('0x26'),_0x1cf3da[_0xaa41('0x1a')])['then'](respondWithResult(_0x2f5cc0,null))[_0xaa41('0x1e')](handleError(_0x2f5cc0,null));};exports[_0xaa41('0x27')]=function(_0x3e0204,_0x4de770){return respondWithRpcPromise(_0xaa41('0x28'),_[_0xaa41('0x1c')](_0x3e0204[_0xaa41('0x1a')],_0x3e0204['params']))[_0xaa41('0xa')](respondWithResult(_0x4de770,null))[_0xaa41('0x1e')](handleError(_0x4de770,null));};exports['voiceQueuesChannelHangup']=function(_0x23eb50,_0x13b6d4){return respondWithRpcPromise(_0xaa41('0x29'),_['merge'](_0x23eb50[_0xaa41('0x1a')],_0x23eb50['params']))[_0xaa41('0xa')](respondWithResult(_0x13b6d4,null))[_0xaa41('0x1e')](handleError(_0x13b6d4,null));};exports[_0xaa41('0x2a')]=function(_0x49b77a,_0x526377){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa41('0x1c')](_0x49b77a[_0xaa41('0x1a')],_0x49b77a[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x526377,null))['catch'](handleError(_0x526377,null));};exports['outbound']=function(_0x267999,_0x5673c){return respondWithRpcPromise(_0xaa41('0x2b'),_0x267999[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5673c,null))[_0xaa41('0x1e')](handleError(_0x5673c,null));};exports[_0xaa41('0x2c')]=function(_0x5e9879,_0x3adc28){return respondWithRpcPromise(_0xaa41('0x2d'),_0x5e9879[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x3adc28,null))['catch'](handleError(_0x3adc28,null));};exports['agents']=function(_0x42b759,_0x275fa3){var _0x5eae08;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759['query'])[_0xaa41('0xa')](function(_0x25f2df){_0x5eae08=_0x25f2df;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759[_0xaa41('0x1a')],routingClient);})[_0xaa41('0xa')](function(_0x12ba1a){return _[_0xaa41('0x1c')]({},_0x12ba1a,_0x5eae08);})[_0xaa41('0xa')](respondWithResult(_0x275fa3,null))['catch'](handleError(_0x275fa3,null));};exports[_0xaa41('0x2f')]=function(_0x2abf39,_0x35c685){if(_0x2abf39[_0xaa41('0x24')]&&_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]&&_0x2abf39['user']&&_0x2abf39['user'][_0xaa41('0x13')]){for(var _0x4f9086 in _0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]){if(_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0xaa41('0x31')](_0x4f9086)){db[_0xaa41('0x32')][_0xaa41('0x33')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2abf39['body'][_0xaa41('0x30')][_0x4f9086]&&_0x2abf39['body']['interaction'][_0x4f9086]['length']?{'$notIn':_0x2abf39[_0xaa41('0x24')]['interaction'][_0x4f9086]}:{'$ne':null}}})[_0xaa41('0xa')](function(_0x198716){var _0x4a6882=moment()['format'](_0xaa41('0x34'));for(var _0x1b7b97=0x0,_0x1bb973=_0x198716[_0xaa41('0x35')];_0x1b7b97<_0x1bb973;_0x1b7b97+=0x1){_0x198716[_0x1b7b97][_0xaa41('0x36')]({'exitAt':_0x4a6882});}});for(var _0x337993=0x0;_0x337993<_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0xaa41('0x35')];_0x337993+=0x1){db['MemberReport'][_0xaa41('0x37')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39[_0xaa41('0x38')][_0xaa41('0x13')],'type':_0xaa41('0x39'),'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993],'exitAt':null},'defaults':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'interface':_[_0xaa41('0x15')](_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')])?util['format'](_0xaa41('0x3b'),_0x2abf39['user']['name']):_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')],'type':_0xaa41('0x39'),'enterAt':moment()['format'](_0xaa41('0x34')),'role':_0xaa41('0x3c'),'internal':_0x2abf39[_0xaa41('0x38')]['internal'],'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993]}});}}}}return respondWithRpcPromise(_0xaa41('0x3d'),{'id':_0x2abf39[_0xaa41('0x1d')]['id'],'capacity':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x3e')]},routingClient)[_0xaa41('0xa')](respondWithResult(_0x35c685,null))[_0xaa41('0x1e')](handleError(_0x35c685,null));};exports['telephones']=function(_0x9f0a81,_0x5bef5f){return respondWithRpcPromise('Telephones',_0x9f0a81[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5bef5f,null))[_0xaa41('0x1e')](handleError(_0x5bef5f,null));};exports[_0xaa41('0x3f')]=function(_0x14aab0,_0x288db3){return respondWithRpcPromise(_0xaa41('0x40'),_0x14aab0[_0xaa41('0x1a')])['then'](respondWithResult(_0x288db3,null))[_0xaa41('0x1e')](handleError(_0x288db3,null));};exports[_0xaa41('0x41')]=function(_0x1d518f,_0x4f9e92){return respondWithRpcPromise(_0xaa41('0x42'),_0x1d518f[_0xaa41('0x1a')])['then'](respondWithResult(_0x4f9e92,null))[_0xaa41('0x1e')](handleError(_0x4f9e92,null));};exports[_0xaa41('0x43')]=function(_0x283b3b,_0x4e5a2e){return respondWithRpcPromise(_0xaa41('0x44'),_0x283b3b[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x4e5a2e,null))['catch'](handleError(_0x4e5a2e,null));};exports[_0xaa41('0x45')]=function(_0x3cd14f,_0x3a29d2){return respondWithRpcPromise('ChatQueues',_0x3cd14f[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x3cd14f[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x3a29d2,null))[_0xaa41('0x1e')](handleError(_0x3a29d2,null));};exports['mailQueues']=function(_0x2ae70c,_0x57cb70){return respondWithRpcPromise('MailQueues',_0x2ae70c[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x57cb70,null))[_0xaa41('0x1e')](handleError(_0x57cb70,null));};exports[_0xaa41('0x46')]=function(_0x169ddf,_0x5e83e1){return respondWithRpcPromise(_0xaa41('0x47'),_0x169ddf[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x169ddf[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5e83e1,null))[_0xaa41('0x1e')](handleError(_0x5e83e1,null));};exports[_0xaa41('0x48')]=function(_0x337059,_0x3f91f3){return respondWithRpcPromise('MailAccounts',_0x337059[_0xaa41('0x1a')],mailClient)[_0xaa41('0xa')](respondWithResult(_0x3f91f3,null))[_0xaa41('0x1e')](handleError(_0x3f91f3,null));};exports['openchannelQueues']=function(_0x3fe47a,_0x2caf5c){return respondWithRpcPromise(_0xaa41('0x49'),_0x3fe47a[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2caf5c,null))[_0xaa41('0x1e')](handleError(_0x2caf5c,null));};exports[_0xaa41('0x4a')]=function(_0x5ea056,_0x55a85c){return respondWithRpcPromise('OpenchannelQueues',_0x5ea056['query'],routingClient)['then'](findById(_0x5ea056['params']['id']))[_0xaa41('0xa')](respondWithResult(_0x55a85c,null))['catch'](handleError(_0x55a85c,null));};exports['smsQueues']=function(_0x24c6f3,_0x40a524){return respondWithRpcPromise(_0xaa41('0x4b'),_0x24c6f3[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x40a524,null))[_0xaa41('0x1e')](handleError(_0x40a524,null));};exports[_0xaa41('0x4c')]=function(_0x1ddb6c,_0x46822f){return respondWithRpcPromise(_0xaa41('0x4b'),_0x1ddb6c[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x1ddb6c[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x46822f,null))['catch'](handleError(_0x46822f,null));};exports[_0xaa41('0x4d')]=function(_0x2d2af8,_0x50170f){return respondWithRpcPromise('WhatsappQueues',_0x2d2af8['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x50170f,null))['catch'](handleError(_0x50170f,null));};exports[_0xaa41('0x4e')]=function(_0x5c8028,_0x5423b6){return respondWithRpcPromise(_0xaa41('0x4f'),_0x5c8028['query'],routingClient)[_0xaa41('0xa')](findById(_0x5c8028[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5423b6,null))[_0xaa41('0x1e')](handleError(_0x5423b6,null));};exports['faxQueues']=function(_0x5be61b,_0x339db3){return respondWithRpcPromise(_0xaa41('0x50'),_0x5be61b['query'],routingClient)['then'](respondWithResult(_0x339db3,null))[_0xaa41('0x1e')](handleError(_0x339db3,null));};exports[_0xaa41('0x51')]=function(_0x304694,_0xbeafb5){return respondWithRpcPromise(_0xaa41('0x50'),_0x304694['query'],routingClient)[_0xaa41('0xa')](findById(_0x304694['params']['id']))['then'](respondWithResult(_0xbeafb5,null))['catch'](handleError(_0xbeafb5,null));};exports[_0xaa41('0x52')]=function(_0x19ec63,_0x436362){return respondWithRpcPromise('FaxAccounts',_0x19ec63[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x436362,null))[_0xaa41('0x1e')](handleError(_0x436362,null));};exports[_0xaa41('0x53')]=function(_0x457515,_0x3ffbf8){return respondWithRpcPromise(_0xaa41('0x54'),_0x457515['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x3ffbf8,null))[_0xaa41('0x1e')](handleError(_0x3ffbf8,null));};exports[_0xaa41('0x55')]=function(_0x175ca9,_0x51ff61){return respondWithRpcPromise(_0xaa41('0x56'),_0x175ca9['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x51ff61,null))[_0xaa41('0x1e')](handleError(_0x51ff61,null));};exports[_0xaa41('0x57')]=function(_0x143ef0,_0x491cad){return respondWithRpcPromise(_0xaa41('0x58'),_0x143ef0[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x491cad,null))[_0xaa41('0x1e')](handleError(_0x491cad,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x140d78,_0x50197b){return respondWithRpcPromise(_0xaa41('0x58'),_0x140d78[_0xaa41('0x1a')],routingClient)['then'](function(_0x1ac05e){if(_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')]!==undefined){var _0x582d79=_(_0x1ac05e[_0xaa41('0x16')])[_0xaa41('0x5a')]([_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')],_0x140d78[_0xaa41('0x1d')]['id']])[_0xaa41('0x5b')](_0xaa41('0x5c'))['uniq']()[_0xaa41('0x5d')]();return _0x1ac05e[_0xaa41('0x16')][_0xaa41('0x5a')](function(_0x530982){return _0x582d79['indexOf'](_0x530982[_0xaa41('0x5c')])>-0x1;});}else{return _0x1ac05e[_0xaa41('0x16')]['filter'](function(_0x1ce957){return _0x1ce957[_0xaa41('0x5c')]===parseInt(_0x140d78['params']['id']);});}})[_0xaa41('0xa')](respondWithResult(_0x50197b,null))[_0xaa41('0x1e')](handleError(_0x50197b,null));};exports[_0xaa41('0x5e')]=function(_0xe8731,_0x46feb2){return respondWithRpcPromise(_0xaa41('0x5f'),_0xe8731[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x46feb2,null))['catch'](handleError(_0x46feb2,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x397526,_0x481db9){return respondWithRpcPromise(_0xaa41('0x60'),_0x397526[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x481db9,null))['catch'](handleError(_0x481db9,null));};exports[_0xaa41('0x61')]=function(_0x404c38,_0x2d7493){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x404c38[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2d7493,null))['catch'](handleError(_0x2d7493,null));};exports[_0xaa41('0x62')]=function(_0x4de25c){return function(_0x53faf4,_0x3f6a2b){var _0x34d0e4,_0x5eded3;var _0x5a8cb0=_[_0xaa41('0x63')](_0x4de25c);var _0x1726ec=_0x4de25c===_0xaa41('0x64')?_0xaa41('0x65'):'Account';return db[_0x5a8cb0+_0xaa41('0x66')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0x53faf4[_0xaa41('0x1d')]['id']}})['then'](function(_0x1ad3aa){if(_[_0xaa41('0x15')](_0x1ad3aa)){throw new Error(_0x5a8cb0+_0xaa41('0x68'));}_0x34d0e4=_0x1ad3aa;return db[_0x5a8cb0+'Message'][_0xaa41('0x67')]({'where':{'id':_0x53faf4['body']['messageId']},'include':[{'model':db[_0x5a8cb0+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x5a8cb0+_0x1726ec],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x9e8ebb){if(_[_0xaa41('0x15')](_0x9e8ebb)){throw new Error(_0x5a8cb0+'\x20Message\x20not\x20found');}_0x5eded3=_0x9e8ebb;return _0x9e8ebb[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x1a2deb={'uniqueid':_0x4de25c+'.'+_0x5eded3['id']+'.'+_0x5eded3[_0xaa41('0x69')]['id'],'FromUserId':_0x53faf4[_0xaa41('0x38')]['id'],'type':'queue'};_0x1a2deb[_0x5a8cb0+_0xaa41('0x6b')]=_0x5eded3['id'];_0x1a2deb[_0x5a8cb0+'InteractionId']=_0x5eded3[_0xaa41('0x69')]['id'];_0x1a2deb[_0xaa41('0x6c')+_0x5a8cb0+_0x1726ec+'Id']=_0x5eded3[_0xaa41('0x6d')]['id'];_0x1a2deb['To'+_0x5a8cb0+_0xaa41('0x6e')]=_0x34d0e4['id'];return db[_0x5a8cb0+_0xaa41('0x6f')][_0xaa41('0x70')](_0x1a2deb);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x4de25c,'interaction':_0x5eded3[_0xaa41('0x69')],'message':_0x5eded3,'account':_0x5eded3[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa41('0x72'),'appdata':_0x34d0e4['name']+','+(_0x5eded3[_0xaa41('0x6d')][_0xaa41('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x3f6a2b,null))['catch'](handleError(_0x3f6a2b,null));};};exports[_0xaa41('0x74')]=function(_0xb44b1f,_0x472eb3){var _0x38d759,_0x2dc55e;if(_[_0xaa41('0x15')](_0xb44b1f[_0xaa41('0x24')]['channel'])){throw new Error(_0xaa41('0x75'));}var _0x1d50db=_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x76')];var _0x585ce7=_[_0xaa41('0x63')](_0x1d50db);var _0x5c9beb=_0x1d50db===_0xaa41('0x64')?_0xaa41('0x65'):_0xaa41('0x6d');return db[_0xaa41('0x77')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0xb44b1f['params']['id'],'role':_0xaa41('0x3c')}})[_0xaa41('0xa')](function(_0x5819ac){if(_[_0xaa41('0x15')](_0x5819ac)){throw new Error(_0xaa41('0x78'));}_0x38d759=_0x5819ac;return db[_0x585ce7+_0xaa41('0x79')][_0xaa41('0x67')]({'where':{'id':_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x7a')]},'include':[{'model':db[_0x585ce7+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x585ce7+_0x5c9beb],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x39d3cc){if(_[_0xaa41('0x15')](_0x39d3cc)){throw new Error(_0x585ce7+_0xaa41('0x7b'));}_0x2dc55e=_0x39d3cc;return _0x39d3cc[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x5489be={'uniqueid':_0x1d50db+'.'+_0x2dc55e['id']+'.'+_0x2dc55e['Interaction']['id'],'FromUserId':_0xb44b1f['user']['id'],'type':_0xaa41('0x72'),'ToUserId':_0x38d759['id']};_0x5489be[_0x585ce7+_0xaa41('0x6b')]=_0x2dc55e['id'];_0x5489be[_0x585ce7+'InteractionId']=_0x2dc55e[_0xaa41('0x69')]['id'];_0x5489be[_0xaa41('0x6c')+_0x585ce7+_0x5c9beb+'Id']=_0x2dc55e['Account']['id'];return db[_0x585ce7+_0xaa41('0x6f')][_0xaa41('0x70')](_0x5489be);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x1d50db,'interaction':_0x2dc55e['Interaction'],'message':_0x2dc55e,'account':_0x2dc55e[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x38d759[_0xaa41('0x13')]+','+(_0x2dc55e[_0xaa41('0x6d')][_0xaa41('0x7c')]||0x12c),'interval':_0xaa41('0x7d')}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x472eb3,null))[_0xaa41('0x1e')](handleError(_0x472eb3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 57785dd..f9273a0 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 _0x5681=['../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','run','put','update','delete','exports','multer','util','Router','fs-extra'];(function(_0x270ebc,_0x5102fc){var _0x315d25=function(_0x1a2d92){while(--_0x1a2d92){_0x270ebc['push'](_0x270ebc['shift']());}};_0x315d25(++_0x5102fc);}(_0x5681,0xec));var _0x1568=function(_0x589836,_0x14d7fc){_0x589836=_0x589836-0x0;var _0x12b6ff=_0x5681[_0x589836];return _0x12b6ff;};'use strict';var multer=require(_0x1568('0x0'));var util=require(_0x1568('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1568('0x2')]();var fs_extra=require(_0x1568('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1568('0x4'));var controller=require(_0x1568('0x5'));router[_0x1568('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1568('0x6')](_0x1568('0x7'),auth[_0x1568('0x8')](),controller[_0x1568('0x9')]);router[_0x1568('0x6')](_0x1568('0xa'),auth['isAuthenticated'](),controller[_0x1568('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1568('0xc')](_0x1568('0x7'),auth[_0x1568('0x8')](),controller[_0x1568('0xd')]);router[_0x1568('0xe')]('/:id',auth[_0x1568('0x8')](),controller['destroy']);module[_0x1568('0xf')]=router; \ No newline at end of file +var _0xa334=['/:id','show','/:id/run','run','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x2399bc,_0x475e0d){var _0x3f230a=function(_0x17f6d3){while(--_0x17f6d3){_0x2399bc['push'](_0x2399bc['shift']());}};_0x3f230a(++_0x475e0d);}(_0xa334,0xc7));var _0x4a33=function(_0x4bda80,_0x272aae){_0x4bda80=_0x4bda80-0x0;var _0x4d760d=_0xa334[_0x4bda80];return _0x4d760d;};'use strict';var multer=require(_0x4a33('0x0'));var util=require(_0x4a33('0x1'));var path=require('path');var timeout=require(_0x4a33('0x2'));var express=require(_0x4a33('0x3'));var router=express[_0x4a33('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4a33('0x5'));var config=require(_0x4a33('0x6'));var controller=require(_0x4a33('0x7'));router[_0x4a33('0x8')]('/',auth[_0x4a33('0x9')](),controller[_0x4a33('0xa')]);router[_0x4a33('0x8')](_0x4a33('0xb'),auth['isAuthenticated'](),controller[_0x4a33('0xc')]);router['get'](_0x4a33('0xd'),auth['isAuthenticated'](),controller[_0x4a33('0xe')]);router[_0x4a33('0xf')]('/',auth[_0x4a33('0x9')](),controller[_0x4a33('0x10')]);router[_0x4a33('0x11')](_0x4a33('0xb'),auth[_0x4a33('0x9')](),controller[_0x4a33('0x12')]);router['delete'](_0x4a33('0xb'),auth[_0x4a33('0x9')](),controller[_0x4a33('0x13')]);module[_0x4a33('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6748dd7..2c85d7c 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 _0x572b=['minutes','csv','xlsx','custom','default','BOOLEAN','TEXT','sequelize','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','days','hours'];(function(_0x5527dd,_0x1ffd51){var _0x5b034a=function(_0x3d1fef){while(--_0x3d1fef){_0x5527dd['push'](_0x5527dd['shift']());}};_0x5b034a(++_0x1ffd51);}(_0x572b,0x147));var _0xb572=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x572b[_0xe39824];return _0x4bc31e;};'use strict';var Sequelize=require(_0xb572('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb572('0x1')},'startAt':{'type':Sequelize[_0xb572('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb572('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb572('0x3')]('years',_0xb572('0x4'),_0xb572('0x5'),_0xb572('0x6'),_0xb572('0x7'),_0xb572('0x8'),_0xb572('0x9')),'allowNull':![],'defaultValue':_0xb572('0x7')},'output':{'type':Sequelize[_0xb572('0x3')](_0xb572('0xa'),'pdf',_0xb572('0xb')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xb572('0x3')](_0xb572('0xc'),_0xb572('0xd')),'allowNull':![],'defaultValue':_0xb572('0xc')},'sendMail':{'type':Sequelize[_0xb572('0xe')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xb572('0xf')]},'bcc':{'type':Sequelize[_0xb572('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xb572('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5554=['xlsx','custom','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','csv','pdf'];(function(_0xed5086,_0x452dd4){var _0x46c1be=function(_0x494e30){while(--_0x494e30){_0xed5086['push'](_0xed5086['shift']());}};_0x46c1be(++_0x452dd4);}(_0x5554,0x147));var _0x4555=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x5554[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4555('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4555('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4555('0x0')],'allowNull':![],'defaultValue':_0x4555('0x2')},'startAt':{'type':Sequelize[_0x4555('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4555('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4555('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x4555('0x5'),_0x4555('0x6'),_0x4555('0x7'),_0x4555('0x8'),_0x4555('0x9'),_0x4555('0xa'),_0x4555('0xb')),'allowNull':![],'defaultValue':_0x4555('0x9')},'output':{'type':Sequelize[_0x4555('0xc')](_0x4555('0xd'),_0x4555('0xe'),_0x4555('0xf')),'allowNull':![],'defaultValue':_0x4555('0xd')},'type':{'type':Sequelize[_0x4555('0xc')]('custom','default'),'allowNull':![],'defaultValue':_0x4555('0x10')},'sendMail':{'type':Sequelize[_0x4555('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x4555('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x4555('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x4555('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 0cc2213..0535270 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 _0x12cc=['apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','status','end','error','stack','send','map','Schedule','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x233bb2,_0x1d91dc){var _0x32bb36=function(_0x5140f5){while(--_0x5140f5){_0x233bb2['push'](_0x233bb2['shift']());}};_0x32bb36(++_0x1d91dc);}(_0x12cc,0xe0));var _0xc12c=function(_0x1eb179,_0x29327d){_0x1eb179=_0x1eb179-0x0;var _0x2a92c6=_0x12cc[_0x1eb179];return _0x2a92c6;};'use strict';var emlformat=require(_0xc12c('0x0'));var rimraf=require(_0xc12c('0x1'));var zipdir=require(_0xc12c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc12c('0x3'));var moment=require(_0xc12c('0x4'));var BPromise=require(_0xc12c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc12c('0x6'));var sox=require(_0xc12c('0x7'));var csv=require('to-csv');var ejs=require(_0xc12c('0x8'));var fs=require('fs');var fs_extra=require(_0xc12c('0x9'));var _=require(_0xc12c('0xa'));var squel=require(_0xc12c('0xb'));var crypto=require(_0xc12c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc12c('0xd'));var toCsv=require(_0xc12c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc12c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc12c('0x10'));var logger=require(_0xc12c('0x11'))(_0xc12c('0x12'));var utils=require(_0xc12c('0x13'));var config=require(_0xc12c('0x14'));var licenseUtil=require(_0xc12c('0x15'));var db=require(_0xc12c('0x16'))['db'];function respondWithStatusCode(_0x41cc65,_0x4929db){_0x4929db=_0x4929db||0xcc;return function(_0x2556d6){if(_0x2556d6){return _0x41cc65[_0xc12c('0x17')](_0x4929db);}return _0x41cc65['status'](_0x4929db)['end']();};}function respondWithResult(_0x40284e,_0xe00b6){_0xe00b6=_0xe00b6||0xc8;return function(_0x4acbd0){if(_0x4acbd0){return _0x40284e['status'](_0xe00b6)[_0xc12c('0x18')](_0x4acbd0);}};}function respondWithFilteredResult(_0xc555de,_0x13bfde){return function(_0x4f7d72){if(_0x4f7d72){var _0x1d371d=typeof _0x13bfde[_0xc12c('0x19')]===_0xc12c('0x1a')&&typeof _0x13bfde[_0xc12c('0x1b')]==='undefined';var _0x5a9672=_0x4f7d72[_0xc12c('0x1c')];var _0x48914d=_0x1d371d?0x0:_0x13bfde[_0xc12c('0x19')];var _0x55b042=_0x1d371d?_0x4f7d72[_0xc12c('0x1c')]:_0x13bfde[_0xc12c('0x19')]+_0x13bfde[_0xc12c('0x1b')];var _0x18c076;if(_0x55b042>=_0x5a9672){_0x55b042=_0x5a9672;_0x18c076=0xc8;}else{_0x18c076=0xce;}_0xc555de['status'](_0x18c076);return _0xc555de[_0xc12c('0x1d')](_0xc12c('0x1e'),_0x48914d+'-'+_0x55b042+'/'+_0x5a9672)[_0xc12c('0x18')](_0x4f7d72);}return null;};}function patchUpdates(_0x482c4d){return function(_0x58f9f8){try{jsonpatch[_0xc12c('0x1f')](_0x58f9f8,_0x482c4d,!![]);}catch(_0x57ec05){return BPromise[_0xc12c('0x20')](_0x57ec05);}return _0x58f9f8[_0xc12c('0x21')]();};}function saveUpdates(_0x3c0fbc,_0x235b8d){return function(_0x7ce762){if(_0x7ce762){return _0x7ce762[_0xc12c('0x22')](_0x3c0fbc)[_0xc12c('0x23')](function(_0x16c415){return _0x16c415;});}return null;};}function removeEntity(_0x58d1d7,_0x32be4e){return function(_0x167468){if(_0x167468){return _0x167468[_0xc12c('0x24')]()['then'](function(){var _0x1a2e40=_0x167468[_0xc12c('0x25')]({'plain':!![]});var _0x40125e=_0xc12c('0x26');return db[_0xc12c('0x27')][_0xc12c('0x24')]({'where':{'type':_0x40125e,'resourceId':_0x1a2e40['id']}})[_0xc12c('0x23')](function(){return _0x167468;});})[_0xc12c('0x23')](function(){_0x58d1d7[_0xc12c('0x28')](0xcc)[_0xc12c('0x29')]();});}};}function handleEntityNotFound(_0x3d4430,_0x2beed6){return function(_0x17f3cb){if(!_0x17f3cb){_0x3d4430['sendStatus'](0x194);}return _0x17f3cb;};}function handleError(_0x1473e3,_0x58da83){_0x58da83=_0x58da83||0x1f4;return function(_0x20ffdb){logger[_0xc12c('0x2a')](_0x20ffdb[_0xc12c('0x2b')]);if(_0x20ffdb['name']){delete _0x20ffdb['name'];}_0x1473e3[_0xc12c('0x28')](_0x58da83)[_0xc12c('0x2c')](_0x20ffdb);};}exports['index']=function(_0x4656a9,_0x13d49d){var _0x5b61e7={},_0x4cc296={},_0x247923={'count':0x0,'rows':[]};var _0xe2834f=_[_0xc12c('0x2d')](db[_0xc12c('0x2e')][_0xc12c('0x2f')],function(_0x3ff2f7){return{'name':_0x3ff2f7[_0xc12c('0x30')],'type':_0x3ff2f7[_0xc12c('0x31')][_0xc12c('0x32')]};});_0x4cc296[_0xc12c('0x33')]=_[_0xc12c('0x2d')](_0xe2834f,_0xc12c('0x34'));_0x4cc296[_0xc12c('0x35')]=_[_0xc12c('0x36')](_0x4656a9[_0xc12c('0x35')]);_0x4cc296[_0xc12c('0x37')]=_[_0xc12c('0x38')](_0x4cc296[_0xc12c('0x33')],_0x4cc296['query']);_0x5b61e7['attributes']=_[_0xc12c('0x38')](_0x4cc296[_0xc12c('0x33')],qs[_0xc12c('0x39')](_0x4656a9[_0xc12c('0x35')][_0xc12c('0x39')]));_0x5b61e7['attributes']=_0x5b61e7[_0xc12c('0x3a')][_0xc12c('0x3b')]?_0x5b61e7[_0xc12c('0x3a')]:_0x4cc296[_0xc12c('0x33')];if(!_0x4656a9['query'][_0xc12c('0x3c')]('nolimit')){_0x5b61e7[_0xc12c('0x1b')]=qs[_0xc12c('0x1b')](_0x4656a9[_0xc12c('0x35')][_0xc12c('0x1b')]);_0x5b61e7[_0xc12c('0x19')]=qs[_0xc12c('0x19')](_0x4656a9[_0xc12c('0x35')][_0xc12c('0x19')]);}_0x5b61e7['order']=qs[_0xc12c('0x3d')](_0x4656a9[_0xc12c('0x35')][_0xc12c('0x3d')]);_0x5b61e7[_0xc12c('0x3e')]=qs['filters'](_[_0xc12c('0x3f')](_0x4656a9['query'],_0x4cc296[_0xc12c('0x37')]),_0xe2834f);if(_0x4656a9[_0xc12c('0x35')]['filter']){_0x5b61e7[_0xc12c('0x3e')]=_[_0xc12c('0x40')](_0x5b61e7['where'],{'$or':_[_0xc12c('0x2d')](_0xe2834f,function(_0x539a9f){if(_0x539a9f['type']!==_0xc12c('0x41')){var _0x223018={};_0x223018[_0x539a9f[_0xc12c('0x34')]]={'$like':'%'+_0x4656a9[_0xc12c('0x35')][_0xc12c('0x42')]+'%'};return _0x223018;}})});}_0x5b61e7=_[_0xc12c('0x40')]({},_0x5b61e7,_0x4656a9[_0xc12c('0x43')]);var _0xb2b11a={'where':_0x5b61e7['where']};return db[_0xc12c('0x2e')][_0xc12c('0x1c')](_0xb2b11a)[_0xc12c('0x23')](function(_0x1cd264){_0x247923[_0xc12c('0x1c')]=_0x1cd264;if(_0x4656a9[_0xc12c('0x35')][_0xc12c('0x44')]){_0x5b61e7[_0xc12c('0x45')]=[{'all':!![]}];}return db['Schedule'][_0xc12c('0x46')](_0x5b61e7);})[_0xc12c('0x23')](function(_0x1dcc21){_0x247923[_0xc12c('0x47')]=_0x1dcc21;return _0x247923;})['then'](respondWithFilteredResult(_0x13d49d,_0x5b61e7))[_0xc12c('0x48')](handleError(_0x13d49d,null));};exports['show']=function(_0x398d7a,_0x3197b0){var _0x43bc10={'raw':![],'where':{'id':_0x398d7a[_0xc12c('0x49')]['id']}},_0x15f1d={};_0x15f1d[_0xc12c('0x33')]=_[_0xc12c('0x36')](db[_0xc12c('0x2e')][_0xc12c('0x2f')]);_0x15f1d['query']=_[_0xc12c('0x36')](_0x398d7a[_0xc12c('0x35')]);_0x15f1d[_0xc12c('0x37')]=_['intersection'](_0x15f1d[_0xc12c('0x33')],_0x15f1d[_0xc12c('0x35')]);_0x43bc10[_0xc12c('0x3a')]=_[_0xc12c('0x38')](_0x15f1d[_0xc12c('0x33')],qs[_0xc12c('0x39')](_0x398d7a[_0xc12c('0x35')][_0xc12c('0x39')]));_0x43bc10[_0xc12c('0x3a')]=_0x43bc10[_0xc12c('0x3a')][_0xc12c('0x3b')]?_0x43bc10[_0xc12c('0x3a')]:_0x15f1d['model'];if(_0x398d7a[_0xc12c('0x35')]['includeAll']){_0x43bc10['include']=[{'all':!![]}];}_0x43bc10=_[_0xc12c('0x40')]({},_0x43bc10,_0x398d7a[_0xc12c('0x43')]);return db[_0xc12c('0x2e')][_0xc12c('0x4a')](_0x43bc10)[_0xc12c('0x23')](handleEntityNotFound(_0x3197b0,null))[_0xc12c('0x23')](respondWithResult(_0x3197b0,null))[_0xc12c('0x48')](handleError(_0x3197b0,null));};exports[_0xc12c('0x4b')]=function(_0x186085,_0x4bb978){return db[_0xc12c('0x2e')][_0xc12c('0x4b')](_0x186085['body'],{})[_0xc12c('0x23')](function(_0x5f0d77){var _0x4ca397=_0x186085['user'][_0xc12c('0x25')]({'plain':!![]});if(!_0x4ca397)throw new Error(_0xc12c('0x4c'));if(_0x4ca397[_0xc12c('0x4d')]===_0xc12c('0x4e')){var _0xfa4f7e=_0x5f0d77['get']({'plain':!![]});var _0x4d379e=_0xc12c('0x26');return db['UserProfileSection'][_0xc12c('0x4a')]({'where':{'name':_0x4d379e,'userProfileId':_0x4ca397[_0xc12c('0x4f')]},'raw':!![]})['then'](function(_0x391698){if(_0x391698&&_0x391698[_0xc12c('0x50')]===0x0){return db[_0xc12c('0x27')][_0xc12c('0x4b')]({'name':_0xfa4f7e[_0xc12c('0x34')],'resourceId':_0xfa4f7e['id'],'type':_0x391698[_0xc12c('0x34')],'sectionId':_0x391698['id']},{})[_0xc12c('0x23')](function(){return _0x5f0d77;});}else{return _0x5f0d77;}})['catch'](function(_0x130139){logger[_0xc12c('0x2a')](_0xc12c('0x51'),_0x130139);throw _0x130139;});}return _0x5f0d77;})[_0xc12c('0x23')](respondWithResult(_0x4bb978,0xc9))[_0xc12c('0x48')](handleError(_0x4bb978,null));};exports['update']=function(_0x1b35e6,_0x410a2d){if(_0x1b35e6[_0xc12c('0x52')]['id']){delete _0x1b35e6[_0xc12c('0x52')]['id'];}return db[_0xc12c('0x2e')]['find']({'where':{'id':_0x1b35e6[_0xc12c('0x49')]['id']}})[_0xc12c('0x23')](handleEntityNotFound(_0x410a2d,null))[_0xc12c('0x23')](saveUpdates(_0x1b35e6['body'],null))[_0xc12c('0x23')](respondWithResult(_0x410a2d,null))[_0xc12c('0x48')](handleError(_0x410a2d,null));};exports['destroy']=function(_0x2c9e40,_0x99eb4){return db['Schedule'][_0xc12c('0x4a')]({'where':{'id':_0x2c9e40['params']['id']}})['then'](handleEntityNotFound(_0x99eb4,null))[_0xc12c('0x23')](removeEntity(_0x99eb4,null))['catch'](handleError(_0x99eb4,null));};exports[_0xc12c('0x53')]=function(_0x2786e1,_0x33fcdb,_0x14080c){var _0x791eda=require(_0xc12c('0x54'));return db[_0xc12c('0x2e')]['find']({'where':{'id':_0x2786e1[_0xc12c('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33fcdb,null))[_0xc12c('0x23')](function(){_0x791eda[_0xc12c('0x53')](_0x2786e1[_0xc12c('0x49')]['id']);})[_0xc12c('0x23')](respondWithStatusCode(_0x33fcdb,null))[_0xc12c('0x48')](handleError(_0x33fcdb,null));}; \ No newline at end of file +var _0x320c=['destroy','then','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x1cf5bd,_0xc2e470){var _0x51ce5f=function(_0x3d3e91){while(--_0x3d3e91){_0x1cf5bd['push'](_0x1cf5bd['shift']());}};_0x51ce5f(++_0xc2e470);}(_0x320c,0x87));var _0xc320=function(_0x2d50ce,_0x506051){_0x2d50ce=_0x2d50ce-0x0;var _0x8b5a6a=_0x320c[_0x2d50ce];return _0x8b5a6a;};'use strict';var emlformat=require(_0xc320('0x0'));var rimraf=require(_0xc320('0x1'));var zipdir=require(_0xc320('0x2'));var jsonpatch=require(_0xc320('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc320('0x4'));var Mustache=require(_0xc320('0x5'));var util=require(_0xc320('0x6'));var path=require(_0xc320('0x7'));var sox=require(_0xc320('0x8'));var csv=require('to-csv');var ejs=require(_0xc320('0x9'));var fs=require('fs');var fs_extra=require(_0xc320('0xa'));var _=require('lodash');var squel=require(_0xc320('0xb'));var crypto=require(_0xc320('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc320('0xd'));var toCsv=require(_0xc320('0xe'));var querystring=require(_0xc320('0xf'));var Papa=require(_0xc320('0x10'));var Redis=require(_0xc320('0x11'));var authService=require(_0xc320('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc320('0x13'));var logger=require(_0xc320('0x14'))(_0xc320('0x15'));var utils=require(_0xc320('0x16'));var config=require(_0xc320('0x17'));var licenseUtil=require(_0xc320('0x18'));var db=require(_0xc320('0x19'))['db'];function respondWithStatusCode(_0x23268a,_0xd066d1){_0xd066d1=_0xd066d1||0xcc;return function(_0x40f5a3){if(_0x40f5a3){return _0x23268a[_0xc320('0x1a')](_0xd066d1);}return _0x23268a[_0xc320('0x1b')](_0xd066d1)[_0xc320('0x1c')]();};}function respondWithResult(_0x4f9583,_0x5f1b26){_0x5f1b26=_0x5f1b26||0xc8;return function(_0x42c87c){if(_0x42c87c){return _0x4f9583[_0xc320('0x1b')](_0x5f1b26)[_0xc320('0x1d')](_0x42c87c);}};}function respondWithFilteredResult(_0x1cfafa,_0x38ba1b){return function(_0x3a1a2d){if(_0x3a1a2d){var _0x5d2ddf=typeof _0x38ba1b[_0xc320('0x1e')]===_0xc320('0x1f')&&typeof _0x38ba1b[_0xc320('0x20')]===_0xc320('0x1f');var _0x222b4a=_0x3a1a2d[_0xc320('0x21')];var _0x3c849f=_0x5d2ddf?0x0:_0x38ba1b[_0xc320('0x1e')];var _0x1aaa0c=_0x5d2ddf?_0x3a1a2d[_0xc320('0x21')]:_0x38ba1b[_0xc320('0x1e')]+_0x38ba1b[_0xc320('0x20')];var _0x35a889;if(_0x1aaa0c>=_0x222b4a){_0x1aaa0c=_0x222b4a;_0x35a889=0xc8;}else{_0x35a889=0xce;}_0x1cfafa[_0xc320('0x1b')](_0x35a889);return _0x1cfafa[_0xc320('0x22')](_0xc320('0x23'),_0x3c849f+'-'+_0x1aaa0c+'/'+_0x222b4a)[_0xc320('0x1d')](_0x3a1a2d);}return null;};}function patchUpdates(_0x417723){return function(_0x10a11a){try{jsonpatch[_0xc320('0x24')](_0x10a11a,_0x417723,!![]);}catch(_0x52b4c3){return BPromise['reject'](_0x52b4c3);}return _0x10a11a[_0xc320('0x25')]();};}function saveUpdates(_0x4a6934,_0x17db44){return function(_0x134f8a){if(_0x134f8a){return _0x134f8a[_0xc320('0x26')](_0x4a6934)['then'](function(_0x20eb4a){return _0x20eb4a;});}return null;};}function removeEntity(_0x3734d9,_0x1c87d6){return function(_0x356c7d){if(_0x356c7d){return _0x356c7d[_0xc320('0x27')]()[_0xc320('0x28')](function(){var _0x51607e=_0x356c7d[_0xc320('0x29')]({'plain':!![]});var _0x1d539d=_0xc320('0x2a');return db[_0xc320('0x2b')][_0xc320('0x27')]({'where':{'type':_0x1d539d,'resourceId':_0x51607e['id']}})[_0xc320('0x28')](function(){return _0x356c7d;});})[_0xc320('0x28')](function(){_0x3734d9['status'](0xcc)[_0xc320('0x1c')]();});}};}function handleEntityNotFound(_0x24cd3b,_0x699592){return function(_0x231344){if(!_0x231344){_0x24cd3b['sendStatus'](0x194);}return _0x231344;};}function handleError(_0x1fa0ab,_0x25cf1c){_0x25cf1c=_0x25cf1c||0x1f4;return function(_0x17b833){logger[_0xc320('0x2c')](_0x17b833[_0xc320('0x2d')]);if(_0x17b833[_0xc320('0x2e')]){delete _0x17b833[_0xc320('0x2e')];}_0x1fa0ab['status'](_0x25cf1c)[_0xc320('0x2f')](_0x17b833);};}exports[_0xc320('0x30')]=function(_0x165156,_0x2ce218){var _0x4022df={},_0x28d2b4={},_0x422138={'count':0x0,'rows':[]};var _0x4f441f=_[_0xc320('0x31')](db[_0xc320('0x32')][_0xc320('0x33')],function(_0x177dc5){return{'name':_0x177dc5[_0xc320('0x34')],'type':_0x177dc5[_0xc320('0x35')][_0xc320('0x36')]};});_0x28d2b4[_0xc320('0x37')]=_['map'](_0x4f441f,_0xc320('0x2e'));_0x28d2b4[_0xc320('0x38')]=_[_0xc320('0x39')](_0x165156[_0xc320('0x38')]);_0x28d2b4[_0xc320('0x3a')]=_['intersection'](_0x28d2b4[_0xc320('0x37')],_0x28d2b4[_0xc320('0x38')]);_0x4022df[_0xc320('0x3b')]=_[_0xc320('0x3c')](_0x28d2b4['model'],qs[_0xc320('0x3d')](_0x165156[_0xc320('0x38')][_0xc320('0x3d')]));_0x4022df[_0xc320('0x3b')]=_0x4022df['attributes'][_0xc320('0x3e')]?_0x4022df[_0xc320('0x3b')]:_0x28d2b4['model'];if(!_0x165156['query'][_0xc320('0x3f')](_0xc320('0x40'))){_0x4022df[_0xc320('0x20')]=qs['limit'](_0x165156[_0xc320('0x38')][_0xc320('0x20')]);_0x4022df[_0xc320('0x1e')]=qs['offset'](_0x165156[_0xc320('0x38')][_0xc320('0x1e')]);}_0x4022df[_0xc320('0x41')]=qs['sort'](_0x165156[_0xc320('0x38')]['sort']);_0x4022df[_0xc320('0x42')]=qs['filters'](_['pick'](_0x165156[_0xc320('0x38')],_0x28d2b4[_0xc320('0x3a')]),_0x4f441f);if(_0x165156[_0xc320('0x38')][_0xc320('0x43')]){_0x4022df[_0xc320('0x42')]=_[_0xc320('0x44')](_0x4022df[_0xc320('0x42')],{'$or':_[_0xc320('0x31')](_0x4f441f,function(_0x16fd4c){if(_0x16fd4c['type']!==_0xc320('0x45')){var _0x2f588b={};_0x2f588b[_0x16fd4c[_0xc320('0x2e')]]={'$like':'%'+_0x165156[_0xc320('0x38')][_0xc320('0x43')]+'%'};return _0x2f588b;}})});}_0x4022df=_['merge']({},_0x4022df,_0x165156[_0xc320('0x46')]);var _0x4d07e0={'where':_0x4022df[_0xc320('0x42')]};return db[_0xc320('0x32')][_0xc320('0x21')](_0x4d07e0)[_0xc320('0x28')](function(_0x20267c){_0x422138['count']=_0x20267c;if(_0x165156[_0xc320('0x38')][_0xc320('0x47')]){_0x4022df[_0xc320('0x48')]=[{'all':!![]}];}return db['Schedule'][_0xc320('0x49')](_0x4022df);})[_0xc320('0x28')](function(_0x29a193){_0x422138[_0xc320('0x4a')]=_0x29a193;return _0x422138;})[_0xc320('0x28')](respondWithFilteredResult(_0x2ce218,_0x4022df))[_0xc320('0x4b')](handleError(_0x2ce218,null));};exports['show']=function(_0x193caa,_0x1ed1e9){var _0x377aa6={'raw':![],'where':{'id':_0x193caa[_0xc320('0x4c')]['id']}},_0x2cca35={};_0x2cca35[_0xc320('0x37')]=_['keys'](db[_0xc320('0x32')][_0xc320('0x33')]);_0x2cca35[_0xc320('0x38')]=_[_0xc320('0x39')](_0x193caa[_0xc320('0x38')]);_0x2cca35['filters']=_[_0xc320('0x3c')](_0x2cca35[_0xc320('0x37')],_0x2cca35[_0xc320('0x38')]);_0x377aa6['attributes']=_['intersection'](_0x2cca35[_0xc320('0x37')],qs[_0xc320('0x3d')](_0x193caa[_0xc320('0x38')][_0xc320('0x3d')]));_0x377aa6[_0xc320('0x3b')]=_0x377aa6[_0xc320('0x3b')][_0xc320('0x3e')]?_0x377aa6['attributes']:_0x2cca35['model'];if(_0x193caa[_0xc320('0x38')][_0xc320('0x47')]){_0x377aa6[_0xc320('0x48')]=[{'all':!![]}];}_0x377aa6=_['merge']({},_0x377aa6,_0x193caa['options']);return db[_0xc320('0x32')][_0xc320('0x4d')](_0x377aa6)[_0xc320('0x28')](handleEntityNotFound(_0x1ed1e9,null))['then'](respondWithResult(_0x1ed1e9,null))['catch'](handleError(_0x1ed1e9,null));};exports[_0xc320('0x4e')]=function(_0x517695,_0x437595){return db['Schedule'][_0xc320('0x4e')](_0x517695[_0xc320('0x4f')],{})[_0xc320('0x28')](function(_0xe3926){var _0x840a4a=_0x517695[_0xc320('0x50')][_0xc320('0x29')]({'plain':!![]});if(!_0x840a4a)throw new Error(_0xc320('0x51'));if(_0x840a4a['role']==='user'){var _0x4e6fa2=_0xe3926[_0xc320('0x29')]({'plain':!![]});var _0x50257e=_0xc320('0x2a');return db[_0xc320('0x52')][_0xc320('0x4d')]({'where':{'name':_0x50257e,'userProfileId':_0x840a4a[_0xc320('0x53')]},'raw':!![]})[_0xc320('0x28')](function(_0x3d1696){if(_0x3d1696&&_0x3d1696['autoAssociation']===0x0){return db['UserProfileResource'][_0xc320('0x4e')]({'name':_0x4e6fa2[_0xc320('0x2e')],'resourceId':_0x4e6fa2['id'],'type':_0x3d1696[_0xc320('0x2e')],'sectionId':_0x3d1696['id']},{})[_0xc320('0x28')](function(){return _0xe3926;});}else{return _0xe3926;}})['catch'](function(_0x31b31d){logger[_0xc320('0x2c')](_0xc320('0x54'),_0x31b31d);throw _0x31b31d;});}return _0xe3926;})['then'](respondWithResult(_0x437595,0xc9))[_0xc320('0x4b')](handleError(_0x437595,null));};exports['update']=function(_0x26a60a,_0x4d8528){if(_0x26a60a['body']['id']){delete _0x26a60a['body']['id'];}return db['Schedule'][_0xc320('0x4d')]({'where':{'id':_0x26a60a[_0xc320('0x4c')]['id']}})[_0xc320('0x28')](handleEntityNotFound(_0x4d8528,null))[_0xc320('0x28')](saveUpdates(_0x26a60a[_0xc320('0x4f')],null))[_0xc320('0x28')](respondWithResult(_0x4d8528,null))['catch'](handleError(_0x4d8528,null));};exports[_0xc320('0x27')]=function(_0x56dc50,_0x31a272){return db['Schedule'][_0xc320('0x4d')]({'where':{'id':_0x56dc50[_0xc320('0x4c')]['id']}})[_0xc320('0x28')](handleEntityNotFound(_0x31a272,null))[_0xc320('0x28')](removeEntity(_0x31a272,null))[_0xc320('0x4b')](handleError(_0x31a272,null));};exports[_0xc320('0x55')]=function(_0x42881a,_0x2c76b7,_0x3839c4){var _0x418352=require(_0xc320('0x56'));return db[_0xc320('0x32')][_0xc320('0x4d')]({'where':{'id':_0x42881a['params']['id']},'raw':!![]})[_0xc320('0x28')](handleEntityNotFound(_0x2c76b7,null))[_0xc320('0x28')](function(){_0x418352['run'](_0x42881a['params']['id']);})['then'](respondWithStatusCode(_0x2c76b7,null))['catch'](handleError(_0x2c76b7,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c1f2ded..7e5bdd9 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 _0xe487=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xe487,0xa7));var _0x7e48=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe487[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e48('0x0'));var util=require(_0x7e48('0x1'));var logger=require(_0x7e48('0x2'))(_0x7e48('0x3'));var moment=require(_0x7e48('0x4'));var BPromise=require(_0x7e48('0x5'));var rp=require(_0x7e48('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e48('0x7'));var config=require(_0x7e48('0x8'));var attributes=require('./schedule.attributes');module[_0x7e48('0x9')]=function(_0x546244,_0x97702c){return _0x546244[_0x7e48('0xa')](_0x7e48('0xb'),attributes,{'tableName':_0x7e48('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b1b=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','lodash'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0x2b1b,0x113));var _0xb2b1=function(_0x5de0b9,_0x5bdc38){_0x5de0b9=_0x5de0b9-0x0;var _0x240437=_0x2b1b[_0x5de0b9];return _0x240437;};'use strict';var _=require(_0xb2b1('0x0'));var util=require(_0xb2b1('0x1'));var logger=require(_0xb2b1('0x2'))(_0xb2b1('0x3'));var moment=require(_0xb2b1('0x4'));var BPromise=require(_0xb2b1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b1('0x6'));var rimraf=require(_0xb2b1('0x7'));var config=require(_0xb2b1('0x8'));var attributes=require(_0xb2b1('0x9'));module['exports']=function(_0x8a3365,_0x59f5b4){return _0x8a3365[_0xb2b1('0xa')](_0xb2b1('0xb'),attributes,{'tableName':'tools_schedules','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 0a75994..021881d 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 _0x2d12=['error','code','message','info','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x21d003,_0x5e14a7){var _0xe5b6a4=function(_0x59e27d){while(--_0x59e27d){_0x21d003['push'](_0x21d003['shift']());}};_0xe5b6a4(++_0x5e14a7);}(_0x2d12,0x17f));var _0x22d1=function(_0x12520f,_0x5112ef){_0x12520f=_0x12520f-0x0;var _0x529547=_0x2d12[_0x12520f];return _0x529547;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x22d1('0x0'));var rs=require(_0x22d1('0x1'));var fs=require('fs');var Redis=require(_0x22d1('0x2'));var db=require(_0x22d1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x22d1('0x4'))(_0x22d1('0x5'));var config=require(_0x22d1('0x6'));var jayson=require(_0x22d1('0x7'));var client=jayson['client'][_0x22d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bbb6b,_0x194712,_0x53f0c2){return new BPromise(function(_0x27fcb5,_0x25ff89){return client['request'](_0x4bbb6b,_0x53f0c2)['then'](function(_0x2b52d5){logger['info'](_0x22d1('0x9'),_0x194712,_0x22d1('0xa'));logger[_0x22d1('0xb')]('Schedule,\x20%s,\x20%s,\x20%s',_0x194712,_0x22d1('0xa'),JSON[_0x22d1('0xc')](_0x2b52d5));if(_0x2b52d5[_0x22d1('0xd')]){if(_0x2b52d5[_0x22d1('0xd')][_0x22d1('0xe')]===0x1f4){logger[_0x22d1('0xd')](_0x22d1('0x9'),_0x194712,_0x2b52d5['error'][_0x22d1('0xf')]);return _0x25ff89(_0x2b52d5['error'][_0x22d1('0xf')]);}logger[_0x22d1('0xd')](_0x22d1('0x9'),_0x194712,_0x2b52d5[_0x22d1('0xd')][_0x22d1('0xf')]);return _0x27fcb5(_0x2b52d5[_0x22d1('0xd')]['message']);}else{logger[_0x22d1('0x10')](_0x22d1('0x9'),_0x194712,'request\x20sent');_0x27fcb5(_0x2b52d5[_0x22d1('0x11')][_0x22d1('0xf')]);}})['catch'](function(_0x462561){logger[_0x22d1('0xd')]('Schedule,\x20%s,\x20%s',_0x194712,_0x462561);_0x25ff89(_0x462561);});});} \ No newline at end of file +var _0x67be=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0xd94bb6,_0x160af1){var _0x5bd51b=function(_0x110041){while(--_0x110041){_0xd94bb6['push'](_0xd94bb6['shift']());}};_0x5bd51b(++_0x160af1);}(_0x67be,0xbd));var _0xe67b=function(_0x4d8bee,_0xd448c7){_0x4d8bee=_0x4d8bee-0x0;var _0x417fee=_0x67be[_0x4d8bee];return _0x417fee;};'use strict';var _=require(_0xe67b('0x0'));var util=require('util');var moment=require(_0xe67b('0x1'));var BPromise=require(_0xe67b('0x2'));var rs=require(_0xe67b('0x3'));var fs=require('fs');var Redis=require(_0xe67b('0x4'));var db=require(_0xe67b('0x5'))['db'];var utils=require(_0xe67b('0x6'));var logger=require('../../config/logger')(_0xe67b('0x7'));var config=require(_0xe67b('0x8'));var jayson=require(_0xe67b('0x9'));var client=jayson['client'][_0xe67b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a8fcd,_0x8539c4,_0x2872a7){return new BPromise(function(_0x1d48b1,_0x3602c8){return client[_0xe67b('0xb')](_0x3a8fcd,_0x2872a7)[_0xe67b('0xc')](function(_0x3f3762){logger[_0xe67b('0xd')](_0xe67b('0xe'),_0x8539c4,_0xe67b('0xf'));logger[_0xe67b('0x10')](_0xe67b('0x11'),_0x8539c4,_0xe67b('0xf'),JSON['stringify'](_0x3f3762));if(_0x3f3762[_0xe67b('0x12')]){if(_0x3f3762[_0xe67b('0x12')][_0xe67b('0x13')]===0x1f4){logger[_0xe67b('0x12')](_0xe67b('0xe'),_0x8539c4,_0x3f3762[_0xe67b('0x12')][_0xe67b('0x14')]);return _0x3602c8(_0x3f3762[_0xe67b('0x12')][_0xe67b('0x14')]);}logger[_0xe67b('0x12')](_0xe67b('0xe'),_0x8539c4,_0x3f3762[_0xe67b('0x12')][_0xe67b('0x14')]);return _0x1d48b1(_0x3f3762[_0xe67b('0x12')][_0xe67b('0x14')]);}else{logger['info'](_0xe67b('0xe'),_0x8539c4,'request\x20sent');_0x1d48b1(_0x3f3762[_0xe67b('0x15')][_0xe67b('0x14')]);}})[_0xe67b('0x16')](function(_0x30c3f2){logger[_0xe67b('0x12')](_0xe67b('0xe'),_0x8539c4,_0x30c3f2);_0x3602c8(_0x30c3f2);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 18c65e2..93b844b 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 _0x78e1=['describe','/:id','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x2f52b7,_0x49a1ca){var _0xba269a=function(_0x334a38){while(--_0x334a38){_0x2f52b7['push'](_0x2f52b7['shift']());}};_0xba269a(++_0x49a1ca);}(_0x78e1,0xfc));var _0x178e=function(_0x4c47ff,_0xd8d468){_0x4c47ff=_0x4c47ff-0x0;var _0x4f45bd=_0x78e1[_0x4c47ff];return _0x4f45bd;};'use strict';var multer=require(_0x178e('0x0'));var util=require(_0x178e('0x1'));var path=require(_0x178e('0x2'));var timeout=require(_0x178e('0x3'));var express=require(_0x178e('0x4'));var router=express[_0x178e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x178e('0x6'));var config=require(_0x178e('0x7'));var controller=require(_0x178e('0x8'));router[_0x178e('0x9')]('/',auth[_0x178e('0xa')](),controller['index']);router['get'](_0x178e('0xb'),auth[_0x178e('0xa')](),controller[_0x178e('0xc')]);router[_0x178e('0x9')](_0x178e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x178e('0x9')](_0x178e('0xe'),auth[_0x178e('0xa')](),controller[_0x178e('0xf')]);router[_0x178e('0x10')]('/',auth[_0x178e('0xa')](),controller[_0x178e('0x11')]);router['put'](_0x178e('0xd'),auth[_0x178e('0xa')](),controller[_0x178e('0x12')]);router[_0x178e('0x13')](_0x178e('0xd'),auth[_0x178e('0xa')](),controller[_0x178e('0x14')]);module[_0x178e('0x15')]=router; \ No newline at end of file +var _0x983f=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/download','post','create','put','update','destroy'];(function(_0x325123,_0x13dc04){var _0x11b36b=function(_0x448dcc){while(--_0x448dcc){_0x325123['push'](_0x325123['shift']());}};_0x11b36b(++_0x13dc04);}(_0x983f,0xd3));var _0xf983=function(_0x4060db,_0x52677e){_0x4060db=_0x4060db-0x0;var _0x2cce5a=_0x983f[_0x4060db];return _0x2cce5a;};'use strict';var multer=require('multer');var util=require(_0xf983('0x0'));var path=require(_0xf983('0x1'));var timeout=require('connect-timeout');var express=require(_0xf983('0x2'));var router=express['Router']();var fs_extra=require(_0xf983('0x3'));var auth=require(_0xf983('0x4'));var interaction=require(_0xf983('0x5'));var config=require(_0xf983('0x6'));var controller=require(_0xf983('0x7'));router[_0xf983('0x8')]('/',auth['isAuthenticated'](),controller[_0xf983('0x9')]);router[_0xf983('0x8')](_0xf983('0xa'),auth[_0xf983('0xb')](),controller['describe']);router['get'](_0xf983('0xc'),auth[_0xf983('0xb')](),controller[_0xf983('0xd')]);router[_0xf983('0x8')](_0xf983('0xe'),auth[_0xf983('0xb')](),controller['download']);router[_0xf983('0xf')]('/',auth['isAuthenticated'](),controller[_0xf983('0x10')]);router[_0xf983('0x11')]('/:id',auth[_0xf983('0xb')](),controller[_0xf983('0x12')]);router['delete']('/:id',auth[_0xf983('0xb')](),controller[_0xf983('0x13')]);module[_0xf983('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 581a8c8..6c8ca01 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 _0xa1cc=['path','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','subtract','closedAt','duration','startedAt','MM-DD-YYYY\x20HH:mm','DATE','toString','createdAt','format','updatedAt','sequelize','moment'];(function(_0x5d24e7,_0x9e1e4c){var _0x5bcc06=function(_0x511a04){while(--_0x511a04){_0x5d24e7['push'](_0x5d24e7['shift']());}};_0x5bcc06(++_0x9e1e4c);}(_0xa1cc,0x10f));var _0xca1c=function(_0x5be8fa,_0x717b66){_0x5be8fa=_0x5be8fa-0x0;var _0x7bdc3e=_0xa1cc[_0x5be8fa];return _0x7bdc3e;};'use strict';var Sequelize=require(_0xca1c('0x0'));var moment=require(_0xca1c('0x1'));var path=require(_0xca1c('0x2'));var config=require('../../config/environment');module[_0xca1c('0x3')]={'format':{'type':Sequelize[_0xca1c('0x4')],'get':function(){return this[_0xca1c('0x5')]('value')?path[_0xca1c('0x6')](this['getDataValue'](_0xca1c('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xca1c('0x8')]},'channel':{'type':Sequelize[_0xca1c('0x8')]},'value':{'type':Sequelize[_0xca1c('0x8')],'set':function(_0x5d5101){var _0x5132e2=_0x5d5101[_0xca1c('0x9')](/\\/g,'/');this[_0xca1c('0xa')](_0xca1c('0x7'),_0x5132e2);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x57807b){this[_0xca1c('0xa')]('startedAt',moment()[_0xca1c('0xb')](_0x57807b,'ms'));this[_0xca1c('0xa')](_0xca1c('0xc'),moment());this[_0xca1c('0xa')](_0xca1c('0xd'),_0x57807b);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xca1c('0x5')](_0xca1c('0xe')))['format'](_0xca1c('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0xca1c('0x10')],'get':function(){return moment(this[_0xca1c('0x5')](_0xca1c('0xc')))['format'](_0xca1c('0xf'))[_0xca1c('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xca1c('0x12')))[_0xca1c('0x13')](_0xca1c('0xf'))[_0xca1c('0x11')]();}},'updatedAt':{'type':Sequelize[_0xca1c('0x10')],'get':function(){return moment(this[_0xca1c('0x5')](_0xca1c('0x14')))[_0xca1c('0x13')](_0xca1c('0xf'))[_0xca1c('0x11')]();}}}; \ No newline at end of file +var _0x9e69=['getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt','moment','path','../../config/environment','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9e69,0x150));var _0x99e6=function(_0x46e9d9,_0x269285){_0x46e9d9=_0x46e9d9-0x0;var _0x348905=_0x9e69[_0x46e9d9];return _0x348905;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x99e6('0x0'));var path=require(_0x99e6('0x1'));var config=require(_0x99e6('0x2'));module[_0x99e6('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x99e6('0x4')](_0x99e6('0x5'))?path['extname'](this[_0x99e6('0x4')](_0x99e6('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x99e6('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x99e6('0x6')],'set':function(_0x3cf241){var _0x41635b=_0x3cf241['replace'](/\\/g,'/');this[_0x99e6('0x7')](_0x99e6('0x5'),_0x41635b);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x99e6('0x8')],'set':function(_0x133169){this['setDataValue'](_0x99e6('0x9'),moment()[_0x99e6('0xa')](_0x133169,'ms'));this['setDataValue']('closedAt',moment());this[_0x99e6('0x7')](_0x99e6('0xb'),_0x133169);}},'startedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x9')))[_0x99e6('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x99e6('0xe')]();}},'closedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')]('closedAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x10')))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 10cddb7..9f69f42 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 _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x18e31a,_0x3c8310){var _0x2b4406=function(_0x4be22c){while(--_0x4be22c){_0x18e31a['push'](_0x18e31a['shift']());}};_0x2b4406(++_0x3c8310);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file +var _0x7bae=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x12e3cb,_0x56b424){var _0x381e17=function(_0x34f495){while(--_0x34f495){_0x12e3cb['push'](_0x12e3cb['shift']());}};_0x381e17(++_0x56b424);}(_0x7bae,0x13b));var _0xe7ba=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7bae[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 4b56b32..ec943db 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 _0x914d=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x914d,0x1e9));var _0xd914=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x914d[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd914('0x0'));var util=require('util');var logger=require(_0xd914('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd914('0x2'));var rp=require(_0xd914('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd914('0x4'));var config=require(_0xd914('0x5'));var attributes=require(_0xd914('0x6'));module[_0xd914('0x7')]=function(_0x4f38d2,_0x5f4dfc){return _0x4f38d2[_0xd914('0x8')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xd914('0x9'),'fields':[_0xd914('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x69cd=['request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4fd985,_0x4e972f){var _0x171b29=function(_0x26c2d3){while(--_0x26c2d3){_0x4fd985['push'](_0x4fd985['shift']());}};_0x171b29(++_0x4e972f);}(_0x69cd,0x86));var _0xd69c=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x69cd[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0xd69c('0x0'));var util=require(_0xd69c('0x1'));var logger=require(_0xd69c('0x2'))(_0xd69c('0x3'));var moment=require(_0xd69c('0x4'));var BPromise=require(_0xd69c('0x5'));var rp=require(_0xd69c('0x6'));var fs=require('fs');var path=require(_0xd69c('0x7'));var rimraf=require(_0xd69c('0x8'));var config=require(_0xd69c('0x9'));var attributes=require(_0xd69c('0xa'));module[_0xd69c('0xb')]=function(_0x2aeed9,_0x2f862b){return _0x2aeed9[_0xd69c('0xc')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xd69c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 563b50b..8664543 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 _0xa26f=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s'];(function(_0x4e3078,_0x416eb3){var _0x3a8892=function(_0x132080){while(--_0x132080){_0x4e3078['push'](_0x4e3078['shift']());}};_0x3a8892(++_0x416eb3);}(_0xa26f,0xd8));var _0xfa26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa26f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa26('0x0'));var BPromise=require(_0xfa26('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa26('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa26('0x3'));var logger=require(_0xfa26('0x4'))(_0xfa26('0x5'));var config=require(_0xfa26('0x6'));var jayson=require(_0xfa26('0x7'));var client=jayson[_0xfa26('0x8')][_0xfa26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bbbe5,_0x11b523,_0x5da56f){return new BPromise(function(_0x46baf8,_0x173e65){return client[_0xfa26('0xa')](_0x1bbbe5,_0x5da56f)[_0xfa26('0xb')](function(_0x52f50d){logger[_0xfa26('0xc')](_0xfa26('0xd'),_0x11b523,_0xfa26('0xe'));logger[_0xfa26('0xf')](_0xfa26('0x10'),_0x11b523,_0xfa26('0xe'),JSON[_0xfa26('0x11')](_0x52f50d));if(_0x52f50d['error']){if(_0x52f50d[_0xfa26('0x12')][_0xfa26('0x13')]===0x1f4){logger['error'](_0xfa26('0xd'),_0x11b523,_0x52f50d['error']['message']);return _0x173e65(_0x52f50d[_0xfa26('0x12')][_0xfa26('0x14')]);}logger[_0xfa26('0x12')](_0xfa26('0xd'),_0x11b523,_0x52f50d[_0xfa26('0x12')][_0xfa26('0x14')]);return _0x46baf8(_0x52f50d[_0xfa26('0x12')][_0xfa26('0x14')]);}else{logger[_0xfa26('0xc')](_0xfa26('0xd'),_0x11b523,_0xfa26('0xe'));_0x46baf8(_0x52f50d[_0xfa26('0x15')][_0xfa26('0x14')]);}})[_0xfa26('0x16')](function(_0x5ea0ac){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x11b523,_0x5ea0ac);_0x173e65(_0x5ea0ac);});});} \ No newline at end of file +var _0xcc41=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x44d900,_0x3de703){var _0x2f1bb0=function(_0x55c2ef){while(--_0x55c2ef){_0x44d900['push'](_0x44d900['shift']());}};_0x2f1bb0(++_0x3de703);}(_0xcc41,0x1e2));var _0x1cc4=function(_0x127a5b,_0x46a722){_0x127a5b=_0x127a5b-0x0;var _0x1ddf6d=_0xcc41[_0x127a5b];return _0x1ddf6d;};'use strict';var _=require('lodash');var util=require(_0x1cc4('0x0'));var moment=require(_0x1cc4('0x1'));var BPromise=require(_0x1cc4('0x2'));var rs=require(_0x1cc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cc4('0x4'))['db'];var utils=require(_0x1cc4('0x5'));var logger=require(_0x1cc4('0x6'))(_0x1cc4('0x7'));var config=require(_0x1cc4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1cc4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52031c,_0x256188,_0xb53c6e){return new BPromise(function(_0x240952,_0x5c16b3){return client[_0x1cc4('0xa')](_0x52031c,_0xb53c6e)[_0x1cc4('0xb')](function(_0x4a0dad){logger[_0x1cc4('0xc')](_0x1cc4('0xd'),_0x256188,_0x1cc4('0xe'));logger[_0x1cc4('0xf')](_0x1cc4('0x10'),_0x256188,_0x1cc4('0xe'),JSON[_0x1cc4('0x11')](_0x4a0dad));if(_0x4a0dad[_0x1cc4('0x12')]){if(_0x4a0dad[_0x1cc4('0x12')][_0x1cc4('0x13')]===0x1f4){logger['error'](_0x1cc4('0xd'),_0x256188,_0x4a0dad[_0x1cc4('0x12')]['message']);return _0x5c16b3(_0x4a0dad[_0x1cc4('0x12')][_0x1cc4('0x14')]);}logger[_0x1cc4('0x12')](_0x1cc4('0xd'),_0x256188,_0x4a0dad[_0x1cc4('0x12')]['message']);return _0x240952(_0x4a0dad[_0x1cc4('0x12')][_0x1cc4('0x14')]);}else{logger[_0x1cc4('0xc')](_0x1cc4('0xd'),_0x256188,_0x1cc4('0xe'));_0x240952(_0x4a0dad[_0x1cc4('0x15')][_0x1cc4('0x14')]);}})[_0x1cc4('0x16')](function(_0xa9783a){logger[_0x1cc4('0x12')](_0x1cc4('0xd'),_0x256188,_0xa9783a);_0x5c16b3(_0xa9783a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index a41e52e..8b67727 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 _0x8e3c=['show','getLogo','getLogoLogin','/:id/gdpr','gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','addLogo','%s%s','logologin','extname','/:id/logo_login','file','preferred','addPreferred','addFavicon','put','update','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id'];(function(_0x38bbbe,_0x12d11d){var _0x3a8e22=function(_0x542b00){while(--_0x542b00){_0x38bbbe['push'](_0x38bbbe['shift']());}};_0x3a8e22(++_0x12d11d);}(_0x8e3c,0x163));var _0xc8e3=function(_0x5d099e,_0x5c9423){_0x5d099e=_0x5d099e-0x0;var _0x14a37b=_0x8e3c[_0x5d099e];return _0x14a37b;};'use strict';var multer=require('multer');var util=require(_0xc8e3('0x0'));var path=require(_0xc8e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc8e3('0x2'));var router=express[_0xc8e3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc8e3('0x4'));var interaction=require(_0xc8e3('0x5'));var config=require(_0xc8e3('0x6'));var controller=require(_0xc8e3('0x7'));router['get']('/',auth[_0xc8e3('0x8')](),controller[_0xc8e3('0x9')]);router[_0xc8e3('0xa')](_0xc8e3('0xb'),controller[_0xc8e3('0xc')]);router[_0xc8e3('0xa')](_0xc8e3('0xd'),controller[_0xc8e3('0xe')]);router[_0xc8e3('0xa')]('/:id/logo',controller[_0xc8e3('0xf')]);router[_0xc8e3('0xa')]('/:id/logo_login',controller[_0xc8e3('0x10')]);router['get'](_0xc8e3('0x11'),controller[_0xc8e3('0x12')]);router['get']('/:id/preferred',controller[_0xc8e3('0x13')]);router[_0xc8e3('0xa')]('/:id/favicon',controller[_0xc8e3('0x14')]);var upload=multer({'storage':multer[_0xc8e3('0x15')]({'destination':function(_0xadeaa6,_0xc0fe1b,_0x52b687){_0x52b687(null,path[_0xc8e3('0x16')](config[_0xc8e3('0x17')],_0xc8e3('0x18')));},'filename':function(_0x252ea7,_0x7544da,_0x12b6eb){_0x12b6eb(null,util[_0xc8e3('0x19')]('%s%s',_0xc8e3('0x1a'),path['extname'](_0x7544da[_0xc8e3('0x1b')])));}})});router[_0xc8e3('0x1c')]('/:id/logo',upload[_0xc8e3('0x1d')]('file'),controller[_0xc8e3('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x201d64,_0x5ef14a,_0x321837){_0x321837(null,path[_0xc8e3('0x16')](config[_0xc8e3('0x17')],_0xc8e3('0x18')));},'filename':function(_0x172f3b,_0x2418b0,_0x357489){_0x357489(null,util[_0xc8e3('0x19')](_0xc8e3('0x1f'),_0xc8e3('0x20'),path[_0xc8e3('0x21')](_0x2418b0[_0xc8e3('0x1b')])));}})});router['post'](_0xc8e3('0x22'),upload[_0xc8e3('0x1d')](_0xc8e3('0x23')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1483ae,_0x57a73c,_0x798f73){_0x798f73(null,path[_0xc8e3('0x16')](config[_0xc8e3('0x17')],_0xc8e3('0x18')));},'filename':function(_0x490d21,_0x116251,_0x58ec39){_0x58ec39(null,util[_0xc8e3('0x19')]('%s%s',_0xc8e3('0x24'),path[_0xc8e3('0x21')](_0x116251[_0xc8e3('0x1b')])));}})});router[_0xc8e3('0x1c')]('/:id/preferred',upload[_0xc8e3('0x1d')](_0xc8e3('0x23')),controller[_0xc8e3('0x25')]);var upload=multer({'storage':multer[_0xc8e3('0x15')]({'destination':function(_0x3f46a3,_0xc9c64b,_0x221783){_0x221783(null,path[_0xc8e3('0x16')](config[_0xc8e3('0x17')],_0xc8e3('0x18')));},'filename':function(_0x48d365,_0x8d7b2,_0x3a8027){_0x3a8027(null,util['format']('%s%s','favicon',path[_0xc8e3('0x21')](_0x8d7b2[_0xc8e3('0x1b')])));}})});router[_0xc8e3('0x1c')]('/:id/favicon',upload[_0xc8e3('0x1d')](_0xc8e3('0x23')),controller[_0xc8e3('0x26')]);router[_0xc8e3('0x27')](_0xc8e3('0xd'),auth[_0xc8e3('0x8')](),controller[_0xc8e3('0x28')]);module['exports']=router; \ No newline at end of file +var _0xbf9d=['getDate','get','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','post','/:id/logo','single','server/files/images/logos/','logologin','extname','originalname','file','%s%s','preferred','addPreferred','favicon','/:id','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','/now'];(function(_0x2fd56e,_0x168395){var _0x8562e8=function(_0x2aa0e8){while(--_0x2aa0e8){_0x2fd56e['push'](_0x2fd56e['shift']());}};_0x8562e8(++_0x168395);}(_0xbf9d,0x16e));var _0xdbf9=function(_0x14fd4a,_0x145947){_0x14fd4a=_0x14fd4a-0x0;var _0x448502=_0xbf9d[_0x14fd4a];return _0x448502;};'use strict';var multer=require(_0xdbf9('0x0'));var util=require(_0xdbf9('0x1'));var path=require('path');var timeout=require(_0xdbf9('0x2'));var express=require(_0xdbf9('0x3'));var router=express['Router']();var fs_extra=require(_0xdbf9('0x4'));var auth=require(_0xdbf9('0x5'));var interaction=require(_0xdbf9('0x6'));var config=require(_0xdbf9('0x7'));var controller=require(_0xdbf9('0x8'));router['get']('/',auth[_0xdbf9('0x9')](),controller[_0xdbf9('0xa')]);router['get'](_0xdbf9('0xb'),controller[_0xdbf9('0xc')]);router[_0xdbf9('0xd')]('/:id',controller[_0xdbf9('0xe')]);router[_0xdbf9('0xd')]('/:id/logo',controller[_0xdbf9('0xf')]);router['get'](_0xdbf9('0x10'),controller[_0xdbf9('0x11')]);router[_0xdbf9('0xd')](_0xdbf9('0x12'),controller[_0xdbf9('0x13')]);router[_0xdbf9('0xd')](_0xdbf9('0x14'),controller[_0xdbf9('0x15')]);router[_0xdbf9('0xd')](_0xdbf9('0x16'),controller[_0xdbf9('0x17')]);var upload=multer({'storage':multer[_0xdbf9('0x18')]({'destination':function(_0x4140ed,_0x1ffcdb,_0x9603a6){_0x9603a6(null,path[_0xdbf9('0x19')](config[_0xdbf9('0x1a')],'server/files/images/logos/'));},'filename':function(_0x48a2b3,_0x56883a,_0x1ca6be){_0x1ca6be(null,util[_0xdbf9('0x1b')]('%s%s','logo',path['extname'](_0x56883a['originalname'])));}})});router[_0xdbf9('0x1c')](_0xdbf9('0x1d'),upload[_0xdbf9('0x1e')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xdbf9('0x18')]({'destination':function(_0x5ec1a8,_0x7bd4cb,_0x4d49bd){_0x4d49bd(null,path[_0xdbf9('0x19')](config['root'],_0xdbf9('0x1f')));},'filename':function(_0x412b5e,_0x55a197,_0x1a1b6b){_0x1a1b6b(null,util[_0xdbf9('0x1b')]('%s%s',_0xdbf9('0x20'),path[_0xdbf9('0x21')](_0x55a197[_0xdbf9('0x22')])));}})});router[_0xdbf9('0x1c')](_0xdbf9('0x10'),upload[_0xdbf9('0x1e')](_0xdbf9('0x23')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xdbf9('0x18')]({'destination':function(_0x5938ef,_0x4dc716,_0x3fa7b2){_0x3fa7b2(null,path[_0xdbf9('0x19')](config['root'],_0xdbf9('0x1f')));},'filename':function(_0x386969,_0x52f7a2,_0x1e4b7e){_0x1e4b7e(null,util[_0xdbf9('0x1b')](_0xdbf9('0x24'),_0xdbf9('0x25'),path[_0xdbf9('0x21')](_0x52f7a2[_0xdbf9('0x22')])));}})});router[_0xdbf9('0x1c')](_0xdbf9('0x14'),upload[_0xdbf9('0x1e')](_0xdbf9('0x23')),controller[_0xdbf9('0x26')]);var upload=multer({'storage':multer[_0xdbf9('0x18')]({'destination':function(_0x50b33d,_0x2c772a,_0x5d7890){_0x5d7890(null,path[_0xdbf9('0x19')](config[_0xdbf9('0x1a')],_0xdbf9('0x1f')));},'filename':function(_0x49d212,_0x26ec6f,_0x49efe0){_0x49efe0(null,util[_0xdbf9('0x1b')](_0xdbf9('0x24'),_0xdbf9('0x27'),path[_0xdbf9('0x21')](_0x26ec6f[_0xdbf9('0x22')])));}})});router[_0xdbf9('0x1c')]('/:id/favicon',upload[_0xdbf9('0x1e')]('file'),controller['addFavicon']);router['put'](_0xdbf9('0x28'),auth[_0xdbf9('0x9')](),controller['update']);module[_0xdbf9('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index a542488..30fc599 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 _0x4634=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x201890,_0x191e9a){var _0x8d4f28=function(_0x16d492){while(--_0x16d492){_0x201890['push'](_0x201890['shift']());}};_0x8d4f28(++_0x191e9a);}(_0x4634,0xfc));var _0x4463=function(_0x12396d,_0x3267fd){_0x12396d=_0x12396d-0x0;var _0x353204=_0x4634[_0x12396d];return _0x353204;};'use strict';var Sequelize=require(_0x4463('0x0'));module[_0x4463('0x1')]={'min_internal':{'type':Sequelize[_0x4463('0x2')](0xb),'unique':_0x4463('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4463('0x2')](0xb),'unique':_0x4463('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4463('0x5')],'defaultValue':_0x4463('0x6')},'logo':{'type':Sequelize[_0x4463('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x4463('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x4463('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x4463('0x5')]},'turnaddr':{'type':Sequelize[_0x4463('0x5')]},'turnusername':{'type':Sequelize[_0x4463('0x5')]},'turnpassword':{'type':Sequelize[_0x4463('0x5')]},'pageTitle':{'type':Sequelize[_0x4463('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4463('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x4463('0x8')},'enableEmailPreview':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4463('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4463('0x5')]},'defaultPreferred':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x4463('0x5')]},'sentiment':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x4463('0x2')]},'sentimentRegion':{'type':Sequelize[_0x4463('0x5')]},'language':{'type':Sequelize[_0x4463('0x5')]},'bucket':{'type':Sequelize[_0x4463('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x4463('0x2')](0x2)[_0x4463('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x4463('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x4463('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x4463('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x4463('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x4463('0x7')],'defaultValue':![]},'viewHelpSection':{'type':Sequelize[_0x4463('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1c37=['min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','STRING','INTEGER','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x1c37,0xc4));var _0x71c3=function(_0xecf844,_0x4ed278){_0xecf844=_0xecf844-0x0;var _0x696713=_0x1c37[_0xecf844];return _0x696713;};'use strict';var Sequelize=require(_0x71c3('0x0'));module[_0x71c3('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x71c3('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x71c3('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x71c3('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x71c3('0x6')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x71c3('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x71c3('0x6')]},'turnusername':{'type':Sequelize[_0x71c3('0x6')]},'turnpassword':{'type':Sequelize[_0x71c3('0x6')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x71c3('0x7')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x71c3('0x8')},'enableEmailPreview':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x71c3('0x6')],'defaultValue':_0x71c3('0x9')},'chatTimeout':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x71c3('0x6')]},'defaultPreferred':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x71c3('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x71c3('0x6')]},'defaultFavicon':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x71c3('0x6')]},'sentiment':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x71c3('0x7')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x71c3('0x6')]},'googleSsoEnabled':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x71c3('0x7')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x71c3('0x7')](0x2)[_0x71c3('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x71c3('0x7')](0x2)[_0x71c3('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x71c3('0x7')](0x2)[_0x71c3('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x71c3('0x7')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x71c3('0x5')],'defaultValue':![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8a38507..ff537aa 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 _0x96ea=['send','index','map','Setting','rawAttributes','type','model','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','fields','find','body','addLogo','filename','logo','addLogoLogin','file','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','toLower','join','root','default_logo.svg','default','upperFirst','custom','existsSync','ValidationError','\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','Sequelize','securePassword','addPreferred','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','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','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','sendStatus','name'];(function(_0x428dbd,_0x30eeb5){var _0xc411d8=function(_0x12cab8){while(--_0x12cab8){_0x428dbd['push'](_0x428dbd['shift']());}};_0xc411d8(++_0x30eeb5);}(_0x96ea,0xc3));var _0xa96e=function(_0x7880d2,_0x32e7d6){_0x7880d2=_0x7880d2-0x0;var _0x35ebbe=_0x96ea[_0x7880d2];return _0x35ebbe;};'use strict';var emlformat=require(_0xa96e('0x0'));var rimraf=require(_0xa96e('0x1'));var zipdir=require(_0xa96e('0x2'));var jsonpatch=require(_0xa96e('0x3'));var rp=require(_0xa96e('0x4'));var moment=require(_0xa96e('0x5'));var BPromise=require(_0xa96e('0x6'));var Mustache=require('mustache');var util=require(_0xa96e('0x7'));var path=require('path');var sox=require(_0xa96e('0x8'));var csv=require(_0xa96e('0x9'));var ejs=require(_0xa96e('0xa'));var fs=require('fs');var fs_extra=require(_0xa96e('0xb'));var _=require('lodash');var squel=require(_0xa96e('0xc'));var crypto=require(_0xa96e('0xd'));var jsforce=require(_0xa96e('0xe'));var deskjs=require(_0xa96e('0xf'));var toCsv=require(_0xa96e('0x9'));var querystring=require(_0xa96e('0x10'));var Papa=require(_0xa96e('0x11'));var Redis=require(_0xa96e('0x12'));var authService=require(_0xa96e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa96e('0x14'));var hardwareService=require(_0xa96e('0x15'));var logger=require(_0xa96e('0x16'))('api');var utils=require(_0xa96e('0x17'));var config=require(_0xa96e('0x18'));var licenseUtil=require(_0xa96e('0x19'));var db=require(_0xa96e('0x1a'))['db'];var jayson=require(_0xa96e('0x1b'));var client=jayson['client'][_0xa96e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x11a77a,_0x381faf,_0x419629,_0x6ba9e5){return new BPromise(function(_0x32a856,_0x341acb){var _0x477695=_0x6ba9e5||client;return _0x477695['request'](_0x11a77a,_0x419629)[_0xa96e('0x1d')](function(_0x24c949){logger[_0xa96e('0x1e')](_0xa96e('0x1f'),_0x381faf,'request\x20sent');logger[_0xa96e('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x381faf,'request\x20sent',JSON[_0xa96e('0x21')](_0x24c949));if(_0x24c949[_0xa96e('0x22')]){if(_0x24c949[_0xa96e('0x22')][_0xa96e('0x23')]===0x1f4){logger[_0xa96e('0x22')](_0xa96e('0x1f'),_0x381faf,_0x24c949[_0xa96e('0x22')][_0xa96e('0x24')]);return _0x341acb(_0x24c949[_0xa96e('0x22')]['message']);}logger[_0xa96e('0x22')](_0xa96e('0x1f'),_0x381faf,_0x24c949[_0xa96e('0x22')][_0xa96e('0x24')]);return _0x32a856(_0x24c949[_0xa96e('0x22')][_0xa96e('0x24')]);}else{logger[_0xa96e('0x1e')](_0xa96e('0x1f'),_0x381faf,_0xa96e('0x25'));_0x32a856(_0x24c949[_0xa96e('0x26')]['message']);}})[_0xa96e('0x27')](function(_0x2c7556){logger[_0xa96e('0x22')](_0xa96e('0x1f'),_0x381faf,_0x2c7556);_0x341acb(_0x2c7556);});});}function respondWithStatusCode(_0x51a610,_0x3c526a){_0x3c526a=_0x3c526a||0xcc;return function(_0x2c6035){if(_0x2c6035){return _0x51a610['sendStatus'](_0x3c526a);}return _0x51a610[_0xa96e('0x28')](_0x3c526a)[_0xa96e('0x29')]();};}function respondWithResult(_0x372549,_0x35e1a1){_0x35e1a1=_0x35e1a1||0xc8;return function(_0x3c2c80){if(_0x3c2c80){return _0x372549[_0xa96e('0x28')](_0x35e1a1)['json'](_0x3c2c80);}};}function respondWithFilteredResult(_0x3c6deb,_0x519ed1){return function(_0x108ef4){if(_0x108ef4){var _0x1fa972=typeof _0x519ed1['offset']===_0xa96e('0x2a')&&typeof _0x519ed1[_0xa96e('0x2b')]==='undefined';var _0x9b3cb3=_0x108ef4[_0xa96e('0x2c')];var _0x249e83=_0x1fa972?0x0:_0x519ed1[_0xa96e('0x2d')];var _0x26c5f5=_0x1fa972?_0x108ef4['count']:_0x519ed1[_0xa96e('0x2d')]+_0x519ed1[_0xa96e('0x2b')];var _0x3d1646;if(_0x26c5f5>=_0x9b3cb3){_0x26c5f5=_0x9b3cb3;_0x3d1646=0xc8;}else{_0x3d1646=0xce;}_0x3c6deb['status'](_0x3d1646);return _0x3c6deb[_0xa96e('0x2e')](_0xa96e('0x2f'),_0x249e83+'-'+_0x26c5f5+'/'+_0x9b3cb3)[_0xa96e('0x30')](_0x108ef4);}return null;};}function patchUpdates(_0x4a1b49){return function(_0x4b867b){try{jsonpatch[_0xa96e('0x31')](_0x4b867b,_0x4a1b49,!![]);}catch(_0x1c815d){return BPromise[_0xa96e('0x32')](_0x1c815d);}return _0x4b867b['save']();};}function saveUpdates(_0x13b020,_0x170f8b){return function(_0x5087d0){if(_0x5087d0){return _0x5087d0[_0xa96e('0x33')](_0x13b020)[_0xa96e('0x1d')](function(_0xfcac44){return _0xfcac44;});}return null;};}function removeEntity(_0xa4b884,_0x493f4d){return function(_0x384d06){if(_0x384d06){return _0x384d06[_0xa96e('0x34')]()[_0xa96e('0x1d')](function(){_0xa4b884[_0xa96e('0x28')](0xcc)[_0xa96e('0x29')]();});}};}function handleEntityNotFound(_0x285e98,_0x5a2c56){return function(_0x32a939){if(!_0x32a939){_0x285e98[_0xa96e('0x35')](0x194);}return _0x32a939;};}function handleError(_0x434ba7,_0x18e323){_0x18e323=_0x18e323||0x1f4;return function(_0x7f9825){logger[_0xa96e('0x22')](_0x7f9825['stack']);if(_0x7f9825[_0xa96e('0x36')]){delete _0x7f9825[_0xa96e('0x36')];}_0x434ba7[_0xa96e('0x28')](_0x18e323)[_0xa96e('0x37')](_0x7f9825);};}exports[_0xa96e('0x38')]=function(_0x43f86d,_0x22f36){var _0x48253a={},_0x308a96={},_0x4f70a8={'count':0x0,'rows':[]};var _0x5847ed=_[_0xa96e('0x39')](db[_0xa96e('0x3a')][_0xa96e('0x3b')],function(_0x1ee907){return{'name':_0x1ee907['fieldName'],'type':_0x1ee907[_0xa96e('0x3c')]['key']};});_0x308a96[_0xa96e('0x3d')]=_['map'](_0x5847ed,_0xa96e('0x36'));_0x308a96['query']=_['keys'](_0x43f86d['query']);_0x308a96['filters']=_[_0xa96e('0x3e')](_0x308a96[_0xa96e('0x3d')],_0x308a96[_0xa96e('0x3f')]);_0x48253a[_0xa96e('0x40')]=_['intersection'](_0x308a96['model'],qs['fields'](_0x43f86d['query']['fields']));_0x48253a[_0xa96e('0x40')]=_0x48253a[_0xa96e('0x40')][_0xa96e('0x41')]?_0x48253a['attributes']:_0x308a96[_0xa96e('0x3d')];if(!_0x43f86d[_0xa96e('0x3f')][_0xa96e('0x42')](_0xa96e('0x43'))){_0x48253a[_0xa96e('0x2b')]=qs[_0xa96e('0x2b')](_0x43f86d[_0xa96e('0x3f')][_0xa96e('0x2b')]);_0x48253a[_0xa96e('0x2d')]=qs[_0xa96e('0x2d')](_0x43f86d['query']['offset']);}_0x48253a[_0xa96e('0x44')]=qs[_0xa96e('0x45')](_0x43f86d[_0xa96e('0x3f')][_0xa96e('0x45')]);_0x48253a[_0xa96e('0x46')]=qs[_0xa96e('0x47')](_[_0xa96e('0x48')](_0x43f86d[_0xa96e('0x3f')],_0x308a96[_0xa96e('0x47')]),_0x5847ed);if(_0x43f86d[_0xa96e('0x3f')][_0xa96e('0x49')]){_0x48253a[_0xa96e('0x46')]=_[_0xa96e('0x4a')](_0x48253a[_0xa96e('0x46')],{'$or':_['map'](_0x5847ed,function(_0x5bc63f){if(_0x5bc63f[_0xa96e('0x3c')]!==_0xa96e('0x4b')){var _0x5bdf78={};_0x5bdf78[_0x5bc63f[_0xa96e('0x36')]]={'$like':'%'+_0x43f86d[_0xa96e('0x3f')]['filter']+'%'};return _0x5bdf78;}})});}_0x48253a=_[_0xa96e('0x4a')]({},_0x48253a,_0x43f86d[_0xa96e('0x4c')]);var _0x3d8e08={'where':_0x48253a[_0xa96e('0x46')]};return db[_0xa96e('0x3a')][_0xa96e('0x2c')](_0x3d8e08)[_0xa96e('0x1d')](function(_0xd625f7){_0x4f70a8['count']=_0xd625f7;if(_0x43f86d[_0xa96e('0x3f')][_0xa96e('0x4d')]){_0x48253a[_0xa96e('0x4e')]=[{'all':!![]}];}return db[_0xa96e('0x3a')][_0xa96e('0x4f')](_0x48253a);})[_0xa96e('0x1d')](function(_0xae9d73){_0x4f70a8[_0xa96e('0x50')]=_0xae9d73;return _0x4f70a8;})['then'](respondWithFilteredResult(_0x22f36,_0x48253a))['catch'](handleError(_0x22f36,null));};exports['show']=function(_0x53d2ed,_0x5ef198){var _0x3faae9={'raw':![],'where':{'id':_0x53d2ed[_0xa96e('0x51')]['id']}},_0x3ee721={};_0x3ee721[_0xa96e('0x3d')]=_[_0xa96e('0x52')](db[_0xa96e('0x3a')]['rawAttributes']);_0x3ee721[_0xa96e('0x3f')]=_[_0xa96e('0x52')](_0x53d2ed[_0xa96e('0x3f')]);_0x3ee721[_0xa96e('0x47')]=_[_0xa96e('0x3e')](_0x3ee721[_0xa96e('0x3d')],_0x3ee721[_0xa96e('0x3f')]);_0x3faae9[_0xa96e('0x40')]=_[_0xa96e('0x3e')](_0x3ee721[_0xa96e('0x3d')],qs[_0xa96e('0x53')](_0x53d2ed[_0xa96e('0x3f')][_0xa96e('0x53')]));_0x3faae9[_0xa96e('0x40')]=_0x3faae9[_0xa96e('0x40')][_0xa96e('0x41')]?_0x3faae9[_0xa96e('0x40')]:_0x3ee721[_0xa96e('0x3d')];if(_0x53d2ed[_0xa96e('0x3f')][_0xa96e('0x4d')]){_0x3faae9[_0xa96e('0x4e')]=[{'all':!![]}];}_0x3faae9=_[_0xa96e('0x4a')]({},_0x3faae9,_0x53d2ed[_0xa96e('0x4c')]);return db['Setting'][_0xa96e('0x54')](_0x3faae9)[_0xa96e('0x1d')](handleEntityNotFound(_0x5ef198,null))[_0xa96e('0x1d')](respondWithResult(_0x5ef198,null))[_0xa96e('0x27')](handleError(_0x5ef198,null));};exports['update']=function(_0x1a478c,_0x16cf2a){if(_0x1a478c[_0xa96e('0x55')]['id']){delete _0x1a478c[_0xa96e('0x55')]['id'];}return db['Setting'][_0xa96e('0x54')]({'where':{'id':_0x1a478c[_0xa96e('0x51')]['id']}})[_0xa96e('0x1d')](handleEntityNotFound(_0x16cf2a,null))[_0xa96e('0x1d')](saveUpdates(_0x1a478c[_0xa96e('0x55')],null))[_0xa96e('0x1d')](respondWithResult(_0x16cf2a,null))['catch'](handleError(_0x16cf2a,null));};exports[_0xa96e('0x56')]=function(_0x1cd5c2,_0x1e3f98,_0x184ad0){if(_0x1cd5c2['file']&&_0x1cd5c2['file'][_0xa96e('0x57')]){_0x1cd5c2[_0xa96e('0x55')][_0xa96e('0x58')]=_0x1cd5c2['file'][_0xa96e('0x57')];}return db['Setting']['find']({'where':{'id':_0x1cd5c2[_0xa96e('0x51')]['id']}})[_0xa96e('0x1d')](handleEntityNotFound(_0x1e3f98,null))[_0xa96e('0x1d')](saveUpdates(_0x1cd5c2[_0xa96e('0x55')],null))[_0xa96e('0x1d')](respondWithResult(_0x1e3f98,null))[_0xa96e('0x27')](handleError(_0x1e3f98,null));};exports[_0xa96e('0x59')]=function(_0x153da1,_0x53c4c4,_0x1934a3){if(_0x153da1[_0xa96e('0x5a')]&&_0x153da1[_0xa96e('0x5a')]['filename']){_0x153da1[_0xa96e('0x55')][_0xa96e('0x5b')]=_0x153da1['file'][_0xa96e('0x57')];}return db[_0xa96e('0x3a')]['find']({'where':{'id':_0x153da1[_0xa96e('0x51')]['id']}})['then'](handleEntityNotFound(_0x53c4c4,null))['then'](saveUpdates(_0x153da1[_0xa96e('0x55')],null))[_0xa96e('0x1d')](respondWithResult(_0x53c4c4,null))[_0xa96e('0x27')](handleError(_0x53c4c4,null));};var utilLicense=require(_0xa96e('0x19'));exports[_0xa96e('0x5c')]=function(_0x1ad947,_0x463b31,_0x2d2190){var _0x168a0e=_0xa96e('0x5d');var _0x254a3d={'custom':![]};return utilLicense[_0xa96e('0x5e')]()[_0xa96e('0x1d')](function(_0x4e5bab){if(_0x4e5bab){_0x254a3d=_0x4e5bab;}return db['Setting']['find']({'where':{'id':_0x1ad947['params']['id']},'attributes':[_0xa96e('0x58'),_0xa96e('0x5b'),_0xa96e('0x5f'),'favicon',_0xa96e('0x60'),_0xa96e('0x61'),'defaultPreferred',_0xa96e('0x62')],'raw':!![]});})[_0xa96e('0x1d')](handleEntityNotFound(_0x463b31,null))[_0xa96e('0x1d')](function(_0x45596d){if(_0x45596d){var _0x3cda40=_0x45596d['logo']&&fs['existsSync'](path['join'](config['root'],_0x168a0e,_[_0xa96e('0x63')](_0x45596d[_0xa96e('0x58')])))?path[_0xa96e('0x64')](config['root'],_0x168a0e,_[_0xa96e('0x63')](_0x45596d[_0xa96e('0x58')])):path['join'](config[_0xa96e('0x65')],_0x168a0e,_[_0xa96e('0x63')](_0xa96e('0x66')));var _0x37beee=_0xa96e('0x67')+_[_0xa96e('0x68')](_0xa96e('0x58'));if(_0x45596d[_0x37beee]||!_0x254a3d[_0xa96e('0x69')]){_0x3cda40=path[_0xa96e('0x64')](config[_0xa96e('0x65')],_0x168a0e,_['toLower'](_0xa96e('0x66')));}if(!fs[_0xa96e('0x6a')](_0x3cda40)){throw new db['Sequelize'][(_0xa96e('0x6b'))](_[_0xa96e('0x68')](_0xa96e('0x58'))+_0xa96e('0x6c'));}return _0x463b31[_0xa96e('0x6d')](_0x3cda40);}})[_0xa96e('0x27')](handleError(_0x463b31,null));};var utilLicense=require(_0xa96e('0x19'));exports[_0xa96e('0x6e')]=function(_0x5c80de,_0x19983b,_0x141e15){var _0x538282=_0xa96e('0x5d');var _0x5a3fe7={'custom':![]};return utilLicense[_0xa96e('0x5e')]()[_0xa96e('0x1d')](function(_0x419c64){if(_0x419c64){_0x5a3fe7=_0x419c64;}return db[_0xa96e('0x3a')][_0xa96e('0x54')]({'where':{'id':_0x5c80de[_0xa96e('0x51')]['id']},'attributes':[_0xa96e('0x58'),_0xa96e('0x5b'),'preferred','favicon','defaultLogo','defaultLoginLogo',_0xa96e('0x6f'),_0xa96e('0x62')],'raw':!![]});})[_0xa96e('0x1d')](handleEntityNotFound(_0x19983b,null))[_0xa96e('0x1d')](function(_0x503c99){if(_0x503c99){var _0x1679f4=_0x503c99[_0xa96e('0x5b')]&&fs[_0xa96e('0x6a')](path[_0xa96e('0x64')](config[_0xa96e('0x65')],_0x538282,_[_0xa96e('0x63')](_0x503c99['loginLogo'])))?path['join'](config[_0xa96e('0x65')],_0x538282,_[_0xa96e('0x63')](_0x503c99[_0xa96e('0x5b')])):path[_0xa96e('0x64')](config['root'],_0x538282,_[_0xa96e('0x63')](_0xa96e('0x70')));var _0x1cc847=_0xa96e('0x67')+_['upperFirst']('loginLogo');if(_0x503c99[_0x1cc847]||!_0x5a3fe7[_0xa96e('0x69')]){_0x1679f4=path['join'](config[_0xa96e('0x65')],_0x538282,_[_0xa96e('0x63')](_0xa96e('0x70')));}if(!fs[_0xa96e('0x6a')](_0x1679f4)){throw new db[(_0xa96e('0x71'))]['ValidationError'](_[_0xa96e('0x68')]('loginLogo')+_0xa96e('0x6c'));}return _0x19983b[_0xa96e('0x6d')](_0x1679f4);}})['catch'](handleError(_0x19983b,null));};exports['gdpr']=function(_0x3148e2,_0x41a24d){return db[_0xa96e('0x3a')][_0xa96e('0x54')]({'where':{'id':_0x3148e2[_0xa96e('0x51')]['id']},'attributes':[_0xa96e('0x72')]})[_0xa96e('0x1d')](respondWithResult(_0x41a24d,null))[_0xa96e('0x27')](handleError(_0x41a24d,null));};exports[_0xa96e('0x73')]=function(_0x2fa278,_0xd22434,_0x36e717){if(_0x2fa278[_0xa96e('0x5a')]&&_0x2fa278[_0xa96e('0x5a')][_0xa96e('0x57')]){_0x2fa278['body'][_0xa96e('0x5f')]=_0x2fa278['file'][_0xa96e('0x57')];}return db[_0xa96e('0x3a')][_0xa96e('0x54')]({'where':{'id':_0x2fa278[_0xa96e('0x51')]['id']}})[_0xa96e('0x1d')](handleEntityNotFound(_0xd22434,null))[_0xa96e('0x1d')](saveUpdates(_0x2fa278[_0xa96e('0x55')],null))[_0xa96e('0x1d')](respondWithResult(_0xd22434,null))[_0xa96e('0x27')](handleError(_0xd22434,null));};var utilLicense=require('../../config/license/util');exports[_0xa96e('0x74')]=function(_0x1e327c,_0x393029,_0x53b904){var _0x2e9d8e=_0xa96e('0x5d');var _0x400f98={'custom':![]};return utilLicense[_0xa96e('0x5e')]()[_0xa96e('0x1d')](function(_0xfc6e46){if(_0xfc6e46){_0x400f98=_0xfc6e46;}return db[_0xa96e('0x3a')][_0xa96e('0x54')]({'where':{'id':_0x1e327c[_0xa96e('0x51')]['id']},'attributes':[_0xa96e('0x58'),_0xa96e('0x5b'),_0xa96e('0x5f'),_0xa96e('0x75'),_0xa96e('0x60'),'defaultLoginLogo',_0xa96e('0x6f'),_0xa96e('0x62')],'raw':!![]});})[_0xa96e('0x1d')](handleEntityNotFound(_0x393029,null))[_0xa96e('0x1d')](function(_0x3b5588){if(_0x3b5588){var _0x29c8b8=_0x3b5588[_0xa96e('0x5f')]&&fs[_0xa96e('0x6a')](path[_0xa96e('0x64')](config['root'],_0x2e9d8e,_[_0xa96e('0x63')](_0x3b5588[_0xa96e('0x5f')])))?path[_0xa96e('0x64')](config['root'],_0x2e9d8e,_['toLower'](_0x3b5588[_0xa96e('0x5f')])):path['join'](config[_0xa96e('0x65')],_0x2e9d8e,_[_0xa96e('0x63')](_0xa96e('0x76')));var _0x1ac5e4=_0xa96e('0x67')+_[_0xa96e('0x68')]('preferred');if(_0x3b5588[_0x1ac5e4]||!_0x400f98[_0xa96e('0x69')]||!_0x400f98[_0xa96e('0x5f')]){_0x29c8b8=path['join'](config['root'],_0x2e9d8e,_['toLower'](_0xa96e('0x76')));}if(!fs[_0xa96e('0x6a')](_0x29c8b8)){throw new db['Sequelize'][(_0xa96e('0x6b'))](_[_0xa96e('0x68')]('preferred')+_0xa96e('0x6c'));}return _0x393029['download'](_0x29c8b8);}})[_0xa96e('0x27')](handleError(_0x393029,null));};exports[_0xa96e('0x77')]=function(_0x2827e1,_0x5b9a42,_0x157f0a){if(_0x2827e1[_0xa96e('0x5a')]&&_0x2827e1['file'][_0xa96e('0x57')]){_0x2827e1['body'][_0xa96e('0x75')]=_0x2827e1[_0xa96e('0x5a')]['filename'];}return db[_0xa96e('0x3a')][_0xa96e('0x54')]({'where':{'id':_0x2827e1[_0xa96e('0x51')]['id']}})[_0xa96e('0x1d')](handleEntityNotFound(_0x5b9a42,null))['then'](saveUpdates(_0x2827e1[_0xa96e('0x55')],null))[_0xa96e('0x1d')](respondWithResult(_0x5b9a42,null))['catch'](handleError(_0x5b9a42,null));};var utilLicense=require(_0xa96e('0x19'));exports[_0xa96e('0x78')]=function(_0x193c34,_0x4ae87c,_0x259c3e){var _0x4a28c9=_0xa96e('0x5d');var _0x7be4d={'custom':![]};return utilLicense[_0xa96e('0x5e')]()[_0xa96e('0x1d')](function(_0x494b85){if(_0x494b85){_0x7be4d=_0x494b85;}return db['Setting'][_0xa96e('0x54')]({'where':{'id':_0x193c34['params']['id']},'attributes':[_0xa96e('0x58'),_0xa96e('0x5b'),'preferred',_0xa96e('0x75'),'defaultLogo',_0xa96e('0x61'),_0xa96e('0x6f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4ae87c,null))['then'](function(_0x4d1813){if(_0x4d1813){var _0x2d43df=_0x4d1813[_0xa96e('0x75')]&&fs[_0xa96e('0x6a')](path[_0xa96e('0x64')](config[_0xa96e('0x65')],_0x4a28c9,_['toLower'](_0x4d1813[_0xa96e('0x75')])))?path[_0xa96e('0x64')](config[_0xa96e('0x65')],_0x4a28c9,_[_0xa96e('0x63')](_0x4d1813[_0xa96e('0x75')])):path[_0xa96e('0x64')](config[_0xa96e('0x65')],_0x4a28c9,_[_0xa96e('0x63')](_0xa96e('0x79')));var _0x5b1293=_0xa96e('0x67')+_[_0xa96e('0x68')](_0xa96e('0x75'));if(_0x4d1813[_0x5b1293]||!_0x7be4d[_0xa96e('0x69')]){_0x2d43df=path[_0xa96e('0x64')](config[_0xa96e('0x65')],_0x4a28c9,_[_0xa96e('0x63')](_0xa96e('0x79')));}if(!fs[_0xa96e('0x6a')](_0x2d43df)){throw new db['Sequelize'][(_0xa96e('0x6b'))](_[_0xa96e('0x68')](_0xa96e('0x75'))+'\x20not\x20found');}return _0x4ae87c[_0xa96e('0x6d')](_0x2d43df);}})[_0xa96e('0x27')](handleError(_0x4ae87c,null));};exports['getDate']=function(_0x2061cf,_0x206246){var _0x54e18e={'offset':moment()[_0xa96e('0x7a')]()};_0x54e18e[_0xa96e('0x7b')]=moment()[_0xa96e('0x7a')](_0x54e18e[_0xa96e('0x2d')])[_0xa96e('0x7c')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x206246[_0xa96e('0x28')](0xc8)[_0xa96e('0x37')](_0x54e18e);}; \ No newline at end of file +var _0x3087=['../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','update','body','params','addLogo','file','filename','getLogo','getLicense','logo','loginLogo','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred','favicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','Sequelize','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x3087,0xe5));var _0x7308=function(_0x49189f,_0x4aae03){_0x49189f=_0x49189f-0x0;var _0x1ebf9e=_0x3087[_0x49189f];return _0x1ebf9e;};'use strict';var emlformat=require(_0x7308('0x0'));var rimraf=require(_0x7308('0x1'));var zipdir=require(_0x7308('0x2'));var jsonpatch=require(_0x7308('0x3'));var rp=require(_0x7308('0x4'));var moment=require(_0x7308('0x5'));var BPromise=require(_0x7308('0x6'));var Mustache=require(_0x7308('0x7'));var util=require(_0x7308('0x8'));var path=require(_0x7308('0x9'));var sox=require(_0x7308('0xa'));var csv=require(_0x7308('0xb'));var ejs=require(_0x7308('0xc'));var fs=require('fs');var fs_extra=require(_0x7308('0xd'));var _=require(_0x7308('0xe'));var squel=require(_0x7308('0xf'));var crypto=require(_0x7308('0x10'));var jsforce=require(_0x7308('0x11'));var deskjs=require(_0x7308('0x12'));var toCsv=require(_0x7308('0xb'));var querystring=require('querystring');var Papa=require(_0x7308('0x13'));var Redis=require(_0x7308('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7308('0x15'));var hardwareService=require(_0x7308('0x16'));var logger=require(_0x7308('0x17'))(_0x7308('0x18'));var utils=require(_0x7308('0x19'));var config=require(_0x7308('0x1a'));var licenseUtil=require(_0x7308('0x1b'));var db=require(_0x7308('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7308('0x1d')][_0x7308('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4ee2bd,_0x1ac523,_0x16ddd7,_0x2afdce){return new BPromise(function(_0x431519,_0x189743){var _0x10c635=_0x2afdce||client;return _0x10c635[_0x7308('0x1f')](_0x4ee2bd,_0x16ddd7)[_0x7308('0x20')](function(_0x58c9c4){logger[_0x7308('0x21')](_0x7308('0x22'),_0x1ac523,_0x7308('0x23'));logger[_0x7308('0x24')](_0x7308('0x25'),_0x1ac523,_0x7308('0x23'),JSON[_0x7308('0x26')](_0x58c9c4));if(_0x58c9c4[_0x7308('0x27')]){if(_0x58c9c4[_0x7308('0x27')]['code']===0x1f4){logger['error'](_0x7308('0x22'),_0x1ac523,_0x58c9c4[_0x7308('0x27')][_0x7308('0x28')]);return _0x189743(_0x58c9c4[_0x7308('0x27')][_0x7308('0x28')]);}logger[_0x7308('0x27')](_0x7308('0x22'),_0x1ac523,_0x58c9c4['error']['message']);return _0x431519(_0x58c9c4[_0x7308('0x27')][_0x7308('0x28')]);}else{logger[_0x7308('0x21')](_0x7308('0x22'),_0x1ac523,'request\x20sent');_0x431519(_0x58c9c4[_0x7308('0x29')][_0x7308('0x28')]);}})[_0x7308('0x2a')](function(_0x654b62){logger['error'](_0x7308('0x22'),_0x1ac523,_0x654b62);_0x189743(_0x654b62);});});}function respondWithStatusCode(_0x30e408,_0x2fe152){_0x2fe152=_0x2fe152||0xcc;return function(_0x17d2ea){if(_0x17d2ea){return _0x30e408[_0x7308('0x2b')](_0x2fe152);}return _0x30e408[_0x7308('0x2c')](_0x2fe152)['end']();};}function respondWithResult(_0x46e7b0,_0x3e2ac6){_0x3e2ac6=_0x3e2ac6||0xc8;return function(_0x48624a){if(_0x48624a){return _0x46e7b0[_0x7308('0x2c')](_0x3e2ac6)[_0x7308('0x2d')](_0x48624a);}};}function respondWithFilteredResult(_0x4b51b9,_0x58f8d2){return function(_0x5b461a){if(_0x5b461a){var _0x215c1c=typeof _0x58f8d2[_0x7308('0x2e')]===_0x7308('0x2f')&&typeof _0x58f8d2[_0x7308('0x30')]===_0x7308('0x2f');var _0x5676bf=_0x5b461a[_0x7308('0x31')];var _0x2dfad0=_0x215c1c?0x0:_0x58f8d2[_0x7308('0x2e')];var _0x560438=_0x215c1c?_0x5b461a[_0x7308('0x31')]:_0x58f8d2[_0x7308('0x2e')]+_0x58f8d2[_0x7308('0x30')];var _0x49fd59;if(_0x560438>=_0x5676bf){_0x560438=_0x5676bf;_0x49fd59=0xc8;}else{_0x49fd59=0xce;}_0x4b51b9[_0x7308('0x2c')](_0x49fd59);return _0x4b51b9[_0x7308('0x32')]('Content-Range',_0x2dfad0+'-'+_0x560438+'/'+_0x5676bf)[_0x7308('0x2d')](_0x5b461a);}return null;};}function patchUpdates(_0xaf2be5){return function(_0x442e77){try{jsonpatch[_0x7308('0x33')](_0x442e77,_0xaf2be5,!![]);}catch(_0x1ce78c){return BPromise[_0x7308('0x34')](_0x1ce78c);}return _0x442e77[_0x7308('0x35')]();};}function saveUpdates(_0x53118e,_0x2c062f){return function(_0xc2a88){if(_0xc2a88){return _0xc2a88['update'](_0x53118e)['then'](function(_0xd3e5e2){return _0xd3e5e2;});}return null;};}function removeEntity(_0xfbfd4e,_0x1f6cf7){return function(_0x144498){if(_0x144498){return _0x144498[_0x7308('0x36')]()['then'](function(){_0xfbfd4e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x205b20,_0x712303){return function(_0x340396){if(!_0x340396){_0x205b20[_0x7308('0x2b')](0x194);}return _0x340396;};}function handleError(_0xc3a295,_0x5d841a){_0x5d841a=_0x5d841a||0x1f4;return function(_0x409246){logger['error'](_0x409246[_0x7308('0x37')]);if(_0x409246[_0x7308('0x38')]){delete _0x409246[_0x7308('0x38')];}_0xc3a295[_0x7308('0x2c')](_0x5d841a)[_0x7308('0x39')](_0x409246);};}exports[_0x7308('0x3a')]=function(_0x4507ad,_0x277343){var _0x303ee2={},_0x2cb76a={},_0x48f2f4={'count':0x0,'rows':[]};var _0x2ac258=_[_0x7308('0x3b')](db[_0x7308('0x3c')][_0x7308('0x3d')],function(_0x12041a){return{'name':_0x12041a[_0x7308('0x3e')],'type':_0x12041a['type'][_0x7308('0x3f')]};});_0x2cb76a['model']=_[_0x7308('0x3b')](_0x2ac258,'name');_0x2cb76a['query']=_['keys'](_0x4507ad['query']);_0x2cb76a[_0x7308('0x40')]=_[_0x7308('0x41')](_0x2cb76a[_0x7308('0x42')],_0x2cb76a['query']);_0x303ee2[_0x7308('0x43')]=_[_0x7308('0x41')](_0x2cb76a['model'],qs[_0x7308('0x44')](_0x4507ad[_0x7308('0x45')]['fields']));_0x303ee2['attributes']=_0x303ee2[_0x7308('0x43')][_0x7308('0x46')]?_0x303ee2[_0x7308('0x43')]:_0x2cb76a[_0x7308('0x42')];if(!_0x4507ad[_0x7308('0x45')][_0x7308('0x47')](_0x7308('0x48'))){_0x303ee2[_0x7308('0x30')]=qs[_0x7308('0x30')](_0x4507ad['query']['limit']);_0x303ee2[_0x7308('0x2e')]=qs[_0x7308('0x2e')](_0x4507ad[_0x7308('0x45')][_0x7308('0x2e')]);}_0x303ee2[_0x7308('0x49')]=qs['sort'](_0x4507ad['query'][_0x7308('0x4a')]);_0x303ee2[_0x7308('0x4b')]=qs[_0x7308('0x40')](_[_0x7308('0x4c')](_0x4507ad[_0x7308('0x45')],_0x2cb76a[_0x7308('0x40')]),_0x2ac258);if(_0x4507ad[_0x7308('0x45')][_0x7308('0x4d')]){_0x303ee2[_0x7308('0x4b')]=_[_0x7308('0x4e')](_0x303ee2['where'],{'$or':_[_0x7308('0x3b')](_0x2ac258,function(_0x564da7){if(_0x564da7['type']!==_0x7308('0x4f')){var _0x4acfc4={};_0x4acfc4[_0x564da7[_0x7308('0x38')]]={'$like':'%'+_0x4507ad[_0x7308('0x45')][_0x7308('0x4d')]+'%'};return _0x4acfc4;}})});}_0x303ee2=_[_0x7308('0x4e')]({},_0x303ee2,_0x4507ad[_0x7308('0x50')]);var _0x16bfd2={'where':_0x303ee2[_0x7308('0x4b')]};return db[_0x7308('0x3c')]['count'](_0x16bfd2)[_0x7308('0x20')](function(_0x146ada){_0x48f2f4[_0x7308('0x31')]=_0x146ada;if(_0x4507ad[_0x7308('0x45')][_0x7308('0x51')]){_0x303ee2[_0x7308('0x52')]=[{'all':!![]}];}return db[_0x7308('0x3c')]['findAll'](_0x303ee2);})['then'](function(_0x3c1046){_0x48f2f4[_0x7308('0x53')]=_0x3c1046;return _0x48f2f4;})[_0x7308('0x20')](respondWithFilteredResult(_0x277343,_0x303ee2))[_0x7308('0x2a')](handleError(_0x277343,null));};exports[_0x7308('0x54')]=function(_0x35c64b,_0x4de3fb){var _0x36c285={'raw':![],'where':{'id':_0x35c64b['params']['id']}},_0x47611b={};_0x47611b['model']=_['keys'](db[_0x7308('0x3c')][_0x7308('0x3d')]);_0x47611b[_0x7308('0x45')]=_[_0x7308('0x55')](_0x35c64b[_0x7308('0x45')]);_0x47611b[_0x7308('0x40')]=_[_0x7308('0x41')](_0x47611b['model'],_0x47611b[_0x7308('0x45')]);_0x36c285[_0x7308('0x43')]=_[_0x7308('0x41')](_0x47611b[_0x7308('0x42')],qs[_0x7308('0x44')](_0x35c64b['query'][_0x7308('0x44')]));_0x36c285[_0x7308('0x43')]=_0x36c285['attributes']['length']?_0x36c285['attributes']:_0x47611b[_0x7308('0x42')];if(_0x35c64b['query'][_0x7308('0x51')]){_0x36c285[_0x7308('0x52')]=[{'all':!![]}];}_0x36c285=_[_0x7308('0x4e')]({},_0x36c285,_0x35c64b[_0x7308('0x50')]);return db[_0x7308('0x3c')][_0x7308('0x56')](_0x36c285)[_0x7308('0x20')](handleEntityNotFound(_0x4de3fb,null))[_0x7308('0x20')](respondWithResult(_0x4de3fb,null))[_0x7308('0x2a')](handleError(_0x4de3fb,null));};exports[_0x7308('0x57')]=function(_0x445c47,_0x216b88){if(_0x445c47[_0x7308('0x58')]['id']){delete _0x445c47[_0x7308('0x58')]['id'];}return db['Setting'][_0x7308('0x56')]({'where':{'id':_0x445c47[_0x7308('0x59')]['id']}})[_0x7308('0x20')](handleEntityNotFound(_0x216b88,null))[_0x7308('0x20')](saveUpdates(_0x445c47[_0x7308('0x58')],null))[_0x7308('0x20')](respondWithResult(_0x216b88,null))['catch'](handleError(_0x216b88,null));};exports[_0x7308('0x5a')]=function(_0xd65067,_0x2784b9,_0x5d2176){if(_0xd65067[_0x7308('0x5b')]&&_0xd65067[_0x7308('0x5b')][_0x7308('0x5c')]){_0xd65067[_0x7308('0x58')]['logo']=_0xd65067['file'][_0x7308('0x5c')];}return db[_0x7308('0x3c')][_0x7308('0x56')]({'where':{'id':_0xd65067[_0x7308('0x59')]['id']}})['then'](handleEntityNotFound(_0x2784b9,null))[_0x7308('0x20')](saveUpdates(_0xd65067[_0x7308('0x58')],null))[_0x7308('0x20')](respondWithResult(_0x2784b9,null))[_0x7308('0x2a')](handleError(_0x2784b9,null));};exports['addLogoLogin']=function(_0x30ac67,_0x57ba80,_0x372fdc){if(_0x30ac67[_0x7308('0x5b')]&&_0x30ac67['file'][_0x7308('0x5c')]){_0x30ac67[_0x7308('0x58')]['loginLogo']=_0x30ac67[_0x7308('0x5b')][_0x7308('0x5c')];}return db[_0x7308('0x3c')]['find']({'where':{'id':_0x30ac67[_0x7308('0x59')]['id']}})[_0x7308('0x20')](handleEntityNotFound(_0x57ba80,null))[_0x7308('0x20')](saveUpdates(_0x30ac67[_0x7308('0x58')],null))[_0x7308('0x20')](respondWithResult(_0x57ba80,null))[_0x7308('0x2a')](handleError(_0x57ba80,null));};var utilLicense=require('../../config/license/util');exports[_0x7308('0x5d')]=function(_0x49e560,_0x9dec80,_0x2173bc){var _0x26b15e='server/files/images/logos';var _0x2743cd={'custom':![]};return utilLicense[_0x7308('0x5e')]()[_0x7308('0x20')](function(_0x40c341){if(_0x40c341){_0x2743cd=_0x40c341;}return db[_0x7308('0x3c')][_0x7308('0x56')]({'where':{'id':_0x49e560[_0x7308('0x59')]['id']},'attributes':[_0x7308('0x5f'),_0x7308('0x60'),'preferred','favicon',_0x7308('0x61'),_0x7308('0x62'),_0x7308('0x63'),_0x7308('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x9dec80,null))['then'](function(_0x27a2c6){if(_0x27a2c6){var _0x22460b=_0x27a2c6[_0x7308('0x5f')]&&fs[_0x7308('0x65')](path[_0x7308('0x66')](config[_0x7308('0x67')],_0x26b15e,_[_0x7308('0x68')](_0x27a2c6[_0x7308('0x5f')])))?path[_0x7308('0x66')](config['root'],_0x26b15e,_[_0x7308('0x68')](_0x27a2c6[_0x7308('0x5f')])):path['join'](config[_0x7308('0x67')],_0x26b15e,_['toLower'](_0x7308('0x69')));var _0xe06ee4=_0x7308('0x6a')+_['upperFirst'](_0x7308('0x5f'));if(_0x27a2c6[_0xe06ee4]||!_0x2743cd[_0x7308('0x6b')]){_0x22460b=path[_0x7308('0x66')](config[_0x7308('0x67')],_0x26b15e,_[_0x7308('0x68')](_0x7308('0x69')));}if(!fs['existsSync'](_0x22460b)){throw new db['Sequelize'][(_0x7308('0x6c'))](_[_0x7308('0x6d')](_0x7308('0x5f'))+_0x7308('0x6e'));}return _0x9dec80[_0x7308('0x6f')](_0x22460b);}})[_0x7308('0x2a')](handleError(_0x9dec80,null));};var utilLicense=require(_0x7308('0x1b'));exports[_0x7308('0x70')]=function(_0x1fad55,_0x2314f4,_0x86ccc4){var _0x44e6e9=_0x7308('0x71');var _0x34f7ff={'custom':![]};return utilLicense[_0x7308('0x5e')]()[_0x7308('0x20')](function(_0x303a5d){if(_0x303a5d){_0x34f7ff=_0x303a5d;}return db[_0x7308('0x3c')][_0x7308('0x56')]({'where':{'id':_0x1fad55[_0x7308('0x59')]['id']},'attributes':[_0x7308('0x5f'),_0x7308('0x60'),_0x7308('0x72'),_0x7308('0x73'),'defaultLogo','defaultLoginLogo',_0x7308('0x63'),_0x7308('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x2314f4,null))[_0x7308('0x20')](function(_0x59db0a){if(_0x59db0a){var _0x184d42=_0x59db0a[_0x7308('0x60')]&&fs[_0x7308('0x65')](path['join'](config[_0x7308('0x67')],_0x44e6e9,_['toLower'](_0x59db0a[_0x7308('0x60')])))?path['join'](config[_0x7308('0x67')],_0x44e6e9,_[_0x7308('0x68')](_0x59db0a[_0x7308('0x60')])):path[_0x7308('0x66')](config[_0x7308('0x67')],_0x44e6e9,_[_0x7308('0x68')](_0x7308('0x74')));var _0xaf6fc9='default'+_[_0x7308('0x6d')]('loginLogo');if(_0x59db0a[_0xaf6fc9]||!_0x34f7ff['custom']){_0x184d42=path[_0x7308('0x66')](config[_0x7308('0x67')],_0x44e6e9,_[_0x7308('0x68')](_0x7308('0x74')));}if(!fs[_0x7308('0x65')](_0x184d42)){throw new db['Sequelize'][(_0x7308('0x6c'))](_[_0x7308('0x6d')]('loginLogo')+'\x20not\x20found');}return _0x2314f4[_0x7308('0x6f')](_0x184d42);}})[_0x7308('0x2a')](handleError(_0x2314f4,null));};exports[_0x7308('0x75')]=function(_0x1eb02d,_0x31bea8){return db[_0x7308('0x3c')][_0x7308('0x56')]({'where':{'id':_0x1eb02d[_0x7308('0x59')]['id']},'attributes':[_0x7308('0x76')]})['then'](respondWithResult(_0x31bea8,null))[_0x7308('0x2a')](handleError(_0x31bea8,null));};exports[_0x7308('0x77')]=function(_0x2bbef6,_0x2fc1d2,_0x56ae5b){if(_0x2bbef6[_0x7308('0x5b')]&&_0x2bbef6[_0x7308('0x5b')][_0x7308('0x5c')]){_0x2bbef6[_0x7308('0x58')]['preferred']=_0x2bbef6[_0x7308('0x5b')][_0x7308('0x5c')];}return db[_0x7308('0x3c')][_0x7308('0x56')]({'where':{'id':_0x2bbef6[_0x7308('0x59')]['id']}})[_0x7308('0x20')](handleEntityNotFound(_0x2fc1d2,null))[_0x7308('0x20')](saveUpdates(_0x2bbef6['body'],null))[_0x7308('0x20')](respondWithResult(_0x2fc1d2,null))['catch'](handleError(_0x2fc1d2,null));};var utilLicense=require('../../config/license/util');exports[_0x7308('0x78')]=function(_0x1cb138,_0x3884f4,_0x57959a){var _0x42a6aa='server/files/images/logos';var _0x413f3e={'custom':![]};return utilLicense['getLicense']()[_0x7308('0x20')](function(_0x12c895){if(_0x12c895){_0x413f3e=_0x12c895;}return db['Setting']['find']({'where':{'id':_0x1cb138[_0x7308('0x59')]['id']},'attributes':[_0x7308('0x5f'),_0x7308('0x60'),_0x7308('0x72'),_0x7308('0x73'),_0x7308('0x61'),'defaultLoginLogo',_0x7308('0x63'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3884f4,null))['then'](function(_0x58f453){if(_0x58f453){var _0x22e6ca=_0x58f453['preferred']&&fs['existsSync'](path['join'](config[_0x7308('0x67')],_0x42a6aa,_[_0x7308('0x68')](_0x58f453[_0x7308('0x72')])))?path[_0x7308('0x66')](config['root'],_0x42a6aa,_[_0x7308('0x68')](_0x58f453['preferred'])):path[_0x7308('0x66')](config['root'],_0x42a6aa,_['toLower']('default_preferred.png'));var _0x34452a=_0x7308('0x6a')+_['upperFirst'](_0x7308('0x72'));if(_0x58f453[_0x34452a]||!_0x413f3e[_0x7308('0x6b')]||!_0x413f3e[_0x7308('0x72')]){_0x22e6ca=path[_0x7308('0x66')](config['root'],_0x42a6aa,_['toLower']('default_preferred.png'));}if(!fs[_0x7308('0x65')](_0x22e6ca)){throw new db[(_0x7308('0x79'))][(_0x7308('0x6c'))](_['upperFirst'](_0x7308('0x72'))+'\x20not\x20found');}return _0x3884f4['download'](_0x22e6ca);}})[_0x7308('0x2a')](handleError(_0x3884f4,null));};exports[_0x7308('0x7a')]=function(_0xfde8e3,_0x7fa53f,_0x8c72d7){if(_0xfde8e3[_0x7308('0x5b')]&&_0xfde8e3[_0x7308('0x5b')][_0x7308('0x5c')]){_0xfde8e3['body'][_0x7308('0x73')]=_0xfde8e3[_0x7308('0x5b')]['filename'];}return db['Setting'][_0x7308('0x56')]({'where':{'id':_0xfde8e3[_0x7308('0x59')]['id']}})[_0x7308('0x20')](handleEntityNotFound(_0x7fa53f,null))[_0x7308('0x20')](saveUpdates(_0xfde8e3[_0x7308('0x58')],null))['then'](respondWithResult(_0x7fa53f,null))['catch'](handleError(_0x7fa53f,null));};var utilLicense=require(_0x7308('0x1b'));exports[_0x7308('0x7b')]=function(_0x5e62c0,_0x239b45,_0x483420){var _0x571468=_0x7308('0x71');var _0x240727={'custom':![]};return utilLicense[_0x7308('0x5e')]()[_0x7308('0x20')](function(_0x1016ba){if(_0x1016ba){_0x240727=_0x1016ba;}return db[_0x7308('0x3c')][_0x7308('0x56')]({'where':{'id':_0x5e62c0[_0x7308('0x59')]['id']},'attributes':['logo',_0x7308('0x60'),_0x7308('0x72'),_0x7308('0x73'),_0x7308('0x61'),'defaultLoginLogo',_0x7308('0x63'),_0x7308('0x64')],'raw':!![]});})[_0x7308('0x20')](handleEntityNotFound(_0x239b45,null))[_0x7308('0x20')](function(_0x11bac2){if(_0x11bac2){var _0x48130e=_0x11bac2['favicon']&&fs[_0x7308('0x65')](path[_0x7308('0x66')](config[_0x7308('0x67')],_0x571468,_['toLower'](_0x11bac2[_0x7308('0x73')])))?path[_0x7308('0x66')](config[_0x7308('0x67')],_0x571468,_[_0x7308('0x68')](_0x11bac2[_0x7308('0x73')])):path[_0x7308('0x66')](config['root'],_0x571468,_['toLower'](_0x7308('0x7c')));var _0x37fc01='default'+_[_0x7308('0x6d')](_0x7308('0x73'));if(_0x11bac2[_0x37fc01]||!_0x240727[_0x7308('0x6b')]){_0x48130e=path[_0x7308('0x66')](config[_0x7308('0x67')],_0x571468,_['toLower'](_0x7308('0x7c')));}if(!fs['existsSync'](_0x48130e)){throw new db[(_0x7308('0x79'))]['ValidationError'](_[_0x7308('0x6d')](_0x7308('0x73'))+_0x7308('0x6e'));}return _0x239b45['download'](_0x48130e);}})[_0x7308('0x2a')](handleError(_0x239b45,null));};exports['getDate']=function(_0xbbeda8,_0x1e071b){var _0x29785f={'offset':moment()[_0x7308('0x7d')]()};_0x29785f[_0x7308('0x7e')]=moment()[_0x7308('0x7d')](_0x29785f[_0x7308('0x2e')])['format'](_0x7308('0x7f'));return _0x1e071b[_0x7308('0x2c')](0xc8)[_0x7308('0x39')](_0x29785f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 012392c..60004c3 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x55ca,0x126));var _0xa55c=function(_0x58cf07,_0x2e3858){_0x58cf07=_0x58cf07-0x0;var _0x42afe0=_0x55ca[_0x58cf07];return _0x42afe0;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x1dec9c,_0x11023c){var _0x36afd8=function(_0x12eee8){while(--_0x12eee8){_0x1dec9c['push'](_0x1dec9c['shift']());}};_0x36afd8(++_0x11023c);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b792b,_0x57289f){_0x4b792b=_0x4b792b-0x0;var _0x5a33c1=_0xedd9[_0x4b792b];return _0x5a33c1;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'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 001dd9e..513efb0 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 _0x8e40=['message','result','catch','ShowSetting','find','options','raw','attributes','include','map','model','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e40,0xa1));var _0x08e4=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x8e40[_0xf10840];return _0x1fdf7e;};'use strict';var _=require(_0x08e4('0x0'));var util=require(_0x08e4('0x1'));var moment=require(_0x08e4('0x2'));var BPromise=require('bluebird');var rs=require(_0x08e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x08e4('0x4'))(_0x08e4('0x5'));var config=require(_0x08e4('0x6'));var jayson=require(_0x08e4('0x7'));var client=jayson[_0x08e4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ba50d,_0x4c0bb6,_0x5edc70){return new BPromise(function(_0x4c264f,_0x172d7a){return client[_0x08e4('0x9')](_0x3ba50d,_0x5edc70)[_0x08e4('0xa')](function(_0x47f358){logger[_0x08e4('0xb')](_0x08e4('0xc'),_0x4c0bb6,'request\x20sent');logger[_0x08e4('0xd')](_0x08e4('0xe'),_0x4c0bb6,_0x08e4('0xf'),JSON[_0x08e4('0x10')](_0x47f358));if(_0x47f358[_0x08e4('0x11')]){if(_0x47f358['error'][_0x08e4('0x12')]===0x1f4){logger['error'](_0x08e4('0xc'),_0x4c0bb6,_0x47f358[_0x08e4('0x11')][_0x08e4('0x13')]);return _0x172d7a(_0x47f358[_0x08e4('0x11')][_0x08e4('0x13')]);}logger[_0x08e4('0x11')](_0x08e4('0xc'),_0x4c0bb6,_0x47f358[_0x08e4('0x11')][_0x08e4('0x13')]);return _0x4c264f(_0x47f358[_0x08e4('0x11')][_0x08e4('0x13')]);}else{logger[_0x08e4('0xb')](_0x08e4('0xc'),_0x4c0bb6,_0x08e4('0xf'));_0x4c264f(_0x47f358[_0x08e4('0x14')][_0x08e4('0x13')]);}})[_0x08e4('0x15')](function(_0x38fbb6){logger[_0x08e4('0x11')](_0x08e4('0xc'),_0x4c0bb6,_0x38fbb6);_0x172d7a(_0x38fbb6);});});}exports[_0x08e4('0x16')]=function(_0x5411d9){var _0x39c491=this;return new Promise(function(_0x563dfd,_0x57e15e){return db['Setting'][_0x08e4('0x17')]({'raw':_0x5411d9[_0x08e4('0x18')]?_0x5411d9[_0x08e4('0x18')][_0x08e4('0x19')]===undefined?!![]:![]:!![],'where':_0x5411d9[_0x08e4('0x18')]?_0x5411d9['options']['where']||null:null,'attributes':_0x5411d9['options']?_0x5411d9[_0x08e4('0x18')][_0x08e4('0x1a')]||null:null,'include':_0x5411d9['options']?_0x5411d9[_0x08e4('0x18')][_0x08e4('0x1b')]?_[_0x08e4('0x1c')](_0x5411d9[_0x08e4('0x18')]['include'],function(_0x4b5444){return{'model':db[_0x4b5444[_0x08e4('0x1d')]],'as':_0x4b5444['as'],'attributes':_0x4b5444[_0x08e4('0x1a')],'include':_0x4b5444[_0x08e4('0x1b')]?_['map'](_0x4b5444[_0x08e4('0x1b')],function(_0xbcb743){return{'model':db[_0xbcb743[_0x08e4('0x1d')]],'as':_0xbcb743['as'],'attributes':_0xbcb743[_0x08e4('0x1a')],'include':_0xbcb743['include']?_[_0x08e4('0x1c')](_0xbcb743[_0x08e4('0x1b')],function(_0xc25487){return{'model':db[_0xc25487[_0x08e4('0x1d')]],'as':_0xc25487['as'],'attributes':_0xc25487[_0x08e4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x08e4('0xa')](function(_0x3039d4){logger['info']('ShowSetting',_0x5411d9);logger['debug']('ShowSetting',_0x5411d9,JSON[_0x08e4('0x10')](_0x3039d4));_0x563dfd(_0x3039d4);})[_0x08e4('0x15')](function(_0x1ba17c){logger[_0x08e4('0x11')](_0x08e4('0x16'),_0x1ba17c[_0x08e4('0x13')],_0x5411d9);_0x57e15e(_0x39c491[_0x08e4('0x11')](0x1f4,_0x1ba17c['message']));});});}; \ No newline at end of file +var _0xf13e=['../../config/environment','jayson/promise','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x56edb7,_0x493f95){var _0x1b2600=function(_0x1eae04){while(--_0x1eae04){_0x56edb7['push'](_0x56edb7['shift']());}};_0x1b2600(++_0x493f95);}(_0xf13e,0xf8));var _0xef13=function(_0x586106,_0x23eba5){_0x586106=_0x586106-0x0;var _0x6be57f=_0xf13e[_0x586106];return _0x6be57f;};'use strict';var _=require(_0xef13('0x0'));var util=require(_0xef13('0x1'));var moment=require(_0xef13('0x2'));var BPromise=require(_0xef13('0x3'));var rs=require(_0xef13('0x4'));var fs=require('fs');var Redis=require(_0xef13('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xef13('0x6'));var logger=require(_0xef13('0x7'))('rpc');var config=require(_0xef13('0x8'));var jayson=require(_0xef13('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd8d3,_0x197acd,_0x5058f6){return new BPromise(function(_0x1dcbaf,_0x446371){return client[_0xef13('0xa')](_0x3dd8d3,_0x5058f6)['then'](function(_0x59da93){logger['info'](_0xef13('0xb'),_0x197acd,_0xef13('0xc'));logger[_0xef13('0xd')](_0xef13('0xe'),_0x197acd,_0xef13('0xc'),JSON['stringify'](_0x59da93));if(_0x59da93[_0xef13('0xf')]){if(_0x59da93['error'][_0xef13('0x10')]===0x1f4){logger[_0xef13('0xf')](_0xef13('0xb'),_0x197acd,_0x59da93[_0xef13('0xf')][_0xef13('0x11')]);return _0x446371(_0x59da93[_0xef13('0xf')][_0xef13('0x11')]);}logger[_0xef13('0xf')](_0xef13('0xb'),_0x197acd,_0x59da93[_0xef13('0xf')]['message']);return _0x1dcbaf(_0x59da93['error']['message']);}else{logger[_0xef13('0x12')](_0xef13('0xb'),_0x197acd,_0xef13('0xc'));_0x1dcbaf(_0x59da93[_0xef13('0x13')][_0xef13('0x11')]);}})[_0xef13('0x14')](function(_0x3b9991){logger[_0xef13('0xf')](_0xef13('0xb'),_0x197acd,_0x3b9991);_0x446371(_0x3b9991);});});}exports[_0xef13('0x15')]=function(_0x186e28){var _0x5bf849=this;return new Promise(function(_0x26e6b1,_0x2c9aa4){return db[_0xef13('0x16')][_0xef13('0x17')]({'raw':_0x186e28[_0xef13('0x18')]?_0x186e28['options'][_0xef13('0x19')]===undefined?!![]:![]:!![],'where':_0x186e28['options']?_0x186e28[_0xef13('0x18')][_0xef13('0x1a')]||null:null,'attributes':_0x186e28['options']?_0x186e28['options'][_0xef13('0x1b')]||null:null,'include':_0x186e28[_0xef13('0x18')]?_0x186e28[_0xef13('0x18')][_0xef13('0x1c')]?_[_0xef13('0x1d')](_0x186e28[_0xef13('0x18')]['include'],function(_0xe1e1c5){return{'model':db[_0xe1e1c5[_0xef13('0x1e')]],'as':_0xe1e1c5['as'],'attributes':_0xe1e1c5[_0xef13('0x1b')],'include':_0xe1e1c5[_0xef13('0x1c')]?_[_0xef13('0x1d')](_0xe1e1c5['include'],function(_0x5dd5df){return{'model':db[_0x5dd5df[_0xef13('0x1e')]],'as':_0x5dd5df['as'],'attributes':_0x5dd5df[_0xef13('0x1b')],'include':_0x5dd5df[_0xef13('0x1c')]?_[_0xef13('0x1d')](_0x5dd5df[_0xef13('0x1c')],function(_0x1b128){return{'model':db[_0x1b128[_0xef13('0x1e')]],'as':_0x1b128['as'],'attributes':_0x1b128[_0xef13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xef13('0x1f')](function(_0x1f7d46){logger[_0xef13('0x12')](_0xef13('0x15'),_0x186e28);logger[_0xef13('0xd')](_0xef13('0x15'),_0x186e28,JSON['stringify'](_0x1f7d46));_0x26e6b1(_0x1f7d46);})['catch'](function(_0x5df592){logger[_0xef13('0xf')]('ShowSetting',_0x5df592[_0xef13('0x11')],_0x186e28);_0x2c9aa4(_0x5bf849[_0xef13('0xf')](0x1f4,_0x5df592[_0xef13('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4324ac7..3452353 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x4b644e,_0x3308ec){var _0x29eaad=function(_0x321892){while(--_0x321892){_0x4b644e['push'](_0x4b644e['shift']());}};_0x29eaad(++_0x3308ec);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1cbd4a,_0x2d8185){_0x1cbd4a=_0x1cbd4a-0x0;var _0x36fe76=_0x8ef6[_0x1cbd4a];return _0x36fe76;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x179e7e,_0x136cbf){_0x179e7e=_0x179e7e-0x0;var _0x5082d4=_0x1cb9[_0x179e7e];return _0x5082d4;};'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 453d999..37175be 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 _0x38a9=['csc','infobip','ENUM','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','skebby','plivo'];(function(_0xfcfb40,_0x47b9a0){var _0x16627c=function(_0x588e95){while(--_0x588e95){_0xfcfb40['push'](_0xfcfb40['shift']());}};_0x16627c(++_0x47b9a0);}(_0x38a9,0x18a));var _0x938a=function(_0x245578,_0x3e2874){_0x245578=_0x245578-0x0;var _0x9962cf=_0x38a9[_0x245578];return _0x9962cf;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x938a('0x0'));module[_0x938a('0x1')]={'name':{'type':Sequelize[_0x938a('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x938a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x938a('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x938a('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0x938a('0x4'),'connectel','clicksend',_0x938a('0x5'),'clickatell','bandwidth',_0x938a('0x6'),_0x938a('0x7'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x938a('0x2')]},'authToken':{'type':Sequelize[_0x938a('0x2')]},'smsMethod':{'type':Sequelize[_0x938a('0x8')]('SI','TI','GP')},'username':{'type':Sequelize[_0x938a('0x2')]},'password':{'type':Sequelize[_0x938a('0x2')]},'apiKey':{'type':Sequelize[_0x938a('0x2')]},'applicationId':{'type':Sequelize[_0x938a('0x2')]},'accountId':{'type':Sequelize[_0x938a('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x938a('0x9')],'defaultValue':![]},'description':{'type':Sequelize[_0x938a('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x938a('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x938a('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x938a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x938a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x938a('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x938a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x938a('0xa')],'comment':_0x938a('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x938a('0x9')],'defaultValue':![],'comment':_0x938a('0xc'),'set':function(_0x204639){if(!_0x204639)this[_0x938a('0xd')](_0x938a('0xe'),null);this[_0x938a('0xd')](_0x938a('0xf'),_0x204639);}}}; \ No newline at end of file +var _0xc95b=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN'];(function(_0xdcd11f,_0x4ce6dd){var _0x532d80=function(_0x5071ab){while(--_0x5071ab){_0xdcd11f['push'](_0xdcd11f['shift']());}};_0x532d80(++_0x4ce6dd);}(_0xc95b,0x75));var _0xbc95=function(_0x27c4c9,_0x59bfdd){_0x27c4c9=_0x27c4c9-0x0;var _0x2bbaad=_0xc95b[_0x27c4c9];return _0x2bbaad;};'use strict';var Sequelize=require(_0xbc95('0x0'));var rs=require(_0xbc95('0x1'));module[_0xbc95('0x2')]={'name':{'type':Sequelize[_0xbc95('0x3')],'unique':_0xbc95('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xbc95('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xbc95('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xbc95('0x3')]},'type':{'type':Sequelize[_0xbc95('0x5')](_0xbc95('0x6'),_0xbc95('0x7'),_0xbc95('0x8'),'clicksend',_0xbc95('0x9'),_0xbc95('0xa'),_0xbc95('0xb'),_0xbc95('0xc'),'infobip',_0xbc95('0xd'))},'accountSid':{'type':Sequelize[_0xbc95('0x3')]},'authId':{'type':Sequelize[_0xbc95('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xbc95('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbc95('0x3')]},'password':{'type':Sequelize[_0xbc95('0x3')]},'apiKey':{'type':Sequelize[_0xbc95('0x3')]},'applicationId':{'type':Sequelize[_0xbc95('0x3')]},'accountId':{'type':Sequelize[_0xbc95('0x3')]},'senderString':{'type':Sequelize[_0xbc95('0x3')]},'deliveryReport':{'type':Sequelize[_0xbc95('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xbc95('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbc95('0xf');}},'notificationSound':{'type':Sequelize[_0xbc95('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbc95('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbc95('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbc95('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbc95('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbc95('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbc95('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbc95('0x10')],'comment':_0xbc95('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xbc95('0xe')],'defaultValue':![],'comment':_0xbc95('0x12'),'set':function(_0x931347){if(!_0x931347)this['setDataValue'](_0xbc95('0x13'),null);this[_0xbc95('0x14')](_0xbc95('0x15'),_0x931347);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e26a390..aa3fec2 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 _0xe933=['count','offset','set','Content-Range','apply','update','then','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','params','merge','create','body','user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','findOne','sort','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','From','Body','messageId','MessageSid','from','connectel','message_id','Text','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','SmsInteraction','Contact','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0xe933,0x191));var _0x3e93=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xe933[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0x3e93('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3e93('0x1'));var rp=require(_0x3e93('0x2'));var moment=require(_0x3e93('0x3'));var BPromise=require(_0x3e93('0x4'));var Mustache=require('mustache');var util=require(_0x3e93('0x5'));var path=require(_0x3e93('0x6'));var sox=require(_0x3e93('0x7'));var csv=require('to-csv');var ejs=require(_0x3e93('0x8'));var fs=require('fs');var fs_extra=require(_0x3e93('0x9'));var _=require(_0x3e93('0xa'));var squel=require('squel');var crypto=require(_0x3e93('0xb'));var jsforce=require(_0x3e93('0xc'));var deskjs=require(_0x3e93('0xd'));var toCsv=require(_0x3e93('0xe'));var querystring=require(_0x3e93('0xf'));var Papa=require(_0x3e93('0x10'));var Redis=require(_0x3e93('0x11'));var authService=require(_0x3e93('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e93('0x13'));var logger=require(_0x3e93('0x14'))(_0x3e93('0x15'));var utils=require(_0x3e93('0x16'));var config=require(_0x3e93('0x17'));var licenseUtil=require(_0x3e93('0x18'));var db=require('../../mysqldb')['db'];config[_0x3e93('0x19')]=_[_0x3e93('0x1a')](config[_0x3e93('0x19')],{'host':_0x3e93('0x1b'),'port':0x18eb});var socket=require(_0x3e93('0x1c'))(new Redis(config[_0x3e93('0x19')]));require(_0x3e93('0x1d'))[_0x3e93('0x1e')](socket);var jayson=require(_0x3e93('0x1f'));var client=jayson[_0x3e93('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4b21f7,_0x40f05e,_0x1d6ce0,_0x2d67c7){return new BPromise(function(_0x1c4f60,_0x43f391){var _0xe9e550=_0x2d67c7||client;return _0xe9e550[_0x3e93('0x21')](_0x4b21f7,_0x1d6ce0)['then'](function(_0x514cd8){logger[_0x3e93('0x22')]('SmsAccount,\x20%s,\x20%s',_0x40f05e,_0x3e93('0x23'));logger[_0x3e93('0x24')](_0x3e93('0x25'),_0x40f05e,'request\x20sent',JSON[_0x3e93('0x26')](_0x514cd8));if(_0x514cd8[_0x3e93('0x27')]){if(_0x514cd8[_0x3e93('0x27')][_0x3e93('0x28')]===0x1f4){logger[_0x3e93('0x27')](_0x3e93('0x29'),_0x40f05e,_0x514cd8[_0x3e93('0x27')][_0x3e93('0x2a')]);return _0x43f391(_0x514cd8[_0x3e93('0x27')]['message']);}logger['error'](_0x3e93('0x29'),_0x40f05e,_0x514cd8['error']['message']);return _0x1c4f60(_0x514cd8[_0x3e93('0x27')][_0x3e93('0x2a')]);}else{logger[_0x3e93('0x22')](_0x3e93('0x29'),_0x40f05e,_0x3e93('0x23'));_0x1c4f60(_0x514cd8[_0x3e93('0x2b')][_0x3e93('0x2a')]);}})[_0x3e93('0x2c')](function(_0x4aefed){logger['error'](_0x3e93('0x29'),_0x40f05e,_0x4aefed);_0x43f391(_0x4aefed);});});}function respondWithStatusCode(_0x3a62ce,_0x5e9da1){_0x5e9da1=_0x5e9da1||0xcc;return function(_0x4f7926){if(_0x4f7926){return _0x3a62ce[_0x3e93('0x2d')](_0x5e9da1);}return _0x3a62ce[_0x3e93('0x2e')](_0x5e9da1)[_0x3e93('0x2f')]();};}function respondWithResult(_0x445af1,_0x3d2472){_0x3d2472=_0x3d2472||0xc8;return function(_0x1e18db){if(_0x1e18db){return _0x445af1[_0x3e93('0x2e')](_0x3d2472)[_0x3e93('0x30')](_0x1e18db);}};}function respondWithFilteredResult(_0xca65a0,_0x259784){return function(_0x224dab){if(_0x224dab){var _0x55ac91=typeof _0x259784['offset']===_0x3e93('0x31')&&typeof _0x259784[_0x3e93('0x32')]===_0x3e93('0x31');var _0x11f8a1=_0x224dab[_0x3e93('0x33')];var _0x147a20=_0x55ac91?0x0:_0x259784[_0x3e93('0x34')];var _0xa67b3e=_0x55ac91?_0x224dab[_0x3e93('0x33')]:_0x259784[_0x3e93('0x34')]+_0x259784[_0x3e93('0x32')];var _0x19bbbe;if(_0xa67b3e>=_0x11f8a1){_0xa67b3e=_0x11f8a1;_0x19bbbe=0xc8;}else{_0x19bbbe=0xce;}_0xca65a0[_0x3e93('0x2e')](_0x19bbbe);return _0xca65a0[_0x3e93('0x35')](_0x3e93('0x36'),_0x147a20+'-'+_0xa67b3e+'/'+_0x11f8a1)['json'](_0x224dab);}return null;};}function patchUpdates(_0x25a95a){return function(_0xd6cbb2){try{jsonpatch[_0x3e93('0x37')](_0xd6cbb2,_0x25a95a,!![]);}catch(_0x13ac57){return BPromise['reject'](_0x13ac57);}return _0xd6cbb2['save']();};}function saveUpdates(_0x3e352d,_0x2a4ef3){return function(_0x9676fa){if(_0x9676fa){return _0x9676fa[_0x3e93('0x38')](_0x3e352d)[_0x3e93('0x39')](function(_0x585fbc){return _0x585fbc;});}return null;};}function removeEntity(_0x332ff7,_0x2ef8b1){return function(_0x3cd8ff){if(_0x3cd8ff){return _0x3cd8ff[_0x3e93('0x3a')]()['then'](function(){var _0x520b6f=_0x3cd8ff[_0x3e93('0x3b')]({'plain':!![]});var _0x13808d=_0x3e93('0x3c');return db['UserProfileResource'][_0x3e93('0x3a')]({'where':{'type':_0x13808d,'resourceId':_0x520b6f['id']}})[_0x3e93('0x39')](function(){return _0x3cd8ff;});})[_0x3e93('0x39')](function(){_0x332ff7[_0x3e93('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52818e,_0x4713f5){return function(_0x22f0c6){if(!_0x22f0c6){_0x52818e[_0x3e93('0x2d')](0x194);}return _0x22f0c6;};}function handleError(_0x206cfd,_0x5e05b1){_0x5e05b1=_0x5e05b1||0x1f4;return function(_0x1de0cb){logger[_0x3e93('0x27')](_0x1de0cb[_0x3e93('0x3d')]);if(_0x1de0cb[_0x3e93('0x3e')]){delete _0x1de0cb[_0x3e93('0x3e')];}_0x206cfd[_0x3e93('0x2e')](_0x5e05b1)[_0x3e93('0x3f')](_0x1de0cb);};}exports[_0x3e93('0x40')]=function(_0x1be3e6,_0x5d558b){var _0x8958f7={'include':[{'model':db[_0x3e93('0x41')],'as':_0x3e93('0x42')}]},_0x598826={},_0x53a40a={'count':0x0,'rows':[]};var _0x4aca38=_[_0x3e93('0x43')](db[_0x3e93('0x44')][_0x3e93('0x45')],function(_0x7c5c8e){return{'name':_0x7c5c8e[_0x3e93('0x46')],'type':_0x7c5c8e['type'][_0x3e93('0x47')]};});_0x598826[_0x3e93('0x48')]=_[_0x3e93('0x43')](_0x4aca38,_0x3e93('0x3e'));_0x598826[_0x3e93('0x49')]=_[_0x3e93('0x4a')](_0x1be3e6[_0x3e93('0x49')]);_0x598826[_0x3e93('0x4b')]=_[_0x3e93('0x4c')](_0x598826[_0x3e93('0x48')],_0x598826[_0x3e93('0x49')]);_0x8958f7[_0x3e93('0x4d')]=_[_0x3e93('0x4c')](_0x598826[_0x3e93('0x48')],qs[_0x3e93('0x4e')](_0x1be3e6['query'][_0x3e93('0x4e')]));_0x8958f7[_0x3e93('0x4d')]=_0x8958f7[_0x3e93('0x4d')][_0x3e93('0x4f')]?_0x8958f7[_0x3e93('0x4d')]:_0x598826[_0x3e93('0x48')];if(!_0x1be3e6['query'][_0x3e93('0x50')](_0x3e93('0x51'))){_0x8958f7['limit']=qs[_0x3e93('0x32')](_0x1be3e6[_0x3e93('0x49')][_0x3e93('0x32')]);_0x8958f7[_0x3e93('0x34')]=qs[_0x3e93('0x34')](_0x1be3e6[_0x3e93('0x49')]['offset']);}_0x8958f7[_0x3e93('0x52')]=qs['sort'](_0x1be3e6[_0x3e93('0x49')]['sort']);_0x8958f7[_0x3e93('0x53')]=qs[_0x3e93('0x4b')](_[_0x3e93('0x54')](_0x1be3e6[_0x3e93('0x49')],_0x598826['filters']),_0x4aca38);if(_0x1be3e6[_0x3e93('0x49')]['filter']){_0x8958f7[_0x3e93('0x53')]=_['merge'](_0x8958f7['where'],{'$or':_[_0x3e93('0x43')](_0x4aca38,function(_0x60cef){if(_0x60cef['type']!==_0x3e93('0x55')){var _0x2570c4={};_0x2570c4[_0x60cef[_0x3e93('0x3e')]]={'$like':'%'+_0x1be3e6['query'][_0x3e93('0x56')]+'%'};return _0x2570c4;}})});}_0x8958f7=_['merge']({},_0x8958f7,_0x1be3e6[_0x3e93('0x57')]);var _0xc8381f={'where':_0x8958f7[_0x3e93('0x53')]};return db['SmsAccount'][_0x3e93('0x33')](_0xc8381f)[_0x3e93('0x39')](function(_0x28f9dd){_0x53a40a[_0x3e93('0x33')]=_0x28f9dd;if(_0x1be3e6['query'][_0x3e93('0x58')]){_0x8958f7['include']=[{'all':!![]}];}return db['SmsAccount'][_0x3e93('0x59')](_0x8958f7);})[_0x3e93('0x39')](function(_0x130a78){_0x53a40a[_0x3e93('0x5a')]=_0x130a78;return _0x53a40a;})[_0x3e93('0x39')](respondWithFilteredResult(_0x5d558b,_0x8958f7))[_0x3e93('0x2c')](handleError(_0x5d558b,null));};exports['show']=function(_0x528570,_0xe52d10){var _0xcaacb2={'raw':![],'where':{'id':_0x528570[_0x3e93('0x5b')]['id']},'include':[{'model':db[_0x3e93('0x41')],'as':_0x3e93('0x42')}]},_0x4fee28={};_0x4fee28[_0x3e93('0x48')]=_[_0x3e93('0x4a')](db[_0x3e93('0x44')]['rawAttributes']);_0x4fee28['query']=_[_0x3e93('0x4a')](_0x528570[_0x3e93('0x49')]);_0x4fee28[_0x3e93('0x4b')]=_[_0x3e93('0x4c')](_0x4fee28[_0x3e93('0x48')],_0x4fee28[_0x3e93('0x49')]);_0xcaacb2['attributes']=_[_0x3e93('0x4c')](_0x4fee28[_0x3e93('0x48')],qs['fields'](_0x528570[_0x3e93('0x49')]['fields']));_0xcaacb2[_0x3e93('0x4d')]=_0xcaacb2[_0x3e93('0x4d')]['length']?_0xcaacb2[_0x3e93('0x4d')]:_0x4fee28[_0x3e93('0x48')];if(_0x528570[_0x3e93('0x49')][_0x3e93('0x58')]){_0xcaacb2['include']=[{'all':!![]}];}_0xcaacb2=_[_0x3e93('0x5c')]({},_0xcaacb2,_0x528570[_0x3e93('0x57')]);return db[_0x3e93('0x44')]['find'](_0xcaacb2)[_0x3e93('0x39')](handleEntityNotFound(_0xe52d10,null))[_0x3e93('0x39')](respondWithResult(_0xe52d10,null))['catch'](handleError(_0xe52d10,null));};exports[_0x3e93('0x5d')]=function(_0x30baa3,_0x33b887){return db[_0x3e93('0x44')][_0x3e93('0x5d')](_0x30baa3[_0x3e93('0x5e')],{})[_0x3e93('0x39')](function(_0x46bce3){var _0x124885=_0x30baa3[_0x3e93('0x5f')]['get']({'plain':!![]});if(!_0x124885)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x124885[_0x3e93('0x60')]===_0x3e93('0x5f')){var _0x370cc7=_0x46bce3[_0x3e93('0x3b')]({'plain':!![]});var _0x8910d=_0x3e93('0x3c');return db['UserProfileSection'][_0x3e93('0x61')]({'where':{'name':_0x8910d,'userProfileId':_0x124885[_0x3e93('0x62')]},'raw':!![]})[_0x3e93('0x39')](function(_0x3f7345){if(_0x3f7345&&_0x3f7345[_0x3e93('0x63')]===0x0){return db[_0x3e93('0x64')]['create']({'name':_0x370cc7[_0x3e93('0x3e')],'resourceId':_0x370cc7['id'],'type':_0x3f7345['name'],'sectionId':_0x3f7345['id']},{})['then'](function(){return _0x46bce3;});}else{return _0x46bce3;}})['catch'](function(_0x5f21c6){logger[_0x3e93('0x27')](_0x3e93('0x65'),_0x5f21c6);throw _0x5f21c6;});}return _0x46bce3;})[_0x3e93('0x39')](respondWithResult(_0x33b887,0xc9))[_0x3e93('0x2c')](handleError(_0x33b887,null));};exports['update']=function(_0x2453e9,_0x526205){if(_0x2453e9[_0x3e93('0x5e')]['id']){delete _0x2453e9[_0x3e93('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2453e9[_0x3e93('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3e93('0x39')](handleEntityNotFound(_0x526205,null))[_0x3e93('0x39')](saveUpdates(_0x2453e9['body'],null))['then'](respondWithResult(_0x526205,null))[_0x3e93('0x2c')](handleError(_0x526205,null));};exports[_0x3e93('0x3a')]=function(_0x550900,_0x4d40fd){return db['SmsAccount']['find']({'where':{'id':_0x550900[_0x3e93('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d40fd,null))[_0x3e93('0x39')](removeEntity(_0x4d40fd,null))['catch'](handleError(_0x4d40fd,null));};exports[_0x3e93('0x66')]=function(_0x88cf62,_0x5d1eaa){return db['SmsAccount'][_0x3e93('0x66')]()[_0x3e93('0x39')](respondWithResult(_0x5d1eaa,null))[_0x3e93('0x2c')](handleError(_0x5d1eaa,null));};exports['addDisposition']=function(_0x5a0ec0,_0x174253,_0x1cc8e5){if(_0x5a0ec0[_0x3e93('0x5e')]['id']){delete _0x5a0ec0['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5a0ec0[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x174253,null))[_0x3e93('0x39')](function(_0x22137e){if(_0x22137e){_0x5a0ec0[_0x3e93('0x5e')][_0x3e93('0x67')]=_0x22137e['id'];return db[_0x3e93('0x68')][_0x3e93('0x5d')](_0x5a0ec0['body']);}})[_0x3e93('0x39')](respondWithResult(_0x174253,null))[_0x3e93('0x2c')](handleError(_0x174253,null));};exports['getDispositions']=function(_0x4df640,_0x4fa61d,_0x5c94b0){var _0x19344d={'raw':![],'where':{}};var _0xed58bc={};var _0x3ce350={'count':0x0,'rows':[]};return db[_0x3e93('0x44')][_0x3e93('0x69')]({'where':{'id':_0x4df640['params']['id']}})['then'](handleEntityNotFound(_0x4fa61d,null))[_0x3e93('0x39')](function(_0x2d7dc0){if(_0x2d7dc0){_0xed58bc[_0x3e93('0x48')]=_[_0x3e93('0x4a')](db[_0x3e93('0x68')][_0x3e93('0x45')]);_0xed58bc[_0x3e93('0x49')]=_[_0x3e93('0x4a')](_0x4df640[_0x3e93('0x49')]);_0xed58bc[_0x3e93('0x4b')]=_['intersection'](_0xed58bc[_0x3e93('0x48')],_0xed58bc[_0x3e93('0x49')]);_0x19344d['attributes']=_[_0x3e93('0x4c')](_0xed58bc[_0x3e93('0x48')],qs[_0x3e93('0x4e')](_0x4df640[_0x3e93('0x49')][_0x3e93('0x4e')]));_0x19344d[_0x3e93('0x4d')]=_0x19344d['attributes'][_0x3e93('0x4f')]?_0x19344d[_0x3e93('0x4d')]:_0xed58bc['model'];if(!_0x4df640[_0x3e93('0x49')][_0x3e93('0x50')]('nolimit')){_0x19344d[_0x3e93('0x32')]=qs[_0x3e93('0x32')](_0x4df640[_0x3e93('0x49')][_0x3e93('0x32')]);_0x19344d[_0x3e93('0x34')]=qs['offset'](_0x4df640[_0x3e93('0x49')][_0x3e93('0x34')]);}_0x19344d[_0x3e93('0x52')]=qs[_0x3e93('0x6a')](_0x4df640['query'][_0x3e93('0x6a')]);_0x19344d[_0x3e93('0x53')]=qs[_0x3e93('0x4b')](_[_0x3e93('0x54')](_0x4df640[_0x3e93('0x49')],_0xed58bc['filters']));_0x19344d[_0x3e93('0x53')][_0x3e93('0x67')]=_0x2d7dc0['id'];if(_0x4df640['query'][_0x3e93('0x56')]){_0x19344d[_0x3e93('0x53')]=_[_0x3e93('0x5c')](_0x19344d[_0x3e93('0x53')],{'$or':_[_0x3e93('0x43')](_0x19344d[_0x3e93('0x4d')],function(_0x196a44){var _0x3e58e1={};_0x3e58e1[_0x196a44]={'$like':'%'+_0x4df640['query'][_0x3e93('0x56')]+'%'};return _0x3e58e1;})});}_0x19344d=_['merge']({},_0x19344d,_0x4df640[_0x3e93('0x57')]);return db[_0x3e93('0x68')][_0x3e93('0x33')]({'where':_0x19344d[_0x3e93('0x53')]})[_0x3e93('0x39')](function(_0x38267c){_0x3ce350[_0x3e93('0x33')]=_0x38267c;if(_0x4df640[_0x3e93('0x49')][_0x3e93('0x58')]){_0x19344d[_0x3e93('0x6b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x19344d);})[_0x3e93('0x39')](function(_0x2e156e){_0x3ce350[_0x3e93('0x5a')]=_0x2e156e;return _0x3ce350;});}})[_0x3e93('0x39')](respondWithFilteredResult(_0x4fa61d,_0x19344d))[_0x3e93('0x2c')](handleError(_0x4fa61d,null));};exports[_0x3e93('0x6c')]=function(_0x464ce2,_0x38f4b5,_0x41bdeb){return db[_0x3e93('0x44')][_0x3e93('0x61')]({'where':{'id':_0x464ce2[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x38f4b5,null))[_0x3e93('0x39')](function(_0x3f89e3){if(_0x3f89e3){return _0x3f89e3[_0x3e93('0x6c')](_0x464ce2[_0x3e93('0x49')][_0x3e93('0x6d')]);}})[_0x3e93('0x39')](respondWithStatusCode(_0x38f4b5,null))[_0x3e93('0x2c')](handleError(_0x38f4b5,null));};exports[_0x3e93('0x6e')]=function(_0x3fe56b,_0x1fd93f,_0x271bcd){if(_0x3fe56b['body']['id']){delete _0x3fe56b[_0x3e93('0x5e')]['id'];}return db[_0x3e93('0x44')][_0x3e93('0x61')]({'where':{'id':_0x3fe56b['params']['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x1fd93f,null))[_0x3e93('0x39')](function(_0x269587){if(_0x269587){_0x3fe56b[_0x3e93('0x5e')][_0x3e93('0x67')]=_0x269587['id'];return db[_0x3e93('0x6f')][_0x3e93('0x5d')](_0x3fe56b[_0x3e93('0x5e')]);}})[_0x3e93('0x39')](respondWithResult(_0x1fd93f,null))[_0x3e93('0x2c')](handleError(_0x1fd93f,null));};exports[_0x3e93('0x70')]=function(_0x41dd11,_0x4009b6,_0x3a4997){var _0x3319e4={'raw':![],'where':{}};var _0x33f10f={};var _0x5d7bb3={'count':0x0,'rows':[]};return db[_0x3e93('0x44')]['findOne']({'where':{'id':_0x41dd11[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x4009b6,null))[_0x3e93('0x39')](function(_0x23ffcf){if(_0x23ffcf){_0x33f10f[_0x3e93('0x48')]=_['keys'](db[_0x3e93('0x6f')][_0x3e93('0x45')]);_0x33f10f['query']=_[_0x3e93('0x4a')](_0x41dd11[_0x3e93('0x49')]);_0x33f10f[_0x3e93('0x4b')]=_[_0x3e93('0x4c')](_0x33f10f['model'],_0x33f10f[_0x3e93('0x49')]);_0x3319e4[_0x3e93('0x4d')]=_[_0x3e93('0x4c')](_0x33f10f[_0x3e93('0x48')],qs['fields'](_0x41dd11[_0x3e93('0x49')][_0x3e93('0x4e')]));_0x3319e4[_0x3e93('0x4d')]=_0x3319e4[_0x3e93('0x4d')][_0x3e93('0x4f')]?_0x3319e4[_0x3e93('0x4d')]:_0x33f10f['model'];if(!_0x41dd11['query'][_0x3e93('0x50')](_0x3e93('0x51'))){_0x3319e4[_0x3e93('0x32')]=qs[_0x3e93('0x32')](_0x41dd11[_0x3e93('0x49')][_0x3e93('0x32')]);_0x3319e4[_0x3e93('0x34')]=qs[_0x3e93('0x34')](_0x41dd11[_0x3e93('0x49')][_0x3e93('0x34')]);}_0x3319e4[_0x3e93('0x52')]=qs[_0x3e93('0x6a')](_0x41dd11[_0x3e93('0x49')][_0x3e93('0x6a')]);_0x3319e4['where']=qs[_0x3e93('0x4b')](_[_0x3e93('0x54')](_0x41dd11[_0x3e93('0x49')],_0x33f10f[_0x3e93('0x4b')]));_0x3319e4[_0x3e93('0x53')][_0x3e93('0x67')]=_0x23ffcf['id'];if(_0x41dd11[_0x3e93('0x49')][_0x3e93('0x56')]){_0x3319e4[_0x3e93('0x53')]=_[_0x3e93('0x5c')](_0x3319e4[_0x3e93('0x53')],{'$or':_['map'](_0x3319e4[_0x3e93('0x4d')],function(_0x5a74b1){var _0x270f62={};_0x270f62[_0x5a74b1]={'$like':'%'+_0x41dd11[_0x3e93('0x49')][_0x3e93('0x56')]+'%'};return _0x270f62;})});}_0x3319e4=_['merge']({},_0x3319e4,_0x41dd11['options']);return db['CannedAnswer']['count']({'where':_0x3319e4[_0x3e93('0x53')]})[_0x3e93('0x39')](function(_0x1a6f14){_0x5d7bb3['count']=_0x1a6f14;if(_0x41dd11['query'][_0x3e93('0x58')]){_0x3319e4[_0x3e93('0x6b')]=[{'all':!![]}];}return db[_0x3e93('0x6f')][_0x3e93('0x59')](_0x3319e4);})[_0x3e93('0x39')](function(_0x558fd2){_0x5d7bb3[_0x3e93('0x5a')]=_0x558fd2;return _0x5d7bb3;});}})[_0x3e93('0x39')](respondWithFilteredResult(_0x4009b6,_0x3319e4))[_0x3e93('0x2c')](handleError(_0x4009b6,null));};exports[_0x3e93('0x71')]=function(_0x1775ec,_0x4b3a87,_0x6cc58a){return db[_0x3e93('0x44')][_0x3e93('0x61')]({'where':{'id':_0x1775ec['params']['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x4b3a87,null))[_0x3e93('0x39')](function(_0x1eaf44){if(_0x1eaf44){return _0x1eaf44[_0x3e93('0x71')](_0x1775ec[_0x3e93('0x49')][_0x3e93('0x6d')]);}})[_0x3e93('0x39')](respondWithStatusCode(_0x4b3a87,null))[_0x3e93('0x2c')](handleError(_0x4b3a87,null));};exports[_0x3e93('0x72')]=function(_0xef6d5f,_0x4cbd24,_0x4bfd2b){var _0x1c6ecb={'channel':'sms'};var _0x3a588d=[];var _0x2c9aa2=[];var _0x4395c7={};return db['SmsAccount']['find']({'where':{'id':_0xef6d5f['params']['id']},'include':[{'model':db[_0x3e93('0x73')],'as':'Applications'}]})[_0x3e93('0x39')](handleEntityNotFound(_0x4cbd24,null))[_0x3e93('0x39')](function(_0x4a76eb){_0x1c6ecb[_0x3e93('0x74')]=_0x4a76eb;_0x1c6ecb[_0x3e93('0x75')]=_[_0x3e93('0x76')](_0x4a76eb[_0x3e93('0x77')],[_0x3e93('0x78')],[_0x3e93('0x79')]);if(_0x1c6ecb[_0x3e93('0x74')][_0x3e93('0x77')]){delete _0x1c6ecb[_0x3e93('0x74')][_0x3e93('0x77')];}return db[_0x3e93('0x7a')][_0x3e93('0x66')]();})[_0x3e93('0x39')](function(_0x1213cb){if(!_0x1213cb){throw new db['Sequelize'][(_0x3e93('0x7b'))]('no\x20available\x20attributes');}_0x3a588d=_[_0x3e93('0x7c')](_['keys'](_0x1213cb),[_0x3e93('0x7d'),_0x3e93('0x7e')]);_0x2c9aa2=_['difference'](_[_0x3e93('0x4a')](_0x1213cb),[_0x3e93('0x7d'),'updatedAt',_0x3e93('0x7f'),_0x3e93('0x80')]);_0x1c6ecb[_0x3e93('0x5e')]={'mapKey':_0x3e93('0x81')};if(_0x1c6ecb[_0x3e93('0x74')][_0x3e93('0x82')]){switch(_0x1c6ecb[_0x3e93('0x74')][_0x3e93('0x82')]){case _0x3e93('0x83'):_0x1c6ecb[_0x3e93('0x5e')]['from']=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x84')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f['body'][_0x3e93('0x85')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x86')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x87')];break;case'skebby':_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]='+'+_0xef6d5f[_0x3e93('0x5e')]['sender'];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f[_0x3e93('0x5e')]['text'];break;case _0x3e93('0x89'):_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]=_0xef6d5f['body'][_0x3e93('0x88')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x2a')];break;case'clicksend':_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x88')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f['body'][_0x3e93('0x5e')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x86')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x8a')];break;case'plivo':_0x1c6ecb[_0x3e93('0x5e')]['from']=_0xef6d5f['body'][_0x3e93('0x84')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f['body'][_0x3e93('0x8b')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x86')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x8c')];break;case'infobip':_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]='+'+_0xef6d5f[_0x3e93('0x5e')]['results'][0x0][_0x3e93('0x88')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x8d')][0x0][_0x3e93('0x8e')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x86')]=_0xef6d5f['body'][_0x3e93('0x8d')][0x0][_0x3e93('0x86')];break;case _0x3e93('0x8f'):_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]=_0xef6d5f['body'][_0x3e93('0x90')];_0x1c6ecb[_0x3e93('0x5e')]['body']=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x91')][_0x3e93('0x2a')];break;case _0x3e93('0x92'):_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]=_0xef6d5f['body'][_0x3e93('0x93')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x8e')];_0x1c6ecb[_0x3e93('0x5e')]['messageId']=_0xef6d5f['body']['replyMessageId'];break;case _0x3e93('0x94'):_0x1c6ecb[_0x3e93('0x5e')]['messageId']=_0xef6d5f[_0x3e93('0x5e')][0x0][_0x3e93('0x2a')]['id'];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]=_0xef6d5f[_0x3e93('0x5e')][0x0][_0x3e93('0x2a')][_0x3e93('0x88')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]=_0xef6d5f[_0x3e93('0x5e')][0x0][_0x3e93('0x2a')][_0x3e93('0x8e')];break;case _0x3e93('0x95'):_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')]=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x88')];_0x1c6ecb['body']['body']=_0xef6d5f[_0x3e93('0x5e')][_0x3e93('0x2a')];_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x86')]=_0xef6d5f['body'][_0x3e93('0x96')];break;}}if(_0x1c6ecb[_0x3e93('0x5e')]['id']){delete _0x1c6ecb['body']['id'];}if(_[_0x3e93('0x97')](_0x1c6ecb[_0x3e93('0x5e')]['from'])){throw new db[(_0x3e93('0x98'))][(_0x3e93('0x7b'))]('from\x20is\x20mandatory');}if(_[_0x3e93('0x97')](_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')])||_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')]===''){throw new db[(_0x3e93('0x98'))][(_0x3e93('0x7b'))](_0x3e93('0x99'));}if(_[_0x3e93('0x97')](_0x1c6ecb[_0x3e93('0x5e')]['mapKey'])){throw new db[(_0x3e93('0x98'))][(_0x3e93('0x7b'))](_0x3e93('0x9a')+_0x2c9aa2);}if(!_['includes'](_0x2c9aa2,_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x9b')])){throw new db[(_0x3e93('0x98'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c9aa2);}_0x4395c7[_0x1c6ecb['body'][_0x3e93('0x9b')]]=_0x1c6ecb[_0x3e93('0x5e')]['from'];return db[_0x3e93('0x9c')][_0x3e93('0x61')]({'where':{'id':_0x1c6ecb[_0x3e93('0x74')][_0x3e93('0x80')]},'include':[{'model':db[_0x3e93('0x7a')],'as':_0x3e93('0x9d'),'where':_0x4395c7,'limit':0x1,'order':[[_0x3e93('0x7e'),_0x3e93('0x9e')]]}]});})['then'](handleEntityNotFound(_0x4cbd24,null))[_0x3e93('0x39')](function(_0xac8d36){if(_0xac8d36){_0x1c6ecb['list']=_['omit'](_0xac8d36,[_0x3e93('0x9d')]);if(_0xac8d36['Contacts']['length']){return _0xac8d36[_0x3e93('0x9d')][0x0];}var _0x5eb0a8=_[_0x3e93('0x1a')](_0x1c6ecb[_0x3e93('0x5e')],{'firstName':_0x1c6ecb[_0x3e93('0x5e')]['from'],'ListId':_0xac8d36['id']});_0x5eb0a8[_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x9b')]]=_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x88')];return db[_0x3e93('0x7a')][_0x3e93('0x5d')](_0x5eb0a8,{'fields':_0x3a588d,'raw':!![]});}})[_0x3e93('0x39')](handleEntityNotFound(_0x4cbd24,null))[_0x3e93('0x39')](function(_0x4e32bb){if(_0x4e32bb){_0x1c6ecb['contact']=_0x4e32bb;var _0x79780c={'ContactId':_0x4e32bb['id'],'phone':_0x1c6ecb['body'][_0x3e93('0x88')],'SmsAccountId':_0xef6d5f['params']['id']};var _0x34a256={'ContactId':_0x4e32bb['id'],'SmsAccountId':_0xef6d5f[_0x3e93('0x5b')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x34a256})['then'](function(_0x45eb37){if(_0x45eb37){return[_0x45eb37,![]];}return db['SmsInteraction'][_0x3e93('0x5d')](_0x79780c)['then'](function(_0x46edd2){return[_0x46edd2,!![]];});});}})[_0x3e93('0x9f')](function(_0x4a6771,_0x4515a8){_0x1c6ecb[_0x3e93('0xa0')]=_0x4a6771[_0x3e93('0x3b')]({'plain':!![]});_0x1c6ecb['interaction'][_0x3e93('0xa1')]=![];if(_0x4515a8){if(_0x1c6ecb[_0x3e93('0x74')][_0x3e93('0xa2')]){_0x1c6ecb[_0x3e93('0x75')][_0x3e93('0xa3')]({'id':0x0,'priority':_0x1c6ecb[_0x3e93('0x75')][_0x3e93('0x4f')]+0x1,'app':_0x3e93('0xa4'),'appdata':'unmanaged','interval':_0x3e93('0xa5')});}_0x1c6ecb[_0x3e93('0xa0')][_0x3e93('0xa1')]=!![];}return db[_0x3e93('0xa6')]['create']({'phone':_0x1c6ecb['body']['from'],'messageId':_0x1c6ecb[_0x3e93('0x5e')]['messageId'],'body':_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0x5e')],'SmsAccountId':_0xef6d5f[_0x3e93('0x5b')]['id'],'SmsInteractionId':_0x4a6771['id'],'direction':'in','ContactId':_0x4a6771[_0x3e93('0xa7')],'AttachmentId':_0x1c6ecb[_0x3e93('0x5e')][_0x3e93('0xa8')]});})[_0x3e93('0x39')](function(_0x2d3f26){_0x1c6ecb[_0x3e93('0x2a')]=_0x2d3f26;if(_0x1c6ecb[_0x3e93('0xa0')][_0x3e93('0xa9')]){return db[_0x3e93('0xaa')][_0x3e93('0x61')]({'attributes':['id',_0x3e93('0x3e')],'where':{'id':_0x1c6ecb[_0x3e93('0xa0')][_0x3e93('0xa9')]}})[_0x3e93('0x39')](function(_0x324833){if(_0x324833){_0x1c6ecb[_0x3e93('0x75')][_0x3e93('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x324833[_0x3e93('0x3e')]+','+(_0x1c6ecb[_0x3e93('0x74')][_0x3e93('0xac')]||0xa),'interval':_0x3e93('0xa5')});}return respondWithRpcPromise(_0x3e93('0xad'),_0x3e93('0xae'),_0x1c6ecb);});}return respondWithRpcPromise(_0x3e93('0xad'),_0x3e93('0xae'),_0x1c6ecb);})[_0x3e93('0x39')](function(_0x61cbbb){if(_0x61cbbb){var _0x206d6a=0xc8;var _0x22c79d=_0x3e93('0xaf');logger['info'](_0x3e93('0x25'),_0x22c79d,_0x206d6a,_0x3e93('0xb0'));logger[_0x3e93('0x24')](_0x3e93('0xb1'),_0x22c79d,_0x206d6a,'entity\x20found',JSON[_0x3e93('0x26')](_0x61cbbb));if(_0x1c6ecb[_0x3e93('0x74')]['type']===_0x3e93('0x83')){return _0x4cbd24[_0x3e93('0x2e')](_0x206d6a)['set'](_0x3e93('0xb2'),_0x3e93('0xb3'))[_0x3e93('0x3f')](_0x3e93('0xb4'));}else{return _0x4cbd24[_0x3e93('0x2e')](_0x206d6a)[_0x3e93('0x30')](_0x61cbbb);}}})['catch'](handleError(_0x4cbd24,null));};exports[_0x3e93('0xb5')]=function(_0x2add94,_0xc2428e,_0x20f225){return db[_0x3e93('0x44')][_0x3e93('0x69')]({'where':{'id':_0x2add94['params']['id']}})['then'](handleEntityNotFound(_0xc2428e,null))['then'](function(_0x45e39f){if(_0x45e39f){return db[_0x3e93('0xb6')]['transaction'](function(_0x3074e3){return db[_0x3e93('0x73')][_0x3e93('0x3a')]({'where':{'SmsAccountId':_0x2add94[_0x3e93('0x5b')]['id']},'transaction':_0x3074e3})[_0x3e93('0x39')](function(_0x153fb7){var _0x46f119=_[_0x3e93('0x43')](_0x2add94[_0x3e93('0x5e')],function(_0x4ac12e){_0x4ac12e[_0x3e93('0x67')]=_0x2add94[_0x3e93('0x5b')]['id'];return _0x4ac12e;});return db['SmsApplication'][_0x3e93('0xb7')](_0x46f119,{'transaction':_0x3074e3});});})[_0x3e93('0x39')](function(){return db[_0x3e93('0x73')][_0x3e93('0xb8')]({'where':{'SmsAccountId':_0x2add94[_0x3e93('0x5b')]['id']},'order':_0x3e93('0x78')});});}})['then'](respondWithResult(_0xc2428e,null))[_0x3e93('0x2c')](handleError(_0xc2428e,null));};exports[_0x3e93('0xb9')]=function(_0x4b03c8,_0x440800,_0x1ab745){var _0x3cd343={};var _0x245c75={};var _0x38abb3;var _0x536495;return db[_0x3e93('0x44')]['findOne']({'where':{'id':_0x4b03c8['params']['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x440800,null))[_0x3e93('0x39')](function(_0x56a9ad){if(_0x56a9ad){_0x38abb3=_0x56a9ad;_0x245c75[_0x3e93('0x48')]=_[_0x3e93('0x4a')](db['SmsApplication'][_0x3e93('0x45')]);_0x245c75[_0x3e93('0x49')]=_['keys'](_0x4b03c8[_0x3e93('0x49')]);_0x245c75[_0x3e93('0x4b')]=_['intersection'](_0x245c75[_0x3e93('0x48')],_0x245c75[_0x3e93('0x49')]);_0x3cd343[_0x3e93('0x4d')]=_[_0x3e93('0x4c')](_0x245c75[_0x3e93('0x48')],qs[_0x3e93('0x4e')](_0x4b03c8[_0x3e93('0x49')]['fields']));_0x3cd343['attributes']=_0x3cd343['attributes'][_0x3e93('0x4f')]?_0x3cd343[_0x3e93('0x4d')]:_0x245c75[_0x3e93('0x48')];_0x3cd343[_0x3e93('0x52')]=qs[_0x3e93('0x6a')](_0x4b03c8[_0x3e93('0x49')]['sort']);_0x3cd343[_0x3e93('0x53')]=qs[_0x3e93('0x4b')](_[_0x3e93('0x54')](_0x4b03c8[_0x3e93('0x49')],_0x245c75[_0x3e93('0x4b')]));if(_0x4b03c8[_0x3e93('0x49')][_0x3e93('0x56')]){_0x3cd343[_0x3e93('0x53')]=_['merge'](_0x3cd343['where'],{'$or':_[_0x3e93('0x43')](_0x3cd343['attributes'],function(_0x47e803){var _0x3bc5fe={};_0x3bc5fe[_0x47e803]={'$like':'%'+_0x4b03c8[_0x3e93('0x49')][_0x3e93('0x56')]+'%'};return _0x3bc5fe;})});}_0x3cd343=_['merge']({},_0x3cd343,_0x4b03c8[_0x3e93('0x57')]);return _0x38abb3[_0x3e93('0xb9')](_0x3cd343);}})[_0x3e93('0x39')](function(_0x582b4e){if(_0x582b4e){_0x536495=_0x582b4e[_0x3e93('0x4f')];if(!_0x4b03c8[_0x3e93('0x49')][_0x3e93('0x50')](_0x3e93('0x51'))){_0x3cd343[_0x3e93('0x32')]=qs['limit'](_0x4b03c8[_0x3e93('0x49')][_0x3e93('0x32')]);_0x3cd343[_0x3e93('0x34')]=qs['offset'](_0x4b03c8['query'][_0x3e93('0x34')]);}return _0x38abb3['getApplications'](_0x3cd343);}})[_0x3e93('0x39')](function(_0x3b6b42){if(_0x3b6b42){return _0x3b6b42?{'count':_0x536495,'rows':_0x3b6b42}:null;}})[_0x3e93('0x39')](respondWithResult(_0x440800,null))[_0x3e93('0x2c')](handleError(_0x440800,null));};exports[_0x3e93('0xba')]=function(_0x479ef3,_0x45aa5b,_0x553a60){var _0x21b1aa={'raw':![],'where':{}};var _0x44032d={};var _0x35a609={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3e93('0x69')]({'where':{'id':_0x479ef3[_0x3e93('0x5b')]['id']}})['then'](handleEntityNotFound(_0x45aa5b,null))['then'](function(_0x1ec6a2){if(_0x1ec6a2){_0x44032d[_0x3e93('0x48')]=_[_0x3e93('0x4a')](db[_0x3e93('0xbb')][_0x3e93('0x45')]);_0x44032d[_0x3e93('0x49')]=_['keys'](_0x479ef3['query']);_0x44032d[_0x3e93('0x4b')]=_[_0x3e93('0x4c')](_0x44032d[_0x3e93('0x48')],_0x44032d['query']);_0x21b1aa[_0x3e93('0x4d')]=_[_0x3e93('0x4c')](_0x44032d[_0x3e93('0x48')],qs[_0x3e93('0x4e')](_0x479ef3[_0x3e93('0x49')][_0x3e93('0x4e')]));_0x21b1aa[_0x3e93('0x4d')]=_0x21b1aa[_0x3e93('0x4d')][_0x3e93('0x4f')]?_0x21b1aa[_0x3e93('0x4d')]:_0x44032d[_0x3e93('0x48')];if(!_0x479ef3[_0x3e93('0x49')][_0x3e93('0x50')](_0x3e93('0x51'))){_0x21b1aa[_0x3e93('0x32')]=qs[_0x3e93('0x32')](_0x479ef3[_0x3e93('0x49')][_0x3e93('0x32')]);_0x21b1aa[_0x3e93('0x34')]=qs[_0x3e93('0x34')](_0x479ef3[_0x3e93('0x49')][_0x3e93('0x34')]);}_0x21b1aa['order']=qs[_0x3e93('0x6a')](_0x479ef3[_0x3e93('0x49')][_0x3e93('0x6a')]);_0x21b1aa[_0x3e93('0x53')]=qs[_0x3e93('0x4b')](_[_0x3e93('0x54')](_0x479ef3[_0x3e93('0x49')],_0x44032d[_0x3e93('0x4b')]));_0x21b1aa[_0x3e93('0x53')][_0x3e93('0x67')]=_0x1ec6a2['id'];if(_0x479ef3['query']['filter']){_0x21b1aa[_0x3e93('0x53')]=_[_0x3e93('0x5c')](_0x21b1aa[_0x3e93('0x53')],{'$or':_[_0x3e93('0x43')](_0x21b1aa[_0x3e93('0x4d')],function(_0x1f976d){var _0x407879={};_0x407879[_0x1f976d]={'$like':'%'+_0x479ef3['query']['filter']+'%'};return _0x407879;})});}_0x21b1aa=_['merge']({},_0x21b1aa,_0x479ef3[_0x3e93('0x57')]);return db[_0x3e93('0xbb')][_0x3e93('0x33')]({'where':_0x21b1aa[_0x3e93('0x53')]})[_0x3e93('0x39')](function(_0x536855){_0x35a609[_0x3e93('0x33')]=_0x536855;if(_0x479ef3['query']['includeAll']){_0x21b1aa[_0x3e93('0x6b')]=[{'model':db[_0x3e93('0x7a')],'as':_0x3e93('0xbc'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x3e93('0x3e'),'fullname',_0x3e93('0xbd')],'required':![]},{'model':db[_0x3e93('0xbe')],'as':_0x3e93('0xbf'),'attributes':['id','name',_0x3e93('0xc0')],'where':_0x479ef3['query'][_0x3e93('0xc1')]?{'id':_0x479ef3[_0x3e93('0x49')][_0x3e93('0xc1')]}:undefined,'required':_0x479ef3[_0x3e93('0x49')][_0x3e93('0xc1')]?!![]:![]}];}return db[_0x3e93('0xbb')][_0x3e93('0x59')](_0x21b1aa);})['then'](function(_0x13f38c){_0x35a609[_0x3e93('0x5a')]=_0x13f38c;return _0x35a609;});}})[_0x3e93('0x39')](respondWithFilteredResult(_0x45aa5b,_0x21b1aa))['catch'](handleError(_0x45aa5b,null));};exports[_0x3e93('0x3f')]=function(_0x229524,_0x172ba6,_0x516256){var _0x476ede,_0x43e14e,_0x16942b;if(_[_0x3e93('0x97')](_0x229524[_0x3e93('0x5e')]['body'])||_0x229524[_0x3e93('0x5e')]['body']===''){throw new db[(_0x3e93('0x98'))]['ValidationError'](_0x3e93('0x99'));}if(_['isNil'](_0x229524[_0x3e93('0x5e')]['to'])){throw new db[(_0x3e93('0x98'))][(_0x3e93('0x7b'))](_0x3e93('0xc2'));}_0x476ede=_0x229524[_0x3e93('0x5e')]['to'];return db[_0x3e93('0x44')]['find']({'where':{'id':_0x229524[_0x3e93('0x5b')]['id']},'include':[{'model':db[_0x3e93('0x9c')],'as':_0x3e93('0xc3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x476ede},'limit':0x1,'order':[[_0x3e93('0x7e'),_0x3e93('0x9e')]]}]}]})[_0x3e93('0x39')](handleEntityNotFound(_0x172ba6,null))['then'](function(_0x58d86e){if(_0x58d86e&&_0x58d86e[_0x3e93('0xc3')]){_0x43e14e=_0x58d86e['get']({'plain':!![]});if(_0x43e14e[_0x3e93('0xc3')]&&_0x43e14e[_0x3e93('0xc3')][_0x3e93('0x9d')]['length']){return _0x43e14e[_0x3e93('0xc3')][_0x3e93('0x9d')][0x0];}return db[_0x3e93('0x7a')][_0x3e93('0x5d')](_[_0x3e93('0x1a')](_0x229524[_0x3e93('0x5e')],{'firstName':_0x476ede,'mobile':_0x476ede,'phone':_0x476ede,'ListId':_0x43e14e[_0x3e93('0x80')]}));}})[_0x3e93('0x39')](handleEntityNotFound(_0x172ba6,null))[_0x3e93('0x39')](function(_0x5a099d){if(_0x5a099d){_0x16942b=_0x5a099d;return db[_0x3e93('0xbb')][_0x3e93('0x61')]({'where':{'ContactId':_0x16942b['id'],'closed':![],'SmsAccountId':_0x43e14e['id']}})[_0x3e93('0x39')](function(_0x417806){if(_0x417806){return[_0x417806,![]];}return db[_0x3e93('0xbb')][_0x3e93('0x5d')]({'UserId':_0x229524[_0x3e93('0x5f')]['id'],'ContactId':_0x16942b['id'],'SmsAccountId':_0x43e14e['id'],'phone':_0x476ede,'firstMsgDirection':_0x3e93('0xc4'),'Messages':[_[_0x3e93('0x5c')](_0x229524[_0x3e93('0x5e')],{'read':![],'body':_0x229524[_0x3e93('0x5e')][_0x3e93('0x5e')],'phone':_0x476ede,'SmsAccountId':_0x43e14e['id'],'UserId':_0x229524[_0x3e93('0x5f')]['id'],'ContactId':_0x16942b['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x3e93('0xc5')}]})[_0x3e93('0x39')](function(_0x593250){return[_0x593250,!![]];});});}})[_0x3e93('0x9f')](function(_0x9bac9b,_0x582534){if(_0x582534){return _0x9bac9b;}return db[_0x3e93('0xa6')]['create'](_['merge'](_0x229524[_0x3e93('0x5e')],{'read':![],'body':_0x229524[_0x3e93('0x5e')][_0x3e93('0x5e')],'phone':_0x476ede,'SmsAccountId':_0x43e14e['id'],'SmsInteractionId':_0x9bac9b['id'],'UserId':_0x229524[_0x3e93('0x5f')]['id'],'ContactId':_0x16942b['id']}))[_0x3e93('0x39')](function(_0x38cd16){_0x9bac9b[_0x3e93('0xc6')][_0x3e93('0xc5')]=[];_0x9bac9b['dataValues']['Messages']['push'](_0x38cd16[_0x3e93('0xc6')]);return _0x9bac9b;});})[_0x3e93('0x39')](respondWithResult(_0x172ba6,null))[_0x3e93('0x2c')](handleError(_0x172ba6,null));};exports[_0x3e93('0x2e')]=function(_0x5641be,_0x354bbf,_0x10eb63){if(_0x5641be[_0x3e93('0x5e')]['id']){delete _0x5641be[_0x3e93('0x5e')]['id'];}var _0xb9638a,_0x4134c0,_0xd215d8;return db[_0x3e93('0x44')]['find']({'where':{'id':_0x5641be[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x354bbf,null))[_0x3e93('0x39')](function(_0x31a124){if(_0x31a124){_0xd215d8=_0x31a124;logger[_0x3e93('0x24')](_0x3e93('0x25'),'status',_0x3e93('0xc7'),_0x31a124[_0x3e93('0x82')],util['inspect'](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));switch(_0x31a124[_0x3e93('0x82')]){case _0x3e93('0xc8'):if(_0x5641be[_0x3e93('0x5e')]['skebby_dispatch_id']&&_0x5641be[_0x3e93('0x5e')]['status']){_0x4134c0=_0x5641be[_0x3e93('0x5e')][_0x3e93('0x2e')];return db['SmsMessage'][_0x3e93('0x61')]({'where':{'messageId':_0x5641be[_0x3e93('0x5e')][_0x3e93('0xc9')]}});}break;case _0x3e93('0x89'):if(_0x5641be[_0x3e93('0x5e')][_0x3e93('0xca')]&&_0x5641be['body'][_0x3e93('0xcb')]){_0x4134c0=_0x5641be[_0x3e93('0x5e')]['statusInt'];return db[_0x3e93('0xa6')][_0x3e93('0x61')]({'where':{'messageId':_0x5641be[_0x3e93('0x5e')][_0x3e93('0xca')]}});}break;case'clicksend':if(_0x5641be[_0x3e93('0x5e')][_0x3e93('0x8a')]&&_0x5641be['body'][_0x3e93('0xcc')]){_0x4134c0=_0x5641be[_0x3e93('0x5e')]['status_code'];return db[_0x3e93('0xa6')][_0x3e93('0x61')]({'where':{'messageId':_0x5641be[_0x3e93('0x5e')]['message_id']}});}break;case'infobip':var _0x28b065=_0x5641be[_0x3e93('0x5e')][_0x3e93('0x8d')][0x0];if(_0x28b065[_0x3e93('0x86')]&&_0x28b065[_0x3e93('0x2e')][_0x3e93('0xcd')]===_0x3e93('0xce')){_0x4134c0=_0x28b065[_0x3e93('0x2e')][_0x3e93('0xcd')];return db['SmsMessage'][_0x3e93('0x61')]({'where':{'messageId':_0x28b065['messageId']}});}break;case _0x3e93('0x92'):if(_0x5641be[_0x3e93('0x5e')][_0x3e93('0x86')]&&_0x5641be['body'][_0x3e93('0x2e')]){_0x4134c0=_0x5641be[_0x3e93('0x5e')][_0x3e93('0x2e')];return db[_0x3e93('0xa6')]['find']({'where':{'messageId':_0x5641be[_0x3e93('0x5e')][_0x3e93('0x86')]}});}break;case _0x3e93('0x94'):if(_0x5641be[_0x3e93('0x5e')][0x0]['message']['id']){_0x4134c0=_0x5641be['body'][0x0]['type'];return db['SmsMessage']['find']({'where':{'messageId':_0x5641be[_0x3e93('0x5e')][0x0][_0x3e93('0x2a')]['id']}});}break;case _0x3e93('0x95'):if(_0x5641be[_0x3e93('0x5e')][_0x3e93('0xcf')]&&_0x5641be[_0x3e93('0x5e')][_0x3e93('0x2e')]){_0x4134c0=_0x5641be['body'][_0x3e93('0x2e')];return db['SmsMessage'][_0x3e93('0x61')]({'where':{'messageId':_0x5641be[_0x3e93('0x5e')][_0x3e93('0xcf')]}});}break;}}})[_0x3e93('0x39')](handleEntityNotFound(_0x354bbf,null))['then'](function(_0x2dda6d){if(_0x2dda6d){_0xb9638a=_0x2dda6d;switch(_0xd215d8['type']){case'skebby':if(_0x4134c0===_0x3e93('0xce')){return _0xb9638a[_0x3e93('0x38')]({'read':!![]});}else{logger[_0x3e93('0x27')](_0x3e93('0x25'),_0x3e93('0x2e'),_0x3e93('0xc8'),util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x3e93('0x89'):if(_0x4134c0==='1'){return _0xb9638a[_0x3e93('0x38')]({'read':!![]});}else{logger[_0x3e93('0x27')](_0x3e93('0x25'),_0x3e93('0x2e'),_0x3e93('0xc8'),util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x3e93('0xd1'):if(!_0x5641be['body'][_0x3e93('0xd2')]&&_0x4134c0>=0xc8&&_0x4134c0<=0xce){return _0xb9638a[_0x3e93('0x38')]({'read':!![]});}else{logger['error'](_0x3e93('0x25'),'status',_0x3e93('0xd1'),util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5088f7=_0x5641be[_0x3e93('0x5e')]['results'][0x0];if(_0x5088f7['status'][_0x3e93('0xcd')]===_0x3e93('0xce')){return _0xb9638a[_0x3e93('0x38')]({'read':!![]});}else{logger[_0x3e93('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x3e93('0x92'):if(_0x4134c0==_0x3e93('0xd3')||_0x4134c0==_0x3e93('0xd4')){return _0xb9638a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3e93('0x2e'),'clickatell',util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x4134c0=='message-delivered'){return _0xb9638a[_0x3e93('0x38')]({'read':!![]});}else{logger['error'](_0x3e93('0x25'),'status',_0x3e93('0x94'),util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4134c0===_0x3e93('0xd5')||_0x4134c0===_0x3e93('0xd6')){return _0xb9638a[_0x3e93('0x38')]({'read':!![]});}else{logger[_0x3e93('0x27')](_0x3e93('0x25'),_0x3e93('0x2e'),_0x3e93('0x95'),util[_0x3e93('0xd0')](_0x5641be[_0x3e93('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0xb9638a;}})[_0x3e93('0x39')](respondWithResult(_0x354bbf,null))[_0x3e93('0x2c')](handleError(_0x354bbf,null));};exports[_0x3e93('0xd7')]=function(_0xce9d5,_0x18c69e,_0x542d3d){var _0xdc4410,_0x569312,_0x275547;return db[_0x3e93('0x44')][_0x3e93('0x61')]({'where':{'id':_0xce9d5[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x18c69e,null))['then'](function(_0x4d3013){if(_0x4d3013){_0x275547=_0x4d3013;logger['debug'](_0x3e93('0x25'),_0x3e93('0x2e'),'received\x20delivery\x20report\x20from',_0x4d3013[_0x3e93('0x82')],util[_0x3e93('0xd0')](_0xce9d5[_0x3e93('0x49')],{'showHidden':![],'depth':null}));switch(_0x4d3013[_0x3e93('0x82')]){case'csc':if(_0xce9d5[_0x3e93('0x49')][_0x3e93('0xd8')]&&_0xce9d5['query'][_0x3e93('0xd9')]){_0x569312=_0xce9d5[_0x3e93('0x49')]['state'];return db[_0x3e93('0xa6')]['find']({'where':{'messageId':_0xce9d5[_0x3e93('0x49')][_0x3e93('0xd8')]}});}break;}}})[_0x3e93('0x39')](handleEntityNotFound(_0x18c69e,null))['then'](function(_0x508e43){if(_0x508e43){_0xdc4410=_0x508e43;switch(_0x275547[_0x3e93('0x82')]){case _0x3e93('0x8f'):if(_0x569312==='2'||_0x569312==='6'){return _0xdc4410['update']({'read':!![]});}else{logger[_0x3e93('0x27')](_0x3e93('0x25'),_0x3e93('0x2e'),'csc',util[_0x3e93('0xd0')](_0xce9d5[_0x3e93('0x49')],{'showHidden':![],'depth':null}));};break;}return _0xdc4410;}})[_0x3e93('0x39')](respondWithResult(_0x18c69e,null))['catch'](handleError(_0x18c69e,null));};exports[_0x3e93('0xda')]=function(_0x6e8b44,_0x5b0f6f,_0x26a641){return db['SmsAccount'][_0x3e93('0x61')]({'where':{'id':_0x6e8b44[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x5b0f6f,null))['then'](function(_0x1cdf80){if(_0x1cdf80){return _0x1cdf80[_0x3e93('0xda')](_0x6e8b44[_0x3e93('0x5e')][_0x3e93('0x6d')],_[_0x3e93('0xdb')](_0x6e8b44['body'],['ids','id'])||{})[_0x3e93('0x9f')](function(_0x42082e){for(var _0x2d0965=0x0;_0x2d0965<_0x6e8b44[_0x3e93('0x5e')][_0x3e93('0x6d')]['length'];_0x2d0965+=0x1){socket[_0x3e93('0xdc')](_0x3e93('0xdd'),{'UserId':Number(_0x6e8b44['body'][_0x3e93('0x6d')][_0x2d0965]),'SmsAccountId':Number(_0x6e8b44['params']['id'])});}return _0x42082e;});}})[_0x3e93('0x39')](respondWithResult(_0x5b0f6f,null))['catch'](handleError(_0x5b0f6f,null));};exports[_0x3e93('0xde')]=function(_0x2d5263,_0x5a2f56,_0x18fff2){return db['SmsAccount']['find']({'where':{'id':_0x2d5263[_0x3e93('0x5b')]['id']}})[_0x3e93('0x39')](handleEntityNotFound(_0x5a2f56,null))[_0x3e93('0x39')](function(_0x2d8951){if(_0x2d8951){return _0x2d8951[_0x3e93('0xde')](_0x2d5263['query'][_0x3e93('0x6d')])[_0x3e93('0x39')](function(){if(_[_0x3e93('0xdf')](_0x2d5263[_0x3e93('0x49')][_0x3e93('0x6d')])){for(var _0x7fdef3=0x0;_0x7fdef3<_0x2d5263[_0x3e93('0x49')][_0x3e93('0x6d')]['length'];_0x7fdef3+=0x1){socket[_0x3e93('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x2d5263[_0x3e93('0x49')][_0x3e93('0x6d')][_0x7fdef3]),'SmsAccountId':Number(_0x2d5263[_0x3e93('0x5b')]['id'])});}}else{socket['emit'](_0x3e93('0xe0'),{'UserId':Number(_0x2d5263[_0x3e93('0x49')][_0x3e93('0x6d')]),'SmsAccountId':Number(_0x2d5263[_0x3e93('0x5b')]['id'])});}});}})[_0x3e93('0x39')](respondWithStatusCode(_0x5a2f56,null))['catch'](handleError(_0x5a2f56,null));};exports[_0x3e93('0xe1')]=function(_0x3edec0,_0x1e4397,_0x1331a5){var _0x444777={};var _0x1a210f={};var _0x461cda;var _0x159134;return db[_0x3e93('0x44')][_0x3e93('0x69')]({'where':{'id':_0x3edec0['params']['id']}})['then'](handleEntityNotFound(_0x1e4397,null))['then'](function(_0x2cb89d){if(_0x2cb89d){_0x461cda=_0x2cb89d;_0x1a210f[_0x3e93('0x48')]=_[_0x3e93('0x4a')](db['User'][_0x3e93('0x45')]);_0x1a210f['query']=_[_0x3e93('0x4a')](_0x3edec0[_0x3e93('0x49')]);_0x1a210f[_0x3e93('0x4b')]=_[_0x3e93('0x4c')](_0x1a210f[_0x3e93('0x48')],_0x1a210f[_0x3e93('0x49')]);_0x444777['attributes']=_['intersection'](_0x1a210f[_0x3e93('0x48')],qs[_0x3e93('0x4e')](_0x3edec0['query'][_0x3e93('0x4e')]));_0x444777['attributes']=_0x444777[_0x3e93('0x4d')][_0x3e93('0x4f')]?_0x444777[_0x3e93('0x4d')]:_0x1a210f[_0x3e93('0x48')];_0x444777[_0x3e93('0x52')]=qs['sort'](_0x3edec0[_0x3e93('0x49')][_0x3e93('0x6a')]);_0x444777[_0x3e93('0x53')]=qs[_0x3e93('0x4b')](_[_0x3e93('0x54')](_0x3edec0[_0x3e93('0x49')],_0x1a210f['filters']));if(_0x3edec0[_0x3e93('0x49')][_0x3e93('0x56')]){_0x444777['where']=_[_0x3e93('0x5c')](_0x444777['where'],{'$or':_['map'](_0x444777['attributes'],function(_0x20b45b){var _0x1f82c0={};_0x1f82c0[_0x20b45b]={'$like':'%'+_0x3edec0[_0x3e93('0x49')][_0x3e93('0x56')]+'%'};return _0x1f82c0;})});}_0x444777=_['merge']({},_0x444777,_0x3edec0[_0x3e93('0x57')]);return _0x461cda[_0x3e93('0xe1')](_0x444777);}})[_0x3e93('0x39')](function(_0x1d72e3){if(_0x1d72e3){_0x159134=_0x1d72e3[_0x3e93('0x4f')];if(!_0x3edec0[_0x3e93('0x49')]['hasOwnProperty'](_0x3e93('0x51'))){_0x444777[_0x3e93('0x32')]=qs[_0x3e93('0x32')](_0x3edec0[_0x3e93('0x49')]['limit']);_0x444777[_0x3e93('0x34')]=qs['offset'](_0x3edec0['query'][_0x3e93('0x34')]);}return _0x461cda[_0x3e93('0xe1')](_0x444777);}})[_0x3e93('0x39')](function(_0x446c29){if(_0x446c29){return _0x446c29?{'count':_0x159134,'rows':_0x446c29}:null;}})['then'](respondWithResult(_0x1e4397,null))[_0x3e93('0x2c')](handleError(_0x1e4397,null));}; \ No newline at end of file +var _0xda26=['body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','send','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','ListId','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','bandwidth','redif','DELIVERED','error_code','infobip','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/license/hardware','../../config/logger','api','redis','socket.io-emitter','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','mandatoryDispositionPause','intersection','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','sort','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','MessageUUID','results','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid'];(function(_0x4ede0e,_0x2a6f5f){var _0x1bb017=function(_0x3d4143){while(--_0x3d4143){_0x4ede0e['push'](_0x4ede0e['shift']());}};_0x1bb017(++_0x2a6f5f);}(_0xda26,0x139));var _0x6da2=function(_0x155b89,_0x36d13a){_0x155b89=_0x155b89-0x0;var _0x431b0c=_0xda26[_0x155b89];return _0x431b0c;};'use strict';var emlformat=require(_0x6da2('0x0'));var rimraf=require(_0x6da2('0x1'));var zipdir=require(_0x6da2('0x2'));var jsonpatch=require(_0x6da2('0x3'));var rp=require(_0x6da2('0x4'));var moment=require(_0x6da2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6da2('0x6'));var util=require(_0x6da2('0x7'));var path=require(_0x6da2('0x8'));var sox=require(_0x6da2('0x9'));var csv=require('to-csv');var ejs=require(_0x6da2('0xa'));var fs=require('fs');var fs_extra=require(_0x6da2('0xb'));var _=require(_0x6da2('0xc'));var squel=require(_0x6da2('0xd'));var crypto=require(_0x6da2('0xe'));var jsforce=require(_0x6da2('0xf'));var deskjs=require(_0x6da2('0x10'));var toCsv=require(_0x6da2('0x11'));var querystring=require(_0x6da2('0x12'));var Papa=require(_0x6da2('0x13'));var Redis=require(_0x6da2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x6da2('0x15'));var as=require(_0x6da2('0x16'));var hardwareService=require(_0x6da2('0x17'));var logger=require(_0x6da2('0x18'))(_0x6da2('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6da2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6da2('0x1b'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x6da2('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6da2('0x1d')][_0x6da2('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x448f23,_0x10aeff,_0x140dff,_0x4702a4){return new BPromise(function(_0x565d94,_0x1c5cf9){var _0x589017=_0x4702a4||client;return _0x589017[_0x6da2('0x1f')](_0x448f23,_0x140dff)['then'](function(_0x4f9a3a){logger[_0x6da2('0x20')](_0x6da2('0x21'),_0x10aeff,'request\x20sent');logger[_0x6da2('0x22')](_0x6da2('0x23'),_0x10aeff,_0x6da2('0x24'),JSON['stringify'](_0x4f9a3a));if(_0x4f9a3a[_0x6da2('0x25')]){if(_0x4f9a3a['error'][_0x6da2('0x26')]===0x1f4){logger[_0x6da2('0x25')]('SmsAccount,\x20%s,\x20%s',_0x10aeff,_0x4f9a3a[_0x6da2('0x25')][_0x6da2('0x27')]);return _0x1c5cf9(_0x4f9a3a[_0x6da2('0x25')][_0x6da2('0x27')]);}logger[_0x6da2('0x25')](_0x6da2('0x21'),_0x10aeff,_0x4f9a3a[_0x6da2('0x25')][_0x6da2('0x27')]);return _0x565d94(_0x4f9a3a['error'][_0x6da2('0x27')]);}else{logger[_0x6da2('0x20')](_0x6da2('0x21'),_0x10aeff,'request\x20sent');_0x565d94(_0x4f9a3a[_0x6da2('0x28')]['message']);}})[_0x6da2('0x29')](function(_0x30de5f){logger['error'](_0x6da2('0x21'),_0x10aeff,_0x30de5f);_0x1c5cf9(_0x30de5f);});});}function respondWithStatusCode(_0x30446b,_0x3eacee){_0x3eacee=_0x3eacee||0xcc;return function(_0x11393d){if(_0x11393d){return _0x30446b[_0x6da2('0x2a')](_0x3eacee);}return _0x30446b[_0x6da2('0x2b')](_0x3eacee)[_0x6da2('0x2c')]();};}function respondWithResult(_0xfcb988,_0x13d29b){_0x13d29b=_0x13d29b||0xc8;return function(_0x3926d9){if(_0x3926d9){return _0xfcb988[_0x6da2('0x2b')](_0x13d29b)['json'](_0x3926d9);}};}function respondWithFilteredResult(_0x4fe4ee,_0x3bfff4){return function(_0x1b7015){if(_0x1b7015){var _0x56e5b1=typeof _0x3bfff4[_0x6da2('0x2d')]===_0x6da2('0x2e')&&typeof _0x3bfff4[_0x6da2('0x2f')]===_0x6da2('0x2e');var _0x35eaa5=_0x1b7015['count'];var _0x16f55d=_0x56e5b1?0x0:_0x3bfff4[_0x6da2('0x2d')];var _0x319bfb=_0x56e5b1?_0x1b7015[_0x6da2('0x30')]:_0x3bfff4[_0x6da2('0x2d')]+_0x3bfff4['limit'];var _0x4e2edb;if(_0x319bfb>=_0x35eaa5){_0x319bfb=_0x35eaa5;_0x4e2edb=0xc8;}else{_0x4e2edb=0xce;}_0x4fe4ee['status'](_0x4e2edb);return _0x4fe4ee['set']('Content-Range',_0x16f55d+'-'+_0x319bfb+'/'+_0x35eaa5)[_0x6da2('0x31')](_0x1b7015);}return null;};}function patchUpdates(_0x3b176c){return function(_0x26fc55){try{jsonpatch['apply'](_0x26fc55,_0x3b176c,!![]);}catch(_0x155f38){return BPromise[_0x6da2('0x32')](_0x155f38);}return _0x26fc55[_0x6da2('0x33')]();};}function saveUpdates(_0xe30c14,_0x5456b3){return function(_0x47a971){if(_0x47a971){return _0x47a971[_0x6da2('0x34')](_0xe30c14)[_0x6da2('0x35')](function(_0x26ea7d){return _0x26ea7d;});}return null;};}function removeEntity(_0x4503b8,_0x1c3084){return function(_0x5a6c59){if(_0x5a6c59){return _0x5a6c59[_0x6da2('0x36')]()['then'](function(){var _0x21bea6=_0x5a6c59[_0x6da2('0x37')]({'plain':!![]});var _0x49a452=_0x6da2('0x38');return db[_0x6da2('0x39')]['destroy']({'where':{'type':_0x49a452,'resourceId':_0x21bea6['id']}})[_0x6da2('0x35')](function(){return _0x5a6c59;});})['then'](function(){_0x4503b8['status'](0xcc)[_0x6da2('0x2c')]();});}};}function handleEntityNotFound(_0x29c381,_0x4b7337){return function(_0x22e665){if(!_0x22e665){_0x29c381[_0x6da2('0x2a')](0x194);}return _0x22e665;};}function handleError(_0x51ec4a,_0x10f94c){_0x10f94c=_0x10f94c||0x1f4;return function(_0x12d2cf){logger[_0x6da2('0x25')](_0x12d2cf[_0x6da2('0x3a')]);if(_0x12d2cf[_0x6da2('0x3b')]){delete _0x12d2cf[_0x6da2('0x3b')];}_0x51ec4a[_0x6da2('0x2b')](_0x10f94c)['send'](_0x12d2cf);};}exports[_0x6da2('0x3c')]=function(_0x3f150f,_0x5d0e69){var _0x26dba6={'include':[{'model':db[_0x6da2('0x3d')],'as':'mandatoryDispositionPause'}]},_0x7bf858={},_0x4bc856={'count':0x0,'rows':[]};var _0x3ad87b=_[_0x6da2('0x3e')](db[_0x6da2('0x3f')][_0x6da2('0x40')],function(_0x3794e4){return{'name':_0x3794e4[_0x6da2('0x41')],'type':_0x3794e4[_0x6da2('0x42')][_0x6da2('0x43')]};});_0x7bf858[_0x6da2('0x44')]=_[_0x6da2('0x3e')](_0x3ad87b,'name');_0x7bf858[_0x6da2('0x45')]=_[_0x6da2('0x46')](_0x3f150f[_0x6da2('0x45')]);_0x7bf858[_0x6da2('0x47')]=_['intersection'](_0x7bf858['model'],_0x7bf858[_0x6da2('0x45')]);_0x26dba6[_0x6da2('0x48')]=_['intersection'](_0x7bf858['model'],qs[_0x6da2('0x49')](_0x3f150f['query'][_0x6da2('0x49')]));_0x26dba6[_0x6da2('0x48')]=_0x26dba6['attributes'][_0x6da2('0x4a')]?_0x26dba6[_0x6da2('0x48')]:_0x7bf858['model'];if(!_0x3f150f[_0x6da2('0x45')][_0x6da2('0x4b')](_0x6da2('0x4c'))){_0x26dba6[_0x6da2('0x2f')]=qs['limit'](_0x3f150f[_0x6da2('0x45')]['limit']);_0x26dba6['offset']=qs[_0x6da2('0x2d')](_0x3f150f['query'][_0x6da2('0x2d')]);}_0x26dba6[_0x6da2('0x4d')]=qs['sort'](_0x3f150f[_0x6da2('0x45')]['sort']);_0x26dba6[_0x6da2('0x4e')]=qs[_0x6da2('0x47')](_[_0x6da2('0x4f')](_0x3f150f[_0x6da2('0x45')],_0x7bf858[_0x6da2('0x47')]),_0x3ad87b);if(_0x3f150f[_0x6da2('0x45')][_0x6da2('0x50')]){_0x26dba6[_0x6da2('0x4e')]=_[_0x6da2('0x51')](_0x26dba6[_0x6da2('0x4e')],{'$or':_[_0x6da2('0x3e')](_0x3ad87b,function(_0x42eb9a){if(_0x42eb9a[_0x6da2('0x42')]!==_0x6da2('0x52')){var _0x3820a9={};_0x3820a9[_0x42eb9a['name']]={'$like':'%'+_0x3f150f[_0x6da2('0x45')][_0x6da2('0x50')]+'%'};return _0x3820a9;}})});}_0x26dba6=_['merge']({},_0x26dba6,_0x3f150f[_0x6da2('0x53')]);var _0x22417c={'where':_0x26dba6[_0x6da2('0x4e')]};return db[_0x6da2('0x3f')][_0x6da2('0x30')](_0x22417c)[_0x6da2('0x35')](function(_0x5bf3de){_0x4bc856[_0x6da2('0x30')]=_0x5bf3de;if(_0x3f150f[_0x6da2('0x45')]['includeAll']){_0x26dba6[_0x6da2('0x54')]=[{'all':!![]}];}return db[_0x6da2('0x3f')][_0x6da2('0x55')](_0x26dba6);})[_0x6da2('0x35')](function(_0x59ea24){_0x4bc856[_0x6da2('0x56')]=_0x59ea24;return _0x4bc856;})['then'](respondWithFilteredResult(_0x5d0e69,_0x26dba6))[_0x6da2('0x29')](handleError(_0x5d0e69,null));};exports[_0x6da2('0x57')]=function(_0x46d2de,_0x884e9b){var _0x1c30ea={'raw':![],'where':{'id':_0x46d2de[_0x6da2('0x58')]['id']},'include':[{'model':db[_0x6da2('0x3d')],'as':_0x6da2('0x59')}]},_0x5cb25d={};_0x5cb25d['model']=_[_0x6da2('0x46')](db[_0x6da2('0x3f')]['rawAttributes']);_0x5cb25d[_0x6da2('0x45')]=_[_0x6da2('0x46')](_0x46d2de[_0x6da2('0x45')]);_0x5cb25d[_0x6da2('0x47')]=_[_0x6da2('0x5a')](_0x5cb25d[_0x6da2('0x44')],_0x5cb25d[_0x6da2('0x45')]);_0x1c30ea[_0x6da2('0x48')]=_[_0x6da2('0x5a')](_0x5cb25d[_0x6da2('0x44')],qs[_0x6da2('0x49')](_0x46d2de[_0x6da2('0x45')]['fields']));_0x1c30ea[_0x6da2('0x48')]=_0x1c30ea[_0x6da2('0x48')][_0x6da2('0x4a')]?_0x1c30ea[_0x6da2('0x48')]:_0x5cb25d[_0x6da2('0x44')];if(_0x46d2de[_0x6da2('0x45')][_0x6da2('0x5b')]){_0x1c30ea[_0x6da2('0x54')]=[{'all':!![]}];}_0x1c30ea=_['merge']({},_0x1c30ea,_0x46d2de[_0x6da2('0x53')]);return db[_0x6da2('0x3f')]['find'](_0x1c30ea)[_0x6da2('0x35')](handleEntityNotFound(_0x884e9b,null))[_0x6da2('0x35')](respondWithResult(_0x884e9b,null))['catch'](handleError(_0x884e9b,null));};exports[_0x6da2('0x5c')]=function(_0x56a9d8,_0x4e4a29){return db['SmsAccount']['create'](_0x56a9d8[_0x6da2('0x5d')],{})[_0x6da2('0x35')](function(_0x44ffe1){var _0x30a2d4=_0x56a9d8[_0x6da2('0x5e')]['get']({'plain':!![]});if(!_0x30a2d4)throw new Error(_0x6da2('0x5f'));if(_0x30a2d4[_0x6da2('0x60')]===_0x6da2('0x5e')){var _0x1bd8d5=_0x44ffe1[_0x6da2('0x37')]({'plain':!![]});var _0x32a738='SmsAccounts';return db['UserProfileSection'][_0x6da2('0x61')]({'where':{'name':_0x32a738,'userProfileId':_0x30a2d4[_0x6da2('0x62')]},'raw':!![]})[_0x6da2('0x35')](function(_0x5edfe4){if(_0x5edfe4&&_0x5edfe4[_0x6da2('0x63')]===0x0){return db[_0x6da2('0x39')][_0x6da2('0x5c')]({'name':_0x1bd8d5[_0x6da2('0x3b')],'resourceId':_0x1bd8d5['id'],'type':_0x5edfe4['name'],'sectionId':_0x5edfe4['id']},{})[_0x6da2('0x35')](function(){return _0x44ffe1;});}else{return _0x44ffe1;}})[_0x6da2('0x29')](function(_0x1796f7){logger[_0x6da2('0x25')](_0x6da2('0x64'),_0x1796f7);throw _0x1796f7;});}return _0x44ffe1;})[_0x6da2('0x35')](respondWithResult(_0x4e4a29,0xc9))[_0x6da2('0x29')](handleError(_0x4e4a29,null));};exports['update']=function(_0x4b4292,_0x4f0573){if(_0x4b4292[_0x6da2('0x5d')]['id']){delete _0x4b4292[_0x6da2('0x5d')]['id'];}return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x4b4292[_0x6da2('0x58')]['id']},'include':[{'model':db[_0x6da2('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4f0573,null))[_0x6da2('0x35')](saveUpdates(_0x4b4292[_0x6da2('0x5d')],null))[_0x6da2('0x35')](respondWithResult(_0x4f0573,null))[_0x6da2('0x29')](handleError(_0x4f0573,null));};exports['destroy']=function(_0x5c715f,_0x1bea9e){return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x5c715f[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x1bea9e,null))[_0x6da2('0x35')](removeEntity(_0x1bea9e,null))[_0x6da2('0x29')](handleError(_0x1bea9e,null));};exports[_0x6da2('0x65')]=function(_0x33ff8a,_0x3f2ddc){return db[_0x6da2('0x3f')]['describe']()[_0x6da2('0x35')](respondWithResult(_0x3f2ddc,null))[_0x6da2('0x29')](handleError(_0x3f2ddc,null));};exports['addDisposition']=function(_0x1f376d,_0x1006f5,_0x43aee7){if(_0x1f376d['body']['id']){delete _0x1f376d[_0x6da2('0x5d')]['id'];}return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x1f376d[_0x6da2('0x58')]['id']}})['then'](handleEntityNotFound(_0x1006f5,null))[_0x6da2('0x35')](function(_0x4d02ee){if(_0x4d02ee){_0x1f376d[_0x6da2('0x5d')][_0x6da2('0x66')]=_0x4d02ee['id'];return db[_0x6da2('0x67')][_0x6da2('0x5c')](_0x1f376d[_0x6da2('0x5d')]);}})[_0x6da2('0x35')](respondWithResult(_0x1006f5,null))[_0x6da2('0x29')](handleError(_0x1006f5,null));};exports['getDispositions']=function(_0x107425,_0x270aae,_0x4af8d4){var _0x4ec3ee={'raw':![],'where':{}};var _0x3daaf6={};var _0x2a6120={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x107425[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x270aae,null))['then'](function(_0x499157){if(_0x499157){_0x3daaf6['model']=_[_0x6da2('0x46')](db[_0x6da2('0x67')][_0x6da2('0x40')]);_0x3daaf6[_0x6da2('0x45')]=_[_0x6da2('0x46')](_0x107425[_0x6da2('0x45')]);_0x3daaf6[_0x6da2('0x47')]=_['intersection'](_0x3daaf6['model'],_0x3daaf6[_0x6da2('0x45')]);_0x4ec3ee[_0x6da2('0x48')]=_['intersection'](_0x3daaf6[_0x6da2('0x44')],qs[_0x6da2('0x49')](_0x107425['query'][_0x6da2('0x49')]));_0x4ec3ee[_0x6da2('0x48')]=_0x4ec3ee[_0x6da2('0x48')][_0x6da2('0x4a')]?_0x4ec3ee[_0x6da2('0x48')]:_0x3daaf6[_0x6da2('0x44')];if(!_0x107425['query'][_0x6da2('0x4b')](_0x6da2('0x4c'))){_0x4ec3ee[_0x6da2('0x2f')]=qs['limit'](_0x107425[_0x6da2('0x45')][_0x6da2('0x2f')]);_0x4ec3ee[_0x6da2('0x2d')]=qs[_0x6da2('0x2d')](_0x107425[_0x6da2('0x45')]['offset']);}_0x4ec3ee[_0x6da2('0x4d')]=qs[_0x6da2('0x68')](_0x107425[_0x6da2('0x45')][_0x6da2('0x68')]);_0x4ec3ee[_0x6da2('0x4e')]=qs[_0x6da2('0x47')](_[_0x6da2('0x4f')](_0x107425[_0x6da2('0x45')],_0x3daaf6[_0x6da2('0x47')]));_0x4ec3ee[_0x6da2('0x4e')][_0x6da2('0x66')]=_0x499157['id'];if(_0x107425['query'][_0x6da2('0x50')]){_0x4ec3ee[_0x6da2('0x4e')]=_['merge'](_0x4ec3ee[_0x6da2('0x4e')],{'$or':_['map'](_0x4ec3ee[_0x6da2('0x48')],function(_0x7d8f67){var _0x3cc59a={};_0x3cc59a[_0x7d8f67]={'$like':'%'+_0x107425[_0x6da2('0x45')][_0x6da2('0x50')]+'%'};return _0x3cc59a;})});}_0x4ec3ee=_[_0x6da2('0x51')]({},_0x4ec3ee,_0x107425['options']);return db[_0x6da2('0x67')][_0x6da2('0x30')]({'where':_0x4ec3ee[_0x6da2('0x4e')]})['then'](function(_0x51d8bc){_0x2a6120[_0x6da2('0x30')]=_0x51d8bc;if(_0x107425['query']['includeAll']){_0x4ec3ee[_0x6da2('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x6da2('0x55')](_0x4ec3ee);})[_0x6da2('0x35')](function(_0x2b2f9c){_0x2a6120['rows']=_0x2b2f9c;return _0x2a6120;});}})[_0x6da2('0x35')](respondWithFilteredResult(_0x270aae,_0x4ec3ee))['catch'](handleError(_0x270aae,null));};exports[_0x6da2('0x69')]=function(_0x540b69,_0x1b2d3e,_0x1b0368){return db[_0x6da2('0x3f')]['find']({'where':{'id':_0x540b69[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x1b2d3e,null))[_0x6da2('0x35')](function(_0x10c791){if(_0x10c791){return _0x10c791[_0x6da2('0x69')](_0x540b69[_0x6da2('0x45')][_0x6da2('0x6a')]);}})['then'](respondWithStatusCode(_0x1b2d3e,null))[_0x6da2('0x29')](handleError(_0x1b2d3e,null));};exports['addAnswer']=function(_0xcd45,_0x2f1a,_0x47b86c){if(_0xcd45['body']['id']){delete _0xcd45[_0x6da2('0x5d')]['id'];}return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0xcd45[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x2f1a,null))[_0x6da2('0x35')](function(_0x528013){if(_0x528013){_0xcd45[_0x6da2('0x5d')][_0x6da2('0x66')]=_0x528013['id'];return db['CannedAnswer'][_0x6da2('0x5c')](_0xcd45[_0x6da2('0x5d')]);}})[_0x6da2('0x35')](respondWithResult(_0x2f1a,null))['catch'](handleError(_0x2f1a,null));};exports[_0x6da2('0x6b')]=function(_0x3ddad2,_0x4549a7,_0x44c970){var _0xae853a={'raw':![],'where':{}};var _0x547a0b={};var _0x403a15={'count':0x0,'rows':[]};return db[_0x6da2('0x3f')][_0x6da2('0x6c')]({'where':{'id':_0x3ddad2['params']['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x4549a7,null))['then'](function(_0x66df89){if(_0x66df89){_0x547a0b[_0x6da2('0x44')]=_[_0x6da2('0x46')](db[_0x6da2('0x6d')][_0x6da2('0x40')]);_0x547a0b['query']=_[_0x6da2('0x46')](_0x3ddad2[_0x6da2('0x45')]);_0x547a0b['filters']=_['intersection'](_0x547a0b['model'],_0x547a0b[_0x6da2('0x45')]);_0xae853a[_0x6da2('0x48')]=_[_0x6da2('0x5a')](_0x547a0b[_0x6da2('0x44')],qs[_0x6da2('0x49')](_0x3ddad2[_0x6da2('0x45')][_0x6da2('0x49')]));_0xae853a[_0x6da2('0x48')]=_0xae853a[_0x6da2('0x48')][_0x6da2('0x4a')]?_0xae853a[_0x6da2('0x48')]:_0x547a0b[_0x6da2('0x44')];if(!_0x3ddad2[_0x6da2('0x45')][_0x6da2('0x4b')](_0x6da2('0x4c'))){_0xae853a[_0x6da2('0x2f')]=qs[_0x6da2('0x2f')](_0x3ddad2[_0x6da2('0x45')]['limit']);_0xae853a['offset']=qs['offset'](_0x3ddad2[_0x6da2('0x45')][_0x6da2('0x2d')]);}_0xae853a[_0x6da2('0x4d')]=qs[_0x6da2('0x68')](_0x3ddad2['query']['sort']);_0xae853a[_0x6da2('0x4e')]=qs[_0x6da2('0x47')](_[_0x6da2('0x4f')](_0x3ddad2[_0x6da2('0x45')],_0x547a0b['filters']));_0xae853a[_0x6da2('0x4e')][_0x6da2('0x66')]=_0x66df89['id'];if(_0x3ddad2[_0x6da2('0x45')][_0x6da2('0x50')]){_0xae853a[_0x6da2('0x4e')]=_[_0x6da2('0x51')](_0xae853a[_0x6da2('0x4e')],{'$or':_[_0x6da2('0x3e')](_0xae853a[_0x6da2('0x48')],function(_0x486e58){var _0x32a60c={};_0x32a60c[_0x486e58]={'$like':'%'+_0x3ddad2[_0x6da2('0x45')][_0x6da2('0x50')]+'%'};return _0x32a60c;})});}_0xae853a=_[_0x6da2('0x51')]({},_0xae853a,_0x3ddad2[_0x6da2('0x53')]);return db[_0x6da2('0x6d')][_0x6da2('0x30')]({'where':_0xae853a[_0x6da2('0x4e')]})['then'](function(_0x1607b6){_0x403a15[_0x6da2('0x30')]=_0x1607b6;if(_0x3ddad2[_0x6da2('0x45')][_0x6da2('0x5b')]){_0xae853a[_0x6da2('0x54')]=[{'all':!![]}];}return db[_0x6da2('0x6d')][_0x6da2('0x55')](_0xae853a);})[_0x6da2('0x35')](function(_0x48e3e9){_0x403a15[_0x6da2('0x56')]=_0x48e3e9;return _0x403a15;});}})['then'](respondWithFilteredResult(_0x4549a7,_0xae853a))['catch'](handleError(_0x4549a7,null));};exports[_0x6da2('0x6e')]=function(_0x2683e0,_0x6e510e,_0x47a75c){return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x2683e0[_0x6da2('0x58')]['id']}})['then'](handleEntityNotFound(_0x6e510e,null))[_0x6da2('0x35')](function(_0x46dacf){if(_0x46dacf){return _0x46dacf[_0x6da2('0x6e')](_0x2683e0[_0x6da2('0x45')]['ids']);}})[_0x6da2('0x35')](respondWithStatusCode(_0x6e510e,null))[_0x6da2('0x29')](handleError(_0x6e510e,null));};exports[_0x6da2('0x6f')]=function(_0x1a88da,_0x49fb4e,_0x270ca7){var _0x2a3d38={'channel':_0x6da2('0x70')};var _0xbd5e03=[];var _0x2726c7=[];var _0x50cfb0={};return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x1a88da[_0x6da2('0x58')]['id']},'include':[{'model':db[_0x6da2('0x71')],'as':_0x6da2('0x72')}]})[_0x6da2('0x35')](handleEntityNotFound(_0x49fb4e,null))[_0x6da2('0x35')](function(_0x1260a1){_0x2a3d38[_0x6da2('0x73')]=_0x1260a1;_0x2a3d38[_0x6da2('0x74')]=_[_0x6da2('0x75')](_0x1260a1[_0x6da2('0x72')],[_0x6da2('0x76')],[_0x6da2('0x77')]);if(_0x2a3d38[_0x6da2('0x73')]['Applications']){delete _0x2a3d38[_0x6da2('0x73')]['Applications'];}return db[_0x6da2('0x78')][_0x6da2('0x65')]();})[_0x6da2('0x35')](function(_0x14b333){if(!_0x14b333){throw new db[(_0x6da2('0x79'))][(_0x6da2('0x7a'))](_0x6da2('0x7b'));}_0xbd5e03=_['difference'](_['keys'](_0x14b333),[_0x6da2('0x7c'),'updatedAt']);_0x2726c7=_[_0x6da2('0x7d')](_[_0x6da2('0x46')](_0x14b333),[_0x6da2('0x7c'),_0x6da2('0x7e'),_0x6da2('0x7f'),'ListId']);_0x2a3d38['body']={'mapKey':_0x6da2('0x80')};if(_0x2a3d38[_0x6da2('0x73')][_0x6da2('0x42')]){switch(_0x2a3d38[_0x6da2('0x73')][_0x6da2('0x42')]){case _0x6da2('0x81'):_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x82')]=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x83')];_0x2a3d38['body'][_0x6da2('0x5d')]=_0x1a88da['body'][_0x6da2('0x84')];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x85')]=_0x1a88da['body'][_0x6da2('0x86')];break;case _0x6da2('0x87'):_0x2a3d38['body'][_0x6da2('0x82')]='+'+_0x1a88da[_0x6da2('0x5d')]['sender'];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x5d')]=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x88')];break;case _0x6da2('0x89'):_0x2a3d38[_0x6da2('0x5d')]['from']=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x82')];_0x2a3d38[_0x6da2('0x5d')]['body']=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x27')];break;case _0x6da2('0x8a'):_0x2a3d38[_0x6da2('0x5d')]['from']=_0x1a88da['body'][_0x6da2('0x82')];_0x2a3d38[_0x6da2('0x5d')]['body']=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x5d')];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x85')]=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x8b')];break;case _0x6da2('0x8c'):_0x2a3d38[_0x6da2('0x5d')]['from']=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x83')];_0x2a3d38[_0x6da2('0x5d')]['body']=_0x1a88da['body']['Text'];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x85')]=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x8d')];break;case'infobip':_0x2a3d38['body'][_0x6da2('0x82')]='+'+_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x8e')][0x0][_0x6da2('0x82')];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x5d')]=_0x1a88da['body'][_0x6da2('0x8e')][0x0][_0x6da2('0x88')];_0x2a3d38[_0x6da2('0x5d')]['messageId']=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x8e')][0x0]['messageId'];break;case'csc':_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x82')]=_0x1a88da['body'][_0x6da2('0x8f')];_0x2a3d38[_0x6da2('0x5d')]['body']=_0x1a88da['body'][_0x6da2('0x90')][_0x6da2('0x27')];break;case _0x6da2('0x91'):_0x2a3d38['body']['from']=_0x1a88da[_0x6da2('0x5d')]['fromNumber'];_0x2a3d38[_0x6da2('0x5d')]['body']=_0x1a88da[_0x6da2('0x5d')]['text'];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x85')]=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x92')];break;case'bandwidth':_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x85')]=_0x1a88da[_0x6da2('0x5d')][0x0]['message']['id'];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x82')]=_0x1a88da['body'][0x0][_0x6da2('0x27')][_0x6da2('0x82')];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x5d')]=_0x1a88da[_0x6da2('0x5d')][0x0][_0x6da2('0x27')][_0x6da2('0x88')];break;case _0x6da2('0x93'):_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x82')]=_0x1a88da['body'][_0x6da2('0x82')];_0x2a3d38[_0x6da2('0x5d')]['body']=_0x1a88da[_0x6da2('0x5d')][_0x6da2('0x27')];_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x85')]=_0x1a88da['body'][_0x6da2('0x94')];break;}}if(_0x2a3d38['body']['id']){delete _0x2a3d38['body']['id'];}if(_['isNil'](_0x2a3d38['body'][_0x6da2('0x82')])){throw new db[(_0x6da2('0x79'))][(_0x6da2('0x7a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2a3d38['body'][_0x6da2('0x5d')])||_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x5d')]===''){throw new db[(_0x6da2('0x79'))][(_0x6da2('0x7a'))](_0x6da2('0x95'));}if(_[_0x6da2('0x96')](_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x97')])){throw new db['Sequelize']['ValidationError'](_0x6da2('0x98')+_0x2726c7);}if(!_[_0x6da2('0x99')](_0x2726c7,_0x2a3d38['body'][_0x6da2('0x97')])){throw new db['Sequelize'][(_0x6da2('0x7a'))](_0x6da2('0x9a')+_0x2726c7);}_0x50cfb0[_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x97')]]=_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x82')];return db[_0x6da2('0x9b')][_0x6da2('0x61')]({'where':{'id':_0x2a3d38[_0x6da2('0x73')]['ListId']},'include':[{'model':db[_0x6da2('0x78')],'as':_0x6da2('0x9c'),'where':_0x50cfb0,'limit':0x1,'order':[[_0x6da2('0x7e'),_0x6da2('0x9d')]]}]});})[_0x6da2('0x35')](handleEntityNotFound(_0x49fb4e,null))[_0x6da2('0x35')](function(_0x55c01b){if(_0x55c01b){_0x2a3d38['list']=_[_0x6da2('0x9e')](_0x55c01b,[_0x6da2('0x9c')]);if(_0x55c01b['Contacts'][_0x6da2('0x4a')]){return _0x55c01b[_0x6da2('0x9c')][0x0];}var _0x1c1314=_[_0x6da2('0x9f')](_0x2a3d38['body'],{'firstName':_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x82')],'ListId':_0x55c01b['id']});_0x1c1314[_0x2a3d38[_0x6da2('0x5d')]['mapKey']]=_0x2a3d38['body'][_0x6da2('0x82')];return db[_0x6da2('0x78')][_0x6da2('0x5c')](_0x1c1314,{'fields':_0xbd5e03,'raw':!![]});}})[_0x6da2('0x35')](handleEntityNotFound(_0x49fb4e,null))['then'](function(_0x566967){if(_0x566967){_0x2a3d38[_0x6da2('0xa0')]=_0x566967;var _0x327b26={'ContactId':_0x566967['id'],'phone':_0x2a3d38['body'][_0x6da2('0x82')],'SmsAccountId':_0x1a88da['params']['id']};var _0x4cbdaf={'ContactId':_0x566967['id'],'SmsAccountId':_0x1a88da[_0x6da2('0x58')]['id'],'closed':![]};return db[_0x6da2('0xa1')][_0x6da2('0x61')]({'where':_0x4cbdaf})['then'](function(_0x5b7dfc){if(_0x5b7dfc){return[_0x5b7dfc,![]];}return db[_0x6da2('0xa1')]['create'](_0x327b26)[_0x6da2('0x35')](function(_0x4e407b){return[_0x4e407b,!![]];});});}})[_0x6da2('0xa2')](function(_0xd8d20c,_0x42f81e){_0x2a3d38[_0x6da2('0xa3')]=_0xd8d20c['get']({'plain':!![]});_0x2a3d38['interaction'][_0x6da2('0xa4')]=![];if(_0x42f81e){if(_0x2a3d38[_0x6da2('0x73')][_0x6da2('0xa5')]){_0x2a3d38[_0x6da2('0x74')]['push']({'id':0x0,'priority':_0x2a3d38['applications']['length']+0x1,'app':'close','appdata':_0x6da2('0xa6'),'interval':_0x6da2('0xa7')});}_0x2a3d38[_0x6da2('0xa3')][_0x6da2('0xa4')]=!![];}return db[_0x6da2('0xa8')][_0x6da2('0x5c')]({'phone':_0x2a3d38['body'][_0x6da2('0x82')],'messageId':_0x2a3d38[_0x6da2('0x5d')]['messageId'],'body':_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0x5d')],'SmsAccountId':_0x1a88da[_0x6da2('0x58')]['id'],'SmsInteractionId':_0xd8d20c['id'],'direction':'in','ContactId':_0xd8d20c[_0x6da2('0xa9')],'AttachmentId':_0x2a3d38[_0x6da2('0x5d')][_0x6da2('0xaa')]});})[_0x6da2('0x35')](function(_0x14c36f){_0x2a3d38[_0x6da2('0x27')]=_0x14c36f;if(_0x2a3d38[_0x6da2('0xa3')][_0x6da2('0xab')]){return db[_0x6da2('0xac')][_0x6da2('0x61')]({'attributes':['id',_0x6da2('0x3b')],'where':{'id':_0x2a3d38['interaction']['UserId']}})[_0x6da2('0x35')](function(_0x14c1d6){if(_0x14c1d6){_0x2a3d38[_0x6da2('0x74')][_0x6da2('0xad')]({'id':0x0,'priority':0x0,'app':_0x6da2('0xae'),'appdata':_0x14c1d6[_0x6da2('0x3b')]+','+(_0x2a3d38[_0x6da2('0x73')][_0x6da2('0xaf')]||0xa),'interval':_0x6da2('0xa7')});}return respondWithRpcPromise(_0x6da2('0xb0'),_0x6da2('0xb1'),_0x2a3d38);});}return respondWithRpcPromise('Start',_0x6da2('0xb1'),_0x2a3d38);})[_0x6da2('0x35')](function(_0x49b700){if(_0x49b700){var _0x1760d0=0xc8;var _0x5962b2=_0x6da2('0xb2');logger[_0x6da2('0x20')](_0x6da2('0x23'),_0x5962b2,_0x1760d0,_0x6da2('0xb3'));logger[_0x6da2('0x22')](_0x6da2('0xb4'),_0x5962b2,_0x1760d0,'entity\x20found',JSON[_0x6da2('0xb5')](_0x49b700));if(_0x2a3d38[_0x6da2('0x73')]['type']==='twilio'){return _0x49fb4e['status'](_0x1760d0)[_0x6da2('0xb6')]('Content-Type','text/xml')[_0x6da2('0xb7')](_0x6da2('0xb8'));}else{return _0x49fb4e[_0x6da2('0x2b')](_0x1760d0)[_0x6da2('0x31')](_0x49b700);}}})[_0x6da2('0x29')](handleError(_0x49fb4e,null));};exports[_0x6da2('0xb9')]=function(_0x2b7df3,_0x584024,_0x383118){return db[_0x6da2('0x3f')][_0x6da2('0x6c')]({'where':{'id':_0x2b7df3[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x584024,null))[_0x6da2('0x35')](function(_0x4eea74){if(_0x4eea74){return db[_0x6da2('0xba')][_0x6da2('0xbb')](function(_0x52f3d0){return db[_0x6da2('0x71')][_0x6da2('0x36')]({'where':{'SmsAccountId':_0x2b7df3[_0x6da2('0x58')]['id']},'transaction':_0x52f3d0})[_0x6da2('0x35')](function(_0x2bcfd9){var _0xeb3e32=_[_0x6da2('0x3e')](_0x2b7df3['body'],function(_0x3c2600){_0x3c2600[_0x6da2('0x66')]=_0x2b7df3[_0x6da2('0x58')]['id'];return _0x3c2600;});return db[_0x6da2('0x71')][_0x6da2('0xbc')](_0xeb3e32,{'transaction':_0x52f3d0});});})['then'](function(){return db['SmsApplication'][_0x6da2('0xbd')]({'where':{'SmsAccountId':_0x2b7df3['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x584024,null))[_0x6da2('0x29')](handleError(_0x584024,null));};exports[_0x6da2('0xbe')]=function(_0x3510b1,_0x3df531,_0x3ab062){var _0x3593e7={};var _0x16323a={};var _0x19c64a;var _0x1087f8;return db[_0x6da2('0x3f')][_0x6da2('0x6c')]({'where':{'id':_0x3510b1['params']['id']}})['then'](handleEntityNotFound(_0x3df531,null))[_0x6da2('0x35')](function(_0x1808e6){if(_0x1808e6){_0x19c64a=_0x1808e6;_0x16323a[_0x6da2('0x44')]=_[_0x6da2('0x46')](db[_0x6da2('0x71')][_0x6da2('0x40')]);_0x16323a[_0x6da2('0x45')]=_[_0x6da2('0x46')](_0x3510b1[_0x6da2('0x45')]);_0x16323a['filters']=_[_0x6da2('0x5a')](_0x16323a[_0x6da2('0x44')],_0x16323a[_0x6da2('0x45')]);_0x3593e7[_0x6da2('0x48')]=_[_0x6da2('0x5a')](_0x16323a[_0x6da2('0x44')],qs[_0x6da2('0x49')](_0x3510b1[_0x6da2('0x45')][_0x6da2('0x49')]));_0x3593e7[_0x6da2('0x48')]=_0x3593e7['attributes'][_0x6da2('0x4a')]?_0x3593e7[_0x6da2('0x48')]:_0x16323a['model'];_0x3593e7[_0x6da2('0x4d')]=qs[_0x6da2('0x68')](_0x3510b1[_0x6da2('0x45')]['sort']);_0x3593e7[_0x6da2('0x4e')]=qs[_0x6da2('0x47')](_['pick'](_0x3510b1[_0x6da2('0x45')],_0x16323a[_0x6da2('0x47')]));if(_0x3510b1[_0x6da2('0x45')][_0x6da2('0x50')]){_0x3593e7[_0x6da2('0x4e')]=_[_0x6da2('0x51')](_0x3593e7[_0x6da2('0x4e')],{'$or':_[_0x6da2('0x3e')](_0x3593e7[_0x6da2('0x48')],function(_0x35376b){var _0x2b37a8={};_0x2b37a8[_0x35376b]={'$like':'%'+_0x3510b1[_0x6da2('0x45')][_0x6da2('0x50')]+'%'};return _0x2b37a8;})});}_0x3593e7=_[_0x6da2('0x51')]({},_0x3593e7,_0x3510b1[_0x6da2('0x53')]);return _0x19c64a[_0x6da2('0xbe')](_0x3593e7);}})['then'](function(_0x1afb12){if(_0x1afb12){_0x1087f8=_0x1afb12[_0x6da2('0x4a')];if(!_0x3510b1['query']['hasOwnProperty'](_0x6da2('0x4c'))){_0x3593e7[_0x6da2('0x2f')]=qs[_0x6da2('0x2f')](_0x3510b1[_0x6da2('0x45')][_0x6da2('0x2f')]);_0x3593e7[_0x6da2('0x2d')]=qs[_0x6da2('0x2d')](_0x3510b1['query'][_0x6da2('0x2d')]);}return _0x19c64a['getApplications'](_0x3593e7);}})['then'](function(_0x43e028){if(_0x43e028){return _0x43e028?{'count':_0x1087f8,'rows':_0x43e028}:null;}})['then'](respondWithResult(_0x3df531,null))['catch'](handleError(_0x3df531,null));};exports[_0x6da2('0xbf')]=function(_0x4cb963,_0x5898b1,_0x421643){var _0x17cb61={'raw':![],'where':{}};var _0x50f9f1={};var _0x375234={'count':0x0,'rows':[]};return db[_0x6da2('0x3f')][_0x6da2('0x6c')]({'where':{'id':_0x4cb963[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x5898b1,null))[_0x6da2('0x35')](function(_0x72f548){if(_0x72f548){_0x50f9f1[_0x6da2('0x44')]=_[_0x6da2('0x46')](db[_0x6da2('0xa1')][_0x6da2('0x40')]);_0x50f9f1[_0x6da2('0x45')]=_['keys'](_0x4cb963[_0x6da2('0x45')]);_0x50f9f1[_0x6da2('0x47')]=_[_0x6da2('0x5a')](_0x50f9f1['model'],_0x50f9f1['query']);_0x17cb61[_0x6da2('0x48')]=_[_0x6da2('0x5a')](_0x50f9f1[_0x6da2('0x44')],qs[_0x6da2('0x49')](_0x4cb963[_0x6da2('0x45')][_0x6da2('0x49')]));_0x17cb61['attributes']=_0x17cb61['attributes'][_0x6da2('0x4a')]?_0x17cb61[_0x6da2('0x48')]:_0x50f9f1[_0x6da2('0x44')];if(!_0x4cb963[_0x6da2('0x45')][_0x6da2('0x4b')](_0x6da2('0x4c'))){_0x17cb61[_0x6da2('0x2f')]=qs[_0x6da2('0x2f')](_0x4cb963['query'][_0x6da2('0x2f')]);_0x17cb61['offset']=qs[_0x6da2('0x2d')](_0x4cb963[_0x6da2('0x45')]['offset']);}_0x17cb61[_0x6da2('0x4d')]=qs['sort'](_0x4cb963[_0x6da2('0x45')][_0x6da2('0x68')]);_0x17cb61['where']=qs[_0x6da2('0x47')](_[_0x6da2('0x4f')](_0x4cb963[_0x6da2('0x45')],_0x50f9f1[_0x6da2('0x47')]));_0x17cb61[_0x6da2('0x4e')][_0x6da2('0x66')]=_0x72f548['id'];if(_0x4cb963[_0x6da2('0x45')][_0x6da2('0x50')]){_0x17cb61[_0x6da2('0x4e')]=_['merge'](_0x17cb61[_0x6da2('0x4e')],{'$or':_[_0x6da2('0x3e')](_0x17cb61[_0x6da2('0x48')],function(_0x36f237){var _0xae02d1={};_0xae02d1[_0x36f237]={'$like':'%'+_0x4cb963[_0x6da2('0x45')][_0x6da2('0x50')]+'%'};return _0xae02d1;})});}_0x17cb61=_[_0x6da2('0x51')]({},_0x17cb61,_0x4cb963['options']);return db[_0x6da2('0xa1')][_0x6da2('0x30')]({'where':_0x17cb61[_0x6da2('0x4e')]})['then'](function(_0x41d242){_0x375234['count']=_0x41d242;if(_0x4cb963[_0x6da2('0x45')][_0x6da2('0x5b')]){_0x17cb61[_0x6da2('0x54')]=[{'model':db[_0x6da2('0x78')],'as':_0x6da2('0xc0'),'required':![]},{'model':db[_0x6da2('0xac')],'as':_0x6da2('0xc1'),'attributes':[_0x6da2('0x3b'),_0x6da2('0xc2'),_0x6da2('0xc3')],'required':![]},{'model':db[_0x6da2('0xc4')],'as':_0x6da2('0xc5'),'attributes':['id',_0x6da2('0x3b'),_0x6da2('0xc6')],'where':_0x4cb963[_0x6da2('0x45')][_0x6da2('0xc7')]?{'id':_0x4cb963[_0x6da2('0x45')][_0x6da2('0xc7')]}:undefined,'required':_0x4cb963[_0x6da2('0x45')][_0x6da2('0xc7')]?!![]:![]}];}return db['SmsInteraction'][_0x6da2('0x55')](_0x17cb61);})[_0x6da2('0x35')](function(_0x61c69e){_0x375234[_0x6da2('0x56')]=_0x61c69e;return _0x375234;});}})[_0x6da2('0x35')](respondWithFilteredResult(_0x5898b1,_0x17cb61))[_0x6da2('0x29')](handleError(_0x5898b1,null));};exports['send']=function(_0x50bc15,_0xda67a6,_0x5070fd){var _0x12103e,_0x37fe56,_0x29fa7b;if(_[_0x6da2('0x96')](_0x50bc15[_0x6da2('0x5d')][_0x6da2('0x5d')])||_0x50bc15[_0x6da2('0x5d')]['body']===''){throw new db[(_0x6da2('0x79'))][(_0x6da2('0x7a'))](_0x6da2('0x95'));}if(_[_0x6da2('0x96')](_0x50bc15[_0x6da2('0x5d')]['to'])){throw new db[(_0x6da2('0x79'))][(_0x6da2('0x7a'))]('to\x20is\x20mandatory');}_0x12103e=_0x50bc15[_0x6da2('0x5d')]['to'];return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x50bc15[_0x6da2('0x58')]['id']},'include':[{'model':db[_0x6da2('0x9b')],'as':'List','include':[{'model':db[_0x6da2('0x78')],'as':'Contacts','where':{'mobile':_0x12103e},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x6da2('0x35')](handleEntityNotFound(_0xda67a6,null))[_0x6da2('0x35')](function(_0x3f3542){if(_0x3f3542&&_0x3f3542[_0x6da2('0xc8')]){_0x37fe56=_0x3f3542[_0x6da2('0x37')]({'plain':!![]});if(_0x37fe56['List']&&_0x37fe56['List'][_0x6da2('0x9c')][_0x6da2('0x4a')]){return _0x37fe56['List']['Contacts'][0x0];}return db[_0x6da2('0x78')][_0x6da2('0x5c')](_['defaults'](_0x50bc15[_0x6da2('0x5d')],{'firstName':_0x12103e,'mobile':_0x12103e,'phone':_0x12103e,'ListId':_0x37fe56[_0x6da2('0xc9')]}));}})['then'](handleEntityNotFound(_0xda67a6,null))[_0x6da2('0x35')](function(_0x1ea8f4){if(_0x1ea8f4){_0x29fa7b=_0x1ea8f4;return db[_0x6da2('0xa1')][_0x6da2('0x61')]({'where':{'ContactId':_0x29fa7b['id'],'closed':![],'SmsAccountId':_0x37fe56['id']}})[_0x6da2('0x35')](function(_0x1bb467){if(_0x1bb467){return[_0x1bb467,![]];}return db['SmsInteraction'][_0x6da2('0x5c')]({'UserId':_0x50bc15['user']['id'],'ContactId':_0x29fa7b['id'],'SmsAccountId':_0x37fe56['id'],'phone':_0x12103e,'firstMsgDirection':_0x6da2('0xca'),'Messages':[_['merge'](_0x50bc15[_0x6da2('0x5d')],{'read':![],'body':_0x50bc15['body']['body'],'phone':_0x12103e,'SmsAccountId':_0x37fe56['id'],'UserId':_0x50bc15[_0x6da2('0x5e')]['id'],'ContactId':_0x29fa7b['id']})]},{'include':[{'model':db[_0x6da2('0xa8')],'as':_0x6da2('0xcb')}]})['then'](function(_0x3d5175){return[_0x3d5175,!![]];});});}})[_0x6da2('0xa2')](function(_0x5beed2,_0x38727a){if(_0x38727a){return _0x5beed2;}return db[_0x6da2('0xa8')][_0x6da2('0x5c')](_[_0x6da2('0x51')](_0x50bc15[_0x6da2('0x5d')],{'read':![],'body':_0x50bc15['body'][_0x6da2('0x5d')],'phone':_0x12103e,'SmsAccountId':_0x37fe56['id'],'SmsInteractionId':_0x5beed2['id'],'UserId':_0x50bc15[_0x6da2('0x5e')]['id'],'ContactId':_0x29fa7b['id']}))[_0x6da2('0x35')](function(_0x598801){_0x5beed2['dataValues']['Messages']=[];_0x5beed2[_0x6da2('0xcc')][_0x6da2('0xcb')]['push'](_0x598801[_0x6da2('0xcc')]);return _0x5beed2;});})[_0x6da2('0x35')](respondWithResult(_0xda67a6,null))[_0x6da2('0x29')](handleError(_0xda67a6,null));};exports[_0x6da2('0x2b')]=function(_0x192c08,_0x841c60,_0x3c67ac){if(_0x192c08['body']['id']){delete _0x192c08[_0x6da2('0x5d')]['id'];}var _0x2bde41,_0x55ae15,_0x31af46;return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x192c08[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x841c60,null))[_0x6da2('0x35')](function(_0x28c684){if(_0x28c684){_0x31af46=_0x28c684;logger[_0x6da2('0x22')](_0x6da2('0x23'),'status',_0x6da2('0xcd'),_0x28c684[_0x6da2('0x42')],util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));switch(_0x28c684[_0x6da2('0x42')]){case'skebby':if(_0x192c08['body'][_0x6da2('0xcf')]&&_0x192c08[_0x6da2('0x5d')][_0x6da2('0x2b')]){_0x55ae15=_0x192c08[_0x6da2('0x5d')][_0x6da2('0x2b')];return db[_0x6da2('0xa8')][_0x6da2('0x61')]({'where':{'messageId':_0x192c08['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x192c08[_0x6da2('0x5d')][_0x6da2('0xd0')]&&_0x192c08[_0x6da2('0x5d')][_0x6da2('0xd1')]){_0x55ae15=_0x192c08[_0x6da2('0x5d')]['statusInt'];return db['SmsMessage'][_0x6da2('0x61')]({'where':{'messageId':_0x192c08[_0x6da2('0x5d')][_0x6da2('0xd0')]}});}break;case _0x6da2('0x8a'):if(_0x192c08[_0x6da2('0x5d')][_0x6da2('0x8b')]&&_0x192c08[_0x6da2('0x5d')]['status_code']){_0x55ae15=_0x192c08['body'][_0x6da2('0xd2')];return db[_0x6da2('0xa8')][_0x6da2('0x61')]({'where':{'messageId':_0x192c08[_0x6da2('0x5d')]['message_id']}});}break;case'infobip':var _0x207509=_0x192c08['body'][_0x6da2('0x8e')][0x0];if(_0x207509['messageId']&&_0x207509[_0x6da2('0x2b')]['groupName']==='DELIVERED'){_0x55ae15=_0x207509[_0x6da2('0x2b')][_0x6da2('0xd3')];return db['SmsMessage'][_0x6da2('0x61')]({'where':{'messageId':_0x207509[_0x6da2('0x85')]}});}break;case _0x6da2('0x91'):if(_0x192c08[_0x6da2('0x5d')]['messageId']&&_0x192c08['body'][_0x6da2('0x2b')]){_0x55ae15=_0x192c08['body'][_0x6da2('0x2b')];return db['SmsMessage']['find']({'where':{'messageId':_0x192c08['body'][_0x6da2('0x85')]}});}break;case _0x6da2('0xd4'):if(_0x192c08[_0x6da2('0x5d')][0x0][_0x6da2('0x27')]['id']){_0x55ae15=_0x192c08[_0x6da2('0x5d')][0x0][_0x6da2('0x42')];return db[_0x6da2('0xa8')][_0x6da2('0x61')]({'where':{'messageId':_0x192c08[_0x6da2('0x5d')][0x0][_0x6da2('0x27')]['id']}});}break;case'intelepeer':if(_0x192c08[_0x6da2('0x5d')][_0x6da2('0xd5')]&&_0x192c08[_0x6da2('0x5d')][_0x6da2('0x2b')]){_0x55ae15=_0x192c08[_0x6da2('0x5d')][_0x6da2('0x2b')];return db[_0x6da2('0xa8')]['find']({'where':{'messageId':_0x192c08[_0x6da2('0x5d')][_0x6da2('0xd5')]}});}break;}}})[_0x6da2('0x35')](handleEntityNotFound(_0x841c60,null))[_0x6da2('0x35')](function(_0x41d57a){if(_0x41d57a){_0x2bde41=_0x41d57a;switch(_0x31af46[_0x6da2('0x42')]){case _0x6da2('0x87'):if(_0x55ae15===_0x6da2('0xd6')){return _0x2bde41[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x6da2('0x87'),util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x55ae15==='1'){return _0x2bde41[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),'status','skebby',util[_0x6da2('0xce')](_0x192c08['body'],{'showHidden':![],'depth':null}));}break;case _0x6da2('0x8a'):if(!_0x192c08[_0x6da2('0x5d')][_0x6da2('0xd7')]&&_0x55ae15>=0xc8&&_0x55ae15<=0xce){return _0x2bde41[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),_0x6da2('0x2b'),_0x6da2('0x8a'),util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x6da2('0xd8'):var _0x421d7e=_0x192c08[_0x6da2('0x5d')][_0x6da2('0x8e')][0x0];if(_0x421d7e[_0x6da2('0x2b')][_0x6da2('0xd3')]==='DELIVERED'){return _0x2bde41['update']({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),_0x6da2('0x2b'),'infobip',util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x6da2('0x91'):if(_0x55ae15==_0x6da2('0xd9')||_0x55ae15=='RECEIVED_BY_RECIPIENT'){return _0x2bde41[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),_0x6da2('0x2b'),_0x6da2('0x91'),util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x55ae15==_0x6da2('0xda')){return _0x2bde41[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),'status','bandwidth',util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x55ae15===_0x6da2('0xdb')||_0x55ae15===_0x6da2('0xdc')){return _0x2bde41[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),'status',_0x6da2('0x93'),util[_0x6da2('0xce')](_0x192c08[_0x6da2('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x2bde41;}})[_0x6da2('0x35')](respondWithResult(_0x841c60,null))[_0x6da2('0x29')](handleError(_0x841c60,null));};exports[_0x6da2('0xdd')]=function(_0x55a893,_0x4243c3,_0x33a761){var _0x470b0b,_0x17d336,_0x2370e0;return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x55a893[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x4243c3,null))[_0x6da2('0x35')](function(_0x136a50){if(_0x136a50){_0x2370e0=_0x136a50;logger[_0x6da2('0x22')](_0x6da2('0x23'),_0x6da2('0x2b'),_0x6da2('0xcd'),_0x136a50[_0x6da2('0x42')],util[_0x6da2('0xce')](_0x55a893[_0x6da2('0x45')],{'showHidden':![],'depth':null}));switch(_0x136a50[_0x6da2('0x42')]){case _0x6da2('0xde'):if(_0x55a893[_0x6da2('0x45')]['message-id']&&_0x55a893['query'][_0x6da2('0xdf')]){_0x17d336=_0x55a893['query']['state'];return db[_0x6da2('0xa8')][_0x6da2('0x61')]({'where':{'messageId':_0x55a893[_0x6da2('0x45')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x4243c3,null))['then'](function(_0x1ce08c){if(_0x1ce08c){_0x470b0b=_0x1ce08c;switch(_0x2370e0[_0x6da2('0x42')]){case _0x6da2('0xde'):if(_0x17d336==='2'||_0x17d336==='6'){return _0x470b0b[_0x6da2('0x34')]({'read':!![]});}else{logger[_0x6da2('0x25')](_0x6da2('0x23'),_0x6da2('0x2b'),'csc',util['inspect'](_0x55a893[_0x6da2('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x470b0b;}})[_0x6da2('0x35')](respondWithResult(_0x4243c3,null))[_0x6da2('0x29')](handleError(_0x4243c3,null));};exports[_0x6da2('0xe0')]=function(_0x150131,_0x73e1c4,_0x3755bd){return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x150131[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x73e1c4,null))['then'](function(_0x886c66){if(_0x886c66){return _0x886c66[_0x6da2('0xe0')](_0x150131[_0x6da2('0x5d')][_0x6da2('0x6a')],_['omit'](_0x150131[_0x6da2('0x5d')],[_0x6da2('0x6a'),'id'])||{})[_0x6da2('0xa2')](function(_0x25bfd9){for(var _0x8d392e=0x0;_0x8d392e<_0x150131['body'][_0x6da2('0x6a')][_0x6da2('0x4a')];_0x8d392e+=0x1){socket[_0x6da2('0xe1')](_0x6da2('0xe2'),{'UserId':Number(_0x150131['body']['ids'][_0x8d392e]),'SmsAccountId':Number(_0x150131[_0x6da2('0x58')]['id'])});}return _0x25bfd9;});}})[_0x6da2('0x35')](respondWithResult(_0x73e1c4,null))[_0x6da2('0x29')](handleError(_0x73e1c4,null));};exports[_0x6da2('0xe3')]=function(_0x17b8c4,_0x223261,_0x3d783f){return db[_0x6da2('0x3f')][_0x6da2('0x61')]({'where':{'id':_0x17b8c4['params']['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0x223261,null))[_0x6da2('0x35')](function(_0x3ee028){if(_0x3ee028){return _0x3ee028[_0x6da2('0xe3')](_0x17b8c4[_0x6da2('0x45')]['ids'])[_0x6da2('0x35')](function(){if(_[_0x6da2('0xe4')](_0x17b8c4[_0x6da2('0x45')][_0x6da2('0x6a')])){for(var _0x556841=0x0;_0x556841<_0x17b8c4[_0x6da2('0x45')][_0x6da2('0x6a')]['length'];_0x556841+=0x1){socket[_0x6da2('0xe1')](_0x6da2('0xe5'),{'UserId':Number(_0x17b8c4[_0x6da2('0x45')][_0x6da2('0x6a')][_0x556841]),'SmsAccountId':Number(_0x17b8c4[_0x6da2('0x58')]['id'])});}}else{socket[_0x6da2('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x17b8c4['query'][_0x6da2('0x6a')]),'SmsAccountId':Number(_0x17b8c4[_0x6da2('0x58')]['id'])});}});}})[_0x6da2('0x35')](respondWithStatusCode(_0x223261,null))[_0x6da2('0x29')](handleError(_0x223261,null));};exports[_0x6da2('0xe6')]=function(_0x175f90,_0xff1c15,_0xb490f7){var _0xbb30d1={};var _0x518acd={};var _0x349ed1;var _0x23f4ed;return db['SmsAccount'][_0x6da2('0x6c')]({'where':{'id':_0x175f90[_0x6da2('0x58')]['id']}})[_0x6da2('0x35')](handleEntityNotFound(_0xff1c15,null))[_0x6da2('0x35')](function(_0x29e2ed){if(_0x29e2ed){_0x349ed1=_0x29e2ed;_0x518acd['model']=_[_0x6da2('0x46')](db['User']['rawAttributes']);_0x518acd[_0x6da2('0x45')]=_[_0x6da2('0x46')](_0x175f90['query']);_0x518acd[_0x6da2('0x47')]=_[_0x6da2('0x5a')](_0x518acd['model'],_0x518acd[_0x6da2('0x45')]);_0xbb30d1['attributes']=_[_0x6da2('0x5a')](_0x518acd[_0x6da2('0x44')],qs[_0x6da2('0x49')](_0x175f90[_0x6da2('0x45')][_0x6da2('0x49')]));_0xbb30d1[_0x6da2('0x48')]=_0xbb30d1[_0x6da2('0x48')][_0x6da2('0x4a')]?_0xbb30d1['attributes']:_0x518acd[_0x6da2('0x44')];_0xbb30d1['order']=qs[_0x6da2('0x68')](_0x175f90['query']['sort']);_0xbb30d1['where']=qs[_0x6da2('0x47')](_[_0x6da2('0x4f')](_0x175f90[_0x6da2('0x45')],_0x518acd['filters']));if(_0x175f90[_0x6da2('0x45')][_0x6da2('0x50')]){_0xbb30d1['where']=_[_0x6da2('0x51')](_0xbb30d1['where'],{'$or':_[_0x6da2('0x3e')](_0xbb30d1[_0x6da2('0x48')],function(_0x4a26a5){var _0x385ec5={};_0x385ec5[_0x4a26a5]={'$like':'%'+_0x175f90['query'][_0x6da2('0x50')]+'%'};return _0x385ec5;})});}_0xbb30d1=_[_0x6da2('0x51')]({},_0xbb30d1,_0x175f90[_0x6da2('0x53')]);return _0x349ed1[_0x6da2('0xe6')](_0xbb30d1);}})[_0x6da2('0x35')](function(_0x536181){if(_0x536181){_0x23f4ed=_0x536181[_0x6da2('0x4a')];if(!_0x175f90[_0x6da2('0x45')][_0x6da2('0x4b')](_0x6da2('0x4c'))){_0xbb30d1[_0x6da2('0x2f')]=qs[_0x6da2('0x2f')](_0x175f90[_0x6da2('0x45')]['limit']);_0xbb30d1[_0x6da2('0x2d')]=qs[_0x6da2('0x2d')](_0x175f90[_0x6da2('0x45')][_0x6da2('0x2d')]);}return _0x349ed1[_0x6da2('0xe6')](_0xbb30d1);}})['then'](function(_0x45dbf9){if(_0x45dbf9){return _0x45dbf9?{'count':_0x23f4ed,'rows':_0x45dbf9}:null;}})[_0x6da2('0x35')](respondWithResult(_0xff1c15,null))[_0x6da2('0x29')](handleError(_0xff1c15,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 50f85e3..eb4ade0 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 _0x8919=['../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8919,0x167));var _0x9891=function(_0x568616,_0x24b755){_0x568616=_0x568616-0x0;var _0x4ce55e=_0x8919[_0x568616];return _0x4ce55e;};'use strict';var EventEmitter=require(_0x9891('0x0'));var SmsAccount=require(_0x9891('0x1'))['db'][_0x9891('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9891('0x3')](0x0);var events={'afterCreate':_0x9891('0x4'),'afterUpdate':_0x9891('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c51e8){return function(_0x26bedf,_0x49bb3d,_0x497b00){SmsAccountEvents['emit'](_0x1c51e8+':'+_0x26bedf['id'],_0x26bedf);SmsAccountEvents[_0x9891('0x6')](_0x1c51e8,_0x26bedf);_0x497b00(null);};}for(var e in events){if(events[_0x9891('0x7')](e)){var event=events[e];SmsAccount[_0x9891('0x8')](e,emitEvent(event));}}module[_0x9891('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x8aee=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x8aee,0x1ed));var _0xe8ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aee[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xe8ae('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe8ae('0x1')](0x0);var events={'afterCreate':_0xe8ae('0x2'),'afterUpdate':'update','afterDestroy':_0xe8ae('0x3')};function emitEvent(_0x5b8806){return function(_0x5abf86,_0x4f3a04,_0x3c9432){SmsAccountEvents[_0xe8ae('0x4')](_0x5b8806+':'+_0x5abf86['id'],_0x5abf86);SmsAccountEvents['emit'](_0x5b8806,_0x5abf86);_0x3c9432(null);};}for(var e in events){if(events[_0xe8ae('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xe8ae('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 6304645..dc49f87 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 _0x844d=['bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','api','moment'];(function(_0x4fb334,_0x4ca8c9){var _0x56dc84=function(_0x470d7b){while(--_0x470d7b){_0x4fb334['push'](_0x4fb334['shift']());}};_0x56dc84(++_0x4ca8c9);}(_0x844d,0xaf));var _0xd844=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x844d[_0xfd9b19];return _0x514918;};'use strict';var _=require(_0xd844('0x0'));var util=require(_0xd844('0x1'));var logger=require(_0xd844('0x2'))(_0xd844('0x3'));var moment=require(_0xd844('0x4'));var BPromise=require(_0xd844('0x5'));var rp=require(_0xd844('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd844('0x7'));var attributes=require(_0xd844('0x8'));module[_0xd844('0x9')]=function(_0x4f8fa6,_0x32a58c){return _0x4f8fa6[_0xd844('0xa')](_0xd844('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe809=['SmsAccount','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports'];(function(_0x5e30ad,_0x47aa0f){var _0xaad26=function(_0x402ce7){while(--_0x402ce7){_0x5e30ad['push'](_0x5e30ad['shift']());}};_0xaad26(++_0x47aa0f);}(_0xe809,0xa1));var _0x9e80=function(_0x371d58,_0x22f295){_0x371d58=_0x371d58-0x0;var _0x214db0=_0xe809[_0x371d58];return _0x214db0;};'use strict';var _=require(_0x9e80('0x0'));var util=require('util');var logger=require(_0x9e80('0x1'))(_0x9e80('0x2'));var moment=require('moment');var BPromise=require(_0x9e80('0x3'));var rp=require(_0x9e80('0x4'));var fs=require('fs');var path=require(_0x9e80('0x5'));var rimraf=require(_0x9e80('0x6'));var config=require('../../config/environment');var attributes=require(_0x9e80('0x7'));module[_0x9e80('0x8')]=function(_0x5ab337,_0x248609){return _0x5ab337['define'](_0x9e80('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 267e371..12c5079 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 _0x1ed0=['map','info','ShowSmsAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','raw','options','where','attributes','include','model'];(function(_0x31f0c3,_0x1c2ae8){var _0x518a8d=function(_0x3dff50){while(--_0x3dff50){_0x31f0c3['push'](_0x31f0c3['shift']());}};_0x518a8d(++_0x1c2ae8);}(_0x1ed0,0xc6));var _0x01ed=function(_0x275621,_0x524302){_0x275621=_0x275621-0x0;var _0x2ad056=_0x1ed0[_0x275621];return _0x2ad056;};'use strict';var _=require(_0x01ed('0x0'));var util=require(_0x01ed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x01ed('0x2'));var fs=require('fs');var Redis=require(_0x01ed('0x3'));var db=require(_0x01ed('0x4'))['db'];var utils=require(_0x01ed('0x5'));var logger=require(_0x01ed('0x6'))(_0x01ed('0x7'));var config=require('../../config/environment');var jayson=require(_0x01ed('0x8'));var client=jayson[_0x01ed('0x9')][_0x01ed('0xa')]({'port':0x232a});config[_0x01ed('0xb')]=_[_0x01ed('0xc')](config['redis'],{'host':_0x01ed('0xd'),'port':0x18eb});var socket=require(_0x01ed('0xe'))(new Redis(config['redis']));require(_0x01ed('0xf'))[_0x01ed('0x10')](socket);function respondWithRpcPromise(_0x2af4dd,_0x271df2,_0x21936d){return new BPromise(function(_0x59c006,_0x5a265b){return client[_0x01ed('0x11')](_0x2af4dd,_0x21936d)[_0x01ed('0x12')](function(_0x2c296b){logger['info'](_0x01ed('0x13'),_0x271df2,_0x01ed('0x14'));logger[_0x01ed('0x15')](_0x01ed('0x16'),_0x271df2,_0x01ed('0x14'),JSON[_0x01ed('0x17')](_0x2c296b));if(_0x2c296b[_0x01ed('0x18')]){if(_0x2c296b['error'][_0x01ed('0x19')]===0x1f4){logger[_0x01ed('0x18')](_0x01ed('0x13'),_0x271df2,_0x2c296b['error'][_0x01ed('0x1a')]);return _0x5a265b(_0x2c296b['error'][_0x01ed('0x1a')]);}logger[_0x01ed('0x18')](_0x01ed('0x13'),_0x271df2,_0x2c296b[_0x01ed('0x18')][_0x01ed('0x1a')]);return _0x59c006(_0x2c296b[_0x01ed('0x18')][_0x01ed('0x1a')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x271df2,'request\x20sent');_0x59c006(_0x2c296b[_0x01ed('0x1b')]['message']);}})[_0x01ed('0x1c')](function(_0x788cf7){logger[_0x01ed('0x18')](_0x01ed('0x13'),_0x271df2,_0x788cf7);_0x5a265b(_0x788cf7);});});}exports['ShowSmsAccount']=function(_0x2c11cb){var _0x13a5cb=this;return new Promise(function(_0x4ce709,_0x495012){return db[_0x01ed('0x1d')]['find']({'raw':_0x2c11cb['options']?_0x2c11cb['options'][_0x01ed('0x1e')]===undefined?!![]:![]:!![],'where':_0x2c11cb[_0x01ed('0x1f')]?_0x2c11cb[_0x01ed('0x1f')][_0x01ed('0x20')]||null:null,'attributes':_0x2c11cb[_0x01ed('0x1f')]?_0x2c11cb[_0x01ed('0x1f')][_0x01ed('0x21')]||null:null,'include':_0x2c11cb[_0x01ed('0x1f')]?_0x2c11cb[_0x01ed('0x1f')]['include']?_['map'](_0x2c11cb[_0x01ed('0x1f')][_0x01ed('0x22')],function(_0x48e728){return{'model':db[_0x48e728[_0x01ed('0x23')]],'as':_0x48e728['as'],'attributes':_0x48e728[_0x01ed('0x21')],'include':_0x48e728['include']?_[_0x01ed('0x24')](_0x48e728[_0x01ed('0x22')],function(_0x5ea4fa){return{'model':db[_0x5ea4fa[_0x01ed('0x23')]],'as':_0x5ea4fa['as'],'attributes':_0x5ea4fa[_0x01ed('0x21')],'include':_0x5ea4fa[_0x01ed('0x22')]?_[_0x01ed('0x24')](_0x5ea4fa[_0x01ed('0x22')],function(_0x364da0){return{'model':db[_0x364da0['model']],'as':_0x364da0['as'],'attributes':_0x364da0[_0x01ed('0x21')]};}):[]};}):[]};}):[]:[]})[_0x01ed('0x12')](function(_0x5f3261){logger[_0x01ed('0x25')](_0x01ed('0x26'),_0x2c11cb);logger[_0x01ed('0x15')](_0x01ed('0x26'),_0x2c11cb,JSON['stringify'](_0x5f3261));_0x4ce709(_0x5f3261);})[_0x01ed('0x1c')](function(_0x4b1222){logger[_0x01ed('0x18')](_0x01ed('0x26'),_0x4b1222[_0x01ed('0x1a')],_0x2c11cb);_0x495012(_0x13a5cb[_0x01ed('0x18')](0x1f4,_0x4b1222[_0x01ed('0x1a')]));});});}; \ No newline at end of file +var _0x55f4=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSmsAccount','find','options','raw','where','map','model','include','attributes','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x55f4,0x1e7));var _0x455f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x55f4[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x455f('0x0'));var util=require(_0x455f('0x1'));var moment=require(_0x455f('0x2'));var BPromise=require(_0x455f('0x3'));var rs=require(_0x455f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x455f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x455f('0x6'))(_0x455f('0x7'));var config=require(_0x455f('0x8'));var jayson=require(_0x455f('0x9'));var client=jayson[_0x455f('0xa')]['http']({'port':0x232a});config[_0x455f('0xb')]=_[_0x455f('0xc')](config['redis'],{'host':_0x455f('0xd'),'port':0x18eb});var socket=require(_0x455f('0xe'))(new Redis(config[_0x455f('0xb')]));require('./smsAccount.socket')[_0x455f('0xf')](socket);function respondWithRpcPromise(_0x2d4aad,_0x1e63be,_0x18cdaa){return new BPromise(function(_0x3a44e4,_0x4479a9){return client[_0x455f('0x10')](_0x2d4aad,_0x18cdaa)[_0x455f('0x11')](function(_0x28fc4e){logger[_0x455f('0x12')](_0x455f('0x13'),_0x1e63be,'request\x20sent');logger['debug'](_0x455f('0x14'),_0x1e63be,_0x455f('0x15'),JSON['stringify'](_0x28fc4e));if(_0x28fc4e['error']){if(_0x28fc4e[_0x455f('0x16')][_0x455f('0x17')]===0x1f4){logger[_0x455f('0x16')](_0x455f('0x13'),_0x1e63be,_0x28fc4e[_0x455f('0x16')][_0x455f('0x18')]);return _0x4479a9(_0x28fc4e['error'][_0x455f('0x18')]);}logger[_0x455f('0x16')](_0x455f('0x13'),_0x1e63be,_0x28fc4e['error'][_0x455f('0x18')]);return _0x3a44e4(_0x28fc4e[_0x455f('0x16')][_0x455f('0x18')]);}else{logger[_0x455f('0x12')](_0x455f('0x13'),_0x1e63be,_0x455f('0x15'));_0x3a44e4(_0x28fc4e[_0x455f('0x19')][_0x455f('0x18')]);}})[_0x455f('0x1a')](function(_0x4da205){logger[_0x455f('0x16')](_0x455f('0x13'),_0x1e63be,_0x4da205);_0x4479a9(_0x4da205);});});}exports[_0x455f('0x1b')]=function(_0x115003){var _0x4c19ef=this;return new Promise(function(_0xf2fed5,_0x427e6f){return db['SmsAccount'][_0x455f('0x1c')]({'raw':_0x115003[_0x455f('0x1d')]?_0x115003[_0x455f('0x1d')][_0x455f('0x1e')]===undefined?!![]:![]:!![],'where':_0x115003[_0x455f('0x1d')]?_0x115003[_0x455f('0x1d')][_0x455f('0x1f')]||null:null,'attributes':_0x115003[_0x455f('0x1d')]?_0x115003['options']['attributes']||null:null,'include':_0x115003['options']?_0x115003['options']['include']?_[_0x455f('0x20')](_0x115003[_0x455f('0x1d')]['include'],function(_0x7b9760){return{'model':db[_0x7b9760[_0x455f('0x21')]],'as':_0x7b9760['as'],'attributes':_0x7b9760['attributes'],'include':_0x7b9760[_0x455f('0x22')]?_[_0x455f('0x20')](_0x7b9760['include'],function(_0x2117c8){return{'model':db[_0x2117c8[_0x455f('0x21')]],'as':_0x2117c8['as'],'attributes':_0x2117c8[_0x455f('0x23')],'include':_0x2117c8[_0x455f('0x22')]?_['map'](_0x2117c8[_0x455f('0x22')],function(_0x2a9e91){return{'model':db[_0x2a9e91[_0x455f('0x21')]],'as':_0x2a9e91['as'],'attributes':_0x2a9e91['attributes']};}):[]};}):[]};}):[]:[]})[_0x455f('0x11')](function(_0x2cc691){logger[_0x455f('0x12')](_0x455f('0x1b'),_0x115003);logger[_0x455f('0x24')]('ShowSmsAccount',_0x115003,JSON[_0x455f('0x25')](_0x2cc691));_0xf2fed5(_0x2cc691);})['catch'](function(_0x51611a){logger[_0x455f('0x16')](_0x455f('0x1b'),_0x51611a[_0x455f('0x18')],_0x115003);_0x427e6f(_0x4c19ef[_0x455f('0x16')](0x1f4,_0x51611a[_0x455f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b3d2505..6c1c51b 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 56ca591..7be04b6 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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x10ad35,_0x2275a9){var _0x43a6a6=function(_0x367e90){while(--_0x367e90){_0x10ad35['push'](_0x10ad35['shift']());}};_0x43a6a6(++_0x2275a9);}(_0x55ca,0x126));var _0xa55c=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x55ca[_0x7ad123];return _0x37d073;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +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(_0x82269f,_0x36d861){var _0x31f596=function(_0x392ac8){while(--_0x392ac8){_0x82269f['push'](_0x82269f['shift']());}};_0x31f596(++_0x36d861);}(_0x008c,0x188));var _0xc008=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x008c[_0x2eec1f];return _0x543075;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 82d6daf..8214766 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 _0xdd5c=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1626df,_0x138073){var _0x3afb4a=function(_0x31e5c5){while(--_0x31e5c5){_0x1626df['push'](_0x1626df['shift']());}};_0x3afb4a(++_0x138073);}(_0xdd5c,0x1b9));var _0xcdd5=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0xdd5c[_0x199b1f];return _0x267ac9;};'use strict';var Sequelize=require(_0xcdd5('0x0'));module[_0xcdd5('0x1')]={'priority':{'type':Sequelize[_0xcdd5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcdd5('0x3')],'allowNull':![],'defaultValue':_0xcdd5('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcdd5('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcdd5('0x5')}}; \ No newline at end of file +var _0x0313=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0xf50a87,_0x25bdb3){var _0xb8d078=function(_0x14fa17){while(--_0x14fa17){_0xf50a87['push'](_0xf50a87['shift']());}};_0xb8d078(++_0x25bdb3);}(_0x0313,0x1eb));var _0x3031=function(_0x1a883f,_0x5bd266){_0x1a883f=_0x1a883f-0x0;var _0x1e8512=_0x0313[_0x1a883f];return _0x1e8512;};'use strict';var Sequelize=require(_0x3031('0x0'));module[_0x3031('0x1')]={'priority':{'type':Sequelize[_0x3031('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3031('0x3')],'allowNull':![],'defaultValue':_0x3031('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3031('0x3')]},'interval':{'type':Sequelize[_0x3031('0x3')],'defaultValue':_0x3031('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index ccd64ca..1e93ed2 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 _0x3e35=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','count','limit','set','Content-Range','apply','update','then','destroy','end','sendStatus','name','send','index','map','SmsApplication','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3e35,0x1e0));var _0x53e3=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x3e35[_0x211fef];return _0x5447bf;};'use strict';var emlformat=require(_0x53e3('0x0'));var rimraf=require(_0x53e3('0x1'));var zipdir=require(_0x53e3('0x2'));var jsonpatch=require(_0x53e3('0x3'));var rp=require(_0x53e3('0x4'));var moment=require('moment');var BPromise=require(_0x53e3('0x5'));var Mustache=require(_0x53e3('0x6'));var util=require(_0x53e3('0x7'));var path=require(_0x53e3('0x8'));var sox=require(_0x53e3('0x9'));var csv=require(_0x53e3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x53e3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53e3('0xc'));var toCsv=require(_0x53e3('0xa'));var querystring=require(_0x53e3('0xd'));var Papa=require(_0x53e3('0xe'));var Redis=require(_0x53e3('0xf'));var authService=require(_0x53e3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x53e3('0x11'));var hardwareService=require(_0x53e3('0x12'));var logger=require(_0x53e3('0x13'))(_0x53e3('0x14'));var utils=require(_0x53e3('0x15'));var config=require(_0x53e3('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x135586,_0x1ff2f0){_0x1ff2f0=_0x1ff2f0||0xcc;return function(_0x237fc7){if(_0x237fc7){return _0x135586['sendStatus'](_0x1ff2f0);}return _0x135586['status'](_0x1ff2f0)['end']();};}function respondWithResult(_0xecdf64,_0x3f2a35){_0x3f2a35=_0x3f2a35||0xc8;return function(_0xd2fbad){if(_0xd2fbad){return _0xecdf64[_0x53e3('0x17')](_0x3f2a35)[_0x53e3('0x18')](_0xd2fbad);}};}function respondWithFilteredResult(_0x533484,_0x45aeea){return function(_0x136017){if(_0x136017){var _0x48cdc4=typeof _0x45aeea[_0x53e3('0x19')]==='undefined'&&typeof _0x45aeea['limit']==='undefined';var _0x1815fb=_0x136017[_0x53e3('0x1a')];var _0x5aaa35=_0x48cdc4?0x0:_0x45aeea[_0x53e3('0x19')];var _0x975d0=_0x48cdc4?_0x136017['count']:_0x45aeea[_0x53e3('0x19')]+_0x45aeea[_0x53e3('0x1b')];var _0x9933c5;if(_0x975d0>=_0x1815fb){_0x975d0=_0x1815fb;_0x9933c5=0xc8;}else{_0x9933c5=0xce;}_0x533484[_0x53e3('0x17')](_0x9933c5);return _0x533484[_0x53e3('0x1c')](_0x53e3('0x1d'),_0x5aaa35+'-'+_0x975d0+'/'+_0x1815fb)[_0x53e3('0x18')](_0x136017);}return null;};}function patchUpdates(_0x3de82e){return function(_0x3f0337){try{jsonpatch[_0x53e3('0x1e')](_0x3f0337,_0x3de82e,!![]);}catch(_0xd0aff){return BPromise['reject'](_0xd0aff);}return _0x3f0337['save']();};}function saveUpdates(_0x418161,_0x2e89fe){return function(_0x37d245){if(_0x37d245){return _0x37d245[_0x53e3('0x1f')](_0x418161)[_0x53e3('0x20')](function(_0x4b06d9){return _0x4b06d9;});}return null;};}function removeEntity(_0x20a603,_0x6878ee){return function(_0x1cf65e){if(_0x1cf65e){return _0x1cf65e[_0x53e3('0x21')]()[_0x53e3('0x20')](function(){_0x20a603[_0x53e3('0x17')](0xcc)[_0x53e3('0x22')]();});}};}function handleEntityNotFound(_0x5d34e7,_0x58ef05){return function(_0x5ee028){if(!_0x5ee028){_0x5d34e7[_0x53e3('0x23')](0x194);}return _0x5ee028;};}function handleError(_0x477bae,_0x3884da){_0x3884da=_0x3884da||0x1f4;return function(_0xb8e5c3){logger['error'](_0xb8e5c3['stack']);if(_0xb8e5c3[_0x53e3('0x24')]){delete _0xb8e5c3[_0x53e3('0x24')];}_0x477bae[_0x53e3('0x17')](_0x3884da)[_0x53e3('0x25')](_0xb8e5c3);};}exports[_0x53e3('0x26')]=function(_0x2a7f95,_0xce647f){var _0x3ddbf9={},_0x14b6de={},_0x45a305={'count':0x0,'rows':[]};var _0x4f39b7=_[_0x53e3('0x27')](db[_0x53e3('0x28')][_0x53e3('0x29')],function(_0x2fd09f){return{'name':_0x2fd09f['fieldName'],'type':_0x2fd09f['type'][_0x53e3('0x2a')]};});_0x14b6de['model']=_[_0x53e3('0x27')](_0x4f39b7,_0x53e3('0x24'));_0x14b6de[_0x53e3('0x2b')]=_[_0x53e3('0x2c')](_0x2a7f95[_0x53e3('0x2b')]);_0x14b6de[_0x53e3('0x2d')]=_[_0x53e3('0x2e')](_0x14b6de['model'],_0x14b6de[_0x53e3('0x2b')]);_0x3ddbf9[_0x53e3('0x2f')]=_[_0x53e3('0x2e')](_0x14b6de[_0x53e3('0x30')],qs[_0x53e3('0x31')](_0x2a7f95['query'][_0x53e3('0x31')]));_0x3ddbf9[_0x53e3('0x2f')]=_0x3ddbf9['attributes'][_0x53e3('0x32')]?_0x3ddbf9['attributes']:_0x14b6de[_0x53e3('0x30')];if(!_0x2a7f95['query'][_0x53e3('0x33')]('nolimit')){_0x3ddbf9[_0x53e3('0x1b')]=qs['limit'](_0x2a7f95[_0x53e3('0x2b')]['limit']);_0x3ddbf9['offset']=qs[_0x53e3('0x19')](_0x2a7f95[_0x53e3('0x2b')][_0x53e3('0x19')]);}_0x3ddbf9[_0x53e3('0x34')]=qs[_0x53e3('0x35')](_0x2a7f95['query'][_0x53e3('0x35')]);_0x3ddbf9['where']=qs[_0x53e3('0x2d')](_[_0x53e3('0x36')](_0x2a7f95[_0x53e3('0x2b')],_0x14b6de[_0x53e3('0x2d')]),_0x4f39b7);if(_0x2a7f95[_0x53e3('0x2b')][_0x53e3('0x37')]){_0x3ddbf9[_0x53e3('0x38')]=_[_0x53e3('0x39')](_0x3ddbf9['where'],{'$or':_[_0x53e3('0x27')](_0x4f39b7,function(_0x4058ed){if(_0x4058ed[_0x53e3('0x3a')]!==_0x53e3('0x3b')){var _0xf6b8df={};_0xf6b8df[_0x4058ed[_0x53e3('0x24')]]={'$like':'%'+_0x2a7f95[_0x53e3('0x2b')]['filter']+'%'};return _0xf6b8df;}})});}_0x3ddbf9=_[_0x53e3('0x39')]({},_0x3ddbf9,_0x2a7f95[_0x53e3('0x3c')]);var _0x3a3153={'where':_0x3ddbf9[_0x53e3('0x38')]};return db['SmsApplication'][_0x53e3('0x1a')](_0x3a3153)[_0x53e3('0x20')](function(_0x3a6800){_0x45a305[_0x53e3('0x1a')]=_0x3a6800;if(_0x2a7f95[_0x53e3('0x2b')]['includeAll']){_0x3ddbf9[_0x53e3('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x53e3('0x3e')](_0x3ddbf9);})['then'](function(_0x3bb529){_0x45a305[_0x53e3('0x3f')]=_0x3bb529;return _0x45a305;})[_0x53e3('0x20')](respondWithFilteredResult(_0xce647f,_0x3ddbf9))[_0x53e3('0x40')](handleError(_0xce647f,null));};exports[_0x53e3('0x41')]=function(_0x4773b2,_0x3e2f56){var _0x55932f={'raw':!![],'where':{'id':_0x4773b2[_0x53e3('0x42')]['id']}},_0x449e97={};_0x449e97['model']=_[_0x53e3('0x2c')](db[_0x53e3('0x28')][_0x53e3('0x29')]);_0x449e97[_0x53e3('0x2b')]=_[_0x53e3('0x2c')](_0x4773b2[_0x53e3('0x2b')]);_0x449e97[_0x53e3('0x2d')]=_[_0x53e3('0x2e')](_0x449e97[_0x53e3('0x30')],_0x449e97['query']);_0x55932f['attributes']=_[_0x53e3('0x2e')](_0x449e97['model'],qs[_0x53e3('0x31')](_0x4773b2[_0x53e3('0x2b')]['fields']));_0x55932f[_0x53e3('0x2f')]=_0x55932f[_0x53e3('0x2f')]['length']?_0x55932f['attributes']:_0x449e97[_0x53e3('0x30')];if(_0x4773b2[_0x53e3('0x2b')][_0x53e3('0x43')]){_0x55932f[_0x53e3('0x3d')]=[{'all':!![]}];}_0x55932f=_[_0x53e3('0x39')]({},_0x55932f,_0x4773b2[_0x53e3('0x3c')]);return db[_0x53e3('0x28')][_0x53e3('0x44')](_0x55932f)[_0x53e3('0x20')](handleEntityNotFound(_0x3e2f56,null))[_0x53e3('0x20')](respondWithResult(_0x3e2f56,null))[_0x53e3('0x40')](handleError(_0x3e2f56,null));};exports[_0x53e3('0x45')]=function(_0x47237f,_0x424fd0){return db['SmsApplication'][_0x53e3('0x45')](_0x47237f['body'],{})[_0x53e3('0x20')](respondWithResult(_0x424fd0,0xc9))[_0x53e3('0x40')](handleError(_0x424fd0,null));};exports['update']=function(_0x110892,_0x13fad9){if(_0x110892[_0x53e3('0x46')]['id']){delete _0x110892[_0x53e3('0x46')]['id'];}return db[_0x53e3('0x28')][_0x53e3('0x44')]({'where':{'id':_0x110892[_0x53e3('0x42')]['id']}})[_0x53e3('0x20')](handleEntityNotFound(_0x13fad9,null))[_0x53e3('0x20')](saveUpdates(_0x110892['body'],null))[_0x53e3('0x20')](respondWithResult(_0x13fad9,null))[_0x53e3('0x40')](handleError(_0x13fad9,null));};exports[_0x53e3('0x21')]=function(_0x54c9e3,_0x4d8a22){return db[_0x53e3('0x28')]['find']({'where':{'id':_0x54c9e3[_0x53e3('0x42')]['id']}})[_0x53e3('0x20')](handleEntityNotFound(_0x4d8a22,null))[_0x53e3('0x20')](removeEntity(_0x4d8a22,null))[_0x53e3('0x40')](handleError(_0x4d8a22,null));}; \ No newline at end of file +var _0xede1=['path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3fe31b,_0x54779a){var _0x41ec8e=function(_0x21b58e){while(--_0x21b58e){_0x3fe31b['push'](_0x3fe31b['shift']());}};_0x41ec8e(++_0x54779a);}(_0xede1,0xcd));var _0x1ede=function(_0x46e2e4,_0x6aadf8){_0x46e2e4=_0x46e2e4-0x0;var _0x310a6f=_0xede1[_0x46e2e4];return _0x310a6f;};'use strict';var emlformat=require(_0x1ede('0x0'));var rimraf=require(_0x1ede('0x1'));var zipdir=require(_0x1ede('0x2'));var jsonpatch=require(_0x1ede('0x3'));var rp=require(_0x1ede('0x4'));var moment=require('moment');var BPromise=require(_0x1ede('0x5'));var Mustache=require(_0x1ede('0x6'));var util=require(_0x1ede('0x7'));var path=require(_0x1ede('0x8'));var sox=require(_0x1ede('0x9'));var csv=require(_0x1ede('0xa'));var ejs=require(_0x1ede('0xb'));var fs=require('fs');var fs_extra=require(_0x1ede('0xc'));var _=require(_0x1ede('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ede('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ede('0xf'));var Papa=require(_0x1ede('0x10'));var Redis=require('ioredis');var authService=require(_0x1ede('0x11'));var qs=require(_0x1ede('0x12'));var as=require(_0x1ede('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ede('0x14'))(_0x1ede('0x15'));var utils=require(_0x1ede('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1ede('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79dfb9,_0x1ef4e2){_0x1ef4e2=_0x1ef4e2||0xcc;return function(_0x4ab95d){if(_0x4ab95d){return _0x79dfb9[_0x1ede('0x18')](_0x1ef4e2);}return _0x79dfb9[_0x1ede('0x19')](_0x1ef4e2)[_0x1ede('0x1a')]();};}function respondWithResult(_0x397561,_0x11991f){_0x11991f=_0x11991f||0xc8;return function(_0x5255b6){if(_0x5255b6){return _0x397561[_0x1ede('0x19')](_0x11991f)[_0x1ede('0x1b')](_0x5255b6);}};}function respondWithFilteredResult(_0x254cee,_0x2ecbe6){return function(_0x3a8a31){if(_0x3a8a31){var _0x44d879=typeof _0x2ecbe6[_0x1ede('0x1c')]==='undefined'&&typeof _0x2ecbe6[_0x1ede('0x1d')]==='undefined';var _0xa8855a=_0x3a8a31[_0x1ede('0x1e')];var _0x1ddb58=_0x44d879?0x0:_0x2ecbe6['offset'];var _0x293883=_0x44d879?_0x3a8a31[_0x1ede('0x1e')]:_0x2ecbe6['offset']+_0x2ecbe6[_0x1ede('0x1d')];var _0x79793d;if(_0x293883>=_0xa8855a){_0x293883=_0xa8855a;_0x79793d=0xc8;}else{_0x79793d=0xce;}_0x254cee[_0x1ede('0x19')](_0x79793d);return _0x254cee[_0x1ede('0x1f')](_0x1ede('0x20'),_0x1ddb58+'-'+_0x293883+'/'+_0xa8855a)[_0x1ede('0x1b')](_0x3a8a31);}return null;};}function patchUpdates(_0x3e4784){return function(_0x8283a3){try{jsonpatch[_0x1ede('0x21')](_0x8283a3,_0x3e4784,!![]);}catch(_0x129007){return BPromise['reject'](_0x129007);}return _0x8283a3[_0x1ede('0x22')]();};}function saveUpdates(_0x57388c,_0x3e406e){return function(_0x235d45){if(_0x235d45){return _0x235d45['update'](_0x57388c)['then'](function(_0xe7b8ec){return _0xe7b8ec;});}return null;};}function removeEntity(_0x22e094,_0x5885b7){return function(_0x369e86){if(_0x369e86){return _0x369e86[_0x1ede('0x23')]()[_0x1ede('0x24')](function(){_0x22e094[_0x1ede('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb23e,_0x245fe1){return function(_0x39f781){if(!_0x39f781){_0x4bb23e['sendStatus'](0x194);}return _0x39f781;};}function handleError(_0x55a0cc,_0x4a6d84){_0x4a6d84=_0x4a6d84||0x1f4;return function(_0x1622cb){logger['error'](_0x1622cb[_0x1ede('0x25')]);if(_0x1622cb[_0x1ede('0x26')]){delete _0x1622cb['name'];}_0x55a0cc['status'](_0x4a6d84)[_0x1ede('0x27')](_0x1622cb);};}exports[_0x1ede('0x28')]=function(_0x184310,_0x327c4a){var _0x393d4c={},_0x292d1e={},_0x454516={'count':0x0,'rows':[]};var _0x3e731c=_[_0x1ede('0x29')](db[_0x1ede('0x2a')][_0x1ede('0x2b')],function(_0x280d5b){return{'name':_0x280d5b[_0x1ede('0x2c')],'type':_0x280d5b[_0x1ede('0x2d')][_0x1ede('0x2e')]};});_0x292d1e[_0x1ede('0x2f')]=_['map'](_0x3e731c,_0x1ede('0x26'));_0x292d1e['query']=_[_0x1ede('0x30')](_0x184310[_0x1ede('0x31')]);_0x292d1e[_0x1ede('0x32')]=_['intersection'](_0x292d1e[_0x1ede('0x2f')],_0x292d1e[_0x1ede('0x31')]);_0x393d4c[_0x1ede('0x33')]=_[_0x1ede('0x34')](_0x292d1e['model'],qs[_0x1ede('0x35')](_0x184310[_0x1ede('0x31')][_0x1ede('0x35')]));_0x393d4c[_0x1ede('0x33')]=_0x393d4c['attributes'][_0x1ede('0x36')]?_0x393d4c[_0x1ede('0x33')]:_0x292d1e['model'];if(!_0x184310['query']['hasOwnProperty'](_0x1ede('0x37'))){_0x393d4c['limit']=qs[_0x1ede('0x1d')](_0x184310[_0x1ede('0x31')][_0x1ede('0x1d')]);_0x393d4c['offset']=qs['offset'](_0x184310[_0x1ede('0x31')]['offset']);}_0x393d4c['order']=qs[_0x1ede('0x38')](_0x184310[_0x1ede('0x31')]['sort']);_0x393d4c[_0x1ede('0x39')]=qs[_0x1ede('0x32')](_[_0x1ede('0x3a')](_0x184310[_0x1ede('0x31')],_0x292d1e['filters']),_0x3e731c);if(_0x184310[_0x1ede('0x31')]['filter']){_0x393d4c['where']=_[_0x1ede('0x3b')](_0x393d4c[_0x1ede('0x39')],{'$or':_[_0x1ede('0x29')](_0x3e731c,function(_0x1c9f6e){if(_0x1c9f6e[_0x1ede('0x2d')]!=='VIRTUAL'){var _0x5cb620={};_0x5cb620[_0x1c9f6e[_0x1ede('0x26')]]={'$like':'%'+_0x184310['query'][_0x1ede('0x3c')]+'%'};return _0x5cb620;}})});}_0x393d4c=_[_0x1ede('0x3b')]({},_0x393d4c,_0x184310[_0x1ede('0x3d')]);var _0x7330bd={'where':_0x393d4c[_0x1ede('0x39')]};return db['SmsApplication']['count'](_0x7330bd)[_0x1ede('0x24')](function(_0x354c9c){_0x454516['count']=_0x354c9c;if(_0x184310[_0x1ede('0x31')][_0x1ede('0x3e')]){_0x393d4c[_0x1ede('0x3f')]=[{'all':!![]}];}return db[_0x1ede('0x2a')][_0x1ede('0x40')](_0x393d4c);})['then'](function(_0x1be5d3){_0x454516[_0x1ede('0x41')]=_0x1be5d3;return _0x454516;})[_0x1ede('0x24')](respondWithFilteredResult(_0x327c4a,_0x393d4c))[_0x1ede('0x42')](handleError(_0x327c4a,null));};exports['show']=function(_0x4909e1,_0x221d1b){var _0x396d54={'raw':!![],'where':{'id':_0x4909e1[_0x1ede('0x43')]['id']}},_0x5ad0eb={};_0x5ad0eb[_0x1ede('0x2f')]=_[_0x1ede('0x30')](db[_0x1ede('0x2a')]['rawAttributes']);_0x5ad0eb['query']=_[_0x1ede('0x30')](_0x4909e1[_0x1ede('0x31')]);_0x5ad0eb[_0x1ede('0x32')]=_[_0x1ede('0x34')](_0x5ad0eb['model'],_0x5ad0eb[_0x1ede('0x31')]);_0x396d54['attributes']=_[_0x1ede('0x34')](_0x5ad0eb[_0x1ede('0x2f')],qs[_0x1ede('0x35')](_0x4909e1[_0x1ede('0x31')][_0x1ede('0x35')]));_0x396d54[_0x1ede('0x33')]=_0x396d54[_0x1ede('0x33')][_0x1ede('0x36')]?_0x396d54[_0x1ede('0x33')]:_0x5ad0eb['model'];if(_0x4909e1['query'][_0x1ede('0x3e')]){_0x396d54['include']=[{'all':!![]}];}_0x396d54=_['merge']({},_0x396d54,_0x4909e1['options']);return db['SmsApplication'][_0x1ede('0x44')](_0x396d54)[_0x1ede('0x24')](handleEntityNotFound(_0x221d1b,null))['then'](respondWithResult(_0x221d1b,null))[_0x1ede('0x42')](handleError(_0x221d1b,null));};exports[_0x1ede('0x45')]=function(_0x214177,_0x2da446){return db[_0x1ede('0x2a')][_0x1ede('0x45')](_0x214177[_0x1ede('0x46')],{})[_0x1ede('0x24')](respondWithResult(_0x2da446,0xc9))[_0x1ede('0x42')](handleError(_0x2da446,null));};exports['update']=function(_0x3ef14f,_0x53cd6c){if(_0x3ef14f['body']['id']){delete _0x3ef14f[_0x1ede('0x46')]['id'];}return db[_0x1ede('0x2a')]['find']({'where':{'id':_0x3ef14f[_0x1ede('0x43')]['id']}})[_0x1ede('0x24')](handleEntityNotFound(_0x53cd6c,null))[_0x1ede('0x24')](saveUpdates(_0x3ef14f[_0x1ede('0x46')],null))[_0x1ede('0x24')](respondWithResult(_0x53cd6c,null))[_0x1ede('0x42')](handleError(_0x53cd6c,null));};exports[_0x1ede('0x23')]=function(_0x143d11,_0x39b7f7){return db[_0x1ede('0x2a')][_0x1ede('0x44')]({'where':{'id':_0x143d11['params']['id']}})['then'](handleEntityNotFound(_0x39b7f7,null))['then'](removeEntity(_0x39b7f7,null))['catch'](handleError(_0x39b7f7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index d48d37d..742acab 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 _0x499f=['define','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x499f,0x99));var _0xf499=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x499f[_0x3e21f4];return _0x40fc49;};'use strict';var _=require(_0xf499('0x0'));var util=require(_0xf499('0x1'));var logger=require(_0xf499('0x2'))(_0xf499('0x3'));var moment=require(_0xf499('0x4'));var BPromise=require('bluebird');var rp=require(_0xf499('0x5'));var fs=require('fs');var path=require(_0xf499('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module['exports']=function(_0x479012,_0x187b73){return _0x479012[_0xf499('0x7')]('SmsApplication',attributes,{'tableName':_0xf499('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf499('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xba82=['sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication'];(function(_0x34cbdb,_0x40b6c8){var _0x5105f8=function(_0x5ac5d6){while(--_0x5ac5d6){_0x34cbdb['push'](_0x34cbdb['shift']());}};_0x5105f8(++_0x40b6c8);}(_0xba82,0x101));var _0x2ba8=function(_0x3a9b99,_0x51d630){_0x3a9b99=_0x3a9b99-0x0;var _0x1e7353=_0xba82[_0x3a9b99];return _0x1e7353;};'use strict';var _=require(_0x2ba8('0x0'));var util=require(_0x2ba8('0x1'));var logger=require(_0x2ba8('0x2'))(_0x2ba8('0x3'));var moment=require(_0x2ba8('0x4'));var BPromise=require(_0x2ba8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ba8('0x6'));var rimraf=require(_0x2ba8('0x7'));var config=require(_0x2ba8('0x8'));var attributes=require(_0x2ba8('0x9'));module[_0x2ba8('0xa')]=function(_0x1d79da,_0xfecf1b){return _0x1d79da[_0x2ba8('0xb')](_0x2ba8('0xc'),attributes,{'tableName':_0x2ba8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2ba8('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 034a814..ebe2042 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 _0x349f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xfa9b8f,_0x26d3ee){var _0x1d7700=function(_0x37ff76){while(--_0x37ff76){_0xfa9b8f['push'](_0xfa9b8f['shift']());}};_0x1d7700(++_0x26d3ee);}(_0x349f,0xa8));var _0xf349=function(_0x4bc3b4,_0x267891){_0x4bc3b4=_0x4bc3b4-0x0;var _0x4f39ee=_0x349f[_0x4bc3b4];return _0x4f39ee;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f4c,_0x1bd44a,_0x23fb4b){return new BPromise(function(_0x6c6cd2,_0x21a480){return client[_0xf349('0xd')](_0x4c6f4c,_0x23fb4b)[_0xf349('0xe')](function(_0x3e2147){logger['info']('SmsApplication,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));logger[_0xf349('0x10')](_0xf349('0x11'),_0x1bd44a,_0xf349('0xf'),JSON[_0xf349('0x12')](_0x3e2147));if(_0x3e2147['error']){if(_0x3e2147['error']['code']===0x1f4){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147[_0xf349('0x13')][_0xf349('0x15')]);return _0x21a480(_0x3e2147[_0xf349('0x13')]['message']);}logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147['error'][_0xf349('0x15')]);return _0x6c6cd2(_0x3e2147[_0xf349('0x13')]['message']);}else{logger[_0xf349('0x16')]('SmsApplication,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));_0x6c6cd2(_0x3e2147[_0xf349('0x17')][_0xf349('0x15')]);}})[_0xf349('0x18')](function(_0x14c06d){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x14c06d);_0x21a480(_0x14c06d);});});} \ No newline at end of file +var _0x59ac=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SmsApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x234318,_0xf22f31){var _0x1ab719=function(_0x10a0b1){while(--_0x10a0b1){_0x234318['push'](_0x234318['shift']());}};_0x1ab719(++_0xf22f31);}(_0x59ac,0x73));var _0xc59a=function(_0x25c72c,_0x14f0ab){_0x25c72c=_0x25c72c-0x0;var _0x57e28b=_0x59ac[_0x25c72c];return _0x57e28b;};'use strict';var _=require(_0xc59a('0x0'));var util=require(_0xc59a('0x1'));var moment=require(_0xc59a('0x2'));var BPromise=require(_0xc59a('0x3'));var rs=require(_0xc59a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59a('0x5'))['db'];var utils=require(_0xc59a('0x6'));var logger=require('../../config/logger')(_0xc59a('0x7'));var config=require(_0xc59a('0x8'));var jayson=require(_0xc59a('0x9'));var client=jayson[_0xc59a('0xa')][_0xc59a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5286c6,_0x364b03,_0x576a51){return new BPromise(function(_0x12806d,_0x5dc514){return client[_0xc59a('0xc')](_0x5286c6,_0x576a51)['then'](function(_0x3ba5c0){logger['info'](_0xc59a('0xd'),_0x364b03,'request\x20sent');logger[_0xc59a('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x364b03,_0xc59a('0xf'),JSON[_0xc59a('0x10')](_0x3ba5c0));if(_0x3ba5c0[_0xc59a('0x11')]){if(_0x3ba5c0['error'][_0xc59a('0x12')]===0x1f4){logger[_0xc59a('0x11')](_0xc59a('0xd'),_0x364b03,_0x3ba5c0['error'][_0xc59a('0x13')]);return _0x5dc514(_0x3ba5c0['error'][_0xc59a('0x13')]);}logger[_0xc59a('0x11')](_0xc59a('0xd'),_0x364b03,_0x3ba5c0[_0xc59a('0x11')][_0xc59a('0x13')]);return _0x12806d(_0x3ba5c0[_0xc59a('0x11')][_0xc59a('0x13')]);}else{logger[_0xc59a('0x14')](_0xc59a('0xd'),_0x364b03,_0xc59a('0xf'));_0x12806d(_0x3ba5c0[_0xc59a('0x15')][_0xc59a('0x13')]);}})[_0xc59a('0x16')](function(_0x16c9ef){logger[_0xc59a('0x11')](_0xc59a('0xd'),_0x364b03,_0x16c9ef);_0x5dc514(_0x16c9ef);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 29f17ed..abeb267 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 _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x2cb642,_0x248ad5){var _0x346dad=function(_0x1905fb){while(--_0x1905fb){_0x2cb642['push'](_0x2cb642['shift']());}};_0x346dad(++_0x248ad5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x1eba[_0x2ce6d5];return _0x32d272;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file +var _0x8f4c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x3d894f,_0x558358){var _0x5ddf2e=function(_0x428b32){while(--_0x428b32){_0x3d894f['push'](_0x3d894f['shift']());}};_0x5ddf2e(++_0x558358);}(_0x8f4c,0x113));var _0xc8f4=function(_0xc437bc,_0x751999){_0xc437bc=_0xc437bc-0x0;var _0x1519f6=_0x8f4c[_0xc437bc];return _0x1519f6;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f4('0x6'));var interaction=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var controller=require('./smsInteraction.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0x9')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router['get'](_0xc8f4('0xf'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x9')]('/:id/download',auth[_0xc8f4('0xd')](),controller['download']);router[_0xc8f4('0x11')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x12')]);router[_0xc8f4('0x11')](_0xc8f4('0xf'),auth['isAuthenticated'](),controller[_0xc8f4('0x13')]);router[_0xc8f4('0x11')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),'smsinteraction:addtags'),controller[_0xc8f4('0x17')]);router[_0xc8f4('0x18')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')]('sms',_0xc8f4('0x19')),controller['update']);router['delete'](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),_0xc8f4('0x1a')),controller[_0xc8f4('0x1b')]);router[_0xc8f4('0x1c')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x1d')]);module[_0xc8f4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 1e0f626..847c255 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 _0x78d3=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78d3,0x73));var _0x378d=function(_0x32b522,_0xbfd22d){_0x32b522=_0x32b522-0x0;var _0x203207=_0x78d3[_0x32b522];return _0x203207;};'use strict';var Sequelize=require(_0x378d('0x0'));var moment=require(_0x378d('0x1'));module[_0x378d('0x2')]={'closed':{'type':Sequelize[_0x378d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x378d('0x4')]},'disposition':{'type':Sequelize[_0x378d('0x5')]},'secondDisposition':{'type':Sequelize[_0x378d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x378d('0x5')]},'note':{'type':Sequelize[_0x378d('0x5')]},'phone':{'type':Sequelize[_0x378d('0x5')]},'read1stAt':{'type':Sequelize[_0x378d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x378d('0x6')]('in',_0x378d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x378d('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x378d('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1b69=['BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x1d9322,_0x2aef94){var _0x41bff1=function(_0x44f2c9){while(--_0x44f2c9){_0x1d9322['push'](_0x1d9322['shift']());}};_0x41bff1(++_0x2aef94);}(_0x1b69,0x190));var _0x91b6=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x1b69[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x91b6('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x91b6('0x1')]},'disposition':{'type':Sequelize[_0x91b6('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x91b6('0x2')]},'note':{'type':Sequelize[_0x91b6('0x2')]},'phone':{'type':Sequelize[_0x91b6('0x2')]},'read1stAt':{'type':Sequelize[_0x91b6('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x91b6('0x3')]('in',_0x91b6('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x91b6('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x91b6('0x3')]('in',_0x91b6('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x91b6('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index bc3d6d9..fb9baa8 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 _0x3cff=['findOne','SmsInteractionId','format','include','addTags','setTags','spread','Tag','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','Sms','N.A.','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','out','downloadInteraction.ejs','transcript-','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','status','end','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','start','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','where','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','includeAll','merge','options','create','describe','addMessage','SmsMessage','ids','omit'];(function(_0xf4da15,_0x2970f3){var _0x27b875=function(_0x11c7f9){while(--_0x11c7f9){_0xf4da15['push'](_0xf4da15['shift']());}};_0x27b875(++_0x2970f3);}(_0x3cff,0x10b));var _0xf3cf=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x3cff[_0x40f9a0];return _0x3e3144;};'use strict';var emlformat=require(_0xf3cf('0x0'));var rimraf=require(_0xf3cf('0x1'));var zipdir=require(_0xf3cf('0x2'));var jsonpatch=require(_0xf3cf('0x3'));var rp=require(_0xf3cf('0x4'));var moment=require(_0xf3cf('0x5'));var BPromise=require(_0xf3cf('0x6'));var Mustache=require(_0xf3cf('0x7'));var util=require(_0xf3cf('0x8'));var path=require('path');var sox=require(_0xf3cf('0x9'));var csv=require(_0xf3cf('0xa'));var ejs=require(_0xf3cf('0xb'));var fs=require('fs');var fs_extra=require(_0xf3cf('0xc'));var _=require(_0xf3cf('0xd'));var squel=require(_0xf3cf('0xe'));var crypto=require(_0xf3cf('0xf'));var jsforce=require(_0xf3cf('0x10'));var deskjs=require(_0xf3cf('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf3cf('0x12'));var Papa=require(_0xf3cf('0x13'));var Redis=require(_0xf3cf('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf3cf('0x15'));var as=require(_0xf3cf('0x16'));var pdf=require(_0xf3cf('0x17'));var hardwareService=require(_0xf3cf('0x18'));var logger=require(_0xf3cf('0x19'))(_0xf3cf('0x1a'));var utils=require(_0xf3cf('0x1b'));var config=require(_0xf3cf('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3cf('0x1d'))['db'];config[_0xf3cf('0x1e')]=_[_0xf3cf('0x1f')](config[_0xf3cf('0x1e')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3cf('0x1e')]));require('./smsInteraction.socket')[_0xf3cf('0x20')](socket);function respondWithStatusCode(_0xef3c08,_0x2f5eb3){_0x2f5eb3=_0x2f5eb3||0xcc;return function(_0x1699ea){if(_0x1699ea){return _0xef3c08[_0xf3cf('0x21')](_0x2f5eb3);}return _0xef3c08['status'](_0x2f5eb3)['end']();};}function respondWithResult(_0x16585f,_0x43471e){_0x43471e=_0x43471e||0xc8;return function(_0x5627cb){if(_0x5627cb){return _0x16585f['status'](_0x43471e)[_0xf3cf('0x22')](_0x5627cb);}};}function respondWithFilteredResult(_0x2cbc47,_0x1d16e9){return function(_0x3d60aa){if(_0x3d60aa){var _0x1f48a0=typeof _0x1d16e9[_0xf3cf('0x23')]===_0xf3cf('0x24')&&typeof _0x1d16e9[_0xf3cf('0x25')]===_0xf3cf('0x24');var _0x1882f7=_0x3d60aa[_0xf3cf('0x26')];var _0x5b46ff=_0x1f48a0?0x0:_0x1d16e9[_0xf3cf('0x23')];var _0x439b40=_0x1f48a0?_0x3d60aa[_0xf3cf('0x26')]:_0x1d16e9[_0xf3cf('0x23')]+_0x1d16e9['limit'];var _0x195a2d;if(_0x439b40>=_0x1882f7){_0x439b40=_0x1882f7;_0x195a2d=0xc8;}else{_0x195a2d=0xce;}_0x2cbc47['status'](_0x195a2d);return _0x2cbc47[_0xf3cf('0x27')](_0xf3cf('0x28'),_0x5b46ff+'-'+_0x439b40+'/'+_0x1882f7)['json'](_0x3d60aa);}return null;};}function patchUpdates(_0x3eb33b){return function(_0x10ee31){try{jsonpatch[_0xf3cf('0x29')](_0x10ee31,_0x3eb33b,!![]);}catch(_0x3a8b7e){return BPromise['reject'](_0x3a8b7e);}return _0x10ee31['save']();};}function saveUpdates(_0x57ffb9,_0x2b6ae9){return function(_0x1d2deb){if(_0x1d2deb){return _0x1d2deb[_0xf3cf('0x2a')](_0x57ffb9)['then'](function(_0x3509ba){return _0x3509ba;});}return null;};}function removeEntity(_0x5de0ed,_0x5762de){return function(_0x5c5d09){if(_0x5c5d09){return _0x5c5d09[_0xf3cf('0x2b')]()[_0xf3cf('0x2c')](function(){_0x5de0ed[_0xf3cf('0x2d')](0xcc)[_0xf3cf('0x2e')]();});}};}function handleEntityNotFound(_0x467099,_0x4ac70b){return function(_0x15d356){if(!_0x15d356){_0x467099[_0xf3cf('0x21')](0x194);}return _0x15d356;};}function handleError(_0x2c9123,_0x5deb53){_0x5deb53=_0x5deb53||0x1f4;return function(_0x2d5a0d){logger[_0xf3cf('0x2f')](_0x2d5a0d[_0xf3cf('0x30')]);if(_0x2d5a0d[_0xf3cf('0x31')]){delete _0x2d5a0d[_0xf3cf('0x31')];}_0x2c9123['status'](_0x5deb53)['send'](_0x2d5a0d);};}function getInteractionUsers(_0x1d7827,_0x2cbbfc){return new BPromise(function(_0x40df4e,_0x1310c9){try{if(_0x2cbbfc[_0x1d7827['id']]){_0x1d7827[_0xf3cf('0x32')]=_[_0xf3cf('0x33')](_0x2cbbfc[_0x1d7827['id']],function(_0x3a1698){return{'id':_0x3a1698['id'],'fullname':_0x3a1698[_0xf3cf('0x34')]};});}}catch(_0x330492){_0x1310c9(_0x330492);}_0x40df4e(_0x1d7827);});}function getInteractionTags(_0x61fd39,_0x1a35d2){return new BPromise(function(_0x4b248a,_0x4db98b){try{if(_0x61fd39[_0xf3cf('0x35')]){_0x61fd39[_0xf3cf('0x36')]=[];_0x61fd39['TagIds'][_0xf3cf('0x37')](',')[_0xf3cf('0x38')](function(_0x2059f1){_0x61fd39[_0xf3cf('0x36')]['push'](_0x1a35d2[_0x2059f1]);});}delete _0x61fd39[_0xf3cf('0x35')];}catch(_0x4b7089){_0x4db98b(_0x4b7089);}_0x4b248a(_0x61fd39);});}function updateSmsInteraction(_0x3761c0,_0x224de0,_0x11bbbb){return new BPromise(function(_0x32b081,_0x3b7269){return getInteractionUsers(_0x3761c0,_0x11bbbb)['then'](function(_0x5dbaee){return getInteractionTags(_0x5dbaee,_0x224de0);})[_0xf3cf('0x2c')](function(_0x47a6da){_0x32b081(_0x47a6da);})[_0xf3cf('0x39')](function(_0x29ac6b){_0x3b7269(_0x29ac6b);});});}exports[_0xf3cf('0x3a')]=function(_0x28a99c,_0x3e8f02){var _0x596eea={},_0x33ef07={},_0xf6bcad={'count':0x0,'rows':[]};var _0x3d6b08=_[_0xf3cf('0x33')](db[_0xf3cf('0x3b')][_0xf3cf('0x3c')],function(_0x196d6d){return{'name':_0x196d6d[_0xf3cf('0x3d')],'type':_0x196d6d[_0xf3cf('0x3e')]['key']};});_0x33ef07[_0xf3cf('0x3f')]=_[_0xf3cf('0x33')](_0x3d6b08,_0xf3cf('0x31'));_0x33ef07[_0xf3cf('0x40')]=_[_0xf3cf('0x41')](_0x28a99c['query']);_0x33ef07['filters']=_[_0xf3cf('0x42')](_0x33ef07['model'],_0x33ef07[_0xf3cf('0x40')]);_0x596eea[_0xf3cf('0x43')]=_[_0xf3cf('0x42')](_0x33ef07[_0xf3cf('0x3f')],qs[_0xf3cf('0x44')](_0x28a99c['query'][_0xf3cf('0x44')]));_0x596eea[_0xf3cf('0x43')]=_0x596eea[_0xf3cf('0x43')]['length']?_0x596eea[_0xf3cf('0x43')]:_0x33ef07[_0xf3cf('0x3f')];if(!_0x28a99c['query'][_0xf3cf('0x45')](_0xf3cf('0x46'))){_0x596eea[_0xf3cf('0x25')]=qs['limit'](_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x25')]);_0x596eea[_0xf3cf('0x23')]=qs[_0xf3cf('0x23')](_0x28a99c['query'][_0xf3cf('0x23')]);}_0x596eea[_0xf3cf('0x47')]=qs[_0xf3cf('0x48')](_0x28a99c[_0xf3cf('0x40')]['sort']);_0x596eea['where']=qs[_0xf3cf('0x49')](_[_0xf3cf('0x4a')](_0x28a99c[_0xf3cf('0x40')],_0x33ef07[_0xf3cf('0x49')]),_0x3d6b08);var _0x449c3e=[];var _0x1ce4f4=squel[_0xf3cf('0x4b')]()['field']('id')[_0xf3cf('0x4c')](_0xf3cf('0x31'))[_0xf3cf('0x4c')]('color')[_0xf3cf('0x4d')](_0xf3cf('0x4e'));var _0x5eaee2=squel[_0xf3cf('0x4b')]()['field']('u.id')[_0xf3cf('0x4c')](_0xf3cf('0x4f'))['field'](_0xf3cf('0x50'))['from'](_0xf3cf('0x51'),'ui')[_0xf3cf('0x52')](_0xf3cf('0x53'),'u',_0xf3cf('0x54'));var _0x11b10b=squel['select']()[_0xf3cf('0x4d')]('sms_interactions','i')['left_join'](_0xf3cf('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf3cf('0x53'),'o','o.id\x20=\x20i.UserId')[_0xf3cf('0x52')](_0xf3cf('0x56'),'a','a.id\x20=\x20i.SmsAccountId')[_0xf3cf('0x52')](_0xf3cf('0x57'),'me',_0xf3cf('0x58'))[_0xf3cf('0x52')]('sms_interaction_has_tags','it',_0xf3cf('0x59'))['left_join'](_0xf3cf('0x4e'),'t',_0xf3cf('0x5a'));var _0x825eb0=squel[_0xf3cf('0x5b')]();var _0x278656=[];var _0x5f3dd7=squel[_0xf3cf('0x5b')]();var _0x1ca49f;if(_0x28a99c[_0xf3cf('0x40')]['search']){_0x1ca49f=as[_0xf3cf('0x5c')](_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x5d')]);var _0x5956a9=_0x1ca49f[_0xf3cf('0x5e')];for(var _0x3c9fd6=0x0;_0x3c9fd6<_0x1ca49f[_0xf3cf('0x5f')][_0xf3cf('0x60')];_0x3c9fd6++){var _0x449f52=_0x1ca49f[_0xf3cf('0x5f')][_0x3c9fd6];var _0x12bcb4='i';var _0x201cd3=_['find'](_0x3d6b08,[_0xf3cf('0x31'),_0x449f52[_0xf3cf('0x4c')]]);if(!_0x201cd3){switch(_0x449f52[_0xf3cf('0x4c')]){case _0xf3cf('0x61'):if(_0x449f52[_0xf3cf('0x62')]==0x1){_0x11b10b[_0xf3cf('0x63')]('`'+_0x449f52[_0xf3cf('0x4c')]+'`\x20=\x200');}else{_0x11b10b['having']('`'+_0x449f52[_0xf3cf('0x4c')]+_0xf3cf('0x64'));}break;case _0xf3cf('0x65'):if(_0x449f52[_0xf3cf('0x66')]===_0xf3cf('0x67')){if(_0x449f52[_0xf3cf('0x62')]['split']('\x20')[_0xf3cf('0x60')]>0x1){_0x825eb0[_0x5956a9](_0xf3cf('0x68'),qs['getFullTextValue'](_0x449f52[_0xf3cf('0x62')]),null);}else{var _0x5350a1='%'+_0x449f52[_0xf3cf('0x62')]+'%';_0x825eb0[_0x5956a9]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5350a1,_0x5350a1,_0x5350a1);}}else{_0x201cd3=_[_0xf3cf('0x69')](_0x3d6b08,[_0xf3cf('0x31'),'ContactId']);_0x449f52[_0xf3cf('0x4c')]=_0xf3cf('0x6a');_0x1250a6=as[_0xf3cf('0x6b')](_0x12bcb4,_0x201cd3[_0xf3cf('0x3e')],_0x449f52);_0x825eb0[_0x5956a9](_0x1250a6[_0xf3cf('0x6c')],_0x1250a6[_0xf3cf('0x62')]['start'],_0x1250a6['value'][_0xf3cf('0x2e')]);}break;case'Tag':var _0x57fb6b=_0x449f52[_0xf3cf('0x62')][_0xf3cf('0x37')](',')[_0xf3cf('0x33')](function(_0x4284d5){return Number(_0x4284d5);});_0x57fb6b[_0xf3cf('0x38')](function(_0x47dd8e){_0x5f3dd7['or'](_0xf3cf('0x6d'),'%,'+_0x47dd8e+',%');});_0x278656=_[_0xf3cf('0x6e')](_0x278656,_0x57fb6b);break;case _0xf3cf('0x6f'):if(_0x449f52[_0xf3cf('0x66')]===_0xf3cf('0x67')){_0x825eb0[_0x5956a9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x449f52['value']+'%',null);}else{_0x201cd3=_[_0xf3cf('0x69')](_0x3d6b08,[_0xf3cf('0x31'),_0xf3cf('0x70')]);_0x449f52[_0xf3cf('0x4c')]=_0xf3cf('0x70');_0x1250a6=as['buildExpression'](_0x12bcb4,_0x201cd3[_0xf3cf('0x3e')],_0x449f52);_0x825eb0[_0x5956a9](_0x1250a6[_0xf3cf('0x6c')],_0x1250a6[_0xf3cf('0x62')][_0xf3cf('0x71')],_0x1250a6[_0xf3cf('0x62')][_0xf3cf('0x2e')]);}break;case _0xf3cf('0x72'):_0x1250a6=as['buildExpression']('me',null,_0x449f52);_0x825eb0[_0x5956a9](_0x1250a6[_0xf3cf('0x6c')],_0x1250a6[_0xf3cf('0x62')][_0xf3cf('0x71')],_0x1250a6[_0xf3cf('0x62')]['end']);break;}}else{var _0x1250a6=as[_0xf3cf('0x6b')](_0x12bcb4,_0x201cd3['type'],_0x449f52);_0x825eb0[_0x5956a9](_0x1250a6[_0xf3cf('0x6c')],_0x1250a6[_0xf3cf('0x62')][_0xf3cf('0x71')],_0x1250a6['value'][_0xf3cf('0x2e')]);}}}else{var _0x10dfe2=_(_0x28a99c[_0xf3cf('0x40')])['keys']()[_0xf3cf('0x33')](function(_0x54a25d){return _[_0xf3cf('0x73')](_0x3d6b08,['name',_0x54a25d])?_0x54a25d:undefined;})[_0xf3cf('0x74')]()[_0xf3cf('0x62')]();if(!_[_0xf3cf('0x75')](_0x10dfe2)){_0x10dfe2['forEach'](function(_0x26c5e7){if(_0x26c5e7===_0xf3cf('0x76')){_0x11b10b['where'](_0xf3cf('0x77'),[][_0xf3cf('0x78')](_0x28a99c[_0xf3cf('0x40')][_0x26c5e7]));}else if(_0x26c5e7===_0xf3cf('0x79')){var _0x5651e4=JSON[_0xf3cf('0x7a')](_0x28a99c[_0xf3cf('0x40')][_0x26c5e7])['$gte'];var _0x9042b8=JSON[_0xf3cf('0x7a')](_0x28a99c['query'][_0x26c5e7])[_0xf3cf('0x7b')];_0x11b10b['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5651e4,_0x9042b8);}else{if(_0x28a99c['query'][_0x26c5e7]==='null'){_0x11b10b['where']('i.'+_0x26c5e7+_0xf3cf('0x7c'));}else{_0x11b10b[_0xf3cf('0x7d')]('i.'+_0x26c5e7+'\x20=\x20?',_0x28a99c[_0xf3cf('0x40')][_0x26c5e7]);}}});}if(_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x7e')]){if(_0x28a99c['query'][_0xf3cf('0x7e')]==0x1){_0x11b10b[_0xf3cf('0x63')](_0xf3cf('0x7f'));}else{_0x11b10b[_0xf3cf('0x63')](_0xf3cf('0x80'));}}if(_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x81')]){_0x278656=_[_0xf3cf('0x82')](_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x81')])?_0x28a99c['query'][_0xf3cf('0x81')]:new Array(_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x81')]);_0x278656[_0xf3cf('0x38')](function(_0x4512ce){_0x5f3dd7['or'](_0xf3cf('0x6d'),'%,'+_0x4512ce+',%');});}if(_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x83')]){var _0x3f80cc=_0x28a99c[_0xf3cf('0x40')]['filter'][_0xf3cf('0x84')]('\x5c','\x5c\x5c')[_0xf3cf('0x84')](/'/g,'\x27\x27');if(qs[_0xf3cf('0x85')](_0x3f80cc)){_0x825eb0['or'](_0xf3cf('0x86'),_0x3f80cc+'%')['or'](_0xf3cf('0x87'),_0x3f80cc+'%');}else{_0x825eb0['or'](_0xf3cf('0x88'),qs['getFullTextValue'](_0x3f80cc))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3f80cc+'%');}}}_0x11b10b[_0xf3cf('0x7d')](_0x825eb0);_0x11b10b[_0xf3cf('0x89')](_0xf3cf('0x8a'));var _0x21117d={'type':db[_0xf3cf('0x8b')][_0xf3cf('0x8c')][_0xf3cf('0x8d')],'raw':!![]};var _0xed6ff5=_0x11b10b['clone']();_0xed6ff5['field'](_0xf3cf('0x8a'));_0xed6ff5[_0xf3cf('0x4c')](_0xf3cf('0x8e'),'unreadMessages');if(_0x596eea[_0xf3cf('0x47')]){_0x596eea[_0xf3cf('0x47')][_0xf3cf('0x38')](function(_0x4abd6c){var _0x1831a6=_0x4abd6c[0x0]==='contactName'?_0x4abd6c[0x0]:'i.'+_0x4abd6c[0x0];_0x11b10b[_0xf3cf('0x47')](_0x1831a6,_0x4abd6c[0x1]===_0xf3cf('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x278656)){_0x11b10b['having'](_0x5f3dd7);_0xed6ff5[_0xf3cf('0x7d')]('t.id\x20IN\x20?',_0x278656);}BPromise[_0xf3cf('0x90')]()[_0xf3cf('0x2c')](function(){if(!_0x1ca49f){if(_0x28a99c['query'][_0xf3cf('0x76')])return;_0xed6ff5[_0xf3cf('0x7d')](_0xf3cf('0x91'));_0x11b10b[_0xf3cf('0x7d')](_0xf3cf('0x91'));return;}if(_0x28a99c[_0xf3cf('0x92')][_0xf3cf('0x93')]!=='agent')return;return _0x28a99c[_0xf3cf('0x92')][_0xf3cf('0x94')]({'attributes':['id'],'raw':!![]})[_0xf3cf('0x2c')](function(_0x5d66fb){if(_[_0xf3cf('0x75')](_0x5d66fb)){_0xed6ff5[_0xf3cf('0x7d')](_0xf3cf('0x95'));_0x11b10b['where'](_0xf3cf('0x95'));}else{_0xed6ff5[_0xf3cf('0x7d')]('i.SmsAccountId\x20IN\x20?',_[_0xf3cf('0x33')](_0x5d66fb,'id'));_0x11b10b[_0xf3cf('0x7d')](_0xf3cf('0x77'),_[_0xf3cf('0x33')](_0x5d66fb,'id'));}});})['then'](function(){if(_0x28a99c[_0xf3cf('0x92')]['role']==='agent'&&!_0x1ca49f&&!_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x76')])return[];return db[_0xf3cf('0x96')][_0xf3cf('0x40')](_0xed6ff5[_0xf3cf('0x97')](),_0x21117d);})[_0xf3cf('0x2c')](function(_0x1db50a){_0xf6bcad[_0xf3cf('0x26')]=_0x1db50a['length'];if(_0xf6bcad[_0xf3cf('0x26')]===0x0)return[];return db['sequelize'][_0xf3cf('0x40')](_0x1ce4f4[_0xf3cf('0x97')](),_0x21117d)[_0xf3cf('0x2c')](function(_0xc2d28c){_0x449c3e=_[_0xf3cf('0x98')](_0xc2d28c,'id');_0x21117d=_['merge'](_0x21117d,{'model':db[_0xf3cf('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x28a99c[_0xf3cf('0x40')][_0xf3cf('0x44')]){_0x596eea[_0xf3cf('0x43')][_0xf3cf('0x38')](function(_0xab5446){_0x11b10b[_0xf3cf('0x4c')]('i.'+_0xab5446);});}else{_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0x8e'),'unreadMessages');_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0x99'),_0xf3cf('0x9a'));_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0x9b'),'Account.mandatoryDisposition');_0x11b10b[_0xf3cf('0x4c')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0x9c'));_0x11b10b[_0xf3cf('0x4c')]('c.firstName','Contact.firstName');_0x11b10b[_0xf3cf('0x4c')]('c.lastName',_0xf3cf('0x9d'));_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0x9e'),_0xf3cf('0x9f'));_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0xa0'),'Contact.phone');_0x11b10b['field'](_0xf3cf('0xa1'),'Contact.mobile');_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0xa2'),_0xf3cf('0xa3'));_0x11b10b[_0xf3cf('0x4c')]('o.fullname',_0xf3cf('0xa4'));_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0xa5'),_0xf3cf('0xa6'));_0x11b10b[_0xf3cf('0x4c')](_0xf3cf('0xa7'),'TagIds');}if(_0x596eea[_0xf3cf('0x25')])_0x11b10b[_0xf3cf('0x25')](_0x596eea[_0xf3cf('0x25')]);if(_0x596eea[_0xf3cf('0x23')])_0x11b10b[_0xf3cf('0x23')](_0x596eea['offset']);return db['sequelize'][_0xf3cf('0x40')](_0x11b10b[_0xf3cf('0x97')](),_0x21117d);})['then'](function(_0x4a20c2){if(_0x4a20c2[_0xf3cf('0x60')]>0x0)_0x5eaee2[_0xf3cf('0x7d')]('ui.SmsInteractionId\x20IN\x20?',_[_0xf3cf('0x33')](_0x4a20c2,'id'));return db[_0xf3cf('0x96')][_0xf3cf('0x40')](_0x5eaee2[_0xf3cf('0x97')](),_0x21117d)[_0xf3cf('0x2c')](function(_0x37ea22){var _0x407ec5=_[_0xf3cf('0xa8')](_0x37ea22,'SmsInteractionId');var _0x510463=[];_0x4a20c2[_0xf3cf('0x38')](function(_0x21aa58){_0x510463[_0xf3cf('0xa9')](updateSmsInteraction(_0x21aa58,_0x449c3e,_0x407ec5));});return BPromise[_0xf3cf('0xaa')](_0x510463);});});})['then'](function(_0x7f7b92){_0xf6bcad[_0xf3cf('0xab')]=_0x7f7b92;return _0xf6bcad;})[_0xf3cf('0x2c')](respondWithFilteredResult(_0x3e8f02,_0x596eea))[_0xf3cf('0x39')](handleError(_0x3e8f02,null));};exports[_0xf3cf('0xac')]=function(_0x3549c8,_0x1eb200){var _0x1c9a45={'raw':![],'where':{'id':_0x3549c8[_0xf3cf('0xad')]['id']}},_0x449f36={};_0x449f36[_0xf3cf('0x3f')]=_[_0xf3cf('0x41')](db[_0xf3cf('0x3b')]['rawAttributes']);_0x449f36[_0xf3cf('0x40')]=_[_0xf3cf('0x41')](_0x3549c8[_0xf3cf('0x40')]);_0x449f36[_0xf3cf('0x49')]=_['intersection'](_0x449f36[_0xf3cf('0x3f')],_0x449f36[_0xf3cf('0x40')]);_0x1c9a45[_0xf3cf('0x43')]=_[_0xf3cf('0x42')](_0x449f36[_0xf3cf('0x3f')],qs['fields'](_0x3549c8[_0xf3cf('0x40')][_0xf3cf('0x44')]));_0x1c9a45['attributes']=_0x1c9a45[_0xf3cf('0x43')][_0xf3cf('0x60')]?_0x1c9a45[_0xf3cf('0x43')]:_0x449f36[_0xf3cf('0x3f')];if(_0x3549c8[_0xf3cf('0x40')][_0xf3cf('0xae')]){_0x1c9a45['include']=[{'all':!![]}];}_0x1c9a45=_[_0xf3cf('0xaf')]({},_0x1c9a45,_0x3549c8[_0xf3cf('0xb0')]);return db[_0xf3cf('0x3b')][_0xf3cf('0x69')](_0x1c9a45)[_0xf3cf('0x2c')](handleEntityNotFound(_0x1eb200,null))[_0xf3cf('0x2c')](respondWithResult(_0x1eb200,null))[_0xf3cf('0x39')](handleError(_0x1eb200,null));};exports[_0xf3cf('0xb1')]=function(_0x51994a,_0x5a0db4){return db['SmsInteraction'][_0xf3cf('0xb1')](_0x51994a[_0xf3cf('0x72')],{})[_0xf3cf('0x2c')](respondWithResult(_0x5a0db4,0xc9))['catch'](handleError(_0x5a0db4,null));};exports[_0xf3cf('0x2a')]=function(_0x11ad1a,_0x2274ca){if(_0x11ad1a[_0xf3cf('0x72')]['id']){delete _0x11ad1a[_0xf3cf('0x72')]['id'];}return db[_0xf3cf('0x3b')]['find']({'where':{'id':_0x11ad1a[_0xf3cf('0xad')]['id']}})[_0xf3cf('0x2c')](handleEntityNotFound(_0x2274ca,null))[_0xf3cf('0x2c')](saveUpdates(_0x11ad1a[_0xf3cf('0x72')],null))[_0xf3cf('0x2c')](respondWithResult(_0x2274ca,null))['catch'](handleError(_0x2274ca,null));};exports[_0xf3cf('0x2b')]=function(_0x38c045,_0x9eeb64){return db[_0xf3cf('0x3b')][_0xf3cf('0x69')]({'where':{'id':_0x38c045[_0xf3cf('0xad')]['id']}})[_0xf3cf('0x2c')](handleEntityNotFound(_0x9eeb64,null))[_0xf3cf('0x2c')](removeEntity(_0x9eeb64,null))[_0xf3cf('0x39')](handleError(_0x9eeb64,null));};exports[_0xf3cf('0xb2')]=function(_0x2b537f,_0x267087){return db[_0xf3cf('0x3b')]['describe']()[_0xf3cf('0x2c')](respondWithResult(_0x267087,null))[_0xf3cf('0x39')](handleError(_0x267087,null));};exports[_0xf3cf('0xb3')]=function(_0x33a91e,_0x2f98b3,_0x44976e){return db[_0xf3cf('0xb4')][_0xf3cf('0x69')]({'where':{'id':_0x33a91e[_0xf3cf('0xad')]['id']}})['then'](handleEntityNotFound(_0x2f98b3,null))['then'](function(_0x1e8bb4){if(_0x1e8bb4){return _0x1e8bb4[_0xf3cf('0xb3')](_0x33a91e['body'][_0xf3cf('0xb5')],_[_0xf3cf('0xb6')](_0x33a91e[_0xf3cf('0x72')],['ids','id'])||{});}})[_0xf3cf('0x2c')](respondWithResult(_0x2f98b3,null))[_0xf3cf('0x39')](handleError(_0x2f98b3,null));};exports['getMessages']=function(_0x22267a,_0x14ba8c,_0x4fc80b){var _0x58d3cd={'raw':![],'where':{}};var _0x277e17={};var _0x1955b2={'count':0x0,'rows':[]};return db[_0xf3cf('0x3b')][_0xf3cf('0xb7')]({'where':{'id':_0x22267a[_0xf3cf('0xad')]['id']}})['then'](handleEntityNotFound(_0x14ba8c,null))[_0xf3cf('0x2c')](function(_0x55426a){if(_0x55426a){_0x277e17[_0xf3cf('0x3f')]=_[_0xf3cf('0x41')](db[_0xf3cf('0xb4')][_0xf3cf('0x3c')]);_0x277e17[_0xf3cf('0x40')]=_[_0xf3cf('0x41')](_0x22267a[_0xf3cf('0x40')]);_0x277e17[_0xf3cf('0x49')]=_['intersection'](_0x277e17[_0xf3cf('0x3f')],_0x277e17[_0xf3cf('0x40')]);_0x58d3cd[_0xf3cf('0x43')]=_['intersection'](_0x277e17['model'],qs['fields'](_0x22267a[_0xf3cf('0x40')]['fields']));_0x58d3cd['attributes']=_0x58d3cd[_0xf3cf('0x43')][_0xf3cf('0x60')]?_0x58d3cd[_0xf3cf('0x43')]:_0x277e17['model'];if(!_0x22267a[_0xf3cf('0x40')][_0xf3cf('0x45')]('nolimit')){_0x58d3cd['limit']=qs[_0xf3cf('0x25')](_0x22267a['query']['limit']);_0x58d3cd[_0xf3cf('0x23')]=qs[_0xf3cf('0x23')](_0x22267a['query'][_0xf3cf('0x23')]);}_0x58d3cd[_0xf3cf('0x47')]=qs[_0xf3cf('0x48')](_0x22267a[_0xf3cf('0x40')][_0xf3cf('0x48')]);_0x58d3cd[_0xf3cf('0x7d')]=qs[_0xf3cf('0x49')](_[_0xf3cf('0x4a')](_0x22267a[_0xf3cf('0x40')],_0x277e17[_0xf3cf('0x49')]));_0x58d3cd['where'][_0xf3cf('0xb8')]=_0x55426a['id'];if(_0x22267a[_0xf3cf('0x40')][_0xf3cf('0x83')]){_0x58d3cd[_0xf3cf('0x7d')]=_[_0xf3cf('0xaf')](_0x58d3cd[_0xf3cf('0x7d')],{'$or':_[_0xf3cf('0x33')](_0x58d3cd[_0xf3cf('0x43')],function(_0x10eaac){var _0x18dc73={};_0x18dc73[_0x10eaac]={'$like':'%'+_0x22267a['query']['filter']+'%'};return _0x18dc73;})});}if(_0x22267a[_0xf3cf('0x40')]['$gte']){var _0x33aaea=_0x22267a['query']['$gte'][_0xf3cf('0x37')](',');var _0x56293d={};_0x56293d[_0x33aaea[0x0]]={'$gte':moment(_0x33aaea[0x1])[_0xf3cf('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x58d3cd[_0xf3cf('0x7d')]=_[_0xf3cf('0xaf')](_0x58d3cd[_0xf3cf('0x7d')],_0x56293d);}_0x58d3cd=_['merge']({},_0x58d3cd,_0x22267a['options']);return db[_0xf3cf('0xb4')][_0xf3cf('0x26')]({'where':_0x58d3cd['where']})['then'](function(_0x1ac271){_0x1955b2[_0xf3cf('0x26')]=_0x1ac271;if(_0x22267a[_0xf3cf('0x40')][_0xf3cf('0xae')]){_0x58d3cd[_0xf3cf('0xba')]=[{'all':!![]}];}return db[_0xf3cf('0xb4')]['findAll'](_0x58d3cd);})[_0xf3cf('0x2c')](function(_0x198ddb){_0x1955b2[_0xf3cf('0xab')]=_0x198ddb;return _0x1955b2;});}})[_0xf3cf('0x2c')](respondWithFilteredResult(_0x14ba8c,_0x58d3cd))[_0xf3cf('0x39')](handleError(_0x14ba8c,null));};exports[_0xf3cf('0xbb')]=function(_0xb4593c,_0x49ba05,_0x2831e3){return db[_0xf3cf('0x3b')][_0xf3cf('0x69')]({'where':{'id':_0xb4593c[_0xf3cf('0xad')]['id']}})[_0xf3cf('0x2c')](handleEntityNotFound(_0x49ba05,null))[_0xf3cf('0x2c')](function(_0x2c54e8){if(_0x2c54e8){return _0x2c54e8[_0xf3cf('0xbc')](_0xb4593c[_0xf3cf('0x72')][_0xf3cf('0xb5')],_['omit'](_0xb4593c[_0xf3cf('0x72')],[_0xf3cf('0xb5'),'id'])||{})[_0xf3cf('0xbd')](function(){return db[_0xf3cf('0xbe')][_0xf3cf('0xbf')]({'attributes':['id',_0xf3cf('0x31'),_0xf3cf('0xc0')],'where':{'id':_0xb4593c[_0xf3cf('0x72')][_0xf3cf('0xb5')]}});})[_0xf3cf('0x2c')](function(_0x1d2269){socket[_0xf3cf('0xc1')](_0xf3cf('0xc2'),{'id':Number(_0xb4593c['params']['id']),'tags':_0x1d2269||[]});return{'id':Number(_0xb4593c[_0xf3cf('0xad')]['id']),'tags':_0x1d2269||[]};});}})[_0xf3cf('0x2c')](respondWithResult(_0x49ba05,null))['catch'](handleError(_0x49ba05,null));};exports['removeTags']=function(_0x168dfa,_0x461221,_0x185ea0){return db[_0xf3cf('0x3b')][_0xf3cf('0x69')]({'where':{'id':_0x168dfa[_0xf3cf('0xad')]['id']}})[_0xf3cf('0x2c')](handleEntityNotFound(_0x461221,null))[_0xf3cf('0x2c')](function(_0x1444d4){if(_0x1444d4){return _0x1444d4[_0xf3cf('0xc3')](_0x168dfa[_0xf3cf('0x40')][_0xf3cf('0xb5')]);}})['then'](respondWithStatusCode(_0x461221,null))[_0xf3cf('0x39')](handleError(_0x461221,null));};exports[_0xf3cf('0xc4')]=function(_0xca28a6,_0x3f4d7b){var _0x24f435=moment()[_0xf3cf('0xc5')]()['toString']();var _0x46854a=path[_0xf3cf('0xc6')](config['root'],_0xf3cf('0xc7'),_0xf3cf('0xc8'),_0xf3cf('0xc9'));var _0x423822=path[_0xf3cf('0xc6')](config['root'],_0xf3cf('0xc7'),_0xf3cf('0xc8'),_0xf3cf('0xca'));var _0x534833=path[_0xf3cf('0xc6')](_0x46854a,_0x24f435);var _0x502515=util[_0xf3cf('0xb9')](_0xf3cf('0xcb'),_0xca28a6['params']['id'],_0x24f435);var _0x4bc874=path[_0xf3cf('0xc6')](_0x46854a,_0x502515);var _0x15bd08=[];_0x15bd08[_0xf3cf('0xa9')]({'model':db['User'],'as':'User','attributes':['id',_0xf3cf('0x34')],'raw':!![]});_0x15bd08[_0xf3cf('0xa9')]({'model':db[_0xf3cf('0xcc')],'as':_0xf3cf('0x65'),'attributes':['id',_0xf3cf('0xcd'),_0xf3cf('0xce')],'raw':!![]});var _0x56c8f4=[{'model':db[_0xf3cf('0xb4')],'as':_0xf3cf('0xcf'),'attributes':['id',_0xf3cf('0x72'),_0xf3cf('0x79'),_0xf3cf('0xd0'),_0xf3cf('0xd1'),_0xf3cf('0x7e')],'include':_0x15bd08}];_0x56c8f4[_0xf3cf('0xa9')]({'model':db[_0xf3cf('0xd2')],'as':_0xf3cf('0xd3'),'attributes':['id',_0xf3cf('0x31')]});_0x56c8f4['push']({'model':db[_0xf3cf('0x6f')],'as':_0xf3cf('0xd4'),'attributes':['id','fullname']});return db[_0xf3cf('0x3b')][_0xf3cf('0x69')]({'where':{'id':_0xca28a6['params']['id']},'include':_0x56c8f4})['then'](handleEntityNotFound(_0x3f4d7b,null))[_0xf3cf('0x2c')](function(_0x58acff){if(_0x58acff){var _0x5f2b77=_0x58acff['get']({'plain':!![]});fs['mkdirSync'](_0x534833);var _0x416ae4={'channel':_0xf3cf('0xd5'),'account':_0x5f2b77['Account'][_0xf3cf('0x31')],'agent':_0x5f2b77['Owner']?_0x5f2b77[_0xf3cf('0xd4')]['fullname']:_0xf3cf('0xd6'),'createdAt':moment(_0x5f2b77[_0xf3cf('0x79')])[_0xf3cf('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf3cf('0x97')](),'closedAt':_0x5f2b77[_0xf3cf('0xd7')]?moment(_0x5f2b77[_0xf3cf('0xd8')])[_0xf3cf('0xb9')](_0xf3cf('0xd9'))['toString']():'','disposition':_0x5f2b77[_0xf3cf('0xda')],'messages':_(_0x5f2b77[_0xf3cf('0xcf')])[_0xf3cf('0x83')]({'secret':![]})[_0xf3cf('0x33')](function(_0x377122){return{'date':moment(_0x377122['createdAt'])[_0xf3cf('0xb9')](_0xf3cf('0xd9'))[_0xf3cf('0x97')](),'sender':_0x377122[_0xf3cf('0xd0')]===_0xf3cf('0xdb')?_0x377122[_0xf3cf('0x6f')]?_0x377122['User']['fullname']:'System':_0x377122[_0xf3cf('0x65')][_0xf3cf('0xcd')]+(_0x377122[_0xf3cf('0x65')][_0xf3cf('0xce')]?'\x20'+_0x377122[_0xf3cf('0x65')][_0xf3cf('0xce')]:''),'body':_0x377122[_0xf3cf('0x72')],'direction':_0x377122[_0xf3cf('0xd0')]==='out'?'A':'C','secret':_0x377122[_0xf3cf('0xd1')],'read':_0x377122[_0xf3cf('0x7e')]};})[_0xf3cf('0x62')]()};return ejs['renderFile'](path[_0xf3cf('0xc6')](config['root'],_0xf3cf('0xc7'),'views',_0xf3cf('0xdc')),{'interaction':_0x416ae4})['then'](function(_0x56d525){var _0x29fca1=path[_0xf3cf('0xc6')](_0x534833,_0xf3cf('0xdd')+_0x5f2b77['id']+'-'+_0x24f435+'.pdf');var _0x3c5569={'path':_0x29fca1,'channel':_0xf3cf('0xd5'),'interactionId':_0x5f2b77['id']};return pdf['createPdfFromHTML'](_0x56d525,_0x3c5569);})[_0xf3cf('0x2c')](function(){return new BPromise(function(_0x18a456,_0xf79b93){zipdir(_0x534833,{'saveTo':_0x4bc874},function(_0x23ec22,_0x461450){if(_0x23ec22)return _0xf79b93(_0x23ec22);return _0x18a456(_0x461450);});})[_0xf3cf('0x2c')](function(){return new BPromise(function(_0x3cbe55,_0x28cd43){rimraf(_0x534833,function(_0x3240d9){if(_0x3240d9)_0x28cd43(_0x3240d9);return _0x3cbe55();});});})[_0xf3cf('0x2c')](function(){return _0x3f4d7b[_0xf3cf('0xc4')](_0x4bc874,_0x502515,function(_0x5c3844){if(_0x5c3844){console[_0xf3cf('0xde')](_0xf3cf('0xdf'),_0x5c3844);}else{fs[_0xf3cf('0xe0')](_0x4bc874);}});});});}else{return _0x3f4d7b[_0xf3cf('0x21')](0xc8);}})[_0xf3cf('0x39')](handleError(_0x3f4d7b,null));}; \ No newline at end of file +var _0x657b=['body','keys','some','compact','isEmpty','SmsAccountId','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','rawAttributes','intersection','merge','options','create','update','params','destroy','describe','addMessage','SmsMessage','ids','omit','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','secret','SmsAccount','Owner','get','mkdirSync','Sms','Account','closed','disposition','direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','SmsInteraction','fieldName','type','model','query','filters','fields','attributes','order','sort','where','select','field','color','from','tools_tags','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','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?','UserId','buildExpression'];(function(_0xe80a60,_0x482e2b){var _0x2cca08=function(_0x31c4da){while(--_0x31c4da){_0xe80a60['push'](_0xe80a60['shift']());}};_0x2cca08(++_0x482e2b);}(_0x657b,0x77));var _0xb657=function(_0x744b56,_0x4b5b6b){_0x744b56=_0x744b56-0x0;var _0x25a640=_0x657b[_0x744b56];return _0x25a640;};'use strict';var emlformat=require(_0xb657('0x0'));var rimraf=require(_0xb657('0x1'));var zipdir=require(_0xb657('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb657('0x3'));var moment=require(_0xb657('0x4'));var BPromise=require(_0xb657('0x5'));var Mustache=require(_0xb657('0x6'));var util=require('util');var path=require(_0xb657('0x7'));var sox=require(_0xb657('0x8'));var csv=require('to-csv');var ejs=require(_0xb657('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb657('0xa'));var squel=require(_0xb657('0xb'));var crypto=require(_0xb657('0xc'));var jsforce=require(_0xb657('0xd'));var deskjs=require(_0xb657('0xe'));var toCsv=require(_0xb657('0xf'));var querystring=require(_0xb657('0x10'));var Papa=require(_0xb657('0x11'));var Redis=require('ioredis');var authService=require(_0xb657('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb657('0x13'));var pdf=require(_0xb657('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb657('0x15'))(_0xb657('0x16'));var utils=require(_0xb657('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb657('0x18'));var db=require(_0xb657('0x19'))['db'];config[_0xb657('0x1a')]=_[_0xb657('0x1b')](config[_0xb657('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb657('0x1c'))(new Redis(config[_0xb657('0x1a')]));require(_0xb657('0x1d'))[_0xb657('0x1e')](socket);function respondWithStatusCode(_0x30cbc8,_0x5cdbf3){_0x5cdbf3=_0x5cdbf3||0xcc;return function(_0x161b78){if(_0x161b78){return _0x30cbc8[_0xb657('0x1f')](_0x5cdbf3);}return _0x30cbc8[_0xb657('0x20')](_0x5cdbf3)[_0xb657('0x21')]();};}function respondWithResult(_0x18fad0,_0x32a026){_0x32a026=_0x32a026||0xc8;return function(_0x45c718){if(_0x45c718){return _0x18fad0[_0xb657('0x20')](_0x32a026)[_0xb657('0x22')](_0x45c718);}};}function respondWithFilteredResult(_0x999041,_0x2a085e){return function(_0x28ed3e){if(_0x28ed3e){var _0x5a180a=typeof _0x2a085e[_0xb657('0x23')]===_0xb657('0x24')&&typeof _0x2a085e[_0xb657('0x25')]==='undefined';var _0xd35b59=_0x28ed3e[_0xb657('0x26')];var _0x5881d9=_0x5a180a?0x0:_0x2a085e['offset'];var _0x398059=_0x5a180a?_0x28ed3e[_0xb657('0x26')]:_0x2a085e['offset']+_0x2a085e[_0xb657('0x25')];var _0x3d9bd9;if(_0x398059>=_0xd35b59){_0x398059=_0xd35b59;_0x3d9bd9=0xc8;}else{_0x3d9bd9=0xce;}_0x999041['status'](_0x3d9bd9);return _0x999041[_0xb657('0x27')](_0xb657('0x28'),_0x5881d9+'-'+_0x398059+'/'+_0xd35b59)[_0xb657('0x22')](_0x28ed3e);}return null;};}function patchUpdates(_0x491e79){return function(_0x28a172){try{jsonpatch[_0xb657('0x29')](_0x28a172,_0x491e79,!![]);}catch(_0x358099){return BPromise['reject'](_0x358099);}return _0x28a172[_0xb657('0x2a')]();};}function saveUpdates(_0x38a72f,_0x1d0ccc){return function(_0xa8ac42){if(_0xa8ac42){return _0xa8ac42['update'](_0x38a72f)['then'](function(_0x54ec7f){return _0x54ec7f;});}return null;};}function removeEntity(_0x54c348,_0x33dd98){return function(_0x47b1e4){if(_0x47b1e4){return _0x47b1e4['destroy']()[_0xb657('0x2b')](function(){_0x54c348[_0xb657('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10d374,_0x10607e){return function(_0x220b86){if(!_0x220b86){_0x10d374[_0xb657('0x1f')](0x194);}return _0x220b86;};}function handleError(_0xa9809d,_0x2c3fa1){_0x2c3fa1=_0x2c3fa1||0x1f4;return function(_0x3fc75a){logger[_0xb657('0x2c')](_0x3fc75a['stack']);if(_0x3fc75a[_0xb657('0x2d')]){delete _0x3fc75a[_0xb657('0x2d')];}_0xa9809d[_0xb657('0x20')](_0x2c3fa1)[_0xb657('0x2e')](_0x3fc75a);};}function getInteractionUsers(_0x4a308b,_0x135f0f){return new BPromise(function(_0x2a1776,_0x43f2bd){try{if(_0x135f0f[_0x4a308b['id']]){_0x4a308b[_0xb657('0x2f')]=_[_0xb657('0x30')](_0x135f0f[_0x4a308b['id']],function(_0x149df0){return{'id':_0x149df0['id'],'fullname':_0x149df0[_0xb657('0x31')]};});}}catch(_0x260e62){_0x43f2bd(_0x260e62);}_0x2a1776(_0x4a308b);});}function getInteractionTags(_0x34ebca,_0x4408f5){return new BPromise(function(_0x967518,_0x55da69){try{if(_0x34ebca[_0xb657('0x32')]){_0x34ebca[_0xb657('0x33')]=[];_0x34ebca[_0xb657('0x32')]['split'](',')[_0xb657('0x34')](function(_0x3ce9f9){_0x34ebca[_0xb657('0x33')][_0xb657('0x35')](_0x4408f5[_0x3ce9f9]);});}delete _0x34ebca['TagIds'];}catch(_0x43d2d5){_0x55da69(_0x43d2d5);}_0x967518(_0x34ebca);});}function updateSmsInteraction(_0x55cd38,_0x474e92,_0x227c87){return new BPromise(function(_0x3e1012,_0x1fb1d4){return getInteractionUsers(_0x55cd38,_0x227c87)[_0xb657('0x2b')](function(_0x3a914b){return getInteractionTags(_0x3a914b,_0x474e92);})['then'](function(_0xeed37){_0x3e1012(_0xeed37);})[_0xb657('0x36')](function(_0x5dd649){_0x1fb1d4(_0x5dd649);});});}exports[_0xb657('0x37')]=function(_0x4ebb84,_0x3c811e){var _0x25a6e2={},_0x2da0b8={},_0x4354e5={'count':0x0,'rows':[]};var _0x28af4c=_[_0xb657('0x30')](db[_0xb657('0x38')]['rawAttributes'],function(_0x34eb62){return{'name':_0x34eb62[_0xb657('0x39')],'type':_0x34eb62[_0xb657('0x3a')]['key']};});_0x2da0b8[_0xb657('0x3b')]=_[_0xb657('0x30')](_0x28af4c,_0xb657('0x2d'));_0x2da0b8[_0xb657('0x3c')]=_['keys'](_0x4ebb84[_0xb657('0x3c')]);_0x2da0b8[_0xb657('0x3d')]=_['intersection'](_0x2da0b8[_0xb657('0x3b')],_0x2da0b8[_0xb657('0x3c')]);_0x25a6e2['attributes']=_['intersection'](_0x2da0b8[_0xb657('0x3b')],qs['fields'](_0x4ebb84[_0xb657('0x3c')][_0xb657('0x3e')]));_0x25a6e2['attributes']=_0x25a6e2[_0xb657('0x3f')]['length']?_0x25a6e2[_0xb657('0x3f')]:_0x2da0b8[_0xb657('0x3b')];if(!_0x4ebb84['query']['hasOwnProperty']('nolimit')){_0x25a6e2[_0xb657('0x25')]=qs[_0xb657('0x25')](_0x4ebb84['query'][_0xb657('0x25')]);_0x25a6e2[_0xb657('0x23')]=qs[_0xb657('0x23')](_0x4ebb84[_0xb657('0x3c')][_0xb657('0x23')]);}_0x25a6e2[_0xb657('0x40')]=qs[_0xb657('0x41')](_0x4ebb84[_0xb657('0x3c')][_0xb657('0x41')]);_0x25a6e2[_0xb657('0x42')]=qs[_0xb657('0x3d')](_['pick'](_0x4ebb84[_0xb657('0x3c')],_0x2da0b8[_0xb657('0x3d')]),_0x28af4c);var _0x32ac94=[];var _0x276552=squel[_0xb657('0x43')]()['field']('id')[_0xb657('0x44')]('name')[_0xb657('0x44')](_0xb657('0x45'))[_0xb657('0x46')](_0xb657('0x47'));var _0x1428eb=squel[_0xb657('0x43')]()[_0xb657('0x44')]('u.id')[_0xb657('0x44')]('u.fullname')[_0xb657('0x44')](_0xb657('0x48'))[_0xb657('0x46')](_0xb657('0x49'),'ui')[_0xb657('0x4a')](_0xb657('0x4b'),'u',_0xb657('0x4c'));var _0x3cfac4=squel['select']()[_0xb657('0x46')]('sms_interactions','i')[_0xb657('0x4a')]('cm_contacts','c',_0xb657('0x4d'))['left_join'](_0xb657('0x4b'),'o',_0xb657('0x4e'))[_0xb657('0x4a')](_0xb657('0x4f'),'a','a.id\x20=\x20i.SmsAccountId')[_0xb657('0x4a')]('sms_messages','me',_0xb657('0x50'))['left_join'](_0xb657('0x51'),'it',_0xb657('0x52'))[_0xb657('0x4a')](_0xb657('0x47'),'t',_0xb657('0x53'));var _0x1bb489=squel['expr']();var _0xa1c90e=[];var _0x4139f7=squel[_0xb657('0x54')]();var _0x1d0303;if(_0x4ebb84[_0xb657('0x3c')]['search']){_0x1d0303=as[_0xb657('0x55')](_0x4ebb84[_0xb657('0x3c')][_0xb657('0x56')]);var _0x5cff73=_0x1d0303[_0xb657('0x57')];for(var _0x252c8a=0x0;_0x252c8a<_0x1d0303[_0xb657('0x58')][_0xb657('0x59')];_0x252c8a++){var _0x1542ef=_0x1d0303[_0xb657('0x58')][_0x252c8a];var _0x31ab33='i';var _0x5d9454=_['find'](_0x28af4c,[_0xb657('0x2d'),_0x1542ef[_0xb657('0x44')]]);if(!_0x5d9454){switch(_0x1542ef[_0xb657('0x44')]){case _0xb657('0x5a'):if(_0x1542ef['value']==0x1){_0x3cfac4['having']('`'+_0x1542ef[_0xb657('0x44')]+_0xb657('0x5b'));}else{_0x3cfac4[_0xb657('0x5c')]('`'+_0x1542ef['field']+_0xb657('0x5d'));}break;case _0xb657('0x5e'):if(_0x1542ef[_0xb657('0x5f')]===_0xb657('0x60')){if(_0x1542ef[_0xb657('0x61')][_0xb657('0x62')]('\x20')[_0xb657('0x59')]>0x1){_0x1bb489[_0x5cff73](_0xb657('0x63'),qs[_0xb657('0x64')](_0x1542ef[_0xb657('0x61')]),null);}else{var _0x26231f='%'+_0x1542ef[_0xb657('0x61')]+'%';_0x1bb489[_0x5cff73]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x26231f,_0x26231f,_0x26231f);}}else{_0x5d9454=_[_0xb657('0x65')](_0x28af4c,[_0xb657('0x2d'),_0xb657('0x66')]);_0x1542ef[_0xb657('0x44')]=_0xb657('0x66');_0x304b16=as['buildExpression'](_0x31ab33,_0x5d9454['type'],_0x1542ef);_0x1bb489[_0x5cff73](_0x304b16[_0xb657('0x67')],_0x304b16[_0xb657('0x61')][_0xb657('0x68')],_0x304b16[_0xb657('0x61')][_0xb657('0x21')]);}break;case _0xb657('0x69'):var _0x53d9a8=_0x1542ef[_0xb657('0x61')][_0xb657('0x62')](',')['map'](function(_0x250d11){return Number(_0x250d11);});_0x53d9a8[_0xb657('0x34')](function(_0x5cdc04){_0x4139f7['or'](_0xb657('0x6a'),'%,'+_0x5cdc04+',%');});_0xa1c90e=_[_0xb657('0x6b')](_0xa1c90e,_0x53d9a8);break;case _0xb657('0x6c'):if(_0x1542ef['operator']===_0xb657('0x60')){_0x1bb489[_0x5cff73](_0xb657('0x6d'),'%'+_0x1542ef[_0xb657('0x61')]+'%',null);}else{_0x5d9454=_[_0xb657('0x65')](_0x28af4c,['name',_0xb657('0x6e')]);_0x1542ef[_0xb657('0x44')]=_0xb657('0x6e');_0x304b16=as[_0xb657('0x6f')](_0x31ab33,_0x5d9454[_0xb657('0x3a')],_0x1542ef);_0x1bb489[_0x5cff73](_0x304b16[_0xb657('0x67')],_0x304b16[_0xb657('0x61')]['start'],_0x304b16[_0xb657('0x61')]['end']);}break;case _0xb657('0x70'):_0x304b16=as[_0xb657('0x6f')]('me',null,_0x1542ef);_0x1bb489[_0x5cff73](_0x304b16[_0xb657('0x67')],_0x304b16[_0xb657('0x61')][_0xb657('0x68')],_0x304b16[_0xb657('0x61')][_0xb657('0x21')]);break;}}else{var _0x304b16=as[_0xb657('0x6f')](_0x31ab33,_0x5d9454['type'],_0x1542ef);_0x1bb489[_0x5cff73](_0x304b16[_0xb657('0x67')],_0x304b16[_0xb657('0x61')][_0xb657('0x68')],_0x304b16[_0xb657('0x61')][_0xb657('0x21')]);}}}else{var _0x1f00fb=_(_0x4ebb84[_0xb657('0x3c')])[_0xb657('0x71')]()[_0xb657('0x30')](function(_0x1af7d8){return _[_0xb657('0x72')](_0x28af4c,[_0xb657('0x2d'),_0x1af7d8])?_0x1af7d8:undefined;})[_0xb657('0x73')]()[_0xb657('0x61')]();if(!_[_0xb657('0x74')](_0x1f00fb)){_0x1f00fb['forEach'](function(_0x5427c6){if(_0x5427c6===_0xb657('0x75')){_0x3cfac4['where']('i.SmsAccountId\x20IN\x20?',[][_0xb657('0x76')](_0x4ebb84[_0xb657('0x3c')][_0x5427c6]));}else if(_0x5427c6===_0xb657('0x77')){var _0x5e7074=JSON[_0xb657('0x78')](_0x4ebb84[_0xb657('0x3c')][_0x5427c6])[_0xb657('0x79')];var _0x567361=JSON['parse'](_0x4ebb84[_0xb657('0x3c')][_0x5427c6])[_0xb657('0x7a')];_0x3cfac4[_0xb657('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5e7074,_0x567361);}else{if(_0x4ebb84[_0xb657('0x3c')][_0x5427c6]===_0xb657('0x7b')){_0x3cfac4[_0xb657('0x42')]('i.'+_0x5427c6+_0xb657('0x7c'));}else{_0x3cfac4[_0xb657('0x42')]('i.'+_0x5427c6+_0xb657('0x7d'),_0x4ebb84[_0xb657('0x3c')][_0x5427c6]);}}});}if(_0x4ebb84['query'][_0xb657('0x7e')]){if(_0x4ebb84['query'][_0xb657('0x7e')]==0x1){_0x3cfac4[_0xb657('0x5c')](_0xb657('0x7f'));}else{_0x3cfac4[_0xb657('0x5c')](_0xb657('0x80'));}}if(_0x4ebb84[_0xb657('0x3c')][_0xb657('0x81')]){_0xa1c90e=_[_0xb657('0x82')](_0x4ebb84['query'][_0xb657('0x81')])?_0x4ebb84['query'][_0xb657('0x81')]:new Array(_0x4ebb84[_0xb657('0x3c')]['tag']);_0xa1c90e[_0xb657('0x34')](function(_0x1c416b){_0x4139f7['or'](_0xb657('0x6a'),'%,'+_0x1c416b+',%');});}if(_0x4ebb84[_0xb657('0x3c')]['filter']){var _0x7787be=_0x4ebb84[_0xb657('0x3c')][_0xb657('0x83')][_0xb657('0x84')]('\x5c','\x5c\x5c')[_0xb657('0x84')](/'/g,'\x27\x27');if(qs[_0xb657('0x85')](_0x7787be)){_0x1bb489['or']('i.id\x20LIKE\x20?',_0x7787be+'%')['or'](_0xb657('0x86'),_0x7787be+'%');}else{_0x1bb489['or'](_0xb657('0x87'),qs[_0xb657('0x64')](_0x7787be))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x7787be+'%');}}}_0x3cfac4[_0xb657('0x42')](_0x1bb489);_0x3cfac4[_0xb657('0x88')](_0xb657('0x89'));var _0x4c11c1={'type':db['Sequelize'][_0xb657('0x8a')][_0xb657('0x8b')],'raw':!![]};var _0x3685af=_0x3cfac4[_0xb657('0x8c')]();_0x3685af['field'](_0xb657('0x89'));_0x3685af[_0xb657('0x44')](_0xb657('0x8d'),'unreadMessages');if(_0x25a6e2['order']){_0x25a6e2[_0xb657('0x40')][_0xb657('0x34')](function(_0x2ba111){var _0x1bb143=_0x2ba111[0x0]==='contactName'?_0x2ba111[0x0]:'i.'+_0x2ba111[0x0];_0x3cfac4[_0xb657('0x40')](_0x1bb143,_0x2ba111[0x1]===_0xb657('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0xa1c90e)){_0x3cfac4[_0xb657('0x5c')](_0x4139f7);_0x3685af[_0xb657('0x42')](_0xb657('0x8f'),_0xa1c90e);}BPromise[_0xb657('0x90')]()['then'](function(){if(!_0x1d0303){if(_0x4ebb84[_0xb657('0x3c')][_0xb657('0x75')])return;_0x3685af[_0xb657('0x42')](_0xb657('0x91'));_0x3cfac4[_0xb657('0x42')](_0xb657('0x91'));return;}if(_0x4ebb84[_0xb657('0x92')][_0xb657('0x93')]!==_0xb657('0x94'))return;return _0x4ebb84[_0xb657('0x92')][_0xb657('0x95')]({'attributes':['id'],'raw':!![]})[_0xb657('0x2b')](function(_0x22dac5){if(_[_0xb657('0x74')](_0x22dac5)){_0x3685af[_0xb657('0x42')](_0xb657('0x96'));_0x3cfac4[_0xb657('0x42')](_0xb657('0x96'));}else{_0x3685af[_0xb657('0x42')](_0xb657('0x97'),_[_0xb657('0x30')](_0x22dac5,'id'));_0x3cfac4['where'](_0xb657('0x97'),_[_0xb657('0x30')](_0x22dac5,'id'));}});})[_0xb657('0x2b')](function(){if(_0x4ebb84['user'][_0xb657('0x93')]==='agent'&&!_0x1d0303&&!_0x4ebb84[_0xb657('0x3c')][_0xb657('0x75')])return[];return db[_0xb657('0x98')][_0xb657('0x3c')](_0x3685af[_0xb657('0x99')](),_0x4c11c1);})[_0xb657('0x2b')](function(_0x9c4428){_0x4354e5[_0xb657('0x26')]=_0x9c4428['length'];if(_0x4354e5['count']===0x0)return[];return db[_0xb657('0x98')]['query'](_0x276552['toString'](),_0x4c11c1)[_0xb657('0x2b')](function(_0x1588ee){_0x32ac94=_['keyBy'](_0x1588ee,'id');_0x4c11c1=_['merge'](_0x4c11c1,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ebb84['query'][_0xb657('0x3e')]){_0x25a6e2[_0xb657('0x3f')][_0xb657('0x34')](function(_0x5034f3){_0x3cfac4[_0xb657('0x44')]('i.'+_0x5034f3);});}else{_0x3cfac4[_0xb657('0x44')](_0xb657('0x8d'),_0xb657('0x5a'));_0x3cfac4[_0xb657('0x44')](_0xb657('0x9a'),_0xb657('0x9b'));_0x3cfac4[_0xb657('0x44')](_0xb657('0x9c'),_0xb657('0x9d'));_0x3cfac4[_0xb657('0x44')](_0xb657('0x9e'),_0xb657('0x9f'));_0x3cfac4[_0xb657('0x44')](_0xb657('0xa0'));_0x3cfac4[_0xb657('0x44')]('c.firstName',_0xb657('0xa1'));_0x3cfac4[_0xb657('0x44')](_0xb657('0xa2'),_0xb657('0xa3'));_0x3cfac4[_0xb657('0x44')](_0xb657('0xa4'),_0xb657('0xa5'));_0x3cfac4[_0xb657('0x44')](_0xb657('0xa6'),'Contact.phone');_0x3cfac4['field'](_0xb657('0xa7'),_0xb657('0xa8'));_0x3cfac4['field']('c.fax','Contact.fax');_0x3cfac4[_0xb657('0x44')](_0xb657('0xa9'),_0xb657('0xaa'));_0x3cfac4[_0xb657('0x44')](_0xb657('0xab'),'Owner.internal');_0x3cfac4[_0xb657('0x44')](_0xb657('0xac'),_0xb657('0x32'));}if(_0x25a6e2['limit'])_0x3cfac4[_0xb657('0x25')](_0x25a6e2['limit']);if(_0x25a6e2[_0xb657('0x23')])_0x3cfac4[_0xb657('0x23')](_0x25a6e2[_0xb657('0x23')]);return db['sequelize'][_0xb657('0x3c')](_0x3cfac4[_0xb657('0x99')](),_0x4c11c1);})[_0xb657('0x2b')](function(_0x547f5c){if(_0x547f5c[_0xb657('0x59')]>0x0)_0x1428eb[_0xb657('0x42')]('ui.SmsInteractionId\x20IN\x20?',_[_0xb657('0x30')](_0x547f5c,'id'));return db[_0xb657('0x98')][_0xb657('0x3c')](_0x1428eb[_0xb657('0x99')](),_0x4c11c1)[_0xb657('0x2b')](function(_0x36f944){var _0x49ed00=_[_0xb657('0xad')](_0x36f944,_0xb657('0xae'));var _0x11aa6e=[];_0x547f5c[_0xb657('0x34')](function(_0x23376e){_0x11aa6e['push'](updateSmsInteraction(_0x23376e,_0x32ac94,_0x49ed00));});return BPromise[_0xb657('0xaf')](_0x11aa6e);});});})[_0xb657('0x2b')](function(_0x69c3e){_0x4354e5[_0xb657('0xb0')]=_0x69c3e;return _0x4354e5;})[_0xb657('0x2b')](respondWithFilteredResult(_0x3c811e,_0x25a6e2))[_0xb657('0x36')](handleError(_0x3c811e,null));};exports['show']=function(_0x1f42ff,_0x12ef21){var _0x2ac283={'raw':![],'where':{'id':_0x1f42ff['params']['id']}},_0x3d946a={};_0x3d946a[_0xb657('0x3b')]=_[_0xb657('0x71')](db[_0xb657('0x38')][_0xb657('0xb1')]);_0x3d946a['query']=_[_0xb657('0x71')](_0x1f42ff['query']);_0x3d946a[_0xb657('0x3d')]=_[_0xb657('0xb2')](_0x3d946a[_0xb657('0x3b')],_0x3d946a[_0xb657('0x3c')]);_0x2ac283[_0xb657('0x3f')]=_['intersection'](_0x3d946a[_0xb657('0x3b')],qs[_0xb657('0x3e')](_0x1f42ff[_0xb657('0x3c')][_0xb657('0x3e')]));_0x2ac283[_0xb657('0x3f')]=_0x2ac283['attributes'][_0xb657('0x59')]?_0x2ac283[_0xb657('0x3f')]:_0x3d946a[_0xb657('0x3b')];if(_0x1f42ff['query']['includeAll']){_0x2ac283['include']=[{'all':!![]}];}_0x2ac283=_[_0xb657('0xb3')]({},_0x2ac283,_0x1f42ff[_0xb657('0xb4')]);return db[_0xb657('0x38')][_0xb657('0x65')](_0x2ac283)[_0xb657('0x2b')](handleEntityNotFound(_0x12ef21,null))[_0xb657('0x2b')](respondWithResult(_0x12ef21,null))[_0xb657('0x36')](handleError(_0x12ef21,null));};exports[_0xb657('0xb5')]=function(_0x2e974b,_0x29389a){return db[_0xb657('0x38')][_0xb657('0xb5')](_0x2e974b[_0xb657('0x70')],{})[_0xb657('0x2b')](respondWithResult(_0x29389a,0xc9))[_0xb657('0x36')](handleError(_0x29389a,null));};exports[_0xb657('0xb6')]=function(_0x5dc048,_0x2cb20f){if(_0x5dc048[_0xb657('0x70')]['id']){delete _0x5dc048[_0xb657('0x70')]['id'];}return db[_0xb657('0x38')][_0xb657('0x65')]({'where':{'id':_0x5dc048[_0xb657('0xb7')]['id']}})[_0xb657('0x2b')](handleEntityNotFound(_0x2cb20f,null))[_0xb657('0x2b')](saveUpdates(_0x5dc048[_0xb657('0x70')],null))[_0xb657('0x2b')](respondWithResult(_0x2cb20f,null))[_0xb657('0x36')](handleError(_0x2cb20f,null));};exports[_0xb657('0xb8')]=function(_0x129a9c,_0x23ea28){return db[_0xb657('0x38')][_0xb657('0x65')]({'where':{'id':_0x129a9c['params']['id']}})[_0xb657('0x2b')](handleEntityNotFound(_0x23ea28,null))[_0xb657('0x2b')](removeEntity(_0x23ea28,null))[_0xb657('0x36')](handleError(_0x23ea28,null));};exports[_0xb657('0xb9')]=function(_0x508425,_0x26d694){return db['SmsInteraction'][_0xb657('0xb9')]()['then'](respondWithResult(_0x26d694,null))[_0xb657('0x36')](handleError(_0x26d694,null));};exports[_0xb657('0xba')]=function(_0x552bba,_0x2be998,_0x11bc78){return db[_0xb657('0xbb')][_0xb657('0x65')]({'where':{'id':_0x552bba[_0xb657('0xb7')]['id']}})[_0xb657('0x2b')](handleEntityNotFound(_0x2be998,null))['then'](function(_0x25782b){if(_0x25782b){return _0x25782b[_0xb657('0xba')](_0x552bba[_0xb657('0x70')][_0xb657('0xbc')],_[_0xb657('0xbd')](_0x552bba['body'],['ids','id'])||{});}})[_0xb657('0x2b')](respondWithResult(_0x2be998,null))[_0xb657('0x36')](handleError(_0x2be998,null));};exports['getMessages']=function(_0x3d20e4,_0x31756c,_0xe7f017){var _0x1d657f={'raw':![],'where':{}};var _0x5eef11={};var _0x2be8ee={'count':0x0,'rows':[]};return db[_0xb657('0x38')]['findOne']({'where':{'id':_0x3d20e4[_0xb657('0xb7')]['id']}})[_0xb657('0x2b')](handleEntityNotFound(_0x31756c,null))['then'](function(_0x1443b9){if(_0x1443b9){_0x5eef11[_0xb657('0x3b')]=_[_0xb657('0x71')](db[_0xb657('0xbb')]['rawAttributes']);_0x5eef11['query']=_['keys'](_0x3d20e4['query']);_0x5eef11[_0xb657('0x3d')]=_[_0xb657('0xb2')](_0x5eef11[_0xb657('0x3b')],_0x5eef11[_0xb657('0x3c')]);_0x1d657f['attributes']=_[_0xb657('0xb2')](_0x5eef11[_0xb657('0x3b')],qs[_0xb657('0x3e')](_0x3d20e4[_0xb657('0x3c')][_0xb657('0x3e')]));_0x1d657f['attributes']=_0x1d657f[_0xb657('0x3f')]['length']?_0x1d657f[_0xb657('0x3f')]:_0x5eef11['model'];if(!_0x3d20e4[_0xb657('0x3c')]['hasOwnProperty'](_0xb657('0xbe'))){_0x1d657f[_0xb657('0x25')]=qs['limit'](_0x3d20e4[_0xb657('0x3c')][_0xb657('0x25')]);_0x1d657f[_0xb657('0x23')]=qs[_0xb657('0x23')](_0x3d20e4[_0xb657('0x3c')]['offset']);}_0x1d657f[_0xb657('0x40')]=qs['sort'](_0x3d20e4[_0xb657('0x3c')][_0xb657('0x41')]);_0x1d657f[_0xb657('0x42')]=qs[_0xb657('0x3d')](_[_0xb657('0xbf')](_0x3d20e4['query'],_0x5eef11[_0xb657('0x3d')]));_0x1d657f['where'][_0xb657('0xae')]=_0x1443b9['id'];if(_0x3d20e4[_0xb657('0x3c')][_0xb657('0x83')]){_0x1d657f[_0xb657('0x42')]=_[_0xb657('0xb3')](_0x1d657f['where'],{'$or':_[_0xb657('0x30')](_0x1d657f[_0xb657('0x3f')],function(_0x1f9935){var _0x5bc207={};_0x5bc207[_0x1f9935]={'$like':'%'+_0x3d20e4['query'][_0xb657('0x83')]+'%'};return _0x5bc207;})});}if(_0x3d20e4[_0xb657('0x3c')][_0xb657('0x79')]){var _0x5d7e0b=_0x3d20e4['query'][_0xb657('0x79')][_0xb657('0x62')](',');var _0x29a508={};_0x29a508[_0x5d7e0b[0x0]]={'$gte':moment(_0x5d7e0b[0x1])[_0xb657('0xc0')](_0xb657('0xc1'))};_0x1d657f[_0xb657('0x42')]=_[_0xb657('0xb3')](_0x1d657f[_0xb657('0x42')],_0x29a508);}_0x1d657f=_[_0xb657('0xb3')]({},_0x1d657f,_0x3d20e4[_0xb657('0xb4')]);return db[_0xb657('0xbb')][_0xb657('0x26')]({'where':_0x1d657f[_0xb657('0x42')]})[_0xb657('0x2b')](function(_0x24b2e5){_0x2be8ee[_0xb657('0x26')]=_0x24b2e5;if(_0x3d20e4[_0xb657('0x3c')][_0xb657('0xc2')]){_0x1d657f[_0xb657('0xc3')]=[{'all':!![]}];}return db[_0xb657('0xbb')]['findAll'](_0x1d657f);})[_0xb657('0x2b')](function(_0x4d8a25){_0x2be8ee['rows']=_0x4d8a25;return _0x2be8ee;});}})[_0xb657('0x2b')](respondWithFilteredResult(_0x31756c,_0x1d657f))[_0xb657('0x36')](handleError(_0x31756c,null));};exports['addTags']=function(_0xb07290,_0x411dae,_0x12cbd3){return db['SmsInteraction']['find']({'where':{'id':_0xb07290[_0xb657('0xb7')]['id']}})[_0xb657('0x2b')](handleEntityNotFound(_0x411dae,null))[_0xb657('0x2b')](function(_0x5f05ac){if(_0x5f05ac){return _0x5f05ac[_0xb657('0xc4')](_0xb07290['body'][_0xb657('0xbc')],_[_0xb657('0xbd')](_0xb07290[_0xb657('0x70')],[_0xb657('0xbc'),'id'])||{})[_0xb657('0xc5')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb657('0x2d'),_0xb657('0x45')],'where':{'id':_0xb07290[_0xb657('0x70')][_0xb657('0xbc')]}});})[_0xb657('0x2b')](function(_0x18b1e3){socket[_0xb657('0xc6')](_0xb657('0xc7'),{'id':Number(_0xb07290['params']['id']),'tags':_0x18b1e3||[]});return{'id':Number(_0xb07290['params']['id']),'tags':_0x18b1e3||[]};});}})[_0xb657('0x2b')](respondWithResult(_0x411dae,null))[_0xb657('0x36')](handleError(_0x411dae,null));};exports[_0xb657('0xc8')]=function(_0x228b03,_0x45e26b,_0xb041f){return db['SmsInteraction'][_0xb657('0x65')]({'where':{'id':_0x228b03[_0xb657('0xb7')]['id']}})[_0xb657('0x2b')](handleEntityNotFound(_0x45e26b,null))[_0xb657('0x2b')](function(_0x159c35){if(_0x159c35){return _0x159c35[_0xb657('0xc8')](_0x228b03[_0xb657('0x3c')][_0xb657('0xbc')]);}})['then'](respondWithStatusCode(_0x45e26b,null))[_0xb657('0x36')](handleError(_0x45e26b,null));};exports[_0xb657('0xc9')]=function(_0x4f73e6,_0x1c7f1f){var _0x15d001=moment()['unix']()['toString']();var _0x2e403f=path[_0xb657('0xca')](config[_0xb657('0xcb')],_0xb657('0xcc'),_0xb657('0xcd'),_0xb657('0xce'));var _0xd7aece=path[_0xb657('0xca')](config['root'],_0xb657('0xcc'),_0xb657('0xcd'),'attachments');var _0x647608=path['join'](_0x2e403f,_0x15d001);var _0x25bfc8=util[_0xb657('0xc0')](_0xb657('0xcf'),_0x4f73e6[_0xb657('0xb7')]['id'],_0x15d001);var _0x336919=path[_0xb657('0xca')](_0x2e403f,_0x25bfc8);var _0x50fd3a=[];_0x50fd3a[_0xb657('0x35')]({'model':db[_0xb657('0x6c')],'as':_0xb657('0x6c'),'attributes':['id',_0xb657('0x31')],'raw':!![]});_0x50fd3a[_0xb657('0x35')]({'model':db[_0xb657('0xd0')],'as':_0xb657('0x5e'),'attributes':['id',_0xb657('0xd1'),_0xb657('0xd2')],'raw':!![]});var _0x33e9dc=[{'model':db[_0xb657('0xbb')],'as':_0xb657('0xd3'),'attributes':['id',_0xb657('0x70'),_0xb657('0x77'),'direction',_0xb657('0xd4'),_0xb657('0x7e')],'include':_0x50fd3a}];_0x33e9dc['push']({'model':db[_0xb657('0xd5')],'as':'Account','attributes':['id',_0xb657('0x2d')]});_0x33e9dc['push']({'model':db[_0xb657('0x6c')],'as':_0xb657('0xd6'),'attributes':['id','fullname']});return db['SmsInteraction'][_0xb657('0x65')]({'where':{'id':_0x4f73e6[_0xb657('0xb7')]['id']},'include':_0x33e9dc})[_0xb657('0x2b')](handleEntityNotFound(_0x1c7f1f,null))['then'](function(_0x5e9d16){if(_0x5e9d16){var _0x16599d=_0x5e9d16[_0xb657('0xd7')]({'plain':!![]});fs[_0xb657('0xd8')](_0x647608);var _0x1daab6={'channel':_0xb657('0xd9'),'account':_0x16599d[_0xb657('0xda')][_0xb657('0x2d')],'agent':_0x16599d[_0xb657('0xd6')]?_0x16599d[_0xb657('0xd6')][_0xb657('0x31')]:'N.A.','createdAt':moment(_0x16599d[_0xb657('0x77')])[_0xb657('0xc0')](_0xb657('0xc1'))[_0xb657('0x99')](),'closedAt':_0x16599d[_0xb657('0xdb')]?moment(_0x16599d['closedAt'])['format'](_0xb657('0xc1'))[_0xb657('0x99')]():'','disposition':_0x16599d[_0xb657('0xdc')],'messages':_(_0x16599d[_0xb657('0xd3')])[_0xb657('0x83')]({'secret':![]})[_0xb657('0x30')](function(_0x15a410){return{'date':moment(_0x15a410[_0xb657('0x77')])[_0xb657('0xc0')](_0xb657('0xc1'))[_0xb657('0x99')](),'sender':_0x15a410[_0xb657('0xdd')]===_0xb657('0xde')?_0x15a410['User']?_0x15a410[_0xb657('0x6c')][_0xb657('0x31')]:_0xb657('0xdf'):_0x15a410[_0xb657('0x5e')]['firstName']+(_0x15a410['Contact'][_0xb657('0xd2')]?'\x20'+_0x15a410[_0xb657('0x5e')][_0xb657('0xd2')]:''),'body':_0x15a410[_0xb657('0x70')],'direction':_0x15a410[_0xb657('0xdd')]===_0xb657('0xde')?'A':'C','secret':_0x15a410['secret'],'read':_0x15a410[_0xb657('0x7e')]};})['value']()};return ejs[_0xb657('0xe0')](path[_0xb657('0xca')](config[_0xb657('0xcb')],_0xb657('0xcc'),_0xb657('0xe1'),_0xb657('0xe2')),{'interaction':_0x1daab6})[_0xb657('0x2b')](function(_0x38164e){var _0x4e57e5=path[_0xb657('0xca')](_0x647608,_0xb657('0xe3')+_0x16599d['id']+'-'+_0x15d001+_0xb657('0xe4'));var _0x58aff0={'path':_0x4e57e5,'channel':_0xb657('0xd9'),'interactionId':_0x16599d['id']};return pdf[_0xb657('0xe5')](_0x38164e,_0x58aff0);})['then'](function(){return new BPromise(function(_0x4a3796,_0x139062){zipdir(_0x647608,{'saveTo':_0x336919},function(_0x494c1e,_0x38fb3e){if(_0x494c1e)return _0x139062(_0x494c1e);return _0x4a3796(_0x38fb3e);});})[_0xb657('0x2b')](function(){return new BPromise(function(_0xb9463b,_0x388e32){rimraf(_0x647608,function(_0x2d1d85){if(_0x2d1d85)_0x388e32(_0x2d1d85);return _0xb9463b();});});})['then'](function(){return _0x1c7f1f[_0xb657('0xc9')](_0x336919,_0x25bfc8,function(_0x524e68){if(_0x524e68){console['log'](_0xb657('0xe6'),_0x524e68);}else{fs['unlinkSync'](_0x336919);}});});});}else{return _0x1c7f1f['sendStatus'](0xc8);}})[_0xb657('0x36')](handleError(_0x1c7f1f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index a5b94b9..57f92fa 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 _0x8e3f=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xf8e3('0x0'));var SmsInteraction=require(_0xf8e3('0x1'))['db'][_0xf8e3('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xf8e3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xf8e3('0x4')](0x0);var events={'afterCreate':_0xf8e3('0x5'),'afterUpdate':'update','afterDestroy':_0xf8e3('0x6')};function emitEvent(_0x41bc05){return function(_0x4dab56,_0x35e88f,_0xb21f8d){_0x4dab56[_0xf8e3('0x7')]({'attributes':['id'],'raw':!![]})[_0xf8e3('0x8')](function(_0x4e9e57){_0x4dab56[_0xf8e3('0x9')](_0xf8e3('0xa'),_0x4e9e57[_0xf8e3('0xb')](function(_0x95ad03){return{'id':_0x95ad03['id']};}));return SmsMessage[_0xf8e3('0xc')]({'where':{'SmsInteractionId':_0x4dab56['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8e3('0x8')](function(_0x299a7e){_0x4dab56[_0xf8e3('0x9')](_0xf8e3('0xd'),_0x299a7e[_0xf8e3('0xe')]);SmsInteractionEvents[_0xf8e3('0xf')](_0x41bc05+':'+_0x4dab56['id'],_0x4dab56);SmsInteractionEvents[_0xf8e3('0xf')](_0x41bc05,_0x4dab56);_0xb21f8d(null);})['catch'](_0xb21f8d(null));};}for(var e in events){if(events[_0xf8e3('0x10')](e)){var event=events[e];SmsInteraction[_0xf8e3('0x11')](e,emitEvent(event));}}module[_0xf8e3('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x47c5=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0x47c5,0x165));var _0x547c=function(_0x28955d,_0x31e4fd){_0x28955d=_0x28955d-0x0;var _0x4ed229=_0x47c5[_0x28955d];return _0x4ed229;};'use strict';var EventEmitter=require(_0x547c('0x0'));var SmsInteraction=require(_0x547c('0x1'))['db'][_0x547c('0x2')];var SmsMessage=require(_0x547c('0x1'))['db'][_0x547c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x547c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x547c('0x5'),'afterDestroy':_0x547c('0x6')};function emitEvent(_0x5b48c9){return function(_0x3e827e,_0x468220,_0x51ab7f){_0x3e827e[_0x547c('0x7')]({'attributes':['id'],'raw':!![]})[_0x547c('0x8')](function(_0x381f2e){_0x3e827e[_0x547c('0x9')](_0x547c('0xa'),_0x381f2e[_0x547c('0xb')](function(_0x3e2279){return{'id':_0x3e2279['id']};}));return SmsMessage[_0x547c('0xc')]({'where':{'SmsInteractionId':_0x3e827e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x547c('0x8')](function(_0x44a581){_0x3e827e[_0x547c('0x9')](_0x547c('0xd'),_0x44a581[_0x547c('0xe')]);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9+':'+_0x3e827e['id'],_0x3e827e);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9,_0x3e827e);_0x51ab7f(null);})[_0x547c('0x10')](_0x51ab7f(null));};}for(var e in events){if(events[_0x547c('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x547c('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 8f740c1..3786c66 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 _0x6885=['request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closedAt','lodash','util','api','moment'];(function(_0x580cd5,_0x48168c){var _0x39d8e4=function(_0x54ef12){while(--_0x54ef12){_0x580cd5['push'](_0x580cd5['shift']());}};_0x39d8e4(++_0x48168c);}(_0x6885,0x1dd));var _0x5688=function(_0x4a173e,_0x22dd64){_0x4a173e=_0x4a173e-0x0;var _0x121783=_0x6885[_0x4a173e];return _0x121783;};'use strict';var _=require(_0x5688('0x0'));var util=require(_0x5688('0x1'));var logger=require('../../config/logger')(_0x5688('0x2'));var moment=require(_0x5688('0x3'));var BPromise=require('bluebird');var rp=require(_0x5688('0x4'));var fs=require('fs');var path=require(_0x5688('0x5'));var rimraf=require('rimraf');var config=require(_0x5688('0x6'));var attributes=require(_0x5688('0x7'));module[_0x5688('0x8')]=function(_0x40128a,_0x1bb110){return _0x40128a[_0x5688('0x9')](_0x5688('0xa'),attributes,{'tableName':_0x5688('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9cdc30,_0x782367,_0x34cebd){if(_0x9cdc30['changed']('closed')){_0x9cdc30[_0x5688('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x34cebd(null,_0x9cdc30);}}});}; \ No newline at end of file +var _0x69ed=['api','moment','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x69ed,0xc9));var _0xd69e=function(_0x1febd3,_0x4d8302){_0x1febd3=_0x1febd3-0x0;var _0x1b71a1=_0x69ed[_0x1febd3];return _0x1b71a1;};'use strict';var _=require(_0xd69e('0x0'));var util=require(_0xd69e('0x1'));var logger=require(_0xd69e('0x2'))(_0xd69e('0x3'));var moment=require(_0xd69e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd69e('0x5'));var rimraf=require(_0xd69e('0x6'));var config=require(_0xd69e('0x7'));var attributes=require(_0xd69e('0x8'));module[_0xd69e('0x9')]=function(_0x358c1c,_0x4beb2f){return _0x358c1c[_0xd69e('0xa')](_0xd69e('0xb'),attributes,{'tableName':_0xd69e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b8916,_0x1a7d0e,_0x321ea8){if(_0x1b8916[_0xd69e('0xd')]('closed')){_0x1b8916[_0xd69e('0xe')]=moment()[_0xd69e('0xf')](_0xd69e('0x10'));}_0x321ea8(null,_0x1b8916);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c2fa399..ccc4dff 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 _0xa984=['../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','raw','options','attributes','limit','debug','AddTagsToSmsInteraction','where','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b4d01,_0x4c6044){var _0x4195d7=function(_0x59935){while(--_0x59935){_0x2b4d01['push'](_0x2b4d01['shift']());}};_0x4195d7(++_0x4c6044);}(_0xa984,0x1b1));var _0x4a98=function(_0x222550,_0x3c0a0c){_0x222550=_0x222550-0x0;var _0x58ac61=_0xa984[_0x222550];return _0x58ac61;};'use strict';var _=require(_0x4a98('0x0'));var util=require(_0x4a98('0x1'));var moment=require(_0x4a98('0x2'));var BPromise=require(_0x4a98('0x3'));var rs=require(_0x4a98('0x4'));var fs=require('fs');var Redis=require(_0x4a98('0x5'));var db=require(_0x4a98('0x6'))['db'];var utils=require(_0x4a98('0x7'));var logger=require(_0x4a98('0x8'))(_0x4a98('0x9'));var config=require('../../config/environment');var jayson=require(_0x4a98('0xa'));var client=jayson['client'][_0x4a98('0xb')]({'port':0x232a});config[_0x4a98('0xc')]=_[_0x4a98('0xd')](config[_0x4a98('0xc')],{'host':_0x4a98('0xe'),'port':0x18eb});var socket=require(_0x4a98('0xf'))(new Redis(config['redis']));require(_0x4a98('0x10'))[_0x4a98('0x11')](socket);function respondWithRpcPromise(_0x48bbda,_0x52790b,_0x27f6b3){return new BPromise(function(_0x4df331,_0x4bf239){return client['request'](_0x48bbda,_0x27f6b3)[_0x4a98('0x12')](function(_0x5723ce){logger[_0x4a98('0x13')](_0x4a98('0x14'),_0x52790b,_0x4a98('0x15'));logger['debug'](_0x4a98('0x16'),_0x52790b,_0x4a98('0x15'),JSON[_0x4a98('0x17')](_0x5723ce));if(_0x5723ce['error']){if(_0x5723ce[_0x4a98('0x18')][_0x4a98('0x19')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x52790b,_0x5723ce[_0x4a98('0x18')][_0x4a98('0x1a')]);return _0x4bf239(_0x5723ce[_0x4a98('0x18')][_0x4a98('0x1a')]);}logger[_0x4a98('0x18')](_0x4a98('0x14'),_0x52790b,_0x5723ce['error'][_0x4a98('0x1a')]);return _0x4df331(_0x5723ce[_0x4a98('0x18')][_0x4a98('0x1a')]);}else{logger[_0x4a98('0x13')](_0x4a98('0x14'),_0x52790b,_0x4a98('0x15'));_0x4df331(_0x5723ce[_0x4a98('0x1b')][_0x4a98('0x1a')]);}})[_0x4a98('0x1c')](function(_0x1acd5b){logger['error'](_0x4a98('0x14'),_0x52790b,_0x1acd5b);_0x4bf239(_0x1acd5b);});});}exports[_0x4a98('0x1d')]=function(_0x56dc18){var _0x49922f=this;return new Promise(function(_0x2a7fe9,_0x32a07d){return db[_0x4a98('0x1e')][_0x4a98('0x1f')](_0x56dc18[_0x4a98('0x20')],{'raw':_0x56dc18['options']?_0x56dc18['options'][_0x4a98('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56dc18[_0x4a98('0x22')]?_0x56dc18[_0x4a98('0x22')]['where']||null:null,'attributes':_0x56dc18[_0x4a98('0x22')]?_0x56dc18[_0x4a98('0x22')][_0x4a98('0x23')]||null:null,'limit':_0x56dc18[_0x4a98('0x22')]?_0x56dc18['options'][_0x4a98('0x24')]||null:null})[_0x4a98('0x12')](function(_0x1c67a8){logger[_0x4a98('0x13')](_0x4a98('0x1d'),_0x56dc18);logger[_0x4a98('0x25')]('UpdateSmsInteraction',_0x56dc18,JSON[_0x4a98('0x17')](_0x1c67a8));_0x2a7fe9(_0x1c67a8);})[_0x4a98('0x1c')](function(_0x2d5875){logger[_0x4a98('0x18')](_0x4a98('0x1d'),_0x2d5875['message'],_0x56dc18);_0x32a07d(_0x49922f[_0x4a98('0x18')](0x1f4,_0x2d5875['message']));});});};exports[_0x4a98('0x26')]=function(_0x50a6aa){return new Promise(function(_0x2ed27b,_0x444478){return db[_0x4a98('0x1e')]['find']({'where':_0x50a6aa['options']?_0x50a6aa[_0x4a98('0x22')][_0x4a98('0x27')]||null:null})[_0x4a98('0x12')](function(_0x51384d){if(_0x51384d){return _0x51384d[_0x4a98('0x28')](_0x50a6aa[_0x4a98('0x20')][_0x4a98('0x29')],_[_0x4a98('0x2a')](_0x50a6aa[_0x4a98('0x20')],[_0x4a98('0x29'),'id'])||{});}})['spread'](function(_0x77f382){logger[_0x4a98('0x13')](_0x4a98('0x2b'),_0x50a6aa);logger[_0x4a98('0x25')]('AddTags',_0x50a6aa,JSON['stringify'](_0x77f382));_0x2ed27b(_0x77f382);})[_0x4a98('0x1c')](function(_0x2942f2){logger['error'](_0x4a98('0x2b'),_0x2942f2[_0x4a98('0x1a')],_0x50a6aa);_0x444478(_this[_0x4a98('0x18')](0x1f4,_0x2942f2[_0x4a98('0x1a')]));});});}; \ No newline at end of file +var _0xed60=['request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0xed60,0x135));var _0x0ed6=function(_0xcba517,_0x149261){_0xcba517=_0xcba517-0x0;var _0x54294d=_0xed60[_0xcba517];return _0x54294d;};'use strict';var _=require(_0x0ed6('0x0'));var util=require(_0x0ed6('0x1'));var moment=require(_0x0ed6('0x2'));var BPromise=require(_0x0ed6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ed6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ed6('0x5'))(_0x0ed6('0x6'));var config=require('../../config/environment');var jayson=require(_0x0ed6('0x7'));var client=jayson[_0x0ed6('0x8')][_0x0ed6('0x9')]({'port':0x232a});config[_0x0ed6('0xa')]=_['defaults'](config[_0x0ed6('0xa')],{'host':_0x0ed6('0xb'),'port':0x18eb});var socket=require(_0x0ed6('0xc'))(new Redis(config['redis']));require(_0x0ed6('0xd'))[_0x0ed6('0xe')](socket);function respondWithRpcPromise(_0x23b333,_0x373496,_0x8e0b89){return new BPromise(function(_0x22148c,_0x58b84f){return client[_0x0ed6('0xf')](_0x23b333,_0x8e0b89)[_0x0ed6('0x10')](function(_0x24bbe3){logger[_0x0ed6('0x11')](_0x0ed6('0x12'),_0x373496,_0x0ed6('0x13'));logger[_0x0ed6('0x14')](_0x0ed6('0x15'),_0x373496,_0x0ed6('0x13'),JSON[_0x0ed6('0x16')](_0x24bbe3));if(_0x24bbe3[_0x0ed6('0x17')]){if(_0x24bbe3[_0x0ed6('0x17')]['code']===0x1f4){logger[_0x0ed6('0x17')](_0x0ed6('0x12'),_0x373496,_0x24bbe3[_0x0ed6('0x17')][_0x0ed6('0x18')]);return _0x58b84f(_0x24bbe3[_0x0ed6('0x17')][_0x0ed6('0x18')]);}logger[_0x0ed6('0x17')](_0x0ed6('0x12'),_0x373496,_0x24bbe3[_0x0ed6('0x17')][_0x0ed6('0x18')]);return _0x22148c(_0x24bbe3[_0x0ed6('0x17')][_0x0ed6('0x18')]);}else{logger[_0x0ed6('0x11')](_0x0ed6('0x12'),_0x373496,_0x0ed6('0x13'));_0x22148c(_0x24bbe3[_0x0ed6('0x19')][_0x0ed6('0x18')]);}})[_0x0ed6('0x1a')](function(_0x16a75f){logger[_0x0ed6('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x373496,_0x16a75f);_0x58b84f(_0x16a75f);});});}exports[_0x0ed6('0x1b')]=function(_0x24798f){var _0x402a59=this;return new Promise(function(_0x5d57db,_0x5c1aa8){return db[_0x0ed6('0x1c')]['update'](_0x24798f['body'],{'raw':_0x24798f[_0x0ed6('0x1d')]?_0x24798f[_0x0ed6('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24798f[_0x0ed6('0x1d')]?_0x24798f[_0x0ed6('0x1d')][_0x0ed6('0x1e')]||null:null,'attributes':_0x24798f[_0x0ed6('0x1d')]?_0x24798f[_0x0ed6('0x1d')][_0x0ed6('0x1f')]||null:null,'limit':_0x24798f[_0x0ed6('0x1d')]?_0x24798f[_0x0ed6('0x1d')][_0x0ed6('0x20')]||null:null})[_0x0ed6('0x10')](function(_0x340b4e){logger['info'](_0x0ed6('0x1b'),_0x24798f);logger[_0x0ed6('0x14')](_0x0ed6('0x1b'),_0x24798f,JSON[_0x0ed6('0x16')](_0x340b4e));_0x5d57db(_0x340b4e);})[_0x0ed6('0x1a')](function(_0x207fcb){logger[_0x0ed6('0x17')](_0x0ed6('0x1b'),_0x207fcb[_0x0ed6('0x18')],_0x24798f);_0x5c1aa8(_0x402a59[_0x0ed6('0x17')](0x1f4,_0x207fcb['message']));});});};exports[_0x0ed6('0x21')]=function(_0x447ba3){return new Promise(function(_0x58fb59,_0x3c95e){return db[_0x0ed6('0x1c')][_0x0ed6('0x22')]({'where':_0x447ba3[_0x0ed6('0x1d')]?_0x447ba3[_0x0ed6('0x1d')]['where']||null:null})['then'](function(_0x16d287){if(_0x16d287){return _0x16d287[_0x0ed6('0x23')](_0x447ba3[_0x0ed6('0x24')][_0x0ed6('0x25')],_[_0x0ed6('0x26')](_0x447ba3[_0x0ed6('0x24')],['ids','id'])||{});}})[_0x0ed6('0x27')](function(_0x50bbcb){logger[_0x0ed6('0x11')](_0x0ed6('0x28'),_0x447ba3);logger['debug'](_0x0ed6('0x28'),_0x447ba3,JSON[_0x0ed6('0x16')](_0x50bbcb));_0x58fb59(_0x50bbcb);})[_0x0ed6('0x1a')](function(_0x1c4401){logger[_0x0ed6('0x17')](_0x0ed6('0x28'),_0x1c4401[_0x0ed6('0x18')],_0x447ba3);_0x3c95e(_this[_0x0ed6('0x17')](0x1f4,_0x1c4401[_0x0ed6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 392519d..8788ec9 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 _0x4380=['smsInteraction:','save','remove','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4380,0xc7));var _0x0438=function(_0x27b31f,_0x29af13){_0x27b31f=_0x27b31f-0x0;var _0x44cd6b=_0x4380[_0x27b31f];return _0x44cd6b;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0438('0x0'),_0x0438('0x1'),'update'];function createListener(_0xef205c,_0x2e546b){return function(_0x81c8ef){_0x2e546b['emit'](_0xef205c,_0x81c8ef);};}function removeListener(_0x5f0d31,_0x51eb5a){return function(){SmsInteractionEvents[_0x0438('0x2')](_0x5f0d31,_0x51eb5a);};}exports[_0x0438('0x3')]=function(_0x2365ba){for(var _0x2109c4=0x0,_0x54c834=events[_0x0438('0x4')];_0x2109c4<_0x54c834;_0x2109c4++){var _0x116da2=events[_0x2109c4];var _0x4ed278=createListener(_0x0438('0x5')+_0x116da2,_0x2365ba);SmsInteractionEvents['on'](_0x116da2,_0x4ed278);}}; \ No newline at end of file +var _0xefaa=['save','remove','emit','removeListener','register','length'];(function(_0x2c826b,_0xadaf9e){var _0x22603f=function(_0x5c3782){while(--_0x5c3782){_0x2c826b['push'](_0x2c826b['shift']());}};_0x22603f(++_0xadaf9e);}(_0xefaa,0xa8));var _0xaefa=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xefaa[_0x55f8b4];return _0x2475f9;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xaefa('0x0'),_0xaefa('0x1'),'update'];function createListener(_0x357534,_0x40d537){return function(_0x471a0e){_0x40d537[_0xaefa('0x2')](_0x357534,_0x471a0e);};}function removeListener(_0x4387c7,_0x1548f2){return function(){SmsInteractionEvents[_0xaefa('0x3')](_0x4387c7,_0x1548f2);};}exports[_0xaefa('0x4')]=function(_0x203190){for(var _0x2f13a2=0x0,_0x54a9e4=events[_0xaefa('0x5')];_0x2f13a2<_0x54a9e4;_0x2f13a2++){var _0x1d780b=events[_0x2f13a2];var _0x38db6c=createListener('smsInteraction:'+_0x1d780b,_0x203190);SmsInteractionEvents['on'](_0x1d780b,_0x38db6c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 3878e63..a0382b4 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 _0x7c5a=['post','create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','destroy','util','path','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x7c5a,0x184));var _0xa7c5=function(_0x3485eb,_0x546bac){_0x3485eb=_0x3485eb-0x0;var _0x1c8820=_0x7c5a[_0x3485eb];return _0x1c8820;};'use strict';var multer=require('multer');var util=require(_0xa7c5('0x0'));var path=require(_0xa7c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa7c5('0x2'));var interaction=require(_0xa7c5('0x3'));var config=require('../../config/environment');var controller=require(_0xa7c5('0x4'));router['get']('/',auth[_0xa7c5('0x5')](),controller[_0xa7c5('0x6')]);router[_0xa7c5('0x7')]('/describe',auth[_0xa7c5('0x5')](),controller[_0xa7c5('0x8')]);router[_0xa7c5('0x7')](_0xa7c5('0x9'),auth[_0xa7c5('0x5')](),controller[_0xa7c5('0xa')]);router[_0xa7c5('0xb')]('/',auth[_0xa7c5('0x5')](),interaction['tracked']('sms','smsmessage:create'),controller[_0xa7c5('0xc')]);router[_0xa7c5('0xb')](_0xa7c5('0xd'),controller[_0xa7c5('0xe')]);router[_0xa7c5('0xf')](_0xa7c5('0x9'),auth[_0xa7c5('0x5')](),controller['update']);router[_0xa7c5('0xf')](_0xa7c5('0x10'),auth[_0xa7c5('0x5')](),controller['accept']);router['put'](_0xa7c5('0x11'),auth['isAuthenticated'](),controller[_0xa7c5('0x12')]);router[_0xa7c5('0x13')](_0xa7c5('0x9'),auth[_0xa7c5('0x5')](),controller[_0xa7c5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x884c=['show','sms','smsmessage:create','create','post','/:id/status','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/:id'];(function(_0x18d4b0,_0x53e770){var _0xff15a7=function(_0x535c4f){while(--_0x535c4f){_0x18d4b0['push'](_0x18d4b0['shift']());}};_0xff15a7(++_0x53e770);}(_0x884c,0x1bd));var _0xc884=function(_0x527000,_0x58f55a){_0x527000=_0x527000-0x0;var _0x552d23=_0x884c[_0x527000];return _0x552d23;};'use strict';var multer=require(_0xc884('0x0'));var util=require(_0xc884('0x1'));var path=require(_0xc884('0x2'));var timeout=require(_0xc884('0x3'));var express=require('express');var router=express[_0xc884('0x4')]();var fs_extra=require(_0xc884('0x5'));var auth=require(_0xc884('0x6'));var interaction=require(_0xc884('0x7'));var config=require(_0xc884('0x8'));var controller=require(_0xc884('0x9'));router['get']('/',auth[_0xc884('0xa')](),controller[_0xc884('0xb')]);router[_0xc884('0xc')]('/describe',auth[_0xc884('0xa')](),controller['describe']);router[_0xc884('0xc')](_0xc884('0xd'),auth['isAuthenticated'](),controller[_0xc884('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xc884('0xf'),_0xc884('0x10')),controller[_0xc884('0x11')]);router[_0xc884('0x12')](_0xc884('0x13'),controller['status']);router[_0xc884('0x14')](_0xc884('0xd'),auth[_0xc884('0xa')](),controller[_0xc884('0x15')]);router['put'](_0xc884('0x16'),auth['isAuthenticated'](),controller[_0xc884('0x17')]);router[_0xc884('0x14')](_0xc884('0x18'),auth[_0xc884('0xa')](),controller['reject']);router['delete']('/:id',auth[_0xc884('0xa')](),controller[_0xc884('0x19')]);module[_0xc884('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 0bae919..0c05eab 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 _0x9ff0=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x581d5b,_0x58b616){var _0x596f6c=function(_0x291379){while(--_0x291379){_0x581d5b['push'](_0x581d5b['shift']());}};_0x596f6c(++_0x58b616);}(_0x9ff0,0x1c1));var _0x09ff=function(_0x549d69,_0x323f47){_0x549d69=_0x549d69-0x0;var _0x151f88=_0x9ff0[_0x549d69];return _0x151f88;};'use strict';var Sequelize=require('sequelize');module[_0x09ff('0x0')]={'body':{'type':Sequelize[_0x09ff('0x1')](_0x09ff('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x09ff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x09ff('0x4')]('in',_0x09ff('0x5')),'defaultValue':_0x09ff('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x09ff('0x6')](0xbe)},'phone':{'type':Sequelize[_0x09ff('0x6')]},'readAt':{'type':Sequelize[_0x09ff('0x7')]},'secret':{'type':Sequelize[_0x09ff('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x09ff('0x6')]},'providerResponse':{'type':Sequelize[_0x09ff('0x1')]}}; \ No newline at end of file +var _0x7a62=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x58696b,_0x5899b2){var _0x4da6c5=function(_0xa7a9ae){while(--_0xa7a9ae){_0x58696b['push'](_0x58696b['shift']());}};_0x4da6c5(++_0x5899b2);}(_0x7a62,0x111));var _0x27a6=function(_0x16cf06,_0x525775){_0x16cf06=_0x16cf06-0x0;var _0x611b7e=_0x7a62[_0x16cf06];return _0x611b7e;};'use strict';var Sequelize=require(_0x27a6('0x0'));module[_0x27a6('0x1')]={'body':{'type':Sequelize[_0x27a6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x27a6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x27a6('0x4')]('in',_0x27a6('0x5')),'defaultValue':_0x27a6('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x27a6('0x6')](0xbe)},'phone':{'type':Sequelize[_0x27a6('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x27a6('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x27a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6de7d7b..34de2f0 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 _0x4329=['RejectMessage','rejectMessage','Sequelize','internal','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageUUID','messageId','indexOf','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','destroy','end','stack','name','send','index','SmsMessage','type','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','findAll','rows','show','params','rawAttributes','includeAll','include','create','body','update','find','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage'];(function(_0x4ad6e4,_0x103161){var _0x11e62a=function(_0x10dc1e){while(--_0x10dc1e){_0x4ad6e4['push'](_0x4ad6e4['shift']());}};_0x11e62a(++_0x103161);}(_0x4329,0x13b));var _0x9432=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x4329[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x9432('0x0'));var rimraf=require(_0x9432('0x1'));var zipdir=require(_0x9432('0x2'));var jsonpatch=require(_0x9432('0x3'));var rp=require(_0x9432('0x4'));var moment=require(_0x9432('0x5'));var BPromise=require(_0x9432('0x6'));var Mustache=require(_0x9432('0x7'));var util=require(_0x9432('0x8'));var path=require(_0x9432('0x9'));var sox=require(_0x9432('0xa'));var csv=require(_0x9432('0xb'));var ejs=require(_0x9432('0xc'));var fs=require('fs');var fs_extra=require(_0x9432('0xd'));var _=require('lodash');var squel=require(_0x9432('0xe'));var crypto=require('crypto');var jsforce=require(_0x9432('0xf'));var deskjs=require(_0x9432('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9432('0x11'));var Papa=require(_0x9432('0x12'));var Redis=require(_0x9432('0x13'));var authService=require(_0x9432('0x14'));var qs=require(_0x9432('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9432('0x16'));var logger=require(_0x9432('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x9432('0x18'));var licenseUtil=require(_0x9432('0x19'));var db=require(_0x9432('0x1a'))['db'];config[_0x9432('0x1b')]=_['defaults'](config[_0x9432('0x1b')],{'host':_0x9432('0x1c'),'port':0x18eb});var socket=require(_0x9432('0x1d'))(new Redis(config[_0x9432('0x1b')]));require(_0x9432('0x1e'))['register'](socket);var jayson=require(_0x9432('0x1f'));var client=jayson[_0x9432('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x9432('0x20')][_0x9432('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5678c4,_0x2b8d4b,_0x23ca2d,_0x5334fe){return new BPromise(function(_0x5c4360,_0x496a9f){var _0x5e2163=_0x5334fe||client;return _0x5e2163['request'](_0x5678c4,_0x23ca2d)[_0x9432('0x22')](function(_0x18f944){logger[_0x9432('0x23')]('SmsMessage,\x20%s,\x20%s',_0x2b8d4b,_0x9432('0x24'));logger['debug'](_0x9432('0x25'),_0x2b8d4b,_0x9432('0x24'),JSON[_0x9432('0x26')](_0x18f944));if(_0x18f944['error']){if(_0x18f944[_0x9432('0x27')][_0x9432('0x28')]===0x1f4){logger[_0x9432('0x27')](_0x9432('0x29'),_0x2b8d4b,_0x18f944[_0x9432('0x27')][_0x9432('0x2a')]);return _0x496a9f(_0x18f944[_0x9432('0x27')]['message']);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x2b8d4b,_0x18f944[_0x9432('0x27')][_0x9432('0x2a')]);return _0x5c4360(_0x18f944[_0x9432('0x27')][_0x9432('0x2a')]);}else{logger['info'](_0x9432('0x29'),_0x2b8d4b,'request\x20sent');_0x5c4360(_0x18f944[_0x9432('0x2b')][_0x9432('0x2a')]);}})[_0x9432('0x2c')](function(_0x1dfee6){logger[_0x9432('0x27')](_0x9432('0x29'),_0x2b8d4b,_0x1dfee6);_0x496a9f(_0x1dfee6);});});}function respondWithStatusCode(_0x121cb9,_0x205ce9){_0x205ce9=_0x205ce9||0xcc;return function(_0x9d258d){if(_0x9d258d){return _0x121cb9[_0x9432('0x2d')](_0x205ce9);}return _0x121cb9['status'](_0x205ce9)['end']();};}function respondWithResult(_0x3bd58b,_0x4ba316){_0x4ba316=_0x4ba316||0xc8;return function(_0x58c056){if(_0x58c056){return _0x3bd58b[_0x9432('0x2e')](_0x4ba316)['json'](_0x58c056);}};}function respondWithFilteredResult(_0x4bf4ae,_0x3c8992){return function(_0x27a638){if(_0x27a638){var _0x146a06=typeof _0x3c8992[_0x9432('0x2f')]==='undefined'&&typeof _0x3c8992['limit']===_0x9432('0x30');var _0x3d7504=_0x27a638[_0x9432('0x31')];var _0x32e991=_0x146a06?0x0:_0x3c8992[_0x9432('0x2f')];var _0x35d955=_0x146a06?_0x27a638[_0x9432('0x31')]:_0x3c8992[_0x9432('0x2f')]+_0x3c8992[_0x9432('0x32')];var _0x53185b;if(_0x35d955>=_0x3d7504){_0x35d955=_0x3d7504;_0x53185b=0xc8;}else{_0x53185b=0xce;}_0x4bf4ae['status'](_0x53185b);return _0x4bf4ae['set'](_0x9432('0x33'),_0x32e991+'-'+_0x35d955+'/'+_0x3d7504)[_0x9432('0x34')](_0x27a638);}return null;};}function patchUpdates(_0x579832){return function(_0x5cca62){try{jsonpatch[_0x9432('0x35')](_0x5cca62,_0x579832,!![]);}catch(_0x1b50ca){return BPromise[_0x9432('0x36')](_0x1b50ca);}return _0x5cca62['save']();};}function saveUpdates(_0x285df7,_0x271e53){return function(_0x354f47){if(_0x354f47){return _0x354f47['update'](_0x285df7)[_0x9432('0x22')](function(_0x47de71){return _0x47de71;});}return null;};}function removeEntity(_0xbb02d2,_0xbbb30){return function(_0x5997dc){if(_0x5997dc){return _0x5997dc[_0x9432('0x37')]()[_0x9432('0x22')](function(){_0xbb02d2[_0x9432('0x2e')](0xcc)[_0x9432('0x38')]();});}};}function handleEntityNotFound(_0x5e1bbd,_0x41869a){return function(_0x30e938){if(!_0x30e938){_0x5e1bbd[_0x9432('0x2d')](0x194);}return _0x30e938;};}function handleError(_0x1658ab,_0x3fc38e){_0x3fc38e=_0x3fc38e||0x1f4;return function(_0x564352){logger['error'](_0x564352[_0x9432('0x39')]);if(_0x564352[_0x9432('0x3a')]){delete _0x564352[_0x9432('0x3a')];}_0x1658ab[_0x9432('0x2e')](_0x3fc38e)[_0x9432('0x3b')](_0x564352);};}exports[_0x9432('0x3c')]=function(_0x19b364,_0x351384){var _0x5a728a={},_0x431d2d={},_0x157ca6={'count':0x0,'rows':[]};var _0x3d064c=_['map'](db[_0x9432('0x3d')]['rawAttributes'],function(_0x392d69){return{'name':_0x392d69['fieldName'],'type':_0x392d69[_0x9432('0x3e')]['key']};});_0x431d2d[_0x9432('0x3f')]=_[_0x9432('0x40')](_0x3d064c,_0x9432('0x3a'));_0x431d2d['query']=_[_0x9432('0x41')](_0x19b364[_0x9432('0x42')]);_0x431d2d['filters']=_['intersection'](_0x431d2d[_0x9432('0x3f')],_0x431d2d[_0x9432('0x42')]);_0x5a728a[_0x9432('0x43')]=_[_0x9432('0x44')](_0x431d2d[_0x9432('0x3f')],qs['fields'](_0x19b364[_0x9432('0x42')][_0x9432('0x45')]));_0x5a728a['attributes']=_0x5a728a[_0x9432('0x43')][_0x9432('0x46')]?_0x5a728a[_0x9432('0x43')]:_0x431d2d[_0x9432('0x3f')];if(!_0x19b364[_0x9432('0x42')][_0x9432('0x47')](_0x9432('0x48'))){_0x5a728a[_0x9432('0x32')]=qs[_0x9432('0x32')](_0x19b364['query'][_0x9432('0x32')]);_0x5a728a[_0x9432('0x2f')]=qs[_0x9432('0x2f')](_0x19b364[_0x9432('0x42')]['offset']);}_0x5a728a['order']=qs[_0x9432('0x49')](_0x19b364[_0x9432('0x42')][_0x9432('0x49')]);_0x5a728a[_0x9432('0x4a')]=qs['filters'](_[_0x9432('0x4b')](_0x19b364[_0x9432('0x42')],_0x431d2d[_0x9432('0x4c')]),_0x3d064c);if(_0x19b364[_0x9432('0x42')][_0x9432('0x4d')]){_0x5a728a[_0x9432('0x4a')]=_[_0x9432('0x4e')](_0x5a728a['where'],{'$or':_[_0x9432('0x40')](_0x3d064c,function(_0x3a870){if(_0x3a870['type']!=='VIRTUAL'){var _0x38ebab={};_0x38ebab[_0x3a870[_0x9432('0x3a')]]={'$like':'%'+_0x19b364['query'][_0x9432('0x4d')]+'%'};return _0x38ebab;}})});}_0x5a728a=_['merge']({},_0x5a728a,_0x19b364[_0x9432('0x4f')]);var _0x201080={'where':_0x5a728a[_0x9432('0x4a')]};return db['SmsMessage']['count'](_0x201080)[_0x9432('0x22')](function(_0x572a11){_0x157ca6[_0x9432('0x31')]=_0x572a11;if(_0x19b364['query']['includeAll']){_0x5a728a['include']=[{'all':!![]}];}return db[_0x9432('0x3d')][_0x9432('0x50')](_0x5a728a);})['then'](function(_0x93625e){_0x157ca6[_0x9432('0x51')]=_0x93625e;return _0x157ca6;})[_0x9432('0x22')](respondWithFilteredResult(_0x351384,_0x5a728a))[_0x9432('0x2c')](handleError(_0x351384,null));};exports[_0x9432('0x52')]=function(_0x5047f0,_0x2fcf4f){var _0x52bc37={'raw':!![],'where':{'id':_0x5047f0[_0x9432('0x53')]['id']}},_0x22cebd={};_0x22cebd[_0x9432('0x3f')]=_[_0x9432('0x41')](db[_0x9432('0x3d')][_0x9432('0x54')]);_0x22cebd['query']=_[_0x9432('0x41')](_0x5047f0[_0x9432('0x42')]);_0x22cebd[_0x9432('0x4c')]=_[_0x9432('0x44')](_0x22cebd[_0x9432('0x3f')],_0x22cebd[_0x9432('0x42')]);_0x52bc37['attributes']=_[_0x9432('0x44')](_0x22cebd[_0x9432('0x3f')],qs[_0x9432('0x45')](_0x5047f0[_0x9432('0x42')]['fields']));_0x52bc37['attributes']=_0x52bc37[_0x9432('0x43')]['length']?_0x52bc37[_0x9432('0x43')]:_0x22cebd['model'];if(_0x5047f0['query'][_0x9432('0x55')]){_0x52bc37[_0x9432('0x56')]=[{'all':!![]}];}_0x52bc37=_[_0x9432('0x4e')]({},_0x52bc37,_0x5047f0[_0x9432('0x4f')]);return db[_0x9432('0x3d')]['find'](_0x52bc37)[_0x9432('0x22')](handleEntityNotFound(_0x2fcf4f,null))['then'](respondWithResult(_0x2fcf4f,null))[_0x9432('0x2c')](handleError(_0x2fcf4f,null));};exports['create']=function(_0x2fd7e7,_0x553b9b){return db[_0x9432('0x3d')][_0x9432('0x57')](_0x2fd7e7[_0x9432('0x58')],{})[_0x9432('0x22')](respondWithResult(_0x553b9b,0xc9))['catch'](handleError(_0x553b9b,null));};exports[_0x9432('0x59')]=function(_0x4f9eb3,_0x3feddb){if(_0x4f9eb3[_0x9432('0x58')]['id']){delete _0x4f9eb3[_0x9432('0x58')]['id'];}return db['SmsMessage'][_0x9432('0x5a')]({'where':{'id':_0x4f9eb3[_0x9432('0x53')]['id']}})[_0x9432('0x22')](handleEntityNotFound(_0x3feddb,null))[_0x9432('0x22')](saveUpdates(_0x4f9eb3['body'],null))[_0x9432('0x22')](respondWithResult(_0x3feddb,null))[_0x9432('0x2c')](handleError(_0x3feddb,null));};exports[_0x9432('0x37')]=function(_0x583a06,_0x54062c){return db['SmsMessage']['find']({'where':{'id':_0x583a06[_0x9432('0x53')]['id']}})[_0x9432('0x22')](handleEntityNotFound(_0x54062c,null))[_0x9432('0x22')](removeEntity(_0x54062c,null))[_0x9432('0x2c')](handleError(_0x54062c,null));};exports['describe']=function(_0x434f79,_0xaef7a7){return db['SmsMessage']['describe']()[_0x9432('0x22')](respondWithResult(_0xaef7a7,null))[_0x9432('0x2c')](handleError(_0xaef7a7,null));};var interaction_log=require(_0x9432('0x17'))(_0x9432('0x5b'));exports[_0x9432('0x5c')]=function(_0x283cdf,_0x3724fc,_0x4fe999){var _0x2d37c8={'agent':{},'channel':_0x9432('0x5d')};if(_0x283cdf[_0x9432('0x58')]['id']){delete _0x283cdf['body']['id'];}_0x283cdf['body'][_0x9432('0x5e')]=!![];_0x283cdf[_0x9432('0x58')]['readAt']=moment()[_0x9432('0x5f')](_0x9432('0x60'));_0x283cdf[_0x9432('0x58')][_0x9432('0x61')]=_0x283cdf[_0x9432('0x58')][_0x9432('0x61')]||_0x283cdf[_0x9432('0x62')]['id'];_0x2d37c8[_0x9432('0x63')]['id']=_0x283cdf[_0x9432('0x58')]['UserId'];return db['SmsMessage'][_0x9432('0x5a')]({'where':{'id':_0x283cdf[_0x9432('0x53')]['id'],'UserId':null}})[_0x9432('0x22')](handleEntityNotFound(_0x3724fc,null))[_0x9432('0x22')](saveUpdates(_0x283cdf[_0x9432('0x58')],null))[_0x9432('0x22')](function(_0x1b50ff){if(_0x1b50ff){_0x2d37c8['message']=_0x1b50ff[_0x9432('0x64')]({'plain':!![]});return db[_0x9432('0x65')]['find']({'where':{'id':_0x1b50ff['SmsInteractionId']}});}return null;})[_0x9432('0x22')](handleEntityNotFound(_0x3724fc,null))[_0x9432('0x22')](function(_0x17d5b6){if(_0x17d5b6){return _0x17d5b6['update']({'UserId':_0x283cdf['body'][_0x9432('0x61')],'read1stAt':_[_0x9432('0x66')](_0x17d5b6['read1stAt'])?moment()[_0x9432('0x5f')](_0x9432('0x60')):undefined});}return null;})[_0x9432('0x22')](function(_0x15083e){if(_0x15083e){_0x2d37c8[_0x9432('0x67')]=_0x15083e['get']({'plain':!![]});interaction_log[_0x9432('0x23')](_0x9432('0x68'),_0x283cdf['user']['id'],_0x283cdf[_0x9432('0x62')][_0x9432('0x3a')],_0x283cdf['user'][_0x9432('0x69')],_0x2d37c8['interaction']['id'],_0x283cdf[_0x9432('0x58')]?JSON[_0x9432('0x26')](_0x283cdf['body']):_0x9432('0x6a'));return respondWithRpcPromise(_0x9432('0x6b'),_0x9432('0x6c'),_0x2d37c8);}return null;})[_0x9432('0x22')](function(_0x2ce424){var _0x5056ab=_0x9432('0x6d')+_0x2ce424[_0x9432('0x2a')][_0x9432('0x6e')];return db['sequelize'][_0x9432('0x42')](_0x5056ab,{'type':db['Sequelize'][_0x9432('0x6f')][_0x9432('0x70')],'raw':!![]})[_0x9432('0x22')](function(_0x4db1f8){return _0x4db1f8;});})['then'](function(_0x2c6671){if(_0x2c6671){_0x2d37c8['message'][_0x9432('0x71')]=_0x2c6671[0x0];if(!_0x283cdf['body']['UserId'])return;return db[_0x9432('0x72')][_0x9432('0x5a')]({'where':{'id':_0x283cdf[_0x9432('0x58')][_0x9432('0x61')],'role':_0x9432('0x63')},'attributes':['id',_0x9432('0x3a'),_0x9432('0x73'),_0x9432('0x74'),'internal'],'raw':!![]});}return null;})[_0x9432('0x22')](function(_0x1de7e6){if(!_0x1de7e6)return null;_0x2d37c8['message'][_0x9432('0x63')]=_0x1de7e6;return _0x2d37c8;})[_0x9432('0x22')](function(_0x4ba04c){if(_0x4ba04c){if(_0x283cdf[_0x9432('0x58')]['manual']){_0x2d37c8[_0x9432('0x2a')]['interface']=util[_0x9432('0x5f')](_0x9432('0x75'),_0x283cdf[_0x9432('0x62')][_0x9432('0x3a')]);_0x2d37c8[_0x9432('0x2a')][_0x9432('0x76')]=_0x2d37c8[_0x9432('0x76')];_0x2d37c8['message'][_0x9432('0x77')]=_0x2d37c8[_0x9432('0x76')];_0x2d37c8[_0x9432('0x2a')][_0x9432('0x78')]=_0x9432('0x5c');return respondWithRpcPromise(_0x9432('0x79'),_0x9432('0x79'),{'event':_0x9432('0x7a'),'message':_0x2d37c8[_0x9432('0x2a')]},client9002)['then'](function(){return _0x2d37c8;});}return _0x2d37c8;}return null;})[_0x9432('0x22')](respondWithResult(_0x3724fc,null))[_0x9432('0x2c')](handleError(_0x3724fc,null));};var interaction_log=require(_0x9432('0x17'))(_0x9432('0x5b'));exports['reject']=function(_0xbd739f,_0xd62d2d,_0x3bef8b){var _0x4d99f0={'agent':{},'channel':_0x9432('0x5d')};if(_0xbd739f['body']['id']){delete _0xbd739f[_0x9432('0x58')]['id'];}_0xbd739f[_0x9432('0x58')][_0x9432('0x61')]=_0xbd739f['body'][_0x9432('0x61')]||_0xbd739f[_0x9432('0x62')]['id'];_0x4d99f0[_0x9432('0x63')]['id']=_0xbd739f[_0x9432('0x58')][_0x9432('0x61')];return db[_0x9432('0x3d')][_0x9432('0x5a')]({'where':{'id':_0xbd739f[_0x9432('0x53')]['id'],'UserId':null}})[_0x9432('0x22')](handleEntityNotFound(_0xd62d2d,null))[_0x9432('0x22')](function(_0x25a334){if(_0x25a334){_0x4d99f0[_0x9432('0x2a')]=_0x25a334[_0x9432('0x64')]({'plain':!![]});return db[_0x9432('0x65')][_0x9432('0x5a')]({'where':{'id':_0x25a334['SmsInteractionId']}});}return null;})[_0x9432('0x22')](handleEntityNotFound(_0xd62d2d,null))['then'](function(_0x9a7e5a){if(_0x9a7e5a){_0x4d99f0[_0x9432('0x67')]=_0x9a7e5a[_0x9432('0x64')]({'plain':!![]});interaction_log[_0x9432('0x23')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xbd739f[_0x9432('0x62')]['id'],_0xbd739f[_0x9432('0x62')][_0x9432('0x3a')],_0xbd739f[_0x9432('0x62')][_0x9432('0x69')],_0x4d99f0[_0x9432('0x67')]['id'],_0xbd739f['body']?JSON[_0x9432('0x26')](_0xbd739f['body']):_0x9432('0x6a'));return respondWithRpcPromise(_0x9432('0x7b'),_0x9432('0x7c'),_0x4d99f0);}return null;})[_0x9432('0x22')](function(_0x89056c){var _0x2351bc=_0x9432('0x6d')+_0x89056c[_0x9432('0x2a')][_0x9432('0x6e')];return db['sequelize'][_0x9432('0x42')](_0x2351bc,{'type':db[_0x9432('0x7d')][_0x9432('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x47457a){return _0x47457a;});})[_0x9432('0x22')](function(_0x128135){if(_0x128135){_0x4d99f0[_0x9432('0x2a')]['contact']=_0x128135[0x0];if(!_0xbd739f[_0x9432('0x58')][_0x9432('0x61')])return;return db['User'][_0x9432('0x5a')]({'where':{'id':_0xbd739f['body'][_0x9432('0x61')],'role':_0x9432('0x63')},'attributes':['id','name',_0x9432('0x73'),'email',_0x9432('0x7e')],'raw':!![]});}return null;})[_0x9432('0x22')](function(_0x5a16c1){if(!_0x5a16c1)return null;_0x4d99f0[_0x9432('0x2a')][_0x9432('0x63')]=_0x5a16c1;return _0x4d99f0;})[_0x9432('0x22')](function(_0x388fab){if(_0x388fab){_0x388fab[_0x9432('0x2a')][_0x9432('0x7f')]=util[_0x9432('0x5f')](_0x9432('0x75'),_0xbd739f[_0x9432('0x62')][_0x9432('0x3a')]);_0x388fab['message'][_0x9432('0x76')]=_0x4d99f0['channel'];_0x388fab['message']['motionChannel']=_0x4d99f0['channel'];_0x388fab[_0x9432('0x2a')][_0x9432('0x78')]=_0x9432('0x36');respondWithRpcPromise(_0x9432('0x79'),'EventManager',{'event':_0x9432('0x80'),'message':_0x388fab['message']},client9002);return _0x4d99f0;}return null;})[_0x9432('0x22')](respondWithResult(_0xd62d2d,null))[_0x9432('0x2c')](handleError(_0xd62d2d,null));};exports['status']=function(_0x552b2c,_0x77925c,_0x2a4493){if(_0x552b2c[_0x9432('0x58')]['id']){delete _0x552b2c[_0x9432('0x58')]['id'];}var _0x48aa60;return db[_0x9432('0x3d')]['find']({'where':{'id':_0x552b2c[_0x9432('0x53')]['id']}})[_0x9432('0x22')](handleEntityNotFound(_0x77925c,null))[_0x9432('0x22')](function(_0x2832da){if(_0x2832da){_0x48aa60=_0x2832da;return db[_0x9432('0x81')]['find']({'where':{'id':_0x2832da[_0x9432('0x82')]}});}})['then'](handleEntityNotFound(_0x77925c,null))[_0x9432('0x22')](function(_0x1243b5){if(_0x1243b5){logger['debug'](_0x9432('0x25'),_0x9432('0x2e'),_0x9432('0x83'),_0x1243b5[_0x9432('0x3e')],util[_0x9432('0x84')](_0x552b2c[_0x9432('0x58')],{'showHidden':![],'depth':null}));switch(_0x1243b5['type']){case _0x9432('0x85'):if(_0x552b2c[_0x9432('0x58')][_0x9432('0x86')]&&_0x552b2c[_0x9432('0x58')][_0x9432('0x86')]===_0x48aa60['messageId']){return _0x48aa60[_0x9432('0x59')]({'read':!![]});}else{logger[_0x9432('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9432('0x2e'),_0x9432('0x85'),util[_0x9432('0x84')](_0x552b2c[_0x9432('0x58')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x552b2c[_0x9432('0x58')][_0x9432('0x87')]&&_0x552b2c[_0x9432('0x58')][_0x9432('0x87')]===_0x48aa60[_0x9432('0x88')]&&_[_0x9432('0x89')](['sent',_0x9432('0x8a')],_0x552b2c[_0x9432('0x58')][_0x9432('0x8b')])>=0x0){return _0x48aa60[_0x9432('0x59')]({'read':!![]});}else{logger[_0x9432('0x27')](_0x9432('0x8c'),_0x9432('0x2e'),_0x9432('0x8d'),util[_0x9432('0x84')](_0x552b2c[_0x9432('0x58')],{'showHidden':![],'depth':null}));}break;case _0x9432('0x8e'):var _0x27ec40=_0x552b2c[_0x9432('0x58')][_0x9432('0x8f')][0x0];if(_0x27ec40[_0x9432('0x2e')][_0x9432('0x90')]===_0x9432('0x91')){return _0x48aa60['update']({'read':!![]});}else{logger['error'](_0x9432('0x8c'),_0x9432('0x2e'),_0x9432('0x8e'),util[_0x9432('0x84')](_0x552b2c['body'],{'showHidden':![],'depth':null}));}break;}return _0x48aa60;}})[_0x9432('0x22')](respondWithResult(_0x77925c,null))[_0x9432('0x2c')](handleError(_0x77925c,null));}; \ No newline at end of file +var _0xdab3=['key','query','keys','intersection','model','attributes','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','fields','includeAll','find','create','body','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','manual','SIP/%s','channel','EventManager','acceptmessage','sms','SmsInteractionId','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','fullname','interface','motionChannel','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','./smsMessage.socket','register','client','http','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','catch','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type'];(function(_0x2c9705,_0x7e284e){var _0x3d6748=function(_0x5b7ee7){while(--_0x5b7ee7){_0x2c9705['push'](_0x2c9705['shift']());}};_0x3d6748(++_0x7e284e);}(_0xdab3,0xeb));var _0x3dab=function(_0x2fabdc,_0x37d605){_0x2fabdc=_0x2fabdc-0x0;var _0x2c748d=_0xdab3[_0x2fabdc];return _0x2c748d;};'use strict';var emlformat=require(_0x3dab('0x0'));var rimraf=require(_0x3dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dab('0x2'));var rp=require(_0x3dab('0x3'));var moment=require(_0x3dab('0x4'));var BPromise=require(_0x3dab('0x5'));var Mustache=require(_0x3dab('0x6'));var util=require(_0x3dab('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3dab('0x8'));var ejs=require(_0x3dab('0x9'));var fs=require('fs');var fs_extra=require(_0x3dab('0xa'));var _=require(_0x3dab('0xb'));var squel=require(_0x3dab('0xc'));var crypto=require(_0x3dab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3dab('0xe'));var toCsv=require(_0x3dab('0x8'));var querystring=require(_0x3dab('0xf'));var Papa=require(_0x3dab('0x10'));var Redis=require(_0x3dab('0x11'));var authService=require(_0x3dab('0x12'));var qs=require(_0x3dab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dab('0x14'));var logger=require(_0x3dab('0x15'))(_0x3dab('0x16'));var utils=require(_0x3dab('0x17'));var config=require(_0x3dab('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3dab('0x19')]=_[_0x3dab('0x1a')](config[_0x3dab('0x19')],{'host':_0x3dab('0x1b'),'port':0x18eb});var socket=require(_0x3dab('0x1c'))(new Redis(config[_0x3dab('0x19')]));require(_0x3dab('0x1d'))[_0x3dab('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3dab('0x1f')][_0x3dab('0x20')]({'port':0x232c});var client9002=jayson[_0x3dab('0x1f')][_0x3dab('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x60120a,_0x55cb0a,_0x4bd3f1,_0xbeeee2){return new BPromise(function(_0x2e9933,_0x173cdc){var _0x367942=_0xbeeee2||client;return _0x367942[_0x3dab('0x21')](_0x60120a,_0x4bd3f1)['then'](function(_0x83a01c){logger[_0x3dab('0x22')]('SmsMessage,\x20%s,\x20%s',_0x55cb0a,_0x3dab('0x23'));logger[_0x3dab('0x24')](_0x3dab('0x25'),_0x55cb0a,_0x3dab('0x23'),JSON['stringify'](_0x83a01c));if(_0x83a01c[_0x3dab('0x26')]){if(_0x83a01c[_0x3dab('0x26')][_0x3dab('0x27')]===0x1f4){logger[_0x3dab('0x26')](_0x3dab('0x28'),_0x55cb0a,_0x83a01c[_0x3dab('0x26')][_0x3dab('0x29')]);return _0x173cdc(_0x83a01c[_0x3dab('0x26')][_0x3dab('0x29')]);}logger['error'](_0x3dab('0x28'),_0x55cb0a,_0x83a01c['error'][_0x3dab('0x29')]);return _0x2e9933(_0x83a01c[_0x3dab('0x26')][_0x3dab('0x29')]);}else{logger[_0x3dab('0x22')](_0x3dab('0x28'),_0x55cb0a,_0x3dab('0x23'));_0x2e9933(_0x83a01c['result']['message']);}})[_0x3dab('0x2a')](function(_0x10f848){logger['error'](_0x3dab('0x28'),_0x55cb0a,_0x10f848);_0x173cdc(_0x10f848);});});}function respondWithStatusCode(_0x2f78d7,_0x240c59){_0x240c59=_0x240c59||0xcc;return function(_0x151806){if(_0x151806){return _0x2f78d7['sendStatus'](_0x240c59);}return _0x2f78d7[_0x3dab('0x2b')](_0x240c59)['end']();};}function respondWithResult(_0x803cc1,_0x1ed38d){_0x1ed38d=_0x1ed38d||0xc8;return function(_0x233800){if(_0x233800){return _0x803cc1[_0x3dab('0x2b')](_0x1ed38d)['json'](_0x233800);}};}function respondWithFilteredResult(_0x4e562c,_0x36f834){return function(_0x5bfe9e){if(_0x5bfe9e){var _0x483bce=typeof _0x36f834['offset']==='undefined'&&typeof _0x36f834[_0x3dab('0x2c')]===_0x3dab('0x2d');var _0x5363ad=_0x5bfe9e[_0x3dab('0x2e')];var _0x2088cc=_0x483bce?0x0:_0x36f834[_0x3dab('0x2f')];var _0xf2c487=_0x483bce?_0x5bfe9e[_0x3dab('0x2e')]:_0x36f834[_0x3dab('0x2f')]+_0x36f834[_0x3dab('0x2c')];var _0x122437;if(_0xf2c487>=_0x5363ad){_0xf2c487=_0x5363ad;_0x122437=0xc8;}else{_0x122437=0xce;}_0x4e562c[_0x3dab('0x2b')](_0x122437);return _0x4e562c[_0x3dab('0x30')](_0x3dab('0x31'),_0x2088cc+'-'+_0xf2c487+'/'+_0x5363ad)[_0x3dab('0x32')](_0x5bfe9e);}return null;};}function patchUpdates(_0x1226ef){return function(_0x30d4dd){try{jsonpatch[_0x3dab('0x33')](_0x30d4dd,_0x1226ef,!![]);}catch(_0x341c2d){return BPromise[_0x3dab('0x34')](_0x341c2d);}return _0x30d4dd['save']();};}function saveUpdates(_0x599b21,_0x3bea25){return function(_0x4f3dca){if(_0x4f3dca){return _0x4f3dca[_0x3dab('0x35')](_0x599b21)[_0x3dab('0x36')](function(_0x492556){return _0x492556;});}return null;};}function removeEntity(_0x325d42,_0x1ea6f1){return function(_0x2340f4){if(_0x2340f4){return _0x2340f4[_0x3dab('0x37')]()['then'](function(){_0x325d42['status'](0xcc)[_0x3dab('0x38')]();});}};}function handleEntityNotFound(_0x47e768,_0x1f0171){return function(_0x34a856){if(!_0x34a856){_0x47e768[_0x3dab('0x39')](0x194);}return _0x34a856;};}function handleError(_0x55cd6a,_0x54d16a){_0x54d16a=_0x54d16a||0x1f4;return function(_0x372348){logger[_0x3dab('0x26')](_0x372348[_0x3dab('0x3a')]);if(_0x372348['name']){delete _0x372348[_0x3dab('0x3b')];}_0x55cd6a[_0x3dab('0x2b')](_0x54d16a)[_0x3dab('0x3c')](_0x372348);};}exports[_0x3dab('0x3d')]=function(_0xc2e1f7,_0x5ce6dd){var _0x243d00={},_0x2e0ccd={},_0x307b9b={'count':0x0,'rows':[]};var _0x1eebb2=_[_0x3dab('0x3e')](db[_0x3dab('0x3f')][_0x3dab('0x40')],function(_0x4bba15){return{'name':_0x4bba15[_0x3dab('0x41')],'type':_0x4bba15[_0x3dab('0x42')][_0x3dab('0x43')]};});_0x2e0ccd['model']=_['map'](_0x1eebb2,_0x3dab('0x3b'));_0x2e0ccd[_0x3dab('0x44')]=_[_0x3dab('0x45')](_0xc2e1f7[_0x3dab('0x44')]);_0x2e0ccd['filters']=_[_0x3dab('0x46')](_0x2e0ccd[_0x3dab('0x47')],_0x2e0ccd[_0x3dab('0x44')]);_0x243d00[_0x3dab('0x48')]=_[_0x3dab('0x46')](_0x2e0ccd[_0x3dab('0x47')],qs['fields'](_0xc2e1f7[_0x3dab('0x44')]['fields']));_0x243d00['attributes']=_0x243d00[_0x3dab('0x48')]['length']?_0x243d00[_0x3dab('0x48')]:_0x2e0ccd[_0x3dab('0x47')];if(!_0xc2e1f7[_0x3dab('0x44')]['hasOwnProperty'](_0x3dab('0x49'))){_0x243d00[_0x3dab('0x2c')]=qs[_0x3dab('0x2c')](_0xc2e1f7[_0x3dab('0x44')][_0x3dab('0x2c')]);_0x243d00[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0xc2e1f7['query'][_0x3dab('0x2f')]);}_0x243d00['order']=qs[_0x3dab('0x4a')](_0xc2e1f7[_0x3dab('0x44')][_0x3dab('0x4a')]);_0x243d00['where']=qs[_0x3dab('0x4b')](_[_0x3dab('0x4c')](_0xc2e1f7['query'],_0x2e0ccd['filters']),_0x1eebb2);if(_0xc2e1f7[_0x3dab('0x44')][_0x3dab('0x4d')]){_0x243d00[_0x3dab('0x4e')]=_[_0x3dab('0x4f')](_0x243d00[_0x3dab('0x4e')],{'$or':_[_0x3dab('0x3e')](_0x1eebb2,function(_0x4743fd){if(_0x4743fd[_0x3dab('0x42')]!==_0x3dab('0x50')){var _0x5051f7={};_0x5051f7[_0x4743fd['name']]={'$like':'%'+_0xc2e1f7['query'][_0x3dab('0x4d')]+'%'};return _0x5051f7;}})});}_0x243d00=_[_0x3dab('0x4f')]({},_0x243d00,_0xc2e1f7['options']);var _0x38db5c={'where':_0x243d00[_0x3dab('0x4e')]};return db[_0x3dab('0x3f')][_0x3dab('0x2e')](_0x38db5c)[_0x3dab('0x36')](function(_0x3fe80f){_0x307b9b['count']=_0x3fe80f;if(_0xc2e1f7[_0x3dab('0x44')]['includeAll']){_0x243d00[_0x3dab('0x51')]=[{'all':!![]}];}return db[_0x3dab('0x3f')][_0x3dab('0x52')](_0x243d00);})[_0x3dab('0x36')](function(_0x5afba8){_0x307b9b[_0x3dab('0x53')]=_0x5afba8;return _0x307b9b;})[_0x3dab('0x36')](respondWithFilteredResult(_0x5ce6dd,_0x243d00))[_0x3dab('0x2a')](handleError(_0x5ce6dd,null));};exports[_0x3dab('0x54')]=function(_0x5b7425,_0x3f2cf1){var _0x1fa2c7={'raw':!![],'where':{'id':_0x5b7425[_0x3dab('0x55')]['id']}},_0x94d3de={};_0x94d3de[_0x3dab('0x47')]=_['keys'](db[_0x3dab('0x3f')]['rawAttributes']);_0x94d3de[_0x3dab('0x44')]=_[_0x3dab('0x45')](_0x5b7425[_0x3dab('0x44')]);_0x94d3de['filters']=_['intersection'](_0x94d3de[_0x3dab('0x47')],_0x94d3de[_0x3dab('0x44')]);_0x1fa2c7[_0x3dab('0x48')]=_[_0x3dab('0x46')](_0x94d3de['model'],qs[_0x3dab('0x56')](_0x5b7425[_0x3dab('0x44')][_0x3dab('0x56')]));_0x1fa2c7[_0x3dab('0x48')]=_0x1fa2c7['attributes']['length']?_0x1fa2c7['attributes']:_0x94d3de[_0x3dab('0x47')];if(_0x5b7425[_0x3dab('0x44')][_0x3dab('0x57')]){_0x1fa2c7[_0x3dab('0x51')]=[{'all':!![]}];}_0x1fa2c7=_[_0x3dab('0x4f')]({},_0x1fa2c7,_0x5b7425['options']);return db[_0x3dab('0x3f')][_0x3dab('0x58')](_0x1fa2c7)[_0x3dab('0x36')](handleEntityNotFound(_0x3f2cf1,null))[_0x3dab('0x36')](respondWithResult(_0x3f2cf1,null))[_0x3dab('0x2a')](handleError(_0x3f2cf1,null));};exports['create']=function(_0x565443,_0x593ab9){return db[_0x3dab('0x3f')][_0x3dab('0x59')](_0x565443[_0x3dab('0x5a')],{})['then'](respondWithResult(_0x593ab9,0xc9))[_0x3dab('0x2a')](handleError(_0x593ab9,null));};exports[_0x3dab('0x35')]=function(_0x54a31c,_0x297d5b){if(_0x54a31c[_0x3dab('0x5a')]['id']){delete _0x54a31c['body']['id'];}return db[_0x3dab('0x3f')]['find']({'where':{'id':_0x54a31c['params']['id']}})[_0x3dab('0x36')](handleEntityNotFound(_0x297d5b,null))['then'](saveUpdates(_0x54a31c[_0x3dab('0x5a')],null))[_0x3dab('0x36')](respondWithResult(_0x297d5b,null))[_0x3dab('0x2a')](handleError(_0x297d5b,null));};exports[_0x3dab('0x37')]=function(_0x27387c,_0x1d776f){return db[_0x3dab('0x3f')][_0x3dab('0x58')]({'where':{'id':_0x27387c['params']['id']}})[_0x3dab('0x36')](handleEntityNotFound(_0x1d776f,null))[_0x3dab('0x36')](removeEntity(_0x1d776f,null))[_0x3dab('0x2a')](handleError(_0x1d776f,null));};exports[_0x3dab('0x5b')]=function(_0x2d8760,_0x155af1){return db[_0x3dab('0x3f')][_0x3dab('0x5b')]()[_0x3dab('0x36')](respondWithResult(_0x155af1,null))[_0x3dab('0x2a')](handleError(_0x155af1,null));};var interaction_log=require(_0x3dab('0x15'))(_0x3dab('0x5c'));exports[_0x3dab('0x5d')]=function(_0x14fbf0,_0x180e93,_0x103014){var _0x3650fd={'agent':{},'channel':'sms'};if(_0x14fbf0[_0x3dab('0x5a')]['id']){delete _0x14fbf0[_0x3dab('0x5a')]['id'];}_0x14fbf0[_0x3dab('0x5a')]['read']=!![];_0x14fbf0['body'][_0x3dab('0x5e')]=moment()[_0x3dab('0x5f')](_0x3dab('0x60'));_0x14fbf0[_0x3dab('0x5a')][_0x3dab('0x61')]=_0x14fbf0[_0x3dab('0x5a')][_0x3dab('0x61')]||_0x14fbf0[_0x3dab('0x62')]['id'];_0x3650fd[_0x3dab('0x63')]['id']=_0x14fbf0[_0x3dab('0x5a')][_0x3dab('0x61')];return db[_0x3dab('0x3f')][_0x3dab('0x58')]({'where':{'id':_0x14fbf0[_0x3dab('0x55')]['id'],'UserId':null}})[_0x3dab('0x36')](handleEntityNotFound(_0x180e93,null))[_0x3dab('0x36')](saveUpdates(_0x14fbf0[_0x3dab('0x5a')],null))['then'](function(_0x4983c9){if(_0x4983c9){_0x3650fd[_0x3dab('0x29')]=_0x4983c9['get']({'plain':!![]});return db[_0x3dab('0x64')][_0x3dab('0x58')]({'where':{'id':_0x4983c9['SmsInteractionId']}});}return null;})[_0x3dab('0x36')](handleEntityNotFound(_0x180e93,null))[_0x3dab('0x36')](function(_0x459c13){if(_0x459c13){return _0x459c13['update']({'UserId':_0x14fbf0[_0x3dab('0x5a')][_0x3dab('0x61')],'read1stAt':_['isNil'](_0x459c13[_0x3dab('0x65')])?moment()[_0x3dab('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3dab('0x36')](function(_0x184cce){if(_0x184cce){_0x3650fd[_0x3dab('0x66')]=_0x184cce['get']({'plain':!![]});interaction_log['info'](_0x3dab('0x67'),_0x14fbf0[_0x3dab('0x62')]['id'],_0x14fbf0[_0x3dab('0x62')][_0x3dab('0x3b')],_0x14fbf0[_0x3dab('0x62')][_0x3dab('0x68')],_0x3650fd[_0x3dab('0x66')]['id'],_0x14fbf0[_0x3dab('0x5a')]?JSON['stringify'](_0x14fbf0['body']):'null');return respondWithRpcPromise(_0x3dab('0x69'),'acceptMessage',_0x3650fd);}return null;})['then'](function(_0x163ce3){var _0x277f27=_0x3dab('0x6a')+_0x163ce3[_0x3dab('0x29')][_0x3dab('0x6b')];return db[_0x3dab('0x6c')][_0x3dab('0x44')](_0x277f27,{'type':db[_0x3dab('0x6d')][_0x3dab('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x41c705){return _0x41c705;});})[_0x3dab('0x36')](function(_0x43d796){if(_0x43d796){_0x3650fd[_0x3dab('0x29')][_0x3dab('0x6f')]=_0x43d796[0x0];if(!_0x14fbf0[_0x3dab('0x5a')][_0x3dab('0x61')])return;return db[_0x3dab('0x70')][_0x3dab('0x58')]({'where':{'id':_0x14fbf0[_0x3dab('0x5a')][_0x3dab('0x61')],'role':_0x3dab('0x63')},'attributes':['id',_0x3dab('0x3b'),'fullname',_0x3dab('0x71'),_0x3dab('0x72')],'raw':!![]});}return null;})['then'](function(_0x153605){if(!_0x153605)return null;_0x3650fd[_0x3dab('0x29')]['agent']=_0x153605;return _0x3650fd;})['then'](function(_0x2bc7b8){if(_0x2bc7b8){if(_0x14fbf0['body'][_0x3dab('0x73')]){_0x3650fd[_0x3dab('0x29')]['interface']=util[_0x3dab('0x5f')](_0x3dab('0x74'),_0x14fbf0['user']['name']);_0x3650fd[_0x3dab('0x29')][_0x3dab('0x75')]=_0x3650fd[_0x3dab('0x75')];_0x3650fd[_0x3dab('0x29')]['motionChannel']=_0x3650fd[_0x3dab('0x75')];_0x3650fd[_0x3dab('0x29')]['event']='accept';return respondWithRpcPromise(_0x3dab('0x76'),_0x3dab('0x76'),{'event':_0x3dab('0x77'),'message':_0x3650fd[_0x3dab('0x29')]},client9002)[_0x3dab('0x36')](function(){return _0x3650fd;});}return _0x3650fd;}return null;})[_0x3dab('0x36')](respondWithResult(_0x180e93,null))[_0x3dab('0x2a')](handleError(_0x180e93,null));};var interaction_log=require(_0x3dab('0x15'))(_0x3dab('0x5c'));exports[_0x3dab('0x34')]=function(_0x1b380b,_0x59d35d,_0x46e0da){var _0x4c6c06={'agent':{},'channel':_0x3dab('0x78')};if(_0x1b380b[_0x3dab('0x5a')]['id']){delete _0x1b380b[_0x3dab('0x5a')]['id'];}_0x1b380b['body']['UserId']=_0x1b380b[_0x3dab('0x5a')][_0x3dab('0x61')]||_0x1b380b[_0x3dab('0x62')]['id'];_0x4c6c06['agent']['id']=_0x1b380b[_0x3dab('0x5a')][_0x3dab('0x61')];return db[_0x3dab('0x3f')][_0x3dab('0x58')]({'where':{'id':_0x1b380b[_0x3dab('0x55')]['id'],'UserId':null}})[_0x3dab('0x36')](handleEntityNotFound(_0x59d35d,null))[_0x3dab('0x36')](function(_0x64f908){if(_0x64f908){_0x4c6c06['message']=_0x64f908['get']({'plain':!![]});return db[_0x3dab('0x64')]['find']({'where':{'id':_0x64f908[_0x3dab('0x79')]}});}return null;})['then'](handleEntityNotFound(_0x59d35d,null))[_0x3dab('0x36')](function(_0x52f38e){if(_0x52f38e){_0x4c6c06[_0x3dab('0x66')]=_0x52f38e[_0x3dab('0x7a')]({'plain':!![]});interaction_log[_0x3dab('0x22')](_0x3dab('0x7b'),_0x1b380b[_0x3dab('0x62')]['id'],_0x1b380b['user'][_0x3dab('0x3b')],_0x1b380b[_0x3dab('0x62')]['role'],_0x4c6c06['interaction']['id'],_0x1b380b[_0x3dab('0x5a')]?JSON['stringify'](_0x1b380b[_0x3dab('0x5a')]):_0x3dab('0x7c'));return respondWithRpcPromise(_0x3dab('0x7d'),_0x3dab('0x7e'),_0x4c6c06);}return null;})[_0x3dab('0x36')](function(_0x2854d2){var _0x24c8c6=_0x3dab('0x6a')+_0x2854d2[_0x3dab('0x29')]['ContactId'];return db['sequelize'][_0x3dab('0x44')](_0x24c8c6,{'type':db[_0x3dab('0x6d')][_0x3dab('0x6e')][_0x3dab('0x7f')],'raw':!![]})[_0x3dab('0x36')](function(_0x56646a){return _0x56646a;});})['then'](function(_0x14a78a){if(_0x14a78a){_0x4c6c06['message'][_0x3dab('0x6f')]=_0x14a78a[0x0];if(!_0x1b380b['body'][_0x3dab('0x61')])return;return db[_0x3dab('0x70')][_0x3dab('0x58')]({'where':{'id':_0x1b380b['body'][_0x3dab('0x61')],'role':_0x3dab('0x63')},'attributes':['id',_0x3dab('0x3b'),_0x3dab('0x80'),'email',_0x3dab('0x72')],'raw':!![]});}return null;})[_0x3dab('0x36')](function(_0x5be801){if(!_0x5be801)return null;_0x4c6c06[_0x3dab('0x29')][_0x3dab('0x63')]=_0x5be801;return _0x4c6c06;})[_0x3dab('0x36')](function(_0x3422dc){if(_0x3422dc){_0x3422dc[_0x3dab('0x29')][_0x3dab('0x81')]=util['format'](_0x3dab('0x74'),_0x1b380b[_0x3dab('0x62')][_0x3dab('0x3b')]);_0x3422dc[_0x3dab('0x29')][_0x3dab('0x75')]=_0x4c6c06['channel'];_0x3422dc[_0x3dab('0x29')][_0x3dab('0x82')]=_0x4c6c06[_0x3dab('0x75')];_0x3422dc[_0x3dab('0x29')][_0x3dab('0x83')]='reject';respondWithRpcPromise(_0x3dab('0x76'),'EventManager',{'event':_0x3dab('0x84'),'message':_0x3422dc['message']},client9002);return _0x4c6c06;}return null;})[_0x3dab('0x36')](respondWithResult(_0x59d35d,null))['catch'](handleError(_0x59d35d,null));};exports[_0x3dab('0x2b')]=function(_0x4ad625,_0x537885,_0x89d08f){if(_0x4ad625[_0x3dab('0x5a')]['id']){delete _0x4ad625[_0x3dab('0x5a')]['id'];}var _0x101eb3;return db[_0x3dab('0x3f')]['find']({'where':{'id':_0x4ad625['params']['id']}})[_0x3dab('0x36')](handleEntityNotFound(_0x537885,null))[_0x3dab('0x36')](function(_0xfa662){if(_0xfa662){_0x101eb3=_0xfa662;return db[_0x3dab('0x85')][_0x3dab('0x58')]({'where':{'id':_0xfa662[_0x3dab('0x86')]}});}})[_0x3dab('0x36')](handleEntityNotFound(_0x537885,null))[_0x3dab('0x36')](function(_0x13fc0d){if(_0x13fc0d){logger[_0x3dab('0x24')](_0x3dab('0x25'),_0x3dab('0x2b'),_0x3dab('0x87'),_0x13fc0d['type'],util[_0x3dab('0x88')](_0x4ad625[_0x3dab('0x5a')],{'showHidden':![],'depth':null}));switch(_0x13fc0d[_0x3dab('0x42')]){case'twilio':if(_0x4ad625[_0x3dab('0x5a')]['MessageSid']&&_0x4ad625[_0x3dab('0x5a')][_0x3dab('0x89')]===_0x101eb3['messageId']){return _0x101eb3[_0x3dab('0x35')]({'read':!![]});}else{logger[_0x3dab('0x26')](_0x3dab('0x8a'),_0x3dab('0x2b'),_0x3dab('0x8b'),util[_0x3dab('0x88')](_0x4ad625['body'],{'showHidden':![],'depth':null}));}break;case _0x3dab('0x8c'):if(_0x4ad625['body'][_0x3dab('0x8d')]&&_0x4ad625[_0x3dab('0x5a')][_0x3dab('0x8d')]===_0x101eb3[_0x3dab('0x8e')]&&_[_0x3dab('0x8f')]([_0x3dab('0x90'),'delivered'],_0x4ad625[_0x3dab('0x5a')][_0x3dab('0x91')])>=0x0){return _0x101eb3[_0x3dab('0x35')]({'read':!![]});}else{logger[_0x3dab('0x26')](_0x3dab('0x8a'),_0x3dab('0x2b'),_0x3dab('0x92'),util[_0x3dab('0x88')](_0x4ad625[_0x3dab('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x3dab('0x93'):var _0x165650=_0x4ad625[_0x3dab('0x5a')][_0x3dab('0x94')][0x0];if(_0x165650[_0x3dab('0x2b')][_0x3dab('0x95')]===_0x3dab('0x96')){return _0x101eb3[_0x3dab('0x35')]({'read':!![]});}else{logger['error'](_0x3dab('0x8a'),'status',_0x3dab('0x93'),util['inspect'](_0x4ad625['body'],{'showHidden':![],'depth':null}));}break;}return _0x101eb3;}})[_0x3dab('0x36')](respondWithResult(_0x537885,null))[_0x3dab('0x2a')](handleError(_0x537885,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 14ea762..ac8392f 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 _0x8607=['events','../../mysqldb','SmsMessage','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8607,0x117));var _0x7860=function(_0x13d14d,_0x281eeb){_0x13d14d=_0x13d14d-0x0;var _0xf7f87e=_0x8607[_0x13d14d];return _0xf7f87e;};'use strict';var EventEmitter=require(_0x7860('0x0'));var SmsMessage=require(_0x7860('0x1'))['db'][_0x7860('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7860('0x3'),'afterDestroy':_0x7860('0x4')};function emitEvent(_0x271ffc){return function(_0x312025,_0x160309,_0x334e8c){SmsMessageEvents[_0x7860('0x5')](_0x271ffc+':'+_0x312025['id'],_0x312025);SmsMessageEvents[_0x7860('0x5')](_0x271ffc,_0x312025);_0x334e8c(null);};}for(var e in events){if(events[_0x7860('0x6')](e)){var event=events[e];SmsMessage[_0x7860('0x7')](e,emitEvent(event));}}module[_0x7860('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x9cce=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x1c67ba,_0x3a95cf){var _0x3b139a=function(_0x2cbb5d){while(--_0x2cbb5d){_0x1c67ba['push'](_0x1c67ba['shift']());}};_0x3b139a(++_0x3a95cf);}(_0x9cce,0x65));var _0xe9cc=function(_0x21fd99,_0x572eb7){_0x21fd99=_0x21fd99-0x0;var _0x5c553b=_0x9cce[_0x21fd99];return _0x5c553b;};'use strict';var EventEmitter=require(_0xe9cc('0x0'));var SmsMessage=require(_0xe9cc('0x1'))['db'][_0xe9cc('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9cc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50c606){return function(_0x485b5b,_0x2831cc,_0xade9d8){SmsMessageEvents[_0xe9cc('0x4')](_0x50c606+':'+_0x485b5b['id'],_0x485b5b);SmsMessageEvents[_0xe9cc('0x4')](_0x50c606,_0x485b5b);_0xade9d8(null);};}for(var e in events){if(events[_0xe9cc('0x5')](e)){var event=events[e];SmsMessage[_0xe9cc('0x6')](e,emitEvent(event));}}module[_0xe9cc('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 f8355e5..f4370e8 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 _0xb761=['remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','user_key','session_key','total_sent','read','Missing\x20parameters:\x20username,\x20password','senderString','POST','https://smsapi.connectel.se/api/v2/send/','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','%s:%s','format','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','csc','apiKey','login','sender','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','Token\x20not\x20received','finally','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','phone'];(function(_0x145559,_0x5e6d32){var _0x3e0fed=function(_0xbc9b14){while(--_0xbc9b14){_0x145559['push'](_0x145559['shift']());}};_0x3e0fed(++_0x5e6d32);}(_0xb761,0xc7));var _0x1b76=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0xb761[_0x57db49];return _0xd0636f;};'use strict';var _=require(_0x1b76('0x0'));var util=require(_0x1b76('0x1'));var logger=require(_0x1b76('0x2'))('api');var moment=require(_0x1b76('0x3'));var BPromise=require(_0x1b76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b76('0x5'));var rimraf=require(_0x1b76('0x6'));var config=require('../../config/environment');var attributes=require(_0x1b76('0x7'));module[_0x1b76('0x8')]=function(_0x47b92d,_0x694757){return _0x47b92d[_0x1b76('0x9')]('SmsMessage',attributes,{'tableName':_0x1b76('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x1b76('0xb'),'fields':[_0x1b76('0xc')],'type':_0x1b76('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15cc20,_0x1e708a,_0x418dcc){var _0x1d3ac4=_0x47b92d[_0x1b76('0xe')];var _0x262c77=_0x15cc20['get']({'plain':!![]});if(_0x262c77[_0x1b76('0xf')][_0x1b76('0x10')]()==='in'||_0x262c77[_0x1b76('0xf')][_0x1b76('0x10')]()===_0x1b76('0x11')&&!_0x262c77[_0x1b76('0x12')]&&!_[_0x1b76('0x13')](_0x262c77[_0x1b76('0x14')])&&!_[_0x1b76('0x13')](_0x262c77[_0x1b76('0x15')])){_0x1d3ac4[_0x1b76('0x16')][_0x1b76('0x17')]({'where':{'id':_0x262c77[_0x1b76('0x15')]}})[_0x1b76('0x18')](function(_0x4bd1a4){if(_0x4bd1a4){_0x4bd1a4[_0x1b76('0x19')]({'lastMsgAt':_0x262c77['createdAt'],'lastMsgDirection':_0x262c77[_0x1b76('0xf')][_0x1b76('0x10')]()});}})[_0x1b76('0x1a')](function(_0x1fe034){console[_0x1b76('0x1b')](_0x1fe034);});}if(_0x262c77[_0x1b76('0xf')]===_0x1b76('0x11')&&!_0x262c77[_0x1b76('0x12')]){var _0x11b12a;_0x1d3ac4[_0x1b76('0x1c')][_0x1b76('0x1d')]({'where':{'id':_0x262c77[_0x1b76('0x1e')]},'raw':!![]})['then'](function(_0x557a08){_0x11b12a=_0x557a08;if(_0x11b12a&&_0x11b12a['type']){switch(_0x11b12a[_0x1b76('0x1f')]){case _0x1b76('0x20'):var _0x49d594=require(_0x1b76('0x20'));if(_0x11b12a[_0x1b76('0x21')]&&_0x11b12a[_0x1b76('0x22')]&&_0x11b12a['phone']){var _0x31c148=new _0x49d594(_0x11b12a['accountSid'],_0x11b12a[_0x1b76('0x22')]);_0x31c148[_0x1b76('0x23')]['create']({'body':_0x262c77['body'],'to':_0x262c77[_0x1b76('0x24')],'from':_0x11b12a[_0x1b76('0x24')],'statusCallback':_0x11b12a[_0x1b76('0x25')]+'/api/sms/messages/'+_0x262c77['id']+_0x1b76('0x26')+_0x11b12a[_0x1b76('0x27')]})[_0x1b76('0x18')](function(_0x3a9412){if(_0x3a9412[_0x1b76('0x28')]){return _0x15cc20[_0x1b76('0x19')]({'messageId':_0x3a9412['sid']});}})[_0x1b76('0x1a')](function(_0x45391f){logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x20'),util[_0x1b76('0x2b')](_0x45391f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x20'),_0x1b76('0x2c'));}break;case'skebby':var _0x188206=_0x1b76('0x2d');if(_0x11b12a[_0x1b76('0x2e')]&&_0x11b12a[_0x1b76('0x2f')]){var _0x22180a={'recipient':[_0x262c77['phone']],'message':_0x262c77[_0x1b76('0xc')],'message_type':_0x11b12a[_0x1b76('0x30')]};if(_0x11b12a[_0x1b76('0x30')]&&_0x11b12a['smsMethod']!=='SI'){_0x22180a['sender']=_0x11b12a[_0x1b76('0x24')];}var _0x2e8dc0={'url':_0x188206+_0x1b76('0x31')+_0x11b12a[_0x1b76('0x2e')]+_0x1b76('0x32')+_0x11b12a[_0x1b76('0x2f')],'method':_0x1b76('0x33')};rp(_0x2e8dc0)[_0x1b76('0x18')](function(_0x68ec39){var _0x480fa4=_0x68ec39['split'](';');var _0x9ed6d8={'user_key':_0x480fa4[0x0],'session_key':_0x480fa4[0x1]};_0x2e8dc0={'url':_0x188206+'sms','method':'POST','headers':{'user_key':_0x9ed6d8[_0x1b76('0x34')],'Session_key':_0x9ed6d8[_0x1b76('0x35')]},'json':!![],'body':_0x22180a};return rp(_0x2e8dc0);})['then'](function(_0x56641a){if(_0x56641a[_0x1b76('0x36')]>=0x1){var _0x5b66cc={'messageId':_0x56641a['internal_order_id']};if(_0x11b12a[_0x1b76('0x30')]!=='GP'||!_0x11b12a['deliveryReport']){_0x5b66cc[_0x1b76('0x37')]=!![];}return _0x15cc20['update'](_0x5b66cc);}else{return logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),'skebby',util[_0x1b76('0x2b')](_0x56641a,{'showHidden':![],'depth':null}));}})[_0x1b76('0x1a')](function(_0x416a5c){return logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),'skebby',util[_0x1b76('0x2b')](_0x416a5c,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),'skebby',_0x1b76('0x38'));}break;case'connectel':if(_0x11b12a[_0x1b76('0x22')]){var _0x1a72d4={'recipient':_0x262c77[_0x1b76('0x24')],'message':_0x262c77['body'],'sender':_0x11b12a[_0x1b76('0x39')]||_0x11b12a[_0x1b76('0x24')],'authorization':_0x11b12a[_0x1b76('0x22')]};var _0x1e708a={'method':_0x1b76('0x3a'),'uri':_0x1b76('0x3b'),'body':_0x1a72d4,'json':!![]};rp(_0x1e708a)[_0x1b76('0x18')](function(_0x567806){var _0x3bffb4={'messageId':_0x567806['requestid']};if(!_0x11b12a[_0x1b76('0x3c')]){_0x3bffb4['read']=!![];}return _0x15cc20[_0x1b76('0x19')](_0x3bffb4);})[_0x1b76('0x1a')](function(_0x571a9f){logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),'connectel',util['inspect'](_0x571a9f,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x3d'),_0x1b76('0x3e'));}break;case _0x1b76('0x3f'):if(_0x11b12a['username']&&_0x11b12a[_0x1b76('0x2f')]){var _0x1a72d4={'messages':[{'source':'xCALLY\x20Motion','to':_0x262c77['phone'],'body':_0x262c77['body'],'from':_0x11b12a['senderString']||_0x11b12a[_0x1b76('0x24')]}]};var _0x39778d=util['format'](_0x1b76('0x40'),_0x11b12a[_0x1b76('0x2e')],_0x11b12a[_0x1b76('0x2f')]);var _0x1e708a={'method':_0x1b76('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1a72d4,'headers':{'Authorization':util[_0x1b76('0x41')](_0x1b76('0x42'),new Buffer(_0x39778d)[_0x1b76('0x43')](_0x1b76('0x44')))},'json':!![]};rp(_0x1e708a)[_0x1b76('0x18')](function(_0x375724){if(_0x375724[_0x1b76('0x45')]>=0xc8&&_0x375724[_0x1b76('0x45')]<=0xce){if(_0x375724[_0x1b76('0x46')]&&_0x375724[_0x1b76('0x46')][_0x1b76('0x47')]>0x0){var _0x5525d4=_['head'](_0x375724[_0x1b76('0x46')]['messages']);var _0x3cbd8a={'messageId':_0x5525d4[_0x1b76('0x48')]};if(!_0x11b12a[_0x1b76('0x3c')]){_0x3cbd8a[_0x1b76('0x37')]=!![];}return _0x15cc20[_0x1b76('0x19')](_0x3cbd8a);}else{logger['error'](_0x1b76('0x29'),_0x1b76('0x2a'),'clickSend',util[_0x1b76('0x2b')](_0x375724,{'showHidden':![],'depth':null}));}}else{logger[_0x1b76('0x1b')](_0x1b76('0x29'),'afterCreate',_0x1b76('0x49'),util[_0x1b76('0x2b')](_0x375724,{'showHidden':![],'depth':null}));}})[_0x1b76('0x1a')](function(_0x5d1265){logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x49'),util[_0x1b76('0x2b')](_0x5d1265,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),'clickSend',_0x1b76('0x38'));}break;case _0x1b76('0x4a'):if(_0x11b12a[_0x1b76('0x4b')]&&_0x11b12a[_0x1b76('0x22')]){var _0x1a72d4={'dst':_0x262c77['phone'],'text':_0x262c77[_0x1b76('0xc')],'src':_0x11b12a[_0x1b76('0x39')]||_0x11b12a['phone'],'url':_0x11b12a[_0x1b76('0x25')]+_0x1b76('0x4c')+_0x262c77['id']+'/status?token='+_0x11b12a[_0x1b76('0x27')]};var _0x39778d=util[_0x1b76('0x41')](_0x1b76('0x40'),_0x11b12a[_0x1b76('0x4b')],_0x11b12a[_0x1b76('0x22')]);var _0x1e708a={'method':_0x1b76('0x3a'),'uri':util['format'](_0x1b76('0x4d'),_0x11b12a['authId']),'body':_0x1a72d4,'headers':{'Authorization':util[_0x1b76('0x41')](_0x1b76('0x42'),new Buffer(_0x39778d)[_0x1b76('0x43')](_0x1b76('0x44')))},'json':!![]};rp(_0x1e708a)[_0x1b76('0x18')](function(_0x28bef0){var _0x5a72d5={'messageId':_0x28bef0[_0x1b76('0x4e')][0x0]};return _0x15cc20[_0x1b76('0x19')](_0x5a72d5);})[_0x1b76('0x1a')](function(_0x368fd7){logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x4a'),util[_0x1b76('0x2b')](_0x368fd7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x4a'),_0x1b76('0x4f'));}break;case'infobip':if(_0x11b12a['username']&&_0x11b12a[_0x1b76('0x2f')]){if(_0x11b12a[_0x1b76('0x50')]){var _0x55092a={'method':_0x1b76('0x3a'),'uri':_0x11b12a[_0x1b76('0x50')]+_0x1b76('0x51'),'body':{'username':_0x11b12a[_0x1b76('0x2e')],'password':_0x11b12a[_0x1b76('0x2f')]},'json':!![]};return rp(_0x55092a)['then'](function(_0x21d4e6){var _0x1b7640={'method':_0x1b76('0x3a'),'uri':_0x11b12a[_0x1b76('0x50')]+_0x1b76('0x52'),'body':{'messages':[{'from':_0x11b12a['phone'],'destinations':[{'to':_0x262c77['phone']}],'text':_0x262c77['body'],'notifyUrl':_0x11b12a[_0x1b76('0x25')]+_0x1b76('0x4c')+_0x262c77['id']+'/status?token='+_0x11b12a['token'],'notifyContentType':_0x1b76('0x53'),'callbackData':_0x11b12a[_0x1b76('0x24')]+';'+_0x262c77['body']}]},'headers':{'Authorization':_0x1b76('0x54')+_0x21d4e6[_0x1b76('0x27')]},'json':!![]};return rp(_0x1b7640)[_0x1b76('0x18')](function(_0x11bf75){if(_0x11bf75['messages']){var _0x154f47={'messageId':_0x11bf75[_0x1b76('0x23')][0x0]['messageId']};if(!_0x11b12a['deliveryReport']){_0x154f47[_0x1b76('0x37')]=!![];}return _0x15cc20[_0x1b76('0x19')](_0x154f47);}else{return logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x55'),util[_0x1b76('0x2b')](_0x11bf75,{'showHidden':![],'depth':null}));}});})[_0x1b76('0x1a')](function(_0x529153){return logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),_0x1b76('0x55'),util[_0x1b76('0x2b')](_0x529153,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),_0x1b76('0x55'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),_0x1b76('0x55'),_0x1b76('0x38'));}break;case _0x1b76('0x56'):var _0x385ca9=require('crypto');if(_0x11b12a[_0x1b76('0x57')]){var _0x204fbc={};_0x204fbc[_0x1b76('0x58')]=_0x11b12a[_0x1b76('0x2e')];_0x204fbc['phone']=_0x262c77[_0x1b76('0x24')];_0x204fbc[_0x1b76('0x59')]=_0x11b12a[_0x1b76('0x24')];_0x204fbc[_0x1b76('0x5a')]=_0x262c77['body'];_0x204fbc[_0x1b76('0x5b')]=+new Date();var _0x5ec156='';var _0xf93ecb='';var _0x526573=Object[_0x1b76('0x5c')](_0x204fbc);_0x526573[_0x1b76('0x5d')]();for(var _0x3b5069=0x0;_0x3b5069<_0x526573[_0x1b76('0x5e')];_0x3b5069++){if(_0x5ec156!=''){_0x5ec156+='&';}_0x5ec156+=_0x526573[_0x3b5069]+'='+encodeURIComponent(_0x204fbc[_0x526573[_0x3b5069]]);_0xf93ecb+=_0x204fbc[_0x526573[_0x3b5069]];}_0xf93ecb+=_0x11b12a[_0x1b76('0x57')];_0xf93ecb=_0x385ca9[_0x1b76('0x5f')](_0x1b76('0x60'))['update'](_0xf93ecb)[_0x1b76('0x61')]('hex');if(_0x5ec156!==''){_0x5ec156+='&';}_0x5ec156+=_0x1b76('0x62')+_0xf93ecb;var _0x2e8dc0={'method':_0x1b76('0x33'),'uri':_0x11b12a[_0x1b76('0x50')]+'/external/get/send.php?'+_0x5ec156,'json':!![]};return rp(_0x2e8dc0)[_0x1b76('0x18')](function(_0x3ba170){var _0x1d89a4=Object[_0x1b76('0x5c')](_0x3ba170);if(_0x3ba170[_0x1d89a4[0x0]][_0x1b76('0x1b')]&&parseInt(_0x3ba170[_0x1d89a4[0x0]][_0x1b76('0x1b')])===0x0){var _0xe3f5e9={'messageId':_0x3ba170[_0x1d89a4[0x0]]['id_sms']};if(!_0x11b12a[_0x1b76('0x3c')]){_0xe3f5e9[_0x1b76('0x37')]=!![];}return _0x15cc20['update'](_0xe3f5e9);}else{return logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),'csc',util[_0x1b76('0x2b')](_0x3ba170[_0x1b76('0x1b')],{'showHidden':![],'depth':null}));}})[_0x1b76('0x1a')](function(_0x273cd1){return logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),'csc',util[_0x1b76('0x2b')](_0x273cd1,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x56'),_0x1b76('0x63'));}break;case _0x1b76('0x64'):if(_0x11b12a[_0x1b76('0x57')]){var _0x9f8ba8={'method':_0x1b76('0x3a'),'uri':_0x1b76('0x65'),'headers':{'Authorization':_0x11b12a[_0x1b76('0x57')]},'body':{'content':_0x262c77['body'],'to':[_0x262c77[_0x1b76('0x24')]],'from':_0x11b12a[_0x1b76('0x24')],'binary':![],'clientMessageId':_0x1b76('0x66'),'charset':_0x1b76('0x67')},'json':!![]};rp(_0x9f8ba8)[_0x1b76('0x18')](function(_0x439abe){if(!_0x439abe[_0x1b76('0x1b')]){var _0x94b737={'messageId':_0x439abe[_0x1b76('0x23')][0x0][_0x1b76('0x68')]};if(!_0x11b12a[_0x1b76('0x3c')]){_0x94b737[_0x1b76('0x37')]=!![];}return _0x15cc20[_0x1b76('0x19')](_0x94b737);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b76('0x2a'),_0x1b76('0x64'),util['inspect'](_0x439abe[_0x1b76('0x1b')],{'showHidden':![],'depth':null}));}})[_0x1b76('0x1a')](function(_0x2ad896){return logger[_0x1b76('0x1b')](_0x1b76('0x29'),'afterCreate',_0x1b76('0x64'),util['inspect'](_0x2ad896,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1b76('0x64'),_0x1b76('0x63'));}break;case _0x1b76('0x69'):if(_0x11b12a['username']&&_0x11b12a[_0x1b76('0x2f')]){var _0x39778d=util[_0x1b76('0x41')](_0x1b76('0x40'),_0x11b12a[_0x1b76('0x2e')],_0x11b12a[_0x1b76('0x2f')]);var _0x1e708a={'method':_0x1b76('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x11b12a[_0x1b76('0x6a')]+_0x1b76('0x6b'),'body':{'to':[_0x262c77[_0x1b76('0x24')]],'text':_0x262c77[_0x1b76('0xc')],'from':_0x11b12a[_0x1b76('0x24')],'applicationId':_0x11b12a[_0x1b76('0x6c')]},'headers':{'Authorization':util[_0x1b76('0x41')](_0x1b76('0x42'),new Buffer(_0x39778d)[_0x1b76('0x43')](_0x1b76('0x44')))},'json':!![]};rp(_0x1e708a)[_0x1b76('0x18')](function(_0x6e338f){if(_0x6e338f['id']){var _0xca959e={'messageId':_0x6e338f['id']};return _0x15cc20[_0x1b76('0x19')](_0xca959e);}else{logger['error'](_0x1b76('0x29'),'afterCreate',_0x1b76('0x69'),util['inspect'](_0x6e338f,{'showHidden':![],'depth':null}));}})[_0x1b76('0x1a')](function(_0x197977){logger['error'](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x69'),util[_0x1b76('0x2b')](_0x197977,{'showHidden':![],'depth':null}));});}else{logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x69'),_0x1b76('0x38'));}break;case _0x1b76('0x6d'):if(_0x11b12a[_0x1b76('0x57')]){var _0x41c3ab={};var _0x2e8dc0={'method':'POST','uri':_0x1b76('0x6e'),'headers':{'Authorization':_0x1b76('0x6f')+_0x11b12a[_0x1b76('0x57')],'Content-Type':_0x1b76('0x53')},'body':{'from':_0x11b12a[_0x1b76('0x24')],'to':_0x262c77[_0x1b76('0x24')],'text':_0x262c77[_0x1b76('0xc')]},'json':!![]};return rp(_0x2e8dc0)[_0x1b76('0x18')](function(_0x4c346f){if(_0x4c346f[_0x1b76('0x70')]==0xca){_0x41c3ab[_0x1b76('0x71')]=_0x4c346f;var _0x2155ea={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x1b76('0x6f')+_0x11b12a[_0x1b76('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x41c3ab[_0x1b76('0x71')]['refid']},'json':!![]};return rp(_0x2155ea)[_0x1b76('0x18')](function(_0x3da623){_0x41c3ab[_0x1b76('0x72')]=_0x3da623;var _0x46a071={'messageId':_0x41c3ab[_0x1b76('0x71')][_0x1b76('0x73')],'read':!![]};return _0x15cc20[_0x1b76('0x19')](_0x46a071);});}else{return logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x6d'),util[_0x1b76('0x2b')](_0x4c346f,{'showHidden':![],'depth':null}));}})[_0x1b76('0x1a')](function(_0x1d706a){return logger[_0x1b76('0x1b')](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x6d'),util[_0x1b76('0x2b')](_0x1d706a,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x1b76('0x29'),_0x1b76('0x2a'),_0x1b76('0x6d'),_0x1b76('0x74'));}break;}}})[_0x1b76('0x75')](function(){_0x418dcc();});}else{_0x418dcc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x96d5=['https://messaging.bandwidth.com/api/v2/users/','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','update','createdAt','error','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','sort','length','digest','hex','signature=','keys','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey'];(function(_0x1e58c8,_0x29bf55){var _0x4cdc58=function(_0x1279ec){while(--_0x1279ec){_0x1e58c8['push'](_0x1e58c8['shift']());}};_0x4cdc58(++_0x29bf55);}(_0x96d5,0xfc));var _0x596d=function(_0x4c0b23,_0x474c1c){_0x4c0b23=_0x4c0b23-0x0;var _0x3a06f0=_0x96d5[_0x4c0b23];return _0x3a06f0;};'use strict';var _=require(_0x596d('0x0'));var util=require(_0x596d('0x1'));var logger=require(_0x596d('0x2'))(_0x596d('0x3'));var moment=require(_0x596d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x596d('0x5'));var config=require(_0x596d('0x6'));var attributes=require(_0x596d('0x7'));module[_0x596d('0x8')]=function(_0x17a882,_0x4f1b94){return _0x17a882[_0x596d('0x9')](_0x596d('0xa'),attributes,{'tableName':_0x596d('0xb'),'paranoid':![],'indexes':[{'name':_0x596d('0xc'),'fields':[_0x596d('0xc')]},{'name':'fti_sms_messages','fields':[_0x596d('0xd')],'type':_0x596d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd076e5,_0x5ed43c,_0x184a1d){var _0x49b202=_0x17a882[_0x596d('0xf')];var _0x113797=_0xd076e5[_0x596d('0x10')]({'plain':!![]});if(_0x113797[_0x596d('0x11')][_0x596d('0x12')]()==='in'||_0x113797['direction'][_0x596d('0x12')]()===_0x596d('0x13')&&!_0x113797[_0x596d('0x14')]&&!_[_0x596d('0x15')](_0x113797['UserId'])&&!_[_0x596d('0x15')](_0x113797[_0x596d('0x16')])){_0x49b202[_0x596d('0x17')][_0x596d('0x18')]({'where':{'id':_0x113797[_0x596d('0x16')]}})['then'](function(_0x1517ce){if(_0x1517ce){_0x1517ce[_0x596d('0x19')]({'lastMsgAt':_0x113797[_0x596d('0x1a')],'lastMsgDirection':_0x113797[_0x596d('0x11')]['toLowerCase']()});}})['catch'](function(_0x54c6be){console[_0x596d('0x1b')](_0x54c6be);});}if(_0x113797[_0x596d('0x11')]===_0x596d('0x13')&&!_0x113797[_0x596d('0x14')]){var _0x48571c;_0x49b202['SmsAccount'][_0x596d('0x1c')]({'where':{'id':_0x113797[_0x596d('0x1d')]},'raw':!![]})[_0x596d('0x1e')](function(_0xa807fe){_0x48571c=_0xa807fe;if(_0x48571c&&_0x48571c['type']){switch(_0x48571c[_0x596d('0x1f')]){case _0x596d('0x20'):var _0x549e58=require('twilio');if(_0x48571c[_0x596d('0x21')]&&_0x48571c[_0x596d('0x22')]&&_0x48571c[_0x596d('0x23')]){var _0x5e7578=new _0x549e58(_0x48571c['accountSid'],_0x48571c[_0x596d('0x22')]);_0x5e7578[_0x596d('0x24')]['create']({'body':_0x113797['body'],'to':_0x113797[_0x596d('0x23')],'from':_0x48571c[_0x596d('0x23')],'statusCallback':_0x48571c[_0x596d('0x25')]+_0x596d('0x26')+_0x113797['id']+_0x596d('0x27')+_0x48571c['token']})[_0x596d('0x1e')](function(_0xc98568){if(_0xc98568[_0x596d('0x28')]){return _0xd076e5[_0x596d('0x19')]({'messageId':_0xc98568[_0x596d('0x28')]});}})[_0x596d('0x29')](function(_0x3b83c0){logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x20'),util['inspect'](_0x3b83c0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x596d('0x2c'):var _0x43ce71=_0x596d('0x2d');if(_0x48571c[_0x596d('0x2e')]&&_0x48571c[_0x596d('0x2f')]){var _0x40defc={'recipient':[_0x113797[_0x596d('0x23')]],'message':_0x113797[_0x596d('0xd')],'message_type':_0x48571c[_0x596d('0x30')]};if(_0x48571c['smsMethod']&&_0x48571c[_0x596d('0x30')]!=='SI'){_0x40defc[_0x596d('0x31')]=_0x48571c[_0x596d('0x23')];}var _0x1ce97a={'url':_0x43ce71+_0x596d('0x32')+_0x48571c['username']+_0x596d('0x33')+_0x48571c['password'],'method':_0x596d('0x34')};rp(_0x1ce97a)[_0x596d('0x1e')](function(_0x17a863){var _0x4e2e88=_0x17a863[_0x596d('0x35')](';');var _0x35e9b2={'user_key':_0x4e2e88[0x0],'session_key':_0x4e2e88[0x1]};_0x1ce97a={'url':_0x43ce71+_0x596d('0x36'),'method':_0x596d('0x37'),'headers':{'user_key':_0x35e9b2[_0x596d('0x38')],'Session_key':_0x35e9b2[_0x596d('0x39')]},'json':!![],'body':_0x40defc};return rp(_0x1ce97a);})['then'](function(_0x261cd9){if(_0x261cd9[_0x596d('0x3a')]>=0x1){var _0x2f1634={'messageId':_0x261cd9[_0x596d('0x3b')]};if(_0x48571c[_0x596d('0x30')]!=='GP'||!_0x48571c[_0x596d('0x3c')]){_0x2f1634[_0x596d('0x3d')]=!![];}return _0xd076e5[_0x596d('0x19')](_0x2f1634);}else{return logger['error'](_0x596d('0x2a'),'afterCreate',_0x596d('0x2c'),util['inspect'](_0x261cd9,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2fa69f){return logger[_0x596d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x596d('0x2b'),_0x596d('0x2c'),util[_0x596d('0x3e')](_0x2fa69f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),'skebby',_0x596d('0x3f'));}break;case _0x596d('0x40'):if(_0x48571c['authToken']){var _0x5787d1={'recipient':_0x113797[_0x596d('0x23')],'message':_0x113797['body'],'sender':_0x48571c['senderString']||_0x48571c[_0x596d('0x23')],'authorization':_0x48571c[_0x596d('0x22')]};var _0x5ed43c={'method':_0x596d('0x37'),'uri':_0x596d('0x41'),'body':_0x5787d1,'json':!![]};rp(_0x5ed43c)[_0x596d('0x1e')](function(_0x5a8974){var _0xb74db3={'messageId':_0x5a8974['requestid']};if(!_0x48571c[_0x596d('0x3c')]){_0xb74db3['read']=!![];}return _0xd076e5[_0x596d('0x19')](_0xb74db3);})[_0x596d('0x29')](function(_0x39d9cb){logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x40'),util[_0x596d('0x3e')](_0x39d9cb,{'showHidden':![],'depth':null}));});}else{logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x40'),_0x596d('0x42'));}break;case'clicksend':if(_0x48571c[_0x596d('0x2e')]&&_0x48571c[_0x596d('0x2f')]){var _0x5787d1={'messages':[{'source':_0x596d('0x43'),'to':_0x113797[_0x596d('0x23')],'body':_0x113797[_0x596d('0xd')],'from':_0x48571c[_0x596d('0x44')]||_0x48571c[_0x596d('0x23')]}]};var _0x2ec635=util[_0x596d('0x45')](_0x596d('0x46'),_0x48571c['username'],_0x48571c[_0x596d('0x2f')]);var _0x5ed43c={'method':_0x596d('0x37'),'uri':_0x596d('0x47'),'body':_0x5787d1,'headers':{'Authorization':util[_0x596d('0x45')](_0x596d('0x48'),new Buffer(_0x2ec635)[_0x596d('0x49')](_0x596d('0x4a')))},'json':!![]};rp(_0x5ed43c)['then'](function(_0x5e1e91){if(_0x5e1e91[_0x596d('0x4b')]>=0xc8&&_0x5e1e91[_0x596d('0x4b')]<=0xce){if(_0x5e1e91[_0x596d('0x4c')]&&_0x5e1e91[_0x596d('0x4c')][_0x596d('0x4d')]>0x0){var _0x4f8340=_[_0x596d('0x4e')](_0x5e1e91[_0x596d('0x4c')][_0x596d('0x24')]);var _0x214a53={'messageId':_0x4f8340['message_id']};if(!_0x48571c[_0x596d('0x3c')]){_0x214a53[_0x596d('0x3d')]=!![];}return _0xd076e5[_0x596d('0x19')](_0x214a53);}else{logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x4f'),util[_0x596d('0x3e')](_0x5e1e91,{'showHidden':![],'depth':null}));}}else{logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),'clickSend',util[_0x596d('0x3e')](_0x5e1e91,{'showHidden':![],'depth':null}));}})[_0x596d('0x29')](function(_0x264520){logger[_0x596d('0x1b')](_0x596d('0x2a'),'afterCreate',_0x596d('0x4f'),util['inspect'](_0x264520,{'showHidden':![],'depth':null}));});}else{logger[_0x596d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x596d('0x2b'),'clickSend',_0x596d('0x3f'));}break;case _0x596d('0x50'):if(_0x48571c[_0x596d('0x51')]&&_0x48571c[_0x596d('0x22')]){var _0x5787d1={'dst':_0x113797['phone'],'text':_0x113797['body'],'src':_0x48571c[_0x596d('0x44')]||_0x48571c[_0x596d('0x23')],'url':_0x48571c[_0x596d('0x25')]+_0x596d('0x26')+_0x113797['id']+_0x596d('0x27')+_0x48571c[_0x596d('0x52')]};var _0x2ec635=util[_0x596d('0x45')](_0x596d('0x46'),_0x48571c[_0x596d('0x51')],_0x48571c['authToken']);var _0x5ed43c={'method':_0x596d('0x37'),'uri':util['format'](_0x596d('0x53'),_0x48571c['authId']),'body':_0x5787d1,'headers':{'Authorization':util[_0x596d('0x45')]('Basic\x20%s',new Buffer(_0x2ec635)[_0x596d('0x49')](_0x596d('0x4a')))},'json':!![]};rp(_0x5ed43c)[_0x596d('0x1e')](function(_0x1e386a){var _0x1b1176={'messageId':_0x1e386a[_0x596d('0x54')][0x0]};return _0xd076e5['update'](_0x1b1176);})['catch'](function(_0x38c84e){logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x50'),util['inspect'](_0x38c84e,{'showHidden':![],'depth':null}));});}else{logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x48571c[_0x596d('0x2e')]&&_0x48571c[_0x596d('0x2f')]){if(_0x48571c[_0x596d('0x55')]){var _0x3dc850={'method':'POST','uri':_0x48571c[_0x596d('0x55')]+_0x596d('0x56'),'body':{'username':_0x48571c[_0x596d('0x2e')],'password':_0x48571c[_0x596d('0x2f')]},'json':!![]};return rp(_0x3dc850)[_0x596d('0x1e')](function(_0x50b9bf){var _0xc59872={'method':_0x596d('0x37'),'uri':_0x48571c['baseUrl']+_0x596d('0x57'),'body':{'messages':[{'from':_0x48571c[_0x596d('0x23')],'destinations':[{'to':_0x113797[_0x596d('0x23')]}],'text':_0x113797['body'],'notifyUrl':_0x48571c[_0x596d('0x25')]+_0x596d('0x26')+_0x113797['id']+_0x596d('0x27')+_0x48571c[_0x596d('0x52')],'notifyContentType':_0x596d('0x58'),'callbackData':_0x48571c['phone']+';'+_0x113797[_0x596d('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x50b9bf[_0x596d('0x52')]},'json':!![]};return rp(_0xc59872)[_0x596d('0x1e')](function(_0xf0ec69){if(_0xf0ec69[_0x596d('0x24')]){var _0x3cf3e7={'messageId':_0xf0ec69[_0x596d('0x24')][0x0][_0x596d('0xc')]};if(!_0x48571c[_0x596d('0x3c')]){_0x3cf3e7[_0x596d('0x3d')]=!![];}return _0xd076e5[_0x596d('0x19')](_0x3cf3e7);}else{return logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x59'),util[_0x596d('0x3e')](_0xf0ec69,{'showHidden':![],'depth':null}));}});})[_0x596d('0x29')](function(_0x215e49){return logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x59'),util['inspect'](_0x215e49,{'showHidden':![],'depth':null}));});}else{logger[_0x596d('0x1b')](_0x596d('0x2a'),'afterCreate',_0x596d('0x59'),_0x596d('0x5a'));}}else{logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x59'),_0x596d('0x3f'));}break;case _0x596d('0x5b'):var _0x5cf4a9=require('crypto');if(_0x48571c[_0x596d('0x5c')]){var _0x116604={};_0x116604['login']=_0x48571c[_0x596d('0x2e')];_0x116604[_0x596d('0x23')]=_0x113797[_0x596d('0x23')];_0x116604[_0x596d('0x31')]=_0x48571c['phone'];_0x116604[_0x596d('0x5d')]=_0x113797[_0x596d('0xd')];_0x116604[_0x596d('0x5e')]=+new Date();var _0x3bf0d5='';var _0x1dcee3='';var _0x6cb795=Object['keys'](_0x116604);_0x6cb795[_0x596d('0x5f')]();for(var _0x1913fa=0x0;_0x1913fa<_0x6cb795[_0x596d('0x60')];_0x1913fa++){if(_0x3bf0d5!=''){_0x3bf0d5+='&';}_0x3bf0d5+=_0x6cb795[_0x1913fa]+'='+encodeURIComponent(_0x116604[_0x6cb795[_0x1913fa]]);_0x1dcee3+=_0x116604[_0x6cb795[_0x1913fa]];}_0x1dcee3+=_0x48571c[_0x596d('0x5c')];_0x1dcee3=_0x5cf4a9['createHash']('md5')[_0x596d('0x19')](_0x1dcee3)[_0x596d('0x61')](_0x596d('0x62'));if(_0x3bf0d5!==''){_0x3bf0d5+='&';}_0x3bf0d5+=_0x596d('0x63')+_0x1dcee3;var _0x1ce97a={'method':'GET','uri':_0x48571c[_0x596d('0x55')]+'/external/get/send.php?'+_0x3bf0d5,'json':!![]};return rp(_0x1ce97a)[_0x596d('0x1e')](function(_0x47505f){var _0x38f676=Object[_0x596d('0x64')](_0x47505f);if(_0x47505f[_0x38f676[0x0]]['error']&&parseInt(_0x47505f[_0x38f676[0x0]][_0x596d('0x1b')])===0x0){var _0x366e3a={'messageId':_0x47505f[_0x38f676[0x0]][_0x596d('0x65')]};if(!_0x48571c[_0x596d('0x3c')]){_0x366e3a['read']=!![];}return _0xd076e5[_0x596d('0x19')](_0x366e3a);}else{return logger['error'](_0x596d('0x2a'),'afterCreate',_0x596d('0x5b'),util['inspect'](_0x47505f[_0x596d('0x1b')],{'showHidden':![],'depth':null}));}})[_0x596d('0x29')](function(_0x288a79){return logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x5b'),util[_0x596d('0x3e')](_0x288a79,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x596d('0x2b'),_0x596d('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x596d('0x66'):if(_0x48571c[_0x596d('0x5c')]){var _0x25ba50={'method':_0x596d('0x37'),'uri':_0x596d('0x67'),'headers':{'Authorization':_0x48571c[_0x596d('0x5c')]},'body':{'content':_0x113797[_0x596d('0xd')],'to':[_0x113797['phone']],'from':_0x48571c['phone'],'binary':![],'clientMessageId':_0x596d('0x68'),'charset':_0x596d('0x69')},'json':!![]};rp(_0x25ba50)[_0x596d('0x1e')](function(_0x3ef5d2){if(!_0x3ef5d2[_0x596d('0x1b')]){var _0xb6d9b4={'messageId':_0x3ef5d2[_0x596d('0x24')][0x0][_0x596d('0x6a')]};if(!_0x48571c[_0x596d('0x3c')]){_0xb6d9b4[_0x596d('0x3d')]=!![];}return _0xd076e5['update'](_0xb6d9b4);}else{return logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x66'),util[_0x596d('0x3e')](_0x3ef5d2[_0x596d('0x1b')],{'showHidden':![],'depth':null}));}})[_0x596d('0x29')](function(_0x14b58a){return logger['error'](_0x596d('0x2a'),'afterCreate',_0x596d('0x66'),util['inspect'](_0x14b58a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x596d('0x2b'),_0x596d('0x66'),_0x596d('0x6b'));}break;case'bandwidth':if(_0x48571c[_0x596d('0x2e')]&&_0x48571c[_0x596d('0x2f')]){var _0x2ec635=util[_0x596d('0x45')](_0x596d('0x46'),_0x48571c['username'],_0x48571c[_0x596d('0x2f')]);var _0x5ed43c={'method':'POST','uri':_0x596d('0x6c')+_0x48571c['accountId']+'/messages','body':{'to':[_0x113797['phone']],'text':_0x113797[_0x596d('0xd')],'from':_0x48571c[_0x596d('0x23')],'applicationId':_0x48571c['applicationId']},'headers':{'Authorization':util[_0x596d('0x45')](_0x596d('0x48'),new Buffer(_0x2ec635)[_0x596d('0x49')](_0x596d('0x4a')))},'json':!![]};rp(_0x5ed43c)[_0x596d('0x1e')](function(_0x467614){if(_0x467614['id']){var _0xd55c3e={'messageId':_0x467614['id']};return _0xd076e5[_0x596d('0x19')](_0xd55c3e);}else{logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x6d'),util['inspect'](_0x467614,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1d5405){logger[_0x596d('0x1b')](_0x596d('0x2a'),'afterCreate',_0x596d('0x6d'),util['inspect'](_0x1d5405,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x6d'),_0x596d('0x3f'));}break;case _0x596d('0x6e'):if(_0x48571c['apiKey']){var _0x34f13e={};var _0x1ce97a={'method':_0x596d('0x37'),'uri':_0x596d('0x6f'),'headers':{'Authorization':'Bearer\x20'+_0x48571c[_0x596d('0x5c')],'Content-Type':_0x596d('0x58')},'body':{'from':_0x48571c[_0x596d('0x23')],'to':_0x113797['phone'],'text':_0x113797[_0x596d('0xd')]},'json':!![]};return rp(_0x1ce97a)['then'](function(_0x808b83){if(_0x808b83['code']==0xca){_0x34f13e[_0x596d('0x70')]=_0x808b83;var _0x1cadb0={'method':_0x596d('0x37'),'uri':_0x596d('0x71'),'headers':{'Authorization':_0x596d('0x72')+_0x48571c[_0x596d('0x5c')],'Content-Type':_0x596d('0x58')},'body':{'refid':_0x34f13e[_0x596d('0x70')][_0x596d('0x73')]},'json':!![]};return rp(_0x1cadb0)[_0x596d('0x1e')](function(_0x1f2962){_0x34f13e['status']=_0x1f2962;var _0x4a1fb8={'messageId':_0x34f13e[_0x596d('0x70')]['refid'],'read':!![]};return _0xd076e5['update'](_0x4a1fb8);});}else{return logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x6e'),util[_0x596d('0x3e')](_0x808b83,{'showHidden':![],'depth':null}));}})[_0x596d('0x29')](function(_0x44e1ee){return logger['error'](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x6e'),util[_0x596d('0x3e')](_0x44e1ee,{'showHidden':![],'depth':null}));});}else{return logger[_0x596d('0x1b')](_0x596d('0x2a'),_0x596d('0x2b'),_0x596d('0x6e'),_0x596d('0x74'));}break;}}})[_0x596d('0x75')](function(){_0x184a1d();});}else{_0x184a1d();}}},'charset':_0x596d('0x76'),'collate':_0x596d('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2e8ace1..621dacc 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 _0xa97e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','create','body','options','raw','CreateSmsMessage','stringify','lodash','util'];(function(_0x123539,_0x3df8e9){var _0x221a29=function(_0x3e2533){while(--_0x3e2533){_0x123539['push'](_0x123539['shift']());}};_0x221a29(++_0x3df8e9);}(_0xa97e,0xca));var _0xea97=function(_0x561529,_0x1a373d){_0x561529=_0x561529-0x0;var _0x3f6105=_0xa97e[_0x561529];return _0x3f6105;};'use strict';var _=require(_0xea97('0x0'));var util=require(_0xea97('0x1'));var moment=require('moment');var BPromise=require(_0xea97('0x2'));var rs=require(_0xea97('0x3'));var fs=require('fs');var Redis=require(_0xea97('0x4'));var db=require(_0xea97('0x5'))['db'];var utils=require(_0xea97('0x6'));var logger=require(_0xea97('0x7'))(_0xea97('0x8'));var config=require('../../config/environment');var jayson=require(_0xea97('0x9'));var client=jayson['client'][_0xea97('0xa')]({'port':0x232a});config[_0xea97('0xb')]=_[_0xea97('0xc')](config['redis'],{'host':_0xea97('0xd'),'port':0x18eb});var socket=require(_0xea97('0xe'))(new Redis(config['redis']));require(_0xea97('0xf'))[_0xea97('0x10')](socket);function respondWithRpcPromise(_0x35cfd1,_0x26fccb,_0x379650){return new BPromise(function(_0x3c7eee,_0x2276a3){return client[_0xea97('0x11')](_0x35cfd1,_0x379650)['then'](function(_0x4bdbd5){logger['info'](_0xea97('0x12'),_0x26fccb,_0xea97('0x13'));logger[_0xea97('0x14')](_0xea97('0x15'),_0x26fccb,_0xea97('0x13'),JSON['stringify'](_0x4bdbd5));if(_0x4bdbd5[_0xea97('0x16')]){if(_0x4bdbd5[_0xea97('0x16')][_0xea97('0x17')]===0x1f4){logger[_0xea97('0x16')](_0xea97('0x12'),_0x26fccb,_0x4bdbd5[_0xea97('0x16')][_0xea97('0x18')]);return _0x2276a3(_0x4bdbd5[_0xea97('0x16')][_0xea97('0x18')]);}logger[_0xea97('0x16')](_0xea97('0x12'),_0x26fccb,_0x4bdbd5[_0xea97('0x16')][_0xea97('0x18')]);return _0x3c7eee(_0x4bdbd5[_0xea97('0x16')][_0xea97('0x18')]);}else{logger[_0xea97('0x19')](_0xea97('0x12'),_0x26fccb,_0xea97('0x13'));_0x3c7eee(_0x4bdbd5[_0xea97('0x1a')][_0xea97('0x18')]);}})[_0xea97('0x1b')](function(_0x4e84f1){logger['error'](_0xea97('0x12'),_0x26fccb,_0x4e84f1);_0x2276a3(_0x4e84f1);});});}exports['CreateSmsMessage']=function(_0x2a47f0){var _0x44f180=this;return new Promise(function(_0x4b204b,_0x3a20e8){return db['SmsMessage'][_0xea97('0x1c')](_0x2a47f0[_0xea97('0x1d')],{'raw':_0x2a47f0['options']?_0x2a47f0[_0xea97('0x1e')][_0xea97('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1d0cb5){logger[_0xea97('0x19')](_0xea97('0x20'),_0x2a47f0);logger[_0xea97('0x14')](_0xea97('0x20'),_0x2a47f0,JSON[_0xea97('0x21')](_0x1d0cb5));_0x4b204b(_0x1d0cb5);})[_0xea97('0x1b')](function(_0x2dcaa4){logger[_0xea97('0x16')]('CreateSmsMessage',_0x2dcaa4[_0xea97('0x18')],_0x2a47f0);_0x3a20e8(_0x44f180[_0xea97('0x16')](0x1f4,_0x2dcaa4[_0xea97('0x18')]));});});}; \ No newline at end of file +var _0x504f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x504f,0x16e));var _0xf504=function(_0x135e09,_0x26b08d){_0x135e09=_0x135e09-0x0;var _0x112866=_0x504f[_0x135e09];return _0x112866;};'use strict';var _=require(_0xf504('0x0'));var util=require(_0xf504('0x1'));var moment=require(_0xf504('0x2'));var BPromise=require(_0xf504('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf504('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf504('0x5'));var logger=require(_0xf504('0x6'))(_0xf504('0x7'));var config=require(_0xf504('0x8'));var jayson=require(_0xf504('0x9'));var client=jayson[_0xf504('0xa')]['http']({'port':0x232a});config[_0xf504('0xb')]=_[_0xf504('0xc')](config[_0xf504('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x11dd5c,_0x5cfcef,_0x477b82){return new BPromise(function(_0xc9fbda,_0x300954){return client[_0xf504('0xd')](_0x11dd5c,_0x477b82)[_0xf504('0xe')](function(_0x8fe775){logger[_0xf504('0xf')](_0xf504('0x10'),_0x5cfcef,_0xf504('0x11'));logger[_0xf504('0x12')](_0xf504('0x13'),_0x5cfcef,_0xf504('0x11'),JSON[_0xf504('0x14')](_0x8fe775));if(_0x8fe775['error']){if(_0x8fe775[_0xf504('0x15')]['code']===0x1f4){logger['error'](_0xf504('0x10'),_0x5cfcef,_0x8fe775[_0xf504('0x15')][_0xf504('0x16')]);return _0x300954(_0x8fe775[_0xf504('0x15')][_0xf504('0x16')]);}logger[_0xf504('0x15')]('SmsMessage,\x20%s,\x20%s',_0x5cfcef,_0x8fe775[_0xf504('0x15')][_0xf504('0x16')]);return _0xc9fbda(_0x8fe775[_0xf504('0x15')][_0xf504('0x16')]);}else{logger[_0xf504('0xf')]('SmsMessage,\x20%s,\x20%s',_0x5cfcef,_0xf504('0x11'));_0xc9fbda(_0x8fe775[_0xf504('0x17')][_0xf504('0x16')]);}})[_0xf504('0x18')](function(_0x165620){logger['error']('SmsMessage,\x20%s,\x20%s',_0x5cfcef,_0x165620);_0x300954(_0x165620);});});}exports[_0xf504('0x19')]=function(_0x54db19){var _0x219ae5=this;return new Promise(function(_0x20d6fa,_0x27b5c1){return db[_0xf504('0x1a')][_0xf504('0x1b')](_0x54db19[_0xf504('0x1c')],{'raw':_0x54db19[_0xf504('0x1d')]?_0x54db19[_0xf504('0x1d')][_0xf504('0x1e')]===undefined?!![]:![]:!![]})[_0xf504('0xe')](function(_0x1c7df5){logger[_0xf504('0xf')](_0xf504('0x19'),_0x54db19);logger[_0xf504('0x12')](_0xf504('0x19'),_0x54db19,JSON[_0xf504('0x14')](_0x1c7df5));_0x20d6fa(_0x1c7df5);})[_0xf504('0x18')](function(_0x4595e8){logger[_0xf504('0x15')](_0xf504('0x19'),_0x4595e8[_0xf504('0x16')],_0x54db19);_0x27b5c1(_0x219ae5[_0xf504('0x15')](0x1f4,_0x4595e8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f873cd5..a9dfb00 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 _0xf514=['removeListener','register','smsMessage:','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf514,0xfb));var _0x4f51=function(_0xcd5951,_0x1fd0c5){_0xcd5951=_0xcd5951-0x0;var _0x4665c9=_0xf514[_0xcd5951];return _0x4665c9;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove',_0x4f51('0x0')];function createListener(_0x777f02,_0x2bee77){return function(_0x165a09){_0x2bee77['emit'](_0x777f02,_0x165a09);};}function removeListener(_0x3ac260,_0x5383fe){return function(){SmsMessageEvents[_0x4f51('0x1')](_0x3ac260,_0x5383fe);};}exports[_0x4f51('0x2')]=function(_0x467c68){for(var _0x156132=0x0,_0x4f8d3a=events['length'];_0x156132<_0x4f8d3a;_0x156132++){var _0xf4514a=events[_0x156132];var _0x408a3=createListener(_0x4f51('0x3')+_0xf4514a,_0x467c68);SmsMessageEvents['on'](_0xf4514a,_0x408a3);}}; \ No newline at end of file +var _0xf335=['remove','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0xf335,0x125));var _0x5f33=function(_0x22a332,_0x528fd1){_0x22a332=_0x22a332-0x0;var _0x13f44d=_0xf335[_0x22a332];return _0x13f44d;};'use strict';var SmsMessageEvents=require(_0x5f33('0x0'));var events=['save',_0x5f33('0x1'),'update'];function createListener(_0x521df1,_0x3d350f){return function(_0x49098b){_0x3d350f[_0x5f33('0x2')](_0x521df1,_0x49098b);};}function removeListener(_0x2830f6,_0xab39d6){return function(){SmsMessageEvents[_0x5f33('0x3')](_0x2830f6,_0xab39d6);};}exports[_0x5f33('0x4')]=function(_0x1e8bae){for(var _0x2fc8a7=0x0,_0x4297ad=events[_0x5f33('0x5')];_0x2fc8a7<_0x4297ad;_0x2fc8a7++){var _0xc49511=events[_0x2fc8a7];var _0x5dfa31=createListener(_0x5f33('0x6')+_0xc49511,_0x1e8bae);SmsMessageEvents['on'](_0xc49511,_0x5dfa31);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0a0c308..bb0db03 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 _0xd705=['post','create','/:id/teams','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/users','getAgents'];(function(_0x13186c,_0x38bed4){var _0x1d5069=function(_0x5c4194){while(--_0x5c4194){_0x13186c['push'](_0x13186c['shift']());}};_0x1d5069(++_0x38bed4);}(_0xd705,0x15b));var _0x5d70=function(_0x4c8a8f,_0x254623){_0x4c8a8f=_0x4c8a8f-0x0;var _0x4958cd=_0xd705[_0x4c8a8f];return _0x4958cd;};'use strict';var multer=require(_0x5d70('0x0'));var util=require(_0x5d70('0x1'));var path=require('path');var timeout=require(_0x5d70('0x2'));var express=require(_0x5d70('0x3'));var router=express['Router']();var fs_extra=require(_0x5d70('0x4'));var auth=require(_0x5d70('0x5'));var interaction=require(_0x5d70('0x6'));var config=require(_0x5d70('0x7'));var controller=require('./smsQueue.controller');router[_0x5d70('0x8')]('/',auth[_0x5d70('0x9')](),controller[_0x5d70('0xa')]);router[_0x5d70('0x8')](_0x5d70('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x5d70('0x8')](_0x5d70('0xc'),auth['isAuthenticated'](),controller[_0x5d70('0xd')]);router[_0x5d70('0x8')](_0x5d70('0xe'),auth[_0x5d70('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x5d70('0x9')](),controller['getTeams']);router[_0x5d70('0x8')](_0x5d70('0xf'),auth[_0x5d70('0x9')](),controller[_0x5d70('0x10')]);router[_0x5d70('0x11')]('/',auth[_0x5d70('0x9')](),controller[_0x5d70('0x12')]);router[_0x5d70('0x11')](_0x5d70('0x13'),auth[_0x5d70('0x9')](),controller['addTeams']);router['post'](_0x5d70('0xf'),auth['isAuthenticated'](),controller[_0x5d70('0x14')]);router[_0x5d70('0x15')](_0x5d70('0xc'),auth[_0x5d70('0x9')](),controller[_0x5d70('0x16')]);router['delete']('/:id',auth[_0x5d70('0x9')](),controller[_0x5d70('0x17')]);router['delete'](_0x5d70('0x13'),auth[_0x5d70('0x9')](),controller[_0x5d70('0x18')]);router[_0x5d70('0x19')](_0x5d70('0xf'),auth[_0x5d70('0x9')](),controller[_0x5d70('0x1a')]);module[_0x5d70('0x1b')]=router; \ No newline at end of file +var _0x39e1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','addAgents','put','/:id','delete','removeTeams','exports','multer','util'];(function(_0x501f61,_0x2450b0){var _0x5760fe=function(_0x541dbb){while(--_0x541dbb){_0x501f61['push'](_0x501f61['shift']());}};_0x5760fe(++_0x2450b0);}(_0x39e1,0x80));var _0x139e=function(_0x3f8e39,_0x5e795a){_0x3f8e39=_0x3f8e39-0x0;var _0xfb6c1b=_0x39e1[_0x3f8e39];return _0xfb6c1b;};'use strict';var multer=require(_0x139e('0x0'));var util=require(_0x139e('0x1'));var path=require('path');var timeout=require(_0x139e('0x2'));var express=require(_0x139e('0x3'));var router=express[_0x139e('0x4')]();var fs_extra=require(_0x139e('0x5'));var auth=require(_0x139e('0x6'));var interaction=require(_0x139e('0x7'));var config=require(_0x139e('0x8'));var controller=require('./smsQueue.controller');router[_0x139e('0x9')]('/',auth[_0x139e('0xa')](),controller[_0x139e('0xb')]);router['get'](_0x139e('0xc'),auth[_0x139e('0xa')](),controller[_0x139e('0xd')]);router[_0x139e('0x9')]('/:id',auth[_0x139e('0xa')](),controller[_0x139e('0xe')]);router[_0x139e('0x9')](_0x139e('0xf'),auth[_0x139e('0xa')](),controller['getMembers']);router['get'](_0x139e('0x10'),auth[_0x139e('0xa')](),controller[_0x139e('0x11')]);router[_0x139e('0x9')](_0x139e('0x12'),auth[_0x139e('0xa')](),controller['getAgents']);router[_0x139e('0x13')]('/',auth[_0x139e('0xa')](),controller['create']);router['post'](_0x139e('0x10'),auth[_0x139e('0xa')](),controller['addTeams']);router[_0x139e('0x13')](_0x139e('0x12'),auth['isAuthenticated'](),controller[_0x139e('0x14')]);router[_0x139e('0x15')](_0x139e('0x16'),auth[_0x139e('0xa')](),controller['update']);router[_0x139e('0x17')](_0x139e('0x16'),auth[_0x139e('0xa')](),controller['destroy']);router[_0x139e('0x17')](_0x139e('0x10'),auth[_0x139e('0xa')](),controller[_0x139e('0x18')]);router['delete'](_0x139e('0x12'),auth[_0x139e('0xa')](),controller['removeAgents']);module[_0x139e('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6ebb512..87f798a 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 _0xee62=['rrmemory','roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x1bb0b6,_0x1734b7){var _0x45f16b=function(_0x15823d){while(--_0x15823d){_0x1bb0b6['push'](_0x1bb0b6['shift']());}};_0x45f16b(++_0x1734b7);}(_0xee62,0x74));var _0x2ee6=function(_0x3e89bc,_0x58ed67){_0x3e89bc=_0x3e89bc-0x0;var _0x3ca57d=_0xee62[_0x3e89bc];return _0x3ca57d;};'use strict';var Sequelize=require('sequelize');module[_0x2ee6('0x0')]={'name':{'type':Sequelize[_0x2ee6('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2ee6('0x1')]},'timeout':{'type':Sequelize[_0x2ee6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2ee6('0x3')](_0x2ee6('0x4'),'beepall',_0x2ee6('0x5'))}}; \ No newline at end of file +var _0x1e02=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x241a9e,_0x569c4a){var _0x4961b0=function(_0x1465cd){while(--_0x1465cd){_0x241a9e['push'](_0x241a9e['shift']());}};_0x4961b0(++_0x569c4a);}(_0x1e02,0x15c));var _0x21e0=function(_0xaedcfd,_0x1c44b1){_0xaedcfd=_0xaedcfd-0x0;var _0x3b503f=_0x1e02[_0xaedcfd];return _0x3b503f;};'use strict';var Sequelize=require('sequelize');module[_0x21e0('0x0')]={'name':{'type':Sequelize[_0x21e0('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x21e0('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x21e0('0x3')](_0x21e0('0x4'),_0x21e0('0x5'),_0x21e0('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c1a17e0..98079d9 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 _0x9bb3=['SIP','getTeams','findOne','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','compact','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','undefined','limit','count','reject','then','destroy','SmsQueues','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','options','SmsQueue','includeAll','include','findAll','rows','show','fields','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','describe','params','length','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','updatedAt','createdAt','%s/%s'];(function(_0x52b22f,_0x12c645){var _0x3eea4e=function(_0x1ce222){while(--_0x1ce222){_0x52b22f['push'](_0x52b22f['shift']());}};_0x3eea4e(++_0x12c645);}(_0x9bb3,0x134));var _0x39bb=function(_0x395f07,_0x1dbf85){_0x395f07=_0x395f07-0x0;var _0x1215d4=_0x9bb3[_0x395f07];return _0x1215d4;};'use strict';var emlformat=require(_0x39bb('0x0'));var rimraf=require(_0x39bb('0x1'));var zipdir=require(_0x39bb('0x2'));var jsonpatch=require(_0x39bb('0x3'));var rp=require(_0x39bb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x39bb('0x5'));var util=require(_0x39bb('0x6'));var path=require(_0x39bb('0x7'));var sox=require(_0x39bb('0x8'));var csv=require(_0x39bb('0x9'));var ejs=require(_0x39bb('0xa'));var fs=require('fs');var fs_extra=require(_0x39bb('0xb'));var _=require(_0x39bb('0xc'));var squel=require(_0x39bb('0xd'));var crypto=require(_0x39bb('0xe'));var jsforce=require(_0x39bb('0xf'));var deskjs=require(_0x39bb('0x10'));var toCsv=require(_0x39bb('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x39bb('0x11'));var authService=require(_0x39bb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x39bb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39bb('0x14'))(_0x39bb('0x15'));var utils=require(_0x39bb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x39bb('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x39bb('0x18')](config[_0x39bb('0x19')],{'host':_0x39bb('0x1a'),'port':0x18eb});var socket=require(_0x39bb('0x1b'))(new Redis(config[_0x39bb('0x19')]));require(_0x39bb('0x1c'))[_0x39bb('0x1d')](socket);function respondWithStatusCode(_0x4a7a94,_0x5c30f5){_0x5c30f5=_0x5c30f5||0xcc;return function(_0x214e83){if(_0x214e83){return _0x4a7a94['sendStatus'](_0x5c30f5);}return _0x4a7a94[_0x39bb('0x1e')](_0x5c30f5)[_0x39bb('0x1f')]();};}function respondWithResult(_0x34c794,_0x240e20){_0x240e20=_0x240e20||0xc8;return function(_0x2a81d9){if(_0x2a81d9){return _0x34c794[_0x39bb('0x1e')](_0x240e20)[_0x39bb('0x20')](_0x2a81d9);}};}function respondWithFilteredResult(_0x27fa0f,_0x35b2b6){return function(_0xde3cf4){if(_0xde3cf4){var _0x51ebdb=typeof _0x35b2b6[_0x39bb('0x21')]===_0x39bb('0x22')&&typeof _0x35b2b6[_0x39bb('0x23')]==='undefined';var _0x12b6a4=_0xde3cf4[_0x39bb('0x24')];var _0xd92981=_0x51ebdb?0x0:_0x35b2b6[_0x39bb('0x21')];var _0x148fe1=_0x51ebdb?_0xde3cf4[_0x39bb('0x24')]:_0x35b2b6[_0x39bb('0x21')]+_0x35b2b6[_0x39bb('0x23')];var _0x50adc6;if(_0x148fe1>=_0x12b6a4){_0x148fe1=_0x12b6a4;_0x50adc6=0xc8;}else{_0x50adc6=0xce;}_0x27fa0f[_0x39bb('0x1e')](_0x50adc6);return _0x27fa0f['set']('Content-Range',_0xd92981+'-'+_0x148fe1+'/'+_0x12b6a4)[_0x39bb('0x20')](_0xde3cf4);}return null;};}function patchUpdates(_0x475768){return function(_0x507859){try{jsonpatch['apply'](_0x507859,_0x475768,!![]);}catch(_0x1f2e4f){return BPromise[_0x39bb('0x25')](_0x1f2e4f);}return _0x507859['save']();};}function saveUpdates(_0x2f9390,_0x119a90){return function(_0x21ec58){if(_0x21ec58){return _0x21ec58['update'](_0x2f9390)[_0x39bb('0x26')](function(_0x492eb6){return _0x492eb6;});}return null;};}function removeEntity(_0x855c98,_0x3d1cef){return function(_0x1ea4b7){if(_0x1ea4b7){return _0x1ea4b7[_0x39bb('0x27')]()[_0x39bb('0x26')](function(){var _0x5f4acf=_0x1ea4b7['get']({'plain':!![]});var _0xe597b8=_0x39bb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0xe597b8,'resourceId':_0x5f4acf['id']}})[_0x39bb('0x26')](function(){return _0x1ea4b7;});})[_0x39bb('0x26')](function(){_0x855c98[_0x39bb('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x68025,_0x512573){return function(_0x1f9fe2){if(!_0x1f9fe2){_0x68025[_0x39bb('0x29')](0x194);}return _0x1f9fe2;};}function handleError(_0x4fda09,_0x454fc5){_0x454fc5=_0x454fc5||0x1f4;return function(_0x229dd6){logger[_0x39bb('0x2a')](_0x229dd6[_0x39bb('0x2b')]);if(_0x229dd6[_0x39bb('0x2c')]){delete _0x229dd6[_0x39bb('0x2c')];}_0x4fda09[_0x39bb('0x1e')](_0x454fc5)[_0x39bb('0x2d')](_0x229dd6);};}exports[_0x39bb('0x2e')]=function(_0x42ba84,_0xad1133){var _0x3e137a={},_0x370d22={},_0x5e0ae8={'count':0x0,'rows':[]};var _0x182460=_[_0x39bb('0x2f')](db['SmsQueue'][_0x39bb('0x30')],function(_0x30fae3){return{'name':_0x30fae3['fieldName'],'type':_0x30fae3[_0x39bb('0x31')][_0x39bb('0x32')]};});_0x370d22[_0x39bb('0x33')]=_['map'](_0x182460,'name');_0x370d22['query']=_[_0x39bb('0x34')](_0x42ba84[_0x39bb('0x35')]);_0x370d22[_0x39bb('0x36')]=_[_0x39bb('0x37')](_0x370d22['model'],_0x370d22[_0x39bb('0x35')]);_0x3e137a['attributes']=_[_0x39bb('0x37')](_0x370d22['model'],qs['fields'](_0x42ba84['query']['fields']));_0x3e137a[_0x39bb('0x38')]=_0x3e137a[_0x39bb('0x38')]['length']?_0x3e137a[_0x39bb('0x38')]:_0x370d22[_0x39bb('0x33')];if(!_0x42ba84['query']['hasOwnProperty'](_0x39bb('0x39'))){_0x3e137a[_0x39bb('0x23')]=qs[_0x39bb('0x23')](_0x42ba84[_0x39bb('0x35')][_0x39bb('0x23')]);_0x3e137a[_0x39bb('0x21')]=qs[_0x39bb('0x21')](_0x42ba84[_0x39bb('0x35')][_0x39bb('0x21')]);}_0x3e137a[_0x39bb('0x3a')]=qs[_0x39bb('0x3b')](_0x42ba84['query']['sort']);_0x3e137a[_0x39bb('0x3c')]=qs[_0x39bb('0x36')](_[_0x39bb('0x3d')](_0x42ba84[_0x39bb('0x35')],_0x370d22[_0x39bb('0x36')]),_0x182460);if(_0x42ba84['query']['filter']){_0x3e137a['where']=_['merge'](_0x3e137a['where'],{'$or':_['map'](_0x182460,function(_0x404fd9){if(_0x404fd9['type']!=='VIRTUAL'){var _0x68c54e={};_0x68c54e[_0x404fd9['name']]={'$like':'%'+_0x42ba84['query'][_0x39bb('0x3e')]+'%'};return _0x68c54e;}})});}_0x3e137a=_[_0x39bb('0x3f')]({},_0x3e137a,_0x42ba84[_0x39bb('0x40')]);var _0x20074c={'where':_0x3e137a[_0x39bb('0x3c')]};return db[_0x39bb('0x41')][_0x39bb('0x24')](_0x20074c)[_0x39bb('0x26')](function(_0x57d8dc){_0x5e0ae8['count']=_0x57d8dc;if(_0x42ba84[_0x39bb('0x35')][_0x39bb('0x42')]){_0x3e137a[_0x39bb('0x43')]=[{'all':!![]}];}return db[_0x39bb('0x41')][_0x39bb('0x44')](_0x3e137a);})[_0x39bb('0x26')](function(_0x1301be){_0x5e0ae8[_0x39bb('0x45')]=_0x1301be;return _0x5e0ae8;})[_0x39bb('0x26')](respondWithFilteredResult(_0xad1133,_0x3e137a))['catch'](handleError(_0xad1133,null));};exports[_0x39bb('0x46')]=function(_0x57affa,_0x4ed178){var _0x45a45c={'raw':!![],'where':{'id':_0x57affa['params']['id']}},_0x295485={};_0x295485[_0x39bb('0x33')]=_[_0x39bb('0x34')](db[_0x39bb('0x41')]['rawAttributes']);_0x295485[_0x39bb('0x35')]=_[_0x39bb('0x34')](_0x57affa[_0x39bb('0x35')]);_0x295485[_0x39bb('0x36')]=_[_0x39bb('0x37')](_0x295485[_0x39bb('0x33')],_0x295485[_0x39bb('0x35')]);_0x45a45c[_0x39bb('0x38')]=_[_0x39bb('0x37')](_0x295485[_0x39bb('0x33')],qs[_0x39bb('0x47')](_0x57affa[_0x39bb('0x35')][_0x39bb('0x47')]));_0x45a45c[_0x39bb('0x38')]=_0x45a45c[_0x39bb('0x38')]['length']?_0x45a45c[_0x39bb('0x38')]:_0x295485[_0x39bb('0x33')];if(_0x57affa[_0x39bb('0x35')][_0x39bb('0x42')]){_0x45a45c[_0x39bb('0x43')]=[{'all':!![]}];}_0x45a45c=_['merge']({},_0x45a45c,_0x57affa['options']);return db[_0x39bb('0x41')]['find'](_0x45a45c)[_0x39bb('0x26')](handleEntityNotFound(_0x4ed178,null))[_0x39bb('0x26')](respondWithResult(_0x4ed178,null))[_0x39bb('0x48')](handleError(_0x4ed178,null));};exports[_0x39bb('0x49')]=function(_0x3e9b4d,_0x523a3b){return db[_0x39bb('0x41')][_0x39bb('0x49')](_0x3e9b4d[_0x39bb('0x4a')],{})[_0x39bb('0x26')](function(_0x3947ae){var _0x17d32a=_0x3e9b4d[_0x39bb('0x4b')][_0x39bb('0x4c')]({'plain':!![]});if(!_0x17d32a)throw new Error(_0x39bb('0x4d'));if(_0x17d32a[_0x39bb('0x4e')]===_0x39bb('0x4b')){var _0x5539d4=_0x3947ae[_0x39bb('0x4c')]({'plain':!![]});var _0x3eadcf=_0x39bb('0x28');return db[_0x39bb('0x4f')][_0x39bb('0x50')]({'where':{'name':_0x3eadcf,'userProfileId':_0x17d32a[_0x39bb('0x51')]},'raw':!![]})[_0x39bb('0x26')](function(_0x356c74){if(_0x356c74&&_0x356c74['autoAssociation']===0x0){return db['UserProfileResource'][_0x39bb('0x49')]({'name':_0x5539d4[_0x39bb('0x2c')],'resourceId':_0x5539d4['id'],'type':_0x356c74[_0x39bb('0x2c')],'sectionId':_0x356c74['id']},{})['then'](function(){return _0x3947ae;});}else{return _0x3947ae;}})[_0x39bb('0x48')](function(_0x449837){logger[_0x39bb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x449837);throw _0x449837;});}return _0x3947ae;})[_0x39bb('0x26')](respondWithResult(_0x523a3b,0xc9))[_0x39bb('0x48')](handleError(_0x523a3b,null));};exports[_0x39bb('0x52')]=function(_0x4c11b3,_0x27b51a){if(_0x4c11b3[_0x39bb('0x4a')]['id']){delete _0x4c11b3[_0x39bb('0x4a')]['id'];}return db[_0x39bb('0x41')][_0x39bb('0x50')]({'where':{'id':_0x4c11b3['params']['id']}})[_0x39bb('0x26')](handleEntityNotFound(_0x27b51a,null))[_0x39bb('0x26')](saveUpdates(_0x4c11b3['body'],null))[_0x39bb('0x26')](respondWithResult(_0x27b51a,null))[_0x39bb('0x48')](handleError(_0x27b51a,null));};exports[_0x39bb('0x27')]=function(_0x4cc2ae,_0x4459a5){return db[_0x39bb('0x41')][_0x39bb('0x50')]({'where':{'id':_0x4cc2ae['params']['id']}})[_0x39bb('0x26')](handleEntityNotFound(_0x4459a5,null))[_0x39bb('0x26')](removeEntity(_0x4459a5,null))[_0x39bb('0x48')](handleError(_0x4459a5,null));};exports[_0x39bb('0x53')]=function(_0x19c718,_0x1d1241){return db[_0x39bb('0x41')]['describe']()[_0x39bb('0x26')](respondWithResult(_0x1d1241,null))[_0x39bb('0x48')](handleError(_0x1d1241,null));};exports['getMembers']=function(_0x5f2c47,_0x9ab822,_0xf3ea2f){var _0x35710d={'raw':!![],'where':{}},_0x343051={},_0x5a7a08;return db['SmsQueue']['findOne']({'where':{'id':_0x5f2c47[_0x39bb('0x54')]['id']}})[_0x39bb('0x26')](handleEntityNotFound(_0x9ab822,null))[_0x39bb('0x26')](function(_0x552126){if(_0x552126){_0x5a7a08=_0x552126[_0x39bb('0x4c')]({'plain':!![]});_0x343051[_0x39bb('0x33')]=_['keys'](db['UserSmsQueue']['rawAttributes']);_0x343051[_0x39bb('0x35')]=_[_0x39bb('0x34')](_0x5f2c47[_0x39bb('0x35')]);_0x343051['filters']=_[_0x39bb('0x37')](_0x343051[_0x39bb('0x33')],_0x343051[_0x39bb('0x35')]);_0x35710d['attributes']=_['intersection'](_0x343051[_0x39bb('0x33')],qs['fields'](_0x5f2c47[_0x39bb('0x35')][_0x39bb('0x47')]));_0x35710d[_0x39bb('0x38')]=_0x35710d[_0x39bb('0x38')][_0x39bb('0x55')]?_0x35710d[_0x39bb('0x38')]:_0x343051['model'];if(!_0x5f2c47[_0x39bb('0x35')]['hasOwnProperty'](_0x39bb('0x39'))){_0x35710d['limit']=qs[_0x39bb('0x23')](_0x5f2c47['query'][_0x39bb('0x23')]);_0x35710d[_0x39bb('0x21')]=qs[_0x39bb('0x21')](_0x5f2c47[_0x39bb('0x35')]['offset']);}_0x35710d[_0x39bb('0x3a')]=qs[_0x39bb('0x3b')](_0x5f2c47['query'][_0x39bb('0x3b')]);_0x35710d[_0x39bb('0x3c')]=qs[_0x39bb('0x36')](_[_0x39bb('0x3d')](_0x5f2c47['query'],_0x343051[_0x39bb('0x36')]));_0x35710d[_0x39bb('0x3c')][_0x39bb('0x56')]=_0x552126['id'];if(_0x5f2c47['query'][_0x39bb('0x3e')]){_0x35710d['where']=_[_0x39bb('0x3f')](_0x35710d[_0x39bb('0x3c')],{'$or':_[_0x39bb('0x2f')](_0x35710d[_0x39bb('0x38')],function(_0x50dbbb){var _0x38cb9f={};_0x38cb9f[_0x50dbbb]={'$like':'%'+_0x5f2c47[_0x39bb('0x35')][_0x39bb('0x3e')]+'%'};return _0x38cb9f;})});}_0x35710d=_[_0x39bb('0x3f')]({},_0x35710d,_0x5f2c47[_0x39bb('0x40')]);return db[_0x39bb('0x57')][_0x39bb('0x44')](_0x35710d);}})[_0x39bb('0x26')](function(_0x4c0f29){if(_0x4c0f29){return db[_0x39bb('0x58')][_0x39bb('0x59')]({'where':{'id':_[_0x39bb('0x2f')](_0x4c0f29,_0x39bb('0x5a')),'role':'agent'},'attributes':['id',_0x39bb('0x2c'),'smsPause',_0x39bb('0x5b'),_0x39bb('0x5c')]});}})['then'](function(_0x3cf071){if(_0x3cf071){return{'count':_0x3cf071[_0x39bb('0x24')],'rows':_['map'](_0x3cf071['rows'],function(_0x2eb78f){return{'membername':_0x2eb78f[_0x39bb('0x2c')],'UserId':_0x2eb78f['id'],'queue_name':_0x5a7a08['name'],'SmsQueueId':_0x5a7a08['id'],'interface':util['format'](_0x39bb('0x5d'),_0x39bb('0x5e'),_0x2eb78f[_0x39bb('0x2c')]),'penalty':0x0,'paused':_0x2eb78f['smsPause'],'createdAt':_0x2eb78f['createdAt'],'updatedAt':_0x2eb78f[_0x39bb('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9ab822,_0x35710d))['catch'](handleError(_0x9ab822,null));};exports[_0x39bb('0x5f')]=function(_0x1c11e6,_0x47caaa,_0x223968){var _0x56bfab={};var _0x10873e={};var _0x49974c;var _0x27095d;return db[_0x39bb('0x41')][_0x39bb('0x60')]({'where':{'id':_0x1c11e6[_0x39bb('0x54')]['id']}})['then'](handleEntityNotFound(_0x47caaa,null))[_0x39bb('0x26')](function(_0x5538e5){if(_0x5538e5){_0x49974c=_0x5538e5;_0x10873e[_0x39bb('0x33')]=_['keys'](db['Team']['rawAttributes']);_0x10873e[_0x39bb('0x35')]=_[_0x39bb('0x34')](_0x1c11e6[_0x39bb('0x35')]);_0x10873e['filters']=_[_0x39bb('0x37')](_0x10873e['model'],_0x10873e['query']);_0x56bfab[_0x39bb('0x38')]=_[_0x39bb('0x37')](_0x10873e[_0x39bb('0x33')],qs[_0x39bb('0x47')](_0x1c11e6[_0x39bb('0x35')]['fields']));_0x56bfab[_0x39bb('0x38')]=_0x56bfab['attributes'][_0x39bb('0x55')]?_0x56bfab[_0x39bb('0x38')]:_0x10873e['model'];_0x56bfab[_0x39bb('0x3a')]=qs[_0x39bb('0x3b')](_0x1c11e6['query'][_0x39bb('0x3b')]);_0x56bfab[_0x39bb('0x3c')]=qs[_0x39bb('0x36')](_['pick'](_0x1c11e6[_0x39bb('0x35')],_0x10873e['filters']));if(_0x1c11e6[_0x39bb('0x35')][_0x39bb('0x3e')]){_0x56bfab[_0x39bb('0x3c')]=_[_0x39bb('0x3f')](_0x56bfab[_0x39bb('0x3c')],{'$or':_[_0x39bb('0x2f')](_0x56bfab[_0x39bb('0x38')],function(_0x55c708){var _0x292f0f={};_0x292f0f[_0x55c708]={'$like':'%'+_0x1c11e6[_0x39bb('0x35')]['filter']+'%'};return _0x292f0f;})});}_0x56bfab=_['merge']({},_0x56bfab,_0x1c11e6[_0x39bb('0x40')]);return _0x49974c[_0x39bb('0x5f')](_0x56bfab);}})[_0x39bb('0x26')](function(_0x4dce28){if(_0x4dce28){_0x27095d=_0x4dce28[_0x39bb('0x55')];if(!_0x1c11e6['query']['hasOwnProperty'](_0x39bb('0x39'))){_0x56bfab[_0x39bb('0x23')]=qs[_0x39bb('0x23')](_0x1c11e6['query']['limit']);_0x56bfab[_0x39bb('0x21')]=qs[_0x39bb('0x21')](_0x1c11e6[_0x39bb('0x35')]['offset']);}return _0x49974c[_0x39bb('0x5f')](_0x56bfab);}})['then'](function(_0x5f1386){if(_0x5f1386){return _0x5f1386?{'count':_0x27095d,'rows':_0x5f1386}:null;}})['then'](respondWithResult(_0x47caaa,null))['catch'](handleError(_0x47caaa,null));};exports[_0x39bb('0x61')]=function(_0x4892ae,_0x7cc3d2,_0x2342ef){var _0x62635=_0x4892ae[_0x39bb('0x4a')][_0x39bb('0x62')];return db[_0x39bb('0x63')][_0x39bb('0x44')]({'where':{'id':_0x62635},'attributes':['id'],'include':[{'model':db[_0x39bb('0x58')],'as':'Agents','attributes':['id',_0x39bb('0x2c'),_0x39bb('0x64'),_0x39bb('0x65'),_0x39bb('0x66')],'raw':!![]}]})[_0x39bb('0x26')](function(_0x366deb){if(_0x366deb){var _0x4c914d=_[_0x39bb('0x67')](_0x366deb,function(_0x92e78a){var _0x27a2e8=_0x92e78a[_0x39bb('0x4c')]({'plain':!![]});return _0x27a2e8[_0x39bb('0x68')];});return db[_0x39bb('0x41')][_0x39bb('0x50')]({'where':{'id':_0x4892ae[_0x39bb('0x54')]['id']}})['then'](function(_0x140882){return db[_0x39bb('0x69')][_0x39bb('0x6a')](function(_0x535244){return _0x140882['addTeams'](_0x62635,{'transaction':_0x535244})[_0x39bb('0x26')](function(){return BPromise[_0x39bb('0x6b')](_0x4c914d,function(_0x20b772){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x20b772['id'],'SmsQueueId':_0x4892ae[_0x39bb('0x54')]['id']},'transaction':_0x535244});});})[_0x39bb('0x26')](function(){_0x4c914d['forEach'](function(_0x234724){socket[_0x39bb('0x6c')](_0x39bb('0x6d'),{'UserId':_0x234724['id'],'SmsQueueId':_0x140882['id']});});});});});}})[_0x39bb('0x26')](respondWithStatusCode(_0x7cc3d2,null))['catch'](handleError(_0x7cc3d2,null));};exports[_0x39bb('0x6e')]=function(_0x4e24e4,_0x485a74,_0x413632){return db[_0x39bb('0x63')]['findAll']({'where':{'id':_0x4e24e4[_0x39bb('0x35')][_0x39bb('0x62')]},'attributes':['id'],'include':[{'model':db[_0x39bb('0x58')],'as':_0x39bb('0x68'),'attributes':['id'],'raw':!![]}]})[_0x39bb('0x26')](handleEntityNotFound(_0x485a74,null))['then'](function(_0xf5773c){var _0x94ec4c=_[_0x39bb('0x2f')](_0xf5773c,'id');var _0x865aed=[];var _0x48d6f8=[];var _0x4f0300=squel[_0x39bb('0x6f')]();_0x4f0300['field'](_0x39bb('0x70'))['from'](_0x39bb('0x71'),'tq')['join'](_0x39bb('0x72'),'ut',_0x39bb('0x73'))[_0x39bb('0x3c')](_0x39bb('0x74'),_0x4e24e4['params']['id']);for(var _0x10ab34=0x0;_0x10ab34<_0xf5773c[_0x39bb('0x55')];_0x10ab34+=0x1){let _0x512790=_0xf5773c[_0x10ab34];for(var _0x51e44e=0x0;_0x51e44e<_0x512790[_0x39bb('0x68')][_0x39bb('0x55')];_0x51e44e+=0x1){let _0xa3c7=_0x512790[_0x39bb('0x68')][_0x51e44e];var _0x249b99=_0x4f0300[_0x39bb('0x75')]();_0x249b99[_0x39bb('0x3c')](_0x39bb('0x76'),_0xa3c7['id']);_0x48d6f8['push'](db[_0x39bb('0x69')][_0x39bb('0x35')](_0x249b99[_0x39bb('0x77')](),{'type':db[_0x39bb('0x69')][_0x39bb('0x78')][_0x39bb('0x79')]})[_0x39bb('0x26')](function(_0x9cd20b){if(_0x9cd20b['length']===0x1){return _0xa3c7['id'];}else{var _0x1a1573=_[_0x39bb('0x7a')](_[_0x39bb('0x2f')](_0x9cd20b,'TeamId'),function(_0x1748df){return _[_0x39bb('0x7b')](_0x94ec4c,_0x1748df);});if(_0x1a1573){return _0xa3c7['id'];}}}));}}return BPromise['all'](_0x48d6f8)[_0x39bb('0x26')](function(_0x5144c4){_0x865aed=_(_0x865aed)[_0x39bb('0x7c')](_0x5144c4)[_0x39bb('0x7d')]()['value']();return db[_0x39bb('0x41')][_0x39bb('0x50')]({'where':{'id':_0x4e24e4[_0x39bb('0x54')]['id']}})[_0x39bb('0x26')](function(_0x5e085e){return db[_0x39bb('0x69')]['transaction'](function(_0x37b1f5){return _0x5e085e['removeTeams'](_0x4e24e4[_0x39bb('0x35')][_0x39bb('0x62')],{'transaction':_0x37b1f5})[_0x39bb('0x26')](function(){if(!_['isEmpty'](_0x865aed)){return _0x5e085e[_0x39bb('0x7e')](_0x865aed,{'transaction':_0x37b1f5});}})['then'](function(){_0x865aed[_0x39bb('0x7f')](function(_0x4ed390){socket['emit'](_0x39bb('0x80'),{'UserId':_0x4ed390,'SmsQueueId':_0x5e085e['id']});});});});});});})[_0x39bb('0x26')](respondWithStatusCode(_0x485a74,null))['catch'](handleError(_0x485a74,null));};exports[_0x39bb('0x81')]=function(_0x35df38,_0x1f2d02,_0x22b9cf){return db[_0x39bb('0x41')][_0x39bb('0x50')]({'where':{'id':_0x35df38[_0x39bb('0x54')]['id']}})[_0x39bb('0x26')](handleEntityNotFound(_0x1f2d02,null))[_0x39bb('0x26')](function(_0xc3226c){if(_0xc3226c){return _0xc3226c[_0x39bb('0x81')](_0x35df38[_0x39bb('0x4a')]['ids'],_[_0x39bb('0x82')](_0x35df38[_0x39bb('0x4a')],['ids','id'])||{})[_0x39bb('0x83')](function(_0x5a52e1){for(var _0x4ccd9b=0x0;_0x4ccd9b<_0x35df38['body'][_0x39bb('0x62')][_0x39bb('0x55')];_0x4ccd9b+=0x1){socket[_0x39bb('0x6c')](_0x39bb('0x6d'),{'UserId':Number(_0x35df38[_0x39bb('0x4a')][_0x39bb('0x62')][_0x4ccd9b]),'SmsQueueId':Number(_0x35df38['params']['id'])});}return _0x5a52e1;});}})['then'](respondWithResult(_0x1f2d02,null))[_0x39bb('0x48')](handleError(_0x1f2d02,null));};exports[_0x39bb('0x7e')]=function(_0x5af612,_0x16e2b3,_0x53d344){return db[_0x39bb('0x41')][_0x39bb('0x50')]({'where':{'id':_0x5af612[_0x39bb('0x54')]['id']}})[_0x39bb('0x26')](handleEntityNotFound(_0x16e2b3,null))[_0x39bb('0x26')](function(_0x48db9d){if(_0x48db9d){return _0x48db9d[_0x39bb('0x7e')](_0x5af612[_0x39bb('0x35')]['ids'])['then'](function(){if(_[_0x39bb('0x84')](_0x5af612[_0x39bb('0x35')][_0x39bb('0x62')])){for(var _0x237040=0x0;_0x237040<_0x5af612['query'][_0x39bb('0x62')]['length'];_0x237040+=0x1){socket[_0x39bb('0x6c')](_0x39bb('0x80'),{'UserId':Number(_0x5af612['query'][_0x39bb('0x62')][_0x237040]),'SmsQueueId':Number(_0x5af612[_0x39bb('0x54')]['id'])});}}else{socket[_0x39bb('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x5af612[_0x39bb('0x35')][_0x39bb('0x62')]),'SmsQueueId':Number(_0x5af612[_0x39bb('0x54')]['id'])});}});}})[_0x39bb('0x26')](respondWithStatusCode(_0x16e2b3,null))['catch'](handleError(_0x16e2b3,null));};exports[_0x39bb('0x85')]=function(_0x3dd6ac,_0xac48c2,_0x48e8a0){var _0x2d23ab={};var _0x22001e={};var _0x3d2598;var _0x17c6fb;return db['SmsQueue'][_0x39bb('0x60')]({'where':{'id':_0x3dd6ac[_0x39bb('0x54')]['id']}})['then'](handleEntityNotFound(_0xac48c2,null))[_0x39bb('0x26')](function(_0x2c15f4){if(_0x2c15f4){_0x3d2598=_0x2c15f4;_0x22001e[_0x39bb('0x33')]=_[_0x39bb('0x34')](db[_0x39bb('0x58')]['rawAttributes']);_0x22001e[_0x39bb('0x35')]=_['keys'](_0x3dd6ac[_0x39bb('0x35')]);_0x22001e['filters']=_[_0x39bb('0x37')](_0x22001e[_0x39bb('0x33')],_0x22001e[_0x39bb('0x35')]);_0x2d23ab[_0x39bb('0x38')]=_[_0x39bb('0x37')](_0x22001e[_0x39bb('0x33')],qs['fields'](_0x3dd6ac[_0x39bb('0x35')][_0x39bb('0x47')]));_0x2d23ab[_0x39bb('0x38')]=_0x2d23ab['attributes']['length']?_0x2d23ab[_0x39bb('0x38')]:_0x22001e['model'];_0x2d23ab[_0x39bb('0x3a')]=qs['sort'](_0x3dd6ac[_0x39bb('0x35')][_0x39bb('0x3b')]);_0x2d23ab[_0x39bb('0x3c')]=qs['filters'](_[_0x39bb('0x3d')](_0x3dd6ac[_0x39bb('0x35')],_0x22001e['filters']));if(_0x3dd6ac[_0x39bb('0x35')]['filter']){_0x2d23ab[_0x39bb('0x3c')]=_[_0x39bb('0x3f')](_0x2d23ab[_0x39bb('0x3c')],{'$or':_[_0x39bb('0x2f')](_0x2d23ab[_0x39bb('0x38')],function(_0x2b7051){var _0x5777cf={};_0x5777cf[_0x2b7051]={'$like':'%'+_0x3dd6ac[_0x39bb('0x35')]['filter']+'%'};return _0x5777cf;})});}_0x2d23ab=_[_0x39bb('0x3f')]({},_0x2d23ab,_0x3dd6ac['options']);return _0x3d2598[_0x39bb('0x85')](_0x2d23ab);}})[_0x39bb('0x26')](function(_0x14ef2f){if(_0x14ef2f){_0x17c6fb=_0x14ef2f[_0x39bb('0x55')];if(!_0x3dd6ac[_0x39bb('0x35')]['hasOwnProperty'](_0x39bb('0x39'))){_0x2d23ab[_0x39bb('0x23')]=qs[_0x39bb('0x23')](_0x3dd6ac['query'][_0x39bb('0x23')]);_0x2d23ab['offset']=qs[_0x39bb('0x21')](_0x3dd6ac[_0x39bb('0x35')][_0x39bb('0x21')]);}return _0x3d2598[_0x39bb('0x85')](_0x2d23ab);}})[_0x39bb('0x26')](function(_0x454baa){if(_0x454baa){return _0x454baa?{'count':_0x17c6fb,'rows':_0x454baa}:null;}})[_0x39bb('0x26')](respondWithResult(_0xac48c2,null))[_0x39bb('0x48')](handleError(_0xac48c2,null));}; \ No newline at end of file +var _0xae37=['body','destroy','describe','getMembers','UserSmsQueue','order','pick','SmsQueueId','User','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','userSmsQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','compact','value','isEmpty','emit','addAgents','spread','removeAgents','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','SmsQueues','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','options','SmsQueue','includeAll','findAll','rows','catch','show','params','include','merge','find','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x31a9e9,_0x2d1543){var _0x339cf2=function(_0x3dddf6){while(--_0x3dddf6){_0x31a9e9['push'](_0x31a9e9['shift']());}};_0x339cf2(++_0x2d1543);}(_0xae37,0xc3));var _0x7ae3=function(_0x2b70df,_0x224881){_0x2b70df=_0x2b70df-0x0;var _0x44b705=_0xae37[_0x2b70df];return _0x44b705;};'use strict';var emlformat=require(_0x7ae3('0x0'));var rimraf=require(_0x7ae3('0x1'));var zipdir=require(_0x7ae3('0x2'));var jsonpatch=require(_0x7ae3('0x3'));var rp=require(_0x7ae3('0x4'));var moment=require('moment');var BPromise=require(_0x7ae3('0x5'));var Mustache=require(_0x7ae3('0x6'));var util=require(_0x7ae3('0x7'));var path=require(_0x7ae3('0x8'));var sox=require(_0x7ae3('0x9'));var csv=require(_0x7ae3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ae3('0xb'));var _=require(_0x7ae3('0xc'));var squel=require('squel');var crypto=require(_0x7ae3('0xd'));var jsforce=require(_0x7ae3('0xe'));var deskjs=require(_0x7ae3('0xf'));var toCsv=require(_0x7ae3('0xa'));var querystring=require(_0x7ae3('0x10'));var Papa=require(_0x7ae3('0x11'));var Redis=require(_0x7ae3('0x12'));var authService=require(_0x7ae3('0x13'));var qs=require(_0x7ae3('0x14'));var as=require(_0x7ae3('0x15'));var hardwareService=require(_0x7ae3('0x16'));var logger=require(_0x7ae3('0x17'))(_0x7ae3('0x18'));var utils=require(_0x7ae3('0x19'));var config=require(_0x7ae3('0x1a'));var licenseUtil=require(_0x7ae3('0x1b'));var db=require('../../mysqldb')['db'];config[_0x7ae3('0x1c')]=_['defaults'](config[_0x7ae3('0x1c')],{'host':_0x7ae3('0x1d'),'port':0x18eb});var socket=require(_0x7ae3('0x1e'))(new Redis(config['redis']));require(_0x7ae3('0x1f'))[_0x7ae3('0x20')](socket);function respondWithStatusCode(_0x5e09f5,_0xd79a84){_0xd79a84=_0xd79a84||0xcc;return function(_0x925e03){if(_0x925e03){return _0x5e09f5[_0x7ae3('0x21')](_0xd79a84);}return _0x5e09f5[_0x7ae3('0x22')](_0xd79a84)['end']();};}function respondWithResult(_0x4277df,_0x51bee4){_0x51bee4=_0x51bee4||0xc8;return function(_0x44f83a){if(_0x44f83a){return _0x4277df['status'](_0x51bee4)[_0x7ae3('0x23')](_0x44f83a);}};}function respondWithFilteredResult(_0x3203ca,_0x4da70a){return function(_0xea8ea4){if(_0xea8ea4){var _0x1037e9=typeof _0x4da70a[_0x7ae3('0x24')]===_0x7ae3('0x25')&&typeof _0x4da70a[_0x7ae3('0x26')]==='undefined';var _0xf8a129=_0xea8ea4[_0x7ae3('0x27')];var _0x543bb7=_0x1037e9?0x0:_0x4da70a[_0x7ae3('0x24')];var _0x1f8c75=_0x1037e9?_0xea8ea4['count']:_0x4da70a[_0x7ae3('0x24')]+_0x4da70a[_0x7ae3('0x26')];var _0x396a6e;if(_0x1f8c75>=_0xf8a129){_0x1f8c75=_0xf8a129;_0x396a6e=0xc8;}else{_0x396a6e=0xce;}_0x3203ca[_0x7ae3('0x22')](_0x396a6e);return _0x3203ca[_0x7ae3('0x28')](_0x7ae3('0x29'),_0x543bb7+'-'+_0x1f8c75+'/'+_0xf8a129)['json'](_0xea8ea4);}return null;};}function patchUpdates(_0x389f61){return function(_0x2d5a7e){try{jsonpatch[_0x7ae3('0x2a')](_0x2d5a7e,_0x389f61,!![]);}catch(_0x2cd8b7){return BPromise[_0x7ae3('0x2b')](_0x2cd8b7);}return _0x2d5a7e[_0x7ae3('0x2c')]();};}function saveUpdates(_0x2756ed,_0x4a57fd){return function(_0x5a7ed5){if(_0x5a7ed5){return _0x5a7ed5[_0x7ae3('0x2d')](_0x2756ed)[_0x7ae3('0x2e')](function(_0x2a0349){return _0x2a0349;});}return null;};}function removeEntity(_0x13362b,_0x3f7ba3){return function(_0x54f49f){if(_0x54f49f){return _0x54f49f['destroy']()[_0x7ae3('0x2e')](function(){var _0x22af74=_0x54f49f[_0x7ae3('0x2f')]({'plain':!![]});var _0x2dbb00=_0x7ae3('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x2dbb00,'resourceId':_0x22af74['id']}})['then'](function(){return _0x54f49f;});})[_0x7ae3('0x2e')](function(){_0x13362b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0805,_0x572ad4){return function(_0x363aa3){if(!_0x363aa3){_0x2b0805[_0x7ae3('0x21')](0x194);}return _0x363aa3;};}function handleError(_0x443398,_0x4d665d){_0x4d665d=_0x4d665d||0x1f4;return function(_0x36c10c){logger[_0x7ae3('0x31')](_0x36c10c[_0x7ae3('0x32')]);if(_0x36c10c[_0x7ae3('0x33')]){delete _0x36c10c[_0x7ae3('0x33')];}_0x443398[_0x7ae3('0x22')](_0x4d665d)[_0x7ae3('0x34')](_0x36c10c);};}exports['index']=function(_0x2d894e,_0x2ba758){var _0xe8fd8f={},_0x51fc39={},_0x4808c4={'count':0x0,'rows':[]};var _0x18743c=_['map'](db['SmsQueue'][_0x7ae3('0x35')],function(_0x53d5f4){return{'name':_0x53d5f4[_0x7ae3('0x36')],'type':_0x53d5f4[_0x7ae3('0x37')][_0x7ae3('0x38')]};});_0x51fc39['model']=_[_0x7ae3('0x39')](_0x18743c,_0x7ae3('0x33'));_0x51fc39[_0x7ae3('0x3a')]=_[_0x7ae3('0x3b')](_0x2d894e[_0x7ae3('0x3a')]);_0x51fc39[_0x7ae3('0x3c')]=_[_0x7ae3('0x3d')](_0x51fc39[_0x7ae3('0x3e')],_0x51fc39[_0x7ae3('0x3a')]);_0xe8fd8f[_0x7ae3('0x3f')]=_[_0x7ae3('0x3d')](_0x51fc39[_0x7ae3('0x3e')],qs[_0x7ae3('0x40')](_0x2d894e['query']['fields']));_0xe8fd8f['attributes']=_0xe8fd8f['attributes'][_0x7ae3('0x41')]?_0xe8fd8f[_0x7ae3('0x3f')]:_0x51fc39[_0x7ae3('0x3e')];if(!_0x2d894e['query'][_0x7ae3('0x42')](_0x7ae3('0x43'))){_0xe8fd8f['limit']=qs[_0x7ae3('0x26')](_0x2d894e[_0x7ae3('0x3a')]['limit']);_0xe8fd8f[_0x7ae3('0x24')]=qs[_0x7ae3('0x24')](_0x2d894e[_0x7ae3('0x3a')][_0x7ae3('0x24')]);}_0xe8fd8f['order']=qs[_0x7ae3('0x44')](_0x2d894e['query'][_0x7ae3('0x44')]);_0xe8fd8f['where']=qs[_0x7ae3('0x3c')](_['pick'](_0x2d894e[_0x7ae3('0x3a')],_0x51fc39[_0x7ae3('0x3c')]),_0x18743c);if(_0x2d894e[_0x7ae3('0x3a')][_0x7ae3('0x45')]){_0xe8fd8f[_0x7ae3('0x46')]=_['merge'](_0xe8fd8f[_0x7ae3('0x46')],{'$or':_[_0x7ae3('0x39')](_0x18743c,function(_0x4f6d13){if(_0x4f6d13[_0x7ae3('0x37')]!=='VIRTUAL'){var _0x522452={};_0x522452[_0x4f6d13[_0x7ae3('0x33')]]={'$like':'%'+_0x2d894e[_0x7ae3('0x3a')][_0x7ae3('0x45')]+'%'};return _0x522452;}})});}_0xe8fd8f=_['merge']({},_0xe8fd8f,_0x2d894e[_0x7ae3('0x47')]);var _0x52f600={'where':_0xe8fd8f[_0x7ae3('0x46')]};return db[_0x7ae3('0x48')][_0x7ae3('0x27')](_0x52f600)['then'](function(_0x591947){_0x4808c4[_0x7ae3('0x27')]=_0x591947;if(_0x2d894e['query'][_0x7ae3('0x49')]){_0xe8fd8f['include']=[{'all':!![]}];}return db[_0x7ae3('0x48')][_0x7ae3('0x4a')](_0xe8fd8f);})[_0x7ae3('0x2e')](function(_0x266a9a){_0x4808c4[_0x7ae3('0x4b')]=_0x266a9a;return _0x4808c4;})['then'](respondWithFilteredResult(_0x2ba758,_0xe8fd8f))[_0x7ae3('0x4c')](handleError(_0x2ba758,null));};exports[_0x7ae3('0x4d')]=function(_0x105775,_0x2b2772){var _0x21dbdb={'raw':!![],'where':{'id':_0x105775[_0x7ae3('0x4e')]['id']}},_0x56d881={};_0x56d881[_0x7ae3('0x3e')]=_[_0x7ae3('0x3b')](db[_0x7ae3('0x48')][_0x7ae3('0x35')]);_0x56d881['query']=_[_0x7ae3('0x3b')](_0x105775[_0x7ae3('0x3a')]);_0x56d881['filters']=_[_0x7ae3('0x3d')](_0x56d881[_0x7ae3('0x3e')],_0x56d881[_0x7ae3('0x3a')]);_0x21dbdb[_0x7ae3('0x3f')]=_[_0x7ae3('0x3d')](_0x56d881[_0x7ae3('0x3e')],qs[_0x7ae3('0x40')](_0x105775[_0x7ae3('0x3a')]['fields']));_0x21dbdb['attributes']=_0x21dbdb[_0x7ae3('0x3f')][_0x7ae3('0x41')]?_0x21dbdb[_0x7ae3('0x3f')]:_0x56d881[_0x7ae3('0x3e')];if(_0x105775[_0x7ae3('0x3a')][_0x7ae3('0x49')]){_0x21dbdb[_0x7ae3('0x4f')]=[{'all':!![]}];}_0x21dbdb=_[_0x7ae3('0x50')]({},_0x21dbdb,_0x105775['options']);return db[_0x7ae3('0x48')][_0x7ae3('0x51')](_0x21dbdb)[_0x7ae3('0x2e')](handleEntityNotFound(_0x2b2772,null))[_0x7ae3('0x2e')](respondWithResult(_0x2b2772,null))[_0x7ae3('0x4c')](handleError(_0x2b2772,null));};exports[_0x7ae3('0x52')]=function(_0x5a4be6,_0x1b6497){return db['SmsQueue'][_0x7ae3('0x52')](_0x5a4be6['body'],{})[_0x7ae3('0x2e')](function(_0x1d415f){var _0x5d608a=_0x5a4be6[_0x7ae3('0x53')][_0x7ae3('0x2f')]({'plain':!![]});if(!_0x5d608a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d608a['role']==='user'){var _0x44c9de=_0x1d415f[_0x7ae3('0x2f')]({'plain':!![]});var _0x3f769f=_0x7ae3('0x30');return db[_0x7ae3('0x54')]['find']({'where':{'name':_0x3f769f,'userProfileId':_0x5d608a[_0x7ae3('0x55')]},'raw':!![]})['then'](function(_0xd8b752){if(_0xd8b752&&_0xd8b752[_0x7ae3('0x56')]===0x0){return db[_0x7ae3('0x57')][_0x7ae3('0x52')]({'name':_0x44c9de['name'],'resourceId':_0x44c9de['id'],'type':_0xd8b752[_0x7ae3('0x33')],'sectionId':_0xd8b752['id']},{})[_0x7ae3('0x2e')](function(){return _0x1d415f;});}else{return _0x1d415f;}})[_0x7ae3('0x4c')](function(_0x521bb5){logger['error'](_0x7ae3('0x58'),_0x521bb5);throw _0x521bb5;});}return _0x1d415f;})[_0x7ae3('0x2e')](respondWithResult(_0x1b6497,0xc9))[_0x7ae3('0x4c')](handleError(_0x1b6497,null));};exports[_0x7ae3('0x2d')]=function(_0xd5a382,_0x325192){if(_0xd5a382[_0x7ae3('0x59')]['id']){delete _0xd5a382[_0x7ae3('0x59')]['id'];}return db[_0x7ae3('0x48')][_0x7ae3('0x51')]({'where':{'id':_0xd5a382[_0x7ae3('0x4e')]['id']}})[_0x7ae3('0x2e')](handleEntityNotFound(_0x325192,null))[_0x7ae3('0x2e')](saveUpdates(_0xd5a382[_0x7ae3('0x59')],null))[_0x7ae3('0x2e')](respondWithResult(_0x325192,null))[_0x7ae3('0x4c')](handleError(_0x325192,null));};exports[_0x7ae3('0x5a')]=function(_0x451859,_0x512e74){return db[_0x7ae3('0x48')][_0x7ae3('0x51')]({'where':{'id':_0x451859[_0x7ae3('0x4e')]['id']}})[_0x7ae3('0x2e')](handleEntityNotFound(_0x512e74,null))['then'](removeEntity(_0x512e74,null))[_0x7ae3('0x4c')](handleError(_0x512e74,null));};exports['describe']=function(_0x39dad6,_0x3bf503){return db[_0x7ae3('0x48')][_0x7ae3('0x5b')]()['then'](respondWithResult(_0x3bf503,null))['catch'](handleError(_0x3bf503,null));};exports[_0x7ae3('0x5c')]=function(_0x3ffa90,_0x4df384,_0x44c346){var _0x2f1bfb={'raw':!![],'where':{}},_0x2b63c1={},_0x3b5992;return db[_0x7ae3('0x48')]['findOne']({'where':{'id':_0x3ffa90[_0x7ae3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4df384,null))[_0x7ae3('0x2e')](function(_0x57ab72){if(_0x57ab72){_0x3b5992=_0x57ab72[_0x7ae3('0x2f')]({'plain':!![]});_0x2b63c1['model']=_[_0x7ae3('0x3b')](db[_0x7ae3('0x5d')][_0x7ae3('0x35')]);_0x2b63c1['query']=_['keys'](_0x3ffa90[_0x7ae3('0x3a')]);_0x2b63c1[_0x7ae3('0x3c')]=_[_0x7ae3('0x3d')](_0x2b63c1['model'],_0x2b63c1[_0x7ae3('0x3a')]);_0x2f1bfb[_0x7ae3('0x3f')]=_[_0x7ae3('0x3d')](_0x2b63c1[_0x7ae3('0x3e')],qs['fields'](_0x3ffa90[_0x7ae3('0x3a')][_0x7ae3('0x40')]));_0x2f1bfb['attributes']=_0x2f1bfb[_0x7ae3('0x3f')][_0x7ae3('0x41')]?_0x2f1bfb[_0x7ae3('0x3f')]:_0x2b63c1[_0x7ae3('0x3e')];if(!_0x3ffa90[_0x7ae3('0x3a')]['hasOwnProperty'](_0x7ae3('0x43'))){_0x2f1bfb['limit']=qs['limit'](_0x3ffa90[_0x7ae3('0x3a')][_0x7ae3('0x26')]);_0x2f1bfb[_0x7ae3('0x24')]=qs[_0x7ae3('0x24')](_0x3ffa90[_0x7ae3('0x3a')]['offset']);}_0x2f1bfb[_0x7ae3('0x5e')]=qs[_0x7ae3('0x44')](_0x3ffa90[_0x7ae3('0x3a')]['sort']);_0x2f1bfb[_0x7ae3('0x46')]=qs[_0x7ae3('0x3c')](_[_0x7ae3('0x5f')](_0x3ffa90[_0x7ae3('0x3a')],_0x2b63c1[_0x7ae3('0x3c')]));_0x2f1bfb[_0x7ae3('0x46')][_0x7ae3('0x60')]=_0x57ab72['id'];if(_0x3ffa90[_0x7ae3('0x3a')][_0x7ae3('0x45')]){_0x2f1bfb[_0x7ae3('0x46')]=_[_0x7ae3('0x50')](_0x2f1bfb[_0x7ae3('0x46')],{'$or':_[_0x7ae3('0x39')](_0x2f1bfb[_0x7ae3('0x3f')],function(_0x1b6638){var _0x3ab292={};_0x3ab292[_0x1b6638]={'$like':'%'+_0x3ffa90[_0x7ae3('0x3a')]['filter']+'%'};return _0x3ab292;})});}_0x2f1bfb=_[_0x7ae3('0x50')]({},_0x2f1bfb,_0x3ffa90['options']);return db[_0x7ae3('0x5d')][_0x7ae3('0x4a')](_0x2f1bfb);}})[_0x7ae3('0x2e')](function(_0x50c2a1){if(_0x50c2a1){return db[_0x7ae3('0x61')]['findAndCountAll']({'where':{'id':_[_0x7ae3('0x39')](_0x50c2a1,_0x7ae3('0x62')),'role':_0x7ae3('0x63')},'attributes':['id',_0x7ae3('0x33'),_0x7ae3('0x64'),'updatedAt',_0x7ae3('0x65')]});}})[_0x7ae3('0x2e')](function(_0x3a51e3){if(_0x3a51e3){return{'count':_0x3a51e3[_0x7ae3('0x27')],'rows':_['map'](_0x3a51e3['rows'],function(_0x19d454){return{'membername':_0x19d454[_0x7ae3('0x33')],'UserId':_0x19d454['id'],'queue_name':_0x3b5992['name'],'SmsQueueId':_0x3b5992['id'],'interface':util[_0x7ae3('0x66')](_0x7ae3('0x67'),_0x7ae3('0x68'),_0x19d454[_0x7ae3('0x33')]),'penalty':0x0,'paused':_0x19d454['smsPause'],'createdAt':_0x19d454['createdAt'],'updatedAt':_0x19d454['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ae3('0x2e')](respondWithFilteredResult(_0x4df384,_0x2f1bfb))[_0x7ae3('0x4c')](handleError(_0x4df384,null));};exports[_0x7ae3('0x69')]=function(_0x4ddf1e,_0x579bb2,_0x2f1a44){var _0x5a37d3={};var _0x5a659e={};var _0x4f6d4f;var _0x28d7dc;return db[_0x7ae3('0x48')][_0x7ae3('0x6a')]({'where':{'id':_0x4ddf1e[_0x7ae3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x579bb2,null))[_0x7ae3('0x2e')](function(_0xf805b6){if(_0xf805b6){_0x4f6d4f=_0xf805b6;_0x5a659e['model']=_[_0x7ae3('0x3b')](db[_0x7ae3('0x6b')]['rawAttributes']);_0x5a659e['query']=_[_0x7ae3('0x3b')](_0x4ddf1e[_0x7ae3('0x3a')]);_0x5a659e[_0x7ae3('0x3c')]=_[_0x7ae3('0x3d')](_0x5a659e[_0x7ae3('0x3e')],_0x5a659e['query']);_0x5a37d3['attributes']=_[_0x7ae3('0x3d')](_0x5a659e[_0x7ae3('0x3e')],qs[_0x7ae3('0x40')](_0x4ddf1e['query'][_0x7ae3('0x40')]));_0x5a37d3[_0x7ae3('0x3f')]=_0x5a37d3[_0x7ae3('0x3f')][_0x7ae3('0x41')]?_0x5a37d3['attributes']:_0x5a659e['model'];_0x5a37d3[_0x7ae3('0x5e')]=qs[_0x7ae3('0x44')](_0x4ddf1e[_0x7ae3('0x3a')][_0x7ae3('0x44')]);_0x5a37d3[_0x7ae3('0x46')]=qs[_0x7ae3('0x3c')](_[_0x7ae3('0x5f')](_0x4ddf1e['query'],_0x5a659e[_0x7ae3('0x3c')]));if(_0x4ddf1e[_0x7ae3('0x3a')]['filter']){_0x5a37d3['where']=_['merge'](_0x5a37d3['where'],{'$or':_[_0x7ae3('0x39')](_0x5a37d3[_0x7ae3('0x3f')],function(_0x1383ea){var _0x554833={};_0x554833[_0x1383ea]={'$like':'%'+_0x4ddf1e['query'][_0x7ae3('0x45')]+'%'};return _0x554833;})});}_0x5a37d3=_['merge']({},_0x5a37d3,_0x4ddf1e[_0x7ae3('0x47')]);return _0x4f6d4f[_0x7ae3('0x69')](_0x5a37d3);}})[_0x7ae3('0x2e')](function(_0x13c96b){if(_0x13c96b){_0x28d7dc=_0x13c96b['length'];if(!_0x4ddf1e[_0x7ae3('0x3a')][_0x7ae3('0x42')](_0x7ae3('0x43'))){_0x5a37d3[_0x7ae3('0x26')]=qs[_0x7ae3('0x26')](_0x4ddf1e[_0x7ae3('0x3a')][_0x7ae3('0x26')]);_0x5a37d3[_0x7ae3('0x24')]=qs[_0x7ae3('0x24')](_0x4ddf1e[_0x7ae3('0x3a')][_0x7ae3('0x24')]);}return _0x4f6d4f[_0x7ae3('0x69')](_0x5a37d3);}})['then'](function(_0x1322e8){if(_0x1322e8){return _0x1322e8?{'count':_0x28d7dc,'rows':_0x1322e8}:null;}})[_0x7ae3('0x2e')](respondWithResult(_0x579bb2,null))[_0x7ae3('0x4c')](handleError(_0x579bb2,null));};exports[_0x7ae3('0x6c')]=function(_0x4924ab,_0x278122,_0x15cf40){var _0x365b58=_0x4924ab[_0x7ae3('0x59')][_0x7ae3('0x6d')];return db[_0x7ae3('0x6b')][_0x7ae3('0x4a')]({'where':{'id':_0x365b58},'attributes':['id'],'include':[{'model':db[_0x7ae3('0x61')],'as':_0x7ae3('0x6e'),'attributes':['id',_0x7ae3('0x33'),_0x7ae3('0x6f'),_0x7ae3('0x70'),'interface'],'raw':!![]}]})['then'](function(_0x4fbf83){if(_0x4fbf83){var _0x278be6=_[_0x7ae3('0x71')](_0x4fbf83,function(_0x5d1f13){var _0x21a190=_0x5d1f13[_0x7ae3('0x2f')]({'plain':!![]});return _0x21a190['Agents'];});return db[_0x7ae3('0x48')][_0x7ae3('0x51')]({'where':{'id':_0x4924ab[_0x7ae3('0x4e')]['id']}})['then'](function(_0x2783c0){return db[_0x7ae3('0x72')][_0x7ae3('0x73')](function(_0x27ff79){return _0x2783c0[_0x7ae3('0x6c')](_0x365b58,{'transaction':_0x27ff79})[_0x7ae3('0x2e')](function(){return BPromise['each'](_0x278be6,function(_0x3d8295){return db[_0x7ae3('0x5d')][_0x7ae3('0x74')]({'where':{'UserId':_0x3d8295['id'],'SmsQueueId':_0x4924ab[_0x7ae3('0x4e')]['id']},'transaction':_0x27ff79});});})['then'](function(){_0x278be6[_0x7ae3('0x75')](function(_0x502008){socket['emit'](_0x7ae3('0x76'),{'UserId':_0x502008['id'],'SmsQueueId':_0x2783c0['id']});});});});});}})[_0x7ae3('0x2e')](respondWithStatusCode(_0x278122,null))[_0x7ae3('0x4c')](handleError(_0x278122,null));};exports[_0x7ae3('0x77')]=function(_0x4cb1d8,_0x2441fc,_0x3ae260){return db['Team'][_0x7ae3('0x4a')]({'where':{'id':_0x4cb1d8[_0x7ae3('0x3a')][_0x7ae3('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x7ae3('0x61')],'as':_0x7ae3('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x7ae3('0x2e')](handleEntityNotFound(_0x2441fc,null))[_0x7ae3('0x2e')](function(_0x477335){var _0xbcb35d=_['map'](_0x477335,'id');var _0xf84106=[];var _0x39f08e=[];var _0x1494f4=squel['select']();_0x1494f4[_0x7ae3('0x78')](_0x7ae3('0x79'))[_0x7ae3('0x7a')]('team_has_sms_queues','tq')[_0x7ae3('0x7b')](_0x7ae3('0x7c'),'ut',_0x7ae3('0x7d'))[_0x7ae3('0x46')](_0x7ae3('0x7e'),_0x4cb1d8[_0x7ae3('0x4e')]['id']);for(var _0x5a74b2=0x0;_0x5a74b2<_0x477335[_0x7ae3('0x41')];_0x5a74b2+=0x1){let _0x558ff3=_0x477335[_0x5a74b2];for(var _0x8bb70f=0x0;_0x8bb70f<_0x558ff3['Agents'][_0x7ae3('0x41')];_0x8bb70f+=0x1){let _0x55fc7d=_0x558ff3[_0x7ae3('0x6e')][_0x8bb70f];var _0x56eb07=_0x1494f4['clone']();_0x56eb07[_0x7ae3('0x46')](_0x7ae3('0x7f'),_0x55fc7d['id']);_0x39f08e[_0x7ae3('0x80')](db[_0x7ae3('0x72')][_0x7ae3('0x3a')](_0x56eb07['toString'](),{'type':db[_0x7ae3('0x72')]['QueryTypes'][_0x7ae3('0x81')]})[_0x7ae3('0x2e')](function(_0x484e35){if(_0x484e35[_0x7ae3('0x41')]===0x1){return _0x55fc7d['id'];}else{var _0x86c65d=_[_0x7ae3('0x82')](_['map'](_0x484e35,_0x7ae3('0x83')),function(_0xfa44f2){return _['includes'](_0xbcb35d,_0xfa44f2);});if(_0x86c65d){return _0x55fc7d['id'];}}}));}}return BPromise[_0x7ae3('0x84')](_0x39f08e)[_0x7ae3('0x2e')](function(_0x302306){_0xf84106=_(_0xf84106)['union'](_0x302306)[_0x7ae3('0x85')]()[_0x7ae3('0x86')]();return db[_0x7ae3('0x48')][_0x7ae3('0x51')]({'where':{'id':_0x4cb1d8['params']['id']}})[_0x7ae3('0x2e')](function(_0x4c1919){return db[_0x7ae3('0x72')][_0x7ae3('0x73')](function(_0x652a17){return _0x4c1919['removeTeams'](_0x4cb1d8['query']['ids'],{'transaction':_0x652a17})[_0x7ae3('0x2e')](function(){if(!_[_0x7ae3('0x87')](_0xf84106)){return _0x4c1919['removeAgents'](_0xf84106,{'transaction':_0x652a17});}})[_0x7ae3('0x2e')](function(){_0xf84106[_0x7ae3('0x75')](function(_0x35d196){socket[_0x7ae3('0x88')]('userSmsQueue:remove',{'UserId':_0x35d196,'SmsQueueId':_0x4c1919['id']});});});});});});})['then'](respondWithStatusCode(_0x2441fc,null))['catch'](handleError(_0x2441fc,null));};exports[_0x7ae3('0x89')]=function(_0x3f1ba8,_0xd53cee,_0x157bf0){return db[_0x7ae3('0x48')]['find']({'where':{'id':_0x3f1ba8['params']['id']}})[_0x7ae3('0x2e')](handleEntityNotFound(_0xd53cee,null))[_0x7ae3('0x2e')](function(_0x4a2968){if(_0x4a2968){return _0x4a2968[_0x7ae3('0x89')](_0x3f1ba8['body'][_0x7ae3('0x6d')],_['omit'](_0x3f1ba8[_0x7ae3('0x59')],[_0x7ae3('0x6d'),'id'])||{})[_0x7ae3('0x8a')](function(_0x31f402){for(var _0x599e48=0x0;_0x599e48<_0x3f1ba8['body'][_0x7ae3('0x6d')][_0x7ae3('0x41')];_0x599e48+=0x1){socket[_0x7ae3('0x88')](_0x7ae3('0x76'),{'UserId':Number(_0x3f1ba8['body']['ids'][_0x599e48]),'SmsQueueId':Number(_0x3f1ba8[_0x7ae3('0x4e')]['id'])});}return _0x31f402;});}})[_0x7ae3('0x2e')](respondWithResult(_0xd53cee,null))['catch'](handleError(_0xd53cee,null));};exports[_0x7ae3('0x8b')]=function(_0xbed121,_0x1a8742,_0x3d7c55){return db[_0x7ae3('0x48')]['find']({'where':{'id':_0xbed121['params']['id']}})[_0x7ae3('0x2e')](handleEntityNotFound(_0x1a8742,null))[_0x7ae3('0x2e')](function(_0xe7920c){if(_0xe7920c){return _0xe7920c[_0x7ae3('0x8b')](_0xbed121[_0x7ae3('0x3a')][_0x7ae3('0x6d')])[_0x7ae3('0x2e')](function(){if(_['isArray'](_0xbed121[_0x7ae3('0x3a')][_0x7ae3('0x6d')])){for(var _0x178f55=0x0;_0x178f55<_0xbed121[_0x7ae3('0x3a')][_0x7ae3('0x6d')][_0x7ae3('0x41')];_0x178f55+=0x1){socket[_0x7ae3('0x88')](_0x7ae3('0x8c'),{'UserId':Number(_0xbed121[_0x7ae3('0x3a')][_0x7ae3('0x6d')][_0x178f55]),'SmsQueueId':Number(_0xbed121['params']['id'])});}}else{socket[_0x7ae3('0x88')](_0x7ae3('0x8c'),{'UserId':Number(_0xbed121[_0x7ae3('0x3a')][_0x7ae3('0x6d')]),'SmsQueueId':Number(_0xbed121[_0x7ae3('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a8742,null))[_0x7ae3('0x4c')](handleError(_0x1a8742,null));};exports['getAgents']=function(_0x43648f,_0x5518d1,_0x238edd){var _0x4e5ddb={};var _0x479b54={};var _0x7b9634;var _0x9413bd;return db[_0x7ae3('0x48')][_0x7ae3('0x6a')]({'where':{'id':_0x43648f[_0x7ae3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5518d1,null))[_0x7ae3('0x2e')](function(_0x287532){if(_0x287532){_0x7b9634=_0x287532;_0x479b54[_0x7ae3('0x3e')]=_['keys'](db[_0x7ae3('0x61')]['rawAttributes']);_0x479b54[_0x7ae3('0x3a')]=_[_0x7ae3('0x3b')](_0x43648f[_0x7ae3('0x3a')]);_0x479b54['filters']=_[_0x7ae3('0x3d')](_0x479b54['model'],_0x479b54[_0x7ae3('0x3a')]);_0x4e5ddb[_0x7ae3('0x3f')]=_['intersection'](_0x479b54[_0x7ae3('0x3e')],qs[_0x7ae3('0x40')](_0x43648f['query'][_0x7ae3('0x40')]));_0x4e5ddb['attributes']=_0x4e5ddb[_0x7ae3('0x3f')]['length']?_0x4e5ddb[_0x7ae3('0x3f')]:_0x479b54['model'];_0x4e5ddb[_0x7ae3('0x5e')]=qs['sort'](_0x43648f[_0x7ae3('0x3a')][_0x7ae3('0x44')]);_0x4e5ddb['where']=qs['filters'](_[_0x7ae3('0x5f')](_0x43648f[_0x7ae3('0x3a')],_0x479b54['filters']));if(_0x43648f[_0x7ae3('0x3a')][_0x7ae3('0x45')]){_0x4e5ddb[_0x7ae3('0x46')]=_['merge'](_0x4e5ddb['where'],{'$or':_[_0x7ae3('0x39')](_0x4e5ddb[_0x7ae3('0x3f')],function(_0x1c6cbc){var _0x5760d7={};_0x5760d7[_0x1c6cbc]={'$like':'%'+_0x43648f[_0x7ae3('0x3a')][_0x7ae3('0x45')]+'%'};return _0x5760d7;})});}_0x4e5ddb=_[_0x7ae3('0x50')]({},_0x4e5ddb,_0x43648f[_0x7ae3('0x47')]);return _0x7b9634['getAgents'](_0x4e5ddb);}})[_0x7ae3('0x2e')](function(_0x157785){if(_0x157785){_0x9413bd=_0x157785[_0x7ae3('0x41')];if(!_0x43648f[_0x7ae3('0x3a')][_0x7ae3('0x42')]('nolimit')){_0x4e5ddb[_0x7ae3('0x26')]=qs[_0x7ae3('0x26')](_0x43648f[_0x7ae3('0x3a')][_0x7ae3('0x26')]);_0x4e5ddb[_0x7ae3('0x24')]=qs[_0x7ae3('0x24')](_0x43648f[_0x7ae3('0x3a')][_0x7ae3('0x24')]);}return _0x7b9634[_0x7ae3('0x8d')](_0x4e5ddb);}})[_0x7ae3('0x2e')](function(_0x179d71){if(_0x179d71){return _0x179d71?{'count':_0x9413bd,'rows':_0x179d71}:null;}})[_0x7ae3('0x2e')](respondWithResult(_0x5518d1,null))[_0x7ae3('0x4c')](handleError(_0x5518d1,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 3290422..7f94e56 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 _0x2f48=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners'];(function(_0x40e6fc,_0x47f703){var _0x12ea4a=function(_0x4c60c9){while(--_0x4c60c9){_0x40e6fc['push'](_0x40e6fc['shift']());}};_0x12ea4a(++_0x47f703);}(_0x2f48,0x96));var _0x82f4=function(_0x589cdd,_0x4c0fde){_0x589cdd=_0x589cdd-0x0;var _0x1e504c=_0x2f48[_0x589cdd];return _0x1e504c;};'use strict';var EventEmitter=require(_0x82f4('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x82f4('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x82f4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x82f4('0x3'),'afterDestroy':_0x82f4('0x4')};function emitEvent(_0x22f7ad){return function(_0xe02a1e,_0x45f6a7,_0x46f596){SmsQueueEvents['emit'](_0x22f7ad+':'+_0xe02a1e['id'],_0xe02a1e);SmsQueueEvents[_0x82f4('0x5')](_0x22f7ad,_0xe02a1e);_0x46f596(null);};}for(var e in events){if(events[_0x82f4('0x6')](e)){var event=events[e];SmsQueue[_0x82f4('0x7')](e,emitEvent(event));}}module[_0x82f4('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x02bb=['events','SmsQueue','save','emit','hook','exports'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x02bb,0xc0));var _0xb02b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x02bb[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xb02b('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xb02b('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb02b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e7034){return function(_0x33be6e,_0x52c834,_0x592126){SmsQueueEvents['emit'](_0x4e7034+':'+_0x33be6e['id'],_0x33be6e);SmsQueueEvents[_0xb02b('0x3')](_0x4e7034,_0x33be6e);_0x592126(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xb02b('0x4')](e,emitEvent(event));}}module[_0xb02b('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index bf186e8..f68ec63 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 _0xf681=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash'];(function(_0x4a6fb3,_0x449bde){var _0x37a465=function(_0x2cff2c){while(--_0x2cff2c){_0x4a6fb3['push'](_0x4a6fb3['shift']());}};_0x37a465(++_0x449bde);}(_0xf681,0x179));var _0x1f68=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf681[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1f68('0x0'));var util=require(_0x1f68('0x1'));var logger=require('../../config/logger')(_0x1f68('0x2'));var moment=require(_0x1f68('0x3'));var BPromise=require(_0x1f68('0x4'));var rp=require(_0x1f68('0x5'));var fs=require('fs');var path=require(_0x1f68('0x6'));var rimraf=require(_0x1f68('0x7'));var config=require(_0x1f68('0x8'));var attributes=require(_0x1f68('0x9'));module[_0x1f68('0xa')]=function(_0x373af5,_0x211d16){return _0x373af5[_0x1f68('0xb')](_0x1f68('0xc'),attributes,{'tableName':_0x1f68('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87de=['request-promise','path','rimraf','./smsQueue.attributes','exports','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x55c387,_0x25cf3d){var _0x21683d=function(_0x1a7f02){while(--_0x1a7f02){_0x55c387['push'](_0x55c387['shift']());}};_0x21683d(++_0x25cf3d);}(_0x87de,0x67));var _0xe87d=function(_0x150ddc,_0x5caf13){_0x150ddc=_0x150ddc-0x0;var _0x57db93=_0x87de[_0x150ddc];return _0x57db93;};'use strict';var _=require('lodash');var util=require(_0xe87d('0x0'));var logger=require(_0xe87d('0x1'))(_0xe87d('0x2'));var moment=require(_0xe87d('0x3'));var BPromise=require(_0xe87d('0x4'));var rp=require(_0xe87d('0x5'));var fs=require('fs');var path=require(_0xe87d('0x6'));var rimraf=require(_0xe87d('0x7'));var config=require('../../config/environment');var attributes=require(_0xe87d('0x8'));module[_0xe87d('0x9')]=function(_0x30f632,_0x18798e){return _0x30f632['define'](_0xe87d('0xa'),attributes,{'tableName':_0xe87d('0xb'),'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 27bf473..ba00e95 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 _0xb422=['../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','raw','options','where','attributes','limit','include','map','model','ShowSmsQueue','find','stringify','bluebird','../../mysqldb','../../config/logger'];(function(_0x441d6f,_0x126117){var _0x1c23a6=function(_0x47c41c){while(--_0x47c41c){_0x441d6f['push'](_0x441d6f['shift']());}};_0x1c23a6(++_0x126117);}(_0xb422,0x85));var _0x2b42=function(_0x4cd2aa,_0x19a600){_0x4cd2aa=_0x4cd2aa-0x0;var _0x2c2c7e=_0xb422[_0x4cd2aa];return _0x2c2c7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b42('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b42('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b42('0x2'))('rpc');var config=require(_0x2b42('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2b42('0x4')][_0x2b42('0x5')]({'port':0x232a});config[_0x2b42('0x6')]=_['defaults'](config[_0x2b42('0x6')],{'host':_0x2b42('0x7'),'port':0x18eb});var socket=require(_0x2b42('0x8'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x2b42('0x9')](socket);function respondWithRpcPromise(_0x5dc850,_0x132066,_0xcc84af){return new BPromise(function(_0x1dcab0,_0x1ec844){return client['request'](_0x5dc850,_0xcc84af)[_0x2b42('0xa')](function(_0x18f30b){logger['info'](_0x2b42('0xb'),_0x132066,_0x2b42('0xc'));logger[_0x2b42('0xd')](_0x2b42('0xe'),_0x132066,'request\x20sent',JSON['stringify'](_0x18f30b));if(_0x18f30b[_0x2b42('0xf')]){if(_0x18f30b[_0x2b42('0xf')]['code']===0x1f4){logger[_0x2b42('0xf')](_0x2b42('0xb'),_0x132066,_0x18f30b[_0x2b42('0xf')][_0x2b42('0x10')]);return _0x1ec844(_0x18f30b[_0x2b42('0xf')][_0x2b42('0x10')]);}logger[_0x2b42('0xf')](_0x2b42('0xb'),_0x132066,_0x18f30b[_0x2b42('0xf')][_0x2b42('0x10')]);return _0x1dcab0(_0x18f30b['error'][_0x2b42('0x10')]);}else{logger[_0x2b42('0x11')](_0x2b42('0xb'),_0x132066,_0x2b42('0xc'));_0x1dcab0(_0x18f30b[_0x2b42('0x12')][_0x2b42('0x10')]);}})[_0x2b42('0x13')](function(_0x4728f4){logger['error'](_0x2b42('0xb'),_0x132066,_0x4728f4);_0x1ec844(_0x4728f4);});});}exports[_0x2b42('0x14')]=function(_0x4d8f3e){var _0x732f9c=this;return new Promise(function(_0x5a8cc4,_0x38d41c){return db[_0x2b42('0x15')][_0x2b42('0x16')]({'raw':_0x4d8f3e['options']?_0x4d8f3e['options'][_0x2b42('0x17')]===undefined?!![]:![]:!![],'where':_0x4d8f3e[_0x2b42('0x18')]?_0x4d8f3e[_0x2b42('0x18')][_0x2b42('0x19')]||null:null,'attributes':_0x4d8f3e['options']?_0x4d8f3e[_0x2b42('0x18')][_0x2b42('0x1a')]||null:null,'limit':_0x4d8f3e['options']?_0x4d8f3e[_0x2b42('0x18')][_0x2b42('0x1b')]||null:null,'include':_0x4d8f3e[_0x2b42('0x18')]?_0x4d8f3e[_0x2b42('0x18')][_0x2b42('0x1c')]?_[_0x2b42('0x1d')](_0x4d8f3e['options'][_0x2b42('0x1c')],function(_0x319692){return{'model':db[_0x319692[_0x2b42('0x1e')]],'as':_0x319692['as'],'attributes':_0x319692[_0x2b42('0x1a')],'include':_0x319692[_0x2b42('0x1c')]?_[_0x2b42('0x1d')](_0x319692[_0x2b42('0x1c')],function(_0xd0ed7d){return{'model':db[_0xd0ed7d[_0x2b42('0x1e')]],'as':_0xd0ed7d['as'],'attributes':_0xd0ed7d[_0x2b42('0x1a')],'include':_0xd0ed7d[_0x2b42('0x1c')]?_['map'](_0xd0ed7d['include'],function(_0x162efa){return{'model':db[_0x162efa[_0x2b42('0x1e')]],'as':_0x162efa['as'],'attributes':_0x162efa[_0x2b42('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b42('0xa')](function(_0x4b43b0){logger[_0x2b42('0x11')](_0x2b42('0x14'),_0x4d8f3e);logger[_0x2b42('0xd')]('GetSmsQueue',_0x4d8f3e,JSON['stringify'](_0x4b43b0));_0x5a8cc4(_0x4b43b0);})[_0x2b42('0x13')](function(_0x15298d){logger[_0x2b42('0xf')](_0x2b42('0x14'),_0x15298d['message'],_0x4d8f3e);_0x38d41c(_0x732f9c[_0x2b42('0xf')](0x1f4,_0x15298d[_0x2b42('0x10')]));});});};exports[_0x2b42('0x1f')]=function(_0x5b4036){var _0x250388=this;return new Promise(function(_0x1a831c,_0x3e029d){return db[_0x2b42('0x15')][_0x2b42('0x20')]({'raw':_0x5b4036[_0x2b42('0x18')]?_0x5b4036[_0x2b42('0x18')][_0x2b42('0x17')]===undefined?!![]:![]:!![],'where':_0x5b4036[_0x2b42('0x18')]?_0x5b4036[_0x2b42('0x18')][_0x2b42('0x19')]||null:null,'attributes':_0x5b4036['options']?_0x5b4036[_0x2b42('0x18')]['attributes']||null:null,'include':_0x5b4036['options']?_0x5b4036[_0x2b42('0x18')][_0x2b42('0x1c')]?_['map'](_0x5b4036['options']['include'],function(_0xb8730){return{'model':db[_0xb8730[_0x2b42('0x1e')]],'as':_0xb8730['as'],'attributes':_0xb8730[_0x2b42('0x1a')],'include':_0xb8730['include']?_[_0x2b42('0x1d')](_0xb8730[_0x2b42('0x1c')],function(_0x5b538d){return{'model':db[_0x5b538d['model']],'as':_0x5b538d['as'],'attributes':_0x5b538d[_0x2b42('0x1a')],'include':_0x5b538d[_0x2b42('0x1c')]?_[_0x2b42('0x1d')](_0x5b538d['include'],function(_0x14fefe){return{'model':db[_0x14fefe[_0x2b42('0x1e')]],'as':_0x14fefe['as'],'attributes':_0x14fefe[_0x2b42('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b42('0xa')](function(_0x175367){logger['info'](_0x2b42('0x1f'),_0x5b4036);logger[_0x2b42('0xd')](_0x2b42('0x1f'),_0x5b4036,JSON[_0x2b42('0x21')](_0x175367));_0x1a831c(_0x175367);})[_0x2b42('0x13')](function(_0x27b219){logger[_0x2b42('0xf')](_0x2b42('0x1f'),_0x27b219[_0x2b42('0x10')],_0x5b4036);_0x3e029d(_0x250388[_0x2b42('0xf')](0x1f4,_0x27b219['message']));});});}; \ No newline at end of file +var _0x359a=['register','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetSmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','SmsQueue','find','ShowSmsQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsQueue.socket'];(function(_0x9d5442,_0x33e9ab){var _0x5331b1=function(_0x3fa4c6){while(--_0x3fa4c6){_0x9d5442['push'](_0x9d5442['shift']());}};_0x5331b1(++_0x33e9ab);}(_0x359a,0x8d));var _0xa359=function(_0x503211,_0x171a43){_0x503211=_0x503211-0x0;var _0x759245=_0x359a[_0x503211];return _0x759245;};'use strict';var _=require('lodash');var util=require(_0xa359('0x0'));var moment=require(_0xa359('0x1'));var BPromise=require(_0xa359('0x2'));var rs=require(_0xa359('0x3'));var fs=require('fs');var Redis=require(_0xa359('0x4'));var db=require(_0xa359('0x5'))['db'];var utils=require(_0xa359('0x6'));var logger=require('../../config/logger')(_0xa359('0x7'));var config=require(_0xa359('0x8'));var jayson=require(_0xa359('0x9'));var client=jayson['client'][_0xa359('0xa')]({'port':0x232a});config[_0xa359('0xb')]=_[_0xa359('0xc')](config[_0xa359('0xb')],{'host':_0xa359('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa359('0xb')]));require(_0xa359('0xe'))[_0xa359('0xf')](socket);function respondWithRpcPromise(_0x33e96a,_0x117af9,_0x4804ca){return new BPromise(function(_0x1e9057,_0x4464b7){return client['request'](_0x33e96a,_0x4804ca)[_0xa359('0x10')](function(_0x52444c){logger[_0xa359('0x11')](_0xa359('0x12'),_0x117af9,'request\x20sent');logger[_0xa359('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x117af9,_0xa359('0x14'),JSON['stringify'](_0x52444c));if(_0x52444c[_0xa359('0x15')]){if(_0x52444c[_0xa359('0x15')][_0xa359('0x16')]===0x1f4){logger[_0xa359('0x15')]('SmsQueue,\x20%s,\x20%s',_0x117af9,_0x52444c[_0xa359('0x15')]['message']);return _0x4464b7(_0x52444c[_0xa359('0x15')][_0xa359('0x17')]);}logger['error'](_0xa359('0x12'),_0x117af9,_0x52444c[_0xa359('0x15')][_0xa359('0x17')]);return _0x1e9057(_0x52444c['error'][_0xa359('0x17')]);}else{logger[_0xa359('0x11')](_0xa359('0x12'),_0x117af9,_0xa359('0x14'));_0x1e9057(_0x52444c[_0xa359('0x18')][_0xa359('0x17')]);}})['catch'](function(_0x199cef){logger[_0xa359('0x15')](_0xa359('0x12'),_0x117af9,_0x199cef);_0x4464b7(_0x199cef);});});}exports[_0xa359('0x19')]=function(_0x13346b){var _0x98c20a=this;return new Promise(function(_0x1bbe1f,_0x5cdc39){return db['SmsQueue'][_0xa359('0x1a')]({'raw':_0x13346b[_0xa359('0x1b')]?_0x13346b['options'][_0xa359('0x1c')]===undefined?!![]:![]:!![],'where':_0x13346b[_0xa359('0x1b')]?_0x13346b[_0xa359('0x1b')][_0xa359('0x1d')]||null:null,'attributes':_0x13346b[_0xa359('0x1b')]?_0x13346b[_0xa359('0x1b')][_0xa359('0x1e')]||null:null,'limit':_0x13346b[_0xa359('0x1b')]?_0x13346b['options'][_0xa359('0x1f')]||null:null,'include':_0x13346b[_0xa359('0x1b')]?_0x13346b[_0xa359('0x1b')]['include']?_[_0xa359('0x20')](_0x13346b['options'][_0xa359('0x21')],function(_0x3481ef){return{'model':db[_0x3481ef[_0xa359('0x22')]],'as':_0x3481ef['as'],'attributes':_0x3481ef[_0xa359('0x1e')],'include':_0x3481ef[_0xa359('0x21')]?_['map'](_0x3481ef[_0xa359('0x21')],function(_0x404ee2){return{'model':db[_0x404ee2[_0xa359('0x22')]],'as':_0x404ee2['as'],'attributes':_0x404ee2[_0xa359('0x1e')],'include':_0x404ee2[_0xa359('0x21')]?_[_0xa359('0x20')](_0x404ee2[_0xa359('0x21')],function(_0x1c8057){return{'model':db[_0x1c8057[_0xa359('0x22')]],'as':_0x1c8057['as'],'attributes':_0x1c8057[_0xa359('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa359('0x10')](function(_0x49dc9e){logger[_0xa359('0x11')](_0xa359('0x19'),_0x13346b);logger[_0xa359('0x13')]('GetSmsQueue',_0x13346b,JSON['stringify'](_0x49dc9e));_0x1bbe1f(_0x49dc9e);})[_0xa359('0x23')](function(_0x1d1eb1){logger[_0xa359('0x15')](_0xa359('0x19'),_0x1d1eb1[_0xa359('0x17')],_0x13346b);_0x5cdc39(_0x98c20a[_0xa359('0x15')](0x1f4,_0x1d1eb1[_0xa359('0x17')]));});});};exports['ShowSmsQueue']=function(_0x36045a){var _0x4a8bac=this;return new Promise(function(_0x3691cd,_0x5ea3d9){return db[_0xa359('0x24')][_0xa359('0x25')]({'raw':_0x36045a[_0xa359('0x1b')]?_0x36045a[_0xa359('0x1b')][_0xa359('0x1c')]===undefined?!![]:![]:!![],'where':_0x36045a[_0xa359('0x1b')]?_0x36045a[_0xa359('0x1b')]['where']||null:null,'attributes':_0x36045a[_0xa359('0x1b')]?_0x36045a['options'][_0xa359('0x1e')]||null:null,'include':_0x36045a[_0xa359('0x1b')]?_0x36045a['options'][_0xa359('0x21')]?_[_0xa359('0x20')](_0x36045a['options'][_0xa359('0x21')],function(_0x2dcf57){return{'model':db[_0x2dcf57[_0xa359('0x22')]],'as':_0x2dcf57['as'],'attributes':_0x2dcf57[_0xa359('0x1e')],'include':_0x2dcf57[_0xa359('0x21')]?_['map'](_0x2dcf57[_0xa359('0x21')],function(_0x480cb7){return{'model':db[_0x480cb7['model']],'as':_0x480cb7['as'],'attributes':_0x480cb7[_0xa359('0x1e')],'include':_0x480cb7['include']?_['map'](_0x480cb7[_0xa359('0x21')],function(_0x5a68ce){return{'model':db[_0x5a68ce[_0xa359('0x22')]],'as':_0x5a68ce['as'],'attributes':_0x5a68ce[_0xa359('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa359('0x10')](function(_0x349332){logger['info'](_0xa359('0x26'),_0x36045a);logger['debug'](_0xa359('0x26'),_0x36045a,JSON['stringify'](_0x349332));_0x3691cd(_0x349332);})[_0xa359('0x23')](function(_0x593bff){logger[_0xa359('0x15')](_0xa359('0x26'),_0x593bff['message'],_0x36045a);_0x5ea3d9(_0x4a8bac[_0xa359('0x15')](0x1f4,_0x593bff[_0xa359('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index af4d436..34c4587 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 _0xb503=['save','remove','update','removeListener','length','./smsQueue.events'];(function(_0x2135ae,_0x28385e){var _0x963da8=function(_0xebf295){while(--_0xebf295){_0x2135ae['push'](_0x2135ae['shift']());}};_0x963da8(++_0x28385e);}(_0xb503,0x1f1));var _0x3b50=function(_0x3df4b9,_0x528dd9){_0x3df4b9=_0x3df4b9-0x0;var _0x53d24f=_0xb503[_0x3df4b9];return _0x53d24f;};'use strict';var SmsQueueEvents=require(_0x3b50('0x0'));var events=[_0x3b50('0x1'),_0x3b50('0x2'),_0x3b50('0x3')];function createListener(_0x47a718,_0x462a88){return function(_0x1867c5){_0x462a88['emit'](_0x47a718,_0x1867c5);};}function removeListener(_0x5e5b9a,_0x20707e){return function(){SmsQueueEvents[_0x3b50('0x4')](_0x5e5b9a,_0x20707e);};}exports['register']=function(_0xacdebb){for(var _0x5185a6=0x0,_0x4d60ed=events[_0x3b50('0x5')];_0x5185a6<_0x4d60ed;_0x5185a6++){var _0x353289=events[_0x5185a6];var _0x1fbaa2=createListener('smsQueue:'+_0x353289,_0xacdebb);SmsQueueEvents['on'](_0x353289,_0x1fbaa2);}}; \ No newline at end of file +var _0xf6a2=['./smsQueue.events','save','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6a2,0x180));var _0x2f6a=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xf6a2[_0x33c9f8];return _0x2d7004;};'use strict';var SmsQueueEvents=require(_0x2f6a('0x0'));var events=[_0x2f6a('0x1'),'remove','update'];function createListener(_0x357a4d,_0x5ef4cb){return function(_0x3e304e){_0x5ef4cb['emit'](_0x357a4d,_0x3e304e);};}function removeListener(_0x2687a3,_0x5c79d9){return function(){SmsQueueEvents['removeListener'](_0x2687a3,_0x5c79d9);};}exports[_0x2f6a('0x2')]=function(_0x5af632){for(var _0x3f16b2=0x0,_0x57a0f3=events[_0x2f6a('0x3')];_0x3f16b2<_0x57a0f3;_0x3f16b2++){var _0x59d2c0=events[_0x3f16b2];var _0x3c1330=createListener('smsQueue:'+_0x59d2c0,_0x5af632);SmsQueueEvents['on'](_0x59d2c0,_0x3c1330);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1815b61..795a5e5 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 _0x484e=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x5499e2,_0x456d08){var _0x26a95d=function(_0x2ac91c){while(--_0x2ac91c){_0x5499e2['push'](_0x5499e2['shift']());}};_0x26a95d(++_0x456d08);}(_0x484e,0x194));var _0xe484=function(_0x25ff3d,_0x1a134a){_0x25ff3d=_0x25ff3d-0x0;var _0x5080d2=_0x484e[_0x25ff3d];return _0x5080d2;};'use strict';var multer=require('multer');var util=require(_0xe484('0x0'));var path=require(_0xe484('0x1'));var timeout=require(_0xe484('0x2'));var express=require(_0xe484('0x3'));var router=express[_0xe484('0x4')]();var fs_extra=require(_0xe484('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe484('0x6'));router[_0xe484('0x7')]('/',auth[_0xe484('0x8')](),controller['index']);router[_0xe484('0x7')](_0xe484('0x9'),auth[_0xe484('0x8')](),controller['describe']);router[_0xe484('0x7')](_0xe484('0xa'),auth[_0xe484('0x8')](),controller[_0xe484('0xb')]);router[_0xe484('0xc')]('/',auth['isAuthenticated'](),controller[_0xe484('0xd')]);router[_0xe484('0xe')](_0xe484('0xa'),auth[_0xe484('0x8')](),controller[_0xe484('0xf')]);router[_0xe484('0x10')]('/:id',auth[_0xe484('0x8')](),controller[_0xe484('0x11')]);module[_0xe484('0x12')]=router; \ No newline at end of file +var _0x8bf3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x11be4b,_0x4c3599){var _0x8eac3a=function(_0x4a2b29){while(--_0x4a2b29){_0x11be4b['push'](_0x11be4b['shift']());}};_0x8eac3a(++_0x4c3599);}(_0x8bf3,0x130));var _0x38bf=function(_0x226999,_0x434d8c){_0x226999=_0x226999-0x0;var _0x5115f6=_0x8bf3[_0x226999];return _0x5115f6;};'use strict';var multer=require(_0x38bf('0x0'));var util=require(_0x38bf('0x1'));var path=require(_0x38bf('0x2'));var timeout=require(_0x38bf('0x3'));var express=require(_0x38bf('0x4'));var router=express[_0x38bf('0x5')]();var fs_extra=require(_0x38bf('0x6'));var auth=require(_0x38bf('0x7'));var interaction=require(_0x38bf('0x8'));var config=require('../../config/environment');var controller=require(_0x38bf('0x9'));router[_0x38bf('0xa')]('/',auth[_0x38bf('0xb')](),controller['index']);router[_0x38bf('0xa')]('/describe',auth[_0x38bf('0xb')](),controller[_0x38bf('0xc')]);router[_0x38bf('0xa')](_0x38bf('0xd'),auth[_0x38bf('0xb')](),controller[_0x38bf('0xe')]);router[_0x38bf('0xf')]('/',auth[_0x38bf('0xb')](),controller[_0x38bf('0x10')]);router[_0x38bf('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x38bf('0x12')]);router[_0x38bf('0x13')](_0x38bf('0xd'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x14')]);module[_0x38bf('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 66ec7b9..79550be 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 _0x3f19=['STRING','DATE','sequelize'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x3f19,0x1f1));var _0x93f1=function(_0x49e68f,_0x21fa6b){_0x49e68f=_0x49e68f-0x0;var _0x351589=_0x3f19[_0x49e68f];return _0x351589;};'use strict';var moment=require('moment');var Sequelize=require(_0x93f1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x93f1('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x93f1('0x2')]},'leaveAt':{'type':Sequelize[_0x93f1('0x2')]},'acceptAt':{'type':Sequelize[_0x93f1('0x2')]},'exitAt':{'type':Sequelize[_0x93f1('0x2')]},'reason':{'type':Sequelize[_0x93f1('0x1')]}}; \ No newline at end of file +var _0x8dd6=['exports','STRING','DATE','moment'];(function(_0xc78b10,_0x3a9bee){var _0x2bfb46=function(_0x5ed586){while(--_0x5ed586){_0xc78b10['push'](_0xc78b10['shift']());}};_0x2bfb46(++_0x3a9bee);}(_0x8dd6,0x19f));var _0x68dd=function(_0x2720dc,_0x3bc562){_0x2720dc=_0x2720dc-0x0;var _0x38e243=_0x8dd6[_0x2720dc];return _0x38e243;};'use strict';var moment=require(_0x68dd('0x0'));var Sequelize=require('sequelize');module[_0x68dd('0x1')]={'uniqueid':{'type':Sequelize[_0x68dd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x68dd('0x2')]},'joinAt':{'type':Sequelize[_0x68dd('0x3')]},'leaveAt':{'type':Sequelize[_0x68dd('0x3')]},'acceptAt':{'type':Sequelize[_0x68dd('0x3')]},'exitAt':{'type':Sequelize[_0x68dd('0x3')]},'reason':{'type':Sequelize[_0x68dd('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d28da68..9ec166e 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 _0x5dca=['body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','find','create'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x5dca,0xe5));var _0xa5dc=function(_0x5aa8a1,_0x2e4580){_0x5aa8a1=_0x5aa8a1-0x0;var _0x4bc322=_0x5dca[_0x5aa8a1];return _0x4bc322;};'use strict';var emlformat=require(_0xa5dc('0x0'));var rimraf=require(_0xa5dc('0x1'));var zipdir=require(_0xa5dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5dc('0x3'));var moment=require(_0xa5dc('0x4'));var BPromise=require(_0xa5dc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa5dc('0x6'));var sox=require(_0xa5dc('0x7'));var csv=require(_0xa5dc('0x8'));var ejs=require(_0xa5dc('0x9'));var fs=require('fs');var fs_extra=require(_0xa5dc('0xa'));var _=require(_0xa5dc('0xb'));var squel=require(_0xa5dc('0xc'));var crypto=require('crypto');var jsforce=require(_0xa5dc('0xd'));var deskjs=require(_0xa5dc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa5dc('0xf'));var Papa=require(_0xa5dc('0x10'));var Redis=require(_0xa5dc('0x11'));var authService=require(_0xa5dc('0x12'));var qs=require(_0xa5dc('0x13'));var as=require(_0xa5dc('0x14'));var hardwareService=require(_0xa5dc('0x15'));var logger=require(_0xa5dc('0x16'))(_0xa5dc('0x17'));var utils=require('../../config/utils');var config=require(_0xa5dc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5dc('0x19'))['db'];function respondWithStatusCode(_0x3a5f83,_0x40c2ef){_0x40c2ef=_0x40c2ef||0xcc;return function(_0x3ca7c1){if(_0x3ca7c1){return _0x3a5f83[_0xa5dc('0x1a')](_0x40c2ef);}return _0x3a5f83[_0xa5dc('0x1b')](_0x40c2ef)[_0xa5dc('0x1c')]();};}function respondWithResult(_0x365ae1,_0x37653b){_0x37653b=_0x37653b||0xc8;return function(_0x25b239){if(_0x25b239){return _0x365ae1[_0xa5dc('0x1b')](_0x37653b)['json'](_0x25b239);}};}function respondWithFilteredResult(_0x477e58,_0x196838){return function(_0x1ea8f3){if(_0x1ea8f3){var _0x4ffbf7=typeof _0x196838['offset']===_0xa5dc('0x1d')&&typeof _0x196838[_0xa5dc('0x1e')]===_0xa5dc('0x1d');var _0x4c7b21=_0x1ea8f3['count'];var _0x4bd1f4=_0x4ffbf7?0x0:_0x196838[_0xa5dc('0x1f')];var _0x17bc49=_0x4ffbf7?_0x1ea8f3['count']:_0x196838[_0xa5dc('0x1f')]+_0x196838[_0xa5dc('0x1e')];var _0x54a1a0;if(_0x17bc49>=_0x4c7b21){_0x17bc49=_0x4c7b21;_0x54a1a0=0xc8;}else{_0x54a1a0=0xce;}_0x477e58['status'](_0x54a1a0);return _0x477e58[_0xa5dc('0x20')](_0xa5dc('0x21'),_0x4bd1f4+'-'+_0x17bc49+'/'+_0x4c7b21)[_0xa5dc('0x22')](_0x1ea8f3);}return null;};}function patchUpdates(_0x210242){return function(_0x25c698){try{jsonpatch['apply'](_0x25c698,_0x210242,!![]);}catch(_0x37925c){return BPromise[_0xa5dc('0x23')](_0x37925c);}return _0x25c698[_0xa5dc('0x24')]();};}function saveUpdates(_0x57051d,_0x35884){return function(_0x1097b7){if(_0x1097b7){return _0x1097b7[_0xa5dc('0x25')](_0x57051d)[_0xa5dc('0x26')](function(_0x42e034){return _0x42e034;});}return null;};}function removeEntity(_0x232c9b,_0x1e71a5){return function(_0x5391fd){if(_0x5391fd){return _0x5391fd['destroy']()[_0xa5dc('0x26')](function(){_0x232c9b[_0xa5dc('0x1b')](0xcc)[_0xa5dc('0x1c')]();});}};}function handleEntityNotFound(_0x1e99af,_0x461abc){return function(_0x48afae){if(!_0x48afae){_0x1e99af[_0xa5dc('0x1a')](0x194);}return _0x48afae;};}function handleError(_0x13f1df,_0x17687b){_0x17687b=_0x17687b||0x1f4;return function(_0x478644){logger[_0xa5dc('0x27')](_0x478644[_0xa5dc('0x28')]);if(_0x478644[_0xa5dc('0x29')]){delete _0x478644[_0xa5dc('0x29')];}_0x13f1df['status'](_0x17687b)[_0xa5dc('0x2a')](_0x478644);};}exports[_0xa5dc('0x2b')]=function(_0x39d48b,_0x2d991d){var _0x292b89={},_0x515e81={},_0x22ed17={'count':0x0,'rows':[]};var _0x1a42a6=_['map'](db[_0xa5dc('0x2c')][_0xa5dc('0x2d')],function(_0x5ee37d){return{'name':_0x5ee37d[_0xa5dc('0x2e')],'type':_0x5ee37d['type'][_0xa5dc('0x2f')]};});_0x515e81[_0xa5dc('0x30')]=_[_0xa5dc('0x31')](_0x1a42a6,_0xa5dc('0x29'));_0x515e81[_0xa5dc('0x32')]=_[_0xa5dc('0x33')](_0x39d48b[_0xa5dc('0x32')]);_0x515e81['filters']=_[_0xa5dc('0x34')](_0x515e81[_0xa5dc('0x30')],_0x515e81['query']);_0x292b89[_0xa5dc('0x35')]=_[_0xa5dc('0x34')](_0x515e81['model'],qs[_0xa5dc('0x36')](_0x39d48b['query'][_0xa5dc('0x36')]));_0x292b89[_0xa5dc('0x35')]=_0x292b89[_0xa5dc('0x35')]['length']?_0x292b89[_0xa5dc('0x35')]:_0x515e81[_0xa5dc('0x30')];if(!_0x39d48b[_0xa5dc('0x32')][_0xa5dc('0x37')](_0xa5dc('0x38'))){_0x292b89['limit']=qs[_0xa5dc('0x1e')](_0x39d48b[_0xa5dc('0x32')]['limit']);_0x292b89[_0xa5dc('0x1f')]=qs[_0xa5dc('0x1f')](_0x39d48b['query']['offset']);}_0x292b89[_0xa5dc('0x39')]=qs[_0xa5dc('0x3a')](_0x39d48b[_0xa5dc('0x32')][_0xa5dc('0x3a')]);_0x292b89[_0xa5dc('0x3b')]=qs[_0xa5dc('0x3c')](_['pick'](_0x39d48b[_0xa5dc('0x32')],_0x515e81['filters']),_0x1a42a6);if(_0x39d48b[_0xa5dc('0x32')]['filter']){_0x292b89[_0xa5dc('0x3b')]=_[_0xa5dc('0x3d')](_0x292b89[_0xa5dc('0x3b')],{'$or':_[_0xa5dc('0x31')](_0x1a42a6,function(_0x3c0e8a){if(_0x3c0e8a['type']!==_0xa5dc('0x3e')){var _0x30186c={};_0x30186c[_0x3c0e8a['name']]={'$like':'%'+_0x39d48b[_0xa5dc('0x32')][_0xa5dc('0x3f')]+'%'};return _0x30186c;}})});}_0x292b89=_[_0xa5dc('0x3d')]({},_0x292b89,_0x39d48b[_0xa5dc('0x40')]);var _0xb7b388={'where':_0x292b89[_0xa5dc('0x3b')]};return db[_0xa5dc('0x2c')]['count'](_0xb7b388)['then'](function(_0x3ea435){_0x22ed17['count']=_0x3ea435;if(_0x39d48b[_0xa5dc('0x32')][_0xa5dc('0x41')]){_0x292b89['include']=[{'all':!![]}];}return db[_0xa5dc('0x2c')][_0xa5dc('0x42')](_0x292b89);})[_0xa5dc('0x26')](function(_0x329efe){_0x22ed17[_0xa5dc('0x43')]=_0x329efe;return _0x22ed17;})[_0xa5dc('0x26')](respondWithFilteredResult(_0x2d991d,_0x292b89))[_0xa5dc('0x44')](handleError(_0x2d991d,null));};exports['show']=function(_0x16b735,_0x1111d7){var _0x51a69e={'raw':!![],'where':{'id':_0x16b735['params']['id']}},_0x4229eb={};_0x4229eb[_0xa5dc('0x30')]=_[_0xa5dc('0x33')](db[_0xa5dc('0x2c')][_0xa5dc('0x2d')]);_0x4229eb[_0xa5dc('0x32')]=_[_0xa5dc('0x33')](_0x16b735[_0xa5dc('0x32')]);_0x4229eb[_0xa5dc('0x3c')]=_[_0xa5dc('0x34')](_0x4229eb['model'],_0x4229eb['query']);_0x51a69e[_0xa5dc('0x35')]=_[_0xa5dc('0x34')](_0x4229eb[_0xa5dc('0x30')],qs[_0xa5dc('0x36')](_0x16b735[_0xa5dc('0x32')][_0xa5dc('0x36')]));_0x51a69e[_0xa5dc('0x35')]=_0x51a69e[_0xa5dc('0x35')]['length']?_0x51a69e[_0xa5dc('0x35')]:_0x4229eb[_0xa5dc('0x30')];if(_0x16b735[_0xa5dc('0x32')][_0xa5dc('0x41')]){_0x51a69e['include']=[{'all':!![]}];}_0x51a69e=_[_0xa5dc('0x3d')]({},_0x51a69e,_0x16b735[_0xa5dc('0x40')]);return db[_0xa5dc('0x2c')][_0xa5dc('0x45')](_0x51a69e)[_0xa5dc('0x26')](handleEntityNotFound(_0x1111d7,null))[_0xa5dc('0x26')](respondWithResult(_0x1111d7,null))[_0xa5dc('0x44')](handleError(_0x1111d7,null));};exports[_0xa5dc('0x46')]=function(_0x20c88d,_0xcba103){return db[_0xa5dc('0x2c')][_0xa5dc('0x46')](_0x20c88d[_0xa5dc('0x47')],{})[_0xa5dc('0x26')](respondWithResult(_0xcba103,0xc9))[_0xa5dc('0x44')](handleError(_0xcba103,null));};exports[_0xa5dc('0x25')]=function(_0x4f8b5c,_0x15830b){if(_0x4f8b5c[_0xa5dc('0x47')]['id']){delete _0x4f8b5c['body']['id'];}return db[_0xa5dc('0x2c')][_0xa5dc('0x45')]({'where':{'id':_0x4f8b5c['params']['id']}})['then'](handleEntityNotFound(_0x15830b,null))['then'](saveUpdates(_0x4f8b5c[_0xa5dc('0x47')],null))[_0xa5dc('0x26')](respondWithResult(_0x15830b,null))[_0xa5dc('0x44')](handleError(_0x15830b,null));};exports[_0xa5dc('0x48')]=function(_0x1f3772,_0x2c0459){return db[_0xa5dc('0x2c')][_0xa5dc('0x45')]({'where':{'id':_0x1f3772[_0xa5dc('0x49')]['id']}})[_0xa5dc('0x26')](handleEntityNotFound(_0x2c0459,null))[_0xa5dc('0x26')](removeEntity(_0x2c0459,null))[_0xa5dc('0x44')](handleError(_0x2c0459,null));};exports['describe']=function(_0x28b941,_0x52bd0a){return db[_0xa5dc('0x2c')][_0xa5dc('0x4a')]()[_0xa5dc('0x26')](respondWithResult(_0x52bd0a,null))[_0xa5dc('0x44')](handleError(_0x52bd0a,null));}; \ No newline at end of file +var _0x6270=['params','keys','intersection','length','options','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show'];(function(_0x2704fe,_0x101bb5){var _0x20f500=function(_0x53c3ab){while(--_0x53c3ab){_0x2704fe['push'](_0x2704fe['shift']());}};_0x20f500(++_0x101bb5);}(_0x6270,0xab));var _0x0627=function(_0x342cf3,_0x10f46f){_0x342cf3=_0x342cf3-0x0;var _0x385059=_0x6270[_0x342cf3];return _0x385059;};'use strict';var emlformat=require(_0x0627('0x0'));var rimraf=require(_0x0627('0x1'));var zipdir=require(_0x0627('0x2'));var jsonpatch=require(_0x0627('0x3'));var rp=require(_0x0627('0x4'));var moment=require(_0x0627('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0627('0x6'));var util=require(_0x0627('0x7'));var path=require(_0x0627('0x8'));var sox=require(_0x0627('0x9'));var csv=require(_0x0627('0xa'));var ejs=require(_0x0627('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0627('0xc'));var squel=require('squel');var crypto=require(_0x0627('0xd'));var jsforce=require(_0x0627('0xe'));var deskjs=require(_0x0627('0xf'));var toCsv=require(_0x0627('0xa'));var querystring=require('querystring');var Papa=require(_0x0627('0x10'));var Redis=require('ioredis');var authService=require(_0x0627('0x11'));var qs=require(_0x0627('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0627('0x13'));var logger=require(_0x0627('0x14'))('api');var utils=require(_0x0627('0x15'));var config=require(_0x0627('0x16'));var licenseUtil=require(_0x0627('0x17'));var db=require(_0x0627('0x18'))['db'];function respondWithStatusCode(_0x74edb8,_0x228420){_0x228420=_0x228420||0xcc;return function(_0x417cf9){if(_0x417cf9){return _0x74edb8[_0x0627('0x19')](_0x228420);}return _0x74edb8['status'](_0x228420)['end']();};}function respondWithResult(_0x1e8c05,_0x27147b){_0x27147b=_0x27147b||0xc8;return function(_0x6774e6){if(_0x6774e6){return _0x1e8c05[_0x0627('0x1a')](_0x27147b)[_0x0627('0x1b')](_0x6774e6);}};}function respondWithFilteredResult(_0x1b0048,_0x5e9479){return function(_0x8512ad){if(_0x8512ad){var _0x54005a=typeof _0x5e9479[_0x0627('0x1c')]===_0x0627('0x1d')&&typeof _0x5e9479[_0x0627('0x1e')]==='undefined';var _0x436b7c=_0x8512ad['count'];var _0x3b7fdf=_0x54005a?0x0:_0x5e9479[_0x0627('0x1c')];var _0x3c605b=_0x54005a?_0x8512ad[_0x0627('0x1f')]:_0x5e9479['offset']+_0x5e9479[_0x0627('0x1e')];var _0x69d135;if(_0x3c605b>=_0x436b7c){_0x3c605b=_0x436b7c;_0x69d135=0xc8;}else{_0x69d135=0xce;}_0x1b0048['status'](_0x69d135);return _0x1b0048['set'](_0x0627('0x20'),_0x3b7fdf+'-'+_0x3c605b+'/'+_0x436b7c)[_0x0627('0x1b')](_0x8512ad);}return null;};}function patchUpdates(_0x16da04){return function(_0x53ad3c){try{jsonpatch[_0x0627('0x21')](_0x53ad3c,_0x16da04,!![]);}catch(_0x5a1afb){return BPromise[_0x0627('0x22')](_0x5a1afb);}return _0x53ad3c[_0x0627('0x23')]();};}function saveUpdates(_0x4f79ac,_0x23ace8){return function(_0x2fc270){if(_0x2fc270){return _0x2fc270['update'](_0x4f79ac)['then'](function(_0x548b06){return _0x548b06;});}return null;};}function removeEntity(_0x5d9bd9,_0x288934){return function(_0x2d47aa){if(_0x2d47aa){return _0x2d47aa[_0x0627('0x24')]()[_0x0627('0x25')](function(){_0x5d9bd9[_0x0627('0x1a')](0xcc)[_0x0627('0x26')]();});}};}function handleEntityNotFound(_0x509cbd,_0x20e675){return function(_0x4a792d){if(!_0x4a792d){_0x509cbd[_0x0627('0x19')](0x194);}return _0x4a792d;};}function handleError(_0x88d904,_0x208885){_0x208885=_0x208885||0x1f4;return function(_0x293f4e){logger[_0x0627('0x27')](_0x293f4e[_0x0627('0x28')]);if(_0x293f4e[_0x0627('0x29')]){delete _0x293f4e['name'];}_0x88d904['status'](_0x208885)[_0x0627('0x2a')](_0x293f4e);};}exports[_0x0627('0x2b')]=function(_0xce6b60,_0x327a32){var _0x3e3de0={},_0x42fb86={},_0x5db8ed={'count':0x0,'rows':[]};var _0x5aec30=_[_0x0627('0x2c')](db[_0x0627('0x2d')][_0x0627('0x2e')],function(_0x305043){return{'name':_0x305043[_0x0627('0x2f')],'type':_0x305043[_0x0627('0x30')][_0x0627('0x31')]};});_0x42fb86[_0x0627('0x32')]=_['map'](_0x5aec30,_0x0627('0x29'));_0x42fb86[_0x0627('0x33')]=_['keys'](_0xce6b60['query']);_0x42fb86[_0x0627('0x34')]=_['intersection'](_0x42fb86[_0x0627('0x32')],_0x42fb86[_0x0627('0x33')]);_0x3e3de0[_0x0627('0x35')]=_['intersection'](_0x42fb86[_0x0627('0x32')],qs[_0x0627('0x36')](_0xce6b60[_0x0627('0x33')][_0x0627('0x36')]));_0x3e3de0['attributes']=_0x3e3de0[_0x0627('0x35')]['length']?_0x3e3de0['attributes']:_0x42fb86[_0x0627('0x32')];if(!_0xce6b60['query'][_0x0627('0x37')](_0x0627('0x38'))){_0x3e3de0[_0x0627('0x1e')]=qs[_0x0627('0x1e')](_0xce6b60[_0x0627('0x33')][_0x0627('0x1e')]);_0x3e3de0[_0x0627('0x1c')]=qs[_0x0627('0x1c')](_0xce6b60['query'][_0x0627('0x1c')]);}_0x3e3de0[_0x0627('0x39')]=qs[_0x0627('0x3a')](_0xce6b60[_0x0627('0x33')]['sort']);_0x3e3de0[_0x0627('0x3b')]=qs[_0x0627('0x34')](_[_0x0627('0x3c')](_0xce6b60[_0x0627('0x33')],_0x42fb86[_0x0627('0x34')]),_0x5aec30);if(_0xce6b60[_0x0627('0x33')]['filter']){_0x3e3de0[_0x0627('0x3b')]=_[_0x0627('0x3d')](_0x3e3de0['where'],{'$or':_[_0x0627('0x2c')](_0x5aec30,function(_0x1bd384){if(_0x1bd384['type']!==_0x0627('0x3e')){var _0x15afc6={};_0x15afc6[_0x1bd384[_0x0627('0x29')]]={'$like':'%'+_0xce6b60[_0x0627('0x33')][_0x0627('0x3f')]+'%'};return _0x15afc6;}})});}_0x3e3de0=_[_0x0627('0x3d')]({},_0x3e3de0,_0xce6b60['options']);var _0x525753={'where':_0x3e3de0['where']};return db[_0x0627('0x2d')][_0x0627('0x1f')](_0x525753)[_0x0627('0x25')](function(_0x1ad9b7){_0x5db8ed[_0x0627('0x1f')]=_0x1ad9b7;if(_0xce6b60[_0x0627('0x33')][_0x0627('0x40')]){_0x3e3de0[_0x0627('0x41')]=[{'all':!![]}];}return db[_0x0627('0x2d')][_0x0627('0x42')](_0x3e3de0);})[_0x0627('0x25')](function(_0x3f828f){_0x5db8ed[_0x0627('0x43')]=_0x3f828f;return _0x5db8ed;})['then'](respondWithFilteredResult(_0x327a32,_0x3e3de0))['catch'](handleError(_0x327a32,null));};exports[_0x0627('0x44')]=function(_0x481be0,_0x520554){var _0x37b83b={'raw':!![],'where':{'id':_0x481be0[_0x0627('0x45')]['id']}},_0x206d06={};_0x206d06[_0x0627('0x32')]=_['keys'](db[_0x0627('0x2d')]['rawAttributes']);_0x206d06[_0x0627('0x33')]=_[_0x0627('0x46')](_0x481be0[_0x0627('0x33')]);_0x206d06[_0x0627('0x34')]=_[_0x0627('0x47')](_0x206d06[_0x0627('0x32')],_0x206d06[_0x0627('0x33')]);_0x37b83b['attributes']=_[_0x0627('0x47')](_0x206d06[_0x0627('0x32')],qs[_0x0627('0x36')](_0x481be0[_0x0627('0x33')][_0x0627('0x36')]));_0x37b83b[_0x0627('0x35')]=_0x37b83b[_0x0627('0x35')][_0x0627('0x48')]?_0x37b83b[_0x0627('0x35')]:_0x206d06[_0x0627('0x32')];if(_0x481be0[_0x0627('0x33')]['includeAll']){_0x37b83b['include']=[{'all':!![]}];}_0x37b83b=_[_0x0627('0x3d')]({},_0x37b83b,_0x481be0[_0x0627('0x49')]);return db['SmsQueueReport'][_0x0627('0x4a')](_0x37b83b)['then'](handleEntityNotFound(_0x520554,null))[_0x0627('0x25')](respondWithResult(_0x520554,null))[_0x0627('0x4b')](handleError(_0x520554,null));};exports[_0x0627('0x4c')]=function(_0x50b47a,_0x4b3268){return db[_0x0627('0x2d')][_0x0627('0x4c')](_0x50b47a[_0x0627('0x4d')],{})[_0x0627('0x25')](respondWithResult(_0x4b3268,0xc9))[_0x0627('0x4b')](handleError(_0x4b3268,null));};exports[_0x0627('0x4e')]=function(_0x236d1a,_0x1e2dc1){if(_0x236d1a['body']['id']){delete _0x236d1a['body']['id'];}return db[_0x0627('0x2d')][_0x0627('0x4a')]({'where':{'id':_0x236d1a[_0x0627('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e2dc1,null))[_0x0627('0x25')](saveUpdates(_0x236d1a[_0x0627('0x4d')],null))[_0x0627('0x25')](respondWithResult(_0x1e2dc1,null))[_0x0627('0x4b')](handleError(_0x1e2dc1,null));};exports[_0x0627('0x24')]=function(_0x5631ca,_0x1edf48){return db[_0x0627('0x2d')][_0x0627('0x4a')]({'where':{'id':_0x5631ca[_0x0627('0x45')]['id']}})[_0x0627('0x25')](handleEntityNotFound(_0x1edf48,null))[_0x0627('0x25')](removeEntity(_0x1edf48,null))[_0x0627('0x4b')](handleError(_0x1edf48,null));};exports[_0x0627('0x4f')]=function(_0x330d74,_0x2ac4b5){return db[_0x0627('0x2d')][_0x0627('0x4f')]()[_0x0627('0x25')](respondWithResult(_0x2ac4b5,null))[_0x0627('0x4b')](handleError(_0x2ac4b5,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 4ef34e5..f8dec6d 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x176a76,_0xb5468c){var _0x4a5c00=function(_0x4c3860){while(--_0x4c3860){_0x176a76['push'](_0x176a76['shift']());}};_0x4a5c00(++_0xb5468c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));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 +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index f908d97..724fd8c 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 _0x91c1=['SmsQueueReport','update','where','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','body','options','UpdateSmsQueueReport'];(function(_0x227ea0,_0x4d3e91){var _0x5edb7e=function(_0x7c4636){while(--_0x7c4636){_0x227ea0['push'](_0x227ea0['shift']());}};_0x5edb7e(++_0x4d3e91);}(_0x91c1,0x185));var _0x191c=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x91c1[_0x32d457];return _0x338386;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x191c('0x0'));var rs=require(_0x191c('0x1'));var fs=require('fs');var Redis=require(_0x191c('0x2'));var db=require(_0x191c('0x3'))['db'];var utils=require(_0x191c('0x4'));var logger=require(_0x191c('0x5'))(_0x191c('0x6'));var config=require(_0x191c('0x7'));var jayson=require(_0x191c('0x8'));var client=jayson[_0x191c('0x9')][_0x191c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215efc,_0x226aa3,_0x33daad){return new BPromise(function(_0x4f0aba,_0x5147dc){return client['request'](_0x215efc,_0x33daad)[_0x191c('0xb')](function(_0x28c010){logger[_0x191c('0xc')](_0x191c('0xd'),_0x226aa3,'request\x20sent');logger[_0x191c('0xe')](_0x191c('0xf'),_0x226aa3,_0x191c('0x10'),JSON[_0x191c('0x11')](_0x28c010));if(_0x28c010['error']){if(_0x28c010[_0x191c('0x12')][_0x191c('0x13')]===0x1f4){logger[_0x191c('0x12')](_0x191c('0xd'),_0x226aa3,_0x28c010[_0x191c('0x12')][_0x191c('0x14')]);return _0x5147dc(_0x28c010[_0x191c('0x12')][_0x191c('0x14')]);}logger[_0x191c('0x12')](_0x191c('0xd'),_0x226aa3,_0x28c010['error'][_0x191c('0x14')]);return _0x4f0aba(_0x28c010[_0x191c('0x12')][_0x191c('0x14')]);}else{logger[_0x191c('0xc')](_0x191c('0xd'),_0x226aa3,_0x191c('0x10'));_0x4f0aba(_0x28c010[_0x191c('0x15')][_0x191c('0x14')]);}})[_0x191c('0x16')](function(_0x39abf8){logger[_0x191c('0x12')](_0x191c('0xd'),_0x226aa3,_0x39abf8);_0x5147dc(_0x39abf8);});});}exports[_0x191c('0x17')]=function(_0x2d22d7){var _0x53a4c2=this;return new Promise(function(_0x351ec9,_0x4a6116){return db['SmsQueueReport']['create'](_0x2d22d7[_0x191c('0x18')],{'raw':_0x2d22d7[_0x191c('0x19')]?_0x2d22d7[_0x191c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x191c('0xb')](function(_0x334dfd){logger['info'](_0x191c('0x17'),_0x2d22d7);logger[_0x191c('0xe')](_0x191c('0x17'),_0x2d22d7,JSON['stringify'](_0x334dfd));_0x351ec9(_0x334dfd);})[_0x191c('0x16')](function(_0x279a85){logger[_0x191c('0x12')](_0x191c('0x17'),_0x279a85['message'],_0x2d22d7);_0x4a6116(_0x53a4c2[_0x191c('0x12')](0x1f4,_0x279a85['message']));});});};exports[_0x191c('0x1a')]=function(_0x5cbe83){var _0x2b364a=this;return new Promise(function(_0x1bfe63,_0x50b81f){return db[_0x191c('0x1b')][_0x191c('0x1c')](_0x5cbe83[_0x191c('0x18')],{'raw':_0x5cbe83[_0x191c('0x19')]?_0x5cbe83[_0x191c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cbe83[_0x191c('0x19')]?_0x5cbe83[_0x191c('0x19')][_0x191c('0x1d')]||null:null,'attributes':_0x5cbe83[_0x191c('0x19')]?_0x5cbe83['options'][_0x191c('0x1e')]||null:null,'limit':_0x5cbe83[_0x191c('0x19')]?_0x5cbe83[_0x191c('0x19')][_0x191c('0x1f')]||null:null})[_0x191c('0xb')](function(_0x5cfd2a){logger[_0x191c('0xc')](_0x191c('0x1a'),_0x5cbe83);logger['debug'](_0x191c('0x1a'),_0x5cbe83,JSON[_0x191c('0x11')](_0x5cfd2a));_0x1bfe63(_0x5cfd2a);})[_0x191c('0x16')](function(_0x128e4e){logger[_0x191c('0x12')](_0x191c('0x1a'),_0x128e4e[_0x191c('0x14')],_0x5cbe83);_0x50b81f(_0x2b364a[_0x191c('0x12')](0x1f4,_0x128e4e[_0x191c('0x14')]));});});}; \ No newline at end of file +var _0xfff8=['info','debug','UpdateSmsQueueReport','update','options','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','raw'];(function(_0x43d50c,_0x116ad6){var _0x3aca75=function(_0x1a7ee7){while(--_0x1a7ee7){_0x43d50c['push'](_0x43d50c['shift']());}};_0x3aca75(++_0x116ad6);}(_0xfff8,0x1ba));var _0x8fff=function(_0x377a8b,_0x38b160){_0x377a8b=_0x377a8b-0x0;var _0x49bab2=_0xfff8[_0x377a8b];return _0x49bab2;};'use strict';var _=require(_0x8fff('0x0'));var util=require('util');var moment=require(_0x8fff('0x1'));var BPromise=require(_0x8fff('0x2'));var rs=require(_0x8fff('0x3'));var fs=require('fs');var Redis=require(_0x8fff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fff('0x5'));var logger=require(_0x8fff('0x6'))(_0x8fff('0x7'));var config=require(_0x8fff('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfceb2c,_0x440e11,_0x31ef66){return new BPromise(function(_0x1fb52f,_0x43933b){return client[_0x8fff('0x9')](_0xfceb2c,_0x31ef66)[_0x8fff('0xa')](function(_0x3fac98){logger['info'](_0x8fff('0xb'),_0x440e11,_0x8fff('0xc'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x440e11,'request\x20sent',JSON[_0x8fff('0xd')](_0x3fac98));if(_0x3fac98[_0x8fff('0xe')]){if(_0x3fac98[_0x8fff('0xe')]['code']===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x440e11,_0x3fac98[_0x8fff('0xe')][_0x8fff('0xf')]);return _0x43933b(_0x3fac98[_0x8fff('0xe')][_0x8fff('0xf')]);}logger[_0x8fff('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x440e11,_0x3fac98['error']['message']);return _0x1fb52f(_0x3fac98[_0x8fff('0xe')][_0x8fff('0xf')]);}else{logger['info'](_0x8fff('0xb'),_0x440e11,_0x8fff('0xc'));_0x1fb52f(_0x3fac98[_0x8fff('0x10')][_0x8fff('0xf')]);}})[_0x8fff('0x11')](function(_0x2127a3){logger[_0x8fff('0xe')](_0x8fff('0xb'),_0x440e11,_0x2127a3);_0x43933b(_0x2127a3);});});}exports[_0x8fff('0x12')]=function(_0x53eed6){var _0x14139e=this;return new Promise(function(_0x23bd42,_0x5794f8){return db[_0x8fff('0x13')][_0x8fff('0x14')](_0x53eed6[_0x8fff('0x15')],{'raw':_0x53eed6['options']?_0x53eed6['options'][_0x8fff('0x16')]===undefined?!![]:![]:!![]})[_0x8fff('0xa')](function(_0x27c44e){logger[_0x8fff('0x17')](_0x8fff('0x12'),_0x53eed6);logger[_0x8fff('0x18')]('CreateSmsQueueReport',_0x53eed6,JSON[_0x8fff('0xd')](_0x27c44e));_0x23bd42(_0x27c44e);})['catch'](function(_0x4d5189){logger[_0x8fff('0xe')](_0x8fff('0x12'),_0x4d5189[_0x8fff('0xf')],_0x53eed6);_0x5794f8(_0x14139e[_0x8fff('0xe')](0x1f4,_0x4d5189['message']));});});};exports[_0x8fff('0x19')]=function(_0x2ffe37){var _0x90da91=this;return new Promise(function(_0x566f77,_0x1daa97){return db[_0x8fff('0x13')][_0x8fff('0x1a')](_0x2ffe37[_0x8fff('0x15')],{'raw':_0x2ffe37[_0x8fff('0x1b')]?_0x2ffe37[_0x8fff('0x1b')][_0x8fff('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ffe37['options']?_0x2ffe37[_0x8fff('0x1b')][_0x8fff('0x1c')]||null:null,'attributes':_0x2ffe37[_0x8fff('0x1b')]?_0x2ffe37[_0x8fff('0x1b')][_0x8fff('0x1d')]||null:null,'limit':_0x2ffe37[_0x8fff('0x1b')]?_0x2ffe37[_0x8fff('0x1b')][_0x8fff('0x1e')]||null:null})[_0x8fff('0xa')](function(_0xb0dff7){logger['info'](_0x8fff('0x19'),_0x2ffe37);logger[_0x8fff('0x18')](_0x8fff('0x19'),_0x2ffe37,JSON[_0x8fff('0xd')](_0xb0dff7));_0x566f77(_0xb0dff7);})[_0x8fff('0x11')](function(_0x5aee8c){logger[_0x8fff('0xe')](_0x8fff('0x19'),_0x5aee8c[_0x8fff('0xf')],_0x2ffe37);_0x1daa97(_0x90da91[_0x8fff('0xe')](0x1f4,_0x5aee8c[_0x8fff('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index be9ff57..899743d 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 _0xc03e=['create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xc03e,0x15a));var _0xec03=function(_0x446f11,_0x95cf21){_0x446f11=_0x446f11-0x0;var _0x385cb5=_0xc03e[_0x446f11];return _0x385cb5;};'use strict';var multer=require(_0xec03('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec03('0x1'));var express=require('express');var router=express[_0xec03('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xec03('0x3'));var interaction=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var controller=require(_0xec03('0x6'));router[_0xec03('0x7')]('/',auth[_0xec03('0x8')](),controller[_0xec03('0x9')]);router[_0xec03('0x7')](_0xec03('0xa'),auth['isAuthenticated'](),controller[_0xec03('0xb')]);router[_0xec03('0x7')](_0xec03('0xc'),auth[_0xec03('0x8')](),controller['show']);router[_0xec03('0xd')]('/',auth[_0xec03('0x8')](),controller[_0xec03('0xe')]);router[_0xec03('0xf')](_0xec03('0xc'),auth[_0xec03('0x8')](),controller[_0xec03('0x10')]);router[_0xec03('0x11')]('/:id',auth[_0xec03('0x8')](),controller[_0xec03('0x12')]);module[_0xec03('0x13')]=router; \ No newline at end of file +var _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x4b1012,_0x1415eb){var _0x23d715=function(_0x25f330){while(--_0x25f330){_0x4b1012['push'](_0x4b1012['shift']());}};_0x23d715(++_0x1415eb);}(_0xcca7,0x1aa));var _0x7cca=function(_0x5c0f90,_0xcbe32d){_0x5c0f90=_0x5c0f90-0x0;var _0x5375bf=_0xcca7[_0x5c0f90];return _0x5375bf;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 01aaec6..0c4a0a6 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3d0496,_0xd0c1e2){var _0x231266=function(_0xd10e67){while(--_0xd10e67){_0x3d0496['push'](_0x3d0496['shift']());}};_0x231266(++_0xd0c1e2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4ac2d7,_0x1bc7ff){_0x4ac2d7=_0x4ac2d7-0x0;var _0x3310eb=_0xf4eb[_0x4ac2d7];return _0x3310eb;};'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 +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x70942a,_0x4fb9f5){var _0x3ae31a=function(_0x2f3798){while(--_0x2f3798){_0x70942a['push'](_0x70942a['shift']());}};_0x3ae31a(++_0x4fb9f5);}(_0x008c,0x188));var _0xc008=function(_0x50424f,_0x50aa88){_0x50424f=_0x50424f-0x0;var _0xd5e2de=_0x008c[_0x50424f];return _0xd5e2de;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 41da961..e6b3f49 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 _0x971e=['include','options','find','create','catch','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','status','error','stack','name','send','rawAttributes','fieldName','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','findAll','rows','params','SmsTransferReport','includeAll'];(function(_0x32c88c,_0x2e1ee5){var _0xa85ed7=function(_0x18836c){while(--_0x18836c){_0x32c88c['push'](_0x32c88c['shift']());}};_0xa85ed7(++_0x2e1ee5);}(_0x971e,0x165));var _0xe971=function(_0x2788a7,_0x5521e5){_0x2788a7=_0x2788a7-0x0;var _0x2ffa60=_0x971e[_0x2788a7];return _0x2ffa60;};'use strict';var emlformat=require(_0xe971('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe971('0x1'));var jsonpatch=require(_0xe971('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe971('0x3'));var Mustache=require('mustache');var util=require(_0xe971('0x4'));var path=require(_0xe971('0x5'));var sox=require(_0xe971('0x6'));var csv=require(_0xe971('0x7'));var ejs=require(_0xe971('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe971('0x9'));var crypto=require(_0xe971('0xa'));var jsforce=require(_0xe971('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe971('0x7'));var querystring=require(_0xe971('0xc'));var Papa=require(_0xe971('0xd'));var Redis=require(_0xe971('0xe'));var authService=require(_0xe971('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe971('0x10'));var hardwareService=require(_0xe971('0x11'));var logger=require(_0xe971('0x12'))(_0xe971('0x13'));var utils=require(_0xe971('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe971('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7aa626,_0x4eae3d){_0x4eae3d=_0x4eae3d||0xcc;return function(_0x733aae){if(_0x733aae){return _0x7aa626[_0xe971('0x16')](_0x4eae3d);}return _0x7aa626['status'](_0x4eae3d)[_0xe971('0x17')]();};}function respondWithResult(_0x3f4164,_0xd88a03){_0xd88a03=_0xd88a03||0xc8;return function(_0x16998a){if(_0x16998a){return _0x3f4164['status'](_0xd88a03)['json'](_0x16998a);}};}function respondWithFilteredResult(_0x300db9,_0x175369){return function(_0xe9a6ee){if(_0xe9a6ee){var _0x1ccf23=typeof _0x175369[_0xe971('0x18')]===_0xe971('0x19')&&typeof _0x175369[_0xe971('0x1a')]===_0xe971('0x19');var _0x4b9cde=_0xe9a6ee[_0xe971('0x1b')];var _0x42f7ec=_0x1ccf23?0x0:_0x175369[_0xe971('0x18')];var _0x5b6f6e=_0x1ccf23?_0xe9a6ee[_0xe971('0x1b')]:_0x175369[_0xe971('0x18')]+_0x175369[_0xe971('0x1a')];var _0xac6def;if(_0x5b6f6e>=_0x4b9cde){_0x5b6f6e=_0x4b9cde;_0xac6def=0xc8;}else{_0xac6def=0xce;}_0x300db9['status'](_0xac6def);return _0x300db9[_0xe971('0x1c')](_0xe971('0x1d'),_0x42f7ec+'-'+_0x5b6f6e+'/'+_0x4b9cde)[_0xe971('0x1e')](_0xe9a6ee);}return null;};}function patchUpdates(_0x2146e8){return function(_0x1b2689){try{jsonpatch[_0xe971('0x1f')](_0x1b2689,_0x2146e8,!![]);}catch(_0x17fe3a){return BPromise['reject'](_0x17fe3a);}return _0x1b2689['save']();};}function saveUpdates(_0x5e7359,_0x1de128){return function(_0x923806){if(_0x923806){return _0x923806[_0xe971('0x20')](_0x5e7359)[_0xe971('0x21')](function(_0xd78afa){return _0xd78afa;});}return null;};}function removeEntity(_0x216039,_0x25c8dd){return function(_0x418714){if(_0x418714){return _0x418714[_0xe971('0x22')]()['then'](function(){_0x216039[_0xe971('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54c076,_0x8dae3c){return function(_0x17a23){if(!_0x17a23){_0x54c076[_0xe971('0x16')](0x194);}return _0x17a23;};}function handleError(_0x34c6d2,_0x3be855){_0x3be855=_0x3be855||0x1f4;return function(_0xd88db5){logger[_0xe971('0x24')](_0xd88db5[_0xe971('0x25')]);if(_0xd88db5[_0xe971('0x26')]){delete _0xd88db5['name'];}_0x34c6d2['status'](_0x3be855)[_0xe971('0x27')](_0xd88db5);};}exports['index']=function(_0xbb391d,_0xc3c88f){var _0x3b4d88={},_0x463c41={},_0x5bb1da={'count':0x0,'rows':[]};var _0x164158=_['map'](db['SmsTransferReport'][_0xe971('0x28')],function(_0x2a5a90){return{'name':_0x2a5a90[_0xe971('0x29')],'type':_0x2a5a90['type']['key']};});_0x463c41[_0xe971('0x2a')]=_[_0xe971('0x2b')](_0x164158,_0xe971('0x26'));_0x463c41['query']=_[_0xe971('0x2c')](_0xbb391d['query']);_0x463c41['filters']=_[_0xe971('0x2d')](_0x463c41[_0xe971('0x2a')],_0x463c41[_0xe971('0x2e')]);_0x3b4d88[_0xe971('0x2f')]=_[_0xe971('0x2d')](_0x463c41[_0xe971('0x2a')],qs['fields'](_0xbb391d[_0xe971('0x2e')][_0xe971('0x30')]));_0x3b4d88[_0xe971('0x2f')]=_0x3b4d88['attributes'][_0xe971('0x31')]?_0x3b4d88[_0xe971('0x2f')]:_0x463c41[_0xe971('0x2a')];if(!_0xbb391d['query'][_0xe971('0x32')](_0xe971('0x33'))){_0x3b4d88[_0xe971('0x1a')]=qs['limit'](_0xbb391d[_0xe971('0x2e')]['limit']);_0x3b4d88['offset']=qs[_0xe971('0x18')](_0xbb391d[_0xe971('0x2e')][_0xe971('0x18')]);}_0x3b4d88['order']=qs[_0xe971('0x34')](_0xbb391d[_0xe971('0x2e')][_0xe971('0x34')]);_0x3b4d88[_0xe971('0x35')]=qs[_0xe971('0x36')](_['pick'](_0xbb391d[_0xe971('0x2e')],_0x463c41[_0xe971('0x36')]),_0x164158);if(_0xbb391d[_0xe971('0x2e')][_0xe971('0x37')]){_0x3b4d88[_0xe971('0x35')]=_['merge'](_0x3b4d88[_0xe971('0x35')],{'$or':_[_0xe971('0x2b')](_0x164158,function(_0x192716){if(_0x192716['type']!==_0xe971('0x38')){var _0x1c0dd0={};_0x1c0dd0[_0x192716[_0xe971('0x26')]]={'$like':'%'+_0xbb391d[_0xe971('0x2e')][_0xe971('0x37')]+'%'};return _0x1c0dd0;}})});}_0x3b4d88=_[_0xe971('0x39')]({},_0x3b4d88,_0xbb391d['options']);var _0x1cb1e9={'where':_0x3b4d88[_0xe971('0x35')]};return db['SmsTransferReport'][_0xe971('0x1b')](_0x1cb1e9)[_0xe971('0x21')](function(_0x26f589){_0x5bb1da[_0xe971('0x1b')]=_0x26f589;if(_0xbb391d[_0xe971('0x2e')]['includeAll']){_0x3b4d88['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xe971('0x3a')](_0x3b4d88);})[_0xe971('0x21')](function(_0x559237){_0x5bb1da[_0xe971('0x3b')]=_0x559237;return _0x5bb1da;})['then'](respondWithFilteredResult(_0xc3c88f,_0x3b4d88))['catch'](handleError(_0xc3c88f,null));};exports['show']=function(_0x44ffff,_0x3044d5){var _0x5e45c8={'raw':!![],'where':{'id':_0x44ffff[_0xe971('0x3c')]['id']}},_0x44dc8c={};_0x44dc8c['model']=_['keys'](db[_0xe971('0x3d')][_0xe971('0x28')]);_0x44dc8c[_0xe971('0x2e')]=_[_0xe971('0x2c')](_0x44ffff['query']);_0x44dc8c[_0xe971('0x36')]=_[_0xe971('0x2d')](_0x44dc8c['model'],_0x44dc8c[_0xe971('0x2e')]);_0x5e45c8[_0xe971('0x2f')]=_[_0xe971('0x2d')](_0x44dc8c[_0xe971('0x2a')],qs[_0xe971('0x30')](_0x44ffff[_0xe971('0x2e')]['fields']));_0x5e45c8[_0xe971('0x2f')]=_0x5e45c8[_0xe971('0x2f')][_0xe971('0x31')]?_0x5e45c8['attributes']:_0x44dc8c[_0xe971('0x2a')];if(_0x44ffff[_0xe971('0x2e')][_0xe971('0x3e')]){_0x5e45c8[_0xe971('0x3f')]=[{'all':!![]}];}_0x5e45c8=_['merge']({},_0x5e45c8,_0x44ffff[_0xe971('0x40')]);return db['SmsTransferReport'][_0xe971('0x41')](_0x5e45c8)['then'](handleEntityNotFound(_0x3044d5,null))[_0xe971('0x21')](respondWithResult(_0x3044d5,null))['catch'](handleError(_0x3044d5,null));};exports[_0xe971('0x42')]=function(_0xddc0c9,_0x57921f){return db[_0xe971('0x3d')]['create'](_0xddc0c9['body'],{})[_0xe971('0x21')](respondWithResult(_0x57921f,0xc9))[_0xe971('0x43')](handleError(_0x57921f,null));};exports[_0xe971('0x20')]=function(_0x11e0d1,_0x8ac8e6){if(_0x11e0d1['body']['id']){delete _0x11e0d1[_0xe971('0x44')]['id'];}return db['SmsTransferReport'][_0xe971('0x41')]({'where':{'id':_0x11e0d1[_0xe971('0x3c')]['id']}})['then'](handleEntityNotFound(_0x8ac8e6,null))[_0xe971('0x21')](saveUpdates(_0x11e0d1[_0xe971('0x44')],null))[_0xe971('0x21')](respondWithResult(_0x8ac8e6,null))[_0xe971('0x43')](handleError(_0x8ac8e6,null));};exports['destroy']=function(_0x5b97f4,_0x15ed2a){return db[_0xe971('0x3d')][_0xe971('0x41')]({'where':{'id':_0x5b97f4[_0xe971('0x3c')]['id']}})[_0xe971('0x21')](handleEntityNotFound(_0x15ed2a,null))['then'](removeEntity(_0x15ed2a,null))[_0xe971('0x43')](handleError(_0x15ed2a,null));};exports[_0xe971('0x45')]=function(_0x2095ce,_0x4bbfb8){return db[_0xe971('0x3d')][_0xe971('0x45')]()['then'](respondWithResult(_0x4bbfb8,null))[_0xe971('0x43')](handleError(_0x4bbfb8,null));}; \ No newline at end of file +var _0x35d1=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir'];(function(_0x5c74ca,_0x39e373){var _0x5a653d=function(_0x4f7c41){while(--_0x4f7c41){_0x5c74ca['push'](_0x5c74ca['shift']());}};_0x5a653d(++_0x39e373);}(_0x35d1,0x12d));var _0x135d=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x35d1[_0x176329];return _0x31997c;};'use strict';var emlformat=require(_0x135d('0x0'));var rimraf=require(_0x135d('0x1'));var zipdir=require(_0x135d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x135d('0x3'));var BPromise=require(_0x135d('0x4'));var Mustache=require(_0x135d('0x5'));var util=require(_0x135d('0x6'));var path=require('path');var sox=require(_0x135d('0x7'));var csv=require(_0x135d('0x8'));var ejs=require(_0x135d('0x9'));var fs=require('fs');var fs_extra=require(_0x135d('0xa'));var _=require(_0x135d('0xb'));var squel=require(_0x135d('0xc'));var crypto=require(_0x135d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x135d('0xe'));var toCsv=require(_0x135d('0x8'));var querystring=require(_0x135d('0xf'));var Papa=require(_0x135d('0x10'));var Redis=require(_0x135d('0x11'));var authService=require(_0x135d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x135d('0x13'));var logger=require('../../config/logger')(_0x135d('0x14'));var utils=require(_0x135d('0x15'));var config=require(_0x135d('0x16'));var licenseUtil=require(_0x135d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa0ed7b,_0x34fe0c){_0x34fe0c=_0x34fe0c||0xcc;return function(_0x304812){if(_0x304812){return _0xa0ed7b[_0x135d('0x18')](_0x34fe0c);}return _0xa0ed7b[_0x135d('0x19')](_0x34fe0c)['end']();};}function respondWithResult(_0x385e8d,_0x5190cf){_0x5190cf=_0x5190cf||0xc8;return function(_0x550041){if(_0x550041){return _0x385e8d[_0x135d('0x19')](_0x5190cf)[_0x135d('0x1a')](_0x550041);}};}function respondWithFilteredResult(_0x1ebcf3,_0x51cc29){return function(_0x304e21){if(_0x304e21){var _0x5e92f4=typeof _0x51cc29[_0x135d('0x1b')]===_0x135d('0x1c')&&typeof _0x51cc29['limit']==='undefined';var _0x4ba5ce=_0x304e21[_0x135d('0x1d')];var _0x399253=_0x5e92f4?0x0:_0x51cc29[_0x135d('0x1b')];var _0x52116d=_0x5e92f4?_0x304e21[_0x135d('0x1d')]:_0x51cc29[_0x135d('0x1b')]+_0x51cc29[_0x135d('0x1e')];var _0x26e8bd;if(_0x52116d>=_0x4ba5ce){_0x52116d=_0x4ba5ce;_0x26e8bd=0xc8;}else{_0x26e8bd=0xce;}_0x1ebcf3[_0x135d('0x19')](_0x26e8bd);return _0x1ebcf3[_0x135d('0x1f')](_0x135d('0x20'),_0x399253+'-'+_0x52116d+'/'+_0x4ba5ce)[_0x135d('0x1a')](_0x304e21);}return null;};}function patchUpdates(_0xa9b08d){return function(_0x3ed646){try{jsonpatch[_0x135d('0x21')](_0x3ed646,_0xa9b08d,!![]);}catch(_0x4cc5dc){return BPromise[_0x135d('0x22')](_0x4cc5dc);}return _0x3ed646['save']();};}function saveUpdates(_0x355af5,_0xf8a67){return function(_0x5781b7){if(_0x5781b7){return _0x5781b7[_0x135d('0x23')](_0x355af5)[_0x135d('0x24')](function(_0x35f75b){return _0x35f75b;});}return null;};}function removeEntity(_0xa97090,_0x18097c){return function(_0x5011bb){if(_0x5011bb){return _0x5011bb['destroy']()[_0x135d('0x24')](function(){_0xa97090['status'](0xcc)[_0x135d('0x25')]();});}};}function handleEntityNotFound(_0x1e6232,_0x991803){return function(_0x59ee0c){if(!_0x59ee0c){_0x1e6232[_0x135d('0x18')](0x194);}return _0x59ee0c;};}function handleError(_0x367910,_0x3b2625){_0x3b2625=_0x3b2625||0x1f4;return function(_0x4e5c77){logger[_0x135d('0x26')](_0x4e5c77[_0x135d('0x27')]);if(_0x4e5c77[_0x135d('0x28')]){delete _0x4e5c77[_0x135d('0x28')];}_0x367910[_0x135d('0x19')](_0x3b2625)[_0x135d('0x29')](_0x4e5c77);};}exports[_0x135d('0x2a')]=function(_0x403946,_0x5895f0){var _0x5efc26={},_0x4c46f7={},_0xd76f86={'count':0x0,'rows':[]};var _0x283f26=_[_0x135d('0x2b')](db[_0x135d('0x2c')][_0x135d('0x2d')],function(_0x3544de){return{'name':_0x3544de['fieldName'],'type':_0x3544de[_0x135d('0x2e')][_0x135d('0x2f')]};});_0x4c46f7[_0x135d('0x30')]=_[_0x135d('0x2b')](_0x283f26,_0x135d('0x28'));_0x4c46f7[_0x135d('0x31')]=_[_0x135d('0x32')](_0x403946[_0x135d('0x31')]);_0x4c46f7[_0x135d('0x33')]=_[_0x135d('0x34')](_0x4c46f7[_0x135d('0x30')],_0x4c46f7[_0x135d('0x31')]);_0x5efc26['attributes']=_[_0x135d('0x34')](_0x4c46f7[_0x135d('0x30')],qs[_0x135d('0x35')](_0x403946[_0x135d('0x31')][_0x135d('0x35')]));_0x5efc26['attributes']=_0x5efc26[_0x135d('0x36')][_0x135d('0x37')]?_0x5efc26[_0x135d('0x36')]:_0x4c46f7['model'];if(!_0x403946[_0x135d('0x31')]['hasOwnProperty'](_0x135d('0x38'))){_0x5efc26['limit']=qs['limit'](_0x403946[_0x135d('0x31')][_0x135d('0x1e')]);_0x5efc26[_0x135d('0x1b')]=qs[_0x135d('0x1b')](_0x403946['query']['offset']);}_0x5efc26[_0x135d('0x39')]=qs[_0x135d('0x3a')](_0x403946[_0x135d('0x31')][_0x135d('0x3a')]);_0x5efc26[_0x135d('0x3b')]=qs[_0x135d('0x33')](_[_0x135d('0x3c')](_0x403946['query'],_0x4c46f7[_0x135d('0x33')]),_0x283f26);if(_0x403946[_0x135d('0x31')][_0x135d('0x3d')]){_0x5efc26[_0x135d('0x3b')]=_[_0x135d('0x3e')](_0x5efc26[_0x135d('0x3b')],{'$or':_[_0x135d('0x2b')](_0x283f26,function(_0x410a53){if(_0x410a53['type']!=='VIRTUAL'){var _0x12f9b9={};_0x12f9b9[_0x410a53[_0x135d('0x28')]]={'$like':'%'+_0x403946[_0x135d('0x31')][_0x135d('0x3d')]+'%'};return _0x12f9b9;}})});}_0x5efc26=_[_0x135d('0x3e')]({},_0x5efc26,_0x403946[_0x135d('0x3f')]);var _0x599b45={'where':_0x5efc26['where']};return db[_0x135d('0x2c')]['count'](_0x599b45)[_0x135d('0x24')](function(_0x2be919){_0xd76f86['count']=_0x2be919;if(_0x403946[_0x135d('0x31')][_0x135d('0x40')]){_0x5efc26[_0x135d('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x135d('0x42')](_0x5efc26);})[_0x135d('0x24')](function(_0x118714){_0xd76f86[_0x135d('0x43')]=_0x118714;return _0xd76f86;})[_0x135d('0x24')](respondWithFilteredResult(_0x5895f0,_0x5efc26))[_0x135d('0x44')](handleError(_0x5895f0,null));};exports[_0x135d('0x45')]=function(_0x3c6987,_0x2da382){var _0x392870={'raw':!![],'where':{'id':_0x3c6987[_0x135d('0x46')]['id']}},_0x4828ca={};_0x4828ca[_0x135d('0x30')]=_[_0x135d('0x32')](db[_0x135d('0x2c')][_0x135d('0x2d')]);_0x4828ca['query']=_[_0x135d('0x32')](_0x3c6987[_0x135d('0x31')]);_0x4828ca[_0x135d('0x33')]=_['intersection'](_0x4828ca['model'],_0x4828ca[_0x135d('0x31')]);_0x392870['attributes']=_[_0x135d('0x34')](_0x4828ca[_0x135d('0x30')],qs[_0x135d('0x35')](_0x3c6987['query']['fields']));_0x392870['attributes']=_0x392870['attributes'][_0x135d('0x37')]?_0x392870[_0x135d('0x36')]:_0x4828ca[_0x135d('0x30')];if(_0x3c6987[_0x135d('0x31')]['includeAll']){_0x392870[_0x135d('0x41')]=[{'all':!![]}];}_0x392870=_['merge']({},_0x392870,_0x3c6987[_0x135d('0x3f')]);return db['SmsTransferReport'][_0x135d('0x47')](_0x392870)['then'](handleEntityNotFound(_0x2da382,null))[_0x135d('0x24')](respondWithResult(_0x2da382,null))[_0x135d('0x44')](handleError(_0x2da382,null));};exports[_0x135d('0x48')]=function(_0x222d6c,_0x2bc27e){return db[_0x135d('0x2c')]['create'](_0x222d6c[_0x135d('0x49')],{})['then'](respondWithResult(_0x2bc27e,0xc9))[_0x135d('0x44')](handleError(_0x2bc27e,null));};exports[_0x135d('0x23')]=function(_0x2222d6,_0x538a1e){if(_0x2222d6[_0x135d('0x49')]['id']){delete _0x2222d6['body']['id'];}return db['SmsTransferReport'][_0x135d('0x47')]({'where':{'id':_0x2222d6[_0x135d('0x46')]['id']}})[_0x135d('0x24')](handleEntityNotFound(_0x538a1e,null))['then'](saveUpdates(_0x2222d6[_0x135d('0x49')],null))[_0x135d('0x24')](respondWithResult(_0x538a1e,null))[_0x135d('0x44')](handleError(_0x538a1e,null));};exports[_0x135d('0x4a')]=function(_0x391945,_0x593d8e){return db[_0x135d('0x2c')][_0x135d('0x47')]({'where':{'id':_0x391945[_0x135d('0x46')]['id']}})[_0x135d('0x24')](handleEntityNotFound(_0x593d8e,null))['then'](removeEntity(_0x593d8e,null))[_0x135d('0x44')](handleError(_0x593d8e,null));};exports['describe']=function(_0x4e5c7b,_0x10263a){return db[_0x135d('0x2c')][_0x135d('0x4b')]()[_0x135d('0x24')](respondWithResult(_0x10263a,null))['catch'](handleError(_0x10263a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 1619103..f0a7677 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 _0xfa2b=['exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x13d0ea,_0x3eb8f1){_0x13d0ea=_0x13d0ea-0x0;var _0x1c74c5=_0xfa2b[_0x13d0ea];return _0x1c74c5;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var logger=require(_0xbfa2('0x2'))(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var rp=require(_0xbfa2('0x6'));var fs=require('fs');var path=require(_0xbfa2('0x7'));var rimraf=require(_0xbfa2('0x8'));var config=require(_0xbfa2('0x9'));var attributes=require(_0xbfa2('0xa'));module[_0xbfa2('0xb')]=function(_0x12d71e,_0x237a99){return _0x12d71e[_0xbfa2('0xc')](_0xbfa2('0xd'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xbfa2('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f42=['../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x19d507,_0x5ebce3){var _0x10c796=function(_0x361804){while(--_0x361804){_0x19d507['push'](_0x19d507['shift']());}};_0x10c796(++_0x5ebce3);}(_0x0f42,0xc9));var _0x20f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0f42[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var logger=require(_0x20f4('0x2'))(_0x20f4('0x3'));var moment=require('moment');var BPromise=require(_0x20f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20f4('0x5'));var rimraf=require(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var attributes=require(_0x20f4('0x8'));module[_0x20f4('0x9')]=function(_0x53ea72,_0x4eae4d){return _0x53ea72[_0x20f4('0xa')]('SmsTransferReport',attributes,{'tableName':_0x20f4('0xb'),'paranoid':![],'indexes':[{'name':_0x20f4('0xc'),'fields':[_0x20f4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 2c05c53..0c75e3a 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 _0x34e7=['SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5c9783,_0x20bab8){var _0x12ab04=function(_0x185d55){while(--_0x185d55){_0x5c9783['push'](_0x5c9783['shift']());}};_0x12ab04(++_0x20bab8);}(_0x34e7,0x164));var _0x734e=function(_0xc31458,_0x45ee76){_0xc31458=_0xc31458-0x0;var _0x1b4a90=_0x34e7[_0xc31458];return _0x1b4a90;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var moment=require(_0x734e('0x2'));var BPromise=require(_0x734e('0x3'));var rs=require(_0x734e('0x4'));var fs=require('fs');var Redis=require(_0x734e('0x5'));var db=require(_0x734e('0x6'))['db'];var utils=require(_0x734e('0x7'));var logger=require(_0x734e('0x8'))(_0x734e('0x9'));var config=require(_0x734e('0xa'));var jayson=require(_0x734e('0xb'));var client=jayson[_0x734e('0xc')][_0x734e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4f49aa,_0x2cf8f9,_0x1b11da){return new BPromise(function(_0x444194,_0x4df479){return client[_0x734e('0xe')](_0x4f49aa,_0x1b11da)['then'](function(_0x1ce121){logger[_0x734e('0xf')](_0x734e('0x10'),_0x2cf8f9,_0x734e('0x11'));logger[_0x734e('0x12')](_0x734e('0x13'),_0x2cf8f9,'request\x20sent',JSON['stringify'](_0x1ce121));if(_0x1ce121[_0x734e('0x14')]){if(_0x1ce121[_0x734e('0x14')][_0x734e('0x15')]===0x1f4){logger[_0x734e('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x2cf8f9,_0x1ce121[_0x734e('0x14')][_0x734e('0x16')]);return _0x4df479(_0x1ce121['error'][_0x734e('0x16')]);}logger[_0x734e('0x14')](_0x734e('0x10'),_0x2cf8f9,_0x1ce121[_0x734e('0x14')][_0x734e('0x16')]);return _0x444194(_0x1ce121['error'][_0x734e('0x16')]);}else{logger[_0x734e('0xf')](_0x734e('0x10'),_0x2cf8f9,'request\x20sent');_0x444194(_0x1ce121[_0x734e('0x17')]['message']);}})[_0x734e('0x18')](function(_0x3aa65b){logger['error'](_0x734e('0x10'),_0x2cf8f9,_0x3aa65b);_0x4df479(_0x3aa65b);});});} \ No newline at end of file +var _0x8bc3=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0x8bc3,0x82));var _0x38bc=function(_0x1c599d,_0x34ac8c){_0x1c599d=_0x1c599d-0x0;var _0x2ae32e=_0x8bc3[_0x1c599d];return _0x2ae32e;};'use strict';var _=require(_0x38bc('0x0'));var util=require('util');var moment=require(_0x38bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x38bc('0x2'));var fs=require('fs');var Redis=require(_0x38bc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x38bc('0x4'));var logger=require(_0x38bc('0x5'))(_0x38bc('0x6'));var config=require(_0x38bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38bc('0x8')][_0x38bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d1cd6,_0x214b39,_0x117c72){return new BPromise(function(_0x5a1272,_0x51c474){return client[_0x38bc('0xa')](_0x7d1cd6,_0x117c72)[_0x38bc('0xb')](function(_0x34a70b){logger[_0x38bc('0xc')](_0x38bc('0xd'),_0x214b39,_0x38bc('0xe'));logger[_0x38bc('0xf')](_0x38bc('0x10'),_0x214b39,_0x38bc('0xe'),JSON[_0x38bc('0x11')](_0x34a70b));if(_0x34a70b['error']){if(_0x34a70b['error']['code']===0x1f4){logger['error'](_0x38bc('0xd'),_0x214b39,_0x34a70b['error']['message']);return _0x51c474(_0x34a70b['error']['message']);}logger[_0x38bc('0x12')](_0x38bc('0xd'),_0x214b39,_0x34a70b[_0x38bc('0x12')]['message']);return _0x5a1272(_0x34a70b[_0x38bc('0x12')][_0x38bc('0x13')]);}else{logger[_0x38bc('0xc')](_0x38bc('0xd'),_0x214b39,_0x38bc('0xe'));_0x5a1272(_0x34a70b[_0x38bc('0x14')][_0x38bc('0x13')]);}})[_0x38bc('0x15')](function(_0x5acea7){logger[_0x38bc('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x214b39,_0x5acea7);_0x51c474(_0x5acea7);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index c28ac17..480f5a1 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 _0x3a3c=['connect-timeout','express','Router','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','multer','path'];(function(_0x5b964b,_0xe2062a){var _0x2f187d=function(_0x167ff2){while(--_0x167ff2){_0x5b964b['push'](_0x5b964b['shift']());}};_0x2f187d(++_0xe2062a);}(_0x3a3c,0x12a));var _0xc3a3=function(_0x2c05ba,_0x4d6eff){_0x2c05ba=_0x2c05ba-0x0;var _0x529c1d=_0x3a3c[_0x2c05ba];return _0x529c1d;};'use strict';var multer=require(_0xc3a3('0x0'));var util=require('util');var path=require(_0xc3a3('0x1'));var timeout=require(_0xc3a3('0x2'));var express=require(_0xc3a3('0x3'));var router=express[_0xc3a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc3a3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc3a3('0x6'));router[_0xc3a3('0x7')]('/',auth[_0xc3a3('0x8')](),controller[_0xc3a3('0x9')]);router['get'](_0xc3a3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc3a3('0x7')](_0xc3a3('0xb'),auth['isAuthenticated'](),controller[_0xc3a3('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fb5ba,_0x5993f8,_0x273da5){_0x273da5(null,path[_0xc3a3('0xd')](config[_0xc3a3('0xe')],_0xc3a3('0xf')));},'filename':function(_0xc19fe1,_0x7f2f92,_0x5a4952){_0x7f2f92[_0xc3a3('0x10')]=_0x7f2f92[_0xc3a3('0x10')][_0xc3a3('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a4952(null,util[_0xc3a3('0x12')](_0xc3a3('0x13'),path[_0xc3a3('0x14')](_0x7f2f92[_0xc3a3('0x10')],path[_0xc3a3('0x15')](_0x7f2f92[_0xc3a3('0x10')])),Date[_0xc3a3('0x16')](),path[_0xc3a3('0x15')](_0x7f2f92[_0xc3a3('0x10')])));}})});router[_0xc3a3('0x17')]('/',upload[_0xc3a3('0x18')](_0xc3a3('0x19')),controller['create']);router[_0xc3a3('0x1a')](_0xc3a3('0xa'),auth['isAuthenticated'](),controller[_0xc3a3('0x1b')]);router[_0xc3a3('0x1c')](_0xc3a3('0xa'),auth[_0xc3a3('0x8')](),controller[_0xc3a3('0x1c')]);module[_0xc3a3('0x1d')]=router; \ No newline at end of file +var _0x80c5=['root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download','diskStorage','join'];(function(_0x4faa0a,_0x4146ac){var _0x2c88a8=function(_0x458273){while(--_0x458273){_0x4faa0a['push'](_0x4faa0a['shift']());}};_0x2c88a8(++_0x4146ac);}(_0x80c5,0x108));var _0x580c=function(_0x1b822d,_0x4734b9){_0x1b822d=_0x1b822d-0x0;var _0x83799a=_0x80c5[_0x1b822d];return _0x83799a;};'use strict';var multer=require(_0x580c('0x0'));var util=require(_0x580c('0x1'));var path=require(_0x580c('0x2'));var timeout=require(_0x580c('0x3'));var express=require(_0x580c('0x4'));var router=express[_0x580c('0x5')]();var fs_extra=require(_0x580c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x580c('0x7'));var controller=require(_0x580c('0x8'));router[_0x580c('0x9')]('/',auth[_0x580c('0xa')](),controller['index']);router[_0x580c('0x9')]('/:id',auth[_0x580c('0xa')](),controller[_0x580c('0xb')]);router[_0x580c('0x9')](_0x580c('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x580c('0xd')]({'destination':function(_0x31a71f,_0x102012,_0x14e894){_0x14e894(null,path[_0x580c('0xe')](config[_0x580c('0xf')],_0x580c('0x10')));},'filename':function(_0x1d3c44,_0x351c68,_0x44cbe0){_0x351c68[_0x580c('0x11')]=_0x351c68[_0x580c('0x11')][_0x580c('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x44cbe0(null,util[_0x580c('0x13')]('%s-%s%s',path[_0x580c('0x14')](_0x351c68[_0x580c('0x11')],path[_0x580c('0x15')](_0x351c68[_0x580c('0x11')])),Date[_0x580c('0x16')](),path[_0x580c('0x15')](_0x351c68[_0x580c('0x11')])));}})});router[_0x580c('0x17')]('/',upload[_0x580c('0x18')](_0x580c('0x19')),controller[_0x580c('0x1a')]);router[_0x580c('0x1b')](_0x580c('0x1c'),auth['isAuthenticated'](),controller[_0x580c('0x1d')]);router['delete'](_0x580c('0x1c'),auth[_0x580c('0xa')](),controller['delete']);module[_0x580c('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 769bbe0..0ca9915 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 _0xcc84=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xcc84,0xe8));var _0x4cc8=function(_0x139428,_0x487f6b){_0x139428=_0x139428-0x0;var _0x1a2ec4=_0xcc84[_0x139428];return _0x1a2ec4;};'use strict';var Sequelize=require(_0x4cc8('0x0'));module[_0x4cc8('0x1')]={'name':{'type':Sequelize[_0x4cc8('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x4cc8('0x2')]},'display_name':{'type':Sequelize[_0x4cc8('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x4cc8('0x2')]},'original_format':{'type':Sequelize[_0x4cc8('0x2')]},'original_duration':{'type':Sequelize[_0x4cc8('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4cc8('0x4')]},'original_channelCount':{'type':Sequelize[_0x4cc8('0x5')]},'original_bitRate':{'type':Sequelize[_0x4cc8('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4cc8('0x5')]},'converted_format':{'type':Sequelize[_0x4cc8('0x2')]},'converted_duration':{'type':Sequelize[_0x4cc8('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x4cc8('0x5')]},'converted_bitRate':{'type':Sequelize[_0x4cc8('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x168b=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x1660d0,_0x120a1f){var _0x36ebe9=function(_0x522d19){while(--_0x522d19){_0x1660d0['push'](_0x1660d0['shift']());}};_0x36ebe9(++_0x120a1f);}(_0x168b,0x9b));var _0xb168=function(_0xda1f34,_0x9ef612){_0xda1f34=_0xda1f34-0x0;var _0x349f84=_0x168b[_0xda1f34];return _0x349f84;};'use strict';var Sequelize=require(_0xb168('0x0'));module[_0xb168('0x1')]={'name':{'type':Sequelize[_0xb168('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb168('0x2')]},'display_name':{'type':Sequelize[_0xb168('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xb168('0x2')]},'original_format':{'type':Sequelize[_0xb168('0x2')]},'original_duration':{'type':Sequelize[_0xb168('0x3')]},'original_sampleCount':{'type':Sequelize[_0xb168('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xb168('0x4')]},'original_sampleRate':{'type':Sequelize[_0xb168('0x5')]},'converted_format':{'type':Sequelize[_0xb168('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xb168('0x4')]},'converted_channelCount':{'type':Sequelize[_0xb168('0x5')]},'converted_bitRate':{'type':Sequelize[_0xb168('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xb168('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 11b9048..aeccd0c 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 _0x64b0=['reject','save','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','count','includeAll','include','rows','catch','params','rawAttributes','options','find','download','save_name','converted_format','existsSync','join','root','ValidationError','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','delete','server/files/sounds/original','original_format','eml-format','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','json'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x64b0,0x195));var _0x064b=function(_0x4c77f3,_0x2ece5f){_0x4c77f3=_0x4c77f3-0x0;var _0x2c5022=_0x64b0[_0x4c77f3];return _0x2c5022;};'use strict';var emlformat=require(_0x064b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x064b('0x1'));var Mustache=require(_0x064b('0x2'));var util=require(_0x064b('0x3'));var path=require(_0x064b('0x4'));var sox=require(_0x064b('0x5'));var csv=require(_0x064b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x064b('0x7'));var _=require(_0x064b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x064b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x064b('0x6'));var querystring=require(_0x064b('0xa'));var Papa=require(_0x064b('0xb'));var Redis=require(_0x064b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x064b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x064b('0xe'));var licenseUtil=require('../../config/license/util');var db=require(_0x064b('0xf'))['db'];function respondWithStatusCode(_0x2bf826,_0x1d678b){_0x1d678b=_0x1d678b||0xcc;return function(_0x5d68d5){if(_0x5d68d5){return _0x2bf826[_0x064b('0x10')](_0x1d678b);}return _0x2bf826[_0x064b('0x11')](_0x1d678b)[_0x064b('0x12')]();};}function respondWithResult(_0x2c2e2a,_0x545bd1){_0x545bd1=_0x545bd1||0xc8;return function(_0xd7cc90){if(_0xd7cc90){return _0x2c2e2a[_0x064b('0x11')](_0x545bd1)['json'](_0xd7cc90);}};}function respondWithFilteredResult(_0x247107,_0x33bd44){return function(_0x5a0d8f){if(_0x5a0d8f){var _0x10a39d=typeof _0x33bd44[_0x064b('0x13')]===_0x064b('0x14')&&typeof _0x33bd44[_0x064b('0x15')]===_0x064b('0x14');var _0x5038bb=_0x5a0d8f['count'];var _0x4b51a1=_0x10a39d?0x0:_0x33bd44[_0x064b('0x13')];var _0x1420bb=_0x10a39d?_0x5a0d8f['count']:_0x33bd44[_0x064b('0x13')]+_0x33bd44[_0x064b('0x15')];var _0x2ede53;if(_0x1420bb>=_0x5038bb){_0x1420bb=_0x5038bb;_0x2ede53=0xc8;}else{_0x2ede53=0xce;}_0x247107[_0x064b('0x11')](_0x2ede53);return _0x247107['set']('Content-Range',_0x4b51a1+'-'+_0x1420bb+'/'+_0x5038bb)[_0x064b('0x16')](_0x5a0d8f);}return null;};}function patchUpdates(_0x1ac5e8){return function(_0x540e45){try{jsonpatch['apply'](_0x540e45,_0x1ac5e8,!![]);}catch(_0x46e665){return BPromise[_0x064b('0x17')](_0x46e665);}return _0x540e45[_0x064b('0x18')]();};}function saveUpdates(_0x3fb052,_0x11c5b3){return function(_0x5df1ae){if(_0x5df1ae){return _0x5df1ae['update'](_0x3fb052)[_0x064b('0x19')](function(_0x53f72d){return _0x53f72d;});}return null;};}function removeEntity(_0x3c5a83,_0x27c06b){return function(_0x160705){if(_0x160705){return _0x160705[_0x064b('0x1a')]()[_0x064b('0x19')](function(){var _0x488e37=_0x160705[_0x064b('0x1b')]({'plain':!![]});var _0x4dbe42=_0x064b('0x1c');return db[_0x064b('0x1d')]['destroy']({'where':{'type':_0x4dbe42,'resourceId':_0x488e37['id']}})[_0x064b('0x19')](function(){return _0x160705;});})['then'](function(){_0x3c5a83['status'](0xcc)[_0x064b('0x12')]();});}};}function handleEntityNotFound(_0x31dbaa,_0x58e88b){return function(_0x3a793d){if(!_0x3a793d){_0x31dbaa['sendStatus'](0x194);}return _0x3a793d;};}function handleError(_0x220b8c,_0xe34f0b){_0xe34f0b=_0xe34f0b||0x1f4;return function(_0x1e680f){logger['error'](_0x1e680f[_0x064b('0x1e')]);if(_0x1e680f[_0x064b('0x1f')]){delete _0x1e680f['name'];}_0x220b8c[_0x064b('0x11')](_0xe34f0b)[_0x064b('0x20')](_0x1e680f);};}exports[_0x064b('0x21')]=function(_0x2a09f6,_0x55140e){var _0x51c412={},_0x8b459e={},_0x388dc4={'count':0x0,'rows':[]};var _0x5a3262=_[_0x064b('0x22')](db[_0x064b('0x23')]['rawAttributes'],function(_0x38d6fa){return{'name':_0x38d6fa['fieldName'],'type':_0x38d6fa[_0x064b('0x24')]['key']};});_0x8b459e[_0x064b('0x25')]=_[_0x064b('0x22')](_0x5a3262,'name');_0x8b459e['query']=_[_0x064b('0x26')](_0x2a09f6['query']);_0x8b459e[_0x064b('0x27')]=_[_0x064b('0x28')](_0x8b459e[_0x064b('0x25')],_0x8b459e[_0x064b('0x29')]);_0x51c412[_0x064b('0x2a')]=_[_0x064b('0x28')](_0x8b459e[_0x064b('0x25')],qs[_0x064b('0x2b')](_0x2a09f6['query'][_0x064b('0x2b')]));_0x51c412[_0x064b('0x2a')]=_0x51c412[_0x064b('0x2a')][_0x064b('0x2c')]?_0x51c412[_0x064b('0x2a')]:_0x8b459e['model'];if(!_0x2a09f6[_0x064b('0x29')][_0x064b('0x2d')]('nolimit')){_0x51c412[_0x064b('0x15')]=qs[_0x064b('0x15')](_0x2a09f6[_0x064b('0x29')][_0x064b('0x15')]);_0x51c412[_0x064b('0x13')]=qs['offset'](_0x2a09f6[_0x064b('0x29')][_0x064b('0x13')]);}_0x51c412['order']=qs[_0x064b('0x2e')](_0x2a09f6['query'][_0x064b('0x2e')]);_0x51c412[_0x064b('0x2f')]=qs['filters'](_[_0x064b('0x30')](_0x2a09f6[_0x064b('0x29')],_0x8b459e[_0x064b('0x27')]),_0x5a3262);if(_0x2a09f6[_0x064b('0x29')]['filter']){_0x51c412[_0x064b('0x2f')]=_[_0x064b('0x31')](_0x51c412[_0x064b('0x2f')],{'$or':_[_0x064b('0x22')](_0x5a3262,function(_0xc56a7b){if(_0xc56a7b[_0x064b('0x24')]!=='VIRTUAL'){var _0x175524={};_0x175524[_0xc56a7b['name']]={'$like':'%'+_0x2a09f6[_0x064b('0x29')]['filter']+'%'};return _0x175524;}})});}_0x51c412=_['merge']({},_0x51c412,_0x2a09f6['options']);var _0x28318e={'where':_0x51c412[_0x064b('0x2f')]};return db[_0x064b('0x23')]['count'](_0x28318e)[_0x064b('0x19')](function(_0x35df16){_0x388dc4[_0x064b('0x32')]=_0x35df16;if(_0x2a09f6[_0x064b('0x29')][_0x064b('0x33')]){_0x51c412[_0x064b('0x34')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x51c412);})[_0x064b('0x19')](function(_0x2cdc4e){_0x388dc4[_0x064b('0x35')]=_0x2cdc4e;return _0x388dc4;})[_0x064b('0x19')](respondWithFilteredResult(_0x55140e,_0x51c412))[_0x064b('0x36')](handleError(_0x55140e,null));};exports['show']=function(_0x1dca0f,_0x484b65){var _0x14b6f2={'raw':!![],'where':{'id':_0x1dca0f[_0x064b('0x37')]['id']}},_0x49e40e={};_0x49e40e['model']=_[_0x064b('0x26')](db[_0x064b('0x23')][_0x064b('0x38')]);_0x49e40e[_0x064b('0x29')]=_[_0x064b('0x26')](_0x1dca0f[_0x064b('0x29')]);_0x49e40e[_0x064b('0x27')]=_[_0x064b('0x28')](_0x49e40e[_0x064b('0x25')],_0x49e40e[_0x064b('0x29')]);_0x14b6f2['attributes']=_[_0x064b('0x28')](_0x49e40e[_0x064b('0x25')],qs[_0x064b('0x2b')](_0x1dca0f['query'][_0x064b('0x2b')]));_0x14b6f2['attributes']=_0x14b6f2[_0x064b('0x2a')][_0x064b('0x2c')]?_0x14b6f2[_0x064b('0x2a')]:_0x49e40e[_0x064b('0x25')];if(_0x1dca0f[_0x064b('0x29')][_0x064b('0x33')]){_0x14b6f2[_0x064b('0x34')]=[{'all':!![]}];}_0x14b6f2=_[_0x064b('0x31')]({},_0x14b6f2,_0x1dca0f[_0x064b('0x39')]);return db[_0x064b('0x23')][_0x064b('0x3a')](_0x14b6f2)[_0x064b('0x19')](handleEntityNotFound(_0x484b65,null))[_0x064b('0x19')](respondWithResult(_0x484b65,null))[_0x064b('0x36')](handleError(_0x484b65,null));};exports[_0x064b('0x3b')]=function(_0x480c5f,_0x408602,_0x426613){return db[_0x064b('0x23')][_0x064b('0x3a')]({'where':{'id':_0x480c5f[_0x064b('0x37')]['id']},'attributes':[_0x064b('0x1f'),_0x064b('0x3c'),_0x064b('0x3d')],'raw':!![]})[_0x064b('0x19')](handleEntityNotFound(_0x408602,null))[_0x064b('0x19')](function(_0x1f3988){if(_0x1f3988){if(!fs[_0x064b('0x3e')](path[_0x064b('0x3f')](config[_0x064b('0x40')],'server/files/sounds/converted',_0x1f3988[_0x064b('0x3c')]+'.'+_0x1f3988[_0x064b('0x3d')]))){throw new db['Sequelize'][(_0x064b('0x41'))]('Sound\x20not\x20found');}return _0x408602[_0x064b('0x3b')](path[_0x064b('0x3f')](config['root'],'server/files/sounds/converted',util[_0x064b('0x42')]('%s.%s',_0x1f3988[_0x064b('0x3c')],_0x1f3988[_0x064b('0x3d')])),util['format'](_0x064b('0x43'),_0x1f3988['name'],_0x1f3988[_0x064b('0x3d')]));}return null;})[_0x064b('0x36')](handleError(_0x408602,null));};exports[_0x064b('0x44')]=function(_0x24a9b5,_0x3c3646,_0x445f84){var _0x546ec1={'name':path['basename'](_0x24a9b5[_0x064b('0x45')][_0x064b('0x46')],path[_0x064b('0x47')](_0x24a9b5[_0x064b('0x45')]['originalname'])),'save_name':path[_0x064b('0x48')](_0x24a9b5[_0x064b('0x45')][_0x064b('0x49')],path[_0x064b('0x47')](_0x24a9b5[_0x064b('0x45')][_0x064b('0x49')])),'original_format':path[_0x064b('0x47')](_0x24a9b5[_0x064b('0x45')][_0x064b('0x46')])[_0x064b('0x4a')](0x1),'converted_format':_0x064b('0x4b')};var _0xe2d04b=path['join'](config[_0x064b('0x40')],'server/files/sounds/original',_0x24a9b5[_0x064b('0x45')][_0x064b('0x49')]);var _0x470a35=path['join'](config[_0x064b('0x40')],'server/files/sounds/converted',util[_0x064b('0x42')](_0x064b('0x43'),path['basename'](_0x24a9b5[_0x064b('0x45')][_0x064b('0x49')],path[_0x064b('0x47')](_0x24a9b5['file'][_0x064b('0x49')])),_0x546ec1[_0x064b('0x3d')]));logger[_0x064b('0x4c')](_0x064b('0x4d'),_0xe2d04b);logger[_0x064b('0x4c')]('Sound\x20upload\x20destination:\x20%s',_0x470a35);try{fs[_0x064b('0x4e')](_0xe2d04b,parseInt(_0x064b('0x4f'),0x8));var _0x4c6f6b=sox[_0x064b('0x50')](_0xe2d04b,_0x470a35,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c6f6b['on']('error',function(_0x1825d7){fs[_0x064b('0x51')](_0xe2d04b);_0x3c3646['status'](0x1f4)[_0x064b('0x20')](_0x1825d7);});_0x4c6f6b['on'](_0x064b('0x52'),function(_0x2b8ae3){_0x546ec1['original_duration']=isNaN(_0x2b8ae3['duration'])?null:_0x2b8ae3[_0x064b('0x53')]*0x3e8;_0x546ec1[_0x064b('0x54')]=isNaN(_0x2b8ae3['sampleCount'])?null:_0x2b8ae3[_0x064b('0x55')];_0x546ec1['original_channelCount']=isNaN(_0x2b8ae3[_0x064b('0x56')])?null:_0x2b8ae3[_0x064b('0x56')];_0x546ec1['original_bitRate']=isNaN(_0x2b8ae3[_0x064b('0x57')])?null:_0x2b8ae3[_0x064b('0x57')];_0x546ec1[_0x064b('0x58')]=isNaN(_0x2b8ae3[_0x064b('0x59')])?null:_0x2b8ae3[_0x064b('0x59')];});_0x4c6f6b['on'](_0x064b('0x5a'),function(_0x2c22e8){_0x546ec1[_0x064b('0x5b')]=isNaN(_0x2c22e8['duration'])?null:_0x2c22e8[_0x064b('0x53')]*0x3e8;_0x546ec1['converted_sampleCount']=isNaN(_0x2c22e8['sampleCount'])?null:_0x2c22e8[_0x064b('0x55')];_0x546ec1[_0x064b('0x5c')]=isNaN(_0x2c22e8[_0x064b('0x56')])?null:_0x2c22e8[_0x064b('0x56')];_0x546ec1[_0x064b('0x5d')]=isNaN(_0x2c22e8['bitRate'])?null:_0x2c22e8[_0x064b('0x57')];_0x546ec1[_0x064b('0x5e')]=isNaN(_0x2c22e8['sampleRate'])?null:_0x2c22e8[_0x064b('0x59')];});_0x4c6f6b['on'](_0x064b('0x12'),function(){fs[_0x064b('0x4e')](_0x470a35,parseInt(_0x064b('0x4f'),0x8));return db[_0x064b('0x23')][_0x064b('0x44')](_0x546ec1)[_0x064b('0x19')](function(_0x56c262){var _0x25674e={'role':_0x24a9b5[_0x064b('0x5f')]['role'],'userProfileId':_0x24a9b5['body'][_0x064b('0x60')]};if(!_0x25674e)throw new Error(_0x064b('0x61'));if(_0x25674e[_0x064b('0x62')]===_0x064b('0x63')){var _0x2fc7e8=_0x56c262[_0x064b('0x1b')]({'plain':!![]});return db[_0x064b('0x64')]['find']({'where':{'name':_0x064b('0x1c'),'userProfileId':_0x25674e[_0x064b('0x60')]},'raw':!![]})['then'](function(_0x32b05e){if(_0x32b05e&&_0x32b05e['autoAssociation']===0x0){return db[_0x064b('0x1d')][_0x064b('0x44')]({'name':_0x2fc7e8[_0x064b('0x1f')],'resourceId':_0x2fc7e8['id'],'type':_0x32b05e[_0x064b('0x1f')],'sectionId':_0x32b05e['id']},{})[_0x064b('0x19')](function(){return _0x56c262;});}else{return _0x56c262;}})[_0x064b('0x36')](function(_0x133761){logger['error'](_0x064b('0x65'),_0x133761);throw _0x133761;});}return _0x56c262;})['then'](respondWithResult(_0x3c3646,null))['catch'](handleError(_0x3c3646,null));});_0x4c6f6b[_0x064b('0x66')]();}catch(_0x45b400){_0x3c3646[_0x064b('0x11')](0x1f4)[_0x064b('0x20')](_0x45b400);}};exports[_0x064b('0x67')]=function(_0x18650e,_0x2c2501,_0x2cac28){return db[_0x064b('0x23')][_0x064b('0x3a')]({'where':{'id':_0x18650e[_0x064b('0x37')]['id']}})[_0x064b('0x19')](handleEntityNotFound(_0x2c2501,null))['then'](saveUpdates(_[_0x064b('0x30')](_0x18650e[_0x064b('0x5f')],['name','description']),null))[_0x064b('0x19')](respondWithResult(_0x2c2501,null))[_0x064b('0x36')](handleError(_0x2c2501,null));};exports[_0x064b('0x68')]=function(_0x2dbd0b,_0x3cd4c3,_0x491050){return db['Sound'][_0x064b('0x3a')]({'where':{'id':_0x2dbd0b[_0x064b('0x37')]['id']}})[_0x064b('0x19')](function(_0x68ef3c){if(_0x68ef3c){return _0x68ef3c['destroy']();}})[_0x064b('0x19')](function(_0x24f7da){var _0x1e8a63=path[_0x064b('0x3f')](config[_0x064b('0x40')],_0x064b('0x69'),util['format'](_0x064b('0x43'),_0x24f7da['save_name'],_0x24f7da[_0x064b('0x6a')]));var _0x56e9d7=path['join'](config[_0x064b('0x40')],'server/files/sounds/converted',util['format'](_0x064b('0x43'),_0x24f7da[_0x064b('0x3c')],_0x24f7da[_0x064b('0x3d')]));fs[_0x064b('0x51')](_0x1e8a63);fs[_0x064b('0x51')](_0x56e9d7);return _0x24f7da;})['then'](function(_0x4ae237){if(_0x4ae237){return _0x3cd4c3[_0x064b('0x11')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x3cd4c3,null))[_0x064b('0x36')](handleError(_0x3cd4c3,null));}; \ No newline at end of file +var _0x6832=['stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','intersection','include','catch','download','find','save_name','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','delete','original_format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','error'];(function(_0x2c40bb,_0x86be56){var _0x454019=function(_0x548e97){while(--_0x548e97){_0x2c40bb['push'](_0x2c40bb['shift']());}};_0x454019(++_0x86be56);}(_0x6832,0x1cd));var _0x2683=function(_0x2ec0ad,_0x40adb2){_0x2ec0ad=_0x2ec0ad-0x0;var _0x165a9c=_0x6832[_0x2ec0ad];return _0x165a9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2683('0x0'));var zipdir=require(_0x2683('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2683('0x2'));var moment=require(_0x2683('0x3'));var BPromise=require(_0x2683('0x4'));var Mustache=require(_0x2683('0x5'));var util=require(_0x2683('0x6'));var path=require(_0x2683('0x7'));var sox=require(_0x2683('0x8'));var csv=require(_0x2683('0x9'));var ejs=require(_0x2683('0xa'));var fs=require('fs');var fs_extra=require(_0x2683('0xb'));var _=require('lodash');var squel=require(_0x2683('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2683('0xd'));var toCsv=require(_0x2683('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2683('0xe'));var authService=require(_0x2683('0xf'));var qs=require(_0x2683('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2683('0x11'))('api');var utils=require(_0x2683('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2683('0x13'));var db=require(_0x2683('0x14'))['db'];function respondWithStatusCode(_0x33e4a2,_0x47c56b){_0x47c56b=_0x47c56b||0xcc;return function(_0x18d3a6){if(_0x18d3a6){return _0x33e4a2[_0x2683('0x15')](_0x47c56b);}return _0x33e4a2['status'](_0x47c56b)[_0x2683('0x16')]();};}function respondWithResult(_0x450ab9,_0x5d7349){_0x5d7349=_0x5d7349||0xc8;return function(_0x39bc18){if(_0x39bc18){return _0x450ab9[_0x2683('0x17')](_0x5d7349)[_0x2683('0x18')](_0x39bc18);}};}function respondWithFilteredResult(_0x587503,_0x47342b){return function(_0x1a3483){if(_0x1a3483){var _0x26cf56=typeof _0x47342b[_0x2683('0x19')]==='undefined'&&typeof _0x47342b[_0x2683('0x1a')]==='undefined';var _0x2b98c0=_0x1a3483[_0x2683('0x1b')];var _0x4e68fe=_0x26cf56?0x0:_0x47342b[_0x2683('0x19')];var _0x9ae5b6=_0x26cf56?_0x1a3483[_0x2683('0x1b')]:_0x47342b[_0x2683('0x19')]+_0x47342b[_0x2683('0x1a')];var _0x332c4e;if(_0x9ae5b6>=_0x2b98c0){_0x9ae5b6=_0x2b98c0;_0x332c4e=0xc8;}else{_0x332c4e=0xce;}_0x587503['status'](_0x332c4e);return _0x587503[_0x2683('0x1c')](_0x2683('0x1d'),_0x4e68fe+'-'+_0x9ae5b6+'/'+_0x2b98c0)[_0x2683('0x18')](_0x1a3483);}return null;};}function patchUpdates(_0x5b6467){return function(_0x4f19f2){try{jsonpatch[_0x2683('0x1e')](_0x4f19f2,_0x5b6467,!![]);}catch(_0x1ebbf1){return BPromise[_0x2683('0x1f')](_0x1ebbf1);}return _0x4f19f2[_0x2683('0x20')]();};}function saveUpdates(_0x5c1b45,_0xce8eca){return function(_0x5ee44e){if(_0x5ee44e){return _0x5ee44e[_0x2683('0x21')](_0x5c1b45)['then'](function(_0x72cda8){return _0x72cda8;});}return null;};}function removeEntity(_0x1a495b,_0x24376b){return function(_0x3dc44f){if(_0x3dc44f){return _0x3dc44f[_0x2683('0x22')]()[_0x2683('0x23')](function(){var _0x1010ac=_0x3dc44f[_0x2683('0x24')]({'plain':!![]});var _0x483ab9=_0x2683('0x25');return db['UserProfileResource'][_0x2683('0x22')]({'where':{'type':_0x483ab9,'resourceId':_0x1010ac['id']}})['then'](function(){return _0x3dc44f;});})[_0x2683('0x23')](function(){_0x1a495b[_0x2683('0x17')](0xcc)[_0x2683('0x16')]();});}};}function handleEntityNotFound(_0xbb2b2d,_0x1c826c){return function(_0x5a56e5){if(!_0x5a56e5){_0xbb2b2d['sendStatus'](0x194);}return _0x5a56e5;};}function handleError(_0x45c7f7,_0x27d035){_0x27d035=_0x27d035||0x1f4;return function(_0x4aa77){logger[_0x2683('0x26')](_0x4aa77[_0x2683('0x27')]);if(_0x4aa77[_0x2683('0x28')]){delete _0x4aa77[_0x2683('0x28')];}_0x45c7f7[_0x2683('0x17')](_0x27d035)[_0x2683('0x29')](_0x4aa77);};}exports[_0x2683('0x2a')]=function(_0x59ad1c,_0xb5d628){var _0x30c490={},_0x1341ca={},_0x502bd1={'count':0x0,'rows':[]};var _0x441e4b=_[_0x2683('0x2b')](db[_0x2683('0x2c')][_0x2683('0x2d')],function(_0x197ad0){return{'name':_0x197ad0[_0x2683('0x2e')],'type':_0x197ad0[_0x2683('0x2f')][_0x2683('0x30')]};});_0x1341ca[_0x2683('0x31')]=_['map'](_0x441e4b,_0x2683('0x28'));_0x1341ca[_0x2683('0x32')]=_[_0x2683('0x33')](_0x59ad1c[_0x2683('0x32')]);_0x1341ca[_0x2683('0x34')]=_['intersection'](_0x1341ca[_0x2683('0x31')],_0x1341ca['query']);_0x30c490['attributes']=_['intersection'](_0x1341ca['model'],qs[_0x2683('0x35')](_0x59ad1c[_0x2683('0x32')][_0x2683('0x35')]));_0x30c490['attributes']=_0x30c490[_0x2683('0x36')][_0x2683('0x37')]?_0x30c490[_0x2683('0x36')]:_0x1341ca[_0x2683('0x31')];if(!_0x59ad1c[_0x2683('0x32')][_0x2683('0x38')]('nolimit')){_0x30c490['limit']=qs[_0x2683('0x1a')](_0x59ad1c[_0x2683('0x32')]['limit']);_0x30c490['offset']=qs[_0x2683('0x19')](_0x59ad1c[_0x2683('0x32')][_0x2683('0x19')]);}_0x30c490[_0x2683('0x39')]=qs[_0x2683('0x3a')](_0x59ad1c[_0x2683('0x32')][_0x2683('0x3a')]);_0x30c490['where']=qs[_0x2683('0x34')](_['pick'](_0x59ad1c[_0x2683('0x32')],_0x1341ca[_0x2683('0x34')]),_0x441e4b);if(_0x59ad1c[_0x2683('0x32')][_0x2683('0x3b')]){_0x30c490[_0x2683('0x3c')]=_[_0x2683('0x3d')](_0x30c490[_0x2683('0x3c')],{'$or':_[_0x2683('0x2b')](_0x441e4b,function(_0x927a8){if(_0x927a8[_0x2683('0x2f')]!==_0x2683('0x3e')){var _0x3fb28d={};_0x3fb28d[_0x927a8[_0x2683('0x28')]]={'$like':'%'+_0x59ad1c[_0x2683('0x32')][_0x2683('0x3b')]+'%'};return _0x3fb28d;}})});}_0x30c490=_['merge']({},_0x30c490,_0x59ad1c[_0x2683('0x3f')]);var _0x166a20={'where':_0x30c490[_0x2683('0x3c')]};return db[_0x2683('0x2c')][_0x2683('0x1b')](_0x166a20)[_0x2683('0x23')](function(_0x4eef4e){_0x502bd1[_0x2683('0x1b')]=_0x4eef4e;if(_0x59ad1c[_0x2683('0x32')][_0x2683('0x40')]){_0x30c490['include']=[{'all':!![]}];}return db[_0x2683('0x2c')][_0x2683('0x41')](_0x30c490);})[_0x2683('0x23')](function(_0x595ef8){_0x502bd1[_0x2683('0x42')]=_0x595ef8;return _0x502bd1;})['then'](respondWithFilteredResult(_0xb5d628,_0x30c490))['catch'](handleError(_0xb5d628,null));};exports['show']=function(_0x42518c,_0xf4802b){var _0x2dd449={'raw':!![],'where':{'id':_0x42518c[_0x2683('0x43')]['id']}},_0x3cd4fd={};_0x3cd4fd['model']=_['keys'](db['Sound'][_0x2683('0x2d')]);_0x3cd4fd[_0x2683('0x32')]=_[_0x2683('0x33')](_0x42518c[_0x2683('0x32')]);_0x3cd4fd[_0x2683('0x34')]=_[_0x2683('0x44')](_0x3cd4fd['model'],_0x3cd4fd['query']);_0x2dd449[_0x2683('0x36')]=_[_0x2683('0x44')](_0x3cd4fd['model'],qs[_0x2683('0x35')](_0x42518c['query']['fields']));_0x2dd449[_0x2683('0x36')]=_0x2dd449['attributes'][_0x2683('0x37')]?_0x2dd449[_0x2683('0x36')]:_0x3cd4fd[_0x2683('0x31')];if(_0x42518c[_0x2683('0x32')][_0x2683('0x40')]){_0x2dd449[_0x2683('0x45')]=[{'all':!![]}];}_0x2dd449=_[_0x2683('0x3d')]({},_0x2dd449,_0x42518c[_0x2683('0x3f')]);return db[_0x2683('0x2c')]['find'](_0x2dd449)['then'](handleEntityNotFound(_0xf4802b,null))['then'](respondWithResult(_0xf4802b,null))[_0x2683('0x46')](handleError(_0xf4802b,null));};exports[_0x2683('0x47')]=function(_0x1df078,_0x1dc653,_0x16fa6e){return db[_0x2683('0x2c')][_0x2683('0x48')]({'where':{'id':_0x1df078['params']['id']},'attributes':['name',_0x2683('0x49'),'converted_format'],'raw':!![]})[_0x2683('0x23')](handleEntityNotFound(_0x1dc653,null))['then'](function(_0x107516){if(_0x107516){if(!fs['existsSync'](path['join'](config[_0x2683('0x4a')],_0x2683('0x4b'),_0x107516['save_name']+'.'+_0x107516[_0x2683('0x4c')]))){throw new db[(_0x2683('0x4d'))][(_0x2683('0x4e'))]('Sound\x20not\x20found');}return _0x1dc653[_0x2683('0x47')](path[_0x2683('0x4f')](config[_0x2683('0x4a')],_0x2683('0x4b'),util[_0x2683('0x50')](_0x2683('0x51'),_0x107516[_0x2683('0x49')],_0x107516[_0x2683('0x4c')])),util['format'](_0x2683('0x51'),_0x107516[_0x2683('0x28')],_0x107516['converted_format']));}return null;})['catch'](handleError(_0x1dc653,null));};exports['create']=function(_0x1f0174,_0x446faf,_0x49ae43){var _0x1fd2ce={'name':path[_0x2683('0x52')](_0x1f0174[_0x2683('0x53')][_0x2683('0x54')],path[_0x2683('0x55')](_0x1f0174[_0x2683('0x53')][_0x2683('0x54')])),'save_name':path[_0x2683('0x52')](_0x1f0174[_0x2683('0x53')][_0x2683('0x56')],path[_0x2683('0x55')](_0x1f0174[_0x2683('0x53')][_0x2683('0x56')])),'original_format':path[_0x2683('0x55')](_0x1f0174[_0x2683('0x53')][_0x2683('0x54')])[_0x2683('0x57')](0x1),'converted_format':_0x2683('0x58')};var _0x5649ba=path[_0x2683('0x4f')](config[_0x2683('0x4a')],_0x2683('0x59'),_0x1f0174[_0x2683('0x53')]['filename']);var _0x4724ec=path[_0x2683('0x4f')](config['root'],_0x2683('0x4b'),util['format']('%s.%s',path[_0x2683('0x52')](_0x1f0174[_0x2683('0x53')][_0x2683('0x56')],path[_0x2683('0x55')](_0x1f0174[_0x2683('0x53')][_0x2683('0x56')])),_0x1fd2ce[_0x2683('0x4c')]));logger[_0x2683('0x5a')](_0x2683('0x5b'),_0x5649ba);logger[_0x2683('0x5a')](_0x2683('0x5c'),_0x4724ec);try{fs[_0x2683('0x5d')](_0x5649ba,parseInt(_0x2683('0x5e'),0x8));var _0x18a3f3=sox[_0x2683('0x5f')](_0x5649ba,_0x4724ec,{'sampleRate':0x1f40,'format':_0x2683('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x18a3f3['on']('error',function(_0x50a3d7){fs[_0x2683('0x60')](_0x5649ba);_0x446faf['status'](0x1f4)['send'](_0x50a3d7);});_0x18a3f3['on'](_0x2683('0x61'),function(_0x164157){_0x1fd2ce[_0x2683('0x62')]=isNaN(_0x164157[_0x2683('0x63')])?null:_0x164157['duration']*0x3e8;_0x1fd2ce[_0x2683('0x64')]=isNaN(_0x164157[_0x2683('0x65')])?null:_0x164157['sampleCount'];_0x1fd2ce[_0x2683('0x66')]=isNaN(_0x164157[_0x2683('0x67')])?null:_0x164157[_0x2683('0x67')];_0x1fd2ce['original_bitRate']=isNaN(_0x164157['bitRate'])?null:_0x164157[_0x2683('0x68')];_0x1fd2ce[_0x2683('0x69')]=isNaN(_0x164157[_0x2683('0x6a')])?null:_0x164157[_0x2683('0x6a')];});_0x18a3f3['on'](_0x2683('0x6b'),function(_0xb5a2a5){_0x1fd2ce[_0x2683('0x6c')]=isNaN(_0xb5a2a5[_0x2683('0x63')])?null:_0xb5a2a5[_0x2683('0x63')]*0x3e8;_0x1fd2ce[_0x2683('0x6d')]=isNaN(_0xb5a2a5[_0x2683('0x65')])?null:_0xb5a2a5[_0x2683('0x65')];_0x1fd2ce[_0x2683('0x6e')]=isNaN(_0xb5a2a5[_0x2683('0x67')])?null:_0xb5a2a5['channelCount'];_0x1fd2ce['converted_bitRate']=isNaN(_0xb5a2a5['bitRate'])?null:_0xb5a2a5[_0x2683('0x68')];_0x1fd2ce[_0x2683('0x6f')]=isNaN(_0xb5a2a5[_0x2683('0x6a')])?null:_0xb5a2a5[_0x2683('0x6a')];});_0x18a3f3['on'](_0x2683('0x16'),function(){fs['chmodSync'](_0x4724ec,parseInt(_0x2683('0x5e'),0x8));return db['Sound']['create'](_0x1fd2ce)[_0x2683('0x23')](function(_0x17ff4b){var _0x13368a={'role':_0x1f0174[_0x2683('0x70')][_0x2683('0x71')],'userProfileId':_0x1f0174[_0x2683('0x70')][_0x2683('0x72')]};if(!_0x13368a)throw new Error(_0x2683('0x73'));if(_0x13368a['role']===_0x2683('0x74')){var _0x5bacbd=_0x17ff4b[_0x2683('0x24')]({'plain':!![]});return db[_0x2683('0x75')]['find']({'where':{'name':'Sounds','userProfileId':_0x13368a[_0x2683('0x72')]},'raw':!![]})[_0x2683('0x23')](function(_0x333a76){if(_0x333a76&&_0x333a76[_0x2683('0x76')]===0x0){return db['UserProfileResource'][_0x2683('0x77')]({'name':_0x5bacbd[_0x2683('0x28')],'resourceId':_0x5bacbd['id'],'type':_0x333a76['name'],'sectionId':_0x333a76['id']},{})['then'](function(){return _0x17ff4b;});}else{return _0x17ff4b;}})[_0x2683('0x46')](function(_0x4f5e33){logger[_0x2683('0x26')](_0x2683('0x78'),_0x4f5e33);throw _0x4f5e33;});}return _0x17ff4b;})[_0x2683('0x23')](respondWithResult(_0x446faf,null))['catch'](handleError(_0x446faf,null));});_0x18a3f3[_0x2683('0x79')]();}catch(_0x3d0129){_0x446faf[_0x2683('0x17')](0x1f4)[_0x2683('0x29')](_0x3d0129);}};exports['update']=function(_0x421967,_0x3aff27,_0x42a7e5){return db[_0x2683('0x2c')][_0x2683('0x48')]({'where':{'id':_0x421967[_0x2683('0x43')]['id']}})['then'](handleEntityNotFound(_0x3aff27,null))[_0x2683('0x23')](saveUpdates(_[_0x2683('0x7a')](_0x421967['body'],[_0x2683('0x28'),'description']),null))[_0x2683('0x23')](respondWithResult(_0x3aff27,null))[_0x2683('0x46')](handleError(_0x3aff27,null));};exports[_0x2683('0x7b')]=function(_0x3c5af5,_0x39c8b9,_0x442661){return db['Sound'][_0x2683('0x48')]({'where':{'id':_0x3c5af5[_0x2683('0x43')]['id']}})[_0x2683('0x23')](function(_0x161541){if(_0x161541){return _0x161541['destroy']();}})['then'](function(_0x1b05ce){var _0x4e2d6b=path[_0x2683('0x4f')](config[_0x2683('0x4a')],_0x2683('0x59'),util['format'](_0x2683('0x51'),_0x1b05ce[_0x2683('0x49')],_0x1b05ce[_0x2683('0x7c')]));var _0xf29dd=path[_0x2683('0x4f')](config[_0x2683('0x4a')],'server/files/sounds/converted',util['format'](_0x2683('0x51'),_0x1b05ce[_0x2683('0x49')],_0x1b05ce[_0x2683('0x4c')]));fs[_0x2683('0x60')](_0x4e2d6b);fs[_0x2683('0x60')](_0xf29dd);return _0x1b05ce;})[_0x2683('0x23')](function(_0x1e241a){if(_0x1e241a){return _0x39c8b9['status'](0xcc)[_0x2683('0x16')]();}})[_0x2683('0x23')](handleEntityNotFound(_0x39c8b9,null))[_0x2683('0x46')](handleError(_0x39c8b9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 9d16995..c6edf53 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 _0x60f8=['../../config/environment','./sound.attributes','exports','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4457f9,_0x4712dc){var _0x2a53c4=function(_0x2e04f0){while(--_0x2e04f0){_0x4457f9['push'](_0x4457f9['shift']());}};_0x2a53c4(++_0x4712dc);}(_0x60f8,0x1f0));var _0x860f=function(_0x35ebf0,_0x173204){_0x35ebf0=_0x35ebf0-0x0;var _0x4d73f6=_0x60f8[_0x35ebf0];return _0x4d73f6;};'use strict';var _=require(_0x860f('0x0'));var util=require(_0x860f('0x1'));var logger=require(_0x860f('0x2'))(_0x860f('0x3'));var moment=require(_0x860f('0x4'));var BPromise=require(_0x860f('0x5'));var rp=require(_0x860f('0x6'));var fs=require('fs');var path=require(_0x860f('0x7'));var rimraf=require('rimraf');var config=require(_0x860f('0x8'));var attributes=require(_0x860f('0x9'));module[_0x860f('0xa')]=function(_0x46ae0d,_0x294c2a){return _0x46ae0d['define']('Sound',attributes,{'tableName':_0x860f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41e1=['util','api','moment','bluebird','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x41e1,0xf1));var _0x141e=function(_0x2e5bb3,_0x3053e1){_0x2e5bb3=_0x2e5bb3-0x0;var _0x47eb0e=_0x41e1[_0x2e5bb3];return _0x47eb0e;};'use strict';var _=require(_0x141e('0x0'));var util=require(_0x141e('0x1'));var logger=require('../../config/logger')(_0x141e('0x2'));var moment=require(_0x141e('0x3'));var BPromise=require(_0x141e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x141e('0x5'));var config=require(_0x141e('0x6'));var attributes=require(_0x141e('0x7'));module[_0x141e('0x8')]=function(_0x488805,_0xd5146a){return _0x488805[_0x141e('0x9')]('Sound',attributes,{'tableName':_0x141e('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 d066007..b4631db 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 _0x4040=['result','catch','ShowSound','options','where','attributes','include','map','model','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','Sound,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4040,0x149));var _0x0404=function(_0x3bb708,_0x12863){_0x3bb708=_0x3bb708-0x0;var _0xc42b22=_0x4040[_0x3bb708];return _0xc42b22;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0404('0x0'));var BPromise=require(_0x0404('0x1'));var rs=require(_0x0404('0x2'));var fs=require('fs');var Redis=require(_0x0404('0x3'));var db=require(_0x0404('0x4'))['db'];var utils=require(_0x0404('0x5'));var logger=require(_0x0404('0x6'))(_0x0404('0x7'));var config=require(_0x0404('0x8'));var jayson=require(_0x0404('0x9'));var client=jayson[_0x0404('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12af7f,_0x1aeb40,_0x1cf8b3){return new BPromise(function(_0x801c92,_0x58d935){return client[_0x0404('0xb')](_0x12af7f,_0x1cf8b3)[_0x0404('0xc')](function(_0x4bf1e4){logger[_0x0404('0xd')]('Sound,\x20%s,\x20%s',_0x1aeb40,_0x0404('0xe'));logger['debug'](_0x0404('0xf'),_0x1aeb40,_0x0404('0xe'),JSON['stringify'](_0x4bf1e4));if(_0x4bf1e4[_0x0404('0x10')]){if(_0x4bf1e4[_0x0404('0x10')]['code']===0x1f4){logger[_0x0404('0x10')]('Sound,\x20%s,\x20%s',_0x1aeb40,_0x4bf1e4['error'][_0x0404('0x11')]);return _0x58d935(_0x4bf1e4[_0x0404('0x10')]['message']);}logger[_0x0404('0x10')](_0x0404('0x12'),_0x1aeb40,_0x4bf1e4['error'][_0x0404('0x11')]);return _0x801c92(_0x4bf1e4[_0x0404('0x10')][_0x0404('0x11')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x1aeb40,_0x0404('0xe'));_0x801c92(_0x4bf1e4[_0x0404('0x13')][_0x0404('0x11')]);}})[_0x0404('0x14')](function(_0x108ceb){logger[_0x0404('0x10')](_0x0404('0x12'),_0x1aeb40,_0x108ceb);_0x58d935(_0x108ceb);});});}exports[_0x0404('0x15')]=function(_0x58c5d0){var _0x44b5e0=this;return new Promise(function(_0x5afc0d,_0xff3fac){return db['Sound']['find']({'raw':_0x58c5d0[_0x0404('0x16')]?_0x58c5d0[_0x0404('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x58c5d0['options']?_0x58c5d0[_0x0404('0x16')][_0x0404('0x17')]||null:null,'attributes':_0x58c5d0[_0x0404('0x16')]?_0x58c5d0[_0x0404('0x16')][_0x0404('0x18')]||null:null,'include':_0x58c5d0[_0x0404('0x16')]?_0x58c5d0[_0x0404('0x16')][_0x0404('0x19')]?_[_0x0404('0x1a')](_0x58c5d0[_0x0404('0x16')]['include'],function(_0x2caad2){return{'model':db[_0x2caad2[_0x0404('0x1b')]],'as':_0x2caad2['as'],'attributes':_0x2caad2[_0x0404('0x18')],'include':_0x2caad2[_0x0404('0x19')]?_[_0x0404('0x1a')](_0x2caad2[_0x0404('0x19')],function(_0x595893){return{'model':db[_0x595893[_0x0404('0x1b')]],'as':_0x595893['as'],'attributes':_0x595893[_0x0404('0x18')],'include':_0x595893[_0x0404('0x19')]?_['map'](_0x595893[_0x0404('0x19')],function(_0x199ff2){return{'model':db[_0x199ff2[_0x0404('0x1b')]],'as':_0x199ff2['as'],'attributes':_0x199ff2['attributes']};}):[]};}):[]};}):[]:[]})[_0x0404('0xc')](function(_0x28627b){logger['info'](_0x0404('0x15'),_0x58c5d0);logger['debug'](_0x0404('0x15'),_0x58c5d0,JSON[_0x0404('0x1c')](_0x28627b));_0x5afc0d(_0x28627b);})[_0x0404('0x14')](function(_0x9c72b9){logger[_0x0404('0x10')](_0x0404('0x15'),_0x9c72b9[_0x0404('0x11')],_0x58c5d0);_0xff3fac(_0x44b5e0[_0x0404('0x10')](0x1f4,_0x9c72b9[_0x0404('0x11')]));});});}; \ No newline at end of file +var _0xbc27=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','Sound','find','options','raw','attributes','include','map','model','ShowSound'];(function(_0x349981,_0x273060){var _0x4aa09f=function(_0x361ffa){while(--_0x361ffa){_0x349981['push'](_0x349981['shift']());}};_0x4aa09f(++_0x273060);}(_0xbc27,0x1a4));var _0x7bc2=function(_0x31fbe7,_0x1decd5){_0x31fbe7=_0x31fbe7-0x0;var _0x52c47d=_0xbc27[_0x31fbe7];return _0x52c47d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7bc2('0x0'));var BPromise=require(_0x7bc2('0x1'));var rs=require(_0x7bc2('0x2'));var fs=require('fs');var Redis=require(_0x7bc2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7bc2('0x4'))(_0x7bc2('0x5'));var config=require(_0x7bc2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7bc2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f7db8,_0x4bb1b7,_0x3aa577){return new BPromise(function(_0x322d2f,_0x2d6466){return client[_0x7bc2('0x8')](_0x8f7db8,_0x3aa577)[_0x7bc2('0x9')](function(_0x29c3be){logger[_0x7bc2('0xa')]('Sound,\x20%s,\x20%s',_0x4bb1b7,_0x7bc2('0xb'));logger[_0x7bc2('0xc')](_0x7bc2('0xd'),_0x4bb1b7,'request\x20sent',JSON[_0x7bc2('0xe')](_0x29c3be));if(_0x29c3be[_0x7bc2('0xf')]){if(_0x29c3be[_0x7bc2('0xf')][_0x7bc2('0x10')]===0x1f4){logger[_0x7bc2('0xf')](_0x7bc2('0x11'),_0x4bb1b7,_0x29c3be[_0x7bc2('0xf')][_0x7bc2('0x12')]);return _0x2d6466(_0x29c3be[_0x7bc2('0xf')]['message']);}logger['error'](_0x7bc2('0x11'),_0x4bb1b7,_0x29c3be[_0x7bc2('0xf')]['message']);return _0x322d2f(_0x29c3be['error']['message']);}else{logger[_0x7bc2('0xa')](_0x7bc2('0x11'),_0x4bb1b7,'request\x20sent');_0x322d2f(_0x29c3be[_0x7bc2('0x13')]['message']);}})[_0x7bc2('0x14')](function(_0x1c64f2){logger[_0x7bc2('0xf')](_0x7bc2('0x11'),_0x4bb1b7,_0x1c64f2);_0x2d6466(_0x1c64f2);});});}exports['ShowSound']=function(_0x293b7d){var _0x4b0e60=this;return new Promise(function(_0x285334,_0x27c2b8){return db[_0x7bc2('0x15')][_0x7bc2('0x16')]({'raw':_0x293b7d[_0x7bc2('0x17')]?_0x293b7d['options'][_0x7bc2('0x18')]===undefined?!![]:![]:!![],'where':_0x293b7d[_0x7bc2('0x17')]?_0x293b7d[_0x7bc2('0x17')]['where']||null:null,'attributes':_0x293b7d[_0x7bc2('0x17')]?_0x293b7d[_0x7bc2('0x17')][_0x7bc2('0x19')]||null:null,'include':_0x293b7d[_0x7bc2('0x17')]?_0x293b7d['options'][_0x7bc2('0x1a')]?_[_0x7bc2('0x1b')](_0x293b7d['options'][_0x7bc2('0x1a')],function(_0x2c2679){return{'model':db[_0x2c2679[_0x7bc2('0x1c')]],'as':_0x2c2679['as'],'attributes':_0x2c2679[_0x7bc2('0x19')],'include':_0x2c2679[_0x7bc2('0x1a')]?_[_0x7bc2('0x1b')](_0x2c2679[_0x7bc2('0x1a')],function(_0x42d06d){return{'model':db[_0x42d06d[_0x7bc2('0x1c')]],'as':_0x42d06d['as'],'attributes':_0x42d06d['attributes'],'include':_0x42d06d[_0x7bc2('0x1a')]?_['map'](_0x42d06d[_0x7bc2('0x1a')],function(_0x35a068){return{'model':db[_0x35a068[_0x7bc2('0x1c')]],'as':_0x35a068['as'],'attributes':_0x35a068['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bc2('0x9')](function(_0x5dfc6d){logger[_0x7bc2('0xa')](_0x7bc2('0x1d'),_0x293b7d);logger['debug'](_0x7bc2('0x1d'),_0x293b7d,JSON['stringify'](_0x5dfc6d));_0x285334(_0x5dfc6d);})[_0x7bc2('0x14')](function(_0x51f17c){logger[_0x7bc2('0xf')](_0x7bc2('0x1d'),_0x51f17c['message'],_0x293b7d);_0x27c2b8(_0x4b0e60['error'](0x1f4,_0x51f17c[_0x7bc2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e89b98d..f74a21a 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x1ef655,_0x3b3d9a){var _0x5ca856=function(_0x2b0396){while(--_0x2b0396){_0x1ef655['push'](_0x1ef655['shift']());}};_0x5ca856(++_0x3b3d9a);}(_0x5eb8,0xb0));var _0x85eb=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0x5eb8[_0xc69f39];return _0x93be41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x42693d,_0x434c1c){var _0x57f95f=function(_0x4c34e0){while(--_0x4c34e0){_0x42693d['push'](_0x42693d['shift']());}};_0x57f95f(++_0x434c1c);}(_0xda3f,0xec));var _0xfda3=function(_0x5bea97,_0x34539c){_0x5bea97=_0x5bea97-0x0;var _0x277a3e=_0xda3f[_0x5bea97];return _0x277a3e;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 871bde2..b79a326 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 _0x277d=['TEXT','medium','ENUM','out','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x277d,0x1ea));var _0xd277=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x277d[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0xd277('0x0')]={'uniqueid':{'type':Sequelize[_0xd277('0x1')]},'body':{'type':Sequelize[_0xd277('0x2')](_0xd277('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xd277('0x4')]('in',_0xd277('0x5')),'defaultValue':_0xd277('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xd277('0x1')]},'providerResponse':{'type':Sequelize[_0xd277('0x2')]}}; \ No newline at end of file +var _0x8243=['TEXT','medium'];(function(_0x4b4dd0,_0x4b7586){var _0x42da25=function(_0x48ed2c){while(--_0x48ed2c){_0x4b4dd0['push'](_0x4b4dd0['shift']());}};_0x42da25(++_0x4b7586);}(_0x8243,0x158));var _0x3824=function(_0x1b313b,_0x4ed1e2){_0x1b313b=_0x1b313b-0x0;var _0x5b8625=_0x8243[_0x1b313b];return _0x5b8625;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3824('0x0')](_0x3824('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3824('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 0556a17..8a7bcc6 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x794b=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareMessage','rows','show','params','rawAttributes','includeAll','catch','create','body','find'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x794b,0x1c2));var _0xb794=function(_0x148918,_0x341d0c){_0x148918=_0x148918-0x0;var _0x393ec2=_0x794b[_0x148918];return _0x393ec2;};'use strict';var emlformat=require(_0xb794('0x0'));var rimraf=require(_0xb794('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb794('0x2'));var rp=require(_0xb794('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb794('0x4'));var util=require(_0xb794('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb794('0x6'));var ejs=require(_0xb794('0x7'));var fs=require('fs');var fs_extra=require(_0xb794('0x8'));var _=require(_0xb794('0x9'));var squel=require(_0xb794('0xa'));var crypto=require(_0xb794('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb794('0xc'));var toCsv=require(_0xb794('0x6'));var querystring=require(_0xb794('0xd'));var Papa=require(_0xb794('0xe'));var Redis=require(_0xb794('0xf'));var authService=require(_0xb794('0x10'));var qs=require(_0xb794('0x11'));var as=require(_0xb794('0x12'));var hardwareService=require(_0xb794('0x13'));var logger=require(_0xb794('0x14'))(_0xb794('0x15'));var utils=require(_0xb794('0x16'));var config=require(_0xb794('0x17'));var licenseUtil=require(_0xb794('0x18'));var db=require(_0xb794('0x19'))['db'];function respondWithStatusCode(_0xe8442a,_0x3900f0){_0x3900f0=_0x3900f0||0xcc;return function(_0x3be436){if(_0x3be436){return _0xe8442a[_0xb794('0x1a')](_0x3900f0);}return _0xe8442a[_0xb794('0x1b')](_0x3900f0)[_0xb794('0x1c')]();};}function respondWithResult(_0x57c750,_0x44e714){_0x44e714=_0x44e714||0xc8;return function(_0x14927e){if(_0x14927e){return _0x57c750[_0xb794('0x1b')](_0x44e714)[_0xb794('0x1d')](_0x14927e);}};}function respondWithFilteredResult(_0xac1f87,_0x469618){return function(_0x558bc1){if(_0x558bc1){var _0x43bf13=typeof _0x469618[_0xb794('0x1e')]==='undefined'&&typeof _0x469618[_0xb794('0x1f')]===_0xb794('0x20');var _0x53788b=_0x558bc1[_0xb794('0x21')];var _0xdf55d7=_0x43bf13?0x0:_0x469618[_0xb794('0x1e')];var _0x518d3d=_0x43bf13?_0x558bc1[_0xb794('0x21')]:_0x469618[_0xb794('0x1e')]+_0x469618['limit'];var _0x10d905;if(_0x518d3d>=_0x53788b){_0x518d3d=_0x53788b;_0x10d905=0xc8;}else{_0x10d905=0xce;}_0xac1f87[_0xb794('0x1b')](_0x10d905);return _0xac1f87[_0xb794('0x22')](_0xb794('0x23'),_0xdf55d7+'-'+_0x518d3d+'/'+_0x53788b)[_0xb794('0x1d')](_0x558bc1);}return null;};}function patchUpdates(_0x4fbb1c){return function(_0x24811c){try{jsonpatch[_0xb794('0x24')](_0x24811c,_0x4fbb1c,!![]);}catch(_0x4c2156){return BPromise[_0xb794('0x25')](_0x4c2156);}return _0x24811c[_0xb794('0x26')]();};}function saveUpdates(_0x29d308,_0x1b93dd){return function(_0x31bd91){if(_0x31bd91){return _0x31bd91[_0xb794('0x27')](_0x29d308)[_0xb794('0x28')](function(_0x45ddac){return _0x45ddac;});}return null;};}function removeEntity(_0x425a47,_0x43e077){return function(_0x4236fe){if(_0x4236fe){return _0x4236fe[_0xb794('0x29')]()[_0xb794('0x28')](function(){_0x425a47['status'](0xcc)[_0xb794('0x1c')]();});}};}function handleEntityNotFound(_0x3f6b71,_0xeebf12){return function(_0x47e38c){if(!_0x47e38c){_0x3f6b71['sendStatus'](0x194);}return _0x47e38c;};}function handleError(_0x1675ea,_0x536444){_0x536444=_0x536444||0x1f4;return function(_0xdb29d7){logger[_0xb794('0x2a')](_0xdb29d7['stack']);if(_0xdb29d7['name']){delete _0xdb29d7[_0xb794('0x2b')];}_0x1675ea[_0xb794('0x1b')](_0x536444)[_0xb794('0x2c')](_0xdb29d7);};}exports['index']=function(_0x59236a,_0x35fbd0){var _0x2db412={},_0x45d4d0={},_0x2ed6bc={'count':0x0,'rows':[]};var _0x3ec2f0=_[_0xb794('0x2d')](db['SquareMessage']['rawAttributes'],function(_0x54d796){return{'name':_0x54d796[_0xb794('0x2e')],'type':_0x54d796[_0xb794('0x2f')][_0xb794('0x30')]};});_0x45d4d0['model']=_[_0xb794('0x2d')](_0x3ec2f0,'name');_0x45d4d0[_0xb794('0x31')]=_[_0xb794('0x32')](_0x59236a['query']);_0x45d4d0[_0xb794('0x33')]=_['intersection'](_0x45d4d0[_0xb794('0x34')],_0x45d4d0[_0xb794('0x31')]);_0x2db412['attributes']=_[_0xb794('0x35')](_0x45d4d0[_0xb794('0x34')],qs[_0xb794('0x36')](_0x59236a[_0xb794('0x31')][_0xb794('0x36')]));_0x2db412[_0xb794('0x37')]=_0x2db412[_0xb794('0x37')]['length']?_0x2db412[_0xb794('0x37')]:_0x45d4d0['model'];if(!_0x59236a[_0xb794('0x31')]['hasOwnProperty'](_0xb794('0x38'))){_0x2db412[_0xb794('0x1f')]=qs[_0xb794('0x1f')](_0x59236a['query']['limit']);_0x2db412[_0xb794('0x1e')]=qs[_0xb794('0x1e')](_0x59236a[_0xb794('0x31')]['offset']);}_0x2db412[_0xb794('0x39')]=qs[_0xb794('0x3a')](_0x59236a[_0xb794('0x31')][_0xb794('0x3a')]);_0x2db412[_0xb794('0x3b')]=qs['filters'](_[_0xb794('0x3c')](_0x59236a[_0xb794('0x31')],_0x45d4d0[_0xb794('0x33')]),_0x3ec2f0);if(_0x59236a[_0xb794('0x31')]['filter']){_0x2db412[_0xb794('0x3b')]=_[_0xb794('0x3d')](_0x2db412[_0xb794('0x3b')],{'$or':_['map'](_0x3ec2f0,function(_0x583f4f){if(_0x583f4f[_0xb794('0x2f')]!==_0xb794('0x3e')){var _0x4928b9={};_0x4928b9[_0x583f4f[_0xb794('0x2b')]]={'$like':'%'+_0x59236a[_0xb794('0x31')][_0xb794('0x3f')]+'%'};return _0x4928b9;}})});}_0x2db412=_['merge']({},_0x2db412,_0x59236a[_0xb794('0x40')]);var _0xb9ad03={'where':_0x2db412[_0xb794('0x3b')]};return db[_0xb794('0x41')][_0xb794('0x21')](_0xb9ad03)[_0xb794('0x28')](function(_0x3f856a){_0x2ed6bc[_0xb794('0x21')]=_0x3f856a;if(_0x59236a[_0xb794('0x31')]['includeAll']){_0x2db412['include']=[{'all':!![]}];}return db[_0xb794('0x41')]['findAll'](_0x2db412);})[_0xb794('0x28')](function(_0x2265b7){_0x2ed6bc[_0xb794('0x42')]=_0x2265b7;return _0x2ed6bc;})[_0xb794('0x28')](respondWithFilteredResult(_0x35fbd0,_0x2db412))['catch'](handleError(_0x35fbd0,null));};exports[_0xb794('0x43')]=function(_0x5f2a0a,_0x12c344){var _0x8240e1={'raw':!![],'where':{'id':_0x5f2a0a[_0xb794('0x44')]['id']}},_0x27794d={};_0x27794d[_0xb794('0x34')]=_['keys'](db[_0xb794('0x41')][_0xb794('0x45')]);_0x27794d[_0xb794('0x31')]=_[_0xb794('0x32')](_0x5f2a0a[_0xb794('0x31')]);_0x27794d[_0xb794('0x33')]=_[_0xb794('0x35')](_0x27794d[_0xb794('0x34')],_0x27794d[_0xb794('0x31')]);_0x8240e1[_0xb794('0x37')]=_[_0xb794('0x35')](_0x27794d[_0xb794('0x34')],qs['fields'](_0x5f2a0a['query']['fields']));_0x8240e1['attributes']=_0x8240e1[_0xb794('0x37')]['length']?_0x8240e1[_0xb794('0x37')]:_0x27794d[_0xb794('0x34')];if(_0x5f2a0a[_0xb794('0x31')][_0xb794('0x46')]){_0x8240e1['include']=[{'all':!![]}];}_0x8240e1=_['merge']({},_0x8240e1,_0x5f2a0a[_0xb794('0x40')]);return db['SquareMessage']['find'](_0x8240e1)['then'](handleEntityNotFound(_0x12c344,null))['then'](respondWithResult(_0x12c344,null))[_0xb794('0x47')](handleError(_0x12c344,null));};exports[_0xb794('0x48')]=function(_0x620576,_0x6c8365){return db[_0xb794('0x41')][_0xb794('0x48')](_0x620576[_0xb794('0x49')],{})[_0xb794('0x28')](respondWithResult(_0x6c8365,0xc9))['catch'](handleError(_0x6c8365,null));};exports['update']=function(_0x3dc181,_0x4bff19){if(_0x3dc181[_0xb794('0x49')]['id']){delete _0x3dc181[_0xb794('0x49')]['id'];}return db[_0xb794('0x41')][_0xb794('0x4a')]({'where':{'id':_0x3dc181['params']['id']}})[_0xb794('0x28')](handleEntityNotFound(_0x4bff19,null))['then'](saveUpdates(_0x3dc181['body'],null))[_0xb794('0x28')](respondWithResult(_0x4bff19,null))['catch'](handleError(_0x4bff19,null));};exports['destroy']=function(_0x1c5609,_0x36ba32){return db[_0xb794('0x41')]['find']({'where':{'id':_0x1c5609['params']['id']}})['then'](handleEntityNotFound(_0x36ba32,null))[_0xb794('0x28')](removeEntity(_0x36ba32,null))['catch'](handleError(_0x36ba32,null));}; \ No newline at end of file +var _0x2340=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','catch','includeAll','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x38861d,_0x503fcc){var _0x1a1232=function(_0x1d611f){while(--_0x1d611f){_0x38861d['push'](_0x38861d['shift']());}};_0x1a1232(++_0x503fcc);}(_0x2340,0x1e6));var _0x0234=function(_0x4200a3,_0x568ad5){_0x4200a3=_0x4200a3-0x0;var _0x50376e=_0x2340[_0x4200a3];return _0x50376e;};'use strict';var emlformat=require(_0x0234('0x0'));var rimraf=require(_0x0234('0x1'));var zipdir=require(_0x0234('0x2'));var jsonpatch=require(_0x0234('0x3'));var rp=require('request-promise');var moment=require(_0x0234('0x4'));var BPromise=require(_0x0234('0x5'));var Mustache=require(_0x0234('0x6'));var util=require('util');var path=require(_0x0234('0x7'));var sox=require(_0x0234('0x8'));var csv=require(_0x0234('0x9'));var ejs=require(_0x0234('0xa'));var fs=require('fs');var fs_extra=require(_0x0234('0xb'));var _=require(_0x0234('0xc'));var squel=require(_0x0234('0xd'));var crypto=require(_0x0234('0xe'));var jsforce=require(_0x0234('0xf'));var deskjs=require(_0x0234('0x10'));var toCsv=require(_0x0234('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0234('0x11'));var qs=require(_0x0234('0x12'));var as=require(_0x0234('0x13'));var hardwareService=require(_0x0234('0x14'));var logger=require(_0x0234('0x15'))(_0x0234('0x16'));var utils=require(_0x0234('0x17'));var config=require(_0x0234('0x18'));var licenseUtil=require(_0x0234('0x19'));var db=require(_0x0234('0x1a'))['db'];function respondWithStatusCode(_0x1ad5a2,_0x346ec9){_0x346ec9=_0x346ec9||0xcc;return function(_0x106b5d){if(_0x106b5d){return _0x1ad5a2[_0x0234('0x1b')](_0x346ec9);}return _0x1ad5a2[_0x0234('0x1c')](_0x346ec9)[_0x0234('0x1d')]();};}function respondWithResult(_0x1d55df,_0x3d1161){_0x3d1161=_0x3d1161||0xc8;return function(_0x19801a){if(_0x19801a){return _0x1d55df[_0x0234('0x1c')](_0x3d1161)[_0x0234('0x1e')](_0x19801a);}};}function respondWithFilteredResult(_0x258f95,_0x1c79d6){return function(_0x553b97){if(_0x553b97){var _0x9d0f3b=typeof _0x1c79d6['offset']==='undefined'&&typeof _0x1c79d6['limit']==='undefined';var _0x11b441=_0x553b97[_0x0234('0x1f')];var _0x436369=_0x9d0f3b?0x0:_0x1c79d6[_0x0234('0x20')];var _0x4da151=_0x9d0f3b?_0x553b97[_0x0234('0x1f')]:_0x1c79d6['offset']+_0x1c79d6[_0x0234('0x21')];var _0x4f9f8e;if(_0x4da151>=_0x11b441){_0x4da151=_0x11b441;_0x4f9f8e=0xc8;}else{_0x4f9f8e=0xce;}_0x258f95[_0x0234('0x1c')](_0x4f9f8e);return _0x258f95[_0x0234('0x22')](_0x0234('0x23'),_0x436369+'-'+_0x4da151+'/'+_0x11b441)[_0x0234('0x1e')](_0x553b97);}return null;};}function patchUpdates(_0x3d9798){return function(_0x2d69fa){try{jsonpatch['apply'](_0x2d69fa,_0x3d9798,!![]);}catch(_0x553439){return BPromise[_0x0234('0x24')](_0x553439);}return _0x2d69fa[_0x0234('0x25')]();};}function saveUpdates(_0x2e79a1,_0x7130f7){return function(_0x2c2ba7){if(_0x2c2ba7){return _0x2c2ba7[_0x0234('0x26')](_0x2e79a1)['then'](function(_0x7f4ed3){return _0x7f4ed3;});}return null;};}function removeEntity(_0x5a76ce,_0x4e2a96){return function(_0x1b58ff){if(_0x1b58ff){return _0x1b58ff[_0x0234('0x27')]()[_0x0234('0x28')](function(){_0x5a76ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a03bb,_0x273ae3){return function(_0x46daf3){if(!_0x46daf3){_0x4a03bb[_0x0234('0x1b')](0x194);}return _0x46daf3;};}function handleError(_0x24922c,_0x4cab34){_0x4cab34=_0x4cab34||0x1f4;return function(_0x3d2a48){logger['error'](_0x3d2a48[_0x0234('0x29')]);if(_0x3d2a48[_0x0234('0x2a')]){delete _0x3d2a48[_0x0234('0x2a')];}_0x24922c[_0x0234('0x1c')](_0x4cab34)[_0x0234('0x2b')](_0x3d2a48);};}exports['index']=function(_0x33b71f,_0x432f0b){var _0x462d57={},_0x45468a={},_0x2b546d={'count':0x0,'rows':[]};var _0xbdee13=_[_0x0234('0x2c')](db[_0x0234('0x2d')][_0x0234('0x2e')],function(_0x239697){return{'name':_0x239697[_0x0234('0x2f')],'type':_0x239697[_0x0234('0x30')][_0x0234('0x31')]};});_0x45468a[_0x0234('0x32')]=_[_0x0234('0x2c')](_0xbdee13,_0x0234('0x2a'));_0x45468a[_0x0234('0x33')]=_[_0x0234('0x34')](_0x33b71f[_0x0234('0x33')]);_0x45468a[_0x0234('0x35')]=_[_0x0234('0x36')](_0x45468a[_0x0234('0x32')],_0x45468a[_0x0234('0x33')]);_0x462d57[_0x0234('0x37')]=_[_0x0234('0x36')](_0x45468a[_0x0234('0x32')],qs['fields'](_0x33b71f[_0x0234('0x33')][_0x0234('0x38')]));_0x462d57[_0x0234('0x37')]=_0x462d57['attributes'][_0x0234('0x39')]?_0x462d57[_0x0234('0x37')]:_0x45468a[_0x0234('0x32')];if(!_0x33b71f[_0x0234('0x33')][_0x0234('0x3a')](_0x0234('0x3b'))){_0x462d57[_0x0234('0x21')]=qs[_0x0234('0x21')](_0x33b71f[_0x0234('0x33')][_0x0234('0x21')]);_0x462d57[_0x0234('0x20')]=qs[_0x0234('0x20')](_0x33b71f['query'][_0x0234('0x20')]);}_0x462d57[_0x0234('0x3c')]=qs[_0x0234('0x3d')](_0x33b71f[_0x0234('0x33')]['sort']);_0x462d57[_0x0234('0x3e')]=qs[_0x0234('0x35')](_[_0x0234('0x3f')](_0x33b71f[_0x0234('0x33')],_0x45468a[_0x0234('0x35')]),_0xbdee13);if(_0x33b71f['query']['filter']){_0x462d57[_0x0234('0x3e')]=_['merge'](_0x462d57[_0x0234('0x3e')],{'$or':_['map'](_0xbdee13,function(_0x12483a){if(_0x12483a[_0x0234('0x30')]!==_0x0234('0x40')){var _0x2b2ee7={};_0x2b2ee7[_0x12483a[_0x0234('0x2a')]]={'$like':'%'+_0x33b71f[_0x0234('0x33')][_0x0234('0x41')]+'%'};return _0x2b2ee7;}})});}_0x462d57=_[_0x0234('0x42')]({},_0x462d57,_0x33b71f['options']);var _0x812901={'where':_0x462d57['where']};return db[_0x0234('0x2d')][_0x0234('0x1f')](_0x812901)[_0x0234('0x28')](function(_0x197986){_0x2b546d[_0x0234('0x1f')]=_0x197986;if(_0x33b71f[_0x0234('0x33')]['includeAll']){_0x462d57[_0x0234('0x43')]=[{'all':!![]}];}return db['SquareMessage'][_0x0234('0x44')](_0x462d57);})[_0x0234('0x28')](function(_0x38e5d0){_0x2b546d[_0x0234('0x45')]=_0x38e5d0;return _0x2b546d;})[_0x0234('0x28')](respondWithFilteredResult(_0x432f0b,_0x462d57))[_0x0234('0x46')](handleError(_0x432f0b,null));};exports['show']=function(_0x33d6d4,_0x32a7ec){var _0x400a55={'raw':!![],'where':{'id':_0x33d6d4['params']['id']}},_0x3c9fa0={};_0x3c9fa0['model']=_['keys'](db[_0x0234('0x2d')][_0x0234('0x2e')]);_0x3c9fa0[_0x0234('0x33')]=_[_0x0234('0x34')](_0x33d6d4[_0x0234('0x33')]);_0x3c9fa0[_0x0234('0x35')]=_[_0x0234('0x36')](_0x3c9fa0[_0x0234('0x32')],_0x3c9fa0[_0x0234('0x33')]);_0x400a55[_0x0234('0x37')]=_[_0x0234('0x36')](_0x3c9fa0[_0x0234('0x32')],qs['fields'](_0x33d6d4['query'][_0x0234('0x38')]));_0x400a55[_0x0234('0x37')]=_0x400a55['attributes'][_0x0234('0x39')]?_0x400a55['attributes']:_0x3c9fa0[_0x0234('0x32')];if(_0x33d6d4[_0x0234('0x33')][_0x0234('0x47')]){_0x400a55['include']=[{'all':!![]}];}_0x400a55=_[_0x0234('0x42')]({},_0x400a55,_0x33d6d4[_0x0234('0x48')]);return db[_0x0234('0x2d')][_0x0234('0x49')](_0x400a55)['then'](handleEntityNotFound(_0x32a7ec,null))[_0x0234('0x28')](respondWithResult(_0x32a7ec,null))[_0x0234('0x46')](handleError(_0x32a7ec,null));};exports[_0x0234('0x4a')]=function(_0x462b11,_0x292083){return db['SquareMessage']['create'](_0x462b11[_0x0234('0x4b')],{})[_0x0234('0x28')](respondWithResult(_0x292083,0xc9))[_0x0234('0x46')](handleError(_0x292083,null));};exports[_0x0234('0x26')]=function(_0x185631,_0x3b4b80){if(_0x185631[_0x0234('0x4b')]['id']){delete _0x185631[_0x0234('0x4b')]['id'];}return db[_0x0234('0x2d')][_0x0234('0x49')]({'where':{'id':_0x185631[_0x0234('0x4c')]['id']}})[_0x0234('0x28')](handleEntityNotFound(_0x3b4b80,null))[_0x0234('0x28')](saveUpdates(_0x185631[_0x0234('0x4b')],null))[_0x0234('0x28')](respondWithResult(_0x3b4b80,null))['catch'](handleError(_0x3b4b80,null));};exports['destroy']=function(_0x473aab,_0x3b65a3){return db['SquareMessage']['find']({'where':{'id':_0x473aab['params']['id']}})[_0x0234('0x28')](handleEntityNotFound(_0x3b65a3,null))[_0x0234('0x28')](removeEntity(_0x3b65a3,null))[_0x0234('0x46')](handleError(_0x3b65a3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 1655f98..174d5fe 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 _0x20a4=['util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','SquareMessage','square_messages','lodash'];(function(_0x298b34,_0x12e544){var _0x34977f=function(_0x460fa3){while(--_0x460fa3){_0x298b34['push'](_0x298b34['shift']());}};_0x34977f(++_0x12e544);}(_0x20a4,0x83));var _0x420a=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x20a4[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require(_0x420a('0x0'));var util=require(_0x420a('0x1'));var logger=require(_0x420a('0x2'))(_0x420a('0x3'));var moment=require(_0x420a('0x4'));var BPromise=require(_0x420a('0x5'));var rp=require(_0x420a('0x6'));var fs=require('fs');var path=require(_0x420a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x420a('0x8')]=function(_0x4c6e66,_0x591e44){return _0x4c6e66[_0x420a('0x9')](_0x420a('0xa'),attributes,{'tableName':_0x420a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1776=['exports','define','SquareMessage','square_messages','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xdeae75,_0x7f9344){var _0xa4d0f8=function(_0x1131f2){while(--_0x1131f2){_0xdeae75['push'](_0xdeae75['shift']());}};_0xa4d0f8(++_0x7f9344);}(_0x1776,0x12d));var _0x6177=function(_0x10a26a,_0xe95601){_0x10a26a=_0x10a26a-0x0;var _0x2308d9=_0x1776[_0x10a26a];return _0x2308d9;};'use strict';var _=require('lodash');var util=require(_0x6177('0x0'));var logger=require(_0x6177('0x1'))(_0x6177('0x2'));var moment=require(_0x6177('0x3'));var BPromise=require(_0x6177('0x4'));var rp=require(_0x6177('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6177('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x6177('0x7')]=function(_0x200b3d,_0x27ad90){return _0x200b3d[_0x6177('0x8')](_0x6177('0x9'),attributes,{'tableName':_0x6177('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 139d967..afecf99 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 _0x7bf3=['then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','options','raw'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7bf3,0x197));var _0x37bf=function(_0x17bacb,_0x2dba8a){_0x17bacb=_0x17bacb-0x0;var _0x54f83c=_0x7bf3[_0x17bacb];return _0x54f83c;};'use strict';var _=require(_0x37bf('0x0'));var util=require(_0x37bf('0x1'));var moment=require(_0x37bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x37bf('0x3'));var fs=require('fs');var Redis=require(_0x37bf('0x4'));var db=require(_0x37bf('0x5'))['db'];var utils=require(_0x37bf('0x6'));var logger=require(_0x37bf('0x7'))(_0x37bf('0x8'));var config=require(_0x37bf('0x9'));var jayson=require(_0x37bf('0xa'));var client=jayson[_0x37bf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5abec6,_0x485c88,_0x276629){return new BPromise(function(_0x3643d2,_0x353f6d){return client[_0x37bf('0xc')](_0x5abec6,_0x276629)['then'](function(_0x428588){logger[_0x37bf('0xd')](_0x37bf('0xe'),_0x485c88,_0x37bf('0xf'));logger['debug'](_0x37bf('0x10'),_0x485c88,_0x37bf('0xf'),JSON[_0x37bf('0x11')](_0x428588));if(_0x428588[_0x37bf('0x12')]){if(_0x428588[_0x37bf('0x12')][_0x37bf('0x13')]===0x1f4){logger[_0x37bf('0x12')](_0x37bf('0xe'),_0x485c88,_0x428588[_0x37bf('0x12')][_0x37bf('0x14')]);return _0x353f6d(_0x428588[_0x37bf('0x12')][_0x37bf('0x14')]);}logger[_0x37bf('0x12')](_0x37bf('0xe'),_0x485c88,_0x428588[_0x37bf('0x12')][_0x37bf('0x14')]);return _0x3643d2(_0x428588[_0x37bf('0x12')][_0x37bf('0x14')]);}else{logger[_0x37bf('0xd')](_0x37bf('0xe'),_0x485c88,_0x37bf('0xf'));_0x3643d2(_0x428588[_0x37bf('0x15')]['message']);}})[_0x37bf('0x16')](function(_0x1bd0cc){logger[_0x37bf('0x12')](_0x37bf('0xe'),_0x485c88,_0x1bd0cc);_0x353f6d(_0x1bd0cc);});});}exports[_0x37bf('0x17')]=function(_0x33348d){var _0x29f5c0=this;return new Promise(function(_0x5d97ca,_0x31c89a){return db[_0x37bf('0x18')][_0x37bf('0x19')](_0x33348d['body'],{'raw':_0x33348d[_0x37bf('0x1a')]?_0x33348d['options'][_0x37bf('0x1b')]===undefined?!![]:![]:!![]})[_0x37bf('0x1c')](function(_0x409a23){logger['info'](_0x37bf('0x17'),_0x33348d);logger['debug']('CreateSquareMessage',_0x33348d,JSON['stringify'](_0x409a23));_0x5d97ca(_0x409a23);})[_0x37bf('0x16')](function(_0x2892d8){logger[_0x37bf('0x12')]('CreateSquareMessage',_0x2892d8[_0x37bf('0x14')],_0x33348d);_0x31c89a(_0x29f5c0['error'](0x1f4,_0x2892d8[_0x37bf('0x14')]));});});}; \ No newline at end of file +var _0x06d9=['code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','options','raw','debug','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45e2e4,_0x5b0e05){var _0x2cce00=function(_0x3edddd){while(--_0x3edddd){_0x45e2e4['push'](_0x45e2e4['shift']());}};_0x2cce00(++_0x5b0e05);}(_0x06d9,0x128));var _0x906d=function(_0x4827b4,_0x4f2c65){_0x4827b4=_0x4827b4-0x0;var _0x348013=_0x06d9[_0x4827b4];return _0x348013;};'use strict';var _=require(_0x906d('0x0'));var util=require(_0x906d('0x1'));var moment=require('moment');var BPromise=require(_0x906d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x906d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x906d('0x4'))('rpc');var config=require(_0x906d('0x5'));var jayson=require(_0x906d('0x6'));var client=jayson[_0x906d('0x7')][_0x906d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56162e,_0x4f00c0,_0x1a614d){return new BPromise(function(_0x2ae703,_0x57e8df){return client[_0x906d('0x9')](_0x56162e,_0x1a614d)[_0x906d('0xa')](function(_0x4e4e06){logger[_0x906d('0xb')]('SquareMessage,\x20%s,\x20%s',_0x4f00c0,_0x906d('0xc'));logger['debug'](_0x906d('0xd'),_0x4f00c0,_0x906d('0xc'),JSON[_0x906d('0xe')](_0x4e4e06));if(_0x4e4e06[_0x906d('0xf')]){if(_0x4e4e06['error'][_0x906d('0x10')]===0x1f4){logger[_0x906d('0xf')](_0x906d('0x11'),_0x4f00c0,_0x4e4e06[_0x906d('0xf')]['message']);return _0x57e8df(_0x4e4e06[_0x906d('0xf')][_0x906d('0x12')]);}logger[_0x906d('0xf')](_0x906d('0x11'),_0x4f00c0,_0x4e4e06[_0x906d('0xf')][_0x906d('0x12')]);return _0x2ae703(_0x4e4e06[_0x906d('0xf')][_0x906d('0x12')]);}else{logger[_0x906d('0xb')](_0x906d('0x11'),_0x4f00c0,_0x906d('0xc'));_0x2ae703(_0x4e4e06[_0x906d('0x13')]['message']);}})[_0x906d('0x14')](function(_0x1f0a39){logger[_0x906d('0xf')](_0x906d('0x11'),_0x4f00c0,_0x1f0a39);_0x57e8df(_0x1f0a39);});});}exports[_0x906d('0x15')]=function(_0x34134a){var _0x4750b2=this;return new Promise(function(_0x59b979,_0x2d71d5){return db['SquareMessage'][_0x906d('0x16')](_0x34134a['body'],{'raw':_0x34134a[_0x906d('0x17')]?_0x34134a[_0x906d('0x17')][_0x906d('0x18')]===undefined?!![]:![]:!![]})[_0x906d('0xa')](function(_0x25b74b){logger[_0x906d('0xb')](_0x906d('0x15'),_0x34134a);logger[_0x906d('0x19')]('CreateSquareMessage',_0x34134a,JSON[_0x906d('0xe')](_0x25b74b));_0x59b979(_0x25b74b);})[_0x906d('0x14')](function(_0x414562){logger['error'](_0x906d('0x15'),_0x414562[_0x906d('0x12')],_0x34134a);_0x2d71d5(_0x4750b2['error'](0x1f4,_0x414562[_0x906d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d1a0655..2cb210b 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 _0x94f2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x7c9f16,_0x1a5b08){var _0x5a9326=function(_0x2144b3){while(--_0x2144b3){_0x7c9f16['push'](_0x7c9f16['shift']());}};_0x5a9326(++_0x1a5b08);}(_0x94f2,0x16c));var _0x294f=function(_0x52ce8a,_0x33a175){_0x52ce8a=_0x52ce8a-0x0;var _0x175fc8=_0x94f2[_0x52ce8a];return _0x175fc8;};'use strict';var multer=require(_0x294f('0x0'));var util=require(_0x294f('0x1'));var path=require(_0x294f('0x2'));var timeout=require(_0x294f('0x3'));var express=require(_0x294f('0x4'));var router=express[_0x294f('0x5')]();var fs_extra=require(_0x294f('0x6'));var auth=require(_0x294f('0x7'));var interaction=require(_0x294f('0x8'));var config=require('../../config/environment');var controller=require(_0x294f('0x9'));router[_0x294f('0xa')]('/',auth[_0x294f('0xb')](),controller[_0x294f('0xc')]);router[_0x294f('0xa')]('/:id',auth[_0x294f('0xb')](),controller[_0x294f('0xd')]);router[_0x294f('0xa')](_0x294f('0xe'),auth[_0x294f('0xb')](),timeout(_0x294f('0xf')),controller[_0x294f('0x10')]);router['post']('/',auth[_0x294f('0xb')](),controller[_0x294f('0x11')]);router['put']('/:id',auth[_0x294f('0xb')](),controller[_0x294f('0x12')]);router[_0x294f('0x13')](_0x294f('0x14'),auth[_0x294f('0xb')](),controller[_0x294f('0x15')]);module[_0x294f('0x16')]=router; \ No newline at end of file +var _0x878c=['create','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','15s','test'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x878c,0x148));var _0xc878=function(_0x1b8bb9,_0x44d022){_0x1b8bb9=_0x1b8bb9-0x0;var _0xe48724=_0x878c[_0x1b8bb9];return _0xe48724;};'use strict';var multer=require('multer');var util=require(_0xc878('0x0'));var path=require(_0xc878('0x1'));var timeout=require('connect-timeout');var express=require(_0xc878('0x2'));var router=express[_0xc878('0x3')]();var fs_extra=require(_0xc878('0x4'));var auth=require(_0xc878('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc878('0x6'));router[_0xc878('0x7')]('/',auth['isAuthenticated'](),controller[_0xc878('0x8')]);router[_0xc878('0x7')](_0xc878('0x9'),auth[_0xc878('0xa')](),controller[_0xc878('0xb')]);router[_0xc878('0x7')]('/:id/test',auth[_0xc878('0xa')](),timeout(_0xc878('0xc')),controller[_0xc878('0xd')]);router['post']('/',auth[_0xc878('0xa')](),controller[_0xc878('0xe')]);router['put'](_0xc878('0x9'),auth['isAuthenticated'](),controller[_0xc878('0xf')]);router[_0xc878('0x10')](_0xc878('0x9'),auth[_0xc878('0xa')](),controller['destroy']);module[_0xc878('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 1a6427b..7861407 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 _0x9068=['STRING','sequelize','exports'];(function(_0x46e0f1,_0x906c2){var _0x15b6a7=function(_0x513bb2){while(--_0x513bb2){_0x46e0f1['push'](_0x46e0f1['shift']());}};_0x15b6a7(++_0x906c2);}(_0x9068,0x11e));var _0x8906=function(_0x4c0e62,_0x378d17){_0x4c0e62=_0x4c0e62-0x0;var _0x770cbb=_0x9068[_0x4c0e62];return _0x770cbb;};'use strict';var Sequelize=require(_0x8906('0x0'));module[_0x8906('0x1')]={'name':{'type':Sequelize[_0x8906('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x8906('0x2')]},'description':{'type':Sequelize[_0x8906('0x2')]}}; \ No newline at end of file +var _0x16b1=['sequelize','exports','STRING','name'];(function(_0x1627e1,_0x4ad5eb){var _0x402aeb=function(_0x49cb1f){while(--_0x49cb1f){_0x1627e1['push'](_0x1627e1['shift']());}};_0x402aeb(++_0x4ad5eb);}(_0x16b1,0x1f4));var _0x116b=function(_0xfa7b29,_0x128f5c){_0xfa7b29=_0xfa7b29-0x0;var _0x50bc0c=_0x16b1[_0xfa7b29];return _0x50bc0c;};'use strict';var Sequelize=require(_0x116b('0x0'));module[_0x116b('0x1')]={'name':{'type':Sequelize[_0x116b('0x2')],'unique':_0x116b('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x116b('0x2')]},'description':{'type':Sequelize[_0x116b('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e214236..e7eecc0 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 _0x72f8=['end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ODBC','UserProfileResource','error','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','includeAll','include','findAll','catch','show','params','keys','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x4ab62e,_0x2f68e1){var _0x227ab9=function(_0x220fe0){while(--_0x220fe0){_0x4ab62e['push'](_0x4ab62e['shift']());}};_0x227ab9(++_0x2f68e1);}(_0x72f8,0x138));var _0x872f=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x72f8[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x872f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x872f('0x1'));var rp=require(_0x872f('0x2'));var moment=require(_0x872f('0x3'));var BPromise=require(_0x872f('0x4'));var Mustache=require(_0x872f('0x5'));var util=require(_0x872f('0x6'));var path=require(_0x872f('0x7'));var sox=require(_0x872f('0x8'));var csv=require('to-csv');var ejs=require(_0x872f('0x9'));var fs=require('fs');var fs_extra=require(_0x872f('0xa'));var _=require(_0x872f('0xb'));var squel=require(_0x872f('0xc'));var crypto=require(_0x872f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x872f('0xe'));var toCsv=require(_0x872f('0xf'));var querystring=require(_0x872f('0x10'));var Papa=require(_0x872f('0x11'));var Redis=require('ioredis');var authService=require(_0x872f('0x12'));var qs=require(_0x872f('0x13'));var as=require(_0x872f('0x14'));var hardwareService=require(_0x872f('0x15'));var logger=require('../../config/logger')(_0x872f('0x16'));var utils=require(_0x872f('0x17'));var config=require(_0x872f('0x18'));var licenseUtil=require(_0x872f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x314847,_0x1ca4f0){_0x1ca4f0=_0x1ca4f0||0xcc;return function(_0x2b7dde){if(_0x2b7dde){return _0x314847[_0x872f('0x1a')](_0x1ca4f0);}return _0x314847[_0x872f('0x1b')](_0x1ca4f0)[_0x872f('0x1c')]();};}function respondWithResult(_0x4195a1,_0x1ac3d1){_0x1ac3d1=_0x1ac3d1||0xc8;return function(_0x41d92c){if(_0x41d92c){return _0x4195a1[_0x872f('0x1b')](_0x1ac3d1)[_0x872f('0x1d')](_0x41d92c);}};}function respondWithFilteredResult(_0x1b76d7,_0x37954b){return function(_0x13b163){if(_0x13b163){var _0x29b67d=typeof _0x37954b[_0x872f('0x1e')]===_0x872f('0x1f')&&typeof _0x37954b[_0x872f('0x20')]==='undefined';var _0x21a46e=_0x13b163[_0x872f('0x21')];var _0x4c5201=_0x29b67d?0x0:_0x37954b[_0x872f('0x1e')];var _0x20970c=_0x29b67d?_0x13b163[_0x872f('0x21')]:_0x37954b[_0x872f('0x1e')]+_0x37954b[_0x872f('0x20')];var _0x32cb42;if(_0x20970c>=_0x21a46e){_0x20970c=_0x21a46e;_0x32cb42=0xc8;}else{_0x32cb42=0xce;}_0x1b76d7[_0x872f('0x1b')](_0x32cb42);return _0x1b76d7[_0x872f('0x22')](_0x872f('0x23'),_0x4c5201+'-'+_0x20970c+'/'+_0x21a46e)[_0x872f('0x1d')](_0x13b163);}return null;};}function patchUpdates(_0x40d8d6){return function(_0x1d893b){try{jsonpatch['apply'](_0x1d893b,_0x40d8d6,!![]);}catch(_0x4738b1){return BPromise['reject'](_0x4738b1);}return _0x1d893b['save']();};}function saveUpdates(_0x568f3e,_0x2c3beb){return function(_0x33ed69){if(_0x33ed69){return _0x33ed69[_0x872f('0x24')](_0x568f3e)[_0x872f('0x25')](function(_0x291300){return _0x291300;});}return null;};}function removeEntity(_0x2d542c,_0x2c0e11){return function(_0x3e3827){if(_0x3e3827){return _0x3e3827[_0x872f('0x26')]()[_0x872f('0x25')](function(){var _0x31e88d=_0x3e3827[_0x872f('0x27')]({'plain':!![]});var _0x58bcd4=_0x872f('0x28');return db[_0x872f('0x29')][_0x872f('0x26')]({'where':{'type':_0x58bcd4,'resourceId':_0x31e88d['id']}})['then'](function(){return _0x3e3827;});})['then'](function(){_0x2d542c['status'](0xcc)[_0x872f('0x1c')]();});}};}function handleEntityNotFound(_0x2724fd,_0x12d935){return function(_0x1609c3){if(!_0x1609c3){_0x2724fd['sendStatus'](0x194);}return _0x1609c3;};}function handleError(_0x5ecaa1,_0x5156f9){_0x5156f9=_0x5156f9||0x1f4;return function(_0x542ea7){logger[_0x872f('0x2a')](_0x542ea7['stack']);if(_0x542ea7[_0x872f('0x2b')]){delete _0x542ea7[_0x872f('0x2b')];}_0x5ecaa1[_0x872f('0x1b')](_0x5156f9)[_0x872f('0x2c')](_0x542ea7);};}exports[_0x872f('0x2d')]=function(_0x2861fe,_0x270dec){var _0x22a64e={},_0x410ab1={},_0x431ab4={'count':0x0,'rows':[]};var _0x24d64c=_[_0x872f('0x2e')](db[_0x872f('0x2f')][_0x872f('0x30')],function(_0xac9d60){return{'name':_0xac9d60[_0x872f('0x31')],'type':_0xac9d60[_0x872f('0x32')][_0x872f('0x33')]};});_0x410ab1['model']=_['map'](_0x24d64c,_0x872f('0x2b'));_0x410ab1[_0x872f('0x34')]=_['keys'](_0x2861fe['query']);_0x410ab1[_0x872f('0x35')]=_[_0x872f('0x36')](_0x410ab1[_0x872f('0x37')],_0x410ab1[_0x872f('0x34')]);_0x22a64e[_0x872f('0x38')]=_[_0x872f('0x36')](_0x410ab1[_0x872f('0x37')],qs[_0x872f('0x39')](_0x2861fe[_0x872f('0x34')][_0x872f('0x39')]));_0x22a64e['attributes']=_0x22a64e[_0x872f('0x38')][_0x872f('0x3a')]?_0x22a64e[_0x872f('0x38')]:_0x410ab1['model'];if(!_0x2861fe[_0x872f('0x34')][_0x872f('0x3b')]('nolimit')){_0x22a64e[_0x872f('0x20')]=qs[_0x872f('0x20')](_0x2861fe[_0x872f('0x34')][_0x872f('0x20')]);_0x22a64e['offset']=qs[_0x872f('0x1e')](_0x2861fe[_0x872f('0x34')][_0x872f('0x1e')]);}_0x22a64e['order']=qs[_0x872f('0x3c')](_0x2861fe['query'][_0x872f('0x3c')]);_0x22a64e[_0x872f('0x3d')]=qs[_0x872f('0x35')](_[_0x872f('0x3e')](_0x2861fe[_0x872f('0x34')],_0x410ab1['filters']),_0x24d64c);if(_0x2861fe[_0x872f('0x34')]['filter']){_0x22a64e[_0x872f('0x3d')]=_[_0x872f('0x3f')](_0x22a64e[_0x872f('0x3d')],{'$or':_['map'](_0x24d64c,function(_0x4ee54){if(_0x4ee54['type']!=='VIRTUAL'){var _0x161e03={};_0x161e03[_0x4ee54[_0x872f('0x2b')]]={'$like':'%'+_0x2861fe[_0x872f('0x34')][_0x872f('0x40')]+'%'};return _0x161e03;}})});}_0x22a64e=_[_0x872f('0x3f')]({},_0x22a64e,_0x2861fe['options']);var _0x568858={'where':_0x22a64e[_0x872f('0x3d')]};return db[_0x872f('0x2f')][_0x872f('0x21')](_0x568858)[_0x872f('0x25')](function(_0x4c6ea6){_0x431ab4[_0x872f('0x21')]=_0x4c6ea6;if(_0x2861fe[_0x872f('0x34')][_0x872f('0x41')]){_0x22a64e[_0x872f('0x42')]=[{'all':!![]}];}return db[_0x872f('0x2f')][_0x872f('0x43')](_0x22a64e);})['then'](function(_0x2d8cd7){_0x431ab4['rows']=_0x2d8cd7;return _0x431ab4;})[_0x872f('0x25')](respondWithFilteredResult(_0x270dec,_0x22a64e))[_0x872f('0x44')](handleError(_0x270dec,null));};exports[_0x872f('0x45')]=function(_0x1bf0de,_0x6e7590){var _0x5e4002={'raw':!![],'where':{'id':_0x1bf0de[_0x872f('0x46')]['id']}},_0x88abb1={};_0x88abb1[_0x872f('0x37')]=_[_0x872f('0x47')](db[_0x872f('0x2f')][_0x872f('0x30')]);_0x88abb1[_0x872f('0x34')]=_[_0x872f('0x47')](_0x1bf0de[_0x872f('0x34')]);_0x88abb1[_0x872f('0x35')]=_[_0x872f('0x36')](_0x88abb1[_0x872f('0x37')],_0x88abb1[_0x872f('0x34')]);_0x5e4002[_0x872f('0x38')]=_[_0x872f('0x36')](_0x88abb1[_0x872f('0x37')],qs[_0x872f('0x39')](_0x1bf0de[_0x872f('0x34')][_0x872f('0x39')]));_0x5e4002['attributes']=_0x5e4002[_0x872f('0x38')]['length']?_0x5e4002[_0x872f('0x38')]:_0x88abb1['model'];if(_0x1bf0de[_0x872f('0x34')][_0x872f('0x41')]){_0x5e4002[_0x872f('0x42')]=[{'all':!![]}];}_0x5e4002=_[_0x872f('0x3f')]({},_0x5e4002,_0x1bf0de[_0x872f('0x48')]);return db[_0x872f('0x2f')][_0x872f('0x49')](_0x5e4002)[_0x872f('0x25')](handleEntityNotFound(_0x6e7590,null))[_0x872f('0x25')](respondWithResult(_0x6e7590,null))[_0x872f('0x44')](handleError(_0x6e7590,null));};exports['create']=function(_0x121647,_0x555ddb){return db[_0x872f('0x2f')]['create'](_0x121647[_0x872f('0x4a')],{})[_0x872f('0x25')](function(_0x4b652d){var _0x4b358a=_0x121647[_0x872f('0x4b')][_0x872f('0x27')]({'plain':!![]});if(!_0x4b358a)throw new Error(_0x872f('0x4c'));if(_0x4b358a[_0x872f('0x4d')]===_0x872f('0x4b')){var _0x1a05ff=_0x4b652d['get']({'plain':!![]});var _0x1a0995=_0x872f('0x28');return db[_0x872f('0x4e')]['find']({'where':{'name':_0x1a0995,'userProfileId':_0x4b358a[_0x872f('0x4f')]},'raw':!![]})[_0x872f('0x25')](function(_0x2d4958){if(_0x2d4958&&_0x2d4958[_0x872f('0x50')]===0x0){return db['UserProfileResource'][_0x872f('0x51')]({'name':_0x1a05ff[_0x872f('0x2b')],'resourceId':_0x1a05ff['id'],'type':_0x2d4958[_0x872f('0x2b')],'sectionId':_0x2d4958['id']},{})['then'](function(){return _0x4b652d;});}else{return _0x4b652d;}})['catch'](function(_0x59bab7){logger[_0x872f('0x2a')](_0x872f('0x52'),_0x59bab7);throw _0x59bab7;});}return _0x4b652d;})[_0x872f('0x25')](respondWithResult(_0x555ddb,0xc9))[_0x872f('0x44')](handleError(_0x555ddb,null));};exports[_0x872f('0x24')]=function(_0x331ca6,_0xfc31c2){if(_0x331ca6[_0x872f('0x4a')]['id']){delete _0x331ca6[_0x872f('0x4a')]['id'];}return db['SquareOdbc'][_0x872f('0x49')]({'where':{'id':_0x331ca6[_0x872f('0x46')]['id']}})['then'](handleEntityNotFound(_0xfc31c2,null))['then'](saveUpdates(_0x331ca6[_0x872f('0x4a')],null))[_0x872f('0x25')](respondWithResult(_0xfc31c2,null))[_0x872f('0x44')](handleError(_0xfc31c2,null));};exports[_0x872f('0x26')]=function(_0x299862,_0x3ce84a){return db[_0x872f('0x2f')][_0x872f('0x49')]({'where':{'id':_0x299862[_0x872f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ce84a,null))[_0x872f('0x25')](removeEntity(_0x3ce84a,null))['catch'](handleError(_0x3ce84a,null));};exports[_0x872f('0x53')]=function(_0x48c3a2,_0x26e58c,_0x28c4b8){var _0x57e637;return db['SquareOdbc'][_0x872f('0x49')]({'where':{'id':_0x48c3a2[_0x872f('0x46')]['id']},'attributes':['id','dsn']})[_0x872f('0x25')](handleEntityNotFound(_0x26e58c,null))[_0x872f('0x25')](function(_0x3d3fd1){if(_0x3d3fd1){var _0x4d55f6=require('odbc')();_0x4d55f6['openSync'](_0x3d3fd1[_0x872f('0x54')]);_0x4d55f6['closeSync']();return _0x3d3fd1;}})['then'](respondWithResult(_0x26e58c,null))[_0x872f('0x44')](handleError(_0x26e58c,null));}; \ No newline at end of file +var _0x3ee5=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','SquareOdbc','fieldName','type','key','model','keys','intersection','attributes','query','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','openSync','closeSync','eml-format','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4f4c11,_0xdb6add){var _0x4dfd33=function(_0x163cfe){while(--_0x163cfe){_0x4f4c11['push'](_0x4f4c11['shift']());}};_0x4dfd33(++_0xdb6add);}(_0x3ee5,0x9b));var _0x53ee=function(_0x32e320,_0x24b6e2){_0x32e320=_0x32e320-0x0;var _0xf00061=_0x3ee5[_0x32e320];return _0xf00061;};'use strict';var emlformat=require(_0x53ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x53ee('0x1'));var moment=require(_0x53ee('0x2'));var BPromise=require(_0x53ee('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x53ee('0x4'));var fs=require('fs');var fs_extra=require(_0x53ee('0x5'));var _=require(_0x53ee('0x6'));var squel=require(_0x53ee('0x7'));var crypto=require(_0x53ee('0x8'));var jsforce=require(_0x53ee('0x9'));var deskjs=require(_0x53ee('0xa'));var toCsv=require(_0x53ee('0xb'));var querystring=require(_0x53ee('0xc'));var Papa=require(_0x53ee('0xd'));var Redis=require(_0x53ee('0xe'));var authService=require(_0x53ee('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x53ee('0x10'));var hardwareService=require(_0x53ee('0x11'));var logger=require('../../config/logger')(_0x53ee('0x12'));var utils=require(_0x53ee('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x53ee('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ed658,_0x17fe59){_0x17fe59=_0x17fe59||0xcc;return function(_0xb3daae){if(_0xb3daae){return _0x3ed658[_0x53ee('0x15')](_0x17fe59);}return _0x3ed658[_0x53ee('0x16')](_0x17fe59)[_0x53ee('0x17')]();};}function respondWithResult(_0x4e6bad,_0xa69308){_0xa69308=_0xa69308||0xc8;return function(_0x17f0be){if(_0x17f0be){return _0x4e6bad[_0x53ee('0x16')](_0xa69308)[_0x53ee('0x18')](_0x17f0be);}};}function respondWithFilteredResult(_0x12471f,_0x5cea68){return function(_0x32411e){if(_0x32411e){var _0x3ecf38=typeof _0x5cea68['offset']===_0x53ee('0x19')&&typeof _0x5cea68[_0x53ee('0x1a')]===_0x53ee('0x19');var _0x229217=_0x32411e[_0x53ee('0x1b')];var _0x303add=_0x3ecf38?0x0:_0x5cea68[_0x53ee('0x1c')];var _0x21eb0a=_0x3ecf38?_0x32411e[_0x53ee('0x1b')]:_0x5cea68[_0x53ee('0x1c')]+_0x5cea68[_0x53ee('0x1a')];var _0x50d572;if(_0x21eb0a>=_0x229217){_0x21eb0a=_0x229217;_0x50d572=0xc8;}else{_0x50d572=0xce;}_0x12471f[_0x53ee('0x16')](_0x50d572);return _0x12471f['set']('Content-Range',_0x303add+'-'+_0x21eb0a+'/'+_0x229217)['json'](_0x32411e);}return null;};}function patchUpdates(_0x11cbbe){return function(_0x1fe4ac){try{jsonpatch[_0x53ee('0x1d')](_0x1fe4ac,_0x11cbbe,!![]);}catch(_0x126f32){return BPromise[_0x53ee('0x1e')](_0x126f32);}return _0x1fe4ac['save']();};}function saveUpdates(_0x51892d,_0x2ad2a9){return function(_0x43d200){if(_0x43d200){return _0x43d200[_0x53ee('0x1f')](_0x51892d)[_0x53ee('0x20')](function(_0x4839d8){return _0x4839d8;});}return null;};}function removeEntity(_0x570a23,_0xa5c5f8){return function(_0x1b1032){if(_0x1b1032){return _0x1b1032[_0x53ee('0x21')]()[_0x53ee('0x20')](function(){var _0x2f5343=_0x1b1032[_0x53ee('0x22')]({'plain':!![]});var _0x353ae4='ODBC';return db[_0x53ee('0x23')][_0x53ee('0x21')]({'where':{'type':_0x353ae4,'resourceId':_0x2f5343['id']}})['then'](function(){return _0x1b1032;});})[_0x53ee('0x20')](function(){_0x570a23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5a4d,_0x2ade7d){return function(_0x385cda){if(!_0x385cda){_0x4c5a4d[_0x53ee('0x15')](0x194);}return _0x385cda;};}function handleError(_0xc1e2f1,_0x4eec37){_0x4eec37=_0x4eec37||0x1f4;return function(_0x45f304){logger['error'](_0x45f304[_0x53ee('0x24')]);if(_0x45f304[_0x53ee('0x25')]){delete _0x45f304[_0x53ee('0x25')];}_0xc1e2f1[_0x53ee('0x16')](_0x4eec37)[_0x53ee('0x26')](_0x45f304);};}exports[_0x53ee('0x27')]=function(_0x515324,_0x23010e){var _0x3919e3={},_0x196a3c={},_0x4db679={'count':0x0,'rows':[]};var _0x9c6ca=_[_0x53ee('0x28')](db[_0x53ee('0x29')]['rawAttributes'],function(_0x156dd2){return{'name':_0x156dd2[_0x53ee('0x2a')],'type':_0x156dd2[_0x53ee('0x2b')][_0x53ee('0x2c')]};});_0x196a3c[_0x53ee('0x2d')]=_[_0x53ee('0x28')](_0x9c6ca,_0x53ee('0x25'));_0x196a3c['query']=_[_0x53ee('0x2e')](_0x515324['query']);_0x196a3c['filters']=_[_0x53ee('0x2f')](_0x196a3c['model'],_0x196a3c['query']);_0x3919e3[_0x53ee('0x30')]=_[_0x53ee('0x2f')](_0x196a3c[_0x53ee('0x2d')],qs['fields'](_0x515324[_0x53ee('0x31')][_0x53ee('0x32')]));_0x3919e3[_0x53ee('0x30')]=_0x3919e3[_0x53ee('0x30')][_0x53ee('0x33')]?_0x3919e3[_0x53ee('0x30')]:_0x196a3c['model'];if(!_0x515324[_0x53ee('0x31')]['hasOwnProperty']('nolimit')){_0x3919e3[_0x53ee('0x1a')]=qs[_0x53ee('0x1a')](_0x515324[_0x53ee('0x31')][_0x53ee('0x1a')]);_0x3919e3[_0x53ee('0x1c')]=qs[_0x53ee('0x1c')](_0x515324['query'][_0x53ee('0x1c')]);}_0x3919e3[_0x53ee('0x34')]=qs[_0x53ee('0x35')](_0x515324[_0x53ee('0x31')][_0x53ee('0x35')]);_0x3919e3[_0x53ee('0x36')]=qs[_0x53ee('0x37')](_[_0x53ee('0x38')](_0x515324[_0x53ee('0x31')],_0x196a3c[_0x53ee('0x37')]),_0x9c6ca);if(_0x515324['query'][_0x53ee('0x39')]){_0x3919e3[_0x53ee('0x36')]=_[_0x53ee('0x3a')](_0x3919e3[_0x53ee('0x36')],{'$or':_[_0x53ee('0x28')](_0x9c6ca,function(_0x4f3a31){if(_0x4f3a31['type']!==_0x53ee('0x3b')){var _0x3c3503={};_0x3c3503[_0x4f3a31[_0x53ee('0x25')]]={'$like':'%'+_0x515324['query'][_0x53ee('0x39')]+'%'};return _0x3c3503;}})});}_0x3919e3=_[_0x53ee('0x3a')]({},_0x3919e3,_0x515324[_0x53ee('0x3c')]);var _0x53ecc6={'where':_0x3919e3[_0x53ee('0x36')]};return db[_0x53ee('0x29')][_0x53ee('0x1b')](_0x53ecc6)[_0x53ee('0x20')](function(_0x107c45){_0x4db679[_0x53ee('0x1b')]=_0x107c45;if(_0x515324[_0x53ee('0x31')][_0x53ee('0x3d')]){_0x3919e3['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x53ee('0x3e')](_0x3919e3);})[_0x53ee('0x20')](function(_0x51c459){_0x4db679['rows']=_0x51c459;return _0x4db679;})[_0x53ee('0x20')](respondWithFilteredResult(_0x23010e,_0x3919e3))['catch'](handleError(_0x23010e,null));};exports[_0x53ee('0x3f')]=function(_0x50718d,_0x34ead5){var _0x5b743d={'raw':!![],'where':{'id':_0x50718d[_0x53ee('0x40')]['id']}},_0x3ab440={};_0x3ab440[_0x53ee('0x2d')]=_['keys'](db[_0x53ee('0x29')][_0x53ee('0x41')]);_0x3ab440['query']=_['keys'](_0x50718d['query']);_0x3ab440[_0x53ee('0x37')]=_[_0x53ee('0x2f')](_0x3ab440[_0x53ee('0x2d')],_0x3ab440[_0x53ee('0x31')]);_0x5b743d[_0x53ee('0x30')]=_['intersection'](_0x3ab440[_0x53ee('0x2d')],qs[_0x53ee('0x32')](_0x50718d[_0x53ee('0x31')][_0x53ee('0x32')]));_0x5b743d[_0x53ee('0x30')]=_0x5b743d[_0x53ee('0x30')][_0x53ee('0x33')]?_0x5b743d['attributes']:_0x3ab440[_0x53ee('0x2d')];if(_0x50718d['query'][_0x53ee('0x3d')]){_0x5b743d[_0x53ee('0x42')]=[{'all':!![]}];}_0x5b743d=_[_0x53ee('0x3a')]({},_0x5b743d,_0x50718d[_0x53ee('0x3c')]);return db[_0x53ee('0x29')][_0x53ee('0x43')](_0x5b743d)[_0x53ee('0x20')](handleEntityNotFound(_0x34ead5,null))[_0x53ee('0x20')](respondWithResult(_0x34ead5,null))[_0x53ee('0x44')](handleError(_0x34ead5,null));};exports[_0x53ee('0x45')]=function(_0x1d1703,_0x48f0b1){return db[_0x53ee('0x29')]['create'](_0x1d1703[_0x53ee('0x46')],{})['then'](function(_0x29b72f){var _0xf3773e=_0x1d1703[_0x53ee('0x47')][_0x53ee('0x22')]({'plain':!![]});if(!_0xf3773e)throw new Error(_0x53ee('0x48'));if(_0xf3773e[_0x53ee('0x49')]==='user'){var _0x206296=_0x29b72f[_0x53ee('0x22')]({'plain':!![]});var _0x56a7c3=_0x53ee('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x56a7c3,'userProfileId':_0xf3773e[_0x53ee('0x4b')]},'raw':!![]})[_0x53ee('0x20')](function(_0x15b384){if(_0x15b384&&_0x15b384[_0x53ee('0x4c')]===0x0){return db[_0x53ee('0x23')][_0x53ee('0x45')]({'name':_0x206296['name'],'resourceId':_0x206296['id'],'type':_0x15b384[_0x53ee('0x25')],'sectionId':_0x15b384['id']},{})['then'](function(){return _0x29b72f;});}else{return _0x29b72f;}})[_0x53ee('0x44')](function(_0x1f4757){logger[_0x53ee('0x4d')](_0x53ee('0x4e'),_0x1f4757);throw _0x1f4757;});}return _0x29b72f;})[_0x53ee('0x20')](respondWithResult(_0x48f0b1,0xc9))[_0x53ee('0x44')](handleError(_0x48f0b1,null));};exports[_0x53ee('0x1f')]=function(_0x1afe86,_0x51d82d){if(_0x1afe86[_0x53ee('0x46')]['id']){delete _0x1afe86['body']['id'];}return db[_0x53ee('0x29')][_0x53ee('0x43')]({'where':{'id':_0x1afe86['params']['id']}})[_0x53ee('0x20')](handleEntityNotFound(_0x51d82d,null))[_0x53ee('0x20')](saveUpdates(_0x1afe86[_0x53ee('0x46')],null))[_0x53ee('0x20')](respondWithResult(_0x51d82d,null))[_0x53ee('0x44')](handleError(_0x51d82d,null));};exports['destroy']=function(_0x4e1489,_0x1d76b1){return db[_0x53ee('0x29')][_0x53ee('0x43')]({'where':{'id':_0x4e1489['params']['id']}})[_0x53ee('0x20')](handleEntityNotFound(_0x1d76b1,null))[_0x53ee('0x20')](removeEntity(_0x1d76b1,null))[_0x53ee('0x44')](handleError(_0x1d76b1,null));};exports['test']=function(_0x4bdbdb,_0x5db73f,_0x5ce1d5){var _0x3e2d9e;return db[_0x53ee('0x29')][_0x53ee('0x43')]({'where':{'id':_0x4bdbdb['params']['id']},'attributes':['id',_0x53ee('0x4f')]})[_0x53ee('0x20')](handleEntityNotFound(_0x5db73f,null))[_0x53ee('0x20')](function(_0x5a574e){if(_0x5a574e){var _0x4a2b82=require('odbc')();_0x4a2b82[_0x53ee('0x50')](_0x5a574e[_0x53ee('0x4f')]);_0x4a2b82[_0x53ee('0x51')]();return _0x5a574e;}})[_0x53ee('0x20')](respondWithResult(_0x5db73f,null))[_0x53ee('0x44')](handleError(_0x5db73f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0915472..613f4ea 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 _0xd572=['./squareOdbc.attributes','exports','SquareOdbc','square_odbc','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x282394,_0x15ef6c){var _0x29e8e8=function(_0x1b5c17){while(--_0x1b5c17){_0x282394['push'](_0x282394['shift']());}};_0x29e8e8(++_0x15ef6c);}(_0xd572,0xae));var _0x2d57=function(_0x301deb,_0x3ebcd6){_0x301deb=_0x301deb-0x0;var _0x334aa2=_0xd572[_0x301deb];return _0x334aa2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2d57('0x0'))(_0x2d57('0x1'));var moment=require(_0x2d57('0x2'));var BPromise=require(_0x2d57('0x3'));var rp=require(_0x2d57('0x4'));var fs=require('fs');var path=require(_0x2d57('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2d57('0x6'));module[_0x2d57('0x7')]=function(_0x3790e2,_0x315ddd){return _0x3790e2['define'](_0x2d57('0x8'),attributes,{'tableName':_0x2d57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52db=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','path'];(function(_0x3cc23e,_0x33ec80){var _0x48f700=function(_0x1690f6){while(--_0x1690f6){_0x3cc23e['push'](_0x3cc23e['shift']());}};_0x48f700(++_0x33ec80);}(_0x52db,0x13e));var _0xb52d=function(_0x3092e4,_0x3dcc53){_0x3092e4=_0x3092e4-0x0;var _0x573574=_0x52db[_0x3092e4];return _0x573574;};'use strict';var _=require(_0xb52d('0x0'));var util=require(_0xb52d('0x1'));var logger=require('../../config/logger')(_0xb52d('0x2'));var moment=require(_0xb52d('0x3'));var BPromise=require(_0xb52d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb52d('0x5'));var rimraf=require('rimraf');var config=require(_0xb52d('0x6'));var attributes=require(_0xb52d('0x7'));module[_0xb52d('0x8')]=function(_0xc92281,_0x5d830c){return _0xc92281[_0xb52d('0x9')](_0xb52d('0xa'),attributes,{'tableName':_0xb52d('0xb'),'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 a683226..e2dea3f 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 _0x5df4=['http','info','request\x20sent','debug','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x163c27,_0x2ecced){var _0x32728c=function(_0x1a5323){while(--_0x1a5323){_0x163c27['push'](_0x163c27['shift']());}};_0x32728c(++_0x2ecced);}(_0x5df4,0x14b));var _0x45df=function(_0x296024,_0x1712c9){_0x296024=_0x296024-0x0;var _0x4e4855=_0x5df4[_0x296024];return _0x4e4855;};'use strict';var _=require('lodash');var util=require(_0x45df('0x0'));var moment=require(_0x45df('0x1'));var BPromise=require(_0x45df('0x2'));var rs=require(_0x45df('0x3'));var fs=require('fs');var Redis=require(_0x45df('0x4'));var db=require(_0x45df('0x5'))['db'];var utils=require(_0x45df('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x45df('0x7'));var jayson=require(_0x45df('0x8'));var client=jayson[_0x45df('0x9')][_0x45df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44ba91,_0x3c2786,_0x190992){return new BPromise(function(_0x5a35d9,_0x191b42){return client['request'](_0x44ba91,_0x190992)['then'](function(_0xcc902c){logger[_0x45df('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x3c2786,_0x45df('0xc'));logger[_0x45df('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3c2786,_0x45df('0xc'),JSON[_0x45df('0xe')](_0xcc902c));if(_0xcc902c[_0x45df('0xf')]){if(_0xcc902c[_0x45df('0xf')][_0x45df('0x10')]===0x1f4){logger[_0x45df('0xf')](_0x45df('0x11'),_0x3c2786,_0xcc902c['error'][_0x45df('0x12')]);return _0x191b42(_0xcc902c[_0x45df('0xf')][_0x45df('0x12')]);}logger[_0x45df('0xf')](_0x45df('0x11'),_0x3c2786,_0xcc902c[_0x45df('0xf')]['message']);return _0x5a35d9(_0xcc902c['error'][_0x45df('0x12')]);}else{logger[_0x45df('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x3c2786,_0x45df('0xc'));_0x5a35d9(_0xcc902c['result']['message']);}})[_0x45df('0x13')](function(_0x5da892){logger[_0x45df('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x3c2786,_0x5da892);_0x191b42(_0x5da892);});});}exports[_0x45df('0x14')]=function(_0xe954a8){var _0x1539bf=this;return new Promise(function(_0x3ae035,_0xf70fd){return db[_0x45df('0x15')][_0x45df('0x16')]({'raw':_0xe954a8[_0x45df('0x17')]?_0xe954a8['options'][_0x45df('0x18')]===undefined?!![]:![]:!![],'where':_0xe954a8[_0x45df('0x17')]?_0xe954a8[_0x45df('0x17')][_0x45df('0x19')]||null:null,'attributes':_0xe954a8['options']?_0xe954a8[_0x45df('0x17')][_0x45df('0x1a')]||null:null,'include':_0xe954a8[_0x45df('0x17')]?_0xe954a8[_0x45df('0x17')][_0x45df('0x1b')]?_[_0x45df('0x1c')](_0xe954a8[_0x45df('0x17')]['include'],function(_0x1c41b2){return{'model':db[_0x1c41b2[_0x45df('0x1d')]],'as':_0x1c41b2['as'],'attributes':_0x1c41b2[_0x45df('0x1a')],'include':_0x1c41b2[_0x45df('0x1b')]?_[_0x45df('0x1c')](_0x1c41b2['include'],function(_0x295a92){return{'model':db[_0x295a92[_0x45df('0x1d')]],'as':_0x295a92['as'],'attributes':_0x295a92[_0x45df('0x1a')],'include':_0x295a92[_0x45df('0x1b')]?_[_0x45df('0x1c')](_0x295a92[_0x45df('0x1b')],function(_0x1ca875){return{'model':db[_0x1ca875['model']],'as':_0x1ca875['as'],'attributes':_0x1ca875['attributes']};}):[]};}):[]};}):[]:[]})[_0x45df('0x1e')](function(_0x4b2ab4){logger[_0x45df('0xb')](_0x45df('0x14'),_0xe954a8);logger[_0x45df('0xd')](_0x45df('0x14'),_0xe954a8,JSON[_0x45df('0xe')](_0x4b2ab4));_0x3ae035(_0x4b2ab4);})[_0x45df('0x13')](function(_0x1b37e6){logger[_0x45df('0xf')](_0x45df('0x14'),_0x1b37e6[_0x45df('0x12')],_0xe954a8);_0xf70fd(_0x1539bf[_0x45df('0xf')](0x1f4,_0x1b37e6[_0x45df('0x12')]));});});}; \ No newline at end of file +var _0xe4f0=['SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0xe4f0,0x195));var _0x0e4f=function(_0x3549d9,_0x274b08){_0x3549d9=_0x3549d9-0x0;var _0x493e01=_0xe4f0[_0x3549d9];return _0x493e01;};'use strict';var _=require(_0x0e4f('0x0'));var util=require(_0x0e4f('0x1'));var moment=require(_0x0e4f('0x2'));var BPromise=require(_0x0e4f('0x3'));var rs=require(_0x0e4f('0x4'));var fs=require('fs');var Redis=require(_0x0e4f('0x5'));var db=require(_0x0e4f('0x6'))['db'];var utils=require(_0x0e4f('0x7'));var logger=require(_0x0e4f('0x8'))(_0x0e4f('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e4f('0xa'));var client=jayson[_0x0e4f('0xb')][_0x0e4f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ab552,_0x458cb8,_0x24ad0e){return new BPromise(function(_0x72739a,_0xc5e1a7){return client[_0x0e4f('0xd')](_0x3ab552,_0x24ad0e)[_0x0e4f('0xe')](function(_0x1f8e96){logger['info'](_0x0e4f('0xf'),_0x458cb8,_0x0e4f('0x10'));logger[_0x0e4f('0x11')](_0x0e4f('0x12'),_0x458cb8,'request\x20sent',JSON[_0x0e4f('0x13')](_0x1f8e96));if(_0x1f8e96[_0x0e4f('0x14')]){if(_0x1f8e96[_0x0e4f('0x14')][_0x0e4f('0x15')]===0x1f4){logger['error'](_0x0e4f('0xf'),_0x458cb8,_0x1f8e96[_0x0e4f('0x14')][_0x0e4f('0x16')]);return _0xc5e1a7(_0x1f8e96[_0x0e4f('0x14')]['message']);}logger[_0x0e4f('0x14')](_0x0e4f('0xf'),_0x458cb8,_0x1f8e96[_0x0e4f('0x14')][_0x0e4f('0x16')]);return _0x72739a(_0x1f8e96['error']['message']);}else{logger[_0x0e4f('0x17')](_0x0e4f('0xf'),_0x458cb8,_0x0e4f('0x10'));_0x72739a(_0x1f8e96['result'][_0x0e4f('0x16')]);}})[_0x0e4f('0x18')](function(_0x4355f1){logger[_0x0e4f('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x458cb8,_0x4355f1);_0xc5e1a7(_0x4355f1);});});}exports[_0x0e4f('0x19')]=function(_0xd0605d){var _0x4bdbd9=this;return new Promise(function(_0x2b31eb,_0x24d6ba){return db[_0x0e4f('0x1a')][_0x0e4f('0x1b')]({'raw':_0xd0605d[_0x0e4f('0x1c')]?_0xd0605d['options'][_0x0e4f('0x1d')]===undefined?!![]:![]:!![],'where':_0xd0605d[_0x0e4f('0x1c')]?_0xd0605d['options'][_0x0e4f('0x1e')]||null:null,'attributes':_0xd0605d[_0x0e4f('0x1c')]?_0xd0605d['options'][_0x0e4f('0x1f')]||null:null,'include':_0xd0605d['options']?_0xd0605d[_0x0e4f('0x1c')][_0x0e4f('0x20')]?_[_0x0e4f('0x21')](_0xd0605d[_0x0e4f('0x1c')]['include'],function(_0x1b66a3){return{'model':db[_0x1b66a3[_0x0e4f('0x22')]],'as':_0x1b66a3['as'],'attributes':_0x1b66a3['attributes'],'include':_0x1b66a3[_0x0e4f('0x20')]?_[_0x0e4f('0x21')](_0x1b66a3[_0x0e4f('0x20')],function(_0x57f1f5){return{'model':db[_0x57f1f5[_0x0e4f('0x22')]],'as':_0x57f1f5['as'],'attributes':_0x57f1f5[_0x0e4f('0x1f')],'include':_0x57f1f5[_0x0e4f('0x20')]?_['map'](_0x57f1f5[_0x0e4f('0x20')],function(_0x19444f){return{'model':db[_0x19444f[_0x0e4f('0x22')]],'as':_0x19444f['as'],'attributes':_0x19444f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e4f('0xe')](function(_0x1212c4){logger['info']('ShowSquareOdbc',_0xd0605d);logger[_0x0e4f('0x11')](_0x0e4f('0x19'),_0xd0605d,JSON[_0x0e4f('0x13')](_0x1212c4));_0x2b31eb(_0x1212c4);})['catch'](function(_0x6d5da3){logger[_0x0e4f('0x14')]('ShowSquareOdbc',_0x6d5da3[_0x0e4f('0x16')],_0xd0605d);_0x24d6ba(_0x4bdbd9[_0x0e4f('0x14')](0x1f4,_0x6d5da3[_0x0e4f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 5a2e3c4..f052980 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 _0x7269=['create','/:id/users','addUsers','put','update','destroy','removeUsers','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','getUsers','post'];(function(_0x56ad2c,_0x2f41c3){var _0x143ea6=function(_0x13ec13){while(--_0x13ec13){_0x56ad2c['push'](_0x56ad2c['shift']());}};_0x143ea6(++_0x2f41c3);}(_0x7269,0x76));var _0x9726=function(_0x1ec459,_0x3355af){_0x1ec459=_0x1ec459-0x0;var _0x575e9f=_0x7269[_0x1ec459];return _0x575e9f;};'use strict';var multer=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var path=require(_0x9726('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9726('0x3')]();var fs_extra=require(_0x9726('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9726('0x5'));var config=require(_0x9726('0x6'));var controller=require(_0x9726('0x7'));router[_0x9726('0x8')]('/',auth[_0x9726('0x9')](),controller[_0x9726('0xa')]);router[_0x9726('0x8')](_0x9726('0xb'),auth[_0x9726('0x9')](),controller['show']);router[_0x9726('0x8')]('/:id/users',auth[_0x9726('0x9')](),controller[_0x9726('0xc')]);router[_0x9726('0xd')]('/',auth['isAuthenticated'](),controller[_0x9726('0xe')]);router[_0x9726('0xd')](_0x9726('0xf'),auth['isAuthenticated'](),controller[_0x9726('0x10')]);router[_0x9726('0x11')](_0x9726('0xb'),auth[_0x9726('0x9')](),controller[_0x9726('0x12')]);router['delete']('/:id',auth[_0x9726('0x9')](),controller[_0x9726('0x13')]);router['delete'](_0x9726('0xf'),auth[_0x9726('0x9')](),controller[_0x9726('0x14')]);module[_0x9726('0x15')]=router; \ No newline at end of file +var _0x2160=['create','/:id/users','put','/:id','destroy','delete','removeUsers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','getUsers','post'];(function(_0x3686ac,_0x2cbb6b){var _0x45f9db=function(_0x52735c){while(--_0x52735c){_0x3686ac['push'](_0x3686ac['shift']());}};_0x45f9db(++_0x2cbb6b);}(_0x2160,0x132));var _0x0216=function(_0x5cd61c,_0x63328d){_0x5cd61c=_0x5cd61c-0x0;var _0x48256a=_0x2160[_0x5cd61c];return _0x48256a;};'use strict';var multer=require('multer');var util=require(_0x0216('0x0'));var path=require(_0x0216('0x1'));var timeout=require(_0x0216('0x2'));var express=require(_0x0216('0x3'));var router=express[_0x0216('0x4')]();var fs_extra=require(_0x0216('0x5'));var auth=require(_0x0216('0x6'));var interaction=require(_0x0216('0x7'));var config=require(_0x0216('0x8'));var controller=require(_0x0216('0x9'));router[_0x0216('0xa')]('/',auth[_0x0216('0xb')](),controller[_0x0216('0xc')]);router[_0x0216('0xa')]('/:id',auth[_0x0216('0xb')](),controller[_0x0216('0xd')]);router[_0x0216('0xa')]('/:id/users',auth[_0x0216('0xb')](),controller[_0x0216('0xe')]);router[_0x0216('0xf')]('/',auth['isAuthenticated'](),controller[_0x0216('0x10')]);router[_0x0216('0xf')](_0x0216('0x11'),auth['isAuthenticated'](),controller['addUsers']);router[_0x0216('0x12')](_0x0216('0x13'),auth[_0x0216('0xb')](),controller['update']);router['delete'](_0x0216('0x13'),auth[_0x0216('0xb')](),controller[_0x0216('0x14')]);router[_0x0216('0x15')](_0x0216('0x11'),auth[_0x0216('0xb')](),controller[_0x0216('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index fa35a83..ded2b86 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 _0xb465=['BLOB','long','getDataValue','preproduction','toString','utf8','production','sequelize','exports','STRING','name','TEXT'];(function(_0x3b62a5,_0x34d1c8){var _0x12c2c7=function(_0x599451){while(--_0x599451){_0x3b62a5['push'](_0x3b62a5['shift']());}};_0x12c2c7(++_0x34d1c8);}(_0xb465,0xaf));var _0x5b46=function(_0x1cc4e1,_0x1629d4){_0x1cc4e1=_0x1cc4e1-0x0;var _0x192d47=_0xb465[_0x1cc4e1];return _0x192d47;};'use strict';var Sequelize=require(_0x5b46('0x0'));module[_0x5b46('0x1')]={'name':{'type':Sequelize[_0x5b46('0x2')],'unique':_0x5b46('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5b46('0x2')]},'notes':{'type':Sequelize[_0x5b46('0x4')]},'preproduction':{'type':Sequelize[_0x5b46('0x5')](_0x5b46('0x6')),'get':function(){if(this[_0x5b46('0x7')](_0x5b46('0x8'))){return this[_0x5b46('0x7')](_0x5b46('0x8'))[_0x5b46('0x9')](_0x5b46('0xa'));}}},'production':{'type':Sequelize[_0x5b46('0x5')]('long'),'get':function(){if(this[_0x5b46('0x7')](_0x5b46('0xb'))){return this[_0x5b46('0x7')](_0x5b46('0xb'))[_0x5b46('0x9')](_0x5b46('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x64e6=['toString','DATE','sequelize','STRING','name','TEXT','getDataValue','preproduction','utf8','BLOB','long','production'];(function(_0x23f399,_0x2d4fa8){var _0x380e1a=function(_0x529e25){while(--_0x529e25){_0x23f399['push'](_0x23f399['shift']());}};_0x380e1a(++_0x2d4fa8);}(_0x64e6,0x1b2));var _0x664e=function(_0x4029b3,_0x50061f){_0x4029b3=_0x4029b3-0x0;var _0x5a429e=_0x64e6[_0x4029b3];return _0x5a429e;};'use strict';var Sequelize=require(_0x664e('0x0'));module['exports']={'name':{'type':Sequelize[_0x664e('0x1')],'unique':_0x664e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x664e('0x1')]},'notes':{'type':Sequelize[_0x664e('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x664e('0x4')]('preproduction')){return this[_0x664e('0x4')](_0x664e('0x5'))['toString'](_0x664e('0x6'));}}},'production':{'type':Sequelize[_0x664e('0x7')](_0x664e('0x8')),'get':function(){if(this['getDataValue'](_0x664e('0x9'))){return this[_0x664e('0x4')](_0x664e('0x9'))[_0x664e('0xa')](_0x664e('0x6'));}}},'savedAt':{'type':Sequelize[_0x664e('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 35f02c9..b56656f 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 _0x396c=['sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','order','pick','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','json','undefined','limit','count','offset','status','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','send','index','map','SquareProject','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0x396c,0x13e));var _0xc396=function(_0x27e9f4,_0x2f19c0){_0x27e9f4=_0x27e9f4-0x0;var _0x3d6622=_0x396c[_0x27e9f4];return _0x3d6622;};'use strict';var emlformat=require(_0xc396('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc396('0x1'));var rp=require(_0xc396('0x2'));var moment=require(_0xc396('0x3'));var BPromise=require(_0xc396('0x4'));var Mustache=require(_0xc396('0x5'));var util=require('util');var path=require(_0xc396('0x6'));var sox=require(_0xc396('0x7'));var csv=require(_0xc396('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc396('0x9'));var jsforce=require(_0xc396('0xa'));var deskjs=require(_0xc396('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc396('0xc'));var Redis=require(_0xc396('0xd'));var authService=require(_0xc396('0xe'));var qs=require(_0xc396('0xf'));var as=require(_0xc396('0x10'));var hardwareService=require(_0xc396('0x11'));var logger=require(_0xc396('0x12'))('api');var utils=require(_0xc396('0x13'));var config=require(_0xc396('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc396('0x15')]=_[_0xc396('0x16')](config['redis'],{'host':_0xc396('0x17'),'port':0x18eb});var socket=require(_0xc396('0x18'))(new Redis(config[_0xc396('0x15')]));require(_0xc396('0x19'))[_0xc396('0x1a')](socket);function respondWithStatusCode(_0x2db1ae,_0x4dfb41){_0x4dfb41=_0x4dfb41||0xcc;return function(_0x5c8384){if(_0x5c8384){return _0x2db1ae[_0xc396('0x1b')](_0x4dfb41);}return _0x2db1ae['status'](_0x4dfb41)['end']();};}function respondWithResult(_0x27339a,_0x526575){_0x526575=_0x526575||0xc8;return function(_0x59b755){if(_0x59b755){return _0x27339a['status'](_0x526575)[_0xc396('0x1c')](_0x59b755);}};}function respondWithFilteredResult(_0xd9c4a7,_0x523972){return function(_0x1bdc51){if(_0x1bdc51){var _0x14eafb=typeof _0x523972['offset']===_0xc396('0x1d')&&typeof _0x523972[_0xc396('0x1e')]===_0xc396('0x1d');var _0x4ae3ca=_0x1bdc51[_0xc396('0x1f')];var _0x4c49f5=_0x14eafb?0x0:_0x523972[_0xc396('0x20')];var _0x499a82=_0x14eafb?_0x1bdc51[_0xc396('0x1f')]:_0x523972[_0xc396('0x20')]+_0x523972[_0xc396('0x1e')];var _0x145397;if(_0x499a82>=_0x4ae3ca){_0x499a82=_0x4ae3ca;_0x145397=0xc8;}else{_0x145397=0xce;}_0xd9c4a7[_0xc396('0x21')](_0x145397);return _0xd9c4a7['set'](_0xc396('0x22'),_0x4c49f5+'-'+_0x499a82+'/'+_0x4ae3ca)['json'](_0x1bdc51);}return null;};}function patchUpdates(_0x9d17a5){return function(_0x39c219){try{jsonpatch['apply'](_0x39c219,_0x9d17a5,!![]);}catch(_0x2a710b){return BPromise[_0xc396('0x23')](_0x2a710b);}return _0x39c219[_0xc396('0x24')]();};}function saveUpdates(_0x1a1498,_0x221e7d){return function(_0x255248){if(_0x255248){return _0x255248[_0xc396('0x25')](_0x1a1498)[_0xc396('0x26')](function(_0x7afc8c){return _0x7afc8c;});}return null;};}function removeEntity(_0x53607b,_0x2ea39e){return function(_0xc13ae9){if(_0xc13ae9){return _0xc13ae9[_0xc396('0x27')]()[_0xc396('0x26')](function(){var _0x5f07ac=_0xc13ae9[_0xc396('0x28')]({'plain':!![]});var _0x5677bc='SquareProjects';return db[_0xc396('0x29')][_0xc396('0x27')]({'where':{'type':_0x5677bc,'resourceId':_0x5f07ac['id']}})[_0xc396('0x26')](function(){return _0xc13ae9;});})[_0xc396('0x26')](function(){_0x53607b[_0xc396('0x21')](0xcc)[_0xc396('0x2a')]();});}};}function handleEntityNotFound(_0x14a094,_0x21e07b){return function(_0x515216){if(!_0x515216){_0x14a094['sendStatus'](0x194);}return _0x515216;};}function handleError(_0x324546,_0x4b9f22){_0x4b9f22=_0x4b9f22||0x1f4;return function(_0x39c3e8){logger[_0xc396('0x2b')](_0x39c3e8[_0xc396('0x2c')]);if(_0x39c3e8['name']){delete _0x39c3e8['name'];}_0x324546[_0xc396('0x21')](_0x4b9f22)[_0xc396('0x2d')](_0x39c3e8);};}exports[_0xc396('0x2e')]=function(_0x2762eb,_0xd706ea){var _0x10fa09={},_0x2121c2={},_0xab3832={'count':0x0,'rows':[]};var _0x11d7ce=_[_0xc396('0x2f')](db[_0xc396('0x30')][_0xc396('0x31')],function(_0x2576d2){return{'name':_0x2576d2['fieldName'],'type':_0x2576d2[_0xc396('0x32')][_0xc396('0x33')]};});_0x2121c2[_0xc396('0x34')]=_['map'](_0x11d7ce,_0xc396('0x35'));_0x2121c2[_0xc396('0x36')]=_[_0xc396('0x37')](_0x2762eb[_0xc396('0x36')]);_0x2121c2[_0xc396('0x38')]=_[_0xc396('0x39')](_0x2121c2[_0xc396('0x34')],_0x2121c2[_0xc396('0x36')]);_0x10fa09[_0xc396('0x3a')]=_[_0xc396('0x39')](_0x2121c2[_0xc396('0x34')],qs[_0xc396('0x3b')](_0x2762eb[_0xc396('0x36')][_0xc396('0x3b')]));_0x10fa09[_0xc396('0x3a')]=_0x10fa09['attributes'][_0xc396('0x3c')]?_0x10fa09[_0xc396('0x3a')]:_0x2121c2[_0xc396('0x34')];if(!_0x2762eb[_0xc396('0x36')]['hasOwnProperty'](_0xc396('0x3d'))){_0x10fa09['limit']=qs['limit'](_0x2762eb[_0xc396('0x36')][_0xc396('0x1e')]);_0x10fa09['offset']=qs[_0xc396('0x20')](_0x2762eb['query'][_0xc396('0x20')]);}_0x10fa09['order']=qs[_0xc396('0x3e')](_0x2762eb[_0xc396('0x36')][_0xc396('0x3e')]);_0x10fa09[_0xc396('0x3f')]=qs[_0xc396('0x38')](_['pick'](_0x2762eb[_0xc396('0x36')],_0x2121c2[_0xc396('0x38')]),_0x11d7ce);if(_0x2762eb[_0xc396('0x36')][_0xc396('0x40')]){_0x10fa09[_0xc396('0x3f')]=_[_0xc396('0x41')](_0x10fa09[_0xc396('0x3f')],{'$or':_['map'](_0x11d7ce,function(_0x24b6da){if(_0x24b6da[_0xc396('0x32')]!==_0xc396('0x42')){var _0x7b706a={};_0x7b706a[_0x24b6da[_0xc396('0x35')]]={'$like':'%'+_0x2762eb['query']['filter']+'%'};return _0x7b706a;}})});}_0x10fa09=_['merge']({},_0x10fa09,_0x2762eb['options']);var _0x1cdc41={'where':_0x10fa09[_0xc396('0x3f')]};return db['SquareProject']['count'](_0x1cdc41)[_0xc396('0x26')](function(_0x1ae25a){_0xab3832['count']=_0x1ae25a;if(_0x2762eb[_0xc396('0x36')][_0xc396('0x43')]){_0x10fa09['include']=[{'all':!![]}];}return db['SquareProject'][_0xc396('0x44')](_0x10fa09);})[_0xc396('0x26')](function(_0x352913){_0xab3832[_0xc396('0x45')]=_0x352913;return _0xab3832;})[_0xc396('0x26')](respondWithFilteredResult(_0xd706ea,_0x10fa09))['catch'](handleError(_0xd706ea,null));};exports[_0xc396('0x46')]=function(_0x4da9d1,_0xc68d2){var _0x3fe7fa={'raw':![],'where':{'id':_0x4da9d1[_0xc396('0x47')]['id']}},_0x224a66={};_0x224a66[_0xc396('0x34')]=_[_0xc396('0x37')](db['SquareProject'][_0xc396('0x31')]);_0x224a66[_0xc396('0x36')]=_[_0xc396('0x37')](_0x4da9d1[_0xc396('0x36')]);_0x224a66[_0xc396('0x38')]=_['intersection'](_0x224a66[_0xc396('0x34')],_0x224a66[_0xc396('0x36')]);_0x3fe7fa[_0xc396('0x3a')]=_['intersection'](_0x224a66[_0xc396('0x34')],qs[_0xc396('0x3b')](_0x4da9d1['query']['fields']));_0x3fe7fa[_0xc396('0x3a')]=_0x3fe7fa[_0xc396('0x3a')][_0xc396('0x3c')]?_0x3fe7fa['attributes']:_0x224a66[_0xc396('0x34')];if(_0x4da9d1[_0xc396('0x36')]['includeAll']){_0x3fe7fa[_0xc396('0x48')]=[{'all':!![]}];}_0x3fe7fa=_[_0xc396('0x41')]({},_0x3fe7fa,_0x4da9d1[_0xc396('0x49')]);return db[_0xc396('0x30')][_0xc396('0x4a')](_0x3fe7fa)[_0xc396('0x26')](handleEntityNotFound(_0xc68d2,null))[_0xc396('0x26')](respondWithResult(_0xc68d2,null))[_0xc396('0x4b')](handleError(_0xc68d2,null));};exports[_0xc396('0x4c')]=function(_0x296d59,_0x10a1be){return db['SquareProject'][_0xc396('0x4c')](_0x296d59[_0xc396('0x4d')],{})[_0xc396('0x26')](function(_0x1f5d2f){var _0x4191f5=_0x296d59[_0xc396('0x4e')][_0xc396('0x28')]({'plain':!![]});if(!_0x4191f5)throw new Error(_0xc396('0x4f'));if(_0x4191f5[_0xc396('0x50')]===_0xc396('0x4e')){var _0x53b591=_0x1f5d2f[_0xc396('0x28')]({'plain':!![]});var _0x4b3e2e='SquareProjects';return db[_0xc396('0x51')][_0xc396('0x4a')]({'where':{'name':_0x4b3e2e,'userProfileId':_0x4191f5[_0xc396('0x52')]},'raw':!![]})[_0xc396('0x26')](function(_0xc70e3b){if(_0xc70e3b&&_0xc70e3b[_0xc396('0x53')]===0x0){return db[_0xc396('0x29')]['create']({'name':_0x53b591[_0xc396('0x35')],'resourceId':_0x53b591['id'],'type':_0xc70e3b[_0xc396('0x35')],'sectionId':_0xc70e3b['id']},{})[_0xc396('0x26')](function(){return _0x1f5d2f;});}else{return _0x1f5d2f;}})['catch'](function(_0x501ab1){logger[_0xc396('0x2b')](_0xc396('0x54'),_0x501ab1);throw _0x501ab1;});}return _0x1f5d2f;})[_0xc396('0x26')](respondWithResult(_0x10a1be,0xc9))[_0xc396('0x4b')](handleError(_0x10a1be,null));};exports['update']=function(_0x1f7447,_0xc624c){if(_0x1f7447[_0xc396('0x4d')]['id']){delete _0x1f7447[_0xc396('0x4d')]['id'];}return db[_0xc396('0x30')][_0xc396('0x4a')]({'where':{'id':_0x1f7447['params']['id']}})[_0xc396('0x26')](handleEntityNotFound(_0xc624c,null))[_0xc396('0x26')](saveUpdates(_0x1f7447[_0xc396('0x4d')],null))[_0xc396('0x26')](respondWithResult(_0xc624c,null))[_0xc396('0x4b')](handleError(_0xc624c,null));};exports['destroy']=function(_0x3c4495,_0x325eac){return db[_0xc396('0x30')]['find']({'where':{'id':_0x3c4495['params']['id']}})[_0xc396('0x26')](handleEntityNotFound(_0x325eac,null))['then'](removeEntity(_0x325eac,null))[_0xc396('0x4b')](handleError(_0x325eac,null));};exports[_0xc396('0x55')]=function(_0x2df7e9,_0xdb7532,_0x292e58){return db[_0xc396('0x30')][_0xc396('0x4a')]({'where':{'id':_0x2df7e9[_0xc396('0x47')]['id']}})[_0xc396('0x26')](handleEntityNotFound(_0xdb7532,null))[_0xc396('0x26')](function(_0x393b80){if(_0x393b80){return _0x393b80[_0xc396('0x55')](_0x2df7e9[_0xc396('0x4d')][_0xc396('0x56')],_['omit'](_0x2df7e9['body'],[_0xc396('0x56'),'id'])||{});}})[_0xc396('0x26')](respondWithResult(_0xdb7532,null))[_0xc396('0x4b')](handleError(_0xdb7532,null));};exports[_0xc396('0x57')]=function(_0x337006,_0x450815,_0x438fe2){return db[_0xc396('0x30')][_0xc396('0x4a')]({'where':{'id':_0x337006[_0xc396('0x47')]['id']}})['then'](handleEntityNotFound(_0x450815,null))[_0xc396('0x26')](function(_0x567f8b){if(_0x567f8b){return _0x567f8b[_0xc396('0x57')](_0x337006[_0xc396('0x36')][_0xc396('0x56')])[_0xc396('0x26')](function(){if(_['isArray'](_0x337006[_0xc396('0x36')][_0xc396('0x56')])){for(var _0x2d5328=0x0;_0x2d5328<_0x337006[_0xc396('0x36')]['ids'][_0xc396('0x3c')];_0x2d5328+=0x1){socket[_0xc396('0x58')](_0xc396('0x59'),{'UserId':Number(_0x337006[_0xc396('0x36')][_0xc396('0x56')][_0x2d5328]),'SquareProjectId':Number(_0x337006[_0xc396('0x47')]['id'])});}}else{socket[_0xc396('0x58')](_0xc396('0x59'),{'UserId':Number(_0x337006[_0xc396('0x36')][_0xc396('0x56')]),'SquareProjectId':Number(_0x337006['params']['id'])});}});}})[_0xc396('0x26')](respondWithStatusCode(_0x450815,null))[_0xc396('0x4b')](handleError(_0x450815,null));};exports[_0xc396('0x5a')]=function(_0x2ff472,_0x14ce64,_0x31e7e5){var _0x5153e6={};var _0x49fa61={};var _0x1ef299;var _0x1350ca;return db[_0xc396('0x30')][_0xc396('0x5b')]({'where':{'id':_0x2ff472[_0xc396('0x47')]['id']}})[_0xc396('0x26')](handleEntityNotFound(_0x14ce64,null))['then'](function(_0x3b3671){if(_0x3b3671){_0x1ef299=_0x3b3671;_0x49fa61['model']=_[_0xc396('0x37')](db['User'][_0xc396('0x31')]);_0x49fa61[_0xc396('0x36')]=_[_0xc396('0x37')](_0x2ff472['query']);_0x49fa61[_0xc396('0x38')]=_[_0xc396('0x39')](_0x49fa61[_0xc396('0x34')],_0x49fa61['query']);_0x5153e6[_0xc396('0x3a')]=_['intersection'](_0x49fa61[_0xc396('0x34')],qs[_0xc396('0x3b')](_0x2ff472['query'][_0xc396('0x3b')]));_0x5153e6[_0xc396('0x3a')]=_0x5153e6[_0xc396('0x3a')]['length']?_0x5153e6[_0xc396('0x3a')]:_0x49fa61[_0xc396('0x34')];_0x5153e6[_0xc396('0x5c')]=qs[_0xc396('0x3e')](_0x2ff472[_0xc396('0x36')][_0xc396('0x3e')]);_0x5153e6[_0xc396('0x3f')]=qs[_0xc396('0x38')](_[_0xc396('0x5d')](_0x2ff472['query'],_0x49fa61[_0xc396('0x38')]));if(_0x2ff472['query'][_0xc396('0x40')]){_0x5153e6[_0xc396('0x3f')]=_['merge'](_0x5153e6['where'],{'$or':_[_0xc396('0x2f')](_0x5153e6[_0xc396('0x3a')],function(_0x38c1b1){var _0x5a0373={};_0x5a0373[_0x38c1b1]={'$like':'%'+_0x2ff472['query'][_0xc396('0x40')]+'%'};return _0x5a0373;})});}_0x5153e6=_[_0xc396('0x41')]({},_0x5153e6,_0x2ff472[_0xc396('0x49')]);return _0x1ef299[_0xc396('0x5a')](_0x5153e6);}})[_0xc396('0x26')](function(_0x403931){if(_0x403931){_0x1350ca=_0x403931[_0xc396('0x3c')];if(!_0x2ff472[_0xc396('0x36')][_0xc396('0x5e')](_0xc396('0x3d'))){_0x5153e6[_0xc396('0x1e')]=qs[_0xc396('0x1e')](_0x2ff472['query'][_0xc396('0x1e')]);_0x5153e6['offset']=qs['offset'](_0x2ff472[_0xc396('0x36')][_0xc396('0x20')]);}return _0x1ef299['getUsers'](_0x5153e6);}})[_0xc396('0x26')](function(_0xf837a5){if(_0xf837a5){return _0xf837a5?{'count':_0x1350ca,'rows':_0xf837a5}:null;}})['then'](respondWithResult(_0x14ce64,null))['catch'](handleError(_0x14ce64,null));}; \ No newline at end of file +var _0x2f08=['keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','includeAll','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','error','stack','name','index','SquareProject','rawAttributes','fieldName','type','key','map','query'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x2f08,0x199));var _0x82f0=function(_0x125425,_0x4b6bab){_0x125425=_0x125425-0x0;var _0xd04dc4=_0x2f08[_0x125425];return _0xd04dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f0('0x0'));var zipdir=require(_0x82f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82f0('0x2'));var moment=require(_0x82f0('0x3'));var BPromise=require(_0x82f0('0x4'));var Mustache=require(_0x82f0('0x5'));var util=require(_0x82f0('0x6'));var path=require('path');var sox=require(_0x82f0('0x7'));var csv=require(_0x82f0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82f0('0x9'));var _=require(_0x82f0('0xa'));var squel=require(_0x82f0('0xb'));var crypto=require(_0x82f0('0xc'));var jsforce=require(_0x82f0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x82f0('0x8'));var querystring=require('querystring');var Papa=require(_0x82f0('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x82f0('0xf'));var as=require(_0x82f0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x82f0('0x11'))(_0x82f0('0x12'));var utils=require(_0x82f0('0x13'));var config=require(_0x82f0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f0('0x15'))['db'];config['redis']=_[_0x82f0('0x16')](config['redis'],{'host':_0x82f0('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82f0('0x18')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0xe4843c,_0x37bb9d){_0x37bb9d=_0x37bb9d||0xcc;return function(_0x5d838f){if(_0x5d838f){return _0xe4843c[_0x82f0('0x19')](_0x37bb9d);}return _0xe4843c['status'](_0x37bb9d)[_0x82f0('0x1a')]();};}function respondWithResult(_0x1cf2e0,_0x140f23){_0x140f23=_0x140f23||0xc8;return function(_0x5a4186){if(_0x5a4186){return _0x1cf2e0[_0x82f0('0x1b')](_0x140f23)[_0x82f0('0x1c')](_0x5a4186);}};}function respondWithFilteredResult(_0xc1fa74,_0x175d26){return function(_0x46507a){if(_0x46507a){var _0x332816=typeof _0x175d26[_0x82f0('0x1d')]===_0x82f0('0x1e')&&typeof _0x175d26[_0x82f0('0x1f')]===_0x82f0('0x1e');var _0x5a38f2=_0x46507a[_0x82f0('0x20')];var _0x3c2196=_0x332816?0x0:_0x175d26[_0x82f0('0x1d')];var _0x3ed278=_0x332816?_0x46507a[_0x82f0('0x20')]:_0x175d26[_0x82f0('0x1d')]+_0x175d26[_0x82f0('0x1f')];var _0x435482;if(_0x3ed278>=_0x5a38f2){_0x3ed278=_0x5a38f2;_0x435482=0xc8;}else{_0x435482=0xce;}_0xc1fa74[_0x82f0('0x1b')](_0x435482);return _0xc1fa74[_0x82f0('0x21')](_0x82f0('0x22'),_0x3c2196+'-'+_0x3ed278+'/'+_0x5a38f2)[_0x82f0('0x1c')](_0x46507a);}return null;};}function patchUpdates(_0x47f805){return function(_0x158d6b){try{jsonpatch['apply'](_0x158d6b,_0x47f805,!![]);}catch(_0x2ce525){return BPromise[_0x82f0('0x23')](_0x2ce525);}return _0x158d6b['save']();};}function saveUpdates(_0x5656f8,_0x2bbe5b){return function(_0x5def9f){if(_0x5def9f){return _0x5def9f[_0x82f0('0x24')](_0x5656f8)[_0x82f0('0x25')](function(_0x542b4d){return _0x542b4d;});}return null;};}function removeEntity(_0x207cd0,_0x2021b7){return function(_0x141180){if(_0x141180){return _0x141180[_0x82f0('0x26')]()[_0x82f0('0x25')](function(){var _0x136218=_0x141180[_0x82f0('0x27')]({'plain':!![]});var _0x4b8a2b='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x4b8a2b,'resourceId':_0x136218['id']}})[_0x82f0('0x25')](function(){return _0x141180;});})['then'](function(){_0x207cd0[_0x82f0('0x1b')](0xcc)[_0x82f0('0x1a')]();});}};}function handleEntityNotFound(_0x2a40a5,_0x42c3f8){return function(_0x55c4ff){if(!_0x55c4ff){_0x2a40a5['sendStatus'](0x194);}return _0x55c4ff;};}function handleError(_0x536b03,_0x1fc17a){_0x1fc17a=_0x1fc17a||0x1f4;return function(_0x305e88){logger[_0x82f0('0x28')](_0x305e88[_0x82f0('0x29')]);if(_0x305e88[_0x82f0('0x2a')]){delete _0x305e88['name'];}_0x536b03['status'](_0x1fc17a)['send'](_0x305e88);};}exports[_0x82f0('0x2b')]=function(_0x4d72b8,_0x5f2456){var _0x4ff397={},_0x2a01bb={},_0x5989eb={'count':0x0,'rows':[]};var _0x338944=_['map'](db[_0x82f0('0x2c')][_0x82f0('0x2d')],function(_0x460457){return{'name':_0x460457[_0x82f0('0x2e')],'type':_0x460457[_0x82f0('0x2f')][_0x82f0('0x30')]};});_0x2a01bb['model']=_[_0x82f0('0x31')](_0x338944,_0x82f0('0x2a'));_0x2a01bb[_0x82f0('0x32')]=_[_0x82f0('0x33')](_0x4d72b8['query']);_0x2a01bb[_0x82f0('0x34')]=_['intersection'](_0x2a01bb['model'],_0x2a01bb[_0x82f0('0x32')]);_0x4ff397['attributes']=_[_0x82f0('0x35')](_0x2a01bb[_0x82f0('0x36')],qs[_0x82f0('0x37')](_0x4d72b8['query'][_0x82f0('0x37')]));_0x4ff397[_0x82f0('0x38')]=_0x4ff397['attributes'][_0x82f0('0x39')]?_0x4ff397[_0x82f0('0x38')]:_0x2a01bb[_0x82f0('0x36')];if(!_0x4d72b8[_0x82f0('0x32')][_0x82f0('0x3a')](_0x82f0('0x3b'))){_0x4ff397[_0x82f0('0x1f')]=qs[_0x82f0('0x1f')](_0x4d72b8[_0x82f0('0x32')][_0x82f0('0x1f')]);_0x4ff397[_0x82f0('0x1d')]=qs['offset'](_0x4d72b8[_0x82f0('0x32')][_0x82f0('0x1d')]);}_0x4ff397[_0x82f0('0x3c')]=qs[_0x82f0('0x3d')](_0x4d72b8[_0x82f0('0x32')][_0x82f0('0x3d')]);_0x4ff397[_0x82f0('0x3e')]=qs['filters'](_[_0x82f0('0x3f')](_0x4d72b8[_0x82f0('0x32')],_0x2a01bb[_0x82f0('0x34')]),_0x338944);if(_0x4d72b8[_0x82f0('0x32')][_0x82f0('0x40')]){_0x4ff397[_0x82f0('0x3e')]=_[_0x82f0('0x41')](_0x4ff397[_0x82f0('0x3e')],{'$or':_[_0x82f0('0x31')](_0x338944,function(_0x34fbac){if(_0x34fbac[_0x82f0('0x2f')]!==_0x82f0('0x42')){var _0x2aa6f4={};_0x2aa6f4[_0x34fbac[_0x82f0('0x2a')]]={'$like':'%'+_0x4d72b8['query'][_0x82f0('0x40')]+'%'};return _0x2aa6f4;}})});}_0x4ff397=_['merge']({},_0x4ff397,_0x4d72b8['options']);var _0x402712={'where':_0x4ff397[_0x82f0('0x3e')]};return db[_0x82f0('0x2c')][_0x82f0('0x20')](_0x402712)[_0x82f0('0x25')](function(_0x3b4099){_0x5989eb[_0x82f0('0x20')]=_0x3b4099;if(_0x4d72b8[_0x82f0('0x32')]['includeAll']){_0x4ff397[_0x82f0('0x43')]=[{'all':!![]}];}return db[_0x82f0('0x2c')]['findAll'](_0x4ff397);})['then'](function(_0x1b7fa1){_0x5989eb[_0x82f0('0x44')]=_0x1b7fa1;return _0x5989eb;})[_0x82f0('0x25')](respondWithFilteredResult(_0x5f2456,_0x4ff397))[_0x82f0('0x45')](handleError(_0x5f2456,null));};exports['show']=function(_0x3c2a63,_0x37f7ac){var _0x3dc162={'raw':![],'where':{'id':_0x3c2a63[_0x82f0('0x46')]['id']}},_0x47e0a9={};_0x47e0a9['model']=_[_0x82f0('0x33')](db[_0x82f0('0x2c')][_0x82f0('0x2d')]);_0x47e0a9['query']=_['keys'](_0x3c2a63['query']);_0x47e0a9[_0x82f0('0x34')]=_['intersection'](_0x47e0a9[_0x82f0('0x36')],_0x47e0a9['query']);_0x3dc162[_0x82f0('0x38')]=_[_0x82f0('0x35')](_0x47e0a9['model'],qs[_0x82f0('0x37')](_0x3c2a63['query'][_0x82f0('0x37')]));_0x3dc162[_0x82f0('0x38')]=_0x3dc162[_0x82f0('0x38')][_0x82f0('0x39')]?_0x3dc162['attributes']:_0x47e0a9[_0x82f0('0x36')];if(_0x3c2a63[_0x82f0('0x32')][_0x82f0('0x47')]){_0x3dc162[_0x82f0('0x43')]=[{'all':!![]}];}_0x3dc162=_[_0x82f0('0x41')]({},_0x3dc162,_0x3c2a63[_0x82f0('0x48')]);return db['SquareProject'][_0x82f0('0x49')](_0x3dc162)[_0x82f0('0x25')](handleEntityNotFound(_0x37f7ac,null))[_0x82f0('0x25')](respondWithResult(_0x37f7ac,null))[_0x82f0('0x45')](handleError(_0x37f7ac,null));};exports['create']=function(_0x92ffd9,_0x48a0c4){return db[_0x82f0('0x2c')]['create'](_0x92ffd9[_0x82f0('0x4a')],{})['then'](function(_0x2b37e2){var _0x3fbc2a=_0x92ffd9[_0x82f0('0x4b')][_0x82f0('0x27')]({'plain':!![]});if(!_0x3fbc2a)throw new Error(_0x82f0('0x4c'));if(_0x3fbc2a[_0x82f0('0x4d')]===_0x82f0('0x4b')){var _0x4e6ba9=_0x2b37e2[_0x82f0('0x27')]({'plain':!![]});var _0x4be5a1='SquareProjects';return db[_0x82f0('0x4e')][_0x82f0('0x49')]({'where':{'name':_0x4be5a1,'userProfileId':_0x3fbc2a[_0x82f0('0x4f')]},'raw':!![]})[_0x82f0('0x25')](function(_0x39a42a){if(_0x39a42a&&_0x39a42a['autoAssociation']===0x0){return db[_0x82f0('0x50')][_0x82f0('0x51')]({'name':_0x4e6ba9[_0x82f0('0x2a')],'resourceId':_0x4e6ba9['id'],'type':_0x39a42a[_0x82f0('0x2a')],'sectionId':_0x39a42a['id']},{})[_0x82f0('0x25')](function(){return _0x2b37e2;});}else{return _0x2b37e2;}})['catch'](function(_0xd62a92){logger[_0x82f0('0x28')](_0x82f0('0x52'),_0xd62a92);throw _0xd62a92;});}return _0x2b37e2;})['then'](respondWithResult(_0x48a0c4,0xc9))[_0x82f0('0x45')](handleError(_0x48a0c4,null));};exports['update']=function(_0x193ff8,_0x234618){if(_0x193ff8[_0x82f0('0x4a')]['id']){delete _0x193ff8[_0x82f0('0x4a')]['id'];}return db[_0x82f0('0x2c')][_0x82f0('0x49')]({'where':{'id':_0x193ff8[_0x82f0('0x46')]['id']}})['then'](handleEntityNotFound(_0x234618,null))[_0x82f0('0x25')](saveUpdates(_0x193ff8['body'],null))['then'](respondWithResult(_0x234618,null))[_0x82f0('0x45')](handleError(_0x234618,null));};exports[_0x82f0('0x26')]=function(_0x2e3c41,_0x21e105){return db[_0x82f0('0x2c')][_0x82f0('0x49')]({'where':{'id':_0x2e3c41['params']['id']}})['then'](handleEntityNotFound(_0x21e105,null))[_0x82f0('0x25')](removeEntity(_0x21e105,null))[_0x82f0('0x45')](handleError(_0x21e105,null));};exports[_0x82f0('0x53')]=function(_0x476d02,_0x4b7062,_0x5edb39){return db[_0x82f0('0x2c')]['find']({'where':{'id':_0x476d02[_0x82f0('0x46')]['id']}})[_0x82f0('0x25')](handleEntityNotFound(_0x4b7062,null))['then'](function(_0x79e0a4){if(_0x79e0a4){return _0x79e0a4[_0x82f0('0x53')](_0x476d02['body'][_0x82f0('0x54')],_[_0x82f0('0x55')](_0x476d02[_0x82f0('0x4a')],[_0x82f0('0x54'),'id'])||{});}})[_0x82f0('0x25')](respondWithResult(_0x4b7062,null))[_0x82f0('0x45')](handleError(_0x4b7062,null));};exports[_0x82f0('0x56')]=function(_0x589dfe,_0x1e79d4,_0x18c65f){return db[_0x82f0('0x2c')][_0x82f0('0x49')]({'where':{'id':_0x589dfe['params']['id']}})['then'](handleEntityNotFound(_0x1e79d4,null))[_0x82f0('0x25')](function(_0x5208f8){if(_0x5208f8){return _0x5208f8[_0x82f0('0x56')](_0x589dfe[_0x82f0('0x32')]['ids'])['then'](function(){if(_[_0x82f0('0x57')](_0x589dfe['query'][_0x82f0('0x54')])){for(var _0x2208e7=0x0;_0x2208e7<_0x589dfe[_0x82f0('0x32')][_0x82f0('0x54')][_0x82f0('0x39')];_0x2208e7+=0x1){socket[_0x82f0('0x58')](_0x82f0('0x59'),{'UserId':Number(_0x589dfe[_0x82f0('0x32')]['ids'][_0x2208e7]),'SquareProjectId':Number(_0x589dfe[_0x82f0('0x46')]['id'])});}}else{socket[_0x82f0('0x58')](_0x82f0('0x59'),{'UserId':Number(_0x589dfe[_0x82f0('0x32')][_0x82f0('0x54')]),'SquareProjectId':Number(_0x589dfe[_0x82f0('0x46')]['id'])});}});}})[_0x82f0('0x25')](respondWithStatusCode(_0x1e79d4,null))[_0x82f0('0x45')](handleError(_0x1e79d4,null));};exports[_0x82f0('0x5a')]=function(_0x46081c,_0x43a118,_0x537526){var _0x56c261={};var _0x44cf7d={};var _0x3e1109;var _0x53b107;return db[_0x82f0('0x2c')][_0x82f0('0x5b')]({'where':{'id':_0x46081c[_0x82f0('0x46')]['id']}})[_0x82f0('0x25')](handleEntityNotFound(_0x43a118,null))[_0x82f0('0x25')](function(_0x4bea6e){if(_0x4bea6e){_0x3e1109=_0x4bea6e;_0x44cf7d[_0x82f0('0x36')]=_[_0x82f0('0x33')](db['User']['rawAttributes']);_0x44cf7d['query']=_[_0x82f0('0x33')](_0x46081c[_0x82f0('0x32')]);_0x44cf7d[_0x82f0('0x34')]=_[_0x82f0('0x35')](_0x44cf7d[_0x82f0('0x36')],_0x44cf7d['query']);_0x56c261['attributes']=_[_0x82f0('0x35')](_0x44cf7d['model'],qs['fields'](_0x46081c[_0x82f0('0x32')][_0x82f0('0x37')]));_0x56c261[_0x82f0('0x38')]=_0x56c261[_0x82f0('0x38')][_0x82f0('0x39')]?_0x56c261['attributes']:_0x44cf7d[_0x82f0('0x36')];_0x56c261[_0x82f0('0x3c')]=qs[_0x82f0('0x3d')](_0x46081c[_0x82f0('0x32')][_0x82f0('0x3d')]);_0x56c261['where']=qs[_0x82f0('0x34')](_[_0x82f0('0x3f')](_0x46081c[_0x82f0('0x32')],_0x44cf7d['filters']));if(_0x46081c[_0x82f0('0x32')]['filter']){_0x56c261[_0x82f0('0x3e')]=_[_0x82f0('0x41')](_0x56c261[_0x82f0('0x3e')],{'$or':_[_0x82f0('0x31')](_0x56c261['attributes'],function(_0xdebd9e){var _0x714207={};_0x714207[_0xdebd9e]={'$like':'%'+_0x46081c[_0x82f0('0x32')][_0x82f0('0x40')]+'%'};return _0x714207;})});}_0x56c261=_['merge']({},_0x56c261,_0x46081c[_0x82f0('0x48')]);return _0x3e1109[_0x82f0('0x5a')](_0x56c261);}})['then'](function(_0x5ccf8b){if(_0x5ccf8b){_0x53b107=_0x5ccf8b['length'];if(!_0x46081c[_0x82f0('0x32')][_0x82f0('0x3a')](_0x82f0('0x3b'))){_0x56c261[_0x82f0('0x1f')]=qs['limit'](_0x46081c['query']['limit']);_0x56c261[_0x82f0('0x1d')]=qs[_0x82f0('0x1d')](_0x46081c[_0x82f0('0x32')][_0x82f0('0x1d')]);}return _0x3e1109[_0x82f0('0x5a')](_0x56c261);}})['then'](function(_0x5c0faf){if(_0x5c0faf){return _0x5c0faf?{'count':_0x53b107,'rows':_0x5c0faf}:null;}})[_0x82f0('0x25')](respondWithResult(_0x43a118,null))[_0x82f0('0x45')](handleError(_0x43a118,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9beb6c0..5629f34 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 _0xc2c8=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2c8,0xa0));var _0x8c2c=function(_0x3af910,_0x202e12){_0x3af910=_0x3af910-0x0;var _0xb0c4d1=_0xc2c8[_0x3af910];return _0xb0c4d1;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x8c2c('0x0'))['db'][_0x8c2c('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8c2c('0x2')](0x0);var events={'afterCreate':_0x8c2c('0x3'),'afterUpdate':_0x8c2c('0x4'),'afterDestroy':_0x8c2c('0x5')};function emitEvent(_0x424b4f){return function(_0x2fb66b,_0xb811e3,_0x17305a){SquareProjectEvents[_0x8c2c('0x6')](_0x424b4f+':'+_0x2fb66b['id'],_0x2fb66b);SquareProjectEvents[_0x8c2c('0x6')](_0x424b4f,_0x2fb66b);_0x17305a(null);};}for(var e in events){if(events[_0x8c2c('0x7')](e)){var event=events[e];SquareProject[_0x8c2c('0x8')](e,emitEvent(event));}}module[_0x8c2c('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x02de=['hook','exports','events','../../mysqldb','SquareProject','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02de,0x1cd));var _0xe02d=function(_0x4be82f,_0x9c2d70){_0x4be82f=_0x4be82f-0x0;var _0x4b7403=_0x02de[_0x4be82f];return _0x4b7403;};'use strict';var EventEmitter=require(_0xe02d('0x0'));var SquareProject=require(_0xe02d('0x1'))['db'][_0xe02d('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe02d('0x3'),'afterUpdate':'update','afterDestroy':_0xe02d('0x4')};function emitEvent(_0x243585){return function(_0x5eec21,_0x3830a6,_0xbaed4b){SquareProjectEvents[_0xe02d('0x5')](_0x243585+':'+_0x5eec21['id'],_0x5eec21);SquareProjectEvents['emit'](_0x243585,_0x5eec21);_0xbaed4b(null);};}for(var e in events){if(events[_0xe02d('0x6')](e)){var event=events[e];SquareProject[_0xe02d('0x7')](e,emitEvent(event));}}module[_0xe02d('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 83ddaa0..6c5dd09 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 _0xca35=['production','publishedAt','lodash','util','api','moment','rimraf','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2485b0,_0xa3c623){var _0x470490=function(_0x4bfbeb){while(--_0x4bfbeb){_0x2485b0['push'](_0x2485b0['shift']());}};_0x470490(++_0xa3c623);}(_0xca35,0xa2));var _0x5ca3=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xca35[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x5ca3('0x0'));var util=require(_0x5ca3('0x1'));var logger=require('../../config/logger')(_0x5ca3('0x2'));var moment=require(_0x5ca3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5ca3('0x4'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x5ca3('0x5')]=function(_0x3540ba,_0x2ba6d5){return _0x3540ba[_0x5ca3('0x6')](_0x5ca3('0x7'),attributes,{'tableName':_0x5ca3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f85a5,_0x447af1,_0x305903){if(_0x3f85a5[_0x5ca3('0x9')](_0x5ca3('0xa'))){_0x3f85a5[_0x5ca3('0xb')]=moment()[_0x5ca3('0xc')](_0x5ca3('0xd'));}if(_0x3f85a5[_0x5ca3('0x9')](_0x5ca3('0xe'))){_0x3f85a5[_0x5ca3('0xf')]=moment()[_0x5ca3('0xc')](_0x5ca3('0xd'));}_0x305903(null,_0x3f85a5);}}});}; \ No newline at end of file +var _0x26fa=['publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','SquareProject','square_projects','changed','savedAt'];(function(_0x54d261,_0x2bf9dd){var _0x1d646d=function(_0xc69e8a){while(--_0xc69e8a){_0x54d261['push'](_0x54d261['shift']());}};_0x1d646d(++_0x2bf9dd);}(_0x26fa,0xad));var _0xa26f=function(_0x3c6e3c,_0x2a6a7){_0x3c6e3c=_0x3c6e3c-0x0;var _0x5ae549=_0x26fa[_0x3c6e3c];return _0x5ae549;};'use strict';var _=require(_0xa26f('0x0'));var util=require(_0xa26f('0x1'));var logger=require(_0xa26f('0x2'))('api');var moment=require(_0xa26f('0x3'));var BPromise=require(_0xa26f('0x4'));var rp=require(_0xa26f('0x5'));var fs=require('fs');var path=require(_0xa26f('0x6'));var rimraf=require(_0xa26f('0x7'));var config=require('../../config/environment');var attributes=require(_0xa26f('0x8'));module[_0xa26f('0x9')]=function(_0x58e354,_0x4aa33e){return _0x58e354['define'](_0xa26f('0xa'),attributes,{'tableName':_0xa26f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a8b1d,_0x14b47e,_0x293f1e){if(_0x5a8b1d[_0xa26f('0xc')]('preproduction')){_0x5a8b1d[_0xa26f('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5a8b1d[_0xa26f('0xc')]('production')){_0x5a8b1d[_0xa26f('0xe')]=moment()[_0xa26f('0xf')](_0xa26f('0x10'));}_0x293f1e(null,_0x5a8b1d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 5b2d40b..8009e4f 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 _0x906e=['register','request','info','SquareProject,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','SquareProject','find','options','raw','where','attributes','include','model','map','then','ShowSquareProject','stringify','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x595648,_0x3dcc72){var _0x20b7cb=function(_0x597215){while(--_0x597215){_0x595648['push'](_0x595648['shift']());}};_0x20b7cb(++_0x3dcc72);}(_0x906e,0x119));var _0xe906=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x906e[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0xe906('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe906('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe906('0x2'));var db=require(_0xe906('0x3'))['db'];var utils=require(_0xe906('0x4'));var logger=require(_0xe906('0x5'))(_0xe906('0x6'));var config=require('../../config/environment');var jayson=require(_0xe906('0x7'));var client=jayson[_0xe906('0x8')][_0xe906('0x9')]({'port':0x232a});config[_0xe906('0xa')]=_[_0xe906('0xb')](config[_0xe906('0xa')],{'host':_0xe906('0xc'),'port':0x18eb});var socket=require(_0xe906('0xd'))(new Redis(config[_0xe906('0xa')]));require(_0xe906('0xe'))[_0xe906('0xf')](socket);function respondWithRpcPromise(_0x535d07,_0x2b4e67,_0x34b66e){return new BPromise(function(_0x18bf6b,_0x2e2c78){return client[_0xe906('0x10')](_0x535d07,_0x34b66e)['then'](function(_0x59fe4e){logger[_0xe906('0x11')](_0xe906('0x12'),_0x2b4e67,'request\x20sent');logger[_0xe906('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x2b4e67,'request\x20sent',JSON['stringify'](_0x59fe4e));if(_0x59fe4e['error']){if(_0x59fe4e[_0xe906('0x14')][_0xe906('0x15')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x2b4e67,_0x59fe4e[_0xe906('0x14')][_0xe906('0x16')]);return _0x2e2c78(_0x59fe4e[_0xe906('0x14')]['message']);}logger[_0xe906('0x14')]('SquareProject,\x20%s,\x20%s',_0x2b4e67,_0x59fe4e[_0xe906('0x14')][_0xe906('0x16')]);return _0x18bf6b(_0x59fe4e['error'][_0xe906('0x16')]);}else{logger[_0xe906('0x11')](_0xe906('0x12'),_0x2b4e67,_0xe906('0x17'));_0x18bf6b(_0x59fe4e['result'][_0xe906('0x16')]);}})[_0xe906('0x18')](function(_0x1ccda0){logger[_0xe906('0x14')]('SquareProject,\x20%s,\x20%s',_0x2b4e67,_0x1ccda0);_0x2e2c78(_0x1ccda0);});});}exports['ShowSquareProject']=function(_0x3c49f1){var _0x4e5d34=this;return new Promise(function(_0x3eae3b,_0x5505d6){return db[_0xe906('0x19')][_0xe906('0x1a')]({'raw':_0x3c49f1['options']?_0x3c49f1[_0xe906('0x1b')][_0xe906('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c49f1['options']?_0x3c49f1[_0xe906('0x1b')][_0xe906('0x1d')]||null:null,'attributes':_0x3c49f1[_0xe906('0x1b')]?_0x3c49f1[_0xe906('0x1b')][_0xe906('0x1e')]||null:null,'include':_0x3c49f1['options']?_0x3c49f1[_0xe906('0x1b')][_0xe906('0x1f')]?_['map'](_0x3c49f1[_0xe906('0x1b')][_0xe906('0x1f')],function(_0x563108){return{'model':db[_0x563108[_0xe906('0x20')]],'as':_0x563108['as'],'attributes':_0x563108[_0xe906('0x1e')],'include':_0x563108[_0xe906('0x1f')]?_[_0xe906('0x21')](_0x563108[_0xe906('0x1f')],function(_0x5ce308){return{'model':db[_0x5ce308[_0xe906('0x20')]],'as':_0x5ce308['as'],'attributes':_0x5ce308[_0xe906('0x1e')],'include':_0x5ce308['include']?_[_0xe906('0x21')](_0x5ce308[_0xe906('0x1f')],function(_0x47dc2e){return{'model':db[_0x47dc2e[_0xe906('0x20')]],'as':_0x47dc2e['as'],'attributes':_0x47dc2e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe906('0x22')](function(_0x1b7118){logger['info'](_0xe906('0x23'),_0x3c49f1);logger[_0xe906('0x13')](_0xe906('0x23'),_0x3c49f1,JSON[_0xe906('0x24')](_0x1b7118));_0x3eae3b(_0x1b7118);})['catch'](function(_0x230ebd){logger['error'](_0xe906('0x23'),_0x230ebd[_0xe906('0x16')],_0x3c49f1);_0x5505d6(_0x4e5d34['error'](0x1f4,_0x230ebd[_0xe906('0x16')]));});});}; \ No newline at end of file +var _0x7117=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','include','model','attributes','lodash','util'];(function(_0x40ff4e,_0x50a4a3){var _0x2ea887=function(_0x3a177b){while(--_0x3a177b){_0x40ff4e['push'](_0x40ff4e['shift']());}};_0x2ea887(++_0x50a4a3);}(_0x7117,0x1b8));var _0x7711=function(_0x4730d7,_0x1f68ea){_0x4730d7=_0x4730d7-0x0;var _0x4ef008=_0x7117[_0x4730d7];return _0x4ef008;};'use strict';var _=require(_0x7711('0x0'));var util=require(_0x7711('0x1'));var moment=require(_0x7711('0x2'));var BPromise=require(_0x7711('0x3'));var rs=require(_0x7711('0x4'));var fs=require('fs');var Redis=require(_0x7711('0x5'));var db=require(_0x7711('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7711('0x7'));var jayson=require(_0x7711('0x8'));var client=jayson['client'][_0x7711('0x9')]({'port':0x232a});config[_0x7711('0xa')]=_['defaults'](config[_0x7711('0xa')],{'host':_0x7711('0xb'),'port':0x18eb});var socket=require(_0x7711('0xc'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x4dcd82,_0x20a2fb,_0x4c9709){return new BPromise(function(_0x2056e5,_0x2fbad9){return client[_0x7711('0xd')](_0x4dcd82,_0x4c9709)[_0x7711('0xe')](function(_0x3feb2d){logger[_0x7711('0xf')](_0x7711('0x10'),_0x20a2fb,_0x7711('0x11'));logger[_0x7711('0x12')](_0x7711('0x13'),_0x20a2fb,_0x7711('0x11'),JSON[_0x7711('0x14')](_0x3feb2d));if(_0x3feb2d[_0x7711('0x15')]){if(_0x3feb2d[_0x7711('0x15')]['code']===0x1f4){logger['error'](_0x7711('0x10'),_0x20a2fb,_0x3feb2d['error']['message']);return _0x2fbad9(_0x3feb2d[_0x7711('0x15')][_0x7711('0x16')]);}logger[_0x7711('0x15')](_0x7711('0x10'),_0x20a2fb,_0x3feb2d[_0x7711('0x15')][_0x7711('0x16')]);return _0x2056e5(_0x3feb2d[_0x7711('0x15')]['message']);}else{logger[_0x7711('0xf')](_0x7711('0x10'),_0x20a2fb,_0x7711('0x11'));_0x2056e5(_0x3feb2d[_0x7711('0x17')][_0x7711('0x16')]);}})[_0x7711('0x18')](function(_0x262d61){logger[_0x7711('0x15')]('SquareProject,\x20%s,\x20%s',_0x20a2fb,_0x262d61);_0x2fbad9(_0x262d61);});});}exports[_0x7711('0x19')]=function(_0x4c0aae){var _0x31ca00=this;return new Promise(function(_0x225b32,_0x3928de){return db[_0x7711('0x1a')][_0x7711('0x1b')]({'raw':_0x4c0aae['options']?_0x4c0aae[_0x7711('0x1c')][_0x7711('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c0aae[_0x7711('0x1c')]?_0x4c0aae[_0x7711('0x1c')][_0x7711('0x1e')]||null:null,'attributes':_0x4c0aae[_0x7711('0x1c')]?_0x4c0aae[_0x7711('0x1c')]['attributes']||null:null,'include':_0x4c0aae[_0x7711('0x1c')]?_0x4c0aae['options'][_0x7711('0x1f')]?_['map'](_0x4c0aae['options'][_0x7711('0x1f')],function(_0x552180){return{'model':db[_0x552180[_0x7711('0x20')]],'as':_0x552180['as'],'attributes':_0x552180['attributes'],'include':_0x552180[_0x7711('0x1f')]?_['map'](_0x552180[_0x7711('0x1f')],function(_0x291011){return{'model':db[_0x291011[_0x7711('0x20')]],'as':_0x291011['as'],'attributes':_0x291011[_0x7711('0x21')],'include':_0x291011[_0x7711('0x1f')]?_['map'](_0x291011[_0x7711('0x1f')],function(_0x4ee33d){return{'model':db[_0x4ee33d[_0x7711('0x20')]],'as':_0x4ee33d['as'],'attributes':_0x4ee33d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bdbd3){logger[_0x7711('0xf')](_0x7711('0x19'),_0x4c0aae);logger['debug'](_0x7711('0x19'),_0x4c0aae,JSON[_0x7711('0x14')](_0x1bdbd3));_0x225b32(_0x1bdbd3);})[_0x7711('0x18')](function(_0x39867f){logger[_0x7711('0x15')]('ShowSquareProject',_0x39867f['message'],_0x4c0aae);_0x3928de(_0x31ca00[_0x7711('0x15')](0x1f4,_0x39867f[_0x7711('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 78de3d3..44a2b9e 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 _0x98c7=['squareProject:','./squareProject.events','remove','removeListener'];(function(_0x456576,_0x5e8fab){var _0x87bab9=function(_0x5c78cd){while(--_0x5c78cd){_0x456576['push'](_0x456576['shift']());}};_0x87bab9(++_0x5e8fab);}(_0x98c7,0xa9));var _0x798c=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x98c7[_0x525af9];return _0x129fbf;};'use strict';var SquareProjectEvents=require(_0x798c('0x0'));var events=['save',_0x798c('0x1'),'update'];function createListener(_0x5c36d4,_0x470710){return function(_0x574dff){_0x470710['emit'](_0x5c36d4,_0x574dff);};}function removeListener(_0x1092d0,_0xb766cd){return function(){SquareProjectEvents[_0x798c('0x2')](_0x1092d0,_0xb766cd);};}exports['register']=function(_0xc3511){for(var _0x3a09e8=0x0,_0x5e7f7a=events['length'];_0x3a09e8<_0x5e7f7a;_0x3a09e8++){var _0x13ac13=events[_0x3a09e8];var _0x2ac5fe=createListener(_0x798c('0x3')+_0x13ac13,_0xc3511);SquareProjectEvents['on'](_0x13ac13,_0x2ac5fe);}}; \ No newline at end of file +var _0x8d21=['update','emit','squareProject:','./squareProject.events','save','remove'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x8d21,0x1b9));var _0x18d2=function(_0x468c59,_0x38f408){_0x468c59=_0x468c59-0x0;var _0x4bbe9d=_0x8d21[_0x468c59];return _0x4bbe9d;};'use strict';var SquareProjectEvents=require(_0x18d2('0x0'));var events=[_0x18d2('0x1'),_0x18d2('0x2'),_0x18d2('0x3')];function createListener(_0x144122,_0x65e954){return function(_0x2d2c97){_0x65e954[_0x18d2('0x4')](_0x144122,_0x2d2c97);};}function removeListener(_0x3fb0e7,_0x1c9988){return function(){SquareProjectEvents['removeListener'](_0x3fb0e7,_0x1c9988);};}exports['register']=function(_0x5cd269){for(var _0xf3724b=0x0,_0x587614=events['length'];_0xf3724b<_0x587614;_0xf3724b++){var _0x21701e=events[_0xf3724b];var _0x3cdbc7=createListener(_0x18d2('0x5')+_0x21701e,_0x5cd269);SquareProjectEvents['on'](_0x21701e,_0x3cdbc7);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 139eccc..d5633cc 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x417ede,_0x1bbd67){var _0x544690=function(_0x4ffcec){while(--_0x4ffcec){_0x417ede['push'](_0x417ede['shift']());}};_0x544690(++_0x1bbd67);}(_0x4975,0x86));var _0x5497=function(_0x1c54af,_0x29be1a){_0x1c54af=_0x1c54af-0x0;var _0x23ddca=_0x4975[_0x1c54af];return _0x23ddca;};'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('0xc'),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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x271987,_0x535d49){var _0x1123a9=function(_0xb5d351){while(--_0xb5d351){_0x271987['push'](_0x271987['shift']());}};_0x1123a9(++_0x535d49);}(_0x326f,0xd1));var _0xf326=function(_0x6cd8e4,_0x177eaf){_0x6cd8e4=_0x6cd8e4-0x0;var _0x4a293b=_0x326f[_0x6cd8e4];return _0x4a293b;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b55f381..df77af2 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 _0x7c09=['exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x43fa27,_0x2127c4){var _0x4dec61=function(_0x4cf1eb){while(--_0x4cf1eb){_0x43fa27['push'](_0x43fa27['shift']());}};_0x4dec61(++_0x2127c4);}(_0x7c09,0x102));var _0x97c0=function(_0x12a7fa,_0x2d6ae7){_0x12a7fa=_0x12a7fa-0x0;var _0x4108c0=_0x7c09[_0x12a7fa];return _0x4108c0;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'uniqueid':{'type':Sequelize[_0x97c0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'extension':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'dnid':{'type':Sequelize[_0x97c0('0x1')]},'projectName':{'type':Sequelize[_0x97c0('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x97c0('0x2')],'get':function(){var _0x42c6c7='';var _0x2c19fa=this[_0x97c0('0x3')](_0x97c0('0x4'));if(_0x2c19fa){_0x42c6c7=_0x2c19fa['substring'](_0x2c19fa[_0x97c0('0x5')]('.'));}return _0x42c6c7;}}}; \ No newline at end of file +var _0x31f0=['getDataValue','savePath','substring','sequelize','STRING','VIRTUAL'];(function(_0x137ee8,_0x37c760){var _0x11599a=function(_0x488e86){while(--_0x488e86){_0x137ee8['push'](_0x137ee8['shift']());}};_0x11599a(++_0x37c760);}(_0x31f0,0xb7));var _0x031f=function(_0x5230b7,_0x3a0911){_0x5230b7=_0x5230b7-0x0;var _0x59c1f4=_0x31f0[_0x5230b7];return _0x59c1f4;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x031f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'context':{'type':Sequelize[_0x031f('0x1')]},'extension':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x031f('0x1')]},'projectName':{'type':Sequelize[_0x031f('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x031f('0x2')],'get':function(){var _0x487e65='';var _0x365f59=this[_0x031f('0x3')](_0x031f('0x4'));if(_0x365f59){_0x487e65=_0x365f59[_0x031f('0x5')](_0x365f59['lastIndexOf']('.'));}return _0x487e65;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c71408f..51b215a 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 _0x7e39=['options','SquareRecording','include','rows','catch','show','params','includeAll','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','reject','then','destroy','stack','name','send','index','rawAttributes','type','map','keys','filters','model','query','intersection','fields','length','attributes','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x7e39,0xcb));var _0x97e3=function(_0x57858f,_0x582edf){_0x57858f=_0x57858f-0x0;var _0x3bdac2=_0x7e39[_0x57858f];return _0x3bdac2;};'use strict';var emlformat=require(_0x97e3('0x0'));var rimraf=require(_0x97e3('0x1'));var zipdir=require(_0x97e3('0x2'));var jsonpatch=require(_0x97e3('0x3'));var rp=require(_0x97e3('0x4'));var moment=require('moment');var BPromise=require(_0x97e3('0x5'));var Mustache=require(_0x97e3('0x6'));var util=require(_0x97e3('0x7'));var path=require('path');var sox=require(_0x97e3('0x8'));var csv=require(_0x97e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97e3('0xa'));var _=require(_0x97e3('0xb'));var squel=require('squel');var crypto=require(_0x97e3('0xc'));var jsforce=require(_0x97e3('0xd'));var deskjs=require(_0x97e3('0xe'));var toCsv=require(_0x97e3('0x9'));var querystring=require(_0x97e3('0xf'));var Papa=require(_0x97e3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x97e3('0x11'));var hardwareService=require(_0x97e3('0x12'));var logger=require(_0x97e3('0x13'))('api');var utils=require(_0x97e3('0x14'));var config=require(_0x97e3('0x15'));var licenseUtil=require(_0x97e3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44b634,_0x9a8c4a){_0x9a8c4a=_0x9a8c4a||0xcc;return function(_0x46e5b7){if(_0x46e5b7){return _0x44b634[_0x97e3('0x17')](_0x9a8c4a);}return _0x44b634[_0x97e3('0x18')](_0x9a8c4a)[_0x97e3('0x19')]();};}function respondWithResult(_0x51ca6c,_0x1e56b5){_0x1e56b5=_0x1e56b5||0xc8;return function(_0x2513a2){if(_0x2513a2){return _0x51ca6c[_0x97e3('0x18')](_0x1e56b5)['json'](_0x2513a2);}};}function respondWithFilteredResult(_0x16222b,_0x29bbf6){return function(_0x171a4f){if(_0x171a4f){var _0x5913e9=typeof _0x29bbf6[_0x97e3('0x1a')]==='undefined'&&typeof _0x29bbf6['limit']===_0x97e3('0x1b');var _0xe5bf98=_0x171a4f['count'];var _0x2df374=_0x5913e9?0x0:_0x29bbf6[_0x97e3('0x1a')];var _0x3fd3f1=_0x5913e9?_0x171a4f[_0x97e3('0x1c')]:_0x29bbf6[_0x97e3('0x1a')]+_0x29bbf6[_0x97e3('0x1d')];var _0x2984da;if(_0x3fd3f1>=_0xe5bf98){_0x3fd3f1=_0xe5bf98;_0x2984da=0xc8;}else{_0x2984da=0xce;}_0x16222b[_0x97e3('0x18')](_0x2984da);return _0x16222b['set']('Content-Range',_0x2df374+'-'+_0x3fd3f1+'/'+_0xe5bf98)['json'](_0x171a4f);}return null;};}function patchUpdates(_0x503f54){return function(_0x57283f){try{jsonpatch['apply'](_0x57283f,_0x503f54,!![]);}catch(_0x1a0f28){return BPromise[_0x97e3('0x1e')](_0x1a0f28);}return _0x57283f['save']();};}function saveUpdates(_0xb24281,_0xa62fa9){return function(_0x333335){if(_0x333335){return _0x333335['update'](_0xb24281)[_0x97e3('0x1f')](function(_0x523be2){return _0x523be2;});}return null;};}function removeEntity(_0x5a54f8,_0x45aa4f){return function(_0xee8205){if(_0xee8205){return _0xee8205[_0x97e3('0x20')]()[_0x97e3('0x1f')](function(){_0x5a54f8[_0x97e3('0x18')](0xcc)[_0x97e3('0x19')]();});}};}function handleEntityNotFound(_0x47d83c,_0x100105){return function(_0x1d2f57){if(!_0x1d2f57){_0x47d83c['sendStatus'](0x194);}return _0x1d2f57;};}function handleError(_0x1e5698,_0x5d6567){_0x5d6567=_0x5d6567||0x1f4;return function(_0x5b30a7){logger['error'](_0x5b30a7[_0x97e3('0x21')]);if(_0x5b30a7[_0x97e3('0x22')]){delete _0x5b30a7[_0x97e3('0x22')];}_0x1e5698['status'](_0x5d6567)[_0x97e3('0x23')](_0x5b30a7);};}exports[_0x97e3('0x24')]=function(_0x4c2902,_0x26e9a5){var _0x24824f={},_0x35e364={},_0x424000={'count':0x0,'rows':[]};var _0x337bd=_['map'](db['SquareRecording'][_0x97e3('0x25')],function(_0x1118b6){return{'name':_0x1118b6['fieldName'],'type':_0x1118b6[_0x97e3('0x26')]['key']};});_0x35e364['model']=_[_0x97e3('0x27')](_0x337bd,_0x97e3('0x22'));_0x35e364['query']=_[_0x97e3('0x28')](_0x4c2902['query']);_0x35e364[_0x97e3('0x29')]=_['intersection'](_0x35e364[_0x97e3('0x2a')],_0x35e364[_0x97e3('0x2b')]);_0x24824f['attributes']=_[_0x97e3('0x2c')](_0x35e364['model'],qs[_0x97e3('0x2d')](_0x4c2902['query'][_0x97e3('0x2d')]));_0x24824f['attributes']=_0x24824f['attributes'][_0x97e3('0x2e')]?_0x24824f[_0x97e3('0x2f')]:_0x35e364[_0x97e3('0x2a')];if(!_0x4c2902[_0x97e3('0x2b')][_0x97e3('0x30')]('nolimit')){_0x24824f[_0x97e3('0x1d')]=qs['limit'](_0x4c2902['query'][_0x97e3('0x1d')]);_0x24824f[_0x97e3('0x1a')]=qs[_0x97e3('0x1a')](_0x4c2902['query']['offset']);}_0x24824f['order']=qs[_0x97e3('0x31')](_0x4c2902[_0x97e3('0x2b')][_0x97e3('0x31')]);_0x24824f[_0x97e3('0x32')]=qs['filters'](_[_0x97e3('0x33')](_0x4c2902['query'],_0x35e364[_0x97e3('0x29')]),_0x337bd);if(_0x4c2902[_0x97e3('0x2b')][_0x97e3('0x34')]){_0x24824f[_0x97e3('0x32')]=_['merge'](_0x24824f[_0x97e3('0x32')],{'$or':_[_0x97e3('0x27')](_0x337bd,function(_0x606aa){if(_0x606aa['type']!==_0x97e3('0x35')){var _0x1dd7cb={};_0x1dd7cb[_0x606aa[_0x97e3('0x22')]]={'$like':'%'+_0x4c2902['query'][_0x97e3('0x34')]+'%'};return _0x1dd7cb;}})});}_0x24824f=_[_0x97e3('0x36')]({},_0x24824f,_0x4c2902[_0x97e3('0x37')]);var _0xfe3680={'where':_0x24824f['where']};return db[_0x97e3('0x38')]['count'](_0xfe3680)[_0x97e3('0x1f')](function(_0xc74737){_0x424000['count']=_0xc74737;if(_0x4c2902['query']['includeAll']){_0x24824f[_0x97e3('0x39')]=[{'all':!![]}];}return db[_0x97e3('0x38')]['findAll'](_0x24824f);})[_0x97e3('0x1f')](function(_0x36ba9a){_0x424000[_0x97e3('0x3a')]=_0x36ba9a;return _0x424000;})[_0x97e3('0x1f')](respondWithFilteredResult(_0x26e9a5,_0x24824f))[_0x97e3('0x3b')](handleError(_0x26e9a5,null));};exports[_0x97e3('0x3c')]=function(_0xd9af7c,_0x5e2908){var _0x139b9a={'raw':!![],'where':{'id':_0xd9af7c[_0x97e3('0x3d')]['id']}},_0x2cb0a4={};_0x2cb0a4[_0x97e3('0x2a')]=_[_0x97e3('0x28')](db['SquareRecording'][_0x97e3('0x25')]);_0x2cb0a4['query']=_[_0x97e3('0x28')](_0xd9af7c[_0x97e3('0x2b')]);_0x2cb0a4[_0x97e3('0x29')]=_['intersection'](_0x2cb0a4[_0x97e3('0x2a')],_0x2cb0a4['query']);_0x139b9a[_0x97e3('0x2f')]=_['intersection'](_0x2cb0a4[_0x97e3('0x2a')],qs[_0x97e3('0x2d')](_0xd9af7c[_0x97e3('0x2b')][_0x97e3('0x2d')]));_0x139b9a[_0x97e3('0x2f')]=_0x139b9a[_0x97e3('0x2f')][_0x97e3('0x2e')]?_0x139b9a[_0x97e3('0x2f')]:_0x2cb0a4[_0x97e3('0x2a')];if(_0xd9af7c['query'][_0x97e3('0x3e')]){_0x139b9a[_0x97e3('0x39')]=[{'all':!![]}];}_0x139b9a=_[_0x97e3('0x36')]({},_0x139b9a,_0xd9af7c['options']);return db['SquareRecording'][_0x97e3('0x3f')](_0x139b9a)['then'](handleEntityNotFound(_0x5e2908,null))[_0x97e3('0x1f')](respondWithResult(_0x5e2908,null))[_0x97e3('0x3b')](handleError(_0x5e2908,null));};exports[_0x97e3('0x40')]=function(_0x261d36,_0x19c0a3){return db[_0x97e3('0x38')][_0x97e3('0x40')](_0x261d36[_0x97e3('0x41')],{})['then'](respondWithResult(_0x19c0a3,0xc9))[_0x97e3('0x3b')](handleError(_0x19c0a3,null));};exports[_0x97e3('0x42')]=function(_0x5147fd,_0x502b84){if(_0x5147fd[_0x97e3('0x41')]['id']){delete _0x5147fd[_0x97e3('0x41')]['id'];}return db[_0x97e3('0x38')][_0x97e3('0x3f')]({'where':{'id':_0x5147fd['params']['id']}})[_0x97e3('0x1f')](handleEntityNotFound(_0x502b84,null))[_0x97e3('0x1f')](saveUpdates(_0x5147fd['body'],null))[_0x97e3('0x1f')](respondWithResult(_0x502b84,null))[_0x97e3('0x3b')](handleError(_0x502b84,null));};exports[_0x97e3('0x43')]=function(_0x693bc1,_0x131d42,_0x562915){var _0x3d7f56=require(_0x97e3('0x44'));var _0x387b3b=![];var _0xbd3d8a={};if(_0x693bc1[_0x97e3('0x2b')][_0x97e3('0x26')]&&_0x693bc1[_0x97e3('0x2b')]['type']==='uniqueid'){_0xbd3d8a[_0x97e3('0x45')]=_0x693bc1[_0x97e3('0x3d')]['id'];}else{_0xbd3d8a['id']=_0x693bc1['params']['id'];}return db['SquareRecording'][_0x97e3('0x3f')]({'where':_0xbd3d8a,'attributes':['id',_0x97e3('0x46'),_0x97e3('0x47')],'raw':!![]})[_0x97e3('0x1f')](handleEntityNotFound(_0x131d42,null))['then'](function(_0x11d92b){if(_0x11d92b){var _0x29ff54=_0x11d92b[_0x97e3('0x46')];var _0x34be16=util['format'](_0x97e3('0x48'),_0x29ff54);if(fs[_0x97e3('0x49')](_0x34be16)){_0x387b3b=!![];return _0x3d7f56[_0x97e3('0x4a')](_0x34be16,_0x29ff54,config['secrets'][_0x97e3('0x4b')])[_0x97e3('0x1f')](function(){return _0x11d92b;});}return _0x11d92b;}})[_0x97e3('0x1f')](function(_0x4e2252){if(_0x4e2252){var _0x4036ac=_0x4e2252[_0x97e3('0x46')];if(!fs['existsSync'](_0x4036ac)){throw new db[(_0x97e3('0x4c'))][(_0x97e3('0x4d'))](_0x97e3('0x4e'));}if(_0x4e2252[_0x97e3('0x47')]){return _0x131d42[_0x97e3('0x43')](_0x4036ac,_0x4e2252[_0x97e3('0x47')]+path['extname'](_0x4036ac),function(){if(_0x387b3b){fs['unlink'](_0x4036ac);}});}else{return _0x131d42['download'](_0x4036ac,function(_0x64c795){if(_0x387b3b){fs[_0x97e3('0x4f')](_0x4036ac);}});}}})['catch'](function(_0x28b94b){if(_0x28b94b['message']==='SquareRecording\x20not\x20found'){_0x131d42[_0x97e3('0x18')](0x194)['send'](_0x97e3('0x50'));}else{return handleError(_0x131d42,null);}});};exports[_0x97e3('0x20')]=function(_0x26a81d,_0xc6115d){return db[_0x97e3('0x38')][_0x97e3('0x3f')]({'where':{'id':_0x26a81d[_0x97e3('0x3d')]['id']}})[_0x97e3('0x1f')](function(_0x80f454){if(_[_0x97e3('0x51')](_0x80f454)){throw new ReferenceError('Entity\x20not\x20found');}return _0x80f454;})['then'](function(_0x5c76fd){var _0x173b63=_0x5c76fd[_0x97e3('0x46')];logger[_0x97e3('0x52')]('cancellazione\x20fisica\x20documento\x20%s',_0x173b63);if(!_[_0x97e3('0x51')](_0x5c76fd[_0x97e3('0x46')])&&fs[_0x97e3('0x49')](_0x173b63)){logger['info'](_0x97e3('0x53')+_0x173b63+_0x97e3('0x54'));fs['unlinkSync'](_0x173b63);}_0x173b63=_0x173b63+'.cypher';if(!_[_0x97e3('0x51')](_0x5c76fd[_0x97e3('0x46')])&&fs['existsSync'](_0x173b63)){logger[_0x97e3('0x52')](_0x97e3('0x53')+_0x173b63+_0x97e3('0x54'));fs[_0x97e3('0x55')](_0x173b63);}return _0x5c76fd;})[_0x97e3('0x1f')](function(_0x280c94){if(!_0x280c94)throw new InternalError();return _0x280c94[_0x97e3('0x20')]();})[_0x97e3('0x1f')](function(){_0xc6115d[_0x97e3('0x18')](0xcc)['end']();})[_0x97e3('0x3b')](handleError(_0xc6115d,null));}; \ No newline at end of file +var _0xbea3=['show','params','includeAll','find','create','body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','existsSync','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch'];(function(_0x4b0f11,_0x329a56){var _0x254fbd=function(_0x301bc5){while(--_0x301bc5){_0x4b0f11['push'](_0x4b0f11['shift']());}};_0x254fbd(++_0x329a56);}(_0xbea3,0xe5));var _0x3bea=function(_0x2c1a9f,_0x3983d){_0x2c1a9f=_0x2c1a9f-0x0;var _0x54c223=_0xbea3[_0x2c1a9f];return _0x54c223;};'use strict';var emlformat=require(_0x3bea('0x0'));var rimraf=require(_0x3bea('0x1'));var zipdir=require(_0x3bea('0x2'));var jsonpatch=require(_0x3bea('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3bea('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bea('0x5'));var sox=require(_0x3bea('0x6'));var csv=require(_0x3bea('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bea('0x8'));var _=require(_0x3bea('0x9'));var squel=require('squel');var crypto=require(_0x3bea('0xa'));var jsforce=require(_0x3bea('0xb'));var deskjs=require(_0x3bea('0xc'));var toCsv=require(_0x3bea('0x7'));var querystring=require(_0x3bea('0xd'));var Papa=require(_0x3bea('0xe'));var Redis=require(_0x3bea('0xf'));var authService=require(_0x3bea('0x10'));var qs=require(_0x3bea('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bea('0x12'));var logger=require(_0x3bea('0x13'))(_0x3bea('0x14'));var utils=require(_0x3bea('0x15'));var config=require(_0x3bea('0x16'));var licenseUtil=require(_0x3bea('0x17'));var db=require(_0x3bea('0x18'))['db'];function respondWithStatusCode(_0x52992c,_0xa5a509){_0xa5a509=_0xa5a509||0xcc;return function(_0x10e8c8){if(_0x10e8c8){return _0x52992c[_0x3bea('0x19')](_0xa5a509);}return _0x52992c[_0x3bea('0x1a')](_0xa5a509)[_0x3bea('0x1b')]();};}function respondWithResult(_0x5c26ef,_0x16a1ec){_0x16a1ec=_0x16a1ec||0xc8;return function(_0x2ddf14){if(_0x2ddf14){return _0x5c26ef['status'](_0x16a1ec)[_0x3bea('0x1c')](_0x2ddf14);}};}function respondWithFilteredResult(_0x386a6b,_0x2fd8c6){return function(_0x1e46f0){if(_0x1e46f0){var _0x3c04e2=typeof _0x2fd8c6['offset']===_0x3bea('0x1d')&&typeof _0x2fd8c6[_0x3bea('0x1e')]==='undefined';var _0x39555=_0x1e46f0[_0x3bea('0x1f')];var _0x54d7f0=_0x3c04e2?0x0:_0x2fd8c6[_0x3bea('0x20')];var _0x47ff0c=_0x3c04e2?_0x1e46f0['count']:_0x2fd8c6[_0x3bea('0x20')]+_0x2fd8c6[_0x3bea('0x1e')];var _0x4796c9;if(_0x47ff0c>=_0x39555){_0x47ff0c=_0x39555;_0x4796c9=0xc8;}else{_0x4796c9=0xce;}_0x386a6b[_0x3bea('0x1a')](_0x4796c9);return _0x386a6b[_0x3bea('0x21')](_0x3bea('0x22'),_0x54d7f0+'-'+_0x47ff0c+'/'+_0x39555)['json'](_0x1e46f0);}return null;};}function patchUpdates(_0x25d870){return function(_0x37cb36){try{jsonpatch['apply'](_0x37cb36,_0x25d870,!![]);}catch(_0x331ddb){return BPromise[_0x3bea('0x23')](_0x331ddb);}return _0x37cb36[_0x3bea('0x24')]();};}function saveUpdates(_0x271ffc,_0x4d0278){return function(_0x3c6384){if(_0x3c6384){return _0x3c6384[_0x3bea('0x25')](_0x271ffc)[_0x3bea('0x26')](function(_0x73475e){return _0x73475e;});}return null;};}function removeEntity(_0x483ba7,_0x4af1c1){return function(_0x5a402b){if(_0x5a402b){return _0x5a402b[_0x3bea('0x27')]()[_0x3bea('0x26')](function(){_0x483ba7[_0x3bea('0x1a')](0xcc)[_0x3bea('0x1b')]();});}};}function handleEntityNotFound(_0x1b2162,_0x5ec6ce){return function(_0x2272c8){if(!_0x2272c8){_0x1b2162[_0x3bea('0x19')](0x194);}return _0x2272c8;};}function handleError(_0x1d74fb,_0x1dd461){_0x1dd461=_0x1dd461||0x1f4;return function(_0x2f9766){logger['error'](_0x2f9766['stack']);if(_0x2f9766[_0x3bea('0x28')]){delete _0x2f9766[_0x3bea('0x28')];}_0x1d74fb[_0x3bea('0x1a')](_0x1dd461)['send'](_0x2f9766);};}exports[_0x3bea('0x29')]=function(_0xbeea6,_0x2c153e){var _0x5d7cdc={},_0x5e2de1={},_0x415d81={'count':0x0,'rows':[]};var _0x34f0ea=_[_0x3bea('0x2a')](db[_0x3bea('0x2b')][_0x3bea('0x2c')],function(_0x5237d8){return{'name':_0x5237d8[_0x3bea('0x2d')],'type':_0x5237d8[_0x3bea('0x2e')][_0x3bea('0x2f')]};});_0x5e2de1['model']=_[_0x3bea('0x2a')](_0x34f0ea,_0x3bea('0x28'));_0x5e2de1['query']=_[_0x3bea('0x30')](_0xbeea6[_0x3bea('0x31')]);_0x5e2de1[_0x3bea('0x32')]=_[_0x3bea('0x33')](_0x5e2de1[_0x3bea('0x34')],_0x5e2de1[_0x3bea('0x31')]);_0x5d7cdc[_0x3bea('0x35')]=_[_0x3bea('0x33')](_0x5e2de1[_0x3bea('0x34')],qs[_0x3bea('0x36')](_0xbeea6[_0x3bea('0x31')][_0x3bea('0x36')]));_0x5d7cdc['attributes']=_0x5d7cdc[_0x3bea('0x35')][_0x3bea('0x37')]?_0x5d7cdc[_0x3bea('0x35')]:_0x5e2de1[_0x3bea('0x34')];if(!_0xbeea6[_0x3bea('0x31')][_0x3bea('0x38')]('nolimit')){_0x5d7cdc[_0x3bea('0x1e')]=qs[_0x3bea('0x1e')](_0xbeea6[_0x3bea('0x31')][_0x3bea('0x1e')]);_0x5d7cdc[_0x3bea('0x20')]=qs[_0x3bea('0x20')](_0xbeea6['query']['offset']);}_0x5d7cdc[_0x3bea('0x39')]=qs[_0x3bea('0x3a')](_0xbeea6[_0x3bea('0x31')]['sort']);_0x5d7cdc[_0x3bea('0x3b')]=qs[_0x3bea('0x32')](_[_0x3bea('0x3c')](_0xbeea6[_0x3bea('0x31')],_0x5e2de1[_0x3bea('0x32')]),_0x34f0ea);if(_0xbeea6[_0x3bea('0x31')][_0x3bea('0x3d')]){_0x5d7cdc['where']=_[_0x3bea('0x3e')](_0x5d7cdc[_0x3bea('0x3b')],{'$or':_[_0x3bea('0x2a')](_0x34f0ea,function(_0x4f33d2){if(_0x4f33d2[_0x3bea('0x2e')]!=='VIRTUAL'){var _0x3686c8={};_0x3686c8[_0x4f33d2[_0x3bea('0x28')]]={'$like':'%'+_0xbeea6[_0x3bea('0x31')][_0x3bea('0x3d')]+'%'};return _0x3686c8;}})});}_0x5d7cdc=_[_0x3bea('0x3e')]({},_0x5d7cdc,_0xbeea6[_0x3bea('0x3f')]);var _0x222873={'where':_0x5d7cdc[_0x3bea('0x3b')]};return db[_0x3bea('0x2b')][_0x3bea('0x1f')](_0x222873)[_0x3bea('0x26')](function(_0x5f5311){_0x415d81[_0x3bea('0x1f')]=_0x5f5311;if(_0xbeea6[_0x3bea('0x31')]['includeAll']){_0x5d7cdc[_0x3bea('0x40')]=[{'all':!![]}];}return db[_0x3bea('0x2b')][_0x3bea('0x41')](_0x5d7cdc);})[_0x3bea('0x26')](function(_0x570e3c){_0x415d81[_0x3bea('0x42')]=_0x570e3c;return _0x415d81;})['then'](respondWithFilteredResult(_0x2c153e,_0x5d7cdc))[_0x3bea('0x43')](handleError(_0x2c153e,null));};exports[_0x3bea('0x44')]=function(_0x2be997,_0x28ed3a){var _0x5f1b2a={'raw':!![],'where':{'id':_0x2be997[_0x3bea('0x45')]['id']}},_0x37f2b4={};_0x37f2b4[_0x3bea('0x34')]=_[_0x3bea('0x30')](db[_0x3bea('0x2b')][_0x3bea('0x2c')]);_0x37f2b4[_0x3bea('0x31')]=_[_0x3bea('0x30')](_0x2be997['query']);_0x37f2b4[_0x3bea('0x32')]=_['intersection'](_0x37f2b4[_0x3bea('0x34')],_0x37f2b4[_0x3bea('0x31')]);_0x5f1b2a[_0x3bea('0x35')]=_[_0x3bea('0x33')](_0x37f2b4[_0x3bea('0x34')],qs[_0x3bea('0x36')](_0x2be997[_0x3bea('0x31')]['fields']));_0x5f1b2a[_0x3bea('0x35')]=_0x5f1b2a[_0x3bea('0x35')]['length']?_0x5f1b2a[_0x3bea('0x35')]:_0x37f2b4[_0x3bea('0x34')];if(_0x2be997[_0x3bea('0x31')][_0x3bea('0x46')]){_0x5f1b2a['include']=[{'all':!![]}];}_0x5f1b2a=_[_0x3bea('0x3e')]({},_0x5f1b2a,_0x2be997[_0x3bea('0x3f')]);return db[_0x3bea('0x2b')][_0x3bea('0x47')](_0x5f1b2a)['then'](handleEntityNotFound(_0x28ed3a,null))[_0x3bea('0x26')](respondWithResult(_0x28ed3a,null))[_0x3bea('0x43')](handleError(_0x28ed3a,null));};exports[_0x3bea('0x48')]=function(_0xeed3e4,_0x249ec4){return db[_0x3bea('0x2b')][_0x3bea('0x48')](_0xeed3e4[_0x3bea('0x49')],{})[_0x3bea('0x26')](respondWithResult(_0x249ec4,0xc9))['catch'](handleError(_0x249ec4,null));};exports[_0x3bea('0x25')]=function(_0x3d7e7f,_0x3c7ca1){if(_0x3d7e7f[_0x3bea('0x49')]['id']){delete _0x3d7e7f[_0x3bea('0x49')]['id'];}return db[_0x3bea('0x2b')][_0x3bea('0x47')]({'where':{'id':_0x3d7e7f[_0x3bea('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c7ca1,null))[_0x3bea('0x26')](saveUpdates(_0x3d7e7f[_0x3bea('0x49')],null))['then'](respondWithResult(_0x3c7ca1,null))[_0x3bea('0x43')](handleError(_0x3c7ca1,null));};exports[_0x3bea('0x4a')]=function(_0x47e52f,_0x4a06c0,_0x187654){var _0x2be564=require(_0x3bea('0x4b'));var _0x470bc4=![];var _0x35b26b={};if(_0x47e52f[_0x3bea('0x31')][_0x3bea('0x2e')]&&_0x47e52f['query'][_0x3bea('0x2e')]===_0x3bea('0x4c')){_0x35b26b[_0x3bea('0x4c')]=_0x47e52f[_0x3bea('0x45')]['id'];}else{_0x35b26b['id']=_0x47e52f['params']['id'];}return db[_0x3bea('0x2b')][_0x3bea('0x47')]({'where':_0x35b26b,'attributes':['id',_0x3bea('0x4d'),'filename'],'raw':!![]})[_0x3bea('0x26')](handleEntityNotFound(_0x4a06c0,null))[_0x3bea('0x26')](function(_0x25558a){if(_0x25558a){var _0xd52560=_0x25558a[_0x3bea('0x4d')];var _0xe803f4=util['format'](_0x3bea('0x4e'),_0xd52560);if(fs['existsSync'](_0xe803f4)){_0x470bc4=!![];return _0x2be564[_0x3bea('0x4f')](_0xe803f4,_0xd52560,config[_0x3bea('0x50')][_0x3bea('0x51')])[_0x3bea('0x26')](function(){return _0x25558a;});}return _0x25558a;}})[_0x3bea('0x26')](function(_0x16a9e0){if(_0x16a9e0){var _0x55a61e=_0x16a9e0[_0x3bea('0x4d')];if(!fs['existsSync'](_0x55a61e)){throw new db[(_0x3bea('0x52'))][(_0x3bea('0x53'))](_0x3bea('0x54'));}if(_0x16a9e0['filename']){return _0x4a06c0[_0x3bea('0x4a')](_0x55a61e,_0x16a9e0[_0x3bea('0x55')]+path[_0x3bea('0x56')](_0x55a61e),function(){if(_0x470bc4){fs[_0x3bea('0x57')](_0x55a61e);}});}else{return _0x4a06c0[_0x3bea('0x4a')](_0x55a61e,function(_0x4f827e){if(_0x470bc4){fs[_0x3bea('0x57')](_0x55a61e);}});}}})[_0x3bea('0x43')](function(_0x108d4f){if(_0x108d4f[_0x3bea('0x58')]==='SquareRecording\x20not\x20found'){_0x4a06c0['status'](0x194)[_0x3bea('0x59')](_0x3bea('0x5a'));}else{return handleError(_0x4a06c0,null);}});};exports[_0x3bea('0x27')]=function(_0x1f0974,_0x370c5f){return db['SquareRecording']['find']({'where':{'id':_0x1f0974[_0x3bea('0x45')]['id']}})[_0x3bea('0x26')](function(_0x55e4bf){if(_[_0x3bea('0x5b')](_0x55e4bf)){throw new ReferenceError(_0x3bea('0x5c'));}return _0x55e4bf;})[_0x3bea('0x26')](function(_0x2cf810){var _0x4acbad=_0x2cf810[_0x3bea('0x4d')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x4acbad);if(!_[_0x3bea('0x5b')](_0x2cf810[_0x3bea('0x4d')])&&fs[_0x3bea('0x5d')](_0x4acbad)){logger[_0x3bea('0x5e')](_0x3bea('0x5f')+_0x4acbad+_0x3bea('0x60'));fs['unlinkSync'](_0x4acbad);}_0x4acbad=_0x4acbad+_0x3bea('0x61');if(!_[_0x3bea('0x5b')](_0x2cf810['savePath'])&&fs[_0x3bea('0x5d')](_0x4acbad)){logger[_0x3bea('0x5e')]('File:\x20\x22'+_0x4acbad+_0x3bea('0x60'));fs[_0x3bea('0x62')](_0x4acbad);}return _0x2cf810;})[_0x3bea('0x26')](function(_0x5129ce){if(!_0x5129ce)throw new InternalError();return _0x5129ce['destroy']();})[_0x3bea('0x26')](function(){_0x370c5f[_0x3bea('0x1a')](0xcc)['end']();})[_0x3bea('0x43')](handleError(_0x370c5f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e83bdea..bedbcf2 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 _0x9f0e=['./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x36fa82,_0xb2649){_0x36fa82=_0x36fa82-0x0;var _0x3c79d4=_0x9f0e[_0x36fa82];return _0x3c79d4;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))(_0xe9f0('0x3'));var moment=require(_0xe9f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9f0('0x5'));var rimraf=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var attributes=require(_0xe9f0('0x8'));module[_0xe9f0('0x9')]=function(_0x50313d,_0x5b87c1){return _0x50313d[_0xe9f0('0xa')](_0xe9f0('0xb'),attributes,{'tableName':_0xe9f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1ad=['moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api'];(function(_0x1ef281,_0x1668da){var _0x39545d=function(_0x181093){while(--_0x181093){_0x1ef281['push'](_0x1ef281['shift']());}};_0x39545d(++_0x1668da);}(_0xb1ad,0x184));var _0xdb1a=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xb1ad[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var logger=require(_0xdb1a('0x2'))(_0xdb1a('0x3'));var moment=require(_0xdb1a('0x4'));var BPromise=require(_0xdb1a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb1a('0x6'));var rimraf=require(_0xdb1a('0x7'));var config=require(_0xdb1a('0x8'));var attributes=require(_0xdb1a('0x9'));module[_0xdb1a('0xa')]=function(_0x3a19a1,_0x368208){return _0x3a19a1[_0xdb1a('0xb')](_0xdb1a('0xc'),attributes,{'tableName':_0xdb1a('0xd'),'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 d18c53c..523b914 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 _0x1f75=['jayson/promise','client','http','then','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','options','info','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x1f75,0x13c));var _0x51f7=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x1f75[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require(_0x51f7('0x0'));var moment=require(_0x51f7('0x1'));var BPromise=require(_0x51f7('0x2'));var rs=require(_0x51f7('0x3'));var fs=require('fs');var Redis=require(_0x51f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51f7('0x5'));var logger=require(_0x51f7('0x6'))(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var jayson=require(_0x51f7('0x9'));var client=jayson[_0x51f7('0xa')][_0x51f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb4e621,_0x3d2a15,_0x47069a){return new BPromise(function(_0x20d374,_0x4158a6){return client['request'](_0xb4e621,_0x47069a)[_0x51f7('0xc')](function(_0x450767){logger['info'](_0x51f7('0xd'),_0x3d2a15,_0x51f7('0xe'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x3d2a15,_0x51f7('0xe'),JSON[_0x51f7('0xf')](_0x450767));if(_0x450767['error']){if(_0x450767[_0x51f7('0x10')][_0x51f7('0x11')]===0x1f4){logger['error'](_0x51f7('0xd'),_0x3d2a15,_0x450767[_0x51f7('0x10')][_0x51f7('0x12')]);return _0x4158a6(_0x450767['error']['message']);}logger[_0x51f7('0x10')](_0x51f7('0xd'),_0x3d2a15,_0x450767[_0x51f7('0x10')][_0x51f7('0x12')]);return _0x20d374(_0x450767[_0x51f7('0x10')][_0x51f7('0x12')]);}else{logger['info'](_0x51f7('0xd'),_0x3d2a15,_0x51f7('0xe'));_0x20d374(_0x450767[_0x51f7('0x13')][_0x51f7('0x12')]);}})[_0x51f7('0x14')](function(_0x1b3532){logger[_0x51f7('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3d2a15,_0x1b3532);_0x4158a6(_0x1b3532);});});}exports[_0x51f7('0x15')]=function(_0x33d2a7){var _0x505597=this;return new Promise(function(_0x1201c1,_0x245d19){return db['SquareRecording']['create'](_0x33d2a7['body'],{'raw':_0x33d2a7[_0x51f7('0x16')]?_0x33d2a7['options']['raw']===undefined?!![]:![]:!![]})[_0x51f7('0xc')](function(_0x1decc1){logger[_0x51f7('0x17')](_0x51f7('0x15'),_0x33d2a7);logger[_0x51f7('0x18')](_0x51f7('0x15'),_0x33d2a7,JSON[_0x51f7('0xf')](_0x1decc1));_0x1201c1(_0x1decc1);})[_0x51f7('0x14')](function(_0x4e277e){logger[_0x51f7('0x10')]('CreateSquareRecording',_0x4e277e[_0x51f7('0x12')],_0x33d2a7);_0x245d19(_0x505597[_0x51f7('0x10')](0x1f4,_0x4e277e[_0x51f7('0x12')]));});});}; \ No newline at end of file +var _0x3ea0=['then','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','CreateSquareRecording','create','body','options','raw'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3ea0,0x154));var _0x03ea=function(_0x5249be,_0x251784){_0x5249be=_0x5249be-0x0;var _0x19ba8e=_0x3ea0[_0x5249be];return _0x19ba8e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x03ea('0x0'));var BPromise=require(_0x03ea('0x1'));var rs=require(_0x03ea('0x2'));var fs=require('fs');var Redis=require(_0x03ea('0x3'));var db=require(_0x03ea('0x4'))['db'];var utils=require(_0x03ea('0x5'));var logger=require(_0x03ea('0x6'))(_0x03ea('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x03ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe4b2fe,_0x11283b,_0x616a77){return new BPromise(function(_0xcdd4b0,_0x454ebd){return client[_0x03ea('0x9')](_0xe4b2fe,_0x616a77)['then'](function(_0x527f13){logger['info'](_0x03ea('0xa'),_0x11283b,_0x03ea('0xb'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x11283b,_0x03ea('0xb'),JSON[_0x03ea('0xc')](_0x527f13));if(_0x527f13['error']){if(_0x527f13['error'][_0x03ea('0xd')]===0x1f4){logger['error'](_0x03ea('0xa'),_0x11283b,_0x527f13[_0x03ea('0xe')][_0x03ea('0xf')]);return _0x454ebd(_0x527f13['error'][_0x03ea('0xf')]);}logger[_0x03ea('0xe')](_0x03ea('0xa'),_0x11283b,_0x527f13[_0x03ea('0xe')][_0x03ea('0xf')]);return _0xcdd4b0(_0x527f13['error'][_0x03ea('0xf')]);}else{logger[_0x03ea('0x10')](_0x03ea('0xa'),_0x11283b,_0x03ea('0xb'));_0xcdd4b0(_0x527f13[_0x03ea('0x11')][_0x03ea('0xf')]);}})[_0x03ea('0x12')](function(_0x21ed7f){logger['error'](_0x03ea('0xa'),_0x11283b,_0x21ed7f);_0x454ebd(_0x21ed7f);});});}exports[_0x03ea('0x13')]=function(_0x36ce9b){var _0x3bf6ad=this;return new Promise(function(_0x3b651b,_0x54456f){return db['SquareRecording'][_0x03ea('0x14')](_0x36ce9b[_0x03ea('0x15')],{'raw':_0x36ce9b['options']?_0x36ce9b[_0x03ea('0x16')][_0x03ea('0x17')]===undefined?!![]:![]:!![]})[_0x03ea('0x18')](function(_0x2a1acc){logger[_0x03ea('0x10')](_0x03ea('0x13'),_0x36ce9b);logger[_0x03ea('0x19')]('CreateSquareRecording',_0x36ce9b,JSON[_0x03ea('0xc')](_0x2a1acc));_0x3b651b(_0x2a1acc);})[_0x03ea('0x12')](function(_0x595323){logger[_0x03ea('0xe')](_0x03ea('0x13'),_0x595323[_0x03ea('0xf')],_0x36ce9b);_0x54456f(_0x3bf6ad[_0x03ea('0xe')](0x1f4,_0x595323[_0x03ea('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6edc2f4..dce20f2 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x36d0c4,_0x247c70){var _0x2e9116=function(_0x54507a){while(--_0x54507a){_0x36d0c4['push'](_0x36d0c4['shift']());}};_0x2e9116(++_0x247c70);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1f069b,_0x7434dc){var _0x56111a=function(_0x3bada6){while(--_0x3bada6){_0x1f069b['push'](_0x1f069b['shift']());}};_0x56111a(++_0x7434dc);}(_0xb10b,0x12a));var _0xbb10=function(_0x1833cd,_0x369128){_0x1833cd=_0x1833cd-0x0;var _0x4360ac=_0xb10b[_0x1833cd];return _0x4360ac;};'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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 374c2e5..8a000c3 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 _0xd3dc=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0xd3dc,0x161));var _0xcd3d=function(_0x43c288,_0x49f850){_0x43c288=_0x43c288-0x0;var _0x560c29=_0xd3dc[_0x43c288];return _0x560c29;};'use strict';var Sequelize=require(_0xcd3d('0x0'));module[_0xcd3d('0x1')]={'network':{'type':Sequelize[_0xcd3d('0x2')]},'network_script':{'type':Sequelize[_0xcd3d('0x2')]},'request':{'type':Sequelize[_0xcd3d('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xcd3d('0x2')]},'type':{'type':Sequelize[_0xcd3d('0x2')]},'uniqueid':{'type':Sequelize[_0xcd3d('0x2')]},'version':{'type':Sequelize[_0xcd3d('0x2')]},'callerid':{'type':Sequelize[_0xcd3d('0x2')]},'calleridname':{'type':Sequelize[_0xcd3d('0x2')]},'callingpres':{'type':Sequelize[_0xcd3d('0x2')]},'callingani2':{'type':Sequelize[_0xcd3d('0x2')]},'callington':{'type':Sequelize[_0xcd3d('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xcd3d('0x2')]},'rdnis':{'type':Sequelize[_0xcd3d('0x2')]},'context':{'type':Sequelize[_0xcd3d('0x2')]},'extension':{'type':Sequelize[_0xcd3d('0x2')]},'priority':{'type':Sequelize[_0xcd3d('0x2')]},'enhanced':{'type':Sequelize[_0xcd3d('0x2')]},'accountcode':{'type':Sequelize[_0xcd3d('0x2')]},'threadid':{'type':Sequelize[_0xcd3d('0x2')]},'project_name':{'type':Sequelize[_0xcd3d('0x2')]},'joinAt':{'type':Sequelize[_0xcd3d('0x3')]},'leaveAt':{'type':Sequelize[_0xcd3d('0x3')]},'bot':{'type':Sequelize[_0xcd3d('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9bb3=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x9bb3,0x134));var _0x39bb=function(_0xecbd1c,_0x39e76c){_0xecbd1c=_0xecbd1c-0x0;var _0x298b77=_0x9bb3[_0xecbd1c];return _0x298b77;};'use strict';var Sequelize=require(_0x39bb('0x0'));module[_0x39bb('0x1')]={'network':{'type':Sequelize[_0x39bb('0x2')]},'network_script':{'type':Sequelize[_0x39bb('0x2')]},'request':{'type':Sequelize[_0x39bb('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x39bb('0x2')]},'uniqueid':{'type':Sequelize[_0x39bb('0x2')]},'version':{'type':Sequelize[_0x39bb('0x2')]},'callerid':{'type':Sequelize[_0x39bb('0x2')]},'calleridname':{'type':Sequelize[_0x39bb('0x2')]},'callingpres':{'type':Sequelize[_0x39bb('0x2')]},'callingani2':{'type':Sequelize[_0x39bb('0x2')]},'callington':{'type':Sequelize[_0x39bb('0x2')]},'callingtns':{'type':Sequelize[_0x39bb('0x2')]},'dnid':{'type':Sequelize[_0x39bb('0x2')]},'rdnis':{'type':Sequelize[_0x39bb('0x2')]},'context':{'type':Sequelize[_0x39bb('0x2')]},'extension':{'type':Sequelize[_0x39bb('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x39bb('0x2')]},'threadid':{'type':Sequelize[_0x39bb('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x39bb('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x39bb('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 e184a5a..26f8fdc 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 _0x0835=['rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','catch','show','params','include','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','sendStatus','stack','name','send','index','map','SquareReport'];(function(_0x4f346e,_0x17d436){var _0x2e28c2=function(_0x21f9b9){while(--_0x21f9b9){_0x4f346e['push'](_0x4f346e['shift']());}};_0x2e28c2(++_0x17d436);}(_0x0835,0xe7));var _0x5083=function(_0x2957cb,_0x21916a){_0x2957cb=_0x2957cb-0x0;var _0x659f3b=_0x0835[_0x2957cb];return _0x659f3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5083('0x0'));var zipdir=require(_0x5083('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5083('0x2'));var moment=require(_0x5083('0x3'));var BPromise=require(_0x5083('0x4'));var Mustache=require('mustache');var util=require(_0x5083('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5083('0x6'));var ejs=require(_0x5083('0x7'));var fs=require('fs');var fs_extra=require(_0x5083('0x8'));var _=require(_0x5083('0x9'));var squel=require('squel');var crypto=require(_0x5083('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5083('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5083('0xc'));var Papa=require(_0x5083('0xd'));var Redis=require(_0x5083('0xe'));var authService=require(_0x5083('0xf'));var qs=require(_0x5083('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5083('0x11'));var logger=require(_0x5083('0x12'))(_0x5083('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5083('0x14'));var db=require(_0x5083('0x15'))['db'];function respondWithStatusCode(_0x26835d,_0x3758ea){_0x3758ea=_0x3758ea||0xcc;return function(_0x2cae96){if(_0x2cae96){return _0x26835d['sendStatus'](_0x3758ea);}return _0x26835d[_0x5083('0x16')](_0x3758ea)[_0x5083('0x17')]();};}function respondWithResult(_0x324a31,_0x47a198){_0x47a198=_0x47a198||0xc8;return function(_0x5c1d3b){if(_0x5c1d3b){return _0x324a31[_0x5083('0x16')](_0x47a198)['json'](_0x5c1d3b);}};}function respondWithFilteredResult(_0x5ac9f4,_0xb52f49){return function(_0x4f99ba){if(_0x4f99ba){var _0x1b0d37=typeof _0xb52f49[_0x5083('0x18')]===_0x5083('0x19')&&typeof _0xb52f49[_0x5083('0x1a')]==='undefined';var _0x3baca9=_0x4f99ba[_0x5083('0x1b')];var _0x4cb225=_0x1b0d37?0x0:_0xb52f49['offset'];var _0x557422=_0x1b0d37?_0x4f99ba[_0x5083('0x1b')]:_0xb52f49[_0x5083('0x18')]+_0xb52f49['limit'];var _0x26f647;if(_0x557422>=_0x3baca9){_0x557422=_0x3baca9;_0x26f647=0xc8;}else{_0x26f647=0xce;}_0x5ac9f4[_0x5083('0x16')](_0x26f647);return _0x5ac9f4[_0x5083('0x1c')]('Content-Range',_0x4cb225+'-'+_0x557422+'/'+_0x3baca9)[_0x5083('0x1d')](_0x4f99ba);}return null;};}function patchUpdates(_0x3e7f25){return function(_0x9b9d8){try{jsonpatch[_0x5083('0x1e')](_0x9b9d8,_0x3e7f25,!![]);}catch(_0x1569ed){return BPromise[_0x5083('0x1f')](_0x1569ed);}return _0x9b9d8['save']();};}function saveUpdates(_0x480ede,_0x1a3427){return function(_0x3eeaaa){if(_0x3eeaaa){return _0x3eeaaa[_0x5083('0x20')](_0x480ede)[_0x5083('0x21')](function(_0x1cb8ba){return _0x1cb8ba;});}return null;};}function removeEntity(_0x514c1f,_0x396cfb){return function(_0x271c38){if(_0x271c38){return _0x271c38['destroy']()[_0x5083('0x21')](function(){_0x514c1f[_0x5083('0x16')](0xcc)[_0x5083('0x17')]();});}};}function handleEntityNotFound(_0x220a8f,_0x3a6044){return function(_0x3176d8){if(!_0x3176d8){_0x220a8f[_0x5083('0x22')](0x194);}return _0x3176d8;};}function handleError(_0x5bcb78,_0x59fb95){_0x59fb95=_0x59fb95||0x1f4;return function(_0x139788){logger['error'](_0x139788[_0x5083('0x23')]);if(_0x139788['name']){delete _0x139788[_0x5083('0x24')];}_0x5bcb78[_0x5083('0x16')](_0x59fb95)[_0x5083('0x25')](_0x139788);};}exports[_0x5083('0x26')]=function(_0x1d9bea,_0x1dc6d9){var _0x30e72e={},_0x4a64ed={},_0x1151af={'count':0x0,'rows':[]};var _0x3973af=_[_0x5083('0x27')](db[_0x5083('0x28')][_0x5083('0x29')],function(_0x559a0f){return{'name':_0x559a0f[_0x5083('0x2a')],'type':_0x559a0f['type'][_0x5083('0x2b')]};});_0x4a64ed[_0x5083('0x2c')]=_['map'](_0x3973af,_0x5083('0x24'));_0x4a64ed[_0x5083('0x2d')]=_[_0x5083('0x2e')](_0x1d9bea['query']);_0x4a64ed[_0x5083('0x2f')]=_[_0x5083('0x30')](_0x4a64ed['model'],_0x4a64ed[_0x5083('0x2d')]);_0x30e72e['attributes']=_[_0x5083('0x30')](_0x4a64ed[_0x5083('0x2c')],qs[_0x5083('0x31')](_0x1d9bea[_0x5083('0x2d')]['fields']));_0x30e72e[_0x5083('0x32')]=_0x30e72e[_0x5083('0x32')][_0x5083('0x33')]?_0x30e72e[_0x5083('0x32')]:_0x4a64ed[_0x5083('0x2c')];if(!_0x1d9bea[_0x5083('0x2d')]['hasOwnProperty'](_0x5083('0x34'))){_0x30e72e[_0x5083('0x1a')]=qs['limit'](_0x1d9bea['query']['limit']);_0x30e72e[_0x5083('0x18')]=qs[_0x5083('0x18')](_0x1d9bea[_0x5083('0x2d')][_0x5083('0x18')]);}_0x30e72e['order']=qs['sort'](_0x1d9bea[_0x5083('0x2d')][_0x5083('0x35')]);_0x30e72e[_0x5083('0x36')]=qs[_0x5083('0x2f')](_[_0x5083('0x37')](_0x1d9bea[_0x5083('0x2d')],_0x4a64ed[_0x5083('0x2f')]),_0x3973af);if(_0x1d9bea[_0x5083('0x2d')]['filter']){_0x30e72e[_0x5083('0x36')]=_[_0x5083('0x38')](_0x30e72e['where'],{'$or':_[_0x5083('0x27')](_0x3973af,function(_0x454731){if(_0x454731['type']!==_0x5083('0x39')){var _0x3bb3ef={};_0x3bb3ef[_0x454731[_0x5083('0x24')]]={'$like':'%'+_0x1d9bea[_0x5083('0x2d')]['filter']+'%'};return _0x3bb3ef;}})});}_0x30e72e=_[_0x5083('0x38')]({},_0x30e72e,_0x1d9bea['options']);var _0x163ebb={'where':_0x30e72e[_0x5083('0x36')]};return db[_0x5083('0x28')][_0x5083('0x1b')](_0x163ebb)[_0x5083('0x21')](function(_0x46700f){_0x1151af[_0x5083('0x1b')]=_0x46700f;if(_0x1d9bea[_0x5083('0x2d')][_0x5083('0x3a')]){_0x30e72e['include']=[{'all':!![]}];}return db[_0x5083('0x28')]['findAll'](_0x30e72e);})['then'](function(_0x5b9eb1){_0x1151af['rows']=_0x5b9eb1;return _0x1151af;})[_0x5083('0x21')](respondWithFilteredResult(_0x1dc6d9,_0x30e72e))[_0x5083('0x3b')](handleError(_0x1dc6d9,null));};exports[_0x5083('0x3c')]=function(_0x11806e,_0x675eae){var _0x3f5e63={'raw':!![],'where':{'id':_0x11806e[_0x5083('0x3d')]['id']}},_0x33ff32={};_0x33ff32[_0x5083('0x2c')]=_[_0x5083('0x2e')](db['SquareReport'][_0x5083('0x29')]);_0x33ff32[_0x5083('0x2d')]=_[_0x5083('0x2e')](_0x11806e[_0x5083('0x2d')]);_0x33ff32[_0x5083('0x2f')]=_[_0x5083('0x30')](_0x33ff32[_0x5083('0x2c')],_0x33ff32[_0x5083('0x2d')]);_0x3f5e63['attributes']=_[_0x5083('0x30')](_0x33ff32[_0x5083('0x2c')],qs[_0x5083('0x31')](_0x11806e[_0x5083('0x2d')]['fields']));_0x3f5e63[_0x5083('0x32')]=_0x3f5e63[_0x5083('0x32')][_0x5083('0x33')]?_0x3f5e63[_0x5083('0x32')]:_0x33ff32[_0x5083('0x2c')];if(_0x11806e[_0x5083('0x2d')]['includeAll']){_0x3f5e63[_0x5083('0x3e')]=[{'all':!![]}];}_0x3f5e63=_['merge']({},_0x3f5e63,_0x11806e['options']);return db[_0x5083('0x28')][_0x5083('0x3f')](_0x3f5e63)[_0x5083('0x21')](handleEntityNotFound(_0x675eae,null))[_0x5083('0x21')](respondWithResult(_0x675eae,null))[_0x5083('0x3b')](handleError(_0x675eae,null));};exports[_0x5083('0x40')]=function(_0x1b4ef8,_0x453cd6){return db[_0x5083('0x28')]['create'](_0x1b4ef8['body'],{})[_0x5083('0x21')](respondWithResult(_0x453cd6,0xc9))[_0x5083('0x3b')](handleError(_0x453cd6,null));};exports['update']=function(_0x26dcea,_0x19cd33){if(_0x26dcea[_0x5083('0x41')]['id']){delete _0x26dcea[_0x5083('0x41')]['id'];}return db['SquareReport'][_0x5083('0x3f')]({'where':{'id':_0x26dcea[_0x5083('0x3d')]['id']}})[_0x5083('0x21')](handleEntityNotFound(_0x19cd33,null))['then'](saveUpdates(_0x26dcea[_0x5083('0x41')],null))['then'](respondWithResult(_0x19cd33,null))[_0x5083('0x3b')](handleError(_0x19cd33,null));};exports[_0x5083('0x42')]=function(_0x47a91e,_0x48780d){return db[_0x5083('0x28')][_0x5083('0x3f')]({'where':{'id':_0x47a91e[_0x5083('0x3d')]['id']}})[_0x5083('0x21')](handleEntityNotFound(_0x48780d,null))[_0x5083('0x21')](removeEntity(_0x48780d,null))[_0x5083('0x3b')](handleError(_0x48780d,null));};exports[_0x5083('0x43')]=function(_0x386ac8,_0x3682d5){return db[_0x5083('0x28')][_0x5083('0x43')]()[_0x5083('0x21')](respondWithResult(_0x3682d5,null))[_0x5083('0x3b')](handleError(_0x3682d5,null));}; \ No newline at end of file +var _0xd898=['key','query','keys','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SquareReport','rawAttributes','type'];(function(_0x31a8fd,_0x3b069e){var _0x3c9f87=function(_0x193208){while(--_0x193208){_0x31a8fd['push'](_0x31a8fd['shift']());}};_0x3c9f87(++_0x3b069e);}(_0xd898,0x67));var _0x8d89=function(_0xcc5d53,_0x96d5ea){_0xcc5d53=_0xcc5d53-0x0;var _0x3c5ab9=_0xd898[_0xcc5d53];return _0x3c5ab9;};'use strict';var emlformat=require(_0x8d89('0x0'));var rimraf=require(_0x8d89('0x1'));var zipdir=require(_0x8d89('0x2'));var jsonpatch=require(_0x8d89('0x3'));var rp=require(_0x8d89('0x4'));var moment=require('moment');var BPromise=require(_0x8d89('0x5'));var Mustache=require('mustache');var util=require(_0x8d89('0x6'));var path=require(_0x8d89('0x7'));var sox=require(_0x8d89('0x8'));var csv=require(_0x8d89('0x9'));var ejs=require(_0x8d89('0xa'));var fs=require('fs');var fs_extra=require(_0x8d89('0xb'));var _=require(_0x8d89('0xc'));var squel=require(_0x8d89('0xd'));var crypto=require(_0x8d89('0xe'));var jsforce=require(_0x8d89('0xf'));var deskjs=require(_0x8d89('0x10'));var toCsv=require(_0x8d89('0x9'));var querystring=require('querystring');var Papa=require(_0x8d89('0x11'));var Redis=require(_0x8d89('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8d89('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d89('0x14'))('api');var utils=require(_0x8d89('0x15'));var config=require(_0x8d89('0x16'));var licenseUtil=require(_0x8d89('0x17'));var db=require(_0x8d89('0x18'))['db'];function respondWithStatusCode(_0x44984f,_0x51d665){_0x51d665=_0x51d665||0xcc;return function(_0x29cfe4){if(_0x29cfe4){return _0x44984f['sendStatus'](_0x51d665);}return _0x44984f[_0x8d89('0x19')](_0x51d665)[_0x8d89('0x1a')]();};}function respondWithResult(_0x4adcfc,_0x3226b2){_0x3226b2=_0x3226b2||0xc8;return function(_0x41c035){if(_0x41c035){return _0x4adcfc[_0x8d89('0x19')](_0x3226b2)['json'](_0x41c035);}};}function respondWithFilteredResult(_0x5426bc,_0x4f03a8){return function(_0xd0a8b5){if(_0xd0a8b5){var _0x4d7ee9=typeof _0x4f03a8[_0x8d89('0x1b')]===_0x8d89('0x1c')&&typeof _0x4f03a8[_0x8d89('0x1d')]===_0x8d89('0x1c');var _0x7afa4=_0xd0a8b5['count'];var _0x14c360=_0x4d7ee9?0x0:_0x4f03a8[_0x8d89('0x1b')];var _0x2fa01f=_0x4d7ee9?_0xd0a8b5[_0x8d89('0x1e')]:_0x4f03a8[_0x8d89('0x1b')]+_0x4f03a8[_0x8d89('0x1d')];var _0x12f5b7;if(_0x2fa01f>=_0x7afa4){_0x2fa01f=_0x7afa4;_0x12f5b7=0xc8;}else{_0x12f5b7=0xce;}_0x5426bc[_0x8d89('0x19')](_0x12f5b7);return _0x5426bc[_0x8d89('0x1f')](_0x8d89('0x20'),_0x14c360+'-'+_0x2fa01f+'/'+_0x7afa4)[_0x8d89('0x21')](_0xd0a8b5);}return null;};}function patchUpdates(_0x5caed1){return function(_0x3eb405){try{jsonpatch[_0x8d89('0x22')](_0x3eb405,_0x5caed1,!![]);}catch(_0x578219){return BPromise[_0x8d89('0x23')](_0x578219);}return _0x3eb405[_0x8d89('0x24')]();};}function saveUpdates(_0x4e4558,_0x2a8f28){return function(_0xcd4a08){if(_0xcd4a08){return _0xcd4a08[_0x8d89('0x25')](_0x4e4558)[_0x8d89('0x26')](function(_0x51e7e1){return _0x51e7e1;});}return null;};}function removeEntity(_0x2bf7f0,_0xdccf09){return function(_0x8f3f7c){if(_0x8f3f7c){return _0x8f3f7c['destroy']()[_0x8d89('0x26')](function(){_0x2bf7f0['status'](0xcc)[_0x8d89('0x1a')]();});}};}function handleEntityNotFound(_0x1b8ef0,_0x97a293){return function(_0x1b68dc){if(!_0x1b68dc){_0x1b8ef0[_0x8d89('0x27')](0x194);}return _0x1b68dc;};}function handleError(_0x18d93c,_0x44f6a9){_0x44f6a9=_0x44f6a9||0x1f4;return function(_0x3a86dc){logger[_0x8d89('0x28')](_0x3a86dc[_0x8d89('0x29')]);if(_0x3a86dc[_0x8d89('0x2a')]){delete _0x3a86dc['name'];}_0x18d93c[_0x8d89('0x19')](_0x44f6a9)[_0x8d89('0x2b')](_0x3a86dc);};}exports[_0x8d89('0x2c')]=function(_0x2213c9,_0x299b93){var _0x529c05={},_0x35c811={},_0x2060e5={'count':0x0,'rows':[]};var _0x4281f2=_[_0x8d89('0x2d')](db[_0x8d89('0x2e')][_0x8d89('0x2f')],function(_0x215d37){return{'name':_0x215d37['fieldName'],'type':_0x215d37[_0x8d89('0x30')][_0x8d89('0x31')]};});_0x35c811['model']=_[_0x8d89('0x2d')](_0x4281f2,_0x8d89('0x2a'));_0x35c811[_0x8d89('0x32')]=_[_0x8d89('0x33')](_0x2213c9[_0x8d89('0x32')]);_0x35c811[_0x8d89('0x34')]=_['intersection'](_0x35c811['model'],_0x35c811[_0x8d89('0x32')]);_0x529c05[_0x8d89('0x35')]=_[_0x8d89('0x36')](_0x35c811['model'],qs[_0x8d89('0x37')](_0x2213c9[_0x8d89('0x32')][_0x8d89('0x37')]));_0x529c05[_0x8d89('0x35')]=_0x529c05[_0x8d89('0x35')][_0x8d89('0x38')]?_0x529c05[_0x8d89('0x35')]:_0x35c811[_0x8d89('0x39')];if(!_0x2213c9[_0x8d89('0x32')]['hasOwnProperty'](_0x8d89('0x3a'))){_0x529c05['limit']=qs[_0x8d89('0x1d')](_0x2213c9[_0x8d89('0x32')][_0x8d89('0x1d')]);_0x529c05[_0x8d89('0x1b')]=qs[_0x8d89('0x1b')](_0x2213c9[_0x8d89('0x32')]['offset']);}_0x529c05[_0x8d89('0x3b')]=qs[_0x8d89('0x3c')](_0x2213c9[_0x8d89('0x32')][_0x8d89('0x3c')]);_0x529c05[_0x8d89('0x3d')]=qs[_0x8d89('0x34')](_[_0x8d89('0x3e')](_0x2213c9[_0x8d89('0x32')],_0x35c811[_0x8d89('0x34')]),_0x4281f2);if(_0x2213c9[_0x8d89('0x32')][_0x8d89('0x3f')]){_0x529c05[_0x8d89('0x3d')]=_['merge'](_0x529c05[_0x8d89('0x3d')],{'$or':_[_0x8d89('0x2d')](_0x4281f2,function(_0x3d483b){if(_0x3d483b[_0x8d89('0x30')]!=='VIRTUAL'){var _0x47839c={};_0x47839c[_0x3d483b['name']]={'$like':'%'+_0x2213c9[_0x8d89('0x32')][_0x8d89('0x3f')]+'%'};return _0x47839c;}})});}_0x529c05=_[_0x8d89('0x40')]({},_0x529c05,_0x2213c9[_0x8d89('0x41')]);var _0x158346={'where':_0x529c05[_0x8d89('0x3d')]};return db[_0x8d89('0x2e')][_0x8d89('0x1e')](_0x158346)[_0x8d89('0x26')](function(_0x49cb93){_0x2060e5['count']=_0x49cb93;if(_0x2213c9['query'][_0x8d89('0x42')]){_0x529c05[_0x8d89('0x43')]=[{'all':!![]}];}return db[_0x8d89('0x2e')][_0x8d89('0x44')](_0x529c05);})[_0x8d89('0x26')](function(_0xc8e6a0){_0x2060e5['rows']=_0xc8e6a0;return _0x2060e5;})['then'](respondWithFilteredResult(_0x299b93,_0x529c05))['catch'](handleError(_0x299b93,null));};exports[_0x8d89('0x45')]=function(_0x1da2b3,_0x124c96){var _0xadf549={'raw':!![],'where':{'id':_0x1da2b3[_0x8d89('0x46')]['id']}},_0x344408={};_0x344408[_0x8d89('0x39')]=_[_0x8d89('0x33')](db[_0x8d89('0x2e')][_0x8d89('0x2f')]);_0x344408['query']=_[_0x8d89('0x33')](_0x1da2b3[_0x8d89('0x32')]);_0x344408[_0x8d89('0x34')]=_[_0x8d89('0x36')](_0x344408['model'],_0x344408['query']);_0xadf549[_0x8d89('0x35')]=_[_0x8d89('0x36')](_0x344408[_0x8d89('0x39')],qs[_0x8d89('0x37')](_0x1da2b3[_0x8d89('0x32')][_0x8d89('0x37')]));_0xadf549[_0x8d89('0x35')]=_0xadf549[_0x8d89('0x35')][_0x8d89('0x38')]?_0xadf549['attributes']:_0x344408['model'];if(_0x1da2b3[_0x8d89('0x32')][_0x8d89('0x42')]){_0xadf549[_0x8d89('0x43')]=[{'all':!![]}];}_0xadf549=_[_0x8d89('0x40')]({},_0xadf549,_0x1da2b3['options']);return db[_0x8d89('0x2e')][_0x8d89('0x47')](_0xadf549)['then'](handleEntityNotFound(_0x124c96,null))[_0x8d89('0x26')](respondWithResult(_0x124c96,null))[_0x8d89('0x48')](handleError(_0x124c96,null));};exports['create']=function(_0x30a01c,_0x54ec3d){return db['SquareReport']['create'](_0x30a01c[_0x8d89('0x49')],{})[_0x8d89('0x26')](respondWithResult(_0x54ec3d,0xc9))['catch'](handleError(_0x54ec3d,null));};exports[_0x8d89('0x25')]=function(_0x1dd692,_0x4d09f9){if(_0x1dd692[_0x8d89('0x49')]['id']){delete _0x1dd692[_0x8d89('0x49')]['id'];}return db[_0x8d89('0x2e')][_0x8d89('0x47')]({'where':{'id':_0x1dd692[_0x8d89('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d09f9,null))[_0x8d89('0x26')](saveUpdates(_0x1dd692[_0x8d89('0x49')],null))[_0x8d89('0x26')](respondWithResult(_0x4d09f9,null))[_0x8d89('0x48')](handleError(_0x4d09f9,null));};exports[_0x8d89('0x4a')]=function(_0x2cac7f,_0x6aa805){return db[_0x8d89('0x2e')][_0x8d89('0x47')]({'where':{'id':_0x2cac7f[_0x8d89('0x46')]['id']}})[_0x8d89('0x26')](handleEntityNotFound(_0x6aa805,null))['then'](removeEntity(_0x6aa805,null))[_0x8d89('0x48')](handleError(_0x6aa805,null));};exports[_0x8d89('0x4b')]=function(_0x5c04f5,_0x337570){return db[_0x8d89('0x2e')][_0x8d89('0x4b')]()[_0x8d89('0x26')](respondWithResult(_0x337570,null))['catch'](handleError(_0x337570,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 54c3fe3..7a1df3a 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 _0x3a48=['moment','request-promise','../../config/environment','./squareReport.attributes','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','../../config/logger','api'];(function(_0x56917a,_0x2c4c82){var _0xe271e4=function(_0x351171){while(--_0x351171){_0x56917a['push'](_0x56917a['shift']());}};_0xe271e4(++_0x2c4c82);}(_0x3a48,0xa6));var _0x83a4=function(_0x127e31,_0x4834f1){_0x127e31=_0x127e31-0x0;var _0x3e21e2=_0x3a48[_0x127e31];return _0x3e21e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x83a4('0x0'))(_0x83a4('0x1'));var moment=require(_0x83a4('0x2'));var BPromise=require('bluebird');var rp=require(_0x83a4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x83a4('0x4'));var attributes=require(_0x83a4('0x5'));module['exports']=function(_0x45c264,_0x4c764b){return _0x45c264['define'](_0x83a4('0x6'),attributes,{'tableName':_0x83a4('0x7'),'paranoid':![],'indexes':[{'name':_0x83a4('0x8'),'fields':[_0x83a4('0x9'),_0x83a4('0xa')]},{'name':'leaveAt','fields':[_0x83a4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5904=['lodash','util','api','bluebird','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0xcefa6,_0x339989){var _0x2e8f17=function(_0x276eea){while(--_0x276eea){_0xcefa6['push'](_0xcefa6['shift']());}};_0x2e8f17(++_0x339989);}(_0x5904,0xb4));var _0x4590=function(_0x35947a,_0x168969){_0x35947a=_0x35947a-0x0;var _0x2bec25=_0x5904[_0x35947a];return _0x2bec25;};'use strict';var _=require(_0x4590('0x0'));var util=require(_0x4590('0x1'));var logger=require('../../config/logger')(_0x4590('0x2'));var moment=require('moment');var BPromise=require(_0x4590('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4590('0x4'));var rimraf=require('rimraf');var config=require(_0x4590('0x5'));var attributes=require(_0x4590('0x6'));module[_0x4590('0x7')]=function(_0x1d900f,_0x5e731d){return _0x1d900f[_0x4590('0x8')](_0x4590('0x9'),attributes,{'tableName':_0x4590('0xa'),'paranoid':![],'indexes':[{'name':_0x4590('0xb'),'fields':[_0x4590('0xc'),_0x4590('0xd')]},{'name':_0x4590('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 31ea83a..3dd46cd 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 _0x065f=['error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','where','attributes','limit','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4724dd,_0x13f2bf){var _0x2fba82=function(_0x3ceb9b){while(--_0x3ceb9b){_0x4724dd['push'](_0x4724dd['shift']());}};_0x2fba82(++_0x13f2bf);}(_0x065f,0x1df));var _0xf065=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x065f[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf065('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf065('0x1'))['db'];var utils=require(_0xf065('0x2'));var logger=require(_0xf065('0x3'))(_0xf065('0x4'));var config=require(_0xf065('0x5'));var jayson=require(_0xf065('0x6'));var client=jayson[_0xf065('0x7')][_0xf065('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1706d9,_0x5a72b3,_0x3b53f5){return new BPromise(function(_0x5d7a43,_0x431be4){return client[_0xf065('0x9')](_0x1706d9,_0x3b53f5)[_0xf065('0xa')](function(_0x50dc79){logger[_0xf065('0xb')](_0xf065('0xc'),_0x5a72b3,_0xf065('0xd'));logger[_0xf065('0xe')](_0xf065('0xf'),_0x5a72b3,'request\x20sent',JSON[_0xf065('0x10')](_0x50dc79));if(_0x50dc79[_0xf065('0x11')]){if(_0x50dc79[_0xf065('0x11')][_0xf065('0x12')]===0x1f4){logger[_0xf065('0x11')](_0xf065('0xc'),_0x5a72b3,_0x50dc79[_0xf065('0x11')][_0xf065('0x13')]);return _0x431be4(_0x50dc79[_0xf065('0x11')]['message']);}logger['error'](_0xf065('0xc'),_0x5a72b3,_0x50dc79[_0xf065('0x11')]['message']);return _0x5d7a43(_0x50dc79[_0xf065('0x11')][_0xf065('0x13')]);}else{logger[_0xf065('0xb')](_0xf065('0xc'),_0x5a72b3,_0xf065('0xd'));_0x5d7a43(_0x50dc79[_0xf065('0x14')]['message']);}})[_0xf065('0x15')](function(_0x46a5c7){logger[_0xf065('0x11')](_0xf065('0xc'),_0x5a72b3,_0x46a5c7);_0x431be4(_0x46a5c7);});});}exports[_0xf065('0x16')]=function(_0x54dc40){var _0x5940f0=this;return new Promise(function(_0x3f7714,_0x3eef49){return db[_0xf065('0x17')][_0xf065('0x18')](_0x54dc40['body'],{'raw':_0x54dc40['options']?_0x54dc40[_0xf065('0x19')][_0xf065('0x1a')]===undefined?!![]:![]:!![]})[_0xf065('0xa')](function(_0xb11de3){logger['info']('CreateSquareReport',_0x54dc40);logger['debug'](_0xf065('0x16'),_0x54dc40,JSON[_0xf065('0x10')](_0xb11de3));_0x3f7714(_0xb11de3);})[_0xf065('0x15')](function(_0x291874){logger[_0xf065('0x11')](_0xf065('0x16'),_0x291874[_0xf065('0x13')],_0x54dc40);_0x3eef49(_0x5940f0[_0xf065('0x11')](0x1f4,_0x291874[_0xf065('0x13')]));});});};exports[_0xf065('0x1b')]=function(_0x400b71){var _0xb04883=this;return new Promise(function(_0x48e7dc,_0x39c62e){return db[_0xf065('0x17')]['update'](_0x400b71['body'],{'raw':_0x400b71['options']?_0x400b71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400b71[_0xf065('0x19')]?_0x400b71[_0xf065('0x19')][_0xf065('0x1c')]||null:null,'attributes':_0x400b71[_0xf065('0x19')]?_0x400b71[_0xf065('0x19')][_0xf065('0x1d')]||null:null,'limit':_0x400b71['options']?_0x400b71[_0xf065('0x19')][_0xf065('0x1e')]||null:null})[_0xf065('0xa')](function(_0x1193e4){logger[_0xf065('0xb')](_0xf065('0x1b'),_0x400b71);logger[_0xf065('0xe')]('UpdateSquareReport',_0x400b71,JSON[_0xf065('0x10')](_0x1193e4));_0x48e7dc(_0x1193e4);})[_0xf065('0x15')](function(_0x4f864b){logger[_0xf065('0x11')](_0xf065('0x1b'),_0x4f864b[_0xf065('0x13')],_0x400b71);_0x39c62e(_0xb04883[_0xf065('0x11')](0x1f4,_0x4f864b['message']));});});}; \ No newline at end of file +var _0x2f82=['stringify','error','message','catch','CreateSquareReport','SquareReport','create','body','update','options','raw','where','attributes','limit','info','UpdateSquareReport','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x5aa373,_0x54c7f4){var _0x590e8e=function(_0x505e62){while(--_0x505e62){_0x5aa373['push'](_0x5aa373['shift']());}};_0x590e8e(++_0x54c7f4);}(_0x2f82,0x11e));var _0x22f8=function(_0x112e6a,_0x4dfc41){_0x112e6a=_0x112e6a-0x0;var _0x1b691b=_0x2f82[_0x112e6a];return _0x1b691b;};'use strict';var _=require(_0x22f8('0x0'));var util=require(_0x22f8('0x1'));var moment=require(_0x22f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x22f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22f8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x22f8('0x5'));var config=require(_0x22f8('0x6'));var jayson=require(_0x22f8('0x7'));var client=jayson['client'][_0x22f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f5b8c,_0x35f5f0,_0x5a21be){return new BPromise(function(_0x371775,_0x260990){return client['request'](_0x3f5b8c,_0x5a21be)[_0x22f8('0x9')](function(_0x36e697){logger['info'](_0x22f8('0xa'),_0x35f5f0,_0x22f8('0xb'));logger[_0x22f8('0xc')](_0x22f8('0xd'),_0x35f5f0,_0x22f8('0xb'),JSON[_0x22f8('0xe')](_0x36e697));if(_0x36e697[_0x22f8('0xf')]){if(_0x36e697['error']['code']===0x1f4){logger[_0x22f8('0xf')]('SquareReport,\x20%s,\x20%s',_0x35f5f0,_0x36e697[_0x22f8('0xf')][_0x22f8('0x10')]);return _0x260990(_0x36e697['error'][_0x22f8('0x10')]);}logger['error'](_0x22f8('0xa'),_0x35f5f0,_0x36e697[_0x22f8('0xf')]['message']);return _0x371775(_0x36e697[_0x22f8('0xf')]['message']);}else{logger['info'](_0x22f8('0xa'),_0x35f5f0,_0x22f8('0xb'));_0x371775(_0x36e697['result']['message']);}})[_0x22f8('0x11')](function(_0x30a5be){logger[_0x22f8('0xf')]('SquareReport,\x20%s,\x20%s',_0x35f5f0,_0x30a5be);_0x260990(_0x30a5be);});});}exports[_0x22f8('0x12')]=function(_0x39bbc1){var _0x31cbf1=this;return new Promise(function(_0x54be5e,_0x3f9646){return db[_0x22f8('0x13')][_0x22f8('0x14')](_0x39bbc1[_0x22f8('0x15')],{'raw':_0x39bbc1['options']?_0x39bbc1['options']['raw']===undefined?!![]:![]:!![]})[_0x22f8('0x9')](function(_0x173b25){logger['info']('CreateSquareReport',_0x39bbc1);logger[_0x22f8('0xc')](_0x22f8('0x12'),_0x39bbc1,JSON[_0x22f8('0xe')](_0x173b25));_0x54be5e(_0x173b25);})[_0x22f8('0x11')](function(_0x51e25a){logger['error'](_0x22f8('0x12'),_0x51e25a[_0x22f8('0x10')],_0x39bbc1);_0x3f9646(_0x31cbf1[_0x22f8('0xf')](0x1f4,_0x51e25a[_0x22f8('0x10')]));});});};exports['UpdateSquareReport']=function(_0x4d4d18){var _0x1c1da8=this;return new Promise(function(_0x3236b4,_0x24402e){return db[_0x22f8('0x13')][_0x22f8('0x16')](_0x4d4d18[_0x22f8('0x15')],{'raw':_0x4d4d18['options']?_0x4d4d18[_0x22f8('0x17')][_0x22f8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d4d18[_0x22f8('0x17')]?_0x4d4d18[_0x22f8('0x17')][_0x22f8('0x19')]||null:null,'attributes':_0x4d4d18['options']?_0x4d4d18[_0x22f8('0x17')][_0x22f8('0x1a')]||null:null,'limit':_0x4d4d18[_0x22f8('0x17')]?_0x4d4d18[_0x22f8('0x17')][_0x22f8('0x1b')]||null:null})['then'](function(_0x522e1c){logger[_0x22f8('0x1c')](_0x22f8('0x1d'),_0x4d4d18);logger['debug'](_0x22f8('0x1d'),_0x4d4d18,JSON[_0x22f8('0xe')](_0x522e1c));_0x3236b4(_0x522e1c);})[_0x22f8('0x11')](function(_0x15005e){logger[_0x22f8('0xf')](_0x22f8('0x1d'),_0x15005e[_0x22f8('0x10')],_0x4d4d18);_0x24402e(_0x1c1da8['error'](0x1f4,_0x15005e[_0x22f8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 93bc6da..fd2c1d8 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 _0x90e3=['describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe'];(function(_0x95184b,_0x6fa6ce){var _0x849bfb=function(_0xb116ae){while(--_0xb116ae){_0x95184b['push'](_0x95184b['shift']());}};_0x849bfb(++_0x6fa6ce);}(_0x90e3,0xbb));var _0x390e=function(_0x54fe1c,_0x5d208c){_0x54fe1c=_0x54fe1c-0x0;var _0x460aaa=_0x90e3[_0x54fe1c];return _0x460aaa;};'use strict';var multer=require(_0x390e('0x0'));var util=require(_0x390e('0x1'));var path=require(_0x390e('0x2'));var timeout=require(_0x390e('0x3'));var express=require(_0x390e('0x4'));var router=express['Router']();var fs_extra=require(_0x390e('0x5'));var auth=require(_0x390e('0x6'));var interaction=require(_0x390e('0x7'));var config=require('../../config/environment');var controller=require(_0x390e('0x8'));router[_0x390e('0x9')]('/',auth[_0x390e('0xa')](),controller[_0x390e('0xb')]);router['get'](_0x390e('0xc'),auth[_0x390e('0xa')](),controller[_0x390e('0xd')]);router[_0x390e('0x9')](_0x390e('0xe'),auth[_0x390e('0xa')](),controller[_0x390e('0xf')]);router[_0x390e('0x10')]('/',auth['isAuthenticated'](),controller[_0x390e('0x11')]);router['put'](_0x390e('0xe'),auth[_0x390e('0xa')](),controller['update']);router[_0x390e('0x12')](_0x390e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x390e('0x13')]=router; \ No newline at end of file +var _0xdf89=['get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf89,0xdb));var _0x9df8=function(_0x36eb1b,_0x246fee){_0x36eb1b=_0x36eb1b-0x0;var _0x23e445=_0xdf89[_0x36eb1b];return _0x23e445;};'use strict';var multer=require(_0x9df8('0x0'));var util=require(_0x9df8('0x1'));var path=require(_0x9df8('0x2'));var timeout=require(_0x9df8('0x3'));var express=require(_0x9df8('0x4'));var router=express[_0x9df8('0x5')]();var fs_extra=require(_0x9df8('0x6'));var auth=require(_0x9df8('0x7'));var interaction=require(_0x9df8('0x8'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x9df8('0x9')]('/',auth[_0x9df8('0xa')](),controller[_0x9df8('0xb')]);router[_0x9df8('0x9')](_0x9df8('0xc'),auth[_0x9df8('0xa')](),controller['describe']);router[_0x9df8('0x9')](_0x9df8('0xd'),auth['isAuthenticated'](),controller[_0x9df8('0xe')]);router['post']('/',auth[_0x9df8('0xa')](),controller[_0x9df8('0xf')]);router['put'](_0x9df8('0xd'),auth[_0x9df8('0xa')](),controller[_0x9df8('0x10')]);router[_0x9df8('0x11')](_0x9df8('0xd'),auth[_0x9df8('0xa')](),controller[_0x9df8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index c31f0ba..8c28bd7 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 _0x6435=['sequelize','exports','STRING'];(function(_0x45c4d0,_0x32d023){var _0xdfc3f4=function(_0x28cb00){while(--_0x28cb00){_0x45c4d0['push'](_0x45c4d0['shift']());}};_0xdfc3f4(++_0x32d023);}(_0x6435,0x1f2));var _0x5643=function(_0xc27cd,_0x3dc0cf){_0xc27cd=_0xc27cd-0x0;var _0x94f653=_0x6435[_0xc27cd];return _0x94f653;};'use strict';var Sequelize=require(_0x5643('0x0'));module[_0x5643('0x1')]={'uniqueid':{'type':Sequelize[_0x5643('0x2')]},'node':{'type':Sequelize[_0x5643('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x5643('0x2')]},'callerid':{'type':Sequelize[_0x5643('0x2')]}}; \ No newline at end of file +var _0x8486=['STRING','TEXT','sequelize','exports'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x8486,0x166));var _0x6848=function(_0x3f1351,_0x1ccd5a){_0x3f1351=_0x3f1351-0x0;var _0xc97417=_0x8486[_0x3f1351];return _0xc97417;};'use strict';var Sequelize=require(_0x6848('0x0'));module[_0x6848('0x1')]={'uniqueid':{'type':Sequelize[_0x6848('0x2')]},'node':{'type':Sequelize[_0x6848('0x2')]},'application':{'type':Sequelize[_0x6848('0x2')]},'data':{'type':Sequelize[_0x6848('0x3')]},'project_name':{'type':Sequelize[_0x6848('0x2')]},'callerid':{'type':Sequelize[_0x6848('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 142f488..94cbe13 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 _0x97d4=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','SquareDetailsReport','includeAll','include','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x5a31d8,_0x22f9ef){var _0x31e74d=function(_0x408e74){while(--_0x408e74){_0x5a31d8['push'](_0x5a31d8['shift']());}};_0x31e74d(++_0x22f9ef);}(_0x97d4,0x1d0));var _0x497d=function(_0x5dd351,_0x19ebc5){_0x5dd351=_0x5dd351-0x0;var _0x1fbdba=_0x97d4[_0x5dd351];return _0x1fbdba;};'use strict';var emlformat=require(_0x497d('0x0'));var rimraf=require(_0x497d('0x1'));var zipdir=require(_0x497d('0x2'));var jsonpatch=require(_0x497d('0x3'));var rp=require(_0x497d('0x4'));var moment=require(_0x497d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x497d('0x6'));var util=require(_0x497d('0x7'));var path=require(_0x497d('0x8'));var sox=require(_0x497d('0x9'));var csv=require('to-csv');var ejs=require(_0x497d('0xa'));var fs=require('fs');var fs_extra=require(_0x497d('0xb'));var _=require(_0x497d('0xc'));var squel=require('squel');var crypto=require(_0x497d('0xd'));var jsforce=require(_0x497d('0xe'));var deskjs=require(_0x497d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x497d('0x10'));var Redis=require(_0x497d('0x11'));var authService=require(_0x497d('0x12'));var qs=require(_0x497d('0x13'));var as=require(_0x497d('0x14'));var hardwareService=require(_0x497d('0x15'));var logger=require(_0x497d('0x16'))(_0x497d('0x17'));var utils=require(_0x497d('0x18'));var config=require(_0x497d('0x19'));var licenseUtil=require(_0x497d('0x1a'));var db=require(_0x497d('0x1b'))['db'];function respondWithStatusCode(_0x5c678d,_0x3b93c7){_0x3b93c7=_0x3b93c7||0xcc;return function(_0x33392f){if(_0x33392f){return _0x5c678d[_0x497d('0x1c')](_0x3b93c7);}return _0x5c678d[_0x497d('0x1d')](_0x3b93c7)[_0x497d('0x1e')]();};}function respondWithResult(_0x3757d6,_0x3f5a11){_0x3f5a11=_0x3f5a11||0xc8;return function(_0x57b9f0){if(_0x57b9f0){return _0x3757d6['status'](_0x3f5a11)['json'](_0x57b9f0);}};}function respondWithFilteredResult(_0x2301bc,_0x54b018){return function(_0x27d5e2){if(_0x27d5e2){var _0x1ed7e8=typeof _0x54b018[_0x497d('0x1f')]===_0x497d('0x20')&&typeof _0x54b018[_0x497d('0x21')]==='undefined';var _0x2037bb=_0x27d5e2[_0x497d('0x22')];var _0x6e211f=_0x1ed7e8?0x0:_0x54b018[_0x497d('0x1f')];var _0x99096d=_0x1ed7e8?_0x27d5e2[_0x497d('0x22')]:_0x54b018[_0x497d('0x1f')]+_0x54b018[_0x497d('0x21')];var _0x177fc5;if(_0x99096d>=_0x2037bb){_0x99096d=_0x2037bb;_0x177fc5=0xc8;}else{_0x177fc5=0xce;}_0x2301bc[_0x497d('0x1d')](_0x177fc5);return _0x2301bc[_0x497d('0x23')](_0x497d('0x24'),_0x6e211f+'-'+_0x99096d+'/'+_0x2037bb)[_0x497d('0x25')](_0x27d5e2);}return null;};}function patchUpdates(_0x22292b){return function(_0xdbbd1f){try{jsonpatch[_0x497d('0x26')](_0xdbbd1f,_0x22292b,!![]);}catch(_0x5b8eeb){return BPromise[_0x497d('0x27')](_0x5b8eeb);}return _0xdbbd1f[_0x497d('0x28')]();};}function saveUpdates(_0x4e777d,_0x4fd748){return function(_0x308bf9){if(_0x308bf9){return _0x308bf9['update'](_0x4e777d)[_0x497d('0x29')](function(_0x375179){return _0x375179;});}return null;};}function removeEntity(_0xcc482e,_0x39e420){return function(_0x4e9d1c){if(_0x4e9d1c){return _0x4e9d1c[_0x497d('0x2a')]()[_0x497d('0x29')](function(){_0xcc482e[_0x497d('0x1d')](0xcc)[_0x497d('0x1e')]();});}};}function handleEntityNotFound(_0xc65794,_0x5b3a05){return function(_0x33106b){if(!_0x33106b){_0xc65794['sendStatus'](0x194);}return _0x33106b;};}function handleError(_0x203dba,_0x1f157f){_0x1f157f=_0x1f157f||0x1f4;return function(_0x358b9c){logger[_0x497d('0x2b')](_0x358b9c['stack']);if(_0x358b9c[_0x497d('0x2c')]){delete _0x358b9c['name'];}_0x203dba[_0x497d('0x1d')](_0x1f157f)['send'](_0x358b9c);};}exports[_0x497d('0x2d')]=function(_0x1f40bb,_0x341a38){var _0x347592={},_0x104bb7={},_0x36d3f4={'count':0x0,'rows':[]};var _0x29a8ac=_[_0x497d('0x2e')](db['SquareDetailsReport'][_0x497d('0x2f')],function(_0x12d2ec){return{'name':_0x12d2ec[_0x497d('0x30')],'type':_0x12d2ec[_0x497d('0x31')][_0x497d('0x32')]};});_0x104bb7[_0x497d('0x33')]=_[_0x497d('0x2e')](_0x29a8ac,_0x497d('0x2c'));_0x104bb7[_0x497d('0x34')]=_[_0x497d('0x35')](_0x1f40bb[_0x497d('0x34')]);_0x104bb7['filters']=_[_0x497d('0x36')](_0x104bb7['model'],_0x104bb7[_0x497d('0x34')]);_0x347592['attributes']=_[_0x497d('0x36')](_0x104bb7['model'],qs[_0x497d('0x37')](_0x1f40bb[_0x497d('0x34')][_0x497d('0x37')]));_0x347592['attributes']=_0x347592[_0x497d('0x38')][_0x497d('0x39')]?_0x347592[_0x497d('0x38')]:_0x104bb7[_0x497d('0x33')];if(!_0x1f40bb[_0x497d('0x34')][_0x497d('0x3a')](_0x497d('0x3b'))){_0x347592[_0x497d('0x21')]=qs[_0x497d('0x21')](_0x1f40bb[_0x497d('0x34')]['limit']);_0x347592[_0x497d('0x1f')]=qs[_0x497d('0x1f')](_0x1f40bb['query']['offset']);}_0x347592[_0x497d('0x3c')]=qs[_0x497d('0x3d')](_0x1f40bb[_0x497d('0x34')][_0x497d('0x3d')]);_0x347592['where']=qs[_0x497d('0x3e')](_[_0x497d('0x3f')](_0x1f40bb['query'],_0x104bb7[_0x497d('0x3e')]),_0x29a8ac);if(_0x1f40bb[_0x497d('0x34')][_0x497d('0x40')]){_0x347592['where']=_[_0x497d('0x41')](_0x347592[_0x497d('0x42')],{'$or':_[_0x497d('0x2e')](_0x29a8ac,function(_0x4453c7){if(_0x4453c7[_0x497d('0x31')]!==_0x497d('0x43')){var _0x5c6e92={};_0x5c6e92[_0x4453c7['name']]={'$like':'%'+_0x1f40bb[_0x497d('0x34')][_0x497d('0x40')]+'%'};return _0x5c6e92;}})});}_0x347592=_[_0x497d('0x41')]({},_0x347592,_0x1f40bb['options']);var _0x3a9b0d={'where':_0x347592[_0x497d('0x42')]};return db[_0x497d('0x44')][_0x497d('0x22')](_0x3a9b0d)[_0x497d('0x29')](function(_0x230eca){_0x36d3f4[_0x497d('0x22')]=_0x230eca;if(_0x1f40bb['query'][_0x497d('0x45')]){_0x347592[_0x497d('0x46')]=[{'all':!![]}];}return db[_0x497d('0x44')]['findAll'](_0x347592);})[_0x497d('0x29')](function(_0x30f534){_0x36d3f4[_0x497d('0x47')]=_0x30f534;return _0x36d3f4;})[_0x497d('0x29')](respondWithFilteredResult(_0x341a38,_0x347592))[_0x497d('0x48')](handleError(_0x341a38,null));};exports[_0x497d('0x49')]=function(_0xbcde69,_0x20b0d6){var _0x26fbdf={'raw':!![],'where':{'id':_0xbcde69[_0x497d('0x4a')]['id']}},_0x168664={};_0x168664[_0x497d('0x33')]=_[_0x497d('0x35')](db[_0x497d('0x44')]['rawAttributes']);_0x168664['query']=_[_0x497d('0x35')](_0xbcde69['query']);_0x168664[_0x497d('0x3e')]=_[_0x497d('0x36')](_0x168664[_0x497d('0x33')],_0x168664[_0x497d('0x34')]);_0x26fbdf[_0x497d('0x38')]=_['intersection'](_0x168664[_0x497d('0x33')],qs['fields'](_0xbcde69[_0x497d('0x34')][_0x497d('0x37')]));_0x26fbdf[_0x497d('0x38')]=_0x26fbdf[_0x497d('0x38')]['length']?_0x26fbdf['attributes']:_0x168664[_0x497d('0x33')];if(_0xbcde69[_0x497d('0x34')][_0x497d('0x45')]){_0x26fbdf[_0x497d('0x46')]=[{'all':!![]}];}_0x26fbdf=_[_0x497d('0x41')]({},_0x26fbdf,_0xbcde69['options']);return db[_0x497d('0x44')][_0x497d('0x4b')](_0x26fbdf)[_0x497d('0x29')](handleEntityNotFound(_0x20b0d6,null))[_0x497d('0x29')](respondWithResult(_0x20b0d6,null))[_0x497d('0x48')](handleError(_0x20b0d6,null));};exports[_0x497d('0x4c')]=function(_0x2aac17,_0x36f543){return db[_0x497d('0x44')][_0x497d('0x4c')](_0x2aac17[_0x497d('0x4d')],{})[_0x497d('0x29')](respondWithResult(_0x36f543,0xc9))[_0x497d('0x48')](handleError(_0x36f543,null));};exports[_0x497d('0x4e')]=function(_0x453afb,_0x2ed986){if(_0x453afb[_0x497d('0x4d')]['id']){delete _0x453afb[_0x497d('0x4d')]['id'];}return db['SquareDetailsReport'][_0x497d('0x4b')]({'where':{'id':_0x453afb[_0x497d('0x4a')]['id']}})[_0x497d('0x29')](handleEntityNotFound(_0x2ed986,null))[_0x497d('0x29')](saveUpdates(_0x453afb[_0x497d('0x4d')],null))['then'](respondWithResult(_0x2ed986,null))[_0x497d('0x48')](handleError(_0x2ed986,null));};exports['destroy']=function(_0x64b845,_0x347f23){return db[_0x497d('0x44')]['find']({'where':{'id':_0x64b845[_0x497d('0x4a')]['id']}})[_0x497d('0x29')](handleEntityNotFound(_0x347f23,null))[_0x497d('0x29')](removeEntity(_0x347f23,null))[_0x497d('0x48')](handleError(_0x347f23,null));};exports[_0x497d('0x4f')]=function(_0x18277e,_0x29c7a8){return db['SquareDetailsReport']['describe']()[_0x497d('0x29')](respondWithResult(_0x29c7a8,null))[_0x497d('0x48')](handleError(_0x29c7a8,null));}; \ No newline at end of file +var _0xaff5=['update','destroy','sendStatus','error','stack','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','where','pick','merge','VIRTUAL','name','filter','options','SquareDetailsReport','includeAll','findAll','then','rows','catch','show','params','length','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save'];(function(_0x474dd0,_0x464ac3){var _0x304f8c=function(_0x5720f4){while(--_0x5720f4){_0x474dd0['push'](_0x474dd0['shift']());}};_0x304f8c(++_0x464ac3);}(_0xaff5,0x1e4));var _0x5aff=function(_0x4a691c,_0x23866e){_0x4a691c=_0x4a691c-0x0;var _0x2f587d=_0xaff5[_0x4a691c];return _0x2f587d;};'use strict';var emlformat=require(_0x5aff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5aff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5aff('0x2'));var moment=require(_0x5aff('0x3'));var BPromise=require(_0x5aff('0x4'));var Mustache=require(_0x5aff('0x5'));var util=require(_0x5aff('0x6'));var path=require(_0x5aff('0x7'));var sox=require(_0x5aff('0x8'));var csv=require(_0x5aff('0x9'));var ejs=require(_0x5aff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5aff('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5aff('0xc'));var deskjs=require(_0x5aff('0xd'));var toCsv=require(_0x5aff('0x9'));var querystring=require('querystring');var Papa=require(_0x5aff('0xe'));var Redis=require(_0x5aff('0xf'));var authService=require(_0x5aff('0x10'));var qs=require(_0x5aff('0x11'));var as=require(_0x5aff('0x12'));var hardwareService=require(_0x5aff('0x13'));var logger=require(_0x5aff('0x14'))('api');var utils=require(_0x5aff('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5aff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a82b3,_0x530ba6){_0x530ba6=_0x530ba6||0xcc;return function(_0x4c0689){if(_0x4c0689){return _0x2a82b3['sendStatus'](_0x530ba6);}return _0x2a82b3[_0x5aff('0x17')](_0x530ba6)[_0x5aff('0x18')]();};}function respondWithResult(_0x44ad7d,_0x46a7f9){_0x46a7f9=_0x46a7f9||0xc8;return function(_0x12a5ba){if(_0x12a5ba){return _0x44ad7d[_0x5aff('0x17')](_0x46a7f9)[_0x5aff('0x19')](_0x12a5ba);}};}function respondWithFilteredResult(_0x166db1,_0xdcf654){return function(_0x3faf4f){if(_0x3faf4f){var _0x4b879b=typeof _0xdcf654[_0x5aff('0x1a')]===_0x5aff('0x1b')&&typeof _0xdcf654[_0x5aff('0x1c')]===_0x5aff('0x1b');var _0x1eed0f=_0x3faf4f[_0x5aff('0x1d')];var _0x3e36e1=_0x4b879b?0x0:_0xdcf654[_0x5aff('0x1a')];var _0x3d6190=_0x4b879b?_0x3faf4f[_0x5aff('0x1d')]:_0xdcf654[_0x5aff('0x1a')]+_0xdcf654[_0x5aff('0x1c')];var _0x33644c;if(_0x3d6190>=_0x1eed0f){_0x3d6190=_0x1eed0f;_0x33644c=0xc8;}else{_0x33644c=0xce;}_0x166db1['status'](_0x33644c);return _0x166db1[_0x5aff('0x1e')](_0x5aff('0x1f'),_0x3e36e1+'-'+_0x3d6190+'/'+_0x1eed0f)[_0x5aff('0x19')](_0x3faf4f);}return null;};}function patchUpdates(_0x492b89){return function(_0x249ed5){try{jsonpatch['apply'](_0x249ed5,_0x492b89,!![]);}catch(_0x24167a){return BPromise[_0x5aff('0x20')](_0x24167a);}return _0x249ed5[_0x5aff('0x21')]();};}function saveUpdates(_0x445add,_0xe44c7){return function(_0x30375d){if(_0x30375d){return _0x30375d[_0x5aff('0x22')](_0x445add)['then'](function(_0x12a3cc){return _0x12a3cc;});}return null;};}function removeEntity(_0x235d80,_0x521cba){return function(_0x1601df){if(_0x1601df){return _0x1601df[_0x5aff('0x23')]()['then'](function(){_0x235d80[_0x5aff('0x17')](0xcc)[_0x5aff('0x18')]();});}};}function handleEntityNotFound(_0x24651e,_0x3c9eed){return function(_0x5e5f8c){if(!_0x5e5f8c){_0x24651e[_0x5aff('0x24')](0x194);}return _0x5e5f8c;};}function handleError(_0x35e541,_0x49e07e){_0x49e07e=_0x49e07e||0x1f4;return function(_0x1faa52){logger[_0x5aff('0x25')](_0x1faa52[_0x5aff('0x26')]);if(_0x1faa52['name']){delete _0x1faa52['name'];}_0x35e541[_0x5aff('0x17')](_0x49e07e)[_0x5aff('0x27')](_0x1faa52);};}exports['index']=function(_0x3fb883,_0x593742){var _0x184d8e={},_0x25e2a7={},_0xd4fcdc={'count':0x0,'rows':[]};var _0x2e6344=_[_0x5aff('0x28')](db['SquareDetailsReport'][_0x5aff('0x29')],function(_0x3a03ff){return{'name':_0x3a03ff[_0x5aff('0x2a')],'type':_0x3a03ff[_0x5aff('0x2b')][_0x5aff('0x2c')]};});_0x25e2a7['model']=_[_0x5aff('0x28')](_0x2e6344,'name');_0x25e2a7[_0x5aff('0x2d')]=_[_0x5aff('0x2e')](_0x3fb883[_0x5aff('0x2d')]);_0x25e2a7[_0x5aff('0x2f')]=_[_0x5aff('0x30')](_0x25e2a7['model'],_0x25e2a7['query']);_0x184d8e[_0x5aff('0x31')]=_[_0x5aff('0x30')](_0x25e2a7[_0x5aff('0x32')],qs['fields'](_0x3fb883[_0x5aff('0x2d')][_0x5aff('0x33')]));_0x184d8e[_0x5aff('0x31')]=_0x184d8e[_0x5aff('0x31')]['length']?_0x184d8e[_0x5aff('0x31')]:_0x25e2a7[_0x5aff('0x32')];if(!_0x3fb883[_0x5aff('0x2d')]['hasOwnProperty'](_0x5aff('0x34'))){_0x184d8e['limit']=qs[_0x5aff('0x1c')](_0x3fb883[_0x5aff('0x2d')][_0x5aff('0x1c')]);_0x184d8e['offset']=qs['offset'](_0x3fb883['query'][_0x5aff('0x1a')]);}_0x184d8e[_0x5aff('0x35')]=qs['sort'](_0x3fb883[_0x5aff('0x2d')]['sort']);_0x184d8e[_0x5aff('0x36')]=qs[_0x5aff('0x2f')](_[_0x5aff('0x37')](_0x3fb883[_0x5aff('0x2d')],_0x25e2a7[_0x5aff('0x2f')]),_0x2e6344);if(_0x3fb883[_0x5aff('0x2d')]['filter']){_0x184d8e[_0x5aff('0x36')]=_[_0x5aff('0x38')](_0x184d8e['where'],{'$or':_[_0x5aff('0x28')](_0x2e6344,function(_0x2c5904){if(_0x2c5904['type']!==_0x5aff('0x39')){var _0x545c9d={};_0x545c9d[_0x2c5904[_0x5aff('0x3a')]]={'$like':'%'+_0x3fb883['query'][_0x5aff('0x3b')]+'%'};return _0x545c9d;}})});}_0x184d8e=_['merge']({},_0x184d8e,_0x3fb883[_0x5aff('0x3c')]);var _0x1ca94a={'where':_0x184d8e[_0x5aff('0x36')]};return db[_0x5aff('0x3d')][_0x5aff('0x1d')](_0x1ca94a)['then'](function(_0x3c5ecc){_0xd4fcdc[_0x5aff('0x1d')]=_0x3c5ecc;if(_0x3fb883['query'][_0x5aff('0x3e')]){_0x184d8e['include']=[{'all':!![]}];}return db[_0x5aff('0x3d')][_0x5aff('0x3f')](_0x184d8e);})[_0x5aff('0x40')](function(_0x48caed){_0xd4fcdc[_0x5aff('0x41')]=_0x48caed;return _0xd4fcdc;})[_0x5aff('0x40')](respondWithFilteredResult(_0x593742,_0x184d8e))[_0x5aff('0x42')](handleError(_0x593742,null));};exports[_0x5aff('0x43')]=function(_0xeacfa6,_0x16bc6d){var _0x3238fe={'raw':!![],'where':{'id':_0xeacfa6[_0x5aff('0x44')]['id']}},_0x66fe5b={};_0x66fe5b[_0x5aff('0x32')]=_['keys'](db[_0x5aff('0x3d')][_0x5aff('0x29')]);_0x66fe5b[_0x5aff('0x2d')]=_[_0x5aff('0x2e')](_0xeacfa6[_0x5aff('0x2d')]);_0x66fe5b[_0x5aff('0x2f')]=_['intersection'](_0x66fe5b[_0x5aff('0x32')],_0x66fe5b[_0x5aff('0x2d')]);_0x3238fe[_0x5aff('0x31')]=_[_0x5aff('0x30')](_0x66fe5b['model'],qs[_0x5aff('0x33')](_0xeacfa6[_0x5aff('0x2d')]['fields']));_0x3238fe[_0x5aff('0x31')]=_0x3238fe[_0x5aff('0x31')][_0x5aff('0x45')]?_0x3238fe[_0x5aff('0x31')]:_0x66fe5b['model'];if(_0xeacfa6[_0x5aff('0x2d')][_0x5aff('0x3e')]){_0x3238fe['include']=[{'all':!![]}];}_0x3238fe=_[_0x5aff('0x38')]({},_0x3238fe,_0xeacfa6['options']);return db['SquareDetailsReport'][_0x5aff('0x46')](_0x3238fe)['then'](handleEntityNotFound(_0x16bc6d,null))[_0x5aff('0x40')](respondWithResult(_0x16bc6d,null))[_0x5aff('0x42')](handleError(_0x16bc6d,null));};exports[_0x5aff('0x47')]=function(_0x33b018,_0x2b0e82){return db[_0x5aff('0x3d')][_0x5aff('0x47')](_0x33b018[_0x5aff('0x48')],{})['then'](respondWithResult(_0x2b0e82,0xc9))[_0x5aff('0x42')](handleError(_0x2b0e82,null));};exports[_0x5aff('0x22')]=function(_0x2c6a0a,_0x16d1fc){if(_0x2c6a0a['body']['id']){delete _0x2c6a0a[_0x5aff('0x48')]['id'];}return db[_0x5aff('0x3d')]['find']({'where':{'id':_0x2c6a0a[_0x5aff('0x44')]['id']}})[_0x5aff('0x40')](handleEntityNotFound(_0x16d1fc,null))[_0x5aff('0x40')](saveUpdates(_0x2c6a0a['body'],null))[_0x5aff('0x40')](respondWithResult(_0x16d1fc,null))['catch'](handleError(_0x16d1fc,null));};exports['destroy']=function(_0x3da1be,_0x38c3bd){return db['SquareDetailsReport'][_0x5aff('0x46')]({'where':{'id':_0x3da1be[_0x5aff('0x44')]['id']}})[_0x5aff('0x40')](handleEntityNotFound(_0x38c3bd,null))[_0x5aff('0x40')](removeEntity(_0x38c3bd,null))[_0x5aff('0x42')](handleError(_0x38c3bd,null));};exports[_0x5aff('0x49')]=function(_0x3c9466,_0x51cc82){return db[_0x5aff('0x3d')][_0x5aff('0x49')]()['then'](respondWithResult(_0x51cc82,null))[_0x5aff('0x42')](handleError(_0x51cc82,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 9379ac9..ebbfd64 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 _0x806a=['../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','api','moment','path'];(function(_0x328b61,_0x3c35c2){var _0x1cc1d1=function(_0x3a9623){while(--_0x3a9623){_0x328b61['push'](_0x328b61['shift']());}};_0x1cc1d1(++_0x3c35c2);}(_0x806a,0x1bd));var _0xa806=function(_0x4930ca,_0x15bf7a){_0x4930ca=_0x4930ca-0x0;var _0x396f3e=_0x806a[_0x4930ca];return _0x396f3e;};'use strict';var _=require(_0xa806('0x0'));var util=require(_0xa806('0x1'));var logger=require('../../config/logger')(_0xa806('0x2'));var moment=require(_0xa806('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa806('0x4'));var rimraf=require('rimraf');var config=require(_0xa806('0x5'));var attributes=require(_0xa806('0x6'));module[_0xa806('0x7')]=function(_0x2ff4b7,_0x2bfc3e){return _0x2ff4b7[_0xa806('0x8')]('SquareDetailsReport',attributes,{'tableName':_0xa806('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e2=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xb7e2,0x141));var _0x2b7e=function(_0x39b3ce,_0x225ffc){_0x39b3ce=_0x39b3ce-0x0;var _0x4b7259=_0xb7e2[_0x39b3ce];return _0x4b7259;};'use strict';var _=require(_0x2b7e('0x0'));var util=require(_0x2b7e('0x1'));var logger=require(_0x2b7e('0x2'))(_0x2b7e('0x3'));var moment=require(_0x2b7e('0x4'));var BPromise=require(_0x2b7e('0x5'));var rp=require(_0x2b7e('0x6'));var fs=require('fs');var path=require(_0x2b7e('0x7'));var rimraf=require(_0x2b7e('0x8'));var config=require(_0x2b7e('0x9'));var attributes=require(_0x2b7e('0xa'));module[_0x2b7e('0xb')]=function(_0xe32eca,_0x149ecf){return _0xe32eca[_0x2b7e('0xc')](_0x2b7e('0xd'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index dfdf850..4c6f1d9 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 _0xb9be=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x31b368,_0xa3c65e){var _0x4b2c51=function(_0xd4e02b){while(--_0xd4e02b){_0x31b368['push'](_0x31b368['shift']());}};_0x4b2c51(++_0xa3c65e);}(_0xb9be,0xc5));var _0xeb9b=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xb9be[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')](_0x21aca6[_0xeb9b('0x1b')],{'raw':_0x21aca6[_0xeb9b('0x1c')]?_0x21aca6['options'][_0xeb9b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5d5f54){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x5d5f54));_0x3cbe3e(_0x5d5f54);})[_0xeb9b('0x17')](function(_0x37d7e0){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x37d7e0[_0xeb9b('0x16')],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x37d7e0[_0xeb9b('0x16')]));});});}; \ No newline at end of file +var _0xcf66=['body','options','raw','info','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x2b2581,_0x34a81b){var _0x3fc867=function(_0x401bfe){while(--_0x401bfe){_0x2b2581['push'](_0x2b2581['shift']());}};_0x3fc867(++_0x34a81b);}(_0xcf66,0x71));var _0x6cf6=function(_0x1e5304,_0x196ba7){_0x1e5304=_0x1e5304-0x0;var _0x541ebe=_0xcf66[_0x1e5304];return _0x541ebe;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['create'](_0x2ca2b1[_0x6cf6('0x16')],{'raw':_0x2ca2b1[_0x6cf6('0x17')]?_0x2ca2b1[_0x6cf6('0x17')][_0x6cf6('0x18')]===undefined?!![]:![]:!![]})[_0x6cf6('0xb')](function(_0x21e903){logger[_0x6cf6('0x19')]('CreateSquareDetailsReport',_0x2ca2b1);logger[_0x6cf6('0x1a')](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x21e903));_0x11d994(_0x21e903);})[_0x6cf6('0x13')](function(_0x5cba3a){logger[_0x6cf6('0xf')](_0x6cf6('0x14'),_0x5cba3a[_0x6cf6('0x11')],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5cba3a['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index f9e3b78..724dde8 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 _0xb10f=['get','/process/:pid/kill','killProcess','Router','../../components/auth/service','./system.controller','isAuthenticated','index'];(function(_0x295849,_0x42b3eb){var _0x27d8d4=function(_0x375ae0){while(--_0x375ae0){_0x295849['push'](_0x295849['shift']());}};_0x27d8d4(++_0x42b3eb);}(_0xb10f,0xa3));var _0xfb10=function(_0x195e61,_0x15350d){_0x195e61=_0x195e61-0x0;var _0x193e2c=_0xb10f[_0x195e61];return _0x193e2c;};'use strict';var express=require('express');var router=express[_0xfb10('0x0')]();var auth=require(_0xfb10('0x1'));var controller=require(_0xfb10('0x2'));router['get']('/',auth[_0xfb10('0x3')](),controller[_0xfb10('0x4')]);router[_0xfb10('0x5')](_0xfb10('0x6'),auth[_0xfb10('0x3')](),controller[_0xfb10('0x7')]);module['exports']=router; \ No newline at end of file +var _0x3681=['isAuthenticated','index','get','/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller'];(function(_0x15f1f8,_0x15e5c8){var _0x53215d=function(_0x5bae68){while(--_0x5bae68){_0x15f1f8['push'](_0x15f1f8['shift']());}};_0x53215d(++_0x15e5c8);}(_0x3681,0x65));var _0x1368=function(_0x43dabf,_0x525c7){_0x43dabf=_0x43dabf-0x0;var _0x52429d=_0x3681[_0x43dabf];return _0x52429d;};'use strict';var express=require('express');var router=express[_0x1368('0x0')]();var auth=require(_0x1368('0x1'));var controller=require(_0x1368('0x2'));router['get']('/',auth[_0x1368('0x3')](),controller[_0x1368('0x4')]);router[_0x1368('0x5')](_0x1368('0x6'),auth[_0x1368('0x3')](),controller['killProcess']);module[_0x1368('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 72f4eba..43b6da7 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 _0xa76e=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','lodash','error'];(function(_0xba96b0,_0x36e8f8){var _0xdad969=function(_0x5226b4){while(--_0x5226b4){_0xba96b0['push'](_0xba96b0['shift']());}};_0xdad969(++_0x36e8f8);}(_0xa76e,0x13c));var _0xea76=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xa76e[_0x5e6ea3];return _0x4048b5;};'use strict';var info=require(_0xea76('0x0'));var exec=require(_0xea76('0x1'))[_0xea76('0x2')];var logger=require(_0xea76('0x3'))(_0xea76('0x4'));var util=require(_0xea76('0x5'));var BPromise=require('bluebird');var _=require(_0xea76('0x6'));function handleError(_0x7a83aa,_0x3c774e,_0x3e46be){_0x3c774e=_0x3c774e||0x1f4;return function(_0x399299){logger[_0xea76('0x7')](_0xea76('0x8'),_0x3e46be,_0x3c774e,util[_0xea76('0x9')](_0x399299,{'showHidden':![],'depth':null}));delete _0x399299[_0xea76('0xa')];_0x7a83aa['status'](_0x3c774e)[_0xea76('0xb')](_0x399299);};}exports[_0xea76('0xc')]=function(_0xb29d71,_0x437090){return info[_0xea76('0xd')]()[_0xea76('0xe')](function(_0x140400){return _0x437090[_0xea76('0xf')](0xc8)[_0xea76('0x10')](_0x140400);})[_0xea76('0x11')](function(_0x5ecdff){return _0x437090[_0xea76('0xf')](0x1f4)[_0xea76('0x10')](_0x5ecdff);});};exports[_0xea76('0x12')]=function(_0x448a58,_0x1b5cf6){var _0x20bee8=[_0xea76('0x13')];return new BPromise(function(_0xabe88a,_0x1db1eb){return exec(util[_0xea76('0x14')](_0xea76('0x15'),_0x448a58[_0xea76('0x16')][_0xea76('0x17')]),function(_0x4f4a29,_0x1089fc,_0x2efc84){if(_0x4f4a29){return _0x1db1eb(_0x4f4a29);}return _0xabe88a(_0x1089fc);});})[_0xea76('0xe')](function(_0x4334c1){var _0x5115bf=![];var _0x1ff63a=_0x4334c1['split'](/\n/);for(var _0x13fe2f=0x0,_0x44f525=_0x20bee8['length'];_0x13fe2f<_0x44f525,_0x5115bf===![];_0x13fe2f+=0x1){if(_0x4334c1[_0xea76('0x18')](_0x20bee8[_0x13fe2f])>=0x0){_0x5115bf=!![];}}if(!_0x5115bf){throw new Error(util[_0xea76('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x448a58[_0xea76('0x16')][_0xea76('0x17')]));}process['kill'](_0x448a58[_0xea76('0x16')][_0xea76('0x17')],_0xea76('0x19'));return _0x1b5cf6[_0xea76('0xf')](0xc8)[_0xea76('0x10')]({'message':util['format'](_0xea76('0x1a'),_0x448a58[_0xea76('0x16')][_0xea76('0x17')])});})[_0xea76('0x11')](handleError(_0x1b5cf6,null,_0xea76('0x12')));}; \ No newline at end of file +var _0x43f8=['exec','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x32af9c,_0x2517b4){var _0x14ef2a=function(_0x3875f4){while(--_0x3875f4){_0x32af9c['push'](_0x32af9c['shift']());}};_0x14ef2a(++_0x2517b4);}(_0x43f8,0x176));var _0x843f=function(_0x369f22,_0x4215d7){_0x369f22=_0x369f22-0x0;var _0x1469fd=_0x43f8[_0x369f22];return _0x1469fd;};'use strict';var info=require(_0x843f('0x0'));var exec=require('child_process')[_0x843f('0x1')];var logger=require('../../config/logger')(_0x843f('0x2'));var util=require(_0x843f('0x3'));var BPromise=require('bluebird');var _=require(_0x843f('0x4'));function handleError(_0x36c960,_0xe65777,_0x4bf455){_0xe65777=_0xe65777||0x1f4;return function(_0x1d09db){logger[_0x843f('0x5')](_0x843f('0x6'),_0x4bf455,_0xe65777,util[_0x843f('0x7')](_0x1d09db,{'showHidden':![],'depth':null}));delete _0x1d09db[_0x843f('0x8')];_0x36c960[_0x843f('0x9')](_0xe65777)[_0x843f('0xa')](_0x1d09db);};}exports['index']=function(_0x35da25,_0xb3b118){return info[_0x843f('0xb')]()[_0x843f('0xc')](function(_0x3e54bc){return _0xb3b118[_0x843f('0x9')](0xc8)[_0x843f('0xd')](_0x3e54bc);})[_0x843f('0xe')](function(_0x50e831){return _0xb3b118[_0x843f('0x9')](0x1f4)[_0x843f('0xd')](_0x50e831);});};exports[_0x843f('0xf')]=function(_0x353742,_0x58aca2){var _0x2fcad8=['components/import/cm'];return new BPromise(function(_0x33c870,_0x540318){return exec(util[_0x843f('0x10')](_0x843f('0x11'),_0x353742[_0x843f('0x12')][_0x843f('0x13')]),function(_0x518497,_0x11fbb4,_0x54d852){if(_0x518497){return _0x540318(_0x518497);}return _0x33c870(_0x11fbb4);});})[_0x843f('0xc')](function(_0x4b21d8){var _0x22371c=![];var _0x1402a5=_0x4b21d8[_0x843f('0x14')](/\n/);for(var _0x30a655=0x0,_0x3f69ee=_0x2fcad8['length'];_0x30a655<_0x3f69ee,_0x22371c===![];_0x30a655+=0x1){if(_0x4b21d8[_0x843f('0x15')](_0x2fcad8[_0x30a655])>=0x0){_0x22371c=!![];}}if(!_0x22371c){throw new Error(util[_0x843f('0x10')](_0x843f('0x16'),_0x353742[_0x843f('0x12')][_0x843f('0x13')]));}process[_0x843f('0x17')](_0x353742[_0x843f('0x12')][_0x843f('0x13')],'SIGINT');return _0x58aca2[_0x843f('0x9')](0xc8)[_0x843f('0xd')]({'message':util[_0x843f('0x10')](_0x843f('0x18'),_0x353742[_0x843f('0x12')][_0x843f('0x13')])});})['catch'](handleError(_0x58aca2,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index de104e4..657b051 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 _0x9dbe=['../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x5d9c37,_0xa242f1){var _0x385099=function(_0x5bc182){while(--_0x5bc182){_0x5d9c37['push'](_0x5d9c37['shift']());}};_0x385099(++_0xa242f1);}(_0x9dbe,0x150));var _0xe9db=function(_0x25db26,_0x48f45f){_0x25db26=_0x25db26-0x0;var _0x748fa6=_0x9dbe[_0x25db26];return _0x748fa6;};'use strict';var multer=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var path=require('path');var timeout=require(_0xe9db('0x2'));var express=require(_0xe9db('0x3'));var router=express['Router']();var fs_extra=require(_0xe9db('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe9db('0x5'));var config=require(_0xe9db('0x6'));var controller=require(_0xe9db('0x7'));router[_0xe9db('0x8')]('/',auth[_0xe9db('0x9')](),controller[_0xe9db('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9db('0xb')]);router[_0xe9db('0xc')]('/',auth[_0xe9db('0x9')](),controller[_0xe9db('0xd')]);router['put'](_0xe9db('0xe'),auth['isAuthenticated'](),controller[_0xe9db('0xf')]);router[_0xe9db('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe9db('0x11')]=router; \ No newline at end of file +var _0xd2fb=['index','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','get'];(function(_0x126264,_0x47e262){var _0x5e1b30=function(_0x5dbc71){while(--_0x5dbc71){_0x126264['push'](_0x126264['shift']());}};_0x5e1b30(++_0x47e262);}(_0xd2fb,0x14e));var _0xbd2f=function(_0xba2c04,_0x10acb4){_0xba2c04=_0xba2c04-0x0;var _0x5a46af=_0xd2fb[_0xba2c04];return _0x5a46af;};'use strict';var multer=require(_0xbd2f('0x0'));var util=require(_0xbd2f('0x1'));var path=require(_0xbd2f('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd2f('0x3'));var router=express[_0xbd2f('0x4')]();var fs_extra=require(_0xbd2f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbd2f('0x6'));var controller=require('./tag.controller');router[_0xbd2f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd2f('0x8')]);router[_0xbd2f('0x7')]('/:id',auth[_0xbd2f('0x9')](),controller['show']);router[_0xbd2f('0xa')]('/',auth[_0xbd2f('0x9')](),controller[_0xbd2f('0xb')]);router[_0xbd2f('0xc')](_0xbd2f('0xd'),auth[_0xbd2f('0x9')](),controller[_0xbd2f('0xe')]);router[_0xbd2f('0xf')](_0xbd2f('0xd'),auth[_0xbd2f('0x9')](),controller[_0xbd2f('0x10')]);module[_0xbd2f('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 9f8a97a..777d19b 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 _0x4227=['STRING','sequelize','name','#0091EA'];(function(_0x2ed1a0,_0x36acd9){var _0x3d272e=function(_0x41460c){while(--_0x41460c){_0x2ed1a0['push'](_0x2ed1a0['shift']());}};_0x3d272e(++_0x36acd9);}(_0x4227,0x89));var _0x7422=function(_0x133124,_0x3f56bd){_0x133124=_0x133124-0x0;var _0x488a98=_0x4227[_0x133124];return _0x488a98;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7422('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x7422('0x2')},'description':{'type':Sequelize[_0x7422('0x3')]}}; \ No newline at end of file +var _0x7b37=['STRING','sequelize','exports','name'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7b37,0xd9));var _0x77b3=function(_0x648377,_0x368d97){_0x648377=_0x648377-0x0;var _0x32feab=_0x7b37[_0x648377];return _0x32feab;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x77b3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x77b3('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x77b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7019761..30acfc3 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 _0x780f=['keys','filters','attributes','intersection','fields','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query'];(function(_0x4b11f8,_0x1ba3b4){var _0x23ae06=function(_0x127523){while(--_0x127523){_0x4b11f8['push'](_0x4b11f8['shift']());}};_0x23ae06(++_0x1ba3b4);}(_0x780f,0x6c));var _0xf780=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x780f[_0xa79977];return _0x109f10;};'use strict';var emlformat=require(_0xf780('0x0'));var rimraf=require(_0xf780('0x1'));var zipdir=require(_0xf780('0x2'));var jsonpatch=require(_0xf780('0x3'));var rp=require(_0xf780('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf780('0x5'));var util=require(_0xf780('0x6'));var path=require(_0xf780('0x7'));var sox=require(_0xf780('0x8'));var csv=require('to-csv');var ejs=require(_0xf780('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf780('0xa'));var squel=require(_0xf780('0xb'));var crypto=require(_0xf780('0xc'));var jsforce=require(_0xf780('0xd'));var deskjs=require(_0xf780('0xe'));var toCsv=require(_0xf780('0xf'));var querystring=require('querystring');var Papa=require(_0xf780('0x10'));var Redis=require(_0xf780('0x11'));var authService=require(_0xf780('0x12'));var qs=require(_0xf780('0x13'));var as=require(_0xf780('0x14'));var hardwareService=require(_0xf780('0x15'));var logger=require(_0xf780('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf780('0x17'));var licenseUtil=require(_0xf780('0x18'));var db=require(_0xf780('0x19'))['db'];function respondWithStatusCode(_0x1a8520,_0x5f04e1){_0x5f04e1=_0x5f04e1||0xcc;return function(_0x24aa4f){if(_0x24aa4f){return _0x1a8520[_0xf780('0x1a')](_0x5f04e1);}return _0x1a8520[_0xf780('0x1b')](_0x5f04e1)[_0xf780('0x1c')]();};}function respondWithResult(_0x5c353b,_0x5a64bc){_0x5a64bc=_0x5a64bc||0xc8;return function(_0x4be599){if(_0x4be599){return _0x5c353b[_0xf780('0x1b')](_0x5a64bc)[_0xf780('0x1d')](_0x4be599);}};}function respondWithFilteredResult(_0xc1e872,_0x187b6d){return function(_0x206d34){if(_0x206d34){var _0x335ba6=typeof _0x187b6d[_0xf780('0x1e')]==='undefined'&&typeof _0x187b6d[_0xf780('0x1f')]===_0xf780('0x20');var _0xa78b1b=_0x206d34[_0xf780('0x21')];var _0x5d5a81=_0x335ba6?0x0:_0x187b6d[_0xf780('0x1e')];var _0x53dfee=_0x335ba6?_0x206d34[_0xf780('0x21')]:_0x187b6d[_0xf780('0x1e')]+_0x187b6d['limit'];var _0x29dae1;if(_0x53dfee>=_0xa78b1b){_0x53dfee=_0xa78b1b;_0x29dae1=0xc8;}else{_0x29dae1=0xce;}_0xc1e872[_0xf780('0x1b')](_0x29dae1);return _0xc1e872['set'](_0xf780('0x22'),_0x5d5a81+'-'+_0x53dfee+'/'+_0xa78b1b)[_0xf780('0x1d')](_0x206d34);}return null;};}function patchUpdates(_0x3c7054){return function(_0x4065bb){try{jsonpatch[_0xf780('0x23')](_0x4065bb,_0x3c7054,!![]);}catch(_0x147de9){return BPromise['reject'](_0x147de9);}return _0x4065bb[_0xf780('0x24')]();};}function saveUpdates(_0x4de546,_0x5853ea){return function(_0x45d80e){if(_0x45d80e){return _0x45d80e[_0xf780('0x25')](_0x4de546)[_0xf780('0x26')](function(_0x58bb66){return _0x58bb66;});}return null;};}function removeEntity(_0x2fcb2d,_0x373dce){return function(_0x4f59b1){if(_0x4f59b1){return _0x4f59b1[_0xf780('0x27')]()['then'](function(){var _0x25faba=_0x4f59b1[_0xf780('0x28')]({'plain':!![]});var _0x5d4053='Tags';return db[_0xf780('0x29')][_0xf780('0x27')]({'where':{'type':_0x5d4053,'resourceId':_0x25faba['id']}})[_0xf780('0x26')](function(){return _0x4f59b1;});})[_0xf780('0x26')](function(){_0x2fcb2d[_0xf780('0x1b')](0xcc)[_0xf780('0x1c')]();});}};}function handleEntityNotFound(_0x34d7b3,_0x57e5e8){return function(_0x5a3547){if(!_0x5a3547){_0x34d7b3['sendStatus'](0x194);}return _0x5a3547;};}function handleError(_0x3f5498,_0xf595e2){_0xf595e2=_0xf595e2||0x1f4;return function(_0x26452f){logger['error'](_0x26452f['stack']);if(_0x26452f[_0xf780('0x2a')]){delete _0x26452f[_0xf780('0x2a')];}_0x3f5498[_0xf780('0x1b')](_0xf595e2)['send'](_0x26452f);};}exports[_0xf780('0x2b')]=function(_0x60bb8b,_0x2368e3){var _0x302594={},_0x55923a={},_0x15e5fd={'count':0x0,'rows':[]};var _0x4ff248=_[_0xf780('0x2c')](db[_0xf780('0x2d')][_0xf780('0x2e')],function(_0x23a019){return{'name':_0x23a019[_0xf780('0x2f')],'type':_0x23a019[_0xf780('0x30')][_0xf780('0x31')]};});_0x55923a[_0xf780('0x32')]=_['map'](_0x4ff248,_0xf780('0x2a'));_0x55923a[_0xf780('0x33')]=_[_0xf780('0x34')](_0x60bb8b[_0xf780('0x33')]);_0x55923a[_0xf780('0x35')]=_['intersection'](_0x55923a[_0xf780('0x32')],_0x55923a['query']);_0x302594[_0xf780('0x36')]=_[_0xf780('0x37')](_0x55923a[_0xf780('0x32')],qs['fields'](_0x60bb8b[_0xf780('0x33')][_0xf780('0x38')]));_0x302594[_0xf780('0x36')]=_0x302594[_0xf780('0x36')]['length']?_0x302594[_0xf780('0x36')]:_0x55923a['model'];if(!_0x60bb8b[_0xf780('0x33')]['hasOwnProperty']('nolimit')){_0x302594[_0xf780('0x1f')]=qs['limit'](_0x60bb8b[_0xf780('0x33')][_0xf780('0x1f')]);_0x302594[_0xf780('0x1e')]=qs[_0xf780('0x1e')](_0x60bb8b['query'][_0xf780('0x1e')]);}_0x302594[_0xf780('0x39')]=qs[_0xf780('0x3a')](_0x60bb8b[_0xf780('0x33')]['sort']);_0x302594[_0xf780('0x3b')]=qs[_0xf780('0x35')](_[_0xf780('0x3c')](_0x60bb8b[_0xf780('0x33')],_0x55923a[_0xf780('0x35')]),_0x4ff248);if(_0x60bb8b['query']['filter']){_0x302594[_0xf780('0x3b')]=_[_0xf780('0x3d')](_0x302594[_0xf780('0x3b')],{'$or':_[_0xf780('0x2c')](_0x4ff248,function(_0x1a6a6f){if(_0x1a6a6f['type']!==_0xf780('0x3e')){var _0x511883={};_0x511883[_0x1a6a6f[_0xf780('0x2a')]]={'$like':'%'+_0x60bb8b[_0xf780('0x33')][_0xf780('0x3f')]+'%'};return _0x511883;}})});}_0x302594=_[_0xf780('0x3d')]({},_0x302594,_0x60bb8b['options']);var _0x1fe827={'where':_0x302594[_0xf780('0x3b')]};return db[_0xf780('0x2d')][_0xf780('0x21')](_0x1fe827)[_0xf780('0x26')](function(_0x12ae9a){_0x15e5fd[_0xf780('0x21')]=_0x12ae9a;if(_0x60bb8b[_0xf780('0x33')][_0xf780('0x40')]){_0x302594[_0xf780('0x41')]=[{'all':!![]}];}return db[_0xf780('0x2d')][_0xf780('0x42')](_0x302594);})[_0xf780('0x26')](function(_0x42a710){_0x15e5fd['rows']=_0x42a710;return _0x15e5fd;})[_0xf780('0x26')](respondWithFilteredResult(_0x2368e3,_0x302594))['catch'](handleError(_0x2368e3,null));};exports[_0xf780('0x43')]=function(_0x3bf697,_0x4cb117){var _0x57ff6d={'raw':!![],'where':{'id':_0x3bf697['params']['id']}},_0x564c9a={};_0x564c9a[_0xf780('0x32')]=_['keys'](db[_0xf780('0x2d')][_0xf780('0x2e')]);_0x564c9a[_0xf780('0x33')]=_[_0xf780('0x34')](_0x3bf697[_0xf780('0x33')]);_0x564c9a['filters']=_['intersection'](_0x564c9a['model'],_0x564c9a['query']);_0x57ff6d[_0xf780('0x36')]=_[_0xf780('0x37')](_0x564c9a[_0xf780('0x32')],qs[_0xf780('0x38')](_0x3bf697[_0xf780('0x33')][_0xf780('0x38')]));_0x57ff6d['attributes']=_0x57ff6d[_0xf780('0x36')][_0xf780('0x44')]?_0x57ff6d[_0xf780('0x36')]:_0x564c9a[_0xf780('0x32')];if(_0x3bf697[_0xf780('0x33')][_0xf780('0x40')]){_0x57ff6d['include']=[{'all':!![]}];}_0x57ff6d=_[_0xf780('0x3d')]({},_0x57ff6d,_0x3bf697['options']);return db[_0xf780('0x2d')]['find'](_0x57ff6d)[_0xf780('0x26')](handleEntityNotFound(_0x4cb117,null))['then'](respondWithResult(_0x4cb117,null))['catch'](handleError(_0x4cb117,null));};exports[_0xf780('0x45')]=function(_0x72a225,_0x189717){return db[_0xf780('0x2d')]['create'](_0x72a225[_0xf780('0x46')],{})[_0xf780('0x26')](function(_0x311268){var _0x143665=_0x72a225[_0xf780('0x47')]['get']({'plain':!![]});if(!_0x143665)throw new Error(_0xf780('0x48'));if(_0x143665['role']===_0xf780('0x47')){var _0x1b492a=_0x311268[_0xf780('0x28')]({'plain':!![]});var _0x45ae96=_0xf780('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x45ae96,'userProfileId':_0x143665[_0xf780('0x4a')]},'raw':!![]})[_0xf780('0x26')](function(_0x3277a3){if(_0x3277a3&&_0x3277a3[_0xf780('0x4b')]===0x0){return db['UserProfileResource'][_0xf780('0x45')]({'name':_0x1b492a[_0xf780('0x2a')],'resourceId':_0x1b492a['id'],'type':_0x3277a3[_0xf780('0x2a')],'sectionId':_0x3277a3['id']},{})[_0xf780('0x26')](function(){return _0x311268;});}else{return _0x311268;}})[_0xf780('0x4c')](function(_0x3b98c7){logger['error'](_0xf780('0x4d'),_0x3b98c7);throw _0x3b98c7;});}return _0x311268;})[_0xf780('0x26')](respondWithResult(_0x189717,0xc9))['catch'](handleError(_0x189717,null));};exports[_0xf780('0x25')]=function(_0x1f1907,_0x276a30){if(_0x1f1907[_0xf780('0x46')]['id']){delete _0x1f1907[_0xf780('0x46')]['id'];}return db[_0xf780('0x2d')][_0xf780('0x4e')]({'where':{'id':_0x1f1907[_0xf780('0x4f')]['id']}})[_0xf780('0x26')](handleEntityNotFound(_0x276a30,null))[_0xf780('0x26')](saveUpdates(_0x1f1907[_0xf780('0x46')],null))[_0xf780('0x26')](respondWithResult(_0x276a30,null))['catch'](handleError(_0x276a30,null));};exports[_0xf780('0x27')]=function(_0x4d669e,_0x1815de){return db[_0xf780('0x2d')]['find']({'where':{'id':_0x4d669e['params']['id']}})['then'](handleEntityNotFound(_0x1815de,null))[_0xf780('0x26')](removeEntity(_0x1815de,null))[_0xf780('0x4c')](handleError(_0x1815de,null));}; \ No newline at end of file +var _0xee5b=['params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','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','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','Tag','includeAll','include','rows','catch','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee5b,0x1f4));var _0xbee5=function(_0xa1a54d,_0x2e461a){_0xa1a54d=_0xa1a54d-0x0;var _0xf713f8=_0xee5b[_0xa1a54d];return _0xf713f8;};'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(){var _0x5b43b3=_0x3cfa8d['get']({'plain':!![]});var _0x519473='Tags';return db[_0xbee5('0x25')][_0xbee5('0x24')]({'where':{'type':_0x519473,'resourceId':_0x5b43b3['id']}})[_0xbee5('0x23')](function(){return _0x3cfa8d;});})[_0xbee5('0x23')](function(){_0xb665df[_0xbee5('0x17')](0xcc)[_0xbee5('0x18')]();});}};}function handleEntityNotFound(_0x3c8643,_0x4e9a79){return function(_0x36b50f){if(!_0x36b50f){_0x3c8643[_0xbee5('0x26')](0x194);}return _0x36b50f;};}function handleError(_0x179d14,_0x39da95){_0x39da95=_0x39da95||0x1f4;return function(_0x1a8bcc){logger['error'](_0x1a8bcc[_0xbee5('0x27')]);if(_0x1a8bcc[_0xbee5('0x28')]){delete _0x1a8bcc[_0xbee5('0x28')];}_0x179d14[_0xbee5('0x17')](_0x39da95)[_0xbee5('0x29')](_0x1a8bcc);};}exports[_0xbee5('0x2a')]=function(_0x34b7df,_0x36e8bb){var _0x2ccb91={},_0x59c2e4={},_0x22df5f={'count':0x0,'rows':[]};var _0x5b10a6=_[_0xbee5('0x2b')](db['Tag'][_0xbee5('0x2c')],function(_0x52dad9){return{'name':_0x52dad9[_0xbee5('0x2d')],'type':_0x52dad9['type'][_0xbee5('0x2e')]};});_0x59c2e4[_0xbee5('0x2f')]=_[_0xbee5('0x2b')](_0x5b10a6,_0xbee5('0x28'));_0x59c2e4['query']=_[_0xbee5('0x30')](_0x34b7df[_0xbee5('0x31')]);_0x59c2e4[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x59c2e4['model'],_0x59c2e4[_0xbee5('0x31')]);_0x2ccb91[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x59c2e4[_0xbee5('0x2f')],qs['fields'](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x35')]));_0x2ccb91[_0xbee5('0x34')]=_0x2ccb91[_0xbee5('0x34')]['length']?_0x2ccb91[_0xbee5('0x34')]:_0x59c2e4['model'];if(!_0x34b7df[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2ccb91['limit']=qs[_0xbee5('0x1a')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2ccb91[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x19')]);}_0x2ccb91[_0xbee5('0x36')]=qs['sort'](_0x34b7df[_0xbee5('0x31')]['sort']);_0x2ccb91[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_[_0xbee5('0x38')](_0x34b7df[_0xbee5('0x31')],_0x59c2e4['filters']),_0x5b10a6);if(_0x34b7df[_0xbee5('0x31')]['filter']){_0x2ccb91['where']=_[_0xbee5('0x39')](_0x2ccb91[_0xbee5('0x37')],{'$or':_[_0xbee5('0x2b')](_0x5b10a6,function(_0x1974f2){if(_0x1974f2['type']!==_0xbee5('0x3a')){var _0x2819e2={};_0x2819e2[_0x1974f2[_0xbee5('0x28')]]={'$like':'%'+_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x2819e2;}})});}_0x2ccb91=_[_0xbee5('0x39')]({},_0x2ccb91,_0x34b7df[_0xbee5('0x3c')]);var _0x297294={'where':_0x2ccb91[_0xbee5('0x37')]};return db[_0xbee5('0x3d')]['count'](_0x297294)[_0xbee5('0x23')](function(_0x371015){_0x22df5f['count']=_0x371015;if(_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x2ccb91[_0xbee5('0x3f')]=[{'all':!![]}];}return db[_0xbee5('0x3d')]['findAll'](_0x2ccb91);})['then'](function(_0x4b4641){_0x22df5f[_0xbee5('0x40')]=_0x4b4641;return _0x22df5f;})[_0xbee5('0x23')](respondWithFilteredResult(_0x36e8bb,_0x2ccb91))[_0xbee5('0x41')](handleError(_0x36e8bb,null));};exports[_0xbee5('0x42')]=function(_0x4012fd,_0x3f5441){var _0x41cea0={'raw':!![],'where':{'id':_0x4012fd[_0xbee5('0x43')]['id']}},_0x2c4464={};_0x2c4464['model']=_['keys'](db[_0xbee5('0x3d')]['rawAttributes']);_0x2c4464[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x4012fd['query']);_0x2c4464[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x2c4464['model'],_0x2c4464['query']);_0x41cea0[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x2c4464['model'],qs[_0xbee5('0x35')](_0x4012fd[_0xbee5('0x31')]['fields']));_0x41cea0[_0xbee5('0x34')]=_0x41cea0[_0xbee5('0x34')][_0xbee5('0x44')]?_0x41cea0[_0xbee5('0x34')]:_0x2c4464[_0xbee5('0x2f')];if(_0x4012fd[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x41cea0['include']=[{'all':!![]}];}_0x41cea0=_[_0xbee5('0x39')]({},_0x41cea0,_0x4012fd[_0xbee5('0x3c')]);return db[_0xbee5('0x3d')][_0xbee5('0x45')](_0x41cea0)['then'](handleEntityNotFound(_0x3f5441,null))[_0xbee5('0x23')](respondWithResult(_0x3f5441,null))[_0xbee5('0x41')](handleError(_0x3f5441,null));};exports[_0xbee5('0x46')]=function(_0x4aa21a,_0x44d4b1){return db[_0xbee5('0x3d')]['create'](_0x4aa21a['body'],{})['then'](function(_0x3a27bb){var _0x501167=_0x4aa21a[_0xbee5('0x47')][_0xbee5('0x48')]({'plain':!![]});if(!_0x501167)throw new Error(_0xbee5('0x49'));if(_0x501167[_0xbee5('0x4a')]===_0xbee5('0x47')){var _0x296fc8=_0x3a27bb['get']({'plain':!![]});var _0x24274d=_0xbee5('0x4b');return db[_0xbee5('0x4c')][_0xbee5('0x45')]({'where':{'name':_0x24274d,'userProfileId':_0x501167['userProfileId']},'raw':!![]})[_0xbee5('0x23')](function(_0x594dcf){if(_0x594dcf&&_0x594dcf[_0xbee5('0x4d')]===0x0){return db[_0xbee5('0x25')][_0xbee5('0x46')]({'name':_0x296fc8[_0xbee5('0x28')],'resourceId':_0x296fc8['id'],'type':_0x594dcf[_0xbee5('0x28')],'sectionId':_0x594dcf['id']},{})[_0xbee5('0x23')](function(){return _0x3a27bb;});}else{return _0x3a27bb;}})[_0xbee5('0x41')](function(_0x35f1d1){logger[_0xbee5('0x4e')](_0xbee5('0x4f'),_0x35f1d1);throw _0x35f1d1;});}return _0x3a27bb;})[_0xbee5('0x23')](respondWithResult(_0x44d4b1,0xc9))[_0xbee5('0x41')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x22')]=function(_0x359738,_0x37cf74){if(_0x359738['body']['id']){delete _0x359738[_0xbee5('0x50')]['id'];}return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x359738['params']['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x37cf74,null))[_0xbee5('0x23')](saveUpdates(_0x359738[_0xbee5('0x50')],null))['then'](respondWithResult(_0x37cf74,null))[_0xbee5('0x41')](handleError(_0x37cf74,null));};exports['destroy']=function(_0x131c45,_0x4ee645){return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x131c45[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee645,null))['then'](removeEntity(_0x4ee645,null))['catch'](handleError(_0x4ee645,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 5e946e0..b607970 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 _0x3f09=['Tag','tools_tags','lodash','../../config/logger','api','path','./tag.attributes','exports','define'];(function(_0x2d45d2,_0x2e4f22){var _0x1b9e8e=function(_0x46da65){while(--_0x46da65){_0x2d45d2['push'](_0x2d45d2['shift']());}};_0x1b9e8e(++_0x2e4f22);}(_0x3f09,0x146));var _0x93f0=function(_0x539efa,_0x195a3f){_0x539efa=_0x539efa-0x0;var _0x3da6f8=_0x3f09[_0x539efa];return _0x3da6f8;};'use strict';var _=require(_0x93f0('0x0'));var util=require('util');var logger=require(_0x93f0('0x1'))(_0x93f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x93f0('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x93f0('0x4'));module[_0x93f0('0x5')]=function(_0x431911,_0x2ae848){return _0x431911[_0x93f0('0x6')](_0x93f0('0x7'),attributes,{'tableName':_0x93f0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa15b=['tools_tags','lodash','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x55447f,_0x552a19){var _0x52b89a=function(_0x51c776){while(--_0x51c776){_0x55447f['push'](_0x55447f['shift']());}};_0x52b89a(++_0x552a19);}(_0xa15b,0x17b));var _0xba15=function(_0x4e9429,_0x59cb18){_0x4e9429=_0x4e9429-0x0;var _0x173d24=_0xa15b[_0x4e9429];return _0x173d24;};'use strict';var _=require(_0xba15('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba15('0x1'));var moment=require(_0xba15('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba15('0x3'));var rimraf=require(_0xba15('0x4'));var config=require(_0xba15('0x5'));var attributes=require('./tag.attributes');module[_0xba15('0x6')]=function(_0x265f01,_0x3f22fb){return _0x265f01[_0xba15('0x7')]('Tag',attributes,{'tableName':_0xba15('0x8'),'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 78c205b..bcb4f55 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 _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x19d11c,_0x285b34){var _0x933487=function(_0x4adf58){while(--_0x4adf58){_0x19d11c['push'](_0x19d11c['shift']());}};_0x933487(++_0x285b34);}(_0x54f3,0x120));var _0x354f=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x54f3[_0x46698a];return _0x356db0;};'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')]('Tag,\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 _0xc3fe=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xc3fe,0xff));var _0xec3f=function(_0x225737,_0x31cfaa){_0x225737=_0x225737-0x0;var _0x4874f3=_0xc3fe[_0x225737];return _0x4874f3;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('Tag,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('Tag,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 5cbfcd8..7551fe7 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_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/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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 c9efb1c..cbad01d 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(_0x355559,_0x1a1eca){var _0x4a613a=function(_0x28cfdf){while(--_0x28cfdf){_0x355559['push'](_0x355559['shift']());}};_0x4a613a(++_0x1a1eca);}(_0x757a,0xde));var _0xa757=function(_0x5dd8a2,_0x191fa5){_0x5dd8a2=_0x5dd8a2-0x0;var _0x302751=_0x757a[_0x5dd8a2];return _0x302751;};'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 _0xbaf0=['name','exports','STRING'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a7010de..f2a7b8a 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 _0x1131=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','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','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','order','pick','Queues','addQueues','findOne','add','removeQueues','remove','isArray','ids','Voice','Chat','Sms','Openchannel','Whatsapp','through','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','QueueId','findAll','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','penalty','all','spread','removeAgents','TeamVoicePrefix','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','then','includeAll','include','rows','catch','find','create','body'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1131,0x174));var _0x1113=function(_0x1d8bc8,_0x1146ff){_0x1d8bc8=_0x1d8bc8-0x0;var _0x426721=_0x1131[_0x1d8bc8];return _0x426721;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1113('0x0'));var jsonpatch=require(_0x1113('0x1'));var rp=require(_0x1113('0x2'));var moment=require(_0x1113('0x3'));var BPromise=require(_0x1113('0x4'));var Mustache=require(_0x1113('0x5'));var util=require(_0x1113('0x6'));var path=require(_0x1113('0x7'));var sox=require('sox');var csv=require(_0x1113('0x8'));var ejs=require(_0x1113('0x9'));var fs=require('fs');var fs_extra=require(_0x1113('0xa'));var _=require(_0x1113('0xb'));var squel=require(_0x1113('0xc'));var crypto=require(_0x1113('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1113('0x8'));var querystring=require('querystring');var Papa=require(_0x1113('0xe'));var Redis=require('ioredis');var authService=require(_0x1113('0xf'));var qs=require(_0x1113('0x10'));var as=require(_0x1113('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1113('0x12'));var utils=require(_0x1113('0x13'));var config=require(_0x1113('0x14'));var licenseUtil=require(_0x1113('0x15'));var db=require(_0x1113('0x16'))['db'];config['redis']=_[_0x1113('0x17')](config[_0x1113('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1113('0x19'))(new Redis(config[_0x1113('0x18')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x3f9922,_0x4c1de8){_0x4c1de8=_0x4c1de8||0xcc;return function(_0x1b5f4b){if(_0x1b5f4b){return _0x3f9922[_0x1113('0x1a')](_0x4c1de8);}return _0x3f9922[_0x1113('0x1b')](_0x4c1de8)[_0x1113('0x1c')]();};}function respondWithResult(_0x596d33,_0x4320b9){_0x4320b9=_0x4320b9||0xc8;return function(_0x250d3f){if(_0x250d3f){return _0x596d33['status'](_0x4320b9)[_0x1113('0x1d')](_0x250d3f);}};}function respondWithFilteredResult(_0x5675cd,_0x52e4ae){return function(_0x4e97e9){if(_0x4e97e9){var _0x15569f=typeof _0x52e4ae[_0x1113('0x1e')]===_0x1113('0x1f')&&typeof _0x52e4ae[_0x1113('0x20')]==='undefined';var _0x1f1d16=_0x4e97e9['count'];var _0x1e366f=_0x15569f?0x0:_0x52e4ae['offset'];var _0x2edff2=_0x15569f?_0x4e97e9[_0x1113('0x21')]:_0x52e4ae[_0x1113('0x1e')]+_0x52e4ae[_0x1113('0x20')];var _0x173aff;if(_0x2edff2>=_0x1f1d16){_0x2edff2=_0x1f1d16;_0x173aff=0xc8;}else{_0x173aff=0xce;}_0x5675cd[_0x1113('0x1b')](_0x173aff);return _0x5675cd[_0x1113('0x22')](_0x1113('0x23'),_0x1e366f+'-'+_0x2edff2+'/'+_0x1f1d16)[_0x1113('0x1d')](_0x4e97e9);}return null;};}function patchUpdates(_0x338f54){return function(_0x537e69){try{jsonpatch[_0x1113('0x24')](_0x537e69,_0x338f54,!![]);}catch(_0x1773db){return BPromise['reject'](_0x1773db);}return _0x537e69[_0x1113('0x25')]();};}function saveUpdates(_0x24d15a,_0x48dc51){return function(_0x315a37){if(_0x315a37){return _0x315a37[_0x1113('0x26')](_0x24d15a)['then'](function(_0xb21456){return _0xb21456;});}return null;};}function handleEntityNotFound(_0x31e4dd,_0x1b9977){return function(_0x584dbd){if(!_0x584dbd){_0x31e4dd['sendStatus'](0x194);}return _0x584dbd;};}function handleError(_0x1dbf30,_0x5c4caa){_0x5c4caa=_0x5c4caa||0x1f4;return function(_0x25a541){logger[_0x1113('0x27')](_0x25a541[_0x1113('0x28')]);if(_0x25a541[_0x1113('0x29')]){delete _0x25a541[_0x1113('0x29')];}_0x1dbf30['status'](_0x5c4caa)[_0x1113('0x2a')](_0x25a541);};}exports[_0x1113('0x2b')]=function(_0x20b5bd,_0x21c599){var _0x462dd8={},_0xe7bd6f={},_0x364c4e={'count':0x0,'rows':[]};var _0x1ca83c=_[_0x1113('0x2c')](db[_0x1113('0x2d')][_0x1113('0x2e')],function(_0x27dd6a){return{'name':_0x27dd6a[_0x1113('0x2f')],'type':_0x27dd6a[_0x1113('0x30')]['key']};});_0xe7bd6f[_0x1113('0x31')]=_[_0x1113('0x2c')](_0x1ca83c,_0x1113('0x29'));_0xe7bd6f[_0x1113('0x32')]=_[_0x1113('0x33')](_0x20b5bd[_0x1113('0x32')]);_0xe7bd6f[_0x1113('0x34')]=_[_0x1113('0x35')](_0xe7bd6f[_0x1113('0x31')],_0xe7bd6f[_0x1113('0x32')]);_0x462dd8[_0x1113('0x36')]=_['intersection'](_0xe7bd6f[_0x1113('0x31')],qs[_0x1113('0x37')](_0x20b5bd[_0x1113('0x32')]['fields']));_0x462dd8[_0x1113('0x36')]=_0x462dd8[_0x1113('0x36')][_0x1113('0x38')]?_0x462dd8['attributes']:_0xe7bd6f[_0x1113('0x31')];if(!_0x20b5bd['query'][_0x1113('0x39')](_0x1113('0x3a'))){_0x462dd8[_0x1113('0x20')]=qs[_0x1113('0x20')](_0x20b5bd[_0x1113('0x32')][_0x1113('0x20')]);_0x462dd8[_0x1113('0x1e')]=qs[_0x1113('0x1e')](_0x20b5bd[_0x1113('0x32')]['offset']);}_0x462dd8['order']=qs['sort'](_0x20b5bd['query'][_0x1113('0x3b')]);_0x462dd8[_0x1113('0x3c')]=qs[_0x1113('0x34')](_['pick'](_0x20b5bd['query'],_0xe7bd6f[_0x1113('0x34')]),_0x1ca83c);if(_0x20b5bd['query']['filter']){_0x462dd8['where']=_['merge'](_0x462dd8[_0x1113('0x3c')],{'$or':_[_0x1113('0x2c')](_0x1ca83c,function(_0x21d1e9){if(_0x21d1e9['type']!=='VIRTUAL'){var _0x51d917={};_0x51d917[_0x21d1e9[_0x1113('0x29')]]={'$like':'%'+_0x20b5bd[_0x1113('0x32')][_0x1113('0x3d')]+'%'};return _0x51d917;}})});}_0x462dd8=_[_0x1113('0x3e')]({},_0x462dd8,_0x20b5bd[_0x1113('0x3f')]);var _0x2ed6b5={'where':_0x462dd8[_0x1113('0x3c')]};return db[_0x1113('0x2d')][_0x1113('0x21')](_0x2ed6b5)[_0x1113('0x40')](function(_0x35e3d2){_0x364c4e['count']=_0x35e3d2;if(_0x20b5bd[_0x1113('0x32')][_0x1113('0x41')]){_0x462dd8[_0x1113('0x42')]=[{'all':!![]}];}return db[_0x1113('0x2d')]['findAll'](_0x462dd8);})[_0x1113('0x40')](function(_0x48aa45){_0x364c4e[_0x1113('0x43')]=_0x48aa45;return _0x364c4e;})[_0x1113('0x40')](respondWithFilteredResult(_0x21c599,_0x462dd8))[_0x1113('0x44')](handleError(_0x21c599,null));};exports['show']=function(_0x7be4fe,_0x96b37c){var _0x4d99a9={'raw':![],'where':{'id':_0x7be4fe['params']['id']}},_0x198d9c={};_0x198d9c[_0x1113('0x31')]=_[_0x1113('0x33')](db['Team'][_0x1113('0x2e')]);_0x198d9c[_0x1113('0x32')]=_[_0x1113('0x33')](_0x7be4fe[_0x1113('0x32')]);_0x198d9c[_0x1113('0x34')]=_['intersection'](_0x198d9c[_0x1113('0x31')],_0x198d9c[_0x1113('0x32')]);_0x4d99a9['attributes']=_[_0x1113('0x35')](_0x198d9c[_0x1113('0x31')],qs['fields'](_0x7be4fe['query']['fields']));_0x4d99a9[_0x1113('0x36')]=_0x4d99a9['attributes'][_0x1113('0x38')]?_0x4d99a9[_0x1113('0x36')]:_0x198d9c[_0x1113('0x31')];if(_0x7be4fe[_0x1113('0x32')][_0x1113('0x41')]){_0x4d99a9[_0x1113('0x42')]=[{'all':!![]}];}_0x4d99a9=_[_0x1113('0x3e')]({},_0x4d99a9,_0x7be4fe[_0x1113('0x3f')]);return db['Team'][_0x1113('0x45')](_0x4d99a9)[_0x1113('0x40')](handleEntityNotFound(_0x96b37c,null))[_0x1113('0x40')](respondWithResult(_0x96b37c,null))['catch'](handleError(_0x96b37c,null));};exports['create']=function(_0x2de690,_0x2d5b86){return db[_0x1113('0x2d')][_0x1113('0x46')](_0x2de690[_0x1113('0x47')],{})['then'](function(_0x418e45){var _0xbc9383=_0x2de690[_0x1113('0x48')][_0x1113('0x49')]({'plain':!![]});if(!_0xbc9383)throw new Error(_0x1113('0x4a'));if(_0xbc9383['role']===_0x1113('0x48')){var _0x4c6080=_0x418e45[_0x1113('0x49')]({'plain':!![]});var _0x533ff8=_0x1113('0x4b');return db[_0x1113('0x4c')][_0x1113('0x45')]({'where':{'name':_0x533ff8,'userProfileId':_0xbc9383[_0x1113('0x4d')]},'raw':!![]})[_0x1113('0x40')](function(_0x331f85){if(_0x331f85&&_0x331f85[_0x1113('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c6080[_0x1113('0x29')],'resourceId':_0x4c6080['id'],'type':_0x331f85[_0x1113('0x29')],'sectionId':_0x331f85['id']},{})[_0x1113('0x40')](function(){return _0x418e45;});}else{return _0x418e45;}})['catch'](function(_0x333935){logger[_0x1113('0x27')](_0x1113('0x4f'),_0x333935);throw _0x333935;});}return _0x418e45;})[_0x1113('0x40')](respondWithResult(_0x2d5b86,0xc9))['catch'](handleError(_0x2d5b86,null));};exports[_0x1113('0x26')]=function(_0x37c25c,_0x9dec1b){if(_0x37c25c[_0x1113('0x47')]['id']){delete _0x37c25c[_0x1113('0x47')]['id'];}return db[_0x1113('0x2d')][_0x1113('0x45')]({'where':{'id':_0x37c25c[_0x1113('0x50')]['id']}})[_0x1113('0x40')](handleEntityNotFound(_0x9dec1b,null))[_0x1113('0x40')](saveUpdates(_0x37c25c[_0x1113('0x47')],null))[_0x1113('0x40')](respondWithResult(_0x9dec1b,null))[_0x1113('0x44')](handleError(_0x9dec1b,null));};exports['destroy']=function(_0x461a94,_0x17a889){var _0x3076ee=_0x461a94[_0x1113('0x50')]['id'];var _0x26d12b=[];return db['sequelize'][_0x1113('0x51')](function(_0x5c8c63){var _0x50c382=_0x1113('0x52')+_0x3076ee;return db[_0x1113('0x53')]['query'](_0x50c382,{'type':db[_0x1113('0x54')][_0x1113('0x55')][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63})[_0x1113('0x40')](function(_0xff4bd){_0x26d12b=_['map'](_0xff4bd,function(_0xee5f9b){return Number(_0xee5f9b[_0x1113('0x57')]);});})[_0x1113('0x40')](function(){var _0x50f19=_0x1113('0x58')+_0x3076ee;return db[_0x1113('0x53')][_0x1113('0x32')](_0x50f19,{'type':db[_0x1113('0x54')][_0x1113('0x55')]['SELECT'],'raw':!![],'transaction':_0x5c8c63});})[_0x1113('0x40')](function(_0x54c7c6){var _0x376169=_[_0x1113('0x2c')](_0x54c7c6,function(_0x1e1ea0){return Number(_0x1e1ea0[_0x1113('0x59')]);});return db[_0x1113('0x5a')][_0x1113('0x5b')]({'where':{'UserId':{'$in':_0x26d12b},'VoiceQueueId':{'$in':_0x376169}},'transaction':_0x5c8c63});})['then'](function(){var _0x186cb4=_0x1113('0x5c')+_0x3076ee;return db['sequelize']['query'](_0x186cb4,{'type':db[_0x1113('0x54')][_0x1113('0x55')][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63});})[_0x1113('0x40')](function(_0x17ffa9){var _0xffedc2=_[_0x1113('0x2c')](_0x17ffa9,function(_0x206f9b){return Number(_0x206f9b['MailQueueId']);});return db['UserMailQueue'][_0x1113('0x5b')]({'where':{'UserId':{'$in':_0x26d12b},'MailQueueId':{'$in':_0xffedc2}},'transaction':_0x5c8c63});})['then'](function(){var _0x461aa2=_0x1113('0x5d')+_0x3076ee;return db[_0x1113('0x53')][_0x1113('0x32')](_0x461aa2,{'type':db[_0x1113('0x54')][_0x1113('0x55')][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63});})['then'](function(_0x1a43fd){var _0x1fe50d=_[_0x1113('0x2c')](_0x1a43fd,function(_0x49d969){return Number(_0x49d969['SmsQueueId']);});return db[_0x1113('0x5e')][_0x1113('0x5b')]({'where':{'UserId':{'$in':_0x26d12b},'SmsQueueId':{'$in':_0x1fe50d}},'transaction':_0x5c8c63});})[_0x1113('0x40')](function(){var _0x26a165=_0x1113('0x5f')+_0x3076ee;return db[_0x1113('0x53')][_0x1113('0x32')](_0x26a165,{'type':db[_0x1113('0x54')][_0x1113('0x55')][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63});})[_0x1113('0x40')](function(_0x56f104){var _0x2d3b0f=_[_0x1113('0x2c')](_0x56f104,function(_0x262392){return Number(_0x262392[_0x1113('0x60')]);});return db[_0x1113('0x61')][_0x1113('0x5b')]({'where':{'UserId':{'$in':_0x26d12b},'ChatQueueId':{'$in':_0x2d3b0f}},'transaction':_0x5c8c63});})['then'](function(){var _0xa9671='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3076ee;return db[_0x1113('0x53')][_0x1113('0x32')](_0xa9671,{'type':db['Sequelize']['QueryTypes'][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63});})[_0x1113('0x40')](function(_0x100913){var _0x22bd38=_['map'](_0x100913,function(_0x59435b){return Number(_0x59435b['FaxQueueId']);});return db[_0x1113('0x62')]['destroy']({'where':{'UserId':{'$in':_0x26d12b},'FaxQueueId':{'$in':_0x22bd38}},'transaction':_0x5c8c63});})['then'](function(){var _0x1157c1='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3076ee;return db[_0x1113('0x53')][_0x1113('0x32')](_0x1157c1,{'type':db[_0x1113('0x54')][_0x1113('0x55')][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63});})['then'](function(_0x37b698){var _0x2bb16d=_[_0x1113('0x2c')](_0x37b698,function(_0xd02a80){return Number(_0xd02a80['OpenchannelQueueId']);});return db[_0x1113('0x63')][_0x1113('0x5b')]({'where':{'UserId':{'$in':_0x26d12b},'OpenchannelQueueId':{'$in':_0x2bb16d}},'transaction':_0x5c8c63});})[_0x1113('0x40')](function(){var _0x4a6860=_0x1113('0x64')+_0x3076ee;return db['sequelize'][_0x1113('0x32')](_0x4a6860,{'type':db[_0x1113('0x54')][_0x1113('0x55')][_0x1113('0x56')],'raw':!![],'transaction':_0x5c8c63});})[_0x1113('0x40')](function(_0x15dc5c){var _0x5411f8=_[_0x1113('0x2c')](_0x15dc5c,function(_0x5375f5){return Number(_0x5375f5[_0x1113('0x65')]);});return db['UserWhatsappQueue'][_0x1113('0x5b')]({'where':{'UserId':{'$in':_0x26d12b},'WhatsappQueueId':{'$in':_0x5411f8}},'transaction':_0x5c8c63});})['then'](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x3076ee}});})[_0x1113('0x40')](function(_0x5e2bf1){if(_0x5e2bf1===null){return;}return db[_0x1113('0x66')]['destroy']({'where':{'UserId':{'$in':_0x26d12b},'VoicePrefixId':_0x5e2bf1[_0x1113('0x67')]},'transaction':_0x5c8c63});})['then'](function(){return db[_0x1113('0x2d')]['destroy']({'where':{'id':_0x3076ee},'cascade':!![],'transaction':_0x5c8c63});})[_0x1113('0x40')](function(_0x53bce1){if(_0x53bce1===0x0){_0x17a889[_0x1113('0x1a')](0x194);}else{return db[_0x1113('0x68')]['destroy']({'where':{'type':_0x1113('0x4b'),'resourceId':_0x3076ee},'cascade':!![],'transaction':_0x5c8c63})[_0x1113('0x40')](function(){_0x17a889['status'](0xcc)['end']();});}})[_0x1113('0x44')](function(_0x407bbc){_0x17a889[_0x1113('0x1b')](0x1f4)['send'](_0x407bbc);});});};exports[_0x1113('0x69')]=function(_0xf8de12,_0x23d46f,_0x585edb){return db['Team']['findOne']({'where':{'id':_0xf8de12[_0x1113('0x50')]['id']}})['then'](handleEntityNotFound(_0x23d46f,null))[_0x1113('0x40')](function(_0x2f09cc){if(!_0xf8de12[_0x1113('0x32')]['channel']||!utils[_0x1113('0x6a')](_0xf8de12['query'][_0x1113('0x6b')])){throw new db[(_0x1113('0x54'))][(_0x1113('0x6c'))](_0x1113('0x6d'));}var _0x21d490={};var _0x49f4b1={};_0x49f4b1[_0x1113('0x31')]=_[_0x1113('0x33')](db[_[_0x1113('0x6e')](_0xf8de12['query'][_0x1113('0x6b')][_0x1113('0x6f')]())+'Queue'][_0x1113('0x2e')]);_0x49f4b1['query']=_[_0x1113('0x33')](_0xf8de12['query']);_0x49f4b1['filters']=_[_0x1113('0x35')](_0x49f4b1['model'],_0x49f4b1[_0x1113('0x32')]);_0x21d490[_0x1113('0x36')]=_['intersection'](_0x49f4b1[_0x1113('0x31')],qs['fields'](_0xf8de12[_0x1113('0x32')][_0x1113('0x37')]));_0x21d490[_0x1113('0x36')]=_0x21d490['attributes'][_0x1113('0x38')]?_0x21d490[_0x1113('0x36')]:_0x49f4b1['model'];_0x21d490[_0x1113('0x20')]=qs['limit'](_0xf8de12['query'][_0x1113('0x20')]);_0x21d490[_0x1113('0x1e')]=qs['offset'](_0xf8de12[_0x1113('0x32')][_0x1113('0x1e')]);_0x21d490[_0x1113('0x70')]=qs[_0x1113('0x3b')](_0xf8de12[_0x1113('0x32')]['sort']);_0x21d490['where']=qs['filters'](_[_0x1113('0x71')](_0xf8de12[_0x1113('0x32')],_0x49f4b1['filters']));_0x21d490=_[_0x1113('0x3e')]({},_0x21d490,_0xf8de12['options']);return _0x2f09cc[_0x1113('0x49')+_[_0x1113('0x6e')](_0xf8de12[_0x1113('0x32')][_0x1113('0x6b')][_0x1113('0x6f')]())+_0x1113('0x72')](_0x21d490);})[_0x1113('0x40')](respondWithResult(_0x23d46f,null))['catch'](handleError(_0x23d46f,null));};exports[_0x1113('0x73')]=function(_0x5c7104,_0x27d729,_0xca3ac4){return db['Team'][_0x1113('0x74')]({'where':{'id':_0x5c7104[_0x1113('0x50')]['id']}})[_0x1113('0x40')](function(_0x1ce98d){if(_0x1ce98d){if(!_0x5c7104[_0x1113('0x47')][_0x1113('0x6b')]||!utils[_0x1113('0x6a')](_0x5c7104[_0x1113('0x47')][_0x1113('0x6b')])){throw new db[(_0x1113('0x54'))][(_0x1113('0x6c'))](_0x1113('0x6d'));}return _0x1ce98d[_0x1113('0x75')+_['capitalize'](_0x5c7104['body'][_0x1113('0x6b')][_0x1113('0x6f')]())+_0x1113('0x72')](_0x5c7104[_0x1113('0x47')]['ids']);}return null;})[_0x1113('0x40')](handleEntityNotFound(_0x27d729,null))['then'](respondWithStatusCode(_0x27d729,null))['catch'](handleError(_0x27d729,null));};exports[_0x1113('0x76')]=function(_0x4053d2,_0x400fa0,_0x792093){return db[_0x1113('0x2d')][_0x1113('0x74')]({'where':{'id':_0x4053d2['params']['id']}})[_0x1113('0x40')](function(_0x46ea0f){if(_0x46ea0f){if(!_0x4053d2[_0x1113('0x32')][_0x1113('0x6b')]||!utils['isValidChannel'](_0x4053d2[_0x1113('0x32')][_0x1113('0x6b')])){throw new db[(_0x1113('0x54'))][(_0x1113('0x6c'))]('Unknown\x20channel');}return _0x46ea0f[_0x1113('0x77')+_['capitalize'](_0x4053d2['query'][_0x1113('0x6b')][_0x1113('0x6f')]())+_0x1113('0x72')](_0x4053d2[_0x1113('0x32')]['ids']);}return null;})[_0x1113('0x40')](handleEntityNotFound(_0x400fa0,null))[_0x1113('0x40')](respondWithStatusCode(_0x400fa0,null))[_0x1113('0x44')](handleError(_0x400fa0,null));};exports['addAgents']=function(_0xe1477e,_0x5ae1b7){var _0x22f529=_[_0x1113('0x78')](_0xe1477e[_0x1113('0x47')][_0x1113('0x79')])?_0xe1477e[_0x1113('0x47')][_0x1113('0x79')]:[_0xe1477e[_0x1113('0x47')][_0x1113('0x79')]];var _0xaf1345=_0xe1477e[_0x1113('0x50')]['id'];return db['Team'][_0x1113('0x45')]({'where':{'id':_0xaf1345}})[_0x1113('0x40')](handleEntityNotFound(_0x5ae1b7,null))[_0x1113('0x40')](function(_0x3474fc){if(_0x3474fc){var _0x60ff7=[_0x1113('0x7a'),_0x1113('0x7b'),'Mail',_0x1113('0x7c'),'Fax',_0x1113('0x7d'),_0x1113('0x7e')];return db[_0x1113('0x53')][_0x1113('0x51')](function(_0x3deb90){var _0x392b07=_['map'](_0x60ff7,function(_0x5a8ca8){var _0x514b2d={'attributes':['id',_0x1113('0x29')]};if(_0x5a8ca8===_0x1113('0x7a')){_0x514b2d[_0x1113('0x7f')]={'attributes':['penalty']};}return _0x3474fc[_0x1113('0x49')+_0x5a8ca8+_0x1113('0x72')](_0x514b2d)['then'](function(_0x12fb55){var _0x4b9807=_[_0x1113('0x2c')](_0x12fb55,function(_0x3c3650){var _0x40ba17=_[_0x1113('0x2c')](_0x22f529,function(_0x445342){var _0x29db71={'where':{'UserId':_0x445342,[_0x5a8ca8+'QueueId']:_0x3c3650['id']},'transaction':_0x3deb90};if(_0x5a8ca8===_0x1113('0x7a')){_0x29db71[_0x1113('0x17')]={'penalty':_0x3c3650[_0x1113('0x80')]['penalty']};}return db[_0x1113('0x81')+_0x5a8ca8+_0x1113('0x82')][_0x1113('0x83')](_0x29db71)[_0x1113('0x40')](function(){socket[_0x1113('0x84')](_0x1113('0x48')+_0x5a8ca8+_0x1113('0x85'),{'UserId':_0x445342,[_0x5a8ca8+_0x1113('0x86')]:_0x3c3650['id']});if(_0x5a8ca8!==_0x1113('0x7a')){return;}return db[_0x1113('0x81')][_0x1113('0x87')]({'where':{'id':_0x22f529,'online':0x1},'attributes':['id',_0x1113('0x29'),'online',_0x1113('0x88'),_0x1113('0x89')],'raw':!![]})[_0x1113('0x40')](function(_0x2d98ef){var _0x5f1b0f=_['map'](_0x2d98ef,function(_0x3ab658){return db[_0x1113('0x8a')][_0x1113('0x8b')]({'membername':_0x3ab658[_0x1113('0x29')],'UserId':_0x3ab658['id'],'queue_name':_0x3c3650[_0x1113('0x29')],'VoiceQueueId':_0x3c3650['id'],'interface':_[_0x1113('0x8c')](_0x3ab658['interface'])?util['format'](_0x1113('0x8d'),_0x3ab658['name']):_0x3ab658[_0x1113('0x89')],'paused':_0x3ab658[_0x1113('0x88')]||![],'penalty':_0x3c3650['TeamVoiceQueue'][_0x1113('0x8e')]},{'transaction':_0x3deb90});});return Promise['all'](_0x5f1b0f);});});});return Promise[_0x1113('0x8f')](_0x40ba17);});return Promise[_0x1113('0x8f')](_0x4b9807);})[_0x1113('0x40')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0xaf1345}})[_0x1113('0x40')](function(_0x3b6fe4){if(_0x3b6fe4){var _0x1b2824=_['map'](_0x22f529,function(_0x53eaef){db[_0x1113('0x66')][_0x1113('0x8b')]({'UserId':_0x53eaef,'VoicePrefixId':_0x3b6fe4['VoicePrefixId']});});return Promise[_0x1113('0x8f')](_0x1b2824);}});});});return Promise[_0x1113('0x8f')](_0x392b07)[_0x1113('0x40')](function(){return _0x3474fc['addAgents'](_0x22f529,{'transaction':_0x3deb90})[_0x1113('0x90')](function(_0x2e2878){return _0x2e2878;});});});}})[_0x1113('0x40')](respondWithResult(_0x5ae1b7,null))[_0x1113('0x44')](handleError(_0x5ae1b7,null));};exports[_0x1113('0x91')]=function(_0x305864,_0x28bcf0){var _0x711ae5=_[_0x1113('0x78')](_0x305864['query'][_0x1113('0x79')])?_0x305864[_0x1113('0x32')][_0x1113('0x79')]:[_0x305864['query'][_0x1113('0x79')]];var _0x5e781c=_0x305864[_0x1113('0x50')]['id'];return db[_0x1113('0x2d')][_0x1113('0x45')]({'where':{'id':_0x5e781c}})[_0x1113('0x40')](handleEntityNotFound(_0x28bcf0,null))['then'](function(_0x5448b1){if(_0x5448b1){var _0x2a32c9=['Voice',_0x1113('0x7b'),'Mail',_0x1113('0x7c'),'Fax',_0x1113('0x7d'),_0x1113('0x7e')];return db[_0x1113('0x53')][_0x1113('0x51')](function(_0x467066){var _0x3b7a02=_[_0x1113('0x2c')](_0x2a32c9,function(_0x1808a7){var _0x4e0167={'attributes':['id',_0x1113('0x29')]};return _0x5448b1['get'+_0x1808a7+'Queues'](_0x4e0167)[_0x1113('0x40')](function(_0x2eb310){var _0x555b27=_[_0x1113('0x2c')](_0x2eb310,function(_0x3523f2){return _0x3523f2[_0x1113('0x91')](_0x711ae5,{'transaction':_0x467066})[_0x1113('0x40')](function(){var _0x1e0440=_['map'](_0x711ae5,function(_0x56dd0f){socket['emit'](_0x1113('0x48')+_0x1808a7+'Queue:remove',{'UserId':Number(_0x56dd0f),[_0x1808a7+_0x1113('0x86')]:_0x3523f2['id']});if(_0x1808a7!==_0x1113('0x7a')){return;}return db[_0x1113('0x8a')][_0x1113('0x5b')]({'where':{'VoiceQueueId':_0x3523f2['id'],'UserId':_0x56dd0f},'transaction':_0x467066});});return Promise['all'](_0x1e0440);});});return Promise[_0x1113('0x8f')](_0x555b27);});});return Promise['all'](_0x3b7a02)[_0x1113('0x40')](function(){return _0x5448b1['removeAgents'](_0x711ae5,{'transaction':_0x467066});})['then'](function(){return db[_0x1113('0x92')][_0x1113('0x74')]({'where':{'teamId':_0x5e781c}})[_0x1113('0x40')](function(_0x2404ba){if(_0x2404ba){var _0x5a40fc=_[_0x1113('0x2c')](_0x711ae5,function(_0x3f5654){db[_0x1113('0x66')][_0x1113('0x5b')]({'where':{'UserId':_0x3f5654,'VoicePrefixId':_0x2404ba[_0x1113('0x67')]}});});return Promise[_0x1113('0x8f')](_0x5a40fc);}});});});}})[_0x1113('0x40')](respondWithStatusCode(_0x28bcf0,null))[_0x1113('0x44')](handleError(_0x28bcf0,null));};exports[_0x1113('0x93')]=function(_0x123c20,_0x262951,_0x18ddbe){var _0x34877a={};var _0x6b167={};var _0xdc7b53;var _0x598ad2;return db[_0x1113('0x2d')][_0x1113('0x74')]({'where':{'id':_0x123c20['params']['id']}})[_0x1113('0x40')](handleEntityNotFound(_0x262951,null))[_0x1113('0x40')](function(_0x2ee486){if(_0x2ee486){_0xdc7b53=_0x2ee486;_0x6b167['model']=_[_0x1113('0x33')](db[_0x1113('0x81')][_0x1113('0x2e')]);_0x6b167[_0x1113('0x32')]=_['keys'](_0x123c20['query']);_0x6b167[_0x1113('0x34')]=_[_0x1113('0x35')](_0x6b167['model'],_0x6b167[_0x1113('0x32')]);_0x34877a['attributes']=_['intersection'](_0x6b167[_0x1113('0x31')],qs[_0x1113('0x37')](_0x123c20[_0x1113('0x32')][_0x1113('0x37')]));_0x34877a['attributes']=_0x34877a['attributes'][_0x1113('0x38')]?_0x34877a[_0x1113('0x36')]:_0x6b167['model'];_0x34877a[_0x1113('0x70')]=qs[_0x1113('0x3b')](_0x123c20['query']['sort']);_0x34877a['where']=qs[_0x1113('0x34')](_[_0x1113('0x71')](_0x123c20[_0x1113('0x32')],_0x6b167['filters']));if(_0x123c20['query'][_0x1113('0x3d')]){_0x34877a[_0x1113('0x3c')]=_[_0x1113('0x3e')](_0x34877a[_0x1113('0x3c')],{'$or':_[_0x1113('0x2c')](_0x34877a[_0x1113('0x36')],function(_0x24365d){var _0x38b982={};_0x38b982[_0x24365d]={'$like':'%'+_0x123c20[_0x1113('0x32')][_0x1113('0x3d')]+'%'};return _0x38b982;})});}_0x34877a=_[_0x1113('0x3e')]({},_0x34877a,_0x123c20['options']);return _0xdc7b53[_0x1113('0x93')](_0x34877a);}})[_0x1113('0x40')](function(_0x54f698){if(_0x54f698){_0x598ad2=_0x54f698[_0x1113('0x38')];if(!_0x123c20[_0x1113('0x32')][_0x1113('0x39')](_0x1113('0x3a'))){_0x34877a['limit']=qs[_0x1113('0x20')](_0x123c20['query']['limit']);_0x34877a[_0x1113('0x1e')]=qs['offset'](_0x123c20[_0x1113('0x32')][_0x1113('0x1e')]);}return _0xdc7b53[_0x1113('0x93')](_0x34877a);}})[_0x1113('0x40')](function(_0x14cc9d){if(_0x14cc9d){return _0x14cc9d?{'count':_0x598ad2,'rows':_0x14cc9d}:null;}})['then'](respondWithResult(_0x262951,null))['catch'](handleError(_0x262951,null));}; \ No newline at end of file +var _0xb304=['map','Team','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','body','destroy','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','UserChatQueue','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','UserProfileResource','send','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','Queue','pick','toLowerCase','Queues','add','removeQueues','ValidationError','remove','ids','addAgents','isArray','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','TeamVoiceQueue','penalty','findOrCreate','emit','QueueId','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Mail','Queue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','error','name','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb304,0x6e));var _0x4b30=function(_0xe389ec,_0x5495f6){_0xe389ec=_0xe389ec-0x0;var _0x514596=_0xb304[_0xe389ec];return _0x514596;};'use strict';var emlformat=require(_0x4b30('0x0'));var rimraf=require(_0x4b30('0x1'));var zipdir=require(_0x4b30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b30('0x3'));var moment=require(_0x4b30('0x4'));var BPromise=require(_0x4b30('0x5'));var Mustache=require('mustache');var util=require(_0x4b30('0x6'));var path=require('path');var sox=require(_0x4b30('0x7'));var csv=require(_0x4b30('0x8'));var ejs=require(_0x4b30('0x9'));var fs=require('fs');var fs_extra=require(_0x4b30('0xa'));var _=require(_0x4b30('0xb'));var squel=require(_0x4b30('0xc'));var crypto=require(_0x4b30('0xd'));var jsforce=require(_0x4b30('0xe'));var deskjs=require(_0x4b30('0xf'));var toCsv=require(_0x4b30('0x8'));var querystring=require(_0x4b30('0x10'));var Papa=require(_0x4b30('0x11'));var Redis=require(_0x4b30('0x12'));var authService=require(_0x4b30('0x13'));var qs=require(_0x4b30('0x14'));var as=require(_0x4b30('0x15'));var hardwareService=require(_0x4b30('0x16'));var logger=require(_0x4b30('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4b30('0x18'));var licenseUtil=require(_0x4b30('0x19'));var db=require('../../mysqldb')['db'];config[_0x4b30('0x1a')]=_[_0x4b30('0x1b')](config[_0x4b30('0x1a')],{'host':_0x4b30('0x1c'),'port':0x18eb});var socket=require(_0x4b30('0x1d'))(new Redis(config[_0x4b30('0x1a')]));require(_0x4b30('0x1e'))['register'](socket);function respondWithStatusCode(_0x511db5,_0x1f5aa8){_0x1f5aa8=_0x1f5aa8||0xcc;return function(_0x1afd1b){if(_0x1afd1b){return _0x511db5[_0x4b30('0x1f')](_0x1f5aa8);}return _0x511db5['status'](_0x1f5aa8)[_0x4b30('0x20')]();};}function respondWithResult(_0xdaf2e,_0x32d918){_0x32d918=_0x32d918||0xc8;return function(_0x451471){if(_0x451471){return _0xdaf2e[_0x4b30('0x21')](_0x32d918)[_0x4b30('0x22')](_0x451471);}};}function respondWithFilteredResult(_0x3fb310,_0x40ddfd){return function(_0x5eb0c2){if(_0x5eb0c2){var _0x49e87f=typeof _0x40ddfd[_0x4b30('0x23')]==='undefined'&&typeof _0x40ddfd[_0x4b30('0x24')]===_0x4b30('0x25');var _0x578510=_0x5eb0c2[_0x4b30('0x26')];var _0x387b2d=_0x49e87f?0x0:_0x40ddfd['offset'];var _0x5d1c1e=_0x49e87f?_0x5eb0c2[_0x4b30('0x26')]:_0x40ddfd[_0x4b30('0x23')]+_0x40ddfd[_0x4b30('0x24')];var _0x54bbdd;if(_0x5d1c1e>=_0x578510){_0x5d1c1e=_0x578510;_0x54bbdd=0xc8;}else{_0x54bbdd=0xce;}_0x3fb310[_0x4b30('0x21')](_0x54bbdd);return _0x3fb310[_0x4b30('0x27')](_0x4b30('0x28'),_0x387b2d+'-'+_0x5d1c1e+'/'+_0x578510)[_0x4b30('0x22')](_0x5eb0c2);}return null;};}function patchUpdates(_0x347b3f){return function(_0x137db0){try{jsonpatch[_0x4b30('0x29')](_0x137db0,_0x347b3f,!![]);}catch(_0x3af773){return BPromise[_0x4b30('0x2a')](_0x3af773);}return _0x137db0[_0x4b30('0x2b')]();};}function saveUpdates(_0xf0c624,_0x437da4){return function(_0x213829){if(_0x213829){return _0x213829[_0x4b30('0x2c')](_0xf0c624)['then'](function(_0x27ba95){return _0x27ba95;});}return null;};}function handleEntityNotFound(_0x59e1f9,_0x50dc3e){return function(_0x89fa50){if(!_0x89fa50){_0x59e1f9[_0x4b30('0x1f')](0x194);}return _0x89fa50;};}function handleError(_0x1cd617,_0xac14f6){_0xac14f6=_0xac14f6||0x1f4;return function(_0x5e6da9){logger[_0x4b30('0x2d')](_0x5e6da9['stack']);if(_0x5e6da9[_0x4b30('0x2e')]){delete _0x5e6da9['name'];}_0x1cd617[_0x4b30('0x21')](_0xac14f6)['send'](_0x5e6da9);};}exports[_0x4b30('0x2f')]=function(_0x332608,_0x31dde6){var _0x197bc0={},_0x347220={},_0x1218ab={'count':0x0,'rows':[]};var _0x31525e=_[_0x4b30('0x30')](db[_0x4b30('0x31')][_0x4b30('0x32')],function(_0x2b2c67){return{'name':_0x2b2c67[_0x4b30('0x33')],'type':_0x2b2c67[_0x4b30('0x34')][_0x4b30('0x35')]};});_0x347220[_0x4b30('0x36')]=_['map'](_0x31525e,'name');_0x347220[_0x4b30('0x37')]=_[_0x4b30('0x38')](_0x332608['query']);_0x347220['filters']=_[_0x4b30('0x39')](_0x347220[_0x4b30('0x36')],_0x347220[_0x4b30('0x37')]);_0x197bc0[_0x4b30('0x3a')]=_[_0x4b30('0x39')](_0x347220['model'],qs[_0x4b30('0x3b')](_0x332608[_0x4b30('0x37')][_0x4b30('0x3b')]));_0x197bc0['attributes']=_0x197bc0['attributes'][_0x4b30('0x3c')]?_0x197bc0[_0x4b30('0x3a')]:_0x347220[_0x4b30('0x36')];if(!_0x332608[_0x4b30('0x37')][_0x4b30('0x3d')]('nolimit')){_0x197bc0[_0x4b30('0x24')]=qs[_0x4b30('0x24')](_0x332608[_0x4b30('0x37')][_0x4b30('0x24')]);_0x197bc0[_0x4b30('0x23')]=qs[_0x4b30('0x23')](_0x332608['query']['offset']);}_0x197bc0[_0x4b30('0x3e')]=qs[_0x4b30('0x3f')](_0x332608['query'][_0x4b30('0x3f')]);_0x197bc0[_0x4b30('0x40')]=qs[_0x4b30('0x41')](_['pick'](_0x332608['query'],_0x347220[_0x4b30('0x41')]),_0x31525e);if(_0x332608[_0x4b30('0x37')][_0x4b30('0x42')]){_0x197bc0['where']=_[_0x4b30('0x43')](_0x197bc0[_0x4b30('0x40')],{'$or':_[_0x4b30('0x30')](_0x31525e,function(_0xf6c7de){if(_0xf6c7de[_0x4b30('0x34')]!==_0x4b30('0x44')){var _0xa59eca={};_0xa59eca[_0xf6c7de[_0x4b30('0x2e')]]={'$like':'%'+_0x332608[_0x4b30('0x37')][_0x4b30('0x42')]+'%'};return _0xa59eca;}})});}_0x197bc0=_['merge']({},_0x197bc0,_0x332608[_0x4b30('0x45')]);var _0x203896={'where':_0x197bc0['where']};return db[_0x4b30('0x31')]['count'](_0x203896)[_0x4b30('0x46')](function(_0x3f1022){_0x1218ab[_0x4b30('0x26')]=_0x3f1022;if(_0x332608[_0x4b30('0x37')][_0x4b30('0x47')]){_0x197bc0[_0x4b30('0x48')]=[{'all':!![]}];}return db[_0x4b30('0x31')][_0x4b30('0x49')](_0x197bc0);})['then'](function(_0x1b1f59){_0x1218ab[_0x4b30('0x4a')]=_0x1b1f59;return _0x1218ab;})[_0x4b30('0x46')](respondWithFilteredResult(_0x31dde6,_0x197bc0))[_0x4b30('0x4b')](handleError(_0x31dde6,null));};exports[_0x4b30('0x4c')]=function(_0x44c583,_0x5740a2){var _0x3b2eb5={'raw':![],'where':{'id':_0x44c583[_0x4b30('0x4d')]['id']}},_0x43451f={};_0x43451f[_0x4b30('0x36')]=_[_0x4b30('0x38')](db[_0x4b30('0x31')][_0x4b30('0x32')]);_0x43451f[_0x4b30('0x37')]=_['keys'](_0x44c583['query']);_0x43451f[_0x4b30('0x41')]=_['intersection'](_0x43451f[_0x4b30('0x36')],_0x43451f[_0x4b30('0x37')]);_0x3b2eb5[_0x4b30('0x3a')]=_['intersection'](_0x43451f['model'],qs[_0x4b30('0x3b')](_0x44c583[_0x4b30('0x37')][_0x4b30('0x3b')]));_0x3b2eb5['attributes']=_0x3b2eb5[_0x4b30('0x3a')][_0x4b30('0x3c')]?_0x3b2eb5[_0x4b30('0x3a')]:_0x43451f[_0x4b30('0x36')];if(_0x44c583[_0x4b30('0x37')]['includeAll']){_0x3b2eb5[_0x4b30('0x48')]=[{'all':!![]}];}_0x3b2eb5=_[_0x4b30('0x43')]({},_0x3b2eb5,_0x44c583['options']);return db[_0x4b30('0x31')][_0x4b30('0x4e')](_0x3b2eb5)[_0x4b30('0x46')](handleEntityNotFound(_0x5740a2,null))[_0x4b30('0x46')](respondWithResult(_0x5740a2,null))[_0x4b30('0x4b')](handleError(_0x5740a2,null));};exports[_0x4b30('0x4f')]=function(_0x220403,_0x5702d1){return db[_0x4b30('0x31')]['create'](_0x220403['body'],{})[_0x4b30('0x46')](function(_0x35ff13){var _0x3c928f=_0x220403[_0x4b30('0x50')][_0x4b30('0x51')]({'plain':!![]});if(!_0x3c928f)throw new Error(_0x4b30('0x52'));if(_0x3c928f[_0x4b30('0x53')]===_0x4b30('0x50')){var _0x4a554a=_0x35ff13[_0x4b30('0x51')]({'plain':!![]});var _0x411eba=_0x4b30('0x54');return db[_0x4b30('0x55')][_0x4b30('0x4e')]({'where':{'name':_0x411eba,'userProfileId':_0x3c928f[_0x4b30('0x56')]},'raw':!![]})[_0x4b30('0x46')](function(_0xfde78c){if(_0xfde78c&&_0xfde78c[_0x4b30('0x57')]===0x0){return db['UserProfileResource'][_0x4b30('0x4f')]({'name':_0x4a554a[_0x4b30('0x2e')],'resourceId':_0x4a554a['id'],'type':_0xfde78c[_0x4b30('0x2e')],'sectionId':_0xfde78c['id']},{})[_0x4b30('0x46')](function(){return _0x35ff13;});}else{return _0x35ff13;}})[_0x4b30('0x4b')](function(_0x2f5a4f){logger[_0x4b30('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f5a4f);throw _0x2f5a4f;});}return _0x35ff13;})[_0x4b30('0x46')](respondWithResult(_0x5702d1,0xc9))[_0x4b30('0x4b')](handleError(_0x5702d1,null));};exports['update']=function(_0x1f6ccc,_0x4a58de){if(_0x1f6ccc[_0x4b30('0x58')]['id']){delete _0x1f6ccc[_0x4b30('0x58')]['id'];}return db[_0x4b30('0x31')][_0x4b30('0x4e')]({'where':{'id':_0x1f6ccc[_0x4b30('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a58de,null))['then'](saveUpdates(_0x1f6ccc[_0x4b30('0x58')],null))[_0x4b30('0x46')](respondWithResult(_0x4a58de,null))[_0x4b30('0x4b')](handleError(_0x4a58de,null));};exports[_0x4b30('0x59')]=function(_0x48b028,_0x5a066c){var _0x5a616d=_0x48b028[_0x4b30('0x4d')]['id'];var _0xa1f766=[];return db['sequelize']['transaction'](function(_0x329919){var _0x1d5bb1='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x5a616d;return db[_0x4b30('0x5a')][_0x4b30('0x37')](_0x1d5bb1,{'type':db[_0x4b30('0x5b')][_0x4b30('0x5c')]['SELECT'],'raw':!![],'transaction':_0x329919})[_0x4b30('0x46')](function(_0x261f74){_0xa1f766=_['map'](_0x261f74,function(_0x27af20){return Number(_0x27af20[_0x4b30('0x5d')]);});})['then'](function(){var _0x35c904=_0x4b30('0x5e')+_0x5a616d;return db[_0x4b30('0x5a')]['query'](_0x35c904,{'type':db[_0x4b30('0x5b')][_0x4b30('0x5c')]['SELECT'],'raw':!![],'transaction':_0x329919});})[_0x4b30('0x46')](function(_0x3b5027){var _0x541797=_['map'](_0x3b5027,function(_0x188e56){return Number(_0x188e56[_0x4b30('0x5f')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0xa1f766},'VoiceQueueId':{'$in':_0x541797}},'transaction':_0x329919});})[_0x4b30('0x46')](function(){var _0xc88f80='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5a616d;return db[_0x4b30('0x5a')]['query'](_0xc88f80,{'type':db[_0x4b30('0x5b')][_0x4b30('0x5c')][_0x4b30('0x60')],'raw':!![],'transaction':_0x329919});})['then'](function(_0x49e873){var _0x4a6e22=_[_0x4b30('0x30')](_0x49e873,function(_0x4caf08){return Number(_0x4caf08[_0x4b30('0x61')]);});return db['UserMailQueue'][_0x4b30('0x59')]({'where':{'UserId':{'$in':_0xa1f766},'MailQueueId':{'$in':_0x4a6e22}},'transaction':_0x329919});})[_0x4b30('0x46')](function(){var _0x5ecabe=_0x4b30('0x62')+_0x5a616d;return db['sequelize']['query'](_0x5ecabe,{'type':db[_0x4b30('0x5b')]['QueryTypes'][_0x4b30('0x60')],'raw':!![],'transaction':_0x329919});})['then'](function(_0x201e51){var _0x280663=_[_0x4b30('0x30')](_0x201e51,function(_0x46bce1){return Number(_0x46bce1[_0x4b30('0x63')]);});return db[_0x4b30('0x64')]['destroy']({'where':{'UserId':{'$in':_0xa1f766},'SmsQueueId':{'$in':_0x280663}},'transaction':_0x329919});})['then'](function(){var _0x2441f6='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5a616d;return db[_0x4b30('0x5a')]['query'](_0x2441f6,{'type':db['Sequelize'][_0x4b30('0x5c')]['SELECT'],'raw':!![],'transaction':_0x329919});})['then'](function(_0x2fb19d){var _0x47d8de=_[_0x4b30('0x30')](_0x2fb19d,function(_0x3d0681){return Number(_0x3d0681['ChatQueueId']);});return db[_0x4b30('0x65')]['destroy']({'where':{'UserId':{'$in':_0xa1f766},'ChatQueueId':{'$in':_0x47d8de}},'transaction':_0x329919});})[_0x4b30('0x46')](function(){var _0x351a14='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5a616d;return db[_0x4b30('0x5a')][_0x4b30('0x37')](_0x351a14,{'type':db['Sequelize'][_0x4b30('0x5c')][_0x4b30('0x60')],'raw':!![],'transaction':_0x329919});})[_0x4b30('0x46')](function(_0x3d9435){var _0xefc032=_[_0x4b30('0x30')](_0x3d9435,function(_0x47ee55){return Number(_0x47ee55['FaxQueueId']);});return db['UserFaxQueue'][_0x4b30('0x59')]({'where':{'UserId':{'$in':_0xa1f766},'FaxQueueId':{'$in':_0xefc032}},'transaction':_0x329919});})[_0x4b30('0x46')](function(){var _0x3ddb8d=_0x4b30('0x66')+_0x5a616d;return db['sequelize'][_0x4b30('0x37')](_0x3ddb8d,{'type':db[_0x4b30('0x5b')][_0x4b30('0x5c')][_0x4b30('0x60')],'raw':!![],'transaction':_0x329919});})[_0x4b30('0x46')](function(_0x42c5ed){var _0x117f78=_[_0x4b30('0x30')](_0x42c5ed,function(_0x362874){return Number(_0x362874[_0x4b30('0x67')]);});return db[_0x4b30('0x68')][_0x4b30('0x59')]({'where':{'UserId':{'$in':_0xa1f766},'OpenchannelQueueId':{'$in':_0x117f78}},'transaction':_0x329919});})[_0x4b30('0x46')](function(){var _0x53d6bf=_0x4b30('0x69')+_0x5a616d;return db[_0x4b30('0x5a')][_0x4b30('0x37')](_0x53d6bf,{'type':db[_0x4b30('0x5b')][_0x4b30('0x5c')][_0x4b30('0x60')],'raw':!![],'transaction':_0x329919});})[_0x4b30('0x46')](function(_0xc9fa0b){var _0x3c8d6a=_[_0x4b30('0x30')](_0xc9fa0b,function(_0x3ccfa9){return Number(_0x3ccfa9[_0x4b30('0x6a')]);});return db[_0x4b30('0x6b')][_0x4b30('0x59')]({'where':{'UserId':{'$in':_0xa1f766},'WhatsappQueueId':{'$in':_0x3c8d6a}},'transaction':_0x329919});})[_0x4b30('0x46')](function(){return db[_0x4b30('0x6c')][_0x4b30('0x4e')]({'where':{'TeamId':_0x5a616d}});})[_0x4b30('0x46')](function(_0x57b2d9){if(_0x57b2d9===null){return;}return db[_0x4b30('0x6d')][_0x4b30('0x59')]({'where':{'UserId':{'$in':_0xa1f766},'VoicePrefixId':_0x57b2d9[_0x4b30('0x6e')]},'transaction':_0x329919});})['then'](function(){return db[_0x4b30('0x31')][_0x4b30('0x59')]({'where':{'id':_0x5a616d},'cascade':!![],'transaction':_0x329919});})['then'](function(_0x26cd49){if(_0x26cd49===0x0){_0x5a066c[_0x4b30('0x1f')](0x194);}else{return db[_0x4b30('0x6f')][_0x4b30('0x59')]({'where':{'type':_0x4b30('0x54'),'resourceId':_0x5a616d},'cascade':!![],'transaction':_0x329919})['then'](function(){_0x5a066c[_0x4b30('0x21')](0xcc)[_0x4b30('0x20')]();});}})['catch'](function(_0x5137e8){_0x5a066c[_0x4b30('0x21')](0x1f4)[_0x4b30('0x70')](_0x5137e8);});});};exports[_0x4b30('0x71')]=function(_0xc1a7e6,_0x4d0667,_0x179ad0){return db[_0x4b30('0x31')][_0x4b30('0x72')]({'where':{'id':_0xc1a7e6[_0x4b30('0x4d')]['id']}})[_0x4b30('0x46')](handleEntityNotFound(_0x4d0667,null))[_0x4b30('0x46')](function(_0x46dc29){if(!_0xc1a7e6[_0x4b30('0x37')][_0x4b30('0x73')]||!utils[_0x4b30('0x74')](_0xc1a7e6[_0x4b30('0x37')][_0x4b30('0x73')])){throw new db[(_0x4b30('0x5b'))]['ValidationError'](_0x4b30('0x75'));}var _0x493044={};var _0x4a38e4={};_0x4a38e4[_0x4b30('0x36')]=_[_0x4b30('0x38')](db[_[_0x4b30('0x76')](_0xc1a7e6[_0x4b30('0x37')][_0x4b30('0x73')]['toLowerCase']())+_0x4b30('0x77')][_0x4b30('0x32')]);_0x4a38e4[_0x4b30('0x37')]=_[_0x4b30('0x38')](_0xc1a7e6['query']);_0x4a38e4[_0x4b30('0x41')]=_[_0x4b30('0x39')](_0x4a38e4[_0x4b30('0x36')],_0x4a38e4[_0x4b30('0x37')]);_0x493044[_0x4b30('0x3a')]=_[_0x4b30('0x39')](_0x4a38e4[_0x4b30('0x36')],qs[_0x4b30('0x3b')](_0xc1a7e6[_0x4b30('0x37')]['fields']));_0x493044[_0x4b30('0x3a')]=_0x493044[_0x4b30('0x3a')][_0x4b30('0x3c')]?_0x493044[_0x4b30('0x3a')]:_0x4a38e4[_0x4b30('0x36')];_0x493044['limit']=qs[_0x4b30('0x24')](_0xc1a7e6[_0x4b30('0x37')]['limit']);_0x493044[_0x4b30('0x23')]=qs[_0x4b30('0x23')](_0xc1a7e6[_0x4b30('0x37')][_0x4b30('0x23')]);_0x493044[_0x4b30('0x3e')]=qs[_0x4b30('0x3f')](_0xc1a7e6[_0x4b30('0x37')][_0x4b30('0x3f')]);_0x493044[_0x4b30('0x40')]=qs[_0x4b30('0x41')](_[_0x4b30('0x78')](_0xc1a7e6['query'],_0x4a38e4[_0x4b30('0x41')]));_0x493044=_['merge']({},_0x493044,_0xc1a7e6[_0x4b30('0x45')]);return _0x46dc29[_0x4b30('0x51')+_[_0x4b30('0x76')](_0xc1a7e6[_0x4b30('0x37')]['channel'][_0x4b30('0x79')]())+_0x4b30('0x7a')](_0x493044);})[_0x4b30('0x46')](respondWithResult(_0x4d0667,null))[_0x4b30('0x4b')](handleError(_0x4d0667,null));};exports['addQueues']=function(_0x497290,_0x1706b5,_0x40da6d){return db['Team'][_0x4b30('0x72')]({'where':{'id':_0x497290[_0x4b30('0x4d')]['id']}})[_0x4b30('0x46')](function(_0x2ff2ea){if(_0x2ff2ea){if(!_0x497290['body'][_0x4b30('0x73')]||!utils['isValidChannel'](_0x497290[_0x4b30('0x58')]['channel'])){throw new db[(_0x4b30('0x5b'))]['ValidationError'](_0x4b30('0x75'));}return _0x2ff2ea[_0x4b30('0x7b')+_[_0x4b30('0x76')](_0x497290['body'][_0x4b30('0x73')]['toLowerCase']())+_0x4b30('0x7a')](_0x497290[_0x4b30('0x58')]['ids']);}return null;})['then'](handleEntityNotFound(_0x1706b5,null))[_0x4b30('0x46')](respondWithStatusCode(_0x1706b5,null))[_0x4b30('0x4b')](handleError(_0x1706b5,null));};exports[_0x4b30('0x7c')]=function(_0x8992e8,_0x3cd6ba,_0x418853){return db[_0x4b30('0x31')][_0x4b30('0x72')]({'where':{'id':_0x8992e8[_0x4b30('0x4d')]['id']}})[_0x4b30('0x46')](function(_0x268766){if(_0x268766){if(!_0x8992e8[_0x4b30('0x37')][_0x4b30('0x73')]||!utils[_0x4b30('0x74')](_0x8992e8[_0x4b30('0x37')][_0x4b30('0x73')])){throw new db['Sequelize'][(_0x4b30('0x7d'))](_0x4b30('0x75'));}return _0x268766[_0x4b30('0x7e')+_['capitalize'](_0x8992e8[_0x4b30('0x37')][_0x4b30('0x73')][_0x4b30('0x79')]())+_0x4b30('0x7a')](_0x8992e8[_0x4b30('0x37')][_0x4b30('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x3cd6ba,null))[_0x4b30('0x46')](respondWithStatusCode(_0x3cd6ba,null))[_0x4b30('0x4b')](handleError(_0x3cd6ba,null));};exports[_0x4b30('0x80')]=function(_0x48c2f6,_0x488c0c){var _0x2c6478=_[_0x4b30('0x81')](_0x48c2f6[_0x4b30('0x58')][_0x4b30('0x7f')])?_0x48c2f6[_0x4b30('0x58')][_0x4b30('0x7f')]:[_0x48c2f6[_0x4b30('0x58')][_0x4b30('0x7f')]];var _0x101739=_0x48c2f6[_0x4b30('0x4d')]['id'];return db['Team']['find']({'where':{'id':_0x101739}})[_0x4b30('0x46')](handleEntityNotFound(_0x488c0c,null))[_0x4b30('0x46')](function(_0x2d08aa){if(_0x2d08aa){var _0x2c018c=['Voice',_0x4b30('0x82'),'Mail',_0x4b30('0x83'),_0x4b30('0x84'),_0x4b30('0x85'),_0x4b30('0x86')];return db[_0x4b30('0x5a')][_0x4b30('0x87')](function(_0x14f775){var _0x11e6c2=_[_0x4b30('0x30')](_0x2c018c,function(_0x354938){var _0x36f138={'attributes':['id',_0x4b30('0x2e')]};if(_0x354938===_0x4b30('0x88')){_0x36f138[_0x4b30('0x89')]={'attributes':['penalty']};}return _0x2d08aa[_0x4b30('0x51')+_0x354938+'Queues'](_0x36f138)['then'](function(_0x260ab6){var _0x2ff4c7=_[_0x4b30('0x30')](_0x260ab6,function(_0x192621){var _0x588496=_[_0x4b30('0x30')](_0x2c6478,function(_0x3b13ae){var _0x35f311={'where':{'UserId':_0x3b13ae,[_0x354938+'QueueId']:_0x192621['id']},'transaction':_0x14f775};if(_0x354938===_0x4b30('0x88')){_0x35f311[_0x4b30('0x1b')]={'penalty':_0x192621[_0x4b30('0x8a')][_0x4b30('0x8b')]};}return db['User'+_0x354938+_0x4b30('0x77')][_0x4b30('0x8c')](_0x35f311)[_0x4b30('0x46')](function(){socket[_0x4b30('0x8d')](_0x4b30('0x50')+_0x354938+'Queue:save',{'UserId':_0x3b13ae,[_0x354938+_0x4b30('0x8e')]:_0x192621['id']});if(_0x354938!=='Voice'){return;}return db[_0x4b30('0x8f')][_0x4b30('0x49')]({'where':{'id':_0x2c6478,'online':0x1},'attributes':['id',_0x4b30('0x2e'),_0x4b30('0x90'),_0x4b30('0x91'),_0x4b30('0x92')],'raw':!![]})[_0x4b30('0x46')](function(_0xf017dc){var _0x2bc0d3=_['map'](_0xf017dc,function(_0x4acf36){return db[_0x4b30('0x93')][_0x4b30('0x94')]({'membername':_0x4acf36[_0x4b30('0x2e')],'UserId':_0x4acf36['id'],'queue_name':_0x192621[_0x4b30('0x2e')],'VoiceQueueId':_0x192621['id'],'interface':_[_0x4b30('0x95')](_0x4acf36['interface'])?util[_0x4b30('0x96')](_0x4b30('0x97'),_0x4acf36[_0x4b30('0x2e')]):_0x4acf36[_0x4b30('0x92')],'paused':_0x4acf36[_0x4b30('0x91')]||![],'penalty':_0x192621[_0x4b30('0x8a')][_0x4b30('0x8b')]},{'transaction':_0x14f775});});return Promise[_0x4b30('0x98')](_0x2bc0d3);});});});return Promise[_0x4b30('0x98')](_0x588496);});return Promise[_0x4b30('0x98')](_0x2ff4c7);})[_0x4b30('0x46')](function(){return db[_0x4b30('0x6c')][_0x4b30('0x72')]({'where':{'teamId':_0x101739}})[_0x4b30('0x46')](function(_0x3000e5){if(_0x3000e5){var _0x208956=_[_0x4b30('0x30')](_0x2c6478,function(_0x58d2b3){db[_0x4b30('0x6d')]['upsert']({'UserId':_0x58d2b3,'VoicePrefixId':_0x3000e5[_0x4b30('0x6e')]});});return Promise[_0x4b30('0x98')](_0x208956);}});});});return Promise[_0x4b30('0x98')](_0x11e6c2)['then'](function(){return _0x2d08aa['addAgents'](_0x2c6478,{'transaction':_0x14f775})[_0x4b30('0x99')](function(_0x62b77a){return _0x62b77a;});});});}})[_0x4b30('0x46')](respondWithResult(_0x488c0c,null))[_0x4b30('0x4b')](handleError(_0x488c0c,null));};exports[_0x4b30('0x9a')]=function(_0x1424a8,_0x4ff66f){var _0x1fae28=_[_0x4b30('0x81')](_0x1424a8[_0x4b30('0x37')]['ids'])?_0x1424a8[_0x4b30('0x37')][_0x4b30('0x7f')]:[_0x1424a8[_0x4b30('0x37')][_0x4b30('0x7f')]];var _0x284ab5=_0x1424a8['params']['id'];return db['Team'][_0x4b30('0x4e')]({'where':{'id':_0x284ab5}})[_0x4b30('0x46')](handleEntityNotFound(_0x4ff66f,null))[_0x4b30('0x46')](function(_0x29b7fe){if(_0x29b7fe){var _0x1be364=[_0x4b30('0x88'),_0x4b30('0x82'),_0x4b30('0x9b'),_0x4b30('0x83'),_0x4b30('0x84'),_0x4b30('0x85'),_0x4b30('0x86')];return db[_0x4b30('0x5a')][_0x4b30('0x87')](function(_0x369538){var _0x906d35=_[_0x4b30('0x30')](_0x1be364,function(_0x2e86a5){var _0x54f7ca={'attributes':['id',_0x4b30('0x2e')]};return _0x29b7fe[_0x4b30('0x51')+_0x2e86a5+_0x4b30('0x7a')](_0x54f7ca)[_0x4b30('0x46')](function(_0x103135){var _0x39f7bc=_[_0x4b30('0x30')](_0x103135,function(_0x617598){return _0x617598['removeAgents'](_0x1fae28,{'transaction':_0x369538})[_0x4b30('0x46')](function(){var _0x3541b3=_[_0x4b30('0x30')](_0x1fae28,function(_0x344914){socket['emit']('user'+_0x2e86a5+_0x4b30('0x9c'),{'UserId':Number(_0x344914),[_0x2e86a5+_0x4b30('0x8e')]:_0x617598['id']});if(_0x2e86a5!=='Voice'){return;}return db[_0x4b30('0x93')]['destroy']({'where':{'VoiceQueueId':_0x617598['id'],'UserId':_0x344914},'transaction':_0x369538});});return Promise[_0x4b30('0x98')](_0x3541b3);});});return Promise[_0x4b30('0x98')](_0x39f7bc);});});return Promise['all'](_0x906d35)['then'](function(){return _0x29b7fe[_0x4b30('0x9a')](_0x1fae28,{'transaction':_0x369538});})[_0x4b30('0x46')](function(){return db['TeamVoicePrefix'][_0x4b30('0x72')]({'where':{'teamId':_0x284ab5}})[_0x4b30('0x46')](function(_0x2d6bd){if(_0x2d6bd){var _0x561760=_[_0x4b30('0x30')](_0x1fae28,function(_0x31668b){db[_0x4b30('0x6d')][_0x4b30('0x59')]({'where':{'UserId':_0x31668b,'VoicePrefixId':_0x2d6bd[_0x4b30('0x6e')]}});});return Promise[_0x4b30('0x98')](_0x561760);}});});});}})['then'](respondWithStatusCode(_0x4ff66f,null))['catch'](handleError(_0x4ff66f,null));};exports[_0x4b30('0x9d')]=function(_0xcc164f,_0x230996,_0x518db3){var _0x244518={};var _0x2fded5={};var _0x1f6eb;var _0x40386e;return db[_0x4b30('0x31')][_0x4b30('0x72')]({'where':{'id':_0xcc164f['params']['id']}})[_0x4b30('0x46')](handleEntityNotFound(_0x230996,null))['then'](function(_0x5ad7ad){if(_0x5ad7ad){_0x1f6eb=_0x5ad7ad;_0x2fded5[_0x4b30('0x36')]=_[_0x4b30('0x38')](db[_0x4b30('0x8f')][_0x4b30('0x32')]);_0x2fded5['query']=_[_0x4b30('0x38')](_0xcc164f['query']);_0x2fded5[_0x4b30('0x41')]=_[_0x4b30('0x39')](_0x2fded5[_0x4b30('0x36')],_0x2fded5['query']);_0x244518[_0x4b30('0x3a')]=_[_0x4b30('0x39')](_0x2fded5['model'],qs[_0x4b30('0x3b')](_0xcc164f[_0x4b30('0x37')][_0x4b30('0x3b')]));_0x244518[_0x4b30('0x3a')]=_0x244518[_0x4b30('0x3a')][_0x4b30('0x3c')]?_0x244518[_0x4b30('0x3a')]:_0x2fded5[_0x4b30('0x36')];_0x244518[_0x4b30('0x3e')]=qs[_0x4b30('0x3f')](_0xcc164f[_0x4b30('0x37')][_0x4b30('0x3f')]);_0x244518['where']=qs[_0x4b30('0x41')](_[_0x4b30('0x78')](_0xcc164f['query'],_0x2fded5['filters']));if(_0xcc164f['query'][_0x4b30('0x42')]){_0x244518[_0x4b30('0x40')]=_[_0x4b30('0x43')](_0x244518[_0x4b30('0x40')],{'$or':_[_0x4b30('0x30')](_0x244518[_0x4b30('0x3a')],function(_0x28b8fc){var _0x49d6c1={};_0x49d6c1[_0x28b8fc]={'$like':'%'+_0xcc164f[_0x4b30('0x37')]['filter']+'%'};return _0x49d6c1;})});}_0x244518=_['merge']({},_0x244518,_0xcc164f[_0x4b30('0x45')]);return _0x1f6eb[_0x4b30('0x9d')](_0x244518);}})[_0x4b30('0x46')](function(_0x767d85){if(_0x767d85){_0x40386e=_0x767d85[_0x4b30('0x3c')];if(!_0xcc164f['query'][_0x4b30('0x3d')]('nolimit')){_0x244518[_0x4b30('0x24')]=qs['limit'](_0xcc164f[_0x4b30('0x37')]['limit']);_0x244518[_0x4b30('0x23')]=qs[_0x4b30('0x23')](_0xcc164f[_0x4b30('0x37')][_0x4b30('0x23')]);}return _0x1f6eb[_0x4b30('0x9d')](_0x244518);}})[_0x4b30('0x46')](function(_0xd9eba4){if(_0xd9eba4){return _0xd9eba4?{'count':_0x40386e,'rows':_0xd9eba4}:null;}})['then'](respondWithResult(_0x230996,null))[_0x4b30('0x4b')](handleError(_0x230996,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index aa000a8..14ec92d 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 _0x7c70=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','Team'];(function(_0x21ab82,_0x32ca06){var _0x44981c=function(_0x3e246b){while(--_0x3e246b){_0x21ab82['push'](_0x21ab82['shift']());}};_0x44981c(++_0x32ca06);}(_0x7c70,0x1d5));var _0x07c7=function(_0x3bb830,_0xa498c1){_0x3bb830=_0x3bb830-0x0;var _0x309778=_0x7c70[_0x3bb830];return _0x309778;};'use strict';var EventEmitter=require(_0x07c7('0x0'));var Team=require(_0x07c7('0x1'))['db'][_0x07c7('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x07c7('0x3'),'afterUpdate':_0x07c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b6a65){return function(_0x4cacb9,_0x27a334,_0x27d312){TeamEvents[_0x07c7('0x5')](_0x1b6a65+':'+_0x4cacb9['id'],_0x4cacb9);TeamEvents[_0x07c7('0x5')](_0x1b6a65,_0x4cacb9);_0x27d312(null);};}for(var e in events){if(events[_0x07c7('0x6')](e)){var event=events[e];Team[_0x07c7('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x99d8=['remove','emit','hasOwnProperty','events','../../mysqldb','Team','update'];(function(_0x1e540c,_0x19a403){var _0x321559=function(_0x37bd18){while(--_0x37bd18){_0x1e540c['push'](_0x1e540c['shift']());}};_0x321559(++_0x19a403);}(_0x99d8,0x199));var _0x899d=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0x99d8[_0x589aee];return _0x2f5ed4;};'use strict';var EventEmitter=require(_0x899d('0x0'));var Team=require(_0x899d('0x1'))['db'][_0x899d('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x899d('0x3'),'afterDestroy':_0x899d('0x4')};function emitEvent(_0x5bd064){return function(_0x33dd13,_0x2febd7,_0x55861){TeamEvents[_0x899d('0x5')](_0x5bd064+':'+_0x33dd13['id'],_0x33dd13);TeamEvents[_0x899d('0x5')](_0x5bd064,_0x33dd13);_0x55861(null);};}for(var e in events){if(events[_0x899d('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0e3d6e4..74bf371 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 _0x2964=['../../config/environment','./team.attributes','exports','define','Team','teams','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x282dcf,_0x3fd88e){var _0x23c397=function(_0x47d1c9){while(--_0x47d1c9){_0x282dcf['push'](_0x282dcf['shift']());}};_0x23c397(++_0x3fd88e);}(_0x2964,0x66));var _0x4296=function(_0x2a5d29,_0x1b66d9){_0x2a5d29=_0x2a5d29-0x0;var _0x3f4395=_0x2964[_0x2a5d29];return _0x3f4395;};'use strict';var _=require('lodash');var util=require(_0x4296('0x0'));var logger=require(_0x4296('0x1'))(_0x4296('0x2'));var moment=require('moment');var BPromise=require(_0x4296('0x3'));var rp=require(_0x4296('0x4'));var fs=require('fs');var path=require(_0x4296('0x5'));var rimraf=require('rimraf');var config=require(_0x4296('0x6'));var attributes=require(_0x4296('0x7'));module[_0x4296('0x8')]=function(_0x13b67f,_0x1e6c31){return _0x13b67f[_0x4296('0x9')](_0x4296('0xa'),attributes,{'tableName':_0x4296('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ca8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','teams','lodash','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3ca8,0xe2));var _0x83ca=function(_0x481ca3,_0x179c12){_0x481ca3=_0x481ca3-0x0;var _0xa9a4ef=_0x3ca8[_0x481ca3];return _0xa9a4ef;};'use strict';var _=require(_0x83ca('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x83ca('0x1'));var moment=require(_0x83ca('0x2'));var BPromise=require(_0x83ca('0x3'));var rp=require(_0x83ca('0x4'));var fs=require('fs');var path=require(_0x83ca('0x5'));var rimraf=require(_0x83ca('0x6'));var config=require(_0x83ca('0x7'));var attributes=require(_0x83ca('0x8'));module['exports']=function(_0x240045,_0x34ef63){return _0x240045[_0x83ca('0x9')](_0x83ca('0xa'),attributes,{'tableName':_0x83ca('0xb'),'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 a536492..f9e4475 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 _0xe491=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x5502a7,_0x325618){var _0x3946fa=function(_0x1c8383){while(--_0x1c8383){_0x5502a7['push'](_0x5502a7['shift']());}};_0x3946fa(++_0x325618);}(_0xe491,0x1a0));var _0x1e49=function(_0x1f7dfa,_0x415b27){_0x1f7dfa=_0x1f7dfa-0x0;var _0x13bb78=_0xe491[_0x1f7dfa];return _0x13bb78;};'use strict';var _=require(_0x1e49('0x0'));var util=require(_0x1e49('0x1'));var moment=require('moment');var BPromise=require(_0x1e49('0x2'));var rs=require(_0x1e49('0x3'));var fs=require('fs');var Redis=require(_0x1e49('0x4'));var db=require(_0x1e49('0x5'))['db'];var utils=require(_0x1e49('0x6'));var logger=require(_0x1e49('0x7'))(_0x1e49('0x8'));var config=require('../../config/environment');var jayson=require(_0x1e49('0x9'));var client=jayson[_0x1e49('0xa')][_0x1e49('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1e49('0xc')],{'host':_0x1e49('0xd'),'port':0x18eb});var socket=require(_0x1e49('0xe'))(new Redis(config[_0x1e49('0xc')]));require(_0x1e49('0xf'))[_0x1e49('0x10')](socket);function respondWithRpcPromise(_0x57f7b0,_0x478477,_0x31a078){return new BPromise(function(_0x2a365a,_0x435287){return client[_0x1e49('0x11')](_0x57f7b0,_0x31a078)['then'](function(_0x1a221){logger[_0x1e49('0x12')](_0x1e49('0x13'),_0x478477,_0x1e49('0x14'));logger['debug'](_0x1e49('0x15'),_0x478477,_0x1e49('0x14'),JSON['stringify'](_0x1a221));if(_0x1a221[_0x1e49('0x16')]){if(_0x1a221[_0x1e49('0x16')]['code']===0x1f4){logger[_0x1e49('0x16')]('Team,\x20%s,\x20%s',_0x478477,_0x1a221[_0x1e49('0x16')][_0x1e49('0x17')]);return _0x435287(_0x1a221[_0x1e49('0x16')][_0x1e49('0x17')]);}logger[_0x1e49('0x16')]('Team,\x20%s,\x20%s',_0x478477,_0x1a221[_0x1e49('0x16')][_0x1e49('0x17')]);return _0x2a365a(_0x1a221[_0x1e49('0x16')][_0x1e49('0x17')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x478477,_0x1e49('0x14'));_0x2a365a(_0x1a221[_0x1e49('0x18')][_0x1e49('0x17')]);}})[_0x1e49('0x19')](function(_0x3cb6ff){logger[_0x1e49('0x16')]('Team,\x20%s,\x20%s',_0x478477,_0x3cb6ff);_0x435287(_0x3cb6ff);});});} \ No newline at end of file +var _0x1801=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x236770,_0x8553){var _0x521ffd=function(_0x17867f){while(--_0x17867f){_0x236770['push'](_0x236770['shift']());}};_0x521ffd(++_0x8553);}(_0x1801,0x68));var _0x1180=function(_0x29f377,_0x1493d1){_0x29f377=_0x29f377-0x0;var _0x595631=_0x1801[_0x29f377];return _0x595631;};'use strict';var _=require(_0x1180('0x0'));var util=require(_0x1180('0x1'));var moment=require(_0x1180('0x2'));var BPromise=require(_0x1180('0x3'));var rs=require(_0x1180('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1180('0x5'))['db'];var utils=require(_0x1180('0x6'));var logger=require(_0x1180('0x7'))(_0x1180('0x8'));var config=require(_0x1180('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1180('0xa')]({'port':0x232a});config[_0x1180('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1180('0xc'))(new Redis(config[_0x1180('0xb')]));require(_0x1180('0xd'))[_0x1180('0xe')](socket);function respondWithRpcPromise(_0x444f81,_0x6714b6,_0x5be110){return new BPromise(function(_0x4e54ce,_0x4b37ab){return client[_0x1180('0xf')](_0x444f81,_0x5be110)['then'](function(_0x4188e4){logger[_0x1180('0x10')](_0x1180('0x11'),_0x6714b6,'request\x20sent');logger['debug'](_0x1180('0x12'),_0x6714b6,'request\x20sent',JSON[_0x1180('0x13')](_0x4188e4));if(_0x4188e4[_0x1180('0x14')]){if(_0x4188e4[_0x1180('0x14')][_0x1180('0x15')]===0x1f4){logger['error'](_0x1180('0x11'),_0x6714b6,_0x4188e4['error'][_0x1180('0x16')]);return _0x4b37ab(_0x4188e4[_0x1180('0x14')][_0x1180('0x16')]);}logger[_0x1180('0x14')](_0x1180('0x11'),_0x6714b6,_0x4188e4[_0x1180('0x14')]['message']);return _0x4e54ce(_0x4188e4[_0x1180('0x14')]['message']);}else{logger[_0x1180('0x10')](_0x1180('0x11'),_0x6714b6,'request\x20sent');_0x4e54ce(_0x4188e4[_0x1180('0x17')]['message']);}})[_0x1180('0x18')](function(_0x19691c){logger[_0x1180('0x14')](_0x1180('0x11'),_0x6714b6,_0x19691c);_0x4b37ab(_0x19691c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 8623e5b..970fc1e 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 _0xdcb9=['remove','update','removeListener','register','team:','./team.events'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xdcb9,0xa7));var _0x9dcb=function(_0x12b537,_0x450cf9){_0x12b537=_0x12b537-0x0;var _0x5229dc=_0xdcb9[_0x12b537];return _0x5229dc;};'use strict';var TeamEvents=require(_0x9dcb('0x0'));var events=['save',_0x9dcb('0x1'),_0x9dcb('0x2')];function createListener(_0x54d7af,_0x396477){return function(_0x556d03){_0x396477['emit'](_0x54d7af,_0x556d03);};}function removeListener(_0x5b842e,_0x35841a){return function(){TeamEvents[_0x9dcb('0x3')](_0x5b842e,_0x35841a);};}exports[_0x9dcb('0x4')]=function(_0x15ee97){for(var _0x4f9b4c=0x0,_0x1a364f=events['length'];_0x4f9b4c<_0x1a364f;_0x4f9b4c++){var _0x25f844=events[_0x4f9b4c];var _0x578700=createListener(_0x9dcb('0x5')+_0x25f844,_0x15ee97);TeamEvents['on'](_0x25f844,_0x578700);}}; \ No newline at end of file +var _0x159b=['remove','update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x159b,0x181));var _0xb159=function(_0x95ece9,_0x3325d5){_0x95ece9=_0x95ece9-0x0;var _0x35bcbf=_0x159b[_0x95ece9];return _0x35bcbf;};'use strict';var TeamEvents=require(_0xb159('0x0'));var events=[_0xb159('0x1'),_0xb159('0x2'),_0xb159('0x3')];function createListener(_0x15d39c,_0x19ceab){return function(_0x2aef23){_0x19ceab[_0xb159('0x4')](_0x15d39c,_0x2aef23);};}function removeListener(_0x4bf9dc,_0x26446e){return function(){TeamEvents[_0xb159('0x5')](_0x4bf9dc,_0x26446e);};}exports[_0xb159('0x6')]=function(_0x21186d){for(var _0x4a6e2e=0x0,_0x42f080=events[_0xb159('0x7')];_0x4a6e2e<_0x42f080;_0x4a6e2e++){var _0x114f47=events[_0x4a6e2e];var _0x329f1e=createListener(_0xb159('0x8')+_0x114f47,_0x21186d);TeamEvents['on'](_0x114f47,_0x329f1e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 05cfd40..4d0eb58 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 _0x59a2=['exports','INTEGER','sequelize'];(function(_0x223f0e,_0x3bd3ee){var _0x5024db=function(_0x296632){while(--_0x296632){_0x223f0e['push'](_0x223f0e['shift']());}};_0x5024db(++_0x3bd3ee);}(_0x59a2,0x1dc));var _0x259a=function(_0x332ad3,_0x448869){_0x332ad3=_0x332ad3-0x0;var _0x553ff6=_0x59a2[_0x332ad3];return _0x553ff6;};'use strict';var Sequelize=require(_0x259a('0x0'));module[_0x259a('0x1')]={'TeamId':{'type':Sequelize[_0x259a('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd957=['sequelize','exports','INTEGER'];(function(_0x2f036b,_0x4e3526){var _0x37feab=function(_0xe9ef6){while(--_0xe9ef6){_0x2f036b['push'](_0x2f036b['shift']());}};_0x37feab(++_0x4e3526);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x7d95('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 56a8359..f16c6ed 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 _0xffaa=['./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x32b4e8,_0x2b736d){var _0x4ae7bd=function(_0x55a955){while(--_0x55a955){_0x32b4e8['push'](_0x32b4e8['shift']());}};_0x4ae7bd(++_0x2b736d);}(_0xffaa,0x130));var _0xaffa=function(_0x130595,_0x3b5551){_0x130595=_0x130595-0x0;var _0x152879=_0xffaa[_0x130595];return _0x152879;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var logger=require(_0xaffa('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaffa('0x3'));var rp=require(_0xaffa('0x4'));var fs=require('fs');var path=require(_0xaffa('0x5'));var rimraf=require(_0xaffa('0x6'));var config=require(_0xaffa('0x7'));var attributes=require(_0xaffa('0x8'));module[_0xaffa('0x9')]=function(_0x40a369,_0x4306c0){return _0x40a369[_0xaffa('0xa')]('TeamVoicePrefix',attributes,{'tableName':_0xaffa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88c3=['../../config/logger','bluebird','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x4ce5fb,_0xdcb61e){var _0xdbe0f8=function(_0x302530){while(--_0x302530){_0x4ce5fb['push'](_0x4ce5fb['shift']());}};_0xdbe0f8(++_0xdcb61e);}(_0x88c3,0x1ee));var _0x388c=function(_0x2b5d36,_0xa122f7){_0x2b5d36=_0x2b5d36-0x0;var _0x5055f=_0x88c3[_0x2b5d36];return _0x5055f;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var logger=require(_0x388c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x388c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x388c('0x3'));var config=require(_0x388c('0x4'));var attributes=require(_0x388c('0x5'));module[_0x388c('0x6')]=function(_0x28ed4d,_0x23199c){return _0x28ed4d['define'](_0x388c('0x7'),attributes,{'tableName':_0x388c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5601ae4..9a0375e 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x595e1b,_0x3c23a8){var _0x15c047=function(_0x51b906){while(--_0x51b906){_0x595e1b['push'](_0x595e1b['shift']());}};_0x15c047(++_0x3c23a8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xcb91[_0x533e4e];return _0x1f14bb;};'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(_0x17e849,_0x588a88){var _0x35d503=function(_0x1d7eb7){while(--_0x1d7eb7){_0x17e849['push'](_0x17e849['shift']());}};_0x35d503(++_0x588a88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 7d467ff..14bd321 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 _0xec29=['exports','INTEGER','sequelize'];(function(_0x243d4f,_0x226bdb){var _0x2e19fa=function(_0x526af2){while(--_0x526af2){_0x243d4f['push'](_0x243d4f['shift']());}};_0x2e19fa(++_0x226bdb);}(_0xec29,0x1ca));var _0x9ec2=function(_0x5b3928,_0x24b38b){_0x5b3928=_0x5b3928-0x0;var _0x33799d=_0xec29[_0x5b3928];return _0x33799d;};'use strict';var Sequelize=require(_0x9ec2('0x0'));module[_0x9ec2('0x1')]={'penalty':{'type':Sequelize[_0x9ec2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa995=['exports','INTEGER'];(function(_0x4aaaef,_0x4cd2d0){var _0xbe59a=function(_0x271997){while(--_0x271997){_0x4aaaef['push'](_0x4aaaef['shift']());}};_0xbe59a(++_0x4cd2d0);}(_0xa995,0x144));var _0x5a99=function(_0x59933c,_0x24e9a7){_0x59933c=_0x59933c-0x0;var _0x171aab=_0xa995[_0x59933c];return _0x171aab;};'use strict';var Sequelize=require('sequelize');module[_0x5a99('0x0')]={'penalty':{'type':Sequelize[_0x5a99('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index a26397a..a5b9464 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 _0xc5ba=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2044b7,_0x56eac9){var _0x315afd=function(_0x3bf56d){while(--_0x3bf56d){_0x2044b7['push'](_0x2044b7['shift']());}};_0x315afd(++_0x56eac9);}(_0xc5ba,0xb9));var _0xac5b=function(_0xe97e4c,_0x486a93){_0xe97e4c=_0xe97e4c-0x0;var _0x2a2f09=_0xc5ba[_0xe97e4c];return _0x2a2f09;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var logger=require(_0xac5b('0x2'))(_0xac5b('0x3'));var moment=require(_0xac5b('0x4'));var BPromise=require(_0xac5b('0x5'));var rp=require(_0xac5b('0x6'));var fs=require('fs');var path=require(_0xac5b('0x7'));var rimraf=require(_0xac5b('0x8'));var config=require(_0xac5b('0x9'));var attributes=require(_0xac5b('0xa'));module[_0xac5b('0xb')]=function(_0x23cf2f,_0x17fcf3){return _0x23cf2f[_0xac5b('0xc')](_0xac5b('0xd'),attributes,{'tableName':_0xac5b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c4b=['rimraf','../../config/environment','define','TeamVoiceQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x6c4b,0x93));var _0xb6c4=function(_0x18d969,_0x491a43){_0x18d969=_0x18d969-0x0;var _0x37ead1=_0x6c4b[_0x18d969];return _0x37ead1;};'use strict';var _=require(_0xb6c4('0x0'));var util=require(_0xb6c4('0x1'));var logger=require(_0xb6c4('0x2'))('api');var moment=require(_0xb6c4('0x3'));var BPromise=require(_0xb6c4('0x4'));var rp=require(_0xb6c4('0x5'));var fs=require('fs');var path=require(_0xb6c4('0x6'));var rimraf=require(_0xb6c4('0x7'));var config=require(_0xb6c4('0x8'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x1f7abc,_0x5a290a){return _0x1f7abc[_0xb6c4('0x9')](_0xb6c4('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 38d6450..eec287a 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 _0x9860=['stringify','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x150e27,_0x284527){var _0x28da6f=function(_0x14fbcb){while(--_0x14fbcb){_0x150e27['push'](_0x150e27['shift']());}};_0x28da6f(++_0x284527);}(_0x9860,0x15f));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0986('0x0'));var moment=require(_0x0986('0x1'));var BPromise=require(_0x0986('0x2'));var rs=require(_0x0986('0x3'));var fs=require('fs');var Redis=require(_0x0986('0x4'));var db=require(_0x0986('0x5'))['db'];var utils=require(_0x0986('0x6'));var logger=require(_0x0986('0x7'))(_0x0986('0x8'));var config=require('../../config/environment');var jayson=require(_0x0986('0x9'));var client=jayson[_0x0986('0xa')][_0x0986('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e6cde,_0x7cecaf,_0x35bdd3){return new BPromise(function(_0x159301,_0x2ee3f1){return client[_0x0986('0xc')](_0x4e6cde,_0x35bdd3)['then'](function(_0x1f6a09){logger[_0x0986('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x7cecaf,_0x0986('0xe'));logger[_0x0986('0xf')](_0x0986('0x10'),_0x7cecaf,_0x0986('0xe'),JSON[_0x0986('0x11')](_0x1f6a09));if(_0x1f6a09['error']){if(_0x1f6a09[_0x0986('0x12')][_0x0986('0x13')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x7cecaf,_0x1f6a09[_0x0986('0x12')][_0x0986('0x14')]);return _0x2ee3f1(_0x1f6a09[_0x0986('0x12')][_0x0986('0x14')]);}logger[_0x0986('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x7cecaf,_0x1f6a09[_0x0986('0x12')][_0x0986('0x14')]);return _0x159301(_0x1f6a09['error']['message']);}else{logger[_0x0986('0xd')](_0x0986('0x15'),_0x7cecaf,_0x0986('0xe'));_0x159301(_0x1f6a09[_0x0986('0x16')]['message']);}})['catch'](function(_0x59c788){logger[_0x0986('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x7cecaf,_0x59c788);_0x2ee3f1(_0x59c788);});});} \ No newline at end of file +var _0x9b83=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5114cd,_0x3225c0){var _0x12d195=function(_0x58054b){while(--_0x58054b){_0x5114cd['push'](_0x5114cd['shift']());}};_0x12d195(++_0x3225c0);}(_0x9b83,0x84));var _0x39b8=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x9b83[_0x3a2a3c];return _0x50ac9a;};'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')]('TeamVoiceQueue,\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')]('TeamVoiceQueue,\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);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 33e9b2d..1f6d2bd 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x38bf74,_0x1164bd){var _0x414e5b=function(_0x2e0cc4){while(--_0x2e0cc4){_0x38bf74['push'](_0x38bf74['shift']());}};_0x414e5b(++_0x1164bd);}(_0x2032,0xd9));var _0x2203=function(_0x10ae70,_0x542506){_0x10ae70=_0x10ae70-0x0;var _0x466225=_0x2032[_0x10ae70];return _0x466225;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0x2515=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2db82f,_0x2711e0){var _0x3df59d=function(_0x2c804d){while(--_0x2c804d){_0x2db82f['push'](_0x2db82f['shift']());}};_0x3df59d(++_0x2711e0);}(_0x2515,0x1c2));var _0x5251=function(_0x1eecf2,_0x5eddc2){_0x1eecf2=_0x1eecf2-0x0;var _0x3e3d86=_0x2515[_0x1eecf2];return _0x3e3d86;};'use strict';var multer=require(_0x5251('0x0'));var util=require(_0x5251('0x1'));var path=require('path');var timeout=require(_0x5251('0x2'));var express=require(_0x5251('0x3'));var router=express[_0x5251('0x4')]();var fs_extra=require(_0x5251('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5251('0x6'));var config=require(_0x5251('0x7'));var controller=require('./template.controller');router[_0x5251('0x8')]('/',auth[_0x5251('0x9')](),controller[_0x5251('0xa')]);router[_0x5251('0x8')](_0x5251('0xb'),auth[_0x5251('0x9')](),controller[_0x5251('0xc')]);router[_0x5251('0xd')]('/',auth[_0x5251('0x9')](),controller[_0x5251('0xe')]);router[_0x5251('0xf')](_0x5251('0xb'),auth['isAuthenticated'](),controller[_0x5251('0x10')]);router[_0x5251('0x11')](_0x5251('0xb'),auth['isAuthenticated'](),controller[_0x5251('0x12')]);module[_0x5251('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index e5501ca..237443c 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 _0xca7c=['TEXT','sequelize','exports'];(function(_0x4cb992,_0x24d513){var _0x442fe1=function(_0x2ef9c2){while(--_0x2ef9c2){_0x4cb992['push'](_0x4cb992['shift']());}};_0x442fe1(++_0x24d513);}(_0xca7c,0xfa));var _0xcca7=function(_0xcb4084,_0x5e82aa){_0xcb4084=_0xcb4084-0x0;var _0x2ddee1=_0xca7c[_0xcb4084];return _0x2ddee1;};'use strict';var Sequelize=require(_0xcca7('0x0'));module[_0xcca7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xcca7('0x2')]}}; \ No newline at end of file +var _0xd101=['STRING','sequelize','exports'];(function(_0x32c6a0,_0x1ef8e0){var _0x7f90ad=function(_0x5ac2d5){while(--_0x5ac2d5){_0x32c6a0['push'](_0x32c6a0['shift']());}};_0x7f90ad(++_0x1ef8e0);}(_0xd101,0x121));var _0x1d10=function(_0x45a760,_0x413072){_0x45a760=_0x45a760-0x0;var _0x28e46c=_0xd101[_0x45a760];return _0x28e46c;};'use strict';var Sequelize=require(_0x1d10('0x0'));module[_0x1d10('0x1')]={'name':{'type':Sequelize[_0x1d10('0x2')]},'description':{'type':Sequelize[_0x1d10('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 213ecc2..49e6591 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 _0xeb83=['hasOwnProperty','order','sort','where','pick','type','VIRTUAL','options','include','findAll','rows','catch','params','Template','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length'];(function(_0x315caa,_0xf9177c){var _0x343c9d=function(_0x5005c0){while(--_0x5005c0){_0x315caa['push'](_0x315caa['shift']());}};_0x343c9d(++_0xf9177c);}(_0xeb83,0xb2));var _0x3eb8=function(_0x300286,_0x53cb88){_0x300286=_0x300286-0x0;var _0x5c607e=_0xeb83[_0x300286];return _0x5c607e;};'use strict';var emlformat=require(_0x3eb8('0x0'));var rimraf=require(_0x3eb8('0x1'));var zipdir=require(_0x3eb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3eb8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3eb8('0x4'));var sox=require(_0x3eb8('0x5'));var csv=require('to-csv');var ejs=require(_0x3eb8('0x6'));var fs=require('fs');var fs_extra=require(_0x3eb8('0x7'));var _=require(_0x3eb8('0x8'));var squel=require(_0x3eb8('0x9'));var crypto=require(_0x3eb8('0xa'));var jsforce=require(_0x3eb8('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3eb8('0xc'));var Papa=require(_0x3eb8('0xd'));var Redis=require(_0x3eb8('0xe'));var authService=require(_0x3eb8('0xf'));var qs=require(_0x3eb8('0x10'));var as=require(_0x3eb8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3eb8('0x12'))(_0x3eb8('0x13'));var utils=require(_0x3eb8('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3eb8('0x15'))['db'];function respondWithStatusCode(_0x55c28b,_0x55c80b){_0x55c80b=_0x55c80b||0xcc;return function(_0x39873d){if(_0x39873d){return _0x55c28b[_0x3eb8('0x16')](_0x55c80b);}return _0x55c28b[_0x3eb8('0x17')](_0x55c80b)[_0x3eb8('0x18')]();};}function respondWithResult(_0xd02348,_0x32170a){_0x32170a=_0x32170a||0xc8;return function(_0xed6f56){if(_0xed6f56){return _0xd02348[_0x3eb8('0x17')](_0x32170a)[_0x3eb8('0x19')](_0xed6f56);}};}function respondWithFilteredResult(_0x5acce7,_0x49f9fb){return function(_0x22ba08){if(_0x22ba08){var _0x9d160=typeof _0x49f9fb['offset']===_0x3eb8('0x1a')&&typeof _0x49f9fb['limit']===_0x3eb8('0x1a');var _0x1c06a7=_0x22ba08[_0x3eb8('0x1b')];var _0x432246=_0x9d160?0x0:_0x49f9fb[_0x3eb8('0x1c')];var _0x435e79=_0x9d160?_0x22ba08[_0x3eb8('0x1b')]:_0x49f9fb[_0x3eb8('0x1c')]+_0x49f9fb[_0x3eb8('0x1d')];var _0x5f15fd;if(_0x435e79>=_0x1c06a7){_0x435e79=_0x1c06a7;_0x5f15fd=0xc8;}else{_0x5f15fd=0xce;}_0x5acce7['status'](_0x5f15fd);return _0x5acce7['set'](_0x3eb8('0x1e'),_0x432246+'-'+_0x435e79+'/'+_0x1c06a7)[_0x3eb8('0x19')](_0x22ba08);}return null;};}function patchUpdates(_0x16d5bd){return function(_0x571c04){try{jsonpatch[_0x3eb8('0x1f')](_0x571c04,_0x16d5bd,!![]);}catch(_0x494c9e){return BPromise['reject'](_0x494c9e);}return _0x571c04['save']();};}function saveUpdates(_0x17b4f4,_0x1f3f26){return function(_0x4580ad){if(_0x4580ad){return _0x4580ad['update'](_0x17b4f4)[_0x3eb8('0x20')](function(_0x1cff7c){return _0x1cff7c;});}return null;};}function removeEntity(_0x399b9,_0x59b5c0){return function(_0x21753d){if(_0x21753d){return _0x21753d['destroy']()[_0x3eb8('0x20')](function(){var _0x5ef749=_0x21753d[_0x3eb8('0x21')]({'plain':!![]});var _0x2bcbdf=_0x3eb8('0x22');return db[_0x3eb8('0x23')]['destroy']({'where':{'type':_0x2bcbdf,'resourceId':_0x5ef749['id']}})['then'](function(){return _0x21753d;});})['then'](function(){_0x399b9[_0x3eb8('0x17')](0xcc)[_0x3eb8('0x18')]();});}};}function handleEntityNotFound(_0x48e2c3,_0x302cd8){return function(_0x1fc56b){if(!_0x1fc56b){_0x48e2c3['sendStatus'](0x194);}return _0x1fc56b;};}function handleError(_0x1c90b5,_0x30cd5b){_0x30cd5b=_0x30cd5b||0x1f4;return function(_0x104ea6){logger[_0x3eb8('0x24')](_0x104ea6[_0x3eb8('0x25')]);if(_0x104ea6[_0x3eb8('0x26')]){delete _0x104ea6['name'];}_0x1c90b5['status'](_0x30cd5b)[_0x3eb8('0x27')](_0x104ea6);};}exports[_0x3eb8('0x28')]=function(_0x3321a5,_0x5846b6){var _0x5de328={},_0x5b424e={},_0x14a940={'count':0x0,'rows':[]};var _0x531214=_[_0x3eb8('0x29')](db['Template'][_0x3eb8('0x2a')],function(_0x124b9e){return{'name':_0x124b9e[_0x3eb8('0x2b')],'type':_0x124b9e['type'][_0x3eb8('0x2c')]};});_0x5b424e['model']=_[_0x3eb8('0x29')](_0x531214,_0x3eb8('0x26'));_0x5b424e[_0x3eb8('0x2d')]=_[_0x3eb8('0x2e')](_0x3321a5['query']);_0x5b424e[_0x3eb8('0x2f')]=_['intersection'](_0x5b424e['model'],_0x5b424e[_0x3eb8('0x2d')]);_0x5de328[_0x3eb8('0x30')]=_[_0x3eb8('0x31')](_0x5b424e[_0x3eb8('0x32')],qs[_0x3eb8('0x33')](_0x3321a5[_0x3eb8('0x2d')][_0x3eb8('0x33')]));_0x5de328[_0x3eb8('0x30')]=_0x5de328[_0x3eb8('0x30')][_0x3eb8('0x34')]?_0x5de328[_0x3eb8('0x30')]:_0x5b424e['model'];if(!_0x3321a5['query'][_0x3eb8('0x35')]('nolimit')){_0x5de328[_0x3eb8('0x1d')]=qs[_0x3eb8('0x1d')](_0x3321a5[_0x3eb8('0x2d')]['limit']);_0x5de328[_0x3eb8('0x1c')]=qs[_0x3eb8('0x1c')](_0x3321a5[_0x3eb8('0x2d')]['offset']);}_0x5de328[_0x3eb8('0x36')]=qs[_0x3eb8('0x37')](_0x3321a5['query'][_0x3eb8('0x37')]);_0x5de328[_0x3eb8('0x38')]=qs[_0x3eb8('0x2f')](_[_0x3eb8('0x39')](_0x3321a5['query'],_0x5b424e[_0x3eb8('0x2f')]),_0x531214);if(_0x3321a5[_0x3eb8('0x2d')]['filter']){_0x5de328[_0x3eb8('0x38')]=_['merge'](_0x5de328[_0x3eb8('0x38')],{'$or':_[_0x3eb8('0x29')](_0x531214,function(_0x5967d5){if(_0x5967d5[_0x3eb8('0x3a')]!==_0x3eb8('0x3b')){var _0x1b64ad={};_0x1b64ad[_0x5967d5[_0x3eb8('0x26')]]={'$like':'%'+_0x3321a5[_0x3eb8('0x2d')]['filter']+'%'};return _0x1b64ad;}})});}_0x5de328=_['merge']({},_0x5de328,_0x3321a5[_0x3eb8('0x3c')]);var _0x30587e={'where':_0x5de328[_0x3eb8('0x38')]};return db['Template']['count'](_0x30587e)[_0x3eb8('0x20')](function(_0x2c797d){_0x14a940['count']=_0x2c797d;if(_0x3321a5[_0x3eb8('0x2d')]['includeAll']){_0x5de328[_0x3eb8('0x3d')]=[{'all':!![]}];}return db['Template'][_0x3eb8('0x3e')](_0x5de328);})[_0x3eb8('0x20')](function(_0x560e85){_0x14a940[_0x3eb8('0x3f')]=_0x560e85;return _0x14a940;})[_0x3eb8('0x20')](respondWithFilteredResult(_0x5846b6,_0x5de328))[_0x3eb8('0x40')](handleError(_0x5846b6,null));};exports['show']=function(_0x293dfe,_0xe5969d){var _0x121f57={'raw':!![],'where':{'id':_0x293dfe[_0x3eb8('0x41')]['id']}},_0x31d1c0={};_0x31d1c0[_0x3eb8('0x32')]=_[_0x3eb8('0x2e')](db[_0x3eb8('0x42')][_0x3eb8('0x2a')]);_0x31d1c0[_0x3eb8('0x2d')]=_[_0x3eb8('0x2e')](_0x293dfe['query']);_0x31d1c0['filters']=_['intersection'](_0x31d1c0[_0x3eb8('0x32')],_0x31d1c0[_0x3eb8('0x2d')]);_0x121f57['attributes']=_[_0x3eb8('0x31')](_0x31d1c0[_0x3eb8('0x32')],qs[_0x3eb8('0x33')](_0x293dfe[_0x3eb8('0x2d')]['fields']));_0x121f57[_0x3eb8('0x30')]=_0x121f57[_0x3eb8('0x30')][_0x3eb8('0x34')]?_0x121f57[_0x3eb8('0x30')]:_0x31d1c0[_0x3eb8('0x32')];if(_0x293dfe[_0x3eb8('0x2d')][_0x3eb8('0x43')]){_0x121f57[_0x3eb8('0x3d')]=[{'all':!![]}];}_0x121f57=_['merge']({},_0x121f57,_0x293dfe['options']);return db[_0x3eb8('0x42')][_0x3eb8('0x44')](_0x121f57)[_0x3eb8('0x20')](handleEntityNotFound(_0xe5969d,null))[_0x3eb8('0x20')](respondWithResult(_0xe5969d,null))[_0x3eb8('0x40')](handleError(_0xe5969d,null));};exports[_0x3eb8('0x45')]=function(_0x4d29fc,_0x23d528){return db[_0x3eb8('0x42')][_0x3eb8('0x45')](_0x4d29fc[_0x3eb8('0x46')],{})[_0x3eb8('0x20')](function(_0x59278e){var _0xeca2d7=_0x4d29fc[_0x3eb8('0x47')][_0x3eb8('0x21')]({'plain':!![]});if(!_0xeca2d7)throw new Error(_0x3eb8('0x48'));if(_0xeca2d7[_0x3eb8('0x49')]===_0x3eb8('0x47')){var _0x106d74=_0x59278e['get']({'plain':!![]});var _0x8eb61c=_0x3eb8('0x22');return db[_0x3eb8('0x4a')]['find']({'where':{'name':_0x8eb61c,'userProfileId':_0xeca2d7['userProfileId']},'raw':!![]})[_0x3eb8('0x20')](function(_0x4380e3){if(_0x4380e3&&_0x4380e3['autoAssociation']===0x0){return db[_0x3eb8('0x23')][_0x3eb8('0x45')]({'name':_0x106d74['name'],'resourceId':_0x106d74['id'],'type':_0x4380e3['name'],'sectionId':_0x4380e3['id']},{})[_0x3eb8('0x20')](function(){return _0x59278e;});}else{return _0x59278e;}})[_0x3eb8('0x40')](function(_0x3b8134){logger['error'](_0x3eb8('0x4b'),_0x3b8134);throw _0x3b8134;});}return _0x59278e;})[_0x3eb8('0x20')](respondWithResult(_0x23d528,0xc9))[_0x3eb8('0x40')](handleError(_0x23d528,null));};exports['update']=function(_0x679972,_0x5bd079){if(_0x679972['body']['id']){delete _0x679972[_0x3eb8('0x46')]['id'];}return db[_0x3eb8('0x42')]['find']({'where':{'id':_0x679972[_0x3eb8('0x41')]['id']}})['then'](handleEntityNotFound(_0x5bd079,null))[_0x3eb8('0x20')](saveUpdates(_0x679972['body'],null))[_0x3eb8('0x20')](respondWithResult(_0x5bd079,null))['catch'](handleError(_0x5bd079,null));};exports[_0x3eb8('0x4c')]=function(_0x46908c,_0x202a20){return db[_0x3eb8('0x42')]['find']({'where':{'id':_0x46908c['params']['id']}})['then'](handleEntityNotFound(_0x202a20,null))[_0x3eb8('0x20')](removeEntity(_0x202a20,null))[_0x3eb8('0x40')](handleError(_0x202a20,null));}; \ No newline at end of file +var _0x46c1=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','get','Templates','UserProfileResource','error','stack','name','map','Template','rawAttributes','fieldName','type','key','model'];(function(_0x593e3f,_0x548301){var _0x459985=function(_0x364f61){while(--_0x364f61){_0x593e3f['push'](_0x593e3f['shift']());}};_0x459985(++_0x548301);}(_0x46c1,0xc5));var _0x146c=function(_0xbc86fc,_0x1bb24d){_0xbc86fc=_0xbc86fc-0x0;var _0x549976=_0x46c1[_0xbc86fc];return _0x549976;};'use strict';var emlformat=require(_0x146c('0x0'));var rimraf=require(_0x146c('0x1'));var zipdir=require(_0x146c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x146c('0x3'));var moment=require(_0x146c('0x4'));var BPromise=require(_0x146c('0x5'));var Mustache=require(_0x146c('0x6'));var util=require(_0x146c('0x7'));var path=require(_0x146c('0x8'));var sox=require(_0x146c('0x9'));var csv=require('to-csv');var ejs=require(_0x146c('0xa'));var fs=require('fs');var fs_extra=require(_0x146c('0xb'));var _=require('lodash');var squel=require(_0x146c('0xc'));var crypto=require(_0x146c('0xd'));var jsforce=require(_0x146c('0xe'));var deskjs=require(_0x146c('0xf'));var toCsv=require(_0x146c('0x10'));var querystring=require(_0x146c('0x11'));var Papa=require(_0x146c('0x12'));var Redis=require('ioredis');var authService=require(_0x146c('0x13'));var qs=require(_0x146c('0x14'));var as=require(_0x146c('0x15'));var hardwareService=require(_0x146c('0x16'));var logger=require('../../config/logger')(_0x146c('0x17'));var utils=require('../../config/utils');var config=require(_0x146c('0x18'));var licenseUtil=require(_0x146c('0x19'));var db=require(_0x146c('0x1a'))['db'];function respondWithStatusCode(_0x1ea512,_0xcb2c5b){_0xcb2c5b=_0xcb2c5b||0xcc;return function(_0x4b1cf2){if(_0x4b1cf2){return _0x1ea512['sendStatus'](_0xcb2c5b);}return _0x1ea512[_0x146c('0x1b')](_0xcb2c5b)[_0x146c('0x1c')]();};}function respondWithResult(_0x2e92db,_0x3f160d){_0x3f160d=_0x3f160d||0xc8;return function(_0x13d2c9){if(_0x13d2c9){return _0x2e92db[_0x146c('0x1b')](_0x3f160d)[_0x146c('0x1d')](_0x13d2c9);}};}function respondWithFilteredResult(_0x4b392e,_0x68873f){return function(_0x4ac73){if(_0x4ac73){var _0x1ca71b=typeof _0x68873f[_0x146c('0x1e')]===_0x146c('0x1f')&&typeof _0x68873f[_0x146c('0x20')]===_0x146c('0x1f');var _0x1db121=_0x4ac73[_0x146c('0x21')];var _0x45a009=_0x1ca71b?0x0:_0x68873f[_0x146c('0x1e')];var _0x170917=_0x1ca71b?_0x4ac73['count']:_0x68873f[_0x146c('0x1e')]+_0x68873f[_0x146c('0x20')];var _0x720bda;if(_0x170917>=_0x1db121){_0x170917=_0x1db121;_0x720bda=0xc8;}else{_0x720bda=0xce;}_0x4b392e['status'](_0x720bda);return _0x4b392e['set'](_0x146c('0x22'),_0x45a009+'-'+_0x170917+'/'+_0x1db121)[_0x146c('0x1d')](_0x4ac73);}return null;};}function patchUpdates(_0x98ba14){return function(_0x501e29){try{jsonpatch['apply'](_0x501e29,_0x98ba14,!![]);}catch(_0x5d7e54){return BPromise[_0x146c('0x23')](_0x5d7e54);}return _0x501e29[_0x146c('0x24')]();};}function saveUpdates(_0x4c1bba,_0x12a316){return function(_0x1ed86e){if(_0x1ed86e){return _0x1ed86e['update'](_0x4c1bba)['then'](function(_0x45a996){return _0x45a996;});}return null;};}function removeEntity(_0x464ff1,_0x2500d7){return function(_0x3115b9){if(_0x3115b9){return _0x3115b9[_0x146c('0x25')]()[_0x146c('0x26')](function(){var _0x5610df=_0x3115b9[_0x146c('0x27')]({'plain':!![]});var _0xad7442=_0x146c('0x28');return db[_0x146c('0x29')]['destroy']({'where':{'type':_0xad7442,'resourceId':_0x5610df['id']}})['then'](function(){return _0x3115b9;});})[_0x146c('0x26')](function(){_0x464ff1[_0x146c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452c01,_0x1a2422){return function(_0x534df3){if(!_0x534df3){_0x452c01['sendStatus'](0x194);}return _0x534df3;};}function handleError(_0x1bcdd7,_0x3dbbe7){_0x3dbbe7=_0x3dbbe7||0x1f4;return function(_0xa98ffb){logger[_0x146c('0x2a')](_0xa98ffb[_0x146c('0x2b')]);if(_0xa98ffb[_0x146c('0x2c')]){delete _0xa98ffb[_0x146c('0x2c')];}_0x1bcdd7[_0x146c('0x1b')](_0x3dbbe7)['send'](_0xa98ffb);};}exports['index']=function(_0x202c58,_0x9ba57a){var _0x1ddf4f={},_0x48bd17={},_0x4f56c7={'count':0x0,'rows':[]};var _0x3c0ce1=_[_0x146c('0x2d')](db[_0x146c('0x2e')][_0x146c('0x2f')],function(_0x99d719){return{'name':_0x99d719[_0x146c('0x30')],'type':_0x99d719[_0x146c('0x31')][_0x146c('0x32')]};});_0x48bd17[_0x146c('0x33')]=_[_0x146c('0x2d')](_0x3c0ce1,'name');_0x48bd17[_0x146c('0x34')]=_[_0x146c('0x35')](_0x202c58[_0x146c('0x34')]);_0x48bd17[_0x146c('0x36')]=_[_0x146c('0x37')](_0x48bd17[_0x146c('0x33')],_0x48bd17[_0x146c('0x34')]);_0x1ddf4f[_0x146c('0x38')]=_[_0x146c('0x37')](_0x48bd17[_0x146c('0x33')],qs[_0x146c('0x39')](_0x202c58[_0x146c('0x34')]['fields']));_0x1ddf4f[_0x146c('0x38')]=_0x1ddf4f['attributes'][_0x146c('0x3a')]?_0x1ddf4f[_0x146c('0x38')]:_0x48bd17['model'];if(!_0x202c58[_0x146c('0x34')][_0x146c('0x3b')](_0x146c('0x3c'))){_0x1ddf4f[_0x146c('0x20')]=qs['limit'](_0x202c58[_0x146c('0x34')][_0x146c('0x20')]);_0x1ddf4f['offset']=qs['offset'](_0x202c58[_0x146c('0x34')][_0x146c('0x1e')]);}_0x1ddf4f['order']=qs[_0x146c('0x3d')](_0x202c58[_0x146c('0x34')][_0x146c('0x3d')]);_0x1ddf4f['where']=qs[_0x146c('0x36')](_['pick'](_0x202c58[_0x146c('0x34')],_0x48bd17[_0x146c('0x36')]),_0x3c0ce1);if(_0x202c58[_0x146c('0x34')]['filter']){_0x1ddf4f[_0x146c('0x3e')]=_[_0x146c('0x3f')](_0x1ddf4f['where'],{'$or':_[_0x146c('0x2d')](_0x3c0ce1,function(_0x47b127){if(_0x47b127['type']!==_0x146c('0x40')){var _0x3eb00d={};_0x3eb00d[_0x47b127['name']]={'$like':'%'+_0x202c58[_0x146c('0x34')][_0x146c('0x41')]+'%'};return _0x3eb00d;}})});}_0x1ddf4f=_[_0x146c('0x3f')]({},_0x1ddf4f,_0x202c58[_0x146c('0x42')]);var _0x52cfa7={'where':_0x1ddf4f['where']};return db[_0x146c('0x2e')][_0x146c('0x21')](_0x52cfa7)[_0x146c('0x26')](function(_0xa1a6ff){_0x4f56c7['count']=_0xa1a6ff;if(_0x202c58[_0x146c('0x34')][_0x146c('0x43')]){_0x1ddf4f['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x1ddf4f);})[_0x146c('0x26')](function(_0x41c7a4){_0x4f56c7[_0x146c('0x44')]=_0x41c7a4;return _0x4f56c7;})[_0x146c('0x26')](respondWithFilteredResult(_0x9ba57a,_0x1ddf4f))[_0x146c('0x45')](handleError(_0x9ba57a,null));};exports[_0x146c('0x46')]=function(_0x4f7a5b,_0x91bc41){var _0x5108b5={'raw':!![],'where':{'id':_0x4f7a5b[_0x146c('0x47')]['id']}},_0x32189b={};_0x32189b[_0x146c('0x33')]=_[_0x146c('0x35')](db[_0x146c('0x2e')][_0x146c('0x2f')]);_0x32189b[_0x146c('0x34')]=_['keys'](_0x4f7a5b[_0x146c('0x34')]);_0x32189b['filters']=_[_0x146c('0x37')](_0x32189b[_0x146c('0x33')],_0x32189b[_0x146c('0x34')]);_0x5108b5['attributes']=_['intersection'](_0x32189b[_0x146c('0x33')],qs[_0x146c('0x39')](_0x4f7a5b[_0x146c('0x34')][_0x146c('0x39')]));_0x5108b5['attributes']=_0x5108b5[_0x146c('0x38')][_0x146c('0x3a')]?_0x5108b5[_0x146c('0x38')]:_0x32189b[_0x146c('0x33')];if(_0x4f7a5b['query']['includeAll']){_0x5108b5[_0x146c('0x48')]=[{'all':!![]}];}_0x5108b5=_['merge']({},_0x5108b5,_0x4f7a5b[_0x146c('0x42')]);return db[_0x146c('0x2e')][_0x146c('0x49')](_0x5108b5)['then'](handleEntityNotFound(_0x91bc41,null))[_0x146c('0x26')](respondWithResult(_0x91bc41,null))[_0x146c('0x45')](handleError(_0x91bc41,null));};exports[_0x146c('0x4a')]=function(_0x11590e,_0x19c55c){return db[_0x146c('0x2e')][_0x146c('0x4a')](_0x11590e['body'],{})[_0x146c('0x26')](function(_0x2e5992){var _0x267a08=_0x11590e[_0x146c('0x4b')][_0x146c('0x27')]({'plain':!![]});if(!_0x267a08)throw new Error(_0x146c('0x4c'));if(_0x267a08[_0x146c('0x4d')]===_0x146c('0x4b')){var _0x3557d2=_0x2e5992[_0x146c('0x27')]({'plain':!![]});var _0x1acf2f='Templates';return db[_0x146c('0x4e')][_0x146c('0x49')]({'where':{'name':_0x1acf2f,'userProfileId':_0x267a08[_0x146c('0x4f')]},'raw':!![]})[_0x146c('0x26')](function(_0x42e1f1){if(_0x42e1f1&&_0x42e1f1[_0x146c('0x50')]===0x0){return db[_0x146c('0x29')][_0x146c('0x4a')]({'name':_0x3557d2[_0x146c('0x2c')],'resourceId':_0x3557d2['id'],'type':_0x42e1f1['name'],'sectionId':_0x42e1f1['id']},{})[_0x146c('0x26')](function(){return _0x2e5992;});}else{return _0x2e5992;}})[_0x146c('0x45')](function(_0x41b78a){logger['error'](_0x146c('0x51'),_0x41b78a);throw _0x41b78a;});}return _0x2e5992;})['then'](respondWithResult(_0x19c55c,0xc9))['catch'](handleError(_0x19c55c,null));};exports['update']=function(_0x33f1e0,_0x169944){if(_0x33f1e0[_0x146c('0x52')]['id']){delete _0x33f1e0[_0x146c('0x52')]['id'];}return db[_0x146c('0x2e')][_0x146c('0x49')]({'where':{'id':_0x33f1e0[_0x146c('0x47')]['id']}})[_0x146c('0x26')](handleEntityNotFound(_0x169944,null))[_0x146c('0x26')](saveUpdates(_0x33f1e0['body'],null))[_0x146c('0x26')](respondWithResult(_0x169944,null))[_0x146c('0x45')](handleError(_0x169944,null));};exports['destroy']=function(_0x396e38,_0x844385){return db['Template'][_0x146c('0x49')]({'where':{'id':_0x396e38[_0x146c('0x47')]['id']}})[_0x146c('0x26')](handleEntityNotFound(_0x844385,null))[_0x146c('0x26')](removeEntity(_0x844385,null))[_0x146c('0x45')](handleError(_0x844385,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index f9753a5..d0c15f4 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 _0x285b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash'];(function(_0x593f13,_0x4301b0){var _0x5e702c=function(_0x4b16c7){while(--_0x4b16c7){_0x593f13['push'](_0x593f13['shift']());}};_0x5e702c(++_0x4301b0);}(_0x285b,0xe6));var _0xb285=function(_0x39de09,_0x3e99a7){_0x39de09=_0x39de09-0x0;var _0x4c268b=_0x285b[_0x39de09];return _0x4c268b;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb285('0x1'));var BPromise=require(_0xb285('0x2'));var rp=require(_0xb285('0x3'));var fs=require('fs');var path=require(_0xb285('0x4'));var rimraf=require(_0xb285('0x5'));var config=require(_0xb285('0x6'));var attributes=require(_0xb285('0x7'));module[_0xb285('0x8')]=function(_0x127a4d,_0x24a64a){return _0x127a4d['define'](_0xb285('0x9'),attributes,{'tableName':_0xb285('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6baa=['tools_templates','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x29e2ba,_0x1b171f){var _0x5c5920=function(_0x3b09c4){while(--_0x3b09c4){_0x29e2ba['push'](_0x29e2ba['shift']());}};_0x5c5920(++_0x1b171f);}(_0x6baa,0xe1));var _0xa6ba=function(_0x13a306,_0x1b4306){_0x13a306=_0x13a306-0x0;var _0x4151d8=_0x6baa[_0x13a306];return _0x4151d8;};'use strict';var _=require(_0xa6ba('0x0'));var util=require(_0xa6ba('0x1'));var logger=require(_0xa6ba('0x2'))('api');var moment=require(_0xa6ba('0x3'));var BPromise=require(_0xa6ba('0x4'));var rp=require(_0xa6ba('0x5'));var fs=require('fs');var path=require(_0xa6ba('0x6'));var rimraf=require(_0xa6ba('0x7'));var config=require(_0xa6ba('0x8'));var attributes=require(_0xa6ba('0x9'));module[_0xa6ba('0xa')]=function(_0x3a8e33,_0x2a80d9){return _0x3a8e33[_0xa6ba('0xb')](_0xa6ba('0xc'),attributes,{'tableName':_0xa6ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 163e239..154a1e1 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 _0xe3ef=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','where','limit','include','map','model','attributes','then','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2e19ab,_0x4d527f){var _0x510981=function(_0x808e9){while(--_0x808e9){_0x2e19ab['push'](_0x2e19ab['shift']());}};_0x510981(++_0x4d527f);}(_0xe3ef,0x1d7));var _0xfe3e=function(_0x1b9591,_0x3a3aef){_0x1b9591=_0x1b9591-0x0;var _0x3eddaa=_0xe3ef[_0x1b9591];return _0x3eddaa;};'use strict';var _=require(_0xfe3e('0x0'));var util=require('util');var moment=require(_0xfe3e('0x1'));var BPromise=require(_0xfe3e('0x2'));var rs=require(_0xfe3e('0x3'));var fs=require('fs');var Redis=require(_0xfe3e('0x4'));var db=require(_0xfe3e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe3e('0x6'))(_0xfe3e('0x7'));var config=require(_0xfe3e('0x8'));var jayson=require(_0xfe3e('0x9'));var client=jayson['client'][_0xfe3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35dcb5,_0x3af603,_0x2f362e){return new BPromise(function(_0x57c444,_0x4208d1){return client[_0xfe3e('0xb')](_0x35dcb5,_0x2f362e)['then'](function(_0x314fa6){logger[_0xfe3e('0xc')](_0xfe3e('0xd'),_0x3af603,_0xfe3e('0xe'));logger[_0xfe3e('0xf')](_0xfe3e('0x10'),_0x3af603,_0xfe3e('0xe'),JSON[_0xfe3e('0x11')](_0x314fa6));if(_0x314fa6[_0xfe3e('0x12')]){if(_0x314fa6[_0xfe3e('0x12')][_0xfe3e('0x13')]===0x1f4){logger[_0xfe3e('0x12')]('Template,\x20%s,\x20%s',_0x3af603,_0x314fa6['error'][_0xfe3e('0x14')]);return _0x4208d1(_0x314fa6[_0xfe3e('0x12')]['message']);}logger['error'](_0xfe3e('0xd'),_0x3af603,_0x314fa6[_0xfe3e('0x12')][_0xfe3e('0x14')]);return _0x57c444(_0x314fa6['error'][_0xfe3e('0x14')]);}else{logger['info'](_0xfe3e('0xd'),_0x3af603,_0xfe3e('0xe'));_0x57c444(_0x314fa6[_0xfe3e('0x15')]['message']);}})[_0xfe3e('0x16')](function(_0x2ec912){logger[_0xfe3e('0x12')](_0xfe3e('0xd'),_0x3af603,_0x2ec912);_0x4208d1(_0x2ec912);});});}exports[_0xfe3e('0x17')]=function(_0x83a4b3){var _0x1e549b=this;return new Promise(function(_0x4bcd0f,_0x33887a){return db[_0xfe3e('0x18')][_0xfe3e('0x19')]({'raw':_0x83a4b3[_0xfe3e('0x1a')]?_0x83a4b3['options']['raw']===undefined?!![]:![]:!![],'where':_0x83a4b3['options']?_0x83a4b3[_0xfe3e('0x1a')][_0xfe3e('0x1b')]||null:null,'attributes':_0x83a4b3['options']?_0x83a4b3[_0xfe3e('0x1a')]['attributes']||null:null,'limit':_0x83a4b3[_0xfe3e('0x1a')]?_0x83a4b3[_0xfe3e('0x1a')][_0xfe3e('0x1c')]||null:null,'include':_0x83a4b3['options']?_0x83a4b3[_0xfe3e('0x1a')][_0xfe3e('0x1d')]?_[_0xfe3e('0x1e')](_0x83a4b3[_0xfe3e('0x1a')]['include'],function(_0x53b844){return{'model':db[_0x53b844[_0xfe3e('0x1f')]],'as':_0x53b844['as'],'attributes':_0x53b844[_0xfe3e('0x20')],'include':_0x53b844['include']?_['map'](_0x53b844['include'],function(_0x42a2cd){return{'model':db[_0x42a2cd[_0xfe3e('0x1f')]],'as':_0x42a2cd['as'],'attributes':_0x42a2cd['attributes'],'include':_0x42a2cd[_0xfe3e('0x1d')]?_[_0xfe3e('0x1e')](_0x42a2cd[_0xfe3e('0x1d')],function(_0x5b42b0){return{'model':db[_0x5b42b0['model']],'as':_0x5b42b0['as'],'attributes':_0x5b42b0[_0xfe3e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfe3e('0x21')](function(_0x124cbb){logger[_0xfe3e('0xc')](_0xfe3e('0x17'),_0x83a4b3);logger[_0xfe3e('0xf')](_0xfe3e('0x17'),_0x83a4b3,JSON[_0xfe3e('0x11')](_0x124cbb));_0x4bcd0f(_0x124cbb);})[_0xfe3e('0x16')](function(_0x5e52dd){logger[_0xfe3e('0x12')]('GetTemplate',_0x5e52dd[_0xfe3e('0x14')],_0x83a4b3);_0x33887a(_0x1e549b[_0xfe3e('0x12')](0x1f4,_0x5e52dd[_0xfe3e('0x14')]));});});}; \ No newline at end of file +var _0x66d8=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1ee91c,_0x4d40c3){var _0x8c3dcb=function(_0x293d8a){while(--_0x293d8a){_0x1ee91c['push'](_0x1ee91c['shift']());}};_0x8c3dcb(++_0x4d40c3);}(_0x66d8,0x1c1));var _0x866d=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x66d8[_0xda464c];return _0x19e222;};'use strict';var _=require(_0x866d('0x0'));var util=require(_0x866d('0x1'));var moment=require(_0x866d('0x2'));var BPromise=require(_0x866d('0x3'));var rs=require(_0x866d('0x4'));var fs=require('fs');var Redis=require(_0x866d('0x5'));var db=require(_0x866d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x866d('0x7'))(_0x866d('0x8'));var config=require(_0x866d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x866d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3baf,_0x2504c4,_0x245aee){return new BPromise(function(_0x9ceb0f,_0x59b8db){return client[_0x866d('0xb')](_0x2f3baf,_0x245aee)[_0x866d('0xc')](function(_0x3f2e64){logger[_0x866d('0xd')](_0x866d('0xe'),_0x2504c4,_0x866d('0xf'));logger[_0x866d('0x10')](_0x866d('0x11'),_0x2504c4,_0x866d('0xf'),JSON[_0x866d('0x12')](_0x3f2e64));if(_0x3f2e64[_0x866d('0x13')]){if(_0x3f2e64[_0x866d('0x13')][_0x866d('0x14')]===0x1f4){logger[_0x866d('0x13')]('Template,\x20%s,\x20%s',_0x2504c4,_0x3f2e64[_0x866d('0x13')][_0x866d('0x15')]);return _0x59b8db(_0x3f2e64[_0x866d('0x13')][_0x866d('0x15')]);}logger['error'](_0x866d('0xe'),_0x2504c4,_0x3f2e64[_0x866d('0x13')][_0x866d('0x15')]);return _0x9ceb0f(_0x3f2e64['error']['message']);}else{logger[_0x866d('0xd')](_0x866d('0xe'),_0x2504c4,_0x866d('0xf'));_0x9ceb0f(_0x3f2e64[_0x866d('0x16')]['message']);}})[_0x866d('0x17')](function(_0x16e5a0){logger[_0x866d('0x13')](_0x866d('0xe'),_0x2504c4,_0x16e5a0);_0x59b8db(_0x16e5a0);});});}exports[_0x866d('0x18')]=function(_0x5d7781){var _0xd8caad=this;return new Promise(function(_0x56b0c4,_0x3009a2){return db[_0x866d('0x19')][_0x866d('0x1a')]({'raw':_0x5d7781[_0x866d('0x1b')]?_0x5d7781[_0x866d('0x1b')][_0x866d('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d7781['options']?_0x5d7781[_0x866d('0x1b')][_0x866d('0x1d')]||null:null,'attributes':_0x5d7781[_0x866d('0x1b')]?_0x5d7781[_0x866d('0x1b')]['attributes']||null:null,'limit':_0x5d7781[_0x866d('0x1b')]?_0x5d7781['options'][_0x866d('0x1e')]||null:null,'include':_0x5d7781[_0x866d('0x1b')]?_0x5d7781[_0x866d('0x1b')][_0x866d('0x1f')]?_[_0x866d('0x20')](_0x5d7781[_0x866d('0x1b')][_0x866d('0x1f')],function(_0x371f90){return{'model':db[_0x371f90[_0x866d('0x21')]],'as':_0x371f90['as'],'attributes':_0x371f90[_0x866d('0x22')],'include':_0x371f90[_0x866d('0x1f')]?_[_0x866d('0x20')](_0x371f90[_0x866d('0x1f')],function(_0x418119){return{'model':db[_0x418119['model']],'as':_0x418119['as'],'attributes':_0x418119[_0x866d('0x22')],'include':_0x418119[_0x866d('0x1f')]?_[_0x866d('0x20')](_0x418119['include'],function(_0x2e2454){return{'model':db[_0x2e2454['model']],'as':_0x2e2454['as'],'attributes':_0x2e2454[_0x866d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x866d('0xc')](function(_0x59d1e6){logger[_0x866d('0xd')](_0x866d('0x18'),_0x5d7781);logger[_0x866d('0x10')]('GetTemplate',_0x5d7781,JSON[_0x866d('0x12')](_0x59d1e6));_0x56b0c4(_0x59d1e6);})[_0x866d('0x17')](function(_0x2fffa1){logger['error']('GetTemplate',_0x2fffa1[_0x866d('0x15')],_0x5d7781);_0x3009a2(_0xd8caad[_0x866d('0x13')](0x1f4,_0x2fffa1[_0x866d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 80e0054..e27321e 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 _0x2c5b=['put','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','getAllConditions','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction'];(function(_0xe01677,_0x2f7695){var _0x2568f2=function(_0xf1bcd2){while(--_0xf1bcd2){_0xe01677['push'](_0xe01677['shift']());}};_0x2568f2(++_0x2f7695);}(_0x2c5b,0x193));var _0xb2c5=function(_0x5c39cb,_0x154e67){_0x5c39cb=_0x5c39cb-0x0;var _0x15261c=_0x2c5b[_0x5c39cb];return _0x15261c;};'use strict';var multer=require(_0xb2c5('0x0'));var util=require('util');var path=require(_0xb2c5('0x1'));var timeout=require(_0xb2c5('0x2'));var express=require(_0xb2c5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2c5('0x4'));var interaction=require(_0xb2c5('0x5'));var config=require(_0xb2c5('0x6'));var controller=require(_0xb2c5('0x7'));router['get']('/',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x9')]);router[_0xb2c5('0xa')](_0xb2c5('0xb'),auth[_0xb2c5('0x8')](),controller[_0xb2c5('0xc')]);router['get']('/:id/all_conditions',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0xd')]);router[_0xb2c5('0xa')]('/:id/any_conditions',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0xe')]);router['get']('/:id/actions',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0xf')]);router[_0xb2c5('0x10')]('/',auth[_0xb2c5('0x8')](),controller['create']);router[_0xb2c5('0x10')](_0xb2c5('0x11'),auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x12')]);router['post']('/:id/any_conditions',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x13')]);router[_0xb2c5('0x10')](_0xb2c5('0x14'),auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x15')]);router[_0xb2c5('0x16')](_0xb2c5('0xb'),auth[_0xb2c5('0x8')](),controller['update']);router[_0xb2c5('0x17')](_0xb2c5('0xb'),auth[_0xb2c5('0x8')](),controller['destroy']);module[_0xb2c5('0x18')]=router; \ No newline at end of file +var _0xbfa1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/any_conditions','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','path','Router','fs-extra'];(function(_0x494db4,_0x2f8b38){var _0x22b8cc=function(_0x262239){while(--_0x262239){_0x494db4['push'](_0x494db4['shift']());}};_0x22b8cc(++_0x2f8b38);}(_0xbfa1,0x140));var _0x1bfa=function(_0x5654e6,_0x435849){_0x5654e6=_0x5654e6-0x0;var _0xcf0100=_0xbfa1[_0x5654e6];return _0xcf0100;};'use strict';var multer=require(_0x1bfa('0x0'));var util=require('util');var path=require(_0x1bfa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1bfa('0x2')]();var fs_extra=require(_0x1bfa('0x3'));var auth=require(_0x1bfa('0x4'));var interaction=require(_0x1bfa('0x5'));var config=require(_0x1bfa('0x6'));var controller=require(_0x1bfa('0x7'));router['get']('/',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x9')]);router[_0x1bfa('0xa')]('/:id',auth[_0x1bfa('0x8')](),controller['show']);router[_0x1bfa('0xa')](_0x1bfa('0xb'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xc')]);router['get']('/:id/any_conditions',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xd')]);router[_0x1bfa('0xa')](_0x1bfa('0xe'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xf')]);router[_0x1bfa('0x10')]('/',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x11')]);router['post']('/:id/all_conditions',auth[_0x1bfa('0x8')](),controller['addAllCondition']);router[_0x1bfa('0x10')](_0x1bfa('0x12'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x13')]);router[_0x1bfa('0x10')](_0x1bfa('0xe'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x14')]);router[_0x1bfa('0x15')](_0x1bfa('0x16'),auth['isAuthenticated'](),controller[_0x1bfa('0x17')]);router[_0x1bfa('0x18')](_0x1bfa('0x16'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x19')]);module[_0x1bfa('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 28888d4..272d4d3 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 _0xcafa=['exports','STRING','BOOLEAN','sequelize'];(function(_0x324798,_0x32187b){var _0x4c8cc2=function(_0x1c62c0){while(--_0x1c62c0){_0x324798['push'](_0x324798['shift']());}};_0x4c8cc2(++_0x32187b);}(_0xcafa,0xfb));var _0xacaf=function(_0x170205,_0x4c52a0){_0x170205=_0x170205-0x0;var _0x52185b=_0xcafa[_0x170205];return _0x52185b;};'use strict';var Sequelize=require(_0xacaf('0x0'));module[_0xacaf('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xacaf('0x2')]},'description':{'type':Sequelize[_0xacaf('0x2')]},'status':{'type':Sequelize[_0xacaf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x13b2=['exports','STRING','sequelize'];(function(_0x7382ec,_0x5e29f2){var _0x13290c=function(_0x4ded68){while(--_0x4ded68){_0x7382ec['push'](_0x7382ec['shift']());}};_0x13290c(++_0x5e29f2);}(_0x13b2,0x1ee));var _0x213b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x13b2[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x213b('0x0'));module[_0x213b('0x1')]={'name':{'type':Sequelize[_0x213b('0x2')]},'channel':{'type':Sequelize[_0x213b('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 4ec6623..10d4ee6 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 _0xf576=['type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','pick','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf576,0x13b));var _0x6f57=function(_0x40889a,_0x5ee3f4){_0x40889a=_0x40889a-0x0;var _0x430e99=_0xf576[_0x40889a];return _0x430e99;};'use strict';var emlformat=require(_0x6f57('0x0'));var rimraf=require(_0x6f57('0x1'));var zipdir=require(_0x6f57('0x2'));var jsonpatch=require(_0x6f57('0x3'));var rp=require(_0x6f57('0x4'));var moment=require(_0x6f57('0x5'));var BPromise=require(_0x6f57('0x6'));var Mustache=require(_0x6f57('0x7'));var util=require(_0x6f57('0x8'));var path=require('path');var sox=require(_0x6f57('0x9'));var csv=require(_0x6f57('0xa'));var ejs=require(_0x6f57('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f57('0xc'));var squel=require(_0x6f57('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6f57('0xe'));var toCsv=require(_0x6f57('0xa'));var querystring=require('querystring');var Papa=require(_0x6f57('0xf'));var Redis=require('ioredis');var authService=require(_0x6f57('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f57('0x11'));var logger=require('../../config/logger')(_0x6f57('0x12'));var utils=require(_0x6f57('0x13'));var config=require(_0x6f57('0x14'));var licenseUtil=require(_0x6f57('0x15'));var db=require(_0x6f57('0x16'))['db'];function respondWithStatusCode(_0x56d5fe,_0xe783d1){_0xe783d1=_0xe783d1||0xcc;return function(_0x42efe0){if(_0x42efe0){return _0x56d5fe[_0x6f57('0x17')](_0xe783d1);}return _0x56d5fe[_0x6f57('0x18')](_0xe783d1)[_0x6f57('0x19')]();};}function respondWithResult(_0x5b19c2,_0x543259){_0x543259=_0x543259||0xc8;return function(_0x53d04f){if(_0x53d04f){return _0x5b19c2[_0x6f57('0x18')](_0x543259)[_0x6f57('0x1a')](_0x53d04f);}};}function respondWithFilteredResult(_0x4fb2aa,_0x1dc915){return function(_0x383e3e){if(_0x383e3e){var _0x3beeea=typeof _0x1dc915[_0x6f57('0x1b')]===_0x6f57('0x1c')&&typeof _0x1dc915[_0x6f57('0x1d')]===_0x6f57('0x1c');var _0x476077=_0x383e3e[_0x6f57('0x1e')];var _0x21e2b2=_0x3beeea?0x0:_0x1dc915['offset'];var _0x43eeb6=_0x3beeea?_0x383e3e[_0x6f57('0x1e')]:_0x1dc915[_0x6f57('0x1b')]+_0x1dc915[_0x6f57('0x1d')];var _0x1210b8;if(_0x43eeb6>=_0x476077){_0x43eeb6=_0x476077;_0x1210b8=0xc8;}else{_0x1210b8=0xce;}_0x4fb2aa[_0x6f57('0x18')](_0x1210b8);return _0x4fb2aa[_0x6f57('0x1f')](_0x6f57('0x20'),_0x21e2b2+'-'+_0x43eeb6+'/'+_0x476077)['json'](_0x383e3e);}return null;};}function patchUpdates(_0x86b9bf){return function(_0x34c903){try{jsonpatch[_0x6f57('0x21')](_0x34c903,_0x86b9bf,!![]);}catch(_0x5534f0){return BPromise[_0x6f57('0x22')](_0x5534f0);}return _0x34c903[_0x6f57('0x23')]();};}function saveUpdates(_0x1a99d9,_0x33d226){return function(_0xc3497e){if(_0xc3497e){return _0xc3497e['update'](_0x1a99d9)[_0x6f57('0x24')](function(_0xaf59ba){return _0xaf59ba;});}return null;};}function removeEntity(_0x4617cf,_0x47d0cc){return function(_0x53a730){if(_0x53a730){return _0x53a730[_0x6f57('0x25')]()[_0x6f57('0x24')](function(){var _0x1efe77=_0x53a730[_0x6f57('0x26')]({'plain':!![]});var _0x50398c=_0x6f57('0x27');return db[_0x6f57('0x28')][_0x6f57('0x25')]({'where':{'type':_0x50398c,'resourceId':_0x1efe77['id']}})[_0x6f57('0x24')](function(){return _0x53a730;});})['then'](function(){_0x4617cf['status'](0xcc)[_0x6f57('0x19')]();});}};}function handleEntityNotFound(_0x1a08fc,_0x4ea619){return function(_0x3bfb15){if(!_0x3bfb15){_0x1a08fc[_0x6f57('0x17')](0x194);}return _0x3bfb15;};}function handleError(_0x30c980,_0x3ee16b){_0x3ee16b=_0x3ee16b||0x1f4;return function(_0x41ce72){logger[_0x6f57('0x29')](_0x41ce72[_0x6f57('0x2a')]);if(_0x41ce72[_0x6f57('0x2b')]){delete _0x41ce72[_0x6f57('0x2b')];}_0x30c980[_0x6f57('0x18')](_0x3ee16b)[_0x6f57('0x2c')](_0x41ce72);};}exports[_0x6f57('0x2d')]=function(_0x309968,_0x61e2b1){var _0x2d1b94={},_0x56714b={},_0x2c11b1={'count':0x0,'rows':[]};var _0x534561=_[_0x6f57('0x2e')](db[_0x6f57('0x2f')]['rawAttributes'],function(_0x30226f){return{'name':_0x30226f[_0x6f57('0x30')],'type':_0x30226f['type'][_0x6f57('0x31')]};});_0x56714b[_0x6f57('0x32')]=_[_0x6f57('0x2e')](_0x534561,_0x6f57('0x2b'));_0x56714b['query']=_[_0x6f57('0x33')](_0x309968[_0x6f57('0x34')]);_0x56714b[_0x6f57('0x35')]=_[_0x6f57('0x36')](_0x56714b[_0x6f57('0x32')],_0x56714b[_0x6f57('0x34')]);_0x2d1b94[_0x6f57('0x37')]=_[_0x6f57('0x36')](_0x56714b[_0x6f57('0x32')],qs[_0x6f57('0x38')](_0x309968['query'][_0x6f57('0x38')]));_0x2d1b94['attributes']=_0x2d1b94[_0x6f57('0x37')][_0x6f57('0x39')]?_0x2d1b94['attributes']:_0x56714b[_0x6f57('0x32')];if(!_0x309968[_0x6f57('0x34')][_0x6f57('0x3a')](_0x6f57('0x3b'))){_0x2d1b94[_0x6f57('0x1d')]=qs[_0x6f57('0x1d')](_0x309968['query']['limit']);_0x2d1b94['offset']=qs[_0x6f57('0x1b')](_0x309968[_0x6f57('0x34')]['offset']);}_0x2d1b94[_0x6f57('0x3c')]=qs['sort'](_0x309968[_0x6f57('0x34')][_0x6f57('0x3d')]);_0x2d1b94[_0x6f57('0x3e')]=qs[_0x6f57('0x35')](_['pick'](_0x309968[_0x6f57('0x34')],_0x56714b[_0x6f57('0x35')]),_0x534561);if(_0x309968['query'][_0x6f57('0x3f')]){_0x2d1b94[_0x6f57('0x3e')]=_[_0x6f57('0x40')](_0x2d1b94['where'],{'$or':_['map'](_0x534561,function(_0x5409b9){if(_0x5409b9[_0x6f57('0x41')]!=='VIRTUAL'){var _0x5866be={};_0x5866be[_0x5409b9[_0x6f57('0x2b')]]={'$like':'%'+_0x309968[_0x6f57('0x34')][_0x6f57('0x3f')]+'%'};return _0x5866be;}})});}_0x2d1b94=_['merge']({},_0x2d1b94,_0x309968[_0x6f57('0x42')]);var _0x115c92={'where':_0x2d1b94[_0x6f57('0x3e')]};return db[_0x6f57('0x2f')]['count'](_0x115c92)['then'](function(_0x310ae2){_0x2c11b1[_0x6f57('0x1e')]=_0x310ae2;if(_0x309968[_0x6f57('0x34')][_0x6f57('0x43')]){_0x2d1b94[_0x6f57('0x44')]=[{'all':!![]}];}return db[_0x6f57('0x2f')][_0x6f57('0x45')](_0x2d1b94);})['then'](function(_0x4fa762){_0x2c11b1[_0x6f57('0x46')]=_0x4fa762;return _0x2c11b1;})[_0x6f57('0x24')](respondWithFilteredResult(_0x61e2b1,_0x2d1b94))[_0x6f57('0x47')](handleError(_0x61e2b1,null));};exports[_0x6f57('0x48')]=function(_0x171df0,_0x5ae0c8){var _0x5e8add={'raw':![],'where':{'id':_0x171df0[_0x6f57('0x49')]['id']}},_0xf60da7={};_0xf60da7['model']=_[_0x6f57('0x33')](db[_0x6f57('0x2f')][_0x6f57('0x4a')]);_0xf60da7['query']=_[_0x6f57('0x33')](_0x171df0[_0x6f57('0x34')]);_0xf60da7[_0x6f57('0x35')]=_[_0x6f57('0x36')](_0xf60da7[_0x6f57('0x32')],_0xf60da7[_0x6f57('0x34')]);_0x5e8add[_0x6f57('0x37')]=_[_0x6f57('0x36')](_0xf60da7[_0x6f57('0x32')],qs['fields'](_0x171df0[_0x6f57('0x34')][_0x6f57('0x38')]));_0x5e8add[_0x6f57('0x37')]=_0x5e8add[_0x6f57('0x37')][_0x6f57('0x39')]?_0x5e8add[_0x6f57('0x37')]:_0xf60da7[_0x6f57('0x32')];if(_0x171df0[_0x6f57('0x34')][_0x6f57('0x43')]){_0x5e8add[_0x6f57('0x44')]=[{'all':!![]}];}_0x5e8add=_[_0x6f57('0x40')]({},_0x5e8add,_0x171df0[_0x6f57('0x42')]);return db['Trigger'][_0x6f57('0x4b')](_0x5e8add)[_0x6f57('0x24')](handleEntityNotFound(_0x5ae0c8,null))[_0x6f57('0x24')](respondWithResult(_0x5ae0c8,null))[_0x6f57('0x47')](handleError(_0x5ae0c8,null));};exports['create']=function(_0x2f63d7,_0x14d04d){return db['Trigger'][_0x6f57('0x4c')](_0x2f63d7['body'],{})['then'](function(_0x18cec8){var _0x4d2145=_0x2f63d7[_0x6f57('0x4d')][_0x6f57('0x26')]({'plain':!![]});if(!_0x4d2145)throw new Error(_0x6f57('0x4e'));if(_0x4d2145['role']===_0x6f57('0x4d')){var _0x49c5c8=_0x18cec8[_0x6f57('0x26')]({'plain':!![]});var _0x92ed8f=_0x6f57('0x27');return db[_0x6f57('0x4f')]['find']({'where':{'name':_0x92ed8f,'userProfileId':_0x4d2145[_0x6f57('0x50')]},'raw':!![]})['then'](function(_0x538dfe){if(_0x538dfe&&_0x538dfe['autoAssociation']===0x0){return db[_0x6f57('0x28')]['create']({'name':_0x49c5c8[_0x6f57('0x2b')],'resourceId':_0x49c5c8['id'],'type':_0x538dfe['name'],'sectionId':_0x538dfe['id']},{})[_0x6f57('0x24')](function(){return _0x18cec8;});}else{return _0x18cec8;}})[_0x6f57('0x47')](function(_0x420354){logger[_0x6f57('0x29')](_0x6f57('0x51'),_0x420354);throw _0x420354;});}return _0x18cec8;})[_0x6f57('0x24')](respondWithResult(_0x14d04d,0xc9))[_0x6f57('0x47')](handleError(_0x14d04d,null));};exports[_0x6f57('0x52')]=function(_0x3e51e6,_0xc699cc){if(_0x3e51e6[_0x6f57('0x53')]['id']){delete _0x3e51e6[_0x6f57('0x53')]['id'];}return db[_0x6f57('0x2f')]['find']({'where':{'id':_0x3e51e6[_0x6f57('0x49')]['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0xc699cc,null))['then'](saveUpdates(_0x3e51e6[_0x6f57('0x53')],null))['then'](respondWithResult(_0xc699cc,null))[_0x6f57('0x47')](handleError(_0xc699cc,null));};exports[_0x6f57('0x25')]=function(_0x3f857f,_0x25e775){return db[_0x6f57('0x2f')][_0x6f57('0x4b')]({'where':{'id':_0x3f857f['params']['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0x25e775,null))[_0x6f57('0x24')](removeEntity(_0x25e775,null))[_0x6f57('0x47')](handleError(_0x25e775,null));};exports[_0x6f57('0x54')]=function(_0xcba42f,_0x4c7cfd,_0x253a56){if(_0xcba42f[_0x6f57('0x53')]['id']){delete _0xcba42f[_0x6f57('0x53')]['id'];}return db[_0x6f57('0x2f')]['find']({'where':{'id':_0xcba42f['params']['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0x4c7cfd,null))[_0x6f57('0x24')](function(_0x307446){if(_0x307446){_0xcba42f[_0x6f57('0x53')][_0x6f57('0x55')]=_0x307446['id'];return db[_0x6f57('0x56')][_0x6f57('0x4c')](_0xcba42f[_0x6f57('0x53')]);}})['then'](respondWithResult(_0x4c7cfd,null))[_0x6f57('0x47')](handleError(_0x4c7cfd,null));};exports['addAnyCondition']=function(_0x913526,_0x59d015,_0xefea50){if(_0x913526[_0x6f57('0x53')]['id']){delete _0x913526[_0x6f57('0x53')]['id'];}return db[_0x6f57('0x2f')][_0x6f57('0x4b')]({'where':{'id':_0x913526['params']['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0x59d015,null))[_0x6f57('0x24')](function(_0x162c92){if(_0x162c92){_0x913526[_0x6f57('0x53')][_0x6f57('0x57')]=_0x162c92['id'];return db[_0x6f57('0x56')][_0x6f57('0x4c')](_0x913526[_0x6f57('0x53')]);}})[_0x6f57('0x24')](respondWithResult(_0x59d015,null))['catch'](handleError(_0x59d015,null));};exports[_0x6f57('0x58')]=function(_0x32e292,_0x297b26,_0x34f85c){var _0x43ca8b={};var _0x24880f={};var _0x588130;var _0x1fa995;return db[_0x6f57('0x2f')][_0x6f57('0x59')]({'where':{'id':_0x32e292[_0x6f57('0x49')]['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0x297b26,null))['then'](function(_0x34cfd9){if(_0x34cfd9){_0x588130=_0x34cfd9;_0x24880f[_0x6f57('0x32')]=_['keys'](db[_0x6f57('0x56')][_0x6f57('0x4a')]);_0x24880f[_0x6f57('0x34')]=_[_0x6f57('0x33')](_0x32e292[_0x6f57('0x34')]);_0x24880f[_0x6f57('0x35')]=_[_0x6f57('0x36')](_0x24880f[_0x6f57('0x32')],_0x24880f[_0x6f57('0x34')]);_0x43ca8b[_0x6f57('0x37')]=_[_0x6f57('0x36')](_0x24880f[_0x6f57('0x32')],qs[_0x6f57('0x38')](_0x32e292[_0x6f57('0x34')]['fields']));_0x43ca8b[_0x6f57('0x37')]=_0x43ca8b[_0x6f57('0x37')][_0x6f57('0x39')]?_0x43ca8b[_0x6f57('0x37')]:_0x24880f[_0x6f57('0x32')];_0x43ca8b[_0x6f57('0x3c')]=qs['sort'](_0x32e292[_0x6f57('0x34')][_0x6f57('0x3d')]);_0x43ca8b[_0x6f57('0x3e')]=qs[_0x6f57('0x35')](_[_0x6f57('0x5a')](_0x32e292['query'],_0x24880f['filters']));if(_0x32e292[_0x6f57('0x34')][_0x6f57('0x3f')]){_0x43ca8b[_0x6f57('0x3e')]=_[_0x6f57('0x40')](_0x43ca8b['where'],{'$or':_[_0x6f57('0x2e')](_0x43ca8b[_0x6f57('0x37')],function(_0x52df3c){var _0x2f55a1={};_0x2f55a1[_0x52df3c]={'$like':'%'+_0x32e292[_0x6f57('0x34')]['filter']+'%'};return _0x2f55a1;})});}_0x43ca8b=_[_0x6f57('0x40')]({},_0x43ca8b,_0x32e292[_0x6f57('0x42')]);return _0x588130[_0x6f57('0x58')](_0x43ca8b);}})[_0x6f57('0x24')](function(_0x4e5770){if(_0x4e5770){_0x1fa995=_0x4e5770[_0x6f57('0x39')];if(!_0x32e292['query'][_0x6f57('0x3a')](_0x6f57('0x3b'))){_0x43ca8b[_0x6f57('0x1d')]=qs[_0x6f57('0x1d')](_0x32e292['query']['limit']);_0x43ca8b[_0x6f57('0x1b')]=qs[_0x6f57('0x1b')](_0x32e292[_0x6f57('0x34')][_0x6f57('0x1b')]);}return _0x588130[_0x6f57('0x58')](_0x43ca8b);}})['then'](function(_0x4f3165){if(_0x4f3165){return _0x4f3165?{'count':_0x1fa995,'rows':_0x4f3165}:null;}})['then'](respondWithResult(_0x297b26,null))['catch'](handleError(_0x297b26,null));};exports[_0x6f57('0x5b')]=function(_0x141941,_0xec334e,_0x41eab6){var _0x5919ee={};var _0x2d512c={};var _0x58d269;var _0x39d484;return db[_0x6f57('0x2f')]['findOne']({'where':{'id':_0x141941[_0x6f57('0x49')]['id']}})['then'](handleEntityNotFound(_0xec334e,null))[_0x6f57('0x24')](function(_0x4d128b){if(_0x4d128b){_0x58d269=_0x4d128b;_0x2d512c['model']=_['keys'](db[_0x6f57('0x56')][_0x6f57('0x4a')]);_0x2d512c[_0x6f57('0x34')]=_['keys'](_0x141941[_0x6f57('0x34')]);_0x2d512c[_0x6f57('0x35')]=_[_0x6f57('0x36')](_0x2d512c[_0x6f57('0x32')],_0x2d512c['query']);_0x5919ee[_0x6f57('0x37')]=_['intersection'](_0x2d512c[_0x6f57('0x32')],qs[_0x6f57('0x38')](_0x141941[_0x6f57('0x34')][_0x6f57('0x38')]));_0x5919ee[_0x6f57('0x37')]=_0x5919ee[_0x6f57('0x37')][_0x6f57('0x39')]?_0x5919ee[_0x6f57('0x37')]:_0x2d512c[_0x6f57('0x32')];_0x5919ee[_0x6f57('0x3c')]=qs[_0x6f57('0x3d')](_0x141941[_0x6f57('0x34')]['sort']);_0x5919ee[_0x6f57('0x3e')]=qs[_0x6f57('0x35')](_[_0x6f57('0x5a')](_0x141941[_0x6f57('0x34')],_0x2d512c[_0x6f57('0x35')]));if(_0x141941[_0x6f57('0x34')][_0x6f57('0x3f')]){_0x5919ee[_0x6f57('0x3e')]=_[_0x6f57('0x40')](_0x5919ee[_0x6f57('0x3e')],{'$or':_[_0x6f57('0x2e')](_0x5919ee[_0x6f57('0x37')],function(_0x49fa43){var _0x1181b8={};_0x1181b8[_0x49fa43]={'$like':'%'+_0x141941['query'][_0x6f57('0x3f')]+'%'};return _0x1181b8;})});}_0x5919ee=_[_0x6f57('0x40')]({},_0x5919ee,_0x141941[_0x6f57('0x42')]);return _0x58d269[_0x6f57('0x5b')](_0x5919ee);}})[_0x6f57('0x24')](function(_0x469959){if(_0x469959){_0x39d484=_0x469959['length'];if(!_0x141941[_0x6f57('0x34')][_0x6f57('0x3a')](_0x6f57('0x3b'))){_0x5919ee[_0x6f57('0x1d')]=qs['limit'](_0x141941[_0x6f57('0x34')]['limit']);_0x5919ee[_0x6f57('0x1b')]=qs[_0x6f57('0x1b')](_0x141941[_0x6f57('0x34')][_0x6f57('0x1b')]);}return _0x58d269[_0x6f57('0x5b')](_0x5919ee);}})['then'](function(_0x33a2e9){if(_0x33a2e9){return _0x33a2e9?{'count':_0x39d484,'rows':_0x33a2e9}:null;}})[_0x6f57('0x24')](respondWithResult(_0xec334e,null))[_0x6f57('0x47')](handleError(_0xec334e,null));};exports[_0x6f57('0x5c')]=function(_0x236295,_0x10d78c,_0x112ea4){if(_0x236295[_0x6f57('0x53')]['id']){delete _0x236295[_0x6f57('0x53')]['id'];}return db['Trigger'][_0x6f57('0x4b')]({'where':{'id':_0x236295['params']['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0x10d78c,null))[_0x6f57('0x24')](function(_0x12034e){if(_0x12034e){_0x236295[_0x6f57('0x53')]['TriggerId']=_0x12034e['id'];return db[_0x6f57('0x5d')][_0x6f57('0x4c')](_0x236295[_0x6f57('0x53')]);}})['then'](respondWithResult(_0x10d78c,null))[_0x6f57('0x47')](handleError(_0x10d78c,null));};exports[_0x6f57('0x5e')]=function(_0x13a607,_0x52aefe,_0x2cda0a){var _0x159ecc={};var _0x52a577={};var _0x33a8ce;var _0x5dc13d;return db[_0x6f57('0x2f')][_0x6f57('0x59')]({'where':{'id':_0x13a607[_0x6f57('0x49')]['id']}})[_0x6f57('0x24')](handleEntityNotFound(_0x52aefe,null))['then'](function(_0x532c37){if(_0x532c37){_0x33a8ce=_0x532c37;_0x52a577['model']=_[_0x6f57('0x33')](db[_0x6f57('0x5d')]['rawAttributes']);_0x52a577['query']=_[_0x6f57('0x33')](_0x13a607['query']);_0x52a577[_0x6f57('0x35')]=_[_0x6f57('0x36')](_0x52a577[_0x6f57('0x32')],_0x52a577['query']);_0x159ecc[_0x6f57('0x37')]=_[_0x6f57('0x36')](_0x52a577['model'],qs[_0x6f57('0x38')](_0x13a607[_0x6f57('0x34')][_0x6f57('0x38')]));_0x159ecc['attributes']=_0x159ecc[_0x6f57('0x37')]['length']?_0x159ecc[_0x6f57('0x37')]:_0x52a577[_0x6f57('0x32')];_0x159ecc['order']=qs[_0x6f57('0x3d')](_0x13a607[_0x6f57('0x34')][_0x6f57('0x3d')]);_0x159ecc['where']=qs[_0x6f57('0x35')](_['pick'](_0x13a607[_0x6f57('0x34')],_0x52a577[_0x6f57('0x35')]));if(_0x13a607['query']['filter']){_0x159ecc[_0x6f57('0x3e')]=_[_0x6f57('0x40')](_0x159ecc[_0x6f57('0x3e')],{'$or':_['map'](_0x159ecc[_0x6f57('0x37')],function(_0x51fbad){var _0x5f0d26={};_0x5f0d26[_0x51fbad]={'$like':'%'+_0x13a607['query']['filter']+'%'};return _0x5f0d26;})});}_0x159ecc=_[_0x6f57('0x40')]({},_0x159ecc,_0x13a607['options']);return _0x33a8ce['getActions'](_0x159ecc);}})[_0x6f57('0x24')](function(_0xbc5fee){if(_0xbc5fee){_0x5dc13d=_0xbc5fee['length'];if(!_0x13a607[_0x6f57('0x34')]['hasOwnProperty'](_0x6f57('0x3b'))){_0x159ecc[_0x6f57('0x1d')]=qs[_0x6f57('0x1d')](_0x13a607[_0x6f57('0x34')][_0x6f57('0x1d')]);_0x159ecc[_0x6f57('0x1b')]=qs[_0x6f57('0x1b')](_0x13a607[_0x6f57('0x34')][_0x6f57('0x1b')]);}return _0x33a8ce[_0x6f57('0x5e')](_0x159ecc);}})[_0x6f57('0x24')](function(_0xcf5cba){if(_0xcf5cba){return _0xcf5cba?{'count':_0x5dc13d,'rows':_0xcf5cba}:null;}})[_0x6f57('0x24')](respondWithResult(_0x52aefe,null))['catch'](handleError(_0x52aefe,null));}; \ No newline at end of file +var _0xe971=['error','name','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','findAll','rows','catch','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','TriggerAnyId','filter','getAllConditions','getAnyConditions','findOne','hasOwnProperty','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','sendStatus'];(function(_0x113753,_0x66b58c){var _0x2dfaaa=function(_0x158e96){while(--_0x158e96){_0x113753['push'](_0x113753['shift']());}};_0x2dfaaa(++_0x66b58c);}(_0xe971,0xee));var _0x1e97=function(_0x426c4e,_0x4c6be0){_0x426c4e=_0x426c4e-0x0;var _0x3d2712=_0xe971[_0x426c4e];return _0x3d2712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e97('0x0'));var zipdir=require(_0x1e97('0x1'));var jsonpatch=require(_0x1e97('0x2'));var rp=require(_0x1e97('0x3'));var moment=require(_0x1e97('0x4'));var BPromise=require(_0x1e97('0x5'));var Mustache=require(_0x1e97('0x6'));var util=require(_0x1e97('0x7'));var path=require(_0x1e97('0x8'));var sox=require('sox');var csv=require(_0x1e97('0x9'));var ejs=require(_0x1e97('0xa'));var fs=require('fs');var fs_extra=require(_0x1e97('0xb'));var _=require(_0x1e97('0xc'));var squel=require(_0x1e97('0xd'));var crypto=require(_0x1e97('0xe'));var jsforce=require(_0x1e97('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1e97('0x9'));var querystring=require(_0x1e97('0x10'));var Papa=require(_0x1e97('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1e97('0x12'));var hardwareService=require(_0x1e97('0x13'));var logger=require(_0x1e97('0x14'))(_0x1e97('0x15'));var utils=require(_0x1e97('0x16'));var config=require(_0x1e97('0x17'));var licenseUtil=require(_0x1e97('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20c72d,_0x2479e8){_0x2479e8=_0x2479e8||0xcc;return function(_0x35b4ef){if(_0x35b4ef){return _0x20c72d['sendStatus'](_0x2479e8);}return _0x20c72d[_0x1e97('0x19')](_0x2479e8)[_0x1e97('0x1a')]();};}function respondWithResult(_0xce8b08,_0x42df01){_0x42df01=_0x42df01||0xc8;return function(_0x5f594d){if(_0x5f594d){return _0xce8b08['status'](_0x42df01)[_0x1e97('0x1b')](_0x5f594d);}};}function respondWithFilteredResult(_0x575a9b,_0x3c5388){return function(_0x29acab){if(_0x29acab){var _0x31cf45=typeof _0x3c5388[_0x1e97('0x1c')]===_0x1e97('0x1d')&&typeof _0x3c5388['limit']===_0x1e97('0x1d');var _0x18ad0b=_0x29acab[_0x1e97('0x1e')];var _0x378bbe=_0x31cf45?0x0:_0x3c5388['offset'];var _0x483276=_0x31cf45?_0x29acab['count']:_0x3c5388['offset']+_0x3c5388[_0x1e97('0x1f')];var _0x20c46e;if(_0x483276>=_0x18ad0b){_0x483276=_0x18ad0b;_0x20c46e=0xc8;}else{_0x20c46e=0xce;}_0x575a9b['status'](_0x20c46e);return _0x575a9b[_0x1e97('0x20')](_0x1e97('0x21'),_0x378bbe+'-'+_0x483276+'/'+_0x18ad0b)[_0x1e97('0x1b')](_0x29acab);}return null;};}function patchUpdates(_0x5be34b){return function(_0x5c01ab){try{jsonpatch[_0x1e97('0x22')](_0x5c01ab,_0x5be34b,!![]);}catch(_0x2a3ab6){return BPromise[_0x1e97('0x23')](_0x2a3ab6);}return _0x5c01ab[_0x1e97('0x24')]();};}function saveUpdates(_0x79f1d5,_0x588561){return function(_0x5a2a23){if(_0x5a2a23){return _0x5a2a23[_0x1e97('0x25')](_0x79f1d5)['then'](function(_0x133c82){return _0x133c82;});}return null;};}function removeEntity(_0x302c01,_0x64a6c0){return function(_0x5d070d){if(_0x5d070d){return _0x5d070d[_0x1e97('0x26')]()[_0x1e97('0x27')](function(){var _0x14fba9=_0x5d070d[_0x1e97('0x28')]({'plain':!![]});var _0x4a61a0=_0x1e97('0x29');return db[_0x1e97('0x2a')][_0x1e97('0x26')]({'where':{'type':_0x4a61a0,'resourceId':_0x14fba9['id']}})[_0x1e97('0x27')](function(){return _0x5d070d;});})['then'](function(){_0x302c01[_0x1e97('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4257cf,_0x356200){return function(_0x1297d0){if(!_0x1297d0){_0x4257cf[_0x1e97('0x2b')](0x194);}return _0x1297d0;};}function handleError(_0x5e465f,_0x243f26){_0x243f26=_0x243f26||0x1f4;return function(_0x38df61){logger[_0x1e97('0x2c')](_0x38df61['stack']);if(_0x38df61[_0x1e97('0x2d')]){delete _0x38df61[_0x1e97('0x2d')];}_0x5e465f[_0x1e97('0x19')](_0x243f26)['send'](_0x38df61);};}exports['index']=function(_0x5d4bf9,_0x470d20){var _0x43c51d={},_0x232466={},_0x1aea6d={'count':0x0,'rows':[]};var _0xbf54ea=_[_0x1e97('0x2e')](db[_0x1e97('0x2f')][_0x1e97('0x30')],function(_0x408973){return{'name':_0x408973[_0x1e97('0x31')],'type':_0x408973[_0x1e97('0x32')][_0x1e97('0x33')]};});_0x232466[_0x1e97('0x34')]=_[_0x1e97('0x2e')](_0xbf54ea,'name');_0x232466[_0x1e97('0x35')]=_[_0x1e97('0x36')](_0x5d4bf9[_0x1e97('0x35')]);_0x232466[_0x1e97('0x37')]=_[_0x1e97('0x38')](_0x232466[_0x1e97('0x34')],_0x232466[_0x1e97('0x35')]);_0x43c51d[_0x1e97('0x39')]=_[_0x1e97('0x38')](_0x232466[_0x1e97('0x34')],qs[_0x1e97('0x3a')](_0x5d4bf9['query'][_0x1e97('0x3a')]));_0x43c51d['attributes']=_0x43c51d[_0x1e97('0x39')][_0x1e97('0x3b')]?_0x43c51d[_0x1e97('0x39')]:_0x232466['model'];if(!_0x5d4bf9[_0x1e97('0x35')]['hasOwnProperty'](_0x1e97('0x3c'))){_0x43c51d[_0x1e97('0x1f')]=qs['limit'](_0x5d4bf9['query'][_0x1e97('0x1f')]);_0x43c51d[_0x1e97('0x1c')]=qs['offset'](_0x5d4bf9['query']['offset']);}_0x43c51d[_0x1e97('0x3d')]=qs[_0x1e97('0x3e')](_0x5d4bf9[_0x1e97('0x35')][_0x1e97('0x3e')]);_0x43c51d[_0x1e97('0x3f')]=qs[_0x1e97('0x37')](_[_0x1e97('0x40')](_0x5d4bf9[_0x1e97('0x35')],_0x232466[_0x1e97('0x37')]),_0xbf54ea);if(_0x5d4bf9[_0x1e97('0x35')]['filter']){_0x43c51d[_0x1e97('0x3f')]=_[_0x1e97('0x41')](_0x43c51d[_0x1e97('0x3f')],{'$or':_['map'](_0xbf54ea,function(_0x4cdc28){if(_0x4cdc28[_0x1e97('0x32')]!==_0x1e97('0x42')){var _0x119093={};_0x119093[_0x4cdc28[_0x1e97('0x2d')]]={'$like':'%'+_0x5d4bf9[_0x1e97('0x35')]['filter']+'%'};return _0x119093;}})});}_0x43c51d=_[_0x1e97('0x41')]({},_0x43c51d,_0x5d4bf9['options']);var _0x548d51={'where':_0x43c51d[_0x1e97('0x3f')]};return db['Trigger'][_0x1e97('0x1e')](_0x548d51)['then'](function(_0x41e54d){_0x1aea6d[_0x1e97('0x1e')]=_0x41e54d;if(_0x5d4bf9['query']['includeAll']){_0x43c51d['include']=[{'all':!![]}];}return db['Trigger'][_0x1e97('0x43')](_0x43c51d);})['then'](function(_0x6098b2){_0x1aea6d[_0x1e97('0x44')]=_0x6098b2;return _0x1aea6d;})[_0x1e97('0x27')](respondWithFilteredResult(_0x470d20,_0x43c51d))[_0x1e97('0x45')](handleError(_0x470d20,null));};exports['show']=function(_0x2b25d6,_0x4d7588){var _0x4743c0={'raw':![],'where':{'id':_0x2b25d6[_0x1e97('0x46')]['id']}},_0x3910bc={};_0x3910bc['model']=_['keys'](db[_0x1e97('0x2f')]['rawAttributes']);_0x3910bc[_0x1e97('0x35')]=_[_0x1e97('0x36')](_0x2b25d6['query']);_0x3910bc[_0x1e97('0x37')]=_['intersection'](_0x3910bc[_0x1e97('0x34')],_0x3910bc[_0x1e97('0x35')]);_0x4743c0['attributes']=_['intersection'](_0x3910bc[_0x1e97('0x34')],qs[_0x1e97('0x3a')](_0x2b25d6['query'][_0x1e97('0x3a')]));_0x4743c0[_0x1e97('0x39')]=_0x4743c0[_0x1e97('0x39')][_0x1e97('0x3b')]?_0x4743c0[_0x1e97('0x39')]:_0x3910bc[_0x1e97('0x34')];if(_0x2b25d6[_0x1e97('0x35')][_0x1e97('0x47')]){_0x4743c0['include']=[{'all':!![]}];}_0x4743c0=_[_0x1e97('0x41')]({},_0x4743c0,_0x2b25d6[_0x1e97('0x48')]);return db['Trigger'][_0x1e97('0x49')](_0x4743c0)[_0x1e97('0x27')](handleEntityNotFound(_0x4d7588,null))['then'](respondWithResult(_0x4d7588,null))[_0x1e97('0x45')](handleError(_0x4d7588,null));};exports[_0x1e97('0x4a')]=function(_0x3f9af4,_0x348b4e){return db['Trigger']['create'](_0x3f9af4[_0x1e97('0x4b')],{})[_0x1e97('0x27')](function(_0x315490){var _0x40b29d=_0x3f9af4['user']['get']({'plain':!![]});if(!_0x40b29d)throw new Error(_0x1e97('0x4c'));if(_0x40b29d['role']===_0x1e97('0x4d')){var _0x1833c4=_0x315490[_0x1e97('0x28')]({'plain':!![]});var _0xa2e1f3=_0x1e97('0x29');return db[_0x1e97('0x4e')][_0x1e97('0x49')]({'where':{'name':_0xa2e1f3,'userProfileId':_0x40b29d[_0x1e97('0x4f')]},'raw':!![]})[_0x1e97('0x27')](function(_0x55c020){if(_0x55c020&&_0x55c020[_0x1e97('0x50')]===0x0){return db['UserProfileResource'][_0x1e97('0x4a')]({'name':_0x1833c4[_0x1e97('0x2d')],'resourceId':_0x1833c4['id'],'type':_0x55c020['name'],'sectionId':_0x55c020['id']},{})['then'](function(){return _0x315490;});}else{return _0x315490;}})[_0x1e97('0x45')](function(_0x2998ce){logger[_0x1e97('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2998ce);throw _0x2998ce;});}return _0x315490;})[_0x1e97('0x27')](respondWithResult(_0x348b4e,0xc9))[_0x1e97('0x45')](handleError(_0x348b4e,null));};exports['update']=function(_0x56bb12,_0x290a23){if(_0x56bb12[_0x1e97('0x4b')]['id']){delete _0x56bb12[_0x1e97('0x4b')]['id'];}return db[_0x1e97('0x2f')][_0x1e97('0x49')]({'where':{'id':_0x56bb12[_0x1e97('0x46')]['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x290a23,null))['then'](saveUpdates(_0x56bb12['body'],null))[_0x1e97('0x27')](respondWithResult(_0x290a23,null))[_0x1e97('0x45')](handleError(_0x290a23,null));};exports[_0x1e97('0x26')]=function(_0x3ebb82,_0x418978){return db[_0x1e97('0x2f')][_0x1e97('0x49')]({'where':{'id':_0x3ebb82[_0x1e97('0x46')]['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x418978,null))[_0x1e97('0x27')](removeEntity(_0x418978,null))['catch'](handleError(_0x418978,null));};exports[_0x1e97('0x51')]=function(_0x4a6f4f,_0x64c899,_0x707a39){if(_0x4a6f4f[_0x1e97('0x4b')]['id']){delete _0x4a6f4f[_0x1e97('0x4b')]['id'];}return db['Trigger'][_0x1e97('0x49')]({'where':{'id':_0x4a6f4f['params']['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x64c899,null))[_0x1e97('0x27')](function(_0x514a54){if(_0x514a54){_0x4a6f4f['body'][_0x1e97('0x52')]=_0x514a54['id'];return db[_0x1e97('0x53')][_0x1e97('0x4a')](_0x4a6f4f[_0x1e97('0x4b')]);}})[_0x1e97('0x27')](respondWithResult(_0x64c899,null))[_0x1e97('0x45')](handleError(_0x64c899,null));};exports['addAnyCondition']=function(_0x3b6d07,_0x5390b0,_0x11a39d){if(_0x3b6d07[_0x1e97('0x4b')]['id']){delete _0x3b6d07['body']['id'];}return db[_0x1e97('0x2f')][_0x1e97('0x49')]({'where':{'id':_0x3b6d07['params']['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x5390b0,null))['then'](function(_0x428f35){if(_0x428f35){_0x3b6d07[_0x1e97('0x4b')][_0x1e97('0x54')]=_0x428f35['id'];return db[_0x1e97('0x53')][_0x1e97('0x4a')](_0x3b6d07[_0x1e97('0x4b')]);}})[_0x1e97('0x27')](respondWithResult(_0x5390b0,null))['catch'](handleError(_0x5390b0,null));};exports['getAllConditions']=function(_0x318512,_0x1e6f5f,_0x2bd6d9){var _0x42d89f={};var _0x2b735c={};var _0x17cef8;var _0x224abc;return db[_0x1e97('0x2f')]['findOne']({'where':{'id':_0x318512[_0x1e97('0x46')]['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x1e6f5f,null))[_0x1e97('0x27')](function(_0x2e05f5){if(_0x2e05f5){_0x17cef8=_0x2e05f5;_0x2b735c['model']=_[_0x1e97('0x36')](db[_0x1e97('0x53')][_0x1e97('0x30')]);_0x2b735c[_0x1e97('0x35')]=_[_0x1e97('0x36')](_0x318512[_0x1e97('0x35')]);_0x2b735c[_0x1e97('0x37')]=_[_0x1e97('0x38')](_0x2b735c[_0x1e97('0x34')],_0x2b735c[_0x1e97('0x35')]);_0x42d89f[_0x1e97('0x39')]=_[_0x1e97('0x38')](_0x2b735c[_0x1e97('0x34')],qs['fields'](_0x318512[_0x1e97('0x35')]['fields']));_0x42d89f[_0x1e97('0x39')]=_0x42d89f[_0x1e97('0x39')][_0x1e97('0x3b')]?_0x42d89f[_0x1e97('0x39')]:_0x2b735c['model'];_0x42d89f[_0x1e97('0x3d')]=qs[_0x1e97('0x3e')](_0x318512[_0x1e97('0x35')][_0x1e97('0x3e')]);_0x42d89f[_0x1e97('0x3f')]=qs['filters'](_['pick'](_0x318512[_0x1e97('0x35')],_0x2b735c[_0x1e97('0x37')]));if(_0x318512[_0x1e97('0x35')][_0x1e97('0x55')]){_0x42d89f[_0x1e97('0x3f')]=_['merge'](_0x42d89f[_0x1e97('0x3f')],{'$or':_[_0x1e97('0x2e')](_0x42d89f[_0x1e97('0x39')],function(_0x265e69){var _0x55d28f={};_0x55d28f[_0x265e69]={'$like':'%'+_0x318512[_0x1e97('0x35')][_0x1e97('0x55')]+'%'};return _0x55d28f;})});}_0x42d89f=_['merge']({},_0x42d89f,_0x318512[_0x1e97('0x48')]);return _0x17cef8[_0x1e97('0x56')](_0x42d89f);}})[_0x1e97('0x27')](function(_0x309f29){if(_0x309f29){_0x224abc=_0x309f29[_0x1e97('0x3b')];if(!_0x318512[_0x1e97('0x35')]['hasOwnProperty'](_0x1e97('0x3c'))){_0x42d89f[_0x1e97('0x1f')]=qs['limit'](_0x318512[_0x1e97('0x35')]['limit']);_0x42d89f['offset']=qs[_0x1e97('0x1c')](_0x318512[_0x1e97('0x35')][_0x1e97('0x1c')]);}return _0x17cef8['getAllConditions'](_0x42d89f);}})[_0x1e97('0x27')](function(_0x5d1a80){if(_0x5d1a80){return _0x5d1a80?{'count':_0x224abc,'rows':_0x5d1a80}:null;}})[_0x1e97('0x27')](respondWithResult(_0x1e6f5f,null))[_0x1e97('0x45')](handleError(_0x1e6f5f,null));};exports[_0x1e97('0x57')]=function(_0x494ea,_0x4c31dc,_0x4b33f4){var _0x20edc0={};var _0x5a6d45={};var _0x5876a9;var _0x586d1d;return db[_0x1e97('0x2f')][_0x1e97('0x58')]({'where':{'id':_0x494ea[_0x1e97('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c31dc,null))[_0x1e97('0x27')](function(_0x21b382){if(_0x21b382){_0x5876a9=_0x21b382;_0x5a6d45[_0x1e97('0x34')]=_[_0x1e97('0x36')](db['Condition']['rawAttributes']);_0x5a6d45[_0x1e97('0x35')]=_['keys'](_0x494ea[_0x1e97('0x35')]);_0x5a6d45[_0x1e97('0x37')]=_[_0x1e97('0x38')](_0x5a6d45['model'],_0x5a6d45[_0x1e97('0x35')]);_0x20edc0[_0x1e97('0x39')]=_[_0x1e97('0x38')](_0x5a6d45['model'],qs[_0x1e97('0x3a')](_0x494ea[_0x1e97('0x35')][_0x1e97('0x3a')]));_0x20edc0[_0x1e97('0x39')]=_0x20edc0['attributes']['length']?_0x20edc0[_0x1e97('0x39')]:_0x5a6d45[_0x1e97('0x34')];_0x20edc0[_0x1e97('0x3d')]=qs[_0x1e97('0x3e')](_0x494ea[_0x1e97('0x35')][_0x1e97('0x3e')]);_0x20edc0[_0x1e97('0x3f')]=qs['filters'](_[_0x1e97('0x40')](_0x494ea[_0x1e97('0x35')],_0x5a6d45[_0x1e97('0x37')]));if(_0x494ea[_0x1e97('0x35')][_0x1e97('0x55')]){_0x20edc0[_0x1e97('0x3f')]=_['merge'](_0x20edc0['where'],{'$or':_[_0x1e97('0x2e')](_0x20edc0[_0x1e97('0x39')],function(_0x3b993b){var _0x2a433f={};_0x2a433f[_0x3b993b]={'$like':'%'+_0x494ea[_0x1e97('0x35')][_0x1e97('0x55')]+'%'};return _0x2a433f;})});}_0x20edc0=_['merge']({},_0x20edc0,_0x494ea[_0x1e97('0x48')]);return _0x5876a9[_0x1e97('0x57')](_0x20edc0);}})['then'](function(_0x8c111){if(_0x8c111){_0x586d1d=_0x8c111['length'];if(!_0x494ea[_0x1e97('0x35')][_0x1e97('0x59')](_0x1e97('0x3c'))){_0x20edc0[_0x1e97('0x1f')]=qs[_0x1e97('0x1f')](_0x494ea[_0x1e97('0x35')][_0x1e97('0x1f')]);_0x20edc0[_0x1e97('0x1c')]=qs['offset'](_0x494ea['query'][_0x1e97('0x1c')]);}return _0x5876a9[_0x1e97('0x57')](_0x20edc0);}})[_0x1e97('0x27')](function(_0x5d117c){if(_0x5d117c){return _0x5d117c?{'count':_0x586d1d,'rows':_0x5d117c}:null;}})['then'](respondWithResult(_0x4c31dc,null))[_0x1e97('0x45')](handleError(_0x4c31dc,null));};exports[_0x1e97('0x5a')]=function(_0x1c1edf,_0x18f7f7,_0x21db58){if(_0x1c1edf[_0x1e97('0x4b')]['id']){delete _0x1c1edf[_0x1e97('0x4b')]['id'];}return db[_0x1e97('0x2f')]['find']({'where':{'id':_0x1c1edf['params']['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x18f7f7,null))[_0x1e97('0x27')](function(_0x56ba7b){if(_0x56ba7b){_0x1c1edf[_0x1e97('0x4b')][_0x1e97('0x5b')]=_0x56ba7b['id'];return db[_0x1e97('0x5c')][_0x1e97('0x4a')](_0x1c1edf[_0x1e97('0x4b')]);}})[_0x1e97('0x27')](respondWithResult(_0x18f7f7,null))['catch'](handleError(_0x18f7f7,null));};exports[_0x1e97('0x5d')]=function(_0x473804,_0x5a5eda,_0x420a1b){var _0x28767d={};var _0x594b14={};var _0x5d5f2e;var _0x20822f;return db[_0x1e97('0x2f')][_0x1e97('0x58')]({'where':{'id':_0x473804[_0x1e97('0x46')]['id']}})[_0x1e97('0x27')](handleEntityNotFound(_0x5a5eda,null))[_0x1e97('0x27')](function(_0xfc33df){if(_0xfc33df){_0x5d5f2e=_0xfc33df;_0x594b14[_0x1e97('0x34')]=_[_0x1e97('0x36')](db[_0x1e97('0x5c')][_0x1e97('0x30')]);_0x594b14['query']=_['keys'](_0x473804['query']);_0x594b14['filters']=_[_0x1e97('0x38')](_0x594b14['model'],_0x594b14[_0x1e97('0x35')]);_0x28767d[_0x1e97('0x39')]=_[_0x1e97('0x38')](_0x594b14[_0x1e97('0x34')],qs[_0x1e97('0x3a')](_0x473804[_0x1e97('0x35')][_0x1e97('0x3a')]));_0x28767d[_0x1e97('0x39')]=_0x28767d['attributes']['length']?_0x28767d['attributes']:_0x594b14[_0x1e97('0x34')];_0x28767d[_0x1e97('0x3d')]=qs[_0x1e97('0x3e')](_0x473804[_0x1e97('0x35')][_0x1e97('0x3e')]);_0x28767d[_0x1e97('0x3f')]=qs[_0x1e97('0x37')](_[_0x1e97('0x40')](_0x473804[_0x1e97('0x35')],_0x594b14[_0x1e97('0x37')]));if(_0x473804[_0x1e97('0x35')]['filter']){_0x28767d[_0x1e97('0x3f')]=_[_0x1e97('0x41')](_0x28767d['where'],{'$or':_[_0x1e97('0x2e')](_0x28767d['attributes'],function(_0x2f7316){var _0xbc33f6={};_0xbc33f6[_0x2f7316]={'$like':'%'+_0x473804[_0x1e97('0x35')][_0x1e97('0x55')]+'%'};return _0xbc33f6;})});}_0x28767d=_[_0x1e97('0x41')]({},_0x28767d,_0x473804[_0x1e97('0x48')]);return _0x5d5f2e[_0x1e97('0x5d')](_0x28767d);}})[_0x1e97('0x27')](function(_0x46aa98){if(_0x46aa98){_0x20822f=_0x46aa98[_0x1e97('0x3b')];if(!_0x473804[_0x1e97('0x35')][_0x1e97('0x59')](_0x1e97('0x3c'))){_0x28767d[_0x1e97('0x1f')]=qs[_0x1e97('0x1f')](_0x473804['query'][_0x1e97('0x1f')]);_0x28767d[_0x1e97('0x1c')]=qs[_0x1e97('0x1c')](_0x473804[_0x1e97('0x35')][_0x1e97('0x1c')]);}return _0x5d5f2e['getActions'](_0x28767d);}})[_0x1e97('0x27')](function(_0x1b57b9){if(_0x1b57b9){return _0x1b57b9?{'count':_0x20822f,'rows':_0x1b57b9}:null;}})['then'](respondWithResult(_0x5a5eda,null))['catch'](handleError(_0x5a5eda,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 48c47ff..98f9a46 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 _0x6bff=['api','bluebird','request-promise','path','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6bff,0xa6));var _0xf6bf=function(_0xac038d,_0xce1131){_0xac038d=_0xac038d-0x0;var _0x46ff09=_0x6bff[_0xac038d];return _0x46ff09;};'use strict';var _=require(_0xf6bf('0x0'));var util=require(_0xf6bf('0x1'));var logger=require('../../config/logger')(_0xf6bf('0x2'));var moment=require('moment');var BPromise=require(_0xf6bf('0x3'));var rp=require(_0xf6bf('0x4'));var fs=require('fs');var path=require(_0xf6bf('0x5'));var rimraf=require(_0xf6bf('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6bf('0x7'));module[_0xf6bf('0x8')]=function(_0x27cdda,_0x239d17){return _0x27cdda[_0xf6bf('0x9')](_0xf6bf('0xa'),attributes,{'tableName':_0xf6bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3308=['define','tools_triggers','api','moment','bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports'];(function(_0x4df197,_0x2a0774){var _0x2edc78=function(_0x349c79){while(--_0x349c79){_0x4df197['push'](_0x4df197['shift']());}};_0x2edc78(++_0x2a0774);}(_0x3308,0x12e));var _0x8330=function(_0x36793,_0x88cbac){_0x36793=_0x36793-0x0;var _0x4af88e=_0x3308[_0x36793];return _0x4af88e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8330('0x0'));var moment=require(_0x8330('0x1'));var BPromise=require(_0x8330('0x2'));var rp=require(_0x8330('0x3'));var fs=require('fs');var path=require(_0x8330('0x4'));var rimraf=require('rimraf');var config=require(_0x8330('0x5'));var attributes=require(_0x8330('0x6'));module[_0x8330('0x7')]=function(_0x131c05,_0x14ac10){return _0x131c05[_0x8330('0x8')]('Trigger',attributes,{'tableName':_0x8330('0x9'),'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 9b48184..d379be8 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 _0x9d1d=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','model','attributes','map','debug','find','ShowTrigger','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x351a16,_0x15b73f){var _0x60f8e0=function(_0xe94866){while(--_0xe94866){_0x351a16['push'](_0x351a16['shift']());}};_0x60f8e0(++_0x15b73f);}(_0x9d1d,0x1a0));var _0xd9d1=function(_0x76e43c,_0x5ed0c8){_0x76e43c=_0x76e43c-0x0;var _0x3e268e=_0x9d1d[_0x76e43c];return _0x3e268e;};'use strict';var _=require(_0xd9d1('0x0'));var util=require(_0xd9d1('0x1'));var moment=require(_0xd9d1('0x2'));var BPromise=require(_0xd9d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9d1('0x4'));var db=require(_0xd9d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd9d1('0x6'));var config=require(_0xd9d1('0x7'));var jayson=require(_0xd9d1('0x8'));var client=jayson[_0xd9d1('0x9')][_0xd9d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xea2ee,_0x13b02b,_0xdc48b9){return new BPromise(function(_0x4f216c,_0x542330){return client[_0xd9d1('0xb')](_0xea2ee,_0xdc48b9)[_0xd9d1('0xc')](function(_0x14ae1d){logger[_0xd9d1('0xd')](_0xd9d1('0xe'),_0x13b02b,_0xd9d1('0xf'));logger['debug'](_0xd9d1('0x10'),_0x13b02b,_0xd9d1('0xf'),JSON[_0xd9d1('0x11')](_0x14ae1d));if(_0x14ae1d[_0xd9d1('0x12')]){if(_0x14ae1d[_0xd9d1('0x12')][_0xd9d1('0x13')]===0x1f4){logger[_0xd9d1('0x12')]('Trigger,\x20%s,\x20%s',_0x13b02b,_0x14ae1d[_0xd9d1('0x12')][_0xd9d1('0x14')]);return _0x542330(_0x14ae1d[_0xd9d1('0x12')]['message']);}logger['error'](_0xd9d1('0xe'),_0x13b02b,_0x14ae1d[_0xd9d1('0x12')][_0xd9d1('0x14')]);return _0x4f216c(_0x14ae1d['error']['message']);}else{logger[_0xd9d1('0xd')](_0xd9d1('0xe'),_0x13b02b,_0xd9d1('0xf'));_0x4f216c(_0x14ae1d['result']['message']);}})[_0xd9d1('0x15')](function(_0x4c7595){logger[_0xd9d1('0x12')](_0xd9d1('0xe'),_0x13b02b,_0x4c7595);_0x542330(_0x4c7595);});});}exports[_0xd9d1('0x16')]=function(_0x216e91){var _0x2d00b3=this;return new Promise(function(_0x2deb0e,_0x7a7a37){return db[_0xd9d1('0x17')][_0xd9d1('0x18')]({'raw':_0x216e91[_0xd9d1('0x19')]?_0x216e91[_0xd9d1('0x19')][_0xd9d1('0x1a')]===undefined?!![]:![]:!![],'where':_0x216e91[_0xd9d1('0x19')]?_0x216e91[_0xd9d1('0x19')][_0xd9d1('0x1b')]||null:null,'attributes':_0x216e91[_0xd9d1('0x19')]?_0x216e91[_0xd9d1('0x19')]['attributes']||null:null,'limit':_0x216e91[_0xd9d1('0x19')]?_0x216e91['options'][_0xd9d1('0x1c')]||null:null,'include':_0x216e91['options']?_0x216e91[_0xd9d1('0x19')][_0xd9d1('0x1d')]?_['map'](_0x216e91['options'][_0xd9d1('0x1d')],function(_0xba9d62){return{'model':db[_0xba9d62[_0xd9d1('0x1e')]],'as':_0xba9d62['as'],'attributes':_0xba9d62[_0xd9d1('0x1f')],'include':_0xba9d62['include']?_[_0xd9d1('0x20')](_0xba9d62[_0xd9d1('0x1d')],function(_0x2c9b18){return{'model':db[_0x2c9b18[_0xd9d1('0x1e')]],'as':_0x2c9b18['as'],'attributes':_0x2c9b18[_0xd9d1('0x1f')],'include':_0x2c9b18[_0xd9d1('0x1d')]?_[_0xd9d1('0x20')](_0x2c9b18['include'],function(_0x5e46cb){return{'model':db[_0x5e46cb[_0xd9d1('0x1e')]],'as':_0x5e46cb['as'],'attributes':_0x5e46cb[_0xd9d1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9d1('0xc')](function(_0x1764ac){logger[_0xd9d1('0xd')]('GetTrigger',_0x216e91);logger[_0xd9d1('0x21')](_0xd9d1('0x16'),_0x216e91,JSON[_0xd9d1('0x11')](_0x1764ac));_0x2deb0e(_0x1764ac);})[_0xd9d1('0x15')](function(_0x6dc6c){logger[_0xd9d1('0x12')](_0xd9d1('0x16'),_0x6dc6c[_0xd9d1('0x14')],_0x216e91);_0x7a7a37(_0x2d00b3[_0xd9d1('0x12')](0x1f4,_0x6dc6c[_0xd9d1('0x14')]));});});};exports['ShowTrigger']=function(_0x4bad76){var _0x3887a1=this;return new Promise(function(_0x22d645,_0x2211b3){return db[_0xd9d1('0x17')][_0xd9d1('0x22')]({'raw':_0x4bad76[_0xd9d1('0x19')]?_0x4bad76[_0xd9d1('0x19')][_0xd9d1('0x1a')]===undefined?!![]:![]:!![],'where':_0x4bad76[_0xd9d1('0x19')]?_0x4bad76[_0xd9d1('0x19')]['where']||null:null,'attributes':_0x4bad76[_0xd9d1('0x19')]?_0x4bad76[_0xd9d1('0x19')][_0xd9d1('0x1f')]||null:null,'include':_0x4bad76[_0xd9d1('0x19')]?_0x4bad76[_0xd9d1('0x19')][_0xd9d1('0x1d')]?_[_0xd9d1('0x20')](_0x4bad76[_0xd9d1('0x19')]['include'],function(_0x39c141){return{'model':db[_0x39c141[_0xd9d1('0x1e')]],'as':_0x39c141['as'],'attributes':_0x39c141[_0xd9d1('0x1f')],'include':_0x39c141[_0xd9d1('0x1d')]?_[_0xd9d1('0x20')](_0x39c141[_0xd9d1('0x1d')],function(_0x33c4e7){return{'model':db[_0x33c4e7['model']],'as':_0x33c4e7['as'],'attributes':_0x33c4e7[_0xd9d1('0x1f')],'include':_0x33c4e7['include']?_[_0xd9d1('0x20')](_0x33c4e7[_0xd9d1('0x1d')],function(_0x533ef0){return{'model':db[_0x533ef0['model']],'as':_0x533ef0['as'],'attributes':_0x533ef0[_0xd9d1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9d1('0xc')](function(_0x2f4c08){logger['info']('ShowTrigger',_0x4bad76);logger[_0xd9d1('0x21')](_0xd9d1('0x23'),_0x4bad76,JSON[_0xd9d1('0x11')](_0x2f4c08));_0x22d645(_0x2f4c08);})['catch'](function(_0xb0b927){logger[_0xd9d1('0x12')](_0xd9d1('0x23'),_0xb0b927['message'],_0x4bad76);_0x2211b3(_0x3887a1[_0xd9d1('0x12')](0x1f4,_0xb0b927['message']));});});}; \ No newline at end of file +var _0xb928=['limit','include','map','model','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes'];(function(_0x1813bb,_0x2c2612){var _0x4310bd=function(_0x5a4180){while(--_0x5a4180){_0x1813bb['push'](_0x1813bb['shift']());}};_0x4310bd(++_0x2c2612);}(_0xb928,0x16e));var _0x8b92=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xb928[_0x4164f2];return _0x2575c7;};'use strict';var _=require(_0x8b92('0x0'));var util=require(_0x8b92('0x1'));var moment=require(_0x8b92('0x2'));var BPromise=require(_0x8b92('0x3'));var rs=require(_0x8b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b92('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b92('0x6'))(_0x8b92('0x7'));var config=require(_0x8b92('0x8'));var jayson=require(_0x8b92('0x9'));var client=jayson[_0x8b92('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159a40,_0x18d803,_0x109468){return new BPromise(function(_0xb4e233,_0x42f79b){return client[_0x8b92('0xb')](_0x159a40,_0x109468)[_0x8b92('0xc')](function(_0x121e2c){logger[_0x8b92('0xd')](_0x8b92('0xe'),_0x18d803,_0x8b92('0xf'));logger[_0x8b92('0x10')](_0x8b92('0x11'),_0x18d803,_0x8b92('0xf'),JSON[_0x8b92('0x12')](_0x121e2c));if(_0x121e2c['error']){if(_0x121e2c[_0x8b92('0x13')][_0x8b92('0x14')]===0x1f4){logger[_0x8b92('0x13')]('Trigger,\x20%s,\x20%s',_0x18d803,_0x121e2c[_0x8b92('0x13')]['message']);return _0x42f79b(_0x121e2c[_0x8b92('0x13')][_0x8b92('0x15')]);}logger['error'](_0x8b92('0xe'),_0x18d803,_0x121e2c[_0x8b92('0x13')][_0x8b92('0x15')]);return _0xb4e233(_0x121e2c[_0x8b92('0x13')][_0x8b92('0x15')]);}else{logger[_0x8b92('0xd')](_0x8b92('0xe'),_0x18d803,_0x8b92('0xf'));_0xb4e233(_0x121e2c['result'][_0x8b92('0x15')]);}})[_0x8b92('0x16')](function(_0x37885f){logger[_0x8b92('0x13')]('Trigger,\x20%s,\x20%s',_0x18d803,_0x37885f);_0x42f79b(_0x37885f);});});}exports[_0x8b92('0x17')]=function(_0x8d9e74){var _0xf45d76=this;return new Promise(function(_0xb3bde6,_0x53d390){return db[_0x8b92('0x18')][_0x8b92('0x19')]({'raw':_0x8d9e74[_0x8b92('0x1a')]?_0x8d9e74['options'][_0x8b92('0x1b')]===undefined?!![]:![]:!![],'where':_0x8d9e74[_0x8b92('0x1a')]?_0x8d9e74[_0x8b92('0x1a')][_0x8b92('0x1c')]||null:null,'attributes':_0x8d9e74[_0x8b92('0x1a')]?_0x8d9e74['options'][_0x8b92('0x1d')]||null:null,'limit':_0x8d9e74[_0x8b92('0x1a')]?_0x8d9e74['options'][_0x8b92('0x1e')]||null:null,'include':_0x8d9e74['options']?_0x8d9e74['options'][_0x8b92('0x1f')]?_[_0x8b92('0x20')](_0x8d9e74[_0x8b92('0x1a')][_0x8b92('0x1f')],function(_0x450b59){return{'model':db[_0x450b59[_0x8b92('0x21')]],'as':_0x450b59['as'],'attributes':_0x450b59['attributes'],'include':_0x450b59[_0x8b92('0x1f')]?_[_0x8b92('0x20')](_0x450b59['include'],function(_0x49f666){return{'model':db[_0x49f666[_0x8b92('0x21')]],'as':_0x49f666['as'],'attributes':_0x49f666['attributes'],'include':_0x49f666[_0x8b92('0x1f')]?_[_0x8b92('0x20')](_0x49f666[_0x8b92('0x1f')],function(_0x335d64){return{'model':db[_0x335d64['model']],'as':_0x335d64['as'],'attributes':_0x335d64[_0x8b92('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8b92('0xc')](function(_0x5bea2d){logger[_0x8b92('0xd')](_0x8b92('0x17'),_0x8d9e74);logger['debug'](_0x8b92('0x17'),_0x8d9e74,JSON[_0x8b92('0x12')](_0x5bea2d));_0xb3bde6(_0x5bea2d);})['catch'](function(_0x1aa181){logger[_0x8b92('0x13')](_0x8b92('0x17'),_0x1aa181['message'],_0x8d9e74);_0x53d390(_0xf45d76[_0x8b92('0x13')](0x1f4,_0x1aa181[_0x8b92('0x15')]));});});};exports[_0x8b92('0x22')]=function(_0x27c0b4){var _0x502957=this;return new Promise(function(_0x2ba8ad,_0x51e87f){return db[_0x8b92('0x18')][_0x8b92('0x23')]({'raw':_0x27c0b4[_0x8b92('0x1a')]?_0x27c0b4['options'][_0x8b92('0x1b')]===undefined?!![]:![]:!![],'where':_0x27c0b4[_0x8b92('0x1a')]?_0x27c0b4[_0x8b92('0x1a')][_0x8b92('0x1c')]||null:null,'attributes':_0x27c0b4['options']?_0x27c0b4[_0x8b92('0x1a')][_0x8b92('0x1d')]||null:null,'include':_0x27c0b4['options']?_0x27c0b4['options'][_0x8b92('0x1f')]?_[_0x8b92('0x20')](_0x27c0b4[_0x8b92('0x1a')][_0x8b92('0x1f')],function(_0x1648c9){return{'model':db[_0x1648c9[_0x8b92('0x21')]],'as':_0x1648c9['as'],'attributes':_0x1648c9[_0x8b92('0x1d')],'include':_0x1648c9['include']?_[_0x8b92('0x20')](_0x1648c9[_0x8b92('0x1f')],function(_0xbe6161){return{'model':db[_0xbe6161[_0x8b92('0x21')]],'as':_0xbe6161['as'],'attributes':_0xbe6161[_0x8b92('0x1d')],'include':_0xbe6161[_0x8b92('0x1f')]?_[_0x8b92('0x20')](_0xbe6161[_0x8b92('0x1f')],function(_0x5b0a66){return{'model':db[_0x5b0a66[_0x8b92('0x21')]],'as':_0x5b0a66['as'],'attributes':_0x5b0a66[_0x8b92('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8b92('0xc')](function(_0x2a843d){logger[_0x8b92('0xd')](_0x8b92('0x22'),_0x27c0b4);logger['debug'](_0x8b92('0x22'),_0x27c0b4,JSON[_0x8b92('0x12')](_0x2a843d));_0x2ba8ad(_0x2a843d);})['catch'](function(_0xae988){logger[_0x8b92('0x13')]('ShowTrigger',_0xae988['message'],_0x27c0b4);_0x51e87f(_0x502957[_0x8b92('0x13')](0x1f4,_0xae988[_0x8b92('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c2a1594..696b263 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 _0x58ea=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','clone','put','destroy','path'];(function(_0x401022,_0x89023e){var _0x285bf1=function(_0x365666){while(--_0x365666){_0x401022['push'](_0x401022['shift']());}};_0x285bf1(++_0x89023e);}(_0x58ea,0x1a8));var _0xa58e=function(_0x33b037,_0x5260db){_0x33b037=_0x33b037-0x0;var _0xd37877=_0x58ea[_0x33b037];return _0xd37877;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa58e('0x0'));var timeout=require(_0xa58e('0x1'));var express=require(_0xa58e('0x2'));var router=express[_0xa58e('0x3')]();var fs_extra=require(_0xa58e('0x4'));var auth=require(_0xa58e('0x5'));var interaction=require(_0xa58e('0x6'));var config=require(_0xa58e('0x7'));var controller=require(_0xa58e('0x8'));router['get']('/',auth[_0xa58e('0x9')](),controller[_0xa58e('0xa')]);router[_0xa58e('0xb')](_0xa58e('0xc'),auth[_0xa58e('0x9')](),controller[_0xa58e('0xd')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xa58e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa58e('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xa58e('0x9')](),controller[_0xa58e('0x10')]);module['exports']=router; \ No newline at end of file +var _0xed37=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','clone','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x37fc3b,_0x13ea42){var _0x37b21b=function(_0x5e2a31){while(--_0x5e2a31){_0x37fc3b['push'](_0x37fc3b['shift']());}};_0x37b21b(++_0x13ea42);}(_0xed37,0x18c));var _0x7ed3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xed37[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x7ed3('0x0'));var util=require(_0x7ed3('0x1'));var path=require('path');var timeout=require(_0x7ed3('0x2'));var express=require('express');var router=express[_0x7ed3('0x3')]();var fs_extra=require(_0x7ed3('0x4'));var auth=require(_0x7ed3('0x5'));var interaction=require(_0x7ed3('0x6'));var config=require(_0x7ed3('0x7'));var controller=require(_0x7ed3('0x8'));router[_0x7ed3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x7ed3('0xa')](),controller[_0x7ed3('0xb')]);router['post']('/:id/clone',auth[_0x7ed3('0xa')](),controller[_0x7ed3('0xc')]);router[_0x7ed3('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ed3('0xe')]);router[_0x7ed3('0xf')](_0x7ed3('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x7ed3('0x11')](_0x7ed3('0x10'),auth[_0x7ed3('0xa')](),controller[_0x7ed3('0x12')]);module[_0x7ed3('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 2ad9b11..1b2331c 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 _0x8132=['rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','certificate','active','passive','update,nonat','BOOLEAN','STRING','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8132,0x16f));var _0x2813=function(_0x42736c,_0x261889){_0x42736c=_0x42736c-0x0;var _0x2dcccf=_0x8132[_0x42736c];return _0x2dcccf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2813('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x2'),_0x2813('0x3'),'peer'),'allowNull':![],'defaultValue':_0x2813('0x2')},'context':{'type':Sequelize[_0x2813('0x0')],'allowNull':![],'defaultValue':_0x2813('0x4')},'callingpres':{'type':Sequelize['ENUM'](_0x2813('0x5'),'ALLOWED_PASSED_SCREEN',_0x2813('0x6'),_0x2813('0x7'),_0x2813('0x8'),_0x2813('0x9'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x2813('0x0')]},'md5secret':{'type':Sequelize[_0x2813('0x0')]},'remotesecret':{'type':Sequelize[_0x2813('0x0')]},'transport':{'type':Sequelize[_0x2813('0x0')],'defaultValue':_0x2813('0xa'),'set':function(_0x3ab97c){this[_0x2813('0xb')]('transport',_0x3ab97c?_0x3ab97c[_0x2813('0xc')](','):null);},'get':function(){return this[_0x2813('0xd')](_0x2813('0xe'))?this['getDataValue'](_0x2813('0xe'))[_0x2813('0xf')](','):null;},'comment':_0x2813('0x10')},'dtmfmode':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x11'),_0x2813('0x12'),_0x2813('0x13'),_0x2813('0x14'),_0x2813('0x15')),'defaultValue':_0x2813('0x11')},'directmedia':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no',_0x2813('0x17'),_0x2813('0x18'),_0x2813('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2813('0x0')]},'directmediadeny':{'type':Sequelize[_0x2813('0x0')]},'nat':{'type':Sequelize[_0x2813('0x0')],'defaultValue':'force_rport,comedia','set':function(_0x1d222b){this[_0x2813('0xb')](_0x2813('0x1a'),_0x1d222b?_0x1d222b[_0x2813('0xc')](','):null);},'get':function(){return this[_0x2813('0xd')]('nat')?this[_0x2813('0xd')](_0x2813('0x1a'))[_0x2813('0xf')](','):null;},'comment':_0x2813('0x1b')},'callgroup':{'type':Sequelize[_0x2813('0x0')]},'namedcallgroup':{'type':Sequelize[_0x2813('0x0')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x2813('0x0')]},'language':{'type':Sequelize[_0x2813('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2813('0x0')],'defaultValue':_0x2813('0x1c')},'allow':{'type':Sequelize[_0x2813('0x0')],'allowNull':![],'defaultValue':_0x2813('0x1d'),'set':function(_0x201388){this[_0x2813('0xb')](_0x2813('0x1e'),_0x201388?_0x201388[_0x2813('0xc')](';'):_0x2813('0x1d'));},'get':function(){return this['getDataValue'](_0x2813('0x1e'))?this[_0x2813('0xd')]('allow')[_0x2813('0xf')](';'):null;},'comment':_0x2813('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x2813('0x16'),'no')},'insecure':{'type':Sequelize[_0x2813('0x0')],'defaultValue':_0x2813('0x20'),'set':function(_0xee2ebc){this[_0x2813('0xb')](_0x2813('0x21'),_0xee2ebc?_0xee2ebc[_0x2813('0xc')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x2813('0xd')](_0x2813('0x21'))[_0x2813('0xf')](','):null;},'comment':_0x2813('0x22')},'trustrpid':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2813('0x1')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'accountcode':{'type':Sequelize[_0x2813('0x23')](0xb)},'setvar':{'type':Sequelize[_0x2813('0x0')]},'callerid':{'type':Sequelize[_0x2813('0x0')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2813('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x2813('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2813('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x2813('0x0')]},'template':{'type':Sequelize[_0x2813('0x0')]},'videosupport':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no',_0x2813('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'mailbox':{'type':Sequelize[_0x2813('0x0')]},'session_timers':{'type':Sequelize['ENUM'](_0x2813('0x25'),'refuse',_0x2813('0x26'))},'session_expires':{'type':Sequelize[_0x2813('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x2813('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x27'),_0x2813('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x2813('0x0')]},'regexten':{'type':Sequelize[_0x2813('0x0')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x2813('0x0')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x2813('0x1')]('yes','no'),'defaultValue':_0x2813('0x16')},'keepalive':{'type':Sequelize[_0x2813('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x2813('0x0')]},'defaultuser':{'type':Sequelize[_0x2813('0x0')]},'rtptimeout':{'type':Sequelize[_0x2813('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2813('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x2813('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x2813('0x16'),'no',_0x2813('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x2813('0x0')]},'timert1':{'type':Sequelize[_0x2813('0x23')](0xb)},'timerb':{'type':Sequelize[_0x2813('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2813('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x2813('0x0')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2813('0x0')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x2813('0x0')]},'maxforwards':{'type':Sequelize[_0x2813('0x23')](0xb)},'encryption':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'force_avp':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'icesupport':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x2813('0x1')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x2813('0x16'),'no',_0x2813('0x2a'),_0x2813('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x2813('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2813('0x0')]},'dtlsprivatekey':{'type':Sequelize[_0x2813('0x0')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x2813('0x0')]},'dtlscapath':{'type':Sequelize[_0x2813('0x0')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x2813('0x2c'),_0x2813('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2813('0x0')]},'usereqphone':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2813('0x0')]},'recordofffeature':{'type':Sequelize[_0x2813('0x0')]},'call_limit':{'type':Sequelize[_0x2813('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no')},'vmexten':{'type':Sequelize[_0x2813('0x0')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x2813('0x0')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2813('0x0')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x2813('0x1')](_0x2813('0x16'),'no',_0x2813('0x17'),'update',_0x2813('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2813('0x0')]},'otherFields':{'type':Sequelize[_0x2813('0x0')]},'active':{'type':Sequelize[_0x2813('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2813('0x0')],'defaultValue':'no'}}; \ No newline at end of file +var _0x5d82=['outgoing','yes','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','refuse','originate','uac','pai','fingerprint','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','update'];(function(_0x4d4122,_0x444dab){var _0x3faa15=function(_0x8c931b){while(--_0x8c931b){_0x4d4122['push'](_0x4d4122['shift']());}};_0x3faa15(++_0x444dab);}(_0x5d82,0xa8));var _0x25d8=function(_0x53212b,_0x363236){_0x53212b=_0x53212b-0x0;var _0x195ff5=_0x5d82[_0x53212b];return _0x195ff5;};'use strict';var Sequelize=require(_0x25d8('0x0'));module[_0x25d8('0x1')]={'name':{'type':Sequelize[_0x25d8('0x2')],'allowNull':![],'unique':_0x25d8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x25d8('0x4')]('friend','user',_0x25d8('0x5')),'allowNull':![],'defaultValue':_0x25d8('0x6')},'context':{'type':Sequelize[_0x25d8('0x2')],'allowNull':![],'defaultValue':_0x25d8('0x7')},'callingpres':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0x25d8('0x9'),_0x25d8('0xa'),_0x25d8('0xb'),_0x25d8('0xc'))},'deny':{'type':Sequelize[_0x25d8('0x2')]},'permit':{'type':Sequelize[_0x25d8('0x2')]},'secret':{'type':Sequelize[_0x25d8('0x2')]},'md5secret':{'type':Sequelize[_0x25d8('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':'udp','set':function(_0x291b15){this[_0x25d8('0xd')]('transport',_0x291b15?_0x291b15[_0x25d8('0xe')](','):null);},'get':function(){return this[_0x25d8('0xf')](_0x25d8('0x10'))?this[_0x25d8('0xf')](_0x25d8('0x10'))[_0x25d8('0x11')](','):null;},'comment':_0x25d8('0x12')},'dtmfmode':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x13'),_0x25d8('0x14'),_0x25d8('0x15'),_0x25d8('0x16'),'auto'),'defaultValue':_0x25d8('0x13')},'directmedia':{'type':Sequelize[_0x25d8('0x4')]('yes','no','nonat',_0x25d8('0x17'),_0x25d8('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x25d8('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x25d8('0x2')]},'directmediadeny':{'type':Sequelize[_0x25d8('0x2')]},'nat':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':_0x25d8('0x1a'),'set':function(_0x4f8699){this[_0x25d8('0xd')](_0x25d8('0x1b'),_0x4f8699?_0x4f8699[_0x25d8('0xe')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x25d8('0xf')](_0x25d8('0x1b'))[_0x25d8('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x25d8('0x2')]},'namedcallgroup':{'type':Sequelize[_0x25d8('0x2')]},'pickupgroup':{'type':Sequelize[_0x25d8('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x25d8('0x2')]},'language':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x25d8('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x25d8('0x2')],'allowNull':![],'defaultValue':_0x25d8('0x1c'),'set':function(_0x26b8df){this['setDataValue'](_0x25d8('0x1d'),_0x26b8df?_0x26b8df[_0x25d8('0xe')](';'):_0x25d8('0x1c'));},'get':function(){return this[_0x25d8('0xf')]('allow')?this[_0x25d8('0xf')](_0x25d8('0x1d'))[_0x25d8('0x11')](';'):null;},'comment':_0x25d8('0x1e')},'autoframing':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'insecure':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':_0x25d8('0x1f'),'set':function(_0x11a3dc){this[_0x25d8('0xd')](_0x25d8('0x20'),_0x11a3dc?_0x11a3dc[_0x25d8('0xe')](','):null);},'get':function(){return this[_0x25d8('0xf')](_0x25d8('0x20'))?this['getDataValue'](_0x25d8('0x20'))[_0x25d8('0x11')](','):null;},'comment':_0x25d8('0x21')},'trustrpid':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no',_0x25d8('0x22'))},'promiscredir':{'type':Sequelize[_0x25d8('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'accountcode':{'type':Sequelize[_0x25d8('0x23')](0xb)},'setvar':{'type':Sequelize[_0x25d8('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x25d8('0x24')},'amaflags':{'type':Sequelize[_0x25d8('0x2')]},'callcounter':{'type':Sequelize[_0x25d8('0x4')]('yes','no'),'defaultValue':_0x25d8('0x19')},'busylevel':{'type':Sequelize[_0x25d8('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x25d8('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x25d8('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x25d8('0x2')]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x25d8('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x25d8('0x4')]('accept',_0x25d8('0x25'),_0x25d8('0x26'))},'session_expires':{'type':Sequelize[_0x25d8('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x25d8('0x27'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x25d8('0x2')]},'regexten':{'type':Sequelize[_0x25d8('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x25d8('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x25d8('0x2')]},'defaultuser':{'type':Sequelize[_0x25d8('0x2')]},'rtptimeout':{'type':Sequelize[_0x25d8('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no',_0x25d8('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x25d8('0x2')]},'callbackextension':{'type':Sequelize[_0x25d8('0x2')]},'timert1':{'type':Sequelize[_0x25d8('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x25d8('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x25d8('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x25d8('0x2')]},'use_q850_reason':{'type':Sequelize[_0x25d8('0x2')]},'maxforwards':{'type':Sequelize[_0x25d8('0x23')](0xb)},'encryption':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'force_avp':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'icesupport':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x25d8('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x25d8('0x19'),'no',_0x25d8('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x25d8('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x25d8('0x2')]},'dtlscafile':{'type':Sequelize[_0x25d8('0x2')]},'dtlscapath':{'type':Sequelize[_0x25d8('0x2')]},'dtlssetup':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x2a'),_0x25d8('0x2b'),_0x25d8('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x25d8('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x25d8('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x25d8('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x25d8('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x25d8('0x2')]},'mohinterpret':{'type':Sequelize[_0x25d8('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x25d8('0x2')]},'host':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':_0x25d8('0x2d')},'canreinvite':{'type':Sequelize[_0x25d8('0x4')](_0x25d8('0x19'),'no','nonat',_0x25d8('0x17'),_0x25d8('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x25d8('0x2')]},'otherFields':{'type':Sequelize[_0x25d8('0x2')]},'active':{'type':Sequelize[_0x25d8('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x25d8('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index f6ffc79..5fb9854 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 _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x37f885,_0x30f6c3){var _0x4754ab=function(_0x47d2f8){while(--_0x47d2f8){_0x37f885['push'](_0x37f885['shift']());}};_0x4754ab(++_0x30f6c3);}(_0x6aa7,0x178));var _0x76aa=function(_0xa853a1,_0x12f767){_0xa853a1=_0xa853a1-0x0;var _0x15c50f=_0x6aa7[_0xa853a1];return _0x15c50f;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));}; \ No newline at end of file +var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x15aea3,_0x2c9b72){var _0x2ac4cd=function(_0x13f830){while(--_0x13f830){_0x15aea3['push'](_0x15aea3['shift']());}};_0x2ac4cd(++_0x2c9b72);}(_0x425d,0x1e0));var _0xd425=function(_0x816b95,_0x3aac55){_0x816b95=_0x816b95-0x0;var _0x3d9e41=_0x425d[_0x816b95];return _0x3d9e41;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0514cd8..d1a68ab 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 _0xfa4f=['../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment','request-promise'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfa4f,0xcd));var _0xffa4=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xfa4f[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xffa4('0x0'));var util=require(_0xffa4('0x1'));var logger=require(_0xffa4('0x2'))('api');var moment=require(_0xffa4('0x3'));var BPromise=require('bluebird');var rp=require(_0xffa4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xffa4('0x5'));var attributes=require(_0xffa4('0x6'));module['exports']=function(_0xf9d434,_0x3e8ffa){return _0xf9d434[_0xffa4('0x7')](_0xffa4('0x8'),attributes,{'tableName':_0xffa4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x984d=['bluebird','path','rimraf','exports','define','Trunk','tools_trunks','util','../../config/logger','api'];(function(_0x504ec1,_0x3581ba){var _0x10d2b5=function(_0x500d24){while(--_0x500d24){_0x504ec1['push'](_0x504ec1['shift']());}};_0x10d2b5(++_0x3581ba);}(_0x984d,0x16f));var _0xd984=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x984d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd984('0x0'));var logger=require(_0xd984('0x1'))(_0xd984('0x2'));var moment=require('moment');var BPromise=require(_0xd984('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd984('0x4'));var rimraf=require(_0xd984('0x5'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xd984('0x6')]=function(_0x45c03f,_0x1f40e1){return _0x45c03f[_0xd984('0x7')](_0xd984('0x8'),attributes,{'tableName':_0xd984('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index a67c429..ddfa4e6 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 _0x368a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetTrunk','options','raw','where','attributes','limit','include','map','model','ShowTrunk','Trunk','find','then','util','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x368a,0x86));var _0xa368=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x368a[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require(_0xa368('0x0'));var moment=require(_0xa368('0x1'));var BPromise=require('bluebird');var rs=require(_0xa368('0x2'));var fs=require('fs');var Redis=require(_0xa368('0x3'));var db=require(_0xa368('0x4'))['db'];var utils=require(_0xa368('0x5'));var logger=require('../../config/logger')(_0xa368('0x6'));var config=require(_0xa368('0x7'));var jayson=require(_0xa368('0x8'));var client=jayson[_0xa368('0x9')][_0xa368('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddcaa,_0x2b11f6,_0x52af41){return new BPromise(function(_0x20ab30,_0x223403){return client[_0xa368('0xb')](_0x3ddcaa,_0x52af41)['then'](function(_0x3d67a7){logger['info'](_0xa368('0xc'),_0x2b11f6,_0xa368('0xd'));logger[_0xa368('0xe')](_0xa368('0xf'),_0x2b11f6,_0xa368('0xd'),JSON[_0xa368('0x10')](_0x3d67a7));if(_0x3d67a7['error']){if(_0x3d67a7[_0xa368('0x11')]['code']===0x1f4){logger[_0xa368('0x11')](_0xa368('0xc'),_0x2b11f6,_0x3d67a7['error'][_0xa368('0x12')]);return _0x223403(_0x3d67a7[_0xa368('0x11')][_0xa368('0x12')]);}logger[_0xa368('0x11')]('Trunk,\x20%s,\x20%s',_0x2b11f6,_0x3d67a7[_0xa368('0x11')][_0xa368('0x12')]);return _0x20ab30(_0x3d67a7[_0xa368('0x11')][_0xa368('0x12')]);}else{logger[_0xa368('0x13')]('Trunk,\x20%s,\x20%s',_0x2b11f6,_0xa368('0xd'));_0x20ab30(_0x3d67a7['result'][_0xa368('0x12')]);}})[_0xa368('0x14')](function(_0x4dcb07){logger[_0xa368('0x11')](_0xa368('0xc'),_0x2b11f6,_0x4dcb07);_0x223403(_0x4dcb07);});});}exports[_0xa368('0x15')]=function(_0x1c0a91){var _0x1b84a1=this;return new Promise(function(_0x1ff9a8,_0x5c9ead){return db['Trunk']['findAll']({'raw':_0x1c0a91[_0xa368('0x16')]?_0x1c0a91[_0xa368('0x16')][_0xa368('0x17')]===undefined?!![]:![]:!![],'where':_0x1c0a91[_0xa368('0x16')]?_0x1c0a91[_0xa368('0x16')][_0xa368('0x18')]||null:null,'attributes':_0x1c0a91[_0xa368('0x16')]?_0x1c0a91[_0xa368('0x16')][_0xa368('0x19')]||null:null,'limit':_0x1c0a91[_0xa368('0x16')]?_0x1c0a91['options'][_0xa368('0x1a')]||null:null,'include':_0x1c0a91[_0xa368('0x16')]?_0x1c0a91['options'][_0xa368('0x1b')]?_[_0xa368('0x1c')](_0x1c0a91['options'][_0xa368('0x1b')],function(_0x1862e9){return{'model':db[_0x1862e9[_0xa368('0x1d')]],'as':_0x1862e9['as'],'attributes':_0x1862e9[_0xa368('0x19')],'include':_0x1862e9[_0xa368('0x1b')]?_[_0xa368('0x1c')](_0x1862e9[_0xa368('0x1b')],function(_0x159743){return{'model':db[_0x159743['model']],'as':_0x159743['as'],'attributes':_0x159743[_0xa368('0x19')],'include':_0x159743['include']?_[_0xa368('0x1c')](_0x159743[_0xa368('0x1b')],function(_0x57c662){return{'model':db[_0x57c662['model']],'as':_0x57c662['as'],'attributes':_0x57c662[_0xa368('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x137eff){logger[_0xa368('0x13')](_0xa368('0x15'),_0x1c0a91);logger[_0xa368('0xe')](_0xa368('0x15'),_0x1c0a91,JSON[_0xa368('0x10')](_0x137eff));_0x1ff9a8(_0x137eff);})[_0xa368('0x14')](function(_0x4fff63){logger[_0xa368('0x11')](_0xa368('0x15'),_0x4fff63[_0xa368('0x12')],_0x1c0a91);_0x5c9ead(_0x1b84a1[_0xa368('0x11')](0x1f4,_0x4fff63[_0xa368('0x12')]));});});};exports[_0xa368('0x1e')]=function(_0x471db1){var _0xb83949=this;return new Promise(function(_0x281ae7,_0xe69655){return db[_0xa368('0x1f')][_0xa368('0x20')]({'raw':_0x471db1['options']?_0x471db1[_0xa368('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x471db1[_0xa368('0x16')]?_0x471db1['options'][_0xa368('0x18')]||null:null,'attributes':_0x471db1[_0xa368('0x16')]?_0x471db1[_0xa368('0x16')][_0xa368('0x19')]||null:null,'include':_0x471db1['options']?_0x471db1[_0xa368('0x16')][_0xa368('0x1b')]?_['map'](_0x471db1[_0xa368('0x16')]['include'],function(_0x442fb4){return{'model':db[_0x442fb4[_0xa368('0x1d')]],'as':_0x442fb4['as'],'attributes':_0x442fb4[_0xa368('0x19')],'include':_0x442fb4[_0xa368('0x1b')]?_['map'](_0x442fb4['include'],function(_0x572bc2){return{'model':db[_0x572bc2[_0xa368('0x1d')]],'as':_0x572bc2['as'],'attributes':_0x572bc2[_0xa368('0x19')],'include':_0x572bc2['include']?_[_0xa368('0x1c')](_0x572bc2['include'],function(_0x2e0348){return{'model':db[_0x2e0348[_0xa368('0x1d')]],'as':_0x2e0348['as'],'attributes':_0x2e0348[_0xa368('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa368('0x21')](function(_0x25318b){logger[_0xa368('0x13')](_0xa368('0x1e'),_0x471db1);logger[_0xa368('0xe')]('ShowTrunk',_0x471db1,JSON['stringify'](_0x25318b));_0x281ae7(_0x25318b);})[_0xa368('0x14')](function(_0x10be00){logger['error'](_0xa368('0x1e'),_0x10be00['message'],_0x471db1);_0xe69655(_0xb83949['error'](0x1f4,_0x10be00[_0xa368('0x12')]));});});}; \ No newline at end of file +var _0x21f6=['GetTrunk','Trunk','findAll','options','raw','attributes','limit','map','model','include','catch','ShowTrunk','find','where','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x21f6,0x162));var _0x621f=function(_0x4ce78d,_0x4bfecc){_0x4ce78d=_0x4ce78d-0x0;var _0x59784b=_0x21f6[_0x4ce78d];return _0x59784b;};'use strict';var _=require(_0x621f('0x0'));var util=require(_0x621f('0x1'));var moment=require(_0x621f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x621f('0x3'));var db=require(_0x621f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x621f('0x5'));var config=require(_0x621f('0x6'));var jayson=require(_0x621f('0x7'));var client=jayson[_0x621f('0x8')][_0x621f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11d108,_0x5bff15,_0x513301){return new BPromise(function(_0x1c0710,_0x215bdc){return client[_0x621f('0xa')](_0x11d108,_0x513301)[_0x621f('0xb')](function(_0x46a66b){logger[_0x621f('0xc')](_0x621f('0xd'),_0x5bff15,_0x621f('0xe'));logger[_0x621f('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5bff15,_0x621f('0xe'),JSON[_0x621f('0x10')](_0x46a66b));if(_0x46a66b[_0x621f('0x11')]){if(_0x46a66b[_0x621f('0x11')][_0x621f('0x12')]===0x1f4){logger[_0x621f('0x11')](_0x621f('0xd'),_0x5bff15,_0x46a66b[_0x621f('0x11')][_0x621f('0x13')]);return _0x215bdc(_0x46a66b['error']['message']);}logger['error'](_0x621f('0xd'),_0x5bff15,_0x46a66b['error'][_0x621f('0x13')]);return _0x1c0710(_0x46a66b[_0x621f('0x11')][_0x621f('0x13')]);}else{logger[_0x621f('0xc')](_0x621f('0xd'),_0x5bff15,_0x621f('0xe'));_0x1c0710(_0x46a66b['result'][_0x621f('0x13')]);}})['catch'](function(_0x5889bb){logger['error']('Trunk,\x20%s,\x20%s',_0x5bff15,_0x5889bb);_0x215bdc(_0x5889bb);});});}exports[_0x621f('0x14')]=function(_0x2b521a){var _0x38d0d3=this;return new Promise(function(_0x46d55b,_0x3bf8b6){return db[_0x621f('0x15')][_0x621f('0x16')]({'raw':_0x2b521a[_0x621f('0x17')]?_0x2b521a[_0x621f('0x17')][_0x621f('0x18')]===undefined?!![]:![]:!![],'where':_0x2b521a[_0x621f('0x17')]?_0x2b521a['options']['where']||null:null,'attributes':_0x2b521a[_0x621f('0x17')]?_0x2b521a[_0x621f('0x17')][_0x621f('0x19')]||null:null,'limit':_0x2b521a[_0x621f('0x17')]?_0x2b521a[_0x621f('0x17')][_0x621f('0x1a')]||null:null,'include':_0x2b521a[_0x621f('0x17')]?_0x2b521a[_0x621f('0x17')]['include']?_[_0x621f('0x1b')](_0x2b521a['options']['include'],function(_0x1a8cd0){return{'model':db[_0x1a8cd0[_0x621f('0x1c')]],'as':_0x1a8cd0['as'],'attributes':_0x1a8cd0[_0x621f('0x19')],'include':_0x1a8cd0[_0x621f('0x1d')]?_[_0x621f('0x1b')](_0x1a8cd0[_0x621f('0x1d')],function(_0x4214fb){return{'model':db[_0x4214fb[_0x621f('0x1c')]],'as':_0x4214fb['as'],'attributes':_0x4214fb['attributes'],'include':_0x4214fb[_0x621f('0x1d')]?_[_0x621f('0x1b')](_0x4214fb[_0x621f('0x1d')],function(_0x14e4d9){return{'model':db[_0x14e4d9[_0x621f('0x1c')]],'as':_0x14e4d9['as'],'attributes':_0x14e4d9[_0x621f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x621f('0xb')](function(_0x327eb6){logger['info'](_0x621f('0x14'),_0x2b521a);logger[_0x621f('0xf')](_0x621f('0x14'),_0x2b521a,JSON[_0x621f('0x10')](_0x327eb6));_0x46d55b(_0x327eb6);})[_0x621f('0x1e')](function(_0x215f66){logger['error'](_0x621f('0x14'),_0x215f66['message'],_0x2b521a);_0x3bf8b6(_0x38d0d3['error'](0x1f4,_0x215f66['message']));});});};exports[_0x621f('0x1f')]=function(_0x458ebb){var _0x5d909e=this;return new Promise(function(_0x55521e,_0x5e9845){return db[_0x621f('0x15')][_0x621f('0x20')]({'raw':_0x458ebb['options']?_0x458ebb['options'][_0x621f('0x18')]===undefined?!![]:![]:!![],'where':_0x458ebb[_0x621f('0x17')]?_0x458ebb['options'][_0x621f('0x21')]||null:null,'attributes':_0x458ebb[_0x621f('0x17')]?_0x458ebb[_0x621f('0x17')][_0x621f('0x19')]||null:null,'include':_0x458ebb[_0x621f('0x17')]?_0x458ebb[_0x621f('0x17')]['include']?_[_0x621f('0x1b')](_0x458ebb[_0x621f('0x17')][_0x621f('0x1d')],function(_0x143e19){return{'model':db[_0x143e19[_0x621f('0x1c')]],'as':_0x143e19['as'],'attributes':_0x143e19[_0x621f('0x19')],'include':_0x143e19[_0x621f('0x1d')]?_[_0x621f('0x1b')](_0x143e19[_0x621f('0x1d')],function(_0x1880a7){return{'model':db[_0x1880a7[_0x621f('0x1c')]],'as':_0x1880a7['as'],'attributes':_0x1880a7['attributes'],'include':_0x1880a7[_0x621f('0x1d')]?_[_0x621f('0x1b')](_0x1880a7[_0x621f('0x1d')],function(_0xd01e46){return{'model':db[_0xd01e46[_0x621f('0x1c')]],'as':_0xd01e46['as'],'attributes':_0xd01e46[_0x621f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x621f('0xb')](function(_0x28045e){logger[_0x621f('0xc')]('ShowTrunk',_0x458ebb);logger[_0x621f('0xf')](_0x621f('0x1f'),_0x458ebb,JSON[_0x621f('0x10')](_0x28045e));_0x55521e(_0x28045e);})[_0x621f('0x1e')](function(_0x552b74){logger[_0x621f('0x11')](_0x621f('0x1f'),_0x552b74[_0x621f('0x13')],_0x458ebb);_0x5e9845(_0x5d909e[_0x621f('0x11')](0x1f4,_0x552b74[_0x621f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index dcd0730..9b5aa48 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 _0xa37f=['addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','file','addAvatar','login','/:id/logout','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','/:id/openchannel_accounts'];(function(_0xcd8ad5,_0x2b0cc4){var _0x530c03=function(_0x32c589){while(--_0x32c589){_0xcd8ad5['push'](_0xcd8ad5['shift']());}};_0x530c03(++_0x2b0cc4);}(_0xa37f,0x1d2));var _0xfa37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa37f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfa37('0x0'));var util=require(_0xfa37('0x1'));var path=require('path');var timeout=require(_0xfa37('0x2'));var express=require(_0xfa37('0x3'));var router=express['Router']();var fs_extra=require(_0xfa37('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfa37('0x5'));var config=require(_0xfa37('0x6'));var controller=require(_0xfa37('0x7'));router[_0xfa37('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa37('0x9')]);router['get'](_0xfa37('0xa'),auth[_0xfa37('0xb')](),controller['describe']);router[_0xfa37('0x8')](_0xfa37('0xc'),auth[_0xfa37('0xb')](),controller[_0xfa37('0xd')]);router['get'](_0xfa37('0xe'),auth[_0xfa37('0xb')](),controller[_0xfa37('0xf')]);router[_0xfa37('0x8')](_0xfa37('0x10'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x11')]);router[_0xfa37('0x8')](_0xfa37('0x12'),controller[_0xfa37('0x13')]);router['get']('/:id/open_tabs',auth[_0xfa37('0xb')](),controller[_0xfa37('0x14')]);router[_0xfa37('0x8')](_0xfa37('0x15'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x16')]);router[_0xfa37('0x8')](_0xfa37('0x17'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x18')]);router[_0xfa37('0x8')](_0xfa37('0x19'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x1a')]);router[_0xfa37('0x8')]('/:id/groups',auth[_0xfa37('0xb')](),controller[_0xfa37('0x1b')]);router[_0xfa37('0x8')](_0xfa37('0x1c'),auth['isAuthenticated'](),controller[_0xfa37('0x1d')]);router[_0xfa37('0x8')](_0xfa37('0x1e'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xfa37('0x8')](_0xfa37('0x1f'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x20')]);router[_0xfa37('0x8')](_0xfa37('0x21'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x22')]);router[_0xfa37('0x8')](_0xfa37('0x23'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x24')]);router[_0xfa37('0x8')](_0xfa37('0x25'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x26')]);router[_0xfa37('0x8')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router['get'](_0xfa37('0x27'),auth[_0xfa37('0xb')](),controller['getWhatsappInteractions']);router[_0xfa37('0x8')](_0xfa37('0x28'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x29')]);router[_0xfa37('0x8')](_0xfa37('0x2a'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x2b')]);router['get'](_0xfa37('0x2c'),auth[_0xfa37('0xb')](),controller['getAgents']);router[_0xfa37('0x8')](_0xfa37('0x2d'),auth[_0xfa37('0xb')](),controller['getVoicePrefixes']);router[_0xfa37('0x8')](_0xfa37('0x2e'),auth['isAuthenticated'](),controller[_0xfa37('0x2f')]);router[_0xfa37('0x8')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xfa37('0x30')]);router['get']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xfa37('0x31')]);router[_0xfa37('0x8')]('/:id/sms_accounts',auth[_0xfa37('0xb')](),controller[_0xfa37('0x32')]);router[_0xfa37('0x8')](_0xfa37('0x33'),auth[_0xfa37('0xb')](),controller['getChatWebsites']);router['get'](_0xfa37('0x34'),auth[_0xfa37('0xb')](),controller['getWhatsappAccounts']);router['get'](_0xfa37('0x35'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x36')]);router['get']('/:id/scheduled_calls',auth[_0xfa37('0xb')](),controller[_0xfa37('0x37')]);router[_0xfa37('0x8')](_0xfa37('0x38'),auth['isAuthenticated'](),controller[_0xfa37('0x39')]);router['post'](_0xfa37('0x15'),auth['isAuthenticated'](),controller[_0xfa37('0x3a')]);router[_0xfa37('0x3b')]('/',auth['isAuthenticated'](),controller[_0xfa37('0x3c')]);router[_0xfa37('0x3b')](_0xfa37('0x3d'),auth[_0xfa37('0xb')](),controller['bulkCreate']);router[_0xfa37('0x3b')]('/:id/queues',auth[_0xfa37('0xb')](),controller[_0xfa37('0x3e')]);var upload=multer({'storage':multer[_0xfa37('0x3f')]({'destination':function(_0x471363,_0x2af789,_0x129a60){_0x129a60(null,path[_0xfa37('0x40')](config[_0xfa37('0x41')],_0xfa37('0x42')));},'filename':function(_0x5aac17,_0x961e12,_0x3f93c5){_0x3f93c5(null,util[_0xfa37('0x43')](_0xfa37('0x44'),Date['now'](),_0x961e12[_0xfa37('0x45')]));}})});router[_0xfa37('0x3b')](_0xfa37('0x12'),upload['single'](_0xfa37('0x46')),controller[_0xfa37('0x47')]);router[_0xfa37('0x3b')]('/:id/login',auth[_0xfa37('0xb')](),controller[_0xfa37('0x48')]);router[_0xfa37('0x3b')](_0xfa37('0x49'),auth[_0xfa37('0xb')](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0xfa37('0x4a')]);router[_0xfa37('0x3b')]('/:id/unpause',auth['isAuthenticated'](),controller[_0xfa37('0x4b')]);router[_0xfa37('0x3b')](_0xfa37('0x28'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x4c')]);router['post'](_0xfa37('0x4d'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x4e')]);router[_0xfa37('0x3b')]('/:id/mail_interactions',auth[_0xfa37('0xb')](),controller['addMailInteractions']);router[_0xfa37('0x3b')](_0xfa37('0x4f'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x50')]);router['post'](_0xfa37('0x51'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x52')]);router[_0xfa37('0x3b')](_0xfa37('0x53'),auth[_0xfa37('0xb')](),controller['addOpenchannelInteractions']);router['post']('/:id/whatsapp_interactions',auth[_0xfa37('0xb')](),controller[_0xfa37('0x54')]);router[_0xfa37('0x3b')](_0xfa37('0x2e'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x55')]);router[_0xfa37('0x3b')](_0xfa37('0x56'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x57')]);router['post'](_0xfa37('0x58'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x59')]);router['post'](_0xfa37('0x5a'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0xfa37('0x3b')](_0xfa37('0x33'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x5b')]);router['post'](_0xfa37('0x34'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x5c')]);router[_0xfa37('0x3b')]('/:id/square_projects',auth[_0xfa37('0xb')](),controller[_0xfa37('0x5d')]);router[_0xfa37('0x3b')](_0xfa37('0x38'),auth[_0xfa37('0xb')](),controller['createApiKey']);router[_0xfa37('0x5e')](_0xfa37('0x10'),auth[_0xfa37('0xb')](),controller['update']);router['put'](_0xfa37('0x5f'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x60')]);router[_0xfa37('0x61')](_0xfa37('0x17'),auth[_0xfa37('0xb')](),controller['removeQueues']);router[_0xfa37('0x61')]('/:id/teams',auth[_0xfa37('0xb')](),controller[_0xfa37('0x62')]);router[_0xfa37('0x61')](_0xfa37('0x10'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x63')]);router[_0xfa37('0x61')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xfa37('0x64')]);router[_0xfa37('0x61')](_0xfa37('0x65'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x66')]);router[_0xfa37('0x61')](_0xfa37('0x4f'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x67')]);router[_0xfa37('0x61')](_0xfa37('0x51'),auth[_0xfa37('0xb')](),controller['removeSmsInteractions']);router[_0xfa37('0x61')](_0xfa37('0x53'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x68')]);router['delete'](_0xfa37('0x69'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0xfa37('0x61')](_0xfa37('0x2e'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router['delete'](_0xfa37('0x56'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x6a')]);router[_0xfa37('0x61')]('/:id/openchannel_accounts',auth[_0xfa37('0xb')](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth[_0xfa37('0xb')](),controller[_0xfa37('0x6b')]);router[_0xfa37('0x61')](_0xfa37('0x33'),auth[_0xfa37('0xb')](),controller[_0xfa37('0x6c')]);router['delete']('/:id/whatsapp_accounts',auth[_0xfa37('0xb')](),controller[_0xfa37('0x6d')]);router[_0xfa37('0x61')](_0xfa37('0x35'),auth['isAuthenticated'](),controller[_0xfa37('0x6e')]);router[_0xfa37('0x61')](_0xfa37('0x38'),auth['isAuthenticated'](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0xb6ae=['originalname','single','addAvatar','login','/:id/logout','logout','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s'];(function(_0x424bd3,_0x8760d8){var _0x1fdade=function(_0x510862){while(--_0x510862){_0x424bd3['push'](_0x424bd3['shift']());}};_0x1fdade(++_0x8760d8);}(_0xb6ae,0xa0));var _0xeb6a=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0xb6ae[_0x16dbcd];return _0x34706e;};'use strict';var multer=require('multer');var util=require(_0xeb6a('0x0'));var path=require('path');var timeout=require(_0xeb6a('0x1'));var express=require('express');var router=express[_0xeb6a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xeb6a('0x3'));var interaction=require(_0xeb6a('0x4'));var config=require(_0xeb6a('0x5'));var controller=require('./user.controller');router[_0xeb6a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb6a('0x6')](_0xeb6a('0x7'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x9')]);router['get'](_0xeb6a('0xa'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0xb')]);router['get']('/presence',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0xc')]);router[_0xeb6a('0x6')](_0xeb6a('0xd'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0xe')]);router[_0xeb6a('0x6')](_0xeb6a('0xf'),controller['getAvatar']);router['get']('/:id/open_tabs',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x10')]);router[_0xeb6a('0x6')](_0xeb6a('0x11'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x12')]);router[_0xeb6a('0x6')](_0xeb6a('0x13'),auth[_0xeb6a('0x8')](),controller['getQueues']);router[_0xeb6a('0x6')](_0xeb6a('0x14'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x15')]);router['get'](_0xeb6a('0x16'),auth['isAuthenticated'](),controller['getGroups']);router[_0xeb6a('0x6')](_0xeb6a('0x17'),auth['isAuthenticated'](),controller[_0xeb6a('0x18')]);router['get'](_0xeb6a('0x19'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x1a')]);router[_0xeb6a('0x6')](_0xeb6a('0x1b'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0xeb6a('0x6')](_0xeb6a('0x1c'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x1d')]);router[_0xeb6a('0x6')](_0xeb6a('0x1e'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x1f')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0xeb6a('0x20')]);router[_0xeb6a('0x6')](_0xeb6a('0x21'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x22')]);router[_0xeb6a('0x6')](_0xeb6a('0x23'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x24')]);router[_0xeb6a('0x6')](_0xeb6a('0x25'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x26')]);router['get'](_0xeb6a('0x27'),auth[_0xeb6a('0x8')](),controller['getLists']);router[_0xeb6a('0x6')](_0xeb6a('0x28'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x29')]);router[_0xeb6a('0x6')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0xeb6a('0x2a')]);router['get'](_0xeb6a('0x2b'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x2c')]);router[_0xeb6a('0x6')](_0xeb6a('0x2d'),auth['isAuthenticated'](),controller[_0xeb6a('0x2e')]);router[_0xeb6a('0x6')](_0xeb6a('0x2f'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x30')]);router['get'](_0xeb6a('0x31'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0xeb6a('0x6')](_0xeb6a('0x32'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x33')]);router['get']('/:id/whatsapp_accounts',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x34')]);router['get']('/:id/square_projects',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x35')]);router['get'](_0xeb6a('0x36'),auth['isAuthenticated'](),controller[_0xeb6a('0x37')]);router[_0xeb6a('0x6')]('/:id/api_key',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x38')]);router['post'](_0xeb6a('0x11'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x39')]);router[_0xeb6a('0x3a')]('/',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x3b')]);router[_0xeb6a('0x3a')](_0xeb6a('0x3c'),auth['isAuthenticated'](),controller[_0xeb6a('0x3d')]);router[_0xeb6a('0x3a')](_0xeb6a('0x13'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x3e')]);var upload=multer({'storage':multer[_0xeb6a('0x3f')]({'destination':function(_0x1ce218,_0xf99dfc,_0xa4f2b0){_0xa4f2b0(null,path[_0xeb6a('0x40')](config[_0xeb6a('0x41')],_0xeb6a('0x42')));},'filename':function(_0x58d85a,_0x19c04d,_0x137fe1){_0x137fe1(null,util['format'](_0xeb6a('0x43'),Date['now'](),_0x19c04d[_0xeb6a('0x44')]));}})});router['post'](_0xeb6a('0xf'),upload[_0xeb6a('0x45')]('file'),controller[_0xeb6a('0x46')]);router['post']('/:id/login',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x47')]);router['post'](_0xeb6a('0x48'),auth['isAuthenticated'](),controller[_0xeb6a('0x49')]);router[_0xeb6a('0x3a')]('/:id/pause',auth[_0xeb6a('0x8')](),controller['pause']);router['post']('/:id/unpause',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x4a')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xeb6a('0x4b')]);router['post'](_0xeb6a('0x4c'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x4d')]);router[_0xeb6a('0x3a')](_0xeb6a('0x4e'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x4f')]);router['post'](_0xeb6a('0x50'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x51')]);router[_0xeb6a('0x3a')](_0xeb6a('0x52'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x53')]);router[_0xeb6a('0x3a')]('/:id/openchannel_interactions',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x54')]);router[_0xeb6a('0x3a')](_0xeb6a('0x55'),auth['isAuthenticated'](),controller[_0xeb6a('0x56')]);router[_0xeb6a('0x3a')]('/:id/fax_accounts',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x57')]);router['post'](_0xeb6a('0x2d'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x58')]);router['post']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xeb6a('0x59')]);router[_0xeb6a('0x3a')](_0xeb6a('0x31'),auth[_0xeb6a('0x8')](),controller['addSmsAccounts']);router[_0xeb6a('0x3a')](_0xeb6a('0x32'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x5a')]);router[_0xeb6a('0x3a')]('/:id/whatsapp_accounts',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x5b')]);router[_0xeb6a('0x3a')](_0xeb6a('0x5c'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x5d')]);router[_0xeb6a('0x3a')](_0xeb6a('0x5e'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x5f')]);router[_0xeb6a('0x60')](_0xeb6a('0xd'),auth[_0xeb6a('0x8')](),controller['update']);router[_0xeb6a('0x60')](_0xeb6a('0x61'),auth['isAuthenticated'](),controller['changePassword']);router[_0xeb6a('0x62')]('/:id/queues',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x63')]);router['delete'](_0xeb6a('0x25'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x64')]);router[_0xeb6a('0x62')](_0xeb6a('0xd'),auth[_0xeb6a('0x8')](),controller['destroy']);router['delete'](_0xeb6a('0x4c'),auth['isAuthenticated'](),controller[_0xeb6a('0x65')]);router['delete'](_0xeb6a('0x4e'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x66')]);router[_0xeb6a('0x62')](_0xeb6a('0x50'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x67')]);router[_0xeb6a('0x62')](_0xeb6a('0x52'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x68')]);router[_0xeb6a('0x62')](_0xeb6a('0x69'),auth[_0xeb6a('0x8')](),controller['removeOpenchannelInteractions']);router[_0xeb6a('0x62')](_0xeb6a('0x55'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x6a')]);router[_0xeb6a('0x62')](_0xeb6a('0x2b'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x6b')]);router[_0xeb6a('0x62')](_0xeb6a('0x2d'),auth[_0xeb6a('0x8')](),controller['removeMailAccounts']);router[_0xeb6a('0x62')]('/:id/openchannel_accounts',auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x6c')]);router[_0xeb6a('0x62')](_0xeb6a('0x31'),auth[_0xeb6a('0x8')](),controller[_0xeb6a('0x6d')]);router[_0xeb6a('0x62')](_0xeb6a('0x32'),auth['isAuthenticated'](),controller[_0xeb6a('0x6e')]);router[_0xeb6a('0x62')](_0xeb6a('0x6f'),auth['isAuthenticated'](),controller[_0xeb6a('0x70')]);router['delete'](_0xeb6a('0x5c'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0xeb6a('0x62')]('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module[_0xeb6a('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a0dbb14..73025ed 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 _0x5089=['phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','defaultuser','The\x20name\x20of\x20the\x20user','setDataValue','fullname','callerid','format','getDataValue','email','ENUM','user','agent','local','INTEGER','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','originate','uas','fingerprint','certificate','passive','actpass','nonat','update,nonat','TEXT','get','isArray','udp','encryption','avpf','icesupport','dtlsprivatekey','wss','force_avp','dtlsenable','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map'];(function(_0x379e71,_0xf26ebd){var _0x147f59=function(_0x58aa53){while(--_0x58aa53){_0x379e71['push'](_0x379e71['shift']());}};_0x147f59(++_0xf26ebd);}(_0x5089,0x1bb));var _0x9508=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x5089[_0x4d7116];return _0x4593dc;};'use strict';var Sequelize=require(_0x9508('0x0'));var moment=require(_0x9508('0x1'));var util=require('util');var _=require(_0x9508('0x2'));module[_0x9508('0x3')]={'name':{'type':Sequelize[_0x9508('0x4')],'allowNull':![],'unique':_0x9508('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x172549){this['setDataValue'](_0x9508('0x5'),_0x172549);this['setDataValue'](_0x9508('0x6'),_0x172549);},'comment':_0x9508('0x7')},'fullname':{'type':Sequelize[_0x9508('0x4')],'allowNull':![],'set':function(_0x4ab3c6){this[_0x9508('0x8')](_0x9508('0x9'),_0x4ab3c6);this['setDataValue'](_0x9508('0xa'),util[_0x9508('0xb')]('\x22%s\x22\x20<%s>',_0x4ab3c6,this[_0x9508('0xc')]('internal')));}},'alias':{'type':Sequelize[_0x9508('0x4')]},'email':{'type':Sequelize[_0x9508('0x4')],'allowNull':![],'unique':_0x9508('0xd'),'validate':{'isEmail':!![]},'set':function(_0x21f8c1){if(_0x21f8c1){this[_0x9508('0x8')](_0x9508('0xd'),_0x21f8c1['toLowerCase']());}}},'role':{'type':Sequelize[_0x9508('0xe')]('admin',_0x9508('0xf'),_0x9508('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x9508('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9508('0x4')],'defaultValue':_0x9508('0x11')},'internal':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x440709){this[_0x9508('0x8')]('internal',_0x440709);this[_0x9508('0x8')]('accountcode',_0x440709);this[_0x9508('0x8')](_0x9508('0xa'),util[_0x9508('0xb')](_0x9508('0x13'),this[_0x9508('0xc')](_0x9508('0x9')),_0x440709));}},'salt':{'type':Sequelize[_0x9508('0x4')]},'phone':{'type':Sequelize[_0x9508('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x9508('0x4')]},'zipcode':{'type':Sequelize[_0x9508('0x4')]},'userpic':{'type':Sequelize[_0x9508('0x4')]},'city':{'type':Sequelize[_0x9508('0x4')]},'country':{'type':Sequelize[_0x9508('0x4')]},'online':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9508('0x4')],'defaultValue':_0x9508('0x15')},'lastPauseAt':{'type':Sequelize[_0x9508('0x16')]},'chatCapacity':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9508('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9508('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9508('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9508('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x17'),_0x9508('0xf'),_0x9508('0x18')),'allowNull':!![],'defaultValue':_0x9508('0x17')},'context':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![],'defaultValue':_0x9508('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x9508('0x1a'),_0x9508('0x1b'),_0x9508('0x1c'),'ALLOWED',_0x9508('0x1d'),_0x9508('0x1e'),'PROHIB_FAILED_SCREEN',_0x9508('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x52a715){this[_0x9508('0x8')](_0x9508('0x20'),_0x52a715?_0x52a715[_0x9508('0x21')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x9508('0xc')](_0x9508('0x20'))[_0x9508('0x22')](','):null;},'comment':_0x9508('0x23')},'dtmfmode':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x24'),_0x9508('0x25'),_0x9508('0x26'),_0x9508('0x27'),_0x9508('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no','nonat',_0x9508('0x2a'),_0x9508('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![],'defaultValue':_0x9508('0x2c'),'set':function(_0xfb6676){this[_0x9508('0x8')](_0x9508('0x2d'),_0xfb6676?_0xfb6676['join'](','):null);},'get':function(){return this[_0x9508('0xc')]('nat')?this[_0x9508('0xc')](_0x9508('0x2d'))[_0x9508('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9508('0x4')]},'pickupgroup':{'type':Sequelize[_0x9508('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x9508('0x4')]},'language':{'type':Sequelize[_0x9508('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x9508('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x9508('0x4')],'allowNull':![],'defaultValue':_0x9508('0x2e'),'set':function(_0x5205f8){this[_0x9508('0x8')](_0x9508('0x2f'),_0x5205f8?_0x5205f8['join'](';'):_0x9508('0x2e'));},'get':function(){return this[_0x9508('0xc')](_0x9508('0x2f'))?this[_0x9508('0xc')]('allow')['split'](';'):null;},'comment':_0x9508('0x30')},'autoframing':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![],'set':function(_0x10e8f5){this[_0x9508('0x8')]('insecure',_0x10e8f5?_0x10e8f5['join'](','):null);},'get':function(){return this['getDataValue'](_0x9508('0x31'))?this['getDataValue'](_0x9508('0x31'))['split'](','):null;},'comment':_0x9508('0x32')},'trustrpid':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9508('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no',_0x9508('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9508('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![],'defaultValue':_0x9508('0x29')},'busylevel':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9508('0xe')]('yes','no',_0x9508('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x35'),'refuse',_0x9508('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9508('0xe')]('uac',_0x9508('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![],'defaultValue':_0x9508('0x29')},'keepalive':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9508('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no',_0x9508('0x38'),_0x9508('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9508('0xe')]('active',_0x9508('0x3a'),_0x9508('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9508('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9508('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9508('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9508('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9508('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9508('0xe')](_0x9508('0x29'),'no',_0x9508('0x3c'),_0x9508('0x2a'),_0x9508('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x9508('0x16')]},'passwordResetAt':{'type':Sequelize[_0x9508('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9508('0x3e')]},'showWebBar':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0,'set':function(_0x5bab99){this[_0x9508('0x8')]('showWebBar',_0x5bab99);var _0x314a07=this[_0x9508('0x3f')]({'plain':!![]});switch(_0x5bab99){case 0x0:case 0x1:var _0x4a6c43=_0x314a07[_0x9508('0x20')]?_[_0x9508('0x40')](_0x314a07['transport'])?_0x314a07[_0x9508('0x20')][_0x9508('0x21')]():_0x314a07[_0x9508('0x20')]:_0x9508('0x41');if(_0x4a6c43==='wss'){_0x4a6c43=_0x9508('0x41');}this[_0x9508('0x8')](_0x9508('0x20'),_0x4a6c43);this[_0x9508('0x8')](_0x9508('0x42'),'no');this[_0x9508('0x8')](_0x9508('0x43'),null);this[_0x9508('0x8')]('force_avp',null);this[_0x9508('0x8')](_0x9508('0x44'),null);this[_0x9508('0x8')]('dtlsenable',null);this[_0x9508('0x8')]('dtlsverify',null);this[_0x9508('0x8')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9508('0x8')](_0x9508('0x45'),null);this[_0x9508('0x8')]('rtcp_mux','no');break;case 0x2:this[_0x9508('0x8')](_0x9508('0x20'),_0x9508('0x46'));this[_0x9508('0x8')](_0x9508('0x42'),'yes');this['setDataValue'](_0x9508('0x43'),_0x9508('0x29'));this[_0x9508('0x8')](_0x9508('0x47'),_0x9508('0x29'));this[_0x9508('0x8')](_0x9508('0x44'),_0x9508('0x29'));this[_0x9508('0x8')](_0x9508('0x48'),_0x9508('0x29'));this[_0x9508('0x8')]('dtlsverify','no');this['setDataValue'](_0x9508('0x49'),'actpass');this[_0x9508('0x8')]('dtlscertfile',_0x314a07['dtlscertfile']||_0x9508('0x4a'));this['setDataValue']('dtlsprivatekey',_0x314a07[_0x9508('0x45')]||_0x9508('0x4b'));this[_0x9508('0x8')](_0x9508('0x4c'),_0x9508('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x9508('0x3e')],'set':function(_0x222e63){this[_0x9508('0x8')](_0x9508('0x4d'),_0x222e63?_0x222e63[_0x9508('0x21')](','):[]);},'get':function(){return this[_0x9508('0xc')](_0x9508('0x4d'))?_[_0x9508('0x4e')](this[_0x9508('0xc')](_0x9508('0x4d'))['split'](','),function(_0x2dc584){return parseInt(_0x2dc584,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9508('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9508('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9508('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9508('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9508('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9508('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9508('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9508('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9508('0xc')](_0x9508('0x4f'))?this[_0x9508('0xc')](_0x9508('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![],'set':function(_0x5b576a){if(typeof _0x5b576a===_0x9508('0x50')){var _0x68c1f5=_0x5b576a==='1'?!![]:_0x5b576a==='0'?![]:_0x5b576a==='true'?!![]:_0x5b576a===_0x9508('0x51')?![]:![];this['setDataValue'](_0x9508('0x52'),_0x68c1f5);}else{this['setDataValue'](_0x9508('0x52'),_0x5b576a);}}},'blocked':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![],'set':function(_0x29471f){this[_0x9508('0x8')](_0x9508('0x53'),_0x29471f);if(_0x29471f===!![]){this[_0x9508('0x8')](_0x9508('0x54'),moment());this[_0x9508('0x8')](_0x9508('0x55'),0x0);}else{this[_0x9508('0x8')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x9508('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9508('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9508('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9508('0x12')](0x5)[_0x9508('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9508('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9508('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0x2bbb=['outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uas','fingerprint','passive','actpass','update,nonat','DATE','isArray','encryption','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','icesupport','/etc/pki/tls/certs/motion.crt','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat'];(function(_0x45a079,_0x2ff4fc){var _0xbe5d70=function(_0xd025c2){while(--_0xd025c2){_0x45a079['push'](_0x45a079['shift']());}};_0xbe5d70(++_0x2ff4fc);}(_0x2bbb,0x85));var _0xb2bb=function(_0x46efed,_0x4145be){_0x46efed=_0x46efed-0x0;var _0x12e713=_0x2bbb[_0x46efed];return _0x12e713;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb2bb('0x0'));var util=require(_0xb2bb('0x1'));var _=require(_0xb2bb('0x2'));module['exports']={'name':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':![],'unique':_0xb2bb('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x14da5e){this[_0xb2bb('0x5')](_0xb2bb('0x4'),_0x14da5e);this[_0xb2bb('0x5')]('defaultuser',_0x14da5e);},'comment':_0xb2bb('0x6')},'fullname':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':![],'set':function(_0x53b48f){this[_0xb2bb('0x5')](_0xb2bb('0x7'),_0x53b48f);this[_0xb2bb('0x5')](_0xb2bb('0x8'),util['format'](_0xb2bb('0x9'),_0x53b48f,this['getDataValue'](_0xb2bb('0xa'))));}},'alias':{'type':Sequelize[_0xb2bb('0x3')]},'email':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':![],'unique':_0xb2bb('0xb'),'validate':{'isEmail':!![]},'set':function(_0x39e56f){if(_0x39e56f){this['setDataValue'](_0xb2bb('0xb'),_0x39e56f['toLowerCase']());}}},'role':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0xd'),_0xb2bb('0xe'),_0xb2bb('0xf'),_0xb2bb('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xb2bb('0x11')},'internal':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':![],'unique':_0xb2bb('0xa'),'set':function(_0x2905e2){this['setDataValue'](_0xb2bb('0xa'),_0x2905e2);this[_0xb2bb('0x5')](_0xb2bb('0x13'),_0x2905e2);this[_0xb2bb('0x5')](_0xb2bb('0x8'),util['format'](_0xb2bb('0x9'),this[_0xb2bb('0x14')](_0xb2bb('0x7')),_0x2905e2));}},'salt':{'type':Sequelize[_0xb2bb('0x3')]},'phone':{'type':Sequelize[_0xb2bb('0x3')]},'mobile':{'type':Sequelize[_0xb2bb('0x3')]},'address':{'type':Sequelize[_0xb2bb('0x3')]},'zipcode':{'type':Sequelize[_0xb2bb('0x3')]},'userpic':{'type':Sequelize[_0xb2bb('0x3')]},'city':{'type':Sequelize[_0xb2bb('0x3')]},'country':{'type':Sequelize[_0xb2bb('0x3')]},'online':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xb2bb('0x3')],'defaultValue':_0xb2bb('0x16')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xb2bb('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xb2bb('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb2bb('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xb2bb('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xb2bb('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![],'defaultValue':_0xb2bb('0x17')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xb2bb('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xb2bb('0x18'),'user',_0xb2bb('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![],'defaultValue':_0xb2bb('0x1a')},'callingpres':{'type':Sequelize['ENUM'](_0xb2bb('0x1b'),'ALLOWED_PASSED_SCREEN',_0xb2bb('0x1c'),_0xb2bb('0x1d'),'PROHIB_NOT_SCREENED',_0xb2bb('0x1e'),_0xb2bb('0x1f'),_0xb2bb('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![],'defaultValue':_0xb2bb('0x21'),'set':function(_0x286520){this['setDataValue'](_0xb2bb('0x22'),_0x286520?_0x286520[_0xb2bb('0x23')](','):null);},'get':function(){return this[_0xb2bb('0x14')](_0xb2bb('0x22'))?this[_0xb2bb('0x14')]('transport')[_0xb2bb('0x24')](','):null;},'comment':_0xb2bb('0x25')},'dtmfmode':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x26'),_0xb2bb('0x27'),'shortinfo','inband',_0xb2bb('0x28')),'allowNull':!![],'defaultValue':_0xb2bb('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no',_0xb2bb('0x2a'),'update',_0xb2bb('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![],'defaultValue':_0xb2bb('0x2c'),'set':function(_0x458a8e){this[_0xb2bb('0x5')]('nat',_0x458a8e?_0x458a8e[_0xb2bb('0x23')](','):null);},'get':function(){return this[_0xb2bb('0x14')](_0xb2bb('0x2d'))?this[_0xb2bb('0x14')](_0xb2bb('0x2d'))[_0xb2bb('0x24')](','):null;},'comment':_0xb2bb('0x2e')},'callgroup':{'type':Sequelize[_0xb2bb('0x3')]},'namedcallgroup':{'type':Sequelize[_0xb2bb('0x3')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xb2bb('0x3')]},'language':{'type':Sequelize[_0xb2bb('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb2bb('0x3')]},'disallow':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':![],'defaultValue':_0xb2bb('0x2f')},'allow':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':![],'defaultValue':_0xb2bb('0x30'),'set':function(_0x185c68){this['setDataValue'](_0xb2bb('0x31'),_0x185c68?_0x185c68['join'](';'):_0xb2bb('0x30'));},'get':function(){return this[_0xb2bb('0x14')](_0xb2bb('0x31'))?this[_0xb2bb('0x14')]('allow')[_0xb2bb('0x24')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x17db4f){this['setDataValue']('insecure',_0x17db4f?_0x17db4f['join'](','):null);},'get':function(){return this[_0xb2bb('0x14')](_0xb2bb('0x32'))?this[_0xb2bb('0x14')]('insecure')['split'](','):null;},'comment':_0xb2bb('0x33')},'trustrpid':{'type':Sequelize[_0xb2bb('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no',_0xb2bb('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb2bb('0x35')},'amaflags':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':_0xb2bb('0x29')},'busylevel':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb2bb('0xc')]('yes','no',_0xb2bb('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xb2bb('0x37'),_0xb2bb('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xb2bb('0xc')]('uac',_0xb2bb('0x39')),'allowNull':!![],'defaultValue':_0xb2bb('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':_0xb2bb('0x29')},'keepalive':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xb2bb('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no',_0xb2bb('0x3a'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb2bb('0xc')]('active',_0xb2bb('0x3b'),_0xb2bb('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xb2bb('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no',_0xb2bb('0x2a'),'update',_0xb2bb('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb2bb('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xb2bb('0x3e')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xb2bb('0x12')],'defaultValue':0x0,'set':function(_0x3a7d66){this[_0xb2bb('0x5')]('showWebBar',_0x3a7d66);var _0xd37961=this['get']({'plain':!![]});switch(_0x3a7d66){case 0x0:case 0x1:var _0x1b8dcc=_0xd37961[_0xb2bb('0x22')]?_[_0xb2bb('0x3f')](_0xd37961[_0xb2bb('0x22')])?_0xd37961['transport'][_0xb2bb('0x23')]():_0xd37961['transport']:'udp';if(_0x1b8dcc==='wss'){_0x1b8dcc=_0xb2bb('0x21');}this['setDataValue'](_0xb2bb('0x22'),_0x1b8dcc);this['setDataValue'](_0xb2bb('0x40'),'no');this['setDataValue']('avpf',null);this[_0xb2bb('0x5')](_0xb2bb('0x41'),null);this[_0xb2bb('0x5')]('icesupport',null);this[_0xb2bb('0x5')](_0xb2bb('0x42'),null);this[_0xb2bb('0x5')](_0xb2bb('0x43'),null);this[_0xb2bb('0x5')](_0xb2bb('0x44'),null);this[_0xb2bb('0x5')](_0xb2bb('0x45'),null);this[_0xb2bb('0x5')](_0xb2bb('0x46'),null);this[_0xb2bb('0x5')](_0xb2bb('0x47'),'no');break;case 0x2:this[_0xb2bb('0x5')](_0xb2bb('0x22'),_0xb2bb('0x48'));this[_0xb2bb('0x5')](_0xb2bb('0x40'),_0xb2bb('0x29'));this[_0xb2bb('0x5')](_0xb2bb('0x49'),_0xb2bb('0x29'));this[_0xb2bb('0x5')]('force_avp',_0xb2bb('0x29'));this[_0xb2bb('0x5')](_0xb2bb('0x4a'),_0xb2bb('0x29'));this[_0xb2bb('0x5')](_0xb2bb('0x42'),'yes');this['setDataValue'](_0xb2bb('0x43'),'no');this['setDataValue'](_0xb2bb('0x44'),'actpass');this[_0xb2bb('0x5')](_0xb2bb('0x45'),_0xd37961[_0xb2bb('0x45')]||_0xb2bb('0x4b'));this[_0xb2bb('0x5')](_0xb2bb('0x46'),_0xd37961[_0xb2bb('0x46')]||'/etc/pki/tls/private/motion.key');this[_0xb2bb('0x5')](_0xb2bb('0x47'),_0xb2bb('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xb2bb('0x4c')],'set':function(_0x2ba467){this[_0xb2bb('0x5')](_0xb2bb('0x4d'),_0x2ba467?_0x2ba467['join'](','):[]);},'get':function(){return this['getDataValue'](_0xb2bb('0x4d'))?_['map'](this[_0xb2bb('0x14')](_0xb2bb('0x4d'))[_0xb2bb('0x24')](','),function(_0x2afc3b){return parseInt(_0x2afc3b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xb2bb('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xb2bb('0x3')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xb2bb('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb2bb('0xc')](_0xb2bb('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb2bb('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xb2bb('0x4e')],'get':function(){return this[_0xb2bb('0x14')](_0xb2bb('0x4f'))?this[_0xb2bb('0x14')](_0xb2bb('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xb2bb('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb2bb('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![],'set':function(_0x532656){if(typeof _0x532656===_0xb2bb('0x50')){var _0x5d5953=_0x532656==='1'?!![]:_0x532656==='0'?![]:_0x532656===_0xb2bb('0x51')?!![]:_0x532656===_0xb2bb('0x52')?![]:![];this[_0xb2bb('0x5')](_0xb2bb('0x53'),_0x5d5953);}else{this['setDataValue'](_0xb2bb('0x53'),_0x532656);}}},'blocked':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![],'set':function(_0x5aecb4){this[_0xb2bb('0x5')](_0xb2bb('0x54'),_0x5aecb4);if(_0x5aecb4===!![]){this[_0xb2bb('0x5')](_0xb2bb('0x55'),moment());this[_0xb2bb('0x5')](_0xb2bb('0x56'),0x0);}else{this[_0xb2bb('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xb2bb('0x3e')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xb2bb('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xb2bb('0x12')](0x5)[_0xb2bb('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xb2bb('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 18606f9..1b72c69 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 _0xf61e=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','defaults','localhost','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','User,\x20%s,\x20%s','catch','status','offset','limit','count','set','Content-Range','json','update','destroy','role','admin','user','Agents','Telephones','filter','map','value','includes','find','name','UserProfileResource','end','rawAttributes','fieldName','type','key','password','salt','where','User','query','attributes','push','findAll','openTabs','true','rows','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','fields','includeAll','include','merge','options','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','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','mailbox','VoiceMail','email','agent','permissions','101','103','110','104','105','106','107','108','109','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','Unauthorized','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','each','isEmpty','telephone','compact','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','QueueId','emit','Queue:save','get','voice','format','upsert','removeQueues','remove','isArray','capitalize','Queue:remove','UserVoiceQueueRt','addAvatar','file','filename','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','sort','CmList','List','Tags','color','tag','nolimit','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','hasOwnProperty','getRecordings','VoiceRecording','UserId','ScreenRecording','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','SIP/%s','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','whatsapppause','manual','Pause','getTeams','Team','addTeams','getVoiceQueues','setDataValue','Voice','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','TeamVoicePrefix','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$like','$iLike','$notILike','$overlap','$contains','$any','CmHopper','firstName','lastName','phone','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','inbound','col','toString','asc','desc','substring','uniqBy','orderBy','result','offline','idle','unknown','ringing','voiceStatus','busy','toUpperCase','slice','select','field','ui.','InteractionId','user_has_','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xf61e,0x191));var _0xef61=function(_0x12fa1c,_0x4c82fd){_0x12fa1c=_0x12fa1c-0x0;var _0xbd9ecc=_0xf61e[_0x12fa1c];return _0xbd9ecc;};'use strict';var moment=require(_0xef61('0x0'));var BPromise=require(_0xef61('0x1'));var util=require(_0xef61('0x2'));var path=require(_0xef61('0x3'));var fs=require('fs');var _=require(_0xef61('0x4'));var squel=require(_0xef61('0x5'));var jayson=require(_0xef61('0x6'));var Redis=require(_0xef61('0x7'));var authService=require(_0xef61('0x8'));var qs=require(_0xef61('0x9'));var logger=require(_0xef61('0xa'))(_0xef61('0xb'));var utils=require('../../config/utils');var config=require(_0xef61('0xc'));var licenseUtil=require(_0xef61('0xd'));var db=require('../../mysqldb')['db'];var socket=require(_0xef61('0xe'))(new Redis(config[_0xef61('0xf')]));require(_0xef61('0x10'))['register'](socket);config['redis']=_[_0xef61('0x11')](config[_0xef61('0xf')],{'host':_0xef61('0x12'),'port':0x18eb});var client=jayson[_0xef61('0x13')][_0xef61('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0xdcd707,_0x1394af,_0x129874,_0x237f43){return new BPromise(function(_0x66e7b2,_0x28d4f7){var _0x2f203c=_0x237f43||client;return _0x2f203c[_0xef61('0x15')](_0xdcd707,_0x129874)[_0xef61('0x16')](function(_0x5de159){logger[_0xef61('0x17')]('User,\x20%s,\x20%s',_0x1394af,_0xef61('0x18'));logger[_0xef61('0x19')](_0xef61('0x1a'),_0x1394af,_0xef61('0x18'),JSON['stringify'](_0x5de159));if(_0x5de159[_0xef61('0x1b')]){if(_0x5de159[_0xef61('0x1b')][_0xef61('0x1c')]===0x1f4){logger[_0xef61('0x1b')]('User,\x20%s,\x20%s',_0x1394af,_0x5de159[_0xef61('0x1b')][_0xef61('0x1d')]);return _0x28d4f7(_0x5de159['error'][_0xef61('0x1d')]);}logger[_0xef61('0x1b')](_0xef61('0x1e'),_0x1394af,_0x5de159[_0xef61('0x1b')][_0xef61('0x1d')]);return _0x66e7b2(_0x5de159[_0xef61('0x1b')][_0xef61('0x1d')]);}else{logger['info'](_0xef61('0x1e'),_0x1394af,_0xef61('0x18'));_0x66e7b2(_0x5de159['result'][_0xef61('0x1d')]);}})[_0xef61('0x1f')](function(_0x29c13c){logger[_0xef61('0x1b')](_0xef61('0x1e'),_0x1394af,_0x29c13c);_0x28d4f7(_0x29c13c);});});}function respondWithStatusCode(_0x2ed61e,_0x92ea33){_0x92ea33=_0x92ea33||0xcc;return function(_0x51f9ca){if(_0x51f9ca){return _0x2ed61e['sendStatus'](_0x92ea33);}return _0x2ed61e[_0xef61('0x20')](_0x92ea33)['end']();};}function respondWithResult(_0x389d6d,_0x5ae7a2){_0x5ae7a2=_0x5ae7a2||0xc8;return function(_0x488b47){if(_0x488b47){return _0x389d6d[_0xef61('0x20')](_0x5ae7a2)['json'](_0x488b47);}};}function respondWithFilteredResult(_0x53181b,_0xfbee94){return function(_0x3782c6){if(_0x3782c6){var _0x3ceb14=typeof _0xfbee94[_0xef61('0x21')]==='undefined'&&typeof _0xfbee94[_0xef61('0x22')]==='undefined';var _0x2a6832=_0x3782c6[_0xef61('0x23')];var _0x2419a9=_0x3ceb14?0x0:_0xfbee94[_0xef61('0x21')];var _0x2155f1=_0x3ceb14?_0x3782c6[_0xef61('0x23')]:_0xfbee94[_0xef61('0x21')]+_0xfbee94[_0xef61('0x22')];var _0x297df7;if(_0x2155f1>=_0x2a6832){_0x2155f1=_0x2a6832;_0x297df7=0xc8;}else{_0x297df7=0xce;}_0x53181b[_0xef61('0x20')](_0x297df7);return _0x53181b[_0xef61('0x24')](_0xef61('0x25'),_0x2419a9+'-'+_0x2155f1+'/'+_0x2a6832)[_0xef61('0x26')](_0x3782c6);}return null;};}function saveUpdates(_0x63edd4){return function(_0x1f3572){if(_0x1f3572){return _0x1f3572[_0xef61('0x27')](_0x63edd4)[_0xef61('0x16')](function(_0x393ea9){return _0x393ea9;});}return null;};}function removeEntity(_0x587e26){return function(_0x2fe908){if(_0x2fe908){return _0x2fe908[_0xef61('0x28')]()[_0xef61('0x16')](function(){var _0x4f35ad=_0x2fe908['get']({'plain':!![]});if(_0x4f35ad[_0xef61('0x29')]===_0xef61('0x2a'))return;var _0x122176=[{'name':'Users','value':_0xef61('0x2b'),'ignore':!![]},{'name':_0xef61('0x2c'),'value':'agent','ignore':![]},{'name':_0xef61('0x2d'),'value':'telephone','ignore':![]}];var _0x4c7fd3=_(_0x122176)[_0xef61('0x2e')]('ignore')[_0xef61('0x2f')]('value')[_0xef61('0x30')]();if(_[_0xef61('0x31')](_0x4c7fd3,_0x4f35ad[_0xef61('0x29')])){return;}var _0x14c05c=_[_0xef61('0x32')](_0x122176,[_0xef61('0x30'),_0x4f35ad[_0xef61('0x29')]])[_0xef61('0x33')];return db[_0xef61('0x34')][_0xef61('0x28')]({'where':{'type':_0x14c05c,'resourceId':_0x4f35ad['id']}})['then'](function(){return _0x2fe908;});})[_0xef61('0x16')](function(){_0x587e26[_0xef61('0x20')](0xcc)[_0xef61('0x35')]();});}};}function handleEntityNotFound(_0x1c1760){return function(_0x310954){if(!_0x310954){_0x1c1760['sendStatus'](0x194);}return _0x310954;};}function handleError(_0x1c38dc,_0x3b7373){_0x3b7373=_0x3b7373||0x1f4;return function(_0x291944){logger['error'](_0x291944['stack']);if(_0x291944['name']){delete _0x291944[_0xef61('0x33')];}_0x1c38dc['status'](_0x3b7373)['send'](_0x291944);};}exports['index']=function(_0x3ee764,_0x294063){var _0x54e37a={},_0x508dc7={'count':0x0,'rows':[]};var _0x53c9ef=_(db['User'][_0xef61('0x36')])[_0xef61('0x2f')](function(_0x5e1128){return{'name':_0x5e1128[_0xef61('0x37')],'type':_0x5e1128[_0xef61('0x38')][_0xef61('0x39')]};})[_0xef61('0x2e')](function(_0x49e7c4){return!_[_0xef61('0x31')]([_0xef61('0x3a'),_0xef61('0x3b')],_0x49e7c4[_0xef61('0x33')]);})['value']();_0x54e37a=qs['getOptions'](_0x53c9ef,_0x3ee764);var _0x32109d={'where':_0x54e37a[_0xef61('0x3c')]};return db[_0xef61('0x3d')]['count'](_0x32109d)[_0xef61('0x16')](function(_0x361705){_0x508dc7[_0xef61('0x23')]=_0x361705;if(_0x3ee764[_0xef61('0x3e')]['includeAll']){_0x54e37a['include']=[{'all':!![]}];}if(!_['includes'](_0x54e37a[_0xef61('0x3f')],'id')){_0x54e37a[_0xef61('0x3f')][_0xef61('0x40')]('id');}return db[_0xef61('0x3d')][_0xef61('0x41')](_0x54e37a);})[_0xef61('0x16')](function(_0xc9b467){_0x508dc7['rows']=_0xc9b467;if(_0x3ee764[_0xef61('0x3e')][_0xef61('0x42')]===_0xef61('0x43')){var _0x898c74=[];for(var _0x51fac1=0x0;_0x51fac1<_0x508dc7[_0xef61('0x44')][_0xef61('0x45')];_0x51fac1++){_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74['push'](get_open_tabs(_0xef61('0x48'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74['push'](get_open_tabs(_0xef61('0x49'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x508dc7[_0xef61('0x44')][_0x51fac1]['dataValues']));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x508dc7['rows'][_0x51fac1][_0xef61('0x47')]));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x508dc7[_0xef61('0x44')][_0x51fac1]['dataValues']));}return BPromise[_0xef61('0x4d')](_0x898c74)[_0xef61('0x16')](function(_0x5e614b){return _0x508dc7;});}else{return _0x508dc7;}})['then'](respondWithFilteredResult(_0x294063,_0x54e37a))[_0xef61('0x1f')](handleError(_0x294063,null));};exports[_0xef61('0x4e')]=function(_0x53bd30,_0xe9d203){var _0x132c77={'raw':![],'where':{'id':_0x53bd30[_0xef61('0x4f')]['id']}},_0x13d0f8={};_0x13d0f8[_0xef61('0x50')]=_[_0xef61('0x51')](_[_0xef61('0x52')](db['User'][_0xef61('0x36')]),['password',_0xef61('0x3b')]);_0x13d0f8[_0xef61('0x3e')]=_[_0xef61('0x52')](_0x53bd30[_0xef61('0x3e')]);_0x13d0f8[_0xef61('0x53')]=_[_0xef61('0x54')](_0x13d0f8[_0xef61('0x50')],_0x13d0f8[_0xef61('0x3e')]);_0x132c77[_0xef61('0x3f')]=_['intersection'](_0x13d0f8[_0xef61('0x50')],qs[_0xef61('0x55')](_0x53bd30['query']['fields']));_0x132c77[_0xef61('0x3f')]=_0x132c77[_0xef61('0x3f')]['length']?_0x132c77[_0xef61('0x3f')]:_0x13d0f8['model'];if(_0x53bd30[_0xef61('0x3e')][_0xef61('0x56')]){_0x132c77[_0xef61('0x57')]=[{'all':!![]}];}_0x132c77=_[_0xef61('0x58')]({},_0x132c77,_0x53bd30[_0xef61('0x59')]);if(!_[_0xef61('0x31')](_0x132c77['attributes'],'id')){_0x132c77[_0xef61('0x3f')][_0xef61('0x40')]('id');}return db['User'][_0xef61('0x32')](_0x132c77)[_0xef61('0x16')](handleEntityNotFound(_0xe9d203,null))['then'](function(_0x54a936){var _0x93441a=[];values=_0x54a936;if(_0x53bd30['query']['openTabs']==='true'){_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x54a936['dataValues']));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x48'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x54a936['dataValues']));_0x93441a['push'](get_open_tabs(_0xef61('0x49'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x54a936[_0xef61('0x47')]));return BPromise['all'](_0x93441a);}else{return values;}})[_0xef61('0x16')](function(_0x572d5f){return values;})['then'](respondWithResult(_0xe9d203,null))[_0xef61('0x1f')](handleError(_0xe9d203,null));};exports[_0xef61('0x27')]=function(_0x224f3a,_0x525a5e){if(_0x224f3a[_0xef61('0x5a')]['id']){delete _0x224f3a[_0xef61('0x5a')]['id'];}delete _0x224f3a[_0xef61('0x5a')][_0xef61('0x29')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x224f3a[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x525a5e,null))[_0xef61('0x16')](saveUpdates(_0x224f3a[_0xef61('0x5a')],null))['then'](respondWithResult(_0x525a5e,null))[_0xef61('0x1f')](handleError(_0x525a5e,null));};exports['describe']=function(_0x503e8c,_0x4386a7){return db[_0xef61('0x3d')][_0xef61('0x5b')]()[_0xef61('0x16')](respondWithResult(_0x4386a7,null))[_0xef61('0x1f')](handleError(_0x4386a7,null));};exports[_0xef61('0x5c')]=function(_0x5e98a9,_0x4c7a9a){return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x5e98a9[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x4c7a9a,null))[_0xef61('0x16')](function(_0x3ae98c){if(_0x3ae98c){return _0x3ae98c[_0xef61('0x5c')](_0x5e98a9[_0xef61('0x5a')][_0xef61('0x5d')],_[_0xef61('0x5e')](_0x5e98a9[_0xef61('0x5a')],['ids','id'])||{});}})[_0xef61('0x16')](respondWithResult(_0x4c7a9a,null))[_0xef61('0x1f')](handleError(_0x4c7a9a,null));};function validateUser(_0x485945){return new BPromise(function(_0x4559a6,_0x1856ee){if(_0x485945[_0xef61('0x5f')])return _0x4559a6(_0x485945);return db[_0xef61('0x60')][_0xef61('0x61')](0x1)[_0xef61('0x16')](function(_0x3e4678){if(_0x3e4678[_0xef61('0x62')])authService['validatePasswordPattern'](_0x485945[_0xef61('0x3a')]);db['User']['max']('internal')[_0xef61('0x16')](function(_0x205f80){if(_[_0xef61('0x63')](_0x205f80)){_0x485945['internal']=_0x3e4678[_0xef61('0x64')]||0x1;return;}if(_[_0xef61('0x63')](_0x3e4678[_0xef61('0x64')])||_0x3e4678[_0xef61('0x64')]===_0x205f80){_0x485945[_0xef61('0x5f')]=_0x205f80+0x1;return;}if(_0x3e4678[_0xef61('0x64')]>_0x205f80){_0x485945[_0xef61('0x5f')]=_0x3e4678[_0xef61('0x64')];return;}return db[_0xef61('0x65')][_0xef61('0x3e')](_0xef61('0x66'),{'type':db[_0xef61('0x65')][_0xef61('0x67')][_0xef61('0x68')]})[_0xef61('0x16')](function(_0x5931a4){if(_0x5931a4&&_0x5931a4[_0xef61('0x45')]){for(var _0x117d37=0x0,_0x529a78=_0x5931a4[_0xef61('0x45')];_0x117d37<_0x529a78&&_[_0xef61('0x63')](_0x485945[_0xef61('0x5f')]);_0x117d37++){if(_0x3e4678[_0xef61('0x64')]<=_0x5931a4[_0x117d37][_0xef61('0x69')]){_0x485945[_0xef61('0x5f')]=_0x5931a4[_0x117d37]['from'];}else if(_0x3e4678[_0xef61('0x64')]>_0x5931a4[_0x117d37][_0xef61('0x69')]&&_0x3e4678['min_internal']<=_0x5931a4[_0x117d37]['to']){_0x485945[_0xef61('0x5f')]=_0x3e4678['min_internal'];}}}if(_[_0xef61('0x63')](_0x485945[_0xef61('0x5f')])){_0x485945['internal']=_0x205f80+0x1;}return _0x4559a6(_0x485945);});});})[_0xef61('0x1f')](function(_0x512415){_0x1856ee(_0x512415);});});}function updateUser(_0x3cba7f){return new BPromise(function(_0x3f9882,_0x4c880e){try{if(_0x3cba7f['voicemail']){_0x3cba7f[_0xef61('0x6a')]=_0x3cba7f[_0xef61('0x5f')];_0x3cba7f[_0xef61('0x6b')]={'mailbox':_0x3cba7f[_0xef61('0x5f')],'password':_0x3cba7f[_0xef61('0x3a')],'fullname':_0x3cba7f['fullname'],'email':_0x3cba7f[_0xef61('0x6c')]};}if(_0x3cba7f[_0xef61('0x29')]===_0xef61('0x6d')){if(!_0x3cba7f[_0xef61('0x6e')])_0x3cba7f[_0xef61('0x6e')]=[_0xef61('0x6f'),'102',_0xef61('0x70'),'113',_0xef61('0x71'),_0xef61('0x72'),_0xef61('0x73'),_0xef61('0x74'),_0xef61('0x75'),_0xef61('0x76'),_0xef61('0x77'),_0xef61('0x78'),_0xef61('0x79'),_0xef61('0x7a'),_0xef61('0x7b')];}_0x3f9882(_0x3cba7f);}catch(_0x253b51){_0x4c880e(_0x253b51);}});}exports[_0xef61('0x7c')]=function(_0x5c2166,_0x3f4ff8){if(_0x5c2166[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x6d'))throw new Error('Unauthorized');if(_0x5c2166[_0xef61('0x5a')]['role']==='user'&&_0x5c2166[_0xef61('0x2b')]['role']!==_0xef61('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5c2166['body'][_0xef61('0x29')]===_0xef61('0x2a')&&_0x5c2166['user'][_0xef61('0x29')]!=='admin'){throw new Error(_0xef61('0x7d'));}return licenseUtil[_0xef61('0x7e')]([_0x5c2166[_0xef61('0x5a')]])[_0xef61('0x16')](function(){return validateUser(_0x5c2166['body']);})[_0xef61('0x16')](function(_0x59813e){return updateUser(_0x59813e)[_0xef61('0x16')](function(_0x2ddf83){if(_0x2ddf83[_0xef61('0x29')]===_0xef61('0x2a')){_0x2ddf83[_0xef61('0x7f')]=_0x5c2166[_0xef61('0x2b')][_0xef61('0x7f')];delete _0x2ddf83[_0xef61('0x80')];}return _0x2ddf83;});})[_0xef61('0x16')](function(_0x540b68){return db[_0xef61('0x3d')]['create'](_0x540b68,{'include':[{'model':db[_0xef61('0x6b')],'as':_0xef61('0x6b')}]});})['then'](function(_0x43eb12){if(_0x5c2166['body']['role']===_0xef61('0x2b'))return _0x43eb12;if(_0x5c2166[_0xef61('0x2b')]['role']!==_0xef61('0x2b'))return _0x43eb12;return db[_0xef61('0x81')]['find']({'where':{'name':_0x43eb12[_0xef61('0x29')]===_0xef61('0x6d')?'Agents':_0xef61('0x2d'),'userProfileId':_0x5c2166['user'][_0xef61('0x80')]},'raw':!![]})[_0xef61('0x16')](function(_0x1d0dd8){if(!_0x1d0dd8||_0x1d0dd8[_0xef61('0x82')]!=0x0)return _0x43eb12;return db['UserProfileResource'][_0xef61('0x7c')]({'name':_0x43eb12[_0xef61('0x33')],'resourceId':_0x43eb12['id'],'type':_0x1d0dd8[_0xef61('0x33')],'sectionId':_0x1d0dd8['id']},{})['then'](function(){return _0x43eb12;});})[_0xef61('0x1f')](function(_0x2a0edb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a0edb);throw _0x2a0edb;});})[_0xef61('0x16')](respondWithResult(_0x3f4ff8,0xc9))[_0xef61('0x1f')](handleError(_0x3f4ff8,null));};exports[_0xef61('0x83')]=function(_0x3d829e,_0x15ddb0){var _0x1b3b78=_0x3d829e[_0xef61('0x5a')];var _0x113f9c=[];if(_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x6d'))throw new Error(_0xef61('0x84'));if(_[_0xef61('0x85')](_0x1b3b78,[_0xef61('0x29'),_0xef61('0x2b')])&&_0x3d829e[_0xef61('0x2b')]['role']!==_0xef61('0x2a')){throw new Error(_0xef61('0x86'));}if(_[_0xef61('0x85')](_0x1b3b78,[_0xef61('0x29'),_0xef61('0x2a')])&&_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]!==_0xef61('0x2a')){throw new Error(_0xef61('0x87'));}return licenseUtil[_0xef61('0x7e')](_0x1b3b78)[_0xef61('0x16')](function(){return validateUser(_0x1b3b78[0x0]);})[_0xef61('0x16')](function(){for(var _0x4e8a39=0x1;_0x4e8a39<_0x1b3b78[_0xef61('0x45')];_0x4e8a39++){var _0xe465b9=_0x1b3b78[_0x4e8a39-0x1]['internal'];if(!_0x1b3b78[_0x4e8a39][_0xef61('0x5f')])_0x1b3b78[_0x4e8a39][_0xef61('0x5f')]=_0xe465b9+0x1;_0x113f9c[_0xef61('0x40')](validateUser(_0x1b3b78[_0x4e8a39]));}return BPromise[_0xef61('0x4d')](_0x113f9c);})[_0xef61('0x16')](function(){_0x113f9c=[];for(var _0x51a988=0x0;_0x51a988<_0x1b3b78[_0xef61('0x45')];_0x51a988++){_0x113f9c['push'](updateUser(_0x1b3b78[_0x51a988]));}return BPromise[_0xef61('0x4d')](_0x113f9c);})[_0xef61('0x16')](function(){return BPromise[_0xef61('0x88')](_0x1b3b78,function(_0x19b1a0){return db[_0xef61('0x3d')][_0xef61('0x7c')](_0x19b1a0,{'include':[{'model':db[_0xef61('0x6b')],'as':_0xef61('0x6b')}]})['then'](function(_0x3f68db){_0x19b1a0['id']=_0x3f68db['id'];return _0x19b1a0;});});})[_0xef61('0x16')](function(_0x28f142){if(_0x3d829e[_0xef61('0x5a')][_0xef61('0x29')]===_0xef61('0x2b'))return _0x28f142;if(_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]!==_0xef61('0x2b'))return _0x28f142;var _0x53678e=_[_0xef61('0x85')](_0x28f142,function(_0xe57b4d){return _0xe57b4d[_0xef61('0x29')]===_0xef61('0x6d')||_0xe57b4d['role']==='telephone';});if(!_0x53678e)return _0x28f142;return db[_0xef61('0x81')][_0xef61('0x41')]({'where':{'name':{'$or':[_0xef61('0x2c'),_0xef61('0x2d')]},'userProfileId':_0x3d829e[_0xef61('0x2b')][_0xef61('0x80')]},'raw':!![]})[_0xef61('0x16')](function(_0x4c2d94){if(_[_0xef61('0x89')](_0x4c2d94)||!_[_0xef61('0x85')](_0x4c2d94,[_0xef61('0x82'),0x0]))return _0x28f142;_0x113f9c=[];var _0x22e342=_(_0x4c2d94)[_0xef61('0x2f')](function(_0x4fa56b){if(_0x4fa56b[_0xef61('0x82')]===0x1)return;return _0x4fa56b['name']===_0xef61('0x2c')?_0xef61('0x6d'):_0xef61('0x8a');})[_0xef61('0x8b')]()[_0xef61('0x30')]();for(var _0xa23aa9=0x0;_0xa23aa9<_0x28f142['length'];_0xa23aa9++){if(!_[_0xef61('0x31')](_0x22e342,_0x28f142[_0xa23aa9][_0xef61('0x29')]))return;var _0xc67b1b=_0x28f142[_0xa23aa9][_0xef61('0x29')]===_0xef61('0x6d')?_0xef61('0x2c'):_0xef61('0x2d');_0x113f9c['push'](db[_0xef61('0x34')][_0xef61('0x7c')]({'name':_0x28f142[_0xa23aa9][_0xef61('0x33')],'resourceId':_0x28f142[_0xa23aa9]['id'],'type':_0xc67b1b,'sectionId':_['find'](_0x4c2d94,['name',_0xc67b1b])['id']},{}));}return BPromise[_0xef61('0x4d')](_0x113f9c);});})[_0xef61('0x16')](respondWithResult(_0x15ddb0,0xc9))['catch'](handleError(_0x15ddb0,null));};exports[_0xef61('0x8c')]=function(_0x1a9418,_0x30e931){if(_0x1a9418[_0xef61('0x5a')]['id']){delete _0x1a9418[_0xef61('0x5a')]['id'];}return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x1a9418[_0xef61('0x4f')]['id']}})['then'](function(_0x321b02){if(!_0x321b02)return null;if(_0x321b02['id']===_0x1a9418[_0xef61('0x2b')]['id']){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x8d')]||!_0x1a9418[_0xef61('0x5a')]['newPassword']){throw new db[(_0xef61('0x8e'))]['ValidationError'](_0xef61('0x8f'));}if(!_0x321b02[_0xef61('0x90')](_0x1a9418[_0xef61('0x5a')]['oldPassword'])){throw new db['Sequelize'][(_0xef61('0x91'))](_0xef61('0x92'));}if(_0x1a9418['body']['oldPassword']===_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x94'));}}else if(_0x1a9418[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x2a')){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))]['ValidationError'](_0xef61('0x95'));}}else if(_0x1a9418[_0xef61('0x2b')]['role']===_0xef61('0x2b')){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x95'));}if(_0x321b02['role']!==_0xef61('0x6d')){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x84'));}}else{throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))]('Unauthorized');}return _0x321b02;})['then'](handleEntityNotFound(_0x30e931,null))[_0xef61('0x16')](function(_0x13d2f4){return db[_0xef61('0x60')][_0xef61('0x96')]({'attributes':['id',_0xef61('0x62'),_0xef61('0x97'),_0xef61('0x98')]})['then'](function(_0x569dc7){if(_0x569dc7[_0xef61('0x62')])authService[_0xef61('0x99')](_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]);if(!_0x569dc7[_0xef61('0x97')]||!_0x13d2f4['previousPasswords'])return _0x13d2f4;authService[_0xef61('0x9a')](_0x1a9418['body'][_0xef61('0x93')],_0x13d2f4['previousPasswords'],_0x569dc7[_0xef61('0x98')]);return _0x13d2f4;})['then'](saveUpdates({'password':_0x1a9418['body'][_0xef61('0x93')],'passwordResetAt':_0x1a9418[_0xef61('0x2b')]['id']==_0x1a9418[_0xef61('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xef61('0x9b')](_0x1a9418[_0xef61('0x5a')]['newPassword'],_0x13d2f4['previousPasswords'])},null));})['then'](respondWithResult(_0x30e931,null))[_0xef61('0x1f')](handleError(_0x30e931,null));};exports['addQueues']=function(_0x35155e,_0x132875){var _0x2ba1e7=_0x35155e[_0xef61('0x5a')][_0xef61('0x9c')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x35155e['params']['id']},'attributes':['id',_0xef61('0x33'),'role',_0xef61('0x9d'),_0xef61('0x9e'),_0xef61('0x9f'),_0xef61('0xa0')]})['then'](handleEntityNotFound(_0x132875,null))[_0xef61('0x16')](function(_0x45c0f4){if(_0x45c0f4){if(!utils[_0xef61('0xa1')](_0x2ba1e7)){throw new db['Sequelize']['ValidationError'](_0xef61('0xa2'));}return _0x45c0f4[_0xef61('0xa3')+_['capitalize'](_0x2ba1e7[_0xef61('0xa4')]())+_0xef61('0xa5')](_0x35155e['body']['ids'],{'penalty':_0x35155e[_0xef61('0x5a')][_0xef61('0xa6')]||0x0})['spread'](function(_0x1090ba){for(var _0x5d2765=0x0;_0x5d2765<_0x35155e[_0xef61('0x5a')]['ids'][_0xef61('0x45')];_0x5d2765+=0x1){var _0x4be6f2={'UserId':Number(_0x35155e[_0xef61('0x4f')]['id'])};_0x4be6f2[_['capitalize'](_0x2ba1e7[_0xef61('0xa4')]())+_0xef61('0xa7')]=Number(_0x35155e['body'][_0xef61('0x5d')][_0x5d2765]);socket[_0xef61('0xa8')](_0xef61('0x2b')+_['capitalize'](_0x2ba1e7['toLowerCase']())+_0xef61('0xa9'),_0x4be6f2);}return _0x1090ba;})[_0xef61('0x16')](function(){if(_0x2ba1e7==='voice'){return db['VoiceQueue'][_0xef61('0x41')]({'where':{'id':_0x35155e[_0xef61('0x5a')]['ids']||[]},'raw':!![],'attributes':['id',_0xef61('0x33')]});}})['then'](function(_0x3dc1f2){var _0x87fe0e=_0x45c0f4[_0xef61('0xaa')]({'plain':!![]});var _0x128ddc=[];if(_0x2ba1e7===_0xef61('0xab')&&_0x87fe0e[_0xef61('0x29')]==='agent'&&_0x87fe0e['online']){for(var _0x780325=0x0;_0x780325<_0x3dc1f2[_0xef61('0x45')];_0x780325+=0x1){_0x128ddc[_0xef61('0x40')]({'membername':_0x87fe0e[_0xef61('0x33')],'UserId':_0x87fe0e['id'],'queue_name':_0x3dc1f2[_0x780325][_0xef61('0x33')],'VoiceQueueId':_0x3dc1f2[_0x780325]['id'],'interface':_[_0xef61('0x63')](_0x87fe0e[_0xef61('0xa0')])?util[_0xef61('0xac')]('SIP/%s',_0x87fe0e[_0xef61('0x33')]):_0x87fe0e[_0xef61('0xa0')],'paused':_0x87fe0e[_0xef61('0x9f')]||![],'penalty':_0x35155e[_0xef61('0x5a')][_0xef61('0xa6')]||0x0});}return BPromise[_0xef61('0x88')](_0x128ddc,function(_0x6b01f9){return db['UserVoiceQueueRt'][_0xef61('0xad')](_0x6b01f9);});}return _0x45c0f4;});}})[_0xef61('0x16')](respondWithStatusCode(_0x132875,null))[_0xef61('0x1f')](handleError(_0x132875,null));};exports[_0xef61('0xae')]=function(_0x318887,_0x3f77d1){var _0x4216f8;return db['User'][_0xef61('0x32')]({'where':{'id':_0x318887[_0xef61('0x4f')]['id']},'attributes':['id',_0xef61('0x33'),_0xef61('0x29')]})[_0xef61('0x16')](handleEntityNotFound(_0x3f77d1,null))[_0xef61('0x16')](function(_0x3ef5fd){if(_0x3ef5fd){_0x4216f8=_0x3ef5fd;if(!_0x318887['query'][_0xef61('0x9c')]||!utils[_0xef61('0xa1')](_0x318887['query']['channel'])){throw new db['Sequelize'][(_0xef61('0x91'))](_0xef61('0xa2'));}return _0x3ef5fd[_0xef61('0xaf')+_['capitalize'](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xa5')](_0x318887['query'][_0xef61('0x5d')]);}})[_0xef61('0x16')](function(_0x23a826){if(_[_0xef61('0xb0')](_0x318887[_0xef61('0x3e')]['ids'])){for(var _0x471206=0x0;_0x471206<_0x318887[_0xef61('0x3e')][_0xef61('0x5d')][_0xef61('0x45')];_0x471206+=0x1){var _0x223514={'UserId':Number(_0x318887[_0xef61('0x4f')]['id'])};_0x223514[_[_0xef61('0xb1')](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xa7')]=Number(_0x318887['query'][_0xef61('0x5d')][_0x471206]);socket['emit']('user'+_['capitalize'](_0x318887['query'][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xb2'),_0x223514);}}else{var _0x223514={'UserId':Number(_0x318887[_0xef61('0x4f')]['id'])};_0x223514[_['capitalize'](_0x318887['query'][_0xef61('0x9c')]['toLowerCase']())+_0xef61('0xa7')]=Number(_0x318887[_0xef61('0x3e')][_0xef61('0x5d')]);socket['emit'](_0xef61('0x2b')+_[_0xef61('0xb1')](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xb2'),_0x223514);}return _0x23a826;})['then'](function(){if(_0x318887[_0xef61('0x3e')][_0xef61('0x9c')]===_0xef61('0xab')){return db[_0xef61('0xb3')]['destroy']({'where':{'UserId':_0x318887['params']['id'],'VoiceQueueId':_0x318887[_0xef61('0x3e')][_0xef61('0x5d')]},'individualHooks':!![]})[_0xef61('0x16')](function(){return _0x4216f8;});}return _0x4216f8;})['then'](respondWithStatusCode(_0x3f77d1,null))[_0xef61('0x1f')](handleError(_0x3f77d1,null));};exports[_0xef61('0xb4')]=function(_0x527c04,_0x3a40e9){_0x527c04[_0xef61('0x5a')]['userpic']=_0x527c04[_0xef61('0xb5')][_0xef61('0xb6')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x527c04[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x3a40e9,null))[_0xef61('0x16')](saveUpdates(_0x527c04['body'],null))[_0xef61('0x16')](respondWithResult(_0x3a40e9,null))[_0xef61('0x1f')](handleError(_0x3a40e9,null));};exports['getAvatar']=function(_0xf43ed,_0x50ca36){var _0x38e790=path[_0xef61('0xb7')](config[_0xef61('0xb8')],_0xef61('0xb9'));return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0xf43ed[_0xef61('0x4f')]['id']},'attributes':['id',_0xef61('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0x50ca36,null))[_0xef61('0x16')](function(_0x392cb9){if(_0x392cb9){if(_['isNil'](_0x392cb9[_0xef61('0xba')])){return _0x50ca36[_0xef61('0xbb')](_0x38e790);}else{if(!fs[_0xef61('0xbc')](path['join'](config[_0xef61('0xb8')],_0xef61('0xbd'),_0x392cb9['userpic']))){return _0x50ca36[_0xef61('0xbb')](_0x38e790);}return _0x50ca36['download'](path['join'](config[_0xef61('0xb8')],'server/files/images/',_0x392cb9[_0xef61('0xba')]));}}})[_0xef61('0x1f')](handleError(_0x50ca36,null));};exports[_0xef61('0xbe')]=function(_0x3bf8a9,_0x227940){return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x3bf8a9[_0xef61('0x4f')]['id']},'attributes':['id']})[_0xef61('0x16')](handleEntityNotFound(_0x227940,null))[_0xef61('0x16')](function(_0x2998f1){var _0x57fa3e=[];values=_0x2998f1[_0xef61('0x47')];_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x48'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x2998f1['dataValues']));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x49'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x2998f1[_0xef61('0x47')]));return BPromise[_0xef61('0x4d')](_0x57fa3e);})['then'](function(_0x54bad6){var _0x4fb086=[];if(_0x54bad6){for(var _0x432f67=0x0;_0x432f67=_0x107fbd){_0x515519=_0x107fbd;_0x35b5c7=0xc8;}else{_0x35b5c7=0xce;}_0x2847b4[_0x71a3('0x21')](_0x35b5c7);return _0x2847b4[_0x71a3('0x27')](_0x71a3('0x28'),_0x4c1a3d+'-'+_0x515519+'/'+_0x107fbd)[_0x71a3('0x22')](_0x26e6e7);}return null;};}function saveUpdates(_0x305eb1){return function(_0x3fc578){if(_0x3fc578){return _0x3fc578[_0x71a3('0x29')](_0x305eb1)[_0x71a3('0x15')](function(_0x51cde3){return _0x51cde3;});}return null;};}function removeEntity(_0x26fd9f){return function(_0x1719e6){if(_0x1719e6){return _0x1719e6[_0x71a3('0x2a')]()[_0x71a3('0x15')](function(){var _0x4a750c=_0x1719e6[_0x71a3('0x2b')]({'plain':!![]});if(_0x4a750c[_0x71a3('0x2c')]===_0x71a3('0x2d'))return;var _0x114032=[{'name':_0x71a3('0x2e'),'value':_0x71a3('0x2f'),'ignore':!![]},{'name':_0x71a3('0x30'),'value':'agent','ignore':![]},{'name':_0x71a3('0x31'),'value':_0x71a3('0x32'),'ignore':![]}];var _0x3aaf63=_(_0x114032)[_0x71a3('0x33')](_0x71a3('0x34'))[_0x71a3('0x35')](_0x71a3('0x36'))[_0x71a3('0x36')]();if(_[_0x71a3('0x37')](_0x3aaf63,_0x4a750c[_0x71a3('0x2c')])){return;}var _0x2376e5=_[_0x71a3('0x38')](_0x114032,[_0x71a3('0x36'),_0x4a750c['role']])['name'];return db[_0x71a3('0x39')][_0x71a3('0x2a')]({'where':{'type':_0x2376e5,'resourceId':_0x4a750c['id']}})['then'](function(){return _0x1719e6;});})[_0x71a3('0x15')](function(){_0x26fd9f[_0x71a3('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3650){return function(_0x1a7bb7){if(!_0x1a7bb7){_0x2f3650[_0x71a3('0x3a')](0x194);}return _0x1a7bb7;};}function handleError(_0x250572,_0x354147){_0x354147=_0x354147||0x1f4;return function(_0x255098){logger[_0x71a3('0x1c')](_0x255098['stack']);if(_0x255098[_0x71a3('0x3b')]){delete _0x255098[_0x71a3('0x3b')];}_0x250572[_0x71a3('0x21')](_0x354147)['send'](_0x255098);};}exports[_0x71a3('0x3c')]=function(_0x2937cf,_0x3dc1de){var _0x171902={},_0x6cea55={'count':0x0,'rows':[]};var _0x54d03b=_(db['User'][_0x71a3('0x3d')])[_0x71a3('0x35')](function(_0xbec9ad){return{'name':_0xbec9ad[_0x71a3('0x3e')],'type':_0xbec9ad[_0x71a3('0x3f')]['key']};})[_0x71a3('0x33')](function(_0x16d23c){return!_[_0x71a3('0x37')](['password',_0x71a3('0x40')],_0x16d23c['name']);})[_0x71a3('0x36')]();_0x171902=qs[_0x71a3('0x41')](_0x54d03b,_0x2937cf);var _0x46e6ce={'where':_0x171902[_0x71a3('0x42')]};return db[_0x71a3('0x43')][_0x71a3('0x26')](_0x46e6ce)[_0x71a3('0x15')](function(_0x40a18f){_0x6cea55[_0x71a3('0x26')]=_0x40a18f;if(_0x2937cf[_0x71a3('0x44')]['includeAll']){_0x171902[_0x71a3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x171902[_0x71a3('0x46')],'id')){_0x171902[_0x71a3('0x46')][_0x71a3('0x47')]('id');}return db[_0x71a3('0x43')]['findAll'](_0x171902);})[_0x71a3('0x15')](function(_0x4b4fde){_0x6cea55['rows']=_0x4b4fde;if(_0x2937cf[_0x71a3('0x44')][_0x71a3('0x48')]===_0x71a3('0x49')){var _0x1dc34b=[];for(var _0x519242=0x0;_0x519242<_0x6cea55[_0x71a3('0x4a')][_0x71a3('0x4b')];_0x519242++){_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4e'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4f'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x50'),_0x6cea55['rows'][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs('openchannel',_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x6cea55[_0x71a3('0x4a')][_0x519242]['dataValues']));}return BPromise['all'](_0x1dc34b)[_0x71a3('0x15')](function(_0x4305ee){return _0x6cea55;});}else{return _0x6cea55;}})['then'](respondWithFilteredResult(_0x3dc1de,_0x171902))[_0x71a3('0x20')](handleError(_0x3dc1de,null));};exports[_0x71a3('0x52')]=function(_0xd1d09c,_0x28378a){var _0x250e56={'raw':![],'where':{'id':_0xd1d09c['params']['id']}},_0xb0d710={};_0xb0d710[_0x71a3('0x53')]=_['differenceBy'](_[_0x71a3('0x54')](db[_0x71a3('0x43')][_0x71a3('0x3d')]),[_0x71a3('0x55'),_0x71a3('0x40')]);_0xb0d710['query']=_[_0x71a3('0x54')](_0xd1d09c[_0x71a3('0x44')]);_0xb0d710[_0x71a3('0x56')]=_['intersection'](_0xb0d710[_0x71a3('0x53')],_0xb0d710['query']);_0x250e56[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0xb0d710['model'],qs[_0x71a3('0x58')](_0xd1d09c[_0x71a3('0x44')][_0x71a3('0x58')]));_0x250e56[_0x71a3('0x46')]=_0x250e56[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x250e56[_0x71a3('0x46')]:_0xb0d710['model'];if(_0xd1d09c[_0x71a3('0x44')]['includeAll']){_0x250e56[_0x71a3('0x45')]=[{'all':!![]}];}_0x250e56=_['merge']({},_0x250e56,_0xd1d09c[_0x71a3('0x59')]);if(!_[_0x71a3('0x37')](_0x250e56[_0x71a3('0x46')],'id')){_0x250e56[_0x71a3('0x46')]['push']('id');}return db['User'][_0x71a3('0x38')](_0x250e56)[_0x71a3('0x15')](handleEntityNotFound(_0x28378a,null))[_0x71a3('0x15')](function(_0x29410d){var _0x4d9181=[];values=_0x29410d;if(_0xd1d09c['query'][_0x71a3('0x48')]===_0x71a3('0x49')){_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181['push'](get_open_tabs(_0x71a3('0x4e'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x5a'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181['push'](get_open_tabs(_0x71a3('0x4f'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs('mail',_0x29410d[_0x71a3('0x4d')]));return BPromise[_0x71a3('0x5b')](_0x4d9181);}else{return values;}})[_0x71a3('0x15')](function(_0x23988d){return values;})[_0x71a3('0x15')](respondWithResult(_0x28378a,null))[_0x71a3('0x20')](handleError(_0x28378a,null));};exports[_0x71a3('0x29')]=function(_0x302dab,_0x3ebf59){if(_0x302dab[_0x71a3('0x5c')]['id']){delete _0x302dab['body']['id'];}delete _0x302dab[_0x71a3('0x5c')][_0x71a3('0x2c')];return db['User'][_0x71a3('0x38')]({'where':{'id':_0x302dab['params']['id']}})['then'](handleEntityNotFound(_0x3ebf59,null))[_0x71a3('0x15')](saveUpdates(_0x302dab[_0x71a3('0x5c')],null))[_0x71a3('0x15')](respondWithResult(_0x3ebf59,null))[_0x71a3('0x20')](handleError(_0x3ebf59,null));};exports[_0x71a3('0x5d')]=function(_0x5cffd2,_0x121b2d){return db[_0x71a3('0x43')]['describe']()[_0x71a3('0x15')](respondWithResult(_0x121b2d,null))['catch'](handleError(_0x121b2d,null));};exports[_0x71a3('0x5e')]=function(_0x1619d3,_0x523e13){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x1619d3[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x523e13,null))[_0x71a3('0x15')](function(_0x97ed1b){if(_0x97ed1b){return _0x97ed1b[_0x71a3('0x5e')](_0x1619d3['body'][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x1619d3[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x523e13,null))[_0x71a3('0x20')](handleError(_0x523e13,null));};function validateUser(_0x1ee283){return new BPromise(function(_0x30fc7a,_0xe03bb5){if(_0x1ee283['internal'])return _0x30fc7a(_0x1ee283);return db[_0x71a3('0x62')][_0x71a3('0x63')](0x1)[_0x71a3('0x15')](function(_0x509bf7){if(_0x509bf7[_0x71a3('0x64')])authService[_0x71a3('0x65')](_0x1ee283[_0x71a3('0x55')]);db[_0x71a3('0x43')][_0x71a3('0x66')](_0x71a3('0x67'))[_0x71a3('0x15')](function(_0xea64e6){if(_[_0x71a3('0x68')](_0xea64e6)){_0x1ee283['internal']=_0x509bf7[_0x71a3('0x69')]||0x1;return;}if(_['isNil'](_0x509bf7[_0x71a3('0x69')])||_0x509bf7['min_internal']===_0xea64e6){_0x1ee283['internal']=_0xea64e6+0x1;return;}if(_0x509bf7[_0x71a3('0x69')]>_0xea64e6){_0x1ee283['internal']=_0x509bf7[_0x71a3('0x69')];return;}return db[_0x71a3('0x6a')][_0x71a3('0x44')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x71a3('0x6a')][_0x71a3('0x6b')]['SELECT']})[_0x71a3('0x15')](function(_0x189320){if(_0x189320&&_0x189320[_0x71a3('0x4b')]){for(var _0x1450cc=0x0,_0x4430f2=_0x189320[_0x71a3('0x4b')];_0x1450cc<_0x4430f2&&_[_0x71a3('0x68')](_0x1ee283[_0x71a3('0x67')]);_0x1450cc++){if(_0x509bf7['min_internal']<=_0x189320[_0x1450cc]['from']){_0x1ee283[_0x71a3('0x67')]=_0x189320[_0x1450cc][_0x71a3('0x6c')];}else if(_0x509bf7[_0x71a3('0x69')]>_0x189320[_0x1450cc]['from']&&_0x509bf7[_0x71a3('0x69')]<=_0x189320[_0x1450cc]['to']){_0x1ee283[_0x71a3('0x67')]=_0x509bf7['min_internal'];}}}if(_[_0x71a3('0x68')](_0x1ee283['internal'])){_0x1ee283[_0x71a3('0x67')]=_0xea64e6+0x1;}return _0x30fc7a(_0x1ee283);});});})[_0x71a3('0x20')](function(_0x765b9c){_0xe03bb5(_0x765b9c);});});}function updateUser(_0x184389){return new BPromise(function(_0x528c4b,_0x7c9e78){try{if(_0x184389[_0x71a3('0x6d')]){_0x184389['mailbox']=_0x184389[_0x71a3('0x67')];_0x184389[_0x71a3('0x6e')]={'mailbox':_0x184389[_0x71a3('0x67')],'password':_0x184389[_0x71a3('0x55')],'fullname':_0x184389[_0x71a3('0x6f')],'email':_0x184389[_0x71a3('0x70')]};}if(_0x184389[_0x71a3('0x2c')]===_0x71a3('0x71')){if(!_0x184389[_0x71a3('0x72')])_0x184389[_0x71a3('0x72')]=[_0x71a3('0x73'),_0x71a3('0x74'),'103',_0x71a3('0x75'),'110',_0x71a3('0x76'),_0x71a3('0x77'),_0x71a3('0x78'),_0x71a3('0x79'),_0x71a3('0x7a'),_0x71a3('0x7b'),_0x71a3('0x7c'),_0x71a3('0x7d'),_0x71a3('0x7e'),_0x71a3('0x7f')];}_0x528c4b(_0x184389);}catch(_0x365f5a){_0x7c9e78(_0x365f5a);}});}exports[_0x71a3('0x80')]=function(_0x316641,_0x18a3ae){if(_0x316641[_0x71a3('0x2f')][_0x71a3('0x2c')]===_0x71a3('0x71'))throw new Error(_0x71a3('0x81'));if(_0x316641[_0x71a3('0x5c')]['role']===_0x71a3('0x2f')&&_0x316641[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2d')){throw new Error(_0x71a3('0x82'));}if(_0x316641[_0x71a3('0x5c')][_0x71a3('0x2c')]==='admin'&&_0x316641[_0x71a3('0x2f')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x316641['body']])['then'](function(){return validateUser(_0x316641[_0x71a3('0x5c')]);})[_0x71a3('0x15')](function(_0x133994){return updateUser(_0x133994)[_0x71a3('0x15')](function(_0x17e205){if(_0x17e205[_0x71a3('0x2c')]===_0x71a3('0x2d')){_0x17e205[_0x71a3('0x83')]=_0x316641[_0x71a3('0x2f')][_0x71a3('0x83')];delete _0x17e205[_0x71a3('0x84')];}return _0x17e205;});})[_0x71a3('0x15')](function(_0x26fa56){return db['User'][_0x71a3('0x80')](_0x26fa56,{'include':[{'model':db[_0x71a3('0x6e')],'as':_0x71a3('0x6e')}]});})[_0x71a3('0x15')](function(_0x38f928){if(_0x316641[_0x71a3('0x5c')]['role']==='user')return _0x38f928;if(_0x316641['user'][_0x71a3('0x2c')]!==_0x71a3('0x2f'))return _0x38f928;return db[_0x71a3('0x85')]['find']({'where':{'name':_0x38f928[_0x71a3('0x2c')]===_0x71a3('0x71')?_0x71a3('0x30'):_0x71a3('0x31'),'userProfileId':_0x316641[_0x71a3('0x2f')][_0x71a3('0x84')]},'raw':!![]})[_0x71a3('0x15')](function(_0x28c184){if(!_0x28c184||_0x28c184[_0x71a3('0x86')]!=0x0)return _0x38f928;return db['UserProfileResource'][_0x71a3('0x80')]({'name':_0x38f928[_0x71a3('0x3b')],'resourceId':_0x38f928['id'],'type':_0x28c184['name'],'sectionId':_0x28c184['id']},{})[_0x71a3('0x15')](function(){return _0x38f928;});})['catch'](function(_0x2d3b17){logger[_0x71a3('0x1c')](_0x71a3('0x87'),_0x2d3b17);throw _0x2d3b17;});})[_0x71a3('0x15')](respondWithResult(_0x18a3ae,0xc9))[_0x71a3('0x20')](handleError(_0x18a3ae,null));};exports['bulkCreate']=function(_0x471c80,_0x1bca59){var _0x51a48f=_0x471c80[_0x71a3('0x5c')];var _0x358853=[];if(_0x471c80[_0x71a3('0x2f')]['role']===_0x71a3('0x71'))throw new Error(_0x71a3('0x81'));if(_[_0x71a3('0x88')](_0x51a48f,['role','user'])&&_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x71a3('0x88')](_0x51a48f,['role',_0x71a3('0x2d')])&&_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!=='admin'){throw new Error(_0x71a3('0x89'));}return licenseUtil['checkUserLimits'](_0x51a48f)[_0x71a3('0x15')](function(){return validateUser(_0x51a48f[0x0]);})[_0x71a3('0x15')](function(){for(var _0x333ab6=0x1;_0x333ab6<_0x51a48f[_0x71a3('0x4b')];_0x333ab6++){var _0x4713a3=_0x51a48f[_0x333ab6-0x1]['internal'];if(!_0x51a48f[_0x333ab6][_0x71a3('0x67')])_0x51a48f[_0x333ab6][_0x71a3('0x67')]=_0x4713a3+0x1;_0x358853['push'](validateUser(_0x51a48f[_0x333ab6]));}return BPromise['all'](_0x358853);})[_0x71a3('0x15')](function(){_0x358853=[];for(var _0xbd5fcc=0x0;_0xbd5fcc<_0x51a48f[_0x71a3('0x4b')];_0xbd5fcc++){_0x358853['push'](updateUser(_0x51a48f[_0xbd5fcc]));}return BPromise[_0x71a3('0x5b')](_0x358853);})[_0x71a3('0x15')](function(){return BPromise[_0x71a3('0x8a')](_0x51a48f,function(_0x2fab3e){return db[_0x71a3('0x43')][_0x71a3('0x80')](_0x2fab3e,{'include':[{'model':db[_0x71a3('0x6e')],'as':'VoiceMail'}]})[_0x71a3('0x15')](function(_0xd87f34){_0x2fab3e['id']=_0xd87f34['id'];return _0x2fab3e;});});})[_0x71a3('0x15')](function(_0x2fc088){if(_0x471c80['body'][_0x71a3('0x2c')]===_0x71a3('0x2f'))return _0x2fc088;if(_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2f'))return _0x2fc088;var _0x220299=_[_0x71a3('0x88')](_0x2fc088,function(_0xd79454){return _0xd79454['role']===_0x71a3('0x71')||_0xd79454['role']===_0x71a3('0x32');});if(!_0x220299)return _0x2fc088;return db[_0x71a3('0x85')][_0x71a3('0x8b')]({'where':{'name':{'$or':[_0x71a3('0x30'),'Telephones']},'userProfileId':_0x471c80['user']['userProfileId']},'raw':!![]})[_0x71a3('0x15')](function(_0x38d740){if(_[_0x71a3('0x8c')](_0x38d740)||!_[_0x71a3('0x88')](_0x38d740,[_0x71a3('0x86'),0x0]))return _0x2fc088;_0x358853=[];var _0x11014c=_(_0x38d740)[_0x71a3('0x35')](function(_0x14919d){if(_0x14919d[_0x71a3('0x86')]===0x1)return;return _0x14919d[_0x71a3('0x3b')]==='Agents'?_0x71a3('0x71'):_0x71a3('0x32');})[_0x71a3('0x8d')]()[_0x71a3('0x36')]();for(var _0x43aab6=0x0;_0x43aab6<_0x2fc088[_0x71a3('0x4b')];_0x43aab6++){if(!_['includes'](_0x11014c,_0x2fc088[_0x43aab6][_0x71a3('0x2c')]))return;var _0x5ee509=_0x2fc088[_0x43aab6][_0x71a3('0x2c')]==='agent'?_0x71a3('0x30'):_0x71a3('0x31');_0x358853['push'](db[_0x71a3('0x39')]['create']({'name':_0x2fc088[_0x43aab6][_0x71a3('0x3b')],'resourceId':_0x2fc088[_0x43aab6]['id'],'type':_0x5ee509,'sectionId':_['find'](_0x38d740,[_0x71a3('0x3b'),_0x5ee509])['id']},{}));}return BPromise[_0x71a3('0x5b')](_0x358853);});})['then'](respondWithResult(_0x1bca59,0xc9))[_0x71a3('0x20')](handleError(_0x1bca59,null));};exports[_0x71a3('0x8e')]=function(_0x31bbd9,_0xf0bded){if(_0x31bbd9[_0x71a3('0x5c')]['id']){delete _0x31bbd9[_0x71a3('0x5c')]['id'];}return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x31bbd9['params']['id']}})[_0x71a3('0x15')](function(_0x1435f8){if(!_0x1435f8)return null;if(_0x1435f8['id']===_0x31bbd9[_0x71a3('0x2f')]['id']){if(!_0x31bbd9['body'][_0x71a3('0x8f')]||!_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')]){throw new db['Sequelize']['ValidationError'](_0x71a3('0x91'));}if(!_0x1435f8[_0x71a3('0x92')](_0x31bbd9['body'][_0x71a3('0x8f')])){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x95'));}if(_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x8f')]===_0x31bbd9[_0x71a3('0x5c')]['newPassword']){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x31bbd9['user'][_0x71a3('0x2c')]===_0x71a3('0x2d')){if(!_0x31bbd9['body'][_0x71a3('0x90')]){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x31bbd9['user'][_0x71a3('0x2c')]===_0x71a3('0x2f')){if(!_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')]){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x96'));}if(_0x1435f8[_0x71a3('0x2c')]!==_0x71a3('0x71')){throw new db['Sequelize'][(_0x71a3('0x94'))]('Unauthorized');}}else{throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x81'));}return _0x1435f8;})[_0x71a3('0x15')](handleEntityNotFound(_0xf0bded,null))['then'](function(_0x500bd9){return db[_0x71a3('0x62')][_0x71a3('0x97')]({'attributes':['id',_0x71a3('0x64'),_0x71a3('0x98'),'passwordHistoryLimit']})[_0x71a3('0x15')](function(_0x609352){if(_0x609352['securePassword'])authService[_0x71a3('0x65')](_0x31bbd9['body'][_0x71a3('0x90')]);if(!_0x609352[_0x71a3('0x98')]||!_0x500bd9[_0x71a3('0x99')])return _0x500bd9;authService[_0x71a3('0x9a')](_0x31bbd9[_0x71a3('0x5c')]['newPassword'],_0x500bd9[_0x71a3('0x99')],_0x609352['passwordHistoryLimit']);return _0x500bd9;})[_0x71a3('0x15')](saveUpdates({'password':_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')],'passwordResetAt':_0x31bbd9[_0x71a3('0x2f')]['id']==_0x31bbd9[_0x71a3('0x5f')]['id']?moment():null,'previousPasswords':authService[_0x71a3('0x9b')](_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')],_0x500bd9[_0x71a3('0x99')])},null));})[_0x71a3('0x15')](respondWithResult(_0xf0bded,null))[_0x71a3('0x20')](handleError(_0xf0bded,null));};exports[_0x71a3('0x9c')]=function(_0x3d1710,_0x17951c){var _0x5ea267=_0x3d1710['body']['channel'];return db[_0x71a3('0x43')]['find']({'where':{'id':_0x3d1710[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c'),_0x71a3('0x9d'),'loginInPause',_0x71a3('0x9e'),_0x71a3('0x9f')]})[_0x71a3('0x15')](handleEntityNotFound(_0x17951c,null))[_0x71a3('0x15')](function(_0x29e932){if(_0x29e932){if(!utils[_0x71a3('0xa0')](_0x5ea267)){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0xa1'));}return _0x29e932['add'+_[_0x71a3('0xa2')](_0x5ea267['toLowerCase']())+'Queues'](_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')],{'penalty':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0xa3')]||0x0})[_0x71a3('0xa4')](function(_0x125bd4){for(var _0x57edb2=0x0;_0x57edb2<_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x57edb2+=0x1){var _0x47167a={'UserId':Number(_0x3d1710[_0x71a3('0x5f')]['id'])};_0x47167a[_[_0x71a3('0xa2')](_0x5ea267['toLowerCase']())+'QueueId']=Number(_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')][_0x57edb2]);socket[_0x71a3('0xa5')]('user'+_[_0x71a3('0xa2')](_0x5ea267[_0x71a3('0xa6')]())+_0x71a3('0xa7'),_0x47167a);}return _0x125bd4;})['then'](function(){if(_0x5ea267==='voice'){return db[_0x71a3('0xa8')][_0x71a3('0x8b')]({'where':{'id':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')]||[]},'raw':!![],'attributes':['id',_0x71a3('0x3b')]});}})[_0x71a3('0x15')](function(_0xa539cc){var _0x47cd2f=_0x29e932[_0x71a3('0x2b')]({'plain':!![]});var _0x34582b=[];if(_0x5ea267===_0x71a3('0xa9')&&_0x47cd2f[_0x71a3('0x2c')]===_0x71a3('0x71')&&_0x47cd2f[_0x71a3('0x9d')]){for(var _0x3a66f8=0x0;_0x3a66f8<_0xa539cc[_0x71a3('0x4b')];_0x3a66f8+=0x1){_0x34582b[_0x71a3('0x47')]({'membername':_0x47cd2f[_0x71a3('0x3b')],'UserId':_0x47cd2f['id'],'queue_name':_0xa539cc[_0x3a66f8][_0x71a3('0x3b')],'VoiceQueueId':_0xa539cc[_0x3a66f8]['id'],'interface':_[_0x71a3('0x68')](_0x47cd2f[_0x71a3('0x9f')])?util[_0x71a3('0xaa')](_0x71a3('0xab'),_0x47cd2f['name']):_0x47cd2f[_0x71a3('0x9f')],'paused':_0x47cd2f[_0x71a3('0x9e')]||![],'penalty':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0xa3')]||0x0});}return BPromise[_0x71a3('0x8a')](_0x34582b,function(_0x35a51f){return db[_0x71a3('0xac')][_0x71a3('0xad')](_0x35a51f);});}return _0x29e932;});}})[_0x71a3('0x15')](respondWithStatusCode(_0x17951c,null))[_0x71a3('0x20')](handleError(_0x17951c,null));};exports[_0x71a3('0xae')]=function(_0xbe2360,_0x1b6c9b){var _0x22873;return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0xbe2360['params']['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c')]})[_0x71a3('0x15')](handleEntityNotFound(_0x1b6c9b,null))[_0x71a3('0x15')](function(_0x56a85a){if(_0x56a85a){_0x22873=_0x56a85a;if(!_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')]||!utils[_0x71a3('0xa0')](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')])){throw new db[(_0x71a3('0x93'))]['ValidationError']('Unknown\x20channel');}return _0x56a85a[_0x71a3('0xb0')+_['capitalize'](_0xbe2360['query'][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb1')](_0xbe2360[_0x71a3('0x44')]['ids']);}})[_0x71a3('0x15')](function(_0x169408){if(_['isArray'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')])){for(var _0x3965d1=0x0;_0x3965d1<_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x3965d1+=0x1){var _0x410c41={'UserId':Number(_0xbe2360[_0x71a3('0x5f')]['id'])};_0x410c41[_[_0x71a3('0xa2')](_0xbe2360[_0x71a3('0x44')]['channel'][_0x71a3('0xa6')]())+_0x71a3('0xb2')]=Number(_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')][_0x3965d1]);socket[_0x71a3('0xa5')]('user'+_[_0x71a3('0xa2')](_0xbe2360['query']['channel'][_0x71a3('0xa6')]())+_0x71a3('0xb3'),_0x410c41);}}else{var _0x410c41={'UserId':Number(_0xbe2360['params']['id'])};_0x410c41[_['capitalize'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb2')]=Number(_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')]);socket[_0x71a3('0xa5')](_0x71a3('0x2f')+_['capitalize'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb3'),_0x410c41);}return _0x169408;})['then'](function(){if(_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')]==='voice'){return db[_0x71a3('0xac')][_0x71a3('0x2a')]({'where':{'UserId':_0xbe2360[_0x71a3('0x5f')]['id'],'VoiceQueueId':_0xbe2360['query'][_0x71a3('0x60')]},'individualHooks':!![]})[_0x71a3('0x15')](function(){return _0x22873;});}return _0x22873;})['then'](respondWithStatusCode(_0x1b6c9b,null))[_0x71a3('0x20')](handleError(_0x1b6c9b,null));};exports[_0x71a3('0xb4')]=function(_0x39965e,_0x13b1f7){_0x39965e[_0x71a3('0x5c')][_0x71a3('0xb5')]=_0x39965e[_0x71a3('0xb6')][_0x71a3('0xb7')];return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x39965e[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x13b1f7,null))[_0x71a3('0x15')](saveUpdates(_0x39965e[_0x71a3('0x5c')],null))[_0x71a3('0x15')](respondWithResult(_0x13b1f7,null))[_0x71a3('0x20')](handleError(_0x13b1f7,null));};exports['getAvatar']=function(_0x3a3f78,_0x39939d){var _0x13741a=path['join'](config[_0x71a3('0xb8')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x3a3f78[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0xb5')],'raw':!![]})[_0x71a3('0x15')](handleEntityNotFound(_0x39939d,null))[_0x71a3('0x15')](function(_0x3eb84f){if(_0x3eb84f){if(_[_0x71a3('0x68')](_0x3eb84f[_0x71a3('0xb5')])){return _0x39939d[_0x71a3('0xb9')](_0x13741a);}else{if(!fs[_0x71a3('0xba')](path[_0x71a3('0xbb')](config[_0x71a3('0xb8')],_0x71a3('0xbc'),_0x3eb84f[_0x71a3('0xb5')]))){return _0x39939d[_0x71a3('0xb9')](_0x13741a);}return _0x39939d[_0x71a3('0xb9')](path['join'](config[_0x71a3('0xb8')],_0x71a3('0xbc'),_0x3eb84f[_0x71a3('0xb5')]));}}})[_0x71a3('0x20')](handleError(_0x39939d,null));};exports['getOpenTabs']=function(_0x379c00,_0x18a69d){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x379c00[_0x71a3('0x5f')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x18a69d,null))[_0x71a3('0x15')](function(_0x37a598){var _0x44bb40=[];values=_0x37a598[_0x71a3('0x4d')];_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40['push'](get_open_tabs(_0x71a3('0x4e'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x5a'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x37a598['dataValues']));_0x44bb40['push'](get_open_tabs(_0x71a3('0x4f'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x50'),_0x37a598[_0x71a3('0x4d')]));return BPromise['all'](_0x44bb40);})['then'](function(_0x3aebc8){var _0x40395d=[];if(_0x3aebc8){for(var _0x38594a=0x0;_0x38594a=_0x5d3efe[_0x23da('0x55')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x42981e){return db[_0x23da('0x42')][_0x23da('0x4e')]({'where':{'membername':_0x42981e[_0x23da('0x2a')]},'individualHooks':!![]});}})[_0x23da('0x11')](function(){if(_0x42981e){return _0x42981e['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x4aaf3f){if(_0x42981e){if(_0x4aaf3f){var _0x33d68a=[];_0x50b1fe=_0x4aaf3f;if(_0x50b1fe[_0x23da('0x2f')]){for(var _0x455caf=0x0;_0x455caf<_0x50b1fe[_0x23da('0x2f')];_0x455caf++){_0x33d68a['push'](db[_0x23da('0x42')][_0x23da('0x56')]({'membername':_0x42981e[_0x23da('0x2a')],'UserId':_0x42981e['id'],'queue_name':_0x50b1fe[_0x455caf][_0x23da('0x2a')],'VoiceQueueId':_0x50b1fe[_0x455caf]['id'],'interface':_0x4637bb,'paused':_0x42981e[_0x23da('0x52')]||![],'penalty':_0x50b1fe[_0x455caf][_0x23da('0x57')]||0x0}));}return BPromise[_0x23da('0x58')](_0x33d68a);}}}})[_0x23da('0x11')](function(){if(_0x42981e){return db['MemberReport']['findAll']({'where':{'membername':_0x42981e[_0x23da('0x2a')],'exitAt':null}});}})[_0x23da('0x11')](function(_0x571d8e){if(_0x42981e){if(_0x571d8e&&_0x571d8e[_0x23da('0x2f')]){var _0x451169=[];_0x571d8e['forEach'](function(_0x212cd0){_0x451169[_0x23da('0x33')](_0x212cd0[_0x23da('0x2d')]({'exitAt':moment()[_0x23da('0x36')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x23da('0x58')](_0x451169);}}})[_0x23da('0x11')](function(_0x3f95e9){if(_0x42981e){var _0x57ff47=[];var _0x53cd0d=[];var _0x4d1164=utils['getChannels']();var _0x175cf3={'membername':_0x42981e[_0x23da('0x2a')],'interface':_0x4637bb,'enterAt':moment()[_0x23da('0x36')](_0x23da('0x30')),'role':_0x42981e[_0x23da('0x2b')],'internal':_0x42981e[_0x23da('0x2c')]};_0x4d1164[_0x23da('0x32')](function(_0x1c8719){_0x57ff47[_0x23da('0x33')](_[_0x23da('0x59')]({'channel':_0x1c8719,'type':'LOGIN','data1':'callysquare','data2':_0x4637bb},_0x175cf3));if(_0x42981e[_0x23da('0x52')]){_0x53cd0d[_0x23da('0x33')](_[_0x23da('0x59')]({'channel':_0x1c8719,'type':_0x23da('0x49'),'data1':_0x23da('0x5a')},_0x175cf3));}});return db[_0x23da('0x2e')]['bulkCreate'](_0x57ff47[_0x23da('0x5b')](_0x53cd0d),{'individualHooks':!![]});}})['then'](function(){if(_0x42981e){return _0x42981e['update']({'online':!![],'lastLoginAt':moment()[_0x23da('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x42981e['loginInPause']||![],'mailPause':_0x42981e[_0x23da('0x52')]||![],'chatPause':_0x42981e['loginInPause']||![],'faxPause':_0x42981e[_0x23da('0x52')]||![],'smsPause':_0x42981e['loginInPause']||![],'openchannelPause':_0x42981e[_0x23da('0x52')]||![],'pauseType':_0x42981e[_0x23da('0x52')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x23da('0x36')](_0x23da('0x30')),'interface':_0x4637bb});}})[_0x23da('0x11')](function(_0x14c56a){_0x234365(_0x14c56a);})[_0x23da('0x1c')](function(_0x3eb198){_0x268be1(_0x466f9b[_0x23da('0x18')](0x1f4,_0x3eb198[_0x23da('0x1a')]));});});}; \ No newline at end of file +var _0xded6=['redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetUser','User','findAll','options','raw','where','limit','include','model','attributes','map','ShowUser','find','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','isValidChannel','channel','Unknown\x20channel','voice','system','fax','whatsapp','set','%s%s','Pause','push','all','LogoutUser','findOne','destroy','LoginUser','mobile','phone','SIP/%s','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','callysquare','loginInPause','LOGININPAUSE','bulkCreate','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3d30d6,_0x1023da){var _0x470a1e=function(_0x3e17c0){while(--_0x3e17c0){_0x3d30d6['push'](_0x3d30d6['shift']());}};_0x470a1e(++_0x1023da);}(_0xded6,0x168));var _0x6ded=function(_0x1b9c4d,_0x503c50){_0x1b9c4d=_0x1b9c4d-0x0;var _0x135f64=_0xded6[_0x1b9c4d];return _0x135f64;};'use strict';var _=require('lodash');var util=require(_0x6ded('0x0'));var moment=require(_0x6ded('0x1'));var BPromise=require(_0x6ded('0x2'));var rs=require(_0x6ded('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ded('0x4'))['db'];var utils=require(_0x6ded('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ded('0x6'));var jayson=require(_0x6ded('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x6ded('0x8')]=_[_0x6ded('0x9')](config[_0x6ded('0x8')],{'host':_0x6ded('0xa'),'port':0x18eb});var socket=require(_0x6ded('0xb'))(new Redis(config['redis']));require(_0x6ded('0xc'))[_0x6ded('0xd')](socket);function respondWithRpcPromise(_0x3f79f3,_0x488b5f,_0x218db3){return new BPromise(function(_0x4ff17d,_0x428b1a){return client[_0x6ded('0xe')](_0x3f79f3,_0x218db3)[_0x6ded('0xf')](function(_0x4c67f3){logger['info'](_0x6ded('0x10'),_0x488b5f,_0x6ded('0x11'));logger[_0x6ded('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x488b5f,_0x6ded('0x11'),JSON[_0x6ded('0x13')](_0x4c67f3));if(_0x4c67f3[_0x6ded('0x14')]){if(_0x4c67f3[_0x6ded('0x14')][_0x6ded('0x15')]===0x1f4){logger['error'](_0x6ded('0x10'),_0x488b5f,_0x4c67f3[_0x6ded('0x14')]['message']);return _0x428b1a(_0x4c67f3[_0x6ded('0x14')][_0x6ded('0x16')]);}logger[_0x6ded('0x14')](_0x6ded('0x10'),_0x488b5f,_0x4c67f3['error']['message']);return _0x4ff17d(_0x4c67f3['error'][_0x6ded('0x16')]);}else{logger[_0x6ded('0x17')](_0x6ded('0x10'),_0x488b5f,_0x6ded('0x11'));_0x4ff17d(_0x4c67f3[_0x6ded('0x18')][_0x6ded('0x16')]);}})[_0x6ded('0x19')](function(_0x1d08dc){logger['error'](_0x6ded('0x10'),_0x488b5f,_0x1d08dc);_0x428b1a(_0x1d08dc);});});}exports[_0x6ded('0x1a')]=function(_0x18edfb){var _0x387f30=this;return new Promise(function(_0x297883,_0x123814){return db[_0x6ded('0x1b')][_0x6ded('0x1c')]({'raw':_0x18edfb[_0x6ded('0x1d')]?_0x18edfb[_0x6ded('0x1d')][_0x6ded('0x1e')]===undefined?!![]:![]:!![],'where':_0x18edfb[_0x6ded('0x1d')]?_0x18edfb[_0x6ded('0x1d')][_0x6ded('0x1f')]||null:null,'attributes':_0x18edfb[_0x6ded('0x1d')]?_0x18edfb[_0x6ded('0x1d')]['attributes']||null:null,'limit':_0x18edfb[_0x6ded('0x1d')]?_0x18edfb[_0x6ded('0x1d')][_0x6ded('0x20')]||null:null,'include':_0x18edfb[_0x6ded('0x1d')]?_0x18edfb[_0x6ded('0x1d')][_0x6ded('0x21')]?_['map'](_0x18edfb['options'][_0x6ded('0x21')],function(_0x3e4bc0){return{'model':db[_0x3e4bc0[_0x6ded('0x22')]],'as':_0x3e4bc0['as'],'attributes':_0x3e4bc0[_0x6ded('0x23')],'include':_0x3e4bc0['include']?_['map'](_0x3e4bc0[_0x6ded('0x21')],function(_0x8d10cc){return{'model':db[_0x8d10cc[_0x6ded('0x22')]],'as':_0x8d10cc['as'],'attributes':_0x8d10cc[_0x6ded('0x23')],'include':_0x8d10cc[_0x6ded('0x21')]?_[_0x6ded('0x24')](_0x8d10cc[_0x6ded('0x21')],function(_0x28ceed){return{'model':db[_0x28ceed[_0x6ded('0x22')]],'as':_0x28ceed['as'],'attributes':_0x28ceed[_0x6ded('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6ded('0xf')](function(_0x2426cc){logger[_0x6ded('0x17')]('GetUser',_0x18edfb);logger[_0x6ded('0x12')]('GetUser',_0x18edfb,JSON[_0x6ded('0x13')](_0x2426cc));_0x297883(_0x2426cc);})[_0x6ded('0x19')](function(_0x1c8771){logger[_0x6ded('0x14')](_0x6ded('0x1a'),_0x1c8771[_0x6ded('0x16')],_0x18edfb);_0x123814(_0x387f30['error'](0x1f4,_0x1c8771[_0x6ded('0x16')]));});});};exports[_0x6ded('0x25')]=function(_0x3a7108){var _0x5408a4=this;return new Promise(function(_0x326b81,_0x2e2294){return db[_0x6ded('0x1b')][_0x6ded('0x26')]({'raw':_0x3a7108[_0x6ded('0x1d')]?_0x3a7108[_0x6ded('0x1d')][_0x6ded('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a7108[_0x6ded('0x1d')]?_0x3a7108[_0x6ded('0x1d')][_0x6ded('0x1f')]||null:null,'attributes':_0x3a7108[_0x6ded('0x1d')]?_0x3a7108[_0x6ded('0x1d')][_0x6ded('0x23')]||null:null,'include':_0x3a7108[_0x6ded('0x1d')]?_0x3a7108[_0x6ded('0x1d')][_0x6ded('0x21')]?_[_0x6ded('0x24')](_0x3a7108['options']['include'],function(_0x431690){return{'model':db[_0x431690['model']],'as':_0x431690['as'],'attributes':_0x431690[_0x6ded('0x23')],'include':_0x431690['include']?_[_0x6ded('0x24')](_0x431690[_0x6ded('0x21')],function(_0x1b71ff){return{'model':db[_0x1b71ff['model']],'as':_0x1b71ff['as'],'attributes':_0x1b71ff[_0x6ded('0x23')],'include':_0x1b71ff[_0x6ded('0x21')]?_['map'](_0x1b71ff[_0x6ded('0x21')],function(_0x59a16b){return{'model':db[_0x59a16b[_0x6ded('0x22')]],'as':_0x59a16b['as'],'attributes':_0x59a16b[_0x6ded('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6ded('0xf')](function(_0x574306){logger[_0x6ded('0x17')](_0x6ded('0x25'),_0x3a7108);logger[_0x6ded('0x12')](_0x6ded('0x25'),_0x3a7108,JSON[_0x6ded('0x13')](_0x574306));_0x326b81(_0x574306);})[_0x6ded('0x19')](function(_0x139cac){logger[_0x6ded('0x14')]('ShowUser',_0x139cac[_0x6ded('0x16')],_0x3a7108);_0x2e2294(_0x5408a4[_0x6ded('0x14')](0x1f4,_0x139cac[_0x6ded('0x16')]));});});};exports[_0x6ded('0x27')]=function(_0x5e03e1){var _0x156f10=this;return new Promise(function(_0x442f79,_0x34b88a){var _0xe0b7c1;return db[_0x6ded('0x1b')][_0x6ded('0x26')]({'where':_0x5e03e1[_0x6ded('0x1d')][_0x6ded('0x1f')]||{},'attributes':['id',_0x6ded('0x28'),_0x6ded('0x29'),_0x6ded('0x2a'),_0x6ded('0x2b')]})[_0x6ded('0xf')](function(_0x493ca1){if(_0x493ca1){_0xe0b7c1=_0x493ca1;return db[_0x6ded('0x2c')][_0x6ded('0x2d')]({'paused':0x1},{'where':{'UserId':_0xe0b7c1['id']},'individualHooks':!![]});}})[_0x6ded('0xf')](function(){if(_0xe0b7c1){return db[_0x6ded('0x2e')][_0x6ded('0x1c')]({'where':{'membername':_0xe0b7c1[_0x6ded('0x28')],'type':_0x6ded('0x2f'),'exitAt':null}});}})['then'](function(_0x54de5a){if(_0xe0b7c1){if(_0x54de5a&&_0x54de5a[_0x6ded('0x30')]){var _0x296851=moment()[_0x6ded('0x31')](_0x6ded('0x32'));for(var _0x58bc59=0x0,_0x2f1d4e=_0x54de5a[_0x6ded('0x30')];_0x58bc59<_0x2f1d4e;_0x58bc59++){_0x54de5a[_0x58bc59][_0x6ded('0x33')]({'exitAt':_0x296851});}}}})['then'](function(){if(_0xe0b7c1){var _0xb35460=[];var _0x1fd21b=utils[_0x6ded('0x34')]();_0x1fd21b[_0x6ded('0x35')](function(_0x448ea4){_0xb35460['push']({'channel':_0x448ea4,'membername':_0xe0b7c1['name'],'interface':_[_0x6ded('0x36')](_0xe0b7c1[_0x6ded('0x2b')])?util[_0x6ded('0x31')]('SIP/%s',_0xe0b7c1['name']):_0xe0b7c1[_0x6ded('0x2b')],'type':_0x6ded('0x2f'),'enterAt':moment()[_0x6ded('0x31')](_0x6ded('0x32')),'data1':_0x5e03e1[_0x6ded('0x37')][_0x6ded('0x38')]||_0x6ded('0x39'),'role':_0xe0b7c1[_0x6ded('0x29')],'internal':_0xe0b7c1['internal'],'uniqueid':_0x5e03e1[_0x6ded('0x37')][_0x6ded('0x3a')]||null});});return db[_0x6ded('0x2e')]['bulkCreate'](_0xb35460,{'individualHooks':!![]});}})[_0x6ded('0xf')](function(){if(_0xe0b7c1){return _0xe0b7c1[_0x6ded('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5e03e1[_0x6ded('0x37')][_0x6ded('0x38')]||_0x6ded('0x39'),'lastPauseAt':moment()[_0x6ded('0x31')](_0x6ded('0x32'))});}})['then'](function(_0xe7d462){_0x442f79(_0xe7d462);})[_0x6ded('0x19')](function(_0x2f03c4){_0x34b88a(_0x156f10[_0x6ded('0x14')](0x1f4,_0x2f03c4[_0x6ded('0x16')]));});});};exports[_0x6ded('0x3b')]=function(_0x35a9c8){var _0x1478f5=this;return new Promise(function(_0x2fd292,_0x170b8e){var _0x36cdcc;return db['User']['findOne']({'where':_0x35a9c8[_0x6ded('0x1d')][_0x6ded('0x1f')]||{},'attributes':['id',_0x6ded('0x28')]})[_0x6ded('0xf')](function(_0x5b6840){if(_0x5b6840){_0x36cdcc=_0x5b6840;if(_0x35a9c8[_0x6ded('0x37')]['channel']&&!utils[_0x6ded('0x3c')](_0x35a9c8[_0x6ded('0x37')][_0x6ded('0x3d')])){throw new Error(_0x6ded('0x3e'));}switch(_0x35a9c8[_0x6ded('0x37')][_0x6ded('0x3d')]){case _0x6ded('0x3f'):return db[_0x6ded('0x2c')][_0x6ded('0x2d')]({'paused':0x0},{'where':{'UserId':_0x36cdcc['id']}})[_0x6ded('0xf')](function(){return db[_0x6ded('0x2e')]['find']({'where':{'channel':_0x35a9c8[_0x6ded('0x37')][_0x6ded('0x3d')],'membername':_0x36cdcc['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x247ea0){if(_0x247ea0){return _0x247ea0['update']({'exitAt':moment()[_0x6ded('0x31')](_0x6ded('0x32')),'data2':_0x6ded('0x40')},{'individualHooks':!![]});}return null;})[_0x6ded('0xf')](function(){return _0x36cdcc[_0x6ded('0x2d')]({'voicePause':![]});});case'mail':case'chat':case _0x6ded('0x41'):case'sms':case'openchannel':case _0x6ded('0x42'):return db[_0x6ded('0x2e')]['find']({'where':{'channel':_0x35a9c8['body'][_0x6ded('0x3d')],'membername':_0x36cdcc[_0x6ded('0x28')],'type':_0x6ded('0x2f'),'exitAt':null}})[_0x6ded('0xf')](function(_0x393bc1){return _0x393bc1['update']({'exitAt':moment()[_0x6ded('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6ded('0x40')},{'individualHooks':!![]});})['then'](function(){var _0x509733={};_[_0x6ded('0x43')](_0x509733,util['format'](_0x6ded('0x44'),_0x35a9c8['body'][_0x6ded('0x3d')],_0x6ded('0x45')),![]);return _0x36cdcc[_0x6ded('0x2d')](_0x509733);});default:return db['UserVoiceQueueRt'][_0x6ded('0x2d')]({'paused':0x0},{'where':{'UserId':_0x36cdcc['id']}})[_0x6ded('0xf')](function(){return db['MemberReport'][_0x6ded('0x1c')]({'where':{'membername':_0x36cdcc[_0x6ded('0x28')],'type':'PAUSE','exitAt':null}});})[_0x6ded('0xf')](function(_0x49e935){var _0xcfbe48=[];_0x49e935[_0x6ded('0x35')](function(_0x42c370){_0xcfbe48[_0x6ded('0x46')](_0x42c370[_0x6ded('0x2d')]({'exitAt':moment()['format'](_0x6ded('0x32')),'data2':_0x6ded('0x40')}));});return BPromise[_0x6ded('0x47')](_0xcfbe48);})['then'](function(){return _0x36cdcc[_0x6ded('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x4e509f){_0x2fd292(_0x4e509f);})[_0x6ded('0x19')](function(_0x287715){_0x170b8e(_0x1478f5[_0x6ded('0x14')](0x1f4,_0x287715[_0x6ded('0x16')]));});});};exports[_0x6ded('0x48')]=function(_0x40ae44){var _0x174bf2=this;return new Promise(function(_0x1dcb60,_0x1561a6){var _0x3dc8b6;return db[_0x6ded('0x1b')][_0x6ded('0x49')]({'where':_0x40ae44[_0x6ded('0x1d')][_0x6ded('0x1f')]||{},'attributes':['id','name']})[_0x6ded('0xf')](function(_0x4d1603){if(_0x4d1603){_0x3dc8b6=_0x4d1603;return db[_0x6ded('0x2c')][_0x6ded('0x4a')]({'where':{'membername':_0x3dc8b6[_0x6ded('0x28')]},'individualHooks':!![]});}})[_0x6ded('0xf')](function(){if(_0x3dc8b6){return db[_0x6ded('0x2e')]['findAll']({'where':{'membername':_0x3dc8b6[_0x6ded('0x28')],'exitAt':null}});}})['then'](function(_0x27b544){if(_0x3dc8b6){if(_0x27b544&&_0x27b544[_0x6ded('0x30')]){var _0x323952=[];_0x27b544[_0x6ded('0x35')](function(_0x2197d4){_0x323952[_0x6ded('0x46')](_0x2197d4[_0x6ded('0x2d')]({'exitAt':moment()[_0x6ded('0x31')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6ded('0x47')](_0x323952);}}})[_0x6ded('0xf')](function(){if(_0x3dc8b6){return _0x3dc8b6['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x3b1ae5){_0x1dcb60(_0x3b1ae5);})['catch'](function(_0x3cc03a){_0x1561a6(_0x174bf2[_0x6ded('0x14')](0x1f4,_0x3cc03a[_0x6ded('0x16')]));});});};exports[_0x6ded('0x4b')]=function(_0x366d89){var _0x516f52=this;return new Promise(function(_0x116ff8,_0x4ce8b8){var _0x119d50;var _0x316041;var _0x3313c0;var _0x5561a4;return db[_0x6ded('0x1b')][_0x6ded('0x49')]({'where':_0x366d89[_0x6ded('0x1d')]['where']||{},'attributes':['id',_0x6ded('0x28'),_0x6ded('0x29'),_0x6ded('0x4c'),_0x6ded('0x4d'),_0x6ded('0x2a'),'loginInPause',_0x6ded('0x2b')]})[_0x6ded('0xf')](function(_0x37cf86){if(_0x37cf86){_0x119d50=_0x37cf86;_0x5561a4=_0x366d89[_0x6ded('0x37')][_0x6ded('0x2b')]?_0x366d89['body'][_0x6ded('0x2b')]:util[_0x6ded('0x31')](_0x6ded('0x4e'),_0x119d50['name']);return db[_0x6ded('0x1b')][_0x6ded('0x4f')]({'where':{'role':_0x6ded('0x50'),'online':!![],'id':{'$ne':_0x119d50['id']}}});}})[_0x6ded('0xf')](function(_0x21500f){if(_0x21500f){_0x3313c0=_0x21500f;return require(_0x6ded('0x51'))[_0x6ded('0x52')]();}})['then'](function(_0x576a1a){if(_0x576a1a&&_0x576a1a['agents']&&_0x3313c0>=_0x576a1a[_0x6ded('0x53')]){throw new Error(_0x6ded('0x54'));}})['then'](function(){if(_0x119d50){return db[_0x6ded('0x2c')][_0x6ded('0x4a')]({'where':{'membername':_0x119d50[_0x6ded('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x119d50){return _0x119d50[_0x6ded('0x55')]({'raw':!![]});}})['then'](function(_0x362229){if(_0x119d50){if(_0x362229){var _0x1d04a4=[];_0x316041=_0x362229;if(_0x316041[_0x6ded('0x30')]){for(var _0x1885ee=0x0;_0x1885ee<_0x316041[_0x6ded('0x30')];_0x1885ee++){_0x1d04a4[_0x6ded('0x46')](db[_0x6ded('0x2c')][_0x6ded('0x56')]({'membername':_0x119d50['name'],'UserId':_0x119d50['id'],'queue_name':_0x316041[_0x1885ee]['name'],'VoiceQueueId':_0x316041[_0x1885ee]['id'],'interface':_0x5561a4,'paused':_0x119d50['loginInPause']||![],'penalty':_0x316041[_0x1885ee]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x6ded('0x47')](_0x1d04a4);}}}})[_0x6ded('0xf')](function(){if(_0x119d50){return db['MemberReport'][_0x6ded('0x1c')]({'where':{'membername':_0x119d50['name'],'exitAt':null}});}})[_0x6ded('0xf')](function(_0x53d71e){if(_0x119d50){if(_0x53d71e&&_0x53d71e['length']){var _0x1c30fa=[];_0x53d71e[_0x6ded('0x35')](function(_0x4bef92){_0x1c30fa[_0x6ded('0x46')](_0x4bef92[_0x6ded('0x2d')]({'exitAt':moment()[_0x6ded('0x31')](_0x6ded('0x32'))}));});return BPromise[_0x6ded('0x47')](_0x1c30fa);}}})['then'](function(_0x5dd167){if(_0x119d50){var _0x4a676f=[];var _0x2767f8=[];var _0x49e701=utils['getChannels']();var _0x198c4a={'membername':_0x119d50[_0x6ded('0x28')],'interface':_0x5561a4,'enterAt':moment()[_0x6ded('0x31')](_0x6ded('0x32')),'role':_0x119d50[_0x6ded('0x29')],'internal':_0x119d50[_0x6ded('0x2a')]};_0x49e701[_0x6ded('0x35')](function(_0x15231a){_0x4a676f[_0x6ded('0x46')](_[_0x6ded('0x57')]({'channel':_0x15231a,'type':'LOGIN','data1':_0x6ded('0x58'),'data2':_0x5561a4},_0x198c4a));if(_0x119d50[_0x6ded('0x59')]){_0x2767f8['push'](_[_0x6ded('0x57')]({'channel':_0x15231a,'type':_0x6ded('0x2f'),'data1':_0x6ded('0x5a')},_0x198c4a));}});return db['MemberReport'][_0x6ded('0x5b')](_0x4a676f['concat'](_0x2767f8),{'individualHooks':!![]});}})['then'](function(){if(_0x119d50){return _0x119d50[_0x6ded('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x6ded('0x31')](_0x6ded('0x32')),'voicePause':_0x119d50[_0x6ded('0x59')]||![],'mailPause':_0x119d50[_0x6ded('0x59')]||![],'chatPause':_0x119d50[_0x6ded('0x59')]||![],'faxPause':_0x119d50[_0x6ded('0x59')]||![],'smsPause':_0x119d50[_0x6ded('0x59')]||![],'openchannelPause':_0x119d50[_0x6ded('0x59')]||![],'pauseType':_0x119d50[_0x6ded('0x59')]?_0x6ded('0x5a'):null,'lastPauseAt':moment()[_0x6ded('0x31')](_0x6ded('0x32')),'interface':_0x5561a4});}})[_0x6ded('0xf')](function(_0x83c009){_0x116ff8(_0x83c009);})['catch'](function(_0x538a73){_0x4ce8b8(_0x516f52[_0x6ded('0x14')](0x1f4,_0x538a73[_0x6ded('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9507048..0983ca7 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 _0xe151=['remove','update','emit','removeListener','length','user:','save'];(function(_0x257643,_0xa49840){var _0x1c7e7f=function(_0x51b096){while(--_0x51b096){_0x257643['push'](_0x257643['shift']());}};_0x1c7e7f(++_0xa49840);}(_0xe151,0x102));var _0x1e15=function(_0x328f97,_0x1d5876){_0x328f97=_0x328f97-0x0;var _0x4b27bc=_0xe151[_0x328f97];return _0x4b27bc;};'use strict';var UserEvents=require('./user.events');var events=[_0x1e15('0x0'),_0x1e15('0x1'),_0x1e15('0x2')];function createListener(_0x21a7ae,_0xe22fed){return function(_0x20ed0f){_0xe22fed[_0x1e15('0x3')](_0x21a7ae,_0x20ed0f);};}function removeListener(_0x396de2,_0x196ccf){return function(){UserEvents[_0x1e15('0x4')](_0x396de2,_0x196ccf);};}exports['register']=function(_0xdfc04b){for(var _0x28c3fb=0x0,_0x55afd3=events[_0x1e15('0x5')];_0x28c3fb<_0x55afd3;_0x28c3fb++){var _0x433c67=events[_0x28c3fb];var _0x39253c=createListener(_0x1e15('0x6')+_0x433c67,_0xdfc04b);UserEvents['on'](_0x433c67,_0x39253c);}}; \ No newline at end of file +var _0x1f45=['emit','removeListener','register','length','user:','./user.events','save'];(function(_0x24a299,_0x4bc675){var _0x9e8a01=function(_0x3368f4){while(--_0x3368f4){_0x24a299['push'](_0x24a299['shift']());}};_0x9e8a01(++_0x4bc675);}(_0x1f45,0x171));var _0x51f4=function(_0x51c0fd,_0x47ba18){_0x51c0fd=_0x51c0fd-0x0;var _0x50e536=_0x1f45[_0x51c0fd];return _0x50e536;};'use strict';var UserEvents=require(_0x51f4('0x0'));var events=[_0x51f4('0x1'),'remove','update'];function createListener(_0x288e70,_0x42365d){return function(_0x3554c7){_0x42365d[_0x51f4('0x2')](_0x288e70,_0x3554c7);};}function removeListener(_0x3d22a9,_0x4be3bb){return function(){UserEvents[_0x51f4('0x3')](_0x3d22a9,_0x4be3bb);};}exports[_0x51f4('0x4')]=function(_0x483131){for(var _0x3efb02=0x0,_0x25d505=events[_0x51f4('0x5')];_0x3efb02<_0x25d505;_0x3efb02++){var _0x4bbea2=events[_0x3efb02];var _0x11996b=createListener(_0x51f4('0x6')+_0x4bbea2,_0x483131);UserEvents['on'](_0x4bbea2,_0x11996b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 2b85e52..585d458 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x59b2e2,_0x1412fb){var _0x369050=function(_0x547536){while(--_0x547536){_0x59b2e2['push'](_0x59b2e2['shift']());}};_0x369050(++_0x1412fb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xcb91[_0x179c4a];return _0x5d1879;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x43390c,_0x261fcb){var _0x1ba111=function(_0x16dac6){while(--_0x16dac6){_0x43390c['push'](_0x43390c['shift']());}};_0x1ba111(++_0x261fcb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0xcb91[_0x54eab6];return _0x1e7435;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 37869fe..f5bc844 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 _0x1f8d=['sequelize','exports','INTEGER'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0x1f8d,0x17a));var _0xd1f8=function(_0x5f2833,_0x14551b){_0x5f2833=_0x5f2833-0x0;var _0xca8bbf=_0x1f8d[_0x5f2833];return _0xca8bbf;};'use strict';var Sequelize=require(_0xd1f8('0x0'));module[_0xd1f8('0x1')]={'penalty':{'type':Sequelize[_0xd1f8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbfda=['exports','INTEGER','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbfda,0x1dc));var _0xabfd=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xbfda[_0x1b64dd];return _0xeb464c;};'use strict';var Sequelize=require(_0xabfd('0x0'));module[_0xabfd('0x1')]={'penalty':{'type':Sequelize[_0xabfd('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 53fc264..bbc5ba5 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 _0x78e8=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x78e8,0x11e));var _0x878e=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x78e8[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x878e('0x0'));var util=require('util');var logger=require(_0x878e('0x1'))(_0x878e('0x2'));var moment=require(_0x878e('0x3'));var BPromise=require(_0x878e('0x4'));var rp=require(_0x878e('0x5'));var fs=require('fs');var path=require(_0x878e('0x6'));var rimraf=require(_0x878e('0x7'));var config=require(_0x878e('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x878e('0x9')]=function(_0x38b14f,_0x4aecfc){return _0x38b14f[_0x878e('0xa')](_0x878e('0xb'),attributes,{'tableName':_0x878e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e72=['./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4e7445,_0x55363d){var _0xb01ec=function(_0x3ffa03){while(--_0x3ffa03){_0x4e7445['push'](_0x4e7445['shift']());}};_0xb01ec(++_0x55363d);}(_0x4e72,0x184));var _0x24e7=function(_0x39ebb6,_0x2f1aff){_0x39ebb6=_0x39ebb6-0x0;var _0x130a80=_0x4e72[_0x39ebb6];return _0x130a80;};'use strict';var _=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var logger=require(_0x24e7('0x2'))(_0x24e7('0x3'));var moment=require(_0x24e7('0x4'));var BPromise=require(_0x24e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24e7('0x6'));var rimraf=require('rimraf');var config=require(_0x24e7('0x7'));var attributes=require(_0x24e7('0x8'));module['exports']=function(_0x28c1ab,_0x4f25b9){return _0x28c1ab[_0x24e7('0x9')](_0x24e7('0xa'),attributes,{'tableName':_0x24e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index e21b7de..ed64c66 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 _0x6e4f=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','randomstring'];(function(_0x42f982,_0x2497dc){var _0x54e269=function(_0x1b0e60){while(--_0x1b0e60){_0x42f982['push'](_0x42f982['shift']());}};_0x54e269(++_0x2497dc);}(_0x6e4f,0xed));var _0xf6e4=function(_0x579d67,_0x5e396f){_0x579d67=_0x579d67-0x0;var _0x985818=_0x6e4f[_0x579d67];return _0x985818;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf6e4('0x0'));var fs=require('fs');var Redis=require(_0xf6e4('0x1'));var db=require(_0xf6e4('0x2'))['db'];var utils=require(_0xf6e4('0x3'));var logger=require('../../config/logger')(_0xf6e4('0x4'));var config=require(_0xf6e4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf6e4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10bb48,_0xbd32fb,_0x369597){return new BPromise(function(_0x1faaf7,_0x11d892){return client[_0xf6e4('0x7')](_0x10bb48,_0x369597)[_0xf6e4('0x8')](function(_0x117d27){logger[_0xf6e4('0x9')](_0xf6e4('0xa'),_0xbd32fb,_0xf6e4('0xb'));logger[_0xf6e4('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0xbd32fb,_0xf6e4('0xb'),JSON[_0xf6e4('0xd')](_0x117d27));if(_0x117d27['error']){if(_0x117d27[_0xf6e4('0xe')]['code']===0x1f4){logger[_0xf6e4('0xe')](_0xf6e4('0xa'),_0xbd32fb,_0x117d27['error'][_0xf6e4('0xf')]);return _0x11d892(_0x117d27[_0xf6e4('0xe')][_0xf6e4('0xf')]);}logger[_0xf6e4('0xe')](_0xf6e4('0xa'),_0xbd32fb,_0x117d27[_0xf6e4('0xe')][_0xf6e4('0xf')]);return _0x1faaf7(_0x117d27[_0xf6e4('0xe')]['message']);}else{logger[_0xf6e4('0x9')](_0xf6e4('0xa'),_0xbd32fb,_0xf6e4('0xb'));_0x1faaf7(_0x117d27['result']['message']);}})[_0xf6e4('0x10')](function(_0xe066ea){logger[_0xf6e4('0xe')]('UserChatQueue,\x20%s,\x20%s',_0xbd32fb,_0xe066ea);_0x11d892(_0xe066ea);});});} \ No newline at end of file +var _0x1f95=['bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0x35a3c6,_0x551d51){var _0x2874d3=function(_0x5e4cd0){while(--_0x5e4cd0){_0x35a3c6['push'](_0x35a3c6['shift']());}};_0x2874d3(++_0x551d51);}(_0x1f95,0x107));var _0x51f9=function(_0x4cbad0,_0x41a1e3){_0x4cbad0=_0x4cbad0-0x0;var _0x58bfb6=_0x1f95[_0x4cbad0];return _0x58bfb6;};'use strict';var _=require(_0x51f9('0x0'));var util=require(_0x51f9('0x1'));var moment=require(_0x51f9('0x2'));var BPromise=require(_0x51f9('0x3'));var rs=require(_0x51f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x51f9('0x6'));var config=require('../../config/environment');var jayson=require(_0x51f9('0x7'));var client=jayson[_0x51f9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15288d,_0x20d9a5,_0x4e76b0){return new BPromise(function(_0x540d04,_0x1f0874){return client[_0x51f9('0x9')](_0x15288d,_0x4e76b0)[_0x51f9('0xa')](function(_0x3a0300){logger[_0x51f9('0xb')](_0x51f9('0xc'),_0x20d9a5,_0x51f9('0xd'));logger['debug'](_0x51f9('0xe'),_0x20d9a5,_0x51f9('0xd'),JSON[_0x51f9('0xf')](_0x3a0300));if(_0x3a0300[_0x51f9('0x10')]){if(_0x3a0300[_0x51f9('0x10')][_0x51f9('0x11')]===0x1f4){logger['error'](_0x51f9('0xc'),_0x20d9a5,_0x3a0300[_0x51f9('0x10')]['message']);return _0x1f0874(_0x3a0300['error'][_0x51f9('0x12')]);}logger[_0x51f9('0x10')](_0x51f9('0xc'),_0x20d9a5,_0x3a0300[_0x51f9('0x10')]['message']);return _0x540d04(_0x3a0300[_0x51f9('0x10')][_0x51f9('0x12')]);}else{logger[_0x51f9('0xb')](_0x51f9('0xc'),_0x20d9a5,_0x51f9('0xd'));_0x540d04(_0x3a0300['result']['message']);}})['catch'](function(_0x1be22a){logger[_0x51f9('0x10')](_0x51f9('0xc'),_0x20d9a5,_0x1be22a);_0x1f0874(_0x1be22a);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 6c5afcd..1ea5482 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x40b7ec,_0x307707){var _0x72b976=function(_0x5bfcc3){while(--_0x5bfcc3){_0x40b7ec['push'](_0x40b7ec['shift']());}};_0x72b976(++_0x307707);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'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(_0x12395e,_0x4babc8){var _0x44883f=function(_0x54519e){while(--_0x54519e){_0x12395e['push'](_0x12395e['shift']());}};_0x44883f(++_0x4babc8);}(_0x70e0,0x17b));var _0x070e=function(_0x35bd9f,_0x2e51b7){_0x35bd9f=_0x35bd9f-0x0;var _0x5e2300=_0x70e0[_0x35bd9f];return _0x5e2300;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c6fef3f..5705eec 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 _0xb048=['sequelize','exports','STRING'];(function(_0x2b6125,_0x5a0c14){var _0x417134=function(_0x55500a){while(--_0x55500a){_0x2b6125['push'](_0x2b6125['shift']());}};_0x417134(++_0x5a0c14);}(_0xb048,0x87));var _0x8b04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb048[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8b04('0x0'));module[_0x8b04('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8b04('0x2')]}}; \ No newline at end of file +var _0x1bb6=['sequelize','INTEGER','STRING'];(function(_0x3819c3,_0x4c5e9a){var _0x1ce0f5=function(_0x3d1251){while(--_0x3d1251){_0x3819c3['push'](_0x3819c3['shift']());}};_0x1ce0f5(++_0x4c5e9a);}(_0x1bb6,0x16b));var _0x61bb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1bb6[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x61bb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x61bb('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x61bb('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x61bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8991b2e..1cfc95c 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 _0x057b=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes'];(function(_0x8beb3f,_0x82e63e){var _0x237be4=function(_0x4bef2d){while(--_0x4bef2d){_0x8beb3f['push'](_0x8beb3f['shift']());}};_0x237be4(++_0x82e63e);}(_0x057b,0x12a));var _0xb057=function(_0x4058a8,_0xcefa9a){_0x4058a8=_0x4058a8-0x0;var _0xcf5329=_0x057b[_0x4058a8];return _0xcf5329;};'use strict';var _=require(_0xb057('0x0'));var util=require(_0xb057('0x1'));var logger=require(_0xb057('0x2'))(_0xb057('0x3'));var moment=require(_0xb057('0x4'));var BPromise=require(_0xb057('0x5'));var rp=require(_0xb057('0x6'));var fs=require('fs');var path=require(_0xb057('0x7'));var rimraf=require(_0xb057('0x8'));var config=require('../../config/environment');var attributes=require(_0xb057('0x9'));module[_0xb057('0xa')]=function(_0x4fb8c2,_0x124dda){return _0x4fb8c2[_0xb057('0xb')](_0xb057('0xc'),attributes,{'tableName':_0xb057('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4665=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x2dc0cb,_0x1e4c58){var _0x4c49cf=function(_0x44d8fd){while(--_0x44d8fd){_0x2dc0cb['push'](_0x2dc0cb['shift']());}};_0x4c49cf(++_0x1e4c58);}(_0x4665,0xee));var _0x5466=function(_0x418a3f,_0x32c7b0){_0x418a3f=_0x418a3f-0x0;var _0x1324b1=_0x4665[_0x418a3f];return _0x1324b1;};'use strict';var _=require(_0x5466('0x0'));var util=require(_0x5466('0x1'));var logger=require(_0x5466('0x2'))(_0x5466('0x3'));var moment=require(_0x5466('0x4'));var BPromise=require(_0x5466('0x5'));var rp=require(_0x5466('0x6'));var fs=require('fs');var path=require(_0x5466('0x7'));var rimraf=require(_0x5466('0x8'));var config=require(_0x5466('0x9'));var attributes=require(_0x5466('0xa'));module[_0x5466('0xb')]=function(_0x1efcd7,_0x43e985){return _0x1efcd7[_0x5466('0xc')](_0x5466('0xd'),attributes,{'tableName':_0x5466('0xe'),'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 52cd0f8..4baca5d 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 _0xf38e=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0xf38e,0x1b7));var _0xef38=function(_0x5dd7bb,_0x49c4ac){_0x5dd7bb=_0x5dd7bb-0x0;var _0x1d5b1c=_0xf38e[_0x5dd7bb];return _0x1d5b1c;};'use strict';var _=require('lodash');var util=require(_0xef38('0x0'));var moment=require('moment');var BPromise=require(_0xef38('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef38('0x2'));var db=require(_0xef38('0x3'))['db'];var utils=require(_0xef38('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xef38('0x5'));var jayson=require(_0xef38('0x6'));var client=jayson[_0xef38('0x7')][_0xef38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d174d,_0x56f903,_0x282e1a){return new BPromise(function(_0x541ce4,_0x2506ca){return client['request'](_0x1d174d,_0x282e1a)[_0xef38('0x9')](function(_0x35dab0){logger[_0xef38('0xa')](_0xef38('0xb'),_0x56f903,_0xef38('0xc'));logger['debug'](_0xef38('0xd'),_0x56f903,_0xef38('0xc'),JSON['stringify'](_0x35dab0));if(_0x35dab0[_0xef38('0xe')]){if(_0x35dab0[_0xef38('0xe')]['code']===0x1f4){logger[_0xef38('0xe')](_0xef38('0xb'),_0x56f903,_0x35dab0[_0xef38('0xe')]['message']);return _0x2506ca(_0x35dab0[_0xef38('0xe')][_0xef38('0xf')]);}logger['error'](_0xef38('0xb'),_0x56f903,_0x35dab0[_0xef38('0xe')][_0xef38('0xf')]);return _0x541ce4(_0x35dab0['error'][_0xef38('0xf')]);}else{logger[_0xef38('0xa')](_0xef38('0xb'),_0x56f903,_0xef38('0xc'));_0x541ce4(_0x35dab0[_0xef38('0x10')][_0xef38('0xf')]);}})[_0xef38('0x11')](function(_0x4c7dbe){logger[_0xef38('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x56f903,_0x4c7dbe);_0x2506ca(_0x4c7dbe);});});} \ No newline at end of file +var _0xb8fd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xf45843,_0x12e7da){var _0x96ce04=function(_0x34e875){while(--_0x34e875){_0xf45843['push'](_0xf45843['shift']());}};_0x96ce04(++_0x12e7da);}(_0xb8fd,0xf6));var _0xdb8f=function(_0x3fd92c,_0xbbccd6){_0x3fd92c=_0x3fd92c-0x0;var _0x2e4c4f=_0xb8fd[_0x3fd92c];return _0x2e4c4f;};'use strict';var _=require(_0xdb8f('0x0'));var util=require('util');var moment=require(_0xdb8f('0x1'));var BPromise=require(_0xdb8f('0x2'));var rs=require(_0xdb8f('0x3'));var fs=require('fs');var Redis=require(_0xdb8f('0x4'));var db=require(_0xdb8f('0x5'))['db'];var utils=require(_0xdb8f('0x6'));var logger=require(_0xdb8f('0x7'))(_0xdb8f('0x8'));var config=require(_0xdb8f('0x9'));var jayson=require(_0xdb8f('0xa'));var client=jayson[_0xdb8f('0xb')][_0xdb8f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e7b23,_0x52b591,_0x3da0bb){return new BPromise(function(_0x6723d8,_0x4e80b3){return client['request'](_0x5e7b23,_0x3da0bb)[_0xdb8f('0xd')](function(_0x59b3d2){logger[_0xdb8f('0xe')](_0xdb8f('0xf'),_0x52b591,_0xdb8f('0x10'));logger[_0xdb8f('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x52b591,'request\x20sent',JSON['stringify'](_0x59b3d2));if(_0x59b3d2[_0xdb8f('0x12')]){if(_0x59b3d2[_0xdb8f('0x12')][_0xdb8f('0x13')]===0x1f4){logger[_0xdb8f('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x52b591,_0x59b3d2[_0xdb8f('0x12')][_0xdb8f('0x14')]);return _0x4e80b3(_0x59b3d2[_0xdb8f('0x12')][_0xdb8f('0x14')]);}logger[_0xdb8f('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x52b591,_0x59b3d2[_0xdb8f('0x12')]['message']);return _0x6723d8(_0x59b3d2[_0xdb8f('0x12')][_0xdb8f('0x14')]);}else{logger['info'](_0xdb8f('0xf'),_0x52b591,_0xdb8f('0x10'));_0x6723d8(_0x59b3d2[_0xdb8f('0x15')][_0xdb8f('0x14')]);}})[_0xdb8f('0x16')](function(_0x4d5e57){logger[_0xdb8f('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x52b591,_0x4d5e57);_0x4e80b3(_0x4d5e57);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7ab4134..11e36d9 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x15b1ec,_0x15ee62){var _0x33320c=function(_0x26e74d){while(--_0x26e74d){_0x15b1ec['push'](_0x15b1ec['shift']());}};_0x33320c(++_0x15ee62);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x139a4f,_0x5c6d66){var _0x46ed1c=function(_0x1190e4){while(--_0x1190e4){_0x139a4f['push'](_0x139a4f['shift']());}};_0x46ed1c(++_0x5c6d66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 21c7460..b1a0274 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 _0x460c=['exports','INTEGER'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x460c,0xe8));var _0xc460=function(_0xa67612,_0x419302){_0xa67612=_0xa67612-0x0;var _0x30ab6e=_0x460c[_0xa67612];return _0x30ab6e;};'use strict';var Sequelize=require('sequelize');module[_0xc460('0x0')]={'penalty':{'type':Sequelize[_0xc460('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e46=['exports','INTEGER','sequelize'];(function(_0x19cf1a,_0x3a916){var _0x17ac03=function(_0x5d6cd9){while(--_0x5d6cd9){_0x19cf1a['push'](_0x19cf1a['shift']());}};_0x17ac03(++_0x3a916);}(_0x7e46,0x1a6));var _0x67e4=function(_0x5f4457,_0x210cb7){_0x5f4457=_0x5f4457-0x0;var _0x5b368b=_0x7e46[_0x5f4457];return _0x5b368b;};'use strict';var Sequelize=require(_0x67e4('0x0'));module[_0x67e4('0x1')]={'penalty':{'type':Sequelize[_0x67e4('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 e8e2b2f..f417120 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 _0x496f=['exports','define','UserMailQueue','user_has_mail_queues','lodash','api','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x496f,0x154));var _0xf496=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x496f[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0xf496('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf496('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(_0xf496('0x2'));var config=require(_0xf496('0x3'));var attributes=require('./userMailQueue.attributes');module[_0xf496('0x4')]=function(_0x4f7e2c,_0x1c4c40){return _0x4f7e2c[_0xf496('0x5')](_0xf496('0x6'),attributes,{'tableName':_0xf496('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa95=['user_has_mail_queues','lodash','util','../../config/logger','api','moment','path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xaa95,0xfd));var _0x5aa9=function(_0xfaebd6,_0x69144c){_0xfaebd6=_0xfaebd6-0x0;var _0x387e52=_0xaa95[_0xfaebd6];return _0x387e52;};'use strict';var _=require(_0x5aa9('0x0'));var util=require(_0x5aa9('0x1'));var logger=require(_0x5aa9('0x2'))(_0x5aa9('0x3'));var moment=require(_0x5aa9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aa9('0x5'));var rimraf=require('rimraf');var config=require(_0x5aa9('0x6'));var attributes=require(_0x5aa9('0x7'));module[_0x5aa9('0x8')]=function(_0x254726,_0x34fe43){return _0x254726[_0x5aa9('0x9')](_0x5aa9('0xa'),attributes,{'tableName':_0x5aa9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 29850fe..23de2a6 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36d6f5,_0x2231ea){var _0x17327b=function(_0x25650b){while(--_0x25650b){_0x36d6f5['push'](_0x36d6f5['shift']());}};_0x17327b(++_0x2231ea);}(_0xa41a,0x6b));var _0xaa41=function(_0x3b6bd9,_0x1c3ffa){_0x3b6bd9=_0x3b6bd9-0x0;var _0x14264f=_0xa41a[_0x3b6bd9];return _0x14264f;};'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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x4d77d0,_0x2f91a0){_0x4d77d0=_0x4d77d0-0x0;var _0x2f4699=_0x008c[_0x4d77d0];return _0x2f4699;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 30d3a14..d3eb0f9 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 _0xce7c=['isAuthenticated','sendUserNotification','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','post'];(function(_0x2b8722,_0x50d540){var _0x20c180=function(_0x595b40){while(--_0x595b40){_0x2b8722['push'](_0x2b8722['shift']());}};_0x20c180(++_0x50d540);}(_0xce7c,0x19d));var _0xcce7=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0xce7c[_0x80544e];return _0x4f9b90;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcce7('0x0'));var timeout=require(_0xcce7('0x1'));var express=require(_0xcce7('0x2'));var router=express[_0xcce7('0x3')]();var fs_extra=require(_0xcce7('0x4'));var auth=require(_0xcce7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xcce7('0x6')]('/',auth[_0xcce7('0x7')](),controller[_0xcce7('0x8')]);module[_0xcce7('0x9')]=router; \ No newline at end of file +var _0x48b4=['Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports'];(function(_0x45a12a,_0x33288c){var _0x5462cf=function(_0x4e9bbf){while(--_0x4e9bbf){_0x45a12a['push'](_0x45a12a['shift']());}};_0x5462cf(++_0x33288c);}(_0x48b4,0x1a0));var _0x448b=function(_0x27fcf3,_0x27584e){_0x27fcf3=_0x27fcf3-0x0;var _0x32b7d1=_0x48b4[_0x27fcf3];return _0x32b7d1;};'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[_0x448b('0x0')]();var fs_extra=require(_0x448b('0x1'));var auth=require(_0x448b('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x448b('0x3'));var controller=require(_0x448b('0x4'));router['post']('/',auth[_0x448b('0x5')](),controller[_0x448b('0x6')]);module[_0x448b('0x7')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index db938a9..7e42011 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 _0x2134=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x2134,0x196));var _0x4213=function(_0x58d282,_0xe9f492){_0x58d282=_0x58d282-0x0;var _0x36c6b3=_0x2134[_0x58d282];return _0x36c6b3;};'use strict';var Sequelize=require(_0x4213('0x0'));module[_0x4213('0x1')]={'body':{'type':Sequelize[_0x4213('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x4213('0x2')]},'recipientsDescription':{'type':Sequelize[_0x4213('0x3')]},'beep':{'type':Sequelize[_0x4213('0x4')]}}; \ No newline at end of file +var _0xa5db=['TEXT','STRING','BOOLEAN','exports'];(function(_0x3bb5eb,_0x88b51f){var _0x2cc4d2=function(_0x12e1f2){while(--_0x12e1f2){_0x3bb5eb['push'](_0x3bb5eb['shift']());}};_0x2cc4d2(++_0x88b51f);}(_0xa5db,0x1cf));var _0xba5d=function(_0x34f865,_0x1a8e39){_0x34f865=_0x34f865-0x0;var _0x4150bf=_0xa5db[_0x34f865];return _0x4150bf;};'use strict';var Sequelize=require('sequelize');module[_0xba5d('0x0')]={'body':{'type':Sequelize[_0xba5d('0x1')]},'senderName':{'type':Sequelize[_0xba5d('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xba5d('0x2')]},'beep':{'type':Sequelize[_0xba5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 76216fd..83196e3 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 _0x7029=['register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','sendUserNotification','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','recipients','chatqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','create','forEach','recipient','emit','catch','findOne','html','startCase','User','union','queue','Queue','ids','push','all','flatten','getAgents','map','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./userNotification.socket'];(function(_0xe30774,_0x46478b){var _0x3bd944=function(_0x109f06){while(--_0x109f06){_0xe30774['push'](_0xe30774['shift']());}};_0x3bd944(++_0x46478b);}(_0x7029,0xfd));var _0x9702=function(_0x538b57,_0x4bff76){_0x538b57=_0x538b57-0x0;var _0x359af0=_0x7029[_0x538b57];return _0x359af0;};'use strict';var emlformat=require(_0x9702('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9702('0x1'));var rp=require(_0x9702('0x2'));var moment=require('moment');var BPromise=require(_0x9702('0x3'));var Mustache=require(_0x9702('0x4'));var util=require('util');var path=require(_0x9702('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9702('0x6'));var _=require(_0x9702('0x7'));var squel=require(_0x9702('0x8'));var crypto=require(_0x9702('0x9'));var jsforce=require(_0x9702('0xa'));var deskjs=require(_0x9702('0xb'));var toCsv=require(_0x9702('0xc'));var querystring=require(_0x9702('0xd'));var Papa=require(_0x9702('0xe'));var Redis=require(_0x9702('0xf'));var authService=require(_0x9702('0x10'));var qs=require(_0x9702('0x11'));var as=require(_0x9702('0x12'));var hardwareService=require(_0x9702('0x13'));var logger=require(_0x9702('0x14'))(_0x9702('0x15'));var utils=require(_0x9702('0x16'));var config=require(_0x9702('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9702('0x18'))['db'];config[_0x9702('0x19')]=_[_0x9702('0x1a')](config[_0x9702('0x19')],{'host':_0x9702('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9702('0x19')]));require(_0x9702('0x1c'))[_0x9702('0x1d')](socket);function respondWithStatusCode(_0x29d9c8,_0x1430c7){_0x1430c7=_0x1430c7||0xcc;return function(_0x105b96){if(_0x105b96){return _0x29d9c8['sendStatus'](_0x1430c7);}return _0x29d9c8[_0x9702('0x1e')](_0x1430c7)['end']();};}function respondWithResult(_0x2c1c38,_0x4069a5){_0x4069a5=_0x4069a5||0xc8;return function(_0xb2b636){if(_0xb2b636){return _0x2c1c38[_0x9702('0x1e')](_0x4069a5)[_0x9702('0x1f')](_0xb2b636);}};}function respondWithFilteredResult(_0x1b7dd0,_0x285b23){return function(_0x1caeb8){if(_0x1caeb8){var _0x5520a9=typeof _0x285b23[_0x9702('0x20')]==='undefined'&&typeof _0x285b23[_0x9702('0x21')]===_0x9702('0x22');var _0x2d6d47=_0x1caeb8[_0x9702('0x23')];var _0x22b27a=_0x5520a9?0x0:_0x285b23['offset'];var _0x17f320=_0x5520a9?_0x1caeb8[_0x9702('0x23')]:_0x285b23[_0x9702('0x20')]+_0x285b23[_0x9702('0x21')];var _0x5a61d4;if(_0x17f320>=_0x2d6d47){_0x17f320=_0x2d6d47;_0x5a61d4=0xc8;}else{_0x5a61d4=0xce;}_0x1b7dd0[_0x9702('0x1e')](_0x5a61d4);return _0x1b7dd0[_0x9702('0x24')](_0x9702('0x25'),_0x22b27a+'-'+_0x17f320+'/'+_0x2d6d47)[_0x9702('0x1f')](_0x1caeb8);}return null;};}function patchUpdates(_0x4d2580){return function(_0x32e3d1){try{jsonpatch[_0x9702('0x26')](_0x32e3d1,_0x4d2580,!![]);}catch(_0x48f7bf){return BPromise[_0x9702('0x27')](_0x48f7bf);}return _0x32e3d1[_0x9702('0x28')]();};}function saveUpdates(_0xea087d,_0x198d30){return function(_0x27f32b){if(_0x27f32b){return _0x27f32b[_0x9702('0x29')](_0xea087d)[_0x9702('0x2a')](function(_0x233511){return _0x233511;});}return null;};}function removeEntity(_0xdd4fcc,_0x22f641){return function(_0x442c6d){if(_0x442c6d){return _0x442c6d['destroy']()[_0x9702('0x2a')](function(){_0xdd4fcc[_0x9702('0x1e')](0xcc)[_0x9702('0x2b')]();});}};}function handleEntityNotFound(_0x1bf2a4,_0x440d6d){return function(_0x2127e4){if(!_0x2127e4){_0x1bf2a4[_0x9702('0x2c')](0x194);}return _0x2127e4;};}function handleError(_0x417c22,_0x2a5405){_0x2a5405=_0x2a5405||0x1f4;return function(_0x2098c5){logger[_0x9702('0x2d')](_0x2098c5[_0x9702('0x2e')]);if(_0x2098c5[_0x9702('0x2f')]){delete _0x2098c5[_0x9702('0x2f')];}_0x417c22['status'](_0x2a5405)[_0x9702('0x30')](_0x2098c5);};}exports[_0x9702('0x31')]=function(_0x4c8ca1,_0x39f7d1,_0x36392e){if(!_0x4c8ca1['body']['hasOwnProperty'](_0x9702('0x32'))&&!_0x4c8ca1['body'][_0x9702('0x33')](_0x9702('0x34'))){throw new db[(_0x9702('0x35'))][(_0x9702('0x36'))](_0x9702('0x37'));}else{if(_0x4c8ca1[_0x9702('0x38')][_0x9702('0x33')](_0x9702('0x34'))&&!_0x4c8ca1[_0x9702('0x38')][_0x9702('0x33')](_0x9702('0x39'))){throw new db[(_0x9702('0x35'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x4c8ca1[_0x9702('0x38')]['hasOwnProperty']('recipients')){throw new db[(_0x9702('0x35'))][(_0x9702('0x36'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x11c10a=JSON['parse'](_0x4c8ca1['body'][_0x9702('0x3a')]);}catch(_0x252cfe){logger[_0x9702('0x2d')](_0x252cfe);throw new db[(_0x9702('0x35'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x13a6da=[_0x9702('0x3b'),'faxqueue','mailqueue','openchannelqueue',_0x9702('0x3c'),_0x9702('0x3d'),_0x9702('0x3e'),'team',_0x9702('0x3f')];if(_[_0x9702('0x40')](_0x11c10a,function(_0xc212dc){return!_[_0x9702('0x41')](_0x13a6da,_0xc212dc['model'][_0x9702('0x42')]());})){throw new db[(_0x9702('0x35'))][(_0x9702('0x36'))](_0x9702('0x43'));}}}var _0x5625b7={};_0x5625b7[_0x9702('0x44')]=_0x4c8ca1['body']['hasOwnProperty'](_0x9702('0x44'))?_0x4c8ca1[_0x9702('0x38')]['senderName']:_0x4c8ca1[_0x9702('0x3f')][_0x9702('0x45')];_0x5625b7[_0x9702('0x46')]=_[_0x9702('0x47')](_0x4c8ca1['body']['recipientsDescription'])?null:_0x4c8ca1[_0x9702('0x38')][_0x9702('0x46')];_0x5625b7[_0x9702('0x48')]=_0x4c8ca1[_0x9702('0x38')][_0x9702('0x48')]||![];_0x5625b7['SenderId']=_0x4c8ca1[_0x9702('0x3f')]['id'];return getContent(_0x4c8ca1['body'])['then'](function(_0x4ec0b1){_0x5625b7[_0x9702('0x38')]=_0x4ec0b1;return getRecipients(_0x11c10a);})[_0x9702('0x2a')](function(_0x4cc049){_0x5625b7[_0x9702('0x49')]=_[_0x9702('0x4a')](_0x4cc049)[_0x9702('0x4b')](',');return db['sequelize']['transaction'](function(_0x407ae4){return db['UserNotification'][_0x9702('0x4c')](_0x5625b7,{'raw':!![],'transaction':_0x407ae4})[_0x9702('0x2a')](function(_0x1f79c6){var _0x2b290f={'sender':_0x5625b7[_0x9702('0x44')],'description':_0x5625b7[_0x9702('0x46')],'content':_0x5625b7[_0x9702('0x38')],'beep':_0x5625b7['beep']};_0x4cc049[_0x9702('0x4d')](function(_0x434291){_0x2b290f[_0x9702('0x4e')]=_0x434291;socket[_0x9702('0x4f')]('userNotification:send',_0x2b290f);});return _0x1f79c6;});});})[_0x9702('0x2a')](respondWithResult(_0x39f7d1,0xc9))[_0x9702('0x50')](handleError(_0x39f7d1,null));};function getContent(_0x192968){return new BPromise(function(_0x3cbe9c,_0x26a014){if(_0x192968[_0x9702('0x32')]){_0x3cbe9c(_0x192968[_0x9702('0x32')]);return;}return db['Template'][_0x9702('0x51')]({'attributes':[_0x9702('0x52')],'where':{'id':_0x192968['TemplateId']},'raw':!![]})[_0x9702('0x2a')](function(_0x43cfa7){if(!_0x43cfa7)throw new db[(_0x9702('0x35'))][(_0x9702('0x36'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x51ff84=Mustache['render'](_0x43cfa7['html'],_0x192968['view']);_0x3cbe9c(_0x51ff84);})['catch'](function(_0x3aca1b){_0x26a014(_0x3aca1b);});});}function getRecipients(_0x1c1b77){return new BPromise(function(_0x1e0c3a,_0x3e944a){var _0x5d1477=[];var _0x1f3fa9=[];_0x1c1b77[_0x9702('0x4d')](function(_0x65b3b4){var _0x586a17=_[_0x9702('0x53')](_0x65b3b4['model'][_0x9702('0x42')]());if(_0x586a17===_0x9702('0x54')){_0x5d1477=_[_0x9702('0x55')](_0x5d1477,_0x65b3b4['ids']);}else{if(_[_0x9702('0x41')](_0x586a17,_0x9702('0x56')))_0x586a17=_0x586a17['replace'](_0x9702('0x56'),_0x9702('0x57'));_0x65b3b4[_0x9702('0x58')][_0x9702('0x4d')](function(_0x44d0c1){_0x1f3fa9[_0x9702('0x59')](getAgents(_0x586a17,_0x44d0c1));});}});return BPromise[_0x9702('0x5a')](_0x1f3fa9)[_0x9702('0x2a')](function(_0x40279d){_0x5d1477=_['union'](_0x5d1477,_[_0x9702('0x5b')](_0x40279d));_0x1e0c3a(_0x5d1477);})[_0x9702('0x50')](function(_0x644f5f){_0x3e944a(_0x644f5f);});});}function getAgents(_0x10f7c4,_0x16928c){return new BPromise(function(_0x281ba7,_0x5b7e91){return db[_0x10f7c4][_0x9702('0x51')]({'where':{'id':_0x16928c}})[_0x9702('0x2a')](function(_0x42f5a9){return _0x42f5a9[_0x9702('0x5c')]({'attributes':['id'],'raw':!![]})[_0x9702('0x2a')](function(_0x4e4364){var _0x11e2cd=_[_0x9702('0x5d')](_0x4e4364,'id');_0x281ba7(_0x11e2cd);});})[_0x9702('0x50')](function(_0x11ecff){_0x5b7e91(_0x11ecff);});});} \ No newline at end of file +var _0x1255=['count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','recipientsId','sortBy','sequelize','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','queue','replace','Queue','push','all','flatten','findOne','getAgents','map','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','undefined'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1255,0x116));var _0x5125=function(_0x1434af,_0x3f4f15){_0x1434af=_0x1434af-0x0;var _0x58121a=_0x1255[_0x1434af];return _0x58121a;};'use strict';var emlformat=require(_0x5125('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5125('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5125('0x2'));var moment=require(_0x5125('0x3'));var BPromise=require(_0x5125('0x4'));var Mustache=require(_0x5125('0x5'));var util=require(_0x5125('0x6'));var path=require(_0x5125('0x7'));var sox=require(_0x5125('0x8'));var csv=require(_0x5125('0x9'));var ejs=require(_0x5125('0xa'));var fs=require('fs');var fs_extra=require(_0x5125('0xb'));var _=require(_0x5125('0xc'));var squel=require(_0x5125('0xd'));var crypto=require(_0x5125('0xe'));var jsforce=require(_0x5125('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5125('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5125('0x10'));var authService=require(_0x5125('0x11'));var qs=require(_0x5125('0x12'));var as=require(_0x5125('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5125('0x14'));var utils=require(_0x5125('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5125('0x16'));var db=require(_0x5125('0x17'))['db'];config[_0x5125('0x18')]=_[_0x5125('0x19')](config[_0x5125('0x18')],{'host':_0x5125('0x1a'),'port':0x18eb});var socket=require(_0x5125('0x1b'))(new Redis(config['redis']));require(_0x5125('0x1c'))['register'](socket);function respondWithStatusCode(_0x5d5e89,_0x5e1689){_0x5e1689=_0x5e1689||0xcc;return function(_0x42a5f7){if(_0x42a5f7){return _0x5d5e89[_0x5125('0x1d')](_0x5e1689);}return _0x5d5e89[_0x5125('0x1e')](_0x5e1689)[_0x5125('0x1f')]();};}function respondWithResult(_0x33fbf3,_0x485361){_0x485361=_0x485361||0xc8;return function(_0x8cc3a2){if(_0x8cc3a2){return _0x33fbf3['status'](_0x485361)[_0x5125('0x20')](_0x8cc3a2);}};}function respondWithFilteredResult(_0x8a9cd4,_0x359970){return function(_0x1f6831){if(_0x1f6831){var _0x21fa40=typeof _0x359970['offset']===_0x5125('0x21')&&typeof _0x359970['limit']===_0x5125('0x21');var _0x14c5ca=_0x1f6831[_0x5125('0x22')];var _0x3e175f=_0x21fa40?0x0:_0x359970[_0x5125('0x23')];var _0x125f5c=_0x21fa40?_0x1f6831[_0x5125('0x22')]:_0x359970[_0x5125('0x23')]+_0x359970[_0x5125('0x24')];var _0x4a1902;if(_0x125f5c>=_0x14c5ca){_0x125f5c=_0x14c5ca;_0x4a1902=0xc8;}else{_0x4a1902=0xce;}_0x8a9cd4[_0x5125('0x1e')](_0x4a1902);return _0x8a9cd4[_0x5125('0x25')](_0x5125('0x26'),_0x3e175f+'-'+_0x125f5c+'/'+_0x14c5ca)[_0x5125('0x20')](_0x1f6831);}return null;};}function patchUpdates(_0x2a5a71){return function(_0x316b04){try{jsonpatch[_0x5125('0x27')](_0x316b04,_0x2a5a71,!![]);}catch(_0x31c207){return BPromise[_0x5125('0x28')](_0x31c207);}return _0x316b04[_0x5125('0x29')]();};}function saveUpdates(_0x3164e0,_0x399940){return function(_0x21ab91){if(_0x21ab91){return _0x21ab91['update'](_0x3164e0)[_0x5125('0x2a')](function(_0x352a3d){return _0x352a3d;});}return null;};}function removeEntity(_0x1dcfee,_0x45c8a7){return function(_0x3d0716){if(_0x3d0716){return _0x3d0716[_0x5125('0x2b')]()[_0x5125('0x2a')](function(){_0x1dcfee[_0x5125('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x159936,_0x4dc1c4){return function(_0x3dac4e){if(!_0x3dac4e){_0x159936[_0x5125('0x1d')](0x194);}return _0x3dac4e;};}function handleError(_0xed7d8,_0x119234){_0x119234=_0x119234||0x1f4;return function(_0x9fa0fa){logger[_0x5125('0x2c')](_0x9fa0fa[_0x5125('0x2d')]);if(_0x9fa0fa[_0x5125('0x2e')]){delete _0x9fa0fa[_0x5125('0x2e')];}_0xed7d8[_0x5125('0x1e')](_0x119234)[_0x5125('0x2f')](_0x9fa0fa);};}exports[_0x5125('0x30')]=function(_0x35f577,_0x4847ef,_0x154c47){if(!_0x35f577['body'][_0x5125('0x31')](_0x5125('0x32'))&&!_0x35f577[_0x5125('0x33')][_0x5125('0x31')](_0x5125('0x34'))){throw new db[(_0x5125('0x35'))][(_0x5125('0x36'))](_0x5125('0x37'));}else{if(_0x35f577[_0x5125('0x33')][_0x5125('0x31')](_0x5125('0x34'))&&!_0x35f577[_0x5125('0x33')][_0x5125('0x31')](_0x5125('0x38'))){throw new db[(_0x5125('0x35'))][(_0x5125('0x36'))](_0x5125('0x39'));}if(!_0x35f577[_0x5125('0x33')]['hasOwnProperty'](_0x5125('0x3a'))){throw new db['Sequelize'][(_0x5125('0x36'))](_0x5125('0x3b'));}else{try{var _0x50ac94=JSON['parse'](_0x35f577[_0x5125('0x33')][_0x5125('0x3a')]);}catch(_0x8242c7){logger[_0x5125('0x2c')](_0x8242c7);throw new db[(_0x5125('0x35'))][(_0x5125('0x36'))](_0x5125('0x3c'));}var _0x16b0af=[_0x5125('0x3d'),_0x5125('0x3e'),_0x5125('0x3f'),_0x5125('0x40'),_0x5125('0x41'),_0x5125('0x42'),_0x5125('0x43'),_0x5125('0x44'),_0x5125('0x45')];if(_[_0x5125('0x46')](_0x50ac94,function(_0x5a4d5a){return!_[_0x5125('0x47')](_0x16b0af,_0x5a4d5a[_0x5125('0x48')][_0x5125('0x49')]());})){throw new db['Sequelize'][(_0x5125('0x36'))](_0x5125('0x4a'));}}}var _0x321e68={};_0x321e68[_0x5125('0x4b')]=_0x35f577[_0x5125('0x33')][_0x5125('0x31')](_0x5125('0x4b'))?_0x35f577[_0x5125('0x33')][_0x5125('0x4b')]:_0x35f577[_0x5125('0x45')][_0x5125('0x4c')];_0x321e68[_0x5125('0x4d')]=_['isEmpty'](_0x35f577[_0x5125('0x33')][_0x5125('0x4d')])?null:_0x35f577[_0x5125('0x33')][_0x5125('0x4d')];_0x321e68[_0x5125('0x4e')]=_0x35f577['body'][_0x5125('0x4e')]||![];_0x321e68['SenderId']=_0x35f577[_0x5125('0x45')]['id'];return getContent(_0x35f577['body'])[_0x5125('0x2a')](function(_0x1709e5){_0x321e68[_0x5125('0x33')]=_0x1709e5;return getRecipients(_0x50ac94);})[_0x5125('0x2a')](function(_0x30be6a){_0x321e68[_0x5125('0x4f')]=_[_0x5125('0x50')](_0x30be6a)['join'](',');return db[_0x5125('0x51')]['transaction'](function(_0x5854c6){return db[_0x5125('0x52')][_0x5125('0x53')](_0x321e68,{'raw':!![],'transaction':_0x5854c6})[_0x5125('0x2a')](function(_0x99bd2e){var _0x260edb={'sender':_0x321e68[_0x5125('0x4b')],'description':_0x321e68[_0x5125('0x4d')],'content':_0x321e68[_0x5125('0x33')],'beep':_0x321e68['beep']};_0x30be6a[_0x5125('0x54')](function(_0x24b185){_0x260edb[_0x5125('0x55')]=_0x24b185;socket['emit'](_0x5125('0x56'),_0x260edb);});return _0x99bd2e;});});})[_0x5125('0x2a')](respondWithResult(_0x4847ef,0xc9))[_0x5125('0x57')](handleError(_0x4847ef,null));};function getContent(_0x1b0f69){return new BPromise(function(_0x129757,_0x3b77ac){if(_0x1b0f69['text']){_0x129757(_0x1b0f69[_0x5125('0x32')]);return;}return db[_0x5125('0x58')]['findOne']({'attributes':[_0x5125('0x59')],'where':{'id':_0x1b0f69['TemplateId']},'raw':!![]})[_0x5125('0x2a')](function(_0x1de410){if(!_0x1de410)throw new db[(_0x5125('0x35'))]['ValidationError'](_0x5125('0x5a'));var _0xd999ed=Mustache[_0x5125('0x5b')](_0x1de410[_0x5125('0x59')],_0x1b0f69[_0x5125('0x38')]);_0x129757(_0xd999ed);})[_0x5125('0x57')](function(_0x32b6d0){_0x3b77ac(_0x32b6d0);});});}function getRecipients(_0x4cad3d){return new BPromise(function(_0xb7cdd8,_0x42b741){var _0x125c80=[];var _0x174276=[];_0x4cad3d[_0x5125('0x54')](function(_0x5cf379){var _0x3630d0=_['startCase'](_0x5cf379[_0x5125('0x48')]['toLowerCase']());if(_0x3630d0===_0x5125('0x5c')){_0x125c80=_[_0x5125('0x5d')](_0x125c80,_0x5cf379[_0x5125('0x5e')]);}else{if(_[_0x5125('0x47')](_0x3630d0,_0x5125('0x5f')))_0x3630d0=_0x3630d0[_0x5125('0x60')](_0x5125('0x5f'),_0x5125('0x61'));_0x5cf379[_0x5125('0x5e')]['forEach'](function(_0xc0e7a2){_0x174276[_0x5125('0x62')](getAgents(_0x3630d0,_0xc0e7a2));});}});return BPromise[_0x5125('0x63')](_0x174276)[_0x5125('0x2a')](function(_0x4a86f7){_0x125c80=_[_0x5125('0x5d')](_0x125c80,_[_0x5125('0x64')](_0x4a86f7));_0xb7cdd8(_0x125c80);})[_0x5125('0x57')](function(_0xa58f48){_0x42b741(_0xa58f48);});});}function getAgents(_0x1754d1,_0x3c24d1){return new BPromise(function(_0x3566f3,_0x3a48ae){return db[_0x1754d1][_0x5125('0x65')]({'where':{'id':_0x3c24d1}})[_0x5125('0x2a')](function(_0x3032e6){return _0x3032e6[_0x5125('0x66')]({'attributes':['id'],'raw':!![]})[_0x5125('0x2a')](function(_0x341d9b){var _0x3d3386=_[_0x5125('0x67')](_0x341d9b,'id');_0x3566f3(_0x3d3386);});})[_0x5125('0x57')](function(_0x1904b6){_0x3a48ae(_0x1904b6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 1c6b3d5..9ef8aec 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 _0x4127=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x4127,0x1e0));var _0x7412=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4127[_0x46aff0];return _0x9d78cf;};'use strict';var EventEmitter=require(_0x7412('0x0'));var UserNotification=require(_0x7412('0x1'))['db'][_0x7412('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7412('0x3')](0x0);var events={'afterCreate':_0x7412('0x4'),'afterUpdate':_0x7412('0x5'),'afterDestroy':'remove'};function emitEvent(_0x172d13){return function(_0x242e6c,_0x1ce3ee,_0x1cb132){UserNotificationEvents[_0x7412('0x6')](_0x172d13+':'+_0x242e6c['id'],_0x242e6c);UserNotificationEvents[_0x7412('0x6')](_0x172d13,_0x242e6c);_0x1cb132(null);};}for(var e in events){if(events[_0x7412('0x7')](e)){var event=events[e];UserNotification[_0x7412('0x8')](e,emitEvent(event));}}module[_0x7412('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x1f6f=['../../mysqldb','UserNotification','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0xce4d01,_0x2b6fa7){var _0x3706d3=function(_0x5609f0){while(--_0x5609f0){_0xce4d01['push'](_0xce4d01['shift']());}};_0x3706d3(++_0x2b6fa7);}(_0x1f6f,0x1bc));var _0xf1f6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1f6f[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xf1f6('0x0'))['db'][_0xf1f6('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xf1f6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3955da){return function(_0x4edaf4,_0x54fc55,_0x2e8c3d){UserNotificationEvents[_0xf1f6('0x3')](_0x3955da+':'+_0x4edaf4['id'],_0x4edaf4);UserNotificationEvents[_0xf1f6('0x3')](_0x3955da,_0x4edaf4);_0x2e8c3d(null);};}for(var e in events){if(events[_0xf1f6('0x4')](e)){var event=events[e];UserNotification[_0xf1f6('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 75ce005..e419046 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 _0x1b07=['../../config/logger','moment','request-promise','path','rimraf','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2b5b23,_0x18ae41){var _0x49febf=function(_0x29392a){while(--_0x29392a){_0x2b5b23['push'](_0x2b5b23['shift']());}};_0x49febf(++_0x18ae41);}(_0x1b07,0x1a0));var _0x71b0=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x1b07[_0xd8a8af];return _0x5b7278;};'use strict';var _=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var logger=require(_0x71b0('0x2'))('api');var moment=require(_0x71b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x71b0('0x4'));var fs=require('fs');var path=require(_0x71b0('0x5'));var rimraf=require(_0x71b0('0x6'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module['exports']=function(_0x3d34e1,_0x4b32db){return _0x3d34e1['define'](_0x71b0('0x7'),attributes,{'tableName':_0x71b0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x71b0('0x9'),'collate':_0x71b0('0xa')});}; \ No newline at end of file +var _0xe157=['userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xe157,0x1f2));var _0x7e15=function(_0x5d0add,_0x349b0e){_0x5d0add=_0x5d0add-0x0;var _0x57dca5=_0xe157[_0x5d0add];return _0x57dca5;};'use strict';var _=require('lodash');var util=require(_0x7e15('0x0'));var logger=require(_0x7e15('0x1'))(_0x7e15('0x2'));var moment=require('moment');var BPromise=require(_0x7e15('0x3'));var rp=require(_0x7e15('0x4'));var fs=require('fs');var path=require(_0x7e15('0x5'));var rimraf=require(_0x7e15('0x6'));var config=require(_0x7e15('0x7'));var attributes=require(_0x7e15('0x8'));module[_0x7e15('0x9')]=function(_0x39e707,_0x332128){return _0x39e707[_0x7e15('0xa')](_0x7e15('0xb'),attributes,{'tableName':_0x7e15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e15('0xd'),'collate':_0x7e15('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 597f060..2973a78 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 _0x1e0a=['../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x8e7703,_0x571749){var _0x10c54f=function(_0xc52c75){while(--_0xc52c75){_0x8e7703['push'](_0x8e7703['shift']());}};_0x10c54f(++_0x571749);}(_0x1e0a,0x97));var _0xa1e0=function(_0x57236a,_0x4e460d){_0x57236a=_0x57236a-0x0;var _0x2c2402=_0x1e0a[_0x57236a];return _0x2c2402;};'use strict';var _=require(_0xa1e0('0x0'));var util=require(_0xa1e0('0x1'));var moment=require('moment');var BPromise=require(_0xa1e0('0x2'));var rs=require(_0xa1e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1e0('0x4'))['db'];var utils=require(_0xa1e0('0x5'));var logger=require('../../config/logger')(_0xa1e0('0x6'));var config=require('../../config/environment');var jayson=require(_0xa1e0('0x7'));var client=jayson['client'][_0xa1e0('0x8')]({'port':0x232a});config['redis']=_[_0xa1e0('0x9')](config[_0xa1e0('0xa')],{'host':_0xa1e0('0xb'),'port':0x18eb});var socket=require(_0xa1e0('0xc'))(new Redis(config['redis']));require(_0xa1e0('0xd'))[_0xa1e0('0xe')](socket);function respondWithRpcPromise(_0xf72a59,_0x33fb92,_0x4fae34){return new BPromise(function(_0x51797f,_0x48c233){return client[_0xa1e0('0xf')](_0xf72a59,_0x4fae34)[_0xa1e0('0x10')](function(_0x2057be){logger[_0xa1e0('0x11')](_0xa1e0('0x12'),_0x33fb92,'request\x20sent');logger['debug'](_0xa1e0('0x13'),_0x33fb92,_0xa1e0('0x14'),JSON['stringify'](_0x2057be));if(_0x2057be[_0xa1e0('0x15')]){if(_0x2057be['error'][_0xa1e0('0x16')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x33fb92,_0x2057be[_0xa1e0('0x15')]['message']);return _0x48c233(_0x2057be['error'][_0xa1e0('0x17')]);}logger[_0xa1e0('0x15')](_0xa1e0('0x12'),_0x33fb92,_0x2057be[_0xa1e0('0x15')]['message']);return _0x51797f(_0x2057be[_0xa1e0('0x15')][_0xa1e0('0x17')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x33fb92,_0xa1e0('0x14'));_0x51797f(_0x2057be[_0xa1e0('0x18')]['message']);}})[_0xa1e0('0x19')](function(_0x40b379){logger[_0xa1e0('0x15')]('UserNotification,\x20%s,\x20%s',_0x33fb92,_0x40b379);_0x48c233(_0x40b379);});});} \ No newline at end of file +var _0xe8d9=['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','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register'];(function(_0x3c779a,_0x25db9b){var _0x3e84e0=function(_0x50b6ac){while(--_0x50b6ac){_0x3c779a['push'](_0x3c779a['shift']());}};_0x3e84e0(++_0x25db9b);}(_0xe8d9,0x6a));var _0x9e8d=function(_0x4fdf66,_0x31d676){_0x4fdf66=_0x4fdf66-0x0;var _0x1b432e=_0xe8d9[_0x4fdf66];return _0x1b432e;};'use strict';var _=require(_0x9e8d('0x0'));var util=require(_0x9e8d('0x1'));var moment=require(_0x9e8d('0x2'));var BPromise=require(_0x9e8d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e8d('0x4'));var db=require(_0x9e8d('0x5'))['db'];var utils=require(_0x9e8d('0x6'));var logger=require(_0x9e8d('0x7'))(_0x9e8d('0x8'));var config=require(_0x9e8d('0x9'));var jayson=require(_0x9e8d('0xa'));var client=jayson[_0x9e8d('0xb')]['http']({'port':0x232a});config[_0x9e8d('0xc')]=_[_0x9e8d('0xd')](config[_0x9e8d('0xc')],{'host':_0x9e8d('0xe'),'port':0x18eb});var socket=require(_0x9e8d('0xf'))(new Redis(config[_0x9e8d('0xc')]));require(_0x9e8d('0x10'))[_0x9e8d('0x11')](socket);function respondWithRpcPromise(_0x13a3d7,_0x8be4f5,_0x158bac){return new BPromise(function(_0x6e918c,_0x3cfd64){return client[_0x9e8d('0x12')](_0x13a3d7,_0x158bac)[_0x9e8d('0x13')](function(_0x24981a){logger[_0x9e8d('0x14')](_0x9e8d('0x15'),_0x8be4f5,'request\x20sent');logger[_0x9e8d('0x16')](_0x9e8d('0x17'),_0x8be4f5,_0x9e8d('0x18'),JSON[_0x9e8d('0x19')](_0x24981a));if(_0x24981a[_0x9e8d('0x1a')]){if(_0x24981a[_0x9e8d('0x1a')][_0x9e8d('0x1b')]===0x1f4){logger[_0x9e8d('0x1a')](_0x9e8d('0x15'),_0x8be4f5,_0x24981a[_0x9e8d('0x1a')][_0x9e8d('0x1c')]);return _0x3cfd64(_0x24981a[_0x9e8d('0x1a')][_0x9e8d('0x1c')]);}logger[_0x9e8d('0x1a')](_0x9e8d('0x15'),_0x8be4f5,_0x24981a[_0x9e8d('0x1a')][_0x9e8d('0x1c')]);return _0x6e918c(_0x24981a['error'][_0x9e8d('0x1c')]);}else{logger[_0x9e8d('0x14')](_0x9e8d('0x15'),_0x8be4f5,_0x9e8d('0x18'));_0x6e918c(_0x24981a[_0x9e8d('0x1d')][_0x9e8d('0x1c')]);}})[_0x9e8d('0x1e')](function(_0x2889fa){logger[_0x9e8d('0x1a')](_0x9e8d('0x15'),_0x8be4f5,_0x2889fa);_0x3cfd64(_0x2889fa);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 3777516..51e39bc 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 _0x11a1=['update','emit','removeListener','register','length','userNotification:','save'];(function(_0x4cd2d7,_0x534197){var _0x1b7d4d=function(_0x269c8c){while(--_0x269c8c){_0x4cd2d7['push'](_0x4cd2d7['shift']());}};_0x1b7d4d(++_0x534197);}(_0x11a1,0x179));var _0x111a=function(_0x485292,_0x40c257){_0x485292=_0x485292-0x0;var _0x6f2a0a=_0x11a1[_0x485292];return _0x6f2a0a;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x111a('0x0'),'remove',_0x111a('0x1')];function createListener(_0x136edc,_0x4bd48e){return function(_0x3e7dd5){_0x4bd48e[_0x111a('0x2')](_0x136edc,_0x3e7dd5);};}function removeListener(_0x1afc28,_0x425e86){return function(){UserNotificationEvents[_0x111a('0x3')](_0x1afc28,_0x425e86);};}exports[_0x111a('0x4')]=function(_0x4d8243){for(var _0x45c49e=0x0,_0x6adfcb=events[_0x111a('0x5')];_0x45c49e<_0x6adfcb;_0x45c49e++){var _0x135bb1=events[_0x45c49e];var _0x4df52b=createListener(_0x111a('0x6')+_0x135bb1,_0x4d8243);UserNotificationEvents['on'](_0x135bb1,_0x4df52b);}}; \ No newline at end of file +var _0x4cc9=['removeListener','length','userNotification:','./userNotification.events','save','remove','update','emit'];(function(_0x34b5eb,_0x40fc5e){var _0x6e0a18=function(_0x2754c0){while(--_0x2754c0){_0x34b5eb['push'](_0x34b5eb['shift']());}};_0x6e0a18(++_0x40fc5e);}(_0x4cc9,0x1db));var _0x94cc=function(_0x59bd73,_0x513813){_0x59bd73=_0x59bd73-0x0;var _0x59d808=_0x4cc9[_0x59bd73];return _0x59d808;};'use strict';var UserNotificationEvents=require(_0x94cc('0x0'));var events=[_0x94cc('0x1'),_0x94cc('0x2'),_0x94cc('0x3')];function createListener(_0x65fdde,_0x44e6a3){return function(_0x5078ec){_0x44e6a3[_0x94cc('0x4')](_0x65fdde,_0x5078ec);};}function removeListener(_0x78528c,_0x31e1d4){return function(){UserNotificationEvents[_0x94cc('0x5')](_0x78528c,_0x31e1d4);};}exports['register']=function(_0x3c3ce4){for(var _0x11e0da=0x0,_0x101f28=events[_0x94cc('0x6')];_0x11e0da<_0x101f28;_0x11e0da++){var _0xd6d943=events[_0x11e0da];var _0x5c068c=createListener(_0x94cc('0x7')+_0xd6d943,_0x3c3ce4);UserNotificationEvents['on'](_0xd6d943,_0x5c068c);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 286448e..fc65012 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(_0x134c9b,_0x2b4738){var _0x33f38e=function(_0x53e7b5){while(--_0x53e7b5){_0x134c9b['push'](_0x134c9b['shift']());}};_0x33f38e(++_0x2b4738);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1dca05,_0x1b0cbb){var _0x5e7c30=function(_0x229d50){while(--_0x229d50){_0x1dca05['push'](_0x1dca05['shift']());}};_0x5e7c30(++_0x1b0cbb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6c2efcb..ca76fb4 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 _0x4873=['exports','INTEGER','sequelize'];(function(_0x35a2b6,_0x45d7ef){var _0x591923=function(_0x324700){while(--_0x324700){_0x35a2b6['push'](_0x35a2b6['shift']());}};_0x591923(++_0x45d7ef);}(_0x4873,0x1df));var _0x3487=function(_0x36b402,_0xa1ebf2){_0x36b402=_0x36b402-0x0;var _0x33467d=_0x4873[_0x36b402];return _0x33467d;};'use strict';var Sequelize=require(_0x3487('0x0'));module[_0x3487('0x1')]={'penalty':{'type':Sequelize[_0x3487('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x294b=['sequelize','INTEGER'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb294('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb294('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 36a0edb..882c8de 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 _0x9828=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x591792,_0x5cc6d4){var _0x2e11c2=function(_0x4d32df){while(--_0x4d32df){_0x591792['push'](_0x591792['shift']());}};_0x2e11c2(++_0x5cc6d4);}(_0x9828,0xe7));var _0x8982=function(_0x516fd1,_0x54b257){_0x516fd1=_0x516fd1-0x0;var _0x4936a4=_0x9828[_0x516fd1];return _0x4936a4;};'use strict';var _=require('lodash');var util=require(_0x8982('0x0'));var logger=require(_0x8982('0x1'))(_0x8982('0x2'));var moment=require(_0x8982('0x3'));var BPromise=require('bluebird');var rp=require(_0x8982('0x4'));var fs=require('fs');var path=require(_0x8982('0x5'));var rimraf=require('rimraf');var config=require(_0x8982('0x6'));var attributes=require(_0x8982('0x7'));module['exports']=function(_0xb98514,_0x249150){return _0xb98514[_0x8982('0x8')](_0x8982('0x9'),attributes,{'tableName':_0x8982('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcb6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbcb6,0x130));var _0x6bcb=function(_0x4080dd,_0x5b595d){_0x4080dd=_0x4080dd-0x0;var _0x4ecf85=_0xbcb6[_0x4080dd];return _0x4ecf85;};'use strict';var _=require(_0x6bcb('0x0'));var util=require(_0x6bcb('0x1'));var logger=require(_0x6bcb('0x2'))(_0x6bcb('0x3'));var moment=require(_0x6bcb('0x4'));var BPromise=require(_0x6bcb('0x5'));var rp=require(_0x6bcb('0x6'));var fs=require('fs');var path=require(_0x6bcb('0x7'));var rimraf=require(_0x6bcb('0x8'));var config=require(_0x6bcb('0x9'));var attributes=require(_0x6bcb('0xa'));module[_0x6bcb('0xb')]=function(_0xc8e61f,_0x1bdf6f){return _0xc8e61f[_0x6bcb('0xc')](_0x6bcb('0xd'),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 2639c3d..094f9be 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 _0x8230=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5737a3,_0x2b8f3f){var _0x59f22c=function(_0xb9c5ee){while(--_0xb9c5ee){_0x5737a3['push'](_0x5737a3['shift']());}};_0x59f22c(++_0x2b8f3f);}(_0x8230,0xd2));var _0x0823=function(_0x50a308,_0x1b4b13){_0x50a308=_0x50a308-0x0;var _0x258b53=_0x8230[_0x50a308];return _0x258b53;};'use strict';var _=require(_0x0823('0x0'));var util=require(_0x0823('0x1'));var moment=require('moment');var BPromise=require(_0x0823('0x2'));var rs=require(_0x0823('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0823('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0823('0x5'))(_0x0823('0x6'));var config=require(_0x0823('0x7'));var jayson=require(_0x0823('0x8'));var client=jayson['client'][_0x0823('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481c0b,_0x3af4ef,_0x56038c){return new BPromise(function(_0x5ee074,_0x5be746){return client[_0x0823('0xa')](_0x481c0b,_0x56038c)[_0x0823('0xb')](function(_0x100f72){logger[_0x0823('0xc')](_0x0823('0xd'),_0x3af4ef,_0x0823('0xe'));logger[_0x0823('0xf')](_0x0823('0x10'),_0x3af4ef,_0x0823('0xe'),JSON[_0x0823('0x11')](_0x100f72));if(_0x100f72[_0x0823('0x12')]){if(_0x100f72[_0x0823('0x12')]['code']===0x1f4){logger[_0x0823('0x12')](_0x0823('0xd'),_0x3af4ef,_0x100f72[_0x0823('0x12')]['message']);return _0x5be746(_0x100f72[_0x0823('0x12')][_0x0823('0x13')]);}logger[_0x0823('0x12')](_0x0823('0xd'),_0x3af4ef,_0x100f72['error'][_0x0823('0x13')]);return _0x5ee074(_0x100f72[_0x0823('0x12')][_0x0823('0x13')]);}else{logger[_0x0823('0xc')](_0x0823('0xd'),_0x3af4ef,_0x0823('0xe'));_0x5ee074(_0x100f72[_0x0823('0x14')]['message']);}})[_0x0823('0x15')](function(_0xcb5c26){logger[_0x0823('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3af4ef,_0xcb5c26);_0x5be746(_0xcb5c26);});});} \ No newline at end of file +var _0x4727=['http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x49f261,_0x584885){var _0x1fd708=function(_0x11cefa){while(--_0x11cefa){_0x49f261['push'](_0x49f261['shift']());}};_0x1fd708(++_0x584885);}(_0x4727,0x187));var _0x7472=function(_0x18eb84,_0x188bd3){_0x18eb84=_0x18eb84-0x0;var _0x2af75e=_0x4727[_0x18eb84];return _0x2af75e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7472('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7472('0x1'));var db=require(_0x7472('0x2'))['db'];var utils=require(_0x7472('0x3'));var logger=require(_0x7472('0x4'))(_0x7472('0x5'));var config=require(_0x7472('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7472('0x7')][_0x7472('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e9c6d,_0x505e4f,_0x48590a){return new BPromise(function(_0x35893e,_0xeebb16){return client[_0x7472('0x9')](_0x2e9c6d,_0x48590a)['then'](function(_0x19967c){logger[_0x7472('0xa')](_0x7472('0xb'),_0x505e4f,_0x7472('0xc'));logger[_0x7472('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x505e4f,_0x7472('0xc'),JSON[_0x7472('0xe')](_0x19967c));if(_0x19967c[_0x7472('0xf')]){if(_0x19967c[_0x7472('0xf')][_0x7472('0x10')]===0x1f4){logger[_0x7472('0xf')](_0x7472('0xb'),_0x505e4f,_0x19967c[_0x7472('0xf')][_0x7472('0x11')]);return _0xeebb16(_0x19967c[_0x7472('0xf')][_0x7472('0x11')]);}logger[_0x7472('0xf')](_0x7472('0xb'),_0x505e4f,_0x19967c[_0x7472('0xf')][_0x7472('0x11')]);return _0x35893e(_0x19967c[_0x7472('0xf')][_0x7472('0x11')]);}else{logger[_0x7472('0xa')](_0x7472('0xb'),_0x505e4f,'request\x20sent');_0x35893e(_0x19967c['result'][_0x7472('0x11')]);}})[_0x7472('0x12')](function(_0x957ec0){logger[_0x7472('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x505e4f,_0x957ec0);_0xeebb16(_0x957ec0);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 9d450cd..4e30e6c 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 _0x2a23=['removeResources','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','show','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','/:id','update','delete','destroy','removeSections'];(function(_0x16ebbe,_0x2d8519){var _0x3753dc=function(_0x44583f){while(--_0x44583f){_0x16ebbe['push'](_0x16ebbe['shift']());}};_0x3753dc(++_0x2d8519);}(_0x2a23,0x65));var _0x32a2=function(_0x4605ba,_0x5471e0){_0x4605ba=_0x4605ba-0x0;var _0x1b9828=_0x2a23[_0x4605ba];return _0x1b9828;};'use strict';var multer=require(_0x32a2('0x0'));var util=require(_0x32a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x32a2('0x2'));var router=express[_0x32a2('0x3')]();var fs_extra=require(_0x32a2('0x4'));var auth=require(_0x32a2('0x5'));var interaction=require(_0x32a2('0x6'));var config=require(_0x32a2('0x7'));var controller=require(_0x32a2('0x8'));router['get']('/',auth[_0x32a2('0x9')](),controller[_0x32a2('0xa')]);router[_0x32a2('0xb')](_0x32a2('0xc'),auth[_0x32a2('0x9')](),controller[_0x32a2('0xd')]);router[_0x32a2('0xb')]('/:id',auth[_0x32a2('0x9')](),controller[_0x32a2('0xe')]);router['get']('/:id/sections',auth[_0x32a2('0x9')](),controller[_0x32a2('0xf')]);router['get'](_0x32a2('0x10'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x11')]);router[_0x32a2('0x12')]('/',auth['isAuthenticated'](),controller[_0x32a2('0x13')]);router[_0x32a2('0x12')](_0x32a2('0x14'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x15')]);router[_0x32a2('0x12')](_0x32a2('0x16'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x17')]);router['post'](_0x32a2('0x10'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x18')]);router[_0x32a2('0x19')](_0x32a2('0x1a'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x1b')]);router[_0x32a2('0x1c')](_0x32a2('0x1a'),auth['isAuthenticated'](),controller[_0x32a2('0x1d')]);router['delete']('/:id/sections',auth[_0x32a2('0x9')](),controller[_0x32a2('0x1e')]);router[_0x32a2('0x1c')](_0x32a2('0x10'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x1f')]);module[_0x32a2('0x20')]=router; \ No newline at end of file +var _0x2350=['put','update','delete','removeSections','/:id/resources','removeResources','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','get','describe','/:id','show','/:id/sections','post','/:id/clone','clone','addResources'];(function(_0x5921dd,_0x15770d){var _0x1cf8fe=function(_0x41c347){while(--_0x41c347){_0x5921dd['push'](_0x5921dd['shift']());}};_0x1cf8fe(++_0x15770d);}(_0x2350,0xf1));var _0x0235=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0x2350[_0x28c939];return _0x527fe9;};'use strict';var multer=require(_0x0235('0x0'));var util=require(_0x0235('0x1'));var path=require('path');var timeout=require(_0x0235('0x2'));var express=require(_0x0235('0x3'));var router=express['Router']();var fs_extra=require(_0x0235('0x4'));var auth=require(_0x0235('0x5'));var interaction=require(_0x0235('0x6'));var config=require('../../config/environment');var controller=require(_0x0235('0x7'));router['get']('/',auth[_0x0235('0x8')](),controller[_0x0235('0x9')]);router[_0x0235('0xa')]('/describe',auth[_0x0235('0x8')](),controller[_0x0235('0xb')]);router['get'](_0x0235('0xc'),auth[_0x0235('0x8')](),controller[_0x0235('0xd')]);router[_0x0235('0xa')](_0x0235('0xe'),auth['isAuthenticated'](),controller['getSections']);router[_0x0235('0xa')]('/:id/resources',auth[_0x0235('0x8')](),controller['getResources']);router[_0x0235('0xf')]('/',auth[_0x0235('0x8')](),controller['create']);router[_0x0235('0xf')](_0x0235('0x10'),auth['isAuthenticated'](),controller[_0x0235('0x11')]);router[_0x0235('0xf')](_0x0235('0xe'),auth[_0x0235('0x8')](),controller['addSections']);router[_0x0235('0xf')]('/:id/resources',auth['isAuthenticated'](),controller[_0x0235('0x12')]);router[_0x0235('0x13')](_0x0235('0xc'),auth[_0x0235('0x8')](),controller[_0x0235('0x14')]);router[_0x0235('0x15')]('/:id',auth[_0x0235('0x8')](),controller['destroy']);router[_0x0235('0x15')]('/:id/sections',auth[_0x0235('0x8')](),controller[_0x0235('0x16')]);router[_0x0235('0x15')](_0x0235('0x17'),auth[_0x0235('0x8')](),controller[_0x0235('0x18')]);module[_0x0235('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3cf8e37..6dc147a 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 _0xd5e2=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0xcfdf73,_0x55eaa1){var _0x14168a=function(_0x34ed57){while(--_0x34ed57){_0xcfdf73['push'](_0xcfdf73['shift']());}};_0x14168a(++_0x55eaa1);}(_0xd5e2,0x8a));var _0x2d5e=function(_0x5a23e5,_0x235f58){_0x5a23e5=_0x5a23e5-0x0;var _0x4f4e67=_0xd5e2[_0x5a23e5];return _0x4f4e67;};'use strict';var Sequelize=require('sequelize');module[_0x2d5e('0x0')]={'name':{'type':Sequelize[_0x2d5e('0x1')],'allowNull':![],'unique':_0x2d5e('0x2')},'crudPermissions':{'type':Sequelize[_0x2d5e('0x1')],'set':function(_0x144615){this[_0x2d5e('0x3')](_0x2d5e('0x4'),_0x144615?_0x144615[_0x2d5e('0x5')](''):[]);},'get':function(){return this[_0x2d5e('0x6')](_0x2d5e('0x4'))?this[_0x2d5e('0x6')](_0x2d5e('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2d5e('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2d5e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x2d5e('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2d5e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3f49=['name','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x24bdfc,_0x5cea95){var _0x16cbc1=function(_0xa100ea){while(--_0xa100ea){_0x24bdfc['push'](_0x24bdfc['shift']());}};_0x16cbc1(++_0x5cea95);}(_0x3f49,0x17a));var _0x93f4=function(_0xc4fa3f,_0x11d5eb){_0xc4fa3f=_0xc4fa3f-0x0;var _0x10e2bf=_0x3f49[_0xc4fa3f];return _0x10e2bf;};'use strict';var Sequelize=require(_0x93f4('0x0'));module[_0x93f4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x93f4('0x2')},'crudPermissions':{'type':Sequelize[_0x93f4('0x3')],'set':function(_0x372151){this[_0x93f4('0x4')](_0x93f4('0x5'),_0x372151?_0x372151[_0x93f4('0x6')](''):[]);},'get':function(){return this[_0x93f4('0x7')](_0x93f4('0x5'))?this[_0x93f4('0x7')](_0x93f4('0x5'))[_0x93f4('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x93f4('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x93f4('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x93f4('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x93f4('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x93f4('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x93f4('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 212e34b..cc5a6ad 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 _0x5b6e=['removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','create','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','describe','addSections','UserProfileResource','push','getSections','enabled','includes','subsections','findOne','forEach','resourceId','Plugin','addResources','bulkCreate'];(function(_0x666eb9,_0x5a9e90){var _0x3fc80b=function(_0x4ec6ff){while(--_0x4ec6ff){_0x666eb9['push'](_0x666eb9['shift']());}};_0x3fc80b(++_0x5a9e90);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x5452b3,_0x20e94e){_0x5452b3=_0x5452b3-0x0;var _0x31a5dd=_0x5b6e[_0x5452b3];return _0x31a5dd;};'use strict';var emlformat=require(_0xe5b6('0x0'));var rimraf=require(_0xe5b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe5b6('0x2'));var rp=require('request-promise');var moment=require(_0xe5b6('0x3'));var BPromise=require(_0xe5b6('0x4'));var Mustache=require(_0xe5b6('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe5b6('0x6'));var csv=require(_0xe5b6('0x7'));var ejs=require(_0xe5b6('0x8'));var fs=require('fs');var fs_extra=require(_0xe5b6('0x9'));var _=require('lodash');var squel=require(_0xe5b6('0xa'));var crypto=require(_0xe5b6('0xb'));var jsforce=require(_0xe5b6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe5b6('0x7'));var querystring=require('querystring');var Papa=require(_0xe5b6('0xd'));var Redis=require(_0xe5b6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe5b6('0xf'));var as=require(_0xe5b6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5b6('0x11'))(_0xe5b6('0x12'));var utils=require('../../config/utils');var config=require(_0xe5b6('0x13'));var licenseUtil=require(_0xe5b6('0x14'));var db=require('../../mysqldb')['db'];config[_0xe5b6('0x15')]=_[_0xe5b6('0x16')](config[_0xe5b6('0x15')],{'host':_0xe5b6('0x17'),'port':0x18eb});var socket=require(_0xe5b6('0x18'))(new Redis(config['redis']));require(_0xe5b6('0x19'))[_0xe5b6('0x1a')](socket);function respondWithStatusCode(_0x172ea1,_0x444b97){_0x444b97=_0x444b97||0xcc;return function(_0x533025){if(_0x533025){return _0x172ea1[_0xe5b6('0x1b')](_0x444b97);}return _0x172ea1[_0xe5b6('0x1c')](_0x444b97)[_0xe5b6('0x1d')]();};}function respondWithResult(_0x117ccd,_0x1d3bd8){_0x1d3bd8=_0x1d3bd8||0xc8;return function(_0x2c9aec){if(_0x2c9aec){return _0x117ccd['status'](_0x1d3bd8)[_0xe5b6('0x1e')](_0x2c9aec);}};}function respondWithFilteredResult(_0x482a71,_0x532395){return function(_0x5b50b1){if(_0x5b50b1){var _0x1915c5=typeof _0x532395['offset']===_0xe5b6('0x1f')&&typeof _0x532395[_0xe5b6('0x20')]===_0xe5b6('0x1f');var _0x383f19=_0x5b50b1[_0xe5b6('0x21')];var _0x195160=_0x1915c5?0x0:_0x532395[_0xe5b6('0x22')];var _0x33d7d3=_0x1915c5?_0x5b50b1['count']:_0x532395[_0xe5b6('0x22')]+_0x532395[_0xe5b6('0x20')];var _0xc895ff;if(_0x33d7d3>=_0x383f19){_0x33d7d3=_0x383f19;_0xc895ff=0xc8;}else{_0xc895ff=0xce;}_0x482a71[_0xe5b6('0x1c')](_0xc895ff);return _0x482a71[_0xe5b6('0x23')]('Content-Range',_0x195160+'-'+_0x33d7d3+'/'+_0x383f19)[_0xe5b6('0x1e')](_0x5b50b1);}return null;};}function patchUpdates(_0x531e67){return function(_0x14aa89){try{jsonpatch['apply'](_0x14aa89,_0x531e67,!![]);}catch(_0x4a5fff){return BPromise['reject'](_0x4a5fff);}return _0x14aa89['save']();};}function saveUpdates(_0x2f0c1f,_0x449527){return function(_0x5bb96b){if(_0x5bb96b){return _0x5bb96b[_0xe5b6('0x24')](_0x2f0c1f)[_0xe5b6('0x25')](function(_0x24b85f){return _0x24b85f;});}return null;};}function removeEntity(_0x4c754b,_0x2f2561){return function(_0x5c778d){if(_0x5c778d){return _0x5c778d[_0xe5b6('0x26')]()[_0xe5b6('0x25')](function(){_0x4c754b[_0xe5b6('0x1c')](0xcc)[_0xe5b6('0x1d')]();});}};}function handleEntityNotFound(_0x1532f7,_0x4530cf){return function(_0x67e54d){if(!_0x67e54d){_0x1532f7[_0xe5b6('0x1b')](0x194);}return _0x67e54d;};}function handleError(_0xb33738,_0x12b0d4){_0x12b0d4=_0x12b0d4||0x1f4;return function(_0x319d62){logger[_0xe5b6('0x27')](_0x319d62[_0xe5b6('0x28')]);if(_0x319d62[_0xe5b6('0x29')]){delete _0x319d62[_0xe5b6('0x29')];}_0xb33738['status'](_0x12b0d4)[_0xe5b6('0x2a')](_0x319d62);};}exports[_0xe5b6('0x2b')]=function(_0x2dc870,_0x2e3cfb){var _0x2cf845={},_0xfd4254={},_0x106208={'count':0x0,'rows':[]};var _0x12d080=_[_0xe5b6('0x2c')](db[_0xe5b6('0x2d')][_0xe5b6('0x2e')],function(_0x570893){return{'name':_0x570893[_0xe5b6('0x2f')],'type':_0x570893[_0xe5b6('0x30')][_0xe5b6('0x31')]};});_0xfd4254[_0xe5b6('0x32')]=_[_0xe5b6('0x2c')](_0x12d080,_0xe5b6('0x29'));_0xfd4254[_0xe5b6('0x33')]=_['keys'](_0x2dc870[_0xe5b6('0x33')]);_0xfd4254[_0xe5b6('0x34')]=_[_0xe5b6('0x35')](_0xfd4254[_0xe5b6('0x32')],_0xfd4254[_0xe5b6('0x33')]);_0x2cf845[_0xe5b6('0x36')]=_['intersection'](_0xfd4254[_0xe5b6('0x32')],qs[_0xe5b6('0x37')](_0x2dc870['query']['fields']));_0x2cf845[_0xe5b6('0x36')]=_0x2cf845['attributes'][_0xe5b6('0x38')]?_0x2cf845[_0xe5b6('0x36')]:_0xfd4254[_0xe5b6('0x32')];if(!_0x2dc870[_0xe5b6('0x33')][_0xe5b6('0x39')](_0xe5b6('0x3a'))){_0x2cf845[_0xe5b6('0x20')]=qs[_0xe5b6('0x20')](_0x2dc870[_0xe5b6('0x33')][_0xe5b6('0x20')]);_0x2cf845['offset']=qs[_0xe5b6('0x22')](_0x2dc870['query'][_0xe5b6('0x22')]);}_0x2cf845['order']=qs['sort'](_0x2dc870[_0xe5b6('0x33')][_0xe5b6('0x3b')]);_0x2cf845[_0xe5b6('0x3c')]=qs[_0xe5b6('0x34')](_[_0xe5b6('0x3d')](_0x2dc870[_0xe5b6('0x33')],_0xfd4254[_0xe5b6('0x34')]),_0x12d080);if(_0x2dc870['query'][_0xe5b6('0x3e')]){_0x2cf845['where']=_['merge'](_0x2cf845['where'],{'$or':_[_0xe5b6('0x2c')](_0x12d080,function(_0x348352){if(_0x348352['type']!=='VIRTUAL'){var _0x533f18={};_0x533f18[_0x348352[_0xe5b6('0x29')]]={'$like':'%'+_0x2dc870[_0xe5b6('0x33')][_0xe5b6('0x3e')]+'%'};return _0x533f18;}})});}_0x2cf845=_[_0xe5b6('0x3f')]({},_0x2cf845,_0x2dc870[_0xe5b6('0x40')]);var _0x30fe47={'where':_0x2cf845[_0xe5b6('0x3c')]};return db[_0xe5b6('0x2d')][_0xe5b6('0x21')](_0x30fe47)[_0xe5b6('0x25')](function(_0x4b67b7){_0x106208[_0xe5b6('0x21')]=_0x4b67b7;if(_0x2dc870[_0xe5b6('0x33')][_0xe5b6('0x41')]){_0x2cf845[_0xe5b6('0x42')]=[{'all':!![]}];}return db[_0xe5b6('0x2d')][_0xe5b6('0x43')](_0x2cf845);})[_0xe5b6('0x25')](function(_0x4c509a){_0x106208[_0xe5b6('0x44')]=_0x4c509a;return _0x106208;})[_0xe5b6('0x25')](respondWithFilteredResult(_0x2e3cfb,_0x2cf845))[_0xe5b6('0x45')](handleError(_0x2e3cfb,null));};exports[_0xe5b6('0x46')]=function(_0xce1d56,_0x468673){var _0x527d54={'raw':![],'where':{'id':_0xce1d56[_0xe5b6('0x47')]['id']}},_0x2d9488={};_0x2d9488[_0xe5b6('0x32')]=_['keys'](db[_0xe5b6('0x2d')][_0xe5b6('0x2e')]);_0x2d9488[_0xe5b6('0x33')]=_[_0xe5b6('0x48')](_0xce1d56['query']);_0x2d9488['filters']=_[_0xe5b6('0x35')](_0x2d9488[_0xe5b6('0x32')],_0x2d9488[_0xe5b6('0x33')]);_0x527d54['attributes']=_[_0xe5b6('0x35')](_0x2d9488[_0xe5b6('0x32')],qs[_0xe5b6('0x37')](_0xce1d56['query'][_0xe5b6('0x37')]));_0x527d54[_0xe5b6('0x36')]=_0x527d54['attributes'][_0xe5b6('0x38')]?_0x527d54['attributes']:_0x2d9488[_0xe5b6('0x32')];if(_0xce1d56[_0xe5b6('0x33')][_0xe5b6('0x41')]){_0x527d54[_0xe5b6('0x42')]=[{'all':!![]}];}_0x527d54=_[_0xe5b6('0x3f')]({},_0x527d54,_0xce1d56[_0xe5b6('0x40')]);return db[_0xe5b6('0x2d')][_0xe5b6('0x49')](_0x527d54)[_0xe5b6('0x25')](handleEntityNotFound(_0x468673,null))['then'](respondWithResult(_0x468673,null))['catch'](handleError(_0x468673,null));};exports['create']=function(_0x5d8748,_0x21d0b6){return db[_0xe5b6('0x2d')]['create'](_0x5d8748['body'],{})[_0xe5b6('0x25')](respondWithResult(_0x21d0b6,0xc9))[_0xe5b6('0x45')](handleError(_0x21d0b6,null));};exports[_0xe5b6('0x4a')]=function(_0x3bfb39,_0xa912d5){var _0x169adf={'where':{'id':_0x3bfb39[_0xe5b6('0x47')]['id']}},_0x254124={};_0x254124[_0xe5b6('0x32')]=_[_0xe5b6('0x48')](db['UserProfile'][_0xe5b6('0x2e')]);_0x169adf[_0xe5b6('0x36')]=_[_0xe5b6('0x35')](_0x254124[_0xe5b6('0x32')],qs[_0xe5b6('0x37')](_0x3bfb39[_0xe5b6('0x33')][_0xe5b6('0x37')]));_0x169adf['attributes']=_0x169adf[_0xe5b6('0x36')]['length']?_0x169adf[_0xe5b6('0x36')]:_0x254124[_0xe5b6('0x32')];if(_0x3bfb39['query'][_0xe5b6('0x41')]){_0x169adf[_0xe5b6('0x42')]=[{'all':!![]}];}_0x169adf=_['merge']({},_0x169adf,_0x3bfb39[_0xe5b6('0x40')]);return db['UserProfile'][_0xe5b6('0x49')](_0x169adf)[_0xe5b6('0x25')](handleEntityNotFound(_0xa912d5,null))['then'](function(_0x4cfccc){if(_0x4cfccc){var _0x2dfda1=_0x4cfccc[_0xe5b6('0x4b')]({'plain':!![]});_0x2dfda1=qs[_0xe5b6('0x4c')](_0x2dfda1,['id',_0xe5b6('0x4d'),_0xe5b6('0x4e'),_0xe5b6('0x4f')]);_0x3bfb39[_0xe5b6('0x50')]=_[_0xe5b6('0x4c')](_0x3bfb39[_0xe5b6('0x50')],['id',_0xe5b6('0x4d'),_0xe5b6('0x4e')]);return db[_0xe5b6('0x51')][_0xe5b6('0x52')](function(_0x1c8700){return db[_0xe5b6('0x2d')][_0xe5b6('0x53')](_[_0xe5b6('0x3f')](_0x2dfda1,_0x3bfb39[_0xe5b6('0x50')]),{'include':_0x3bfb39[_0xe5b6('0x33')][_0xe5b6('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x1c8700})[_0xe5b6('0x25')](function(_0x395354){var _0x572f55=_0x395354[_0xe5b6('0x4b')]({'plain':!![]});return db[_0xe5b6('0x54')][_0xe5b6('0x43')]({'where':{'userProfileId':_0x3bfb39[_0xe5b6('0x47')]['id']},'raw':!![]})[_0xe5b6('0x25')](function(_0x4ed818){if(_0x4ed818){return BPromise[_0xe5b6('0x55')](_0x4ed818,function(_0x52c61d){return new BPromise(function(_0x7396de,_0x48c161){if(_0x52c61d[_0xe5b6('0x56')]===null||_0x52c61d[_0xe5b6('0x56')]===0x1)_0x7396de(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x52c61d['id']},'raw':!![]})[_0xe5b6('0x25')](function(_0x399d85){var _0x3826ee=_['map'](_0x399d85,function(_0x82653e){return qs['omit'](_0x82653e,['id','createdAt',_0xe5b6('0x4e'),_0xe5b6('0x57')]);});_0x7396de(_0x3826ee);})[_0xe5b6('0x45')](function(_0x3ba74c){_0x48c161(_0x3ba74c);});})[_0xe5b6('0x25')](function(_0x138d56){var _0x439d19=qs[_0xe5b6('0x4c')](_0x52c61d,['id',_0xe5b6('0x4d'),_0xe5b6('0x4e')]);_0x439d19[_0xe5b6('0x58')]=_0x572f55['id'];if(_0x138d56)_0x439d19[_0xe5b6('0x59')]=_0x138d56;return _0x439d19;})[_0xe5b6('0x25')](function(_0x152a12){return db[_0xe5b6('0x54')][_0xe5b6('0x53')](_0x152a12,{'include':[{'model':db['UserProfileResource'],'as':_0xe5b6('0x59')}],'raw':!![],'transaction':_0x1c8700});});})[_0xe5b6('0x25')](function(){return _0x572f55;});}});});});}})['then'](respondWithResult(_0xa912d5,0xc9))['catch'](handleError(_0xa912d5,null));};exports['update']=function(_0x2887a0,_0x1686cf){if(_0x2887a0['body']['id']){delete _0x2887a0['body']['id'];}return db['UserProfile'][_0xe5b6('0x49')]({'where':{'id':_0x2887a0[_0xe5b6('0x47')]['id']}})[_0xe5b6('0x25')](handleEntityNotFound(_0x1686cf,null))[_0xe5b6('0x25')](saveUpdates(_0x2887a0[_0xe5b6('0x50')],null))[_0xe5b6('0x25')](respondWithResult(_0x1686cf,null))[_0xe5b6('0x45')](handleError(_0x1686cf,null));};exports[_0xe5b6('0x26')]=function(_0x7ff580,_0x599c19){return db[_0xe5b6('0x2d')][_0xe5b6('0x49')]({'where':{'id':_0x7ff580[_0xe5b6('0x47')]['id']}})[_0xe5b6('0x25')](handleEntityNotFound(_0x599c19,null))['then'](removeEntity(_0x599c19,null))['catch'](handleError(_0x599c19,null));};exports[_0xe5b6('0x5a')]=function(_0x205160,_0x1a4204){return db[_0xe5b6('0x2d')][_0xe5b6('0x5a')]()[_0xe5b6('0x25')](respondWithResult(_0x1a4204,null))['catch'](handleError(_0x1a4204,null));};exports[_0xe5b6('0x5b')]=function(_0x428d1b,_0x4057c9){var _0x3917f3=_0x428d1b[_0xe5b6('0x50')];return db[_0xe5b6('0x2d')][_0xe5b6('0x49')]({'where':{'id':_0x428d1b[_0xe5b6('0x47')]['id']}})[_0xe5b6('0x25')](handleEntityNotFound(_0x4057c9,null))[_0xe5b6('0x25')](function(_0x4f4553){if(_0x4f4553){return db['sequelize']['transaction'](function(_0x589edc){return db[_0xe5b6('0x54')]['destroy']({'where':{'userProfileId':_0x428d1b[_0xe5b6('0x47')]['id'],'sectionId':_[_0xe5b6('0x2c')](_0x3917f3,function(_0x1b1214){return _0x1b1214[_0xe5b6('0x57')];})},'transaction':_0x589edc})[_0xe5b6('0x25')](function(){var _0x435ea0=_[_0xe5b6('0x2c')](_0x3917f3,function(_0x38f199){_0x38f199['userProfileId']=_0x428d1b[_0xe5b6('0x47')]['id'];return _0x38f199;});var _0x1179de=[];return BPromise[_0xe5b6('0x55')](_0x435ea0,function(_0x38da3e){return db['UserProfileSection'][_0xe5b6('0x53')](_0x38da3e,{'include':[{'model':db[_0xe5b6('0x5c')],'as':_0xe5b6('0x59')}],'raw':!![],'transaction':_0x589edc})[_0xe5b6('0x25')](function(_0x4310a6){_0x1179de[_0xe5b6('0x5d')](_0x4310a6[_0xe5b6('0x4b')]({'plain':!![]}));});})['then'](function(){return _0x1179de;});});});}})['then'](function(_0x2b5851){return _0x2b5851;})[_0xe5b6('0x25')](respondWithResult(_0x4057c9,null))['catch'](handleError(_0x4057c9,null));};exports['removeSections']=function(_0x25c83d,_0x25473c){var _0x45b683;return db[_0xe5b6('0x2d')][_0xe5b6('0x49')]({'where':{'id':_0x25c83d[_0xe5b6('0x47')]['id']},'attributes':['id',_0xe5b6('0x29')]})[_0xe5b6('0x25')](handleEntityNotFound(_0x25473c,null))[_0xe5b6('0x25')](function(_0x2bd101){if(_0x2bd101){_0x45b683=_0x2bd101;return db[_0xe5b6('0x54')][_0xe5b6('0x26')]({'where':{'userProfileId':_0x25c83d[_0xe5b6('0x47')]['id'],'sectionId':_0x25c83d['query']['ids']}});}})[_0xe5b6('0x25')](function(){return _0x45b683;})[_0xe5b6('0x25')](respondWithStatusCode(_0x25473c,null))['catch'](handleError(_0x25473c,null));};exports[_0xe5b6('0x5e')]=function(_0x23b6d6,_0x1950b5){var _0x12886b=[];var _0x273a59=[];return db[_0xe5b6('0x54')][_0xe5b6('0x43')]({'where':{'userProfileId':_0x23b6d6['params']['id']},'raw':!![]})[_0xe5b6('0x25')](function(_0x5a00c1){_0x12886b=_[_0xe5b6('0x3e')](_0x5a00c1,function(_0x5dcd6c){return _0x5dcd6c[_0xe5b6('0x5f')]===0x1||_[_0xe5b6('0x60')]([0x3eb,0x709],_0x5dcd6c['sectionId']);});if(!_['isEmpty'](_0x12886b)){return _[_0xe5b6('0x2c')](_0x12886b,function(_0x2efb35){return _0x2efb35[_0xe5b6('0x57')];});}else{return;}})[_0xe5b6('0x25')](function(_0x3e8cb9){if(_0x3e8cb9)_0x273a59=_0x3e8cb9;if(_[_0xe5b6('0x60')](_0x273a59,0x64)){var _0x3c9605=_['find'](_0x12886b,{'sectionId':0x64});return hasDefaultDashboard(_0x3c9605)[_0xe5b6('0x25')](function(_0x1d89de){return _[_0xe5b6('0x2c')](_0x12886b,function(_0x4cd243){if(_0x4cd243[_0xe5b6('0x57')]===0x64){_0x4cd243[_0xe5b6('0x61')]=_0x1d89de;}return _0x4cd243;});});}else{return;}})['then'](function(_0x528e56){if(_0x528e56)_0x12886b=_0x528e56;if(_[_0xe5b6('0x60')](_0x273a59,0x3eb)){var _0xf5cb82=_[_0xe5b6('0x49')](_0x12886b,{'sectionId':0x3eb});return getCustomDashboards(_0xf5cb82)['then'](function(_0x2b07ae){return _[_0xe5b6('0x2c')](_0x12886b,function(_0x48e318){if(_0xf5cb82[_0xe5b6('0x5f')]){if(_0x48e318[_0xe5b6('0x57')]===0x3eb){_0x48e318[_0xe5b6('0x61')]=_0x2b07ae;}}else{if(_0x48e318[_0xe5b6('0x57')]===0x64){_0x48e318['subsections']=_0x2b07ae;}}return _0x48e318;});});}else{return;}})['then'](function(_0x1996aa){if(_0x1996aa)_0x12886b=_0x1996aa;if(_[_0xe5b6('0x60')](_0x273a59,0x709)){var _0x17d4c5=_[_0xe5b6('0x49')](_0x12886b,{'sectionId':0x709});return getPlugins(_0x17d4c5)[_0xe5b6('0x25')](function(_0xe656ec){if(_0x17d4c5[_0xe5b6('0x5f')]){return _[_0xe5b6('0x2c')](_0x12886b,function(_0x375039){if(_0x375039[_0xe5b6('0x57')]===0x709){_0x375039[_0xe5b6('0x61')]=_0xe656ec;}return _0x375039;});}else{var _0x2b49f8={'sectionId':0x76c,'enabled':0x1,'subsections':_0xe656ec};var _0x1aed89=_[_0xe5b6('0x2c')](_0x12886b);_0x1aed89[_0xe5b6('0x5d')](_0x2b49f8);return _0x1aed89;}});}else{return;}})[_0xe5b6('0x25')](function(_0x5dce33){if(_0x5dce33)_0x12886b=_0x5dce33;return _[_0xe5b6('0x3e')](_0x12886b,[_0xe5b6('0x5f'),0x1]);})[_0xe5b6('0x25')](respondWithResult(_0x1950b5,null))[_0xe5b6('0x45')](handleError(_0x1950b5,null));};function hasDefaultDashboard(_0xc82a3a){var _0x1cdbad=[0x65];return new BPromise(function(_0xaf2c23,_0x3452bc){try{if(_0xc82a3a[_0xe5b6('0x56')]){_0xaf2c23(_0x1cdbad);}else{return db[_0xe5b6('0x5c')][_0xe5b6('0x62')]({'where':{'sectionId':_0xc82a3a['id']},'raw':!![]})[_0xe5b6('0x25')](function(_0x21c384){_0x21c384?_0xaf2c23(_0x1cdbad):_0xaf2c23();});}}catch(_0x651e83){_0x3452bc(_0x651e83);}});}function getCustomDashboards(_0xd5f12f){var _0x5145fb=[];return new BPromise(function(_0x4803b5,_0xb8aad6){try{if(_0xd5f12f['autoAssociation']){return db['Dashboard']['findAll']({'raw':!![]})[_0xe5b6('0x25')](function(_0x518692){_0x518692['forEach'](function(_0x5d508f){_0x5145fb[_0xe5b6('0x5d')](_0x5d508f['id']+0x1869f);});_0x4803b5(_0x5145fb);});}else{return db[_0xe5b6('0x5c')]['findAll']({'where':{'sectionId':_0xd5f12f['id']},'raw':!![]})[_0xe5b6('0x25')](function(_0x40d94e){_0x40d94e[_0xe5b6('0x63')](function(_0x1af364){_0x5145fb['push'](_0x1af364[_0xe5b6('0x64')]+0x1869f);});_0x4803b5(_0x5145fb);});}}catch(_0x177e06){_0xb8aad6(_0x177e06);}});}function getPlugins(_0x43aaaf){var _0x5874da=[];return new BPromise(function(_0x331ef6,_0x1079ef){try{if(_0x43aaaf[_0xe5b6('0x56')]){return db[_0xe5b6('0x65')][_0xe5b6('0x43')]({'raw':!![]})['then'](function(_0x1707f9){_0x1707f9[_0xe5b6('0x63')](function(_0x126891){_0x5874da[_0xe5b6('0x5d')](_0x126891['id']+0x15b38);});_0x331ef6(_0x5874da);});}else{return db[_0xe5b6('0x5c')][_0xe5b6('0x43')]({'where':{'sectionId':_0x43aaaf['id']},'raw':!![]})[_0xe5b6('0x25')](function(_0x510df3){_0x510df3[_0xe5b6('0x63')](function(_0x4c9d5b){_0x5874da[_0xe5b6('0x5d')](_0x4c9d5b[_0xe5b6('0x64')]+0x15b38);});_0x331ef6(_0x5874da);});}}catch(_0x213752){_0x1079ef(_0x213752);}});}exports[_0xe5b6('0x66')]=function(_0x260b49,_0x150719){return db['UserProfile'][_0xe5b6('0x49')]({'where':{'id':_0x260b49[_0xe5b6('0x47')]['id']}})[_0xe5b6('0x25')](handleEntityNotFound(_0x150719,null))['then'](function(_0x2d1f85){if(_0x2d1f85){return db['sequelize'][_0xe5b6('0x52')](function(_0x5d24f7){return db[_0xe5b6('0x54')]['findAll']({'where':{'userProfileId':_0x260b49[_0xe5b6('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xe5b6('0x25')](function(_0x1a5593){if(_0x1a5593){return db[_0xe5b6('0x54')][_0xe5b6('0x26')]({'where':{'userProfileId':_0x260b49[_0xe5b6('0x47')]['id'],'id':_['map'](_0x1a5593,function(_0x4e0bbb){return _0x4e0bbb['id'];})},'transaction':_0x5d24f7});}})[_0xe5b6('0x25')](function(_0x2ac395){var _0x870e28=_[_0xe5b6('0x2c')](_0x260b49['body'],function(_0x36d9cc){_0x36d9cc[_0xe5b6('0x58')]=_0x260b49[_0xe5b6('0x47')]['id'];return _0x36d9cc;});return db[_0xe5b6('0x54')][_0xe5b6('0x67')](_0x870e28,{'raw':!![],'transaction':_0x5d24f7});})[_0xe5b6('0x25')](function(_0x4ff7e1){var _0x5f0a51=_[_0xe5b6('0x3e')](_['map'](_0x4ff7e1,function(_0x4baaaf){return _0x4baaaf[_0xe5b6('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x5f0a51){return db[_0xe5b6('0x54')][_0xe5b6('0x43')]({'where':{'userProfileId':_0x260b49[_0xe5b6('0x47')]['id'],'sectionId':_[_0xe5b6('0x2c')](_0x5f0a51,function(_0xc9d38e){return _0xc9d38e[_0xe5b6('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0xc0664c){var _0x5cfb4b=_[_0xe5b6('0x2c')](_0x260b49[_0xe5b6('0x50')],function(_0x3cf0ad){_0x3cf0ad[_0xe5b6('0x58')]=_0x260b49[_0xe5b6('0x47')]['id'];return _0x3cf0ad;});return db[_0xe5b6('0x5c')]['bulkCreate'](_0x5cfb4b,{'raw':!![],'transaction':_0x5d24f7});});}})[_0xe5b6('0x45')](handleError(_0x150719,null));});}})[_0xe5b6('0x25')](function(_0x55060a){var _0x265168=_['map'](_0x55060a,function(_0x1d4316){return _0x1d4316[_0xe5b6('0x4b')]({'plain':!![]});});})['then'](respondWithResult(_0x150719,null))[_0xe5b6('0x45')](handleError(_0x150719,null));};exports[_0xe5b6('0x68')]=function(_0x4b4d15,_0x393995,_0x508b3d){return db[_0xe5b6('0x2d')]['find']({'where':{'id':_0x4b4d15[_0xe5b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x393995,null))[_0xe5b6('0x25')](function(_0x42e171){if(_0x42e171){return _0x42e171[_0xe5b6('0x68')](_0x4b4d15[_0xe5b6('0x33')]['ids']);}})[_0xe5b6('0x25')](respondWithStatusCode(_0x393995,null))['catch'](handleError(_0x393995,null));};exports['getResources']=function(_0xf59663,_0x3eb0eb){var _0x254157={};if(!_0xf59663[_0xe5b6('0x33')][_0xe5b6('0x69')])throw new Error(_0xe5b6('0x6a'));if(!_0xf59663[_0xe5b6('0x33')][_0xe5b6('0x39')]('nolimit')){_0x254157['limit']=qs[_0xe5b6('0x20')](_0xf59663[_0xe5b6('0x33')]['limit']);_0x254157[_0xe5b6('0x22')]=qs[_0xe5b6('0x22')](_0xf59663[_0xe5b6('0x33')][_0xe5b6('0x22')]);}return db[_0xe5b6('0x2d')][_0xe5b6('0x49')]({'where':{'id':_0xf59663[_0xe5b6('0x47')]['id']}})['then'](function(_0x520da1){if(!_0x520da1)throw new Error(_0xe5b6('0x6b')+_0xf59663['params']['id']);return db[_0xe5b6('0x2d')][_0xe5b6('0x6c')](_0xf59663);})[_0xe5b6('0x25')](respondWithFilteredResult(_0x3eb0eb,_0x254157))[_0xe5b6('0x45')](handleError(_0x3eb0eb,null));}; \ No newline at end of file +var _0x0954=['../../config/utils','../../config/license/util','redis','defaults','./userProfile.socket','register','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','clone','get','omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','push','removeSections','ids','enabled','includes','isEmpty','subsections','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x0954,0x135));var _0x4095=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x0954[_0x2a453b];return _0x132f79;};'use strict';var emlformat=require(_0x4095('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4095('0x1'));var jsonpatch=require(_0x4095('0x2'));var rp=require('request-promise');var moment=require(_0x4095('0x3'));var BPromise=require(_0x4095('0x4'));var Mustache=require(_0x4095('0x5'));var util=require(_0x4095('0x6'));var path=require(_0x4095('0x7'));var sox=require(_0x4095('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4095('0x9'));var squel=require(_0x4095('0xa'));var crypto=require(_0x4095('0xb'));var jsforce=require(_0x4095('0xc'));var deskjs=require(_0x4095('0xd'));var toCsv=require(_0x4095('0xe'));var querystring=require('querystring');var Papa=require(_0x4095('0xf'));var Redis=require(_0x4095('0x10'));var authService=require(_0x4095('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4095('0x12'));var hardwareService=require(_0x4095('0x13'));var logger=require(_0x4095('0x14'))('api');var utils=require(_0x4095('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4095('0x16'));var db=require('../../mysqldb')['db'];config[_0x4095('0x17')]=_[_0x4095('0x18')](config[_0x4095('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4095('0x17')]));require(_0x4095('0x19'))[_0x4095('0x1a')](socket);function respondWithStatusCode(_0x51b78a,_0x52878d){_0x52878d=_0x52878d||0xcc;return function(_0x50b788){if(_0x50b788){return _0x51b78a[_0x4095('0x1b')](_0x52878d);}return _0x51b78a[_0x4095('0x1c')](_0x52878d)[_0x4095('0x1d')]();};}function respondWithResult(_0x400d5e,_0x51f3f){_0x51f3f=_0x51f3f||0xc8;return function(_0x346540){if(_0x346540){return _0x400d5e['status'](_0x51f3f)['json'](_0x346540);}};}function respondWithFilteredResult(_0x24e902,_0x3a1cd5){return function(_0x47ebf5){if(_0x47ebf5){var _0x52d4d1=typeof _0x3a1cd5['offset']==='undefined'&&typeof _0x3a1cd5[_0x4095('0x1e')]==='undefined';var _0x2e417e=_0x47ebf5[_0x4095('0x1f')];var _0x2d2e9f=_0x52d4d1?0x0:_0x3a1cd5[_0x4095('0x20')];var _0x4df5b6=_0x52d4d1?_0x47ebf5['count']:_0x3a1cd5[_0x4095('0x20')]+_0x3a1cd5[_0x4095('0x1e')];var _0x1d7c3b;if(_0x4df5b6>=_0x2e417e){_0x4df5b6=_0x2e417e;_0x1d7c3b=0xc8;}else{_0x1d7c3b=0xce;}_0x24e902[_0x4095('0x1c')](_0x1d7c3b);return _0x24e902[_0x4095('0x21')](_0x4095('0x22'),_0x2d2e9f+'-'+_0x4df5b6+'/'+_0x2e417e)[_0x4095('0x23')](_0x47ebf5);}return null;};}function patchUpdates(_0x18c321){return function(_0x1964d5){try{jsonpatch[_0x4095('0x24')](_0x1964d5,_0x18c321,!![]);}catch(_0x30d171){return BPromise[_0x4095('0x25')](_0x30d171);}return _0x1964d5[_0x4095('0x26')]();};}function saveUpdates(_0x3c9824,_0x4f7688){return function(_0x5e97c0){if(_0x5e97c0){return _0x5e97c0[_0x4095('0x27')](_0x3c9824)[_0x4095('0x28')](function(_0x26604f){return _0x26604f;});}return null;};}function removeEntity(_0x4cae6a,_0x4f2581){return function(_0x3be7a4){if(_0x3be7a4){return _0x3be7a4[_0x4095('0x29')]()[_0x4095('0x28')](function(){_0x4cae6a[_0x4095('0x1c')](0xcc)[_0x4095('0x1d')]();});}};}function handleEntityNotFound(_0x495868,_0x439bce){return function(_0xf87fd4){if(!_0xf87fd4){_0x495868[_0x4095('0x1b')](0x194);}return _0xf87fd4;};}function handleError(_0x280166,_0x504928){_0x504928=_0x504928||0x1f4;return function(_0x1ddcdc){logger['error'](_0x1ddcdc['stack']);if(_0x1ddcdc[_0x4095('0x2a')]){delete _0x1ddcdc[_0x4095('0x2a')];}_0x280166[_0x4095('0x1c')](_0x504928)[_0x4095('0x2b')](_0x1ddcdc);};}exports['index']=function(_0x244a37,_0x4f9959){var _0x347df8={},_0x3f2516={},_0x4eb0ab={'count':0x0,'rows':[]};var _0x3c49c0=_[_0x4095('0x2c')](db[_0x4095('0x2d')][_0x4095('0x2e')],function(_0x9b495f){return{'name':_0x9b495f[_0x4095('0x2f')],'type':_0x9b495f[_0x4095('0x30')][_0x4095('0x31')]};});_0x3f2516['model']=_[_0x4095('0x2c')](_0x3c49c0,'name');_0x3f2516[_0x4095('0x32')]=_[_0x4095('0x33')](_0x244a37['query']);_0x3f2516[_0x4095('0x34')]=_[_0x4095('0x35')](_0x3f2516[_0x4095('0x36')],_0x3f2516[_0x4095('0x32')]);_0x347df8[_0x4095('0x37')]=_[_0x4095('0x35')](_0x3f2516[_0x4095('0x36')],qs[_0x4095('0x38')](_0x244a37[_0x4095('0x32')]['fields']));_0x347df8[_0x4095('0x37')]=_0x347df8[_0x4095('0x37')]['length']?_0x347df8[_0x4095('0x37')]:_0x3f2516['model'];if(!_0x244a37['query'][_0x4095('0x39')](_0x4095('0x3a'))){_0x347df8[_0x4095('0x1e')]=qs['limit'](_0x244a37['query'][_0x4095('0x1e')]);_0x347df8[_0x4095('0x20')]=qs[_0x4095('0x20')](_0x244a37['query'][_0x4095('0x20')]);}_0x347df8[_0x4095('0x3b')]=qs[_0x4095('0x3c')](_0x244a37[_0x4095('0x32')][_0x4095('0x3c')]);_0x347df8[_0x4095('0x3d')]=qs[_0x4095('0x34')](_[_0x4095('0x3e')](_0x244a37[_0x4095('0x32')],_0x3f2516[_0x4095('0x34')]),_0x3c49c0);if(_0x244a37[_0x4095('0x32')][_0x4095('0x3f')]){_0x347df8[_0x4095('0x3d')]=_[_0x4095('0x40')](_0x347df8['where'],{'$or':_[_0x4095('0x2c')](_0x3c49c0,function(_0x598575){if(_0x598575[_0x4095('0x30')]!==_0x4095('0x41')){var _0x210478={};_0x210478[_0x598575[_0x4095('0x2a')]]={'$like':'%'+_0x244a37['query'][_0x4095('0x3f')]+'%'};return _0x210478;}})});}_0x347df8=_['merge']({},_0x347df8,_0x244a37[_0x4095('0x42')]);var _0x5a2b6c={'where':_0x347df8[_0x4095('0x3d')]};return db[_0x4095('0x2d')][_0x4095('0x1f')](_0x5a2b6c)[_0x4095('0x28')](function(_0x4a9f66){_0x4eb0ab['count']=_0x4a9f66;if(_0x244a37['query']['includeAll']){_0x347df8[_0x4095('0x43')]=[{'all':!![]}];}return db[_0x4095('0x2d')][_0x4095('0x44')](_0x347df8);})[_0x4095('0x28')](function(_0x149834){_0x4eb0ab['rows']=_0x149834;return _0x4eb0ab;})[_0x4095('0x28')](respondWithFilteredResult(_0x4f9959,_0x347df8))[_0x4095('0x45')](handleError(_0x4f9959,null));};exports[_0x4095('0x46')]=function(_0x582b56,_0x4b1df1){var _0x4eefb3={'raw':![],'where':{'id':_0x582b56[_0x4095('0x47')]['id']}},_0x4cd344={};_0x4cd344['model']=_[_0x4095('0x33')](db[_0x4095('0x2d')][_0x4095('0x2e')]);_0x4cd344[_0x4095('0x32')]=_[_0x4095('0x33')](_0x582b56[_0x4095('0x32')]);_0x4cd344[_0x4095('0x34')]=_['intersection'](_0x4cd344[_0x4095('0x36')],_0x4cd344[_0x4095('0x32')]);_0x4eefb3['attributes']=_[_0x4095('0x35')](_0x4cd344[_0x4095('0x36')],qs[_0x4095('0x38')](_0x582b56[_0x4095('0x32')]['fields']));_0x4eefb3['attributes']=_0x4eefb3[_0x4095('0x37')][_0x4095('0x48')]?_0x4eefb3[_0x4095('0x37')]:_0x4cd344[_0x4095('0x36')];if(_0x582b56['query'][_0x4095('0x49')]){_0x4eefb3['include']=[{'all':!![]}];}_0x4eefb3=_[_0x4095('0x40')]({},_0x4eefb3,_0x582b56[_0x4095('0x42')]);return db[_0x4095('0x2d')][_0x4095('0x4a')](_0x4eefb3)[_0x4095('0x28')](handleEntityNotFound(_0x4b1df1,null))[_0x4095('0x28')](respondWithResult(_0x4b1df1,null))[_0x4095('0x45')](handleError(_0x4b1df1,null));};exports[_0x4095('0x4b')]=function(_0x3ab424,_0x29c4b3){return db[_0x4095('0x2d')][_0x4095('0x4b')](_0x3ab424['body'],{})[_0x4095('0x28')](respondWithResult(_0x29c4b3,0xc9))['catch'](handleError(_0x29c4b3,null));};exports[_0x4095('0x4c')]=function(_0xb1396a,_0x46e4c3){var _0x1f3a1d={'where':{'id':_0xb1396a[_0x4095('0x47')]['id']}},_0x25021b={};_0x25021b[_0x4095('0x36')]=_[_0x4095('0x33')](db[_0x4095('0x2d')][_0x4095('0x2e')]);_0x1f3a1d[_0x4095('0x37')]=_[_0x4095('0x35')](_0x25021b[_0x4095('0x36')],qs[_0x4095('0x38')](_0xb1396a[_0x4095('0x32')][_0x4095('0x38')]));_0x1f3a1d[_0x4095('0x37')]=_0x1f3a1d[_0x4095('0x37')][_0x4095('0x48')]?_0x1f3a1d['attributes']:_0x25021b[_0x4095('0x36')];if(_0xb1396a['query'][_0x4095('0x49')]){_0x1f3a1d[_0x4095('0x43')]=[{'all':!![]}];}_0x1f3a1d=_[_0x4095('0x40')]({},_0x1f3a1d,_0xb1396a[_0x4095('0x42')]);return db[_0x4095('0x2d')][_0x4095('0x4a')](_0x1f3a1d)[_0x4095('0x28')](handleEntityNotFound(_0x46e4c3,null))[_0x4095('0x28')](function(_0x21091f){if(_0x21091f){var _0x110468=_0x21091f[_0x4095('0x4d')]({'plain':!![]});_0x110468=qs[_0x4095('0x4e')](_0x110468,['id','createdAt',_0x4095('0x4f'),_0x4095('0x50')]);_0xb1396a[_0x4095('0x51')]=_[_0x4095('0x4e')](_0xb1396a['body'],['id',_0x4095('0x52'),_0x4095('0x4f')]);return db[_0x4095('0x53')][_0x4095('0x54')](function(_0x4ed088){return db[_0x4095('0x2d')][_0x4095('0x4b')](_[_0x4095('0x40')](_0x110468,_0xb1396a['body']),{'include':_0xb1396a['query'][_0x4095('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x4ed088})[_0x4095('0x28')](function(_0x1f2e19){var _0x448220=_0x1f2e19[_0x4095('0x4d')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xb1396a[_0x4095('0x47')]['id']},'raw':!![]})[_0x4095('0x28')](function(_0x11b7c9){if(_0x11b7c9){return BPromise[_0x4095('0x55')](_0x11b7c9,function(_0x1155bf){return new BPromise(function(_0x2739b8,_0x2ee838){if(_0x1155bf[_0x4095('0x56')]===null||_0x1155bf[_0x4095('0x56')]===0x1)_0x2739b8(null);return db[_0x4095('0x57')][_0x4095('0x44')]({'where':{'sectionId':_0x1155bf['id']},'raw':!![]})['then'](function(_0x199bd5){var _0x51d8e8=_[_0x4095('0x2c')](_0x199bd5,function(_0x38c11b){return qs[_0x4095('0x4e')](_0x38c11b,['id',_0x4095('0x52'),_0x4095('0x4f'),_0x4095('0x58')]);});_0x2739b8(_0x51d8e8);})[_0x4095('0x45')](function(_0x53019a){_0x2ee838(_0x53019a);});})['then'](function(_0x1e3dc1){var _0x10d21b=qs[_0x4095('0x4e')](_0x1155bf,['id',_0x4095('0x52'),_0x4095('0x4f')]);_0x10d21b[_0x4095('0x59')]=_0x448220['id'];if(_0x1e3dc1)_0x10d21b[_0x4095('0x5a')]=_0x1e3dc1;return _0x10d21b;})[_0x4095('0x28')](function(_0x5b62d9){return db[_0x4095('0x5b')]['create'](_0x5b62d9,{'include':[{'model':db['UserProfileResource'],'as':_0x4095('0x5a')}],'raw':!![],'transaction':_0x4ed088});});})[_0x4095('0x28')](function(){return _0x448220;});}});});});}})[_0x4095('0x28')](respondWithResult(_0x46e4c3,0xc9))[_0x4095('0x45')](handleError(_0x46e4c3,null));};exports[_0x4095('0x27')]=function(_0x5b2528,_0x36020d){if(_0x5b2528[_0x4095('0x51')]['id']){delete _0x5b2528['body']['id'];}return db['UserProfile']['find']({'where':{'id':_0x5b2528[_0x4095('0x47')]['id']}})[_0x4095('0x28')](handleEntityNotFound(_0x36020d,null))[_0x4095('0x28')](saveUpdates(_0x5b2528[_0x4095('0x51')],null))['then'](respondWithResult(_0x36020d,null))[_0x4095('0x45')](handleError(_0x36020d,null));};exports[_0x4095('0x29')]=function(_0x297c9d,_0x3b6614){return db[_0x4095('0x2d')][_0x4095('0x4a')]({'where':{'id':_0x297c9d[_0x4095('0x47')]['id']}})[_0x4095('0x28')](handleEntityNotFound(_0x3b6614,null))['then'](removeEntity(_0x3b6614,null))[_0x4095('0x45')](handleError(_0x3b6614,null));};exports[_0x4095('0x5c')]=function(_0xe7bec9,_0xb7bdb1){return db[_0x4095('0x2d')][_0x4095('0x5c')]()['then'](respondWithResult(_0xb7bdb1,null))[_0x4095('0x45')](handleError(_0xb7bdb1,null));};exports['addSections']=function(_0x56d1c1,_0x27cbf0){var _0x5ac475=_0x56d1c1[_0x4095('0x51')];return db[_0x4095('0x2d')][_0x4095('0x4a')]({'where':{'id':_0x56d1c1[_0x4095('0x47')]['id']}})[_0x4095('0x28')](handleEntityNotFound(_0x27cbf0,null))[_0x4095('0x28')](function(_0x49703d){if(_0x49703d){return db['sequelize']['transaction'](function(_0x538238){return db[_0x4095('0x5b')]['destroy']({'where':{'userProfileId':_0x56d1c1['params']['id'],'sectionId':_['map'](_0x5ac475,function(_0x419668){return _0x419668['sectionId'];})},'transaction':_0x538238})[_0x4095('0x28')](function(){var _0x1d7b00=_[_0x4095('0x2c')](_0x5ac475,function(_0x19b652){_0x19b652[_0x4095('0x59')]=_0x56d1c1[_0x4095('0x47')]['id'];return _0x19b652;});var _0x10187c=[];return BPromise[_0x4095('0x55')](_0x1d7b00,function(_0x46b396){return db[_0x4095('0x5b')][_0x4095('0x4b')](_0x46b396,{'include':[{'model':db[_0x4095('0x57')],'as':_0x4095('0x5a')}],'raw':!![],'transaction':_0x538238})[_0x4095('0x28')](function(_0x64cd6){_0x10187c[_0x4095('0x5d')](_0x64cd6[_0x4095('0x4d')]({'plain':!![]}));});})[_0x4095('0x28')](function(){return _0x10187c;});});});}})[_0x4095('0x28')](function(_0x3fb76f){return _0x3fb76f;})[_0x4095('0x28')](respondWithResult(_0x27cbf0,null))[_0x4095('0x45')](handleError(_0x27cbf0,null));};exports[_0x4095('0x5e')]=function(_0x2556a8,_0x177730){var _0x5b91cb;return db[_0x4095('0x2d')][_0x4095('0x4a')]({'where':{'id':_0x2556a8[_0x4095('0x47')]['id']},'attributes':['id',_0x4095('0x2a')]})[_0x4095('0x28')](handleEntityNotFound(_0x177730,null))[_0x4095('0x28')](function(_0x4dfd6c){if(_0x4dfd6c){_0x5b91cb=_0x4dfd6c;return db['UserProfileSection'][_0x4095('0x29')]({'where':{'userProfileId':_0x2556a8['params']['id'],'sectionId':_0x2556a8[_0x4095('0x32')][_0x4095('0x5f')]}});}})[_0x4095('0x28')](function(){return _0x5b91cb;})['then'](respondWithStatusCode(_0x177730,null))[_0x4095('0x45')](handleError(_0x177730,null));};exports['getSections']=function(_0x4d23fc,_0xc14f1){var _0x1615f5=[];var _0x5c9ecd=[];return db[_0x4095('0x5b')][_0x4095('0x44')]({'where':{'userProfileId':_0x4d23fc['params']['id']},'raw':!![]})[_0x4095('0x28')](function(_0x4e13cc){_0x1615f5=_[_0x4095('0x3f')](_0x4e13cc,function(_0x231b36){return _0x231b36[_0x4095('0x60')]===0x1||_[_0x4095('0x61')]([0x3eb,0x709],_0x231b36[_0x4095('0x58')]);});if(!_[_0x4095('0x62')](_0x1615f5)){return _['map'](_0x1615f5,function(_0x9a7918){return _0x9a7918['sectionId'];});}else{return;}})[_0x4095('0x28')](function(_0x276e52){if(_0x276e52)_0x5c9ecd=_0x276e52;if(_[_0x4095('0x61')](_0x5c9ecd,0x64)){var _0x1d5022=_[_0x4095('0x4a')](_0x1615f5,{'sectionId':0x64});return hasDefaultDashboard(_0x1d5022)[_0x4095('0x28')](function(_0x3b85a2){return _[_0x4095('0x2c')](_0x1615f5,function(_0x29750d){if(_0x29750d[_0x4095('0x58')]===0x64){_0x29750d[_0x4095('0x63')]=_0x3b85a2;}return _0x29750d;});});}else{return;}})[_0x4095('0x28')](function(_0x4caa3b){if(_0x4caa3b)_0x1615f5=_0x4caa3b;if(_[_0x4095('0x61')](_0x5c9ecd,0x3eb)){var _0x33a705=_[_0x4095('0x4a')](_0x1615f5,{'sectionId':0x3eb});return getCustomDashboards(_0x33a705)['then'](function(_0x546fac){return _[_0x4095('0x2c')](_0x1615f5,function(_0x67c84d){if(_0x33a705['enabled']){if(_0x67c84d[_0x4095('0x58')]===0x3eb){_0x67c84d[_0x4095('0x63')]=_0x546fac;}}else{if(_0x67c84d['sectionId']===0x64){_0x67c84d[_0x4095('0x63')]=_0x546fac;}}return _0x67c84d;});});}else{return;}})['then'](function(_0x47b12a){if(_0x47b12a)_0x1615f5=_0x47b12a;if(_[_0x4095('0x61')](_0x5c9ecd,0x709)){var _0x42f4c6=_[_0x4095('0x4a')](_0x1615f5,{'sectionId':0x709});return getPlugins(_0x42f4c6)[_0x4095('0x28')](function(_0x1e5d3b){if(_0x42f4c6[_0x4095('0x60')]){return _[_0x4095('0x2c')](_0x1615f5,function(_0x571933){if(_0x571933[_0x4095('0x58')]===0x709){_0x571933[_0x4095('0x63')]=_0x1e5d3b;}return _0x571933;});}else{var _0x429846={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1e5d3b};var _0x57e194=_[_0x4095('0x2c')](_0x1615f5);_0x57e194[_0x4095('0x5d')](_0x429846);return _0x57e194;}});}else{return;}})[_0x4095('0x28')](function(_0xa2f69e){if(_0xa2f69e)_0x1615f5=_0xa2f69e;return _[_0x4095('0x3f')](_0x1615f5,[_0x4095('0x60'),0x1]);})[_0x4095('0x28')](respondWithResult(_0xc14f1,null))[_0x4095('0x45')](handleError(_0xc14f1,null));};function hasDefaultDashboard(_0xf6f98c){var _0x380b67=[0x65];return new BPromise(function(_0x43f3fd,_0x34c3c1){try{if(_0xf6f98c[_0x4095('0x56')]){_0x43f3fd(_0x380b67);}else{return db[_0x4095('0x57')]['findOne']({'where':{'sectionId':_0xf6f98c['id']},'raw':!![]})[_0x4095('0x28')](function(_0x5c0e70){_0x5c0e70?_0x43f3fd(_0x380b67):_0x43f3fd();});}}catch(_0x284848){_0x34c3c1(_0x284848);}});}function getCustomDashboards(_0x39186e){var _0x16705a=[];return new BPromise(function(_0x178d4a,_0x58d73d){try{if(_0x39186e[_0x4095('0x56')]){return db[_0x4095('0x64')][_0x4095('0x44')]({'raw':!![]})[_0x4095('0x28')](function(_0x23274c){_0x23274c[_0x4095('0x65')](function(_0x515b2d){_0x16705a['push'](_0x515b2d['id']+0x1869f);});_0x178d4a(_0x16705a);});}else{return db[_0x4095('0x57')]['findAll']({'where':{'sectionId':_0x39186e['id']},'raw':!![]})[_0x4095('0x28')](function(_0x51caf1){_0x51caf1[_0x4095('0x65')](function(_0x3a9881){_0x16705a[_0x4095('0x5d')](_0x3a9881['resourceId']+0x1869f);});_0x178d4a(_0x16705a);});}}catch(_0x71ee1a){_0x58d73d(_0x71ee1a);}});}function getPlugins(_0x488951){var _0xc1c88a=[];return new BPromise(function(_0x30ef71,_0x2ee081){try{if(_0x488951[_0x4095('0x56')]){return db[_0x4095('0x66')][_0x4095('0x44')]({'raw':!![]})[_0x4095('0x28')](function(_0x40e6fb){_0x40e6fb[_0x4095('0x65')](function(_0x6028bf){_0xc1c88a[_0x4095('0x5d')](_0x6028bf['id']+0x15b38);});_0x30ef71(_0xc1c88a);});}else{return db[_0x4095('0x57')][_0x4095('0x44')]({'where':{'sectionId':_0x488951['id']},'raw':!![]})[_0x4095('0x28')](function(_0x1c43d4){_0x1c43d4[_0x4095('0x65')](function(_0x12e75b){_0xc1c88a[_0x4095('0x5d')](_0x12e75b[_0x4095('0x67')]+0x15b38);});_0x30ef71(_0xc1c88a);});}}catch(_0x4492e5){_0x2ee081(_0x4492e5);}});}exports[_0x4095('0x68')]=function(_0x4d0599,_0x40abd9){return db['UserProfile'][_0x4095('0x4a')]({'where':{'id':_0x4d0599[_0x4095('0x47')]['id']}})[_0x4095('0x28')](handleEntityNotFound(_0x40abd9,null))[_0x4095('0x28')](function(_0x294351){if(_0x294351){return db[_0x4095('0x53')][_0x4095('0x54')](function(_0x3adda2){return db[_0x4095('0x5b')][_0x4095('0x44')]({'where':{'userProfileId':_0x4d0599[_0x4095('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x4095('0x28')](function(_0x339018){if(_0x339018){return db[_0x4095('0x5b')][_0x4095('0x29')]({'where':{'userProfileId':_0x4d0599[_0x4095('0x47')]['id'],'id':_[_0x4095('0x2c')](_0x339018,function(_0x3a8268){return _0x3a8268['id'];})},'transaction':_0x3adda2});}})[_0x4095('0x28')](function(_0x44c35e){var _0x3db9fb=_[_0x4095('0x2c')](_0x4d0599[_0x4095('0x51')],function(_0xb83a77){_0xb83a77[_0x4095('0x59')]=_0x4d0599[_0x4095('0x47')]['id'];return _0xb83a77;});return db[_0x4095('0x5b')][_0x4095('0x69')](_0x3db9fb,{'raw':!![],'transaction':_0x3adda2});})['then'](function(_0x3277dd){var _0x564df8=_['filter'](_[_0x4095('0x2c')](_0x3277dd,function(_0xa1d6d8){return _0xa1d6d8['get']({'plain':!![]});}),{'includeAll':![]});if(_0x564df8){return db[_0x4095('0x5b')]['findAll']({'where':{'userProfileId':_0x4d0599[_0x4095('0x47')]['id'],'sectionId':_['map'](_0x564df8,function(_0x5d61f9){return _0x5d61f9[_0x4095('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x4095('0x28')](function(_0x587989){var _0x2c4ebc=_[_0x4095('0x2c')](_0x4d0599[_0x4095('0x51')],function(_0x102563){_0x102563[_0x4095('0x59')]=_0x4d0599[_0x4095('0x47')]['id'];return _0x102563;});return db[_0x4095('0x57')]['bulkCreate'](_0x2c4ebc,{'raw':!![],'transaction':_0x3adda2});});}})[_0x4095('0x45')](handleError(_0x40abd9,null));});}})[_0x4095('0x28')](function(_0x2e2829){var _0x57860b=_[_0x4095('0x2c')](_0x2e2829,function(_0x19f229){return _0x19f229[_0x4095('0x4d')]({'plain':!![]});});})[_0x4095('0x28')](respondWithResult(_0x40abd9,null))['catch'](handleError(_0x40abd9,null));};exports[_0x4095('0x6a')]=function(_0x4cfa28,_0x5cd9d0,_0x5d7a6b){return db[_0x4095('0x2d')]['find']({'where':{'id':_0x4cfa28['params']['id']}})['then'](handleEntityNotFound(_0x5cd9d0,null))[_0x4095('0x28')](function(_0x5afef7){if(_0x5afef7){return _0x5afef7[_0x4095('0x6a')](_0x4cfa28[_0x4095('0x32')][_0x4095('0x5f')]);}})[_0x4095('0x28')](respondWithStatusCode(_0x5cd9d0,null))[_0x4095('0x45')](handleError(_0x5cd9d0,null));};exports[_0x4095('0x6b')]=function(_0x2071e4,_0x337d4f){var _0x30f8bf={};if(!_0x2071e4['query'][_0x4095('0x6c')])throw new Error(_0x4095('0x6d'));if(!_0x2071e4[_0x4095('0x32')][_0x4095('0x39')](_0x4095('0x3a'))){_0x30f8bf[_0x4095('0x1e')]=qs[_0x4095('0x1e')](_0x2071e4[_0x4095('0x32')][_0x4095('0x1e')]);_0x30f8bf['offset']=qs[_0x4095('0x20')](_0x2071e4[_0x4095('0x32')]['offset']);}return db[_0x4095('0x2d')]['find']({'where':{'id':_0x2071e4['params']['id']}})[_0x4095('0x28')](function(_0xcb63f4){if(!_0xcb63f4)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2071e4['params']['id']);return db[_0x4095('0x2d')][_0x4095('0x6b')](_0x2071e4);})[_0x4095('0x28')](respondWithFilteredResult(_0x337d4f,_0x30f8bf))['catch'](handleError(_0x337d4f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5d9becc..df8599e 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 _0x9134=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','save','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9134,0x87));var _0x4913=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9134[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x4913('0x0'))['db'][_0x4913('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4913('0x2')](0x0);var events={'afterCreate':_0x4913('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x352f58){return function(_0x488795,_0x367836,_0x349c8c){UserProfileEvents[_0x4913('0x4')](_0x352f58+':'+_0x488795['id'],_0x488795);UserProfileEvents[_0x4913('0x4')](_0x352f58,_0x488795);_0x349c8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x4913('0x5')](e,emitEvent(event));}}module[_0x4913('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x0170=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x56cdbf,_0x28d597){var _0x17b166=function(_0x3fc1c8){while(--_0x3fc1c8){_0x56cdbf['push'](_0x56cdbf['shift']());}};_0x17b166(++_0x28d597);}(_0x0170,0x1d6));var _0x0017=function(_0x2f75d1,_0x38f249){_0x2f75d1=_0x2f75d1-0x0;var _0x4eefbf=_0x0170[_0x2f75d1];return _0x4eefbf;};'use strict';var EventEmitter=require(_0x0017('0x0'));var UserProfile=require(_0x0017('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0017('0x2')](0x0);var events={'afterCreate':_0x0017('0x3'),'afterUpdate':_0x0017('0x4'),'afterDestroy':_0x0017('0x5')};function emitEvent(_0x5ee6e8){return function(_0x20a045,_0x255938,_0x3ba292){UserProfileEvents[_0x0017('0x6')](_0x5ee6e8+':'+_0x20a045['id'],_0x20a045);UserProfileEvents[_0x0017('0x6')](_0x5ee6e8,_0x20a045);_0x3ba292(null);};}for(var e in events){if(events[_0x0017('0x7')](e)){var event=events[e];UserProfile[_0x0017('0x8')](e,emitEvent(event));}}module[_0x0017('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index af74c90..a340577 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 _0x9fd4=['sms','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','FaxQueue','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','agents','telephones','Users','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','intervals','Pause','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','toString','define','UserProfile','user_profiles','section','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','union','autoAssociation','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','reportType','default','DefaultReports','custom','rows','CmContact','Tags','tag','openTabs','true','chat','dataValues'];(function(_0x3eb926,_0x27e966){var _0x29460d=function(_0x143ba7){while(--_0x143ba7){_0x3eb926['push'](_0x3eb926['shift']());}};_0x29460d(++_0x27e966);}(_0x9fd4,0x16c));var _0x49fd=function(_0x1496c1,_0x23cf40){_0x1496c1=_0x1496c1-0x0;var _0x48abc0=_0x9fd4[_0x1496c1];return _0x48abc0;};'use strict';var _=require(_0x49fd('0x0'));var attributes=require(_0x49fd('0x1'));var qs=require(_0x49fd('0x2'));var squel=require(_0x49fd('0x3'));module[_0x49fd('0x4')]=function(_0xe1e23f){var _0x32d855=_0xe1e23f[_0x49fd('0x5')];function _0x3f149e(_0x55dda5,_0x481f6a){return new Promise(function(_0x3b4b46,_0x42fdc7){if(!_0x481f6a)return _0x3b4b46(null);var _0x1bc16e=_0x481f6a[_0x49fd('0x6')]?{[_0x481f6a['filter'][_0x49fd('0x7')]]:_0x481f6a[_0x49fd('0x6')][_0x49fd('0x8')]}:undefined;return _0x32d855[_0x55dda5][_0x49fd('0x9')]({'where':_0x1bc16e,'raw':!![]})[_0x49fd('0xa')](function(_0x4a1c47){_0x481f6a[_0x49fd('0xb')]=_[_0x49fd('0xc')](_0x4a1c47,'id');_0x3b4b46(_0x481f6a);})[_0x49fd('0xd')](function(_0x4969d3){_0x42fdc7(_0x4969d3);});});}function _0x426ec2(_0x2c6d77,_0x4733ce){return new Promise(function(_0x53a44e,_0x70933e){var _0x1a6ee5=_0x2c6d77[_0x49fd('0x6')]?{[_0x2c6d77[_0x49fd('0x6')][_0x49fd('0x7')]]:_0x2c6d77[_0x49fd('0x6')][_0x49fd('0x8')]}:undefined;return _0x32d855[_0x2c6d77[_0x49fd('0xe')]][_0x49fd('0x9')]({'where':_0x1a6ee5,'raw':!![]})[_0x49fd('0xa')](function(_0x157b09){_0x4733ce[_0x49fd('0xb')]=_[_0x49fd('0xc')](_0x157b09,function(_0x1a9063){return _0x1a9063[_0x49fd('0xf')];});_0x53a44e(_0x4733ce);})[_0x49fd('0xd')](function(_0x2859f2){_0x70933e(_0x2859f2);});});}function _0x3ca675(_0x2f8d68,_0x12ae8f,_0x14c34f){if(!_0x12ae8f)return Promise[_0x49fd('0x10')](null);return new Promise(function(_0x320fe5,_0x475eee){return _0x32d855[_0x49fd('0x11')][_0x49fd('0x9')]({'where':{'sectionId':_0x12ae8f['id']},'raw':!![]})['then'](function(_0x2dc611){if(_0x2f8d68[_0x49fd('0x7')]&&_0x2f8d68['field']!=='id'){_0x12ae8f['associatedResources']=_[_0x49fd('0xc')](_0x2dc611,function(_0x53cbd1){return _0x53cbd1[_0x2f8d68[_0x49fd('0x7')]];});}else{if(_0x14c34f===_0x49fd('0x12')){_0x12ae8f['associatedResources']=_[_0x49fd('0xc')](_0x2dc611,function(_0x83ab70){return{'id':_0x83ab70['resourceId'],'type':_0x83ab70[_0x49fd('0x13')]};});}else{_0x12ae8f[_0x49fd('0xb')]=_[_0x49fd('0xc')](_0x2dc611,function(_0x290f59){return _0x290f59[_0x49fd('0x14')];});}}_0x320fe5(_0x12ae8f);})[_0x49fd('0xd')](function(_0x5dc839){_0x475eee(_0x5dc839);});});}function _0x46019d(_0xd43815,_0x8f202b){var _0x4bf811={'parentSections':[]};switch(_0xd43815[_0x49fd('0x15')]()){case _0x49fd('0x16'):_0x4bf811[_0x49fd('0x17')]='SquareProject';break;case'odbc':_0x4bf811['childModel']=_0x49fd('0x18');break;case _0x49fd('0x19'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x1a');_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x1c'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x1d')}];break;case'projects':_0x4bf811[_0x49fd('0x17')]='JscriptyProject';break;case _0x49fd('0x1e'):_0x4bf811[_0x49fd('0x17')]='CmContact';_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x1f'),'field':'id','foreignKey':_0x49fd('0x20')}];break;case _0x49fd('0x21'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x22');break;case _0x49fd('0x23'):_0x4bf811[_0x49fd('0x17')]='CmCompany';break;case _0x49fd('0x24'):_0x4bf811['childModel']=_0x49fd('0x25');break;case'chatqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x26');break;case _0x49fd('0x27'):_0x4bf811['childModel']='ChatWebsite';break;case'faxqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x28');break;case'faxaccounts':_0x4bf811[_0x49fd('0x17')]='FaxAccount';break;case'inboundroutes':case _0x49fd('0x29'):case _0x49fd('0x2a'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x2b');break;case _0x49fd('0x2c'):_0x4bf811['childModel']='VoiceContext';break;case _0x49fd('0x2d'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x2e');break;case _0x49fd('0x2f'):_0x4bf811['childModel']=_0x49fd('0x30');_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x31'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x32'),'model':_0x49fd('0x33'),'filter':{'field':_0x49fd('0x34'),'value':[_0x49fd('0x35')]}},{'name':_0x49fd('0x36'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x32'),'model':'User','filter':{'field':_0x49fd('0x34'),'value':[_0x49fd('0x37')]}},{'name':_0x49fd('0x38'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x39'),'model':_0x49fd('0x3a'),'filter':{'field':_0x49fd('0x13'),'value':[_0x49fd('0x3b')]}},{'name':_0x49fd('0x3c'),'field':'name','foreignKey':_0x49fd('0x39'),'model':'VoiceQueue','filter':{'field':_0x49fd('0x13'),'value':[_0x49fd('0x3d')]}}];break;case'musiconholds':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x3e');break;case'chanspies':_0x4bf811[_0x49fd('0x17')]='VoiceChanSpy';break;case'voiceprefixes':_0x4bf811['childModel']=_0x49fd('0x3f');break;case _0x49fd('0x40'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x41');break;case'mailqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x42');break;case _0x49fd('0x43'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x44');break;case _0x49fd('0x45'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x46');break;case'openchannelqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x47');break;case'openchannelaccounts':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x48');break;case'smsqueues':_0x4bf811[_0x49fd('0x17')]='SmsQueue';break;case _0x49fd('0x49'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x4a');break;case _0x49fd('0x4b'):_0x4bf811['childModel']='WhatsappQueue';break;case _0x49fd('0x4c'):_0x4bf811['childModel']=_0x49fd('0x4d');break;case _0x49fd('0x4e'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x4f');break;case'voicequeues':case _0x49fd('0x50'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x3a');if(_0x8f202b){_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x38')},{'name':_0x49fd('0x3c')}];}break;case _0x49fd('0x51'):case _0x49fd('0x52'):case _0x49fd('0x53'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x33');if(_0x8f202b){_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x54'),'filter':{'field':_0x49fd('0x34'),'value':['admin','user']},'ignore':!![]},{'name':_0x49fd('0x31')},{'name':_0x49fd('0x36')}];}break;case _0x49fd('0x55'):_0x4bf811[_0x49fd('0x17')]='ZendeskAccount';break;case _0x49fd('0x56'):_0x4bf811[_0x49fd('0x17')]='SalesforceAccount';break;case _0x49fd('0x57'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x58');break;case _0x49fd('0x59'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x5a');break;case _0x49fd('0x5b'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x5c');break;case _0x49fd('0x5d'):_0x4bf811[_0x49fd('0x17')]='ZohoAccount';break;case _0x49fd('0x5e'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x33');break;case _0x49fd('0x5f'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x60');break;case'dispositions':_0x4bf811['childModel']=_0x49fd('0x61');break;case _0x49fd('0x62'):_0x4bf811[_0x49fd('0x17')]='Dashboard';break;case _0x49fd('0x63'):_0x4bf811[_0x49fd('0x17')]='Interval';break;case'pauses':_0x4bf811['childModel']=_0x49fd('0x64');break;case'scheduler':_0x4bf811['childModel']='Schedule';break;case _0x49fd('0x65'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x66');break;case _0x49fd('0x67'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x68');break;case _0x49fd('0x69'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x6a');break;case _0x49fd('0x6b'):_0x4bf811['childModel']=_0x49fd('0x6c');break;case _0x49fd('0x6d'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x6e');break;case _0x49fd('0x6f'):_0x4bf811[_0x49fd('0x17')]='Variable';break;case _0x49fd('0x70'):_0x4bf811[_0x49fd('0x17')]='Plugin';break;case'extractedreports':_0x4bf811[_0x49fd('0x17')]='AnalyticExtractedReport';_0x4bf811[_0x49fd('0x1b')]=[{'name':'Reports','field':'id','foreignKey':_0x49fd('0x71')}];break;case'metrics':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x72');break;}return _0x4bf811;}function _0x4fe873(_0x2e4f29,_0xc34aed){var _0x275a68=_0x2e4f29[_0x49fd('0x73')](0x0)[_0x49fd('0x74')]()+_0x2e4f29[_0x49fd('0x75')](0x1);var _0xd2cc88={'type':_0x32d855[_0x49fd('0x76')]['QueryTypes'][_0x49fd('0x77')],'raw':!![]};return new Promise(function(_0x46f351,_0x3732bb){var _0x5d0d68=squel[_0x49fd('0x78')]()[_0x49fd('0x7')](_0x49fd('0x79')+_0x275a68+_0x49fd('0x7a'),'id')[_0x49fd('0x7')](_0x49fd('0x7b'))[_0x49fd('0x7c')](_0x49fd('0x7d')+_0x2e4f29+_0x49fd('0x7e'),'ui')['where'](_0x49fd('0x7f'),_0xc34aed['id']);return _0x32d855[_0x49fd('0x80')]['query'](_0x5d0d68[_0x49fd('0x81')](),_0xd2cc88)[_0x49fd('0xa')](function(_0x51223a){_0xc34aed[_0x275a68+'OpenTabs']=_0x51223a;_0x46f351(_0x51223a);})['catch'](function(_0x197239){_0x3732bb(_0x197239);});});}return _0xe1e23f[_0x49fd('0x82')](_0x49fd('0x83'),attributes,{'tableName':_0x49fd('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xb1e0f3){var _0x582286={'raw':![],'where':{}};var _0x7e0750={};var _0x58ae06={'count':0x0,'rows':[]};var _0x418673=_0xb1e0f3['query'][_0x49fd('0x85')];var _0x1a8da2=_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x87')]||![];var _0x5a6fe0=_0x46019d(_0x418673,_0x1a8da2);if(!_0x5a6fe0[_0x49fd('0x17')])throw new Error(_0x49fd('0x88')+_0x418673+'\x27');var _0x547aea=[{'name':_0x418673}];if(!_[_0x49fd('0x89')](_0x5a6fe0[_0x49fd('0x1b')]))_0x547aea=_0x5a6fe0[_0x49fd('0x1b')];var _0x58215b=[];for(var _0x264fe9=0x0;_0x264fe9<_0x547aea[_0x49fd('0x8a')];_0x264fe9++){_0x58215b[_0x49fd('0x8b')](_0x32d855[_0x49fd('0x8c')][_0x49fd('0x8d')]({'where':{'userProfileId':_0xb1e0f3[_0x49fd('0x8e')]['id'],'name':_0x547aea[_0x264fe9]['name']},'raw':!![]}));}return Promise['all'](_0x58215b)[_0x49fd('0xa')](function(_0x1c64f8){var _0x4079e3=_[_0x49fd('0x6')](_0x1c64f8,function(_0x27806a){return _0x27806a?_0x27806a:undefined;});var _0xdc81cf=_[_0x49fd('0x6')](_0x547aea,[_0x49fd('0x8f'),!![]]);var _0x36de5c=_[_0x49fd('0x89')](_0x4079e3)&&_[_0x49fd('0x89')](_0xdc81cf)?null:_[_0x49fd('0x90')](_0xdc81cf,_0x4079e3);if(!_0x36de5c)return null;var _0xa63360=[];for(var _0x536262=0x0;_0x536262<_0x36de5c[_0x49fd('0x8a')];_0x536262++){var _0x35a8e4=_[_0x49fd('0x8d')](_0x547aea,function(_0x561e58){return _0x36de5c[_0x536262]?_0x561e58['name']===_0x36de5c[_0x536262][_0x49fd('0xf')]:null;});if(_0x35a8e4){if(_0x36de5c[_0x536262][_0x49fd('0x8f')]){_0xa63360[_0x49fd('0x8b')](_0x3f149e(_0x5a6fe0['childModel'],_0x36de5c[_0x536262]));}else{if(!_0x36de5c[_0x536262][_0x49fd('0x91')]){_0xa63360[_0x49fd('0x8b')](_0x3ca675(_0x35a8e4,_0x36de5c[_0x536262],_0x5a6fe0[_0x49fd('0x17')]));}else{if(_0x35a8e4[_0x49fd('0xe')]){_0xa63360[_0x49fd('0x8b')](_0x426ec2(_0x35a8e4,_0x36de5c[_0x536262]));}}}}}return Promise[_0x49fd('0x92')](_0xa63360);})[_0x49fd('0xa')](function(_0x4c8977){var _0x58eecf=_0x4c8977;var _0x4614d1=null;if(_0x58eecf){_0x4614d1=_0x58eecf['length']===0x1?_0x58eecf[0x0]:null;}if(!_0x4614d1&&!_0x58eecf)return _0x58ae06;var _0x3b94e1=_0x32d855[_0x5a6fe0['childModel']]['rawAttributes'];_0x7e0750['model']=_[_0x49fd('0x93')](_0x3b94e1);_0x7e0750[_0x49fd('0x86')]=_['keys'](_0xb1e0f3[_0x49fd('0x86')]);_0x7e0750[_0x49fd('0x94')]=_['intersection'](_0x7e0750[_0x49fd('0xe')],_0x7e0750[_0x49fd('0x86')]);_0x582286['attributes']=_[_0x49fd('0x95')](_0x7e0750['model'],qs[_0x49fd('0x96')](_0xb1e0f3[_0x49fd('0x86')]['fields']));_0x582286[_0x49fd('0x97')]=_0x582286[_0x49fd('0x97')]['length']?_0x582286[_0x49fd('0x97')]:_0x7e0750[_0x49fd('0xe')];if(!_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x98')](_0x49fd('0x99'))){_0x582286[_0x49fd('0x9a')]=qs[_0x49fd('0x9a')](_0xb1e0f3[_0x49fd('0x86')]['limit']);_0x582286['offset']=qs[_0x49fd('0x9b')](_0xb1e0f3[_0x49fd('0x86')]['offset']);}_0x582286[_0x49fd('0x9c')]=qs[_0x49fd('0x9d')](_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x9d')]);_0x582286[_0x49fd('0x9e')]=qs[_0x49fd('0x94')](_[_0x49fd('0x9f')](_0xb1e0f3['query'],_0x7e0750[_0x49fd('0x94')]));if(_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x6')]){_0x582286[_0x49fd('0x9e')]=_[_0x49fd('0xa0')](_0x582286[_0x49fd('0x9e')],{'$or':_[_0x49fd('0xc')](_0x3b94e1,function(_0x545740){if(_0x545740[_0x49fd('0x13')][_0x49fd('0xa1')]!==_0x49fd('0xa2')){var _0x373ce0={};_0x373ce0[_0x545740[_0x49fd('0x7')]]={'$like':'%'+_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x6')]+'%'};return _0x373ce0;}})});}var _0x2da3c4=[];var _0xe96b86=null;var _0x333e8e={};if(_0x4614d1){_0xe96b86=_[_0x49fd('0x8d')](_0x547aea,[_0x49fd('0xf'),_0x4614d1[_0x49fd('0xf')]]);if(_0xe96b86[_0x49fd('0x7')]){_0x333e8e={};if(_0x5a6fe0[_0x49fd('0x17')]===_0x49fd('0x12')){_0x333e8e[_0xe96b86[_0x49fd('0xa3')]]=_[_0x49fd('0xc')](_0x4614d1[_0x49fd('0xb')],'id');}else{_0x333e8e[_0xe96b86[_0x49fd('0xa3')]]=_0x4614d1['associatedResources'];}_0x2da3c4[_0x49fd('0x8b')](_0x333e8e);}else{_0x582286['where']['id']=_0x4614d1[_0x49fd('0xb')];}}else{for(var _0x472450=0x0;_0x472450<_0x58eecf['length'];_0x472450++){_0xe96b86=_['find'](_0x547aea,[_0x49fd('0xf'),_0x58eecf[_0x472450][_0x49fd('0xf')]]);if(_0xe96b86[_0x49fd('0x7')]){_0x333e8e={};_0x333e8e[_0xe96b86['foreignKey']]=_0x58eecf[_0x472450][_0x49fd('0xb')];_0x2da3c4['push'](_0x333e8e);}else{if(!_0x582286[_0x49fd('0x9e')]['id'])_0x582286[_0x49fd('0x9e')]['id']=[];_0x58eecf[_0x472450]['associatedResources']['forEach'](function(_0x51afb5){_0x582286[_0x49fd('0x9e')]['id']['push'](_0x51afb5);});}}}if(!_[_0x49fd('0x89')](_0x2da3c4)){_0x582286[_0x49fd('0x9e')]=_[_0x49fd('0xa0')](_0x582286['where'],{'$and':{'$or':_0x2da3c4}});}_0x582286=_[_0x49fd('0xa0')]({},_0x582286,_0xb1e0f3[_0x49fd('0xa4')]);if(_0x4614d1&&!_0x4614d1[_0x49fd('0x91')]&&_0x5a6fe0[_0x49fd('0x17')]==='AnalyticExtractedReport'){if(_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0xa5')]){_0x582286[_0x49fd('0xa6')]=[{'all':!![]}];}return _0x32d855[_0x5a6fe0['childModel']][_0x49fd('0x9')](_0x582286)[_0x49fd('0xa')](function(_0x3f063e){var _0x43477d=[];_0x3f063e['forEach'](function(_0x3e2b65){var _0x268029;switch(_0x3e2b65[_0x49fd('0xa7')]){case _0x49fd('0xa8'):_0x268029=_['find'](_0x4614d1['associatedResources'],function(_0x2627ef){return _0x2627ef['id']===_0x3e2b65['reportId']&&_0x2627ef[_0x49fd('0x13')]===_0x49fd('0xa9');});break;case _0x49fd('0xaa'):_0x268029=_[_0x49fd('0x8d')](_0x4614d1['associatedResources'],function(_0x97bcd3){return _0x97bcd3['id']===_0x3e2b65[_0x49fd('0x71')]&&_0x97bcd3['type']==='CustomReports';});break;}if(_0x268029)_0x43477d[_0x49fd('0x8b')](_0x3e2b65);});_0x58ae06['count']=_0x43477d[_0x49fd('0x8a')];_0x58ae06[_0x49fd('0xab')]=_0x43477d;return _0x58ae06;});}else{return _0x32d855[_0x5a6fe0[_0x49fd('0x17')]]['count']({'where':_0x582286[_0x49fd('0x9e')]})['then'](function(_0x56c1d2){_0x58ae06['count']=_0x56c1d2;if(_0xb1e0f3[_0x49fd('0x86')]['includeAll']){if(_0x5a6fe0['childModel']===_0x49fd('0xac')){_0x582286['include']=[{'model':_0x32d855[_0x49fd('0x68')],'as':_0x49fd('0xad'),'attributes':['id',_0x49fd('0xf'),'color'],'required':_0xb1e0f3[_0x49fd('0x86')]['tag']?!![]:![]},{'model':_0x32d855[_0x49fd('0x68')],'as':'ThroughTags','attributes':['id',_0x49fd('0xf'),'color'],'through':_0xb1e0f3['query']['tag']?{'attributes':[],'where':{'TagId':_0xb1e0f3['query']['tag']||undefined}}:{},'required':_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0xae')]?!![]:![]}];}else{_0x582286[_0x49fd('0xa6')]=[{'all':!![]}];}}return _0x32d855[_0x5a6fe0['childModel']][_0x49fd('0x9')](_0x582286);})[_0x49fd('0xa')](function(_0x20326b){_0x58ae06['rows']=_0x20326b;if(_0x418673===_0x49fd('0x31')&&_0xb1e0f3['query'][_0x49fd('0xaf')]===_0x49fd('0xb0')){var _0xd23a0a=[];for(var _0x148a2b=0x0;_0x148a2b<_0x58ae06[_0x49fd('0xab')][_0x49fd('0x8a')];_0x148a2b++){_0xd23a0a[_0x49fd('0x8b')](_0x4fe873(_0x49fd('0xb1'),_0x58ae06[_0x49fd('0xab')][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a['push'](_0x4fe873(_0x49fd('0xb3'),_0x58ae06[_0x49fd('0xab')][_0x148a2b]['dataValues']));_0xd23a0a[_0x49fd('0x8b')](_0x4fe873('fax',_0x58ae06['rows'][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a[_0x49fd('0x8b')](_0x4fe873('mail',_0x58ae06[_0x49fd('0xab')][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a[_0x49fd('0x8b')](_0x4fe873(_0x49fd('0xb4'),_0x58ae06[_0x49fd('0xab')][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a['push'](_0x4fe873('whatsapp',_0x58ae06['rows'][_0x148a2b][_0x49fd('0xb2')]));}return Promise['all'](_0xd23a0a)[_0x49fd('0xa')](function(){return _0x58ae06;});}return _0x58ae06;});}});}}});}; \ No newline at end of file +var _0x66fa=['sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','union','ignore','push','autoAssociation','model','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','reportType','default','custom','CustomReports','rows','count','include','color','tag','openTabs','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','then','associatedResources','findAll','map','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','SquareOdbc','squarerecordings','childModel','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','agent','Telephones','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','telephones','Users','user','Agents','ZendeskAccount','salesforceaccounts','FreshdeskAccount'];(function(_0x2c5605,_0x370f66){var _0x4591c0=function(_0x1f1e75){while(--_0x1f1e75){_0x2c5605['push'](_0x2c5605['shift']());}};_0x4591c0(++_0x370f66);}(_0x66fa,0x117));var _0xa66f=function(_0x4ecc17,_0x1fcb71){_0x4ecc17=_0x4ecc17-0x0;var _0x3029a6=_0x66fa[_0x4ecc17];return _0x3029a6;};'use strict';var _=require(_0xa66f('0x0'));var attributes=require(_0xa66f('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xa66f('0x2'));module[_0xa66f('0x3')]=function(_0x234f2d){var _0x12a38f=_0x234f2d[_0xa66f('0x4')];function _0x2a2abf(_0x3f4904,_0x5ebea5){return new Promise(function(_0x4fd9d0,_0x2239d3){if(!_0x5ebea5)return _0x4fd9d0(null);var _0x20a150=_0x5ebea5[_0xa66f('0x5')]?{[_0x5ebea5[_0xa66f('0x5')][_0xa66f('0x6')]]:_0x5ebea5['filter'][_0xa66f('0x7')]}:undefined;return _0x12a38f[_0x3f4904]['findAll']({'where':_0x20a150,'raw':!![]})[_0xa66f('0x8')](function(_0x597c7c){_0x5ebea5[_0xa66f('0x9')]=_['map'](_0x597c7c,'id');_0x4fd9d0(_0x5ebea5);})['catch'](function(_0x55e6dc){_0x2239d3(_0x55e6dc);});});}function _0x1e1997(_0x825868,_0x4979c6){return new Promise(function(_0x14d31e,_0x4cd893){var _0x28634d=_0x825868['filter']?{[_0x825868[_0xa66f('0x5')][_0xa66f('0x6')]]:_0x825868[_0xa66f('0x5')]['value']}:undefined;return _0x12a38f[_0x825868['model']][_0xa66f('0xa')]({'where':_0x28634d,'raw':!![]})['then'](function(_0x528427){_0x4979c6['associatedResources']=_[_0xa66f('0xb')](_0x528427,function(_0x452c37){return _0x452c37[_0xa66f('0xc')];});_0x14d31e(_0x4979c6);})[_0xa66f('0xd')](function(_0xd348f9){_0x4cd893(_0xd348f9);});});}function _0x567d4f(_0x5510dc,_0x19b5ac,_0x32d338){if(!_0x19b5ac)return Promise[_0xa66f('0xe')](null);return new Promise(function(_0x403f4d,_0x5c67f5){return _0x12a38f[_0xa66f('0xf')]['findAll']({'where':{'sectionId':_0x19b5ac['id']},'raw':!![]})['then'](function(_0x2f9da2){if(_0x5510dc[_0xa66f('0x6')]&&_0x5510dc[_0xa66f('0x6')]!=='id'){_0x19b5ac[_0xa66f('0x9')]=_[_0xa66f('0xb')](_0x2f9da2,function(_0x408bc7){return _0x408bc7[_0x5510dc[_0xa66f('0x6')]];});}else{if(_0x32d338===_0xa66f('0x10')){_0x19b5ac[_0xa66f('0x9')]=_[_0xa66f('0xb')](_0x2f9da2,function(_0x235b61){return{'id':_0x235b61[_0xa66f('0x11')],'type':_0x235b61[_0xa66f('0x12')]};});}else{_0x19b5ac[_0xa66f('0x9')]=_[_0xa66f('0xb')](_0x2f9da2,function(_0x5cd613){return _0x5cd613[_0xa66f('0x11')];});}}_0x403f4d(_0x19b5ac);})[_0xa66f('0xd')](function(_0x40ee00){_0x5c67f5(_0x40ee00);});});}function _0x37ee13(_0x5cbd82,_0x337602){var _0x473822={'parentSections':[]};switch(_0x5cbd82[_0xa66f('0x13')]()){case _0xa66f('0x14'):_0x473822['childModel']='SquareProject';break;case _0xa66f('0x15'):_0x473822['childModel']=_0xa66f('0x16');break;case _0xa66f('0x17'):_0x473822[_0xa66f('0x18')]='SquareRecording';_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x1a'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x1b')}];break;case _0xa66f('0x1c'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x1d');break;case _0xa66f('0x1e'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x1f');_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x20'),'field':'id','foreignKey':_0xa66f('0x21')}];break;case _0xa66f('0x22'):_0x473822['childModel']='CmList';break;case _0xa66f('0x23'):_0x473822[_0xa66f('0x18')]='CmCompany';break;case _0xa66f('0x24'):_0x473822[_0xa66f('0x18')]='CmCustomField';break;case _0xa66f('0x25'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x26');break;case _0xa66f('0x27'):_0x473822[_0xa66f('0x18')]='ChatWebsite';break;case _0xa66f('0x28'):_0x473822['childModel']=_0xa66f('0x29');break;case _0xa66f('0x2a'):_0x473822[_0xa66f('0x18')]='FaxAccount';break;case _0xa66f('0x2b'):case _0xa66f('0x2c'):case'outboundroutes':_0x473822[_0xa66f('0x18')]=_0xa66f('0x2d');break;case _0xa66f('0x2e'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x2f');break;case _0xa66f('0x30'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x31');break;case _0xa66f('0x32'):_0x473822[_0xa66f('0x18')]='VoiceRecording';_0x473822[_0xa66f('0x19')]=[{'name':'Agents','field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x33'),'model':_0xa66f('0x34'),'filter':{'field':_0xa66f('0x35'),'value':[_0xa66f('0x36')]}},{'name':_0xa66f('0x37'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x33'),'model':'User','filter':{'field':_0xa66f('0x35'),'value':['telephone']}},{'name':_0xa66f('0x38'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x39'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xa66f('0x3a')]}},{'name':_0xa66f('0x3b'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x39'),'model':_0xa66f('0x3c'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x473822[_0xa66f('0x18')]='VoiceMusicOnHold';break;case'chanspies':_0x473822['childModel']=_0xa66f('0x3d');break;case'voiceprefixes':_0x473822[_0xa66f('0x18')]=_0xa66f('0x3e');break;case _0xa66f('0x3f'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x40');break;case _0xa66f('0x41'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x42');break;case _0xa66f('0x43'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x44');break;case _0xa66f('0x45'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x46');break;case'openchannelqueues':_0x473822[_0xa66f('0x18')]=_0xa66f('0x47');break;case'openchannelaccounts':_0x473822[_0xa66f('0x18')]='OpenchannelAccount';break;case _0xa66f('0x48'):_0x473822[_0xa66f('0x18')]='SmsQueue';break;case _0xa66f('0x49'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x4a');break;case'whatsappqueues':_0x473822[_0xa66f('0x18')]='WhatsappQueue';break;case _0xa66f('0x4b'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x4c');break;case _0xa66f('0x4d'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x4e');break;case _0xa66f('0x4f'):case'queuecampaigns':_0x473822[_0xa66f('0x18')]=_0xa66f('0x3c');if(_0x337602){_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x38')},{'name':_0xa66f('0x3b')}];}break;case'users':case'agents':case _0xa66f('0x50'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x34');if(_0x337602){_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x51'),'filter':{'field':_0xa66f('0x35'),'value':['admin',_0xa66f('0x52')]},'ignore':!![]},{'name':_0xa66f('0x53')},{'name':_0xa66f('0x37')}];}break;case'zendeskaccounts':_0x473822['childModel']=_0xa66f('0x54');break;case _0xa66f('0x55'):_0x473822[_0xa66f('0x18')]='SalesforceAccount';break;case'freshdeskaccounts':_0x473822['childModel']=_0xa66f('0x56');break;case _0xa66f('0x57'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x58');break;case _0xa66f('0x59'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x5a');break;case _0xa66f('0x5b'):_0x473822['childModel']=_0xa66f('0x5c');break;case _0xa66f('0x5d'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x34');break;case _0xa66f('0x5e'):_0x473822[_0xa66f('0x18')]='CannedAnswer';break;case _0xa66f('0x5f'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x60');break;case _0xa66f('0x61'):_0x473822[_0xa66f('0x18')]='Dashboard';break;case _0xa66f('0x62'):_0x473822['childModel']=_0xa66f('0x63');break;case'pauses':_0x473822['childModel']=_0xa66f('0x64');break;case _0xa66f('0x65'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x66');break;case _0xa66f('0x67'):_0x473822[_0xa66f('0x18')]='Sound';break;case _0xa66f('0x68'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x69');break;case _0xa66f('0x6a'):_0x473822['childModel']=_0xa66f('0x6b');break;case'triggers':_0x473822[_0xa66f('0x18')]=_0xa66f('0x6c');break;case _0xa66f('0x6d'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x6e');break;case _0xa66f('0x6f'):_0x473822[_0xa66f('0x18')]='Variable';break;case _0xa66f('0x70'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x71');break;case _0xa66f('0x72'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x10');_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x73'),'field':'id','foreignKey':_0xa66f('0x74')}];break;case'metrics':_0x473822['childModel']=_0xa66f('0x75');break;}return _0x473822;}function _0x8c7bdc(_0x31ffea,_0xf5cdf8){var _0x2f1f1e=_0x31ffea[_0xa66f('0x76')](0x0)[_0xa66f('0x77')]()+_0x31ffea['slice'](0x1);var _0x1709eb={'type':_0x12a38f[_0xa66f('0x78')][_0xa66f('0x79')][_0xa66f('0x7a')],'raw':!![]};return new Promise(function(_0x53d22a,_0x29f216){var _0x242100=squel[_0xa66f('0x7b')]()[_0xa66f('0x6')](_0xa66f('0x7c')+_0x2f1f1e+_0xa66f('0x7d'),'id')['field']('ui.createdAt')[_0xa66f('0x7e')](_0xa66f('0x7f')+_0x31ffea+_0xa66f('0x80'),'ui')['where'](_0xa66f('0x81'),_0xf5cdf8['id']);return _0x12a38f[_0xa66f('0x82')][_0xa66f('0x83')](_0x242100[_0xa66f('0x84')](),_0x1709eb)[_0xa66f('0x8')](function(_0x465758){_0xf5cdf8[_0x2f1f1e+_0xa66f('0x85')]=_0x465758;_0x53d22a(_0x465758);})[_0xa66f('0xd')](function(_0x3b8428){_0x29f216(_0x3b8428);});});}return _0x234f2d['define'](_0xa66f('0x86'),attributes,{'tableName':_0xa66f('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x235e4f){var _0x172c42={'raw':![],'where':{}};var _0x4565f5={};var _0x148ad1={'count':0x0,'rows':[]};var _0x41ffa7=_0x235e4f[_0xa66f('0x83')]['section'];var _0x52f22d=_0x235e4f[_0xa66f('0x83')][_0xa66f('0x88')]||![];var _0x2540ad=_0x37ee13(_0x41ffa7,_0x52f22d);if(!_0x2540ad[_0xa66f('0x18')])throw new Error(_0xa66f('0x89')+_0x41ffa7+'\x27');var _0x508e73=[{'name':_0x41ffa7}];if(!_[_0xa66f('0x8a')](_0x2540ad['parentSections']))_0x508e73=_0x2540ad[_0xa66f('0x19')];var _0x66dbf4=[];for(var _0x450e1d=0x0;_0x450e1d<_0x508e73[_0xa66f('0x8b')];_0x450e1d++){_0x66dbf4['push'](_0x12a38f[_0xa66f('0x8c')][_0xa66f('0x8d')]({'where':{'userProfileId':_0x235e4f[_0xa66f('0x8e')]['id'],'name':_0x508e73[_0x450e1d][_0xa66f('0xc')]},'raw':!![]}));}return Promise[_0xa66f('0x8f')](_0x66dbf4)[_0xa66f('0x8')](function(_0xe06d44){var _0x2bdb18=_[_0xa66f('0x5')](_0xe06d44,function(_0x36b92f){return _0x36b92f?_0x36b92f:undefined;});var _0x290323=_[_0xa66f('0x5')](_0x508e73,['ignore',!![]]);var _0x1854d3=_[_0xa66f('0x8a')](_0x2bdb18)&&_[_0xa66f('0x8a')](_0x290323)?null:_[_0xa66f('0x90')](_0x290323,_0x2bdb18);if(!_0x1854d3)return null;var _0x178434=[];for(var _0x325916=0x0;_0x325916<_0x1854d3[_0xa66f('0x8b')];_0x325916++){var _0x68bd43=_['find'](_0x508e73,function(_0x5173f0){return _0x1854d3[_0x325916]?_0x5173f0[_0xa66f('0xc')]===_0x1854d3[_0x325916][_0xa66f('0xc')]:null;});if(_0x68bd43){if(_0x1854d3[_0x325916][_0xa66f('0x91')]){_0x178434[_0xa66f('0x92')](_0x2a2abf(_0x2540ad[_0xa66f('0x18')],_0x1854d3[_0x325916]));}else{if(!_0x1854d3[_0x325916][_0xa66f('0x93')]){_0x178434[_0xa66f('0x92')](_0x567d4f(_0x68bd43,_0x1854d3[_0x325916],_0x2540ad['childModel']));}else{if(_0x68bd43['model']){_0x178434[_0xa66f('0x92')](_0x1e1997(_0x68bd43,_0x1854d3[_0x325916]));}}}}}return Promise[_0xa66f('0x8f')](_0x178434);})[_0xa66f('0x8')](function(_0x5b03a4){var _0x53b01b=_0x5b03a4;var _0x2dc550=null;if(_0x53b01b){_0x2dc550=_0x53b01b[_0xa66f('0x8b')]===0x1?_0x53b01b[0x0]:null;}if(!_0x2dc550&&!_0x53b01b)return _0x148ad1;var _0x4293dc=_0x12a38f[_0x2540ad[_0xa66f('0x18')]]['rawAttributes'];_0x4565f5[_0xa66f('0x94')]=_[_0xa66f('0x95')](_0x4293dc);_0x4565f5[_0xa66f('0x83')]=_[_0xa66f('0x95')](_0x235e4f[_0xa66f('0x83')]);_0x4565f5[_0xa66f('0x96')]=_[_0xa66f('0x97')](_0x4565f5[_0xa66f('0x94')],_0x4565f5['query']);_0x172c42[_0xa66f('0x98')]=_[_0xa66f('0x97')](_0x4565f5['model'],qs['fields'](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x99')]));_0x172c42['attributes']=_0x172c42[_0xa66f('0x98')]['length']?_0x172c42[_0xa66f('0x98')]:_0x4565f5['model'];if(!_0x235e4f['query']['hasOwnProperty'](_0xa66f('0x9a'))){_0x172c42[_0xa66f('0x9b')]=qs[_0xa66f('0x9b')](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x9b')]);_0x172c42[_0xa66f('0x9c')]=qs[_0xa66f('0x9c')](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x9c')]);}_0x172c42[_0xa66f('0x9d')]=qs[_0xa66f('0x9e')](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x9e')]);_0x172c42[_0xa66f('0x9f')]=qs[_0xa66f('0x96')](_[_0xa66f('0xa0')](_0x235e4f['query'],_0x4565f5[_0xa66f('0x96')]));if(_0x235e4f['query'][_0xa66f('0x5')]){_0x172c42['where']=_[_0xa66f('0xa1')](_0x172c42[_0xa66f('0x9f')],{'$or':_[_0xa66f('0xb')](_0x4293dc,function(_0x5ecc98){if(_0x5ecc98['type'][_0xa66f('0xa2')]!==_0xa66f('0xa3')){var _0x38b869={};_0x38b869[_0x5ecc98[_0xa66f('0x6')]]={'$like':'%'+_0x235e4f[_0xa66f('0x83')][_0xa66f('0x5')]+'%'};return _0x38b869;}})});}var _0x30bcda=[];var _0x578bff=null;var _0x4013b9={};if(_0x2dc550){_0x578bff=_[_0xa66f('0x8d')](_0x508e73,[_0xa66f('0xc'),_0x2dc550[_0xa66f('0xc')]]);if(_0x578bff[_0xa66f('0x6')]){_0x4013b9={};if(_0x2540ad[_0xa66f('0x18')]===_0xa66f('0x10')){_0x4013b9[_0x578bff[_0xa66f('0xa4')]]=_[_0xa66f('0xb')](_0x2dc550[_0xa66f('0x9')],'id');}else{_0x4013b9[_0x578bff[_0xa66f('0xa4')]]=_0x2dc550[_0xa66f('0x9')];}_0x30bcda[_0xa66f('0x92')](_0x4013b9);}else{_0x172c42['where']['id']=_0x2dc550[_0xa66f('0x9')];}}else{for(var _0x722786=0x0;_0x722786<_0x53b01b[_0xa66f('0x8b')];_0x722786++){_0x578bff=_[_0xa66f('0x8d')](_0x508e73,[_0xa66f('0xc'),_0x53b01b[_0x722786][_0xa66f('0xc')]]);if(_0x578bff[_0xa66f('0x6')]){_0x4013b9={};_0x4013b9[_0x578bff[_0xa66f('0xa4')]]=_0x53b01b[_0x722786][_0xa66f('0x9')];_0x30bcda['push'](_0x4013b9);}else{if(!_0x172c42[_0xa66f('0x9f')]['id'])_0x172c42['where']['id']=[];_0x53b01b[_0x722786][_0xa66f('0x9')]['forEach'](function(_0x25d203){_0x172c42['where']['id'][_0xa66f('0x92')](_0x25d203);});}}}if(!_['isEmpty'](_0x30bcda)){_0x172c42[_0xa66f('0x9f')]=_[_0xa66f('0xa1')](_0x172c42[_0xa66f('0x9f')],{'$and':{'$or':_0x30bcda}});}_0x172c42=_[_0xa66f('0xa1')]({},_0x172c42,_0x235e4f[_0xa66f('0xa5')]);if(_0x2dc550&&!_0x2dc550[_0xa66f('0x93')]&&_0x2540ad['childModel']===_0xa66f('0x10')){if(_0x235e4f[_0xa66f('0x83')][_0xa66f('0xa6')]){_0x172c42['include']=[{'all':!![]}];}return _0x12a38f[_0x2540ad[_0xa66f('0x18')]][_0xa66f('0xa')](_0x172c42)['then'](function(_0x1e8510){var _0x473ebd=[];_0x1e8510['forEach'](function(_0x57f0b7){var _0x125bf4;switch(_0x57f0b7[_0xa66f('0xa7')]){case _0xa66f('0xa8'):_0x125bf4=_[_0xa66f('0x8d')](_0x2dc550[_0xa66f('0x9')],function(_0x495a04){return _0x495a04['id']===_0x57f0b7[_0xa66f('0x74')]&&_0x495a04[_0xa66f('0x12')]==='DefaultReports';});break;case _0xa66f('0xa9'):_0x125bf4=_[_0xa66f('0x8d')](_0x2dc550['associatedResources'],function(_0x453847){return _0x453847['id']===_0x57f0b7[_0xa66f('0x74')]&&_0x453847[_0xa66f('0x12')]===_0xa66f('0xaa');});break;}if(_0x125bf4)_0x473ebd[_0xa66f('0x92')](_0x57f0b7);});_0x148ad1['count']=_0x473ebd[_0xa66f('0x8b')];_0x148ad1[_0xa66f('0xab')]=_0x473ebd;return _0x148ad1;});}else{return _0x12a38f[_0x2540ad[_0xa66f('0x18')]][_0xa66f('0xac')]({'where':_0x172c42[_0xa66f('0x9f')]})[_0xa66f('0x8')](function(_0x4e318d){_0x148ad1[_0xa66f('0xac')]=_0x4e318d;if(_0x235e4f[_0xa66f('0x83')][_0xa66f('0xa6')]){if(_0x2540ad[_0xa66f('0x18')]===_0xa66f('0x1f')){_0x172c42[_0xa66f('0xad')]=[{'model':_0x12a38f[_0xa66f('0x69')],'as':'Tags','attributes':['id','name',_0xa66f('0xae')],'required':_0x235e4f['query'][_0xa66f('0xaf')]?!![]:![]},{'model':_0x12a38f[_0xa66f('0x69')],'as':'ThroughTags','attributes':['id',_0xa66f('0xc'),_0xa66f('0xae')],'through':_0x235e4f[_0xa66f('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x235e4f['query'][_0xa66f('0xaf')]||undefined}}:{},'required':_0x235e4f['query'][_0xa66f('0xaf')]?!![]:![]}];}else{_0x172c42[_0xa66f('0xad')]=[{'all':!![]}];}}return _0x12a38f[_0x2540ad[_0xa66f('0x18')]]['findAll'](_0x172c42);})[_0xa66f('0x8')](function(_0x4cefa7){_0x148ad1[_0xa66f('0xab')]=_0x4cefa7;if(_0x41ffa7===_0xa66f('0x53')&&_0x235e4f[_0xa66f('0x83')][_0xa66f('0xb0')]==='true'){var _0x20a5bc=[];for(var _0x3ac90f=0x0;_0x3ac90f<_0x148ad1[_0xa66f('0xab')][_0xa66f('0x8b')];_0x3ac90f++){_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb1'),_0x148ad1['rows'][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb3'),_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc['push'](_0x8c7bdc('fax',_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb4'),_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb5'),_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb6'),_0x148ad1['rows'][_0x3ac90f][_0xa66f('0xb2')]));}return Promise[_0xa66f('0x8f')](_0x20a5bc)['then'](function(){return _0x148ad1;});}return _0x148ad1;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 1feae7e..d477315 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 _0x960c=['socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost'];(function(_0x195310,_0x4496bf){var _0x2a83c9=function(_0x19337a){while(--_0x19337a){_0x195310['push'](_0x195310['shift']());}};_0x2a83c9(++_0x4496bf);}(_0x960c,0x113));var _0xc960=function(_0x573337,_0x350c77){_0x573337=_0x573337-0x0;var _0x6f8baf=_0x960c[_0x573337];return _0x6f8baf;};'use strict';var _=require(_0xc960('0x0'));var util=require('util');var moment=require(_0xc960('0x1'));var BPromise=require('bluebird');var rs=require(_0xc960('0x2'));var fs=require('fs');var Redis=require(_0xc960('0x3'));var db=require(_0xc960('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc960('0x5'))(_0xc960('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc960('0x7')][_0xc960('0x8')]({'port':0x232a});config[_0xc960('0x9')]=_['defaults'](config['redis'],{'host':_0xc960('0xa'),'port':0x18eb});var socket=require(_0xc960('0xb'))(new Redis(config['redis']));require('./userProfile.socket')[_0xc960('0xc')](socket);function respondWithRpcPromise(_0x27b0d6,_0x1e999f,_0x465ca0){return new BPromise(function(_0x5a9ace,_0x5358d0){return client[_0xc960('0xd')](_0x27b0d6,_0x465ca0)[_0xc960('0xe')](function(_0x18d8c9){logger[_0xc960('0xf')](_0xc960('0x10'),_0x1e999f,_0xc960('0x11'));logger[_0xc960('0x12')](_0xc960('0x13'),_0x1e999f,_0xc960('0x11'),JSON[_0xc960('0x14')](_0x18d8c9));if(_0x18d8c9[_0xc960('0x15')]){if(_0x18d8c9['error'][_0xc960('0x16')]===0x1f4){logger[_0xc960('0x15')](_0xc960('0x10'),_0x1e999f,_0x18d8c9[_0xc960('0x15')]['message']);return _0x5358d0(_0x18d8c9[_0xc960('0x15')][_0xc960('0x17')]);}logger[_0xc960('0x15')](_0xc960('0x10'),_0x1e999f,_0x18d8c9[_0xc960('0x15')][_0xc960('0x17')]);return _0x5a9ace(_0x18d8c9[_0xc960('0x15')][_0xc960('0x17')]);}else{logger[_0xc960('0xf')](_0xc960('0x10'),_0x1e999f,_0xc960('0x11'));_0x5a9ace(_0x18d8c9[_0xc960('0x18')][_0xc960('0x17')]);}})[_0xc960('0x19')](function(_0x3a23b3){logger['error'](_0xc960('0x10'),_0x1e999f,_0x3a23b3);_0x5358d0(_0x3a23b3);});});} \ No newline at end of file +var _0xf435=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf435,0x174));var _0x5f43=function(_0x384fc2,_0x355f74){_0x384fc2=_0x384fc2-0x0;var _0xa88873=_0xf435[_0x384fc2];return _0xa88873;};'use strict';var _=require('lodash');var util=require(_0x5f43('0x0'));var moment=require(_0x5f43('0x1'));var BPromise=require(_0x5f43('0x2'));var rs=require(_0x5f43('0x3'));var fs=require('fs');var Redis=require(_0x5f43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f43('0x5'));var logger=require(_0x5f43('0x6'))(_0x5f43('0x7'));var config=require(_0x5f43('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f43('0x9')][_0x5f43('0xa')]({'port':0x232a});config[_0x5f43('0xb')]=_['defaults'](config[_0x5f43('0xb')],{'host':_0x5f43('0xc'),'port':0x18eb});var socket=require(_0x5f43('0xd'))(new Redis(config[_0x5f43('0xb')]));require(_0x5f43('0xe'))[_0x5f43('0xf')](socket);function respondWithRpcPromise(_0x233acb,_0x43a927,_0x35d958){return new BPromise(function(_0x43468d,_0x1c9040){return client['request'](_0x233acb,_0x35d958)['then'](function(_0x1a3d7f){logger[_0x5f43('0x10')](_0x5f43('0x11'),_0x43a927,_0x5f43('0x12'));logger[_0x5f43('0x13')](_0x5f43('0x14'),_0x43a927,_0x5f43('0x12'),JSON[_0x5f43('0x15')](_0x1a3d7f));if(_0x1a3d7f['error']){if(_0x1a3d7f[_0x5f43('0x16')]['code']===0x1f4){logger[_0x5f43('0x16')]('UserProfile,\x20%s,\x20%s',_0x43a927,_0x1a3d7f[_0x5f43('0x16')][_0x5f43('0x17')]);return _0x1c9040(_0x1a3d7f[_0x5f43('0x16')][_0x5f43('0x17')]);}logger['error'](_0x5f43('0x11'),_0x43a927,_0x1a3d7f[_0x5f43('0x16')][_0x5f43('0x17')]);return _0x43468d(_0x1a3d7f['error'][_0x5f43('0x17')]);}else{logger[_0x5f43('0x10')](_0x5f43('0x11'),_0x43a927,_0x5f43('0x12'));_0x43468d(_0x1a3d7f[_0x5f43('0x18')][_0x5f43('0x17')]);}})['catch'](function(_0x74fd9d){logger[_0x5f43('0x16')]('UserProfile,\x20%s,\x20%s',_0x43a927,_0x74fd9d);_0x1c9040(_0x74fd9d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a84f518..dbcfe8a 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 _0x925c=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x925c,0xf4));var _0xc925=function(_0x483545,_0x352f47){_0x483545=_0x483545-0x0;var _0x24922f=_0x925c[_0x483545];return _0x24922f;};'use strict';var UserProfileEvents=require(_0xc925('0x0'));var events=[_0xc925('0x1'),_0xc925('0x2'),_0xc925('0x3')];function createListener(_0x55c988,_0x4daae6){return function(_0x407bc1){_0x4daae6[_0xc925('0x4')](_0x55c988,_0x407bc1);};}function removeListener(_0x1d7af3,_0x53524e){return function(){UserProfileEvents[_0xc925('0x5')](_0x1d7af3,_0x53524e);};}exports[_0xc925('0x6')]=function(_0x94c376){for(var _0x4258b8=0x0,_0x171f5f=events[_0xc925('0x7')];_0x4258b8<_0x171f5f;_0x4258b8++){var _0xf9bd45=events[_0x4258b8];var _0x2dfda2=createListener(_0xc925('0x8')+_0xf9bd45,_0x94c376);UserProfileEvents['on'](_0xf9bd45,_0x2dfda2);}}; \ No newline at end of file +var _0xa163=['length','userProfile:','./userProfile.events','remove','update','removeListener','register'];(function(_0x28958d,_0xfa5f9f){var _0x439c72=function(_0x280df5){while(--_0x280df5){_0x28958d['push'](_0x28958d['shift']());}};_0x439c72(++_0xfa5f9f);}(_0xa163,0x175));var _0x3a16=function(_0x19ed41,_0x4a09f4){_0x19ed41=_0x19ed41-0x0;var _0x435f19=_0xa163[_0x19ed41];return _0x435f19;};'use strict';var UserProfileEvents=require(_0x3a16('0x0'));var events=['save',_0x3a16('0x1'),_0x3a16('0x2')];function createListener(_0x18f929,_0x2e98b5){return function(_0x50eeff){_0x2e98b5['emit'](_0x18f929,_0x50eeff);};}function removeListener(_0x4946cb,_0x4e8981){return function(){UserProfileEvents[_0x3a16('0x3')](_0x4946cb,_0x4e8981);};}exports[_0x3a16('0x4')]=function(_0x2bf05b){for(var _0x1aae47=0x0,_0x330dbe=events[_0x3a16('0x5')];_0x1aae47<_0x330dbe;_0x1aae47++){var _0x5357e0=events[_0x1aae47];var _0xcc9a3e=createListener(_0x3a16('0x6')+_0x5357e0,_0x2bf05b);UserProfileEvents['on'](_0x5357e0,_0xcc9a3e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 88d1eb1..3c4acf5 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 _0x5c72=['destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','delete'];(function(_0x3ca9df,_0x19dc5a){var _0x37d2e3=function(_0x1c0d93){while(--_0x1c0d93){_0x3ca9df['push'](_0x3ca9df['shift']());}};_0x37d2e3(++_0x19dc5a);}(_0x5c72,0x158));var _0x25c7=function(_0x10ba46,_0x463b65){_0x10ba46=_0x10ba46-0x0;var _0x2bfb84=_0x5c72[_0x10ba46];return _0x2bfb84;};'use strict';var multer=require('multer');var util=require(_0x25c7('0x0'));var path=require(_0x25c7('0x1'));var timeout=require(_0x25c7('0x2'));var express=require('express');var router=express[_0x25c7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x25c7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x25c7('0x5'));var controller=require(_0x25c7('0x6'));router[_0x25c7('0x7')]('/',auth[_0x25c7('0x8')](),controller['index']);router[_0x25c7('0x7')](_0x25c7('0x9'),auth[_0x25c7('0x8')](),controller['describe']);router[_0x25c7('0x7')](_0x25c7('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x25c7('0xb')]('/',auth['isAuthenticated'](),controller[_0x25c7('0xc')]);router[_0x25c7('0xd')]('/:id',auth[_0x25c7('0x8')](),controller[_0x25c7('0xe')]);router[_0x25c7('0xf')](_0x25c7('0xa'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x10')]);module[_0x25c7('0x11')]=router; \ No newline at end of file +var _0xfa9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','create','put','update','exports','path','connect-timeout','express'];(function(_0x66fb66,_0x48b792){var _0xc6ff16=function(_0x41522f){while(--_0x41522f){_0x66fb66['push'](_0x66fb66['shift']());}};_0xc6ff16(++_0x48b792);}(_0xfa9e,0x18c));var _0xefa9=function(_0x21bba3,_0x72758e){_0x21bba3=_0x21bba3-0x0;var _0x2b3ba6=_0xfa9e[_0x21bba3];return _0x2b3ba6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xefa9('0x0'));var timeout=require(_0xefa9('0x1'));var express=require(_0xefa9('0x2'));var router=express[_0xefa9('0x3')]();var fs_extra=require(_0xefa9('0x4'));var auth=require(_0xefa9('0x5'));var interaction=require(_0xefa9('0x6'));var config=require(_0xefa9('0x7'));var controller=require(_0xefa9('0x8'));router[_0xefa9('0x9')]('/',auth['isAuthenticated'](),controller[_0xefa9('0xa')]);router[_0xefa9('0x9')](_0xefa9('0xb'),auth[_0xefa9('0xc')](),controller[_0xefa9('0xd')]);router[_0xefa9('0x9')](_0xefa9('0xe'),auth[_0xefa9('0xc')](),controller['show']);router['post']('/',auth[_0xefa9('0xc')](),controller[_0xefa9('0xf')]);router[_0xefa9('0x10')](_0xefa9('0xe'),auth[_0xefa9('0xc')](),controller[_0xefa9('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xefa9('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index cbdcb5c..a565c2d 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 _0xa5ac=['sequelize','exports','STRING','INTEGER'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0xa5ac,0x12c));var _0xca5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xca5a('0x0'));module[_0xca5a('0x1')]={'name':{'type':Sequelize[_0xca5a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xca5a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xca5a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x07d8=['exports','STRING','INTEGER'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x07d8,0x15f));var _0x807d=function(_0x31b950,_0x48a4e9){_0x31b950=_0x31b950-0x0;var _0x415d87=_0x07d8[_0x31b950];return _0x415d87;};'use strict';var Sequelize=require('sequelize');module[_0x807d('0x0')]={'name':{'type':Sequelize[_0x807d('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x807d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x807d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 962b59a..8d274f3 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 _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','UserProfileResource','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x52d7df,_0x5d5742){var _0x6163fc=function(_0x79d617){while(--_0x79d617){_0x52d7df['push'](_0x52d7df['shift']());}};_0x6163fc(++_0x5d5742);}(_0x4c60,0xc1));var _0x04c6=function(_0x446dec,_0x14e411){_0x446dec=_0x446dec-0x0;var _0x58e353=_0x4c60[_0x446dec];return _0x58e353;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['UserProfileResource'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['UserProfileResource'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['UserProfileResource'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['UserProfileResource'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file +var _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x3a80a0,_0x16f9ee){var _0x5318c5=function(_0x2651de){while(--_0x2651de){_0x3a80a0['push'](_0x3a80a0['shift']());}};_0x5318c5(++_0x16f9ee);}(_0xd943,0x15d));var _0x3d94=function(_0x2c03c8,_0x255612){_0x2c03c8=_0x2c03c8-0x0;var _0x325ac3=_0xd943[_0x2c03c8];return _0x325ac3;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 7b4cda7..d3c3bda 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 _0x2370=['../../config/environment','exports','resourceId','sectionId','lodash','api','moment','bluebird','path','rimraf'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x2370,0x9a));var _0x0237=function(_0x439534,_0x4ff786){_0x439534=_0x439534-0x0;var _0x211660=_0x2370[_0x439534];return _0x211660;};'use strict';var _=require(_0x0237('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0237('0x1'));var moment=require(_0x0237('0x2'));var BPromise=require(_0x0237('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0237('0x4'));var rimraf=require(_0x0237('0x5'));var config=require(_0x0237('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x0237('0x7')]=function(_0x5e1929,_0x535aac){return _0x5e1929['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x0237('0x8'),_0x0237('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0274=['moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0x0274,0x10f));var _0x4027=function(_0x1e5a87,_0xad9d5){_0x1e5a87=_0x1e5a87-0x0;var _0x309977=_0x0274[_0x1e5a87];return _0x309977;};'use strict';var _=require('lodash');var util=require(_0x4027('0x0'));var logger=require(_0x4027('0x1'))('api');var moment=require(_0x4027('0x2'));var BPromise=require('bluebird');var rp=require(_0x4027('0x3'));var fs=require('fs');var path=require(_0x4027('0x4'));var rimraf=require(_0x4027('0x5'));var config=require(_0x4027('0x6'));var attributes=require(_0x4027('0x7'));module['exports']=function(_0x299911,_0x4f45cc){return _0x299911['define'](_0x4027('0x8'),attributes,{'tableName':_0x4027('0x9'),'paranoid':![],'indexes':[{'name':_0x4027('0xa'),'fields':[_0x4027('0xb'),_0x4027('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 902725d..dbd2cb5 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 _0x0703=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0703,0xaa));var _0x3070=function(_0x592e8e,_0x182f70){_0x592e8e=_0x592e8e-0x0;var _0x59fcfa=_0x0703[_0x592e8e];return _0x59fcfa;};'use strict';var _=require(_0x3070('0x0'));var util=require('util');var moment=require(_0x3070('0x1'));var BPromise=require(_0x3070('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3070('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3070('0x4'))(_0x3070('0x5'));var config=require(_0x3070('0x6'));var jayson=require(_0x3070('0x7'));var client=jayson[_0x3070('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7baf,_0x20032f,_0xc18d26){return new BPromise(function(_0x155a1a,_0x2a6951){return client['request'](_0x2f7baf,_0xc18d26)[_0x3070('0x9')](function(_0x59fff1){logger[_0x3070('0xa')](_0x3070('0xb'),_0x20032f,_0x3070('0xc'));logger[_0x3070('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x20032f,_0x3070('0xc'),JSON[_0x3070('0xe')](_0x59fff1));if(_0x59fff1[_0x3070('0xf')]){if(_0x59fff1[_0x3070('0xf')]['code']===0x1f4){logger['error'](_0x3070('0xb'),_0x20032f,_0x59fff1[_0x3070('0xf')][_0x3070('0x10')]);return _0x2a6951(_0x59fff1['error'][_0x3070('0x10')]);}logger[_0x3070('0xf')](_0x3070('0xb'),_0x20032f,_0x59fff1[_0x3070('0xf')]['message']);return _0x155a1a(_0x59fff1[_0x3070('0xf')]['message']);}else{logger[_0x3070('0xa')](_0x3070('0xb'),_0x20032f,_0x3070('0xc'));_0x155a1a(_0x59fff1['result'][_0x3070('0x10')]);}})[_0x3070('0x11')](function(_0x36a9e0){logger[_0x3070('0xf')](_0x3070('0xb'),_0x20032f,_0x36a9e0);_0x2a6951(_0x36a9e0);});});} \ No newline at end of file +var _0x9ef5=['UserProfileResource,\x20%s,\x20%s','info','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xc93556,_0x840f41){var _0x4453a1=function(_0x3215f5){while(--_0x3215f5){_0xc93556['push'](_0xc93556['shift']());}};_0x4453a1(++_0x840f41);}(_0x9ef5,0x1a7));var _0x59ef=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x9ef5[_0xcfeda9];return _0x4826c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x59ef('0x0'));var BPromise=require(_0x59ef('0x1'));var rs=require(_0x59ef('0x2'));var fs=require('fs');var Redis=require(_0x59ef('0x3'));var db=require(_0x59ef('0x4'))['db'];var utils=require(_0x59ef('0x5'));var logger=require(_0x59ef('0x6'))(_0x59ef('0x7'));var config=require('../../config/environment');var jayson=require(_0x59ef('0x8'));var client=jayson[_0x59ef('0x9')][_0x59ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a7058,_0x4ac342,_0x537024){return new BPromise(function(_0x1a7179,_0x153e35){return client['request'](_0x2a7058,_0x537024)[_0x59ef('0xb')](function(_0x494c6c){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x4ac342,'request\x20sent');logger[_0x59ef('0xc')](_0x59ef('0xd'),_0x4ac342,'request\x20sent',JSON['stringify'](_0x494c6c));if(_0x494c6c[_0x59ef('0xe')]){if(_0x494c6c[_0x59ef('0xe')][_0x59ef('0xf')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x4ac342,_0x494c6c['error']['message']);return _0x153e35(_0x494c6c[_0x59ef('0xe')][_0x59ef('0x10')]);}logger[_0x59ef('0xe')](_0x59ef('0x11'),_0x4ac342,_0x494c6c[_0x59ef('0xe')]['message']);return _0x1a7179(_0x494c6c[_0x59ef('0xe')][_0x59ef('0x10')]);}else{logger[_0x59ef('0x12')](_0x59ef('0x11'),_0x4ac342,_0x59ef('0x13'));_0x1a7179(_0x494c6c[_0x59ef('0x14')][_0x59ef('0x10')]);}})[_0x59ef('0x15')](function(_0x535954){logger[_0x59ef('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x4ac342,_0x535954);_0x153e35(_0x535954);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index fe2875c..138a2d5 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 _0x799f=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','delete','exports'];(function(_0xded2b0,_0x304e30){var _0x53cb21=function(_0x44a7fc){while(--_0x44a7fc){_0xded2b0['push'](_0xded2b0['shift']());}};_0x53cb21(++_0x304e30);}(_0x799f,0x18f));var _0xf799=function(_0x4a14a3,_0x44ee62){_0x4a14a3=_0x4a14a3-0x0;var _0x611b22=_0x799f[_0x4a14a3];return _0x611b22;};'use strict';var multer=require(_0xf799('0x0'));var util=require(_0xf799('0x1'));var path=require(_0xf799('0x2'));var timeout=require(_0xf799('0x3'));var express=require(_0xf799('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf799('0x5'));var interaction=require(_0xf799('0x6'));var config=require(_0xf799('0x7'));var controller=require(_0xf799('0x8'));router[_0xf799('0x9')]('/',auth[_0xf799('0xa')](),controller[_0xf799('0xb')]);router['get'](_0xf799('0xc'),auth[_0xf799('0xa')](),controller['describe']);router[_0xf799('0x9')](_0xf799('0xd'),auth[_0xf799('0xa')](),controller[_0xf799('0xe')]);router[_0xf799('0xf')]('/',auth[_0xf799('0xa')](),controller['create']);router[_0xf799('0x10')](_0xf799('0xd'),auth[_0xf799('0xa')](),controller['update']);router[_0xf799('0x11')](_0xf799('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xf799('0x12')]=router; \ No newline at end of file +var _0x6c46=['../../config/environment','./userProfileSection.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x38f76c,_0x4106d6){var _0x3b858a=function(_0x49f40a){while(--_0x49f40a){_0x38f76c['push'](_0x38f76c['shift']());}};_0x3b858a(++_0x4106d6);}(_0x6c46,0x8a));var _0x66c4=function(_0x17ea17,_0x3c2ac9){_0x17ea17=_0x17ea17-0x0;var _0x1ea925=_0x6c46[_0x17ea17];return _0x1ea925;};'use strict';var multer=require('multer');var util=require(_0x66c4('0x0'));var path=require(_0x66c4('0x1'));var timeout=require(_0x66c4('0x2'));var express=require('express');var router=express[_0x66c4('0x3')]();var fs_extra=require(_0x66c4('0x4'));var auth=require(_0x66c4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x66c4('0x6'));var controller=require(_0x66c4('0x7'));router['get']('/',auth[_0x66c4('0x8')](),controller[_0x66c4('0x9')]);router['get']('/describe',auth[_0x66c4('0x8')](),controller[_0x66c4('0xa')]);router[_0x66c4('0xb')](_0x66c4('0xc'),auth['isAuthenticated'](),controller[_0x66c4('0xd')]);router[_0x66c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x66c4('0xf')]);router[_0x66c4('0x10')]('/:id',auth[_0x66c4('0x8')](),controller['update']);router['delete'](_0x66c4('0xc'),auth[_0x66c4('0x8')](),controller[_0x66c4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 14270fd..c9c5e9c 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 _0x8f4c=['setDataValue','join','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x20ac39,_0x14b5ce){var _0x587db1=function(_0x1686bc){while(--_0x1686bc){_0x20ac39['push'](_0x20ac39['shift']());}};_0x587db1(++_0x14b5ce);}(_0x8f4c,0x113));var _0xc8f4=function(_0x410b0b,_0x4e4d91){_0x410b0b=_0x410b0b-0x0;var _0x315c91=_0x8f4c[_0x410b0b];return _0x315c91;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc8f4('0x2')],'set':function(_0x47350d){this[_0xc8f4('0x5')]('crudPermissions',_0x47350d?_0x47350d[_0xc8f4('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc8f4('0x7'))['split'](''):[];}}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x3faf89,_0x446ad5){var _0x2019ae=function(_0x56dade){while(--_0x56dade){_0x3faf89['push'](_0x3faf89['shift']());}};_0x2019ae(++_0x446ad5);}(_0xe820,0xd2));var _0x0e82=function(_0xc7c68f,_0x24d42c){_0xc7c68f=_0xc7c68f-0x0;var _0x5ab124=_0xe820[_0xc7c68f];return _0x5ab124;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0e82('0x1')],'set':function(_0x59b28d){this[_0x0e82('0x3')]('crudPermissions',_0x59b28d?_0x59b28d[_0x0e82('0x4')](''):[]);},'get':function(){return this[_0x0e82('0x5')](_0x0e82('0x6'))?this[_0x0e82('0x5')](_0x0e82('0x6'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 526124b..9266102 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 _0x51a2=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','find','body','describe','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x4146b8,_0x5b5791){var _0x3cb4c7=function(_0x5cb830){while(--_0x5cb830){_0x4146b8['push'](_0x4146b8['shift']());}};_0x3cb4c7(++_0x5b5791);}(_0x51a2,0x10e));var _0x251a=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x51a2[_0x503ffd];return _0x160437;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x251a('0x0'));var rp=require(_0x251a('0x1'));var moment=require(_0x251a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x251a('0x3'));var util=require(_0x251a('0x4'));var path=require(_0x251a('0x5'));var sox=require(_0x251a('0x6'));var csv=require(_0x251a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x251a('0x8'));var _=require(_0x251a('0x9'));var squel=require(_0x251a('0xa'));var crypto=require(_0x251a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x251a('0xc'));var toCsv=require(_0x251a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x251a('0xd'));var authService=require(_0x251a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x251a('0xf'));var logger=require(_0x251a('0x10'))(_0x251a('0x11'));var utils=require(_0x251a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x251a('0x13'));var db=require(_0x251a('0x14'))['db'];function respondWithStatusCode(_0x27ab41,_0x2181c0){_0x2181c0=_0x2181c0||0xcc;return function(_0x4f48c7){if(_0x4f48c7){return _0x27ab41[_0x251a('0x15')](_0x2181c0);}return _0x27ab41[_0x251a('0x16')](_0x2181c0)[_0x251a('0x17')]();};}function respondWithResult(_0x54e246,_0x5bd4ba){_0x5bd4ba=_0x5bd4ba||0xc8;return function(_0x10ecd7){if(_0x10ecd7){return _0x54e246[_0x251a('0x16')](_0x5bd4ba)['json'](_0x10ecd7);}};}function respondWithFilteredResult(_0x308ce6,_0x190fa3){return function(_0x190fcc){if(_0x190fcc){var _0x2aac3e=typeof _0x190fa3[_0x251a('0x18')]===_0x251a('0x19')&&typeof _0x190fa3[_0x251a('0x1a')]===_0x251a('0x19');var _0x54f895=_0x190fcc[_0x251a('0x1b')];var _0x258d6f=_0x2aac3e?0x0:_0x190fa3['offset'];var _0x5450a3=_0x2aac3e?_0x190fcc[_0x251a('0x1b')]:_0x190fa3['offset']+_0x190fa3[_0x251a('0x1a')];var _0x46900d;if(_0x5450a3>=_0x54f895){_0x5450a3=_0x54f895;_0x46900d=0xc8;}else{_0x46900d=0xce;}_0x308ce6[_0x251a('0x16')](_0x46900d);return _0x308ce6[_0x251a('0x1c')]('Content-Range',_0x258d6f+'-'+_0x5450a3+'/'+_0x54f895)[_0x251a('0x1d')](_0x190fcc);}return null;};}function patchUpdates(_0x26332c){return function(_0xc92e9e){try{jsonpatch[_0x251a('0x1e')](_0xc92e9e,_0x26332c,!![]);}catch(_0x43f151){return BPromise[_0x251a('0x1f')](_0x43f151);}return _0xc92e9e[_0x251a('0x20')]();};}function saveUpdates(_0x4658fa,_0x47000b){return function(_0x2dddaa){if(_0x2dddaa){return _0x2dddaa[_0x251a('0x21')](_0x4658fa)[_0x251a('0x22')](function(_0x2f78f7){return _0x2f78f7;});}return null;};}function removeEntity(_0x4e2faf,_0x494f4d){return function(_0x170b24){if(_0x170b24){return _0x170b24[_0x251a('0x23')]()['then'](function(){_0x4e2faf[_0x251a('0x16')](0xcc)[_0x251a('0x17')]();});}};}function handleEntityNotFound(_0x3d1ed6,_0x532d74){return function(_0x42fffc){if(!_0x42fffc){_0x3d1ed6['sendStatus'](0x194);}return _0x42fffc;};}function handleError(_0x20f847,_0x1ce289){_0x1ce289=_0x1ce289||0x1f4;return function(_0x32af6b){logger['error'](_0x32af6b[_0x251a('0x24')]);if(_0x32af6b[_0x251a('0x25')]){delete _0x32af6b[_0x251a('0x25')];}_0x20f847[_0x251a('0x16')](_0x1ce289)['send'](_0x32af6b);};}exports[_0x251a('0x26')]=function(_0x5a3df4,_0x2de75b){var _0x3b1890={},_0x58a321={},_0x45ecda={'count':0x0,'rows':[]};var _0x17963d=_[_0x251a('0x27')](db[_0x251a('0x28')][_0x251a('0x29')],function(_0x56e4fb){return{'name':_0x56e4fb[_0x251a('0x2a')],'type':_0x56e4fb[_0x251a('0x2b')][_0x251a('0x2c')]};});_0x58a321[_0x251a('0x2d')]=_[_0x251a('0x27')](_0x17963d,'name');_0x58a321[_0x251a('0x2e')]=_[_0x251a('0x2f')](_0x5a3df4[_0x251a('0x2e')]);_0x58a321[_0x251a('0x30')]=_['intersection'](_0x58a321['model'],_0x58a321['query']);_0x3b1890[_0x251a('0x31')]=_[_0x251a('0x32')](_0x58a321[_0x251a('0x2d')],qs[_0x251a('0x33')](_0x5a3df4[_0x251a('0x2e')][_0x251a('0x33')]));_0x3b1890['attributes']=_0x3b1890[_0x251a('0x31')]['length']?_0x3b1890[_0x251a('0x31')]:_0x58a321[_0x251a('0x2d')];if(!_0x5a3df4[_0x251a('0x2e')][_0x251a('0x34')](_0x251a('0x35'))){_0x3b1890[_0x251a('0x1a')]=qs[_0x251a('0x1a')](_0x5a3df4[_0x251a('0x2e')][_0x251a('0x1a')]);_0x3b1890[_0x251a('0x18')]=qs[_0x251a('0x18')](_0x5a3df4['query']['offset']);}_0x3b1890[_0x251a('0x36')]=qs[_0x251a('0x37')](_0x5a3df4[_0x251a('0x2e')]['sort']);_0x3b1890[_0x251a('0x38')]=qs[_0x251a('0x30')](_[_0x251a('0x39')](_0x5a3df4[_0x251a('0x2e')],_0x58a321[_0x251a('0x30')]),_0x17963d);if(_0x5a3df4[_0x251a('0x2e')][_0x251a('0x3a')]){_0x3b1890[_0x251a('0x38')]=_[_0x251a('0x3b')](_0x3b1890['where'],{'$or':_[_0x251a('0x27')](_0x17963d,function(_0x53c2d2){if(_0x53c2d2[_0x251a('0x2b')]!==_0x251a('0x3c')){var _0x4f630c={};_0x4f630c[_0x53c2d2[_0x251a('0x25')]]={'$like':'%'+_0x5a3df4[_0x251a('0x2e')][_0x251a('0x3a')]+'%'};return _0x4f630c;}})});}_0x3b1890=_[_0x251a('0x3b')]({},_0x3b1890,_0x5a3df4[_0x251a('0x3d')]);var _0x18c827={'where':_0x3b1890['where']};return db[_0x251a('0x28')]['count'](_0x18c827)[_0x251a('0x22')](function(_0x3e39cb){_0x45ecda[_0x251a('0x1b')]=_0x3e39cb;if(_0x5a3df4[_0x251a('0x2e')][_0x251a('0x3e')]){_0x3b1890['include']=[{'all':!![]}];}return db[_0x251a('0x28')][_0x251a('0x3f')](_0x3b1890);})['then'](function(_0x454f8c){_0x45ecda[_0x251a('0x40')]=_0x454f8c;return _0x45ecda;})['then'](respondWithFilteredResult(_0x2de75b,_0x3b1890))[_0x251a('0x41')](handleError(_0x2de75b,null));};exports[_0x251a('0x42')]=function(_0x14b4fa,_0x599bfa){var _0x4fdbc6={'raw':![],'where':{'id':_0x14b4fa[_0x251a('0x43')]['id']}},_0x27809c={};_0x27809c['model']=_[_0x251a('0x2f')](db['UserProfileSection'][_0x251a('0x29')]);_0x27809c[_0x251a('0x2e')]=_['keys'](_0x14b4fa['query']);_0x27809c[_0x251a('0x30')]=_[_0x251a('0x32')](_0x27809c[_0x251a('0x2d')],_0x27809c['query']);_0x4fdbc6['attributes']=_[_0x251a('0x32')](_0x27809c[_0x251a('0x2d')],qs['fields'](_0x14b4fa[_0x251a('0x2e')][_0x251a('0x33')]));_0x4fdbc6[_0x251a('0x31')]=_0x4fdbc6[_0x251a('0x31')][_0x251a('0x44')]?_0x4fdbc6['attributes']:_0x27809c['model'];if(_0x14b4fa[_0x251a('0x2e')]['includeAll']){_0x4fdbc6['include']=[{'all':!![]}];}_0x4fdbc6=_[_0x251a('0x3b')]({},_0x4fdbc6,_0x14b4fa[_0x251a('0x3d')]);return db[_0x251a('0x28')][_0x251a('0x45')](_0x4fdbc6)[_0x251a('0x22')](handleEntityNotFound(_0x599bfa,null))[_0x251a('0x22')](respondWithResult(_0x599bfa,null))['catch'](handleError(_0x599bfa,null));};exports['create']=function(_0x3a256c,_0x406a5c){return db['UserProfileSection']['create'](_0x3a256c[_0x251a('0x46')],{})[_0x251a('0x22')](respondWithResult(_0x406a5c,0xc9))[_0x251a('0x41')](handleError(_0x406a5c,null));};exports['update']=function(_0x39e2c0,_0x451248){if(_0x39e2c0[_0x251a('0x46')]['id']){delete _0x39e2c0['body']['id'];}return db['UserProfileSection'][_0x251a('0x45')]({'where':{'id':_0x39e2c0['params']['id']}})[_0x251a('0x22')](handleEntityNotFound(_0x451248,null))[_0x251a('0x22')](saveUpdates(_0x39e2c0['body'],null))[_0x251a('0x22')](respondWithResult(_0x451248,null))[_0x251a('0x41')](handleError(_0x451248,null));};exports['destroy']=function(_0x20c17b,_0x2ac1da){return db[_0x251a('0x28')][_0x251a('0x45')]({'where':{'id':_0x20c17b[_0x251a('0x43')]['id']}})[_0x251a('0x22')](handleEntityNotFound(_0x2ac1da,null))[_0x251a('0x22')](removeEntity(_0x2ac1da,null))[_0x251a('0x41')](handleError(_0x2ac1da,null));};exports[_0x251a('0x47')]=function(_0x4b9662,_0x2b2598){return db[_0x251a('0x28')][_0x251a('0x47')]()[_0x251a('0x22')](respondWithResult(_0x2b2598,null))[_0x251a('0x41')](handleError(_0x2b2598,null));}; \ No newline at end of file +var _0x7abf=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','UserProfileSection','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key'];(function(_0x39236f,_0x33f3e1){var _0x563852=function(_0x171127){while(--_0x171127){_0x39236f['push'](_0x39236f['shift']());}};_0x563852(++_0x33f3e1);}(_0x7abf,0xc1));var _0xf7ab=function(_0x244aa4,_0x251b1d){_0x244aa4=_0x244aa4-0x0;var _0x463d24=_0x7abf[_0x244aa4];return _0x463d24;};'use strict';var emlformat=require(_0xf7ab('0x0'));var rimraf=require(_0xf7ab('0x1'));var zipdir=require(_0xf7ab('0x2'));var jsonpatch=require(_0xf7ab('0x3'));var rp=require(_0xf7ab('0x4'));var moment=require(_0xf7ab('0x5'));var BPromise=require(_0xf7ab('0x6'));var Mustache=require('mustache');var util=require(_0xf7ab('0x7'));var path=require(_0xf7ab('0x8'));var sox=require(_0xf7ab('0x9'));var csv=require(_0xf7ab('0xa'));var ejs=require(_0xf7ab('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7ab('0xc'));var squel=require(_0xf7ab('0xd'));var crypto=require(_0xf7ab('0xe'));var jsforce=require(_0xf7ab('0xf'));var deskjs=require(_0xf7ab('0x10'));var toCsv=require(_0xf7ab('0xa'));var querystring=require(_0xf7ab('0x11'));var Papa=require(_0xf7ab('0x12'));var Redis=require(_0xf7ab('0x13'));var authService=require(_0xf7ab('0x14'));var qs=require(_0xf7ab('0x15'));var as=require(_0xf7ab('0x16'));var hardwareService=require(_0xf7ab('0x17'));var logger=require(_0xf7ab('0x18'))('api');var utils=require(_0xf7ab('0x19'));var config=require(_0xf7ab('0x1a'));var licenseUtil=require(_0xf7ab('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ea786,_0x4f6d41){_0x4f6d41=_0x4f6d41||0xcc;return function(_0x4dfbb2){if(_0x4dfbb2){return _0x3ea786[_0xf7ab('0x1c')](_0x4f6d41);}return _0x3ea786[_0xf7ab('0x1d')](_0x4f6d41)[_0xf7ab('0x1e')]();};}function respondWithResult(_0x5d02d0,_0x3b0110){_0x3b0110=_0x3b0110||0xc8;return function(_0x1db713){if(_0x1db713){return _0x5d02d0['status'](_0x3b0110)[_0xf7ab('0x1f')](_0x1db713);}};}function respondWithFilteredResult(_0x296267,_0x145490){return function(_0xd834e4){if(_0xd834e4){var _0x1cff10=typeof _0x145490['offset']==='undefined'&&typeof _0x145490[_0xf7ab('0x20')]==='undefined';var _0x5bef48=_0xd834e4[_0xf7ab('0x21')];var _0x211696=_0x1cff10?0x0:_0x145490[_0xf7ab('0x22')];var _0xa90294=_0x1cff10?_0xd834e4[_0xf7ab('0x21')]:_0x145490[_0xf7ab('0x22')]+_0x145490['limit'];var _0x1920e3;if(_0xa90294>=_0x5bef48){_0xa90294=_0x5bef48;_0x1920e3=0xc8;}else{_0x1920e3=0xce;}_0x296267[_0xf7ab('0x1d')](_0x1920e3);return _0x296267[_0xf7ab('0x23')](_0xf7ab('0x24'),_0x211696+'-'+_0xa90294+'/'+_0x5bef48)[_0xf7ab('0x1f')](_0xd834e4);}return null;};}function patchUpdates(_0x26a0be){return function(_0x87e417){try{jsonpatch['apply'](_0x87e417,_0x26a0be,!![]);}catch(_0x212b87){return BPromise[_0xf7ab('0x25')](_0x212b87);}return _0x87e417[_0xf7ab('0x26')]();};}function saveUpdates(_0xcbe622,_0x14d7ed){return function(_0x5862ce){if(_0x5862ce){return _0x5862ce[_0xf7ab('0x27')](_0xcbe622)[_0xf7ab('0x28')](function(_0x3a05fd){return _0x3a05fd;});}return null;};}function removeEntity(_0x301618,_0x18ec78){return function(_0x410f23){if(_0x410f23){return _0x410f23[_0xf7ab('0x29')]()[_0xf7ab('0x28')](function(){_0x301618[_0xf7ab('0x1d')](0xcc)[_0xf7ab('0x1e')]();});}};}function handleEntityNotFound(_0x3ba55e,_0x14d3e7){return function(_0x4a3c9c){if(!_0x4a3c9c){_0x3ba55e[_0xf7ab('0x1c')](0x194);}return _0x4a3c9c;};}function handleError(_0x2e6b9b,_0x3885e6){_0x3885e6=_0x3885e6||0x1f4;return function(_0x291b8e){logger[_0xf7ab('0x2a')](_0x291b8e[_0xf7ab('0x2b')]);if(_0x291b8e[_0xf7ab('0x2c')]){delete _0x291b8e['name'];}_0x2e6b9b[_0xf7ab('0x1d')](_0x3885e6)[_0xf7ab('0x2d')](_0x291b8e);};}exports[_0xf7ab('0x2e')]=function(_0x48a3ca,_0x147523){var _0x38b42b={},_0x422f21={},_0x43a34f={'count':0x0,'rows':[]};var _0x2245a6=_[_0xf7ab('0x2f')](db['UserProfileSection']['rawAttributes'],function(_0xc9ffa3){return{'name':_0xc9ffa3[_0xf7ab('0x30')],'type':_0xc9ffa3['type'][_0xf7ab('0x31')]};});_0x422f21[_0xf7ab('0x32')]=_['map'](_0x2245a6,_0xf7ab('0x2c'));_0x422f21['query']=_[_0xf7ab('0x33')](_0x48a3ca['query']);_0x422f21[_0xf7ab('0x34')]=_[_0xf7ab('0x35')](_0x422f21['model'],_0x422f21[_0xf7ab('0x36')]);_0x38b42b[_0xf7ab('0x37')]=_[_0xf7ab('0x35')](_0x422f21[_0xf7ab('0x32')],qs[_0xf7ab('0x38')](_0x48a3ca['query'][_0xf7ab('0x38')]));_0x38b42b[_0xf7ab('0x37')]=_0x38b42b[_0xf7ab('0x37')][_0xf7ab('0x39')]?_0x38b42b['attributes']:_0x422f21['model'];if(!_0x48a3ca[_0xf7ab('0x36')][_0xf7ab('0x3a')](_0xf7ab('0x3b'))){_0x38b42b['limit']=qs[_0xf7ab('0x20')](_0x48a3ca[_0xf7ab('0x36')]['limit']);_0x38b42b['offset']=qs['offset'](_0x48a3ca[_0xf7ab('0x36')][_0xf7ab('0x22')]);}_0x38b42b[_0xf7ab('0x3c')]=qs[_0xf7ab('0x3d')](_0x48a3ca[_0xf7ab('0x36')]['sort']);_0x38b42b[_0xf7ab('0x3e')]=qs['filters'](_[_0xf7ab('0x3f')](_0x48a3ca[_0xf7ab('0x36')],_0x422f21[_0xf7ab('0x34')]),_0x2245a6);if(_0x48a3ca[_0xf7ab('0x36')][_0xf7ab('0x40')]){_0x38b42b[_0xf7ab('0x3e')]=_[_0xf7ab('0x41')](_0x38b42b['where'],{'$or':_[_0xf7ab('0x2f')](_0x2245a6,function(_0x4e7002){if(_0x4e7002[_0xf7ab('0x42')]!==_0xf7ab('0x43')){var _0x188a79={};_0x188a79[_0x4e7002[_0xf7ab('0x2c')]]={'$like':'%'+_0x48a3ca[_0xf7ab('0x36')][_0xf7ab('0x40')]+'%'};return _0x188a79;}})});}_0x38b42b=_[_0xf7ab('0x41')]({},_0x38b42b,_0x48a3ca[_0xf7ab('0x44')]);var _0x49f97f={'where':_0x38b42b['where']};return db[_0xf7ab('0x45')][_0xf7ab('0x21')](_0x49f97f)[_0xf7ab('0x28')](function(_0x5b122f){_0x43a34f[_0xf7ab('0x21')]=_0x5b122f;if(_0x48a3ca[_0xf7ab('0x36')][_0xf7ab('0x46')]){_0x38b42b[_0xf7ab('0x47')]=[{'all':!![]}];}return db[_0xf7ab('0x45')]['findAll'](_0x38b42b);})[_0xf7ab('0x28')](function(_0x593202){_0x43a34f[_0xf7ab('0x48')]=_0x593202;return _0x43a34f;})[_0xf7ab('0x28')](respondWithFilteredResult(_0x147523,_0x38b42b))[_0xf7ab('0x49')](handleError(_0x147523,null));};exports[_0xf7ab('0x4a')]=function(_0x2d2d00,_0x272a49){var _0x2256ca={'raw':![],'where':{'id':_0x2d2d00[_0xf7ab('0x4b')]['id']}},_0x5a1cae={};_0x5a1cae['model']=_[_0xf7ab('0x33')](db[_0xf7ab('0x45')][_0xf7ab('0x4c')]);_0x5a1cae['query']=_['keys'](_0x2d2d00[_0xf7ab('0x36')]);_0x5a1cae[_0xf7ab('0x34')]=_['intersection'](_0x5a1cae['model'],_0x5a1cae[_0xf7ab('0x36')]);_0x2256ca[_0xf7ab('0x37')]=_['intersection'](_0x5a1cae[_0xf7ab('0x32')],qs[_0xf7ab('0x38')](_0x2d2d00[_0xf7ab('0x36')][_0xf7ab('0x38')]));_0x2256ca['attributes']=_0x2256ca[_0xf7ab('0x37')][_0xf7ab('0x39')]?_0x2256ca['attributes']:_0x5a1cae[_0xf7ab('0x32')];if(_0x2d2d00['query'][_0xf7ab('0x46')]){_0x2256ca[_0xf7ab('0x47')]=[{'all':!![]}];}_0x2256ca=_[_0xf7ab('0x41')]({},_0x2256ca,_0x2d2d00[_0xf7ab('0x44')]);return db[_0xf7ab('0x45')][_0xf7ab('0x4d')](_0x2256ca)[_0xf7ab('0x28')](handleEntityNotFound(_0x272a49,null))[_0xf7ab('0x28')](respondWithResult(_0x272a49,null))[_0xf7ab('0x49')](handleError(_0x272a49,null));};exports['create']=function(_0x2f1b83,_0x420619){return db[_0xf7ab('0x45')][_0xf7ab('0x4e')](_0x2f1b83[_0xf7ab('0x4f')],{})[_0xf7ab('0x28')](respondWithResult(_0x420619,0xc9))[_0xf7ab('0x49')](handleError(_0x420619,null));};exports[_0xf7ab('0x27')]=function(_0x1eaba6,_0x974721){if(_0x1eaba6['body']['id']){delete _0x1eaba6[_0xf7ab('0x4f')]['id'];}return db[_0xf7ab('0x45')][_0xf7ab('0x4d')]({'where':{'id':_0x1eaba6[_0xf7ab('0x4b')]['id']}})['then'](handleEntityNotFound(_0x974721,null))[_0xf7ab('0x28')](saveUpdates(_0x1eaba6[_0xf7ab('0x4f')],null))[_0xf7ab('0x28')](respondWithResult(_0x974721,null))[_0xf7ab('0x49')](handleError(_0x974721,null));};exports['destroy']=function(_0x252cac,_0x44ac98){return db[_0xf7ab('0x45')]['find']({'where':{'id':_0x252cac[_0xf7ab('0x4b')]['id']}})[_0xf7ab('0x28')](handleEntityNotFound(_0x44ac98,null))['then'](removeEntity(_0x44ac98,null))[_0xf7ab('0x49')](handleError(_0x44ac98,null));};exports['describe']=function(_0xab5d8b,_0x1f9828){return db[_0xf7ab('0x45')][_0xf7ab('0x50')]()[_0xf7ab('0x28')](respondWithResult(_0x1f9828,null))[_0xf7ab('0x49')](handleError(_0x1f9828,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c79bb1e..b7c92fd 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 _0x3f5a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x99fec0,_0x422d3b){var _0x291fa8=function(_0x3150d1){while(--_0x3150d1){_0x99fec0['push'](_0x99fec0['shift']());}};_0x291fa8(++_0x422d3b);}(_0x3f5a,0x9e));var _0xa3f5=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0x3f5a[_0x5dc03e];return _0x466a07;};'use strict';var _=require(_0xa3f5('0x0'));var util=require(_0xa3f5('0x1'));var logger=require(_0xa3f5('0x2'))('api');var moment=require(_0xa3f5('0x3'));var BPromise=require(_0xa3f5('0x4'));var rp=require(_0xa3f5('0x5'));var fs=require('fs');var path=require(_0xa3f5('0x6'));var rimraf=require(_0xa3f5('0x7'));var config=require(_0xa3f5('0x8'));var attributes=require(_0xa3f5('0x9'));module[_0xa3f5('0xa')]=function(_0xb6bfd3,_0x174145){return _0xb6bfd3['define'](_0xa3f5('0xb'),attributes,{'tableName':_0xa3f5('0xc'),'paranoid':![],'indexes':[{'name':_0xa3f5('0xd'),'fields':[_0xa3f5('0xe'),_0xa3f5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7041=['request-promise','path','define','UserProfileSection','userProfileId','lodash','../../config/logger','api','bluebird'];(function(_0x10dfb3,_0x3da2d4){var _0x27834e=function(_0x31acdd){while(--_0x31acdd){_0x10dfb3['push'](_0x10dfb3['shift']());}};_0x27834e(++_0x3da2d4);}(_0x7041,0xdd));var _0x1704=function(_0x8cef0a,_0x2af041){_0x8cef0a=_0x8cef0a-0x0;var _0x68bc05=_0x7041[_0x8cef0a];return _0x68bc05;};'use strict';var _=require(_0x1704('0x0'));var util=require('util');var logger=require(_0x1704('0x1'))(_0x1704('0x2'));var moment=require('moment');var BPromise=require(_0x1704('0x3'));var rp=require(_0x1704('0x4'));var fs=require('fs');var path=require(_0x1704('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0xf09891,_0x748012){return _0xf09891[_0x1704('0x6')](_0x1704('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x1704('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 507118e..751c866 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 _0xa9c8=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa9c8,0x1ea));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a9c('0x0'));var BPromise=require('bluebird');var rs=require(_0x8a9c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a9c('0x2'));var logger=require(_0x8a9c('0x3'))(_0x8a9c('0x4'));var config=require(_0x8a9c('0x5'));var jayson=require(_0x8a9c('0x6'));var client=jayson[_0x8a9c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x689686,_0x4647b3,_0x496763){return new BPromise(function(_0x2f641e,_0x1a1d70){return client[_0x8a9c('0x8')](_0x689686,_0x496763)[_0x8a9c('0x9')](function(_0x2dfd3f){logger[_0x8a9c('0xa')](_0x8a9c('0xb'),_0x4647b3,_0x8a9c('0xc'));logger[_0x8a9c('0xd')](_0x8a9c('0xe'),_0x4647b3,_0x8a9c('0xc'),JSON[_0x8a9c('0xf')](_0x2dfd3f));if(_0x2dfd3f[_0x8a9c('0x10')]){if(_0x2dfd3f[_0x8a9c('0x10')][_0x8a9c('0x11')]===0x1f4){logger[_0x8a9c('0x10')](_0x8a9c('0xb'),_0x4647b3,_0x2dfd3f['error'][_0x8a9c('0x12')]);return _0x1a1d70(_0x2dfd3f['error'][_0x8a9c('0x12')]);}logger[_0x8a9c('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x4647b3,_0x2dfd3f[_0x8a9c('0x10')][_0x8a9c('0x12')]);return _0x2f641e(_0x2dfd3f['error'][_0x8a9c('0x12')]);}else{logger[_0x8a9c('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x4647b3,_0x8a9c('0xc'));_0x2f641e(_0x2dfd3f[_0x8a9c('0x13')][_0x8a9c('0x12')]);}})[_0x8a9c('0x14')](function(_0x3c5da8){logger[_0x8a9c('0x10')](_0x8a9c('0xb'),_0x4647b3,_0x3c5da8);_0x1a1d70(_0x3c5da8);});});} \ No newline at end of file +var _0x315b=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x49b5ea,_0x445ff9){var _0x4280bd=function(_0xf37bbe){while(--_0xf37bbe){_0x49b5ea['push'](_0x49b5ea['shift']());}};_0x4280bd(++_0x445ff9);}(_0x315b,0xae));var _0xb315=function(_0x46c524,_0x13490b){_0x46c524=_0x46c524-0x0;var _0x3e8987=_0x315b[_0x46c524];return _0x3e8987;};'use strict';var _=require(_0xb315('0x0'));var util=require(_0xb315('0x1'));var moment=require(_0xb315('0x2'));var BPromise=require(_0xb315('0x3'));var rs=require(_0xb315('0x4'));var fs=require('fs');var Redis=require(_0xb315('0x5'));var db=require(_0xb315('0x6'))['db'];var utils=require(_0xb315('0x7'));var logger=require(_0xb315('0x8'))(_0xb315('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb315('0xa')][_0xb315('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x228a9d,_0x4e6deb,_0x265773){return new BPromise(function(_0x3e3c54,_0x1d3671){return client[_0xb315('0xc')](_0x228a9d,_0x265773)[_0xb315('0xd')](function(_0x2002c6){logger['info'](_0xb315('0xe'),_0x4e6deb,'request\x20sent');logger[_0xb315('0xf')](_0xb315('0x10'),_0x4e6deb,_0xb315('0x11'),JSON[_0xb315('0x12')](_0x2002c6));if(_0x2002c6['error']){if(_0x2002c6[_0xb315('0x13')][_0xb315('0x14')]===0x1f4){logger[_0xb315('0x13')](_0xb315('0xe'),_0x4e6deb,_0x2002c6[_0xb315('0x13')][_0xb315('0x15')]);return _0x1d3671(_0x2002c6[_0xb315('0x13')]['message']);}logger[_0xb315('0x13')](_0xb315('0xe'),_0x4e6deb,_0x2002c6[_0xb315('0x13')][_0xb315('0x15')]);return _0x3e3c54(_0x2002c6[_0xb315('0x13')][_0xb315('0x15')]);}else{logger[_0xb315('0x16')](_0xb315('0xe'),_0x4e6deb,'request\x20sent');_0x3e3c54(_0x2002c6['result'][_0xb315('0x15')]);}})[_0xb315('0x17')](function(_0x85f553){logger[_0xb315('0x13')](_0xb315('0xe'),_0x4e6deb,_0x85f553);_0x1d3671(_0x85f553);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 14305f7..37684c2 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3271db,_0x3444a2){var _0x108034=function(_0x46884a){while(--_0x46884a){_0x3271db['push'](_0x3271db['shift']());}};_0x108034(++_0x3444a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xa339a9,_0x342371){var _0x125a36=function(_0x5d8c68){while(--_0x5d8c68){_0xa339a9['push'](_0xa339a9['shift']());}};_0x125a36(++_0x342371);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d4e0adc..3636f58 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 _0xcb8b=['INTEGER','exports'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0xcb8b,0xc7));var _0xbcb8=function(_0x4e2d94,_0x59629d){_0x4e2d94=_0x4e2d94-0x0;var _0x26680e=_0xcb8b[_0x4e2d94];return _0x26680e;};'use strict';var Sequelize=require('sequelize');module[_0xbcb8('0x0')]={'penalty':{'type':Sequelize[_0xbcb8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7f3f=['sequelize','exports'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0x7f3f[_0x5067db];return _0x2771e4;};'use strict';var Sequelize=require(_0xf7f3('0x0'));module[_0xf7f3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 791dc23..35e66e3 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 _0x0af5=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa8eabc,_0x1a2b93){var _0xc6c1d1=function(_0x23fe30){while(--_0x23fe30){_0xa8eabc['push'](_0xa8eabc['shift']());}};_0xc6c1d1(++_0x1a2b93);}(_0x0af5,0x158));var _0x50af=function(_0x32e2e8,_0x12d243){_0x32e2e8=_0x32e2e8-0x0;var _0x376655=_0x0af5[_0x32e2e8];return _0x376655;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));module[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return _0xe37b1['define'](_0x50af('0xb'),attributes,{'tableName':_0x50af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee3c=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0xee3c,0x14a));var _0xcee3=function(_0x4e5a7d,_0xd16cbd){_0x4e5a7d=_0x4e5a7d-0x0;var _0x2953f8=_0xee3c[_0x4e5a7d];return _0x2953f8;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var logger=require(_0xcee3('0x2'))(_0xcee3('0x3'));var moment=require(_0xcee3('0x4'));var BPromise=require(_0xcee3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcee3('0x6'));var config=require(_0xcee3('0x7'));var attributes=require(_0xcee3('0x8'));module[_0xcee3('0x9')]=function(_0x9350f3,_0x44e46f){return _0x9350f3[_0xcee3('0xa')](_0xcee3('0xb'),attributes,{'tableName':_0xcee3('0xc'),'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 ac47135..77415cd 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 _0x5c8e=['../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x5c8e,0x150));var _0xe5c8=function(_0x5e90e3,_0x1b8e13){_0x5e90e3=_0x5e90e3-0x0;var _0x33c036=_0x5c8e[_0x5e90e3];return _0x33c036;};'use strict';var _=require(_0xe5c8('0x0'));var util=require(_0xe5c8('0x1'));var moment=require(_0xe5c8('0x2'));var BPromise=require(_0xe5c8('0x3'));var rs=require(_0xe5c8('0x4'));var fs=require('fs');var Redis=require(_0xe5c8('0x5'));var db=require(_0xe5c8('0x6'))['db'];var utils=require(_0xe5c8('0x7'));var logger=require(_0xe5c8('0x8'))('rpc');var config=require(_0xe5c8('0x9'));var jayson=require(_0xe5c8('0xa'));var client=jayson[_0xe5c8('0xb')][_0xe5c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11d4d2,_0x1fc488,_0x4e9b03){return new BPromise(function(_0x17d940,_0x50d525){return client[_0xe5c8('0xd')](_0x11d4d2,_0x4e9b03)['then'](function(_0x524d45){logger['info'](_0xe5c8('0xe'),_0x1fc488,_0xe5c8('0xf'));logger[_0xe5c8('0x10')](_0xe5c8('0x11'),_0x1fc488,_0xe5c8('0xf'),JSON[_0xe5c8('0x12')](_0x524d45));if(_0x524d45['error']){if(_0x524d45[_0xe5c8('0x13')]['code']===0x1f4){logger[_0xe5c8('0x13')](_0xe5c8('0xe'),_0x1fc488,_0x524d45[_0xe5c8('0x13')][_0xe5c8('0x14')]);return _0x50d525(_0x524d45[_0xe5c8('0x13')][_0xe5c8('0x14')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1fc488,_0x524d45[_0xe5c8('0x13')][_0xe5c8('0x14')]);return _0x17d940(_0x524d45[_0xe5c8('0x13')][_0xe5c8('0x14')]);}else{logger[_0xe5c8('0x15')](_0xe5c8('0xe'),_0x1fc488,_0xe5c8('0xf'));_0x17d940(_0x524d45[_0xe5c8('0x16')][_0xe5c8('0x14')]);}})['catch'](function(_0x269a8b){logger[_0xe5c8('0x13')](_0xe5c8('0xe'),_0x1fc488,_0x269a8b);_0x50d525(_0x269a8b);});});} \ No newline at end of file +var _0x4860=['message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','UserSmsQueue,\x20%s,\x20%s'];(function(_0x31c26c,_0x5ba82a){var _0x2bf4ca=function(_0x193915){while(--_0x193915){_0x31c26c['push'](_0x31c26c['shift']());}};_0x2bf4ca(++_0x5ba82a);}(_0x4860,0xb2));var _0x0486=function(_0xa74051,_0x5b8f0a){_0xa74051=_0xa74051-0x0;var _0x133ca0=_0x4860[_0xa74051];return _0x133ca0;};'use strict';var _=require(_0x0486('0x0'));var util=require(_0x0486('0x1'));var moment=require(_0x0486('0x2'));var BPromise=require(_0x0486('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0486('0x4'))['db'];var utils=require(_0x0486('0x5'));var logger=require(_0x0486('0x6'))(_0x0486('0x7'));var config=require(_0x0486('0x8'));var jayson=require(_0x0486('0x9'));var client=jayson[_0x0486('0xa')][_0x0486('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23a516,_0x3a5f48,_0x275dbb){return new BPromise(function(_0x4295d5,_0x28d2d0){return client['request'](_0x23a516,_0x275dbb)[_0x0486('0xc')](function(_0x231d3e){logger[_0x0486('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x3a5f48,_0x0486('0xe'));logger[_0x0486('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3a5f48,_0x0486('0xe'),JSON[_0x0486('0x10')](_0x231d3e));if(_0x231d3e[_0x0486('0x11')]){if(_0x231d3e[_0x0486('0x11')][_0x0486('0x12')]===0x1f4){logger['error'](_0x0486('0x13'),_0x3a5f48,_0x231d3e[_0x0486('0x11')][_0x0486('0x14')]);return _0x28d2d0(_0x231d3e[_0x0486('0x11')][_0x0486('0x14')]);}logger['error'](_0x0486('0x13'),_0x3a5f48,_0x231d3e[_0x0486('0x11')]['message']);return _0x4295d5(_0x231d3e[_0x0486('0x11')]['message']);}else{logger[_0x0486('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x3a5f48,_0x0486('0xe'));_0x4295d5(_0x231d3e['result'][_0x0486('0x14')]);}})[_0x0486('0x15')](function(_0x34bada){logger[_0x0486('0x11')](_0x0486('0x13'),_0x3a5f48,_0x34bada);_0x28d2d0(_0x34bada);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2246854..1c7b422 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 _0xb332=['sequelize','exports','INTEGER'];(function(_0x3a242a,_0x2d1fae){var _0x4a7a94=function(_0x2e0920){while(--_0x2e0920){_0x3a242a['push'](_0x3a242a['shift']());}};_0x4a7a94(++_0x2d1fae);}(_0xb332,0xba));var _0x2b33=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xb332[_0x1b8f5a];return _0x594189;};'use strict';var Sequelize=require(_0x2b33('0x0'));module[_0x2b33('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x2b33('0x2')]}}; \ No newline at end of file +var _0x529c=['INTEGER','sequelize'];(function(_0x291275,_0x594d79){var _0x5b92c5=function(_0x59dd0c){while(--_0x59dd0c){_0x291275['push'](_0x291275['shift']());}};_0x5b92c5(++_0x594d79);}(_0x529c,0x12f));var _0xc529=function(_0x496a21,_0x45c7b4){_0x496a21=_0x496a21-0x0;var _0x18e8b6=_0x529c[_0x496a21];return _0x18e8b6;};'use strict';var Sequelize=require(_0xc529('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xc529('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xc529('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c6d4eb3..344e7ff 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(_0x4df414,_0x20768a){var _0x20567c=function(_0x2e41e3){while(--_0x2e41e3){_0x4df414['push'](_0x4df414['shift']());}};_0x20567c(++_0x20768a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2815e0,_0x30564b){var _0x488716=function(_0x1f392a){while(--_0x1f392a){_0x2815e0['push'](_0x2815e0['shift']());}};_0x488716(++_0x30564b);}(_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':'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 1a58ea7..aa1a925 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x53f48f,_0x3ca880){var _0x5dad85=function(_0x5b651b){while(--_0x5b651b){_0x53f48f['push'](_0x53f48f['shift']());}};_0x5dad85(++_0x3ca880);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x31ca93,_0x492be2){var _0x540e06=function(_0x32c0d4){while(--_0x32c0d4){_0x31ca93['push'](_0x31ca93['shift']());}};_0x540e06(++_0x492be2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0xcb91[_0x4eaa4c];return _0x15aec6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index eb240f2..7c24576 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 _0x6171=['sequelize','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6171,0x10e));var _0x1617=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x6171[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0x1617('0x0'));module[_0x1617('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x525d=['INTEGER','sequelize'];(function(_0x1523fc,_0x640841){var _0x4e15e8=function(_0x190958){while(--_0x190958){_0x1523fc['push'](_0x1523fc['shift']());}};_0x4e15e8(++_0x640841);}(_0x525d,0x77));var _0xd525=function(_0x360b32,_0x563700){_0x360b32=_0x360b32-0x0;var _0x365ec3=_0x525d[_0x360b32];return _0x365ec3;};'use strict';var Sequelize=require(_0xd525('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd525('0x1')],'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 b54eab1..a7ac574 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 _0xf637=['./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x9f4f76,_0x5d96da){var _0x5b2b0a=function(_0x539bbb){while(--_0x539bbb){_0x9f4f76['push'](_0x9f4f76['shift']());}};_0x5b2b0a(++_0x5d96da);}(_0xf637,0x179));var _0x7f63=function(_0x4fbd92,_0x4effc9){_0x4fbd92=_0x4fbd92-0x0;var _0x5071dd=_0xf637[_0x4fbd92];return _0x5071dd;};'use strict';var _=require(_0x7f63('0x0'));var util=require(_0x7f63('0x1'));var logger=require(_0x7f63('0x2'))(_0x7f63('0x3'));var moment=require(_0x7f63('0x4'));var BPromise=require('bluebird');var rp=require(_0x7f63('0x5'));var fs=require('fs');var path=require(_0x7f63('0x6'));var rimraf=require('rimraf');var config=require(_0x7f63('0x7'));var attributes=require(_0x7f63('0x8'));module['exports']=function(_0x277a3b,_0x256513){return _0x277a3b['define'](_0x7f63('0x9'),attributes,{'tableName':_0x7f63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebf9=['moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','api'];(function(_0x30ac04,_0x365f1b){var _0x56b497=function(_0x2e4724){while(--_0x2e4724){_0x30ac04['push'](_0x30ac04['shift']());}};_0x56b497(++_0x365f1b);}(_0xebf9,0x11e));var _0x9ebf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xebf9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9ebf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9ebf('0x1'));var moment=require(_0x9ebf('0x2'));var BPromise=require(_0x9ebf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ebf('0x4'));var rimraf=require(_0x9ebf('0x5'));var config=require(_0x9ebf('0x6'));var attributes=require(_0x9ebf('0x7'));module[_0x9ebf('0x8')]=function(_0x1b92b0,_0x477c0b){return _0x1b92b0[_0x9ebf('0x9')](_0x9ebf('0xa'),attributes,{'tableName':_0x9ebf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index a2254ea..e6169a6 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 _0x2f02=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2f02,0x17c));var _0x22f0=function(_0x36be38,_0x50b484){_0x36be38=_0x36be38-0x0;var _0x10a629=_0x2f02[_0x36be38];return _0x10a629;};'use strict';var _=require(_0x22f0('0x0'));var util=require(_0x22f0('0x1'));var moment=require(_0x22f0('0x2'));var BPromise=require(_0x22f0('0x3'));var rs=require(_0x22f0('0x4'));var fs=require('fs');var Redis=require(_0x22f0('0x5'));var db=require(_0x22f0('0x6'))['db'];var utils=require(_0x22f0('0x7'));var logger=require(_0x22f0('0x8'))(_0x22f0('0x9'));var config=require(_0x22f0('0xa'));var jayson=require(_0x22f0('0xb'));var client=jayson[_0x22f0('0xc')][_0x22f0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x7b2ad5,_0x1f9bc5,_0x456d9b){return new BPromise(function(_0x7c3691,_0x2c3e85){return client[_0x22f0('0xe')](_0x7b2ad5,_0x456d9b)['then'](function(_0x421f4b){logger[_0x22f0('0xf')](_0x22f0('0x10'),_0x1f9bc5,_0x22f0('0x11'));logger[_0x22f0('0x12')](_0x22f0('0x13'),_0x1f9bc5,_0x22f0('0x11'),JSON['stringify'](_0x421f4b));if(_0x421f4b[_0x22f0('0x14')]){if(_0x421f4b[_0x22f0('0x14')]['code']===0x1f4){logger[_0x22f0('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x1f9bc5,_0x421f4b[_0x22f0('0x14')][_0x22f0('0x15')]);return _0x2c3e85(_0x421f4b[_0x22f0('0x14')]['message']);}logger['error'](_0x22f0('0x10'),_0x1f9bc5,_0x421f4b['error']['message']);return _0x7c3691(_0x421f4b[_0x22f0('0x14')][_0x22f0('0x15')]);}else{logger[_0x22f0('0xf')](_0x22f0('0x10'),_0x1f9bc5,_0x22f0('0x11'));_0x7c3691(_0x421f4b[_0x22f0('0x16')][_0x22f0('0x15')]);}})[_0x22f0('0x17')](function(_0x58363d){logger[_0x22f0('0x14')](_0x22f0('0x10'),_0x1f9bc5,_0x58363d);_0x2c3e85(_0x58363d);});});} \ No newline at end of file +var _0xda3f=['../../config/environment','jayson/promise','client','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x2bf236,_0x1871fc){var _0x5bbf2b=function(_0x2983f4){while(--_0x2983f4){_0x2bf236['push'](_0x2bf236['shift']());}};_0x5bbf2b(++_0x1871fc);}(_0xda3f,0x18b));var _0xfda3=function(_0x329d11,_0x2469a5){_0x329d11=_0x329d11-0x0;var _0x50b549=_0xda3f[_0x329d11];return _0x50b549;};'use strict';var _=require(_0xfda3('0x0'));var util=require(_0xfda3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfda3('0x2'));var fs=require('fs');var Redis=require(_0xfda3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x4'))('rpc');var config=require(_0xfda3('0x5'));var jayson=require(_0xfda3('0x6'));var client=jayson[_0xfda3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40fdfb,_0x4c7a02,_0x1cb666){return new BPromise(function(_0x26594a,_0xa0e84){return client[_0xfda3('0x8')](_0x40fdfb,_0x1cb666)['then'](function(_0x23fac8){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x4c7a02,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x4c7a02,_0xfda3('0xb'),JSON[_0xfda3('0xe')](_0x23fac8));if(_0x23fac8[_0xfda3('0xf')]){if(_0x23fac8[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x4c7a02,_0x23fac8[_0xfda3('0xf')][_0xfda3('0x11')]);return _0xa0e84(_0x23fac8[_0xfda3('0xf')][_0xfda3('0x11')]);}logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x4c7a02,_0x23fac8['error'][_0xfda3('0x11')]);return _0x26594a(_0x23fac8[_0xfda3('0xf')][_0xfda3('0x11')]);}else{logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x4c7a02,_0xfda3('0xb'));_0x26594a(_0x23fac8[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0xa0d28a){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x4c7a02,_0xa0d28a);_0xa0e84(_0xa0d28a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c2aec18..02f0913 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1caed2,_0x4df276){var _0x34cd35=function(_0x4cb82e){while(--_0x4cb82e){_0x1caed2['push'](_0x1caed2['shift']());}};_0x34cd35(++_0x4df276);}(_0xe706,0xa3));var _0x6e70=function(_0x283952,_0x442596){_0x283952=_0x283952-0x0;var _0x57bb99=_0xe706[_0x283952];return _0x57bb99;};'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(_0x266d75,_0x4a737b){var _0x285f04=function(_0x5a5302){while(--_0x5a5302){_0x266d75['push'](_0x266d75['shift']());}};_0x285f04(++_0x4a737b);}(_0xe706,0xa3));var _0x6e70=function(_0x555552,_0x576279){_0x555552=_0x555552-0x0;var _0x5b280d=_0xe706[_0x555552];return _0x5b280d;};'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 e2dcb8b..8328753 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 _0x54be=['Required\x20by\x20Asterisk','INTEGER','STRING','queue_interface','sequelize','exports'];(function(_0x5e644f,_0x379b91){var _0x556ffc=function(_0x3a23f4){while(--_0x3a23f4){_0x5e644f['push'](_0x5e644f['shift']());}};_0x556ffc(++_0x379b91);}(_0x54be,0x1ba));var _0xe54b=function(_0x4007c1,_0x47f5c2){_0x4007c1=_0x4007c1-0x0;var _0x15bc7d=_0x54be[_0x4007c1];return _0x15bc7d;};'use strict';var Sequelize=require(_0xe54b('0x0'));module[_0xe54b('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xe54b('0x2')},'UserId':{'type':Sequelize[_0xe54b('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe54b('0x4')],'allowNull':![],'unique':_0xe54b('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xe54b('0x4')],'allowNull':![],'unique':_0xe54b('0x5'),'comment':_0xe54b('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xe54b('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xe54b('0x2')}}; \ No newline at end of file +var _0x9297=['sequelize','exports','INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk'];(function(_0x208c26,_0xd03b50){var _0x160b08=function(_0x43770d){while(--_0x43770d){_0x208c26['push'](_0x208c26['shift']());}};_0x160b08(++_0xd03b50);}(_0x9297,0x6c));var _0x7929=function(_0x817d15,_0x3da209){_0x817d15=_0x817d15-0x0;var _0x27c6f9=_0x9297[_0x817d15];return _0x27c6f9;};'use strict';var Sequelize=require(_0x7929('0x0'));module[_0x7929('0x1')]={'uniqueid':{'type':Sequelize[_0x7929('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x7929('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x7929('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7929('0x3')],'allowNull':![],'unique':_0x7929('0x4'),'comment':_0x7929('0x5')},'VoiceQueueId':{'type':Sequelize[_0x7929('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7929('0x4'),'comment':_0x7929('0x5')},'penalty':{'type':Sequelize[_0x7929('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x7929('0x2')](0xb),'defaultValue':0x0,'comment':_0x7929('0x5')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 7377758..77c9e43 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 _0x29ec=['hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove'];(function(_0x1f373a,_0x55c614){var _0x580cb4=function(_0x510d96){while(--_0x510d96){_0x1f373a['push'](_0x1f373a['shift']());}};_0x580cb4(++_0x55c614);}(_0x29ec,0xf7));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xc29e('0x0'))['db'][_0xc29e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc29e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc29e('0x3'),'afterDestroy':_0xc29e('0x4')};function emitEvent(_0x285777){return function(_0xd2c78,_0x50620a,_0x1b82db){UserVoiceQueueRtEvents['emit'](_0x285777+':'+_0xd2c78['id'],_0xd2c78);UserVoiceQueueRtEvents['emit'](_0x285777,_0xd2c78);_0x1b82db(null);};}for(var e in events){if(events[_0xc29e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xc29e('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xcede=['hasOwnProperty','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0xb960ae,_0x36233e){var _0x2e1f5f=function(_0x40667f){while(--_0x40667f){_0xb960ae['push'](_0xb960ae['shift']());}};_0x2e1f5f(++_0x36233e);}(_0xcede,0xec));var _0xeced=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xcede[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xeced('0x0'))['db'][_0xeced('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xeced('0x2')](0x0);var events={'afterCreate':_0xeced('0x3'),'afterUpdate':_0xeced('0x4'),'afterDestroy':_0xeced('0x5')};function emitEvent(_0x434bb7){return function(_0x520fd7,_0x2bce50,_0x39c4b1){UserVoiceQueueRtEvents[_0xeced('0x6')](_0x434bb7+':'+_0x520fd7['id'],_0x520fd7);UserVoiceQueueRtEvents[_0xeced('0x6')](_0x434bb7,_0x520fd7);_0x39c4b1(null);};}for(var e in events){if(events[_0xeced('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xeced('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 818e379..d285244 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 _0x8c07=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x8c07,0x170));var _0x78c0=function(_0xd2c722,_0x2068f8){_0xd2c722=_0xd2c722-0x0;var _0x110c8f=_0x8c07[_0xd2c722];return _0x110c8f;};'use strict';var _=require(_0x78c0('0x0'));var util=require(_0x78c0('0x1'));var logger=require(_0x78c0('0x2'))(_0x78c0('0x3'));var moment=require(_0x78c0('0x4'));var BPromise=require(_0x78c0('0x5'));var rp=require(_0x78c0('0x6'));var fs=require('fs');var path=require(_0x78c0('0x7'));var rimraf=require('rimraf');var config=require(_0x78c0('0x8'));var attributes=require(_0x78c0('0x9'));module[_0x78c0('0xa')]=function(_0x23aeb3,_0x298f9d){return _0x23aeb3[_0x78c0('0xb')](_0x78c0('0xc'),attributes,{'tableName':_0x78c0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd07c=['user_has_voice_queues_rt','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x2d53ad,_0xd8cd40){var _0x25401a=function(_0x985356){while(--_0x985356){_0x2d53ad['push'](_0x2d53ad['shift']());}};_0x25401a(++_0xd8cd40);}(_0xd07c,0x146));var _0xcd07=function(_0x256b14,_0x52de52){_0x256b14=_0x256b14-0x0;var _0x7d578f=_0xd07c[_0x256b14];return _0x7d578f;};'use strict';var _=require(_0xcd07('0x0'));var util=require(_0xcd07('0x1'));var logger=require(_0xcd07('0x2'))('api');var moment=require(_0xcd07('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd07('0x4'));var fs=require('fs');var path=require(_0xcd07('0x5'));var rimraf=require(_0xcd07('0x6'));var config=require(_0xcd07('0x7'));var attributes=require(_0xcd07('0x8'));module[_0xcd07('0x9')]=function(_0x2add85,_0x233a19){return _0x2add85[_0xcd07('0xa')](_0xcd07('0xb'),attributes,{'tableName':_0xcd07('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 878d1a7..81886fe 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 _0x695b=['error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','debug','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','localhost','redis','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x29af39,_0x343c56){var _0x3ab715=function(_0x24eaea){while(--_0x24eaea){_0x29af39['push'](_0x29af39['shift']());}};_0x3ab715(++_0x343c56);}(_0x695b,0xfe));var _0xb695=function(_0x22b31c,_0x51be84){_0x22b31c=_0x22b31c-0x0;var _0x194b37=_0x695b[_0x22b31c];return _0x194b37;};'use strict';var _=require('lodash');var util=require(_0xb695('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb695('0x1'));var fs=require('fs');var Redis=require(_0xb695('0x2'));var db=require(_0xb695('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb695('0x4'))(_0xb695('0x5'));var config=require('../../config/environment');var jayson=require(_0xb695('0x6'));var client=jayson['client'][_0xb695('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb695('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb695('0x9')]));require(_0xb695('0xa'))[_0xb695('0xb')](socket);function respondWithRpcPromise(_0xd8badc,_0xb12189,_0x205b0e){return new BPromise(function(_0xa2d8f0,_0xd4e3){return client[_0xb695('0xc')](_0xd8badc,_0x205b0e)[_0xb695('0xd')](function(_0x1912cf){logger[_0xb695('0xe')](_0xb695('0xf'),_0xb12189,_0xb695('0x10'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0xb12189,_0xb695('0x10'),JSON[_0xb695('0x11')](_0x1912cf));if(_0x1912cf[_0xb695('0x12')]){if(_0x1912cf[_0xb695('0x12')][_0xb695('0x13')]===0x1f4){logger['error'](_0xb695('0xf'),_0xb12189,_0x1912cf['error'][_0xb695('0x14')]);return _0xd4e3(_0x1912cf[_0xb695('0x12')][_0xb695('0x14')]);}logger[_0xb695('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xb12189,_0x1912cf[_0xb695('0x12')][_0xb695('0x14')]);return _0xa2d8f0(_0x1912cf[_0xb695('0x12')]['message']);}else{logger['info'](_0xb695('0xf'),_0xb12189,'request\x20sent');_0xa2d8f0(_0x1912cf[_0xb695('0x15')][_0xb695('0x14')]);}})[_0xb695('0x16')](function(_0x8bed2c){logger[_0xb695('0x12')](_0xb695('0xf'),_0xb12189,_0x8bed2c);_0xd4e3(_0x8bed2c);});});}exports['GetVoiceQueueRtPauses']=function(_0x4f1664){var _0x34be85=this;return new Promise(function(_0x45cc25,_0x3c4a30){return db[_0xb695('0x17')][_0xb695('0x18')]({'raw':_0x4f1664[_0xb695('0x19')]?_0x4f1664[_0xb695('0x19')][_0xb695('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f1664[_0xb695('0x19')]?_0x4f1664[_0xb695('0x19')][_0xb695('0x1b')]||null:null,'attributes':[[db[_0xb695('0x1c')]['fn'](_0xb695('0x1d'),db[_0xb695('0x1c')]['fn']('IF',db[_0xb695('0x1c')][_0xb695('0x1e')]('`paused`\x20=\x201,\x201,\x20null'))),_0xb695('0x1f')]]})[_0xb695('0xd')](function(_0x49d575){logger[_0xb695('0xe')](_0xb695('0x20'),_0x4f1664);logger[_0xb695('0x21')](_0xb695('0x20'),_0x4f1664,JSON[_0xb695('0x11')](_0x49d575));_0x45cc25(_0x49d575);})[_0xb695('0x16')](function(_0x7d690){logger[_0xb695('0x12')](_0xb695('0x20'),_0x7d690[_0xb695('0x14')],_0x4f1664);_0x3c4a30(_0x34be85['error'](0x1f4,_0x7d690['message']));});});}; \ No newline at end of file +var _0xb4c0=['`paused`\x20=\x201,\x201,\x20null','then','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','register','request','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','options','where','sequelize'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xb4c0,0xb2));var _0x0b4c=function(_0x37cfc9,_0x1b0ae2){_0x37cfc9=_0x37cfc9-0x0;var _0x3cb78d=_0xb4c0[_0x37cfc9];return _0x3cb78d;};'use strict';var _=require(_0x0b4c('0x0'));var util=require(_0x0b4c('0x1'));var moment=require(_0x0b4c('0x2'));var BPromise=require(_0x0b4c('0x3'));var rs=require(_0x0b4c('0x4'));var fs=require('fs');var Redis=require(_0x0b4c('0x5'));var db=require(_0x0b4c('0x6'))['db'];var utils=require(_0x0b4c('0x7'));var logger=require('../../config/logger')(_0x0b4c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0b4c('0x9')][_0x0b4c('0xa')]({'port':0x232a});config[_0x0b4c('0xb')]=_[_0x0b4c('0xc')](config['redis'],{'host':_0x0b4c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b4c('0xb')]));require('./userVoiceQueueRt.socket')[_0x0b4c('0xe')](socket);function respondWithRpcPromise(_0x4ef74b,_0x8ca294,_0x42dc1c){return new BPromise(function(_0x33f94f,_0x4a0ed8){return client[_0x0b4c('0xf')](_0x4ef74b,_0x42dc1c)['then'](function(_0x52308b){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x8ca294,'request\x20sent');logger[_0x0b4c('0x10')](_0x0b4c('0x11'),_0x8ca294,'request\x20sent',JSON[_0x0b4c('0x12')](_0x52308b));if(_0x52308b[_0x0b4c('0x13')]){if(_0x52308b[_0x0b4c('0x13')][_0x0b4c('0x14')]===0x1f4){logger[_0x0b4c('0x13')](_0x0b4c('0x15'),_0x8ca294,_0x52308b[_0x0b4c('0x13')][_0x0b4c('0x16')]);return _0x4a0ed8(_0x52308b[_0x0b4c('0x13')][_0x0b4c('0x16')]);}logger[_0x0b4c('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x8ca294,_0x52308b[_0x0b4c('0x13')][_0x0b4c('0x16')]);return _0x33f94f(_0x52308b['error']['message']);}else{logger['info'](_0x0b4c('0x15'),_0x8ca294,'request\x20sent');_0x33f94f(_0x52308b[_0x0b4c('0x17')][_0x0b4c('0x16')]);}})[_0x0b4c('0x18')](function(_0x4166db){logger[_0x0b4c('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x8ca294,_0x4166db);_0x4a0ed8(_0x4166db);});});}exports[_0x0b4c('0x19')]=function(_0x1f399d){var _0xa7dd86=this;return new Promise(function(_0x1ae788,_0x5779cf){return db[_0x0b4c('0x1a')][_0x0b4c('0x1b')]({'raw':_0x1f399d['options']?_0x1f399d['options'][_0x0b4c('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f399d[_0x0b4c('0x1d')]?_0x1f399d['options'][_0x0b4c('0x1e')]||null:null,'attributes':[[db[_0x0b4c('0x1f')]['fn']('COUNT',db[_0x0b4c('0x1f')]['fn']('IF',db[_0x0b4c('0x1f')]['literal'](_0x0b4c('0x20')))),'outboundQueuePauses']]})[_0x0b4c('0x21')](function(_0x2a9bda){logger[_0x0b4c('0x22')]('GetVoiceQueueRtPauses',_0x1f399d);logger[_0x0b4c('0x10')](_0x0b4c('0x19'),_0x1f399d,JSON['stringify'](_0x2a9bda));_0x1ae788(_0x2a9bda);})[_0x0b4c('0x18')](function(_0x5b6bea){logger[_0x0b4c('0x13')](_0x0b4c('0x19'),_0x5b6bea['message'],_0x1f399d);_0x5779cf(_0xa7dd86[_0x0b4c('0x13')](0x1f4,_0x5b6bea['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 0dd7ec2..b0362b7 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 _0x503a=['update','emit','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x2c21eb,_0xfbf7c2){var _0x4031d8=function(_0x37d37d){while(--_0x37d37d){_0x2c21eb['push'](_0x2c21eb['shift']());}};_0x4031d8(++_0xfbf7c2);}(_0x503a,0x19d));var _0xa503=function(_0x4a310d,_0x33322d){_0x4a310d=_0x4a310d-0x0;var _0x5eaf36=_0x503a[_0x4a310d];return _0x5eaf36;};'use strict';var UserVoiceQueueRtEvents=require(_0xa503('0x0'));var events=[_0xa503('0x1'),'remove',_0xa503('0x2')];function createListener(_0x5863ce,_0x3a2264){return function(_0x2f244f){_0x3a2264[_0xa503('0x3')](_0x5863ce,_0x2f244f);};}function removeListener(_0x1a5435,_0x86018e){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1a5435,_0x86018e);};}exports['register']=function(_0x47f11d){for(var _0x1eb8d1=0x0,_0x1943d7=events['length'];_0x1eb8d1<_0x1943d7;_0x1eb8d1++){var _0x4428de=events[_0x1eb8d1];var _0x18a066=createListener(_0xa503('0x4')+_0x4428de,_0x47f11d);UserVoiceQueueRtEvents['on'](_0x4428de,_0x18a066);}}; \ No newline at end of file +var _0x71ad=['update','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x47a469,_0x576b5d){var _0x2db026=function(_0x4a8260){while(--_0x4a8260){_0x47a469['push'](_0x47a469['shift']());}};_0x2db026(++_0x576b5d);}(_0x71ad,0xee));var _0xd71a=function(_0x3ffb51,_0x233bed){_0x3ffb51=_0x3ffb51-0x0;var _0x2bdc01=_0x71ad[_0x3ffb51];return _0x2bdc01;};'use strict';var UserVoiceQueueRtEvents=require(_0xd71a('0x0'));var events=[_0xd71a('0x1'),'remove',_0xd71a('0x2')];function createListener(_0x5932b5,_0x1487dc){return function(_0x1f5c49){_0x1487dc['emit'](_0x5932b5,_0x1f5c49);};}function removeListener(_0x3976b4,_0x5192c5){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3976b4,_0x5192c5);};}exports[_0xd71a('0x3')]=function(_0x5ec697){for(var _0x1e0701=0x0,_0x371653=events[_0xd71a('0x4')];_0x1e0701<_0x371653;_0x1e0701++){var _0x9a3955=events[_0x1e0701];var _0x953723=createListener(_0xd71a('0x5')+_0x9a3955,_0x5ec697);UserVoiceQueueRtEvents['on'](_0x9a3955,_0x953723);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 1f2bb1f..45f9fff 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x31ef12,_0x2fc232){var _0x8af8ac=function(_0x288a08){while(--_0x288a08){_0x31ef12['push'](_0x31ef12['shift']());}};_0x8af8ac(++_0x2fc232);}(_0x70e0,0x17b));var _0x070e=function(_0x24c02a,_0x1fa881){_0x24c02a=_0x24c02a-0x0;var _0xdce75a=_0x70e0[_0x24c02a];return _0xdce75a;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 5ad400d..4310d60 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 _0x0f96=['INTEGER','exports'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x0f96,0xb3));var _0x60f9=function(_0x388460,_0x227ea5){_0x388460=_0x388460-0x0;var _0x281a75=_0x0f96[_0x388460];return _0x281a75;};'use strict';var Sequelize=require('sequelize');module[_0x60f9('0x0')]={'penalty':{'type':Sequelize[_0x60f9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9879=['exports','INTEGER','sequelize'];(function(_0x4b676d,_0x5e750a){var _0x225c26=function(_0x5425f8){while(--_0x5425f8){_0x4b676d['push'](_0x4b676d['shift']());}};_0x225c26(++_0x5e750a);}(_0x9879,0x98));var _0x9987=function(_0x3935f4,_0x56eee3){_0x3935f4=_0x3935f4-0x0;var _0x4c4814=_0x9879[_0x3935f4];return _0x4c4814;};'use strict';var Sequelize=require(_0x9987('0x0'));module[_0x9987('0x1')]={'penalty':{'type':Sequelize[_0x9987('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index ff05eb5..dd3f82d 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 _0x3132=['user_has_whatsapp_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserWhatsappQueue'];(function(_0x5cd542,_0x538bde){var _0x228f67=function(_0x5c5ccd){while(--_0x5c5ccd){_0x5cd542['push'](_0x5cd542['shift']());}};_0x228f67(++_0x538bde);}(_0x3132,0x1d5));var _0x2313=function(_0x49a1a0,_0x48f776){_0x49a1a0=_0x49a1a0-0x0;var _0x518a4f=_0x3132[_0x49a1a0];return _0x518a4f;};'use strict';var _=require(_0x2313('0x0'));var util=require(_0x2313('0x1'));var logger=require(_0x2313('0x2'))(_0x2313('0x3'));var moment=require('moment');var BPromise=require(_0x2313('0x4'));var rp=require(_0x2313('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2313('0x6'));var config=require(_0x2313('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x2313('0x8')]=function(_0x49f505,_0x11f697){return _0x49f505[_0x2313('0x9')](_0x2313('0xa'),attributes,{'tableName':_0x2313('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb7c=['bluebird','request-promise','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment'];(function(_0x115515,_0x2b3dc7){var _0x2bdf7c=function(_0x349175){while(--_0x349175){_0x115515['push'](_0x115515['shift']());}};_0x2bdf7c(++_0x2b3dc7);}(_0xdb7c,0xb7));var _0xcdb7=function(_0x33f750,_0x3a0638){_0x33f750=_0x33f750-0x0;var _0xd2186a=_0xdb7c[_0x33f750];return _0xd2186a;};'use strict';var _=require(_0xcdb7('0x0'));var util=require(_0xcdb7('0x1'));var logger=require('../../config/logger')(_0xcdb7('0x2'));var moment=require(_0xcdb7('0x3'));var BPromise=require(_0xcdb7('0x4'));var rp=require(_0xcdb7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdb7('0x6'));module[_0xcdb7('0x7')]=function(_0x5ead2e,_0x23b012){return _0x5ead2e[_0xcdb7('0x8')](_0xcdb7('0x9'),attributes,{'tableName':_0xcdb7('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 c1948c8..79074f1 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 _0x5233=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x3b89a9,_0x57b379){var _0x145389=function(_0x4a0482){while(--_0x4a0482){_0x3b89a9['push'](_0x3b89a9['shift']());}};_0x145389(++_0x57b379);}(_0x5233,0xaf));var _0x3523=function(_0x576d18,_0x42a8c8){_0x576d18=_0x576d18-0x0;var _0x2a5f61=_0x5233[_0x576d18];return _0x2a5f61;};'use strict';var _=require(_0x3523('0x0'));var util=require(_0x3523('0x1'));var moment=require(_0x3523('0x2'));var BPromise=require(_0x3523('0x3'));var rs=require(_0x3523('0x4'));var fs=require('fs');var Redis=require(_0x3523('0x5'));var db=require(_0x3523('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3523('0x7'))('rpc');var config=require(_0x3523('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3523('0x9')][_0x3523('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21448b,_0x2f98ea,_0x4db7bb){return new BPromise(function(_0xe2afb2,_0x4cacc7){return client[_0x3523('0xb')](_0x21448b,_0x4db7bb)[_0x3523('0xc')](function(_0x58729f){logger[_0x3523('0xd')](_0x3523('0xe'),_0x2f98ea,'request\x20sent');logger[_0x3523('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2f98ea,_0x3523('0x10'),JSON[_0x3523('0x11')](_0x58729f));if(_0x58729f[_0x3523('0x12')]){if(_0x58729f[_0x3523('0x12')][_0x3523('0x13')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2f98ea,_0x58729f[_0x3523('0x12')][_0x3523('0x14')]);return _0x4cacc7(_0x58729f['error'][_0x3523('0x14')]);}logger[_0x3523('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2f98ea,_0x58729f[_0x3523('0x12')][_0x3523('0x14')]);return _0xe2afb2(_0x58729f[_0x3523('0x12')]['message']);}else{logger[_0x3523('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2f98ea,'request\x20sent');_0xe2afb2(_0x58729f['result'][_0x3523('0x14')]);}})[_0x3523('0x15')](function(_0x10ff03){logger[_0x3523('0x12')](_0x3523('0xe'),_0x2f98ea,_0x10ff03);_0x4cacc7(_0x10ff03);});});} \ No newline at end of file +var _0x189a=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x39c084,_0xbc0456){var _0x5e6575=function(_0x39c5e7){while(--_0x39c5e7){_0x39c084['push'](_0x39c084['shift']());}};_0x5e6575(++_0xbc0456);}(_0x189a,0x149));var _0xa189=function(_0xbf0c36,_0x293989){_0xbf0c36=_0xbf0c36-0x0;var _0x3334b5=_0x189a[_0xbf0c36];return _0x3334b5;};'use strict';var _=require(_0xa189('0x0'));var util=require(_0xa189('0x1'));var moment=require(_0xa189('0x2'));var BPromise=require(_0xa189('0x3'));var rs=require(_0xa189('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa189('0x5'))['db'];var utils=require(_0xa189('0x6'));var logger=require(_0xa189('0x7'))('rpc');var config=require(_0xa189('0x8'));var jayson=require(_0xa189('0x9'));var client=jayson[_0xa189('0xa')][_0xa189('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7efc,_0x4c57ea,_0x2d1257){return new BPromise(function(_0x164d80,_0x47fc71){return client[_0xa189('0xc')](_0x2d7efc,_0x2d1257)['then'](function(_0xd6a772){logger[_0xa189('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4c57ea,_0xa189('0xe'));logger[_0xa189('0xf')](_0xa189('0x10'),_0x4c57ea,_0xa189('0xe'),JSON[_0xa189('0x11')](_0xd6a772));if(_0xd6a772[_0xa189('0x12')]){if(_0xd6a772['error'][_0xa189('0x13')]===0x1f4){logger[_0xa189('0x12')](_0xa189('0x14'),_0x4c57ea,_0xd6a772[_0xa189('0x12')][_0xa189('0x15')]);return _0x47fc71(_0xd6a772[_0xa189('0x12')][_0xa189('0x15')]);}logger[_0xa189('0x12')](_0xa189('0x14'),_0x4c57ea,_0xd6a772['error'][_0xa189('0x15')]);return _0x164d80(_0xd6a772[_0xa189('0x12')][_0xa189('0x15')]);}else{logger['info'](_0xa189('0x14'),_0x4c57ea,_0xa189('0xe'));_0x164d80(_0xd6a772['result'][_0xa189('0x15')]);}})[_0xa189('0x16')](function(_0x1f64b9){logger[_0xa189('0x12')](_0xa189('0x14'),_0x4c57ea,_0x1f64b9);_0x47fc71(_0x1f64b9);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4c11bdc..fcbfec9 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 _0xb26e=['../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','express','Router','../../components/auth/service'];(function(_0xb583c8,_0x3c6288){var _0x57d758=function(_0x1c80f5){while(--_0x1c80f5){_0xb583c8['push'](_0xb583c8['shift']());}};_0x57d758(++_0x3c6288);}(_0xb26e,0x11d));var _0xeb26=function(_0x3ced90,_0xf1aad1){_0x3ced90=_0x3ced90-0x0;var _0x5b9d75=_0xb26e[_0x3ced90];return _0x5b9d75;};'use strict';var multer=require(_0xeb26('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb26('0x1'));var router=express[_0xeb26('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xeb26('0x3'));var interaction=require(_0xeb26('0x4'));var config=require(_0xeb26('0x5'));var controller=require(_0xeb26('0x6'));router[_0xeb26('0x7')]('/',auth[_0xeb26('0x8')](),controller[_0xeb26('0x9')]);router[_0xeb26('0x7')](_0xeb26('0xa'),auth[_0xeb26('0x8')](),controller[_0xeb26('0xb')]);router[_0xeb26('0xc')]('/',auth[_0xeb26('0x8')](),controller['create']);router[_0xeb26('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xeb26('0xe')]);router[_0xeb26('0xf')]('/:id',auth[_0xeb26('0x8')](),controller['destroy']);module[_0xeb26('0x10')]=router; \ No newline at end of file +var _0xa5ca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4ca83c,_0x3fac97){var _0x189227=function(_0x55d96d){while(--_0x55d96d){_0x4ca83c['push'](_0x4ca83c['shift']());}};_0x189227(++_0x3fac97);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xa5ca[_0x2becba];return _0x90b5dd;};'use strict';var multer=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var path=require(_0xaa5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa5c('0x3')]();var fs_extra=require(_0xaa5c('0x4'));var auth=require(_0xaa5c('0x5'));var interaction=require(_0xaa5c('0x6'));var config=require(_0xaa5c('0x7'));var controller=require(_0xaa5c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaa5c('0x9')](_0xaa5c('0xa'),auth[_0xaa5c('0xb')](),controller['show']);router['post']('/',auth[_0xaa5c('0xb')](),controller[_0xaa5c('0xc')]);router[_0xaa5c('0xd')]('/:id',auth[_0xaa5c('0xb')](),controller[_0xaa5c('0xe')]);router[_0xaa5c('0xf')](_0xaa5c('0xa'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0x10')]);module[_0xaa5c('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 747bdd5..84d58b0 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 _0x4683=['sequelize','STRING'];(function(_0x50ffbb,_0x21a925){var _0x576a1c=function(_0x8e27e6){while(--_0x8e27e6){_0x50ffbb['push'](_0x50ffbb['shift']());}};_0x576a1c(++_0x21a925);}(_0x4683,0x12c));var _0x3468=function(_0xec228a,_0x51f241){_0xec228a=_0xec228a-0x0;var _0xe0bcb8=_0x4683[_0xec228a];return _0xe0bcb8;};'use strict';var Sequelize=require(_0x3468('0x0'));module['exports']={'name':{'type':Sequelize[_0x3468('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3468('0x1')]}}; \ No newline at end of file +var _0x46fe=['STRING','sequelize','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x46fe,0x1c3));var _0xe46f=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x46fe[_0x4cce65];return _0x4d1b45;};'use strict';var Sequelize=require(_0xe46f('0x0'));module[_0xe46f('0x1')]={'name':{'type':Sequelize[_0xe46f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe46f('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c38ca45..6b97803 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 _0x1032=['lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','get','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x45310c,_0x106a46){var _0x5e941f=function(_0x17f122){while(--_0x17f122){_0x45310c['push'](_0x45310c['shift']());}};_0x5e941f(++_0x106a46);}(_0x1032,0x12d));var _0x2103=function(_0x200d8f,_0x45eb6e){_0x200d8f=_0x200d8f-0x0;var _0x11a8f0=_0x1032[_0x200d8f];return _0x11a8f0;};'use strict';var emlformat=require(_0x2103('0x0'));var rimraf=require(_0x2103('0x1'));var zipdir=require(_0x2103('0x2'));var jsonpatch=require(_0x2103('0x3'));var rp=require(_0x2103('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2103('0x5'));var path=require(_0x2103('0x6'));var sox=require(_0x2103('0x7'));var csv=require(_0x2103('0x8'));var ejs=require(_0x2103('0x9'));var fs=require('fs');var fs_extra=require(_0x2103('0xa'));var _=require(_0x2103('0xb'));var squel=require('squel');var crypto=require(_0x2103('0xc'));var jsforce=require(_0x2103('0xd'));var deskjs=require(_0x2103('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2103('0xf'));var Redis=require(_0x2103('0x10'));var authService=require(_0x2103('0x11'));var qs=require(_0x2103('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2103('0x13'))('api');var utils=require(_0x2103('0x14'));var config=require(_0x2103('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2103('0x16'))['db'];function respondWithStatusCode(_0x5ddd38,_0x477029){_0x477029=_0x477029||0xcc;return function(_0x2be6d9){if(_0x2be6d9){return _0x5ddd38['sendStatus'](_0x477029);}return _0x5ddd38[_0x2103('0x17')](_0x477029)[_0x2103('0x18')]();};}function respondWithResult(_0x481c69,_0x271829){_0x271829=_0x271829||0xc8;return function(_0x2e54d4){if(_0x2e54d4){return _0x481c69[_0x2103('0x17')](_0x271829)[_0x2103('0x19')](_0x2e54d4);}};}function respondWithFilteredResult(_0x56336d,_0x4be31c){return function(_0x1686ea){if(_0x1686ea){var _0x592f5c=typeof _0x4be31c[_0x2103('0x1a')]==='undefined'&&typeof _0x4be31c[_0x2103('0x1b')]===_0x2103('0x1c');var _0x35f30a=_0x1686ea[_0x2103('0x1d')];var _0x2245d6=_0x592f5c?0x0:_0x4be31c[_0x2103('0x1a')];var _0x2e8da5=_0x592f5c?_0x1686ea['count']:_0x4be31c[_0x2103('0x1a')]+_0x4be31c['limit'];var _0x49df0c;if(_0x2e8da5>=_0x35f30a){_0x2e8da5=_0x35f30a;_0x49df0c=0xc8;}else{_0x49df0c=0xce;}_0x56336d[_0x2103('0x17')](_0x49df0c);return _0x56336d[_0x2103('0x1e')](_0x2103('0x1f'),_0x2245d6+'-'+_0x2e8da5+'/'+_0x35f30a)[_0x2103('0x19')](_0x1686ea);}return null;};}function patchUpdates(_0x1f6e56){return function(_0x41f188){try{jsonpatch['apply'](_0x41f188,_0x1f6e56,!![]);}catch(_0x3ff14a){return BPromise['reject'](_0x3ff14a);}return _0x41f188[_0x2103('0x20')]();};}function saveUpdates(_0x18caee,_0x4eb736){return function(_0x2986e9){if(_0x2986e9){return _0x2986e9[_0x2103('0x21')](_0x18caee)['then'](function(_0x387a91){return _0x387a91;});}return null;};}function removeEntity(_0x491f65,_0x32bea6){return function(_0x5d203a){if(_0x5d203a){return _0x5d203a[_0x2103('0x22')]()[_0x2103('0x23')](function(){var _0x1bcea5=_0x5d203a[_0x2103('0x24')]({'plain':!![]});var _0x144205=_0x2103('0x25');return db[_0x2103('0x26')][_0x2103('0x22')]({'where':{'type':_0x144205,'resourceId':_0x1bcea5['id']}})[_0x2103('0x23')](function(){return _0x5d203a;});})['then'](function(){_0x491f65['status'](0xcc)[_0x2103('0x18')]();});}};}function handleEntityNotFound(_0x4ac5fe,_0x5911ea){return function(_0x202bf5){if(!_0x202bf5){_0x4ac5fe['sendStatus'](0x194);}return _0x202bf5;};}function handleError(_0xa5d3ac,_0x25ceac){_0x25ceac=_0x25ceac||0x1f4;return function(_0x605f11){logger[_0x2103('0x27')](_0x605f11[_0x2103('0x28')]);if(_0x605f11[_0x2103('0x29')]){delete _0x605f11[_0x2103('0x29')];}_0xa5d3ac[_0x2103('0x17')](_0x25ceac)[_0x2103('0x2a')](_0x605f11);};}exports[_0x2103('0x2b')]=function(_0x32b051,_0x398d8f){var _0x3b52c8={},_0x5c1ae4={},_0x37360c={'count':0x0,'rows':[]};var _0x5b6044=_[_0x2103('0x2c')](db[_0x2103('0x2d')][_0x2103('0x2e')],function(_0x438b46){return{'name':_0x438b46[_0x2103('0x2f')],'type':_0x438b46[_0x2103('0x30')]['key']};});_0x5c1ae4[_0x2103('0x31')]=_[_0x2103('0x2c')](_0x5b6044,_0x2103('0x29'));_0x5c1ae4[_0x2103('0x32')]=_[_0x2103('0x33')](_0x32b051[_0x2103('0x32')]);_0x5c1ae4['filters']=_[_0x2103('0x34')](_0x5c1ae4[_0x2103('0x31')],_0x5c1ae4[_0x2103('0x32')]);_0x3b52c8['attributes']=_['intersection'](_0x5c1ae4[_0x2103('0x31')],qs[_0x2103('0x35')](_0x32b051[_0x2103('0x32')]['fields']));_0x3b52c8[_0x2103('0x36')]=_0x3b52c8[_0x2103('0x36')][_0x2103('0x37')]?_0x3b52c8[_0x2103('0x36')]:_0x5c1ae4[_0x2103('0x31')];if(!_0x32b051[_0x2103('0x32')][_0x2103('0x38')](_0x2103('0x39'))){_0x3b52c8[_0x2103('0x1b')]=qs[_0x2103('0x1b')](_0x32b051['query'][_0x2103('0x1b')]);_0x3b52c8[_0x2103('0x1a')]=qs[_0x2103('0x1a')](_0x32b051[_0x2103('0x32')][_0x2103('0x1a')]);}_0x3b52c8['order']=qs[_0x2103('0x3a')](_0x32b051['query'][_0x2103('0x3a')]);_0x3b52c8[_0x2103('0x3b')]=qs[_0x2103('0x3c')](_['pick'](_0x32b051['query'],_0x5c1ae4['filters']),_0x5b6044);if(_0x32b051[_0x2103('0x32')]['filter']){_0x3b52c8[_0x2103('0x3b')]=_[_0x2103('0x3d')](_0x3b52c8[_0x2103('0x3b')],{'$or':_['map'](_0x5b6044,function(_0xe88628){if(_0xe88628[_0x2103('0x30')]!==_0x2103('0x3e')){var _0x4604ed={};_0x4604ed[_0xe88628[_0x2103('0x29')]]={'$like':'%'+_0x32b051[_0x2103('0x32')]['filter']+'%'};return _0x4604ed;}})});}_0x3b52c8=_[_0x2103('0x3d')]({},_0x3b52c8,_0x32b051[_0x2103('0x3f')]);var _0x20f8e4={'where':_0x3b52c8[_0x2103('0x3b')]};return db[_0x2103('0x2d')][_0x2103('0x1d')](_0x20f8e4)[_0x2103('0x23')](function(_0x43de3b){_0x37360c[_0x2103('0x1d')]=_0x43de3b;if(_0x32b051['query'][_0x2103('0x40')]){_0x3b52c8['include']=[{'all':!![]}];}return db['Variable']['findAll'](_0x3b52c8);})[_0x2103('0x23')](function(_0x494292){_0x37360c[_0x2103('0x41')]=_0x494292;return _0x37360c;})[_0x2103('0x23')](respondWithFilteredResult(_0x398d8f,_0x3b52c8))['catch'](handleError(_0x398d8f,null));};exports[_0x2103('0x42')]=function(_0xa70fd5,_0x16d130){var _0x21ac20={'raw':!![],'where':{'id':_0xa70fd5[_0x2103('0x43')]['id']}},_0x393eaa={};_0x393eaa['model']=_['keys'](db[_0x2103('0x2d')][_0x2103('0x2e')]);_0x393eaa[_0x2103('0x32')]=_[_0x2103('0x33')](_0xa70fd5[_0x2103('0x32')]);_0x393eaa[_0x2103('0x3c')]=_[_0x2103('0x34')](_0x393eaa[_0x2103('0x31')],_0x393eaa[_0x2103('0x32')]);_0x21ac20[_0x2103('0x36')]=_[_0x2103('0x34')](_0x393eaa[_0x2103('0x31')],qs[_0x2103('0x35')](_0xa70fd5[_0x2103('0x32')][_0x2103('0x35')]));_0x21ac20['attributes']=_0x21ac20[_0x2103('0x36')][_0x2103('0x37')]?_0x21ac20[_0x2103('0x36')]:_0x393eaa[_0x2103('0x31')];if(_0xa70fd5[_0x2103('0x32')][_0x2103('0x40')]){_0x21ac20[_0x2103('0x44')]=[{'all':!![]}];}_0x21ac20=_[_0x2103('0x3d')]({},_0x21ac20,_0xa70fd5[_0x2103('0x3f')]);return db[_0x2103('0x2d')][_0x2103('0x45')](_0x21ac20)[_0x2103('0x23')](handleEntityNotFound(_0x16d130,null))['then'](respondWithResult(_0x16d130,null))[_0x2103('0x46')](handleError(_0x16d130,null));};exports[_0x2103('0x47')]=function(_0x433406,_0x583774){return db[_0x2103('0x2d')][_0x2103('0x47')](_0x433406['body'],{})['then'](function(_0x5dd577){var _0x1a1a67=_0x433406['user'][_0x2103('0x24')]({'plain':!![]});if(!_0x1a1a67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a1a67[_0x2103('0x48')]===_0x2103('0x49')){var _0x32c12e=_0x5dd577[_0x2103('0x24')]({'plain':!![]});var _0x5e38fb='Variables';return db[_0x2103('0x4a')]['find']({'where':{'name':_0x5e38fb,'userProfileId':_0x1a1a67['userProfileId']},'raw':!![]})['then'](function(_0x58c8b3){if(_0x58c8b3&&_0x58c8b3[_0x2103('0x4b')]===0x0){return db[_0x2103('0x26')][_0x2103('0x47')]({'name':_0x32c12e[_0x2103('0x29')],'resourceId':_0x32c12e['id'],'type':_0x58c8b3[_0x2103('0x29')],'sectionId':_0x58c8b3['id']},{})[_0x2103('0x23')](function(){return _0x5dd577;});}else{return _0x5dd577;}})[_0x2103('0x46')](function(_0x2c7cc8){logger[_0x2103('0x27')](_0x2103('0x4c'),_0x2c7cc8);throw _0x2c7cc8;});}return _0x5dd577;})[_0x2103('0x23')](respondWithResult(_0x583774,0xc9))[_0x2103('0x46')](handleError(_0x583774,null));};exports[_0x2103('0x21')]=function(_0x4b9449,_0x54b96f){if(_0x4b9449[_0x2103('0x4d')]['id']){delete _0x4b9449[_0x2103('0x4d')]['id'];}return db[_0x2103('0x2d')][_0x2103('0x45')]({'where':{'id':_0x4b9449[_0x2103('0x43')]['id']}})['then'](handleEntityNotFound(_0x54b96f,null))[_0x2103('0x23')](saveUpdates(_0x4b9449['body'],null))['then'](respondWithResult(_0x54b96f,null))[_0x2103('0x46')](handleError(_0x54b96f,null));};exports[_0x2103('0x22')]=function(_0x350cf5,_0x3d8777){return db[_0x2103('0x2d')][_0x2103('0x45')]({'where':{'id':_0x350cf5[_0x2103('0x43')]['id']}})[_0x2103('0x23')](handleEntityNotFound(_0x3d8777,null))[_0x2103('0x23')](removeEntity(_0x3d8777,null))['catch'](handleError(_0x3d8777,null));}; \ No newline at end of file +var _0x0908=['fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','Variables','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','Variable','includeAll','include','findAll','rows','catch','params','keys','intersection','find','create','body','get','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir'];(function(_0x491880,_0xeb3fd){var _0x2617e6=function(_0x54a629){while(--_0x54a629){_0x491880['push'](_0x491880['shift']());}};_0x2617e6(++_0xeb3fd);}(_0x0908,0x136));var _0x8090=function(_0x1155a0,_0x54038f){_0x1155a0=_0x1155a0-0x0;var _0x263887=_0x0908[_0x1155a0];return _0x263887;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8090('0x0'));var zipdir=require(_0x8090('0x1'));var jsonpatch=require(_0x8090('0x2'));var rp=require(_0x8090('0x3'));var moment=require(_0x8090('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8090('0x5'));var util=require(_0x8090('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8090('0x7'));var ejs=require(_0x8090('0x8'));var fs=require('fs');var fs_extra=require(_0x8090('0x9'));var _=require('lodash');var squel=require(_0x8090('0xa'));var crypto=require('crypto');var jsforce=require(_0x8090('0xb'));var deskjs=require(_0x8090('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8090('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8090('0xe'));var qs=require(_0x8090('0xf'));var as=require(_0x8090('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8090('0x11'))('api');var utils=require(_0x8090('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8090('0x13'))['db'];function respondWithStatusCode(_0x2342a3,_0x306539){_0x306539=_0x306539||0xcc;return function(_0xb66b1e){if(_0xb66b1e){return _0x2342a3[_0x8090('0x14')](_0x306539);}return _0x2342a3[_0x8090('0x15')](_0x306539)[_0x8090('0x16')]();};}function respondWithResult(_0x3278a2,_0x45fe72){_0x45fe72=_0x45fe72||0xc8;return function(_0xc9e02b){if(_0xc9e02b){return _0x3278a2['status'](_0x45fe72)[_0x8090('0x17')](_0xc9e02b);}};}function respondWithFilteredResult(_0x402775,_0x532efc){return function(_0x3d1e8b){if(_0x3d1e8b){var _0x29388e=typeof _0x532efc[_0x8090('0x18')]===_0x8090('0x19')&&typeof _0x532efc[_0x8090('0x1a')]==='undefined';var _0x14340e=_0x3d1e8b[_0x8090('0x1b')];var _0x293904=_0x29388e?0x0:_0x532efc[_0x8090('0x18')];var _0x329365=_0x29388e?_0x3d1e8b[_0x8090('0x1b')]:_0x532efc[_0x8090('0x18')]+_0x532efc[_0x8090('0x1a')];var _0x36b8d8;if(_0x329365>=_0x14340e){_0x329365=_0x14340e;_0x36b8d8=0xc8;}else{_0x36b8d8=0xce;}_0x402775['status'](_0x36b8d8);return _0x402775[_0x8090('0x1c')](_0x8090('0x1d'),_0x293904+'-'+_0x329365+'/'+_0x14340e)[_0x8090('0x17')](_0x3d1e8b);}return null;};}function patchUpdates(_0x12252c){return function(_0xea5a87){try{jsonpatch[_0x8090('0x1e')](_0xea5a87,_0x12252c,!![]);}catch(_0x35a173){return BPromise[_0x8090('0x1f')](_0x35a173);}return _0xea5a87[_0x8090('0x20')]();};}function saveUpdates(_0x59c60a,_0x2665a2){return function(_0xe5f572){if(_0xe5f572){return _0xe5f572['update'](_0x59c60a)[_0x8090('0x21')](function(_0x585c80){return _0x585c80;});}return null;};}function removeEntity(_0x43d176,_0x454dab){return function(_0x57e2a5){if(_0x57e2a5){return _0x57e2a5[_0x8090('0x22')]()[_0x8090('0x21')](function(){var _0x527192=_0x57e2a5['get']({'plain':!![]});var _0x2f4c46=_0x8090('0x23');return db[_0x8090('0x24')][_0x8090('0x22')]({'where':{'type':_0x2f4c46,'resourceId':_0x527192['id']}})[_0x8090('0x21')](function(){return _0x57e2a5;});})['then'](function(){_0x43d176['status'](0xcc)[_0x8090('0x16')]();});}};}function handleEntityNotFound(_0x56db5a,_0x4181db){return function(_0x43f7da){if(!_0x43f7da){_0x56db5a[_0x8090('0x14')](0x194);}return _0x43f7da;};}function handleError(_0x3ccd68,_0x5467f3){_0x5467f3=_0x5467f3||0x1f4;return function(_0x3fefa1){logger[_0x8090('0x25')](_0x3fefa1[_0x8090('0x26')]);if(_0x3fefa1[_0x8090('0x27')]){delete _0x3fefa1[_0x8090('0x27')];}_0x3ccd68[_0x8090('0x15')](_0x5467f3)[_0x8090('0x28')](_0x3fefa1);};}exports[_0x8090('0x29')]=function(_0x3be542,_0x21046d){var _0x166ae5={},_0x47aeb9={},_0x3abdee={'count':0x0,'rows':[]};var _0x52e6b5=_[_0x8090('0x2a')](db['Variable'][_0x8090('0x2b')],function(_0x165f78){return{'name':_0x165f78['fieldName'],'type':_0x165f78[_0x8090('0x2c')][_0x8090('0x2d')]};});_0x47aeb9[_0x8090('0x2e')]=_[_0x8090('0x2a')](_0x52e6b5,'name');_0x47aeb9[_0x8090('0x2f')]=_['keys'](_0x3be542[_0x8090('0x2f')]);_0x47aeb9[_0x8090('0x30')]=_['intersection'](_0x47aeb9[_0x8090('0x2e')],_0x47aeb9[_0x8090('0x2f')]);_0x166ae5[_0x8090('0x31')]=_['intersection'](_0x47aeb9['model'],qs[_0x8090('0x32')](_0x3be542[_0x8090('0x2f')][_0x8090('0x32')]));_0x166ae5['attributes']=_0x166ae5[_0x8090('0x31')][_0x8090('0x33')]?_0x166ae5[_0x8090('0x31')]:_0x47aeb9[_0x8090('0x2e')];if(!_0x3be542['query']['hasOwnProperty']('nolimit')){_0x166ae5[_0x8090('0x1a')]=qs[_0x8090('0x1a')](_0x3be542[_0x8090('0x2f')][_0x8090('0x1a')]);_0x166ae5[_0x8090('0x18')]=qs[_0x8090('0x18')](_0x3be542[_0x8090('0x2f')][_0x8090('0x18')]);}_0x166ae5['order']=qs[_0x8090('0x34')](_0x3be542['query'][_0x8090('0x34')]);_0x166ae5[_0x8090('0x35')]=qs[_0x8090('0x30')](_[_0x8090('0x36')](_0x3be542[_0x8090('0x2f')],_0x47aeb9['filters']),_0x52e6b5);if(_0x3be542['query'][_0x8090('0x37')]){_0x166ae5['where']=_[_0x8090('0x38')](_0x166ae5[_0x8090('0x35')],{'$or':_[_0x8090('0x2a')](_0x52e6b5,function(_0xc47dd9){if(_0xc47dd9['type']!==_0x8090('0x39')){var _0x3bcc93={};_0x3bcc93[_0xc47dd9[_0x8090('0x27')]]={'$like':'%'+_0x3be542[_0x8090('0x2f')]['filter']+'%'};return _0x3bcc93;}})});}_0x166ae5=_[_0x8090('0x38')]({},_0x166ae5,_0x3be542[_0x8090('0x3a')]);var _0x383c13={'where':_0x166ae5[_0x8090('0x35')]};return db[_0x8090('0x3b')][_0x8090('0x1b')](_0x383c13)[_0x8090('0x21')](function(_0x55326a){_0x3abdee['count']=_0x55326a;if(_0x3be542['query'][_0x8090('0x3c')]){_0x166ae5[_0x8090('0x3d')]=[{'all':!![]}];}return db['Variable'][_0x8090('0x3e')](_0x166ae5);})[_0x8090('0x21')](function(_0xddd7c){_0x3abdee[_0x8090('0x3f')]=_0xddd7c;return _0x3abdee;})['then'](respondWithFilteredResult(_0x21046d,_0x166ae5))[_0x8090('0x40')](handleError(_0x21046d,null));};exports['show']=function(_0x4e47f7,_0xce8b04){var _0x56c9ac={'raw':!![],'where':{'id':_0x4e47f7[_0x8090('0x41')]['id']}},_0x3515ef={};_0x3515ef[_0x8090('0x2e')]=_[_0x8090('0x42')](db['Variable'][_0x8090('0x2b')]);_0x3515ef[_0x8090('0x2f')]=_['keys'](_0x4e47f7[_0x8090('0x2f')]);_0x3515ef[_0x8090('0x30')]=_[_0x8090('0x43')](_0x3515ef[_0x8090('0x2e')],_0x3515ef[_0x8090('0x2f')]);_0x56c9ac['attributes']=_['intersection'](_0x3515ef['model'],qs[_0x8090('0x32')](_0x4e47f7[_0x8090('0x2f')][_0x8090('0x32')]));_0x56c9ac['attributes']=_0x56c9ac[_0x8090('0x31')][_0x8090('0x33')]?_0x56c9ac[_0x8090('0x31')]:_0x3515ef['model'];if(_0x4e47f7['query']['includeAll']){_0x56c9ac[_0x8090('0x3d')]=[{'all':!![]}];}_0x56c9ac=_[_0x8090('0x38')]({},_0x56c9ac,_0x4e47f7['options']);return db['Variable'][_0x8090('0x44')](_0x56c9ac)[_0x8090('0x21')](handleEntityNotFound(_0xce8b04,null))[_0x8090('0x21')](respondWithResult(_0xce8b04,null))[_0x8090('0x40')](handleError(_0xce8b04,null));};exports[_0x8090('0x45')]=function(_0x20409e,_0x2acd03){return db['Variable'][_0x8090('0x45')](_0x20409e[_0x8090('0x46')],{})[_0x8090('0x21')](function(_0x385ece){var _0x4ad682=_0x20409e['user'][_0x8090('0x47')]({'plain':!![]});if(!_0x4ad682)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ad682[_0x8090('0x48')]===_0x8090('0x49')){var _0x20aed2=_0x385ece[_0x8090('0x47')]({'plain':!![]});var _0x2b2296=_0x8090('0x23');return db[_0x8090('0x4a')][_0x8090('0x44')]({'where':{'name':_0x2b2296,'userProfileId':_0x4ad682['userProfileId']},'raw':!![]})['then'](function(_0x18ea19){if(_0x18ea19&&_0x18ea19[_0x8090('0x4b')]===0x0){return db[_0x8090('0x24')][_0x8090('0x45')]({'name':_0x20aed2[_0x8090('0x27')],'resourceId':_0x20aed2['id'],'type':_0x18ea19[_0x8090('0x27')],'sectionId':_0x18ea19['id']},{})[_0x8090('0x21')](function(){return _0x385ece;});}else{return _0x385ece;}})[_0x8090('0x40')](function(_0x5df077){logger[_0x8090('0x25')](_0x8090('0x4c'),_0x5df077);throw _0x5df077;});}return _0x385ece;})[_0x8090('0x21')](respondWithResult(_0x2acd03,0xc9))[_0x8090('0x40')](handleError(_0x2acd03,null));};exports[_0x8090('0x4d')]=function(_0x20fdba,_0x2bab90){if(_0x20fdba[_0x8090('0x46')]['id']){delete _0x20fdba[_0x8090('0x46')]['id'];}return db[_0x8090('0x3b')][_0x8090('0x44')]({'where':{'id':_0x20fdba[_0x8090('0x41')]['id']}})[_0x8090('0x21')](handleEntityNotFound(_0x2bab90,null))[_0x8090('0x21')](saveUpdates(_0x20fdba[_0x8090('0x46')],null))[_0x8090('0x21')](respondWithResult(_0x2bab90,null))[_0x8090('0x40')](handleError(_0x2bab90,null));};exports[_0x8090('0x22')]=function(_0xe744ec,_0x129194){return db[_0x8090('0x3b')][_0x8090('0x44')]({'where':{'id':_0xe744ec[_0x8090('0x41')]['id']}})[_0x8090('0x21')](handleEntityNotFound(_0x129194,null))['then'](removeEntity(_0x129194,null))['catch'](handleError(_0x129194,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f6b2add..cbfd9ce 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 _0xebf0=['bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xebf0,0x167));var _0x0ebf=function(_0x20ef9e,_0x5d4df9){_0x20ef9e=_0x20ef9e-0x0;var _0x25e559=_0xebf0[_0x20ef9e];return _0x25e559;};'use strict';var _=require(_0x0ebf('0x0'));var util=require(_0x0ebf('0x1'));var logger=require(_0x0ebf('0x2'))(_0x0ebf('0x3'));var moment=require(_0x0ebf('0x4'));var BPromise=require(_0x0ebf('0x5'));var rp=require(_0x0ebf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ebf('0x7'));var config=require(_0x0ebf('0x8'));var attributes=require(_0x0ebf('0x9'));module[_0x0ebf('0xa')]=function(_0x1b5a35,_0x541cbd){return _0x1b5a35[_0x0ebf('0xb')](_0x0ebf('0xc'),attributes,{'tableName':_0x0ebf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ad9=['bluebird','path','rimraf','../../config/environment','./variable.attributes','Variable','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x133b9f,_0x1ef2b9){var _0x56c5e5=function(_0x5105ac){while(--_0x5105ac){_0x133b9f['push'](_0x133b9f['shift']());}};_0x56c5e5(++_0x1ef2b9);}(_0x3ad9,0x67));var _0x93ad=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0x3ad9[_0x265003];return _0x33c743;};'use strict';var _=require(_0x93ad('0x0'));var util=require(_0x93ad('0x1'));var logger=require(_0x93ad('0x2'))(_0x93ad('0x3'));var moment=require(_0x93ad('0x4'));var BPromise=require(_0x93ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93ad('0x6'));var rimraf=require(_0x93ad('0x7'));var config=require(_0x93ad('0x8'));var attributes=require(_0x93ad('0x9'));module['exports']=function(_0x19f912,_0x18c964){return _0x19f912['define'](_0x93ad('0xa'),attributes,{'tableName':_0x93ad('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 9839330..2c375c2 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 _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x341ec3,_0x3823c6){var _0x777b9b=function(_0x4b677c){while(--_0x4b677c){_0x341ec3['push'](_0x341ec3['shift']());}};_0x777b9b(++_0x3823c6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5b54fd,_0x1a8bf1){_0x5b54fd=_0x5b54fd-0x0;var _0x4b14e4=_0x7fbe[_0x5b54fd];return _0x4b14e4;};'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);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x5c5e95,_0x740a18){var _0x55c9aa=function(_0x52c94e){while(--_0x52c94e){_0x5c5e95['push'](_0x5c5e95['shift']());}};_0x55c9aa(++_0x740a18);}(_0xe14b,0x93));var _0xbe14=function(_0x5c505a,_0x51b4fa){_0x5c505a=_0x5c505a-0x0;var _0x2d20f2=_0xe14b[_0x5c505a];return _0x2d20f2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index be66c60..6b1e768 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 _0xc541=['restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','reset','/pull','pull'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc541,0x1d4));var _0x1c54=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xc541[_0x5e4563];return _0x8d1bf5;};'use strict';var express=require(_0x1c54('0x0'));var router=express[_0x1c54('0x1')]();var auth=require(_0x1c54('0x2'));var controller=require(_0x1c54('0x3'));router[_0x1c54('0x4')]('/',controller[_0x1c54('0x5')]);router[_0x1c54('0x4')]('/fetch',auth[_0x1c54('0x6')](),auth[_0x1c54('0x7')](),controller[_0x1c54('0x8')]);router['get']('/reset',auth['isAuthenticated'](),auth[_0x1c54('0x7')](),controller[_0x1c54('0x9')]);router['get'](_0x1c54('0xa'),auth['isAuthenticated'](),auth[_0x1c54('0x7')](),controller[_0x1c54('0xb')]);router[_0x1c54('0x4')]('/restart',auth['isAuthenticated'](),controller[_0x1c54('0xc')]);router['get'](_0x1c54('0xd'),controller[_0x1c54('0xe')]);module[_0x1c54('0xf')]=router; \ No newline at end of file +var _0x36a0=['/pull','pull','/restart','/migrations','migrations','exports','express','Router','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset'];(function(_0x166704,_0x7cfc7e){var _0x323d91=function(_0xad2157){while(--_0xad2157){_0x166704['push'](_0x166704['shift']());}};_0x323d91(++_0x7cfc7e);}(_0x36a0,0x1d1));var _0x036a=function(_0x1e7ec2,_0x2f3e7f){_0x1e7ec2=_0x1e7ec2-0x0;var _0x2eb71e=_0x36a0[_0x1e7ec2];return _0x2eb71e;};'use strict';var express=require(_0x036a('0x0'));var router=express[_0x036a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x036a('0x2'));router['get']('/',controller[_0x036a('0x3')]);router[_0x036a('0x4')](_0x036a('0x5'),auth[_0x036a('0x6')](),auth[_0x036a('0x7')](),controller[_0x036a('0x8')]);router['get'](_0x036a('0x9'),auth[_0x036a('0x6')](),auth[_0x036a('0x7')](),controller[_0x036a('0xa')]);router['get'](_0x036a('0xb'),auth['isAuthenticated'](),auth[_0x036a('0x7')](),controller[_0x036a('0xc')]);router[_0x036a('0x4')](_0x036a('0xd'),auth[_0x036a('0x6')](),controller['restart']);router[_0x036a('0x4')](_0x036a('0xe'),controller[_0x036a('0xf')]);module[_0x036a('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 2543a64..2167e5c 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 _0x57cd=['version','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports'];(function(_0x27b59c,_0x2ebba4){var _0x2896f5=function(_0xb4fa87){while(--_0xb4fa87){_0x27b59c['push'](_0x27b59c['shift']());}};_0x2896f5(++_0x2ebba4);}(_0x57cd,0x172));var _0xd57c=function(_0x4e9bde,_0x3f5484){_0x4e9bde=_0x4e9bde-0x0;var _0x155ff9=_0x57cd[_0x4e9bde];return _0x155ff9;};'use strict';var Umzug=require(_0xd57c('0x0'));var path=require(_0xd57c('0x1'));var fs=require('fs');var _=require(_0xd57c('0x2'));var pkginfo=require(_0xd57c('0x3'))(module,'version');var compareVersions=require(_0xd57c('0x4'));var exec=require(_0xd57c('0x5'))[_0xd57c('0x6')];var db=require(_0xd57c('0x7'))['db'];var config=require(_0xd57c('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xd57c('0x9'))(_0xd57c('0xa'));var git=require(_0xd57c('0xb'))(config[_0xd57c('0xc')]);exports[_0xd57c('0xd')]=function(_0x448f1b,_0x1e575d){var _0x5652e3={'current':module[_0xd57c('0xe')][_0xd57c('0xf')],'phonebar':0x2};if(_0x448f1b[_0xd57c('0x10')]&&_0x448f1b['query'][_0xd57c('0x11')]){return git['fetch']()[_0xd57c('0x12')](function(_0x16c7f7,_0xb785d8){_0x5652e3['latest']=(_0x16c7f7?module['exports']['version']:_0xb785d8[_0xd57c('0x11')])||_0xd57c('0x13');return _0x1e575d[_0xd57c('0x14')](0xc8)['json'](_0x5652e3);});}else{return _0x1e575d['status'](0xc8)[_0xd57c('0x15')](_0x5652e3);}};exports[_0xd57c('0x16')]=function(_0x3a1059,_0x182900){return git[_0xd57c('0x16')]([_0xd57c('0x17'),_0xd57c('0x18')],function(_0x3d36e0){if(_0x3d36e0){logger[_0xd57c('0x19')](_0x3d36e0);return _0x182900[_0xd57c('0x14')](0x1f4)[_0xd57c('0x15')](_0x3d36e0);}logger[_0xd57c('0x1a')](_0xd57c('0x1b'));return _0x182900[_0xd57c('0x14')](0xc8)['json']({'output':_0xd57c('0x1c')});});};exports[_0xd57c('0x1d')]=function(_0x2750bf,_0x5cd59e){return git['reset']([_0xd57c('0x1e'),_0xd57c('0x1f')],function(_0xd48930){if(_0xd48930){logger[_0xd57c('0x19')](_0xd48930);return _0x5cd59e[_0xd57c('0x14')](0x1f4)[_0xd57c('0x15')](_0xd48930);}logger[_0xd57c('0x1a')](_0xd57c('0x20'));return _0x5cd59e['status'](0xc8)['json']({'output':_0xd57c('0x21')});});};exports['pull']=function(_0xa8ed7f,_0xe4b726){exec('npm\x20install\x20--production',function(_0x321d3b,_0x1322e8,_0x24888d){logger[_0xd57c('0x1a')](_0x1322e8);logger[_0xd57c('0x1a')](_0x24888d);if(_0x321d3b){logger[_0xd57c('0x19')](_0x321d3b);return _0xe4b726[_0xd57c('0x14')](0x1f4)[_0xd57c('0x15')](_0x321d3b);}return _0xe4b726[_0xd57c('0x14')](0xc8)[_0xd57c('0x15')]({'output':_0x1322e8});});};exports[_0xd57c('0x22')]=function(_0x59c3ed,_0x5d2b4d){return pm2[_0xd57c('0x22')]('motion2')[_0xd57c('0x23')](function(_0xa20f5f){logger[_0xd57c('0x1a')]('pm2\x20restart\x20motion\x20%s',_0xa20f5f);return _0x5d2b4d[_0xd57c('0x14')](0xc8)[_0xd57c('0x15')]({'output':_0xd57c('0x24')});})[_0xd57c('0x25')](function(_0x50d3bb){logger['error'](_0x50d3bb);return _0x5d2b4d['status'](0x1f4)[_0xd57c('0x15')](_0x50d3bb);});};exports[_0xd57c('0x26')]=function(_0x5e5bd9,_0x3d4532){var _0xad087d=fs[_0xd57c('0x27')](path[_0xd57c('0x28')](config['root'],_0xd57c('0x29'),'migrations'));var _0x5f10d8=[];for(var _0x225b39=0x0;_0x225b39<_0xad087d[_0xd57c('0x2a')];_0x225b39++){var _0x4c5b04=_0xad087d[_0x225b39][_0xd57c('0x2b')](_0xd57c('0x2c'),'');if(compareVersions(module[_0xd57c('0xe')][_0xd57c('0xf')],_0x4c5b04)===-0x1){_0x5f10d8[_0xd57c('0x2d')](_0x4c5b04);}}if(_0x5f10d8[_0xd57c('0x2a')]){var _0x15e563=_0x5f10d8[_0xd57c('0x2e')](compareVersions);var _0x15f98b=new Umzug({'storage':_0xd57c('0x2f'),'storageOptions':{'model':db[_0xd57c('0x30')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xd57c('0x2f')]['constructor'],function(){throw new Error(_0xd57c('0x31'));}],'path':path[_0xd57c('0x28')](config[_0xd57c('0xc')],_0xd57c('0x29'),'migrations'),'pattern':/\.js$/}});_0x15f98b['up']({'migrations':_[_0xd57c('0x32')](_0x15e563,function(_0x56006d){return _0x56006d+_0xd57c('0x2c');})})['then'](function(){return _0x3d4532[_0xd57c('0x14')](0xc8)[_0xd57c('0x15')]({'output':_0xd57c('0x33')+module['exports'][_0xd57c('0xf')]+_0xd57c('0x34')+_[_0xd57c('0x35')](_0x15e563),'migrations':_[_0xd57c('0x28')](_0x15e563)});})[_0xd57c('0x25')](function(_0x56dc10){if(_0x56dc10 instanceof db[_0xd57c('0x2f')]['UniqueConstraintError']){return _0x3d4532[_0xd57c('0x14')](0xc8)[_0xd57c('0x15')]({'output':_0xd57c('0x36')});}else{return _0x3d4532[_0xd57c('0x14')](0x1f4)['json'](_0x56dc10);}});}else{return _0x3d4532['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x1205=['fetch','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','../../config/logger','update','simple-git','root','index','exports','query','latest'];(function(_0x1e8bea,_0x47bde9){var _0x29f756=function(_0x37bb53){while(--_0x37bb53){_0x1e8bea['push'](_0x1e8bea['shift']());}};_0x29f756(++_0x47bde9);}(_0x1205,0x15e));var _0x5120=function(_0x146471,_0x5bdabb){_0x146471=_0x146471-0x0;var _0x47b65e=_0x1205[_0x146471];return _0x47b65e;};'use strict';var Umzug=require(_0x5120('0x0'));var path=require(_0x5120('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x5120('0x2'))(module,_0x5120('0x3'));var compareVersions=require(_0x5120('0x4'));var exec=require(_0x5120('0x5'))['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x5120('0x6'))(_0x5120('0x7'));var git=require(_0x5120('0x8'))(config[_0x5120('0x9')]);exports[_0x5120('0xa')]=function(_0x364117,_0x28dd49){var _0x118fe8={'current':module[_0x5120('0xb')][_0x5120('0x3')],'phonebar':0x2};if(_0x364117[_0x5120('0xc')]&&_0x364117['query'][_0x5120('0xd')]){return git[_0x5120('0xe')]()['tags'](function(_0x4834d6,_0x4045ec){_0x118fe8[_0x5120('0xd')]=(_0x4834d6?module[_0x5120('0xb')][_0x5120('0x3')]:_0x4045ec[_0x5120('0xd')])||_0x5120('0xf');return _0x28dd49[_0x5120('0x10')](0xc8)['json'](_0x118fe8);});}else{return _0x28dd49[_0x5120('0x10')](0xc8)[_0x5120('0x11')](_0x118fe8);}};exports[_0x5120('0xe')]=function(_0x23015c,_0x48e12b){return git[_0x5120('0xe')]([_0x5120('0x12'),'master'],function(_0xba4e0d){if(_0xba4e0d){logger[_0x5120('0x13')](_0xba4e0d);return _0x48e12b[_0x5120('0x10')](0x1f4)[_0x5120('0x11')](_0xba4e0d);}logger[_0x5120('0x14')](_0x5120('0x15'));return _0x48e12b['status'](0xc8)['json']({'output':_0x5120('0x16')});});};exports[_0x5120('0x17')]=function(_0x499bc9,_0xefe91){return git[_0x5120('0x17')]([_0x5120('0x18'),'FETCH_HEAD'],function(_0xee9a09){if(_0xee9a09){logger[_0x5120('0x13')](_0xee9a09);return _0xefe91['status'](0x1f4)[_0x5120('0x11')](_0xee9a09);}logger[_0x5120('0x14')](_0x5120('0x19'));return _0xefe91[_0x5120('0x10')](0xc8)['json']({'output':_0x5120('0x1a')});});};exports[_0x5120('0x1b')]=function(_0x345d46,_0x2149d1){exec(_0x5120('0x1c'),function(_0xec212c,_0x766256,_0x2e2191){logger[_0x5120('0x14')](_0x766256);logger[_0x5120('0x14')](_0x2e2191);if(_0xec212c){logger['error'](_0xec212c);return _0x2149d1[_0x5120('0x10')](0x1f4)['json'](_0xec212c);}return _0x2149d1[_0x5120('0x10')](0xc8)[_0x5120('0x11')]({'output':_0x766256});});};exports[_0x5120('0x1d')]=function(_0x3e341f,_0x3d8528){return pm2['restart'](_0x5120('0x1e'))['then'](function(_0x300553){logger[_0x5120('0x14')](_0x5120('0x1f'),_0x300553);return _0x3d8528[_0x5120('0x10')](0xc8)[_0x5120('0x11')]({'output':_0x5120('0x20')});})[_0x5120('0x21')](function(_0x3f64db){logger[_0x5120('0x13')](_0x3f64db);return _0x3d8528[_0x5120('0x10')](0x1f4)[_0x5120('0x11')](_0x3f64db);});};exports[_0x5120('0x22')]=function(_0x52a7ff,_0x1d9e7f){var _0x114631=fs['readdirSync'](path['join'](config['root'],_0x5120('0x23'),_0x5120('0x22')));var _0x5704a5=[];for(var _0x1af056=0x0;_0x1af056<_0x114631[_0x5120('0x24')];_0x1af056++){var _0x404834=_0x114631[_0x1af056][_0x5120('0x25')](_0x5120('0x26'),'');if(compareVersions(module[_0x5120('0xb')]['version'],_0x404834)===-0x1){_0x5704a5[_0x5120('0x27')](_0x404834);}}if(_0x5704a5[_0x5120('0x24')]){var _0x49134c=_0x5704a5[_0x5120('0x28')](compareVersions);var _0x4304b0=new Umzug({'storage':_0x5120('0x29'),'storageOptions':{'model':db[_0x5120('0x2a')],'modelName':_0x5120('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0x5120('0x29')][_0x5120('0x2b')](),db[_0x5120('0x29')][_0x5120('0x2c')],function(){throw new Error(_0x5120('0x2d'));}],'path':path['join'](config[_0x5120('0x9')],_0x5120('0x23'),_0x5120('0x22')),'pattern':/\.js$/}});_0x4304b0['up']({'migrations':_[_0x5120('0x2e')](_0x49134c,function(_0x4c76c9){return _0x4c76c9+_0x5120('0x26');})})['then'](function(){return _0x1d9e7f['status'](0xc8)['json']({'output':_0x5120('0x2f')+module[_0x5120('0xb')][_0x5120('0x3')]+_0x5120('0x30')+_[_0x5120('0x31')](_0x49134c),'migrations':_[_0x5120('0x32')](_0x49134c)});})[_0x5120('0x21')](function(_0x4f4aaf){if(_0x4f4aaf instanceof db[_0x5120('0x29')]['UniqueConstraintError']){return _0x1d9e7f['status'](0xc8)[_0x5120('0x11')]({'output':_0x5120('0x33')});}else{return _0x1d9e7f[_0x5120('0x10')](0x1f4)[_0x5120('0x11')](_0x4f4aaf);}});}else{return _0x1d9e7f[_0x5120('0x10')](0xc8)[_0x5120('0x11')]({'output':_0x5120('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 9db4e43..65fad8c 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 _0xda33=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x24fb18,_0x5057bd){var _0x48e04a=function(_0x46ddca){while(--_0x46ddca){_0x24fb18['push'](_0x24fb18['shift']());}};_0x48e04a(++_0x5057bd);}(_0xda33,0x125));var _0x3da3=function(_0x2e7c36,_0x1d9223){_0x2e7c36=_0x2e7c36-0x0;var _0x76bdf0=_0xda33[_0x2e7c36];return _0x76bdf0;};'use strict';var multer=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var path=require(_0x3da3('0x2'));var timeout=require(_0x3da3('0x3'));var express=require(_0x3da3('0x4'));var router=express[_0x3da3('0x5')]();var fs_extra=require(_0x3da3('0x6'));var auth=require(_0x3da3('0x7'));var interaction=require(_0x3da3('0x8'));var config=require('../../config/environment');var controller=require(_0x3da3('0x9'));router[_0x3da3('0xa')]('/',auth[_0x3da3('0xb')](),controller[_0x3da3('0xc')]);router[_0x3da3('0xa')](_0x3da3('0xd'),auth[_0x3da3('0xb')](),controller[_0x3da3('0xe')]);router[_0x3da3('0xa')](_0x3da3('0xf'),auth[_0x3da3('0xb')](),controller[_0x3da3('0x10')]);router[_0x3da3('0x11')]('/',auth['isAuthenticated'](),controller[_0x3da3('0x12')]);router[_0x3da3('0x13')](_0x3da3('0xf'),auth['isAuthenticated'](),controller[_0x3da3('0x14')]);router[_0x3da3('0x15')](_0x3da3('0xf'),auth[_0x3da3('0xb')](),controller[_0x3da3('0x16')]);module[_0x3da3('0x17')]=router; \ No newline at end of file +var _0xce33=['put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','show','create'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xce33,0x1f3));var _0x3ce3=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0xce33[_0xb7a459];return _0x104ab5;};'use strict';var multer=require('multer');var util=require(_0x3ce3('0x0'));var path=require(_0x3ce3('0x1'));var timeout=require(_0x3ce3('0x2'));var express=require(_0x3ce3('0x3'));var router=express[_0x3ce3('0x4')]();var fs_extra=require(_0x3ce3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3ce3('0x6'));var config=require(_0x3ce3('0x7'));var controller=require(_0x3ce3('0x8'));router[_0x3ce3('0x9')]('/',auth[_0x3ce3('0xa')](),controller['index']);router[_0x3ce3('0x9')](_0x3ce3('0xb'),auth[_0x3ce3('0xa')](),controller['describe']);router[_0x3ce3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3ce3('0xc')]);router['post']('/',auth[_0x3ce3('0xa')](),controller[_0x3ce3('0xd')]);router[_0x3ce3('0xe')](_0x3ce3('0xf'),auth[_0x3ce3('0xa')](),controller[_0x3ce3('0x10')]);router[_0x3ce3('0x11')](_0x3ce3('0xf'),auth[_0x3ce3('0xa')](),controller[_0x3ce3('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 3d7221e..f1d84be 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 _0x0abf=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'type':{'type':Sequelize[_0xf0ab('0x1')]},'uniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf0ab('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf0ab('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf0ab('0x2')]},'holdtime':{'type':Sequelize[_0xf0ab('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf0ab('0x3')]},'agentacw':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf0ab('0x1')]},'lastevent':{'type':Sequelize[_0xf0ab('0x1')]},'channel':{'type':Sequelize[_0xf0ab('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf0ab('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf0ab('0x1')]},'accountcode':{'type':Sequelize[_0xf0ab('0x1')]},'context':{'type':Sequelize[_0xf0ab('0x1')]},'exten':{'type':Sequelize[_0xf0ab('0x1')]},'priority':{'type':Sequelize[_0xf0ab('0x1')]},'destchannel':{'type':Sequelize[_0xf0ab('0x1')]},'destchannelstate':{'type':Sequelize[_0xf0ab('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf0ab('0x1')]},'destcalleridname':{'type':Sequelize[_0xf0ab('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf0ab('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf0ab('0x1')]},'destlanguage':{'type':Sequelize[_0xf0ab('0x1')]},'destaccountcode':{'type':Sequelize[_0xf0ab('0x1')]},'destcontext':{'type':Sequelize[_0xf0ab('0x1')]},'destexten':{'type':Sequelize[_0xf0ab('0x1')]},'destpriority':{'type':Sequelize[_0xf0ab('0x1')]},'destuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xf0ab('0x1')]},'transfer':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf0ab('0x1')],'comment':_0xf0ab('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'agententerreason':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8374=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x6a2228,_0x4a1d8b){var _0x2d7c81=function(_0x53bf1e){while(--_0x53bf1e){_0x6a2228['push'](_0x6a2228['shift']());}};_0x2d7c81(++_0x4a1d8b);}(_0x8374,0x174));var _0x4837=function(_0x39252d,_0x5b7bb7){_0x39252d=_0x39252d-0x0;var _0x4221d3=_0x8374[_0x39252d];return _0x4221d3;};'use strict';var Sequelize=require(_0x4837('0x0'));module[_0x4837('0x1')]={'type':{'type':Sequelize[_0x4837('0x2')]},'uniqueid':{'type':Sequelize[_0x4837('0x2')]},'calleridnum':{'type':Sequelize[_0x4837('0x2')]},'calleridname':{'type':Sequelize[_0x4837('0x2')]},'queue':{'type':Sequelize[_0x4837('0x2')]},'interface':{'type':Sequelize[_0x4837('0x2')]},'membername':{'type':Sequelize[_0x4837('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4837('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4837('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x4837('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4837('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4837('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4837('0x5')]},'agentacw':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4837('0x5')]},'reason':{'type':Sequelize[_0x4837('0x2')]},'lastevent':{'type':Sequelize[_0x4837('0x2')]},'channel':{'type':Sequelize[_0x4837('0x2')]},'channelstate':{'type':Sequelize[_0x4837('0x5')]},'channelstatedesc':{'type':Sequelize[_0x4837('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4837('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4837('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4837('0x2')]},'priority':{'type':Sequelize[_0x4837('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4837('0x2')]},'destcalleridname':{'type':Sequelize[_0x4837('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4837('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4837('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4837('0x2')]},'destcontext':{'type':Sequelize[_0x4837('0x2')]},'destexten':{'type':Sequelize[_0x4837('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4837('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4837('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4837('0x2')],'comment':_0x4837('0x6')},'transferexten':{'type':Sequelize[_0x4837('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4837('0x2')]},'agententerreason':{'type':Sequelize[_0x4837('0x5')],'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 d48eb5f..2b14c9b 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(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 f2ddb77..0f1236e 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 _0x9879=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util'];(function(_0x5e2b34,_0x58385c){var _0x4859f9=function(_0x177263){while(--_0x177263){_0x5e2b34['push'](_0x5e2b34['shift']());}};_0x4859f9(++_0x58385c);}(_0x9879,0x98));var _0x9987=function(_0x42e658,_0x105914){_0x42e658=_0x42e658-0x0;var _0x5df48c=_0x9879[_0x42e658];return _0x5df48c;};'use strict';var _=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var logger=require(_0x9987('0x2'))('api');var moment=require(_0x9987('0x3'));var BPromise=require('bluebird');var rp=require(_0x9987('0x4'));var fs=require('fs');var path=require(_0x9987('0x5'));var rimraf=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var attributes=require(_0x9987('0x8'));module[_0x9987('0x9')]=function(_0x4258df,_0x4d479d){return _0x4258df[_0x9987('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x9987('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9987('0xc'),_0x9987('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb57=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','api','bluebird','path','rimraf','./voiceAgentReport.attributes','exports'];(function(_0x966478,_0x5b7b09){var _0x5ec091=function(_0x2fa540){while(--_0x2fa540){_0x966478['push'](_0x966478['shift']());}};_0x5ec091(++_0x5b7b09);}(_0xcb57,0xa1));var _0x7cb5=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xcb57[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x7cb5('0x0'));var util=require(_0x7cb5('0x1'));var logger=require('../../config/logger')(_0x7cb5('0x2'));var moment=require('moment');var BPromise=require(_0x7cb5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cb5('0x4'));var rimraf=require(_0x7cb5('0x5'));var config=require('../../config/environment');var attributes=require(_0x7cb5('0x6'));module[_0x7cb5('0x7')]=function(_0x1aafb5,_0x4e036d){return _0x1aafb5[_0x7cb5('0x8')](_0x7cb5('0x9'),attributes,{'tableName':_0x7cb5('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7cb5('0xb'),_0x7cb5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0eb4786..6200812 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 _0xb90e=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','catch','UpdateVoiceAgentReport','update','where','attributes','limit'];(function(_0x23c49f,_0x2df27e){var _0x24cdb7=function(_0x42ff58){while(--_0x42ff58){_0x23c49f['push'](_0x23c49f['shift']());}};_0x24cdb7(++_0x2df27e);}(_0xb90e,0x1b0));var _0xeb90=function(_0x94963d,_0x339635){_0x94963d=_0x94963d-0x0;var _0x472d16=_0xb90e[_0x94963d];return _0x472d16;};'use strict';var _=require(_0xeb90('0x0'));var util=require(_0xeb90('0x1'));var moment=require('moment');var BPromise=require(_0xeb90('0x2'));var rs=require(_0xeb90('0x3'));var fs=require('fs');var Redis=require(_0xeb90('0x4'));var db=require(_0xeb90('0x5'))['db'];var utils=require(_0xeb90('0x6'));var logger=require(_0xeb90('0x7'))(_0xeb90('0x8'));var config=require(_0xeb90('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb90('0xa')][_0xeb90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c08c,_0x9302b7,_0x5b23b4){return new BPromise(function(_0xba6b14,_0x32fb2f){return client[_0xeb90('0xc')](_0x18c08c,_0x5b23b4)[_0xeb90('0xd')](function(_0xae7fe0){logger[_0xeb90('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x9302b7,_0xeb90('0xf'));logger[_0xeb90('0x10')](_0xeb90('0x11'),_0x9302b7,_0xeb90('0xf'),JSON[_0xeb90('0x12')](_0xae7fe0));if(_0xae7fe0[_0xeb90('0x13')]){if(_0xae7fe0[_0xeb90('0x13')][_0xeb90('0x14')]===0x1f4){logger[_0xeb90('0x13')](_0xeb90('0x15'),_0x9302b7,_0xae7fe0[_0xeb90('0x13')]['message']);return _0x32fb2f(_0xae7fe0[_0xeb90('0x13')][_0xeb90('0x16')]);}logger[_0xeb90('0x13')](_0xeb90('0x15'),_0x9302b7,_0xae7fe0[_0xeb90('0x13')]['message']);return _0xba6b14(_0xae7fe0[_0xeb90('0x13')][_0xeb90('0x16')]);}else{logger[_0xeb90('0xe')](_0xeb90('0x15'),_0x9302b7,_0xeb90('0xf'));_0xba6b14(_0xae7fe0[_0xeb90('0x17')][_0xeb90('0x16')]);}})['catch'](function(_0x2d0ab5){logger['error'](_0xeb90('0x15'),_0x9302b7,_0x2d0ab5);_0x32fb2f(_0x2d0ab5);});});}exports['CreateVoiceAgentReport']=function(_0x58eae7){var _0x1f97fe=this;return new Promise(function(_0xbe4d03,_0x455b6d){return db[_0xeb90('0x18')][_0xeb90('0x19')](_0x58eae7[_0xeb90('0x1a')],{'raw':_0x58eae7[_0xeb90('0x1b')]?_0x58eae7[_0xeb90('0x1b')][_0xeb90('0x1c')]===undefined?!![]:![]:!![]})[_0xeb90('0xd')](function(_0x8ac9ca){logger[_0xeb90('0xe')](_0xeb90('0x1d'),_0x58eae7);logger[_0xeb90('0x10')](_0xeb90('0x1d'),_0x58eae7,JSON[_0xeb90('0x12')](_0x8ac9ca));_0xbe4d03(_0x8ac9ca);})[_0xeb90('0x1e')](function(_0x251aa3){logger[_0xeb90('0x13')](_0xeb90('0x1d'),_0x251aa3[_0xeb90('0x16')],_0x58eae7);_0x455b6d(_0x1f97fe['error'](0x1f4,_0x251aa3['message']));});});};exports[_0xeb90('0x1f')]=function(_0x2d84bb){var _0x379c2b=this;return new Promise(function(_0x2dda18,_0x36068c){return db['VoiceAgentReport'][_0xeb90('0x20')](_0x2d84bb[_0xeb90('0x1a')],{'raw':_0x2d84bb[_0xeb90('0x1b')]?_0x2d84bb['options'][_0xeb90('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d84bb[_0xeb90('0x1b')]?_0x2d84bb[_0xeb90('0x1b')][_0xeb90('0x21')]||null:null,'attributes':_0x2d84bb[_0xeb90('0x1b')]?_0x2d84bb[_0xeb90('0x1b')][_0xeb90('0x22')]||null:null,'limit':_0x2d84bb[_0xeb90('0x1b')]?_0x2d84bb[_0xeb90('0x1b')][_0xeb90('0x23')]||null:null})[_0xeb90('0xd')](function(_0x5d42c7){logger[_0xeb90('0xe')](_0xeb90('0x1f'),_0x2d84bb);logger[_0xeb90('0x10')](_0xeb90('0x1f'),_0x2d84bb,JSON['stringify'](_0x5d42c7));_0x2dda18(_0x5d42c7);})[_0xeb90('0x1e')](function(_0x8748d4){logger[_0xeb90('0x13')]('UpdateVoiceAgentReport',_0x8748d4[_0xeb90('0x16')],_0x2d84bb);_0x36068c(_0x379c2b[_0xeb90('0x13')](0x1f4,_0x8748d4[_0xeb90('0x16')]));});});}; \ No newline at end of file +var _0x7f1c=['stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','raw','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x44f252,_0x11ec11){var _0x2ede04=function(_0x3175a2){while(--_0x3175a2){_0x44f252['push'](_0x44f252['shift']());}};_0x2ede04(++_0x11ec11);}(_0x7f1c,0x77));var _0xc7f1=function(_0x3deb78,_0x5b8496){_0x3deb78=_0x3deb78-0x0;var _0x4d9808=_0x7f1c[_0x3deb78];return _0x4d9808;};'use strict';var _=require(_0xc7f1('0x0'));var util=require(_0xc7f1('0x1'));var moment=require('moment');var BPromise=require(_0xc7f1('0x2'));var rs=require(_0xc7f1('0x3'));var fs=require('fs');var Redis=require(_0xc7f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7f1('0x5'));var logger=require(_0xc7f1('0x6'))(_0xc7f1('0x7'));var config=require(_0xc7f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc7f1('0x9')][_0xc7f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf622f8,_0x3a1828,_0x364631){return new BPromise(function(_0x2cb888,_0x30624d){return client[_0xc7f1('0xb')](_0xf622f8,_0x364631)[_0xc7f1('0xc')](function(_0x220fb6){logger[_0xc7f1('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3a1828,_0xc7f1('0xe'));logger[_0xc7f1('0xf')](_0xc7f1('0x10'),_0x3a1828,_0xc7f1('0xe'),JSON[_0xc7f1('0x11')](_0x220fb6));if(_0x220fb6['error']){if(_0x220fb6[_0xc7f1('0x12')][_0xc7f1('0x13')]===0x1f4){logger[_0xc7f1('0x12')](_0xc7f1('0x14'),_0x3a1828,_0x220fb6[_0xc7f1('0x12')][_0xc7f1('0x15')]);return _0x30624d(_0x220fb6['error'][_0xc7f1('0x15')]);}logger['error'](_0xc7f1('0x14'),_0x3a1828,_0x220fb6[_0xc7f1('0x12')][_0xc7f1('0x15')]);return _0x2cb888(_0x220fb6['error'][_0xc7f1('0x15')]);}else{logger[_0xc7f1('0xd')](_0xc7f1('0x14'),_0x3a1828,_0xc7f1('0xe'));_0x2cb888(_0x220fb6[_0xc7f1('0x16')][_0xc7f1('0x15')]);}})[_0xc7f1('0x17')](function(_0x4ad91f){logger[_0xc7f1('0x12')](_0xc7f1('0x14'),_0x3a1828,_0x4ad91f);_0x30624d(_0x4ad91f);});});}exports[_0xc7f1('0x18')]=function(_0xc4a55d){var _0x25c67c=this;return new Promise(function(_0x24e83b,_0x404ebb){return db[_0xc7f1('0x19')][_0xc7f1('0x1a')](_0xc4a55d[_0xc7f1('0x1b')],{'raw':_0xc4a55d[_0xc7f1('0x1c')]?_0xc4a55d['options']['raw']===undefined?!![]:![]:!![]})[_0xc7f1('0xc')](function(_0x4fb72d){logger[_0xc7f1('0xd')](_0xc7f1('0x18'),_0xc4a55d);logger[_0xc7f1('0xf')](_0xc7f1('0x18'),_0xc4a55d,JSON['stringify'](_0x4fb72d));_0x24e83b(_0x4fb72d);})[_0xc7f1('0x17')](function(_0x413f4e){logger[_0xc7f1('0x12')](_0xc7f1('0x18'),_0x413f4e[_0xc7f1('0x15')],_0xc4a55d);_0x404ebb(_0x25c67c[_0xc7f1('0x12')](0x1f4,_0x413f4e[_0xc7f1('0x15')]));});});};exports[_0xc7f1('0x1d')]=function(_0x28c7d8){var _0x168f02=this;return new Promise(function(_0x2ac4ae,_0x17fe85){return db['VoiceAgentReport'][_0xc7f1('0x1e')](_0x28c7d8[_0xc7f1('0x1b')],{'raw':_0x28c7d8[_0xc7f1('0x1c')]?_0x28c7d8[_0xc7f1('0x1c')][_0xc7f1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28c7d8[_0xc7f1('0x1c')]?_0x28c7d8[_0xc7f1('0x1c')][_0xc7f1('0x20')]||null:null,'attributes':_0x28c7d8['options']?_0x28c7d8[_0xc7f1('0x1c')][_0xc7f1('0x21')]||null:null,'limit':_0x28c7d8[_0xc7f1('0x1c')]?_0x28c7d8['options']['limit']||null:null})[_0xc7f1('0xc')](function(_0x5aa925){logger[_0xc7f1('0xd')](_0xc7f1('0x1d'),_0x28c7d8);logger['debug']('UpdateVoiceAgentReport',_0x28c7d8,JSON[_0xc7f1('0x11')](_0x5aa925));_0x2ac4ae(_0x5aa925);})['catch'](function(_0xa0f203){logger['error'](_0xc7f1('0x1d'),_0xa0f203['message'],_0x28c7d8);_0x17fe85(_0x168f02['error'](0x1f4,_0xa0f203['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 5a6cc70..fbe9426 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 _0xaba6=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x8b6151,_0x5139f3){var _0x31592c=function(_0x25a6c4){while(--_0x25a6c4){_0x8b6151['push'](_0x8b6151['shift']());}};_0x31592c(++_0x5139f3);}(_0xaba6,0xe2));var _0x6aba=function(_0xcada36,_0x12c897){_0xcada36=_0xcada36-0x0;var _0x58353a=_0xaba6[_0xcada36];return _0x58353a;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/describe',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['get'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller['show']);router[_0x6aba('0xa')]('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);router['delete'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xe')]);module[_0x6aba('0xf')]=router; \ No newline at end of file +var _0xb458=['./voiceCallReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x42af3a,_0x2aafb9){var _0x14d099=function(_0x14a06d){while(--_0x14a06d){_0x42af3a['push'](_0x42af3a['shift']());}};_0x14d099(++_0x2aafb9);}(_0xb458,0x103));var _0x8b45=function(_0x4f6272,_0x53b79c){_0x4f6272=_0x4f6272-0x0;var _0x1b5ae5=_0xb458[_0x4f6272];return _0x1b5ae5;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xc')]);router['get'](_0x8b45('0xd'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xe')]);router[_0x8b45('0xf')]('/',auth[_0x8b45('0xb')](),controller['create']);router[_0x8b45('0x10')](_0x8b45('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8b45('0xb')](),controller[_0x8b45('0x11')]);module[_0x8b45('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 08b84ad..2317ba8 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 _0x974c=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound','inbound-fax','dialer'];(function(_0x385358,_0x4aebf7){var _0x5bd30f=function(_0x552c4f){while(--_0x552c4f){_0x385358['push'](_0x385358['shift']());}};_0x5bd30f(++_0x4aebf7);}(_0x974c,0xd4));var _0xc974=function(_0x357e14,_0x181b86){_0x357e14=_0x357e14-0x0;var _0x4df0cb=_0x974c[_0x357e14];return _0x4df0cb;};'use strict';var Sequelize=require(_0xc974('0x0'));module[_0xc974('0x1')]={'uniqueid':{'type':Sequelize[_0xc974('0x2')]},'type':{'type':Sequelize[_0xc974('0x3')]('inbound',_0xc974('0x4'),_0xc974('0x5'),_0xc974('0x6'),'outbound-fax',_0xc974('0x7'))},'tag':{'type':Sequelize[_0xc974('0x2')]},'accountcode':{'type':Sequelize[_0xc974('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xc974('0x2')]},'destinationcontext':{'type':Sequelize[_0xc974('0x2')]},'callerid':{'type':Sequelize[_0xc974('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xc974('0x2')]},'lastapplication':{'type':Sequelize[_0xc974('0x2')]},'lastdata':{'type':Sequelize[_0xc974('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xc974('0x9')]},'answertime':{'type':Sequelize[_0xc974('0x9')]},'endtime':{'type':Sequelize[_0xc974('0x9')]},'duration':{'type':Sequelize[_0xc974('0xa')]},'billableseconds':{'type':Sequelize[_0xc974('0xa')]},'mohtime':{'type':Sequelize[_0xc974('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc974('0x2')]},'amaflags':{'type':Sequelize[_0xc974('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc974('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xc974('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc974('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xc974('0x2')]}}; \ No newline at end of file +var _0xe900=['inbound','outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM'];(function(_0x19d70e,_0x30afe6){var _0x28dd2c=function(_0xf3360d){while(--_0xf3360d){_0x19d70e['push'](_0x19d70e['shift']());}};_0x28dd2c(++_0x30afe6);}(_0xe900,0x89));var _0x0e90=function(_0x4c9020,_0x599c7b){_0x4c9020=_0x4c9020-0x0;var _0x3bfef2=_0xe900[_0x4c9020];return _0x3bfef2;};'use strict';var Sequelize=require(_0x0e90('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0e90('0x1')]},'type':{'type':Sequelize[_0x0e90('0x2')](_0x0e90('0x3'),'internal',_0x0e90('0x4'),_0x0e90('0x5'),'outbound-fax',_0x0e90('0x6'))},'tag':{'type':Sequelize[_0x0e90('0x1')]},'accountcode':{'type':Sequelize[_0x0e90('0x1')]},'source':{'type':Sequelize[_0x0e90('0x1')]},'destination':{'type':Sequelize[_0x0e90('0x1')]},'destinationcontext':{'type':Sequelize[_0x0e90('0x1')]},'callerid':{'type':Sequelize[_0x0e90('0x1')]},'channel':{'type':Sequelize[_0x0e90('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0e90('0x1')]},'lastdata':{'type':Sequelize[_0x0e90('0x7')]},'starttime':{'type':Sequelize[_0x0e90('0x8')]},'systemanswertime':{'type':Sequelize[_0x0e90('0x8')]},'answertime':{'type':Sequelize[_0x0e90('0x8')]},'endtime':{'type':Sequelize[_0x0e90('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x0e90('0x9')]},'mohtime':{'type':Sequelize[_0x0e90('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0e90('0x1')]},'amaflags':{'type':Sequelize[_0x0e90('0x1')]},'userfield':{'type':Sequelize[_0x0e90('0x1')]},'userDisposition':{'type':Sequelize[_0x0e90('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x0e90('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0e90('0x1')]},'routeid':{'type':Sequelize[_0x0e90('0x9')]},'sipcallid':{'type':Sequelize[_0x0e90('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index db89038..d69d433 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x58ebd7,_0x1fb820){var _0x22e8e1=function(_0x25e208){while(--_0x25e208){_0x58ebd7['push'](_0x58ebd7['shift']());}};_0x22e8e1(++_0x1fb820);}(_0xb10b,0x12a));var _0xbb10=function(_0x5da73f,_0x592980){_0x5da73f=_0x5da73f-0x0;var _0x1b3d73=_0xb10b[_0x5da73f];return _0x1b3d73;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xadb5,0xad));var _0x5adb=function(_0x405b57,_0x5e8109){_0x405b57=_0x405b57-0x0;var _0x2f9919=_0xadb5[_0x405b57];return _0x2f9919;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 93c1686..6ccfc63 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 _0x86be=['exports','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x39af08,_0x349b04){var _0x412615=function(_0x38918f){while(--_0x38918f){_0x39af08['push'](_0x39af08['shift']());}};_0x412615(++_0x349b04);}(_0x86be,0x1b5));var _0xe86b=function(_0x1b7ee8,_0x3eaac2){_0x1b7ee8=_0x1b7ee8-0x0;var _0x5b4c0f=_0x86be[_0x1b7ee8];return _0x5b4c0f;};'use strict';var _=require(_0xe86b('0x0'));var util=require(_0xe86b('0x1'));var logger=require(_0xe86b('0x2'))(_0xe86b('0x3'));var moment=require(_0xe86b('0x4'));var BPromise=require(_0xe86b('0x5'));var rp=require(_0xe86b('0x6'));var fs=require('fs');var path=require(_0xe86b('0x7'));var rimraf=require(_0xe86b('0x8'));var config=require(_0xe86b('0x9'));var attributes=require(_0xe86b('0xa'));module[_0xe86b('0xb')]=function(_0x49e603,_0x1ab12c){return _0x49e603['define'](_0xe86b('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xe86b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcfbf=['./voiceCallReport.attributes','exports','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfbf,0x1b4));var _0xfcfb=function(_0x25a66a,_0x4602b8){_0x25a66a=_0x25a66a-0x0;var _0x10899f=_0xcfbf[_0x25a66a];return _0x10899f;};'use strict';var _=require('lodash');var util=require(_0xfcfb('0x0'));var logger=require(_0xfcfb('0x1'))(_0xfcfb('0x2'));var moment=require(_0xfcfb('0x3'));var BPromise=require(_0xfcfb('0x4'));var rp=require(_0xfcfb('0x5'));var fs=require('fs');var path=require(_0xfcfb('0x6'));var rimraf=require(_0xfcfb('0x7'));var config=require('../../config/environment');var attributes=require(_0xfcfb('0x8'));module[_0xfcfb('0x9')]=function(_0x1f4ebe,_0x40830d){return _0x1f4ebe['define']('VoiceCallReport',attributes,{'tableName':_0xfcfb('0xa'),'paranoid':![],'indexes':[{'fields':[_0xfcfb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 5da18fa..f29e8f0 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 _0x6cb6=['model','CreateVoiceCallReport','create','body','stringify','UpdateVoiceCallReport','update','where','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map'];(function(_0x109946,_0x3494b7){var _0x4ed20b=function(_0x578aa4){while(--_0x578aa4){_0x109946['push'](_0x109946['shift']());}};_0x4ed20b(++_0x3494b7);}(_0x6cb6,0x1d0));var _0x66cb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6cb6[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0x66cb('0x0'));var moment=require('moment');var BPromise=require(_0x66cb('0x1'));var rs=require(_0x66cb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x66cb('0x3'));var logger=require(_0x66cb('0x4'))(_0x66cb('0x5'));var config=require(_0x66cb('0x6'));var jayson=require(_0x66cb('0x7'));var client=jayson['client'][_0x66cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cb029,_0x272717,_0x4b026c){return new BPromise(function(_0x49ba76,_0x553d04){return client[_0x66cb('0x9')](_0x1cb029,_0x4b026c)[_0x66cb('0xa')](function(_0x2f5769){logger[_0x66cb('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x272717,_0x66cb('0xc'));logger[_0x66cb('0xd')](_0x66cb('0xe'),_0x272717,_0x66cb('0xc'),JSON['stringify'](_0x2f5769));if(_0x2f5769[_0x66cb('0xf')]){if(_0x2f5769['error'][_0x66cb('0x10')]===0x1f4){logger['error'](_0x66cb('0x11'),_0x272717,_0x2f5769[_0x66cb('0xf')][_0x66cb('0x12')]);return _0x553d04(_0x2f5769[_0x66cb('0xf')][_0x66cb('0x12')]);}logger[_0x66cb('0xf')](_0x66cb('0x11'),_0x272717,_0x2f5769[_0x66cb('0xf')][_0x66cb('0x12')]);return _0x49ba76(_0x2f5769['error'][_0x66cb('0x12')]);}else{logger['info'](_0x66cb('0x11'),_0x272717,'request\x20sent');_0x49ba76(_0x2f5769[_0x66cb('0x13')][_0x66cb('0x12')]);}})[_0x66cb('0x14')](function(_0x10a7da){logger['error'](_0x66cb('0x11'),_0x272717,_0x10a7da);_0x553d04(_0x10a7da);});});}exports[_0x66cb('0x15')]=function(_0x5b5481){var _0x9286d7=this;return new Promise(function(_0x146c7,_0x594c85){return db[_0x66cb('0x16')][_0x66cb('0x17')]({'raw':_0x5b5481[_0x66cb('0x18')]?_0x5b5481[_0x66cb('0x18')][_0x66cb('0x19')]===undefined?!![]:![]:!![],'where':_0x5b5481[_0x66cb('0x18')]?_0x5b5481['options']['where']||null:null,'attributes':_0x5b5481[_0x66cb('0x18')]?_0x5b5481[_0x66cb('0x18')][_0x66cb('0x1a')]||null:null,'limit':_0x5b5481[_0x66cb('0x18')]?_0x5b5481[_0x66cb('0x18')][_0x66cb('0x1b')]||null:null,'include':_0x5b5481[_0x66cb('0x18')]?_0x5b5481[_0x66cb('0x18')][_0x66cb('0x1c')]?_[_0x66cb('0x1d')](_0x5b5481[_0x66cb('0x18')][_0x66cb('0x1c')],function(_0x4464dd){return{'model':db[_0x4464dd[_0x66cb('0x1e')]],'as':_0x4464dd['as'],'attributes':_0x4464dd['attributes'],'include':_0x4464dd[_0x66cb('0x1c')]?_[_0x66cb('0x1d')](_0x4464dd[_0x66cb('0x1c')],function(_0x1d2c2b){return{'model':db[_0x1d2c2b[_0x66cb('0x1e')]],'as':_0x1d2c2b['as'],'attributes':_0x1d2c2b[_0x66cb('0x1a')],'include':_0x1d2c2b[_0x66cb('0x1c')]?_[_0x66cb('0x1d')](_0x1d2c2b[_0x66cb('0x1c')],function(_0x2a50a7){return{'model':db[_0x2a50a7[_0x66cb('0x1e')]],'as':_0x2a50a7['as'],'attributes':_0x2a50a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x66cb('0xa')](function(_0x3d287e){logger[_0x66cb('0xb')](_0x66cb('0x15'),_0x5b5481);logger[_0x66cb('0xd')](_0x66cb('0x15'),_0x5b5481,JSON['stringify'](_0x3d287e));_0x146c7(_0x3d287e);})[_0x66cb('0x14')](function(_0x523416){logger['error'](_0x66cb('0x15'),_0x523416['message'],_0x5b5481);_0x594c85(_0x9286d7[_0x66cb('0xf')](0x1f4,_0x523416[_0x66cb('0x12')]));});});};exports[_0x66cb('0x1f')]=function(_0x2c22ee){var _0x44c79e=this;return new Promise(function(_0x6ab55e,_0x1c0a4e){return db[_0x66cb('0x16')][_0x66cb('0x20')](_0x2c22ee[_0x66cb('0x21')],{'raw':_0x2c22ee[_0x66cb('0x18')]?_0x2c22ee[_0x66cb('0x18')][_0x66cb('0x19')]===undefined?!![]:![]:!![]})[_0x66cb('0xa')](function(_0x51d123){logger['info'](_0x66cb('0x1f'),_0x2c22ee);logger['debug'](_0x66cb('0x1f'),_0x2c22ee,JSON[_0x66cb('0x22')](_0x51d123));_0x6ab55e(_0x51d123);})[_0x66cb('0x14')](function(_0x28efca){logger[_0x66cb('0xf')](_0x66cb('0x1f'),_0x28efca[_0x66cb('0x12')],_0x2c22ee);_0x1c0a4e(_0x44c79e[_0x66cb('0xf')](0x1f4,_0x28efca[_0x66cb('0x12')]));});});};exports[_0x66cb('0x23')]=function(_0x5643fb){var _0x43c380=this;return new Promise(function(_0x3d0000,_0x4333f0){return db['VoiceCallReport'][_0x66cb('0x24')](_0x5643fb[_0x66cb('0x21')],{'raw':_0x5643fb[_0x66cb('0x18')]?_0x5643fb[_0x66cb('0x18')][_0x66cb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5643fb[_0x66cb('0x18')]?_0x5643fb[_0x66cb('0x18')][_0x66cb('0x25')]||null:null,'attributes':_0x5643fb['options']?_0x5643fb[_0x66cb('0x18')][_0x66cb('0x1a')]||null:null,'limit':_0x5643fb[_0x66cb('0x18')]?_0x5643fb[_0x66cb('0x18')][_0x66cb('0x1b')]||null:null})[_0x66cb('0xa')](function(_0x13a26b){logger[_0x66cb('0xb')]('UpdateVoiceCallReport',_0x5643fb);logger[_0x66cb('0xd')]('UpdateVoiceCallReport',_0x5643fb,JSON[_0x66cb('0x22')](_0x13a26b));_0x3d0000(_0x13a26b);})['catch'](function(_0x58a277){logger['error'](_0x66cb('0x23'),_0x58a277[_0x66cb('0x12')],_0x5643fb);_0x4333f0(_0x43c380[_0x66cb('0xf')](0x1f4,_0x58a277[_0x66cb('0x12')]));});});}; \ No newline at end of file +var _0x804f=['CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','VoiceCallReport,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x804f,0x15c));var _0xf804=function(_0x341408,_0x105312){_0x341408=_0x341408-0x0;var _0x1c87ce=_0x804f[_0x341408];return _0x1c87ce;};'use strict';var _=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var moment=require('moment');var BPromise=require(_0xf804('0x2'));var rs=require(_0xf804('0x3'));var fs=require('fs');var Redis=require(_0xf804('0x4'));var db=require(_0xf804('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf804('0x6'))(_0xf804('0x7'));var config=require('../../config/environment');var jayson=require(_0xf804('0x8'));var client=jayson[_0xf804('0x9')][_0xf804('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d3868,_0x5db8e4,_0x43a4eb){return new BPromise(function(_0x3e0b7c,_0x3e6ded){return client['request'](_0x5d3868,_0x43a4eb)[_0xf804('0xb')](function(_0x59f5e8){logger[_0xf804('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x5db8e4,'request\x20sent');logger['debug'](_0xf804('0xd'),_0x5db8e4,'request\x20sent',JSON['stringify'](_0x59f5e8));if(_0x59f5e8[_0xf804('0xe')]){if(_0x59f5e8[_0xf804('0xe')]['code']===0x1f4){logger[_0xf804('0xe')](_0xf804('0xf'),_0x5db8e4,_0x59f5e8[_0xf804('0xe')][_0xf804('0x10')]);return _0x3e6ded(_0x59f5e8['error']['message']);}logger[_0xf804('0xe')](_0xf804('0xf'),_0x5db8e4,_0x59f5e8['error'][_0xf804('0x10')]);return _0x3e0b7c(_0x59f5e8[_0xf804('0xe')][_0xf804('0x10')]);}else{logger['info'](_0xf804('0xf'),_0x5db8e4,_0xf804('0x11'));_0x3e0b7c(_0x59f5e8[_0xf804('0x12')]['message']);}})[_0xf804('0x13')](function(_0x4edb3f){logger[_0xf804('0xe')](_0xf804('0xf'),_0x5db8e4,_0x4edb3f);_0x3e6ded(_0x4edb3f);});});}exports[_0xf804('0x14')]=function(_0x14343b){var _0x22c059=this;return new Promise(function(_0x1243ea,_0x3639ad){return db['VoiceCallReport'][_0xf804('0x15')]({'raw':_0x14343b['options']?_0x14343b[_0xf804('0x16')][_0xf804('0x17')]===undefined?!![]:![]:!![],'where':_0x14343b[_0xf804('0x16')]?_0x14343b[_0xf804('0x16')][_0xf804('0x18')]||null:null,'attributes':_0x14343b['options']?_0x14343b[_0xf804('0x16')][_0xf804('0x19')]||null:null,'limit':_0x14343b[_0xf804('0x16')]?_0x14343b[_0xf804('0x16')][_0xf804('0x1a')]||null:null,'include':_0x14343b['options']?_0x14343b[_0xf804('0x16')][_0xf804('0x1b')]?_[_0xf804('0x1c')](_0x14343b['options'][_0xf804('0x1b')],function(_0x280787){return{'model':db[_0x280787[_0xf804('0x1d')]],'as':_0x280787['as'],'attributes':_0x280787[_0xf804('0x19')],'include':_0x280787[_0xf804('0x1b')]?_[_0xf804('0x1c')](_0x280787[_0xf804('0x1b')],function(_0x15cbcc){return{'model':db[_0x15cbcc[_0xf804('0x1d')]],'as':_0x15cbcc['as'],'attributes':_0x15cbcc[_0xf804('0x19')],'include':_0x15cbcc[_0xf804('0x1b')]?_[_0xf804('0x1c')](_0x15cbcc[_0xf804('0x1b')],function(_0x27ae6b){return{'model':db[_0x27ae6b[_0xf804('0x1d')]],'as':_0x27ae6b['as'],'attributes':_0x27ae6b[_0xf804('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf804('0xb')](function(_0x85f424){logger[_0xf804('0xc')](_0xf804('0x14'),_0x14343b);logger[_0xf804('0x1e')]('GetVoiceCallReport',_0x14343b,JSON[_0xf804('0x1f')](_0x85f424));_0x1243ea(_0x85f424);})[_0xf804('0x13')](function(_0x13aeab){logger[_0xf804('0xe')]('GetVoiceCallReport',_0x13aeab[_0xf804('0x10')],_0x14343b);_0x3639ad(_0x22c059[_0xf804('0xe')](0x1f4,_0x13aeab[_0xf804('0x10')]));});});};exports[_0xf804('0x20')]=function(_0x71f66a){var _0x3a2dd2=this;return new Promise(function(_0x864bbb,_0x2360f3){return db[_0xf804('0x21')][_0xf804('0x22')](_0x71f66a[_0xf804('0x23')],{'raw':_0x71f66a[_0xf804('0x16')]?_0x71f66a[_0xf804('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xf804('0xb')](function(_0x200dec){logger[_0xf804('0xc')](_0xf804('0x20'),_0x71f66a);logger['debug']('CreateVoiceCallReport',_0x71f66a,JSON[_0xf804('0x1f')](_0x200dec));_0x864bbb(_0x200dec);})[_0xf804('0x13')](function(_0x130aa2){logger[_0xf804('0xe')](_0xf804('0x20'),_0x130aa2[_0xf804('0x10')],_0x71f66a);_0x2360f3(_0x3a2dd2[_0xf804('0xe')](0x1f4,_0x130aa2['message']));});});};exports[_0xf804('0x24')]=function(_0x3c4f42){var _0x2dfe71=this;return new Promise(function(_0x7e2e7f,_0x301ee2){return db[_0xf804('0x21')][_0xf804('0x25')](_0x3c4f42[_0xf804('0x23')],{'raw':_0x3c4f42[_0xf804('0x16')]?_0x3c4f42[_0xf804('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c4f42[_0xf804('0x16')]?_0x3c4f42['options'][_0xf804('0x18')]||null:null,'attributes':_0x3c4f42[_0xf804('0x16')]?_0x3c4f42['options'][_0xf804('0x19')]||null:null,'limit':_0x3c4f42[_0xf804('0x16')]?_0x3c4f42[_0xf804('0x16')][_0xf804('0x1a')]||null:null})[_0xf804('0xb')](function(_0x36f4ed){logger[_0xf804('0xc')](_0xf804('0x24'),_0x3c4f42);logger[_0xf804('0x1e')](_0xf804('0x24'),_0x3c4f42,JSON[_0xf804('0x1f')](_0x36f4ed));_0x7e2e7f(_0x36f4ed);})['catch'](function(_0x2526d4){logger['error'](_0xf804('0x24'),_0x2526d4[_0xf804('0x10')],_0x3c4f42);_0x301ee2(_0x2dfe71[_0xf804('0xe')](0x1f4,_0x2526d4[_0xf804('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9f3dcdc..d8c8ce4 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 _0x86ff=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceChanSpy.controller'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x86ff,0x174));var _0xf86f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86ff[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf86f('0x0'));var util=require(_0xf86f('0x1'));var path=require('path');var timeout=require(_0xf86f('0x2'));var express=require(_0xf86f('0x3'));var router=express[_0xf86f('0x4')]();var fs_extra=require(_0xf86f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf86f('0x6'));var config=require('../../config/environment');var controller=require(_0xf86f('0x7'));router[_0xf86f('0x8')]('/',auth[_0xf86f('0x9')](),controller['index']);router['get'](_0xf86f('0xa'),auth[_0xf86f('0x9')](),controller[_0xf86f('0xb')]);router[_0xf86f('0xc')]('/',auth[_0xf86f('0x9')](),controller[_0xf86f('0xd')]);router[_0xf86f('0xe')](_0xf86f('0xa'),auth[_0xf86f('0x9')](),controller[_0xf86f('0xf')]);router[_0xf86f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf86f('0x11')]);module[_0xf86f('0x12')]=router; \ No newline at end of file +var _0x9979=['../../components/interaction/service','../../config/environment','index','get','/:id','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xa1e3e6,_0x8a2ec8){var _0x37c555=function(_0x27520b){while(--_0x27520b){_0xa1e3e6['push'](_0xa1e3e6['shift']());}};_0x37c555(++_0x8a2ec8);}(_0x9979,0x108));var _0x9997=function(_0x38d887,_0x261d68){_0x38d887=_0x38d887-0x0;var _0x84c717=_0x9979[_0x38d887];return _0x84c717;};'use strict';var multer=require(_0x9997('0x0'));var util=require(_0x9997('0x1'));var path=require(_0x9997('0x2'));var timeout=require(_0x9997('0x3'));var express=require(_0x9997('0x4'));var router=express[_0x9997('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9997('0x6'));var config=require(_0x9997('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9997('0x8')]);router[_0x9997('0x9')](_0x9997('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9997('0xb')]('/',auth['isAuthenticated'](),controller[_0x9997('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9997('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9997('0xe')]);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 5dbd68b..51b2f36 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 _0x03e9=['exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x03e9,0x149));var _0x903e=function(_0x36c805,_0x55eea2){_0x36c805=_0x36c805-0x0;var _0x38d6f4=_0x03e9[_0x36c805];return _0x38d6f4;};'use strict';var Sequelize=require(_0x903e('0x0'));module[_0x903e('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x903e('0x2')],'unique':_0x903e('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x903e('0x2')],'set':function(_0x404efc){this[_0x903e('0x4')](_0x903e('0x5'),_0x404efc?_0x404efc[_0x903e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x903e('0x5'))?this[_0x903e('0x7')](_0x903e('0x5'))[_0x903e('0x8')](''):[];}},'auth':{'type':Sequelize[_0x903e('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x903e('0x2')]},'record':{'type':Sequelize[_0x903e('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x903e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x535a=['sequelize','exports','STRING','setDataValue','options','getDataValue','split','BOOLEAN'];(function(_0x17086a,_0x2f8475){var _0x18779c=function(_0xd4515e){while(--_0xd4515e){_0x17086a['push'](_0x17086a['shift']());}};_0x18779c(++_0x2f8475);}(_0x535a,0xc0));var _0xa535=function(_0x5949ce,_0x3d0fc9){_0x5949ce=_0x5949ce-0x0;var _0x220057=_0x535a[_0x5949ce];return _0x220057;};'use strict';var Sequelize=require(_0xa535('0x0'));module[_0xa535('0x1')]={'name':{'type':Sequelize[_0xa535('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xa535('0x2')],'set':function(_0x2fb192){this[_0xa535('0x3')](_0xa535('0x4'),_0x2fb192?_0x2fb192['join'](''):[]);},'get':function(){return this[_0xa535('0x5')](_0xa535('0x4'))?this['getDataValue'](_0xa535('0x4'))[_0xa535('0x6')](''):[];}},'auth':{'type':Sequelize[_0xa535('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xa535('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa535('0x2')]},'description':{'type':Sequelize[_0xa535('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 89a91a3..3b21aaf 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 _0xa4de=['pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','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','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','get','ChanSpies','error','stack','name','send','index','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0xcf69e4,_0x22359f){var _0x3ae183=function(_0x34d0fc){while(--_0x34d0fc){_0xcf69e4['push'](_0xcf69e4['shift']());}};_0x3ae183(++_0x22359f);}(_0xa4de,0x10d));var _0xea4d=function(_0x20abe5,_0x51f8da){_0x20abe5=_0x20abe5-0x0;var _0x29f97f=_0xa4de[_0x20abe5];return _0x29f97f;};'use strict';var emlformat=require(_0xea4d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea4d('0x1'));var rp=require(_0xea4d('0x2'));var moment=require(_0xea4d('0x3'));var BPromise=require(_0xea4d('0x4'));var Mustache=require(_0xea4d('0x5'));var util=require(_0xea4d('0x6'));var path=require(_0xea4d('0x7'));var sox=require(_0xea4d('0x8'));var csv=require(_0xea4d('0x9'));var ejs=require(_0xea4d('0xa'));var fs=require('fs');var fs_extra=require(_0xea4d('0xb'));var _=require(_0xea4d('0xc'));var squel=require('squel');var crypto=require(_0xea4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xea4d('0xe'));var toCsv=require(_0xea4d('0x9'));var querystring=require(_0xea4d('0xf'));var Papa=require(_0xea4d('0x10'));var Redis=require(_0xea4d('0x11'));var authService=require(_0xea4d('0x12'));var qs=require(_0xea4d('0x13'));var as=require(_0xea4d('0x14'));var hardwareService=require(_0xea4d('0x15'));var logger=require(_0xea4d('0x16'))(_0xea4d('0x17'));var utils=require(_0xea4d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xea4d('0x19'));var db=require(_0xea4d('0x1a'))['db'];function respondWithStatusCode(_0x2c4651,_0x178f42){_0x178f42=_0x178f42||0xcc;return function(_0x3cb932){if(_0x3cb932){return _0x2c4651['sendStatus'](_0x178f42);}return _0x2c4651[_0xea4d('0x1b')](_0x178f42)[_0xea4d('0x1c')]();};}function respondWithResult(_0x547628,_0x597c50){_0x597c50=_0x597c50||0xc8;return function(_0x38d7b9){if(_0x38d7b9){return _0x547628[_0xea4d('0x1b')](_0x597c50)[_0xea4d('0x1d')](_0x38d7b9);}};}function respondWithFilteredResult(_0x3726c6,_0x16003a){return function(_0x29f706){if(_0x29f706){var _0x1f725f=typeof _0x16003a['offset']===_0xea4d('0x1e')&&typeof _0x16003a['limit']===_0xea4d('0x1e');var _0xe9925d=_0x29f706[_0xea4d('0x1f')];var _0x16370e=_0x1f725f?0x0:_0x16003a[_0xea4d('0x20')];var _0x5d2912=_0x1f725f?_0x29f706['count']:_0x16003a[_0xea4d('0x20')]+_0x16003a['limit'];var _0x2d13f4;if(_0x5d2912>=_0xe9925d){_0x5d2912=_0xe9925d;_0x2d13f4=0xc8;}else{_0x2d13f4=0xce;}_0x3726c6['status'](_0x2d13f4);return _0x3726c6[_0xea4d('0x21')](_0xea4d('0x22'),_0x16370e+'-'+_0x5d2912+'/'+_0xe9925d)['json'](_0x29f706);}return null;};}function patchUpdates(_0x3cfdbd){return function(_0xdd6cd7){try{jsonpatch['apply'](_0xdd6cd7,_0x3cfdbd,!![]);}catch(_0x5c3d72){return BPromise[_0xea4d('0x23')](_0x5c3d72);}return _0xdd6cd7['save']();};}function saveUpdates(_0x515513,_0x17fef2){return function(_0x3c686d){if(_0x3c686d){return _0x3c686d[_0xea4d('0x24')](_0x515513)['then'](function(_0x4db59a){return _0x4db59a;});}return null;};}function removeEntity(_0x110768,_0x180242){return function(_0x103fee){if(_0x103fee){return _0x103fee['destroy']()[_0xea4d('0x25')](function(){var _0x2c10ca=_0x103fee[_0xea4d('0x26')]({'plain':!![]});var _0x32039a=_0xea4d('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x32039a,'resourceId':_0x2c10ca['id']}})[_0xea4d('0x25')](function(){return _0x103fee;});})['then'](function(){_0x110768[_0xea4d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe01672,_0x475567){return function(_0x18e4b0){if(!_0x18e4b0){_0xe01672['sendStatus'](0x194);}return _0x18e4b0;};}function handleError(_0x5325bf,_0x5102e4){_0x5102e4=_0x5102e4||0x1f4;return function(_0x540b0c){logger[_0xea4d('0x28')](_0x540b0c[_0xea4d('0x29')]);if(_0x540b0c[_0xea4d('0x2a')]){delete _0x540b0c[_0xea4d('0x2a')];}_0x5325bf[_0xea4d('0x1b')](_0x5102e4)[_0xea4d('0x2b')](_0x540b0c);};}exports[_0xea4d('0x2c')]=function(_0x563706,_0xd0a393){var _0xc99b7c={},_0x4fef86={},_0x4ad958={'count':0x0,'rows':[]};var _0x289bba=_['map'](db[_0xea4d('0x2d')][_0xea4d('0x2e')],function(_0x4db0e3){return{'name':_0x4db0e3['fieldName'],'type':_0x4db0e3[_0xea4d('0x2f')][_0xea4d('0x30')]};});_0x4fef86[_0xea4d('0x31')]=_['map'](_0x289bba,_0xea4d('0x2a'));_0x4fef86[_0xea4d('0x32')]=_[_0xea4d('0x33')](_0x563706[_0xea4d('0x32')]);_0x4fef86[_0xea4d('0x34')]=_['intersection'](_0x4fef86[_0xea4d('0x31')],_0x4fef86[_0xea4d('0x32')]);_0xc99b7c[_0xea4d('0x35')]=_[_0xea4d('0x36')](_0x4fef86[_0xea4d('0x31')],qs[_0xea4d('0x37')](_0x563706[_0xea4d('0x32')][_0xea4d('0x37')]));_0xc99b7c[_0xea4d('0x35')]=_0xc99b7c[_0xea4d('0x35')][_0xea4d('0x38')]?_0xc99b7c[_0xea4d('0x35')]:_0x4fef86[_0xea4d('0x31')];if(!_0x563706['query'][_0xea4d('0x39')](_0xea4d('0x3a'))){_0xc99b7c[_0xea4d('0x3b')]=qs[_0xea4d('0x3b')](_0x563706[_0xea4d('0x32')][_0xea4d('0x3b')]);_0xc99b7c[_0xea4d('0x20')]=qs['offset'](_0x563706[_0xea4d('0x32')][_0xea4d('0x20')]);}_0xc99b7c[_0xea4d('0x3c')]=qs[_0xea4d('0x3d')](_0x563706[_0xea4d('0x32')][_0xea4d('0x3d')]);_0xc99b7c[_0xea4d('0x3e')]=qs[_0xea4d('0x34')](_[_0xea4d('0x3f')](_0x563706[_0xea4d('0x32')],_0x4fef86['filters']),_0x289bba);if(_0x563706['query'][_0xea4d('0x40')]){_0xc99b7c[_0xea4d('0x3e')]=_[_0xea4d('0x41')](_0xc99b7c[_0xea4d('0x3e')],{'$or':_['map'](_0x289bba,function(_0x23b7a7){if(_0x23b7a7[_0xea4d('0x2f')]!==_0xea4d('0x42')){var _0x1c7318={};_0x1c7318[_0x23b7a7[_0xea4d('0x2a')]]={'$like':'%'+_0x563706[_0xea4d('0x32')][_0xea4d('0x40')]+'%'};return _0x1c7318;}})});}_0xc99b7c=_[_0xea4d('0x41')]({},_0xc99b7c,_0x563706[_0xea4d('0x43')]);var _0x507cd7={'where':_0xc99b7c[_0xea4d('0x3e')]};return db[_0xea4d('0x2d')]['count'](_0x507cd7)[_0xea4d('0x25')](function(_0x12c4f3){_0x4ad958['count']=_0x12c4f3;if(_0x563706[_0xea4d('0x32')]['includeAll']){_0xc99b7c[_0xea4d('0x44')]=[{'all':!![]}];}return db[_0xea4d('0x2d')]['findAll'](_0xc99b7c);})[_0xea4d('0x25')](function(_0x321fe2){_0x4ad958['rows']=_0x321fe2;return _0x4ad958;})['then'](respondWithFilteredResult(_0xd0a393,_0xc99b7c))[_0xea4d('0x45')](handleError(_0xd0a393,null));};exports[_0xea4d('0x46')]=function(_0x33df03,_0x22183e){var _0x4218c7={'raw':![],'where':{'id':_0x33df03[_0xea4d('0x47')]['id']}},_0x43f0da={};_0x43f0da[_0xea4d('0x31')]=_['keys'](db[_0xea4d('0x2d')][_0xea4d('0x2e')]);_0x43f0da[_0xea4d('0x32')]=_[_0xea4d('0x33')](_0x33df03[_0xea4d('0x32')]);_0x43f0da[_0xea4d('0x34')]=_[_0xea4d('0x36')](_0x43f0da[_0xea4d('0x31')],_0x43f0da[_0xea4d('0x32')]);_0x4218c7[_0xea4d('0x35')]=_[_0xea4d('0x36')](_0x43f0da['model'],qs[_0xea4d('0x37')](_0x33df03['query'][_0xea4d('0x37')]));_0x4218c7['attributes']=_0x4218c7['attributes'][_0xea4d('0x38')]?_0x4218c7[_0xea4d('0x35')]:_0x43f0da[_0xea4d('0x31')];if(_0x33df03['query'][_0xea4d('0x48')]){_0x4218c7[_0xea4d('0x44')]=[{'all':!![]}];}_0x4218c7=_[_0xea4d('0x41')]({},_0x4218c7,_0x33df03[_0xea4d('0x43')]);return db[_0xea4d('0x2d')][_0xea4d('0x49')](_0x4218c7)[_0xea4d('0x25')](handleEntityNotFound(_0x22183e,null))[_0xea4d('0x25')](respondWithResult(_0x22183e,null))[_0xea4d('0x45')](handleError(_0x22183e,null));};exports[_0xea4d('0x4a')]=function(_0x5ee70b,_0xa42df1){return db['VoiceChanSpy']['create'](_0x5ee70b[_0xea4d('0x4b')],{})[_0xea4d('0x25')](function(_0x28b07e){var _0xfc9dfc=_0x5ee70b['user']['get']({'plain':!![]});if(!_0xfc9dfc)throw new Error(_0xea4d('0x4c'));if(_0xfc9dfc['role']===_0xea4d('0x4d')){var _0x2bc8cb=_0x28b07e[_0xea4d('0x26')]({'plain':!![]});var _0x12270f=_0xea4d('0x27');return db[_0xea4d('0x4e')][_0xea4d('0x49')]({'where':{'name':_0x12270f,'userProfileId':_0xfc9dfc[_0xea4d('0x4f')]},'raw':!![]})[_0xea4d('0x25')](function(_0x38c426){if(_0x38c426&&_0x38c426[_0xea4d('0x50')]===0x0){return db[_0xea4d('0x51')][_0xea4d('0x4a')]({'name':_0x2bc8cb[_0xea4d('0x2a')],'resourceId':_0x2bc8cb['id'],'type':_0x38c426[_0xea4d('0x2a')],'sectionId':_0x38c426['id']},{})[_0xea4d('0x25')](function(){return _0x28b07e;});}else{return _0x28b07e;}})[_0xea4d('0x45')](function(_0x3bee2e){logger[_0xea4d('0x28')](_0xea4d('0x52'),_0x3bee2e);throw _0x3bee2e;});}return _0x28b07e;})[_0xea4d('0x25')](respondWithResult(_0xa42df1,0xc9))[_0xea4d('0x45')](handleError(_0xa42df1,null));};exports['update']=function(_0x3a270c,_0x5c1c87){if(_0x3a270c['body']['id']){delete _0x3a270c['body']['id'];}return db[_0xea4d('0x2d')]['find']({'where':{'id':_0x3a270c[_0xea4d('0x47')]['id']}})[_0xea4d('0x25')](handleEntityNotFound(_0x5c1c87,null))[_0xea4d('0x25')](saveUpdates(_0x3a270c[_0xea4d('0x4b')],null))[_0xea4d('0x25')](respondWithResult(_0x5c1c87,null))[_0xea4d('0x45')](handleError(_0x5c1c87,null));};exports['destroy']=function(_0x8e5e80,_0x26284){return db['VoiceChanSpy']['find']({'where':{'id':_0x8e5e80[_0xea4d('0x47')]['id']}})[_0xea4d('0x25')](handleEntityNotFound(_0x26284,null))[_0xea4d('0x25')](removeEntity(_0x26284,null))[_0xea4d('0x45')](handleError(_0x26284,null));}; \ No newline at end of file +var _0xbd3b=['sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','include','findAll','rows','catch','show','length','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','ChanSpies','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order'];(function(_0x204911,_0x4d76d3){var _0x19c0eb=function(_0x587f2b){while(--_0x587f2b){_0x204911['push'](_0x204911['shift']());}};_0x19c0eb(++_0x4d76d3);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x4660b9,_0x172664){_0x4660b9=_0x4660b9-0x0;var _0x3d0b6b=_0xbd3b[_0x4660b9];return _0x3d0b6b;};'use strict';var emlformat=require(_0xbbd3('0x0'));var rimraf=require(_0xbbd3('0x1'));var zipdir=require(_0xbbd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbd3('0x3'));var moment=require(_0xbbd3('0x4'));var BPromise=require(_0xbbd3('0x5'));var Mustache=require(_0xbbd3('0x6'));var util=require('util');var path=require(_0xbbd3('0x7'));var sox=require(_0xbbd3('0x8'));var csv=require('to-csv');var ejs=require(_0xbbd3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbd3('0xa'));var squel=require(_0xbbd3('0xb'));var crypto=require(_0xbbd3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbd3('0xd'));var toCsv=require(_0xbbd3('0xe'));var querystring=require(_0xbbd3('0xf'));var Papa=require(_0xbbd3('0x10'));var Redis=require('ioredis');var authService=require(_0xbbd3('0x11'));var qs=require(_0xbbd3('0x12'));var as=require(_0xbbd3('0x13'));var hardwareService=require(_0xbbd3('0x14'));var logger=require('../../config/logger')(_0xbbd3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbbd3('0x16'));var db=require(_0xbbd3('0x17'))['db'];function respondWithStatusCode(_0x4004a3,_0x35d473){_0x35d473=_0x35d473||0xcc;return function(_0x26283b){if(_0x26283b){return _0x4004a3[_0xbbd3('0x18')](_0x35d473);}return _0x4004a3[_0xbbd3('0x19')](_0x35d473)[_0xbbd3('0x1a')]();};}function respondWithResult(_0x469ef2,_0xf12c2d){_0xf12c2d=_0xf12c2d||0xc8;return function(_0x4a8ea8){if(_0x4a8ea8){return _0x469ef2['status'](_0xf12c2d)[_0xbbd3('0x1b')](_0x4a8ea8);}};}function respondWithFilteredResult(_0xda19d6,_0x38b4ba){return function(_0x38ab26){if(_0x38ab26){var _0xbeeb6b=typeof _0x38b4ba['offset']===_0xbbd3('0x1c')&&typeof _0x38b4ba['limit']===_0xbbd3('0x1c');var _0x830690=_0x38ab26[_0xbbd3('0x1d')];var _0x240a46=_0xbeeb6b?0x0:_0x38b4ba['offset'];var _0x50b6e4=_0xbeeb6b?_0x38ab26[_0xbbd3('0x1d')]:_0x38b4ba[_0xbbd3('0x1e')]+_0x38b4ba['limit'];var _0x398c80;if(_0x50b6e4>=_0x830690){_0x50b6e4=_0x830690;_0x398c80=0xc8;}else{_0x398c80=0xce;}_0xda19d6['status'](_0x398c80);return _0xda19d6[_0xbbd3('0x1f')](_0xbbd3('0x20'),_0x240a46+'-'+_0x50b6e4+'/'+_0x830690)[_0xbbd3('0x1b')](_0x38ab26);}return null;};}function patchUpdates(_0x1fa586){return function(_0xe79e48){try{jsonpatch[_0xbbd3('0x21')](_0xe79e48,_0x1fa586,!![]);}catch(_0x223e02){return BPromise['reject'](_0x223e02);}return _0xe79e48[_0xbbd3('0x22')]();};}function saveUpdates(_0x57544e,_0x5392eb){return function(_0x1e3fa8){if(_0x1e3fa8){return _0x1e3fa8[_0xbbd3('0x23')](_0x57544e)[_0xbbd3('0x24')](function(_0x18ce17){return _0x18ce17;});}return null;};}function removeEntity(_0x56197e,_0x79e118){return function(_0x51d5ee){if(_0x51d5ee){return _0x51d5ee[_0xbbd3('0x25')]()['then'](function(){var _0x560b5d=_0x51d5ee['get']({'plain':!![]});var _0x51e13a=_0xbbd3('0x26');return db[_0xbbd3('0x27')]['destroy']({'where':{'type':_0x51e13a,'resourceId':_0x560b5d['id']}})[_0xbbd3('0x24')](function(){return _0x51d5ee;});})[_0xbbd3('0x24')](function(){_0x56197e[_0xbbd3('0x19')](0xcc)[_0xbbd3('0x1a')]();});}};}function handleEntityNotFound(_0x541d0f,_0x34ce0e){return function(_0x4b8dfa){if(!_0x4b8dfa){_0x541d0f[_0xbbd3('0x18')](0x194);}return _0x4b8dfa;};}function handleError(_0x396793,_0x5bf14a){_0x5bf14a=_0x5bf14a||0x1f4;return function(_0x279cb1){logger[_0xbbd3('0x28')](_0x279cb1[_0xbbd3('0x29')]);if(_0x279cb1[_0xbbd3('0x2a')]){delete _0x279cb1[_0xbbd3('0x2a')];}_0x396793[_0xbbd3('0x19')](_0x5bf14a)[_0xbbd3('0x2b')](_0x279cb1);};}exports[_0xbbd3('0x2c')]=function(_0x3e242f,_0x49ece8){var _0x137923={},_0xece49e={},_0x2de9d9={'count':0x0,'rows':[]};var _0x4177ec=_['map'](db['VoiceChanSpy'][_0xbbd3('0x2d')],function(_0x835783){return{'name':_0x835783[_0xbbd3('0x2e')],'type':_0x835783[_0xbbd3('0x2f')]['key']};});_0xece49e[_0xbbd3('0x30')]=_[_0xbbd3('0x31')](_0x4177ec,_0xbbd3('0x2a'));_0xece49e['query']=_[_0xbbd3('0x32')](_0x3e242f[_0xbbd3('0x33')]);_0xece49e[_0xbbd3('0x34')]=_[_0xbbd3('0x35')](_0xece49e[_0xbbd3('0x30')],_0xece49e[_0xbbd3('0x33')]);_0x137923['attributes']=_['intersection'](_0xece49e['model'],qs[_0xbbd3('0x36')](_0x3e242f[_0xbbd3('0x33')]['fields']));_0x137923['attributes']=_0x137923['attributes']['length']?_0x137923[_0xbbd3('0x37')]:_0xece49e[_0xbbd3('0x30')];if(!_0x3e242f[_0xbbd3('0x33')][_0xbbd3('0x38')]('nolimit')){_0x137923[_0xbbd3('0x39')]=qs[_0xbbd3('0x39')](_0x3e242f['query'][_0xbbd3('0x39')]);_0x137923[_0xbbd3('0x1e')]=qs[_0xbbd3('0x1e')](_0x3e242f[_0xbbd3('0x33')]['offset']);}_0x137923[_0xbbd3('0x3a')]=qs[_0xbbd3('0x3b')](_0x3e242f[_0xbbd3('0x33')][_0xbbd3('0x3b')]);_0x137923[_0xbbd3('0x3c')]=qs[_0xbbd3('0x34')](_[_0xbbd3('0x3d')](_0x3e242f[_0xbbd3('0x33')],_0xece49e[_0xbbd3('0x34')]),_0x4177ec);if(_0x3e242f[_0xbbd3('0x33')][_0xbbd3('0x3e')]){_0x137923[_0xbbd3('0x3c')]=_[_0xbbd3('0x3f')](_0x137923[_0xbbd3('0x3c')],{'$or':_['map'](_0x4177ec,function(_0x574921){if(_0x574921[_0xbbd3('0x2f')]!==_0xbbd3('0x40')){var _0x85f82e={};_0x85f82e[_0x574921['name']]={'$like':'%'+_0x3e242f[_0xbbd3('0x33')][_0xbbd3('0x3e')]+'%'};return _0x85f82e;}})});}_0x137923=_[_0xbbd3('0x3f')]({},_0x137923,_0x3e242f[_0xbbd3('0x41')]);var _0x21ddbb={'where':_0x137923[_0xbbd3('0x3c')]};return db[_0xbbd3('0x42')][_0xbbd3('0x1d')](_0x21ddbb)['then'](function(_0x310b82){_0x2de9d9[_0xbbd3('0x1d')]=_0x310b82;if(_0x3e242f[_0xbbd3('0x33')]['includeAll']){_0x137923[_0xbbd3('0x43')]=[{'all':!![]}];}return db[_0xbbd3('0x42')][_0xbbd3('0x44')](_0x137923);})[_0xbbd3('0x24')](function(_0x252857){_0x2de9d9[_0xbbd3('0x45')]=_0x252857;return _0x2de9d9;})['then'](respondWithFilteredResult(_0x49ece8,_0x137923))[_0xbbd3('0x46')](handleError(_0x49ece8,null));};exports[_0xbbd3('0x47')]=function(_0x423c10,_0x4c66a0){var _0x1e9882={'raw':![],'where':{'id':_0x423c10['params']['id']}},_0x393161={};_0x393161[_0xbbd3('0x30')]=_['keys'](db['VoiceChanSpy'][_0xbbd3('0x2d')]);_0x393161[_0xbbd3('0x33')]=_[_0xbbd3('0x32')](_0x423c10[_0xbbd3('0x33')]);_0x393161[_0xbbd3('0x34')]=_[_0xbbd3('0x35')](_0x393161[_0xbbd3('0x30')],_0x393161[_0xbbd3('0x33')]);_0x1e9882[_0xbbd3('0x37')]=_[_0xbbd3('0x35')](_0x393161['model'],qs['fields'](_0x423c10['query']['fields']));_0x1e9882[_0xbbd3('0x37')]=_0x1e9882[_0xbbd3('0x37')][_0xbbd3('0x48')]?_0x1e9882[_0xbbd3('0x37')]:_0x393161[_0xbbd3('0x30')];if(_0x423c10[_0xbbd3('0x33')][_0xbbd3('0x49')]){_0x1e9882['include']=[{'all':!![]}];}_0x1e9882=_[_0xbbd3('0x3f')]({},_0x1e9882,_0x423c10[_0xbbd3('0x41')]);return db['VoiceChanSpy'][_0xbbd3('0x4a')](_0x1e9882)[_0xbbd3('0x24')](handleEntityNotFound(_0x4c66a0,null))['then'](respondWithResult(_0x4c66a0,null))[_0xbbd3('0x46')](handleError(_0x4c66a0,null));};exports[_0xbbd3('0x4b')]=function(_0x32404f,_0x22feba){return db['VoiceChanSpy']['create'](_0x32404f['body'],{})[_0xbbd3('0x24')](function(_0x51c592){var _0x129e46=_0x32404f[_0xbbd3('0x4c')][_0xbbd3('0x4d')]({'plain':!![]});if(!_0x129e46)throw new Error(_0xbbd3('0x4e'));if(_0x129e46[_0xbbd3('0x4f')]==='user'){var _0x5c5f16=_0x51c592[_0xbbd3('0x4d')]({'plain':!![]});var _0x1a4007=_0xbbd3('0x26');return db[_0xbbd3('0x50')][_0xbbd3('0x4a')]({'where':{'name':_0x1a4007,'userProfileId':_0x129e46['userProfileId']},'raw':!![]})[_0xbbd3('0x24')](function(_0x2e8ef7){if(_0x2e8ef7&&_0x2e8ef7[_0xbbd3('0x51')]===0x0){return db['UserProfileResource'][_0xbbd3('0x4b')]({'name':_0x5c5f16[_0xbbd3('0x2a')],'resourceId':_0x5c5f16['id'],'type':_0x2e8ef7[_0xbbd3('0x2a')],'sectionId':_0x2e8ef7['id']},{})[_0xbbd3('0x24')](function(){return _0x51c592;});}else{return _0x51c592;}})[_0xbbd3('0x46')](function(_0x220481){logger['error'](_0xbbd3('0x52'),_0x220481);throw _0x220481;});}return _0x51c592;})[_0xbbd3('0x24')](respondWithResult(_0x22feba,0xc9))[_0xbbd3('0x46')](handleError(_0x22feba,null));};exports[_0xbbd3('0x23')]=function(_0x3115ce,_0x35d357){if(_0x3115ce[_0xbbd3('0x53')]['id']){delete _0x3115ce[_0xbbd3('0x53')]['id'];}return db[_0xbbd3('0x42')][_0xbbd3('0x4a')]({'where':{'id':_0x3115ce[_0xbbd3('0x54')]['id']}})[_0xbbd3('0x24')](handleEntityNotFound(_0x35d357,null))[_0xbbd3('0x24')](saveUpdates(_0x3115ce[_0xbbd3('0x53')],null))[_0xbbd3('0x24')](respondWithResult(_0x35d357,null))[_0xbbd3('0x46')](handleError(_0x35d357,null));};exports['destroy']=function(_0xfc25af,_0x247b63){return db[_0xbbd3('0x42')]['find']({'where':{'id':_0xfc25af['params']['id']}})[_0xbbd3('0x24')](handleEntityNotFound(_0x247b63,null))[_0xbbd3('0x24')](removeEntity(_0x247b63,null))[_0xbbd3('0x46')](handleError(_0x247b63,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e4f93eb..2609c2d 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 _0x1233=['push','format','CDR(type)=%s','chanspy','merge','MixMonitor','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system'];(function(_0x46038e,_0x2fbecb){var _0x189c48=function(_0x48d456){while(--_0x48d456){_0x46038e['push'](_0x46038e['shift']());}};_0x189c48(++_0x2fbecb);}(_0x1233,0x8c));var _0x3123=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x1233[_0x445101];return _0x3c3d04;};'use strict';var _=require(_0x3123('0x0'));var util=require(_0x3123('0x1'));var BPromise=require('bluebird');var attributes=require(_0x3123('0x2'));var getUserApplications=function(_0x3f4dc6,_0x209de7,_0x2ff13a){var _0x2428bd=0x1;var _0x5887ca=[];var _0x6bab05={'context':_0x209de7[_0x3123('0x3')]||_0x3123('0x4'),'exten':util['format'](_0x3123('0x5'),_0x3f4dc6[_0x3123('0x6')],_0x2ff13a),'type':_0x3123('0x7'),'isApp':![],'ChanSpyId':_0x3f4dc6['id'],'UserId':_0x209de7['id']};_0x5887ca[_0x3123('0x8')](_['merge']({'app':'Set','appdata':util[_0x3123('0x9')](_0x3123('0xa'),_0x3123('0xb')),'priority':_0x2428bd++},_0x6bab05));if(_0x3f4dc6['record']){_0x5887ca[_0x3123('0x8')](_[_0x3123('0xc')]({'app':_0x3123('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x3f4dc6['recordingFormat']),'priority':_0x2428bd++},_0x6bab05));}if(_0x3f4dc6[_0x3123('0xe')]){_0x5887ca[_0x3123('0x8')](_['merge']({'app':_0x3123('0xf'),'appdata':_0x3f4dc6['password'],'priority':_0x2428bd++},_0x6bab05));}_0x5887ca[_0x3123('0x8')](_[_0x3123('0xc')]({'app':_0x3123('0x10'),'appdata':util[_0x3123('0x9')](_0x3123('0x11'),_0x209de7[_0x3123('0x12')],_0x3f4dc6['options']?_0x3f4dc6[_0x3123('0x13')][_0x3123('0x14')](''):''),'priority':_0x2428bd++},_0x6bab05));if(_0x3f4dc6[_0x3123('0x15')]){_0x5887ca[_0x3123('0x8')](_['merge']({'app':_0x3123('0x16'),'priority':_0x2428bd++},_0x6bab05));}return _0x5887ca;};var getChanSpyApplications=function(_0x3dc6d2,_0x3f0036){var _0x4fc807=[];for(var _0x2a33ec=0x0,_0x4be280=0x1;_0x2a33ec<_0x3f0036[_0x3123('0x17')];_0x2a33ec++,_0x4be280=0x1){_0x4fc807=_0x4fc807[_0x3123('0x18')](getUserApplications(_0x3dc6d2,_0x3f0036[_0x2a33ec],_0x3f0036[_0x2a33ec][_0x3123('0x19')]));if(_0x3f0036[_0x2a33ec][_0x3123('0x19')]!=_0x3f0036[_0x2a33ec]['name']){_0x4fc807=_0x4fc807[_0x3123('0x18')](getUserApplications(_0x3dc6d2,_0x3f0036[_0x2a33ec],_0x3f0036[_0x2a33ec][_0x3123('0x12')]));}}return _0x4fc807;};var getChanSpyPromise=function(_0x58621f,_0x413db0){return new BPromise(function(_0x82e3fe,_0x262038){return _0x58621f[_0x3123('0x1a')][_0x3123('0x1b')]({'attributes':['id',_0x3123('0x12'),_0x3123('0x19')],'where':{'role':_0x3123('0x1c'),'chanspy':!![]},'raw':!![]})[_0x3123('0x1d')](function(_0x460a56){if(_0x460a56){return _0x82e3fe(getChanSpyApplications(_0x413db0,_0x460a56));}return _0x82e3fe([]);})[_0x3123('0x1e')](function(_0x3233d4){_0x262038(_0x3233d4);});});};module[_0x3123('0x1f')]=function(_0x239782,_0x23001d){var _0x1f30d4=_0x239782['models'];return _0x239782['define'](_0x3123('0x20'),attributes,{'tableName':_0x3123('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x598bd1,_0x186924,_0x34270a){return getChanSpyPromise(_0x1f30d4,_0x598bd1)[_0x3123('0x1d')](function(_0x968df6){if(_0x968df6&&_0x968df6['length']){return _0x1f30d4[_0x3123('0x22')][_0x3123('0x23')](_0x968df6);}})[_0x3123('0x1d')](function(){_0x34270a();})[_0x3123('0x1e')](function(_0x3eb5d3){_0x34270a(_0x3eb5d3);});},'afterUpdate':function(_0x4d25ee,_0x1abaa5,_0x44f425){return _0x1f30d4['VoiceExtension'][_0x3123('0x24')]({'where':{'ChanSpyId':_0x4d25ee['id']}})[_0x3123('0x1d')](function(){return getChanSpyPromise(_0x1f30d4,_0x4d25ee);})[_0x3123('0x1d')](function(_0x459c70){if(_0x459c70&&_0x459c70[_0x3123('0x17')]){return _0x1f30d4[_0x3123('0x22')][_0x3123('0x23')](_0x459c70);}})['then'](function(){_0x44f425();})[_0x3123('0x1e')](function(_0x4f2257){_0x44f425(_0x4f2257);});},'afterDestroy':function(_0x1d7678,_0x5191f3,_0x4a039a){return _0x1f30d4[_0x3123('0x22')][_0x3123('0x24')]({'where':{'ChanSpyId':_0x1d7678['id']}})[_0x3123('0x1d')](function(){_0x4a039a();})['catch'](function(_0x3003f2){_0x4a039a(_0x3003f2);});}}});}; \ No newline at end of file +var _0xb6fb=['name','User','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','join','StopMixMonitor','length','concat','internal'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb6fb,0x188));var _0xbb6f=function(_0x28ae50,_0x5a92b0){_0x28ae50=_0x28ae50-0x0;var _0x44ddd6=_0xb6fb[_0x28ae50];return _0x44ddd6;};'use strict';var _=require(_0xbb6f('0x0'));var util=require('util');var BPromise=require(_0xbb6f('0x1'));var attributes=require(_0xbb6f('0x2'));var getUserApplications=function(_0x4111e1,_0x103834,_0x100381){var _0x5acf55=0x1;var _0x117c7b=[];var _0x2048d7={'context':_0x103834[_0xbb6f('0x3')]||'from-sip','exten':util[_0xbb6f('0x4')](_0xbb6f('0x5'),_0x4111e1[_0xbb6f('0x6')],_0x100381),'type':_0xbb6f('0x7'),'isApp':![],'ChanSpyId':_0x4111e1['id'],'UserId':_0x103834['id']};_0x117c7b[_0xbb6f('0x8')](_[_0xbb6f('0x9')]({'app':'Set','appdata':util[_0xbb6f('0x4')](_0xbb6f('0xa'),_0xbb6f('0xb')),'priority':_0x5acf55++},_0x2048d7));if(_0x4111e1[_0xbb6f('0xc')]){_0x117c7b[_0xbb6f('0x8')](_[_0xbb6f('0x9')]({'app':_0xbb6f('0xd'),'appdata':util[_0xbb6f('0x4')](_0xbb6f('0xe'),_0x4111e1[_0xbb6f('0xf')]),'priority':_0x5acf55++},_0x2048d7));}if(_0x4111e1[_0xbb6f('0x10')]){_0x117c7b[_0xbb6f('0x8')](_[_0xbb6f('0x9')]({'app':_0xbb6f('0x11'),'appdata':_0x4111e1[_0xbb6f('0x12')],'priority':_0x5acf55++},_0x2048d7));}_0x117c7b[_0xbb6f('0x8')](_['merge']({'app':_0xbb6f('0x13'),'appdata':util[_0xbb6f('0x4')]('SIP/%s,%s',_0x103834['name'],_0x4111e1['options']?_0x4111e1[_0xbb6f('0x14')][_0xbb6f('0x15')](''):''),'priority':_0x5acf55++},_0x2048d7));if(_0x4111e1[_0xbb6f('0xc')]){_0x117c7b[_0xbb6f('0x8')](_[_0xbb6f('0x9')]({'app':_0xbb6f('0x16'),'priority':_0x5acf55++},_0x2048d7));}return _0x117c7b;};var getChanSpyApplications=function(_0x4ee558,_0xa74ad8){var _0x105eb6=[];for(var _0x15a305=0x0,_0xb1563a=0x1;_0x15a305<_0xa74ad8[_0xbb6f('0x17')];_0x15a305++,_0xb1563a=0x1){_0x105eb6=_0x105eb6[_0xbb6f('0x18')](getUserApplications(_0x4ee558,_0xa74ad8[_0x15a305],_0xa74ad8[_0x15a305][_0xbb6f('0x19')]));if(_0xa74ad8[_0x15a305][_0xbb6f('0x19')]!=_0xa74ad8[_0x15a305]['name']){_0x105eb6=_0x105eb6[_0xbb6f('0x18')](getUserApplications(_0x4ee558,_0xa74ad8[_0x15a305],_0xa74ad8[_0x15a305][_0xbb6f('0x1a')]));}}return _0x105eb6;};var getChanSpyPromise=function(_0x2b2234,_0x558d82){return new BPromise(function(_0x1ccff2,_0x2ed422){return _0x2b2234[_0xbb6f('0x1b')]['findAll']({'attributes':['id','name',_0xbb6f('0x19')],'where':{'role':_0xbb6f('0x1c'),'chanspy':!![]},'raw':!![]})[_0xbb6f('0x1d')](function(_0x1ab00d){if(_0x1ab00d){return _0x1ccff2(getChanSpyApplications(_0x558d82,_0x1ab00d));}return _0x1ccff2([]);})['catch'](function(_0x269b62){_0x2ed422(_0x269b62);});});};module[_0xbb6f('0x1e')]=function(_0x498a19,_0xc5d345){var _0x2e7df0=_0x498a19[_0xbb6f('0x1f')];return _0x498a19[_0xbb6f('0x20')](_0xbb6f('0x21'),attributes,{'tableName':_0xbb6f('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x14a14c,_0x343c7a,_0x404e0e){return getChanSpyPromise(_0x2e7df0,_0x14a14c)[_0xbb6f('0x1d')](function(_0x3c90dc){if(_0x3c90dc&&_0x3c90dc[_0xbb6f('0x17')]){return _0x2e7df0['VoiceExtension']['bulkCreate'](_0x3c90dc);}})[_0xbb6f('0x1d')](function(){_0x404e0e();})['catch'](function(_0x3b456e){_0x404e0e(_0x3b456e);});},'afterUpdate':function(_0x27d7ca,_0x462a92,_0x381812){return _0x2e7df0[_0xbb6f('0x23')]['destroy']({'where':{'ChanSpyId':_0x27d7ca['id']}})['then'](function(){return getChanSpyPromise(_0x2e7df0,_0x27d7ca);})[_0xbb6f('0x1d')](function(_0x21d268){if(_0x21d268&&_0x21d268[_0xbb6f('0x17')]){return _0x2e7df0[_0xbb6f('0x23')]['bulkCreate'](_0x21d268);}})[_0xbb6f('0x1d')](function(){_0x381812();})[_0xbb6f('0x24')](function(_0x7c1346){_0x381812(_0x7c1346);});},'afterDestroy':function(_0x592fd5,_0x5150c8,_0x460316){return _0x2e7df0[_0xbb6f('0x23')][_0xbb6f('0x25')]({'where':{'ChanSpyId':_0x592fd5['id']}})[_0xbb6f('0x1d')](function(){_0x460316();})['catch'](function(_0x5bd49d){_0x460316(_0x5bd49d);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 8071a3b..9ebdd5d 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 _0x4746=['request\x20sent','debug','error','code','message','VoiceChanSpy,\x20%s,\x20%s','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x1d1595,_0x22d07f){var _0x38f3a7=function(_0x5bb829){while(--_0x5bb829){_0x1d1595['push'](_0x1d1595['shift']());}};_0x38f3a7(++_0x22d07f);}(_0x4746,0xc6));var _0x6474=function(_0xc689c7,_0x63165a){_0xc689c7=_0xc689c7-0x0;var _0x535e43=_0x4746[_0xc689c7];return _0x535e43;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433af9,_0x427f79,_0xcd065e){return new BPromise(function(_0xec3cda,_0x15d4c2){return client[_0x6474('0xa')](_0x433af9,_0xcd065e)['then'](function(_0x1bc38b){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'));logger[_0x6474('0xc')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'),JSON['stringify'](_0x1bc38b));if(_0x1bc38b[_0x6474('0xd')]){if(_0x1bc38b['error'][_0x6474('0xe')]===0x1f4){logger[_0x6474('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x427f79,_0x1bc38b['error']['message']);return _0x15d4c2(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);return _0xec3cda(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}else{logger[_0x6474('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x427f79,'request\x20sent');_0xec3cda(_0x1bc38b['result'][_0x6474('0xf')]);}})[_0x6474('0x12')](function(_0x29c19b){logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x29c19b);_0x15d4c2(_0x29c19b);});});} \ No newline at end of file +var _0x3eec=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','VoiceChanSpy,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x4580c3,_0x3955fd){_0x4580c3=_0x4580c3-0x0;var _0x535a63=_0x3eec[_0x4580c3];return _0x535a63;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0b36a81..85fb241 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 _0x69d5=['isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceContext.controller','index','get','/:id','show','post','create','put'];(function(_0x2d6af5,_0x7d2033){var _0x1a5d9b=function(_0x3b4997){while(--_0x3b4997){_0x2d6af5['push'](_0x2d6af5['shift']());}};_0x1a5d9b(++_0x7d2033);}(_0x69d5,0xb7));var _0x569d=function(_0x4ba6e6,_0x4fbc75){_0x4ba6e6=_0x4ba6e6-0x0;var _0x27c74f=_0x69d5[_0x4ba6e6];return _0x27c74f;};'use strict';var multer=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var path=require(_0x569d('0x2'));var timeout=require(_0x569d('0x3'));var express=require(_0x569d('0x4'));var router=express[_0x569d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x569d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x569d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x569d('0x8')]);router[_0x569d('0x9')](_0x569d('0xa'),auth['isAuthenticated'](),controller[_0x569d('0xb')]);router[_0x569d('0xc')]('/',auth['isAuthenticated'](),controller[_0x569d('0xd')]);router[_0x569d('0xe')](_0x569d('0xa'),auth[_0x569d('0xf')](),controller[_0x569d('0x10')]);router['delete'](_0x569d('0xa'),auth[_0x569d('0xf')](),controller['destroy']);module[_0x569d('0x11')]=router; \ No newline at end of file +var _0x8051=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','post','create','put','/:id','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8051,0x67));var _0x1805=function(_0x1d2234,_0x8a1ca3){_0x1d2234=_0x1d2234-0x0;var _0x59d8ed=_0x8051[_0x1d2234];return _0x59d8ed;};'use strict';var multer=require(_0x1805('0x0'));var util=require('util');var path=require(_0x1805('0x1'));var timeout=require('connect-timeout');var express=require(_0x1805('0x2'));var router=express[_0x1805('0x3')]();var fs_extra=require(_0x1805('0x4'));var auth=require(_0x1805('0x5'));var interaction=require(_0x1805('0x6'));var config=require('../../config/environment');var controller=require(_0x1805('0x7'));router[_0x1805('0x8')]('/',auth[_0x1805('0x9')](),controller[_0x1805('0xa')]);router['get']('/:id',auth[_0x1805('0x9')](),controller['show']);router[_0x1805('0xb')]('/',auth[_0x1805('0x9')](),controller[_0x1805('0xc')]);router[_0x1805('0xd')]('/:id',auth[_0x1805('0x9')](),controller['update']);router['delete'](_0x1805('0xe'),auth[_0x1805('0x9')](),controller[_0x1805('0xf')]);module[_0x1805('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 f907d4a..013dbe8 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 _0x516b=['sequelize','STRING','BOOLEAN'];(function(_0x31b137,_0xa54c07){var _0x35a4f8=function(_0x28e248){while(--_0x28e248){_0x31b137['push'](_0x31b137['shift']());}};_0x35a4f8(++_0xa54c07);}(_0x516b,0x1dd));var _0xb516=function(_0x58a611,_0x5c81f9){_0x58a611=_0x58a611-0x0;var _0x57d84f=_0x516b[_0x58a611];return _0x57d84f;};'use strict';var Sequelize=require(_0xb516('0x0'));module['exports']={'name':{'type':Sequelize[_0xb516('0x1')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb516('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x25fe=['exports','STRING','name','BOOLEAN'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x25fe,0x1f4));var _0xe25f=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x25fe[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require('sequelize');module[_0xe25f('0x0')]={'name':{'type':Sequelize[_0xe25f('0x1')],'unique':_0xe25f('0x2')},'description':{'type':Sequelize[_0xe25f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe25f('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 6e99f26..2135a99 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 _0xa918=['api','../../config/utils','../../config/license/util','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','includeAll','find','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','create','chan_sip.so','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','body','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4cf8ac,_0x2b4b7b){var _0x1e1bf7=function(_0x635271){while(--_0x635271){_0x4cf8ac['push'](_0x4cf8ac['shift']());}};_0x1e1bf7(++_0x2b4b7b);}(_0xa918,0x117));var _0x8a91=function(_0x12432d,_0x48ce04){_0x12432d=_0x12432d-0x0;var _0x4c8b0a=_0xa918[_0x12432d];return _0x4c8b0a;};'use strict';var emlformat=require(_0x8a91('0x0'));var rimraf=require(_0x8a91('0x1'));var zipdir=require(_0x8a91('0x2'));var jsonpatch=require(_0x8a91('0x3'));var rp=require(_0x8a91('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a91('0x5'));var util=require(_0x8a91('0x6'));var path=require(_0x8a91('0x7'));var sox=require(_0x8a91('0x8'));var csv=require(_0x8a91('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a91('0xa'));var _=require(_0x8a91('0xb'));var squel=require(_0x8a91('0xc'));var crypto=require('crypto');var jsforce=require(_0x8a91('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a91('0xe'));var Redis=require(_0x8a91('0xf'));var authService=require(_0x8a91('0x10'));var qs=require(_0x8a91('0x11'));var as=require(_0x8a91('0x12'));var hardwareService=require(_0x8a91('0x13'));var logger=require(_0x8a91('0x14'))(_0x8a91('0x15'));var utils=require(_0x8a91('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8a91('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8a91('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26ffb1,_0x6ca927,_0x5374e1,_0xf8d6f5){return new BPromise(function(_0x69a8a6,_0x3f4946){var _0x49ae82=_0xf8d6f5||client;return _0x49ae82[_0x8a91('0x19')](_0x26ffb1,_0x5374e1)[_0x8a91('0x1a')](function(_0x494a75){logger[_0x8a91('0x1b')](_0x8a91('0x1c'),_0x6ca927,_0x8a91('0x1d'));logger['debug'](_0x8a91('0x1e'),_0x6ca927,_0x8a91('0x1d'),JSON[_0x8a91('0x1f')](_0x494a75));if(_0x494a75[_0x8a91('0x20')]){if(_0x494a75[_0x8a91('0x20')]['code']===0x1f4){logger[_0x8a91('0x20')](_0x8a91('0x1c'),_0x6ca927,_0x494a75[_0x8a91('0x20')][_0x8a91('0x21')]);return _0x3f4946(_0x494a75['error'][_0x8a91('0x21')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x6ca927,_0x494a75['error'][_0x8a91('0x21')]);return _0x69a8a6(_0x494a75[_0x8a91('0x20')][_0x8a91('0x21')]);}else{logger[_0x8a91('0x1b')](_0x8a91('0x1c'),_0x6ca927,_0x8a91('0x1d'));_0x69a8a6(_0x494a75[_0x8a91('0x22')][_0x8a91('0x21')]);}})[_0x8a91('0x23')](function(_0x9918a7){logger[_0x8a91('0x20')](_0x8a91('0x1c'),_0x6ca927,_0x9918a7);_0x3f4946(_0x9918a7);});});}function respondWithStatusCode(_0x5b4173,_0x3e8bb){_0x3e8bb=_0x3e8bb||0xcc;return function(_0x4aedae){if(_0x4aedae){return _0x5b4173[_0x8a91('0x24')](_0x3e8bb);}return _0x5b4173[_0x8a91('0x25')](_0x3e8bb)[_0x8a91('0x26')]();};}function respondWithResult(_0x2910ce,_0x487af0){_0x487af0=_0x487af0||0xc8;return function(_0x3d6ed0){if(_0x3d6ed0){return _0x2910ce[_0x8a91('0x25')](_0x487af0)[_0x8a91('0x27')](_0x3d6ed0);}};}function respondWithFilteredResult(_0x4869c6,_0x5d8143){return function(_0x63f4fb){if(_0x63f4fb){var _0x1d16cc=typeof _0x5d8143[_0x8a91('0x28')]===_0x8a91('0x29')&&typeof _0x5d8143[_0x8a91('0x2a')]===_0x8a91('0x29');var _0x303d45=_0x63f4fb[_0x8a91('0x2b')];var _0x3cdeaa=_0x1d16cc?0x0:_0x5d8143[_0x8a91('0x28')];var _0x111324=_0x1d16cc?_0x63f4fb[_0x8a91('0x2b')]:_0x5d8143['offset']+_0x5d8143[_0x8a91('0x2a')];var _0x2258ba;if(_0x111324>=_0x303d45){_0x111324=_0x303d45;_0x2258ba=0xc8;}else{_0x2258ba=0xce;}_0x4869c6[_0x8a91('0x25')](_0x2258ba);return _0x4869c6[_0x8a91('0x2c')](_0x8a91('0x2d'),_0x3cdeaa+'-'+_0x111324+'/'+_0x303d45)['json'](_0x63f4fb);}return null;};}function patchUpdates(_0x11e3da){return function(_0x559a39){try{jsonpatch['apply'](_0x559a39,_0x11e3da,!![]);}catch(_0x50c08a){return BPromise[_0x8a91('0x2e')](_0x50c08a);}return _0x559a39['save']();};}function saveUpdates(_0x50f4da,_0x50a606){return function(_0x627ec8){if(_0x627ec8){return _0x627ec8['update'](_0x50f4da)['then'](function(_0x4752a0){return _0x4752a0;});}return null;};}function removeEntity(_0x2d07f6,_0x3ed150){return function(_0x3de1a2){if(_0x3de1a2){return _0x3de1a2['destroy']()[_0x8a91('0x1a')](function(){var _0x193032=_0x3de1a2[_0x8a91('0x2f')]({'plain':!![]});var _0x321d0b=_0x8a91('0x30');return db[_0x8a91('0x31')][_0x8a91('0x32')]({'where':{'type':_0x321d0b,'resourceId':_0x193032['id']}})[_0x8a91('0x1a')](function(){return _0x3de1a2;});})[_0x8a91('0x1a')](function(){_0x2d07f6[_0x8a91('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x76366,_0x3b025f){return function(_0x14fabb){if(!_0x14fabb){_0x76366[_0x8a91('0x24')](0x194);}return _0x14fabb;};}function handleError(_0x5e6e8b,_0x485a22){_0x485a22=_0x485a22||0x1f4;return function(_0x86d9c5){logger['error'](_0x86d9c5[_0x8a91('0x33')]);if(_0x86d9c5[_0x8a91('0x34')]){delete _0x86d9c5[_0x8a91('0x34')];}_0x5e6e8b[_0x8a91('0x25')](_0x485a22)[_0x8a91('0x35')](_0x86d9c5);};}exports[_0x8a91('0x36')]=function(_0x4304c0,_0x38ce7e){var _0x26edbf={},_0x5a7645={},_0x1d0e4a={'count':0x0,'rows':[]};var _0x20cf18=_[_0x8a91('0x37')](db[_0x8a91('0x38')][_0x8a91('0x39')],function(_0x30164f){return{'name':_0x30164f[_0x8a91('0x3a')],'type':_0x30164f[_0x8a91('0x3b')]['key']};});_0x5a7645[_0x8a91('0x3c')]=_[_0x8a91('0x37')](_0x20cf18,_0x8a91('0x34'));_0x5a7645[_0x8a91('0x3d')]=_[_0x8a91('0x3e')](_0x4304c0[_0x8a91('0x3d')]);_0x5a7645[_0x8a91('0x3f')]=_[_0x8a91('0x40')](_0x5a7645['model'],_0x5a7645[_0x8a91('0x3d')]);_0x26edbf['attributes']=_[_0x8a91('0x40')](_0x5a7645[_0x8a91('0x3c')],qs[_0x8a91('0x41')](_0x4304c0[_0x8a91('0x3d')][_0x8a91('0x41')]));_0x26edbf[_0x8a91('0x42')]=_0x26edbf['attributes'][_0x8a91('0x43')]?_0x26edbf[_0x8a91('0x42')]:_0x5a7645[_0x8a91('0x3c')];if(!_0x4304c0[_0x8a91('0x3d')]['hasOwnProperty']('nolimit')){_0x26edbf[_0x8a91('0x2a')]=qs[_0x8a91('0x2a')](_0x4304c0[_0x8a91('0x3d')]['limit']);_0x26edbf['offset']=qs[_0x8a91('0x28')](_0x4304c0[_0x8a91('0x3d')][_0x8a91('0x28')]);}_0x26edbf[_0x8a91('0x44')]=qs[_0x8a91('0x45')](_0x4304c0[_0x8a91('0x3d')][_0x8a91('0x45')]);_0x26edbf['where']=qs[_0x8a91('0x3f')](_['pick'](_0x4304c0[_0x8a91('0x3d')],_0x5a7645[_0x8a91('0x3f')]),_0x20cf18);if(_0x4304c0[_0x8a91('0x3d')][_0x8a91('0x46')]){_0x26edbf[_0x8a91('0x47')]=_['merge'](_0x26edbf[_0x8a91('0x47')],{'$or':_[_0x8a91('0x37')](_0x20cf18,function(_0x2139fe){if(_0x2139fe[_0x8a91('0x3b')]!==_0x8a91('0x48')){var _0x3febde={};_0x3febde[_0x2139fe[_0x8a91('0x34')]]={'$like':'%'+_0x4304c0['query']['filter']+'%'};return _0x3febde;}})});}_0x26edbf=_[_0x8a91('0x49')]({},_0x26edbf,_0x4304c0[_0x8a91('0x4a')]);var _0x3e3ee6={'where':_0x26edbf['where']};return db[_0x8a91('0x38')][_0x8a91('0x2b')](_0x3e3ee6)[_0x8a91('0x1a')](function(_0x15342a){_0x1d0e4a[_0x8a91('0x2b')]=_0x15342a;if(_0x4304c0[_0x8a91('0x3d')]['includeAll']){_0x26edbf[_0x8a91('0x4b')]=[{'all':!![]}];}return db[_0x8a91('0x38')][_0x8a91('0x4c')](_0x26edbf);})['then'](function(_0x3be035){_0x1d0e4a[_0x8a91('0x4d')]=_0x3be035;return _0x1d0e4a;})[_0x8a91('0x1a')](respondWithFilteredResult(_0x38ce7e,_0x26edbf))[_0x8a91('0x23')](handleError(_0x38ce7e,null));};exports[_0x8a91('0x4e')]=function(_0x57634c,_0x51e32){var _0x510ea5={'raw':![],'where':{'id':_0x57634c['params']['id']}},_0x344bf1={};_0x344bf1[_0x8a91('0x3c')]=_[_0x8a91('0x3e')](db[_0x8a91('0x38')]['rawAttributes']);_0x344bf1[_0x8a91('0x3d')]=_['keys'](_0x57634c[_0x8a91('0x3d')]);_0x344bf1[_0x8a91('0x3f')]=_['intersection'](_0x344bf1[_0x8a91('0x3c')],_0x344bf1[_0x8a91('0x3d')]);_0x510ea5['attributes']=_['intersection'](_0x344bf1[_0x8a91('0x3c')],qs['fields'](_0x57634c[_0x8a91('0x3d')][_0x8a91('0x41')]));_0x510ea5['attributes']=_0x510ea5[_0x8a91('0x42')][_0x8a91('0x43')]?_0x510ea5[_0x8a91('0x42')]:_0x344bf1['model'];if(_0x57634c[_0x8a91('0x3d')][_0x8a91('0x4f')]){_0x510ea5[_0x8a91('0x4b')]=[{'all':!![]}];}_0x510ea5=_[_0x8a91('0x49')]({},_0x510ea5,_0x57634c[_0x8a91('0x4a')]);return db['VoiceContext'][_0x8a91('0x50')](_0x510ea5)[_0x8a91('0x1a')](handleEntityNotFound(_0x51e32,null))[_0x8a91('0x1a')](respondWithResult(_0x51e32,null))[_0x8a91('0x23')](handleError(_0x51e32,null));};exports['create']=function(_0x322c9b,_0x1712dc,_0x5e7f53){var _0x4cfc62;return db[_0x8a91('0x38')]['create'](_0x322c9b['body'],{'raw':!![]})['then'](function(_0x30fdea){_0x4cfc62=_0x30fdea;return db[_0x8a91('0x38')][_0x8a91('0x4c')]({'raw':!![]});})[_0x8a91('0x1a')](function(_0x49a22b){var _0x4df090=fs[_0x8a91('0x51')](path[_0x8a91('0x52')](config[_0x8a91('0x53')],_0x8a91('0x54')),_0x8a91('0x55'));var _0x874489=ejs[_0x8a91('0x56')](_0x4df090,{'contexts':_0x49a22b||[]});fs[_0x8a91('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x874489);})[_0x8a91('0x1a')](function(){return respondWithRpcPromise(_0x8a91('0x58'),_0x8a91('0x59'),{'module':_0x8a91('0x5a')});})[_0x8a91('0x1a')](function(){var _0x575230=_0x322c9b[_0x8a91('0x5b')][_0x8a91('0x2f')]({'plain':!![]});if(!_0x575230)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x575230[_0x8a91('0x5c')]===_0x8a91('0x5b')){var _0x27a188=_0x4cfc62[_0x8a91('0x2f')]({'plain':!![]});return db[_0x8a91('0x5d')][_0x8a91('0x50')]({'where':{'name':_0x8a91('0x30'),'userProfileId':_0x575230['userProfileId']},'raw':!![]})[_0x8a91('0x1a')](function(_0x2933e4){if(_0x2933e4&&_0x2933e4[_0x8a91('0x5e')]===0x0){return db[_0x8a91('0x31')][_0x8a91('0x59')]({'name':_0x27a188[_0x8a91('0x34')],'resourceId':_0x27a188['id'],'type':_0x2933e4[_0x8a91('0x34')],'sectionId':_0x2933e4['id']},{})[_0x8a91('0x1a')](function(){return _0x4cfc62;});}else{return _0x4cfc62;}})[_0x8a91('0x23')](function(_0x404b9c){logger[_0x8a91('0x20')](_0x8a91('0x5f'),_0x404b9c);throw _0x404b9c;});}return _0x4cfc62;})[_0x8a91('0x1a')](respondWithResult(_0x1712dc,0xc9))[_0x8a91('0x23')](handleError(_0x1712dc,null));};exports[_0x8a91('0x60')]=function(_0x485b8b,_0x149e66,_0x47dfc7){var _0x74bbde;return db[_0x8a91('0x38')][_0x8a91('0x50')]({'where':{'id':_0x485b8b[_0x8a91('0x61')]['id']}})[_0x8a91('0x1a')](handleEntityNotFound(_0x149e66,null))[_0x8a91('0x1a')](saveUpdates(_0x485b8b[_0x8a91('0x62')],null))[_0x8a91('0x1a')](function(_0x482e9d){if(_0x482e9d){_0x74bbde=_0x482e9d;return db[_0x8a91('0x38')][_0x8a91('0x4c')]({'raw':!![]});}})[_0x8a91('0x1a')](function(_0x12a199){var _0x6275f1=fs[_0x8a91('0x51')](path[_0x8a91('0x52')](config['root'],_0x8a91('0x54')),'utf8');var _0x31ac24=ejs[_0x8a91('0x56')](_0x6275f1,{'contexts':_0x12a199||[]});fs[_0x8a91('0x57')](_0x8a91('0x63'),_0x31ac24);})[_0x8a91('0x1a')](function(){return respondWithRpcPromise(_0x8a91('0x58'),_0x8a91('0x60'),{'module':_0x8a91('0x5a')});})[_0x8a91('0x1a')](function(){return _0x74bbde;})[_0x8a91('0x1a')](respondWithResult(_0x149e66,null))['catch'](handleError(_0x149e66,null));};exports[_0x8a91('0x32')]=function(_0x337bf0,_0x467d2e,_0x8abd4f){var _0x453adb;return db[_0x8a91('0x38')][_0x8a91('0x50')]({'where':{'id':_0x337bf0[_0x8a91('0x61')]['id']}})['then'](handleEntityNotFound(_0x467d2e,null))[_0x8a91('0x1a')](removeEntity(_0x467d2e,null))[_0x8a91('0x1a')](function(){return db[_0x8a91('0x38')][_0x8a91('0x4c')]({'raw':!![]});})[_0x8a91('0x1a')](function(_0xcb034){var _0x4fec84=fs['readFileSync'](path[_0x8a91('0x52')](config[_0x8a91('0x53')],'server/files/templates/context.ejs'),_0x8a91('0x55'));var _0x18978d=ejs[_0x8a91('0x56')](_0x4fec84,{'contexts':_0xcb034});fs[_0x8a91('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x18978d);return respondWithRpcPromise(_0x8a91('0x58'),_0x8a91('0x32'),{'module':_0x8a91('0x5a')});})['catch'](handleError(_0x467d2e,null));}; \ No newline at end of file +var _0x4deb=['update','destroy','get','UserProfileResource','stack','name','send','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceContext','includeAll','findAll','rows','show','rawAttributes','include','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','params','join','chan_sip.so','render','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','VoiceContext,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','set','apply','reject'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x4deb,0x17c));var _0xb4de=function(_0x44ca6e,_0x5e2c91){_0x44ca6e=_0x44ca6e-0x0;var _0x2edab2=_0x4deb[_0x44ca6e];return _0x2edab2;};'use strict';var emlformat=require(_0xb4de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4de('0x1'));var jsonpatch=require(_0xb4de('0x2'));var rp=require(_0xb4de('0x3'));var moment=require('moment');var BPromise=require(_0xb4de('0x4'));var Mustache=require(_0xb4de('0x5'));var util=require(_0xb4de('0x6'));var path=require(_0xb4de('0x7'));var sox=require(_0xb4de('0x8'));var csv=require(_0xb4de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4de('0xa'));var _=require(_0xb4de('0xb'));var squel=require(_0xb4de('0xc'));var crypto=require(_0xb4de('0xd'));var jsforce=require(_0xb4de('0xe'));var deskjs=require(_0xb4de('0xf'));var toCsv=require(_0xb4de('0x9'));var querystring=require(_0xb4de('0x10'));var Papa=require(_0xb4de('0x11'));var Redis=require(_0xb4de('0x12'));var authService=require(_0xb4de('0x13'));var qs=require(_0xb4de('0x14'));var as=require(_0xb4de('0x15'));var hardwareService=require(_0xb4de('0x16'));var logger=require(_0xb4de('0x17'))(_0xb4de('0x18'));var utils=require(_0xb4de('0x19'));var config=require(_0xb4de('0x1a'));var licenseUtil=require(_0xb4de('0x1b'));var db=require(_0xb4de('0x1c'))['db'];var jayson=require(_0xb4de('0x1d'));var client=jayson[_0xb4de('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf894ea,_0x401883,_0x566c6f,_0xc82803){return new BPromise(function(_0x5749cd,_0xa758b3){var _0x2b9318=_0xc82803||client;return _0x2b9318[_0xb4de('0x1f')](_0xf894ea,_0x566c6f)[_0xb4de('0x20')](function(_0x10b596){logger['info']('VoiceContext,\x20%s,\x20%s',_0x401883,_0xb4de('0x21'));logger[_0xb4de('0x22')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x401883,_0xb4de('0x21'),JSON[_0xb4de('0x23')](_0x10b596));if(_0x10b596[_0xb4de('0x24')]){if(_0x10b596[_0xb4de('0x24')]['code']===0x1f4){logger['error'](_0xb4de('0x25'),_0x401883,_0x10b596['error'][_0xb4de('0x26')]);return _0xa758b3(_0x10b596[_0xb4de('0x24')][_0xb4de('0x26')]);}logger[_0xb4de('0x24')](_0xb4de('0x25'),_0x401883,_0x10b596[_0xb4de('0x24')][_0xb4de('0x26')]);return _0x5749cd(_0x10b596['error'][_0xb4de('0x26')]);}else{logger[_0xb4de('0x27')]('VoiceContext,\x20%s,\x20%s',_0x401883,_0xb4de('0x21'));_0x5749cd(_0x10b596[_0xb4de('0x28')]['message']);}})[_0xb4de('0x29')](function(_0x2c621b){logger[_0xb4de('0x24')](_0xb4de('0x25'),_0x401883,_0x2c621b);_0xa758b3(_0x2c621b);});});}function respondWithStatusCode(_0x34eb44,_0x18f24e){_0x18f24e=_0x18f24e||0xcc;return function(_0x340306){if(_0x340306){return _0x34eb44[_0xb4de('0x2a')](_0x18f24e);}return _0x34eb44[_0xb4de('0x2b')](_0x18f24e)[_0xb4de('0x2c')]();};}function respondWithResult(_0x46deb0,_0x140218){_0x140218=_0x140218||0xc8;return function(_0x1c6712){if(_0x1c6712){return _0x46deb0[_0xb4de('0x2b')](_0x140218)[_0xb4de('0x2d')](_0x1c6712);}};}function respondWithFilteredResult(_0x4f1232,_0x244859){return function(_0x3b2494){if(_0x3b2494){var _0xc9a447=typeof _0x244859[_0xb4de('0x2e')]===_0xb4de('0x2f')&&typeof _0x244859['limit']===_0xb4de('0x2f');var _0xaad39f=_0x3b2494[_0xb4de('0x30')];var _0x181c5e=_0xc9a447?0x0:_0x244859[_0xb4de('0x2e')];var _0x115366=_0xc9a447?_0x3b2494[_0xb4de('0x30')]:_0x244859[_0xb4de('0x2e')]+_0x244859['limit'];var _0x59841b;if(_0x115366>=_0xaad39f){_0x115366=_0xaad39f;_0x59841b=0xc8;}else{_0x59841b=0xce;}_0x4f1232[_0xb4de('0x2b')](_0x59841b);return _0x4f1232[_0xb4de('0x31')]('Content-Range',_0x181c5e+'-'+_0x115366+'/'+_0xaad39f)['json'](_0x3b2494);}return null;};}function patchUpdates(_0x4cf025){return function(_0x1ca304){try{jsonpatch[_0xb4de('0x32')](_0x1ca304,_0x4cf025,!![]);}catch(_0x2db0e9){return BPromise[_0xb4de('0x33')](_0x2db0e9);}return _0x1ca304['save']();};}function saveUpdates(_0x4b5bd1,_0x57910f){return function(_0x580e9d){if(_0x580e9d){return _0x580e9d[_0xb4de('0x34')](_0x4b5bd1)[_0xb4de('0x20')](function(_0xc40b76){return _0xc40b76;});}return null;};}function removeEntity(_0x20d4f2,_0x33d8a9){return function(_0x2b9964){if(_0x2b9964){return _0x2b9964[_0xb4de('0x35')]()[_0xb4de('0x20')](function(){var _0x36e310=_0x2b9964[_0xb4de('0x36')]({'plain':!![]});var _0x50ba87='Contexts';return db[_0xb4de('0x37')][_0xb4de('0x35')]({'where':{'type':_0x50ba87,'resourceId':_0x36e310['id']}})[_0xb4de('0x20')](function(){return _0x2b9964;});})[_0xb4de('0x20')](function(){_0x20d4f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa10a,_0x439f79){return function(_0x4bbf41){if(!_0x4bbf41){_0x5aa10a[_0xb4de('0x2a')](0x194);}return _0x4bbf41;};}function handleError(_0x338a9,_0x2e61df){_0x2e61df=_0x2e61df||0x1f4;return function(_0x9b7d61){logger[_0xb4de('0x24')](_0x9b7d61[_0xb4de('0x38')]);if(_0x9b7d61['name']){delete _0x9b7d61[_0xb4de('0x39')];}_0x338a9[_0xb4de('0x2b')](_0x2e61df)[_0xb4de('0x3a')](_0x9b7d61);};}exports['index']=function(_0x376ef7,_0x1b9730){var _0x6da6df={},_0x196a5a={},_0x4983f5={'count':0x0,'rows':[]};var _0x439248=_[_0xb4de('0x3b')](db['VoiceContext']['rawAttributes'],function(_0x4a8517){return{'name':_0x4a8517['fieldName'],'type':_0x4a8517['type'][_0xb4de('0x3c')]};});_0x196a5a[_0xb4de('0x3d')]=_[_0xb4de('0x3b')](_0x439248,_0xb4de('0x39'));_0x196a5a[_0xb4de('0x3e')]=_[_0xb4de('0x3f')](_0x376ef7[_0xb4de('0x3e')]);_0x196a5a[_0xb4de('0x40')]=_[_0xb4de('0x41')](_0x196a5a['model'],_0x196a5a[_0xb4de('0x3e')]);_0x6da6df[_0xb4de('0x42')]=_['intersection'](_0x196a5a[_0xb4de('0x3d')],qs[_0xb4de('0x43')](_0x376ef7[_0xb4de('0x3e')][_0xb4de('0x43')]));_0x6da6df[_0xb4de('0x42')]=_0x6da6df[_0xb4de('0x42')][_0xb4de('0x44')]?_0x6da6df[_0xb4de('0x42')]:_0x196a5a[_0xb4de('0x3d')];if(!_0x376ef7[_0xb4de('0x3e')][_0xb4de('0x45')](_0xb4de('0x46'))){_0x6da6df[_0xb4de('0x47')]=qs[_0xb4de('0x47')](_0x376ef7[_0xb4de('0x3e')][_0xb4de('0x47')]);_0x6da6df[_0xb4de('0x2e')]=qs[_0xb4de('0x2e')](_0x376ef7['query'][_0xb4de('0x2e')]);}_0x6da6df[_0xb4de('0x48')]=qs[_0xb4de('0x49')](_0x376ef7[_0xb4de('0x3e')]['sort']);_0x6da6df['where']=qs['filters'](_[_0xb4de('0x4a')](_0x376ef7['query'],_0x196a5a[_0xb4de('0x40')]),_0x439248);if(_0x376ef7[_0xb4de('0x3e')][_0xb4de('0x4b')]){_0x6da6df[_0xb4de('0x4c')]=_['merge'](_0x6da6df[_0xb4de('0x4c')],{'$or':_[_0xb4de('0x3b')](_0x439248,function(_0x5572ba){if(_0x5572ba['type']!==_0xb4de('0x4d')){var _0x18d74a={};_0x18d74a[_0x5572ba[_0xb4de('0x39')]]={'$like':'%'+_0x376ef7[_0xb4de('0x3e')][_0xb4de('0x4b')]+'%'};return _0x18d74a;}})});}_0x6da6df=_[_0xb4de('0x4e')]({},_0x6da6df,_0x376ef7[_0xb4de('0x4f')]);var _0x1e97bd={'where':_0x6da6df[_0xb4de('0x4c')]};return db[_0xb4de('0x50')][_0xb4de('0x30')](_0x1e97bd)[_0xb4de('0x20')](function(_0x5e8c4f){_0x4983f5[_0xb4de('0x30')]=_0x5e8c4f;if(_0x376ef7['query'][_0xb4de('0x51')]){_0x6da6df['include']=[{'all':!![]}];}return db[_0xb4de('0x50')][_0xb4de('0x52')](_0x6da6df);})[_0xb4de('0x20')](function(_0x4f818e){_0x4983f5[_0xb4de('0x53')]=_0x4f818e;return _0x4983f5;})[_0xb4de('0x20')](respondWithFilteredResult(_0x1b9730,_0x6da6df))[_0xb4de('0x29')](handleError(_0x1b9730,null));};exports[_0xb4de('0x54')]=function(_0x10023f,_0x427747){var _0x1c2a5c={'raw':![],'where':{'id':_0x10023f['params']['id']}},_0x8da450={};_0x8da450[_0xb4de('0x3d')]=_['keys'](db[_0xb4de('0x50')][_0xb4de('0x55')]);_0x8da450[_0xb4de('0x3e')]=_[_0xb4de('0x3f')](_0x10023f[_0xb4de('0x3e')]);_0x8da450[_0xb4de('0x40')]=_['intersection'](_0x8da450['model'],_0x8da450[_0xb4de('0x3e')]);_0x1c2a5c[_0xb4de('0x42')]=_['intersection'](_0x8da450[_0xb4de('0x3d')],qs[_0xb4de('0x43')](_0x10023f[_0xb4de('0x3e')][_0xb4de('0x43')]));_0x1c2a5c[_0xb4de('0x42')]=_0x1c2a5c[_0xb4de('0x42')][_0xb4de('0x44')]?_0x1c2a5c[_0xb4de('0x42')]:_0x8da450['model'];if(_0x10023f['query'][_0xb4de('0x51')]){_0x1c2a5c[_0xb4de('0x56')]=[{'all':!![]}];}_0x1c2a5c=_[_0xb4de('0x4e')]({},_0x1c2a5c,_0x10023f[_0xb4de('0x4f')]);return db[_0xb4de('0x50')][_0xb4de('0x57')](_0x1c2a5c)[_0xb4de('0x20')](handleEntityNotFound(_0x427747,null))[_0xb4de('0x20')](respondWithResult(_0x427747,null))[_0xb4de('0x29')](handleError(_0x427747,null));};exports['create']=function(_0x539a87,_0x30a473,_0xa1c60b){var _0x1dd269;return db[_0xb4de('0x50')][_0xb4de('0x58')](_0x539a87[_0xb4de('0x59')],{'raw':!![]})[_0xb4de('0x20')](function(_0x3fd2e4){_0x1dd269=_0x3fd2e4;return db['VoiceContext'][_0xb4de('0x52')]({'raw':!![]});})[_0xb4de('0x20')](function(_0x2a922c){var _0x4252f1=fs[_0xb4de('0x5a')](path['join'](config[_0xb4de('0x5b')],_0xb4de('0x5c')),_0xb4de('0x5d'));var _0x38f1bd=ejs['render'](_0x4252f1,{'contexts':_0x2a922c||[]});fs[_0xb4de('0x5e')](_0xb4de('0x5f'),_0x38f1bd);})[_0xb4de('0x20')](function(){return respondWithRpcPromise(_0xb4de('0x60'),'create',{'module':'chan_sip.so'});})[_0xb4de('0x20')](function(){var _0x31a751=_0x539a87[_0xb4de('0x61')][_0xb4de('0x36')]({'plain':!![]});if(!_0x31a751)throw new Error(_0xb4de('0x62'));if(_0x31a751[_0xb4de('0x63')]===_0xb4de('0x61')){var _0x250975=_0x1dd269[_0xb4de('0x36')]({'plain':!![]});return db[_0xb4de('0x64')][_0xb4de('0x57')]({'where':{'name':_0xb4de('0x65'),'userProfileId':_0x31a751[_0xb4de('0x66')]},'raw':!![]})[_0xb4de('0x20')](function(_0x4b86a1){if(_0x4b86a1&&_0x4b86a1[_0xb4de('0x67')]===0x0){return db[_0xb4de('0x37')][_0xb4de('0x58')]({'name':_0x250975[_0xb4de('0x39')],'resourceId':_0x250975['id'],'type':_0x4b86a1[_0xb4de('0x39')],'sectionId':_0x4b86a1['id']},{})[_0xb4de('0x20')](function(){return _0x1dd269;});}else{return _0x1dd269;}})[_0xb4de('0x29')](function(_0x259abd){logger[_0xb4de('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x259abd);throw _0x259abd;});}return _0x1dd269;})[_0xb4de('0x20')](respondWithResult(_0x30a473,0xc9))[_0xb4de('0x29')](handleError(_0x30a473,null));};exports[_0xb4de('0x34')]=function(_0x3ea8b9,_0x28b48d,_0x2bb4ff){var _0x53e856;return db['VoiceContext']['find']({'where':{'id':_0x3ea8b9[_0xb4de('0x68')]['id']}})[_0xb4de('0x20')](handleEntityNotFound(_0x28b48d,null))['then'](saveUpdates(_0x3ea8b9[_0xb4de('0x59')],null))[_0xb4de('0x20')](function(_0x1a0347){if(_0x1a0347){_0x53e856=_0x1a0347;return db[_0xb4de('0x50')][_0xb4de('0x52')]({'raw':!![]});}})[_0xb4de('0x20')](function(_0x4ed97b){var _0xd7e79a=fs['readFileSync'](path[_0xb4de('0x69')](config[_0xb4de('0x5b')],_0xb4de('0x5c')),'utf8');var _0x191230=ejs['render'](_0xd7e79a,{'contexts':_0x4ed97b||[]});fs[_0xb4de('0x5e')](_0xb4de('0x5f'),_0x191230);})[_0xb4de('0x20')](function(){return respondWithRpcPromise(_0xb4de('0x60'),_0xb4de('0x34'),{'module':_0xb4de('0x6a')});})[_0xb4de('0x20')](function(){return _0x53e856;})[_0xb4de('0x20')](respondWithResult(_0x28b48d,null))['catch'](handleError(_0x28b48d,null));};exports['destroy']=function(_0x3fba65,_0x4d6819,_0x3f5655){var _0x360f9d;return db[_0xb4de('0x50')][_0xb4de('0x57')]({'where':{'id':_0x3fba65[_0xb4de('0x68')]['id']}})[_0xb4de('0x20')](handleEntityNotFound(_0x4d6819,null))[_0xb4de('0x20')](removeEntity(_0x4d6819,null))[_0xb4de('0x20')](function(){return db[_0xb4de('0x50')]['findAll']({'raw':!![]});})[_0xb4de('0x20')](function(_0x5633a2){var _0x32b331=fs[_0xb4de('0x5a')](path['join'](config[_0xb4de('0x5b')],'server/files/templates/context.ejs'),_0xb4de('0x5d'));var _0x4f53c8=ejs[_0xb4de('0x6b')](_0x32b331,{'contexts':_0x5633a2});fs[_0xb4de('0x5e')](_0xb4de('0x5f'),_0x4f53c8);return respondWithRpcPromise(_0xb4de('0x60'),_0xb4de('0x35'),{'module':'chan_sip.so'});})[_0xb4de('0x29')](handleError(_0x4d6819,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index d56b0f3..d0e0ac3 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 _0x6973=['bluebird','request-promise','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x1df75f,_0x13a053){var _0x3ab3df=function(_0x593239){while(--_0x593239){_0x1df75f['push'](_0x1df75f['shift']());}};_0x3ab3df(++_0x13a053);}(_0x6973,0x1f3));var _0x3697=function(_0x55cb95,_0x5c6523){_0x55cb95=_0x55cb95-0x0;var _0x33cff1=_0x6973[_0x55cb95];return _0x33cff1;};'use strict';var _=require(_0x3697('0x0'));var util=require(_0x3697('0x1'));var logger=require(_0x3697('0x2'))(_0x3697('0x3'));var moment=require(_0x3697('0x4'));var BPromise=require(_0x3697('0x5'));var rp=require(_0x3697('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3697('0x7'));module[_0x3697('0x8')]=function(_0x675b9d,_0x51a238){return _0x675b9d[_0x3697('0x9')](_0x3697('0xa'),attributes,{'tableName':_0x3697('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd32=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x221f45,_0xa87c28){var _0x3abdb9=function(_0x3412a6){while(--_0x3412a6){_0x221f45['push'](_0x221f45['shift']());}};_0x3abdb9(++_0xa87c28);}(_0xcd32,0x12e));var _0x2cd3=function(_0x2923e0,_0xe88675){_0x2923e0=_0x2923e0-0x0;var _0x1b780e=_0xcd32[_0x2923e0];return _0x1b780e;};'use strict';var _=require(_0x2cd3('0x0'));var util=require(_0x2cd3('0x1'));var logger=require(_0x2cd3('0x2'))(_0x2cd3('0x3'));var moment=require(_0x2cd3('0x4'));var BPromise=require(_0x2cd3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cd3('0x6'));var rimraf=require(_0x2cd3('0x7'));var config=require(_0x2cd3('0x8'));var attributes=require(_0x2cd3('0x9'));module[_0x2cd3('0xa')]=function(_0x4ac0cc,_0x1b65f1){return _0x4ac0cc[_0x2cd3('0xb')](_0x2cd3('0xc'),attributes,{'tableName':_0x2cd3('0xd'),'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 5090fb7..148f4b2 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 _0x3eaf=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','VoiceContext,\x20%s,\x20%s','message'];(function(_0x7aad15,_0x5e7f){var _0x420c7e=function(_0x3a2e0a){while(--_0x3a2e0a){_0x7aad15['push'](_0x7aad15['shift']());}};_0x420c7e(++_0x5e7f);}(_0x3eaf,0x190));var _0xf3ea=function(_0x1de11a,_0x406660){_0x1de11a=_0x1de11a-0x0;var _0x1cf2bd=_0x3eaf[_0x1de11a];return _0x1cf2bd;};'use strict';var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var moment=require(_0xf3ea('0x2'));var BPromise=require(_0xf3ea('0x3'));var rs=require(_0xf3ea('0x4'));var fs=require('fs');var Redis=require(_0xf3ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3ea('0x6'));var logger=require(_0xf3ea('0x7'))(_0xf3ea('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3ea('0x9'));var client=jayson['client'][_0xf3ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac6bd,_0x1708c3,_0x526b29){return new BPromise(function(_0x1819bc,_0x5517ad){return client[_0xf3ea('0xb')](_0x1ac6bd,_0x526b29)[_0xf3ea('0xc')](function(_0x52384d){logger[_0xf3ea('0xd')]('VoiceContext,\x20%s,\x20%s',_0x1708c3,_0xf3ea('0xe'));logger[_0xf3ea('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1708c3,'request\x20sent',JSON[_0xf3ea('0x10')](_0x52384d));if(_0x52384d[_0xf3ea('0x11')]){if(_0x52384d[_0xf3ea('0x11')]['code']===0x1f4){logger[_0xf3ea('0x11')](_0xf3ea('0x12'),_0x1708c3,_0x52384d[_0xf3ea('0x11')]['message']);return _0x5517ad(_0x52384d[_0xf3ea('0x11')][_0xf3ea('0x13')]);}logger[_0xf3ea('0x11')](_0xf3ea('0x12'),_0x1708c3,_0x52384d[_0xf3ea('0x11')][_0xf3ea('0x13')]);return _0x1819bc(_0x52384d[_0xf3ea('0x11')][_0xf3ea('0x13')]);}else{logger['info'](_0xf3ea('0x12'),_0x1708c3,'request\x20sent');_0x1819bc(_0x52384d[_0xf3ea('0x14')][_0xf3ea('0x13')]);}})['catch'](function(_0x311508){logger[_0xf3ea('0x11')](_0xf3ea('0x12'),_0x1708c3,_0x311508);_0x5517ad(_0x311508);});});} \ No newline at end of file +var _0x1e41=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e41,0x11c));var _0x11e4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1e41[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x11e4('0x0'));var moment=require(_0x11e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x11e4('0x2'));var fs=require('fs');var Redis=require(_0x11e4('0x3'));var db=require(_0x11e4('0x4'))['db'];var utils=require(_0x11e4('0x5'));var logger=require('../../config/logger')(_0x11e4('0x6'));var config=require(_0x11e4('0x7'));var jayson=require(_0x11e4('0x8'));var client=jayson['client'][_0x11e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xee095e,_0x1eab1b,_0x2b1b9a){return new BPromise(function(_0x15ca35,_0x153e81){return client[_0x11e4('0xa')](_0xee095e,_0x2b1b9a)['then'](function(_0x3c1a5c){logger[_0x11e4('0xb')](_0x11e4('0xc'),_0x1eab1b,_0x11e4('0xd'));logger[_0x11e4('0xe')](_0x11e4('0xf'),_0x1eab1b,_0x11e4('0xd'),JSON[_0x11e4('0x10')](_0x3c1a5c));if(_0x3c1a5c['error']){if(_0x3c1a5c[_0x11e4('0x11')][_0x11e4('0x12')]===0x1f4){logger[_0x11e4('0x11')]('VoiceContext,\x20%s,\x20%s',_0x1eab1b,_0x3c1a5c['error'][_0x11e4('0x13')]);return _0x153e81(_0x3c1a5c[_0x11e4('0x11')]['message']);}logger[_0x11e4('0x11')](_0x11e4('0xc'),_0x1eab1b,_0x3c1a5c[_0x11e4('0x11')][_0x11e4('0x13')]);return _0x15ca35(_0x3c1a5c[_0x11e4('0x11')][_0x11e4('0x13')]);}else{logger['info'](_0x11e4('0xc'),_0x1eab1b,_0x11e4('0xd'));_0x15ca35(_0x3c1a5c[_0x11e4('0x14')]['message']);}})[_0x11e4('0x15')](function(_0xd2c83e){logger[_0x11e4('0x11')](_0x11e4('0xc'),_0x1eab1b,_0xd2c83e);_0x153e81(_0xd2c83e);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 504f2f0..66be1d4 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 _0x9bdf=['../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id','update','delete','exports','multer','express','fs-extra'];(function(_0x13610a,_0x4f866c){var _0x150ecc=function(_0x383f46){while(--_0x383f46){_0x13610a['push'](_0x13610a['shift']());}};_0x150ecc(++_0x4f866c);}(_0x9bdf,0x1dd));var _0xf9bd=function(_0x4b234f,_0x30d262){_0x4b234f=_0x4b234f-0x0;var _0x4d3db1=_0x9bdf[_0x4b234f];return _0x4d3db1;};'use strict';var multer=require(_0xf9bd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf9bd('0x1'));var router=express['Router']();var fs_extra=require(_0xf9bd('0x2'));var auth=require(_0xf9bd('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf9bd('0x4'));router[_0xf9bd('0x5')]('/',auth[_0xf9bd('0x6')](),controller[_0xf9bd('0x7')]);router['get'](_0xf9bd('0x8'),auth[_0xf9bd('0x6')](),controller[_0xf9bd('0x9')]);router[_0xf9bd('0x5')]('/:id',auth[_0xf9bd('0x6')](),controller['show']);router[_0xf9bd('0xa')]('/',auth[_0xf9bd('0x6')](),controller['create']);router[_0xf9bd('0xb')](_0xf9bd('0xc'),auth['isAuthenticated'](),controller[_0xf9bd('0xd')]);router[_0xf9bd('0xe')](_0xf9bd('0xc'),auth[_0xf9bd('0x6')](),controller['destroy']);module[_0xf9bd('0xf')]=router; \ No newline at end of file +var _0xf0a3=['post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x3c70da,_0x189a68){var _0x5595ab=function(_0x8033b5){while(--_0x8033b5){_0x3c70da['push'](_0x3c70da['shift']());}};_0x5595ab(++_0x189a68);}(_0xf0a3,0xe1));var _0x3f0a=function(_0x4c6765,_0x36e94b){_0x4c6765=_0x4c6765-0x0;var _0xc6ad74=_0xf0a3[_0x4c6765];return _0xc6ad74;};'use strict';var multer=require(_0x3f0a('0x0'));var util=require(_0x3f0a('0x1'));var path=require(_0x3f0a('0x2'));var timeout=require(_0x3f0a('0x3'));var express=require(_0x3f0a('0x4'));var router=express[_0x3f0a('0x5')]();var fs_extra=require(_0x3f0a('0x6'));var auth=require(_0x3f0a('0x7'));var interaction=require(_0x3f0a('0x8'));var config=require(_0x3f0a('0x9'));var controller=require(_0x3f0a('0xa'));router['get']('/',auth[_0x3f0a('0xb')](),controller[_0x3f0a('0xc')]);router[_0x3f0a('0xd')]('/describe',auth[_0x3f0a('0xb')](),controller[_0x3f0a('0xe')]);router[_0x3f0a('0xd')](_0x3f0a('0xf'),auth[_0x3f0a('0xb')](),controller[_0x3f0a('0x10')]);router[_0x3f0a('0x11')]('/',auth['isAuthenticated'](),controller[_0x3f0a('0x12')]);router['put'](_0x3f0a('0xf'),auth['isAuthenticated'](),controller[_0x3f0a('0x13')]);router['delete'](_0x3f0a('0xf'),auth[_0x3f0a('0xb')](),controller[_0x3f0a('0x14')]);module[_0x3f0a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5520737..790f076 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 _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x22556e,_0x12cdb2){var _0x546e7a=function(_0x16b3cf){while(--_0x16b3cf){_0x22556e['push'](_0x22556e['shift']());}};_0x546e7a(++_0x12cdb2);}(_0x98a8,0x12c));var _0x898a=function(_0x24f0e4,_0xc776e3){_0x24f0e4=_0x24f0e4-0x0;var _0x16554c=_0x98a8[_0x24f0e4];return _0x16554c;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x5efe0e,_0x289ad2){var _0x1d14cd=function(_0x3afe82){while(--_0x3afe82){_0x5efe0e['push'](_0x5efe0e['shift']());}};_0x1d14cd(++_0x289ad2);}(_0x425d,0x1e0));var _0xd425=function(_0x5d2a31,_0x4920fb){_0x5d2a31=_0x5d2a31-0x0;var _0x577a7e=_0x425d[_0x5d2a31];return _0x577a7e;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x2')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize[_0xd425('0x1')]},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x2')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'destlinkedid':{'type':Sequelize[_0xd425('0x1')]},'dialstring':{'type':Sequelize[_0xd425('0x1')]},'dialstatus':{'type':Sequelize[_0xd425('0x1')]},'starttime':{'type':Sequelize[_0xd425('0x3')]},'answertime':{'type':Sequelize[_0xd425('0x3')]},'endtime':{'type':Sequelize[_0xd425('0x3')]},'lastevent':{'type':Sequelize[_0xd425('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd425('0x2')]},'duration':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 15f142b..6d88306 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 _0x3419=['limit','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','options','include','findAll','catch','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x250c78,_0x25b838){var _0x44f07a=function(_0x599b41){while(--_0x599b41){_0x250c78['push'](_0x250c78['shift']());}};_0x44f07a(++_0x25b838);}(_0x3419,0x133));var _0x9341=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0x3419[_0x34e4a0];return _0x3ead3e;};'use strict';var emlformat=require(_0x9341('0x0'));var rimraf=require(_0x9341('0x1'));var zipdir=require(_0x9341('0x2'));var jsonpatch=require(_0x9341('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9341('0x4'));var Mustache=require(_0x9341('0x5'));var util=require('util');var path=require(_0x9341('0x6'));var sox=require(_0x9341('0x7'));var csv=require(_0x9341('0x8'));var ejs=require(_0x9341('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9341('0xa'));var crypto=require(_0x9341('0xb'));var jsforce=require(_0x9341('0xc'));var deskjs=require(_0x9341('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9341('0xe'));var authService=require(_0x9341('0xf'));var qs=require(_0x9341('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9341('0x11'))('api');var utils=require(_0x9341('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9341('0x13'));var db=require(_0x9341('0x14'))['db'];function respondWithStatusCode(_0x2506ae,_0x5f0761){_0x5f0761=_0x5f0761||0xcc;return function(_0x3b351d){if(_0x3b351d){return _0x2506ae[_0x9341('0x15')](_0x5f0761);}return _0x2506ae[_0x9341('0x16')](_0x5f0761)[_0x9341('0x17')]();};}function respondWithResult(_0x4b8c58,_0x23e00c){_0x23e00c=_0x23e00c||0xc8;return function(_0x25fbc8){if(_0x25fbc8){return _0x4b8c58[_0x9341('0x16')](_0x23e00c)[_0x9341('0x18')](_0x25fbc8);}};}function respondWithFilteredResult(_0x5ce526,_0x45ae12){return function(_0x4aff47){if(_0x4aff47){var _0x2f29f7=typeof _0x45ae12[_0x9341('0x19')]===_0x9341('0x1a')&&typeof _0x45ae12['limit']==='undefined';var _0x323e74=_0x4aff47['count'];var _0x518efe=_0x2f29f7?0x0:_0x45ae12[_0x9341('0x19')];var _0x44ecb0=_0x2f29f7?_0x4aff47[_0x9341('0x1b')]:_0x45ae12['offset']+_0x45ae12[_0x9341('0x1c')];var _0x5b8847;if(_0x44ecb0>=_0x323e74){_0x44ecb0=_0x323e74;_0x5b8847=0xc8;}else{_0x5b8847=0xce;}_0x5ce526[_0x9341('0x16')](_0x5b8847);return _0x5ce526['set'](_0x9341('0x1d'),_0x518efe+'-'+_0x44ecb0+'/'+_0x323e74)['json'](_0x4aff47);}return null;};}function patchUpdates(_0x53d331){return function(_0x309123){try{jsonpatch['apply'](_0x309123,_0x53d331,!![]);}catch(_0xfb96f8){return BPromise[_0x9341('0x1e')](_0xfb96f8);}return _0x309123[_0x9341('0x1f')]();};}function saveUpdates(_0x4dbfd2,_0x579a42){return function(_0x2d2a4d){if(_0x2d2a4d){return _0x2d2a4d[_0x9341('0x20')](_0x4dbfd2)[_0x9341('0x21')](function(_0x7c035b){return _0x7c035b;});}return null;};}function removeEntity(_0x2a82e6,_0x55a178){return function(_0x26ab50){if(_0x26ab50){return _0x26ab50[_0x9341('0x22')]()['then'](function(){_0x2a82e6[_0x9341('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x529e71,_0x4ae752){return function(_0x2271bc){if(!_0x2271bc){_0x529e71['sendStatus'](0x194);}return _0x2271bc;};}function handleError(_0x1556c2,_0x313135){_0x313135=_0x313135||0x1f4;return function(_0x10bb3c){logger[_0x9341('0x23')](_0x10bb3c['stack']);if(_0x10bb3c[_0x9341('0x24')]){delete _0x10bb3c[_0x9341('0x24')];}_0x1556c2['status'](_0x313135)[_0x9341('0x25')](_0x10bb3c);};}exports[_0x9341('0x26')]=function(_0x53e01a,_0x2407eb){var _0x12d3f6={},_0x59f1e5={},_0x4655e6={'count':0x0,'rows':[]};var _0x127887=_[_0x9341('0x27')](db[_0x9341('0x28')][_0x9341('0x29')],function(_0x30fd22){return{'name':_0x30fd22['fieldName'],'type':_0x30fd22['type'][_0x9341('0x2a')]};});_0x59f1e5[_0x9341('0x2b')]=_[_0x9341('0x27')](_0x127887,_0x9341('0x24'));_0x59f1e5[_0x9341('0x2c')]=_[_0x9341('0x2d')](_0x53e01a[_0x9341('0x2c')]);_0x59f1e5[_0x9341('0x2e')]=_[_0x9341('0x2f')](_0x59f1e5[_0x9341('0x2b')],_0x59f1e5[_0x9341('0x2c')]);_0x12d3f6[_0x9341('0x30')]=_[_0x9341('0x2f')](_0x59f1e5[_0x9341('0x2b')],qs['fields'](_0x53e01a[_0x9341('0x2c')][_0x9341('0x31')]));_0x12d3f6[_0x9341('0x30')]=_0x12d3f6[_0x9341('0x30')][_0x9341('0x32')]?_0x12d3f6['attributes']:_0x59f1e5[_0x9341('0x2b')];if(!_0x53e01a[_0x9341('0x2c')][_0x9341('0x33')](_0x9341('0x34'))){_0x12d3f6[_0x9341('0x1c')]=qs[_0x9341('0x1c')](_0x53e01a[_0x9341('0x2c')][_0x9341('0x1c')]);_0x12d3f6[_0x9341('0x19')]=qs[_0x9341('0x19')](_0x53e01a[_0x9341('0x2c')][_0x9341('0x19')]);}_0x12d3f6[_0x9341('0x35')]=qs[_0x9341('0x36')](_0x53e01a[_0x9341('0x2c')][_0x9341('0x36')]);_0x12d3f6[_0x9341('0x37')]=qs[_0x9341('0x2e')](_['pick'](_0x53e01a[_0x9341('0x2c')],_0x59f1e5[_0x9341('0x2e')]),_0x127887);if(_0x53e01a['query']['filter']){_0x12d3f6['where']=_[_0x9341('0x38')](_0x12d3f6['where'],{'$or':_[_0x9341('0x27')](_0x127887,function(_0x500982){if(_0x500982[_0x9341('0x39')]!=='VIRTUAL'){var _0x1275e0={};_0x1275e0[_0x500982[_0x9341('0x24')]]={'$like':'%'+_0x53e01a[_0x9341('0x2c')]['filter']+'%'};return _0x1275e0;}})});}_0x12d3f6=_[_0x9341('0x38')]({},_0x12d3f6,_0x53e01a[_0x9341('0x3a')]);var _0x110227={'where':_0x12d3f6[_0x9341('0x37')]};return db[_0x9341('0x28')][_0x9341('0x1b')](_0x110227)[_0x9341('0x21')](function(_0x4ca550){_0x4655e6[_0x9341('0x1b')]=_0x4ca550;if(_0x53e01a[_0x9341('0x2c')]['includeAll']){_0x12d3f6[_0x9341('0x3b')]=[{'all':!![]}];}return db[_0x9341('0x28')][_0x9341('0x3c')](_0x12d3f6);})[_0x9341('0x21')](function(_0x4bf8a7){_0x4655e6['rows']=_0x4bf8a7;return _0x4655e6;})[_0x9341('0x21')](respondWithFilteredResult(_0x2407eb,_0x12d3f6))[_0x9341('0x3d')](handleError(_0x2407eb,null));};exports['show']=function(_0x493716,_0xf582f3){var _0x3b71c5={'raw':!![],'where':{'id':_0x493716[_0x9341('0x3e')]['id']}},_0x243b2c={};_0x243b2c[_0x9341('0x2b')]=_[_0x9341('0x2d')](db[_0x9341('0x28')][_0x9341('0x29')]);_0x243b2c[_0x9341('0x2c')]=_[_0x9341('0x2d')](_0x493716['query']);_0x243b2c[_0x9341('0x2e')]=_['intersection'](_0x243b2c[_0x9341('0x2b')],_0x243b2c['query']);_0x3b71c5[_0x9341('0x30')]=_['intersection'](_0x243b2c[_0x9341('0x2b')],qs[_0x9341('0x31')](_0x493716[_0x9341('0x2c')][_0x9341('0x31')]));_0x3b71c5[_0x9341('0x30')]=_0x3b71c5[_0x9341('0x30')][_0x9341('0x32')]?_0x3b71c5['attributes']:_0x243b2c['model'];if(_0x493716[_0x9341('0x2c')]['includeAll']){_0x3b71c5[_0x9341('0x3b')]=[{'all':!![]}];}_0x3b71c5=_['merge']({},_0x3b71c5,_0x493716[_0x9341('0x3a')]);return db[_0x9341('0x28')]['find'](_0x3b71c5)[_0x9341('0x21')](handleEntityNotFound(_0xf582f3,null))['then'](respondWithResult(_0xf582f3,null))[_0x9341('0x3d')](handleError(_0xf582f3,null));};exports[_0x9341('0x3f')]=function(_0x5140f4,_0x172009){return db[_0x9341('0x28')][_0x9341('0x3f')](_0x5140f4[_0x9341('0x40')],{})['then'](respondWithResult(_0x172009,0xc9))['catch'](handleError(_0x172009,null));};exports['update']=function(_0x2df4fe,_0x22dad3){if(_0x2df4fe[_0x9341('0x40')]['id']){delete _0x2df4fe[_0x9341('0x40')]['id'];}return db[_0x9341('0x28')][_0x9341('0x41')]({'where':{'id':_0x2df4fe[_0x9341('0x3e')]['id']}})[_0x9341('0x21')](handleEntityNotFound(_0x22dad3,null))[_0x9341('0x21')](saveUpdates(_0x2df4fe[_0x9341('0x40')],null))[_0x9341('0x21')](respondWithResult(_0x22dad3,null))[_0x9341('0x3d')](handleError(_0x22dad3,null));};exports[_0x9341('0x22')]=function(_0x146731,_0x436a06){return db['VoiceDialReport'][_0x9341('0x41')]({'where':{'id':_0x146731[_0x9341('0x3e')]['id']}})['then'](handleEntityNotFound(_0x436a06,null))['then'](removeEntity(_0x436a06,null))['catch'](handleError(_0x436a06,null));};exports[_0x9341('0x42')]=function(_0x30082a,_0x5bde85){return db[_0x9341('0x28')]['describe']()[_0x9341('0x21')](respondWithResult(_0x5bde85,null))[_0x9341('0x3d')](handleError(_0x5bde85,null));}; \ No newline at end of file +var _0x6ed8=['name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','describe','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack'];(function(_0x411291,_0x31d2e8){var _0x416c34=function(_0x5dce82){while(--_0x5dce82){_0x411291['push'](_0x411291['shift']());}};_0x416c34(++_0x31d2e8);}(_0x6ed8,0x1f2));var _0x86ed=function(_0xa519c2,_0x5af9ad){_0xa519c2=_0xa519c2-0x0;var _0x4fff69=_0x6ed8[_0xa519c2];return _0x4fff69;};'use strict';var emlformat=require(_0x86ed('0x0'));var rimraf=require(_0x86ed('0x1'));var zipdir=require(_0x86ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86ed('0x3'));var Mustache=require('mustache');var util=require(_0x86ed('0x4'));var path=require(_0x86ed('0x5'));var sox=require(_0x86ed('0x6'));var csv=require(_0x86ed('0x7'));var ejs=require(_0x86ed('0x8'));var fs=require('fs');var fs_extra=require(_0x86ed('0x9'));var _=require(_0x86ed('0xa'));var squel=require(_0x86ed('0xb'));var crypto=require(_0x86ed('0xc'));var jsforce=require(_0x86ed('0xd'));var deskjs=require(_0x86ed('0xe'));var toCsv=require(_0x86ed('0x7'));var querystring=require(_0x86ed('0xf'));var Papa=require(_0x86ed('0x10'));var Redis=require(_0x86ed('0x11'));var authService=require(_0x86ed('0x12'));var qs=require(_0x86ed('0x13'));var as=require(_0x86ed('0x14'));var hardwareService=require(_0x86ed('0x15'));var logger=require(_0x86ed('0x16'))(_0x86ed('0x17'));var utils=require(_0x86ed('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x86ed('0x19'))['db'];function respondWithStatusCode(_0x3476ce,_0x22928b){_0x22928b=_0x22928b||0xcc;return function(_0x535928){if(_0x535928){return _0x3476ce[_0x86ed('0x1a')](_0x22928b);}return _0x3476ce[_0x86ed('0x1b')](_0x22928b)[_0x86ed('0x1c')]();};}function respondWithResult(_0x19192c,_0x7b339e){_0x7b339e=_0x7b339e||0xc8;return function(_0x367d8b){if(_0x367d8b){return _0x19192c[_0x86ed('0x1b')](_0x7b339e)[_0x86ed('0x1d')](_0x367d8b);}};}function respondWithFilteredResult(_0x271182,_0x5f216f){return function(_0x294828){if(_0x294828){var _0x3f26e1=typeof _0x5f216f[_0x86ed('0x1e')]===_0x86ed('0x1f')&&typeof _0x5f216f[_0x86ed('0x20')]===_0x86ed('0x1f');var _0x3e438b=_0x294828[_0x86ed('0x21')];var _0x2978a5=_0x3f26e1?0x0:_0x5f216f[_0x86ed('0x1e')];var _0x1d7384=_0x3f26e1?_0x294828[_0x86ed('0x21')]:_0x5f216f[_0x86ed('0x1e')]+_0x5f216f[_0x86ed('0x20')];var _0x3e27a8;if(_0x1d7384>=_0x3e438b){_0x1d7384=_0x3e438b;_0x3e27a8=0xc8;}else{_0x3e27a8=0xce;}_0x271182[_0x86ed('0x1b')](_0x3e27a8);return _0x271182['set']('Content-Range',_0x2978a5+'-'+_0x1d7384+'/'+_0x3e438b)[_0x86ed('0x1d')](_0x294828);}return null;};}function patchUpdates(_0x2ffd0f){return function(_0x1cbbc5){try{jsonpatch[_0x86ed('0x22')](_0x1cbbc5,_0x2ffd0f,!![]);}catch(_0x4f3545){return BPromise[_0x86ed('0x23')](_0x4f3545);}return _0x1cbbc5[_0x86ed('0x24')]();};}function saveUpdates(_0x2062dc,_0x494737){return function(_0x410ee3){if(_0x410ee3){return _0x410ee3[_0x86ed('0x25')](_0x2062dc)[_0x86ed('0x26')](function(_0x119217){return _0x119217;});}return null;};}function removeEntity(_0x311a5e,_0x1c1c02){return function(_0x15f77b){if(_0x15f77b){return _0x15f77b['destroy']()['then'](function(){_0x311a5e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbdb3,_0x427c29){return function(_0x692ee3){if(!_0x692ee3){_0x1dbdb3[_0x86ed('0x1a')](0x194);}return _0x692ee3;};}function handleError(_0x52e5dc,_0x403fbd){_0x403fbd=_0x403fbd||0x1f4;return function(_0x5044ef){logger[_0x86ed('0x27')](_0x5044ef[_0x86ed('0x28')]);if(_0x5044ef['name']){delete _0x5044ef[_0x86ed('0x29')];}_0x52e5dc[_0x86ed('0x1b')](_0x403fbd)[_0x86ed('0x2a')](_0x5044ef);};}exports[_0x86ed('0x2b')]=function(_0x479095,_0xe187f4){var _0x11bb28={},_0x35342d={},_0x4ddaae={'count':0x0,'rows':[]};var _0x121b1a=_['map'](db['VoiceDialReport'][_0x86ed('0x2c')],function(_0xa7339f){return{'name':_0xa7339f[_0x86ed('0x2d')],'type':_0xa7339f[_0x86ed('0x2e')][_0x86ed('0x2f')]};});_0x35342d[_0x86ed('0x30')]=_['map'](_0x121b1a,_0x86ed('0x29'));_0x35342d[_0x86ed('0x31')]=_[_0x86ed('0x32')](_0x479095[_0x86ed('0x31')]);_0x35342d[_0x86ed('0x33')]=_['intersection'](_0x35342d[_0x86ed('0x30')],_0x35342d['query']);_0x11bb28['attributes']=_[_0x86ed('0x34')](_0x35342d[_0x86ed('0x30')],qs[_0x86ed('0x35')](_0x479095['query'][_0x86ed('0x35')]));_0x11bb28[_0x86ed('0x36')]=_0x11bb28[_0x86ed('0x36')][_0x86ed('0x37')]?_0x11bb28[_0x86ed('0x36')]:_0x35342d[_0x86ed('0x30')];if(!_0x479095[_0x86ed('0x31')][_0x86ed('0x38')](_0x86ed('0x39'))){_0x11bb28[_0x86ed('0x20')]=qs['limit'](_0x479095[_0x86ed('0x31')][_0x86ed('0x20')]);_0x11bb28[_0x86ed('0x1e')]=qs['offset'](_0x479095['query'][_0x86ed('0x1e')]);}_0x11bb28[_0x86ed('0x3a')]=qs['sort'](_0x479095[_0x86ed('0x31')][_0x86ed('0x3b')]);_0x11bb28[_0x86ed('0x3c')]=qs[_0x86ed('0x33')](_[_0x86ed('0x3d')](_0x479095[_0x86ed('0x31')],_0x35342d['filters']),_0x121b1a);if(_0x479095[_0x86ed('0x31')][_0x86ed('0x3e')]){_0x11bb28['where']=_[_0x86ed('0x3f')](_0x11bb28[_0x86ed('0x3c')],{'$or':_[_0x86ed('0x40')](_0x121b1a,function(_0x5a4861){if(_0x5a4861['type']!=='VIRTUAL'){var _0x1ea361={};_0x1ea361[_0x5a4861[_0x86ed('0x29')]]={'$like':'%'+_0x479095['query'][_0x86ed('0x3e')]+'%'};return _0x1ea361;}})});}_0x11bb28=_[_0x86ed('0x3f')]({},_0x11bb28,_0x479095['options']);var _0x4c731d={'where':_0x11bb28['where']};return db[_0x86ed('0x41')][_0x86ed('0x21')](_0x4c731d)['then'](function(_0x4f4bdb){_0x4ddaae[_0x86ed('0x21')]=_0x4f4bdb;if(_0x479095[_0x86ed('0x31')][_0x86ed('0x42')]){_0x11bb28[_0x86ed('0x43')]=[{'all':!![]}];}return db[_0x86ed('0x41')][_0x86ed('0x44')](_0x11bb28);})[_0x86ed('0x26')](function(_0x4d8994){_0x4ddaae[_0x86ed('0x45')]=_0x4d8994;return _0x4ddaae;})[_0x86ed('0x26')](respondWithFilteredResult(_0xe187f4,_0x11bb28))[_0x86ed('0x46')](handleError(_0xe187f4,null));};exports[_0x86ed('0x47')]=function(_0x11ed59,_0x5f0071){var _0x443687={'raw':!![],'where':{'id':_0x11ed59[_0x86ed('0x48')]['id']}},_0x50901f={};_0x50901f[_0x86ed('0x30')]=_['keys'](db[_0x86ed('0x41')][_0x86ed('0x2c')]);_0x50901f[_0x86ed('0x31')]=_[_0x86ed('0x32')](_0x11ed59[_0x86ed('0x31')]);_0x50901f[_0x86ed('0x33')]=_['intersection'](_0x50901f[_0x86ed('0x30')],_0x50901f[_0x86ed('0x31')]);_0x443687[_0x86ed('0x36')]=_['intersection'](_0x50901f[_0x86ed('0x30')],qs[_0x86ed('0x35')](_0x11ed59['query'][_0x86ed('0x35')]));_0x443687[_0x86ed('0x36')]=_0x443687['attributes']['length']?_0x443687[_0x86ed('0x36')]:_0x50901f[_0x86ed('0x30')];if(_0x11ed59['query'][_0x86ed('0x42')]){_0x443687[_0x86ed('0x43')]=[{'all':!![]}];}_0x443687=_[_0x86ed('0x3f')]({},_0x443687,_0x11ed59[_0x86ed('0x49')]);return db[_0x86ed('0x41')]['find'](_0x443687)[_0x86ed('0x26')](handleEntityNotFound(_0x5f0071,null))['then'](respondWithResult(_0x5f0071,null))[_0x86ed('0x46')](handleError(_0x5f0071,null));};exports['create']=function(_0x19bfe9,_0x393a15){return db[_0x86ed('0x41')][_0x86ed('0x4a')](_0x19bfe9[_0x86ed('0x4b')],{})[_0x86ed('0x26')](respondWithResult(_0x393a15,0xc9))['catch'](handleError(_0x393a15,null));};exports[_0x86ed('0x25')]=function(_0x5c4b21,_0x4901fe){if(_0x5c4b21['body']['id']){delete _0x5c4b21[_0x86ed('0x4b')]['id'];}return db[_0x86ed('0x41')]['find']({'where':{'id':_0x5c4b21['params']['id']}})[_0x86ed('0x26')](handleEntityNotFound(_0x4901fe,null))[_0x86ed('0x26')](saveUpdates(_0x5c4b21[_0x86ed('0x4b')],null))['then'](respondWithResult(_0x4901fe,null))[_0x86ed('0x46')](handleError(_0x4901fe,null));};exports['destroy']=function(_0x4160c1,_0x192fd8){return db[_0x86ed('0x41')]['find']({'where':{'id':_0x4160c1[_0x86ed('0x48')]['id']}})[_0x86ed('0x26')](handleEntityNotFound(_0x192fd8,null))[_0x86ed('0x26')](removeEntity(_0x192fd8,null))['catch'](handleError(_0x192fd8,null));};exports[_0x86ed('0x4c')]=function(_0x273263,_0x30c21a){return db[_0x86ed('0x41')][_0x86ed('0x4c')]()[_0x86ed('0x26')](respondWithResult(_0x30c21a,null))[_0x86ed('0x46')](handleError(_0x30c21a,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5787cd1..44e2354 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 _0x0d1e=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0d1e,0x77));var _0xe0d1=function(_0xf52342,_0x2e9017){_0xf52342=_0xf52342-0x0;var _0x120899=_0x0d1e[_0xf52342];return _0x120899;};'use strict';var _=require(_0xe0d1('0x0'));var util=require(_0xe0d1('0x1'));var logger=require(_0xe0d1('0x2'))(_0xe0d1('0x3'));var moment=require(_0xe0d1('0x4'));var BPromise=require(_0xe0d1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0d1('0x6'));var rimraf=require(_0xe0d1('0x7'));var config=require(_0xe0d1('0x8'));var attributes=require(_0xe0d1('0x9'));module['exports']=function(_0x439f49,_0x1a3516){return _0x439f49[_0xe0d1('0xa')]('VoiceDialReport',attributes,{'tableName':_0xe0d1('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe0d1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c94=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x26096d,_0x3e0cfb){var _0x19ec29=function(_0x39dd6a){while(--_0x39dd6a){_0x26096d['push'](_0x26096d['shift']());}};_0x19ec29(++_0x3e0cfb);}(_0x0c94,0x7a));var _0x40c9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0c94[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x40c9('0x0'));var util=require(_0x40c9('0x1'));var logger=require(_0x40c9('0x2'))(_0x40c9('0x3'));var moment=require(_0x40c9('0x4'));var BPromise=require(_0x40c9('0x5'));var rp=require(_0x40c9('0x6'));var fs=require('fs');var path=require(_0x40c9('0x7'));var rimraf=require(_0x40c9('0x8'));var config=require('../../config/environment');var attributes=require(_0x40c9('0x9'));module[_0x40c9('0xa')]=function(_0x5afd2b,_0x549c41){return _0x5afd2b[_0x40c9('0xb')](_0x40c9('0xc'),attributes,{'tableName':_0x40c9('0xd'),'paranoid':![],'indexes':[{'fields':[_0x40c9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 0b0d5cc..1492b46 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 _0x9c6f=['CreateVoiceDialReport','VoiceDialReport','update','attributes','limit','UpdateVoiceDialReport','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9c6f,0x1b9));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf9c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf9c6('0x1'));var rs=require(_0xf9c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9c6('0x3'))['db'];var utils=require(_0xf9c6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf9c6('0x5'));var jayson=require(_0xf9c6('0x6'));var client=jayson['client'][_0xf9c6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd03bfd,_0x152748,_0x9ac28e){return new BPromise(function(_0x7e4e22,_0x2dbabd){return client['request'](_0xd03bfd,_0x9ac28e)[_0xf9c6('0x8')](function(_0x59f2d4){logger[_0xf9c6('0x9')](_0xf9c6('0xa'),_0x152748,_0xf9c6('0xb'));logger[_0xf9c6('0xc')](_0xf9c6('0xd'),_0x152748,_0xf9c6('0xb'),JSON[_0xf9c6('0xe')](_0x59f2d4));if(_0x59f2d4['error']){if(_0x59f2d4[_0xf9c6('0xf')]['code']===0x1f4){logger[_0xf9c6('0xf')](_0xf9c6('0xa'),_0x152748,_0x59f2d4[_0xf9c6('0xf')][_0xf9c6('0x10')]);return _0x2dbabd(_0x59f2d4[_0xf9c6('0xf')][_0xf9c6('0x10')]);}logger[_0xf9c6('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x152748,_0x59f2d4[_0xf9c6('0xf')][_0xf9c6('0x10')]);return _0x7e4e22(_0x59f2d4[_0xf9c6('0xf')][_0xf9c6('0x10')]);}else{logger[_0xf9c6('0x9')](_0xf9c6('0xa'),_0x152748,_0xf9c6('0xb'));_0x7e4e22(_0x59f2d4[_0xf9c6('0x11')][_0xf9c6('0x10')]);}})[_0xf9c6('0x12')](function(_0x3f4c82){logger[_0xf9c6('0xf')](_0xf9c6('0xa'),_0x152748,_0x3f4c82);_0x2dbabd(_0x3f4c82);});});}exports['CreateVoiceDialReport']=function(_0x2ef7ff){var _0x269107=this;return new Promise(function(_0x2f5882,_0x17fbab){return db['VoiceDialReport'][_0xf9c6('0x13')](_0x2ef7ff[_0xf9c6('0x14')],{'raw':_0x2ef7ff[_0xf9c6('0x15')]?_0x2ef7ff[_0xf9c6('0x15')][_0xf9c6('0x16')]===undefined?!![]:![]:!![]})[_0xf9c6('0x8')](function(_0x50bd5f){logger[_0xf9c6('0x9')](_0xf9c6('0x17'),_0x2ef7ff);logger[_0xf9c6('0xc')]('CreateVoiceDialReport',_0x2ef7ff,JSON['stringify'](_0x50bd5f));_0x2f5882(_0x50bd5f);})[_0xf9c6('0x12')](function(_0xfc208a){logger['error']('CreateVoiceDialReport',_0xfc208a['message'],_0x2ef7ff);_0x17fbab(_0x269107[_0xf9c6('0xf')](0x1f4,_0xfc208a[_0xf9c6('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x59d280){var _0x48c81f=this;return new Promise(function(_0xc900fb,_0x5dfbf5){return db[_0xf9c6('0x18')][_0xf9c6('0x19')](_0x59d280[_0xf9c6('0x14')],{'raw':_0x59d280[_0xf9c6('0x15')]?_0x59d280[_0xf9c6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d280[_0xf9c6('0x15')]?_0x59d280[_0xf9c6('0x15')]['where']||null:null,'attributes':_0x59d280[_0xf9c6('0x15')]?_0x59d280[_0xf9c6('0x15')][_0xf9c6('0x1a')]||null:null,'limit':_0x59d280[_0xf9c6('0x15')]?_0x59d280['options'][_0xf9c6('0x1b')]||null:null})[_0xf9c6('0x8')](function(_0x3df8ae){logger['info'](_0xf9c6('0x1c'),_0x59d280);logger['debug']('UpdateVoiceDialReport',_0x59d280,JSON['stringify'](_0x3df8ae));_0xc900fb(_0x3df8ae);})['catch'](function(_0x135fc0){logger[_0xf9c6('0xf')]('UpdateVoiceDialReport',_0x135fc0[_0xf9c6('0x10')],_0x59d280);_0x5dfbf5(_0x48c81f[_0xf9c6('0xf')](0x1f4,_0x135fc0[_0xf9c6('0x10')]));});});}; \ No newline at end of file +var _0xbf68=['message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','catch','UpdateVoiceDialReport','update','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1b8729,_0x13dcd0){var _0x581199=function(_0x5d56ad){while(--_0x5d56ad){_0x1b8729['push'](_0x1b8729['shift']());}};_0x581199(++_0x13dcd0);}(_0xbf68,0x17a));var _0x8bf6=function(_0xfdcce4,_0x49a63b){_0xfdcce4=_0xfdcce4-0x0;var _0x79dfb7=_0xbf68[_0xfdcce4];return _0x79dfb7;};'use strict';var _=require(_0x8bf6('0x0'));var util=require(_0x8bf6('0x1'));var moment=require('moment');var BPromise=require(_0x8bf6('0x2'));var rs=require(_0x8bf6('0x3'));var fs=require('fs');var Redis=require(_0x8bf6('0x4'));var db=require(_0x8bf6('0x5'))['db'];var utils=require(_0x8bf6('0x6'));var logger=require('../../config/logger')(_0x8bf6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8bf6('0x8')][_0x8bf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x465961,_0x443288,_0x6571cc){return new BPromise(function(_0xf894f6,_0x302bc9){return client[_0x8bf6('0xa')](_0x465961,_0x6571cc)[_0x8bf6('0xb')](function(_0x5dfedb){logger[_0x8bf6('0xc')](_0x8bf6('0xd'),_0x443288,_0x8bf6('0xe'));logger['debug'](_0x8bf6('0xf'),_0x443288,_0x8bf6('0xe'),JSON['stringify'](_0x5dfedb));if(_0x5dfedb[_0x8bf6('0x10')]){if(_0x5dfedb[_0x8bf6('0x10')][_0x8bf6('0x11')]===0x1f4){logger[_0x8bf6('0x10')](_0x8bf6('0xd'),_0x443288,_0x5dfedb[_0x8bf6('0x10')][_0x8bf6('0x12')]);return _0x302bc9(_0x5dfedb[_0x8bf6('0x10')][_0x8bf6('0x12')]);}logger[_0x8bf6('0x10')](_0x8bf6('0xd'),_0x443288,_0x5dfedb[_0x8bf6('0x10')][_0x8bf6('0x12')]);return _0xf894f6(_0x5dfedb[_0x8bf6('0x10')]['message']);}else{logger[_0x8bf6('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x443288,_0x8bf6('0xe'));_0xf894f6(_0x5dfedb[_0x8bf6('0x13')]['message']);}})['catch'](function(_0x51fa3f){logger[_0x8bf6('0x10')](_0x8bf6('0xd'),_0x443288,_0x51fa3f);_0x302bc9(_0x51fa3f);});});}exports[_0x8bf6('0x14')]=function(_0x1978a6){var _0x499532=this;return new Promise(function(_0x2917e9,_0x509d7a){return db[_0x8bf6('0x15')][_0x8bf6('0x16')](_0x1978a6[_0x8bf6('0x17')],{'raw':_0x1978a6[_0x8bf6('0x18')]?_0x1978a6[_0x8bf6('0x18')][_0x8bf6('0x19')]===undefined?!![]:![]:!![]})[_0x8bf6('0xb')](function(_0x44ce6c){logger['info']('CreateVoiceDialReport',_0x1978a6);logger['debug'](_0x8bf6('0x14'),_0x1978a6,JSON[_0x8bf6('0x1a')](_0x44ce6c));_0x2917e9(_0x44ce6c);})[_0x8bf6('0x1b')](function(_0xf34dbd){logger['error']('CreateVoiceDialReport',_0xf34dbd[_0x8bf6('0x12')],_0x1978a6);_0x509d7a(_0x499532[_0x8bf6('0x10')](0x1f4,_0xf34dbd[_0x8bf6('0x12')]));});});};exports[_0x8bf6('0x1c')]=function(_0x106246){var _0x5ce56d=this;return new Promise(function(_0x1533cd,_0x2e105a){return db[_0x8bf6('0x15')][_0x8bf6('0x1d')](_0x106246[_0x8bf6('0x17')],{'raw':_0x106246[_0x8bf6('0x18')]?_0x106246[_0x8bf6('0x18')][_0x8bf6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106246['options']?_0x106246[_0x8bf6('0x18')]['where']||null:null,'attributes':_0x106246[_0x8bf6('0x18')]?_0x106246[_0x8bf6('0x18')][_0x8bf6('0x1e')]||null:null,'limit':_0x106246[_0x8bf6('0x18')]?_0x106246['options'][_0x8bf6('0x1f')]||null:null})['then'](function(_0x4b6899){logger[_0x8bf6('0xc')]('UpdateVoiceDialReport',_0x106246);logger[_0x8bf6('0x20')](_0x8bf6('0x1c'),_0x106246,JSON[_0x8bf6('0x1a')](_0x4b6899));_0x1533cd(_0x4b6899);})['catch'](function(_0x583191){logger[_0x8bf6('0x10')]('UpdateVoiceDialReport',_0x583191['message'],_0x106246);_0x2e105a(_0x5ce56d[_0x8bf6('0x10')](0x1f4,_0x583191[_0x8bf6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 10b415d..f1d82ac 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 _0x958b=['index','get','show','post','create','/:id/applications','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','isAuthenticated'];(function(_0x450f09,_0x59561d){var _0x4e22ec=function(_0x516748){while(--_0x516748){_0x450f09['push'](_0x450f09['shift']());}};_0x4e22ec(++_0x59561d);}(_0x958b,0x156));var _0xb958=function(_0x50e370,_0x40fa9a){_0x50e370=_0x50e370-0x0;var _0x2db33e=_0x958b[_0x50e370];return _0x2db33e;};'use strict';var multer=require('multer');var util=require(_0xb958('0x0'));var path=require(_0xb958('0x1'));var timeout=require(_0xb958('0x2'));var express=require(_0xb958('0x3'));var router=express[_0xb958('0x4')]();var fs_extra=require(_0xb958('0x5'));var auth=require(_0xb958('0x6'));var interaction=require(_0xb958('0x7'));var config=require('../../config/environment');var controller=require(_0xb958('0x8'));router['get']('/',auth[_0xb958('0x9')](),controller[_0xb958('0xa')]);router[_0xb958('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb958('0xc')]);router[_0xb958('0xd')]('/',auth['isAuthenticated'](),controller[_0xb958('0xe')]);router[_0xb958('0xd')](_0xb958('0xf'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb958('0x10')](_0xb958('0x11'),auth['isAuthenticated'](),controller[_0xb958('0x12')]);router[_0xb958('0x13')](_0xb958('0x11'),auth[_0xb958('0x9')](),controller[_0xb958('0x14')]);module[_0xb958('0x15')]=router; \ No newline at end of file +var _0xfac7=['put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','show','post','create'];(function(_0x17d4ff,_0x2368d8){var _0x4803b5=function(_0x3ad237){while(--_0x3ad237){_0x17d4ff['push'](_0x17d4ff['shift']());}};_0x4803b5(++_0x2368d8);}(_0xfac7,0x9c));var _0x7fac=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0xfac7[_0x44cb92];return _0x56b9e6;};'use strict';var multer=require(_0x7fac('0x0'));var util=require(_0x7fac('0x1'));var path=require('path');var timeout=require(_0x7fac('0x2'));var express=require(_0x7fac('0x3'));var router=express[_0x7fac('0x4')]();var fs_extra=require(_0x7fac('0x5'));var auth=require(_0x7fac('0x6'));var interaction=require(_0x7fac('0x7'));var config=require(_0x7fac('0x8'));var controller=require(_0x7fac('0x9'));router[_0x7fac('0xa')]('/',auth[_0x7fac('0xb')](),controller['index']);router[_0x7fac('0xa')]('/:id',auth[_0x7fac('0xb')](),controller[_0x7fac('0xc')]);router[_0x7fac('0xd')]('/',auth[_0x7fac('0xb')](),controller[_0x7fac('0xe')]);router[_0x7fac('0xd')]('/:id/applications',auth[_0x7fac('0xb')](),controller['addApplications']);router[_0x7fac('0xf')](_0x7fac('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x7fac('0x11')](_0x7fac('0x10'),auth['isAuthenticated'](),controller[_0x7fac('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 8edcb73..6845428 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 _0x346b=['NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','exports','STRING','compositeIndex'];(function(_0x281d5c,_0x1758a0){var _0x1ce37b=function(_0x1304b1){while(--_0x1304b1){_0x281d5c['push'](_0x281d5c['shift']());}};_0x1ce37b(++_0x1758a0);}(_0x346b,0xb8));var _0xb346=function(_0x18a9c7,_0x4fdfca){_0x18a9c7=_0x18a9c7-0x0;var _0x4eac22=_0x346b[_0x18a9c7];return _0x4eac22;};'use strict';var Sequelize=require('sequelize');module[_0xb346('0x0')]={'context':{'type':Sequelize[_0xb346('0x1')],'allowNull':![],'unique':_0xb346('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb346('0x1')],'allowNull':![],'unique':_0xb346('0x2')},'priority':{'type':Sequelize[_0xb346('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xb346('0x2')},'tag':{'type':Sequelize[_0xb346('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb346('0x1')],'allowNull':![],'defaultValue':_0xb346('0x3')},'appdata':{'type':Sequelize[_0xb346('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb346('0x4')](_0xb346('0x5'),_0xb346('0x6'),_0xb346('0x7'),'inbound-fax',_0xb346('0x8'),_0xb346('0x9'),_0xb346('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xb346('0x1')]},'interval':{'type':Sequelize[_0xb346('0x1')],'allowNull':![],'defaultValue':_0xb346('0xb')},'IntervalId':{'type':Sequelize[_0xb346('0xc')]},'isApp':{'type':Sequelize[_0xb346('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb346('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xb346('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb346('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb346('0xe')},'answer':{'type':Sequelize[_0xb346('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb346('0xf')],'get':function(_0x472c0f){return this['getDataValue'](_0xb346('0x10'));}},'alias':{'type':Sequelize[_0xb346('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xe3cd=['NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','sequelize','exports','STRING','compositeIndex'];(function(_0x50e7b2,_0x436c0b){var _0x24a67b=function(_0x493580){while(--_0x493580){_0x50e7b2['push'](_0x50e7b2['shift']());}};_0x24a67b(++_0x436c0b);}(_0xe3cd,0xec));var _0xde3c=function(_0x495ff8,_0x3799ef){_0x495ff8=_0x495ff8-0x0;var _0x4e51ef=_0xe3cd[_0x495ff8];return _0x4e51ef;};'use strict';var Sequelize=require(_0xde3c('0x0'));module[_0xde3c('0x1')]={'context':{'type':Sequelize[_0xde3c('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde3c('0x3')},'priority':{'type':Sequelize[_0xde3c('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xde3c('0x2')],'allowNull':![],'defaultValue':_0xde3c('0x4')},'appdata':{'type':Sequelize[_0xde3c('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xde3c('0x5')](_0xde3c('0x6'),_0xde3c('0x7'),_0xde3c('0x8'),'inbound-fax',_0xde3c('0x9'),_0xde3c('0xa'),_0xde3c('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xde3c('0x2')]},'interval':{'type':Sequelize[_0xde3c('0x2')],'allowNull':![],'defaultValue':_0xde3c('0xc')},'IntervalId':{'type':Sequelize[_0xde3c('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xde3c('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xde3c('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xde3c('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xde3c('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xde3c('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x58f05f){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xde3c('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 73b8b24..dd78ac8 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 _0x7428=['type','find','name','UserProfileResource','destroy','stack','send','index','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','show','catch','params','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OutboundRoutes','value','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','Content-Range','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','map','includes'];(function(_0xfe2c3a,_0x4c42c2){var _0x584f7d=function(_0x10ab9b){while(--_0x10ab9b){_0xfe2c3a['push'](_0xfe2c3a['shift']());}};_0x584f7d(++_0x4c42c2);}(_0x7428,0xfc));var _0x8742=function(_0x42d74f,_0x2b0c23){_0x42d74f=_0x42d74f-0x0;var _0x549b3a=_0x7428[_0x42d74f];return _0x549b3a;};'use strict';var _=require(_0x8742('0x0'));var Redis=require(_0x8742('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x8742('0x2'))(_0x8742('0x3'));var config=require(_0x8742('0x4'));var db=require(_0x8742('0x5'))['db'];config[_0x8742('0x6')]=_[_0x8742('0x7')](config[_0x8742('0x6')],{'host':_0x8742('0x8'),'port':0x18eb});var socket=require(_0x8742('0x9'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x8742('0xa')](socket);function respondWithStatusCode(_0x2ffc85,_0x5a6d7e){_0x5a6d7e=_0x5a6d7e||0xcc;return function(_0x4a58d2){if(_0x4a58d2){return _0x2ffc85['sendStatus'](_0x5a6d7e);}return _0x2ffc85[_0x8742('0xb')](_0x5a6d7e)['end']();};}function respondWithResult(_0x47f490,_0x2a4efe){_0x2a4efe=_0x2a4efe||0xc8;return function(_0x358832){if(_0x358832){return _0x47f490['status'](_0x2a4efe)[_0x8742('0xc')](_0x358832);}};}function respondWithFilteredResult(_0x518997,_0x4993ac){return function(_0x134019){if(_0x134019){var _0x1f75c2=typeof _0x4993ac[_0x8742('0xd')]===_0x8742('0xe')&&typeof _0x4993ac['limit']===_0x8742('0xe');var _0x168670=_0x134019[_0x8742('0xf')];var _0x78f0d8=_0x1f75c2?0x0:_0x4993ac[_0x8742('0xd')];var _0xa21253=_0x1f75c2?_0x134019['count']:_0x4993ac['offset']+_0x4993ac[_0x8742('0x10')];var _0x175a4a;if(_0xa21253>=_0x168670){_0xa21253=_0x168670;_0x175a4a=0xc8;}else{_0x175a4a=0xce;}_0x518997[_0x8742('0xb')](_0x175a4a);return _0x518997[_0x8742('0x11')](_0x8742('0x12'),_0x78f0d8+'-'+_0xa21253+'/'+_0x168670)[_0x8742('0xc')](_0x134019);}return null;};}function removeEntity(_0x1f0126){return function(_0x573ca3){if(_0x573ca3){return _0x573ca3['destroy']()[_0x8742('0x13')](function(){var _0x2ee5c6=_0x573ca3[_0x8742('0x14')]({'plain':!![]});var _0x1e6c0c=[{'name':_0x8742('0x15'),'value':_0x8742('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0x8742('0x17'),'ignore':![]},{'name':_0x8742('0x18'),'value':_0x8742('0x19'),'ignore':![]}];var _0xcf17bf=_(_0x1e6c0c)[_0x8742('0x1a')](_0x8742('0x1b'))[_0x8742('0x1c')]('value')['value']();if(_[_0x8742('0x1d')](_0xcf17bf,_0x2ee5c6[_0x8742('0x1e')])){return;}var _0x3223d9=_[_0x8742('0x1f')](_0x1e6c0c,['value',_0x2ee5c6['type']])[_0x8742('0x20')];return db[_0x8742('0x21')][_0x8742('0x22')]({'where':{'type':_0x3223d9,'resourceId':_0x2ee5c6['id']}})['then'](function(){return _0x573ca3;});})[_0x8742('0x13')](function(){_0x1f0126[_0x8742('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x433632){return function(_0x1a7029){if(!_0x1a7029){_0x433632['sendStatus'](0x194);}return _0x1a7029;};}function handleError(_0xb60522,_0x1ace83){_0x1ace83=_0x1ace83||0x1f4;return function(_0x15f6c7){logger['error'](_0x15f6c7[_0x8742('0x23')]);if(_0x15f6c7[_0x8742('0x20')]){delete _0x15f6c7[_0x8742('0x20')];}_0xb60522[_0x8742('0xb')](_0x1ace83)[_0x8742('0x24')](_0x15f6c7);};}exports[_0x8742('0x25')]=function(_0x312338,_0x295e65){var _0x341503={},_0x7976e3={},_0x3b2cb2={'count':0x0,'rows':[]};var _0x220bee=_[_0x8742('0x1c')](db['VoiceExtension']['rawAttributes'],function(_0x51dc5c){return{'name':_0x51dc5c[_0x8742('0x26')],'type':_0x51dc5c[_0x8742('0x1e')][_0x8742('0x27')]};});_0x7976e3[_0x8742('0x28')]=_[_0x8742('0x1c')](_0x220bee,_0x8742('0x20'));_0x7976e3[_0x8742('0x29')]=_[_0x8742('0x2a')](_0x312338[_0x8742('0x29')]);_0x7976e3['filters']=_[_0x8742('0x2b')](_0x7976e3[_0x8742('0x28')],_0x7976e3[_0x8742('0x29')]);_0x341503[_0x8742('0x2c')]=_['intersection'](_0x7976e3[_0x8742('0x28')],qs[_0x8742('0x2d')](_0x312338[_0x8742('0x29')][_0x8742('0x2d')]));_0x341503[_0x8742('0x2c')]=_0x341503[_0x8742('0x2c')][_0x8742('0x2e')]?_0x341503['attributes']:_0x7976e3[_0x8742('0x28')];if(!_0x312338[_0x8742('0x29')][_0x8742('0x2f')]('nolimit')){_0x341503[_0x8742('0x10')]=qs['limit'](_0x312338[_0x8742('0x29')][_0x8742('0x10')]);_0x341503['offset']=qs[_0x8742('0xd')](_0x312338[_0x8742('0x29')][_0x8742('0xd')]);}_0x341503[_0x8742('0x30')]=qs[_0x8742('0x31')](_0x312338[_0x8742('0x29')][_0x8742('0x31')]);_0x341503[_0x8742('0x32')]=qs[_0x8742('0x33')](_[_0x8742('0x34')](_0x312338[_0x8742('0x29')],_0x7976e3[_0x8742('0x33')]),_0x220bee);if(_0x312338[_0x8742('0x29')][_0x8742('0x1a')]){_0x341503[_0x8742('0x32')]=_[_0x8742('0x35')](_0x341503[_0x8742('0x32')],{'$or':_[_0x8742('0x1c')](_0x220bee,function(_0x4311e6){if(_0x4311e6['type']!==_0x8742('0x36')){var _0x2e8148={};_0x2e8148[_0x4311e6[_0x8742('0x20')]]={'$like':'%'+_0x312338[_0x8742('0x29')][_0x8742('0x1a')]+'%'};return _0x2e8148;}})});}_0x341503=_[_0x8742('0x35')]({},_0x341503,_0x312338[_0x8742('0x37')]);var _0x45704b={'where':_0x341503[_0x8742('0x32')]};return db[_0x8742('0x38')][_0x8742('0xf')](_0x45704b)['then'](function(_0x37272d){_0x3b2cb2[_0x8742('0xf')]=_0x37272d;if(_0x312338[_0x8742('0x29')][_0x8742('0x39')]){_0x341503[_0x8742('0x3a')]=[{'all':!![]}];}return db[_0x8742('0x38')][_0x8742('0x3b')](_0x341503);})['then'](function(_0x4a2e3d){_0x3b2cb2[_0x8742('0x3c')]=_0x4a2e3d;return _0x3b2cb2;})[_0x8742('0x13')](respondWithFilteredResult(_0x295e65,_0x341503))['catch'](handleError(_0x295e65,null));};exports[_0x8742('0x3d')]=function(_0x46fd72,_0x4e8b2e){var _0x3ac008={'raw':![],'where':{'id':_0x46fd72['params']['id']}},_0x54e3b0={};_0x54e3b0['model']=_['keys'](db[_0x8742('0x38')]['rawAttributes']);_0x54e3b0[_0x8742('0x29')]=_[_0x8742('0x2a')](_0x46fd72[_0x8742('0x29')]);_0x54e3b0[_0x8742('0x33')]=_['intersection'](_0x54e3b0['model'],_0x54e3b0[_0x8742('0x29')]);_0x3ac008['attributes']=_[_0x8742('0x2b')](_0x54e3b0[_0x8742('0x28')],qs['fields'](_0x46fd72['query'][_0x8742('0x2d')]));_0x3ac008[_0x8742('0x2c')]=_0x3ac008[_0x8742('0x2c')]['length']?_0x3ac008[_0x8742('0x2c')]:_0x54e3b0[_0x8742('0x28')];if(_0x46fd72[_0x8742('0x29')][_0x8742('0x39')]){_0x3ac008[_0x8742('0x3a')]=[{'all':!![]}];}_0x3ac008=_[_0x8742('0x35')]({},_0x3ac008,_0x46fd72[_0x8742('0x37')]);return db[_0x8742('0x38')][_0x8742('0x1f')](_0x3ac008)[_0x8742('0x13')](handleEntityNotFound(_0x4e8b2e,null))[_0x8742('0x13')](respondWithResult(_0x4e8b2e,null))[_0x8742('0x3e')](handleError(_0x4e8b2e,null));};exports['destroy']=function(_0x1022c5,_0x2b0a33){return db[_0x8742('0x38')]['find']({'where':{'id':_0x1022c5[_0x8742('0x3f')]['id']}})[_0x8742('0x13')](handleEntityNotFound(_0x2b0a33,null))['then'](removeEntity(_0x2b0a33,null))[_0x8742('0x3e')](handleError(_0x2b0a33,null));};exports[_0x8742('0x40')]=function(_0x2f8798,_0x5889b1){if(_0x2f8798[_0x8742('0x41')][_0x8742('0x1e')]===_0x8742('0x17')&&!_['startsWith'](_0x2f8798['body'][_0x8742('0x42')],'_')){_0x2f8798[_0x8742('0x41')]['exten']='_'[_0x8742('0x43')](_0x2f8798[_0x8742('0x41')][_0x8742('0x42')]);}return db[_0x8742('0x38')][_0x8742('0x40')](_0x2f8798[_0x8742('0x41')],{'raw':![]})[_0x8742('0x13')](function(_0x16857e){var _0x5dc916=_0x2f8798['user'][_0x8742('0x14')]({'plain':!![]});if(!_0x5dc916)throw new Error(_0x8742('0x44'));if(_0x5dc916['role']===_0x8742('0x45')){var _0x1fa797=_0x16857e[_0x8742('0x14')]({'plain':!![]});var _0x128806=[{'name':_0x8742('0x15'),'value':_0x8742('0x16')},{'name':_0x8742('0x46'),'value':_0x8742('0x17')},{'name':_0x8742('0x18'),'value':_0x8742('0x19')}];var _0x28ad6c=_[_0x8742('0x1f')](_0x128806,[_0x8742('0x47'),_0x1fa797[_0x8742('0x1e')]])[_0x8742('0x20')];return db[_0x8742('0x48')]['find']({'where':{'name':_0x28ad6c,'userProfileId':_0x5dc916[_0x8742('0x49')]},'raw':!![]})[_0x8742('0x13')](function(_0x51cdc4){if(_0x51cdc4&&_0x51cdc4[_0x8742('0x4a')]===0x0){return db[_0x8742('0x21')][_0x8742('0x40')]({'name':_0x1fa797[_0x8742('0x20')],'resourceId':_0x1fa797['id'],'type':_0x51cdc4[_0x8742('0x20')],'sectionId':_0x51cdc4['id']},{})['then'](function(){return _0x16857e;});}else{return _0x16857e;}})['catch'](function(_0x27924c){logger[_0x8742('0x4b')](_0x8742('0x4c'),_0x27924c);throw _0x27924c;});}return _0x16857e;})['then'](respondWithResult(_0x5889b1,0xc9))['catch'](handleError(_0x5889b1,null));};exports[_0x8742('0x4d')]=function(_0x5d9a7b,_0x49dd4c){if(_0x5d9a7b[_0x8742('0x41')]['id']){delete _0x5d9a7b[_0x8742('0x41')]['id'];}return db[_0x8742('0x38')][_0x8742('0x1f')]({'where':{'id':_0x5d9a7b[_0x8742('0x3f')]['id']}})[_0x8742('0x13')](handleEntityNotFound(_0x49dd4c,null))['then'](function(_0x285ce5){if(_0x285ce5){return db[_0x8742('0x38')][_0x8742('0x4d')](_[_0x8742('0x34')](_0x5d9a7b[_0x8742('0x41')],[_0x8742('0x42'),_0x8742('0x4e'),'description',_0x8742('0x4f'),_0x8742('0x50'),_0x8742('0x51'),'alias']),{'where':{'context':_0x285ce5['context'],'exten':_0x285ce5[_0x8742('0x42')]},'individualHooks':!![]})[_0x8742('0x13')](function(_0x1275d8){return _0x1275d8;});}return null;})['then'](respondWithStatusCode(_0x49dd4c,null))[_0x8742('0x3e')](handleError(_0x49dd4c,null));};exports[_0x8742('0x52')]=function(_0x5d693a,_0x19ccfe){return db['VoiceExtension'][_0x8742('0x53')]({'where':{'id':_0x5d693a[_0x8742('0x3f')]['id']}})['then'](function(_0x31ce69){if(_0x31ce69){return db[_0x8742('0x54')][_0x8742('0x55')](function(_0x269402){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x5d693a[_0x8742('0x3f')]['id']},'transaction':_0x269402})[_0x8742('0x13')](function(){var _0x239ac1=_[_0x8742('0x1c')](_0x5d693a[_0x8742('0x41')],function(_0x5e9de9){_0x5e9de9[_0x8742('0x56')]=_0x5d693a[_0x8742('0x3f')]['id'];_0x5e9de9[_0x8742('0x57')]=!![];return _0x5e9de9;});return _0x31ce69[_0x8742('0x58')](_0x239ac1);})[_0x8742('0x13')](function(_0x5b5f72){console[_0x8742('0x59')](_0x8742('0x5a'),_0x5b5f72);return db['VoiceExtension'][_0x8742('0x5b')](_0x5b5f72,{'transaction':_0x269402});});})['then'](function(){return db[_0x8742('0x38')][_0x8742('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5d693a[_0x8742('0x3f')]['id']},'order':_0x8742('0x5d')});});}})['then'](respondWithResult(_0x19ccfe,null))[_0x8742('0x3e')](handleError(_0x19ccfe,null));}; \ No newline at end of file +var _0xd6dc=['find','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','alias','context','findOne','transaction','VoiceExtensionId','isApp','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','undefined','count','offset','limit','set','Content-Range','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','name','UserProfileResource','destroy','sendStatus','error','stack','send','index','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','params'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd6dc,0x1d7));var _0xcd6d=function(_0x39c0ff,_0x24e76d){_0x39c0ff=_0x39c0ff-0x0;var _0x8190ed=_0xd6dc[_0x39c0ff];return _0x8190ed;};'use strict';var _=require(_0xcd6d('0x0'));var Redis=require('ioredis');var qs=require(_0xcd6d('0x1'));var logger=require(_0xcd6d('0x2'))(_0xcd6d('0x3'));var config=require(_0xcd6d('0x4'));var db=require('../../mysqldb')['db'];config[_0xcd6d('0x5')]=_[_0xcd6d('0x6')](config[_0xcd6d('0x5')],{'host':_0xcd6d('0x7'),'port':0x18eb});var socket=require(_0xcd6d('0x8'))(new Redis(config[_0xcd6d('0x5')]));require(_0xcd6d('0x9'))[_0xcd6d('0xa')](socket);function respondWithStatusCode(_0x16400c,_0x4d880b){_0x4d880b=_0x4d880b||0xcc;return function(_0x3d1b22){if(_0x3d1b22){return _0x16400c['sendStatus'](_0x4d880b);}return _0x16400c['status'](_0x4d880b)['end']();};}function respondWithResult(_0x33a461,_0x3d0dc0){_0x3d0dc0=_0x3d0dc0||0xc8;return function(_0x566380){if(_0x566380){return _0x33a461[_0xcd6d('0xb')](_0x3d0dc0)[_0xcd6d('0xc')](_0x566380);}};}function respondWithFilteredResult(_0x5097be,_0x2541b4){return function(_0x31a8cc){if(_0x31a8cc){var _0x147b1a=typeof _0x2541b4['offset']===_0xcd6d('0xd')&&typeof _0x2541b4['limit']==='undefined';var _0x1e55bd=_0x31a8cc[_0xcd6d('0xe')];var _0x391096=_0x147b1a?0x0:_0x2541b4[_0xcd6d('0xf')];var _0x3c5652=_0x147b1a?_0x31a8cc[_0xcd6d('0xe')]:_0x2541b4[_0xcd6d('0xf')]+_0x2541b4[_0xcd6d('0x10')];var _0x2328f6;if(_0x3c5652>=_0x1e55bd){_0x3c5652=_0x1e55bd;_0x2328f6=0xc8;}else{_0x2328f6=0xce;}_0x5097be['status'](_0x2328f6);return _0x5097be[_0xcd6d('0x11')](_0xcd6d('0x12'),_0x391096+'-'+_0x3c5652+'/'+_0x1e55bd)[_0xcd6d('0xc')](_0x31a8cc);}return null;};}function removeEntity(_0x4afafb){return function(_0x107354){if(_0x107354){return _0x107354['destroy']()[_0xcd6d('0x13')](function(){var _0x55fccd=_0x107354[_0xcd6d('0x14')]({'plain':!![]});var _0x537e05=[{'name':'InboundRoutes','value':_0xcd6d('0x15'),'ignore':![]},{'name':_0xcd6d('0x16'),'value':_0xcd6d('0x17'),'ignore':![]},{'name':_0xcd6d('0x18'),'value':_0xcd6d('0x19'),'ignore':![]}];var _0x57aafe=_(_0x537e05)['filter'](_0xcd6d('0x1a'))[_0xcd6d('0x1b')]('value')[_0xcd6d('0x1c')]();if(_[_0xcd6d('0x1d')](_0x57aafe,_0x55fccd[_0xcd6d('0x1e')])){return;}var _0x4df66d=_['find'](_0x537e05,[_0xcd6d('0x1c'),_0x55fccd[_0xcd6d('0x1e')]])[_0xcd6d('0x1f')];return db[_0xcd6d('0x20')][_0xcd6d('0x21')]({'where':{'type':_0x4df66d,'resourceId':_0x55fccd['id']}})[_0xcd6d('0x13')](function(){return _0x107354;});})[_0xcd6d('0x13')](function(){_0x4afafb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x234ae3){return function(_0x45eb2d){if(!_0x45eb2d){_0x234ae3[_0xcd6d('0x22')](0x194);}return _0x45eb2d;};}function handleError(_0x220152,_0x25d0fe){_0x25d0fe=_0x25d0fe||0x1f4;return function(_0x143bea){logger[_0xcd6d('0x23')](_0x143bea[_0xcd6d('0x24')]);if(_0x143bea[_0xcd6d('0x1f')]){delete _0x143bea[_0xcd6d('0x1f')];}_0x220152[_0xcd6d('0xb')](_0x25d0fe)[_0xcd6d('0x25')](_0x143bea);};}exports[_0xcd6d('0x26')]=function(_0x4d0595,_0x34a439){var _0x159e86={},_0xb0bdc2={},_0x4b0b17={'count':0x0,'rows':[]};var _0x37e0dd=_['map'](db['VoiceExtension'][_0xcd6d('0x27')],function(_0x1939e9){return{'name':_0x1939e9['fieldName'],'type':_0x1939e9[_0xcd6d('0x1e')][_0xcd6d('0x28')]};});_0xb0bdc2[_0xcd6d('0x29')]=_[_0xcd6d('0x1b')](_0x37e0dd,_0xcd6d('0x1f'));_0xb0bdc2['query']=_[_0xcd6d('0x2a')](_0x4d0595[_0xcd6d('0x2b')]);_0xb0bdc2[_0xcd6d('0x2c')]=_[_0xcd6d('0x2d')](_0xb0bdc2[_0xcd6d('0x29')],_0xb0bdc2[_0xcd6d('0x2b')]);_0x159e86[_0xcd6d('0x2e')]=_[_0xcd6d('0x2d')](_0xb0bdc2[_0xcd6d('0x29')],qs[_0xcd6d('0x2f')](_0x4d0595[_0xcd6d('0x2b')][_0xcd6d('0x2f')]));_0x159e86['attributes']=_0x159e86[_0xcd6d('0x2e')]['length']?_0x159e86[_0xcd6d('0x2e')]:_0xb0bdc2[_0xcd6d('0x29')];if(!_0x4d0595[_0xcd6d('0x2b')][_0xcd6d('0x30')](_0xcd6d('0x31'))){_0x159e86[_0xcd6d('0x10')]=qs[_0xcd6d('0x10')](_0x4d0595[_0xcd6d('0x2b')]['limit']);_0x159e86[_0xcd6d('0xf')]=qs[_0xcd6d('0xf')](_0x4d0595['query']['offset']);}_0x159e86['order']=qs['sort'](_0x4d0595[_0xcd6d('0x2b')]['sort']);_0x159e86['where']=qs[_0xcd6d('0x2c')](_[_0xcd6d('0x32')](_0x4d0595[_0xcd6d('0x2b')],_0xb0bdc2[_0xcd6d('0x2c')]),_0x37e0dd);if(_0x4d0595[_0xcd6d('0x2b')][_0xcd6d('0x33')]){_0x159e86[_0xcd6d('0x34')]=_[_0xcd6d('0x35')](_0x159e86['where'],{'$or':_['map'](_0x37e0dd,function(_0x11de79){if(_0x11de79[_0xcd6d('0x1e')]!==_0xcd6d('0x36')){var _0x922cb6={};_0x922cb6[_0x11de79[_0xcd6d('0x1f')]]={'$like':'%'+_0x4d0595[_0xcd6d('0x2b')][_0xcd6d('0x33')]+'%'};return _0x922cb6;}})});}_0x159e86=_[_0xcd6d('0x35')]({},_0x159e86,_0x4d0595[_0xcd6d('0x37')]);var _0x261f07={'where':_0x159e86['where']};return db[_0xcd6d('0x38')][_0xcd6d('0xe')](_0x261f07)['then'](function(_0x4413ec){_0x4b0b17[_0xcd6d('0xe')]=_0x4413ec;if(_0x4d0595['query'][_0xcd6d('0x39')]){_0x159e86[_0xcd6d('0x3a')]=[{'all':!![]}];}return db[_0xcd6d('0x38')][_0xcd6d('0x3b')](_0x159e86);})[_0xcd6d('0x13')](function(_0x536e8e){_0x4b0b17[_0xcd6d('0x3c')]=_0x536e8e;return _0x4b0b17;})[_0xcd6d('0x13')](respondWithFilteredResult(_0x34a439,_0x159e86))[_0xcd6d('0x3d')](handleError(_0x34a439,null));};exports['show']=function(_0x5a3d52,_0x141896){var _0x923e42={'raw':![],'where':{'id':_0x5a3d52[_0xcd6d('0x3e')]['id']}},_0x2c0d74={};_0x2c0d74[_0xcd6d('0x29')]=_[_0xcd6d('0x2a')](db['VoiceExtension'][_0xcd6d('0x27')]);_0x2c0d74[_0xcd6d('0x2b')]=_[_0xcd6d('0x2a')](_0x5a3d52[_0xcd6d('0x2b')]);_0x2c0d74[_0xcd6d('0x2c')]=_[_0xcd6d('0x2d')](_0x2c0d74[_0xcd6d('0x29')],_0x2c0d74[_0xcd6d('0x2b')]);_0x923e42[_0xcd6d('0x2e')]=_['intersection'](_0x2c0d74[_0xcd6d('0x29')],qs[_0xcd6d('0x2f')](_0x5a3d52['query']['fields']));_0x923e42[_0xcd6d('0x2e')]=_0x923e42[_0xcd6d('0x2e')]['length']?_0x923e42[_0xcd6d('0x2e')]:_0x2c0d74[_0xcd6d('0x29')];if(_0x5a3d52['query'][_0xcd6d('0x39')]){_0x923e42[_0xcd6d('0x3a')]=[{'all':!![]}];}_0x923e42=_['merge']({},_0x923e42,_0x5a3d52[_0xcd6d('0x37')]);return db[_0xcd6d('0x38')][_0xcd6d('0x3f')](_0x923e42)[_0xcd6d('0x13')](handleEntityNotFound(_0x141896,null))['then'](respondWithResult(_0x141896,null))['catch'](handleError(_0x141896,null));};exports['destroy']=function(_0x45b9f6,_0x48bd10){return db[_0xcd6d('0x38')][_0xcd6d('0x3f')]({'where':{'id':_0x45b9f6[_0xcd6d('0x3e')]['id']}})[_0xcd6d('0x13')](handleEntityNotFound(_0x48bd10,null))[_0xcd6d('0x13')](removeEntity(_0x48bd10,null))[_0xcd6d('0x3d')](handleError(_0x48bd10,null));};exports[_0xcd6d('0x40')]=function(_0x41bf74,_0x4600f1){if(_0x41bf74[_0xcd6d('0x41')][_0xcd6d('0x1e')]==='outbound'&&!_[_0xcd6d('0x42')](_0x41bf74['body'][_0xcd6d('0x43')],'_')){_0x41bf74[_0xcd6d('0x41')][_0xcd6d('0x43')]='_'[_0xcd6d('0x44')](_0x41bf74[_0xcd6d('0x41')][_0xcd6d('0x43')]);}return db[_0xcd6d('0x38')][_0xcd6d('0x40')](_0x41bf74[_0xcd6d('0x41')],{'raw':![]})[_0xcd6d('0x13')](function(_0x473ae0){var _0xa7595c=_0x41bf74[_0xcd6d('0x45')][_0xcd6d('0x14')]({'plain':!![]});if(!_0xa7595c)throw new Error(_0xcd6d('0x46'));if(_0xa7595c[_0xcd6d('0x47')]==='user'){var _0x3cff0f=_0x473ae0[_0xcd6d('0x14')]({'plain':!![]});var _0x4395b1=[{'name':_0xcd6d('0x48'),'value':_0xcd6d('0x15')},{'name':_0xcd6d('0x16'),'value':_0xcd6d('0x17')},{'name':_0xcd6d('0x18'),'value':_0xcd6d('0x19')}];var _0x22e6ca=_[_0xcd6d('0x3f')](_0x4395b1,[_0xcd6d('0x1c'),_0x3cff0f[_0xcd6d('0x1e')]])['name'];return db[_0xcd6d('0x49')][_0xcd6d('0x3f')]({'where':{'name':_0x22e6ca,'userProfileId':_0xa7595c[_0xcd6d('0x4a')]},'raw':!![]})[_0xcd6d('0x13')](function(_0x55871d){if(_0x55871d&&_0x55871d[_0xcd6d('0x4b')]===0x0){return db[_0xcd6d('0x20')]['create']({'name':_0x3cff0f[_0xcd6d('0x1f')],'resourceId':_0x3cff0f['id'],'type':_0x55871d['name'],'sectionId':_0x55871d['id']},{})['then'](function(){return _0x473ae0;});}else{return _0x473ae0;}})['catch'](function(_0x3c33a2){logger[_0xcd6d('0x23')](_0xcd6d('0x4c'),_0x3c33a2);throw _0x3c33a2;});}return _0x473ae0;})[_0xcd6d('0x13')](respondWithResult(_0x4600f1,0xc9))[_0xcd6d('0x3d')](handleError(_0x4600f1,null));};exports[_0xcd6d('0x4d')]=function(_0x3b44e5,_0x559698){if(_0x3b44e5['body']['id']){delete _0x3b44e5[_0xcd6d('0x41')]['id'];}return db[_0xcd6d('0x38')][_0xcd6d('0x3f')]({'where':{'id':_0x3b44e5['params']['id']}})['then'](handleEntityNotFound(_0x559698,null))[_0xcd6d('0x13')](function(_0xa69e30){if(_0xa69e30){return db['VoiceExtension']['update'](_[_0xcd6d('0x32')](_0x3b44e5[_0xcd6d('0x41')],['exten','context',_0xcd6d('0x4e'),'recordingFormat',_0xcd6d('0x4f'),'mandatoryDisposition',_0xcd6d('0x50')]),{'where':{'context':_0xa69e30[_0xcd6d('0x51')],'exten':_0xa69e30[_0xcd6d('0x43')]},'individualHooks':!![]})[_0xcd6d('0x13')](function(_0x2f0c77){return _0x2f0c77;});}return null;})[_0xcd6d('0x13')](respondWithStatusCode(_0x559698,null))[_0xcd6d('0x3d')](handleError(_0x559698,null));};exports['addApplications']=function(_0x4bbed8,_0x4689b4){return db['VoiceExtension'][_0xcd6d('0x52')]({'where':{'id':_0x4bbed8[_0xcd6d('0x3e')]['id']}})[_0xcd6d('0x13')](function(_0x1287a9){if(_0x1287a9){return db['sequelize'][_0xcd6d('0x53')](function(_0x49f584){return db[_0xcd6d('0x38')][_0xcd6d('0x21')]({'where':{'VoiceExtensionId':_0x4bbed8['params']['id']},'transaction':_0x49f584})[_0xcd6d('0x13')](function(){var _0x2a76c4=_[_0xcd6d('0x1b')](_0x4bbed8[_0xcd6d('0x41')],function(_0x11cf51){_0x11cf51[_0xcd6d('0x54')]=_0x4bbed8[_0xcd6d('0x3e')]['id'];_0x11cf51[_0xcd6d('0x55')]=!![];return _0x11cf51;});return _0x1287a9['createRouting'](_0x2a76c4);})[_0xcd6d('0x13')](function(_0x20d2c1){console[_0xcd6d('0x56')](_0xcd6d('0x57'),_0x20d2c1);return db[_0xcd6d('0x38')]['bulkCreate'](_0x20d2c1,{'transaction':_0x49f584});});})[_0xcd6d('0x13')](function(){return db['VoiceExtension'][_0xcd6d('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4bbed8['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xcd6d('0x13')](respondWithResult(_0x4689b4,null))[_0xcd6d('0x3d')](handleError(_0x4689b4,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7405161..33c6722 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 _0x6045=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x13e81e,_0x34247d){var _0x5a886a=function(_0x588a34){while(--_0x588a34){_0x13e81e['push'](_0x13e81e['shift']());}};_0x5a886a(++_0x34247d);}(_0x6045,0x1e6));var _0x5604=function(_0x4c6c1a,_0x3f4652){_0x4c6c1a=_0x4c6c1a-0x0;var _0x31c9d4=_0x6045[_0x4c6c1a];return _0x31c9d4;};'use strict';var EventEmitter=require(_0x5604('0x0'));var VoiceExtension=require(_0x5604('0x1'))['db'][_0x5604('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5604('0x3')](0x0);var events={'afterCreate':_0x5604('0x4'),'afterUpdate':'update','afterDestroy':_0x5604('0x5')};function emitEvent(_0x3a6f89){return function(_0x12cc99,_0x2f9e7a,_0x4bb867){VoiceExtensionEvents[_0x5604('0x6')](_0x3a6f89+':'+_0x12cc99['id'],_0x12cc99);VoiceExtensionEvents[_0x5604('0x6')](_0x3a6f89,_0x12cc99);_0x4bb867(null);};}for(var e in events){if(events[_0x5604('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x5604('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc229=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','exports'];(function(_0x4b38a,_0x45fdf7){var _0xf0592b=function(_0x400581){while(--_0x400581){_0x4b38a['push'](_0x4b38a['shift']());}};_0xf0592b(++_0x45fdf7);}(_0xc229,0x126));var _0x9c22=function(_0x3ecdcc,_0x2a579b){_0x3ecdcc=_0x3ecdcc-0x0;var _0x57a3d5=_0xc229[_0x3ecdcc];return _0x57a3d5;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x9c22('0x0'))['db'][_0x9c22('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9c22('0x2')](0x0);var events={'afterCreate':_0x9c22('0x3'),'afterUpdate':'update','afterDestroy':_0x9c22('0x4')};function emitEvent(_0x42e746){return function(_0x2a2423,_0x57d0d5,_0x4ec657){VoiceExtensionEvents[_0x9c22('0x5')](_0x42e746+':'+_0x2a2423['id'],_0x2a2423);VoiceExtensionEvents[_0x9c22('0x5')](_0x42e746,_0x2a2423);_0x4ec657(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x9c22('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 94ceca6..f42f426 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 _0x01a2=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','length','name','param','phone','split','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','toLowerCase','hasOwnProperty','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','queue','playback','includes','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}'];(function(_0x40537c,_0x1103af){var _0x2d39c2=function(_0x14412a){while(--_0x14412a){_0x40537c['push'](_0x40537c['shift']());}};_0x2d39c2(++_0x1103af);}(_0x01a2,0x1cb));var _0x201a=function(_0x4e2e0d,_0x5fdd27){_0x4e2e0d=_0x4e2e0d-0x0;var _0x4afb5c=_0x01a2[_0x4e2e0d];return _0x4afb5c;};'use strict';var _=require('lodash');var attributes=require(_0x201a('0x0'));module[_0x201a('0x1')]=function(_0x375559){var _0x18211c=_0x375559[_0x201a('0x2')];function _0x5a84de(_0x599c26){var _0x3f3d4a=0x2;var _0x3bc952=[{'type':_0x599c26[_0x201a('0x3')],'app':_0x201a('0x4'),'appdata':_0x201a('0x5')+_0x599c26[_0x201a('0x3')],'context':_0x599c26[_0x201a('0x6')],'exten':_0x599c26[_0x201a('0x7')],'priority':_0x3f3d4a++,'VoiceExtensionId':_0x599c26['id']},{'type':_0x599c26[_0x201a('0x3')],'app':_0x599c26[_0x201a('0x8')]?_0x201a('0x4'):_0x201a('0x9'),'appdata':_0x599c26[_0x201a('0x8')]?_0x201a('0xa')+_0x599c26[_0x201a('0x8')]:'No\x20alias\x20set','context':_0x599c26[_0x201a('0x6')],'exten':_0x599c26[_0x201a('0x7')],'priority':_0x3f3d4a++,'VoiceExtensionId':_0x599c26['id']}];if(_0x599c26['type']==='inbound'){_0x3bc952[_0x201a('0xb')]({'type':_0x201a('0xc'),'app':'Set','appdata':_0x201a('0xd')+_0x599c26['id'],'context':_0x599c26[_0x201a('0x6')],'exten':_0x599c26[_0x201a('0x7')],'priority':_0x3f3d4a++,'VoiceExtensionId':_0x599c26['id']});}_0x3bc952[_0x201a('0xb')]({'type':_0x599c26[_0x201a('0x3')],'app':_0x201a('0x4'),'appdata':_0x201a('0xe'),'context':_0x599c26[_0x201a('0x6')],'exten':_0x599c26['exten'],'priority':_0x3f3d4a++,'VoiceExtensionId':_0x599c26['id']},{'type':_0x599c26['type'],'app':_0x201a('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x599c26[_0x201a('0x6')],'exten':_0x599c26[_0x201a('0x7')],'priority':_0x3f3d4a++,'VoiceExtensionId':_0x599c26['id']},{'type':_0x599c26['type'],'app':_0x201a('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x599c26[_0x201a('0x6')],'exten':_0x599c26[_0x201a('0x7')],'priority':_0x3f3d4a++,'VoiceExtensionId':_0x599c26['id']});return _0x3bc952;}function _0xfbf6f(_0x30020d){var _0x28a443=0x2;var _0x53bb87=[{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':_0x201a('0x10'),'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x30020d[_0x201a('0x8')]?'Set':_0x201a('0x9'),'appdata':_0x30020d['alias']?_0x201a('0xa')+_0x30020d[_0x201a('0x8')]:'No\x20alias\x20set','context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':_0x201a('0x11')+(_0x30020d[_0x201a('0x12')]?_0x201a('0x13')+_0x30020d[_0x201a('0x12')]+'}':_0x201a('0x14')),'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':_0x201a('0xd')+_0x30020d['id'],'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d['exten'],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x15'),'appdata':_0x201a('0x16')+(_0x28a443+0x2)+_0x201a('0x17')+(_0x28a443+0x1)+')','context':_0x30020d['context'],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':'Set','appdata':_0x30020d[_0x201a('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x30020d['cutdigits']+'}':_0x201a('0x18'),'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x30020d['context'],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':'outbound','app':_0x201a('0x4'),'appdata':_0x201a('0x19')+_0x30020d['id'],'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']}];if(_0x30020d['hasOwnProperty']('recordingFormat')&&_0x30020d['recordingFormat']!==_0x201a('0x1a')){_0x53bb87[_0x201a('0xb')]({'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':_0x201a('0x1b'),'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d[_0x201a('0x7')],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']},{'type':_0x201a('0xf'),'app':_0x201a('0x4'),'appdata':_0x201a('0x1c')+_0x30020d[_0x201a('0x1d')]||_0x201a('0x1e'),'context':_0x30020d[_0x201a('0x6')],'exten':_0x30020d['exten'],'priority':_0x28a443++,'VoiceExtensionId':_0x30020d['id']});}return _0x53bb87;}function _0x6fe8f7(_0x589519,_0x1c409a){var _0x3669bd=[{'name':_0x201a('0x1f'),'param':0x0},{'name':_0x201a('0x20'),'param':0x1},{'name':_0x201a('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x51d1c6={};var _0x3de0e1=_0x1c409a['split'](',');var _0x69d4d7=[];for(var _0x337b82=0x0;_0x337b82<_0x3669bd[_0x201a('0x22')];_0x337b82++){switch(_0x3669bd[_0x337b82][_0x201a('0x23')]){case'trunk':_0x51d1c6[_0x201a('0x1f')]=_0x3de0e1[_0x3669bd[_0x337b82][_0x201a('0x24')]]['split']('/')[0x1];_0x51d1c6[_0x201a('0x25')]=_0x3de0e1[_0x3669bd[_0x337b82][_0x201a('0x24')]][_0x201a('0x26')]('/')[0x2];_0x51d1c6['prefix']=_0x51d1c6[_0x201a('0x25')]?_0x51d1c6[_0x201a('0x25')]['split']('$')[0x0]:undefined;_0x51d1c6[_0x201a('0x25')]=_0x589519[_0x201a('0x12')]?(_0x51d1c6[_0x201a('0x27')]||'')+_0x201a('0x13')+_0x589519[_0x201a('0x12')]+'}':(_0x51d1c6[_0x201a('0x27')]||'')+_0x201a('0x14');_0x69d4d7[_0x3669bd[_0x337b82][_0x201a('0x24')]]=[_0x201a('0x28'),_0x51d1c6['trunk'],_0x51d1c6[_0x201a('0x25')]][_0x201a('0x29')]('/');break;case _0x201a('0x21'):_0x51d1c6['options']=_0x3de0e1[_0x3669bd[_0x337b82][_0x201a('0x24')]];if(_0x589519[_0x201a('0x1d')]!==_0x201a('0x1a')){if(_0x51d1c6[_0x201a('0x21')][_0x201a('0x2a')](_0x201a('0x2b'))<0x0){_0x51d1c6['options']+=_0x201a('0x2b');}}else{_0x51d1c6[_0x201a('0x21')]=_0x51d1c6[_0x201a('0x21')]['replace']('U(xcally-mixmonitor-context)','');}_0x69d4d7[_0x3669bd[_0x337b82]['param']]=_0x51d1c6[_0x201a('0x21')];break;default:_0x69d4d7[_0x3669bd[_0x337b82][_0x201a('0x24')]]=_0x3de0e1[_0x3669bd[_0x337b82][_0x201a('0x24')]];}}return _0x69d4d7['join'](',');}function _0x5d200d(_0x1d1e32,_0x28bd2f,_0x4e2a31){return new Promise(function(_0xddaea1,_0x4b873f){var _0x56c91d=[];if(_[_0x201a('0x2c')](_0x28bd2f))return _0xddaea1(_0x56c91d);_0x18211c[_0x201a('0x2d')][_0x201a('0x2e')]({'attributes':['id','interval',_0x201a('0x2f')],'raw':!![]})[_0x201a('0x30')](function(_0x551ebd){for(var _0x7b6dc1=0x0,_0x792988=0x0;_0x7b6dc1<_0x28bd2f[_0x201a('0x22')];_0x7b6dc1++,_0x792988=0x0){var _0x24a76f=_0x28bd2f[_0x7b6dc1];var _0x590503=[];var _0x4219d3=[];delete _0x24a76f['id'];if(_0x24a76f[_0x201a('0x31')]!==_0x201a('0x32')){_0x24a76f[_0x201a('0x33')]=[_0x24a76f[_0x201a('0x31')]];}else{_0x24a76f[_0x201a('0x33')]=_0x24a76f[_0x201a('0x2f')]?_[_0x201a('0x34')](_['filter'](_0x551ebd,{'IntervalId':_0x24a76f[_0x201a('0x2f')]}),_0x201a('0x31')):[];}_0x24a76f['context']=_0x1d1e32[_0x201a('0x6')];_0x24a76f[_0x201a('0x7')]=_0x1d1e32[_0x201a('0x7')];if(_0x24a76f['type'])_0x24a76f[_0x201a('0x3')]=_0x24a76f[_0x201a('0x3')][_0x201a('0x35')]();if(_0x1d1e32['type']==='outbound'){if(_0x24a76f[_0x201a('0x36')](_0x201a('0x37'))&&_0x24a76f[_0x201a('0x37')]&&_0x24a76f['tag']!=='--'){_0x590503['push']({'type':_0x24a76f[_0x201a('0x3')]['toLowerCase'](),'app':_0x201a('0x4'),'appdata':_0x201a('0x38')+_0x24a76f[_0x201a('0x37')],'context':_0x1d1e32['context'],'exten':_0x1d1e32[_0x201a('0x7')],'priority':_0x24a76f['intervals'][_0x201a('0x22')]+_0x4e2a31+_0x792988++,'VoiceExtensionId':_0x1d1e32['id']});}_0x590503[_0x201a('0xb')]({'type':_0x24a76f[_0x201a('0x3')][_0x201a('0x35')](),'app':_0x201a('0x15'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x24a76f[_0x201a('0x39')]?_0x201a('0x3a')+_0x24a76f[_0x201a('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x1d1e32[_0x201a('0x6')],'exten':_0x1d1e32[_0x201a('0x7')],'priority':_0x24a76f[_0x201a('0x33')][_0x201a('0x22')]+_0x4e2a31+_0x792988++,'VoiceExtensionId':_0x1d1e32['id']});}else{if(_0x24a76f[_0x201a('0x36')]('answer')){if([_0x201a('0x3b'),_0x201a('0x3c')][_0x201a('0x3d')](_0x24a76f[_0x201a('0x3e')][_0x201a('0x35')]())&&_0x24a76f[_0x201a('0x3f')]!==_0x201a('0x40')){if(_0x24a76f[_0x201a('0x41')]){_0x590503[_0x201a('0xb')]({'type':_0x24a76f[_0x201a('0x3')]['toLowerCase'](),'app':_0x201a('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1d1e32[_0x201a('0x6')],'exten':_0x1d1e32[_0x201a('0x7')],'priority':_0x24a76f[_0x201a('0x33')][_0x201a('0x22')]+_0x4e2a31+_0x792988++,'VoiceExtensionId':_0x1d1e32['id']});_0x590503[_0x201a('0xb')]({'type':_0x24a76f['type']['toLowerCase'](),'app':'Set','appdata':_0x201a('0x42'),'context':_0x1d1e32[_0x201a('0x6')],'exten':_0x1d1e32[_0x201a('0x7')],'priority':_0x24a76f[_0x201a('0x33')][_0x201a('0x22')]+_0x4e2a31+_0x792988++,'VoiceExtensionId':_0x1d1e32['id']});}else{_0x590503[_0x201a('0xb')]({'type':_0x24a76f[_0x201a('0x3')][_0x201a('0x35')](),'app':_0x201a('0x15'),'appdata':_0x201a('0x43'),'context':_0x1d1e32[_0x201a('0x6')],'exten':_0x1d1e32[_0x201a('0x7')],'priority':_0x24a76f['intervals']['length']+_0x4e2a31+_0x792988++,'VoiceExtensionId':_0x1d1e32['id']});_0x590503['push']({'type':_0x24a76f[_0x201a('0x3')][_0x201a('0x35')](),'app':_0x201a('0x4'),'appdata':_0x201a('0x44'),'context':_0x1d1e32[_0x201a('0x6')],'exten':_0x1d1e32[_0x201a('0x7')],'priority':_0x24a76f[_0x201a('0x33')][_0x201a('0x22')]+_0x4e2a31+_0x792988++,'VoiceExtensionId':_0x1d1e32['id']});}}}}for(var _0x2170d9=0x0;_0x2170d9<_0x24a76f['intervals']['length'];_0x2170d9++){var _0x527802=_0x4e2a31+_0x24a76f['intervals'][_0x201a('0x22')];var _0x7bc309=_0x2170d9===_0x24a76f[_0x201a('0x33')]['length']-0x1?_0x4e2a31+_0x590503[_0x201a('0x22')]+_0x4219d3['length']+0x2:_0x4e2a31+_0x2170d9+0x1;_0x590503[_0x201a('0x45')](_0x2170d9,0x0,{'type':_0x1d1e32['type'],'app':_0x201a('0x46'),'appdata':_0x24a76f['intervals'][_0x2170d9]+'?'+_0x1d1e32[_0x201a('0x6')]+',${EXTEN},'+_0x527802+':'+_0x1d1e32[_0x201a('0x6')]+_0x201a('0x47')+_0x7bc309,'exten':_0x1d1e32[_0x201a('0x7')],'context':_0x1d1e32[_0x201a('0x6')],'priority':_0x4e2a31+_0x2170d9,'VoiceExtensionId':_0x1d1e32['id']});}if(_0x24a76f[_0x201a('0x3f')]===_0x201a('0x48'))_0x24a76f['appdata']=_0x6fe8f7(_0x1d1e32,_0x24a76f[_0x201a('0x49')]);_0x24a76f[_0x201a('0x4a')]=_0x590503[_0x201a('0x22')]?_[_0x201a('0x4b')](_0x590503)['priority']+0x1:_0x4e2a31;_0x56c91d=_[_0x201a('0x4c')](_0x56c91d,_0x590503,[_0x24a76f],_0x4219d3);_0x4e2a31=_[_0x201a('0x4b')](_0x56c91d)[_0x201a('0x4a')]+0x1;}return _0xddaea1(_0x56c91d);})['catch'](function(_0x234515){_0x4b873f(_0x234515);});});}return _0x375559[_0x201a('0x4d')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xaaf64e){var _0x1deabb=this[_0x201a('0x4e')]({'plain':!![]});var _0x586f99=_0x1deabb[_0x201a('0x3')]===_0x201a('0xf')?_0xfbf6f(_0x1deabb):_0x5a84de(_0x1deabb);return _0x5d200d(_0x1deabb,_0xaaf64e,_[_0x201a('0x4b')](_0x586f99)[_0x201a('0x4a')]+0x1)[_0x201a('0x30')](function(_0x8879f3){var _0x2a905c=_[_0x201a('0x4c')](_0x586f99,_0x8879f3);_0x2a905c['push']({'type':_0x1deabb['type'],'app':_0x201a('0x4f'),'exten':_0x1deabb[_0x201a('0x7')],'context':_0x1deabb[_0x201a('0x6')],'priority':_['last'](_0x2a905c)[_0x201a('0x4a')]+0x1,'VoiceExtensionId':_0x1deabb['id']});return _0x2a905c;});}}});}; \ No newline at end of file +var _0x46e1=['splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','get','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','split','length','param','phone','prefix','cutdigits','${EXTEN:','${EXTEN}','SIP','options','indexOf','U(xcally-mixmonitor-context)','join','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1'];(function(_0x53effc,_0x2a6268){var _0x3b0a06=function(_0x49b3cb){while(--_0x49b3cb){_0x53effc['push'](_0x53effc['shift']());}};_0x3b0a06(++_0x2a6268);}(_0x46e1,0x155));var _0x146e=function(_0x635c27,_0x559ba0){_0x635c27=_0x635c27-0x0;var _0x59c52e=_0x46e1[_0x635c27];return _0x59c52e;};'use strict';var _=require(_0x146e('0x0'));var attributes=require(_0x146e('0x1'));module[_0x146e('0x2')]=function(_0xb2e948){var _0x155784=_0xb2e948[_0x146e('0x3')];function _0x3708b1(_0x186d9b){var _0x18dab9=0x2;var _0x3bbaec=[{'type':_0x186d9b['type'],'app':_0x146e('0x4'),'appdata':_0x146e('0x5')+_0x186d9b[_0x146e('0x6')],'context':_0x186d9b[_0x146e('0x7')],'exten':_0x186d9b[_0x146e('0x8')],'priority':_0x18dab9++,'VoiceExtensionId':_0x186d9b['id']},{'type':_0x186d9b[_0x146e('0x6')],'app':_0x186d9b[_0x146e('0x9')]?'Set':_0x146e('0xa'),'appdata':_0x186d9b['alias']?_0x146e('0xb')+_0x186d9b[_0x146e('0x9')]:_0x146e('0xc'),'context':_0x186d9b[_0x146e('0x7')],'exten':_0x186d9b[_0x146e('0x8')],'priority':_0x18dab9++,'VoiceExtensionId':_0x186d9b['id']}];if(_0x186d9b[_0x146e('0x6')]==='inbound'){_0x3bbaec['push']({'type':_0x146e('0xd'),'app':_0x146e('0x4'),'appdata':_0x146e('0xe')+_0x186d9b['id'],'context':_0x186d9b[_0x146e('0x7')],'exten':_0x186d9b[_0x146e('0x8')],'priority':_0x18dab9++,'VoiceExtensionId':_0x186d9b['id']});}_0x3bbaec[_0x146e('0xf')]({'type':_0x186d9b[_0x146e('0x6')],'app':_0x146e('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x186d9b['context'],'exten':_0x186d9b[_0x146e('0x8')],'priority':_0x18dab9++,'VoiceExtensionId':_0x186d9b['id']},{'type':_0x186d9b[_0x146e('0x6')],'app':_0x146e('0x4'),'appdata':_0x146e('0x10'),'context':_0x186d9b[_0x146e('0x7')],'exten':_0x186d9b[_0x146e('0x8')],'priority':_0x18dab9++,'VoiceExtensionId':_0x186d9b['id']},{'type':_0x186d9b[_0x146e('0x6')],'app':_0x146e('0x4'),'appdata':_0x146e('0x11'),'context':_0x186d9b[_0x146e('0x7')],'exten':_0x186d9b[_0x146e('0x8')],'priority':_0x18dab9++,'VoiceExtensionId':_0x186d9b['id']});return _0x3bbaec;}function _0x55fddc(_0xcfd5f6){var _0x1a8a20=0x2;var _0x3f77d3=[{'type':_0x146e('0x12'),'app':_0x146e('0x4'),'appdata':_0x146e('0x13'),'context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6['exten'],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':_0xcfd5f6['alias']?_0x146e('0x4'):_0x146e('0xa'),'appdata':_0xcfd5f6[_0x146e('0x9')]?'CDR(routeAlias)='+_0xcfd5f6[_0x146e('0x9')]:'No\x20alias\x20set','context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6['exten'],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':_0x146e('0x4'),'appdata':'CDR(destination)='+(_0xcfd5f6['cutdigits']?'${EXTEN:'+_0xcfd5f6['cutdigits']+'}':'${EXTEN}'),'context':_0xcfd5f6['context'],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':'outbound','app':_0x146e('0x4'),'appdata':_0x146e('0xe')+_0xcfd5f6['id'],'context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':_0x146e('0x14'),'appdata':_0x146e('0x15')+(_0x1a8a20+0x2)+'):Goto('+(_0x1a8a20+0x1)+')','context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6['exten'],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':'Set','appdata':_0xcfd5f6['cutdigits']?_0x146e('0x16')+_0xcfd5f6['cutdigits']+'}':_0x146e('0x17'),'context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':_0x146e('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':_0x146e('0x4'),'appdata':_0x146e('0x10'),'context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6['exten'],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':'Set','appdata':'outboundrouteid='+_0xcfd5f6['id'],'context':_0xcfd5f6[_0x146e('0x7')],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']}];if(_0xcfd5f6[_0x146e('0x18')](_0x146e('0x19'))&&_0xcfd5f6[_0x146e('0x19')]!==_0x146e('0x1a')){_0x3f77d3['push']({'type':_0x146e('0x12'),'app':'Set','appdata':_0x146e('0x1b'),'context':_0xcfd5f6['context'],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']},{'type':_0x146e('0x12'),'app':_0x146e('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xcfd5f6[_0x146e('0x19')]||_0x146e('0x1c'),'context':_0xcfd5f6['context'],'exten':_0xcfd5f6[_0x146e('0x8')],'priority':_0x1a8a20++,'VoiceExtensionId':_0xcfd5f6['id']});}return _0x3f77d3;}function _0x3271e1(_0x2f438d,_0x10e007){var _0x449162=[{'name':_0x146e('0x1d'),'param':0x0},{'name':_0x146e('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x257b42={};var _0x31951c=_0x10e007[_0x146e('0x1f')](',');var _0x36bb15=[];for(var _0x3cbf6f=0x0;_0x3cbf6f<_0x449162[_0x146e('0x20')];_0x3cbf6f++){switch(_0x449162[_0x3cbf6f]['name']){case _0x146e('0x1d'):_0x257b42['trunk']=_0x31951c[_0x449162[_0x3cbf6f][_0x146e('0x21')]][_0x146e('0x1f')]('/')[0x1];_0x257b42[_0x146e('0x22')]=_0x31951c[_0x449162[_0x3cbf6f][_0x146e('0x21')]][_0x146e('0x1f')]('/')[0x2];_0x257b42[_0x146e('0x23')]=_0x257b42['phone']?_0x257b42['phone']['split']('$')[0x0]:undefined;_0x257b42['phone']=_0x2f438d[_0x146e('0x24')]?(_0x257b42[_0x146e('0x23')]||'')+_0x146e('0x25')+_0x2f438d[_0x146e('0x24')]+'}':(_0x257b42[_0x146e('0x23')]||'')+_0x146e('0x26');_0x36bb15[_0x449162[_0x3cbf6f][_0x146e('0x21')]]=[_0x146e('0x27'),_0x257b42[_0x146e('0x1d')],_0x257b42[_0x146e('0x22')]]['join']('/');break;case _0x146e('0x28'):_0x257b42[_0x146e('0x28')]=_0x31951c[_0x449162[_0x3cbf6f][_0x146e('0x21')]];if(_0x2f438d[_0x146e('0x19')]!==_0x146e('0x1a')){if(_0x257b42['options'][_0x146e('0x29')](_0x146e('0x2a'))<0x0){_0x257b42[_0x146e('0x28')]+=_0x146e('0x2a');}}else{_0x257b42[_0x146e('0x28')]=_0x257b42[_0x146e('0x28')]['replace'](_0x146e('0x2a'),'');}_0x36bb15[_0x449162[_0x3cbf6f][_0x146e('0x21')]]=_0x257b42[_0x146e('0x28')];break;default:_0x36bb15[_0x449162[_0x3cbf6f]['param']]=_0x31951c[_0x449162[_0x3cbf6f][_0x146e('0x21')]];}}return _0x36bb15[_0x146e('0x2b')](',');}function _0x4be842(_0x5851e1,_0x4e1747,_0x36c0df){return new Promise(function(_0x34bb2a,_0x1a8cb9){var _0x41c45b=[];if(_['isEmpty'](_0x4e1747))return _0x34bb2a(_0x41c45b);_0x155784[_0x146e('0x2c')][_0x146e('0x2d')]({'attributes':['id',_0x146e('0x2e'),_0x146e('0x2f')],'raw':!![]})[_0x146e('0x30')](function(_0x4e0d00){for(var _0x4d3b3d=0x0,_0x54bfec=0x0;_0x4d3b3d<_0x4e1747[_0x146e('0x20')];_0x4d3b3d++,_0x54bfec=0x0){var _0x1476c1=_0x4e1747[_0x4d3b3d];var _0xf50315=[];var _0x267292=[];delete _0x1476c1['id'];if(_0x1476c1['interval']!==_0x146e('0x31')){_0x1476c1['intervals']=[_0x1476c1[_0x146e('0x2e')]];}else{_0x1476c1[_0x146e('0x32')]=_0x1476c1[_0x146e('0x2f')]?_[_0x146e('0x33')](_[_0x146e('0x34')](_0x4e0d00,{'IntervalId':_0x1476c1[_0x146e('0x2f')]}),'interval'):[];}_0x1476c1[_0x146e('0x7')]=_0x5851e1[_0x146e('0x7')];_0x1476c1['exten']=_0x5851e1[_0x146e('0x8')];if(_0x1476c1[_0x146e('0x6')])_0x1476c1[_0x146e('0x6')]=_0x1476c1[_0x146e('0x6')][_0x146e('0x35')]();if(_0x5851e1[_0x146e('0x6')]==='outbound'){if(_0x1476c1[_0x146e('0x18')](_0x146e('0x36'))&&_0x1476c1[_0x146e('0x36')]&&_0x1476c1[_0x146e('0x36')]!=='--'){_0xf50315[_0x146e('0xf')]({'type':_0x1476c1[_0x146e('0x6')][_0x146e('0x35')](),'app':_0x146e('0x4'),'appdata':'CDR(tag)='+_0x1476c1[_0x146e('0x36')],'context':_0x5851e1[_0x146e('0x7')],'exten':_0x5851e1['exten'],'priority':_0x1476c1[_0x146e('0x32')][_0x146e('0x20')]+_0x36c0df+_0x54bfec++,'VoiceExtensionId':_0x5851e1['id']});}_0xf50315[_0x146e('0xf')]({'type':_0x1476c1[_0x146e('0x6')]['toLowerCase'](),'app':_0x146e('0x14'),'appdata':_0x146e('0x37')+(_0x1476c1[_0x146e('0x38')]?_0x146e('0x39')+_0x1476c1[_0x146e('0x38')]+')':_0x146e('0x3a')),'context':_0x5851e1['context'],'exten':_0x5851e1[_0x146e('0x8')],'priority':_0x1476c1[_0x146e('0x32')][_0x146e('0x20')]+_0x36c0df+_0x54bfec++,'VoiceExtensionId':_0x5851e1['id']});}else{if(_0x1476c1[_0x146e('0x18')]('answer')){if([_0x146e('0x3b'),_0x146e('0x3c')][_0x146e('0x3d')](_0x1476c1[_0x146e('0x3e')][_0x146e('0x35')]())&&_0x1476c1['appType']!==_0x146e('0x3f')){if(_0x1476c1[_0x146e('0x40')]){_0xf50315[_0x146e('0xf')]({'type':_0x1476c1[_0x146e('0x6')]['toLowerCase'](),'app':_0x146e('0x14'),'appdata':_0x146e('0x41'),'context':_0x5851e1['context'],'exten':_0x5851e1[_0x146e('0x8')],'priority':_0x1476c1[_0x146e('0x32')][_0x146e('0x20')]+_0x36c0df+_0x54bfec++,'VoiceExtensionId':_0x5851e1['id']});_0xf50315[_0x146e('0xf')]({'type':_0x1476c1['type'][_0x146e('0x35')](),'app':'Set','appdata':_0x146e('0x42'),'context':_0x5851e1[_0x146e('0x7')],'exten':_0x5851e1[_0x146e('0x8')],'priority':_0x1476c1['intervals']['length']+_0x36c0df+_0x54bfec++,'VoiceExtensionId':_0x5851e1['id']});}else{_0xf50315[_0x146e('0xf')]({'type':_0x1476c1[_0x146e('0x6')][_0x146e('0x35')](),'app':_0x146e('0x14'),'appdata':_0x146e('0x43'),'context':_0x5851e1[_0x146e('0x7')],'exten':_0x5851e1['exten'],'priority':_0x1476c1[_0x146e('0x32')]['length']+_0x36c0df+_0x54bfec++,'VoiceExtensionId':_0x5851e1['id']});_0xf50315[_0x146e('0xf')]({'type':_0x1476c1['type']['toLowerCase'](),'app':'Set','appdata':_0x146e('0x44'),'context':_0x5851e1[_0x146e('0x7')],'exten':_0x5851e1[_0x146e('0x8')],'priority':_0x1476c1[_0x146e('0x32')][_0x146e('0x20')]+_0x36c0df+_0x54bfec++,'VoiceExtensionId':_0x5851e1['id']});}}}}for(var _0x45955b=0x0;_0x45955b<_0x1476c1['intervals'][_0x146e('0x20')];_0x45955b++){var _0x2ac2fe=_0x36c0df+_0x1476c1[_0x146e('0x32')][_0x146e('0x20')];var _0x4644a7=_0x45955b===_0x1476c1['intervals']['length']-0x1?_0x36c0df+_0xf50315['length']+_0x267292[_0x146e('0x20')]+0x2:_0x36c0df+_0x45955b+0x1;_0xf50315[_0x146e('0x45')](_0x45955b,0x0,{'type':_0x5851e1[_0x146e('0x6')],'app':_0x146e('0x46'),'appdata':_0x1476c1[_0x146e('0x32')][_0x45955b]+'?'+_0x5851e1[_0x146e('0x7')]+_0x146e('0x47')+_0x2ac2fe+':'+_0x5851e1[_0x146e('0x7')]+_0x146e('0x47')+_0x4644a7,'exten':_0x5851e1[_0x146e('0x8')],'context':_0x5851e1['context'],'priority':_0x36c0df+_0x45955b,'VoiceExtensionId':_0x5851e1['id']});}if(_0x1476c1[_0x146e('0x48')]===_0x146e('0x49'))_0x1476c1['appdata']=_0x3271e1(_0x5851e1,_0x1476c1[_0x146e('0x4a')]);_0x1476c1[_0x146e('0x4b')]=_0xf50315[_0x146e('0x20')]?_['last'](_0xf50315)[_0x146e('0x4b')]+0x1:_0x36c0df;_0x41c45b=_[_0x146e('0x4c')](_0x41c45b,_0xf50315,[_0x1476c1],_0x267292);_0x36c0df=_[_0x146e('0x4d')](_0x41c45b)[_0x146e('0x4b')]+0x1;}return _0x34bb2a(_0x41c45b);})[_0x146e('0x4e')](function(_0x3063a6){_0x1a8cb9(_0x3063a6);});});}return _0xb2e948[_0x146e('0x4f')](_0x146e('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x47889a){var _0x5f12e4=this[_0x146e('0x51')]({'plain':!![]});var _0x34ca1b=_0x5f12e4[_0x146e('0x6')]==='outbound'?_0x55fddc(_0x5f12e4):_0x3708b1(_0x5f12e4);return _0x4be842(_0x5f12e4,_0x47889a,_['last'](_0x34ca1b)[_0x146e('0x4b')]+0x1)[_0x146e('0x30')](function(_0xb37c7b){var _0x3a56f7=_[_0x146e('0x4c')](_0x34ca1b,_0xb37c7b);_0x3a56f7[_0x146e('0xf')]({'type':_0x5f12e4['type'],'app':'Hangup','exten':_0x5f12e4['exten'],'context':_0x5f12e4[_0x146e('0x7')],'priority':_[_0x146e('0x4d')](_0x3a56f7)[_0x146e('0x4b')]+0x1,'VoiceExtensionId':_0x5f12e4['id']});return _0x3a56f7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 7497660..aa64046 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 _0x7c1f=['code','message','result','catch','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x367054,_0x1debc3){var _0x472454=function(_0x3f4ea7){while(--_0x3f4ea7){_0x367054['push'](_0x367054['shift']());}};_0x472454(++_0x1debc3);}(_0x7c1f,0x194));var _0xf7c1=function(_0x2dea93,_0x4a346a){_0x2dea93=_0x2dea93-0x0;var _0x2f2452=_0x7c1f[_0x2dea93];return _0x2f2452;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var moment=require(_0xf7c1('0x2'));var BPromise=require(_0xf7c1('0x3'));var rs=require(_0xf7c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7c1('0x5'))['db'];var utils=require(_0xf7c1('0x6'));var logger=require(_0xf7c1('0x7'))('rpc');var config=require(_0xf7c1('0x8'));var jayson=require(_0xf7c1('0x9'));var client=jayson[_0xf7c1('0xa')][_0xf7c1('0xb')]({'port':0x232a});config['redis']=_[_0xf7c1('0xc')](config[_0xf7c1('0xd')],{'host':_0xf7c1('0xe'),'port':0x18eb});var socket=require(_0xf7c1('0xf'))(new Redis(config[_0xf7c1('0xd')]));require(_0xf7c1('0x10'))[_0xf7c1('0x11')](socket);function respondWithRpcPromise(_0x211033,_0x118dfb,_0x1a4415){return new BPromise(function(_0x914382,_0x2584d7){return client['request'](_0x211033,_0x1a4415)[_0xf7c1('0x12')](function(_0x407fde){logger[_0xf7c1('0x13')](_0xf7c1('0x14'),_0x118dfb,_0xf7c1('0x15'));logger[_0xf7c1('0x16')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x118dfb,'request\x20sent',JSON[_0xf7c1('0x17')](_0x407fde));if(_0x407fde['error']){if(_0x407fde[_0xf7c1('0x18')][_0xf7c1('0x19')]===0x1f4){logger['error'](_0xf7c1('0x14'),_0x118dfb,_0x407fde['error'][_0xf7c1('0x1a')]);return _0x2584d7(_0x407fde[_0xf7c1('0x18')][_0xf7c1('0x1a')]);}logger[_0xf7c1('0x18')](_0xf7c1('0x14'),_0x118dfb,_0x407fde['error'][_0xf7c1('0x1a')]);return _0x914382(_0x407fde['error'][_0xf7c1('0x1a')]);}else{logger['info'](_0xf7c1('0x14'),_0x118dfb,_0xf7c1('0x15'));_0x914382(_0x407fde[_0xf7c1('0x1b')][_0xf7c1('0x1a')]);}})[_0xf7c1('0x1c')](function(_0x3e4124){logger[_0xf7c1('0x18')](_0xf7c1('0x14'),_0x118dfb,_0x3e4124);_0x2584d7(_0x3e4124);});});}exports['GetVoiceExtension']=function(_0x59f0d2){var _0x151b11=this;return new Promise(function(_0x3fd7fc,_0x4ee91e){return db[_0xf7c1('0x1d')][_0xf7c1('0x1e')]({'raw':_0x59f0d2['options']?_0x59f0d2[_0xf7c1('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x59f0d2['options']?_0x59f0d2['options'][_0xf7c1('0x20')]||null:null,'attributes':_0x59f0d2[_0xf7c1('0x1f')]?_0x59f0d2['options'][_0xf7c1('0x21')]||null:null,'limit':_0x59f0d2[_0xf7c1('0x1f')]?_0x59f0d2[_0xf7c1('0x1f')][_0xf7c1('0x22')]||null:null,'include':_0x59f0d2[_0xf7c1('0x1f')]?_0x59f0d2[_0xf7c1('0x1f')][_0xf7c1('0x23')]?_[_0xf7c1('0x24')](_0x59f0d2['options']['include'],function(_0x5bd8ba){return{'model':db[_0x5bd8ba[_0xf7c1('0x25')]],'as':_0x5bd8ba['as'],'attributes':_0x5bd8ba[_0xf7c1('0x21')],'include':_0x5bd8ba[_0xf7c1('0x23')]?_[_0xf7c1('0x24')](_0x5bd8ba[_0xf7c1('0x23')],function(_0x296afb){return{'model':db[_0x296afb[_0xf7c1('0x25')]],'as':_0x296afb['as'],'attributes':_0x296afb[_0xf7c1('0x21')],'include':_0x296afb[_0xf7c1('0x23')]?_['map'](_0x296afb[_0xf7c1('0x23')],function(_0x37c472){return{'model':db[_0x37c472['model']],'as':_0x37c472['as'],'attributes':_0x37c472[_0xf7c1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf7c1('0x12')](function(_0x410544){logger[_0xf7c1('0x13')](_0xf7c1('0x26'),_0x59f0d2);logger['debug'](_0xf7c1('0x26'),_0x59f0d2,JSON['stringify'](_0x410544));_0x3fd7fc(_0x410544);})[_0xf7c1('0x1c')](function(_0x3d8049){logger[_0xf7c1('0x18')]('GetVoiceExtension',_0x3d8049[_0xf7c1('0x1a')],_0x59f0d2);_0x4ee91e(_0x151b11[_0xf7c1('0x18')](0x1f4,_0x3d8049['message']));});});}; \ No newline at end of file +var _0x0960=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','debug','stringify','code','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x0960,0xc2));var _0x0096=function(_0x5cf5d6,_0x3620d1){_0x5cf5d6=_0x5cf5d6-0x0;var _0x240b0c=_0x0960[_0x5cf5d6];return _0x240b0c;};'use strict';var _=require(_0x0096('0x0'));var util=require(_0x0096('0x1'));var moment=require('moment');var BPromise=require(_0x0096('0x2'));var rs=require(_0x0096('0x3'));var fs=require('fs');var Redis=require(_0x0096('0x4'));var db=require(_0x0096('0x5'))['db'];var utils=require(_0x0096('0x6'));var logger=require(_0x0096('0x7'))(_0x0096('0x8'));var config=require(_0x0096('0x9'));var jayson=require(_0x0096('0xa'));var client=jayson[_0x0096('0xb')]['http']({'port':0x232a});config[_0x0096('0xc')]=_['defaults'](config[_0x0096('0xc')],{'host':_0x0096('0xd'),'port':0x18eb});var socket=require(_0x0096('0xe'))(new Redis(config['redis']));require(_0x0096('0xf'))[_0x0096('0x10')](socket);function respondWithRpcPromise(_0x20879f,_0x24a00a,_0x564840){return new BPromise(function(_0x18b3b3,_0xd711dd){return client['request'](_0x20879f,_0x564840)[_0x0096('0x11')](function(_0x59dfc5){logger[_0x0096('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x24a00a,_0x0096('0x13'));logger[_0x0096('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x24a00a,_0x0096('0x13'),JSON[_0x0096('0x15')](_0x59dfc5));if(_0x59dfc5['error']){if(_0x59dfc5['error'][_0x0096('0x16')]===0x1f4){logger[_0x0096('0x17')](_0x0096('0x18'),_0x24a00a,_0x59dfc5[_0x0096('0x17')][_0x0096('0x19')]);return _0xd711dd(_0x59dfc5['error']['message']);}logger[_0x0096('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x24a00a,_0x59dfc5['error'][_0x0096('0x19')]);return _0x18b3b3(_0x59dfc5[_0x0096('0x17')]['message']);}else{logger[_0x0096('0x12')](_0x0096('0x18'),_0x24a00a,'request\x20sent');_0x18b3b3(_0x59dfc5[_0x0096('0x1a')][_0x0096('0x19')]);}})[_0x0096('0x1b')](function(_0x22556d){logger[_0x0096('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x24a00a,_0x22556d);_0xd711dd(_0x22556d);});});}exports[_0x0096('0x1c')]=function(_0xd01f89){var _0xa2030c=this;return new Promise(function(_0x57c109,_0x1f5aad){return db[_0x0096('0x1d')][_0x0096('0x1e')]({'raw':_0xd01f89['options']?_0xd01f89[_0x0096('0x1f')][_0x0096('0x20')]===undefined?!![]:![]:!![],'where':_0xd01f89['options']?_0xd01f89[_0x0096('0x1f')][_0x0096('0x21')]||null:null,'attributes':_0xd01f89['options']?_0xd01f89[_0x0096('0x1f')][_0x0096('0x22')]||null:null,'limit':_0xd01f89[_0x0096('0x1f')]?_0xd01f89['options'][_0x0096('0x23')]||null:null,'include':_0xd01f89[_0x0096('0x1f')]?_0xd01f89[_0x0096('0x1f')]['include']?_['map'](_0xd01f89['options'][_0x0096('0x24')],function(_0x1a6df7){return{'model':db[_0x1a6df7['model']],'as':_0x1a6df7['as'],'attributes':_0x1a6df7['attributes'],'include':_0x1a6df7[_0x0096('0x24')]?_[_0x0096('0x25')](_0x1a6df7['include'],function(_0x4b77ae){return{'model':db[_0x4b77ae[_0x0096('0x26')]],'as':_0x4b77ae['as'],'attributes':_0x4b77ae[_0x0096('0x22')],'include':_0x4b77ae['include']?_[_0x0096('0x25')](_0x4b77ae[_0x0096('0x24')],function(_0x204002){return{'model':db[_0x204002[_0x0096('0x26')]],'as':_0x204002['as'],'attributes':_0x204002[_0x0096('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x511806){logger[_0x0096('0x12')](_0x0096('0x1c'),_0xd01f89);logger[_0x0096('0x14')]('GetVoiceExtension',_0xd01f89,JSON['stringify'](_0x511806));_0x57c109(_0x511806);})[_0x0096('0x1b')](function(_0x56246c){logger[_0x0096('0x17')](_0x0096('0x1c'),_0x56246c[_0x0096('0x19')],_0xd01f89);_0x1f5aad(_0xa2030c[_0x0096('0x17')](0x1f4,_0x56246c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8e3341d..019acea 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 _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x193927,_0x5f179e){var _0x2f8b59=function(_0x1c8bad){while(--_0x1c8bad){_0x193927['push'](_0x193927['shift']());}};_0x2f8b59(++_0x5f179e);}(_0x0295,0x1f0));var _0x5029=function(_0xe1b12b,_0x241bd1){_0xe1b12b=_0xe1b12b-0x0;var _0x1b697a=_0x0295[_0xe1b12b];return _0x1b697a;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x487c03,_0x53f15d){var _0x58ebb8=function(_0x80c0d2){while(--_0x80c0d2){_0x487c03['push'](_0x487c03['shift']());}};_0x58ebb8(++_0x53f15d);}(_0x53ec,0x192));var _0xc53e=function(_0x4cc1c1,_0x3ad908){_0x4cc1c1=_0x4cc1c1-0x0;var _0x483778=_0x53ec[_0x4cc1c1];return _0x483778;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 1f151aa..f42e329 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x1c4831,_0x3ff74a){var _0x1e6a6d=function(_0x434896){while(--_0x434896){_0x1c4831['push'](_0x1c4831['shift']());}};_0x1e6a6d(++_0x3ff74a);}(_0x6d11,0xbf));var _0x16d1=function(_0x1ef566,_0x739ea1){_0x1ef566=_0x1ef566-0x0;var _0x91a95d=_0x6d11[_0x1ef566];return _0x91a95d;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')]('/',auth[_0x16d1('0x8')](),controller['create']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);router[_0x16d1('0xf')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x10')]);module['exports']=router; \ No newline at end of file +var _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x5033cf,_0x439c58){var _0x2e6970=function(_0x3b48e6){while(--_0x3b48e6){_0x5033cf['push'](_0x5033cf['shift']());}};_0x2e6970(++_0x439c58);}(_0xeda8,0x104));var _0x8eda=function(_0x389cca,_0x50fe23){_0x389cca=_0x389cca-0x0;var _0x2d3b5f=_0xeda8[_0x389cca];return _0x2d3b5f;};'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')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index ee8f6e8..1dad76f 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 _0x4f50=['trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string'];(function(_0x5b29de,_0x1092ba){var _0x39de43=function(_0x29e6c0){while(--_0x29e6c0){_0x5b29de['push'](_0x5b29de['shift']());}};_0x39de43(++_0x1092ba);}(_0x4f50,0x116));var _0x04f5=function(_0x1c1b4a,_0x5c48a1){_0x1c1b4a=_0x1c1b4a-0x0;var _0x119ee1=_0x4f50[_0x1c1b4a];return _0x119ee1;};'use strict';var Sequelize=require(_0x04f5('0x0'));module[_0x04f5('0x1')]={'customer_id':{'type':Sequelize[_0x04f5('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x04f5('0x3'),'unique':_0x04f5('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x04f5('0x4')},'password':{'type':Sequelize[_0x04f5('0x2')]},'fullname':{'type':Sequelize[_0x04f5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x12b319){this['setDataValue'](_0x04f5('0x5'),typeof _0x12b319===_0x04f5('0x6')&&_0x12b319[_0x04f5('0x7')]()?_0x12b319[_0x04f5('0x7')]():null);}},'pager':{'type':Sequelize[_0x04f5('0x2')]},'tz':{'type':Sequelize[_0x04f5('0x2')],'defaultValue':_0x04f5('0x8')},'attach':{'type':Sequelize['ENUM'](_0x04f5('0x9'),'no'),'defaultValue':_0x04f5('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x04f5('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x04f5('0x2')]},'callback':{'type':Sequelize[_0x04f5('0x2')]},'review':{'type':Sequelize['ENUM'](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x04f5('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x04f5('0x9'),'no'),'defaultValue':_0x04f5('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x04f5('0xa')](_0x04f5('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x04f5('0xc')},'emailsubject':{'type':Sequelize[_0x04f5('0x2')]},'emailbody':{'type':Sequelize[_0x04f5('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x04f5('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x04f5('0xe')],'get':function(){return this[_0x04f5('0xf')](_0x04f5('0x10'))+_0x04f5('0x11')+this[_0x04f5('0xf')](_0x04f5('0x12'));}}}; \ No newline at end of file +var _0x604d=['contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','INTEGER','getDataValue','fullname','mailbox','sequelize','exports','STRING'];(function(_0x4f485f,_0x1db0f7){var _0x1e998e=function(_0x14066c){while(--_0x14066c){_0x4f485f['push'](_0x4f485f['shift']());}};_0x1e998e(++_0x1db0f7);}(_0x604d,0x1a1));var _0xd604=function(_0x2c7c27,_0x945979){_0x2c7c27=_0x2c7c27-0x0;var _0x38a3ce=_0x604d[_0x2c7c27];return _0x38a3ce;};'use strict';var Sequelize=require(_0xd604('0x0'));module[_0xd604('0x1')]={'customer_id':{'type':Sequelize[_0xd604('0x2')]},'context':{'type':Sequelize[_0xd604('0x2')],'defaultValue':'from-voicemail','unique':_0xd604('0x3')},'mailbox':{'type':Sequelize[_0xd604('0x2')],'defaultValue':'','allowNull':![],'unique':_0xd604('0x3')},'password':{'type':Sequelize[_0xd604('0x2')]},'fullname':{'type':Sequelize[_0xd604('0x2')]},'email':{'type':Sequelize[_0xd604('0x2')],'validate':{'isEmail':!![]},'set':function(_0x111e97){this[_0xd604('0x4')](_0xd604('0x5'),typeof _0x111e97==='string'&&_0x111e97[_0xd604('0x6')]()?_0x111e97['trim']():null);}},'pager':{'type':Sequelize[_0xd604('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xd604('0x7')},'attach':{'type':Sequelize[_0xd604('0x8')]('yes','no'),'defaultValue':_0xd604('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xd604('0x8')](_0xd604('0x9'),'no'),'defaultValue':_0xd604('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xd604('0x2')]},'callback':{'type':Sequelize[_0xd604('0x2')]},'review':{'type':Sequelize[_0xd604('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd604('0x8')](_0xd604('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd604('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xd604('0x8')](_0xd604('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd604('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xd604('0x8')](_0xd604('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xd604('0x8')](_0xd604('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xd604('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd604('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xd604('0x8')]('yes','no'),'defaultValue':_0xd604('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xd604('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd604('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd604('0xc')](_0xd604('0xd'))+'\x20-\x20'+this[_0xd604('0xc')](_0xd604('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a11617c..d14c4bb 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 _0xdb94=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','index','map','VoiceMail','rawAttributes','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra'];(function(_0x54f7c0,_0x27af83){var _0x245d03=function(_0x1ad6c4){while(--_0x1ad6c4){_0x54f7c0['push'](_0x54f7c0['shift']());}};_0x245d03(++_0x27af83);}(_0xdb94,0xab));var _0x4db9=function(_0x130e44,_0x46f68e){_0x130e44=_0x130e44-0x0;var _0xf00584=_0xdb94[_0x130e44];return _0xf00584;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){var _0x2e97ab=_0x213daa[_0x4db9('0x26')]({'plain':!![]});var _0x2987c6='Voicemails';return db[_0x4db9('0x27')][_0x4db9('0x25')]({'where':{'type':_0x2987c6,'resourceId':_0x2e97ab['id']}})[_0x4db9('0x24')](function(){return _0x213daa;});})[_0x4db9('0x24')](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x385400,_0x2a56b8){return function(_0x3d0f12){if(!_0x3d0f12){_0x385400[_0x4db9('0x17')](0x194);}return _0x3d0f12;};}function handleError(_0x2fae0a,_0x355284){_0x355284=_0x355284||0x1f4;return function(_0x2d646d){logger[_0x4db9('0x29')](_0x2d646d['stack']);if(_0x2d646d['name']){delete _0x2d646d[_0x4db9('0x2a')];}_0x2fae0a[_0x4db9('0x18')](_0x355284)[_0x4db9('0x2b')](_0x2d646d);};}exports[_0x4db9('0x2c')]=function(_0x2af884,_0x459131){var _0x4dc946={},_0x375834={},_0x554eef={'count':0x0,'rows':[]};var _0x3b6a64=_[_0x4db9('0x2d')](db[_0x4db9('0x2e')][_0x4db9('0x2f')],function(_0x27d48c){return{'name':_0x27d48c['fieldName'],'type':_0x27d48c['type'][_0x4db9('0x30')]};});_0x375834['model']=_[_0x4db9('0x2d')](_0x3b6a64,_0x4db9('0x2a'));_0x375834['query']=_[_0x4db9('0x31')](_0x2af884[_0x4db9('0x32')]);_0x375834[_0x4db9('0x33')]=_['intersection'](_0x375834[_0x4db9('0x34')],_0x375834['query']);_0x4dc946[_0x4db9('0x35')]=_[_0x4db9('0x36')](_0x375834[_0x4db9('0x34')],qs['fields'](_0x2af884['query'][_0x4db9('0x37')]));_0x4dc946[_0x4db9('0x35')]=_0x4dc946[_0x4db9('0x35')][_0x4db9('0x38')]?_0x4dc946[_0x4db9('0x35')]:_0x375834[_0x4db9('0x34')];if(!_0x2af884[_0x4db9('0x32')][_0x4db9('0x39')](_0x4db9('0x3a'))){_0x4dc946['limit']=qs[_0x4db9('0x1c')](_0x2af884[_0x4db9('0x32')][_0x4db9('0x1c')]);_0x4dc946[_0x4db9('0x19')]=qs['offset'](_0x2af884[_0x4db9('0x32')][_0x4db9('0x19')]);}_0x4dc946[_0x4db9('0x3b')]=qs['sort'](_0x2af884[_0x4db9('0x32')][_0x4db9('0x3c')]);_0x4dc946[_0x4db9('0x3d')]=qs[_0x4db9('0x33')](_['pick'](_0x2af884['query'],_0x375834[_0x4db9('0x33')]),_0x3b6a64);if(_0x2af884[_0x4db9('0x32')][_0x4db9('0x3e')]){_0x4dc946[_0x4db9('0x3d')]=_[_0x4db9('0x3f')](_0x4dc946['where'],{'$or':_[_0x4db9('0x2d')](_0x3b6a64,function(_0x43b0d9){if(_0x43b0d9[_0x4db9('0x40')]!==_0x4db9('0x41')){var _0x2b2555={};_0x2b2555[_0x43b0d9['name']]={'$like':'%'+_0x2af884[_0x4db9('0x32')][_0x4db9('0x3e')]+'%'};return _0x2b2555;}})});}_0x4dc946=_[_0x4db9('0x3f')]({},_0x4dc946,_0x2af884['options']);var _0x37358f={'where':_0x4dc946[_0x4db9('0x3d')]};return db[_0x4db9('0x2e')][_0x4db9('0x1b')](_0x37358f)[_0x4db9('0x24')](function(_0x24aa2a){_0x554eef[_0x4db9('0x1b')]=_0x24aa2a;if(_0x2af884[_0x4db9('0x32')][_0x4db9('0x42')]){_0x4dc946[_0x4db9('0x43')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x4dc946);})['then'](function(_0x22a021){_0x554eef[_0x4db9('0x44')]=_0x22a021;return _0x554eef;})['then'](respondWithFilteredResult(_0x459131,_0x4dc946))[_0x4db9('0x45')](handleError(_0x459131,null));};exports[_0x4db9('0x46')]=function(_0x563416,_0x57a519){var _0x2eee28={'raw':!![],'where':{'id':_0x563416[_0x4db9('0x47')]['id']}},_0x4f6c51={};_0x4f6c51[_0x4db9('0x34')]=_['keys'](db[_0x4db9('0x2e')][_0x4db9('0x2f')]);_0x4f6c51['query']=_[_0x4db9('0x31')](_0x563416[_0x4db9('0x32')]);_0x4f6c51[_0x4db9('0x33')]=_['intersection'](_0x4f6c51['model'],_0x4f6c51[_0x4db9('0x32')]);_0x2eee28[_0x4db9('0x35')]=_[_0x4db9('0x36')](_0x4f6c51[_0x4db9('0x34')],qs[_0x4db9('0x37')](_0x563416[_0x4db9('0x32')][_0x4db9('0x37')]));_0x2eee28[_0x4db9('0x35')]=_0x2eee28[_0x4db9('0x35')][_0x4db9('0x38')]?_0x2eee28[_0x4db9('0x35')]:_0x4f6c51[_0x4db9('0x34')];if(_0x563416[_0x4db9('0x32')]['includeAll']){_0x2eee28[_0x4db9('0x43')]=[{'all':!![]}];}_0x2eee28=_[_0x4db9('0x3f')]({},_0x2eee28,_0x563416[_0x4db9('0x48')]);return db[_0x4db9('0x2e')][_0x4db9('0x49')](_0x2eee28)[_0x4db9('0x24')](handleEntityNotFound(_0x57a519,null))[_0x4db9('0x24')](respondWithResult(_0x57a519,null))[_0x4db9('0x45')](handleError(_0x57a519,null));};exports[_0x4db9('0x4a')]=function(_0x2d6094,_0x10dccb){return db['VoiceMail']['create'](_0x2d6094[_0x4db9('0x4b')],{})[_0x4db9('0x24')](function(_0x34b366){var _0x3e5131=_0x2d6094[_0x4db9('0x4c')][_0x4db9('0x26')]({'plain':!![]});if(!_0x3e5131)throw new Error(_0x4db9('0x4d'));if(_0x3e5131[_0x4db9('0x4e')]==='user'){var _0xd8eae3=_0x34b366[_0x4db9('0x26')]({'plain':!![]});var _0x121225=_0x4db9('0x4f');return db[_0x4db9('0x50')][_0x4db9('0x49')]({'where':{'name':_0x121225,'userProfileId':_0x3e5131[_0x4db9('0x51')]},'raw':!![]})[_0x4db9('0x24')](function(_0x479808){if(_0x479808&&_0x479808[_0x4db9('0x52')]===0x0){return db[_0x4db9('0x27')][_0x4db9('0x4a')]({'name':_0xd8eae3[_0x4db9('0x2a')],'resourceId':_0xd8eae3['id'],'type':_0x479808[_0x4db9('0x2a')],'sectionId':_0x479808['id']},{})[_0x4db9('0x24')](function(){return _0x34b366;});}else{return _0x34b366;}})['catch'](function(_0x188663){logger['error'](_0x4db9('0x53'),_0x188663);throw _0x188663;});}return _0x34b366;})['then'](respondWithResult(_0x10dccb,0xc9))['catch'](handleError(_0x10dccb,null));};exports[_0x4db9('0x23')]=function(_0x5996f2,_0x4643a1){if(_0x5996f2[_0x4db9('0x4b')]['id']){delete _0x5996f2[_0x4db9('0x4b')]['id'];}return db[_0x4db9('0x2e')]['find']({'where':{'id':_0x5996f2[_0x4db9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4643a1,null))[_0x4db9('0x24')](saveUpdates(_0x5996f2[_0x4db9('0x4b')],null))['then'](respondWithResult(_0x4643a1,null))[_0x4db9('0x45')](handleError(_0x4643a1,null));};exports['destroy']=function(_0x2e0a6f,_0x5731a0){return db[_0x4db9('0x2e')][_0x4db9('0x49')]({'where':{'id':_0x2e0a6f[_0x4db9('0x47')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x5731a0,null))[_0x4db9('0x24')](removeEntity(_0x5731a0,null))[_0x4db9('0x45')](handleError(_0x5731a0,null));};exports[_0x4db9('0x54')]=function(_0x14251f,_0x19649c,_0x178ca5){return db[_0x4db9('0x2e')][_0x4db9('0x55')]({'where':{'id':_0x14251f[_0x4db9('0x47')]['id']}})['then'](handleEntityNotFound(_0x19649c,null))[_0x4db9('0x24')](function(_0x3ad16f){var _0x4c89c7;var _0x1bd7d4={},_0x3de5ef={};_0x3de5ef[_0x4db9('0x34')]=_[_0x4db9('0x31')](db[_0x4db9('0x56')][_0x4db9('0x2f')]);_0x3de5ef[_0x4db9('0x32')]=_[_0x4db9('0x31')](_0x14251f[_0x4db9('0x32')]);_0x3de5ef['filters']=_['intersection'](_0x3de5ef[_0x4db9('0x34')],_0x3de5ef[_0x4db9('0x32')]);_0x1bd7d4[_0x4db9('0x35')]=_[_0x4db9('0x36')](_0x3de5ef[_0x4db9('0x34')],qs[_0x4db9('0x37')](_0x14251f[_0x4db9('0x32')][_0x4db9('0x37')]));_0x1bd7d4[_0x4db9('0x35')]=_0x1bd7d4[_0x4db9('0x35')]['length']?_0x1bd7d4[_0x4db9('0x35')]:_0x3de5ef['model'];if(!_0x14251f['query']['hasOwnProperty']('nolimit')){_0x1bd7d4[_0x4db9('0x1c')]=qs['limit'](_0x14251f['query'][_0x4db9('0x1c')]);_0x1bd7d4[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x14251f[_0x4db9('0x32')][_0x4db9('0x19')]);}_0x1bd7d4[_0x4db9('0x3b')]=qs[_0x4db9('0x3c')](_0x14251f[_0x4db9('0x32')][_0x4db9('0x3c')]);_0x1bd7d4[_0x4db9('0x3d')]=qs[_0x4db9('0x33')](_[_0x4db9('0x57')](_0x14251f[_0x4db9('0x32')],_0x3de5ef[_0x4db9('0x33')]));if(_0x14251f[_0x4db9('0x32')][_0x4db9('0x3e')]){_0x1bd7d4['where']=_['merge'](_0x1bd7d4['where'],{'$or':_[_0x4db9('0x2d')](_0x1bd7d4['attributes'],function(_0x12f062){var _0x747299={};_0x747299[_0x12f062]={'$like':'%'+_0x14251f[_0x4db9('0x32')]['filter']+'%'};return _0x747299;})});}_0x1bd7d4['where']=_[_0x4db9('0x3f')](_0x1bd7d4['where'],{'mailboxuser':_0x3ad16f[_0x4db9('0x58')]});_0x1bd7d4=_[_0x4db9('0x3f')]({},_0x1bd7d4,_0x14251f[_0x4db9('0x48')]);return db[_0x4db9('0x56')][_0x4db9('0x59')](_0x1bd7d4)['then'](respondWithFilteredResult(_0x19649c,_0x1bd7d4));})[_0x4db9('0x45')](handleError(_0x19649c,null));}; \ No newline at end of file +var _0x0713=['userProfileId','autoAssociation','getMessages','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','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','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceMail','rows','catch','show','params','keys','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_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(){var _0x2793ef=_0xb05b1d[_0x3071('0x29')]({'plain':!![]});var _0x7a4cb4=_0x3071('0x2a');return db[_0x3071('0x2b')]['destroy']({'where':{'type':_0x7a4cb4,'resourceId':_0x2793ef['id']}})[_0x3071('0x27')](function(){return _0xb05b1d;});})[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb1ca,_0x28792d){return function(_0x163604){if(!_0x163604){_0x4fb1ca[_0x3071('0x2c')](0x194);}return _0x163604;};}function handleError(_0x3fa3b8,_0x25b96b){_0x25b96b=_0x25b96b||0x1f4;return function(_0x177b5f){logger[_0x3071('0x2d')](_0x177b5f[_0x3071('0x2e')]);if(_0x177b5f[_0x3071('0x2f')]){delete _0x177b5f[_0x3071('0x2f')];}_0x3fa3b8['status'](_0x25b96b)['send'](_0x177b5f);};}exports[_0x3071('0x30')]=function(_0x149e0d,_0x6ddf96){var _0x40be95={},_0x3f6d90={},_0x29538c={'count':0x0,'rows':[]};var _0x32b6b1=_[_0x3071('0x31')](db['VoiceMail']['rawAttributes'],function(_0x4ab983){return{'name':_0x4ab983[_0x3071('0x32')],'type':_0x4ab983[_0x3071('0x33')]['key']};});_0x3f6d90[_0x3071('0x34')]=_[_0x3071('0x31')](_0x32b6b1,_0x3071('0x2f'));_0x3f6d90[_0x3071('0x35')]=_['keys'](_0x149e0d[_0x3071('0x35')]);_0x3f6d90[_0x3071('0x36')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],_0x3f6d90[_0x3071('0x35')]);_0x40be95[_0x3071('0x38')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],qs['fields'](_0x149e0d[_0x3071('0x35')]['fields']));_0x40be95['attributes']=_0x40be95[_0x3071('0x38')][_0x3071('0x39')]?_0x40be95['attributes']:_0x3f6d90[_0x3071('0x34')];if(!_0x149e0d[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x40be95[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x149e0d['query'][_0x3071('0x20')]);_0x40be95[_0x3071('0x1e')]=qs['offset'](_0x149e0d[_0x3071('0x35')]['offset']);}_0x40be95[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x149e0d['query']['sort']);_0x40be95[_0x3071('0x3e')]=qs[_0x3071('0x36')](_[_0x3071('0x3f')](_0x149e0d['query'],_0x3f6d90[_0x3071('0x36')]),_0x32b6b1);if(_0x149e0d['query'][_0x3071('0x40')]){_0x40be95['where']=_[_0x3071('0x41')](_0x40be95[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x32b6b1,function(_0x3113ef){if(_0x3113ef[_0x3071('0x33')]!=='VIRTUAL'){var _0x53ed25={};_0x53ed25[_0x3113ef[_0x3071('0x2f')]]={'$like':'%'+_0x149e0d[_0x3071('0x35')][_0x3071('0x40')]+'%'};return _0x53ed25;}})});}_0x40be95=_[_0x3071('0x41')]({},_0x40be95,_0x149e0d['options']);var _0x3cfc05={'where':_0x40be95[_0x3071('0x3e')]};return db[_0x3071('0x42')][_0x3071('0x21')](_0x3cfc05)[_0x3071('0x27')](function(_0xb9a4b8){_0x29538c['count']=_0xb9a4b8;if(_0x149e0d[_0x3071('0x35')]['includeAll']){_0x40be95['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x40be95);})[_0x3071('0x27')](function(_0x1be8b6){_0x29538c[_0x3071('0x43')]=_0x1be8b6;return _0x29538c;})[_0x3071('0x27')](respondWithFilteredResult(_0x6ddf96,_0x40be95))[_0x3071('0x44')](handleError(_0x6ddf96,null));};exports[_0x3071('0x45')]=function(_0xa711b5,_0x2e6c70){var _0x56589e={'raw':!![],'where':{'id':_0xa711b5[_0x3071('0x46')]['id']}},_0x1e8222={};_0x1e8222[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x42')]['rawAttributes']);_0x1e8222['query']=_[_0x3071('0x47')](_0xa711b5[_0x3071('0x35')]);_0x1e8222[_0x3071('0x36')]=_[_0x3071('0x37')](_0x1e8222[_0x3071('0x34')],_0x1e8222['query']);_0x56589e[_0x3071('0x38')]=_['intersection'](_0x1e8222[_0x3071('0x34')],qs['fields'](_0xa711b5['query'][_0x3071('0x48')]));_0x56589e['attributes']=_0x56589e[_0x3071('0x38')]['length']?_0x56589e[_0x3071('0x38')]:_0x1e8222[_0x3071('0x34')];if(_0xa711b5[_0x3071('0x35')][_0x3071('0x49')]){_0x56589e['include']=[{'all':!![]}];}_0x56589e=_[_0x3071('0x41')]({},_0x56589e,_0xa711b5['options']);return db[_0x3071('0x42')]['find'](_0x56589e)[_0x3071('0x27')](handleEntityNotFound(_0x2e6c70,null))[_0x3071('0x27')](respondWithResult(_0x2e6c70,null))['catch'](handleError(_0x2e6c70,null));};exports[_0x3071('0x4a')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x42')][_0x3071('0x4a')](_0x117e73[_0x3071('0x4b')],{})[_0x3071('0x27')](function(_0x577060){var _0x2c6e4c=_0x117e73[_0x3071('0x4c')][_0x3071('0x29')]({'plain':!![]});if(!_0x2c6e4c)throw new Error(_0x3071('0x4d'));if(_0x2c6e4c['role']===_0x3071('0x4c')){var _0x2aea37=_0x577060[_0x3071('0x29')]({'plain':!![]});var _0x2307dd=_0x3071('0x2a');return db[_0x3071('0x4e')][_0x3071('0x4f')]({'where':{'name':_0x2307dd,'userProfileId':_0x2c6e4c[_0x3071('0x50')]},'raw':!![]})[_0x3071('0x27')](function(_0x886f7){if(_0x886f7&&_0x886f7[_0x3071('0x51')]===0x0){return db[_0x3071('0x2b')][_0x3071('0x4a')]({'name':_0x2aea37[_0x3071('0x2f')],'resourceId':_0x2aea37['id'],'type':_0x886f7[_0x3071('0x2f')],'sectionId':_0x886f7['id']},{})[_0x3071('0x27')](function(){return _0x577060;});}else{return _0x577060;}})['catch'](function(_0x47a438){logger[_0x3071('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47a438);throw _0x47a438;});}return _0x577060;})[_0x3071('0x27')](respondWithResult(_0x224a70,0xc9))[_0x3071('0x44')](handleError(_0x224a70,null));};exports[_0x3071('0x26')]=function(_0x514821,_0x1ec428){if(_0x514821[_0x3071('0x4b')]['id']){delete _0x514821['body']['id'];}return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x514821[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1ec428,null))[_0x3071('0x27')](saveUpdates(_0x514821['body'],null))[_0x3071('0x27')](respondWithResult(_0x1ec428,null))[_0x3071('0x44')](handleError(_0x1ec428,null));};exports[_0x3071('0x28')]=function(_0x41f02a,_0x123323){return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x41f02a[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x123323,null))[_0x3071('0x27')](removeEntity(_0x123323,null))[_0x3071('0x44')](handleError(_0x123323,null));};exports[_0x3071('0x52')]=function(_0x71d921,_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x42')]['findOne']({'where':{'id':_0x71d921[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x4bea5d,null))['then'](function(_0x19dc95){var _0x1bf911;var _0x4d3886={},_0x108b14={};_0x108b14[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x53')][_0x3071('0x54')]);_0x108b14['query']=_[_0x3071('0x47')](_0x71d921[_0x3071('0x35')]);_0x108b14[_0x3071('0x36')]=_['intersection'](_0x108b14[_0x3071('0x34')],_0x108b14[_0x3071('0x35')]);_0x4d3886[_0x3071('0x38')]=_[_0x3071('0x37')](_0x108b14[_0x3071('0x34')],qs[_0x3071('0x48')](_0x71d921[_0x3071('0x35')][_0x3071('0x48')]));_0x4d3886[_0x3071('0x38')]=_0x4d3886['attributes'][_0x3071('0x39')]?_0x4d3886[_0x3071('0x38')]:_0x108b14[_0x3071('0x34')];if(!_0x71d921[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x4d3886[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x71d921[_0x3071('0x35')][_0x3071('0x20')]);_0x4d3886[_0x3071('0x1e')]=qs['offset'](_0x71d921[_0x3071('0x35')][_0x3071('0x1e')]);}_0x4d3886[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x71d921[_0x3071('0x35')][_0x3071('0x3d')]);_0x4d3886[_0x3071('0x3e')]=qs[_0x3071('0x36')](_['pick'](_0x71d921[_0x3071('0x35')],_0x108b14[_0x3071('0x36')]));if(_0x71d921['query']['filter']){_0x4d3886[_0x3071('0x3e')]=_[_0x3071('0x41')](_0x4d3886[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x4d3886['attributes'],function(_0x52955a){var _0x33c39a={};_0x33c39a[_0x52955a]={'$like':'%'+_0x71d921['query']['filter']+'%'};return _0x33c39a;})});}_0x4d3886['where']=_['merge'](_0x4d3886[_0x3071('0x3e')],{'mailboxuser':_0x19dc95[_0x3071('0x55')]});_0x4d3886=_[_0x3071('0x41')]({},_0x4d3886,_0x71d921['options']);return db[_0x3071('0x53')][_0x3071('0x56')](_0x4d3886)[_0x3071('0x27')](respondWithFilteredResult(_0x4bea5d,_0x4d3886));})[_0x3071('0x44')](handleError(_0x4bea5d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index e161840..1ccfa4c 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 _0x757a=['define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','api','request-promise','path','./voiceMail.attributes','exports'];(function(_0x3ee802,_0x2a0c6f){var _0x955132=function(_0x520d63){while(--_0x520d63){_0x3ee802['push'](_0x3ee802['shift']());}};_0x955132(++_0x2a0c6f);}(_0x757a,0x1e7));var _0xa757=function(_0x2bac22,_0x59342a){_0x2bac22=_0x2bac22-0x0;var _0x526c1d=_0x757a[_0x2bac22];return _0x526c1d;};'use strict';var _=require(_0xa757('0x0'));var util=require('util');var logger=require(_0xa757('0x1'))(_0xa757('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x3'));var fs=require('fs');var path=require(_0xa757('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa757('0x5'));module[_0xa757('0x6')]=function(_0x46a75e,_0x3a1973){return _0x46a75e[_0xa757('0x7')](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xb'),_0xa757('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee7d=['./voiceMail.attributes','exports','VoiceMail','voice_voicemail','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xee7d,0x136));var _0xdee7=function(_0x43b457,_0x4e4f0f){_0x43b457=_0x43b457-0x0;var _0x453bcd=_0xee7d[_0x43b457];return _0x453bcd;};'use strict';var _=require(_0xdee7('0x0'));var util=require('util');var logger=require(_0xdee7('0x1'))(_0xdee7('0x2'));var moment=require('moment');var BPromise=require(_0xdee7('0x3'));var rp=require(_0xdee7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdee7('0x5'));module[_0xdee7('0x6')]=function(_0x2c0cef,_0xe1e116){return _0x2c0cef['define'](_0xdee7('0x7'),attributes,{'tableName':_0xdee7('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 6f8e2e3..0f2fa85 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 _0x47d7=['info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x2211d4,_0x592254){var _0x565b56=function(_0x576ba){while(--_0x576ba){_0x2211d4['push'](_0x2211d4['shift']());}};_0x565b56(++_0x592254);}(_0x47d7,0x136));var _0x747d=function(_0x2f59f0,_0x226e47){_0x2f59f0=_0x2f59f0-0x0;var _0x5eaf9c=_0x47d7[_0x2f59f0];return _0x5eaf9c;};'use strict';var _=require('lodash');var util=require(_0x747d('0x0'));var moment=require(_0x747d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x747d('0x2'))['db'];var utils=require(_0x747d('0x3'));var logger=require(_0x747d('0x4'))(_0x747d('0x5'));var config=require('../../config/environment');var jayson=require(_0x747d('0x6'));var client=jayson['client'][_0x747d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x294ed0,_0x1cbbb7,_0xc513fd){return new BPromise(function(_0x50cd9b,_0x3bb2d9){return client[_0x747d('0x8')](_0x294ed0,_0xc513fd)[_0x747d('0x9')](function(_0x4aded5){logger[_0x747d('0xa')](_0x747d('0xb'),_0x1cbbb7,_0x747d('0xc'));logger['debug'](_0x747d('0xd'),_0x1cbbb7,_0x747d('0xc'),JSON[_0x747d('0xe')](_0x4aded5));if(_0x4aded5[_0x747d('0xf')]){if(_0x4aded5[_0x747d('0xf')][_0x747d('0x10')]===0x1f4){logger[_0x747d('0xf')](_0x747d('0xb'),_0x1cbbb7,_0x4aded5['error'][_0x747d('0x11')]);return _0x3bb2d9(_0x4aded5[_0x747d('0xf')]['message']);}logger[_0x747d('0xf')](_0x747d('0xb'),_0x1cbbb7,_0x4aded5[_0x747d('0xf')][_0x747d('0x11')]);return _0x50cd9b(_0x4aded5[_0x747d('0xf')][_0x747d('0x11')]);}else{logger[_0x747d('0xa')](_0x747d('0xb'),_0x1cbbb7,'request\x20sent');_0x50cd9b(_0x4aded5[_0x747d('0x12')][_0x747d('0x11')]);}})[_0x747d('0x13')](function(_0x65c3ee){logger['error'](_0x747d('0xb'),_0x1cbbb7,_0x65c3ee);_0x3bb2d9(_0x65c3ee);});});} \ No newline at end of file +var _0xc172=['request','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xc172,0x146));var _0x2c17=function(_0x5299a0,_0xc0013d){_0x5299a0=_0x5299a0-0x0;var _0x34f11f=_0xc172[_0x5299a0];return _0x34f11f;};'use strict';var _=require(_0x2c17('0x0'));var util=require(_0x2c17('0x1'));var moment=require('moment');var BPromise=require(_0x2c17('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c17('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c17('0x4'));var logger=require(_0x2c17('0x5'))(_0x2c17('0x6'));var config=require(_0x2c17('0x7'));var jayson=require(_0x2c17('0x8'));var client=jayson[_0x2c17('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4f61,_0x6cef29,_0x35efaf){return new BPromise(function(_0x46a44a,_0x593dfd){return client[_0x2c17('0xa')](_0x1b4f61,_0x35efaf)['then'](function(_0x4733a4){logger[_0x2c17('0xb')](_0x2c17('0xc'),_0x6cef29,'request\x20sent');logger['debug'](_0x2c17('0xd'),_0x6cef29,_0x2c17('0xe'),JSON[_0x2c17('0xf')](_0x4733a4));if(_0x4733a4[_0x2c17('0x10')]){if(_0x4733a4[_0x2c17('0x10')][_0x2c17('0x11')]===0x1f4){logger[_0x2c17('0x10')](_0x2c17('0xc'),_0x6cef29,_0x4733a4[_0x2c17('0x10')]['message']);return _0x593dfd(_0x4733a4[_0x2c17('0x10')][_0x2c17('0x12')]);}logger[_0x2c17('0x10')]('VoiceMail,\x20%s,\x20%s',_0x6cef29,_0x4733a4[_0x2c17('0x10')]['message']);return _0x46a44a(_0x4733a4['error'][_0x2c17('0x12')]);}else{logger[_0x2c17('0xb')](_0x2c17('0xc'),_0x6cef29,_0x2c17('0xe'));_0x46a44a(_0x4733a4[_0x2c17('0x13')][_0x2c17('0x12')]);}})[_0x2c17('0x14')](function(_0x108a41){logger['error'](_0x2c17('0xc'),_0x6cef29,_0x108a41);_0x593dfd(_0x108a41);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 046c87e..4d81130 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 _0x13e8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x4d407a,_0x31adc1){var _0x590cc3=function(_0x14208a){while(--_0x14208a){_0x4d407a['push'](_0x4d407a['shift']());}};_0x590cc3(++_0x31adc1);}(_0x13e8,0xb0));var _0x813e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x13e8[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x813e('0x0'));var util=require(_0x813e('0x1'));var path=require(_0x813e('0x2'));var timeout=require(_0x813e('0x3'));var express=require(_0x813e('0x4'));var router=express[_0x813e('0x5')]();var fs_extra=require(_0x813e('0x6'));var auth=require(_0x813e('0x7'));var interaction=require(_0x813e('0x8'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x813e('0x9')]('/',auth[_0x813e('0xa')](),controller['index']);router[_0x813e('0x9')](_0x813e('0xb'),auth[_0x813e('0xa')](),controller['show']);router[_0x813e('0x9')](_0x813e('0xc'),auth[_0x813e('0xa')](),controller[_0x813e('0xd')]);router[_0x813e('0xe')]('/',auth['isAuthenticated'](),controller[_0x813e('0xf')]);router[_0x813e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x813e('0x11')]);router[_0x813e('0x12')](_0x813e('0xb'),auth[_0x813e('0xa')](),controller[_0x813e('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd3a0=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','download','post','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3a0,0x1b5));var _0x0d3a=function(_0x5bc21c,_0xf4f0aa){_0x5bc21c=_0x5bc21c-0x0;var _0x208a6b=_0xd3a0[_0x5bc21c];return _0x208a6b;};'use strict';var multer=require(_0x0d3a('0x0'));var util=require('util');var path=require(_0x0d3a('0x1'));var timeout=require(_0x0d3a('0x2'));var express=require(_0x0d3a('0x3'));var router=express[_0x0d3a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0d3a('0x5'));var interaction=require(_0x0d3a('0x6'));var config=require('../../config/environment');var controller=require(_0x0d3a('0x7'));router[_0x0d3a('0x8')]('/',auth[_0x0d3a('0x9')](),controller['index']);router['get'](_0x0d3a('0xa'),auth[_0x0d3a('0x9')](),controller[_0x0d3a('0xb')]);router[_0x0d3a('0x8')]('/:id/download',auth[_0x0d3a('0x9')](),controller[_0x0d3a('0xc')]);router[_0x0d3a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0d3a('0xe')](_0x0d3a('0xa'),auth['isAuthenticated'](),controller[_0x0d3a('0xf')]);router[_0x0d3a('0x10')](_0x0d3a('0xa'),auth[_0x0d3a('0x9')](),controller[_0x0d3a('0x11')]);module[_0x0d3a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 45ffa95..d5a04c5 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 _0xe101=['INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x37d753,_0x21a1db){var _0x1c5b7b=function(_0x6fd7ea){while(--_0x6fd7ea){_0x37d753['push'](_0x37d753['shift']());}};_0x1c5b7b(++_0x21a1db);}(_0xe101,0x13c));var _0x1e10=function(_0x47a94f,_0x53f33c){_0x47a94f=_0x47a94f-0x0;var _0x8324ce=_0xe101[_0x47a94f];return _0x8324ce;};'use strict';var Sequelize=require(_0x1e10('0x0'));module[_0x1e10('0x1')]={'name':{'type':Sequelize[_0x1e10('0x2')],'get':function(_0x8c309f){return this[_0x1e10('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x1e10('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x1e10('0x6')](_0x1e10('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x1e10('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x1e10('0x8'),'defaultValue':Sequelize[_0x1e10('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x357d=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','exports','VIRTUAL'];(function(_0x2653ac,_0x338212){var _0x14a4ba=function(_0xccd7ed){while(--_0xccd7ed){_0x2653ac['push'](_0x2653ac['shift']());}};_0x14a4ba(++_0x338212);}(_0x357d,0x15e));var _0xd357=function(_0x268cf8,_0x16c8cf){_0x268cf8=_0x268cf8-0x0;var _0x4ec9ae=_0x357d[_0x268cf8];return _0x4ec9ae;};'use strict';var Sequelize=require('sequelize');module[_0xd357('0x0')]={'name':{'type':Sequelize[_0xd357('0x1')],'get':function(_0x1530f4){return this[_0xd357('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd357('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xd357('0x5')](_0xd357('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd357('0x4')],'defaultValue':''},'stamp':{'type':_0xd357('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 93a4d65..912be15 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 _0xd6f8=['create','body','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','status','send','index','map','rawAttributes','key','model','differenceBy','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','VoiceMailMessage','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x1db82f,_0x2e574f){var _0x1ede57=function(_0x41b28e){while(--_0x41b28e){_0x1db82f['push'](_0x1db82f['shift']());}};_0x1ede57(++_0x2e574f);}(_0xd6f8,0x1f1));var _0x8d6f=function(_0x57e7f8,_0x328bcd){_0x57e7f8=_0x57e7f8-0x0;var _0x39f93b=_0xd6f8[_0x57e7f8];return _0x39f93b;};'use strict';var emlformat=require(_0x8d6f('0x0'));var rimraf=require(_0x8d6f('0x1'));var zipdir=require(_0x8d6f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d6f('0x3'));var moment=require(_0x8d6f('0x4'));var BPromise=require(_0x8d6f('0x5'));var Mustache=require(_0x8d6f('0x6'));var util=require('util');var path=require(_0x8d6f('0x7'));var sox=require(_0x8d6f('0x8'));var csv=require(_0x8d6f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d6f('0xa'));var _=require('lodash');var squel=require(_0x8d6f('0xb'));var crypto=require(_0x8d6f('0xc'));var jsforce=require(_0x8d6f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8d6f('0x9'));var querystring=require(_0x8d6f('0xe'));var Papa=require(_0x8d6f('0xf'));var Redis=require(_0x8d6f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8d6f('0x11'));var as=require(_0x8d6f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8d6f('0x13'));var config=require(_0x8d6f('0x14'));var licenseUtil=require(_0x8d6f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7ebe18,_0x542904){_0x542904=_0x542904||0xcc;return function(_0x55256e){if(_0x55256e){return _0x7ebe18[_0x8d6f('0x16')](_0x542904);}return _0x7ebe18['status'](_0x542904)[_0x8d6f('0x17')]();};}function respondWithResult(_0x277087,_0x3330ce){_0x3330ce=_0x3330ce||0xc8;return function(_0x2501f5){if(_0x2501f5){return _0x277087['status'](_0x3330ce)[_0x8d6f('0x18')](_0x2501f5);}};}function respondWithFilteredResult(_0x37ecba,_0x26371e){return function(_0x2714ae){if(_0x2714ae){var _0xf0b535=typeof _0x26371e[_0x8d6f('0x19')]==='undefined'&&typeof _0x26371e[_0x8d6f('0x1a')]===_0x8d6f('0x1b');var _0x2b8c25=_0x2714ae['count'];var _0x2eddbe=_0xf0b535?0x0:_0x26371e[_0x8d6f('0x19')];var _0x40a200=_0xf0b535?_0x2714ae[_0x8d6f('0x1c')]:_0x26371e['offset']+_0x26371e['limit'];var _0x45a27e;if(_0x40a200>=_0x2b8c25){_0x40a200=_0x2b8c25;_0x45a27e=0xc8;}else{_0x45a27e=0xce;}_0x37ecba['status'](_0x45a27e);return _0x37ecba[_0x8d6f('0x1d')](_0x8d6f('0x1e'),_0x2eddbe+'-'+_0x40a200+'/'+_0x2b8c25)[_0x8d6f('0x18')](_0x2714ae);}return null;};}function patchUpdates(_0x431361){return function(_0x221ee3){try{jsonpatch[_0x8d6f('0x1f')](_0x221ee3,_0x431361,!![]);}catch(_0x40f9d0){return BPromise['reject'](_0x40f9d0);}return _0x221ee3[_0x8d6f('0x20')]();};}function saveUpdates(_0x2223c9,_0x3e0b16){return function(_0x366123){if(_0x366123){return _0x366123['update'](_0x2223c9)[_0x8d6f('0x21')](function(_0x3f5ed7){return _0x3f5ed7;});}return null;};}function removeEntity(_0x12b0f9,_0x11a829){return function(_0x19bc5c){if(_0x19bc5c){return _0x19bc5c[_0x8d6f('0x22')]()[_0x8d6f('0x21')](function(){_0x12b0f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e49b,_0x1b3276){return function(_0x22ece0){if(!_0x22ece0){_0x29e49b['sendStatus'](0x194);}return _0x22ece0;};}function handleError(_0x19e386,_0x5f4f63){_0x5f4f63=_0x5f4f63||0x1f4;return function(_0x3d9ce6){logger[_0x8d6f('0x23')](_0x3d9ce6[_0x8d6f('0x24')]);if(_0x3d9ce6[_0x8d6f('0x25')]){delete _0x3d9ce6[_0x8d6f('0x25')];}_0x19e386[_0x8d6f('0x26')](_0x5f4f63)[_0x8d6f('0x27')](_0x3d9ce6);};}exports[_0x8d6f('0x28')]=function(_0x410f11,_0x4ca26e){var _0x256da3={},_0x457953={},_0x61795={'count':0x0,'rows':[]};var _0x3a0980=_[_0x8d6f('0x29')](db['VoiceMailMessage'][_0x8d6f('0x2a')],function(_0x395bb7){return{'name':_0x395bb7['fieldName'],'type':_0x395bb7['type'][_0x8d6f('0x2b')]};});_0x457953[_0x8d6f('0x2c')]=_[_0x8d6f('0x2d')](_[_0x8d6f('0x29')](_0x3a0980,_0x8d6f('0x25')),[_0x8d6f('0x25')]);_0x457953['query']=_[_0x8d6f('0x2e')](_0x410f11[_0x8d6f('0x2f')]);_0x457953[_0x8d6f('0x30')]=_['intersection'](_0x457953['model'],_0x457953[_0x8d6f('0x2f')]);_0x256da3[_0x8d6f('0x31')]=_[_0x8d6f('0x32')](_0x457953[_0x8d6f('0x2c')],qs[_0x8d6f('0x33')](_0x410f11[_0x8d6f('0x2f')][_0x8d6f('0x33')]));_0x256da3[_0x8d6f('0x31')]=_0x256da3['attributes'][_0x8d6f('0x34')]?_0x256da3[_0x8d6f('0x31')]:_0x457953[_0x8d6f('0x2c')];if(!_0x410f11[_0x8d6f('0x2f')][_0x8d6f('0x35')]('nolimit')){_0x256da3[_0x8d6f('0x1a')]=qs['limit'](_0x410f11[_0x8d6f('0x2f')][_0x8d6f('0x1a')]);_0x256da3[_0x8d6f('0x19')]=qs['offset'](_0x410f11['query']['offset']);}_0x256da3[_0x8d6f('0x36')]=qs[_0x8d6f('0x37')](_0x410f11[_0x8d6f('0x2f')][_0x8d6f('0x37')]);_0x256da3[_0x8d6f('0x38')]=qs[_0x8d6f('0x30')](_[_0x8d6f('0x39')](_0x410f11['query'],_0x457953[_0x8d6f('0x30')]),_0x3a0980);if(_0x410f11['query'][_0x8d6f('0x3a')]){_0x256da3['where']=_[_0x8d6f('0x3b')](_0x256da3['where'],{'$or':_['map'](_0x3a0980,function(_0x154dac){if(_0x154dac['type']!=='VIRTUAL'){var _0x5d025a={};_0x5d025a[_0x154dac['name']]={'$like':'%'+_0x410f11[_0x8d6f('0x2f')][_0x8d6f('0x3a')]+'%'};return _0x5d025a;}})});}_0x256da3=_[_0x8d6f('0x3b')]({},_0x256da3,_0x410f11[_0x8d6f('0x3c')]);var _0x579951={'where':_0x256da3[_0x8d6f('0x38')]};return db[_0x8d6f('0x3d')]['count'](_0x579951)[_0x8d6f('0x21')](function(_0x226323){_0x61795[_0x8d6f('0x1c')]=_0x226323;if(_0x410f11['query']['includeAll']){_0x256da3[_0x8d6f('0x3e')]=[{'all':!![]}];}return db[_0x8d6f('0x3d')][_0x8d6f('0x3f')](_0x256da3);})[_0x8d6f('0x21')](function(_0x19496e){_0x61795[_0x8d6f('0x40')]=_0x19496e;return _0x61795;})[_0x8d6f('0x21')](respondWithFilteredResult(_0x4ca26e,_0x256da3))[_0x8d6f('0x41')](handleError(_0x4ca26e,null));};exports[_0x8d6f('0x42')]=function(_0x6c48e7,_0x569867){var _0xc4fb8c={'raw':!![],'where':{'id':_0x6c48e7[_0x8d6f('0x43')]['id']}},_0x347842={};_0x347842[_0x8d6f('0x2c')]=_[_0x8d6f('0x2e')](db[_0x8d6f('0x3d')][_0x8d6f('0x2a')]);_0x347842[_0x8d6f('0x2f')]=_['keys'](_0x6c48e7['query']);_0x347842[_0x8d6f('0x30')]=_[_0x8d6f('0x32')](_0x347842[_0x8d6f('0x2c')],_0x347842[_0x8d6f('0x2f')]);_0xc4fb8c[_0x8d6f('0x31')]=_[_0x8d6f('0x32')](_0x347842[_0x8d6f('0x2c')],qs[_0x8d6f('0x33')](_0x6c48e7[_0x8d6f('0x2f')][_0x8d6f('0x33')]));_0xc4fb8c[_0x8d6f('0x31')]=_0xc4fb8c[_0x8d6f('0x31')][_0x8d6f('0x34')]?_0xc4fb8c[_0x8d6f('0x31')]:_0x347842[_0x8d6f('0x2c')];if(_0x6c48e7[_0x8d6f('0x2f')][_0x8d6f('0x44')]){_0xc4fb8c[_0x8d6f('0x3e')]=[{'all':!![]}];}_0xc4fb8c=_[_0x8d6f('0x3b')]({},_0xc4fb8c,_0x6c48e7[_0x8d6f('0x3c')]);return db[_0x8d6f('0x3d')][_0x8d6f('0x45')](_0xc4fb8c)[_0x8d6f('0x21')](handleEntityNotFound(_0x569867,null))[_0x8d6f('0x21')](respondWithResult(_0x569867,null))[_0x8d6f('0x41')](handleError(_0x569867,null));};exports[_0x8d6f('0x46')]=function(_0x47245b,_0x331650){return db[_0x8d6f('0x3d')][_0x8d6f('0x46')](_0x47245b[_0x8d6f('0x47')],{})[_0x8d6f('0x21')](respondWithResult(_0x331650,0xc9))[_0x8d6f('0x41')](handleError(_0x331650,null));};exports['update']=function(_0x3c5b6e,_0x17baed){if(_0x3c5b6e['body']['id']){delete _0x3c5b6e[_0x8d6f('0x47')]['id'];}return db[_0x8d6f('0x3d')]['find']({'where':{'id':_0x3c5b6e['params']['id']}})[_0x8d6f('0x21')](handleEntityNotFound(_0x17baed,null))[_0x8d6f('0x21')](saveUpdates(_0x3c5b6e['body'],null))['then'](respondWithResult(_0x17baed,null))[_0x8d6f('0x41')](handleError(_0x17baed,null));};exports[_0x8d6f('0x22')]=function(_0x3ec107,_0x5924da){return db[_0x8d6f('0x3d')]['find']({'where':{'id':_0x3ec107[_0x8d6f('0x43')]['id']}})[_0x8d6f('0x21')](handleEntityNotFound(_0x5924da,null))['then'](removeEntity(_0x5924da,null))['catch'](handleError(_0x5924da,null));};exports['download']=function(_0x359d5a,_0x3f98a4,_0x39ba14){return db[_0x8d6f('0x3d')][_0x8d6f('0x45')]({'where':{'id':_0x359d5a[_0x8d6f('0x43')]['id']},'attributes':['id',_0x8d6f('0x48'),_0x8d6f('0x49')]})[_0x8d6f('0x21')](handleEntityNotFound(_0x3f98a4,null))['then'](function(_0x119991){if(_0x119991){if(!_0x119991[_0x8d6f('0x48')]){throw new db[(_0x8d6f('0x4a'))][(_0x8d6f('0x4b'))](_0x8d6f('0x4c'));}var _0x1ca92f={'Content-Type':_0x8d6f('0x4d'),'Content-Disposition':_0x8d6f('0x4e')};if(_0x119991['msg_id']){_0x1ca92f[_0x8d6f('0x4f')]='attachment;\x20filename=\x22'+_0x119991[_0x8d6f('0x49')]+_0x8d6f('0x50');}_0x3f98a4['set'](_0x1ca92f);return _0x3f98a4['send'](new Buffer(_0x119991['recording']));}})[_0x8d6f('0x41')](handleError(_0x3f98a4,null));}; \ No newline at end of file +var _0x48be=['Content-Disposition','attachment;\x20filename=\x22','eml-format','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','keys','find','catch','create','body','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x48be,0x1ba));var _0xe48b=function(_0xf97240,_0x5e0b56){_0xf97240=_0xf97240-0x0;var _0x22c779=_0x48be[_0xf97240];return _0x22c779;};'use strict';var emlformat=require(_0xe48b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe48b('0x1'));var jsonpatch=require(_0xe48b('0x2'));var rp=require(_0xe48b('0x3'));var moment=require(_0xe48b('0x4'));var BPromise=require(_0xe48b('0x5'));var Mustache=require(_0xe48b('0x6'));var util=require(_0xe48b('0x7'));var path=require(_0xe48b('0x8'));var sox=require(_0xe48b('0x9'));var csv=require(_0xe48b('0xa'));var ejs=require(_0xe48b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe48b('0xc'));var squel=require(_0xe48b('0xd'));var crypto=require(_0xe48b('0xe'));var jsforce=require(_0xe48b('0xf'));var deskjs=require(_0xe48b('0x10'));var toCsv=require(_0xe48b('0xa'));var querystring=require(_0xe48b('0x11'));var Papa=require(_0xe48b('0x12'));var Redis=require(_0xe48b('0x13'));var authService=require(_0xe48b('0x14'));var qs=require(_0xe48b('0x15'));var as=require(_0xe48b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe48b('0x17'))(_0xe48b('0x18'));var utils=require('../../config/utils');var config=require(_0xe48b('0x19'));var licenseUtil=require(_0xe48b('0x1a'));var db=require(_0xe48b('0x1b'))['db'];function respondWithStatusCode(_0x143546,_0x53bd24){_0x53bd24=_0x53bd24||0xcc;return function(_0x1cf2b9){if(_0x1cf2b9){return _0x143546[_0xe48b('0x1c')](_0x53bd24);}return _0x143546['status'](_0x53bd24)[_0xe48b('0x1d')]();};}function respondWithResult(_0x71057c,_0x6aafc4){_0x6aafc4=_0x6aafc4||0xc8;return function(_0x415f4b){if(_0x415f4b){return _0x71057c['status'](_0x6aafc4)[_0xe48b('0x1e')](_0x415f4b);}};}function respondWithFilteredResult(_0x2e6889,_0x32e92a){return function(_0x552ba1){if(_0x552ba1){var _0x584743=typeof _0x32e92a[_0xe48b('0x1f')]===_0xe48b('0x20')&&typeof _0x32e92a[_0xe48b('0x21')]===_0xe48b('0x20');var _0x5e4114=_0x552ba1[_0xe48b('0x22')];var _0x2f0e14=_0x584743?0x0:_0x32e92a[_0xe48b('0x1f')];var _0x53eb09=_0x584743?_0x552ba1[_0xe48b('0x22')]:_0x32e92a[_0xe48b('0x1f')]+_0x32e92a[_0xe48b('0x21')];var _0x20ff61;if(_0x53eb09>=_0x5e4114){_0x53eb09=_0x5e4114;_0x20ff61=0xc8;}else{_0x20ff61=0xce;}_0x2e6889[_0xe48b('0x23')](_0x20ff61);return _0x2e6889[_0xe48b('0x24')](_0xe48b('0x25'),_0x2f0e14+'-'+_0x53eb09+'/'+_0x5e4114)['json'](_0x552ba1);}return null;};}function patchUpdates(_0x48fb0d){return function(_0x10401e){try{jsonpatch[_0xe48b('0x26')](_0x10401e,_0x48fb0d,!![]);}catch(_0x211cfb){return BPromise[_0xe48b('0x27')](_0x211cfb);}return _0x10401e['save']();};}function saveUpdates(_0x562fb2,_0x42204c){return function(_0x7008a4){if(_0x7008a4){return _0x7008a4[_0xe48b('0x28')](_0x562fb2)[_0xe48b('0x29')](function(_0xf0b5c6){return _0xf0b5c6;});}return null;};}function removeEntity(_0x186fc7,_0x9dc750){return function(_0x2ec8a3){if(_0x2ec8a3){return _0x2ec8a3[_0xe48b('0x2a')]()[_0xe48b('0x29')](function(){_0x186fc7['status'](0xcc)[_0xe48b('0x1d')]();});}};}function handleEntityNotFound(_0x2c0b06,_0x3b402f){return function(_0xef9e72){if(!_0xef9e72){_0x2c0b06[_0xe48b('0x1c')](0x194);}return _0xef9e72;};}function handleError(_0x506d06,_0x1fed5e){_0x1fed5e=_0x1fed5e||0x1f4;return function(_0x1d7562){logger[_0xe48b('0x2b')](_0x1d7562[_0xe48b('0x2c')]);if(_0x1d7562[_0xe48b('0x2d')]){delete _0x1d7562[_0xe48b('0x2d')];}_0x506d06[_0xe48b('0x23')](_0x1fed5e)[_0xe48b('0x2e')](_0x1d7562);};}exports[_0xe48b('0x2f')]=function(_0xa89a71,_0x86c156){var _0x5da74c={},_0x3ec59e={},_0x23ee9b={'count':0x0,'rows':[]};var _0x4b57f6=_[_0xe48b('0x30')](db[_0xe48b('0x31')][_0xe48b('0x32')],function(_0x404221){return{'name':_0x404221[_0xe48b('0x33')],'type':_0x404221[_0xe48b('0x34')][_0xe48b('0x35')]};});_0x3ec59e[_0xe48b('0x36')]=_[_0xe48b('0x37')](_[_0xe48b('0x30')](_0x4b57f6,_0xe48b('0x2d')),['name']);_0x3ec59e[_0xe48b('0x38')]=_['keys'](_0xa89a71[_0xe48b('0x38')]);_0x3ec59e[_0xe48b('0x39')]=_[_0xe48b('0x3a')](_0x3ec59e[_0xe48b('0x36')],_0x3ec59e['query']);_0x5da74c['attributes']=_[_0xe48b('0x3a')](_0x3ec59e['model'],qs[_0xe48b('0x3b')](_0xa89a71['query'][_0xe48b('0x3b')]));_0x5da74c[_0xe48b('0x3c')]=_0x5da74c[_0xe48b('0x3c')][_0xe48b('0x3d')]?_0x5da74c[_0xe48b('0x3c')]:_0x3ec59e[_0xe48b('0x36')];if(!_0xa89a71[_0xe48b('0x38')][_0xe48b('0x3e')](_0xe48b('0x3f'))){_0x5da74c['limit']=qs[_0xe48b('0x21')](_0xa89a71[_0xe48b('0x38')][_0xe48b('0x21')]);_0x5da74c[_0xe48b('0x1f')]=qs[_0xe48b('0x1f')](_0xa89a71[_0xe48b('0x38')][_0xe48b('0x1f')]);}_0x5da74c['order']=qs[_0xe48b('0x40')](_0xa89a71['query'][_0xe48b('0x40')]);_0x5da74c[_0xe48b('0x41')]=qs[_0xe48b('0x39')](_['pick'](_0xa89a71[_0xe48b('0x38')],_0x3ec59e[_0xe48b('0x39')]),_0x4b57f6);if(_0xa89a71['query']['filter']){_0x5da74c[_0xe48b('0x41')]=_[_0xe48b('0x42')](_0x5da74c[_0xe48b('0x41')],{'$or':_['map'](_0x4b57f6,function(_0x2a9fa3){if(_0x2a9fa3[_0xe48b('0x34')]!==_0xe48b('0x43')){var _0x1912ae={};_0x1912ae[_0x2a9fa3[_0xe48b('0x2d')]]={'$like':'%'+_0xa89a71[_0xe48b('0x38')][_0xe48b('0x44')]+'%'};return _0x1912ae;}})});}_0x5da74c=_['merge']({},_0x5da74c,_0xa89a71[_0xe48b('0x45')]);var _0x2d52da={'where':_0x5da74c[_0xe48b('0x41')]};return db['VoiceMailMessage'][_0xe48b('0x22')](_0x2d52da)['then'](function(_0x250d48){_0x23ee9b[_0xe48b('0x22')]=_0x250d48;if(_0xa89a71['query'][_0xe48b('0x46')]){_0x5da74c[_0xe48b('0x47')]=[{'all':!![]}];}return db[_0xe48b('0x31')][_0xe48b('0x48')](_0x5da74c);})[_0xe48b('0x29')](function(_0xc1f9c9){_0x23ee9b['rows']=_0xc1f9c9;return _0x23ee9b;})[_0xe48b('0x29')](respondWithFilteredResult(_0x86c156,_0x5da74c))['catch'](handleError(_0x86c156,null));};exports['show']=function(_0x519b3a,_0x338dec){var _0x1cc162={'raw':!![],'where':{'id':_0x519b3a[_0xe48b('0x49')]['id']}},_0x2aae45={};_0x2aae45[_0xe48b('0x36')]=_[_0xe48b('0x4a')](db[_0xe48b('0x31')][_0xe48b('0x32')]);_0x2aae45[_0xe48b('0x38')]=_['keys'](_0x519b3a[_0xe48b('0x38')]);_0x2aae45['filters']=_['intersection'](_0x2aae45[_0xe48b('0x36')],_0x2aae45[_0xe48b('0x38')]);_0x1cc162[_0xe48b('0x3c')]=_[_0xe48b('0x3a')](_0x2aae45[_0xe48b('0x36')],qs[_0xe48b('0x3b')](_0x519b3a[_0xe48b('0x38')][_0xe48b('0x3b')]));_0x1cc162['attributes']=_0x1cc162[_0xe48b('0x3c')][_0xe48b('0x3d')]?_0x1cc162[_0xe48b('0x3c')]:_0x2aae45['model'];if(_0x519b3a[_0xe48b('0x38')]['includeAll']){_0x1cc162['include']=[{'all':!![]}];}_0x1cc162=_[_0xe48b('0x42')]({},_0x1cc162,_0x519b3a['options']);return db[_0xe48b('0x31')][_0xe48b('0x4b')](_0x1cc162)[_0xe48b('0x29')](handleEntityNotFound(_0x338dec,null))[_0xe48b('0x29')](respondWithResult(_0x338dec,null))[_0xe48b('0x4c')](handleError(_0x338dec,null));};exports[_0xe48b('0x4d')]=function(_0x4b3306,_0x1cf319){return db['VoiceMailMessage'][_0xe48b('0x4d')](_0x4b3306[_0xe48b('0x4e')],{})[_0xe48b('0x29')](respondWithResult(_0x1cf319,0xc9))[_0xe48b('0x4c')](handleError(_0x1cf319,null));};exports[_0xe48b('0x28')]=function(_0x40a3db,_0x214b5e){if(_0x40a3db[_0xe48b('0x4e')]['id']){delete _0x40a3db[_0xe48b('0x4e')]['id'];}return db[_0xe48b('0x31')][_0xe48b('0x4b')]({'where':{'id':_0x40a3db['params']['id']}})[_0xe48b('0x29')](handleEntityNotFound(_0x214b5e,null))[_0xe48b('0x29')](saveUpdates(_0x40a3db[_0xe48b('0x4e')],null))['then'](respondWithResult(_0x214b5e,null))[_0xe48b('0x4c')](handleError(_0x214b5e,null));};exports[_0xe48b('0x2a')]=function(_0x5e6b1c,_0x27bd79){return db[_0xe48b('0x31')]['find']({'where':{'id':_0x5e6b1c[_0xe48b('0x49')]['id']}})[_0xe48b('0x29')](handleEntityNotFound(_0x27bd79,null))[_0xe48b('0x29')](removeEntity(_0x27bd79,null))['catch'](handleError(_0x27bd79,null));};exports[_0xe48b('0x4f')]=function(_0x2a6605,_0x10ab01,_0x4e6274){return db[_0xe48b('0x31')][_0xe48b('0x4b')]({'where':{'id':_0x2a6605['params']['id']},'attributes':['id',_0xe48b('0x50'),_0xe48b('0x51')]})[_0xe48b('0x29')](handleEntityNotFound(_0x10ab01,null))[_0xe48b('0x29')](function(_0x104103){if(_0x104103){if(!_0x104103[_0xe48b('0x50')]){throw new db[(_0xe48b('0x52'))][(_0xe48b('0x53'))]('VoiceMailMessage\x20not\x20found');}var _0x5cd642={'Content-Type':_0xe48b('0x54'),'Content-Disposition':_0xe48b('0x55')};if(_0x104103[_0xe48b('0x51')]){_0x5cd642[_0xe48b('0x56')]=_0xe48b('0x57')+_0x104103[_0xe48b('0x51')]+'.wav\x22';}_0x10ab01[_0xe48b('0x24')](_0x5cd642);return _0x10ab01[_0xe48b('0x2e')](new Buffer(_0x104103[_0xe48b('0x50')]));}})[_0xe48b('0x4c')](handleError(_0x10ab01,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f81b85f..86ae665 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 _0x022c=['path','rimraf','../../config/environment','exports','VoiceMailMessage','dir','lodash','api','bluebird','request-promise'];(function(_0x3ea47a,_0x168099){var _0x175465=function(_0x36b573){while(--_0x36b573){_0x3ea47a['push'](_0x3ea47a['shift']());}};_0x175465(++_0x168099);}(_0x022c,0x15a));var _0xc022=function(_0x21995d,_0x5eba86){_0x21995d=_0x21995d-0x0;var _0x3d9940=_0x022c[_0x21995d];return _0x3d9940;};'use strict';var _=require(_0xc022('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc022('0x1'));var moment=require('moment');var BPromise=require(_0xc022('0x2'));var rp=require(_0xc022('0x3'));var fs=require('fs');var path=require(_0xc022('0x4'));var rimraf=require(_0xc022('0x5'));var config=require(_0xc022('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0xc022('0x7')]=function(_0x4e79b6,_0x7717d9){return _0x4e79b6['define'](_0xc022('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xc022('0x9'),'fields':[_0xc022('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1ce8=['bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','api'];(function(_0x299456,_0x254caf){var _0x213017=function(_0x31b69d){while(--_0x31b69d){_0x299456['push'](_0x299456['shift']());}};_0x213017(++_0x254caf);}(_0x1ce8,0xe1));var _0x81ce=function(_0x14c4f2,_0x4df4b1){_0x14c4f2=_0x14c4f2-0x0;var _0x255998=_0x1ce8[_0x14c4f2];return _0x255998;};'use strict';var _=require(_0x81ce('0x0'));var util=require(_0x81ce('0x1'));var logger=require('../../config/logger')(_0x81ce('0x2'));var moment=require('moment');var BPromise=require(_0x81ce('0x3'));var rp=require(_0x81ce('0x4'));var fs=require('fs');var path=require(_0x81ce('0x5'));var rimraf=require(_0x81ce('0x6'));var config=require('../../config/environment');var attributes=require(_0x81ce('0x7'));module[_0x81ce('0x8')]=function(_0x47a0c2,_0x4ed465){return _0x47a0c2[_0x81ce('0x9')](_0x81ce('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x81ce('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 e9c9d5c..114bd59 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 _0x8bb3=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x23096b,_0x35ebc1){var _0x24c0f4=function(_0x3ddd78){while(--_0x3ddd78){_0x23096b['push'](_0x23096b['shift']());}};_0x24c0f4(++_0x35ebc1);}(_0x8bb3,0x122));var _0x38bb=function(_0x514bbf,_0x21fb29){_0x514bbf=_0x514bbf-0x0;var _0x405823=_0x8bb3[_0x514bbf];return _0x405823;};'use strict';var _=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var moment=require(_0x38bb('0x2'));var BPromise=require(_0x38bb('0x3'));var rs=require(_0x38bb('0x4'));var fs=require('fs');var Redis=require(_0x38bb('0x5'));var db=require(_0x38bb('0x6'))['db'];var utils=require(_0x38bb('0x7'));var logger=require(_0x38bb('0x8'))(_0x38bb('0x9'));var config=require(_0x38bb('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x38bb('0xb')][_0x38bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d92fb,_0x9c1955,_0x2e33db){return new BPromise(function(_0x181de1,_0x30096c){return client[_0x38bb('0xd')](_0x4d92fb,_0x2e33db)['then'](function(_0x1d9ee6){logger[_0x38bb('0xe')](_0x38bb('0xf'),_0x9c1955,'request\x20sent');logger['debug'](_0x38bb('0x10'),_0x9c1955,_0x38bb('0x11'),JSON['stringify'](_0x1d9ee6));if(_0x1d9ee6['error']){if(_0x1d9ee6['error']['code']===0x1f4){logger[_0x38bb('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x9c1955,_0x1d9ee6['error'][_0x38bb('0x13')]);return _0x30096c(_0x1d9ee6['error'][_0x38bb('0x13')]);}logger[_0x38bb('0x12')](_0x38bb('0xf'),_0x9c1955,_0x1d9ee6['error'][_0x38bb('0x13')]);return _0x181de1(_0x1d9ee6['error'][_0x38bb('0x13')]);}else{logger[_0x38bb('0xe')](_0x38bb('0xf'),_0x9c1955,'request\x20sent');_0x181de1(_0x1d9ee6[_0x38bb('0x14')][_0x38bb('0x13')]);}})[_0x38bb('0x15')](function(_0x2aa632){logger[_0x38bb('0x12')](_0x38bb('0xf'),_0x9c1955,_0x2aa632);_0x30096c(_0x2aa632);});});} \ No newline at end of file +var _0x81e0=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x81e0,0x1ed));var _0x081e=function(_0x3438d3,_0x116349){_0x3438d3=_0x3438d3-0x0;var _0x494348=_0x81e0[_0x3438d3];return _0x494348;};'use strict';var _=require(_0x081e('0x0'));var util=require(_0x081e('0x1'));var moment=require(_0x081e('0x2'));var BPromise=require(_0x081e('0x3'));var rs=require(_0x081e('0x4'));var fs=require('fs');var Redis=require(_0x081e('0x5'));var db=require(_0x081e('0x6'))['db'];var utils=require(_0x081e('0x7'));var logger=require(_0x081e('0x8'))(_0x081e('0x9'));var config=require('../../config/environment');var jayson=require(_0x081e('0xa'));var client=jayson[_0x081e('0xb')][_0x081e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x130e79,_0x2df412,_0x5039ee){return new BPromise(function(_0xa6fca4,_0x3aa82e){return client[_0x081e('0xd')](_0x130e79,_0x5039ee)[_0x081e('0xe')](function(_0xde3768){logger[_0x081e('0xf')](_0x081e('0x10'),_0x2df412,_0x081e('0x11'));logger[_0x081e('0x12')](_0x081e('0x13'),_0x2df412,_0x081e('0x11'),JSON['stringify'](_0xde3768));if(_0xde3768[_0x081e('0x14')]){if(_0xde3768['error'][_0x081e('0x15')]===0x1f4){logger['error'](_0x081e('0x10'),_0x2df412,_0xde3768[_0x081e('0x14')]['message']);return _0x3aa82e(_0xde3768['error']['message']);}logger[_0x081e('0x14')](_0x081e('0x10'),_0x2df412,_0xde3768[_0x081e('0x14')][_0x081e('0x16')]);return _0xa6fca4(_0xde3768[_0x081e('0x14')][_0x081e('0x16')]);}else{logger[_0x081e('0xf')](_0x081e('0x10'),_0x2df412,_0x081e('0x11'));_0xa6fca4(_0xde3768[_0x081e('0x17')][_0x081e('0x16')]);}})[_0x081e('0x18')](function(_0x58c278){logger[_0x081e('0x14')](_0x081e('0x10'),_0x2df412,_0x58c278);_0x3aa82e(_0x58c278);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index cb86cae..a6d81a2 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 _0x8efd=['update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','post','addSound','put'];(function(_0x337b8f,_0x3a6eb2){var _0x2cfae7=function(_0x46ff92){while(--_0x46ff92){_0x337b8f['push'](_0x337b8f['shift']());}};_0x2cfae7(++_0x3a6eb2);}(_0x8efd,0x10e));var _0xd8ef=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8efd[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xd8ef('0x0'));var util=require('util');var path=require(_0xd8ef('0x1'));var timeout=require(_0xd8ef('0x2'));var express=require(_0xd8ef('0x3'));var router=express['Router']();var fs_extra=require(_0xd8ef('0x4'));var auth=require(_0xd8ef('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8ef('0x6'));router[_0xd8ef('0x7')]('/',auth[_0xd8ef('0x8')](),controller[_0xd8ef('0x9')]);router[_0xd8ef('0x7')](_0xd8ef('0xa'),auth[_0xd8ef('0x8')](),controller[_0xd8ef('0xb')]);router[_0xd8ef('0x7')](_0xd8ef('0xc'),auth[_0xd8ef('0x8')](),controller['getSounds']);router[_0xd8ef('0xd')]('/',auth[_0xd8ef('0x8')](),controller['create']);router[_0xd8ef('0xd')](_0xd8ef('0xc'),auth[_0xd8ef('0x8')](),controller[_0xd8ef('0xe')]);router[_0xd8ef('0xf')](_0xd8ef('0xa'),auth[_0xd8ef('0x8')](),controller[_0xd8ef('0x10')]);router[_0xd8ef('0x11')](_0xd8ef('0xa'),auth['isAuthenticated'](),controller[_0xd8ef('0x12')]);router[_0xd8ef('0x11')](_0xd8ef('0x13'),auth[_0xd8ef('0x8')](),controller[_0xd8ef('0x14')]);module[_0xd8ef('0x15')]=router; \ No newline at end of file +var _0x20e7=['/:id/sounds','getSounds','post','addSound','put','delete','/:id/sounds/:id2','removeSound','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x2a3e5f,_0x24c745){var _0xfdbebc=function(_0x1c1bd2){while(--_0x1c1bd2){_0x2a3e5f['push'](_0x2a3e5f['shift']());}};_0xfdbebc(++_0x24c745);}(_0x20e7,0x1c2));var _0x720e=function(_0xf16b9f,_0x4e4bf4){_0xf16b9f=_0xf16b9f-0x0;var _0x5c484e=_0x20e7[_0xf16b9f];return _0x5c484e;};'use strict';var multer=require(_0x720e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x720e('0x1'));var express=require(_0x720e('0x2'));var router=express[_0x720e('0x3')]();var fs_extra=require(_0x720e('0x4'));var auth=require(_0x720e('0x5'));var interaction=require(_0x720e('0x6'));var config=require(_0x720e('0x7'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x720e('0x8')]);router[_0x720e('0x9')](_0x720e('0xa'),auth[_0x720e('0xb')](),controller['show']);router['get'](_0x720e('0xc'),auth[_0x720e('0xb')](),controller[_0x720e('0xd')]);router[_0x720e('0xe')]('/',auth[_0x720e('0xb')](),controller['create']);router[_0x720e('0xe')]('/:id/sounds',auth[_0x720e('0xb')](),controller[_0x720e('0xf')]);router[_0x720e('0x10')](_0x720e('0xa'),auth[_0x720e('0xb')](),controller['update']);router[_0x720e('0x11')](_0x720e('0xa'),auth[_0x720e('0xb')](),controller['destroy']);router[_0x720e('0x11')](_0x720e('0x12'),auth[_0x720e('0xb')](),controller[_0x720e('0x13')]);module[_0x720e('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 408d948..e1d63b9 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 _0x048b=['files','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','ENUM','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x048b,0xd1));var _0xb048=function(_0x2eac1f,_0x4a49d2){_0x2eac1f=_0x2eac1f-0x0;var _0x5ce0b2=_0x048b[_0x2eac1f];return _0x5ce0b2;};'use strict';var Sequelize=require(_0xb048('0x0'));module[_0xb048('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xb048('0x2')]('custom','files',_0xb048('0x3'),_0xb048('0x4'),_0xb048('0x5'),_0xb048('0x6')),'allowNull':!![],'defaultValue':_0xb048('0x7')},'directory':{'type':Sequelize[_0xb048('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0xb048('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb048('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb048('0x8')],'allowNull':!![],'defaultValue':_0xb048('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xb048('0xa')},'defaultEntry':{'type':Sequelize[_0xb048('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe564=['sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x4279b6,_0x6dbf0d){var _0x5a5fe6=function(_0x4a418f){while(--_0x4a418f){_0x4279b6['push'](_0x4279b6['shift']());}};_0x5a5fe6(++_0x6dbf0d);}(_0xe564,0x1ba));var _0x4e56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe564[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e56('0x0'));module[_0x4e56('0x1')]={'name':{'type':Sequelize[_0x4e56('0x2')],'allowNull':![],'unique':_0x4e56('0x3')},'mode':{'type':Sequelize[_0x4e56('0x4')](_0x4e56('0x5'),_0x4e56('0x6'),_0x4e56('0x7'),_0x4e56('0x8'),'quietmp3',_0x4e56('0x9')),'allowNull':!![],'defaultValue':_0x4e56('0x6')},'directory':{'type':Sequelize[_0x4e56('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4e56('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4e56('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4e56('0x2')],'allowNull':!![],'defaultValue':_0x4e56('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x4e56('0xb')},'defaultEntry':{'type':Sequelize[_0x4e56('0xc')],'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 5ff8a5f..9ed8f23 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 _0x78a4=['mode','files','root','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','readdirSync','forEach','join','rmdirSync','Sequelize','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','removeSound','id2','unlinkSync','ValidationError','getSounds','sort','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','status','error','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','body','find','create','transaction'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0x78a4,0x18b));var _0x478a=function(_0x302d1a,_0x387081){_0x302d1a=_0x302d1a-0x0;var _0xd82ca=_0x78a4[_0x302d1a];return _0xd82ca;};'use strict';var emlformat=require(_0x478a('0x0'));var rimraf=require(_0x478a('0x1'));var zipdir=require(_0x478a('0x2'));var jsonpatch=require(_0x478a('0x3'));var rp=require('request-promise');var moment=require(_0x478a('0x4'));var BPromise=require(_0x478a('0x5'));var Mustache=require(_0x478a('0x6'));var util=require(_0x478a('0x7'));var path=require('path');var sox=require(_0x478a('0x8'));var csv=require(_0x478a('0x9'));var ejs=require(_0x478a('0xa'));var fs=require('fs');var fs_extra=require(_0x478a('0xb'));var _=require('lodash');var squel=require(_0x478a('0xc'));var crypto=require(_0x478a('0xd'));var jsforce=require(_0x478a('0xe'));var deskjs=require(_0x478a('0xf'));var toCsv=require(_0x478a('0x9'));var querystring=require(_0x478a('0x10'));var Papa=require('papaparse');var Redis=require(_0x478a('0x11'));var authService=require(_0x478a('0x12'));var qs=require(_0x478a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x478a('0x14'));var logger=require(_0x478a('0x15'))(_0x478a('0x16'));var utils=require('../../config/utils');var config=require(_0x478a('0x17'));var licenseUtil=require(_0x478a('0x18'));var db=require(_0x478a('0x19'))['db'];function respondWithStatusCode(_0x4fe469,_0xc24b10){_0xc24b10=_0xc24b10||0xcc;return function(_0x448dfb){if(_0x448dfb){return _0x4fe469[_0x478a('0x1a')](_0xc24b10);}return _0x4fe469['status'](_0xc24b10)[_0x478a('0x1b')]();};}function respondWithResult(_0x258f3e,_0x2545a2){_0x2545a2=_0x2545a2||0xc8;return function(_0x409d50){if(_0x409d50){return _0x258f3e['status'](_0x2545a2)[_0x478a('0x1c')](_0x409d50);}};}function respondWithFilteredResult(_0x2d7366,_0x8ee213){return function(_0x73694e){if(_0x73694e){var _0x2dabeb=typeof _0x8ee213[_0x478a('0x1d')]===_0x478a('0x1e')&&typeof _0x8ee213[_0x478a('0x1f')]===_0x478a('0x1e');var _0x424a3a=_0x73694e[_0x478a('0x20')];var _0x90447d=_0x2dabeb?0x0:_0x8ee213[_0x478a('0x1d')];var _0x4a351c=_0x2dabeb?_0x73694e[_0x478a('0x20')]:_0x8ee213[_0x478a('0x1d')]+_0x8ee213[_0x478a('0x1f')];var _0x5785d6;if(_0x4a351c>=_0x424a3a){_0x4a351c=_0x424a3a;_0x5785d6=0xc8;}else{_0x5785d6=0xce;}_0x2d7366['status'](_0x5785d6);return _0x2d7366[_0x478a('0x21')]('Content-Range',_0x90447d+'-'+_0x4a351c+'/'+_0x424a3a)[_0x478a('0x1c')](_0x73694e);}return null;};}function patchUpdates(_0xdd7477){return function(_0x28caa1){try{jsonpatch[_0x478a('0x22')](_0x28caa1,_0xdd7477,!![]);}catch(_0x4e6ebe){return BPromise['reject'](_0x4e6ebe);}return _0x28caa1[_0x478a('0x23')]();};}function saveUpdates(_0x564ecb,_0xf04a6d){return function(_0x486c97){if(_0x486c97){return _0x486c97[_0x478a('0x24')](_0x564ecb)[_0x478a('0x25')](function(_0x215995){return _0x215995;});}return null;};}function removeEntity(_0x1b9757,_0x14546d){return function(_0x51b988){if(_0x51b988){return _0x51b988[_0x478a('0x26')]()[_0x478a('0x25')](function(){var _0x520457=_0x51b988[_0x478a('0x27')]({'plain':!![]});var _0x1b73df='MusicOnHolds';return db[_0x478a('0x28')]['destroy']({'where':{'type':_0x1b73df,'resourceId':_0x520457['id']}})[_0x478a('0x25')](function(){return _0x51b988;});})[_0x478a('0x25')](function(){_0x1b9757[_0x478a('0x29')](0xcc)[_0x478a('0x1b')]();});}};}function handleEntityNotFound(_0x240bae,_0x26ea33){return function(_0x4ab3ed){if(!_0x4ab3ed){_0x240bae[_0x478a('0x1a')](0x194);}return _0x4ab3ed;};}function handleError(_0x4d93fe,_0x2bf95a){_0x2bf95a=_0x2bf95a||0x1f4;return function(_0x5ee5f5){logger[_0x478a('0x2a')](_0x5ee5f5[_0x478a('0x2b')]);if(_0x5ee5f5[_0x478a('0x2c')]){delete _0x5ee5f5[_0x478a('0x2c')];}_0x4d93fe['status'](_0x2bf95a)[_0x478a('0x2d')](_0x5ee5f5);};}exports['index']=function(_0x21eefc,_0x57dba4){var _0x288d0f={},_0x189e04={},_0x4f2ab8={'count':0x0,'rows':[]};var _0x4117d9=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x1c0902){return{'name':_0x1c0902[_0x478a('0x2e')],'type':_0x1c0902[_0x478a('0x2f')][_0x478a('0x30')]};});_0x189e04[_0x478a('0x31')]=_[_0x478a('0x32')](_0x4117d9,_0x478a('0x2c'));_0x189e04[_0x478a('0x33')]=_['keys'](_0x21eefc['query']);_0x189e04[_0x478a('0x34')]=_[_0x478a('0x35')](_0x189e04['model'],_0x189e04[_0x478a('0x33')]);_0x288d0f[_0x478a('0x36')]=_[_0x478a('0x35')](_0x189e04['model'],qs[_0x478a('0x37')](_0x21eefc[_0x478a('0x33')]['fields']));_0x288d0f[_0x478a('0x36')]=_0x288d0f[_0x478a('0x36')]['length']?_0x288d0f['attributes']:_0x189e04[_0x478a('0x31')];if(!_0x21eefc[_0x478a('0x33')][_0x478a('0x38')]('nolimit')){_0x288d0f[_0x478a('0x1f')]=qs[_0x478a('0x1f')](_0x21eefc[_0x478a('0x33')][_0x478a('0x1f')]);_0x288d0f[_0x478a('0x1d')]=qs[_0x478a('0x1d')](_0x21eefc[_0x478a('0x33')]['offset']);}_0x288d0f[_0x478a('0x39')]=qs['sort'](_0x21eefc['query']['sort']);delete _0x21eefc[_0x478a('0x33')]['sort'];_0x288d0f[_0x478a('0x3a')]=qs[_0x478a('0x34')](_['pick'](_0x21eefc[_0x478a('0x33')],_0x189e04['filters']),_0x4117d9);if(_0x21eefc[_0x478a('0x33')][_0x478a('0x3b')]){_0x288d0f[_0x478a('0x3a')]=_[_0x478a('0x3c')](_0x288d0f[_0x478a('0x3a')],{'$or':_[_0x478a('0x32')](_0x4117d9,function(_0x81659e){if(_0x81659e['type']!==_0x478a('0x3d')){var _0x369731={};_0x369731[_0x81659e['name']]={'$like':'%'+_0x21eefc['query'][_0x478a('0x3b')]+'%'};return _0x369731;}})});}_0x288d0f=_[_0x478a('0x3c')]({},_0x288d0f,_0x21eefc[_0x478a('0x3e')]);var _0x2564dc={'where':_0x288d0f['where']};return db[_0x478a('0x3f')][_0x478a('0x20')](_0x2564dc)[_0x478a('0x25')](function(_0x50d2f6){_0x4f2ab8[_0x478a('0x20')]=_0x50d2f6;if(_0x21eefc[_0x478a('0x33')][_0x478a('0x40')]){_0x288d0f[_0x478a('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x478a('0x42')](_0x288d0f);})[_0x478a('0x25')](function(_0x2b8072){_0x4f2ab8['rows']=_0x2b8072;return _0x4f2ab8;})['then'](respondWithFilteredResult(_0x57dba4,_0x288d0f))[_0x478a('0x43')](handleError(_0x57dba4,null));};exports[_0x478a('0x44')]=function(_0x4b86b7,_0x3d3adc){var _0x1580df={'raw':![],'where':{'id':_0x4b86b7[_0x478a('0x45')]['id']}},_0x5d47fc={};_0x5d47fc[_0x478a('0x31')]=_[_0x478a('0x46')](db['VoiceMusicOnHold'][_0x478a('0x47')]);_0x5d47fc[_0x478a('0x33')]=_['keys'](_0x4b86b7[_0x478a('0x33')]);_0x5d47fc[_0x478a('0x34')]=_[_0x478a('0x35')](_0x5d47fc[_0x478a('0x31')],_0x5d47fc[_0x478a('0x33')]);_0x1580df[_0x478a('0x36')]=_['intersection'](_0x5d47fc[_0x478a('0x31')],qs[_0x478a('0x37')](_0x4b86b7[_0x478a('0x33')]['fields']));_0x1580df[_0x478a('0x36')]=_0x1580df[_0x478a('0x36')][_0x478a('0x48')]?_0x1580df['attributes']:_0x5d47fc[_0x478a('0x31')];if(_0x4b86b7[_0x478a('0x33')][_0x478a('0x40')]){_0x1580df[_0x478a('0x41')]=[{'all':!![]}];}_0x1580df=_[_0x478a('0x3c')]({},_0x1580df,_0x4b86b7[_0x478a('0x3e')]);return db[_0x478a('0x3f')]['find'](_0x1580df)['then'](handleEntityNotFound(_0x3d3adc,null))['then'](respondWithResult(_0x3d3adc,null))[_0x478a('0x43')](handleError(_0x3d3adc,null));};exports[_0x478a('0x24')]=function(_0xb1e0e0,_0x47062e){if(_0xb1e0e0[_0x478a('0x49')]['id']){delete _0xb1e0e0[_0x478a('0x49')]['id'];}return db[_0x478a('0x3f')][_0x478a('0x4a')]({'where':{'id':_0xb1e0e0['params']['id']}})['then'](handleEntityNotFound(_0x47062e,null))[_0x478a('0x25')](saveUpdates(_0xb1e0e0[_0x478a('0x49')],null))[_0x478a('0x25')](respondWithResult(_0x47062e,null))[_0x478a('0x43')](handleError(_0x47062e,null));};exports[_0x478a('0x4b')]=function(_0x55222b,_0x46fb75,_0x171f91){return db['sequelize'][_0x478a('0x4c')](function(_0x81ecec){if(_0x55222b[_0x478a('0x49')][_0x478a('0x4d')]===_0x478a('0x4e')){_0x55222b[_0x478a('0x49')]['directory']=path['join'](config[_0x478a('0x4f')],_0x478a('0x50'),_0x55222b[_0x478a('0x49')]['name']);}return db['VoiceMusicOnHold']['create'](_0x55222b[_0x478a('0x49')],{'transaction':_0x81ecec})[_0x478a('0x25')](function(_0x4a130a){if(_0x55222b['body'][_0x478a('0x4d')]===_0x478a('0x4e')){fs[_0x478a('0x51')](_0x4a130a['directory'],parseInt(_0x478a('0x52'),0x8));}var _0x3e1226=_0x55222b[_0x478a('0x53')]['get']({'plain':!![]});if(!_0x3e1226)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1226[_0x478a('0x54')]===_0x478a('0x53')){var _0x5c9c57=_0x4a130a[_0x478a('0x27')]({'plain':!![]});return db[_0x478a('0x55')][_0x478a('0x4a')]({'where':{'name':_0x478a('0x56'),'userProfileId':_0x3e1226[_0x478a('0x57')]},'raw':!![]})[_0x478a('0x25')](function(_0x477e88){if(_0x477e88&&_0x477e88[_0x478a('0x58')]===0x0){return db[_0x478a('0x28')][_0x478a('0x4b')]({'name':_0x5c9c57[_0x478a('0x2c')],'resourceId':_0x5c9c57['id'],'type':_0x477e88[_0x478a('0x2c')],'sectionId':_0x477e88['id']},{})['then'](function(){return _0x4a130a;});}else{return _0x4a130a;}})['catch'](function(_0x39a886){logger[_0x478a('0x2a')](_0x478a('0x59'),_0x39a886);});}return _0x4a130a;});})[_0x478a('0x25')](respondWithResult(_0x46fb75,0xc9))[_0x478a('0x43')](handleError(_0x46fb75,null));};exports[_0x478a('0x26')]=function(_0x37a0e4,_0x396f2a,_0x50ae94){var _0x387005;return db['VoiceMusicOnHold'][_0x478a('0x4a')]({'where':{'id':_0x37a0e4[_0x478a('0x45')]['id']}})[_0x478a('0x25')](function(_0x527d50){if(_0x527d50){return db['sequelize'][_0x478a('0x4c')](function(_0x508361){return _0x527d50[_0x478a('0x26')]({'transaction':_0x508361,'raw':!![]})[_0x478a('0x25')](function(_0x190698){if(_0x190698[_0x478a('0x5a')]){fs[_0x478a('0x5b')](_0x190698[_0x478a('0x5a')])[_0x478a('0x5c')](function(_0x3a9f7d){fs['unlinkSync'](path[_0x478a('0x5d')](_0x190698[_0x478a('0x5a')],_0x3a9f7d));});fs[_0x478a('0x5e')](_0x190698[_0x478a('0x5a')]);}return _0x190698;});})['catch'](function(_0x39dd8e){throw new db[(_0x478a('0x5f'))]['ValidationError'](_0x39dd8e[_0x478a('0x60')]);});}})['then'](handleEntityNotFound(_0x396f2a,null))[_0x478a('0x25')](removeEntity(_0x396f2a,null))[_0x478a('0x43')](handleError(_0x396f2a,null));};exports[_0x478a('0x61')]=function(_0x204563,_0x5394e3,_0x5fddcc){return db[_0x478a('0x62')][_0x478a('0x4c')](function(_0x5e3d27){var _0x3c8702;return db[_0x478a('0x3f')]['find']({'where':{'id':_0x204563[_0x478a('0x45')]['id']}})['then'](function(_0x2287a9){if(_0x2287a9){_0x3c8702=_0x2287a9;return _0x2287a9[_0x478a('0x61')](_0x204563[_0x478a('0x49')]['id'],{'transaction':_0x5e3d27});}})[_0x478a('0x25')](function(_0x24398a){if(_0x24398a){return db[_0x478a('0x63')][_0x478a('0x64')]({'where':{'id':_0x204563[_0x478a('0x49')]['id']},'attributes':['id',_0x478a('0x2c'),_0x478a('0x65'),_0x478a('0x66'),_0x478a('0x67')],'raw':!![]});}})[_0x478a('0x25')](function(_0x2fe7ae){if(_0x2fe7ae){var _0xfaa9d8=path[_0x478a('0x5d')](config[_0x478a('0x4f')],_0x478a('0x68'),util[_0x478a('0x69')]('%s.%s',path[_0x478a('0x6a')](_0x2fe7ae['save_name'],path[_0x478a('0x6b')](_0x2fe7ae['save_name'])),_0x2fe7ae[_0x478a('0x66')]));var _0x30ce4a=path['join'](config[_0x478a('0x4f')],_0x478a('0x50'),_0x3c8702[_0x478a('0x2c')],util['format'](_0x478a('0x6c'),_0x2fe7ae['name'],_0x2fe7ae[_0x478a('0x66')]));fs[_0x478a('0x6d')](_0xfaa9d8,_0x30ce4a);return _0x2fe7ae;}})[_0x478a('0x43')](function(_0x4cc78b){throw new db[(_0x478a('0x5f'))]['ValidationError'](_0x4cc78b['message']);});})[_0x478a('0x25')](handleEntityNotFound(_0x5394e3,null))['then'](respondWithResult(_0x5394e3,0xc9))['catch'](handleError(_0x5394e3,null));};exports[_0x478a('0x6e')]=function(_0x268d34,_0x48f343,_0x26754a){return db[_0x478a('0x62')][_0x478a('0x4c')](function(_0x468456){var _0x50a067;return db[_0x478a('0x3f')][_0x478a('0x64')]({'where':{'id':_0x268d34[_0x478a('0x45')]['id']}})[_0x478a('0x25')](handleEntityNotFound(_0x48f343,null))[_0x478a('0x25')](function(_0x346032){if(_0x346032){_0x50a067=_0x346032;return _0x346032[_0x478a('0x6e')](_0x268d34[_0x478a('0x45')]['id2']);}})['then'](function(_0x5df9c2){if(_0x5df9c2){return db[_0x478a('0x63')][_0x478a('0x64')]({'where':{'id':_0x268d34[_0x478a('0x45')][_0x478a('0x6f')]},'attributes':['id','name',_0x478a('0x65'),_0x478a('0x66'),_0x478a('0x67')],'raw':!![]});}})['then'](function(_0xf8aab8){if(_0xf8aab8){fs[_0x478a('0x70')](path['join'](_0x50a067['directory'],util[_0x478a('0x69')](_0x478a('0x6c'),_0xf8aab8['name'],_0xf8aab8['converted_format'])));return _0xf8aab8;}})['catch'](function(_0x4405e9){throw new db[(_0x478a('0x5f'))][(_0x478a('0x71'))](_0x4405e9[_0x478a('0x60')]);});})['then'](handleEntityNotFound(_0x48f343,null))[_0x478a('0x25')](respondWithStatusCode(_0x48f343,0xcc))[_0x478a('0x43')](handleError(_0x48f343,null));};exports[_0x478a('0x72')]=function(_0x70a44f,_0x1ad967,_0x4983f8){var _0x4cd7b4={};var _0x3cd8e6={};var _0x2ac003;var _0x31169a;return db[_0x478a('0x3f')][_0x478a('0x64')]({'where':{'id':_0x70a44f['params']['id']}})[_0x478a('0x25')](handleEntityNotFound(_0x1ad967,null))['then'](function(_0x1d15b6){if(_0x1d15b6){_0x2ac003=_0x1d15b6;_0x3cd8e6['model']=_[_0x478a('0x46')](db['Sound'][_0x478a('0x47')]);_0x3cd8e6[_0x478a('0x33')]=_['keys'](_0x70a44f[_0x478a('0x33')]);_0x3cd8e6[_0x478a('0x34')]=_[_0x478a('0x35')](_0x3cd8e6['model'],_0x3cd8e6['query']);_0x4cd7b4[_0x478a('0x36')]=_['intersection'](_0x3cd8e6['model'],qs['fields'](_0x70a44f[_0x478a('0x33')][_0x478a('0x37')]));_0x4cd7b4[_0x478a('0x36')]=_0x4cd7b4[_0x478a('0x36')]['length']?_0x4cd7b4[_0x478a('0x36')]:_0x3cd8e6[_0x478a('0x31')];_0x4cd7b4[_0x478a('0x39')]=qs[_0x478a('0x73')](_0x70a44f[_0x478a('0x33')]['sort']);_0x4cd7b4[_0x478a('0x3a')]=qs[_0x478a('0x34')](_[_0x478a('0x74')](_0x70a44f[_0x478a('0x33')],_0x3cd8e6[_0x478a('0x34')]));if(_0x70a44f[_0x478a('0x33')][_0x478a('0x3b')]){_0x4cd7b4[_0x478a('0x3a')]=_[_0x478a('0x3c')](_0x4cd7b4[_0x478a('0x3a')],{'$or':_[_0x478a('0x32')](_0x4cd7b4[_0x478a('0x36')],function(_0x1b7088){var _0x5c5f1a={};_0x5c5f1a[_0x1b7088]={'$like':'%'+_0x70a44f[_0x478a('0x33')][_0x478a('0x3b')]+'%'};return _0x5c5f1a;})});}_0x4cd7b4=_['merge']({},_0x4cd7b4,_0x70a44f[_0x478a('0x3e')]);return _0x2ac003[_0x478a('0x72')](_0x4cd7b4);}})[_0x478a('0x25')](function(_0x15c1cb){if(_0x15c1cb){_0x31169a=_0x15c1cb[_0x478a('0x48')];if(!_0x70a44f[_0x478a('0x33')][_0x478a('0x38')](_0x478a('0x75'))){_0x4cd7b4['limit']=qs[_0x478a('0x1f')](_0x70a44f[_0x478a('0x33')][_0x478a('0x1f')]);_0x4cd7b4[_0x478a('0x1d')]=qs['offset'](_0x70a44f[_0x478a('0x33')][_0x478a('0x1d')]);}return _0x2ac003['getSounds'](_0x4cd7b4);}})['then'](function(_0x19100b){if(_0x19100b){return _0x19100b?{'count':_0x31169a,'rows':_0x19100b}:null;}})[_0x478a('0x25')](respondWithResult(_0x1ad967,null))[_0x478a('0x43')](handleError(_0x1ad967,null));}; \ No newline at end of file +var _0x1b7f=['desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','status','end','undefined','offset','count','set','Content-Range','reject','save','then','get','MusicOnHolds','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','fields','length','options','find','catch','update','body','create','sequelize','mode','files','directory','join','root','mkdirSync','0777','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','destroy','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','extname','format','%s.%s','Sequelize','message','removeSound','id2','getSounds','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','lodash','squel','jsforce'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1b7f,0x195));var _0xf1b7=function(_0x38b2e5,_0x7a2f32){_0x38b2e5=_0x38b2e5-0x0;var _0xf17303=_0x1b7f[_0x38b2e5];return _0xf17303;};'use strict';var emlformat=require(_0xf1b7('0x0'));var rimraf=require(_0xf1b7('0x1'));var zipdir=require(_0xf1b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1b7('0x3'));var moment=require(_0xf1b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1b7('0x5'));var util=require(_0xf1b7('0x6'));var path=require('path');var sox=require(_0xf1b7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1b7('0x8'));var squel=require(_0xf1b7('0x9'));var crypto=require('crypto');var jsforce=require(_0xf1b7('0xa'));var deskjs=require(_0xf1b7('0xb'));var toCsv=require(_0xf1b7('0xc'));var querystring=require('querystring');var Papa=require(_0xf1b7('0xd'));var Redis=require('ioredis');var authService=require(_0xf1b7('0xe'));var qs=require(_0xf1b7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1b7('0x10'));var logger=require(_0xf1b7('0x11'))(_0xf1b7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b529b,_0x58eb83){_0x58eb83=_0x58eb83||0xcc;return function(_0x1b8320){if(_0x1b8320){return _0x4b529b['sendStatus'](_0x58eb83);}return _0x4b529b[_0xf1b7('0x13')](_0x58eb83)[_0xf1b7('0x14')]();};}function respondWithResult(_0x110f30,_0x4c0009){_0x4c0009=_0x4c0009||0xc8;return function(_0x515cf8){if(_0x515cf8){return _0x110f30[_0xf1b7('0x13')](_0x4c0009)['json'](_0x515cf8);}};}function respondWithFilteredResult(_0xd07770,_0x57cec4){return function(_0x425969){if(_0x425969){var _0x25a8d5=typeof _0x57cec4['offset']===_0xf1b7('0x15')&&typeof _0x57cec4['limit']===_0xf1b7('0x15');var _0x99913f=_0x425969['count'];var _0x4c78a1=_0x25a8d5?0x0:_0x57cec4[_0xf1b7('0x16')];var _0x12359d=_0x25a8d5?_0x425969[_0xf1b7('0x17')]:_0x57cec4[_0xf1b7('0x16')]+_0x57cec4['limit'];var _0xc16b2d;if(_0x12359d>=_0x99913f){_0x12359d=_0x99913f;_0xc16b2d=0xc8;}else{_0xc16b2d=0xce;}_0xd07770[_0xf1b7('0x13')](_0xc16b2d);return _0xd07770[_0xf1b7('0x18')](_0xf1b7('0x19'),_0x4c78a1+'-'+_0x12359d+'/'+_0x99913f)['json'](_0x425969);}return null;};}function patchUpdates(_0x2fe0d7){return function(_0x45227d){try{jsonpatch['apply'](_0x45227d,_0x2fe0d7,!![]);}catch(_0x1e58a0){return BPromise[_0xf1b7('0x1a')](_0x1e58a0);}return _0x45227d[_0xf1b7('0x1b')]();};}function saveUpdates(_0x269ac0,_0x5d6018){return function(_0x213628){if(_0x213628){return _0x213628['update'](_0x269ac0)[_0xf1b7('0x1c')](function(_0x12885c){return _0x12885c;});}return null;};}function removeEntity(_0x344519,_0x13f09){return function(_0x391e92){if(_0x391e92){return _0x391e92['destroy']()[_0xf1b7('0x1c')](function(){var _0x54970f=_0x391e92[_0xf1b7('0x1d')]({'plain':!![]});var _0x2a8a91=_0xf1b7('0x1e');return db['UserProfileResource']['destroy']({'where':{'type':_0x2a8a91,'resourceId':_0x54970f['id']}})['then'](function(){return _0x391e92;});})[_0xf1b7('0x1c')](function(){_0x344519[_0xf1b7('0x13')](0xcc)[_0xf1b7('0x14')]();});}};}function handleEntityNotFound(_0x14697c,_0x5d596f){return function(_0x50f581){if(!_0x50f581){_0x14697c['sendStatus'](0x194);}return _0x50f581;};}function handleError(_0x54ceeb,_0x445d86){_0x445d86=_0x445d86||0x1f4;return function(_0x214ea9){logger[_0xf1b7('0x1f')](_0x214ea9[_0xf1b7('0x20')]);if(_0x214ea9[_0xf1b7('0x21')]){delete _0x214ea9[_0xf1b7('0x21')];}_0x54ceeb[_0xf1b7('0x13')](_0x445d86)['send'](_0x214ea9);};}exports[_0xf1b7('0x22')]=function(_0x38c429,_0x39d9d2){var _0x486c4e={},_0x414c03={},_0x587f4f={'count':0x0,'rows':[]};var _0xafd86a=_[_0xf1b7('0x23')](db[_0xf1b7('0x24')][_0xf1b7('0x25')],function(_0x3990c9){return{'name':_0x3990c9[_0xf1b7('0x26')],'type':_0x3990c9[_0xf1b7('0x27')][_0xf1b7('0x28')]};});_0x414c03[_0xf1b7('0x29')]=_[_0xf1b7('0x23')](_0xafd86a,_0xf1b7('0x21'));_0x414c03[_0xf1b7('0x2a')]=_[_0xf1b7('0x2b')](_0x38c429['query']);_0x414c03[_0xf1b7('0x2c')]=_[_0xf1b7('0x2d')](_0x414c03['model'],_0x414c03[_0xf1b7('0x2a')]);_0x486c4e['attributes']=_['intersection'](_0x414c03[_0xf1b7('0x29')],qs['fields'](_0x38c429[_0xf1b7('0x2a')]['fields']));_0x486c4e['attributes']=_0x486c4e[_0xf1b7('0x2e')]['length']?_0x486c4e[_0xf1b7('0x2e')]:_0x414c03[_0xf1b7('0x29')];if(!_0x38c429[_0xf1b7('0x2a')][_0xf1b7('0x2f')]('nolimit')){_0x486c4e[_0xf1b7('0x30')]=qs[_0xf1b7('0x30')](_0x38c429[_0xf1b7('0x2a')]['limit']);_0x486c4e['offset']=qs[_0xf1b7('0x16')](_0x38c429[_0xf1b7('0x2a')][_0xf1b7('0x16')]);}_0x486c4e[_0xf1b7('0x31')]=qs[_0xf1b7('0x32')](_0x38c429[_0xf1b7('0x2a')][_0xf1b7('0x32')]);delete _0x38c429['query'][_0xf1b7('0x32')];_0x486c4e[_0xf1b7('0x33')]=qs[_0xf1b7('0x2c')](_[_0xf1b7('0x34')](_0x38c429[_0xf1b7('0x2a')],_0x414c03[_0xf1b7('0x2c')]),_0xafd86a);if(_0x38c429[_0xf1b7('0x2a')]['filter']){_0x486c4e[_0xf1b7('0x33')]=_[_0xf1b7('0x35')](_0x486c4e[_0xf1b7('0x33')],{'$or':_['map'](_0xafd86a,function(_0x4df989){if(_0x4df989[_0xf1b7('0x27')]!==_0xf1b7('0x36')){var _0x278af9={};_0x278af9[_0x4df989[_0xf1b7('0x21')]]={'$like':'%'+_0x38c429[_0xf1b7('0x2a')][_0xf1b7('0x37')]+'%'};return _0x278af9;}})});}_0x486c4e=_[_0xf1b7('0x35')]({},_0x486c4e,_0x38c429['options']);var _0x1b4d50={'where':_0x486c4e[_0xf1b7('0x33')]};return db[_0xf1b7('0x24')][_0xf1b7('0x17')](_0x1b4d50)[_0xf1b7('0x1c')](function(_0x27593e){_0x587f4f[_0xf1b7('0x17')]=_0x27593e;if(_0x38c429[_0xf1b7('0x2a')][_0xf1b7('0x38')]){_0x486c4e[_0xf1b7('0x39')]=[{'all':!![]}];}return db[_0xf1b7('0x24')][_0xf1b7('0x3a')](_0x486c4e);})[_0xf1b7('0x1c')](function(_0x53c214){_0x587f4f['rows']=_0x53c214;return _0x587f4f;})[_0xf1b7('0x1c')](respondWithFilteredResult(_0x39d9d2,_0x486c4e))['catch'](handleError(_0x39d9d2,null));};exports[_0xf1b7('0x3b')]=function(_0x104b06,_0x3b8924){var _0x5901aa={'raw':![],'where':{'id':_0x104b06[_0xf1b7('0x3c')]['id']}},_0x505d92={};_0x505d92['model']=_[_0xf1b7('0x2b')](db['VoiceMusicOnHold'][_0xf1b7('0x25')]);_0x505d92[_0xf1b7('0x2a')]=_[_0xf1b7('0x2b')](_0x104b06['query']);_0x505d92[_0xf1b7('0x2c')]=_[_0xf1b7('0x2d')](_0x505d92[_0xf1b7('0x29')],_0x505d92[_0xf1b7('0x2a')]);_0x5901aa[_0xf1b7('0x2e')]=_[_0xf1b7('0x2d')](_0x505d92[_0xf1b7('0x29')],qs[_0xf1b7('0x3d')](_0x104b06['query'][_0xf1b7('0x3d')]));_0x5901aa[_0xf1b7('0x2e')]=_0x5901aa[_0xf1b7('0x2e')][_0xf1b7('0x3e')]?_0x5901aa[_0xf1b7('0x2e')]:_0x505d92[_0xf1b7('0x29')];if(_0x104b06[_0xf1b7('0x2a')][_0xf1b7('0x38')]){_0x5901aa[_0xf1b7('0x39')]=[{'all':!![]}];}_0x5901aa=_[_0xf1b7('0x35')]({},_0x5901aa,_0x104b06[_0xf1b7('0x3f')]);return db[_0xf1b7('0x24')][_0xf1b7('0x40')](_0x5901aa)['then'](handleEntityNotFound(_0x3b8924,null))['then'](respondWithResult(_0x3b8924,null))[_0xf1b7('0x41')](handleError(_0x3b8924,null));};exports[_0xf1b7('0x42')]=function(_0x2b64d3,_0x143ade){if(_0x2b64d3[_0xf1b7('0x43')]['id']){delete _0x2b64d3[_0xf1b7('0x43')]['id'];}return db['VoiceMusicOnHold'][_0xf1b7('0x40')]({'where':{'id':_0x2b64d3['params']['id']}})[_0xf1b7('0x1c')](handleEntityNotFound(_0x143ade,null))[_0xf1b7('0x1c')](saveUpdates(_0x2b64d3[_0xf1b7('0x43')],null))[_0xf1b7('0x1c')](respondWithResult(_0x143ade,null))[_0xf1b7('0x41')](handleError(_0x143ade,null));};exports[_0xf1b7('0x44')]=function(_0x285ad0,_0x2417e2,_0x5f060){return db[_0xf1b7('0x45')]['transaction'](function(_0x2f5bd4){if(_0x285ad0['body'][_0xf1b7('0x46')]===_0xf1b7('0x47')){_0x285ad0[_0xf1b7('0x43')][_0xf1b7('0x48')]=path[_0xf1b7('0x49')](config[_0xf1b7('0x4a')],'server/files/moh',_0x285ad0[_0xf1b7('0x43')][_0xf1b7('0x21')]);}return db['VoiceMusicOnHold'][_0xf1b7('0x44')](_0x285ad0[_0xf1b7('0x43')],{'transaction':_0x2f5bd4})[_0xf1b7('0x1c')](function(_0x3a9503){if(_0x285ad0[_0xf1b7('0x43')][_0xf1b7('0x46')]===_0xf1b7('0x47')){fs[_0xf1b7('0x4b')](_0x3a9503[_0xf1b7('0x48')],parseInt(_0xf1b7('0x4c'),0x8));}var _0x3caaa=_0x285ad0[_0xf1b7('0x4d')][_0xf1b7('0x1d')]({'plain':!![]});if(!_0x3caaa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3caaa['role']===_0xf1b7('0x4d')){var _0x171776=_0x3a9503['get']({'plain':!![]});return db[_0xf1b7('0x4e')][_0xf1b7('0x40')]({'where':{'name':_0xf1b7('0x1e'),'userProfileId':_0x3caaa[_0xf1b7('0x4f')]},'raw':!![]})[_0xf1b7('0x1c')](function(_0x348049){if(_0x348049&&_0x348049[_0xf1b7('0x50')]===0x0){return db[_0xf1b7('0x51')][_0xf1b7('0x44')]({'name':_0x171776['name'],'resourceId':_0x171776['id'],'type':_0x348049[_0xf1b7('0x21')],'sectionId':_0x348049['id']},{})['then'](function(){return _0x3a9503;});}else{return _0x3a9503;}})[_0xf1b7('0x41')](function(_0x2a1f58){logger[_0xf1b7('0x1f')](_0xf1b7('0x52'),_0x2a1f58);});}return _0x3a9503;});})[_0xf1b7('0x1c')](respondWithResult(_0x2417e2,0xc9))[_0xf1b7('0x41')](handleError(_0x2417e2,null));};exports['destroy']=function(_0x40e161,_0x340037,_0x70099b){var _0x58f1ad;return db[_0xf1b7('0x24')][_0xf1b7('0x40')]({'where':{'id':_0x40e161[_0xf1b7('0x3c')]['id']}})[_0xf1b7('0x1c')](function(_0x424103){if(_0x424103){return db[_0xf1b7('0x45')][_0xf1b7('0x53')](function(_0x54a60c){return _0x424103[_0xf1b7('0x54')]({'transaction':_0x54a60c,'raw':!![]})[_0xf1b7('0x1c')](function(_0x3e660b){if(_0x3e660b['directory']){fs[_0xf1b7('0x55')](_0x3e660b[_0xf1b7('0x48')])[_0xf1b7('0x56')](function(_0x186635){fs[_0xf1b7('0x57')](path[_0xf1b7('0x49')](_0x3e660b[_0xf1b7('0x48')],_0x186635));});fs[_0xf1b7('0x58')](_0x3e660b[_0xf1b7('0x48')]);}return _0x3e660b;});})[_0xf1b7('0x41')](function(_0xb10d05){throw new db['Sequelize'][(_0xf1b7('0x59'))](_0xb10d05['message']);});}})[_0xf1b7('0x1c')](handleEntityNotFound(_0x340037,null))['then'](removeEntity(_0x340037,null))['catch'](handleError(_0x340037,null));};exports['addSound']=function(_0xee5e5,_0x2ad777,_0x438d56){return db[_0xf1b7('0x45')]['transaction'](function(_0x16072f){var _0xe6cd53;return db[_0xf1b7('0x24')][_0xf1b7('0x40')]({'where':{'id':_0xee5e5[_0xf1b7('0x3c')]['id']}})[_0xf1b7('0x1c')](function(_0x23d886){if(_0x23d886){_0xe6cd53=_0x23d886;return _0x23d886['addSound'](_0xee5e5[_0xf1b7('0x43')]['id'],{'transaction':_0x16072f});}})[_0xf1b7('0x1c')](function(_0x4d7dbf){if(_0x4d7dbf){return db[_0xf1b7('0x5a')][_0xf1b7('0x5b')]({'where':{'id':_0xee5e5[_0xf1b7('0x43')]['id']},'attributes':['id',_0xf1b7('0x21'),_0xf1b7('0x5c'),_0xf1b7('0x5d'),_0xf1b7('0x5e')],'raw':!![]});}})[_0xf1b7('0x1c')](function(_0x3e2513){if(_0x3e2513){var _0x2c5faa=path[_0xf1b7('0x49')](config[_0xf1b7('0x4a')],_0xf1b7('0x5f'),util['format']('%s.%s',path['basename'](_0x3e2513[_0xf1b7('0x5c')],path[_0xf1b7('0x60')](_0x3e2513[_0xf1b7('0x5c')])),_0x3e2513[_0xf1b7('0x5d')]));var _0x3771fd=path[_0xf1b7('0x49')](config[_0xf1b7('0x4a')],'server/files/moh',_0xe6cd53[_0xf1b7('0x21')],util[_0xf1b7('0x61')](_0xf1b7('0x62'),_0x3e2513[_0xf1b7('0x21')],_0x3e2513[_0xf1b7('0x5d')]));fs['symlinkSync'](_0x2c5faa,_0x3771fd);return _0x3e2513;}})[_0xf1b7('0x41')](function(_0xdf1ce6){throw new db[(_0xf1b7('0x63'))]['ValidationError'](_0xdf1ce6[_0xf1b7('0x64')]);});})[_0xf1b7('0x1c')](handleEntityNotFound(_0x2ad777,null))['then'](respondWithResult(_0x2ad777,0xc9))[_0xf1b7('0x41')](handleError(_0x2ad777,null));};exports[_0xf1b7('0x65')]=function(_0x27dfc9,_0x3051dc,_0x482211){return db['sequelize'][_0xf1b7('0x53')](function(_0x4efe5b){var _0x14f312;return db[_0xf1b7('0x24')][_0xf1b7('0x5b')]({'where':{'id':_0x27dfc9[_0xf1b7('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3051dc,null))[_0xf1b7('0x1c')](function(_0x1aa7d2){if(_0x1aa7d2){_0x14f312=_0x1aa7d2;return _0x1aa7d2[_0xf1b7('0x65')](_0x27dfc9['params']['id2']);}})[_0xf1b7('0x1c')](function(_0x1357a9){if(_0x1357a9){return db[_0xf1b7('0x5a')][_0xf1b7('0x5b')]({'where':{'id':_0x27dfc9[_0xf1b7('0x3c')][_0xf1b7('0x66')]},'attributes':['id',_0xf1b7('0x21'),_0xf1b7('0x5c'),_0xf1b7('0x5d'),'createdAt'],'raw':!![]});}})[_0xf1b7('0x1c')](function(_0x7ef80){if(_0x7ef80){fs[_0xf1b7('0x57')](path[_0xf1b7('0x49')](_0x14f312['directory'],util[_0xf1b7('0x61')](_0xf1b7('0x62'),_0x7ef80[_0xf1b7('0x21')],_0x7ef80[_0xf1b7('0x5d')])));return _0x7ef80;}})[_0xf1b7('0x41')](function(_0x29b1af){throw new db[(_0xf1b7('0x63'))]['ValidationError'](_0x29b1af[_0xf1b7('0x64')]);});})[_0xf1b7('0x1c')](handleEntityNotFound(_0x3051dc,null))['then'](respondWithStatusCode(_0x3051dc,0xcc))[_0xf1b7('0x41')](handleError(_0x3051dc,null));};exports[_0xf1b7('0x67')]=function(_0x48dfcc,_0x5cd947,_0x36c1e3){var _0x4bf1c3={};var _0x113bd3={};var _0x159612;var _0x534d17;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x48dfcc[_0xf1b7('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5cd947,null))[_0xf1b7('0x1c')](function(_0x3af04f){if(_0x3af04f){_0x159612=_0x3af04f;_0x113bd3[_0xf1b7('0x29')]=_[_0xf1b7('0x2b')](db[_0xf1b7('0x5a')][_0xf1b7('0x25')]);_0x113bd3['query']=_[_0xf1b7('0x2b')](_0x48dfcc[_0xf1b7('0x2a')]);_0x113bd3[_0xf1b7('0x2c')]=_[_0xf1b7('0x2d')](_0x113bd3[_0xf1b7('0x29')],_0x113bd3[_0xf1b7('0x2a')]);_0x4bf1c3[_0xf1b7('0x2e')]=_[_0xf1b7('0x2d')](_0x113bd3[_0xf1b7('0x29')],qs[_0xf1b7('0x3d')](_0x48dfcc[_0xf1b7('0x2a')][_0xf1b7('0x3d')]));_0x4bf1c3[_0xf1b7('0x2e')]=_0x4bf1c3[_0xf1b7('0x2e')][_0xf1b7('0x3e')]?_0x4bf1c3['attributes']:_0x113bd3[_0xf1b7('0x29')];_0x4bf1c3[_0xf1b7('0x31')]=qs['sort'](_0x48dfcc[_0xf1b7('0x2a')][_0xf1b7('0x32')]);_0x4bf1c3['where']=qs[_0xf1b7('0x2c')](_[_0xf1b7('0x34')](_0x48dfcc[_0xf1b7('0x2a')],_0x113bd3[_0xf1b7('0x2c')]));if(_0x48dfcc[_0xf1b7('0x2a')][_0xf1b7('0x37')]){_0x4bf1c3[_0xf1b7('0x33')]=_[_0xf1b7('0x35')](_0x4bf1c3[_0xf1b7('0x33')],{'$or':_[_0xf1b7('0x23')](_0x4bf1c3[_0xf1b7('0x2e')],function(_0xa2df4){var _0x354c88={};_0x354c88[_0xa2df4]={'$like':'%'+_0x48dfcc[_0xf1b7('0x2a')][_0xf1b7('0x37')]+'%'};return _0x354c88;})});}_0x4bf1c3=_[_0xf1b7('0x35')]({},_0x4bf1c3,_0x48dfcc['options']);return _0x159612[_0xf1b7('0x67')](_0x4bf1c3);}})[_0xf1b7('0x1c')](function(_0x121829){if(_0x121829){_0x534d17=_0x121829['length'];if(!_0x48dfcc[_0xf1b7('0x2a')][_0xf1b7('0x2f')]('nolimit')){_0x4bf1c3[_0xf1b7('0x30')]=qs[_0xf1b7('0x30')](_0x48dfcc[_0xf1b7('0x2a')][_0xf1b7('0x30')]);_0x4bf1c3[_0xf1b7('0x16')]=qs[_0xf1b7('0x16')](_0x48dfcc['query'][_0xf1b7('0x16')]);}return _0x159612['getSounds'](_0x4bf1c3);}})[_0xf1b7('0x1c')](function(_0x4afcd4){if(_0x4afcd4){return _0x4afcd4?{'count':_0x534d17,'rows':_0x4afcd4}:null;}})[_0xf1b7('0x1c')](respondWithResult(_0x5cd947,null))[_0xf1b7('0x41')](handleError(_0x5cd947,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 4badf6d..ee7ffa2 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 _0x72b3=['request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','api','moment','bluebird'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x72b3,0x1ca));var _0x372b=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x72b3[_0x2f3ecd];return _0xffdc44;};'use strict';var _=require(_0x372b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x372b('0x1'));var moment=require(_0x372b('0x2'));var BPromise=require(_0x372b('0x3'));var rp=require(_0x372b('0x4'));var fs=require('fs');var path=require(_0x372b('0x5'));var rimraf=require('rimraf');var config=require(_0x372b('0x6'));var attributes=require(_0x372b('0x7'));module[_0x372b('0x8')]=function(_0x2876ed,_0x45fd57){return _0x2876ed[_0x372b('0x9')](_0x372b('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74c9=['define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x4d5ff1,_0x4c00c9){var _0x1a0cca=function(_0x505d9f){while(--_0x505d9f){_0x4d5ff1['push'](_0x4d5ff1['shift']());}};_0x1a0cca(++_0x4c00c9);}(_0x74c9,0xc6));var _0x974c=function(_0x5f4b23,_0x3fe8ff){_0x5f4b23=_0x5f4b23-0x0;var _0x58b0bc=_0x74c9[_0x5f4b23];return _0x58b0bc;};'use strict';var _=require('lodash');var util=require(_0x974c('0x0'));var logger=require(_0x974c('0x1'))(_0x974c('0x2'));var moment=require(_0x974c('0x3'));var BPromise=require(_0x974c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x974c('0x5'));var rimraf=require(_0x974c('0x6'));var config=require(_0x974c('0x7'));var attributes=require(_0x974c('0x8'));module[_0x974c('0x9')]=function(_0x38c9d4,_0x5dbe51){return _0x38c9d4[_0x974c('0xa')](_0x974c('0xb'),attributes,{'tableName':_0x974c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 5f9e461..9f3488b 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x38d186,_0x282825){var _0x467447=function(_0x4cb5c0){while(--_0x4cb5c0){_0x38d186['push'](_0x38d186['shift']());}};_0x467447(++_0x282825);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1b3d58,_0xe87ec9){var _0x1387b9=function(_0x782670){while(--_0x782670){_0x1b3d58['push'](_0x1b3d58['shift']());}};_0x1387b9(++_0xe87ec9);}(_0x34e8,0x12c));var _0x834e=function(_0x3dd15d,_0x340b28){_0x3dd15d=_0x3dd15d-0x0;var _0x41520c=_0x34e8[_0x3dd15d];return _0x41520c;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 51ccab2..0320d71 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 _0xc569=['addTeams','put','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAgents','/:id/teams','getTeams','post','create','/:id/users'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xc569,0x159));var _0x9c56=function(_0x48218c,_0xf8408f){_0x48218c=_0x48218c-0x0;var _0x1b1863=_0xc569[_0x48218c];return _0x1b1863;};'use strict';var multer=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var path=require(_0x9c56('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c56('0x3'));var router=express[_0x9c56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c56('0x5'));var interaction=require(_0x9c56('0x6'));var config=require(_0x9c56('0x7'));var controller=require('./voicePrefix.controller');router[_0x9c56('0x8')]('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0xa')]);router[_0x9c56('0x8')]('/describe',auth[_0x9c56('0x9')](),controller[_0x9c56('0xb')]);router[_0x9c56('0x8')](_0x9c56('0xc'),auth[_0x9c56('0x9')](),controller['show']);router['get']('/:id/users',auth[_0x9c56('0x9')](),controller[_0x9c56('0xd')]);router['get'](_0x9c56('0xe'),auth['isAuthenticated'](),controller[_0x9c56('0xf')]);router[_0x9c56('0x10')]('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0x11')]);router[_0x9c56('0x10')](_0x9c56('0x12'),auth[_0x9c56('0x9')](),controller['addAgents']);router[_0x9c56('0x10')](_0x9c56('0xe'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x13')]);router[_0x9c56('0x14')]('/:id',auth[_0x9c56('0x9')](),controller['update']);router[_0x9c56('0x15')](_0x9c56('0xc'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x16')]);router[_0x9c56('0x15')](_0x9c56('0x12'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x17')]);router[_0x9c56('0x15')](_0x9c56('0xe'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x18')]);module[_0x9c56('0x19')]=router; \ No newline at end of file +var _0xf698=['post','create','addAgents','addTeams','update','destroy','removeAgents','delete','/:id/teams','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/users','getAgents'];(function(_0x4d5396,_0x57af1b){var _0x33a4bb=function(_0x1e5743){while(--_0x1e5743){_0x4d5396['push'](_0x4d5396['shift']());}};_0x33a4bb(++_0x57af1b);}(_0xf698,0x1de));var _0x8f69=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xf698[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var fs_extra=require(_0x8f69('0x4'));var auth=require(_0x8f69('0x5'));var interaction=require(_0x8f69('0x6'));var config=require(_0x8f69('0x7'));var controller=require('./voicePrefix.controller');router[_0x8f69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xb')]);router[_0x8f69('0x8')](_0x8f69('0xc'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xd')]);router[_0x8f69('0x8')](_0x8f69('0xe'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xf')]);router[_0x8f69('0x8')]('/:id/teams',auth[_0x8f69('0xa')](),controller['getTeams']);router[_0x8f69('0x10')]('/',auth['isAuthenticated'](),controller[_0x8f69('0x11')]);router['post'](_0x8f69('0xe'),auth[_0x8f69('0xa')](),controller[_0x8f69('0x12')]);router['post']('/:id/teams',auth[_0x8f69('0xa')](),controller[_0x8f69('0x13')]);router['put'](_0x8f69('0xc'),auth[_0x8f69('0xa')](),controller[_0x8f69('0x14')]);router['delete'](_0x8f69('0xc'),auth[_0x8f69('0xa')](),controller[_0x8f69('0x15')]);router['delete'](_0x8f69('0xe'),auth[_0x8f69('0xa')](),controller[_0x8f69('0x16')]);router[_0x8f69('0x17')](_0x8f69('0x18'),auth[_0x8f69('0xa')](),controller['removeTeams']);module[_0x8f69('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d8a5d53..7cb0673 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 _0x4694=['STRING','name','system-','INTEGER','sequelize','exports'];(function(_0x2878cd,_0x1b7041){var _0x575647=function(_0x266ea6){while(--_0x266ea6){_0x2878cd['push'](_0x2878cd['shift']());}};_0x575647(++_0x1b7041);}(_0x4694,0xfa));var _0x4469=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x4694[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x4469('0x0'));module[_0x4469('0x1')]={'name':{'type':Sequelize[_0x4469('0x2')],'allowNull':![],'unique':_0x4469('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x208e4a){return _0x4469('0x4')+this['getDataValue'](_0x4469('0x3'))+'-';}},'description':{'type':Sequelize[_0x4469('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x4469('0x5')]}}; \ No newline at end of file +var _0x2219=['sequelize','exports','system-','getDataValue','name','STRING','INTEGER'];(function(_0x31e2cd,_0x4c05ba){var _0x48af4e=function(_0x270bdd){while(--_0x270bdd){_0x31e2cd['push'](_0x31e2cd['shift']());}};_0x48af4e(++_0x4c05ba);}(_0x2219,0xf5));var _0x9221=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x2219[_0x575a38];return _0x5a7bdd;};'use strict';var Sequelize=require(_0x9221('0x0'));module[_0x9221('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f7419){return _0x9221('0x2')+this[_0x9221('0x3')](_0x9221('0x4'))+'-';}},'description':{'type':Sequelize[_0x9221('0x5')]},'callerIdAll':{'type':Sequelize[_0x9221('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x9221('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5dbf261..04804f0 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 _0xd4f4=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voicePrefix.socket','register','sendStatus','end','status','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','options','includeAll','include','VoicePrefix','rows','catch','show','keys','find','params','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','length','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','Team','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x480fe1,_0x231356){var _0x51a745=function(_0x5ea9c3){while(--_0x5ea9c3){_0x480fe1['push'](_0x480fe1['shift']());}};_0x51a745(++_0x231356);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4e8532,_0x1cd172){_0x4e8532=_0x4e8532-0x0;var _0x176be1=_0xd4f4[_0x4e8532];return _0x176be1;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4d4f('0x1d')],{'host':_0x4d4f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x1d')]));require(_0x4d4f('0x1f'))[_0x4d4f('0x20')](socket);function respondWithStatusCode(_0x59252c,_0x145804){_0x145804=_0x145804||0xcc;return function(_0x2e736b){if(_0x2e736b){return _0x59252c[_0x4d4f('0x21')](_0x145804);}return _0x59252c['status'](_0x145804)[_0x4d4f('0x22')]();};}function respondWithResult(_0x5e4ff5,_0x18a528){_0x18a528=_0x18a528||0xc8;return function(_0x16f8e7){if(_0x16f8e7){return _0x5e4ff5[_0x4d4f('0x23')](_0x18a528)['json'](_0x16f8e7);}};}function respondWithFilteredResult(_0x30b6b1,_0x17a437){return function(_0x51dcf1){if(_0x51dcf1){var _0x5dbbeb=typeof _0x17a437['offset']==='undefined'&&typeof _0x17a437['limit']===_0x4d4f('0x24');var _0x15100a=_0x51dcf1[_0x4d4f('0x25')];var _0x3566a5=_0x5dbbeb?0x0:_0x17a437['offset'];var _0x5b2863=_0x5dbbeb?_0x51dcf1[_0x4d4f('0x25')]:_0x17a437['offset']+_0x17a437[_0x4d4f('0x26')];var _0x1e3e9a;if(_0x5b2863>=_0x15100a){_0x5b2863=_0x15100a;_0x1e3e9a=0xc8;}else{_0x1e3e9a=0xce;}_0x30b6b1[_0x4d4f('0x23')](_0x1e3e9a);return _0x30b6b1[_0x4d4f('0x27')](_0x4d4f('0x28'),_0x3566a5+'-'+_0x5b2863+'/'+_0x15100a)['json'](_0x51dcf1);}return null;};}function patchUpdates(_0x570520){return function(_0x4043f2){try{jsonpatch['apply'](_0x4043f2,_0x570520,!![]);}catch(_0x247077){return BPromise[_0x4d4f('0x29')](_0x247077);}return _0x4043f2[_0x4d4f('0x2a')]();};}function saveUpdates(_0x3f4a55,_0xf3f7a4){return function(_0x497cec){if(_0x497cec){return _0x497cec[_0x4d4f('0x2b')](_0x3f4a55)[_0x4d4f('0x2c')](function(_0x1cf365){return _0x1cf365;});}return null;};}function removeEntity(_0x28443b,_0x5cf9e7){return function(_0x51a7c5){if(_0x51a7c5){return _0x51a7c5[_0x4d4f('0x2d')]()[_0x4d4f('0x2c')](function(){var _0xa2492c=_0x51a7c5[_0x4d4f('0x2e')]({'plain':!![]});var _0x58acbe=_0x4d4f('0x2f');return db[_0x4d4f('0x30')][_0x4d4f('0x2d')]({'where':{'type':_0x58acbe,'resourceId':_0xa2492c['id']}})[_0x4d4f('0x2c')](function(){return _0x51a7c5;});})['then'](function(){_0x28443b[_0x4d4f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1688bb,_0x333a40){return function(_0x550040){if(!_0x550040){_0x1688bb[_0x4d4f('0x21')](0x194);}return _0x550040;};}function handleError(_0x123383,_0x287a09){_0x287a09=_0x287a09||0x1f4;return function(_0x3d7f14){logger[_0x4d4f('0x31')](_0x3d7f14[_0x4d4f('0x32')]);if(_0x3d7f14['name']){delete _0x3d7f14[_0x4d4f('0x33')];}_0x123383[_0x4d4f('0x23')](_0x287a09)[_0x4d4f('0x34')](_0x3d7f14);};}exports[_0x4d4f('0x35')]=function(_0x104104,_0x4e47e5){var _0x2d6565={},_0x486e33={},_0x35f9e2={'count':0x0,'rows':[]};var _0x537a47=_['map'](db['VoicePrefix'][_0x4d4f('0x36')],function(_0x57fc2b){return{'name':_0x57fc2b[_0x4d4f('0x37')],'type':_0x57fc2b[_0x4d4f('0x38')][_0x4d4f('0x39')]};});_0x486e33['model']=_[_0x4d4f('0x3a')](_0x537a47,_0x4d4f('0x33'));_0x486e33[_0x4d4f('0x3b')]=_['keys'](_0x104104[_0x4d4f('0x3b')]);_0x486e33['filters']=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],_0x486e33[_0x4d4f('0x3b')]);_0x2d6565[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x104104[_0x4d4f('0x3b')]['fields']));_0x2d6565['attributes']=_0x2d6565[_0x4d4f('0x3e')]['length']?_0x2d6565['attributes']:_0x486e33[_0x4d4f('0x3d')];if(!_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x40')](_0x4d4f('0x41'))){_0x2d6565[_0x4d4f('0x26')]=qs['limit'](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2d6565['offset']=qs[_0x4d4f('0x42')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}_0x2d6565[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x44')]);_0x2d6565[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_['pick'](_0x104104['query'],_0x486e33[_0x4d4f('0x46')]),_0x537a47);if(_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x47')]){_0x2d6565[_0x4d4f('0x45')]=_['merge'](_0x2d6565['where'],{'$or':_[_0x4d4f('0x3a')](_0x537a47,function(_0x3c34bd){if(_0x3c34bd['type']!=='VIRTUAL'){var _0x3591b7={};_0x3591b7[_0x3c34bd[_0x4d4f('0x33')]]={'$like':'%'+_0x104104['query'][_0x4d4f('0x47')]+'%'};return _0x3591b7;}})});}_0x2d6565=_[_0x4d4f('0x48')]({},_0x2d6565,_0x104104[_0x4d4f('0x49')]);var _0x32c6ff={'where':_0x2d6565[_0x4d4f('0x45')]};return db['VoicePrefix'][_0x4d4f('0x25')](_0x32c6ff)['then'](function(_0x45a0c1){_0x35f9e2[_0x4d4f('0x25')]=_0x45a0c1;if(_0x104104['query'][_0x4d4f('0x4a')]){_0x2d6565[_0x4d4f('0x4b')]=[{'all':!![]}];}return db[_0x4d4f('0x4c')]['findAll'](_0x2d6565);})[_0x4d4f('0x2c')](function(_0x48caa2){_0x35f9e2[_0x4d4f('0x4d')]=_0x48caa2;return _0x35f9e2;})['then'](respondWithFilteredResult(_0x4e47e5,_0x2d6565))[_0x4d4f('0x4e')](handleError(_0x4e47e5,null));};exports[_0x4d4f('0x4f')]=function(_0x231134,_0x2939cb){var _0x198c3a={'raw':![],'where':{'id':_0x231134['params']['id']}},_0x4a53e4={};_0x4a53e4[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x4c')][_0x4d4f('0x36')]);_0x4a53e4['query']=_['keys'](_0x231134['query']);_0x4a53e4[_0x4d4f('0x46')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],_0x4a53e4[_0x4d4f('0x3b')]);_0x198c3a[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x231134[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x198c3a[_0x4d4f('0x3e')]=_0x198c3a[_0x4d4f('0x3e')]['length']?_0x198c3a[_0x4d4f('0x3e')]:_0x4a53e4[_0x4d4f('0x3d')];if(_0x231134['query'][_0x4d4f('0x4a')]){_0x198c3a['include']=[{'all':!![]}];}_0x198c3a=_[_0x4d4f('0x48')]({},_0x198c3a,_0x231134[_0x4d4f('0x49')]);return db['VoicePrefix'][_0x4d4f('0x51')](_0x198c3a)[_0x4d4f('0x2c')](handleEntityNotFound(_0x2939cb,null))[_0x4d4f('0x2c')](respondWithResult(_0x2939cb,null))[_0x4d4f('0x4e')](handleError(_0x2939cb,null));};exports[_0x4d4f('0x2d')]=function(_0x3eae74,_0x11a63e){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x3eae74[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x11a63e,null))[_0x4d4f('0x2c')](removeEntity(_0x11a63e,null))['catch'](handleError(_0x11a63e,null));};exports[_0x4d4f('0x53')]=function(_0x539088,_0x59d245){return db['VoicePrefix'][_0x4d4f('0x53')]()[_0x4d4f('0x2c')](respondWithResult(_0x59d245,null))['catch'](handleError(_0x59d245,null));};exports['create']=function(_0x2a3bc4,_0x4c80c4){var _0x5adc7b;return db[_0x4d4f('0x54')]['transaction'](function(_0x17b59e){return db[_0x4d4f('0x4c')][_0x4d4f('0x55')](_0x2a3bc4[_0x4d4f('0x56')],{'transaction':_0x17b59e})['then'](function(_0x224b83){_0x5adc7b=_0x224b83[_0x4d4f('0x2e')]({'plain':!![]});return db[_0x4d4f('0x57')][_0x4d4f('0x51')]({'where':{'id':_0x5adc7b[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x10f94e){return createVoicePrefixExtensions(_0x5adc7b,_0x10f94e,_0x17b59e);});});})['then'](function(){var _0x32cba6=_0x2a3bc4['user'][_0x4d4f('0x2e')]({'plain':!![]});if(!_0x32cba6)throw new Error(_0x4d4f('0x59'));if(_0x32cba6['role']===_0x4d4f('0x5a')){var _0x1d8ae6=_0x5adc7b;return db['UserProfileSection'][_0x4d4f('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0x32cba6[_0x4d4f('0x5b')]},'raw':!![]})['then'](function(_0x48ad06){if(_0x48ad06&&_0x48ad06[_0x4d4f('0x5c')]===0x0){return db[_0x4d4f('0x30')][_0x4d4f('0x55')]({'name':_0x1d8ae6[_0x4d4f('0x33')],'resourceId':_0x1d8ae6['id'],'type':_0x48ad06[_0x4d4f('0x33')],'sectionId':_0x48ad06['id']},{})['then'](function(){return _0x5adc7b;});}else{return _0x5adc7b;}})['catch'](function(_0xeaccdd){logger['error'](_0x4d4f('0x5d'),_0xeaccdd);throw _0xeaccdd;});}return _0x5adc7b;})[_0x4d4f('0x2c')](respondWithResult(_0x4c80c4,null))[_0x4d4f('0x4e')](handleError(_0x4c80c4,null));};function Extension(_0x4585b5,_0x31aba3,_0x39ae15,_0x585764){this[_0x4d4f('0x5e')]=_0x4d4f('0x5f');this[_0x4d4f('0x60')]=_0x4585b5;this['app']=_0x39ae15;this[_0x4d4f('0x38')]=_0x4d4f('0x61');this[_0x4d4f('0x62')]='Voice\x20Prefix\x20Extension';this[_0x4d4f('0x63')]=_0x31aba3;this['appdata']=_0x585764;}function createVoicePrefixExtensions(_0xcdab8b,_0x2145ca,_0x1fe5ca){return new BPromise(function(_0xe8d3e2,_0x1edb3d){var _0x2e55f5=new Extension(formatPrefixName(_0xcdab8b[_0x4d4f('0x64')]),0x1,_0x4d4f('0x65'),_0x4d4f('0x66'));_0x2e55f5['VoicePrefixId']=_0xcdab8b['id'];return db[_0x4d4f('0x57')][_0x4d4f('0x55')](_0x2e55f5,{'transaction':_0x1fe5ca})['then'](function(_0x1bd4b1){var _0x2a3738=_0x1bd4b1[_0x4d4f('0x2e')]({'plain':!![]});var _0xae8fe=_['map'](addVoicePrefixExtensions(_0xcdab8b,_0x2145ca),function(_0x4013a9){_0x4013a9[_0x4d4f('0x58')]=_0x2a3738['id'];_0x4013a9['VoicePrefixId']=_0xcdab8b['id'];return _0x4013a9;});return db['VoiceExtension'][_0x4d4f('0x67')](_0xae8fe,{'transaction':_0x1fe5ca})[_0x4d4f('0x2c')](function(_0x53b2db){if(!_0x53b2db){return _0x1edb3d('Extensions\x20creation\x20failed');}else{return _0xe8d3e2(_0x53b2db);}})['catch'](function(_0x4752bd){return _0x1edb3d(_0x4752bd);});});;});};function addVoicePrefixExtensions(_0x351fb5,_0x5e0ead){var _0x347bb1=[];var _0xc596ea=formatPrefixName(_0x351fb5[_0x4d4f('0x64')]);_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x2,_0x4d4f('0x69'),_0x4d4f('0x6a')+_0x351fb5[_0x4d4f('0x33')]));if(_0x351fb5[_0x4d4f('0x6b')]){_0x347bb1['push'](new Extension(_0xc596ea,0x3,_0x4d4f('0x69'),'PREFIX-CALLERIDALL='+_0x351fb5[_0x4d4f('0x6b')]));}else{_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x3,_0x4d4f('0x65'),'No\x20callerid\x20available'));}_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x4,_0x4d4f('0x6c'),_0x5e0ead[_0x4d4f('0x5e')]+','+_0x4d4f('0x6d')+(0x8+_0x351fb5['name'][_0x4d4f('0x6e')])+'}'+','+0x1));return _0x347bb1;}function formatPrefixName(_0x4bf7bd){var _0x268b34='_';for(var _0x50d0da=0x0;_0x50d0da<_0x4bf7bd['length'];_0x50d0da++){if(_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da)=='-'){_0x268b34+=_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da);}else{_0x268b34+='['+_0x4bf7bd['charAt'](_0x50d0da)+']';}}_0x268b34+='.';return _0x268b34;}exports[_0x4d4f('0x2b')]=function(_0x53a18b,_0x41ffe7,_0x4420f0){var _0x111c01=_0x53a18b[_0x4d4f('0x56')];_0x111c01['prefix']=_0x4d4f('0x70')+_0x111c01[_0x4d4f('0x33')]+'-';return db[_0x4d4f('0x54')]['transaction'](function(_0x781877){return db[_0x4d4f('0x4c')][_0x4d4f('0x2b')](_0x111c01,{'where':{'id':_0x111c01['id']},'transaction':_0x781877})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x57')][_0x4d4f('0x2d')]({'where':{'VoicePrefixId':_0x111c01['id']},'transaction':_0x781877})['then'](function(){return db['VoiceExtension'][_0x4d4f('0x51')]({'where':{'id':_0x111c01[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x26ed6f){return createVoicePrefixExtensions(_0x111c01,_0x26ed6f,_0x781877);});});});})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x4c')][_0x4d4f('0x71')](_0x111c01['id']);})[_0x4d4f('0x2c')](respondWithResult(_0x41ffe7,null))[_0x4d4f('0x4e')](handleError(_0x41ffe7,null));};exports[_0x4d4f('0x72')]=function(_0x1c764b,_0x302cde,_0x44f0c2){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x1c764b[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x302cde,null))[_0x4d4f('0x2c')](function(_0x518252){if(_0x518252){return _0x518252[_0x4d4f('0x72')](_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')],_[_0x4d4f('0x74')](_0x1c764b['body'],['ids','id'])||{})[_0x4d4f('0x75')](function(_0x3c8a64){for(var _0x4736db=0x0;_0x4736db<_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x4736db+=0x1){socket[_0x4d4f('0x76')](_0x4d4f('0x77'),{'UserId':Number(_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4736db]),'VoicePrefixId':Number(_0x1c764b['params']['id'])});}return _0x3c8a64;});}})[_0x4d4f('0x2c')](respondWithResult(_0x302cde,null))[_0x4d4f('0x4e')](handleError(_0x302cde,null));};exports[_0x4d4f('0x78')]=function(_0x2c8c79,_0x584c53,_0x5240be){return db['VoicePrefix'][_0x4d4f('0x51')]({'where':{'id':_0x2c8c79['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x584c53,null))[_0x4d4f('0x2c')](function(_0xa63721){if(_0xa63721){return _0xa63721[_0x4d4f('0x78')](_0x2c8c79[_0x4d4f('0x3b')][_0x4d4f('0x73')])[_0x4d4f('0x2c')](function(){if(_[_0x4d4f('0x79')](_0x2c8c79['query']['ids'])){for(var _0x42c66c=0x0;_0x42c66c<_0x2c8c79['query'][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x42c66c+=0x1){socket[_0x4d4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x2c8c79['query']['ids'][_0x42c66c]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}}else{socket['emit'](_0x4d4f('0x7a'),{'UserId':Number(_0x2c8c79['query'][_0x4d4f('0x73')]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x584c53,null))[_0x4d4f('0x4e')](handleError(_0x584c53,null));};exports[_0x4d4f('0x7b')]=function(_0x1670fd,_0x548709,_0x18274e){var _0x3beacf={};var _0x4691b7={};var _0x1f62e0;var _0x328528;return db['VoicePrefix'][_0x4d4f('0x7c')]({'where':{'id':_0x1670fd['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x548709,null))[_0x4d4f('0x2c')](function(_0x2511c8){if(_0x2511c8){_0x1f62e0=_0x2511c8;_0x4691b7[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x7d')][_0x4d4f('0x36')]);_0x4691b7['query']=_[_0x4d4f('0x50')](_0x1670fd[_0x4d4f('0x3b')]);_0x4691b7[_0x4d4f('0x46')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],_0x4691b7['query']);_0x3beacf[_0x4d4f('0x3e')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x1670fd[_0x4d4f('0x3b')]['fields']));_0x3beacf[_0x4d4f('0x3e')]=_0x3beacf[_0x4d4f('0x3e')][_0x4d4f('0x6e')]?_0x3beacf[_0x4d4f('0x3e')]:_0x4691b7['model'];_0x3beacf[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x1670fd['query'][_0x4d4f('0x44')]);_0x3beacf[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x1670fd[_0x4d4f('0x3b')],_0x4691b7[_0x4d4f('0x46')]));if(_0x1670fd['query'][_0x4d4f('0x47')]){_0x3beacf[_0x4d4f('0x45')]=_['merge'](_0x3beacf[_0x4d4f('0x45')],{'$or':_[_0x4d4f('0x3a')](_0x3beacf[_0x4d4f('0x3e')],function(_0x4686b9){var _0x16d1f7={};_0x16d1f7[_0x4686b9]={'$like':'%'+_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x16d1f7;})});}_0x3beacf=_[_0x4d4f('0x48')]({},_0x3beacf,_0x1670fd['options']);return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x4dd3f6){if(_0x4dd3f6){_0x328528=_0x4dd3f6[_0x4d4f('0x6e')];if(!_0x1670fd['query'][_0x4d4f('0x40')]('nolimit')){_0x3beacf[_0x4d4f('0x26')]=qs[_0x4d4f('0x26')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x3beacf[_0x4d4f('0x42')]=qs[_0x4d4f('0x42')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x10f882){if(_0x10f882){return _0x10f882?{'count':_0x328528,'rows':_0x10f882}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x548709,null))['catch'](handleError(_0x548709,null));};exports['getTeams']=function(_0x41c81d,_0x5d6abf,_0x2208d8){var _0x2b096e={};var _0x4e6da6={};var _0x53817f;var _0x10955f;return db[_0x4d4f('0x4c')][_0x4d4f('0x7c')]({'where':{'id':_0x41c81d['params']['id']}})['then'](handleEntityNotFound(_0x5d6abf,null))[_0x4d4f('0x2c')](function(_0x274ff2){if(_0x274ff2){_0x53817f=_0x274ff2;_0x4e6da6[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db['Team'][_0x4d4f('0x36')]);_0x4e6da6[_0x4d4f('0x3b')]=_[_0x4d4f('0x50')](_0x41c81d['query']);_0x4e6da6['filters']=_[_0x4d4f('0x3c')](_0x4e6da6[_0x4d4f('0x3d')],_0x4e6da6[_0x4d4f('0x3b')]);_0x2b096e[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4e6da6['model'],qs[_0x4d4f('0x3f')](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x2b096e['attributes']=_0x2b096e[_0x4d4f('0x3e')]['length']?_0x2b096e[_0x4d4f('0x3e')]:_0x4e6da6[_0x4d4f('0x3d')];_0x2b096e[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x41c81d[_0x4d4f('0x3b')]['sort']);_0x2b096e[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x41c81d[_0x4d4f('0x3b')],_0x4e6da6['filters']));if(_0x41c81d[_0x4d4f('0x3b')]['filter']){_0x2b096e['where']=_[_0x4d4f('0x48')](_0x2b096e[_0x4d4f('0x45')],{'$or':_['map'](_0x2b096e[_0x4d4f('0x3e')],function(_0x50b0a3){var _0x1177a3={};_0x1177a3[_0x50b0a3]={'$like':'%'+_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x1177a3;})});}_0x2b096e=_[_0x4d4f('0x48')]({},_0x2b096e,_0x41c81d[_0x4d4f('0x49')]);return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})[_0x4d4f('0x2c')](function(_0x3fe348){if(_0x3fe348){_0x10955f=_0x3fe348['length'];if(!_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x40')]('nolimit')){_0x2b096e[_0x4d4f('0x26')]=qs['limit'](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2b096e[_0x4d4f('0x42')]=qs['offset'](_0x41c81d['query']['offset']);}return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})['then'](function(_0xb5d71b){if(_0xb5d71b){return _0xb5d71b?{'count':_0x10955f,'rows':_0xb5d71b}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x5d6abf,null))[_0x4d4f('0x4e')](handleError(_0x5d6abf,null));};exports['addTeams']=function(_0x5b6061,_0x230ff0,_0x28ae80){var _0x42be25=_0x5b6061[_0x4d4f('0x56')][_0x4d4f('0x73')];var _0x13279e;return db['Team'][_0x4d4f('0x80')]({'where':{'id':_0x42be25},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id',_0x4d4f('0x33'),_0x4d4f('0x82'),_0x4d4f('0x83'),_0x4d4f('0x84')],'raw':!![]}]})[_0x4d4f('0x2c')](function(_0x1a1e6f){if(_0x1a1e6f){_0x13279e=_0x1a1e6f;var _0x152400=_[_0x4d4f('0x85')](_0x1a1e6f,function(_0x3c6f1b){var _0x25e63c=_0x3c6f1b[_0x4d4f('0x2e')]({'plain':!![]});return _0x25e63c['Agents'];});return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x5b6061[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0xc01ac4){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x472938){return _0xc01ac4[_0x4d4f('0x87')](_0x42be25,{'transaction':_0x472938})['then'](function(){return BPromise[_0x4d4f('0x88')](_0x13279e,function(_0x72d583){return db[_0x4d4f('0x89')][_0x4d4f('0x8a')]({'TeamId':_0x72d583['id'],'VoicePrefixId':_0x5b6061[_0x4d4f('0x52')]['id']},{'transaction':_0x472938});});})[_0x4d4f('0x2c')](function(){return BPromise[_0x4d4f('0x88')](_0x152400,function(_0x28fd35){return db[_0x4d4f('0x8b')][_0x4d4f('0x8c')]({'where':{'UserId':_0x28fd35['id'],'VoicePrefixId':_0x5b6061['params']['id']},'transaction':_0x472938});});})['then'](function(){_0x152400[_0x4d4f('0x8d')](function(_0x8850a4){socket['emit'](_0x4d4f('0x77'),{'UserId':_0x8850a4['id'],'VoicePrefixId':_0xc01ac4['id']});});});});});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x230ff0,null))[_0x4d4f('0x4e')](handleError(_0x230ff0,null));};exports[_0x4d4f('0x8e')]=function(_0x15028c,_0x1659f6,_0x77dac1){return db[_0x4d4f('0x8f')][_0x4d4f('0x80')]({'where':{'id':_0x15028c[_0x4d4f('0x3b')][_0x4d4f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id'],'raw':!![]}]})[_0x4d4f('0x2c')](handleEntityNotFound(_0x1659f6,null))['then'](function(_0x342b63){var _0x524ed0=_[_0x4d4f('0x3a')](_0x342b63,'id');var _0x3fd499=[];var _0x17a39f=[];var _0x27b4d6=squel['select']();_0x27b4d6[_0x4d4f('0x90')](_0x4d4f('0x91'))[_0x4d4f('0x92')](_0x4d4f('0x93'),'tq')[_0x4d4f('0x94')](_0x4d4f('0x95'),'ut',_0x4d4f('0x96'))['where'](_0x4d4f('0x97'),_0x15028c[_0x4d4f('0x52')]['id']);for(var _0x2f4bad=0x0;_0x2f4bad<_0x342b63[_0x4d4f('0x6e')];_0x2f4bad+=0x1){let _0x4501b5=_0x342b63[_0x2f4bad];for(var _0x12eda1=0x0;_0x12eda1<_0x4501b5['Agents']['length'];_0x12eda1+=0x1){let _0x11ee76=_0x4501b5['Agents'][_0x12eda1];var _0x2ea6b4=_0x27b4d6[_0x4d4f('0x98')]();_0x2ea6b4['where'](_0x4d4f('0x99'),_0x11ee76['id']);_0x17a39f[_0x4d4f('0x68')](db[_0x4d4f('0x54')][_0x4d4f('0x3b')](_0x2ea6b4[_0x4d4f('0x9a')](),{'type':db[_0x4d4f('0x54')][_0x4d4f('0x9b')]['SELECT']})[_0x4d4f('0x2c')](function(_0x5d05cb){if(_0x5d05cb[_0x4d4f('0x6e')]===0x1){return _0x11ee76['id'];}else{var _0x2d1337=_['every'](_['map'](_0x5d05cb,_0x4d4f('0x9c')),function(_0x17894c){return _[_0x4d4f('0x9d')](_0x524ed0,_0x17894c);});if(_0x2d1337){return _0x11ee76['id'];}}}));}}return BPromise['all'](_0x17a39f)[_0x4d4f('0x2c')](function(_0x118642){_0x3fd499=_(_0x3fd499)[_0x4d4f('0x9e')](_0x118642)[_0x4d4f('0x9f')]()[_0x4d4f('0xa0')]();return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x15028c[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0x51e70f){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x23485f){return _0x51e70f[_0x4d4f('0x8e')](_0x15028c['query'][_0x4d4f('0x73')],{'transaction':_0x23485f})['then'](function(){if(!_['isEmpty'](_0x3fd499)){return _0x51e70f[_0x4d4f('0x78')](_0x3fd499,{'transaction':_0x23485f});}})[_0x4d4f('0x2c')](function(){_0x3fd499[_0x4d4f('0x8d')](function(_0x3de9b3){socket[_0x4d4f('0x76')](_0x4d4f('0x7a'),{'UserId':_0x3de9b3,'VoicePrefixId':_0x51e70f['id']});});});});});});})[_0x4d4f('0x2c')](respondWithStatusCode(_0x1659f6,null))[_0x4d4f('0x4e')](handleError(_0x1659f6,null));}; \ No newline at end of file +var _0xefda=['value','isEmpty','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','destroy','VoicePrefixes','then','error','stack','send','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','describe','create','transaction','body','VoiceExtensionId','user','get','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','User','getTeams','findOne','Team','addTeams','interface','flatMap','Agents','upsert','each','UserVoicePrefix','forEach','userVoicePrefix:save','removeTeams','select','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','QueryTypes','SELECT','every','TeamId','all','union','compact'];(function(_0x3eb975,_0x2e601e){var _0x4b81e6=function(_0x22c272){while(--_0x22c272){_0x3eb975['push'](_0x3eb975['shift']());}};_0x4b81e6(++_0x2e601e);}(_0xefda,0x96));var _0xaefd=function(_0x1dcd7f,_0x119674){_0x1dcd7f=_0x1dcd7f-0x0;var _0x4a4a52=_0xefda[_0x1dcd7f];return _0x4a4a52;};'use strict';var emlformat=require(_0xaefd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaefd('0x1'));var rp=require(_0xaefd('0x2'));var moment=require('moment');var BPromise=require(_0xaefd('0x3'));var Mustache=require(_0xaefd('0x4'));var util=require(_0xaefd('0x5'));var path=require(_0xaefd('0x6'));var sox=require(_0xaefd('0x7'));var csv=require(_0xaefd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaefd('0x9'));var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0x8'));var querystring=require(_0xaefd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0xf'));var as=require(_0xaefd('0x10'));var hardwareService=require(_0xaefd('0x11'));var logger=require(_0xaefd('0x12'))(_0xaefd('0x13'));var utils=require(_0xaefd('0x14'));var config=require(_0xaefd('0x15'));var licenseUtil=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];config[_0xaefd('0x18')]=_[_0xaefd('0x19')](config['redis'],{'host':_0xaefd('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaefd('0x18')]));require(_0xaefd('0x1b'))[_0xaefd('0x1c')](socket);function respondWithStatusCode(_0x43b82a,_0x4ec92a){_0x4ec92a=_0x4ec92a||0xcc;return function(_0x16e4f4){if(_0x16e4f4){return _0x43b82a[_0xaefd('0x1d')](_0x4ec92a);}return _0x43b82a[_0xaefd('0x1e')](_0x4ec92a)[_0xaefd('0x1f')]();};}function respondWithResult(_0x10ee28,_0x32f75e){_0x32f75e=_0x32f75e||0xc8;return function(_0x277070){if(_0x277070){return _0x10ee28[_0xaefd('0x1e')](_0x32f75e)['json'](_0x277070);}};}function respondWithFilteredResult(_0x9d9c29,_0x109604){return function(_0x9748f4){if(_0x9748f4){var _0x1737a1=typeof _0x109604[_0xaefd('0x20')]===_0xaefd('0x21')&&typeof _0x109604['limit']===_0xaefd('0x21');var _0x182f9a=_0x9748f4[_0xaefd('0x22')];var _0x1260dd=_0x1737a1?0x0:_0x109604[_0xaefd('0x20')];var _0x1f302c=_0x1737a1?_0x9748f4['count']:_0x109604[_0xaefd('0x20')]+_0x109604[_0xaefd('0x23')];var _0x2dcdd8;if(_0x1f302c>=_0x182f9a){_0x1f302c=_0x182f9a;_0x2dcdd8=0xc8;}else{_0x2dcdd8=0xce;}_0x9d9c29[_0xaefd('0x1e')](_0x2dcdd8);return _0x9d9c29[_0xaefd('0x24')]('Content-Range',_0x1260dd+'-'+_0x1f302c+'/'+_0x182f9a)['json'](_0x9748f4);}return null;};}function patchUpdates(_0x5b9967){return function(_0x21680a){try{jsonpatch[_0xaefd('0x25')](_0x21680a,_0x5b9967,!![]);}catch(_0x313a6f){return BPromise['reject'](_0x313a6f);}return _0x21680a[_0xaefd('0x26')]();};}function saveUpdates(_0x4cd9b2,_0x3deec8){return function(_0x3caa99){if(_0x3caa99){return _0x3caa99[_0xaefd('0x27')](_0x4cd9b2)['then'](function(_0x435413){return _0x435413;});}return null;};}function removeEntity(_0x3ffc9c,_0x18e720){return function(_0x14cc9d){if(_0x14cc9d){return _0x14cc9d[_0xaefd('0x28')]()['then'](function(){var _0x2fe27e=_0x14cc9d['get']({'plain':!![]});var _0x810bf=_0xaefd('0x29');return db['UserProfileResource'][_0xaefd('0x28')]({'where':{'type':_0x810bf,'resourceId':_0x2fe27e['id']}})[_0xaefd('0x2a')](function(){return _0x14cc9d;});})['then'](function(){_0x3ffc9c[_0xaefd('0x1e')](0xcc)[_0xaefd('0x1f')]();});}};}function handleEntityNotFound(_0x36b6b7,_0x4c0898){return function(_0x45f0e8){if(!_0x45f0e8){_0x36b6b7['sendStatus'](0x194);}return _0x45f0e8;};}function handleError(_0x109e19,_0x5c5639){_0x5c5639=_0x5c5639||0x1f4;return function(_0x4a1acb){logger[_0xaefd('0x2b')](_0x4a1acb[_0xaefd('0x2c')]);if(_0x4a1acb['name']){delete _0x4a1acb['name'];}_0x109e19['status'](_0x5c5639)[_0xaefd('0x2d')](_0x4a1acb);};}exports[_0xaefd('0x2e')]=function(_0x4b6910,_0x5503d0){var _0x62ef86={},_0x465d99={},_0x3f4947={'count':0x0,'rows':[]};var _0x21d358=_['map'](db[_0xaefd('0x2f')][_0xaefd('0x30')],function(_0x3b11e4){return{'name':_0x3b11e4[_0xaefd('0x31')],'type':_0x3b11e4[_0xaefd('0x32')][_0xaefd('0x33')]};});_0x465d99[_0xaefd('0x34')]=_[_0xaefd('0x35')](_0x21d358,_0xaefd('0x36'));_0x465d99[_0xaefd('0x37')]=_[_0xaefd('0x38')](_0x4b6910[_0xaefd('0x37')]);_0x465d99[_0xaefd('0x39')]=_[_0xaefd('0x3a')](_0x465d99[_0xaefd('0x34')],_0x465d99[_0xaefd('0x37')]);_0x62ef86['attributes']=_[_0xaefd('0x3a')](_0x465d99[_0xaefd('0x34')],qs[_0xaefd('0x3b')](_0x4b6910['query'][_0xaefd('0x3b')]));_0x62ef86['attributes']=_0x62ef86[_0xaefd('0x3c')][_0xaefd('0x3d')]?_0x62ef86[_0xaefd('0x3c')]:_0x465d99[_0xaefd('0x34')];if(!_0x4b6910[_0xaefd('0x37')][_0xaefd('0x3e')](_0xaefd('0x3f'))){_0x62ef86[_0xaefd('0x23')]=qs[_0xaefd('0x23')](_0x4b6910[_0xaefd('0x37')][_0xaefd('0x23')]);_0x62ef86[_0xaefd('0x20')]=qs[_0xaefd('0x20')](_0x4b6910[_0xaefd('0x37')]['offset']);}_0x62ef86[_0xaefd('0x40')]=qs['sort'](_0x4b6910[_0xaefd('0x37')][_0xaefd('0x41')]);_0x62ef86[_0xaefd('0x42')]=qs[_0xaefd('0x39')](_[_0xaefd('0x43')](_0x4b6910[_0xaefd('0x37')],_0x465d99[_0xaefd('0x39')]),_0x21d358);if(_0x4b6910[_0xaefd('0x37')][_0xaefd('0x44')]){_0x62ef86[_0xaefd('0x42')]=_['merge'](_0x62ef86[_0xaefd('0x42')],{'$or':_[_0xaefd('0x35')](_0x21d358,function(_0x4dfea1){if(_0x4dfea1[_0xaefd('0x32')]!==_0xaefd('0x45')){var _0x27daa8={};_0x27daa8[_0x4dfea1['name']]={'$like':'%'+_0x4b6910['query'][_0xaefd('0x44')]+'%'};return _0x27daa8;}})});}_0x62ef86=_[_0xaefd('0x46')]({},_0x62ef86,_0x4b6910[_0xaefd('0x47')]);var _0x179648={'where':_0x62ef86[_0xaefd('0x42')]};return db[_0xaefd('0x2f')][_0xaefd('0x22')](_0x179648)[_0xaefd('0x2a')](function(_0x48a7af){_0x3f4947[_0xaefd('0x22')]=_0x48a7af;if(_0x4b6910[_0xaefd('0x37')][_0xaefd('0x48')]){_0x62ef86[_0xaefd('0x49')]=[{'all':!![]}];}return db[_0xaefd('0x2f')][_0xaefd('0x4a')](_0x62ef86);})[_0xaefd('0x2a')](function(_0x1f4a15){_0x3f4947['rows']=_0x1f4a15;return _0x3f4947;})['then'](respondWithFilteredResult(_0x5503d0,_0x62ef86))[_0xaefd('0x4b')](handleError(_0x5503d0,null));};exports[_0xaefd('0x4c')]=function(_0x532328,_0x599738){var _0x17d611={'raw':![],'where':{'id':_0x532328[_0xaefd('0x4d')]['id']}},_0xe37b2c={};_0xe37b2c[_0xaefd('0x34')]=_[_0xaefd('0x38')](db[_0xaefd('0x2f')][_0xaefd('0x30')]);_0xe37b2c[_0xaefd('0x37')]=_[_0xaefd('0x38')](_0x532328['query']);_0xe37b2c[_0xaefd('0x39')]=_[_0xaefd('0x3a')](_0xe37b2c[_0xaefd('0x34')],_0xe37b2c[_0xaefd('0x37')]);_0x17d611[_0xaefd('0x3c')]=_[_0xaefd('0x3a')](_0xe37b2c[_0xaefd('0x34')],qs['fields'](_0x532328[_0xaefd('0x37')]['fields']));_0x17d611[_0xaefd('0x3c')]=_0x17d611[_0xaefd('0x3c')][_0xaefd('0x3d')]?_0x17d611[_0xaefd('0x3c')]:_0xe37b2c['model'];if(_0x532328['query'][_0xaefd('0x48')]){_0x17d611[_0xaefd('0x49')]=[{'all':!![]}];}_0x17d611=_[_0xaefd('0x46')]({},_0x17d611,_0x532328['options']);return db[_0xaefd('0x2f')][_0xaefd('0x4e')](_0x17d611)['then'](handleEntityNotFound(_0x599738,null))[_0xaefd('0x2a')](respondWithResult(_0x599738,null))[_0xaefd('0x4b')](handleError(_0x599738,null));};exports[_0xaefd('0x28')]=function(_0x23d4a9,_0x398aee){return db[_0xaefd('0x2f')][_0xaefd('0x4e')]({'where':{'id':_0x23d4a9[_0xaefd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x398aee,null))['then'](removeEntity(_0x398aee,null))[_0xaefd('0x4b')](handleError(_0x398aee,null));};exports[_0xaefd('0x4f')]=function(_0x578e0c,_0x332743){return db['VoicePrefix'][_0xaefd('0x4f')]()[_0xaefd('0x2a')](respondWithResult(_0x332743,null))[_0xaefd('0x4b')](handleError(_0x332743,null));};exports[_0xaefd('0x50')]=function(_0x27fd3f,_0xf727cd){var _0x4b709a;return db['sequelize'][_0xaefd('0x51')](function(_0x338823){return db['VoicePrefix'][_0xaefd('0x50')](_0x27fd3f[_0xaefd('0x52')],{'transaction':_0x338823})[_0xaefd('0x2a')](function(_0x23fee9){_0x4b709a=_0x23fee9['get']({'plain':!![]});return db['VoiceExtension'][_0xaefd('0x4e')]({'where':{'id':_0x4b709a[_0xaefd('0x53')]},'raw':!![]})[_0xaefd('0x2a')](function(_0x1fe44a){return createVoicePrefixExtensions(_0x4b709a,_0x1fe44a,_0x338823);});});})[_0xaefd('0x2a')](function(){var _0x47cac9=_0x27fd3f[_0xaefd('0x54')][_0xaefd('0x55')]({'plain':!![]});if(!_0x47cac9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47cac9[_0xaefd('0x56')]===_0xaefd('0x54')){var _0x5f2925=_0x4b709a;return db[_0xaefd('0x57')][_0xaefd('0x4e')]({'where':{'name':_0xaefd('0x29'),'userProfileId':_0x47cac9['userProfileId']},'raw':!![]})[_0xaefd('0x2a')](function(_0x1a9842){if(_0x1a9842&&_0x1a9842['autoAssociation']===0x0){return db[_0xaefd('0x58')][_0xaefd('0x50')]({'name':_0x5f2925[_0xaefd('0x36')],'resourceId':_0x5f2925['id'],'type':_0x1a9842[_0xaefd('0x36')],'sectionId':_0x1a9842['id']},{})['then'](function(){return _0x4b709a;});}else{return _0x4b709a;}})['catch'](function(_0x232bf9){logger[_0xaefd('0x2b')](_0xaefd('0x59'),_0x232bf9);throw _0x232bf9;});}return _0x4b709a;})[_0xaefd('0x2a')](respondWithResult(_0xf727cd,null))[_0xaefd('0x4b')](handleError(_0xf727cd,null));};function Extension(_0x8ab9e7,_0x314660,_0x368fd3,_0x1e519e){this[_0xaefd('0x5a')]='from-sip';this['exten']=_0x8ab9e7;this[_0xaefd('0x5b')]=_0x368fd3;this[_0xaefd('0x32')]=_0xaefd('0x5c');this[_0xaefd('0x5d')]='Voice\x20Prefix\x20Extension';this[_0xaefd('0x5e')]=_0x314660;this[_0xaefd('0x5f')]=_0x1e519e;}function createVoicePrefixExtensions(_0x422b9e,_0x1ad04e,_0x16c227){return new BPromise(function(_0x37414d,_0x241e93){var _0x2c1004=new Extension(formatPrefixName(_0x422b9e['prefix']),0x1,_0xaefd('0x60'),_0xaefd('0x61'));_0x2c1004[_0xaefd('0x62')]=_0x422b9e['id'];return db[_0xaefd('0x63')]['create'](_0x2c1004,{'transaction':_0x16c227})[_0xaefd('0x2a')](function(_0x53888d){var _0xeb739=_0x53888d[_0xaefd('0x55')]({'plain':!![]});var _0x516913=_['map'](addVoicePrefixExtensions(_0x422b9e,_0x1ad04e),function(_0x45028e){_0x45028e['VoiceExtensionId']=_0xeb739['id'];_0x45028e['VoicePrefixId']=_0x422b9e['id'];return _0x45028e;});return db['VoiceExtension'][_0xaefd('0x64')](_0x516913,{'transaction':_0x16c227})[_0xaefd('0x2a')](function(_0x27fcb4){if(!_0x27fcb4){return _0x241e93(_0xaefd('0x65'));}else{return _0x37414d(_0x27fcb4);}})[_0xaefd('0x4b')](function(_0x384847){return _0x241e93(_0x384847);});});;});};function addVoicePrefixExtensions(_0x509a87,_0x5d308a){var _0x4f8e16=[];var _0x5c7220=formatPrefixName(_0x509a87[_0xaefd('0x66')]);_0x4f8e16['push'](new Extension(_0x5c7220,0x2,_0xaefd('0x67'),'CDR(prefix)='+_0x509a87[_0xaefd('0x36')]));if(_0x509a87[_0xaefd('0x68')]){_0x4f8e16[_0xaefd('0x69')](new Extension(_0x5c7220,0x3,_0xaefd('0x67'),_0xaefd('0x6a')+_0x509a87[_0xaefd('0x68')]));}else{_0x4f8e16[_0xaefd('0x69')](new Extension(_0x5c7220,0x3,'NoOp',_0xaefd('0x6b')));}_0x4f8e16[_0xaefd('0x69')](new Extension(_0x5c7220,0x4,_0xaefd('0x6c'),_0x5d308a[_0xaefd('0x5a')]+','+'${EXTEN:'+(0x8+_0x509a87[_0xaefd('0x36')]['length'])+'}'+','+0x1));return _0x4f8e16;}function formatPrefixName(_0x28db3a){var _0x40b493='_';for(var _0x110379=0x0;_0x110379<_0x28db3a[_0xaefd('0x3d')];_0x110379++){if(_0x28db3a[_0xaefd('0x6d')](_0x110379)=='-'){_0x40b493+=_0x28db3a[_0xaefd('0x6d')](_0x110379);}else{_0x40b493+='['+_0x28db3a['charAt'](_0x110379)+']';}}_0x40b493+='.';return _0x40b493;}exports[_0xaefd('0x27')]=function(_0x3b39db,_0x4a9fa5,_0x39ee5){var _0x279ad4=_0x3b39db['body'];_0x279ad4[_0xaefd('0x66')]=_0xaefd('0x6e')+_0x279ad4[_0xaefd('0x36')]+'-';return db[_0xaefd('0x6f')][_0xaefd('0x51')](function(_0x406c6d){return db[_0xaefd('0x2f')][_0xaefd('0x27')](_0x279ad4,{'where':{'id':_0x279ad4['id']},'transaction':_0x406c6d})[_0xaefd('0x2a')](function(){return db[_0xaefd('0x63')][_0xaefd('0x28')]({'where':{'VoicePrefixId':_0x279ad4['id']},'transaction':_0x406c6d})[_0xaefd('0x2a')](function(){return db[_0xaefd('0x63')][_0xaefd('0x4e')]({'where':{'id':_0x279ad4[_0xaefd('0x53')]},'raw':!![]})[_0xaefd('0x2a')](function(_0x3e0836){return createVoicePrefixExtensions(_0x279ad4,_0x3e0836,_0x406c6d);});});});})['then'](function(){return db[_0xaefd('0x2f')][_0xaefd('0x70')](_0x279ad4['id']);})[_0xaefd('0x2a')](respondWithResult(_0x4a9fa5,null))['catch'](handleError(_0x4a9fa5,null));};exports[_0xaefd('0x71')]=function(_0x12391f,_0x47270b,_0x594a75){return db['VoicePrefix'][_0xaefd('0x4e')]({'where':{'id':_0x12391f['params']['id']}})[_0xaefd('0x2a')](handleEntityNotFound(_0x47270b,null))['then'](function(_0x1e8616){if(_0x1e8616){return _0x1e8616[_0xaefd('0x71')](_0x12391f[_0xaefd('0x52')]['ids'],_['omit'](_0x12391f[_0xaefd('0x52')],[_0xaefd('0x72'),'id'])||{})[_0xaefd('0x73')](function(_0x99f17b){for(var _0x157a2a=0x0;_0x157a2a<_0x12391f[_0xaefd('0x52')]['ids']['length'];_0x157a2a+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x12391f['body'][_0xaefd('0x72')][_0x157a2a]),'VoicePrefixId':Number(_0x12391f[_0xaefd('0x4d')]['id'])});}return _0x99f17b;});}})[_0xaefd('0x2a')](respondWithResult(_0x47270b,null))[_0xaefd('0x4b')](handleError(_0x47270b,null));};exports['removeAgents']=function(_0x3ae6ba,_0x1c4508,_0x4a3586){return db[_0xaefd('0x2f')]['find']({'where':{'id':_0x3ae6ba[_0xaefd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c4508,null))[_0xaefd('0x2a')](function(_0x4b1ade){if(_0x4b1ade){return _0x4b1ade[_0xaefd('0x74')](_0x3ae6ba['query'][_0xaefd('0x72')])[_0xaefd('0x2a')](function(){if(_['isArray'](_0x3ae6ba[_0xaefd('0x37')][_0xaefd('0x72')])){for(var _0x47235e=0x0;_0x47235e<_0x3ae6ba['query'][_0xaefd('0x72')][_0xaefd('0x3d')];_0x47235e+=0x1){socket[_0xaefd('0x75')](_0xaefd('0x76'),{'UserId':Number(_0x3ae6ba[_0xaefd('0x37')]['ids'][_0x47235e]),'VoicePrefixId':Number(_0x3ae6ba[_0xaefd('0x4d')]['id'])});}}else{socket[_0xaefd('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x3ae6ba[_0xaefd('0x37')][_0xaefd('0x72')]),'VoicePrefixId':Number(_0x3ae6ba[_0xaefd('0x4d')]['id'])});}});}})[_0xaefd('0x2a')](respondWithStatusCode(_0x1c4508,null))['catch'](handleError(_0x1c4508,null));};exports[_0xaefd('0x77')]=function(_0x491978,_0xf2925d,_0x1bbeec){var _0x19b574={};var _0x5e2823={};var _0xa53ec;var _0x888d96;return db[_0xaefd('0x2f')]['findOne']({'where':{'id':_0x491978[_0xaefd('0x4d')]['id']}})[_0xaefd('0x2a')](handleEntityNotFound(_0xf2925d,null))[_0xaefd('0x2a')](function(_0x317b55){if(_0x317b55){_0xa53ec=_0x317b55;_0x5e2823['model']=_[_0xaefd('0x38')](db[_0xaefd('0x78')][_0xaefd('0x30')]);_0x5e2823[_0xaefd('0x37')]=_['keys'](_0x491978[_0xaefd('0x37')]);_0x5e2823[_0xaefd('0x39')]=_[_0xaefd('0x3a')](_0x5e2823[_0xaefd('0x34')],_0x5e2823['query']);_0x19b574[_0xaefd('0x3c')]=_['intersection'](_0x5e2823[_0xaefd('0x34')],qs['fields'](_0x491978[_0xaefd('0x37')][_0xaefd('0x3b')]));_0x19b574[_0xaefd('0x3c')]=_0x19b574[_0xaefd('0x3c')][_0xaefd('0x3d')]?_0x19b574['attributes']:_0x5e2823[_0xaefd('0x34')];_0x19b574['order']=qs[_0xaefd('0x41')](_0x491978['query'][_0xaefd('0x41')]);_0x19b574[_0xaefd('0x42')]=qs[_0xaefd('0x39')](_['pick'](_0x491978[_0xaefd('0x37')],_0x5e2823['filters']));if(_0x491978[_0xaefd('0x37')][_0xaefd('0x44')]){_0x19b574[_0xaefd('0x42')]=_[_0xaefd('0x46')](_0x19b574['where'],{'$or':_[_0xaefd('0x35')](_0x19b574[_0xaefd('0x3c')],function(_0x215986){var _0x407c6a={};_0x407c6a[_0x215986]={'$like':'%'+_0x491978[_0xaefd('0x37')][_0xaefd('0x44')]+'%'};return _0x407c6a;})});}_0x19b574=_[_0xaefd('0x46')]({},_0x19b574,_0x491978[_0xaefd('0x47')]);return _0xa53ec[_0xaefd('0x77')](_0x19b574);}})['then'](function(_0x250d61){if(_0x250d61){_0x888d96=_0x250d61[_0xaefd('0x3d')];if(!_0x491978[_0xaefd('0x37')][_0xaefd('0x3e')](_0xaefd('0x3f'))){_0x19b574[_0xaefd('0x23')]=qs[_0xaefd('0x23')](_0x491978[_0xaefd('0x37')][_0xaefd('0x23')]);_0x19b574[_0xaefd('0x20')]=qs[_0xaefd('0x20')](_0x491978[_0xaefd('0x37')][_0xaefd('0x20')]);}return _0xa53ec[_0xaefd('0x77')](_0x19b574);}})[_0xaefd('0x2a')](function(_0x4db4b0){if(_0x4db4b0){return _0x4db4b0?{'count':_0x888d96,'rows':_0x4db4b0}:null;}})['then'](respondWithResult(_0xf2925d,null))[_0xaefd('0x4b')](handleError(_0xf2925d,null));};exports[_0xaefd('0x79')]=function(_0x48e33f,_0x24c994,_0x3ea496){var _0x320cc6={};var _0x17ba3d={};var _0x321b4c;var _0x128a26;return db['VoicePrefix'][_0xaefd('0x7a')]({'where':{'id':_0x48e33f[_0xaefd('0x4d')]['id']}})[_0xaefd('0x2a')](handleEntityNotFound(_0x24c994,null))[_0xaefd('0x2a')](function(_0x4d0fc3){if(_0x4d0fc3){_0x321b4c=_0x4d0fc3;_0x17ba3d[_0xaefd('0x34')]=_[_0xaefd('0x38')](db[_0xaefd('0x7b')][_0xaefd('0x30')]);_0x17ba3d['query']=_[_0xaefd('0x38')](_0x48e33f[_0xaefd('0x37')]);_0x17ba3d['filters']=_[_0xaefd('0x3a')](_0x17ba3d[_0xaefd('0x34')],_0x17ba3d['query']);_0x320cc6[_0xaefd('0x3c')]=_[_0xaefd('0x3a')](_0x17ba3d[_0xaefd('0x34')],qs['fields'](_0x48e33f[_0xaefd('0x37')][_0xaefd('0x3b')]));_0x320cc6['attributes']=_0x320cc6[_0xaefd('0x3c')][_0xaefd('0x3d')]?_0x320cc6[_0xaefd('0x3c')]:_0x17ba3d[_0xaefd('0x34')];_0x320cc6[_0xaefd('0x40')]=qs[_0xaefd('0x41')](_0x48e33f[_0xaefd('0x37')]['sort']);_0x320cc6[_0xaefd('0x42')]=qs[_0xaefd('0x39')](_['pick'](_0x48e33f['query'],_0x17ba3d[_0xaefd('0x39')]));if(_0x48e33f[_0xaefd('0x37')][_0xaefd('0x44')]){_0x320cc6['where']=_[_0xaefd('0x46')](_0x320cc6['where'],{'$or':_['map'](_0x320cc6[_0xaefd('0x3c')],function(_0x32045b){var _0x3056d2={};_0x3056d2[_0x32045b]={'$like':'%'+_0x48e33f[_0xaefd('0x37')][_0xaefd('0x44')]+'%'};return _0x3056d2;})});}_0x320cc6=_[_0xaefd('0x46')]({},_0x320cc6,_0x48e33f[_0xaefd('0x47')]);return _0x321b4c[_0xaefd('0x79')](_0x320cc6);}})[_0xaefd('0x2a')](function(_0x4e8481){if(_0x4e8481){_0x128a26=_0x4e8481[_0xaefd('0x3d')];if(!_0x48e33f[_0xaefd('0x37')][_0xaefd('0x3e')](_0xaefd('0x3f'))){_0x320cc6[_0xaefd('0x23')]=qs['limit'](_0x48e33f[_0xaefd('0x37')][_0xaefd('0x23')]);_0x320cc6['offset']=qs[_0xaefd('0x20')](_0x48e33f['query'][_0xaefd('0x20')]);}return _0x321b4c['getTeams'](_0x320cc6);}})['then'](function(_0x2d88da){if(_0x2d88da){return _0x2d88da?{'count':_0x128a26,'rows':_0x2d88da}:null;}})[_0xaefd('0x2a')](respondWithResult(_0x24c994,null))['catch'](handleError(_0x24c994,null));};exports[_0xaefd('0x7c')]=function(_0x1aa4f7,_0x67e396,_0x261efa){var _0x4e8867=_0x1aa4f7[_0xaefd('0x52')][_0xaefd('0x72')];var _0x5dad4e;return db[_0xaefd('0x7b')]['findAll']({'where':{'id':_0x4e8867},'attributes':['id'],'include':[{'model':db[_0xaefd('0x78')],'as':'Agents','attributes':['id','name','online','voicePause',_0xaefd('0x7d')],'raw':!![]}]})[_0xaefd('0x2a')](function(_0x3e7f61){if(_0x3e7f61){_0x5dad4e=_0x3e7f61;var _0x13fd50=_[_0xaefd('0x7e')](_0x3e7f61,function(_0x3a705b){var _0x46d502=_0x3a705b[_0xaefd('0x55')]({'plain':!![]});return _0x46d502[_0xaefd('0x7f')];});return db[_0xaefd('0x2f')]['find']({'where':{'id':_0x1aa4f7[_0xaefd('0x4d')]['id']}})['then'](function(_0x3dafc3){return db[_0xaefd('0x6f')][_0xaefd('0x51')](function(_0x336594){return _0x3dafc3[_0xaefd('0x7c')](_0x4e8867,{'transaction':_0x336594})['then'](function(){return BPromise['each'](_0x5dad4e,function(_0x27790f){return db['TeamVoicePrefix'][_0xaefd('0x80')]({'TeamId':_0x27790f['id'],'VoicePrefixId':_0x1aa4f7[_0xaefd('0x4d')]['id']},{'transaction':_0x336594});});})['then'](function(){return BPromise[_0xaefd('0x81')](_0x13fd50,function(_0x4887f7){return db[_0xaefd('0x82')]['findOrCreate']({'where':{'UserId':_0x4887f7['id'],'VoicePrefixId':_0x1aa4f7[_0xaefd('0x4d')]['id']},'transaction':_0x336594});});})['then'](function(){_0x13fd50[_0xaefd('0x83')](function(_0x47a053){socket['emit'](_0xaefd('0x84'),{'UserId':_0x47a053['id'],'VoicePrefixId':_0x3dafc3['id']});});});});});}})[_0xaefd('0x2a')](respondWithStatusCode(_0x67e396,null))[_0xaefd('0x4b')](handleError(_0x67e396,null));};exports[_0xaefd('0x85')]=function(_0x2f3049,_0x7fd0d8,_0x2efdca){return db[_0xaefd('0x7b')][_0xaefd('0x4a')]({'where':{'id':_0x2f3049[_0xaefd('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xaefd('0x78')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xaefd('0x2a')](handleEntityNotFound(_0x7fd0d8,null))[_0xaefd('0x2a')](function(_0x4c3cb0){var _0x7380d5=_['map'](_0x4c3cb0,'id');var _0x3723e6=[];var _0x58e4c5=[];var _0x42e09b=squel[_0xaefd('0x86')]();_0x42e09b['field'](_0xaefd('0x87'))['from']('team_has_voice_prefixes','tq')['join'](_0xaefd('0x88'),'ut',_0xaefd('0x89'))['where']('VoicePrefixId\x20=\x20?',_0x2f3049[_0xaefd('0x4d')]['id']);for(var _0x35b685=0x0;_0x35b685<_0x4c3cb0['length'];_0x35b685+=0x1){let _0x1af15a=_0x4c3cb0[_0x35b685];for(var _0x42c685=0x0;_0x42c685<_0x1af15a[_0xaefd('0x7f')][_0xaefd('0x3d')];_0x42c685+=0x1){let _0x2fe05a=_0x1af15a[_0xaefd('0x7f')][_0x42c685];var _0x4df2de=_0x42e09b['clone']();_0x4df2de[_0xaefd('0x42')]('ut.UserId\x20=\x20?',_0x2fe05a['id']);_0x58e4c5['push'](db[_0xaefd('0x6f')][_0xaefd('0x37')](_0x4df2de[_0xaefd('0x8a')](),{'type':db[_0xaefd('0x6f')][_0xaefd('0x8b')][_0xaefd('0x8c')]})['then'](function(_0x129a22){if(_0x129a22[_0xaefd('0x3d')]===0x1){return _0x2fe05a['id'];}else{var _0x1911a2=_[_0xaefd('0x8d')](_[_0xaefd('0x35')](_0x129a22,_0xaefd('0x8e')),function(_0x1ce217){return _['includes'](_0x7380d5,_0x1ce217);});if(_0x1911a2){return _0x2fe05a['id'];}}}));}}return BPromise[_0xaefd('0x8f')](_0x58e4c5)['then'](function(_0x1f0cc0){_0x3723e6=_(_0x3723e6)[_0xaefd('0x90')](_0x1f0cc0)[_0xaefd('0x91')]()[_0xaefd('0x92')]();return db[_0xaefd('0x2f')][_0xaefd('0x4e')]({'where':{'id':_0x2f3049[_0xaefd('0x4d')]['id']}})[_0xaefd('0x2a')](function(_0x34cc20){return db[_0xaefd('0x6f')][_0xaefd('0x51')](function(_0x5ee5cd){return _0x34cc20['removeTeams'](_0x2f3049[_0xaefd('0x37')][_0xaefd('0x72')],{'transaction':_0x5ee5cd})['then'](function(){if(!_[_0xaefd('0x93')](_0x3723e6)){return _0x34cc20[_0xaefd('0x74')](_0x3723e6,{'transaction':_0x5ee5cd});}})[_0xaefd('0x2a')](function(){_0x3723e6[_0xaefd('0x83')](function(_0x7a283b){socket[_0xaefd('0x75')]('userVoicePrefix:remove',{'UserId':_0x7a283b,'VoicePrefixId':_0x34cc20['id']});});});});});});})['then'](respondWithStatusCode(_0x7fd0d8,null))[_0xaefd('0x4b')](handleError(_0x7fd0d8,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1f5b095..062ebec 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 _0xc5ad=['hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','save','update','remove','emit'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xc5ad,0x17d));var _0xdc5a=function(_0x486723,_0x1b6adf){_0x486723=_0x486723-0x0;var _0x250b91=_0xc5ad[_0x486723];return _0x250b91;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xdc5a('0x0'))['db'][_0xdc5a('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdc5a('0x2'),'afterUpdate':_0xdc5a('0x3'),'afterDestroy':_0xdc5a('0x4')};function emitEvent(_0x6f5b91){return function(_0x41df5b,_0x63a9c2,_0x5e70ff){VoicePrefixEvents['emit'](_0x6f5b91+':'+_0x41df5b['id'],_0x41df5b);VoicePrefixEvents[_0xdc5a('0x5')](_0x6f5b91,_0x41df5b);_0x5e70ff(null);};}for(var e in events){if(events[_0xdc5a('0x6')](e)){var event=events[e];VoicePrefix[_0xdc5a('0x7')](e,emitEvent(event));}}module[_0xdc5a('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xd49d=['emit','hook','../../mysqldb'];(function(_0x39a531,_0x8b056a){var _0x27c403=function(_0x5703c7){while(--_0x5703c7){_0x39a531['push'](_0x39a531['shift']());}};_0x27c403(++_0x8b056a);}(_0xd49d,0x98));var _0xdd49=function(_0x287509,_0x19cb11){_0x287509=_0x287509-0x0;var _0x53f110=_0xd49d[_0x287509];return _0x53f110;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xdd49('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5723e8){return function(_0xb26fd2,_0x3f001e,_0x240061){VoicePrefixEvents['emit'](_0x5723e8+':'+_0xb26fd2['id'],_0xb26fd2);VoicePrefixEvents[_0xdd49('0x1')](_0x5723e8,_0xb26fd2);_0x240061(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xdd49('0x2')](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 39d7f12..848f88f 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 _0x7691=['exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x4541e9,_0x3cf4a1){var _0x4f8fe1=function(_0x988f07){while(--_0x988f07){_0x4541e9['push'](_0x4541e9['shift']());}};_0x4f8fe1(++_0x3cf4a1);}(_0x7691,0x72));var _0x1769=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7691[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1769('0x0'));var logger=require(_0x1769('0x1'))('api');var moment=require(_0x1769('0x2'));var BPromise=require('bluebird');var rp=require(_0x1769('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1769('0x4'));var config=require(_0x1769('0x5'));var attributes=require(_0x1769('0x6'));module[_0x1769('0x7')]=function(_0x3bf533,_0x51545d){return _0x3bf533[_0x1769('0x8')](_0x1769('0x9'),attributes,{'tableName':_0x1769('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1055=['bluebird','path','rimraf','../../config/environment','exports','define','VoicePrefix','lodash','util','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1055,0x1f1));var _0x5105=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0x1055[_0x26d386];return _0x4ef9a8;};'use strict';var _=require(_0x5105('0x0'));var util=require(_0x5105('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5105('0x2'));var BPromise=require(_0x5105('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5105('0x4'));var rimraf=require(_0x5105('0x5'));var config=require(_0x5105('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x5105('0x7')]=function(_0x492509,_0x8f0eaa){return _0x492509[_0x5105('0x8')](_0x5105('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 3126abd..c64b0d9 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 _0x404d=['register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x40aa58,_0x5b22fc){var _0x532346=function(_0x2a6cd3){while(--_0x2a6cd3){_0x40aa58['push'](_0x40aa58['shift']());}};_0x532346(++_0x5b22fc);}(_0x404d,0x1e9));var _0xd404=function(_0x1c8fc1,_0x335611){_0x1c8fc1=_0x1c8fc1-0x0;var _0x53b4ab=_0x404d[_0x1c8fc1];return _0x53b4ab;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});config[_0xd404('0xc')]=_['defaults'](config['redis'],{'host':_0xd404('0xd'),'port':0x18eb});var socket=require(_0xd404('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xd404('0xf')](socket);function respondWithRpcPromise(_0x1b99d2,_0x3a1a89,_0xb018fc){return new BPromise(function(_0x5d3faf,_0x4b60f2){return client[_0xd404('0x10')](_0x1b99d2,_0xb018fc)[_0xd404('0x11')](function(_0x569542){logger[_0xd404('0x12')](_0xd404('0x13'),_0x3a1a89,_0xd404('0x14'));logger[_0xd404('0x15')](_0xd404('0x16'),_0x3a1a89,_0xd404('0x14'),JSON[_0xd404('0x17')](_0x569542));if(_0x569542[_0xd404('0x18')]){if(_0x569542[_0xd404('0x18')][_0xd404('0x19')]===0x1f4){logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);return _0x4b60f2(_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);}logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);return _0x5d3faf(_0x569542[_0xd404('0x18')]['message']);}else{logger[_0xd404('0x12')](_0xd404('0x13'),_0x3a1a89,'request\x20sent');_0x5d3faf(_0x569542[_0xd404('0x1b')][_0xd404('0x1a')]);}})['catch'](function(_0x209a6b){logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x209a6b);_0x4b60f2(_0x209a6b);});});} \ No newline at end of file +var _0xd0c9=['../../config/utils','rpc','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x5d00ed,_0x50ed0f){var _0x4ee318=function(_0x50dfa6){while(--_0x50dfa6){_0x5d00ed['push'](_0x5d00ed['shift']());}};_0x4ee318(++_0x50ed0f);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd0c9[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x9d0c('0x0'));var util=require(_0x9d0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d0c('0x2'));var db=require(_0x9d0c('0x3'))['db'];var utils=require(_0x9d0c('0x4'));var logger=require('../../config/logger')(_0x9d0c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9d0c('0x6')]['http']({'port':0x232a});config[_0x9d0c('0x7')]=_[_0x9d0c('0x8')](config[_0x9d0c('0x7')],{'host':_0x9d0c('0x9'),'port':0x18eb});var socket=require(_0x9d0c('0xa'))(new Redis(config[_0x9d0c('0x7')]));require('./voicePrefix.socket')[_0x9d0c('0xb')](socket);function respondWithRpcPromise(_0x5dbbfa,_0x29d57b,_0x12ab3a){return new BPromise(function(_0x3e3a5e,_0x53f49a){return client[_0x9d0c('0xc')](_0x5dbbfa,_0x12ab3a)[_0x9d0c('0xd')](function(_0x3c5ea3){logger[_0x9d0c('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x29d57b,_0x9d0c('0xf'));logger['debug'](_0x9d0c('0x10'),_0x29d57b,_0x9d0c('0xf'),JSON[_0x9d0c('0x11')](_0x3c5ea3));if(_0x3c5ea3[_0x9d0c('0x12')]){if(_0x3c5ea3['error']['code']===0x1f4){logger['error'](_0x9d0c('0x13'),_0x29d57b,_0x3c5ea3['error'][_0x9d0c('0x14')]);return _0x53f49a(_0x3c5ea3[_0x9d0c('0x12')][_0x9d0c('0x14')]);}logger[_0x9d0c('0x12')](_0x9d0c('0x13'),_0x29d57b,_0x3c5ea3[_0x9d0c('0x12')][_0x9d0c('0x14')]);return _0x3e3a5e(_0x3c5ea3[_0x9d0c('0x12')]['message']);}else{logger[_0x9d0c('0xe')](_0x9d0c('0x13'),_0x29d57b,'request\x20sent');_0x3e3a5e(_0x3c5ea3[_0x9d0c('0x15')][_0x9d0c('0x14')]);}})[_0x9d0c('0x16')](function(_0x4ccf40){logger['error'](_0x9d0c('0x13'),_0x29d57b,_0x4ccf40);_0x53f49a(_0x4ccf40);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 9468b7e..e48d268 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 _0xbf1a=['remove','update','removeListener','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x538710,_0x2ebf48){var _0x4361de=function(_0x102841){while(--_0x102841){_0x538710['push'](_0x538710['shift']());}};_0x4361de(++_0x2ebf48);}(_0xbf1a,0x7c));var _0xabf1=function(_0x14b0a9,_0x1ff8e0){_0x14b0a9=_0x14b0a9-0x0;var _0x4b7690=_0xbf1a[_0x14b0a9];return _0x4b7690;};'use strict';var VoicePrefixEvents=require(_0xabf1('0x0'));var events=[_0xabf1('0x1'),_0xabf1('0x2'),_0xabf1('0x3')];function createListener(_0x690e59,_0x567007){return function(_0x132189){_0x567007['emit'](_0x690e59,_0x132189);};}function removeListener(_0x1b5f1a,_0x288b6c){return function(){VoicePrefixEvents[_0xabf1('0x4')](_0x1b5f1a,_0x288b6c);};}exports['register']=function(_0x5a477e){for(var _0x2a4ebd=0x0,_0x4f5b53=events[_0xabf1('0x5')];_0x2a4ebd<_0x4f5b53;_0x2a4ebd++){var _0x1cc1f6=events[_0x2a4ebd];var _0x1f48f5=createListener(_0xabf1('0x6')+_0x1cc1f6,_0x5a477e);VoicePrefixEvents['on'](_0x1cc1f6,_0x1f48f5);}}; \ No newline at end of file +var _0x80df=['remove','update','emit','removeListener','register','voicePrefix:','./voicePrefix.events','save'];(function(_0x5748c6,_0x555ade){var _0x3215b5=function(_0x26bad6){while(--_0x26bad6){_0x5748c6['push'](_0x5748c6['shift']());}};_0x3215b5(++_0x555ade);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var VoicePrefixEvents=require(_0xf80d('0x0'));var events=[_0xf80d('0x1'),_0xf80d('0x2'),_0xf80d('0x3')];function createListener(_0x5390c8,_0x3aee0a){return function(_0x216488){_0x3aee0a[_0xf80d('0x4')](_0x5390c8,_0x216488);};}function removeListener(_0x21365c,_0x15d302){return function(){VoicePrefixEvents[_0xf80d('0x5')](_0x21365c,_0x15d302);};}exports[_0xf80d('0x6')]=function(_0xeffeb7){for(var _0x1c9b19=0x0,_0x62e50f=events['length'];_0x1c9b19<_0x62e50f;_0x1c9b19++){var _0x30e2b3=events[_0x1c9b19];var _0x16b219=createListener(_0xf80d('0x7')+_0x30e2b3,_0xeffeb7);VoicePrefixEvents['on'](_0x30e2b3,_0x16b219);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d223e25..2da7337 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x20f80f,_0x3df53e){var _0x2ab52f=function(_0x1a9880){while(--_0x1a9880){_0x20f80f['push'](_0x20f80f['shift']());}};_0x2ab52f(++_0x3df53e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x47fc4f,_0x2bb701){var _0x53cf75=function(_0x5457a7){while(--_0x5457a7){_0x47fc4f['push'](_0x47fc4f['shift']());}};_0x53cf75(++_0x2bb701);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 014741a..0f5a95b 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 _0x402b=['fewestcalls','random','rrmemory','linear','rrordered','ringall','setDataValue','strategy','type','getDataValue','booked','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\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','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','leastrecent'];(function(_0x3abcd3,_0x2331e6){var _0x5e01f5=function(_0xf320c6){while(--_0xf320c6){_0x3abcd3['push'](_0x3abcd3['shift']());}};_0x5e01f5(++_0x2331e6);}(_0x402b,0x1a0));var _0xb402=function(_0x14d034,_0x514a1a){_0x14d034=_0x14d034-0x0;var _0x37075b=_0x402b[_0x14d034];return _0x37075b;};'use strict';var Sequelize=require(_0xb402('0x0'));module[_0xb402('0x1')]={'name':{'type':Sequelize[_0xb402('0x2')],'allowNull':![],'unique':_0xb402('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x5'),_0xb402('0x6')),'allowNull':![],'defaultValue':_0xb402('0x5')},'musiconhold':{'type':Sequelize[_0xb402('0x2')],'defaultValue':_0xb402('0x7')},'announce':{'type':Sequelize[_0xb402('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0xb402('0x8'),_0xb402('0x9'),_0xb402('0xa'),_0xb402('0xb'),_0xb402('0xc'),'wrandom',_0xb402('0xd')),'allowNull':![],'defaultValue':_0xb402('0xe'),'set':function(_0x207296){this[_0xb402('0xf')](_0xb402('0x10'),_0x207296?_0x207296:_0xb402('0xb'));},'get':function(){var _0x476a6d=this['getDataValue'](_0xb402('0x11'));var _0x59ebbe=this[_0xb402('0x12')]('dialMethod');var _0x33451f=this['getDataValue'](_0xb402('0x10'));if(_0x476a6d===_0xb402('0x5')){return _0x33451f;}if(_0x59ebbe===_0xb402('0x13')&&_0x33451f===_0xb402('0xb')||_0x59ebbe==='booked'&&_0x33451f==='roundrobin'){return _0x33451f;}if(_0x59ebbe===_0xb402('0x14')||_0x59ebbe===_0xb402('0x15')||_0x59ebbe===_0xb402('0x16')){return _0x33451f;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xb402('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':_0xb402('0x18')},'autopause':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no',_0xb402('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb402('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb402('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no',_0xb402('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb402('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb402('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb402('0x2')]},'queue_youarenext':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb402('0x2')]},'queue_quantity1':{'type':Sequelize[_0xb402('0x2')]},'queue_quantity2':{'type':Sequelize[_0xb402('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xb402('0x2')]},'queue_less_than':{'type':Sequelize[_0xb402('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x3577cc){this[_0xb402('0xf')](_0xb402('0x1b'),_0x3577cc?_0x3577cc[_0xb402('0x1c')](','):[]);},'get':function(){return this[_0xb402('0x12')](_0xb402('0x1b'))?this[_0xb402('0x12')](_0xb402('0x1b'))[_0xb402('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0xb402('0x2')],'defaultValue':_0xb402('0x18'),'set':function(_0x29196a){this[_0xb402('0xf')](_0xb402('0x1e'),_0x29196a?_0x29196a[_0xb402('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xb402('0x1e'))?this[_0xb402('0x12')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb402('0x2')],'defaultValue':'no','set':function(_0x1f41fa){this[_0xb402('0xf')](_0xb402('0x1f'),_0x1f41fa?_0x1f41fa['join'](','):undefined);},'get':function(){return this[_0xb402('0x12')](_0xb402('0x1f'))?this[_0xb402('0x12')](_0xb402('0x1f'))[_0xb402('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xb402('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xb402('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb402('0x2')]},'description':{'type':Sequelize[_0xb402('0x2')]},'acw':{'type':Sequelize[_0xb402('0x20')],'defaultValue':0x0,'set':function(_0x5562f1){this[_0xb402('0xf')](_0xb402('0x21'),_0x5562f1);if(_0x5562f1){if(this[_0xb402('0x12')](_0xb402('0x22'))<0x2){this[_0xb402('0xf')](_0xb402('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb402('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb402('0x20')],'defaultValue':0x0,'comment':_0xb402('0x23')},'dialMethod':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x24'),_0xb402('0x14'),_0xb402('0x16'),_0xb402('0x15'),_0xb402('0x13')),'defaultValue':'progressive','comment':_0xb402('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xb402('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb402('0x27')},'dialLimitQueue':{'type':Sequelize[_0xb402('0x17')](0x4)[_0xb402('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb402('0x28')},'dialPowerLevel':{'type':Sequelize[_0xb402('0x29')](0x2)[_0xb402('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb402('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x2b'),_0xb402('0x2c')),'defaultValue':'dropRate','comment':_0xb402('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb402('0x29')](0x2)[_0xb402('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb402('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb402('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb402('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x2f')},'dialQueueOptions':{'type':Sequelize[_0xb402('0x2')],'defaultValue':_0xb402('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb402('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x31')},'dialQueueProject':{'type':Sequelize[_0xb402('0x2')],'comment':_0xb402('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x34')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb402('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0x3,'comment':_0xb402('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb402('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xb402('0x39')},'dialPrefix':{'type':Sequelize[_0xb402('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x3a'),_0xb402('0x3b'),_0xb402('0x3c')),'defaultValue':_0xb402('0x3a')},'dialAMDActive':{'type':Sequelize[_0xb402('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb402('0x17')](0x9)[_0xb402('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb402('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xb402('0x17')](0x9)[_0xb402('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb402('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb402('0x17')](0x9)[_0xb402('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb402('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb402('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb402('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb402('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb402('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb402('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb402('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb402('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb402('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb402('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0xb402('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xb402('0x20')],'defaultValue':0x0,'comment':_0xb402('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb402('0x4')](_0xb402('0x45'),_0xb402('0x46')),'defaultValue':_0xb402('0x45')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xb402('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb402('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb402('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb402('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb402('0x47')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xb402('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb402('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb402('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb402('0x17')](0x5)[_0xb402('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb402('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb402('0x17')],'allowNull':!![],'comment':_0xb402('0x51')},'mandatoryDisposition':{'type':Sequelize[_0xb402('0x20')],'defaultValue':![],'comment':_0xb402('0x52'),'set':function(_0x3e3106){if(!_0x3e3106)this['setDataValue'](_0xb402('0x53'),null);this['setDataValue'](_0xb402('0x54'),_0x3e3106);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb402('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb402('0x17')](0x3)[_0xb402('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb402('0x20')],'defaultValue':!![]}}; \ No newline at end of file +var _0xeb8b=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','outbound','inbound','ringall','leastrecent','linear','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','acw','wrapuptime','predictive','Dial\x20Method.','UNSIGNED','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x19d442,_0x82f6fb){var _0x4eb341=function(_0x27bff7){while(--_0x27bff7){_0x19d442['push'](_0x19d442['shift']());}};_0x4eb341(++_0x82f6fb);}(_0xeb8b,0x199));var _0xbeb8=function(_0xd24889,_0xecec21){_0xd24889=_0xd24889-0x0;var _0x349ed2=_0xeb8b[_0xd24889];return _0x349ed2;};'use strict';var Sequelize=require('sequelize');module[_0xbeb8('0x0')]={'name':{'type':Sequelize[_0xbeb8('0x1')],'allowNull':![],'unique':_0xbeb8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbeb8('0x3')]('inbound',_0xbeb8('0x4')),'allowNull':![],'defaultValue':_0xbeb8('0x5')},'musiconhold':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xbeb8('0x3')]('rr',_0xbeb8('0x6'),_0xbeb8('0x7'),'fewestcalls','random','rrmemory',_0xbeb8('0x8'),'wrandom',_0xbeb8('0x9')),'allowNull':![],'defaultValue':_0xbeb8('0x6'),'set':function(_0x63df27){this[_0xbeb8('0xa')](_0xbeb8('0xb'),_0x63df27?_0x63df27:_0xbeb8('0xc'));},'get':function(){var _0x4af2af=this[_0xbeb8('0xd')](_0xbeb8('0xe'));var _0x1b53c1=this['getDataValue'](_0xbeb8('0xf'));var _0x53dd1b=this[_0xbeb8('0xd')](_0xbeb8('0xb'));if(_0x4af2af===_0xbeb8('0x5')){return _0x53dd1b;}if(_0x1b53c1===_0xbeb8('0x10')&&_0x53dd1b===_0xbeb8('0xc')||_0x1b53c1===_0xbeb8('0x10')&&_0x53dd1b===_0xbeb8('0x11')){return _0x53dd1b;}if(_0x1b53c1==='progressive'||_0x1b53c1==='predictive'||_0x1b53c1===_0xbeb8('0x12')){return _0x53dd1b;}return null;}},'servicelevel':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xbeb8('0x13')](0xb)},'timeout':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xbeb8('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xbeb8('0x14'),'no'),'defaultValue':_0xbeb8('0x14')},'autopause':{'type':Sequelize[_0xbeb8('0x3')]('yes','no',_0xbeb8('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xbeb8('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xbeb8('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xbeb8('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xbeb8('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xbeb8('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xbeb8('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xbeb8('0x14'),'no'),'defaultValue':_0xbeb8('0x14')},'announce_holdtime':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no',_0xbeb8('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0xbeb8('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xbeb8('0x1')]},'queue_youarenext':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xbeb8('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xbeb8('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xbeb8('0x1')]},'queue_less_than':{'type':Sequelize[_0xbeb8('0x1')]},'periodic_announce':{'type':Sequelize[_0xbeb8('0x17')],'set':function(_0x32a2ff){this[_0xbeb8('0xa')]('periodic_announce',_0x32a2ff?_0x32a2ff[_0xbeb8('0x18')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0xbeb8('0xd')](_0xbeb8('0x19'))[_0xbeb8('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x4cfc9a){this[_0xbeb8('0xa')](_0xbeb8('0x1b'),_0x4cfc9a?_0x4cfc9a['join'](','):undefined);},'get':function(){return this[_0xbeb8('0xd')](_0xbeb8('0x1b'))?this[_0xbeb8('0xd')](_0xbeb8('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4e2631){this['setDataValue']('leavewhenempty',_0x4e2631?_0x4e2631['join'](','):undefined);},'get':function(){return this[_0xbeb8('0xd')]('leavewhenempty')?this['getDataValue']('leavewhenempty')[_0xbeb8('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xbeb8('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xbeb8('0x1')]},'description':{'type':Sequelize[_0xbeb8('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3007cc){this[_0xbeb8('0xa')](_0xbeb8('0x1c'),_0x3007cc);if(_0x3007cc){if(this['getDataValue']('wrapuptime')<0x2){this[_0xbeb8('0xa')](_0xbeb8('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xbeb8('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xbeb8('0x3')]('preview','progressive',_0xbeb8('0x12'),_0xbeb8('0x1e'),_0xbeb8('0x10')),'defaultValue':'progressive','comment':_0xbeb8('0x1f')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xbeb8('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xbeb8('0x13')](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)[_0xbeb8('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xbeb8('0x3')](_0xbeb8('0x21'),_0xbeb8('0x22')),'defaultValue':'dropRate','comment':_0xbeb8('0x23')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xbeb8('0x24')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xbeb8('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xbeb8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbeb8('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x25')},'dialQueueOptions':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':_0xbeb8('0x26'),'comment':_0xbeb8('0x27')},'dialQueueTimeout':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x28')},'dialQueueProject':{'type':Sequelize[_0xbeb8('0x1')],'comment':_0xbeb8('0x29')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x2a')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)[_0xbeb8('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbeb8('0x2b')},'dialBusyMaxRetry':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x2c')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbeb8('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbeb8('0x2e')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbeb8('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbeb8('0x2f')},'dialTimezone':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xbeb8('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xbeb8('0x30'),_0xbeb8('0x31'),_0xbeb8('0x32')),'defaultValue':_0xbeb8('0x30')},'dialAMDActive':{'type':Sequelize[_0xbeb8('0x33')],'defaultValue':0x0,'comment':_0xbeb8('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0xbeb8('0x13')](0x9)[_0xbeb8('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbeb8('0x35')},'dialAMDGreeting':{'type':Sequelize[_0xbeb8('0x13')](0x9)[_0xbeb8('0x20')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbeb8('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbeb8('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0xbeb8('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbeb8('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbeb8('0x13')](0x9)[_0xbeb8('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbeb8('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbeb8('0x13')](0x9)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbeb8('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbeb8('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xbeb8('0x13')](0x5)[_0xbeb8('0x20')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xbeb8('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0xbeb8('0x33')],'defaultValue':0x0,'comment':_0xbeb8('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbeb8('0x3')]('DESC',_0xbeb8('0x3d')),'defaultValue':_0xbeb8('0x3e')},'dialQueueProject2':{'type':Sequelize[_0xbeb8('0x1')],'comment':_0xbeb8('0x29')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbeb8('0x3f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xbeb8('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbeb8('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbeb8('0x42')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)[_0xbeb8('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbeb8('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)[_0xbeb8('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbeb8('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)[_0xbeb8('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbeb8('0x13')](0x3)[_0xbeb8('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbeb8('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbeb8('0x13')](0x5)[_0xbeb8('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbeb8('0x13')],'allowNull':!![],'comment':_0xbeb8('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xbeb8('0x33')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x48b2bb){if(!_0x48b2bb)this[_0xbeb8('0xa')](_0xbeb8('0x4a'),null);this[_0xbeb8('0xa')](_0xbeb8('0x4b'),_0x48b2bb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xbeb8('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xbeb8('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xbeb8('0x33')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 1f94471..7f7c1d9 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 _0xec26=['apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','type','UserProfileResource','status','sendStatus','error','stack','name','send','index','VoiceQueue','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','limit','order','sort','where','merge','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','nolimit','pick','findOne','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','upsert','findOrCreate','UserVoiceQueueRt','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','userVoiceQueue:remove','addAgents','isNil','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','ListId','NOW()','scheduledAt','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','cm_hopper','onlyIfOpen','insert','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','end','json','undefined','count','offset'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0xec26,0x95));var _0x6ec2=function(_0x39afb0,_0x58a575){_0x39afb0=_0x39afb0-0x0;var _0xa89370=_0xec26[_0x39afb0];return _0xa89370;};'use strict';var emlformat=require(_0x6ec2('0x0'));var rimraf=require(_0x6ec2('0x1'));var zipdir=require(_0x6ec2('0x2'));var jsonpatch=require(_0x6ec2('0x3'));var rp=require(_0x6ec2('0x4'));var moment=require(_0x6ec2('0x5'));var BPromise=require(_0x6ec2('0x6'));var Mustache=require(_0x6ec2('0x7'));var util=require(_0x6ec2('0x8'));var path=require(_0x6ec2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6ec2('0xa'));var fs=require('fs');var fs_extra=require(_0x6ec2('0xb'));var _=require(_0x6ec2('0xc'));var squel=require(_0x6ec2('0xd'));var crypto=require('crypto');var jsforce=require(_0x6ec2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6ec2('0xf'));var querystring=require(_0x6ec2('0x10'));var Papa=require(_0x6ec2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ec2('0x12'));var hardwareService=require(_0x6ec2('0x13'));var logger=require(_0x6ec2('0x14'))(_0x6ec2('0x15'));var utils=require('../../config/utils');var config=require(_0x6ec2('0x16'));var licenseUtil=require(_0x6ec2('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6ec2('0x18')],{'host':_0x6ec2('0x19'),'port':0x18eb});var socket=require(_0x6ec2('0x1a'))(new Redis(config[_0x6ec2('0x18')]));require(_0x6ec2('0x1b'))[_0x6ec2('0x1c')](socket);function respondWithStatusCode(_0x3ab4f1,_0x28f382){_0x28f382=_0x28f382||0xcc;return function(_0x1cceab){if(_0x1cceab){return _0x3ab4f1['sendStatus'](_0x28f382);}return _0x3ab4f1['status'](_0x28f382)[_0x6ec2('0x1d')]();};}function respondWithResult(_0x44c71c,_0x44dbe1){_0x44dbe1=_0x44dbe1||0xc8;return function(_0x4b08aa){if(_0x4b08aa){return _0x44c71c['status'](_0x44dbe1)[_0x6ec2('0x1e')](_0x4b08aa);}};}function respondWithFilteredResult(_0x185ea,_0xc84944){return function(_0x5ae334){if(_0x5ae334){var _0x17d413=typeof _0xc84944['offset']==='undefined'&&typeof _0xc84944['limit']===_0x6ec2('0x1f');var _0x4fc521=_0x5ae334[_0x6ec2('0x20')];var _0x515795=_0x17d413?0x0:_0xc84944['offset'];var _0x1c1ea5=_0x17d413?_0x5ae334['count']:_0xc84944[_0x6ec2('0x21')]+_0xc84944['limit'];var _0x2c0239;if(_0x1c1ea5>=_0x4fc521){_0x1c1ea5=_0x4fc521;_0x2c0239=0xc8;}else{_0x2c0239=0xce;}_0x185ea['status'](_0x2c0239);return _0x185ea['set']('Content-Range',_0x515795+'-'+_0x1c1ea5+'/'+_0x4fc521)[_0x6ec2('0x1e')](_0x5ae334);}return null;};}function patchUpdates(_0x47e347){return function(_0xcb43d7){try{jsonpatch[_0x6ec2('0x22')](_0xcb43d7,_0x47e347,!![]);}catch(_0x16dec8){return BPromise[_0x6ec2('0x23')](_0x16dec8);}return _0xcb43d7[_0x6ec2('0x24')]();};}function saveUpdates(_0x1f2b9c,_0x11c22a){return function(_0x51614f){if(_0x51614f){return _0x51614f[_0x6ec2('0x25')](_0x1f2b9c)[_0x6ec2('0x26')](function(_0x4872ae){return _0x4872ae;});}return null;};}function removeEntity(_0x1a6e9b,_0x235864){return function(_0x335fd5){if(_0x335fd5){return _0x335fd5[_0x6ec2('0x27')]()[_0x6ec2('0x26')](function(){var _0x5513a2=_0x335fd5[_0x6ec2('0x28')]({'plain':!![]});var _0x1d9fd2=[{'name':_0x6ec2('0x29'),'value':'inbound','ignore':![]},{'name':_0x6ec2('0x2a'),'value':_0x6ec2('0x2b'),'ignore':![]}];var _0x377960=_(_0x1d9fd2)[_0x6ec2('0x2c')](_0x6ec2('0x2d'))[_0x6ec2('0x2e')](_0x6ec2('0x2f'))['value']();if(_['includes'](_0x377960,_0x5513a2[_0x6ec2('0x30')])){return;}var _0x4a3f91=_['find'](_0x1d9fd2,[_0x6ec2('0x2f'),_0x5513a2[_0x6ec2('0x30')]])['name'];return db[_0x6ec2('0x31')]['destroy']({'where':{'type':_0x4a3f91,'resourceId':_0x5513a2['id']}})[_0x6ec2('0x26')](function(){return _0x335fd5;});})[_0x6ec2('0x26')](function(){_0x1a6e9b[_0x6ec2('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f9f0,_0x3e7bc8){return function(_0x33162c){if(!_0x33162c){_0x53f9f0[_0x6ec2('0x33')](0x194);}return _0x33162c;};}function handleError(_0x312faf,_0x438ecf){_0x438ecf=_0x438ecf||0x1f4;return function(_0x54ff8c){logger[_0x6ec2('0x34')](_0x54ff8c[_0x6ec2('0x35')]);if(_0x54ff8c[_0x6ec2('0x36')]){delete _0x54ff8c[_0x6ec2('0x36')];}_0x312faf['status'](_0x438ecf)[_0x6ec2('0x37')](_0x54ff8c);};}exports[_0x6ec2('0x38')]=function(_0x443f4e,_0x243d60){var _0x89304={},_0x22baa6={},_0x57c35c={'count':0x0,'rows':[]};var _0x3852a0=_[_0x6ec2('0x2e')](db[_0x6ec2('0x39')]['rawAttributes'],function(_0x19cec2){return{'name':_0x19cec2['fieldName'],'type':_0x19cec2[_0x6ec2('0x30')][_0x6ec2('0x3a')]};});_0x22baa6[_0x6ec2('0x3b')]=_[_0x6ec2('0x2e')](_0x3852a0,_0x6ec2('0x36'));_0x22baa6[_0x6ec2('0x3c')]=_['keys'](_0x443f4e[_0x6ec2('0x3c')]);_0x22baa6[_0x6ec2('0x3d')]=_[_0x6ec2('0x3e')](_0x22baa6[_0x6ec2('0x3b')],_0x22baa6[_0x6ec2('0x3c')]);_0x89304['attributes']=_[_0x6ec2('0x3e')](_0x22baa6[_0x6ec2('0x3b')],qs['fields'](_0x443f4e['query'][_0x6ec2('0x3f')]));_0x89304['attributes']=_0x89304['attributes'][_0x6ec2('0x40')]?_0x89304[_0x6ec2('0x41')]:_0x22baa6['model'];if(!_0x443f4e['query'][_0x6ec2('0x42')]('nolimit')){_0x89304[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x443f4e[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x89304[_0x6ec2('0x21')]=qs['offset'](_0x443f4e['query'][_0x6ec2('0x21')]);}_0x89304[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0x443f4e['query'][_0x6ec2('0x45')]);_0x89304[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_['pick'](_0x443f4e[_0x6ec2('0x3c')],_0x22baa6[_0x6ec2('0x3d')]),_0x3852a0);if(_0x443f4e[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x89304[_0x6ec2('0x46')]=_['merge'](_0x89304[_0x6ec2('0x46')],{'$or':_['map'](_0x3852a0,function(_0x37abf6){if(_0x37abf6[_0x6ec2('0x30')]!=='VIRTUAL'){var _0x1dc6a0={};_0x1dc6a0[_0x37abf6['name']]={'$like':'%'+_0x443f4e[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0x1dc6a0;}})});}_0x89304=_[_0x6ec2('0x47')]({},_0x89304,_0x443f4e[_0x6ec2('0x48')]);var _0x1acef3={'where':_0x89304[_0x6ec2('0x46')]};return db[_0x6ec2('0x39')]['count'](_0x1acef3)['then'](function(_0x46aa65){_0x57c35c[_0x6ec2('0x20')]=_0x46aa65;if(_0x443f4e['query']['includeAll']){_0x89304[_0x6ec2('0x49')]=[{'all':!![]}];}return db[_0x6ec2('0x39')][_0x6ec2('0x4a')](_0x89304);})[_0x6ec2('0x26')](function(_0x1760e7){_0x57c35c[_0x6ec2('0x4b')]=_0x1760e7;return _0x57c35c;})[_0x6ec2('0x26')](respondWithFilteredResult(_0x243d60,_0x89304))[_0x6ec2('0x4c')](handleError(_0x243d60,null));};exports['show']=function(_0xc5f4a0,_0x1e000f){var _0x5935be={'raw':![],'where':{'id':_0xc5f4a0[_0x6ec2('0x4d')]['id']}},_0x45f1d5={};_0x45f1d5['model']=_[_0x6ec2('0x4e')](db[_0x6ec2('0x39')][_0x6ec2('0x4f')]);_0x45f1d5['query']=_['keys'](_0xc5f4a0[_0x6ec2('0x3c')]);_0x45f1d5[_0x6ec2('0x3d')]=_[_0x6ec2('0x3e')](_0x45f1d5['model'],_0x45f1d5['query']);_0x5935be[_0x6ec2('0x41')]=_['intersection'](_0x45f1d5[_0x6ec2('0x3b')],qs[_0x6ec2('0x3f')](_0xc5f4a0[_0x6ec2('0x3c')][_0x6ec2('0x3f')]));_0x5935be['attributes']=_0x5935be[_0x6ec2('0x41')]['length']?_0x5935be[_0x6ec2('0x41')]:_0x45f1d5['model'];if(_0xc5f4a0[_0x6ec2('0x3c')][_0x6ec2('0x50')]){_0x5935be['include']=[{'all':!![]}];}_0x5935be=_[_0x6ec2('0x47')]({},_0x5935be,_0xc5f4a0['options']);return db[_0x6ec2('0x39')][_0x6ec2('0x51')](_0x5935be)[_0x6ec2('0x26')](handleEntityNotFound(_0x1e000f,null))[_0x6ec2('0x26')](respondWithResult(_0x1e000f,null))[_0x6ec2('0x4c')](handleError(_0x1e000f,null));};exports[_0x6ec2('0x52')]=function(_0x2683df,_0x284a48){return db[_0x6ec2('0x39')]['create'](_0x2683df[_0x6ec2('0x53')],{})[_0x6ec2('0x26')](function(_0x3dafd4){var _0x7b3ca9=_0x2683df[_0x6ec2('0x54')][_0x6ec2('0x28')]({'plain':!![]});if(!_0x7b3ca9)throw new Error(_0x6ec2('0x55'));if(_0x7b3ca9['role']==='user'){var _0x51c80a=_0x3dafd4['get']({'plain':!![]});var _0x5a41c8=[{'name':_0x6ec2('0x29'),'value':_0x6ec2('0x56')},{'name':_0x6ec2('0x2a'),'value':_0x6ec2('0x2b')}];var _0x32c8c1=_['find'](_0x5a41c8,[_0x6ec2('0x2f'),_0x51c80a[_0x6ec2('0x30')]])[_0x6ec2('0x36')];return db[_0x6ec2('0x57')][_0x6ec2('0x51')]({'where':{'name':_0x32c8c1,'userProfileId':_0x7b3ca9[_0x6ec2('0x58')]},'raw':!![]})[_0x6ec2('0x26')](function(_0x171feb){if(_0x171feb&&_0x171feb[_0x6ec2('0x59')]===0x0){return db[_0x6ec2('0x31')][_0x6ec2('0x52')]({'name':_0x51c80a[_0x6ec2('0x36')],'resourceId':_0x51c80a['id'],'type':_0x171feb['name'],'sectionId':_0x171feb['id']},{})[_0x6ec2('0x26')](function(){return _0x3dafd4;});}else{return _0x3dafd4;}})[_0x6ec2('0x4c')](function(_0x5b7e13){logger[_0x6ec2('0x34')](_0x6ec2('0x5a'),_0x5b7e13);throw _0x5b7e13;});}return _0x3dafd4;})[_0x6ec2('0x26')](respondWithResult(_0x284a48,0xc9))[_0x6ec2('0x4c')](handleError(_0x284a48,null));};exports[_0x6ec2('0x5b')]=function(_0x3dc66f,_0x3fac7d){var _0x577d0b={'where':{'id':_0x3dc66f[_0x6ec2('0x4d')]['id']}},_0x52e311={};_0x52e311[_0x6ec2('0x3b')]=_[_0x6ec2('0x4e')](db[_0x6ec2('0x39')][_0x6ec2('0x4f')]);_0x577d0b[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x52e311[_0x6ec2('0x3b')],qs['fields'](_0x3dc66f['query']['fields']));_0x577d0b[_0x6ec2('0x41')]=_0x577d0b['attributes']['length']?_0x577d0b[_0x6ec2('0x41')]:_0x52e311[_0x6ec2('0x3b')];if(_0x3dc66f['query'][_0x6ec2('0x50')]){_0x577d0b[_0x6ec2('0x49')]=[{'all':!![]}];}_0x577d0b=_['merge']({},_0x577d0b,_0x3dc66f[_0x6ec2('0x48')]);return db[_0x6ec2('0x39')][_0x6ec2('0x51')](_0x577d0b)['then'](handleEntityNotFound(_0x3fac7d,null))[_0x6ec2('0x26')](function(_0x82442b){if(_0x82442b){var _0x4b68ab=_0x82442b['get']({'plain':!![]});_0x4b68ab=qs[_0x6ec2('0x5c')](_0x4b68ab,['id',_0x6ec2('0x5d'),_0x6ec2('0x5e')]);_0x3dc66f['body']=_[_0x6ec2('0x5c')](_0x3dc66f['body'],['id','createdAt',_0x6ec2('0x5e')]);return db[_0x6ec2('0x39')][_0x6ec2('0x52')](_[_0x6ec2('0x47')](_0x4b68ab,_0x3dc66f[_0x6ec2('0x53')]),{'include':_0x3dc66f['query'][_0x6ec2('0x50')]?[{'all':!![]}]:undefined})[_0x6ec2('0x26')](function(_0x2ccf07){var _0x4f2547=_0x3dc66f[_0x6ec2('0x54')][_0x6ec2('0x28')]({'plain':!![]});if(!_0x4f2547)throw new Error(_0x6ec2('0x55'));if(_0x4f2547['role']===_0x6ec2('0x54')){var _0x279ec2=_0x2ccf07[_0x6ec2('0x28')]({'plain':!![]});var _0xdde8b=[{'name':_0x6ec2('0x29'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x6ec2('0x2b')}];var _0x49f799=_[_0x6ec2('0x51')](_0xdde8b,['value',_0x279ec2[_0x6ec2('0x30')]])['name'];return db[_0x6ec2('0x57')][_0x6ec2('0x51')]({'where':{'name':_0x49f799,'userProfileId':_0x4f2547['userProfileId']},'raw':!![]})[_0x6ec2('0x26')](function(_0x39b262){if(_0x39b262&&_0x39b262[_0x6ec2('0x59')]===0x0){return db[_0x6ec2('0x31')][_0x6ec2('0x52')]({'name':_0x279ec2[_0x6ec2('0x36')],'resourceId':_0x279ec2['id'],'type':_0x39b262[_0x6ec2('0x36')],'sectionId':_0x39b262['id']},{})['then'](function(){return _0x2ccf07;});}else{return _0x2ccf07;}})['catch'](function(_0x285781){logger[_0x6ec2('0x34')](_0x6ec2('0x5a'),_0x285781);throw _0x285781;});}return _0x2ccf07;});}})['then'](respondWithResult(_0x3fac7d,0xc9))[_0x6ec2('0x4c')](handleError(_0x3fac7d,null));};exports[_0x6ec2('0x25')]=function(_0x1bef93,_0x1ccf82){if(_0x1bef93[_0x6ec2('0x53')]['id']){delete _0x1bef93[_0x6ec2('0x53')]['id'];}return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x1bef93[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x1ccf82,null))[_0x6ec2('0x26')](saveUpdates(_0x1bef93[_0x6ec2('0x53')],null))['then'](respondWithResult(_0x1ccf82,null))['catch'](handleError(_0x1ccf82,null));};exports[_0x6ec2('0x27')]=function(_0x37331a,_0x8f3ef0){return db['VoiceQueue'][_0x6ec2('0x51')]({'where':{'id':_0x37331a[_0x6ec2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x8f3ef0,null))[_0x6ec2('0x26')](removeEntity(_0x8f3ef0,null))[_0x6ec2('0x4c')](handleError(_0x8f3ef0,null));};exports[_0x6ec2('0x5f')]=function(_0x52ddb9,_0x31aea1,_0x351b4e){var _0x5ed16b={'raw':![],'where':{}};var _0x80a769={};var _0x1d5aaa={'count':0x0,'rows':[]};return db[_0x6ec2('0x39')]['findOne']({'where':{'id':_0x52ddb9[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x31aea1,null))[_0x6ec2('0x26')](function(_0x6b5d2c){if(_0x6b5d2c){_0x80a769[_0x6ec2('0x3b')]=_['keys'](db[_0x6ec2('0x60')][_0x6ec2('0x4f')]);_0x80a769['query']=_[_0x6ec2('0x4e')](_0x52ddb9[_0x6ec2('0x3c')]);_0x80a769[_0x6ec2('0x3d')]=_['intersection'](_0x80a769[_0x6ec2('0x3b')],_0x80a769[_0x6ec2('0x3c')]);_0x5ed16b[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x80a769[_0x6ec2('0x3b')],qs[_0x6ec2('0x3f')](_0x52ddb9['query'][_0x6ec2('0x3f')]));_0x5ed16b[_0x6ec2('0x41')]=_0x5ed16b['attributes'][_0x6ec2('0x40')]?_0x5ed16b[_0x6ec2('0x41')]:_0x80a769[_0x6ec2('0x3b')];if(!_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x5ed16b[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x5ed16b[_0x6ec2('0x21')]=qs[_0x6ec2('0x21')](_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x21')]);}_0x5ed16b[_0x6ec2('0x44')]=qs['sort'](_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x45')]);_0x5ed16b[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_[_0x6ec2('0x62')](_0x52ddb9['query'],_0x80a769[_0x6ec2('0x3d')]));_0x5ed16b[_0x6ec2('0x46')]['VoiceQueueId']=_0x6b5d2c['id'];if(_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x5ed16b[_0x6ec2('0x46')]=_['merge'](_0x5ed16b[_0x6ec2('0x46')],{'$or':_[_0x6ec2('0x2e')](_0x5ed16b[_0x6ec2('0x41')],function(_0x2ad2b1){var _0x1ac6de={};_0x1ac6de[_0x2ad2b1]={'$like':'%'+_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0x1ac6de;})});}_0x5ed16b=_[_0x6ec2('0x47')]({},_0x5ed16b,_0x52ddb9[_0x6ec2('0x48')]);return db['CmHopper'][_0x6ec2('0x20')]({'where':_0x5ed16b[_0x6ec2('0x46')]})['then'](function(_0x19960f){_0x1d5aaa[_0x6ec2('0x20')]=_0x19960f;if(_0x52ddb9[_0x6ec2('0x3c')][_0x6ec2('0x50')]){_0x5ed16b[_0x6ec2('0x49')]=[{'all':!![]}];}return db[_0x6ec2('0x60')]['findAll'](_0x5ed16b);})[_0x6ec2('0x26')](function(_0x51ef72){_0x1d5aaa[_0x6ec2('0x4b')]=_0x51ef72;return _0x1d5aaa;});}})[_0x6ec2('0x26')](respondWithFilteredResult(_0x31aea1,_0x5ed16b))[_0x6ec2('0x4c')](handleError(_0x31aea1,null));};exports['getHopperHistories']=function(_0x243461,_0x59a112,_0x12adb9){var _0x346a3a={'raw':!![],'where':{}};var _0x411f51={};var _0x56ecef={'count':0x0,'rows':[]};return db[_0x6ec2('0x39')][_0x6ec2('0x63')]({'where':{'id':_0x243461['params']['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x59a112,null))['then'](function(_0x4f8c13){if(_0x4f8c13){_0x411f51[_0x6ec2('0x3b')]=_['keys'](db[_0x6ec2('0x64')][_0x6ec2('0x4f')]);_0x411f51['query']=_['keys'](_0x243461[_0x6ec2('0x3c')]);_0x411f51[_0x6ec2('0x3d')]=_[_0x6ec2('0x3e')](_0x411f51[_0x6ec2('0x3b')],_0x411f51[_0x6ec2('0x3c')]);_0x346a3a[_0x6ec2('0x41')]=_['intersection'](_0x411f51[_0x6ec2('0x3b')],qs['fields'](_0x243461['query'][_0x6ec2('0x3f')]));_0x346a3a[_0x6ec2('0x41')]=_0x346a3a[_0x6ec2('0x41')][_0x6ec2('0x40')]?_0x346a3a[_0x6ec2('0x41')]:_0x411f51['model'];if(!_0x243461[_0x6ec2('0x3c')][_0x6ec2('0x42')]('nolimit')){_0x346a3a[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x243461['query']['limit']);_0x346a3a[_0x6ec2('0x21')]=qs['offset'](_0x243461['query'][_0x6ec2('0x21')]);}_0x346a3a[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0x243461[_0x6ec2('0x3c')][_0x6ec2('0x45')]);_0x346a3a['where']=qs['filters'](_[_0x6ec2('0x62')](_0x243461[_0x6ec2('0x3c')],_0x411f51['filters']));_0x346a3a[_0x6ec2('0x46')][_0x6ec2('0x65')]=_0x4f8c13['id'];if(_0x243461[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x346a3a['where']=_['merge'](_0x346a3a[_0x6ec2('0x46')],{'$or':_[_0x6ec2('0x2e')](_0x346a3a[_0x6ec2('0x41')],function(_0x5d6bd6){var _0x2e5e9a={};_0x2e5e9a[_0x5d6bd6]={'$like':'%'+_0x243461['query'][_0x6ec2('0x2c')]+'%'};return _0x2e5e9a;})});}_0x346a3a=_[_0x6ec2('0x47')]({},_0x346a3a,_0x243461[_0x6ec2('0x48')]);return db[_0x6ec2('0x64')][_0x6ec2('0x20')]({'where':_0x346a3a['where']})[_0x6ec2('0x26')](function(_0x3b94aa){_0x56ecef[_0x6ec2('0x20')]=_0x3b94aa;if(_0x243461['query'][_0x6ec2('0x50')]){_0x346a3a[_0x6ec2('0x49')]=[{'all':!![]}];}return db[_0x6ec2('0x64')][_0x6ec2('0x4a')](_0x346a3a);})[_0x6ec2('0x26')](function(_0x3ab00f){_0x56ecef[_0x6ec2('0x4b')]=_0x3ab00f;return _0x56ecef;});}})['then'](respondWithFilteredResult(_0x59a112,_0x346a3a))['catch'](handleError(_0x59a112,null));};exports[_0x6ec2('0x66')]=function(_0x586729,_0x55f0ca,_0x4f1d3b){var _0x531e90={'raw':!![],'where':{}};var _0x2b98a2={};var _0x226491={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6ec2('0x63')]({'where':{'id':_0x586729['params']['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x55f0ca,null))[_0x6ec2('0x26')](function(_0x3a3824){if(_0x3a3824){_0x2b98a2[_0x6ec2('0x3b')]=_[_0x6ec2('0x4e')](db[_0x6ec2('0x67')][_0x6ec2('0x4f')]);_0x2b98a2[_0x6ec2('0x3c')]=_[_0x6ec2('0x4e')](_0x586729[_0x6ec2('0x3c')]);_0x2b98a2[_0x6ec2('0x3d')]=_[_0x6ec2('0x3e')](_0x2b98a2[_0x6ec2('0x3b')],_0x2b98a2[_0x6ec2('0x3c')]);_0x531e90[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x2b98a2['model'],qs[_0x6ec2('0x3f')](_0x586729[_0x6ec2('0x3c')][_0x6ec2('0x3f')]));_0x531e90[_0x6ec2('0x41')]=_0x531e90[_0x6ec2('0x41')][_0x6ec2('0x40')]?_0x531e90[_0x6ec2('0x41')]:_0x2b98a2['model'];if(!_0x586729['query'][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x531e90[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x586729[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x531e90['offset']=qs[_0x6ec2('0x21')](_0x586729[_0x6ec2('0x3c')]['offset']);}_0x531e90[_0x6ec2('0x44')]=qs['sort'](_0x586729[_0x6ec2('0x3c')]['sort']);_0x531e90[_0x6ec2('0x46')]=qs['filters'](_[_0x6ec2('0x62')](_0x586729[_0x6ec2('0x3c')],_0x2b98a2[_0x6ec2('0x3d')]));_0x531e90[_0x6ec2('0x46')]['VoiceQueueId']=_0x3a3824['id'];if(_0x586729[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x531e90[_0x6ec2('0x46')]=_[_0x6ec2('0x47')](_0x531e90['where'],{'$or':_['map'](_0x531e90[_0x6ec2('0x41')],function(_0x251294){var _0x19937a={};_0x19937a[_0x251294]={'$like':'%'+_0x586729[_0x6ec2('0x3c')]['filter']+'%'};return _0x19937a;})});}_0x531e90=_[_0x6ec2('0x47')]({},_0x531e90,_0x586729[_0x6ec2('0x48')]);return db[_0x6ec2('0x67')][_0x6ec2('0x20')]({'where':_0x531e90['where']})[_0x6ec2('0x26')](function(_0x16403c){_0x226491[_0x6ec2('0x20')]=_0x16403c;if(_0x586729[_0x6ec2('0x3c')][_0x6ec2('0x50')]){_0x531e90[_0x6ec2('0x49')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x531e90);})['then'](function(_0x5b1f68){_0x226491[_0x6ec2('0x4b')]=_0x5b1f68;return _0x226491;});}})[_0x6ec2('0x26')](respondWithFilteredResult(_0x55f0ca,_0x531e90))[_0x6ec2('0x4c')](handleError(_0x55f0ca,null));};exports[_0x6ec2('0x68')]=function(_0xe516e3,_0x548449,_0x213245){var _0x4d8a9d={'raw':!![],'where':{}};var _0x3179fe={};var _0x5c513b={'count':0x0,'rows':[]};return db[_0x6ec2('0x39')]['findOne']({'where':{'id':_0xe516e3['params']['id']}})['then'](handleEntityNotFound(_0x548449,null))[_0x6ec2('0x26')](function(_0x3371b9){if(_0x3371b9){_0x3179fe['model']=_[_0x6ec2('0x4e')](db[_0x6ec2('0x69')][_0x6ec2('0x4f')]);_0x3179fe[_0x6ec2('0x3c')]=_[_0x6ec2('0x4e')](_0xe516e3['query']);_0x3179fe[_0x6ec2('0x3d')]=_['intersection'](_0x3179fe[_0x6ec2('0x3b')],_0x3179fe['query']);_0x4d8a9d[_0x6ec2('0x41')]=_['intersection'](_0x3179fe[_0x6ec2('0x3b')],qs[_0x6ec2('0x3f')](_0xe516e3['query'][_0x6ec2('0x3f')]));_0x4d8a9d[_0x6ec2('0x41')]=_0x4d8a9d[_0x6ec2('0x41')][_0x6ec2('0x40')]?_0x4d8a9d[_0x6ec2('0x41')]:_0x3179fe[_0x6ec2('0x3b')];if(!_0xe516e3['query'][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x4d8a9d[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0xe516e3['query'][_0x6ec2('0x43')]);_0x4d8a9d[_0x6ec2('0x21')]=qs[_0x6ec2('0x21')](_0xe516e3[_0x6ec2('0x3c')][_0x6ec2('0x21')]);}_0x4d8a9d['order']=qs[_0x6ec2('0x45')](_0xe516e3[_0x6ec2('0x3c')][_0x6ec2('0x45')]);_0x4d8a9d[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_[_0x6ec2('0x62')](_0xe516e3[_0x6ec2('0x3c')],_0x3179fe[_0x6ec2('0x3d')]));_0x4d8a9d['where'][_0x6ec2('0x65')]=_0x3371b9['id'];if(_0xe516e3[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x4d8a9d[_0x6ec2('0x46')]=_['merge'](_0x4d8a9d['where'],{'$or':_[_0x6ec2('0x2e')](_0x4d8a9d[_0x6ec2('0x41')],function(_0x2b0848){var _0xda3000={};_0xda3000[_0x2b0848]={'$like':'%'+_0xe516e3[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0xda3000;})});}_0x4d8a9d=_['merge']({},_0x4d8a9d,_0xe516e3['options']);return db[_0x6ec2('0x69')][_0x6ec2('0x20')]({'where':_0x4d8a9d['where']})['then'](function(_0x3a58a1){_0x5c513b[_0x6ec2('0x20')]=_0x3a58a1;if(_0xe516e3[_0x6ec2('0x3c')][_0x6ec2('0x50')]){_0x4d8a9d['include']=[{'all':!![]}];}return db[_0x6ec2('0x69')][_0x6ec2('0x4a')](_0x4d8a9d);})[_0x6ec2('0x26')](function(_0x59cf8a){_0x5c513b['rows']=_0x59cf8a;return _0x5c513b;});}})[_0x6ec2('0x26')](respondWithFilteredResult(_0x548449,_0x4d8a9d))[_0x6ec2('0x4c')](handleError(_0x548449,null));};exports[_0x6ec2('0x6a')]=function(_0x2a8cff,_0x51bcbe,_0x2a9c1e){var _0x56aabc={};var _0x2f2286={};var _0x3e23ac;var _0x347cc5;return db[_0x6ec2('0x39')]['findOne']({'where':{'id':_0x2a8cff[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x51bcbe,null))[_0x6ec2('0x26')](function(_0x530147){if(_0x530147){_0x3e23ac=_0x530147;_0x2f2286[_0x6ec2('0x3b')]=_[_0x6ec2('0x4e')](db[_0x6ec2('0x6b')][_0x6ec2('0x4f')]);_0x2f2286[_0x6ec2('0x3c')]=_[_0x6ec2('0x4e')](_0x2a8cff[_0x6ec2('0x3c')]);_0x2f2286['filters']=_[_0x6ec2('0x3e')](_0x2f2286[_0x6ec2('0x3b')],_0x2f2286['query']);_0x56aabc[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x2f2286['model'],qs['fields'](_0x2a8cff[_0x6ec2('0x3c')][_0x6ec2('0x3f')]));_0x56aabc[_0x6ec2('0x41')]=_0x56aabc[_0x6ec2('0x41')]['length']?_0x56aabc[_0x6ec2('0x41')]:_0x2f2286['model'];_0x56aabc[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0x2a8cff[_0x6ec2('0x3c')][_0x6ec2('0x45')]);_0x56aabc[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_[_0x6ec2('0x62')](_0x2a8cff[_0x6ec2('0x3c')],_0x2f2286[_0x6ec2('0x3d')]));if(_0x2a8cff[_0x6ec2('0x3c')]['filter']){_0x56aabc[_0x6ec2('0x46')]=_[_0x6ec2('0x47')](_0x56aabc['where'],{'$or':_[_0x6ec2('0x2e')](_0x56aabc[_0x6ec2('0x41')],function(_0xfb1b77){var _0x544555={};_0x544555[_0xfb1b77]={'$like':'%'+_0x2a8cff[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0x544555;})});}_0x56aabc=_[_0x6ec2('0x47')]({},_0x56aabc,_0x2a8cff[_0x6ec2('0x48')]);return _0x3e23ac[_0x6ec2('0x6a')](_0x56aabc);}})[_0x6ec2('0x26')](function(_0x1b6eab){if(_0x1b6eab){_0x347cc5=_0x1b6eab['length'];if(!_0x2a8cff[_0x6ec2('0x3c')][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x56aabc[_0x6ec2('0x43')]=qs['limit'](_0x2a8cff[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x56aabc[_0x6ec2('0x21')]=qs[_0x6ec2('0x21')](_0x2a8cff[_0x6ec2('0x3c')][_0x6ec2('0x21')]);}return _0x3e23ac[_0x6ec2('0x6a')](_0x56aabc);}})['then'](function(_0x46cc06){if(_0x46cc06){return _0x46cc06?{'count':_0x347cc5,'rows':_0x46cc06}:null;}})[_0x6ec2('0x26')](respondWithResult(_0x51bcbe,null))[_0x6ec2('0x4c')](handleError(_0x51bcbe,null));};exports[_0x6ec2('0x6c')]=function(_0x4c3753,_0x8d5685,_0x4ed6b1){var _0x94386a=_0x4c3753[_0x6ec2('0x53')][_0x6ec2('0x6d')];var _0xe6fc07=_['map'](_0x94386a,'id');return db[_0x6ec2('0x6b')][_0x6ec2('0x4a')]({'where':{'id':_0xe6fc07},'attributes':['id'],'include':[{'model':db[_0x6ec2('0x6e')],'as':'Agents','attributes':['id','name','online',_0x6ec2('0x6f'),_0x6ec2('0x70')],'raw':!![]}]})['then'](function(_0x480b08){if(_0x480b08){var _0xc97ff6=_[_0x6ec2('0x71')](_0x480b08,function(_0x36ed1a){var _0x4eb781=_0x36ed1a[_0x6ec2('0x28')]({'plain':!![]});_0x4eb781[_0x6ec2('0x72')][_0x6ec2('0x73')](function(_0x19d976){_0x19d976[_0x6ec2('0x74')]=_[_0x6ec2('0x51')](_0x94386a,{'id':_0x4eb781['id']})['penalty'];});return _0x4eb781['Agents'];});return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x4c3753[_0x6ec2('0x4d')]['id']}})['then'](function(_0x56c93f){return db[_0x6ec2('0x75')][_0x6ec2('0x76')](function(_0x466df0){return _0x56c93f[_0x6ec2('0x6c')](_0xe6fc07,{'transaction':_0x466df0})[_0x6ec2('0x26')](function(){return BPromise[_0x6ec2('0x77')](_0x94386a,function(_0x2f0229){return db['TeamVoiceQueue'][_0x6ec2('0x78')]({'TeamId':_0x2f0229['id'],'VoiceQueueId':_0x4c3753['params']['id'],'penalty':_0x2f0229[_0x6ec2('0x74')]},{'transaction':_0x466df0});});})[_0x6ec2('0x26')](function(){return BPromise['each'](_0xc97ff6,function(_0x3a6ffe){return db['UserVoiceQueue'][_0x6ec2('0x79')]({'where':{'UserId':_0x3a6ffe['id'],'VoiceQueueId':_0x4c3753['params']['id']},'defaults':{'penalty':_0x3a6ffe[_0x6ec2('0x74')]},'transaction':_0x466df0});});})[_0x6ec2('0x26')](function(){return BPromise[_0x6ec2('0x77')](_['filter'](_0xc97ff6,{'online':!![]}),function(_0xc1dafe){return db[_0x6ec2('0x7a')][_0x6ec2('0x78')]({'membername':_0xc1dafe[_0x6ec2('0x36')],'UserId':_0xc1dafe['id'],'queue_name':_0x56c93f[_0x6ec2('0x36')],'VoiceQueueId':_0x56c93f['id'],'interface':_['isNil'](_0xc1dafe[_0x6ec2('0x70')])?util[_0x6ec2('0x7b')](_0x6ec2('0x7c'),_0xc1dafe[_0x6ec2('0x36')]):_0xc1dafe[_0x6ec2('0x70')],'paused':_0xc1dafe[_0x6ec2('0x6f')]||![],'penalty':_0xc1dafe[_0x6ec2('0x74')]},{'transaction':_0x466df0});});})[_0x6ec2('0x26')](function(){_0xc97ff6['forEach'](function(_0x2ce495){socket[_0x6ec2('0x7d')](_0x6ec2('0x7e'),{'UserId':_0x2ce495['id'],'VoiceQueueId':_0x56c93f['id']});});});});});}})[_0x6ec2('0x26')](respondWithStatusCode(_0x8d5685,null))[_0x6ec2('0x4c')](handleError(_0x8d5685,null));};exports[_0x6ec2('0x7f')]=function(_0x302c13,_0xd03e43,_0x5ced49){return db[_0x6ec2('0x6b')][_0x6ec2('0x4a')]({'where':{'id':_0x302c13[_0x6ec2('0x3c')][_0x6ec2('0x80')]},'attributes':['id'],'include':[{'model':db[_0x6ec2('0x6e')],'as':_0x6ec2('0x72'),'attributes':['id'],'raw':!![]}]})[_0x6ec2('0x26')](handleEntityNotFound(_0xd03e43,null))['then'](function(_0xc6e331){var _0x5e83bb=_[_0x6ec2('0x2e')](_0xc6e331,'id');var _0x524e63=[];var _0x977f1e=[];var _0x272069=squel[_0x6ec2('0x81')]();_0x272069[_0x6ec2('0x82')](_0x6ec2('0x83'))['from']('team_has_voice_queues','tq')[_0x6ec2('0x84')](_0x6ec2('0x85'),'ut',_0x6ec2('0x86'))[_0x6ec2('0x46')](_0x6ec2('0x87'),_0x302c13[_0x6ec2('0x4d')]['id']);for(var _0x762694=0x0;_0x762694<_0xc6e331[_0x6ec2('0x40')];_0x762694+=0x1){let _0xa37106=_0xc6e331[_0x762694];for(var _0x5aac51=0x0;_0x5aac51<_0xa37106['Agents'][_0x6ec2('0x40')];_0x5aac51+=0x1){let _0x5dcb11=_0xa37106[_0x6ec2('0x72')][_0x5aac51];var _0x49bceb=_0x272069[_0x6ec2('0x5b')]();_0x49bceb[_0x6ec2('0x46')]('ut.UserId\x20=\x20?',_0x5dcb11['id']);_0x977f1e[_0x6ec2('0x88')](db[_0x6ec2('0x75')]['query'](_0x49bceb[_0x6ec2('0x89')](),{'type':db['sequelize'][_0x6ec2('0x8a')][_0x6ec2('0x8b')]})[_0x6ec2('0x26')](function(_0x125ed4){if(_0x125ed4[_0x6ec2('0x40')]===0x1){return _0x5dcb11['id'];}else{var _0x3f39ce=_[_0x6ec2('0x8c')](_[_0x6ec2('0x2e')](_0x125ed4,_0x6ec2('0x8d')),function(_0x4d1489){return _[_0x6ec2('0x8e')](_0x5e83bb,_0x4d1489);});if(_0x3f39ce){return _0x5dcb11['id'];}}}));}}return BPromise[_0x6ec2('0x8f')](_0x977f1e)[_0x6ec2('0x26')](function(_0x36e35b){_0x524e63=_(_0x524e63)[_0x6ec2('0x90')](_0x36e35b)['compact']()[_0x6ec2('0x2f')]();return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x302c13[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](function(_0x489fc8){return db['sequelize'][_0x6ec2('0x76')](function(_0x1aa0b2){return _0x489fc8[_0x6ec2('0x7f')](_0x302c13[_0x6ec2('0x3c')][_0x6ec2('0x80')],{'transaction':_0x1aa0b2})[_0x6ec2('0x26')](function(){if(!_[_0x6ec2('0x91')](_0x524e63)){return _0x489fc8['removeAgents'](_0x524e63,{'transaction':_0x1aa0b2})['then'](function(){return db[_0x6ec2('0x7a')][_0x6ec2('0x27')]({'where':{'VoiceQueueId':_0x302c13[_0x6ec2('0x4d')]['id'],'UserId':_0x524e63},'transaction':_0x1aa0b2});});}})[_0x6ec2('0x26')](function(){_0x524e63[_0x6ec2('0x73')](function(_0x58a14a){socket[_0x6ec2('0x7d')](_0x6ec2('0x92'),{'UserId':_0x58a14a,'VoiceQueueId':_0x489fc8['id']});});});});});});})['then'](respondWithStatusCode(_0xd03e43,null))[_0x6ec2('0x4c')](handleError(_0xd03e43,null));};exports[_0x6ec2('0x93')]=function(_0x2f3b3d,_0x29fbc7,_0xce2ff){var _0x14ed67,_0x324d68;return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x2f3b3d[_0x6ec2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29fbc7,null))['then'](function(_0x3c0a39){if(_0x3c0a39){_0x324d68=_0x3c0a39;return _0x3c0a39['addAgents'](_0x2f3b3d[_0x6ec2('0x53')][_0x6ec2('0x80')],_['omit'](_0x2f3b3d[_0x6ec2('0x53')],['ids','id'])||{})['spread'](function(_0x136e15){for(var _0xb00364=0x0;_0xb00364<_0x2f3b3d['body'][_0x6ec2('0x80')][_0x6ec2('0x40')];_0xb00364+=0x1){socket[_0x6ec2('0x7d')](_0x6ec2('0x7e'),{'UserId':Number(_0x2f3b3d['body'][_0x6ec2('0x80')][_0xb00364]),'VoiceQueueId':Number(_0x2f3b3d[_0x6ec2('0x4d')]['id'])});}return _0x136e15;});}})[_0x6ec2('0x26')](function(_0x5eee94){_0x14ed67=_0x5eee94||[];if(_0x324d68){return db[_0x6ec2('0x6e')][_0x6ec2('0x4a')]({'where':{'id':_0x2f3b3d['body'][_0x6ec2('0x80')]},'attributes':['id','name','online',_0x6ec2('0x6f'),_0x6ec2('0x70')],'raw':!![]});}})[_0x6ec2('0x26')](function(_0x25a54d){if(!_['isEmpty'](_0x25a54d)){var _0x3a37ff=[];for(var _0x41cd81=0x0;_0x41cd81<_0x25a54d[_0x6ec2('0x40')];_0x41cd81++){if(_0x25a54d[_0x41cd81]['online']){_0x3a37ff[_0x6ec2('0x88')](db[_0x6ec2('0x7a')][_0x6ec2('0x78')]({'membername':_0x25a54d[_0x41cd81][_0x6ec2('0x36')],'UserId':_0x25a54d[_0x41cd81]['id'],'queue_name':_0x324d68[_0x6ec2('0x36')],'VoiceQueueId':_0x324d68['id'],'interface':_[_0x6ec2('0x94')](_0x25a54d[_0x41cd81][_0x6ec2('0x70')])?util[_0x6ec2('0x7b')](_0x6ec2('0x7c'),_0x25a54d[_0x41cd81]['name']):_0x25a54d[_0x41cd81][_0x6ec2('0x70')],'paused':_0x25a54d[_0x41cd81][_0x6ec2('0x6f')]||![],'penalty':_0x2f3b3d[_0x6ec2('0x53')]['penalty']||0x0}));}}return BPromise[_0x6ec2('0x8f')](_0x3a37ff);}})['then'](function(){return _0x14ed67;})[_0x6ec2('0x26')](respondWithResult(_0x29fbc7,null))[_0x6ec2('0x4c')](handleError(_0x29fbc7,null));};exports[_0x6ec2('0x95')]=function(_0x2bab41,_0x4f233d,_0x15e925){return db[_0x6ec2('0x39')]['find']({'where':{'id':_0x2bab41[_0x6ec2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f233d,null))[_0x6ec2('0x26')](function(_0x3d911b){if(_0x3d911b){return _0x3d911b[_0x6ec2('0x95')](_0x2bab41['query'][_0x6ec2('0x80')])[_0x6ec2('0x26')](function(){if(_[_0x6ec2('0x96')](_0x2bab41[_0x6ec2('0x3c')]['ids'])){for(var _0x18ce72=0x0;_0x18ce72<_0x2bab41[_0x6ec2('0x3c')][_0x6ec2('0x80')][_0x6ec2('0x40')];_0x18ce72+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x2bab41[_0x6ec2('0x3c')][_0x6ec2('0x80')][_0x18ce72]),'VoiceQueueId':Number(_0x2bab41[_0x6ec2('0x4d')]['id'])});}}else{socket[_0x6ec2('0x7d')](_0x6ec2('0x92'),{'UserId':Number(_0x2bab41[_0x6ec2('0x3c')][_0x6ec2('0x80')]),'VoiceQueueId':Number(_0x2bab41[_0x6ec2('0x4d')]['id'])});}});}})[_0x6ec2('0x26')](function(_0x59f63d){return db[_0x6ec2('0x7a')][_0x6ec2('0x27')]({'where':{'VoiceQueueId':_0x2bab41[_0x6ec2('0x4d')]['id'],'UserId':_0x2bab41['query'][_0x6ec2('0x80')]}})['then'](function(){return _0x59f63d;});})[_0x6ec2('0x26')](respondWithStatusCode(_0x4f233d,null))['catch'](handleError(_0x4f233d,null));};exports[_0x6ec2('0x97')]=function(_0x571126,_0xa0515,_0x57d8a1){var _0x2a6040={};var _0x45a2c5={};var _0x3fd2eb;var _0x559753;return db[_0x6ec2('0x39')][_0x6ec2('0x63')]({'where':{'id':_0x571126[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0xa0515,null))[_0x6ec2('0x26')](function(_0x4f9e56){if(_0x4f9e56){_0x3fd2eb=_0x4f9e56;_0x45a2c5[_0x6ec2('0x3b')]=_['keys'](db[_0x6ec2('0x6e')][_0x6ec2('0x4f')]);_0x45a2c5[_0x6ec2('0x3c')]=_[_0x6ec2('0x4e')](_0x571126[_0x6ec2('0x3c')]);_0x45a2c5[_0x6ec2('0x3d')]=_[_0x6ec2('0x3e')](_0x45a2c5[_0x6ec2('0x3b')],_0x45a2c5[_0x6ec2('0x3c')]);_0x2a6040[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x45a2c5['model'],qs[_0x6ec2('0x3f')](_0x571126[_0x6ec2('0x3c')]['fields']));_0x2a6040[_0x6ec2('0x41')]=_0x2a6040[_0x6ec2('0x41')][_0x6ec2('0x40')]?_0x2a6040[_0x6ec2('0x41')]:_0x45a2c5[_0x6ec2('0x3b')];_0x2a6040[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0x571126[_0x6ec2('0x3c')][_0x6ec2('0x45')]);_0x2a6040[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_['pick'](_0x571126[_0x6ec2('0x3c')],_0x45a2c5['filters']));if(_0x571126['query']['filter']){_0x2a6040[_0x6ec2('0x46')]=_[_0x6ec2('0x47')](_0x2a6040['where'],{'$or':_[_0x6ec2('0x2e')](_0x2a6040[_0x6ec2('0x41')],function(_0x213c69){var _0x2d6d77={};_0x2d6d77[_0x213c69]={'$like':'%'+_0x571126['query'][_0x6ec2('0x2c')]+'%'};return _0x2d6d77;})});}_0x2a6040=_[_0x6ec2('0x47')]({},_0x2a6040,_0x571126['options']);return _0x3fd2eb[_0x6ec2('0x97')](_0x2a6040);}})[_0x6ec2('0x26')](function(_0x18c779){if(_0x18c779){_0x559753=_0x18c779[_0x6ec2('0x40')];if(!_0x571126['query'][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x2a6040[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x571126[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x2a6040['offset']=qs['offset'](_0x571126[_0x6ec2('0x3c')][_0x6ec2('0x21')]);}return _0x3fd2eb['getAgents'](_0x2a6040);}})[_0x6ec2('0x26')](function(_0xcca0a6){if(_0xcca0a6){return _0xcca0a6?{'count':_0x559753,'rows':_0xcca0a6}:null;}})[_0x6ec2('0x26')](respondWithResult(_0xa0515,null))['catch'](handleError(_0xa0515,null));};exports[_0x6ec2('0x98')]=function(_0xcac06d,_0x19af7b,_0x4d69a8){var _0x11ab56={};var _0x4d7447={};var _0x41d248;var _0x2ee2da;return db[_0x6ec2('0x39')][_0x6ec2('0x63')]({'where':{'id':_0xcac06d[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x19af7b,null))[_0x6ec2('0x26')](function(_0x19cd8c){if(_0x19cd8c){_0x41d248=_0x19cd8c;_0x4d7447[_0x6ec2('0x3b')]=_['keys'](db[_0x6ec2('0x7a')][_0x6ec2('0x4f')]);_0x4d7447[_0x6ec2('0x3c')]=_['keys'](_0xcac06d['query']);_0x4d7447['filters']=_[_0x6ec2('0x3e')](_0x4d7447[_0x6ec2('0x3b')],_0x4d7447[_0x6ec2('0x3c')]);_0x11ab56[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x4d7447[_0x6ec2('0x3b')],qs['fields'](_0xcac06d['query'][_0x6ec2('0x3f')]));_0x11ab56[_0x6ec2('0x41')]=_0x11ab56['attributes']['length']?_0x11ab56['attributes']:_0x4d7447[_0x6ec2('0x3b')];_0x11ab56[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0xcac06d['query'][_0x6ec2('0x45')]);_0x11ab56[_0x6ec2('0x46')]=qs['filters'](_[_0x6ec2('0x62')](_0xcac06d['query'],_0x4d7447[_0x6ec2('0x3d')]));if(_0xcac06d['query']['filter']){_0x11ab56['where']=_[_0x6ec2('0x47')](_0x11ab56[_0x6ec2('0x46')],{'$or':_[_0x6ec2('0x2e')](_0x11ab56['attributes'],function(_0x2a6f33){var _0x103fd9={};_0x103fd9[_0x2a6f33]={'$like':'%'+_0xcac06d[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0x103fd9;})});}_0x11ab56=_[_0x6ec2('0x47')]({},_0x11ab56,_0xcac06d[_0x6ec2('0x48')]);return _0x41d248[_0x6ec2('0x98')](_0x11ab56);}})[_0x6ec2('0x26')](function(_0x2d9577){if(_0x2d9577){_0x2ee2da=_0x2d9577['length'];if(!_0xcac06d[_0x6ec2('0x3c')][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x11ab56[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0xcac06d[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x11ab56[_0x6ec2('0x21')]=qs[_0x6ec2('0x21')](_0xcac06d[_0x6ec2('0x3c')][_0x6ec2('0x21')]);}return _0x41d248[_0x6ec2('0x98')](_0x11ab56);}})[_0x6ec2('0x26')](function(_0x3b6c10){return _0x3b6c10?{'count':_0x2ee2da,'rows':_0x3b6c10}:null;})[_0x6ec2('0x26')](respondWithResult(_0x19af7b,null))[_0x6ec2('0x4c')](handleError(_0x19af7b,null));};exports[_0x6ec2('0x99')]=function(_0x445803,_0x19df45,_0x86f10b){var _0x327213={};var _0x1b1e31={};var _0x439284;var _0x45edeb;return db[_0x6ec2('0x39')]['findOne']({'where':{'id':_0x445803[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x19df45,null))[_0x6ec2('0x26')](function(_0xddae8){if(_0xddae8){_0x439284=_0xddae8;_0x1b1e31['model']=_[_0x6ec2('0x4e')](db[_0x6ec2('0x9a')][_0x6ec2('0x4f')]);_0x1b1e31[_0x6ec2('0x3c')]=_[_0x6ec2('0x4e')](_0x445803[_0x6ec2('0x3c')]);_0x1b1e31['filters']=_[_0x6ec2('0x3e')](_0x1b1e31[_0x6ec2('0x3b')],_0x1b1e31['query']);_0x327213['attributes']=_[_0x6ec2('0x3e')](_0x1b1e31[_0x6ec2('0x3b')],qs[_0x6ec2('0x3f')](_0x445803[_0x6ec2('0x3c')]['fields']));_0x327213[_0x6ec2('0x41')]=_0x327213[_0x6ec2('0x41')][_0x6ec2('0x40')]?_0x327213[_0x6ec2('0x41')]:_0x1b1e31[_0x6ec2('0x3b')];_0x327213[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0x445803[_0x6ec2('0x3c')][_0x6ec2('0x45')]);_0x327213[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_[_0x6ec2('0x62')](_0x445803[_0x6ec2('0x3c')],_0x1b1e31[_0x6ec2('0x3d')]));if(_0x445803[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x327213[_0x6ec2('0x46')]=_[_0x6ec2('0x47')](_0x327213['where'],{'$or':_[_0x6ec2('0x2e')](_0x327213[_0x6ec2('0x41')],function(_0x2d75d0){var _0xfe4117={};_0xfe4117[_0x2d75d0]={'$like':'%'+_0x445803[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0xfe4117;})});}_0x327213=_['merge']({},_0x327213,_0x445803['options']);return _0x439284[_0x6ec2('0x99')](_0x327213);}})[_0x6ec2('0x26')](function(_0x3cf3ab){if(_0x3cf3ab){_0x45edeb=_0x3cf3ab[_0x6ec2('0x40')];if(!_0x445803['query'][_0x6ec2('0x42')](_0x6ec2('0x61'))){_0x327213[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x445803[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x327213[_0x6ec2('0x21')]=qs[_0x6ec2('0x21')](_0x445803['query']['offset']);}return _0x439284[_0x6ec2('0x99')](_0x327213);}})['then'](function(_0x1b1b66){if(_0x1b1b66){return _0x1b1b66?{'count':_0x45edeb,'rows':_0x1b1b66}:null;}})[_0x6ec2('0x26')](respondWithResult(_0x19df45,null))[_0x6ec2('0x4c')](handleError(_0x19df45,null));};exports[_0x6ec2('0x9b')]=function(_0x546807,_0xba1bba,_0x10816c){var _0x57b495,_0x453e35;return db['VoiceQueue'][_0x6ec2('0x51')]({'where':{'id':_0x546807[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0xba1bba,null))[_0x6ec2('0x26')](function(_0x438f8d){if(_0x438f8d){_0x453e35=_0x438f8d;return _0x438f8d[_0x6ec2('0x9b')](_0x546807['body'][_0x6ec2('0x80')],_[_0x6ec2('0x5c')](_0x546807[_0x6ec2('0x53')],[_0x6ec2('0x80'),'id'])||{});}return null;})[_0x6ec2('0x9c')](function(_0x5677ce){var _0x3bdb6f;_0x57b495=_0x5677ce||[];var _0x2d0103=[];if(_0x5677ce){for(var _0x5eee97=0x0;_0x5eee97<_0x5677ce[_0x6ec2('0x40')];_0x5eee97+=0x1){var _0x351d71=_0x5677ce[_0x5eee97][_0x6ec2('0x28')]({'plain':!![]});_0x453e35[_0x6ec2('0x9d')]=_0x546807[_0x6ec2('0x53')][_0x6ec2('0x9d')]?_0x546807[_0x6ec2('0x53')]['dialCheckDuplicateType']:_0x453e35[_0x6ec2('0x9d')];switch(_0x453e35['dialCheckDuplicateType']){case _0x6ec2('0x9e'):_0x3bdb6f=squel['insert']()[_0x6ec2('0x9f')]('cm_hopper')[_0x6ec2('0xa0')]([_0x6ec2('0xa1'),'scheduledAt',_0x6ec2('0xa2'),_0x6ec2('0xa3'),_0x6ec2('0x65'),_0x6ec2('0x5d'),_0x6ec2('0x5e')],squel['select']()[_0x6ec2('0x82')]('phone',_0x6ec2('0xa1'))[_0x6ec2('0x82')](_0x6ec2('0xa4'),_0x6ec2('0xa5'))[_0x6ec2('0x82')]('id','ContactId')[_0x6ec2('0x82')](_0x351d71[_0x6ec2('0xa6')]['toString'](),_0x6ec2('0xa3'))[_0x6ec2('0x82')](_0x546807[_0x6ec2('0x4d')]['id'][_0x6ec2('0x89')](),_0x6ec2('0x65'))[_0x6ec2('0x82')]('NOW()','createdAt')[_0x6ec2('0x82')](_0x6ec2('0xa4'),_0x6ec2('0x5e'))[_0x6ec2('0xa7')](_0x6ec2('0xa8'))[_0x6ec2('0x46')](_0x6ec2('0xa9'))[_0x6ec2('0x46')](_0x6ec2('0xaa'),_0x351d71['CmListId'][_0x6ec2('0x89')]())['where'](_0x6ec2('0xab'))[_0x6ec2('0x46')](_0x6ec2('0xac'),squel[_0x6ec2('0x81')]()[_0x6ec2('0x82')]('COALESCE(calleridnum,\x27\x27)')[_0x6ec2('0xa7')](_0x6ec2('0xad'))[_0x6ec2('0x46')]('VoiceQueueId\x20=\x20?',_0x546807[_0x6ec2('0x4d')]['id'][_0x6ec2('0x89')]()))[_0x6ec2('0x46')](_0x6ec2('0xac'),squel[_0x6ec2('0x81')]()[_0x6ec2('0x82')]('COALESCE(phone,\x27\x27)')[_0x6ec2('0xa7')](_0x6ec2('0xae'))[_0x6ec2('0x46')](_0x6ec2('0x87'),_0x546807['params']['id']['toString']())))[_0x6ec2('0x89')]();break;case _0x6ec2('0xaf'):_0x3bdb6f=squel[_0x6ec2('0xb0')]()[_0x6ec2('0x9f')]('cm_hopper')[_0x6ec2('0xa0')](['phone',_0x6ec2('0xa5'),_0x6ec2('0xa2'),_0x6ec2('0xa3'),_0x6ec2('0x65'),_0x6ec2('0x5d'),_0x6ec2('0x5e')],squel[_0x6ec2('0x81')]()['field']('phone',_0x6ec2('0xa1'))['field'](_0x6ec2('0xa4'),_0x6ec2('0xa5'))[_0x6ec2('0x82')]('id',_0x6ec2('0xa2'))[_0x6ec2('0x82')](_0x351d71[_0x6ec2('0xa6')][_0x6ec2('0x89')](),_0x6ec2('0xa3'))[_0x6ec2('0x82')](_0x546807[_0x6ec2('0x4d')]['id']['toString'](),_0x6ec2('0x65'))[_0x6ec2('0x82')](_0x6ec2('0xa4'),_0x6ec2('0x5d'))[_0x6ec2('0x82')]('NOW()',_0x6ec2('0x5e'))['from'](_0x6ec2('0xa8'))[_0x6ec2('0x46')](_0x6ec2('0xa9'))['where'](_0x6ec2('0xaa'),_0x351d71['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6ec2('0x46')](_0x6ec2('0xac'),squel[_0x6ec2('0x81')]()[_0x6ec2('0x82')](_0x6ec2('0xb1'))[_0x6ec2('0xa7')](_0x6ec2('0xae'))[_0x6ec2('0x46')]('VoiceQueueId\x20=\x20?',_0x546807[_0x6ec2('0x4d')]['id'][_0x6ec2('0x89')]())))['toString']();break;default:_0x3bdb6f=squel[_0x6ec2('0xb0')]()[_0x6ec2('0x9f')](_0x6ec2('0xae'))[_0x6ec2('0xa0')]([_0x6ec2('0xa1'),_0x6ec2('0xa5'),'ContactId',_0x6ec2('0xa3'),_0x6ec2('0x65'),_0x6ec2('0x5d'),'updatedAt'],squel[_0x6ec2('0x81')]()['field'](_0x6ec2('0xa1'),_0x6ec2('0xa1'))[_0x6ec2('0x82')](_0x6ec2('0xa4'),_0x6ec2('0xa5'))['field']('id',_0x6ec2('0xa2'))[_0x6ec2('0x82')](_0x351d71[_0x6ec2('0xa6')]['toString'](),_0x6ec2('0xa3'))[_0x6ec2('0x82')](_0x546807[_0x6ec2('0x4d')]['id'][_0x6ec2('0x89')](),_0x6ec2('0x65'))[_0x6ec2('0x82')](_0x6ec2('0xa4'),_0x6ec2('0x5d'))[_0x6ec2('0x82')](_0x6ec2('0xa4'),'updatedAt')[_0x6ec2('0xa7')](_0x6ec2('0xa8'))[_0x6ec2('0x46')](_0x6ec2('0xa9'))['where'](_0x6ec2('0xaa'),_0x351d71['CmListId'][_0x6ec2('0x89')]())[_0x6ec2('0x46')](_0x6ec2('0xab')))['toString']();}_0x2d0103[_0x6ec2('0x88')](db[_0x6ec2('0x75')][_0x6ec2('0x3c')](_0x3bdb6f));}return BPromise['all'](_0x2d0103);}})[_0x6ec2('0x26')](function(){return _0x57b495;})[_0x6ec2('0x26')](respondWithResult(_0xba1bba,null))[_0x6ec2('0x4c')](handleError(_0xba1bba,null));};exports[_0x6ec2('0xb2')]=function(_0x6e35b6,_0x1b15ac,_0x2d1825){return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x6e35b6[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x1b15ac,null))[_0x6ec2('0x26')](function(_0xe9c895){if(_0xe9c895){return _0xe9c895['removeLists'](_0x6e35b6['query'][_0x6ec2('0x80')]);}})[_0x6ec2('0x26')](function(_0x2a8848){if(_0x2a8848){return db['CmHopper']['destroy']({'where':{'ListId':_0x6e35b6['query'][_0x6ec2('0x80')],'VoiceQueueId':_0x6e35b6[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](function(){return _0x2a8848;});}})[_0x6ec2('0x26')](respondWithStatusCode(_0x1b15ac,null))[_0x6ec2('0x4c')](handleError(_0x1b15ac,null));};exports[_0x6ec2('0xb3')]=function(_0x2d7782,_0x37701a,_0x2cb187){var _0x6c9e8b={};var _0x2488f9={};var _0xa9ea4a;var _0x3fb47a;return db['VoiceQueue'][_0x6ec2('0x63')]({'where':{'id':_0x2d7782[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x37701a,null))[_0x6ec2('0x26')](function(_0x34f73c){if(_0x34f73c){_0xa9ea4a=_0x34f73c;_0x2488f9[_0x6ec2('0x3b')]=_[_0x6ec2('0x4e')](db[_0x6ec2('0x9a')]['rawAttributes']);_0x2488f9[_0x6ec2('0x3c')]=_['keys'](_0x2d7782[_0x6ec2('0x3c')]);_0x2488f9[_0x6ec2('0x3d')]=_['intersection'](_0x2488f9[_0x6ec2('0x3b')],_0x2488f9[_0x6ec2('0x3c')]);_0x6c9e8b[_0x6ec2('0x41')]=_[_0x6ec2('0x3e')](_0x2488f9[_0x6ec2('0x3b')],qs[_0x6ec2('0x3f')](_0x2d7782[_0x6ec2('0x3c')][_0x6ec2('0x3f')]));_0x6c9e8b[_0x6ec2('0x41')]=_0x6c9e8b[_0x6ec2('0x41')]['length']?_0x6c9e8b['attributes']:_0x2488f9[_0x6ec2('0x3b')];_0x6c9e8b[_0x6ec2('0x44')]=qs[_0x6ec2('0x45')](_0x2d7782['query'][_0x6ec2('0x45')]);_0x6c9e8b[_0x6ec2('0x46')]=qs[_0x6ec2('0x3d')](_[_0x6ec2('0x62')](_0x2d7782[_0x6ec2('0x3c')],_0x2488f9[_0x6ec2('0x3d')]));if(_0x2d7782[_0x6ec2('0x3c')][_0x6ec2('0x2c')]){_0x6c9e8b['where']=_['merge'](_0x6c9e8b[_0x6ec2('0x46')],{'$or':_[_0x6ec2('0x2e')](_0x6c9e8b['attributes'],function(_0x2877d2){var _0x449dbe={};_0x449dbe[_0x2877d2]={'$like':'%'+_0x2d7782[_0x6ec2('0x3c')][_0x6ec2('0x2c')]+'%'};return _0x449dbe;})});}_0x6c9e8b=_[_0x6ec2('0x47')]({},_0x6c9e8b,_0x2d7782[_0x6ec2('0x48')]);return _0xa9ea4a[_0x6ec2('0xb3')](_0x6c9e8b);}})[_0x6ec2('0x26')](function(_0x351ba0){if(_0x351ba0){_0x3fb47a=_0x351ba0[_0x6ec2('0x40')];if(!_0x2d7782[_0x6ec2('0x3c')]['hasOwnProperty'](_0x6ec2('0x61'))){_0x6c9e8b[_0x6ec2('0x43')]=qs[_0x6ec2('0x43')](_0x2d7782[_0x6ec2('0x3c')][_0x6ec2('0x43')]);_0x6c9e8b[_0x6ec2('0x21')]=qs[_0x6ec2('0x21')](_0x2d7782[_0x6ec2('0x3c')]['offset']);}return _0xa9ea4a[_0x6ec2('0xb3')](_0x6c9e8b);}})[_0x6ec2('0x26')](function(_0x42256d){if(_0x42256d){return _0x42256d?{'count':_0x3fb47a,'rows':_0x42256d}:null;}})['then'](respondWithResult(_0x37701a,null))[_0x6ec2('0x4c')](handleError(_0x37701a,null));};exports[_0x6ec2('0xb4')]=function(_0x382a99,_0x35cd5f,_0x141cc2){var _0x133b1b,_0x4fbbb4;return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x382a99[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x35cd5f,null))['then'](function(_0x3423e2){if(_0x3423e2){_0x4fbbb4=_0x3423e2;return _0x3423e2[_0x6ec2('0xb4')](_0x382a99[_0x6ec2('0x53')][_0x6ec2('0x80')],_['omit'](_0x382a99[_0x6ec2('0x53')],[_0x6ec2('0x80'),'id'])||{});}return null;})[_0x6ec2('0x9c')](function(_0xfb4f2){var _0x3ee7e6;_0x133b1b=_0xfb4f2||[];var _0x31d3a3=[];if(_0xfb4f2){for(var _0x14564f=0x0;_0x14564f<_0xfb4f2[_0x6ec2('0x40')];_0x14564f+=0x1){var _0x1dc655=_0xfb4f2[_0x14564f][_0x6ec2('0x28')]({'plain':!![]});_0x3ee7e6=squel[_0x6ec2('0xb0')]()[_0x6ec2('0x9f')](_0x6ec2('0xb5'))[_0x6ec2('0xa0')]([_0x6ec2('0xa1'),_0x6ec2('0xa2'),_0x6ec2('0xa3'),_0x6ec2('0x65'),'createdAt',_0x6ec2('0x5e')],squel['select']()[_0x6ec2('0x82')]('phone','phone')['field']('id',_0x6ec2('0xa2'))[_0x6ec2('0x82')](_0x1dc655[_0x6ec2('0xa6')]['toString'](),_0x6ec2('0xa3'))[_0x6ec2('0x82')](_0x382a99['params']['id'][_0x6ec2('0x89')](),'VoiceQueueId')[_0x6ec2('0x82')](_0x6ec2('0xa4'),_0x6ec2('0x5d'))['field']('NOW()',_0x6ec2('0x5e'))[_0x6ec2('0xa7')](_0x6ec2('0xa8'))[_0x6ec2('0x46')](_0x6ec2('0xa9'))[_0x6ec2('0x46')]('ListId\x20=\x20?',_0x1dc655[_0x6ec2('0xa6')]['toString']())[_0x6ec2('0x46')](_0x6ec2('0xab')))[_0x6ec2('0x89')]();_0x31d3a3[_0x6ec2('0x88')](db['sequelize'][_0x6ec2('0x3c')](_0x3ee7e6));}return BPromise[_0x6ec2('0x8f')](_0x31d3a3);}})['then'](function(){return _0x133b1b;})[_0x6ec2('0x26')](respondWithResult(_0x35cd5f,null))[_0x6ec2('0x4c')](handleError(_0x35cd5f,null));};exports[_0x6ec2('0xb6')]=function(_0x1002ab,_0x3b07cc,_0x20eef1){return db[_0x6ec2('0x39')][_0x6ec2('0x51')]({'where':{'id':_0x1002ab[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](handleEntityNotFound(_0x3b07cc,null))[_0x6ec2('0x26')](function(_0x56643a){if(_0x56643a){return _0x56643a[_0x6ec2('0xb6')](_0x1002ab[_0x6ec2('0x3c')][_0x6ec2('0x80')]);}})['then'](function(_0x45dc3c){if(_0x45dc3c){return db[_0x6ec2('0x69')][_0x6ec2('0x27')]({'where':{'ListId':_0x1002ab['query'][_0x6ec2('0x80')],'VoiceQueueId':_0x1002ab[_0x6ec2('0x4d')]['id']}})[_0x6ec2('0x26')](function(){return _0x45dc3c;});}})['then'](respondWithStatusCode(_0x3b07cc,null))[_0x6ec2('0x4c')](handleError(_0x3b07cc,null));}; \ No newline at end of file +var _0x3589=['getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','ids','isEmpty','userVoiceQueue:remove','addAgents','spread','push','isNil','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','NOW()','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','onlyIfOpen','insert','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','removeBlackLists','eml-format','rimraf','zip-dir','bluebird','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','error','stack','send','VoiceQueue','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','rows','show','params','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','inbound','update'];(function(_0x337651,_0x2af690){var _0x20893c=function(_0x545dcd){while(--_0x545dcd){_0x337651['push'](_0x337651['shift']());}};_0x20893c(++_0x2af690);}(_0x3589,0x1cd));var _0x9358=function(_0xa428c1,_0x669ffe){_0xa428c1=_0xa428c1-0x0;var _0x1967ad=_0x3589[_0xa428c1];return _0x1967ad;};'use strict';var emlformat=require(_0x9358('0x0'));var rimraf=require(_0x9358('0x1'));var zipdir=require(_0x9358('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9358('0x3'));var Mustache=require('mustache');var util=require(_0x9358('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9358('0x5'));var fs=require('fs');var fs_extra=require(_0x9358('0x6'));var _=require(_0x9358('0x7'));var squel=require('squel');var crypto=require(_0x9358('0x8'));var jsforce=require(_0x9358('0x9'));var deskjs=require(_0x9358('0xa'));var toCsv=require(_0x9358('0xb'));var querystring=require(_0x9358('0xc'));var Papa=require(_0x9358('0xd'));var Redis=require(_0x9358('0xe'));var authService=require(_0x9358('0xf'));var qs=require(_0x9358('0x10'));var as=require(_0x9358('0x11'));var hardwareService=require(_0x9358('0x12'));var logger=require(_0x9358('0x13'))(_0x9358('0x14'));var utils=require(_0x9358('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9358('0x16'))['db'];config[_0x9358('0x17')]=_[_0x9358('0x18')](config[_0x9358('0x17')],{'host':_0x9358('0x19'),'port':0x18eb});var socket=require(_0x9358('0x1a'))(new Redis(config[_0x9358('0x17')]));require(_0x9358('0x1b'))[_0x9358('0x1c')](socket);function respondWithStatusCode(_0x2c8509,_0x24324d){_0x24324d=_0x24324d||0xcc;return function(_0x350ffc){if(_0x350ffc){return _0x2c8509[_0x9358('0x1d')](_0x24324d);}return _0x2c8509[_0x9358('0x1e')](_0x24324d)[_0x9358('0x1f')]();};}function respondWithResult(_0x2087da,_0x3cceda){_0x3cceda=_0x3cceda||0xc8;return function(_0x395fe6){if(_0x395fe6){return _0x2087da[_0x9358('0x1e')](_0x3cceda)[_0x9358('0x20')](_0x395fe6);}};}function respondWithFilteredResult(_0x480ca2,_0x268544){return function(_0xf52c38){if(_0xf52c38){var _0x2bb115=typeof _0x268544[_0x9358('0x21')]==='undefined'&&typeof _0x268544[_0x9358('0x22')]===_0x9358('0x23');var _0x1b8673=_0xf52c38[_0x9358('0x24')];var _0x357a91=_0x2bb115?0x0:_0x268544[_0x9358('0x21')];var _0x8ec2d2=_0x2bb115?_0xf52c38['count']:_0x268544[_0x9358('0x21')]+_0x268544[_0x9358('0x22')];var _0x1b0544;if(_0x8ec2d2>=_0x1b8673){_0x8ec2d2=_0x1b8673;_0x1b0544=0xc8;}else{_0x1b0544=0xce;}_0x480ca2[_0x9358('0x1e')](_0x1b0544);return _0x480ca2[_0x9358('0x25')](_0x9358('0x26'),_0x357a91+'-'+_0x8ec2d2+'/'+_0x1b8673)['json'](_0xf52c38);}return null;};}function patchUpdates(_0x504711){return function(_0x2f373b){try{jsonpatch[_0x9358('0x27')](_0x2f373b,_0x504711,!![]);}catch(_0x4ed8b2){return BPromise[_0x9358('0x28')](_0x4ed8b2);}return _0x2f373b[_0x9358('0x29')]();};}function saveUpdates(_0x6e0ef6,_0x46de89){return function(_0x41faf4){if(_0x41faf4){return _0x41faf4['update'](_0x6e0ef6)['then'](function(_0x597100){return _0x597100;});}return null;};}function removeEntity(_0x272f96,_0x9eefcc){return function(_0x53a4b9){if(_0x53a4b9){return _0x53a4b9[_0x9358('0x2a')]()[_0x9358('0x2b')](function(){var _0x28042f=_0x53a4b9[_0x9358('0x2c')]({'plain':!![]});var _0x4d4478=[{'name':_0x9358('0x2d'),'value':'inbound','ignore':![]},{'name':_0x9358('0x2e'),'value':_0x9358('0x2f'),'ignore':![]}];var _0x4efb07=_(_0x4d4478)[_0x9358('0x30')](_0x9358('0x31'))[_0x9358('0x32')](_0x9358('0x33'))[_0x9358('0x33')]();if(_['includes'](_0x4efb07,_0x28042f[_0x9358('0x34')])){return;}var _0x2e58ef=_[_0x9358('0x35')](_0x4d4478,[_0x9358('0x33'),_0x28042f[_0x9358('0x34')]])[_0x9358('0x36')];return db[_0x9358('0x37')][_0x9358('0x2a')]({'where':{'type':_0x2e58ef,'resourceId':_0x28042f['id']}})['then'](function(){return _0x53a4b9;});})[_0x9358('0x2b')](function(){_0x272f96[_0x9358('0x1e')](0xcc)[_0x9358('0x1f')]();});}};}function handleEntityNotFound(_0x3d701b,_0x140e85){return function(_0x5b871c){if(!_0x5b871c){_0x3d701b['sendStatus'](0x194);}return _0x5b871c;};}function handleError(_0xb3f4a6,_0x2aed25){_0x2aed25=_0x2aed25||0x1f4;return function(_0x29c465){logger[_0x9358('0x38')](_0x29c465[_0x9358('0x39')]);if(_0x29c465['name']){delete _0x29c465[_0x9358('0x36')];}_0xb3f4a6[_0x9358('0x1e')](_0x2aed25)[_0x9358('0x3a')](_0x29c465);};}exports['index']=function(_0x6293d2,_0x32dbc3){var _0x18f5ed={},_0x571101={},_0x168bad={'count':0x0,'rows':[]};var _0x51f0df=_['map'](db[_0x9358('0x3b')][_0x9358('0x3c')],function(_0x4ed46d){return{'name':_0x4ed46d['fieldName'],'type':_0x4ed46d[_0x9358('0x34')][_0x9358('0x3d')]};});_0x571101[_0x9358('0x3e')]=_[_0x9358('0x32')](_0x51f0df,_0x9358('0x36'));_0x571101[_0x9358('0x3f')]=_[_0x9358('0x40')](_0x6293d2[_0x9358('0x3f')]);_0x571101[_0x9358('0x41')]=_[_0x9358('0x42')](_0x571101[_0x9358('0x3e')],_0x571101[_0x9358('0x3f')]);_0x18f5ed['attributes']=_[_0x9358('0x42')](_0x571101[_0x9358('0x3e')],qs[_0x9358('0x43')](_0x6293d2['query'][_0x9358('0x43')]));_0x18f5ed[_0x9358('0x44')]=_0x18f5ed['attributes'][_0x9358('0x45')]?_0x18f5ed[_0x9358('0x44')]:_0x571101[_0x9358('0x3e')];if(!_0x6293d2[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0x18f5ed['limit']=qs['limit'](_0x6293d2[_0x9358('0x3f')][_0x9358('0x22')]);_0x18f5ed[_0x9358('0x21')]=qs[_0x9358('0x21')](_0x6293d2[_0x9358('0x3f')][_0x9358('0x21')]);}_0x18f5ed[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x6293d2[_0x9358('0x3f')][_0x9358('0x49')]);_0x18f5ed[_0x9358('0x4a')]=qs['filters'](_[_0x9358('0x4b')](_0x6293d2['query'],_0x571101[_0x9358('0x41')]),_0x51f0df);if(_0x6293d2[_0x9358('0x3f')][_0x9358('0x30')]){_0x18f5ed[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0x18f5ed[_0x9358('0x4a')],{'$or':_[_0x9358('0x32')](_0x51f0df,function(_0x5f56e8){if(_0x5f56e8[_0x9358('0x34')]!==_0x9358('0x4d')){var _0xd6bd56={};_0xd6bd56[_0x5f56e8[_0x9358('0x36')]]={'$like':'%'+_0x6293d2['query'][_0x9358('0x30')]+'%'};return _0xd6bd56;}})});}_0x18f5ed=_['merge']({},_0x18f5ed,_0x6293d2['options']);var _0x4ebe00={'where':_0x18f5ed[_0x9358('0x4a')]};return db[_0x9358('0x3b')][_0x9358('0x24')](_0x4ebe00)[_0x9358('0x2b')](function(_0xb71c22){_0x168bad[_0x9358('0x24')]=_0xb71c22;if(_0x6293d2[_0x9358('0x3f')]['includeAll']){_0x18f5ed[_0x9358('0x4e')]=[{'all':!![]}];}return db[_0x9358('0x3b')]['findAll'](_0x18f5ed);})[_0x9358('0x2b')](function(_0x3902ab){_0x168bad[_0x9358('0x4f')]=_0x3902ab;return _0x168bad;})[_0x9358('0x2b')](respondWithFilteredResult(_0x32dbc3,_0x18f5ed))['catch'](handleError(_0x32dbc3,null));};exports[_0x9358('0x50')]=function(_0x27f66b,_0x401c46){var _0x4dd9b6={'raw':![],'where':{'id':_0x27f66b[_0x9358('0x51')]['id']}},_0x5e9dcb={};_0x5e9dcb[_0x9358('0x3e')]=_[_0x9358('0x40')](db[_0x9358('0x3b')]['rawAttributes']);_0x5e9dcb[_0x9358('0x3f')]=_[_0x9358('0x40')](_0x27f66b[_0x9358('0x3f')]);_0x5e9dcb[_0x9358('0x41')]=_[_0x9358('0x42')](_0x5e9dcb['model'],_0x5e9dcb[_0x9358('0x3f')]);_0x4dd9b6[_0x9358('0x44')]=_['intersection'](_0x5e9dcb[_0x9358('0x3e')],qs[_0x9358('0x43')](_0x27f66b[_0x9358('0x3f')][_0x9358('0x43')]));_0x4dd9b6[_0x9358('0x44')]=_0x4dd9b6[_0x9358('0x44')][_0x9358('0x45')]?_0x4dd9b6[_0x9358('0x44')]:_0x5e9dcb[_0x9358('0x3e')];if(_0x27f66b[_0x9358('0x3f')][_0x9358('0x52')]){_0x4dd9b6[_0x9358('0x4e')]=[{'all':!![]}];}_0x4dd9b6=_[_0x9358('0x4c')]({},_0x4dd9b6,_0x27f66b[_0x9358('0x53')]);return db[_0x9358('0x3b')][_0x9358('0x35')](_0x4dd9b6)['then'](handleEntityNotFound(_0x401c46,null))[_0x9358('0x2b')](respondWithResult(_0x401c46,null))[_0x9358('0x54')](handleError(_0x401c46,null));};exports[_0x9358('0x55')]=function(_0x3572eb,_0x20f4ca){return db[_0x9358('0x3b')][_0x9358('0x55')](_0x3572eb[_0x9358('0x56')],{})[_0x9358('0x2b')](function(_0x14e117){var _0x8e9d18=_0x3572eb[_0x9358('0x57')][_0x9358('0x2c')]({'plain':!![]});if(!_0x8e9d18)throw new Error(_0x9358('0x58'));if(_0x8e9d18['role']===_0x9358('0x57')){var _0xa7092c=_0x14e117['get']({'plain':!![]});var _0x5165c1=[{'name':_0x9358('0x2d'),'value':'inbound'},{'name':_0x9358('0x2e'),'value':_0x9358('0x2f')}];var _0x30ceea=_[_0x9358('0x35')](_0x5165c1,[_0x9358('0x33'),_0xa7092c[_0x9358('0x34')]])[_0x9358('0x36')];return db[_0x9358('0x59')][_0x9358('0x35')]({'where':{'name':_0x30ceea,'userProfileId':_0x8e9d18[_0x9358('0x5a')]},'raw':!![]})[_0x9358('0x2b')](function(_0x4fe2b1){if(_0x4fe2b1&&_0x4fe2b1[_0x9358('0x5b')]===0x0){return db[_0x9358('0x37')][_0x9358('0x55')]({'name':_0xa7092c['name'],'resourceId':_0xa7092c['id'],'type':_0x4fe2b1['name'],'sectionId':_0x4fe2b1['id']},{})[_0x9358('0x2b')](function(){return _0x14e117;});}else{return _0x14e117;}})[_0x9358('0x54')](function(_0xfd4c5f){logger[_0x9358('0x38')](_0x9358('0x5c'),_0xfd4c5f);throw _0xfd4c5f;});}return _0x14e117;})['then'](respondWithResult(_0x20f4ca,0xc9))[_0x9358('0x54')](handleError(_0x20f4ca,null));};exports[_0x9358('0x5d')]=function(_0x4ca60d,_0x325a6a){var _0x27a422={'where':{'id':_0x4ca60d[_0x9358('0x51')]['id']}},_0x5bb7c2={};_0x5bb7c2['model']=_['keys'](db['VoiceQueue'][_0x9358('0x3c')]);_0x27a422['attributes']=_[_0x9358('0x42')](_0x5bb7c2[_0x9358('0x3e')],qs[_0x9358('0x43')](_0x4ca60d['query'][_0x9358('0x43')]));_0x27a422[_0x9358('0x44')]=_0x27a422[_0x9358('0x44')][_0x9358('0x45')]?_0x27a422['attributes']:_0x5bb7c2[_0x9358('0x3e')];if(_0x4ca60d[_0x9358('0x3f')][_0x9358('0x52')]){_0x27a422[_0x9358('0x4e')]=[{'all':!![]}];}_0x27a422=_['merge']({},_0x27a422,_0x4ca60d[_0x9358('0x53')]);return db[_0x9358('0x3b')]['find'](_0x27a422)[_0x9358('0x2b')](handleEntityNotFound(_0x325a6a,null))['then'](function(_0xf5b415){if(_0xf5b415){var _0xcbd03=_0xf5b415[_0x9358('0x2c')]({'plain':!![]});_0xcbd03=qs['omit'](_0xcbd03,['id',_0x9358('0x5e'),_0x9358('0x5f')]);_0x4ca60d[_0x9358('0x56')]=_[_0x9358('0x60')](_0x4ca60d['body'],['id',_0x9358('0x5e'),_0x9358('0x5f')]);return db[_0x9358('0x3b')]['create'](_['merge'](_0xcbd03,_0x4ca60d[_0x9358('0x56')]),{'include':_0x4ca60d[_0x9358('0x3f')][_0x9358('0x52')]?[{'all':!![]}]:undefined})[_0x9358('0x2b')](function(_0x4ad1a0){var _0x3d2b30=_0x4ca60d['user'][_0x9358('0x2c')]({'plain':!![]});if(!_0x3d2b30)throw new Error(_0x9358('0x58'));if(_0x3d2b30[_0x9358('0x61')]===_0x9358('0x57')){var _0x4c5cab=_0x4ad1a0[_0x9358('0x2c')]({'plain':!![]});var _0x2e80e8=[{'name':'VoiceQueues','value':_0x9358('0x62')},{'name':'QueueCampaigns','value':_0x9358('0x2f')}];var _0x47bcc1=_['find'](_0x2e80e8,[_0x9358('0x33'),_0x4c5cab[_0x9358('0x34')]])[_0x9358('0x36')];return db['UserProfileSection'][_0x9358('0x35')]({'where':{'name':_0x47bcc1,'userProfileId':_0x3d2b30[_0x9358('0x5a')]},'raw':!![]})[_0x9358('0x2b')](function(_0xa03a41){if(_0xa03a41&&_0xa03a41[_0x9358('0x5b')]===0x0){return db[_0x9358('0x37')][_0x9358('0x55')]({'name':_0x4c5cab[_0x9358('0x36')],'resourceId':_0x4c5cab['id'],'type':_0xa03a41[_0x9358('0x36')],'sectionId':_0xa03a41['id']},{})[_0x9358('0x2b')](function(){return _0x4ad1a0;});}else{return _0x4ad1a0;}})[_0x9358('0x54')](function(_0x125ef2){logger[_0x9358('0x38')](_0x9358('0x5c'),_0x125ef2);throw _0x125ef2;});}return _0x4ad1a0;});}})[_0x9358('0x2b')](respondWithResult(_0x325a6a,0xc9))[_0x9358('0x54')](handleError(_0x325a6a,null));};exports[_0x9358('0x63')]=function(_0x57ea5a,_0x216523){if(_0x57ea5a[_0x9358('0x56')]['id']){delete _0x57ea5a[_0x9358('0x56')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x57ea5a[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x216523,null))[_0x9358('0x2b')](saveUpdates(_0x57ea5a[_0x9358('0x56')],null))[_0x9358('0x2b')](respondWithResult(_0x216523,null))[_0x9358('0x54')](handleError(_0x216523,null));};exports[_0x9358('0x2a')]=function(_0x5e45bd,_0x1fd60d){return db[_0x9358('0x3b')][_0x9358('0x35')]({'where':{'id':_0x5e45bd[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x1fd60d,null))['then'](removeEntity(_0x1fd60d,null))['catch'](handleError(_0x1fd60d,null));};exports[_0x9358('0x64')]=function(_0x2877a2,_0x33669e,_0x41703c){var _0x4273c2={'raw':![],'where':{}};var _0x27aea7={};var _0x266be5={'count':0x0,'rows':[]};return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x2877a2['params']['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x33669e,null))[_0x9358('0x2b')](function(_0x56ae0b){if(_0x56ae0b){_0x27aea7[_0x9358('0x3e')]=_[_0x9358('0x40')](db[_0x9358('0x66')][_0x9358('0x3c')]);_0x27aea7['query']=_[_0x9358('0x40')](_0x2877a2[_0x9358('0x3f')]);_0x27aea7[_0x9358('0x41')]=_['intersection'](_0x27aea7[_0x9358('0x3e')],_0x27aea7[_0x9358('0x3f')]);_0x4273c2[_0x9358('0x44')]=_['intersection'](_0x27aea7[_0x9358('0x3e')],qs[_0x9358('0x43')](_0x2877a2[_0x9358('0x3f')][_0x9358('0x43')]));_0x4273c2['attributes']=_0x4273c2[_0x9358('0x44')][_0x9358('0x45')]?_0x4273c2[_0x9358('0x44')]:_0x27aea7[_0x9358('0x3e')];if(!_0x2877a2[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0x4273c2[_0x9358('0x22')]=qs['limit'](_0x2877a2[_0x9358('0x3f')]['limit']);_0x4273c2[_0x9358('0x21')]=qs['offset'](_0x2877a2[_0x9358('0x3f')][_0x9358('0x21')]);}_0x4273c2[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x2877a2[_0x9358('0x3f')][_0x9358('0x49')]);_0x4273c2[_0x9358('0x4a')]=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x2877a2[_0x9358('0x3f')],_0x27aea7[_0x9358('0x41')]));_0x4273c2[_0x9358('0x4a')][_0x9358('0x67')]=_0x56ae0b['id'];if(_0x2877a2['query'][_0x9358('0x30')]){_0x4273c2['where']=_[_0x9358('0x4c')](_0x4273c2[_0x9358('0x4a')],{'$or':_['map'](_0x4273c2['attributes'],function(_0x4ffcf9){var _0x4de8ea={};_0x4de8ea[_0x4ffcf9]={'$like':'%'+_0x2877a2[_0x9358('0x3f')]['filter']+'%'};return _0x4de8ea;})});}_0x4273c2=_[_0x9358('0x4c')]({},_0x4273c2,_0x2877a2[_0x9358('0x53')]);return db['CmHopper'][_0x9358('0x24')]({'where':_0x4273c2[_0x9358('0x4a')]})[_0x9358('0x2b')](function(_0x264200){_0x266be5['count']=_0x264200;if(_0x2877a2['query'][_0x9358('0x52')]){_0x4273c2['include']=[{'all':!![]}];}return db['CmHopper'][_0x9358('0x68')](_0x4273c2);})[_0x9358('0x2b')](function(_0x5b9a52){_0x266be5['rows']=_0x5b9a52;return _0x266be5;});}})[_0x9358('0x2b')](respondWithFilteredResult(_0x33669e,_0x4273c2))[_0x9358('0x54')](handleError(_0x33669e,null));};exports[_0x9358('0x69')]=function(_0x1bfdbf,_0x5ae770,_0x525007){var _0x22688b={'raw':!![],'where':{}};var _0x44375b={};var _0x4d8896={'count':0x0,'rows':[]};return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x1bfdbf['params']['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x5ae770,null))[_0x9358('0x2b')](function(_0x4ccc41){if(_0x4ccc41){_0x44375b[_0x9358('0x3e')]=_[_0x9358('0x40')](db[_0x9358('0x6a')][_0x9358('0x3c')]);_0x44375b['query']=_[_0x9358('0x40')](_0x1bfdbf[_0x9358('0x3f')]);_0x44375b[_0x9358('0x41')]=_[_0x9358('0x42')](_0x44375b[_0x9358('0x3e')],_0x44375b['query']);_0x22688b[_0x9358('0x44')]=_['intersection'](_0x44375b[_0x9358('0x3e')],qs[_0x9358('0x43')](_0x1bfdbf[_0x9358('0x3f')][_0x9358('0x43')]));_0x22688b[_0x9358('0x44')]=_0x22688b[_0x9358('0x44')][_0x9358('0x45')]?_0x22688b[_0x9358('0x44')]:_0x44375b[_0x9358('0x3e')];if(!_0x1bfdbf['query'][_0x9358('0x46')](_0x9358('0x47'))){_0x22688b['limit']=qs[_0x9358('0x22')](_0x1bfdbf[_0x9358('0x3f')][_0x9358('0x22')]);_0x22688b['offset']=qs[_0x9358('0x21')](_0x1bfdbf[_0x9358('0x3f')]['offset']);}_0x22688b[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x1bfdbf[_0x9358('0x3f')][_0x9358('0x49')]);_0x22688b[_0x9358('0x4a')]=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x1bfdbf[_0x9358('0x3f')],_0x44375b['filters']));_0x22688b['where']['VoiceQueueId']=_0x4ccc41['id'];if(_0x1bfdbf[_0x9358('0x3f')]['filter']){_0x22688b[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0x22688b[_0x9358('0x4a')],{'$or':_[_0x9358('0x32')](_0x22688b[_0x9358('0x44')],function(_0x5f2237){var _0x37e19b={};_0x37e19b[_0x5f2237]={'$like':'%'+_0x1bfdbf[_0x9358('0x3f')][_0x9358('0x30')]+'%'};return _0x37e19b;})});}_0x22688b=_['merge']({},_0x22688b,_0x1bfdbf[_0x9358('0x53')]);return db[_0x9358('0x6a')][_0x9358('0x24')]({'where':_0x22688b[_0x9358('0x4a')]})['then'](function(_0x32aa74){_0x4d8896[_0x9358('0x24')]=_0x32aa74;if(_0x1bfdbf[_0x9358('0x3f')][_0x9358('0x52')]){_0x22688b[_0x9358('0x4e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9358('0x68')](_0x22688b);})['then'](function(_0x3abd40){_0x4d8896[_0x9358('0x4f')]=_0x3abd40;return _0x4d8896;});}})[_0x9358('0x2b')](respondWithFilteredResult(_0x5ae770,_0x22688b))[_0x9358('0x54')](handleError(_0x5ae770,null));};exports['getHopperFinals']=function(_0x20e81e,_0x22fa7d,_0x1fdeda){var _0x34f980={'raw':!![],'where':{}};var _0x2a0f3c={};var _0x5b2b7d={'count':0x0,'rows':[]};return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x20e81e[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x22fa7d,null))[_0x9358('0x2b')](function(_0x4dfc4d){if(_0x4dfc4d){_0x2a0f3c[_0x9358('0x3e')]=_[_0x9358('0x40')](db['CmHopperFinal']['rawAttributes']);_0x2a0f3c[_0x9358('0x3f')]=_[_0x9358('0x40')](_0x20e81e[_0x9358('0x3f')]);_0x2a0f3c['filters']=_[_0x9358('0x42')](_0x2a0f3c[_0x9358('0x3e')],_0x2a0f3c['query']);_0x34f980['attributes']=_['intersection'](_0x2a0f3c[_0x9358('0x3e')],qs['fields'](_0x20e81e[_0x9358('0x3f')][_0x9358('0x43')]));_0x34f980[_0x9358('0x44')]=_0x34f980[_0x9358('0x44')]['length']?_0x34f980[_0x9358('0x44')]:_0x2a0f3c[_0x9358('0x3e')];if(!_0x20e81e['query'][_0x9358('0x46')](_0x9358('0x47'))){_0x34f980[_0x9358('0x22')]=qs['limit'](_0x20e81e[_0x9358('0x3f')]['limit']);_0x34f980[_0x9358('0x21')]=qs[_0x9358('0x21')](_0x20e81e['query']['offset']);}_0x34f980[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x20e81e['query'][_0x9358('0x49')]);_0x34f980[_0x9358('0x4a')]=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x20e81e[_0x9358('0x3f')],_0x2a0f3c[_0x9358('0x41')]));_0x34f980['where'][_0x9358('0x67')]=_0x4dfc4d['id'];if(_0x20e81e[_0x9358('0x3f')]['filter']){_0x34f980[_0x9358('0x4a')]=_['merge'](_0x34f980['where'],{'$or':_[_0x9358('0x32')](_0x34f980[_0x9358('0x44')],function(_0x202c54){var _0x1fc90c={};_0x1fc90c[_0x202c54]={'$like':'%'+_0x20e81e['query'][_0x9358('0x30')]+'%'};return _0x1fc90c;})});}_0x34f980=_[_0x9358('0x4c')]({},_0x34f980,_0x20e81e[_0x9358('0x53')]);return db[_0x9358('0x6b')]['count']({'where':_0x34f980[_0x9358('0x4a')]})[_0x9358('0x2b')](function(_0x262d1f){_0x5b2b7d[_0x9358('0x24')]=_0x262d1f;if(_0x20e81e[_0x9358('0x3f')][_0x9358('0x52')]){_0x34f980[_0x9358('0x4e')]=[{'all':!![]}];}return db[_0x9358('0x6b')]['findAll'](_0x34f980);})[_0x9358('0x2b')](function(_0x2152e9){_0x5b2b7d[_0x9358('0x4f')]=_0x2152e9;return _0x5b2b7d;});}})[_0x9358('0x2b')](respondWithFilteredResult(_0x22fa7d,_0x34f980))['catch'](handleError(_0x22fa7d,null));};exports[_0x9358('0x6c')]=function(_0x72385d,_0xc6daff,_0x47b0e8){var _0x51d734={'raw':!![],'where':{}};var _0x3ec3c8={};var _0x19cdf5={'count':0x0,'rows':[]};return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x72385d[_0x9358('0x51')]['id']}})['then'](handleEntityNotFound(_0xc6daff,null))['then'](function(_0x431a1f){if(_0x431a1f){_0x3ec3c8[_0x9358('0x3e')]=_['keys'](db[_0x9358('0x6d')]['rawAttributes']);_0x3ec3c8['query']=_[_0x9358('0x40')](_0x72385d[_0x9358('0x3f')]);_0x3ec3c8[_0x9358('0x41')]=_['intersection'](_0x3ec3c8[_0x9358('0x3e')],_0x3ec3c8[_0x9358('0x3f')]);_0x51d734[_0x9358('0x44')]=_[_0x9358('0x42')](_0x3ec3c8[_0x9358('0x3e')],qs['fields'](_0x72385d['query'][_0x9358('0x43')]));_0x51d734[_0x9358('0x44')]=_0x51d734[_0x9358('0x44')][_0x9358('0x45')]?_0x51d734['attributes']:_0x3ec3c8[_0x9358('0x3e')];if(!_0x72385d['query'][_0x9358('0x46')](_0x9358('0x47'))){_0x51d734[_0x9358('0x22')]=qs['limit'](_0x72385d['query']['limit']);_0x51d734['offset']=qs[_0x9358('0x21')](_0x72385d[_0x9358('0x3f')][_0x9358('0x21')]);}_0x51d734[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x72385d[_0x9358('0x3f')][_0x9358('0x49')]);_0x51d734[_0x9358('0x4a')]=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x72385d[_0x9358('0x3f')],_0x3ec3c8[_0x9358('0x41')]));_0x51d734[_0x9358('0x4a')][_0x9358('0x67')]=_0x431a1f['id'];if(_0x72385d[_0x9358('0x3f')]['filter']){_0x51d734['where']=_[_0x9358('0x4c')](_0x51d734[_0x9358('0x4a')],{'$or':_['map'](_0x51d734[_0x9358('0x44')],function(_0x50436a){var _0x12b161={};_0x12b161[_0x50436a]={'$like':'%'+_0x72385d[_0x9358('0x3f')][_0x9358('0x30')]+'%'};return _0x12b161;})});}_0x51d734=_['merge']({},_0x51d734,_0x72385d[_0x9358('0x53')]);return db['CmHopperBlack'][_0x9358('0x24')]({'where':_0x51d734[_0x9358('0x4a')]})['then'](function(_0x4a839d){_0x19cdf5[_0x9358('0x24')]=_0x4a839d;if(_0x72385d['query']['includeAll']){_0x51d734['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x51d734);})['then'](function(_0x13a926){_0x19cdf5[_0x9358('0x4f')]=_0x13a926;return _0x19cdf5;});}})[_0x9358('0x2b')](respondWithFilteredResult(_0xc6daff,_0x51d734))[_0x9358('0x54')](handleError(_0xc6daff,null));};exports[_0x9358('0x6e')]=function(_0x12c059,_0x2f6561,_0x194423){var _0xaa3a0a={};var _0x3b9455={};var _0x5b25a8;var _0x31460a;return db['VoiceQueue']['findOne']({'where':{'id':_0x12c059['params']['id']}})['then'](handleEntityNotFound(_0x2f6561,null))[_0x9358('0x2b')](function(_0x28825f){if(_0x28825f){_0x5b25a8=_0x28825f;_0x3b9455['model']=_[_0x9358('0x40')](db['Team'][_0x9358('0x3c')]);_0x3b9455[_0x9358('0x3f')]=_[_0x9358('0x40')](_0x12c059[_0x9358('0x3f')]);_0x3b9455['filters']=_[_0x9358('0x42')](_0x3b9455[_0x9358('0x3e')],_0x3b9455['query']);_0xaa3a0a[_0x9358('0x44')]=_[_0x9358('0x42')](_0x3b9455['model'],qs['fields'](_0x12c059[_0x9358('0x3f')][_0x9358('0x43')]));_0xaa3a0a[_0x9358('0x44')]=_0xaa3a0a[_0x9358('0x44')][_0x9358('0x45')]?_0xaa3a0a[_0x9358('0x44')]:_0x3b9455[_0x9358('0x3e')];_0xaa3a0a['order']=qs[_0x9358('0x49')](_0x12c059['query'][_0x9358('0x49')]);_0xaa3a0a[_0x9358('0x4a')]=qs['filters'](_[_0x9358('0x4b')](_0x12c059[_0x9358('0x3f')],_0x3b9455[_0x9358('0x41')]));if(_0x12c059[_0x9358('0x3f')][_0x9358('0x30')]){_0xaa3a0a[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0xaa3a0a[_0x9358('0x4a')],{'$or':_['map'](_0xaa3a0a[_0x9358('0x44')],function(_0xb027c9){var _0x55bcac={};_0x55bcac[_0xb027c9]={'$like':'%'+_0x12c059['query'][_0x9358('0x30')]+'%'};return _0x55bcac;})});}_0xaa3a0a=_[_0x9358('0x4c')]({},_0xaa3a0a,_0x12c059[_0x9358('0x53')]);return _0x5b25a8['getTeams'](_0xaa3a0a);}})['then'](function(_0x583adb){if(_0x583adb){_0x31460a=_0x583adb[_0x9358('0x45')];if(!_0x12c059[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0xaa3a0a[_0x9358('0x22')]=qs['limit'](_0x12c059[_0x9358('0x3f')][_0x9358('0x22')]);_0xaa3a0a['offset']=qs[_0x9358('0x21')](_0x12c059[_0x9358('0x3f')]['offset']);}return _0x5b25a8['getTeams'](_0xaa3a0a);}})[_0x9358('0x2b')](function(_0x56d348){if(_0x56d348){return _0x56d348?{'count':_0x31460a,'rows':_0x56d348}:null;}})[_0x9358('0x2b')](respondWithResult(_0x2f6561,null))[_0x9358('0x54')](handleError(_0x2f6561,null));};exports[_0x9358('0x6f')]=function(_0x31698b,_0x28ee92,_0x478294){var _0x345966=_0x31698b[_0x9358('0x56')]['teams'];var _0x12a064=_[_0x9358('0x32')](_0x345966,'id');return db[_0x9358('0x70')][_0x9358('0x68')]({'where':{'id':_0x12a064},'attributes':['id'],'include':[{'model':db[_0x9358('0x71')],'as':_0x9358('0x72'),'attributes':['id','name',_0x9358('0x73'),_0x9358('0x74'),_0x9358('0x75')],'raw':!![]}]})[_0x9358('0x2b')](function(_0x5c0196){if(_0x5c0196){var _0x4bc909=_[_0x9358('0x76')](_0x5c0196,function(_0x2f7087){var _0x17e100=_0x2f7087['get']({'plain':!![]});_0x17e100[_0x9358('0x72')][_0x9358('0x77')](function(_0x2f22e9){_0x2f22e9['penalty']=_[_0x9358('0x35')](_0x345966,{'id':_0x17e100['id']})[_0x9358('0x78')];});return _0x17e100['Agents'];});return db[_0x9358('0x3b')]['find']({'where':{'id':_0x31698b[_0x9358('0x51')]['id']}})['then'](function(_0x200ed7){return db[_0x9358('0x79')][_0x9358('0x7a')](function(_0x4e1e20){return _0x200ed7['addTeams'](_0x12a064,{'transaction':_0x4e1e20})[_0x9358('0x2b')](function(){return BPromise[_0x9358('0x7b')](_0x345966,function(_0x58b332){return db[_0x9358('0x7c')]['upsert']({'TeamId':_0x58b332['id'],'VoiceQueueId':_0x31698b[_0x9358('0x51')]['id'],'penalty':_0x58b332[_0x9358('0x78')]},{'transaction':_0x4e1e20});});})[_0x9358('0x2b')](function(){return BPromise['each'](_0x4bc909,function(_0x500ffb){return db['UserVoiceQueue'][_0x9358('0x7d')]({'where':{'UserId':_0x500ffb['id'],'VoiceQueueId':_0x31698b['params']['id']},'defaults':{'penalty':_0x500ffb[_0x9358('0x78')]},'transaction':_0x4e1e20});});})[_0x9358('0x2b')](function(){return BPromise['each'](_[_0x9358('0x30')](_0x4bc909,{'online':!![]}),function(_0x1a9b49){return db[_0x9358('0x7e')][_0x9358('0x7f')]({'membername':_0x1a9b49['name'],'UserId':_0x1a9b49['id'],'queue_name':_0x200ed7[_0x9358('0x36')],'VoiceQueueId':_0x200ed7['id'],'interface':_['isNil'](_0x1a9b49['interface'])?util[_0x9358('0x80')](_0x9358('0x81'),_0x1a9b49[_0x9358('0x36')]):_0x1a9b49[_0x9358('0x75')],'paused':_0x1a9b49[_0x9358('0x74')]||![],'penalty':_0x1a9b49[_0x9358('0x78')]},{'transaction':_0x4e1e20});});})[_0x9358('0x2b')](function(){_0x4bc909[_0x9358('0x77')](function(_0x2ae69c){socket[_0x9358('0x82')](_0x9358('0x83'),{'UserId':_0x2ae69c['id'],'VoiceQueueId':_0x200ed7['id']});});});});});}})[_0x9358('0x2b')](respondWithStatusCode(_0x28ee92,null))['catch'](handleError(_0x28ee92,null));};exports[_0x9358('0x84')]=function(_0x4fb28d,_0x565f60,_0x1cf38c){return db[_0x9358('0x70')][_0x9358('0x68')]({'where':{'id':_0x4fb28d[_0x9358('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9358('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x565f60,null))[_0x9358('0x2b')](function(_0x5866db){var _0x4b3c87=_[_0x9358('0x32')](_0x5866db,'id');var _0x591c64=[];var _0x2ed7e1=[];var _0x2eca9b=squel[_0x9358('0x85')]();_0x2eca9b[_0x9358('0x86')](_0x9358('0x87'))[_0x9358('0x88')]('team_has_voice_queues','tq')[_0x9358('0x89')](_0x9358('0x8a'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9358('0x8b'),_0x4fb28d[_0x9358('0x51')]['id']);for(var _0x5472f2=0x0;_0x5472f2<_0x5866db['length'];_0x5472f2+=0x1){let _0x567e75=_0x5866db[_0x5472f2];for(var _0x11eb83=0x0;_0x11eb83<_0x567e75[_0x9358('0x72')][_0x9358('0x45')];_0x11eb83+=0x1){let _0x4ae1b0=_0x567e75[_0x9358('0x72')][_0x11eb83];var _0x185995=_0x2eca9b[_0x9358('0x5d')]();_0x185995[_0x9358('0x4a')](_0x9358('0x8c'),_0x4ae1b0['id']);_0x2ed7e1['push'](db[_0x9358('0x79')][_0x9358('0x3f')](_0x185995[_0x9358('0x8d')](),{'type':db[_0x9358('0x79')]['QueryTypes'][_0x9358('0x8e')]})[_0x9358('0x2b')](function(_0x1c9fc8){if(_0x1c9fc8[_0x9358('0x45')]===0x1){return _0x4ae1b0['id'];}else{var _0x2f849a=_[_0x9358('0x8f')](_['map'](_0x1c9fc8,_0x9358('0x90')),function(_0x3778e6){return _[_0x9358('0x91')](_0x4b3c87,_0x3778e6);});if(_0x2f849a){return _0x4ae1b0['id'];}}}));}}return BPromise[_0x9358('0x92')](_0x2ed7e1)[_0x9358('0x2b')](function(_0x22b5f8){_0x591c64=_(_0x591c64)[_0x9358('0x93')](_0x22b5f8)[_0x9358('0x94')]()['value']();return db[_0x9358('0x3b')]['find']({'where':{'id':_0x4fb28d[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](function(_0x4473ef){return db[_0x9358('0x79')]['transaction'](function(_0x8d54d3){return _0x4473ef[_0x9358('0x84')](_0x4fb28d[_0x9358('0x3f')][_0x9358('0x95')],{'transaction':_0x8d54d3})[_0x9358('0x2b')](function(){if(!_[_0x9358('0x96')](_0x591c64)){return _0x4473ef['removeAgents'](_0x591c64,{'transaction':_0x8d54d3})[_0x9358('0x2b')](function(){return db['UserVoiceQueueRt'][_0x9358('0x2a')]({'where':{'VoiceQueueId':_0x4fb28d['params']['id'],'UserId':_0x591c64},'transaction':_0x8d54d3});});}})['then'](function(){_0x591c64[_0x9358('0x77')](function(_0x42bfd9){socket['emit'](_0x9358('0x97'),{'UserId':_0x42bfd9,'VoiceQueueId':_0x4473ef['id']});});});});});});})[_0x9358('0x2b')](respondWithStatusCode(_0x565f60,null))['catch'](handleError(_0x565f60,null));};exports[_0x9358('0x98')]=function(_0x3b6447,_0x289c2d,_0x38595c){var _0x407184,_0x3ecf08;return db[_0x9358('0x3b')][_0x9358('0x35')]({'where':{'id':_0x3b6447[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x289c2d,null))[_0x9358('0x2b')](function(_0x84a363){if(_0x84a363){_0x3ecf08=_0x84a363;return _0x84a363['addAgents'](_0x3b6447['body'][_0x9358('0x95')],_[_0x9358('0x60')](_0x3b6447[_0x9358('0x56')],[_0x9358('0x95'),'id'])||{})[_0x9358('0x99')](function(_0x515d2a){for(var _0x3c3011=0x0;_0x3c3011<_0x3b6447[_0x9358('0x56')][_0x9358('0x95')][_0x9358('0x45')];_0x3c3011+=0x1){socket[_0x9358('0x82')](_0x9358('0x83'),{'UserId':Number(_0x3b6447[_0x9358('0x56')]['ids'][_0x3c3011]),'VoiceQueueId':Number(_0x3b6447[_0x9358('0x51')]['id'])});}return _0x515d2a;});}})[_0x9358('0x2b')](function(_0x808d27){_0x407184=_0x808d27||[];if(_0x3ecf08){return db[_0x9358('0x71')][_0x9358('0x68')]({'where':{'id':_0x3b6447[_0x9358('0x56')][_0x9358('0x95')]},'attributes':['id',_0x9358('0x36'),_0x9358('0x73'),_0x9358('0x74'),_0x9358('0x75')],'raw':!![]});}})[_0x9358('0x2b')](function(_0x24ce3d){if(!_[_0x9358('0x96')](_0x24ce3d)){var _0x3b508a=[];for(var _0x2c6bef=0x0;_0x2c6bef<_0x24ce3d['length'];_0x2c6bef++){if(_0x24ce3d[_0x2c6bef][_0x9358('0x73')]){_0x3b508a[_0x9358('0x9a')](db[_0x9358('0x7e')][_0x9358('0x7f')]({'membername':_0x24ce3d[_0x2c6bef]['name'],'UserId':_0x24ce3d[_0x2c6bef]['id'],'queue_name':_0x3ecf08['name'],'VoiceQueueId':_0x3ecf08['id'],'interface':_[_0x9358('0x9b')](_0x24ce3d[_0x2c6bef][_0x9358('0x75')])?util[_0x9358('0x80')](_0x9358('0x81'),_0x24ce3d[_0x2c6bef][_0x9358('0x36')]):_0x24ce3d[_0x2c6bef][_0x9358('0x75')],'paused':_0x24ce3d[_0x2c6bef][_0x9358('0x74')]||![],'penalty':_0x3b6447[_0x9358('0x56')][_0x9358('0x78')]||0x0}));}}return BPromise[_0x9358('0x92')](_0x3b508a);}})[_0x9358('0x2b')](function(){return _0x407184;})['then'](respondWithResult(_0x289c2d,null))[_0x9358('0x54')](handleError(_0x289c2d,null));};exports[_0x9358('0x9c')]=function(_0xf15615,_0x3f27e3,_0x59981c){return db[_0x9358('0x3b')][_0x9358('0x35')]({'where':{'id':_0xf15615[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x3f27e3,null))[_0x9358('0x2b')](function(_0x42d122){if(_0x42d122){return _0x42d122[_0x9358('0x9c')](_0xf15615['query']['ids'])['then'](function(){if(_[_0x9358('0x9d')](_0xf15615[_0x9358('0x3f')]['ids'])){for(var _0x123a73=0x0;_0x123a73<_0xf15615[_0x9358('0x3f')]['ids'][_0x9358('0x45')];_0x123a73+=0x1){socket[_0x9358('0x82')](_0x9358('0x97'),{'UserId':Number(_0xf15615['query']['ids'][_0x123a73]),'VoiceQueueId':Number(_0xf15615['params']['id'])});}}else{socket[_0x9358('0x82')](_0x9358('0x97'),{'UserId':Number(_0xf15615['query'][_0x9358('0x95')]),'VoiceQueueId':Number(_0xf15615[_0x9358('0x51')]['id'])});}});}})[_0x9358('0x2b')](function(_0x32bbe7){return db[_0x9358('0x7e')]['destroy']({'where':{'VoiceQueueId':_0xf15615[_0x9358('0x51')]['id'],'UserId':_0xf15615[_0x9358('0x3f')][_0x9358('0x95')]}})[_0x9358('0x2b')](function(){return _0x32bbe7;});})['then'](respondWithStatusCode(_0x3f27e3,null))['catch'](handleError(_0x3f27e3,null));};exports[_0x9358('0x9e')]=function(_0x146f42,_0x4cc6c5,_0xa59899){var _0x3c7a16={};var _0x29f0e7={};var _0x17d5d4;var _0x33dd33;return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x146f42[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x4cc6c5,null))[_0x9358('0x2b')](function(_0x7919bb){if(_0x7919bb){_0x17d5d4=_0x7919bb;_0x29f0e7['model']=_['keys'](db[_0x9358('0x71')][_0x9358('0x3c')]);_0x29f0e7['query']=_[_0x9358('0x40')](_0x146f42[_0x9358('0x3f')]);_0x29f0e7[_0x9358('0x41')]=_[_0x9358('0x42')](_0x29f0e7[_0x9358('0x3e')],_0x29f0e7[_0x9358('0x3f')]);_0x3c7a16[_0x9358('0x44')]=_[_0x9358('0x42')](_0x29f0e7['model'],qs['fields'](_0x146f42[_0x9358('0x3f')][_0x9358('0x43')]));_0x3c7a16['attributes']=_0x3c7a16['attributes']['length']?_0x3c7a16['attributes']:_0x29f0e7['model'];_0x3c7a16[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x146f42[_0x9358('0x3f')][_0x9358('0x49')]);_0x3c7a16[_0x9358('0x4a')]=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x146f42[_0x9358('0x3f')],_0x29f0e7[_0x9358('0x41')]));if(_0x146f42[_0x9358('0x3f')][_0x9358('0x30')]){_0x3c7a16[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0x3c7a16[_0x9358('0x4a')],{'$or':_[_0x9358('0x32')](_0x3c7a16[_0x9358('0x44')],function(_0x215fb0){var _0x148c1a={};_0x148c1a[_0x215fb0]={'$like':'%'+_0x146f42[_0x9358('0x3f')][_0x9358('0x30')]+'%'};return _0x148c1a;})});}_0x3c7a16=_[_0x9358('0x4c')]({},_0x3c7a16,_0x146f42[_0x9358('0x53')]);return _0x17d5d4['getAgents'](_0x3c7a16);}})['then'](function(_0xf15c77){if(_0xf15c77){_0x33dd33=_0xf15c77[_0x9358('0x45')];if(!_0x146f42[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0x3c7a16[_0x9358('0x22')]=qs['limit'](_0x146f42[_0x9358('0x3f')][_0x9358('0x22')]);_0x3c7a16[_0x9358('0x21')]=qs['offset'](_0x146f42[_0x9358('0x3f')][_0x9358('0x21')]);}return _0x17d5d4[_0x9358('0x9e')](_0x3c7a16);}})['then'](function(_0x5ec858){if(_0x5ec858){return _0x5ec858?{'count':_0x33dd33,'rows':_0x5ec858}:null;}})['then'](respondWithResult(_0x4cc6c5,null))[_0x9358('0x54')](handleError(_0x4cc6c5,null));};exports[_0x9358('0x9f')]=function(_0x572ed7,_0x5ea071,_0x37b33c){var _0x2e883c={};var _0x605742={};var _0x8f5913;var _0x397038;return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x572ed7['params']['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x5ea071,null))[_0x9358('0x2b')](function(_0xffc777){if(_0xffc777){_0x8f5913=_0xffc777;_0x605742['model']=_[_0x9358('0x40')](db[_0x9358('0x7e')][_0x9358('0x3c')]);_0x605742['query']=_['keys'](_0x572ed7['query']);_0x605742[_0x9358('0x41')]=_[_0x9358('0x42')](_0x605742['model'],_0x605742[_0x9358('0x3f')]);_0x2e883c[_0x9358('0x44')]=_[_0x9358('0x42')](_0x605742[_0x9358('0x3e')],qs[_0x9358('0x43')](_0x572ed7['query'][_0x9358('0x43')]));_0x2e883c[_0x9358('0x44')]=_0x2e883c[_0x9358('0x44')][_0x9358('0x45')]?_0x2e883c['attributes']:_0x605742[_0x9358('0x3e')];_0x2e883c[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x572ed7[_0x9358('0x3f')]['sort']);_0x2e883c['where']=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x572ed7['query'],_0x605742[_0x9358('0x41')]));if(_0x572ed7[_0x9358('0x3f')][_0x9358('0x30')]){_0x2e883c[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0x2e883c[_0x9358('0x4a')],{'$or':_[_0x9358('0x32')](_0x2e883c[_0x9358('0x44')],function(_0x2e591d){var _0x23cc3e={};_0x23cc3e[_0x2e591d]={'$like':'%'+_0x572ed7['query'][_0x9358('0x30')]+'%'};return _0x23cc3e;})});}_0x2e883c=_[_0x9358('0x4c')]({},_0x2e883c,_0x572ed7[_0x9358('0x53')]);return _0x8f5913['getMembers'](_0x2e883c);}})[_0x9358('0x2b')](function(_0x5264f6){if(_0x5264f6){_0x397038=_0x5264f6[_0x9358('0x45')];if(!_0x572ed7[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0x2e883c[_0x9358('0x22')]=qs[_0x9358('0x22')](_0x572ed7[_0x9358('0x3f')]['limit']);_0x2e883c['offset']=qs['offset'](_0x572ed7[_0x9358('0x3f')]['offset']);}return _0x8f5913[_0x9358('0x9f')](_0x2e883c);}})[_0x9358('0x2b')](function(_0x880e03){return _0x880e03?{'count':_0x397038,'rows':_0x880e03}:null;})[_0x9358('0x2b')](respondWithResult(_0x5ea071,null))[_0x9358('0x54')](handleError(_0x5ea071,null));};exports[_0x9358('0xa0')]=function(_0x46b575,_0x32e49b,_0x2fae22){var _0x2e253a={};var _0xa955a2={};var _0x1e6c47;var _0x3dfb49;return db[_0x9358('0x3b')][_0x9358('0x65')]({'where':{'id':_0x46b575[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x32e49b,null))[_0x9358('0x2b')](function(_0xd05c2b){if(_0xd05c2b){_0x1e6c47=_0xd05c2b;_0xa955a2['model']=_[_0x9358('0x40')](db['CmList'][_0x9358('0x3c')]);_0xa955a2[_0x9358('0x3f')]=_[_0x9358('0x40')](_0x46b575[_0x9358('0x3f')]);_0xa955a2['filters']=_[_0x9358('0x42')](_0xa955a2[_0x9358('0x3e')],_0xa955a2[_0x9358('0x3f')]);_0x2e253a[_0x9358('0x44')]=_['intersection'](_0xa955a2[_0x9358('0x3e')],qs['fields'](_0x46b575[_0x9358('0x3f')][_0x9358('0x43')]));_0x2e253a[_0x9358('0x44')]=_0x2e253a[_0x9358('0x44')][_0x9358('0x45')]?_0x2e253a['attributes']:_0xa955a2[_0x9358('0x3e')];_0x2e253a[_0x9358('0x48')]=qs['sort'](_0x46b575[_0x9358('0x3f')][_0x9358('0x49')]);_0x2e253a[_0x9358('0x4a')]=qs[_0x9358('0x41')](_['pick'](_0x46b575[_0x9358('0x3f')],_0xa955a2[_0x9358('0x41')]));if(_0x46b575['query'][_0x9358('0x30')]){_0x2e253a[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0x2e253a[_0x9358('0x4a')],{'$or':_[_0x9358('0x32')](_0x2e253a[_0x9358('0x44')],function(_0x2c66d4){var _0x2969d6={};_0x2969d6[_0x2c66d4]={'$like':'%'+_0x46b575[_0x9358('0x3f')]['filter']+'%'};return _0x2969d6;})});}_0x2e253a=_[_0x9358('0x4c')]({},_0x2e253a,_0x46b575[_0x9358('0x53')]);return _0x1e6c47[_0x9358('0xa0')](_0x2e253a);}})[_0x9358('0x2b')](function(_0x2c1a50){if(_0x2c1a50){_0x3dfb49=_0x2c1a50[_0x9358('0x45')];if(!_0x46b575[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0x2e253a['limit']=qs[_0x9358('0x22')](_0x46b575['query'][_0x9358('0x22')]);_0x2e253a[_0x9358('0x21')]=qs[_0x9358('0x21')](_0x46b575[_0x9358('0x3f')][_0x9358('0x21')]);}return _0x1e6c47[_0x9358('0xa0')](_0x2e253a);}})[_0x9358('0x2b')](function(_0x41c334){if(_0x41c334){return _0x41c334?{'count':_0x3dfb49,'rows':_0x41c334}:null;}})[_0x9358('0x2b')](respondWithResult(_0x32e49b,null))['catch'](handleError(_0x32e49b,null));};exports[_0x9358('0xa1')]=function(_0x360fe9,_0xc8d769,_0x1d7383){var _0x482f0b,_0x5ceb54;return db[_0x9358('0x3b')]['find']({'where':{'id':_0x360fe9[_0x9358('0x51')]['id']}})['then'](handleEntityNotFound(_0xc8d769,null))[_0x9358('0x2b')](function(_0x596326){if(_0x596326){_0x5ceb54=_0x596326;return _0x596326[_0x9358('0xa1')](_0x360fe9[_0x9358('0x56')][_0x9358('0x95')],_['omit'](_0x360fe9['body'],[_0x9358('0x95'),'id'])||{});}return null;})[_0x9358('0x99')](function(_0x32e58a){var _0x2f19d2;_0x482f0b=_0x32e58a||[];var _0x44f7ac=[];if(_0x32e58a){for(var _0x49ab0d=0x0;_0x49ab0d<_0x32e58a[_0x9358('0x45')];_0x49ab0d+=0x1){var _0x1a97e7=_0x32e58a[_0x49ab0d][_0x9358('0x2c')]({'plain':!![]});_0x5ceb54[_0x9358('0xa2')]=_0x360fe9[_0x9358('0x56')]['dialCheckDuplicateType']?_0x360fe9[_0x9358('0x56')][_0x9358('0xa2')]:_0x5ceb54['dialCheckDuplicateType'];switch(_0x5ceb54['dialCheckDuplicateType']){case _0x9358('0xa3'):_0x2f19d2=squel['insert']()[_0x9358('0xa4')](_0x9358('0xa5'))[_0x9358('0xa6')]([_0x9358('0xa7'),_0x9358('0xa8'),_0x9358('0xa9'),_0x9358('0xaa'),_0x9358('0x67'),_0x9358('0x5e'),_0x9358('0x5f')],squel[_0x9358('0x85')]()['field'](_0x9358('0xa7'),_0x9358('0xa7'))[_0x9358('0x86')]('NOW()','scheduledAt')['field']('id',_0x9358('0xa9'))[_0x9358('0x86')](_0x1a97e7[_0x9358('0xab')][_0x9358('0x8d')](),_0x9358('0xaa'))[_0x9358('0x86')](_0x360fe9['params']['id'][_0x9358('0x8d')](),_0x9358('0x67'))[_0x9358('0x86')](_0x9358('0xac'),_0x9358('0x5e'))[_0x9358('0x86')]('NOW()',_0x9358('0x5f'))[_0x9358('0x88')]('cm_contacts')[_0x9358('0x4a')](_0x9358('0xad'))[_0x9358('0x4a')]('ListId\x20=\x20?',_0x1a97e7[_0x9358('0xab')][_0x9358('0x8d')]())['where'](_0x9358('0xae'))[_0x9358('0x4a')](_0x9358('0xaf'),squel['select']()['field'](_0x9358('0xb0'))['from']('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x360fe9[_0x9358('0x51')]['id']['toString']()))[_0x9358('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9358('0x85')]()[_0x9358('0x86')]('COALESCE(phone,\x27\x27)')[_0x9358('0x88')](_0x9358('0xa5'))['where'](_0x9358('0x8b'),_0x360fe9['params']['id'][_0x9358('0x8d')]())))[_0x9358('0x8d')]();break;case _0x9358('0xb1'):_0x2f19d2=squel[_0x9358('0xb2')]()[_0x9358('0xa4')](_0x9358('0xa5'))['fromQuery']([_0x9358('0xa7'),'scheduledAt',_0x9358('0xa9'),_0x9358('0xaa'),_0x9358('0x67'),'createdAt','updatedAt'],squel[_0x9358('0x85')]()['field'](_0x9358('0xa7'),_0x9358('0xa7'))['field'](_0x9358('0xac'),'scheduledAt')[_0x9358('0x86')]('id','ContactId')['field'](_0x1a97e7[_0x9358('0xab')][_0x9358('0x8d')](),'ListId')[_0x9358('0x86')](_0x360fe9[_0x9358('0x51')]['id'][_0x9358('0x8d')](),'VoiceQueueId')[_0x9358('0x86')](_0x9358('0xac'),'createdAt')['field']('NOW()',_0x9358('0x5f'))['from']('cm_contacts')[_0x9358('0x4a')](_0x9358('0xad'))[_0x9358('0x4a')](_0x9358('0xb3'),_0x1a97e7[_0x9358('0xab')][_0x9358('0x8d')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x9358('0x4a')](_0x9358('0xaf'),squel[_0x9358('0x85')]()['field'](_0x9358('0xb4'))[_0x9358('0x88')](_0x9358('0xa5'))[_0x9358('0x4a')](_0x9358('0x8b'),_0x360fe9[_0x9358('0x51')]['id'][_0x9358('0x8d')]())))[_0x9358('0x8d')]();break;default:_0x2f19d2=squel[_0x9358('0xb2')]()[_0x9358('0xa4')](_0x9358('0xa5'))['fromQuery'](['phone','scheduledAt',_0x9358('0xa9'),_0x9358('0xaa'),_0x9358('0x67'),_0x9358('0x5e'),_0x9358('0x5f')],squel['select']()[_0x9358('0x86')](_0x9358('0xa7'),'phone')[_0x9358('0x86')](_0x9358('0xac'),'scheduledAt')[_0x9358('0x86')]('id','ContactId')[_0x9358('0x86')](_0x1a97e7[_0x9358('0xab')][_0x9358('0x8d')](),_0x9358('0xaa'))['field'](_0x360fe9['params']['id'][_0x9358('0x8d')](),_0x9358('0x67'))[_0x9358('0x86')](_0x9358('0xac'),_0x9358('0x5e'))['field'](_0x9358('0xac'),'updatedAt')[_0x9358('0x88')]('cm_contacts')['where'](_0x9358('0xad'))[_0x9358('0x4a')]('ListId\x20=\x20?',_0x1a97e7[_0x9358('0xab')][_0x9358('0x8d')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x9358('0x8d')]();}_0x44f7ac['push'](db[_0x9358('0x79')][_0x9358('0x3f')](_0x2f19d2));}return BPromise[_0x9358('0x92')](_0x44f7ac);}})[_0x9358('0x2b')](function(){return _0x482f0b;})[_0x9358('0x2b')](respondWithResult(_0xc8d769,null))['catch'](handleError(_0xc8d769,null));};exports[_0x9358('0xb5')]=function(_0x5e393f,_0x74b963,_0x17680b){return db[_0x9358('0x3b')][_0x9358('0x35')]({'where':{'id':_0x5e393f[_0x9358('0x51')]['id']}})['then'](handleEntityNotFound(_0x74b963,null))[_0x9358('0x2b')](function(_0x4d58f9){if(_0x4d58f9){return _0x4d58f9[_0x9358('0xb5')](_0x5e393f['query'][_0x9358('0x95')]);}})[_0x9358('0x2b')](function(_0x43b8ec){if(_0x43b8ec){return db[_0x9358('0x66')][_0x9358('0x2a')]({'where':{'ListId':_0x5e393f[_0x9358('0x3f')]['ids'],'VoiceQueueId':_0x5e393f[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](function(){return _0x43b8ec;});}})[_0x9358('0x2b')](respondWithStatusCode(_0x74b963,null))[_0x9358('0x54')](handleError(_0x74b963,null));};exports[_0x9358('0xb6')]=function(_0x5ac68e,_0x235967,_0x3a12a4){var _0x1cad96={};var _0x219e7d={};var _0x137ab6;var _0x2c3723;return db[_0x9358('0x3b')]['findOne']({'where':{'id':_0x5ac68e[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x235967,null))[_0x9358('0x2b')](function(_0xfdf733){if(_0xfdf733){_0x137ab6=_0xfdf733;_0x219e7d[_0x9358('0x3e')]=_['keys'](db['CmList'][_0x9358('0x3c')]);_0x219e7d['query']=_[_0x9358('0x40')](_0x5ac68e[_0x9358('0x3f')]);_0x219e7d[_0x9358('0x41')]=_[_0x9358('0x42')](_0x219e7d[_0x9358('0x3e')],_0x219e7d[_0x9358('0x3f')]);_0x1cad96['attributes']=_[_0x9358('0x42')](_0x219e7d['model'],qs[_0x9358('0x43')](_0x5ac68e[_0x9358('0x3f')][_0x9358('0x43')]));_0x1cad96[_0x9358('0x44')]=_0x1cad96[_0x9358('0x44')][_0x9358('0x45')]?_0x1cad96[_0x9358('0x44')]:_0x219e7d['model'];_0x1cad96[_0x9358('0x48')]=qs[_0x9358('0x49')](_0x5ac68e['query']['sort']);_0x1cad96[_0x9358('0x4a')]=qs[_0x9358('0x41')](_[_0x9358('0x4b')](_0x5ac68e[_0x9358('0x3f')],_0x219e7d['filters']));if(_0x5ac68e[_0x9358('0x3f')][_0x9358('0x30')]){_0x1cad96[_0x9358('0x4a')]=_[_0x9358('0x4c')](_0x1cad96[_0x9358('0x4a')],{'$or':_[_0x9358('0x32')](_0x1cad96[_0x9358('0x44')],function(_0x271049){var _0x4add88={};_0x4add88[_0x271049]={'$like':'%'+_0x5ac68e[_0x9358('0x3f')][_0x9358('0x30')]+'%'};return _0x4add88;})});}_0x1cad96=_[_0x9358('0x4c')]({},_0x1cad96,_0x5ac68e[_0x9358('0x53')]);return _0x137ab6[_0x9358('0xb6')](_0x1cad96);}})[_0x9358('0x2b')](function(_0x21aa5b){if(_0x21aa5b){_0x2c3723=_0x21aa5b[_0x9358('0x45')];if(!_0x5ac68e[_0x9358('0x3f')][_0x9358('0x46')](_0x9358('0x47'))){_0x1cad96['limit']=qs[_0x9358('0x22')](_0x5ac68e['query'][_0x9358('0x22')]);_0x1cad96['offset']=qs[_0x9358('0x21')](_0x5ac68e[_0x9358('0x3f')][_0x9358('0x21')]);}return _0x137ab6['getBlackLists'](_0x1cad96);}})[_0x9358('0x2b')](function(_0x5bf969){if(_0x5bf969){return _0x5bf969?{'count':_0x2c3723,'rows':_0x5bf969}:null;}})[_0x9358('0x2b')](respondWithResult(_0x235967,null))['catch'](handleError(_0x235967,null));};exports[_0x9358('0xb7')]=function(_0x645cf,_0x4c99ee,_0x4bacf6){var _0x516074,_0x4b88bc;return db[_0x9358('0x3b')][_0x9358('0x35')]({'where':{'id':_0x645cf[_0x9358('0x51')]['id']}})[_0x9358('0x2b')](handleEntityNotFound(_0x4c99ee,null))[_0x9358('0x2b')](function(_0x2ebdbb){if(_0x2ebdbb){_0x4b88bc=_0x2ebdbb;return _0x2ebdbb[_0x9358('0xb7')](_0x645cf['body'][_0x9358('0x95')],_[_0x9358('0x60')](_0x645cf[_0x9358('0x56')],[_0x9358('0x95'),'id'])||{});}return null;})[_0x9358('0x99')](function(_0x446305){var _0x5e32b5;_0x516074=_0x446305||[];var _0xa3c935=[];if(_0x446305){for(var _0x4f762d=0x0;_0x4f762d<_0x446305[_0x9358('0x45')];_0x4f762d+=0x1){var _0x295dc6=_0x446305[_0x4f762d][_0x9358('0x2c')]({'plain':!![]});_0x5e32b5=squel[_0x9358('0xb2')]()['into'](_0x9358('0xb8'))[_0x9358('0xa6')]([_0x9358('0xa7'),'ContactId',_0x9358('0xaa'),'VoiceQueueId',_0x9358('0x5e'),'updatedAt'],squel[_0x9358('0x85')]()[_0x9358('0x86')](_0x9358('0xa7'),_0x9358('0xa7'))[_0x9358('0x86')]('id',_0x9358('0xa9'))[_0x9358('0x86')](_0x295dc6[_0x9358('0xab')][_0x9358('0x8d')](),_0x9358('0xaa'))[_0x9358('0x86')](_0x645cf['params']['id'][_0x9358('0x8d')](),_0x9358('0x67'))[_0x9358('0x86')](_0x9358('0xac'),_0x9358('0x5e'))['field'](_0x9358('0xac'),_0x9358('0x5f'))[_0x9358('0x88')](_0x9358('0xb9'))[_0x9358('0x4a')](_0x9358('0xad'))[_0x9358('0x4a')]('ListId\x20=\x20?',_0x295dc6[_0x9358('0xab')][_0x9358('0x8d')]())[_0x9358('0x4a')](_0x9358('0xae')))[_0x9358('0x8d')]();_0xa3c935[_0x9358('0x9a')](db[_0x9358('0x79')][_0x9358('0x3f')](_0x5e32b5));}return BPromise['all'](_0xa3c935);}})[_0x9358('0x2b')](function(){return _0x516074;})[_0x9358('0x2b')](respondWithResult(_0x4c99ee,null))[_0x9358('0x54')](handleError(_0x4c99ee,null));};exports[_0x9358('0xba')]=function(_0x2a1529,_0x46a645,_0x2e184d){return db[_0x9358('0x3b')][_0x9358('0x35')]({'where':{'id':_0x2a1529[_0x9358('0x51')]['id']}})['then'](handleEntityNotFound(_0x46a645,null))[_0x9358('0x2b')](function(_0x3217c7){if(_0x3217c7){return _0x3217c7[_0x9358('0xba')](_0x2a1529[_0x9358('0x3f')]['ids']);}})[_0x9358('0x2b')](function(_0x6fad10){if(_0x6fad10){return db[_0x9358('0x6d')][_0x9358('0x2a')]({'where':{'ListId':_0x2a1529[_0x9358('0x3f')][_0x9358('0x95')],'VoiceQueueId':_0x2a1529['params']['id']}})[_0x9358('0x2b')](function(){return _0x6fad10;});}})['then'](respondWithStatusCode(_0x46a645,null))[_0x9358('0x54')](handleError(_0x46a645,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 718852e..9a2724c 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 _0xb7ef=['hook','exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2803dc,_0x1cdaf1){var _0x552ae4=function(_0x15f1ef){while(--_0x15f1ef){_0x2803dc['push'](_0x2803dc['shift']());}};_0x552ae4(++_0x1cdaf1);}(_0xb7ef,0x6e));var _0xfb7e=function(_0x525ca5,_0xf43527){_0x525ca5=_0x525ca5-0x0;var _0x4c17c7=_0xb7ef[_0x525ca5];return _0x4c17c7;};'use strict';var EventEmitter=require(_0xfb7e('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xfb7e('0x1')](0x0);var events={'afterCreate':_0xfb7e('0x2'),'afterUpdate':_0xfb7e('0x3'),'afterDestroy':_0xfb7e('0x4')};function emitEvent(_0x2f8963){return function(_0x2037e2,_0x36f2fd,_0x573cb5){VoiceQueueEvents[_0xfb7e('0x5')](_0x2f8963+':'+_0x2037e2['id'],_0x2037e2);VoiceQueueEvents['emit'](_0x2f8963,_0x2037e2);_0x573cb5(null);};}for(var e in events){if(events[_0xfb7e('0x6')](e)){var event=events[e];VoiceQueue[_0xfb7e('0x7')](e,emitEvent(event));}}module[_0xfb7e('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xbf10=['exports','events','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x385c42,_0x52afb3){var _0x1584aa=function(_0x4074a0){while(--_0x4074a0){_0x385c42['push'](_0x385c42['shift']());}};_0x1584aa(++_0x52afb3);}(_0xbf10,0x1a5));var _0x0bf1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xbf10[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require(_0x0bf1('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0bf1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bf1('0x2'),'afterDestroy':_0x0bf1('0x3')};function emitEvent(_0x408207){return function(_0x548ca6,_0x29fe98,_0x1e57e1){VoiceQueueEvents['emit'](_0x408207+':'+_0x548ca6['id'],_0x548ca6);VoiceQueueEvents['emit'](_0x408207,_0x548ca6);_0x1e57e1(null);};}for(var e in events){if(events[_0x0bf1('0x4')](e)){var event=events[e];VoiceQueue[_0x0bf1('0x5')](e,emitEvent(event));}}module[_0x0bf1('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 446d01d..572ec2e 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x5b758d,_0x5443a8){var _0x5db2fb=function(_0x3acf58){while(--_0x3acf58){_0x5b758d['push'](_0x5b758d['shift']());}};_0x5db2fb(++_0x5443a8);}(_0x70e0,0x17b));var _0x070e=function(_0x272939,_0x902028){_0x272939=_0x272939-0x0;var _0x26d894=_0x70e0[_0x272939];return _0x26d894;};'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']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3806e6,_0x2f55d1){var _0x43aea8=function(_0x3c9928){while(--_0x3c9928){_0x3806e6['push'](_0x3806e6['shift']());}};_0x43aea8(++_0x2f55d1);}(_0x008c,0x188));var _0xc008=function(_0x236654,_0x16e44f){_0x236654=_0x236654-0x0;var _0x27653b=_0x008c[_0x236654];return _0x27653b;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 6fd4e66..fbe2c26 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 _0x3984=['http','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xd6b1af,_0xe08a3d){var _0x11432c=function(_0x4dbd09){while(--_0x4dbd09){_0xd6b1af['push'](_0xd6b1af['shift']());}};_0x11432c(++_0xe08a3d);}(_0x3984,0x1a3));var _0x4398=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x3984[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0x4398('0x0'));var util=require(_0x4398('0x1'));var moment=require(_0x4398('0x2'));var BPromise=require(_0x4398('0x3'));var rs=require(_0x4398('0x4'));var fs=require('fs');var Redis=require(_0x4398('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4398('0x6'));var logger=require(_0x4398('0x7'))('rpc');var config=require(_0x4398('0x8'));var jayson=require(_0x4398('0x9'));var client=jayson[_0x4398('0xa')][_0x4398('0xb')]({'port':0x232a});config['redis']=_[_0x4398('0xc')](config['redis'],{'host':_0x4398('0xd'),'port':0x18eb});var socket=require(_0x4398('0xe'))(new Redis(config[_0x4398('0xf')]));require(_0x4398('0x10'))[_0x4398('0x11')](socket);function respondWithRpcPromise(_0x294b8a,_0x5c7607,_0x3b5c12){return new BPromise(function(_0x439a88,_0x5e826c){return client[_0x4398('0x12')](_0x294b8a,_0x3b5c12)[_0x4398('0x13')](function(_0x15bb66){logger['info'](_0x4398('0x14'),_0x5c7607,_0x4398('0x15'));logger[_0x4398('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5c7607,_0x4398('0x15'),JSON[_0x4398('0x17')](_0x15bb66));if(_0x15bb66['error']){if(_0x15bb66[_0x4398('0x18')][_0x4398('0x19')]===0x1f4){logger[_0x4398('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x5c7607,_0x15bb66[_0x4398('0x18')]['message']);return _0x5e826c(_0x15bb66[_0x4398('0x18')][_0x4398('0x1a')]);}logger[_0x4398('0x18')](_0x4398('0x14'),_0x5c7607,_0x15bb66[_0x4398('0x18')][_0x4398('0x1a')]);return _0x439a88(_0x15bb66[_0x4398('0x18')][_0x4398('0x1a')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x5c7607,_0x4398('0x15'));_0x439a88(_0x15bb66[_0x4398('0x1b')][_0x4398('0x1a')]);}})[_0x4398('0x1c')](function(_0xb0d84c){logger[_0x4398('0x18')](_0x4398('0x14'),_0x5c7607,_0xb0d84c);_0x5e826c(_0xb0d84c);});});}exports[_0x4398('0x1d')]=function(_0x3e127a){var _0x459ef7=this;return new Promise(function(_0x38beac,_0x38502a){return db[_0x4398('0x1e')][_0x4398('0x1f')]({'raw':_0x3e127a[_0x4398('0x20')]?_0x3e127a[_0x4398('0x20')][_0x4398('0x21')]===undefined?!![]:![]:!![],'where':_0x3e127a[_0x4398('0x20')]?_0x3e127a[_0x4398('0x20')][_0x4398('0x22')]||null:null,'attributes':_0x3e127a[_0x4398('0x20')]?_0x3e127a['options'][_0x4398('0x23')]||null:null,'limit':_0x3e127a[_0x4398('0x20')]?_0x3e127a[_0x4398('0x20')][_0x4398('0x24')]||null:null,'include':_0x3e127a[_0x4398('0x20')]?_0x3e127a[_0x4398('0x20')][_0x4398('0x25')]?_[_0x4398('0x26')](_0x3e127a[_0x4398('0x20')][_0x4398('0x25')],function(_0x29c3fb){return{'model':db[_0x29c3fb[_0x4398('0x27')]],'as':_0x29c3fb['as'],'attributes':_0x29c3fb[_0x4398('0x23')],'include':_0x29c3fb[_0x4398('0x25')]?_[_0x4398('0x26')](_0x29c3fb[_0x4398('0x25')],function(_0x1c2a7a){return{'model':db[_0x1c2a7a[_0x4398('0x27')]],'as':_0x1c2a7a['as'],'attributes':_0x1c2a7a[_0x4398('0x23')],'include':_0x1c2a7a['include']?_[_0x4398('0x26')](_0x1c2a7a[_0x4398('0x25')],function(_0x55fa17){return{'model':db[_0x55fa17['model']],'as':_0x55fa17['as'],'attributes':_0x55fa17['attributes']};}):[]};}):[]};}):[]:[]})[_0x4398('0x13')](function(_0xb03039){logger[_0x4398('0x28')](_0x4398('0x1d'),_0x3e127a);logger[_0x4398('0x16')](_0x4398('0x1d'),_0x3e127a,JSON['stringify'](_0xb03039));_0x38beac(_0xb03039);})['catch'](function(_0x497ade){logger[_0x4398('0x18')](_0x4398('0x1d'),_0x497ade[_0x4398('0x1a')],_0x3e127a);_0x38502a(_0x459ef7[_0x4398('0x18')](0x1f4,_0x497ade[_0x4398('0x1a')]));});});};exports[_0x4398('0x29')]=function(_0x54a934){var _0x406da2=this;return new Promise(function(_0x49d0cb,_0x3e73de){return db[_0x4398('0x1e')][_0x4398('0x2a')]({'raw':_0x54a934[_0x4398('0x20')]?_0x54a934['options'][_0x4398('0x21')]===undefined?!![]:![]:!![],'where':_0x54a934['options']?_0x54a934[_0x4398('0x20')]['where']||null:null,'attributes':_0x54a934['options']?_0x54a934[_0x4398('0x20')]['attributes']||null:null,'include':_0x54a934['options']?_0x54a934[_0x4398('0x20')][_0x4398('0x25')]?_['map'](_0x54a934[_0x4398('0x20')][_0x4398('0x25')],function(_0x69b8c8){return{'model':db[_0x69b8c8[_0x4398('0x27')]],'as':_0x69b8c8['as'],'attributes':_0x69b8c8[_0x4398('0x23')],'include':_0x69b8c8[_0x4398('0x25')]?_[_0x4398('0x26')](_0x69b8c8['include'],function(_0x3a5d65){return{'model':db[_0x3a5d65['model']],'as':_0x3a5d65['as'],'attributes':_0x3a5d65[_0x4398('0x23')],'include':_0x3a5d65[_0x4398('0x25')]?_[_0x4398('0x26')](_0x3a5d65['include'],function(_0x4ef6b5){return{'model':db[_0x4ef6b5[_0x4398('0x27')]],'as':_0x4ef6b5['as'],'attributes':_0x4ef6b5[_0x4398('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550067){logger[_0x4398('0x28')](_0x4398('0x29'),_0x54a934);logger[_0x4398('0x16')]('ShowVoiceQueue',_0x54a934,JSON['stringify'](_0x550067));_0x49d0cb(_0x550067);})[_0x4398('0x1c')](function(_0x28cabe){logger[_0x4398('0x18')](_0x4398('0x29'),_0x28cabe['message'],_0x54a934);_0x3e73de(_0x406da2[_0x4398('0x18')](0x1f4,_0x28cabe['message']));});});}; \ No newline at end of file +var _0x4559=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','lodash','util','moment'];(function(_0x5c443d,_0x5d43b5){var _0x14b7cf=function(_0x3771a){while(--_0x3771a){_0x5c443d['push'](_0x5c443d['shift']());}};_0x14b7cf(++_0x5d43b5);}(_0x4559,0x197));var _0x9455=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x4559[_0x58eec7];return _0x25c5d3;};'use strict';var _=require(_0x9455('0x0'));var util=require(_0x9455('0x1'));var moment=require(_0x9455('0x2'));var BPromise=require('bluebird');var rs=require(_0x9455('0x3'));var fs=require('fs');var Redis=require(_0x9455('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9455('0x5'));var logger=require('../../config/logger')(_0x9455('0x6'));var config=require('../../config/environment');var jayson=require(_0x9455('0x7'));var client=jayson[_0x9455('0x8')]['http']({'port':0x232a});config[_0x9455('0x9')]=_[_0x9455('0xa')](config[_0x9455('0x9')],{'host':_0x9455('0xb'),'port':0x18eb});var socket=require(_0x9455('0xc'))(new Redis(config[_0x9455('0x9')]));require(_0x9455('0xd'))[_0x9455('0xe')](socket);function respondWithRpcPromise(_0xbc2b7e,_0x54bd3a,_0x26c931){return new BPromise(function(_0x1e8ca3,_0x14c61e){return client[_0x9455('0xf')](_0xbc2b7e,_0x26c931)[_0x9455('0x10')](function(_0x122550){logger['info'](_0x9455('0x11'),_0x54bd3a,'request\x20sent');logger[_0x9455('0x12')](_0x9455('0x13'),_0x54bd3a,_0x9455('0x14'),JSON[_0x9455('0x15')](_0x122550));if(_0x122550['error']){if(_0x122550[_0x9455('0x16')][_0x9455('0x17')]===0x1f4){logger['error'](_0x9455('0x11'),_0x54bd3a,_0x122550['error'][_0x9455('0x18')]);return _0x14c61e(_0x122550[_0x9455('0x16')][_0x9455('0x18')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x54bd3a,_0x122550['error'][_0x9455('0x18')]);return _0x1e8ca3(_0x122550[_0x9455('0x16')]['message']);}else{logger[_0x9455('0x19')](_0x9455('0x11'),_0x54bd3a,_0x9455('0x14'));_0x1e8ca3(_0x122550[_0x9455('0x1a')][_0x9455('0x18')]);}})[_0x9455('0x1b')](function(_0xe1f599){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x54bd3a,_0xe1f599);_0x14c61e(_0xe1f599);});});}exports[_0x9455('0x1c')]=function(_0x6af1a3){var _0x41d245=this;return new Promise(function(_0x1ec93d,_0x1ef7ed){return db[_0x9455('0x1d')][_0x9455('0x1e')]({'raw':_0x6af1a3[_0x9455('0x1f')]?_0x6af1a3[_0x9455('0x1f')][_0x9455('0x20')]===undefined?!![]:![]:!![],'where':_0x6af1a3[_0x9455('0x1f')]?_0x6af1a3['options'][_0x9455('0x21')]||null:null,'attributes':_0x6af1a3['options']?_0x6af1a3[_0x9455('0x1f')][_0x9455('0x22')]||null:null,'limit':_0x6af1a3[_0x9455('0x1f')]?_0x6af1a3[_0x9455('0x1f')][_0x9455('0x23')]||null:null,'include':_0x6af1a3[_0x9455('0x1f')]?_0x6af1a3[_0x9455('0x1f')][_0x9455('0x24')]?_[_0x9455('0x25')](_0x6af1a3['options'][_0x9455('0x24')],function(_0x5979ad){return{'model':db[_0x5979ad[_0x9455('0x26')]],'as':_0x5979ad['as'],'attributes':_0x5979ad['attributes'],'include':_0x5979ad[_0x9455('0x24')]?_[_0x9455('0x25')](_0x5979ad[_0x9455('0x24')],function(_0x5af0a1){return{'model':db[_0x5af0a1['model']],'as':_0x5af0a1['as'],'attributes':_0x5af0a1[_0x9455('0x22')],'include':_0x5af0a1['include']?_[_0x9455('0x25')](_0x5af0a1[_0x9455('0x24')],function(_0x184dca){return{'model':db[_0x184dca[_0x9455('0x26')]],'as':_0x184dca['as'],'attributes':_0x184dca[_0x9455('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9455('0x10')](function(_0x57ec6b){logger[_0x9455('0x19')]('GetVoiceQueue',_0x6af1a3);logger[_0x9455('0x12')](_0x9455('0x1c'),_0x6af1a3,JSON[_0x9455('0x15')](_0x57ec6b));_0x1ec93d(_0x57ec6b);})[_0x9455('0x1b')](function(_0x2463f6){logger[_0x9455('0x16')](_0x9455('0x1c'),_0x2463f6[_0x9455('0x18')],_0x6af1a3);_0x1ef7ed(_0x41d245['error'](0x1f4,_0x2463f6['message']));});});};exports[_0x9455('0x27')]=function(_0x2223ee){var _0x58edb0=this;return new Promise(function(_0x4b7e7b,_0x263724){return db['VoiceQueue'][_0x9455('0x28')]({'raw':_0x2223ee[_0x9455('0x1f')]?_0x2223ee[_0x9455('0x1f')][_0x9455('0x20')]===undefined?!![]:![]:!![],'where':_0x2223ee[_0x9455('0x1f')]?_0x2223ee[_0x9455('0x1f')][_0x9455('0x21')]||null:null,'attributes':_0x2223ee['options']?_0x2223ee['options'][_0x9455('0x22')]||null:null,'include':_0x2223ee[_0x9455('0x1f')]?_0x2223ee[_0x9455('0x1f')][_0x9455('0x24')]?_['map'](_0x2223ee[_0x9455('0x1f')][_0x9455('0x24')],function(_0x5dd767){return{'model':db[_0x5dd767[_0x9455('0x26')]],'as':_0x5dd767['as'],'attributes':_0x5dd767[_0x9455('0x22')],'include':_0x5dd767[_0x9455('0x24')]?_[_0x9455('0x25')](_0x5dd767[_0x9455('0x24')],function(_0x3149ed){return{'model':db[_0x3149ed[_0x9455('0x26')]],'as':_0x3149ed['as'],'attributes':_0x3149ed[_0x9455('0x22')],'include':_0x3149ed[_0x9455('0x24')]?_[_0x9455('0x25')](_0x3149ed[_0x9455('0x24')],function(_0x52e6ac){return{'model':db[_0x52e6ac[_0x9455('0x26')]],'as':_0x52e6ac['as'],'attributes':_0x52e6ac[_0x9455('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9455('0x10')](function(_0x1c222c){logger['info'](_0x9455('0x27'),_0x2223ee);logger[_0x9455('0x12')]('ShowVoiceQueue',_0x2223ee,JSON['stringify'](_0x1c222c));_0x4b7e7b(_0x1c222c);})[_0x9455('0x1b')](function(_0x4cddf7){logger[_0x9455('0x16')](_0x9455('0x27'),_0x4cddf7[_0x9455('0x18')],_0x2223ee);_0x263724(_0x58edb0[_0x9455('0x16')](0x1f4,_0x4cddf7[_0x9455('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d0a7efa..4faff7a 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 _0xffe1=['removeListener','register','length','voiceQueue:','save','update'];(function(_0x364efa,_0x200d4f){var _0x2440fc=function(_0x50a844){while(--_0x50a844){_0x364efa['push'](_0x364efa['shift']());}};_0x2440fc(++_0x200d4f);}(_0xffe1,0x154));var _0x1ffe=function(_0x3f1ef1,_0xf536f5){_0x3f1ef1=_0x3f1ef1-0x0;var _0x1b112e=_0xffe1[_0x3f1ef1];return _0x1b112e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x1ffe('0x0'),'remove',_0x1ffe('0x1')];function createListener(_0x38e5d1,_0x28438c){return function(_0x508dae){_0x28438c['emit'](_0x38e5d1,_0x508dae);};}function removeListener(_0x138fb2,_0x53fc64){return function(){VoiceQueueEvents[_0x1ffe('0x2')](_0x138fb2,_0x53fc64);};}exports[_0x1ffe('0x3')]=function(_0x604341){for(var _0x181e83=0x0,_0x5a9c6e=events[_0x1ffe('0x4')];_0x181e83<_0x5a9c6e;_0x181e83++){var _0x3d0b3e=events[_0x181e83];var _0x385450=createListener(_0x1ffe('0x5')+_0x3d0b3e,_0x604341);VoiceQueueEvents['on'](_0x3d0b3e,_0x385450);}}; \ No newline at end of file +var _0xb3a0=['remove','update','emit','removeListener','register','length','./voiceQueue.events','save'];(function(_0x76391e,_0x2115a7){var _0x431040=function(_0x2bdbc4){while(--_0x2bdbc4){_0x76391e['push'](_0x76391e['shift']());}};_0x431040(++_0x2115a7);}(_0xb3a0,0xae));var _0x0b3a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb3a0[_0x501510];return _0x1e6ee5;};'use strict';var VoiceQueueEvents=require(_0x0b3a('0x0'));var events=[_0x0b3a('0x1'),_0x0b3a('0x2'),_0x0b3a('0x3')];function createListener(_0x41efea,_0x287429){return function(_0x113898){_0x287429[_0x0b3a('0x4')](_0x41efea,_0x113898);};}function removeListener(_0x3e21c0,_0x201b3a){return function(){VoiceQueueEvents[_0x0b3a('0x5')](_0x3e21c0,_0x201b3a);};}exports[_0x0b3a('0x6')]=function(_0x2b339e){for(var _0x3a6e83=0x0,_0x5e0a7b=events[_0x0b3a('0x7')];_0x3a6e83<_0x5e0a7b;_0x3a6e83++){var _0x459a9a=events[_0x3a6e83];var _0x609110=createListener('voiceQueue:'+_0x459a9a,_0x2b339e);VoiceQueueEvents['on'](_0x459a9a,_0x609110);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 79a3171..502ea8c 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 _0xcc2f=['getVoiceQueuesReport','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index'];(function(_0x3eba1e,_0x3607c2){var _0x176112=function(_0xc025dc){while(--_0xc025dc){_0x3eba1e['push'](_0x3eba1e['shift']());}};_0x176112(++_0x3607c2);}(_0xcc2f,0x1ec));var _0xfcc2=function(_0x5b1d4c,_0x14e503){_0x5b1d4c=_0x5b1d4c-0x0;var _0x19c3b4=_0xcc2f[_0x5b1d4c];return _0x19c3b4;};'use strict';var multer=require(_0xfcc2('0x0'));var util=require('util');var path=require(_0xfcc2('0x1'));var timeout=require(_0xfcc2('0x2'));var express=require(_0xfcc2('0x3'));var router=express[_0xfcc2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfcc2('0x5'));var interaction=require(_0xfcc2('0x6'));var config=require(_0xfcc2('0x7'));var controller=require(_0xfcc2('0x8'));router[_0xfcc2('0x9')]('/',auth[_0xfcc2('0xa')](),controller[_0xfcc2('0xb')]);router[_0xfcc2('0x9')]('/describe',auth[_0xfcc2('0xa')](),controller[_0xfcc2('0xc')]);router[_0xfcc2('0x9')](_0xfcc2('0xd'),auth[_0xfcc2('0xa')](),controller[_0xfcc2('0xe')]);router[_0xfcc2('0x9')](_0xfcc2('0xf'),auth[_0xfcc2('0xa')](),controller[_0xfcc2('0x10')]);router['post']('/',auth[_0xfcc2('0xa')](),controller[_0xfcc2('0x11')]);router[_0xfcc2('0x12')]('/:id',auth[_0xfcc2('0xa')](),controller[_0xfcc2('0x13')]);router[_0xfcc2('0x14')](_0xfcc2('0xf'),auth[_0xfcc2('0xa')](),controller[_0xfcc2('0x15')]);module[_0xfcc2('0x16')]=router; \ No newline at end of file +var _0x60fa=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/index','/:id','show','post','put','update','destroy','exports','multer','util','path','express'];(function(_0x9b82b8,_0x1d3d63){var _0x353562=function(_0x42a8a6){while(--_0x42a8a6){_0x9b82b8['push'](_0x9b82b8['shift']());}};_0x353562(++_0x1d3d63);}(_0x60fa,0x100));var _0xa60f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x60fa[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa60f('0x0'));var util=require(_0xa60f('0x1'));var path=require(_0xa60f('0x2'));var timeout=require('connect-timeout');var express=require(_0xa60f('0x3'));var router=express[_0xa60f('0x4')]();var fs_extra=require(_0xa60f('0x5'));var auth=require(_0xa60f('0x6'));var interaction=require(_0xa60f('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xa60f('0x8')]('/',auth[_0xa60f('0x9')](),controller[_0xa60f('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa60f('0xb')]);router[_0xa60f('0x8')](_0xa60f('0xc'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xa60f('0x8')](_0xa60f('0xd'),auth[_0xa60f('0x9')](),controller[_0xa60f('0xe')]);router[_0xa60f('0xf')]('/',auth[_0xa60f('0x9')](),controller['create']);router[_0xa60f('0x10')](_0xa60f('0xd'),auth[_0xa60f('0x9')](),controller[_0xa60f('0x11')]);router['delete'](_0xa60f('0xd'),auth[_0xa60f('0x9')](),controller[_0xa60f('0x12')]);module[_0xa60f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index cce75b8..b61f082 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 _0xb8f2=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb8f2,0x18b));var _0x2b8f=function(_0xbbd04,_0x4e535f){_0xbbd04=_0xbbd04-0x0;var _0x4ef8b6=_0xb8f2[_0xbbd04];return _0x4ef8b6;};'use strict';var Sequelize=require(_0x2b8f('0x0'));var moment=require(_0x2b8f('0x1'));module[_0x2b8f('0x2')]={'type':{'type':Sequelize[_0x2b8f('0x3')]},'uniqueid':{'type':Sequelize[_0x2b8f('0x3')]},'calleridnum':{'type':Sequelize[_0x2b8f('0x3')]},'calleridname':{'type':Sequelize[_0x2b8f('0x3')]},'queue':{'type':Sequelize[_0x2b8f('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x2b8f('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x2b8f('0x4')],'set':function(_0x9d76a){var _0x2bea5a=moment(_0x9d76a);var _0x5081f9=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x2b8f('0x5'));var _0x416875=_0x2bea5a[_0x2b8f('0x6')](_0x5081f9,'seconds');this[_0x2b8f('0x7')](_0x2b8f('0x8'),_0x9d76a);this['setDataValue'](_0x2b8f('0x9'),_0x416875||null);}},'position':{'type':Sequelize[_0x2b8f('0xa')]},'count':{'type':Sequelize[_0x2b8f('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2b8f('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x2b8f('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2b8f('0x4')]},'queuecallerexit':{'type':Sequelize[_0x2b8f('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2b8f('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x2b8f('0x3')],'comment':_0x2b8f('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x2b8f('0x3')]},'connectedlinenum':{'type':Sequelize[_0x2b8f('0x3')]},'connectedlinename':{'type':Sequelize[_0x2b8f('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2b8f('0x3')]},'exten':{'type':Sequelize[_0x2b8f('0x3')]},'priority':{'type':Sequelize[_0x2b8f('0x3')]},'holdtime':{'type':Sequelize[_0x2b8f('0xa')]},'mohtime':{'type':Sequelize[_0x2b8f('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2b8f('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2b8f('0x3')]},'transfer':{'type':Sequelize[_0x2b8f('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2b8f('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2b8f('0x3')]},'disposition':{'type':Sequelize[_0x2b8f('0x3')]},'secondDisposition':{'type':Sequelize[_0x2b8f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x2b8f('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x38f3=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x2b441f,_0x249bac){var _0x1cc771=function(_0x33b705){while(--_0x33b705){_0x2b441f['push'](_0x2b441f['shift']());}};_0x1cc771(++_0x249bac);}(_0x38f3,0x71));var _0x338f=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x38f3[_0xef4ef0];return _0x39b60b;};'use strict';var Sequelize=require(_0x338f('0x0'));var moment=require(_0x338f('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x338f('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x338f('0x3')],'set':function(_0x139adc){var _0x474ca5=moment(_0x139adc);var _0xc3ffda=moment(this['getDataValue'](_0x338f('0x4')))[_0x338f('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e76f8=_0x474ca5[_0x338f('0x6')](_0xc3ffda,_0x338f('0x7'));this[_0x338f('0x8')](_0x338f('0x9'),_0x139adc);this['setDataValue']('holdtime',_0x1e76f8||null);}},'position':{'type':Sequelize[_0x338f('0xa')]},'count':{'type':Sequelize[_0x338f('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x338f('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x338f('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x338f('0x3')]},'queuecallerexit':{'type':Sequelize[_0x338f('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x338f('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x338f('0x2')],'comment':_0x338f('0xc')},'originalposition':{'type':Sequelize[_0x338f('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x338f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x338f('0xa')]},'mohtime':{'type':Sequelize[_0x338f('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x338f('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x338f('0x2')],'comment':_0x338f('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x338f('0x2')]},'disposition':{'type':Sequelize[_0x338f('0x2')]},'secondDisposition':{'type':Sequelize[_0x338f('0x2')]},'thirdDisposition':{'type':Sequelize[_0x338f('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x338f('0xa')],'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 89e96fd..38c17b6 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 _0x5495=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','describe','getVoiceQueuesReport','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x2f974c,_0x2a9938){var _0xd74bc6=function(_0x426652){while(--_0x426652){_0x2f974c['push'](_0x2f974c['shift']());}};_0xd74bc6(++_0x2a9938);}(_0x5495,0x196));var _0x5549=function(_0x37dc48,_0x416727){_0x37dc48=_0x37dc48-0x0;var _0xa63a52=_0x5495[_0x37dc48];return _0xa63a52;};'use strict';var emlformat=require(_0x5549('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5549('0x1'));var rp=require(_0x5549('0x2'));var moment=require(_0x5549('0x3'));var BPromise=require(_0x5549('0x4'));var Mustache=require(_0x5549('0x5'));var util=require(_0x5549('0x6'));var path=require(_0x5549('0x7'));var sox=require(_0x5549('0x8'));var csv=require(_0x5549('0x9'));var ejs=require(_0x5549('0xa'));var fs=require('fs');var fs_extra=require(_0x5549('0xb'));var _=require(_0x5549('0xc'));var squel=require('squel');var crypto=require(_0x5549('0xd'));var jsforce=require(_0x5549('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5549('0xf'));var Papa=require(_0x5549('0x10'));var Redis=require(_0x5549('0x11'));var authService=require(_0x5549('0x12'));var qs=require(_0x5549('0x13'));var as=require(_0x5549('0x14'));var hardwareService=require(_0x5549('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5549('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5549('0x17'));var db=require(_0x5549('0x18'))['db'];config[_0x5549('0x19')]=_[_0x5549('0x1a')](config[_0x5549('0x19')],{'host':_0x5549('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5549('0x19')]));require(_0x5549('0x1c'))[_0x5549('0x1d')](socket);function respondWithStatusCode(_0x3fcb1d,_0xf92a90){_0xf92a90=_0xf92a90||0xcc;return function(_0x17535e){if(_0x17535e){return _0x3fcb1d[_0x5549('0x1e')](_0xf92a90);}return _0x3fcb1d['status'](_0xf92a90)['end']();};}function respondWithResult(_0x4e5903,_0x464199){_0x464199=_0x464199||0xc8;return function(_0x522f23){if(_0x522f23){return _0x4e5903[_0x5549('0x1f')](_0x464199)[_0x5549('0x20')](_0x522f23);}};}function respondWithFilteredResult(_0x2b45c1,_0x220f8d){return function(_0x23742a){if(_0x23742a){var _0x1e783a=typeof _0x220f8d[_0x5549('0x21')]===_0x5549('0x22')&&typeof _0x220f8d['limit']===_0x5549('0x22');var _0x501ef3=_0x23742a['count'];var _0x1a9720=_0x1e783a?0x0:_0x220f8d[_0x5549('0x21')];var _0x3d161c=_0x1e783a?_0x23742a[_0x5549('0x23')]:_0x220f8d[_0x5549('0x21')]+_0x220f8d[_0x5549('0x24')];var _0x59a2ea;if(_0x3d161c>=_0x501ef3){_0x3d161c=_0x501ef3;_0x59a2ea=0xc8;}else{_0x59a2ea=0xce;}_0x2b45c1[_0x5549('0x1f')](_0x59a2ea);return _0x2b45c1[_0x5549('0x25')](_0x5549('0x26'),_0x1a9720+'-'+_0x3d161c+'/'+_0x501ef3)['json'](_0x23742a);}return null;};}function patchUpdates(_0x5a4a25){return function(_0x294498){try{jsonpatch['apply'](_0x294498,_0x5a4a25,!![]);}catch(_0x5667ab){return BPromise[_0x5549('0x27')](_0x5667ab);}return _0x294498['save']();};}function saveUpdates(_0x595b84,_0x5129fc){return function(_0x349aa6){if(_0x349aa6){return _0x349aa6[_0x5549('0x28')](_0x595b84)[_0x5549('0x29')](function(_0x5a4351){return _0x5a4351;});}return null;};}function removeEntity(_0x1357a5,_0x1530b3){return function(_0x2eaba6){if(_0x2eaba6){return _0x2eaba6[_0x5549('0x2a')]()[_0x5549('0x29')](function(){_0x1357a5[_0x5549('0x1f')](0xcc)[_0x5549('0x2b')]();});}};}function handleEntityNotFound(_0x62bb24,_0x213483){return function(_0x20e7e7){if(!_0x20e7e7){_0x62bb24[_0x5549('0x1e')](0x194);}return _0x20e7e7;};}function handleError(_0xbf53ff,_0x2ea0c8){_0x2ea0c8=_0x2ea0c8||0x1f4;return function(_0x21a5c6){logger[_0x5549('0x2c')](_0x21a5c6[_0x5549('0x2d')]);if(_0x21a5c6[_0x5549('0x2e')]){delete _0x21a5c6['name'];}_0xbf53ff[_0x5549('0x1f')](_0x2ea0c8)[_0x5549('0x2f')](_0x21a5c6);};}exports[_0x5549('0x30')]=function(_0x1fa188,_0x54f801){var _0x205c1b={},_0x14144b={},_0x31d09e={'count':0x0,'rows':[]};var _0x64dc6c=_[_0x5549('0x31')](db[_0x5549('0x32')][_0x5549('0x33')],function(_0x40f06b){return{'name':_0x40f06b['fieldName'],'type':_0x40f06b['type'][_0x5549('0x34')]};});_0x14144b['model']=_[_0x5549('0x31')](_0x64dc6c,_0x5549('0x2e'));_0x14144b[_0x5549('0x35')]=_[_0x5549('0x36')](_0x1fa188[_0x5549('0x35')]);_0x14144b[_0x5549('0x37')]=_[_0x5549('0x38')](_0x14144b[_0x5549('0x39')],_0x14144b[_0x5549('0x35')]);_0x205c1b['attributes']=_['intersection'](_0x14144b[_0x5549('0x39')],qs[_0x5549('0x3a')](_0x1fa188[_0x5549('0x35')][_0x5549('0x3a')]));_0x205c1b['attributes']=_0x205c1b[_0x5549('0x3b')][_0x5549('0x3c')]?_0x205c1b[_0x5549('0x3b')]:_0x14144b[_0x5549('0x39')];if(!_0x1fa188[_0x5549('0x35')][_0x5549('0x3d')](_0x5549('0x3e'))){_0x205c1b[_0x5549('0x24')]=qs[_0x5549('0x24')](_0x1fa188[_0x5549('0x35')]['limit']);_0x205c1b[_0x5549('0x21')]=qs['offset'](_0x1fa188[_0x5549('0x35')][_0x5549('0x21')]);}_0x205c1b[_0x5549('0x3f')]=qs[_0x5549('0x40')](_0x1fa188['query'][_0x5549('0x40')]);_0x205c1b[_0x5549('0x41')]=qs['filters'](_[_0x5549('0x42')](_0x1fa188[_0x5549('0x35')],_0x14144b['filters']),_0x64dc6c);if(_0x1fa188['query'][_0x5549('0x43')]){_0x205c1b['where']=_[_0x5549('0x44')](_0x205c1b['where'],{'$or':_[_0x5549('0x31')](_0x64dc6c,function(_0x190723){if(_0x190723[_0x5549('0x45')]!==_0x5549('0x46')){var _0x2ffd11={};_0x2ffd11[_0x190723[_0x5549('0x2e')]]={'$like':'%'+_0x1fa188[_0x5549('0x35')][_0x5549('0x43')]+'%'};return _0x2ffd11;}})});}_0x205c1b=_['merge']({},_0x205c1b,_0x1fa188[_0x5549('0x47')]);var _0x370e3f={'where':_0x205c1b[_0x5549('0x41')]};return db[_0x5549('0x32')][_0x5549('0x23')](_0x370e3f)[_0x5549('0x29')](function(_0x21ee4e){_0x31d09e[_0x5549('0x23')]=_0x21ee4e;if(_0x1fa188[_0x5549('0x35')][_0x5549('0x48')]){_0x205c1b['include']=[{'all':!![]}];}return db[_0x5549('0x32')]['findAll'](_0x205c1b);})[_0x5549('0x29')](function(_0x18d46e){_0x31d09e[_0x5549('0x49')]=_0x18d46e;return _0x31d09e;})[_0x5549('0x29')](respondWithFilteredResult(_0x54f801,_0x205c1b))[_0x5549('0x4a')](handleError(_0x54f801,null));};exports[_0x5549('0x4b')]=function(_0x2b5c4c,_0x37b79c){var _0x12771a={'raw':![],'where':{'id':_0x2b5c4c[_0x5549('0x4c')]['id']}},_0x19ed38={};_0x19ed38[_0x5549('0x39')]=_[_0x5549('0x36')](db[_0x5549('0x32')][_0x5549('0x33')]);_0x19ed38[_0x5549('0x35')]=_['keys'](_0x2b5c4c[_0x5549('0x35')]);_0x19ed38[_0x5549('0x37')]=_['intersection'](_0x19ed38[_0x5549('0x39')],_0x19ed38[_0x5549('0x35')]);_0x12771a['attributes']=_[_0x5549('0x38')](_0x19ed38[_0x5549('0x39')],qs[_0x5549('0x3a')](_0x2b5c4c['query'][_0x5549('0x3a')]));_0x12771a['attributes']=_0x12771a[_0x5549('0x3b')][_0x5549('0x3c')]?_0x12771a[_0x5549('0x3b')]:_0x19ed38[_0x5549('0x39')];if(_0x2b5c4c['query'][_0x5549('0x48')]){_0x12771a[_0x5549('0x4d')]=[{'all':!![]}];}_0x12771a=_[_0x5549('0x44')]({},_0x12771a,_0x2b5c4c['options']);return db['VoiceQueueReport'][_0x5549('0x4e')](_0x12771a)[_0x5549('0x29')](handleEntityNotFound(_0x37b79c,null))['then'](respondWithResult(_0x37b79c,null))[_0x5549('0x4a')](handleError(_0x37b79c,null));};exports[_0x5549('0x4f')]=function(_0x33e81c,_0x58c6ef){return db[_0x5549('0x32')][_0x5549('0x4f')](_0x33e81c[_0x5549('0x50')],{})[_0x5549('0x29')](respondWithResult(_0x58c6ef,0xc9))[_0x5549('0x4a')](handleError(_0x58c6ef,null));};exports[_0x5549('0x28')]=function(_0x36d1f1,_0x4bdc78){if(_0x36d1f1[_0x5549('0x50')]['id']){delete _0x36d1f1[_0x5549('0x50')]['id'];}return db[_0x5549('0x32')][_0x5549('0x4e')]({'where':{'id':_0x36d1f1['params']['id']}})[_0x5549('0x29')](handleEntityNotFound(_0x4bdc78,null))['then'](saveUpdates(_0x36d1f1[_0x5549('0x50')],null))['then'](respondWithResult(_0x4bdc78,null))[_0x5549('0x4a')](handleError(_0x4bdc78,null));};exports[_0x5549('0x2a')]=function(_0x121a5a,_0x4d9601){return db[_0x5549('0x32')][_0x5549('0x4e')]({'where':{'id':_0x121a5a[_0x5549('0x4c')]['id']}})[_0x5549('0x29')](handleEntityNotFound(_0x4d9601,null))[_0x5549('0x29')](removeEntity(_0x4d9601,null))['catch'](handleError(_0x4d9601,null));};exports[_0x5549('0x51')]=function(_0xf67b30,_0x280b24){return db[_0x5549('0x32')][_0x5549('0x51')]()[_0x5549('0x29')](respondWithResult(_0x280b24,null))['catch'](handleError(_0x280b24,null));};exports[_0x5549('0x52')]=function(_0x1e26b6,_0x47f427){var _0x2f71f9={},_0x293443={},_0x248ed8={'count':0x0,'rows':[]};_0x293443[_0x5549('0x39')]=_[_0x5549('0x36')](db[_0x5549('0x32')][_0x5549('0x33')]);_0x293443[_0x5549('0x35')]=_['keys'](_0x1e26b6[_0x5549('0x35')]);_0x293443[_0x5549('0x37')]=_[_0x5549('0x38')](_0x293443[_0x5549('0x39')],_0x293443[_0x5549('0x35')]);_0x2f71f9[_0x5549('0x3b')]=_[_0x5549('0x38')](_0x293443[_0x5549('0x39')],qs['fields'](_0x1e26b6[_0x5549('0x35')][_0x5549('0x3a')]));_0x2f71f9[_0x5549('0x3b')]=_0x2f71f9['attributes'][_0x5549('0x3c')]?_0x2f71f9[_0x5549('0x3b')]:_0x293443['model'];if(!_0x1e26b6[_0x5549('0x35')][_0x5549('0x3d')](_0x5549('0x3e'))){_0x2f71f9[_0x5549('0x24')]=qs['limit'](_0x1e26b6[_0x5549('0x35')][_0x5549('0x24')]);_0x2f71f9['offset']=qs['offset'](_0x1e26b6[_0x5549('0x35')]['offset']);}_0x2f71f9[_0x5549('0x3f')]=qs[_0x5549('0x40')](_0x1e26b6[_0x5549('0x35')][_0x5549('0x40')]);_0x2f71f9[_0x5549('0x41')]=qs[_0x5549('0x37')](_['pick'](_0x1e26b6[_0x5549('0x35')],_0x293443['filters']));if(_0x1e26b6[_0x5549('0x35')][_0x5549('0x43')]){_0x2f71f9[_0x5549('0x41')]=_[_0x5549('0x44')](_0x2f71f9[_0x5549('0x41')],{'$or':_[_0x5549('0x31')](_0x2f71f9[_0x5549('0x3b')],function(_0x284606){var _0x5ef6d8={};_0x5ef6d8[_0x284606]={'$like':'%'+_0x1e26b6['query'][_0x5549('0x43')]+'%'};return _0x5ef6d8;})});}_0x2f71f9=_['merge']({},_0x2f71f9,_0x1e26b6[_0x5549('0x47')]);var _0x59d342={'where':_0x2f71f9[_0x5549('0x41')]};return db[_0x5549('0x32')][_0x5549('0x23')](_0x59d342)[_0x5549('0x29')](function(_0x11be02){_0x248ed8[_0x5549('0x23')]=_0x11be02;if(_0x1e26b6['query'][_0x5549('0x48')]){_0x2f71f9[_0x5549('0x4d')]=[{'all':!![]}];}return db[_0x5549('0x32')][_0x5549('0x53')](_0x2f71f9);})[_0x5549('0x29')](function(_0x296e21){_0x248ed8['rows']=_0x296e21;return _0x248ed8;})[_0x5549('0x29')](respondWithFilteredResult(_0x47f427,_0x2f71f9,_0x5549('0x52')))[_0x5549('0x4a')](handleError(_0x47f427,null,_0x5549('0x52')));}; \ No newline at end of file +var _0x77c4=['findAll','rows','params','intersection','length','includeAll','create','body','catch','update','find','destroy','describe','getVoiceQueuesReport','pick','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueueReport.socket','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','error','stack','name','send','index','VoiceQueueReport','rawAttributes','type','model','query','keys','attributes','fields','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','then','include'];(function(_0x219a1c,_0x248746){var _0x437925=function(_0x5e07bf){while(--_0x5e07bf){_0x219a1c['push'](_0x219a1c['shift']());}};_0x437925(++_0x248746);}(_0x77c4,0x150));var _0x477c=function(_0x5dcbc4,_0x1ce42a){_0x5dcbc4=_0x5dcbc4-0x0;var _0x350c8f=_0x77c4[_0x5dcbc4];return _0x350c8f;};'use strict';var emlformat=require(_0x477c('0x0'));var rimraf=require(_0x477c('0x1'));var zipdir=require(_0x477c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x477c('0x3'));var moment=require(_0x477c('0x4'));var BPromise=require(_0x477c('0x5'));var Mustache=require('mustache');var util=require(_0x477c('0x6'));var path=require(_0x477c('0x7'));var sox=require(_0x477c('0x8'));var csv=require(_0x477c('0x9'));var ejs=require(_0x477c('0xa'));var fs=require('fs');var fs_extra=require(_0x477c('0xb'));var _=require(_0x477c('0xc'));var squel=require(_0x477c('0xd'));var crypto=require(_0x477c('0xe'));var jsforce=require(_0x477c('0xf'));var deskjs=require(_0x477c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x477c('0x11'));var Redis=require('ioredis');var authService=require(_0x477c('0x12'));var qs=require(_0x477c('0x13'));var as=require(_0x477c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x477c('0x15'))(_0x477c('0x16'));var utils=require(_0x477c('0x17'));var config=require(_0x477c('0x18'));var licenseUtil=require(_0x477c('0x19'));var db=require(_0x477c('0x1a'))['db'];config[_0x477c('0x1b')]=_['defaults'](config['redis'],{'host':_0x477c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x477c('0x1b')]));require(_0x477c('0x1d'))['register'](socket);function respondWithStatusCode(_0x3c4c1a,_0x1efa70){_0x1efa70=_0x1efa70||0xcc;return function(_0x5d04cb){if(_0x5d04cb){return _0x3c4c1a[_0x477c('0x1e')](_0x1efa70);}return _0x3c4c1a[_0x477c('0x1f')](_0x1efa70)[_0x477c('0x20')]();};}function respondWithResult(_0x57aadf,_0x4729df){_0x4729df=_0x4729df||0xc8;return function(_0x4ed806){if(_0x4ed806){return _0x57aadf[_0x477c('0x1f')](_0x4729df)[_0x477c('0x21')](_0x4ed806);}};}function respondWithFilteredResult(_0x4d1600,_0xd5d370){return function(_0x94b334){if(_0x94b334){var _0xa28886=typeof _0xd5d370[_0x477c('0x22')]===_0x477c('0x23')&&typeof _0xd5d370[_0x477c('0x24')]==='undefined';var _0x26043c=_0x94b334[_0x477c('0x25')];var _0x1e1d0e=_0xa28886?0x0:_0xd5d370[_0x477c('0x22')];var _0x419dfc=_0xa28886?_0x94b334['count']:_0xd5d370[_0x477c('0x22')]+_0xd5d370[_0x477c('0x24')];var _0x1a7c59;if(_0x419dfc>=_0x26043c){_0x419dfc=_0x26043c;_0x1a7c59=0xc8;}else{_0x1a7c59=0xce;}_0x4d1600[_0x477c('0x1f')](_0x1a7c59);return _0x4d1600['set']('Content-Range',_0x1e1d0e+'-'+_0x419dfc+'/'+_0x26043c)[_0x477c('0x21')](_0x94b334);}return null;};}function patchUpdates(_0x455dee){return function(_0x4f1f4e){try{jsonpatch['apply'](_0x4f1f4e,_0x455dee,!![]);}catch(_0x3a2213){return BPromise[_0x477c('0x26')](_0x3a2213);}return _0x4f1f4e[_0x477c('0x27')]();};}function saveUpdates(_0x34765a,_0x3d0059){return function(_0x75f34d){if(_0x75f34d){return _0x75f34d['update'](_0x34765a)['then'](function(_0x36628a){return _0x36628a;});}return null;};}function removeEntity(_0x16287b,_0x5c4c37){return function(_0x508bac){if(_0x508bac){return _0x508bac['destroy']()['then'](function(){_0x16287b[_0x477c('0x1f')](0xcc)[_0x477c('0x20')]();});}};}function handleEntityNotFound(_0x3dd74f,_0x415550){return function(_0x3a4e51){if(!_0x3a4e51){_0x3dd74f[_0x477c('0x1e')](0x194);}return _0x3a4e51;};}function handleError(_0x4407ab,_0x4610b9){_0x4610b9=_0x4610b9||0x1f4;return function(_0x2a8d44){logger[_0x477c('0x28')](_0x2a8d44[_0x477c('0x29')]);if(_0x2a8d44['name']){delete _0x2a8d44[_0x477c('0x2a')];}_0x4407ab[_0x477c('0x1f')](_0x4610b9)[_0x477c('0x2b')](_0x2a8d44);};}exports[_0x477c('0x2c')]=function(_0x164bf7,_0x252f24){var _0x2a2ce0={},_0x2026e2={},_0x733463={'count':0x0,'rows':[]};var _0x383201=_['map'](db[_0x477c('0x2d')][_0x477c('0x2e')],function(_0x184457){return{'name':_0x184457['fieldName'],'type':_0x184457[_0x477c('0x2f')]['key']};});_0x2026e2[_0x477c('0x30')]=_['map'](_0x383201,_0x477c('0x2a'));_0x2026e2[_0x477c('0x31')]=_[_0x477c('0x32')](_0x164bf7[_0x477c('0x31')]);_0x2026e2['filters']=_['intersection'](_0x2026e2[_0x477c('0x30')],_0x2026e2[_0x477c('0x31')]);_0x2a2ce0[_0x477c('0x33')]=_['intersection'](_0x2026e2[_0x477c('0x30')],qs[_0x477c('0x34')](_0x164bf7[_0x477c('0x31')][_0x477c('0x34')]));_0x2a2ce0['attributes']=_0x2a2ce0[_0x477c('0x33')]['length']?_0x2a2ce0[_0x477c('0x33')]:_0x2026e2[_0x477c('0x30')];if(!_0x164bf7[_0x477c('0x31')]['hasOwnProperty'](_0x477c('0x35'))){_0x2a2ce0[_0x477c('0x24')]=qs['limit'](_0x164bf7[_0x477c('0x31')]['limit']);_0x2a2ce0['offset']=qs[_0x477c('0x22')](_0x164bf7[_0x477c('0x31')][_0x477c('0x22')]);}_0x2a2ce0[_0x477c('0x36')]=qs[_0x477c('0x37')](_0x164bf7[_0x477c('0x31')][_0x477c('0x37')]);_0x2a2ce0[_0x477c('0x38')]=qs[_0x477c('0x39')](_['pick'](_0x164bf7[_0x477c('0x31')],_0x2026e2[_0x477c('0x39')]),_0x383201);if(_0x164bf7[_0x477c('0x31')][_0x477c('0x3a')]){_0x2a2ce0[_0x477c('0x38')]=_['merge'](_0x2a2ce0[_0x477c('0x38')],{'$or':_['map'](_0x383201,function(_0x4a81ef){if(_0x4a81ef['type']!==_0x477c('0x3b')){var _0x298cfb={};_0x298cfb[_0x4a81ef[_0x477c('0x2a')]]={'$like':'%'+_0x164bf7[_0x477c('0x31')]['filter']+'%'};return _0x298cfb;}})});}_0x2a2ce0=_[_0x477c('0x3c')]({},_0x2a2ce0,_0x164bf7[_0x477c('0x3d')]);var _0x5aceda={'where':_0x2a2ce0[_0x477c('0x38')]};return db[_0x477c('0x2d')][_0x477c('0x25')](_0x5aceda)[_0x477c('0x3e')](function(_0x161397){_0x733463[_0x477c('0x25')]=_0x161397;if(_0x164bf7[_0x477c('0x31')]['includeAll']){_0x2a2ce0[_0x477c('0x3f')]=[{'all':!![]}];}return db[_0x477c('0x2d')][_0x477c('0x40')](_0x2a2ce0);})['then'](function(_0x2b4b11){_0x733463[_0x477c('0x41')]=_0x2b4b11;return _0x733463;})['then'](respondWithFilteredResult(_0x252f24,_0x2a2ce0))['catch'](handleError(_0x252f24,null));};exports['show']=function(_0x327839,_0x439a20){var _0x6b919b={'raw':![],'where':{'id':_0x327839[_0x477c('0x42')]['id']}},_0x43c1d1={};_0x43c1d1[_0x477c('0x30')]=_['keys'](db[_0x477c('0x2d')][_0x477c('0x2e')]);_0x43c1d1['query']=_[_0x477c('0x32')](_0x327839[_0x477c('0x31')]);_0x43c1d1[_0x477c('0x39')]=_[_0x477c('0x43')](_0x43c1d1[_0x477c('0x30')],_0x43c1d1[_0x477c('0x31')]);_0x6b919b[_0x477c('0x33')]=_[_0x477c('0x43')](_0x43c1d1[_0x477c('0x30')],qs['fields'](_0x327839[_0x477c('0x31')][_0x477c('0x34')]));_0x6b919b[_0x477c('0x33')]=_0x6b919b[_0x477c('0x33')][_0x477c('0x44')]?_0x6b919b[_0x477c('0x33')]:_0x43c1d1[_0x477c('0x30')];if(_0x327839['query'][_0x477c('0x45')]){_0x6b919b['include']=[{'all':!![]}];}_0x6b919b=_[_0x477c('0x3c')]({},_0x6b919b,_0x327839[_0x477c('0x3d')]);return db[_0x477c('0x2d')]['find'](_0x6b919b)[_0x477c('0x3e')](handleEntityNotFound(_0x439a20,null))[_0x477c('0x3e')](respondWithResult(_0x439a20,null))['catch'](handleError(_0x439a20,null));};exports[_0x477c('0x46')]=function(_0x252490,_0x166bc6){return db[_0x477c('0x2d')][_0x477c('0x46')](_0x252490[_0x477c('0x47')],{})[_0x477c('0x3e')](respondWithResult(_0x166bc6,0xc9))[_0x477c('0x48')](handleError(_0x166bc6,null));};exports[_0x477c('0x49')]=function(_0x7bed69,_0x1bdaaf){if(_0x7bed69[_0x477c('0x47')]['id']){delete _0x7bed69[_0x477c('0x47')]['id'];}return db[_0x477c('0x2d')][_0x477c('0x4a')]({'where':{'id':_0x7bed69[_0x477c('0x42')]['id']}})[_0x477c('0x3e')](handleEntityNotFound(_0x1bdaaf,null))[_0x477c('0x3e')](saveUpdates(_0x7bed69[_0x477c('0x47')],null))[_0x477c('0x3e')](respondWithResult(_0x1bdaaf,null))[_0x477c('0x48')](handleError(_0x1bdaaf,null));};exports[_0x477c('0x4b')]=function(_0x40746d,_0x2055a4){return db['VoiceQueueReport'][_0x477c('0x4a')]({'where':{'id':_0x40746d['params']['id']}})[_0x477c('0x3e')](handleEntityNotFound(_0x2055a4,null))[_0x477c('0x3e')](removeEntity(_0x2055a4,null))['catch'](handleError(_0x2055a4,null));};exports['describe']=function(_0x15ed40,_0x1cef52){return db[_0x477c('0x2d')][_0x477c('0x4c')]()[_0x477c('0x3e')](respondWithResult(_0x1cef52,null))[_0x477c('0x48')](handleError(_0x1cef52,null));};exports[_0x477c('0x4d')]=function(_0x5edde8,_0x4e0453){var _0x43368d={},_0x3c53de={},_0x1d2859={'count':0x0,'rows':[]};_0x3c53de[_0x477c('0x30')]=_['keys'](db[_0x477c('0x2d')][_0x477c('0x2e')]);_0x3c53de[_0x477c('0x31')]=_[_0x477c('0x32')](_0x5edde8['query']);_0x3c53de[_0x477c('0x39')]=_[_0x477c('0x43')](_0x3c53de['model'],_0x3c53de[_0x477c('0x31')]);_0x43368d[_0x477c('0x33')]=_[_0x477c('0x43')](_0x3c53de['model'],qs[_0x477c('0x34')](_0x5edde8[_0x477c('0x31')]['fields']));_0x43368d[_0x477c('0x33')]=_0x43368d[_0x477c('0x33')][_0x477c('0x44')]?_0x43368d['attributes']:_0x3c53de[_0x477c('0x30')];if(!_0x5edde8['query']['hasOwnProperty'](_0x477c('0x35'))){_0x43368d[_0x477c('0x24')]=qs['limit'](_0x5edde8['query'][_0x477c('0x24')]);_0x43368d[_0x477c('0x22')]=qs[_0x477c('0x22')](_0x5edde8[_0x477c('0x31')][_0x477c('0x22')]);}_0x43368d[_0x477c('0x36')]=qs['sort'](_0x5edde8[_0x477c('0x31')]['sort']);_0x43368d[_0x477c('0x38')]=qs['filters'](_[_0x477c('0x4e')](_0x5edde8[_0x477c('0x31')],_0x3c53de[_0x477c('0x39')]));if(_0x5edde8['query'][_0x477c('0x3a')]){_0x43368d['where']=_[_0x477c('0x3c')](_0x43368d[_0x477c('0x38')],{'$or':_[_0x477c('0x4f')](_0x43368d[_0x477c('0x33')],function(_0x1cc11f){var _0x44151e={};_0x44151e[_0x1cc11f]={'$like':'%'+_0x5edde8[_0x477c('0x31')]['filter']+'%'};return _0x44151e;})});}_0x43368d=_['merge']({},_0x43368d,_0x5edde8[_0x477c('0x3d')]);var _0x572e7b={'where':_0x43368d[_0x477c('0x38')]};return db[_0x477c('0x2d')][_0x477c('0x25')](_0x572e7b)['then'](function(_0x282307){_0x1d2859[_0x477c('0x25')]=_0x282307;if(_0x5edde8[_0x477c('0x31')][_0x477c('0x45')]){_0x43368d[_0x477c('0x3f')]=[{'all':!![]}];}return db[_0x477c('0x2d')]['findAll'](_0x43368d);})[_0x477c('0x3e')](function(_0x4bd62b){_0x1d2859['rows']=_0x4bd62b;return _0x1d2859;})[_0x477c('0x3e')](respondWithFilteredResult(_0x4e0453,_0x43368d,'getVoiceQueuesReport'))['catch'](handleError(_0x4e0453,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index da82c40..faca0a1 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 _0xde1c=['events','VoiceQueueReport','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x1193ea,_0xc04ef0){var _0x5e4000=function(_0xe18bde){while(--_0xe18bde){_0x1193ea['push'](_0x1193ea['shift']());}};_0x5e4000(++_0xc04ef0);}(_0xde1c,0x1d0));var _0xcde1=function(_0x15e714,_0xbc9d98){_0x15e714=_0x15e714-0x0;var _0x2dd515=_0xde1c[_0x15e714];return _0x2dd515;};'use strict';var EventEmitter=require(_0xcde1('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xcde1('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xcde1('0x2')](0x0);var events={'afterCreate':_0xcde1('0x3'),'afterUpdate':'update','afterDestroy':_0xcde1('0x4')};function emitEvent(_0x595ff3){return function(_0x168379,_0x256dac,_0x590992){VoiceQueueReportEvents['emit'](_0x595ff3+':'+_0x168379['id'],_0x168379);VoiceQueueReportEvents[_0xcde1('0x5')](_0x595ff3,_0x168379);_0x590992(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xcde1('0x6')](e,emitEvent(event));}}module[_0xcde1('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xd3fd=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','emit'];(function(_0x3546fb,_0x137629){var _0x2446b9=function(_0x2709e6){while(--_0x2709e6){_0x3546fb['push'](_0x3546fb['shift']());}};_0x2446b9(++_0x137629);}(_0xd3fd,0x9c));var _0xdd3f=function(_0x50498e,_0x2c21c7){_0x50498e=_0x50498e-0x0;var _0x2c4a46=_0xd3fd[_0x50498e];return _0x2c4a46;};'use strict';var EventEmitter=require(_0xdd3f('0x0'));var VoiceQueueReport=require(_0xdd3f('0x1'))['db'][_0xdd3f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdd3f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5da8fc){return function(_0x486ece,_0x54d75d,_0x1307ad){VoiceQueueReportEvents[_0xdd3f('0x4')](_0x5da8fc+':'+_0x486ece['id'],_0x486ece);VoiceQueueReportEvents[_0xdd3f('0x4')](_0x5da8fc,_0x486ece);_0x1307ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xdd3f('0x5')](e,emitEvent(event));}}module[_0xdd3f('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 59ee58c..d1fb0c1 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 _0xdf70=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdf70,0x1e6));var _0x0df7=function(_0x18c510,_0x416a82){_0x18c510=_0x18c510-0x0;var _0x2cff7f=_0xdf70[_0x18c510];return _0x2cff7f;};'use strict';var _=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var logger=require(_0x0df7('0x2'))(_0x0df7('0x3'));var moment=require(_0x0df7('0x4'));var BPromise=require(_0x0df7('0x5'));var rp=require(_0x0df7('0x6'));var fs=require('fs');var path=require(_0x0df7('0x7'));var rimraf=require(_0x0df7('0x8'));var config=require(_0x0df7('0x9'));var attributes=require(_0x0df7('0xa'));module[_0x0df7('0xb')]=function(_0x420fd4,_0x377722){return _0x420fd4[_0x0df7('0xc')](_0x0df7('0xd'),attributes,{'tableName':_0x0df7('0xe'),'paranoid':![],'indexes':[{'fields':[_0x0df7('0xf')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfee4=['api','moment','path','rimraf','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger'];(function(_0x1ef911,_0x32a38b){var _0x5297f4=function(_0x3b1134){while(--_0x3b1134){_0x1ef911['push'](_0x1ef911['shift']());}};_0x5297f4(++_0x32a38b);}(_0xfee4,0x1d7));var _0x4fee=function(_0x5ef833,_0x306fa8){_0x5ef833=_0x5ef833-0x0;var _0xcb00bb=_0xfee4[_0x5ef833];return _0xcb00bb;};'use strict';var _=require('lodash');var util=require(_0x4fee('0x0'));var logger=require(_0x4fee('0x1'))(_0x4fee('0x2'));var moment=require(_0x4fee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fee('0x4'));var rimraf=require(_0x4fee('0x5'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x4fee('0x6')]=function(_0x39abc4,_0x4fd399){return _0x39abc4['define'](_0x4fee('0x7'),attributes,{'tableName':_0x4fee('0x8'),'paranoid':![],'indexes':[{'fields':[_0x4fee('0x9')]},{'fields':[_0x4fee('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 5c936a1..a081592 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 _0x7e2c=['client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','include','map','model','debug','catch','CreateVoiceQueueReport','then','update','limit','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x7e2c,0xc7));var _0xc7e2=function(_0x185b19,_0x15dbc2){_0x185b19=_0x185b19-0x0;var _0xffc90d=_0x7e2c[_0x185b19];return _0xffc90d;};'use strict';var _=require(_0xc7e2('0x0'));var util=require(_0xc7e2('0x1'));var moment=require(_0xc7e2('0x2'));var BPromise=require(_0xc7e2('0x3'));var rs=require(_0xc7e2('0x4'));var fs=require('fs');var Redis=require(_0xc7e2('0x5'));var db=require(_0xc7e2('0x6'))['db'];var utils=require(_0xc7e2('0x7'));var logger=require(_0xc7e2('0x8'))(_0xc7e2('0x9'));var config=require('../../config/environment');var jayson=require(_0xc7e2('0xa'));var client=jayson[_0xc7e2('0xb')]['http']({'port':0x232a});config[_0xc7e2('0xc')]=_[_0xc7e2('0xd')](config[_0xc7e2('0xc')],{'host':_0xc7e2('0xe'),'port':0x18eb});var socket=require(_0xc7e2('0xf'))(new Redis(config[_0xc7e2('0xc')]));require(_0xc7e2('0x10'))['register'](socket);function respondWithRpcPromise(_0x44237f,_0x4c1ab3,_0x3a05ee){return new BPromise(function(_0x3d8803,_0x4a91c4){return client[_0xc7e2('0x11')](_0x44237f,_0x3a05ee)['then'](function(_0x271166){logger[_0xc7e2('0x12')](_0xc7e2('0x13'),_0x4c1ab3,_0xc7e2('0x14'));logger['debug'](_0xc7e2('0x15'),_0x4c1ab3,_0xc7e2('0x14'),JSON[_0xc7e2('0x16')](_0x271166));if(_0x271166['error']){if(_0x271166[_0xc7e2('0x17')][_0xc7e2('0x18')]===0x1f4){logger[_0xc7e2('0x17')](_0xc7e2('0x13'),_0x4c1ab3,_0x271166[_0xc7e2('0x17')][_0xc7e2('0x19')]);return _0x4a91c4(_0x271166[_0xc7e2('0x17')][_0xc7e2('0x19')]);}logger[_0xc7e2('0x17')](_0xc7e2('0x13'),_0x4c1ab3,_0x271166[_0xc7e2('0x17')][_0xc7e2('0x19')]);return _0x3d8803(_0x271166[_0xc7e2('0x17')][_0xc7e2('0x19')]);}else{logger[_0xc7e2('0x12')](_0xc7e2('0x13'),_0x4c1ab3,_0xc7e2('0x14'));_0x3d8803(_0x271166[_0xc7e2('0x1a')]['message']);}})['catch'](function(_0x24046a){logger[_0xc7e2('0x17')](_0xc7e2('0x13'),_0x4c1ab3,_0x24046a);_0x4a91c4(_0x24046a);});});}exports[_0xc7e2('0x1b')]=function(_0x5e8467){var _0x339509=this;return new Promise(function(_0x1dbfa4,_0x1d3b64){return db[_0xc7e2('0x1c')]['findAll']({'raw':_0x5e8467[_0xc7e2('0x1d')]?_0x5e8467['options'][_0xc7e2('0x1e')]===undefined?!![]:![]:!![],'where':_0x5e8467[_0xc7e2('0x1d')]?_0x5e8467[_0xc7e2('0x1d')]['where']||null:null,'attributes':_0x5e8467[_0xc7e2('0x1d')]?_0x5e8467[_0xc7e2('0x1d')][_0xc7e2('0x1f')]||null:null,'limit':_0x5e8467[_0xc7e2('0x1d')]?_0x5e8467['options']['limit']||null:null,'include':_0x5e8467[_0xc7e2('0x1d')]?_0x5e8467['options'][_0xc7e2('0x20')]?_[_0xc7e2('0x21')](_0x5e8467['options'][_0xc7e2('0x20')],function(_0x367f8f){return{'model':db[_0x367f8f[_0xc7e2('0x22')]],'as':_0x367f8f['as'],'attributes':_0x367f8f[_0xc7e2('0x1f')],'include':_0x367f8f[_0xc7e2('0x20')]?_[_0xc7e2('0x21')](_0x367f8f[_0xc7e2('0x20')],function(_0x557a76){return{'model':db[_0x557a76[_0xc7e2('0x22')]],'as':_0x557a76['as'],'attributes':_0x557a76['attributes'],'include':_0x557a76[_0xc7e2('0x20')]?_[_0xc7e2('0x21')](_0x557a76[_0xc7e2('0x20')],function(_0x38ed03){return{'model':db[_0x38ed03[_0xc7e2('0x22')]],'as':_0x38ed03['as'],'attributes':_0x38ed03[_0xc7e2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e6319){logger[_0xc7e2('0x12')](_0xc7e2('0x1b'),_0x5e8467);logger[_0xc7e2('0x23')](_0xc7e2('0x1b'),_0x5e8467,JSON['stringify'](_0x3e6319));_0x1dbfa4(_0x3e6319);})[_0xc7e2('0x24')](function(_0x2399e6){logger[_0xc7e2('0x17')](_0xc7e2('0x1b'),_0x2399e6['message'],_0x5e8467);_0x1d3b64(_0x339509[_0xc7e2('0x17')](0x1f4,_0x2399e6[_0xc7e2('0x19')]));});});};exports[_0xc7e2('0x25')]=function(_0x50382d){var _0xa5ab4=this;return new Promise(function(_0x50e2d3,_0x18e719){return db[_0xc7e2('0x1c')]['create'](_0x50382d['body'],{'raw':_0x50382d['options']?_0x50382d[_0xc7e2('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xc7e2('0x26')](function(_0x55b545){logger['info'](_0xc7e2('0x25'),_0x50382d);logger['debug']('CreateVoiceQueueReport',_0x50382d,JSON[_0xc7e2('0x16')](_0x55b545));_0x50e2d3(_0x55b545);})[_0xc7e2('0x24')](function(_0xd620a2){logger[_0xc7e2('0x17')](_0xc7e2('0x25'),_0xd620a2[_0xc7e2('0x19')],_0x50382d);_0x18e719(_0xa5ab4[_0xc7e2('0x17')](0x1f4,_0xd620a2['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x1f7251){var _0x5e86d5=this;return new Promise(function(_0x579298,_0x292263){return db[_0xc7e2('0x1c')][_0xc7e2('0x27')](_0x1f7251['body'],{'raw':_0x1f7251[_0xc7e2('0x1d')]?_0x1f7251[_0xc7e2('0x1d')][_0xc7e2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f7251['options']?_0x1f7251[_0xc7e2('0x1d')]['where']||null:null,'attributes':_0x1f7251[_0xc7e2('0x1d')]?_0x1f7251[_0xc7e2('0x1d')][_0xc7e2('0x1f')]||null:null,'limit':_0x1f7251[_0xc7e2('0x1d')]?_0x1f7251['options'][_0xc7e2('0x28')]||null:null})[_0xc7e2('0x26')](function(_0x277c26){logger[_0xc7e2('0x12')](_0xc7e2('0x29'),_0x1f7251);logger[_0xc7e2('0x23')](_0xc7e2('0x29'),_0x1f7251,JSON[_0xc7e2('0x16')](_0x277c26));_0x579298(_0x277c26);})['catch'](function(_0x40979c){logger[_0xc7e2('0x17')](_0xc7e2('0x29'),_0x40979c['message'],_0x1f7251);_0x292263(_0x5e86d5[_0xc7e2('0x17')](0x1f4,_0x40979c[_0xc7e2('0x19')]));});});}; \ No newline at end of file +var _0xd078=['VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport'];(function(_0xcd7a3c,_0x1174f9){var _0xd8aa59=function(_0x3b4433){while(--_0x3b4433){_0xcd7a3c['push'](_0xcd7a3c['shift']());}};_0xd8aa59(++_0x1174f9);}(_0xd078,0x15f));var _0x8d07=function(_0x7e557a,_0x3e41ab){_0x7e557a=_0x7e557a-0x0;var _0x3aba18=_0xd078[_0x7e557a];return _0x3aba18;};'use strict';var _=require(_0x8d07('0x0'));var util=require('util');var moment=require(_0x8d07('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d07('0x2'));var db=require(_0x8d07('0x3'))['db'];var utils=require(_0x8d07('0x4'));var logger=require('../../config/logger')(_0x8d07('0x5'));var config=require('../../config/environment');var jayson=require(_0x8d07('0x6'));var client=jayson[_0x8d07('0x7')][_0x8d07('0x8')]({'port':0x232a});config[_0x8d07('0x9')]=_['defaults'](config['redis'],{'host':_0x8d07('0xa'),'port':0x18eb});var socket=require(_0x8d07('0xb'))(new Redis(config[_0x8d07('0x9')]));require('./voiceQueueReport.socket')[_0x8d07('0xc')](socket);function respondWithRpcPromise(_0x46c511,_0x3c9c5f,_0x3e37c0){return new BPromise(function(_0x570570,_0x3d8a0f){return client[_0x8d07('0xd')](_0x46c511,_0x3e37c0)[_0x8d07('0xe')](function(_0x234c0a){logger[_0x8d07('0xf')](_0x8d07('0x10'),_0x3c9c5f,_0x8d07('0x11'));logger[_0x8d07('0x12')](_0x8d07('0x13'),_0x3c9c5f,_0x8d07('0x11'),JSON[_0x8d07('0x14')](_0x234c0a));if(_0x234c0a[_0x8d07('0x15')]){if(_0x234c0a[_0x8d07('0x15')][_0x8d07('0x16')]===0x1f4){logger['error'](_0x8d07('0x10'),_0x3c9c5f,_0x234c0a[_0x8d07('0x15')]['message']);return _0x3d8a0f(_0x234c0a[_0x8d07('0x15')][_0x8d07('0x17')]);}logger[_0x8d07('0x15')](_0x8d07('0x10'),_0x3c9c5f,_0x234c0a[_0x8d07('0x15')]['message']);return _0x570570(_0x234c0a['error'][_0x8d07('0x17')]);}else{logger[_0x8d07('0xf')](_0x8d07('0x10'),_0x3c9c5f,_0x8d07('0x11'));_0x570570(_0x234c0a[_0x8d07('0x18')][_0x8d07('0x17')]);}})[_0x8d07('0x19')](function(_0x50ea9c){logger[_0x8d07('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x3c9c5f,_0x50ea9c);_0x3d8a0f(_0x50ea9c);});});}exports[_0x8d07('0x1a')]=function(_0x2afb46){var _0x78e072=this;return new Promise(function(_0x5ccdfe,_0x238d00){return db[_0x8d07('0x1b')][_0x8d07('0x1c')]({'raw':_0x2afb46[_0x8d07('0x1d')]?_0x2afb46[_0x8d07('0x1d')][_0x8d07('0x1e')]===undefined?!![]:![]:!![],'where':_0x2afb46[_0x8d07('0x1d')]?_0x2afb46[_0x8d07('0x1d')][_0x8d07('0x1f')]||null:null,'attributes':_0x2afb46[_0x8d07('0x1d')]?_0x2afb46[_0x8d07('0x1d')][_0x8d07('0x20')]||null:null,'limit':_0x2afb46[_0x8d07('0x1d')]?_0x2afb46[_0x8d07('0x1d')][_0x8d07('0x21')]||null:null,'include':_0x2afb46[_0x8d07('0x1d')]?_0x2afb46[_0x8d07('0x1d')]['include']?_[_0x8d07('0x22')](_0x2afb46[_0x8d07('0x1d')][_0x8d07('0x23')],function(_0x3cdac4){return{'model':db[_0x3cdac4[_0x8d07('0x24')]],'as':_0x3cdac4['as'],'attributes':_0x3cdac4['attributes'],'include':_0x3cdac4['include']?_['map'](_0x3cdac4[_0x8d07('0x23')],function(_0xb273ec){return{'model':db[_0xb273ec[_0x8d07('0x24')]],'as':_0xb273ec['as'],'attributes':_0xb273ec[_0x8d07('0x20')],'include':_0xb273ec[_0x8d07('0x23')]?_[_0x8d07('0x22')](_0xb273ec['include'],function(_0x1d5a45){return{'model':db[_0x1d5a45[_0x8d07('0x24')]],'as':_0x1d5a45['as'],'attributes':_0x1d5a45[_0x8d07('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8d07('0xe')](function(_0x6b589){logger[_0x8d07('0xf')](_0x8d07('0x1a'),_0x2afb46);logger[_0x8d07('0x12')](_0x8d07('0x1a'),_0x2afb46,JSON['stringify'](_0x6b589));_0x5ccdfe(_0x6b589);})['catch'](function(_0x248ca2){logger['error']('GetVoiceQueueReport',_0x248ca2[_0x8d07('0x17')],_0x2afb46);_0x238d00(_0x78e072[_0x8d07('0x15')](0x1f4,_0x248ca2['message']));});});};exports[_0x8d07('0x25')]=function(_0x1ac7d9){var _0x20dad4=this;return new Promise(function(_0x59402d,_0x5c933c){return db[_0x8d07('0x1b')][_0x8d07('0x26')](_0x1ac7d9[_0x8d07('0x27')],{'raw':_0x1ac7d9[_0x8d07('0x1d')]?_0x1ac7d9[_0x8d07('0x1d')][_0x8d07('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1ebad6){logger[_0x8d07('0xf')](_0x8d07('0x25'),_0x1ac7d9);logger['debug'](_0x8d07('0x25'),_0x1ac7d9,JSON[_0x8d07('0x14')](_0x1ebad6));_0x59402d(_0x1ebad6);})[_0x8d07('0x19')](function(_0x39871a){logger[_0x8d07('0x15')](_0x8d07('0x25'),_0x39871a['message'],_0x1ac7d9);_0x5c933c(_0x20dad4[_0x8d07('0x15')](0x1f4,_0x39871a['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x2ebb3f){var _0x27de25=this;return new Promise(function(_0x548da6,_0x308eb0){return db[_0x8d07('0x1b')][_0x8d07('0x28')](_0x2ebb3f['body'],{'raw':_0x2ebb3f[_0x8d07('0x1d')]?_0x2ebb3f[_0x8d07('0x1d')][_0x8d07('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ebb3f[_0x8d07('0x1d')]?_0x2ebb3f['options'][_0x8d07('0x1f')]||null:null,'attributes':_0x2ebb3f['options']?_0x2ebb3f[_0x8d07('0x1d')][_0x8d07('0x20')]||null:null,'limit':_0x2ebb3f[_0x8d07('0x1d')]?_0x2ebb3f[_0x8d07('0x1d')][_0x8d07('0x21')]||null:null})['then'](function(_0x37dbbd){logger['info'](_0x8d07('0x29'),_0x2ebb3f);logger[_0x8d07('0x12')](_0x8d07('0x29'),_0x2ebb3f,JSON[_0x8d07('0x14')](_0x37dbbd));_0x548da6(_0x37dbbd);})[_0x8d07('0x19')](function(_0x33d13e){logger[_0x8d07('0x15')](_0x8d07('0x29'),_0x33d13e[_0x8d07('0x17')],_0x2ebb3f);_0x308eb0(_0x27de25[_0x8d07('0x15')](0x1f4,_0x33d13e[_0x8d07('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8b781eb..cbf327a 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 _0xf006=['register','voiceQueueReport:','remove','update','emit','removeListener'];(function(_0x24a00c,_0x182bd8){var _0x2a04a=function(_0x15dca1){while(--_0x15dca1){_0x24a00c['push'](_0x24a00c['shift']());}};_0x2a04a(++_0x182bd8);}(_0xf006,0x146));var _0x6f00=function(_0x251fb4,_0x432721){_0x251fb4=_0x251fb4-0x0;var _0x5161c4=_0xf006[_0x251fb4];return _0x5161c4;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x6f00('0x0'),_0x6f00('0x1')];function createListener(_0x5914f3,_0xbab575){return function(_0x4e9dbc){_0xbab575[_0x6f00('0x2')](_0x5914f3,_0x4e9dbc);};}function removeListener(_0x4f4466,_0x5039fb){return function(){VoiceQueueReportEvents[_0x6f00('0x3')](_0x4f4466,_0x5039fb);};}exports[_0x6f00('0x4')]=function(_0x141e71){for(var _0x52c9a2=0x0,_0x3c29ff=events['length'];_0x52c9a2<_0x3c29ff;_0x52c9a2++){var _0x3875fb=events[_0x52c9a2];var _0x3001b1=createListener(_0x6f00('0x5')+_0x3875fb,_0x141e71);VoiceQueueReportEvents['on'](_0x3875fb,_0x3001b1);}}; \ No newline at end of file +var _0x7bbd=['./voiceQueueReport.events','save','remove','update','register','length','voiceQueueReport:'];(function(_0x2fc782,_0x176c59){var _0x10a6c3=function(_0x398cee){while(--_0x398cee){_0x2fc782['push'](_0x2fc782['shift']());}};_0x10a6c3(++_0x176c59);}(_0x7bbd,0x11f));var _0xd7bb=function(_0x5511ec,_0x23b791){_0x5511ec=_0x5511ec-0x0;var _0x411c75=_0x7bbd[_0x5511ec];return _0x411c75;};'use strict';var VoiceQueueReportEvents=require(_0xd7bb('0x0'));var events=[_0xd7bb('0x1'),_0xd7bb('0x2'),_0xd7bb('0x3')];function createListener(_0x4d6483,_0x525a91){return function(_0x5371f7){_0x525a91['emit'](_0x4d6483,_0x5371f7);};}function removeListener(_0x2a039f,_0x1ec7c4){return function(){VoiceQueueReportEvents['removeListener'](_0x2a039f,_0x1ec7c4);};}exports[_0xd7bb('0x4')]=function(_0x269764){for(var _0x18095d=0x0,_0x1c5174=events[_0xd7bb('0x5')];_0x18095d<_0x1c5174;_0x18095d++){var _0x407c83=events[_0x18095d];var _0x24e7c9=createListener(_0xd7bb('0x6')+_0x407c83,_0x269764);VoiceQueueReportEvents['on'](_0x407c83,_0x24e7c9);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9e8baf2..f13914c 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 _0x91e4=['get','index','/:id','post','isAuthenticated','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x91e4,0x14d));var _0x491e=function(_0x1000bc,_0x409433){_0x1000bc=_0x1000bc-0x0;var _0x29a027=_0x91e4[_0x1000bc];return _0x29a027;};'use strict';var multer=require(_0x491e('0x0'));var util=require(_0x491e('0x1'));var path=require('path');var timeout=require(_0x491e('0x2'));var express=require('express');var router=express[_0x491e('0x3')]();var fs_extra=require(_0x491e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0x491e('0x5')]('/',auth['isAuthenticated'](),controller[_0x491e('0x6')]);router[_0x491e('0x5')](_0x491e('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x491e('0x8')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x491e('0x7'),auth[_0x491e('0x9')](),controller[_0x491e('0xa')]);router[_0x491e('0xb')](_0x491e('0x7'),auth[_0x491e('0x9')](),controller[_0x491e('0xc')]);module['exports']=router; \ No newline at end of file +var _0x6127=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x6127,0x165));var _0x7612=function(_0x126ee1,_0x4b9781){_0x126ee1=_0x126ee1-0x0;var _0x32524c=_0x6127[_0x126ee1];return _0x32524c;};'use strict';var multer=require(_0x7612('0x0'));var util=require(_0x7612('0x1'));var path=require(_0x7612('0x2'));var timeout=require(_0x7612('0x3'));var express=require(_0x7612('0x4'));var router=express[_0x7612('0x5')]();var fs_extra=require(_0x7612('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7612('0x7'));var controller=require(_0x7612('0x8'));router[_0x7612('0x9')]('/',auth[_0x7612('0xa')](),controller[_0x7612('0xb')]);router['get'](_0x7612('0xc'),auth[_0x7612('0xa')](),controller[_0x7612('0xd')]);router[_0x7612('0xe')]('/',auth[_0x7612('0xa')](),controller[_0x7612('0xf')]);router[_0x7612('0x10')](_0x7612('0xc'),auth[_0x7612('0xa')](),controller[_0x7612('0x11')]);router[_0x7612('0x12')](_0x7612('0xc'),auth[_0x7612('0xa')](),controller[_0x7612('0x13')]);module[_0x7612('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index f085578..3da15c4 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 _0x0e50=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x2601d4,_0x38c081){var _0xce72cc=function(_0x55901b){while(--_0x55901b){_0x2601d4['push'](_0x2601d4['shift']());}};_0xce72cc(++_0x38c081);}(_0x0e50,0x168));var _0x00e5=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x0e50[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x00e5('0x0'));var moment=require(_0x00e5('0x1'));module[_0x00e5('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x00e5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x00e5('0x4')],'allowNull':![],'defaultValue':moment()[_0x00e5('0x5')](_0x00e5('0x6'))}}; \ No newline at end of file +var _0xb2b0=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x4d63b1,_0x3a32ec){var _0xd422f6=function(_0x284a15){while(--_0x284a15){_0x4d63b1['push'](_0x4d63b1['shift']());}};_0xd422f6(++_0x3a32ec);}(_0xb2b0,0x72));var _0x0b2b=function(_0x466bef,_0x3aca10){_0x466bef=_0x466bef-0x0;var _0x41f935=_0xb2b0[_0x466bef];return _0x41f935;};'use strict';var Sequelize=require(_0x0b2b('0x0'));var moment=require(_0x0b2b('0x1'));module[_0x0b2b('0x2')]={'time':{'type':Sequelize[_0x0b2b('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0b2b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0b2b('0x4')],'allowNull':![],'defaultValue':moment()[_0x0b2b('0x5')](_0x0b2b('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 907cda3..6c5078f 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 _0xedbc=['rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','destroy','rimraf','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','error','stack','name','send','index','VoiceQueuesLog'];(function(_0x34055a,_0x78885){var _0x466547=function(_0xf32157){while(--_0xf32157){_0x34055a['push'](_0x34055a['shift']());}};_0x466547(++_0x78885);}(_0xedbc,0x1ea));var _0xcedb=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xedbc[_0x3070dc];return _0x431489;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcedb('0x0'));var zipdir=require(_0xcedb('0x1'));var jsonpatch=require(_0xcedb('0x2'));var rp=require('request-promise');var moment=require(_0xcedb('0x3'));var BPromise=require(_0xcedb('0x4'));var Mustache=require(_0xcedb('0x5'));var util=require('util');var path=require(_0xcedb('0x6'));var sox=require(_0xcedb('0x7'));var csv=require(_0xcedb('0x8'));var ejs=require(_0xcedb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcedb('0xa'));var squel=require(_0xcedb('0xb'));var crypto=require('crypto');var jsforce=require(_0xcedb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcedb('0x8'));var querystring=require(_0xcedb('0xd'));var Papa=require(_0xcedb('0xe'));var Redis=require(_0xcedb('0xf'));var authService=require(_0xcedb('0x10'));var qs=require(_0xcedb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcedb('0x12'));var logger=require(_0xcedb('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcedb('0x14'));var licenseUtil=require(_0xcedb('0x15'));var db=require(_0xcedb('0x16'))['db'];function respondWithStatusCode(_0x77f9ae,_0x1e157c){_0x1e157c=_0x1e157c||0xcc;return function(_0x5f2f3e){if(_0x5f2f3e){return _0x77f9ae[_0xcedb('0x17')](_0x1e157c);}return _0x77f9ae[_0xcedb('0x18')](_0x1e157c)[_0xcedb('0x19')]();};}function respondWithResult(_0x5be988,_0x4a28c8){_0x4a28c8=_0x4a28c8||0xc8;return function(_0x1f7c0b){if(_0x1f7c0b){return _0x5be988[_0xcedb('0x18')](_0x4a28c8)['json'](_0x1f7c0b);}};}function respondWithFilteredResult(_0x4b9ea3,_0x48b685){return function(_0x4e6274){if(_0x4e6274){var _0x58a97b=typeof _0x48b685[_0xcedb('0x1a')]===_0xcedb('0x1b')&&typeof _0x48b685[_0xcedb('0x1c')]===_0xcedb('0x1b');var _0x2447dd=_0x4e6274[_0xcedb('0x1d')];var _0xbd0f1=_0x58a97b?0x0:_0x48b685[_0xcedb('0x1a')];var _0xf71b88=_0x58a97b?_0x4e6274[_0xcedb('0x1d')]:_0x48b685['offset']+_0x48b685[_0xcedb('0x1c')];var _0x1e88f8;if(_0xf71b88>=_0x2447dd){_0xf71b88=_0x2447dd;_0x1e88f8=0xc8;}else{_0x1e88f8=0xce;}_0x4b9ea3[_0xcedb('0x18')](_0x1e88f8);return _0x4b9ea3[_0xcedb('0x1e')]('Content-Range',_0xbd0f1+'-'+_0xf71b88+'/'+_0x2447dd)[_0xcedb('0x1f')](_0x4e6274);}return null;};}function patchUpdates(_0x2bbd85){return function(_0x48b167){try{jsonpatch[_0xcedb('0x20')](_0x48b167,_0x2bbd85,!![]);}catch(_0xf73c05){return BPromise['reject'](_0xf73c05);}return _0x48b167[_0xcedb('0x21')]();};}function saveUpdates(_0x5a5feb,_0x684f76){return function(_0x2df482){if(_0x2df482){return _0x2df482[_0xcedb('0x22')](_0x5a5feb)[_0xcedb('0x23')](function(_0x37b97b){return _0x37b97b;});}return null;};}function removeEntity(_0x4de459,_0x27d3d0){return function(_0x538169){if(_0x538169){return _0x538169['destroy']()[_0xcedb('0x23')](function(){_0x4de459['status'](0xcc)[_0xcedb('0x19')]();});}};}function handleEntityNotFound(_0x4b0622,_0x4c4af6){return function(_0x21d536){if(!_0x21d536){_0x4b0622[_0xcedb('0x17')](0x194);}return _0x21d536;};}function handleError(_0x412e2f,_0x51383d){_0x51383d=_0x51383d||0x1f4;return function(_0x92a86c){logger[_0xcedb('0x24')](_0x92a86c[_0xcedb('0x25')]);if(_0x92a86c['name']){delete _0x92a86c[_0xcedb('0x26')];}_0x412e2f[_0xcedb('0x18')](_0x51383d)[_0xcedb('0x27')](_0x92a86c);};}exports[_0xcedb('0x28')]=function(_0x18c8be,_0xf657d5){var _0x35f2fc={},_0x1aefaf={},_0x57abc5={'count':0x0,'rows':[]};var _0x1eb8f9=_['map'](db[_0xcedb('0x29')][_0xcedb('0x2a')],function(_0x108d40){return{'name':_0x108d40[_0xcedb('0x2b')],'type':_0x108d40[_0xcedb('0x2c')][_0xcedb('0x2d')]};});_0x1aefaf[_0xcedb('0x2e')]=_[_0xcedb('0x2f')](_0x1eb8f9,_0xcedb('0x26'));_0x1aefaf[_0xcedb('0x30')]=_[_0xcedb('0x31')](_0x18c8be[_0xcedb('0x30')]);_0x1aefaf['filters']=_[_0xcedb('0x32')](_0x1aefaf[_0xcedb('0x2e')],_0x1aefaf[_0xcedb('0x30')]);_0x35f2fc[_0xcedb('0x33')]=_[_0xcedb('0x32')](_0x1aefaf[_0xcedb('0x2e')],qs['fields'](_0x18c8be[_0xcedb('0x30')][_0xcedb('0x34')]));_0x35f2fc[_0xcedb('0x33')]=_0x35f2fc[_0xcedb('0x33')][_0xcedb('0x35')]?_0x35f2fc[_0xcedb('0x33')]:_0x1aefaf['model'];if(!_0x18c8be['query'][_0xcedb('0x36')](_0xcedb('0x37'))){_0x35f2fc[_0xcedb('0x1c')]=qs[_0xcedb('0x1c')](_0x18c8be['query']['limit']);_0x35f2fc[_0xcedb('0x1a')]=qs['offset'](_0x18c8be[_0xcedb('0x30')][_0xcedb('0x1a')]);}_0x35f2fc[_0xcedb('0x38')]=qs[_0xcedb('0x39')](_0x18c8be[_0xcedb('0x30')][_0xcedb('0x39')]);_0x35f2fc[_0xcedb('0x3a')]=qs[_0xcedb('0x3b')](_[_0xcedb('0x3c')](_0x18c8be[_0xcedb('0x30')],_0x1aefaf['filters']),_0x1eb8f9);if(_0x18c8be[_0xcedb('0x30')][_0xcedb('0x3d')]){_0x35f2fc[_0xcedb('0x3a')]=_[_0xcedb('0x3e')](_0x35f2fc[_0xcedb('0x3a')],{'$or':_[_0xcedb('0x2f')](_0x1eb8f9,function(_0xa945b1){if(_0xa945b1[_0xcedb('0x2c')]!==_0xcedb('0x3f')){var _0x2d1429={};_0x2d1429[_0xa945b1[_0xcedb('0x26')]]={'$like':'%'+_0x18c8be[_0xcedb('0x30')][_0xcedb('0x3d')]+'%'};return _0x2d1429;}})});}_0x35f2fc=_[_0xcedb('0x3e')]({},_0x35f2fc,_0x18c8be[_0xcedb('0x40')]);var _0x1fd327={'where':_0x35f2fc['where']};return db[_0xcedb('0x29')]['count'](_0x1fd327)[_0xcedb('0x23')](function(_0x34123e){_0x57abc5['count']=_0x34123e;if(_0x18c8be[_0xcedb('0x30')][_0xcedb('0x41')]){_0x35f2fc[_0xcedb('0x42')]=[{'all':!![]}];}return db[_0xcedb('0x29')][_0xcedb('0x43')](_0x35f2fc);})[_0xcedb('0x23')](function(_0x13130e){_0x57abc5[_0xcedb('0x44')]=_0x13130e;return _0x57abc5;})[_0xcedb('0x23')](respondWithFilteredResult(_0xf657d5,_0x35f2fc))[_0xcedb('0x45')](handleError(_0xf657d5,null));};exports[_0xcedb('0x46')]=function(_0x339725,_0x246040){var _0x4e5d02={'raw':!![],'where':{'id':_0x339725['params']['id']}},_0x2bf0ea={};_0x2bf0ea['model']=_[_0xcedb('0x31')](db['VoiceQueuesLog'][_0xcedb('0x2a')]);_0x2bf0ea['query']=_[_0xcedb('0x31')](_0x339725[_0xcedb('0x30')]);_0x2bf0ea[_0xcedb('0x3b')]=_[_0xcedb('0x32')](_0x2bf0ea['model'],_0x2bf0ea[_0xcedb('0x30')]);_0x4e5d02['attributes']=_[_0xcedb('0x32')](_0x2bf0ea[_0xcedb('0x2e')],qs[_0xcedb('0x34')](_0x339725[_0xcedb('0x30')][_0xcedb('0x34')]));_0x4e5d02[_0xcedb('0x33')]=_0x4e5d02[_0xcedb('0x33')][_0xcedb('0x35')]?_0x4e5d02['attributes']:_0x2bf0ea[_0xcedb('0x2e')];if(_0x339725[_0xcedb('0x30')][_0xcedb('0x41')]){_0x4e5d02['include']=[{'all':!![]}];}_0x4e5d02=_[_0xcedb('0x3e')]({},_0x4e5d02,_0x339725[_0xcedb('0x40')]);return db[_0xcedb('0x29')]['find'](_0x4e5d02)['then'](handleEntityNotFound(_0x246040,null))[_0xcedb('0x23')](respondWithResult(_0x246040,null))[_0xcedb('0x45')](handleError(_0x246040,null));};exports[_0xcedb('0x47')]=function(_0x482d6b,_0x10e06c){return db[_0xcedb('0x29')][_0xcedb('0x47')](_0x482d6b[_0xcedb('0x48')],{})[_0xcedb('0x23')](respondWithResult(_0x10e06c,0xc9))[_0xcedb('0x45')](handleError(_0x10e06c,null));};exports[_0xcedb('0x22')]=function(_0x18d176,_0x40c05f){if(_0x18d176[_0xcedb('0x48')]['id']){delete _0x18d176[_0xcedb('0x48')]['id'];}return db[_0xcedb('0x29')][_0xcedb('0x49')]({'where':{'id':_0x18d176[_0xcedb('0x4a')]['id']}})[_0xcedb('0x23')](handleEntityNotFound(_0x40c05f,null))[_0xcedb('0x23')](saveUpdates(_0x18d176['body'],null))['then'](respondWithResult(_0x40c05f,null))['catch'](handleError(_0x40c05f,null));};exports[_0xcedb('0x4b')]=function(_0x179ed4,_0x3733e3){return db['VoiceQueuesLog']['find']({'where':{'id':_0x179ed4['params']['id']}})[_0xcedb('0x23')](handleEntityNotFound(_0x3733e3,null))[_0xcedb('0x23')](removeEntity(_0x3733e3,null))['catch'](handleError(_0x3733e3,null));}; \ No newline at end of file +var _0x78a8=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','show','params','keys','rawAttributes','includeAll','options','find','create','body','catch','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','then','sendStatus','error','stack','name','send','index','VoiceQueuesLog','fieldName','type','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x29b358,_0x5f1ced){var _0xa3e5b9=function(_0x54482a){while(--_0x54482a){_0x29b358['push'](_0x29b358['shift']());}};_0xa3e5b9(++_0x5f1ced);}(_0x78a8,0x18e));var _0x878a=function(_0x48be02,_0x280e16){_0x48be02=_0x48be02-0x0;var _0x316ac5=_0x78a8[_0x48be02];return _0x316ac5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x878a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x878a('0x1'));var rp=require(_0x878a('0x2'));var moment=require(_0x878a('0x3'));var BPromise=require(_0x878a('0x4'));var Mustache=require(_0x878a('0x5'));var util=require('util');var path=require(_0x878a('0x6'));var sox=require('sox');var csv=require(_0x878a('0x7'));var ejs=require(_0x878a('0x8'));var fs=require('fs');var fs_extra=require(_0x878a('0x9'));var _=require(_0x878a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x878a('0xb'));var deskjs=require(_0x878a('0xc'));var toCsv=require(_0x878a('0x7'));var querystring=require(_0x878a('0xd'));var Papa=require(_0x878a('0xe'));var Redis=require(_0x878a('0xf'));var authService=require(_0x878a('0x10'));var qs=require(_0x878a('0x11'));var as=require(_0x878a('0x12'));var hardwareService=require(_0x878a('0x13'));var logger=require(_0x878a('0x14'))(_0x878a('0x15'));var utils=require('../../config/utils');var config=require(_0x878a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x878a('0x17'))['db'];function respondWithStatusCode(_0x3a9982,_0x35c4f0){_0x35c4f0=_0x35c4f0||0xcc;return function(_0x11c4c2){if(_0x11c4c2){return _0x3a9982['sendStatus'](_0x35c4f0);}return _0x3a9982[_0x878a('0x18')](_0x35c4f0)[_0x878a('0x19')]();};}function respondWithResult(_0x2a7c5f,_0x53bc11){_0x53bc11=_0x53bc11||0xc8;return function(_0x48fe71){if(_0x48fe71){return _0x2a7c5f[_0x878a('0x18')](_0x53bc11)['json'](_0x48fe71);}};}function respondWithFilteredResult(_0x3e0748,_0x54a1a9){return function(_0x3e0cba){if(_0x3e0cba){var _0x30156=typeof _0x54a1a9[_0x878a('0x1a')]==='undefined'&&typeof _0x54a1a9['limit']===_0x878a('0x1b');var _0x4ae850=_0x3e0cba[_0x878a('0x1c')];var _0x1e91e5=_0x30156?0x0:_0x54a1a9['offset'];var _0x24b50c=_0x30156?_0x3e0cba[_0x878a('0x1c')]:_0x54a1a9[_0x878a('0x1a')]+_0x54a1a9[_0x878a('0x1d')];var _0x1d9d7a;if(_0x24b50c>=_0x4ae850){_0x24b50c=_0x4ae850;_0x1d9d7a=0xc8;}else{_0x1d9d7a=0xce;}_0x3e0748[_0x878a('0x18')](_0x1d9d7a);return _0x3e0748[_0x878a('0x1e')](_0x878a('0x1f'),_0x1e91e5+'-'+_0x24b50c+'/'+_0x4ae850)['json'](_0x3e0cba);}return null;};}function patchUpdates(_0x2029c0){return function(_0x16264b){try{jsonpatch[_0x878a('0x20')](_0x16264b,_0x2029c0,!![]);}catch(_0x57809d){return BPromise['reject'](_0x57809d);}return _0x16264b[_0x878a('0x21')]();};}function saveUpdates(_0x4318af,_0x5a9392){return function(_0x124f61){if(_0x124f61){return _0x124f61['update'](_0x4318af)[_0x878a('0x22')](function(_0xe39928){return _0xe39928;});}return null;};}function removeEntity(_0x501caf,_0x57959e){return function(_0x339e30){if(_0x339e30){return _0x339e30['destroy']()['then'](function(){_0x501caf['status'](0xcc)[_0x878a('0x19')]();});}};}function handleEntityNotFound(_0x221097,_0x452e39){return function(_0x1b4524){if(!_0x1b4524){_0x221097[_0x878a('0x23')](0x194);}return _0x1b4524;};}function handleError(_0x4d83dc,_0x1877f4){_0x1877f4=_0x1877f4||0x1f4;return function(_0x200c7e){logger[_0x878a('0x24')](_0x200c7e[_0x878a('0x25')]);if(_0x200c7e[_0x878a('0x26')]){delete _0x200c7e[_0x878a('0x26')];}_0x4d83dc['status'](_0x1877f4)[_0x878a('0x27')](_0x200c7e);};}exports[_0x878a('0x28')]=function(_0x22041d,_0x20c0a3){var _0x279318={},_0x2b1248={},_0xa4ce4={'count':0x0,'rows':[]};var _0x1a20c4=_['map'](db[_0x878a('0x29')]['rawAttributes'],function(_0x4981ac){return{'name':_0x4981ac[_0x878a('0x2a')],'type':_0x4981ac[_0x878a('0x2b')][_0x878a('0x2c')]};});_0x2b1248[_0x878a('0x2d')]=_['map'](_0x1a20c4,'name');_0x2b1248[_0x878a('0x2e')]=_['keys'](_0x22041d[_0x878a('0x2e')]);_0x2b1248[_0x878a('0x2f')]=_[_0x878a('0x30')](_0x2b1248[_0x878a('0x2d')],_0x2b1248[_0x878a('0x2e')]);_0x279318['attributes']=_[_0x878a('0x30')](_0x2b1248[_0x878a('0x2d')],qs['fields'](_0x22041d[_0x878a('0x2e')][_0x878a('0x31')]));_0x279318[_0x878a('0x32')]=_0x279318['attributes'][_0x878a('0x33')]?_0x279318['attributes']:_0x2b1248[_0x878a('0x2d')];if(!_0x22041d[_0x878a('0x2e')][_0x878a('0x34')](_0x878a('0x35'))){_0x279318['limit']=qs[_0x878a('0x1d')](_0x22041d[_0x878a('0x2e')][_0x878a('0x1d')]);_0x279318[_0x878a('0x1a')]=qs[_0x878a('0x1a')](_0x22041d[_0x878a('0x2e')][_0x878a('0x1a')]);}_0x279318[_0x878a('0x36')]=qs['sort'](_0x22041d[_0x878a('0x2e')][_0x878a('0x37')]);_0x279318[_0x878a('0x38')]=qs[_0x878a('0x2f')](_[_0x878a('0x39')](_0x22041d[_0x878a('0x2e')],_0x2b1248['filters']),_0x1a20c4);if(_0x22041d['query'][_0x878a('0x3a')]){_0x279318[_0x878a('0x38')]=_[_0x878a('0x3b')](_0x279318[_0x878a('0x38')],{'$or':_[_0x878a('0x3c')](_0x1a20c4,function(_0x1da70c){if(_0x1da70c[_0x878a('0x2b')]!==_0x878a('0x3d')){var _0x718dd2={};_0x718dd2[_0x1da70c[_0x878a('0x26')]]={'$like':'%'+_0x22041d[_0x878a('0x2e')][_0x878a('0x3a')]+'%'};return _0x718dd2;}})});}_0x279318=_[_0x878a('0x3b')]({},_0x279318,_0x22041d['options']);var _0x4d6097={'where':_0x279318[_0x878a('0x38')]};return db[_0x878a('0x29')][_0x878a('0x1c')](_0x4d6097)[_0x878a('0x22')](function(_0x4bf956){_0xa4ce4['count']=_0x4bf956;if(_0x22041d[_0x878a('0x2e')]['includeAll']){_0x279318[_0x878a('0x3e')]=[{'all':!![]}];}return db[_0x878a('0x29')][_0x878a('0x3f')](_0x279318);})[_0x878a('0x22')](function(_0xb92028){_0xa4ce4['rows']=_0xb92028;return _0xa4ce4;})['then'](respondWithFilteredResult(_0x20c0a3,_0x279318))['catch'](handleError(_0x20c0a3,null));};exports[_0x878a('0x40')]=function(_0x35794a,_0x321f62){var _0x43c6a0={'raw':!![],'where':{'id':_0x35794a[_0x878a('0x41')]['id']}},_0x5074d9={};_0x5074d9['model']=_[_0x878a('0x42')](db[_0x878a('0x29')][_0x878a('0x43')]);_0x5074d9[_0x878a('0x2e')]=_[_0x878a('0x42')](_0x35794a[_0x878a('0x2e')]);_0x5074d9['filters']=_['intersection'](_0x5074d9['model'],_0x5074d9['query']);_0x43c6a0[_0x878a('0x32')]=_['intersection'](_0x5074d9[_0x878a('0x2d')],qs[_0x878a('0x31')](_0x35794a['query'][_0x878a('0x31')]));_0x43c6a0[_0x878a('0x32')]=_0x43c6a0[_0x878a('0x32')][_0x878a('0x33')]?_0x43c6a0[_0x878a('0x32')]:_0x5074d9[_0x878a('0x2d')];if(_0x35794a[_0x878a('0x2e')][_0x878a('0x44')]){_0x43c6a0[_0x878a('0x3e')]=[{'all':!![]}];}_0x43c6a0=_[_0x878a('0x3b')]({},_0x43c6a0,_0x35794a[_0x878a('0x45')]);return db[_0x878a('0x29')][_0x878a('0x46')](_0x43c6a0)[_0x878a('0x22')](handleEntityNotFound(_0x321f62,null))[_0x878a('0x22')](respondWithResult(_0x321f62,null))['catch'](handleError(_0x321f62,null));};exports[_0x878a('0x47')]=function(_0x228027,_0x423ade){return db['VoiceQueuesLog'][_0x878a('0x47')](_0x228027[_0x878a('0x48')],{})['then'](respondWithResult(_0x423ade,0xc9))['catch'](handleError(_0x423ade,null));};exports['update']=function(_0x7fe03c,_0x5cb76a){if(_0x7fe03c['body']['id']){delete _0x7fe03c[_0x878a('0x48')]['id'];}return db['VoiceQueuesLog'][_0x878a('0x46')]({'where':{'id':_0x7fe03c['params']['id']}})['then'](handleEntityNotFound(_0x5cb76a,null))['then'](saveUpdates(_0x7fe03c[_0x878a('0x48')],null))['then'](respondWithResult(_0x5cb76a,null))[_0x878a('0x49')](handleError(_0x5cb76a,null));};exports[_0x878a('0x4a')]=function(_0x3bed64,_0x2d1aad){return db['VoiceQueuesLog'][_0x878a('0x46')]({'where':{'id':_0x3bed64[_0x878a('0x41')]['id']}})[_0x878a('0x22')](handleEntityNotFound(_0x2d1aad,null))[_0x878a('0x22')](removeEntity(_0x2d1aad,null))['catch'](handleError(_0x2d1aad,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7fdb6b1..eaf17bc 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 _0xef98=['../../config/logger','api','bluebird','path','rimraf','exports','define','voice_queues_log','event_dtm','event'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0xef98,0x1c2));var _0x8ef9=function(_0x4a3513,_0x40bbe1){_0x4a3513=_0x4a3513-0x0;var _0x1c363f=_0xef98[_0x4a3513];return _0x1c363f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ef9('0x0'))(_0x8ef9('0x1'));var moment=require('moment');var BPromise=require(_0x8ef9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef9('0x3'));var rimraf=require(_0x8ef9('0x4'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x8ef9('0x5')]=function(_0x5df7ec,_0x1cab8c){return _0x5df7ec[_0x8ef9('0x6')]('VoiceQueuesLog',attributes,{'tableName':_0x8ef9('0x7'),'paranoid':![],'indexes':[{'name':_0x8ef9('0x8'),'fields':[_0x8ef9('0x9'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x4f82=['define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','bluebird','path','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x5544f9,_0x46b6e2){var _0x3aaa58=function(_0x4ee044){while(--_0x4ee044){_0x5544f9['push'](_0x5544f9['shift']());}};_0x3aaa58(++_0x46b6e2);}(_0x4f82,0xbc));var _0x24f8=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x4f82[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x24f8('0x0'));var util=require(_0x24f8('0x1'));var logger=require('../../config/logger')(_0x24f8('0x2'));var moment=require('moment');var BPromise=require(_0x24f8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24f8('0x4'));var rimraf=require('rimraf');var config=require(_0x24f8('0x5'));var attributes=require(_0x24f8('0x6'));module[_0x24f8('0x7')]=function(_0x3fc5d4,_0x53e9fb){return _0x3fc5d4[_0x24f8('0x8')](_0x24f8('0x9'),attributes,{'tableName':_0x24f8('0xa'),'paranoid':![],'indexes':[{'name':_0x24f8('0xb'),'fields':[_0x24f8('0xc'),_0x24f8('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 119adcc..4fd4808 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 _0x357b=['util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1c6869,_0x186f3e){var _0x5061fc=function(_0x3ed167){while(--_0x3ed167){_0x1c6869['push'](_0x1c6869['shift']());}};_0x5061fc(++_0x186f3e);}(_0x357b,0x164));var _0xb357=function(_0xe81c53,_0x4b0240){_0xe81c53=_0xe81c53-0x0;var _0x4e4725=_0x357b[_0xe81c53];return _0x4e4725;};'use strict';var _=require(_0xb357('0x0'));var util=require(_0xb357('0x1'));var moment=require('moment');var BPromise=require(_0xb357('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb357('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb357('0x4'));var logger=require('../../config/logger')(_0xb357('0x5'));var config=require(_0xb357('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb357('0x7')][_0xb357('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17fd6e,_0x40cc01,_0x4d1f38){return new BPromise(function(_0xe9f645,_0x112f80){return client[_0xb357('0x9')](_0x17fd6e,_0x4d1f38)[_0xb357('0xa')](function(_0x2d8e49){logger[_0xb357('0xb')](_0xb357('0xc'),_0x40cc01,_0xb357('0xd'));logger['debug'](_0xb357('0xe'),_0x40cc01,'request\x20sent',JSON[_0xb357('0xf')](_0x2d8e49));if(_0x2d8e49['error']){if(_0x2d8e49[_0xb357('0x10')][_0xb357('0x11')]===0x1f4){logger[_0xb357('0x10')](_0xb357('0xc'),_0x40cc01,_0x2d8e49[_0xb357('0x10')][_0xb357('0x12')]);return _0x112f80(_0x2d8e49[_0xb357('0x10')]['message']);}logger[_0xb357('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x40cc01,_0x2d8e49[_0xb357('0x10')][_0xb357('0x12')]);return _0xe9f645(_0x2d8e49[_0xb357('0x10')][_0xb357('0x12')]);}else{logger['info'](_0xb357('0xc'),_0x40cc01,_0xb357('0xd'));_0xe9f645(_0x2d8e49[_0xb357('0x13')][_0xb357('0x12')]);}})[_0xb357('0x14')](function(_0x5ded98){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x40cc01,_0x5ded98);_0x112f80(_0x5ded98);});});} \ No newline at end of file +var _0xed65=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xed65,0xd6));var _0x5ed6=function(_0x3ba2a3,_0x34d0ba){_0x3ba2a3=_0x3ba2a3-0x0;var _0x2d0e38=_0xed65[_0x3ba2a3];return _0x2d0e38;};'use strict';var _=require('lodash');var util=require(_0x5ed6('0x0'));var moment=require(_0x5ed6('0x1'));var BPromise=require(_0x5ed6('0x2'));var rs=require(_0x5ed6('0x3'));var fs=require('fs');var Redis=require(_0x5ed6('0x4'));var db=require(_0x5ed6('0x5'))['db'];var utils=require(_0x5ed6('0x6'));var logger=require(_0x5ed6('0x7'))(_0x5ed6('0x8'));var config=require(_0x5ed6('0x9'));var jayson=require(_0x5ed6('0xa'));var client=jayson[_0x5ed6('0xb')][_0x5ed6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x204667,_0x174cba,_0xee556c){return new BPromise(function(_0x5327e1,_0x23ffd6){return client['request'](_0x204667,_0xee556c)[_0x5ed6('0xd')](function(_0x206553){logger[_0x5ed6('0xe')](_0x5ed6('0xf'),_0x174cba,'request\x20sent');logger['debug'](_0x5ed6('0x10'),_0x174cba,_0x5ed6('0x11'),JSON['stringify'](_0x206553));if(_0x206553[_0x5ed6('0x12')]){if(_0x206553[_0x5ed6('0x12')][_0x5ed6('0x13')]===0x1f4){logger[_0x5ed6('0x12')](_0x5ed6('0xf'),_0x174cba,_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);return _0x23ffd6(_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);}logger[_0x5ed6('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x174cba,_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);return _0x5327e1(_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);}else{logger['info'](_0x5ed6('0xf'),_0x174cba,_0x5ed6('0x11'));_0x5327e1(_0x206553[_0x5ed6('0x15')]['message']);}})[_0x5ed6('0x16')](function(_0x540c97){logger[_0x5ed6('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x174cba,_0x540c97);_0x23ffd6(_0x540c97);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7449283..31e1188 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 _0x0703=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','put','update','delete','destroy','exports'];(function(_0x467599,_0x10804a){var _0x4ae44c=function(_0x17b1f6){while(--_0x17b1f6){_0x467599['push'](_0x467599['shift']());}};_0x4ae44c(++_0x10804a);}(_0x0703,0x1b0));var _0x3070=function(_0x7c1a77,_0x1cefe3){_0x7c1a77=_0x7c1a77-0x0;var _0x3496d7=_0x0703[_0x7c1a77];return _0x3496d7;};'use strict';var multer=require(_0x3070('0x0'));var util=require(_0x3070('0x1'));var path=require(_0x3070('0x2'));var timeout=require(_0x3070('0x3'));var express=require(_0x3070('0x4'));var router=express[_0x3070('0x5')]();var fs_extra=require(_0x3070('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3070('0x7'));var controller=require(_0x3070('0x8'));router[_0x3070('0x9')]('/',auth[_0x3070('0xa')](),controller[_0x3070('0xb')]);router[_0x3070('0x9')]('/describe',auth[_0x3070('0xa')](),controller[_0x3070('0xc')]);router[_0x3070('0x9')](_0x3070('0xd'),auth[_0x3070('0xa')](),controller[_0x3070('0xe')]);router[_0x3070('0x9')](_0x3070('0xf'),auth[_0x3070('0xa')](),controller[_0x3070('0x10')]);router[_0x3070('0x9')](_0x3070('0x11'),controller[_0x3070('0x12')]);router[_0x3070('0x9')](_0x3070('0x13'),auth[_0x3070('0xa')](),controller['downloadTranscribe']);router[_0x3070('0x14')]('/',auth[_0x3070('0xa')](),controller['create']);router[_0x3070('0x14')](_0x3070('0x13'),auth['isAuthenticated'](),controller[_0x3070('0x15')]);router[_0x3070('0x16')](_0x3070('0xd'),auth['isAuthenticated'](),controller[_0x3070('0x17')]);router[_0x3070('0x18')](_0x3070('0xd'),auth[_0x3070('0xa')](),controller[_0x3070('0x19')]);module[_0x3070('0x1a')]=router; \ No newline at end of file +var _0x288e=['/:id/download','download','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show'];(function(_0x179f19,_0x3f7af3){var _0x3fee80=function(_0x204d97){while(--_0x204d97){_0x179f19['push'](_0x179f19['shift']());}};_0x3fee80(++_0x3f7af3);}(_0x288e,0xbd));var _0xe288=function(_0x180032,_0x33e01b){_0x180032=_0x180032-0x0;var _0x124265=_0x288e[_0x180032];return _0x124265;};'use strict';var multer=require(_0xe288('0x0'));var util=require(_0xe288('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe288('0x2')]();var fs_extra=require(_0xe288('0x3'));var auth=require(_0xe288('0x4'));var interaction=require(_0xe288('0x5'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xe288('0x6')]('/',auth[_0xe288('0x7')](),controller[_0xe288('0x8')]);router['get'](_0xe288('0x9'),auth[_0xe288('0x7')](),controller['describe']);router[_0xe288('0x6')]('/:id',auth[_0xe288('0x7')](),controller[_0xe288('0xa')]);router[_0xe288('0x6')](_0xe288('0xb'),auth[_0xe288('0x7')](),controller[_0xe288('0xc')]);router['get']('/:id/downloads',controller[_0xe288('0xd')]);router[_0xe288('0x6')]('/:id/transcribe',auth[_0xe288('0x7')](),controller[_0xe288('0xe')]);router[_0xe288('0xf')]('/',auth[_0xe288('0x7')](),controller[_0xe288('0x10')]);router[_0xe288('0xf')](_0xe288('0x11'),auth[_0xe288('0x7')](),controller[_0xe288('0x12')]);router[_0xe288('0x13')](_0xe288('0x14'),auth[_0xe288('0x7')](),controller[_0xe288('0x15')]);router[_0xe288('0x16')](_0xe288('0x14'),auth['isAuthenticated'](),controller[_0xe288('0x17')]);module[_0xe288('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index f30febf..0f626dd 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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_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(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 e7b959b..328226b 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 _0x708a=['include','findAll','rows','show','params','length','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','eml-format','rimraf','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x436a28,_0x9cb9f4){var _0x53949f=function(_0x285690){while(--_0x285690){_0x436a28['push'](_0x436a28['shift']());}};_0x53949f(++_0x9cb9f4);}(_0x708a,0x185));var _0xa708=function(_0xa5ded9,_0x2ccdbc){_0xa5ded9=_0xa5ded9-0x0;var _0x3c48fe=_0x708a[_0xa5ded9];return _0x3c48fe;};'use strict';var emlformat=require(_0xa708('0x0'));var rimraf=require(_0xa708('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa708('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa708('0x3'));var path=require(_0xa708('0x4'));var sox=require(_0xa708('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa708('0x6'));var _=require(_0xa708('0x7'));var squel=require(_0xa708('0x8'));var crypto=require(_0xa708('0x9'));var jsforce=require(_0xa708('0xa'));var deskjs=require(_0xa708('0xb'));var toCsv=require(_0xa708('0xc'));var querystring=require('querystring');var Papa=require(_0xa708('0xd'));var AWS=require(_0xa708('0xe'));var uuidv4=require(_0xa708('0xf'));var Redis=require('ioredis');var authService=require(_0xa708('0x10'));var qs=require(_0xa708('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa708('0x12'));var logger=require(_0xa708('0x13'))(_0xa708('0x14'));var utils=require(_0xa708('0x15'));var config=require(_0xa708('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa708('0x17'))['db'];function respondWithStatusCode(_0x393b1a,_0x4a31a6){_0x4a31a6=_0x4a31a6||0xcc;return function(_0x22a798){if(_0x22a798){return _0x393b1a['sendStatus'](_0x4a31a6);}return _0x393b1a[_0xa708('0x18')](_0x4a31a6)[_0xa708('0x19')]();};}function respondWithResult(_0x5a3381,_0x37e0bc){_0x37e0bc=_0x37e0bc||0xc8;return function(_0x994776){if(_0x994776){return _0x5a3381[_0xa708('0x18')](_0x37e0bc)[_0xa708('0x1a')](_0x994776);}};}function respondWithFilteredResult(_0x5f336c,_0x31ef0d){return function(_0x166bd6){if(_0x166bd6){var _0x539ce3=typeof _0x31ef0d['offset']===_0xa708('0x1b')&&typeof _0x31ef0d[_0xa708('0x1c')]==='undefined';var _0x54c1b6=_0x166bd6[_0xa708('0x1d')];var _0x1af0dc=_0x539ce3?0x0:_0x31ef0d[_0xa708('0x1e')];var _0x5e4da5=_0x539ce3?_0x166bd6['count']:_0x31ef0d[_0xa708('0x1e')]+_0x31ef0d[_0xa708('0x1c')];var _0x563455;if(_0x5e4da5>=_0x54c1b6){_0x5e4da5=_0x54c1b6;_0x563455=0xc8;}else{_0x563455=0xce;}_0x5f336c['status'](_0x563455);return _0x5f336c[_0xa708('0x1f')](_0xa708('0x20'),_0x1af0dc+'-'+_0x5e4da5+'/'+_0x54c1b6)[_0xa708('0x1a')](_0x166bd6);}return null;};}function patchUpdates(_0x1ab032){return function(_0xe54d04){try{jsonpatch[_0xa708('0x21')](_0xe54d04,_0x1ab032,!![]);}catch(_0x4ce7d0){return BPromise[_0xa708('0x22')](_0x4ce7d0);}return _0xe54d04[_0xa708('0x23')]();};}function saveUpdates(_0xe1332e,_0x215180){return function(_0x468d65){if(_0x468d65){return _0x468d65[_0xa708('0x24')](_0xe1332e)[_0xa708('0x25')](function(_0x2343a0){return _0x2343a0;});}return null;};}function removeEntity(_0x2ddf22,_0x2ab185){return function(_0x8e0c46){if(_0x8e0c46){return _0x8e0c46['destroy']()[_0xa708('0x25')](function(){_0x2ddf22[_0xa708('0x18')](0xcc)[_0xa708('0x19')]();});}};}function handleEntityNotFound(_0xc7bcc0,_0x58fc7c){return function(_0x47e830){if(!_0x47e830){_0xc7bcc0['sendStatus'](0x194);}return _0x47e830;};}function handleError(_0x3486f9,_0x39f710){_0x39f710=_0x39f710||0x1f4;return function(_0x2956e6){logger['error'](_0x2956e6[_0xa708('0x26')]);if(_0x2956e6[_0xa708('0x27')]){delete _0x2956e6[_0xa708('0x27')];}_0x3486f9[_0xa708('0x18')](_0x39f710)[_0xa708('0x28')](_0x2956e6);};}exports[_0xa708('0x29')]=function(_0x5d387d,_0x9aa127){var _0x35b7ec={},_0xa7a091={},_0x16c1b9={'count':0x0,'rows':[]};var _0x222590=_[_0xa708('0x2a')](db[_0xa708('0x2b')][_0xa708('0x2c')],function(_0x330143){return{'name':_0x330143[_0xa708('0x2d')],'type':_0x330143[_0xa708('0x2e')][_0xa708('0x2f')]};});_0xa7a091[_0xa708('0x30')]=_[_0xa708('0x31')](_[_0xa708('0x2a')](_0x222590,_0xa708('0x27')),[_0xa708('0x32')]);_0xa7a091[_0xa708('0x33')]=_[_0xa708('0x34')](_0x5d387d[_0xa708('0x33')]);_0xa7a091[_0xa708('0x35')]=_[_0xa708('0x36')](_0xa7a091['model'],_0xa7a091['query']);_0x35b7ec[_0xa708('0x37')]=_[_0xa708('0x36')](_0xa7a091['model'],qs[_0xa708('0x38')](_0x5d387d[_0xa708('0x33')][_0xa708('0x38')]));_0x35b7ec['attributes']=_0x35b7ec[_0xa708('0x37')]['length']?_0x35b7ec[_0xa708('0x37')]:_0xa7a091[_0xa708('0x30')];if(!_0x5d387d[_0xa708('0x33')]['hasOwnProperty'](_0xa708('0x39'))){_0x35b7ec[_0xa708('0x1c')]=qs[_0xa708('0x1c')](_0x5d387d[_0xa708('0x33')][_0xa708('0x1c')]);_0x35b7ec[_0xa708('0x1e')]=qs[_0xa708('0x1e')](_0x5d387d['query'][_0xa708('0x1e')]);}_0x35b7ec[_0xa708('0x3a')]=qs[_0xa708('0x3b')](_0x5d387d[_0xa708('0x33')][_0xa708('0x3b')]);_0x35b7ec[_0xa708('0x3c')]=qs['filters'](_[_0xa708('0x3d')](_0x5d387d['query'],_0xa7a091[_0xa708('0x35')]),_0x222590);if(_0x5d387d[_0xa708('0x33')]['filter']){_0x35b7ec[_0xa708('0x3c')]=_[_0xa708('0x3e')](_0x35b7ec[_0xa708('0x3c')],{'$or':_[_0xa708('0x2a')](_0x222590,function(_0x590a64){if(_0x590a64['type']!==_0xa708('0x3f')){var _0x1070a6={};_0x1070a6[_0x590a64[_0xa708('0x27')]]={'$like':'%'+_0x5d387d[_0xa708('0x33')][_0xa708('0x40')]+'%'};return _0x1070a6;}})});}_0x35b7ec=_[_0xa708('0x3e')]({},_0x35b7ec,_0x5d387d[_0xa708('0x41')]);var _0x470f24={'where':_0x35b7ec['where']};return db[_0xa708('0x2b')][_0xa708('0x1d')](_0x470f24)[_0xa708('0x25')](function(_0x13347c){_0x16c1b9[_0xa708('0x1d')]=_0x13347c;if(_0x5d387d[_0xa708('0x33')][_0xa708('0x42')]){_0x35b7ec[_0xa708('0x43')]=[{'all':!![]}];}return db[_0xa708('0x2b')][_0xa708('0x44')](_0x35b7ec);})['then'](function(_0x4e509b){_0x16c1b9[_0xa708('0x45')]=_0x4e509b;return _0x16c1b9;})[_0xa708('0x25')](respondWithFilteredResult(_0x9aa127,_0x35b7ec))['catch'](handleError(_0x9aa127,null));};exports[_0xa708('0x46')]=function(_0x4e1490,_0x47fdd6){var _0x44a412={'raw':![],'where':{'id':_0x4e1490[_0xa708('0x47')]['id']}},_0x2044a1={};_0x2044a1[_0xa708('0x30')]=_[_0xa708('0x34')](db['VoiceRecording'][_0xa708('0x2c')]);_0x2044a1[_0xa708('0x33')]=_[_0xa708('0x34')](_0x4e1490[_0xa708('0x33')]);_0x2044a1[_0xa708('0x35')]=_[_0xa708('0x36')](_0x2044a1[_0xa708('0x30')],_0x2044a1['query']);_0x44a412[_0xa708('0x37')]=_[_0xa708('0x36')](_0x2044a1[_0xa708('0x30')],qs[_0xa708('0x38')](_0x4e1490[_0xa708('0x33')][_0xa708('0x38')]));_0x44a412['attributes']=_0x44a412[_0xa708('0x37')][_0xa708('0x48')]?_0x44a412[_0xa708('0x37')]:_0x2044a1[_0xa708('0x30')];if(_0x4e1490[_0xa708('0x33')][_0xa708('0x42')]){_0x44a412[_0xa708('0x43')]=[{'all':!![]}];}_0x44a412=_[_0xa708('0x3e')]({},_0x44a412,_0x4e1490[_0xa708('0x41')]);return db[_0xa708('0x2b')][_0xa708('0x49')](_0x44a412)[_0xa708('0x25')](handleEntityNotFound(_0x47fdd6,null))[_0xa708('0x25')](respondWithResult(_0x47fdd6,null))[_0xa708('0x4a')](handleError(_0x47fdd6,null));};exports[_0xa708('0x4b')]=function(_0x5c8f38,_0x3b9e7a){return db[_0xa708('0x2b')][_0xa708('0x4b')](_0x5c8f38['body'],{})['then'](respondWithResult(_0x3b9e7a,0xc9))[_0xa708('0x4a')](handleError(_0x3b9e7a,null));};exports['update']=function(_0x3c5cf3,_0x32cbfc){if(_0x3c5cf3[_0xa708('0x4c')]['id']){delete _0x3c5cf3[_0xa708('0x4c')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x3c5cf3['params']['id']}})[_0xa708('0x25')](handleEntityNotFound(_0x32cbfc,null))[_0xa708('0x25')](saveUpdates(_0x3c5cf3['body'],null))['then'](respondWithResult(_0x32cbfc,null))[_0xa708('0x4a')](handleError(_0x32cbfc,null));};exports[_0xa708('0x4d')]=function(_0x5f42b6,_0x24e164){return db[_0xa708('0x2b')][_0xa708('0x4d')]()[_0xa708('0x25')](respondWithResult(_0x24e164,null))['catch'](handleError(_0x24e164,null));};exports[_0xa708('0x4e')]=function(_0x19615a,_0x1c18ac,_0x2f0a8f){var _0x43d599=require(_0xa708('0x4f'));var _0x470109=![];var _0x36ed15={};if(_0x19615a[_0xa708('0x33')][_0xa708('0x2e')]&&_0x19615a[_0xa708('0x33')]['type']===_0xa708('0x50')){_0x36ed15['uniqueid']=_0x19615a['params']['id'];}else{_0x36ed15['id']=_0x19615a[_0xa708('0x47')]['id'];}return db[_0xa708('0x2b')]['find']({'where':_0x36ed15,'attributes':['id',_0xa708('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1c18ac,null))['then'](function(_0x4dde29){if(_0x4dde29){var _0x1cb3d3=_0x4dde29[_0xa708('0x51')];var _0x144548=util['format']('%s.cypher',_0x1cb3d3);if(fs[_0xa708('0x52')](_0x144548)){_0x470109=!![];return _0x43d599[_0xa708('0x53')](_0x144548,_0x1cb3d3,config['secrets'][_0xa708('0x54')])[_0xa708('0x25')](function(){return _0x4dde29;});}return _0x4dde29;}})[_0xa708('0x25')](function(_0x19d0eb){if(_0x19d0eb){var _0x1c3b20=_0x19d0eb[_0xa708('0x51')];if(!fs[_0xa708('0x52')](_0x1c3b20)){throw new db[(_0xa708('0x55'))][(_0xa708('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x19d0eb[_0xa708('0x57')]){return _0x1c18ac[_0xa708('0x4e')](_0x1c3b20,_0x19d0eb[_0xa708('0x57')]+path[_0xa708('0x58')](_0x1c3b20),function(){if(_0x470109){fs[_0xa708('0x59')](_0x1c3b20);}});}else{return _0x1c18ac[_0xa708('0x4e')](_0x1c3b20,function(_0x282c2f){if(_0x470109){fs['unlink'](_0x1c3b20);}});}}})[_0xa708('0x4a')](function(_0x13a857){if(_0x13a857[_0xa708('0x5a')]===_0xa708('0x5b')){_0x1c18ac[_0xa708('0x18')](0x194)['send'](_0xa708('0x5c'));}else{return handleError(_0x1c18ac,null);}});};exports[_0xa708('0x5d')]=function(_0x5b9807,_0x484b3d,_0x530b88){var _0x8808ca=require(_0xa708('0x4f'));var _0x4ef321=![];var _0x367cd4={'$and':[db[_0xa708('0x5e')][_0xa708('0x3c')](db[_0xa708('0x5e')]['fn'](_0xa708('0x5f'),db[_0xa708('0x5e')][_0xa708('0x60')]('uniqueid')),_0x5b9807['query']['token'])]};if(_0x5b9807[_0xa708('0x33')]['type']&&_0x5b9807[_0xa708('0x33')][_0xa708('0x2e')]==='uniqueid'){_0x367cd4[_0xa708('0x61')][_0xa708('0x62')]({'uniqueid':_0x5b9807[_0xa708('0x47')]['id']});}else{_0x367cd4[_0xa708('0x61')]['push']({'id':_0x5b9807[_0xa708('0x47')]['id']});}return db['VoiceRecording'][_0xa708('0x49')]({'where':_0x367cd4,'attributes':['id',_0xa708('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x484b3d,null))[_0xa708('0x25')](function(_0x4d8219){if(_0x4d8219){var _0x503569=util[_0xa708('0x32')](_0xa708('0x63'),_0x4d8219[_0xa708('0x51')]);if(fs[_0xa708('0x52')](_0x503569)){_0x4ef321=!![];return _0x8808ca[_0xa708('0x53')](_0x503569,_0x4d8219[_0xa708('0x51')],config['secrets'][_0xa708('0x54')])[_0xa708('0x25')](function(){return _0x4d8219;});}return _0x4d8219;}})[_0xa708('0x25')](function(_0x15129d){if(_0x15129d){if(!fs[_0xa708('0x52')](_0x15129d[_0xa708('0x51')])){throw new db[(_0xa708('0x55'))][(_0xa708('0x56'))](_0xa708('0x5b'));}if(_0x15129d[_0xa708('0x57')]){return _0x484b3d['download'](_0x15129d[_0xa708('0x51')],_0x15129d[_0xa708('0x57')]+path[_0xa708('0x58')](_0x15129d['value']),function(){if(_0x4ef321){fs[_0xa708('0x59')](_0x15129d['value']);}});}else{return _0x484b3d[_0xa708('0x4e')](_0x15129d[_0xa708('0x51')],function(_0x537ff6){if(_0x4ef321){fs[_0xa708('0x59')](_0x15129d[_0xa708('0x51')]);}});}}})[_0xa708('0x4a')](handleError(_0x484b3d,null));};exports[_0xa708('0x64')]=function(_0x19ae0a,_0x21d253){return db[_0xa708('0x2b')][_0xa708('0x49')]({'where':{'id':_0x19ae0a[_0xa708('0x47')]['id']}})[_0xa708('0x25')](function(_0x321cec){if(_[_0xa708('0x65')](_0x321cec)){throw new ReferenceError(_0xa708('0x66'));}return _0x321cec;})[_0xa708('0x25')](function(_0xe9b182){var _0x944833=_0xe9b182[_0xa708('0x51')];logger[_0xa708('0x67')](_0xa708('0x68'),_0x944833);if(!_[_0xa708('0x65')](_0xe9b182[_0xa708('0x51')])&&fs[_0xa708('0x52')](_0x944833)){logger[_0xa708('0x67')](_0xa708('0x69')+_0x944833+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa708('0x6a')](_0x944833);}_0x944833=_0x944833+_0xa708('0x6b');if(!_[_0xa708('0x65')](_0xe9b182['value'])&&fs[_0xa708('0x52')](_0x944833)){logger['info'](_0xa708('0x69')+_0x944833+_0xa708('0x6c'));fs[_0xa708('0x6a')](_0x944833);}return _0xe9b182;})[_0xa708('0x25')](function(_0x26066d){if(!_0x26066d)throw new InternalError();return _0x26066d['destroy']();})[_0xa708('0x25')](function(){_0x21d253['status'](0xcc)[_0xa708('0x19')]();})[_0xa708('0x4a')](handleError(_0x21d253,null));};function getBucketslist(_0x2e7feb,_0x35a960,_0x122d5b){return new Promise(function(_0x5aaafd,_0x5094d7){var _0x41a3e5=new AWS['S3']({'accessKeyId':_0x35a960,'secretAccessKey':_0x2e7feb,'region':_0x122d5b});_0x41a3e5[_0xa708('0x6d')]({},function(_0x2bdbea,_0x2a4b98){if(_0x2bdbea){return _0x5094d7(_0x2bdbea);}else{return _0x5aaafd(_0x2a4b98);}});});}function createBucket(_0xa6d622,_0x3b5b4d,_0x2ba548,_0x10a4a3){return new Promise(function(_0x28774c,_0x50b44a){var _0x260fb1=new AWS['S3']({'accessKeyId':_0x3b5b4d,'secretAccessKey':_0xa6d622,'region':_0x2ba548});_0x260fb1[_0xa708('0x6e')]({'Bucket':_0x10a4a3},function(_0x4ed50c,_0x2b7bb9){if(_0x4ed50c){return _0x50b44a(_0x4ed50c);}else{return _0x28774c(_0x2b7bb9);}});});}function uploadFile(_0x2948ce,_0x2062c1,_0x23427f,_0x3e0e33,_0x5a5495,_0x223f49){return new Promise(function(_0x3365d7,_0x398ff6){var _0x2c5d30=new AWS['S3']({'accessKeyId':_0x2062c1,'secretAccessKey':_0x2948ce,'region':_0x23427f});_0x2c5d30[_0xa708('0x6f')]({'Bucket':_0x3e0e33,'Key':_0x5a5495,'Body':_0x223f49},function(_0x3978e5,_0x46931b){if(_0x3978e5){return _0x398ff6(_0x3978e5);}else{return _0x3365d7(_0x46931b);}});});}function startTranscribe(_0x48b95e,_0x197df3,_0x563d9b,_0x40eec3,_0xd9a81e,_0x2743de){return new Promise(function(_0x15eedf,_0x1b3138){var _0x16d3b5=new AWS[(_0xa708('0x70'))]({'accessKeyId':_0x197df3,'secretAccessKey':_0x48b95e,'region':_0x563d9b});_0x16d3b5[_0xa708('0x71')]({'TranscriptionJobName':_0x40eec3,'LanguageCode':_0xd9a81e,'Media':{'MediaFileUri':_0x2743de}},function(_0x413044,_0x5b6f08){if(_0x413044){return _0x1b3138(_0x413044);}else{return _0x15eedf(_0x5b6f08);}});});}function transcribe(_0x49de06,_0x1a0fc1,_0x13b9c1,_0x3412f0,_0x1d1d3c,_0x2913dc,_0x3da017){return new Promise(function(_0x4c095c,_0x3a0a4c){var _0x1dec22={};logger[_0xa708('0x67')](util[_0xa708('0x32')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x49de06,_0x1d1d3c));return uploadFile(_0x1a0fc1,_0x13b9c1,_0x3412f0,_0x1d1d3c,path[_0xa708('0x72')](_0x2913dc),fs[_0xa708('0x73')](_0x2913dc))[_0xa708('0x25')](function(_0x2d0e60){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x49de06,_0x1d1d3c,_0x2d0e60['Location']));_0x1dec22[_0xa708('0x74')]=_0x2d0e60['Bucket'];_0x1dec22[_0xa708('0x75')]=_0x2d0e60[_0xa708('0x76')];logger[_0xa708('0x67')](util[_0xa708('0x32')](_0xa708('0x77'),_0x49de06));return startTranscribe(_0x1a0fc1,_0x13b9c1,_0x3412f0,uuidv4(),_0x3da017,_0x2d0e60['Location']);})[_0xa708('0x25')](function(_0x150d1f){logger['info'](util['format'](_0xa708('0x78'),_0x49de06,_0x150d1f[_0xa708('0x79')][_0xa708('0x7a')]));_0x1dec22[_0xa708('0x7b')]=_0x150d1f[_0xa708('0x79')]['TranscriptionJobName'];_0x1dec22['transcribeStatus']=_0x150d1f[_0xa708('0x79')][_0xa708('0x7c')];return _0x4c095c(_0x1dec22);})[_0xa708('0x4a')](function(_0x5642c6){return _0x3a0a4c(_0x5642c6);});});}exports[_0xa708('0x7d')]=function(_0x23b8cd,_0x1493d6,_0xdfb3f5){var _0x5a68fc;var _0xf608b7;var _0x524d10;var _0x18281f=require(_0xa708('0x4f'));return db[_0xa708('0x2b')][_0xa708('0x7e')]({'where':{'id':_0x23b8cd['params']['id']}})['then'](function(_0x1efcb4){if(_0x1efcb4){var _0x1de121=util[_0xa708('0x32')](_0xa708('0x63'),_0x1efcb4[_0xa708('0x51')]);if(fs[_0xa708('0x52')](_0x1de121)){cypher=!![];return _0x18281f['decryptFile'](_0x1de121,_0x1efcb4[_0xa708('0x51')],config['secrets']['recording'])[_0xa708('0x25')](function(){return _0x1efcb4;});}return _0x1efcb4;}})[_0xa708('0x25')](function(_0x1300a4){if(!_0x1300a4){throw new db[(_0xa708('0x55'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0xf608b7=_0x1300a4;return db[_0xa708('0x7f')][_0xa708('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x1493d6,null))['then'](function(_0x52a121){if(_0x52a121){_0x5a68fc=_0x52a121;if(!_0x5a68fc[_0xa708('0x80')]||!_0x5a68fc[_0xa708('0x81')]||!_0x5a68fc[_0xa708('0x82')]||!_0x5a68fc['language']||!_0x5a68fc[_0xa708('0x74')]){throw new db['Sequelize']['ValidationError'](_0xa708('0x83'));}if(_0x23b8cd[_0xa708('0x4c')][_0xa708('0x84')]&&(!_0x5a68fc['sentiment']||!_0x5a68fc[_0xa708('0x85')]||!_0x5a68fc[_0xa708('0x86')]||!_0x5a68fc[_0xa708('0x87')]||!_0x5a68fc['bucket'])){throw new db[(_0xa708('0x55'))][(_0xa708('0x56'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xa708('0x88')][_0xa708('0x7e')]({'where':{'id':_0x5a68fc[_0xa708('0x81')]}});}})['then'](function(_0x355d7a){if(!_0x355d7a){throw new db[(_0xa708('0x55'))]['ValidationError'](_0xa708('0x89'));}if(!_0x355d7a[_0xa708('0x8a')]||!_0x355d7a['data2']){throw new db['Sequelize'][(_0xa708('0x56'))]('Cloud\x20Provider\x20not\x20configured');}_0x524d10=_0x355d7a;return getBucketslist(_0x524d10['data1'],_0x524d10['data2'],_0x5a68fc['transcribeRegion']);})[_0xa708('0x25')](function(_0x2589e6){if(_0x2589e6&&_0x2589e6[_0xa708('0x8b')]){var _0x1afeb7=_['find'](_0x2589e6[_0xa708('0x8b')],function(_0x38633a){return _0x38633a['Name']===_0x5a68fc[_0xa708('0x74')];});if(!_0x1afeb7){logger[_0xa708('0x67')](util[_0xa708('0x32')](_0xa708('0x8c'),_0x23b8cd[_0xa708('0x47')]['id'],_0x5a68fc[_0xa708('0x74')]));return createBucket(_0x524d10[_0xa708('0x8a')],_0x524d10[_0xa708('0x8d')],_0x5a68fc[_0xa708('0x82')],_0x5a68fc['bucket']);}logger[_0xa708('0x67')](util['format'](_0xa708('0x8e'),_0x23b8cd[_0xa708('0x47')]['id'],_0x5a68fc[_0xa708('0x74')]));return;}})[_0xa708('0x25')](function(_0x28aa4e){if(_0xf608b7[_0xa708('0x8f')]===_0xa708('0x90')){return transcribe(_0x23b8cd['params']['id'],_0x524d10[_0xa708('0x8a')],_0x524d10[_0xa708('0x8d')],_0x5a68fc[_0xa708('0x82')],_0x5a68fc[_0xa708('0x74')],_0xf608b7[_0xa708('0x51')],_0x5a68fc[_0xa708('0x87')]);}else{logger[_0xa708('0x67')](util[_0xa708('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x23b8cd[_0xa708('0x47')]['id']));return{'transcribeStatus':_0xa708('0x91')};}})[_0xa708('0x25')](function(_0x359a9b){if(_0x359a9b){_0x359a9b[_0xa708('0x92')]=_0x23b8cd[_0xa708('0x4c')][_0xa708('0x84')];return _0xf608b7[_0xa708('0x93')](_0x359a9b);}})[_0xa708('0x25')](respondWithResult(_0x1493d6,null))[_0xa708('0x4a')](handleError(_0x1493d6,null));};function writeFile(_0x35e245,_0x1bda8e){return new Promise(function(_0x1b7249,_0x491b3c){fs[_0xa708('0x94')](_0x1bda8e,_0x35e245,function(_0x4d8cdd,_0xdf5469){if(_0x4d8cdd){return _0x491b3c(_0x4d8cdd);}else{return _0x1b7249(_0xdf5469);}});});}exports['downloadTranscribe']=function(_0x3040c0,_0x174aa8,_0x3bb916){return db[_0xa708('0x2b')][_0xa708('0x7e')]({'where':{'id':_0x3040c0[_0xa708('0x47')]['id']}})['then'](handleEntityNotFound(_0x174aa8))[_0xa708('0x25')](function(_0x1452b3){if(_0x1452b3&&_0x1452b3[_0xa708('0x95')]){var _0x1a9c90=_0x1452b3['fileText'];var _0x12042f=config[_0xa708('0x96')]+_0xa708('0x97')+_0x1452b3['id']+'.txt';if(fs['existsSync'](_0x12042f)){return _0x12042f;}return writeFile(_0x1a9c90,_0x12042f)[_0xa708('0x25')](function(){return _0x12042f;});}else{throw new db[(_0xa708('0x55'))][(_0xa708('0x56'))]('Transcript\x20not\x20available');}})[_0xa708('0x25')](function(_0x1d266d){return _0x174aa8[_0xa708('0x4e')](_0x1d266d);})[_0xa708('0x4a')](handleError(_0x174aa8));}; \ No newline at end of file +var _0x6001=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','download','../../components/encryptor','type','uniqueid','value','%s.cypher','existsSync','secrets','recording','filename','extname','unlink','downloads','sequelize','MD5','col','$and','push','decryptFile','Sequelize','ValidationError','VoiceRecording\x20not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6001,0x11e));var _0x1600=function(_0x31548e,_0x590a05){_0x31548e=_0x31548e-0x0;var _0x201187=_0x6001[_0x31548e];return _0x201187;};'use strict';var emlformat=require(_0x1600('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1600('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1600('0x2'));var moment=require(_0x1600('0x3'));var BPromise=require(_0x1600('0x4'));var Mustache=require(_0x1600('0x5'));var util=require(_0x1600('0x6'));var path=require(_0x1600('0x7'));var sox=require(_0x1600('0x8'));var csv=require(_0x1600('0x9'));var ejs=require(_0x1600('0xa'));var fs=require('fs');var fs_extra=require(_0x1600('0xb'));var _=require(_0x1600('0xc'));var squel=require(_0x1600('0xd'));var crypto=require(_0x1600('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1600('0x9'));var querystring=require('querystring');var Papa=require(_0x1600('0xf'));var AWS=require(_0x1600('0x10'));var uuidv4=require(_0x1600('0x11'));var Redis=require('ioredis');var authService=require(_0x1600('0x12'));var qs=require(_0x1600('0x13'));var as=require(_0x1600('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1600('0x15'))(_0x1600('0x16'));var utils=require(_0x1600('0x17'));var config=require(_0x1600('0x18'));var licenseUtil=require(_0x1600('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x458778,_0x47b7cb){_0x47b7cb=_0x47b7cb||0xcc;return function(_0x5c6f1b){if(_0x5c6f1b){return _0x458778[_0x1600('0x1a')](_0x47b7cb);}return _0x458778['status'](_0x47b7cb)[_0x1600('0x1b')]();};}function respondWithResult(_0x53bdc0,_0x23f7ef){_0x23f7ef=_0x23f7ef||0xc8;return function(_0x977a64){if(_0x977a64){return _0x53bdc0[_0x1600('0x1c')](_0x23f7ef)[_0x1600('0x1d')](_0x977a64);}};}function respondWithFilteredResult(_0x5cb6cd,_0x46b023){return function(_0x238e39){if(_0x238e39){var _0x422f2e=typeof _0x46b023[_0x1600('0x1e')]===_0x1600('0x1f')&&typeof _0x46b023[_0x1600('0x20')]==='undefined';var _0x1621e1=_0x238e39[_0x1600('0x21')];var _0x4b995=_0x422f2e?0x0:_0x46b023['offset'];var _0xef08fc=_0x422f2e?_0x238e39['count']:_0x46b023['offset']+_0x46b023[_0x1600('0x20')];var _0x382036;if(_0xef08fc>=_0x1621e1){_0xef08fc=_0x1621e1;_0x382036=0xc8;}else{_0x382036=0xce;}_0x5cb6cd[_0x1600('0x1c')](_0x382036);return _0x5cb6cd[_0x1600('0x22')]('Content-Range',_0x4b995+'-'+_0xef08fc+'/'+_0x1621e1)[_0x1600('0x1d')](_0x238e39);}return null;};}function patchUpdates(_0x53283f){return function(_0x48882a){try{jsonpatch[_0x1600('0x23')](_0x48882a,_0x53283f,!![]);}catch(_0x2adf97){return BPromise[_0x1600('0x24')](_0x2adf97);}return _0x48882a['save']();};}function saveUpdates(_0x3c3d45,_0x3655b1){return function(_0x1d62c2){if(_0x1d62c2){return _0x1d62c2[_0x1600('0x25')](_0x3c3d45)[_0x1600('0x26')](function(_0x3b668e){return _0x3b668e;});}return null;};}function removeEntity(_0x564d89,_0x2b549a){return function(_0x538550){if(_0x538550){return _0x538550['destroy']()['then'](function(){_0x564d89[_0x1600('0x1c')](0xcc)[_0x1600('0x1b')]();});}};}function handleEntityNotFound(_0x59710f,_0x359f99){return function(_0x45173a){if(!_0x45173a){_0x59710f[_0x1600('0x1a')](0x194);}return _0x45173a;};}function handleError(_0x1aed7f,_0x3cbcbe){_0x3cbcbe=_0x3cbcbe||0x1f4;return function(_0x2787cb){logger[_0x1600('0x27')](_0x2787cb[_0x1600('0x28')]);if(_0x2787cb[_0x1600('0x29')]){delete _0x2787cb[_0x1600('0x29')];}_0x1aed7f['status'](_0x3cbcbe)[_0x1600('0x2a')](_0x2787cb);};}exports[_0x1600('0x2b')]=function(_0x3af976,_0x171e1c){var _0x445ed3={},_0x36301d={},_0x5e1d29={'count':0x0,'rows':[]};var _0x38a6b5=_[_0x1600('0x2c')](db[_0x1600('0x2d')][_0x1600('0x2e')],function(_0x4162c3){return{'name':_0x4162c3[_0x1600('0x2f')],'type':_0x4162c3['type'][_0x1600('0x30')]};});_0x36301d[_0x1600('0x31')]=_[_0x1600('0x32')](_[_0x1600('0x2c')](_0x38a6b5,_0x1600('0x29')),[_0x1600('0x33')]);_0x36301d[_0x1600('0x34')]=_[_0x1600('0x35')](_0x3af976[_0x1600('0x34')]);_0x36301d['filters']=_[_0x1600('0x36')](_0x36301d[_0x1600('0x31')],_0x36301d[_0x1600('0x34')]);_0x445ed3[_0x1600('0x37')]=_[_0x1600('0x36')](_0x36301d[_0x1600('0x31')],qs[_0x1600('0x38')](_0x3af976[_0x1600('0x34')][_0x1600('0x38')]));_0x445ed3[_0x1600('0x37')]=_0x445ed3['attributes'][_0x1600('0x39')]?_0x445ed3[_0x1600('0x37')]:_0x36301d[_0x1600('0x31')];if(!_0x3af976['query'][_0x1600('0x3a')](_0x1600('0x3b'))){_0x445ed3['limit']=qs[_0x1600('0x20')](_0x3af976[_0x1600('0x34')][_0x1600('0x20')]);_0x445ed3[_0x1600('0x1e')]=qs[_0x1600('0x1e')](_0x3af976[_0x1600('0x34')]['offset']);}_0x445ed3[_0x1600('0x3c')]=qs[_0x1600('0x3d')](_0x3af976[_0x1600('0x34')]['sort']);_0x445ed3['where']=qs[_0x1600('0x3e')](_[_0x1600('0x3f')](_0x3af976[_0x1600('0x34')],_0x36301d[_0x1600('0x3e')]),_0x38a6b5);if(_0x3af976['query']['filter']){_0x445ed3['where']=_['merge'](_0x445ed3['where'],{'$or':_[_0x1600('0x2c')](_0x38a6b5,function(_0x564610){if(_0x564610['type']!==_0x1600('0x40')){var _0x1c6cb9={};_0x1c6cb9[_0x564610[_0x1600('0x29')]]={'$like':'%'+_0x3af976['query']['filter']+'%'};return _0x1c6cb9;}})});}_0x445ed3=_[_0x1600('0x41')]({},_0x445ed3,_0x3af976[_0x1600('0x42')]);var _0xa418fa={'where':_0x445ed3[_0x1600('0x43')]};return db[_0x1600('0x2d')][_0x1600('0x21')](_0xa418fa)[_0x1600('0x26')](function(_0x419be4){_0x5e1d29[_0x1600('0x21')]=_0x419be4;if(_0x3af976['query'][_0x1600('0x44')]){_0x445ed3[_0x1600('0x45')]=[{'all':!![]}];}return db[_0x1600('0x2d')][_0x1600('0x46')](_0x445ed3);})[_0x1600('0x26')](function(_0x2a9757){_0x5e1d29[_0x1600('0x47')]=_0x2a9757;return _0x5e1d29;})['then'](respondWithFilteredResult(_0x171e1c,_0x445ed3))['catch'](handleError(_0x171e1c,null));};exports[_0x1600('0x48')]=function(_0x3c9e75,_0x234326){var _0x42d3f8={'raw':![],'where':{'id':_0x3c9e75['params']['id']}},_0x3e5069={};_0x3e5069[_0x1600('0x31')]=_[_0x1600('0x35')](db[_0x1600('0x2d')][_0x1600('0x2e')]);_0x3e5069[_0x1600('0x34')]=_['keys'](_0x3c9e75[_0x1600('0x34')]);_0x3e5069[_0x1600('0x3e')]=_[_0x1600('0x36')](_0x3e5069[_0x1600('0x31')],_0x3e5069[_0x1600('0x34')]);_0x42d3f8[_0x1600('0x37')]=_[_0x1600('0x36')](_0x3e5069[_0x1600('0x31')],qs['fields'](_0x3c9e75[_0x1600('0x34')]['fields']));_0x42d3f8[_0x1600('0x37')]=_0x42d3f8[_0x1600('0x37')][_0x1600('0x39')]?_0x42d3f8[_0x1600('0x37')]:_0x3e5069[_0x1600('0x31')];if(_0x3c9e75[_0x1600('0x34')][_0x1600('0x44')]){_0x42d3f8[_0x1600('0x45')]=[{'all':!![]}];}_0x42d3f8=_[_0x1600('0x41')]({},_0x42d3f8,_0x3c9e75[_0x1600('0x42')]);return db[_0x1600('0x2d')][_0x1600('0x49')](_0x42d3f8)['then'](handleEntityNotFound(_0x234326,null))[_0x1600('0x26')](respondWithResult(_0x234326,null))[_0x1600('0x4a')](handleError(_0x234326,null));};exports[_0x1600('0x4b')]=function(_0x153765,_0xde834d){return db[_0x1600('0x2d')][_0x1600('0x4b')](_0x153765['body'],{})[_0x1600('0x26')](respondWithResult(_0xde834d,0xc9))['catch'](handleError(_0xde834d,null));};exports[_0x1600('0x25')]=function(_0x51b7ef,_0x39b8cc){if(_0x51b7ef[_0x1600('0x4c')]['id']){delete _0x51b7ef[_0x1600('0x4c')]['id'];}return db[_0x1600('0x2d')]['find']({'where':{'id':_0x51b7ef[_0x1600('0x4d')]['id']}})[_0x1600('0x26')](handleEntityNotFound(_0x39b8cc,null))[_0x1600('0x26')](saveUpdates(_0x51b7ef['body'],null))[_0x1600('0x26')](respondWithResult(_0x39b8cc,null))['catch'](handleError(_0x39b8cc,null));};exports[_0x1600('0x4e')]=function(_0x56fe6e,_0x3cc85e){return db[_0x1600('0x2d')][_0x1600('0x4e')]()[_0x1600('0x26')](respondWithResult(_0x3cc85e,null))['catch'](handleError(_0x3cc85e,null));};exports[_0x1600('0x4f')]=function(_0x1ac9e2,_0x2aaae2,_0x31aeda){var _0x32f962=require(_0x1600('0x50'));var _0x2d3ca4=![];var _0x42e5f1={};if(_0x1ac9e2[_0x1600('0x34')][_0x1600('0x51')]&&_0x1ac9e2['query'][_0x1600('0x51')]===_0x1600('0x52')){_0x42e5f1[_0x1600('0x52')]=_0x1ac9e2[_0x1600('0x4d')]['id'];}else{_0x42e5f1['id']=_0x1ac9e2['params']['id'];}return db[_0x1600('0x2d')][_0x1600('0x49')]({'where':_0x42e5f1,'attributes':['id',_0x1600('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x2aaae2,null))[_0x1600('0x26')](function(_0x3b0689){if(_0x3b0689){var _0x49d44d=_0x3b0689['value'];var _0x274dc7=util[_0x1600('0x33')](_0x1600('0x54'),_0x49d44d);if(fs[_0x1600('0x55')](_0x274dc7)){_0x2d3ca4=!![];return _0x32f962['decryptFile'](_0x274dc7,_0x49d44d,config[_0x1600('0x56')][_0x1600('0x57')])[_0x1600('0x26')](function(){return _0x3b0689;});}return _0x3b0689;}})[_0x1600('0x26')](function(_0x3da741){if(_0x3da741){var _0x876e4a=_0x3da741['value'];if(!fs[_0x1600('0x55')](_0x876e4a)){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x3da741[_0x1600('0x58')]){return _0x2aaae2['download'](_0x876e4a,_0x3da741[_0x1600('0x58')]+path[_0x1600('0x59')](_0x876e4a),function(){if(_0x2d3ca4){fs[_0x1600('0x5a')](_0x876e4a);}});}else{return _0x2aaae2[_0x1600('0x4f')](_0x876e4a,function(_0x2443a6){if(_0x2d3ca4){fs[_0x1600('0x5a')](_0x876e4a);}});}}})['catch'](function(_0x1b2f4e){if(_0x1b2f4e['message']==='VoiceRecording\x20not\x20found'){_0x2aaae2[_0x1600('0x1c')](0x194)[_0x1600('0x2a')]('Not\x20found');}else{return handleError(_0x2aaae2,null);}});};exports[_0x1600('0x5b')]=function(_0x1871c9,_0x1402bb,_0x4dbfc0){var _0x13eae4=require(_0x1600('0x50'));var _0x239fa4=![];var _0x24d438={'$and':[db[_0x1600('0x5c')][_0x1600('0x43')](db[_0x1600('0x5c')]['fn'](_0x1600('0x5d'),db[_0x1600('0x5c')][_0x1600('0x5e')](_0x1600('0x52'))),_0x1871c9[_0x1600('0x34')]['token'])]};if(_0x1871c9['query']['type']&&_0x1871c9[_0x1600('0x34')][_0x1600('0x51')]==='uniqueid'){_0x24d438[_0x1600('0x5f')]['push']({'uniqueid':_0x1871c9['params']['id']});}else{_0x24d438[_0x1600('0x5f')][_0x1600('0x60')]({'id':_0x1871c9[_0x1600('0x4d')]['id']});}return db[_0x1600('0x2d')][_0x1600('0x49')]({'where':_0x24d438,'attributes':['id',_0x1600('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x1402bb,null))[_0x1600('0x26')](function(_0x443e8a){if(_0x443e8a){var _0x1a5fb1=util[_0x1600('0x33')](_0x1600('0x54'),_0x443e8a[_0x1600('0x53')]);if(fs[_0x1600('0x55')](_0x1a5fb1)){_0x239fa4=!![];return _0x13eae4[_0x1600('0x61')](_0x1a5fb1,_0x443e8a[_0x1600('0x53')],config['secrets'][_0x1600('0x57')])[_0x1600('0x26')](function(){return _0x443e8a;});}return _0x443e8a;}})['then'](function(_0x50fc60){if(_0x50fc60){if(!fs[_0x1600('0x55')](_0x50fc60[_0x1600('0x53')])){throw new db[(_0x1600('0x62'))][(_0x1600('0x63'))](_0x1600('0x64'));}if(_0x50fc60['filename']){return _0x1402bb[_0x1600('0x4f')](_0x50fc60[_0x1600('0x53')],_0x50fc60['filename']+path[_0x1600('0x59')](_0x50fc60[_0x1600('0x53')]),function(){if(_0x239fa4){fs[_0x1600('0x5a')](_0x50fc60[_0x1600('0x53')]);}});}else{return _0x1402bb[_0x1600('0x4f')](_0x50fc60[_0x1600('0x53')],function(_0x8f986){if(_0x239fa4){fs[_0x1600('0x5a')](_0x50fc60[_0x1600('0x53')]);}});}}})[_0x1600('0x4a')](handleError(_0x1402bb,null));};exports[_0x1600('0x65')]=function(_0x340ae8,_0x4360b7){return db[_0x1600('0x2d')][_0x1600('0x49')]({'where':{'id':_0x340ae8[_0x1600('0x4d')]['id']}})[_0x1600('0x26')](function(_0x20dacd){if(_['isNil'](_0x20dacd)){throw new ReferenceError(_0x1600('0x66'));}return _0x20dacd;})[_0x1600('0x26')](function(_0xef1b4c){var _0x20ff1f=_0xef1b4c['value'];logger[_0x1600('0x67')](_0x1600('0x68'),_0x20ff1f);if(!_[_0x1600('0x69')](_0xef1b4c[_0x1600('0x53')])&&fs['existsSync'](_0x20ff1f)){logger['info'](_0x1600('0x6a')+_0x20ff1f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1600('0x6b')](_0x20ff1f);}_0x20ff1f=_0x20ff1f+_0x1600('0x6c');if(!_[_0x1600('0x69')](_0xef1b4c[_0x1600('0x53')])&&fs[_0x1600('0x55')](_0x20ff1f)){logger['info'](_0x1600('0x6a')+_0x20ff1f+_0x1600('0x6d'));fs[_0x1600('0x6b')](_0x20ff1f);}return _0xef1b4c;})[_0x1600('0x26')](function(_0xa59fdd){if(!_0xa59fdd)throw new InternalError();return _0xa59fdd[_0x1600('0x65')]();})[_0x1600('0x26')](function(){_0x4360b7['status'](0xcc)[_0x1600('0x1b')]();})['catch'](handleError(_0x4360b7,null));};function getBucketslist(_0x3d6952,_0x135d96,_0x341026){return new Promise(function(_0x4a0aa0,_0x1d11e2){var _0x2ff2b9=new AWS['S3']({'accessKeyId':_0x135d96,'secretAccessKey':_0x3d6952,'region':_0x341026});_0x2ff2b9['listBuckets']({},function(_0xf5990a,_0x1c9e99){if(_0xf5990a){return _0x1d11e2(_0xf5990a);}else{return _0x4a0aa0(_0x1c9e99);}});});}function createBucket(_0x549149,_0x46586e,_0xc2bbb7,_0x9018ec){return new Promise(function(_0x555fb5,_0x1de380){var _0x25fe2f=new AWS['S3']({'accessKeyId':_0x46586e,'secretAccessKey':_0x549149,'region':_0xc2bbb7});_0x25fe2f[_0x1600('0x6e')]({'Bucket':_0x9018ec},function(_0x3660ed,_0x5669ed){if(_0x3660ed){return _0x1de380(_0x3660ed);}else{return _0x555fb5(_0x5669ed);}});});}function uploadFile(_0x53de2c,_0x5c046e,_0x13ebcd,_0x54ab70,_0x538aa0,_0x3bfefb){return new Promise(function(_0x125807,_0x113e67){var _0x19859e=new AWS['S3']({'accessKeyId':_0x5c046e,'secretAccessKey':_0x53de2c,'region':_0x13ebcd});_0x19859e['upload']({'Bucket':_0x54ab70,'Key':_0x538aa0,'Body':_0x3bfefb},function(_0x393f5a,_0xf56e32){if(_0x393f5a){return _0x113e67(_0x393f5a);}else{return _0x125807(_0xf56e32);}});});}function startTranscribe(_0x28e4c6,_0x5af0e3,_0x7c6452,_0x4c55e7,_0x53d08c,_0x216c47){return new Promise(function(_0x273998,_0x5a7004){var _0x5270a2=new AWS[(_0x1600('0x6f'))]({'accessKeyId':_0x5af0e3,'secretAccessKey':_0x28e4c6,'region':_0x7c6452});_0x5270a2[_0x1600('0x70')]({'TranscriptionJobName':_0x4c55e7,'LanguageCode':_0x53d08c,'Media':{'MediaFileUri':_0x216c47}},function(_0x246cb8,_0x5c3365){if(_0x246cb8){return _0x5a7004(_0x246cb8);}else{return _0x273998(_0x5c3365);}});});}function transcribe(_0x50a98b,_0x25c464,_0x2b3149,_0x577922,_0x2173bd,_0x315a3f,_0x4a4647){return new Promise(function(_0x29f735,_0x3ceeef){var _0x314612={};logger[_0x1600('0x67')](util[_0x1600('0x33')](_0x1600('0x71'),_0x50a98b,_0x2173bd));return uploadFile(_0x25c464,_0x2b3149,_0x577922,_0x2173bd,path[_0x1600('0x72')](_0x315a3f),fs[_0x1600('0x73')](_0x315a3f))[_0x1600('0x26')](function(_0x2a8c5d){logger[_0x1600('0x67')](util[_0x1600('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x50a98b,_0x2173bd,_0x2a8c5d[_0x1600('0x74')]));_0x314612[_0x1600('0x75')]=_0x2a8c5d[_0x1600('0x76')];_0x314612[_0x1600('0x77')]=_0x2a8c5d[_0x1600('0x74')];logger['info'](util[_0x1600('0x33')](_0x1600('0x78'),_0x50a98b));return startTranscribe(_0x25c464,_0x2b3149,_0x577922,uuidv4(),_0x4a4647,_0x2a8c5d[_0x1600('0x74')]);})['then'](function(_0xc22446){logger[_0x1600('0x67')](util[_0x1600('0x33')](_0x1600('0x79'),_0x50a98b,_0xc22446[_0x1600('0x7a')][_0x1600('0x7b')]));_0x314612[_0x1600('0x7c')]=_0xc22446[_0x1600('0x7a')][_0x1600('0x7b')];_0x314612[_0x1600('0x7d')]=_0xc22446[_0x1600('0x7a')][_0x1600('0x7e')];return _0x29f735(_0x314612);})[_0x1600('0x4a')](function(_0x328ed5){return _0x3ceeef(_0x328ed5);});});}exports[_0x1600('0x7f')]=function(_0xe1f4ea,_0x17ce53,_0x2a5a04){var _0x4bf6e7;var _0x179da0;var _0x106c1b;var _0x47dd67=require(_0x1600('0x50'));return db[_0x1600('0x2d')]['findOne']({'where':{'id':_0xe1f4ea['params']['id']}})['then'](function(_0x51a7c6){if(_0x51a7c6){var _0xde5bc2=util[_0x1600('0x33')](_0x1600('0x54'),_0x51a7c6[_0x1600('0x53')]);if(fs['existsSync'](_0xde5bc2)){cypher=!![];return _0x47dd67[_0x1600('0x61')](_0xde5bc2,_0x51a7c6[_0x1600('0x53')],config[_0x1600('0x56')][_0x1600('0x57')])['then'](function(){return _0x51a7c6;});}return _0x51a7c6;}})['then'](function(_0x1b39b0){if(!_0x1b39b0){throw new db[(_0x1600('0x62'))][(_0x1600('0x63'))](_0x1600('0x80'));}_0x179da0=_0x1b39b0;return db[_0x1600('0x81')][_0x1600('0x82')]({'where':{'id':0x1}});})[_0x1600('0x26')](handleEntityNotFound(_0x17ce53,null))['then'](function(_0xf4f266){if(_0xf4f266){_0x4bf6e7=_0xf4f266;if(!_0x4bf6e7['transcribe']||!_0x4bf6e7[_0x1600('0x83')]||!_0x4bf6e7[_0x1600('0x84')]||!_0x4bf6e7['language']||!_0x4bf6e7[_0x1600('0x75')]){throw new db[(_0x1600('0x62'))][(_0x1600('0x63'))](_0x1600('0x85'));}if(_0xe1f4ea[_0x1600('0x4c')]['runSentiment']&&(!_0x4bf6e7[_0x1600('0x86')]||!_0x4bf6e7['sentimentAccountId']||!_0x4bf6e7[_0x1600('0x87')]||!_0x4bf6e7[_0x1600('0x88')]||!_0x4bf6e7[_0x1600('0x75')])){throw new db[(_0x1600('0x62'))]['ValidationError'](_0x1600('0x89'));}return db['CloudProvider'][_0x1600('0x82')]({'where':{'id':_0x4bf6e7['transcribeAccountId']}});}})[_0x1600('0x26')](function(_0x19ba16){if(!_0x19ba16){throw new db[(_0x1600('0x62'))][(_0x1600('0x63'))](_0x1600('0x8a'));}if(!_0x19ba16[_0x1600('0x8b')]||!_0x19ba16[_0x1600('0x8c')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x106c1b=_0x19ba16;return getBucketslist(_0x106c1b[_0x1600('0x8b')],_0x106c1b[_0x1600('0x8c')],_0x4bf6e7['transcribeRegion']);})[_0x1600('0x26')](function(_0x835116){if(_0x835116&&_0x835116['Buckets']){var _0x3c40fa=_[_0x1600('0x49')](_0x835116[_0x1600('0x8d')],function(_0xe33005){return _0xe33005[_0x1600('0x8e')]===_0x4bf6e7[_0x1600('0x75')];});if(!_0x3c40fa){logger[_0x1600('0x67')](util[_0x1600('0x33')](_0x1600('0x8f'),_0xe1f4ea['params']['id'],_0x4bf6e7[_0x1600('0x75')]));return createBucket(_0x106c1b[_0x1600('0x8b')],_0x106c1b[_0x1600('0x8c')],_0x4bf6e7['transcribeRegion'],_0x4bf6e7['bucket']);}logger['info'](util[_0x1600('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xe1f4ea[_0x1600('0x4d')]['id'],_0x4bf6e7[_0x1600('0x75')]));return;}})[_0x1600('0x26')](function(_0x48bdf2){if(_0x179da0[_0x1600('0x7d')]==='NEW'){return transcribe(_0xe1f4ea['params']['id'],_0x106c1b['data1'],_0x106c1b[_0x1600('0x8c')],_0x4bf6e7[_0x1600('0x84')],_0x4bf6e7[_0x1600('0x75')],_0x179da0[_0x1600('0x53')],_0x4bf6e7[_0x1600('0x88')]);}else{logger[_0x1600('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xe1f4ea[_0x1600('0x4d')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x1600('0x26')](function(_0x131b46){if(_0x131b46){_0x131b46[_0x1600('0x90')]=_0xe1f4ea[_0x1600('0x4c')][_0x1600('0x91')];return _0x179da0[_0x1600('0x92')](_0x131b46);}})[_0x1600('0x26')](respondWithResult(_0x17ce53,null))[_0x1600('0x4a')](handleError(_0x17ce53,null));};function writeFile(_0x3ae9f9,_0x8010c4){return new Promise(function(_0x5a4a0b,_0x1c7965){fs[_0x1600('0x93')](_0x8010c4,_0x3ae9f9,function(_0x519eec,_0x30bc19){if(_0x519eec){return _0x1c7965(_0x519eec);}else{return _0x5a4a0b(_0x30bc19);}});});}exports[_0x1600('0x94')]=function(_0x4ebca1,_0xb40a7,_0x34c780){return db[_0x1600('0x2d')][_0x1600('0x82')]({'where':{'id':_0x4ebca1[_0x1600('0x4d')]['id']}})[_0x1600('0x26')](handleEntityNotFound(_0xb40a7))[_0x1600('0x26')](function(_0x4d0faf){if(_0x4d0faf&&_0x4d0faf[_0x1600('0x95')]){var _0x564f12=_0x4d0faf['fileText'];var _0x42172d=config[_0x1600('0x96')]+_0x1600('0x97')+_0x4d0faf['id']+_0x1600('0x98');if(fs[_0x1600('0x55')](_0x42172d)){return _0x42172d;}return writeFile(_0x564f12,_0x42172d)[_0x1600('0x26')](function(){return _0x42172d;});}else{throw new db[(_0x1600('0x62'))][(_0x1600('0x63'))](_0x1600('0x99'));}})[_0x1600('0x26')](function(_0x25ecb6){return _0xb40a7[_0x1600('0x4f')](_0x25ecb6);})['catch'](handleError(_0xb40a7));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index bff9f6d..6f1561c 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 _0x77d6=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','../../config/logger'];(function(_0x9033a6,_0x460dbc){var _0x24640c=function(_0x1f72d3){while(--_0x1f72d3){_0x9033a6['push'](_0x9033a6['shift']());}};_0x24640c(++_0x460dbc);}(_0x77d6,0x17f));var _0x677d=function(_0x5aecb9,_0x431f00){_0x5aecb9=_0x5aecb9-0x0;var _0x2bac52=_0x77d6[_0x5aecb9];return _0x2bac52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x677d('0x0'))(_0x677d('0x1'));var moment=require(_0x677d('0x2'));var BPromise=require(_0x677d('0x3'));var rp=require(_0x677d('0x4'));var fs=require('fs');var path=require(_0x677d('0x5'));var rimraf=require('rimraf');var config=require(_0x677d('0x6'));var attributes=require(_0x677d('0x7'));module[_0x677d('0x8')]=function(_0x24072f,_0x4bf6c2){return _0x24072f[_0x677d('0x9')](_0x677d('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x677d('0xb'),'fields':[_0x677d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbf6c=['voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording'];(function(_0xa808d9,_0x186110){var _0x2ae6af=function(_0x89c722){while(--_0x89c722){_0xa808d9['push'](_0xa808d9['shift']());}};_0x2ae6af(++_0x186110);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x4fb945,_0x49e10f){_0x4fb945=_0x4fb945-0x0;var _0x3d464e=_0xbf6c[_0x4fb945];return _0x3d464e;};'use strict';var _=require(_0xcbf6('0x0'));var util=require(_0xcbf6('0x1'));var logger=require('../../config/logger')(_0xcbf6('0x2'));var moment=require(_0xcbf6('0x3'));var BPromise=require(_0xcbf6('0x4'));var rp=require(_0xcbf6('0x5'));var fs=require('fs');var path=require(_0xcbf6('0x6'));var rimraf=require(_0xcbf6('0x7'));var config=require(_0xcbf6('0x8'));var attributes=require(_0xcbf6('0x9'));module['exports']=function(_0x58be56,_0x5ad0ce){return _0x58be56[_0xcbf6('0xa')](_0xcbf6('0xb'),attributes,{'tableName':_0xcbf6('0xc'),'paranoid':![],'indexes':[{'name':_0xcbf6('0xd'),'fields':[_0xcbf6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 89f7be6..ab28115 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 _0x3e24=['client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x341a08,_0x52c3f1){var _0x4b7c31=function(_0x38e383){while(--_0x38e383){_0x341a08['push'](_0x341a08['shift']());}};_0x4b7c31(++_0x52c3f1);}(_0x3e24,0x167));var _0x43e2=function(_0x764919,_0x588753){_0x764919=_0x764919-0x0;var _0x103b07=_0x3e24[_0x764919];return _0x103b07;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});}exports[_0x43e2('0x15')]=function(_0x1b7cde){var _0x3ea010=this;return new Promise(function(_0x15ecb5,_0x3236b9){return db[_0x43e2('0x16')]['update'](_0x1b7cde[_0x43e2('0x17')],{'raw':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde['options'][_0x43e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1a')]||null:null,'attributes':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1b')]||null:null,'limit':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1c')]||null:null})[_0x43e2('0xc')](function(_0x52e361){logger[_0x43e2('0x13')](_0x43e2('0x15'),_0x1b7cde);logger[_0x43e2('0x1d')](_0x43e2('0x15'),_0x1b7cde,JSON['stringify'](_0x52e361));_0x15ecb5(_0x52e361);})[_0x43e2('0x14')](function(_0xc717d8){logger[_0x43e2('0x10')](_0x43e2('0x15'),_0xc717d8[_0x43e2('0x12')],_0x1b7cde);_0x3236b9(_0x3ea010[_0x43e2('0x10')](0x1f4,_0xc717d8[_0x43e2('0x12')]));});});};exports[_0x43e2('0x1e')]=function(_0xd29b7b){var _0x1ec68e=this;return new Promise(function(_0x1ea844,_0x1de7e1){var _0x52ed49=require(_0x43e2('0x1f'));var _0x2f2bd8;return db['Setting'][_0x43e2('0x20')]({'attributes':['id',_0x43e2('0x21')],'where':{'id':0x1},'raw':!![]})[_0x43e2('0xc')](function(_0x404483){_0x2f2bd8=_0x404483;return db[_0x43e2('0x16')]['create'](_0xd29b7b[_0x43e2('0x17')]);})[_0x43e2('0xc')](function(_0x1779f9){if(_0x2f2bd8[_0x43e2('0x21')]&&fs[_0x43e2('0x22')](_0x1779f9[_0x43e2('0x23')])){var _0x53f797=util['format'](_0x43e2('0x24'),_0x1779f9[_0x43e2('0x23')]);return _0x52ed49[_0x43e2('0x25')](_0x1779f9[_0x43e2('0x23')],_0x53f797,config[_0x43e2('0x26')]['recording'])[_0x43e2('0xc')](function(){fs[_0x43e2('0x27')](_0x1779f9[_0x43e2('0x23')]);logger[_0x43e2('0x13')](_0x43e2('0x28'));return _0x1779f9;});}return _0x1779f9;})[_0x43e2('0xc')](function(_0x2fcdd4){logger['info']('CreateVoiceRecording',_0xd29b7b);logger[_0x43e2('0x1d')](_0x43e2('0x1e'),_0xd29b7b,JSON['stringify'](_0x2fcdd4));_0x1ea844(_0x2fcdd4);})[_0x43e2('0x14')](function(_0x34effb){logger['error'](_0x43e2('0x1e'),_0x34effb['message'],_0xd29b7b);_0x1de7e1(_0x1ec68e['error'](0x1f4,_0x34effb['message']));});});}; \ No newline at end of file +var _0xd943=['info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x741a7b,_0x5cb899){var _0x43a8e6=function(_0x3a3aa3){while(--_0x3a3aa3){_0x741a7b['push'](_0x741a7b['shift']());}};_0x43a8e6(++_0x5cb899);}(_0xd943,0x15d));var _0x3d94=function(_0x219db5,_0x174938){_0x219db5=_0x219db5-0x0;var _0x36fa78=_0xd943[_0x219db5];return _0x36fa78;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['update'](_0x2acee3[_0x3d94('0x16')],{'raw':_0x2acee3['options']?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x19')]||null:null,'attributes':_0x2acee3['options']?_0x2acee3['options'][_0x3d94('0x1a')]||null:null,'limit':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')]['limit']||null:null})[_0x3d94('0xa')](function(_0x2e8c91){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1b')](_0x3d94('0x14'),_0x2acee3,JSON[_0x3d94('0x1c')](_0x2e8c91));_0x4afc92(_0x2e8c91);})[_0x3d94('0x13')](function(_0xee7b8d){logger[_0x3d94('0xe')](_0x3d94('0x14'),_0xee7b8d[_0x3d94('0x11')],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0xee7b8d[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1d')]=function(_0x5b3b31){var _0x123183=this;return new Promise(function(_0x558fd2,_0x28a698){var _0x1d0a7a=require(_0x3d94('0x1e'));var _0x439173;return db[_0x3d94('0x1f')][_0x3d94('0x20')]({'attributes':['id',_0x3d94('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x584c4a){_0x439173=_0x584c4a;return db[_0x3d94('0x15')]['create'](_0x5b3b31['body']);})[_0x3d94('0xa')](function(_0x58c0d0){if(_0x439173[_0x3d94('0x21')]&&fs[_0x3d94('0x22')](_0x58c0d0[_0x3d94('0x23')])){var _0x4cef9c=util[_0x3d94('0x24')]('%s.cypher',_0x58c0d0[_0x3d94('0x23')]);return _0x1d0a7a['encryptFile'](_0x58c0d0[_0x3d94('0x23')],_0x4cef9c,config[_0x3d94('0x25')][_0x3d94('0x26')])[_0x3d94('0xa')](function(){fs['unlink'](_0x58c0d0[_0x3d94('0x23')]);logger['info'](_0x3d94('0x27'));return _0x58c0d0;});}return _0x58c0d0;})[_0x3d94('0xa')](function(_0x51d308){logger['info'](_0x3d94('0x1d'),_0x5b3b31);logger[_0x3d94('0x1b')](_0x3d94('0x1d'),_0x5b3b31,JSON['stringify'](_0x51d308));_0x558fd2(_0x51d308);})[_0x3d94('0x13')](function(_0x3d29fd){logger['error'](_0x3d94('0x1d'),_0x3d29fd[_0x3d94('0x11')],_0x5b3b31);_0x28a698(_0x123183[_0x3d94('0xe')](0x1f4,_0x3d29fd[_0x3d94('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 600d37d..43d7290 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 _0xfd1d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x417f3f,_0x19a6e1){var _0x10add3=function(_0x9098ce){while(--_0x9098ce){_0x417f3f['push'](_0x417f3f['shift']());}};_0x10add3(++_0x19a6e1);}(_0xfd1d,0xe4));var _0xdfd1=function(_0x5e5c4b,_0x5e8010){_0x5e5c4b=_0x5e5c4b-0x0;var _0x21e799=_0xfd1d[_0x5e5c4b];return _0x21e799;};'use strict';var multer=require('multer');var util=require(_0xdfd1('0x0'));var path=require(_0xdfd1('0x1'));var timeout=require(_0xdfd1('0x2'));var express=require(_0xdfd1('0x3'));var router=express['Router']();var fs_extra=require(_0xdfd1('0x4'));var auth=require(_0xdfd1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdfd1('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xdfd1('0x7')]('/',auth[_0xdfd1('0x8')](),controller[_0xdfd1('0x9')]);router[_0xdfd1('0x7')]('/describe',auth[_0xdfd1('0x8')](),controller[_0xdfd1('0xa')]);router[_0xdfd1('0x7')](_0xdfd1('0xb'),auth['isAuthenticated'](),controller[_0xdfd1('0xc')]);router[_0xdfd1('0xd')]('/',auth['isAuthenticated'](),controller[_0xdfd1('0xe')]);router[_0xdfd1('0xf')](_0xdfd1('0xb'),auth[_0xdfd1('0x8')](),controller[_0xdfd1('0x10')]);router[_0xdfd1('0x11')](_0xdfd1('0xb'),auth[_0xdfd1('0x8')](),controller['destroy']);module[_0xdfd1('0x12')]=router; \ No newline at end of file +var _0x0df4=['./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xd094d7,_0x1c4feb){var _0x2dc98a=function(_0x5c0a3a){while(--_0x5c0a3a){_0xd094d7['push'](_0xd094d7['shift']());}};_0x2dc98a(++_0x1c4feb);}(_0x0df4,0x98));var _0x40df=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x0df4[_0x2576d7];return _0x16a08c;};'use strict';var multer=require('multer');var util=require(_0x40df('0x0'));var path=require(_0x40df('0x1'));var timeout=require(_0x40df('0x2'));var express=require(_0x40df('0x3'));var router=express[_0x40df('0x4')]();var fs_extra=require(_0x40df('0x5'));var auth=require(_0x40df('0x6'));var interaction=require(_0x40df('0x7'));var config=require('../../config/environment');var controller=require(_0x40df('0x8'));router[_0x40df('0x9')]('/',auth[_0x40df('0xa')](),controller['index']);router[_0x40df('0x9')](_0x40df('0xb'),auth['isAuthenticated'](),controller[_0x40df('0xc')]);router['get'](_0x40df('0xd'),auth[_0x40df('0xa')](),controller[_0x40df('0xe')]);router['post']('/',auth[_0x40df('0xa')](),controller['create']);router[_0x40df('0xf')]('/:id',auth[_0x40df('0xa')](),controller[_0x40df('0x10')]);router[_0x40df('0x11')](_0x40df('0xd'),auth[_0x40df('0xa')](),controller[_0x40df('0x12')]);module[_0x40df('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 8eacec2..e7b009e 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 _0x72bd=['Yes','sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x72bd,0xb9));var _0xd72b=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x72bd[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xd72b('0x0'));var moment=require(_0xd72b('0x1'));module[_0xd72b('0x2')]={'type':{'type':Sequelize[_0xd72b('0x3')](_0xd72b('0x4'),_0xd72b('0x5'))},'result':{'type':Sequelize[_0xd72b('0x6')]},'transfererchannel':{'type':Sequelize[_0xd72b('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xd72b('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xd72b('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xd72b('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xd72b('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xd72b('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xd72b('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd72b('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd72b('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xd72b('0x6')]},'transfereecontext':{'type':Sequelize[_0xd72b('0x6')]},'transfereeexten':{'type':Sequelize[_0xd72b('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd72b('0x3')](_0xd72b('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7063=['attended','STRING','Yes','moment','exports','ENUM','blind'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x7063,0x1d1));var _0x3706=function(_0x310086,_0x327e5a){_0x310086=_0x310086-0x0;var _0x53e3c9=_0x7063[_0x310086];return _0x53e3c9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3706('0x0'));module[_0x3706('0x1')]={'type':{'type':Sequelize[_0x3706('0x2')](_0x3706('0x3'),_0x3706('0x4'))},'result':{'type':Sequelize[_0x3706('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x3706('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x3706('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x3706('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x3706('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x3706('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x3706('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x3706('0x5')]},'transfereecontext':{'type':Sequelize[_0x3706('0x5')]},'transfereeexten':{'type':Sequelize[_0x3706('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x3706('0x5')]},'isexternal':{'type':Sequelize[_0x3706('0x2')](_0x3706('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index aec8afc..52eba89 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 _0xb6e4=['../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','then','end','error','name','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4bbb42,_0x3530a2){var _0x5171da=function(_0x3eba99){while(--_0x3eba99){_0x4bbb42['push'](_0x4bbb42['shift']());}};_0x5171da(++_0x3530a2);}(_0xb6e4,0x1a6));var _0x4b6e=function(_0x46074c,_0x4fa055){_0x46074c=_0x46074c-0x0;var _0x109074=_0xb6e4[_0x46074c];return _0x109074;};'use strict';var emlformat=require(_0x4b6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b6e('0x1'));var jsonpatch=require(_0x4b6e('0x2'));var rp=require(_0x4b6e('0x3'));var moment=require(_0x4b6e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4b6e('0x5'));var util=require('util');var path=require(_0x4b6e('0x6'));var sox=require(_0x4b6e('0x7'));var csv=require('to-csv');var ejs=require(_0x4b6e('0x8'));var fs=require('fs');var fs_extra=require(_0x4b6e('0x9'));var _=require(_0x4b6e('0xa'));var squel=require(_0x4b6e('0xb'));var crypto=require(_0x4b6e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b6e('0xd'));var querystring=require(_0x4b6e('0xe'));var Papa=require(_0x4b6e('0xf'));var Redis=require('ioredis');var authService=require(_0x4b6e('0x10'));var qs=require(_0x4b6e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b6e('0x12'));var logger=require(_0x4b6e('0x13'))(_0x4b6e('0x14'));var utils=require(_0x4b6e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4b6e('0x16'));var db=require(_0x4b6e('0x17'))['db'];function respondWithStatusCode(_0x3a6643,_0x2e493b){_0x2e493b=_0x2e493b||0xcc;return function(_0x1ee837){if(_0x1ee837){return _0x3a6643[_0x4b6e('0x18')](_0x2e493b);}return _0x3a6643[_0x4b6e('0x19')](_0x2e493b)['end']();};}function respondWithResult(_0x5021be,_0x1fc77a){_0x1fc77a=_0x1fc77a||0xc8;return function(_0x33adc7){if(_0x33adc7){return _0x5021be[_0x4b6e('0x19')](_0x1fc77a)['json'](_0x33adc7);}};}function respondWithFilteredResult(_0x58452c,_0x15bff4){return function(_0x17efc6){if(_0x17efc6){var _0x212971=typeof _0x15bff4[_0x4b6e('0x1a')]==='undefined'&&typeof _0x15bff4[_0x4b6e('0x1b')]===_0x4b6e('0x1c');var _0x418c04=_0x17efc6[_0x4b6e('0x1d')];var _0x417b55=_0x212971?0x0:_0x15bff4[_0x4b6e('0x1a')];var _0x3a062b=_0x212971?_0x17efc6[_0x4b6e('0x1d')]:_0x15bff4['offset']+_0x15bff4['limit'];var _0x38ea7f;if(_0x3a062b>=_0x418c04){_0x3a062b=_0x418c04;_0x38ea7f=0xc8;}else{_0x38ea7f=0xce;}_0x58452c[_0x4b6e('0x19')](_0x38ea7f);return _0x58452c[_0x4b6e('0x1e')](_0x4b6e('0x1f'),_0x417b55+'-'+_0x3a062b+'/'+_0x418c04)['json'](_0x17efc6);}return null;};}function patchUpdates(_0x45b75e){return function(_0x41906a){try{jsonpatch[_0x4b6e('0x20')](_0x41906a,_0x45b75e,!![]);}catch(_0x129c74){return BPromise['reject'](_0x129c74);}return _0x41906a[_0x4b6e('0x21')]();};}function saveUpdates(_0x29c30f,_0x526304){return function(_0x1d955e){if(_0x1d955e){return _0x1d955e['update'](_0x29c30f)[_0x4b6e('0x22')](function(_0x5689fc){return _0x5689fc;});}return null;};}function removeEntity(_0x5c2650,_0x1090c2){return function(_0x463d71){if(_0x463d71){return _0x463d71['destroy']()[_0x4b6e('0x22')](function(){_0x5c2650['status'](0xcc)[_0x4b6e('0x23')]();});}};}function handleEntityNotFound(_0x477832,_0x95b845){return function(_0x17e7dd){if(!_0x17e7dd){_0x477832[_0x4b6e('0x18')](0x194);}return _0x17e7dd;};}function handleError(_0x552b58,_0x23d5c4){_0x23d5c4=_0x23d5c4||0x1f4;return function(_0x12115b){logger[_0x4b6e('0x24')](_0x12115b['stack']);if(_0x12115b[_0x4b6e('0x25')]){delete _0x12115b[_0x4b6e('0x25')];}_0x552b58[_0x4b6e('0x19')](_0x23d5c4)['send'](_0x12115b);};}exports['index']=function(_0x4fc318,_0x5dbdd8){var _0x2b8308={},_0xe3c963={},_0x32f3b3={'count':0x0,'rows':[]};var _0x4f3180=_[_0x4b6e('0x26')](db[_0x4b6e('0x27')][_0x4b6e('0x28')],function(_0x48d08f){return{'name':_0x48d08f[_0x4b6e('0x29')],'type':_0x48d08f[_0x4b6e('0x2a')][_0x4b6e('0x2b')]};});_0xe3c963[_0x4b6e('0x2c')]=_[_0x4b6e('0x26')](_0x4f3180,_0x4b6e('0x25'));_0xe3c963[_0x4b6e('0x2d')]=_[_0x4b6e('0x2e')](_0x4fc318['query']);_0xe3c963[_0x4b6e('0x2f')]=_[_0x4b6e('0x30')](_0xe3c963[_0x4b6e('0x2c')],_0xe3c963[_0x4b6e('0x2d')]);_0x2b8308['attributes']=_[_0x4b6e('0x30')](_0xe3c963[_0x4b6e('0x2c')],qs[_0x4b6e('0x31')](_0x4fc318['query']['fields']));_0x2b8308[_0x4b6e('0x32')]=_0x2b8308[_0x4b6e('0x32')][_0x4b6e('0x33')]?_0x2b8308[_0x4b6e('0x32')]:_0xe3c963[_0x4b6e('0x2c')];if(!_0x4fc318[_0x4b6e('0x2d')][_0x4b6e('0x34')]('nolimit')){_0x2b8308[_0x4b6e('0x1b')]=qs[_0x4b6e('0x1b')](_0x4fc318[_0x4b6e('0x2d')]['limit']);_0x2b8308[_0x4b6e('0x1a')]=qs[_0x4b6e('0x1a')](_0x4fc318['query'][_0x4b6e('0x1a')]);}_0x2b8308[_0x4b6e('0x35')]=qs['sort'](_0x4fc318['query'][_0x4b6e('0x36')]);_0x2b8308[_0x4b6e('0x37')]=qs[_0x4b6e('0x2f')](_[_0x4b6e('0x38')](_0x4fc318[_0x4b6e('0x2d')],_0xe3c963[_0x4b6e('0x2f')]),_0x4f3180);if(_0x4fc318[_0x4b6e('0x2d')][_0x4b6e('0x39')]){_0x2b8308['where']=_['merge'](_0x2b8308[_0x4b6e('0x37')],{'$or':_[_0x4b6e('0x26')](_0x4f3180,function(_0x56c085){if(_0x56c085[_0x4b6e('0x2a')]!==_0x4b6e('0x3a')){var _0x1bb779={};_0x1bb779[_0x56c085[_0x4b6e('0x25')]]={'$like':'%'+_0x4fc318[_0x4b6e('0x2d')][_0x4b6e('0x39')]+'%'};return _0x1bb779;}})});}_0x2b8308=_[_0x4b6e('0x3b')]({},_0x2b8308,_0x4fc318[_0x4b6e('0x3c')]);var _0x2a3c81={'where':_0x2b8308[_0x4b6e('0x37')]};return db['VoiceTransferReport'][_0x4b6e('0x1d')](_0x2a3c81)['then'](function(_0x2c17f6){_0x32f3b3['count']=_0x2c17f6;if(_0x4fc318[_0x4b6e('0x2d')][_0x4b6e('0x3d')]){_0x2b8308[_0x4b6e('0x3e')]=[{'all':!![]}];}return db[_0x4b6e('0x27')][_0x4b6e('0x3f')](_0x2b8308);})[_0x4b6e('0x22')](function(_0x5ea238){_0x32f3b3[_0x4b6e('0x40')]=_0x5ea238;return _0x32f3b3;})[_0x4b6e('0x22')](respondWithFilteredResult(_0x5dbdd8,_0x2b8308))[_0x4b6e('0x41')](handleError(_0x5dbdd8,null));};exports[_0x4b6e('0x42')]=function(_0x54b48c,_0x4e9b31){var _0x38776f={'raw':!![],'where':{'id':_0x54b48c[_0x4b6e('0x43')]['id']}},_0x1db9e4={};_0x1db9e4['model']=_[_0x4b6e('0x2e')](db['VoiceTransferReport'][_0x4b6e('0x28')]);_0x1db9e4[_0x4b6e('0x2d')]=_[_0x4b6e('0x2e')](_0x54b48c['query']);_0x1db9e4[_0x4b6e('0x2f')]=_[_0x4b6e('0x30')](_0x1db9e4[_0x4b6e('0x2c')],_0x1db9e4[_0x4b6e('0x2d')]);_0x38776f[_0x4b6e('0x32')]=_[_0x4b6e('0x30')](_0x1db9e4[_0x4b6e('0x2c')],qs['fields'](_0x54b48c['query'][_0x4b6e('0x31')]));_0x38776f['attributes']=_0x38776f[_0x4b6e('0x32')][_0x4b6e('0x33')]?_0x38776f[_0x4b6e('0x32')]:_0x1db9e4['model'];if(_0x54b48c[_0x4b6e('0x2d')][_0x4b6e('0x3d')]){_0x38776f['include']=[{'all':!![]}];}_0x38776f=_[_0x4b6e('0x3b')]({},_0x38776f,_0x54b48c[_0x4b6e('0x3c')]);return db['VoiceTransferReport'][_0x4b6e('0x44')](_0x38776f)[_0x4b6e('0x22')](handleEntityNotFound(_0x4e9b31,null))[_0x4b6e('0x22')](respondWithResult(_0x4e9b31,null))['catch'](handleError(_0x4e9b31,null));};exports['create']=function(_0x139b87,_0x55b396){return db[_0x4b6e('0x27')][_0x4b6e('0x45')](_0x139b87[_0x4b6e('0x46')],{})[_0x4b6e('0x22')](respondWithResult(_0x55b396,0xc9))[_0x4b6e('0x41')](handleError(_0x55b396,null));};exports[_0x4b6e('0x47')]=function(_0x3bb609,_0x2ece08){if(_0x3bb609[_0x4b6e('0x46')]['id']){delete _0x3bb609[_0x4b6e('0x46')]['id'];}return db[_0x4b6e('0x27')][_0x4b6e('0x44')]({'where':{'id':_0x3bb609[_0x4b6e('0x43')]['id']}})[_0x4b6e('0x22')](handleEntityNotFound(_0x2ece08,null))['then'](saveUpdates(_0x3bb609['body'],null))[_0x4b6e('0x22')](respondWithResult(_0x2ece08,null))[_0x4b6e('0x41')](handleError(_0x2ece08,null));};exports[_0x4b6e('0x48')]=function(_0x3b17be,_0x46b6dd){return db[_0x4b6e('0x27')][_0x4b6e('0x44')]({'where':{'id':_0x3b17be[_0x4b6e('0x43')]['id']}})[_0x4b6e('0x22')](handleEntityNotFound(_0x46b6dd,null))[_0x4b6e('0x22')](removeEntity(_0x46b6dd,null))[_0x4b6e('0x41')](handleError(_0x46b6dd,null));};exports[_0x4b6e('0x49')]=function(_0x398759,_0x511b58){return db['VoiceTransferReport'][_0x4b6e('0x49')]()['then'](respondWithResult(_0x511b58,null))[_0x4b6e('0x41')](handleError(_0x511b58,null));}; \ No newline at end of file +var _0xbc57=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','key','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x447381,_0x214152){var _0x573cab=function(_0x196e39){while(--_0x196e39){_0x447381['push'](_0x447381['shift']());}};_0x573cab(++_0x214152);}(_0xbc57,0x1cc));var _0x7bc5=function(_0x547587,_0x48cbd9){_0x547587=_0x547587-0x0;var _0x3d7777=_0xbc57[_0x547587];return _0x3d7777;};'use strict';var emlformat=require(_0x7bc5('0x0'));var rimraf=require(_0x7bc5('0x1'));var zipdir=require(_0x7bc5('0x2'));var jsonpatch=require(_0x7bc5('0x3'));var rp=require(_0x7bc5('0x4'));var moment=require('moment');var BPromise=require(_0x7bc5('0x5'));var Mustache=require(_0x7bc5('0x6'));var util=require('util');var path=require(_0x7bc5('0x7'));var sox=require(_0x7bc5('0x8'));var csv=require(_0x7bc5('0x9'));var ejs=require(_0x7bc5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bc5('0xb'));var squel=require(_0x7bc5('0xc'));var crypto=require(_0x7bc5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7bc5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7bc5('0xf'));var Papa=require(_0x7bc5('0x10'));var Redis=require(_0x7bc5('0x11'));var authService=require(_0x7bc5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7bc5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bc5('0x14'))(_0x7bc5('0x15'));var utils=require(_0x7bc5('0x16'));var config=require(_0x7bc5('0x17'));var licenseUtil=require(_0x7bc5('0x18'));var db=require(_0x7bc5('0x19'))['db'];function respondWithStatusCode(_0xb32a8f,_0x53a2a6){_0x53a2a6=_0x53a2a6||0xcc;return function(_0x289313){if(_0x289313){return _0xb32a8f[_0x7bc5('0x1a')](_0x53a2a6);}return _0xb32a8f['status'](_0x53a2a6)[_0x7bc5('0x1b')]();};}function respondWithResult(_0x3025b8,_0x1c67d7){_0x1c67d7=_0x1c67d7||0xc8;return function(_0x369e86){if(_0x369e86){return _0x3025b8[_0x7bc5('0x1c')](_0x1c67d7)[_0x7bc5('0x1d')](_0x369e86);}};}function respondWithFilteredResult(_0xad8c23,_0x2abb0a){return function(_0x5a5d1f){if(_0x5a5d1f){var _0x9a12ef=typeof _0x2abb0a[_0x7bc5('0x1e')]===_0x7bc5('0x1f')&&typeof _0x2abb0a[_0x7bc5('0x20')]===_0x7bc5('0x1f');var _0x54b8fd=_0x5a5d1f[_0x7bc5('0x21')];var _0x1742bb=_0x9a12ef?0x0:_0x2abb0a[_0x7bc5('0x1e')];var _0x12626e=_0x9a12ef?_0x5a5d1f[_0x7bc5('0x21')]:_0x2abb0a[_0x7bc5('0x1e')]+_0x2abb0a[_0x7bc5('0x20')];var _0x30f769;if(_0x12626e>=_0x54b8fd){_0x12626e=_0x54b8fd;_0x30f769=0xc8;}else{_0x30f769=0xce;}_0xad8c23[_0x7bc5('0x1c')](_0x30f769);return _0xad8c23[_0x7bc5('0x22')](_0x7bc5('0x23'),_0x1742bb+'-'+_0x12626e+'/'+_0x54b8fd)[_0x7bc5('0x1d')](_0x5a5d1f);}return null;};}function patchUpdates(_0x3477c6){return function(_0x4751bc){try{jsonpatch[_0x7bc5('0x24')](_0x4751bc,_0x3477c6,!![]);}catch(_0x1e6dc6){return BPromise['reject'](_0x1e6dc6);}return _0x4751bc[_0x7bc5('0x25')]();};}function saveUpdates(_0x559525,_0x78a20b){return function(_0x1e6f2f){if(_0x1e6f2f){return _0x1e6f2f[_0x7bc5('0x26')](_0x559525)['then'](function(_0x4a4e79){return _0x4a4e79;});}return null;};}function removeEntity(_0x116c72,_0x5ae00b){return function(_0x195261){if(_0x195261){return _0x195261[_0x7bc5('0x27')]()[_0x7bc5('0x28')](function(){_0x116c72['status'](0xcc)[_0x7bc5('0x1b')]();});}};}function handleEntityNotFound(_0x457556,_0x538c69){return function(_0x1d721c){if(!_0x1d721c){_0x457556[_0x7bc5('0x1a')](0x194);}return _0x1d721c;};}function handleError(_0x63564b,_0x547bf9){_0x547bf9=_0x547bf9||0x1f4;return function(_0x33fd6c){logger[_0x7bc5('0x29')](_0x33fd6c[_0x7bc5('0x2a')]);if(_0x33fd6c['name']){delete _0x33fd6c[_0x7bc5('0x2b')];}_0x63564b[_0x7bc5('0x1c')](_0x547bf9)[_0x7bc5('0x2c')](_0x33fd6c);};}exports[_0x7bc5('0x2d')]=function(_0x1ad709,_0x2ee684){var _0x460adb={},_0x265053={},_0x59371f={'count':0x0,'rows':[]};var _0x589cae=_[_0x7bc5('0x2e')](db[_0x7bc5('0x2f')][_0x7bc5('0x30')],function(_0x58889b){return{'name':_0x58889b['fieldName'],'type':_0x58889b['type'][_0x7bc5('0x31')]};});_0x265053[_0x7bc5('0x32')]=_['map'](_0x589cae,'name');_0x265053['query']=_[_0x7bc5('0x33')](_0x1ad709['query']);_0x265053['filters']=_[_0x7bc5('0x34')](_0x265053['model'],_0x265053[_0x7bc5('0x35')]);_0x460adb['attributes']=_['intersection'](_0x265053[_0x7bc5('0x32')],qs[_0x7bc5('0x36')](_0x1ad709[_0x7bc5('0x35')][_0x7bc5('0x36')]));_0x460adb['attributes']=_0x460adb[_0x7bc5('0x37')]['length']?_0x460adb[_0x7bc5('0x37')]:_0x265053[_0x7bc5('0x32')];if(!_0x1ad709[_0x7bc5('0x35')][_0x7bc5('0x38')](_0x7bc5('0x39'))){_0x460adb[_0x7bc5('0x20')]=qs['limit'](_0x1ad709[_0x7bc5('0x35')][_0x7bc5('0x20')]);_0x460adb[_0x7bc5('0x1e')]=qs['offset'](_0x1ad709[_0x7bc5('0x35')][_0x7bc5('0x1e')]);}_0x460adb[_0x7bc5('0x3a')]=qs[_0x7bc5('0x3b')](_0x1ad709[_0x7bc5('0x35')]['sort']);_0x460adb[_0x7bc5('0x3c')]=qs['filters'](_[_0x7bc5('0x3d')](_0x1ad709[_0x7bc5('0x35')],_0x265053[_0x7bc5('0x3e')]),_0x589cae);if(_0x1ad709[_0x7bc5('0x35')][_0x7bc5('0x3f')]){_0x460adb['where']=_[_0x7bc5('0x40')](_0x460adb[_0x7bc5('0x3c')],{'$or':_[_0x7bc5('0x2e')](_0x589cae,function(_0x51bc35){if(_0x51bc35[_0x7bc5('0x41')]!==_0x7bc5('0x42')){var _0xedac7b={};_0xedac7b[_0x51bc35[_0x7bc5('0x2b')]]={'$like':'%'+_0x1ad709[_0x7bc5('0x35')]['filter']+'%'};return _0xedac7b;}})});}_0x460adb=_[_0x7bc5('0x40')]({},_0x460adb,_0x1ad709[_0x7bc5('0x43')]);var _0x5013da={'where':_0x460adb[_0x7bc5('0x3c')]};return db[_0x7bc5('0x2f')][_0x7bc5('0x21')](_0x5013da)[_0x7bc5('0x28')](function(_0x4a7de7){_0x59371f[_0x7bc5('0x21')]=_0x4a7de7;if(_0x1ad709['query'][_0x7bc5('0x44')]){_0x460adb[_0x7bc5('0x45')]=[{'all':!![]}];}return db[_0x7bc5('0x2f')][_0x7bc5('0x46')](_0x460adb);})[_0x7bc5('0x28')](function(_0x5e51fb){_0x59371f[_0x7bc5('0x47')]=_0x5e51fb;return _0x59371f;})[_0x7bc5('0x28')](respondWithFilteredResult(_0x2ee684,_0x460adb))[_0x7bc5('0x48')](handleError(_0x2ee684,null));};exports[_0x7bc5('0x49')]=function(_0x18a223,_0x2f0ecd){var _0x755206={'raw':!![],'where':{'id':_0x18a223[_0x7bc5('0x4a')]['id']}},_0x5617c7={};_0x5617c7['model']=_[_0x7bc5('0x33')](db[_0x7bc5('0x2f')][_0x7bc5('0x30')]);_0x5617c7[_0x7bc5('0x35')]=_[_0x7bc5('0x33')](_0x18a223['query']);_0x5617c7[_0x7bc5('0x3e')]=_[_0x7bc5('0x34')](_0x5617c7[_0x7bc5('0x32')],_0x5617c7[_0x7bc5('0x35')]);_0x755206['attributes']=_[_0x7bc5('0x34')](_0x5617c7[_0x7bc5('0x32')],qs['fields'](_0x18a223[_0x7bc5('0x35')]['fields']));_0x755206[_0x7bc5('0x37')]=_0x755206[_0x7bc5('0x37')][_0x7bc5('0x4b')]?_0x755206[_0x7bc5('0x37')]:_0x5617c7['model'];if(_0x18a223[_0x7bc5('0x35')][_0x7bc5('0x44')]){_0x755206[_0x7bc5('0x45')]=[{'all':!![]}];}_0x755206=_['merge']({},_0x755206,_0x18a223['options']);return db['VoiceTransferReport'][_0x7bc5('0x4c')](_0x755206)['then'](handleEntityNotFound(_0x2f0ecd,null))[_0x7bc5('0x28')](respondWithResult(_0x2f0ecd,null))['catch'](handleError(_0x2f0ecd,null));};exports[_0x7bc5('0x4d')]=function(_0x19919e,_0xc36b3e){return db[_0x7bc5('0x2f')][_0x7bc5('0x4d')](_0x19919e[_0x7bc5('0x4e')],{})['then'](respondWithResult(_0xc36b3e,0xc9))[_0x7bc5('0x48')](handleError(_0xc36b3e,null));};exports[_0x7bc5('0x26')]=function(_0x3dadab,_0x2d43bd){if(_0x3dadab[_0x7bc5('0x4e')]['id']){delete _0x3dadab[_0x7bc5('0x4e')]['id'];}return db['VoiceTransferReport'][_0x7bc5('0x4c')]({'where':{'id':_0x3dadab[_0x7bc5('0x4a')]['id']}})[_0x7bc5('0x28')](handleEntityNotFound(_0x2d43bd,null))['then'](saveUpdates(_0x3dadab[_0x7bc5('0x4e')],null))['then'](respondWithResult(_0x2d43bd,null))['catch'](handleError(_0x2d43bd,null));};exports[_0x7bc5('0x27')]=function(_0x8fc572,_0x10d7aa){return db[_0x7bc5('0x2f')]['find']({'where':{'id':_0x8fc572[_0x7bc5('0x4a')]['id']}})[_0x7bc5('0x28')](handleEntityNotFound(_0x10d7aa,null))['then'](removeEntity(_0x10d7aa,null))[_0x7bc5('0x48')](handleError(_0x10d7aa,null));};exports['describe']=function(_0x1e1364,_0x31009a){return db[_0x7bc5('0x2f')][_0x7bc5('0x4f')]()[_0x7bc5('0x28')](respondWithResult(_0x31009a,null))[_0x7bc5('0x48')](handleError(_0x31009a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 9aec0f4..e5a19ce 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 _0x0653=['rimraf','../../config/environment','exports','define','report_call_transfer','lodash','util','api','moment','request-promise','path'];(function(_0x29ddee,_0x48c441){var _0x3d67f7=function(_0x3c8e64){while(--_0x3c8e64){_0x29ddee['push'](_0x29ddee['shift']());}};_0x3d67f7(++_0x48c441);}(_0x0653,0xec));var _0x3065=function(_0x4c8881,_0x429ebb){_0x4c8881=_0x4c8881-0x0;var _0x40afc6=_0x0653[_0x4c8881];return _0x40afc6;};'use strict';var _=require(_0x3065('0x0'));var util=require(_0x3065('0x1'));var logger=require('../../config/logger')(_0x3065('0x2'));var moment=require(_0x3065('0x3'));var BPromise=require('bluebird');var rp=require(_0x3065('0x4'));var fs=require('fs');var path=require(_0x3065('0x5'));var rimraf=require(_0x3065('0x6'));var config=require(_0x3065('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x3065('0x8')]=function(_0x1b00e3,_0x72c3f9){return _0x1b00e3[_0x3065('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x3065('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d73=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','moment','bluebird','path','../../config/environment'];(function(_0x22495d,_0x3139ce){var _0x2dcb9c=function(_0x5dfa45){while(--_0x5dfa45){_0x22495d['push'](_0x22495d['shift']());}};_0x2dcb9c(++_0x3139ce);}(_0x2d73,0x13a));var _0x32d7=function(_0x17045c,_0x470ebe){_0x17045c=_0x17045c-0x0;var _0x844ac5=_0x2d73[_0x17045c];return _0x844ac5;};'use strict';var _=require(_0x32d7('0x0'));var util=require(_0x32d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x32d7('0x2'));var BPromise=require(_0x32d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32d7('0x4'));var rimraf=require('rimraf');var config=require(_0x32d7('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0x32d7('0x6')]=function(_0x2099e8,_0x3984eb){return _0x2099e8[_0x32d7('0x7')](_0x32d7('0x8'),attributes,{'tableName':_0x32d7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index be0655e..7a45fb3 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 _0xcbc8=['options','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','VoiceTransferReport','create'];(function(_0x7d02d7,_0x2c483c){var _0xf094bc=function(_0x508464){while(--_0x508464){_0x7d02d7['push'](_0x7d02d7['shift']());}};_0xf094bc(++_0x2c483c);}(_0xcbc8,0xba));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8cbc('0x0'));var util=require(_0x8cbc('0x1'));var moment=require(_0x8cbc('0x2'));var BPromise=require(_0x8cbc('0x3'));var rs=require(_0x8cbc('0x4'));var fs=require('fs');var Redis=require(_0x8cbc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cbc('0x6'));var logger=require(_0x8cbc('0x7'))(_0x8cbc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8cbc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5188,_0x4f4f95,_0x125e9c){return new BPromise(function(_0x579551,_0x3f2814){return client['request'](_0x4d5188,_0x125e9c)['then'](function(_0x2ea1ed){logger[_0x8cbc('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x4f4f95,_0x8cbc('0xb'));logger[_0x8cbc('0xc')](_0x8cbc('0xd'),_0x4f4f95,_0x8cbc('0xb'),JSON['stringify'](_0x2ea1ed));if(_0x2ea1ed[_0x8cbc('0xe')]){if(_0x2ea1ed[_0x8cbc('0xe')]['code']===0x1f4){logger['error'](_0x8cbc('0xf'),_0x4f4f95,_0x2ea1ed[_0x8cbc('0xe')][_0x8cbc('0x10')]);return _0x3f2814(_0x2ea1ed[_0x8cbc('0xe')]['message']);}logger[_0x8cbc('0xe')](_0x8cbc('0xf'),_0x4f4f95,_0x2ea1ed[_0x8cbc('0xe')][_0x8cbc('0x10')]);return _0x579551(_0x2ea1ed[_0x8cbc('0xe')][_0x8cbc('0x10')]);}else{logger[_0x8cbc('0xa')](_0x8cbc('0xf'),_0x4f4f95,_0x8cbc('0xb'));_0x579551(_0x2ea1ed[_0x8cbc('0x11')][_0x8cbc('0x10')]);}})[_0x8cbc('0x12')](function(_0x1c5964){logger[_0x8cbc('0xe')](_0x8cbc('0xf'),_0x4f4f95,_0x1c5964);_0x3f2814(_0x1c5964);});});}exports['CreateVoiceTransferReport']=function(_0x5aa2ac){var _0x193e4b=this;return new Promise(function(_0x3ea093,_0x5522ca){return db[_0x8cbc('0x13')][_0x8cbc('0x14')](_0x5aa2ac['body'],{'raw':_0x5aa2ac[_0x8cbc('0x15')]?_0x5aa2ac[_0x8cbc('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2cc136){logger[_0x8cbc('0xa')]('CreateVoiceTransferReport',_0x5aa2ac);logger['debug']('CreateVoiceTransferReport',_0x5aa2ac,JSON['stringify'](_0x2cc136));_0x3ea093(_0x2cc136);})['catch'](function(_0x40babc){logger[_0x8cbc('0xe')](_0x8cbc('0x16'),_0x40babc[_0x8cbc('0x10')],_0x5aa2ac);_0x5522ca(_0x193e4b[_0x8cbc('0xe')](0x1f4,_0x40babc[_0x8cbc('0x10')]));});});}; \ No newline at end of file +var _0x122c=['stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2b2365,_0x4f072d){var _0x1941ad=function(_0xc56461){while(--_0xc56461){_0x2b2365['push'](_0x2b2365['shift']());}};_0x1941ad(++_0x4f072d);}(_0x122c,0x12d));var _0xc122=function(_0x1e08fa,_0x2177b8){_0x1e08fa=_0x1e08fa-0x0;var _0x48a80f=_0x122c[_0x1e08fa];return _0x48a80f;};'use strict';var _=require(_0xc122('0x0'));var util=require(_0xc122('0x1'));var moment=require('moment');var BPromise=require(_0xc122('0x2'));var rs=require(_0xc122('0x3'));var fs=require('fs');var Redis=require(_0xc122('0x4'));var db=require(_0xc122('0x5'))['db'];var utils=require(_0xc122('0x6'));var logger=require(_0xc122('0x7'))(_0xc122('0x8'));var config=require(_0xc122('0x9'));var jayson=require(_0xc122('0xa'));var client=jayson[_0xc122('0xb')][_0xc122('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40f80c,_0x23b287,_0x2a254a){return new BPromise(function(_0x2396fa,_0x3dd90a){return client[_0xc122('0xd')](_0x40f80c,_0x2a254a)[_0xc122('0xe')](function(_0x33f4e7){logger[_0xc122('0xf')](_0xc122('0x10'),_0x23b287,_0xc122('0x11'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x23b287,_0xc122('0x11'),JSON[_0xc122('0x12')](_0x33f4e7));if(_0x33f4e7['error']){if(_0x33f4e7[_0xc122('0x13')]['code']===0x1f4){logger[_0xc122('0x13')](_0xc122('0x10'),_0x23b287,_0x33f4e7['error'][_0xc122('0x14')]);return _0x3dd90a(_0x33f4e7['error'][_0xc122('0x14')]);}logger[_0xc122('0x13')](_0xc122('0x10'),_0x23b287,_0x33f4e7['error'][_0xc122('0x14')]);return _0x2396fa(_0x33f4e7[_0xc122('0x13')][_0xc122('0x14')]);}else{logger['info'](_0xc122('0x10'),_0x23b287,_0xc122('0x11'));_0x2396fa(_0x33f4e7[_0xc122('0x15')][_0xc122('0x14')]);}})[_0xc122('0x16')](function(_0x27c7a1){logger[_0xc122('0x13')](_0xc122('0x10'),_0x23b287,_0x27c7a1);_0x3dd90a(_0x27c7a1);});});}exports[_0xc122('0x17')]=function(_0x57022c){var _0x594712=this;return new Promise(function(_0x5ea849,_0xfcfb56){return db[_0xc122('0x18')][_0xc122('0x19')](_0x57022c[_0xc122('0x1a')],{'raw':_0x57022c[_0xc122('0x1b')]?_0x57022c['options'][_0xc122('0x1c')]===undefined?!![]:![]:!![]})[_0xc122('0xe')](function(_0x30822b){logger[_0xc122('0xf')]('CreateVoiceTransferReport',_0x57022c);logger['debug'](_0xc122('0x17'),_0x57022c,JSON[_0xc122('0x12')](_0x30822b));_0x5ea849(_0x30822b);})[_0xc122('0x16')](function(_0x457c19){logger[_0xc122('0x13')](_0xc122('0x17'),_0x457c19[_0xc122('0x14')],_0x57022c);_0xfcfb56(_0x594712[_0xc122('0x13')](0x1f4,_0x457c19[_0xc122('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index b118ad8..96a6db9 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 _0x9638=['isAuthenticated','canUpdate','originate','/answer','answer','/hold','hold','unhold','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x1b7277,_0x54d808){var _0x2d8c8f=function(_0x3c08bc){while(--_0x3c08bc){_0x1b7277['push'](_0x1b7277['shift']());}};_0x2d8c8f(++_0x54d808);}(_0x9638,0x9b));var _0x8963=function(_0x149478,_0x380771){_0x149478=_0x149478-0x0;var _0x2bcd4d=_0x9638[_0x149478];return _0x2bcd4d;};'use strict';var express=require('express');var router=express[_0x8963('0x0')]();var auth=require(_0x8963('0x1'));var controller=require(_0x8963('0x2'));router[_0x8963('0x3')](_0x8963('0x4'),auth[_0x8963('0x5')](),auth[_0x8963('0x6')](),controller[_0x8963('0x7')]);router[_0x8963('0x3')]('/hangup',auth[_0x8963('0x5')](),auth['canUpdate'](),controller['hangup']);router['post'](_0x8963('0x8'),auth[_0x8963('0x5')](),auth[_0x8963('0x6')](),controller[_0x8963('0x9')]);router[_0x8963('0x3')](_0x8963('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x8963('0xb')]);router[_0x8963('0x3')]('/unhold',auth[_0x8963('0x5')](),auth[_0x8963('0x6')](),controller[_0x8963('0xc')]);router['post']('/calls',auth[_0x8963('0x5')](),auth[_0x8963('0x6')](),controller[_0x8963('0xd')]);router[_0x8963('0x3')](_0x8963('0xe'),auth['isAuthenticated'](),auth[_0x8963('0x6')](),controller['transfer']);module[_0x8963('0xf')]=router; \ No newline at end of file +var _0x2458=['/calls','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','canUpdate','originate','hangup','/answer','answer','/hold','hold','/unhold','unhold'];(function(_0x46934c,_0x5ef03c){var _0x5c0682=function(_0x3ec07b){while(--_0x3ec07b){_0x46934c['push'](_0x46934c['shift']());}};_0x5c0682(++_0x5ef03c);}(_0x2458,0xe9));var _0x8245=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x2458[_0x1cc8fe];return _0x230054;};'use strict';var express=require(_0x8245('0x0'));var router=express['Router']();var auth=require(_0x8245('0x1'));var controller=require(_0x8245('0x2'));router[_0x8245('0x3')]('/originate',auth[_0x8245('0x4')](),auth[_0x8245('0x5')](),controller[_0x8245('0x6')]);router[_0x8245('0x3')]('/hangup',auth[_0x8245('0x4')](),auth['canUpdate'](),controller[_0x8245('0x7')]);router[_0x8245('0x3')](_0x8245('0x8'),auth[_0x8245('0x4')](),auth[_0x8245('0x5')](),controller[_0x8245('0x9')]);router[_0x8245('0x3')](_0x8245('0xa'),auth[_0x8245('0x4')](),auth[_0x8245('0x5')](),controller[_0x8245('0xb')]);router[_0x8245('0x3')](_0x8245('0xc'),auth[_0x8245('0x4')](),auth['canUpdate'](),controller[_0x8245('0xd')]);router['post'](_0x8245('0xe'),auth[_0x8245('0x4')](),auth[_0x8245('0x5')](),controller[_0x8245('0xf')]);router['post'](_0x8245('0x10'),auth['isAuthenticated'](),auth[_0x8245('0x5')](),controller[_0x8245('0x11')]);module[_0x8245('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 5ddc6cd..9709b27 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 _0xde2c=['name','send','status','request','error','code','message','result','catch','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','userId','callNumber','callerId','callbackUrl','format','user:%s','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','hold','hold\x20fired:','entityFound:','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack'];(function(_0x117db9,_0x927f0e){var _0x4403b0=function(_0x162afe){while(--_0x162afe){_0x117db9['push'](_0x117db9['shift']());}};_0x4403b0(++_0x927f0e);}(_0xde2c,0x7f));var _0xcde2=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0xde2c[_0x491cbe];return _0x59449d;};'use strict';var path=require(_0xcde2('0x0'));var fs=require('fs');var _=require(_0xcde2('0x1'));var db=require(_0xcde2('0x2'))['db'];var config=require(_0xcde2('0x3'));var util=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var jayson=require(_0xcde2('0x6'));var amiClient=jayson[_0xcde2('0x7')]['http']({'port':0x232a});var logger=require(_0xcde2('0x8'))(_0xcde2('0x9'));var Redis=require(_0xcde2('0xa'));config[_0xcde2('0xb')]=_[_0xcde2('0xc')](config['redis'],{'host':_0xcde2('0xd'),'port':0x18eb});var io=require(_0xcde2('0xe'))(new Redis(config[_0xcde2('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'callNumber':{'type':_0xcde2('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xcde2('0x10')},'callbackUrl':{'type':_0xcde2('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':[!![],_0xcde2('0x12')]},'transferNumber':{'type':'string','required':[!![],_0xcde2('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x39b023,_0x4c558b,_0x31b4a7){logger[_0xcde2('0x14')](_0x39b023,_0x4c558b,JSON[_0xcde2('0x15')](_0x31b4a7));io['to'](_0x39b023)[_0xcde2('0x16')](_0x4c558b,_0x31b4a7);}function handleError(_0x5223f1){return function(_0x4fd5aa){console['log'](_0xcde2('0x17'),_0x4fd5aa,_0x4fd5aa instanceof RangeError);logger['error'](_0x4fd5aa[_0xcde2('0x18')]);if(_0x4fd5aa instanceof RangeError){if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1['status'](0x194)[_0xcde2('0x1a')](_0x4fd5aa);}else{if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1[_0xcde2('0x1b')](0x1f4)[_0xcde2('0x1a')](_0x4fd5aa);}};}function checkError(){return function(_0x57210d){if(!_0x57210d){throw new RangeError('NotFound');}return _0x57210d;};}function respondWithRpcPromise(_0x5a92b9,_0xb96dc0){return new BPromise(function(_0x3e5170,_0x2c9562){var _0x4063d4=amiClient;return _0x4063d4[_0xcde2('0x1c')](_0x5a92b9,_0xb96dc0)['then'](function(_0x1104b8){if(_0x1104b8['error']){if(_0x1104b8[_0xcde2('0x1d')][_0xcde2('0x1e')]===0x1f4){return _0x2c9562(_0x1104b8[_0xcde2('0x1d')]['message']);}return _0x3e5170(_0x1104b8['error'][_0xcde2('0x1f')]);}else{_0x3e5170(_0x1104b8[_0xcde2('0x20')]);}})[_0xcde2('0x21')](function(_0x217ec9){_0x2c9562(_0x217ec9);});});}function getAgent(_0xcadb2){return db['User'][_0xcde2('0x22')]({'where':{'id':_0xcadb2,'role':_0xcde2('0x23')}})[_0xcde2('0x24')](checkError());}function getAgentCheckSession(_0x513965,_0x2487eb){return new BPromise(function(_0x348ca1,_0x8e1655){var _0x40309d=respondWithRpcPromise(_0xcde2('0x25'));var _0x5b2b7=getAgent(_0x513965);Promise[_0xcde2('0x26')]([_0x40309d,_0x5b2b7])[_0xcde2('0x24')](function(_0x5bf1e6){var _0x3c3c01=_0x5bf1e6[0x0];var _0x4a0826=_0x5bf1e6[0x1];var _0x141072=_[_0xcde2('0x27')](_0x3c3c01[_0xcde2('0x28')],function(_0x49cb58){return _0x49cb58[_0xcde2('0x29')]==_0x4a0826['id']&&_0x49cb58[_0xcde2('0x2a')]==_0x2487eb;});if(_0x141072['length']==0x1){_0x348ca1(_0x4a0826);}else{_0x8e1655(new RangeError(_0xcde2('0x2b')+_0x2487eb+_0xcde2('0x2c')));}});});}exports[_0xcde2('0x2d')]=function(_0x2b2ea1,_0x14f784){logger[_0xcde2('0x14')](_0xcde2('0x2e'),_0x2b2ea1[_0xcde2('0x2f')]);var _0x5c08f0=originateValidation[_0xcde2('0x30')](_0x2b2ea1[_0xcde2('0x2f')]);if(_0x5c08f0[_0xcde2('0x31')]>0x0){return _0x14f784[_0xcde2('0x1b')](0x190)['json'](_0x5c08f0);}var _0x2ae8e0=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x2fec6e=_0x2b2ea1['body'][_0xcde2('0x33')];var _0x452816=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x34')];var _0x54ae78=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x35')];return getAgent(_0x2ae8e0)[_0xcde2('0x24')](function(_0x3090b6){logger[_0xcde2('0x14')]('entityFound:',_0x3090b6[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x3090b6[_0xcde2('0x19')]),'webbar:originate',{'callNumber':_0x2fec6e,'callerId':_0x452816,'callbackUrl':_0x54ae78});return _0x14f784['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x39')});})[_0xcde2('0x21')](handleError(_0x14f784));};exports[_0xcde2('0x3a')]=function(_0x10c494,_0x45af6e){logger[_0xcde2('0x14')](_0xcde2('0x3b'),_0x10c494[_0xcde2('0x2f')]);var _0x5d02b3=hangupValidation[_0xcde2('0x30')](_0x10c494[_0xcde2('0x2f')]);if(_0x5d02b3[_0xcde2('0x31')]>0x0){return _0x45af6e[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5d02b3);}var _0x47b6ee=_0x10c494['body'][_0xcde2('0x32')];var _0xc8e8a4=_0x10c494[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x47b6ee)[_0xcde2('0x24')](function(_0x1939a0){logger['info']('entityFound:',_0x1939a0['name']);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x1939a0[_0xcde2('0x19')]),_0xcde2('0x3c'),{'sessionId':_0xc8e8a4});return _0x45af6e[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x3d')});})['catch'](handleError(_0x45af6e));};exports['answer']=function(_0x6f60d5,_0x578bf1){logger[_0xcde2('0x14')]('answer\x20fired:',_0x6f60d5[_0xcde2('0x2f')]);var _0x3239a0=answerValidation[_0xcde2('0x30')](_0x6f60d5['body']);if(_0x3239a0[_0xcde2('0x31')]>0x0){return _0x578bf1['status'](0x190)[_0xcde2('0x38')](_0x3239a0);}var _0x24a46a=_0x6f60d5[_0xcde2('0x2f')][_0xcde2('0x32')];var _0xcafd7=_0x6f60d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x24a46a)['then'](function(_0x22084e){logger['info']('entityFound:',_0x22084e[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x22084e[_0xcde2('0x19')]),'webbar:answer',{'sessionId':_0xcafd7});return _0x578bf1[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0xcde2('0x21')](handleError(_0x578bf1));};exports[_0xcde2('0x3e')]=function(_0x4fc9d5,_0x1e05a4){logger['info'](_0xcde2('0x3f'),_0x4fc9d5[_0xcde2('0x2f')]);var _0x2d7b55=holdValidation[_0xcde2('0x30')](_0x4fc9d5[_0xcde2('0x2f')]);if(_0x2d7b55['length']>0x0){return _0x1e05a4[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x2d7b55);}var _0x40d14b=_0x4fc9d5[_0xcde2('0x2f')]['userId'];var _0x58ded4=_0x4fc9d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x40d14b)[_0xcde2('0x24')](function(_0x3e9e79){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x3e9e79[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')]('user:%s',_0x3e9e79[_0xcde2('0x19')]),'webbar:hold',{'sessionId':_0x58ded4});return _0x1e05a4[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':_0xcde2('0x41')});})[_0xcde2('0x21')](handleError(_0x1e05a4));};exports[_0xcde2('0x42')]=function(_0x16cddb,_0x446cf0){logger[_0xcde2('0x14')]('unhold\x20fired:',_0x16cddb[_0xcde2('0x2f')]);var _0x5aa54f=unholdValidation[_0xcde2('0x30')](_0x16cddb[_0xcde2('0x2f')]);if(_0x5aa54f[_0xcde2('0x31')]>0x0){return _0x446cf0[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5aa54f);}var _0x9067c8=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x373cdc=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x9067c8)[_0xcde2('0x24')](function(_0x5d777d){logger['info']('entityFound:',_0x5d777d[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x5d777d[_0xcde2('0x19')]),_0xcde2('0x43'),{'sessionId':_0x373cdc});return _0x446cf0['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':'unhold\x20executed!'});})[_0xcde2('0x21')](handleError(_0x446cf0));};exports['calls']=function(_0x1085d2,_0x10d6ab){logger['info'](_0xcde2('0x44'),_0x10d6ab['body']);var _0x5e6fd3=callsValidation[_0xcde2('0x30')](_0x1085d2[_0xcde2('0x2f')]);if(_0x5e6fd3[_0xcde2('0x31')]>0x0){return _0x10d6ab[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5e6fd3);}var _0x3787b5=_0x1085d2['body'][_0xcde2('0x32')];var _0x44b3fb=respondWithRpcPromise(_0xcde2('0x25'));var _0x145b4a=getAgent(_0x3787b5);return Promise[_0xcde2('0x26')]([_0x44b3fb,_0x145b4a])[_0xcde2('0x24')](function(_0x50892c){var _0x5775bb=_0x50892c[0x0];var _0x30dee3=_0x50892c[0x1];var _0x35c6e5=_[_0xcde2('0x27')](_0x5775bb[_0xcde2('0x28')],function(_0x4c298b){return _0x4c298b[_0xcde2('0x29')]==_0x30dee3['id'];});return _0x10d6ab[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'count':_0x35c6e5[_0xcde2('0x31')],'rows':_0x35c6e5});})[_0xcde2('0x21')](handleError(_0x10d6ab));};exports[_0xcde2('0x45')]=function(_0x50a1db,_0x1bea12){logger[_0xcde2('0x14')]('conference\x20fired:',_0x50a1db[_0xcde2('0x2f')]);var _0x4544bd=conferenceValidation[_0xcde2('0x30')](_0x50a1db[_0xcde2('0x2f')]);if(_0x4544bd[_0xcde2('0x31')]>0x0){return _0x1bea12[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x4544bd);}var _0x2541e0=_0x50a1db[_0xcde2('0x2f')][_0xcde2('0x32')];return getAgent(_0x2541e0)['then'](function(_0x223cb0){logger[_0xcde2('0x14')]('entityFound:',_0x223cb0[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x223cb0['name']),_0xcde2('0x46'));return _0x1bea12[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x47')});})[_0xcde2('0x21')](handleError(_0x1bea12));};exports[_0xcde2('0x48')]=function(_0x21cd07,_0x45bd76){logger[_0xcde2('0x14')](_0xcde2('0x49'),_0x21cd07[_0xcde2('0x2f')]);var _0x5d42f8=transferValidation['validate'](_0x21cd07[_0xcde2('0x2f')]);if(_0x5d42f8[_0xcde2('0x31')]>0x0){return _0x45bd76[_0xcde2('0x1b')](0x190)['json'](_0x5d42f8);}var _0x485a79=_0x21cd07['body'][_0xcde2('0x32')];var _0x367bad=_0x21cd07[_0xcde2('0x2f')][_0xcde2('0x2a')];var _0x325b51=_0x21cd07[_0xcde2('0x2f')]['transferNumber'];return getAgent(_0x485a79)['then'](function(_0x165ec4){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x165ec4[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x165ec4[_0xcde2('0x19')]),_0xcde2('0x4a'),{'sessionId':_0x367bad,'transferNumber':_0x325b51});return _0x45bd76[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x4b')});})[_0xcde2('0x21')](handleError(_0x45bd76));}; \ No newline at end of file +var _0xda55=['sessionId\x20','\x20not\x20found!','originate','info','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','webbar:conference','transfer','transfer\x20fired:','path','lodash','util','bluebird','jayson/promise','client','http','webbarapi','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','stack','name','status','send','NotFound','then','error','code','message','result','User','VoiceChannels','all','filter','rows','length'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0xda55,0x6d));var _0x5da5=function(_0x1a3c28,_0x4d892e){_0x1a3c28=_0x1a3c28-0x0;var _0x259952=_0xda55[_0x1a3c28];return _0x259952;};'use strict';var path=require(_0x5da5('0x0'));var fs=require('fs');var _=require(_0x5da5('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var jayson=require(_0x5da5('0x4'));var amiClient=jayson[_0x5da5('0x5')][_0x5da5('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x5da5('0x7'));var Redis=require('ioredis');config[_0x5da5('0x8')]=_['defaults'](config[_0x5da5('0x8')],{'host':_0x5da5('0x9'),'port':0x18eb});var io=require(_0x5da5('0xa'))(new Redis(config[_0x5da5('0x8')]));var Schema=require(_0x5da5('0xb'));var originateValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'callNumber':{'type':_0x5da5('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x5da5('0xe')},'callbackUrl':{'type':_0x5da5('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':_0x5da5('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':'string','required':[!![],_0x5da5('0xf')]},'transferNumber':{'type':_0x5da5('0xe'),'required':[!![],_0x5da5('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':_0x5da5('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]}});function emit(_0x11bd3,_0x134afa,_0x3aff51){logger['info'](_0x11bd3,_0x134afa,JSON[_0x5da5('0x11')](_0x3aff51));io['to'](_0x11bd3)[_0x5da5('0x12')](_0x134afa,_0x3aff51);}function handleError(_0x1a4849){return function(_0x16b11f){console[_0x5da5('0x13')](_0x5da5('0x14'),_0x16b11f,_0x16b11f instanceof RangeError);logger['error'](_0x16b11f[_0x5da5('0x15')]);if(_0x16b11f instanceof RangeError){if(_0x16b11f[_0x5da5('0x16')]){delete _0x16b11f[_0x5da5('0x16')];}_0x1a4849[_0x5da5('0x17')](0x194)[_0x5da5('0x18')](_0x16b11f);}else{if(_0x16b11f['name']){delete _0x16b11f[_0x5da5('0x16')];}_0x1a4849[_0x5da5('0x17')](0x1f4)[_0x5da5('0x18')](_0x16b11f);}};}function checkError(){return function(_0x560ea7){if(!_0x560ea7){throw new RangeError(_0x5da5('0x19'));}return _0x560ea7;};}function respondWithRpcPromise(_0x15aa62,_0x20c8a6){return new BPromise(function(_0x2e68d5,_0xec69f2){var _0x436960=amiClient;return _0x436960['request'](_0x15aa62,_0x20c8a6)[_0x5da5('0x1a')](function(_0x568ddf){if(_0x568ddf[_0x5da5('0x1b')]){if(_0x568ddf[_0x5da5('0x1b')][_0x5da5('0x1c')]===0x1f4){return _0xec69f2(_0x568ddf['error'][_0x5da5('0x1d')]);}return _0x2e68d5(_0x568ddf[_0x5da5('0x1b')][_0x5da5('0x1d')]);}else{_0x2e68d5(_0x568ddf[_0x5da5('0x1e')]);}})['catch'](function(_0x5b0b43){_0xec69f2(_0x5b0b43);});});}function getAgent(_0x50aadc){return db[_0x5da5('0x1f')]['findOne']({'where':{'id':_0x50aadc,'role':'agent'}})[_0x5da5('0x1a')](checkError());}function getAgentCheckSession(_0x3974d8,_0x5740a7){return new BPromise(function(_0x1798ae,_0x1ab83e){var _0x558b12=respondWithRpcPromise(_0x5da5('0x20'));var _0x27de55=getAgent(_0x3974d8);Promise[_0x5da5('0x21')]([_0x558b12,_0x27de55])[_0x5da5('0x1a')](function(_0x766ed9){var _0x5734ce=_0x766ed9[0x0];var _0x3ae664=_0x766ed9[0x1];var _0x2e3c5d=_[_0x5da5('0x22')](_0x5734ce[_0x5da5('0x23')],function(_0x55e2bf){return _0x55e2bf['UserId']==_0x3ae664['id']&&_0x55e2bf['sessionId']==_0x5740a7;});if(_0x2e3c5d[_0x5da5('0x24')]==0x1){_0x1798ae(_0x3ae664);}else{_0x1ab83e(new RangeError(_0x5da5('0x25')+_0x5740a7+_0x5da5('0x26')));}});});}exports[_0x5da5('0x27')]=function(_0x51b712,_0x585298){logger[_0x5da5('0x28')]('originate\x20fired:',_0x51b712['body']);var _0x2dd4b6=originateValidation['validate'](_0x51b712[_0x5da5('0x29')]);if(_0x2dd4b6[_0x5da5('0x24')]>0x0){return _0x585298[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x2dd4b6);}var _0x6c556d=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x3dc66a=_0x51b712['body'][_0x5da5('0x2c')];var _0x48de0b=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2d')];var _0x28c5eb=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2e')];return getAgent(_0x6c556d)[_0x5da5('0x1a')](function(_0x325ccd){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x325ccd[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x325ccd[_0x5da5('0x16')]),'webbar:originate',{'callNumber':_0x3dc66a,'callerId':_0x48de0b,'callbackUrl':_0x28c5eb});return _0x585298[_0x5da5('0x17')](0xc8)['json']({'error':![],'message':_0x5da5('0x32')});})[_0x5da5('0x33')](handleError(_0x585298));};exports[_0x5da5('0x34')]=function(_0x24842c,_0x59c92e){logger[_0x5da5('0x28')](_0x5da5('0x35'),_0x24842c[_0x5da5('0x29')]);var _0x56fd57=hangupValidation[_0x5da5('0xb')](_0x24842c[_0x5da5('0x29')]);if(_0x56fd57['length']>0x0){return _0x59c92e[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x56fd57);}var _0xe9888e=_0x24842c[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x664a8d=_0x24842c['body'][_0x5da5('0x36')];return getAgent(_0xe9888e)[_0x5da5('0x1a')](function(_0x14c3f5){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x14c3f5['name']);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x14c3f5['name']),_0x5da5('0x37'),{'sessionId':_0x664a8d});return _0x59c92e['status'](0xc8)['json']({'error':![],'message':_0x5da5('0x38')});})[_0x5da5('0x33')](handleError(_0x59c92e));};exports[_0x5da5('0x39')]=function(_0x29d9a7,_0x52b618){logger[_0x5da5('0x28')](_0x5da5('0x3a'),_0x29d9a7[_0x5da5('0x29')]);var _0x40cf69=answerValidation[_0x5da5('0xb')](_0x29d9a7[_0x5da5('0x29')]);if(_0x40cf69[_0x5da5('0x24')]>0x0){return _0x52b618[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x40cf69);}var _0x284d40=_0x29d9a7[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x4464a7=_0x29d9a7[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x284d40)['then'](function(_0x485326){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x485326['name']);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x485326[_0x5da5('0x16')]),_0x5da5('0x3b'),{'sessionId':_0x4464a7});return _0x52b618[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':_0x5da5('0x3c')});})[_0x5da5('0x33')](handleError(_0x52b618));};exports[_0x5da5('0x3d')]=function(_0x44de08,_0x4fc584){logger[_0x5da5('0x28')]('hold\x20fired:',_0x44de08['body']);var _0x2a0fb6=holdValidation[_0x5da5('0xb')](_0x44de08[_0x5da5('0x29')]);if(_0x2a0fb6[_0x5da5('0x24')]>0x0){return _0x4fc584[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x2a0fb6);}var _0x5aa561=_0x44de08[_0x5da5('0x29')]['userId'];var _0x5325ad=_0x44de08[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x5aa561)['then'](function(_0x419d74){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x419d74[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')]('user:%s',_0x419d74[_0x5da5('0x16')]),'webbar:hold',{'sessionId':_0x5325ad});return _0x4fc584['status'](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'hold\x20executed!'});})[_0x5da5('0x33')](handleError(_0x4fc584));};exports[_0x5da5('0x3e')]=function(_0x17581a,_0x1ec725){logger[_0x5da5('0x28')](_0x5da5('0x3f'),_0x17581a['body']);var _0x5cb8d8=unholdValidation[_0x5da5('0xb')](_0x17581a[_0x5da5('0x29')]);if(_0x5cb8d8['length']>0x0){return _0x1ec725['status'](0x190)[_0x5da5('0x2a')](_0x5cb8d8);}var _0x4c1321=_0x17581a[_0x5da5('0x29')]['userId'];var _0x505ea4=_0x17581a[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x4c1321)[_0x5da5('0x1a')](function(_0x39d428){logger['info'](_0x5da5('0x2f'),_0x39d428[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')]('user:%s',_0x39d428[_0x5da5('0x16')]),_0x5da5('0x40'),{'sessionId':_0x505ea4});return _0x1ec725[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':_0x5da5('0x41')});})[_0x5da5('0x33')](handleError(_0x1ec725));};exports[_0x5da5('0x42')]=function(_0x53c7dd,_0x3d1a54){logger[_0x5da5('0x28')](_0x5da5('0x43'),_0x3d1a54[_0x5da5('0x29')]);var _0x211b80=callsValidation[_0x5da5('0xb')](_0x53c7dd[_0x5da5('0x29')]);if(_0x211b80[_0x5da5('0x24')]>0x0){return _0x3d1a54[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x211b80);}var _0x191691=_0x53c7dd[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x4cc539=respondWithRpcPromise(_0x5da5('0x20'));var _0x35939b=getAgent(_0x191691);return Promise['all']([_0x4cc539,_0x35939b])['then'](function(_0x509c9e){var _0x1959af=_0x509c9e[0x0];var _0x469907=_0x509c9e[0x1];var _0x20c269=_['filter'](_0x1959af['rows'],function(_0x462317){return _0x462317[_0x5da5('0x44')]==_0x469907['id'];});return _0x3d1a54[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'count':_0x20c269['length'],'rows':_0x20c269});})[_0x5da5('0x33')](handleError(_0x3d1a54));};exports[_0x5da5('0x45')]=function(_0x34b4b0,_0x4e4ffa){logger[_0x5da5('0x28')]('conference\x20fired:',_0x34b4b0[_0x5da5('0x29')]);var _0x4496d2=conferenceValidation[_0x5da5('0xb')](_0x34b4b0[_0x5da5('0x29')]);if(_0x4496d2[_0x5da5('0x24')]>0x0){return _0x4e4ffa[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x4496d2);}var _0x2c13f1=_0x34b4b0[_0x5da5('0x29')][_0x5da5('0x2b')];return getAgent(_0x2c13f1)[_0x5da5('0x1a')](function(_0xe3fc79){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0xe3fc79[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0xe3fc79[_0x5da5('0x16')]),_0x5da5('0x46'));return _0x4e4ffa[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x4e4ffa));};exports[_0x5da5('0x47')]=function(_0x35cca1,_0x4041e8){logger['info'](_0x5da5('0x48'),_0x35cca1[_0x5da5('0x29')]);var _0x43b55e=transferValidation[_0x5da5('0xb')](_0x35cca1['body']);if(_0x43b55e[_0x5da5('0x24')]>0x0){return _0x4041e8['status'](0x190)[_0x5da5('0x2a')](_0x43b55e);}var _0x5f862f=_0x35cca1[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x57966d=_0x35cca1[_0x5da5('0x29')][_0x5da5('0x36')];var _0x512f01=_0x35cca1['body']['transferNumber'];return getAgent(_0x5f862f)[_0x5da5('0x1a')](function(_0x446241){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x446241[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x446241[_0x5da5('0x16')]),'webbar:transfer',{'sessionId':_0x57966d,'transferNumber':_0x512f01});return _0x4041e8[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x4041e8));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 04baa47..65baa7e 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 _0x1623=['destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','/:id/dispositions','addAgents','/:id/notify','notify','update'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x1623,0xab));var _0x3162=function(_0x357abb,_0x2459c8){_0x357abb=_0x357abb-0x0;var _0x5490d6=_0x1623[_0x357abb];return _0x5490d6;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3162('0xe')]);router[_0x3162('0xb')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0xb')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);router['get'](_0x3162('0x13'),auth['isAuthenticated'](),controller[_0x3162('0x14')]);router[_0x3162('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3162('0x15')](_0x3162('0x16'),auth[_0x3162('0x7')](),controller['addDisposition']);router[_0x3162('0x15')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller['addAnswer']);router[_0x3162('0x15')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x17')]);router[_0x3162('0x15')](_0x3162('0x13'),auth[_0x3162('0x7')](),controller['addApplications']);router[_0x3162('0x15')](_0x3162('0x18'),controller[_0x3162('0x19')]);router[_0x3162('0x15')]('/:id/send',auth[_0x3162('0x7')](),controller['send']);router['put'](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x1a')]);router['delete']('/:id',auth[_0x3162('0x7')](),controller[_0x3162('0x1b')]);router[_0x3162('0x1c')](_0x3162('0x16'),auth[_0x3162('0x7')](),controller[_0x3162('0x1d')]);router[_0x3162('0x1c')](_0x3162('0xf'),auth['isAuthenticated'](),controller[_0x3162('0x1e')]);router[_0x3162('0x1c')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x1f')]);module[_0x3162('0x20')]=router; \ No newline at end of file +var _0x7a54=['index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','getApplications','post','create','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','/:id','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x461708,_0x454658){var _0x1f0f67=function(_0x4ccee1){while(--_0x4ccee1){_0x461708['push'](_0x461708['shift']());}};_0x1f0f67(++_0x454658);}(_0x7a54,0x106));var _0x47a5=function(_0x1e3110,_0x360419){_0x1e3110=_0x1e3110-0x0;var _0x596f03=_0x7a54[_0x1e3110];return _0x596f03;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/applications',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x13')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x14')]);router[_0x47a5('0x13')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['addDisposition']);router[_0x47a5('0x13')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x16')]);router[_0x47a5('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x47a5('0x17')]);router['post']('/:id/applications',auth[_0x47a5('0xc')](),controller[_0x47a5('0x18')]);router[_0x47a5('0x13')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x13')](_0x47a5('0x1b'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['put'](_0x47a5('0x1d'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0x1e')](_0x47a5('0x1d'),auth[_0x47a5('0xc')](),controller['destroy']);router[_0x47a5('0x1e')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1f')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['removeAnswers']);router[_0x47a5('0x1e')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x20')]);module[_0x47a5('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b3f0529..c04b657 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 _0x73b8=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x2d977d,_0x5b2e3d){var _0x5943c4=function(_0x6295e2){while(--_0x6295e2){_0x2d977d['push'](_0x2d977d['shift']());}};_0x5943c4(++_0x5b2e3d);}(_0x73b8,0x9c));var _0x873b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x73b8[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x873b('0x0'));var rs=require(_0x873b('0x1'));module[_0x873b('0x2')]={'name':{'type':Sequelize[_0x873b('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x873b('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x873b('0x3')],'defaultValue':function(){return rs[_0x873b('0x4')]();}},'phone':{'type':Sequelize[_0x873b('0x3')]},'type':{'type':Sequelize['ENUM'](_0x873b('0x5'),_0x873b('0x6'))},'accountSid':{'type':Sequelize[_0x873b('0x3')]},'baseUrl':{'type':Sequelize[_0x873b('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x873b('0x7')],'defaultValue':function(){return _0x873b('0x8');}},'notificationSound':{'type':Sequelize[_0x873b('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x873b('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x873b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x873b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x873b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x873b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x873b('0xa')],'comment':_0x873b('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x873b('0x9')],'defaultValue':![],'comment':_0x873b('0xc'),'set':function(_0xc6a187){if(!_0xc6a187){this[_0x873b('0xd')]('mandatoryDispositionPauseId',null);}this[_0x873b('0xd')](_0x873b('0xe'),_0xc6a187);}},'description':{'type':Sequelize[_0x873b('0x3')]}}; \ No newline at end of file +var _0xdaa5=['mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','ENUM','sinch','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'];(function(_0x1c67a2,_0x599648){var _0x4fbd8e=function(_0x2e465b){while(--_0x2e465b){_0x1c67a2['push'](_0x1c67a2['shift']());}};_0x4fbd8e(++_0x599648);}(_0xdaa5,0x8e));var _0x5daa=function(_0x4e5bf8,_0x4476c7){_0x4e5bf8=_0x4e5bf8-0x0;var _0x245ff1=_0xdaa5[_0x4e5bf8];return _0x245ff1;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5daa('0x0')]={'name':{'type':Sequelize[_0x5daa('0x1')],'unique':_0x5daa('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x5daa('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x5daa('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x5daa('0x1')],'defaultValue':function(){return rs[_0x5daa('0x3')]();}},'phone':{'type':Sequelize[_0x5daa('0x1')]},'type':{'type':Sequelize[_0x5daa('0x4')]('twilio',_0x5daa('0x5'))},'accountSid':{'type':Sequelize[_0x5daa('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5daa('0x6');}},'notificationSound':{'type':Sequelize[_0x5daa('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5daa('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5daa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5daa('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5daa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5daa('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5daa('0x8')],'comment':_0x5daa('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5daa('0x7')],'defaultValue':![],'comment':_0x5daa('0xa'),'set':function(_0xdabf7e){if(!_0xdabf7e){this[_0x5daa('0xb')](_0x5daa('0xc'),null);}this['setDataValue'](_0x5daa('0xd'),_0xdabf7e);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index e3269d7..11ccb5a 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 _0x29b0=['MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','WhatsappAccount','findAll','rows','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId'];(function(_0x23a0a8,_0x51bba0){var _0x49f593=function(_0x4d2157){while(--_0x4d2157){_0x23a0a8['push'](_0x23a0a8['shift']());}};_0x49f593(++_0x51bba0);}(_0x29b0,0x1af));var _0x029b=function(_0x1dcdce,_0x38e8d6){_0x1dcdce=_0x1dcdce-0x0;var _0x1504d2=_0x29b0[_0x1dcdce];return _0x1504d2;};'use strict';var emlformat=require(_0x029b('0x0'));var rimraf=require(_0x029b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x029b('0x2'));var rp=require(_0x029b('0x3'));var moment=require(_0x029b('0x4'));var BPromise=require(_0x029b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x029b('0x6'));var csv=require(_0x029b('0x7'));var ejs=require(_0x029b('0x8'));var fs=require('fs');var fs_extra=require(_0x029b('0x9'));var _=require(_0x029b('0xa'));var squel=require(_0x029b('0xb'));var crypto=require(_0x029b('0xc'));var jsforce=require(_0x029b('0xd'));var deskjs=require(_0x029b('0xe'));var toCsv=require(_0x029b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x029b('0xf'));var as=require(_0x029b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x029b('0x11'))(_0x029b('0x12'));var utils=require(_0x029b('0x13'));var config=require(_0x029b('0x14'));var licenseUtil=require(_0x029b('0x15'));var db=require('../../mysqldb')['db'];config[_0x029b('0x16')]=_[_0x029b('0x17')](config['redis'],{'host':_0x029b('0x18'),'port':0x18eb});var socket=require(_0x029b('0x19'))(new Redis(config[_0x029b('0x16')]));require('./whatsappAccount.socket')[_0x029b('0x1a')](socket);var jayson=require(_0x029b('0x1b'));var client=jayson[_0x029b('0x1c')][_0x029b('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x4faaf2,_0x2b0a26,_0x50b2d1,_0x3c280b){return new BPromise(function(_0x334a36,_0x170d13){var _0x4ccfbf=_0x3c280b||client;return _0x4ccfbf[_0x029b('0x1e')](_0x4faaf2,_0x50b2d1)[_0x029b('0x1f')](function(_0x43dac9){logger[_0x029b('0x20')](_0x029b('0x21'),_0x2b0a26,_0x029b('0x22'));logger[_0x029b('0x23')](_0x029b('0x24'),_0x2b0a26,_0x029b('0x22'),JSON[_0x029b('0x25')](_0x43dac9));if(_0x43dac9[_0x029b('0x26')]){if(_0x43dac9['error'][_0x029b('0x27')]===0x1f4){logger[_0x029b('0x26')](_0x029b('0x21'),_0x2b0a26,_0x43dac9[_0x029b('0x26')][_0x029b('0x28')]);return _0x170d13(_0x43dac9[_0x029b('0x26')][_0x029b('0x28')]);}logger['error'](_0x029b('0x21'),_0x2b0a26,_0x43dac9[_0x029b('0x26')][_0x029b('0x28')]);return _0x334a36(_0x43dac9['error']['message']);}else{logger[_0x029b('0x20')](_0x029b('0x21'),_0x2b0a26,_0x029b('0x22'));_0x334a36(_0x43dac9[_0x029b('0x29')][_0x029b('0x28')]);}})[_0x029b('0x2a')](function(_0x5f382f){logger['error'](_0x029b('0x21'),_0x2b0a26,_0x5f382f);_0x170d13(_0x5f382f);});});}function respondWithStatusCode(_0x578598,_0x4c42ce){_0x4c42ce=_0x4c42ce||0xcc;return function(_0x3d5d49){if(_0x3d5d49){return _0x578598[_0x029b('0x2b')](_0x4c42ce);}return _0x578598['status'](_0x4c42ce)['end']();};}function respondWithResult(_0x2d3ee6,_0x510fba){_0x510fba=_0x510fba||0xc8;return function(_0x9f147e){if(_0x9f147e){return _0x2d3ee6[_0x029b('0x2c')](_0x510fba)[_0x029b('0x2d')](_0x9f147e);}};}function respondWithFilteredResult(_0x1ce8f2,_0x6c3fa6){return function(_0x9ab9c8){if(_0x9ab9c8){var _0x13421e=typeof _0x6c3fa6[_0x029b('0x2e')]===_0x029b('0x2f')&&typeof _0x6c3fa6[_0x029b('0x30')]==='undefined';var _0x2ba058=_0x9ab9c8[_0x029b('0x31')];var _0x2645ad=_0x13421e?0x0:_0x6c3fa6[_0x029b('0x2e')];var _0x3b347d=_0x13421e?_0x9ab9c8[_0x029b('0x31')]:_0x6c3fa6[_0x029b('0x2e')]+_0x6c3fa6[_0x029b('0x30')];var _0x162e4f;if(_0x3b347d>=_0x2ba058){_0x3b347d=_0x2ba058;_0x162e4f=0xc8;}else{_0x162e4f=0xce;}_0x1ce8f2[_0x029b('0x2c')](_0x162e4f);return _0x1ce8f2['set'](_0x029b('0x32'),_0x2645ad+'-'+_0x3b347d+'/'+_0x2ba058)[_0x029b('0x2d')](_0x9ab9c8);}return null;};}function patchUpdates(_0x483573){return function(_0x3da056){try{jsonpatch[_0x029b('0x33')](_0x3da056,_0x483573,!![]);}catch(_0x2412c0){return BPromise[_0x029b('0x34')](_0x2412c0);}return _0x3da056[_0x029b('0x35')]();};}function saveUpdates(_0x3babdb,_0x59a8a4){return function(_0x3e6a47){if(_0x3e6a47){return _0x3e6a47[_0x029b('0x36')](_0x3babdb)[_0x029b('0x1f')](function(_0x305ecc){return _0x305ecc;});}return null;};}function removeEntity(_0x455d07,_0x4576a0){return function(_0x3771bb){if(_0x3771bb){return _0x3771bb[_0x029b('0x37')]()[_0x029b('0x1f')](function(){var _0x1206cb=_0x3771bb[_0x029b('0x38')]({'plain':!![]});var _0x22a10e=_0x029b('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x22a10e,'resourceId':_0x1206cb['id']}})[_0x029b('0x1f')](function(){return _0x3771bb;});})[_0x029b('0x1f')](function(){_0x455d07['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x577018,_0x84736b){return function(_0x3dcf1e){if(!_0x3dcf1e){_0x577018['sendStatus'](0x194);}return _0x3dcf1e;};}function handleError(_0x15e77c,_0x1d2b70){_0x1d2b70=_0x1d2b70||0x1f4;return function(_0x41ba0e){logger[_0x029b('0x26')](_0x41ba0e['stack']);if(_0x41ba0e[_0x029b('0x3a')]){delete _0x41ba0e['name'];}_0x15e77c[_0x029b('0x2c')](_0x1d2b70)[_0x029b('0x3b')](_0x41ba0e);};}exports[_0x029b('0x3c')]=function(_0x47404b,_0x113937){var _0x404df5={'include':[{'model':db[_0x029b('0x3d')],'as':_0x029b('0x3e')}]},_0x29f7ec={},_0xb57567={'count':0x0,'rows':[]};var _0x4990a1=_['map'](db['WhatsappAccount'][_0x029b('0x3f')],function(_0x4c7317){return{'name':_0x4c7317[_0x029b('0x40')],'type':_0x4c7317[_0x029b('0x41')][_0x029b('0x42')]};});_0x29f7ec[_0x029b('0x43')]=_[_0x029b('0x44')](_0x4990a1,_0x029b('0x3a'));_0x29f7ec[_0x029b('0x45')]=_[_0x029b('0x46')](_0x47404b[_0x029b('0x45')]);_0x29f7ec[_0x029b('0x47')]=_[_0x029b('0x48')](_0x29f7ec['model'],_0x29f7ec[_0x029b('0x45')]);_0x404df5[_0x029b('0x49')]=_['intersection'](_0x29f7ec['model'],qs[_0x029b('0x4a')](_0x47404b[_0x029b('0x45')][_0x029b('0x4a')]));_0x404df5[_0x029b('0x49')]=_0x404df5['attributes'][_0x029b('0x4b')]?_0x404df5[_0x029b('0x49')]:_0x29f7ec['model'];if(!_0x47404b['query'][_0x029b('0x4c')](_0x029b('0x4d'))){_0x404df5[_0x029b('0x30')]=qs[_0x029b('0x30')](_0x47404b[_0x029b('0x45')][_0x029b('0x30')]);_0x404df5[_0x029b('0x2e')]=qs[_0x029b('0x2e')](_0x47404b['query'][_0x029b('0x2e')]);}_0x404df5[_0x029b('0x4e')]=qs[_0x029b('0x4f')](_0x47404b[_0x029b('0x45')]['sort']);_0x404df5[_0x029b('0x50')]=qs[_0x029b('0x47')](_[_0x029b('0x51')](_0x47404b['query'],_0x29f7ec[_0x029b('0x47')]),_0x4990a1);if(_0x47404b[_0x029b('0x45')][_0x029b('0x52')]){_0x404df5[_0x029b('0x50')]=_[_0x029b('0x53')](_0x404df5[_0x029b('0x50')],{'$or':_[_0x029b('0x44')](_0x4990a1,function(_0x32af46){if(_0x32af46[_0x029b('0x41')]!==_0x029b('0x54')){var _0x4f284={};_0x4f284[_0x32af46[_0x029b('0x3a')]]={'$like':'%'+_0x47404b[_0x029b('0x45')][_0x029b('0x52')]+'%'};return _0x4f284;}})});}_0x404df5=_[_0x029b('0x53')]({},_0x404df5,_0x47404b['options']);var _0x23bd72={'where':_0x404df5[_0x029b('0x50')]};return db['WhatsappAccount']['count'](_0x23bd72)[_0x029b('0x1f')](function(_0x59e036){_0xb57567[_0x029b('0x31')]=_0x59e036;if(_0x47404b['query'][_0x029b('0x55')]){_0x404df5[_0x029b('0x56')]=[{'all':!![]}];}return db[_0x029b('0x57')][_0x029b('0x58')](_0x404df5);})['then'](function(_0xbe66a5){_0xb57567[_0x029b('0x59')]=_0xbe66a5;return _0xb57567;})[_0x029b('0x1f')](respondWithFilteredResult(_0x113937,_0x404df5))[_0x029b('0x2a')](handleError(_0x113937,null));};exports[_0x029b('0x5a')]=function(_0x1f431b,_0x3f071d){var _0x205f2a={'raw':![],'where':{'id':_0x1f431b[_0x029b('0x5b')]['id']},'include':[{'model':db[_0x029b('0x3d')],'as':_0x029b('0x3e')}]},_0x1a8704={};_0x1a8704[_0x029b('0x43')]=_['keys'](db[_0x029b('0x57')][_0x029b('0x3f')]);_0x1a8704[_0x029b('0x45')]=_[_0x029b('0x46')](_0x1f431b[_0x029b('0x45')]);_0x1a8704[_0x029b('0x47')]=_[_0x029b('0x48')](_0x1a8704[_0x029b('0x43')],_0x1a8704['query']);_0x205f2a[_0x029b('0x49')]=_[_0x029b('0x48')](_0x1a8704[_0x029b('0x43')],qs[_0x029b('0x4a')](_0x1f431b[_0x029b('0x45')][_0x029b('0x4a')]));_0x205f2a['attributes']=_0x205f2a[_0x029b('0x49')]['length']?_0x205f2a[_0x029b('0x49')]:_0x1a8704['model'];if(_0x1f431b[_0x029b('0x45')][_0x029b('0x55')]){_0x205f2a['include']=[{'all':!![]}];}_0x205f2a=_['merge']({},_0x205f2a,_0x1f431b[_0x029b('0x5c')]);return db[_0x029b('0x57')][_0x029b('0x5d')](_0x205f2a)['then'](handleEntityNotFound(_0x3f071d,null))['then'](respondWithResult(_0x3f071d,null))[_0x029b('0x2a')](handleError(_0x3f071d,null));};exports['create']=function(_0x48913d,_0x5cdfa9){return db[_0x029b('0x57')][_0x029b('0x5e')](_0x48913d['body'],{})['then'](function(_0x1f64e4){var _0xecb74d=_0x48913d[_0x029b('0x5f')][_0x029b('0x38')]({'plain':!![]});if(!_0xecb74d)throw new Error(_0x029b('0x60'));if(_0xecb74d[_0x029b('0x61')]===_0x029b('0x5f')){var _0x375d75=_0x1f64e4[_0x029b('0x38')]({'plain':!![]});var _0x2eda71='WhatsappAccounts';return db['UserProfileSection'][_0x029b('0x5d')]({'where':{'name':_0x2eda71,'userProfileId':_0xecb74d[_0x029b('0x62')]},'raw':!![]})[_0x029b('0x1f')](function(_0x4a847b){if(_0x4a847b&&_0x4a847b[_0x029b('0x63')]===0x0){return db[_0x029b('0x64')]['create']({'name':_0x375d75['name'],'resourceId':_0x375d75['id'],'type':_0x4a847b['name'],'sectionId':_0x4a847b['id']},{})[_0x029b('0x1f')](function(){return _0x1f64e4;});}else{return _0x1f64e4;}})[_0x029b('0x2a')](function(_0x3300fd){logger[_0x029b('0x26')](_0x029b('0x65'),_0x3300fd);throw _0x3300fd;});}return _0x1f64e4;})[_0x029b('0x1f')](respondWithResult(_0x5cdfa9,0xc9))['catch'](handleError(_0x5cdfa9,null));};exports[_0x029b('0x36')]=function(_0xf4eb5a,_0x80ac8b){if(_0xf4eb5a['body']['id']){delete _0xf4eb5a[_0x029b('0x66')]['id'];}return db['WhatsappAccount'][_0x029b('0x5d')]({'where':{'id':_0xf4eb5a['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x029b('0x1f')](handleEntityNotFound(_0x80ac8b,null))['then'](saveUpdates(_0xf4eb5a[_0x029b('0x66')],null))['then'](respondWithResult(_0x80ac8b,null))[_0x029b('0x2a')](handleError(_0x80ac8b,null));};exports[_0x029b('0x37')]=function(_0x2744a3,_0x531fde){return db[_0x029b('0x57')][_0x029b('0x5d')]({'where':{'id':_0x2744a3['params']['id']}})['then'](handleEntityNotFound(_0x531fde,null))[_0x029b('0x1f')](removeEntity(_0x531fde,null))[_0x029b('0x2a')](handleError(_0x531fde,null));};exports[_0x029b('0x67')]=function(_0xc6f2e9,_0x571706){return db[_0x029b('0x57')]['describe']()[_0x029b('0x1f')](respondWithResult(_0x571706,null))[_0x029b('0x2a')](handleError(_0x571706,null));};exports[_0x029b('0x68')]=function(_0x2573a4,_0x139309,_0xd92786){if(_0x2573a4['body']['id']){delete _0x2573a4[_0x029b('0x66')]['id'];}return db[_0x029b('0x57')]['find']({'where':{'id':_0x2573a4[_0x029b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x139309,null))[_0x029b('0x1f')](function(_0x155ec0){if(_0x155ec0){_0x2573a4[_0x029b('0x66')][_0x029b('0x69')]=_0x155ec0['id'];return db[_0x029b('0x6a')][_0x029b('0x5e')](_0x2573a4[_0x029b('0x66')]);}})[_0x029b('0x1f')](respondWithResult(_0x139309,null))[_0x029b('0x2a')](handleError(_0x139309,null));};exports[_0x029b('0x6b')]=function(_0x5633f4,_0x2939c4,_0x50d18f){var _0x3f3d95={'raw':![],'where':{}};var _0x36520f={};var _0x3fa5e2={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x5633f4[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x2939c4,null))[_0x029b('0x1f')](function(_0x38e70d){if(_0x38e70d){_0x36520f['model']=_[_0x029b('0x46')](db['Disposition'][_0x029b('0x3f')]);_0x36520f[_0x029b('0x45')]=_[_0x029b('0x46')](_0x5633f4['query']);_0x36520f[_0x029b('0x47')]=_[_0x029b('0x48')](_0x36520f[_0x029b('0x43')],_0x36520f[_0x029b('0x45')]);_0x3f3d95[_0x029b('0x49')]=_['intersection'](_0x36520f[_0x029b('0x43')],qs[_0x029b('0x4a')](_0x5633f4[_0x029b('0x45')][_0x029b('0x4a')]));_0x3f3d95[_0x029b('0x49')]=_0x3f3d95[_0x029b('0x49')][_0x029b('0x4b')]?_0x3f3d95['attributes']:_0x36520f[_0x029b('0x43')];if(!_0x5633f4[_0x029b('0x45')][_0x029b('0x4c')](_0x029b('0x4d'))){_0x3f3d95['limit']=qs[_0x029b('0x30')](_0x5633f4[_0x029b('0x45')][_0x029b('0x30')]);_0x3f3d95[_0x029b('0x2e')]=qs['offset'](_0x5633f4[_0x029b('0x45')][_0x029b('0x2e')]);}_0x3f3d95[_0x029b('0x4e')]=qs[_0x029b('0x4f')](_0x5633f4[_0x029b('0x45')][_0x029b('0x4f')]);_0x3f3d95[_0x029b('0x50')]=qs[_0x029b('0x47')](_[_0x029b('0x51')](_0x5633f4['query'],_0x36520f[_0x029b('0x47')]));_0x3f3d95[_0x029b('0x50')]['WhatsappAccountId']=_0x38e70d['id'];if(_0x5633f4[_0x029b('0x45')][_0x029b('0x52')]){_0x3f3d95[_0x029b('0x50')]=_[_0x029b('0x53')](_0x3f3d95[_0x029b('0x50')],{'$or':_['map'](_0x3f3d95['attributes'],function(_0x278d40){var _0x453525={};_0x453525[_0x278d40]={'$like':'%'+_0x5633f4['query']['filter']+'%'};return _0x453525;})});}_0x3f3d95=_['merge']({},_0x3f3d95,_0x5633f4[_0x029b('0x5c')]);return db['Disposition'][_0x029b('0x31')]({'where':_0x3f3d95[_0x029b('0x50')]})[_0x029b('0x1f')](function(_0x3f4f64){_0x3fa5e2['count']=_0x3f4f64;if(_0x5633f4[_0x029b('0x45')]['includeAll']){_0x3f3d95[_0x029b('0x56')]=[{'all':!![]}];}return db[_0x029b('0x6a')][_0x029b('0x58')](_0x3f3d95);})['then'](function(_0xf8ad0b){_0x3fa5e2[_0x029b('0x59')]=_0xf8ad0b;return _0x3fa5e2;});}})[_0x029b('0x1f')](respondWithFilteredResult(_0x2939c4,_0x3f3d95))['catch'](handleError(_0x2939c4,null));};exports['removeDispositions']=function(_0xbdeacd,_0x2d919e,_0x512b74){return db[_0x029b('0x57')]['find']({'where':{'id':_0xbdeacd[_0x029b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2d919e,null))[_0x029b('0x1f')](function(_0x535d9e){if(_0x535d9e){return _0x535d9e[_0x029b('0x6c')](_0xbdeacd[_0x029b('0x45')][_0x029b('0x6d')]);}})[_0x029b('0x1f')](respondWithStatusCode(_0x2d919e,null))[_0x029b('0x2a')](handleError(_0x2d919e,null));};exports['addAnswer']=function(_0x315007,_0x39b558,_0x586657){if(_0x315007[_0x029b('0x66')]['id']){delete _0x315007[_0x029b('0x66')]['id'];}return db[_0x029b('0x57')]['find']({'where':{'id':_0x315007[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x39b558,null))[_0x029b('0x1f')](function(_0x15c4ff){if(_0x15c4ff){_0x315007[_0x029b('0x66')]['WhatsappAccountId']=_0x15c4ff['id'];return db[_0x029b('0x6e')][_0x029b('0x5e')](_0x315007[_0x029b('0x66')]);}})[_0x029b('0x1f')](respondWithResult(_0x39b558,null))[_0x029b('0x2a')](handleError(_0x39b558,null));};exports[_0x029b('0x6f')]=function(_0x5e9d7e,_0x7c3c5b,_0x6e0a9){var _0x988ee2={'raw':![],'where':{}};var _0x5e7adc={};var _0xaf7173={'count':0x0,'rows':[]};return db[_0x029b('0x57')][_0x029b('0x70')]({'where':{'id':_0x5e9d7e[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x7c3c5b,null))[_0x029b('0x1f')](function(_0x1da175){if(_0x1da175){_0x5e7adc[_0x029b('0x43')]=_[_0x029b('0x46')](db[_0x029b('0x6e')]['rawAttributes']);_0x5e7adc[_0x029b('0x45')]=_['keys'](_0x5e9d7e[_0x029b('0x45')]);_0x5e7adc[_0x029b('0x47')]=_[_0x029b('0x48')](_0x5e7adc['model'],_0x5e7adc['query']);_0x988ee2[_0x029b('0x49')]=_[_0x029b('0x48')](_0x5e7adc[_0x029b('0x43')],qs[_0x029b('0x4a')](_0x5e9d7e[_0x029b('0x45')][_0x029b('0x4a')]));_0x988ee2[_0x029b('0x49')]=_0x988ee2[_0x029b('0x49')][_0x029b('0x4b')]?_0x988ee2[_0x029b('0x49')]:_0x5e7adc[_0x029b('0x43')];if(!_0x5e9d7e['query'][_0x029b('0x4c')](_0x029b('0x4d'))){_0x988ee2['limit']=qs[_0x029b('0x30')](_0x5e9d7e['query']['limit']);_0x988ee2[_0x029b('0x2e')]=qs[_0x029b('0x2e')](_0x5e9d7e[_0x029b('0x45')][_0x029b('0x2e')]);}_0x988ee2[_0x029b('0x4e')]=qs[_0x029b('0x4f')](_0x5e9d7e[_0x029b('0x45')]['sort']);_0x988ee2[_0x029b('0x50')]=qs['filters'](_[_0x029b('0x51')](_0x5e9d7e['query'],_0x5e7adc[_0x029b('0x47')]));_0x988ee2['where'][_0x029b('0x69')]=_0x1da175['id'];if(_0x5e9d7e[_0x029b('0x45')][_0x029b('0x52')]){_0x988ee2[_0x029b('0x50')]=_[_0x029b('0x53')](_0x988ee2[_0x029b('0x50')],{'$or':_[_0x029b('0x44')](_0x988ee2['attributes'],function(_0x203d43){var _0x53c691={};_0x53c691[_0x203d43]={'$like':'%'+_0x5e9d7e[_0x029b('0x45')]['filter']+'%'};return _0x53c691;})});}_0x988ee2=_[_0x029b('0x53')]({},_0x988ee2,_0x5e9d7e[_0x029b('0x5c')]);return db[_0x029b('0x6e')][_0x029b('0x31')]({'where':_0x988ee2['where']})[_0x029b('0x1f')](function(_0x2eca17){_0xaf7173['count']=_0x2eca17;if(_0x5e9d7e[_0x029b('0x45')]['includeAll']){_0x988ee2[_0x029b('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x988ee2);})[_0x029b('0x1f')](function(_0x34a5c1){_0xaf7173[_0x029b('0x59')]=_0x34a5c1;return _0xaf7173;});}})['then'](respondWithFilteredResult(_0x7c3c5b,_0x988ee2))[_0x029b('0x2a')](handleError(_0x7c3c5b,null));};exports[_0x029b('0x71')]=function(_0x4e81fe,_0x1f74c1,_0x281d82){return db['WhatsappAccount'][_0x029b('0x5d')]({'where':{'id':_0x4e81fe[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x1f74c1,null))[_0x029b('0x1f')](function(_0x4b011d){if(_0x4b011d){return _0x4b011d['removeAnswers'](_0x4e81fe[_0x029b('0x45')][_0x029b('0x6d')]);}})['then'](respondWithStatusCode(_0x1f74c1,null))[_0x029b('0x2a')](handleError(_0x1f74c1,null));};exports['addAgents']=function(_0x1f50ac,_0x252915,_0x4de8bf){return db[_0x029b('0x57')][_0x029b('0x5d')]({'where':{'id':_0x1f50ac[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x252915,null))[_0x029b('0x1f')](function(_0x271a4f){if(_0x271a4f){return _0x271a4f[_0x029b('0x72')](_0x1f50ac[_0x029b('0x66')][_0x029b('0x6d')],_[_0x029b('0x73')](_0x1f50ac[_0x029b('0x66')],[_0x029b('0x6d'),'id'])||{})[_0x029b('0x74')](function(_0x4ce165){for(var _0x4f4ce9=0x0;_0x4f4ce9<_0x1f50ac[_0x029b('0x66')]['ids']['length'];_0x4f4ce9+=0x1){socket[_0x029b('0x75')]('userWhatsappAccount:save',{'UserId':Number(_0x1f50ac[_0x029b('0x66')][_0x029b('0x6d')][_0x4f4ce9]),'WhatsappAccountId':Number(_0x1f50ac[_0x029b('0x5b')]['id'])});}return _0x4ce165;});}})[_0x029b('0x1f')](respondWithResult(_0x252915,null))[_0x029b('0x2a')](handleError(_0x252915,null));};exports[_0x029b('0x76')]=function(_0x3c2301,_0x108e0f,_0x59caba){return db[_0x029b('0x57')]['find']({'where':{'id':_0x3c2301[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x108e0f,null))[_0x029b('0x1f')](function(_0x77157){if(_0x77157){return _0x77157['removeAgents'](_0x3c2301['query'][_0x029b('0x6d')])[_0x029b('0x1f')](function(){if(_['isArray'](_0x3c2301[_0x029b('0x45')][_0x029b('0x6d')])){for(var _0x11f7ca=0x0;_0x11f7ca<_0x3c2301[_0x029b('0x45')]['ids']['length'];_0x11f7ca+=0x1){socket[_0x029b('0x75')](_0x029b('0x77'),{'UserId':Number(_0x3c2301['query'][_0x029b('0x6d')][_0x11f7ca]),'WhatsappAccountId':Number(_0x3c2301[_0x029b('0x5b')]['id'])});}}else{socket[_0x029b('0x75')](_0x029b('0x77'),{'UserId':Number(_0x3c2301['query'][_0x029b('0x6d')]),'WhatsappAccountId':Number(_0x3c2301['params']['id'])});}});}})[_0x029b('0x1f')](respondWithStatusCode(_0x108e0f,null))[_0x029b('0x2a')](handleError(_0x108e0f,null));};exports[_0x029b('0x78')]=function(_0x292bb7,_0x16eb0f,_0x3e10dd){var _0x503c19={};var _0xc79af8={};var _0x20da47;var _0x35fe9a;return db['WhatsappAccount'][_0x029b('0x70')]({'where':{'id':_0x292bb7[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x16eb0f,null))[_0x029b('0x1f')](function(_0x7525d){if(_0x7525d){_0x20da47=_0x7525d;_0xc79af8[_0x029b('0x43')]=_[_0x029b('0x46')](db['User'][_0x029b('0x3f')]);_0xc79af8['query']=_[_0x029b('0x46')](_0x292bb7[_0x029b('0x45')]);_0xc79af8[_0x029b('0x47')]=_[_0x029b('0x48')](_0xc79af8['model'],_0xc79af8[_0x029b('0x45')]);_0x503c19[_0x029b('0x49')]=_[_0x029b('0x48')](_0xc79af8['model'],qs['fields'](_0x292bb7[_0x029b('0x45')][_0x029b('0x4a')]));_0x503c19[_0x029b('0x49')]=_0x503c19[_0x029b('0x49')][_0x029b('0x4b')]?_0x503c19[_0x029b('0x49')]:_0xc79af8['model'];_0x503c19['order']=qs[_0x029b('0x4f')](_0x292bb7['query']['sort']);_0x503c19[_0x029b('0x50')]=qs[_0x029b('0x47')](_['pick'](_0x292bb7[_0x029b('0x45')],_0xc79af8[_0x029b('0x47')]));if(_0x292bb7[_0x029b('0x45')]['filter']){_0x503c19[_0x029b('0x50')]=_['merge'](_0x503c19['where'],{'$or':_[_0x029b('0x44')](_0x503c19[_0x029b('0x49')],function(_0x26800d){var _0x4ff26b={};_0x4ff26b[_0x26800d]={'$like':'%'+_0x292bb7[_0x029b('0x45')][_0x029b('0x52')]+'%'};return _0x4ff26b;})});}_0x503c19=_[_0x029b('0x53')]({},_0x503c19,_0x292bb7['options']);return _0x20da47[_0x029b('0x78')](_0x503c19);}})[_0x029b('0x1f')](function(_0x127956){if(_0x127956){_0x35fe9a=_0x127956[_0x029b('0x4b')];if(!_0x292bb7[_0x029b('0x45')]['hasOwnProperty'](_0x029b('0x4d'))){_0x503c19['limit']=qs[_0x029b('0x30')](_0x292bb7['query'][_0x029b('0x30')]);_0x503c19['offset']=qs[_0x029b('0x2e')](_0x292bb7[_0x029b('0x45')][_0x029b('0x2e')]);}return _0x20da47['getAgents'](_0x503c19);}})[_0x029b('0x1f')](function(_0xed8151){if(_0xed8151){return _0xed8151?{'count':_0x35fe9a,'rows':_0xed8151}:null;}})['then'](respondWithResult(_0x16eb0f,null))['catch'](handleError(_0x16eb0f,null));};exports[_0x029b('0x79')]=function(_0xbf0c3b,_0x8bba2,_0x5b67f7){return db[_0x029b('0x57')][_0x029b('0x70')]({'where':{'id':_0xbf0c3b['params']['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x8bba2,null))[_0x029b('0x1f')](function(_0x3078fa){if(_0x3078fa){return db[_0x029b('0x7a')][_0x029b('0x7b')](function(_0x5f1791){return db[_0x029b('0x7c')][_0x029b('0x37')]({'where':{'WhatsappAccountId':_0xbf0c3b[_0x029b('0x5b')]['id']},'transaction':_0x5f1791})['then'](function(_0x31e3ae){var _0x3f0de3=_[_0x029b('0x44')](_0xbf0c3b[_0x029b('0x66')],function(_0x23a488){_0x23a488[_0x029b('0x69')]=_0xbf0c3b['params']['id'];return _0x23a488;});return db['WhatsappApplication'][_0x029b('0x7d')](_0x3f0de3,{'transaction':_0x5f1791});});})[_0x029b('0x1f')](function(){return db[_0x029b('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0xbf0c3b[_0x029b('0x5b')]['id']},'order':_0x029b('0x7e')});});}})['then'](respondWithResult(_0x8bba2,null))[_0x029b('0x2a')](handleError(_0x8bba2,null));};exports[_0x029b('0x7f')]=function(_0x66ce13,_0x3f38f9,_0x2faa06){var _0x2bb0c4={};var _0x3e7584={};var _0x5e51e7;var _0x65089a;return db[_0x029b('0x57')][_0x029b('0x70')]({'where':{'id':_0x66ce13[_0x029b('0x5b')]['id']}})[_0x029b('0x1f')](handleEntityNotFound(_0x3f38f9,null))[_0x029b('0x1f')](function(_0x5594eb){if(_0x5594eb){_0x5e51e7=_0x5594eb;_0x3e7584[_0x029b('0x43')]=_[_0x029b('0x46')](db[_0x029b('0x7c')][_0x029b('0x3f')]);_0x3e7584[_0x029b('0x45')]=_[_0x029b('0x46')](_0x66ce13[_0x029b('0x45')]);_0x3e7584[_0x029b('0x47')]=_[_0x029b('0x48')](_0x3e7584[_0x029b('0x43')],_0x3e7584[_0x029b('0x45')]);_0x2bb0c4[_0x029b('0x49')]=_[_0x029b('0x48')](_0x3e7584[_0x029b('0x43')],qs[_0x029b('0x4a')](_0x66ce13[_0x029b('0x45')][_0x029b('0x4a')]));_0x2bb0c4['attributes']=_0x2bb0c4[_0x029b('0x49')][_0x029b('0x4b')]?_0x2bb0c4[_0x029b('0x49')]:_0x3e7584[_0x029b('0x43')];_0x2bb0c4[_0x029b('0x4e')]=qs['sort'](_0x66ce13[_0x029b('0x45')][_0x029b('0x4f')]);_0x2bb0c4[_0x029b('0x50')]=qs['filters'](_[_0x029b('0x51')](_0x66ce13[_0x029b('0x45')],_0x3e7584[_0x029b('0x47')]));if(_0x66ce13[_0x029b('0x45')][_0x029b('0x52')]){_0x2bb0c4[_0x029b('0x50')]=_[_0x029b('0x53')](_0x2bb0c4['where'],{'$or':_['map'](_0x2bb0c4[_0x029b('0x49')],function(_0x3a94b4){var _0x112264={};_0x112264[_0x3a94b4]={'$like':'%'+_0x66ce13[_0x029b('0x45')]['filter']+'%'};return _0x112264;})});}_0x2bb0c4=_[_0x029b('0x53')]({},_0x2bb0c4,_0x66ce13['options']);return _0x5e51e7[_0x029b('0x7f')](_0x2bb0c4);}})[_0x029b('0x1f')](function(_0x598fe1){if(_0x598fe1){_0x65089a=_0x598fe1['length'];if(!_0x66ce13[_0x029b('0x45')][_0x029b('0x4c')](_0x029b('0x4d'))){_0x2bb0c4['limit']=qs['limit'](_0x66ce13[_0x029b('0x45')]['limit']);_0x2bb0c4[_0x029b('0x2e')]=qs[_0x029b('0x2e')](_0x66ce13[_0x029b('0x45')][_0x029b('0x2e')]);}return _0x5e51e7[_0x029b('0x7f')](_0x2bb0c4);}})[_0x029b('0x1f')](function(_0x539898){if(_0x539898){return _0x539898?{'count':_0x65089a,'rows':_0x539898}:null;}})[_0x029b('0x1f')](respondWithResult(_0x3f38f9,null))[_0x029b('0x2a')](handleError(_0x3f38f9,null));};exports[_0x029b('0x80')]=function(_0x588e4e,_0x3cd2fe,_0x178966){var _0x1e9910={'channel':'whatsapp'};var _0x5e6273=[];var _0x9c9601=[];var _0x3d2058={};return db[_0x029b('0x57')][_0x029b('0x5d')]({'where':{'id':_0x588e4e[_0x029b('0x5b')]['id']},'include':[{'model':db[_0x029b('0x7c')],'as':_0x029b('0x81')}]})['then'](handleEntityNotFound(_0x3cd2fe,null))[_0x029b('0x1f')](function(_0xf7e6ab){_0x1e9910['account']=_0xf7e6ab;if(_0x1e9910['account']&&_0x1e9910[_0x029b('0x82')]['type']===_0x029b('0x83')&&_0x588e4e['body'][_0x029b('0x84')]){if(_0x588e4e[_0x029b('0x66')]['statuses']['length']===0x0)return;if(_0x588e4e[_0x029b('0x66')][_0x029b('0x84')][0x0][_0x029b('0x85')]!==_0x029b('0x86'))return;return db[_0x029b('0x87')][_0x029b('0x36')]({'read':!![],'readAt':_0x588e4e[_0x029b('0x66')]['statuses'][0x0][_0x029b('0x88')]},{'where':{'messageId':_0x588e4e[_0x029b('0x66')][_0x029b('0x84')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x59ffb4){return _0x3cd2fe['status'](0xc8)['json'](_0x59ffb4);});}_0x1e9910[_0x029b('0x89')]=_[_0x029b('0x8a')](_0xf7e6ab[_0x029b('0x81')],['priority'],['asc']);if(_0x1e9910[_0x029b('0x82')]['Applications']){delete _0x1e9910[_0x029b('0x82')]['Applications'];}return db['CmContact'][_0x029b('0x67')]()[_0x029b('0x1f')](function(_0x1ba297){if(!_0x1ba297){throw new db[(_0x029b('0x8b'))][(_0x029b('0x8c'))](_0x029b('0x8d'));}_0x5e6273=_['difference'](_[_0x029b('0x46')](_0x1ba297),[_0x029b('0x8e'),_0x029b('0x8f')]);_0x9c9601=_[_0x029b('0x90')](_['keys'](_0x1ba297),['createdAt',_0x029b('0x8f'),_0x029b('0x91'),_0x029b('0x92')]);_0x1e9910[_0x029b('0x66')]={'mapKey':_0x029b('0x93')};if(_0x1e9910[_0x029b('0x82')]&&_0x1e9910[_0x029b('0x82')]['type']===_0x029b('0x94')){_0x1e9910[_0x029b('0x66')][_0x029b('0x95')]=_0x588e4e[_0x029b('0x66')][_0x029b('0x96')][_0x029b('0x97')](_0x029b('0x98'),'');_0x1e9910[_0x029b('0x66')][_0x029b('0x66')]=_0x588e4e[_0x029b('0x66')]['Body'];_0x1e9910[_0x029b('0x66')][_0x029b('0x99')]=_0x588e4e[_0x029b('0x66')][_0x029b('0x9a')];}if(_0x1e9910[_0x029b('0x82')]&&_0x1e9910[_0x029b('0x82')]['type']===_0x029b('0x83')){_0x1e9910[_0x029b('0x66')][_0x029b('0x95')]=_0x588e4e[_0x029b('0x66')][_0x029b('0x9b')][0x0][_0x029b('0x95')];_0x1e9910[_0x029b('0x66')][_0x029b('0x66')]=_0x588e4e[_0x029b('0x66')]['notifications'][0x0][_0x029b('0x28')]['body'];_0x1e9910[_0x029b('0x66')]['messageId']=_0x588e4e[_0x029b('0x66')]['notifications'][0x0][_0x029b('0x9c')];}if(_0x1e9910[_0x029b('0x66')]['id']){delete _0x1e9910[_0x029b('0x66')]['id'];}if(_[_0x029b('0x9d')](_0x1e9910['body'][_0x029b('0x95')])){throw new db[(_0x029b('0x8b'))][(_0x029b('0x8c'))](_0x029b('0x9e'));}if(_[_0x029b('0x9d')](_0x1e9910[_0x029b('0x66')][_0x029b('0x66')])||_0x1e9910[_0x029b('0x66')][_0x029b('0x66')]===''){throw new db[(_0x029b('0x8b'))][(_0x029b('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x029b('0x9d')](_0x1e9910[_0x029b('0x66')]['mapKey'])){throw new db[(_0x029b('0x8b'))][(_0x029b('0x8c'))](_0x029b('0x9f')+_0x9c9601);}if(!_[_0x029b('0xa0')](_0x9c9601,_0x1e9910['body'][_0x029b('0xa1')])){throw new db['Sequelize'][(_0x029b('0x8c'))](_0x029b('0xa2')+_0x9c9601);}_0x3d2058[_0x1e9910['body'][_0x029b('0xa1')]]=_0x1e9910['body']['from'];return db[_0x029b('0xa3')]['find']({'where':{'id':_0x1e9910[_0x029b('0x82')][_0x029b('0x92')]},'include':[{'model':db[_0x029b('0xa4')],'as':'Contacts','where':_0x3d2058,'limit':0x1,'order':[[_0x029b('0x8f'),_0x029b('0xa5')]]}]});})[_0x029b('0x1f')](handleEntityNotFound(_0x3cd2fe,null))[_0x029b('0x1f')](function(_0x119aa7){if(_0x119aa7){_0x1e9910[_0x029b('0xa6')]=_['omit'](_0x119aa7,[_0x029b('0xa7')]);if(_0x119aa7['Contacts'][_0x029b('0x4b')]){return _0x119aa7[_0x029b('0xa7')][0x0];}var _0xc6cb1b=_[_0x029b('0x17')](_0x1e9910[_0x029b('0x66')],{'firstName':_0x1e9910[_0x029b('0x66')][_0x029b('0x95')],'ListId':_0x119aa7['id']});_0xc6cb1b[_0x1e9910[_0x029b('0x66')][_0x029b('0xa1')]]=_0x1e9910[_0x029b('0x66')][_0x029b('0x95')];return db['CmContact'][_0x029b('0x5e')](_0xc6cb1b,{'fields':_0x5e6273,'raw':!![]});}})[_0x029b('0x1f')](handleEntityNotFound(_0x3cd2fe,null))[_0x029b('0x1f')](function(_0x3df075){if(_0x3df075){_0x1e9910[_0x029b('0xa8')]=_0x3df075;var _0x28b5ec={'ContactId':_0x3df075['id'],'phone':_0x1e9910['body']['from'],'WhatsappAccountId':_0x588e4e[_0x029b('0x5b')]['id']};var _0x145ce4={'ContactId':_0x3df075['id'],'WhatsappAccountId':_0x588e4e['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x029b('0x5d')]({'where':_0x145ce4})[_0x029b('0x1f')](function(_0x5215a7){if(_0x5215a7){return[_0x5215a7,![]];}return db[_0x029b('0xa9')][_0x029b('0x5e')](_0x28b5ec)[_0x029b('0x1f')](function(_0x271c45){return[_0x271c45,!![]];});});}})['spread'](function(_0x1a0ed6,_0x14f92b){_0x1e9910[_0x029b('0xaa')]=_0x1a0ed6[_0x029b('0x38')]({'plain':!![]});_0x1e9910[_0x029b('0xaa')][_0x029b('0xab')]=![];if(_0x14f92b){if(_0x1e9910[_0x029b('0x82')]['autoclose']){_0x1e9910[_0x029b('0x89')][_0x029b('0xac')]({'id':0x0,'priority':_0x1e9910[_0x029b('0x89')]['length']+0x1,'app':_0x029b('0xad'),'appdata':_0x029b('0xae'),'interval':_0x029b('0xaf')});}_0x1e9910[_0x029b('0xaa')][_0x029b('0xab')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x1e9910[_0x029b('0x66')][_0x029b('0x95')],'messageId':_0x1e9910[_0x029b('0x66')][_0x029b('0x99')],'body':_0x1e9910[_0x029b('0x66')][_0x029b('0x66')],'WhatsappAccountId':_0x588e4e['params']['id'],'WhatsappInteractionId':_0x1a0ed6['id'],'direction':'in','ContactId':_0x1a0ed6['ContactId'],'AttachmentId':_0x1e9910[_0x029b('0x66')][_0x029b('0xb0')]});})[_0x029b('0x1f')](function(_0x5276c4){_0x1e9910['message']=_0x5276c4;if(_0x1e9910[_0x029b('0xaa')][_0x029b('0xb1')]){return db[_0x029b('0xb2')][_0x029b('0x5d')]({'attributes':['id',_0x029b('0x3a')],'where':{'id':_0x1e9910[_0x029b('0xaa')][_0x029b('0xb1')]}})[_0x029b('0x1f')](function(_0x18db2c){if(_0x18db2c){_0x1e9910['applications'][_0x029b('0xb3')]({'id':0x0,'priority':0x0,'app':_0x029b('0xb4'),'appdata':_0x18db2c['name']+','+(_0x1e9910[_0x029b('0x82')][_0x029b('0xb5')]||0xa),'interval':_0x029b('0xaf')});}return respondWithRpcPromise(_0x029b('0xb6'),_0x029b('0xb7'),_0x1e9910);});}return respondWithRpcPromise(_0x029b('0xb6'),_0x029b('0xb7'),_0x1e9910);})[_0x029b('0x1f')](function(_0xe0b047){if(_0xe0b047){var _0x81ba33=0xc8;var _0x2ef324='receiveMessage';logger[_0x029b('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2ef324,_0x81ba33,_0x029b('0xb8'));logger[_0x029b('0x23')](_0x029b('0xb9'),_0x2ef324,_0x81ba33,'entity\x20found',JSON[_0x029b('0x25')](_0xe0b047));if(_0x1e9910[_0x029b('0x82')][_0x029b('0x41')]===_0x029b('0x94')){return _0x3cd2fe[_0x029b('0x2c')](_0x81ba33)[_0x029b('0xba')](_0x029b('0xbb'),_0x029b('0xbc'))[_0x029b('0x3b')](_0x029b('0xbd'));}else{return _0x3cd2fe['status'](_0x81ba33)['json'](_0xe0b047);}}});})[_0x029b('0x2a')](handleError(_0x3cd2fe,null));};exports[_0x029b('0x3b')]=function(_0x1e8fc2,_0x394f5d,_0x111767){var _0x780cde,_0x8836bd,_0x63c080;if(_[_0x029b('0x9d')](_0x1e8fc2[_0x029b('0x66')][_0x029b('0x66')])||_0x1e8fc2['body']['body']===''){throw new db[(_0x029b('0x8b'))][(_0x029b('0x8c'))](_0x029b('0xbe'));}if(_['isNil'](_0x1e8fc2[_0x029b('0x66')]['to'])){throw new db[(_0x029b('0x8b'))]['ValidationError']('to\x20is\x20mandatory');}_0x780cde=_0x1e8fc2[_0x029b('0x66')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x1e8fc2[_0x029b('0x5b')]['id']},'include':[{'model':db[_0x029b('0xa3')],'as':_0x029b('0xbf'),'include':[{'model':db[_0x029b('0xa4')],'as':_0x029b('0xa7'),'where':{'mobile':_0x780cde},'limit':0x1,'order':[['updatedAt',_0x029b('0xa5')]]}]}]})['then'](handleEntityNotFound(_0x394f5d,null))[_0x029b('0x1f')](function(_0x440da0){if(_0x440da0&&_0x440da0['List']){_0x8836bd=_0x440da0[_0x029b('0x38')]({'plain':!![]});if(_0x8836bd[_0x029b('0xbf')]&&_0x8836bd[_0x029b('0xbf')][_0x029b('0xa7')]['length']){return _0x8836bd[_0x029b('0xbf')][_0x029b('0xa7')][0x0];}return db[_0x029b('0xa4')][_0x029b('0x5e')](_[_0x029b('0x17')](_0x1e8fc2[_0x029b('0x66')],{'firstName':_0x780cde,'mobile':_0x780cde,'phone':_0x780cde,'ListId':_0x8836bd[_0x029b('0x92')]}));}})['then'](handleEntityNotFound(_0x394f5d,null))[_0x029b('0x1f')](function(_0x215fd0){if(_0x215fd0){_0x63c080=_0x215fd0;return db[_0x029b('0xa9')][_0x029b('0x5d')]({'where':{'ContactId':_0x63c080['id'],'closed':![],'WhatsappAccountId':_0x8836bd['id']}})[_0x029b('0x1f')](function(_0x2d8525){if(_0x2d8525){return[_0x2d8525,![]];}return db[_0x029b('0xa9')][_0x029b('0x5e')]({'UserId':_0x1e8fc2[_0x029b('0x5f')]['id'],'ContactId':_0x63c080['id'],'WhatsappAccountId':_0x8836bd['id'],'phone':_0x780cde,'firstMsgDirection':_0x029b('0xc0'),'Messages':[_[_0x029b('0x53')](_0x1e8fc2[_0x029b('0x66')],{'read':![],'body':_0x1e8fc2[_0x029b('0x66')][_0x029b('0x66')],'phone':_0x780cde,'WhatsappAccountId':_0x8836bd['id'],'UserId':_0x1e8fc2[_0x029b('0x5f')]['id'],'ContactId':_0x63c080['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x1d41ca){return[_0x1d41ca,!![]];});});}})[_0x029b('0x74')](function(_0x5e8a52,_0x443aca){if(_0x443aca){return _0x5e8a52;}return db[_0x029b('0x87')][_0x029b('0x5e')](_[_0x029b('0x53')](_0x1e8fc2[_0x029b('0x66')],{'read':![],'body':_0x1e8fc2[_0x029b('0x66')]['body'],'phone':_0x780cde,'WhatsappAccountId':_0x8836bd['id'],'WhatsappInteractionId':_0x5e8a52['id'],'UserId':_0x1e8fc2[_0x029b('0x5f')]['id'],'ContactId':_0x63c080['id']}))[_0x029b('0x1f')](function(_0x5900ca){_0x5e8a52['dataValues'][_0x029b('0xc1')]=[];_0x5e8a52[_0x029b('0xc2')][_0x029b('0xc1')][_0x029b('0xac')](_0x5900ca[_0x029b('0xc2')]);return _0x5e8a52;});})[_0x029b('0x1f')](respondWithResult(_0x394f5d,null))[_0x029b('0x2a')](handleError(_0x394f5d,null));}; \ No newline at end of file +var _0x99a4=['options','includeAll','include','findAll','rows','show','find','create','body','user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','emit','getAgents','User','rawAttributes','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','account','statuses','read','WhatsappMessage','message_id','applications','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','createdAt','ListId','from','From','Body','messageId','MessageSid','sinch','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','defaults','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','UserId','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL'];(function(_0x4c5149,_0x39629d){var _0x3273c0=function(_0x5a734f){while(--_0x5a734f){_0x4c5149['push'](_0x4c5149['shift']());}};_0x3273c0(++_0x39629d);}(_0x99a4,0x1cd));var _0x499a=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x99a4[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require(_0x499a('0x0'));var rimraf=require(_0x499a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x499a('0x2'));var rp=require(_0x499a('0x3'));var moment=require(_0x499a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x499a('0x5'));var util=require(_0x499a('0x6'));var path=require(_0x499a('0x7'));var sox=require(_0x499a('0x8'));var csv=require(_0x499a('0x9'));var ejs=require(_0x499a('0xa'));var fs=require('fs');var fs_extra=require(_0x499a('0xb'));var _=require(_0x499a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x499a('0xd'));var deskjs=require(_0x499a('0xe'));var toCsv=require(_0x499a('0x9'));var querystring=require(_0x499a('0xf'));var Papa=require(_0x499a('0x10'));var Redis=require('ioredis');var authService=require(_0x499a('0x11'));var qs=require(_0x499a('0x12'));var as=require(_0x499a('0x13'));var hardwareService=require(_0x499a('0x14'));var logger=require(_0x499a('0x15'))('api');var utils=require(_0x499a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x499a('0x17'));var db=require(_0x499a('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x499a('0x19'))(new Redis(config[_0x499a('0x1a')]));require('./whatsappAccount.socket')[_0x499a('0x1b')](socket);var jayson=require(_0x499a('0x1c'));var client=jayson['client'][_0x499a('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x366f75,_0x4cf186,_0x44bc9d,_0x14794c){return new BPromise(function(_0x271e9c,_0x11c362){var _0x2a015a=_0x14794c||client;return _0x2a015a['request'](_0x366f75,_0x44bc9d)[_0x499a('0x1e')](function(_0x54d947){logger[_0x499a('0x1f')](_0x499a('0x20'),_0x4cf186,_0x499a('0x21'));logger[_0x499a('0x22')](_0x499a('0x23'),_0x4cf186,'request\x20sent',JSON[_0x499a('0x24')](_0x54d947));if(_0x54d947[_0x499a('0x25')]){if(_0x54d947[_0x499a('0x25')][_0x499a('0x26')]===0x1f4){logger[_0x499a('0x25')](_0x499a('0x20'),_0x4cf186,_0x54d947[_0x499a('0x25')][_0x499a('0x27')]);return _0x11c362(_0x54d947['error']['message']);}logger[_0x499a('0x25')](_0x499a('0x20'),_0x4cf186,_0x54d947['error'][_0x499a('0x27')]);return _0x271e9c(_0x54d947[_0x499a('0x25')][_0x499a('0x27')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x4cf186,'request\x20sent');_0x271e9c(_0x54d947[_0x499a('0x28')][_0x499a('0x27')]);}})[_0x499a('0x29')](function(_0x3f90f4){logger[_0x499a('0x25')](_0x499a('0x20'),_0x4cf186,_0x3f90f4);_0x11c362(_0x3f90f4);});});}function respondWithStatusCode(_0x3bea62,_0x42fc0e){_0x42fc0e=_0x42fc0e||0xcc;return function(_0x4ede39){if(_0x4ede39){return _0x3bea62[_0x499a('0x2a')](_0x42fc0e);}return _0x3bea62[_0x499a('0x2b')](_0x42fc0e)[_0x499a('0x2c')]();};}function respondWithResult(_0x32d13f,_0x4570a9){_0x4570a9=_0x4570a9||0xc8;return function(_0x269123){if(_0x269123){return _0x32d13f[_0x499a('0x2b')](_0x4570a9)[_0x499a('0x2d')](_0x269123);}};}function respondWithFilteredResult(_0x2fb9d7,_0x3155d6){return function(_0x3e6310){if(_0x3e6310){var _0x275b64=typeof _0x3155d6[_0x499a('0x2e')]==='undefined'&&typeof _0x3155d6[_0x499a('0x2f')]===_0x499a('0x30');var _0x1d6cca=_0x3e6310[_0x499a('0x31')];var _0x33c6ce=_0x275b64?0x0:_0x3155d6[_0x499a('0x2e')];var _0x387f6e=_0x275b64?_0x3e6310[_0x499a('0x31')]:_0x3155d6[_0x499a('0x2e')]+_0x3155d6[_0x499a('0x2f')];var _0x74d858;if(_0x387f6e>=_0x1d6cca){_0x387f6e=_0x1d6cca;_0x74d858=0xc8;}else{_0x74d858=0xce;}_0x2fb9d7[_0x499a('0x2b')](_0x74d858);return _0x2fb9d7[_0x499a('0x32')](_0x499a('0x33'),_0x33c6ce+'-'+_0x387f6e+'/'+_0x1d6cca)[_0x499a('0x2d')](_0x3e6310);}return null;};}function patchUpdates(_0x3bd044){return function(_0x4475b9){try{jsonpatch['apply'](_0x4475b9,_0x3bd044,!![]);}catch(_0x39a3b1){return BPromise[_0x499a('0x34')](_0x39a3b1);}return _0x4475b9[_0x499a('0x35')]();};}function saveUpdates(_0x5a5f3f,_0x1bd154){return function(_0x16166a){if(_0x16166a){return _0x16166a[_0x499a('0x36')](_0x5a5f3f)[_0x499a('0x1e')](function(_0x1f3e4a){return _0x1f3e4a;});}return null;};}function removeEntity(_0x51b763,_0x38ed77){return function(_0x30dc84){if(_0x30dc84){return _0x30dc84[_0x499a('0x37')]()['then'](function(){var _0x4c8d92=_0x30dc84[_0x499a('0x38')]({'plain':!![]});var _0x492405='WhatsappAccounts';return db[_0x499a('0x39')][_0x499a('0x37')]({'where':{'type':_0x492405,'resourceId':_0x4c8d92['id']}})['then'](function(){return _0x30dc84;});})[_0x499a('0x1e')](function(){_0x51b763[_0x499a('0x2b')](0xcc)[_0x499a('0x2c')]();});}};}function handleEntityNotFound(_0x26b509,_0x1d1750){return function(_0x5b8502){if(!_0x5b8502){_0x26b509[_0x499a('0x2a')](0x194);}return _0x5b8502;};}function handleError(_0x2f0810,_0x2ed52f){_0x2ed52f=_0x2ed52f||0x1f4;return function(_0x5eaa7b){logger[_0x499a('0x25')](_0x5eaa7b['stack']);if(_0x5eaa7b['name']){delete _0x5eaa7b[_0x499a('0x3a')];}_0x2f0810[_0x499a('0x2b')](_0x2ed52f)['send'](_0x5eaa7b);};}exports[_0x499a('0x3b')]=function(_0x152778,_0x36dec7){var _0x28ae5c={'include':[{'model':db[_0x499a('0x3c')],'as':_0x499a('0x3d')}]},_0x636462={},_0x22adb4={'count':0x0,'rows':[]};var _0x5a27b5=_[_0x499a('0x3e')](db[_0x499a('0x3f')]['rawAttributes'],function(_0x35e768){return{'name':_0x35e768[_0x499a('0x40')],'type':_0x35e768['type']['key']};});_0x636462[_0x499a('0x41')]=_[_0x499a('0x3e')](_0x5a27b5,'name');_0x636462['query']=_[_0x499a('0x42')](_0x152778[_0x499a('0x43')]);_0x636462[_0x499a('0x44')]=_[_0x499a('0x45')](_0x636462[_0x499a('0x41')],_0x636462[_0x499a('0x43')]);_0x28ae5c[_0x499a('0x46')]=_[_0x499a('0x45')](_0x636462[_0x499a('0x41')],qs[_0x499a('0x47')](_0x152778[_0x499a('0x43')][_0x499a('0x47')]));_0x28ae5c[_0x499a('0x46')]=_0x28ae5c[_0x499a('0x46')][_0x499a('0x48')]?_0x28ae5c[_0x499a('0x46')]:_0x636462[_0x499a('0x41')];if(!_0x152778[_0x499a('0x43')][_0x499a('0x49')](_0x499a('0x4a'))){_0x28ae5c[_0x499a('0x2f')]=qs[_0x499a('0x2f')](_0x152778[_0x499a('0x43')][_0x499a('0x2f')]);_0x28ae5c[_0x499a('0x2e')]=qs['offset'](_0x152778[_0x499a('0x43')][_0x499a('0x2e')]);}_0x28ae5c[_0x499a('0x4b')]=qs[_0x499a('0x4c')](_0x152778['query']['sort']);_0x28ae5c['where']=qs[_0x499a('0x44')](_['pick'](_0x152778[_0x499a('0x43')],_0x636462['filters']),_0x5a27b5);if(_0x152778['query'][_0x499a('0x4d')]){_0x28ae5c[_0x499a('0x4e')]=_[_0x499a('0x4f')](_0x28ae5c[_0x499a('0x4e')],{'$or':_[_0x499a('0x3e')](_0x5a27b5,function(_0x38bb29){if(_0x38bb29[_0x499a('0x50')]!==_0x499a('0x51')){var _0x59619c={};_0x59619c[_0x38bb29[_0x499a('0x3a')]]={'$like':'%'+_0x152778[_0x499a('0x43')][_0x499a('0x4d')]+'%'};return _0x59619c;}})});}_0x28ae5c=_[_0x499a('0x4f')]({},_0x28ae5c,_0x152778[_0x499a('0x52')]);var _0x5a3fef={'where':_0x28ae5c[_0x499a('0x4e')]};return db['WhatsappAccount'][_0x499a('0x31')](_0x5a3fef)[_0x499a('0x1e')](function(_0x46e699){_0x22adb4[_0x499a('0x31')]=_0x46e699;if(_0x152778[_0x499a('0x43')][_0x499a('0x53')]){_0x28ae5c[_0x499a('0x54')]=[{'all':!![]}];}return db[_0x499a('0x3f')][_0x499a('0x55')](_0x28ae5c);})['then'](function(_0x41dd71){_0x22adb4[_0x499a('0x56')]=_0x41dd71;return _0x22adb4;})[_0x499a('0x1e')](respondWithFilteredResult(_0x36dec7,_0x28ae5c))[_0x499a('0x29')](handleError(_0x36dec7,null));};exports[_0x499a('0x57')]=function(_0x5b4e53,_0x1c1a7e){var _0x2ca7fc={'raw':![],'where':{'id':_0x5b4e53['params']['id']},'include':[{'model':db[_0x499a('0x3c')],'as':_0x499a('0x3d')}]},_0x1d476f={};_0x1d476f[_0x499a('0x41')]=_[_0x499a('0x42')](db[_0x499a('0x3f')]['rawAttributes']);_0x1d476f['query']=_[_0x499a('0x42')](_0x5b4e53['query']);_0x1d476f[_0x499a('0x44')]=_[_0x499a('0x45')](_0x1d476f[_0x499a('0x41')],_0x1d476f['query']);_0x2ca7fc[_0x499a('0x46')]=_[_0x499a('0x45')](_0x1d476f[_0x499a('0x41')],qs['fields'](_0x5b4e53[_0x499a('0x43')][_0x499a('0x47')]));_0x2ca7fc[_0x499a('0x46')]=_0x2ca7fc[_0x499a('0x46')][_0x499a('0x48')]?_0x2ca7fc['attributes']:_0x1d476f[_0x499a('0x41')];if(_0x5b4e53['query'][_0x499a('0x53')]){_0x2ca7fc[_0x499a('0x54')]=[{'all':!![]}];}_0x2ca7fc=_['merge']({},_0x2ca7fc,_0x5b4e53[_0x499a('0x52')]);return db[_0x499a('0x3f')][_0x499a('0x58')](_0x2ca7fc)['then'](handleEntityNotFound(_0x1c1a7e,null))['then'](respondWithResult(_0x1c1a7e,null))['catch'](handleError(_0x1c1a7e,null));};exports[_0x499a('0x59')]=function(_0x38d692,_0x29fd9){return db['WhatsappAccount'][_0x499a('0x59')](_0x38d692[_0x499a('0x5a')],{})[_0x499a('0x1e')](function(_0x449b7f){var _0x4df2a0=_0x38d692[_0x499a('0x5b')][_0x499a('0x38')]({'plain':!![]});if(!_0x4df2a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4df2a0[_0x499a('0x5c')]===_0x499a('0x5b')){var _0x55144b=_0x449b7f[_0x499a('0x38')]({'plain':!![]});var _0x2e566d=_0x499a('0x5d');return db[_0x499a('0x5e')][_0x499a('0x58')]({'where':{'name':_0x2e566d,'userProfileId':_0x4df2a0[_0x499a('0x5f')]},'raw':!![]})[_0x499a('0x1e')](function(_0x317be7){if(_0x317be7&&_0x317be7[_0x499a('0x60')]===0x0){return db[_0x499a('0x39')]['create']({'name':_0x55144b['name'],'resourceId':_0x55144b['id'],'type':_0x317be7['name'],'sectionId':_0x317be7['id']},{})['then'](function(){return _0x449b7f;});}else{return _0x449b7f;}})[_0x499a('0x29')](function(_0x52b7c1){logger[_0x499a('0x25')](_0x499a('0x61'),_0x52b7c1);throw _0x52b7c1;});}return _0x449b7f;})[_0x499a('0x1e')](respondWithResult(_0x29fd9,0xc9))[_0x499a('0x29')](handleError(_0x29fd9,null));};exports[_0x499a('0x36')]=function(_0xf181ce,_0x1b08c3){if(_0xf181ce['body']['id']){delete _0xf181ce[_0x499a('0x5a')]['id'];}return db[_0x499a('0x3f')][_0x499a('0x58')]({'where':{'id':_0xf181ce['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x499a('0x1e')](handleEntityNotFound(_0x1b08c3,null))[_0x499a('0x1e')](saveUpdates(_0xf181ce[_0x499a('0x5a')],null))[_0x499a('0x1e')](respondWithResult(_0x1b08c3,null))[_0x499a('0x29')](handleError(_0x1b08c3,null));};exports['destroy']=function(_0xdab817,_0x4ab02d){return db[_0x499a('0x3f')]['find']({'where':{'id':_0xdab817['params']['id']}})[_0x499a('0x1e')](handleEntityNotFound(_0x4ab02d,null))['then'](removeEntity(_0x4ab02d,null))[_0x499a('0x29')](handleError(_0x4ab02d,null));};exports['describe']=function(_0xc06dc5,_0x543e3c){return db[_0x499a('0x3f')][_0x499a('0x62')]()[_0x499a('0x1e')](respondWithResult(_0x543e3c,null))[_0x499a('0x29')](handleError(_0x543e3c,null));};exports[_0x499a('0x63')]=function(_0x1cb076,_0x189fce,_0x34bafa){if(_0x1cb076['body']['id']){delete _0x1cb076[_0x499a('0x5a')]['id'];}return db['WhatsappAccount'][_0x499a('0x58')]({'where':{'id':_0x1cb076[_0x499a('0x64')]['id']}})[_0x499a('0x1e')](handleEntityNotFound(_0x189fce,null))['then'](function(_0x2b2af6){if(_0x2b2af6){_0x1cb076[_0x499a('0x5a')][_0x499a('0x65')]=_0x2b2af6['id'];return db[_0x499a('0x66')][_0x499a('0x59')](_0x1cb076[_0x499a('0x5a')]);}})[_0x499a('0x1e')](respondWithResult(_0x189fce,null))[_0x499a('0x29')](handleError(_0x189fce,null));};exports[_0x499a('0x67')]=function(_0x276149,_0x3dd5b8,_0x2ed9d0){var _0x1d9671={'raw':![],'where':{}};var _0x3f7faf={};var _0x245e19={'count':0x0,'rows':[]};return db[_0x499a('0x3f')][_0x499a('0x68')]({'where':{'id':_0x276149['params']['id']}})[_0x499a('0x1e')](handleEntityNotFound(_0x3dd5b8,null))['then'](function(_0x1f4f47){if(_0x1f4f47){_0x3f7faf[_0x499a('0x41')]=_[_0x499a('0x42')](db[_0x499a('0x66')]['rawAttributes']);_0x3f7faf[_0x499a('0x43')]=_['keys'](_0x276149['query']);_0x3f7faf['filters']=_[_0x499a('0x45')](_0x3f7faf[_0x499a('0x41')],_0x3f7faf[_0x499a('0x43')]);_0x1d9671[_0x499a('0x46')]=_[_0x499a('0x45')](_0x3f7faf[_0x499a('0x41')],qs['fields'](_0x276149[_0x499a('0x43')][_0x499a('0x47')]));_0x1d9671['attributes']=_0x1d9671[_0x499a('0x46')]['length']?_0x1d9671[_0x499a('0x46')]:_0x3f7faf['model'];if(!_0x276149[_0x499a('0x43')][_0x499a('0x49')](_0x499a('0x4a'))){_0x1d9671['limit']=qs[_0x499a('0x2f')](_0x276149['query']['limit']);_0x1d9671[_0x499a('0x2e')]=qs['offset'](_0x276149['query']['offset']);}_0x1d9671[_0x499a('0x4b')]=qs[_0x499a('0x4c')](_0x276149[_0x499a('0x43')][_0x499a('0x4c')]);_0x1d9671['where']=qs[_0x499a('0x44')](_[_0x499a('0x69')](_0x276149[_0x499a('0x43')],_0x3f7faf[_0x499a('0x44')]));_0x1d9671[_0x499a('0x4e')]['WhatsappAccountId']=_0x1f4f47['id'];if(_0x276149['query'][_0x499a('0x4d')]){_0x1d9671['where']=_[_0x499a('0x4f')](_0x1d9671['where'],{'$or':_[_0x499a('0x3e')](_0x1d9671[_0x499a('0x46')],function(_0x15a160){var _0x470bd7={};_0x470bd7[_0x15a160]={'$like':'%'+_0x276149[_0x499a('0x43')]['filter']+'%'};return _0x470bd7;})});}_0x1d9671=_[_0x499a('0x4f')]({},_0x1d9671,_0x276149[_0x499a('0x52')]);return db[_0x499a('0x66')][_0x499a('0x31')]({'where':_0x1d9671[_0x499a('0x4e')]})[_0x499a('0x1e')](function(_0x3de56f){_0x245e19[_0x499a('0x31')]=_0x3de56f;if(_0x276149[_0x499a('0x43')][_0x499a('0x53')]){_0x1d9671[_0x499a('0x54')]=[{'all':!![]}];}return db[_0x499a('0x66')][_0x499a('0x55')](_0x1d9671);})[_0x499a('0x1e')](function(_0x1c4b9b){_0x245e19[_0x499a('0x56')]=_0x1c4b9b;return _0x245e19;});}})[_0x499a('0x1e')](respondWithFilteredResult(_0x3dd5b8,_0x1d9671))[_0x499a('0x29')](handleError(_0x3dd5b8,null));};exports[_0x499a('0x6a')]=function(_0x3aac69,_0x30199f,_0x3d0c68){return db[_0x499a('0x3f')][_0x499a('0x58')]({'where':{'id':_0x3aac69[_0x499a('0x64')]['id']}})[_0x499a('0x1e')](handleEntityNotFound(_0x30199f,null))[_0x499a('0x1e')](function(_0x3324e6){if(_0x3324e6){return _0x3324e6[_0x499a('0x6a')](_0x3aac69[_0x499a('0x43')][_0x499a('0x6b')]);}})[_0x499a('0x1e')](respondWithStatusCode(_0x30199f,null))['catch'](handleError(_0x30199f,null));};exports['addAnswer']=function(_0x256a9a,_0x15699a,_0x1ba59e){if(_0x256a9a[_0x499a('0x5a')]['id']){delete _0x256a9a[_0x499a('0x5a')]['id'];}return db[_0x499a('0x3f')]['find']({'where':{'id':_0x256a9a[_0x499a('0x64')]['id']}})['then'](handleEntityNotFound(_0x15699a,null))[_0x499a('0x1e')](function(_0x301b58){if(_0x301b58){_0x256a9a['body'][_0x499a('0x65')]=_0x301b58['id'];return db[_0x499a('0x6c')]['create'](_0x256a9a['body']);}})[_0x499a('0x1e')](respondWithResult(_0x15699a,null))[_0x499a('0x29')](handleError(_0x15699a,null));};exports[_0x499a('0x6d')]=function(_0x3bb238,_0x3b12ae,_0x5da653){var _0x24b7fa={'raw':![],'where':{}};var _0x43d155={};var _0x57fa17={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x499a('0x68')]({'where':{'id':_0x3bb238[_0x499a('0x64')]['id']}})[_0x499a('0x1e')](handleEntityNotFound(_0x3b12ae,null))[_0x499a('0x1e')](function(_0x44fe8a){if(_0x44fe8a){_0x43d155[_0x499a('0x41')]=_[_0x499a('0x42')](db[_0x499a('0x6c')]['rawAttributes']);_0x43d155[_0x499a('0x43')]=_[_0x499a('0x42')](_0x3bb238[_0x499a('0x43')]);_0x43d155['filters']=_[_0x499a('0x45')](_0x43d155[_0x499a('0x41')],_0x43d155['query']);_0x24b7fa[_0x499a('0x46')]=_[_0x499a('0x45')](_0x43d155[_0x499a('0x41')],qs[_0x499a('0x47')](_0x3bb238[_0x499a('0x43')]['fields']));_0x24b7fa[_0x499a('0x46')]=_0x24b7fa[_0x499a('0x46')][_0x499a('0x48')]?_0x24b7fa[_0x499a('0x46')]:_0x43d155[_0x499a('0x41')];if(!_0x3bb238[_0x499a('0x43')][_0x499a('0x49')](_0x499a('0x4a'))){_0x24b7fa[_0x499a('0x2f')]=qs['limit'](_0x3bb238[_0x499a('0x43')][_0x499a('0x2f')]);_0x24b7fa[_0x499a('0x2e')]=qs[_0x499a('0x2e')](_0x3bb238[_0x499a('0x43')]['offset']);}_0x24b7fa[_0x499a('0x4b')]=qs['sort'](_0x3bb238[_0x499a('0x43')][_0x499a('0x4c')]);_0x24b7fa[_0x499a('0x4e')]=qs[_0x499a('0x44')](_[_0x499a('0x69')](_0x3bb238[_0x499a('0x43')],_0x43d155[_0x499a('0x44')]));_0x24b7fa[_0x499a('0x4e')][_0x499a('0x65')]=_0x44fe8a['id'];if(_0x3bb238[_0x499a('0x43')]['filter']){_0x24b7fa[_0x499a('0x4e')]=_[_0x499a('0x4f')](_0x24b7fa['where'],{'$or':_[_0x499a('0x3e')](_0x24b7fa[_0x499a('0x46')],function(_0x380c86){var _0xf24029={};_0xf24029[_0x380c86]={'$like':'%'+_0x3bb238['query']['filter']+'%'};return _0xf24029;})});}_0x24b7fa=_['merge']({},_0x24b7fa,_0x3bb238[_0x499a('0x52')]);return db[_0x499a('0x6c')]['count']({'where':_0x24b7fa['where']})['then'](function(_0x132fcc){_0x57fa17[_0x499a('0x31')]=_0x132fcc;if(_0x3bb238[_0x499a('0x43')]['includeAll']){_0x24b7fa[_0x499a('0x54')]=[{'all':!![]}];}return db[_0x499a('0x6c')][_0x499a('0x55')](_0x24b7fa);})[_0x499a('0x1e')](function(_0x4f4c47){_0x57fa17[_0x499a('0x56')]=_0x4f4c47;return _0x57fa17;});}})['then'](respondWithFilteredResult(_0x3b12ae,_0x24b7fa))[_0x499a('0x29')](handleError(_0x3b12ae,null));};exports['removeAnswers']=function(_0x55d350,_0x31dd8e,_0x5058eb){return db[_0x499a('0x3f')][_0x499a('0x58')]({'where':{'id':_0x55d350['params']['id']}})[_0x499a('0x1e')](handleEntityNotFound(_0x31dd8e,null))[_0x499a('0x1e')](function(_0x1e4e01){if(_0x1e4e01){return _0x1e4e01[_0x499a('0x6e')](_0x55d350[_0x499a('0x43')][_0x499a('0x6b')]);}})[_0x499a('0x1e')](respondWithStatusCode(_0x31dd8e,null))['catch'](handleError(_0x31dd8e,null));};exports['addAgents']=function(_0x39c149,_0x3dfc63,_0x13f42a){return db['WhatsappAccount']['find']({'where':{'id':_0x39c149[_0x499a('0x64')]['id']}})['then'](handleEntityNotFound(_0x3dfc63,null))[_0x499a('0x1e')](function(_0x1c6ea5){if(_0x1c6ea5){return _0x1c6ea5[_0x499a('0x6f')](_0x39c149['body'][_0x499a('0x6b')],_[_0x499a('0x70')](_0x39c149[_0x499a('0x5a')],['ids','id'])||{})[_0x499a('0x71')](function(_0x1113a){for(var _0x41dd90=0x0;_0x41dd90<_0x39c149[_0x499a('0x5a')]['ids'][_0x499a('0x48')];_0x41dd90+=0x1){socket['emit'](_0x499a('0x72'),{'UserId':Number(_0x39c149[_0x499a('0x5a')][_0x499a('0x6b')][_0x41dd90]),'WhatsappAccountId':Number(_0x39c149['params']['id'])});}return _0x1113a;});}})[_0x499a('0x1e')](respondWithResult(_0x3dfc63,null))[_0x499a('0x29')](handleError(_0x3dfc63,null));};exports['removeAgents']=function(_0x3160a0,_0x37f277,_0x21601b){return db['WhatsappAccount']['find']({'where':{'id':_0x3160a0['params']['id']}})['then'](handleEntityNotFound(_0x37f277,null))[_0x499a('0x1e')](function(_0x4f222){if(_0x4f222){return _0x4f222['removeAgents'](_0x3160a0[_0x499a('0x43')]['ids'])[_0x499a('0x1e')](function(){if(_['isArray'](_0x3160a0['query']['ids'])){for(var _0x2ecc1e=0x0;_0x2ecc1e<_0x3160a0['query'][_0x499a('0x6b')][_0x499a('0x48')];_0x2ecc1e+=0x1){socket[_0x499a('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x3160a0[_0x499a('0x43')][_0x499a('0x6b')][_0x2ecc1e]),'WhatsappAccountId':Number(_0x3160a0[_0x499a('0x64')]['id'])});}}else{socket[_0x499a('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x3160a0[_0x499a('0x43')]['ids']),'WhatsappAccountId':Number(_0x3160a0['params']['id'])});}});}})[_0x499a('0x1e')](respondWithStatusCode(_0x37f277,null))[_0x499a('0x29')](handleError(_0x37f277,null));};exports[_0x499a('0x74')]=function(_0x39b538,_0x41e474,_0x462b97){var _0x123331={};var _0x3cf8ce={};var _0x56f606;var _0x3dbcff;return db[_0x499a('0x3f')][_0x499a('0x68')]({'where':{'id':_0x39b538['params']['id']}})['then'](handleEntityNotFound(_0x41e474,null))['then'](function(_0x559e84){if(_0x559e84){_0x56f606=_0x559e84;_0x3cf8ce[_0x499a('0x41')]=_[_0x499a('0x42')](db[_0x499a('0x75')][_0x499a('0x76')]);_0x3cf8ce[_0x499a('0x43')]=_[_0x499a('0x42')](_0x39b538[_0x499a('0x43')]);_0x3cf8ce['filters']=_['intersection'](_0x3cf8ce['model'],_0x3cf8ce[_0x499a('0x43')]);_0x123331['attributes']=_[_0x499a('0x45')](_0x3cf8ce['model'],qs[_0x499a('0x47')](_0x39b538[_0x499a('0x43')][_0x499a('0x47')]));_0x123331[_0x499a('0x46')]=_0x123331[_0x499a('0x46')][_0x499a('0x48')]?_0x123331['attributes']:_0x3cf8ce['model'];_0x123331[_0x499a('0x4b')]=qs[_0x499a('0x4c')](_0x39b538[_0x499a('0x43')][_0x499a('0x4c')]);_0x123331[_0x499a('0x4e')]=qs[_0x499a('0x44')](_[_0x499a('0x69')](_0x39b538[_0x499a('0x43')],_0x3cf8ce[_0x499a('0x44')]));if(_0x39b538['query'][_0x499a('0x4d')]){_0x123331[_0x499a('0x4e')]=_[_0x499a('0x4f')](_0x123331[_0x499a('0x4e')],{'$or':_[_0x499a('0x3e')](_0x123331[_0x499a('0x46')],function(_0x15928b){var _0x10398e={};_0x10398e[_0x15928b]={'$like':'%'+_0x39b538[_0x499a('0x43')]['filter']+'%'};return _0x10398e;})});}_0x123331=_['merge']({},_0x123331,_0x39b538[_0x499a('0x52')]);return _0x56f606['getAgents'](_0x123331);}})['then'](function(_0x209e3b){if(_0x209e3b){_0x3dbcff=_0x209e3b['length'];if(!_0x39b538['query']['hasOwnProperty']('nolimit')){_0x123331[_0x499a('0x2f')]=qs['limit'](_0x39b538[_0x499a('0x43')][_0x499a('0x2f')]);_0x123331[_0x499a('0x2e')]=qs[_0x499a('0x2e')](_0x39b538[_0x499a('0x43')][_0x499a('0x2e')]);}return _0x56f606[_0x499a('0x74')](_0x123331);}})[_0x499a('0x1e')](function(_0x8c855b){if(_0x8c855b){return _0x8c855b?{'count':_0x3dbcff,'rows':_0x8c855b}:null;}})[_0x499a('0x1e')](respondWithResult(_0x41e474,null))[_0x499a('0x29')](handleError(_0x41e474,null));};exports[_0x499a('0x77')]=function(_0x4b4cdf,_0x471b71,_0x507eee){return db['WhatsappAccount']['findOne']({'where':{'id':_0x4b4cdf[_0x499a('0x64')]['id']}})['then'](handleEntityNotFound(_0x471b71,null))['then'](function(_0x23da0c){if(_0x23da0c){return db['sequelize'][_0x499a('0x78')](function(_0x45e58c){return db[_0x499a('0x79')][_0x499a('0x37')]({'where':{'WhatsappAccountId':_0x4b4cdf['params']['id']},'transaction':_0x45e58c})[_0x499a('0x1e')](function(_0xa91892){var _0xd055fa=_[_0x499a('0x3e')](_0x4b4cdf[_0x499a('0x5a')],function(_0xca6041){_0xca6041[_0x499a('0x65')]=_0x4b4cdf[_0x499a('0x64')]['id'];return _0xca6041;});return db[_0x499a('0x79')][_0x499a('0x7a')](_0xd055fa,{'transaction':_0x45e58c});});})[_0x499a('0x1e')](function(){return db[_0x499a('0x79')][_0x499a('0x7b')]({'where':{'WhatsappAccountId':_0x4b4cdf[_0x499a('0x64')]['id']},'order':_0x499a('0x7c')});});}})[_0x499a('0x1e')](respondWithResult(_0x471b71,null))[_0x499a('0x29')](handleError(_0x471b71,null));};exports[_0x499a('0x7d')]=function(_0x3e3472,_0x5a03f9,_0x4f9b04){var _0x2a08d2={};var _0x140764={};var _0x5bcba5;var _0x3139d0;return db[_0x499a('0x3f')][_0x499a('0x68')]({'where':{'id':_0x3e3472[_0x499a('0x64')]['id']}})['then'](handleEntityNotFound(_0x5a03f9,null))[_0x499a('0x1e')](function(_0x290b6d){if(_0x290b6d){_0x5bcba5=_0x290b6d;_0x140764[_0x499a('0x41')]=_[_0x499a('0x42')](db[_0x499a('0x79')][_0x499a('0x76')]);_0x140764[_0x499a('0x43')]=_['keys'](_0x3e3472[_0x499a('0x43')]);_0x140764[_0x499a('0x44')]=_['intersection'](_0x140764[_0x499a('0x41')],_0x140764['query']);_0x2a08d2[_0x499a('0x46')]=_[_0x499a('0x45')](_0x140764[_0x499a('0x41')],qs[_0x499a('0x47')](_0x3e3472[_0x499a('0x43')][_0x499a('0x47')]));_0x2a08d2[_0x499a('0x46')]=_0x2a08d2[_0x499a('0x46')][_0x499a('0x48')]?_0x2a08d2[_0x499a('0x46')]:_0x140764[_0x499a('0x41')];_0x2a08d2[_0x499a('0x4b')]=qs[_0x499a('0x4c')](_0x3e3472[_0x499a('0x43')]['sort']);_0x2a08d2[_0x499a('0x4e')]=qs[_0x499a('0x44')](_['pick'](_0x3e3472[_0x499a('0x43')],_0x140764['filters']));if(_0x3e3472[_0x499a('0x43')][_0x499a('0x4d')]){_0x2a08d2[_0x499a('0x4e')]=_['merge'](_0x2a08d2['where'],{'$or':_[_0x499a('0x3e')](_0x2a08d2['attributes'],function(_0x4a132f){var _0x5af906={};_0x5af906[_0x4a132f]={'$like':'%'+_0x3e3472[_0x499a('0x43')][_0x499a('0x4d')]+'%'};return _0x5af906;})});}_0x2a08d2=_[_0x499a('0x4f')]({},_0x2a08d2,_0x3e3472[_0x499a('0x52')]);return _0x5bcba5[_0x499a('0x7d')](_0x2a08d2);}})[_0x499a('0x1e')](function(_0x7decb){if(_0x7decb){_0x3139d0=_0x7decb[_0x499a('0x48')];if(!_0x3e3472[_0x499a('0x43')]['hasOwnProperty'](_0x499a('0x4a'))){_0x2a08d2[_0x499a('0x2f')]=qs[_0x499a('0x2f')](_0x3e3472[_0x499a('0x43')][_0x499a('0x2f')]);_0x2a08d2[_0x499a('0x2e')]=qs[_0x499a('0x2e')](_0x3e3472[_0x499a('0x43')][_0x499a('0x2e')]);}return _0x5bcba5[_0x499a('0x7d')](_0x2a08d2);}})[_0x499a('0x1e')](function(_0x2c3880){if(_0x2c3880){return _0x2c3880?{'count':_0x3139d0,'rows':_0x2c3880}:null;}})[_0x499a('0x1e')](respondWithResult(_0x5a03f9,null))[_0x499a('0x29')](handleError(_0x5a03f9,null));};exports['notify']=function(_0x4c18da,_0x2d6830,_0x58420c){var _0x4f5955={'channel':_0x499a('0x7e')};var _0x4edf0a=[];var _0x3aabd5=[];var _0x2e5880={};return db['WhatsappAccount'][_0x499a('0x58')]({'where':{'id':_0x4c18da['params']['id']},'include':[{'model':db[_0x499a('0x79')],'as':'Applications'}]})[_0x499a('0x1e')](handleEntityNotFound(_0x2d6830,null))[_0x499a('0x1e')](function(_0x19b245){_0x4f5955[_0x499a('0x7f')]=_0x19b245;if(_0x4f5955[_0x499a('0x7f')]&&_0x4f5955['account'][_0x499a('0x50')]==='sinch'&&_0x4c18da[_0x499a('0x5a')][_0x499a('0x80')]){if(_0x4c18da[_0x499a('0x5a')][_0x499a('0x80')][_0x499a('0x48')]===0x0)return;if(_0x4c18da[_0x499a('0x5a')][_0x499a('0x80')][0x0]['state']!==_0x499a('0x81'))return;return db[_0x499a('0x82')][_0x499a('0x36')]({'read':!![],'readAt':_0x4c18da[_0x499a('0x5a')][_0x499a('0x80')][0x0]['timestamp']},{'where':{'messageId':_0x4c18da[_0x499a('0x5a')][_0x499a('0x80')][0x0][_0x499a('0x83')]},'individualHooks':!![]})[_0x499a('0x1e')](function(_0x42554c){return _0x2d6830[_0x499a('0x2b')](0xc8)[_0x499a('0x2d')](_0x42554c);});}_0x4f5955[_0x499a('0x84')]=_[_0x499a('0x85')](_0x19b245[_0x499a('0x86')],[_0x499a('0x7c')],[_0x499a('0x87')]);if(_0x4f5955[_0x499a('0x7f')][_0x499a('0x86')]){delete _0x4f5955[_0x499a('0x7f')][_0x499a('0x86')];}return db[_0x499a('0x88')][_0x499a('0x62')]()[_0x499a('0x1e')](function(_0x50aa0c){if(!_0x50aa0c){throw new db[(_0x499a('0x89'))][(_0x499a('0x8a'))](_0x499a('0x8b'));}_0x4edf0a=_['difference'](_[_0x499a('0x42')](_0x50aa0c),['createdAt',_0x499a('0x8c')]);_0x3aabd5=_['difference'](_[_0x499a('0x42')](_0x50aa0c),[_0x499a('0x8d'),'updatedAt','CompanyId',_0x499a('0x8e')]);_0x4f5955[_0x499a('0x5a')]={'mapKey':'mobile'};if(_0x4f5955['account']&&_0x4f5955['account'][_0x499a('0x50')]==='twilio'){_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')]=_0x4c18da[_0x499a('0x5a')][_0x499a('0x90')]['replace']('whatsapp:','');_0x4f5955[_0x499a('0x5a')][_0x499a('0x5a')]=_0x4c18da[_0x499a('0x5a')][_0x499a('0x91')];_0x4f5955[_0x499a('0x5a')][_0x499a('0x92')]=_0x4c18da[_0x499a('0x5a')][_0x499a('0x93')];}if(_0x4f5955['account']&&_0x4f5955[_0x499a('0x7f')][_0x499a('0x50')]===_0x499a('0x94')){_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')]=_0x4c18da[_0x499a('0x5a')]['notifications'][0x0]['from'];_0x4f5955[_0x499a('0x5a')][_0x499a('0x5a')]=_0x4c18da['body']['notifications'][0x0][_0x499a('0x27')][_0x499a('0x5a')];_0x4f5955[_0x499a('0x5a')]['messageId']=_0x4c18da[_0x499a('0x5a')]['notifications'][0x0]['message_id'];}if(_0x4f5955[_0x499a('0x5a')]['id']){delete _0x4f5955['body']['id'];}if(_['isNil'](_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')])){throw new db[(_0x499a('0x89'))][(_0x499a('0x8a'))](_0x499a('0x95'));}if(_[_0x499a('0x96')](_0x4f5955['body'][_0x499a('0x5a')])||_0x4f5955['body'][_0x499a('0x5a')]===''){throw new db[(_0x499a('0x89'))][(_0x499a('0x8a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x499a('0x96')](_0x4f5955['body'][_0x499a('0x97')])){throw new db[(_0x499a('0x89'))][(_0x499a('0x8a'))](_0x499a('0x98')+_0x3aabd5);}if(!_['includes'](_0x3aabd5,_0x4f5955[_0x499a('0x5a')][_0x499a('0x97')])){throw new db[(_0x499a('0x89'))][(_0x499a('0x8a'))](_0x499a('0x99')+_0x3aabd5);}_0x2e5880[_0x4f5955[_0x499a('0x5a')][_0x499a('0x97')]]=_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')];return db[_0x499a('0x9a')][_0x499a('0x58')]({'where':{'id':_0x4f5955[_0x499a('0x7f')][_0x499a('0x8e')]},'include':[{'model':db[_0x499a('0x88')],'as':'Contacts','where':_0x2e5880,'limit':0x1,'order':[['updatedAt',_0x499a('0x9b')]]}]});})[_0x499a('0x1e')](handleEntityNotFound(_0x2d6830,null))[_0x499a('0x1e')](function(_0x3b5ec3){if(_0x3b5ec3){_0x4f5955['list']=_[_0x499a('0x70')](_0x3b5ec3,[_0x499a('0x9c')]);if(_0x3b5ec3[_0x499a('0x9c')]['length']){return _0x3b5ec3[_0x499a('0x9c')][0x0];}var _0x4cf816=_[_0x499a('0x9d')](_0x4f5955[_0x499a('0x5a')],{'firstName':_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')],'ListId':_0x3b5ec3['id']});_0x4cf816[_0x4f5955[_0x499a('0x5a')][_0x499a('0x97')]]=_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')];return db['CmContact'][_0x499a('0x59')](_0x4cf816,{'fields':_0x4edf0a,'raw':!![]});}})[_0x499a('0x1e')](handleEntityNotFound(_0x2d6830,null))['then'](function(_0x279e41){if(_0x279e41){_0x4f5955[_0x499a('0x9e')]=_0x279e41;var _0x1e296d={'ContactId':_0x279e41['id'],'phone':_0x4f5955[_0x499a('0x5a')]['from'],'WhatsappAccountId':_0x4c18da['params']['id']};var _0x30e02d={'ContactId':_0x279e41['id'],'WhatsappAccountId':_0x4c18da[_0x499a('0x64')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x499a('0x58')]({'where':_0x30e02d})[_0x499a('0x1e')](function(_0x1e06b7){if(_0x1e06b7){return[_0x1e06b7,![]];}return db[_0x499a('0x9f')][_0x499a('0x59')](_0x1e296d)[_0x499a('0x1e')](function(_0xc3da78){return[_0xc3da78,!![]];});});}})[_0x499a('0x71')](function(_0x3cd0d3,_0x411bff){_0x4f5955[_0x499a('0xa0')]=_0x3cd0d3[_0x499a('0x38')]({'plain':!![]});_0x4f5955[_0x499a('0xa0')][_0x499a('0xa1')]=![];if(_0x411bff){if(_0x4f5955[_0x499a('0x7f')]['autoclose']){_0x4f5955[_0x499a('0x84')][_0x499a('0xa2')]({'id':0x0,'priority':_0x4f5955[_0x499a('0x84')][_0x499a('0x48')]+0x1,'app':_0x499a('0xa3'),'appdata':_0x499a('0xa4'),'interval':_0x499a('0xa5')});}_0x4f5955['interaction']['created']=!![];}return db[_0x499a('0x82')][_0x499a('0x59')]({'phone':_0x4f5955[_0x499a('0x5a')][_0x499a('0x8f')],'messageId':_0x4f5955[_0x499a('0x5a')]['messageId'],'body':_0x4f5955[_0x499a('0x5a')][_0x499a('0x5a')],'WhatsappAccountId':_0x4c18da['params']['id'],'WhatsappInteractionId':_0x3cd0d3['id'],'direction':'in','ContactId':_0x3cd0d3[_0x499a('0xa6')],'AttachmentId':_0x4f5955[_0x499a('0x5a')]['AttachmentId']});})[_0x499a('0x1e')](function(_0xd22e04){_0x4f5955[_0x499a('0x27')]=_0xd22e04;if(_0x4f5955['interaction'][_0x499a('0xa7')]){return db[_0x499a('0x75')][_0x499a('0x58')]({'attributes':['id',_0x499a('0x3a')],'where':{'id':_0x4f5955[_0x499a('0xa0')][_0x499a('0xa7')]}})[_0x499a('0x1e')](function(_0x5428f9){if(_0x5428f9){_0x4f5955[_0x499a('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5428f9[_0x499a('0x3a')]+','+(_0x4f5955[_0x499a('0x7f')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x499a('0xa8'),'startRouting',_0x4f5955);});}return respondWithRpcPromise(_0x499a('0xa8'),_0x499a('0xa9'),_0x4f5955);})[_0x499a('0x1e')](function(_0xbda22f){if(_0xbda22f){var _0x2a5808=0xc8;var _0x5e055d='receiveMessage';logger[_0x499a('0x1f')](_0x499a('0x23'),_0x5e055d,_0x2a5808,_0x499a('0xaa'));logger[_0x499a('0x22')](_0x499a('0xab'),_0x5e055d,_0x2a5808,_0x499a('0xaa'),JSON['stringify'](_0xbda22f));if(_0x4f5955['account']['type']==='twilio'){return _0x2d6830[_0x499a('0x2b')](_0x2a5808)[_0x499a('0x32')]('Content-Type',_0x499a('0xac'))[_0x499a('0xad')](_0x499a('0xae'));}else{return _0x2d6830['status'](_0x2a5808)[_0x499a('0x2d')](_0xbda22f);}}});})[_0x499a('0x29')](handleError(_0x2d6830,null));};exports[_0x499a('0xad')]=function(_0x176fa1,_0x3f1e3b,_0x45a76c){var _0x27fc90,_0x4814f2,_0x31e628;if(_['isNil'](_0x176fa1['body'][_0x499a('0x5a')])||_0x176fa1[_0x499a('0x5a')][_0x499a('0x5a')]===''){throw new db['Sequelize'][(_0x499a('0x8a'))](_0x499a('0xaf'));}if(_[_0x499a('0x96')](_0x176fa1[_0x499a('0x5a')]['to'])){throw new db[(_0x499a('0x89'))][(_0x499a('0x8a'))](_0x499a('0xb0'));}_0x27fc90=_0x176fa1[_0x499a('0x5a')]['to'];return db[_0x499a('0x3f')][_0x499a('0x58')]({'where':{'id':_0x176fa1[_0x499a('0x64')]['id']},'include':[{'model':db[_0x499a('0x9a')],'as':_0x499a('0xb1'),'include':[{'model':db[_0x499a('0x88')],'as':'Contacts','where':{'mobile':_0x27fc90},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x3f1e3b,null))['then'](function(_0x204cb0){if(_0x204cb0&&_0x204cb0[_0x499a('0xb1')]){_0x4814f2=_0x204cb0['get']({'plain':!![]});if(_0x4814f2[_0x499a('0xb1')]&&_0x4814f2['List']['Contacts']['length']){return _0x4814f2[_0x499a('0xb1')][_0x499a('0x9c')][0x0];}return db['CmContact'][_0x499a('0x59')](_['defaults'](_0x176fa1['body'],{'firstName':_0x27fc90,'mobile':_0x27fc90,'phone':_0x27fc90,'ListId':_0x4814f2['ListId']}));}})['then'](handleEntityNotFound(_0x3f1e3b,null))[_0x499a('0x1e')](function(_0x329b1f){if(_0x329b1f){_0x31e628=_0x329b1f;return db[_0x499a('0x9f')][_0x499a('0x58')]({'where':{'ContactId':_0x31e628['id'],'closed':![],'WhatsappAccountId':_0x4814f2['id']}})[_0x499a('0x1e')](function(_0x34be6d){if(_0x34be6d){return[_0x34be6d,![]];}return db[_0x499a('0x9f')]['create']({'UserId':_0x176fa1['user']['id'],'ContactId':_0x31e628['id'],'WhatsappAccountId':_0x4814f2['id'],'phone':_0x27fc90,'firstMsgDirection':_0x499a('0xb2'),'Messages':[_['merge'](_0x176fa1[_0x499a('0x5a')],{'read':![],'body':_0x176fa1[_0x499a('0x5a')][_0x499a('0x5a')],'phone':_0x27fc90,'WhatsappAccountId':_0x4814f2['id'],'UserId':_0x176fa1[_0x499a('0x5b')]['id'],'ContactId':_0x31e628['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x499a('0xb3')}]})[_0x499a('0x1e')](function(_0x51a1f7){return[_0x51a1f7,!![]];});});}})[_0x499a('0x71')](function(_0x14a13d,_0x2b4267){if(_0x2b4267){return _0x14a13d;}return db[_0x499a('0x82')][_0x499a('0x59')](_['merge'](_0x176fa1['body'],{'read':![],'body':_0x176fa1[_0x499a('0x5a')][_0x499a('0x5a')],'phone':_0x27fc90,'WhatsappAccountId':_0x4814f2['id'],'WhatsappInteractionId':_0x14a13d['id'],'UserId':_0x176fa1['user']['id'],'ContactId':_0x31e628['id']}))[_0x499a('0x1e')](function(_0x5d4068){_0x14a13d[_0x499a('0xb4')][_0x499a('0xb3')]=[];_0x14a13d[_0x499a('0xb4')][_0x499a('0xb3')][_0x499a('0xa2')](_0x5d4068[_0x499a('0xb4')]);return _0x14a13d;});})[_0x499a('0x1e')](respondWithResult(_0x3f1e3b,null))[_0x499a('0x29')](handleError(_0x3f1e3b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 0d00c2e..ea44869 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 _0x602c=['hook','exports','events','../../mysqldb','setMaxListeners','update','hasOwnProperty'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x602c,0xdb));var _0xc602=function(_0x22b4e7,_0x4ae9e9){_0x22b4e7=_0x22b4e7-0x0;var _0x583ac9=_0x602c[_0x22b4e7];return _0x583ac9;};'use strict';var EventEmitter=require(_0xc602('0x0'));var WhatsappAccount=require(_0xc602('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc602('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc602('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5ec32d){return function(_0x2e43f4,_0x22fed8,_0x160a58){WhatsappAccountEvents['emit'](_0x5ec32d+':'+_0x2e43f4['id'],_0x2e43f4);WhatsappAccountEvents['emit'](_0x5ec32d,_0x2e43f4);_0x160a58(null);};}for(var e in events){if(events[_0xc602('0x4')](e)){var event=events[e];WhatsappAccount[_0xc602('0x5')](e,emitEvent(event));}}module[_0xc602('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x9b2e=['WhatsappAccount','setMaxListeners','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0xf1e6f1,_0x26be17){var _0x528705=function(_0x1fd183){while(--_0x1fd183){_0xf1e6f1['push'](_0xf1e6f1['shift']());}};_0x528705(++_0x26be17);}(_0x9b2e,0x110));var _0xe9b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b2e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xe9b2('0x0'))['db'][_0xe9b2('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe9b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe9b2('0x3')};function emitEvent(_0x1937cf){return function(_0x1c0610,_0x239b3a,_0x30f8e6){WhatsappAccountEvents[_0xe9b2('0x4')](_0x1937cf+':'+_0x1c0610['id'],_0x1c0610);WhatsappAccountEvents['emit'](_0x1937cf,_0x1c0610);_0x30f8e6(null);};}for(var e in events){if(events[_0xe9b2('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xe9b2('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 67c0199..c5adbb5 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 _0x6893=['./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x6893,0x154));var _0x3689=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x6893[_0x4688f3];return _0x470c84;};'use strict';var _=require(_0x3689('0x0'));var util=require(_0x3689('0x1'));var logger=require(_0x3689('0x2'))(_0x3689('0x3'));var moment=require(_0x3689('0x4'));var BPromise=require(_0x3689('0x5'));var rp=require(_0x3689('0x6'));var fs=require('fs');var path=require(_0x3689('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3689('0x8'));module['exports']=function(_0x1967d0,_0x33df3d){return _0x1967d0[_0x3689('0x9')](_0x3689('0xa'),attributes,{'tableName':_0x3689('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0e3=['rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4b3bcb,_0x3d357c){var _0x16a184=function(_0x263537){while(--_0x263537){_0x4b3bcb['push'](_0x4b3bcb['shift']());}};_0x16a184(++_0x3d357c);}(_0xb0e3,0x1f1));var _0x3b0e=function(_0x442b59,_0x34f2e6){_0x442b59=_0x442b59-0x0;var _0xd88eec=_0xb0e3[_0x442b59];return _0xd88eec;};'use strict';var _=require(_0x3b0e('0x0'));var util=require(_0x3b0e('0x1'));var logger=require('../../config/logger')(_0x3b0e('0x2'));var moment=require(_0x3b0e('0x3'));var BPromise=require(_0x3b0e('0x4'));var rp=require(_0x3b0e('0x5'));var fs=require('fs');var path=require(_0x3b0e('0x6'));var rimraf=require(_0x3b0e('0x7'));var config=require(_0x3b0e('0x8'));var attributes=require(_0x3b0e('0x9'));module['exports']=function(_0x4f4628,_0x50ae28){return _0x4f4628[_0x3b0e('0xa')](_0x3b0e('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index cb53987..31fb8ad 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 _0xbe58=['raw','where','attributes','include','map','model','then','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options'];(function(_0x171e50,_0x3ab98e){var _0x51ba9b=function(_0x38b147){while(--_0x38b147){_0x171e50['push'](_0x171e50['shift']());}};_0x51ba9b(++_0x3ab98e);}(_0xbe58,0x19f));var _0x8be5=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xbe58[_0x411017];return _0x2adeea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8be5('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8be5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8be5('0x2'));var logger=require(_0x8be5('0x3'))(_0x8be5('0x4'));var config=require(_0x8be5('0x5'));var jayson=require(_0x8be5('0x6'));var client=jayson[_0x8be5('0x7')]['http']({'port':0x232a});config['redis']=_[_0x8be5('0x8')](config[_0x8be5('0x9')],{'host':_0x8be5('0xa'),'port':0x18eb});var socket=require(_0x8be5('0xb'))(new Redis(config[_0x8be5('0x9')]));require('./whatsappAccount.socket')[_0x8be5('0xc')](socket);function respondWithRpcPromise(_0x38195c,_0x15c6e8,_0x124ea9){return new BPromise(function(_0x4e74bb,_0x554308){return client[_0x8be5('0xd')](_0x38195c,_0x124ea9)['then'](function(_0x44cc12){logger[_0x8be5('0xe')](_0x8be5('0xf'),_0x15c6e8,_0x8be5('0x10'));logger[_0x8be5('0x11')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x15c6e8,_0x8be5('0x10'),JSON[_0x8be5('0x12')](_0x44cc12));if(_0x44cc12['error']){if(_0x44cc12[_0x8be5('0x13')][_0x8be5('0x14')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x15c6e8,_0x44cc12['error'][_0x8be5('0x15')]);return _0x554308(_0x44cc12[_0x8be5('0x13')][_0x8be5('0x15')]);}logger[_0x8be5('0x13')](_0x8be5('0xf'),_0x15c6e8,_0x44cc12[_0x8be5('0x13')][_0x8be5('0x15')]);return _0x4e74bb(_0x44cc12[_0x8be5('0x13')]['message']);}else{logger[_0x8be5('0xe')](_0x8be5('0xf'),_0x15c6e8,'request\x20sent');_0x4e74bb(_0x44cc12['result'][_0x8be5('0x15')]);}})[_0x8be5('0x16')](function(_0x312acc){logger[_0x8be5('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x15c6e8,_0x312acc);_0x554308(_0x312acc);});});}exports[_0x8be5('0x17')]=function(_0x2af2a8){var _0x577efe=this;return new Promise(function(_0x3471d0,_0x2af8ed){return db[_0x8be5('0x18')][_0x8be5('0x19')]({'raw':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1c')]||null:null,'attributes':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1d')]||null:null,'include':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1e')]?_[_0x8be5('0x1f')](_0x2af2a8[_0x8be5('0x1a')]['include'],function(_0x31070a){return{'model':db[_0x31070a[_0x8be5('0x20')]],'as':_0x31070a['as'],'attributes':_0x31070a[_0x8be5('0x1d')],'include':_0x31070a[_0x8be5('0x1e')]?_[_0x8be5('0x1f')](_0x31070a[_0x8be5('0x1e')],function(_0xafe46c){return{'model':db[_0xafe46c[_0x8be5('0x20')]],'as':_0xafe46c['as'],'attributes':_0xafe46c['attributes'],'include':_0xafe46c[_0x8be5('0x1e')]?_['map'](_0xafe46c['include'],function(_0x592bd5){return{'model':db[_0x592bd5[_0x8be5('0x20')]],'as':_0x592bd5['as'],'attributes':_0x592bd5[_0x8be5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8be5('0x21')](function(_0x3ea4ec){logger[_0x8be5('0xe')](_0x8be5('0x17'),_0x2af2a8);logger[_0x8be5('0x11')](_0x8be5('0x17'),_0x2af2a8,JSON[_0x8be5('0x12')](_0x3ea4ec));_0x3471d0(_0x3ea4ec);})[_0x8be5('0x16')](function(_0x5a0902){logger[_0x8be5('0x13')](_0x8be5('0x17'),_0x5a0902[_0x8be5('0x15')],_0x2af2a8);_0x2af8ed(_0x577efe[_0x8be5('0x13')](0x1f4,_0x5a0902[_0x8be5('0x15')]));});});}; \ No newline at end of file +var _0xa1dd=['request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','options','raw','include','map','attributes','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','WhatsappAccount,\x20%s,\x20%s'];(function(_0x4bdcb8,_0x3d473f){var _0x5842a9=function(_0x368c40){while(--_0x368c40){_0x4bdcb8['push'](_0x4bdcb8['shift']());}};_0x5842a9(++_0x3d473f);}(_0xa1dd,0x165));var _0xda1d=function(_0xcdc2e1,_0x2e2e21){_0xcdc2e1=_0xcdc2e1-0x0;var _0x580576=_0xa1dd[_0xcdc2e1];return _0x580576;};'use strict';var _=require('lodash');var util=require(_0xda1d('0x0'));var moment=require(_0xda1d('0x1'));var BPromise=require(_0xda1d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda1d('0x3'));var db=require(_0xda1d('0x4'))['db'];var utils=require(_0xda1d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xda1d('0x6'));var jayson=require(_0xda1d('0x7'));var client=jayson[_0xda1d('0x8')][_0xda1d('0x9')]({'port':0x232a});config[_0xda1d('0xa')]=_[_0xda1d('0xb')](config['redis'],{'host':_0xda1d('0xc'),'port':0x18eb});var socket=require(_0xda1d('0xd'))(new Redis(config[_0xda1d('0xa')]));require('./whatsappAccount.socket')[_0xda1d('0xe')](socket);function respondWithRpcPromise(_0x558008,_0x26d653,_0x325efc){return new BPromise(function(_0x111ce7,_0x59a312){return client[_0xda1d('0xf')](_0x558008,_0x325efc)['then'](function(_0x3ffb23){logger['info'](_0xda1d('0x10'),_0x26d653,_0xda1d('0x11'));logger[_0xda1d('0x12')](_0xda1d('0x13'),_0x26d653,_0xda1d('0x11'),JSON[_0xda1d('0x14')](_0x3ffb23));if(_0x3ffb23[_0xda1d('0x15')]){if(_0x3ffb23[_0xda1d('0x15')][_0xda1d('0x16')]===0x1f4){logger['error'](_0xda1d('0x10'),_0x26d653,_0x3ffb23[_0xda1d('0x15')]['message']);return _0x59a312(_0x3ffb23[_0xda1d('0x15')][_0xda1d('0x17')]);}logger[_0xda1d('0x15')](_0xda1d('0x10'),_0x26d653,_0x3ffb23['error'][_0xda1d('0x17')]);return _0x111ce7(_0x3ffb23['error']['message']);}else{logger[_0xda1d('0x18')](_0xda1d('0x10'),_0x26d653,'request\x20sent');_0x111ce7(_0x3ffb23[_0xda1d('0x19')][_0xda1d('0x17')]);}})[_0xda1d('0x1a')](function(_0x58314b){logger[_0xda1d('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x26d653,_0x58314b);_0x59a312(_0x58314b);});});}exports[_0xda1d('0x1b')]=function(_0x159759){var _0x2298cb=this;return new Promise(function(_0x40b91b,_0x1458c8){return db['WhatsappAccount']['find']({'raw':_0x159759[_0xda1d('0x1c')]?_0x159759[_0xda1d('0x1c')][_0xda1d('0x1d')]===undefined?!![]:![]:!![],'where':_0x159759[_0xda1d('0x1c')]?_0x159759[_0xda1d('0x1c')]['where']||null:null,'attributes':_0x159759['options']?_0x159759['options']['attributes']||null:null,'include':_0x159759[_0xda1d('0x1c')]?_0x159759[_0xda1d('0x1c')][_0xda1d('0x1e')]?_[_0xda1d('0x1f')](_0x159759[_0xda1d('0x1c')]['include'],function(_0xd0f91){return{'model':db[_0xd0f91['model']],'as':_0xd0f91['as'],'attributes':_0xd0f91[_0xda1d('0x20')],'include':_0xd0f91['include']?_[_0xda1d('0x1f')](_0xd0f91['include'],function(_0x1b1f26){return{'model':db[_0x1b1f26[_0xda1d('0x21')]],'as':_0x1b1f26['as'],'attributes':_0x1b1f26[_0xda1d('0x20')],'include':_0x1b1f26[_0xda1d('0x1e')]?_[_0xda1d('0x1f')](_0x1b1f26[_0xda1d('0x1e')],function(_0x2ba664){return{'model':db[_0x2ba664['model']],'as':_0x2ba664['as'],'attributes':_0x2ba664[_0xda1d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x104df8){logger['info'](_0xda1d('0x1b'),_0x159759);logger[_0xda1d('0x12')](_0xda1d('0x1b'),_0x159759,JSON['stringify'](_0x104df8));_0x40b91b(_0x104df8);})[_0xda1d('0x1a')](function(_0x1a0f0b){logger['error']('ShowWhatsappAccount',_0x1a0f0b['message'],_0x159759);_0x1458c8(_0x2298cb[_0xda1d('0x15')](0x1f4,_0x1a0f0b[_0xda1d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 06bfb57..bc7872c 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 _0x87fa=['update','emit','removeListener','register','whatsappAccount:','save','remove'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x87fa,0xec));var _0xa87f=function(_0x5636ec,_0x251d7b){_0x5636ec=_0x5636ec-0x0;var _0xb3ef01=_0x87fa[_0x5636ec];return _0xb3ef01;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xa87f('0x0'),_0xa87f('0x1'),_0xa87f('0x2')];function createListener(_0x2753f3,_0x216421){return function(_0x4da74f){_0x216421[_0xa87f('0x3')](_0x2753f3,_0x4da74f);};}function removeListener(_0x5f3af6,_0x49081d){return function(){WhatsappAccountEvents[_0xa87f('0x4')](_0x5f3af6,_0x49081d);};}exports[_0xa87f('0x5')]=function(_0x22763a){for(var _0x4ab645=0x0,_0x374fa0=events['length'];_0x4ab645<_0x374fa0;_0x4ab645++){var _0x1a8ec3=events[_0x4ab645];var _0x203997=createListener(_0xa87f('0x6')+_0x1a8ec3,_0x22763a);WhatsappAccountEvents['on'](_0x1a8ec3,_0x203997);}}; \ No newline at end of file +var _0x7835=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','register'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x7835,0x1a5));var _0x5783=function(_0x3bb591,_0x3dea81){_0x3bb591=_0x3bb591-0x0;var _0x251482=_0x7835[_0x3bb591];return _0x251482;};'use strict';var WhatsappAccountEvents=require(_0x5783('0x0'));var events=[_0x5783('0x1'),_0x5783('0x2'),_0x5783('0x3')];function createListener(_0x5eefc3,_0x586031){return function(_0x4fdf43){_0x586031[_0x5783('0x4')](_0x5eefc3,_0x4fdf43);};}function removeListener(_0x12ffcd,_0xeb48d4){return function(){WhatsappAccountEvents['removeListener'](_0x12ffcd,_0xeb48d4);};}exports[_0x5783('0x5')]=function(_0x4a2558){for(var _0x2ec537=0x0,_0x581722=events['length'];_0x2ec537<_0x581722;_0x2ec537++){var _0x10f76c=events[_0x2ec537];var _0x6eeede=createListener(_0x5783('0x6')+_0x10f76c,_0x4a2558);WhatsappAccountEvents['on'](_0x10f76c,_0x6eeede);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 5a9ca34..a425ef6 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 _0x6964=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer'];(function(_0x268173,_0x1cc18f){var _0x4b60d9=function(_0x225c10){while(--_0x225c10){_0x268173['push'](_0x268173['shift']());}};_0x4b60d9(++_0x1cc18f);}(_0x6964,0xe9));var _0x4696=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x6964[_0x4521e3];return _0x46a272;};'use strict';var multer=require(_0x4696('0x0'));var util=require(_0x4696('0x1'));var path=require(_0x4696('0x2'));var timeout=require(_0x4696('0x3'));var express=require(_0x4696('0x4'));var router=express[_0x4696('0x5')]();var fs_extra=require(_0x4696('0x6'));var auth=require(_0x4696('0x7'));var interaction=require(_0x4696('0x8'));var config=require(_0x4696('0x9'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x4696('0xa')](),controller[_0x4696('0xb')]);router['get'](_0x4696('0xc'),auth[_0x4696('0xa')](),controller[_0x4696('0xd')]);router[_0x4696('0xe')]('/',auth[_0x4696('0xa')](),controller[_0x4696('0xf')]);router['put'](_0x4696('0xc'),auth[_0x4696('0xa')](),controller['update']);router[_0x4696('0x10')](_0x4696('0xc'),auth[_0x4696('0xa')](),controller[_0x4696('0x11')]);module['exports']=router; \ No newline at end of file +var _0x87f5=['index','/:id','post','create','put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x1a86dc,_0x5387bc){var _0x3406f1=function(_0x5b75be){while(--_0x5b75be){_0x1a86dc['push'](_0x1a86dc['shift']());}};_0x3406f1(++_0x5387bc);}(_0x87f5,0x15e));var _0x587f=function(_0x33055e,_0x54dff9){_0x33055e=_0x33055e-0x0;var _0x41dfb4=_0x87f5[_0x33055e];return _0x41dfb4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x587f('0x0'));var timeout=require(_0x587f('0x1'));var express=require(_0x587f('0x2'));var router=express['Router']();var fs_extra=require(_0x587f('0x3'));var auth=require(_0x587f('0x4'));var interaction=require(_0x587f('0x5'));var config=require(_0x587f('0x6'));var controller=require(_0x587f('0x7'));router[_0x587f('0x8')]('/',auth[_0x587f('0x9')](),controller[_0x587f('0xa')]);router[_0x587f('0x8')](_0x587f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x587f('0xc')]('/',auth['isAuthenticated'](),controller[_0x587f('0xd')]);router[_0x587f('0xe')](_0x587f('0xb'),auth[_0x587f('0x9')](),controller[_0x587f('0xf')]);router[_0x587f('0x10')](_0x587f('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x587f('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 7f64160..1120689 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 _0xae59=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x1ceab4,_0xb6be0b){var _0x3add59=function(_0x45e89b){while(--_0x45e89b){_0x1ceab4['push'](_0x1ceab4['shift']());}};_0x3add59(++_0xb6be0b);}(_0xae59,0x170));var _0x9ae5=function(_0x2ba29f,_0x13981a){_0x2ba29f=_0x2ba29f-0x0;var _0x120bd1=_0xae59[_0x2ba29f];return _0x120bd1;};'use strict';var Sequelize=require(_0x9ae5('0x0'));module[_0x9ae5('0x1')]={'priority':{'type':Sequelize[_0x9ae5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9ae5('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9ae5('0x4')]},'interval':{'type':Sequelize[_0x9ae5('0x4')],'defaultValue':_0x9ae5('0x5')}}; \ No newline at end of file +var _0xec27=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x459399,_0x488ed8){var _0x3cb0a9=function(_0x3a76d9){while(--_0x3a76d9){_0x459399['push'](_0x459399['shift']());}};_0x3cb0a9(++_0x488ed8);}(_0xec27,0x1af));var _0x7ec2=function(_0x1e1f74,_0x190226){_0x1e1f74=_0x1e1f74-0x0;var _0x54139e=_0xec27[_0x1e1f74];return _0x54139e;};'use strict';var Sequelize=require(_0x7ec2('0x0'));module[_0x7ec2('0x1')]={'priority':{'type':Sequelize[_0x7ec2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7ec2('0x3')},'appdata':{'type':Sequelize[_0x7ec2('0x4')]()},'description':{'type':Sequelize[_0x7ec2('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index d394f74..da7fd5b 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 _0x1122=['query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','catch','params','keys','fields','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','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','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2112('0x1'));var jsonpatch=require(_0x2112('0x2'));var rp=require(_0x2112('0x3'));var moment=require(_0x2112('0x4'));var BPromise=require(_0x2112('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2112('0x6'));var sox=require('sox');var csv=require(_0x2112('0x7'));var ejs=require(_0x2112('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2112('0x9'));var squel=require(_0x2112('0xa'));var crypto=require(_0x2112('0xb'));var jsforce=require(_0x2112('0xc'));var deskjs=require(_0x2112('0xd'));var toCsv=require(_0x2112('0x7'));var querystring=require(_0x2112('0xe'));var Papa=require(_0x2112('0xf'));var Redis=require(_0x2112('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2112('0x11'));var as=require(_0x2112('0x12'));var hardwareService=require(_0x2112('0x13'));var logger=require(_0x2112('0x14'))('api');var utils=require(_0x2112('0x15'));var config=require(_0x2112('0x16'));var licenseUtil=require(_0x2112('0x17'));var db=require(_0x2112('0x18'))['db'];function respondWithStatusCode(_0x450ef8,_0x15d062){_0x15d062=_0x15d062||0xcc;return function(_0x410405){if(_0x410405){return _0x450ef8['sendStatus'](_0x15d062);}return _0x450ef8[_0x2112('0x19')](_0x15d062)['end']();};}function respondWithResult(_0x33e4c3,_0x1f76c2){_0x1f76c2=_0x1f76c2||0xc8;return function(_0x561c78){if(_0x561c78){return _0x33e4c3[_0x2112('0x19')](_0x1f76c2)['json'](_0x561c78);}};}function respondWithFilteredResult(_0x1d5afe,_0x5e5e55){return function(_0xc961a){if(_0xc961a){var _0xc1f5d1=typeof _0x5e5e55['offset']===_0x2112('0x1a')&&typeof _0x5e5e55['limit']===_0x2112('0x1a');var _0x4a9e46=_0xc961a['count'];var _0x454981=_0xc1f5d1?0x0:_0x5e5e55['offset'];var _0x4dee3c=_0xc1f5d1?_0xc961a[_0x2112('0x1b')]:_0x5e5e55[_0x2112('0x1c')]+_0x5e5e55[_0x2112('0x1d')];var _0x40a89d;if(_0x4dee3c>=_0x4a9e46){_0x4dee3c=_0x4a9e46;_0x40a89d=0xc8;}else{_0x40a89d=0xce;}_0x1d5afe[_0x2112('0x19')](_0x40a89d);return _0x1d5afe[_0x2112('0x1e')](_0x2112('0x1f'),_0x454981+'-'+_0x4dee3c+'/'+_0x4a9e46)['json'](_0xc961a);}return null;};}function patchUpdates(_0x5b7e84){return function(_0x154e10){try{jsonpatch[_0x2112('0x20')](_0x154e10,_0x5b7e84,!![]);}catch(_0x435428){return BPromise['reject'](_0x435428);}return _0x154e10[_0x2112('0x21')]();};}function saveUpdates(_0xd17981,_0x2b5c50){return function(_0x101565){if(_0x101565){return _0x101565[_0x2112('0x22')](_0xd17981)[_0x2112('0x23')](function(_0x2a2d44){return _0x2a2d44;});}return null;};}function removeEntity(_0x35a49a,_0x89db6d){return function(_0x51431d){if(_0x51431d){return _0x51431d[_0x2112('0x24')]()[_0x2112('0x23')](function(){_0x35a49a[_0x2112('0x19')](0xcc)[_0x2112('0x25')]();});}};}function handleEntityNotFound(_0x3002a6,_0x27433f){return function(_0x2f6b86){if(!_0x2f6b86){_0x3002a6[_0x2112('0x26')](0x194);}return _0x2f6b86;};}function handleError(_0x3b2c82,_0x5023ea){_0x5023ea=_0x5023ea||0x1f4;return function(_0x7a072c){logger[_0x2112('0x27')](_0x7a072c[_0x2112('0x28')]);if(_0x7a072c[_0x2112('0x29')]){delete _0x7a072c[_0x2112('0x29')];}_0x3b2c82['status'](_0x5023ea)[_0x2112('0x2a')](_0x7a072c);};}exports[_0x2112('0x2b')]=function(_0x1f0978,_0x49f589){var _0x19d559={},_0x1db82b={},_0x1c53da={'count':0x0,'rows':[]};var _0x55ebed=_['map'](db['WhatsappApplication'][_0x2112('0x2c')],function(_0x5d13d3){return{'name':_0x5d13d3[_0x2112('0x2d')],'type':_0x5d13d3[_0x2112('0x2e')][_0x2112('0x2f')]};});_0x1db82b[_0x2112('0x30')]=_[_0x2112('0x31')](_0x55ebed,_0x2112('0x29'));_0x1db82b['query']=_['keys'](_0x1f0978[_0x2112('0x32')]);_0x1db82b[_0x2112('0x33')]=_[_0x2112('0x34')](_0x1db82b['model'],_0x1db82b[_0x2112('0x32')]);_0x19d559[_0x2112('0x35')]=_[_0x2112('0x34')](_0x1db82b[_0x2112('0x30')],qs['fields'](_0x1f0978['query']['fields']));_0x19d559[_0x2112('0x35')]=_0x19d559['attributes'][_0x2112('0x36')]?_0x19d559[_0x2112('0x35')]:_0x1db82b['model'];if(!_0x1f0978[_0x2112('0x32')]['hasOwnProperty'](_0x2112('0x37'))){_0x19d559['limit']=qs['limit'](_0x1f0978[_0x2112('0x32')][_0x2112('0x1d')]);_0x19d559[_0x2112('0x1c')]=qs['offset'](_0x1f0978[_0x2112('0x32')][_0x2112('0x1c')]);}_0x19d559['order']=qs[_0x2112('0x38')](_0x1f0978[_0x2112('0x32')][_0x2112('0x38')]);_0x19d559[_0x2112('0x39')]=qs[_0x2112('0x33')](_[_0x2112('0x3a')](_0x1f0978['query'],_0x1db82b['filters']),_0x55ebed);if(_0x1f0978['query'][_0x2112('0x3b')]){_0x19d559[_0x2112('0x39')]=_[_0x2112('0x3c')](_0x19d559[_0x2112('0x39')],{'$or':_[_0x2112('0x31')](_0x55ebed,function(_0x12116c){if(_0x12116c[_0x2112('0x2e')]!==_0x2112('0x3d')){var _0x3a0cea={};_0x3a0cea[_0x12116c[_0x2112('0x29')]]={'$like':'%'+_0x1f0978[_0x2112('0x32')]['filter']+'%'};return _0x3a0cea;}})});}_0x19d559=_[_0x2112('0x3c')]({},_0x19d559,_0x1f0978[_0x2112('0x3e')]);var _0x2efe8d={'where':_0x19d559[_0x2112('0x39')]};return db[_0x2112('0x3f')][_0x2112('0x1b')](_0x2efe8d)[_0x2112('0x23')](function(_0x31a757){_0x1c53da[_0x2112('0x1b')]=_0x31a757;if(_0x1f0978['query'][_0x2112('0x40')]){_0x19d559[_0x2112('0x41')]=[{'all':!![]}];}return db[_0x2112('0x3f')][_0x2112('0x42')](_0x19d559);})[_0x2112('0x23')](function(_0x43d6c7){_0x1c53da['rows']=_0x43d6c7;return _0x1c53da;})[_0x2112('0x23')](respondWithFilteredResult(_0x49f589,_0x19d559))[_0x2112('0x43')](handleError(_0x49f589,null));};exports['show']=function(_0x18bfa0,_0x2061fd){var _0x42007a={'raw':!![],'where':{'id':_0x18bfa0[_0x2112('0x44')]['id']}},_0xdd0d1={};_0xdd0d1[_0x2112('0x30')]=_['keys'](db[_0x2112('0x3f')][_0x2112('0x2c')]);_0xdd0d1['query']=_[_0x2112('0x45')](_0x18bfa0[_0x2112('0x32')]);_0xdd0d1[_0x2112('0x33')]=_[_0x2112('0x34')](_0xdd0d1['model'],_0xdd0d1[_0x2112('0x32')]);_0x42007a[_0x2112('0x35')]=_[_0x2112('0x34')](_0xdd0d1[_0x2112('0x30')],qs[_0x2112('0x46')](_0x18bfa0[_0x2112('0x32')][_0x2112('0x46')]));_0x42007a['attributes']=_0x42007a[_0x2112('0x35')]['length']?_0x42007a[_0x2112('0x35')]:_0xdd0d1['model'];if(_0x18bfa0[_0x2112('0x32')][_0x2112('0x40')]){_0x42007a[_0x2112('0x41')]=[{'all':!![]}];}_0x42007a=_[_0x2112('0x3c')]({},_0x42007a,_0x18bfa0[_0x2112('0x3e')]);return db[_0x2112('0x3f')][_0x2112('0x47')](_0x42007a)[_0x2112('0x23')](handleEntityNotFound(_0x2061fd,null))[_0x2112('0x23')](respondWithResult(_0x2061fd,null))[_0x2112('0x43')](handleError(_0x2061fd,null));};exports[_0x2112('0x48')]=function(_0x30c5e4,_0x52428e){return db[_0x2112('0x3f')][_0x2112('0x48')](_0x30c5e4['body'],{})[_0x2112('0x23')](respondWithResult(_0x52428e,0xc9))[_0x2112('0x43')](handleError(_0x52428e,null));};exports['update']=function(_0x15edd9,_0x3ac54c){if(_0x15edd9[_0x2112('0x49')]['id']){delete _0x15edd9[_0x2112('0x49')]['id'];}return db[_0x2112('0x3f')]['find']({'where':{'id':_0x15edd9[_0x2112('0x44')]['id']}})[_0x2112('0x23')](handleEntityNotFound(_0x3ac54c,null))['then'](saveUpdates(_0x15edd9['body'],null))[_0x2112('0x23')](respondWithResult(_0x3ac54c,null))[_0x2112('0x43')](handleError(_0x3ac54c,null));};exports[_0x2112('0x24')]=function(_0x9a815d,_0x30d0b3){return db[_0x2112('0x3f')][_0x2112('0x47')]({'where':{'id':_0x9a815d[_0x2112('0x44')]['id']}})['then'](handleEntityNotFound(_0x30d0b3,null))['then'](removeEntity(_0x30d0b3,null))['catch'](handleError(_0x30d0b3,null));}; \ No newline at end of file +var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters'];(function(_0x54813d,_0x101c1f){var _0x561eea=function(_0x1faa0a){while(--_0x1faa0a){_0x54813d['push'](_0x54813d['shift']());}};_0x561eea(++_0x101c1f);}(_0xf61e,0x191));var _0xef61=function(_0x100ae9,_0x4d6668){_0x100ae9=_0x100ae9-0x0;var _0x1c9e43=_0xf61e[_0x100ae9];return _0x1c9e43;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['WhatsappApplication']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['WhatsappApplication'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6bc75e6..19be7cf 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 _0xde64=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','WhatsappApplication'];(function(_0x25997b,_0xeddec4){var _0x43f8e1=function(_0x3a1005){while(--_0x3a1005){_0x25997b['push'](_0x25997b['shift']());}};_0x43f8e1(++_0xeddec4);}(_0xde64,0x17c));var _0x4de6=function(_0x126c5d,_0x5c4df8){_0x126c5d=_0x126c5d-0x0;var _0xe2c4a8=_0xde64[_0x126c5d];return _0xe2c4a8;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var logger=require(_0x4de6('0x2'))(_0x4de6('0x3'));var moment=require(_0x4de6('0x4'));var BPromise=require(_0x4de6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4de6('0x6'));var rimraf=require(_0x4de6('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0x4de6('0x8')]=function(_0x45867b,_0x4da17f){return _0x45867b['define'](_0x4de6('0x9'),attributes,{'tableName':_0x4de6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4de6('0xb'),'collate':_0x4de6('0xc')});}; \ No newline at end of file +var _0x5089=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash'];(function(_0x5395e2,_0x592aaa){var _0x568454=function(_0x1d73c3){while(--_0x1d73c3){_0x5395e2['push'](_0x5395e2['shift']());}};_0x568454(++_0x592aaa);}(_0x5089,0x1bb));var _0x9508=function(_0x5d6b41,_0x3d1c8f){_0x5d6b41=_0x5d6b41-0x0;var _0x1c2dd6=_0x5089[_0x5d6b41];return _0x1c2dd6;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9508('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 92306d7..2683a69 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 _0xbec5=['info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x38533d,_0x4e9b1b){var _0x4d56db=function(_0x4420e1){while(--_0x4420e1){_0x38533d['push'](_0x38533d['shift']());}};_0x4d56db(++_0x4e9b1b);}(_0xbec5,0xe5));var _0x5bec=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xbec5[_0x2a9f4];return _0x3c39e0;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a427,_0x38456e,_0x406e65){return new BPromise(function(_0x43d96e,_0x302aae){return client[_0x5bec('0xb')](_0x28a427,_0x406e65)[_0x5bec('0xc')](function(_0x4d0d29){logger[_0x5bec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x38456e,_0x5bec('0xe'));logger[_0x5bec('0xf')](_0x5bec('0x10'),_0x38456e,'request\x20sent',JSON[_0x5bec('0x11')](_0x4d0d29));if(_0x4d0d29[_0x5bec('0x12')]){if(_0x4d0d29[_0x5bec('0x12')]['code']===0x1f4){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29['error'][_0x5bec('0x14')]);return _0x302aae(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);return _0x43d96e(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}else{logger[_0x5bec('0xd')](_0x5bec('0x13'),_0x38456e,_0x5bec('0xe'));_0x43d96e(_0x4d0d29[_0x5bec('0x15')]['message']);}})['catch'](function(_0x15af9b){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x15af9b);_0x302aae(_0x15af9b);});});} \ No newline at end of file +var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x2d17,0x17e));var _0x72d1=function(_0x3e999a,_0x3f7368){_0x3e999a=_0x3e999a-0x0;var _0x4c95eb=_0x2d17[_0x3e999a];return _0x4c95eb;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 9cfeddc..c819a75 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 _0xbfe8=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','whatsapp','addTags','put','delete','whatsappinteraction:destroy','destroy','exports','util'];(function(_0x5ce2eb,_0x539e5f){var _0x500348=function(_0x32e567){while(--_0x32e567){_0x5ce2eb['push'](_0x5ce2eb['shift']());}};_0x500348(++_0x539e5f);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x2ab969,_0x28fff4){_0x2ab969=_0x2ab969-0x0;var _0x17a708=_0xbfe8[_0x2ab969];return _0x17a708;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0x6')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0x6')](_0x8bfe('0xc'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0x6')](_0x8bfe('0xe'),auth[_0x8bfe('0x7')](),controller['download']);router[_0x8bfe('0xf')]('/',auth['isAuthenticated'](),controller[_0x8bfe('0x10')]);router[_0x8bfe('0xf')](_0x8bfe('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8bfe('0xf')](_0x8bfe('0x11'),auth[_0x8bfe('0x7')](),interaction[_0x8bfe('0x12')](_0x8bfe('0x13'),'whatsappinteraction:addtags'),controller[_0x8bfe('0x14')]);router[_0x8bfe('0x15')]('/:id',auth[_0x8bfe('0x7')](),interaction[_0x8bfe('0x12')](_0x8bfe('0x13'),'whatsappinteraction:update'),controller['update']);router[_0x8bfe('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x8bfe('0x12')](_0x8bfe('0x13'),_0x8bfe('0x17')),controller[_0x8bfe('0x18')]);router[_0x8bfe('0x16')](_0x8bfe('0x11'),auth[_0x8bfe('0x7')](),controller['removeTags']);module[_0x8bfe('0x19')]=router; \ No newline at end of file +var _0x06f4=['connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','destroy','delete','multer','util'];(function(_0x39499d,_0x271615){var _0x1edf28=function(_0x3d8cf1){while(--_0x3d8cf1){_0x39499d['push'](_0x39499d['shift']());}};_0x1edf28(++_0x271615);}(_0x06f4,0x136));var _0x406f=function(_0x16891d,_0x3d7ed0){_0x16891d=_0x16891d-0x0;var _0x56ad9c=_0x06f4[_0x16891d];return _0x56ad9c;};'use strict';var multer=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var path=require('path');var timeout=require(_0x406f('0x2'));var express=require(_0x406f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x406f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x406f('0x5'));var controller=require(_0x406f('0x6'));router[_0x406f('0x7')]('/',auth[_0x406f('0x8')](),controller['index']);router[_0x406f('0x7')]('/describe',auth[_0x406f('0x8')](),controller[_0x406f('0x9')]);router[_0x406f('0x7')]('/:id',auth[_0x406f('0x8')](),controller['show']);router['get'](_0x406f('0xa'),auth['isAuthenticated'](),controller[_0x406f('0xb')]);router['get'](_0x406f('0xc'),auth['isAuthenticated'](),controller[_0x406f('0xd')]);router[_0x406f('0xe')]('/',auth['isAuthenticated'](),controller[_0x406f('0xf')]);router[_0x406f('0xe')](_0x406f('0xa'),auth[_0x406f('0x8')](),controller[_0x406f('0x10')]);router[_0x406f('0xe')](_0x406f('0x11'),auth[_0x406f('0x8')](),interaction[_0x406f('0x12')](_0x406f('0x13'),_0x406f('0x14')),controller['addTags']);router[_0x406f('0x15')](_0x406f('0x16'),auth[_0x406f('0x8')](),interaction['tracked'](_0x406f('0x13'),_0x406f('0x17')),controller['update']);router['delete'](_0x406f('0x16'),auth[_0x406f('0x8')](),interaction['tracked'](_0x406f('0x13'),'whatsappinteraction:destroy'),controller[_0x406f('0x18')]);router[_0x406f('0x19')](_0x406f('0x11'),auth[_0x406f('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index c29e272..8a2e5ab 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 _0x2263=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0xc721ff,_0x359140){var _0x490ed8=function(_0x294355){while(--_0x294355){_0xc721ff['push'](_0xc721ff['shift']());}};_0x490ed8(++_0x359140);}(_0x2263,0x6e));var _0x3226=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x2263[_0x3817a9];return _0x443f30;};'use strict';var Sequelize=require(_0x3226('0x0'));var moment=require(_0x3226('0x1'));module[_0x3226('0x2')]={'closed':{'type':Sequelize[_0x3226('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3226('0x4')]},'disposition':{'type':Sequelize[_0x3226('0x5')]},'secondDisposition':{'type':Sequelize[_0x3226('0x5')]},'thirdDisposition':{'type':Sequelize[_0x3226('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x3226('0x5')]},'read1stAt':{'type':Sequelize[_0x3226('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3226('0x6')]('in',_0x3226('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3226('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3226('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3226('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xafdd=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x4054ea,_0x149305){var _0x1349b0=function(_0x5cbc63){while(--_0x5cbc63){_0x4054ea['push'](_0x4054ea['shift']());}};_0x1349b0(++_0x149305);}(_0xafdd,0x19a));var _0xdafd=function(_0x57c48b,_0x49e046){_0x57c48b=_0x57c48b-0x0;var _0x2fa56b=_0xafdd[_0x57c48b];return _0x2fa56b;};'use strict';var Sequelize=require(_0xdafd('0x0'));var moment=require(_0xdafd('0x1'));module[_0xdafd('0x2')]={'closed':{'type':Sequelize[_0xdafd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdafd('0x4')]},'disposition':{'type':Sequelize[_0xdafd('0x5')]},'secondDisposition':{'type':Sequelize[_0xdafd('0x5')]},'thirdDisposition':{'type':Sequelize[_0xdafd('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdafd('0x5')]},'read1stAt':{'type':Sequelize[_0xdafd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xdafd('0x6')]('in',_0xdafd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdafd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xdafd('0x6')]('in',_0xdafd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 72b85b1..6ddd193 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 _0xfa2b=['map','fullname','Tags','TagIds','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','keys','some','compact','WhatsappAccountId','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','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','clone','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','create','update','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','CmContact','firstName','Attachment','Messages','direction','secret','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','sendStatus','error','stack','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2a23a4,_0x5a9130){_0x2a23a4=_0x2a23a4-0x0;var _0x233142=_0xfa2b[_0x2a23a4];return _0x233142;};'use strict';var emlformat=require(_0xbfa2('0x0'));var rimraf=require(_0xbfa2('0x1'));var zipdir=require(_0xbfa2('0x2'));var jsonpatch=require(_0xbfa2('0x3'));var rp=require(_0xbfa2('0x4'));var moment=require(_0xbfa2('0x5'));var BPromise=require(_0xbfa2('0x6'));var Mustache=require(_0xbfa2('0x7'));var util=require(_0xbfa2('0x8'));var path=require(_0xbfa2('0x9'));var sox=require(_0xbfa2('0xa'));var csv=require(_0xbfa2('0xb'));var ejs=require(_0xbfa2('0xc'));var fs=require('fs');var fs_extra=require(_0xbfa2('0xd'));var _=require(_0xbfa2('0xe'));var squel=require(_0xbfa2('0xf'));var crypto=require('crypto');var jsforce=require(_0xbfa2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbfa2('0xb'));var querystring=require(_0xbfa2('0x11'));var Papa=require(_0xbfa2('0x12'));var Redis=require(_0xbfa2('0x13'));var authService=require(_0xbfa2('0x14'));var qs=require(_0xbfa2('0x15'));var as=require(_0xbfa2('0x16'));var pdf=require(_0xbfa2('0x17'));var hardwareService=require(_0xbfa2('0x18'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbfa2('0x19'));var licenseUtil=require(_0xbfa2('0x1a'));var db=require(_0xbfa2('0x1b'))['db'];config[_0xbfa2('0x1c')]=_[_0xbfa2('0x1d')](config[_0xbfa2('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xbfa2('0x1e'))(new Redis(config[_0xbfa2('0x1c')]));require(_0xbfa2('0x1f'))[_0xbfa2('0x20')](socket);function respondWithStatusCode(_0x191ec5,_0x4e799a){_0x4e799a=_0x4e799a||0xcc;return function(_0xa988cc){if(_0xa988cc){return _0x191ec5['sendStatus'](_0x4e799a);}return _0x191ec5['status'](_0x4e799a)[_0xbfa2('0x21')]();};}function respondWithResult(_0x55c9fe,_0x560190){_0x560190=_0x560190||0xc8;return function(_0xab2c91){if(_0xab2c91){return _0x55c9fe[_0xbfa2('0x22')](_0x560190)['json'](_0xab2c91);}};}function respondWithFilteredResult(_0xb9b6a3,_0x12627a){return function(_0x28fe6f){if(_0x28fe6f){var _0x4088c5=typeof _0x12627a[_0xbfa2('0x23')]===_0xbfa2('0x24')&&typeof _0x12627a[_0xbfa2('0x25')]==='undefined';var _0xb805f7=_0x28fe6f[_0xbfa2('0x26')];var _0x193200=_0x4088c5?0x0:_0x12627a['offset'];var _0x2ac6c3=_0x4088c5?_0x28fe6f[_0xbfa2('0x26')]:_0x12627a['offset']+_0x12627a[_0xbfa2('0x25')];var _0x5278d8;if(_0x2ac6c3>=_0xb805f7){_0x2ac6c3=_0xb805f7;_0x5278d8=0xc8;}else{_0x5278d8=0xce;}_0xb9b6a3['status'](_0x5278d8);return _0xb9b6a3[_0xbfa2('0x27')](_0xbfa2('0x28'),_0x193200+'-'+_0x2ac6c3+'/'+_0xb805f7)[_0xbfa2('0x29')](_0x28fe6f);}return null;};}function patchUpdates(_0x27ccf1){return function(_0x5aa8f4){try{jsonpatch['apply'](_0x5aa8f4,_0x27ccf1,!![]);}catch(_0x599df2){return BPromise[_0xbfa2('0x2a')](_0x599df2);}return _0x5aa8f4['save']();};}function saveUpdates(_0x1a5249,_0x540d5c){return function(_0xeb88ab){if(_0xeb88ab){return _0xeb88ab['update'](_0x1a5249)[_0xbfa2('0x2b')](function(_0xbe4d26){return _0xbe4d26;});}return null;};}function removeEntity(_0x8488e1,_0x38c5dc){return function(_0x1e1c76){if(_0x1e1c76){return _0x1e1c76['destroy']()[_0xbfa2('0x2b')](function(){_0x8488e1[_0xbfa2('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ec27,_0x14f142){return function(_0x4ccdb5){if(!_0x4ccdb5){_0x37ec27[_0xbfa2('0x2c')](0x194);}return _0x4ccdb5;};}function handleError(_0x5ecd55,_0x16bc84){_0x16bc84=_0x16bc84||0x1f4;return function(_0x56dd44){logger[_0xbfa2('0x2d')](_0x56dd44[_0xbfa2('0x2e')]);if(_0x56dd44[_0xbfa2('0x2f')]){delete _0x56dd44[_0xbfa2('0x2f')];}_0x5ecd55['status'](_0x16bc84)[_0xbfa2('0x30')](_0x56dd44);};}function getInteractionUsers(_0x4aac4e,_0xb95429){return new BPromise(function(_0x36a30d,_0x3860b4){try{if(_0xb95429[_0x4aac4e['id']]){_0x4aac4e['Users']=_[_0xbfa2('0x31')](_0xb95429[_0x4aac4e['id']],function(_0x17e471){return{'id':_0x17e471['id'],'fullname':_0x17e471[_0xbfa2('0x32')]};});}}catch(_0x5db6ae){_0x3860b4(_0x5db6ae);}_0x36a30d(_0x4aac4e);});}function getInteractionTags(_0x47fd5a,_0x5aa051){return new BPromise(function(_0x2d5050,_0x12069c){try{if(_0x47fd5a['TagIds']){_0x47fd5a[_0xbfa2('0x33')]=[];_0x47fd5a[_0xbfa2('0x34')][_0xbfa2('0x35')](',')[_0xbfa2('0x36')](function(_0x53dd76){_0x47fd5a[_0xbfa2('0x33')][_0xbfa2('0x37')](_0x5aa051[_0x53dd76]);});}delete _0x47fd5a['TagIds'];}catch(_0x63ed08){_0x12069c(_0x63ed08);}_0x2d5050(_0x47fd5a);});}function updateWhatsappInteraction(_0x1271d8,_0xad23ed,_0xa8eac2){return new BPromise(function(_0x309284,_0x278f3a){return getInteractionUsers(_0x1271d8,_0xa8eac2)[_0xbfa2('0x2b')](function(_0x263044){return getInteractionTags(_0x263044,_0xad23ed);})[_0xbfa2('0x2b')](function(_0x5d6c57){_0x309284(_0x5d6c57);})[_0xbfa2('0x38')](function(_0x5c910b){_0x278f3a(_0x5c910b);});});}exports[_0xbfa2('0x39')]=function(_0x57c93c,_0x17c2d1){var _0x2915ce={},_0x1611b0={},_0xa665d8={'count':0x0,'rows':[]};var _0x3b0dd5=_['map'](db[_0xbfa2('0x3a')][_0xbfa2('0x3b')],function(_0xb264a6){return{'name':_0xb264a6[_0xbfa2('0x3c')],'type':_0xb264a6[_0xbfa2('0x3d')]['key']};});_0x1611b0['model']=_[_0xbfa2('0x31')](_0x3b0dd5,_0xbfa2('0x2f'));_0x1611b0[_0xbfa2('0x3e')]=_['keys'](_0x57c93c['query']);_0x1611b0[_0xbfa2('0x3f')]=_[_0xbfa2('0x40')](_0x1611b0['model'],_0x1611b0['query']);_0x2915ce[_0xbfa2('0x41')]=_[_0xbfa2('0x40')](_0x1611b0['model'],qs[_0xbfa2('0x42')](_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x42')]));_0x2915ce[_0xbfa2('0x41')]=_0x2915ce[_0xbfa2('0x41')][_0xbfa2('0x43')]?_0x2915ce[_0xbfa2('0x41')]:_0x1611b0[_0xbfa2('0x44')];if(!_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x45')](_0xbfa2('0x46'))){_0x2915ce[_0xbfa2('0x25')]=qs[_0xbfa2('0x25')](_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x25')]);_0x2915ce[_0xbfa2('0x23')]=qs[_0xbfa2('0x23')](_0x57c93c['query'][_0xbfa2('0x23')]);}_0x2915ce[_0xbfa2('0x47')]=qs[_0xbfa2('0x48')](_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x48')]);_0x2915ce[_0xbfa2('0x49')]=qs['filters'](_[_0xbfa2('0x4a')](_0x57c93c['query'],_0x1611b0[_0xbfa2('0x3f')]),_0x3b0dd5);var _0x1d293e=[];var _0x56a917=squel[_0xbfa2('0x4b')]()[_0xbfa2('0x4c')]('id')[_0xbfa2('0x4c')](_0xbfa2('0x2f'))[_0xbfa2('0x4c')]('color')[_0xbfa2('0x4d')](_0xbfa2('0x4e'));var _0x6f6a96=squel[_0xbfa2('0x4b')]()[_0xbfa2('0x4c')](_0xbfa2('0x4f'))[_0xbfa2('0x4c')](_0xbfa2('0x50'))['field'](_0xbfa2('0x51'))[_0xbfa2('0x4d')]('user_has_whatsapp_interactions','ui')[_0xbfa2('0x52')](_0xbfa2('0x53'),'u',_0xbfa2('0x54'));var _0x3879ac=squel[_0xbfa2('0x4b')]()[_0xbfa2('0x4d')](_0xbfa2('0x55'),'i')[_0xbfa2('0x52')](_0xbfa2('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xbfa2('0x52')](_0xbfa2('0x53'),'o',_0xbfa2('0x57'))['left_join']('whatsapp_accounts','a',_0xbfa2('0x58'))['left_join'](_0xbfa2('0x59'),'me',_0xbfa2('0x5a'))['left_join'](_0xbfa2('0x5b'),'it',_0xbfa2('0x5c'))[_0xbfa2('0x52')]('tools_tags','t',_0xbfa2('0x5d'));var _0x4ab0d4=squel[_0xbfa2('0x5e')]();var _0x2a02f6=[];var _0x4edbe6=squel[_0xbfa2('0x5e')]();var _0x59dc56;if(_0x57c93c[_0xbfa2('0x3e')]['search']){_0x59dc56=as[_0xbfa2('0x5f')](_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x60')]);var _0xdb21b5=_0x59dc56[_0xbfa2('0x61')];for(var _0x4aa950=0x0;_0x4aa950<_0x59dc56['conditions']['length'];_0x4aa950++){var _0x39d372=_0x59dc56[_0xbfa2('0x62')][_0x4aa950];var _0x221f5a='i';var _0x4d5271=_[_0xbfa2('0x63')](_0x3b0dd5,[_0xbfa2('0x2f'),_0x39d372['field']]);if(!_0x4d5271){switch(_0x39d372[_0xbfa2('0x4c')]){case _0xbfa2('0x64'):if(_0x39d372['value']==0x1){_0x3879ac[_0xbfa2('0x65')]('`'+_0x39d372[_0xbfa2('0x4c')]+'`\x20=\x200');}else{_0x3879ac['having']('`'+_0x39d372[_0xbfa2('0x4c')]+'`\x20>\x200');}break;case _0xbfa2('0x66'):if(_0x39d372[_0xbfa2('0x67')]==='$substring'){if(_0x39d372[_0xbfa2('0x68')][_0xbfa2('0x35')]('\x20')[_0xbfa2('0x43')]>0x1){_0x4ab0d4[_0xdb21b5](_0xbfa2('0x69'),qs[_0xbfa2('0x6a')](_0x39d372[_0xbfa2('0x68')]),null);}else{var _0x14c2b1='%'+_0x39d372[_0xbfa2('0x68')]+'%';_0x4ab0d4[_0xdb21b5](_0xbfa2('0x6b'),_0x14c2b1,_0x14c2b1,_0x14c2b1);}}else{_0x4d5271=_[_0xbfa2('0x63')](_0x3b0dd5,[_0xbfa2('0x2f'),_0xbfa2('0x6c')]);_0x39d372[_0xbfa2('0x4c')]=_0xbfa2('0x6c');_0x13d8cb=as['buildExpression'](_0x221f5a,_0x4d5271[_0xbfa2('0x3d')],_0x39d372);_0x4ab0d4[_0xdb21b5](_0x13d8cb['text'],_0x13d8cb[_0xbfa2('0x68')][_0xbfa2('0x6d')],_0x13d8cb[_0xbfa2('0x68')][_0xbfa2('0x21')]);}break;case _0xbfa2('0x6e'):var _0x2b05b5=_0x39d372[_0xbfa2('0x68')][_0xbfa2('0x35')](',')[_0xbfa2('0x31')](function(_0x2ea55c){return Number(_0x2ea55c);});_0x2b05b5[_0xbfa2('0x36')](function(_0x52803c){_0x4edbe6['or'](_0xbfa2('0x6f'),'%,'+_0x52803c+',%');});_0x2a02f6=_[_0xbfa2('0x70')](_0x2a02f6,_0x2b05b5);break;case _0xbfa2('0x71'):if(_0x39d372[_0xbfa2('0x67')]==='$substring'){_0x4ab0d4[_0xdb21b5](_0xbfa2('0x72'),'%'+_0x39d372[_0xbfa2('0x68')]+'%',null);}else{_0x4d5271=_[_0xbfa2('0x63')](_0x3b0dd5,[_0xbfa2('0x2f'),_0xbfa2('0x73')]);_0x39d372['field']=_0xbfa2('0x73');_0x13d8cb=as[_0xbfa2('0x74')](_0x221f5a,_0x4d5271[_0xbfa2('0x3d')],_0x39d372);_0x4ab0d4[_0xdb21b5](_0x13d8cb[_0xbfa2('0x75')],_0x13d8cb[_0xbfa2('0x68')][_0xbfa2('0x6d')],_0x13d8cb['value'][_0xbfa2('0x21')]);}break;case _0xbfa2('0x76'):_0x13d8cb=as[_0xbfa2('0x74')]('me',null,_0x39d372);_0x4ab0d4[_0xdb21b5](_0x13d8cb[_0xbfa2('0x75')],_0x13d8cb[_0xbfa2('0x68')]['start'],_0x13d8cb[_0xbfa2('0x68')]['end']);break;}}else{var _0x13d8cb=as[_0xbfa2('0x74')](_0x221f5a,_0x4d5271[_0xbfa2('0x3d')],_0x39d372);_0x4ab0d4[_0xdb21b5](_0x13d8cb[_0xbfa2('0x75')],_0x13d8cb['value']['start'],_0x13d8cb[_0xbfa2('0x68')][_0xbfa2('0x21')]);}}}else{var _0x15c172=_(_0x57c93c['query'])[_0xbfa2('0x77')]()[_0xbfa2('0x31')](function(_0xb9e0a){return _[_0xbfa2('0x78')](_0x3b0dd5,['name',_0xb9e0a])?_0xb9e0a:undefined;})[_0xbfa2('0x79')]()[_0xbfa2('0x68')]();if(!_['isEmpty'](_0x15c172)){_0x15c172[_0xbfa2('0x36')](function(_0x217ca5){if(_0x217ca5===_0xbfa2('0x7a')){_0x3879ac[_0xbfa2('0x49')]('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x57c93c[_0xbfa2('0x3e')][_0x217ca5]));}else if(_0x217ca5===_0xbfa2('0x7b')){var _0x8de0a6=JSON[_0xbfa2('0x7c')](_0x57c93c[_0xbfa2('0x3e')][_0x217ca5])['$gte'];var _0x435984=JSON[_0xbfa2('0x7c')](_0x57c93c[_0xbfa2('0x3e')][_0x217ca5])['$lte'];_0x3879ac[_0xbfa2('0x49')](_0xbfa2('0x7d'),_0x8de0a6,_0x435984);}else{if(_0x57c93c[_0xbfa2('0x3e')][_0x217ca5]===_0xbfa2('0x7e')){_0x3879ac['where']('i.'+_0x217ca5+'\x20IS\x20NULL');}else{_0x3879ac[_0xbfa2('0x49')]('i.'+_0x217ca5+'\x20=\x20?',_0x57c93c[_0xbfa2('0x3e')][_0x217ca5]);}}});}if(_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x7f')]){if(_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x7f')]==0x1){_0x3879ac['having'](_0xbfa2('0x80'));}else{_0x3879ac[_0xbfa2('0x65')](_0xbfa2('0x81'));}}if(_0x57c93c['query']['tag']){_0x2a02f6=_[_0xbfa2('0x82')](_0x57c93c['query']['tag'])?_0x57c93c['query'][_0xbfa2('0x83')]:new Array(_0x57c93c['query'][_0xbfa2('0x83')]);_0x2a02f6[_0xbfa2('0x36')](function(_0xdde19){_0x4edbe6['or'](_0xbfa2('0x6f'),'%,'+_0xdde19+',%');});}if(_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x84')]){var _0xe1f79c=_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x84')][_0xbfa2('0x85')]('\x5c','\x5c\x5c')[_0xbfa2('0x85')](/'/g,'\x27\x27');if(qs[_0xbfa2('0x86')](_0xe1f79c)){_0x4ab0d4['or'](_0xbfa2('0x87'),_0xe1f79c+'%')['or'](_0xbfa2('0x88'),_0xe1f79c+'%');}else{_0x4ab0d4['or'](_0xbfa2('0x89'),qs[_0xbfa2('0x6a')](_0xe1f79c))['or'](_0xbfa2('0x8a'),_0xe1f79c+'%');}}}_0x3879ac[_0xbfa2('0x49')](_0x4ab0d4);_0x3879ac[_0xbfa2('0x8b')](_0xbfa2('0x8c'));var _0x40a162={'type':db[_0xbfa2('0x8d')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3f2bd3=_0x3879ac[_0xbfa2('0x8e')]();_0x3f2bd3[_0xbfa2('0x4c')](_0xbfa2('0x8c'));_0x3f2bd3[_0xbfa2('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbfa2('0x64'));if(_0x2915ce[_0xbfa2('0x47')]){_0x2915ce['order'][_0xbfa2('0x36')](function(_0x52a7f0){var _0x42dc64=_0x52a7f0[0x0]===_0xbfa2('0x8f')?_0x52a7f0[0x0]:'i.'+_0x52a7f0[0x0];_0x3879ac[_0xbfa2('0x47')](_0x42dc64,_0x52a7f0[0x1]===_0xbfa2('0x90')?![]:!![]);});}if(!_[_0xbfa2('0x91')](_0x2a02f6)){_0x3879ac[_0xbfa2('0x65')](_0x4edbe6);_0x3f2bd3[_0xbfa2('0x49')](_0xbfa2('0x92'),_0x2a02f6);}BPromise[_0xbfa2('0x93')]()['then'](function(){if(!_0x59dc56){if(_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x7a')])return;_0x3f2bd3['where'](_0xbfa2('0x94'));_0x3879ac['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x57c93c[_0xbfa2('0x95')][_0xbfa2('0x96')]!==_0xbfa2('0x97'))return;return _0x57c93c[_0xbfa2('0x95')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xbfa2('0x2b')](function(_0x4bd996){if(_[_0xbfa2('0x91')](_0x4bd996)){_0x3f2bd3[_0xbfa2('0x49')](_0xbfa2('0x98'));_0x3879ac[_0xbfa2('0x49')](_0xbfa2('0x98'));}else{_0x3f2bd3[_0xbfa2('0x49')](_0xbfa2('0x99'),_[_0xbfa2('0x31')](_0x4bd996,'id'));_0x3879ac[_0xbfa2('0x49')](_0xbfa2('0x99'),_['map'](_0x4bd996,'id'));}});})[_0xbfa2('0x2b')](function(){if(_0x57c93c[_0xbfa2('0x95')][_0xbfa2('0x96')]===_0xbfa2('0x97')&&!_0x59dc56&&!_0x57c93c[_0xbfa2('0x3e')][_0xbfa2('0x7a')])return[];return db['sequelize'][_0xbfa2('0x3e')](_0x3f2bd3[_0xbfa2('0x9a')](),_0x40a162);})[_0xbfa2('0x2b')](function(_0x323f19){_0xa665d8['count']=_0x323f19['length'];if(_0xa665d8[_0xbfa2('0x26')]===0x0)return[];return db[_0xbfa2('0x9b')][_0xbfa2('0x3e')](_0x56a917[_0xbfa2('0x9a')](),_0x40a162)[_0xbfa2('0x2b')](function(_0x345454){_0x1d293e=_[_0xbfa2('0x9c')](_0x345454,'id');_0x40a162=_[_0xbfa2('0x9d')](_0x40a162,{'model':db[_0xbfa2('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57c93c['query']['fields']){_0x2915ce[_0xbfa2('0x41')][_0xbfa2('0x36')](function(_0x5e8c86){_0x3879ac[_0xbfa2('0x4c')]('i.'+_0x5e8c86);});}else{_0x3879ac['field'](_0xbfa2('0x9e'),_0xbfa2('0x64'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0x9f'),_0xbfa2('0xa0'));_0x3879ac['field']('a.mandatoryDisposition',_0xbfa2('0xa1'));_0x3879ac['field'](_0xbfa2('0xa2'),_0xbfa2('0x8f'));_0x3879ac['field'](_0xbfa2('0xa3'));_0x3879ac['field']('c.firstName',_0xbfa2('0xa4'));_0x3879ac[_0xbfa2('0x4c')]('c.lastName',_0xbfa2('0xa5'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0xa6'),_0xbfa2('0xa7'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0xa8'),_0xbfa2('0xa9'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0xaa'),_0xbfa2('0xab'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0xac'),_0xbfa2('0xad'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0xae'),_0xbfa2('0xaf'));_0x3879ac[_0xbfa2('0x4c')](_0xbfa2('0xb0'),'Owner.internal');_0x3879ac['field'](_0xbfa2('0xb1'),_0xbfa2('0x34'));}if(_0x2915ce[_0xbfa2('0x25')])_0x3879ac[_0xbfa2('0x25')](_0x2915ce[_0xbfa2('0x25')]);if(_0x2915ce['offset'])_0x3879ac[_0xbfa2('0x23')](_0x2915ce[_0xbfa2('0x23')]);return db[_0xbfa2('0x9b')][_0xbfa2('0x3e')](_0x3879ac[_0xbfa2('0x9a')](),_0x40a162);})[_0xbfa2('0x2b')](function(_0x271525){if(_0x271525[_0xbfa2('0x43')]>0x0)_0x6f6a96[_0xbfa2('0x49')](_0xbfa2('0xb2'),_[_0xbfa2('0x31')](_0x271525,'id'));return db[_0xbfa2('0x9b')][_0xbfa2('0x3e')](_0x6f6a96[_0xbfa2('0x9a')](),_0x40a162)['then'](function(_0x3bb2fe){var _0x1c395f=_[_0xbfa2('0xb3')](_0x3bb2fe,'WhatsappInteractionId');var _0x4a04cf=[];_0x271525[_0xbfa2('0x36')](function(_0x24bb46){_0x4a04cf[_0xbfa2('0x37')](updateWhatsappInteraction(_0x24bb46,_0x1d293e,_0x1c395f));});return BPromise[_0xbfa2('0xb4')](_0x4a04cf);});});})[_0xbfa2('0x2b')](function(_0x39674a){_0xa665d8[_0xbfa2('0xb5')]=_0x39674a;return _0xa665d8;})['then'](respondWithFilteredResult(_0x17c2d1,_0x2915ce))['catch'](handleError(_0x17c2d1,null));};exports[_0xbfa2('0xb6')]=function(_0x2e4715,_0x40dbef){var _0x1cab3f={'raw':![],'where':{'id':_0x2e4715[_0xbfa2('0xb7')]['id']}},_0x5e5a3a={};_0x5e5a3a[_0xbfa2('0x44')]=_[_0xbfa2('0x77')](db[_0xbfa2('0x3a')][_0xbfa2('0x3b')]);_0x5e5a3a['query']=_['keys'](_0x2e4715[_0xbfa2('0x3e')]);_0x5e5a3a['filters']=_[_0xbfa2('0x40')](_0x5e5a3a[_0xbfa2('0x44')],_0x5e5a3a[_0xbfa2('0x3e')]);_0x1cab3f[_0xbfa2('0x41')]=_[_0xbfa2('0x40')](_0x5e5a3a[_0xbfa2('0x44')],qs[_0xbfa2('0x42')](_0x2e4715['query'][_0xbfa2('0x42')]));_0x1cab3f[_0xbfa2('0x41')]=_0x1cab3f[_0xbfa2('0x41')][_0xbfa2('0x43')]?_0x1cab3f[_0xbfa2('0x41')]:_0x5e5a3a['model'];if(_0x2e4715['query'][_0xbfa2('0xb8')]){_0x1cab3f[_0xbfa2('0xb9')]=[{'all':!![]}];}_0x1cab3f=_[_0xbfa2('0x9d')]({},_0x1cab3f,_0x2e4715['options']);return db[_0xbfa2('0x3a')][_0xbfa2('0x63')](_0x1cab3f)[_0xbfa2('0x2b')](handleEntityNotFound(_0x40dbef,null))[_0xbfa2('0x2b')](respondWithResult(_0x40dbef,null))['catch'](handleError(_0x40dbef,null));};exports['create']=function(_0x2e2a21,_0x385ab7){return db['WhatsappInteraction'][_0xbfa2('0xba')](_0x2e2a21['body'],{})[_0xbfa2('0x2b')](respondWithResult(_0x385ab7,0xc9))[_0xbfa2('0x38')](handleError(_0x385ab7,null));};exports[_0xbfa2('0xbb')]=function(_0x595844,_0x25bdd7){if(_0x595844['body']['id']){delete _0x595844[_0xbfa2('0x76')]['id'];}return db[_0xbfa2('0x3a')][_0xbfa2('0x63')]({'where':{'id':_0x595844[_0xbfa2('0xb7')]['id']}})['then'](handleEntityNotFound(_0x25bdd7,null))[_0xbfa2('0x2b')](saveUpdates(_0x595844['body'],null))[_0xbfa2('0x2b')](respondWithResult(_0x25bdd7,null))[_0xbfa2('0x38')](handleError(_0x25bdd7,null));};exports[_0xbfa2('0xbc')]=function(_0x28b821,_0x2ec65c){return db['WhatsappInteraction'][_0xbfa2('0x63')]({'where':{'id':_0x28b821['params']['id']}})[_0xbfa2('0x2b')](handleEntityNotFound(_0x2ec65c,null))[_0xbfa2('0x2b')](removeEntity(_0x2ec65c,null))[_0xbfa2('0x38')](handleError(_0x2ec65c,null));};exports[_0xbfa2('0xbd')]=function(_0x3e93b9,_0x3ffbc6){return db[_0xbfa2('0x3a')][_0xbfa2('0xbd')]()[_0xbfa2('0x2b')](respondWithResult(_0x3ffbc6,null))[_0xbfa2('0x38')](handleError(_0x3ffbc6,null));};exports[_0xbfa2('0xbe')]=function(_0x4341bf,_0x484feb,_0x296652){return db[_0xbfa2('0xbf')]['find']({'where':{'id':_0x4341bf['params']['id']}})[_0xbfa2('0x2b')](handleEntityNotFound(_0x484feb,null))[_0xbfa2('0x2b')](function(_0x4472d2){if(_0x4472d2){return _0x4472d2[_0xbfa2('0xbe')](_0x4341bf[_0xbfa2('0x76')][_0xbfa2('0xc0')],_[_0xbfa2('0xc1')](_0x4341bf[_0xbfa2('0x76')],['ids','id'])||{});}})[_0xbfa2('0x2b')](respondWithResult(_0x484feb,null))[_0xbfa2('0x38')](handleError(_0x484feb,null));};exports[_0xbfa2('0xc2')]=function(_0x1366df,_0x288e93,_0xe62c08){var _0x1df60e={'raw':![],'where':{}};var _0x16393b={};var _0x71128e={'count':0x0,'rows':[]};return db[_0xbfa2('0x3a')][_0xbfa2('0xc3')]({'where':{'id':_0x1366df[_0xbfa2('0xb7')]['id']}})['then'](handleEntityNotFound(_0x288e93,null))[_0xbfa2('0x2b')](function(_0x5959e4){if(_0x5959e4){_0x16393b['model']=_[_0xbfa2('0x77')](db[_0xbfa2('0xbf')]['rawAttributes']);_0x16393b[_0xbfa2('0x3e')]=_[_0xbfa2('0x77')](_0x1366df[_0xbfa2('0x3e')]);_0x16393b[_0xbfa2('0x3f')]=_[_0xbfa2('0x40')](_0x16393b[_0xbfa2('0x44')],_0x16393b[_0xbfa2('0x3e')]);_0x1df60e['attributes']=_[_0xbfa2('0x40')](_0x16393b['model'],qs[_0xbfa2('0x42')](_0x1366df[_0xbfa2('0x3e')][_0xbfa2('0x42')]));_0x1df60e[_0xbfa2('0x41')]=_0x1df60e['attributes']['length']?_0x1df60e[_0xbfa2('0x41')]:_0x16393b['model'];if(!_0x1366df[_0xbfa2('0x3e')][_0xbfa2('0x45')](_0xbfa2('0x46'))){_0x1df60e['limit']=qs[_0xbfa2('0x25')](_0x1366df['query'][_0xbfa2('0x25')]);_0x1df60e[_0xbfa2('0x23')]=qs['offset'](_0x1366df[_0xbfa2('0x3e')]['offset']);}_0x1df60e[_0xbfa2('0x47')]=qs[_0xbfa2('0x48')](_0x1366df['query']['sort']);_0x1df60e['where']=qs[_0xbfa2('0x3f')](_[_0xbfa2('0x4a')](_0x1366df[_0xbfa2('0x3e')],_0x16393b[_0xbfa2('0x3f')]));_0x1df60e[_0xbfa2('0x49')][_0xbfa2('0xc4')]=_0x5959e4['id'];if(_0x1366df[_0xbfa2('0x3e')][_0xbfa2('0x84')]){_0x1df60e[_0xbfa2('0x49')]=_['merge'](_0x1df60e['where'],{'$or':_[_0xbfa2('0x31')](_0x1df60e[_0xbfa2('0x41')],function(_0x2b675e){var _0x4213c7={};_0x4213c7[_0x2b675e]={'$like':'%'+_0x1366df[_0xbfa2('0x3e')][_0xbfa2('0x84')]+'%'};return _0x4213c7;})});}if(_0x1366df[_0xbfa2('0x3e')][_0xbfa2('0xc5')]){var _0x912aa=_0x1366df[_0xbfa2('0x3e')][_0xbfa2('0xc5')][_0xbfa2('0x35')](',');var _0x2672e5={};_0x2672e5[_0x912aa[0x0]]={'$gte':moment(_0x912aa[0x1])[_0xbfa2('0xc6')](_0xbfa2('0xc7'))};_0x1df60e[_0xbfa2('0x49')]=_[_0xbfa2('0x9d')](_0x1df60e[_0xbfa2('0x49')],_0x2672e5);}_0x1df60e=_[_0xbfa2('0x9d')]({},_0x1df60e,_0x1366df['options']);return db[_0xbfa2('0xbf')][_0xbfa2('0x26')]({'where':_0x1df60e[_0xbfa2('0x49')]})[_0xbfa2('0x2b')](function(_0x2052d3){_0x71128e[_0xbfa2('0x26')]=_0x2052d3;if(_0x1366df[_0xbfa2('0x3e')]['includeAll']){_0x1df60e[_0xbfa2('0xb9')]=[{'all':!![]}];}return db[_0xbfa2('0xbf')][_0xbfa2('0xc8')](_0x1df60e);})[_0xbfa2('0x2b')](function(_0x24ba4a){_0x71128e['rows']=_0x24ba4a;return _0x71128e;});}})[_0xbfa2('0x2b')](respondWithFilteredResult(_0x288e93,_0x1df60e))[_0xbfa2('0x38')](handleError(_0x288e93,null));};exports[_0xbfa2('0xc9')]=function(_0x38d49b,_0x4ddc73,_0x3bb31e){return db[_0xbfa2('0x3a')][_0xbfa2('0x63')]({'where':{'id':_0x38d49b[_0xbfa2('0xb7')]['id']}})[_0xbfa2('0x2b')](handleEntityNotFound(_0x4ddc73,null))['then'](function(_0x3d2aca){if(_0x3d2aca){return _0x3d2aca['setTags'](_0x38d49b[_0xbfa2('0x76')][_0xbfa2('0xc0')],_[_0xbfa2('0xc1')](_0x38d49b[_0xbfa2('0x76')],[_0xbfa2('0xc0'),'id'])||{})[_0xbfa2('0xca')](function(){return db[_0xbfa2('0x6e')][_0xbfa2('0xc8')]({'attributes':['id','name',_0xbfa2('0xcb')],'where':{'id':_0x38d49b['body'][_0xbfa2('0xc0')]}});})[_0xbfa2('0x2b')](function(_0x209303){socket[_0xbfa2('0xcc')](_0xbfa2('0xcd'),{'id':Number(_0x38d49b[_0xbfa2('0xb7')]['id']),'tags':_0x209303||[]});return{'id':Number(_0x38d49b[_0xbfa2('0xb7')]['id']),'tags':_0x209303||[]};});}})[_0xbfa2('0x2b')](respondWithResult(_0x4ddc73,null))[_0xbfa2('0x38')](handleError(_0x4ddc73,null));};exports[_0xbfa2('0xce')]=function(_0x373e78,_0x33828e,_0x3495b2){return db[_0xbfa2('0x3a')][_0xbfa2('0x63')]({'where':{'id':_0x373e78['params']['id']}})[_0xbfa2('0x2b')](handleEntityNotFound(_0x33828e,null))['then'](function(_0x5c66ba){if(_0x5c66ba){return _0x5c66ba['removeTags'](_0x373e78[_0xbfa2('0x3e')][_0xbfa2('0xc0')]);}})[_0xbfa2('0x2b')](respondWithStatusCode(_0x33828e,null))[_0xbfa2('0x38')](handleError(_0x33828e,null));};exports[_0xbfa2('0xcf')]=function(_0x40bd24,_0x4810d5){var _0x4515b6=moment()[_0xbfa2('0xd0')]()[_0xbfa2('0x9a')]();var _0x187363=path[_0xbfa2('0xd1')](config[_0xbfa2('0xd2')],_0xbfa2('0xd3'),_0xbfa2('0xd4'),_0xbfa2('0xd5'));var _0x4b084f=path[_0xbfa2('0xd1')](config['root'],_0xbfa2('0xd3'),_0xbfa2('0xd4'),_0xbfa2('0xd6'));var _0x2170b8=path[_0xbfa2('0xd1')](_0x187363,_0x4515b6);var _0x5495ae=util[_0xbfa2('0xc6')]('transcript-%d-%s.zip',_0x40bd24[_0xbfa2('0xb7')]['id'],_0x4515b6);var _0x292122=path[_0xbfa2('0xd1')](_0x187363,_0x5495ae);var _0x35a349=[];_0x35a349[_0xbfa2('0x37')]({'model':db[_0xbfa2('0x71')],'as':_0xbfa2('0x71'),'attributes':['id',_0xbfa2('0x32')],'raw':!![]});_0x35a349[_0xbfa2('0x37')]({'model':db[_0xbfa2('0xd7')],'as':'Contact','attributes':['id',_0xbfa2('0xd8'),'lastName'],'raw':!![]});if(_0x40bd24[_0xbfa2('0x3e')][_0xbfa2('0xd6')]){_0x35a349[_0xbfa2('0x37')]({'model':db[_0xbfa2('0xd9')],'as':_0xbfa2('0xd9'),'raw':!![]});}var _0xc3710e=[{'model':db[_0xbfa2('0xbf')],'as':_0xbfa2('0xda'),'attributes':['id',_0xbfa2('0x76'),_0xbfa2('0x7b'),_0xbfa2('0xdb'),_0xbfa2('0xdc'),'read'],'include':_0x35a349}];_0xc3710e['push']({'model':db['WhatsappAccount'],'as':_0xbfa2('0xdd'),'attributes':['id',_0xbfa2('0x2f')]});_0xc3710e[_0xbfa2('0x37')]({'model':db['User'],'as':_0xbfa2('0xde'),'attributes':['id',_0xbfa2('0x32')]});return db[_0xbfa2('0x3a')]['find']({'where':{'id':_0x40bd24[_0xbfa2('0xb7')]['id']},'include':_0xc3710e})[_0xbfa2('0x2b')](handleEntityNotFound(_0x4810d5,null))[_0xbfa2('0x2b')](function(_0x1d260e){if(_0x1d260e){var _0x3e48bf=_0x1d260e[_0xbfa2('0xdf')]({'plain':!![]});fs[_0xbfa2('0xe0')](_0x2170b8);var _0xe5516c={'channel':'Whatsapp','account':_0x3e48bf[_0xbfa2('0xdd')][_0xbfa2('0x2f')],'agent':_0x3e48bf[_0xbfa2('0xde')]?_0x3e48bf[_0xbfa2('0xde')][_0xbfa2('0x32')]:_0xbfa2('0xe1'),'createdAt':moment(_0x3e48bf[_0xbfa2('0x7b')])[_0xbfa2('0xc6')](_0xbfa2('0xc7'))[_0xbfa2('0x9a')](),'closedAt':_0x3e48bf[_0xbfa2('0xe2')]?moment(_0x3e48bf[_0xbfa2('0xe3')])['format'](_0xbfa2('0xc7'))[_0xbfa2('0x9a')]():'','disposition':_0x3e48bf[_0xbfa2('0xe4')],'messages':_(_0x3e48bf[_0xbfa2('0xda')])[_0xbfa2('0x84')]({'secret':![]})['map'](function(_0x1ba438){if(_0x1ba438[_0xbfa2('0xd9')]){var _0x244d2d=path['join'](_0x4b084f,_0x1ba438['Attachment'][_0xbfa2('0xe5')]);if(fs[_0xbfa2('0xe6')](_0x244d2d)){fs[_0xbfa2('0xe7')](_0x244d2d)[_0xbfa2('0xe8')](fs[_0xbfa2('0xe9')](path['join'](_0x2170b8,_0x1ba438['Attachment'][_0xbfa2('0xe5')])));}}return{'date':moment(_0x1ba438[_0xbfa2('0x7b')])['format'](_0xbfa2('0xc7'))[_0xbfa2('0x9a')](),'sender':_0x1ba438[_0xbfa2('0xdb')]==='out'?_0x1ba438[_0xbfa2('0x71')]?_0x1ba438[_0xbfa2('0x71')][_0xbfa2('0x32')]:_0xbfa2('0xea'):_0x1ba438[_0xbfa2('0x66')][_0xbfa2('0xd8')]+(_0x1ba438['Contact'][_0xbfa2('0xeb')]?'\x20'+_0x1ba438['Contact'][_0xbfa2('0xeb')]:''),'body':_0x1ba438[_0xbfa2('0xd9')]?_0x1ba438[_0xbfa2('0xd9')][_0xbfa2('0xe5')]:_0x1ba438['body'],'direction':_0x1ba438['direction']==='out'?'A':'C','secret':_0x1ba438[_0xbfa2('0xdc')],'read':_0x1ba438[_0xbfa2('0x7f')],'attachment':_0x1ba438['Attachment']};})[_0xbfa2('0x68')]()};return ejs[_0xbfa2('0xec')](path[_0xbfa2('0xd1')](config[_0xbfa2('0xd2')],_0xbfa2('0xd3'),_0xbfa2('0xed'),_0xbfa2('0xee')),{'interaction':_0xe5516c})[_0xbfa2('0x2b')](function(_0x4770e9){var _0x1a74e0=path['join'](_0x2170b8,_0xbfa2('0xef')+_0x3e48bf['id']+'-'+_0x4515b6+_0xbfa2('0xf0'));var _0x366d5d={'path':_0x1a74e0,'channel':'Whatsapp','interactionId':_0x3e48bf['id']};return pdf[_0xbfa2('0xf1')](_0x4770e9,_0x366d5d);})['then'](function(){return new BPromise(function(_0x488cb8,_0x4cf88a){zipdir(_0x2170b8,{'saveTo':_0x292122},function(_0x357cfe,_0x2e1cd4){if(_0x357cfe)return _0x4cf88a(_0x357cfe);return _0x488cb8(_0x2e1cd4);});})[_0xbfa2('0x2b')](function(){return new BPromise(function(_0x3d87b4,_0x3a77bf){rimraf(_0x2170b8,function(_0x5b56dc){if(_0x5b56dc)_0x3a77bf(_0x5b56dc);return _0x3d87b4();});});})[_0xbfa2('0x2b')](function(){return _0x4810d5['download'](_0x292122,_0x5495ae,function(_0x4a99e7){if(_0x4a99e7){console['log'](_0xbfa2('0xf2'),_0x4a99e7);}else{fs[_0xbfa2('0xf3')](_0x292122);}});});});}else{return _0x4810d5[_0xbfa2('0x2c')](0xc8);}})['catch'](handleError(_0x4810d5,null));}; \ No newline at end of file +var _0x0412=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','start','body','compact','isEmpty','WhatsappAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','c.fax','o.fullname','o.internal','Owner.internal','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','merge','options','create','describe','WhatsappMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','Tag','findAll','color','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','secret','views','downloadInteraction.ejs','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','WhatsappInteraction','rawAttributes','query','keys','intersection'];(function(_0x5d0028,_0x58edc4){var _0x4f6c5=function(_0x32bb32){while(--_0x32bb32){_0x5d0028['push'](_0x5d0028['shift']());}};_0x4f6c5(++_0x58edc4);}(_0x0412,0xad));var _0x2041=function(_0x1fc1fc,_0x809d49){_0x1fc1fc=_0x1fc1fc-0x0;var _0x5a7a59=_0x0412[_0x1fc1fc];return _0x5a7a59;};'use strict';var emlformat=require(_0x2041('0x0'));var rimraf=require(_0x2041('0x1'));var zipdir=require(_0x2041('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2041('0x3'));var moment=require('moment');var BPromise=require(_0x2041('0x4'));var Mustache=require(_0x2041('0x5'));var util=require(_0x2041('0x6'));var path=require('path');var sox=require(_0x2041('0x7'));var csv=require(_0x2041('0x8'));var ejs=require(_0x2041('0x9'));var fs=require('fs');var fs_extra=require(_0x2041('0xa'));var _=require(_0x2041('0xb'));var squel=require(_0x2041('0xc'));var crypto=require('crypto');var jsforce=require(_0x2041('0xd'));var deskjs=require(_0x2041('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2041('0xf'));var Papa=require(_0x2041('0x10'));var Redis=require(_0x2041('0x11'));var authService=require(_0x2041('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x2041('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2041('0x14'))(_0x2041('0x15'));var utils=require(_0x2041('0x16'));var config=require(_0x2041('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2041('0x18'))['db'];config[_0x2041('0x19')]=_[_0x2041('0x1a')](config['redis'],{'host':_0x2041('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2041('0x19')]));require(_0x2041('0x1c'))['register'](socket);function respondWithStatusCode(_0x2da3b1,_0x42e3b8){_0x42e3b8=_0x42e3b8||0xcc;return function(_0x5c0120){if(_0x5c0120){return _0x2da3b1['sendStatus'](_0x42e3b8);}return _0x2da3b1[_0x2041('0x1d')](_0x42e3b8)[_0x2041('0x1e')]();};}function respondWithResult(_0x2c18be,_0x4f5520){_0x4f5520=_0x4f5520||0xc8;return function(_0x187645){if(_0x187645){return _0x2c18be[_0x2041('0x1d')](_0x4f5520)[_0x2041('0x1f')](_0x187645);}};}function respondWithFilteredResult(_0x135bbc,_0x31c0cd){return function(_0x538a09){if(_0x538a09){var _0x2224e8=typeof _0x31c0cd['offset']==='undefined'&&typeof _0x31c0cd[_0x2041('0x20')]==='undefined';var _0x3ed72b=_0x538a09[_0x2041('0x21')];var _0x52a109=_0x2224e8?0x0:_0x31c0cd[_0x2041('0x22')];var _0x1cece3=_0x2224e8?_0x538a09[_0x2041('0x21')]:_0x31c0cd['offset']+_0x31c0cd[_0x2041('0x20')];var _0x279051;if(_0x1cece3>=_0x3ed72b){_0x1cece3=_0x3ed72b;_0x279051=0xc8;}else{_0x279051=0xce;}_0x135bbc[_0x2041('0x1d')](_0x279051);return _0x135bbc[_0x2041('0x23')](_0x2041('0x24'),_0x52a109+'-'+_0x1cece3+'/'+_0x3ed72b)['json'](_0x538a09);}return null;};}function patchUpdates(_0x24c721){return function(_0x17c870){try{jsonpatch[_0x2041('0x25')](_0x17c870,_0x24c721,!![]);}catch(_0x562fcf){return BPromise['reject'](_0x562fcf);}return _0x17c870[_0x2041('0x26')]();};}function saveUpdates(_0x51e093,_0x4e6ca4){return function(_0x3b044d){if(_0x3b044d){return _0x3b044d[_0x2041('0x27')](_0x51e093)[_0x2041('0x28')](function(_0x38be9f){return _0x38be9f;});}return null;};}function removeEntity(_0x516c3e,_0x22b9d1){return function(_0x52c6a7){if(_0x52c6a7){return _0x52c6a7[_0x2041('0x29')]()[_0x2041('0x28')](function(){_0x516c3e[_0x2041('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7ff2,_0x259206){return function(_0x49b89b){if(!_0x49b89b){_0x3e7ff2['sendStatus'](0x194);}return _0x49b89b;};}function handleError(_0x3b086c,_0x2a846a){_0x2a846a=_0x2a846a||0x1f4;return function(_0x1d0915){logger[_0x2041('0x2a')](_0x1d0915['stack']);if(_0x1d0915[_0x2041('0x2b')]){delete _0x1d0915[_0x2041('0x2b')];}_0x3b086c[_0x2041('0x1d')](_0x2a846a)[_0x2041('0x2c')](_0x1d0915);};}function getInteractionUsers(_0x2657e6,_0x58c9bb){return new BPromise(function(_0x2c5f6f,_0x3112fd){try{if(_0x58c9bb[_0x2657e6['id']]){_0x2657e6[_0x2041('0x2d')]=_[_0x2041('0x2e')](_0x58c9bb[_0x2657e6['id']],function(_0x31ac72){return{'id':_0x31ac72['id'],'fullname':_0x31ac72[_0x2041('0x2f')]};});}}catch(_0xd20767){_0x3112fd(_0xd20767);}_0x2c5f6f(_0x2657e6);});}function getInteractionTags(_0x3a3a0f,_0x42a7c3){return new BPromise(function(_0x407c1c,_0x363a4d){try{if(_0x3a3a0f[_0x2041('0x30')]){_0x3a3a0f['Tags']=[];_0x3a3a0f[_0x2041('0x30')][_0x2041('0x31')](',')[_0x2041('0x32')](function(_0x166415){_0x3a3a0f[_0x2041('0x33')][_0x2041('0x34')](_0x42a7c3[_0x166415]);});}delete _0x3a3a0f['TagIds'];}catch(_0x434397){_0x363a4d(_0x434397);}_0x407c1c(_0x3a3a0f);});}function updateWhatsappInteraction(_0x28c163,_0x85276c,_0x1dfc58){return new BPromise(function(_0x4edc5d,_0x224833){return getInteractionUsers(_0x28c163,_0x1dfc58)[_0x2041('0x28')](function(_0x2493e6){return getInteractionTags(_0x2493e6,_0x85276c);})[_0x2041('0x28')](function(_0x54b686){_0x4edc5d(_0x54b686);})['catch'](function(_0x11467b){_0x224833(_0x11467b);});});}exports[_0x2041('0x35')]=function(_0x31b20b,_0x11d288){var _0x57bff6={},_0x1c5f99={},_0x54139b={'count':0x0,'rows':[]};var _0x1ea4c9=_[_0x2041('0x2e')](db[_0x2041('0x36')][_0x2041('0x37')],function(_0xe95322){return{'name':_0xe95322['fieldName'],'type':_0xe95322['type']['key']};});_0x1c5f99['model']=_[_0x2041('0x2e')](_0x1ea4c9,_0x2041('0x2b'));_0x1c5f99[_0x2041('0x38')]=_[_0x2041('0x39')](_0x31b20b[_0x2041('0x38')]);_0x1c5f99['filters']=_[_0x2041('0x3a')](_0x1c5f99[_0x2041('0x3b')],_0x1c5f99['query']);_0x57bff6[_0x2041('0x3c')]=_['intersection'](_0x1c5f99[_0x2041('0x3b')],qs[_0x2041('0x3d')](_0x31b20b['query'][_0x2041('0x3d')]));_0x57bff6[_0x2041('0x3c')]=_0x57bff6[_0x2041('0x3c')][_0x2041('0x3e')]?_0x57bff6[_0x2041('0x3c')]:_0x1c5f99[_0x2041('0x3b')];if(!_0x31b20b[_0x2041('0x38')][_0x2041('0x3f')](_0x2041('0x40'))){_0x57bff6[_0x2041('0x20')]=qs['limit'](_0x31b20b['query']['limit']);_0x57bff6['offset']=qs['offset'](_0x31b20b['query'][_0x2041('0x22')]);}_0x57bff6[_0x2041('0x41')]=qs[_0x2041('0x42')](_0x31b20b['query']['sort']);_0x57bff6[_0x2041('0x43')]=qs['filters'](_[_0x2041('0x44')](_0x31b20b[_0x2041('0x38')],_0x1c5f99[_0x2041('0x45')]),_0x1ea4c9);var _0x3d64fd=[];var _0x51e0c7=squel[_0x2041('0x46')]()[_0x2041('0x47')]('id')['field'](_0x2041('0x2b'))[_0x2041('0x47')]('color')[_0x2041('0x48')](_0x2041('0x49'));var _0x12f965=squel['select']()[_0x2041('0x47')](_0x2041('0x4a'))['field'](_0x2041('0x4b'))[_0x2041('0x47')](_0x2041('0x4c'))[_0x2041('0x48')]('user_has_whatsapp_interactions','ui')[_0x2041('0x4d')](_0x2041('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x2ad8b6=squel['select']()[_0x2041('0x48')](_0x2041('0x4f'),'i')[_0x2041('0x4d')](_0x2041('0x50'),'c',_0x2041('0x51'))[_0x2041('0x4d')](_0x2041('0x4e'),'o','o.id\x20=\x20i.UserId')[_0x2041('0x4d')](_0x2041('0x52'),'a',_0x2041('0x53'))[_0x2041('0x4d')](_0x2041('0x54'),'me',_0x2041('0x55'))[_0x2041('0x4d')](_0x2041('0x56'),'it',_0x2041('0x57'))[_0x2041('0x4d')](_0x2041('0x49'),'t',_0x2041('0x58'));var _0xc60a43=squel['expr']();var _0x11fb34=[];var _0x174463=squel[_0x2041('0x59')]();var _0x34f7eb;if(_0x31b20b[_0x2041('0x38')][_0x2041('0x5a')]){_0x34f7eb=as[_0x2041('0x5b')](_0x31b20b[_0x2041('0x38')]['search']);var _0x2af5ba=_0x34f7eb[_0x2041('0x5c')];for(var _0xf1f651=0x0;_0xf1f651<_0x34f7eb[_0x2041('0x5d')]['length'];_0xf1f651++){var _0x3e3fa7=_0x34f7eb[_0x2041('0x5d')][_0xf1f651];var _0x143f05='i';var _0x2eb0c2=_[_0x2041('0x5e')](_0x1ea4c9,[_0x2041('0x2b'),_0x3e3fa7[_0x2041('0x47')]]);if(!_0x2eb0c2){switch(_0x3e3fa7[_0x2041('0x47')]){case _0x2041('0x5f'):if(_0x3e3fa7[_0x2041('0x60')]==0x1){_0x2ad8b6[_0x2041('0x61')]('`'+_0x3e3fa7[_0x2041('0x47')]+'`\x20=\x200');}else{_0x2ad8b6[_0x2041('0x61')]('`'+_0x3e3fa7['field']+_0x2041('0x62'));}break;case _0x2041('0x63'):if(_0x3e3fa7[_0x2041('0x64')]===_0x2041('0x65')){if(_0x3e3fa7[_0x2041('0x60')][_0x2041('0x31')]('\x20')[_0x2041('0x3e')]>0x1){_0xc60a43[_0x2af5ba](_0x2041('0x66'),qs[_0x2041('0x67')](_0x3e3fa7['value']),null);}else{var _0x30d523='%'+_0x3e3fa7[_0x2041('0x60')]+'%';_0xc60a43[_0x2af5ba](_0x2041('0x68'),_0x30d523,_0x30d523,_0x30d523);}}else{_0x2eb0c2=_[_0x2041('0x5e')](_0x1ea4c9,[_0x2041('0x2b'),_0x2041('0x69')]);_0x3e3fa7[_0x2041('0x47')]='ContactId';_0x238161=as[_0x2041('0x6a')](_0x143f05,_0x2eb0c2[_0x2041('0x6b')],_0x3e3fa7);_0xc60a43[_0x2af5ba](_0x238161[_0x2041('0x6c')],_0x238161[_0x2041('0x60')]['start'],_0x238161[_0x2041('0x60')][_0x2041('0x1e')]);}break;case'Tag':var _0x2ced0e=_0x3e3fa7[_0x2041('0x60')]['split'](',')['map'](function(_0x230cc3){return Number(_0x230cc3);});_0x2ced0e[_0x2041('0x32')](function(_0x412464){_0x174463['or'](_0x2041('0x6d'),'%,'+_0x412464+',%');});_0x11fb34=_[_0x2041('0x6e')](_0x11fb34,_0x2ced0e);break;case'User':if(_0x3e3fa7['operator']===_0x2041('0x65')){_0xc60a43[_0x2af5ba]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3e3fa7[_0x2041('0x60')]+'%',null);}else{_0x2eb0c2=_['find'](_0x1ea4c9,['name',_0x2041('0x6f')]);_0x3e3fa7['field']=_0x2041('0x6f');_0x238161=as[_0x2041('0x6a')](_0x143f05,_0x2eb0c2[_0x2041('0x6b')],_0x3e3fa7);_0xc60a43[_0x2af5ba](_0x238161[_0x2041('0x6c')],_0x238161[_0x2041('0x60')][_0x2041('0x70')],_0x238161[_0x2041('0x60')]['end']);}break;case _0x2041('0x71'):_0x238161=as[_0x2041('0x6a')]('me',null,_0x3e3fa7);_0xc60a43[_0x2af5ba](_0x238161[_0x2041('0x6c')],_0x238161[_0x2041('0x60')][_0x2041('0x70')],_0x238161[_0x2041('0x60')][_0x2041('0x1e')]);break;}}else{var _0x238161=as[_0x2041('0x6a')](_0x143f05,_0x2eb0c2[_0x2041('0x6b')],_0x3e3fa7);_0xc60a43[_0x2af5ba](_0x238161['text'],_0x238161[_0x2041('0x60')][_0x2041('0x70')],_0x238161['value'][_0x2041('0x1e')]);}}}else{var _0x1c7e73=_(_0x31b20b[_0x2041('0x38')])['keys']()[_0x2041('0x2e')](function(_0x3cbd58){return _['some'](_0x1ea4c9,[_0x2041('0x2b'),_0x3cbd58])?_0x3cbd58:undefined;})[_0x2041('0x72')]()[_0x2041('0x60')]();if(!_[_0x2041('0x73')](_0x1c7e73)){_0x1c7e73['forEach'](function(_0x5cdbda){if(_0x5cdbda===_0x2041('0x74')){_0x2ad8b6[_0x2041('0x43')]('i.WhatsappAccountId\x20IN\x20?',[][_0x2041('0x75')](_0x31b20b[_0x2041('0x38')][_0x5cdbda]));}else if(_0x5cdbda===_0x2041('0x76')){var _0x1648b6=JSON[_0x2041('0x77')](_0x31b20b[_0x2041('0x38')][_0x5cdbda])[_0x2041('0x78')];var _0x23c70a=JSON['parse'](_0x31b20b[_0x2041('0x38')][_0x5cdbda])['$lte'];_0x2ad8b6[_0x2041('0x43')](_0x2041('0x79'),_0x1648b6,_0x23c70a);}else{if(_0x31b20b[_0x2041('0x38')][_0x5cdbda]===_0x2041('0x7a')){_0x2ad8b6[_0x2041('0x43')]('i.'+_0x5cdbda+'\x20IS\x20NULL');}else{_0x2ad8b6[_0x2041('0x43')]('i.'+_0x5cdbda+_0x2041('0x7b'),_0x31b20b['query'][_0x5cdbda]);}}});}if(_0x31b20b['query'][_0x2041('0x7c')]){if(_0x31b20b[_0x2041('0x38')][_0x2041('0x7c')]==0x1){_0x2ad8b6[_0x2041('0x61')](_0x2041('0x7d'));}else{_0x2ad8b6['having'](_0x2041('0x7e'));}}if(_0x31b20b[_0x2041('0x38')][_0x2041('0x7f')]){_0x11fb34=_[_0x2041('0x80')](_0x31b20b[_0x2041('0x38')]['tag'])?_0x31b20b['query'][_0x2041('0x7f')]:new Array(_0x31b20b[_0x2041('0x38')]['tag']);_0x11fb34['forEach'](function(_0x36f83e){_0x174463['or'](_0x2041('0x6d'),'%,'+_0x36f83e+',%');});}if(_0x31b20b[_0x2041('0x38')][_0x2041('0x81')]){var _0x269230=_0x31b20b[_0x2041('0x38')][_0x2041('0x81')][_0x2041('0x82')]('\x5c','\x5c\x5c')[_0x2041('0x82')](/'/g,'\x27\x27');if(qs[_0x2041('0x83')](_0x269230)){_0xc60a43['or'](_0x2041('0x84'),_0x269230+'%')['or']('i.phone\x20LIKE\x20?',_0x269230+'%');}else{_0xc60a43['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2041('0x67')](_0x269230))['or'](_0x2041('0x85'),_0x269230+'%');}}}_0x2ad8b6[_0x2041('0x43')](_0xc60a43);_0x2ad8b6[_0x2041('0x86')]('i.id');var _0x31d0b8={'type':db[_0x2041('0x87')][_0x2041('0x88')][_0x2041('0x89')],'raw':!![]};var _0xc62f58=_0x2ad8b6[_0x2041('0x8a')]();_0xc62f58[_0x2041('0x47')](_0x2041('0x8b'));_0xc62f58[_0x2041('0x47')](_0x2041('0x8c'),_0x2041('0x5f'));if(_0x57bff6[_0x2041('0x41')]){_0x57bff6[_0x2041('0x41')]['forEach'](function(_0x32caf1){var _0xd34e05=_0x32caf1[0x0]==='contactName'?_0x32caf1[0x0]:'i.'+_0x32caf1[0x0];_0x2ad8b6['order'](_0xd34e05,_0x32caf1[0x1]===_0x2041('0x8d')?![]:!![]);});}if(!_[_0x2041('0x73')](_0x11fb34)){_0x2ad8b6[_0x2041('0x61')](_0x174463);_0xc62f58[_0x2041('0x43')](_0x2041('0x8e'),_0x11fb34);}BPromise[_0x2041('0x8f')]()[_0x2041('0x28')](function(){if(!_0x34f7eb){if(_0x31b20b[_0x2041('0x38')][_0x2041('0x74')])return;_0xc62f58['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x2ad8b6[_0x2041('0x43')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x31b20b[_0x2041('0x90')][_0x2041('0x91')]!==_0x2041('0x92'))return;return _0x31b20b[_0x2041('0x90')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x2041('0x28')](function(_0x38b993){if(_['isEmpty'](_0x38b993)){_0xc62f58[_0x2041('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');_0x2ad8b6[_0x2041('0x43')](_0x2041('0x93'));}else{_0xc62f58[_0x2041('0x43')](_0x2041('0x94'),_[_0x2041('0x2e')](_0x38b993,'id'));_0x2ad8b6[_0x2041('0x43')](_0x2041('0x94'),_[_0x2041('0x2e')](_0x38b993,'id'));}});})[_0x2041('0x28')](function(){if(_0x31b20b[_0x2041('0x90')][_0x2041('0x91')]===_0x2041('0x92')&&!_0x34f7eb&&!_0x31b20b[_0x2041('0x38')][_0x2041('0x74')])return[];return db[_0x2041('0x95')][_0x2041('0x38')](_0xc62f58[_0x2041('0x96')](),_0x31d0b8);})[_0x2041('0x28')](function(_0x2a7e26){_0x54139b[_0x2041('0x21')]=_0x2a7e26[_0x2041('0x3e')];if(_0x54139b[_0x2041('0x21')]===0x0)return[];return db['sequelize'][_0x2041('0x38')](_0x51e0c7[_0x2041('0x96')](),_0x31d0b8)[_0x2041('0x28')](function(_0x329e65){_0x3d64fd=_[_0x2041('0x97')](_0x329e65,'id');_0x31d0b8=_['merge'](_0x31d0b8,{'model':db[_0x2041('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31b20b[_0x2041('0x38')][_0x2041('0x3d')]){_0x57bff6[_0x2041('0x3c')][_0x2041('0x32')](function(_0x103912){_0x2ad8b6[_0x2041('0x47')]('i.'+_0x103912);});}else{_0x2ad8b6['field'](_0x2041('0x8c'),_0x2041('0x5f'));_0x2ad8b6[_0x2041('0x47')](_0x2041('0x98'),_0x2041('0x99'));_0x2ad8b6[_0x2041('0x47')](_0x2041('0x9a'),_0x2041('0x9b'));_0x2ad8b6[_0x2041('0x47')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x2041('0x9c'));_0x2ad8b6[_0x2041('0x47')](_0x2041('0x9d'));_0x2ad8b6[_0x2041('0x47')](_0x2041('0x9e'),_0x2041('0x9f'));_0x2ad8b6[_0x2041('0x47')](_0x2041('0xa0'),_0x2041('0xa1'));_0x2ad8b6[_0x2041('0x47')]('c.email','Contact.email');_0x2ad8b6[_0x2041('0x47')](_0x2041('0xa2'),'Contact.phone');_0x2ad8b6[_0x2041('0x47')](_0x2041('0xa3'),'Contact.mobile');_0x2ad8b6[_0x2041('0x47')](_0x2041('0xa4'),'Contact.fax');_0x2ad8b6['field'](_0x2041('0xa5'),'Owner.fullname');_0x2ad8b6[_0x2041('0x47')](_0x2041('0xa6'),_0x2041('0xa7'));_0x2ad8b6[_0x2041('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2041('0x30'));}if(_0x57bff6[_0x2041('0x20')])_0x2ad8b6[_0x2041('0x20')](_0x57bff6[_0x2041('0x20')]);if(_0x57bff6['offset'])_0x2ad8b6['offset'](_0x57bff6['offset']);return db[_0x2041('0x95')]['query'](_0x2ad8b6[_0x2041('0x96')](),_0x31d0b8);})['then'](function(_0x156171){if(_0x156171[_0x2041('0x3e')]>0x0)_0x12f965[_0x2041('0x43')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x2041('0x2e')](_0x156171,'id'));return db[_0x2041('0x95')][_0x2041('0x38')](_0x12f965['toString'](),_0x31d0b8)[_0x2041('0x28')](function(_0x333de7){var _0x324db2=_[_0x2041('0xa8')](_0x333de7,_0x2041('0xa9'));var _0x24a691=[];_0x156171[_0x2041('0x32')](function(_0xed3e4b){_0x24a691['push'](updateWhatsappInteraction(_0xed3e4b,_0x3d64fd,_0x324db2));});return BPromise[_0x2041('0xaa')](_0x24a691);});});})[_0x2041('0x28')](function(_0x21bad9){_0x54139b[_0x2041('0xab')]=_0x21bad9;return _0x54139b;})[_0x2041('0x28')](respondWithFilteredResult(_0x11d288,_0x57bff6))[_0x2041('0xac')](handleError(_0x11d288,null));};exports[_0x2041('0xad')]=function(_0x3366c1,_0x11a351){var _0x4c85be={'raw':![],'where':{'id':_0x3366c1[_0x2041('0xae')]['id']}},_0x55f862={};_0x55f862['model']=_[_0x2041('0x39')](db[_0x2041('0x36')][_0x2041('0x37')]);_0x55f862[_0x2041('0x38')]=_['keys'](_0x3366c1[_0x2041('0x38')]);_0x55f862[_0x2041('0x45')]=_[_0x2041('0x3a')](_0x55f862[_0x2041('0x3b')],_0x55f862[_0x2041('0x38')]);_0x4c85be[_0x2041('0x3c')]=_[_0x2041('0x3a')](_0x55f862['model'],qs[_0x2041('0x3d')](_0x3366c1[_0x2041('0x38')][_0x2041('0x3d')]));_0x4c85be['attributes']=_0x4c85be[_0x2041('0x3c')][_0x2041('0x3e')]?_0x4c85be[_0x2041('0x3c')]:_0x55f862[_0x2041('0x3b')];if(_0x3366c1[_0x2041('0x38')][_0x2041('0xaf')]){_0x4c85be[_0x2041('0xb0')]=[{'all':!![]}];}_0x4c85be=_[_0x2041('0xb1')]({},_0x4c85be,_0x3366c1[_0x2041('0xb2')]);return db[_0x2041('0x36')]['find'](_0x4c85be)[_0x2041('0x28')](handleEntityNotFound(_0x11a351,null))['then'](respondWithResult(_0x11a351,null))[_0x2041('0xac')](handleError(_0x11a351,null));};exports[_0x2041('0xb3')]=function(_0x591793,_0x58fa1e){return db['WhatsappInteraction']['create'](_0x591793[_0x2041('0x71')],{})['then'](respondWithResult(_0x58fa1e,0xc9))['catch'](handleError(_0x58fa1e,null));};exports[_0x2041('0x27')]=function(_0x494b9e,_0x39c105){if(_0x494b9e[_0x2041('0x71')]['id']){delete _0x494b9e[_0x2041('0x71')]['id'];}return db[_0x2041('0x36')][_0x2041('0x5e')]({'where':{'id':_0x494b9e[_0x2041('0xae')]['id']}})[_0x2041('0x28')](handleEntityNotFound(_0x39c105,null))[_0x2041('0x28')](saveUpdates(_0x494b9e[_0x2041('0x71')],null))[_0x2041('0x28')](respondWithResult(_0x39c105,null))[_0x2041('0xac')](handleError(_0x39c105,null));};exports[_0x2041('0x29')]=function(_0x2a1b5e,_0x3556d5){return db['WhatsappInteraction'][_0x2041('0x5e')]({'where':{'id':_0x2a1b5e['params']['id']}})[_0x2041('0x28')](handleEntityNotFound(_0x3556d5,null))[_0x2041('0x28')](removeEntity(_0x3556d5,null))[_0x2041('0xac')](handleError(_0x3556d5,null));};exports[_0x2041('0xb4')]=function(_0x556044,_0x412d29){return db[_0x2041('0x36')]['describe']()[_0x2041('0x28')](respondWithResult(_0x412d29,null))[_0x2041('0xac')](handleError(_0x412d29,null));};exports['addMessage']=function(_0x20a9d7,_0x3689d0,_0x5b26f1){return db[_0x2041('0xb5')][_0x2041('0x5e')]({'where':{'id':_0x20a9d7['params']['id']}})['then'](handleEntityNotFound(_0x3689d0,null))[_0x2041('0x28')](function(_0x121314){if(_0x121314){return _0x121314['addMessage'](_0x20a9d7[_0x2041('0x71')]['ids'],_['omit'](_0x20a9d7[_0x2041('0x71')],[_0x2041('0xb6'),'id'])||{});}})[_0x2041('0x28')](respondWithResult(_0x3689d0,null))[_0x2041('0xac')](handleError(_0x3689d0,null));};exports[_0x2041('0xb7')]=function(_0x431188,_0x36ca33,_0x1167df){var _0x38637f={'raw':![],'where':{}};var _0x63c08e={};var _0x229964={'count':0x0,'rows':[]};return db[_0x2041('0x36')]['findOne']({'where':{'id':_0x431188['params']['id']}})[_0x2041('0x28')](handleEntityNotFound(_0x36ca33,null))[_0x2041('0x28')](function(_0x35ab1a){if(_0x35ab1a){_0x63c08e['model']=_['keys'](db['WhatsappMessage'][_0x2041('0x37')]);_0x63c08e['query']=_['keys'](_0x431188[_0x2041('0x38')]);_0x63c08e[_0x2041('0x45')]=_[_0x2041('0x3a')](_0x63c08e[_0x2041('0x3b')],_0x63c08e['query']);_0x38637f['attributes']=_[_0x2041('0x3a')](_0x63c08e[_0x2041('0x3b')],qs['fields'](_0x431188['query']['fields']));_0x38637f[_0x2041('0x3c')]=_0x38637f[_0x2041('0x3c')]['length']?_0x38637f['attributes']:_0x63c08e[_0x2041('0x3b')];if(!_0x431188[_0x2041('0x38')][_0x2041('0x3f')]('nolimit')){_0x38637f[_0x2041('0x20')]=qs[_0x2041('0x20')](_0x431188[_0x2041('0x38')]['limit']);_0x38637f[_0x2041('0x22')]=qs[_0x2041('0x22')](_0x431188[_0x2041('0x38')]['offset']);}_0x38637f[_0x2041('0x41')]=qs[_0x2041('0x42')](_0x431188[_0x2041('0x38')][_0x2041('0x42')]);_0x38637f[_0x2041('0x43')]=qs[_0x2041('0x45')](_[_0x2041('0x44')](_0x431188[_0x2041('0x38')],_0x63c08e['filters']));_0x38637f['where'][_0x2041('0xa9')]=_0x35ab1a['id'];if(_0x431188[_0x2041('0x38')][_0x2041('0x81')]){_0x38637f[_0x2041('0x43')]=_[_0x2041('0xb1')](_0x38637f[_0x2041('0x43')],{'$or':_['map'](_0x38637f[_0x2041('0x3c')],function(_0x3163e3){var _0x4133f7={};_0x4133f7[_0x3163e3]={'$like':'%'+_0x431188[_0x2041('0x38')]['filter']+'%'};return _0x4133f7;})});}if(_0x431188['query']['$gte']){var _0x409277=_0x431188['query'][_0x2041('0x78')][_0x2041('0x31')](',');var _0xa471d4={};_0xa471d4[_0x409277[0x0]]={'$gte':moment(_0x409277[0x1])[_0x2041('0xb8')](_0x2041('0xb9'))};_0x38637f[_0x2041('0x43')]=_[_0x2041('0xb1')](_0x38637f['where'],_0xa471d4);}_0x38637f=_[_0x2041('0xb1')]({},_0x38637f,_0x431188[_0x2041('0xb2')]);return db[_0x2041('0xb5')][_0x2041('0x21')]({'where':_0x38637f['where']})['then'](function(_0x189a36){_0x229964['count']=_0x189a36;if(_0x431188[_0x2041('0x38')][_0x2041('0xaf')]){_0x38637f[_0x2041('0xb0')]=[{'all':!![]}];}return db[_0x2041('0xb5')]['findAll'](_0x38637f);})[_0x2041('0x28')](function(_0x1f7518){_0x229964['rows']=_0x1f7518;return _0x229964;});}})[_0x2041('0x28')](respondWithFilteredResult(_0x36ca33,_0x38637f))[_0x2041('0xac')](handleError(_0x36ca33,null));};exports[_0x2041('0xba')]=function(_0x3c160f,_0x40870d,_0x400b3e){return db[_0x2041('0x36')][_0x2041('0x5e')]({'where':{'id':_0x3c160f[_0x2041('0xae')]['id']}})['then'](handleEntityNotFound(_0x40870d,null))[_0x2041('0x28')](function(_0x25d525){if(_0x25d525){return _0x25d525[_0x2041('0xbb')](_0x3c160f['body']['ids'],_[_0x2041('0xbc')](_0x3c160f[_0x2041('0x71')],['ids','id'])||{})[_0x2041('0xbd')](function(){return db[_0x2041('0xbe')][_0x2041('0xbf')]({'attributes':['id',_0x2041('0x2b'),_0x2041('0xc0')],'where':{'id':_0x3c160f['body'][_0x2041('0xb6')]}});})[_0x2041('0x28')](function(_0x300696){socket[_0x2041('0xc1')]('whatsappInteractionTags:save',{'id':Number(_0x3c160f['params']['id']),'tags':_0x300696||[]});return{'id':Number(_0x3c160f[_0x2041('0xae')]['id']),'tags':_0x300696||[]};});}})[_0x2041('0x28')](respondWithResult(_0x40870d,null))[_0x2041('0xac')](handleError(_0x40870d,null));};exports[_0x2041('0xc2')]=function(_0x31dcb9,_0xa35db,_0x144cb4){return db[_0x2041('0x36')]['find']({'where':{'id':_0x31dcb9[_0x2041('0xae')]['id']}})[_0x2041('0x28')](handleEntityNotFound(_0xa35db,null))['then'](function(_0x280312){if(_0x280312){return _0x280312[_0x2041('0xc2')](_0x31dcb9[_0x2041('0x38')][_0x2041('0xb6')]);}})[_0x2041('0x28')](respondWithStatusCode(_0xa35db,null))['catch'](handleError(_0xa35db,null));};exports[_0x2041('0xc3')]=function(_0x2540cd,_0x925cd8){var _0x4b97db=moment()[_0x2041('0xc4')]()['toString']();var _0x1cdb05=path[_0x2041('0xc5')](config[_0x2041('0xc6')],_0x2041('0xc7'),_0x2041('0xc8'),_0x2041('0xc9'));var _0x2bbc9c=path['join'](config['root'],'server',_0x2041('0xc8'),_0x2041('0xca'));var _0x1ca6b8=path[_0x2041('0xc5')](_0x1cdb05,_0x4b97db);var _0x20605e=util[_0x2041('0xb8')](_0x2041('0xcb'),_0x2540cd['params']['id'],_0x4b97db);var _0x245608=path[_0x2041('0xc5')](_0x1cdb05,_0x20605e);var _0x51a5d2=[];_0x51a5d2[_0x2041('0x34')]({'model':db['User'],'as':'User','attributes':['id',_0x2041('0x2f')],'raw':!![]});_0x51a5d2[_0x2041('0x34')]({'model':db[_0x2041('0xcc')],'as':_0x2041('0x63'),'attributes':['id',_0x2041('0xcd'),_0x2041('0xce')],'raw':!![]});if(_0x2540cd[_0x2041('0x38')][_0x2041('0xca')]){_0x51a5d2[_0x2041('0x34')]({'model':db[_0x2041('0xcf')],'as':_0x2041('0xcf'),'raw':!![]});}var _0x26276d=[{'model':db['WhatsappMessage'],'as':_0x2041('0xd0'),'attributes':['id',_0x2041('0x71'),_0x2041('0x76'),_0x2041('0xd1'),'secret',_0x2041('0x7c')],'include':_0x51a5d2}];_0x26276d[_0x2041('0x34')]({'model':db[_0x2041('0xd2')],'as':'Account','attributes':['id',_0x2041('0x2b')]});_0x26276d[_0x2041('0x34')]({'model':db['User'],'as':_0x2041('0xd3'),'attributes':['id',_0x2041('0x2f')]});return db['WhatsappInteraction'][_0x2041('0x5e')]({'where':{'id':_0x2540cd[_0x2041('0xae')]['id']},'include':_0x26276d})[_0x2041('0x28')](handleEntityNotFound(_0x925cd8,null))[_0x2041('0x28')](function(_0x4eaafc){if(_0x4eaafc){var _0x354865=_0x4eaafc[_0x2041('0xd4')]({'plain':!![]});fs[_0x2041('0xd5')](_0x1ca6b8);var _0x178560={'channel':_0x2041('0xd6'),'account':_0x354865[_0x2041('0xd7')][_0x2041('0x2b')],'agent':_0x354865['Owner']?_0x354865[_0x2041('0xd3')][_0x2041('0x2f')]:_0x2041('0xd8'),'createdAt':moment(_0x354865[_0x2041('0x76')])['format'](_0x2041('0xb9'))[_0x2041('0x96')](),'closedAt':_0x354865[_0x2041('0xd9')]?moment(_0x354865[_0x2041('0xda')])[_0x2041('0xb8')](_0x2041('0xb9'))[_0x2041('0x96')]():'','disposition':_0x354865[_0x2041('0xdb')],'messages':_(_0x354865[_0x2041('0xd0')])['filter']({'secret':![]})['map'](function(_0x3629d5){if(_0x3629d5[_0x2041('0xcf')]){var _0x19683f=path[_0x2041('0xc5')](_0x2bbc9c,_0x3629d5[_0x2041('0xcf')][_0x2041('0xdc')]);if(fs[_0x2041('0xdd')](_0x19683f)){fs[_0x2041('0xde')](_0x19683f)[_0x2041('0xdf')](fs[_0x2041('0xe0')](path[_0x2041('0xc5')](_0x1ca6b8,_0x3629d5[_0x2041('0xcf')][_0x2041('0xdc')])));}}return{'date':moment(_0x3629d5[_0x2041('0x76')])[_0x2041('0xb8')](_0x2041('0xb9'))[_0x2041('0x96')](),'sender':_0x3629d5[_0x2041('0xd1')]===_0x2041('0xe1')?_0x3629d5['User']?_0x3629d5['User'][_0x2041('0x2f')]:'System':_0x3629d5['Contact'][_0x2041('0xcd')]+(_0x3629d5[_0x2041('0x63')][_0x2041('0xce')]?'\x20'+_0x3629d5[_0x2041('0x63')][_0x2041('0xce')]:''),'body':_0x3629d5[_0x2041('0xcf')]?_0x3629d5[_0x2041('0xcf')]['basename']:_0x3629d5[_0x2041('0x71')],'direction':_0x3629d5[_0x2041('0xd1')]===_0x2041('0xe1')?'A':'C','secret':_0x3629d5[_0x2041('0xe2')],'read':_0x3629d5['read'],'attachment':_0x3629d5[_0x2041('0xcf')]};})[_0x2041('0x60')]()};return ejs['renderFile'](path[_0x2041('0xc5')](config['root'],'server',_0x2041('0xe3'),_0x2041('0xe4')),{'interaction':_0x178560})[_0x2041('0x28')](function(_0x1b3ab9){var _0x4cdfe7=path[_0x2041('0xc5')](_0x1ca6b8,'transcript-'+_0x354865['id']+'-'+_0x4b97db+'.pdf');var _0x203fad={'path':_0x4cdfe7,'channel':_0x2041('0xd6'),'interactionId':_0x354865['id']};return pdf[_0x2041('0xe5')](_0x1b3ab9,_0x203fad);})[_0x2041('0x28')](function(){return new BPromise(function(_0x165f95,_0x5509dc){zipdir(_0x1ca6b8,{'saveTo':_0x245608},function(_0x299423,_0x3e8aed){if(_0x299423)return _0x5509dc(_0x299423);return _0x165f95(_0x3e8aed);});})[_0x2041('0x28')](function(){return new BPromise(function(_0x34fb5a,_0x223eff){rimraf(_0x1ca6b8,function(_0x55dd75){if(_0x55dd75)_0x223eff(_0x55dd75);return _0x34fb5a();});});})['then'](function(){return _0x925cd8['download'](_0x245608,_0x20605e,function(_0xf334fd){if(_0xf334fd){console[_0x2041('0xe6')](_0x2041('0xe7'),_0xf334fd);}else{fs['unlinkSync'](_0x245608);}});});});}else{return _0x925cd8['sendStatus'](0xc8);}})['catch'](handleError(_0x925cd8,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index f3c3d11..e284ca6 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 _0xfd07=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x5e66f7,_0x24b8da){var _0x10dcfe=function(_0x311b73){while(--_0x311b73){_0x5e66f7['push'](_0x5e66f7['shift']());}};_0x10dcfe(++_0x24b8da);}(_0xfd07,0x104));var _0x7fd0=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0xfd07[_0x335a62];return _0x249a9a;};'use strict';var EventEmitter=require(_0x7fd0('0x0'));var WhatsappInteraction=require(_0x7fd0('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7fd0('0x2'),'afterUpdate':_0x7fd0('0x3'),'afterDestroy':_0x7fd0('0x4')};function emitEvent(_0x52de97){return function(_0x5b9167,_0x2a7ffe,_0x245329){_0x5b9167[_0x7fd0('0x5')]({'attributes':['id'],'raw':!![]})[_0x7fd0('0x6')](function(_0x4fa939){_0x5b9167[_0x7fd0('0x7')](_0x7fd0('0x8'),_0x4fa939[_0x7fd0('0x9')](function(_0x5960c4){return{'id':_0x5960c4['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x5b9167['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7fd0('0x6')](function(_0x4f2dec){_0x5b9167[_0x7fd0('0x7')](_0x7fd0('0xa'),_0x4f2dec[_0x7fd0('0xb')]);WhatsappInteractionEvents[_0x7fd0('0xc')](_0x52de97+':'+_0x5b9167['id'],_0x5b9167);WhatsappInteractionEvents[_0x7fd0('0xc')](_0x52de97,_0x5b9167);_0x245329(null);})[_0x7fd0('0xd')](_0x245329(null));};}for(var e in events){if(events[_0x7fd0('0xe')](e)){var event=events[e];WhatsappInteraction[_0x7fd0('0xf')](e,emitEvent(event));}}module[_0x7fd0('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x9e9b=['WhatsappMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x9e9b[_0x817d9b];return _0x2752e1;};'use strict';var EventEmitter=require(_0xb9e9('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xb9e9('0x1'))['db'][_0xb9e9('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb9e9('0x3')](0x0);var events={'afterCreate':_0xb9e9('0x4'),'afterUpdate':'update','afterDestroy':_0xb9e9('0x5')};function emitEvent(_0x394a8e){return function(_0x557e37,_0x433bb4,_0x7b18d5){_0x557e37[_0xb9e9('0x6')]({'attributes':['id'],'raw':!![]})[_0xb9e9('0x7')](function(_0x3329cf){_0x557e37[_0xb9e9('0x8')](_0xb9e9('0x9'),_0x3329cf[_0xb9e9('0xa')](function(_0x127c61){return{'id':_0x127c61['id']};}));return WhatsappMessage[_0xb9e9('0xb')]({'where':{'WhatsappInteractionId':_0x557e37['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb9e9('0x7')](function(_0x4369b0){_0x557e37['setDataValue'](_0xb9e9('0xc'),_0x4369b0[_0xb9e9('0xd')]);WhatsappInteractionEvents['emit'](_0x394a8e+':'+_0x557e37['id'],_0x557e37);WhatsappInteractionEvents[_0xb9e9('0xe')](_0x394a8e,_0x557e37);_0x7b18d5(null);})[_0xb9e9('0xf')](_0x7b18d5(null));};}for(var e in events){if(events[_0xb9e9('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 f6a42d5..456cbc8 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 _0xe4f4=['closedAt','format','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x4c0f30,_0x26ff10){var _0x36a424=function(_0x3d0f62){while(--_0x3d0f62){_0x4c0f30['push'](_0x4c0f30['shift']());}};_0x36a424(++_0x26ff10);}(_0xe4f4,0x89));var _0x4e4f=function(_0x7e2c44,_0x1f04e8){_0x7e2c44=_0x7e2c44-0x0;var _0x315907=_0xe4f4[_0x7e2c44];return _0x315907;};'use strict';var _=require('lodash');var util=require(_0x4e4f('0x0'));var logger=require(_0x4e4f('0x1'))('api');var moment=require(_0x4e4f('0x2'));var BPromise=require(_0x4e4f('0x3'));var rp=require(_0x4e4f('0x4'));var fs=require('fs');var path=require(_0x4e4f('0x5'));var rimraf=require(_0x4e4f('0x6'));var config=require(_0x4e4f('0x7'));var attributes=require(_0x4e4f('0x8'));module['exports']=function(_0x404dfb,_0x1de125){return _0x404dfb['define'](_0x4e4f('0x9'),attributes,{'tableName':_0x4e4f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c4a5a,_0x4050fa,_0x74fc9){if(_0x4c4a5a[_0x4e4f('0xb')](_0x4e4f('0xc'))){_0x4c4a5a[_0x4e4f('0xd')]=moment()[_0x4e4f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x74fc9(null,_0x4c4a5a);}}});}; \ No newline at end of file +var _0x10aa=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x123355,_0x329a59){var _0x167777=function(_0x4bb7b0){while(--_0x4bb7b0){_0x123355['push'](_0x123355['shift']());}};_0x167777(++_0x329a59);}(_0x10aa,0x14b));var _0xa10a=function(_0x3ea087,_0x291e33){_0x3ea087=_0x3ea087-0x0;var _0x439735=_0x10aa[_0x3ea087];return _0x439735;};'use strict';var _=require(_0xa10a('0x0'));var util=require(_0xa10a('0x1'));var logger=require(_0xa10a('0x2'))(_0xa10a('0x3'));var moment=require(_0xa10a('0x4'));var BPromise=require(_0xa10a('0x5'));var rp=require(_0xa10a('0x6'));var fs=require('fs');var path=require(_0xa10a('0x7'));var rimraf=require(_0xa10a('0x8'));var config=require(_0xa10a('0x9'));var attributes=require(_0xa10a('0xa'));module[_0xa10a('0xb')]=function(_0x147a35,_0xe3e13a){return _0x147a35[_0xa10a('0xc')](_0xa10a('0xd'),attributes,{'tableName':_0xa10a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4732d9,_0x9ab9d7,_0x361a9a){if(_0x4732d9[_0xa10a('0xf')](_0xa10a('0x10'))){_0x4732d9[_0xa10a('0x11')]=moment()[_0xa10a('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x361a9a(null,_0x4732d9);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 08c15f4..a74b485 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 _0xb1f0=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','UpdateWhatsappInteraction','catch','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b7fce,_0x4d10b1){var _0x51f11b=function(_0x273284){while(--_0x273284){_0x4b7fce['push'](_0x4b7fce['shift']());}};_0x51f11b(++_0x4d10b1);}(_0xb1f0,0x1f4));var _0x0b1f=function(_0x1b2818,_0x5a0cc7){_0x1b2818=_0x1b2818-0x0;var _0x3e12b7=_0xb1f0[_0x1b2818];return _0x3e12b7;};'use strict';var _=require(_0x0b1f('0x0'));var util=require(_0x0b1f('0x1'));var moment=require(_0x0b1f('0x2'));var BPromise=require(_0x0b1f('0x3'));var rs=require(_0x0b1f('0x4'));var fs=require('fs');var Redis=require(_0x0b1f('0x5'));var db=require(_0x0b1f('0x6'))['db'];var utils=require(_0x0b1f('0x7'));var logger=require('../../config/logger')(_0x0b1f('0x8'));var config=require(_0x0b1f('0x9'));var jayson=require(_0x0b1f('0xa'));var client=jayson[_0x0b1f('0xb')][_0x0b1f('0xc')]({'port':0x232a});config[_0x0b1f('0xd')]=_[_0x0b1f('0xe')](config['redis'],{'host':_0x0b1f('0xf'),'port':0x18eb});var socket=require(_0x0b1f('0x10'))(new Redis(config['redis']));require(_0x0b1f('0x11'))[_0x0b1f('0x12')](socket);function respondWithRpcPromise(_0x1cdcb5,_0x3770d5,_0x45c016){return new BPromise(function(_0x8bba2,_0x544f89){return client['request'](_0x1cdcb5,_0x45c016)[_0x0b1f('0x13')](function(_0x3c0446){logger[_0x0b1f('0x14')](_0x0b1f('0x15'),_0x3770d5,_0x0b1f('0x16'));logger['debug'](_0x0b1f('0x17'),_0x3770d5,_0x0b1f('0x16'),JSON[_0x0b1f('0x18')](_0x3c0446));if(_0x3c0446[_0x0b1f('0x19')]){if(_0x3c0446[_0x0b1f('0x19')][_0x0b1f('0x1a')]===0x1f4){logger[_0x0b1f('0x19')](_0x0b1f('0x15'),_0x3770d5,_0x3c0446[_0x0b1f('0x19')]['message']);return _0x544f89(_0x3c0446[_0x0b1f('0x19')]['message']);}logger[_0x0b1f('0x19')](_0x0b1f('0x15'),_0x3770d5,_0x3c0446[_0x0b1f('0x19')][_0x0b1f('0x1b')]);return _0x8bba2(_0x3c0446[_0x0b1f('0x19')][_0x0b1f('0x1b')]);}else{logger[_0x0b1f('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x3770d5,_0x0b1f('0x16'));_0x8bba2(_0x3c0446[_0x0b1f('0x1c')][_0x0b1f('0x1b')]);}})['catch'](function(_0x5916ab){logger['error'](_0x0b1f('0x15'),_0x3770d5,_0x5916ab);_0x544f89(_0x5916ab);});});}exports['UpdateWhatsappInteraction']=function(_0x3f187f){var _0x4bec3f=this;return new Promise(function(_0x545dd7,_0xb379d){return db[_0x0b1f('0x1d')][_0x0b1f('0x1e')](_0x3f187f[_0x0b1f('0x1f')],{'raw':_0x3f187f[_0x0b1f('0x20')]?_0x3f187f[_0x0b1f('0x20')][_0x0b1f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f187f[_0x0b1f('0x20')]?_0x3f187f['options'][_0x0b1f('0x22')]||null:null,'attributes':_0x3f187f[_0x0b1f('0x20')]?_0x3f187f[_0x0b1f('0x20')][_0x0b1f('0x23')]||null:null,'limit':_0x3f187f[_0x0b1f('0x20')]?_0x3f187f['options'][_0x0b1f('0x24')]||null:null})['then'](function(_0x2e3c17){logger[_0x0b1f('0x14')]('UpdateWhatsappInteraction',_0x3f187f);logger[_0x0b1f('0x25')](_0x0b1f('0x26'),_0x3f187f,JSON[_0x0b1f('0x18')](_0x2e3c17));_0x545dd7(_0x2e3c17);})[_0x0b1f('0x27')](function(_0x106301){logger[_0x0b1f('0x19')](_0x0b1f('0x26'),_0x106301[_0x0b1f('0x1b')],_0x3f187f);_0xb379d(_0x4bec3f['error'](0x1f4,_0x106301[_0x0b1f('0x1b')]));});});};exports[_0x0b1f('0x28')]=function(_0x6cea52){return new Promise(function(_0x4c1c94,_0x5ab0cc){return db[_0x0b1f('0x1d')][_0x0b1f('0x29')]({'where':_0x6cea52['options']?_0x6cea52[_0x0b1f('0x20')][_0x0b1f('0x22')]||null:null})[_0x0b1f('0x13')](function(_0x2b0de4){if(_0x2b0de4){return _0x2b0de4['addTags'](_0x6cea52['body'][_0x0b1f('0x2a')],_[_0x0b1f('0x2b')](_0x6cea52[_0x0b1f('0x1f')],[_0x0b1f('0x2a'),'id'])||{});}})[_0x0b1f('0x2c')](function(_0x27dc8b){logger[_0x0b1f('0x14')]('AddTags',_0x6cea52);logger[_0x0b1f('0x25')](_0x0b1f('0x2d'),_0x6cea52,JSON[_0x0b1f('0x18')](_0x27dc8b));_0x4c1c94(_0x27dc8b);})['catch'](function(_0x1dae20){logger['error'](_0x0b1f('0x2d'),_0x1dae20[_0x0b1f('0x1b')],_0x6cea52);_0x5ab0cc(_this[_0x0b1f('0x19')](0x1f4,_0x1dae20[_0x0b1f('0x1b')]));});});}; \ No newline at end of file +var _0x7623=['ids','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags'];(function(_0x292893,_0x3cd21e){var _0x5a55ac=function(_0x420f8d){while(--_0x420f8d){_0x292893['push'](_0x292893['shift']());}};_0x5a55ac(++_0x3cd21e);}(_0x7623,0x80));var _0x3762=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0x7623[_0x23733d];return _0x4a9cc4;};'use strict';var _=require(_0x3762('0x0'));var util=require(_0x3762('0x1'));var moment=require(_0x3762('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3762('0x3'));var db=require(_0x3762('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3762('0x5'))(_0x3762('0x6'));var config=require('../../config/environment');var jayson=require(_0x3762('0x7'));var client=jayson[_0x3762('0x8')][_0x3762('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3762('0xa')],{'host':_0x3762('0xb'),'port':0x18eb});var socket=require(_0x3762('0xc'))(new Redis(config['redis']));require(_0x3762('0xd'))[_0x3762('0xe')](socket);function respondWithRpcPromise(_0x39c408,_0x336fc4,_0x5c8cf7){return new BPromise(function(_0x402772,_0x2a8d05){return client[_0x3762('0xf')](_0x39c408,_0x5c8cf7)[_0x3762('0x10')](function(_0x2b39e2){logger[_0x3762('0x11')](_0x3762('0x12'),_0x336fc4,'request\x20sent');logger[_0x3762('0x13')](_0x3762('0x14'),_0x336fc4,_0x3762('0x15'),JSON[_0x3762('0x16')](_0x2b39e2));if(_0x2b39e2['error']){if(_0x2b39e2['error'][_0x3762('0x17')]===0x1f4){logger['error'](_0x3762('0x12'),_0x336fc4,_0x2b39e2[_0x3762('0x18')][_0x3762('0x19')]);return _0x2a8d05(_0x2b39e2[_0x3762('0x18')][_0x3762('0x19')]);}logger[_0x3762('0x18')](_0x3762('0x12'),_0x336fc4,_0x2b39e2['error']['message']);return _0x402772(_0x2b39e2[_0x3762('0x18')]['message']);}else{logger[_0x3762('0x11')](_0x3762('0x12'),_0x336fc4,_0x3762('0x15'));_0x402772(_0x2b39e2[_0x3762('0x1a')]['message']);}})[_0x3762('0x1b')](function(_0x36036c){logger[_0x3762('0x18')](_0x3762('0x12'),_0x336fc4,_0x36036c);_0x2a8d05(_0x36036c);});});}exports['UpdateWhatsappInteraction']=function(_0x460d7c){var _0x32ac84=this;return new Promise(function(_0x18890b,_0x509c12){return db['WhatsappInteraction'][_0x3762('0x1c')](_0x460d7c[_0x3762('0x1d')],{'raw':_0x460d7c[_0x3762('0x1e')]?_0x460d7c[_0x3762('0x1e')][_0x3762('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x460d7c['options']?_0x460d7c['options'][_0x3762('0x20')]||null:null,'attributes':_0x460d7c['options']?_0x460d7c[_0x3762('0x1e')][_0x3762('0x21')]||null:null,'limit':_0x460d7c[_0x3762('0x1e')]?_0x460d7c[_0x3762('0x1e')][_0x3762('0x22')]||null:null})[_0x3762('0x10')](function(_0x2b4a66){logger[_0x3762('0x11')]('UpdateWhatsappInteraction',_0x460d7c);logger[_0x3762('0x13')](_0x3762('0x23'),_0x460d7c,JSON[_0x3762('0x16')](_0x2b4a66));_0x18890b(_0x2b4a66);})[_0x3762('0x1b')](function(_0x176b47){logger[_0x3762('0x18')](_0x3762('0x23'),_0x176b47['message'],_0x460d7c);_0x509c12(_0x32ac84[_0x3762('0x18')](0x1f4,_0x176b47['message']));});});};exports[_0x3762('0x24')]=function(_0x3979b1){return new Promise(function(_0x144c41,_0xe4d572){return db[_0x3762('0x25')][_0x3762('0x26')]({'where':_0x3979b1[_0x3762('0x1e')]?_0x3979b1[_0x3762('0x1e')][_0x3762('0x20')]||null:null})['then'](function(_0x12cc4d){if(_0x12cc4d){return _0x12cc4d[_0x3762('0x27')](_0x3979b1[_0x3762('0x1d')][_0x3762('0x28')],_['omit'](_0x3979b1[_0x3762('0x1d')],[_0x3762('0x28'),'id'])||{});}})['spread'](function(_0x2bfc64){logger[_0x3762('0x11')](_0x3762('0x29'),_0x3979b1);logger[_0x3762('0x13')](_0x3762('0x29'),_0x3979b1,JSON['stringify'](_0x2bfc64));_0x144c41(_0x2bfc64);})[_0x3762('0x1b')](function(_0x93cb9e){logger[_0x3762('0x18')](_0x3762('0x29'),_0x93cb9e['message'],_0x3979b1);_0xe4d572(_this[_0x3762('0x18')](0x1f4,_0x93cb9e[_0x3762('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 34e29b7..d322e27 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 _0x6863=['./whatsappInteraction.events','remove','update','emit','register','length','whatsappInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6863,0x134));var _0x3686=function(_0xb9464a,_0x11ca19){_0xb9464a=_0xb9464a-0x0;var _0x3273d2=_0x6863[_0xb9464a];return _0x3273d2;};'use strict';var WhatsappInteractionEvents=require(_0x3686('0x0'));var events=['save',_0x3686('0x1'),_0x3686('0x2')];function createListener(_0x46bd83,_0x47ba18){return function(_0x593020){_0x47ba18[_0x3686('0x3')](_0x46bd83,_0x593020);};}function removeListener(_0x437545,_0x4750cc){return function(){WhatsappInteractionEvents['removeListener'](_0x437545,_0x4750cc);};}exports[_0x3686('0x4')]=function(_0x43e602){for(var _0x43931c=0x0,_0x1c0813=events[_0x3686('0x5')];_0x43931c<_0x1c0813;_0x43931c++){var _0x32248c=events[_0x43931c];var _0xc0d843=createListener(_0x3686('0x6')+_0x32248c,_0x43e602);WhatsappInteractionEvents['on'](_0x32248c,_0xc0d843);}}; \ No newline at end of file +var _0x1647=['register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x41b4e2,_0x1a5cf3){var _0x991786=function(_0x31f101){while(--_0x31f101){_0x41b4e2['push'](_0x41b4e2['shift']());}};_0x991786(++_0x1a5cf3);}(_0x1647,0x136));var _0x7164=function(_0x801846,_0x33b830){_0x801846=_0x801846-0x0;var _0x456a96=_0x1647[_0x801846];return _0x456a96;};'use strict';var WhatsappInteractionEvents=require(_0x7164('0x0'));var events=[_0x7164('0x1'),_0x7164('0x2'),_0x7164('0x3')];function createListener(_0x14669c,_0x2e74fa){return function(_0x10c0f5){_0x2e74fa['emit'](_0x14669c,_0x10c0f5);};}function removeListener(_0x4bc8ba,_0x5f51bf){return function(){WhatsappInteractionEvents[_0x7164('0x4')](_0x4bc8ba,_0x5f51bf);};}exports[_0x7164('0x5')]=function(_0x160cf1){for(var _0x420add=0x0,_0x1b3c18=events['length'];_0x420add<_0x1b3c18;_0x420add++){var _0x1bb3dc=events[_0x420add];var _0x70f454=createListener(_0x7164('0x6')+_0x1bb3dc,_0x160cf1);WhatsappInteractionEvents['on'](_0x1bb3dc,_0x70f454);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 2e6dc47..b24bf51 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 _0xebc5=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','update','accept','/:id/reject','delete','destroy','exports'];(function(_0xd7465d,_0x4fc020){var _0x389d2a=function(_0x5512d2){while(--_0x5512d2){_0xd7465d['push'](_0xd7465d['shift']());}};_0x389d2a(++_0x4fc020);}(_0xebc5,0x196));var _0x5ebc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xebc5[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x5ebc('0x0'));var util=require(_0x5ebc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ebc('0x2'));var router=express[_0x5ebc('0x3')]();var fs_extra=require(_0x5ebc('0x4'));var auth=require(_0x5ebc('0x5'));var interaction=require(_0x5ebc('0x6'));var config=require(_0x5ebc('0x7'));var controller=require(_0x5ebc('0x8'));router['get']('/',auth[_0x5ebc('0x9')](),controller[_0x5ebc('0xa')]);router['get'](_0x5ebc('0xb'),auth['isAuthenticated'](),controller[_0x5ebc('0xc')]);router[_0x5ebc('0xd')](_0x5ebc('0xe'),auth[_0x5ebc('0x9')](),controller[_0x5ebc('0xf')]);router[_0x5ebc('0x10')]('/',auth[_0x5ebc('0x9')](),interaction[_0x5ebc('0x11')](_0x5ebc('0x12'),_0x5ebc('0x13')),controller['create']);router[_0x5ebc('0x10')](_0x5ebc('0x14'),controller[_0x5ebc('0x15')]);router[_0x5ebc('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5ebc('0x17')]);router[_0x5ebc('0x16')]('/:id/accept',auth[_0x5ebc('0x9')](),controller[_0x5ebc('0x18')]);router[_0x5ebc('0x16')](_0x5ebc('0x19'),auth[_0x5ebc('0x9')](),controller['reject']);router[_0x5ebc('0x1a')](_0x5ebc('0xe'),auth[_0x5ebc('0x9')](),controller[_0x5ebc('0x1b')]);module[_0x5ebc('0x1c')]=router; \ No newline at end of file +var _0x5cbd=['isAuthenticated','get','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b9b64,_0x30ba58){var _0x3d704c=function(_0x31e601){while(--_0x31e601){_0x1b9b64['push'](_0x1b9b64['shift']());}};_0x3d704c(++_0x30ba58);}(_0x5cbd,0x1c5));var _0xd5cb=function(_0x5e209f,_0x17a04f){_0x5e209f=_0x5e209f-0x0;var _0x16ad3b=_0x5cbd[_0x5e209f];return _0x16ad3b;};'use strict';var multer=require('multer');var util=require(_0xd5cb('0x0'));var path=require(_0xd5cb('0x1'));var timeout=require(_0xd5cb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd5cb('0x3'));var interaction=require(_0xd5cb('0x4'));var config=require(_0xd5cb('0x5'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xd5cb('0x6')](),controller['index']);router[_0xd5cb('0x7')](_0xd5cb('0x8'),auth['isAuthenticated'](),controller[_0xd5cb('0x9')]);router[_0xd5cb('0x7')](_0xd5cb('0xa'),auth[_0xd5cb('0x6')](),controller[_0xd5cb('0xb')]);router[_0xd5cb('0xc')]('/',auth[_0xd5cb('0x6')](),interaction[_0xd5cb('0xd')](_0xd5cb('0xe'),_0xd5cb('0xf')),controller[_0xd5cb('0x10')]);router[_0xd5cb('0xc')](_0xd5cb('0x11'),controller[_0xd5cb('0x12')]);router[_0xd5cb('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd5cb('0x14')]);router['put'](_0xd5cb('0x15'),auth[_0xd5cb('0x6')](),controller[_0xd5cb('0x16')]);router[_0xd5cb('0x13')](_0xd5cb('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0xd5cb('0x18')]('/:id',auth[_0xd5cb('0x6')](),controller[_0xd5cb('0x19')]);module[_0xd5cb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5fed736..0f7829c 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 _0x058f=['STRING','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x352e7b,_0x2c5874){var _0xfa3f11=function(_0x150372){while(--_0x150372){_0x352e7b['push'](_0x352e7b['shift']());}};_0xfa3f11(++_0x2c5874);}(_0x058f,0x166));var _0xf058=function(_0x845412,_0x3267bd){_0x845412=_0x845412-0x0;var _0x53d28b=_0x058f[_0x845412];return _0x53d28b;};'use strict';var Sequelize=require('sequelize');module[_0xf058('0x0')]={'body':{'type':Sequelize[_0xf058('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf058('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf058('0x3')]('in',_0xf058('0x4')),'defaultValue':_0xf058('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf058('0x5')]},'secret':{'type':Sequelize[_0xf058('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf058('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1d32=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0xb55ed6,_0x1ecc6f){var _0x1b0d68=function(_0x2ddc2c){while(--_0x2ddc2c){_0xb55ed6['push'](_0xb55ed6['shift']());}};_0x1b0d68(++_0x1ecc6f);}(_0x1d32,0x1e3));var _0x21d3=function(_0x2e15c3,_0x9a1f18){_0x2e15c3=_0x2e15c3-0x0;var _0x51ac2f=_0x1d32[_0x2e15c3];return _0x51ac2f;};'use strict';var Sequelize=require(_0x21d3('0x0'));module[_0x21d3('0x1')]={'body':{'type':Sequelize[_0x21d3('0x2')](_0x21d3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x21d3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x21d3('0x5')]('in',_0x21d3('0x6')),'defaultValue':_0x21d3('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x21d3('0x7')](0xbe)},'phone':{'type':Sequelize[_0x21d3('0x7')]},'readAt':{'type':Sequelize[_0x21d3('0x8')]},'secret':{'type':Sequelize[_0x21d3('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x21d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 970d469..4ea4dba 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 _0xa275=['./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','destroy','end','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','body','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','UserId','user','agent','get','WhatsappInteractionId','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter'];(function(_0x253cd8,_0x5f0e6b){var _0x11aed6=function(_0x34e8be){while(--_0x34e8be){_0x253cd8['push'](_0x253cd8['shift']());}};_0x11aed6(++_0x5f0e6b);}(_0xa275,0xf7));var _0x5a27=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa275[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x5a27('0x0'));var rimraf=require(_0x5a27('0x1'));var zipdir=require(_0x5a27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a27('0x3'));var moment=require(_0x5a27('0x4'));var BPromise=require(_0x5a27('0x5'));var Mustache=require(_0x5a27('0x6'));var util=require(_0x5a27('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5a27('0x8'));var ejs=require(_0x5a27('0x9'));var fs=require('fs');var fs_extra=require(_0x5a27('0xa'));var _=require(_0x5a27('0xb'));var squel=require('squel');var crypto=require(_0x5a27('0xc'));var jsforce=require(_0x5a27('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5a27('0x8'));var querystring=require('querystring');var Papa=require(_0x5a27('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5a27('0xf'));var as=require(_0x5a27('0x10'));var hardwareService=require(_0x5a27('0x11'));var logger=require(_0x5a27('0x12'))('api');var utils=require(_0x5a27('0x13'));var config=require(_0x5a27('0x14'));var licenseUtil=require(_0x5a27('0x15'));var db=require(_0x5a27('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5a27('0x17'),'port':0x18eb});var socket=require(_0x5a27('0x18'))(new Redis(config['redis']));require(_0x5a27('0x19'))[_0x5a27('0x1a')](socket);var jayson=require(_0x5a27('0x1b'));var client=jayson[_0x5a27('0x1c')][_0x5a27('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6de99f,_0x277616,_0xcebcf5,_0x1c29f3){return new BPromise(function(_0x110a00,_0x395e7b){var _0x41a024=_0x1c29f3||client;return _0x41a024[_0x5a27('0x1e')](_0x6de99f,_0xcebcf5)[_0x5a27('0x1f')](function(_0x54c840){logger[_0x5a27('0x20')](_0x5a27('0x21'),_0x277616,_0x5a27('0x22'));logger[_0x5a27('0x23')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x277616,'request\x20sent',JSON['stringify'](_0x54c840));if(_0x54c840[_0x5a27('0x24')]){if(_0x54c840[_0x5a27('0x24')][_0x5a27('0x25')]===0x1f4){logger[_0x5a27('0x24')](_0x5a27('0x21'),_0x277616,_0x54c840[_0x5a27('0x24')][_0x5a27('0x26')]);return _0x395e7b(_0x54c840['error'][_0x5a27('0x26')]);}logger[_0x5a27('0x24')](_0x5a27('0x21'),_0x277616,_0x54c840[_0x5a27('0x24')][_0x5a27('0x26')]);return _0x110a00(_0x54c840[_0x5a27('0x24')][_0x5a27('0x26')]);}else{logger[_0x5a27('0x20')](_0x5a27('0x21'),_0x277616,_0x5a27('0x22'));_0x110a00(_0x54c840[_0x5a27('0x27')][_0x5a27('0x26')]);}})['catch'](function(_0x51e189){logger[_0x5a27('0x24')](_0x5a27('0x21'),_0x277616,_0x51e189);_0x395e7b(_0x51e189);});});}function respondWithStatusCode(_0x1e2009,_0xefe850){_0xefe850=_0xefe850||0xcc;return function(_0x5b7f1e){if(_0x5b7f1e){return _0x1e2009[_0x5a27('0x28')](_0xefe850);}return _0x1e2009[_0x5a27('0x29')](_0xefe850)['end']();};}function respondWithResult(_0x5522e6,_0x5bc7ab){_0x5bc7ab=_0x5bc7ab||0xc8;return function(_0x2aab3c){if(_0x2aab3c){return _0x5522e6[_0x5a27('0x29')](_0x5bc7ab)[_0x5a27('0x2a')](_0x2aab3c);}};}function respondWithFilteredResult(_0x1483f3,_0x30a5ad){return function(_0x99d6e0){if(_0x99d6e0){var _0x38c6ed=typeof _0x30a5ad[_0x5a27('0x2b')]===_0x5a27('0x2c')&&typeof _0x30a5ad[_0x5a27('0x2d')]===_0x5a27('0x2c');var _0xac0653=_0x99d6e0[_0x5a27('0x2e')];var _0x39501c=_0x38c6ed?0x0:_0x30a5ad[_0x5a27('0x2b')];var _0x3e0ab3=_0x38c6ed?_0x99d6e0['count']:_0x30a5ad[_0x5a27('0x2b')]+_0x30a5ad[_0x5a27('0x2d')];var _0x22fa3b;if(_0x3e0ab3>=_0xac0653){_0x3e0ab3=_0xac0653;_0x22fa3b=0xc8;}else{_0x22fa3b=0xce;}_0x1483f3[_0x5a27('0x29')](_0x22fa3b);return _0x1483f3['set']('Content-Range',_0x39501c+'-'+_0x3e0ab3+'/'+_0xac0653)['json'](_0x99d6e0);}return null;};}function patchUpdates(_0x12bba9){return function(_0x52e8f3){try{jsonpatch['apply'](_0x52e8f3,_0x12bba9,!![]);}catch(_0x476c95){return BPromise[_0x5a27('0x2f')](_0x476c95);}return _0x52e8f3[_0x5a27('0x30')]();};}function saveUpdates(_0x5049cb,_0x22f90c){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0x5a27('0x31')](_0x5049cb)['then'](function(_0x23282f){return _0x23282f;});}return null;};}function removeEntity(_0x4a81c4,_0x80e500){return function(_0x429f5e){if(_0x429f5e){return _0x429f5e[_0x5a27('0x32')]()[_0x5a27('0x1f')](function(){_0x4a81c4[_0x5a27('0x29')](0xcc)[_0x5a27('0x33')]();});}};}function handleEntityNotFound(_0x14a947,_0x3a1947){return function(_0x264635){if(!_0x264635){_0x14a947[_0x5a27('0x28')](0x194);}return _0x264635;};}function handleError(_0x3f7314,_0x4194ad){_0x4194ad=_0x4194ad||0x1f4;return function(_0x1d18dc){logger[_0x5a27('0x24')](_0x1d18dc[_0x5a27('0x34')]);if(_0x1d18dc[_0x5a27('0x35')]){delete _0x1d18dc[_0x5a27('0x35')];}_0x3f7314[_0x5a27('0x29')](_0x4194ad)['send'](_0x1d18dc);};}exports[_0x5a27('0x36')]=function(_0xba7d4f,_0x30fe22){var _0x11159a={},_0x9a4c95={},_0x108c50={'count':0x0,'rows':[]};var _0x1f28ad=_[_0x5a27('0x37')](db[_0x5a27('0x38')][_0x5a27('0x39')],function(_0x1da72f){return{'name':_0x1da72f[_0x5a27('0x3a')],'type':_0x1da72f[_0x5a27('0x3b')][_0x5a27('0x3c')]};});_0x9a4c95['model']=_[_0x5a27('0x37')](_0x1f28ad,_0x5a27('0x35'));_0x9a4c95[_0x5a27('0x3d')]=_[_0x5a27('0x3e')](_0xba7d4f['query']);_0x9a4c95[_0x5a27('0x3f')]=_[_0x5a27('0x40')](_0x9a4c95['model'],_0x9a4c95[_0x5a27('0x3d')]);_0x11159a[_0x5a27('0x41')]=_[_0x5a27('0x40')](_0x9a4c95['model'],qs['fields'](_0xba7d4f[_0x5a27('0x3d')][_0x5a27('0x42')]));_0x11159a['attributes']=_0x11159a['attributes'][_0x5a27('0x43')]?_0x11159a[_0x5a27('0x41')]:_0x9a4c95[_0x5a27('0x44')];if(!_0xba7d4f['query'][_0x5a27('0x45')]('nolimit')){_0x11159a[_0x5a27('0x2d')]=qs[_0x5a27('0x2d')](_0xba7d4f['query'][_0x5a27('0x2d')]);_0x11159a[_0x5a27('0x2b')]=qs[_0x5a27('0x2b')](_0xba7d4f[_0x5a27('0x3d')]['offset']);}_0x11159a['order']=qs['sort'](_0xba7d4f[_0x5a27('0x3d')][_0x5a27('0x46')]);_0x11159a['where']=qs[_0x5a27('0x3f')](_[_0x5a27('0x47')](_0xba7d4f[_0x5a27('0x3d')],_0x9a4c95[_0x5a27('0x3f')]),_0x1f28ad);if(_0xba7d4f[_0x5a27('0x3d')][_0x5a27('0x48')]){_0x11159a[_0x5a27('0x49')]=_[_0x5a27('0x4a')](_0x11159a[_0x5a27('0x49')],{'$or':_[_0x5a27('0x37')](_0x1f28ad,function(_0x330b32){if(_0x330b32[_0x5a27('0x3b')]!==_0x5a27('0x4b')){var _0x531d5b={};_0x531d5b[_0x330b32[_0x5a27('0x35')]]={'$like':'%'+_0xba7d4f[_0x5a27('0x3d')][_0x5a27('0x48')]+'%'};return _0x531d5b;}})});}_0x11159a=_[_0x5a27('0x4a')]({},_0x11159a,_0xba7d4f[_0x5a27('0x4c')]);var _0xb9a96e={'where':_0x11159a[_0x5a27('0x49')]};return db[_0x5a27('0x38')][_0x5a27('0x2e')](_0xb9a96e)[_0x5a27('0x1f')](function(_0x5d8334){_0x108c50[_0x5a27('0x2e')]=_0x5d8334;if(_0xba7d4f['query'][_0x5a27('0x4d')]){_0x11159a[_0x5a27('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x11159a);})[_0x5a27('0x1f')](function(_0x5b5de1){_0x108c50[_0x5a27('0x4f')]=_0x5b5de1;return _0x108c50;})['then'](respondWithFilteredResult(_0x30fe22,_0x11159a))[_0x5a27('0x50')](handleError(_0x30fe22,null));};exports[_0x5a27('0x51')]=function(_0x2b656b,_0x21de3f){var _0x379ff5={'raw':!![],'where':{'id':_0x2b656b[_0x5a27('0x52')]['id']}},_0x445f07={};_0x445f07['model']=_[_0x5a27('0x3e')](db[_0x5a27('0x38')][_0x5a27('0x39')]);_0x445f07[_0x5a27('0x3d')]=_['keys'](_0x2b656b[_0x5a27('0x3d')]);_0x445f07[_0x5a27('0x3f')]=_[_0x5a27('0x40')](_0x445f07['model'],_0x445f07['query']);_0x379ff5['attributes']=_[_0x5a27('0x40')](_0x445f07['model'],qs[_0x5a27('0x42')](_0x2b656b[_0x5a27('0x3d')]['fields']));_0x379ff5[_0x5a27('0x41')]=_0x379ff5['attributes'][_0x5a27('0x43')]?_0x379ff5['attributes']:_0x445f07[_0x5a27('0x44')];if(_0x2b656b[_0x5a27('0x3d')][_0x5a27('0x4d')]){_0x379ff5[_0x5a27('0x4e')]=[{'all':!![]}];}_0x379ff5=_['merge']({},_0x379ff5,_0x2b656b[_0x5a27('0x4c')]);return db['WhatsappMessage']['find'](_0x379ff5)[_0x5a27('0x1f')](handleEntityNotFound(_0x21de3f,null))[_0x5a27('0x1f')](respondWithResult(_0x21de3f,null))[_0x5a27('0x50')](handleError(_0x21de3f,null));};exports['create']=function(_0x28961a,_0xfa20d6){return db[_0x5a27('0x38')]['create'](_0x28961a[_0x5a27('0x53')],{})[_0x5a27('0x1f')](respondWithResult(_0xfa20d6,0xc9))[_0x5a27('0x50')](handleError(_0xfa20d6,null));};exports[_0x5a27('0x31')]=function(_0x818079,_0x1b76d5){if(_0x818079[_0x5a27('0x53')]['id']){delete _0x818079[_0x5a27('0x53')]['id'];}return db[_0x5a27('0x38')]['find']({'where':{'id':_0x818079[_0x5a27('0x52')]['id']}})[_0x5a27('0x1f')](handleEntityNotFound(_0x1b76d5,null))['then'](saveUpdates(_0x818079[_0x5a27('0x53')],null))[_0x5a27('0x1f')](respondWithResult(_0x1b76d5,null))[_0x5a27('0x50')](handleError(_0x1b76d5,null));};exports['destroy']=function(_0x1eb59d,_0x345c0e){return db['WhatsappMessage'][_0x5a27('0x54')]({'where':{'id':_0x1eb59d[_0x5a27('0x52')]['id']}})[_0x5a27('0x1f')](handleEntityNotFound(_0x345c0e,null))['then'](removeEntity(_0x345c0e,null))[_0x5a27('0x50')](handleError(_0x345c0e,null));};exports[_0x5a27('0x55')]=function(_0x5ff05b,_0x36606e){return db['WhatsappMessage']['describe']()[_0x5a27('0x1f')](respondWithResult(_0x36606e,null))[_0x5a27('0x50')](handleError(_0x36606e,null));};var interaction_log=require(_0x5a27('0x12'))(_0x5a27('0x56'));exports[_0x5a27('0x57')]=function(_0x213bdd,_0x13fe38,_0x95d045){var _0x131ab5={'agent':{},'channel':_0x5a27('0x58')};if(_0x213bdd['body']['id']){delete _0x213bdd[_0x5a27('0x53')]['id'];}_0x213bdd['body'][_0x5a27('0x59')]=!![];_0x213bdd[_0x5a27('0x53')][_0x5a27('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x213bdd[_0x5a27('0x53')][_0x5a27('0x5b')]=_0x213bdd[_0x5a27('0x53')][_0x5a27('0x5b')]||_0x213bdd[_0x5a27('0x5c')]['id'];_0x131ab5[_0x5a27('0x5d')]['id']=_0x213bdd['body'][_0x5a27('0x5b')];return db[_0x5a27('0x38')][_0x5a27('0x54')]({'where':{'id':_0x213bdd[_0x5a27('0x52')]['id'],'UserId':null}})[_0x5a27('0x1f')](handleEntityNotFound(_0x13fe38,null))[_0x5a27('0x1f')](saveUpdates(_0x213bdd[_0x5a27('0x53')],null))[_0x5a27('0x1f')](function(_0x38c20f){if(_0x38c20f){_0x131ab5[_0x5a27('0x26')]=_0x38c20f[_0x5a27('0x5e')]({'plain':!![]});return db['WhatsappInteraction'][_0x5a27('0x54')]({'where':{'id':_0x38c20f[_0x5a27('0x5f')]}});}return null;})[_0x5a27('0x1f')](handleEntityNotFound(_0x13fe38,null))[_0x5a27('0x1f')](function(_0x1f2d3f){if(_0x1f2d3f){return _0x1f2d3f[_0x5a27('0x31')]({'UserId':_0x213bdd[_0x5a27('0x53')]['UserId'],'read1stAt':_['isNil'](_0x1f2d3f[_0x5a27('0x60')])?moment()[_0x5a27('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5a27('0x1f')](function(_0x3ecda6){if(_0x3ecda6){_0x131ab5['interaction']=_0x3ecda6[_0x5a27('0x5e')]({'plain':!![]});interaction_log[_0x5a27('0x20')](_0x5a27('0x62'),_0x213bdd[_0x5a27('0x5c')]['id'],_0x213bdd[_0x5a27('0x5c')][_0x5a27('0x35')],_0x213bdd[_0x5a27('0x5c')][_0x5a27('0x63')],_0x131ab5[_0x5a27('0x64')]['id'],_0x213bdd['body']?JSON['stringify'](_0x213bdd['body']):_0x5a27('0x65'));return respondWithRpcPromise(_0x5a27('0x66'),_0x5a27('0x67'),_0x131ab5);}return null;})[_0x5a27('0x1f')](function(_0x59172f){var _0x7fbbec='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x59172f[_0x5a27('0x26')][_0x5a27('0x68')];return db[_0x5a27('0x69')]['query'](_0x7fbbec,{'type':db[_0x5a27('0x6a')]['QueryTypes'][_0x5a27('0x6b')],'raw':!![]})[_0x5a27('0x1f')](function(_0x361db6){return _0x361db6;});})[_0x5a27('0x1f')](function(_0x3c63e0){if(_0x3c63e0){_0x131ab5[_0x5a27('0x26')][_0x5a27('0x6c')]=_0x3c63e0[0x0];if(!_0x213bdd[_0x5a27('0x53')]['UserId'])return;return db[_0x5a27('0x6d')][_0x5a27('0x54')]({'where':{'id':_0x213bdd[_0x5a27('0x53')][_0x5a27('0x5b')],'role':_0x5a27('0x5d')},'attributes':['id',_0x5a27('0x35'),'fullname',_0x5a27('0x6e'),_0x5a27('0x6f')],'raw':!![]});}return null;})[_0x5a27('0x1f')](function(_0x39b679){if(!_0x39b679)return null;_0x131ab5['message']['agent']=_0x39b679;return _0x131ab5;})[_0x5a27('0x1f')](function(_0x16a98c){if(_0x16a98c){if(_0x213bdd[_0x5a27('0x53')][_0x5a27('0x70')]){_0x131ab5[_0x5a27('0x26')][_0x5a27('0x71')]=util['format'](_0x5a27('0x72'),_0x213bdd[_0x5a27('0x5c')][_0x5a27('0x35')]);_0x131ab5[_0x5a27('0x26')][_0x5a27('0x73')]=_0x131ab5[_0x5a27('0x73')];_0x131ab5[_0x5a27('0x26')][_0x5a27('0x74')]=_0x131ab5[_0x5a27('0x73')];_0x131ab5['message'][_0x5a27('0x75')]=_0x5a27('0x57');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5a27('0x76'),'message':_0x131ab5[_0x5a27('0x26')]},client9002)['then'](function(){return _0x131ab5;});}return _0x131ab5;}return null;})[_0x5a27('0x1f')](respondWithResult(_0x13fe38,null))[_0x5a27('0x50')](handleError(_0x13fe38,null));};var interaction_log=require(_0x5a27('0x12'))(_0x5a27('0x56'));exports[_0x5a27('0x2f')]=function(_0x11eae5,_0x597787,_0x32915c){var _0x352ca5={'agent':{},'channel':_0x5a27('0x58')};if(_0x11eae5[_0x5a27('0x53')]['id']){delete _0x11eae5[_0x5a27('0x53')]['id'];}_0x11eae5[_0x5a27('0x53')]['UserId']=_0x11eae5[_0x5a27('0x53')][_0x5a27('0x5b')]||_0x11eae5[_0x5a27('0x5c')]['id'];_0x352ca5[_0x5a27('0x5d')]['id']=_0x11eae5['body'][_0x5a27('0x5b')];return db[_0x5a27('0x38')][_0x5a27('0x54')]({'where':{'id':_0x11eae5['params']['id'],'UserId':null}})[_0x5a27('0x1f')](handleEntityNotFound(_0x597787,null))[_0x5a27('0x1f')](function(_0x4ab3c0){if(_0x4ab3c0){_0x352ca5['message']=_0x4ab3c0[_0x5a27('0x5e')]({'plain':!![]});return db[_0x5a27('0x77')][_0x5a27('0x54')]({'where':{'id':_0x4ab3c0[_0x5a27('0x5f')]}});}return null;})[_0x5a27('0x1f')](handleEntityNotFound(_0x597787,null))[_0x5a27('0x1f')](function(_0x1ee214){if(_0x1ee214){_0x352ca5[_0x5a27('0x64')]=_0x1ee214[_0x5a27('0x5e')]({'plain':!![]});interaction_log[_0x5a27('0x20')](_0x5a27('0x78'),_0x11eae5['user']['id'],_0x11eae5[_0x5a27('0x5c')][_0x5a27('0x35')],_0x11eae5[_0x5a27('0x5c')][_0x5a27('0x63')],_0x352ca5[_0x5a27('0x64')]['id'],_0x11eae5[_0x5a27('0x53')]?JSON[_0x5a27('0x79')](_0x11eae5[_0x5a27('0x53')]):'null');return respondWithRpcPromise('RejectMessage',_0x5a27('0x7a'),_0x352ca5);}return null;})['then'](function(_0xc8e468){var _0x2630e5=_0x5a27('0x7b')+_0xc8e468[_0x5a27('0x26')][_0x5a27('0x68')];return db[_0x5a27('0x69')][_0x5a27('0x3d')](_0x2630e5,{'type':db['Sequelize']['QueryTypes'][_0x5a27('0x6b')],'raw':!![]})[_0x5a27('0x1f')](function(_0x1e7963){return _0x1e7963;});})[_0x5a27('0x1f')](function(_0x558215){if(_0x558215){_0x352ca5[_0x5a27('0x26')]['contact']=_0x558215[0x0];if(!_0x11eae5[_0x5a27('0x53')][_0x5a27('0x5b')])return;return db[_0x5a27('0x6d')]['find']({'where':{'id':_0x11eae5[_0x5a27('0x53')][_0x5a27('0x5b')],'role':_0x5a27('0x5d')},'attributes':['id',_0x5a27('0x35'),_0x5a27('0x7c'),_0x5a27('0x6e'),_0x5a27('0x6f')],'raw':!![]});}return null;})[_0x5a27('0x1f')](function(_0x5d6ec4){if(!_0x5d6ec4)return null;_0x352ca5[_0x5a27('0x26')][_0x5a27('0x5d')]=_0x5d6ec4;return _0x352ca5;})[_0x5a27('0x1f')](function(_0x347152){if(_0x347152){_0x347152[_0x5a27('0x26')][_0x5a27('0x71')]=util[_0x5a27('0x61')](_0x5a27('0x72'),_0x11eae5[_0x5a27('0x5c')][_0x5a27('0x35')]);_0x347152[_0x5a27('0x26')][_0x5a27('0x73')]=_0x352ca5[_0x5a27('0x73')];_0x347152[_0x5a27('0x26')][_0x5a27('0x74')]=_0x352ca5['channel'];_0x347152['message'][_0x5a27('0x75')]='reject';respondWithRpcPromise(_0x5a27('0x7d'),_0x5a27('0x7d'),{'event':_0x5a27('0x7e'),'message':_0x347152[_0x5a27('0x26')]},client9002);return _0x352ca5;}return null;})[_0x5a27('0x1f')](respondWithResult(_0x597787,null))[_0x5a27('0x50')](handleError(_0x597787,null));};exports[_0x5a27('0x29')]=function(_0x4f96fd,_0x26d293,_0x2572db){if(_0x4f96fd[_0x5a27('0x53')]['id']){delete _0x4f96fd['body']['id'];}var _0x711792;return db[_0x5a27('0x38')][_0x5a27('0x54')]({'where':{'id':_0x4f96fd['params']['id']}})['then'](handleEntityNotFound(_0x26d293,null))[_0x5a27('0x1f')](function(_0x5e28a2){if(_0x5e28a2){_0x711792=_0x5e28a2;return db[_0x5a27('0x7f')][_0x5a27('0x54')]({'where':{'id':_0x5e28a2[_0x5a27('0x80')]}});}})['then'](handleEntityNotFound(_0x26d293,null))[_0x5a27('0x1f')](function(_0x22f6cd){if(_0x22f6cd){logger[_0x5a27('0x23')](_0x5a27('0x81'),_0x5a27('0x29'),_0x5a27('0x82'),_0x22f6cd[_0x5a27('0x3b')],util[_0x5a27('0x83')](_0x4f96fd[_0x5a27('0x53')],{'showHidden':![],'depth':null}));switch(_0x22f6cd[_0x5a27('0x3b')]){case _0x5a27('0x84'):if(_0x4f96fd[_0x5a27('0x53')][_0x5a27('0x85')]&&_0x4f96fd[_0x5a27('0x53')]['MessageSid']===_0x711792[_0x5a27('0x86')]&&_0x4f96fd[_0x5a27('0x53')][_0x5a27('0x87')]&&_0x4f96fd[_0x5a27('0x53')][_0x5a27('0x87')]==='read'){return _0x711792[_0x5a27('0x31')]({'read':!![]});}else{logger[_0x5a27('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5a27('0x29'),_0x5a27('0x84'),util[_0x5a27('0x83')](_0x4f96fd[_0x5a27('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x711792;}})['then'](respondWithResult(_0x26d293,null))['catch'](handleError(_0x26d293,null));}; \ No newline at end of file +var _0x066c=['WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','update','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','sendStatus','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','agent','fullname','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','interface','event','rejectmessage'];(function(_0x8fa801,_0x24cb97){var _0x11b5c4=function(_0x2487bf){while(--_0x2487bf){_0x8fa801['push'](_0x8fa801['shift']());}};_0x11b5c4(++_0x24cb97);}(_0x066c,0x1a8));var _0xc066=function(_0x411a82,_0x447668){_0x411a82=_0x411a82-0x0;var _0x53ad97=_0x066c[_0x411a82];return _0x53ad97;};'use strict';var emlformat=require(_0xc066('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc066('0x1'));var jsonpatch=require(_0xc066('0x2'));var rp=require(_0xc066('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc066('0x4'));var util=require('util');var path=require(_0xc066('0x5'));var sox=require('sox');var csv=require(_0xc066('0x6'));var ejs=require(_0xc066('0x7'));var fs=require('fs');var fs_extra=require(_0xc066('0x8'));var _=require(_0xc066('0x9'));var squel=require('squel');var crypto=require(_0xc066('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc066('0xb'));var toCsv=require(_0xc066('0x6'));var querystring=require(_0xc066('0xc'));var Papa=require(_0xc066('0xd'));var Redis=require(_0xc066('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc066('0xf'));var as=require(_0xc066('0x10'));var hardwareService=require(_0xc066('0x11'));var logger=require(_0xc066('0x12'))(_0xc066('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc066('0x14'));var db=require('../../mysqldb')['db'];config[_0xc066('0x15')]=_[_0xc066('0x16')](config[_0xc066('0x15')],{'host':_0xc066('0x17'),'port':0x18eb});var socket=require(_0xc066('0x18'))(new Redis(config[_0xc066('0x15')]));require(_0xc066('0x19'))[_0xc066('0x1a')](socket);var jayson=require(_0xc066('0x1b'));var client=jayson[_0xc066('0x1c')][_0xc066('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xc066('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1f45a5,_0x4d0c38,_0x349c4a,_0x36ed34){return new BPromise(function(_0x3c6931,_0x44cecc){var _0x5d00dd=_0x36ed34||client;return _0x5d00dd['request'](_0x1f45a5,_0x349c4a)[_0xc066('0x1e')](function(_0x161873){logger[_0xc066('0x1f')](_0xc066('0x20'),_0x4d0c38,_0xc066('0x21'));logger[_0xc066('0x22')](_0xc066('0x23'),_0x4d0c38,_0xc066('0x21'),JSON['stringify'](_0x161873));if(_0x161873['error']){if(_0x161873['error']['code']===0x1f4){logger[_0xc066('0x24')](_0xc066('0x20'),_0x4d0c38,_0x161873['error'][_0xc066('0x25')]);return _0x44cecc(_0x161873[_0xc066('0x24')][_0xc066('0x25')]);}logger[_0xc066('0x24')](_0xc066('0x20'),_0x4d0c38,_0x161873[_0xc066('0x24')][_0xc066('0x25')]);return _0x3c6931(_0x161873[_0xc066('0x24')][_0xc066('0x25')]);}else{logger[_0xc066('0x1f')](_0xc066('0x20'),_0x4d0c38,_0xc066('0x21'));_0x3c6931(_0x161873['result']['message']);}})['catch'](function(_0x15b3d4){logger[_0xc066('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x4d0c38,_0x15b3d4);_0x44cecc(_0x15b3d4);});});}function respondWithStatusCode(_0x303339,_0x457a83){_0x457a83=_0x457a83||0xcc;return function(_0x18b7f4){if(_0x18b7f4){return _0x303339['sendStatus'](_0x457a83);}return _0x303339[_0xc066('0x26')](_0x457a83)[_0xc066('0x27')]();};}function respondWithResult(_0x1ef74b,_0x55bc95){_0x55bc95=_0x55bc95||0xc8;return function(_0x4acad5){if(_0x4acad5){return _0x1ef74b[_0xc066('0x26')](_0x55bc95)[_0xc066('0x28')](_0x4acad5);}};}function respondWithFilteredResult(_0x18dd21,_0x1a05e9){return function(_0x153556){if(_0x153556){var _0xa94e37=typeof _0x1a05e9[_0xc066('0x29')]===_0xc066('0x2a')&&typeof _0x1a05e9['limit']===_0xc066('0x2a');var _0x2dec77=_0x153556[_0xc066('0x2b')];var _0x31c9c6=_0xa94e37?0x0:_0x1a05e9['offset'];var _0xd66ff9=_0xa94e37?_0x153556['count']:_0x1a05e9[_0xc066('0x29')]+_0x1a05e9[_0xc066('0x2c')];var _0x3931c0;if(_0xd66ff9>=_0x2dec77){_0xd66ff9=_0x2dec77;_0x3931c0=0xc8;}else{_0x3931c0=0xce;}_0x18dd21[_0xc066('0x26')](_0x3931c0);return _0x18dd21[_0xc066('0x2d')](_0xc066('0x2e'),_0x31c9c6+'-'+_0xd66ff9+'/'+_0x2dec77)[_0xc066('0x28')](_0x153556);}return null;};}function patchUpdates(_0x405ec4){return function(_0x3e2a6f){try{jsonpatch[_0xc066('0x2f')](_0x3e2a6f,_0x405ec4,!![]);}catch(_0x475ef3){return BPromise[_0xc066('0x30')](_0x475ef3);}return _0x3e2a6f[_0xc066('0x31')]();};}function saveUpdates(_0x43d85d,_0x5c8075){return function(_0x1b5210){if(_0x1b5210){return _0x1b5210['update'](_0x43d85d)[_0xc066('0x1e')](function(_0x7ddf96){return _0x7ddf96;});}return null;};}function removeEntity(_0x2c35e,_0x3ec258){return function(_0x25a228){if(_0x25a228){return _0x25a228['destroy']()['then'](function(){_0x2c35e['status'](0xcc)[_0xc066('0x27')]();});}};}function handleEntityNotFound(_0x1a021a,_0x393fbe){return function(_0x3bd93e){if(!_0x3bd93e){_0x1a021a[_0xc066('0x32')](0x194);}return _0x3bd93e;};}function handleError(_0x2dfce2,_0x4a48b3){_0x4a48b3=_0x4a48b3||0x1f4;return function(_0x15228a){logger[_0xc066('0x24')](_0x15228a['stack']);if(_0x15228a[_0xc066('0x33')]){delete _0x15228a[_0xc066('0x33')];}_0x2dfce2['status'](_0x4a48b3)[_0xc066('0x34')](_0x15228a);};}exports[_0xc066('0x35')]=function(_0x32c0d6,_0x2fcae2){var _0x592cb1={},_0xf77918={},_0x3e71e7={'count':0x0,'rows':[]};var _0x444720=_['map'](db[_0xc066('0x36')][_0xc066('0x37')],function(_0x4cd8ce){return{'name':_0x4cd8ce[_0xc066('0x38')],'type':_0x4cd8ce[_0xc066('0x39')][_0xc066('0x3a')]};});_0xf77918['model']=_['map'](_0x444720,'name');_0xf77918[_0xc066('0x3b')]=_[_0xc066('0x3c')](_0x32c0d6[_0xc066('0x3b')]);_0xf77918[_0xc066('0x3d')]=_[_0xc066('0x3e')](_0xf77918[_0xc066('0x3f')],_0xf77918[_0xc066('0x3b')]);_0x592cb1[_0xc066('0x40')]=_[_0xc066('0x3e')](_0xf77918[_0xc066('0x3f')],qs[_0xc066('0x41')](_0x32c0d6[_0xc066('0x3b')][_0xc066('0x41')]));_0x592cb1[_0xc066('0x40')]=_0x592cb1[_0xc066('0x40')]['length']?_0x592cb1['attributes']:_0xf77918['model'];if(!_0x32c0d6[_0xc066('0x3b')][_0xc066('0x42')](_0xc066('0x43'))){_0x592cb1[_0xc066('0x2c')]=qs[_0xc066('0x2c')](_0x32c0d6[_0xc066('0x3b')][_0xc066('0x2c')]);_0x592cb1[_0xc066('0x29')]=qs[_0xc066('0x29')](_0x32c0d6['query'][_0xc066('0x29')]);}_0x592cb1[_0xc066('0x44')]=qs[_0xc066('0x45')](_0x32c0d6[_0xc066('0x3b')]['sort']);_0x592cb1[_0xc066('0x46')]=qs[_0xc066('0x3d')](_[_0xc066('0x47')](_0x32c0d6['query'],_0xf77918[_0xc066('0x3d')]),_0x444720);if(_0x32c0d6['query'][_0xc066('0x48')]){_0x592cb1[_0xc066('0x46')]=_[_0xc066('0x49')](_0x592cb1[_0xc066('0x46')],{'$or':_[_0xc066('0x4a')](_0x444720,function(_0x138e53){if(_0x138e53[_0xc066('0x39')]!=='VIRTUAL'){var _0x3ce25c={};_0x3ce25c[_0x138e53[_0xc066('0x33')]]={'$like':'%'+_0x32c0d6[_0xc066('0x3b')][_0xc066('0x48')]+'%'};return _0x3ce25c;}})});}_0x592cb1=_['merge']({},_0x592cb1,_0x32c0d6[_0xc066('0x4b')]);var _0xa9b383={'where':_0x592cb1[_0xc066('0x46')]};return db[_0xc066('0x36')][_0xc066('0x2b')](_0xa9b383)[_0xc066('0x1e')](function(_0x198929){_0x3e71e7[_0xc066('0x2b')]=_0x198929;if(_0x32c0d6['query'][_0xc066('0x4c')]){_0x592cb1[_0xc066('0x4d')]=[{'all':!![]}];}return db[_0xc066('0x36')]['findAll'](_0x592cb1);})[_0xc066('0x1e')](function(_0x54328a){_0x3e71e7[_0xc066('0x4e')]=_0x54328a;return _0x3e71e7;})[_0xc066('0x1e')](respondWithFilteredResult(_0x2fcae2,_0x592cb1))[_0xc066('0x4f')](handleError(_0x2fcae2,null));};exports[_0xc066('0x50')]=function(_0x2f7d9d,_0x2d8930){var _0x4a11fc={'raw':!![],'where':{'id':_0x2f7d9d[_0xc066('0x51')]['id']}},_0x5aeec4={};_0x5aeec4['model']=_[_0xc066('0x3c')](db[_0xc066('0x36')][_0xc066('0x37')]);_0x5aeec4['query']=_[_0xc066('0x3c')](_0x2f7d9d['query']);_0x5aeec4[_0xc066('0x3d')]=_[_0xc066('0x3e')](_0x5aeec4[_0xc066('0x3f')],_0x5aeec4[_0xc066('0x3b')]);_0x4a11fc[_0xc066('0x40')]=_[_0xc066('0x3e')](_0x5aeec4[_0xc066('0x3f')],qs[_0xc066('0x41')](_0x2f7d9d[_0xc066('0x3b')][_0xc066('0x41')]));_0x4a11fc[_0xc066('0x40')]=_0x4a11fc['attributes'][_0xc066('0x52')]?_0x4a11fc[_0xc066('0x40')]:_0x5aeec4[_0xc066('0x3f')];if(_0x2f7d9d[_0xc066('0x3b')]['includeAll']){_0x4a11fc[_0xc066('0x4d')]=[{'all':!![]}];}_0x4a11fc=_['merge']({},_0x4a11fc,_0x2f7d9d['options']);return db['WhatsappMessage'][_0xc066('0x53')](_0x4a11fc)['then'](handleEntityNotFound(_0x2d8930,null))['then'](respondWithResult(_0x2d8930,null))[_0xc066('0x4f')](handleError(_0x2d8930,null));};exports['create']=function(_0x451ee3,_0xd3792e){return db['WhatsappMessage'][_0xc066('0x54')](_0x451ee3['body'],{})['then'](respondWithResult(_0xd3792e,0xc9))[_0xc066('0x4f')](handleError(_0xd3792e,null));};exports['update']=function(_0x26c588,_0xcf5e0d){if(_0x26c588[_0xc066('0x55')]['id']){delete _0x26c588[_0xc066('0x55')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x26c588[_0xc066('0x51')]['id']}})[_0xc066('0x1e')](handleEntityNotFound(_0xcf5e0d,null))[_0xc066('0x1e')](saveUpdates(_0x26c588[_0xc066('0x55')],null))[_0xc066('0x1e')](respondWithResult(_0xcf5e0d,null))['catch'](handleError(_0xcf5e0d,null));};exports[_0xc066('0x56')]=function(_0x242b09,_0xce3fa0){return db[_0xc066('0x36')][_0xc066('0x53')]({'where':{'id':_0x242b09[_0xc066('0x51')]['id']}})[_0xc066('0x1e')](handleEntityNotFound(_0xce3fa0,null))[_0xc066('0x1e')](removeEntity(_0xce3fa0,null))[_0xc066('0x4f')](handleError(_0xce3fa0,null));};exports[_0xc066('0x57')]=function(_0x2afdd0,_0x50123d){return db[_0xc066('0x36')][_0xc066('0x57')]()[_0xc066('0x1e')](respondWithResult(_0x50123d,null))[_0xc066('0x4f')](handleError(_0x50123d,null));};var interaction_log=require(_0xc066('0x12'))(_0xc066('0x58'));exports['accept']=function(_0x1c1168,_0x2ed179,_0x42b8cb){var _0x746af9={'agent':{},'channel':_0xc066('0x59')};if(_0x1c1168[_0xc066('0x55')]['id']){delete _0x1c1168[_0xc066('0x55')]['id'];}_0x1c1168['body'][_0xc066('0x5a')]=!![];_0x1c1168[_0xc066('0x55')][_0xc066('0x5b')]=moment()[_0xc066('0x5c')](_0xc066('0x5d'));_0x1c1168[_0xc066('0x55')]['UserId']=_0x1c1168[_0xc066('0x55')]['UserId']||_0x1c1168[_0xc066('0x5e')]['id'];_0x746af9['agent']['id']=_0x1c1168[_0xc066('0x55')][_0xc066('0x5f')];return db['WhatsappMessage'][_0xc066('0x53')]({'where':{'id':_0x1c1168[_0xc066('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ed179,null))[_0xc066('0x1e')](saveUpdates(_0x1c1168[_0xc066('0x55')],null))[_0xc066('0x1e')](function(_0x21e66d){if(_0x21e66d){_0x746af9[_0xc066('0x25')]=_0x21e66d[_0xc066('0x60')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x21e66d[_0xc066('0x61')]}});}return null;})[_0xc066('0x1e')](handleEntityNotFound(_0x2ed179,null))['then'](function(_0x3ab5fb){if(_0x3ab5fb){return _0x3ab5fb['update']({'UserId':_0x1c1168[_0xc066('0x55')][_0xc066('0x5f')],'read1stAt':_[_0xc066('0x62')](_0x3ab5fb[_0xc066('0x63')])?moment()[_0xc066('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5e16f9){if(_0x5e16f9){_0x746af9[_0xc066('0x64')]=_0x5e16f9[_0xc066('0x60')]({'plain':!![]});interaction_log['info'](_0xc066('0x65'),_0x1c1168[_0xc066('0x5e')]['id'],_0x1c1168[_0xc066('0x5e')]['name'],_0x1c1168[_0xc066('0x5e')][_0xc066('0x66')],_0x746af9[_0xc066('0x64')]['id'],_0x1c1168[_0xc066('0x55')]?JSON[_0xc066('0x67')](_0x1c1168['body']):_0xc066('0x68'));return respondWithRpcPromise(_0xc066('0x69'),_0xc066('0x6a'),_0x746af9);}return null;})[_0xc066('0x1e')](function(_0x226822){var _0x343e6c=_0xc066('0x6b')+_0x226822[_0xc066('0x25')][_0xc066('0x6c')];return db['sequelize'][_0xc066('0x3b')](_0x343e6c,{'type':db['Sequelize'][_0xc066('0x6d')][_0xc066('0x6e')],'raw':!![]})['then'](function(_0x11bca8){return _0x11bca8;});})[_0xc066('0x1e')](function(_0x8bf5d9){if(_0x8bf5d9){_0x746af9[_0xc066('0x25')]['contact']=_0x8bf5d9[0x0];if(!_0x1c1168[_0xc066('0x55')][_0xc066('0x5f')])return;return db[_0xc066('0x6f')][_0xc066('0x53')]({'where':{'id':_0x1c1168[_0xc066('0x55')][_0xc066('0x5f')],'role':_0xc066('0x70')},'attributes':['id','name',_0xc066('0x71'),_0xc066('0x72'),_0xc066('0x73')],'raw':!![]});}return null;})[_0xc066('0x1e')](function(_0xa14c3){if(!_0xa14c3)return null;_0x746af9[_0xc066('0x25')]['agent']=_0xa14c3;return _0x746af9;})['then'](function(_0x74203f){if(_0x74203f){if(_0x1c1168[_0xc066('0x55')]['manual']){_0x746af9[_0xc066('0x25')]['interface']=util[_0xc066('0x5c')](_0xc066('0x74'),_0x1c1168[_0xc066('0x5e')][_0xc066('0x33')]);_0x746af9[_0xc066('0x25')][_0xc066('0x75')]=_0x746af9['channel'];_0x746af9[_0xc066('0x25')][_0xc066('0x76')]=_0x746af9[_0xc066('0x75')];_0x746af9[_0xc066('0x25')]['event']='accept';return respondWithRpcPromise(_0xc066('0x77'),_0xc066('0x77'),{'event':_0xc066('0x78'),'message':_0x746af9[_0xc066('0x25')]},client9002)[_0xc066('0x1e')](function(){return _0x746af9;});}return _0x746af9;}return null;})['then'](respondWithResult(_0x2ed179,null))[_0xc066('0x4f')](handleError(_0x2ed179,null));};var interaction_log=require(_0xc066('0x12'))('whatsapp-interactions');exports[_0xc066('0x30')]=function(_0x16d061,_0x376f3f,_0x153905){var _0xc57acc={'agent':{},'channel':_0xc066('0x59')};if(_0x16d061['body']['id']){delete _0x16d061['body']['id'];}_0x16d061['body'][_0xc066('0x5f')]=_0x16d061['body'][_0xc066('0x5f')]||_0x16d061[_0xc066('0x5e')]['id'];_0xc57acc[_0xc066('0x70')]['id']=_0x16d061['body'][_0xc066('0x5f')];return db[_0xc066('0x36')]['find']({'where':{'id':_0x16d061[_0xc066('0x51')]['id'],'UserId':null}})[_0xc066('0x1e')](handleEntityNotFound(_0x376f3f,null))['then'](function(_0x4bd8fd){if(_0x4bd8fd){_0xc57acc[_0xc066('0x25')]=_0x4bd8fd['get']({'plain':!![]});return db['WhatsappInteraction'][_0xc066('0x53')]({'where':{'id':_0x4bd8fd[_0xc066('0x61')]}});}return null;})[_0xc066('0x1e')](handleEntityNotFound(_0x376f3f,null))[_0xc066('0x1e')](function(_0x13b753){if(_0x13b753){_0xc57acc[_0xc066('0x64')]=_0x13b753[_0xc066('0x60')]({'plain':!![]});interaction_log[_0xc066('0x1f')](_0xc066('0x79'),_0x16d061[_0xc066('0x5e')]['id'],_0x16d061[_0xc066('0x5e')][_0xc066('0x33')],_0x16d061['user'][_0xc066('0x66')],_0xc57acc['interaction']['id'],_0x16d061[_0xc066('0x55')]?JSON['stringify'](_0x16d061['body']):_0xc066('0x68'));return respondWithRpcPromise(_0xc066('0x7a'),_0xc066('0x7b'),_0xc57acc);}return null;})[_0xc066('0x1e')](function(_0x108d7d){var _0x2cecd8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x108d7d['message'][_0xc066('0x6c')];return db[_0xc066('0x7c')]['query'](_0x2cecd8,{'type':db['Sequelize']['QueryTypes'][_0xc066('0x6e')],'raw':!![]})['then'](function(_0x58c5f5){return _0x58c5f5;});})[_0xc066('0x1e')](function(_0x1e824e){if(_0x1e824e){_0xc57acc[_0xc066('0x25')]['contact']=_0x1e824e[0x0];if(!_0x16d061[_0xc066('0x55')][_0xc066('0x5f')])return;return db[_0xc066('0x6f')][_0xc066('0x53')]({'where':{'id':_0x16d061['body'][_0xc066('0x5f')],'role':_0xc066('0x70')},'attributes':['id','name',_0xc066('0x71'),'email',_0xc066('0x73')],'raw':!![]});}return null;})['then'](function(_0x2daf37){if(!_0x2daf37)return null;_0xc57acc[_0xc066('0x25')][_0xc066('0x70')]=_0x2daf37;return _0xc57acc;})[_0xc066('0x1e')](function(_0x4791fc){if(_0x4791fc){_0x4791fc[_0xc066('0x25')][_0xc066('0x7d')]=util['format'](_0xc066('0x74'),_0x16d061[_0xc066('0x5e')][_0xc066('0x33')]);_0x4791fc[_0xc066('0x25')][_0xc066('0x75')]=_0xc57acc[_0xc066('0x75')];_0x4791fc[_0xc066('0x25')]['motionChannel']=_0xc57acc['channel'];_0x4791fc['message'][_0xc066('0x7e')]=_0xc066('0x30');respondWithRpcPromise(_0xc066('0x77'),_0xc066('0x77'),{'event':_0xc066('0x7f'),'message':_0x4791fc[_0xc066('0x25')]},client9002);return _0xc57acc;}return null;})[_0xc066('0x1e')](respondWithResult(_0x376f3f,null))[_0xc066('0x4f')](handleError(_0x376f3f,null));};exports[_0xc066('0x26')]=function(_0x243b98,_0x41376,_0x5b4817){if(_0x243b98[_0xc066('0x55')]['id']){delete _0x243b98[_0xc066('0x55')]['id'];}var _0x5754b6;return db[_0xc066('0x36')][_0xc066('0x53')]({'where':{'id':_0x243b98[_0xc066('0x51')]['id']}})[_0xc066('0x1e')](handleEntityNotFound(_0x41376,null))[_0xc066('0x1e')](function(_0x4dcba8){if(_0x4dcba8){_0x5754b6=_0x4dcba8;return db['WhatsappAccount'][_0xc066('0x53')]({'where':{'id':_0x4dcba8[_0xc066('0x80')]}});}})[_0xc066('0x1e')](handleEntityNotFound(_0x41376,null))['then'](function(_0x5d084e){if(_0x5d084e){logger[_0xc066('0x22')](_0xc066('0x81'),_0xc066('0x26'),_0xc066('0x82'),_0x5d084e[_0xc066('0x39')],util[_0xc066('0x83')](_0x243b98[_0xc066('0x55')],{'showHidden':![],'depth':null}));switch(_0x5d084e[_0xc066('0x39')]){case _0xc066('0x84'):if(_0x243b98['body']['MessageSid']&&_0x243b98[_0xc066('0x55')][_0xc066('0x85')]===_0x5754b6[_0xc066('0x86')]&&_0x243b98['body']['MessageStatus']&&_0x243b98[_0xc066('0x55')][_0xc066('0x87')]===_0xc066('0x5a')){return _0x5754b6[_0xc066('0x88')]({'read':!![]});}else{logger[_0xc066('0x24')](_0xc066('0x89'),_0xc066('0x26'),_0xc066('0x84'),util[_0xc066('0x83')](_0x243b98[_0xc066('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x5754b6;}})['then'](respondWithResult(_0x41376,null))['catch'](handleError(_0x41376,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 46a50f3..b35fcbc 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 _0xd757=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x5b87df,_0x6f3bb5){var _0x10a39e=function(_0x4e3a3b){while(--_0x4e3a3b){_0x5b87df['push'](_0x5b87df['shift']());}};_0x10a39e(++_0x6f3bb5);}(_0xd757,0x1e5));var _0x7d75=function(_0x5a90c8,_0x4c47fe){_0x5a90c8=_0x5a90c8-0x0;var _0x3ce0d8=_0xd757[_0x5a90c8];return _0x3ce0d8;};'use strict';var EventEmitter=require(_0x7d75('0x0'));var WhatsappMessage=require(_0x7d75('0x1'))['db'][_0x7d75('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7d75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7d75('0x4')};function emitEvent(_0x2772a3){return function(_0x5e4a4c,_0xa7df66,_0x10d11a){WhatsappMessageEvents[_0x7d75('0x5')](_0x2772a3+':'+_0x5e4a4c['id'],_0x5e4a4c);WhatsappMessageEvents['emit'](_0x2772a3,_0x5e4a4c);_0x10d11a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x7d75('0x6')](e,emitEvent(event));}}module[_0x7d75('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x1c7c=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x475785,_0x31b9a3){var _0x19c899=function(_0x5f2918){while(--_0x5f2918){_0x475785['push'](_0x475785['shift']());}};_0x19c899(++_0x31b9a3);}(_0x1c7c,0x164));var _0xc1c7=function(_0x305697,_0x5ceead){_0x305697=_0x305697-0x0;var _0x4f9eee=_0x1c7c[_0x305697];return _0x4f9eee;};'use strict';var EventEmitter=require(_0xc1c7('0x0'));var WhatsappMessage=require(_0xc1c7('0x1'))['db'][_0xc1c7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc1c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3cb551){return function(_0x20dad3,_0xbb9da0,_0x2a0383){WhatsappMessageEvents[_0xc1c7('0x5')](_0x3cb551+':'+_0x20dad3['id'],_0x20dad3);WhatsappMessageEvents[_0xc1c7('0x5')](_0x3cb551,_0x20dad3);_0x2a0383(null);};}for(var e in events){if(events[_0xc1c7('0x6')](e)){var event=events[e];WhatsappMessage[_0xc1c7('0x7')](e,emitEvent(event));}}module[_0xc1c7('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 119c828..80c33f5 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 _0x8470=['body','models','get','direction','out','secret','isNil','findOne','WhatsappInteractionId','update','toLowerCase','error','WhatsappAccount','WhatsappAccountId','then','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','/whatsapp/v1/','text','POST','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','../../config/logger','bluebird','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages'];(function(_0x147617,_0x191588){var _0x1fa8c2=function(_0x4a64c2){while(--_0x4a64c2){_0x147617['push'](_0x147617['shift']());}};_0x1fa8c2(++_0x191588);}(_0x8470,0x1d2));var _0x0847=function(_0x18037c,_0x188899){_0x18037c=_0x18037c-0x0;var _0x44506a=_0x8470[_0x18037c];return _0x44506a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0847('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0847('0x1'));var rp=require('request-promise');var fetch=require(_0x0847('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0847('0x3'));var config=require(_0x0847('0x4'));var attributes=require(_0x0847('0x5'));module['exports']=function(_0x7737c1,_0x4b2871){return _0x7737c1[_0x0847('0x6')](_0x0847('0x7'),attributes,{'tableName':_0x0847('0x8'),'paranoid':![],'indexes':[{'name':_0x0847('0x9'),'fields':[_0x0847('0x9')]},{'name':_0x0847('0xa'),'fields':[_0x0847('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x588956,_0x3c1af2,_0x5e1112){var _0x16d8d2=_0x7737c1[_0x0847('0xc')];var _0x3aea8a=_0x588956[_0x0847('0xd')]({'plain':!![]});if(_0x3aea8a[_0x0847('0xe')]['toLowerCase']()==='in'||_0x3aea8a[_0x0847('0xe')]['toLowerCase']()===_0x0847('0xf')&&!_0x3aea8a[_0x0847('0x10')]&&!_[_0x0847('0x11')](_0x3aea8a['UserId'])){_0x16d8d2['WhatsappInteraction'][_0x0847('0x12')]({'where':{'id':_0x3aea8a[_0x0847('0x13')]}})['then'](function(_0x339d41){if(_0x339d41){_0x339d41[_0x0847('0x14')]({'lastMsgAt':_0x3aea8a['createdAt'],'lastMsgDirection':_0x3aea8a['direction'][_0x0847('0x15')]()});}})['catch'](function(_0x26e027){console[_0x0847('0x16')](_0x26e027);});}if(_0x3aea8a[_0x0847('0xe')]===_0x0847('0xf')&&!_0x3aea8a['secret']){var _0x5e5b2e;_0x16d8d2[_0x0847('0x17')]['find']({'where':{'id':_0x3aea8a[_0x0847('0x18')]},'raw':!![]})[_0x0847('0x19')](function(_0x1b5e38){_0x5e5b2e=_0x1b5e38;if(_0x5e5b2e&&_0x5e5b2e['type']){switch(_0x5e5b2e[_0x0847('0x1a')]){case _0x0847('0x1b'):var _0x4bcf5a=require(_0x0847('0x1b'));if(_0x5e5b2e[_0x0847('0x1c')]&&_0x5e5b2e['authToken']&&_0x5e5b2e[_0x0847('0x1d')]){var _0x169c8e=new _0x4bcf5a(_0x5e5b2e[_0x0847('0x1c')],_0x5e5b2e[_0x0847('0x1e')]);_0x169c8e[_0x0847('0x1f')][_0x0847('0x20')]({'body':_0x3aea8a[_0x0847('0xb')],'to':_0x0847('0x21')+_0x3aea8a[_0x0847('0x1d')],'from':_0x0847('0x21')+_0x5e5b2e[_0x0847('0x1d')],'statusCallback':_0x5e5b2e[_0x0847('0x22')]+_0x0847('0x23')+_0x3aea8a['id']+_0x0847('0x24')+_0x5e5b2e[_0x0847('0x25')]})[_0x0847('0x19')](function(_0xfd0f6d){if(_0xfd0f6d[_0x0847('0x26')]){return _0x588956[_0x0847('0x14')]({'messageId':_0xfd0f6d[_0x0847('0x26')]});}})[_0x0847('0x27')](function(_0x4ecf67){logger[_0x0847('0x16')](_0x0847('0x28'),_0x0847('0x29'),_0x0847('0x1b'),util[_0x0847('0x2a')](_0x4ecf67,{'showHidden':![],'depth':null}));});}else{logger[_0x0847('0x16')](_0x0847('0x28'),'afterCreate',_0x0847('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x0847('0x2b'):var _0xb9570c=_0x5e5b2e[_0x0847('0x1c')];var _0x4dc152=_0x5e5b2e[_0x0847('0x1e')];var _0x1e7551=_0x5e5b2e['baseUrl']+_0x0847('0x2c')+_0xb9570c+'/messages/';var _0x2af27b={'to':[_0x3aea8a[_0x0847('0x1d')]],'message':{'type':_0x0847('0x2d'),'text':_0x3aea8a[_0x0847('0xb')]}};var _0x2a3503={'method':_0x0847('0x2e'),'uri':_0x1e7551,'headers':{'Authorization':'Bearer\x20'+_0x4dc152,'Content-Type':_0x0847('0x2f')},'body':_0x2af27b,'json':!![]};rp(_0x2a3503)['then'](function(_0x865875){if(_0x865875[_0x0847('0x30')][0x0][_0x0847('0x31')]){return _0x588956[_0x0847('0x14')]({'messageId':_0x865875[_0x0847('0x30')][0x0]['message_id']});}})['catch'](function(_0x3c3d31){logger['err'](_0x0847('0x32'),_0x3c3d31);});break;}}})[_0x0847('0x33')](function(){_0x5e1112();});}else{_0x5e1112();}}},'charset':'utf8mb4','collate':_0x0847('0x34')});}; \ No newline at end of file +var _0x0316=['bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','findOne','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','../../config/logger','api','moment'];(function(_0xec9262,_0x3e62bd){var _0x19aeff=function(_0x39c18a){while(--_0x39c18a){_0xec9262['push'](_0xec9262['shift']());}};_0x19aeff(++_0x3e62bd);}(_0x0316,0x73));var _0x6031=function(_0x3198b4,_0x382898){_0x3198b4=_0x3198b4-0x0;var _0x3e8d6a=_0x0316[_0x3198b4];return _0x3e8d6a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6031('0x0'))(_0x6031('0x1'));var moment=require(_0x6031('0x2'));var BPromise=require(_0x6031('0x3'));var rp=require(_0x6031('0x4'));var fetch=require(_0x6031('0x5'));var fs=require('fs');var path=require(_0x6031('0x6'));var rimraf=require(_0x6031('0x7'));var config=require(_0x6031('0x8'));var attributes=require(_0x6031('0x9'));module[_0x6031('0xa')]=function(_0x3876ea,_0x476aae){return _0x3876ea[_0x6031('0xb')](_0x6031('0xc'),attributes,{'tableName':_0x6031('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x6031('0xe')]},{'name':_0x6031('0xf'),'fields':[_0x6031('0x10')],'type':_0x6031('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bea20,_0x1ec0b8,_0x110b77){var _0xdf1e8b=_0x3876ea[_0x6031('0x12')];var _0x309743=_0x1bea20[_0x6031('0x13')]({'plain':!![]});if(_0x309743[_0x6031('0x14')]['toLowerCase']()==='in'||_0x309743[_0x6031('0x14')][_0x6031('0x15')]()===_0x6031('0x16')&&!_0x309743['secret']&&!_[_0x6031('0x17')](_0x309743['UserId'])){_0xdf1e8b[_0x6031('0x18')][_0x6031('0x19')]({'where':{'id':_0x309743['WhatsappInteractionId']}})['then'](function(_0x29c208){if(_0x29c208){_0x29c208['update']({'lastMsgAt':_0x309743[_0x6031('0x1a')],'lastMsgDirection':_0x309743[_0x6031('0x14')][_0x6031('0x15')]()});}})[_0x6031('0x1b')](function(_0x35977a){console[_0x6031('0x1c')](_0x35977a);});}if(_0x309743[_0x6031('0x14')]==='out'&&!_0x309743['secret']){var _0x333a8b;_0xdf1e8b[_0x6031('0x1d')][_0x6031('0x1e')]({'where':{'id':_0x309743[_0x6031('0x1f')]},'raw':!![]})[_0x6031('0x20')](function(_0x29175f){_0x333a8b=_0x29175f;if(_0x333a8b&&_0x333a8b[_0x6031('0x21')]){switch(_0x333a8b[_0x6031('0x21')]){case _0x6031('0x22'):var _0x47f1a8=require(_0x6031('0x22'));if(_0x333a8b[_0x6031('0x23')]&&_0x333a8b[_0x6031('0x24')]&&_0x333a8b[_0x6031('0x25')]){var _0x4ff2d6=new _0x47f1a8(_0x333a8b['accountSid'],_0x333a8b[_0x6031('0x24')]);_0x4ff2d6[_0x6031('0x26')]['create']({'body':_0x309743['body'],'to':'whatsapp:'+_0x309743[_0x6031('0x25')],'from':_0x6031('0x27')+_0x333a8b['phone'],'statusCallback':_0x333a8b[_0x6031('0x28')]+_0x6031('0x29')+_0x309743['id']+_0x6031('0x2a')+_0x333a8b['token']})['then'](function(_0x3a99b8){if(_0x3a99b8[_0x6031('0x2b')]){return _0x1bea20[_0x6031('0x2c')]({'messageId':_0x3a99b8[_0x6031('0x2b')]});}})['catch'](function(_0xca3940){logger[_0x6031('0x1c')](_0x6031('0x2d'),_0x6031('0x2e'),'twilio',util[_0x6031('0x2f')](_0xca3940,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6031('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x46139b=_0x333a8b['accountSid'];var _0x4e494d=_0x333a8b[_0x6031('0x24')];var _0x1c4a56=_0x333a8b[_0x6031('0x30')]+_0x6031('0x31')+_0x46139b+_0x6031('0x32');var _0xb77e9c={'to':[_0x309743[_0x6031('0x25')]],'message':{'type':_0x6031('0x33'),'text':_0x309743['body']}};var _0x9f80d2={'method':'POST','uri':_0x1c4a56,'headers':{'Authorization':_0x6031('0x34')+_0x4e494d,'Content-Type':_0x6031('0x35')},'body':_0xb77e9c,'json':!![]};rp(_0x9f80d2)['then'](function(_0x2a6d34){if(_0x2a6d34[_0x6031('0x36')][0x0]['message_id']){return _0x1bea20[_0x6031('0x2c')]({'messageId':_0x2a6d34[_0x6031('0x36')][0x0][_0x6031('0x37')]});}})[_0x6031('0x1b')](function(_0x4424c5){logger[_0x6031('0x38')]('WhatsappMessage,\x20%s',_0x4424c5);});break;}}})[_0x6031('0x39')](function(){_0x110b77();});}else{_0x110b77();}}},'charset':_0x6031('0x3a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ced2d08..6b11d95 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 _0xbf51=['rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','request\x20sent','error','code','WhatsappMessage,\x20%s,\x20%s','message','CreateWhatsappMessage','create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13f627,_0x3e236e){var _0x51cf7c=function(_0x785dda){while(--_0x785dda){_0x13f627['push'](_0x13f627['shift']());}};_0x51cf7c(++_0x3e236e);}(_0xbf51,0x197));var _0x1bf5=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xbf51[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x1bf5('0x0'));var util=require(_0x1bf5('0x1'));var moment=require(_0x1bf5('0x2'));var BPromise=require(_0x1bf5('0x3'));var rs=require(_0x1bf5('0x4'));var fs=require('fs');var Redis=require(_0x1bf5('0x5'));var db=require(_0x1bf5('0x6'))['db'];var utils=require(_0x1bf5('0x7'));var logger=require(_0x1bf5('0x8'))(_0x1bf5('0x9'));var config=require(_0x1bf5('0xa'));var jayson=require(_0x1bf5('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x1bf5('0xc')]=_[_0x1bf5('0xd')](config[_0x1bf5('0xc')],{'host':_0x1bf5('0xe'),'port':0x18eb});var socket=require(_0x1bf5('0xf'))(new Redis(config[_0x1bf5('0xc')]));require(_0x1bf5('0x10'))[_0x1bf5('0x11')](socket);function respondWithRpcPromise(_0x43a570,_0x52f848,_0xc569d5){return new BPromise(function(_0x1722f7,_0x316d7a){return client[_0x1bf5('0x12')](_0x43a570,_0xc569d5)['then'](function(_0x428bc6){logger[_0x1bf5('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x52f848,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x52f848,_0x1bf5('0x14'),JSON['stringify'](_0x428bc6));if(_0x428bc6[_0x1bf5('0x15')]){if(_0x428bc6[_0x1bf5('0x15')][_0x1bf5('0x16')]===0x1f4){logger[_0x1bf5('0x15')](_0x1bf5('0x17'),_0x52f848,_0x428bc6[_0x1bf5('0x15')][_0x1bf5('0x18')]);return _0x316d7a(_0x428bc6[_0x1bf5('0x15')][_0x1bf5('0x18')]);}logger[_0x1bf5('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x52f848,_0x428bc6[_0x1bf5('0x15')][_0x1bf5('0x18')]);return _0x1722f7(_0x428bc6[_0x1bf5('0x15')][_0x1bf5('0x18')]);}else{logger[_0x1bf5('0x13')](_0x1bf5('0x17'),_0x52f848,_0x1bf5('0x14'));_0x1722f7(_0x428bc6['result'][_0x1bf5('0x18')]);}})['catch'](function(_0x47f867){logger['error'](_0x1bf5('0x17'),_0x52f848,_0x47f867);_0x316d7a(_0x47f867);});});}exports[_0x1bf5('0x19')]=function(_0x2eefa1){var _0x24cdee=this;return new Promise(function(_0x5e4dbc,_0x175a0f){return db['WhatsappMessage'][_0x1bf5('0x1a')](_0x2eefa1[_0x1bf5('0x1b')],{'raw':_0x2eefa1[_0x1bf5('0x1c')]?_0x2eefa1[_0x1bf5('0x1c')][_0x1bf5('0x1d')]===undefined?!![]:![]:!![]})[_0x1bf5('0x1e')](function(_0xc64719){logger[_0x1bf5('0x13')](_0x1bf5('0x19'),_0x2eefa1);logger['debug'](_0x1bf5('0x19'),_0x2eefa1,JSON['stringify'](_0xc64719));_0x5e4dbc(_0xc64719);})[_0x1bf5('0x1f')](function(_0x15cafc){logger[_0x1bf5('0x15')]('CreateWhatsappMessage',_0x15cafc[_0x1bf5('0x18')],_0x2eefa1);_0x175a0f(_0x24cdee[_0x1bf5('0x15')](0x1f4,_0x15cafc[_0x1bf5('0x18')]));});});}; \ No newline at end of file +var _0x5b4c=['register','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateWhatsappMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter'];(function(_0x44124b,_0x2b2b32){var _0xafe8bf=function(_0x421d4e){while(--_0x421d4e){_0x44124b['push'](_0x44124b['shift']());}};_0xafe8bf(++_0x2b2b32);}(_0x5b4c,0x76));var _0xc5b4=function(_0x96f91,_0x393eb6){_0x96f91=_0x96f91-0x0;var _0x110a72=_0x5b4c[_0x96f91];return _0x110a72;};'use strict';var _=require(_0xc5b4('0x0'));var util=require(_0xc5b4('0x1'));var moment=require(_0xc5b4('0x2'));var BPromise=require('bluebird');var rs=require(_0xc5b4('0x3'));var fs=require('fs');var Redis=require(_0xc5b4('0x4'));var db=require(_0xc5b4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5b4('0x6'))(_0xc5b4('0x7'));var config=require(_0xc5b4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc5b4('0x9')](config['redis'],{'host':_0xc5b4('0xa'),'port':0x18eb});var socket=require(_0xc5b4('0xb'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xc5b4('0xc')](socket);function respondWithRpcPromise(_0x160a30,_0xf13d7f,_0x488711){return new BPromise(function(_0x6a6f21,_0x3b642d){return client['request'](_0x160a30,_0x488711)[_0xc5b4('0xd')](function(_0x50e277){logger['info'](_0xc5b4('0xe'),_0xf13d7f,'request\x20sent');logger[_0xc5b4('0xf')](_0xc5b4('0x10'),_0xf13d7f,'request\x20sent',JSON['stringify'](_0x50e277));if(_0x50e277[_0xc5b4('0x11')]){if(_0x50e277[_0xc5b4('0x11')][_0xc5b4('0x12')]===0x1f4){logger[_0xc5b4('0x11')](_0xc5b4('0xe'),_0xf13d7f,_0x50e277[_0xc5b4('0x11')]['message']);return _0x3b642d(_0x50e277[_0xc5b4('0x11')][_0xc5b4('0x13')]);}logger[_0xc5b4('0x11')](_0xc5b4('0xe'),_0xf13d7f,_0x50e277[_0xc5b4('0x11')][_0xc5b4('0x13')]);return _0x6a6f21(_0x50e277[_0xc5b4('0x11')][_0xc5b4('0x13')]);}else{logger[_0xc5b4('0x14')](_0xc5b4('0xe'),_0xf13d7f,'request\x20sent');_0x6a6f21(_0x50e277['result'][_0xc5b4('0x13')]);}})[_0xc5b4('0x15')](function(_0x3f1477){logger[_0xc5b4('0x11')](_0xc5b4('0xe'),_0xf13d7f,_0x3f1477);_0x3b642d(_0x3f1477);});});}exports[_0xc5b4('0x16')]=function(_0x38f1aa){var _0x4dad8f=this;return new Promise(function(_0x2d88b7,_0x5784a1){return db['WhatsappMessage']['create'](_0x38f1aa[_0xc5b4('0x17')],{'raw':_0x38f1aa['options']?_0x38f1aa[_0xc5b4('0x18')][_0xc5b4('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x138f30){logger[_0xc5b4('0x14')](_0xc5b4('0x16'),_0x38f1aa);logger[_0xc5b4('0xf')](_0xc5b4('0x16'),_0x38f1aa,JSON['stringify'](_0x138f30));_0x2d88b7(_0x138f30);})[_0xc5b4('0x15')](function(_0x2253d5){logger[_0xc5b4('0x11')]('CreateWhatsappMessage',_0x2253d5[_0xc5b4('0x13')],_0x38f1aa);_0x5784a1(_0x4dad8f['error'](0x1f4,_0x2253d5[_0xc5b4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2797cd4..cccdaec 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 _0x2e4e=['register','length','whatsappMessage:','./whatsappMessage.events','save','remove','emit','removeListener'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0x2e4e,0xe3));var _0xe2e4=function(_0x5ba741,_0x4e6108){_0x5ba741=_0x5ba741-0x0;var _0x853871=_0x2e4e[_0x5ba741];return _0x853871;};'use strict';var WhatsappMessageEvents=require(_0xe2e4('0x0'));var events=[_0xe2e4('0x1'),_0xe2e4('0x2'),'update'];function createListener(_0x1b1afc,_0x90e5de){return function(_0x139c18){_0x90e5de[_0xe2e4('0x3')](_0x1b1afc,_0x139c18);};}function removeListener(_0x30c2d2,_0x522b4a){return function(){WhatsappMessageEvents[_0xe2e4('0x4')](_0x30c2d2,_0x522b4a);};}exports[_0xe2e4('0x5')]=function(_0x1d25d5){for(var _0x404fc0=0x0,_0x2529fe=events[_0xe2e4('0x6')];_0x404fc0<_0x2529fe;_0x404fc0++){var _0x5b2b9f=events[_0x404fc0];var _0x4b08b8=createListener(_0xe2e4('0x7')+_0x5b2b9f,_0x1d25d5);WhatsappMessageEvents['on'](_0x5b2b9f,_0x4b08b8);}}; \ No newline at end of file +var _0xdec3=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','emit'];(function(_0x1fc3d3,_0x464f04){var _0x4e8587=function(_0x301cf0){while(--_0x301cf0){_0x1fc3d3['push'](_0x1fc3d3['shift']());}};_0x4e8587(++_0x464f04);}(_0xdec3,0xac));var _0x3dec=function(_0x50e153,_0x4e8ede){_0x50e153=_0x50e153-0x0;var _0x3f76e1=_0xdec3[_0x50e153];return _0x3f76e1;};'use strict';var WhatsappMessageEvents=require(_0x3dec('0x0'));var events=[_0x3dec('0x1'),_0x3dec('0x2'),'update'];function createListener(_0xfd7196,_0x317f78){return function(_0x1ab277){_0x317f78[_0x3dec('0x3')](_0xfd7196,_0x1ab277);};}function removeListener(_0x550b94,_0x255741){return function(){WhatsappMessageEvents[_0x3dec('0x4')](_0x550b94,_0x255741);};}exports[_0x3dec('0x5')]=function(_0x44cc0f){for(var _0x16ccfb=0x0,_0x16a972=events[_0x3dec('0x6')];_0x16ccfb<_0x16a972;_0x16ccfb++){var _0x4c06a2=events[_0x16ccfb];var _0x342d6d=createListener(_0x3dec('0x7')+_0x4c06a2,_0x44cc0f);WhatsappMessageEvents['on'](_0x4c06a2,_0x342d6d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5af799a..08c2cfe 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 _0x59d3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeTeams','path','express'];(function(_0x3aeec2,_0x167576){var _0xbf0ef1=function(_0x18101d){while(--_0x18101d){_0x3aeec2['push'](_0x3aeec2['shift']());}};_0xbf0ef1(++_0x167576);}(_0x59d3,0x80));var _0x359d=function(_0x124e6e,_0x6cc353){_0x124e6e=_0x124e6e-0x0;var _0x57b566=_0x59d3[_0x124e6e];return _0x57b566;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x359d('0x0'));var timeout=require('connect-timeout');var express=require(_0x359d('0x1'));var router=express[_0x359d('0x2')]();var fs_extra=require(_0x359d('0x3'));var auth=require(_0x359d('0x4'));var interaction=require(_0x359d('0x5'));var config=require(_0x359d('0x6'));var controller=require(_0x359d('0x7'));router[_0x359d('0x8')]('/',auth[_0x359d('0x9')](),controller[_0x359d('0xa')]);router[_0x359d('0x8')](_0x359d('0xb'),auth[_0x359d('0x9')](),controller['describe']);router[_0x359d('0x8')](_0x359d('0xc'),auth['isAuthenticated'](),controller[_0x359d('0xd')]);router[_0x359d('0x8')](_0x359d('0xe'),auth[_0x359d('0x9')](),controller[_0x359d('0xf')]);router[_0x359d('0x8')](_0x359d('0x10'),auth[_0x359d('0x9')](),controller['getTeams']);router['get'](_0x359d('0x11'),auth['isAuthenticated'](),controller[_0x359d('0x12')]);router[_0x359d('0x13')]('/',auth[_0x359d('0x9')](),controller[_0x359d('0x14')]);router[_0x359d('0x13')](_0x359d('0x10'),auth[_0x359d('0x9')](),controller['addTeams']);router[_0x359d('0x13')]('/:id/users',auth[_0x359d('0x9')](),controller[_0x359d('0x15')]);router[_0x359d('0x16')]('/:id',auth[_0x359d('0x9')](),controller['update']);router[_0x359d('0x17')]('/:id',auth[_0x359d('0x9')](),controller[_0x359d('0x18')]);router[_0x359d('0x17')](_0x359d('0x10'),auth['isAuthenticated'](),controller[_0x359d('0x19')]);router['delete'](_0x359d('0x11'),auth[_0x359d('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x052d=['/:id/users','post','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','path','Router','../../components/auth/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','/:id/teams'];(function(_0x1d9eb4,_0x4ec2f1){var _0x12ec6d=function(_0x3fb2fe){while(--_0x3fb2fe){_0x1d9eb4['push'](_0x1d9eb4['shift']());}};_0x12ec6d(++_0x4ec2f1);}(_0x052d,0xef));var _0xd052=function(_0x2a4973,_0x94f97b){_0x2a4973=_0x2a4973-0x0;var _0x42871e=_0x052d[_0x2a4973];return _0x42871e;};'use strict';var multer=require(_0xd052('0x0'));var util=require('util');var path=require(_0xd052('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd052('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd052('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd052('0x4'));var controller=require(_0xd052('0x5'));router['get']('/',auth[_0xd052('0x6')](),controller[_0xd052('0x7')]);router[_0xd052('0x8')](_0xd052('0x9'),auth[_0xd052('0x6')](),controller['describe']);router[_0xd052('0x8')](_0xd052('0xa'),auth[_0xd052('0x6')](),controller[_0xd052('0xb')]);router[_0xd052('0x8')](_0xd052('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0xd052('0x8')](_0xd052('0xd'),auth[_0xd052('0x6')](),controller['getTeams']);router[_0xd052('0x8')](_0xd052('0xe'),auth[_0xd052('0x6')](),controller['getAgents']);router[_0xd052('0xf')]('/',auth[_0xd052('0x6')](),controller['create']);router[_0xd052('0xf')](_0xd052('0xd'),auth[_0xd052('0x6')](),controller['addTeams']);router['post'](_0xd052('0xe'),auth[_0xd052('0x6')](),controller[_0xd052('0x10')]);router[_0xd052('0x11')](_0xd052('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd052('0xa'),auth[_0xd052('0x6')](),controller[_0xd052('0x12')]);router[_0xd052('0x13')](_0xd052('0xd'),auth[_0xd052('0x6')](),controller[_0xd052('0x14')]);router['delete'](_0xd052('0xe'),auth['isAuthenticated'](),controller[_0xd052('0x15')]);module[_0xd052('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 9ff5a79..f8a14de 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 _0x4584=['roundrobin','sequelize','STRING','name','INTEGER','beepall'];(function(_0xe8c2e1,_0x3af17c){var _0x268038=function(_0x5f4bbf){while(--_0x5f4bbf){_0xe8c2e1['push'](_0xe8c2e1['shift']());}};_0x268038(++_0x3af17c);}(_0x4584,0x1cf));var _0x4458=function(_0x29632e,_0x40f63f){_0x29632e=_0x29632e-0x0;var _0xda5a7e=_0x4584[_0x29632e];return _0xda5a7e;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'name':{'type':Sequelize[_0x4458('0x1')],'unique':_0x4458('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4458('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4458('0x4'),_0x4458('0x5'))},'description':{'type':Sequelize[_0x4458('0x1')]}}; \ No newline at end of file +var _0x6599=['ENUM','beepall','exports','STRING','name','INTEGER'];(function(_0x4fe684,_0x3b6019){var _0x2c1667=function(_0x8c92ae){while(--_0x8c92ae){_0x4fe684['push'](_0x4fe684['shift']());}};_0x2c1667(++_0x3b6019);}(_0x6599,0xb0));var _0x9659=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x6599[_0x4ee9cd];return _0x328a5b;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'name':{'type':Sequelize[_0x9659('0x1')],'unique':_0x9659('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9659('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9659('0x4')]('rrmemory',_0x9659('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x9659('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 88fbd4e..cbc347b 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 _0x3a07=['fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','find','create','body','user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserWhatsappQueue','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','length','order','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','clone','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','get','UserProfileResource','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3a07,0x15f));var _0x73a0=function(_0x120733,_0x583570){_0x120733=_0x120733-0x0;var _0x4ca6ce=_0x3a07[_0x120733];return _0x4ca6ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x73a0('0x0'));var zipdir=require(_0x73a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73a0('0x2'));var moment=require(_0x73a0('0x3'));var BPromise=require(_0x73a0('0x4'));var Mustache=require(_0x73a0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x73a0('0x6'));var csv=require(_0x73a0('0x7'));var ejs=require(_0x73a0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73a0('0x9'));var squel=require(_0x73a0('0xa'));var crypto=require(_0x73a0('0xb'));var jsforce=require(_0x73a0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x73a0('0x7'));var querystring=require(_0x73a0('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x73a0('0xe'));var qs=require(_0x73a0('0xf'));var as=require(_0x73a0('0x10'));var hardwareService=require(_0x73a0('0x11'));var logger=require(_0x73a0('0x12'))('api');var utils=require(_0x73a0('0x13'));var config=require(_0x73a0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x73a0('0x15'))['db'];config[_0x73a0('0x16')]=_['defaults'](config[_0x73a0('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73a0('0x16')]));require(_0x73a0('0x17'))[_0x73a0('0x18')](socket);function respondWithStatusCode(_0x41d6a8,_0x2c83da){_0x2c83da=_0x2c83da||0xcc;return function(_0x3735d4){if(_0x3735d4){return _0x41d6a8[_0x73a0('0x19')](_0x2c83da);}return _0x41d6a8[_0x73a0('0x1a')](_0x2c83da)[_0x73a0('0x1b')]();};}function respondWithResult(_0x3fea70,_0xaa2b8f){_0xaa2b8f=_0xaa2b8f||0xc8;return function(_0x7de72e){if(_0x7de72e){return _0x3fea70['status'](_0xaa2b8f)[_0x73a0('0x1c')](_0x7de72e);}};}function respondWithFilteredResult(_0x1c0621,_0x2bfac0){return function(_0x5980aa){if(_0x5980aa){var _0x4985cf=typeof _0x2bfac0[_0x73a0('0x1d')]===_0x73a0('0x1e')&&typeof _0x2bfac0['limit']===_0x73a0('0x1e');var _0x1526d1=_0x5980aa[_0x73a0('0x1f')];var _0x27d015=_0x4985cf?0x0:_0x2bfac0[_0x73a0('0x1d')];var _0x174b73=_0x4985cf?_0x5980aa[_0x73a0('0x1f')]:_0x2bfac0[_0x73a0('0x1d')]+_0x2bfac0[_0x73a0('0x20')];var _0x3a9afd;if(_0x174b73>=_0x1526d1){_0x174b73=_0x1526d1;_0x3a9afd=0xc8;}else{_0x3a9afd=0xce;}_0x1c0621[_0x73a0('0x1a')](_0x3a9afd);return _0x1c0621[_0x73a0('0x21')](_0x73a0('0x22'),_0x27d015+'-'+_0x174b73+'/'+_0x1526d1)[_0x73a0('0x1c')](_0x5980aa);}return null;};}function patchUpdates(_0x1a950a){return function(_0x3b8ff5){try{jsonpatch['apply'](_0x3b8ff5,_0x1a950a,!![]);}catch(_0x151cf5){return BPromise[_0x73a0('0x23')](_0x151cf5);}return _0x3b8ff5['save']();};}function saveUpdates(_0x186bac,_0x9e92c1){return function(_0x10e1a3){if(_0x10e1a3){return _0x10e1a3['update'](_0x186bac)[_0x73a0('0x24')](function(_0x6b6a76){return _0x6b6a76;});}return null;};}function removeEntity(_0x216678,_0x84d363){return function(_0x12d72e){if(_0x12d72e){return _0x12d72e[_0x73a0('0x25')]()[_0x73a0('0x24')](function(){var _0x369891=_0x12d72e[_0x73a0('0x26')]({'plain':!![]});var _0x1b65b1='WhatsappQueues';return db[_0x73a0('0x27')][_0x73a0('0x25')]({'where':{'type':_0x1b65b1,'resourceId':_0x369891['id']}})[_0x73a0('0x24')](function(){return _0x12d72e;});})['then'](function(){_0x216678['status'](0xcc)[_0x73a0('0x1b')]();});}};}function handleEntityNotFound(_0x1b4f29,_0x3c64d1){return function(_0x2bc712){if(!_0x2bc712){_0x1b4f29['sendStatus'](0x194);}return _0x2bc712;};}function handleError(_0x124a81,_0x328d17){_0x328d17=_0x328d17||0x1f4;return function(_0x166757){logger['error'](_0x166757['stack']);if(_0x166757[_0x73a0('0x28')]){delete _0x166757['name'];}_0x124a81[_0x73a0('0x1a')](_0x328d17)[_0x73a0('0x29')](_0x166757);};}exports[_0x73a0('0x2a')]=function(_0x44aeac,_0x55c211){var _0x3221fb={},_0x3087c7={},_0x550146={'count':0x0,'rows':[]};var _0x226e6d=_[_0x73a0('0x2b')](db[_0x73a0('0x2c')][_0x73a0('0x2d')],function(_0x4424aa){return{'name':_0x4424aa[_0x73a0('0x2e')],'type':_0x4424aa[_0x73a0('0x2f')][_0x73a0('0x30')]};});_0x3087c7['model']=_['map'](_0x226e6d,_0x73a0('0x28'));_0x3087c7[_0x73a0('0x31')]=_['keys'](_0x44aeac['query']);_0x3087c7[_0x73a0('0x32')]=_[_0x73a0('0x33')](_0x3087c7[_0x73a0('0x34')],_0x3087c7[_0x73a0('0x31')]);_0x3221fb[_0x73a0('0x35')]=_[_0x73a0('0x33')](_0x3087c7['model'],qs['fields'](_0x44aeac[_0x73a0('0x31')][_0x73a0('0x36')]));_0x3221fb[_0x73a0('0x35')]=_0x3221fb[_0x73a0('0x35')]['length']?_0x3221fb[_0x73a0('0x35')]:_0x3087c7['model'];if(!_0x44aeac[_0x73a0('0x31')][_0x73a0('0x37')](_0x73a0('0x38'))){_0x3221fb[_0x73a0('0x20')]=qs[_0x73a0('0x20')](_0x44aeac[_0x73a0('0x31')][_0x73a0('0x20')]);_0x3221fb[_0x73a0('0x1d')]=qs[_0x73a0('0x1d')](_0x44aeac[_0x73a0('0x31')][_0x73a0('0x1d')]);}_0x3221fb['order']=qs[_0x73a0('0x39')](_0x44aeac[_0x73a0('0x31')]['sort']);_0x3221fb[_0x73a0('0x3a')]=qs[_0x73a0('0x32')](_[_0x73a0('0x3b')](_0x44aeac['query'],_0x3087c7[_0x73a0('0x32')]),_0x226e6d);if(_0x44aeac[_0x73a0('0x31')][_0x73a0('0x3c')]){_0x3221fb['where']=_[_0x73a0('0x3d')](_0x3221fb[_0x73a0('0x3a')],{'$or':_['map'](_0x226e6d,function(_0x38a74c){if(_0x38a74c[_0x73a0('0x2f')]!==_0x73a0('0x3e')){var _0x3edf6a={};_0x3edf6a[_0x38a74c[_0x73a0('0x28')]]={'$like':'%'+_0x44aeac[_0x73a0('0x31')]['filter']+'%'};return _0x3edf6a;}})});}_0x3221fb=_[_0x73a0('0x3d')]({},_0x3221fb,_0x44aeac[_0x73a0('0x3f')]);var _0x8c785b={'where':_0x3221fb['where']};return db['WhatsappQueue'][_0x73a0('0x1f')](_0x8c785b)['then'](function(_0x1901d7){_0x550146[_0x73a0('0x1f')]=_0x1901d7;if(_0x44aeac['query'][_0x73a0('0x40')]){_0x3221fb['include']=[{'all':!![]}];}return db[_0x73a0('0x2c')][_0x73a0('0x41')](_0x3221fb);})[_0x73a0('0x24')](function(_0x4126a5){_0x550146[_0x73a0('0x42')]=_0x4126a5;return _0x550146;})[_0x73a0('0x24')](respondWithFilteredResult(_0x55c211,_0x3221fb))[_0x73a0('0x43')](handleError(_0x55c211,null));};exports[_0x73a0('0x44')]=function(_0x4ec021,_0x2baf0e){var _0x561b83={'raw':!![],'where':{'id':_0x4ec021['params']['id']}},_0x19b0f7={};_0x19b0f7['model']=_['keys'](db[_0x73a0('0x2c')]['rawAttributes']);_0x19b0f7[_0x73a0('0x31')]=_[_0x73a0('0x45')](_0x4ec021[_0x73a0('0x31')]);_0x19b0f7[_0x73a0('0x32')]=_['intersection'](_0x19b0f7[_0x73a0('0x34')],_0x19b0f7['query']);_0x561b83['attributes']=_[_0x73a0('0x33')](_0x19b0f7[_0x73a0('0x34')],qs['fields'](_0x4ec021[_0x73a0('0x31')][_0x73a0('0x36')]));_0x561b83[_0x73a0('0x35')]=_0x561b83['attributes']['length']?_0x561b83[_0x73a0('0x35')]:_0x19b0f7[_0x73a0('0x34')];if(_0x4ec021[_0x73a0('0x31')][_0x73a0('0x40')]){_0x561b83['include']=[{'all':!![]}];}_0x561b83=_['merge']({},_0x561b83,_0x4ec021[_0x73a0('0x3f')]);return db[_0x73a0('0x2c')][_0x73a0('0x46')](_0x561b83)[_0x73a0('0x24')](handleEntityNotFound(_0x2baf0e,null))[_0x73a0('0x24')](respondWithResult(_0x2baf0e,null))[_0x73a0('0x43')](handleError(_0x2baf0e,null));};exports[_0x73a0('0x47')]=function(_0x1218d5,_0x2ebbc8){return db['WhatsappQueue']['create'](_0x1218d5[_0x73a0('0x48')],{})[_0x73a0('0x24')](function(_0x5161ec){var _0x5830ae=_0x1218d5[_0x73a0('0x49')]['get']({'plain':!![]});if(!_0x5830ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5830ae['role']===_0x73a0('0x49')){var _0x4d5ab3=_0x5161ec[_0x73a0('0x26')]({'plain':!![]});var _0x23bcd5=_0x73a0('0x4a');return db[_0x73a0('0x4b')][_0x73a0('0x46')]({'where':{'name':_0x23bcd5,'userProfileId':_0x5830ae[_0x73a0('0x4c')]},'raw':!![]})[_0x73a0('0x24')](function(_0x5c5c74){if(_0x5c5c74&&_0x5c5c74[_0x73a0('0x4d')]===0x0){return db[_0x73a0('0x27')][_0x73a0('0x47')]({'name':_0x4d5ab3['name'],'resourceId':_0x4d5ab3['id'],'type':_0x5c5c74[_0x73a0('0x28')],'sectionId':_0x5c5c74['id']},{})['then'](function(){return _0x5161ec;});}else{return _0x5161ec;}})[_0x73a0('0x43')](function(_0x4a8237){logger['error'](_0x73a0('0x4e'),_0x4a8237);throw _0x4a8237;});}return _0x5161ec;})[_0x73a0('0x24')](respondWithResult(_0x2ebbc8,0xc9))['catch'](handleError(_0x2ebbc8,null));};exports[_0x73a0('0x4f')]=function(_0x2a70f2,_0x167a0c){if(_0x2a70f2[_0x73a0('0x48')]['id']){delete _0x2a70f2[_0x73a0('0x48')]['id'];}return db[_0x73a0('0x2c')][_0x73a0('0x46')]({'where':{'id':_0x2a70f2[_0x73a0('0x50')]['id']}})[_0x73a0('0x24')](handleEntityNotFound(_0x167a0c,null))[_0x73a0('0x24')](saveUpdates(_0x2a70f2[_0x73a0('0x48')],null))[_0x73a0('0x24')](respondWithResult(_0x167a0c,null))['catch'](handleError(_0x167a0c,null));};exports['destroy']=function(_0x36376c,_0x1e72d5){return db['WhatsappQueue'][_0x73a0('0x46')]({'where':{'id':_0x36376c[_0x73a0('0x50')]['id']}})[_0x73a0('0x24')](handleEntityNotFound(_0x1e72d5,null))[_0x73a0('0x24')](removeEntity(_0x1e72d5,null))['catch'](handleError(_0x1e72d5,null));};exports[_0x73a0('0x51')]=function(_0x4023a2,_0x27b021){return db['WhatsappQueue'][_0x73a0('0x51')]()[_0x73a0('0x24')](respondWithResult(_0x27b021,null))['catch'](handleError(_0x27b021,null));};exports['getMembers']=function(_0x5daf42,_0x43a040,_0x51ce36){var _0x49bf06={'raw':!![],'where':{}},_0x4dfe84={},_0x4e5d2c;return db[_0x73a0('0x2c')]['findOne']({'where':{'id':_0x5daf42['params']['id']}})[_0x73a0('0x24')](handleEntityNotFound(_0x43a040,null))[_0x73a0('0x24')](function(_0x1fe7cb){if(_0x1fe7cb){_0x4e5d2c=_0x1fe7cb[_0x73a0('0x26')]({'plain':!![]});_0x4dfe84['model']=_[_0x73a0('0x45')](db[_0x73a0('0x52')]['rawAttributes']);_0x4dfe84[_0x73a0('0x31')]=_[_0x73a0('0x45')](_0x5daf42[_0x73a0('0x31')]);_0x4dfe84[_0x73a0('0x32')]=_['intersection'](_0x4dfe84[_0x73a0('0x34')],_0x4dfe84['query']);_0x49bf06[_0x73a0('0x35')]=_['intersection'](_0x4dfe84[_0x73a0('0x34')],qs['fields'](_0x5daf42[_0x73a0('0x31')][_0x73a0('0x36')]));_0x49bf06[_0x73a0('0x35')]=_0x49bf06[_0x73a0('0x35')]['length']?_0x49bf06[_0x73a0('0x35')]:_0x4dfe84[_0x73a0('0x34')];if(!_0x5daf42[_0x73a0('0x31')][_0x73a0('0x37')](_0x73a0('0x38'))){_0x49bf06['limit']=qs[_0x73a0('0x20')](_0x5daf42[_0x73a0('0x31')][_0x73a0('0x20')]);_0x49bf06[_0x73a0('0x1d')]=qs[_0x73a0('0x1d')](_0x5daf42[_0x73a0('0x31')]['offset']);}_0x49bf06['order']=qs[_0x73a0('0x39')](_0x5daf42['query'][_0x73a0('0x39')]);_0x49bf06[_0x73a0('0x3a')]=qs[_0x73a0('0x32')](_[_0x73a0('0x3b')](_0x5daf42[_0x73a0('0x31')],_0x4dfe84[_0x73a0('0x32')]));_0x49bf06[_0x73a0('0x3a')]['WhatsappQueueId']=_0x1fe7cb['id'];if(_0x5daf42['query']['filter']){_0x49bf06['where']=_[_0x73a0('0x3d')](_0x49bf06[_0x73a0('0x3a')],{'$or':_[_0x73a0('0x2b')](_0x49bf06[_0x73a0('0x35')],function(_0x2043ac){var _0x4beeb4={};_0x4beeb4[_0x2043ac]={'$like':'%'+_0x5daf42[_0x73a0('0x31')][_0x73a0('0x3c')]+'%'};return _0x4beeb4;})});}_0x49bf06=_[_0x73a0('0x3d')]({},_0x49bf06,_0x5daf42[_0x73a0('0x3f')]);return db[_0x73a0('0x52')][_0x73a0('0x41')](_0x49bf06);}})[_0x73a0('0x24')](function(_0xdcc504){if(_0xdcc504){return db[_0x73a0('0x53')]['findAndCountAll']({'where':{'id':_[_0x73a0('0x2b')](_0xdcc504,_0x73a0('0x54')),'role':_0x73a0('0x55')},'attributes':['id',_0x73a0('0x28'),_0x73a0('0x56'),_0x73a0('0x57'),_0x73a0('0x58')]});}})['then'](function(_0x2e4fab){if(_0x2e4fab){return{'count':_0x2e4fab['count'],'rows':_[_0x73a0('0x2b')](_0x2e4fab[_0x73a0('0x42')],function(_0x16b732){return{'membername':_0x16b732['name'],'UserId':_0x16b732['id'],'queue_name':_0x4e5d2c[_0x73a0('0x28')],'WhatsappQueueId':_0x4e5d2c['id'],'interface':util[_0x73a0('0x59')](_0x73a0('0x5a'),_0x73a0('0x5b'),_0x16b732[_0x73a0('0x28')]),'penalty':0x0,'paused':_0x16b732[_0x73a0('0x56')],'createdAt':_0x16b732[_0x73a0('0x58')],'updatedAt':_0x16b732[_0x73a0('0x57')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x73a0('0x24')](respondWithFilteredResult(_0x43a040,_0x49bf06))[_0x73a0('0x43')](handleError(_0x43a040,null));};exports[_0x73a0('0x5c')]=function(_0x1b5c12,_0x11673b,_0x227dce){var _0x4f761d={};var _0x23ad93={};var _0x1bfc9b;var _0x2ebbf1;return db[_0x73a0('0x2c')][_0x73a0('0x5d')]({'where':{'id':_0x1b5c12['params']['id']}})[_0x73a0('0x24')](handleEntityNotFound(_0x11673b,null))[_0x73a0('0x24')](function(_0x1b125f){if(_0x1b125f){_0x1bfc9b=_0x1b125f;_0x23ad93[_0x73a0('0x34')]=_[_0x73a0('0x45')](db[_0x73a0('0x5e')]['rawAttributes']);_0x23ad93[_0x73a0('0x31')]=_[_0x73a0('0x45')](_0x1b5c12[_0x73a0('0x31')]);_0x23ad93[_0x73a0('0x32')]=_[_0x73a0('0x33')](_0x23ad93[_0x73a0('0x34')],_0x23ad93[_0x73a0('0x31')]);_0x4f761d[_0x73a0('0x35')]=_['intersection'](_0x23ad93[_0x73a0('0x34')],qs[_0x73a0('0x36')](_0x1b5c12[_0x73a0('0x31')][_0x73a0('0x36')]));_0x4f761d['attributes']=_0x4f761d[_0x73a0('0x35')][_0x73a0('0x5f')]?_0x4f761d[_0x73a0('0x35')]:_0x23ad93['model'];_0x4f761d[_0x73a0('0x60')]=qs['sort'](_0x1b5c12[_0x73a0('0x31')][_0x73a0('0x39')]);_0x4f761d[_0x73a0('0x3a')]=qs[_0x73a0('0x32')](_[_0x73a0('0x3b')](_0x1b5c12[_0x73a0('0x31')],_0x23ad93[_0x73a0('0x32')]));if(_0x1b5c12[_0x73a0('0x31')][_0x73a0('0x3c')]){_0x4f761d['where']=_['merge'](_0x4f761d[_0x73a0('0x3a')],{'$or':_[_0x73a0('0x2b')](_0x4f761d[_0x73a0('0x35')],function(_0x53e696){var _0x1eba03={};_0x1eba03[_0x53e696]={'$like':'%'+_0x1b5c12[_0x73a0('0x31')][_0x73a0('0x3c')]+'%'};return _0x1eba03;})});}_0x4f761d=_[_0x73a0('0x3d')]({},_0x4f761d,_0x1b5c12[_0x73a0('0x3f')]);return _0x1bfc9b[_0x73a0('0x5c')](_0x4f761d);}})[_0x73a0('0x24')](function(_0x3cba19){if(_0x3cba19){_0x2ebbf1=_0x3cba19['length'];if(!_0x1b5c12[_0x73a0('0x31')][_0x73a0('0x37')]('nolimit')){_0x4f761d[_0x73a0('0x20')]=qs[_0x73a0('0x20')](_0x1b5c12[_0x73a0('0x31')][_0x73a0('0x20')]);_0x4f761d['offset']=qs[_0x73a0('0x1d')](_0x1b5c12['query'][_0x73a0('0x1d')]);}return _0x1bfc9b[_0x73a0('0x5c')](_0x4f761d);}})[_0x73a0('0x24')](function(_0x4518e9){if(_0x4518e9){return _0x4518e9?{'count':_0x2ebbf1,'rows':_0x4518e9}:null;}})[_0x73a0('0x24')](respondWithResult(_0x11673b,null))[_0x73a0('0x43')](handleError(_0x11673b,null));};exports['addTeams']=function(_0x3c4ee4,_0x29d29f,_0x46e97c){var _0x4dea2f=_0x3c4ee4['body'][_0x73a0('0x61')];return db[_0x73a0('0x5e')][_0x73a0('0x41')]({'where':{'id':_0x4dea2f},'attributes':['id'],'include':[{'model':db[_0x73a0('0x53')],'as':_0x73a0('0x62'),'attributes':['id',_0x73a0('0x28'),'online',_0x73a0('0x63'),_0x73a0('0x64')],'raw':!![]}]})[_0x73a0('0x24')](function(_0x42f5e3){if(_0x42f5e3){var _0x5ee732=_[_0x73a0('0x65')](_0x42f5e3,function(_0x37f2ad){var _0xac3a2a=_0x37f2ad[_0x73a0('0x26')]({'plain':!![]});return _0xac3a2a['Agents'];});return db['WhatsappQueue'][_0x73a0('0x46')]({'where':{'id':_0x3c4ee4[_0x73a0('0x50')]['id']}})[_0x73a0('0x24')](function(_0x30a696){return db[_0x73a0('0x66')][_0x73a0('0x67')](function(_0xb226d9){return _0x30a696[_0x73a0('0x68')](_0x4dea2f,{'transaction':_0xb226d9})['then'](function(){return BPromise[_0x73a0('0x69')](_0x5ee732,function(_0x307ff0){return db[_0x73a0('0x52')][_0x73a0('0x6a')]({'where':{'UserId':_0x307ff0['id'],'WhatsappQueueId':_0x3c4ee4[_0x73a0('0x50')]['id']},'transaction':_0xb226d9});});})[_0x73a0('0x24')](function(){_0x5ee732[_0x73a0('0x6b')](function(_0xc32b3){socket['emit'](_0x73a0('0x6c'),{'UserId':_0xc32b3['id'],'WhatsappQueueId':_0x30a696['id']});});});});});}})[_0x73a0('0x24')](respondWithStatusCode(_0x29d29f,null))[_0x73a0('0x43')](handleError(_0x29d29f,null));};exports['removeTeams']=function(_0x314987,_0x3c40a4,_0xa57d6d){return db[_0x73a0('0x5e')][_0x73a0('0x41')]({'where':{'id':_0x314987[_0x73a0('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x73a0('0x53')],'as':_0x73a0('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c40a4,null))[_0x73a0('0x24')](function(_0x15df17){var _0x5e1bd4=_[_0x73a0('0x2b')](_0x15df17,'id');var _0x1a1fc4=[];var _0x5112e6=[];var _0x5db7fe=squel[_0x73a0('0x6d')]();_0x5db7fe[_0x73a0('0x6e')](_0x73a0('0x6f'))[_0x73a0('0x70')](_0x73a0('0x71'),'tq')[_0x73a0('0x72')](_0x73a0('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('WhatsappQueueId\x20=\x20?',_0x314987[_0x73a0('0x50')]['id']);for(var _0x34f3a6=0x0;_0x34f3a6<_0x15df17[_0x73a0('0x5f')];_0x34f3a6+=0x1){let _0x493ff0=_0x15df17[_0x34f3a6];for(var _0xcb599a=0x0;_0xcb599a<_0x493ff0[_0x73a0('0x62')]['length'];_0xcb599a+=0x1){let _0x284f37=_0x493ff0[_0x73a0('0x62')][_0xcb599a];var _0x276151=_0x5db7fe[_0x73a0('0x74')]();_0x276151[_0x73a0('0x3a')]('ut.UserId\x20=\x20?',_0x284f37['id']);_0x5112e6['push'](db[_0x73a0('0x66')]['query'](_0x276151[_0x73a0('0x75')](),{'type':db[_0x73a0('0x66')][_0x73a0('0x76')][_0x73a0('0x77')]})[_0x73a0('0x24')](function(_0x155118){if(_0x155118[_0x73a0('0x5f')]===0x1){return _0x284f37['id'];}else{var _0x3f8a4d=_[_0x73a0('0x78')](_['map'](_0x155118,'TeamId'),function(_0x353d47){return _[_0x73a0('0x79')](_0x5e1bd4,_0x353d47);});if(_0x3f8a4d){return _0x284f37['id'];}}}));}}return BPromise[_0x73a0('0x7a')](_0x5112e6)['then'](function(_0x7c749){_0x1a1fc4=_(_0x1a1fc4)[_0x73a0('0x7b')](_0x7c749)[_0x73a0('0x7c')]()[_0x73a0('0x7d')]();return db['WhatsappQueue'][_0x73a0('0x46')]({'where':{'id':_0x314987[_0x73a0('0x50')]['id']}})['then'](function(_0x43baa8){return db['sequelize'][_0x73a0('0x67')](function(_0x42eca3){return _0x43baa8[_0x73a0('0x7e')](_0x314987[_0x73a0('0x31')]['ids'],{'transaction':_0x42eca3})[_0x73a0('0x24')](function(){if(!_['isEmpty'](_0x1a1fc4)){return _0x43baa8[_0x73a0('0x7f')](_0x1a1fc4,{'transaction':_0x42eca3});}})[_0x73a0('0x24')](function(){_0x1a1fc4[_0x73a0('0x6b')](function(_0xab9240){socket[_0x73a0('0x80')](_0x73a0('0x81'),{'UserId':_0xab9240,'WhatsappQueueId':_0x43baa8['id']});});});});});});})[_0x73a0('0x24')](respondWithStatusCode(_0x3c40a4,null))[_0x73a0('0x43')](handleError(_0x3c40a4,null));};exports[_0x73a0('0x82')]=function(_0x4a4120,_0x28bd31,_0x46c8f8){return db[_0x73a0('0x2c')][_0x73a0('0x46')]({'where':{'id':_0x4a4120[_0x73a0('0x50')]['id']}})['then'](handleEntityNotFound(_0x28bd31,null))['then'](function(_0x2c07e9){if(_0x2c07e9){return _0x2c07e9[_0x73a0('0x82')](_0x4a4120[_0x73a0('0x48')][_0x73a0('0x61')],_[_0x73a0('0x83')](_0x4a4120['body'],[_0x73a0('0x61'),'id'])||{})[_0x73a0('0x84')](function(_0x3b4b9a){for(var _0x499655=0x0;_0x499655<_0x4a4120[_0x73a0('0x48')][_0x73a0('0x61')][_0x73a0('0x5f')];_0x499655+=0x1){socket[_0x73a0('0x80')](_0x73a0('0x6c'),{'UserId':Number(_0x4a4120[_0x73a0('0x48')][_0x73a0('0x61')][_0x499655]),'WhatsappQueueId':Number(_0x4a4120[_0x73a0('0x50')]['id'])});}return _0x3b4b9a;});}})[_0x73a0('0x24')](respondWithResult(_0x28bd31,null))[_0x73a0('0x43')](handleError(_0x28bd31,null));};exports[_0x73a0('0x7f')]=function(_0x5bb279,_0x485451,_0x21bb47){return db[_0x73a0('0x2c')][_0x73a0('0x46')]({'where':{'id':_0x5bb279[_0x73a0('0x50')]['id']}})[_0x73a0('0x24')](handleEntityNotFound(_0x485451,null))[_0x73a0('0x24')](function(_0x2d2e47){if(_0x2d2e47){return _0x2d2e47[_0x73a0('0x7f')](_0x5bb279[_0x73a0('0x31')][_0x73a0('0x61')])[_0x73a0('0x24')](function(){if(_[_0x73a0('0x85')](_0x5bb279[_0x73a0('0x31')][_0x73a0('0x61')])){for(var _0x1b8c4f=0x0;_0x1b8c4f<_0x5bb279[_0x73a0('0x31')][_0x73a0('0x61')][_0x73a0('0x5f')];_0x1b8c4f+=0x1){socket[_0x73a0('0x80')](_0x73a0('0x81'),{'UserId':Number(_0x5bb279[_0x73a0('0x31')]['ids'][_0x1b8c4f]),'WhatsappQueueId':Number(_0x5bb279[_0x73a0('0x50')]['id'])});}}else{socket['emit'](_0x73a0('0x81'),{'UserId':Number(_0x5bb279[_0x73a0('0x31')][_0x73a0('0x61')]),'WhatsappQueueId':Number(_0x5bb279[_0x73a0('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x485451,null))[_0x73a0('0x43')](handleError(_0x485451,null));};exports[_0x73a0('0x86')]=function(_0x54544b,_0x1460b5,_0x1c7dff){var _0x3d18d8={};var _0x469ebe={};var _0xed2ecb;var _0x1b67d6;return db[_0x73a0('0x2c')][_0x73a0('0x5d')]({'where':{'id':_0x54544b[_0x73a0('0x50')]['id']}})['then'](handleEntityNotFound(_0x1460b5,null))[_0x73a0('0x24')](function(_0x18670d){if(_0x18670d){_0xed2ecb=_0x18670d;_0x469ebe['model']=_[_0x73a0('0x45')](db[_0x73a0('0x53')][_0x73a0('0x2d')]);_0x469ebe[_0x73a0('0x31')]=_[_0x73a0('0x45')](_0x54544b[_0x73a0('0x31')]);_0x469ebe['filters']=_[_0x73a0('0x33')](_0x469ebe[_0x73a0('0x34')],_0x469ebe['query']);_0x3d18d8[_0x73a0('0x35')]=_['intersection'](_0x469ebe[_0x73a0('0x34')],qs[_0x73a0('0x36')](_0x54544b[_0x73a0('0x31')][_0x73a0('0x36')]));_0x3d18d8['attributes']=_0x3d18d8['attributes']['length']?_0x3d18d8[_0x73a0('0x35')]:_0x469ebe['model'];_0x3d18d8[_0x73a0('0x60')]=qs[_0x73a0('0x39')](_0x54544b[_0x73a0('0x31')]['sort']);_0x3d18d8[_0x73a0('0x3a')]=qs[_0x73a0('0x32')](_[_0x73a0('0x3b')](_0x54544b[_0x73a0('0x31')],_0x469ebe['filters']));if(_0x54544b[_0x73a0('0x31')][_0x73a0('0x3c')]){_0x3d18d8[_0x73a0('0x3a')]=_[_0x73a0('0x3d')](_0x3d18d8[_0x73a0('0x3a')],{'$or':_[_0x73a0('0x2b')](_0x3d18d8['attributes'],function(_0x276812){var _0x1f82a0={};_0x1f82a0[_0x276812]={'$like':'%'+_0x54544b[_0x73a0('0x31')][_0x73a0('0x3c')]+'%'};return _0x1f82a0;})});}_0x3d18d8=_['merge']({},_0x3d18d8,_0x54544b[_0x73a0('0x3f')]);return _0xed2ecb[_0x73a0('0x86')](_0x3d18d8);}})[_0x73a0('0x24')](function(_0x24d0f6){if(_0x24d0f6){_0x1b67d6=_0x24d0f6[_0x73a0('0x5f')];if(!_0x54544b[_0x73a0('0x31')]['hasOwnProperty'](_0x73a0('0x38'))){_0x3d18d8[_0x73a0('0x20')]=qs[_0x73a0('0x20')](_0x54544b[_0x73a0('0x31')]['limit']);_0x3d18d8[_0x73a0('0x1d')]=qs[_0x73a0('0x1d')](_0x54544b[_0x73a0('0x31')][_0x73a0('0x1d')]);}return _0xed2ecb[_0x73a0('0x86')](_0x3d18d8);}})[_0x73a0('0x24')](function(_0x53d2fc){if(_0x53d2fc){return _0x53d2fc?{'count':_0x1b67d6,'rows':_0x53d2fc}:null;}})[_0x73a0('0x24')](respondWithResult(_0x1460b5,null))[_0x73a0('0x43')](handleError(_0x1460b5,null));}; \ No newline at end of file +var _0xea15=['json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','createdAt','Team','filter','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','removeTeams','User','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','SELECT','every','TeamId','includes','all','union','compact','removeAgents','emit','addAgents','omit','spread','userWhatsappQueue:save','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end'];(function(_0x3b5c38,_0x2c7022){var _0x442ebd=function(_0x738ed7){while(--_0x738ed7){_0x3b5c38['push'](_0x3b5c38['shift']());}};_0x442ebd(++_0x2c7022);}(_0xea15,0xf4));var _0x5ea1=function(_0x9d679d,_0x4dd38a){_0x9d679d=_0x9d679d-0x0;var _0x3ce1dc=_0xea15[_0x9d679d];return _0x3ce1dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ea1('0x0'));var zipdir=require(_0x5ea1('0x1'));var jsonpatch=require(_0x5ea1('0x2'));var rp=require(_0x5ea1('0x3'));var moment=require(_0x5ea1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ea1('0x5'));var util=require(_0x5ea1('0x6'));var path=require(_0x5ea1('0x7'));var sox=require(_0x5ea1('0x8'));var csv=require(_0x5ea1('0x9'));var ejs=require(_0x5ea1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5ea1('0xb'));var crypto=require('crypto');var jsforce=require(_0x5ea1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ea1('0xd'));var Papa=require('papaparse');var Redis=require(_0x5ea1('0xe'));var authService=require(_0x5ea1('0xf'));var qs=require(_0x5ea1('0x10'));var as=require(_0x5ea1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ea1('0x12'))('api');var utils=require(_0x5ea1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5ea1('0x14'));var db=require('../../mysqldb')['db'];config[_0x5ea1('0x15')]=_[_0x5ea1('0x16')](config[_0x5ea1('0x15')],{'host':_0x5ea1('0x17'),'port':0x18eb});var socket=require(_0x5ea1('0x18'))(new Redis(config['redis']));require(_0x5ea1('0x19'))[_0x5ea1('0x1a')](socket);function respondWithStatusCode(_0xe6bc98,_0x27e0ee){_0x27e0ee=_0x27e0ee||0xcc;return function(_0x2c2699){if(_0x2c2699){return _0xe6bc98[_0x5ea1('0x1b')](_0x27e0ee);}return _0xe6bc98[_0x5ea1('0x1c')](_0x27e0ee)[_0x5ea1('0x1d')]();};}function respondWithResult(_0x133a6,_0x39a5d3){_0x39a5d3=_0x39a5d3||0xc8;return function(_0x5498e5){if(_0x5498e5){return _0x133a6[_0x5ea1('0x1c')](_0x39a5d3)[_0x5ea1('0x1e')](_0x5498e5);}};}function respondWithFilteredResult(_0x403942,_0x45cc43){return function(_0x3ba900){if(_0x3ba900){var _0x304252=typeof _0x45cc43[_0x5ea1('0x1f')]===_0x5ea1('0x20')&&typeof _0x45cc43[_0x5ea1('0x21')]===_0x5ea1('0x20');var _0xed422b=_0x3ba900[_0x5ea1('0x22')];var _0x5d9fc1=_0x304252?0x0:_0x45cc43['offset'];var _0x436688=_0x304252?_0x3ba900[_0x5ea1('0x22')]:_0x45cc43[_0x5ea1('0x1f')]+_0x45cc43['limit'];var _0x335969;if(_0x436688>=_0xed422b){_0x436688=_0xed422b;_0x335969=0xc8;}else{_0x335969=0xce;}_0x403942[_0x5ea1('0x1c')](_0x335969);return _0x403942['set']('Content-Range',_0x5d9fc1+'-'+_0x436688+'/'+_0xed422b)[_0x5ea1('0x1e')](_0x3ba900);}return null;};}function patchUpdates(_0x29aaa8){return function(_0x1a72a8){try{jsonpatch[_0x5ea1('0x23')](_0x1a72a8,_0x29aaa8,!![]);}catch(_0x478fd9){return BPromise[_0x5ea1('0x24')](_0x478fd9);}return _0x1a72a8[_0x5ea1('0x25')]();};}function saveUpdates(_0x255678,_0x3557f1){return function(_0x2be049){if(_0x2be049){return _0x2be049[_0x5ea1('0x26')](_0x255678)[_0x5ea1('0x27')](function(_0xa9659b){return _0xa9659b;});}return null;};}function removeEntity(_0x2f0d91,_0x475f3c){return function(_0x7ecfe7){if(_0x7ecfe7){return _0x7ecfe7[_0x5ea1('0x28')]()[_0x5ea1('0x27')](function(){var _0x2bf8c2=_0x7ecfe7[_0x5ea1('0x29')]({'plain':!![]});var _0x5ba9df=_0x5ea1('0x2a');return db[_0x5ea1('0x2b')][_0x5ea1('0x28')]({'where':{'type':_0x5ba9df,'resourceId':_0x2bf8c2['id']}})[_0x5ea1('0x27')](function(){return _0x7ecfe7;});})[_0x5ea1('0x27')](function(){_0x2f0d91['status'](0xcc)[_0x5ea1('0x1d')]();});}};}function handleEntityNotFound(_0x2a0e3e,_0x44cc90){return function(_0x18d8bd){if(!_0x18d8bd){_0x2a0e3e[_0x5ea1('0x1b')](0x194);}return _0x18d8bd;};}function handleError(_0x4ac10a,_0x29a1f9){_0x29a1f9=_0x29a1f9||0x1f4;return function(_0x1bae89){logger[_0x5ea1('0x2c')](_0x1bae89[_0x5ea1('0x2d')]);if(_0x1bae89[_0x5ea1('0x2e')]){delete _0x1bae89['name'];}_0x4ac10a[_0x5ea1('0x1c')](_0x29a1f9)[_0x5ea1('0x2f')](_0x1bae89);};}exports['index']=function(_0x34abf1,_0x412778){var _0x1891f6={},_0x9fe8bc={},_0x3e9b50={'count':0x0,'rows':[]};var _0x453c1c=_[_0x5ea1('0x30')](db[_0x5ea1('0x31')][_0x5ea1('0x32')],function(_0x565c67){return{'name':_0x565c67[_0x5ea1('0x33')],'type':_0x565c67[_0x5ea1('0x34')][_0x5ea1('0x35')]};});_0x9fe8bc[_0x5ea1('0x36')]=_[_0x5ea1('0x30')](_0x453c1c,'name');_0x9fe8bc['query']=_[_0x5ea1('0x37')](_0x34abf1['query']);_0x9fe8bc[_0x5ea1('0x38')]=_[_0x5ea1('0x39')](_0x9fe8bc[_0x5ea1('0x36')],_0x9fe8bc[_0x5ea1('0x3a')]);_0x1891f6[_0x5ea1('0x3b')]=_[_0x5ea1('0x39')](_0x9fe8bc[_0x5ea1('0x36')],qs[_0x5ea1('0x3c')](_0x34abf1[_0x5ea1('0x3a')][_0x5ea1('0x3c')]));_0x1891f6[_0x5ea1('0x3b')]=_0x1891f6[_0x5ea1('0x3b')][_0x5ea1('0x3d')]?_0x1891f6[_0x5ea1('0x3b')]:_0x9fe8bc[_0x5ea1('0x36')];if(!_0x34abf1[_0x5ea1('0x3a')][_0x5ea1('0x3e')](_0x5ea1('0x3f'))){_0x1891f6['limit']=qs[_0x5ea1('0x21')](_0x34abf1['query'][_0x5ea1('0x21')]);_0x1891f6[_0x5ea1('0x1f')]=qs[_0x5ea1('0x1f')](_0x34abf1['query'][_0x5ea1('0x1f')]);}_0x1891f6[_0x5ea1('0x40')]=qs[_0x5ea1('0x41')](_0x34abf1[_0x5ea1('0x3a')][_0x5ea1('0x41')]);_0x1891f6[_0x5ea1('0x42')]=qs[_0x5ea1('0x38')](_[_0x5ea1('0x43')](_0x34abf1['query'],_0x9fe8bc[_0x5ea1('0x38')]),_0x453c1c);if(_0x34abf1[_0x5ea1('0x3a')]['filter']){_0x1891f6[_0x5ea1('0x42')]=_[_0x5ea1('0x44')](_0x1891f6[_0x5ea1('0x42')],{'$or':_['map'](_0x453c1c,function(_0x13acbe){if(_0x13acbe[_0x5ea1('0x34')]!==_0x5ea1('0x45')){var _0x5d7ba5={};_0x5d7ba5[_0x13acbe[_0x5ea1('0x2e')]]={'$like':'%'+_0x34abf1['query']['filter']+'%'};return _0x5d7ba5;}})});}_0x1891f6=_[_0x5ea1('0x44')]({},_0x1891f6,_0x34abf1[_0x5ea1('0x46')]);var _0x21eb4a={'where':_0x1891f6['where']};return db[_0x5ea1('0x31')][_0x5ea1('0x22')](_0x21eb4a)[_0x5ea1('0x27')](function(_0x43e604){_0x3e9b50['count']=_0x43e604;if(_0x34abf1[_0x5ea1('0x3a')][_0x5ea1('0x47')]){_0x1891f6['include']=[{'all':!![]}];}return db[_0x5ea1('0x31')][_0x5ea1('0x48')](_0x1891f6);})[_0x5ea1('0x27')](function(_0x362f39){_0x3e9b50[_0x5ea1('0x49')]=_0x362f39;return _0x3e9b50;})[_0x5ea1('0x27')](respondWithFilteredResult(_0x412778,_0x1891f6))['catch'](handleError(_0x412778,null));};exports[_0x5ea1('0x4a')]=function(_0x345ada,_0xf7a2c0){var _0x2a30ff={'raw':!![],'where':{'id':_0x345ada[_0x5ea1('0x4b')]['id']}},_0x1a87e0={};_0x1a87e0[_0x5ea1('0x36')]=_['keys'](db['WhatsappQueue'][_0x5ea1('0x32')]);_0x1a87e0[_0x5ea1('0x3a')]=_[_0x5ea1('0x37')](_0x345ada[_0x5ea1('0x3a')]);_0x1a87e0[_0x5ea1('0x38')]=_[_0x5ea1('0x39')](_0x1a87e0['model'],_0x1a87e0[_0x5ea1('0x3a')]);_0x2a30ff[_0x5ea1('0x3b')]=_[_0x5ea1('0x39')](_0x1a87e0['model'],qs[_0x5ea1('0x3c')](_0x345ada[_0x5ea1('0x3a')][_0x5ea1('0x3c')]));_0x2a30ff[_0x5ea1('0x3b')]=_0x2a30ff[_0x5ea1('0x3b')][_0x5ea1('0x3d')]?_0x2a30ff['attributes']:_0x1a87e0['model'];if(_0x345ada[_0x5ea1('0x3a')][_0x5ea1('0x47')]){_0x2a30ff[_0x5ea1('0x4c')]=[{'all':!![]}];}_0x2a30ff=_[_0x5ea1('0x44')]({},_0x2a30ff,_0x345ada[_0x5ea1('0x46')]);return db[_0x5ea1('0x31')]['find'](_0x2a30ff)[_0x5ea1('0x27')](handleEntityNotFound(_0xf7a2c0,null))[_0x5ea1('0x27')](respondWithResult(_0xf7a2c0,null))[_0x5ea1('0x4d')](handleError(_0xf7a2c0,null));};exports['create']=function(_0xbf0d3d,_0x38bd1c){return db['WhatsappQueue']['create'](_0xbf0d3d['body'],{})[_0x5ea1('0x27')](function(_0x2a33f3){var _0x1898d1=_0xbf0d3d[_0x5ea1('0x4e')][_0x5ea1('0x29')]({'plain':!![]});if(!_0x1898d1)throw new Error(_0x5ea1('0x4f'));if(_0x1898d1[_0x5ea1('0x50')]===_0x5ea1('0x4e')){var _0x5b035a=_0x2a33f3[_0x5ea1('0x29')]({'plain':!![]});var _0xe89335='WhatsappQueues';return db['UserProfileSection'][_0x5ea1('0x51')]({'where':{'name':_0xe89335,'userProfileId':_0x1898d1[_0x5ea1('0x52')]},'raw':!![]})[_0x5ea1('0x27')](function(_0x143e37){if(_0x143e37&&_0x143e37['autoAssociation']===0x0){return db[_0x5ea1('0x2b')]['create']({'name':_0x5b035a[_0x5ea1('0x2e')],'resourceId':_0x5b035a['id'],'type':_0x143e37['name'],'sectionId':_0x143e37['id']},{})[_0x5ea1('0x27')](function(){return _0x2a33f3;});}else{return _0x2a33f3;}})['catch'](function(_0x4465e3){logger[_0x5ea1('0x2c')](_0x5ea1('0x53'),_0x4465e3);throw _0x4465e3;});}return _0x2a33f3;})[_0x5ea1('0x27')](respondWithResult(_0x38bd1c,0xc9))['catch'](handleError(_0x38bd1c,null));};exports[_0x5ea1('0x26')]=function(_0x104279,_0x24eb66){if(_0x104279['body']['id']){delete _0x104279[_0x5ea1('0x54')]['id'];}return db[_0x5ea1('0x31')]['find']({'where':{'id':_0x104279['params']['id']}})['then'](handleEntityNotFound(_0x24eb66,null))['then'](saveUpdates(_0x104279['body'],null))[_0x5ea1('0x27')](respondWithResult(_0x24eb66,null))[_0x5ea1('0x4d')](handleError(_0x24eb66,null));};exports[_0x5ea1('0x28')]=function(_0x3fd178,_0x2b5887){return db[_0x5ea1('0x31')]['find']({'where':{'id':_0x3fd178[_0x5ea1('0x4b')]['id']}})[_0x5ea1('0x27')](handleEntityNotFound(_0x2b5887,null))[_0x5ea1('0x27')](removeEntity(_0x2b5887,null))[_0x5ea1('0x4d')](handleError(_0x2b5887,null));};exports[_0x5ea1('0x55')]=function(_0x4ef39f,_0x24110c){return db[_0x5ea1('0x31')][_0x5ea1('0x55')]()[_0x5ea1('0x27')](respondWithResult(_0x24110c,null))[_0x5ea1('0x4d')](handleError(_0x24110c,null));};exports[_0x5ea1('0x56')]=function(_0x59ee9c,_0x1052f4,_0x496ab7){var _0x61b921={'raw':!![],'where':{}},_0x11706a={},_0x2a1849;return db[_0x5ea1('0x31')][_0x5ea1('0x57')]({'where':{'id':_0x59ee9c['params']['id']}})[_0x5ea1('0x27')](handleEntityNotFound(_0x1052f4,null))[_0x5ea1('0x27')](function(_0x4e5467){if(_0x4e5467){_0x2a1849=_0x4e5467[_0x5ea1('0x29')]({'plain':!![]});_0x11706a[_0x5ea1('0x36')]=_[_0x5ea1('0x37')](db[_0x5ea1('0x58')]['rawAttributes']);_0x11706a['query']=_[_0x5ea1('0x37')](_0x59ee9c[_0x5ea1('0x3a')]);_0x11706a['filters']=_['intersection'](_0x11706a[_0x5ea1('0x36')],_0x11706a[_0x5ea1('0x3a')]);_0x61b921[_0x5ea1('0x3b')]=_[_0x5ea1('0x39')](_0x11706a[_0x5ea1('0x36')],qs[_0x5ea1('0x3c')](_0x59ee9c[_0x5ea1('0x3a')][_0x5ea1('0x3c')]));_0x61b921[_0x5ea1('0x3b')]=_0x61b921[_0x5ea1('0x3b')][_0x5ea1('0x3d')]?_0x61b921[_0x5ea1('0x3b')]:_0x11706a[_0x5ea1('0x36')];if(!_0x59ee9c[_0x5ea1('0x3a')]['hasOwnProperty'](_0x5ea1('0x3f'))){_0x61b921[_0x5ea1('0x21')]=qs[_0x5ea1('0x21')](_0x59ee9c[_0x5ea1('0x3a')][_0x5ea1('0x21')]);_0x61b921['offset']=qs['offset'](_0x59ee9c[_0x5ea1('0x3a')][_0x5ea1('0x1f')]);}_0x61b921[_0x5ea1('0x40')]=qs[_0x5ea1('0x41')](_0x59ee9c[_0x5ea1('0x3a')][_0x5ea1('0x41')]);_0x61b921[_0x5ea1('0x42')]=qs[_0x5ea1('0x38')](_[_0x5ea1('0x43')](_0x59ee9c[_0x5ea1('0x3a')],_0x11706a[_0x5ea1('0x38')]));_0x61b921[_0x5ea1('0x42')][_0x5ea1('0x59')]=_0x4e5467['id'];if(_0x59ee9c[_0x5ea1('0x3a')]['filter']){_0x61b921[_0x5ea1('0x42')]=_['merge'](_0x61b921[_0x5ea1('0x42')],{'$or':_[_0x5ea1('0x30')](_0x61b921[_0x5ea1('0x3b')],function(_0x3fb4b8){var _0x5667e6={};_0x5667e6[_0x3fb4b8]={'$like':'%'+_0x59ee9c['query']['filter']+'%'};return _0x5667e6;})});}_0x61b921=_[_0x5ea1('0x44')]({},_0x61b921,_0x59ee9c[_0x5ea1('0x46')]);return db[_0x5ea1('0x58')][_0x5ea1('0x48')](_0x61b921);}})['then'](function(_0x2a2fd8){if(_0x2a2fd8){return db['User'][_0x5ea1('0x5a')]({'where':{'id':_[_0x5ea1('0x30')](_0x2a2fd8,_0x5ea1('0x5b')),'role':_0x5ea1('0x5c')},'attributes':['id','name',_0x5ea1('0x5d'),'updatedAt',_0x5ea1('0x5e')]});}})[_0x5ea1('0x27')](function(_0x6fa76d){if(_0x6fa76d){return{'count':_0x6fa76d[_0x5ea1('0x22')],'rows':_[_0x5ea1('0x30')](_0x6fa76d[_0x5ea1('0x49')],function(_0x1ced19){return{'membername':_0x1ced19[_0x5ea1('0x2e')],'UserId':_0x1ced19['id'],'queue_name':_0x2a1849[_0x5ea1('0x2e')],'WhatsappQueueId':_0x2a1849['id'],'interface':util['format']('%s/%s','SIP',_0x1ced19[_0x5ea1('0x2e')]),'penalty':0x0,'paused':_0x1ced19[_0x5ea1('0x5d')],'createdAt':_0x1ced19[_0x5ea1('0x5e')],'updatedAt':_0x1ced19['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ea1('0x27')](respondWithFilteredResult(_0x1052f4,_0x61b921))[_0x5ea1('0x4d')](handleError(_0x1052f4,null));};exports['getTeams']=function(_0x3dc271,_0x6a5654,_0x5868d6){var _0x226b6f={};var _0x4f6799={};var _0x1a682f;var _0x3f5a4d;return db[_0x5ea1('0x31')][_0x5ea1('0x57')]({'where':{'id':_0x3dc271['params']['id']}})[_0x5ea1('0x27')](handleEntityNotFound(_0x6a5654,null))[_0x5ea1('0x27')](function(_0x33ccd9){if(_0x33ccd9){_0x1a682f=_0x33ccd9;_0x4f6799[_0x5ea1('0x36')]=_[_0x5ea1('0x37')](db[_0x5ea1('0x5f')]['rawAttributes']);_0x4f6799[_0x5ea1('0x3a')]=_[_0x5ea1('0x37')](_0x3dc271[_0x5ea1('0x3a')]);_0x4f6799[_0x5ea1('0x38')]=_[_0x5ea1('0x39')](_0x4f6799['model'],_0x4f6799[_0x5ea1('0x3a')]);_0x226b6f[_0x5ea1('0x3b')]=_[_0x5ea1('0x39')](_0x4f6799[_0x5ea1('0x36')],qs['fields'](_0x3dc271[_0x5ea1('0x3a')][_0x5ea1('0x3c')]));_0x226b6f[_0x5ea1('0x3b')]=_0x226b6f[_0x5ea1('0x3b')][_0x5ea1('0x3d')]?_0x226b6f['attributes']:_0x4f6799[_0x5ea1('0x36')];_0x226b6f[_0x5ea1('0x40')]=qs[_0x5ea1('0x41')](_0x3dc271['query'][_0x5ea1('0x41')]);_0x226b6f[_0x5ea1('0x42')]=qs[_0x5ea1('0x38')](_[_0x5ea1('0x43')](_0x3dc271[_0x5ea1('0x3a')],_0x4f6799[_0x5ea1('0x38')]));if(_0x3dc271['query'][_0x5ea1('0x60')]){_0x226b6f['where']=_[_0x5ea1('0x44')](_0x226b6f[_0x5ea1('0x42')],{'$or':_[_0x5ea1('0x30')](_0x226b6f[_0x5ea1('0x3b')],function(_0x137014){var _0xb8c7ef={};_0xb8c7ef[_0x137014]={'$like':'%'+_0x3dc271[_0x5ea1('0x3a')][_0x5ea1('0x60')]+'%'};return _0xb8c7ef;})});}_0x226b6f=_[_0x5ea1('0x44')]({},_0x226b6f,_0x3dc271[_0x5ea1('0x46')]);return _0x1a682f['getTeams'](_0x226b6f);}})[_0x5ea1('0x27')](function(_0x42d6b0){if(_0x42d6b0){_0x3f5a4d=_0x42d6b0[_0x5ea1('0x3d')];if(!_0x3dc271[_0x5ea1('0x3a')][_0x5ea1('0x3e')]('nolimit')){_0x226b6f[_0x5ea1('0x21')]=qs[_0x5ea1('0x21')](_0x3dc271['query'][_0x5ea1('0x21')]);_0x226b6f[_0x5ea1('0x1f')]=qs['offset'](_0x3dc271[_0x5ea1('0x3a')][_0x5ea1('0x1f')]);}return _0x1a682f['getTeams'](_0x226b6f);}})[_0x5ea1('0x27')](function(_0x225605){if(_0x225605){return _0x225605?{'count':_0x3f5a4d,'rows':_0x225605}:null;}})['then'](respondWithResult(_0x6a5654,null))[_0x5ea1('0x4d')](handleError(_0x6a5654,null));};exports[_0x5ea1('0x61')]=function(_0x254c0d,_0x2ebf3c,_0x524a99){var _0x4d0e89=_0x254c0d['body'][_0x5ea1('0x62')];return db[_0x5ea1('0x5f')]['findAll']({'where':{'id':_0x4d0e89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5ea1('0x2e'),_0x5ea1('0x63'),_0x5ea1('0x64'),_0x5ea1('0x65')],'raw':!![]}]})[_0x5ea1('0x27')](function(_0x2c5161){if(_0x2c5161){var _0x418549=_[_0x5ea1('0x66')](_0x2c5161,function(_0x47acd4){var _0x533d94=_0x47acd4[_0x5ea1('0x29')]({'plain':!![]});return _0x533d94[_0x5ea1('0x67')];});return db[_0x5ea1('0x31')]['find']({'where':{'id':_0x254c0d['params']['id']}})[_0x5ea1('0x27')](function(_0x36ade0){return db[_0x5ea1('0x68')][_0x5ea1('0x69')](function(_0x163bb0){return _0x36ade0[_0x5ea1('0x61')](_0x4d0e89,{'transaction':_0x163bb0})[_0x5ea1('0x27')](function(){return BPromise[_0x5ea1('0x6a')](_0x418549,function(_0x545ddd){return db[_0x5ea1('0x58')][_0x5ea1('0x6b')]({'where':{'UserId':_0x545ddd['id'],'WhatsappQueueId':_0x254c0d['params']['id']},'transaction':_0x163bb0});});})[_0x5ea1('0x27')](function(){_0x418549[_0x5ea1('0x6c')](function(_0x293002){socket['emit']('userWhatsappQueue:save',{'UserId':_0x293002['id'],'WhatsappQueueId':_0x36ade0['id']});});});});});}})['then'](respondWithStatusCode(_0x2ebf3c,null))['catch'](handleError(_0x2ebf3c,null));};exports[_0x5ea1('0x6d')]=function(_0x227fdc,_0x1982f7,_0x1ea1bf){return db[_0x5ea1('0x5f')][_0x5ea1('0x48')]({'where':{'id':_0x227fdc[_0x5ea1('0x3a')][_0x5ea1('0x62')]},'attributes':['id'],'include':[{'model':db[_0x5ea1('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5ea1('0x27')](handleEntityNotFound(_0x1982f7,null))['then'](function(_0x4d14e1){var _0x8af568=_['map'](_0x4d14e1,'id');var _0x25eb8f=[];var _0xe6241e=[];var _0x2688fe=squel[_0x5ea1('0x6f')]();_0x2688fe['field'](_0x5ea1('0x70'))[_0x5ea1('0x71')](_0x5ea1('0x72'),'tq')[_0x5ea1('0x73')](_0x5ea1('0x74'),'ut',_0x5ea1('0x75'))[_0x5ea1('0x42')](_0x5ea1('0x76'),_0x227fdc['params']['id']);for(var _0x50be7d=0x0;_0x50be7d<_0x4d14e1['length'];_0x50be7d+=0x1){let _0x5096cb=_0x4d14e1[_0x50be7d];for(var _0x33db1f=0x0;_0x33db1f<_0x5096cb['Agents'][_0x5ea1('0x3d')];_0x33db1f+=0x1){let _0x59ec72=_0x5096cb[_0x5ea1('0x67')][_0x33db1f];var _0x288ca5=_0x2688fe[_0x5ea1('0x77')]();_0x288ca5['where']('ut.UserId\x20=\x20?',_0x59ec72['id']);_0xe6241e[_0x5ea1('0x78')](db[_0x5ea1('0x68')]['query'](_0x288ca5['toString'](),{'type':db['sequelize']['QueryTypes'][_0x5ea1('0x79')]})[_0x5ea1('0x27')](function(_0x373f3f){if(_0x373f3f[_0x5ea1('0x3d')]===0x1){return _0x59ec72['id'];}else{var _0x261481=_[_0x5ea1('0x7a')](_[_0x5ea1('0x30')](_0x373f3f,_0x5ea1('0x7b')),function(_0x1b195a){return _[_0x5ea1('0x7c')](_0x8af568,_0x1b195a);});if(_0x261481){return _0x59ec72['id'];}}}));}}return BPromise[_0x5ea1('0x7d')](_0xe6241e)['then'](function(_0x3d86b3){_0x25eb8f=_(_0x25eb8f)[_0x5ea1('0x7e')](_0x3d86b3)[_0x5ea1('0x7f')]()['value']();return db[_0x5ea1('0x31')][_0x5ea1('0x51')]({'where':{'id':_0x227fdc['params']['id']}})[_0x5ea1('0x27')](function(_0x288364){return db['sequelize'][_0x5ea1('0x69')](function(_0x57709a){return _0x288364[_0x5ea1('0x6d')](_0x227fdc['query'][_0x5ea1('0x62')],{'transaction':_0x57709a})['then'](function(){if(!_['isEmpty'](_0x25eb8f)){return _0x288364[_0x5ea1('0x80')](_0x25eb8f,{'transaction':_0x57709a});}})[_0x5ea1('0x27')](function(){_0x25eb8f['forEach'](function(_0x2e9586){socket[_0x5ea1('0x81')]('userWhatsappQueue:remove',{'UserId':_0x2e9586,'WhatsappQueueId':_0x288364['id']});});});});});});})['then'](respondWithStatusCode(_0x1982f7,null))[_0x5ea1('0x4d')](handleError(_0x1982f7,null));};exports[_0x5ea1('0x82')]=function(_0x432856,_0x4b6683,_0x1fdae3){return db[_0x5ea1('0x31')][_0x5ea1('0x51')]({'where':{'id':_0x432856['params']['id']}})[_0x5ea1('0x27')](handleEntityNotFound(_0x4b6683,null))[_0x5ea1('0x27')](function(_0x11b214){if(_0x11b214){return _0x11b214[_0x5ea1('0x82')](_0x432856[_0x5ea1('0x54')][_0x5ea1('0x62')],_[_0x5ea1('0x83')](_0x432856[_0x5ea1('0x54')],['ids','id'])||{})[_0x5ea1('0x84')](function(_0x4f5829){for(var _0x139131=0x0;_0x139131<_0x432856[_0x5ea1('0x54')][_0x5ea1('0x62')][_0x5ea1('0x3d')];_0x139131+=0x1){socket[_0x5ea1('0x81')](_0x5ea1('0x85'),{'UserId':Number(_0x432856[_0x5ea1('0x54')][_0x5ea1('0x62')][_0x139131]),'WhatsappQueueId':Number(_0x432856[_0x5ea1('0x4b')]['id'])});}return _0x4f5829;});}})[_0x5ea1('0x27')](respondWithResult(_0x4b6683,null))[_0x5ea1('0x4d')](handleError(_0x4b6683,null));};exports[_0x5ea1('0x80')]=function(_0x516815,_0x2fd63d,_0x491a6d){return db[_0x5ea1('0x31')]['find']({'where':{'id':_0x516815[_0x5ea1('0x4b')]['id']}})[_0x5ea1('0x27')](handleEntityNotFound(_0x2fd63d,null))[_0x5ea1('0x27')](function(_0x3ebbe6){if(_0x3ebbe6){return _0x3ebbe6[_0x5ea1('0x80')](_0x516815[_0x5ea1('0x3a')][_0x5ea1('0x62')])[_0x5ea1('0x27')](function(){if(_[_0x5ea1('0x86')](_0x516815[_0x5ea1('0x3a')][_0x5ea1('0x62')])){for(var _0x20aea9=0x0;_0x20aea9<_0x516815[_0x5ea1('0x3a')][_0x5ea1('0x62')][_0x5ea1('0x3d')];_0x20aea9+=0x1){socket[_0x5ea1('0x81')](_0x5ea1('0x87'),{'UserId':Number(_0x516815[_0x5ea1('0x3a')][_0x5ea1('0x62')][_0x20aea9]),'WhatsappQueueId':Number(_0x516815[_0x5ea1('0x4b')]['id'])});}}else{socket[_0x5ea1('0x81')](_0x5ea1('0x87'),{'UserId':Number(_0x516815[_0x5ea1('0x3a')]['ids']),'WhatsappQueueId':Number(_0x516815[_0x5ea1('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fd63d,null))['catch'](handleError(_0x2fd63d,null));};exports[_0x5ea1('0x88')]=function(_0x2ea8a1,_0x5725e5,_0x4029df){var _0x4d4c1e={};var _0x74f2aa={};var _0x421dc7;var _0x537bcd;return db[_0x5ea1('0x31')][_0x5ea1('0x57')]({'where':{'id':_0x2ea8a1[_0x5ea1('0x4b')]['id']}})[_0x5ea1('0x27')](handleEntityNotFound(_0x5725e5,null))[_0x5ea1('0x27')](function(_0x471aa2){if(_0x471aa2){_0x421dc7=_0x471aa2;_0x74f2aa[_0x5ea1('0x36')]=_[_0x5ea1('0x37')](db[_0x5ea1('0x6e')][_0x5ea1('0x32')]);_0x74f2aa[_0x5ea1('0x3a')]=_[_0x5ea1('0x37')](_0x2ea8a1[_0x5ea1('0x3a')]);_0x74f2aa['filters']=_[_0x5ea1('0x39')](_0x74f2aa[_0x5ea1('0x36')],_0x74f2aa[_0x5ea1('0x3a')]);_0x4d4c1e[_0x5ea1('0x3b')]=_[_0x5ea1('0x39')](_0x74f2aa[_0x5ea1('0x36')],qs['fields'](_0x2ea8a1['query'][_0x5ea1('0x3c')]));_0x4d4c1e['attributes']=_0x4d4c1e[_0x5ea1('0x3b')][_0x5ea1('0x3d')]?_0x4d4c1e[_0x5ea1('0x3b')]:_0x74f2aa[_0x5ea1('0x36')];_0x4d4c1e['order']=qs['sort'](_0x2ea8a1[_0x5ea1('0x3a')]['sort']);_0x4d4c1e['where']=qs[_0x5ea1('0x38')](_['pick'](_0x2ea8a1['query'],_0x74f2aa['filters']));if(_0x2ea8a1[_0x5ea1('0x3a')][_0x5ea1('0x60')]){_0x4d4c1e[_0x5ea1('0x42')]=_['merge'](_0x4d4c1e[_0x5ea1('0x42')],{'$or':_[_0x5ea1('0x30')](_0x4d4c1e['attributes'],function(_0x1d5c88){var _0x2bc927={};_0x2bc927[_0x1d5c88]={'$like':'%'+_0x2ea8a1[_0x5ea1('0x3a')][_0x5ea1('0x60')]+'%'};return _0x2bc927;})});}_0x4d4c1e=_[_0x5ea1('0x44')]({},_0x4d4c1e,_0x2ea8a1[_0x5ea1('0x46')]);return _0x421dc7[_0x5ea1('0x88')](_0x4d4c1e);}})['then'](function(_0x33345e){if(_0x33345e){_0x537bcd=_0x33345e[_0x5ea1('0x3d')];if(!_0x2ea8a1[_0x5ea1('0x3a')]['hasOwnProperty'](_0x5ea1('0x3f'))){_0x4d4c1e[_0x5ea1('0x21')]=qs[_0x5ea1('0x21')](_0x2ea8a1[_0x5ea1('0x3a')]['limit']);_0x4d4c1e['offset']=qs['offset'](_0x2ea8a1[_0x5ea1('0x3a')][_0x5ea1('0x1f')]);}return _0x421dc7[_0x5ea1('0x88')](_0x4d4c1e);}})[_0x5ea1('0x27')](function(_0x14a4a5){if(_0x14a4a5){return _0x14a4a5?{'count':_0x537bcd,'rows':_0x14a4a5}:null;}})[_0x5ea1('0x27')](respondWithResult(_0x5725e5,null))[_0x5ea1('0x4d')](handleError(_0x5725e5,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index ad7cce1..7394f99 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 _0x8307=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1d9715,_0x5cdeda){var _0x1180d5=function(_0x16c29a){while(--_0x16c29a){_0x1d9715['push'](_0x1d9715['shift']());}};_0x1180d5(++_0x5cdeda);}(_0x8307,0x67));var _0x7830=function(_0x25ff14,_0x384501){_0x25ff14=_0x25ff14-0x0;var _0x1eef4d=_0x8307[_0x25ff14];return _0x1eef4d;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x7830('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7830('0x1')](0x0);var events={'afterCreate':_0x7830('0x2'),'afterUpdate':_0x7830('0x3'),'afterDestroy':_0x7830('0x4')};function emitEvent(_0x31fc03){return function(_0x9d6f16,_0x5b567b,_0x4a2cb0){WhatsappQueueEvents[_0x7830('0x5')](_0x31fc03+':'+_0x9d6f16['id'],_0x9d6f16);WhatsappQueueEvents[_0x7830('0x5')](_0x31fc03,_0x9d6f16);_0x4a2cb0(null);};}for(var e in events){if(events[_0x7830('0x6')](e)){var event=events[e];WhatsappQueue[_0x7830('0x7')](e,emitEvent(event));}}module[_0x7830('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x11f5=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x11f5,0x11c));var _0x511f=function(_0x5b4663,_0x19d06f){_0x5b4663=_0x5b4663-0x0;var _0x5d1b1b=_0x11f5[_0x5b4663];return _0x5d1b1b;};'use strict';var EventEmitter=require(_0x511f('0x0'));var WhatsappQueue=require(_0x511f('0x1'))['db'][_0x511f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x511f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x511f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x246343){return function(_0x21694d,_0xbf446a,_0x5d49d4){WhatsappQueueEvents['emit'](_0x246343+':'+_0x21694d['id'],_0x21694d);WhatsappQueueEvents[_0x511f('0x5')](_0x246343,_0x21694d);_0x5d49d4(null);};}for(var e in events){if(events[_0x511f('0x6')](e)){var event=events[e];WhatsappQueue[_0x511f('0x7')](e,emitEvent(event));}}module[_0x511f('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 355e4f9..6cbecd4 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 _0xe216=['util','api','path','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','lodash'];(function(_0x3bc27a,_0x55b5a6){var _0x331511=function(_0x296b85){while(--_0x296b85){_0x3bc27a['push'](_0x3bc27a['shift']());}};_0x331511(++_0x55b5a6);}(_0xe216,0x197));var _0x6e21=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xe216[_0x318410];return _0x2898a3;};'use strict';var _=require(_0x6e21('0x0'));var util=require(_0x6e21('0x1'));var logger=require('../../config/logger')(_0x6e21('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e21('0x3'));var rimraf=require(_0x6e21('0x4'));var config=require(_0x6e21('0x5'));var attributes=require(_0x6e21('0x6'));module['exports']=function(_0x2ebd30,_0x58d371){return _0x2ebd30['define'](_0x6e21('0x7'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d7b=['request-promise','path','rimraf','../../config/environment','exports','WhatsappQueue','lodash','api','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7d7b,0x1a4));var _0xb7d7=function(_0x128b26,_0x5b77f7){_0x128b26=_0x128b26-0x0;var _0x2b2d48=_0x7d7b[_0x128b26];return _0x2b2d48;};'use strict';var _=require(_0xb7d7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb7d7('0x1'));var moment=require('moment');var BPromise=require(_0xb7d7('0x2'));var rp=require(_0xb7d7('0x3'));var fs=require('fs');var path=require(_0xb7d7('0x4'));var rimraf=require(_0xb7d7('0x5'));var config=require(_0xb7d7('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xb7d7('0x7')]=function(_0x12c92a,_0x4ed459){return _0x12c92a['define'](_0xb7d7('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index e25be6f..5a31e63 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 _0xaccd=['../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','lodash','util','moment','bluebird','ioredis'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0xaccd,0x18b));var _0xdacc=function(_0x53f7cb,_0x865146){_0x53f7cb=_0x53f7cb-0x0;var _0x3c3f5b=_0xaccd[_0x53f7cb];return _0x3c3f5b;};'use strict';var _=require(_0xdacc('0x0'));var util=require(_0xdacc('0x1'));var moment=require(_0xdacc('0x2'));var BPromise=require(_0xdacc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdacc('0x4'));var db=require(_0xdacc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdacc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdacc('0x7'));var client=jayson[_0xdacc('0x8')][_0xdacc('0x9')]({'port':0x232a});config[_0xdacc('0xa')]=_[_0xdacc('0xb')](config['redis'],{'host':_0xdacc('0xc'),'port':0x18eb});var socket=require(_0xdacc('0xd'))(new Redis(config[_0xdacc('0xa')]));require(_0xdacc('0xe'))[_0xdacc('0xf')](socket);function respondWithRpcPromise(_0x49dbb9,_0x486bf5,_0x24fa0f){return new BPromise(function(_0x5f08a6,_0xe82b09){return client[_0xdacc('0x10')](_0x49dbb9,_0x24fa0f)[_0xdacc('0x11')](function(_0x402c50){logger['info'](_0xdacc('0x12'),_0x486bf5,_0xdacc('0x13'));logger[_0xdacc('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x486bf5,'request\x20sent',JSON[_0xdacc('0x15')](_0x402c50));if(_0x402c50[_0xdacc('0x16')]){if(_0x402c50[_0xdacc('0x16')][_0xdacc('0x17')]===0x1f4){logger[_0xdacc('0x16')](_0xdacc('0x12'),_0x486bf5,_0x402c50['error'][_0xdacc('0x18')]);return _0xe82b09(_0x402c50[_0xdacc('0x16')][_0xdacc('0x18')]);}logger[_0xdacc('0x16')](_0xdacc('0x12'),_0x486bf5,_0x402c50[_0xdacc('0x16')]['message']);return _0x5f08a6(_0x402c50[_0xdacc('0x16')][_0xdacc('0x18')]);}else{logger[_0xdacc('0x19')](_0xdacc('0x12'),_0x486bf5,_0xdacc('0x13'));_0x5f08a6(_0x402c50[_0xdacc('0x1a')][_0xdacc('0x18')]);}})[_0xdacc('0x1b')](function(_0x39adf5){logger[_0xdacc('0x16')](_0xdacc('0x12'),_0x486bf5,_0x39adf5);_0xe82b09(_0x39adf5);});});}exports[_0xdacc('0x1c')]=function(_0x515e6f){var _0x5b7a74=this;return new Promise(function(_0x23dcde,_0x44480d){return db[_0xdacc('0x1d')][_0xdacc('0x1e')]({'raw':_0x515e6f[_0xdacc('0x1f')]?_0x515e6f['options'][_0xdacc('0x20')]===undefined?!![]:![]:!![],'where':_0x515e6f['options']?_0x515e6f[_0xdacc('0x1f')][_0xdacc('0x21')]||null:null,'attributes':_0x515e6f[_0xdacc('0x1f')]?_0x515e6f['options'][_0xdacc('0x22')]||null:null,'limit':_0x515e6f[_0xdacc('0x1f')]?_0x515e6f['options'][_0xdacc('0x23')]||null:null,'include':_0x515e6f[_0xdacc('0x1f')]?_0x515e6f[_0xdacc('0x1f')][_0xdacc('0x24')]?_['map'](_0x515e6f[_0xdacc('0x1f')][_0xdacc('0x24')],function(_0x47fcb4){return{'model':db[_0x47fcb4['model']],'as':_0x47fcb4['as'],'attributes':_0x47fcb4[_0xdacc('0x22')],'include':_0x47fcb4[_0xdacc('0x24')]?_['map'](_0x47fcb4['include'],function(_0x375729){return{'model':db[_0x375729['model']],'as':_0x375729['as'],'attributes':_0x375729[_0xdacc('0x22')],'include':_0x375729['include']?_[_0xdacc('0x25')](_0x375729[_0xdacc('0x24')],function(_0x1e6e68){return{'model':db[_0x1e6e68[_0xdacc('0x26')]],'as':_0x1e6e68['as'],'attributes':_0x1e6e68['attributes']};}):[]};}):[]};}):[]:[]})[_0xdacc('0x11')](function(_0x52aa3a){logger[_0xdacc('0x19')]('GetWhatsappQueue',_0x515e6f);logger[_0xdacc('0x14')]('GetWhatsappQueue',_0x515e6f,JSON[_0xdacc('0x15')](_0x52aa3a));_0x23dcde(_0x52aa3a);})[_0xdacc('0x1b')](function(_0x2261c2){logger[_0xdacc('0x16')](_0xdacc('0x1c'),_0x2261c2[_0xdacc('0x18')],_0x515e6f);_0x44480d(_0x5b7a74[_0xdacc('0x16')](0x1f4,_0x2261c2[_0xdacc('0x18')]));});});};exports[_0xdacc('0x27')]=function(_0x4c9354){var _0x36aaa8=this;return new Promise(function(_0x498e91,_0x2265da){return db[_0xdacc('0x1d')]['find']({'raw':_0x4c9354['options']?_0x4c9354[_0xdacc('0x1f')][_0xdacc('0x20')]===undefined?!![]:![]:!![],'where':_0x4c9354[_0xdacc('0x1f')]?_0x4c9354[_0xdacc('0x1f')][_0xdacc('0x21')]||null:null,'attributes':_0x4c9354['options']?_0x4c9354[_0xdacc('0x1f')]['attributes']||null:null,'include':_0x4c9354[_0xdacc('0x1f')]?_0x4c9354[_0xdacc('0x1f')][_0xdacc('0x24')]?_['map'](_0x4c9354[_0xdacc('0x1f')][_0xdacc('0x24')],function(_0x3ca24a){return{'model':db[_0x3ca24a[_0xdacc('0x26')]],'as':_0x3ca24a['as'],'attributes':_0x3ca24a[_0xdacc('0x22')],'include':_0x3ca24a[_0xdacc('0x24')]?_[_0xdacc('0x25')](_0x3ca24a[_0xdacc('0x24')],function(_0x10a6d1){return{'model':db[_0x10a6d1[_0xdacc('0x26')]],'as':_0x10a6d1['as'],'attributes':_0x10a6d1[_0xdacc('0x22')],'include':_0x10a6d1[_0xdacc('0x24')]?_['map'](_0x10a6d1[_0xdacc('0x24')],function(_0x314d38){return{'model':db[_0x314d38[_0xdacc('0x26')]],'as':_0x314d38['as'],'attributes':_0x314d38[_0xdacc('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdacc('0x11')](function(_0x302c20){logger[_0xdacc('0x19')](_0xdacc('0x27'),_0x4c9354);logger[_0xdacc('0x14')]('ShowWhatsappQueue',_0x4c9354,JSON[_0xdacc('0x15')](_0x302c20));_0x498e91(_0x302c20);})[_0xdacc('0x1b')](function(_0x65c4b){logger[_0xdacc('0x16')]('ShowWhatsappQueue',_0x65c4b[_0xdacc('0x18')],_0x4c9354);_0x2265da(_0x36aaa8['error'](0x1f4,_0x65c4b[_0xdacc('0x18')]));});});}; \ No newline at end of file +var _0xbca1=['WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','attributes','map','then','catch','ShowWhatsappQueue','find','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','info'];(function(_0x41fb96,_0x20facf){var _0x5ce3a9=function(_0x3f70da){while(--_0x3f70da){_0x41fb96['push'](_0x41fb96['shift']());}};_0x5ce3a9(++_0x20facf);}(_0xbca1,0x1da));var _0x1bca=function(_0x26e101,_0x5599fb){_0x26e101=_0x26e101-0x0;var _0x5c735f=_0xbca1[_0x26e101];return _0x5c735f;};'use strict';var _=require(_0x1bca('0x0'));var util=require(_0x1bca('0x1'));var moment=require(_0x1bca('0x2'));var BPromise=require(_0x1bca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bca('0x4'));var db=require(_0x1bca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bca('0x6'))(_0x1bca('0x7'));var config=require(_0x1bca('0x8'));var jayson=require(_0x1bca('0x9'));var client=jayson['client'][_0x1bca('0xa')]({'port':0x232a});config['redis']=_[_0x1bca('0xb')](config[_0x1bca('0xc')],{'host':_0x1bca('0xd'),'port':0x18eb});var socket=require(_0x1bca('0xe'))(new Redis(config[_0x1bca('0xc')]));require(_0x1bca('0xf'))['register'](socket);function respondWithRpcPromise(_0x979adf,_0x4804f5,_0x74c57a){return new BPromise(function(_0xbf7ee6,_0x375807){return client[_0x1bca('0x10')](_0x979adf,_0x74c57a)['then'](function(_0x1db9d8){logger[_0x1bca('0x11')](_0x1bca('0x12'),_0x4804f5,_0x1bca('0x13'));logger[_0x1bca('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4804f5,'request\x20sent',JSON[_0x1bca('0x15')](_0x1db9d8));if(_0x1db9d8[_0x1bca('0x16')]){if(_0x1db9d8[_0x1bca('0x16')][_0x1bca('0x17')]===0x1f4){logger[_0x1bca('0x16')](_0x1bca('0x12'),_0x4804f5,_0x1db9d8[_0x1bca('0x16')][_0x1bca('0x18')]);return _0x375807(_0x1db9d8[_0x1bca('0x16')][_0x1bca('0x18')]);}logger['error'](_0x1bca('0x12'),_0x4804f5,_0x1db9d8[_0x1bca('0x16')][_0x1bca('0x18')]);return _0xbf7ee6(_0x1db9d8[_0x1bca('0x16')][_0x1bca('0x18')]);}else{logger[_0x1bca('0x11')](_0x1bca('0x12'),_0x4804f5,_0x1bca('0x13'));_0xbf7ee6(_0x1db9d8[_0x1bca('0x19')][_0x1bca('0x18')]);}})['catch'](function(_0x1d4437){logger[_0x1bca('0x16')](_0x1bca('0x12'),_0x4804f5,_0x1d4437);_0x375807(_0x1d4437);});});}exports[_0x1bca('0x1a')]=function(_0x4f428f){var _0x1c0996=this;return new Promise(function(_0x1ac07e,_0x2396af){return db[_0x1bca('0x1b')][_0x1bca('0x1c')]({'raw':_0x4f428f[_0x1bca('0x1d')]?_0x4f428f[_0x1bca('0x1d')][_0x1bca('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f428f[_0x1bca('0x1d')]?_0x4f428f[_0x1bca('0x1d')][_0x1bca('0x1f')]||null:null,'attributes':_0x4f428f[_0x1bca('0x1d')]?_0x4f428f[_0x1bca('0x1d')]['attributes']||null:null,'limit':_0x4f428f['options']?_0x4f428f[_0x1bca('0x1d')][_0x1bca('0x20')]||null:null,'include':_0x4f428f[_0x1bca('0x1d')]?_0x4f428f[_0x1bca('0x1d')][_0x1bca('0x21')]?_['map'](_0x4f428f[_0x1bca('0x1d')][_0x1bca('0x21')],function(_0x3fd1c7){return{'model':db[_0x3fd1c7['model']],'as':_0x3fd1c7['as'],'attributes':_0x3fd1c7[_0x1bca('0x22')],'include':_0x3fd1c7['include']?_[_0x1bca('0x23')](_0x3fd1c7[_0x1bca('0x21')],function(_0x2a38a1){return{'model':db[_0x2a38a1['model']],'as':_0x2a38a1['as'],'attributes':_0x2a38a1[_0x1bca('0x22')],'include':_0x2a38a1[_0x1bca('0x21')]?_[_0x1bca('0x23')](_0x2a38a1[_0x1bca('0x21')],function(_0x8ba104){return{'model':db[_0x8ba104['model']],'as':_0x8ba104['as'],'attributes':_0x8ba104[_0x1bca('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1bca('0x24')](function(_0x27de70){logger['info'](_0x1bca('0x1a'),_0x4f428f);logger[_0x1bca('0x14')](_0x1bca('0x1a'),_0x4f428f,JSON[_0x1bca('0x15')](_0x27de70));_0x1ac07e(_0x27de70);})[_0x1bca('0x25')](function(_0x5bb632){logger[_0x1bca('0x16')](_0x1bca('0x1a'),_0x5bb632[_0x1bca('0x18')],_0x4f428f);_0x2396af(_0x1c0996[_0x1bca('0x16')](0x1f4,_0x5bb632[_0x1bca('0x18')]));});});};exports[_0x1bca('0x26')]=function(_0x1ed045){var _0x4da3f6=this;return new Promise(function(_0x5688f5,_0x372213){return db[_0x1bca('0x1b')][_0x1bca('0x27')]({'raw':_0x1ed045[_0x1bca('0x1d')]?_0x1ed045[_0x1bca('0x1d')][_0x1bca('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ed045[_0x1bca('0x1d')]?_0x1ed045[_0x1bca('0x1d')][_0x1bca('0x1f')]||null:null,'attributes':_0x1ed045[_0x1bca('0x1d')]?_0x1ed045[_0x1bca('0x1d')]['attributes']||null:null,'include':_0x1ed045['options']?_0x1ed045[_0x1bca('0x1d')][_0x1bca('0x21')]?_[_0x1bca('0x23')](_0x1ed045[_0x1bca('0x1d')]['include'],function(_0x26ca0a){return{'model':db[_0x26ca0a[_0x1bca('0x28')]],'as':_0x26ca0a['as'],'attributes':_0x26ca0a[_0x1bca('0x22')],'include':_0x26ca0a[_0x1bca('0x21')]?_[_0x1bca('0x23')](_0x26ca0a['include'],function(_0x5ce36e){return{'model':db[_0x5ce36e[_0x1bca('0x28')]],'as':_0x5ce36e['as'],'attributes':_0x5ce36e[_0x1bca('0x22')],'include':_0x5ce36e[_0x1bca('0x21')]?_['map'](_0x5ce36e[_0x1bca('0x21')],function(_0xaa83ff){return{'model':db[_0xaa83ff[_0x1bca('0x28')]],'as':_0xaa83ff['as'],'attributes':_0xaa83ff[_0x1bca('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1bca('0x24')](function(_0x2765ce){logger['info'](_0x1bca('0x26'),_0x1ed045);logger['debug']('ShowWhatsappQueue',_0x1ed045,JSON[_0x1bca('0x15')](_0x2765ce));_0x5688f5(_0x2765ce);})['catch'](function(_0x1d48d6){logger[_0x1bca('0x16')]('ShowWhatsappQueue',_0x1d48d6[_0x1bca('0x18')],_0x1ed045);_0x372213(_0x4da3f6[_0x1bca('0x16')](0x1f4,_0x1d48d6[_0x1bca('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9241a0a..bbf1a5d 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 _0x05ef=['update','emit','removeListener','length','whatsappQueue:','save'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x05ef,0x119));var _0xf05e=function(_0x115f14,_0x1242e8){_0x115f14=_0x115f14-0x0;var _0x1785ee=_0x05ef[_0x115f14];return _0x1785ee;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xf05e('0x0'),'remove',_0xf05e('0x1')];function createListener(_0x55aea,_0x204d01){return function(_0x4bfa07){_0x204d01[_0xf05e('0x2')](_0x55aea,_0x4bfa07);};}function removeListener(_0x8023d8,_0x421492){return function(){WhatsappQueueEvents[_0xf05e('0x3')](_0x8023d8,_0x421492);};}exports['register']=function(_0x58bf7f){for(var _0x42e7e5=0x0,_0x90a1fa=events[_0xf05e('0x4')];_0x42e7e5<_0x90a1fa;_0x42e7e5++){var _0x53d712=events[_0x42e7e5];var _0x11c641=createListener(_0xf05e('0x5')+_0x53d712,_0x58bf7f);WhatsappQueueEvents['on'](_0x53d712,_0x11c641);}}; \ No newline at end of file +var _0xbff8=['whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener','register'];(function(_0x152f68,_0x9c4fc4){var _0xdfdc55=function(_0x2f1333){while(--_0x2f1333){_0x152f68['push'](_0x152f68['shift']());}};_0xdfdc55(++_0x9c4fc4);}(_0xbff8,0xb7));var _0x8bff=function(_0x1d2295,_0x4f1ad9){_0x1d2295=_0x1d2295-0x0;var _0x36b55b=_0xbff8[_0x1d2295];return _0x36b55b;};'use strict';var WhatsappQueueEvents=require(_0x8bff('0x0'));var events=[_0x8bff('0x1'),_0x8bff('0x2'),_0x8bff('0x3')];function createListener(_0x52780a,_0x15f4fb){return function(_0x4227fa){_0x15f4fb['emit'](_0x52780a,_0x4227fa);};}function removeListener(_0x291000,_0x5d3748){return function(){WhatsappQueueEvents[_0x8bff('0x4')](_0x291000,_0x5d3748);};}exports[_0x8bff('0x5')]=function(_0x1347a0){for(var _0x27aa1f=0x0,_0x3a91a6=events['length'];_0x27aa1f<_0x3a91a6;_0x27aa1f++){var _0x240268=events[_0x27aa1f];var _0x278da9=createListener(_0x8bff('0x6')+_0x240268,_0x1347a0);WhatsappQueueEvents['on'](_0x240268,_0x278da9);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 033087a..169dce1 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 _0x47c3=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x24aab1,_0x2bcacb){var _0xf06693=function(_0x586c6e){while(--_0x586c6e){_0x24aab1['push'](_0x24aab1['shift']());}};_0xf06693(++_0x2bcacb);}(_0x47c3,0x7c));var _0x347c=function(_0x16d3a1,_0x5887a8){_0x16d3a1=_0x16d3a1-0x0;var _0x5bbffd=_0x47c3[_0x16d3a1];return _0x5bbffd;};'use strict';var multer=require(_0x347c('0x0'));var util=require(_0x347c('0x1'));var path=require('path');var timeout=require(_0x347c('0x2'));var express=require('express');var router=express[_0x347c('0x3')]();var fs_extra=require(_0x347c('0x4'));var auth=require(_0x347c('0x5'));var interaction=require(_0x347c('0x6'));var config=require(_0x347c('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x347c('0x8')]('/',auth[_0x347c('0x9')](),controller[_0x347c('0xa')]);router[_0x347c('0x8')](_0x347c('0xb'),auth['isAuthenticated'](),controller[_0x347c('0xc')]);router[_0x347c('0x8')](_0x347c('0xd'),auth[_0x347c('0x9')](),controller[_0x347c('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x347c('0xf')]);router[_0x347c('0x10')](_0x347c('0xd'),auth[_0x347c('0x9')](),controller[_0x347c('0x11')]);router[_0x347c('0x12')](_0x347c('0xd'),auth[_0x347c('0x9')](),controller[_0x347c('0x13')]);module[_0x347c('0x14')]=router; \ No newline at end of file +var _0x63d3=['/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x63d3,0xf9));var _0x363d=function(_0x3f4100,_0x54582e){_0x3f4100=_0x3f4100-0x0;var _0x48fff1=_0x63d3[_0x3f4100];return _0x48fff1;};'use strict';var multer=require(_0x363d('0x0'));var util=require(_0x363d('0x1'));var path=require(_0x363d('0x2'));var timeout=require('connect-timeout');var express=require(_0x363d('0x3'));var router=express[_0x363d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x363d('0x5'));var interaction=require(_0x363d('0x6'));var config=require(_0x363d('0x7'));var controller=require(_0x363d('0x8'));router[_0x363d('0x9')]('/',auth[_0x363d('0xa')](),controller['index']);router['get'](_0x363d('0xb'),auth[_0x363d('0xa')](),controller[_0x363d('0xc')]);router[_0x363d('0x9')](_0x363d('0xd'),auth['isAuthenticated'](),controller[_0x363d('0xe')]);router[_0x363d('0xf')]('/',auth[_0x363d('0xa')](),controller[_0x363d('0x10')]);router[_0x363d('0x11')]('/:id',auth[_0x363d('0xa')](),controller[_0x363d('0x12')]);router[_0x363d('0x13')]('/:id',auth[_0x363d('0xa')](),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 5795386..7f39373 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x237b13,_0x414f01){var _0x371422=function(_0x4d652f){while(--_0x4d652f){_0x237b13['push'](_0x237b13['shift']());}};_0x371422(++_0x414f01);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1276f8,_0x33f68e){var _0x11422c=function(_0x2546fb){while(--_0x2546fb){_0x1276f8['push'](_0x1276f8['shift']());}};_0x11422c(++_0x33f68e);}(_0x7a54,0x106));var _0x47a5=function(_0x3ac6ce,_0x4bf05f){_0x3ac6ce=_0x3ac6ce-0x0;var _0x1dbbc6=_0x7a54[_0x3ac6ce];return _0x1dbbc6;};'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 13cdb18..22cc834 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 _0xbc9d=['index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','map','type','merge','options','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send'];(function(_0x273d71,_0x11c3a4){var _0x264e15=function(_0x4344c3){while(--_0x4344c3){_0x273d71['push'](_0x273d71['shift']());}};_0x264e15(++_0x11c3a4);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x483692,_0x2f310e){_0x483692=_0x483692-0x0;var _0x53a351=_0xbc9d[_0x483692];return _0x53a351;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)[_0xdbc9('0x1b')]();});}};}function handleEntityNotFound(_0x3c8c1d,_0x4a868b){return function(_0x550bef){if(!_0x550bef){_0x3c8c1d[_0xdbc9('0x19')](0x194);}return _0x550bef;};}function handleError(_0x446ab9,_0x1053ca){_0x1053ca=_0x1053ca||0x1f4;return function(_0x24fdec){logger['error'](_0x24fdec[_0xdbc9('0x27')]);if(_0x24fdec[_0xdbc9('0x28')]){delete _0x24fdec['name'];}_0x446ab9['status'](_0x1053ca)[_0xdbc9('0x29')](_0x24fdec);};}exports[_0xdbc9('0x2a')]=function(_0x473430,_0x59bfd2){var _0x13a432={},_0x539e57={},_0x561f8e={'count':0x0,'rows':[]};var _0x210a40=_['map'](db['WhatsappQueueReport'][_0xdbc9('0x2b')],function(_0x20eb4f){return{'name':_0x20eb4f[_0xdbc9('0x2c')],'type':_0x20eb4f['type'][_0xdbc9('0x2d')]};});_0x539e57[_0xdbc9('0x2e')]=_['map'](_0x210a40,'name');_0x539e57[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x473430[_0xdbc9('0x2f')]);_0x539e57[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],_0x539e57[_0xdbc9('0x2f')]);_0x13a432['attributes']=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],qs[_0xdbc9('0x33')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x33')]));_0x13a432[_0xdbc9('0x34')]=_0x13a432['attributes'][_0xdbc9('0x35')]?_0x13a432['attributes']:_0x539e57['model'];if(!_0x473430['query']['hasOwnProperty']('nolimit')){_0x13a432[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x473430[_0xdbc9('0x2f')]['limit']);_0x13a432[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x20')]);}_0x13a432[_0xdbc9('0x36')]=qs[_0xdbc9('0x37')](_0x473430['query'][_0xdbc9('0x37')]);_0x13a432[_0xdbc9('0x38')]=qs[_0xdbc9('0x31')](_['pick'](_0x473430[_0xdbc9('0x2f')],_0x539e57[_0xdbc9('0x31')]),_0x210a40);if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x39')]){_0x13a432['where']=_['merge'](_0x13a432[_0xdbc9('0x38')],{'$or':_[_0xdbc9('0x3a')](_0x210a40,function(_0x136392){if(_0x136392[_0xdbc9('0x3b')]!=='VIRTUAL'){var _0x1b651f={};_0x1b651f[_0x136392[_0xdbc9('0x28')]]={'$like':'%'+_0x473430[_0xdbc9('0x2f')]['filter']+'%'};return _0x1b651f;}})});}_0x13a432=_[_0xdbc9('0x3c')]({},_0x13a432,_0x473430[_0xdbc9('0x3d')]);var _0x444219={'where':_0x13a432['where']};return db[_0xdbc9('0x3e')][_0xdbc9('0x1f')](_0x444219)['then'](function(_0x5173c2){_0x561f8e[_0xdbc9('0x1f')]=_0x5173c2;if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x13a432[_0xdbc9('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xdbc9('0x41')](_0x13a432);})[_0xdbc9('0x26')](function(_0x577725){_0x561f8e[_0xdbc9('0x42')]=_0x577725;return _0x561f8e;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x59bfd2,_0x13a432))['catch'](handleError(_0x59bfd2,null));};exports[_0xdbc9('0x43')]=function(_0x72dee3,_0x2adb23){var _0x3415c3={'raw':!![],'where':{'id':_0x72dee3[_0xdbc9('0x44')]['id']}},_0x3ed4de={};_0x3ed4de[_0xdbc9('0x2e')]=_['keys'](db['WhatsappQueueReport'][_0xdbc9('0x2b')]);_0x3ed4de[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x72dee3[_0xdbc9('0x2f')]);_0x3ed4de[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],_0x3ed4de[_0xdbc9('0x2f')]);_0x3415c3[_0xdbc9('0x34')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],qs['fields'](_0x72dee3['query'][_0xdbc9('0x33')]));_0x3415c3[_0xdbc9('0x34')]=_0x3415c3[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x3415c3[_0xdbc9('0x34')]:_0x3ed4de[_0xdbc9('0x2e')];if(_0x72dee3[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x3415c3['include']=[{'all':!![]}];}_0x3415c3=_['merge']({},_0x3415c3,_0x72dee3[_0xdbc9('0x3d')]);return db[_0xdbc9('0x3e')][_0xdbc9('0x45')](_0x3415c3)[_0xdbc9('0x26')](handleEntityNotFound(_0x2adb23,null))[_0xdbc9('0x26')](respondWithResult(_0x2adb23,null))[_0xdbc9('0x46')](handleError(_0x2adb23,null));};exports[_0xdbc9('0x47')]=function(_0x2ea096,_0x43e3ec){return db['WhatsappQueueReport'][_0xdbc9('0x47')](_0x2ea096[_0xdbc9('0x48')],{})['then'](respondWithResult(_0x43e3ec,0xc9))['catch'](handleError(_0x43e3ec,null));};exports[_0xdbc9('0x24')]=function(_0xc3db3c,_0x133a13){if(_0xc3db3c['body']['id']){delete _0xc3db3c[_0xdbc9('0x48')]['id'];}return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0xc3db3c[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x133a13,null))[_0xdbc9('0x26')](saveUpdates(_0xc3db3c[_0xdbc9('0x48')],null))[_0xdbc9('0x26')](respondWithResult(_0x133a13,null))[_0xdbc9('0x46')](handleError(_0x133a13,null));};exports['destroy']=function(_0x3e89f5,_0x36c70e){return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0x3e89f5[_0xdbc9('0x44')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x36c70e,null))[_0xdbc9('0x26')](removeEntity(_0x36c70e,null))[_0xdbc9('0x46')](handleError(_0x36c70e,null));};exports['describe']=function(_0x1c6e6e,_0x4d09e1){return db[_0xdbc9('0x3e')][_0xdbc9('0x49')]()['then'](respondWithResult(_0x4d09e1,null))['catch'](handleError(_0x4d09e1,null));}; \ No newline at end of file +var _0x0fd9=['includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x34e0bd,_0x465d8e){var _0x3a0d96=function(_0xe99c5d){while(--_0xe99c5d){_0x34e0bd['push'](_0x34e0bd['shift']());}};_0x3a0d96(++_0x465d8e);}(_0x0fd9,0xa3));var _0x90fd=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x0fd9[_0x4226d6];return _0x19655b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['WhatsappQueueReport']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['WhatsappQueueReport'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));};exports[_0x90fd('0x4b')]=function(_0xb8a2af,_0x13c428){return db[_0x90fd('0x2b')][_0x90fd('0x4b')]()['then'](respondWithResult(_0x13c428,null))['catch'](handleError(_0x13c428,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 05c5106..784d68f 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 _0xe179=['lodash','moment','request-promise','exports','define','uniqueid'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xe179,0x1ce));var _0x9e17=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xe179[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x9e17('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9e17('0x1'));var BPromise=require('bluebird');var rp=require(_0x9e17('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x9e17('0x3')]=function(_0x79862,_0x2b838f){return _0x79862[_0x9e17('0x4')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x9e17('0x5'),'fields':[_0x9e17('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6fbb=['WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x6fbb,0x1d0));var _0xb6fb=function(_0x26823f,_0x61e908){_0x26823f=_0x26823f-0x0;var _0x274106=_0x6fbb[_0x26823f];return _0x274106;};'use strict';var _=require(_0xb6fb('0x0'));var util=require(_0xb6fb('0x1'));var logger=require(_0xb6fb('0x2'))('api');var moment=require(_0xb6fb('0x3'));var BPromise=require(_0xb6fb('0x4'));var rp=require(_0xb6fb('0x5'));var fs=require('fs');var path=require(_0xb6fb('0x6'));var rimraf=require(_0xb6fb('0x7'));var config=require(_0xb6fb('0x8'));var attributes=require(_0xb6fb('0x9'));module[_0xb6fb('0xa')]=function(_0x252b49,_0x9a2626){return _0x252b49[_0xb6fb('0xb')](_0xb6fb('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xb6fb('0xd'),'fields':[_0xb6fb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 2e17c54..cbfabfd 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 _0xb741=['error','message','info','result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x59ec6b,_0x1d1a4b){var _0x2c15dc=function(_0x1f87bb){while(--_0x1f87bb){_0x59ec6b['push'](_0x59ec6b['shift']());}};_0x2c15dc(++_0x1d1a4b);}(_0xb741,0x141));var _0x1b74=function(_0x382728,_0x168d85){_0x382728=_0x382728-0x0;var _0x41ad8e=_0xb741[_0x382728];return _0x41ad8e;};'use strict';var _=require(_0x1b74('0x0'));var util=require(_0x1b74('0x1'));var moment=require(_0x1b74('0x2'));var BPromise=require(_0x1b74('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b74('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b74('0x5'));var logger=require(_0x1b74('0x6'))(_0x1b74('0x7'));var config=require(_0x1b74('0x8'));var jayson=require(_0x1b74('0x9'));var client=jayson[_0x1b74('0xa')][_0x1b74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ae3b2,_0x3e4f13,_0x5bd57f){return new BPromise(function(_0x5eb8e4,_0x940561){return client[_0x1b74('0xc')](_0x4ae3b2,_0x5bd57f)[_0x1b74('0xd')](function(_0x5b4ad5){logger['info'](_0x1b74('0xe'),_0x3e4f13,_0x1b74('0xf'));logger[_0x1b74('0x10')](_0x1b74('0x11'),_0x3e4f13,_0x1b74('0xf'),JSON[_0x1b74('0x12')](_0x5b4ad5));if(_0x5b4ad5['error']){if(_0x5b4ad5[_0x1b74('0x13')]['code']===0x1f4){logger[_0x1b74('0x13')](_0x1b74('0xe'),_0x3e4f13,_0x5b4ad5[_0x1b74('0x13')]['message']);return _0x940561(_0x5b4ad5[_0x1b74('0x13')][_0x1b74('0x14')]);}logger['error'](_0x1b74('0xe'),_0x3e4f13,_0x5b4ad5[_0x1b74('0x13')][_0x1b74('0x14')]);return _0x5eb8e4(_0x5b4ad5[_0x1b74('0x13')]['message']);}else{logger[_0x1b74('0x15')](_0x1b74('0xe'),_0x3e4f13,_0x1b74('0xf'));_0x5eb8e4(_0x5b4ad5[_0x1b74('0x16')][_0x1b74('0x14')]);}})[_0x1b74('0x17')](function(_0x4e5878){logger[_0x1b74('0x13')](_0x1b74('0xe'),_0x3e4f13,_0x4e5878);_0x940561(_0x4e5878);});});}exports[_0x1b74('0x18')]=function(_0x135863){var _0x151359=this;return new Promise(function(_0x1a1284,_0x2a98b7){return db['WhatsappQueueReport'][_0x1b74('0x19')](_0x135863[_0x1b74('0x1a')],{'raw':_0x135863[_0x1b74('0x1b')]?_0x135863[_0x1b74('0x1b')][_0x1b74('0x1c')]===undefined?!![]:![]:!![]})[_0x1b74('0xd')](function(_0x20973e){logger['info'](_0x1b74('0x18'),_0x135863);logger['debug'](_0x1b74('0x18'),_0x135863,JSON[_0x1b74('0x12')](_0x20973e));_0x1a1284(_0x20973e);})['catch'](function(_0x57ce20){logger[_0x1b74('0x13')](_0x1b74('0x18'),_0x57ce20[_0x1b74('0x14')],_0x135863);_0x2a98b7(_0x151359[_0x1b74('0x13')](0x1f4,_0x57ce20[_0x1b74('0x14')]));});});};exports[_0x1b74('0x1d')]=function(_0x3acba8){var _0x3af3a3=this;return new Promise(function(_0x2a46de,_0x14cdc2){return db[_0x1b74('0x1e')][_0x1b74('0x1f')](_0x3acba8['body'],{'raw':_0x3acba8[_0x1b74('0x1b')]?_0x3acba8[_0x1b74('0x1b')][_0x1b74('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3acba8[_0x1b74('0x1b')]?_0x3acba8[_0x1b74('0x1b')]['where']||null:null,'attributes':_0x3acba8['options']?_0x3acba8[_0x1b74('0x1b')][_0x1b74('0x20')]||null:null,'limit':_0x3acba8['options']?_0x3acba8[_0x1b74('0x1b')][_0x1b74('0x21')]||null:null})[_0x1b74('0xd')](function(_0x4aec7c){logger[_0x1b74('0x15')](_0x1b74('0x1d'),_0x3acba8);logger[_0x1b74('0x10')](_0x1b74('0x1d'),_0x3acba8,JSON[_0x1b74('0x12')](_0x4aec7c));_0x2a46de(_0x4aec7c);})[_0x1b74('0x17')](function(_0x1d84ea){logger[_0x1b74('0x13')](_0x1b74('0x1d'),_0x1d84ea[_0x1b74('0x14')],_0x3acba8);_0x14cdc2(_0x3af3a3[_0x1b74('0x13')](0x1f4,_0x1d84ea[_0x1b74('0x14')]));});});}; \ No newline at end of file +var _0x8007=['info','WhatsappQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','update','where','UpdateWhatsappQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8007,0x70));var _0x7800=function(_0x5d5488,_0x5087fa){_0x5d5488=_0x5d5488-0x0;var _0x5bdf26=_0x8007[_0x5d5488];return _0x5bdf26;};'use strict';var _=require(_0x7800('0x0'));var util=require(_0x7800('0x1'));var moment=require('moment');var BPromise=require(_0x7800('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7800('0x3'));var db=require(_0x7800('0x4'))['db'];var utils=require(_0x7800('0x5'));var logger=require(_0x7800('0x6'))('rpc');var config=require(_0x7800('0x7'));var jayson=require(_0x7800('0x8'));var client=jayson[_0x7800('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9e8e0d,_0x5027df,_0x1fffb6){return new BPromise(function(_0x5e82a8,_0x1ca410){return client[_0x7800('0xa')](_0x9e8e0d,_0x1fffb6)[_0x7800('0xb')](function(_0x7bfe51){logger[_0x7800('0xc')](_0x7800('0xd'),_0x5027df,'request\x20sent');logger[_0x7800('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5027df,'request\x20sent',JSON[_0x7800('0xf')](_0x7bfe51));if(_0x7bfe51[_0x7800('0x10')]){if(_0x7bfe51[_0x7800('0x10')][_0x7800('0x11')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5027df,_0x7bfe51[_0x7800('0x10')]['message']);return _0x1ca410(_0x7bfe51[_0x7800('0x10')][_0x7800('0x12')]);}logger[_0x7800('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5027df,_0x7bfe51['error'][_0x7800('0x12')]);return _0x5e82a8(_0x7bfe51[_0x7800('0x10')][_0x7800('0x12')]);}else{logger[_0x7800('0xc')](_0x7800('0xd'),_0x5027df,_0x7800('0x13'));_0x5e82a8(_0x7bfe51[_0x7800('0x14')][_0x7800('0x12')]);}})[_0x7800('0x15')](function(_0x20ab9c){logger[_0x7800('0x10')](_0x7800('0xd'),_0x5027df,_0x20ab9c);_0x1ca410(_0x20ab9c);});});}exports[_0x7800('0x16')]=function(_0x57d154){var _0x439142=this;return new Promise(function(_0x24f328,_0x888c67){return db[_0x7800('0x17')][_0x7800('0x18')](_0x57d154[_0x7800('0x19')],{'raw':_0x57d154[_0x7800('0x1a')]?_0x57d154[_0x7800('0x1a')][_0x7800('0x1b')]===undefined?!![]:![]:!![]})[_0x7800('0xb')](function(_0x119f0a){logger['info'](_0x7800('0x16'),_0x57d154);logger[_0x7800('0xe')](_0x7800('0x16'),_0x57d154,JSON['stringify'](_0x119f0a));_0x24f328(_0x119f0a);})[_0x7800('0x15')](function(_0x16b999){logger[_0x7800('0x10')](_0x7800('0x16'),_0x16b999[_0x7800('0x12')],_0x57d154);_0x888c67(_0x439142[_0x7800('0x10')](0x1f4,_0x16b999[_0x7800('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5a1a9c){var _0x26b1c5=this;return new Promise(function(_0x43b57e,_0xfc212b){return db[_0x7800('0x17')][_0x7800('0x1c')](_0x5a1a9c['body'],{'raw':_0x5a1a9c['options']?_0x5a1a9c[_0x7800('0x1a')][_0x7800('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1a9c[_0x7800('0x1a')]?_0x5a1a9c['options'][_0x7800('0x1d')]||null:null,'attributes':_0x5a1a9c['options']?_0x5a1a9c[_0x7800('0x1a')]['attributes']||null:null,'limit':_0x5a1a9c[_0x7800('0x1a')]?_0x5a1a9c[_0x7800('0x1a')]['limit']||null:null})[_0x7800('0xb')](function(_0x3d3e75){logger[_0x7800('0xc')](_0x7800('0x1e'),_0x5a1a9c);logger[_0x7800('0xe')]('UpdateWhatsappQueueReport',_0x5a1a9c,JSON['stringify'](_0x3d3e75));_0x43b57e(_0x3d3e75);})[_0x7800('0x15')](function(_0x27e3b4){logger[_0x7800('0x10')](_0x7800('0x1e'),_0x27e3b4[_0x7800('0x12')],_0x5a1a9c);_0xfc212b(_0x26b1c5['error'](0x1f4,_0x27e3b4[_0x7800('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 018208c..5ec87a5 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 _0x571b=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x1df859,_0x288ae8){var _0x245378=function(_0x1b8c95){while(--_0x1b8c95){_0x1df859['push'](_0x1df859['shift']());}};_0x245378(++_0x288ae8);}(_0x571b,0x151));var _0xb571=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x571b[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0xb571('0x0'));var path=require(_0xb571('0x1'));var timeout=require(_0xb571('0x2'));var express=require(_0xb571('0x3'));var router=express[_0xb571('0x4')]();var fs_extra=require(_0xb571('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb571('0x6'));var config=require(_0xb571('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xb571('0x8')]('/',auth[_0xb571('0x9')](),controller['index']);router[_0xb571('0x8')](_0xb571('0xa'),auth[_0xb571('0x9')](),controller['describe']);router[_0xb571('0x8')](_0xb571('0xb'),auth[_0xb571('0x9')](),controller[_0xb571('0xc')]);router['post']('/',auth[_0xb571('0x9')](),controller['create']);router[_0xb571('0xd')](_0xb571('0xb'),auth['isAuthenticated'](),controller[_0xb571('0xe')]);router[_0xb571('0xf')](_0xb571('0xb'),auth[_0xb571('0x9')](),controller[_0xb571('0x10')]);module[_0xb571('0x11')]=router; \ No newline at end of file +var _0xc499=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x4eee34,_0x4af4ed){var _0x28e2c3=function(_0x4af0ed){while(--_0x4af0ed){_0x4eee34['push'](_0x4eee34['shift']());}};_0x28e2c3(++_0x4af4ed);}(_0xc499,0x1ca));var _0x9c49=function(_0x48b3fb,_0x4b07bf){_0x48b3fb=_0x48b3fb-0x0;var _0x458604=_0xc499[_0x48b3fb];return _0x458604;};'use strict';var multer=require(_0x9c49('0x0'));var util=require(_0x9c49('0x1'));var path=require(_0x9c49('0x2'));var timeout=require(_0x9c49('0x3'));var express=require(_0x9c49('0x4'));var router=express[_0x9c49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9c49('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9c49('0x7'));var controller=require(_0x9c49('0x8'));router['get']('/',auth[_0x9c49('0x9')](),controller[_0x9c49('0xa')]);router[_0x9c49('0xb')]('/describe',auth[_0x9c49('0x9')](),controller[_0x9c49('0xc')]);router[_0x9c49('0xb')](_0x9c49('0xd'),auth['isAuthenticated'](),controller[_0x9c49('0xe')]);router[_0x9c49('0xf')]('/',auth[_0x9c49('0x9')](),controller[_0x9c49('0x10')]);router['put'](_0x9c49('0xd'),auth['isAuthenticated'](),controller[_0x9c49('0x11')]);router[_0x9c49('0x12')](_0x9c49('0xd'),auth[_0x9c49('0x9')](),controller['destroy']);module[_0x9c49('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 9b5d052..a1bf960 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 _0x6343=['STRING','ENUM'];(function(_0x5a2430,_0x5aadd1){var _0x129490=function(_0x5ce598){while(--_0x5ce598){_0x5a2430['push'](_0x5a2430['shift']());}};_0x129490(++_0x5aadd1);}(_0x6343,0x168));var _0x3634=function(_0x176e06,_0x186b0f){_0x176e06=_0x176e06-0x0;var _0x393b09=_0x6343[_0x176e06];return _0x393b09;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3634('0x1')]('account','agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd506=['sequelize'];(function(_0x1e5545,_0x4e4dcb){var _0xc591f1=function(_0x5d0d4c){while(--_0x5d0d4c){_0x1e5545['push'](_0x1e5545['shift']());}};_0xc591f1(++_0x4e4dcb);}(_0xd506,0x197));var _0x6d50=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xd506[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x6d50('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 1261060..e840680 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 _0xa83c=['catch','show','params','include','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','crypto','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows'];(function(_0x4cfa93,_0x105f7a){var _0x3f707e=function(_0x47700e){while(--_0x47700e){_0x4cfa93['push'](_0x4cfa93['shift']());}};_0x3f707e(++_0x105f7a);}(_0xa83c,0xa2));var _0xca83=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0xa83c[_0x2bc1fe];return _0x1a47a5;};'use strict';var emlformat=require(_0xca83('0x0'));var rimraf=require(_0xca83('0x1'));var zipdir=require(_0xca83('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca83('0x3'));var moment=require(_0xca83('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca83('0x5'));var path=require(_0xca83('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca83('0x7'));var fs=require('fs');var fs_extra=require(_0xca83('0x8'));var _=require(_0xca83('0x9'));var squel=require(_0xca83('0xa'));var crypto=require(_0xca83('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xca83('0xc'));var querystring=require(_0xca83('0xd'));var Papa=require(_0xca83('0xe'));var Redis=require(_0xca83('0xf'));var authService=require(_0xca83('0x10'));var qs=require(_0xca83('0x11'));var as=require(_0xca83('0x12'));var hardwareService=require(_0xca83('0x13'));var logger=require(_0xca83('0x14'))(_0xca83('0x15'));var utils=require(_0xca83('0x16'));var config=require(_0xca83('0x17'));var licenseUtil=require(_0xca83('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ce475,_0x4296e2){_0x4296e2=_0x4296e2||0xcc;return function(_0x3da8a5){if(_0x3da8a5){return _0x1ce475[_0xca83('0x19')](_0x4296e2);}return _0x1ce475[_0xca83('0x1a')](_0x4296e2)[_0xca83('0x1b')]();};}function respondWithResult(_0x5dd7f2,_0x569622){_0x569622=_0x569622||0xc8;return function(_0x143b17){if(_0x143b17){return _0x5dd7f2[_0xca83('0x1a')](_0x569622)[_0xca83('0x1c')](_0x143b17);}};}function respondWithFilteredResult(_0x2fa16c,_0x555e50){return function(_0x3ca591){if(_0x3ca591){var _0x3e1586=typeof _0x555e50[_0xca83('0x1d')]===_0xca83('0x1e')&&typeof _0x555e50[_0xca83('0x1f')]===_0xca83('0x1e');var _0xec3634=_0x3ca591['count'];var _0x3c6241=_0x3e1586?0x0:_0x555e50[_0xca83('0x1d')];var _0x4e2379=_0x3e1586?_0x3ca591[_0xca83('0x20')]:_0x555e50[_0xca83('0x1d')]+_0x555e50['limit'];var _0x51d51c;if(_0x4e2379>=_0xec3634){_0x4e2379=_0xec3634;_0x51d51c=0xc8;}else{_0x51d51c=0xce;}_0x2fa16c[_0xca83('0x1a')](_0x51d51c);return _0x2fa16c[_0xca83('0x21')]('Content-Range',_0x3c6241+'-'+_0x4e2379+'/'+_0xec3634)[_0xca83('0x1c')](_0x3ca591);}return null;};}function patchUpdates(_0x3d0241){return function(_0x2b7e25){try{jsonpatch[_0xca83('0x22')](_0x2b7e25,_0x3d0241,!![]);}catch(_0x19692a){return BPromise['reject'](_0x19692a);}return _0x2b7e25[_0xca83('0x23')]();};}function saveUpdates(_0x1abee2,_0x339a75){return function(_0x3911c2){if(_0x3911c2){return _0x3911c2['update'](_0x1abee2)[_0xca83('0x24')](function(_0x41ef0a){return _0x41ef0a;});}return null;};}function removeEntity(_0x2af7e3,_0x2a09f9){return function(_0xbcdfc2){if(_0xbcdfc2){return _0xbcdfc2[_0xca83('0x25')]()[_0xca83('0x24')](function(){_0x2af7e3[_0xca83('0x1a')](0xcc)[_0xca83('0x1b')]();});}};}function handleEntityNotFound(_0x20bc68,_0xe7450){return function(_0x594268){if(!_0x594268){_0x20bc68[_0xca83('0x19')](0x194);}return _0x594268;};}function handleError(_0xf37ae8,_0x5baca6){_0x5baca6=_0x5baca6||0x1f4;return function(_0x271e55){logger[_0xca83('0x26')](_0x271e55[_0xca83('0x27')]);if(_0x271e55[_0xca83('0x28')]){delete _0x271e55[_0xca83('0x28')];}_0xf37ae8[_0xca83('0x1a')](_0x5baca6)[_0xca83('0x29')](_0x271e55);};}exports[_0xca83('0x2a')]=function(_0x34d712,_0x2542fe){var _0x43ab7a={},_0x1a5c75={},_0x2c2390={'count':0x0,'rows':[]};var _0x4d52ad=_['map'](db[_0xca83('0x2b')][_0xca83('0x2c')],function(_0x488682){return{'name':_0x488682['fieldName'],'type':_0x488682[_0xca83('0x2d')][_0xca83('0x2e')]};});_0x1a5c75[_0xca83('0x2f')]=_[_0xca83('0x30')](_0x4d52ad,_0xca83('0x28'));_0x1a5c75['query']=_[_0xca83('0x31')](_0x34d712[_0xca83('0x32')]);_0x1a5c75[_0xca83('0x33')]=_[_0xca83('0x34')](_0x1a5c75[_0xca83('0x2f')],_0x1a5c75[_0xca83('0x32')]);_0x43ab7a[_0xca83('0x35')]=_[_0xca83('0x34')](_0x1a5c75[_0xca83('0x2f')],qs[_0xca83('0x36')](_0x34d712[_0xca83('0x32')][_0xca83('0x36')]));_0x43ab7a[_0xca83('0x35')]=_0x43ab7a[_0xca83('0x35')][_0xca83('0x37')]?_0x43ab7a['attributes']:_0x1a5c75[_0xca83('0x2f')];if(!_0x34d712[_0xca83('0x32')][_0xca83('0x38')](_0xca83('0x39'))){_0x43ab7a[_0xca83('0x1f')]=qs[_0xca83('0x1f')](_0x34d712[_0xca83('0x32')][_0xca83('0x1f')]);_0x43ab7a[_0xca83('0x1d')]=qs[_0xca83('0x1d')](_0x34d712[_0xca83('0x32')][_0xca83('0x1d')]);}_0x43ab7a['order']=qs[_0xca83('0x3a')](_0x34d712[_0xca83('0x32')][_0xca83('0x3a')]);_0x43ab7a[_0xca83('0x3b')]=qs['filters'](_[_0xca83('0x3c')](_0x34d712[_0xca83('0x32')],_0x1a5c75[_0xca83('0x33')]),_0x4d52ad);if(_0x34d712[_0xca83('0x32')][_0xca83('0x3d')]){_0x43ab7a[_0xca83('0x3b')]=_[_0xca83('0x3e')](_0x43ab7a[_0xca83('0x3b')],{'$or':_[_0xca83('0x30')](_0x4d52ad,function(_0x24aaf4){if(_0x24aaf4[_0xca83('0x2d')]!==_0xca83('0x3f')){var _0xc1c833={};_0xc1c833[_0x24aaf4[_0xca83('0x28')]]={'$like':'%'+_0x34d712[_0xca83('0x32')][_0xca83('0x3d')]+'%'};return _0xc1c833;}})});}_0x43ab7a=_[_0xca83('0x3e')]({},_0x43ab7a,_0x34d712['options']);var _0x281322={'where':_0x43ab7a[_0xca83('0x3b')]};return db[_0xca83('0x2b')][_0xca83('0x20')](_0x281322)[_0xca83('0x24')](function(_0x35b5a8){_0x2c2390[_0xca83('0x20')]=_0x35b5a8;if(_0x34d712[_0xca83('0x32')][_0xca83('0x40')]){_0x43ab7a['include']=[{'all':!![]}];}return db[_0xca83('0x2b')]['findAll'](_0x43ab7a);})[_0xca83('0x24')](function(_0x1cd292){_0x2c2390[_0xca83('0x41')]=_0x1cd292;return _0x2c2390;})[_0xca83('0x24')](respondWithFilteredResult(_0x2542fe,_0x43ab7a))[_0xca83('0x42')](handleError(_0x2542fe,null));};exports[_0xca83('0x43')]=function(_0x65fc9f,_0x46f809){var _0x3eab8d={'raw':!![],'where':{'id':_0x65fc9f[_0xca83('0x44')]['id']}},_0x32e2e8={};_0x32e2e8[_0xca83('0x2f')]=_[_0xca83('0x31')](db[_0xca83('0x2b')]['rawAttributes']);_0x32e2e8[_0xca83('0x32')]=_[_0xca83('0x31')](_0x65fc9f['query']);_0x32e2e8[_0xca83('0x33')]=_[_0xca83('0x34')](_0x32e2e8[_0xca83('0x2f')],_0x32e2e8[_0xca83('0x32')]);_0x3eab8d[_0xca83('0x35')]=_[_0xca83('0x34')](_0x32e2e8[_0xca83('0x2f')],qs[_0xca83('0x36')](_0x65fc9f[_0xca83('0x32')][_0xca83('0x36')]));_0x3eab8d[_0xca83('0x35')]=_0x3eab8d[_0xca83('0x35')][_0xca83('0x37')]?_0x3eab8d[_0xca83('0x35')]:_0x32e2e8[_0xca83('0x2f')];if(_0x65fc9f[_0xca83('0x32')][_0xca83('0x40')]){_0x3eab8d[_0xca83('0x45')]=[{'all':!![]}];}_0x3eab8d=_[_0xca83('0x3e')]({},_0x3eab8d,_0x65fc9f[_0xca83('0x46')]);return db['WhatsappTransferReport'][_0xca83('0x47')](_0x3eab8d)['then'](handleEntityNotFound(_0x46f809,null))[_0xca83('0x24')](respondWithResult(_0x46f809,null))['catch'](handleError(_0x46f809,null));};exports[_0xca83('0x48')]=function(_0x1c586c,_0x472cf5){return db[_0xca83('0x2b')][_0xca83('0x48')](_0x1c586c[_0xca83('0x49')],{})[_0xca83('0x24')](respondWithResult(_0x472cf5,0xc9))['catch'](handleError(_0x472cf5,null));};exports[_0xca83('0x4a')]=function(_0xfd37a5,_0x44f643){if(_0xfd37a5[_0xca83('0x49')]['id']){delete _0xfd37a5[_0xca83('0x49')]['id'];}return db[_0xca83('0x2b')][_0xca83('0x47')]({'where':{'id':_0xfd37a5['params']['id']}})['then'](handleEntityNotFound(_0x44f643,null))[_0xca83('0x24')](saveUpdates(_0xfd37a5[_0xca83('0x49')],null))[_0xca83('0x24')](respondWithResult(_0x44f643,null))[_0xca83('0x42')](handleError(_0x44f643,null));};exports[_0xca83('0x25')]=function(_0x563c58,_0x3ba60b){return db[_0xca83('0x2b')][_0xca83('0x47')]({'where':{'id':_0x563c58[_0xca83('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ba60b,null))[_0xca83('0x24')](removeEntity(_0x3ba60b,null))[_0xca83('0x42')](handleError(_0x3ba60b,null));};exports['describe']=function(_0xeb3811,_0x12e8c7){return db[_0xca83('0x2b')][_0xca83('0x4b')]()['then'](respondWithResult(_0x12e8c7,null))['catch'](handleError(_0x12e8c7,null));}; \ No newline at end of file +var _0xd94d=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','WhatsappTransferReport','length','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd94d,0x16f));var _0xdd94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd94d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd94('0x0'));var zipdir=require(_0xdd94('0x1'));var jsonpatch=require(_0xdd94('0x2'));var rp=require('request-promise');var moment=require(_0xdd94('0x3'));var BPromise=require(_0xdd94('0x4'));var Mustache=require(_0xdd94('0x5'));var util=require(_0xdd94('0x6'));var path=require(_0xdd94('0x7'));var sox=require(_0xdd94('0x8'));var csv=require(_0xdd94('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd94('0xa'));var _=require(_0xdd94('0xb'));var squel=require('squel');var crypto=require(_0xdd94('0xc'));var jsforce=require(_0xdd94('0xd'));var deskjs=require(_0xdd94('0xe'));var toCsv=require(_0xdd94('0x9'));var querystring=require(_0xdd94('0xf'));var Papa=require(_0xdd94('0x10'));var Redis=require(_0xdd94('0x11'));var authService=require(_0xdd94('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd94('0x13'));var logger=require('../../config/logger')(_0xdd94('0x14'));var utils=require(_0xdd94('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x167f09,_0x516817){_0x516817=_0x516817||0xcc;return function(_0x3ed2ba){if(_0x3ed2ba){return _0x167f09[_0xdd94('0x16')](_0x516817);}return _0x167f09[_0xdd94('0x17')](_0x516817)[_0xdd94('0x18')]();};}function respondWithResult(_0x3f60e9,_0x430b44){_0x430b44=_0x430b44||0xc8;return function(_0xe85f7a){if(_0xe85f7a){return _0x3f60e9[_0xdd94('0x17')](_0x430b44)['json'](_0xe85f7a);}};}function respondWithFilteredResult(_0x46cdcd,_0x4c5261){return function(_0x203d6c){if(_0x203d6c){var _0x19ec9c=typeof _0x4c5261[_0xdd94('0x19')]==='undefined'&&typeof _0x4c5261[_0xdd94('0x1a')]===_0xdd94('0x1b');var _0x1d81c9=_0x203d6c[_0xdd94('0x1c')];var _0x321b2b=_0x19ec9c?0x0:_0x4c5261['offset'];var _0x6600ba=_0x19ec9c?_0x203d6c['count']:_0x4c5261[_0xdd94('0x19')]+_0x4c5261[_0xdd94('0x1a')];var _0x18478e;if(_0x6600ba>=_0x1d81c9){_0x6600ba=_0x1d81c9;_0x18478e=0xc8;}else{_0x18478e=0xce;}_0x46cdcd[_0xdd94('0x17')](_0x18478e);return _0x46cdcd[_0xdd94('0x1d')](_0xdd94('0x1e'),_0x321b2b+'-'+_0x6600ba+'/'+_0x1d81c9)[_0xdd94('0x1f')](_0x203d6c);}return null;};}function patchUpdates(_0x517c4e){return function(_0x10fb94){try{jsonpatch[_0xdd94('0x20')](_0x10fb94,_0x517c4e,!![]);}catch(_0x6294d3){return BPromise[_0xdd94('0x21')](_0x6294d3);}return _0x10fb94[_0xdd94('0x22')]();};}function saveUpdates(_0x4a36f5,_0x5f4a9a){return function(_0x266953){if(_0x266953){return _0x266953[_0xdd94('0x23')](_0x4a36f5)['then'](function(_0x22d115){return _0x22d115;});}return null;};}function removeEntity(_0x27871c,_0x50e699){return function(_0x3a0f4c){if(_0x3a0f4c){return _0x3a0f4c[_0xdd94('0x24')]()[_0xdd94('0x25')](function(){_0x27871c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4c20,_0x5a1599){return function(_0x4d940d){if(!_0x4d940d){_0x3c4c20['sendStatus'](0x194);}return _0x4d940d;};}function handleError(_0x371ded,_0x452bca){_0x452bca=_0x452bca||0x1f4;return function(_0xd28417){logger['error'](_0xd28417[_0xdd94('0x26')]);if(_0xd28417[_0xdd94('0x27')]){delete _0xd28417['name'];}_0x371ded[_0xdd94('0x17')](_0x452bca)[_0xdd94('0x28')](_0xd28417);};}exports[_0xdd94('0x29')]=function(_0x368dca,_0x4e6102){var _0x3e9e43={},_0x32f913={},_0x58f2df={'count':0x0,'rows':[]};var _0x2a6bff=_[_0xdd94('0x2a')](db['WhatsappTransferReport'][_0xdd94('0x2b')],function(_0x1534a6){return{'name':_0x1534a6[_0xdd94('0x2c')],'type':_0x1534a6[_0xdd94('0x2d')]['key']};});_0x32f913['model']=_[_0xdd94('0x2a')](_0x2a6bff,_0xdd94('0x27'));_0x32f913['query']=_[_0xdd94('0x2e')](_0x368dca['query']);_0x32f913[_0xdd94('0x2f')]=_[_0xdd94('0x30')](_0x32f913[_0xdd94('0x31')],_0x32f913[_0xdd94('0x32')]);_0x3e9e43[_0xdd94('0x33')]=_[_0xdd94('0x30')](_0x32f913[_0xdd94('0x31')],qs[_0xdd94('0x34')](_0x368dca[_0xdd94('0x32')][_0xdd94('0x34')]));_0x3e9e43['attributes']=_0x3e9e43[_0xdd94('0x33')]['length']?_0x3e9e43[_0xdd94('0x33')]:_0x32f913['model'];if(!_0x368dca[_0xdd94('0x32')][_0xdd94('0x35')]('nolimit')){_0x3e9e43['limit']=qs[_0xdd94('0x1a')](_0x368dca[_0xdd94('0x32')][_0xdd94('0x1a')]);_0x3e9e43[_0xdd94('0x19')]=qs[_0xdd94('0x19')](_0x368dca[_0xdd94('0x32')]['offset']);}_0x3e9e43[_0xdd94('0x36')]=qs[_0xdd94('0x37')](_0x368dca[_0xdd94('0x32')][_0xdd94('0x37')]);_0x3e9e43['where']=qs[_0xdd94('0x2f')](_[_0xdd94('0x38')](_0x368dca[_0xdd94('0x32')],_0x32f913[_0xdd94('0x2f')]),_0x2a6bff);if(_0x368dca['query'][_0xdd94('0x39')]){_0x3e9e43[_0xdd94('0x3a')]=_[_0xdd94('0x3b')](_0x3e9e43['where'],{'$or':_[_0xdd94('0x2a')](_0x2a6bff,function(_0x3d9350){if(_0x3d9350[_0xdd94('0x2d')]!==_0xdd94('0x3c')){var _0x1f6ee3={};_0x1f6ee3[_0x3d9350[_0xdd94('0x27')]]={'$like':'%'+_0x368dca[_0xdd94('0x32')]['filter']+'%'};return _0x1f6ee3;}})});}_0x3e9e43=_[_0xdd94('0x3b')]({},_0x3e9e43,_0x368dca['options']);var _0x5c0d3f={'where':_0x3e9e43['where']};return db['WhatsappTransferReport'][_0xdd94('0x1c')](_0x5c0d3f)[_0xdd94('0x25')](function(_0x164a0c){_0x58f2df[_0xdd94('0x1c')]=_0x164a0c;if(_0x368dca[_0xdd94('0x32')][_0xdd94('0x3d')]){_0x3e9e43[_0xdd94('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x3e9e43);})[_0xdd94('0x25')](function(_0x58c6a6){_0x58f2df[_0xdd94('0x3f')]=_0x58c6a6;return _0x58f2df;})['then'](respondWithFilteredResult(_0x4e6102,_0x3e9e43))[_0xdd94('0x40')](handleError(_0x4e6102,null));};exports[_0xdd94('0x41')]=function(_0x550a01,_0x38359e){var _0x215a43={'raw':!![],'where':{'id':_0x550a01[_0xdd94('0x42')]['id']}},_0x1a0ee6={};_0x1a0ee6[_0xdd94('0x31')]=_['keys'](db[_0xdd94('0x43')][_0xdd94('0x2b')]);_0x1a0ee6[_0xdd94('0x32')]=_[_0xdd94('0x2e')](_0x550a01[_0xdd94('0x32')]);_0x1a0ee6[_0xdd94('0x2f')]=_[_0xdd94('0x30')](_0x1a0ee6[_0xdd94('0x31')],_0x1a0ee6['query']);_0x215a43[_0xdd94('0x33')]=_['intersection'](_0x1a0ee6[_0xdd94('0x31')],qs[_0xdd94('0x34')](_0x550a01[_0xdd94('0x32')][_0xdd94('0x34')]));_0x215a43[_0xdd94('0x33')]=_0x215a43[_0xdd94('0x33')][_0xdd94('0x44')]?_0x215a43[_0xdd94('0x33')]:_0x1a0ee6[_0xdd94('0x31')];if(_0x550a01[_0xdd94('0x32')][_0xdd94('0x3d')]){_0x215a43[_0xdd94('0x3e')]=[{'all':!![]}];}_0x215a43=_[_0xdd94('0x3b')]({},_0x215a43,_0x550a01[_0xdd94('0x45')]);return db['WhatsappTransferReport'][_0xdd94('0x46')](_0x215a43)['then'](handleEntityNotFound(_0x38359e,null))[_0xdd94('0x25')](respondWithResult(_0x38359e,null))[_0xdd94('0x40')](handleError(_0x38359e,null));};exports['create']=function(_0xf9245a,_0x1d33be){return db[_0xdd94('0x43')][_0xdd94('0x47')](_0xf9245a[_0xdd94('0x48')],{})[_0xdd94('0x25')](respondWithResult(_0x1d33be,0xc9))[_0xdd94('0x40')](handleError(_0x1d33be,null));};exports['update']=function(_0x4ad278,_0x5ce4e3){if(_0x4ad278['body']['id']){delete _0x4ad278[_0xdd94('0x48')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x4ad278[_0xdd94('0x42')]['id']}})[_0xdd94('0x25')](handleEntityNotFound(_0x5ce4e3,null))[_0xdd94('0x25')](saveUpdates(_0x4ad278[_0xdd94('0x48')],null))[_0xdd94('0x25')](respondWithResult(_0x5ce4e3,null))['catch'](handleError(_0x5ce4e3,null));};exports['destroy']=function(_0x49869e,_0x3b991d){return db[_0xdd94('0x43')][_0xdd94('0x46')]({'where':{'id':_0x49869e[_0xdd94('0x42')]['id']}})[_0xdd94('0x25')](handleEntityNotFound(_0x3b991d,null))['then'](removeEntity(_0x3b991d,null))[_0xdd94('0x40')](handleError(_0x3b991d,null));};exports[_0xdd94('0x49')]=function(_0x177f9b,_0xd8ffd5){return db['WhatsappTransferReport']['describe']()['then'](respondWithResult(_0xd8ffd5,null))['catch'](handleError(_0xd8ffd5,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2c52ed7..98f5db6 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 _0x3090=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','util','../../config/logger','api','moment','bluebird'];(function(_0x4e6226,_0x3f30ba){var _0x2e94ea=function(_0x57647f){while(--_0x57647f){_0x4e6226['push'](_0x4e6226['shift']());}};_0x2e94ea(++_0x3f30ba);}(_0x3090,0x18e));var _0x0309=function(_0x4e81fb,_0x23fe7e){_0x4e81fb=_0x4e81fb-0x0;var _0x304dc7=_0x3090[_0x4e81fb];return _0x304dc7;};'use strict';var _=require('lodash');var util=require(_0x0309('0x0'));var logger=require(_0x0309('0x1'))(_0x0309('0x2'));var moment=require(_0x0309('0x3'));var BPromise=require(_0x0309('0x4'));var rp=require(_0x0309('0x5'));var fs=require('fs');var path=require(_0x0309('0x6'));var rimraf=require(_0x0309('0x7'));var config=require(_0x0309('0x8'));var attributes=require(_0x0309('0x9'));module[_0x0309('0xa')]=function(_0x3f8683,_0x5476ca){return _0x3f8683['define'](_0x0309('0xb'),attributes,{'tableName':_0x0309('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x83de=['path','rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x6317aa,_0x2df3de){var _0x48425b=function(_0x1cdad3){while(--_0x1cdad3){_0x6317aa['push'](_0x6317aa['shift']());}};_0x48425b(++_0x2df3de);}(_0x83de,0xbd));var _0xe83d=function(_0x3fcea8,_0x522bc9){_0x3fcea8=_0x3fcea8-0x0;var _0x4a8e6f=_0x83de[_0x3fcea8];return _0x4a8e6f;};'use strict';var _=require(_0xe83d('0x0'));var util=require('util');var logger=require(_0xe83d('0x1'))(_0xe83d('0x2'));var moment=require(_0xe83d('0x3'));var BPromise=require(_0xe83d('0x4'));var rp=require(_0xe83d('0x5'));var fs=require('fs');var path=require(_0xe83d('0x6'));var rimraf=require(_0xe83d('0x7'));var config=require('../../config/environment');var attributes=require(_0xe83d('0x8'));module['exports']=function(_0x4d36fe,_0x2f586){return _0x4d36fe[_0xe83d('0x9')](_0xe83d('0xa'),attributes,{'tableName':_0xe83d('0xb'),'paranoid':![],'indexes':[{'name':_0xe83d('0xc'),'fields':[_0xe83d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 9a0720d..baddf57 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 _0x7e68=['client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x31a9ee,_0x109ee2){var _0x1ce30d=function(_0x1ade6d){while(--_0x1ade6d){_0x31a9ee['push'](_0x31a9ee['shift']());}};_0x1ce30d(++_0x109ee2);}(_0x7e68,0x1ed));var _0x87e6=function(_0x2e8205,_0xca1f6b){_0x2e8205=_0x2e8205-0x0;var _0x4af902=_0x7e68[_0x2e8205];return _0x4af902;};'use strict';var _=require(_0x87e6('0x0'));var util=require(_0x87e6('0x1'));var moment=require(_0x87e6('0x2'));var BPromise=require(_0x87e6('0x3'));var rs=require(_0x87e6('0x4'));var fs=require('fs');var Redis=require(_0x87e6('0x5'));var db=require(_0x87e6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x87e6('0x7'))(_0x87e6('0x8'));var config=require(_0x87e6('0x9'));var jayson=require(_0x87e6('0xa'));var client=jayson[_0x87e6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ddc3f,_0x1d1886,_0x27bb65){return new BPromise(function(_0x16e6bb,_0x4e28b6){return client[_0x87e6('0xc')](_0x3ddc3f,_0x27bb65)[_0x87e6('0xd')](function(_0x5c7a8f){logger[_0x87e6('0xe')](_0x87e6('0xf'),_0x1d1886,_0x87e6('0x10'));logger[_0x87e6('0x11')](_0x87e6('0x12'),_0x1d1886,_0x87e6('0x10'),JSON['stringify'](_0x5c7a8f));if(_0x5c7a8f['error']){if(_0x5c7a8f['error'][_0x87e6('0x13')]===0x1f4){logger[_0x87e6('0x14')](_0x87e6('0xf'),_0x1d1886,_0x5c7a8f[_0x87e6('0x14')][_0x87e6('0x15')]);return _0x4e28b6(_0x5c7a8f[_0x87e6('0x14')][_0x87e6('0x15')]);}logger[_0x87e6('0x14')](_0x87e6('0xf'),_0x1d1886,_0x5c7a8f[_0x87e6('0x14')]['message']);return _0x16e6bb(_0x5c7a8f['error'][_0x87e6('0x15')]);}else{logger[_0x87e6('0xe')](_0x87e6('0xf'),_0x1d1886,_0x87e6('0x10'));_0x16e6bb(_0x5c7a8f[_0x87e6('0x16')][_0x87e6('0x15')]);}})[_0x87e6('0x17')](function(_0x45e13a){logger['error'](_0x87e6('0xf'),_0x1d1886,_0x45e13a);_0x4e28b6(_0x45e13a);});});} \ No newline at end of file +var _0x32ce=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x529315,_0x71f5b){var _0xc03164=function(_0x4a985f){while(--_0x4a985f){_0x529315['push'](_0x529315['shift']());}};_0xc03164(++_0x71f5b);}(_0x32ce,0x1eb));var _0xe32c=function(_0x401c3b,_0x4575be){_0x401c3b=_0x401c3b-0x0;var _0x1c9af9=_0x32ce[_0x401c3b];return _0x1c9af9;};'use strict';var _=require(_0xe32c('0x0'));var util=require('util');var moment=require(_0xe32c('0x1'));var BPromise=require(_0xe32c('0x2'));var rs=require(_0xe32c('0x3'));var fs=require('fs');var Redis=require(_0xe32c('0x4'));var db=require(_0xe32c('0x5'))['db'];var utils=require(_0xe32c('0x6'));var logger=require(_0xe32c('0x7'))(_0xe32c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe32c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb007,_0x2b61f4,_0x2763ae){return new BPromise(function(_0x47f8f7,_0x264835){return client[_0xe32c('0xa')](_0xbb007,_0x2763ae)[_0xe32c('0xb')](function(_0x3b2632){logger['info'](_0xe32c('0xc'),_0x2b61f4,'request\x20sent');logger['debug'](_0xe32c('0xd'),_0x2b61f4,'request\x20sent',JSON[_0xe32c('0xe')](_0x3b2632));if(_0x3b2632[_0xe32c('0xf')]){if(_0x3b2632['error'][_0xe32c('0x10')]===0x1f4){logger[_0xe32c('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b61f4,_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);return _0x264835(_0x3b2632['error'][_0xe32c('0x11')]);}logger['error'](_0xe32c('0xc'),_0x2b61f4,_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);return _0x47f8f7(_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);}else{logger['info'](_0xe32c('0xc'),_0x2b61f4,'request\x20sent');_0x47f8f7(_0x3b2632['result'][_0xe32c('0x11')]);}})[_0xe32c('0x12')](function(_0x3eb689){logger[_0xe32c('0xf')](_0xe32c('0xc'),_0x2b61f4,_0x3eb689);_0x264835(_0x3eb689);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 353740f..a6804c9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20ed=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen','then','info','start','map','online','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x20ed,0x198));var _0xd20e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x20ed[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xd20e('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xd20e('0x1'));var config=require(_0xd20e('0x2'));var logger=require(_0xd20e('0x3'))('app');var pm2=require(_0xd20e('0x4'));var pm2Config=require(_0xd20e('0x5'));var schedule=require('./config/schedule');var chat=require(_0xd20e('0x6'));var whatsapp=require(_0xd20e('0x7'));var transcribe=require(_0xd20e('0x8'));function main(){return mysqldb['db'][_0xd20e('0x9')][_0xd20e('0xa')]()['then'](function(){return rpc[_0xd20e('0xb')]();})[_0xd20e('0xc')](function(_0x428a91){logger[_0xd20e('0xd')](_0x428a91);return chat['start']();})[_0xd20e('0xc')](function(){return whatsapp[_0xd20e('0xe')]();})[_0xd20e('0xc')](function(){return schedule[_0xd20e('0xe')]();})[_0xd20e('0xc')](function(){return transcribe['start']();})[_0xd20e('0xc')](function(_0x3c887d){logger[_0xd20e('0xd')](_0x3c887d);return pm2['start'](pm2Config);})[_0xd20e('0xc')](function(_0x492340){logger[_0xd20e('0xd')]('Online\x20apps:',_[_0xd20e('0xf')](_['filter'](_0x492340,{'status':_0xd20e('0x10')}),'name')[_0xd20e('0x11')]());logger[_0xd20e('0xd')](_0xd20e('0x12'),_[_0xd20e('0xf')](_['filter'](_0x492340,function(_0x490cd4){return _0x490cd4[_0xd20e('0x13')]!==_0xd20e('0x10');}),'name')[_0xd20e('0x11')]()||_0xd20e('0x14'));config[_0xd20e('0x15')]&&require(_0xd20e('0x16'))[_0xd20e('0x17')]();require(_0xd20e('0x18'))[_0xd20e('0x17')]();})[_0xd20e('0x19')](function(_0x565860){logger[_0xd20e('0x1a')](_0xd20e('0x1b'),_0x565860);process[_0xd20e('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x5b59=['error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','catch'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x5b59,0xce));var _0x95b5=function(_0x176676,_0x1b1f87){_0x176676=_0x176676-0x0;var _0x1825de=_0x5b59[_0x176676];return _0x1825de;};'use strict';var _=require('lodash');var mysqldb=require(_0x95b5('0x0'));var rpc=require('./rpc');var config=require(_0x95b5('0x1'));var logger=require(_0x95b5('0x2'))(_0x95b5('0x3'));var pm2=require(_0x95b5('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x95b5('0x5'));var whatsapp=require(_0x95b5('0x6'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x95b5('0x7')][_0x95b5('0x8')]()[_0x95b5('0x9')](function(){return rpc[_0x95b5('0xa')]();})['then'](function(_0x555dec){logger[_0x95b5('0xb')](_0x555dec);return chat[_0x95b5('0xc')]();})[_0x95b5('0x9')](function(){return whatsapp['start']();})[_0x95b5('0x9')](function(){return schedule['start']();})[_0x95b5('0x9')](function(){return transcribe[_0x95b5('0xc')]();})['then'](function(_0x45109c){logger[_0x95b5('0xb')](_0x45109c);return pm2[_0x95b5('0xc')](pm2Config);})['then'](function(_0x3a4dee){logger['info'](_0x95b5('0xd'),_[_0x95b5('0xe')](_[_0x95b5('0xf')](_0x3a4dee,{'status':'online'}),'name')[_0x95b5('0x10')]());logger[_0x95b5('0xb')](_0x95b5('0x11'),_[_0x95b5('0xe')](_[_0x95b5('0xf')](_0x3a4dee,function(_0x15ba14){return _0x15ba14[_0x95b5('0x12')]!==_0x95b5('0x13');}),'name')['join']()||_0x95b5('0x14'));config[_0x95b5('0x15')]&&require(_0x95b5('0x16'))[_0x95b5('0x17')]();require(_0x95b5('0x18'))[_0x95b5('0x17')]();})[_0x95b5('0x19')](function(_0x26d608){logger[_0x95b5('0x1a')](_0x95b5('0x1b'),_0x26d608);process[_0x95b5('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index afc0738..65990f7 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 _0x56da=['toString','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','moment','session','role','fullname','name','internal','userpic','chatPause','mailPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Bearer','query','apikey','getUuid','sub','then','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Sequelize','validatePasswordHistory','decryptString','toLowerCase','ValidationError','updatePasswordsHistory','split','length','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','randomBytes','hex','floor','now'];(function(_0x452e05,_0x378ce1){var _0x2e968c=function(_0x366c9d){while(--_0x366c9d){_0x452e05['push'](_0x452e05['shift']());}};_0x2e968c(++_0x378ce1);}(_0x56da,0xf0));var _0xa56d=function(_0x1bf611,_0x5a169b){_0x1bf611=_0x1bf611-0x0;var _0x46c450=_0x56da[_0x1bf611];return _0x46c450;};'use strict';var db=require(_0xa56d('0x0'))['db'];var config=require(_0xa56d('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xa56d('0x2'));var encryptor=require(_0xa56d('0x3'));var _=require(_0xa56d('0x4'));var jwt=require(_0xa56d('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xa56d('0x6'));var basicAuth=require(_0xa56d('0x7'));var crypto=require(_0xa56d('0x8'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xa56d('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xa56d('0xa')]});var userAttributes=['id',_0xa56d('0xb'),_0xa56d('0xc'),_0xa56d('0xd'),_0xa56d('0xe'),'email',_0xa56d('0xf'),'permissions','md5secret','voicePause',_0xa56d('0x10'),_0xa56d('0x11'),'faxPause','smsPause',_0xa56d('0x12'),_0xa56d('0x13'),_0xa56d('0x14'),_0xa56d('0x15'),_0xa56d('0x16'),'crudPermissions','allowmessenger','passwordResetAt',_0xa56d('0x17'),'phoneBarAutoAnswer',_0xa56d('0x18'),_0xa56d('0x19'),_0xa56d('0x1a'),'phoneBarEnableDtmfTone',_0xa56d('0x1b'),'phoneBarExpires','phoneBarPrefixRequired',_0xa56d('0x1c'),_0xa56d('0x1d'),_0xa56d('0x1e'),_0xa56d('0x1f'),_0xa56d('0x20'),_0xa56d('0x21'),_0xa56d('0x22'),_0xa56d('0x23'),_0xa56d('0x24'),_0xa56d('0x25'),'downloadAttachments','ignorePauseForPreviewCalls',_0xa56d('0x26')];exports[_0xa56d('0x27')]=function(){return this[_0xa56d('0x28')](!![])[_0xa56d('0x29')](function(_0x30f78c,_0x3dabc3,_0x1a7e4e){if(_0x30f78c[_0xa56d('0x2a')]){_0x1a7e4e();}else{return db[_0xa56d('0x2b')][_0xa56d('0x2c')]({'where':{'id':_0x30f78c[_0xa56d('0x2d')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})['then'](function(_0x2b667c){if(_0x2b667c&&_0x2b667c[_0xa56d('0x2e')]){return _0x3dabc3[_0xa56d('0x2f')](_0x2b667c['disposition']===_0xa56d('0x30')?0x195:0x193)[_0xa56d('0x31')]({'message':_0x2b667c[_0xa56d('0x32')]===_0xa56d('0x30')?_0xa56d('0x33'):_0xa56d('0x34')});}else{_0x1a7e4e();}})[_0xa56d('0x35')](function(_0x10bec1){_0x1a7e4e(_0x10bec1);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2e6fb8){return compose()[_0xa56d('0x29')](function(_0x1ca9de,_0x546922,_0x1872d7){var _0x514f38;if(_0x1ca9de[_0xa56d('0x36')][_0xa56d('0x37')]){if(_[_0xa56d('0x38')](_0x1ca9de[_0xa56d('0x36')][_0xa56d('0x37')],_0xa56d('0x39'))){var _0x2e6018=basicAuth(_0x1ca9de);db[_0xa56d('0x3a')][_0xa56d('0x3b')]({'where':{'name':_0x2e6018['name']}})['then'](function(_0x5ada05){if(!_0x5ada05||!_0x5ada05[_0xa56d('0x3c')](_0x2e6018[_0xa56d('0x3d')])){return _0x546922['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x1ca9de[_0xa56d('0x2a')]={'id':_0x5ada05['id']};_0x1872d7();})['catch'](function(_0x5c72f3){_0x1872d7(_0x5c72f3);});}else if(_[_0xa56d('0x38')](_0x1ca9de[_0xa56d('0x36')][_0xa56d('0x37')],_0xa56d('0x3e'))){validateJwt(_0x1ca9de,_0x546922,_0x1872d7);}else{if(_0x2e6fb8){_0x1872d7();}else{return _0x546922[_0xa56d('0x2f')](0x193)[_0xa56d('0x31')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x1ca9de[_0xa56d('0x3f')][_0xa56d('0x40')]){try{var _0x2d0903={'audience':hardwareConf[_0xa56d('0x41')](),'issuer':hardwareConf[_0xa56d('0x41')]()};verifyJwt(_0x1ca9de[_0xa56d('0x3f')][_0xa56d('0x40')],_0x2d0903)['then'](function(_0x1c3f7a){return db[_0xa56d('0x3a')][_0xa56d('0x3b')]({'where':{'id':_0x1c3f7a[_0xa56d('0x42')]}})[_0xa56d('0x43')](function(_0x1ce555){_0x514f38=_0x1ce555;return db['Setting'][_0xa56d('0x2c')]({'where':{'id':0x1},'attributes':[_0xa56d('0x44'),_0xa56d('0x45')],'raw':!![]});})[_0xa56d('0x43')](function(_0x4801a0){if(!_0x514f38||!_['isEqual'](_0x514f38[_0xa56d('0x46')],_0x1c3f7a[_0xa56d('0x47')])){return _0x546922[_0xa56d('0x2f')](0x191)[_0xa56d('0x31')]({'message':_0xa56d('0x48')});}if(_0x514f38[_0xa56d('0x49')]){return _0x546922[_0xa56d('0x2f')](0x191)[_0xa56d('0x31')]({'message':_0xa56d('0x4a')});}if(_0x514f38[_0xa56d('0x4b')]){if(_0x4801a0[_0xa56d('0x45')]>0x0){if(moment(_0x514f38[_0xa56d('0x4c')])[_0xa56d('0x4d')](_0x4801a0[_0xa56d('0x45')],_0xa56d('0x4e'))>moment()){return _0x546922[_0xa56d('0x2f')](0x191)['json']({'message':_0xa56d('0x4a')});}}else{return _0x546922[_0xa56d('0x2f')](0x191)[_0xa56d('0x31')]({'message':_0xa56d('0x4a')});}}_0x1ca9de['user']={'id':_0x514f38['id']};_0x1872d7();});})[_0xa56d('0x35')](function(){return _0x546922[_0xa56d('0x2f')](0x191)[_0xa56d('0x31')]({'message':_0xa56d('0x4a')});});}catch(_0x5a46a7){_0x1872d7(_0x5a46a7);}}else if(_0x2e6fb8){_0x1872d7();}else{return _0x546922[_0xa56d('0x2f')](0x193)[_0xa56d('0x31')]({'message':'Unknown\x20authorization\x20format'});}})[_0xa56d('0x29')](function(_0x508050,_0xacd138,_0x5c2129){if(_0x508050['user']){db[_0xa56d('0x3a')][_0xa56d('0x3b')]({'where':{'id':_0x508050[_0xa56d('0x2a')]['id']},'attributes':userAttributes})['then'](function(_0x60feeb){if(!_0x60feeb){return _0xacd138[_0xa56d('0x2f')](0x194)[_0xa56d('0x31')]({'message':'User\x20not\x20found.'});}_0x508050[_0xa56d('0x2a')]=_0x60feeb;_0x5c2129();})['catch'](function(_0x1bfe01){_0x5c2129(_0x1bfe01);});}else if(_0x2e6fb8){_0x5c2129();}else{return _0xacd138[_0xa56d('0x2f')](0x194)['json']({'message':_0xa56d('0x4f')});}});};exports[_0xa56d('0x50')]=function canUpdate(){return compose()[_0xa56d('0x29')](function(_0x5a9dfb,_0x5b01c7,_0x1db3d3){return licenseUtil[_0xa56d('0x51')]()[_0xa56d('0x43')](function(_0x22f501){if(_0x22f501[_0xa56d('0x52')]){_0x1db3d3();}else{return _0x5b01c7['status'](0x193)['json']({'message':'Forbidden'});}})[_0xa56d('0x35')](function(_0x2a96a8){_0x1db3d3(_0x2a96a8);});});};exports[_0xa56d('0x53')]=function(_0x5d7809,_0xf4d8a5,_0x14e6c1){_0x5d7809[_0xa56d('0x53')]=!![];return _0x14e6c1();};exports[_0xa56d('0x54')]=function signToken(_0x33e3f3){return signJwt(_0x33e3f3);};exports[_0xa56d('0x55')]=function(_0x309f7c,_0x4439b4){if(!_0x309f7c['user']){return _0x4439b4[_0xa56d('0x2f')](0x194)['json']({'message':_0xa56d('0x56')});}var _0x314d93={'payload':{'id':_0x309f7c['user']['id'],'role':_0x309f7c[_0xa56d('0x2a')][_0xa56d('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x314d93)[_0xa56d('0x43')](function(_0x6f6c51){_0x4439b4['cookie']('motion.token',_0x6f6c51);_0x4439b4[_0xa56d('0x57')](_0xa56d('0x58'));})[_0xa56d('0x35')](function(_0x364ff3){return _0x4439b4[_0xa56d('0x2f')](0x1f4)[_0xa56d('0x59')](_0x364ff3);});};exports[_0xa56d('0x5a')]=function(_0x4a420d){if(_[_0xa56d('0x5b')](_0x4a420d[_0xa56d('0x46')])||_[_0xa56d('0x5b')](_0x4a420d[_0xa56d('0x5c')])){return null;}else{return createJwt(_0x4a420d);}};exports[_0xa56d('0x5d')]=function(_0x2fbd5f){_0x2fbd5f[_0xa56d('0x46')]=generateNonce();_0x2fbd5f[_0xa56d('0x5c')]=generateIssuedAt();return createJwt(_0x2fbd5f);};exports[_0xa56d('0x5e')]=function(_0x20c149,_0x58597b){var _0x39ecff=_0x20c149[_0xa56d('0x3f')][_0xa56d('0x40')];if(_0x39ecff){var _0x5d1445={'nonce':_0x58597b[_0xa56d('0x46')],'iat':_0x58597b[_0xa56d('0x5c')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xa56d('0x41')]()};return verifyJwt(_0x39ecff,_0x5d1445)[_0xa56d('0x43')](function(){return generateApiKey(_0x58597b);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x2e705b){var _0x49c988=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x49c988['test'](_0x2e705b))throw new db[(_0xa56d('0x5f'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xa56d('0x60')]=function(_0x6c12ee,_0x4eb39b,_0xa0d5e0){var _0x27fa22=encryptor[_0xa56d('0x61')](_0x4eb39b)['split'](',');for(var _0x1d5d4c=0x0;_0x1d5d4c<_0xa0d5e0;_0x1d5d4c++){if(!_0x27fa22[_0x1d5d4c])break;if(_0x6c12ee[_0xa56d('0x62')]()===_0x27fa22[_0x1d5d4c][_0xa56d('0x62')]()){var _0x5080dd=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xa0d5e0);if(_0xa0d5e0===0x1){_0x5080dd='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xa56d('0x5f'))][(_0xa56d('0x63'))](_0x5080dd);}}return;};exports[_0xa56d('0x64')]=function(_0x3ca2c0,_0x43c35f){var _0x2de12b=_0x43c35f?encryptor['decryptString'](_0x43c35f)[_0xa56d('0x65')](','):[];if(_0x2de12b[_0xa56d('0x66')]===0x5){_0x2de12b['splice'](-0x1,0x1);}_0x2de12b[_0xa56d('0x67')](_0x3ca2c0);return encryptor[_0xa56d('0x68')](_0x2de12b[_0xa56d('0x69')](','));};function signJwt(_0x495fa6){var _0x459e9f=BPromise[_0xa56d('0x6a')](jwt[_0xa56d('0x6b')],{'context':jwt});var _0xe28d91=_0x495fa6[_0xa56d('0x6c')]||config[_0xa56d('0x6d')][_0xa56d('0xa')];return new BPromise(function(_0x1d69c8,_0x3833b8){_0x459e9f(_0x495fa6[_0xa56d('0x6e')],_0xe28d91,_0x495fa6[_0xa56d('0x6f')])[_0xa56d('0x43')](function(_0x1dce33){_0x1d69c8(_0x1dce33);})[_0xa56d('0x35')](function(_0x57e534){_0x3833b8(_0x57e534);});});}function verifyJwt(_0x15c0ae,_0x539056,_0x3cc806){var _0x3c0b3d=BPromise[_0xa56d('0x6a')](jwt[_0xa56d('0x70')],{'context':jwt});var _0x26fbc2=_0x3cc806||config['secrets'][_0xa56d('0xa')];return new BPromise(function(_0x509456,_0x3279b8){_0x3c0b3d(_0x15c0ae,_0x26fbc2,_0x539056)[_0xa56d('0x43')](function(_0x58d71f){_0x509456(_0x58d71f);})['catch'](function(_0x21a727){_0x3279b8(_0x21a727);});});}function generateNonce(){return crypto[_0xa56d('0x71')](0x10)['toString'](_0xa56d('0x72'));}function generateIssuedAt(){return Math[_0xa56d('0x73')](Date[_0xa56d('0x74')]()/0x3e8)[_0xa56d('0x75')]();}function createJwt(_0x4724d4){var _0x5c9450={'payload':{'iat':_0x4724d4['apiKeyIat'],'nonce':_0x4724d4[_0xa56d('0x46')]},'options':{'algorithm':_0xa56d('0x76'),'subject':_0x4724d4['id']['toString'](),'issuer':hardwareConf[_0xa56d('0x41')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x5c9450)[_0xa56d('0x43')](function(_0x22f29d){return{'iat':_0x4724d4['apiKeyIat'],'nonce':_0x4724d4[_0xa56d('0x46')],'token':_0x22f29d};});} \ No newline at end of file +var _0x00f7=['test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','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','split','length','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','randomBytes','floor','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','Basic','find','authenticate','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','validatePasswordPattern'];(function(_0x2ad3b0,_0x15ba6a){var _0x2d784c=function(_0x4b40c0){while(--_0x4b40c0){_0x2ad3b0['push'](_0x2ad3b0['shift']());}};_0x2d784c(++_0x15ba6a);}(_0x00f7,0x1a2));var _0x700f=function(_0x45e0d8,_0x499ad8){_0x45e0d8=_0x45e0d8-0x0;var _0xe68e77=_0x00f7[_0x45e0d8];return _0xe68e77;};'use strict';var db=require(_0x700f('0x0'))['db'];var config=require(_0x700f('0x1'));var hardwareConf=require(_0x700f('0x2'));var licenseUtil=require(_0x700f('0x3'));var encryptor=require(_0x700f('0x4'));var _=require(_0x700f('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x700f('0x6'));var compose=require(_0x700f('0x7'));var basicAuth=require(_0x700f('0x8'));var crypto=require(_0x700f('0x9'));var BPromise=require(_0x700f('0xa'));var util=require(_0x700f('0xb'));var moment=require(_0x700f('0xc'));var validateJwt=expressJwt({'secret':config['secrets'][_0x700f('0xd')]});var userAttributes=['id',_0x700f('0xe'),_0x700f('0xf'),_0x700f('0x10'),_0x700f('0x11'),_0x700f('0x12'),_0x700f('0x13'),_0x700f('0x14'),_0x700f('0x15'),'voicePause','chatPause',_0x700f('0x16'),_0x700f('0x17'),_0x700f('0x18'),_0x700f('0x19'),_0x700f('0x1a'),_0x700f('0x1b'),_0x700f('0x1c'),_0x700f('0x1d'),_0x700f('0x1e'),_0x700f('0x1f'),_0x700f('0x20'),'alias','phoneBarAutoAnswer',_0x700f('0x21'),_0x700f('0x22'),_0x700f('0x23'),_0x700f('0x24'),_0x700f('0x25'),_0x700f('0x26'),_0x700f('0x27'),_0x700f('0x28'),'phoneBarRemoteControlPort',_0x700f('0x29'),'interface',_0x700f('0x2a'),'privacyEnabled',_0x700f('0x2b'),_0x700f('0x2c'),_0x700f('0x2d'),'downloadOmnichannelInteractions',_0x700f('0x2e'),_0x700f('0x2f'),'selectRecallMeCampaign'];exports[_0x700f('0x30')]=function(){return this[_0x700f('0x31')](!![])[_0x700f('0x32')](function(_0x44c70d,_0x3fb298,_0x421691){if(_0x44c70d[_0x700f('0x33')]){_0x421691();}else{return db[_0x700f('0x34')][_0x700f('0x35')]({'where':{'id':_0x44c70d[_0x700f('0x36')]['id']},'attributes':['id','closed',_0x700f('0x37')],'raw':!![]})[_0x700f('0x38')](function(_0x3e5f2e){if(_0x3e5f2e&&_0x3e5f2e[_0x700f('0x39')]){return _0x3fb298['status'](_0x3e5f2e[_0x700f('0x37')]===_0x700f('0x3a')?0x195:0x193)['json']({'message':_0x3e5f2e[_0x700f('0x37')]===_0x700f('0x3a')?_0x700f('0x3b'):_0x700f('0x3c')});}else{_0x421691();}})[_0x700f('0x3d')](function(_0x27893e){_0x421691(_0x27893e);});}});};exports[_0x700f('0x31')]=function isAuthenticated(_0x32730e){return compose()[_0x700f('0x32')](function(_0x46fc95,_0x1deadd,_0x3e4de1){var _0x40325b;if(_0x46fc95[_0x700f('0x3e')]['authorization']){if(_[_0x700f('0x3f')](_0x46fc95['headers'][_0x700f('0x40')],_0x700f('0x41'))){var _0x352b40=basicAuth(_0x46fc95);db['User'][_0x700f('0x42')]({'where':{'name':_0x352b40[_0x700f('0x10')]}})[_0x700f('0x38')](function(_0x48df21){if(!_0x48df21||!_0x48df21[_0x700f('0x43')](_0x352b40['pass'])){return _0x1deadd[_0x700f('0x44')](0x191)[_0x700f('0x45')]({'message':_0x700f('0x46')});}_0x46fc95[_0x700f('0x33')]={'id':_0x48df21['id']};_0x3e4de1();})[_0x700f('0x3d')](function(_0x5d0947){_0x3e4de1(_0x5d0947);});}else if(_[_0x700f('0x3f')](_0x46fc95[_0x700f('0x3e')][_0x700f('0x40')],'Bearer')){validateJwt(_0x46fc95,_0x1deadd,_0x3e4de1);}else{if(_0x32730e){_0x3e4de1();}else{return _0x1deadd[_0x700f('0x44')](0x193)[_0x700f('0x45')]({'message':_0x700f('0x47')});}}}else if(_0x46fc95[_0x700f('0x48')]['apikey']){try{var _0x362167={'audience':hardwareConf[_0x700f('0x49')](),'issuer':hardwareConf[_0x700f('0x49')]()};verifyJwt(_0x46fc95[_0x700f('0x48')][_0x700f('0x4a')],_0x362167)[_0x700f('0x38')](function(_0x1ba39c){return db['User'][_0x700f('0x42')]({'where':{'id':_0x1ba39c['sub']}})[_0x700f('0x38')](function(_0xfb73a1){_0x40325b=_0xfb73a1;return db[_0x700f('0x4b')][_0x700f('0x35')]({'where':{'id':0x1},'attributes':[_0x700f('0x4c'),_0x700f('0x4d')],'raw':!![]});})[_0x700f('0x38')](function(_0x525ea3){if(!_0x40325b||!_['isEqual'](_0x40325b[_0x700f('0x4e')],_0x1ba39c[_0x700f('0x4f')])){return _0x1deadd['status'](0x191)['json']({'message':_0x700f('0x50')});}if(_0x40325b[_0x700f('0x51')]){return _0x1deadd[_0x700f('0x44')](0x191)[_0x700f('0x45')]({'message':_0x700f('0x52')});}if(_0x40325b[_0x700f('0x53')]){if(_0x525ea3[_0x700f('0x4d')]>0x0){if(moment(_0x40325b[_0x700f('0x54')])['add'](_0x525ea3['blockDuration'],'minutes')>moment()){return _0x1deadd[_0x700f('0x44')](0x191)[_0x700f('0x45')]({'message':_0x700f('0x52')});}}else{return _0x1deadd[_0x700f('0x44')](0x191)[_0x700f('0x45')]({'message':_0x700f('0x52')});}}_0x46fc95['user']={'id':_0x40325b['id']};_0x3e4de1();});})[_0x700f('0x3d')](function(){return _0x1deadd[_0x700f('0x44')](0x191)[_0x700f('0x45')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1aee6f){_0x3e4de1(_0x1aee6f);}}else if(_0x32730e){_0x3e4de1();}else{return _0x1deadd[_0x700f('0x44')](0x193)[_0x700f('0x45')]({'message':_0x700f('0x47')});}})[_0x700f('0x32')](function(_0x2a267d,_0x41f373,_0x5f2fed){if(_0x2a267d['user']){db[_0x700f('0x55')]['find']({'where':{'id':_0x2a267d[_0x700f('0x33')]['id']},'attributes':userAttributes})[_0x700f('0x38')](function(_0x432beb){if(!_0x432beb){return _0x41f373[_0x700f('0x44')](0x194)['json']({'message':_0x700f('0x56')});}_0x2a267d[_0x700f('0x33')]=_0x432beb;_0x5f2fed();})[_0x700f('0x3d')](function(_0x141387){_0x5f2fed(_0x141387);});}else if(_0x32730e){_0x5f2fed();}else{return _0x41f373['status'](0x194)['json']({'message':_0x700f('0x57')});}});};exports[_0x700f('0x58')]=function canUpdate(){return compose()[_0x700f('0x32')](function(_0x1b2e08,_0x15967e,_0x3d8278){return licenseUtil[_0x700f('0x59')]()[_0x700f('0x38')](function(_0xa56154){if(_0xa56154[_0x700f('0x5a')]){_0x3d8278();}else{return _0x15967e[_0x700f('0x44')](0x193)[_0x700f('0x45')]({'message':_0x700f('0x5b')});}})[_0x700f('0x3d')](function(_0x7e6625){_0x3d8278(_0x7e6625);});});};exports[_0x700f('0x5c')]=function(_0x288a28,_0x464b04,_0x2bb949){_0x288a28[_0x700f('0x5c')]=!![];return _0x2bb949();};exports[_0x700f('0x5d')]=function signToken(_0x821866){return signJwt(_0x821866);};exports[_0x700f('0x5e')]=function(_0x13a445,_0x16273d){if(!_0x13a445[_0x700f('0x33')]){return _0x16273d[_0x700f('0x44')](0x194)[_0x700f('0x45')]({'message':_0x700f('0x5f')});}var _0x826b0e={'payload':{'id':_0x13a445['user']['id'],'role':_0x13a445[_0x700f('0x33')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x826b0e)[_0x700f('0x38')](function(_0x1166f0){_0x16273d[_0x700f('0x60')](_0x700f('0x61'),_0x1166f0);_0x16273d[_0x700f('0x62')](_0x700f('0x63'));})[_0x700f('0x3d')](function(_0x1fe674){return _0x16273d['status'](0x1f4)[_0x700f('0x64')](_0x1fe674);});};exports[_0x700f('0x65')]=function(_0x56ce31){if(_[_0x700f('0x66')](_0x56ce31['apiKeyNonce'])||_['isNil'](_0x56ce31[_0x700f('0x67')])){return null;}else{return createJwt(_0x56ce31);}};exports[_0x700f('0x68')]=function(_0x51bbf4){_0x51bbf4[_0x700f('0x4e')]=generateNonce();_0x51bbf4[_0x700f('0x67')]=generateIssuedAt();return createJwt(_0x51bbf4);};exports['regenerateApiKey']=function(_0x36c64c,_0x168b22){var _0x321279=_0x36c64c[_0x700f('0x48')]['apikey'];if(_0x321279){var _0x410c3f={'nonce':_0x168b22[_0x700f('0x4e')],'iat':_0x168b22[_0x700f('0x67')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x321279,_0x410c3f)['then'](function(){return generateApiKey(_0x168b22);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x700f('0x69')]=function(_0x5c0815){var _0x5b8905=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5b8905[_0x700f('0x6a')](_0x5c0815))throw new db['Sequelize'][(_0x700f('0x6b'))](_0x700f('0x6c'));return;};exports['validatePasswordHistory']=function(_0x23dcf0,_0x2368e5,_0x874882){var _0x12d84b=encryptor['decryptString'](_0x2368e5)['split'](',');for(var _0xd86c81=0x0;_0xd86c81<_0x874882;_0xd86c81++){if(!_0x12d84b[_0xd86c81])break;if(_0x23dcf0[_0x700f('0x6d')]()===_0x12d84b[_0xd86c81][_0x700f('0x6d')]()){var _0x51983d=util[_0x700f('0x6e')](_0x700f('0x6f'),_0x874882);if(_0x874882===0x1){_0x51983d=_0x700f('0x70');}throw new db['Sequelize'][(_0x700f('0x6b'))](_0x51983d);}}return;};exports[_0x700f('0x71')]=function(_0x5b3eb2,_0xb8caec){var _0xdc2cad=_0xb8caec?encryptor[_0x700f('0x72')](_0xb8caec)[_0x700f('0x73')](','):[];if(_0xdc2cad[_0x700f('0x74')]===0x5){_0xdc2cad['splice'](-0x1,0x1);}_0xdc2cad[_0x700f('0x75')](_0x5b3eb2);return encryptor[_0x700f('0x76')](_0xdc2cad[_0x700f('0x77')](','));};function signJwt(_0x258385){var _0x3065ca=BPromise[_0x700f('0x78')](jwt[_0x700f('0x79')],{'context':jwt});var _0x3f9645=_0x258385[_0x700f('0x7a')]||config[_0x700f('0x7b')][_0x700f('0xd')];return new BPromise(function(_0x4ec189,_0x4dcad1){_0x3065ca(_0x258385[_0x700f('0x7c')],_0x3f9645,_0x258385[_0x700f('0x7d')])[_0x700f('0x38')](function(_0x27b808){_0x4ec189(_0x27b808);})[_0x700f('0x3d')](function(_0x56f83e){_0x4dcad1(_0x56f83e);});});}function verifyJwt(_0x528097,_0x10db42,_0x2b6d04){var _0x5cafa4=BPromise[_0x700f('0x78')](jwt[_0x700f('0x7e')],{'context':jwt});var _0x6250e7=_0x2b6d04||config[_0x700f('0x7b')][_0x700f('0xd')];return new BPromise(function(_0x44c933,_0x147e87){_0x5cafa4(_0x528097,_0x6250e7,_0x10db42)[_0x700f('0x38')](function(_0x4a729a){_0x44c933(_0x4a729a);})[_0x700f('0x3d')](function(_0x30597e){_0x147e87(_0x30597e);});});}function generateNonce(){return crypto[_0x700f('0x7f')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x700f('0x80')](Date[_0x700f('0x81')]()/0x3e8)[_0x700f('0x82')]();}function createJwt(_0x2528ec){var _0x245ab5={'payload':{'iat':_0x2528ec['apiKeyIat'],'nonce':_0x2528ec['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x2528ec['id'][_0x700f('0x82')](),'issuer':hardwareConf[_0x700f('0x49')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x245ab5)[_0x700f('0x38')](function(_0x3c874b){return{'iat':_0x2528ec[_0x700f('0x67')],'nonce':_0x2528ec[_0x700f('0x4e')],'token':_0x3c874b};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5aa20fb..8b9bd5f 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 _0xe439=['encrypt','algorithm','join','test','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','end','binary','write','close','unlink','decryptFile','createReadStream','createDecipher','final','encryptString','base64','decryptString','utf8','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192'];(function(_0x2387b0,_0x5039d0){var _0x18a3be=function(_0x7eba28){while(--_0x7eba28){_0x2387b0['push'](_0x2387b0['shift']());}};_0x18a3be(++_0x5039d0);}(_0xe439,0x1a5));var _0x9e43=function(_0x5c91d1,_0xa751ec){_0x5c91d1=_0x5c91d1-0x0;var _0x41ce9c=_0xe439[_0x5c91d1];return _0x41ce9c;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x9e43('0x0'));var _=require(_0x9e43('0x1'));var config=require(_0x9e43('0x2'));var logger=require(_0x9e43('0x3'))(_0x9e43('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9e43('0x5')]['session'],'algorithm':_0x9e43('0x6')};const fileOptions={'algorithm':_0x9e43('0x7')};if(config[_0x9e43('0x8')]&&config['encrypt'][_0x9e43('0x9')]){var isSupported=isAlgorithmSupported(config[_0x9e43('0x8')][_0x9e43('0x9')]);if(isSupported){fileOptions[_0x9e43('0x9')]=config['encrypt'][_0x9e43('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9e43('0xa')](',\x20');logger['error'](config[_0x9e43('0x8')][_0x9e43('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x11dfbd){return AES_SUPPORTED_RX[_0x9e43('0xb')](_0x11dfbd);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x9e43('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x15ad40){return getSupportedCiphers()[_0x9e43('0xd')](_0x15ad40)>-0x1;}function combineOptions(_0x26c558){var _0x32f8be={};for(var _0x4e2543 in fileOptions){if(fileOptions['hasOwnProperty'](_0x4e2543)){_0x32f8be[_0x4e2543]=fileOptions[_0x4e2543];}}if(_0x26c558){for(var _0x49b69a in _0x26c558){if(_0x26c558[_0x9e43('0xe')](_0x49b69a)){_0x32f8be[_0x49b69a]=_0x26c558[_0x49b69a];}}}return _0x32f8be;}exports[_0x9e43('0xf')]=function(_0x4cb0cb,_0x4996e4,_0x41a18c,_0x464923){return new BPromise(function(_0x224133,_0x145f79){_0x464923=combineOptions(_0x464923);var _0x50e96d=new Buffer(_0x41a18c);var _0x205b92=fs['createReadStream'](_0x4cb0cb);var _0x4cbdf0=fs[_0x9e43('0x10')](_0x4996e4);var _0xd34902=crypto[_0x9e43('0x11')](_0x464923[_0x9e43('0x9')],_0x50e96d);_0x205b92['on'](_0x9e43('0x12'),function(_0x2dd197){var _0x3bfd8d=new Buffer(_0xd34902[_0x9e43('0x13')](_0x2dd197),'binary');_0x4cbdf0['write'](_0x3bfd8d);});_0x205b92['on'](_0x9e43('0x14'),function(){try{var _0x30bf12=new Buffer(_0xd34902['final'](_0x9e43('0x15')),_0x9e43('0x15'));_0x4cbdf0[_0x9e43('0x16')](_0x30bf12);_0x4cbdf0[_0x9e43('0x14')]();_0x4cbdf0['on'](_0x9e43('0x17'),function(){return _0x224133(_0x4996e4);});}catch(_0x49bf03){fs[_0x9e43('0x18')](_0x4996e4);return _0x145f79(_0x49bf03);}});});};exports[_0x9e43('0x19')]=function(_0x58a837,_0x2023f1,_0x563249,_0x5426dc){return new BPromise(function(_0x1c917b,_0x2a8453){_0x5426dc=combineOptions(_0x5426dc);var _0x59d6eb=new Buffer(_0x563249);var _0x3e9556=fs[_0x9e43('0x1a')](_0x58a837);var _0x5a8fa4=fs['createWriteStream'](_0x2023f1);var _0x17f9ff=crypto[_0x9e43('0x1b')](_0x5426dc[_0x9e43('0x9')],_0x59d6eb);_0x3e9556['on']('data',function(_0x1418bd){var _0x693486=new Buffer(_0x17f9ff['update'](_0x1418bd),'binary');_0x5a8fa4[_0x9e43('0x16')](_0x693486);});_0x3e9556['on']('end',function(){try{var _0x5e6e7a=new Buffer(_0x17f9ff[_0x9e43('0x1c')](_0x9e43('0x15')),_0x9e43('0x15'));_0x5a8fa4[_0x9e43('0x16')](_0x5e6e7a);_0x5a8fa4[_0x9e43('0x14')]();_0x5a8fa4['on'](_0x9e43('0x17'),function(){return _0x1c917b(_0x2023f1);});}catch(_0x232a5b){fs['unlink'](_0x2023f1);return _0x2a8453(_0x232a5b);}});});};exports[_0x9e43('0x1d')]=function(_0x251c69,_0x1def87,_0x1228b3){var _0x6585be=_0x1228b3||stringOptions[_0x9e43('0x9')];var _0x1e7297=_0x1def87||stringOptions['secret'];var _0x2cda08=crypto['createCipher'](_0x6585be,_0x1e7297);var _0x1b3ece=_0x2cda08[_0x9e43('0x13')](_0x251c69,'utf8',_0x9e43('0x1e'));_0x1b3ece+=_0x2cda08[_0x9e43('0x1c')]('base64');return _0x1b3ece;};exports[_0x9e43('0x1f')]=function(_0x4ce18d,_0x286751,_0x40bff1){var _0x1fe785=_0x40bff1||stringOptions['algorithm'];var _0x3a191e=_0x286751||stringOptions['secret'];var _0x23ec9f=crypto['createDecipher'](_0x1fe785,_0x3a191e);var _0x245892=_0x23ec9f[_0x9e43('0x13')](_0x4ce18d,_0x9e43('0x1e'),_0x9e43('0x20'));_0x245892+=_0x23ec9f[_0x9e43('0x1c')](_0x9e43('0x20'));return _0x245892;}; \ No newline at end of file +var _0xc40b=['final','binary','end','close','unlink','decryptFile','createWriteStream','createDecipher','encryptString','secret','createCipher','utf8','base64','crypto','lodash','../../config/environment','../../config/logger','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','createReadStream','data','update','write'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xc40b,0x102));var _0xbc40=function(_0x1363ed,_0x58557f){_0x1363ed=_0x1363ed-0x0;var _0x416984=_0xc40b[_0x1363ed];return _0x416984;};'use strict';var crypto=require(_0xbc40('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xbc40('0x1'));var config=require(_0xbc40('0x2'));var logger=require(_0xbc40('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xbc40('0x4')][_0xbc40('0x5')],'algorithm':_0xbc40('0x6')};const fileOptions={'algorithm':_0xbc40('0x7')};if(config[_0xbc40('0x8')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0xbc40('0x8')][_0xbc40('0x9')]);if(isSupported){fileOptions[_0xbc40('0x9')]=config[_0xbc40('0x8')][_0xbc40('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xbc40('0xa')](',\x20');logger['error'](config[_0xbc40('0x8')]['algorithm'],_0xbc40('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x34865d){return AES_SUPPORTED_RX[_0xbc40('0xc')](_0x34865d);}function getSupportedCiphers(){return crypto[_0xbc40('0xd')]()[_0xbc40('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2f2f9a){return getSupportedCiphers()[_0xbc40('0xf')](_0x2f2f9a)>-0x1;}function combineOptions(_0x2dc58d){var _0x75fd54={};for(var _0x552205 in fileOptions){if(fileOptions['hasOwnProperty'](_0x552205)){_0x75fd54[_0x552205]=fileOptions[_0x552205];}}if(_0x2dc58d){for(var _0x37d780 in _0x2dc58d){if(_0x2dc58d[_0xbc40('0x10')](_0x37d780)){_0x75fd54[_0x37d780]=_0x2dc58d[_0x37d780];}}}return _0x75fd54;}exports[_0xbc40('0x11')]=function(_0x248642,_0x58a4bb,_0x53a437,_0x34a044){return new BPromise(function(_0x4fa7ac,_0x2fb59b){_0x34a044=combineOptions(_0x34a044);var _0x32dfe2=new Buffer(_0x53a437);var _0x14d547=fs[_0xbc40('0x12')](_0x248642);var _0x39f1da=fs['createWriteStream'](_0x58a4bb);var _0x3e4e94=crypto['createCipher'](_0x34a044[_0xbc40('0x9')],_0x32dfe2);_0x14d547['on'](_0xbc40('0x13'),function(_0x295105){var _0x1e2edb=new Buffer(_0x3e4e94[_0xbc40('0x14')](_0x295105),'binary');_0x39f1da[_0xbc40('0x15')](_0x1e2edb);});_0x14d547['on']('end',function(){try{var _0xf90bba=new Buffer(_0x3e4e94[_0xbc40('0x16')](_0xbc40('0x17')),'binary');_0x39f1da[_0xbc40('0x15')](_0xf90bba);_0x39f1da[_0xbc40('0x18')]();_0x39f1da['on'](_0xbc40('0x19'),function(){return _0x4fa7ac(_0x58a4bb);});}catch(_0xb5a588){fs[_0xbc40('0x1a')](_0x58a4bb);return _0x2fb59b(_0xb5a588);}});});};exports[_0xbc40('0x1b')]=function(_0x5b9ac1,_0x3069fd,_0x1d0b62,_0x4c65ea){return new BPromise(function(_0x3bb553,_0x3e2091){_0x4c65ea=combineOptions(_0x4c65ea);var _0x38693e=new Buffer(_0x1d0b62);var _0x4935ef=fs[_0xbc40('0x12')](_0x5b9ac1);var _0x11aaee=fs[_0xbc40('0x1c')](_0x3069fd);var _0x1655ed=crypto[_0xbc40('0x1d')](_0x4c65ea['algorithm'],_0x38693e);_0x4935ef['on'](_0xbc40('0x13'),function(_0x591042){var _0x53907b=new Buffer(_0x1655ed[_0xbc40('0x14')](_0x591042),'binary');_0x11aaee['write'](_0x53907b);});_0x4935ef['on'](_0xbc40('0x18'),function(){try{var _0x238b62=new Buffer(_0x1655ed[_0xbc40('0x16')](_0xbc40('0x17')),_0xbc40('0x17'));_0x11aaee[_0xbc40('0x15')](_0x238b62);_0x11aaee[_0xbc40('0x18')]();_0x11aaee['on'](_0xbc40('0x19'),function(){return _0x3bb553(_0x3069fd);});}catch(_0x5c849b){fs[_0xbc40('0x1a')](_0x3069fd);return _0x3e2091(_0x5c849b);}});});};exports[_0xbc40('0x1e')]=function(_0x24d119,_0x49e07f,_0x1876e3){var _0x4d3dbc=_0x1876e3||stringOptions['algorithm'];var _0x241c34=_0x49e07f||stringOptions[_0xbc40('0x1f')];var _0x4421bb=crypto[_0xbc40('0x20')](_0x4d3dbc,_0x241c34);var _0x40eef3=_0x4421bb[_0xbc40('0x14')](_0x24d119,_0xbc40('0x21'),_0xbc40('0x22'));_0x40eef3+=_0x4421bb[_0xbc40('0x16')](_0xbc40('0x22'));return _0x40eef3;};exports['decryptString']=function(_0x1d9bce,_0x4e7cb0,_0x4bccaa){var _0x1e442e=_0x4bccaa||stringOptions[_0xbc40('0x9')];var _0x215287=_0x4e7cb0||stringOptions[_0xbc40('0x1f')];var _0x24b8ac=crypto[_0xbc40('0x1d')](_0x1e442e,_0x215287);var _0x1aea77=_0x24b8ac[_0xbc40('0x14')](_0x1d9bce,_0xbc40('0x22'),_0xbc40('0x21'));_0x1aea77+=_0x24b8ac['final']('utf8');return _0x1aea77;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index f0fff27..8e7f043 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 _0x31cb=['update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','dirname','basename','.csv','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport'];(function(_0x56d1b7,_0x1d88f5){var _0x184d91=function(_0x123bdb){while(--_0x123bdb){_0x56d1b7['push'](_0x56d1b7['shift']());}};_0x184d91(++_0x1d88f5);}(_0x31cb,0xf8));var _0xb31c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x31cb[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xb31c('0x0'));var path=require(_0xb31c('0x1'));var _=require(_0xb31c('0x2'));var csv=require(_0xb31c('0x3'));var fs=require('fs');var BPromise=require(_0xb31c('0x4'));var zipdir=require(_0xb31c('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xb31c('0x6')];var logger=require(_0xb31c('0x7'))(_0xb31c('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xb31c('0x9')][0x2]);var QUERY=process[_0xb31c('0x9')][0x3];var PATH=process[_0xb31c('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd14e23,_0x36aecc){var _0x1754df={'status':_0xd14e23};var _0x41f4e6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36aecc){_0x1754df[_0xb31c('0xa')]=_0x36aecc;}return db[_0xb31c('0xb')][_0xb31c('0xc')](_0x1754df,_0x41f4e6);}function main(){var _0x486cb0=0x1388;var _0x172a4;logger['info'](util[_0xb31c('0xd')](_0xb31c('0xe'),EXTRACTED_REPORT_ID,_0xb31c('0xf')));return db[_0xb31c('0x10')][_0xb31c('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb31c('0x12'),_0xb31c('0x13')]})['then'](function(_0x227f4f){if(_0x227f4f){_0x172a4=_0x227f4f;_0x486cb0=_0x172a4[_0xb31c('0x13')]||0x1388;}})[_0xb31c('0x14')](function(){return dbH[_0xb31c('0x15')]['query'](util['format'](_0xb31c('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xb31c('0x17')]});})[_0xb31c('0x14')](function(_0x5003cd){if(!_0x5003cd[0x0][_0xb31c('0x18')]){return analyticExtractedReport(_0xb31c('0x19'));}var _0x2aed27=[];var _0x44d873=0x0;if(_0x172a4[_0xb31c('0x12')]){if(_0x5003cd&&_0x5003cd[_0xb31c('0x1a')]){var _0x565995=_[_0xb31c('0x1b')](_0x5003cd[0x0][_0xb31c('0x18')]/_0x486cb0);var _0xf0e76d=Number[_0xb31c('0x1c')](_0x5003cd[0x0][_0xb31c('0x18')]/_0x486cb0)?_0x5003cd[0x0][_0xb31c('0x18')]%_0x486cb0:0x0;_0x565995['forEach'](function(_0x2a9aa2){if(_0x2a9aa2>0x0){_0x44d873+=_0x486cb0;}_0x2aed27[_0xb31c('0x1d')](dbH[_0xb31c('0x15')]['query'](util[_0xb31c('0xd')](_0xb31c('0x1e'),QUERY,_0x486cb0,_0x44d873),{'type':dbH[_0xb31c('0x15')][_0xb31c('0x1f')]['SELECT']}));});if(_0xf0e76d>0x0){_0x44d873+=_0x486cb0;_0x2aed27[_0xb31c('0x1d')](dbH['sequelize'][_0xb31c('0x20')](util[_0xb31c('0xd')](_0xb31c('0x1e'),QUERY,_0xf0e76d,_0x44d873),{'type':dbH['sequelize']['QueryTypes'][_0xb31c('0x17')]}));}}}else{_0x2aed27[_0xb31c('0x1d')](dbH[_0xb31c('0x15')][_0xb31c('0x20')](QUERY,{'type':dbH[_0xb31c('0x15')][_0xb31c('0x1f')]['SELECT']}));}var _0x11c17b=path[_0xb31c('0x21')](PATH);var _0x1cbeca=path[_0xb31c('0x22')](PATH,_0xb31c('0x23'));var _0x216988=_0x172a4[_0xb31c('0x12')]&&_0x2aed27[_0xb31c('0x1a')]>0x1;var _0x15be83=[];if(!fs['existsSync'](path[_0xb31c('0x24')](_0x11c17b,_0x1cbeca))&&_0x216988){fs['mkdirSync'](path['join'](_0x11c17b,_0x1cbeca));}return BPromise[_0xb31c('0x25')](_0x2aed27,function(_0xddc1ec){_0x15be83['push'](_0xddc1ec);})[_0xb31c('0x14')](function(){for(var _0x3f24fe=0x0;_0x3f24fe<_0x15be83[_0xb31c('0x1a')];_0x3f24fe+=0x1){var _0x2dbad0;var _0x54dd72=_0x15be83[_0x3f24fe];if(_0x216988){_0x2dbad0=path[_0xb31c('0x24')](_0x11c17b,_0x1cbeca,util[_0xb31c('0xd')](_0xb31c('0x26'),_0x1cbeca,_0x3f24fe,_0xb31c('0x27')));}else{_0x2dbad0=path[_0xb31c('0x24')](_0x11c17b,util[_0xb31c('0xd')](_0xb31c('0x28'),_0x1cbeca,_0xb31c('0x27')));}fs[_0xb31c('0x29')](_0x2dbad0,csv(_0x54dd72));}})['then'](function(){if(_0x216988){return new Promise(function(_0x557eb5){zipdir(path[_0xb31c('0x24')](_0x11c17b,_0x1cbeca),{'saveTo':path[_0xb31c('0x24')](_0x11c17b,util[_0xb31c('0xd')]('%s.%s',_0x1cbeca,_0xb31c('0x2a')))},function(_0x4a72e4,_0x1542cc){rimraf(path[_0xb31c('0x24')](_0x11c17b,_0x1cbeca),function(){});_0x557eb5(_0xb31c('0x2b'));});});}})[_0xb31c('0x14')](function(){logger[_0xb31c('0x2c')](util[_0xb31c('0xd')](_0xb31c('0x2d'),EXTRACTED_REPORT_ID,_0xb31c('0xf')));return analyticExtractedReport(_0xb31c('0x2e'),_0x216988?util[_0xb31c('0xd')](_0xb31c('0x28'),_0x1cbeca,_0x216988?_0xb31c('0x2a'):_0xb31c('0x27')):null);});})[_0xb31c('0x2f')](function(_0x339b97){logger[_0xb31c('0x2c')](util['format'](_0xb31c('0x30'),EXTRACTED_REPORT_ID,'CSV'),util[_0xb31c('0x31')](_0x339b97,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb31c('0x32'));})[_0xb31c('0x33')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2606=['query','QueryTypes','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize'];(function(_0x2fc50f,_0xa6100b){var _0x3f242e=function(_0x1aadfd){while(--_0x1aadfd){_0x2fc50f['push'](_0x2fc50f['shift']());}};_0x3f242e(++_0xa6100b);}(_0x2606,0x1c3));var _0x6260=function(_0x4032cd,_0x3d95e5){_0x4032cd=_0x4032cd-0x0;var _0x525fe6=_0x2606[_0x4032cd];return _0x525fe6;};'use strict';var util=require('util');var path=require('path');var _=require('lodash');var csv=require(_0x6260('0x0'));var fs=require('fs');var BPromise=require(_0x6260('0x1'));var zipdir=require('zip-dir');var rimraf=require(_0x6260('0x2'));var db=require(_0x6260('0x3'))['db'];var dbH=require(_0x6260('0x3'))[_0x6260('0x4')];var logger=require(_0x6260('0x5'))(_0x6260('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x6260('0x7')][0x3];var PATH=process[_0x6260('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1de378,_0x2d7761){var _0x147252={'status':_0x1de378};var _0x755343={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d7761){_0x147252[_0x6260('0x8')]=_0x2d7761;}return db[_0x6260('0x9')][_0x6260('0xa')](_0x147252,_0x755343);}function main(){var _0x1a4eab=0x1388;var _0x5d7515;logger['info'](util[_0x6260('0xb')](_0x6260('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x6260('0xd')][_0x6260('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6260('0xf'),_0x6260('0x10')]})[_0x6260('0x11')](function(_0x5189a0){if(_0x5189a0){_0x5d7515=_0x5189a0;_0x1a4eab=_0x5d7515[_0x6260('0x10')]||0x1388;}})[_0x6260('0x11')](function(){return dbH[_0x6260('0x12')][_0x6260('0x13')](util[_0x6260('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x6260('0x14')]['SELECT']});})[_0x6260('0x11')](function(_0x51e622){if(!_0x51e622[0x0][_0x6260('0x15')]){return analyticExtractedReport(_0x6260('0x16'));}var _0x23819d=[];var _0x2e659e=0x0;if(_0x5d7515[_0x6260('0xf')]){if(_0x51e622&&_0x51e622[_0x6260('0x17')]){var _0x1de01b=_[_0x6260('0x18')](_0x51e622[0x0][_0x6260('0x15')]/_0x1a4eab);var _0x7cde80=Number[_0x6260('0x19')](_0x51e622[0x0]['num']/_0x1a4eab)?_0x51e622[0x0][_0x6260('0x15')]%_0x1a4eab:0x0;_0x1de01b[_0x6260('0x1a')](function(_0x26d29){if(_0x26d29>0x0){_0x2e659e+=_0x1a4eab;}_0x23819d[_0x6260('0x1b')](dbH[_0x6260('0x12')][_0x6260('0x13')](util[_0x6260('0xb')](_0x6260('0x1c'),QUERY,_0x1a4eab,_0x2e659e),{'type':dbH[_0x6260('0x12')][_0x6260('0x14')]['SELECT']}));});if(_0x7cde80>0x0){_0x2e659e+=_0x1a4eab;_0x23819d[_0x6260('0x1b')](dbH[_0x6260('0x12')][_0x6260('0x13')](util[_0x6260('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x7cde80,_0x2e659e),{'type':dbH[_0x6260('0x12')][_0x6260('0x14')][_0x6260('0x1d')]}));}}}else{_0x23819d[_0x6260('0x1b')](dbH[_0x6260('0x12')][_0x6260('0x13')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x6260('0x1d')]}));}var _0x18bb03=path[_0x6260('0x1e')](PATH);var _0x4c4d21=path['basename'](PATH,'.csv');var _0x1fa6bb=_0x5d7515['split']&&_0x23819d['length']>0x1;var _0x365e05=[];if(!fs[_0x6260('0x1f')](path['join'](_0x18bb03,_0x4c4d21))&&_0x1fa6bb){fs[_0x6260('0x20')](path[_0x6260('0x21')](_0x18bb03,_0x4c4d21));}return BPromise[_0x6260('0x22')](_0x23819d,function(_0x259ec9){_0x365e05[_0x6260('0x1b')](_0x259ec9);})[_0x6260('0x11')](function(){for(var _0x11d26f=0x0;_0x11d26f<_0x365e05[_0x6260('0x17')];_0x11d26f+=0x1){var _0xbd207c;var _0x54a9c5=_0x365e05[_0x11d26f];if(_0x1fa6bb){_0xbd207c=path[_0x6260('0x21')](_0x18bb03,_0x4c4d21,util[_0x6260('0xb')](_0x6260('0x23'),_0x4c4d21,_0x11d26f,_0x6260('0x24')));}else{_0xbd207c=path['join'](_0x18bb03,util[_0x6260('0xb')](_0x6260('0x25'),_0x4c4d21,_0x6260('0x24')));}fs['writeFileSync'](_0xbd207c,csv(_0x54a9c5));}})['then'](function(){if(_0x1fa6bb){return new Promise(function(_0x548c8b){zipdir(path[_0x6260('0x21')](_0x18bb03,_0x4c4d21),{'saveTo':path['join'](_0x18bb03,util[_0x6260('0xb')](_0x6260('0x25'),_0x4c4d21,_0x6260('0x26')))},function(_0x383119,_0x54c8ee){rimraf(path[_0x6260('0x21')](_0x18bb03,_0x4c4d21),function(){});_0x548c8b(_0x6260('0x27'));});});}})[_0x6260('0x11')](function(){logger[_0x6260('0x28')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x6260('0x29')));return analyticExtractedReport('Completed',_0x1fa6bb?util[_0x6260('0xb')](_0x6260('0x25'),_0x4c4d21,_0x1fa6bb?_0x6260('0x26'):_0x6260('0x24')):null);});})[_0x6260('0x2a')](function(_0x2c6ff5){logger[_0x6260('0x28')](util[_0x6260('0xb')](_0x6260('0x2b'),EXTRACTED_REPORT_ID,_0x6260('0x29')),util[_0x6260('0x2c')](_0x2c6ff5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6260('0x2d'));})[_0x6260('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index cd09495..b7b62b6 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 _0x789e=['channel','YYYY-MM-DD','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','tableHeader','map','toString','value','length','auto','body','push','concat','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','pageBreak','margin','landscape','Arial','black','right','num','Empty','Setting','split','splitSizePdf','then','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','join','each','flatten','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','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-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf'];(function(_0x1469b8,_0x441d7f){var _0x40380e=function(_0x5d5c4e){while(--_0x5d5c4e){_0x1469b8['push'](_0x1469b8['shift']());}};_0x40380e(++_0x441d7f);}(_0x789e,0x1c1));var _0xe789=function(_0x5032c8,_0x7fc968){_0x5032c8=_0x5032c8-0x0;var _0x29452f=_0x789e[_0x5032c8];return _0x29452f;};'use strict';var _=require(_0xe789('0x0'));var fs=require('fs');var util=require(_0xe789('0x1'));var path=require(_0xe789('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xe789('0x3'));var zipdir=require(_0xe789('0x4'));var rimraf=require(_0xe789('0x5'));var JSDOM=require(_0xe789('0x6'))[_0xe789('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0xe789('0x8'));var db=require(_0xe789('0x9'))['db'];var dbH=require(_0xe789('0x9'))[_0xe789('0xa')];var logger=require(_0xe789('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe789('0xc')][0x2]);var QUERY=process[_0xe789('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xe789('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x19aeac,_0x3ae771){var _0x5a91ca={'status':_0x19aeac};var _0x149409={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ae771){_0x5a91ca[_0xe789('0xe')]=_0x3ae771;}return db['AnalyticExtractedReport']['update'](_0x5a91ca,_0x149409);}function getHeaders(_0x50ef11){return _['map'](_0x50ef11,function(_0x276020){return{'text':_0x276020,'style':_0xe789('0xf')};});}function getRows(_0x450d3a,_0x3847d3){return _['map'](_0x3847d3,function(_0x21589a){return _(_0x21589a)['pick'](_0x450d3a)[_0xe789('0x10')](function(_0x4b0e56){return _0x4b0e56?_[_0xe789('0x11')](_0x4b0e56):'';})[_0xe789('0x12')]();});}function createTable(_0x2760d0,_0x2e4e6f){var _0x3aa0b9={'widths':_['fill'](Array(_0x2760d0[_0xe789('0x13')]),0x91),'heights':function(_0x703739){return _0x703739===0x0?_0xe789('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4d53e0=getHeaders(_0x2760d0);_0x3aa0b9[_0xe789('0x15')][_0xe789('0x16')](_0x4d53e0);var _0x291b28=getRows(_0x2760d0,_0x2e4e6f);_0x3aa0b9[_0xe789('0x15')]=_0x3aa0b9[_0xe789('0x15')][_0xe789('0x17')](_0x291b28);return _0x3aa0b9;}function createTables(_0xdef171){var _0x3075c0=[];var _0x582df4=_['chunk'](Object[_0xe789('0x18')](_0xdef171[0x0]),0x5);_0x582df4[_0xe789('0x19')](function(_0x2afe55){_0x3075c0[_0xe789('0x16')](createTable(_0x2afe55,_0xdef171));});return _0x3075c0;}function getPDFDocDefinition(_0x68cd49){var _0x92d39c=util['format'](_0xe789('0x1a'),NAME,EXTRACTED_REPORT[_0xe789('0x1b')],moment(EXTRACTED_REPORT[_0xe789('0x1c')])[_0xe789('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xe789('0x1e')])[_0xe789('0x1d')](FORMAT));var _0x5719b9=[];for(var _0x3e3e60=0x0;_0x3e3e60<_0x68cd49[_0xe789('0x13')];_0x3e3e60++){var _0x168f13=[];if(_0x3e3e60===0x0){_0x168f13[_0xe789('0x16')]({'text':_0x92d39c,'style':_0xe789('0x1f')});}var _0x2a3970={'table':_0x68cd49[_0x3e3e60]};if(_0x3e3e60>0x0){_0x2a3970[_0xe789('0x20')]='before';_0x2a3970[_0xe789('0x21')]=[0x0,0x46,0x0,0x0];}_0x168f13['push'](_0x2a3970);_0x5719b9['push'](_0x168f13);}return{'pageSize':'A4','pageOrientation':_0xe789('0x22'),'content':_0x5719b9,'footer':function(_0x5d8e46,_0x2b0163){return{'text':_0x5d8e46['toString']()+'\x20/\x20'+_0x2b0163,'style':'footer'};},'defaultStyle':{'font':_0xe789('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe789('0x24')},'footer':{'alignment':_0xe789('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ae709){var _0x11675c=0x1388;var _0x2c89f6;if(!_0x2ae709[0x0][_0xe789('0x26')]){return analyticExtractedReport(_0xe789('0x27'));}return db[_0xe789('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe789('0x29'),_0xe789('0x2a')]})[_0xe789('0x2b')](function(_0x5f4698){if(_0x5f4698){_0x2c89f6=_0x5f4698;_0x11675c=_0x2c89f6[_0xe789('0x2a')]||0x3e8;}})[_0xe789('0x2b')](function(){var _0x5e5ab6=[];var _0x1d0792=0x0;if(_0x2c89f6['split']){if(_0x2ae709&&_0x2ae709[_0xe789('0x13')]){var _0x4032f1=_[_0xe789('0x2c')](_0x2ae709[0x0]['num']/_0x11675c);var _0x1a9cc8=Number['isInteger'](_0x2ae709[0x0][_0xe789('0x26')]/_0x11675c)?_0x2ae709[0x0][_0xe789('0x26')]%_0x11675c:0x0;_0x4032f1['forEach'](function(_0x3c109a){if(_0x3c109a>0x0){_0x1d0792+=_0x11675c;}_0x5e5ab6[_0xe789('0x16')](dbH[_0xe789('0x2d')][_0xe789('0x2e')](util[_0xe789('0x1d')](_0xe789('0x2f'),QUERY,_0x11675c,_0x1d0792),{'type':dbH[_0xe789('0x2d')]['QueryTypes']['SELECT']}));});if(_0x1a9cc8>0x0){_0x1d0792+=_0x11675c;_0x5e5ab6[_0xe789('0x16')](dbH[_0xe789('0x2d')]['query'](util[_0xe789('0x1d')](_0xe789('0x2f'),QUERY,_0x1a9cc8,_0x1d0792),{'type':dbH[_0xe789('0x2d')][_0xe789('0x30')][_0xe789('0x31')]}));}}}else{_0x5e5ab6['push'](dbH[_0xe789('0x2d')]['query'](QUERY,{'type':dbH['sequelize'][_0xe789('0x30')]['SELECT']}));}var _0x556607=path['dirname'](PATH);var _0x109997=path[_0xe789('0x32')](PATH,_0xe789('0x33'));var _0xa24a83=_0x2c89f6[_0xe789('0x29')]&&_0x5e5ab6[_0xe789('0x13')]>0x1;var _0x381ffb=[];if(!fs[_0xe789('0x34')](path[_0xe789('0x35')](_0x556607,_0x109997))&&_0xa24a83){fs['mkdirSync'](path['join'](_0x556607,_0x109997));}return BPromise[_0xe789('0x36')](_0x5e5ab6,function(_0x1c5842){_0x381ffb['push'](_0x1c5842);})[_0xe789('0x2b')](function(){var _0x2bdca8=[];for(var _0x18ad94=0x0;_0x18ad94<_0x381ffb['length'];_0x18ad94+=0x1){var _0x32fc37=_0x381ffb[_0x18ad94];var _0x71e7ba=createTables(_[_0xe789('0x37')](_0x32fc37));var _0x3cd722;var _0x4d88fe=getPDFDocDefinition(_0x71e7ba);var _0x321395=getPDFPrinter();var _0x44be80=_0x321395['createPdfKitDocument'](_0x4d88fe);if(_0xa24a83){_0x3cd722=path['join'](_0x556607,_0x109997,util[_0xe789('0x1d')](_0xe789('0x38'),_0x109997,_0x18ad94,_0xe789('0x39')));}else{_0x3cd722=path[_0xe789('0x35')](_0x556607,util['format'](_0xe789('0x3a'),_0x109997,_0xe789('0x39')));}_0x2bdca8[_0xe789('0x16')](writePDFDocument(_0x44be80,_0x3cd722));}return Promise['all'](_0x2bdca8);})[_0xe789('0x2b')](function(){if(_0xa24a83){return new Promise(function(_0x39d6e2){zipdir(path['join'](_0x556607,_0x109997),{'saveTo':path[_0xe789('0x35')](_0x556607,util[_0xe789('0x1d')](_0xe789('0x3a'),_0x109997,_0xe789('0x3b')))},function(){rimraf(path['join'](_0x556607,_0x109997),function(){});_0x39d6e2(_0xe789('0x3c'));});});}})[_0xe789('0x2b')](function(){if(!_0xa24a83)return;rimraf(path[_0xe789('0x35')](_0x556607,_0x109997),function(){});})[_0xe789('0x2b')](function(){logger[_0xe789('0x3d')](util[_0xe789('0x1d')](_0xe789('0x3e'),EXTRACTED_REPORT_ID,_0xe789('0x3f')));return analyticExtractedReport(_0xe789('0x40'),_0xa24a83?util[_0xe789('0x1d')](_0xe789('0x3a'),_0x109997,_0xa24a83?_0xe789('0x3b'):_0xe789('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe789('0x3d')](util[_0xe789('0x1d')](_0xe789('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xe789('0x42')][_0xe789('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x151f7a){EXTRACTED_REPORT=_0x151f7a;return dbH[_0xe789('0x2d')][_0xe789('0x2e')](util[_0xe789('0x1d')](_0xe789('0x44'),QUERY),{'type':dbH[_0xe789('0x2d')][_0xe789('0x30')][_0xe789('0x31')]});})[_0xe789('0x2b')](extractReport)[_0xe789('0x45')](function(_0x1a46d8){logger['info'](util[_0xe789('0x1d')](_0xe789('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0xe789('0x47')](_0x1a46d8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe789('0x48'));})[_0xe789('0x49')](function(){process[_0xe789('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x143046=new PdfPrinter({'Arial':{'normal':__dirname+_0xe789('0x4b'),'bold':__dirname+_0xe789('0x4c'),'italics':__dirname+_0xe789('0x4d'),'bolditalics':__dirname+_0xe789('0x4e')}});return _0x143046;}function getPDFDocDefinitionFromHTML(_0x4adeab,_0x4a37e4){var _0x21e825=util[_0xe789('0x1d')]('%s\x20#%d',_0x4a37e4[_0xe789('0x4f')],_0x4a37e4['interactionId']);var _0x5d972a=moment()[_0xe789('0x1d')](_0xe789('0x50'))[_0xe789('0x11')]();var _0x17cc3b=htmlToPdfmake(_0x4adeab,{'window':window,'tableAutoSize':!![]});return{'content':[_0x17cc3b],'defaultStyle':{'font':_0xe789('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','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':'center'}},'header':function(){return[{'text':_0xe789('0x51'),'style':_0xe789('0x1f')}];},'footer':function(_0x2be195,_0x4d3e1d){return[{'text':util['format'](_0xe789('0x52'),_0x21e825,_0x2be195,_0x4d3e1d,_0x5d972a),'style':'footer'}];}};}function writePDFDocument(_0x4ebfda,_0x1c786e){return new Promise(function(_0x2bcda4,_0xd55fc1){var _0x183feb=_0x4ebfda[_0xe789('0x53')](fs['createWriteStream'](_0x1c786e));_0x183feb['on'](_0xe789('0x54'),function(){_0x2bcda4('finish');});_0x183feb['on'](_0xe789('0x55'),function(_0x1a19db){_0xd55fc1(_0x1a19db);});_0x4ebfda[_0xe789('0x56')]();});}exports[_0xe789('0x57')]=function(_0x4500bc,_0x23557d){var _0x5ff8a8=getPDFPrinter();var _0x2d3984=getPDFDocDefinitionFromHTML(_0x4500bc,_0x23557d);var _0x38afb7=_0x5ff8a8['createPdfKitDocument'](_0x2d3984);return writePDFDocument(_0x38afb7,_0x23557d[_0xe789('0x2')])[_0xe789('0x45')](function(_0x254c92){throw _0x254c92;});}; \ No newline at end of file +var _0x9883=['join','each','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfKitDocument','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','value','fill','length','body','push','concat','chunk','forEach','format','name','startDate','header','pageBreak','before','margin','toString','footer','Arial','black','num','Empty','find','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','QueryTypes','.pdf'];(function(_0x58d52d,_0x5ca0b5){var _0x5094f8=function(_0x26f372){while(--_0x26f372){_0x58d52d['push'](_0x58d52d['shift']());}};_0x5094f8(++_0x5ca0b5);}(_0x9883,0xd0));var _0x3988=function(_0x2b4123,_0x49259a){_0x2b4123=_0x2b4123-0x0;var _0xd5f826=_0x9883[_0x2b4123];return _0xd5f826;};'use strict';var _=require(_0x3988('0x0'));var fs=require('fs');var util=require(_0x3988('0x1'));var path=require('path');var moment=require(_0x3988('0x2'));var htmlToPdfmake=require(_0x3988('0x3'));var PdfPrinter=require(_0x3988('0x4'));var zipdir=require(_0x3988('0x5'));var rimraf=require(_0x3988('0x6'));var JSDOM=require(_0x3988('0x7'))[_0x3988('0x8')];var window=new JSDOM('')[_0x3988('0x9')];var BPromise=require(_0x3988('0xa'));var db=require(_0x3988('0xb'))['db'];var dbH=require('../../mysqldb')[_0x3988('0xc')];var logger=require('../../config/logger')(_0x3988('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x3988('0xe')][0x2]);var QUERY=process[_0x3988('0xe')][0x3];var PATH=process[_0x3988('0xe')][0x4];var NAME=process[_0x3988('0xe')][0x5];var FORMAT=_0x3988('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x408b5c,_0x110028){var _0x2b43e8={'status':_0x408b5c};var _0x41dc46={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x110028){_0x2b43e8[_0x3988('0x10')]=_0x110028;}return db['AnalyticExtractedReport'][_0x3988('0x11')](_0x2b43e8,_0x41dc46);}function getHeaders(_0x25cebd){return _[_0x3988('0x12')](_0x25cebd,function(_0x100fba){return{'text':_0x100fba,'style':_0x3988('0x13')};});}function getRows(_0x832708,_0x297663){return _['map'](_0x297663,function(_0x3a4811){return _(_0x3a4811)['pick'](_0x832708)[_0x3988('0x12')](function(_0x139719){return _0x139719?_['toString'](_0x139719):'';})[_0x3988('0x14')]();});}function createTable(_0x3cb15d,_0x2c680b){var _0x2863c7={'widths':_[_0x3988('0x15')](Array(_0x3cb15d[_0x3988('0x16')]),0x91),'heights':function(_0x4acc72){return _0x4acc72===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4f5228=getHeaders(_0x3cb15d);_0x2863c7[_0x3988('0x17')][_0x3988('0x18')](_0x4f5228);var _0xd06294=getRows(_0x3cb15d,_0x2c680b);_0x2863c7[_0x3988('0x17')]=_0x2863c7[_0x3988('0x17')][_0x3988('0x19')](_0xd06294);return _0x2863c7;}function createTables(_0x5b990e){var _0x2d6014=[];var _0x9543b9=_[_0x3988('0x1a')](Object['keys'](_0x5b990e[0x0]),0x5);_0x9543b9[_0x3988('0x1b')](function(_0x59355c){_0x2d6014[_0x3988('0x18')](createTable(_0x59355c,_0x5b990e));});return _0x2d6014;}function getPDFDocDefinition(_0x4384c5){var _0x49dee9=util[_0x3988('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x3988('0x1d')],moment(EXTRACTED_REPORT[_0x3988('0x1e')])[_0x3988('0x1c')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x483397=[];for(var _0x504f37=0x0;_0x504f37<_0x4384c5[_0x3988('0x16')];_0x504f37++){var _0x2aad09=[];if(_0x504f37===0x0){_0x2aad09[_0x3988('0x18')]({'text':_0x49dee9,'style':_0x3988('0x1f')});}var _0x41e574={'table':_0x4384c5[_0x504f37]};if(_0x504f37>0x0){_0x41e574[_0x3988('0x20')]=_0x3988('0x21');_0x41e574[_0x3988('0x22')]=[0x0,0x46,0x0,0x0];}_0x2aad09[_0x3988('0x18')](_0x41e574);_0x483397[_0x3988('0x18')](_0x2aad09);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x483397,'footer':function(_0x3c3d3b,_0x453d7f){return{'text':_0x3c3d3b[_0x3988('0x23')]()+'\x20/\x20'+_0x453d7f,'style':_0x3988('0x24')};},'defaultStyle':{'font':_0x3988('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3988('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4e4a7a){var _0x4e6980=0x1388;var _0x17a140;if(!_0x4e4a7a[0x0][_0x3988('0x27')]){return analyticExtractedReport(_0x3988('0x28'));}return db['Setting'][_0x3988('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3988('0x2a'),_0x3988('0x2b')]})[_0x3988('0x2c')](function(_0x47ec08){if(_0x47ec08){_0x17a140=_0x47ec08;_0x4e6980=_0x17a140['splitSizePdf']||0x3e8;}})[_0x3988('0x2c')](function(){var _0x1473bb=[];var _0x4aa03f=0x0;if(_0x17a140['split']){if(_0x4e4a7a&&_0x4e4a7a[_0x3988('0x16')]){var _0x28dc43=_[_0x3988('0x2d')](_0x4e4a7a[0x0][_0x3988('0x27')]/_0x4e6980);var _0x285723=Number[_0x3988('0x2e')](_0x4e4a7a[0x0][_0x3988('0x27')]/_0x4e6980)?_0x4e4a7a[0x0][_0x3988('0x27')]%_0x4e6980:0x0;_0x28dc43['forEach'](function(_0x2c2fb1){if(_0x2c2fb1>0x0){_0x4aa03f+=_0x4e6980;}_0x1473bb['push'](dbH['sequelize'][_0x3988('0x2f')](util[_0x3988('0x1c')](_0x3988('0x30'),QUERY,_0x4e6980,_0x4aa03f),{'type':dbH[_0x3988('0x31')]['QueryTypes'][_0x3988('0x32')]}));});if(_0x285723>0x0){_0x4aa03f+=_0x4e6980;_0x1473bb[_0x3988('0x18')](dbH[_0x3988('0x31')][_0x3988('0x2f')](util[_0x3988('0x1c')](_0x3988('0x30'),QUERY,_0x285723,_0x4aa03f),{'type':dbH[_0x3988('0x31')]['QueryTypes']['SELECT']}));}}}else{_0x1473bb[_0x3988('0x18')](dbH[_0x3988('0x31')][_0x3988('0x2f')](QUERY,{'type':dbH[_0x3988('0x31')][_0x3988('0x33')]['SELECT']}));}var _0x20824c=path['dirname'](PATH);var _0x129e0f=path['basename'](PATH,_0x3988('0x34'));var _0x395f02=_0x17a140[_0x3988('0x2a')]&&_0x1473bb['length']>0x1;var _0x3e7976=[];if(!fs['existsSync'](path[_0x3988('0x35')](_0x20824c,_0x129e0f))&&_0x395f02){fs['mkdirSync'](path[_0x3988('0x35')](_0x20824c,_0x129e0f));}return BPromise[_0x3988('0x36')](_0x1473bb,function(_0x8d5333){_0x3e7976[_0x3988('0x18')](_0x8d5333);})['then'](function(){var _0x17552f=[];for(var _0x1bcc4c=0x0;_0x1bcc4c<_0x3e7976[_0x3988('0x16')];_0x1bcc4c+=0x1){var _0x2851d5=_0x3e7976[_0x1bcc4c];var _0x34aaa9=createTables(_['flatten'](_0x2851d5));var _0x55e7c0;var _0x18bfb3=getPDFDocDefinition(_0x34aaa9);var _0xe9c70d=getPDFPrinter();var _0x24080b=_0xe9c70d['createPdfKitDocument'](_0x18bfb3);if(_0x395f02){_0x55e7c0=path[_0x3988('0x35')](_0x20824c,_0x129e0f,util['format'](_0x3988('0x37'),_0x129e0f,_0x1bcc4c,_0x3988('0x38')));}else{_0x55e7c0=path[_0x3988('0x35')](_0x20824c,util[_0x3988('0x1c')](_0x3988('0x39'),_0x129e0f,_0x3988('0x38')));}_0x17552f[_0x3988('0x18')](writePDFDocument(_0x24080b,_0x55e7c0));}return Promise[_0x3988('0x3a')](_0x17552f);})[_0x3988('0x2c')](function(){if(_0x395f02){return new Promise(function(_0x46ec89){zipdir(path[_0x3988('0x35')](_0x20824c,_0x129e0f),{'saveTo':path[_0x3988('0x35')](_0x20824c,util[_0x3988('0x1c')]('%s.%s',_0x129e0f,_0x3988('0x3b')))},function(){rimraf(path['join'](_0x20824c,_0x129e0f),function(){});_0x46ec89('zip\x20finished');});});}})[_0x3988('0x2c')](function(){if(!_0x395f02)return;rimraf(path[_0x3988('0x35')](_0x20824c,_0x129e0f),function(){});})[_0x3988('0x2c')](function(){logger[_0x3988('0x3c')](util[_0x3988('0x1c')](_0x3988('0x3d'),EXTRACTED_REPORT_ID,_0x3988('0x3e')));return analyticExtractedReport(_0x3988('0x3f'),_0x395f02?util[_0x3988('0x1c')](_0x3988('0x39'),_0x129e0f,_0x395f02?_0x3988('0x3b'):_0x3988('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3988('0x3c')](util[_0x3988('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3988('0x3e')));return db[_0x3988('0x40')][_0x3988('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3988('0x2c')](function(_0x1fc656){EXTRACTED_REPORT=_0x1fc656;return dbH[_0x3988('0x31')][_0x3988('0x2f')](util[_0x3988('0x1c')](_0x3988('0x42'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x3988('0x32')]});})[_0x3988('0x2c')](extractReport)[_0x3988('0x43')](function(_0x53ec73){logger['info'](util['format'](_0x3988('0x44'),EXTRACTED_REPORT_ID,'PDF'),util[_0x3988('0x45')](_0x53ec73,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3988('0x46'));})[_0x3988('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5dc608=new PdfPrinter({'Arial':{'normal':__dirname+_0x3988('0x48'),'bold':__dirname+_0x3988('0x49'),'italics':__dirname+_0x3988('0x4a'),'bolditalics':__dirname+_0x3988('0x4b')}});return _0x5dc608;}function getPDFDocDefinitionFromHTML(_0x5d7ad4,_0x172d59){var _0x47cdaa=util['format']('%s\x20#%d',_0x172d59['channel'],_0x172d59[_0x3988('0x4c')]);var _0x6b0808=moment()[_0x3988('0x1c')](_0x3988('0x4d'))[_0x3988('0x23')]();var _0x395b49=htmlToPdfmake(_0x5d7ad4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x395b49],'defaultStyle':{'font':_0x3988('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3988('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3988('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3988('0x4e')}},'header':function(){return[{'text':_0x3988('0x4f'),'style':_0x3988('0x1f')}];},'footer':function(_0x318a79,_0x28d3d2){return[{'text':util[_0x3988('0x1c')](_0x3988('0x50'),_0x47cdaa,_0x318a79,_0x28d3d2,_0x6b0808),'style':_0x3988('0x24')}];}};}function writePDFDocument(_0x5e1f6a,_0x19a946){return new Promise(function(_0x17fbe8,_0x1d40e1){var _0x5def06=_0x5e1f6a[_0x3988('0x51')](fs[_0x3988('0x52')](_0x19a946));_0x5def06['on']('finish',function(){_0x17fbe8(_0x3988('0x53'));});_0x5def06['on'](_0x3988('0x54'),function(_0x40212c){_0x1d40e1(_0x40212c);});_0x5e1f6a[_0x3988('0x55')]();});}exports['createPdfFromHTML']=function(_0x28f991,_0x4959ca){var _0x49dc67=getPDFPrinter();var _0x2de47f=getPDFDocDefinitionFromHTML(_0x28f991,_0x4959ca);var _0x2d775c=_0x49dc67[_0x3988('0x56')](_0x2de47f);return writePDFDocument(_0x2d775c,_0x4959ca['path'])[_0x3988('0x43')](function(_0x52e71f){throw _0x52e71f;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4491211..246ddc3 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 _0x5b92=['split','splitSizeXlsx','then','query','QueryTypes','num','Empty','length','range','isInteger','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Failed','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5b92,0x1a0));var _0x25b9=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x5b92[_0x23e7c1];return _0x1add43;};'use strict';var util=require(_0x25b9('0x0'));var path=require(_0x25b9('0x1'));var _=require(_0x25b9('0x2'));var fs=require('fs');var json2xls=require(_0x25b9('0x3'));var BPromise=require(_0x25b9('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x25b9('0x5'));var db=require(_0x25b9('0x6'))['db'];var dbH=require('../../mysqldb')[_0x25b9('0x7')];var logger=require(_0x25b9('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x25b9('0x9')][0x2]);var QUERY=process[_0x25b9('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3e4833,_0x148570){var _0xbea936={'status':_0x3e4833};var _0x452b97={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x148570){_0xbea936[_0x25b9('0xa')]=_0x148570;}return db[_0x25b9('0xb')]['update'](_0xbea936,_0x452b97);}function main(){var _0x841ebe=0x1388;var _0x208cef;logger[_0x25b9('0xc')](util[_0x25b9('0xd')](_0x25b9('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x25b9('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x25b9('0x10'),_0x25b9('0x11')]})[_0x25b9('0x12')](function(_0x158b60){if(_0x158b60){_0x208cef=_0x158b60;_0x841ebe=_0x208cef[_0x25b9('0x11')]||0x1388;}})[_0x25b9('0x12')](function(){return dbH['sequelize'][_0x25b9('0x13')](util[_0x25b9('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x25b9('0x14')]['SELECT']});})['then'](function(_0x3ca9fe){if(!_0x3ca9fe[0x0][_0x25b9('0x15')]){return analyticExtractedReport(_0x25b9('0x16'));}var _0x26758d=[];var _0x3f4f4e=0x0;if(_0x208cef[_0x25b9('0x10')]){if(_0x3ca9fe&&_0x3ca9fe[_0x25b9('0x17')]){var _0x32205b=_[_0x25b9('0x18')](_0x3ca9fe[0x0][_0x25b9('0x15')]/_0x841ebe);var _0x3e3591=Number[_0x25b9('0x19')](_0x3ca9fe[0x0][_0x25b9('0x15')]/_0x841ebe)?_0x3ca9fe[0x0][_0x25b9('0x15')]%_0x841ebe:0x0;_0x32205b['forEach'](function(_0x4d35c2){if(_0x4d35c2>0x0){_0x3f4f4e+=_0x841ebe;}_0x26758d[_0x25b9('0x1a')](dbH[_0x25b9('0x1b')]['query'](util[_0x25b9('0xd')](_0x25b9('0x1c'),QUERY,_0x841ebe,_0x3f4f4e),{'type':dbH[_0x25b9('0x1b')]['QueryTypes']['SELECT']}));});if(_0x3e3591>0x0){_0x3f4f4e+=_0x841ebe;_0x26758d['push'](dbH['sequelize']['query'](util['format'](_0x25b9('0x1c'),QUERY,_0x3e3591,_0x3f4f4e),{'type':dbH[_0x25b9('0x1b')][_0x25b9('0x14')][_0x25b9('0x1d')]}));}}}else{_0x26758d[_0x25b9('0x1a')](dbH[_0x25b9('0x1b')][_0x25b9('0x13')](QUERY,{'type':dbH[_0x25b9('0x1b')][_0x25b9('0x14')][_0x25b9('0x1d')]}));}var _0x35a76c=path[_0x25b9('0x1e')](PATH);var _0x326000=path[_0x25b9('0x1f')](PATH,_0x25b9('0x20'));var _0x42628=_0x208cef[_0x25b9('0x10')]&&_0x26758d[_0x25b9('0x17')]>0x1;var _0x51d7c5=[];if(!fs[_0x25b9('0x21')](path[_0x25b9('0x22')](_0x35a76c,_0x326000))&&_0x42628){fs[_0x25b9('0x23')](path[_0x25b9('0x22')](_0x35a76c,_0x326000));}return BPromise[_0x25b9('0x24')](_0x26758d,function(_0x222470){_0x51d7c5[_0x25b9('0x1a')](_0x222470);})[_0x25b9('0x12')](function(){for(var _0x485b6c=0x0;_0x485b6c<_0x51d7c5['length'];_0x485b6c+=0x1){var _0x1ba165;var _0x5ea190=_0x51d7c5[_0x485b6c];if(_0x42628){_0x1ba165=path['join'](_0x35a76c,_0x326000,util['format'](_0x25b9('0x25'),_0x326000,_0x485b6c,_0x25b9('0x26')));}else{_0x1ba165=path[_0x25b9('0x22')](_0x35a76c,util[_0x25b9('0xd')](_0x25b9('0x27'),_0x326000,'xlsx'));}fs[_0x25b9('0x28')](_0x1ba165,json2xls(_0x5ea190),_0x25b9('0x29'));}})[_0x25b9('0x12')](function(){if(_0x42628){return new Promise(function(_0x250b7c){zipdir(path[_0x25b9('0x22')](_0x35a76c,_0x326000),{'saveTo':path[_0x25b9('0x22')](_0x35a76c,util[_0x25b9('0xd')](_0x25b9('0x27'),_0x326000,_0x25b9('0x2a')))},function(_0x364209,_0x4adb8e){rimraf(path['join'](_0x35a76c,_0x326000),function(){});_0x250b7c(_0x25b9('0x2b'));});});}})[_0x25b9('0x12')](function(){logger['info'](util[_0x25b9('0xd')](_0x25b9('0x2c'),EXTRACTED_REPORT_ID,_0x25b9('0x2d')));return analyticExtractedReport('Completed',_0x42628?util['format']('%s.%s',_0x326000,_0x42628?_0x25b9('0x2a'):_0x25b9('0x26')):null);});})[_0x25b9('0x2e')](function(_0x1a5c97){logger[_0x25b9('0xc')](util[_0x25b9('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x25b9('0x2d')),util['inspect'](_0x1a5c97,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x25b9('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4ffe=['format','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','finally','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','range','isInteger','push'];(function(_0x41e663,_0x54a04c){var _0x4ad41f=function(_0x200c99){while(--_0x200c99){_0x41e663['push'](_0x41e663['shift']());}};_0x4ad41f(++_0x54a04c);}(_0x4ffe,0x172));var _0xe4ff=function(_0x571c65,_0x321f37){_0x571c65=_0x571c65-0x0;var _0x563767=_0x4ffe[_0x571c65];return _0x563767;};'use strict';var util=require(_0xe4ff('0x0'));var path=require(_0xe4ff('0x1'));var _=require(_0xe4ff('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xe4ff('0x3'));var zipdir=require(_0xe4ff('0x4'));var rimraf=require(_0xe4ff('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe4ff('0x6'))[_0xe4ff('0x7')];var logger=require(_0xe4ff('0x8'))(_0xe4ff('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe4ff('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe4ff('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x455874,_0x227be1){var _0x2aa67c={'status':_0x455874};var _0x5b9a40={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x227be1){_0x2aa67c[_0xe4ff('0xb')]=_0x227be1;}return db['AnalyticExtractedReport'][_0xe4ff('0xc')](_0x2aa67c,_0x5b9a40);}function main(){var _0x188173=0x1388;var _0x290d4a;logger[_0xe4ff('0xd')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe4ff('0xe')));return db[_0xe4ff('0xf')][_0xe4ff('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe4ff('0x11'),_0xe4ff('0x12')]})[_0xe4ff('0x13')](function(_0x4d6721){if(_0x4d6721){_0x290d4a=_0x4d6721;_0x188173=_0x290d4a[_0xe4ff('0x12')]||0x1388;}})[_0xe4ff('0x13')](function(){return dbH['sequelize'][_0xe4ff('0x14')](util['format'](_0xe4ff('0x15'),QUERY),{'type':dbH[_0xe4ff('0x16')]['QueryTypes'][_0xe4ff('0x17')]});})[_0xe4ff('0x13')](function(_0x1d0664){if(!_0x1d0664[0x0][_0xe4ff('0x18')]){return analyticExtractedReport(_0xe4ff('0x19'));}var _0x416889=[];var _0x4a7ae5=0x0;if(_0x290d4a[_0xe4ff('0x11')]){if(_0x1d0664&&_0x1d0664[_0xe4ff('0x1a')]){var _0x130cef=_[_0xe4ff('0x1b')](_0x1d0664[0x0]['num']/_0x188173);var _0x342bad=Number[_0xe4ff('0x1c')](_0x1d0664[0x0][_0xe4ff('0x18')]/_0x188173)?_0x1d0664[0x0][_0xe4ff('0x18')]%_0x188173:0x0;_0x130cef['forEach'](function(_0x177590){if(_0x177590>0x0){_0x4a7ae5+=_0x188173;}_0x416889[_0xe4ff('0x1d')](dbH[_0xe4ff('0x16')][_0xe4ff('0x14')](util[_0xe4ff('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x188173,_0x4a7ae5),{'type':dbH[_0xe4ff('0x16')][_0xe4ff('0x1f')][_0xe4ff('0x17')]}));});if(_0x342bad>0x0){_0x4a7ae5+=_0x188173;_0x416889[_0xe4ff('0x1d')](dbH[_0xe4ff('0x16')][_0xe4ff('0x14')](util['format'](_0xe4ff('0x20'),QUERY,_0x342bad,_0x4a7ae5),{'type':dbH['sequelize'][_0xe4ff('0x1f')][_0xe4ff('0x17')]}));}}}else{_0x416889['push'](dbH[_0xe4ff('0x16')]['query'](QUERY,{'type':dbH[_0xe4ff('0x16')][_0xe4ff('0x1f')][_0xe4ff('0x17')]}));}var _0x1a0f3c=path[_0xe4ff('0x21')](PATH);var _0xfa00a5=path[_0xe4ff('0x22')](PATH,_0xe4ff('0x23'));var _0x12cd79=_0x290d4a[_0xe4ff('0x11')]&&_0x416889[_0xe4ff('0x1a')]>0x1;var _0x46844e=[];if(!fs['existsSync'](path[_0xe4ff('0x24')](_0x1a0f3c,_0xfa00a5))&&_0x12cd79){fs[_0xe4ff('0x25')](path[_0xe4ff('0x24')](_0x1a0f3c,_0xfa00a5));}return BPromise[_0xe4ff('0x26')](_0x416889,function(_0x320a5c){_0x46844e[_0xe4ff('0x1d')](_0x320a5c);})['then'](function(){for(var _0xb31df7=0x0;_0xb31df7<_0x46844e[_0xe4ff('0x1a')];_0xb31df7+=0x1){var _0x2ec29e;var _0x4a5b4d=_0x46844e[_0xb31df7];if(_0x12cd79){_0x2ec29e=path[_0xe4ff('0x24')](_0x1a0f3c,_0xfa00a5,util['format'](_0xe4ff('0x27'),_0xfa00a5,_0xb31df7,_0xe4ff('0x28')));}else{_0x2ec29e=path['join'](_0x1a0f3c,util['format'](_0xe4ff('0x29'),_0xfa00a5,_0xe4ff('0x28')));}fs[_0xe4ff('0x2a')](_0x2ec29e,json2xls(_0x4a5b4d),_0xe4ff('0x2b'));}})[_0xe4ff('0x13')](function(){if(_0x12cd79){return new Promise(function(_0x1026b5){zipdir(path[_0xe4ff('0x24')](_0x1a0f3c,_0xfa00a5),{'saveTo':path[_0xe4ff('0x24')](_0x1a0f3c,util['format'](_0xe4ff('0x29'),_0xfa00a5,_0xe4ff('0x2c')))},function(_0x45daee,_0x164dd0){rimraf(path[_0xe4ff('0x24')](_0x1a0f3c,_0xfa00a5),function(){});_0x1026b5('zip\x20finished');});});}})['then'](function(){logger[_0xe4ff('0xd')](util[_0xe4ff('0x1e')](_0xe4ff('0x2d'),EXTRACTED_REPORT_ID,_0xe4ff('0xe')));return analyticExtractedReport(_0xe4ff('0x2e'),_0x12cd79?util['format'](_0xe4ff('0x29'),_0xfa00a5,_0x12cd79?'zip':_0xe4ff('0x28')):null);});})['catch'](function(_0xdbda1b){logger['info'](util[_0xe4ff('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe4ff('0xe')),util[_0xe4ff('0x2f')](_0xdbda1b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe4ff('0x30'));})[_0xe4ff('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 49dd31d..9fd3a99 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 _0x119b=['CAST(priority\x20AS\x20UNSIGNED)','then','filter','groupBy','queue','playback','priority','extensions','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','extension','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','findAll','intervals','VoiceExtension','IntervalId','uniq','map','exten'];(function(_0x6254d1,_0x1271fd){var _0x165358=function(_0x1597f9){while(--_0x1597f9){_0x6254d1['push'](_0x6254d1['shift']());}};_0x165358(++_0x1271fd);}(_0x119b,0x1b8));var _0xb119=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x119b[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xb119('0x0'));var util=require(_0xb119('0x1'));function rewrite(_0x486ce1,_0x2d614e){var _0x44800a=this;return _0x486ce1[_0xb119('0x2')]['Interval'][_0xb119('0x3')]({'raw':!![]})['then'](function(_0x15aefc){_0x44800a[_0xb119('0x4')]=_0x15aefc;return _0x486ce1['models'][_0xb119('0x5')][_0xb119('0x3')]({'where':{'IntervalId':_0x2d614e[_0xb119('0x6')]},'raw':!![]});})['then'](function(_0x30d66a){return _0x486ce1[_0xb119('0x2')]['VoiceExtension'][_0xb119('0x3')]({'where':{'exten':{'$in':_[_0xb119('0x7')](_[_0xb119('0x8')](_0x30d66a,_0xb119('0x9')))}},'order':[{'raw':_0xb119('0xa')}],'raw':!![]});})[_0xb119('0xb')](function(_0x123675){var _0x32bec6=_[_0xb119('0xc')](_0x123675,{'priority':'1'});var _0x3bf9d5=_['filter'](_0x123675,{'isApp':0x1});var _0x142064=_[_0xb119('0xd')](_0x3bf9d5,_0xb119('0x9'));var _0x68a92a=[_0xb119('0xe'),_0xb119('0xf')];var _0x4bbd21=[];var _0x4312a3=[];for(var _0x41aad1 in _0x142064){if(_0x142064['hasOwnProperty'](_0x41aad1)){_0x44800a[_0xb119('0x10')]=0x2;_0x44800a[_0xb119('0x11')]=[];_0x44800a['extension']=_[_0xb119('0x12')](_0x32bec6,{'exten':_0x142064[_0x41aad1][0x0]['exten']});_0x44800a[_0xb119('0x11')][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':util['format'](_0xb119('0x16'),_0x142064[_0x41aad1][0x0][_0xb119('0x14')]),'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a[_0xb119('0x10')]++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});if(_0x142064[_0x41aad1][0x0][_0xb119('0x14')]===_0xb119('0x19')){_0x44800a['extensions'][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0xb119('0x1a')+_0x142064[_0x41aad1][0x0]['VoiceExtensionId'],'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a['priority']++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});}else if(_0x142064[_0x41aad1][0x0][_0xb119('0x14')]===_0xb119('0x1b')){if(_0x44800a['extension']){_0x44800a['extensions']['push']({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0xb119('0x1c')+(_0x44800a[_0xb119('0x1d')]['cutdigits']?_0xb119('0x1e')+_0x44800a[_0xb119('0x1d')][_0xb119('0x1f')]+'}':_0xb119('0x20')),'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a[_0xb119('0x10')]++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});}_0x44800a['extensions'][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x142064[_0x41aad1][0x0]['VoiceExtensionId'],'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a['priority']++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});var _0x3d4642=_0x44800a[_0xb119('0x10')]++;_0x44800a['extensions'][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x21'),'appdata':_0xb119('0x22')+(_0x3d4642+0x2)+_0xb119('0x23')+(_0x3d4642+0x1)+')','context':_0x142064[_0x41aad1][0x0]['context'],'exten':_0x142064[_0x41aad1][0x0]['exten'],'priority':_0x3d4642,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});if(_0x44800a['extension']){_0x44800a[_0xb119('0x11')][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0x44800a[_0xb119('0x1d')][_0xb119('0x1f')]?_0xb119('0x24')+_0x44800a[_0xb119('0x1d')][_0xb119('0x1f')]+'}':_0xb119('0x25'),'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0]['exten'],'priority':_0x44800a[_0xb119('0x10')]++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});}_0x44800a['extensions']['push']({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':'Set','appdata':_0xb119('0x26')+_0x142064[_0x41aad1][0x0]['VoiceExtensionId'],'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a[_0xb119('0x10')]++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});if(_0x44800a[_0xb119('0x1d')]&&_0x44800a[_0xb119('0x1d')][_0xb119('0x27')](_0xb119('0x28'))&&_0x44800a[_0xb119('0x1d')][_0xb119('0x28')]!==_0xb119('0x29')){_0x44800a[_0xb119('0x11')][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x142064[_0x41aad1][0x0]['context'],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a['priority']++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});_0x44800a['extensions'][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0xb119('0x2a')+_0x44800a[_0xb119('0x1d')][_0xb119('0x28')]||_0xb119('0x2b'),'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a[_0xb119('0x10')]++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});}}_0x44800a[_0xb119('0x11')][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0xb119('0x2c'),'context':_0x142064[_0x41aad1][0x0]['context'],'exten':_0x142064[_0x41aad1][0x0]['exten'],'priority':_0x44800a[_0xb119('0x10')]++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0]['VoiceExtensionId']});_0x44800a[_0xb119('0x11')][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a['priority']++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0]['VoiceExtensionId']});_0x44800a[_0xb119('0x11')][_0xb119('0x13')]({'type':_0x142064[_0x41aad1][0x0]['type'],'app':_0xb119('0x15'),'appdata':_0xb119('0x2d'),'context':_0x142064[_0x41aad1][0x0]['context'],'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'priority':_0x44800a['priority']++,'VoiceExtensionId':_0x142064[_0x41aad1][0x0][_0xb119('0x18')]});for(var _0x29b5f7=0x0,_0x14f858=0x0;_0x29b5f7<_0x142064[_0x41aad1][_0xb119('0x2e')];_0x29b5f7+=0x1,_0x14f858=0x0){var _0x35a008=_0x142064[_0x41aad1][_0x29b5f7];if(_0x35a008[_0xb119('0x14')]){_0x35a008[_0xb119('0x14')]=_0x35a008[_0xb119('0x14')][_0xb119('0x2f')]();}var _0x3fb0f9=[];var _0x454125=[];delete _0x35a008['id'];delete _0x35a008[_0xb119('0x30')];delete _0x35a008['updatedAt'];var _0x1e13f6=_0x35a008[_0xb119('0x31')]!=='*,*,*,*'?[_0x35a008[_0xb119('0x31')]]:_0x35a008[_0xb119('0x6')]?_[_0xb119('0x8')](_[_0xb119('0xc')](_0x44800a[_0xb119('0x4')],{'IntervalId':_0x35a008[_0xb119('0x6')]}),_0xb119('0x31')):[];if(_0x35a008[_0xb119('0x27')]('tag')){if(_0x35a008[_0xb119('0x32')]&&_0x35a008['tag']!=='--'){_0x3fb0f9['push']({'type':_0x35a008['type'],'app':_0xb119('0x15'),'appdata':_0xb119('0x33')+_0x35a008['tag'],'context':_0x35a008[_0xb119('0x17')],'exten':_0x35a008[_0xb119('0x9')],'priority':_0x1e13f6['length']+_0x44800a['priority']+_0x14f858++,'VoiceExtensionId':_0x35a008[_0xb119('0x18')]});}}if(_0x35a008[_0xb119('0x14')]===_0xb119('0x1b')&&_0x35a008[_0xb119('0x27')]('callerID')){if(_0x35a008['callerID']){_0x3fb0f9[_0xb119('0x13')]({'type':_0x35a008['type'],'app':_0xb119('0x21'),'appdata':_0xb119('0x34')+_0x35a008[_0xb119('0x35')]+')','context':_0x35a008[_0xb119('0x17')],'exten':_0x35a008[_0xb119('0x9')],'priority':_0x1e13f6[_0xb119('0x2e')]+_0x44800a[_0xb119('0x10')]+_0x14f858++,'VoiceExtensionId':_0x35a008[_0xb119('0x18')]});}else{_0x3fb0f9[_0xb119('0x13')]({'type':_0x35a008[_0xb119('0x14')],'app':_0xb119('0x21'),'appdata':_0xb119('0x36'),'context':_0x35a008[_0xb119('0x17')],'exten':_0x35a008[_0xb119('0x9')],'priority':_0x1e13f6[_0xb119('0x2e')]+_0x44800a[_0xb119('0x10')]+_0x14f858++,'VoiceExtensionId':_0x35a008[_0xb119('0x18')]});}}if(_0x35a008[_0xb119('0x27')]('answer')){if(_0x68a92a[_0xb119('0x37')](_0x35a008[_0xb119('0x38')]['toLowerCase']())>=0x0&&_0x35a008[_0xb119('0x39')]!==_0xb119('0x3a')){if(_0x35a008[_0xb119('0x3b')]){_0x3fb0f9[_0xb119('0x13')]({'type':_0x35a008[_0xb119('0x14')],'app':'ExecIf','appdata':_0xb119('0x3c'),'context':_0x35a008[_0xb119('0x17')],'exten':_0x35a008[_0xb119('0x9')],'priority':_0x1e13f6[_0xb119('0x2e')]+_0x44800a[_0xb119('0x10')]+_0x14f858++,'VoiceExtensionId':_0x35a008[_0xb119('0x18')]});_0x3fb0f9['push']({'type':_0x35a008[_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0xb119('0x3d'),'context':_0x35a008[_0xb119('0x17')],'exten':_0x35a008[_0xb119('0x9')],'priority':_0x1e13f6[_0xb119('0x2e')]+_0x44800a['priority']+_0x14f858++,'VoiceExtensionId':_0x35a008['VoiceExtensionId']});}else{_0x3fb0f9[_0xb119('0x13')]({'type':_0x35a008[_0xb119('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x35a008[_0xb119('0x17')],'exten':_0x35a008['exten'],'priority':_0x1e13f6[_0xb119('0x2e')]+_0x44800a['priority']+_0x14f858++,'VoiceExtensionId':_0x35a008['VoiceExtensionId']});_0x3fb0f9[_0xb119('0x13')]({'type':_0x35a008[_0xb119('0x14')],'app':_0xb119('0x15'),'appdata':_0xb119('0x3e'),'context':_0x35a008['context'],'exten':_0x35a008[_0xb119('0x9')],'priority':_0x1e13f6['length']+_0x44800a[_0xb119('0x10')]+_0x14f858++,'VoiceExtensionId':_0x35a008[_0xb119('0x18')]});}}}for(var _0x980420=0x0;_0x980420<_0x1e13f6[_0xb119('0x2e')];_0x980420+=0x1){var _0x8296bf=_0x44800a['priority']+_0x1e13f6['length'];var _0x2a6d80=_0x980420===_0x1e13f6['length']-0x1?_0x44800a[_0xb119('0x10')]+_0x3fb0f9[_0xb119('0x2e')]+_0x454125[_0xb119('0x2e')]+0x2:_0x44800a[_0xb119('0x10')]+_0x980420+0x1;_0x3fb0f9[_0xb119('0x3f')](_0x980420,0x0,{'type':_0x35a008[_0xb119('0x14')],'app':_0xb119('0x40'),'appdata':_0x1e13f6[_0x980420]+'?'+_0x35a008[_0xb119('0x17')]+_0xb119('0x41')+_0x8296bf+':'+_0x35a008[_0xb119('0x17')]+_0xb119('0x41')+_0x2a6d80,'exten':_0x35a008[_0xb119('0x9')],'context':_0x35a008[_0xb119('0x17')],'priority':_0x44800a[_0xb119('0x10')]+_0x980420,'VoiceExtensionId':_0x142064[_0x41aad1][0x0]['VoiceExtensionId']});}_0x35a008[_0xb119('0x10')]=_0x3fb0f9['length']?_[_0xb119('0x42')](_0x3fb0f9)[_0xb119('0x10')]+0x1:_0x44800a[_0xb119('0x10')];_0x44800a['priority']=(_0x454125[_0xb119('0x2e')]?_[_0xb119('0x42')](_0x454125)['priority']:_0x35a008[_0xb119('0x10')])+0x1;_0x44800a[_0xb119('0x11')]=_[_0xb119('0x43')](_0x44800a[_0xb119('0x11')],_0x3fb0f9,[_0x35a008],_0x454125);}_0x44800a[_0xb119('0x11')]['push']({'type':_0x142064[_0x41aad1][0x0][_0xb119('0x14')],'app':_0xb119('0x44'),'exten':_0x142064[_0x41aad1][0x0][_0xb119('0x9')],'context':_0x142064[_0x41aad1][0x0][_0xb119('0x17')],'priority':_0x44800a[_0xb119('0x10')],'VoiceExtensionId':_0x142064[_0x41aad1][0x0]['VoiceExtensionId']});_0x4bbd21[_0xb119('0x13')](_0x142064[_0x41aad1][0x0][_0xb119('0x18')]);_0x4312a3=_[_0xb119('0x43')](_0x4312a3,_0x44800a[_0xb119('0x11')]);}}return _0x486ce1[_0xb119('0x45')](function(_0x3e3ea6){return _0x486ce1['models'][_0xb119('0x5')][_0xb119('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x4bbd21}},'transaction':_0x3e3ea6})[_0xb119('0xb')](function(_0x1147e5){return _0x486ce1['models'][_0xb119('0x5')]['bulkCreate'](_[_0xb119('0x47')](_0x4312a3,_0xb119('0x10')),{'transaction':_0x3e3ea6});});});})[_0xb119('0x48')](function(_0x1b33f8){console[_0xb119('0x49')](_0x1b33f8);});}exports[_0xb119('0x4a')]=rewrite; \ No newline at end of file +var _0x4a1c=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','interval','*,*,*,*','tag','callerID','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','sortBy','catch','error','rewrite','util','models','Interval','then','intervals','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','extensions','extension','find','type','Set','CDR(type)=%s','context','inbound','push','CDR(routeid)=','VoiceExtensionId','priority','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x13e285,_0x246245){var _0x322d09=function(_0x4a7a04){while(--_0x4a7a04){_0x13e285['push'](_0x13e285['shift']());}};_0x322d09(++_0x246245);}(_0x4a1c,0xe5));var _0xc4a1=function(_0x4d3d50,_0x50f156){_0x4d3d50=_0x4d3d50-0x0;var _0x175e6d=_0x4a1c[_0x4d3d50];return _0x175e6d;};'use strict';var _=require('lodash');var util=require(_0xc4a1('0x0'));function rewrite(_0xf92ec4,_0x456f33){var _0x4a2fb4=this;return _0xf92ec4[_0xc4a1('0x1')][_0xc4a1('0x2')]['findAll']({'raw':!![]})[_0xc4a1('0x3')](function(_0x307597){_0x4a2fb4[_0xc4a1('0x4')]=_0x307597;return _0xf92ec4[_0xc4a1('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x456f33['IntervalId']},'raw':!![]});})[_0xc4a1('0x3')](function(_0x5263b5){return _0xf92ec4[_0xc4a1('0x1')]['VoiceExtension'][_0xc4a1('0x5')]({'where':{'exten':{'$in':_[_0xc4a1('0x6')](_[_0xc4a1('0x7')](_0x5263b5,_0xc4a1('0x8')))}},'order':[{'raw':_0xc4a1('0x9')}],'raw':!![]});})[_0xc4a1('0x3')](function(_0x41e88a){var _0x3602ab=_['filter'](_0x41e88a,{'priority':'1'});var _0x3d50b2=_[_0xc4a1('0xa')](_0x41e88a,{'isApp':0x1});var _0x512088=_['groupBy'](_0x3d50b2,'exten');var _0x2ae9a3=[_0xc4a1('0xb'),'playback'];var _0x46bf70=[];var _0x38f3b5=[];for(var _0x3db91e in _0x512088){if(_0x512088[_0xc4a1('0xc')](_0x3db91e)){_0x4a2fb4['priority']=0x2;_0x4a2fb4[_0xc4a1('0xd')]=[];_0x4a2fb4[_0xc4a1('0xe')]=_[_0xc4a1('0xf')](_0x3602ab,{'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')]});_0x4a2fb4[_0xc4a1('0xd')]['push']({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':util['format'](_0xc4a1('0x12'),_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')]),'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4['priority']++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0]['VoiceExtensionId']});if(_0x512088[_0x3db91e][0x0]['type']===_0xc4a1('0x14')){_0x4a2fb4['extensions'][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x16')+_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')],'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0]['exten'],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});}else if(_0x512088[_0x3db91e][0x0]['type']===_0xc4a1('0x19')){if(_0x4a2fb4[_0xc4a1('0xe')]){_0x4a2fb4[_0xc4a1('0xd')][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':'CDR(destination)='+(_0x4a2fb4[_0xc4a1('0xe')][_0xc4a1('0x1a')]?_0xc4a1('0x1b')+_0x4a2fb4[_0xc4a1('0xe')][_0xc4a1('0x1a')]+'}':_0xc4a1('0x1c')),'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});}_0x4a2fb4[_0xc4a1('0xd')][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0]['type'],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x16')+_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')],'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});var _0x4aab1b=_0x4a2fb4[_0xc4a1('0x18')]++;_0x4a2fb4[_0xc4a1('0xd')]['push']({'type':_0x512088[_0x3db91e][0x0]['type'],'app':_0xc4a1('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4aab1b+0x2)+_0xc4a1('0x1e')+(_0x4aab1b+0x1)+')','context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4aab1b,'VoiceExtensionId':_0x512088[_0x3db91e][0x0]['VoiceExtensionId']});if(_0x4a2fb4['extension']){_0x4a2fb4[_0xc4a1('0xd')][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0x4a2fb4[_0xc4a1('0xe')][_0xc4a1('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x4a2fb4[_0xc4a1('0xe')][_0xc4a1('0x1a')]+'}':_0xc4a1('0x1f'),'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0]['VoiceExtensionId']});}_0x4a2fb4['extensions']['push']({'type':_0x512088[_0x3db91e][0x0]['type'],'app':_0xc4a1('0x11'),'appdata':'outboundrouteid='+_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')],'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4['priority']++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0]['VoiceExtensionId']});if(_0x4a2fb4[_0xc4a1('0xe')]&&_0x4a2fb4[_0xc4a1('0xe')][_0xc4a1('0xc')](_0xc4a1('0x20'))&&_0x4a2fb4[_0xc4a1('0xe')]['recordingFormat']!==_0xc4a1('0x21')){_0x4a2fb4['extensions'][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0]['VoiceExtensionId']});_0x4a2fb4['extensions'][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x22')+_0x4a2fb4[_0xc4a1('0xe')]['recordingFormat']||'wav','context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0]['exten'],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});}}_0x4a2fb4[_0xc4a1('0xd')][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x23'),'context':_0x512088[_0x3db91e][0x0]['context'],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4[_0xc4a1('0x18')]++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});_0x4a2fb4['extensions'][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x24'),'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0]['exten'],'priority':_0x4a2fb4['priority']++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});_0x4a2fb4[_0xc4a1('0xd')]['push']({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'priority':_0x4a2fb4['priority']++,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});for(var _0x120d9e=0x0,_0x5b4ce6=0x0;_0x120d9e<_0x512088[_0x3db91e]['length'];_0x120d9e+=0x1,_0x5b4ce6=0x0){var _0x123897=_0x512088[_0x3db91e][_0x120d9e];if(_0x123897[_0xc4a1('0x10')]){_0x123897['type']=_0x123897[_0xc4a1('0x10')][_0xc4a1('0x25')]();}var _0xd39990=[];var _0x39c5a2=[];delete _0x123897['id'];delete _0x123897[_0xc4a1('0x26')];delete _0x123897['updatedAt'];var _0x2f4bd6=_0x123897[_0xc4a1('0x27')]!==_0xc4a1('0x28')?[_0x123897[_0xc4a1('0x27')]]:_0x123897['IntervalId']?_[_0xc4a1('0x7')](_[_0xc4a1('0xa')](_0x4a2fb4[_0xc4a1('0x4')],{'IntervalId':_0x123897['IntervalId']}),_0xc4a1('0x27')):[];if(_0x123897[_0xc4a1('0xc')]('tag')){if(_0x123897[_0xc4a1('0x29')]&&_0x123897[_0xc4a1('0x29')]!=='--'){_0xd39990[_0xc4a1('0x15')]({'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':'CDR(tag)='+_0x123897[_0xc4a1('0x29')],'context':_0x123897[_0xc4a1('0x13')],'exten':_0x123897[_0xc4a1('0x8')],'priority':_0x2f4bd6['length']+_0x4a2fb4[_0xc4a1('0x18')]+_0x5b4ce6++,'VoiceExtensionId':_0x123897[_0xc4a1('0x17')]});}}if(_0x123897[_0xc4a1('0x10')]===_0xc4a1('0x19')&&_0x123897['hasOwnProperty']('callerID')){if(_0x123897[_0xc4a1('0x2a')]){_0xd39990['push']({'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x123897[_0xc4a1('0x2a')]+')','context':_0x123897[_0xc4a1('0x13')],'exten':_0x123897[_0xc4a1('0x8')],'priority':_0x2f4bd6[_0xc4a1('0x2b')]+_0x4a2fb4['priority']+_0x5b4ce6++,'VoiceExtensionId':_0x123897[_0xc4a1('0x17')]});}else{_0xd39990[_0xc4a1('0x15')]({'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x1d'),'appdata':_0xc4a1('0x2c'),'context':_0x123897['context'],'exten':_0x123897[_0xc4a1('0x8')],'priority':_0x2f4bd6['length']+_0x4a2fb4[_0xc4a1('0x18')]+_0x5b4ce6++,'VoiceExtensionId':_0x123897[_0xc4a1('0x17')]});}}if(_0x123897['hasOwnProperty'](_0xc4a1('0x2d'))){if(_0x2ae9a3[_0xc4a1('0x2e')](_0x123897[_0xc4a1('0x2f')][_0xc4a1('0x25')]())>=0x0&&_0x123897['appType']!==_0xc4a1('0x30')){if(_0x123897[_0xc4a1('0x2d')]){_0xd39990[_0xc4a1('0x15')]({'type':_0x123897['type'],'app':_0xc4a1('0x1d'),'appdata':_0xc4a1('0x31'),'context':_0x123897[_0xc4a1('0x13')],'exten':_0x123897['exten'],'priority':_0x2f4bd6[_0xc4a1('0x2b')]+_0x4a2fb4[_0xc4a1('0x18')]+_0x5b4ce6++,'VoiceExtensionId':_0x123897['VoiceExtensionId']});_0xd39990[_0xc4a1('0x15')]({'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x32'),'context':_0x123897[_0xc4a1('0x13')],'exten':_0x123897['exten'],'priority':_0x2f4bd6[_0xc4a1('0x2b')]+_0x4a2fb4[_0xc4a1('0x18')]+_0x5b4ce6++,'VoiceExtensionId':_0x123897[_0xc4a1('0x17')]});}else{_0xd39990[_0xc4a1('0x15')]({'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x1d'),'appdata':_0xc4a1('0x33'),'context':_0x123897[_0xc4a1('0x13')],'exten':_0x123897['exten'],'priority':_0x2f4bd6[_0xc4a1('0x2b')]+_0x4a2fb4['priority']+_0x5b4ce6++,'VoiceExtensionId':_0x123897[_0xc4a1('0x17')]});_0xd39990[_0xc4a1('0x15')]({'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x11'),'appdata':_0xc4a1('0x34'),'context':_0x123897[_0xc4a1('0x13')],'exten':_0x123897[_0xc4a1('0x8')],'priority':_0x2f4bd6[_0xc4a1('0x2b')]+_0x4a2fb4[_0xc4a1('0x18')]+_0x5b4ce6++,'VoiceExtensionId':_0x123897[_0xc4a1('0x17')]});}}}for(var _0x6fc948=0x0;_0x6fc948<_0x2f4bd6['length'];_0x6fc948+=0x1){var _0x2c6cd7=_0x4a2fb4[_0xc4a1('0x18')]+_0x2f4bd6[_0xc4a1('0x2b')];var _0x13f357=_0x6fc948===_0x2f4bd6[_0xc4a1('0x2b')]-0x1?_0x4a2fb4[_0xc4a1('0x18')]+_0xd39990[_0xc4a1('0x2b')]+_0x39c5a2[_0xc4a1('0x2b')]+0x2:_0x4a2fb4[_0xc4a1('0x18')]+_0x6fc948+0x1;_0xd39990[_0xc4a1('0x35')](_0x6fc948,0x0,{'type':_0x123897[_0xc4a1('0x10')],'app':_0xc4a1('0x36'),'appdata':_0x2f4bd6[_0x6fc948]+'?'+_0x123897[_0xc4a1('0x13')]+_0xc4a1('0x37')+_0x2c6cd7+':'+_0x123897[_0xc4a1('0x13')]+_0xc4a1('0x37')+_0x13f357,'exten':_0x123897['exten'],'context':_0x123897[_0xc4a1('0x13')],'priority':_0x4a2fb4[_0xc4a1('0x18')]+_0x6fc948,'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});}_0x123897[_0xc4a1('0x18')]=_0xd39990[_0xc4a1('0x2b')]?_[_0xc4a1('0x38')](_0xd39990)[_0xc4a1('0x18')]+0x1:_0x4a2fb4[_0xc4a1('0x18')];_0x4a2fb4[_0xc4a1('0x18')]=(_0x39c5a2[_0xc4a1('0x2b')]?_[_0xc4a1('0x38')](_0x39c5a2)[_0xc4a1('0x18')]:_0x123897['priority'])+0x1;_0x4a2fb4[_0xc4a1('0xd')]=_[_0xc4a1('0x39')](_0x4a2fb4[_0xc4a1('0xd')],_0xd39990,[_0x123897],_0x39c5a2);}_0x4a2fb4[_0xc4a1('0xd')][_0xc4a1('0x15')]({'type':_0x512088[_0x3db91e][0x0][_0xc4a1('0x10')],'app':_0xc4a1('0x3a'),'exten':_0x512088[_0x3db91e][0x0][_0xc4a1('0x8')],'context':_0x512088[_0x3db91e][0x0][_0xc4a1('0x13')],'priority':_0x4a2fb4[_0xc4a1('0x18')],'VoiceExtensionId':_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]});_0x46bf70[_0xc4a1('0x15')](_0x512088[_0x3db91e][0x0][_0xc4a1('0x17')]);_0x38f3b5=_[_0xc4a1('0x39')](_0x38f3b5,_0x4a2fb4[_0xc4a1('0xd')]);}}return _0xf92ec4[_0xc4a1('0x3b')](function(_0x29b2ac){return _0xf92ec4[_0xc4a1('0x1')][_0xc4a1('0x3c')][_0xc4a1('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x46bf70}},'transaction':_0x29b2ac})[_0xc4a1('0x3')](function(_0x58e7a6){return _0xf92ec4[_0xc4a1('0x1')][_0xc4a1('0x3c')]['bulkCreate'](_[_0xc4a1('0x3e')](_0x38f3b5,_0xc4a1('0x18')),{'transaction':_0x29b2ac});});});})[_0xc4a1('0x3f')](function(_0x22ae11){console[_0xc4a1('0x40')](_0x22ae11);});}exports[_0xc4a1('0x41')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 6f4d53c..3d7a9e8 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 _0xea9a=['phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','fromQuery','id\x20IN\x20?','calleridnum','str','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','outbound','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','localhost','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0xea9a,0xbc));var _0xaea9=function(_0x5f2d83,_0x547a8b){_0x5f2d83=_0x5f2d83-0x0;var _0x1c3cad=_0xea9a[_0x5f2d83];return _0x1c3cad;};'use strict';var BPromise=require(_0xaea9('0x0'));var util=require(_0xaea9('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xaea9('0x2'));var Papa=require(_0xaea9('0x3'));var Redis=require(_0xaea9('0x4'));var db=require(_0xaea9('0x5'))['db'];var config=require(_0xaea9('0x6'));var logger=require('../../../config/logger')(_0xaea9('0x7'));config[_0xaea9('0x8')]=_['defaults'](config[_0xaea9('0x8')],{'host':_0xaea9('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaea9('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xaea9('0xa')][0x2]||process['argv'][0x2]==='undefined'||process[_0xaea9('0xa')][0x2]===_0xaea9('0xb')){throw new Error(_0xaea9('0xc'));}var FILEPATH=process[_0xaea9('0xa')][0x2];if(!process[_0xaea9('0xa')][0x3]||process[_0xaea9('0xa')][0x3]===_0xaea9('0xd')||process[_0xaea9('0xa')][0x3]===_0xaea9('0xb')||!process[_0xaea9('0xa')][0x4]||process['argv'][0x4]==='undefined'||process[_0xaea9('0xa')][0x4]===_0xaea9('0xb')){throw new Error(_0xaea9('0xe'));}var FIELDS=_[_0xaea9('0xf')](process['argv'][0x3][_0xaea9('0x10')](','),process['argv'][0x4][_0xaea9('0x10')](','));if(!process[_0xaea9('0xa')][0x5]||process['argv'][0x5]===_0xaea9('0xd')||process[_0xaea9('0xa')][0x5]==='null'){throw new Error(_0xaea9('0x11'));}var LISTID=process[_0xaea9('0xa')][0x5];var COMPANYID=process[_0xaea9('0xa')][0x6]&&process[_0xaea9('0xa')][0x6]!==_0xaea9('0xd')&&process[_0xaea9('0xa')][0x6]!==_0xaea9('0xb')?process[_0xaea9('0xa')][0x6]:null;var DUPLICATES=process[_0xaea9('0xa')][0x7]&&process['argv'][0x7]!==_0xaea9('0xd')&&process[_0xaea9('0xa')][0x7]!==_0xaea9('0xb')?process[_0xaea9('0xa')][0x7]:null;if(!process[_0xaea9('0xa')][0x8]||process[_0xaea9('0xa')][0x8]===_0xaea9('0xd')||process[_0xaea9('0xa')][0x8]===_0xaea9('0xb')){throw new Error(_0xaea9('0x12'));}var SOCKET_TIMESTAMP=process[_0xaea9('0xa')][0x8];}catch(_0x4e62bf){logger[_0xaea9('0x13')](_0x4e62bf);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(_0x473fab,_0x11562d,_0x12a7e6,_0xdbc9b6){var _0x19fe30={'message':_0x11562d};_0x19fe30[_0x473fab]=!![];if(_0x12a7e6){_0x19fe30[_0xaea9('0x14')]=_0x12a7e6;}if(_0xdbc9b6){_0x19fe30['index']=_0xdbc9b6;}return _0x19fe30;}function isEmail(_0x13e054){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))*$/[_0xaea9('0x15')](_0x13e054);}function checkRow(_0x554595,_0x23e730,_0x1ba87c){return new BPromise(function(_0x2d7a82,_0x3807ed){if(_[_0xaea9('0x16')](_0x554595)){return _0x3807ed(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1ba87c));}if(_0x554595[_0xaea9('0x17')]&&_0x554595['errors'][_0xaea9('0x18')]){var _0xcd84b5=_[_0xaea9('0x19')](_0x554595['errors'],_0xaea9('0x1a'))[_0xaea9('0x1b')](';');return _0x3807ed(handleCheckRowError(_0xaea9('0x13'),_0xcd84b5,null,_0x1ba87c));}var _0x2670d1={};for(var _0x8dd317 in FIELDS){if(FIELDS['hasOwnProperty'](_0x8dd317)&&FIELDS[_0x8dd317]){_0x2670d1[_0x8dd317]=_0x554595[_0xaea9('0x1c')][0x0][FIELDS[_0x8dd317]]||_0x554595['data'][0x0]['\ufeff'+FIELDS[_0x8dd317]];}}if(!_0x2670d1[_0xaea9('0x1d')]){return _0x3807ed(handleCheckRowError('error',_0xaea9('0x1e'),null,_0x1ba87c));}if(!_0x2670d1[_0xaea9('0x1f')]){return _0x3807ed(handleCheckRowError('error',_0xaea9('0x20'),null,_0x1ba87c));}if(_0x2670d1[_0xaea9('0x21')]){var _0x13696a=moment(_0x2670d1[_0xaea9('0x21')],_0xaea9('0x22'));if(!_0x13696a[_0xaea9('0x23')]()){return _0x3807ed(handleCheckRowError('error',_0xaea9('0x24'),null,_0x1ba87c));}}if(_0x2670d1[_0xaea9('0x25')]){if(!isEmail(_0x2670d1['email'])){return _0x3807ed(handleCheckRowError(_0xaea9('0x13'),_0xaea9('0x26'),null,_0x1ba87c));}}_0x2670d1[_0xaea9('0x27')]=LISTID;_0x2670d1[_0xaea9('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xaea9('0x18')]&&_0x23e730){var _0x503fe3={};for(var _0x336c3a=0x0,_0x1c5b36=DUPLICATES[_0xaea9('0x18')];_0x336c3a<_0x1c5b36;_0x336c3a+=0x1){_0x503fe3[DUPLICATES[_0x336c3a]]=_0x2670d1[DUPLICATES[_0x336c3a]];}var _0xa30d0a=_['find'](_0x23e730,_0x503fe3);if(_0xa30d0a){return _0x3807ed(handleCheckRowError(_0xaea9('0x29'),_0xaea9('0x2a'),_0xa30d0a,_0x1ba87c));}}return db[_0xaea9('0x2b')][_0xaea9('0x2c')](_0x2670d1,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2670d1)})[_0xaea9('0x2d')](function(_0x2da3fc){if(DUPLICATES&&DUPLICATES[_0xaea9('0x18')]&&_0x23e730){_0x23e730[_0xaea9('0x2e')](_[_0xaea9('0x2f')](_0x2670d1,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2da3fc['id'];return _0x2d7a82();})[_0xaea9('0x30')](function(_0xa645bc){return _0x3807ed(handleCheckRowError(_0xaea9('0x13'),_0xaea9('0x31')+(_0xa645bc[_0xaea9('0x1a')]||JSON[_0xaea9('0x32')](_0xa645bc)),null,_0x1ba87c));});});}function checkHopper(){function _0x3cac91(){return function(_0x602198){logger['error'](_0xaea9('0x33'),_0xaea9('0x34'),util[_0xaea9('0x35')](_0x602198,{'showHidden':![],'depth':null}));};}var _0x317fbf=function(_0x11d1f9,_0xd9766){var _0x90ba19=squel[_0xaea9('0x36')]()[_0xaea9('0x37')]('cm_hopper')['fromQuery']([_0xaea9('0x1f'),_0xaea9('0x38'),_0xaea9('0x39'),_0xaea9('0x27'),_0xd9766,_0xaea9('0x3a'),_0xaea9('0x3b')],squel[_0xaea9('0x3c')]()['field']('phone',_0xaea9('0x1f'))[_0xaea9('0x3d')](_0xaea9('0x3e'),_0xaea9('0x38'))['field']('id',_0xaea9('0x39'))['field'](LISTID['toString'](),_0xaea9('0x27'))[_0xaea9('0x3d')](_0x11d1f9['id'][_0xaea9('0x3f')](),_0xd9766)['field'](_0xaea9('0x3e'),'createdAt')['field']('NOW()',_0xaea9('0x3b'))['from'](_0xaea9('0x40'))[_0xaea9('0x41')](_0xaea9('0x42'))[_0xaea9('0x41')](_0xaea9('0x43'),LISTID[_0xaea9('0x3f')]())['where'](_0xaea9('0x44'))['where'](_0xaea9('0x45'),squel[_0xaea9('0x3c')]()[_0xaea9('0x3d')](_0xaea9('0x1f'))[_0xaea9('0x46')](_0xaea9('0x47'))[_0xaea9('0x41')](_0xd9766+_0xaea9('0x48'),_0x11d1f9['id'][_0xaea9('0x3f')]())))[_0xaea9('0x3f')]();return _0x90ba19;};var _0x7a7fb2=function(_0x173221,_0x3429e7){var _0x3acc7f=squel['insert']()[_0xaea9('0x37')](_0xaea9('0x47'))[_0xaea9('0x49')]([_0xaea9('0x1f'),_0xaea9('0x38'),_0xaea9('0x39'),'ListId',_0x3429e7,_0xaea9('0x3a'),'updatedAt'],squel[_0xaea9('0x3c')]()['field'](_0xaea9('0x1f'),_0xaea9('0x1f'))[_0xaea9('0x3d')](_0xaea9('0x3e'),_0xaea9('0x38'))['field']('id',_0xaea9('0x39'))[_0xaea9('0x3d')](LISTID['toString'](),_0xaea9('0x27'))[_0xaea9('0x3d')](_0x173221['id']['toString'](),_0x3429e7)[_0xaea9('0x3d')](_0xaea9('0x3e'),_0xaea9('0x3a'))[_0xaea9('0x3d')]('NOW()','updatedAt')[_0xaea9('0x46')](_0xaea9('0x40'))['where'](_0xaea9('0x42'))[_0xaea9('0x41')](_0xaea9('0x43'),LISTID[_0xaea9('0x3f')]())['where'](_0xaea9('0x4a'),squel['str'](hopperContacts))[_0xaea9('0x41')](_0xaea9('0x44'))[_0xaea9('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0xaea9('0x3c')]()[_0xaea9('0x3d')](_0xaea9('0x4b'))[_0xaea9('0x46')]('cm_hopper_final')[_0xaea9('0x41')](_0x3429e7+'\x20=\x20?',_0x173221['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xaea9('0x3c')]()[_0xaea9('0x3d')](_0xaea9('0x1f'))[_0xaea9('0x46')](_0xaea9('0x47'))[_0xaea9('0x41')](_0x3429e7+_0xaea9('0x48'),_0x173221['id'][_0xaea9('0x3f')]())))[_0xaea9('0x3f')]();return _0x3acc7f;};function _0x47db02(_0x1c4a82,_0x1b3965){var _0x4b6963=squel[_0xaea9('0x36')]()['into'](_0xaea9('0x47'))[_0xaea9('0x49')](['phone',_0xaea9('0x38'),_0xaea9('0x39'),_0xaea9('0x27'),_0x1b3965,'createdAt',_0xaea9('0x3b')],squel[_0xaea9('0x3c')]()[_0xaea9('0x3d')](_0xaea9('0x1f'),'phone')['field'](_0xaea9('0x3e'),_0xaea9('0x38'))[_0xaea9('0x3d')]('id',_0xaea9('0x39'))[_0xaea9('0x3d')](LISTID[_0xaea9('0x3f')](),_0xaea9('0x27'))['field'](_0x1c4a82['id'][_0xaea9('0x3f')](),_0x1b3965)[_0xaea9('0x3d')](_0xaea9('0x3e'),_0xaea9('0x3a'))[_0xaea9('0x3d')]('NOW()',_0xaea9('0x3b'))[_0xaea9('0x46')](_0xaea9('0x40'))[_0xaea9('0x41')](_0xaea9('0x42'))[_0xaea9('0x41')]('ListId\x20=\x20?',LISTID[_0xaea9('0x3f')]())['where']('id\x20IN\x20?',squel[_0xaea9('0x4c')](hopperContacts))[_0xaea9('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xaea9('0x3f')]();return _0x4b6963;}function _0x493341(_0x491feb,_0xfbae20){var _0x17cdb0=squel['insert']()[_0xaea9('0x37')](_0xaea9('0x4d'))[_0xaea9('0x49')](['phone',_0xaea9('0x39'),'ListId',_0xfbae20,_0xaea9('0x3a'),_0xaea9('0x3b')],squel[_0xaea9('0x3c')]()[_0xaea9('0x3d')](_0xaea9('0x1f'),_0xaea9('0x1f'))['field']('id',_0xaea9('0x39'))['field'](LISTID[_0xaea9('0x3f')](),_0xaea9('0x27'))['field'](_0x491feb['id'][_0xaea9('0x3f')](),_0xfbae20)[_0xaea9('0x3d')](_0xaea9('0x3e'),'createdAt')['field'](_0xaea9('0x3e'),_0xaea9('0x3b'))[_0xaea9('0x46')](_0xaea9('0x40'))['where'](_0xaea9('0x42'))[_0xaea9('0x41')](_0xaea9('0x43'),LISTID['toString']())[_0xaea9('0x41')]('id\x20IN\x20?',squel[_0xaea9('0x4c')](hopperContacts))[_0xaea9('0x41')](_0xaea9('0x44')))[_0xaea9('0x3f')]();return _0x17cdb0;}return db['VoiceQueue'][_0xaea9('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0xaea9('0x4f')],'include':[{'model':db[_0xaea9('0x50')],'as':_0xaea9('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x20f61a){var _0x4492a2=[];if(_0x20f61a){var _0x2767ee;for(var _0xf01ab=0x0,_0x2abe67;_0xf01ab<_0x20f61a[_0xaea9('0x18')];_0xf01ab+=0x1){_0x2abe67=_0x20f61a[_0xf01ab][_0xaea9('0x52')]({'plain':!![]});switch(_0x2abe67[_0xaea9('0x4f')]){case _0xaea9('0x53'):_0x4492a2[_0xaea9('0x2e')](db['sequelize'][_0xaea9('0x54')](_0x7a7fb2(_0x2abe67,_0xaea9('0x55')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));break;case _0xaea9('0x56'):_0x4492a2[_0xaea9('0x2e')](db[_0xaea9('0x57')][_0xaea9('0x54')](_0x317fbf(_0x2abe67,_0xaea9('0x55')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));break;default:_0x4492a2['push'](db[_0xaea9('0x57')][_0xaea9('0x54')](_0x47db02(_0x2abe67,_0xaea9('0x55')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));}}}return _0x4492a2;})[_0xaea9('0x58')]()[_0xaea9('0x2d')](function(){return db['VoiceQueue'][_0xaea9('0x4e')]({'where':{'type':_0xaea9('0x59')},'attributes':['id'],'include':[{'model':db[_0xaea9('0x50')],'as':_0xaea9('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x33ba0f){var _0x4ea17e=[];if(_0x33ba0f){var _0x48a206;for(var _0x1a1b42=0x0,_0x5b4de4;_0x1a1b42<_0x33ba0f[_0xaea9('0x18')];_0x1a1b42+=0x1){_0x5b4de4=_0x33ba0f[_0x1a1b42][_0xaea9('0x52')]({'plain':!![]});_0x4ea17e['push'](db[_0xaea9('0x57')][_0xaea9('0x54')](_0x493341(_0x5b4de4,_0xaea9('0x55')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));}}return _0x4ea17e;})[_0xaea9('0x58')]();})[_0xaea9('0x2d')](function(){return db[_0xaea9('0x5b')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaea9('0x50')],'as':_0xaea9('0x51'),'where':{'id':LISTID}}]})[_0xaea9('0x2d')](function(_0x4b7e72){var _0x216853=[];if(_0x4b7e72){for(var _0x20a724=0x0,_0x4e1c67;_0x20a724<_0x4b7e72[_0xaea9('0x18')];_0x20a724+=0x1){_0x4e1c67=_0x4b7e72[_0x20a724][_0xaea9('0x52')]({'plain':!![]});switch(_0x4e1c67['dialCheckDuplicateType']){case _0xaea9('0x53'):_0x216853[_0xaea9('0x2e')](db['sequelize'][_0xaea9('0x54')](_0x7a7fb2(_0x4e1c67,_0xaea9('0x5c')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));break;case'onlyIfOpen':_0x216853[_0xaea9('0x2e')](db[_0xaea9('0x57')][_0xaea9('0x54')](_0x317fbf(_0x4e1c67,_0xaea9('0x5c')))[_0xaea9('0x2d')](function(){})['catch'](_0x3cac91()));break;default:_0x216853[_0xaea9('0x2e')](db[_0xaea9('0x57')][_0xaea9('0x54')](_0x47db02(_0x4e1c67,_0xaea9('0x5c')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));}}}return _0x216853;})[_0xaea9('0x58')]();})[_0xaea9('0x2d')](function(){return db['Campaign'][_0xaea9('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xaea9('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0xdd9bb3){var _0x1c1ff5=[];if(_0xdd9bb3){for(var _0x162200=0x0,_0x1e470e;_0x162200<_0xdd9bb3[_0xaea9('0x18')];_0x162200+=0x1){_0x1e470e=_0xdd9bb3[_0x162200][_0xaea9('0x52')]({'plain':!![]});_0x1c1ff5[_0xaea9('0x2e')](db['sequelize'][_0xaea9('0x54')](_0x493341(_0x1e470e,_0xaea9('0x5c')))[_0xaea9('0x2d')](function(){})[_0xaea9('0x30')](_0x3cac91()));}}return _0x1c1ff5;})[_0xaea9('0x58')]();})[_0xaea9('0x30')](function(_0x42aee2){logger[_0xaea9('0x13')](_0xaea9('0x5d'),_0xaea9('0x5e'),_0x42aee2[_0xaea9('0x1a')]);});}var processPromises=function(_0x34ecfd){return BPromise['all'](promises)[_0xaea9('0x2d')](function(_0x53f206){})['catch'](function(_0x1bad63){logger[_0xaea9('0x13')](_0xaea9('0x5f'),JSON[_0xaea9('0x32')](_0x1bad63));})[_0xaea9('0x60')](function(){socket[_0xaea9('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x34ecfd){return _0x34ecfd[_0xaea9('0x62')]();}});};var endCsv=function(){return BPromise[_0xaea9('0x63')]()[_0xaea9('0x2d')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xaea9('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xaea9('0x64')](FILEPATH);}catch(_0x5a8016){logger[_0xaea9('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x5a8016));}finally{process[_0xaea9('0x65')](0x0);}});};process['on'](_0xaea9('0x66'),function(){logger[_0xaea9('0x67')](_0xaea9('0x68'));endCsv();});function main(){return BPromise['resolve']()[_0xaea9('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xaea9('0x2b')][_0xaea9('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xaea9('0x2d')](function(_0x31d123){var _0x27a12f=fs[_0xaea9('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xaea9('0x6a')](_0x27a12f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5796b4,_0x2f6bd2){total+=0x1;var _0x46f919=total;promises[_0xaea9('0x2e')](checkRow(_0x5796b4,_0x31d123,_0x46f919)[_0xaea9('0x2d')](function(){success+=0x1;})[_0xaea9('0x30')](function(_0x538e48){if(_0x538e48[_0xaea9('0x13')]){errors+=0x1;delete _0x538e48['error'];}else if(_0x538e48[_0xaea9('0x29')]){duplicates+=0x1;delete _0x538e48['duplicate'];}rows[_0xaea9('0x2e')](_0x538e48);}));if(total%0xc8===0x0){_0x2f6bd2[_0xaea9('0x6b')]();return processPromises(_0x2f6bd2);}},'complete':function(){return processPromises()[_0xaea9('0x2d')](function(){logger[_0xaea9('0x67')](_0xaea9('0x6c'));endCsv();});},'error':function(_0x1c9ace,_0x210d7f){logger[_0xaea9('0x67')]('CSV\x20parse\x20error',JSON[_0xaea9('0x32')](_0x1c9ace));endCsv();}});})['catch'](function(_0x22d0c9){logger[_0xaea9('0x13')](_0xaea9('0x6d'),JSON[_0xaea9('0x32')](_0x22d0c9));});}main(); \ No newline at end of file +var _0xb19e=['generalCheckHopper','finally','emit','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','id\x20IN\x20?','calleridnum','cm_contacts','cm_hopper_black','str','VoiceQueue','outbound','dialCheckDuplicateType','CmList','always','sequelize','query','VoiceQueueId','all','findAll','get','Lists','CampaignId','BlackLists'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb19e,0x1aa));var _0xeb19=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xb19e[_0x5cb1af];return _0x8d7940;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xeb19('0x0'));var fs=require('fs');var squel=require(_0xeb19('0x1'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xeb19('0x2'))['db'];var config=require(_0xeb19('0x3'));var logger=require(_0xeb19('0x4'))(_0xeb19('0x5'));config[_0xeb19('0x6')]=_[_0xeb19('0x7')](config[_0xeb19('0x6')],{'host':_0xeb19('0x8'),'port':0x18eb});var socket=require(_0xeb19('0x9'))(new Redis(config[_0xeb19('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0xeb19('0xa')](socket);try{if(!process['argv'][0x2]||process[_0xeb19('0xb')][0x2]===_0xeb19('0xc')||process[_0xeb19('0xb')][0x2]===_0xeb19('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xeb19('0xb')][0x2];if(!process[_0xeb19('0xb')][0x3]||process[_0xeb19('0xb')][0x3]===_0xeb19('0xc')||process['argv'][0x3]===_0xeb19('0xd')||!process[_0xeb19('0xb')][0x4]||process[_0xeb19('0xb')][0x4]===_0xeb19('0xc')||process[_0xeb19('0xb')][0x4]===_0xeb19('0xd')){throw new Error(_0xeb19('0xe'));}var FIELDS=_[_0xeb19('0xf')](process[_0xeb19('0xb')][0x3][_0xeb19('0x10')](','),process[_0xeb19('0xb')][0x4][_0xeb19('0x10')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xeb19('0xc')||process[_0xeb19('0xb')][0x5]===_0xeb19('0xd')){throw new Error(_0xeb19('0x11'));}var LISTID=process[_0xeb19('0xb')][0x5];var COMPANYID=process[_0xeb19('0xb')][0x6]&&process[_0xeb19('0xb')][0x6]!==_0xeb19('0xc')&&process['argv'][0x6]!==_0xeb19('0xd')?process['argv'][0x6]:null;var DUPLICATES=process[_0xeb19('0xb')][0x7]&&process[_0xeb19('0xb')][0x7]!==_0xeb19('0xc')&&process[_0xeb19('0xb')][0x7]!==_0xeb19('0xd')?process[_0xeb19('0xb')][0x7]:null;if(!process[_0xeb19('0xb')][0x8]||process[_0xeb19('0xb')][0x8]===_0xeb19('0xc')||process[_0xeb19('0xb')][0x8]===_0xeb19('0xd')){throw new Error(_0xeb19('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x477ff6){logger[_0xeb19('0x13')](_0x477ff6);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(_0x2ed350,_0x5b172c,_0x1aa0d6,_0x27c1ac){var _0xd4635a={'message':_0x5b172c};_0xd4635a[_0x2ed350]=!![];if(_0x1aa0d6){_0xd4635a[_0xeb19('0x14')]=_0x1aa0d6;}if(_0x27c1ac){_0xd4635a[_0xeb19('0x15')]=_0x27c1ac;}return _0xd4635a;}function isEmail(_0x3a0a66){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'](_0x3a0a66);}function checkRow(_0x357ea4,_0x1c7cb6,_0x416ede){return new BPromise(function(_0x1bd4ce,_0x5a4cff){if(_[_0xeb19('0x16')](_0x357ea4)){return _0x5a4cff(handleCheckRowError(_0xeb19('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x416ede));}if(_0x357ea4[_0xeb19('0x17')]&&_0x357ea4['errors'][_0xeb19('0x18')]){var _0x1b287c=_[_0xeb19('0x19')](_0x357ea4[_0xeb19('0x17')],_0xeb19('0x1a'))[_0xeb19('0x1b')](';');return _0x5a4cff(handleCheckRowError('error',_0x1b287c,null,_0x416ede));}var _0x296cc0={};for(var _0x51bff6 in FIELDS){if(FIELDS[_0xeb19('0x1c')](_0x51bff6)&&FIELDS[_0x51bff6]){_0x296cc0[_0x51bff6]=_0x357ea4[_0xeb19('0x1d')][0x0][FIELDS[_0x51bff6]]||_0x357ea4[_0xeb19('0x1d')][0x0]['\ufeff'+FIELDS[_0x51bff6]];}}if(!_0x296cc0[_0xeb19('0x1e')]){return _0x5a4cff(handleCheckRowError(_0xeb19('0x13'),'firstName\x20not\x20specified!',null,_0x416ede));}if(!_0x296cc0[_0xeb19('0x1f')]){return _0x5a4cff(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x416ede));}if(_0x296cc0[_0xeb19('0x20')]){var _0x5bedf4=moment(_0x296cc0[_0xeb19('0x20')],'YYYY-MM-DD');if(!_0x5bedf4['isValid']()){return _0x5a4cff(handleCheckRowError(_0xeb19('0x13'),_0xeb19('0x21'),null,_0x416ede));}}if(_0x296cc0[_0xeb19('0x22')]){if(!isEmail(_0x296cc0['email'])){return _0x5a4cff(handleCheckRowError(_0xeb19('0x13'),_0xeb19('0x23'),null,_0x416ede));}}_0x296cc0[_0xeb19('0x24')]=LISTID;_0x296cc0[_0xeb19('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xeb19('0x18')]&&_0x1c7cb6){var _0x4e4b96={};for(var _0x4d4e6e=0x0,_0x469bd9=DUPLICATES[_0xeb19('0x18')];_0x4d4e6e<_0x469bd9;_0x4d4e6e+=0x1){_0x4e4b96[DUPLICATES[_0x4d4e6e]]=_0x296cc0[DUPLICATES[_0x4d4e6e]];}var _0x56a0ca=_['find'](_0x1c7cb6,_0x4e4b96);if(_0x56a0ca){return _0x5a4cff(handleCheckRowError(_0xeb19('0x26'),_0xeb19('0x27'),_0x56a0ca,_0x416ede));}}return db[_0xeb19('0x28')][_0xeb19('0x29')](_0x296cc0,{'raw':!![],'hooks':![],'fields':_[_0xeb19('0x2a')](_0x296cc0)})[_0xeb19('0x2b')](function(_0x283ccf){if(DUPLICATES&&DUPLICATES['length']&&_0x1c7cb6){_0x1c7cb6[_0xeb19('0x2c')](_['pick'](_0x296cc0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x283ccf['id'];return _0x1bd4ce();})[_0xeb19('0x2d')](function(_0x381bd3){return _0x5a4cff(handleCheckRowError(_0xeb19('0x13'),_0xeb19('0x2e')+(_0x381bd3[_0xeb19('0x1a')]||JSON[_0xeb19('0x2f')](_0x381bd3)),null,_0x416ede));});});}function checkHopper(){function _0x2c1acb(){return function(_0x59ee74){logger[_0xeb19('0x13')](_0xeb19('0x30'),_0xeb19('0x31'),util[_0xeb19('0x32')](_0x59ee74,{'showHidden':![],'depth':null}));};}var _0x138117=function(_0x2bc616,_0x53d55a){var _0xd0a922=squel[_0xeb19('0x33')]()[_0xeb19('0x34')]('cm_hopper')[_0xeb19('0x35')]([_0xeb19('0x1f'),_0xeb19('0x36'),_0xeb19('0x37'),_0xeb19('0x24'),_0x53d55a,_0xeb19('0x38'),_0xeb19('0x39')],squel[_0xeb19('0x3a')]()[_0xeb19('0x3b')](_0xeb19('0x1f'),_0xeb19('0x1f'))[_0xeb19('0x3b')](_0xeb19('0x3c'),_0xeb19('0x36'))[_0xeb19('0x3b')]('id','ContactId')[_0xeb19('0x3b')](LISTID[_0xeb19('0x3d')](),_0xeb19('0x24'))['field'](_0x2bc616['id'][_0xeb19('0x3d')](),_0x53d55a)[_0xeb19('0x3b')](_0xeb19('0x3c'),'createdAt')['field'](_0xeb19('0x3c'),'updatedAt')[_0xeb19('0x3e')]('cm_contacts')[_0xeb19('0x3f')](_0xeb19('0x40'))['where'](_0xeb19('0x41'),LISTID[_0xeb19('0x3d')]())['where'](_0xeb19('0x42'))[_0xeb19('0x3f')](_0xeb19('0x43'),squel['select']()[_0xeb19('0x3b')](_0xeb19('0x1f'))[_0xeb19('0x3e')](_0xeb19('0x44'))[_0xeb19('0x3f')](_0x53d55a+_0xeb19('0x45'),_0x2bc616['id'][_0xeb19('0x3d')]())))[_0xeb19('0x3d')]();return _0xd0a922;};var _0x556238=function(_0x23a499,_0x26fa25){var _0x2e35ff=squel[_0xeb19('0x33')]()[_0xeb19('0x34')](_0xeb19('0x44'))[_0xeb19('0x35')]([_0xeb19('0x1f'),_0xeb19('0x36'),_0xeb19('0x37'),_0xeb19('0x24'),_0x26fa25,'createdAt',_0xeb19('0x39')],squel['select']()[_0xeb19('0x3b')](_0xeb19('0x1f'),_0xeb19('0x1f'))['field'](_0xeb19('0x3c'),'scheduledAt')['field']('id',_0xeb19('0x37'))[_0xeb19('0x3b')](LISTID[_0xeb19('0x3d')](),_0xeb19('0x24'))['field'](_0x23a499['id'][_0xeb19('0x3d')](),_0x26fa25)['field']('NOW()','createdAt')['field']('NOW()','updatedAt')[_0xeb19('0x3e')]('cm_contacts')[_0xeb19('0x3f')](_0xeb19('0x40'))[_0xeb19('0x3f')](_0xeb19('0x41'),LISTID[_0xeb19('0x3d')]())[_0xeb19('0x3f')](_0xeb19('0x46'),squel['str'](hopperContacts))[_0xeb19('0x3f')](_0xeb19('0x42'))[_0xeb19('0x3f')](_0xeb19('0x43'),squel['select']()['field'](_0xeb19('0x47'))[_0xeb19('0x3e')]('cm_hopper_final')[_0xeb19('0x3f')](_0x26fa25+_0xeb19('0x45'),_0x23a499['id'][_0xeb19('0x3d')]()))[_0xeb19('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeb19('0x3a')]()[_0xeb19('0x3b')]('phone')['from']('cm_hopper')[_0xeb19('0x3f')](_0x26fa25+_0xeb19('0x45'),_0x23a499['id'][_0xeb19('0x3d')]())))[_0xeb19('0x3d')]();return _0x2e35ff;};function _0x12afc4(_0x32121e,_0x4b1b8a){var _0x321e62=squel[_0xeb19('0x33')]()['into'](_0xeb19('0x44'))[_0xeb19('0x35')](['phone','scheduledAt','ContactId',_0xeb19('0x24'),_0x4b1b8a,_0xeb19('0x38'),_0xeb19('0x39')],squel[_0xeb19('0x3a')]()[_0xeb19('0x3b')](_0xeb19('0x1f'),_0xeb19('0x1f'))[_0xeb19('0x3b')]('NOW()',_0xeb19('0x36'))[_0xeb19('0x3b')]('id','ContactId')[_0xeb19('0x3b')](LISTID['toString'](),_0xeb19('0x24'))[_0xeb19('0x3b')](_0x32121e['id'][_0xeb19('0x3d')](),_0x4b1b8a)[_0xeb19('0x3b')](_0xeb19('0x3c'),_0xeb19('0x38'))[_0xeb19('0x3b')]('NOW()',_0xeb19('0x39'))[_0xeb19('0x3e')](_0xeb19('0x48'))[_0xeb19('0x3f')](_0xeb19('0x40'))[_0xeb19('0x3f')](_0xeb19('0x41'),LISTID[_0xeb19('0x3d')]())[_0xeb19('0x3f')](_0xeb19('0x46'),squel['str'](hopperContacts))[_0xeb19('0x3f')](_0xeb19('0x42')))['toString']();return _0x321e62;}function _0x5c6504(_0xcee03a,_0x2cd44a){var _0x1a9437=squel[_0xeb19('0x33')]()[_0xeb19('0x34')](_0xeb19('0x49'))[_0xeb19('0x35')](['phone',_0xeb19('0x37'),_0xeb19('0x24'),_0x2cd44a,_0xeb19('0x38'),_0xeb19('0x39')],squel[_0xeb19('0x3a')]()['field'](_0xeb19('0x1f'),_0xeb19('0x1f'))[_0xeb19('0x3b')]('id',_0xeb19('0x37'))[_0xeb19('0x3b')](LISTID[_0xeb19('0x3d')](),_0xeb19('0x24'))[_0xeb19('0x3b')](_0xcee03a['id'][_0xeb19('0x3d')](),_0x2cd44a)[_0xeb19('0x3b')](_0xeb19('0x3c'),_0xeb19('0x38'))[_0xeb19('0x3b')](_0xeb19('0x3c'),_0xeb19('0x39'))[_0xeb19('0x3e')]('cm_contacts')['where'](_0xeb19('0x40'))[_0xeb19('0x3f')]('ListId\x20=\x20?',LISTID['toString']())[_0xeb19('0x3f')](_0xeb19('0x46'),squel[_0xeb19('0x4a')](hopperContacts))[_0xeb19('0x3f')](_0xeb19('0x42')))[_0xeb19('0x3d')]();return _0x1a9437;}return db[_0xeb19('0x4b')]['findAll']({'where':{'type':_0xeb19('0x4c')},'attributes':['id',_0xeb19('0x4d')],'include':[{'model':db[_0xeb19('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xeb19('0x2b')](function(_0x302e1c){var _0x2432a5=[];if(_0x302e1c){var _0x2e93db;for(var _0x3e6cdb=0x0,_0x57bb0b;_0x3e6cdb<_0x302e1c['length'];_0x3e6cdb+=0x1){_0x57bb0b=_0x302e1c[_0x3e6cdb]['get']({'plain':!![]});switch(_0x57bb0b[_0xeb19('0x4d')]){case _0xeb19('0x4f'):_0x2432a5[_0xeb19('0x2c')](db[_0xeb19('0x50')][_0xeb19('0x51')](_0x556238(_0x57bb0b,'VoiceQueueId'))[_0xeb19('0x2b')](function(){})[_0xeb19('0x2d')](_0x2c1acb()));break;case'onlyIfOpen':_0x2432a5[_0xeb19('0x2c')](db[_0xeb19('0x50')]['query'](_0x138117(_0x57bb0b,_0xeb19('0x52')))[_0xeb19('0x2b')](function(){})[_0xeb19('0x2d')](_0x2c1acb()));break;default:_0x2432a5[_0xeb19('0x2c')](db[_0xeb19('0x50')]['query'](_0x12afc4(_0x57bb0b,_0xeb19('0x52')))['then'](function(){})[_0xeb19('0x2d')](_0x2c1acb()));}}}return _0x2432a5;})[_0xeb19('0x53')]()[_0xeb19('0x2b')](function(){return db[_0xeb19('0x4b')][_0xeb19('0x54')]({'where':{'type':_0xeb19('0x4c')},'attributes':['id'],'include':[{'model':db[_0xeb19('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xeb19('0x2b')](function(_0x14741a){var _0x3ce213=[];if(_0x14741a){var _0x3a6673;for(var _0xdc1185=0x0,_0x177f49;_0xdc1185<_0x14741a[_0xeb19('0x18')];_0xdc1185+=0x1){_0x177f49=_0x14741a[_0xdc1185][_0xeb19('0x55')]({'plain':!![]});_0x3ce213[_0xeb19('0x2c')](db[_0xeb19('0x50')]['query'](_0x5c6504(_0x177f49,_0xeb19('0x52')))[_0xeb19('0x2b')](function(){})[_0xeb19('0x2d')](_0x2c1acb()));}}return _0x3ce213;})[_0xeb19('0x53')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xeb19('0x4e')],'as':_0xeb19('0x56'),'where':{'id':LISTID}}]})[_0xeb19('0x2b')](function(_0x2b5436){var _0x5127b5=[];if(_0x2b5436){for(var _0x5ed359=0x0,_0x22a376;_0x5ed359<_0x2b5436['length'];_0x5ed359+=0x1){_0x22a376=_0x2b5436[_0x5ed359]['get']({'plain':!![]});switch(_0x22a376['dialCheckDuplicateType']){case _0xeb19('0x4f'):_0x5127b5[_0xeb19('0x2c')](db[_0xeb19('0x50')]['query'](_0x556238(_0x22a376,_0xeb19('0x57')))[_0xeb19('0x2b')](function(){})[_0xeb19('0x2d')](_0x2c1acb()));break;case'onlyIfOpen':_0x5127b5[_0xeb19('0x2c')](db['sequelize'][_0xeb19('0x51')](_0x138117(_0x22a376,_0xeb19('0x57')))[_0xeb19('0x2b')](function(){})['catch'](_0x2c1acb()));break;default:_0x5127b5['push'](db[_0xeb19('0x50')]['query'](_0x12afc4(_0x22a376,_0xeb19('0x57')))[_0xeb19('0x2b')](function(){})['catch'](_0x2c1acb()));}}}return _0x5127b5;})[_0xeb19('0x53')]();})[_0xeb19('0x2b')](function(){return db['Campaign'][_0xeb19('0x54')]({'attributes':['id'],'include':[{'model':db[_0xeb19('0x4e')],'as':_0xeb19('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x3d3069){var _0x15b69c=[];if(_0x3d3069){for(var _0x29830b=0x0,_0x563bef;_0x29830b<_0x3d3069[_0xeb19('0x18')];_0x29830b+=0x1){_0x563bef=_0x3d3069[_0x29830b][_0xeb19('0x55')]({'plain':!![]});_0x15b69c[_0xeb19('0x2c')](db[_0xeb19('0x50')][_0xeb19('0x51')](_0x5c6504(_0x563bef,'CampaignId'))[_0xeb19('0x2b')](function(){})['catch'](_0x2c1acb()));}}return _0x15b69c;})[_0xeb19('0x53')]();})[_0xeb19('0x2d')](function(_0x20d944){logger[_0xeb19('0x13')]('cmContact,\x20%s,\x20%s',_0xeb19('0x59'),_0x20d944['message']);});}var processPromises=function(_0xe3dca7){return BPromise[_0xeb19('0x53')](promises)[_0xeb19('0x2b')](function(_0x4747c4){})[_0xeb19('0x2d')](function(_0x1205b1){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xeb19('0x2f')](_0x1205b1));})[_0xeb19('0x5a')](function(){socket[_0xeb19('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xe3dca7){return _0xe3dca7[_0xeb19('0x5c')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xeb19('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0xeb19('0x2b')](function(){socket[_0xeb19('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xeb19('0x5d')](FILEPATH);}catch(_0xe1d952){logger[_0xeb19('0x13')](_0xeb19('0x5e'),JSON[_0xeb19('0x2f')](_0xe1d952));}finally{process[_0xeb19('0x5f')](0x0);}});};process['on'](_0xeb19('0x60'),function(){logger[_0xeb19('0x61')](_0xeb19('0x62'));endCsv();});function main(){return BPromise['resolve']()[_0xeb19('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xeb19('0x10')](',');return db[_0xeb19('0x28')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xeb19('0x2b')](function(_0x2301b0){var _0x149474=fs[_0xeb19('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xeb19('0x64')](_0x149474,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f0b5b,_0x28ca15){total+=0x1;var _0x105818=total;promises[_0xeb19('0x2c')](checkRow(_0x2f0b5b,_0x2301b0,_0x105818)[_0xeb19('0x2b')](function(){success+=0x1;})[_0xeb19('0x2d')](function(_0x4bae28){if(_0x4bae28[_0xeb19('0x13')]){errors+=0x1;delete _0x4bae28[_0xeb19('0x13')];}else if(_0x4bae28[_0xeb19('0x26')]){duplicates+=0x1;delete _0x4bae28[_0xeb19('0x26')];}rows['push'](_0x4bae28);}));if(total%0xc8===0x0){_0x28ca15['pause']();return processPromises(_0x28ca15);}},'complete':function(){return processPromises()[_0xeb19('0x2b')](function(){logger[_0xeb19('0x61')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x31529a,_0x307269){logger['info'](_0xeb19('0x65'),JSON[_0xeb19('0x2f')](_0x31529a));endCsv();}});})['catch'](function(_0x26c74f){logger[_0xeb19('0x13')](_0xeb19('0x66'),JSON[_0xeb19('0x2f')](_0x26c74f));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 4fa7ff9..2b973c6 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 _0xc16d=['parse','data','length','rows','errors','hasOwnProperty','replace','isValid','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','includes','email','email\x20wrong\x20format','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','CompanyId','isNil','scheduledat','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','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','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','ListId','createdAt','updatedAt','fields','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','into','ContactId','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','\x20=\x20?','concat',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','exit','code','message','sequelize','query','spread','catch','main','stringify','send','start','binding','server/files/tmp','.csv','keys','header','writeFileSync'];(function(_0x46d750,_0x4beee0){var _0x5345d7=function(_0x33e2bf){while(--_0x33e2bf){_0x46d750['push'](_0x46d750['shift']());}};_0x5345d7(++_0x4beee0);}(_0xc16d,0x145));var _0xdc16=function(_0x3e4853,_0x256600){_0x3e4853=_0x3e4853-0x0;var _0x214a19=_0xc16d[_0x3e4853];return _0x214a19;};'use strict';var fs=require('fs');var path=require(_0xdc16('0x0'));var _=require(_0xdc16('0x1'));var Papa=require(_0xdc16('0x2'));var util=require(_0xdc16('0x3'));var BPromise=require(_0xdc16('0x4'));var moment=require(_0xdc16('0x5'));var squel=require(_0xdc16('0x6'));var Redis=require('ioredis');var db=require(_0xdc16('0x7'))['db'];var config=require(_0xdc16('0x8'));var logger=require(_0xdc16('0x9'))(_0xdc16('0xa'));config[_0xdc16('0xb')]=_[_0xdc16('0xc')](config[_0xdc16('0xb')],{'host':_0xdc16('0xd'),'port':0x18eb});var socket=require(_0xdc16('0xe'))(new Redis(config[_0xdc16('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xdc16('0xf')](_0xdc16('0x10'));function isEmail(_0x3f4419){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))*$/[_0xdc16('0x11')](_0x3f4419);}function selectNotIn(_0x368d23,_0x430bdc,_0x4fe432,_0x2c5a8e,_0x425649){return squel[_0xdc16('0x12')]()[_0xdc16('0x13')]('phone')[_0xdc16('0x14')](_0x2c5a8e)[_0xdc16('0x15')](_0x430bdc,null,_0x430bdc+_0xdc16('0x16')+_0x2c5a8e+'.'+_0x4fe432)[_0xdc16('0x17')](_0x2c5a8e+'.'+_0x4fe432+'\x20=\x20'+_0x368d23+'.'+_0x4fe432)[_0xdc16('0x17')](_0x430bdc+'.dialCheckDuplicateType\x20IN\x20('+_0x425649['join']()+')');}function insertCmHopper(_0x440bfe,_0x50d023,_0x12bef5,_0x42b482,_0x1a9f4f){var _0x5677a4=[_0xdc16('0x18'),'cm_contacts.scheduledat',_0xdc16('0x19'),_0xdc16('0x1a'),_0x50d023+'.'+_0x42b482,_0xdc16('0x1b'),_0xdc16('0x1c'),'cm_contacts.priority',_0xdc16('0x1d'),'\x22'+_0x1a9f4f+'\x22'];return squel[_0xdc16('0x1e')]()['into'](_0xdc16('0x1f'))[_0xdc16('0x20')]([_0xdc16('0x21'),'scheduledat','ContactId',_0xdc16('0x22'),_0x42b482,_0xdc16('0x23'),_0xdc16('0x24'),'priority','UserId','recallme'],squel['select']()[_0xdc16('0x25')](_0x5677a4)[_0xdc16('0x14')](_0x50d023)[_0xdc16('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x50d023+'.CmListId')[_0xdc16('0x15')](_0x12bef5,null,_0x12bef5+'.id\x20=\x20'+_0x50d023+'.'+_0x42b482)[_0xdc16('0x17')](_0x50d023+_0xdc16('0x26'),_0x440bfe)[_0xdc16('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xdc16('0x27'),selectNotIn(_0x50d023,_0x12bef5,_0x42b482,_0xdc16('0x1f'),[_0xdc16('0x28'),_0xdc16('0x29')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x50d023,_0x12bef5,_0x42b482,'cm_hopper',[_0xdc16('0x28')])))[_0xdc16('0x2a')]();}function insertCmHopperBlack(_0x14fc27,_0x4964a7,_0x235f78,_0x38ab82){var _0x19d40c=[_0xdc16('0x18'),'cm_contacts.id','cm_contacts.ListId',_0x4964a7+'.'+_0x38ab82,_0xdc16('0x1b'),_0xdc16('0x1c')];return squel['insert']()[_0xdc16('0x2b')]('cm_hopper_black')[_0xdc16('0x20')]([_0xdc16('0x21'),_0xdc16('0x2c'),'ListId',_0x38ab82,_0xdc16('0x23'),_0xdc16('0x24')],squel[_0xdc16('0x12')]()['fields'](_0x19d40c)[_0xdc16('0x14')](_0x4964a7)[_0xdc16('0x15')](_0xdc16('0x2d'),null,'cm_contacts.ListId\x20=\x20'+_0x4964a7+_0xdc16('0x2e'))[_0xdc16('0x15')](_0x235f78,null,_0x235f78+_0xdc16('0x16')+_0x4964a7+'.'+_0x38ab82)[_0xdc16('0x17')](_0x4964a7+_0xdc16('0x26'),_0x14fc27)['where'](_0xdc16('0x2f'),NOW)[_0xdc16('0x17')](_0xdc16('0x27'),squel[_0xdc16('0x12')]()[_0xdc16('0x13')]('phone')[_0xdc16('0x14')](_0xdc16('0x30'))[_0xdc16('0x17')]('ListId\x20=\x20?',_0x14fc27)[_0xdc16('0x17')](_0x38ab82+_0xdc16('0x31'),_0x4964a7+'.'+_0x38ab82)))[_0xdc16('0x2a')]();}function insertCmContact(_0x530c50,_0x78b6cf,_0x5032bb,_0x370c2c){var _0x195811=_[_0xdc16('0x32')](_['keys'](_0x370c2c),['ListId','CompanyId','createdAt',_0xdc16('0x24')]);return squel[_0xdc16('0x1e')]()[_0xdc16('0x2b')](_0xdc16('0x2d'))['fromQuery'](_0x195811,squel[_0xdc16('0x12')]()[_0xdc16('0x25')](_0x195811)[_0xdc16('0x14')](_0x78b6cf)['where']('('+_0x5032bb['join'](',')+_0xdc16('0x33'),squel['select']()[_0xdc16('0x25')](_0x5032bb)[_0xdc16('0x14')](_0xdc16('0x2d'))[_0xdc16('0x17')](_0xdc16('0x34'),_0x530c50)[_0xdc16('0x17')](_0xdc16('0x35')))['where'](_0xdc16('0x36'),squel['select']()['field'](_0xdc16('0x37'),'min_id')['from'](_0x78b6cf)[_0xdc16('0x38')](_0x5032bb[_0xdc16('0x15')](','))))[_0xdc16('0x2a')]();}function handleStop(){logger[_0xdc16('0x39')](_0xdc16('0x3a'));stopped=!![];}function handleUncaughtException(_0x172b77){logger[_0xdc16('0x3b')](_0x172b77['message']);process[_0xdc16('0x3c')](0x1);}function handleError(_0x522ec9,_0x1b6e01){stats['errors']['push']({'name':_0x1b6e01[_0xdc16('0x3d')],'message':_0x1b6e01[_0xdc16('0x3e')],'row':_0x522ec9});}function handleQuery(_0x229792){logger[_0xdc16('0x39')](_0x229792);return db[_0xdc16('0x3f')][_0xdc16('0x40')](_0x229792)[_0xdc16('0x41')](function(_0x4de320){results['push'](_0x4de320);})[_0xdc16('0x42')](function(_0x73090e){logger[_0xdc16('0x3b')](_0x73090e[_0xdc16('0x3e')]);});}function main(_0x14f724,_0x36d7d8,_0xcf6818,_0x3c1b59){logger[_0xdc16('0x39')](_0xdc16('0x43'),_0x14f724,JSON[_0xdc16('0x44')](_0x36d7d8));process[_0xdc16('0x45')](_0xdc16('0x46'));var _0x38c738=_0x36d7d8[_0xdc16('0x47')];var _0xa5e6c8=_0x36d7d8['socket_timestamp'];var _0x21a3d8=path['join'](config['root'],_0xdc16('0x48'),_0xa5e6c8+_0xdc16('0x49'));var _0x16ca3d=_[_0xdc16('0x4a')](_0x38c738)[_0xdc16('0x15')]();logger[_0xdc16('0x39')](_0xdc16('0x4b'),_0x16ca3d);fs[_0xdc16('0x4c')](_0x21a3d8,_0x16ca3d+'\x0a');Papa[_0xdc16('0x4d')](fs['createReadStream'](_0x14f724),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b48a5,_0x9428b6){try{for(var _0x1e998d=0x0,_0x33f50e=[];_0x1e998d<_0x3b48a5[_0xdc16('0x4e')][_0xdc16('0x4f')];_0x1e998d++){stats[_0xdc16('0x50')]+=0x1;if(_0x3b48a5['errors'][_0x1e998d]){handleError(_0x3b48a5[_0xdc16('0x4e')][_0x1e998d],_0x3b48a5[_0xdc16('0x51')][_0x1e998d]);}else{var _0x43e357=[];for(var _0x4f6455 in _0x38c738){if(_0x38c738[_0xdc16('0x52')](_0x4f6455)){if(_0x3b48a5[_0xdc16('0x4e')][_0x1e998d][_0x38c738[_0x4f6455]]){var _0x45af5f=_['trim'](_0x3b48a5[_0xdc16('0x4e')][_0x1e998d][_0x38c738[_0x4f6455]][_0xdc16('0x53')](/"/g,'\x27'));switch(_0x4f6455){case'scheduledat':var _0x3be5ea=moment(_0x45af5f,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3be5ea[_0xdc16('0x54')]()){_0x33f50e[_0xdc16('0x55')]('\x22'+_0x45af5f+'\x22');}else{_0x43e357[_0xdc16('0x55')](_0xdc16('0x56'));}break;case _0xdc16('0x57'):var _0x1ba128=parseInt(_0x45af5f);_0x45af5f=_[_0xdc16('0x58')](_0x1ba128)||_0x1ba128<0x0||_0x1ba128>0x4?_0x3c1b59?0x3:0x2:_0x1ba128;_0x33f50e[_0xdc16('0x55')]('\x22'+_0x45af5f+'\x22');break;case _0xdc16('0x59'):var _0x39abaf=parseInt(_0x45af5f);if(_[_0xdc16('0x5a')](_0x39abaf)&&_[_0xdc16('0x5b')](_0xcf6818,_0x39abaf)){_0x33f50e[_0xdc16('0x55')]('\x22'+_0x39abaf+'\x22');}else{_0x43e357['push']('agent\x20not\x20exists');}break;case _0xdc16('0x5c'):if(isEmail(_0x45af5f)){_0x33f50e[_0xdc16('0x55')]('\x22'+_0x45af5f+'\x22');}else{_0x43e357[_0xdc16('0x55')](_0xdc16('0x5d'));}break;case'dateOfBirth':var _0x566859=moment(_0x45af5f,_0xdc16('0x5e'),!![]);if(_0x566859['isValid']()){_0x33f50e[_0xdc16('0x55')]('\x22'+_0x45af5f+'\x22');}else{_0x43e357[_0xdc16('0x55')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x33f50e[_0xdc16('0x55')]('\x22'+_0x45af5f+'\x22');}}else{switch(_0x4f6455){case _0xdc16('0x5f'):case _0xdc16('0x21'):_0x43e357['push'](_0x4f6455+_0xdc16('0x60'));break;default:_0x33f50e[_0xdc16('0x55')]('\x22\x22');}}}}if(_0x43e357['length']){handleError(_0x3b48a5['data'][_0x1e998d],{'code':_0xdc16('0x61'),'message':_0x43e357[_0xdc16('0x15')]()});}else{fs[_0xdc16('0x62')](_0x21a3d8,_0x33f50e[_0xdc16('0x15')]()+'\x0a');}_0x33f50e=[];}if(!(stats['rows']%0xc8)){socket[_0xdc16('0x63')](_0xdc16('0x64')+_0xa5e6c8,stats);stats[_0xdc16('0x51')]=[];}}if(stopped){logger['info'](_0xdc16('0x65'));_0x9428b6['abort']();}}catch(_0x5a4d32){handleError(_0x3b48a5['data'][_0x1e998d],{'code':_0xdc16('0x66'),'message':_0x5a4d32[_0xdc16('0x3e')]});logger[_0xdc16('0x3b')](_0xdc16('0x67'),_0x5a4d32['message']);}},'complete':function(){try{var _0x10f18c=[];var _0x3b0acd=_0xdc16('0x2d');if(_0x36d7d8[_0xdc16('0x68')]&&_0x36d7d8[_0xdc16('0x68')][_0xdc16('0x4f')]){_0x3b0acd=_0xdc16('0x69')+_0xa5e6c8;_0x10f18c[_0xdc16('0x55')](_0xdc16('0x6a')+_0x3b0acd+'\x20LIKE\x20cm_contacts;');}var _0xe5371d=util[_0xdc16('0xf')]('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',_0x21a3d8,_0x3b0acd,_0x16ca3d,_0x36d7d8[_0xdc16('0x22')],_0x36d7d8[_0xdc16('0x6b')]||null,NOW,NOW);if(_[_0xdc16('0x6c')](_0x38c738[_0xdc16('0x6d')])){_0xe5371d+=',\x20scheduledAt\x20=\x20NOW()';}_0x10f18c['push'](_0xe5371d);if(_0x36d7d8[_0xdc16('0x68')]&&_0x36d7d8[_0xdc16('0x68')][_0xdc16('0x4f')]){_0x10f18c['push'](insertCmContact(_0x36d7d8[_0xdc16('0x22')],_0x3b0acd,_0x36d7d8['duplicates'],_0x38c738));_0x10f18c[_0xdc16('0x55')](_0xdc16('0x6e')+_0x3b0acd+';');}_0x10f18c['push'](insertCmHopper(_0x36d7d8['ListId'],'voice_queues_has_cm_lists',_0xdc16('0x6f'),_0xdc16('0x70'),_0x3c1b59));_0x10f18c[_0xdc16('0x55')](insertCmHopperBlack(_0x36d7d8['ListId'],'voice_queues_has_cm_blacklists','voice_queues',_0xdc16('0x70')));_0x10f18c[_0xdc16('0x55')](insertCmHopper(_0x36d7d8['ListId'],'campaigns_has_cm_lists',_0xdc16('0x71'),_0xdc16('0x72'),_0x3c1b59));_0x10f18c[_0xdc16('0x55')](insertCmHopperBlack(_0x36d7d8['ListId'],_0xdc16('0x73'),_0xdc16('0x71'),'CampaignId'));BPromise[_0xdc16('0x74')](_0x10f18c,handleQuery)['then'](function(_0x1f5b7a){stats[_0xdc16('0x75')]=!![];stats[_0xdc16('0x76')]=_0x36d7d8['duplicates']&&_0x36d7d8[_0xdc16('0x68')]['length']?results[0x2][_0xdc16('0x76')]:results[0x0][_0xdc16('0x76')];socket[_0xdc16('0x63')]('contact:import:'+_0xa5e6c8,stats);fs[_0xdc16('0x77')](_0x14f724);fs[_0xdc16('0x77')](_0x21a3d8);process[_0xdc16('0x3c')](0x0);})['catch'](function(_0x3bd55f){logger[_0xdc16('0x3b')](_0x3bd55f['message']);process[_0xdc16('0x3c')](0x1);});}catch(_0x4c8cef){logger['error'](_0xdc16('0x78'),_0x4c8cef['message']);process['exit'](0x1);}},'error':function(_0x3a5a77,_0x368d34,_0x37088f,_0x409a9e){throw new Error(_0x409a9e);}});}function validate(){if(process[_0xdc16('0x79')]&&process[_0xdc16('0x79')][_0xdc16('0x4f')]<0x4){throw new Error(_0xdc16('0x7a'));}var _0x7c3d75=path['join'](config[_0xdc16('0x7b')],_0xdc16('0x48'),process[_0xdc16('0x79')][0x2]);if(!fs['existsSync'](_0x7c3d75)){throw new Error(_0xdc16('0x7c'));}var _0x5f09be={};try{_0x5f09be=JSON[_0xdc16('0x4d')](process[_0xdc16('0x79')][0x3]);if(!_0x5f09be['binding']){throw new Error(_0xdc16('0x7d'));}if(!_0x5f09be['binding']['phone']){throw new Error(_0xdc16('0x7e'));}if(!_0x5f09be['binding'][_0xdc16('0x5f')]){throw new Error(_0xdc16('0x7f'));}var _0xe5eb4d=0x0;if(_0x5f09be[_0xdc16('0x47')][_0xdc16('0x59')]){_0xe5eb4d=0x1;}if(!_0x5f09be[_0xdc16('0x22')]){throw new Error(_0xdc16('0x80'));}}catch(_0x46ce3b){throw new Error(_0xdc16('0x81'));}var _0x4e40c9=[];try{_0x4e40c9=_[_0xdc16('0x82')](JSON[_0xdc16('0x4d')](process[_0xdc16('0x79')][0x4]),'id');}catch(_0x437e01){logger[_0xdc16('0x39')](_0xdc16('0x83'));}main(_0x7c3d75,_0x5f09be,_0x4e40c9,_0xe5eb4d);}validate();process['on'](_0xdc16('0x84'),handleStop);process['on'](_0xdc16('0x85'),handleUncaughtException); \ No newline at end of file +var _0x2b87=['where','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','fromQuery','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','push','query','spread','catch','error','main','stringify','send','start','binding','socket_timestamp','header','writeFileSync','createReadStream','length','data','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','complete','argv','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20'];(function(_0x233282,_0x305444){var _0x387f16=function(_0x41fa17){while(--_0x41fa17){_0x233282['push'](_0x233282['shift']());}};_0x387f16(++_0x305444);}(_0x2b87,0x72));var _0x72b8=function(_0x2b9629,_0x3bfa7a){_0x2b9629=_0x2b9629-0x0;var _0x3c38d8=_0x2b87[_0x2b9629];return _0x3c38d8;};'use strict';var fs=require('fs');var path=require(_0x72b8('0x0'));var _=require(_0x72b8('0x1'));var Papa=require(_0x72b8('0x2'));var util=require(_0x72b8('0x3'));var BPromise=require('bluebird');var moment=require(_0x72b8('0x4'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x72b8('0x5'))['db'];var config=require(_0x72b8('0x6'));var logger=require(_0x72b8('0x7'))('import');config[_0x72b8('0x8')]=_[_0x72b8('0x9')](config[_0x72b8('0x8')],{'host':_0x72b8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72b8('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x72b8('0xb')](_0x72b8('0xc'));function isEmail(_0x4340f7){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))*$/[_0x72b8('0xd')](_0x4340f7);}function selectNotIn(_0xe22e2f,_0x3c3a73,_0x48093b,_0x37a350,_0x1bdf39){return squel[_0x72b8('0xe')]()[_0x72b8('0xf')](_0x72b8('0x10'))[_0x72b8('0x11')](_0x37a350)['join'](_0x3c3a73,null,_0x3c3a73+_0x72b8('0x12')+_0x37a350+'.'+_0x48093b)['where'](_0x37a350+'.'+_0x48093b+_0x72b8('0x13')+_0xe22e2f+'.'+_0x48093b)[_0x72b8('0x14')](_0x3c3a73+'.dialCheckDuplicateType\x20IN\x20('+_0x1bdf39[_0x72b8('0x15')]()+')');}function insertCmHopper(_0x24ecc5,_0x1f1bc8,_0x15a9df,_0x38e332,_0x3ed068){var _0x2dcd49=[_0x72b8('0x16'),_0x72b8('0x17'),_0x72b8('0x18'),_0x72b8('0x19'),_0x1f1bc8+'.'+_0x38e332,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x72b8('0x1a'),'cm_contacts.UserId','\x22'+_0x3ed068+'\x22'];return squel[_0x72b8('0x1b')]()[_0x72b8('0x1c')](_0x72b8('0x1d'))['fromQuery']([_0x72b8('0x10'),_0x72b8('0x1e'),_0x72b8('0x1f'),_0x72b8('0x20'),_0x38e332,_0x72b8('0x21'),_0x72b8('0x22'),_0x72b8('0x23'),_0x72b8('0x24'),_0x72b8('0x25')],squel[_0x72b8('0xe')]()[_0x72b8('0x26')](_0x2dcd49)[_0x72b8('0x11')](_0x1f1bc8)[_0x72b8('0x15')](_0x72b8('0x27'),null,_0x72b8('0x28')+_0x1f1bc8+_0x72b8('0x29'))['join'](_0x15a9df,null,_0x15a9df+_0x72b8('0x12')+_0x1f1bc8+'.'+_0x38e332)[_0x72b8('0x14')](_0x1f1bc8+_0x72b8('0x2a'),_0x24ecc5)[_0x72b8('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x72b8('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1f1bc8,_0x15a9df,_0x38e332,_0x72b8('0x1d'),[_0x72b8('0x2b'),_0x72b8('0x2c')]))['where'](_0x72b8('0x2d'),selectNotIn(_0x1f1bc8,_0x15a9df,_0x38e332,_0x72b8('0x1d'),[_0x72b8('0x2b')])))[_0x72b8('0x2e')]();}function insertCmHopperBlack(_0x526887,_0x5637fb,_0x5b62af,_0x4edd6c){var _0x172827=[_0x72b8('0x16'),'cm_contacts.id',_0x72b8('0x19'),_0x5637fb+'.'+_0x4edd6c,_0x72b8('0x2f'),_0x72b8('0x30')];return squel['insert']()[_0x72b8('0x1c')]('cm_hopper_black')['fromQuery']([_0x72b8('0x10'),_0x72b8('0x1f'),_0x72b8('0x20'),_0x4edd6c,_0x72b8('0x21'),_0x72b8('0x22')],squel['select']()[_0x72b8('0x26')](_0x172827)[_0x72b8('0x11')](_0x5637fb)[_0x72b8('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x5637fb+_0x72b8('0x29'))['join'](_0x5b62af,null,_0x5b62af+_0x72b8('0x12')+_0x5637fb+'.'+_0x4edd6c)['where'](_0x5637fb+_0x72b8('0x2a'),_0x526887)['where'](_0x72b8('0x31'),NOW)[_0x72b8('0x14')](_0x72b8('0x2d'),squel['select']()[_0x72b8('0xf')](_0x72b8('0x10'))[_0x72b8('0x11')](_0x72b8('0x32'))['where'](_0x72b8('0x33'),_0x526887)[_0x72b8('0x14')](_0x4edd6c+_0x72b8('0x34'),_0x5637fb+'.'+_0x4edd6c)))[_0x72b8('0x2e')]();}function insertCmContact(_0x1f2c77,_0x2efca4,_0x2c96eb,_0x54b26a){var _0x2b4ccb=_[_0x72b8('0x35')](_[_0x72b8('0x36')](_0x54b26a),[_0x72b8('0x20'),_0x72b8('0x37'),_0x72b8('0x21'),_0x72b8('0x22')]);return squel[_0x72b8('0x1b')]()[_0x72b8('0x1c')](_0x72b8('0x27'))[_0x72b8('0x38')](_0x2b4ccb,squel['select']()[_0x72b8('0x26')](_0x2b4ccb)[_0x72b8('0x11')](_0x2efca4)[_0x72b8('0x14')]('('+_0x2c96eb[_0x72b8('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0x72b8('0xe')]()[_0x72b8('0x26')](_0x2c96eb)[_0x72b8('0x11')](_0x72b8('0x27'))['where'](_0x72b8('0x33'),_0x1f2c77)[_0x72b8('0x14')]('deletedAt\x20IS\x20NULL'))[_0x72b8('0x14')](_0x72b8('0x39'),squel[_0x72b8('0xe')]()['field'](_0x72b8('0x3a'),_0x72b8('0x3b'))['from'](_0x2efca4)[_0x72b8('0x3c')](_0x2c96eb['join'](','))))[_0x72b8('0x2e')]();}function handleStop(){logger[_0x72b8('0x3d')](_0x72b8('0x3e'));stopped=!![];}function handleUncaughtException(_0x27cad2){logger['error'](_0x27cad2[_0x72b8('0x3f')]);process[_0x72b8('0x40')](0x1);}function handleError(_0x54883c,_0x913fd6){stats[_0x72b8('0x41')][_0x72b8('0x42')]({'name':_0x913fd6['code'],'message':_0x913fd6[_0x72b8('0x3f')],'row':_0x54883c});}function handleQuery(_0x435cad){logger[_0x72b8('0x3d')](_0x435cad);return db['sequelize'][_0x72b8('0x43')](_0x435cad)[_0x72b8('0x44')](function(_0x535e9d){results[_0x72b8('0x42')](_0x535e9d);})[_0x72b8('0x45')](function(_0x8c355c){logger[_0x72b8('0x46')](_0x8c355c[_0x72b8('0x3f')]);});}function main(_0x56d95a,_0xc027f3,_0x5542d5,_0x2eb3b1){logger[_0x72b8('0x3d')](_0x72b8('0x47'),_0x56d95a,JSON[_0x72b8('0x48')](_0xc027f3));process[_0x72b8('0x49')](_0x72b8('0x4a'));var _0x3ecf51=_0xc027f3[_0x72b8('0x4b')];var _0x2c295b=_0xc027f3[_0x72b8('0x4c')];var _0x2119d4=path['join'](config['root'],'server/files/tmp',_0x2c295b+'.csv');var _0x1a925b=_[_0x72b8('0x36')](_0x3ecf51)['join']();logger[_0x72b8('0x3d')](_0x72b8('0x4d'),_0x1a925b);fs[_0x72b8('0x4e')](_0x2119d4,_0x1a925b+'\x0a');Papa['parse'](fs[_0x72b8('0x4f')](_0x56d95a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36a55d,_0x158483){try{for(var _0x162387=0x0,_0x59f262=[];_0x162387<_0x36a55d['data'][_0x72b8('0x50')];_0x162387++){stats['rows']+=0x1;if(_0x36a55d[_0x72b8('0x41')][_0x162387]){handleError(_0x36a55d[_0x72b8('0x51')][_0x162387],_0x36a55d[_0x72b8('0x41')][_0x162387]);}else{var _0x407ec2=[];for(var _0x3f84a3 in _0x3ecf51){if(_0x3ecf51['hasOwnProperty'](_0x3f84a3)){if(_0x36a55d[_0x72b8('0x51')][_0x162387][_0x3ecf51[_0x3f84a3]]){var _0x579913=_[_0x72b8('0x52')](_0x36a55d[_0x72b8('0x51')][_0x162387][_0x3ecf51[_0x3f84a3]]['replace'](/"/g,'\x27'));switch(_0x3f84a3){case _0x72b8('0x1e'):var _0x3e4b0c=moment(_0x579913,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3e4b0c['isValid']()){_0x59f262[_0x72b8('0x42')]('\x22'+_0x579913+'\x22');}else{_0x407ec2[_0x72b8('0x42')](_0x72b8('0x53'));}break;case'priority':var _0x15d6cf=parseInt(_0x579913);_0x579913=_[_0x72b8('0x54')](_0x15d6cf)||_0x15d6cf<0x0||_0x15d6cf>0x4?_0x2eb3b1?0x3:0x2:_0x15d6cf;_0x59f262[_0x72b8('0x42')]('\x22'+_0x579913+'\x22');break;case _0x72b8('0x24'):var _0x2264d4=parseInt(_0x579913);if(_[_0x72b8('0x55')](_0x2264d4)&&_[_0x72b8('0x56')](_0x5542d5,_0x2264d4)){_0x59f262[_0x72b8('0x42')]('\x22'+_0x2264d4+'\x22');}else{_0x407ec2[_0x72b8('0x42')](_0x72b8('0x57'));}break;case _0x72b8('0x58'):if(isEmail(_0x579913)){_0x59f262[_0x72b8('0x42')]('\x22'+_0x579913+'\x22');}else{_0x407ec2[_0x72b8('0x42')](_0x72b8('0x59'));}break;case'dateOfBirth':var _0x2311db=moment(_0x579913,_0x72b8('0x5a'),!![]);if(_0x2311db[_0x72b8('0x5b')]()){_0x59f262[_0x72b8('0x42')]('\x22'+_0x579913+'\x22');}else{_0x407ec2[_0x72b8('0x42')](_0x72b8('0x5c'));}break;default:_0x59f262[_0x72b8('0x42')]('\x22'+_0x579913+'\x22');}}else{switch(_0x3f84a3){case _0x72b8('0x5d'):case _0x72b8('0x10'):_0x407ec2[_0x72b8('0x42')](_0x3f84a3+'\x20not\x20specified');break;default:_0x59f262[_0x72b8('0x42')]('\x22\x22');}}}}if(_0x407ec2[_0x72b8('0x50')]){handleError(_0x36a55d['data'][_0x162387],{'code':'SystemRow','message':_0x407ec2[_0x72b8('0x15')]()});}else{fs[_0x72b8('0x5e')](_0x2119d4,_0x59f262[_0x72b8('0x15')]()+'\x0a');}_0x59f262=[];}if(!(stats['rows']%0xc8)){socket[_0x72b8('0x5f')](_0x72b8('0x60')+_0x2c295b,stats);stats[_0x72b8('0x41')]=[];}}if(stopped){logger['info'](_0x72b8('0x61'));_0x158483[_0x72b8('0x62')]();}}catch(_0x1844b7){handleError(_0x36a55d['data'][_0x162387],{'code':_0x72b8('0x63'),'message':_0x1844b7[_0x72b8('0x3f')]});logger[_0x72b8('0x46')](_0x72b8('0x64'),_0x1844b7[_0x72b8('0x3f')]);}},'complete':function(){try{var _0x379557=[];var _0x1c2702='cm_contacts';if(_0xc027f3[_0x72b8('0x65')]&&_0xc027f3[_0x72b8('0x65')][_0x72b8('0x50')]){_0x1c2702='cm_contacts_'+_0x2c295b;_0x379557['push'](_0x72b8('0x66')+_0x1c2702+_0x72b8('0x67'));}var _0x3cf0a4=util[_0x72b8('0xb')](_0x72b8('0x68'),_0x2119d4,_0x1c2702,_0x1a925b,_0xc027f3[_0x72b8('0x20')],_0xc027f3['CompanyId']||null,NOW,NOW);if(_[_0x72b8('0x69')](_0x3ecf51[_0x72b8('0x1e')])){_0x3cf0a4+=_0x72b8('0x6a');}_0x379557[_0x72b8('0x42')](_0x3cf0a4);if(_0xc027f3[_0x72b8('0x65')]&&_0xc027f3[_0x72b8('0x65')][_0x72b8('0x50')]){_0x379557[_0x72b8('0x42')](insertCmContact(_0xc027f3[_0x72b8('0x20')],_0x1c2702,_0xc027f3['duplicates'],_0x3ecf51));_0x379557[_0x72b8('0x42')](_0x72b8('0x6b')+_0x1c2702+';');}_0x379557['push'](insertCmHopper(_0xc027f3[_0x72b8('0x20')],_0x72b8('0x6c'),_0x72b8('0x6d'),_0x72b8('0x6e'),_0x2eb3b1));_0x379557['push'](insertCmHopperBlack(_0xc027f3[_0x72b8('0x20')],_0x72b8('0x6f'),_0x72b8('0x6d'),_0x72b8('0x6e')));_0x379557[_0x72b8('0x42')](insertCmHopper(_0xc027f3[_0x72b8('0x20')],_0x72b8('0x70'),_0x72b8('0x71'),_0x72b8('0x72'),_0x2eb3b1));_0x379557['push'](insertCmHopperBlack(_0xc027f3[_0x72b8('0x20')],_0x72b8('0x73'),_0x72b8('0x71'),'CampaignId'));BPromise[_0x72b8('0x74')](_0x379557,handleQuery)[_0x72b8('0x75')](function(_0x4a74f6){stats['finish']=!![];stats[_0x72b8('0x76')]=_0xc027f3[_0x72b8('0x65')]&&_0xc027f3[_0x72b8('0x65')][_0x72b8('0x50')]?results[0x2][_0x72b8('0x76')]:results[0x0][_0x72b8('0x76')];socket[_0x72b8('0x5f')](_0x72b8('0x60')+_0x2c295b,stats);fs[_0x72b8('0x77')](_0x56d95a);fs['unlink'](_0x2119d4);process['exit'](0x0);})[_0x72b8('0x45')](function(_0x5bf708){logger[_0x72b8('0x46')](_0x5bf708[_0x72b8('0x3f')]);process[_0x72b8('0x40')](0x1);});}catch(_0x4f0914){logger[_0x72b8('0x46')](_0x72b8('0x78'),_0x4f0914[_0x72b8('0x3f')]);process['exit'](0x1);}},'error':function(_0x3f72bf,_0x559aac,_0x14e031,_0x1f75d1){throw new Error(_0x1f75d1);}});}function validate(){if(process['argv']&&process[_0x72b8('0x79')][_0x72b8('0x50')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x1bfb49=path[_0x72b8('0x15')](config[_0x72b8('0x7a')],_0x72b8('0x7b'),process['argv'][0x2]);if(!fs[_0x72b8('0x7c')](_0x1bfb49)){throw new Error(_0x72b8('0x7d'));}var _0x5ad5ef={};try{_0x5ad5ef=JSON[_0x72b8('0x7e')](process[_0x72b8('0x79')][0x3]);if(!_0x5ad5ef[_0x72b8('0x4b')]){throw new Error(_0x72b8('0x7f'));}if(!_0x5ad5ef[_0x72b8('0x4b')][_0x72b8('0x10')]){throw new Error(_0x72b8('0x80'));}if(!_0x5ad5ef[_0x72b8('0x4b')][_0x72b8('0x5d')]){throw new Error('firstName\x20is\x20mandatory');}var _0x35a8a9=0x0;if(_0x5ad5ef['binding'][_0x72b8('0x24')]){_0x35a8a9=0x1;}if(!_0x5ad5ef[_0x72b8('0x20')]){throw new Error(_0x72b8('0x81'));}}catch(_0x3784b4){throw new Error(_0x72b8('0x82'));}var _0x4cf372=[];try{_0x4cf372=_[_0x72b8('0x83')](JSON[_0x72b8('0x7e')](process[_0x72b8('0x79')][0x4]),'id');}catch(_0x37e3af){logger[_0x72b8('0x3d')](_0x72b8('0x84'));}main(_0x1bfb49,_0x5ad5ef,_0x4cf372,_0x35a8a9);}validate();process['on'](_0x72b8('0x85'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 71b1bb0..79bae7b 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 _0xd3db=['Called\x20Number','Member\x20Name','membername','uniqueid','Date','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','inbound','Caller\x20Number','keyValue','Caller\x20Name','calleridname','destexten','Queue','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***'];(function(_0x21cf85,_0x3ebaba){var _0x2f79bd=function(_0x4689e8){while(--_0x4689e8){_0x21cf85['push'](_0x21cf85['shift']());}};_0x2f79bd(++_0x3ebaba);}(_0xd3db,0xcc));var _0xbd3d=function(_0x5b8068,_0x3d3db2){_0x5b8068=_0x5b8068-0x0;var _0x5b750e=_0xd3db[_0x5b8068];return _0x5b750e;};'use strict';exports[_0xbd3d('0x0')]=function(_0xd5a2a0,_0x4dd917){var _0x5612a7=[{'type':_0xbd3d('0x1'),'content':_0xbd3d('0x2'),'variableName':null}];switch(_0xd5a2a0[_0xbd3d('0x3')]()){case'voice':switch(_0x4dd917[_0xbd3d('0x3')]()){case'inbound':_0x5612a7['push']({'type':_0xbd3d('0x4'),'content':'','variableName':_0xbd3d('0x5')});_0x5612a7[_0xbd3d('0x6')]({'type':_0xbd3d('0x4'),'content':'','variableName':_0xbd3d('0x7')});break;case _0xbd3d('0x8'):_0x5612a7[_0xbd3d('0x6')]({'type':_0xbd3d('0x1'),'content':_0xbd3d('0x9'),'variableName':null});_0x5612a7['push']({'type':'variable','content':'','variableName':_0xbd3d('0xa')});break;}}return _0x5612a7;};exports[_0xbd3d('0xb')]=function(_0x3c22f1,_0x5f149a){var _0x593f1d=[];switch(_0x3c22f1[_0xbd3d('0x3')]()){case _0xbd3d('0xc'):switch(_0x5f149a['toLowerCase']()){case _0xbd3d('0xd'):_0x593f1d=[{'type':_0xbd3d('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xbd3d('0xe'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x10'),'keyType':_0xbd3d('0x4'),'variableName':_0xbd3d('0x11')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':'variable','variableName':_0xbd3d('0x12')},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x13'),'keyType':'variable','variableName':_0xbd3d('0x5')},{'type':'keyValue','content':'','key':_0xbd3d('0x14'),'keyType':'variable','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0xbd3d('0x4'),'variableName':_0xbd3d('0x15')},{'type':_0xbd3d('0x1'),'content':_0xbd3d('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xbd3d('0x17'),'keyType':'variable','variableName':_0xbd3d('0x18')},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x19'),'keyType':_0xbd3d('0x4'),'variableName':_0xbd3d('0xa')},{'type':'string','content':_0xbd3d('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x1b'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xbd3d('0xf'),'content':'','key':'Agent\x20Connect','keyType':_0xbd3d('0x4'),'variableName':_0xbd3d('0x1c')},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x1d'),'keyType':_0xbd3d('0x4'),'variableName':_0xbd3d('0x1e')},{'type':'keyValue','content':'','key':_0xbd3d('0x1f'),'keyType':_0xbd3d('0x4'),'variableName':_0xbd3d('0x20')},{'type':'keyValue','content':'','key':_0xbd3d('0x21'),'keyType':'variable','variableName':_0xbd3d('0x22')}];break;case _0xbd3d('0x8'):_0x593f1d=[{'type':'string','content':_0xbd3d('0x23'),'variableName':null},{'type':'keyValue','content':'','key':_0xbd3d('0x24'),'keyType':'variable','keyContent':'','variableName':_0xbd3d('0xa')},{'type':'keyValue','content':'','key':_0xbd3d('0x25'),'keyType':'variable','keyContent':'','variableName':_0xbd3d('0x26')},{'type':'keyValue','content':'','key':_0xbd3d('0x14'),'keyType':_0xbd3d('0x4'),'keyContent':'','variableName':_0xbd3d('0x27')},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x28'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xbd3d('0x1'),'content':_0xbd3d('0x1a')},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x29'),'keyType':_0xbd3d('0x4'),'keyContent':'','variableName':_0xbd3d('0x2a')},{'type':'keyValue','content':'','key':_0xbd3d('0x2b'),'keyType':_0xbd3d('0x4'),'keyContent':'','variableName':'endtime'},{'type':_0xbd3d('0xf'),'content':'','key':_0xbd3d('0x2c'),'keyType':_0xbd3d('0x4'),'keyContent':'','variableName':_0xbd3d('0x2d')},{'type':'keyValue','content':'','key':_0xbd3d('0x2e'),'keyType':_0xbd3d('0x4'),'keyContent':'','variableName':_0xbd3d('0x2f')}];break;}}return _0x593f1d;}; \ No newline at end of file +var _0xece6=['push','variable','queue','calleridnum','outbound','destcalleridnum','getDescriptions','voice','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','talktime','***\x20Call\x20Info\x20***','Member\x20Name','starttime','answertime','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0xece6,0xe6));var _0x6ece=function(_0x1e8c2b,_0x159984){_0x1e8c2b=_0x1e8c2b-0x0;var _0x297044=_0xece6[_0x1e8c2b];return _0x297044;};'use strict';exports[_0x6ece('0x0')]=function(_0x5be6c7,_0x37efc5){var _0x42d2fe=[{'type':_0x6ece('0x1'),'content':_0x6ece('0x2'),'variableName':null}];switch(_0x5be6c7[_0x6ece('0x3')]()){case'voice':switch(_0x37efc5[_0x6ece('0x3')]()){case'inbound':_0x42d2fe[_0x6ece('0x4')]({'type':_0x6ece('0x5'),'content':'','variableName':_0x6ece('0x6')});_0x42d2fe[_0x6ece('0x4')]({'type':_0x6ece('0x5'),'content':'','variableName':_0x6ece('0x7')});break;case _0x6ece('0x8'):_0x42d2fe['push']({'type':_0x6ece('0x1'),'content':'Outbound\x20Call','variableName':null});_0x42d2fe[_0x6ece('0x4')]({'type':_0x6ece('0x5'),'content':'','variableName':_0x6ece('0x9')});break;}}return _0x42d2fe;};exports[_0x6ece('0xa')]=function(_0x4bc8fb,_0x3ca584){var _0x5aea03=[];switch(_0x4bc8fb['toLowerCase']()){case _0x6ece('0xb'):switch(_0x3ca584['toLowerCase']()){case'inbound':_0x5aea03=[{'type':_0x6ece('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x6ece('0xc'),'keyType':_0x6ece('0x5'),'variableName':'calleridnum'},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0xe'),'keyType':_0x6ece('0x5'),'variableName':_0x6ece('0xf')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x10'),'keyType':'variable','variableName':'destexten'},{'type':'keyValue','content':'','key':_0x6ece('0x11'),'keyType':'variable','variableName':_0x6ece('0x6')},{'type':'keyValue','content':'','key':_0x6ece('0x12'),'keyType':'variable','variableName':_0x6ece('0x13')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x14'),'keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x15')},{'type':_0x6ece('0x1'),'content':_0x6ece('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x17')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x18'),'keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x9')},{'type':_0x6ece('0x1'),'content':_0x6ece('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x1a'),'keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x15')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x1b')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x1c')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x1d'),'keyType':_0x6ece('0x5'),'variableName':'holdtime'},{'type':_0x6ece('0xd'),'content':'','key':'Talk\x20Time','keyType':_0x6ece('0x5'),'variableName':_0x6ece('0x1e')}];break;case'outbound':_0x5aea03=[{'type':_0x6ece('0x1'),'content':_0x6ece('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0x6ece('0x5'),'keyContent':'','variableName':_0x6ece('0x9')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x20'),'keyType':_0x6ece('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x6ece('0xd'),'content':'','key':'UniqueId','keyType':_0x6ece('0x5'),'keyContent':'','variableName':_0x6ece('0x13')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x14'),'keyType':_0x6ece('0x5'),'keyContent':'','variableName':_0x6ece('0x21')},{'type':'string','content':_0x6ece('0x19')},{'type':_0x6ece('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x6ece('0x22')},{'type':_0x6ece('0xd'),'content':'','key':_0x6ece('0x23'),'keyType':_0x6ece('0x5'),'keyContent':'','variableName':_0x6ece('0x24')},{'type':_0x6ece('0xd'),'content':'','key':'Duration','keyType':_0x6ece('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0x6ece('0x25'),'keyType':_0x6ece('0x5'),'keyContent':'','variableName':_0x6ece('0x26')}];break;}}return _0x5aea03;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index f4628c3..90a7091 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 _0x5e7c=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','body','omit','html','phone','fax','lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId'];(function(_0x21b538,_0x2a7517){var _0xbfff37=function(_0x362f9f){while(--_0x362f9f){_0x21b538['push'](_0x21b538['shift']());}};_0xbfff37(++_0x2a7517);}(_0x5e7c,0x92));var _0xc5e7=function(_0xe1b390,_0x898827){_0xe1b390=_0xe1b390-0x0;var _0x3619e7=_0x5e7c[_0xe1b390];return _0x3619e7;};'use strict';var _=require(_0xc5e7('0x0'));var db=require(_0xc5e7('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xc5e7('0x2')),'mail':require(_0xc5e7('0x3'))('mail-interactions'),'fax':require(_0xc5e7('0x3'))('fax-interactions'),'sms':require(_0xc5e7('0x3'))(_0xc5e7('0x4')),'chat':require(_0xc5e7('0x3'))(_0xc5e7('0x5')),'whatsapp':require(_0xc5e7('0x3'))(_0xc5e7('0x6'))};function getInteractionId(_0x19a49a,_0x324411,_0xffc1fe){if(_0x19a49a&&_0x19a49a[_[_0xc5e7('0x7')](_0xffc1fe)+_0xc5e7('0x8')]){return _0x19a49a[_[_0xc5e7('0x7')](_0xffc1fe)+_0xc5e7('0x8')];}else if(_0x19a49a&&_0x19a49a['id']){return _0x19a49a['id'];}else if(_0x324411&&_0x324411['id']){return _0x324411['id'];}else{return _0xc5e7('0x9');}}function log(_0x3a963c,_0x3df139,_0x567243,_0x599b05,_0x5c3b8a,_0x451671){loggers[_0x5c3b8a[_0xc5e7('0xa')]()][_0x3a963c](_0xc5e7('0xb'),_0x451671[_0xc5e7('0xc')](),_0x3df139?_0x3df139['id']:null,_0x3df139?_0x3df139[_0xc5e7('0xd')]:null,_0x3df139?_0x3df139['role']:null,getInteractionId(_0x567243,_0x599b05,_0x5c3b8a),_0x567243?JSON[_0xc5e7('0xe')](_0x567243):_0xc5e7('0xf'));}function updateUser(_0xe046e2,_0x511faa,_0x36b5ea,_0x4288e7,_0x2929e1){db[_[_0xc5e7('0x7')](_0x4288e7)+_0xc5e7('0x10')][_0xc5e7('0x11')]({'where':{'id':getInteractionId(_0x511faa,_0x36b5ea,_0x4288e7)}})[_0xc5e7('0x12')](function(_0x55a92f){if(_0x55a92f){return _0x55a92f[_0xc5e7('0x13')]({'UserId':_0xe046e2?_0xe046e2['id']:null});}})[_0xc5e7('0x12')](function(_0x10aa85){if(_0x10aa85){log(_0xc5e7('0x14'),_0xe046e2,_0x511faa,_0x36b5ea,_0x4288e7,_0x2929e1);}})[_0xc5e7('0x15')](function(){log(_0xc5e7('0x16'),_0xe046e2,_0x511faa,_0x36b5ea,_0x4288e7,_0x2929e1);});}exports[_0xc5e7('0x17')]=function(_0x56a714,_0x260cb5){return function(_0x240009,_0x2032d0,_0x291b47){var _0x2f4540=_0x240009[_0xc5e7('0x18')];var _0x3f68fc={};var _0x45067e=_0x240009[_0xc5e7('0x19')];if(_0x3f68fc){_0x3f68fc=_['clone'](_0x240009[_0xc5e7('0x1a')]);_0x3f68fc=_[_0xc5e7('0x1b')](_0x3f68fc,[_0xc5e7('0x1a'),_0xc5e7('0x1c'),_0xc5e7('0x1d'),_0xc5e7('0x1e'),'mobile']);}updateUser(_0x2f4540,_0x3f68fc,_0x45067e,_0x56a714,_0x260cb5);_0x291b47(null);};}; \ No newline at end of file +var _0x3469=['findOne','then','update','info','error','tracked','user','clone','body','html','phone','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','null','Interaction'];(function(_0x5edbdc,_0x5d7c6b){var _0x1230c2=function(_0x56bf9b){while(--_0x56bf9b){_0x5edbdc['push'](_0x5edbdc['shift']());}};_0x1230c2(++_0x5d7c6b);}(_0x3469,0x8e));var _0x9346=function(_0x2691e7,_0x172dba){_0x2691e7=_0x2691e7-0x0;var _0x5e5fcc=_0x3469[_0x2691e7];return _0x5e5fcc;};'use strict';var _=require(_0x9346('0x0'));var db=require(_0x9346('0x1'))['db'];var loggers={'openchannel':require(_0x9346('0x2'))('openchannel-interactions'),'mail':require(_0x9346('0x2'))(_0x9346('0x3')),'fax':require('../../config/logger')(_0x9346('0x4')),'sms':require(_0x9346('0x2'))(_0x9346('0x5')),'chat':require('../../config/logger')(_0x9346('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x2c9d61,_0x25c1ec,_0x50d70b){if(_0x2c9d61&&_0x2c9d61[_['upperFirst'](_0x50d70b)+'InteractionId']){return _0x2c9d61[_[_0x9346('0x7')](_0x50d70b)+'InteractionId'];}else if(_0x2c9d61&&_0x2c9d61['id']){return _0x2c9d61['id'];}else if(_0x25c1ec&&_0x25c1ec['id']){return _0x25c1ec['id'];}else{return'unknown';}}function log(_0x1f9d24,_0x3f9ae1,_0x1848d6,_0x4eeef0,_0x59c5c1,_0x4897e0){loggers[_0x59c5c1[_0x9346('0x8')]()][_0x1f9d24](_0x9346('0x9'),_0x4897e0[_0x9346('0xa')](),_0x3f9ae1?_0x3f9ae1['id']:null,_0x3f9ae1?_0x3f9ae1[_0x9346('0xb')]:null,_0x3f9ae1?_0x3f9ae1['role']:null,getInteractionId(_0x1848d6,_0x4eeef0,_0x59c5c1),_0x1848d6?JSON['stringify'](_0x1848d6):_0x9346('0xc'));}function updateUser(_0x58b59e,_0x25a884,_0x31ce12,_0x2f400a,_0x1bb823){db[_[_0x9346('0x7')](_0x2f400a)+_0x9346('0xd')][_0x9346('0xe')]({'where':{'id':getInteractionId(_0x25a884,_0x31ce12,_0x2f400a)}})[_0x9346('0xf')](function(_0x29c133){if(_0x29c133){return _0x29c133[_0x9346('0x10')]({'UserId':_0x58b59e?_0x58b59e['id']:null});}})['then'](function(_0x26d53d){if(_0x26d53d){log(_0x9346('0x11'),_0x58b59e,_0x25a884,_0x31ce12,_0x2f400a,_0x1bb823);}})['catch'](function(){log(_0x9346('0x12'),_0x58b59e,_0x25a884,_0x31ce12,_0x2f400a,_0x1bb823);});}exports[_0x9346('0x13')]=function(_0x4088d9,_0x4e505c){return function(_0x525fc7,_0xbf3ab4,_0x3e1836){var _0x4c3973=_0x525fc7[_0x9346('0x14')];var _0xe79c4b={};var _0x3a4fa5=_0x525fc7['query'];if(_0xe79c4b){_0xe79c4b=_[_0x9346('0x15')](_0x525fc7[_0x9346('0x16')]);_0xe79c4b=_['omit'](_0xe79c4b,[_0x9346('0x16'),_0x9346('0x17'),_0x9346('0x18'),'fax',_0x9346('0x19')]);}updateUser(_0x4c3973,_0xe79c4b,_0x3a4fa5,_0x4088d9,_0x4e505c);_0x3e1836(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index b6c530d..2487585 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 _0x07d3=['License','findOne','then','count','json','users','User','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','update','base64','final','utf8','parse','hasOwnProperty','use'];(function(_0x1aee59,_0x31acff){var _0x3a2427=function(_0x11385b){while(--_0x11385b){_0x1aee59['push'](_0x1aee59['shift']());}};_0x3a2427(++_0x31acff);}(_0x07d3,0x1cb));var _0x307d=function(_0x2f1fcf,_0xbb936){_0x2f1fcf=_0x2f1fcf-0x0;var _0x241265=_0x07d3[_0x2f1fcf];return _0x241265;};'use strict';var crypto=require(_0x307d('0x0'));var util=require(_0x307d('0x1'));var compose=require('composable-middleware');var db=require(_0x307d('0x2'))['db'];var config=require(_0x307d('0x3'));function getValueFromLicense(_0x3884a9,_0x1255ba){if(_0x3884a9&&_0x1255ba){if(_0x1255ba[_0x307d('0x4')]&&_0x1255ba[_0x307d('0x5')]){var _0x45f7f2=_0x1255ba['data1'];var _0x38d428=_0x1255ba['license'];var _0x724318=_0x45f7f2[_0x307d('0x6')]('-')[0x4];var _0x15ea06=_0x45f7f2[_0x307d('0x6')]('-')[0x0];var _0x457165=crypto[_0x307d('0x7')]('aes-256-ctr',util[_0x307d('0x8')]('%s:%s:%s',_0x724318,_0x45f7f2,_0x15ea06));var _0x100363=_0x457165[_0x307d('0x9')](_0x38d428,_0x307d('0xa'),'utf8');_0x100363+=_0x457165[_0x307d('0xb')](_0x307d('0xc'));var _0x2c4b45=JSON[_0x307d('0xd')](_0x100363);return _0x2c4b45[_0x307d('0xe')](_0x3884a9)?_0x2c4b45[_0x3884a9]:null;}}return null;}function isLimit(_0x1f0db9,_0x2f1407,_0x5a04ac,_0x4a414d){var _0x3004a3=_0x2f1407;return compose()[_0x307d('0xf')](function(_0x679c21,_0x53d95d,_0x367514){return db[_0x307d('0x10')][_0x307d('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x307d('0x12')](function(_0xf30486){var _0x365465=getValueFromLicense(_0x1f0db9,_0xf30486);return _0x365465?_0x365465:_0x3004a3;})[_0x307d('0x12')](function(_0x34b8b0){_0x3004a3=_0x34b8b0;return _0x5a04ac[_0x307d('0x13')](_0x4a414d);})[_0x307d('0x12')](function(_0x45893f){if(_0x45893f>=_0x3004a3){return _0x53d95d['status'](0x193)[_0x307d('0x14')]({'message':util[_0x307d('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1f0db9)});}_0x367514();})['catch'](function(_0x369f7d){_0x367514(_0x369f7d);});});}function isUserLimit(){return isLimit(_0x307d('0x15'),0x1,db[_0x307d('0x16')],{'where':{'$or':[{'role':_0x307d('0x17')},{'role':_0x307d('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x4293=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','crypto','util','../../mysqldb','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','use','License','findOne','then','count','status','json'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x4293,0x163));var _0x3429=function(_0xe282c,_0x378aa2){_0xe282c=_0xe282c-0x0;var _0x2d5bb9=_0x4293[_0xe282c];return _0x2d5bb9;};'use strict';var crypto=require(_0x3429('0x0'));var util=require(_0x3429('0x1'));var compose=require('composable-middleware');var db=require(_0x3429('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x110b2d,_0x4fba6b){if(_0x110b2d&&_0x4fba6b){if(_0x4fba6b['data1']&&_0x4fba6b[_0x3429('0x3')]){var _0x3e2d2f=_0x4fba6b['data1'];var _0x413bb5=_0x4fba6b[_0x3429('0x3')];var _0x432c4f=_0x3e2d2f[_0x3429('0x4')]('-')[0x4];var _0x4aa4a0=_0x3e2d2f[_0x3429('0x4')]('-')[0x0];var _0x9f51de=crypto[_0x3429('0x5')](_0x3429('0x6'),util[_0x3429('0x7')](_0x3429('0x8'),_0x432c4f,_0x3e2d2f,_0x4aa4a0));var _0x408439=_0x9f51de['update'](_0x413bb5,_0x3429('0x9'),_0x3429('0xa'));_0x408439+=_0x9f51de[_0x3429('0xb')](_0x3429('0xa'));var _0x4acb25=JSON[_0x3429('0xc')](_0x408439);return _0x4acb25['hasOwnProperty'](_0x110b2d)?_0x4acb25[_0x110b2d]:null;}}return null;}function isLimit(_0x525fdc,_0x578b6c,_0x3e96cc,_0x2098bd){var _0x39a980=_0x578b6c;return compose()[_0x3429('0xd')](function(_0x24af4e,_0x3ab5f3,_0x250369){return db[_0x3429('0xe')][_0x3429('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x16beed){var _0x2d2b3a=getValueFromLicense(_0x525fdc,_0x16beed);return _0x2d2b3a?_0x2d2b3a:_0x39a980;})[_0x3429('0x10')](function(_0x191f67){_0x39a980=_0x191f67;return _0x3e96cc[_0x3429('0x11')](_0x2098bd);})[_0x3429('0x10')](function(_0x51b6d0){if(_0x51b6d0>=_0x39a980){return _0x3ab5f3[_0x3429('0x12')](0x193)[_0x3429('0x13')]({'message':util[_0x3429('0x7')](_0x3429('0x14'),_0x525fdc)});}_0x250369();})['catch'](function(_0x5282b1){_0x250369(_0x5282b1);});});}function isUserLimit(){return isLimit(_0x3429('0x15'),0x1,db[_0x3429('0x16')],{'where':{'$or':[{'role':_0x3429('0x17')},{'role':_0x3429('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index d9d73b2..aafd116 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 _0x7c8b=['$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','days','format','castTo','\x20AS\x20','text','field','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','<>\x20?'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7c8b,0xa7));var _0xb7c8=function(_0x408824,_0x5a6260){_0x408824=_0x408824-0x0;var _0x961092=_0x7c8b[_0x408824];return _0x961092;};'use strict';var _=require(_0xb7c8('0x0'));var moment=require(_0xb7c8('0x1'));exports[_0xb7c8('0x2')]=function(_0x287a71){var _0x468fc2={'conditions':[]};_0x468fc2['sqlOperator']=_['startsWith'](_0x287a71,_0xb7c8('0x3'))?'or':_0xb7c8('0x4');var _0x2ec48f=_0x287a71[_0xb7c8('0x5')](_0xb7c8('0x6'),'')[_0xb7c8('0x5')](_0xb7c8('0x3'),'')[_0xb7c8('0x7')]('||');for(var _0x1d3b56=0x0;_0x1d3b56<_0x2ec48f[_0xb7c8('0x8')];_0x1d3b56++){var _0x43b6f9=_0x2ec48f[_0x1d3b56][_0xb7c8('0x7')](':=');var _0x20fe43=_0x43b6f9[0x0];var _0x568f08=_0x43b6f9[_0xb7c8('0x9')](0x1);_0x568f08[_0xb7c8('0xa')](function(_0x319582){var _0x5edb95=_0x319582[_0xb7c8('0x7')]('[')[_0xb7c8('0xb')]();var _0x51e984=_0x319582[_0xb7c8('0xc')](/\[(.*?)\]/g);_0x51e984[_0xb7c8('0xa')](function(_0x3d0d98){var _0x3159bd=_0x3d0d98[_0xb7c8('0x7')]('[')['filter'](function(_0x1a079e){return _0x1a079e['indexOf'](']')>-0x1;})['map'](function(_0x1f573f){return _0x1f573f[_0xb7c8('0x7')](']')[0x0];})[0x0];_0x468fc2[_0xb7c8('0xd')][_0xb7c8('0xe')]({'field':_0x20fe43,'operator':_0x5edb95,'value':_0x3159bd});});});}return _0x468fc2;};exports[_0xb7c8('0xf')]=function(_0x4deabb,_0x4617b6,_0x1b5dd2){var _0x12e13a={};if(_0x4617b6===_0xb7c8('0x10')){if(_0x1b5dd2[_0xb7c8('0x11')]===_0xb7c8('0x12')){_0x1b5dd2['operator']=_0xb7c8('0x13');_0x1b5dd2[_0xb7c8('0x14')]+=','+_0x1b5dd2[_0xb7c8('0x14')];}else if(_['includes']([_0xb7c8('0x15'),_0xb7c8('0x16')],_0x1b5dd2[_0xb7c8('0x11')])){_0x1b5dd2[_0xb7c8('0x14')]=moment(_0x1b5dd2[_0xb7c8('0x14')])[_0xb7c8('0x17')](0x1,_0xb7c8('0x18'))[_0xb7c8('0x19')]('YYYY-MM-DD');}}if(_0x1b5dd2[_0xb7c8('0x1a')]){_0x4617b6=_0x1b5dd2[_0xb7c8('0x1a')];_0x12e13a['text']='CAST('+_0x4deabb+'.'+_0x1b5dd2['field']+_0xb7c8('0x1b')+_0x1b5dd2[_0xb7c8('0x1a')]+')\x20'+parseOperator(_0x1b5dd2[_0xb7c8('0x11')]);}else{_0x12e13a[_0xb7c8('0x1c')]=_0x4deabb+'.'+_0x1b5dd2[_0xb7c8('0x1d')]+'\x20'+parseOperator(_0x1b5dd2[_0xb7c8('0x11')]);}if(_[_0xb7c8('0x1e')]([_0xb7c8('0x1f'),_0xb7c8('0x20')],_0x1b5dd2['operator']))_0x12e13a[_0xb7c8('0x1c')]='('+_0x12e13a[_0xb7c8('0x1c')]+_0xb7c8('0x21')+_0x4deabb+'.'+_0x1b5dd2[_0xb7c8('0x1d')]+_0xb7c8('0x22');_0x12e13a[_0xb7c8('0x14')]=parseValue(_0x4617b6,_0x1b5dd2[_0xb7c8('0x11')],_0x1b5dd2['value']);return _0x12e13a;};function parseOperator(_0x412b0a){var _0x5eb721;switch(_0x412b0a){case _0xb7c8('0x23'):_0x5eb721='IN\x20?';break;case'$notIn':_0x5eb721='NOT\x20IN\x20?';break;case _0xb7c8('0x12'):_0x5eb721='=\x20?';break;case _0xb7c8('0x1f'):_0x5eb721=_0xb7c8('0x24');break;case'$substring':case _0xb7c8('0x25'):case _0xb7c8('0x26'):_0x5eb721=_0xb7c8('0x27');break;case _0xb7c8('0x28'):_0x5eb721=_0xb7c8('0x29');break;case'$gt':_0x5eb721='>\x20?';break;case _0xb7c8('0x16'):_0x5eb721=_0xb7c8('0x2a');break;case'$gte':_0x5eb721=_0xb7c8('0x2b');break;case _0xb7c8('0x13'):_0x5eb721=_0xb7c8('0x2c');break;}return _0x5eb721;}function parseValue(_0x4122c7,_0x453972,_0x22d8d7){var _0x579973={'start':undefined,'end':undefined};switch(_0x453972){case'$in':case _0xb7c8('0x20'):_0x579973[_0xb7c8('0x2d')]=_0x22d8d7['split'](',');break;case _0xb7c8('0x2e'):_0x579973['start']='%'+_0x22d8d7+'%';break;case'$startsWith':_0x579973['start']=_0x22d8d7+'%';break;case'$endsWith':_0x579973[_0xb7c8('0x2d')]='%'+_0x22d8d7;break;case _0xb7c8('0x13'):var _0x7a61c=_0x22d8d7[_0xb7c8('0x7')](',');var _0x22d8d7=_0x7a61c[_0xb7c8('0xb')]();var _0x56eabd=_0x7a61c[_0xb7c8('0x2f')]();if(_0x4122c7==='DATE'){_0x22d8d7=moment(_0x22d8d7)[_0xb7c8('0x30')](0x0,!![])[_0xb7c8('0x19')]();_0x56eabd=moment(_0x56eabd)[_0xb7c8('0x30')](0x0,!![])['add'](0x17,'hours')[_0xb7c8('0x17')](0x3b,_0xb7c8('0x31'))[_0xb7c8('0x17')](0x3b,_0xb7c8('0x32'))[_0xb7c8('0x19')]();}_0x579973={'start':_0x22d8d7,'end':_0x56eabd};break;default:_0x579973[_0xb7c8('0x2d')]=_0x22d8d7;break;}return _0x579973;} \ No newline at end of file +var _0x3154=['\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','add','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','forEach','match','filter','indexOf','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x3154,0x152));var _0x4315=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x3154[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x4315('0x0'));var moment=require('moment');exports[_0x4315('0x1')]=function(_0x1e25ba){var _0x234ce0={'conditions':[]};_0x234ce0[_0x4315('0x2')]=_[_0x4315('0x3')](_0x1e25ba,_0x4315('0x4'))?'or':_0x4315('0x5');var _0x5ab5ce=_0x1e25ba[_0x4315('0x6')](_0x4315('0x7'),'')[_0x4315('0x6')]('[$or]','')[_0x4315('0x8')]('||');for(var _0x49bdac=0x0;_0x49bdac<_0x5ab5ce['length'];_0x49bdac++){var _0x149329=_0x5ab5ce[_0x49bdac]['split'](':=');var _0x5a45eb=_0x149329[0x0];var _0x350f3d=_0x149329['slice'](0x1);_0x350f3d[_0x4315('0x9')](function(_0x1d9d13){var _0x35ba00=_0x1d9d13[_0x4315('0x8')]('[')['shift']();var _0x20356e=_0x1d9d13[_0x4315('0xa')](/\[(.*?)\]/g);_0x20356e[_0x4315('0x9')](function(_0x5a237d){var _0x3ac947=_0x5a237d[_0x4315('0x8')]('[')[_0x4315('0xb')](function(_0x128052){return _0x128052[_0x4315('0xc')](']')>-0x1;})['map'](function(_0x183cf4){return _0x183cf4[_0x4315('0x8')](']')[0x0];})[0x0];_0x234ce0['conditions'][_0x4315('0xd')]({'field':_0x5a45eb,'operator':_0x35ba00,'value':_0x3ac947});});});}return _0x234ce0;};exports[_0x4315('0xe')]=function(_0x37c0db,_0x434f81,_0x2a3a44){var _0x5227ff={};if(_0x434f81===_0x4315('0xf')){if(_0x2a3a44['operator']===_0x4315('0x10')){_0x2a3a44[_0x4315('0x11')]=_0x4315('0x12');_0x2a3a44['value']+=','+_0x2a3a44[_0x4315('0x13')];}else if(_[_0x4315('0x14')]([_0x4315('0x15'),_0x4315('0x16')],_0x2a3a44[_0x4315('0x11')])){_0x2a3a44[_0x4315('0x13')]=moment(_0x2a3a44[_0x4315('0x13')])['add'](0x1,_0x4315('0x17'))[_0x4315('0x18')](_0x4315('0x19'));}}if(_0x2a3a44[_0x4315('0x1a')]){_0x434f81=_0x2a3a44[_0x4315('0x1a')];_0x5227ff[_0x4315('0x1b')]=_0x4315('0x1c')+_0x37c0db+'.'+_0x2a3a44[_0x4315('0x1d')]+'\x20AS\x20'+_0x2a3a44[_0x4315('0x1a')]+')\x20'+parseOperator(_0x2a3a44[_0x4315('0x11')]);}else{_0x5227ff['text']=_0x37c0db+'.'+_0x2a3a44['field']+'\x20'+parseOperator(_0x2a3a44[_0x4315('0x11')]);}if(_[_0x4315('0x14')]([_0x4315('0x1e'),_0x4315('0x1f')],_0x2a3a44[_0x4315('0x11')]))_0x5227ff['text']='('+_0x5227ff[_0x4315('0x1b')]+_0x4315('0x20')+_0x37c0db+'.'+_0x2a3a44['field']+_0x4315('0x21');_0x5227ff[_0x4315('0x13')]=parseValue(_0x434f81,_0x2a3a44[_0x4315('0x11')],_0x2a3a44[_0x4315('0x13')]);return _0x5227ff;};function parseOperator(_0x5936eb){var _0x5ee277;switch(_0x5936eb){case _0x4315('0x22'):_0x5ee277=_0x4315('0x23');break;case _0x4315('0x1f'):_0x5ee277=_0x4315('0x24');break;case _0x4315('0x10'):_0x5ee277=_0x4315('0x25');break;case _0x4315('0x1e'):_0x5ee277=_0x4315('0x26');break;case _0x4315('0x27'):case _0x4315('0x28'):case _0x4315('0x29'):_0x5ee277='LIKE\x20?';break;case _0x4315('0x2a'):_0x5ee277=_0x4315('0x2b');break;case _0x4315('0x15'):_0x5ee277=_0x4315('0x2c');break;case _0x4315('0x16'):_0x5ee277=_0x4315('0x2d');break;case'$gte':_0x5ee277='>=\x20?';break;case'$between':_0x5ee277=_0x4315('0x2e');break;}return _0x5ee277;}function parseValue(_0x314c49,_0xab5d31,_0x58398a){var _0x2c04ad={'start':undefined,'end':undefined};switch(_0xab5d31){case'$in':case _0x4315('0x1f'):_0x2c04ad[_0x4315('0x2f')]=_0x58398a[_0x4315('0x8')](',');break;case _0x4315('0x27'):_0x2c04ad['start']='%'+_0x58398a+'%';break;case'$startsWith':_0x2c04ad[_0x4315('0x2f')]=_0x58398a+'%';break;case _0x4315('0x29'):_0x2c04ad[_0x4315('0x2f')]='%'+_0x58398a;break;case _0x4315('0x12'):var _0xfb96fc=_0x58398a['split'](',');var _0x58398a=_0xfb96fc['shift']();var _0x3bb0e1=_0xfb96fc['pop']();if(_0x314c49==='DATE'){_0x58398a=moment(_0x58398a)[_0x4315('0x30')](0x0,!![])[_0x4315('0x18')]();_0x3bb0e1=moment(_0x3bb0e1)[_0x4315('0x30')](0x0,!![])[_0x4315('0x31')](0x17,_0x4315('0x32'))[_0x4315('0x31')](0x3b,_0x4315('0x33'))[_0x4315('0x31')](0x3b,_0x4315('0x34'))['format']();}_0x2c04ad={'start':_0x58398a,'end':_0x3bb0e1};break;default:_0x2c04ad['start']=_0x58398a;break;}return _0x2c04ad;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9086b75..6c6d24d 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 _0x5e60=['forEach','replace','getOptions','query','$id','model','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','object','columns','name','VIRTUAL','lower','merge','options','sequelize','moment','parse','keys','includes','split','isEmpty','forOwn','find','type','DATE','isPlainObject','utc','format','YYYY-MM-DD','subtract','uniqueid','isArray','limit','offset','map','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue'];(function(_0x3ff433,_0x5edf7b){var _0x2c4e29=function(_0x5ad2e9){while(--_0x5ad2e9){_0x3ff433['push'](_0x3ff433['shift']());}};_0x2c4e29(++_0x5edf7b);}(_0x5e60,0x91));var _0x05e6=function(_0x3559ea,_0x3990f2){_0x3559ea=_0x3559ea-0x0;var _0xb0aef0=_0x5e60[_0x3559ea];return _0xb0aef0;};'use strict';var _=require('lodash');var sequelize=require(_0x05e6('0x0'));var moment=require(_0x05e6('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2816a6){var _0x38da8c=['ne'];try{var _0xf261db=JSON[_0x05e6('0x2')](_0x2816a6);var _0x3354d7=Object[_0x05e6('0x3')](_0xf261db)[0x0];return _0x38da8c[_0x05e6('0x4')](_0x3354d7);}catch(_0x40039d){return![];}}function getOperatorValue(_0x4dea1e){var _0x7fa46a=JSON[_0x05e6('0x2')](_0x4dea1e);var _0x55b8ca=Object[_0x05e6('0x3')](_0x7fa46a)[0x0];var _0x402fad=_0x7fa46a[_0x55b8ca];return{['$'+_0x55b8ca]:_0x402fad};}exports['fields']=function(_0x1a00bc){var _0x1b3db9=null;if(_0x1a00bc){_0x1b3db9=_0x1a00bc[_0x05e6('0x5')](',');}return _0x1b3db9;};exports['filters']=function(_0x513c68,_0x4c9fc7){var _0xd5738d={};if(!_[_0x05e6('0x6')](_0x513c68)){_[_0x05e6('0x7')](_0x513c68,function(_0x2ef837,_0x179086){try{if(_0x4c9fc7){var _0x53c73d=_[_0x05e6('0x8')](_0x4c9fc7,{'name':_0x179086})||{};if(hasSequelizeOperator(_0x2ef837)){_0xd5738d[_0x179086]=getOperatorValue(_0x2ef837);}else if(_0x53c73d[_0x05e6('0x9')]===_0x05e6('0xa')&&_[_0x05e6('0xb')](_0x2ef837)){var _0x2b07e=JSON[_0x05e6('0x2')](_0x2ef837);var _0x100d19={'$gte':moment(moment(_0x2b07e['$gte'])['format']('YYYY-MM-DD'))[_0x05e6('0xc')]()[_0x05e6('0xd')](),'$lte':moment(moment(_0x2b07e['$lte'])[_0x05e6('0xd')](_0x05e6('0xe')))[_0x05e6('0xc')]()[_0x05e6('0xf')](0x1,'s')[_0x05e6('0xd')]()};_0xd5738d[_0x179086]=_0x100d19;}else if(_0x53c73d['name']===_0x05e6('0x10')){_0xd5738d[_0x179086]=_0x2ef837;}else{_0xd5738d[_0x179086]=_[_0x05e6('0x11')](_0x2ef837)?_0x2ef837:JSON[_0x05e6('0x2')](_0x2ef837);}}else{_0xd5738d[_0x179086]=_[_0x05e6('0x11')](_0x2ef837)?_0x2ef837:JSON[_0x05e6('0x2')](_0x2ef837);}}catch(_0x5cfd19){_0xd5738d[_0x179086]=_0x2ef837[_0x05e6('0x5')](',');}});}return _0xd5738d;};exports[_0x05e6('0x12')]=function(_0x2cf997){_0x2cf997=parseInt(_0x2cf997,0xa);if(!_0x2cf997||_0x2cf997<0x0){_0x2cf997=LIMIT_VALUE;}return _0x2cf997;};exports[_0x05e6('0x13')]=function(_0x6cd8ad){_0x6cd8ad=parseInt(_0x6cd8ad,0xa);if(!_0x6cd8ad||_0x6cd8ad<0x0){_0x6cd8ad=0x0;}return _0x6cd8ad;};exports['sort']=function(_0x3d3982){var _0x42b0d2,_0x42255c=null;if(_0x3d3982){_0x42b0d2=_0x3d3982[_0x05e6('0x5')](',');_0x42255c=_[_0x05e6('0x14')](_0x42b0d2,function(_0x79a899){if(_0x79a899['indexOf']('-')===0x0){return[_0x79a899===_0x05e6('0x15')?sequelize[_0x05e6('0x16')](sequelize[_0x05e6('0x17')](_0x05e6('0x15')),_0x05e6('0x18')):_0x79a899[_0x05e6('0x19')](0x1),_0x05e6('0x1a')];}else{return[_0x79a899==='priority'?sequelize[_0x05e6('0x16')](sequelize[_0x05e6('0x17')]('priority'),_0x05e6('0x18')):_0x79a899,_0x05e6('0x1b')];}});}return _0x42255c;};exports[_0x05e6('0x1c')]=function(_0x422b26,_0x5b7232){if(_[_0x05e6('0x6')](_0x422b26)){return _0x422b26;}if(_[_0x05e6('0x11')](_0x422b26)){for(var _0x9b3a93=0x0;_0x9b3a93<_0x422b26[_0x05e6('0x1d')];_0x9b3a93+=0x1){_0x422b26[_0x9b3a93]=this['omit'](_0x422b26[_0x9b3a93],_0x5b7232);}return _0x422b26;}if(!_[_0x05e6('0x1e')](_0x422b26)){return _0x422b26;}if(_['isString'](_0x5b7232)){_0x5b7232=[_0x5b7232];}if(!_['isArray'](_0x5b7232)){return _0x422b26;}for(var _0x12c5fc=0x0;_0x12c5fc<_0x5b7232['length'];_0x12c5fc+=0x1){_[_0x05e6('0x1f')](_0x422b26,_0x5b7232[_0x12c5fc]);}for(var _0x5def23 in _0x422b26){if(_0x422b26[_0x05e6('0x20')](_0x5def23)){_0x422b26[_0x5def23]=this[_0x05e6('0x1c')](_0x422b26[_0x5def23],_0x5b7232);}}return _0x422b26;};exports[_0x05e6('0x21')]=function(_0x527714){return _0x527714[_0x05e6('0x22')](RegExp(_0x05e6('0x23')))?!![]:![];};exports[_0x05e6('0x24')]=function(_0x1d180a){return _0x1d180a[_0x05e6('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x05e6('0x25')]=function(_0xf47dea){var _0x1ee7ae=[];_0xf47dea[_0x05e6('0x5')](/[ ,]+/)[_0x05e6('0x26')](function(_0x2f54ca){_0x2f54ca=_0x2f54ca[_0x05e6('0x27')](/([^:]")"+/g,'$1');_0x2f54ca='+'+_0x2f54ca+'*';if(_0x2f54ca[_0x05e6('0x4')]('@'))_0x2f54ca='\x22'+_0x2f54ca+'\x22';_0x1ee7ae['push'](_0x2f54ca);});return _0x1ee7ae['join']('\x20');};exports[_0x05e6('0x28')]=function(_0x56059b,_0x426bda,_0x5333a4){var _0x553426={},_0x4453c1={};if(_0x426bda[_0x05e6('0x29')][_0x05e6('0x2a')]){_0x426bda[_0x05e6('0x29')]['id']=_0x426bda[_0x05e6('0x29')][_0x05e6('0x2a')];delete _0x426bda[_0x05e6('0x29')][_0x05e6('0x2a')];}_0x553426[_0x05e6('0x2b')]=_[_0x05e6('0x14')](_0x56059b,'name');_0x553426[_0x05e6('0x29')]=_['keys'](_0x426bda['query']);_0x553426[_0x05e6('0x2c')]=_['intersection'](_0x553426[_0x05e6('0x2b')],_0x553426['query']);_0x4453c1[_0x05e6('0x2d')]=_[_0x05e6('0x2e')](_0x553426[_0x05e6('0x2b')],this[_0x05e6('0x2f')](_0x426bda[_0x05e6('0x29')][_0x05e6('0x2f')]));_0x4453c1['attributes']=_0x4453c1[_0x05e6('0x2d')][_0x05e6('0x1d')]?_0x4453c1[_0x05e6('0x2d')]:_0x553426[_0x05e6('0x2b')];if(!_0x426bda['query'][_0x05e6('0x20')](_0x05e6('0x30'))){_0x4453c1['limit']=this['limit'](_0x426bda[_0x05e6('0x29')]['limit']);_0x4453c1[_0x05e6('0x13')]=this[_0x05e6('0x13')](_0x426bda['query'][_0x05e6('0x13')]);}_0x4453c1[_0x05e6('0x31')]=this[_0x05e6('0x32')](_0x426bda['query'][_0x05e6('0x32')]);_0x4453c1[_0x05e6('0x33')]=this[_0x05e6('0x2c')](_[_0x05e6('0x34')](_0x426bda[_0x05e6('0x29')],_0x553426[_0x05e6('0x2c')]),_0x56059b);if(_0x426bda[_0x05e6('0x29')][_0x05e6('0x35')]){var _0x4af74c=_0x56059b;var _0x2c9c8a=_0x426bda[_0x05e6('0x29')][_0x05e6('0x35')];if(typeof _0x2c9c8a===_0x05e6('0x36')){_0x4af74c=_['filter'](_0x56059b,function(_0x52f5a4){return _[_0x05e6('0x4')](_0x2c9c8a[_0x05e6('0x37')],_0x52f5a4[_0x05e6('0x38')]);});_0x2c9c8a=_0x2c9c8a['value'];}_0x4453c1[_0x05e6('0x33')]=_['merge'](_0x4453c1[_0x05e6('0x33')],{'$or':_['map'](_0x4af74c,function(_0x562c18){if(_0x562c18[_0x05e6('0x9')]!==_0x05e6('0x39')){if(_0x5333a4){return sequelize[_0x05e6('0x33')](sequelize['fn'](_0x05e6('0x3a'),sequelize[_0x05e6('0x17')](_0x562c18[_0x05e6('0x38')])),{'$like':sequelize['fn'](_0x05e6('0x3a'),'%'+_0x426bda[_0x05e6('0x29')][_0x05e6('0x35')]+'%')});}else{var _0xce641d={};_0xce641d[_0x562c18[_0x05e6('0x38')]]={'$like':'%'+_0x426bda['query'][_0x05e6('0x35')]+'%'};return _0xce641d;}}})});}_0x4453c1=_[_0x05e6('0x3b')]({},_0x4453c1,_0x426bda[_0x05e6('0x3c')]);return _0x4453c1;}; \ No newline at end of file +var _0x52c6=['name','uniqueid','isArray','offset','sort','map','indexOf','priority','unsigned','substr','cast','col','ASC','omit','isString','length','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','includes','push','join','query','$id','intersection','model','attributes','nolimit','limit','where','filter','object','columns','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','$lte','format','utc','subtract'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x52c6,0x15a));var _0x652c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x52c6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x652c('0x0'));var sequelize=require(_0x652c('0x1'));var moment=require(_0x652c('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3542a8){var _0x407eb1=['ne'];try{var _0x47df54=JSON[_0x652c('0x3')](_0x3542a8);var _0x2c0ffe=Object[_0x652c('0x4')](_0x47df54)[0x0];return _0x407eb1['includes'](_0x2c0ffe);}catch(_0x565260){return![];}}function getOperatorValue(_0x2bb74c){var _0x30fc1f=JSON[_0x652c('0x3')](_0x2bb74c);var _0x12b9f9=Object['keys'](_0x30fc1f)[0x0];var _0x2d699d=_0x30fc1f[_0x12b9f9];return{['$'+_0x12b9f9]:_0x2d699d};}exports[_0x652c('0x5')]=function(_0x303a81){var _0x3b98a2=null;if(_0x303a81){_0x3b98a2=_0x303a81[_0x652c('0x6')](',');}return _0x3b98a2;};exports[_0x652c('0x7')]=function(_0x4b743d,_0x3610cb){var _0x152680={};if(!_[_0x652c('0x8')](_0x4b743d)){_[_0x652c('0x9')](_0x4b743d,function(_0x21f5e8,_0x498f64){try{if(_0x3610cb){var _0x550ef1=_[_0x652c('0xa')](_0x3610cb,{'name':_0x498f64})||{};if(hasSequelizeOperator(_0x21f5e8)){_0x152680[_0x498f64]=getOperatorValue(_0x21f5e8);}else if(_0x550ef1[_0x652c('0xb')]===_0x652c('0xc')&&_[_0x652c('0xd')](_0x21f5e8)){var _0x28ce50=JSON[_0x652c('0x3')](_0x21f5e8);var _0x59c2c5={'$gte':moment(moment(_0x28ce50[_0x652c('0xe')])['format'](_0x652c('0xf')))['utc']()['format'](),'$lte':moment(moment(_0x28ce50[_0x652c('0x10')])[_0x652c('0x11')](_0x652c('0xf')))[_0x652c('0x12')]()[_0x652c('0x13')](0x1,'s')[_0x652c('0x11')]()};_0x152680[_0x498f64]=_0x59c2c5;}else if(_0x550ef1[_0x652c('0x14')]===_0x652c('0x15')){_0x152680[_0x498f64]=_0x21f5e8;}else{_0x152680[_0x498f64]=_[_0x652c('0x16')](_0x21f5e8)?_0x21f5e8:JSON[_0x652c('0x3')](_0x21f5e8);}}else{_0x152680[_0x498f64]=_[_0x652c('0x16')](_0x21f5e8)?_0x21f5e8:JSON[_0x652c('0x3')](_0x21f5e8);}}catch(_0x2064eb){_0x152680[_0x498f64]=_0x21f5e8[_0x652c('0x6')](',');}});}return _0x152680;};exports['limit']=function(_0x14b316){_0x14b316=parseInt(_0x14b316,0xa);if(!_0x14b316||_0x14b316<0x0){_0x14b316=LIMIT_VALUE;}return _0x14b316;};exports[_0x652c('0x17')]=function(_0x3ced5c){_0x3ced5c=parseInt(_0x3ced5c,0xa);if(!_0x3ced5c||_0x3ced5c<0x0){_0x3ced5c=0x0;}return _0x3ced5c;};exports[_0x652c('0x18')]=function(_0x5c3066){var _0xfed528,_0x3c0107=null;if(_0x5c3066){_0xfed528=_0x5c3066['split'](',');_0x3c0107=_[_0x652c('0x19')](_0xfed528,function(_0x1437ee){if(_0x1437ee[_0x652c('0x1a')]('-')===0x0){return[_0x1437ee===_0x652c('0x1b')?sequelize['cast'](sequelize['col'](_0x652c('0x1b')),_0x652c('0x1c')):_0x1437ee[_0x652c('0x1d')](0x1),'DESC'];}else{return[_0x1437ee===_0x652c('0x1b')?sequelize[_0x652c('0x1e')](sequelize[_0x652c('0x1f')](_0x652c('0x1b')),_0x652c('0x1c')):_0x1437ee,_0x652c('0x20')];}});}return _0x3c0107;};exports[_0x652c('0x21')]=function(_0x29b182,_0x382833){if(_['isEmpty'](_0x29b182)){return _0x29b182;}if(_[_0x652c('0x16')](_0x29b182)){for(var _0x12a38b=0x0;_0x12a38b<_0x29b182['length'];_0x12a38b+=0x1){_0x29b182[_0x12a38b]=this[_0x652c('0x21')](_0x29b182[_0x12a38b],_0x382833);}return _0x29b182;}if(!_['isObject'](_0x29b182)){return _0x29b182;}if(_[_0x652c('0x22')](_0x382833)){_0x382833=[_0x382833];}if(!_[_0x652c('0x16')](_0x382833)){return _0x29b182;}for(var _0x4cb484=0x0;_0x4cb484<_0x382833[_0x652c('0x23')];_0x4cb484+=0x1){_[_0x652c('0x24')](_0x29b182,_0x382833[_0x4cb484]);}for(var _0x1f1901 in _0x29b182){if(_0x29b182[_0x652c('0x25')](_0x1f1901)){_0x29b182[_0x1f1901]=this[_0x652c('0x21')](_0x29b182[_0x1f1901],_0x382833);}}return _0x29b182;};exports['isNumeric']=function(_0x47b186){return _0x47b186['match'](RegExp(_0x652c('0x26')))?!![]:![];};exports[_0x652c('0x27')]=function(_0xe50b90){return _0xe50b90[_0x652c('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x652c('0x29')]=function(_0x4193c9){var _0x5f073a=[];_0x4193c9[_0x652c('0x6')](/[ ,]+/)[_0x652c('0x2a')](function(_0x5573c6){_0x5573c6=_0x5573c6['replace'](/([^:]")"+/g,'$1');_0x5573c6='+'+_0x5573c6+'*';if(_0x5573c6[_0x652c('0x2b')]('@'))_0x5573c6='\x22'+_0x5573c6+'\x22';_0x5f073a[_0x652c('0x2c')](_0x5573c6);});return _0x5f073a[_0x652c('0x2d')]('\x20');};exports['getOptions']=function(_0x32a179,_0xf31aae,_0x20d2e4){var _0x2d56fd={},_0x14815b={};if(_0xf31aae[_0x652c('0x2e')][_0x652c('0x2f')]){_0xf31aae[_0x652c('0x2e')]['id']=_0xf31aae[_0x652c('0x2e')][_0x652c('0x2f')];delete _0xf31aae['query'][_0x652c('0x2f')];}_0x2d56fd['model']=_['map'](_0x32a179,_0x652c('0x14'));_0x2d56fd[_0x652c('0x2e')]=_[_0x652c('0x4')](_0xf31aae[_0x652c('0x2e')]);_0x2d56fd[_0x652c('0x7')]=_[_0x652c('0x30')](_0x2d56fd[_0x652c('0x31')],_0x2d56fd[_0x652c('0x2e')]);_0x14815b[_0x652c('0x32')]=_[_0x652c('0x30')](_0x2d56fd[_0x652c('0x31')],this[_0x652c('0x5')](_0xf31aae[_0x652c('0x2e')]['fields']));_0x14815b[_0x652c('0x32')]=_0x14815b['attributes'][_0x652c('0x23')]?_0x14815b['attributes']:_0x2d56fd[_0x652c('0x31')];if(!_0xf31aae[_0x652c('0x2e')][_0x652c('0x25')](_0x652c('0x33'))){_0x14815b['limit']=this[_0x652c('0x34')](_0xf31aae['query']['limit']);_0x14815b[_0x652c('0x17')]=this[_0x652c('0x17')](_0xf31aae['query'][_0x652c('0x17')]);}_0x14815b['order']=this[_0x652c('0x18')](_0xf31aae[_0x652c('0x2e')][_0x652c('0x18')]);_0x14815b[_0x652c('0x35')]=this[_0x652c('0x7')](_['pick'](_0xf31aae['query'],_0x2d56fd[_0x652c('0x7')]),_0x32a179);if(_0xf31aae['query']['filter']){var _0x284696=_0x32a179;var _0x3581fe=_0xf31aae[_0x652c('0x2e')][_0x652c('0x36')];if(typeof _0x3581fe===_0x652c('0x37')){_0x284696=_[_0x652c('0x36')](_0x32a179,function(_0x5896d5){return _[_0x652c('0x2b')](_0x3581fe[_0x652c('0x38')],_0x5896d5[_0x652c('0x14')]);});_0x3581fe=_0x3581fe['value'];}_0x14815b[_0x652c('0x35')]=_[_0x652c('0x39')](_0x14815b['where'],{'$or':_[_0x652c('0x19')](_0x284696,function(_0x392f71){if(_0x392f71[_0x652c('0xb')]!==_0x652c('0x3a')){if(_0x20d2e4){return sequelize['where'](sequelize['fn'](_0x652c('0x3b'),sequelize[_0x652c('0x1f')](_0x392f71['name'])),{'$like':sequelize['fn'](_0x652c('0x3b'),'%'+_0xf31aae[_0x652c('0x2e')][_0x652c('0x36')]+'%')});}else{var _0x111931={};_0x111931[_0x392f71[_0x652c('0x14')]]={'$like':'%'+_0xf31aae[_0x652c('0x2e')]['filter']+'%'};return _0x111931;}}})});}_0x14815b=_[_0x652c('0x39')]({},_0x14815b,_0xf31aae[_0x652c('0x3c')]);return _0x14815b;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index f29ba72..a2bfa1a 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66e2=['method-override','cookie-parser','errorhandler','path','passport','moment','./environment','../mysqldb','default','get','env','production','set','appPath','public','development','test','join','root','client','use','toISOString','static','views','/server/views','engine','ejs','renderFile','view\x20engine','html','urlencoded','50mb','json','initialize','express','serve-favicon'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66e2,0xd6));var _0x266e=function(_0x4ca6dd,_0x47ed65){_0x4ca6dd=_0x4ca6dd-0x0;var _0x21136d=_0x66e2[_0x4ca6dd];return _0x21136d;};'use strict';var express=require(_0x266e('0x0'));var favicon=require(_0x266e('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x266e('0x2'));var cookieParser=require(_0x266e('0x3'));var errorHandler=require(_0x266e('0x4'));var path=require(_0x266e('0x5'));var passport=require(_0x266e('0x6'));var cors=require('cors');var moment=require(_0x266e('0x7'));var config=require(_0x266e('0x8'));var db=require(_0x266e('0x9'))['db'];exports[_0x266e('0xa')]=function(_0x252f2d){var _0x3695e5=_0x252f2d[_0x266e('0xb')](_0x266e('0xc'));if(_0x3695e5===_0x266e('0xd')){_0x252f2d[_0x266e('0xe')](_0x266e('0xf'),path['join'](config['root'],_0x266e('0x10')));}if(_0x3695e5===_0x266e('0x11')||_0x3695e5===_0x266e('0x12')){_0x252f2d[_0x266e('0xe')]('appPath',path[_0x266e('0x13')](config[_0x266e('0x14')],_0x266e('0x15')));_0x252f2d[_0x266e('0x16')](errorHandler());}_0x252f2d[_0x266e('0xe')]('json\x20replacer',function(_0x3469ca,_0x5dc035){if(this[_0x3469ca]instanceof Date){_0x5dc035=this[_0x3469ca][_0x266e('0x17')]()['split']('.')[0x0]+'Z';}return _0x5dc035;});_0x252f2d['use'](express[_0x266e('0x18')](_0x252f2d[_0x266e('0xb')](_0x266e('0xf'))));_0x252f2d[_0x266e('0xe')](_0x266e('0x19'),config['root']+_0x266e('0x1a'));_0x252f2d[_0x266e('0x1b')]('html',require(_0x266e('0x1c'))[_0x266e('0x1d')]);_0x252f2d[_0x266e('0xe')](_0x266e('0x1e'),_0x266e('0x1f'));_0x252f2d[_0x266e('0x16')](bodyParser[_0x266e('0x20')]({'limit':_0x266e('0x21'),'extended':!![]}));_0x252f2d[_0x266e('0x16')](bodyParser[_0x266e('0x22')]({'limit':_0x266e('0x21')}));_0x252f2d[_0x266e('0x16')](cors());_0x252f2d[_0x266e('0x16')](methodOverride());_0x252f2d['use'](cookieParser());_0x252f2d[_0x266e('0x16')](passport[_0x266e('0x23')]());}; \ No newline at end of file +var _0x75ec=['errorhandler','path','passport','cors','moment','../mysqldb','default','production','appPath','join','root','public','development','test','set','client','use','json\x20replacer','static','get','views','ejs','renderFile','urlencoded','50mb','json','initialize','express','serve-favicon','method-override','cookie-parser'];(function(_0x178ca4,_0x5aaa16){var _0x57f6a8=function(_0x237032){while(--_0x237032){_0x178ca4['push'](_0x178ca4['shift']());}};_0x57f6a8(++_0x5aaa16);}(_0x75ec,0x1ae));var _0xc75e=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x75ec[_0x5d2803];return _0xdcad2c;};'use strict';var express=require(_0xc75e('0x0'));var favicon=require(_0xc75e('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0xc75e('0x2'));var cookieParser=require(_0xc75e('0x3'));var errorHandler=require(_0xc75e('0x4'));var path=require(_0xc75e('0x5'));var passport=require(_0xc75e('0x6'));var cors=require(_0xc75e('0x7'));var moment=require(_0xc75e('0x8'));var config=require('./environment');var db=require(_0xc75e('0x9'))['db'];exports[_0xc75e('0xa')]=function(_0x35c9e8){var _0x364863=_0x35c9e8['get']('env');if(_0x364863===_0xc75e('0xb')){_0x35c9e8['set'](_0xc75e('0xc'),path[_0xc75e('0xd')](config[_0xc75e('0xe')],_0xc75e('0xf')));}if(_0x364863===_0xc75e('0x10')||_0x364863===_0xc75e('0x11')){_0x35c9e8[_0xc75e('0x12')]('appPath',path[_0xc75e('0xd')](config[_0xc75e('0xe')],_0xc75e('0x13')));_0x35c9e8[_0xc75e('0x14')](errorHandler());}_0x35c9e8['set'](_0xc75e('0x15'),function(_0x5779e1,_0x33cb80){if(this[_0x5779e1]instanceof Date){_0x33cb80=this[_0x5779e1]['toISOString']()['split']('.')[0x0]+'Z';}return _0x33cb80;});_0x35c9e8[_0xc75e('0x14')](express[_0xc75e('0x16')](_0x35c9e8[_0xc75e('0x17')](_0xc75e('0xc'))));_0x35c9e8[_0xc75e('0x12')](_0xc75e('0x18'),config[_0xc75e('0xe')]+'/server/views');_0x35c9e8['engine']('html',require(_0xc75e('0x19'))[_0xc75e('0x1a')]);_0x35c9e8['set']('view\x20engine','html');_0x35c9e8[_0xc75e('0x14')](bodyParser[_0xc75e('0x1b')]({'limit':_0xc75e('0x1c'),'extended':!![]}));_0x35c9e8['use'](bodyParser[_0xc75e('0x1d')]({'limit':'50mb'}));_0x35c9e8[_0xc75e('0x14')](cors());_0x35c9e8[_0xc75e('0x14')](methodOverride());_0x35c9e8['use'](cookieParser());_0x35c9e8[_0xc75e('0x14')](passport[_0xc75e('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index c0833c0..21d6ca9 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 _0xf9ad=['createHash','md5','update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','orderBy','keys','length','family','internal','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','join'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf9ad,0x117));var _0xdf9a=function(_0x5c7f6d,_0x5d03a3){_0x5c7f6d=_0x5c7f6d-0x0;var _0x128160=_0xf9ad[_0x5c7f6d];return _0x128160;};'use strict';var _=require(_0xdf9a('0x0'));var os=require('os');var crypto=require(_0xdf9a('0x1'));var machine=require(_0xdf9a('0x2'));var exec=require(_0xdf9a('0x3'))['execSync'];var config=require(_0xdf9a('0x4'));function getInterfaces(){var _0x4b09c3=[];var _0x6dd1fb=os['networkInterfaces']();var _0x1add5d=_[_0xdf9a('0x5')](_[_0xdf9a('0x6')](_0x6dd1fb));for(var _0x2da00b=0x0;_0x2da00b<_0x1add5d[_0xdf9a('0x7')];_0x2da00b++){var _0x3c1ec5=_0x6dd1fb[_0x1add5d[_0x2da00b]]['filter'](function(_0x240c88){return _0x240c88[_0xdf9a('0x8')]==='IPv4'&&_0x240c88[_0xdf9a('0x9')]===![];});_0x4b09c3=_0x4b09c3['concat'](_0x3c1ec5);}return _0x4b09c3;}function getFirstInterface(){var _0x6c6a83=_[_0xdf9a('0xa')](getInterfaces());return{'macAddress':_0x6c6a83&&_0x6c6a83[_0xdf9a('0xb')]?_0x6c6a83['mac']:_0xdf9a('0xc'),'ipAddress':_0x6c6a83&&_0x6c6a83[_0xdf9a('0xd')]?_0x6c6a83[_0xdf9a('0xd')]:'127.0.0.1'};}exports[_0xdf9a('0xe')]=getFirstInterface;function getCPUhash(){var _0x335a6c=_[_0xdf9a('0x5')](os[_0xdf9a('0xf')]()[_0xdf9a('0x10')](function(_0x10d0b2){return _0x10d0b2['model'];}))[_0xdf9a('0x11')](':');return crypto[_0xdf9a('0x12')](_0xdf9a('0x13'))[_0xdf9a('0x14')](_0x335a6c)['digest'](_0xdf9a('0x15'));}exports[_0xdf9a('0x16')]=function(){var _0x1d5bb7=os[_0xdf9a('0x17')]();var _0x4d99c5=/[0-9a-f-]{36}/;if(config[_0xdf9a('0x18')]&&_0x4d99c5['test'](config[_0xdf9a('0x18')])){return config['licenseToken'];}else if(_0x1d5bb7===_0xdf9a('0x19')){return exec(_0xdf9a('0x1a'),{'encoding':_0xdf9a('0x1b')})[_0xdf9a('0x1c')]('\x0d\x0a','');}else{var _0x2516a3=getFirstInterface();var _0x460185=getCPUhash();var _0x3a82c8=_0x460185+'|'+os['hostname']()+'|'+_0x2516a3[_0xdf9a('0x1d')]+'|'+_0x2516a3[_0xdf9a('0x1e')];var _0x589d0f=crypto['createHash'](_0xdf9a('0x13'))[_0xdf9a('0x14')](_0x3a82c8)[_0xdf9a('0x1f')](_0xdf9a('0x15'));return _0x589d0f[_0xdf9a('0x20')](0x0,0x8)+'-'+_0x589d0f[_0xdf9a('0x20')](0x8,0xc)+'-'+_0x589d0f[_0xdf9a('0x20')](0xc,0x10)+'-'+_0x589d0f[_0xdf9a('0x20')](0x10,0x14)+'-'+_0x589d0f[_0xdf9a('0x20')](0x14);}}; \ No newline at end of file +var _0x7477=['platform','licenseToken','win32','utf8','hostname','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','head','mac','address','cpus','model','join','createHash','md5','update','digest','hex','getUuid'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x7477,0x100));var _0x7747=function(_0x125a8a,_0x490d31){_0x125a8a=_0x125a8a-0x0;var _0xe767a5=_0x7477[_0x125a8a];return _0xe767a5;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x7747('0x0'));var exec=require(_0x7747('0x1'))['execSync'];var config=require(_0x7747('0x2'));function getInterfaces(){var _0x5ef208=[];var _0x35cecb=os[_0x7747('0x3')]();var _0xa8ae2f=_[_0x7747('0x4')](_[_0x7747('0x5')](_0x35cecb));for(var _0x48abfb=0x0;_0x48abfb<_0xa8ae2f[_0x7747('0x6')];_0x48abfb++){var _0x2bfd34=_0x35cecb[_0xa8ae2f[_0x48abfb]][_0x7747('0x7')](function(_0x220fd3){return _0x220fd3[_0x7747('0x8')]===_0x7747('0x9')&&_0x220fd3[_0x7747('0xa')]===![];});_0x5ef208=_0x5ef208['concat'](_0x2bfd34);}return _0x5ef208;}function getFirstInterface(){var _0x38c105=_[_0x7747('0xb')](getInterfaces());return{'macAddress':_0x38c105&&_0x38c105[_0x7747('0xc')]?_0x38c105[_0x7747('0xc')]:'00:00:00:00:00:00','ipAddress':_0x38c105&&_0x38c105['address']?_0x38c105[_0x7747('0xd')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x126b12=_[_0x7747('0x4')](os[_0x7747('0xe')]()['map'](function(_0x59fb13){return _0x59fb13[_0x7747('0xf')];}))[_0x7747('0x10')](':');return crypto[_0x7747('0x11')](_0x7747('0x12'))[_0x7747('0x13')](_0x126b12)[_0x7747('0x14')](_0x7747('0x15'));}exports[_0x7747('0x16')]=function(){var _0x30ceb6=os[_0x7747('0x17')]();var _0x5efb7e=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x5efb7e['test'](config[_0x7747('0x18')])){return config[_0x7747('0x18')];}else if(_0x30ceb6===_0x7747('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x7747('0x1a')})['replace']('\x0d\x0a','');}else{var _0xbd9e5d=getFirstInterface();var _0x1381e5=getCPUhash();var _0x4a4a99=_0x1381e5+'|'+os[_0x7747('0x1b')]()+'|'+_0xbd9e5d[_0x7747('0x1c')]+'|'+_0xbd9e5d[_0x7747('0x1d')];var _0x16a330=crypto['createHash'](_0x7747('0x12'))[_0x7747('0x13')](_0x4a4a99)['digest'](_0x7747('0x15'));return _0x16a330[_0x7747('0x1e')](0x0,0x8)+'-'+_0x16a330[_0x7747('0x1e')](0x8,0xc)+'-'+_0x16a330['substring'](0xc,0x10)+'-'+_0x16a330[_0x7747('0x1e')](0x10,0x14)+'-'+_0x16a330[_0x7747('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a40e849..67520d2 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 _0x80a4=['data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','License','spread','default','util','request-promise','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get'];(function(_0x1797a8,_0xdf273a){var _0x4feaab=function(_0x50d16a){while(--_0x50d16a){_0x1797a8['push'](_0x1797a8['shift']());}};_0x4feaab(++_0xdf273a);}(_0x80a4,0x1d3));var _0x480a=function(_0x3a3a7d,_0x58e12f){_0x3a3a7d=_0x3a3a7d-0x0;var _0x82c974=_0x80a4[_0x3a3a7d];return _0x82c974;};'use strict';var util=require(_0x480a('0x0'));var moment=require('moment');var rp=require(_0x480a('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0x480a('0x2'))['db'];var encryptor=require(_0x480a('0x3'));var hardware=require('./hardware');var logger=require(_0x480a('0x4'))(_0x480a('0x5'));var HOST=_0x480a('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x289cfc){return new BPromise(function(_0x38a95a,_0x887bf9){var _0x1938c4=util[_0x480a('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0x289cfc,module[_0x480a('0x8')][_0x480a('0x9')]);if(oldToken){_0x1938c4=util[_0x480a('0x7')](_0x480a('0xa'),HOST,_0x289cfc,module[_0x480a('0x8')][_0x480a('0x9')],oldToken);}var _0x60a0f2={'uri':_0x1938c4,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x60a0f2)[_0x480a('0xb')](function(_0x1edf54){_0x38a95a(_0x1edf54);})[_0x480a('0xc')](function(_0x4f4d64){_0x887bf9(_0x4f4d64);});});}function manageLicense(_0x3f4d89,_0xce9ef4){var _0x4834a7=_0xce9ef4[_0x480a('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x4834a7[_0x480a('0xe')]!==_0x3f4d89&&!_0x4834a7[_0x480a('0xf')]){oldToken=_0x4834a7[_0x480a('0xe')];}httpRequest(_0x3f4d89)[_0x480a('0xb')](function(_0x33da1c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x33da1c[_0x480a('0x10')]){isOldTokenSent=![];if(!_0x4834a7[_0x480a('0x5')]&&_0x4834a7[_0x480a('0x5')]!=_0x33da1c[_0x480a('0x5')]||_0x4834a7['license']&&_0x4834a7['data2']){logger[_0x480a('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4834a7['license']&&!_0x4834a7[_0x480a('0xf')]&&_0x4834a7['license']!=_0x33da1c[_0x480a('0x5')]){logger[_0x480a('0x11')](_0x480a('0x12'));}if(_0x4834a7[_0x480a('0x5')]&&!_0x4834a7[_0x480a('0xf')]&&_0x4834a7['license']==_0x33da1c[_0x480a('0x5')]){return _0xce9ef4;}return _0xce9ef4[_0x480a('0x13')]({'data1':_0x3f4d89,'data2':null,'license':_0x33da1c['license']});}else{if(_0x33da1c[_0x480a('0x5')]||_0x4834a7[_0x480a('0x5')]){if(!_0x4834a7['data2']){if(_0x4834a7['data1']==_0x3f4d89){GRAY_PERIOD_REASON=_0x480a('0x14');logger[_0x480a('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x480a('0x15');logger['info'](_0x480a('0x16'),_0x4834a7[_0x480a('0xe')],_0x3f4d89);}logger[_0x480a('0x11')](_0x480a('0x17'),GRAY_PERIOD_REASON[_0x480a('0x18')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xce9ef4['update']({'data2':encryptor[_0x480a('0x19')](moment()[_0x480a('0x7')](_0x480a('0x1a')))});}else{if(moment()[_0x480a('0x1b')](encryptor[_0x480a('0x1c')](_0x4834a7[_0x480a('0xf')]),_0x480a('0x1d'))>DAYS){logger['info'](_0x480a('0x1e'),moment()[_0x480a('0x7')](_0x480a('0x1a')));isOldTokenSent=![];return _0xce9ef4[_0x480a('0x13')]({'data1':_0x3f4d89,'data2':null,'license':null});}}}else{if(_0x4834a7[_0x480a('0xe')]!=_0x3f4d89){logger[_0x480a('0x11')](_0x480a('0x16'),_0x4834a7['data1'],_0x3f4d89);return _0xce9ef4[_0x480a('0x13')]({'data1':_0x3f4d89,'data2':null,'license':null});}}}return _0xce9ef4;})[_0x480a('0xb')](function(_0x4b4488){_0xce9ef4=_0x4b4488;})[_0x480a('0xc')](function(_0x354db2){logger[_0x480a('0x1f')](_0x354db2[_0x480a('0x20')]);})[_0x480a('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xce9ef4);},TIME);});}function defaultLicense(){var _0x15593b=hardware['getUuid']();if(_0x15593b){return db[_0x480a('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x15593b}})[_0x480a('0x23')](function(_0x13a803,_0x3c99bf){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x15593b);manageLicense(_0x15593b,_0x13a803);})[_0x480a('0xc')](function(_0x16bef3){logger['error'](_0x16bef3[_0x480a('0x20')]);});}}exports[_0x480a('0x24')]=defaultLicense; \ No newline at end of file +var _0xdef6=['moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','then','catch','get','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','format','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s'];(function(_0x8f10f2,_0x33a7e4){var _0x1690c8=function(_0x22b94d){while(--_0x22b94d){_0x8f10f2['push'](_0x8f10f2['shift']());}};_0x1690c8(++_0x33a7e4);}(_0xdef6,0xc3));var _0x6def=function(_0x1e50fc,_0x3d2684){_0x1e50fc=_0x1e50fc-0x0;var _0x497f51=_0xdef6[_0x1e50fc];return _0x497f51;};'use strict';var util=require('util');var moment=require(_0x6def('0x0'));var rp=require(_0x6def('0x1'));var BPromise=require(_0x6def('0x2'));var pkginfo=require(_0x6def('0x3'))(module,'version');var db=require(_0x6def('0x4'))['db'];var encryptor=require(_0x6def('0x5'));var hardware=require(_0x6def('0x6'));var logger=require('../logger')(_0x6def('0x7'));var HOST=_0x6def('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x289bc4){return new BPromise(function(_0x5d953f,_0x25cbf1){var _0x221bd1=util['format'](_0x6def('0x9'),HOST,_0x289bc4,module[_0x6def('0xa')]['version']);if(oldToken){_0x221bd1=util['format'](_0x6def('0xb'),HOST,_0x289bc4,module['exports'][_0x6def('0xc')],oldToken);}var _0x1dbc14={'uri':_0x221bd1,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1dbc14)[_0x6def('0xd')](function(_0x11f50b){_0x5d953f(_0x11f50b);})[_0x6def('0xe')](function(_0x3d0885){_0x25cbf1(_0x3d0885);});});}function manageLicense(_0x24ef45,_0x46ab5f){var _0x2b30f7=_0x46ab5f[_0x6def('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x2b30f7['data1']!==_0x24ef45&&!_0x2b30f7['data2']){oldToken=_0x2b30f7[_0x6def('0x10')];}httpRequest(_0x24ef45)[_0x6def('0xd')](function(_0x1725b3){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1725b3[_0x6def('0x11')]){isOldTokenSent=![];if(!_0x2b30f7[_0x6def('0x7')]&&_0x2b30f7[_0x6def('0x7')]!=_0x1725b3[_0x6def('0x7')]||_0x2b30f7['license']&&_0x2b30f7['data2']){logger[_0x6def('0x12')](_0x6def('0x13'));}if(_0x2b30f7[_0x6def('0x7')]&&!_0x2b30f7[_0x6def('0x14')]&&_0x2b30f7[_0x6def('0x7')]!=_0x1725b3['license']){logger[_0x6def('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2b30f7[_0x6def('0x7')]&&!_0x2b30f7[_0x6def('0x14')]&&_0x2b30f7[_0x6def('0x7')]==_0x1725b3[_0x6def('0x7')]){return _0x46ab5f;}return _0x46ab5f[_0x6def('0x15')]({'data1':_0x24ef45,'data2':null,'license':_0x1725b3[_0x6def('0x7')]});}else{if(_0x1725b3['license']||_0x2b30f7[_0x6def('0x7')]){if(!_0x2b30f7[_0x6def('0x14')]){if(_0x2b30f7[_0x6def('0x10')]==_0x24ef45){GRAY_PERIOD_REASON=_0x6def('0x16');logger['info'](_0x6def('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x6def('0x12')](_0x6def('0x18'),_0x2b30f7[_0x6def('0x10')],_0x24ef45);}logger[_0x6def('0x12')](_0x6def('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x6def('0x1a')](_0x6def('0x1b')));return _0x46ab5f['update']({'data2':encryptor['encryptString'](moment()['format'](_0x6def('0x1b')))});}else{if(moment()[_0x6def('0x1c')](encryptor[_0x6def('0x1d')](_0x2b30f7['data2']),_0x6def('0x1e'))>DAYS){logger[_0x6def('0x12')](_0x6def('0x1f'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x46ab5f[_0x6def('0x15')]({'data1':_0x24ef45,'data2':null,'license':null});}}}else{if(_0x2b30f7[_0x6def('0x10')]!=_0x24ef45){logger[_0x6def('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2b30f7[_0x6def('0x10')],_0x24ef45);return _0x46ab5f[_0x6def('0x15')]({'data1':_0x24ef45,'data2':null,'license':null});}}}return _0x46ab5f;})['then'](function(_0x5b5b6a){_0x46ab5f=_0x5b5b6a;})[_0x6def('0xe')](function(_0x51a180){logger[_0x6def('0x20')](_0x51a180[_0x6def('0x21')]);})[_0x6def('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x6def('0x23')](),_0x46ab5f);},TIME);});}function defaultLicense(){var _0x12e8da=hardware['getUuid']();if(_0x12e8da){return db[_0x6def('0x24')][_0x6def('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x12e8da}})['spread'](function(_0x2768a3,_0x269cd7){logger[_0x6def('0x12')](_0x6def('0x26'),_0x12e8da);manageLicense(_0x12e8da,_0x2768a3);})[_0x6def('0xe')](function(_0x1db1eb){logger[_0x6def('0x20')](_0x1db1eb[_0x6def('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c6f7a61..c1e3d1f 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 _0x42af=['User','role','COUNT','col','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','gray','deadline','add','days','machineUuid','changed','disabled','message'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x42af,0xb6));var _0xf42a=function(_0x4c794a,_0x20b8aa){_0x4c794a=_0x4c794a-0x0;var _0x3006f6=_0x42af[_0x4c794a];return _0x3006f6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xf42a('0x0'));var BPromise=require(_0xf42a('0x1'));var hardware=require(_0xf42a('0x2'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf42a('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf42a('0x4'),'machineUuid':hardware[_0xf42a('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x134888){return new BPromise(function(_0x1374c1,_0x117c0){return db[_0xf42a('0x6')][_0xf42a('0x7')](_[_0xf42a('0x8')](_0x134888,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3391c3){return checkLicense(_0x3391c3,null);})[_0xf42a('0x9')](function(_0x540b39){_0x1374c1(_0x540b39);return;})[_0xf42a('0xa')](function(_0xaa9dfd){_0x117c0(_0xaa9dfd);});});}function checkLicense(_0x4f4df0,_0x521de4){if(!_0x4f4df0){demoLicense[_0xf42a('0xb')]=_0x4f4df0[_0xf42a('0xc')];return demoLicense;}try{var _0x518a6a=_0x521de4||_0x4f4df0['license'];if(_['isEmpty'](_0x518a6a)){throw new Error(_0xf42a('0xd'));}var _0x41e77f=_0x4f4df0[_0xf42a('0xc')];var _0x55d605=_0x4f4df0[_0xf42a('0xe')];var _0x2731ea=_0x41e77f[_0xf42a('0xf')]('-')[0x4];var _0x4acd30=_0x41e77f[_0xf42a('0xf')]('-')[0x0];var _0x2c2623=encryptor['decryptString'](_0x518a6a,util[_0xf42a('0x10')](_0xf42a('0x11'),_0x2731ea,_0x41e77f,_0x4acd30));var _0x4b1c76=JSON[_0xf42a('0x12')](_0x2c2623);_0x4b1c76[_0xf42a('0x13')]=![];_0x4b1c76['uuid']=_0x41e77f;_0x4b1c76['machineUuid']=hardware['getUuid']();if(_0x55d605){var _0x5ea148=encryptor['decryptString'](_0x55d605);_0x4b1c76[_0xf42a('0x14')]=_0x5ea148;_0x4b1c76[_0xf42a('0x15')]=moment(_0x5ea148)[_0xf42a('0x16')](0x7,_0xf42a('0x17'))[_0xf42a('0x10')]();_0x4b1c76['grayReason']=_0x4b1c76[_0xf42a('0xb')]!=_0x4b1c76[_0xf42a('0x18')]?_0xf42a('0x19'):_0xf42a('0x1a');}return _0x4b1c76;}catch(_0x1944b0){breakingLicense[_0xf42a('0xb')]=_0x4f4df0[_0xf42a('0xc')];breakingLicense['message']=_0x1944b0[_0xf42a('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d2aee,_0x49e463){getLicense()[_0xf42a('0x9')](function(_0xdd03b6){return db[_0xf42a('0x1c')]['findAll']({'attributes':[_0xf42a('0x1d'),[db['sequelize']['fn'](_0xf42a('0x1e'),db['sequelize'][_0xf42a('0x1f')](_0xf42a('0x1d'))),'count']],'group':_0xf42a('0x1d'),'where':{'role':{'$or':[_0xf42a('0x20'),_0xf42a('0x21'),_0xf42a('0x22')]}},'raw':!![]})[_0xf42a('0x9')](function(_0x3b68d0){var _0x53ae45={'user':_0xdd03b6[_0xf42a('0x23')]||0x0,'telephone':_0xdd03b6[_0xf42a('0x24')]||0x0};_0x3b68d0[_0xf42a('0x25')](function(_0x244066){var _0x213bdc=_0x244066['role']==='admin'?_0xf42a('0x21'):_0x244066['role'];_0x53ae45[_0x213bdc]-=_0x244066['count'];if(_0x53ae45[_0x213bdc]<0x0)_0x53ae45[_0x213bdc]=0x0;});_0x4d2aee(_0x53ae45);return;});})[_0xf42a('0xa')](function(_0x26b7f7){_0x49e463(_0x26b7f7);});});}function checkUserLimits(_0x5442cc){return new BPromise(function(_0x2c4123,_0x31a75e){getLimits()['then'](function(_0x13a8ac){var _0x45d2cf=_[_0xf42a('0x26')](_[_0xf42a('0x27')](_0x5442cc,_0xf42a('0x1d')),[_0xf42a('0x20'),'user',_0xf42a('0x22')]);var _0x27636b=(_0x45d2cf['admin']||0x0)+(_0x45d2cf[_0xf42a('0x21')]||0x0);var _0x205895=_0x45d2cf[_0xf42a('0x22')]||0x0;if(_0x27636b>_0x13a8ac[_0xf42a('0x21')])return _0x31a75e('License\x20limit\x20reached\x20for\x20users');if(_0x205895>_0x13a8ac['telephone'])return _0x31a75e(_0xf42a('0x28'));return _0x2c4123();})[_0xf42a('0xa')](function(_0x1c066a){_0x31a75e(_0x1c066a);});});}module[_0xf42a('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x1f14=['bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','gray','deadline','disabled','message','User','findAll','role','sequelize','COUNT','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x1f14,0xfa));var _0x41f1=function(_0x2a35c7,_0x1085b9){_0x2a35c7=_0x2a35c7-0x0;var _0x5d89a4=_0x1f14[_0x2a35c7];return _0x5d89a4;};'use strict';var util=require(_0x41f1('0x0'));var _=require(_0x41f1('0x1'));var moment=require('moment');var BPromise=require(_0x41f1('0x2'));var hardware=require(_0x41f1('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x41f1('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x41f1('0x5'),'machineUuid':hardware[_0x41f1('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x41f1('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x41f1('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1b48a9){return new BPromise(function(_0x3ddafb,_0x26100a){return db['License']['find'](_['defaults'](_0x1b48a9,{'raw':!![],'where':{'id':0x1}}))[_0x41f1('0x9')](function(_0x2e024a){return checkLicense(_0x2e024a,null);})[_0x41f1('0x9')](function(_0x144fb8){_0x3ddafb(_0x144fb8);return;})[_0x41f1('0xa')](function(_0x228ea6){_0x26100a(_0x228ea6);});});}function checkLicense(_0x198a90,_0x2f180){if(!_0x198a90){demoLicense[_0x41f1('0xb')]=_0x198a90[_0x41f1('0xc')];return demoLicense;}try{var _0x595013=_0x2f180||_0x198a90['license'];if(_[_0x41f1('0xd')](_0x595013)){throw new Error(_0x41f1('0xe'));}var _0x3dcb78=_0x198a90[_0x41f1('0xc')];var _0x3a2abc=_0x198a90[_0x41f1('0xf')];var _0x10ef44=_0x3dcb78[_0x41f1('0x10')]('-')[0x4];var _0xcd242a=_0x3dcb78[_0x41f1('0x10')]('-')[0x0];var _0x5cf2fe=encryptor[_0x41f1('0x11')](_0x595013,util[_0x41f1('0x12')]('%s:%s:%s',_0x10ef44,_0x3dcb78,_0xcd242a));var _0x4652ed=JSON[_0x41f1('0x13')](_0x5cf2fe);_0x4652ed[_0x41f1('0x14')]=![];_0x4652ed[_0x41f1('0xb')]=_0x3dcb78;_0x4652ed[_0x41f1('0x15')]=hardware[_0x41f1('0x6')]();if(_0x3a2abc){var _0x353845=encryptor['decryptString'](_0x3a2abc);_0x4652ed[_0x41f1('0x16')]=_0x353845;_0x4652ed[_0x41f1('0x17')]=moment(_0x353845)['add'](0x7,'days')[_0x41f1('0x12')]();_0x4652ed['grayReason']=_0x4652ed[_0x41f1('0xb')]!=_0x4652ed['machineUuid']?'changed':_0x41f1('0x18');}return _0x4652ed;}catch(_0x413802){breakingLicense[_0x41f1('0xb')]=_0x198a90[_0x41f1('0xc')];breakingLicense[_0x41f1('0x19')]=_0x413802['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x75c625,_0x139dd7){getLicense()[_0x41f1('0x9')](function(_0x4b0168){return db[_0x41f1('0x1a')][_0x41f1('0x1b')]({'attributes':[_0x41f1('0x1c'),[db[_0x41f1('0x1d')]['fn'](_0x41f1('0x1e'),db[_0x41f1('0x1d')]['col'](_0x41f1('0x1c'))),'count']],'group':_0x41f1('0x1c'),'where':{'role':{'$or':[_0x41f1('0x1f'),_0x41f1('0x20'),_0x41f1('0x21')]}},'raw':!![]})[_0x41f1('0x9')](function(_0x574b9c){var _0x5d986e={'user':_0x4b0168[_0x41f1('0x22')]||0x0,'telephone':_0x4b0168[_0x41f1('0x23')]||0x0};_0x574b9c[_0x41f1('0x24')](function(_0x7a0951){var _0x49d45f=_0x7a0951['role']===_0x41f1('0x1f')?'user':_0x7a0951[_0x41f1('0x1c')];_0x5d986e[_0x49d45f]-=_0x7a0951[_0x41f1('0x25')];if(_0x5d986e[_0x49d45f]<0x0)_0x5d986e[_0x49d45f]=0x0;});_0x75c625(_0x5d986e);return;});})[_0x41f1('0xa')](function(_0x1613c1){_0x139dd7(_0x1613c1);});});}function checkUserLimits(_0x1058c3){return new BPromise(function(_0x38b9b3,_0x346b28){getLimits()[_0x41f1('0x9')](function(_0x54129a){var _0x515aa3=_[_0x41f1('0x26')](_[_0x41f1('0x27')](_0x1058c3,'role'),[_0x41f1('0x1f'),_0x41f1('0x20'),_0x41f1('0x21')]);var _0x184315=(_0x515aa3[_0x41f1('0x1f')]||0x0)+(_0x515aa3[_0x41f1('0x20')]||0x0);var _0x28ca75=_0x515aa3[_0x41f1('0x21')]||0x0;if(_0x184315>_0x54129a[_0x41f1('0x20')])return _0x346b28(_0x41f1('0x28'));if(_0x28ca75>_0x54129a[_0x41f1('0x21')])return _0x346b28(_0x41f1('0x29'));return _0x38b9b3();})[_0x41f1('0xa')](function(_0x41279d){_0x346b28(_0x41279d);});});}module['exports']={'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 1b2214e..fa46952 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 _0xc2c7=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x1e8414,_0x599185){var _0x32fbce=function(_0x2ecad9){while(--_0x2ecad9){_0x1e8414['push'](_0x1e8414['shift']());}};_0x32fbce(++_0x599185);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3ce8a2,_0xb1a3d6){_0x3ce8a2=_0x3ce8a2-0x0;var _0x105bbc=_0xc2c7[_0x3ce8a2];return _0x105bbc;};'use strict';module['exports']={'DOMAIN':_0x7c2c('0x0'),'SESSION_SECRET':_0x7c2c('0x1'),'GOOGLE_ID':_0x7c2c('0x2'),'GOOGLE_SECRET':_0x7c2c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x8e3f=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x1d1934,_0x5e21ec){var _0x1ddab8=function(_0x411736){while(--_0x411736){_0x1d1934['push'](_0x1d1934['shift']());}};_0x1ddab8(++_0x5e21ec);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';module[_0xf8e3('0x0')]={'DOMAIN':_0xf8e3('0x1'),'SESSION_SECRET':_0xf8e3('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xf8e3('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index fab488f..3c209ba 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2981=['transports','File','info','Console','env','debugLevel','moment','winston','path','INFO','/var','log','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','Logger','%s-%s','error'];(function(_0x414919,_0x451fe4){var _0x4693c6=function(_0x58e817){while(--_0x58e817){_0x414919['push'](_0x414919['shift']());}};_0x4693c6(++_0x451fe4);}(_0x2981,0x11a));var _0x1298=function(_0x405df1,_0x42eaf9){_0x405df1=_0x405df1-0x0;var _0x2b1da6=_0x2981[_0x405df1];return _0x2b1da6;};'use strict';var moment=require(_0x1298('0x0'));var winston=require(_0x1298('0x1'));var util=require('util');var path=require(_0x1298('0x2'));var debugLevel=_0x1298('0x3');function filename(_0x418128,_0x5a2d58){return path['join'](_0x1298('0x4'),_0x1298('0x5'),'xcally',util[_0x1298('0x6')](_0x1298('0x7'),_0x418128,_0x5a2d58));}function formatter(_0x5a7cfe,_0xc2000d){_0xc2000d[_0x1298('0x8')]=_0xc2000d[_0x1298('0x8')][_0x1298('0x9')](/@@{/g,_0x1298('0xa'))['replace'](/}@@/g,_0x1298('0xb'))[_0x1298('0x9')](/@{/g,'{{')[_0x1298('0x9')](/}@/g,'}}');return util[_0x1298('0x6')](_0x1298('0xc'),moment()[_0x1298('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0xc2000d['level'][_0x1298('0xd')](),_0x5a7cfe,_0xc2000d[_0x1298('0x8')]);}module['exports']=function(_0x2b0c1d){return new winston[(_0x1298('0xe'))]({'transports':[new winston['transports']['File']({'name':util[_0x1298('0x6')](_0x1298('0xf'),_0x2b0c1d,_0x1298('0x10')),'filename':filename(_0x2b0c1d,_0x1298('0x10')),'level':_0x1298('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2cc5ba){return formatter(_0x2b0c1d,_0x2cc5ba);}}),new winston[(_0x1298('0x11'))][(_0x1298('0x12'))]({'name':util['format']('%s-%s',_0x2b0c1d,'info'),'filename':filename(_0x2b0c1d,_0x1298('0x13')),'level':_0x1298('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xeb70ba){return formatter(_0x2b0c1d,_0xeb70ba);}}),new winston['transports'][(_0x1298('0x14'))]({'level':process[_0x1298('0x15')][_0x1298('0x16')]||debugLevel,'json':![],'formatter':function(_0x601acb){return formatter(_0x2b0c1d,_0x601acb);}})]});}; \ No newline at end of file +var _0xf0c6=['Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','exports','Logger','transports','File','error','%s-%s','info'];(function(_0x2925a0,_0x115323){var _0x2fe54e=function(_0x3629ea){while(--_0x3629ea){_0x2925a0['push'](_0x2925a0['shift']());}};_0x2fe54e(++_0x115323);}(_0xf0c6,0xa5));var _0x6f0c=function(_0xd2c706,_0x4dcc0e){_0xd2c706=_0xd2c706-0x0;var _0x2416d1=_0xf0c6[_0xd2c706];return _0x2416d1;};'use strict';var moment=require(_0x6f0c('0x0'));var winston=require(_0x6f0c('0x1'));var util=require(_0x6f0c('0x2'));var path=require(_0x6f0c('0x3'));var debugLevel=_0x6f0c('0x4');function filename(_0x340eca,_0x19b55e){return path[_0x6f0c('0x5')](_0x6f0c('0x6'),_0x6f0c('0x7'),_0x6f0c('0x8'),util[_0x6f0c('0x9')](_0x6f0c('0xa'),_0x340eca,_0x19b55e));}function formatter(_0x140ad8,_0x2571e8){_0x2571e8['message']=_0x2571e8[_0x6f0c('0xb')]['replace'](/@@{/g,_0x6f0c('0xc'))[_0x6f0c('0xd')](/}@@/g,_0x6f0c('0xe'))[_0x6f0c('0xd')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x6f0c('0x9')](_0x6f0c('0xf'),moment()[_0x6f0c('0x9')](_0x6f0c('0x10')),_0x2571e8['level']['toUpperCase'](),_0x140ad8,_0x2571e8[_0x6f0c('0xb')]);}module[_0x6f0c('0x11')]=function(_0x25c14e){return new winston[(_0x6f0c('0x12'))]({'transports':[new winston[(_0x6f0c('0x13'))][(_0x6f0c('0x14'))]({'name':util[_0x6f0c('0x9')]('%s-%s',_0x25c14e,'error'),'filename':filename(_0x25c14e,_0x6f0c('0x15')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x615ea2){return formatter(_0x25c14e,_0x615ea2);}}),new winston[(_0x6f0c('0x13'))]['File']({'name':util['format'](_0x6f0c('0x16'),_0x25c14e,_0x6f0c('0x17')),'filename':filename(_0x25c14e,'info'),'level':_0x6f0c('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4343df){return formatter(_0x25c14e,_0x4343df);}}),new winston[(_0x6f0c('0x13'))][(_0x6f0c('0x18'))]({'level':process[_0x6f0c('0x19')][_0x6f0c('0x1a')]||debugLevel,'json':![],'formatter':function(_0x1b4bf3){return formatter(_0x25c14e,_0x1b4bf3);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 94e9e89..d8f8e57 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 _0x4011=['path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x157f1c,_0x329bdb){var _0x552cd8=function(_0xc969d1){while(--_0xc969d1){_0x157f1c['push'](_0x157f1c['shift']());}};_0x552cd8(++_0x329bdb);}(_0x4011,0x138));var _0x1401=function(_0x21a209,_0x1b8347){_0x21a209=_0x21a209-0x0;var _0x40c2a8=_0x4011[_0x21a209];return _0x40c2a8;};'use strict';var path=require(_0x1401('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x1401('0x1')](__dirname,_0x1401('0x2'))},{'name':_0x1401('0x3'),'script':path[_0x1401('0x1')](__dirname,_0x1401('0x4'))},{'name':_0x1401('0x5'),'script':path['join'](__dirname,_0x1401('0x6'))},{'name':_0x1401('0x7'),'script':path[_0x1401('0x1')](__dirname,_0x1401('0x8'))},{'name':'routing','script':path['join'](__dirname,_0x1401('0x9'))},{'name':_0x1401('0xa'),'script':path[_0x1401('0x1')](__dirname,_0x1401('0xb'))}]};module[_0x1401('0xc')]=config; \ No newline at end of file +var _0xd1cc=['xdr','../../services/xdr/index.js','exports','path','express','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x30962e,_0x489dd2){var _0x621b93=function(_0xe2cd75){while(--_0xe2cd75){_0x30962e['push'](_0x30962e['shift']());}};_0x621b93(++_0x489dd2);}(_0xd1cc,0x1a7));var _0xcd1c=function(_0x15b2f3,_0x55306e){_0x15b2f3=_0x15b2f3-0x0;var _0x17bddd=_0xd1cc[_0x15b2f3];return _0x17bddd;};'use strict';var path=require(_0xcd1c('0x0'));var os=require('os');var config={'apps':[{'name':_0xcd1c('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xcd1c('0x2'),'script':path[_0xcd1c('0x3')](__dirname,_0xcd1c('0x4'))},{'name':_0xcd1c('0x5'),'script':path[_0xcd1c('0x3')](__dirname,_0xcd1c('0x6'))},{'name':_0xcd1c('0x7'),'script':path['join'](__dirname,_0xcd1c('0x8'))},{'name':_0xcd1c('0x9'),'script':path[_0xcd1c('0x3')](__dirname,_0xcd1c('0xa'))},{'name':_0xcd1c('0xb'),'script':path[_0xcd1c('0x3')](__dirname,_0xcd1c('0xc'))}]};module[_0xcd1c('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f0bf4f8..8d9f565 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 _0x377b=['connected','start','disconnect','stop','restart','then','list','describe','delete','saved','pm2','connect'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x377b,0x166));var _0xb377=function(_0x285ef2,_0x232733){_0x285ef2=_0x285ef2-0x0;var _0x185277=_0x377b[_0x285ef2];return _0x185277;};'use strict';var pm2=require(_0xb377('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x32c9f8,_0x46fe62){return pm2[_0xb377('0x1')](function(_0x4b5d2c){if(_0x4b5d2c){return _0x46fe62(_0x4b5d2c);}return _0x32c9f8(_0xb377('0x2'));});});};exports['start']=function(_0x599fe0){return connect()['then'](function(){return new BPromise(function(_0x15b961,_0x1ae81f){return pm2[_0xb377('0x3')](_0x599fe0,function(_0x3706d2,_0x54864a){if(_0x3706d2){return _0x1ae81f(_0x3706d2);}pm2[_0xb377('0x4')]();return _0x15b961(_0x54864a);});});});};exports[_0xb377('0x5')]=function(_0x2ceeec){return connect()['then'](function(){return new BPromise(function(_0x3ccebf,_0xcb53fc){return pm2[_0xb377('0x5')](_0x2ceeec,function(_0x34c6fd,_0x323ada){if(_0x34c6fd){return _0xcb53fc(_0x34c6fd);}pm2['disconnect']();return _0x3ccebf(_0x323ada);});});});};exports[_0xb377('0x6')]=function(_0xc1a5bd){return connect()[_0xb377('0x7')](function(){return new BPromise(function(_0x25235f,_0x2d82bb){return pm2[_0xb377('0x6')](_0xc1a5bd,function(_0x544dfb,_0x2e0f3b){if(_0x544dfb){return _0x2d82bb(_0x544dfb);}pm2[_0xb377('0x4')]();return _0x25235f(_0x2e0f3b);});});});};exports[_0xb377('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1e3d60,_0x3b97c8){return pm2[_0xb377('0x8')](function(_0x53dcd0,_0x4e00f6){if(_0x53dcd0){return _0x3b97c8(_0x53dcd0);}pm2[_0xb377('0x4')]();return _0x1e3d60(_0x4e00f6);});});});};exports[_0xb377('0x9')]=function(_0x5f1dd0){return connect()[_0xb377('0x7')](function(){return new BPromise(function(_0x17ace1,_0x3c187f){return pm2[_0xb377('0x9')](_0x5f1dd0,function(_0x3e0512,_0xc68c30){if(_0x3e0512){return _0x3c187f(_0x3e0512);}pm2['disconnect']();return _0x17ace1(_0xc68c30);});});});};exports['delete']=function(_0x285757){return connect()[_0xb377('0x7')](function(){return new BPromise(function(_0x34672c,_0x5f4441){return pm2[_0xb377('0xa')](_0x285757,function(_0x3760f5,_0x2fdfae){if(_0x3760f5){return _0x5f4441(_0x3760f5);}pm2[_0xb377('0x4')]();return _0x34672c(_0x2fdfae);});});});};exports['dump']=function(){return connect()[_0xb377('0x7')](function(){return new BPromise(function(_0x295a8f,_0x4fbd23){return pm2['dump'](function(_0x236c06){if(_0x236c06){return _0x4fbd23(_0x236c06);}return _0x295a8f(_0xb377('0xb'));});});});}; \ No newline at end of file +var _0xe835=['pm2','bluebird','connected','start','then','stop','disconnect','restart','list','describe','delete','dump'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xe835,0x1c8));var _0x5e83=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xe835[_0x53b8e0];return _0x10630c;};'use strict';var pm2=require(_0x5e83('0x0'));var BPromise=require(_0x5e83('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x2706cd,_0x218d0e){return pm2['connect'](function(_0x1ae020){if(_0x1ae020){return _0x218d0e(_0x1ae020);}return _0x2706cd(_0x5e83('0x2'));});});};exports[_0x5e83('0x3')]=function(_0x1d2b2e){return connect()[_0x5e83('0x4')](function(){return new BPromise(function(_0x2f7e31,_0x1af6f2){return pm2[_0x5e83('0x3')](_0x1d2b2e,function(_0x3733e9,_0x540917){if(_0x3733e9){return _0x1af6f2(_0x3733e9);}pm2['disconnect']();return _0x2f7e31(_0x540917);});});});};exports[_0x5e83('0x5')]=function(_0x718371){return connect()[_0x5e83('0x4')](function(){return new BPromise(function(_0x4659a6,_0x139758){return pm2['stop'](_0x718371,function(_0x123658,_0x211f4e){if(_0x123658){return _0x139758(_0x123658);}pm2[_0x5e83('0x6')]();return _0x4659a6(_0x211f4e);});});});};exports[_0x5e83('0x7')]=function(_0x47eec3){return connect()[_0x5e83('0x4')](function(){return new BPromise(function(_0x3d363c,_0x402646){return pm2[_0x5e83('0x7')](_0x47eec3,function(_0x3365e3,_0x48445c){if(_0x3365e3){return _0x402646(_0x3365e3);}pm2[_0x5e83('0x6')]();return _0x3d363c(_0x48445c);});});});};exports[_0x5e83('0x8')]=function(){return connect()[_0x5e83('0x4')](function(){return new BPromise(function(_0x27d0f2,_0x508c75){return pm2[_0x5e83('0x8')](function(_0x12e9eb,_0x282da2){if(_0x12e9eb){return _0x508c75(_0x12e9eb);}pm2[_0x5e83('0x6')]();return _0x27d0f2(_0x282da2);});});});};exports['describe']=function(_0x4b0f15){return connect()['then'](function(){return new BPromise(function(_0x34ba45,_0x27dfbf){return pm2[_0x5e83('0x9')](_0x4b0f15,function(_0x27998c,_0x262fe1){if(_0x27998c){return _0x27dfbf(_0x27998c);}pm2[_0x5e83('0x6')]();return _0x34ba45(_0x262fe1);});});});};exports[_0x5e83('0xa')]=function(_0x3218cb){return connect()['then'](function(){return new BPromise(function(_0x12904a,_0x311409){return pm2[_0x5e83('0xa')](_0x3218cb,function(_0xe28e9,_0x532d8a){if(_0xe28e9){return _0x311409(_0xe28e9);}pm2[_0x5e83('0x6')]();return _0x12904a(_0x532d8a);});});});};exports[_0x5e83('0xb')]=function(){return connect()[_0x5e83('0x4')](function(){return new BPromise(function(_0x1802f6,_0x2547e8){return pm2['dump'](function(_0x4e3fc0){if(_0x4e3fc0){return _0x2547e8(_0x4e3fc0);}return _0x1802f6('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7f36580..d8ba69d 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 _0x78fe=['lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x78fe,0x144));var _0xe78f=function(_0x3c2631,_0x1905f7){_0x3c2631=_0x3c2631-0x0;var _0x1f6f46=_0x78fe[_0x3c2631];return _0x1f6f46;};'use strict';var _=require(_0xe78f('0x0'));var moment=require(_0xe78f('0x1'));var Redis=require(_0xe78f('0x2'));var util=require(_0xe78f('0x3'));var config=require(_0xe78f('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xe78f('0x5'))(_0xe78f('0x6'));config[_0xe78f('0x7')]=_[_0xe78f('0x8')](config[_0xe78f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xe78f('0x9'))(new Redis(config[_0xe78f('0x7')]));function closeInteractions(){var _0x4b8147=0x0;var _0x339253=[];return db[_0xe78f('0xa')][_0xe78f('0xb')]({'raw':!![],'attributes':['id',_0xe78f('0xc')],'where':{'id':0x1}})[_0xe78f('0xd')](function(_0x2dcabe){_0x4b8147=_0x2dcabe['chatTimeout'];if(_0x4b8147){return db[_0xe78f('0xe')][_0xe78f('0xf')]({'raw':!![],'attributes':['id',_0xe78f('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe78f('0x11')](_0x2dcabe['chatTimeout'],_0xe78f('0x12'))}}});}else{return[];}})['then'](function(_0xf89510){if(_0xf89510&&_0xf89510[_0xe78f('0x13')]){_0x339253=_[_0xe78f('0x14')](_0xf89510||[],'id');logger[_0xe78f('0x15')](_0xe78f('0x16'),_0x339253[_0xe78f('0x17')]());return db['ChatInteraction'][_0xe78f('0x18')]({'closeReason':_0xe78f('0x19'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xe78f('0x1a'))},{'where':{'id':_0x339253}});}})[_0xe78f('0xd')](function(){if(_0x339253&&_0x339253[_0xe78f('0x13')]){logger[_0xe78f('0x15')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x339253[_0xe78f('0x17')]());for(var _0x4879db=0x0;_0x4879db<_0x339253[_0xe78f('0x13')];_0x4879db++){io[_0xe78f('0x1b')](_0xe78f('0x1c'),{'id':_0x339253[_0x4879db],'closed':!![]});}}})[_0xe78f('0x1d')](function(_0x3e0694){logger[_0xe78f('0x1e')](_0xe78f('0x1f'),_0x3e0694?util[_0xe78f('0x20')](_0x3e0694,{'showHidden':![],'depth':null}):'');});}exports[_0xe78f('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc0e6=['socket.io-emitter','find','then','chatTimeout','ChatInteraction','findAll','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../logger','schedule','redis'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xc0e6,0x1b5));var _0x6c0e=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xc0e6[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var moment=require(_0x6c0e('0x0'));var Redis=require('ioredis');var util=require(_0x6c0e('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x6c0e('0x2'))(_0x6c0e('0x3'));config[_0x6c0e('0x4')]=_['defaults'](config[_0x6c0e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6c0e('0x5'))(new Redis(config[_0x6c0e('0x4')]));function closeInteractions(){var _0x494965=0x0;var _0x15855c=[];return db['Setting'][_0x6c0e('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6c0e('0x7')](function(_0xb838e4){_0x494965=_0xb838e4[_0x6c0e('0x8')];if(_0x494965){return db[_0x6c0e('0x9')][_0x6c0e('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6c0e('0xb')](_0xb838e4[_0x6c0e('0x8')],'minutes')}}});}else{return[];}})[_0x6c0e('0x7')](function(_0x1fa75f){if(_0x1fa75f&&_0x1fa75f[_0x6c0e('0xc')]){_0x15855c=_[_0x6c0e('0xd')](_0x1fa75f||[],'id');logger[_0x6c0e('0xe')](_0x6c0e('0xf'),_0x15855c[_0x6c0e('0x10')]());return db[_0x6c0e('0x9')][_0x6c0e('0x11')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x6c0e('0x12'))},{'where':{'id':_0x15855c}});}})[_0x6c0e('0x7')](function(){if(_0x15855c&&_0x15855c[_0x6c0e('0xc')]){logger[_0x6c0e('0xe')](_0x6c0e('0x13'),_0x15855c['join']());for(var _0x12ee8f=0x0;_0x12ee8f<_0x15855c['length'];_0x12ee8f++){io[_0x6c0e('0x14')](_0x6c0e('0x15'),{'id':_0x15855c[_0x12ee8f],'closed':!![]});}}})['catch'](function(_0x4348b7){logger[_0x6c0e('0x16')](_0x6c0e('0x17'),_0x4348b7?util[_0x6c0e('0x18')](_0x4348b7,{'showHidden':![],'depth':null}):'');});}exports[_0x6c0e('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3d6f66a..5b561ae 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 _0xef49=['secure','authentication','auth','user','pass','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','basename','extname','zip','existsSync','message','stringify','status','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','cron','active','isBetween','startAt','add','start','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port'];(function(_0x12c66e,_0xea7b4){var _0x19481a=function(_0x5a77aa){while(--_0x5a77aa){_0x12c66e['push'](_0x12c66e['shift']());}};_0x19481a(++_0xea7b4);}(_0xef49,0xf4));var _0x9ef4=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xef49[_0x1e4360];return _0x31e6b4;};'use strict';var fs=require('fs');var util=require(_0x9ef4('0x0'));var path=require(_0x9ef4('0x1'));var _=require(_0x9ef4('0x2'));var moment=require(_0x9ef4('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x9ef4('0x4'));var BPromise=require(_0x9ef4('0x5'));var logger=require(_0x9ef4('0x6'))('schedule');var db=require(_0x9ef4('0x7'))['db'];var analyticCustomReportController=require(_0x9ef4('0x8'));var analyticDefaultReportController=require(_0x9ef4('0x9'));var client=jayson[_0x9ef4('0xa')][_0x9ef4('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5da86c,_0x2e3743){return function(){logger[_0x9ef4('0xc')](_0x9ef4('0xd'),_0x5da86c[_0x9ef4('0xe')]);var _0x231dc7=!![];var _0x1efa4c={'tls':{'rejectUnauthorized':![]}};if(_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0x10')][_0x9ef4('0x11')]){_0x1efa4c['service']=_0x5da86c[_0x9ef4('0xf')]['Smtp'][_0x9ef4('0x11')];}else{_0x1efa4c[_0x9ef4('0x12')]=_0x5da86c[_0x9ef4('0xf')]['Smtp'][_0x9ef4('0x12')];_0x1efa4c[_0x9ef4('0x13')]=_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0x10')][_0x9ef4('0x13')];_0x1efa4c['secure']=_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0x10')][_0x9ef4('0x14')];}if(_0x5da86c['MailAccount'][_0x9ef4('0x10')][_0x9ef4('0x15')]){_0x1efa4c[_0x9ef4('0x16')]={'user':_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0x10')][_0x9ef4('0x17')],'pass':_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0x10')][_0x9ef4('0x18')]};}var _0x1368f4={'account':_0x1efa4c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0x19')],_0x5da86c[_0x9ef4('0xf')][_0x9ef4('0xe')]||_0x5da86c['MailAccount']['Smtp'][_0x9ef4('0x17')]),'to':_0x5da86c['email'],'cc':_0x5da86c['cc'],'bcc':_0x5da86c[_0x9ef4('0x1a')],'subject':util[_0x9ef4('0x1b')](_0x9ef4('0x1c'),_0x2e3743['name'],_0x5da86c['subtractNumber'],_0x5da86c[_0x9ef4('0x1d')])}};var _0x8857b3=path[_0x9ef4('0x1e')](__dirname,'../../files/reports');var _0x3e8f0a=_0x2e3743[_0x9ef4('0x1f')];var _0x39fb73=util[_0x9ef4('0x1b')]('%s.%s',path[_0x9ef4('0x20')](_0x2e3743[_0x9ef4('0x1f')],path[_0x9ef4('0x21')](_0x2e3743[_0x9ef4('0x1f')])),_0x9ef4('0x22'));var _0x131a73=path['join'](_0x8857b3,_0x3e8f0a);var _0x276f6a=path[_0x9ef4('0x1e')](_0x8857b3,_0x39fb73);if(fs[_0x9ef4('0x23')](_0x131a73)){_0x2e3743['status']='Sent';_0x1368f4['message']['attachments']=[{'filename':_0x3e8f0a,'path':_0x131a73}];_0x1368f4[_0x9ef4('0x24')]['text']=util[_0x9ef4('0x1b')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x9ef4('0x25')](_0x2e3743,null,0x2));}else if(fs['existsSync'](_0x276f6a)){_0x2e3743[_0x9ef4('0x26')]='Sent';_0x1368f4['message'][_0x9ef4('0x27')]=[{'filename':_0x39fb73,'path':_0x276f6a}];}else{_0x1368f4[_0x9ef4('0x24')][_0x9ef4('0x28')]=_0x9ef4('0x29');if(!_0x5da86c['sendIfEmpty']){_0x231dc7=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x231dc7){return client[_0x9ef4('0x2a')]('SendMail',_0x1368f4)[_0x9ef4('0x2b')](function(_0x273a0c){if(_0x273a0c[_0x9ef4('0x2c')]){return logger['error'](_0x9ef4('0x2d'),JSON[_0x9ef4('0x25')](_0x273a0c));}return logger['info'](_0x9ef4('0x2e'));})[_0x9ef4('0x2f')](function(_0x1496ba){return logger['error']('error\x20mail',JSON[_0x9ef4('0x25')](_0x1496ba));});}};}function handleError(){return function(_0x2eaf52){return logger['error'](JSON[_0x9ef4('0x25')](_0x2eaf52));};}function handleResult(_0x2ac78d){return function(_0x182efd){logger[_0x9ef4('0xc')](_0x9ef4('0x30'),JSON[_0x9ef4('0x25')](_0x182efd));if(_0x2ac78d[_0x9ef4('0xf')]&&_0x2ac78d[_0x9ef4('0xf')][_0x9ef4('0x10')]&&!_[_0x9ef4('0x31')](_0x2ac78d[_0x9ef4('0xe')])){setTimeout(handleSendEmail(_0x2ac78d,_0x182efd),0x3c*0x3e8);}};}function handleJob(_0x3e3eba){return function(){try{if(_[_0x9ef4('0x31')](_0x3e3eba[_0x9ef4('0x32')])){return logger[_0x9ef4('0xc')](_0x9ef4('0x33'));}if(_['isNil'](_0x3e3eba['subtractUnit'])){return logger[_0x9ef4('0xc')](_0x9ef4('0x34'));}var _0xa94b7c={'startDate':moment()[_0x9ef4('0x35')](_0x3e3eba['subtractNumber'],_0x3e3eba[_0x9ef4('0x1d')])[_0x9ef4('0x1b')](_0x9ef4('0x36')),'endDate':moment()[_0x9ef4('0x1b')](_0x9ef4('0x36')),'type':_0x9ef4('0x37'),'output':_0x3e3eba['output'],'name':_0x3e3eba['name']};if(!_[_0x9ef4('0x31')](_0x3e3eba[_0x9ef4('0x38')])){logger['info'](_0x9ef4('0x39'),_0x3e3eba['DefaultReportId']);return analyticDefaultReportController[_0x9ef4('0x3a')]({'id':_0x3e3eba['DefaultReportId']},_0xa94b7c)[_0x9ef4('0x2b')](handleResult(_0x3e3eba))['catch'](handleError());}if(!_['isNil'](_0x3e3eba[_0x9ef4('0x3b')])){logger[_0x9ef4('0xc')]('exec\x20custom\x20report\x20id:%s',_0x3e3eba[_0x9ef4('0x3b')]);return analyticCustomReportController[_0x9ef4('0x3a')]({'id':_0x3e3eba['CustomReportId']},_0xa94b7c)['then'](handleResult(_0x3e3eba))[_0x9ef4('0x2f')](handleError());}}catch(_0x6fbbf3){logger[_0x9ef4('0x2c')](JSON['stringify'](_0x6fbbf3));}return logger[_0x9ef4('0xc')](_0x9ef4('0x3c'));};}function getJobs(_0x17da6a){var _0x401a1b={};if(_0x17da6a){_0x401a1b['id']=_0x17da6a;}return db[_0x9ef4('0x3d')][_0x9ef4('0x3e')]({'where':_0x401a1b,'include':[{'model':db['MailAccount'],'attributes':['id',_0x9ef4('0x19'),_0x9ef4('0xe')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x9ef4('0x2b')](function(_0x842f02){var _0x4fd1bb=_[_0x9ef4('0x3f')](manager[_0x9ef4('0x40')]);var _0x54e3db=_[_0x9ef4('0x41')](_0x842f02,function(_0x53a69c){return _0x53a69c['id']['toString']();});var _0x3d7e6a=_[_0x9ef4('0x42')](_0x842f02,function(_0x956659){return _0x956659['id'][_0x9ef4('0x43')]();});var _0x17eed0=_0x17da6a?_0x54e3db:_[_0x9ef4('0x44')](_0x54e3db,_0x4fd1bb);var _0x2752c7=_[_0x9ef4('0x45')](_0x54e3db,_0x4fd1bb);var _0x12b68c=_['difference'](_0x4fd1bb,_0x54e3db);var _0x133f3e;var _0x3f3772;for(_0x133f3e=0x0;_0x133f3e<_0x12b68c[_0x9ef4('0x46')]&&!_0x17da6a;_0x133f3e+=0x1){_0x3f3772=_0x12b68c[_0x133f3e][_0x9ef4('0x43')]();if(manager[_0x9ef4('0x47')](_0x3f3772)){manager[_0x9ef4('0x48')](_0x3f3772);manager[_0x9ef4('0x49')](_0x3f3772);logger['info'](_0x9ef4('0x4a'),_0x3f3772);}}logger[_0x9ef4('0xc')](_0x9ef4('0x4b'),JSON[_0x9ef4('0x25')](_0x17eed0));for(_0x133f3e=0x0;_0x133f3e<_0x17eed0[_0x9ef4('0x46')];_0x133f3e+=0x1){_0x3f3772=_0x17eed0[_0x133f3e][_0x9ef4('0x43')]();logger[_0x9ef4('0xc')](_0x9ef4('0x4c'),_0x3f3772);if(_0x17da6a){logger[_0x9ef4('0xc')]('my\x20id',_0x17da6a);logger[_0x9ef4('0xc')](JSON['stringify'](_0x3d7e6a[_0x3f3772]));BPromise[_0x9ef4('0x4d')]()[_0x9ef4('0x2b')](handleJob(_0x3d7e6a[_0x3f3772]));logger['info']('run\x20job',_0x3d7e6a[_0x3f3772][_0x9ef4('0x19')],_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]);}else if(_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]&&_0x3d7e6a[_0x3f3772][_0x9ef4('0x4f')]&&moment()[_0x9ef4('0x50')](_0x3d7e6a[_0x3f3772][_0x9ef4('0x51')],_0x3d7e6a[_0x3f3772]['endAt'])){manager[_0x9ef4('0x52')](_0x3f3772,_0x3d7e6a[_0x3f3772]['cron'],handleJob(_0x3d7e6a[_0x3f3772]));manager[_0x9ef4('0x53')](_0x3f3772);logger[_0x9ef4('0xc')]('add\x20cron',_0x3d7e6a[_0x3f3772]['name'],_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]);}else if(manager[_0x9ef4('0x47')](_0x3f3772)){manager['stop'](_0x3f3772);manager['deleteJob'](_0x3f3772);logger[_0x9ef4('0xc')](_0x9ef4('0x54'),_0x3d7e6a[_0x3f3772][_0x9ef4('0x19')],_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]);}}for(_0x133f3e=0x0,_0x3f3772;_0x133f3e<_0x2752c7[_0x9ef4('0x46')]&&!_0x17da6a;_0x133f3e+=0x1){_0x3f3772=_0x2752c7[_0x133f3e][_0x9ef4('0x43')]();if(manager[_0x9ef4('0x47')](_0x3f3772)){if(_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]&&_0x3d7e6a[_0x3f3772][_0x9ef4('0x4f')]&&moment()['isBetween'](_0x3d7e6a[_0x3f3772][_0x9ef4('0x51')],_0x3d7e6a[_0x3f3772]['endAt'])){manager[_0x9ef4('0x55')](_0x3f3772,_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')],handleJob(_0x3d7e6a[_0x3f3772]));logger[_0x9ef4('0xc')](_0x9ef4('0x56'),_0x3d7e6a[_0x3f3772][_0x9ef4('0x19')],_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]);}else{manager[_0x9ef4('0x48')](_0x3f3772);manager['deleteJob'](_0x3f3772);logger[_0x9ef4('0xc')](_0x9ef4('0x54'),_0x3d7e6a[_0x3f3772][_0x9ef4('0x19')],_0x3d7e6a[_0x3f3772][_0x9ef4('0x4e')]);}}}})[_0x9ef4('0x2f')](function(_0x1a1cca){logger[_0x9ef4('0x2c')](JSON[_0x9ef4('0x25')](_0x1a1cca));});}exports[_0x9ef4('0x57')]=function(_0x1cd894){return getJobs(_0x1cd894);};exports[_0x9ef4('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2805=['resolve','cron','isBetween','startAt','endAt','add','start','stop\x20cron','active','update\x20cron','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','Smtp','service','MailAccount','host','port','secure','auth','pass','format','email','user','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','../../files/reports','savename','basename','extname','zip','existsSync','status','message','text','stringify','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','index'];(function(_0x3e5708,_0x5b76cd){var _0x203b35=function(_0x21823e){while(--_0x21823e){_0x3e5708['push'](_0x3e5708['shift']());}};_0x203b35(++_0x5b76cd);}(_0x2805,0x1a9));var _0x5280=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x2805[_0x4ae829];return _0x256b31;};'use strict';var fs=require('fs');var util=require(_0x5280('0x0'));var path=require(_0x5280('0x1'));var _=require(_0x5280('0x2'));var moment=require('moment');var CronJobManager=require(_0x5280('0x3'));var jayson=require(_0x5280('0x4'));var BPromise=require(_0x5280('0x5'));var logger=require(_0x5280('0x6'))(_0x5280('0x7'));var db=require(_0x5280('0x8'))['db'];var analyticCustomReportController=require(_0x5280('0x9'));var analyticDefaultReportController=require(_0x5280('0xa'));var client=jayson[_0x5280('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3bdf67,_0x5c20cb){return function(){logger[_0x5280('0xc')](_0x5280('0xd'),_0x3bdf67['email']);var _0x46a621=!![];var _0x2d0a0a={'tls':{'rejectUnauthorized':![]}};if(_0x3bdf67['MailAccount'][_0x5280('0xe')][_0x5280('0xf')]){_0x2d0a0a[_0x5280('0xf')]=_0x3bdf67[_0x5280('0x10')][_0x5280('0xe')][_0x5280('0xf')];}else{_0x2d0a0a[_0x5280('0x11')]=_0x3bdf67['MailAccount'][_0x5280('0xe')][_0x5280('0x11')];_0x2d0a0a[_0x5280('0x12')]=_0x3bdf67[_0x5280('0x10')]['Smtp']['port'];_0x2d0a0a[_0x5280('0x13')]=_0x3bdf67[_0x5280('0x10')][_0x5280('0xe')][_0x5280('0x13')];}if(_0x3bdf67['MailAccount'][_0x5280('0xe')]['authentication']){_0x2d0a0a[_0x5280('0x14')]={'user':_0x3bdf67[_0x5280('0x10')]['Smtp']['user'],'pass':_0x3bdf67[_0x5280('0x10')][_0x5280('0xe')][_0x5280('0x15')]};}var _0x33f704={'account':_0x2d0a0a,'message':{'from':util[_0x5280('0x16')]('\x22%s\x22\x20<%s>',_0x3bdf67[_0x5280('0x10')]['name'],_0x3bdf67[_0x5280('0x10')][_0x5280('0x17')]||_0x3bdf67['MailAccount']['Smtp'][_0x5280('0x18')]),'to':_0x3bdf67[_0x5280('0x17')],'cc':_0x3bdf67['cc'],'bcc':_0x3bdf67['bcc'],'subject':util[_0x5280('0x16')](_0x5280('0x19'),_0x5c20cb[_0x5280('0x1a')],_0x3bdf67[_0x5280('0x1b')],_0x3bdf67['subtractUnit'])}};var _0x22ab9b=path[_0x5280('0x1c')](__dirname,_0x5280('0x1d'));var _0x268989=_0x5c20cb[_0x5280('0x1e')];var _0x33628f=util[_0x5280('0x16')]('%s.%s',path[_0x5280('0x1f')](_0x5c20cb['savename'],path[_0x5280('0x20')](_0x5c20cb[_0x5280('0x1e')])),_0x5280('0x21'));var _0x738fe8=path[_0x5280('0x1c')](_0x22ab9b,_0x268989);var _0x4af9a8=path[_0x5280('0x1c')](_0x22ab9b,_0x33628f);if(fs[_0x5280('0x22')](_0x738fe8)){_0x5c20cb[_0x5280('0x23')]='Sent';_0x33f704[_0x5280('0x24')]['attachments']=[{'filename':_0x268989,'path':_0x738fe8}];_0x33f704[_0x5280('0x24')][_0x5280('0x25')]=util[_0x5280('0x16')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x5280('0x26')](_0x5c20cb,null,0x2));}else if(fs['existsSync'](_0x4af9a8)){_0x5c20cb[_0x5280('0x23')]='Sent';_0x33f704['message']['attachments']=[{'filename':_0x33628f,'path':_0x4af9a8}];}else{_0x33f704[_0x5280('0x24')][_0x5280('0x25')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3bdf67[_0x5280('0x27')]){_0x46a621=![];logger[_0x5280('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x46a621){return client[_0x5280('0x28')](_0x5280('0x29'),_0x33f704)[_0x5280('0x2a')](function(_0x5152a1){if(_0x5152a1[_0x5280('0x2b')]){return logger[_0x5280('0x2b')](_0x5280('0x2c'),JSON[_0x5280('0x26')](_0x5152a1));}return logger[_0x5280('0xc')](_0x5280('0x2d'));})[_0x5280('0x2e')](function(_0x52673b){return logger[_0x5280('0x2b')](_0x5280('0x2c'),JSON[_0x5280('0x26')](_0x52673b));});}};}function handleError(){return function(_0x38f290){return logger[_0x5280('0x2b')](JSON[_0x5280('0x26')](_0x38f290));};}function handleResult(_0x2fd18f){return function(_0x2af103){logger[_0x5280('0xc')]('data',JSON['stringify'](_0x2af103));if(_0x2fd18f['MailAccount']&&_0x2fd18f[_0x5280('0x10')][_0x5280('0xe')]&&!_[_0x5280('0x2f')](_0x2fd18f[_0x5280('0x17')])){setTimeout(handleSendEmail(_0x2fd18f,_0x2af103),0x3c*0x3e8);}};}function handleJob(_0x34bb0e){return function(){try{if(_[_0x5280('0x2f')](_0x34bb0e[_0x5280('0x1b')])){return logger[_0x5280('0xc')](_0x5280('0x30'));}if(_[_0x5280('0x2f')](_0x34bb0e['subtractUnit'])){return logger[_0x5280('0xc')]('subtractUnit\x20null\x20or\x20undefined');}var _0x564770={'startDate':moment()[_0x5280('0x31')](_0x34bb0e[_0x5280('0x1b')],_0x34bb0e[_0x5280('0x32')])[_0x5280('0x16')](_0x5280('0x33')),'endDate':moment()[_0x5280('0x16')](_0x5280('0x33')),'type':_0x5280('0x34'),'output':_0x34bb0e['output'],'name':_0x34bb0e[_0x5280('0x1a')]};if(!_[_0x5280('0x2f')](_0x34bb0e[_0x5280('0x35')])){logger['info'](_0x5280('0x36'),_0x34bb0e[_0x5280('0x35')]);return analyticDefaultReportController[_0x5280('0x37')]({'id':_0x34bb0e[_0x5280('0x35')]},_0x564770)[_0x5280('0x2a')](handleResult(_0x34bb0e))['catch'](handleError());}if(!_[_0x5280('0x2f')](_0x34bb0e['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x34bb0e[_0x5280('0x38')]);return analyticCustomReportController[_0x5280('0x37')]({'id':_0x34bb0e[_0x5280('0x38')]},_0x564770)['then'](handleResult(_0x34bb0e))['catch'](handleError());}}catch(_0x5a4601){logger[_0x5280('0x2b')](JSON['stringify'](_0x5a4601));}return logger[_0x5280('0xc')](_0x5280('0x39'));};}function getJobs(_0x5e7776){var _0x9c0cdc={};if(_0x5e7776){_0x9c0cdc['id']=_0x5e7776;}return db[_0x5280('0x3a')][_0x5280('0x3b')]({'where':_0x9c0cdc,'include':[{'model':db[_0x5280('0x10')],'attributes':['id','name',_0x5280('0x17')],'include':[{'model':db[_0x5280('0x3c')],'as':_0x5280('0xe')}]}]})[_0x5280('0x2a')](function(_0x1e897a){var _0x25a36b=_[_0x5280('0x3d')](manager[_0x5280('0x3e')]);var _0x3b565c=_[_0x5280('0x3f')](_0x1e897a,function(_0x241eb5){return _0x241eb5['id'][_0x5280('0x40')]();});var _0x134cc7=_[_0x5280('0x41')](_0x1e897a,function(_0x286a8e){return _0x286a8e['id'][_0x5280('0x40')]();});var _0x319ef7=_0x5e7776?_0x3b565c:_[_0x5280('0x42')](_0x3b565c,_0x25a36b);var _0x1d6051=_['intersection'](_0x3b565c,_0x25a36b);var _0x18ec32=_[_0x5280('0x42')](_0x25a36b,_0x3b565c);var _0x58db17;var _0x276fb4;for(_0x58db17=0x0;_0x58db17<_0x18ec32[_0x5280('0x43')]&&!_0x5e7776;_0x58db17+=0x1){_0x276fb4=_0x18ec32[_0x58db17][_0x5280('0x40')]();if(manager[_0x5280('0x44')](_0x276fb4)){manager[_0x5280('0x45')](_0x276fb4);manager[_0x5280('0x46')](_0x276fb4);logger[_0x5280('0xc')](_0x5280('0x47'),_0x276fb4);}}logger[_0x5280('0xc')]('toRun',JSON[_0x5280('0x26')](_0x319ef7));for(_0x58db17=0x0;_0x58db17<_0x319ef7[_0x5280('0x43')];_0x58db17+=0x1){_0x276fb4=_0x319ef7[_0x58db17][_0x5280('0x40')]();logger[_0x5280('0xc')](_0x5280('0x48'),_0x276fb4);if(_0x5e7776){logger[_0x5280('0xc')]('my\x20id',_0x5e7776);logger[_0x5280('0xc')](JSON[_0x5280('0x26')](_0x134cc7[_0x276fb4]));BPromise[_0x5280('0x49')]()['then'](handleJob(_0x134cc7[_0x276fb4]));logger[_0x5280('0xc')]('run\x20job',_0x134cc7[_0x276fb4][_0x5280('0x1a')],_0x134cc7[_0x276fb4][_0x5280('0x4a')]);}else if(_0x134cc7[_0x276fb4][_0x5280('0x4a')]&&_0x134cc7[_0x276fb4]['active']&&moment()[_0x5280('0x4b')](_0x134cc7[_0x276fb4][_0x5280('0x4c')],_0x134cc7[_0x276fb4][_0x5280('0x4d')])){manager[_0x5280('0x4e')](_0x276fb4,_0x134cc7[_0x276fb4][_0x5280('0x4a')],handleJob(_0x134cc7[_0x276fb4]));manager[_0x5280('0x4f')](_0x276fb4);logger['info']('add\x20cron',_0x134cc7[_0x276fb4]['name'],_0x134cc7[_0x276fb4][_0x5280('0x4a')]);}else if(manager[_0x5280('0x44')](_0x276fb4)){manager[_0x5280('0x45')](_0x276fb4);manager[_0x5280('0x46')](_0x276fb4);logger[_0x5280('0xc')](_0x5280('0x50'),_0x134cc7[_0x276fb4]['name'],_0x134cc7[_0x276fb4]['cron']);}}for(_0x58db17=0x0,_0x276fb4;_0x58db17<_0x1d6051['length']&&!_0x5e7776;_0x58db17+=0x1){_0x276fb4=_0x1d6051[_0x58db17][_0x5280('0x40')]();if(manager[_0x5280('0x44')](_0x276fb4)){if(_0x134cc7[_0x276fb4][_0x5280('0x4a')]&&_0x134cc7[_0x276fb4][_0x5280('0x51')]&&moment()['isBetween'](_0x134cc7[_0x276fb4][_0x5280('0x4c')],_0x134cc7[_0x276fb4][_0x5280('0x4d')])){manager['update'](_0x276fb4,_0x134cc7[_0x276fb4][_0x5280('0x4a')],handleJob(_0x134cc7[_0x276fb4]));logger[_0x5280('0xc')](_0x5280('0x52'),_0x134cc7[_0x276fb4][_0x5280('0x1a')],_0x134cc7[_0x276fb4]['cron']);}else{manager['stop'](_0x276fb4);manager[_0x5280('0x46')](_0x276fb4);logger[_0x5280('0xc')](_0x5280('0x50'),_0x134cc7[_0x276fb4][_0x5280('0x1a')],_0x134cc7[_0x276fb4][_0x5280('0x4a')]);}}}})[_0x5280('0x2e')](function(_0x57453b){logger[_0x5280('0x2b')](JSON[_0x5280('0x26')](_0x57453b));});}exports['run']=function(_0x222761){return getJobs(_0x222761);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 908104e..c16b7a1 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 _0x486e=['[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','tempSentiment','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','bucket','Transcribe\x20not\x20configured','push','all','error','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','TranscriptionJobStatus','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured'];(function(_0x424c98,_0x3a12d1){var _0x470d95=function(_0x29f7e1){while(--_0x29f7e1){_0x424c98['push'](_0x424c98['shift']());}};_0x470d95(++_0x3a12d1);}(_0x486e,0xb2));var _0xe486=function(_0x45cf7c,_0x49fed2){_0x45cf7c=_0x45cf7c-0x0;var _0x2a9193=_0x486e[_0x45cf7c];return _0x2a9193;};var _=require(_0xe486('0x0'));var AWS=require(_0xe486('0x1'));var rp=require('request-promise');var util=require(_0xe486('0x2'));var BPromise=require(_0xe486('0x3'));var db=require(_0xe486('0x4'))['db'];var logger=require(_0xe486('0x5'))(_0xe486('0x6'));function getTranscriptionJob(_0x1bb3f2,_0x45a4cc,_0x30f0f3,_0x37910f){return new Promise(function(_0x25034d,_0x1bf55d){var _0x4fac5d=new AWS[(_0xe486('0x7'))]({'accessKeyId':_0x45a4cc,'secretAccessKey':_0x1bb3f2,'region':_0x30f0f3});_0x4fac5d[_0xe486('0x8')]({'TranscriptionJobName':_0x37910f},function(_0x8a85c7,_0x2114a5){if(_0x8a85c7){return _0x1bf55d(_0x8a85c7);}else{return _0x25034d(_0x2114a5);}});});}function sentiment(_0x369290,_0x3ab1f1,_0x42c4b3,_0x3e9b9b,_0x50d367){return new Promise(function(_0x5cec37,_0x2f6c67){var _0xce77e6=new AWS[(_0xe486('0x9'))]({'accessKeyId':_0x3ab1f1,'secretAccessKey':_0x369290,'region':_0x42c4b3});_0xce77e6[_0xe486('0xa')]({'Text':_0x3e9b9b,'LanguageCode':_0x50d367[_0xe486('0xb')](0x0,0x2)},function(_0xdbf6e7,_0x374344){if(_0xdbf6e7){return _0x2f6c67(_0xdbf6e7);}else{return _0x5cec37(_0x374344);}});});}function checkTranscribeJob(_0x11a0cf,_0x372057,_0x530344){var _0x5a1aad;return new BPromise(function(_0x4236e1,_0x594228){logger[_0xe486('0xc')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x11a0cf['id'],_0x11a0cf[_0xe486('0xd')]));return getTranscriptionJob(_0x530344['data1'],_0x530344[_0xe486('0xe')],_0x372057[_0xe486('0xf')],_0x11a0cf[_0xe486('0xd')])[_0xe486('0x10')](function(_0x5016f0){logger['info'](util[_0xe486('0x11')](_0xe486('0x12'),_0x11a0cf['id'],_0x11a0cf['transcribeName'],_0x5016f0[_0xe486('0x13')]['TranscriptionJobStatus']));if(!_0x11a0cf[_0xe486('0x14')]){switch(_0x5016f0[_0xe486('0x13')]['TranscriptionJobStatus']){case _0xe486('0x15'):var _0x12ba83={'transcribeStatus':_0x5016f0['TranscriptionJob'][_0xe486('0x16')],'fileUri':_0x5016f0[_0xe486('0x13')][_0xe486('0x17')]['TranscriptFileUri']};logger[_0xe486('0xc')](util[_0xe486('0x11')](_0xe486('0x18'),_0x11a0cf['id']));return rp({'uri':_0x5016f0[_0xe486('0x13')][_0xe486('0x17')][_0xe486('0x19')],'json':!![]})[_0xe486('0x10')](function(_0xdc43f0){logger['info'](util[_0xe486('0x11')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x11a0cf['id']));if(_0xdc43f0&&_0xdc43f0[_0xe486('0x1a')]&&_0xdc43f0['results'][_0xe486('0x1b')]&&_0xdc43f0['results'][_0xe486('0x1b')][_0xe486('0x1c')]){_0x12ba83[_0xe486('0x14')]='';for(var _0x9f77fc=0x0;_0x9f77fc<_0xdc43f0['results'][_0xe486('0x1b')][_0xe486('0x1c')];_0x9f77fc++){_0x12ba83[_0xe486('0x14')]+=_0xdc43f0[_0xe486('0x1a')][_0xe486('0x1b')][_0x9f77fc][_0xe486('0x1d')]+'';}}return _0x11a0cf['update'](_0x12ba83);})[_0xe486('0x10')](function(){logger[_0xe486('0xc')](util['format'](_0xe486('0x1e'),_0x11a0cf['id']));if(!_0x11a0cf['tempSentiment']){throw new db[(_0xe486('0x1f'))]['ValidationError'](_0xe486('0x20'));}if(!_0x372057[_0xe486('0x21')]||!_0x372057[_0xe486('0x22')]||!_0x372057['sentimentRegion']||!_0x372057[_0xe486('0x23')]||!_0x372057['bucket']){throw new db['Sequelize'][(_0xe486('0x24'))](_0xe486('0x25'));}if(!_0x12ba83[_0xe486('0x14')]){throw new Error(_0xe486('0x26'));}if(_0x372057[_0xe486('0x22')]===_0x530344['id']){return _0x530344;}else{return db[_0xe486('0x27')][_0xe486('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3bf14b){if(!_0x3bf14b){throw new db['Sequelize'][(_0xe486('0x24'))](_0xe486('0x29'));}if(!_0x3bf14b[_0xe486('0x2a')]||!_0x3bf14b[_0xe486('0xe')]){throw new db[(_0xe486('0x1f'))]['ValidationError'](_0xe486('0x2b'));}_0x5a1aad=_0x3bf14b;logger[_0xe486('0xc')](util[_0xe486('0x11')](_0xe486('0x2c'),_0x11a0cf['id']));return sentiment(_0x5a1aad['data1'],_0x5a1aad[_0xe486('0xe')],_0x372057[_0xe486('0x2d')],_0x12ba83[_0xe486('0x14')],_0x372057['language']);})[_0xe486('0x10')](function(_0x2b917d){logger[_0xe486('0xc')](util[_0xe486('0x11')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x11a0cf['id']));return _0x11a0cf[_0xe486('0x2e')]({'sentiment':_0x2b917d[_0xe486('0x2f')],'sPositive':_0x2b917d[_0xe486('0x30')][_0xe486('0x31')],'sNegative':_0x2b917d['SentimentScore']['Negative'],'sMixed':_0x2b917d[_0xe486('0x30')][_0xe486('0x32')],'sNeutral':_0x2b917d[_0xe486('0x30')][_0xe486('0x33')]});})['then'](function(){logger[_0xe486('0xc')](util[_0xe486('0x11')](_0xe486('0x1e'),_0x11a0cf['id']));_0x4236e1();});case'FAILED':return _0x11a0cf[_0xe486('0x2e')]({'transcribeStatus':_0xe486('0x34'),'failureReason':_0x5016f0[_0xe486('0x13')][_0xe486('0x35')]})['then'](function(){logger['info'](util[_0xe486('0x11')](_0xe486('0x1e'),_0x11a0cf['id']));_0x4236e1();});default:logger[_0xe486('0xc')](util[_0xe486('0x11')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x11a0cf['id']));break;}}else{return BPromise[_0xe486('0x36')]()['then'](function(){if(!_0x11a0cf[_0xe486('0x37')]){throw new db[(_0xe486('0x1f'))][(_0xe486('0x24'))](_0xe486('0x20'));}if(!_0x372057[_0xe486('0x21')]||!_0x372057[_0xe486('0x22')]||!_0x372057['sentimentRegion']||!_0x372057[_0xe486('0x23')]||!_0x372057['bucket']){throw new db[(_0xe486('0x1f'))][(_0xe486('0x24'))](_0xe486('0x25'));}if(!_0x11a0cf['fileText']){throw new Error(_0xe486('0x26'));}if(_0x372057['sentimentAccountId']===_0x530344['id']){return _0x530344;}else{return db[_0xe486('0x27')][_0xe486('0x28')]({'where':{'id':_settings[_0xe486('0x22')]}});}})['then'](function(_0x36ec31){if(!_0x36ec31){throw new db['Sequelize'][(_0xe486('0x24'))](_0xe486('0x29'));}if(!_0x36ec31['data1']||!_0x36ec31[_0xe486('0xe')]){throw new db[(_0xe486('0x1f'))][(_0xe486('0x24'))](_0xe486('0x2b'));}_0x5a1aad=_0x36ec31;logger[_0xe486('0xc')](util[_0xe486('0x11')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x11a0cf['id']));return sentiment(_0x5a1aad[_0xe486('0x2a')],_0x5a1aad[_0xe486('0xe')],_0x372057['sentimentRegion'],_0x11a0cf[_0xe486('0x14')],_0x372057['language']);})[_0xe486('0x10')](function(_0x1f9648){logger['info'](util[_0xe486('0x11')](_0xe486('0x38'),_0x11a0cf['id']));return _0x11a0cf[_0xe486('0x2e')]({'sentiment':_0x1f9648['Sentiment'],'sPositive':_0x1f9648[_0xe486('0x30')][_0xe486('0x31')],'sNegative':_0x1f9648[_0xe486('0x30')][_0xe486('0x39')],'sMixed':_0x1f9648['SentimentScore'][_0xe486('0x32')],'sNeutral':_0x1f9648[_0xe486('0x30')][_0xe486('0x33')],'transcribeStatus':_0xe486('0x15')});})[_0xe486('0x10')](function(){logger[_0xe486('0xc')](util[_0xe486('0x11')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x11a0cf['id']));_0x4236e1();});}})[_0xe486('0x3a')](function(_0x2d29f8){if(_0x2d29f8){if(!_0x2d29f8['name']||_0x2d29f8[_0xe486('0x3b')]!==_0xe486('0x3c')){logger['error'](util[_0xe486('0x11')](_0xe486('0x3d'),_0x11a0cf['id']),util[_0xe486('0x3e')](_0x2d29f8,{'showHidden':![],'depth':null}));}}_0x4236e1();});});}function checkTranscribe(){var _0xf2598b;var _0x1317cc;var _0x10b115;return db[_0xe486('0x3f')]['findAll']({'where':{'transcribeStatus':_0xe486('0x40')}})[_0xe486('0x10')](function(_0x5c260f){if(!_0x5c260f||!_0x5c260f[_0xe486('0x1c')]){throw new db[(_0xe486('0x1f'))][(_0xe486('0x24'))](_0xe486('0x41'));}_0xf2598b=_0x5c260f;return db[_0xe486('0x42')][_0xe486('0x28')]({'where':{'id':0x1}});})['then'](function(_0x1c8ad5){if(!_0x1c8ad5){throw new db[(_0xe486('0x1f'))]['ValidationError'](_0xe486('0x43'));}_0x1317cc=_0x1c8ad5;if(!_0x1317cc[_0xe486('0x6')]||!_0x1317cc[_0xe486('0x44')]||!_0x1317cc[_0xe486('0xf')]||!_0x1317cc[_0xe486('0x23')]||!_0x1317cc[_0xe486('0x45')]){throw new db[(_0xe486('0x1f'))][(_0xe486('0x24'))](_0xe486('0x46'));}return db[_0xe486('0x27')]['findOne']({'where':{'id':_0x1317cc[_0xe486('0x44')]}});})[_0xe486('0x10')](function(_0x3c9cf2){if(!_0x3c9cf2){throw new db[(_0xe486('0x1f'))][(_0xe486('0x24'))](_0xe486('0x29'));}if(!_0x3c9cf2['data1']||!_0x3c9cf2[_0xe486('0xe')]){throw new db[(_0xe486('0x1f'))]['ValidationError'](_0xe486('0x2b'));}_0x10b115=_0x3c9cf2;var _0x4de708=[];_0xf2598b['forEach'](function(_0x421c58){_0x4de708[_0xe486('0x47')](checkTranscribeJob(_0x421c58,_0x1317cc,_0x10b115));});return BPromise[_0xe486('0x48')](_0x4de708);})['catch'](function(_0x247147){if(_0x247147){if(!_0x247147['name']||_0x247147[_0xe486('0x3b')]!=='SequelizeValidationError'){logger[_0xe486('0x49')](util['inspect'](_0x247147,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x1db3=['sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','update','Sentiment','SentimentScore','Negative','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','push','all','inspect','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','info','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1db3,0x1e5));var _0x31db=function(_0x24c7d0,_0x168fa3){_0x24c7d0=_0x24c7d0-0x0;var _0x2a25c1=_0x1db3[_0x24c7d0];return _0x2a25c1;};var _=require('lodash');var AWS=require(_0x31db('0x0'));var rp=require(_0x31db('0x1'));var util=require(_0x31db('0x2'));var BPromise=require(_0x31db('0x3'));var db=require(_0x31db('0x4'))['db'];var logger=require(_0x31db('0x5'))(_0x31db('0x6'));function getTranscriptionJob(_0x7041d7,_0x291c40,_0x446ef8,_0x5fdfef){return new Promise(function(_0x3f252a,_0x2b4eb6){var _0x156381=new AWS[(_0x31db('0x7'))]({'accessKeyId':_0x291c40,'secretAccessKey':_0x7041d7,'region':_0x446ef8});_0x156381[_0x31db('0x8')]({'TranscriptionJobName':_0x5fdfef},function(_0x3a431e,_0x3881c8){if(_0x3a431e){return _0x2b4eb6(_0x3a431e);}else{return _0x3f252a(_0x3881c8);}});});}function sentiment(_0x34ee71,_0x58517e,_0x19d1a9,_0x11ed47,_0x2647cc){return new Promise(function(_0x2628af,_0x2311cd){var _0x541779=new AWS[(_0x31db('0x9'))]({'accessKeyId':_0x58517e,'secretAccessKey':_0x34ee71,'region':_0x19d1a9});_0x541779[_0x31db('0xa')]({'Text':_0x11ed47,'LanguageCode':_0x2647cc[_0x31db('0xb')](0x0,0x2)},function(_0x49ce46,_0x296f62){if(_0x49ce46){return _0x2311cd(_0x49ce46);}else{return _0x2628af(_0x296f62);}});});}function checkTranscribeJob(_0x2aaafc,_0x1fad0a,_0x1ca88f){var _0x298707;return new BPromise(function(_0x98c3d0,_0x547218){logger['info'](util[_0x31db('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x2aaafc['id'],_0x2aaafc[_0x31db('0xd')]));return getTranscriptionJob(_0x1ca88f[_0x31db('0xe')],_0x1ca88f[_0x31db('0xf')],_0x1fad0a[_0x31db('0x10')],_0x2aaafc[_0x31db('0xd')])['then'](function(_0x557907){logger['info'](util[_0x31db('0xc')](_0x31db('0x11'),_0x2aaafc['id'],_0x2aaafc[_0x31db('0xd')],_0x557907[_0x31db('0x12')][_0x31db('0x13')]));if(!_0x2aaafc[_0x31db('0x14')]){switch(_0x557907[_0x31db('0x12')][_0x31db('0x13')]){case _0x31db('0x15'):var _0x44cdeb={'transcribeStatus':_0x557907[_0x31db('0x12')]['TranscriptionJobStatus'],'fileUri':_0x557907[_0x31db('0x12')]['Transcript']['TranscriptFileUri']};logger[_0x31db('0x16')](util[_0x31db('0xc')](_0x31db('0x17'),_0x2aaafc['id']));return rp({'uri':_0x557907[_0x31db('0x12')][_0x31db('0x18')][_0x31db('0x19')],'json':!![]})[_0x31db('0x1a')](function(_0x98ce70){logger[_0x31db('0x16')](util[_0x31db('0xc')](_0x31db('0x1b'),_0x2aaafc['id']));if(_0x98ce70&&_0x98ce70[_0x31db('0x1c')]&&_0x98ce70['results'][_0x31db('0x1d')]&&_0x98ce70[_0x31db('0x1c')][_0x31db('0x1d')]['length']){_0x44cdeb[_0x31db('0x14')]='';for(var _0x54d623=0x0;_0x54d623<_0x98ce70['results'][_0x31db('0x1d')][_0x31db('0x1e')];_0x54d623++){_0x44cdeb['fileText']+=_0x98ce70['results']['transcripts'][_0x54d623][_0x31db('0x1f')]+'';}}return _0x2aaafc['update'](_0x44cdeb);})[_0x31db('0x1a')](function(){logger[_0x31db('0x16')](util[_0x31db('0xc')](_0x31db('0x20'),_0x2aaafc['id']));if(!_0x2aaafc[_0x31db('0x21')]){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))](_0x31db('0x24'));}if(!_0x1fad0a[_0x31db('0x25')]||!_0x1fad0a['sentimentAccountId']||!_0x1fad0a[_0x31db('0x26')]||!_0x1fad0a[_0x31db('0x27')]||!_0x1fad0a['bucket']){throw new db['Sequelize'][(_0x31db('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x44cdeb['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x1fad0a[_0x31db('0x28')]===_0x1ca88f['id']){return _0x1ca88f;}else{return db[_0x31db('0x29')]['findOne']({'where':{'id':_settings[_0x31db('0x28')]}});}})['then'](function(_0x530c44){if(!_0x530c44){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))](_0x31db('0x2a'));}if(!_0x530c44['data1']||!_0x530c44['data2']){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))](_0x31db('0x2b'));}_0x298707=_0x530c44;logger[_0x31db('0x16')](util[_0x31db('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2aaafc['id']));return sentiment(_0x298707['data1'],_0x298707[_0x31db('0xf')],_0x1fad0a['sentimentRegion'],_0x44cdeb[_0x31db('0x14')],_0x1fad0a['language']);})[_0x31db('0x1a')](function(_0x3204f6){logger[_0x31db('0x16')](util[_0x31db('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2aaafc['id']));return _0x2aaafc[_0x31db('0x2c')]({'sentiment':_0x3204f6[_0x31db('0x2d')],'sPositive':_0x3204f6['SentimentScore']['Positive'],'sNegative':_0x3204f6[_0x31db('0x2e')][_0x31db('0x2f')],'sMixed':_0x3204f6['SentimentScore']['Mixed'],'sNeutral':_0x3204f6[_0x31db('0x2e')][_0x31db('0x30')]});})[_0x31db('0x1a')](function(){logger[_0x31db('0x16')](util['format'](_0x31db('0x20'),_0x2aaafc['id']));_0x98c3d0();});case _0x31db('0x31'):return _0x2aaafc[_0x31db('0x2c')]({'transcribeStatus':'FAILED','failureReason':_0x557907[_0x31db('0x12')]['FailureReason']})[_0x31db('0x1a')](function(){logger[_0x31db('0x16')](util[_0x31db('0xc')](_0x31db('0x20'),_0x2aaafc['id']));_0x98c3d0();});default:logger['info'](util[_0x31db('0xc')](_0x31db('0x32'),_0x2aaafc['id']));break;}}else{return BPromise[_0x31db('0x33')]()[_0x31db('0x1a')](function(){if(!_0x2aaafc['tempSentiment']){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))](_0x31db('0x24'));}if(!_0x1fad0a[_0x31db('0x25')]||!_0x1fad0a['sentimentAccountId']||!_0x1fad0a[_0x31db('0x26')]||!_0x1fad0a[_0x31db('0x27')]||!_0x1fad0a[_0x31db('0x34')]){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))](_0x31db('0x35'));}if(!_0x2aaafc[_0x31db('0x14')]){throw new Error(_0x31db('0x36'));}if(_0x1fad0a[_0x31db('0x28')]===_0x1ca88f['id']){return _0x1ca88f;}else{return db[_0x31db('0x29')][_0x31db('0x37')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x31db('0x1a')](function(_0x434af9){if(!_0x434af9){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))](_0x31db('0x2a'));}if(!_0x434af9[_0x31db('0xe')]||!_0x434af9[_0x31db('0xf')]){throw new db['Sequelize'][(_0x31db('0x23'))](_0x31db('0x2b'));}_0x298707=_0x434af9;logger['info'](util[_0x31db('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2aaafc['id']));return sentiment(_0x298707[_0x31db('0xe')],_0x298707[_0x31db('0xf')],_0x1fad0a[_0x31db('0x26')],_0x2aaafc['fileText'],_0x1fad0a[_0x31db('0x27')]);})[_0x31db('0x1a')](function(_0x5a1eb0){logger[_0x31db('0x16')](util[_0x31db('0xc')](_0x31db('0x38'),_0x2aaafc['id']));return _0x2aaafc[_0x31db('0x2c')]({'sentiment':_0x5a1eb0[_0x31db('0x2d')],'sPositive':_0x5a1eb0[_0x31db('0x2e')][_0x31db('0x39')],'sNegative':_0x5a1eb0[_0x31db('0x2e')]['Negative'],'sMixed':_0x5a1eb0[_0x31db('0x2e')][_0x31db('0x3a')],'sNeutral':_0x5a1eb0[_0x31db('0x2e')][_0x31db('0x30')],'transcribeStatus':_0x31db('0x15')});})['then'](function(){logger['info'](util[_0x31db('0xc')](_0x31db('0x20'),_0x2aaafc['id']));_0x98c3d0();});}})[_0x31db('0x3b')](function(_0x1a016b){if(_0x1a016b){if(!_0x1a016b[_0x31db('0x3c')]||_0x1a016b[_0x31db('0x3c')]!==_0x31db('0x3d')){logger[_0x31db('0x3e')](util[_0x31db('0xc')](_0x31db('0x3f'),_0x2aaafc['id']),util['inspect'](_0x1a016b,{'showHidden':![],'depth':null}));}}_0x98c3d0();});});}function checkTranscribe(){var _0x1e0878;var _0x286dbb;var _0xd9b947;return db[_0x31db('0x40')][_0x31db('0x41')]({'where':{'transcribeStatus':_0x31db('0x42')}})[_0x31db('0x1a')](function(_0x3a6862){if(!_0x3a6862||!_0x3a6862['length']){throw new db[(_0x31db('0x22'))]['ValidationError'](_0x31db('0x43'));}_0x1e0878=_0x3a6862;return db[_0x31db('0x44')][_0x31db('0x37')]({'where':{'id':0x1}});})[_0x31db('0x1a')](function(_0x4f861b){if(!_0x4f861b){throw new db['Sequelize']['ValidationError'](_0x31db('0x45'));}_0x286dbb=_0x4f861b;if(!_0x286dbb[_0x31db('0x6')]||!_0x286dbb[_0x31db('0x46')]||!_0x286dbb[_0x31db('0x10')]||!_0x286dbb['language']||!_0x286dbb[_0x31db('0x34')]){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))]('Transcribe\x20not\x20configured');}return db[_0x31db('0x29')]['findOne']({'where':{'id':_0x286dbb[_0x31db('0x46')]}});})[_0x31db('0x1a')](function(_0x51fe21){if(!_0x51fe21){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x51fe21[_0x31db('0xe')]||!_0x51fe21['data2']){throw new db[(_0x31db('0x22'))][(_0x31db('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0xd9b947=_0x51fe21;var _0x3e6733=[];_0x1e0878['forEach'](function(_0x2a2366){_0x3e6733[_0x31db('0x47')](checkTranscribeJob(_0x2a2366,_0x286dbb,_0xd9b947));});return BPromise[_0x31db('0x48')](_0x3e6733);})[_0x31db('0x3b')](function(_0xe73ed4){if(_0xe73ed4){if(!_0xe73ed4[_0x31db('0x3c')]||_0xe73ed4[_0x31db('0x3c')]!==_0x31db('0x3d')){logger['error'](util[_0x31db('0x49')](_0xe73ed4,{'showHidden':![],'depth':null}));}}});}exports[_0x31db('0x4a')]=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 d561da1..50ade39 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 _0xcdef=['join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x1a3ca2,_0xe144e7){var _0x30ea08=function(_0x37a9f6){while(--_0x37a9f6){_0x1a3ca2['push'](_0x1a3ca2['shift']());}};_0x30ea08(++_0xe144e7);}(_0xcdef,0xb3));var _0xfcde=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcdef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfcde('0x0'));var moment=require(_0xfcde('0x1'));var Redis=require('ioredis');var util=require(_0xfcde('0x2'));var config=require(_0xfcde('0x3'));var db=require(_0xfcde('0x4'))['db'];var logger=require(_0xfcde('0x5'))(_0xfcde('0x6'));config[_0xfcde('0x7')]=_[_0xfcde('0x8')](config[_0xfcde('0x7')],{'host':_0xfcde('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfcde('0x7')]));function closeInteractions(){var _0x306ce0=[];return db[_0xfcde('0xa')][_0xfcde('0xb')]({'raw':!![],'attributes':['id',_0xfcde('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfcde('0xd')](0x18,_0xfcde('0xe'))}}})[_0xfcde('0xf')](function(_0x4185e1){if(_0x4185e1&&_0x4185e1['length']){_0x306ce0=_[_0xfcde('0x10')](_0x4185e1||[],'id');logger[_0xfcde('0x11')](_0xfcde('0x12'),_0x306ce0[_0xfcde('0x13')]());return db['WhatsappInteraction'][_0xfcde('0x14')]({'closeReason':_0xfcde('0x15'),'disposition':_0xfcde('0x16'),'closed':!![],'closedAt':moment()['format'](_0xfcde('0x17'))},{'where':{'id':_0x306ce0}});}})[_0xfcde('0xf')](function(){if(_0x306ce0&&_0x306ce0[_0xfcde('0x18')]){logger[_0xfcde('0x11')](_0xfcde('0x19'),_0x306ce0['join']());for(var _0x4ff029=0x0;_0x4ff029<_0x306ce0[_0xfcde('0x18')];_0x4ff029++){io[_0xfcde('0x1a')](_0xfcde('0x1b'),{'id':_0x306ce0[_0x4ff029],'closed':!![]});}}})[_0xfcde('0x1c')](function(_0x3ae213){logger[_0xfcde('0x1d')](_0xfcde('0x1e'),_0x3ae213?util[_0xfcde('0x1f')](_0x3ae213,{'showHidden':![],'depth':null}):'');});}exports[_0xfcde('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf169=['ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','hours','length','map','info','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment'];(function(_0x405e35,_0x5af212){var _0x192dcb=function(_0x24a03c){while(--_0x24a03c){_0x405e35['push'](_0x405e35['shift']());}};_0x192dcb(++_0x5af212);}(_0xf169,0x142));var _0x9f16=function(_0x38ebee,_0x153a15){_0x38ebee=_0x38ebee-0x0;var _0x456464=_0xf169[_0x38ebee];return _0x456464;};'use strict';var _=require(_0x9f16('0x0'));var moment=require(_0x9f16('0x1'));var Redis=require(_0x9f16('0x2'));var util=require('util');var config=require(_0x9f16('0x3'));var db=require(_0x9f16('0x4'))['db'];var logger=require(_0x9f16('0x5'))('schedule');config[_0x9f16('0x6')]=_[_0x9f16('0x7')](config[_0x9f16('0x6')],{'host':_0x9f16('0x8'),'port':0x18eb});var io=require(_0x9f16('0x9'))(new Redis(config[_0x9f16('0x6')]));function closeInteractions(){var _0x57fdef=[];return db['WhatsappInteraction'][_0x9f16('0xa')]({'raw':!![],'attributes':['id',_0x9f16('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x9f16('0xc'))}}})['then'](function(_0x295789){if(_0x295789&&_0x295789[_0x9f16('0xd')]){_0x57fdef=_[_0x9f16('0xe')](_0x295789||[],'id');logger[_0x9f16('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x57fdef[_0x9f16('0x10')]());return db['WhatsappInteraction']['update']({'closeReason':_0x9f16('0x11'),'disposition':_0x9f16('0x12'),'closed':!![],'closedAt':moment()[_0x9f16('0x13')](_0x9f16('0x14'))},{'where':{'id':_0x57fdef}});}})[_0x9f16('0x15')](function(){if(_0x57fdef&&_0x57fdef[_0x9f16('0xd')]){logger[_0x9f16('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x57fdef[_0x9f16('0x10')]());for(var _0x2199c2=0x0;_0x2199c2<_0x57fdef[_0x9f16('0xd')];_0x2199c2++){io['emit'](_0x9f16('0x16'),{'id':_0x57fdef[_0x2199c2],'closed':!![]});}}})[_0x9f16('0x17')](function(_0x2bdc1e){logger[_0x9f16('0x18')](_0x9f16('0x19'),_0x2bdc1e?util['inspect'](_0x2bdc1e,{'showHidden':![],'depth':null}):'');});}exports[_0x9f16('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 bff66e9..ce99698 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe495=['hopper1','hopper2','catch','util','../mysqldb','push','innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate'];(function(_0x2ce9e5,_0x3feece){var _0x491211=function(_0x90b121){while(--_0x90b121){_0x2ce9e5['push'](_0x2ce9e5['shift']());}};_0x491211(++_0x3feece);}(_0xe495,0xc1));var _0x5e49=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xe495[_0x1b2ff7];return _0x31656a;};'use strict';var util=require(_0x5e49('0x0'));var db=require(_0x5e49('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5e49('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5e49('0x3')+i+_0x5e49('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5e49('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5e49('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x5e49('0x6')+i,'lastName':_0x5e49('0x7')+i,'phone':0xf879fb460+i,'email':_0x5e49('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5e49('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5e49('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x5e49('0x5')]()});}db[_0x5e49('0x8')][_0x5e49('0x9')]({'where':{}})[_0x5e49('0xa')](function(){return db[_0x5e49('0x8')]['bulkCreate'](contacts);})[_0x5e49('0xa')](function(){console[_0x5e49('0xb')](_0x5e49('0xc'),_0x5e49('0xd'));return db[_0x5e49('0xe')][_0x5e49('0x9')]({'where':{}});})['then'](function(){return db[_0x5e49('0xe')][_0x5e49('0xf')](hopper);})['then'](function(){console[_0x5e49('0xb')]('finished\x20populating',_0x5e49('0x10'));return db[_0x5e49('0x8')][_0x5e49('0xf')](contacts2);})[_0x5e49('0xa')](function(){console[_0x5e49('0xb')](_0x5e49('0xc'),'contacts2');return db[_0x5e49('0xe')][_0x5e49('0xf')](hopper2);})[_0x5e49('0xa')](function(){console[_0x5e49('0xb')](_0x5e49('0xc'),_0x5e49('0x11'));})[_0x5e49('0x12')](function(_0x4c6102){console[_0x5e49('0xb')](_0x4c6102);}); \ No newline at end of file +var _0x5216=['push','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','CmHopper','finished\x20populating','catch','util','Innocenzo'];(function(_0x3c73e4,_0x183626){var _0x5bed14=function(_0x59a1d2){while(--_0x59a1d2){_0x3c73e4['push'](_0x3c73e4['shift']());}};_0x5bed14(++_0x183626);}(_0x5216,0x1a2));var _0x6521=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5216[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6521('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x6521('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6521('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6521('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6521('0x3')+i+_0x6521('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6521('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6521('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6521('0x5')](),'updatedAt':Date[_0x6521('0x5')]()});}db[_0x6521('0x6')][_0x6521('0x7')]({'where':{}})[_0x6521('0x8')](function(){return db[_0x6521('0x6')][_0x6521('0x9')](contacts);})[_0x6521('0x8')](function(){console[_0x6521('0xa')]('finished\x20populating','contacts1');return db['CmHopper'][_0x6521('0x7')]({'where':{}});})['then'](function(){return db[_0x6521('0xb')][_0x6521('0x9')](hopper);})[_0x6521('0x8')](function(){console[_0x6521('0xa')](_0x6521('0xc'),'hopper1');return db[_0x6521('0x6')][_0x6521('0x9')](contacts2);})['then'](function(){console['log'](_0x6521('0xc'),'contacts2');return db[_0x6521('0xb')][_0x6521('0x9')](hopper2);})[_0x6521('0x8')](function(){console[_0x6521('0xa')](_0x6521('0xc'),'hopper2');})[_0x6521('0xd')](function(_0x485368){console['log'](_0x485368);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8969388..ce0a4e2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33e3=['%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent'];(function(_0x4d0d85,_0x1d2bdb){var _0xf8b08e=function(_0xd33fc2){while(--_0xd33fc2){_0x4d0d85['push'](_0x4d0d85['shift']());}};_0xf8b08e(++_0x1d2bdb);}(_0x33e3,0x1da));var _0x333e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33e3[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x333e('0x0'));var db=require(_0x333e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x333e('0x2')]({'name':util[_0x333e('0x3')](_0x333e('0x4'),_0x333e('0x5'),i),'fullname':util[_0x333e('0x3')](_0x333e('0x4'),_0x333e('0x5'),i),'email':util['format'](_0x333e('0x6'),_0x333e('0x5'),i),'role':_0x333e('0x5'),'password':_0x333e('0x7'),'internal':0xfa0+i,'type':_0x333e('0x8'),'transport':[_0x333e('0x9'),'ws',_0x333e('0xa')],'disallow':[_0x333e('0xb')],'allow':['ulaw'],'defaultuser':util[_0x333e('0x3')](_0x333e('0x4'),_0x333e('0x5'),i),'encryption':_0x333e('0xc'),'avpf':_0x333e('0xc'),'force_avp':_0x333e('0xc'),'icesupport':_0x333e('0xc'),'dtlsenable':_0x333e('0xc'),'dtlsverify':'no','dtlscertfile':_0x333e('0xd'),'dtlsprivatekey':_0x333e('0xe'),'dtlssetup':_0x333e('0xf'),'callerid':util[_0x333e('0x3')](_0x333e('0x10'),util[_0x333e('0x3')]('%s%s',_0x333e('0x5'),i),0xfa0+i)});}db['User']['bulkCreate'](users)['then'](function(){console[_0x333e('0x11')](_0x333e('0x12'));})[_0x333e('0x13')](function(_0x16a8f7){console['log'](_0x16a8f7);}); \ No newline at end of file +var _0x9d53=['agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s'];(function(_0xe6c7e3,_0x4d4d84){var _0x32c5b1=function(_0x2ec7bf){while(--_0x2ec7bf){_0xe6c7e3['push'](_0xe6c7e3['shift']());}};_0x32c5b1(++_0x4d4d84);}(_0x9d53,0x8b));var _0x39d5=function(_0x207d8b,_0x3cfc56){_0x207d8b=_0x207d8b-0x0;var _0x570f38=_0x9d53[_0x207d8b];return _0x570f38;};'use strict';var util=require(_0x39d5('0x0'));var db=require(_0x39d5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x39d5('0x2')]({'name':util[_0x39d5('0x3')](_0x39d5('0x4'),_0x39d5('0x5'),i),'fullname':util[_0x39d5('0x3')](_0x39d5('0x4'),'agent',i),'email':util['format'](_0x39d5('0x6'),_0x39d5('0x5'),i),'role':'agent','password':_0x39d5('0x7'),'internal':0xfa0+i,'type':_0x39d5('0x8'),'transport':[_0x39d5('0x9'),'ws',_0x39d5('0xa')],'disallow':[_0x39d5('0xb')],'allow':[_0x39d5('0xc')],'defaultuser':util[_0x39d5('0x3')](_0x39d5('0x4'),_0x39d5('0x5'),i),'encryption':'yes','avpf':_0x39d5('0xd'),'force_avp':'yes','icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x39d5('0xe'),'dtlsprivatekey':_0x39d5('0xf'),'dtlssetup':_0x39d5('0x10'),'callerid':util[_0x39d5('0x3')](_0x39d5('0x11'),util['format'](_0x39d5('0x4'),'agent',i),0xfa0+i)});}db[_0x39d5('0x12')][_0x39d5('0x13')](users)[_0x39d5('0x14')](function(){console[_0x39d5('0x15')](_0x39d5('0x16'));})[_0x39d5('0x17')](function(_0x4f461a){console['log'](_0x4f461a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 1882b43..94fb38d 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6bc=['all','voice','fax','sms','mail','whatsapp','telephone:%s','role','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','default','setMaxListeners','address','request','connection','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','telephone','agent','type','ivr','findOne','then','autoAssociation','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Trunks','findAll','IvrCampaigns','resourceId','map','User','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','FaxQueue','Telephones','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xd6bc,0x1a0));var _0xcd6b=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xd6bc[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xcd6b('0x0'));var util=require(_0xcd6b('0x1'));var BPromise=require(_0xcd6b('0x2'));var db=require(_0xcd6b('0x3'))['db'];var config=require(_0xcd6b('0x4'));var queryQueues={'attributes':['id',_0xcd6b('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0xcd6b('0x5'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xcd6b('0x5')],'where':{'role':_0xcd6b('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xcd6b('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xcd6b('0x5')],'where':{'role':_0xcd6b('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xcd6b('0x5'),_0xcd6b('0x8')],'where':{'type':_0xcd6b('0x9')}};function getAssociatedResources(_0x2ff2e4,_0x526bc8,_0x4f32e7){return db['UserProfileSection'][_0xcd6b('0xa')]({'where':{'name':_0x2ff2e4,'userProfileId':_0x526bc8},'raw':!![]})[_0xcd6b('0xb')](function(_0x4c8b64){if(_0x4c8b64){if(_0x4c8b64[_0xcd6b('0xc')]){switch(_0x2ff2e4){case'VoiceQueues':case _0xcd6b('0xd'):case'FaxQueues':case _0xcd6b('0xe'):case _0xcd6b('0xf'):case _0xcd6b('0x10'):case _0xcd6b('0x11'):return db[_0x4f32e7]['findAll'](queryQueues);case'Telephones':return db[_0x4f32e7]['findAll'](queryTelephones);case _0xcd6b('0x12'):return db[_0x4f32e7][_0xcd6b('0x13')](queryTrunks);case _0xcd6b('0x14'):return db[_0x4f32e7][_0xcd6b('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0xcd6b('0x13')]({'attributes':[_0xcd6b('0x15')],'where':{'sectionId':_0x4c8b64['id']},'raw':!![]})['then'](function(_0x312884){if(_0x312884){var _0x2913e8={'where':{'id':_[_0xcd6b('0x16')](_0x312884,_0xcd6b('0x15'))},'raw':!![]};switch(_0x4f32e7){case _0xcd6b('0x17'):_0x2913e8[_0xcd6b('0x18')]['role']='telephone';break;case _0xcd6b('0x19'):_0x2913e8['where'][_0xcd6b('0x8')]=_0xcd6b('0x9');break;}return db[_0x4f32e7][_0xcd6b('0x13')](_0x2913e8);}else{return[];}});}}else{return[];}})[_0xcd6b('0xb')](function(_0x507c29){return _0x507c29;});}function joinOrLeaveQueues(_0x1ef0e1,_0x2fb44e,_0x4307c5,_0x13aff6){_0x1ef0e1[_0x2fb44e](util[_0xcd6b('0x1a')](_0xcd6b('0x1b'),_0x4307c5,_0x13aff6['name']));if(_0x13aff6['Agents']){for(var _0x48724a=0x0;_0x48724a<_0x13aff6[_0xcd6b('0x1c')][_0xcd6b('0x1d')];_0x48724a+=0x1){_0x1ef0e1[_0x2fb44e](util[_0xcd6b('0x1a')](_0xcd6b('0x1e'),_0x13aff6[_0xcd6b('0x1c')][_0x48724a][_0xcd6b('0x5')]));}}}function joinOrLeave(_0x6e07aa,_0x31e13c,_0x1fd091){var _0x5b7864;if(_0x6e07aa[_0xcd6b('0x1f')][_0xcd6b('0x20')]['id']){db['User']['find']({'attributes':['id',_0xcd6b('0x5'),'role',_0xcd6b('0x21')],'where':{'id':_0x6e07aa[_0xcd6b('0x1f')]['query']['id']},'include':[{'model':db[_0xcd6b('0x22')],'as':_0xcd6b('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xcd6b('0x24')],'as':_0xcd6b('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xcd6b('0x26')],'as':_0xcd6b('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xcd6b('0x28')],'as':_0xcd6b('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xcd6b('0x2a')],'as':_0xcd6b('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xcd6b('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xcd6b('0xb')](function(_0x4cbda3){if(_0x4cbda3){_0x5b7864=_0x4cbda3;_0x6e07aa[_0x31e13c](util[_0xcd6b('0x1a')]('user:%s',_0x4cbda3['name']));var _0x1bd814=[];switch(_0x4cbda3['role']){case _0xcd6b('0x2d'):_0x6e07aa[_0x31e13c](_0xcd6b('0x2e'));_0x6e07aa[_0x31e13c](_0xcd6b('0x2f'));if(queryQueues['hasOwnProperty'](_0xcd6b('0x30'))){delete queryQueues[_0xcd6b('0x30')];}_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x32')][_0xcd6b('0x13')](queryQueues));_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x33')]['findAll'](queryQueues));_0x1bd814[_0xcd6b('0x31')](db['FaxQueue'][_0xcd6b('0x13')](queryQueues));_0x1bd814['push'](db[_0xcd6b('0x34')][_0xcd6b('0x13')](queryQueues));_0x1bd814['push'](db[_0xcd6b('0x35')][_0xcd6b('0x13')](queryQueues));_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x36')]['findAll'](queryQueues));_0x1bd814['push'](db[_0xcd6b('0x37')]['findAll'](queryQueues));_0x1bd814['push'](db[_0xcd6b('0x17')][_0xcd6b('0x13')](queryTelephones));_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x38')]['findAll'](queryTrunks));_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x19')]['findAll'](queryCampaigns));_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x17')][_0xcd6b('0x13')](queryAgents));break;case'user':_0x6e07aa[_0x31e13c](_0xcd6b('0x2e'));_0x6e07aa[_0x31e13c]('voice:outbound');_0x1bd814[_0xcd6b('0x31')](getAssociatedResources('VoiceQueues',_0x4cbda3[_0xcd6b('0x21')],_0xcd6b('0x32')));_0x1bd814[_0xcd6b('0x31')](getAssociatedResources('ChatQueues',_0x4cbda3['userProfileId'],'ChatQueue'));_0x1bd814['push'](getAssociatedResources('FaxQueues',_0x4cbda3[_0xcd6b('0x21')],_0xcd6b('0x39')));_0x1bd814['push'](getAssociatedResources('SmsQueues',_0x4cbda3[_0xcd6b('0x21')],_0xcd6b('0x34')));_0x1bd814['push'](getAssociatedResources(_0xcd6b('0xf'),_0x4cbda3['userProfileId'],_0xcd6b('0x35')));_0x1bd814[_0xcd6b('0x31')](getAssociatedResources(_0xcd6b('0x10'),_0x4cbda3[_0xcd6b('0x21')],_0xcd6b('0x36')));_0x1bd814[_0xcd6b('0x31')](getAssociatedResources(_0xcd6b('0x11'),_0x4cbda3[_0xcd6b('0x21')],_0xcd6b('0x37')));_0x1bd814[_0xcd6b('0x31')](getAssociatedResources(_0xcd6b('0x3a'),_0x4cbda3[_0xcd6b('0x21')],'User'));_0x1bd814[_0xcd6b('0x31')](getAssociatedResources('Trunks',_0x4cbda3['userProfileId'],_0xcd6b('0x38')));_0x1bd814[_0xcd6b('0x31')](getAssociatedResources(_0xcd6b('0x14'),_0x4cbda3[_0xcd6b('0x21')],_0xcd6b('0x19')));_0x1bd814[_0xcd6b('0x31')](db[_0xcd6b('0x17')][_0xcd6b('0x13')](queryAgents));break;case _0xcd6b('0x7'):_0x6e07aa[_0x31e13c](_0xcd6b('0x2e'));_0x6e07aa[_0x31e13c]('voice:outbound');_0x1bd814[_0xcd6b('0x31')](_0x4cbda3[_0xcd6b('0x3b')]({'attributes':['id',_0xcd6b('0x5')]}));_0x1bd814[_0xcd6b('0x31')](_0x4cbda3['getChatQueues']({'attributes':['id',_0xcd6b('0x5')]}));_0x1bd814[_0xcd6b('0x31')](_0x4cbda3[_0xcd6b('0x3c')]({'attributes':['id',_0xcd6b('0x5')]}));_0x1bd814[_0xcd6b('0x31')](_0x4cbda3[_0xcd6b('0x3d')]({'attributes':['id','name']}));_0x1bd814[_0xcd6b('0x31')](_0x4cbda3['getMailQueues']({'attributes':['id',_0xcd6b('0x5')]}));_0x1bd814[_0xcd6b('0x31')](_0x4cbda3[_0xcd6b('0x3e')]({'attributes':['id',_0xcd6b('0x5')]}));_0x1bd814[_0xcd6b('0x31')](_0x4cbda3[_0xcd6b('0x3f')]({'attributes':['id',_0xcd6b('0x5')]}));break;}return BPromise[_0xcd6b('0x40')](_0x1bd814);}})['then'](function(_0x468b64){if(_0x468b64&&_0x468b64[_0xcd6b('0x1d')]){for(var _0x179446=0x0;_0x179446<_0x468b64['length'];_0x179446+=0x1){for(var _0x9ff0f9=0x0;_0x9ff0f9<_0x468b64[_0x179446]['length'];_0x9ff0f9+=0x1){switch(_0x179446){case 0x0:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,_0xcd6b('0x41'),_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x1:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,'chat',_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x2:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,_0xcd6b('0x42'),_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x3:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,_0xcd6b('0x43'),_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x4:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,_0xcd6b('0x44'),_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x5:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,'openchannel',_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x6:joinOrLeaveQueues(_0x6e07aa,_0x31e13c,_0xcd6b('0x45'),_0x468b64[_0x179446][_0x9ff0f9]);break;case 0x7:if(_0x5b7864['role']!==_0xcd6b('0x7'))_0x6e07aa[_0x31e13c](util['format'](_0xcd6b('0x46'),_0x468b64[_0x179446][_0x9ff0f9][_0xcd6b('0x5')]));break;case 0x8:if(_0x5b7864[_0xcd6b('0x47')]!==_0xcd6b('0x7'))_0x6e07aa[_0x31e13c](util['format'](_0xcd6b('0x48'),_0x468b64[_0x179446][_0x9ff0f9][_0xcd6b('0x5')]));break;case 0x9:if(_0x5b7864[_0xcd6b('0x47')]!==_0xcd6b('0x7'))_0x6e07aa[_0x31e13c](util[_0xcd6b('0x1a')]('campaign:%s:%s',_0x468b64[_0x179446][_0x9ff0f9][_0xcd6b('0x8')],_0x468b64[_0x179446][_0x9ff0f9][_0xcd6b('0x5')]));break;case 0xa:_0x6e07aa[_0x31e13c](util[_0xcd6b('0x1a')]('user:%s',_0x468b64[_0x179446][_0x9ff0f9][_0xcd6b('0x5')]));break;}}}}})[_0xcd6b('0xb')](function(){if(_0x31e13c===_0xcd6b('0x49')){var _0x17a662=_[_0xcd6b('0x16')](_0x5b7864[_0xcd6b('0x23')],'id');return _0x5b7864[_0xcd6b('0x4a')](_0x17a662)['then'](function(){for(var _0x378d16=0x0;_0x378d16<_0x17a662[_0xcd6b('0x1d')];_0x378d16+=0x1){_0x1fd091[_0xcd6b('0x4b')](_0xcd6b('0x4c'),{'ChatInteractionId':Number(_0x17a662[_0x378d16]),'UserId':Number(_0x5b7864['id'])});}});}})[_0xcd6b('0xb')](function(){if(_0x31e13c===_0xcd6b('0x49')){var _0x1eb54f=_[_0xcd6b('0x16')](_0x5b7864[_0xcd6b('0x25')],'id');return _0x5b7864[_0xcd6b('0x4d')](_0x1eb54f)[_0xcd6b('0xb')](function(){for(var _0x234519=0x0;_0x234519<_0x1eb54f[_0xcd6b('0x1d')];_0x234519+=0x1){_0x1fd091[_0xcd6b('0x4b')](_0xcd6b('0x4e'),{'MailInteractionId':Number(_0x1eb54f[_0x234519]),'UserId':Number(_0x5b7864['id'])});}});}})['then'](function(){if(_0x31e13c==='leave'){var _0x2eaf35=_[_0xcd6b('0x16')](_0x5b7864[_0xcd6b('0x27')],'id');return _0x5b7864[_0xcd6b('0x4f')](_0x2eaf35)[_0xcd6b('0xb')](function(){for(var _0x169f00=0x0;_0x169f00<_0x2eaf35['length'];_0x169f00+=0x1){_0x1fd091[_0xcd6b('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2eaf35[_0x169f00]),'UserId':Number(_0x5b7864['id'])});}});}})[_0xcd6b('0xb')](function(){if(_0x31e13c===_0xcd6b('0x49')){var _0x5dfbc3=_['map'](_0x5b7864[_0xcd6b('0x29')],'id');return _0x5b7864['removeSmsInteractions'](_0x5dfbc3)['then'](function(){for(var _0x43bc0d=0x0;_0x43bc0d<_0x5dfbc3[_0xcd6b('0x1d')];_0x43bc0d+=0x1){_0x1fd091[_0xcd6b('0x4b')](_0xcd6b('0x50'),{'SmsInteractionId':Number(_0x5dfbc3[_0x43bc0d]),'UserId':Number(_0x5b7864['id'])});}});}})[_0xcd6b('0xb')](function(){if(_0x31e13c==='leave'){var _0x247cc1=_['map'](_0x5b7864[_0xcd6b('0x2b')],'id');return _0x5b7864[_0xcd6b('0x51')](_0x247cc1)[_0xcd6b('0xb')](function(){for(var _0x497eec=0x0;_0x497eec<_0x247cc1[_0xcd6b('0x1d')];_0x497eec+=0x1){_0x1fd091[_0xcd6b('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x247cc1[_0x497eec]),'UserId':Number(_0x5b7864['id'])});}});}})[_0xcd6b('0xb')](function(){if(_0x31e13c==='leave'){var _0x1e2413=_['map'](_0x5b7864[_0xcd6b('0x2c')],'id');return _0x5b7864[_0xcd6b('0x52')](_0x1e2413)[_0xcd6b('0xb')](function(){for(var _0x4aaa24=0x0;_0x4aaa24<_0x1e2413[_0xcd6b('0x1d')];_0x4aaa24+=0x1){_0x1fd091[_0xcd6b('0x4b')](_0xcd6b('0x53'),{'WhatsappInteractionId':Number(_0x1e2413[_0x4aaa24]),'UserId':Number(_0x5b7864['id'])});}});}})['catch'](function(_0x346708){_0x6e07aa[_0xcd6b('0x54')](_0x346708);});}}function onDisconnect(_0x1dbf3a,_0x434e3d){joinOrLeave(_0x1dbf3a,_0xcd6b('0x49'),_0x434e3d);}function onConnect(_0xc2caec){joinOrLeave(_0xc2caec,'join');}exports[_0xcd6b('0x55')]=function(_0x4c33aa){_0x4c33aa['on']('connection',function(_0x586a21){_0x586a21[_0xcd6b('0x56')](0x0);_0x586a21[_0xcd6b('0x57')]=_0x586a21[_0xcd6b('0x58')][_0xcd6b('0x59')]['remoteAddress']+':'+_0x586a21[_0xcd6b('0x58')][_0xcd6b('0x59')][_0xcd6b('0x5a')];_0x586a21['connectedAt']=new Date();_0x586a21[_0xcd6b('0x54')]=function(_0x197819){console['log'](_0xcd6b('0x5b')+_0x586a21[_0xcd6b('0x5c')]['name']+'['+_0x586a21[_0xcd6b('0x57')]+']',_0x197819);};_0x586a21['on'](_0xcd6b('0x5d'),function(){onDisconnect(_0x586a21,_0x4c33aa);_0x586a21[_0xcd6b('0x54')](_0xcd6b('0x5e'));});onConnect(_0x586a21);_0x586a21['log'](_0xcd6b('0x5f'));});}; \ No newline at end of file +var _0x7292=['default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','type','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','then','where','telephone','Campaign','format','%s:queue:%s','Agents','length','query','find','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','Trunk','userProfileId','ChatQueue','OpenchannelQueues','OpenchannelQueue','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','map','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join'];(function(_0x5ddb3a,_0xd975ed){var _0xb409ea=function(_0x367623){while(--_0x367623){_0x5ddb3a['push'](_0x5ddb3a['shift']());}};_0xb409ea(++_0xd975ed);}(_0x7292,0x6d));var _0x2729=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7292[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var BPromise=require(_0x2729('0x2'));var db=require(_0x2729('0x3'))['db'];var config=require(_0x2729('0x4'));var queryQueues={'attributes':['id',_0x2729('0x5')],'include':[{'as':'Agents','model':db[_0x2729('0x6')],'attributes':['id',_0x2729('0x5'),_0x2729('0x7')],'raw':!![],'where':{'role':_0x2729('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2729('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x2729('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x2729('0x5')],'where':{'role':_0x2729('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2729('0x5'),_0x2729('0x9')],'where':{'type':_0x2729('0xa')}};function getAssociatedResources(_0x529992,_0xe6a4a7,_0x5b3014){return db[_0x2729('0xb')]['findOne']({'where':{'name':_0x529992,'userProfileId':_0xe6a4a7},'raw':!![]})['then'](function(_0x26d5cf){if(_0x26d5cf){if(_0x26d5cf[_0x2729('0xc')]){switch(_0x529992){case _0x2729('0xd'):case _0x2729('0xe'):case _0x2729('0xf'):case _0x2729('0x10'):case'MailQueues':case'OpenchannelQueues':case _0x2729('0x11'):return db[_0x5b3014][_0x2729('0x12')](queryQueues);case _0x2729('0x13'):return db[_0x5b3014]['findAll'](queryTelephones);case'Trunks':return db[_0x5b3014][_0x2729('0x12')](queryTrunks);case _0x2729('0x14'):return db[_0x5b3014][_0x2729('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2729('0x12')]({'attributes':[_0x2729('0x15')],'where':{'sectionId':_0x26d5cf['id']},'raw':!![]})[_0x2729('0x16')](function(_0xa92e22){if(_0xa92e22){var _0x2db404={'where':{'id':_['map'](_0xa92e22,_0x2729('0x15'))},'raw':!![]};switch(_0x5b3014){case _0x2729('0x6'):_0x2db404[_0x2729('0x17')][_0x2729('0x7')]=_0x2729('0x18');break;case _0x2729('0x19'):_0x2db404[_0x2729('0x17')][_0x2729('0x9')]=_0x2729('0xa');break;}return db[_0x5b3014][_0x2729('0x12')](_0x2db404);}else{return[];}});}}else{return[];}})[_0x2729('0x16')](function(_0x2ad137){return _0x2ad137;});}function joinOrLeaveQueues(_0xb5bba6,_0xd4320c,_0x17db0a,_0x24eea1){_0xb5bba6[_0xd4320c](util[_0x2729('0x1a')](_0x2729('0x1b'),_0x17db0a,_0x24eea1[_0x2729('0x5')]));if(_0x24eea1[_0x2729('0x1c')]){for(var _0xee7bbc=0x0;_0xee7bbc<_0x24eea1[_0x2729('0x1c')][_0x2729('0x1d')];_0xee7bbc+=0x1){_0xb5bba6[_0xd4320c](util['format']('user:%s',_0x24eea1[_0x2729('0x1c')][_0xee7bbc][_0x2729('0x5')]));}}}function joinOrLeave(_0x4540db,_0xbcace7,_0x4dbdf2){var _0x16d69f;if(_0x4540db['handshake'][_0x2729('0x1e')]['id']){db[_0x2729('0x6')][_0x2729('0x1f')]({'attributes':['id','name',_0x2729('0x7'),'userProfileId'],'where':{'id':_0x4540db[_0x2729('0x20')]['query']['id']},'include':[{'model':db[_0x2729('0x21')],'as':_0x2729('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x2729('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x2729('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2729('0x25')],'as':_0x2729('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x2729('0x27')],'as':_0x2729('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x2729('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x2729('0x16')](function(_0x23d7ed){if(_0x23d7ed){_0x16d69f=_0x23d7ed;_0x4540db[_0xbcace7](util[_0x2729('0x1a')](_0x2729('0x2a'),_0x23d7ed[_0x2729('0x5')]));var _0x36fd0e=[];switch(_0x23d7ed[_0x2729('0x7')]){case _0x2729('0x2b'):_0x4540db[_0xbcace7](_0x2729('0x2c'));_0x4540db[_0xbcace7](_0x2729('0x2d'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x2729('0x2e')];}_0x36fd0e[_0x2729('0x2f')](db[_0x2729('0x30')]['findAll'](queryQueues));_0x36fd0e['push'](db['ChatQueue'][_0x2729('0x12')](queryQueues));_0x36fd0e[_0x2729('0x2f')](db[_0x2729('0x31')]['findAll'](queryQueues));_0x36fd0e[_0x2729('0x2f')](db[_0x2729('0x32')][_0x2729('0x12')](queryQueues));_0x36fd0e[_0x2729('0x2f')](db[_0x2729('0x33')]['findAll'](queryQueues));_0x36fd0e[_0x2729('0x2f')](db['OpenchannelQueue'][_0x2729('0x12')](queryQueues));_0x36fd0e[_0x2729('0x2f')](db['WhatsappQueue']['findAll'](queryQueues));_0x36fd0e[_0x2729('0x2f')](db['User']['findAll'](queryTelephones));_0x36fd0e['push'](db[_0x2729('0x34')][_0x2729('0x12')](queryTrunks));_0x36fd0e[_0x2729('0x2f')](db[_0x2729('0x19')][_0x2729('0x12')](queryCampaigns));_0x36fd0e[_0x2729('0x2f')](db[_0x2729('0x6')][_0x2729('0x12')](queryAgents));break;case'user':_0x4540db[_0xbcace7]('voice:inbound');_0x4540db[_0xbcace7](_0x2729('0x2d'));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources('VoiceQueues',_0x23d7ed['userProfileId'],_0x2729('0x30')));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources(_0x2729('0xe'),_0x23d7ed[_0x2729('0x35')],_0x2729('0x36')));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources(_0x2729('0xf'),_0x23d7ed['userProfileId'],_0x2729('0x31')));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources(_0x2729('0x10'),_0x23d7ed['userProfileId'],'SmsQueue'));_0x36fd0e['push'](getAssociatedResources('MailQueues',_0x23d7ed['userProfileId'],'MailQueue'));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources(_0x2729('0x37'),_0x23d7ed['userProfileId'],_0x2729('0x38')));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources('WhatsappQueues',_0x23d7ed[_0x2729('0x35')],'WhatsappQueue'));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources(_0x2729('0x13'),_0x23d7ed[_0x2729('0x35')],_0x2729('0x6')));_0x36fd0e[_0x2729('0x2f')](getAssociatedResources('Trunks',_0x23d7ed[_0x2729('0x35')],_0x2729('0x34')));_0x36fd0e['push'](getAssociatedResources(_0x2729('0x14'),_0x23d7ed[_0x2729('0x35')],'Campaign'));_0x36fd0e[_0x2729('0x2f')](db['User'][_0x2729('0x12')](queryAgents));break;case _0x2729('0x8'):_0x4540db[_0xbcace7](_0x2729('0x2c'));_0x4540db[_0xbcace7](_0x2729('0x2d'));_0x36fd0e[_0x2729('0x2f')](_0x23d7ed[_0x2729('0x39')]({'attributes':['id','name']}));_0x36fd0e[_0x2729('0x2f')](_0x23d7ed['getChatQueues']({'attributes':['id','name']}));_0x36fd0e[_0x2729('0x2f')](_0x23d7ed[_0x2729('0x3a')]({'attributes':['id','name']}));_0x36fd0e[_0x2729('0x2f')](_0x23d7ed[_0x2729('0x3b')]({'attributes':['id',_0x2729('0x5')]}));_0x36fd0e['push'](_0x23d7ed['getMailQueues']({'attributes':['id',_0x2729('0x5')]}));_0x36fd0e[_0x2729('0x2f')](_0x23d7ed[_0x2729('0x3c')]({'attributes':['id',_0x2729('0x5')]}));_0x36fd0e[_0x2729('0x2f')](_0x23d7ed[_0x2729('0x3d')]({'attributes':['id',_0x2729('0x5')]}));break;}return BPromise['all'](_0x36fd0e);}})[_0x2729('0x16')](function(_0x3e5027){if(_0x3e5027&&_0x3e5027[_0x2729('0x1d')]){for(var _0x4505f4=0x0;_0x4505f4<_0x3e5027[_0x2729('0x1d')];_0x4505f4+=0x1){for(var _0x42b62f=0x0;_0x42b62f<_0x3e5027[_0x4505f4]['length'];_0x42b62f+=0x1){switch(_0x4505f4){case 0x0:joinOrLeaveQueues(_0x4540db,_0xbcace7,_0x2729('0x3e'),_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x1:joinOrLeaveQueues(_0x4540db,_0xbcace7,_0x2729('0x3f'),_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x2:joinOrLeaveQueues(_0x4540db,_0xbcace7,_0x2729('0x40'),_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x3:joinOrLeaveQueues(_0x4540db,_0xbcace7,_0x2729('0x41'),_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x4:joinOrLeaveQueues(_0x4540db,_0xbcace7,_0x2729('0x42'),_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x5:joinOrLeaveQueues(_0x4540db,_0xbcace7,_0x2729('0x43'),_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x6:joinOrLeaveQueues(_0x4540db,_0xbcace7,'whatsapp',_0x3e5027[_0x4505f4][_0x42b62f]);break;case 0x7:if(_0x16d69f[_0x2729('0x7')]!=='agent')_0x4540db[_0xbcace7](util[_0x2729('0x1a')](_0x2729('0x44'),_0x3e5027[_0x4505f4][_0x42b62f][_0x2729('0x5')]));break;case 0x8:if(_0x16d69f[_0x2729('0x7')]!==_0x2729('0x8'))_0x4540db[_0xbcace7](util['format'](_0x2729('0x45'),_0x3e5027[_0x4505f4][_0x42b62f]['name']));break;case 0x9:if(_0x16d69f['role']!==_0x2729('0x8'))_0x4540db[_0xbcace7](util['format']('campaign:%s:%s',_0x3e5027[_0x4505f4][_0x42b62f][_0x2729('0x9')],_0x3e5027[_0x4505f4][_0x42b62f][_0x2729('0x5')]));break;case 0xa:_0x4540db[_0xbcace7](util[_0x2729('0x1a')](_0x2729('0x2a'),_0x3e5027[_0x4505f4][_0x42b62f][_0x2729('0x5')]));break;}}}}})['then'](function(){if(_0xbcace7===_0x2729('0x46')){var _0x1b9071=_['map'](_0x16d69f[_0x2729('0x22')],'id');return _0x16d69f[_0x2729('0x47')](_0x1b9071)[_0x2729('0x16')](function(){for(var _0x6615=0x0;_0x6615<_0x1b9071[_0x2729('0x1d')];_0x6615+=0x1){_0x4dbdf2[_0x2729('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1b9071[_0x6615]),'UserId':Number(_0x16d69f['id'])});}});}})[_0x2729('0x16')](function(){if(_0xbcace7===_0x2729('0x46')){var _0xcc2c33=_[_0x2729('0x49')](_0x16d69f['MailInteractions'],'id');return _0x16d69f[_0x2729('0x4a')](_0xcc2c33)[_0x2729('0x16')](function(){for(var _0x240afa=0x0;_0x240afa<_0xcc2c33[_0x2729('0x1d')];_0x240afa+=0x1){_0x4dbdf2['emit'](_0x2729('0x4b'),{'MailInteractionId':Number(_0xcc2c33[_0x240afa]),'UserId':Number(_0x16d69f['id'])});}});}})[_0x2729('0x16')](function(){if(_0xbcace7==='leave'){var _0x3078ce=_[_0x2729('0x49')](_0x16d69f[_0x2729('0x4c')],'id');return _0x16d69f['removeFaxInteractions'](_0x3078ce)[_0x2729('0x16')](function(){for(var _0x1e819a=0x0;_0x1e819a<_0x3078ce['length'];_0x1e819a+=0x1){_0x4dbdf2['emit'](_0x2729('0x4d'),{'FaxInteractionId':Number(_0x3078ce[_0x1e819a]),'UserId':Number(_0x16d69f['id'])});}});}})['then'](function(){if(_0xbcace7===_0x2729('0x46')){var _0x528520=_[_0x2729('0x49')](_0x16d69f[_0x2729('0x26')],'id');return _0x16d69f[_0x2729('0x4e')](_0x528520)[_0x2729('0x16')](function(){for(var _0x337d0c=0x0;_0x337d0c<_0x528520[_0x2729('0x1d')];_0x337d0c+=0x1){_0x4dbdf2['emit'](_0x2729('0x4f'),{'SmsInteractionId':Number(_0x528520[_0x337d0c]),'UserId':Number(_0x16d69f['id'])});}});}})[_0x2729('0x16')](function(){if(_0xbcace7==='leave'){var _0x28d9d1=_['map'](_0x16d69f[_0x2729('0x28')],'id');return _0x16d69f[_0x2729('0x50')](_0x28d9d1)[_0x2729('0x16')](function(){for(var _0x152cd7=0x0;_0x152cd7<_0x28d9d1[_0x2729('0x1d')];_0x152cd7+=0x1){_0x4dbdf2['emit'](_0x2729('0x51'),{'OpenchannelInteractionId':Number(_0x28d9d1[_0x152cd7]),'UserId':Number(_0x16d69f['id'])});}});}})[_0x2729('0x16')](function(){if(_0xbcace7===_0x2729('0x46')){var _0x460a2e=_[_0x2729('0x49')](_0x16d69f['WhatsappInteractions'],'id');return _0x16d69f[_0x2729('0x52')](_0x460a2e)[_0x2729('0x16')](function(){for(var _0x398420=0x0;_0x398420<_0x460a2e[_0x2729('0x1d')];_0x398420+=0x1){_0x4dbdf2[_0x2729('0x48')](_0x2729('0x53'),{'WhatsappInteractionId':Number(_0x460a2e[_0x398420]),'UserId':Number(_0x16d69f['id'])});}});}})[_0x2729('0x54')](function(_0x2c8cae){_0x4540db[_0x2729('0x55')](_0x2c8cae);});}}function onDisconnect(_0x495bf9,_0x1eedfa){joinOrLeave(_0x495bf9,'leave',_0x1eedfa);}function onConnect(_0x20924c){joinOrLeave(_0x20924c,_0x2729('0x56'));}exports[_0x2729('0x57')]=function(_0x4bd659){_0x4bd659['on'](_0x2729('0x58'),function(_0x404e8d){_0x404e8d[_0x2729('0x59')](0x0);_0x404e8d[_0x2729('0x5a')]=_0x404e8d[_0x2729('0x5b')][_0x2729('0x58')][_0x2729('0x5c')]+':'+_0x404e8d[_0x2729('0x5b')][_0x2729('0x58')]['remotePort'];_0x404e8d[_0x2729('0x5d')]=new Date();_0x404e8d[_0x2729('0x55')]=function(_0x5274e1){console[_0x2729('0x55')](_0x2729('0x5e')+_0x404e8d[_0x2729('0x5f')][_0x2729('0x5')]+'['+_0x404e8d[_0x2729('0x5a')]+']',_0x5274e1);};_0x404e8d['on'](_0x2729('0x60'),function(){onDisconnect(_0x404e8d,_0x4bd659);_0x404e8d[_0x2729('0x55')](_0x2729('0x61'));});onConnect(_0x404e8d);_0x404e8d[_0x2729('0x55')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3bba2cb..a25057b 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 _0xf174=['newinteraction','ChatInteraction','afterUpdate','newmessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','get','channel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','User','find','name','email','internal','interface','format','SIP/%s','incomingmessage','catch','AfterCreateMessage','outgoingmessage','motionChannel','opened','closed','changed','substatus','fullname','agent','default','length','model','hook','toLowerCase','condition','util','jayson/promise','triggers','client','http','afterCreate'];(function(_0x49a6e3,_0x44653c){var _0x137dba=function(_0x59d1ff){while(--_0x59d1ff){_0x49a6e3['push'](_0x49a6e3['shift']());}};_0x137dba(++_0x44653c);}(_0xf174,0xd2));var _0x4f17=function(_0x56d2e8,_0x191a8f){_0x56d2e8=_0x56d2e8-0x0;var _0x38d56c=_0xf174[_0x56d2e8];return _0x38d56c;};'use strict';var util=require(_0x4f17('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4f17('0x1'));var logger=require('../logger')(_0x4f17('0x2'));var client=jayson[_0x4f17('0x3')][_0x4f17('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x4f17('0x5'),'condition':_0x4f17('0x6'),'callback':afterCreate},{'channel':'Chat','model':_0x4f17('0x7'),'event':_0x4f17('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0x4f17('0x5'),'condition':_0x4f17('0x9'),'callback':afterCreateMessage},{'channel':_0x4f17('0xa'),'model':_0x4f17('0xb'),'event':_0x4f17('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4f17('0xa'),'model':_0x4f17('0xb'),'event':'afterUpdate','condition':_0x4f17('0xc'),'callback':afterUpdate},{'channel':_0x4f17('0xa'),'model':_0x4f17('0xd'),'event':'afterCreate','condition':_0x4f17('0x9'),'callback':afterCreateMessage},{'channel':_0x4f17('0xe'),'model':_0x4f17('0xf'),'event':_0x4f17('0x5'),'condition':_0x4f17('0x6'),'callback':afterCreate},{'channel':_0x4f17('0xe'),'model':_0x4f17('0xf'),'event':'afterUpdate','condition':_0x4f17('0xc'),'callback':afterUpdate},{'channel':_0x4f17('0xe'),'model':_0x4f17('0x10'),'event':'afterCreate','condition':_0x4f17('0x9'),'callback':afterCreateMessage},{'channel':_0x4f17('0x11'),'model':_0x4f17('0x12'),'event':_0x4f17('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x4f17('0x12'),'event':'afterUpdate','condition':_0x4f17('0xc'),'callback':afterUpdate},{'channel':_0x4f17('0x11'),'model':_0x4f17('0x13'),'event':_0x4f17('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x4f17('0x14'),'event':_0x4f17('0x5'),'condition':_0x4f17('0x6'),'callback':afterCreate},{'channel':_0x4f17('0x15'),'model':'MailInteraction','event':_0x4f17('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4f17('0x15'),'model':_0x4f17('0x16'),'event':_0x4f17('0x5'),'condition':_0x4f17('0x9'),'callback':afterCreateMessage},{'channel':_0x4f17('0x17'),'model':_0x4f17('0x18'),'event':'afterCreate','condition':_0x4f17('0x6'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x4f17('0x8'),'condition':_0x4f17('0xc'),'callback':afterUpdate},{'channel':_0x4f17('0x17'),'model':_0x4f17('0x19'),'event':_0x4f17('0x5'),'condition':_0x4f17('0x9'),'callback':afterCreateMessage}];function request(_0x1bcfd9){return client[_0x4f17('0x1a')](_0x4f17('0x1b'),_0x1bcfd9)[_0x4f17('0x1c')](function(_0x54359a){logger[_0x4f17('0x1d')](_0x4f17('0x1e'),'EventManager',_0x54359a);if(_0x54359a['error']){if(_0x54359a[_0x4f17('0x1f')]['code']===0x1f4){logger[_0x4f17('0x1f')](_0x4f17('0x1e'),'EventManager',_0x54359a[_0x4f17('0x1f')]);}}})['catch'](function(_0x2c0a0f){logger[_0x4f17('0x1f')](_0x4f17('0x1e'),_0x4f17('0x1b'),_0x2c0a0f);});}function afterCreateMessage(_0x4a70c8){return function(_0xad9f7e){_0xad9f7e=_0xad9f7e[_0x4f17('0x20')]({'plain':!![]});_0xad9f7e[_0x4f17('0x21')]=_0x4a70c8;_0xad9f7e['motionChannel']=_0x4a70c8;_0xad9f7e[_0x4f17('0x22')]=_0xad9f7e[_0x4f17('0x23')];Promise[_0x4f17('0x24')]()[_0x4f17('0x1c')](function(){if(typeof _0xad9f7e[_0x4f17('0x25')]===_0x4f17('0x26'))return null;var _0x379d51=_0x4f17('0x27')+_0xad9f7e[_0x4f17('0x25')];return db[_0x4f17('0x28')][_0x4f17('0x29')](_0x379d51,{'type':db[_0x4f17('0x2a')][_0x4f17('0x2b')][_0x4f17('0x2c')],'raw':!![]});})[_0x4f17('0x1c')](function(_0x359c15){if(_0x359c15){_0xad9f7e[_0x4f17('0x2d')]=_0x359c15[0x0];}if(_0xad9f7e[_0x4f17('0x2e')]){return db[_0x4f17('0x2f')][_0x4f17('0x30')]({'where':{'id':_0xad9f7e['UserId']},'attributes':['id',_0x4f17('0x31'),'fullname',_0x4f17('0x32'),_0x4f17('0x33')],'raw':!![]})['then'](function(_0x4ec999){_0xad9f7e[_0x4f17('0x34')]=util[_0x4f17('0x35')](_0x4f17('0x36'),_0x4ec999[_0x4f17('0x31')]);_0xad9f7e[_0x4f17('0x21')]=_0x4a70c8;_0xad9f7e['agent']=_0x4ec999;return request({'event':_0x4f17('0x37'),'message':_0xad9f7e});})[_0x4f17('0x38')](function(_0x55390a){logger[_0x4f17('0x1f')]('Trigger,\x20%s',_0x4f17('0x39'),_0x55390a);});}else{return request({'event':_0x4f17('0x3a'),'message':_0xad9f7e});}});};}function afterCreate(_0x23685c,_0x509fbb){return function(_0x3e942e){_0x3e942e=_0x3e942e[_0x4f17('0x20')]({'plain':!![]});_0x3e942e['channel']=_0x23685c;_0x3e942e[_0x4f17('0x3b')]=_0x23685c;_0x3e942e['event']=_0x4f17('0x3c');var _0x5641b1=_0x4f17('0x27')+_0x3e942e[_0x4f17('0x25')];return db['sequelize'][_0x4f17('0x29')](_0x5641b1,{'type':db[_0x4f17('0x2a')][_0x4f17('0x2b')][_0x4f17('0x2c')],'raw':!![]})[_0x4f17('0x1c')](function(_0x2cb2bc){return _0x2cb2bc;})[_0x4f17('0x1c')](function(_0x51f701){if(_0x51f701){_0x3e942e[_0x4f17('0x2d')]=_0x51f701[0x0];}return request({'event':_0x509fbb,'message':_0x3e942e});});};}function afterUpdate(_0x1715fa){return function(_0x346263){var _0x380f07=_0x346263['changed'](_0x4f17('0x3d'))&&_0x346263[_0x4f17('0x3d')];var _0x44a273=_0x346263[_0x4f17('0x3e')](_0x4f17('0x3f'));if(_0x380f07||_0x44a273){var _0x415adb=_0x380f07?'closedinteraction':_0x4f17('0x3f');var _0x39a0e4=_0x346263[_0x4f17('0x20')]({'plain':!![]});_0x39a0e4[_0x4f17('0x21')]=_0x1715fa;_0x39a0e4['motionChannel']=_0x1715fa;_0x39a0e4[_0x4f17('0x22')]=_0x380f07?_0x4f17('0x3d'):'substatus';var _0x1ab6e9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39a0e4[_0x4f17('0x25')];return db[_0x4f17('0x28')][_0x4f17('0x29')](_0x1ab6e9,{'type':db[_0x4f17('0x2a')][_0x4f17('0x2b')][_0x4f17('0x2c')],'raw':!![]})['then'](function(_0x5d6ebb){if(_0x5d6ebb){_0x39a0e4[_0x4f17('0x2d')]=_0x5d6ebb[0x0];}if(_0x39a0e4[_0x4f17('0x2e')]){return db[_0x4f17('0x2f')][_0x4f17('0x30')]({'where':{'id':_0x39a0e4[_0x4f17('0x2e')]},'attributes':['id',_0x4f17('0x31'),_0x4f17('0x40'),_0x4f17('0x32'),'internal'],'raw':!![]})['then'](function(_0x3076f7){_0x39a0e4['interface']=util['format'](_0x4f17('0x36'),_0x3076f7[_0x4f17('0x31')]);_0x39a0e4[_0x4f17('0x41')]=_0x3076f7;return request({'event':_0x415adb,'message':_0x39a0e4});})[_0x4f17('0x38')](function(_0x3ca9dd){logger[_0x4f17('0x1f')](_0x4f17('0x1e'),'AfterUpdate',_0x3ca9dd);});}else{return request({'event':_0x415adb,'message':_0x39a0e4});}});}};}exports[_0x4f17('0x42')]=function(){for(var _0x29e87f=0x0;_0x29e87f=_0xc8bec5[_0xa805('0x13')]){throw Error(_0xa805('0x14'));}_0x5c0999(_0x26711c);})['catch'](function(_0x51c80f){_0xca8e6(_0x51c80f);});});}; \ No newline at end of file +var _0xf34c=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','mail','chat','fax','sms','openchannel','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','role','agent','User','count','then','getLicense'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf34c,0xb2));var _0xcf34=function(_0x237eca,_0x251eb5){_0x237eca=_0x237eca-0x0;var _0x19cdc9=_0xf34c[_0x237eca];return _0x19cdc9;};'use strict';var _=require(_0xcf34('0x0'));var BPromise=require(_0xcf34('0x1'));var db=require(_0xcf34('0x2'))['db'];var util=require('./license/util');var channels=['voice',_0xcf34('0x3'),_0xcf34('0x4'),_0xcf34('0x5'),_0xcf34('0x6'),'whatsapp',_0xcf34('0x7')];exports['getChannels']=function(){return channels;};exports[_0xcf34('0x8')]=function(_0x455cbe){_0x455cbe=_0x455cbe[_0xcf34('0x9')]();return _['includes'](channels,_0x455cbe);};exports[_0xcf34('0xa')]=function(_0x3d38e9,_0x17d5db,_0x5a96c7,_0x3abd96){var _0x20ba5a={'loginAttempts':_0x17d5db,'blocked':_0x5a96c7};if(!_[_0xcf34('0xb')](_0x3abd96)){_0x20ba5a[_0xcf34('0xc')]=_0x3abd96;}return _0x3d38e9[_0xcf34('0xd')](_0x20ba5a);};exports['getLicense']=function(_0x305ad2){return new BPromise(function(_0x2bf985,_0x1fad3c){var _0x5eb285=0x0;if(_0x305ad2[_0xcf34('0xe')]!==_0xcf34('0xf')){_0x2bf985(_0x305ad2);}db[_0xcf34('0x10')][_0xcf34('0x11')]({'where':{'role':_0xcf34('0xf'),'online':!![],'id':{'$ne':_0x305ad2['id']}}})[_0xcf34('0x12')](function(_0x25ffa9){_0x5eb285=_0x25ffa9;return util[_0xcf34('0x13')]();})[_0xcf34('0x12')](function(_0x1ea46d){if(_0x1ea46d&&_0x1ea46d['agents']&&_0x5eb285>=_0x1ea46d['agents']){throw Error(_0xcf34('0x14'));}_0x2bf985(_0x305ad2);})[_0xcf34('0x15')](function(_0x282e89){_0x1fad3c(_0x282e89);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 5782c0e..b32716c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x336d=['status','render','json','send','404'];(function(_0x1198a7,_0x58ca47){var _0x34e937=function(_0x38ee9b){while(--_0x38ee9b){_0x1198a7['push'](_0x1198a7['shift']());}};_0x34e937(++_0x58ca47);}(_0x336d,0xae));var _0xd336=function(_0x4f356e,_0x4253c0){_0x4f356e=_0x4f356e-0x0;var _0x2a3a7e=_0x336d[_0x4f356e];return _0x2a3a7e;};'use strict';module['exports'][0x194]=function pageNotFound(_0x146cc8,_0x183947){var _0x3ab6df=_0xd336('0x0');var _0x31b323=0x194;var _0x9d54f4={'status':_0x31b323};_0x183947[_0xd336('0x1')](_0x9d54f4[_0xd336('0x1')]);_0x183947[_0xd336('0x2')](_0x3ab6df,{},function(_0xa21198,_0x578a83){if(_0xa21198){return _0x183947['status'](_0x9d54f4[_0xd336('0x1')])[_0xd336('0x3')](_0x9d54f4);}_0x183947[_0xd336('0x4')](_0x578a83);});}; \ No newline at end of file +var _0x347f=['404','render','status','json'];(function(_0x3fba41,_0x39825c){var _0x12e6a2=function(_0x5dda68){while(--_0x5dda68){_0x3fba41['push'](_0x3fba41['shift']());}};_0x12e6a2(++_0x39825c);}(_0x347f,0x1cc));var _0xf347=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x347f[_0x502c7d];return _0x30b7ed;};'use strict';module['exports'][0x194]=function pageNotFound(_0x34502a,_0x1cc3b7){var _0x22d72b=_0xf347('0x0');var _0x505105=0x194;var _0x536614={'status':_0x505105};_0x1cc3b7['status'](_0x536614['status']);_0x1cc3b7[_0xf347('0x1')](_0x22d72b,{},function(_0x478c8a,_0x3f3005){if(_0x478c8a){return _0x1cc3b7['status'](_0x536614[_0xf347('0x2')])[_0xf347('0x3')](_0x536614);}_0x1cc3b7['send'](_0x3f3005);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2f81934..51c2f71 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec56=['../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','ChatGroup','chat_group_has_users','belongsToMany','Contacts','Lists','cm_user_has_lists','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefixes','MailQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','Applications','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','voice_queues_has_cm_blacklists','VoiceMailMessage','mailbox','VoiceCallReport','AgentReports','Contact','ContactId','MailAccountId','Imap','MailServerOut','Smtp','Dispositions','CannedAnswer','Answers','MailMessage','Messages','Interactions','List','ListId','TemplateId','Agents','UserMailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Users','user_has_mail_interactions','Attachments','ChatOfflineMessageId','MailApplication','restrict','Items','FaxAccountId','Exntensions','user_has_fax_accounts','TagId','FaxInteractionId','Tags','fax_interaction_has_tags','ThroughTags','Interaction','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatGroupId','CompanyId','CmCompany','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','whatsapp_interaction_has_tags','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','Field','FieldId','Variable','VariableId','SugarcrmConfiguration','SugarcrmField','Subjects','Description','int_desk_configuration_has_tags','ZohoField','Subject','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','FreshsalesAccount','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','ProjectId','VoiceQueues','team_has_chat_queues','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefix','TeamVoicePrefix','TrunkId','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToQueue','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','username','password','options','database','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0xec56,0x1bd));var _0x6ec5=function(_0x5b52f6,_0x2b6c61){_0x5b52f6=_0x5b52f6-0x0;var _0x3c66cb=_0xec56[_0x5b52f6];return _0x3c66cb;};'use strict';var config=require(_0x6ec5('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x6ec5('0x1'));var timezone=jstz[_0x6ec5('0x2')]();config[_0x6ec5('0x3')]=_[_0x6ec5('0x4')](config[_0x6ec5('0x3')],{'database':_0x6ec5('0x5'),'username':_0x6ec5('0x6'),'password':_0x6ec5('0x7'),'options':{'host':_0x6ec5('0x8'),'port':0xcea,'dialect':_0x6ec5('0x9'),'dialectOptions':{'charset':_0x6ec5('0xa')},'logging':![],'timezone':timezone[_0x6ec5('0xb')](),'define':{'charset':_0x6ec5('0xc'),'collate':_0x6ec5('0xd')}}});config[_0x6ec5('0xe')]=_[_0x6ec5('0x4')](config[_0x6ec5('0xe')],{'database':_0x6ec5('0x5'),'username':_0x6ec5('0x6'),'password':'xC@LL1234','options':{'host':_0x6ec5('0x8'),'port':0xcea,'dialect':_0x6ec5('0x9'),'dialectOptions':{'charset':_0x6ec5('0xa')},'logging':![],'timezone':timezone[_0x6ec5('0xb')](),'define':{'charset':_0x6ec5('0xc'),'collate':_0x6ec5('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6ec5('0x3')]['database'],config[_0x6ec5('0x3')][_0x6ec5('0xf')],config[_0x6ec5('0x3')][_0x6ec5('0x10')],config[_0x6ec5('0x3')][_0x6ec5('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6ec5('0xe')][_0x6ec5('0x12')],config['sequelizeHistory'][_0x6ec5('0xf')],config['sequelizeHistory'][_0x6ec5('0x10')],config[_0x6ec5('0xe')][_0x6ec5('0x11')])};db[_0x6ec5('0x13')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x14'));db[_0x6ec5('0x15')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x17'));db[_0x6ec5('0x18')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x19'));db[_0x6ec5('0x1a')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x1b'));db[_0x6ec5('0x1c')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x1d'));db['VoiceQueue']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x1e'));db[_0x6ec5('0x1f')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x20'));db['ScreenRecording']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x21'));db[_0x6ec5('0x22')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x23'));db['VoiceMailMessage']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x24'));db['VoiceCallReport']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x25'));db[_0x6ec5('0x26')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x27'));db[_0x6ec5('0x28')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x29'));db['VoiceQueueReport']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x2a'));db[_0x6ec5('0x2b')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x2c'));db[_0x6ec5('0x2d')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x2e'));db[_0x6ec5('0x2f')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x30'));db['UserVoiceQueueRt']=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x31'));db[_0x6ec5('0x32')]=db['sequelize']['import'](_0x6ec5('0x33'));db[_0x6ec5('0x34')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x35'));db['UserMailQueue']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x36'));db[_0x6ec5('0x37')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x38'));db[_0x6ec5('0x39')]=db['sequelize'][_0x6ec5('0x16')]('../api/userSmsQueue/userSmsQueue.model');db[_0x6ec5('0x3a')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x3b'));db[_0x6ec5('0x3c')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x3d'));db[_0x6ec5('0x3e')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x3f'));db[_0x6ec5('0x40')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x41'));db[_0x6ec5('0x42')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x43'));db[_0x6ec5('0x44')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x45'));db[_0x6ec5('0x46')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x47'));db['MailMessage']=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x48'));db['MailApplication']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/mailApplication/mailApplication.model');db[_0x6ec5('0x49')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/mailQueueReport/mailQueueReport.model');db[_0x6ec5('0x4a')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x4b'));db[_0x6ec5('0x4c')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x4d'));db[_0x6ec5('0x4e')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x4f'));db[_0x6ec5('0x50')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x51'));db[_0x6ec5('0x52')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/faxInteraction/faxInteraction.model');db[_0x6ec5('0x53')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x54'));db['FaxQueue']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x55'));db[_0x6ec5('0x56')]=db['sequelize']['import'](_0x6ec5('0x57'));db['SmsAccount']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x58'));db[_0x6ec5('0x59')]=db[_0x6ec5('0x3')]['import']('../api/smsApplication/smsApplication.model');db[_0x6ec5('0x5a')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x5b'));db[_0x6ec5('0x5c')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x5d'));db[_0x6ec5('0x5e')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x5f'));db[_0x6ec5('0x60')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x61'));db['OpenchannelApplication']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/openchannelApplication/openchannelApplication.model');db[_0x6ec5('0x62')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x63'));db[_0x6ec5('0x64')]=db['sequelize']['import'](_0x6ec5('0x65'));db['OpenchannelQueue']=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x66'));db[_0x6ec5('0x67')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x68'));db[_0x6ec5('0x69')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x6a'));db[_0x6ec5('0x6b')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x6c'));db[_0x6ec5('0x6d')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x6e'));db['ChatMessage']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/chatMessage/chatMessage.model');db[_0x6ec5('0x6f')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x70'));db[_0x6ec5('0x71')]=db['sequelize']['import'](_0x6ec5('0x72'));db['ChatGroup']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x73'));db[_0x6ec5('0x74')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x75'));db['CmCompany']=db['sequelize']['import'](_0x6ec5('0x76'));db[_0x6ec5('0x77')]=db['sequelize']['import'](_0x6ec5('0x78'));db[_0x6ec5('0x79')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x7a'));db['CmHopperBlack']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x7b'));db[_0x6ec5('0x7c')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x7d'));db[_0x6ec5('0x7e')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x7f'));db[_0x6ec5('0x80')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x81'));db[_0x6ec5('0x82')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x83'));db[_0x6ec5('0x84')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x85'));db['Automation']=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x86'));db['CannedAnswer']=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x87'));db[_0x6ec5('0x88')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/disposition/disposition.model');db[_0x6ec5('0x89')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x8a'));db[_0x6ec5('0x8b')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x8c'));db[_0x6ec5('0x8d')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x8e'));db[_0x6ec5('0x8f')]=db['sequelize']['import'](_0x6ec5('0x90'));db[_0x6ec5('0x91')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x92'));db[_0x6ec5('0x93')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x94'));db[_0x6ec5('0x95')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x96'));db[_0x6ec5('0x97')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/tag/tag.model');db[_0x6ec5('0x98')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x99'));db['Trigger']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x9a'));db['Variable']=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x9b'));db['Integration']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x9c'));db[_0x6ec5('0x9d')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x9e'));db[_0x6ec5('0x9f')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xa0'));db[_0x6ec5('0xa1')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xa2'));db[_0x6ec5('0xa3')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xa4'));db[_0x6ec5('0xa5')]=db['sequelize']['import'](_0x6ec5('0xa6'));db[_0x6ec5('0xa7')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xa8'));db[_0x6ec5('0xa9')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x6ec5('0xaa')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xab'));db[_0x6ec5('0xac')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xad'));db[_0x6ec5('0xae')]=db['sequelize']['import'](_0x6ec5('0xaf'));db[_0x6ec5('0xb0')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xb1'));db['SugarcrmConfiguration']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xb2'));db[_0x6ec5('0xb3')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xb4'));db[_0x6ec5('0xb5')]=db['sequelize']['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x6ec5('0xb6')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xb7'));db[_0x6ec5('0xb8')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/intZohoAccount/intZohoAccount.model');db[_0x6ec5('0xb9')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xba'));db['ZohoField']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/intZohoField/intZohoField.model');db[_0x6ec5('0xbb')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xbc'));db[_0x6ec5('0xbd')]=db[_0x6ec5('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x6ec5('0xbe')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xbf'));db[_0x6ec5('0xc0')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xc1'));db[_0x6ec5('0xc2')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xc3'));db[_0x6ec5('0xc4')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xc5'));db[_0x6ec5('0xc6')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xc7'));db['VtigerConfiguration']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xc8'));db[_0x6ec5('0xc9')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xca'));db['ServicenowAccount']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x6ec5('0xcb')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xcc'));db[_0x6ec5('0xcd')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xce'));db[_0x6ec5('0xcf')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xd0'));db[_0x6ec5('0xd1')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x6ec5('0xd2')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xd3'));db['FreshsalesAccount']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xd4'));db[_0x6ec5('0xd5')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xd6'));db[_0x6ec5('0xd7')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xd8'));db[_0x6ec5('0xd9')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x9c'));db['Network']=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xda'));db['ChatQueueReport']=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xdb'));db[_0x6ec5('0xdc')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xdd'));db[_0x6ec5('0xde')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x6ec5('0xdf')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xe0'));db[_0x6ec5('0xe1')]=db[_0x6ec5('0x3')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xe2'));db[_0x6ec5('0xe3')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0xe4'));db['SquareDetailsReport']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xe5'));db[_0x6ec5('0xe6')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xe7'));db[_0x6ec5('0xe8')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xe9'));db['SquareOdbc']=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xea'));db[_0x6ec5('0xeb')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xec'));db[_0x6ec5('0xed')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xee'));db['SquareMessage']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xef'));db[_0x6ec5('0xf0')]=db['sequelize']['import'](_0x6ec5('0xf1'));db[_0x6ec5('0xf2')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xf3'));db[_0x6ec5('0xf4')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xf5'));db['Migration']=db[_0x6ec5('0x3')]['import']('../api/migration/migration.model');db['Attachment']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xf6'));db['Plugin']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xf7'));db[_0x6ec5('0xf8')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xf9'));db[_0x6ec5('0xfa')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0xfb'));db[_0x6ec5('0xfc')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/faxTransferReport/faxTransferReport.model');db[_0x6ec5('0xfd')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0xfe'));db[_0x6ec5('0xff')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x100'));db[_0x6ec5('0x101')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x102'));db['UserProfile']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x103'));db[_0x6ec5('0x104')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x105'));db['UserProfileResource']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x106'));db[_0x6ec5('0x107')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x108'));db[_0x6ec5('0x109')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x10a'));db[_0x6ec5('0x10b')]=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/whatsappApplication/whatsappApplication.model');db[_0x6ec5('0x10c')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x10d'));db[_0x6ec5('0x10e')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x10f'));db['WhatsappQueueReport']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x110'));db['WhatsappTransferReport']=db[_0x6ec5('0x3')][_0x6ec5('0x16')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x6ec5('0x111')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x112'));db[_0x6ec5('0x113')]=db['sequelize'][_0x6ec5('0x16')](_0x6ec5('0x114'));db[_0x6ec5('0x115')]=db[_0x6ec5('0x3')]['import'](_0x6ec5('0x116'));db['TeamVoicePrefix']=db[_0x6ec5('0x3')][_0x6ec5('0x16')](_0x6ec5('0x117'));db[_0x6ec5('0x118')]=db['sequelize']['import'](_0x6ec5('0x119'));db[_0x6ec5('0x13')][_0x6ec5('0x11a')](db[_0x6ec5('0x22')],{'as':_0x6ec5('0x22'),'onDelete':'cascade','foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x1f')],{'as':_0x6ec5('0x11d'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x11e')],{'as':_0x6ec5('0x11f'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x1a')],{'as':_0x6ec5('0x120'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db['User']['hasMany'](db[_0x6ec5('0x7c')],{'as':_0x6ec5('0x122'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x7e')],{'as':_0x6ec5('0x123'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x80')],{'as':_0x6ec5('0x80'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db['OpenchannelInteraction'],{'as':_0x6ec5('0x124'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x6d')],{'as':_0x6ec5('0x125'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db['SmsInteraction'],{'as':_0x6ec5('0x126'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x13')]['hasMany'](db[_0x6ec5('0x52')],{'as':_0x6ec5('0x127'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x6ec5('0x46')],{'as':_0x6ec5('0x128'),'foreignKey':'UserId'});db[_0x6ec5('0x13')]['hasMany'](db[_0x6ec5('0x10c')],{'as':_0x6ec5('0x129'),'foreignKey':'UserId'});db[_0x6ec5('0x13')][_0x6ec5('0x11c')](db[_0x6ec5('0x107')],{'as':_0x6ec5('0x12a'),'foreignKey':_0x6ec5('0x12b')});db[_0x6ec5('0x13')][_0x6ec5('0x12c')](db[_0x6ec5('0x12d')],{'as':_0x6ec5('0x12d'),'foreignKey':_0x6ec5('0x12e')});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x12f')],{'as':'Groups','through':_0x6ec5('0x130')});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db['CmContact'],{'as':_0x6ec5('0x132'),'through':'cm_user_has_contacts'});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x133'),'through':_0x6ec5('0x134')});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0xf0')],{'through':'user_has_teams'});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x46')],{'as':_0x6ec5('0x128'),'through':'user_has_mail_interactions'});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x6d')],{'as':_0x6ec5('0x125'),'through':'user_has_chat_interactions'});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x52')],{'as':'FaxInteractions','through':_0x6ec5('0x135')});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x5a')],{'as':_0x6ec5('0x126'),'through':_0x6ec5('0x136')});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x62')],{'as':_0x6ec5('0x124'),'through':_0x6ec5('0x137')});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x10c')],{'as':_0x6ec5('0x129'),'through':_0x6ec5('0x138')});db['User']['belongsToMany'](db[_0x6ec5('0x139')],{'as':'VoiceQueues','through':_0x6ec5('0x32'),'required':![]});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db['VoicePrefix'],{'as':_0x6ec5('0x13a'),'through':'UserVoicePrefix','required':![]});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x42')],{'as':_0x6ec5('0x13b'),'through':'UserMailQueue','required':![]});db[_0x6ec5('0x13')]['belongsToMany'](db['ChatQueue'],{'as':'ChatQueues','through':_0x6ec5('0x34'),'required':![],'hooks':!![]});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x13c')],{'as':_0x6ec5('0x13d'),'through':_0x6ec5('0x37'),'required':![]});db['User']['belongsToMany'](db[_0x6ec5('0x5e')],{'as':_0x6ec5('0x13e'),'through':_0x6ec5('0x39'),'required':![]});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x13f')],{'as':_0x6ec5('0x140'),'through':_0x6ec5('0x3a'),'required':![]});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x111')],{'as':_0x6ec5('0x141'),'through':_0x6ec5('0x3c'),'required':![]});db['User']['belongsToMany'](db[_0x6ec5('0x101')],{'through':_0x6ec5('0x134')});db[_0x6ec5('0x13')][_0x6ec5('0x131')](db[_0x6ec5('0x67')],{'as':_0x6ec5('0x142'),'through':_0x6ec5('0x143')});db['User']['belongsToMany'](db['FaxAccount'],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x40')],{'as':_0x6ec5('0x144'),'through':_0x6ec5('0x145')});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x60')],{'as':_0x6ec5('0x146'),'through':_0x6ec5('0x147')});db['User']['belongsToMany'](db[_0x6ec5('0x148')],{'as':_0x6ec5('0x149'),'through':_0x6ec5('0x14a')});db[_0x6ec5('0x13')]['belongsToMany'](db[_0x6ec5('0x109')],{'as':_0x6ec5('0x14b'),'through':_0x6ec5('0x14c')});db[_0x6ec5('0x13')]['belongsToMany'](db['SquareProject'],{'as':'SquareProjects','through':_0x6ec5('0x14d')});db[_0x6ec5('0x15')][_0x6ec5('0x11c')](db[_0x6ec5('0x1a')],{'as':_0x6ec5('0x14e'),'onDelete':_0x6ec5('0x121'),'foreignKey':'ChanSpyId'});db[_0x6ec5('0x18')]['hasMany'](db[_0x6ec5('0x1a')],{'onDelete':_0x6ec5('0x121')});db['VoiceExtension'][_0x6ec5('0x11c')](db[_0x6ec5('0x1a')],{'as':_0x6ec5('0x14f'),'onDelete':_0x6ec5('0x121')});db['VoiceMusicOnHold'][_0x6ec5('0x131')](db[_0x6ec5('0x95')],{'as':'Sounds','through':_0x6ec5('0x150')});db[_0x6ec5('0x139')][_0x6ec5('0x11c')](db[_0x6ec5('0x11e')],{'as':_0x6ec5('0x151'),'foreignKey':'VoiceQueueId'});db[_0x6ec5('0x139')]['hasMany'](db[_0x6ec5('0x79')],{'as':_0x6ec5('0x152'),'foreignKey':'VoiceQueueId'});db[_0x6ec5('0x139')][_0x6ec5('0x11c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x6ec5('0x153')});db[_0x6ec5('0x139')][_0x6ec5('0x11c')](db['CmHopperHistory'],{'as':_0x6ec5('0x154'),'foreignKey':_0x6ec5('0x153')});db[_0x6ec5('0x139')][_0x6ec5('0x11c')](db[_0x6ec5('0x80')],{'as':_0x6ec5('0x80'),'foreignKey':_0x6ec5('0x153')});db[_0x6ec5('0x139')][_0x6ec5('0x11c')](db[_0x6ec5('0x155')],{'as':_0x6ec5('0x156'),'foreignKey':_0x6ec5('0x153')});db[_0x6ec5('0x139')][_0x6ec5('0x11c')](db[_0x6ec5('0xe1')],{'as':_0x6ec5('0x157'),'foreignKey':_0x6ec5('0x153')});db[_0x6ec5('0x139')][_0x6ec5('0x12c')](db[_0x6ec5('0x2d')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x6ec5('0x139')][_0x6ec5('0x12c')](db[_0x6ec5('0x2d')],{'as':'TrunkBackup','foreignKey':_0x6ec5('0x158')});db[_0x6ec5('0x139')][_0x6ec5('0x12c')](db[_0x6ec5('0x8b')],{'as':_0x6ec5('0x8b'),'foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x139')][_0x6ec5('0x12c')](db[_0x6ec5('0x8d')],{'as':_0x6ec5('0x15a'),'foreignKey':_0x6ec5('0x15b')});db['VoiceQueue'][_0x6ec5('0x131')](db['CmList'],{'as':_0x6ec5('0x133'),'through':'voice_queues_has_cm_lists'});db[_0x6ec5('0x139')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':'Agents','through':_0x6ec5('0x32')});db['VoiceQueue'][_0x6ec5('0x131')](db[_0x6ec5('0xf0')],{'as':_0x6ec5('0x15c'),'through':'TeamVoiceQueue'});db[_0x6ec5('0x139')][_0x6ec5('0x131')](db[_0x6ec5('0x101')],{'as':'BlackLists','through':_0x6ec5('0x15d')});db[_0x6ec5('0x1f')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x13'),'foreignKey':_0x6ec5('0x11b')});db['ScreenRecording'][_0x6ec5('0x12c')](db['User'],{'as':_0x6ec5('0x13'),'foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x22')][_0x6ec5('0x11c')](db[_0x6ec5('0x15e')],{'as':'Messages','onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x6ec5('0x15e')]['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x6ec5('0x15f')});db[_0x6ec5('0x160')][_0x6ec5('0x11c')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x6ec5('0x160')]['hasMany'](db[_0x6ec5('0x28')],{'as':_0x6ec5('0x161'),'foreignKey':'uniqueid','constraints':![]});db[_0x6ec5('0x160')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x13'),'foreignKey':_0x6ec5('0x11b')});db['VoiceCallReport'][_0x6ec5('0x12c')](db['CmContact'],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db['MailServerIn'][_0x6ec5('0x12c')](db[_0x6ec5('0x40')],{'as':_0x6ec5('0x40'),'foreignKey':_0x6ec5('0x164')});db['MailServerOut'][_0x6ec5('0x12c')](db['MailAccount'],{'as':_0x6ec5('0x40'),'foreignKey':_0x6ec5('0x164')});db[_0x6ec5('0x40')][_0x6ec5('0x11a')](db[_0x6ec5('0x3e')],{'as':_0x6ec5('0x165'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x40')][_0x6ec5('0x11a')](db[_0x6ec5('0x166')],{'as':_0x6ec5('0x167'),'onDelete':'cascade'});db['MailAccount'][_0x6ec5('0x11c')](db[_0x6ec5('0x88')],{'as':_0x6ec5('0x168'),'foreignKey':_0x6ec5('0x164'),'onDelete':'cascade'});db[_0x6ec5('0x40')][_0x6ec5('0x11c')](db[_0x6ec5('0x169')],{'as':_0x6ec5('0x16a'),'foreignKey':_0x6ec5('0x164')});db['MailAccount']['hasMany'](db[_0x6ec5('0x16b')],{'as':_0x6ec5('0x16c'),'foreignKey':'MailAccountId'});db[_0x6ec5('0x40')][_0x6ec5('0x11c')](db['MailInteraction'],{'as':_0x6ec5('0x16d')});db[_0x6ec5('0x40')][_0x6ec5('0x11c')](db['MailApplication'],{'as':'Applications'});db[_0x6ec5('0x40')][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f')});db['MailAccount'][_0x6ec5('0x12c')](db[_0x6ec5('0x98')],{'as':_0x6ec5('0x98'),'foreignKey':_0x6ec5('0x170')});db[_0x6ec5('0x40')][_0x6ec5('0x12c')](db[_0x6ec5('0x8d')],{'as':_0x6ec5('0x15a'),'foreignKey':_0x6ec5('0x15b')});db[_0x6ec5('0x40')]['belongsToMany'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x145')});db['MailQueue'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x172')});db[_0x6ec5('0x42')][_0x6ec5('0x131')](db[_0x6ec5('0xf0')],{'through':_0x6ec5('0x173'),'as':_0x6ec5('0x15c')});db[_0x6ec5('0x46')][_0x6ec5('0x11c')](db['MailMessage'],{'as':_0x6ec5('0x16c'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x174')});db[_0x6ec5('0x46')][_0x6ec5('0x12c')](db['MailAccount'],{'as':_0x6ec5('0x175'),'foreignKey':'MailAccountId'});db[_0x6ec5('0x46')]['belongsTo'](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x46')][_0x6ec5('0x12c')](db['User'],{'as':_0x6ec5('0x176'),'foreignKey':'UserId'});db['MailInteraction'][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x177'),'as':'Tags'});db[_0x6ec5('0x46')][_0x6ec5('0x131')](db['Tag'],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db['MailInteraction'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':_0x6ec5('0x179'),'foreignKey':_0x6ec5('0x174')});db['MailMessage'][_0x6ec5('0x11c')](db['Attachment'],{'as':_0x6ec5('0x17a'),'onDelete':'cascade'});db['MailMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':'User'});db[_0x6ec5('0x16b')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'onDelete':_0x6ec5('0x121'),'as':'Contact'});db[_0x6ec5('0x16b')][_0x6ec5('0x12c')](db[_0x6ec5('0x46')],{'as':'Interaction','foreignKey':_0x6ec5('0x174')});db[_0x6ec5('0x16b')]['belongsTo'](db[_0x6ec5('0x40')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x6ec5('0x16b')][_0x6ec5('0x12c')](db[_0x6ec5('0x67')],{'as':_0x6ec5('0x67'),'foreignKey':'ChatWebsiteId'});db[_0x6ec5('0x16b')][_0x6ec5('0x12c')](db['ChatOfflineMessage'],{'as':_0x6ec5('0x6f'),'foreignKey':_0x6ec5('0x17b')});db[_0x6ec5('0x17c')][_0x6ec5('0x12c')](db['User'],{'onDelete':_0x6ec5('0x17d')});db['MailApplication'][_0x6ec5('0x12c')](db['MailQueue'],{'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x17c')][_0x6ec5('0x12c')](db[_0x6ec5('0x40')],{'onDelete':_0x6ec5('0x17d')});db['MailApplication'][_0x6ec5('0x12c')](db[_0x6ec5('0x8b')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x17c')][_0x6ec5('0x12c')](db[_0x6ec5('0x97')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':'TagId'});db['MailQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x40')],{});db['MailQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x49')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':'Contact','foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x49')][_0x6ec5('0x12c')](db[_0x6ec5('0x46')],{});db['MailQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x16b')],{});db[_0x6ec5('0x49')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{});db['MailQueueReport']['belongsTo'](db[_0x6ec5('0x42')],{});db[_0x6ec5('0x4a')]['hasMany'](db['DashboardItem'],{'as':_0x6ec5('0x17e'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x4e')][_0x6ec5('0x11c')](db['Disposition'],{'as':_0x6ec5('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x4e')]['hasMany'](db[_0x6ec5('0x169')],{'as':_0x6ec5('0x16a'),'foreignKey':_0x6ec5('0x17f')});db[_0x6ec5('0x4e')][_0x6ec5('0x11c')](db['FaxInteraction'],{'as':'Interactions'});db[_0x6ec5('0x4e')][_0x6ec5('0x11c')](db[_0x6ec5('0x50')],{'as':_0x6ec5('0x14f')});db[_0x6ec5('0x4e')][_0x6ec5('0x11c')](db[_0x6ec5('0x1a')],{'as':_0x6ec5('0x180'),'onDelete':'cascade'});db[_0x6ec5('0x4e')][_0x6ec5('0x11c')](db[_0x6ec5('0x53')],{'as':_0x6ec5('0x16c')});db['FaxAccount'][_0x6ec5('0x12c')](db['Trunk'],{'as':_0x6ec5('0x2d')});db[_0x6ec5('0x4e')][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':'List','foreignKey':_0x6ec5('0x16f')});db['FaxAccount']['belongsTo'](db[_0x6ec5('0x8d')],{'as':_0x6ec5('0x15a'),'foreignKey':_0x6ec5('0x15b')});db[_0x6ec5('0x4e')]['belongsToMany'](db['User'],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x181')});db[_0x6ec5('0x50')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x50')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x50')][_0x6ec5('0x12c')](db[_0x6ec5('0x4e')],{'onDelete':_0x6ec5('0x17d')});db['FaxApplication'][_0x6ec5('0x12c')](db[_0x6ec5('0x97')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x182')});db[_0x6ec5('0x52')][_0x6ec5('0x11c')](db[_0x6ec5('0x53')],{'as':_0x6ec5('0x16c'),'onDelete':'cascade','foreignKey':_0x6ec5('0x183')});db[_0x6ec5('0x52')][_0x6ec5('0x12c')](db[_0x6ec5('0x4e')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x17f')});db[_0x6ec5('0x52')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db['FaxInteraction']['belongsTo'](db[_0x6ec5('0x13')],{'as':'Owner','foreignKey':_0x6ec5('0x11b')});db[_0x6ec5('0x52')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x6ec5('0x184')});db[_0x6ec5('0x52')][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x185'),'as':_0x6ec5('0x186')});db[_0x6ec5('0x52')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':'user_has_fax_interactions','foreignKey':_0x6ec5('0x183')});db['FaxMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x13')});db[_0x6ec5('0x53')][_0x6ec5('0x12c')](db['FaxInteraction'],{'as':_0x6ec5('0x187'),'foreignKey':_0x6ec5('0x183')});db['FaxMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x162')});db[_0x6ec5('0x53')][_0x6ec5('0x12c')](db[_0x6ec5('0x188')],{'as':_0x6ec5('0x188'),'foreignKey':_0x6ec5('0x189')});db[_0x6ec5('0x53')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x6ec5('0x17f')});db['FaxQueue'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':'Agents','through':_0x6ec5('0x37')});db['FaxQueue'][_0x6ec5('0x131')](db[_0x6ec5('0xf0')],{'through':_0x6ec5('0x18a'),'as':_0x6ec5('0x15c')});db[_0x6ec5('0x56')]['belongsTo'](db[_0x6ec5('0x4e')],{});db['FaxQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':'ListId'});db[_0x6ec5('0x56')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':'ContactId'});db[_0x6ec5('0x56')]['belongsTo'](db['FaxInteraction'],{});db[_0x6ec5('0x56')]['belongsTo'](db[_0x6ec5('0x53')],{});db[_0x6ec5('0x56')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{});db[_0x6ec5('0x56')][_0x6ec5('0x12c')](db[_0x6ec5('0x13c')],{});db['SmsAccount'][_0x6ec5('0x11c')](db['Disposition'],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x148')]['hasMany'](db['CannedAnswer'],{'as':_0x6ec5('0x16a'),'foreignKey':_0x6ec5('0x18b')});db[_0x6ec5('0x148')][_0x6ec5('0x11c')](db['SmsMessage'],{'as':_0x6ec5('0x16c'),'foreignKey':_0x6ec5('0x18b')});db[_0x6ec5('0x148')]['hasMany'](db['SmsInteraction'],{'as':'Interactions'});db[_0x6ec5('0x148')][_0x6ec5('0x11c')](db['SmsApplication'],{'as':_0x6ec5('0x14f')});db[_0x6ec5('0x148')][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':'ListId'});db[_0x6ec5('0x148')]['belongsTo'](db['Pause'],{'as':_0x6ec5('0x15a'),'foreignKey':_0x6ec5('0x15b')});db['SmsAccount'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x14a')});db[_0x6ec5('0x59')][_0x6ec5('0x12c')](db['User'],{'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x59')][_0x6ec5('0x12c')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x6ec5('0x59')]['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db[_0x6ec5('0x59')][_0x6ec5('0x12c')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x6ec5('0x159')});db['SmsApplication'][_0x6ec5('0x12c')](db['Tag'],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x182')});db[_0x6ec5('0x5a')][_0x6ec5('0x11c')](db[_0x6ec5('0x5c')],{'as':_0x6ec5('0x16c'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x6ec5('0x5a')][_0x6ec5('0x12c')](db[_0x6ec5('0x148')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x18b')});db[_0x6ec5('0x5a')]['belongsTo'](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':'ContactId'});db[_0x6ec5('0x5a')]['belongsTo'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x176'),'foreignKey':'UserId'});db[_0x6ec5('0x5a')][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x18c'),'as':'Tags'});db[_0x6ec5('0x5a')][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x18c'),'as':_0x6ec5('0x186')});db[_0x6ec5('0x5a')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':_0x6ec5('0x136'),'foreignKey':_0x6ec5('0x18d')});db[_0x6ec5('0x5c')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x13')});db['SmsMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'onDelete':_0x6ec5('0x121'),'as':'Contact'});db[_0x6ec5('0x5c')][_0x6ec5('0x12c')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x6ec5('0x187'),'foreignKey':_0x6ec5('0x18d')});db[_0x6ec5('0x5c')]['belongsTo'](db[_0x6ec5('0x148')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x18b')});db['SmsQueue'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x39'),'foreignKey':_0x6ec5('0x18e')});db['SmsQueue'][_0x6ec5('0x131')](db[_0x6ec5('0xf0')],{'through':'team_has_sms_queues','as':_0x6ec5('0x15c')});db['OpenchannelAccount']['hasMany'](db[_0x6ec5('0x88')],{'as':_0x6ec5('0x168'),'foreignKey':_0x6ec5('0x18f'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x60')][_0x6ec5('0x11c')](db[_0x6ec5('0x169')],{'as':_0x6ec5('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x6ec5('0x11c')](db['OpenchannelInteraction'],{'as':_0x6ec5('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0x6ec5('0x60')][_0x6ec5('0x11c')](db['OpenchannelMessage'],{'as':_0x6ec5('0x16c'),'foreignKey':_0x6ec5('0x18f')});db['OpenchannelAccount'][_0x6ec5('0x11c')](db['OpenchannelApplication'],{'as':_0x6ec5('0x14f'),'foreignKey':_0x6ec5('0x18f')});db[_0x6ec5('0x60')][_0x6ec5('0x12c')](db['CmList'],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f')});db['OpenchannelAccount'][_0x6ec5('0x12c')](db[_0x6ec5('0x8d')],{'as':_0x6ec5('0x15a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6ec5('0x60')]['belongsToMany'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x6ec5('0x12c')](db[_0x6ec5('0x13f')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':'OpenchannelQueueId'});db[_0x6ec5('0x190')][_0x6ec5('0x12c')](db[_0x6ec5('0x60')],{'onDelete':'restrict','foreignKey':_0x6ec5('0x18f')});db[_0x6ec5('0x190')][_0x6ec5('0x12c')](db[_0x6ec5('0x8b')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x190')][_0x6ec5('0x12c')](db[_0x6ec5('0x97')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x182')});db[_0x6ec5('0x62')][_0x6ec5('0x11c')](db[_0x6ec5('0x64')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x6ec5('0x62')]['belongsTo'](db[_0x6ec5('0x60')],{'as':'Account','foreignKey':_0x6ec5('0x18f')});db[_0x6ec5('0x62')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x62')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x176'),'foreignKey':'UserId'});db[_0x6ec5('0x62')]['belongsToMany'](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x191'),'as':_0x6ec5('0x184')});db[_0x6ec5('0x62')][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x191'),'as':_0x6ec5('0x186')});db['OpenchannelInteraction'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':'user_has_openchannel_interactions','foreignKey':_0x6ec5('0x192')});db[_0x6ec5('0x64')]['belongsTo'](db['User'],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x13')});db['OpenchannelMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'onDelete':'cascade','as':_0x6ec5('0x162')});db['OpenchannelMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x62')],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x187'),'foreignKey':_0x6ec5('0x192')});db[_0x6ec5('0x64')][_0x6ec5('0x12c')](db[_0x6ec5('0x188')],{'as':_0x6ec5('0x188'),'foreignKey':_0x6ec5('0x189')});db[_0x6ec5('0x64')][_0x6ec5('0x12c')](db[_0x6ec5('0x60')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x18f')});db[_0x6ec5('0x13f')]['belongsToMany'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':'UserOpenchannelQueue','foreignKey':_0x6ec5('0x193')});db[_0x6ec5('0x13f')][_0x6ec5('0x131')](db[_0x6ec5('0xf0')],{'through':_0x6ec5('0x194'),'as':_0x6ec5('0x15c')});db[_0x6ec5('0x67')]['hasMany'](db[_0x6ec5('0x88')],{'as':'Dispositions','foreignKey':_0x6ec5('0x195'),'onDelete':'cascade'});db[_0x6ec5('0x67')]['hasMany'](db[_0x6ec5('0x169')],{'as':_0x6ec5('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0x6ec5('0x67')][_0x6ec5('0x11c')](db[_0x6ec5('0x74')],{'as':_0x6ec5('0x196')});db[_0x6ec5('0x67')][_0x6ec5('0x11c')](db[_0x6ec5('0x6d')],{'as':'Interactions'});db['ChatWebsite'][_0x6ec5('0x11c')](db[_0x6ec5('0x6b')],{'as':_0x6ec5('0x14f')});db['ChatWebsite'][_0x6ec5('0x11c')](db[_0x6ec5('0x197')],{'as':_0x6ec5('0x16c')});db[_0x6ec5('0x67')][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x67')][_0x6ec5('0x12c')](db[_0x6ec5('0x8b')],{'as':_0x6ec5('0x8b'),'foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x67')][_0x6ec5('0x12c')](db[_0x6ec5('0x40')],{'as':_0x6ec5('0x40'),'foreignKey':'MailAccountId'});db[_0x6ec5('0x67')][_0x6ec5('0x12c')](db[_0x6ec5('0x8d')],{'as':_0x6ec5('0x15a'),'foreignKey':_0x6ec5('0x15b')});db[_0x6ec5('0x67')]['belongsToMany'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x143')});db[_0x6ec5('0x69')]['belongsTo'](db[_0x6ec5('0x60')],{});db[_0x6ec5('0x69')][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x69')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x69')][_0x6ec5('0x12c')](db['OpenchannelInteraction'],{});db[_0x6ec5('0x69')][_0x6ec5('0x12c')](db[_0x6ec5('0x64')],{});db[_0x6ec5('0x69')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{});db['OpenchannelQueueReport'][_0x6ec5('0x12c')](db['OpenchannelQueue'],{});db['ChatApplication']['belongsTo'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x198'),'foreignKey':_0x6ec5('0x11b'),'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x6b')][_0x6ec5('0x12c')](db[_0x6ec5('0x71')],{'as':_0x6ec5('0x199'),'foreignKey':_0x6ec5('0x19a'),'onDelete':'restrict'});db['ChatApplication'][_0x6ec5('0x12c')](db['ChatWebsite'],{'as':_0x6ec5('0x19b'),'foreignKey':_0x6ec5('0x195'),'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x6b')][_0x6ec5('0x12c')](db[_0x6ec5('0x97')],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x182')});db['ChatInteraction']['hasMany'](db[_0x6ec5('0x197')],{'as':_0x6ec5('0x16c'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x19c')});db[_0x6ec5('0x6d')]['belongsTo'](db[_0x6ec5('0x67')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x195')});db[_0x6ec5('0x6d')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x176'),'foreignKey':'UserId'});db[_0x6ec5('0x6d')][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x19d'),'as':_0x6ec5('0x184')});db['ChatInteraction'][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x19d'),'as':_0x6ec5('0x186')});db[_0x6ec5('0x6d')]['belongsToMany'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':_0x6ec5('0x19e'),'foreignKey':'ChatInteractionId'});db[_0x6ec5('0x197')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'onDelete':_0x6ec5('0x121'),'as':'User'});db[_0x6ec5('0x197')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x197')][_0x6ec5('0x12c')](db[_0x6ec5('0x6d')],{'onDelete':_0x6ec5('0x121'),'as':'Interaction','foreignKey':_0x6ec5('0x19c')});db[_0x6ec5('0x197')][_0x6ec5('0x12c')](db[_0x6ec5('0x188')],{'as':_0x6ec5('0x188'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x67')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x195')});db[_0x6ec5('0x6f')][_0x6ec5('0x11c')](db['Attachment'],{'as':_0x6ec5('0x17a'),'foreignKey':_0x6ec5('0x17b'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db[_0x6ec5('0x6f')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x6f')][_0x6ec5('0x12c')](db[_0x6ec5('0x67')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x195')});db['ChatQueue'][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x34'),'hooks':!![]});db['ChatQueue'][_0x6ec5('0x131')](db['Team'],{'through':'team_has_chat_queues','as':'Teams'});db[_0x6ec5('0x12f')][_0x6ec5('0x11c')](db['ChatInternalMessage'],{'as':_0x6ec5('0x16c'),'foreignKey':_0x6ec5('0x19f'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x12f')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x151'),'through':_0x6ec5('0x130')});db['ChatProactiveAction'][_0x6ec5('0x12c')](db[_0x6ec5('0x67')],{'as':_0x6ec5('0x19b'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x6ec5('0x11c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x132'),'foreignKey':_0x6ec5('0x1a0')});db[_0x6ec5('0x77')]['hasMany'](db['CmHopper'],{'as':_0x6ec5('0x152'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x77')][_0x6ec5('0x11c')](db[_0x6ec5('0x7c')],{'as':_0x6ec5('0x122'),'foreignKey':'ContactId'});db[_0x6ec5('0x77')][_0x6ec5('0x11c')](db['CmHopperHistory'],{'as':_0x6ec5('0x154'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x77')][_0x6ec5('0x11c')](db[_0x6ec5('0x80')],{'as':_0x6ec5('0x80'),'foreignKey':_0x6ec5('0x163')});db['CmContact']['hasMany'](db[_0x6ec5('0xe1')],{'as':'JscriptySessions','foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x77')][_0x6ec5('0x11c')](db[_0x6ec5('0x62')],{'as':_0x6ec5('0x124'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x6ec5('0x77')][_0x6ec5('0x11c')](db['ChatInteraction'],{'as':_0x6ec5('0x125'),'foreignKey':_0x6ec5('0x163'),'onDelete':_0x6ec5('0x17d')});db['CmContact'][_0x6ec5('0x11c')](db[_0x6ec5('0x5a')],{'as':_0x6ec5('0x126'),'foreignKey':_0x6ec5('0x163'),'onDelete':_0x6ec5('0x17d')});db['CmContact'][_0x6ec5('0x11c')](db[_0x6ec5('0x52')],{'as':_0x6ec5('0x127'),'foreignKey':_0x6ec5('0x163'),'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x77')][_0x6ec5('0x11c')](db[_0x6ec5('0x46')],{'as':_0x6ec5('0x128'),'foreignKey':_0x6ec5('0x163'),'onDelete':'restrict'});db[_0x6ec5('0x77')][_0x6ec5('0x12c')](db[_0x6ec5('0x1a1')],{'as':_0x6ec5('0x1a2'),'foreignKey':_0x6ec5('0x1a0')});db[_0x6ec5('0x77')][_0x6ec5('0x12c')](db['CmList'],{'as':_0x6ec5('0x16e'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x6ec5('0x77')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':_0x6ec5('0x1a3')});db[_0x6ec5('0x77')][_0x6ec5('0x131')](db['Tag'],{'as':'Tags','through':_0x6ec5('0x1a4')});db['CmContact'][_0x6ec5('0x131')](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x1a4'),'as':_0x6ec5('0x186')});db[_0x6ec5('0x79')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':'ContactId','onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x79')]['belongsTo'](db[_0x6ec5('0x101')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x6ec5('0x79')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x198'),'foreignKey':'UserId'});db[_0x6ec5('0x79')][_0x6ec5('0x12c')](db[_0x6ec5('0x139')],{'as':'Queue','foreignKey':_0x6ec5('0x153'),'onDelete':'cascade'});db[_0x6ec5('0x79')][_0x6ec5('0x12c')](db[_0x6ec5('0xf4')],{'as':_0x6ec5('0xf4'),'foreignKey':_0x6ec5('0x1a5'),'onDelete':_0x6ec5('0x121')});db['CmHopper']['belongsTo'](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x176'),'foreignKey':_0x6ec5('0x1a6')});db[_0x6ec5('0x155')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x155')][_0x6ec5('0x12c')](db['CmList'],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x155')][_0x6ec5('0x12c')](db[_0x6ec5('0x139')],{'as':_0x6ec5('0x199'),'foreignKey':_0x6ec5('0x153'),'onDelete':'cascade'});db[_0x6ec5('0x155')][_0x6ec5('0x12c')](db['Campaign'],{'as':_0x6ec5('0xf4'),'foreignKey':_0x6ec5('0x1a5'),'onDelete':'cascade'});db[_0x6ec5('0x1a7')][_0x6ec5('0x11c')](db[_0x6ec5('0x89')],{'as':{'plural':_0x6ec5('0x1a8'),'singular':_0x6ec5('0x1a9')},'foreignKey':_0x6ec5('0x1aa'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db[_0x6ec5('0x1a7')][_0x6ec5('0x11c')](db[_0x6ec5('0x89')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x6ec5('0x121'),'hooks':!![]});db[_0x6ec5('0x1a7')][_0x6ec5('0x11c')](db[_0x6ec5('0x84')],{'as':_0x6ec5('0x1ab'),'foreignKey':_0x6ec5('0x1ac'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db['Disposition'][_0x6ec5('0x11c')](db[_0x6ec5('0x88')],{'as':'Dispositions','foreignKey':_0x6ec5('0x1ad'),'onDelete':_0x6ec5('0x121')});db['Interval'][_0x6ec5('0x11c')](db[_0x6ec5('0x8b')],{'as':_0x6ec5('0x1ae'),'foreignKey':_0x6ec5('0x159'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x6ec5('0x8b')][_0x6ec5('0x11c')](db[_0x6ec5('0x1a')],{'as':_0x6ec5('0x120'),'foreignKey':'IntervalId','onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x8b')][_0x6ec5('0x11c')](db[_0x6ec5('0x17c')],{'as':_0x6ec5('0x1af'),'foreignKey':'IntervalId'});db[_0x6ec5('0x8b')][_0x6ec5('0x11c')](db[_0x6ec5('0x6b')],{'as':_0x6ec5('0x1b0'),'foreignKey':'IntervalId'});db[_0x6ec5('0x8b')][_0x6ec5('0x11c')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x8b')][_0x6ec5('0x11c')](db[_0x6ec5('0x59')],{'as':_0x6ec5('0x1b1'),'foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x93')][_0x6ec5('0x12c')](db['MailAccount'],{});db[_0x6ec5('0x93')][_0x6ec5('0x12c')](db[_0x6ec5('0xa1')],{'foreignKey':_0x6ec5('0x1b2')});db[_0x6ec5('0x93')][_0x6ec5('0x12c')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x6ec5('0x95')]['belongsToMany'](db[_0x6ec5('0x1c')],{'as':'Mohs','through':_0x6ec5('0x150'),'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x97')][_0x6ec5('0x131')](db[_0x6ec5('0x77')],{'through':_0x6ec5('0x1a4')});db[_0x6ec5('0x97')][_0x6ec5('0x131')](db[_0x6ec5('0x6d')],{'through':'chat_interaction_has_tags'});db[_0x6ec5('0x97')]['belongsToMany'](db['MailInteraction'],{'through':_0x6ec5('0x177')});db[_0x6ec5('0x97')][_0x6ec5('0x131')](db[_0x6ec5('0x5a')],{'through':'sms_interaction_has_tags'});db[_0x6ec5('0x97')][_0x6ec5('0x131')](db[_0x6ec5('0x52')],{'through':'fax_interaction_has_tags'});db[_0x6ec5('0x97')][_0x6ec5('0x131')](db['OpenchannelInteraction'],{'through':_0x6ec5('0x191')});db[_0x6ec5('0x97')][_0x6ec5('0x131')](db[_0x6ec5('0x10c')],{'through':_0x6ec5('0x1b3')});db[_0x6ec5('0x1b4')][_0x6ec5('0x11c')](db[_0x6ec5('0x89')],{'as':{'plural':'AllConditions','singular':_0x6ec5('0x1b5')},'foreignKey':_0x6ec5('0x1b6'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db['Trigger'][_0x6ec5('0x11c')](db[_0x6ec5('0x89')],{'as':{'plural':_0x6ec5('0x1b7'),'singular':_0x6ec5('0x1b8')},'foreignKey':_0x6ec5('0x1b9'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db[_0x6ec5('0x1b4')]['hasMany'](db['Action'],{'as':_0x6ec5('0x1ab'),'foreignKey':_0x6ec5('0x1ba'),'onDelete':_0x6ec5('0x121'),'hooks':!![]});db[_0x6ec5('0x9f')]['hasMany'](db[_0x6ec5('0xa7')],{'as':_0x6ec5('0x1bb'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bc'),'hooks':!![]});db[_0x6ec5('0xa1')][_0x6ec5('0x11c')](db[_0x6ec5('0xa7')],{'as':_0x6ec5('0x1bb'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1b2')});db['AnalyticMetric'][_0x6ec5('0x11c')](db[_0x6ec5('0xa7')],{'as':_0x6ec5('0x1bb'),'onDelete':'cascade','foreignKey':_0x6ec5('0x1bd')});db[_0x6ec5('0xa7')][_0x6ec5('0x12c')](db[_0x6ec5('0xa5')],{'foreignKey':_0x6ec5('0x1bd')});db['SalesforceAccount']['hasMany'](db[_0x6ec5('0xac')],{'as':_0x6ec5('0x1be'),'onDelete':'cascade','foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xac')][_0x6ec5('0x11c')](db[_0x6ec5('0xae')],{'as':'Subjects','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xac')][_0x6ec5('0x11c')](db[_0x6ec5('0xae')],{'as':_0x6ec5('0x1c1'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xac')][_0x6ec5('0x11c')](db[_0x6ec5('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x6ec5('0xac')][_0x6ec5('0x12c')](db[_0x6ec5('0xaa')],{'as':'Account','foreignKey':'AccountId'});db[_0x6ec5('0xae')]['hasMany'](db[_0x6ec5('0xae')],{'as':'Subject','foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xae')][_0x6ec5('0x11c')](db[_0x6ec5('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x6ec5('0xae')][_0x6ec5('0x11c')](db[_0x6ec5('0xae')],{'as':_0x6ec5('0x1c3'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xae')][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':_0x6ec5('0x1c5'),'foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0xb0')][_0x6ec5('0x11c')](db[_0x6ec5('0x1c7')],{'as':_0x6ec5('0x1be'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db['SugarcrmConfiguration'][_0x6ec5('0x11c')](db[_0x6ec5('0x1c8')],{'as':_0x6ec5('0x1c9'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0x1c7')][_0x6ec5('0x11c')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0x1c7')][_0x6ec5('0x11c')](db[_0x6ec5('0x1c8')],{'as':_0x6ec5('0x1bb'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0x1c7')][_0x6ec5('0x12c')](db['SugarcrmAccount'],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0x1c8')][_0x6ec5('0x11c')](db[_0x6ec5('0x1c8')],{'as':'Subject','foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0x1c8')][_0x6ec5('0x11c')](db[_0x6ec5('0x1c8')],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0x1c8')][_0x6ec5('0x11c')](db[_0x6ec5('0x1c8')],{'as':_0x6ec5('0x1c3'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0x1c8')][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':_0x6ec5('0x1c5'),'foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0xb3')][_0x6ec5('0x11c')](db[_0x6ec5('0xb5')],{'as':_0x6ec5('0x1be'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xb5')][_0x6ec5('0x11c')](db[_0x6ec5('0xb6')],{'as':_0x6ec5('0x1c9'),'onDelete':_0x6ec5('0x121'),'foreignKey':'SubjectId'});db[_0x6ec5('0xb5')][_0x6ec5('0x11c')](db[_0x6ec5('0xb6')],{'as':_0x6ec5('0x1c1'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c2')});db['DeskConfiguration']['hasMany'](db[_0x6ec5('0xb6')],{'as':_0x6ec5('0x1bb'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xb5')][_0x6ec5('0x12c')](db[_0x6ec5('0xb3')],{'as':_0x6ec5('0x175'),'foreignKey':'AccountId'});db[_0x6ec5('0xb5')]['belongsToMany'](db['Tag'],{'through':_0x6ec5('0x1cb')});db[_0x6ec5('0xb6')][_0x6ec5('0x11c')](db[_0x6ec5('0xb6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x6ec5('0xb6')]['hasMany'](db[_0x6ec5('0xb6')],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xb6')][_0x6ec5('0x11c')](db[_0x6ec5('0xb6')],{'as':_0x6ec5('0x1c3'),'foreignKey':_0x6ec5('0x1c4')});db['DeskField'][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':_0x6ec5('0x1c5'),'foreignKey':'VariableId'});db[_0x6ec5('0xb8')][_0x6ec5('0x11c')](db[_0x6ec5('0xb9')],{'as':_0x6ec5('0x1be'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Subjects','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xb9')][_0x6ec5('0x11c')](db[_0x6ec5('0x1cc')],{'as':_0x6ec5('0x1c1'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xb9')][_0x6ec5('0x11c')](db['ZohoField'],{'as':'Fields','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xb9')]['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0x1cc')][_0x6ec5('0x11c')](db[_0x6ec5('0x1cc')],{'as':_0x6ec5('0x1cd'),'foreignKey':'SubjectId'});db['ZohoField'][_0x6ec5('0x11c')](db['ZohoField'],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db['ZohoField'][_0x6ec5('0x11c')](db['ZohoField'],{'as':_0x6ec5('0x1c3'),'foreignKey':'FieldId'});db['ZohoField']['belongsTo'](db[_0x6ec5('0x1c5')],{'as':_0x6ec5('0x1c5'),'foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0xbb')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x6ec5('0x1be'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xbd')][_0x6ec5('0x11c')](db[_0x6ec5('0xbe')],{'as':_0x6ec5('0x1c9'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xbd')][_0x6ec5('0x11c')](db[_0x6ec5('0xbe')],{'as':_0x6ec5('0x1c1'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xbd')][_0x6ec5('0x11c')](db[_0x6ec5('0xbe')],{'as':_0x6ec5('0x1bb'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xbd')][_0x6ec5('0x12c')](db[_0x6ec5('0xbb')],{'as':'Account','foreignKey':'AccountId'});db[_0x6ec5('0xbd')]['belongsToMany'](db[_0x6ec5('0x97')],{'through':'int_zendesk_configuration_has_tags'});db[_0x6ec5('0xbe')][_0x6ec5('0x11c')](db[_0x6ec5('0xbe')],{'as':_0x6ec5('0x1cd'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xbe')][_0x6ec5('0x11c')](db['ZendeskField'],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xbe')][_0x6ec5('0x11c')](db['ZendeskField'],{'as':_0x6ec5('0x1c3'),'foreignKey':_0x6ec5('0x1c4')});db['ZendeskField'][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':'Variable','foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0xc0')][_0x6ec5('0x11c')](db[_0x6ec5('0xc2')],{'as':'Configurations','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xc2')]['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xc2')]['hasMany'](db[_0x6ec5('0xc4')],{'as':_0x6ec5('0x1c1'),'onDelete':_0x6ec5('0x121'),'foreignKey':'DescriptionId'});db[_0x6ec5('0xc2')][_0x6ec5('0x11c')](db[_0x6ec5('0xc4')],{'as':'Fields','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xc2')][_0x6ec5('0x12c')](db[_0x6ec5('0xc0')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xc2')]['belongsToMany'](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x1ce')});db[_0x6ec5('0xc4')][_0x6ec5('0x11c')](db[_0x6ec5('0xc4')],{'as':_0x6ec5('0x1cd'),'foreignKey':_0x6ec5('0x1c0')});db['FreshdeskField'][_0x6ec5('0x11c')](db[_0x6ec5('0xc4')],{'as':_0x6ec5('0x1ca'),'foreignKey':'DescriptionId'});db[_0x6ec5('0xc4')]['hasMany'](db[_0x6ec5('0xc4')],{'as':'Field','foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xc4')][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':'Variable','foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0xc6')][_0x6ec5('0x11c')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0x1cf')][_0x6ec5('0x11c')](db[_0x6ec5('0xc9')],{'as':'Subjects','foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0x1cf')]['hasMany'](db[_0x6ec5('0xc9')],{'as':_0x6ec5('0x1c1'),'foreignKey':'DescriptionId'});db[_0x6ec5('0x1cf')]['hasMany'](db[_0x6ec5('0xc9')],{'as':_0x6ec5('0x1bb'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0x1cf')][_0x6ec5('0x12c')](db[_0x6ec5('0xc6')],{'as':'Account','foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xc9')][_0x6ec5('0x11c')](db[_0x6ec5('0xc9')],{'as':_0x6ec5('0x1cd'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xc9')][_0x6ec5('0x11c')](db['VtigerField'],{'as':'Description','foreignKey':_0x6ec5('0x1c2')});db['VtigerField'][_0x6ec5('0x11c')](db[_0x6ec5('0xc9')],{'as':_0x6ec5('0x1c3'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xc9')]['belongsTo'](db[_0x6ec5('0x1c5')],{'as':'Variable','foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0x1d0')][_0x6ec5('0x11c')](db[_0x6ec5('0xcb')],{'as':'Configurations','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xcb')][_0x6ec5('0x11c')](db[_0x6ec5('0xcd')],{'as':_0x6ec5('0x1c9'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xcb')]['hasMany'](db[_0x6ec5('0xcd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x6ec5('0xcd')],{'as':_0x6ec5('0x1bb'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xcb')]['belongsTo'](db[_0x6ec5('0x1d0')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xcd')][_0x6ec5('0x11c')](db['ServicenowField'],{'as':_0x6ec5('0x1cd'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xcd')][_0x6ec5('0x11c')](db['ServicenowField'],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xcd')][_0x6ec5('0x11c')](db['ServicenowField'],{'as':'Field','foreignKey':'FieldId'});db[_0x6ec5('0xcd')]['belongsTo'](db[_0x6ec5('0x1c5')],{'as':'Variable','foreignKey':'VariableId'});db[_0x6ec5('0xcf')][_0x6ec5('0x11c')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x6ec5('0xd1')][_0x6ec5('0x11c')](db[_0x6ec5('0xd2')],{'as':_0x6ec5('0x1c9'),'onDelete':'cascade','foreignKey':_0x6ec5('0x1c0')});db['Dynamics365Configuration'][_0x6ec5('0x11c')](db['Dynamics365Field'],{'as':_0x6ec5('0x1c1'),'onDelete':'cascade','foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xd1')][_0x6ec5('0x11c')](db[_0x6ec5('0xd2')],{'as':_0x6ec5('0x1bb'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xd1')][_0x6ec5('0x12c')](db[_0x6ec5('0xcf')],{'as':_0x6ec5('0x175'),'foreignKey':'AccountId'});db[_0x6ec5('0xd2')][_0x6ec5('0x11c')](db['Dynamics365Field'],{'as':_0x6ec5('0x1cd'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0x6ec5('0x11c')](db[_0x6ec5('0xd2')],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xd2')][_0x6ec5('0x11c')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xd2')][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':_0x6ec5('0x1c5'),'foreignKey':_0x6ec5('0x1c6')});db[_0x6ec5('0x1d1')]['hasMany'](db[_0x6ec5('0xd5')],{'as':_0x6ec5('0x1be'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xd5')][_0x6ec5('0x11c')](db['FreshsalesField'],{'as':_0x6ec5('0x1c9'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xd5')][_0x6ec5('0x11c')](db[_0x6ec5('0xd7')],{'as':_0x6ec5('0x1c1'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xd5')]['hasMany'](db[_0x6ec5('0xd7')],{'as':_0x6ec5('0x1bb'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xd5')][_0x6ec5('0x12c')](db['FreshsalesAccount'],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x1bf')});db[_0x6ec5('0xd7')][_0x6ec5('0x11c')](db[_0x6ec5('0xd7')],{'as':_0x6ec5('0x1cd'),'foreignKey':_0x6ec5('0x1c0')});db[_0x6ec5('0xd7')]['hasMany'](db[_0x6ec5('0xd7')],{'as':_0x6ec5('0x1ca'),'foreignKey':_0x6ec5('0x1c2')});db[_0x6ec5('0xd7')][_0x6ec5('0x11c')](db['FreshsalesField'],{'as':_0x6ec5('0x1c3'),'foreignKey':_0x6ec5('0x1c4')});db[_0x6ec5('0xd7')][_0x6ec5('0x12c')](db[_0x6ec5('0x1c5')],{'as':_0x6ec5('0x1c5'),'foreignKey':_0x6ec5('0x1c6')});db['ChatQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x67')],{});db['ChatQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':'List','foreignKey':_0x6ec5('0x16f')});db['ChatQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':'Contact','foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x1d2')][_0x6ec5('0x12c')](db[_0x6ec5('0x6d')],{});db[_0x6ec5('0x1d2')]['belongsTo'](db['ChatMessage'],{});db[_0x6ec5('0x1d2')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{});db['ChatQueueReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x71')],{});db[_0x6ec5('0xdc')]['belongsTo'](db[_0x6ec5('0x13')],{'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1d3')});db['ChatInternalMessage'][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'onDelete':'cascade','foreignKey':_0x6ec5('0x1d4')});db[_0x6ec5('0xe1')][_0x6ec5('0x11c')](db[_0x6ec5('0xdf')],{'foreignKey':_0x6ec5('0x1d5'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0xe1')]['hasMany'](db[_0x6ec5('0xde')],{'foreignKey':_0x6ec5('0x1d5'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x1d6')][_0x6ec5('0x12c')](db[_0x6ec5('0x148')],{});db[_0x6ec5('0x1d6')]['belongsTo'](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x16e'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x1d6')][_0x6ec5('0x12c')](db['CmContact'],{'as':_0x6ec5('0x162'),'foreignKey':_0x6ec5('0x163')});db[_0x6ec5('0x1d6')][_0x6ec5('0x12c')](db[_0x6ec5('0x5a')],{});db[_0x6ec5('0x1d6')]['belongsTo'](db[_0x6ec5('0x5c')],{});db[_0x6ec5('0x1d6')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{});db[_0x6ec5('0x1d6')][_0x6ec5('0x12c')](db[_0x6ec5('0x5e')],{});db['JscriptyProject'][_0x6ec5('0x11c')](db[_0x6ec5('0xe1')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x6ec5('0x11c')](db[_0x6ec5('0xdf')],{'foreignKey':_0x6ec5('0x1d7')});db[_0x6ec5('0xe6')][_0x6ec5('0x11c')](db['JscriptyAnswerReport'],{'foreignKey':_0x6ec5('0x1d7')});db[_0x6ec5('0xeb')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':'Users','through':'user_has_square_projects'});db[_0x6ec5('0xf0')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':'user_has_teams'});db[_0x6ec5('0xf0')][_0x6ec5('0x131')](db['VoiceQueue'],{'through':_0x6ec5('0x115'),'as':_0x6ec5('0x1d8')});db['Team'][_0x6ec5('0x131')](db[_0x6ec5('0x42')],{'through':_0x6ec5('0x173'),'as':_0x6ec5('0x13b')});db[_0x6ec5('0xf0')][_0x6ec5('0x131')](db[_0x6ec5('0x71')],{'through':_0x6ec5('0x1d9'),'as':_0x6ec5('0x1da')});db['Team'][_0x6ec5('0x131')](db['FaxQueue'],{'through':_0x6ec5('0x18a'),'as':_0x6ec5('0x13d')});db[_0x6ec5('0xf0')][_0x6ec5('0x131')](db[_0x6ec5('0x5e')],{'through':_0x6ec5('0x1db'),'as':_0x6ec5('0x13e')});db['Team']['belongsToMany'](db[_0x6ec5('0x13f')],{'through':_0x6ec5('0x194'),'as':'OpenchannelQueues'});db[_0x6ec5('0xf0')][_0x6ec5('0x131')](db['WhatsappQueue'],{'through':_0x6ec5('0x1dc'),'as':_0x6ec5('0x141')});db['Team'][_0x6ec5('0x131')](db[_0x6ec5('0x1dd')],{'through':_0x6ec5('0x1de'),'as':_0x6ec5('0x13a')});db['Campaign']['hasMany'](db[_0x6ec5('0x79')],{'as':_0x6ec5('0x152'),'foreignKey':_0x6ec5('0x1a5')});db[_0x6ec5('0xf4')]['hasMany'](db[_0x6ec5('0x7c')],{'as':_0x6ec5('0x122'),'foreignKey':'CampaignId'});db[_0x6ec5('0xf4')][_0x6ec5('0x11c')](db[_0x6ec5('0x7e')],{'as':'HopperHistories','foreignKey':_0x6ec5('0x1a5')});db[_0x6ec5('0xf4')][_0x6ec5('0x11c')](db['CmHopperBlack'],{'as':_0x6ec5('0x156'),'foreignKey':_0x6ec5('0x1a5')});db[_0x6ec5('0xf4')][_0x6ec5('0x12c')](db['Trunk'],{'as':_0x6ec5('0x2d'),'foreignKey':_0x6ec5('0x1df')});db[_0x6ec5('0xf4')][_0x6ec5('0x12c')](db['Trunk'],{'as':_0x6ec5('0x1e0'),'foreignKey':_0x6ec5('0x158')});db[_0x6ec5('0xf4')][_0x6ec5('0x12c')](db[_0x6ec5('0x8b')],{'as':_0x6ec5('0x8b'),'foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0xf4')][_0x6ec5('0x12c')](db[_0x6ec5('0xeb')],{'as':_0x6ec5('0xeb'),'foreignKey':_0x6ec5('0x1e1')});db['Campaign']['belongsToMany'](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x133'),'through':_0x6ec5('0x1e2')});db['Campaign']['belongsToMany'](db[_0x6ec5('0x101')],{'as':_0x6ec5('0x1e3'),'through':_0x6ec5('0x1e4')});db[_0x6ec5('0x188')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x6ec5('0x6f'),'foreignKey':'ChatOfflineMessageId'});db[_0x6ec5('0xf8')][_0x6ec5('0x12c')](db[_0x6ec5('0x16b')],{});db[_0x6ec5('0xf8')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x40')],{'foreignKey':_0x6ec5('0x1e5'),'as':_0x6ec5('0x1e6')});db[_0x6ec5('0xf8')][_0x6ec5('0x12c')](db['User'],{'foreignKey':_0x6ec5('0x1e7'),'as':'FromAgent'});db[_0x6ec5('0xf8')][_0x6ec5('0x12c')](db['User'],{'foreignKey':_0x6ec5('0x1e8'),'as':_0x6ec5('0x1e9')});db[_0x6ec5('0xf8')][_0x6ec5('0x12c')](db['MailQueue'],{'foreignKey':_0x6ec5('0x1ea'),'as':'ToQueue'});db[_0x6ec5('0xf8')][_0x6ec5('0x12c')](db[_0x6ec5('0x40')],{'foreignKey':'ToMailAccountId','as':_0x6ec5('0x1eb')});db[_0x6ec5('0xfa')][_0x6ec5('0x12c')](db[_0x6ec5('0x197')],{});db[_0x6ec5('0xfa')][_0x6ec5('0x12c')](db[_0x6ec5('0x6d')],{});db[_0x6ec5('0xfa')][_0x6ec5('0x12c')](db[_0x6ec5('0x67')],{'foreignKey':_0x6ec5('0x1ec'),'as':_0x6ec5('0x1e6')});db[_0x6ec5('0xfa')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':_0x6ec5('0x1e7'),'as':_0x6ec5('0x1ed')});db[_0x6ec5('0xfa')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':_0x6ec5('0x1e8'),'as':_0x6ec5('0x1e9')});db[_0x6ec5('0xfa')][_0x6ec5('0x12c')](db[_0x6ec5('0x71')],{'foreignKey':_0x6ec5('0x1ee'),'as':_0x6ec5('0x1ef')});db['ChatTransferReport']['belongsTo'](db[_0x6ec5('0x67')],{'foreignKey':'ToChatWebsiteId','as':_0x6ec5('0x1eb')});db[_0x6ec5('0xfc')][_0x6ec5('0x12c')](db['FaxMessage'],{});db[_0x6ec5('0xfc')][_0x6ec5('0x12c')](db[_0x6ec5('0x52')],{});db['FaxTransferReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x4e')],{'foreignKey':_0x6ec5('0x1f0'),'as':_0x6ec5('0x1e6')});db[_0x6ec5('0xfc')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':_0x6ec5('0x1e7'),'as':'FromAgent'});db[_0x6ec5('0xfc')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x6ec5('0xfc')]['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x6ec5('0xfc')][_0x6ec5('0x12c')](db[_0x6ec5('0x4e')],{'foreignKey':_0x6ec5('0x1f1'),'as':_0x6ec5('0x1eb')});db[_0x6ec5('0xfd')][_0x6ec5('0x12c')](db[_0x6ec5('0x64')],{});db['OpenchannelTransferReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x62')],{});db[_0x6ec5('0xfd')][_0x6ec5('0x12c')](db['OpenchannelAccount'],{'foreignKey':_0x6ec5('0x1f2'),'as':_0x6ec5('0x1e6')});db['OpenchannelTransferReport'][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':_0x6ec5('0x1e7'),'as':_0x6ec5('0x1ed')});db[_0x6ec5('0xfd')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':_0x6ec5('0x1e8'),'as':_0x6ec5('0x1e9')});db[_0x6ec5('0xfd')][_0x6ec5('0x12c')](db['OpenchannelQueue'],{'foreignKey':_0x6ec5('0x1f3'),'as':_0x6ec5('0x1ef')});db[_0x6ec5('0xfd')][_0x6ec5('0x12c')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x6ec5('0x1eb')});db[_0x6ec5('0xff')][_0x6ec5('0x12c')](db['SmsMessage'],{});db[_0x6ec5('0xff')][_0x6ec5('0x12c')](db[_0x6ec5('0x5a')],{});db[_0x6ec5('0xff')][_0x6ec5('0x12c')](db['SmsAccount'],{'foreignKey':_0x6ec5('0x1f4'),'as':_0x6ec5('0x1e6')});db[_0x6ec5('0xff')]['belongsTo'](db[_0x6ec5('0x13')],{'foreignKey':'FromUserId','as':_0x6ec5('0x1ed')});db[_0x6ec5('0xff')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':'ToUserId','as':_0x6ec5('0x1e9')});db['SmsTransferReport']['belongsTo'](db[_0x6ec5('0x5e')],{'foreignKey':_0x6ec5('0x1f5'),'as':_0x6ec5('0x1ef')});db[_0x6ec5('0xff')][_0x6ec5('0x12c')](db[_0x6ec5('0x148')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList'][_0x6ec5('0x11c')](db[_0x6ec5('0x88')],{'as':_0x6ec5('0x168'),'foreignKey':_0x6ec5('0x16f'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x101')][_0x6ec5('0x11c')](db[_0x6ec5('0x82')],{'as':_0x6ec5('0x1f6'),'foreignKey':'ListId'});db[_0x6ec5('0x101')][_0x6ec5('0x11c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x132'),'onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x16f')});db['CmList'][_0x6ec5('0x11c')](db[_0x6ec5('0x7c')],{'as':_0x6ec5('0x122'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x101')][_0x6ec5('0x11c')](db[_0x6ec5('0x7e')],{'as':_0x6ec5('0x123'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x101')][_0x6ec5('0x11c')](db[_0x6ec5('0x80')],{'as':_0x6ec5('0x80'),'foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x101')][_0x6ec5('0x131')](db[_0x6ec5('0x139')],{'as':'Queues','through':_0x6ec5('0x1f7')});db[_0x6ec5('0x101')]['belongsToMany'](db[_0x6ec5('0x13')],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x6ec5('0x1a')],{'as':_0x6ec5('0x120'),'onDelete':_0x6ec5('0x121')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x118')});db[_0x6ec5('0x1dd')]['belongsToMany'](db[_0x6ec5('0xf0')],{'through':_0x6ec5('0x1de'),'as':_0x6ec5('0x15c')});db[_0x6ec5('0x12d')][_0x6ec5('0x11c')](db[_0x6ec5('0x13')],{'as':'Users','foreignKey':_0x6ec5('0x12e')});db[_0x6ec5('0x12d')][_0x6ec5('0x11c')](db[_0x6ec5('0x104')],{'as':_0x6ec5('0x1f8'),'foreignKey':_0x6ec5('0x12e'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x104')][_0x6ec5('0x11c')](db[_0x6ec5('0x1f9')],{'as':_0x6ec5('0x1fa'),'foreignKey':_0x6ec5('0x1fb'),'onDelete':_0x6ec5('0x121')});db[_0x6ec5('0x109')][_0x6ec5('0x11c')](db[_0x6ec5('0x88')],{'as':'Dispositions','foreignKey':_0x6ec5('0x1fc'),'onDelete':'cascade'});db[_0x6ec5('0x109')][_0x6ec5('0x11c')](db[_0x6ec5('0x169')],{'as':'Answers','foreignKey':_0x6ec5('0x1fc')});db[_0x6ec5('0x109')][_0x6ec5('0x11c')](db[_0x6ec5('0x10e')],{'as':_0x6ec5('0x16c'),'foreignKey':_0x6ec5('0x1fc')});db[_0x6ec5('0x109')][_0x6ec5('0x11c')](db[_0x6ec5('0x10c')],{'as':_0x6ec5('0x16d')});db['WhatsappAccount'][_0x6ec5('0x11c')](db[_0x6ec5('0x10b')],{'as':_0x6ec5('0x14f')});db[_0x6ec5('0x109')][_0x6ec5('0x12c')](db['CmList'],{'as':'List','foreignKey':_0x6ec5('0x16f')});db[_0x6ec5('0x109')][_0x6ec5('0x12c')](db[_0x6ec5('0x8d')],{'as':_0x6ec5('0x15a'),'foreignKey':_0x6ec5('0x15b')});db[_0x6ec5('0x109')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':'Agents','through':_0x6ec5('0x14c')});db['WhatsappApplication'][_0x6ec5('0x12c')](db['User'],{'onDelete':_0x6ec5('0x17d')});db['WhatsappApplication'][_0x6ec5('0x12c')](db[_0x6ec5('0x111')],{'onDelete':_0x6ec5('0x17d')});db[_0x6ec5('0x10b')]['belongsTo'](db[_0x6ec5('0x109')],{'onDelete':_0x6ec5('0x17d')});db['WhatsappApplication']['belongsTo'](db[_0x6ec5('0x8b')],{'onDelete':'restrict','foreignKey':_0x6ec5('0x159')});db[_0x6ec5('0x10b')][_0x6ec5('0x12c')](db['Tag'],{'onDelete':_0x6ec5('0x17d'),'foreignKey':_0x6ec5('0x182')});db[_0x6ec5('0x10c')][_0x6ec5('0x11c')](db[_0x6ec5('0x10e')],{'as':'Messages','onDelete':_0x6ec5('0x121'),'foreignKey':_0x6ec5('0x1fd')});db['WhatsappInteraction'][_0x6ec5('0x12c')](db[_0x6ec5('0x109')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x1fc')});db[_0x6ec5('0x10c')][_0x6ec5('0x12c')](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':'ContactId'});db[_0x6ec5('0x10c')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x176'),'foreignKey':'UserId'});db[_0x6ec5('0x10c')]['belongsToMany'](db['Tag'],{'through':_0x6ec5('0x1b3'),'as':_0x6ec5('0x184')});db['WhatsappInteraction']['belongsToMany'](db[_0x6ec5('0x97')],{'through':_0x6ec5('0x1b3'),'as':_0x6ec5('0x186')});db[_0x6ec5('0x10c')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x178'),'through':'user_has_whatsapp_interactions','foreignKey':_0x6ec5('0x1fd')});db[_0x6ec5('0x10e')]['belongsTo'](db[_0x6ec5('0x13')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db[_0x6ec5('0x77')],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x162')});db[_0x6ec5('0x10e')][_0x6ec5('0x12c')](db['WhatsappInteraction'],{'onDelete':_0x6ec5('0x121'),'as':_0x6ec5('0x187'),'foreignKey':_0x6ec5('0x1fd')});db[_0x6ec5('0x10e')][_0x6ec5('0x12c')](db[_0x6ec5('0x109')],{'as':_0x6ec5('0x175'),'foreignKey':_0x6ec5('0x1fc')});db[_0x6ec5('0x1fe')]['belongsTo'](db[_0x6ec5('0x109')],{});db[_0x6ec5('0x1fe')][_0x6ec5('0x12c')](db[_0x6ec5('0x101')],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport']['belongsTo'](db[_0x6ec5('0x77')],{'as':_0x6ec5('0x162'),'foreignKey':'ContactId'});db[_0x6ec5('0x1fe')][_0x6ec5('0x12c')](db[_0x6ec5('0x10c')],{});db[_0x6ec5('0x1fe')][_0x6ec5('0x12c')](db[_0x6ec5('0x111')],{});db[_0x6ec5('0x1fe')][_0x6ec5('0x12c')](db['WhatsappMessage'],{});db[_0x6ec5('0x1fe')]['belongsTo'](db[_0x6ec5('0x13')],{});db[_0x6ec5('0x1ff')][_0x6ec5('0x12c')](db['WhatsappMessage'],{});db[_0x6ec5('0x1ff')]['belongsTo'](db[_0x6ec5('0x10c')],{});db[_0x6ec5('0x1ff')][_0x6ec5('0x12c')](db[_0x6ec5('0x109')],{'foreignKey':_0x6ec5('0x200'),'as':_0x6ec5('0x1e6')});db[_0x6ec5('0x1ff')][_0x6ec5('0x12c')](db[_0x6ec5('0x109')],{'foreignKey':_0x6ec5('0x201'),'as':_0x6ec5('0x1eb')});db[_0x6ec5('0x1ff')][_0x6ec5('0x12c')](db[_0x6ec5('0x111')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0x6ec5('0x1ff')]['belongsTo'](db[_0x6ec5('0x13')],{'foreignKey':_0x6ec5('0x1e7'),'as':_0x6ec5('0x1ed')});db[_0x6ec5('0x1ff')][_0x6ec5('0x12c')](db[_0x6ec5('0x13')],{'foreignKey':'ToUserId','as':_0x6ec5('0x1e9')});db[_0x6ec5('0x111')][_0x6ec5('0x131')](db[_0x6ec5('0x13')],{'as':_0x6ec5('0x171'),'through':_0x6ec5('0x3c'),'foreignKey':_0x6ec5('0x202')});db[_0x6ec5('0x111')][_0x6ec5('0x131')](db[_0x6ec5('0xf0')],{'through':'team_has_whatsapp_queues','as':'Teams'});module[_0x6ec5('0x203')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x13f6=['JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','hasMany','Recordings','UserId','HopperFinals','ReportAgentPreview','ChatInteractions','SmsInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','user_has_fax_interactions','OpenchannelInteraction','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefix','UserVoicePrefix','MailQueue','ChatQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','CmContact','ContactId','MailAccountId','MailServerOut','Imap','Disposition','Dispositions','Interactions','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessageId','restrict','IntervalId','List','Items','FaxAccountId','mandatoryDispositionPauseId','user_has_fax_accounts','FaxInteractionId','Account','fax_interaction_has_tags','SmsAccountId','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','Answers','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueue','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','ChatMessage','Agent','ChatQueue','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','FaxInteractions','Company','cm_user_has_contacts','cm_contact_has_tags','OwnerId','CampaignId','All','Automation','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Action','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','ServicenowAccount','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','VoiceQueues','MailQueues','FaxQueues','team_has_whatsapp_queues','WhatsappQueues','TeamVoicePrefix','VoicePrefixes','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToUserId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Extensions','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','WhatsappQueueId','../config/environment','sequelize','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','sequelizeHistory','127.0.0.1','utf8','utf8_general_ci','username','options','database','password','User','import','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelMessage/openchannelMessage.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatInteraction/chatInteraction.model','../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','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x13f6,0x124));var _0x613f=function(_0x1723ff,_0x3210f9){_0x1723ff=_0x1723ff-0x0;var _0x1db59f=_0x13f6[_0x1723ff];return _0x1db59f;};'use strict';var config=require(_0x613f('0x0'));var Sequelize=require(_0x613f('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x613f('0x2')]();config[_0x613f('0x1')]=_[_0x613f('0x3')](config['sequelize'],{'database':_0x613f('0x4'),'username':_0x613f('0x5'),'password':_0x613f('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x613f('0x7'),'dialectOptions':{'charset':_0x613f('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x613f('0x3')](config[_0x613f('0x9')],{'database':_0x613f('0x4'),'username':_0x613f('0x5'),'password':'xC@LL1234','options':{'host':_0x613f('0xa'),'port':0xcea,'dialect':_0x613f('0x7'),'dialectOptions':{'charset':_0x613f('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x613f('0xb'),'collate':_0x613f('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x613f('0x1')]['database'],config[_0x613f('0x1')][_0x613f('0xd')],config['sequelize']['password'],config['sequelize'][_0x613f('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x613f('0x9')][_0x613f('0xf')],config[_0x613f('0x9')][_0x613f('0xd')],config[_0x613f('0x9')][_0x613f('0x10')],config[_0x613f('0x9')][_0x613f('0xe')])};db[_0x613f('0x11')]=db['sequelize'][_0x613f('0x12')]('../api/user/user.model');db['VoiceChanSpy']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x613f('0x13')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x14'));db[_0x613f('0x15')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x16'));db['VoiceMusicOnHold']=db['sequelize'][_0x613f('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0x613f('0x17')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x18'));db['VoiceMail']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x19'));db[_0x613f('0x1a')]=db[_0x613f('0x1')]['import'](_0x613f('0x1b'));db[_0x613f('0x1c')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x1d'));db[_0x613f('0x1e')]=db['sequelize']['import']('../api/voiceDialReport/voiceDialReport.model');db[_0x613f('0x1f')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x20'));db['VoiceQueueReport']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db['sequelize'][_0x613f('0x12')](_0x613f('0x21'));db[_0x613f('0x22')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x23'));db[_0x613f('0x24')]=db[_0x613f('0x1')]['import'](_0x613f('0x25'));db[_0x613f('0x26')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x27'));db[_0x613f('0x28')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x29'));db[_0x613f('0x2a')]=db['sequelize'][_0x613f('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x613f('0x2b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x2c'));db[_0x613f('0x2d')]=db[_0x613f('0x1')]['import'](_0x613f('0x2e'));db[_0x613f('0x2f')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x30'));db['UserOpenchannelQueue']=db['sequelize']['import'](_0x613f('0x31'));db[_0x613f('0x32')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x613f('0x33')]=db[_0x613f('0x1')]['import'](_0x613f('0x34'));db['MailServerOut']=db[_0x613f('0x1')]['import'](_0x613f('0x35'));db['MailAccount']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x36'));db['MailQueue']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x37'));db[_0x613f('0x38')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x39'));db[_0x613f('0x3a')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x613f('0x3b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x3c'));db[_0x613f('0x3d')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/mailApplication/mailApplication.model');db[_0x613f('0x3e')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x3f'));db[_0x613f('0x40')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/dashboard/dashboard.model');db[_0x613f('0x41')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x42'));db[_0x613f('0x43')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x44'));db[_0x613f('0x45')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x46'));db[_0x613f('0x47')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x48'));db[_0x613f('0x49')]=db[_0x613f('0x1')]['import'](_0x613f('0x4a'));db[_0x613f('0x4b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x4c'));db[_0x613f('0x4d')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x4e'));db[_0x613f('0x4f')]=db['sequelize']['import'](_0x613f('0x50'));db[_0x613f('0x51')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x52'));db[_0x613f('0x53')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x54'));db[_0x613f('0x55')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x56'));db[_0x613f('0x57')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x58'));db[_0x613f('0x59')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5a'));db['OpenchannelApplication']=db['sequelize'][_0x613f('0x12')](_0x613f('0x5b'));db['OpenchannelInteraction']=db['sequelize'][_0x613f('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5c'));db['OpenchannelQueue']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5d'));db[_0x613f('0x5e')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x5f'));db['ChatApplication']=db['sequelize'][_0x613f('0x12')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x60'));db['ChatMessage']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x61'));db[_0x613f('0x62')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x63'));db['ChatQueue']=db[_0x613f('0x1')]['import'](_0x613f('0x64'));db[_0x613f('0x65')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x66'));db[_0x613f('0x67')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x68'));db[_0x613f('0x69')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x6a'));db['CmContact']=db['sequelize'][_0x613f('0x12')]('../api/cmContact/cmContact.model');db[_0x613f('0x6b')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x6c'));db[_0x613f('0x6d')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x6e'));db[_0x613f('0x6f')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x613f('0x70')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x71'));db['ReportAgentPreview']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x613f('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x613f('0x1')]['import']('../api/action/action.model');db['Automation']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/automation/automation.model');db[_0x613f('0x72')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x73'));db['Disposition']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/disposition/disposition.model');db[_0x613f('0x74')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x75'));db[_0x613f('0x76')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x77'));db[_0x613f('0x78')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x79'));db['Cdr']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x7a'));db[_0x613f('0x7b')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x613f('0x7c')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x7d'));db[_0x613f('0x7e')]=db[_0x613f('0x1')]['import']('../api/sound/sound.model');db[_0x613f('0x7f')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x80'));db['Template']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x81'));db[_0x613f('0x82')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x83'));db[_0x613f('0x84')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x85'));db[_0x613f('0x86')]=db[_0x613f('0x1')]['import'](_0x613f('0x87'));db[_0x613f('0x88')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x89'));db[_0x613f('0x8a')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x8b'));db[_0x613f('0x8c')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x8d'));db[_0x613f('0x8e')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x8f'));db[_0x613f('0x90')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x91'));db[_0x613f('0x92')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x93'));db[_0x613f('0x94')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x95'));db[_0x613f('0x96')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x97'));db[_0x613f('0x98')]=db[_0x613f('0x1')]['import'](_0x613f('0x99'));db[_0x613f('0x9a')]=db['sequelize'][_0x613f('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x613f('0x9b')]=db['sequelize']['import'](_0x613f('0x9c'));db[_0x613f('0x9d')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x9e'));db[_0x613f('0x9f')]=db[_0x613f('0x1')]['import'](_0x613f('0xa0'));db[_0x613f('0xa1')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xa2'));db['DeskConfiguration']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x613f('0xa3')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db['sequelize'][_0x613f('0x12')](_0x613f('0xa4'));db['ZohoConfiguration']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xa5'));db['ZohoField']=db[_0x613f('0x1')]['import'](_0x613f('0xa6'));db['ZendeskAccount']=db['sequelize'][_0x613f('0x12')](_0x613f('0xa7'));db[_0x613f('0xa8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xa9'));db[_0x613f('0xaa')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xab'));db[_0x613f('0xac')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xad'));db[_0x613f('0xae')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xaf'));db[_0x613f('0xb0')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xb1'));db[_0x613f('0xb2')]=db[_0x613f('0x1')]['import'](_0x613f('0xb3'));db[_0x613f('0xb4')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xb5'));db[_0x613f('0xb6')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xb7'));db['ServicenowAccount']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xb8'));db[_0x613f('0xb9')]=db[_0x613f('0x1')]['import'](_0x613f('0xba'));db[_0x613f('0xbb')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xbc'));db[_0x613f('0xbd')]=db['sequelize']['import'](_0x613f('0xbe'));db[_0x613f('0xbf')]=db[_0x613f('0x1')]['import'](_0x613f('0xc0'));db[_0x613f('0xc1')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x613f('0xc2')]=db[_0x613f('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x613f('0x1')]['import'](_0x613f('0xc3'));db[_0x613f('0xc4')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x613f('0x86')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x87'));db[_0x613f('0xc5')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/network/network.model');db[_0x613f('0xc6')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x613f('0xc7')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x613f('0xc8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xc9'));db[_0x613f('0xca')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xcb'));db['JscriptySessionReport']=db['sequelize'][_0x613f('0x12')](_0x613f('0xcc'));db[_0x613f('0xcd')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x613f('0xce')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xcf'));db[_0x613f('0xd0')]=db[_0x613f('0x1')]['import'](_0x613f('0xd1'));db[_0x613f('0xd2')]=db['sequelize'][_0x613f('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0x613f('0xd3')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xd4'));db[_0x613f('0xd5')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xd6'));db['SquareProject']=db[_0x613f('0x1')]['import'](_0x613f('0xd7'));db[_0x613f('0xd8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xd9'));db[_0x613f('0xda')]=db[_0x613f('0x1')]['import'](_0x613f('0xdb'));db[_0x613f('0xdc')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xdd'));db[_0x613f('0xde')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xdf'));db[_0x613f('0xe0')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xe1'));db['Migration']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/migration/migration.model');db[_0x613f('0xe2')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe3'));db[_0x613f('0xe4')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe5'));db[_0x613f('0xe6')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe7'));db[_0x613f('0xe8')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xe9'));db[_0x613f('0xea')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xeb'));db['OpenchannelTransferReport']=db[_0x613f('0x1')]['import'](_0x613f('0xec'));db[_0x613f('0xed')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xee'));db[_0x613f('0xef')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xf0'));db['VoicePrefix']=db[_0x613f('0x1')][_0x613f('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x613f('0xf1')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xf2'));db[_0x613f('0xf3')]=db[_0x613f('0x1')]['import'](_0x613f('0xf4'));db[_0x613f('0xf5')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xf6'));db[_0x613f('0xf7')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/userNotification/userNotification.model');db[_0x613f('0xf8')]=db['sequelize']['import'](_0x613f('0xf9'));db[_0x613f('0xfa')]=db['sequelize'][_0x613f('0x12')](_0x613f('0xfb'));db[_0x613f('0xfc')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0xfd'));db[_0x613f('0xfe')]=db[_0x613f('0x1')][_0x613f('0x12')]('../api/whatsappMessage/whatsappMessage.model');db[_0x613f('0xff')]=db['sequelize'][_0x613f('0x12')](_0x613f('0x100'));db['WhatsappTransferReport']=db[_0x613f('0x1')]['import'](_0x613f('0x101'));db[_0x613f('0x102')]=db[_0x613f('0x1')]['import'](_0x613f('0x103'));db[_0x613f('0x104')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x105'));db[_0x613f('0x106')]=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x107'));db['TeamVoicePrefix']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x108'));db['UserVoicePrefix']=db[_0x613f('0x1')][_0x613f('0x12')](_0x613f('0x109'));db[_0x613f('0x11')][_0x613f('0x10a')](db[_0x613f('0x10b')],{'as':_0x613f('0x10b'),'onDelete':_0x613f('0x10c'),'foreignKey':'UserId'});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x17')],{'as':_0x613f('0x10e'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x26')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':'Extensions','onDelete':_0x613f('0x10c'),'hooks':!![]});db[_0x613f('0x11')][_0x613f('0x10d')](db['CmHopperFinal'],{'as':_0x613f('0x110'),'foreignKey':'UserId'});db['User'][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':'HopperHistory','foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')]['hasMany'](db[_0x613f('0x111')],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x613f('0x10f')});db['User'][_0x613f('0x10d')](db['ChatInteraction'],{'as':_0x613f('0x112'),'foreignKey':'UserId'});db[_0x613f('0x11')]['hasMany'](db['SmsInteraction'],{'as':_0x613f('0x113'),'foreignKey':_0x613f('0x10f')});db['User'][_0x613f('0x10d')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0x3a')],{'as':'MailInteractions','foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db['WhatsappInteraction'],{'as':_0x613f('0x114'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x11')][_0x613f('0x10d')](db[_0x613f('0xf7')],{'as':_0x613f('0x115'),'foreignKey':_0x613f('0x116')});db['User'][_0x613f('0x117')](db[_0x613f('0xf1')],{'as':_0x613f('0xf1'),'foreignKey':'userProfileId'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x65')],{'as':'Groups','through':_0x613f('0x119')});db[_0x613f('0x11')][_0x613f('0x118')](db['CmContact'],{'as':_0x613f('0x11a'),'through':'cm_user_has_contacts'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x11b'),'through':_0x613f('0x11c')});db[_0x613f('0x11')][_0x613f('0x118')](db['Team'],{'through':'user_has_teams'});db['User'][_0x613f('0x118')](db[_0x613f('0x3a')],{'as':_0x613f('0x11d'),'through':_0x613f('0x11e')});db['User']['belongsToMany'](db[_0x613f('0x11f')],{'as':_0x613f('0x112'),'through':_0x613f('0x120')});db[_0x613f('0x11')][_0x613f('0x118')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x613f('0x121')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x53')],{'as':_0x613f('0x113'),'through':'user_has_sms_interactions'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x122')],{'as':_0x613f('0x123'),'through':_0x613f('0x124')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0xfc')],{'as':_0x613f('0x114'),'through':_0x613f('0x125')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x126')],{'as':'VoiceQueues','through':_0x613f('0x28'),'required':![]});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x127')],{'as':'VoicePrefixes','through':_0x613f('0x128'),'required':![]});db[_0x613f('0x11')]['belongsToMany'](db[_0x613f('0x129')],{'as':'MailQueues','through':_0x613f('0x2b'),'required':![]});db[_0x613f('0x11')]['belongsToMany'](db['ChatQueue'],{'as':_0x613f('0x12a'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x613f('0x118')](db[_0x613f('0x4b')],{'as':'FaxQueues','through':_0x613f('0x2d'),'required':![]});db['User'][_0x613f('0x118')](db['SmsQueue'],{'as':_0x613f('0x12b'),'through':_0x613f('0x2f'),'required':![]});db[_0x613f('0x11')][_0x613f('0x118')](db['OpenchannelQueue'],{'as':_0x613f('0x12c'),'through':_0x613f('0x12d'),'required':![]});db[_0x613f('0x11')]['belongsToMany'](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x613f('0x32'),'required':![]});db['User'][_0x613f('0x118')](db['CmList'],{'through':_0x613f('0x11c')});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x12e')],{'as':_0x613f('0x12f'),'through':_0x613f('0x130')});db['User'][_0x613f('0x118')](db[_0x613f('0x43')],{'as':_0x613f('0x131'),'through':'user_has_fax_accounts'});db[_0x613f('0x11')]['belongsToMany'](db[_0x613f('0x132')],{'as':_0x613f('0x133'),'through':_0x613f('0x134')});db['User'][_0x613f('0x118')](db['OpenchannelAccount'],{'as':_0x613f('0x135'),'through':'user_has_openchannel_accounts'});db[_0x613f('0x11')][_0x613f('0x118')](db[_0x613f('0x4f')],{'as':_0x613f('0x136'),'through':'user_has_sms_accounts'});db[_0x613f('0x11')]['belongsToMany'](db[_0x613f('0xf8')],{'as':_0x613f('0x137'),'through':_0x613f('0x138')});db['User'][_0x613f('0x118')](db[_0x613f('0x139')],{'as':_0x613f('0x13a'),'through':_0x613f('0x13b')});db[_0x613f('0x13c')][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':_0x613f('0x13d'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x13e')});db['VoiceContext']['hasMany'](db[_0x613f('0x15')],{'onDelete':_0x613f('0x10c')});db['VoiceExtension']['hasMany'](db['VoiceExtension'],{'as':_0x613f('0x13f'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x613f('0x118')](db[_0x613f('0x7e')],{'as':'Sounds','through':_0x613f('0x140')});db[_0x613f('0x126')][_0x613f('0x10d')](db['UserVoiceQueueRt'],{'as':_0x613f('0x141'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')]['hasMany'](db['CmHopper'],{'as':_0x613f('0x143'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':'HopperFinals','foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':_0x613f('0x144'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x111')],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x142')});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x6d')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x613f('0x126')][_0x613f('0x10d')](db[_0x613f('0x145')],{'as':_0x613f('0x146'),'foreignKey':_0x613f('0x142')});db['VoiceQueue']['belongsTo'](db[_0x613f('0x22')],{'as':_0x613f('0x22'),'foreignKey':_0x613f('0x147')});db[_0x613f('0x126')]['belongsTo'](db[_0x613f('0x22')],{'as':_0x613f('0x148'),'foreignKey':_0x613f('0x149')});db['VoiceQueue'][_0x613f('0x117')](db[_0x613f('0x76')],{'as':_0x613f('0x76'),'foreignKey':'IntervalId'});db[_0x613f('0x126')][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x613f('0x126')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':'Lists','through':_0x613f('0x14b')});db[_0x613f('0x126')]['belongsToMany'](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x28')});db['VoiceQueue'][_0x613f('0x118')](db['Team'],{'as':_0x613f('0x14d'),'through':_0x613f('0x106')});db['VoiceQueue'][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x14e'),'through':'voice_queues_has_cm_blacklists'});db[_0x613f('0x17')][_0x613f('0x117')](db['User'],{'as':_0x613f('0x11'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x14f')][_0x613f('0x117')](db['User'],{'as':'User','foreignKey':_0x613f('0x10f')});db[_0x613f('0x10b')][_0x613f('0x10d')](db['VoiceMailMessage'],{'as':_0x613f('0x150'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0x613f('0x117')](db[_0x613f('0x10b')],{'foreignKey':_0x613f('0x151'),'targetKey':_0x613f('0x152')});db[_0x613f('0x1c')][_0x613f('0x10d')](db[_0x613f('0x153')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x613f('0x1f')],{'as':'AgentReports','foreignKey':_0x613f('0x154'),'constraints':![]});db[_0x613f('0x1c')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x11'),'foreignKey':'UserId'});db[_0x613f('0x1c')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':'Contact','foreignKey':_0x613f('0x156')});db[_0x613f('0x33')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':_0x613f('0x132'),'foreignKey':_0x613f('0x157')});db[_0x613f('0x158')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x613f('0x132')][_0x613f('0x10a')](db[_0x613f('0x33')],{'as':_0x613f('0x159'),'onDelete':'cascade'});db[_0x613f('0x132')][_0x613f('0x10a')](db[_0x613f('0x158')],{'as':'Smtp','onDelete':_0x613f('0x10c')});db[_0x613f('0x132')]['hasMany'](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x157'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x132')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x613f('0x132')][_0x613f('0x10d')](db[_0x613f('0x3b')],{'as':_0x613f('0x150'),'foreignKey':_0x613f('0x157')});db[_0x613f('0x132')][_0x613f('0x10d')](db[_0x613f('0x3a')],{'as':_0x613f('0x15c')});db['MailAccount'][_0x613f('0x10d')](db[_0x613f('0x3d')],{'as':_0x613f('0x13f')});db[_0x613f('0x132')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':'List','foreignKey':_0x613f('0x15d')});db['MailAccount'][_0x613f('0x117')](db['Template'],{'as':_0x613f('0x15e'),'foreignKey':_0x613f('0x15f')});db[_0x613f('0x132')][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Agents','through':_0x613f('0x134')});db[_0x613f('0x129')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x14c'),'through':'UserMailQueue'});db[_0x613f('0x129')][_0x613f('0x118')](db[_0x613f('0xdc')],{'through':_0x613f('0x160'),'as':'Teams'});db[_0x613f('0x3a')][_0x613f('0x10d')](db[_0x613f('0x3b')],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x161')});db[_0x613f('0x3a')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':'Account','foreignKey':_0x613f('0x157')});db[_0x613f('0x3a')]['belongsTo'](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x3a')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db['MailInteraction'][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x164'),'as':_0x613f('0x165')});db[_0x613f('0x3a')][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x164'),'as':_0x613f('0x166')});db[_0x613f('0x3a')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x167'),'through':_0x613f('0x11e'),'foreignKey':_0x613f('0x161')});db[_0x613f('0x3b')][_0x613f('0x10d')](db[_0x613f('0xe2')],{'as':_0x613f('0x168'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x3b')]['belongsTo'](db[_0x613f('0x11')],{'as':_0x613f('0x11')});db['MailMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x162')});db[_0x613f('0x3b')][_0x613f('0x117')](db[_0x613f('0x3a')],{'as':_0x613f('0x169'),'foreignKey':_0x613f('0x161')});db[_0x613f('0x3b')]['belongsTo'](db[_0x613f('0x132')],{'as':'Account','foreignKey':_0x613f('0x157')});db['MailMessage'][_0x613f('0x117')](db['ChatWebsite'],{'as':_0x613f('0x12e'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x613f('0x117')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x613f('0x16a')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x129')],{'onDelete':'restrict'});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x132')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x16c')});db[_0x613f('0x3d')][_0x613f('0x117')](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':'TagId'});db[_0x613f('0x3e')][_0x613f('0x117')](db[_0x613f('0x132')],{});db[_0x613f('0x3e')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId'});db[_0x613f('0x3e')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':'Contact','foreignKey':_0x613f('0x156')});db[_0x613f('0x3e')]['belongsTo'](db[_0x613f('0x3a')],{});db['MailQueueReport'][_0x613f('0x117')](db[_0x613f('0x3b')],{});db['MailQueueReport'][_0x613f('0x117')](db[_0x613f('0x11')],{});db[_0x613f('0x3e')]['belongsTo'](db[_0x613f('0x129')],{});db[_0x613f('0x40')][_0x613f('0x10d')](db[_0x613f('0x41')],{'as':_0x613f('0x16e'),'onDelete':_0x613f('0x10c')});db['FaxAccount'][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':'FaxAccountId','onDelete':_0x613f('0x10c')});db[_0x613f('0x43')][_0x613f('0x10d')](db[_0x613f('0x72')],{'as':'Answers','foreignKey':_0x613f('0x16f')});db[_0x613f('0x43')][_0x613f('0x10d')](db['FaxInteraction'],{'as':_0x613f('0x15c')});db[_0x613f('0x43')]['hasMany'](db['FaxApplication'],{'as':_0x613f('0x13f')});db[_0x613f('0x43')][_0x613f('0x10d')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x613f('0x10c')});db[_0x613f('0x43')]['hasMany'](db[_0x613f('0x49')],{'as':_0x613f('0x150')});db[_0x613f('0x43')][_0x613f('0x117')](db[_0x613f('0x22')],{'as':_0x613f('0x22')});db[_0x613f('0x43')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db['FaxAccount'][_0x613f('0x117')](db['Pause'],{'as':_0x613f('0x14a'),'foreignKey':_0x613f('0x170')});db[_0x613f('0x43')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x14c'),'through':_0x613f('0x171')});db['FaxApplication']['belongsTo'](db[_0x613f('0x11')],{'onDelete':'restrict'});db[_0x613f('0x45')][_0x613f('0x117')](db[_0x613f('0x4b')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x45')][_0x613f('0x117')](db[_0x613f('0x43')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x45')][_0x613f('0x117')](db['Tag'],{'onDelete':_0x613f('0x16b'),'foreignKey':'TagId'});db[_0x613f('0x47')][_0x613f('0x10d')](db[_0x613f('0x49')],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x172')});db[_0x613f('0x47')]['belongsTo'](db[_0x613f('0x43')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x16f')});db[_0x613f('0x47')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db[_0x613f('0x47')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x47')][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x174'),'as':_0x613f('0x165')});db[_0x613f('0x47')]['belongsToMany'](db[_0x613f('0x7f')],{'through':'fax_interaction_has_tags','as':_0x613f('0x166')});db['FaxInteraction'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x167'),'through':_0x613f('0x121'),'foreignKey':_0x613f('0x172')});db['FaxMessage'][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x10c'),'as':'User'});db[_0x613f('0x49')][_0x613f('0x117')](db[_0x613f('0x47')],{'as':_0x613f('0x169'),'foreignKey':_0x613f('0x172')});db[_0x613f('0x49')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':_0x613f('0x10c'),'as':'Contact'});db[_0x613f('0x49')][_0x613f('0x117')](db[_0x613f('0xe2')],{'as':_0x613f('0xe2'),'foreignKey':'AttachmentId'});db[_0x613f('0x49')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x613f('0x16f')});db['FaxQueue']['belongsToMany'](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'UserFaxQueue'});db['FaxQueue'][_0x613f('0x118')](db[_0x613f('0xdc')],{'through':'team_has_fax_queues','as':_0x613f('0x14d')});db[_0x613f('0x4d')][_0x613f('0x117')](db[_0x613f('0x43')],{});db[_0x613f('0x4d')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0x4d')][_0x613f('0x117')](db['CmContact'],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x4d')][_0x613f('0x117')](db[_0x613f('0x47')],{});db['FaxQueueReport'][_0x613f('0x117')](db[_0x613f('0x49')],{});db[_0x613f('0x4d')][_0x613f('0x117')](db['User'],{});db[_0x613f('0x4d')]['belongsTo'](db[_0x613f('0x4b')],{});db[_0x613f('0x4f')][_0x613f('0x10d')](db['Disposition'],{'as':_0x613f('0x15b'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x613f('0x4f')][_0x613f('0x10d')](db[_0x613f('0x72')],{'as':'Answers','foreignKey':_0x613f('0x175')});db[_0x613f('0x4f')]['hasMany'](db[_0x613f('0x55')],{'as':_0x613f('0x150'),'foreignKey':_0x613f('0x175')});db[_0x613f('0x4f')][_0x613f('0x10d')](db[_0x613f('0x53')],{'as':_0x613f('0x15c')});db['SmsAccount']['hasMany'](db[_0x613f('0x51')],{'as':_0x613f('0x13f')});db[_0x613f('0x4f')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':'List','foreignKey':_0x613f('0x15d')});db[_0x613f('0x4f')][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':_0x613f('0x170')});db[_0x613f('0x4f')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x176')});db[_0x613f('0x51')]['belongsTo'](db[_0x613f('0x11')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x51')][_0x613f('0x117')](db['SmsQueue'],{'onDelete':_0x613f('0x16b')});db[_0x613f('0x51')][_0x613f('0x117')](db[_0x613f('0x4f')],{'onDelete':'restrict'});db[_0x613f('0x51')][_0x613f('0x117')](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x16c')});db['SmsApplication'][_0x613f('0x117')](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x177')});db[_0x613f('0x53')][_0x613f('0x10d')](db['SmsMessage'],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x178')});db[_0x613f('0x53')]['belongsTo'](db['SmsAccount'],{'as':_0x613f('0x173'),'foreignKey':'SmsAccountId'});db[_0x613f('0x53')][_0x613f('0x117')](db['CmContact'],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db['SmsInteraction'][_0x613f('0x117')](db[_0x613f('0x11')],{'as':'Owner','foreignKey':'UserId'});db[_0x613f('0x53')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x179'),'as':'Tags'});db['SmsInteraction'][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x179'),'as':_0x613f('0x166')});db[_0x613f('0x53')][_0x613f('0x118')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x613f('0x55')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x11')});db[_0x613f('0x55')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':_0x613f('0x10c'),'as':'Contact'});db[_0x613f('0x55')][_0x613f('0x117')](db[_0x613f('0x53')],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x169'),'foreignKey':_0x613f('0x178')});db[_0x613f('0x55')][_0x613f('0x117')](db['SmsAccount'],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x175')});db['SmsQueue'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Agents','through':_0x613f('0x2f'),'foreignKey':_0x613f('0x17a')});db[_0x613f('0x57')]['belongsToMany'](db[_0x613f('0xdc')],{'through':_0x613f('0x17b'),'as':_0x613f('0x14d')});db[_0x613f('0x59')][_0x613f('0x10d')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0x613f('0x10c')});db['OpenchannelAccount'][_0x613f('0x10d')](db[_0x613f('0x72')],{'as':_0x613f('0x17c'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')]['hasMany'](db[_0x613f('0x122')],{'as':_0x613f('0x15c'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')][_0x613f('0x10d')](db[_0x613f('0x17e')],{'as':'Messages','foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')][_0x613f('0x10d')](db[_0x613f('0x17f')],{'as':_0x613f('0x13f'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x59')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db['OpenchannelAccount'][_0x613f('0x117')](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x613f('0x59')]['belongsToMany'](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'user_has_openchannel_accounts'});db[_0x613f('0x17f')][_0x613f('0x117')](db['User'],{'onDelete':'restrict'});db[_0x613f('0x17f')][_0x613f('0x117')](db[_0x613f('0x180')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x181')});db[_0x613f('0x17f')]['belongsTo'](db[_0x613f('0x59')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication']['belongsTo'](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x16c')});db[_0x613f('0x17f')][_0x613f('0x117')](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x177')});db[_0x613f('0x122')]['hasMany'](db[_0x613f('0x17e')],{'as':'Messages','onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x182')});db[_0x613f('0x122')][_0x613f('0x117')](db[_0x613f('0x59')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x17d')});db['OpenchannelInteraction'][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x122')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db[_0x613f('0x7f')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x613f('0x122')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x183'),'as':'ThroughTags'});db[_0x613f('0x122')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x167'),'through':_0x613f('0x124'),'foreignKey':_0x613f('0x182')});db[_0x613f('0x17e')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x10c'),'as':'User'});db[_0x613f('0x17e')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':'cascade','as':_0x613f('0x162')});db[_0x613f('0x17e')][_0x613f('0x117')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x613f('0x169'),'foreignKey':_0x613f('0x182')});db[_0x613f('0x17e')][_0x613f('0x117')](db[_0x613f('0xe2')],{'as':_0x613f('0xe2'),'foreignKey':_0x613f('0x184')});db[_0x613f('0x17e')]['belongsTo'](db[_0x613f('0x59')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x17d')});db[_0x613f('0x180')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Agents','through':_0x613f('0x12d'),'foreignKey':_0x613f('0x181')});db[_0x613f('0x180')]['belongsToMany'](db[_0x613f('0xdc')],{'through':_0x613f('0x185'),'as':'Teams'});db[_0x613f('0x12e')][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x186'),'onDelete':'cascade'});db[_0x613f('0x12e')][_0x613f('0x10d')](db['CannedAnswer'],{'as':_0x613f('0x17c'),'foreignKey':_0x613f('0x186')});db['ChatWebsite'][_0x613f('0x10d')](db[_0x613f('0x67')],{'as':_0x613f('0x187')});db['ChatWebsite'][_0x613f('0x10d')](db[_0x613f('0x11f')],{'as':_0x613f('0x15c')});db[_0x613f('0x12e')][_0x613f('0x10d')](db[_0x613f('0x188')],{'as':_0x613f('0x13f')});db[_0x613f('0x12e')][_0x613f('0x10d')](db[_0x613f('0x189')],{'as':'Messages'});db[_0x613f('0x12e')]['belongsTo'](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0x12e')][_0x613f('0x117')](db['Interval'],{'as':'Interval','foreignKey':_0x613f('0x16c')});db[_0x613f('0x12e')][_0x613f('0x117')](db[_0x613f('0x132')],{'as':_0x613f('0x132'),'foreignKey':'MailAccountId'});db[_0x613f('0x12e')]['belongsTo'](db[_0x613f('0x78')],{'as':_0x613f('0x14a'),'foreignKey':_0x613f('0x170')});db[_0x613f('0x12e')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'user_has_chat_websites'});db[_0x613f('0x5e')]['belongsTo'](db[_0x613f('0x59')],{});db[_0x613f('0x5e')][_0x613f('0x117')](db['CmList'],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0x5e')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db['OpenchannelQueueReport'][_0x613f('0x117')](db[_0x613f('0x122')],{});db[_0x613f('0x5e')][_0x613f('0x117')](db['OpenchannelMessage'],{});db[_0x613f('0x5e')][_0x613f('0x117')](db[_0x613f('0x11')],{});db[_0x613f('0x5e')]['belongsTo'](db[_0x613f('0x180')],{});db[_0x613f('0x188')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x18a'),'foreignKey':_0x613f('0x10f'),'onDelete':_0x613f('0x16b')});db[_0x613f('0x188')]['belongsTo'](db[_0x613f('0x18b')],{'as':_0x613f('0x18c'),'foreignKey':_0x613f('0x18d'),'onDelete':_0x613f('0x16b')});db['ChatApplication'][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':_0x613f('0x18e'),'foreignKey':_0x613f('0x186'),'onDelete':_0x613f('0x16b')});db[_0x613f('0x188')][_0x613f('0x117')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x613f('0x177')});db[_0x613f('0x11f')]['hasMany'](db['ChatMessage'],{'as':_0x613f('0x150'),'onDelete':'cascade','foreignKey':_0x613f('0x18f')});db[_0x613f('0x11f')][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x186')});db[_0x613f('0x11f')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db[_0x613f('0x11f')][_0x613f('0x117')](db['User'],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db[_0x613f('0x11f')]['belongsToMany'](db['Tag'],{'through':_0x613f('0x190'),'as':'Tags'});db['ChatInteraction'][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x190'),'as':_0x613f('0x166')});db[_0x613f('0x11f')]['belongsToMany'](db[_0x613f('0x11')],{'as':'Users','through':_0x613f('0x120'),'foreignKey':'ChatInteractionId'});db[_0x613f('0x189')][_0x613f('0x117')](db['User'],{'onDelete':'cascade','as':_0x613f('0x11')});db[_0x613f('0x189')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x613f('0x189')][_0x613f('0x117')](db[_0x613f('0x11f')],{'onDelete':_0x613f('0x10c'),'as':'Interaction','foreignKey':_0x613f('0x18f')});db[_0x613f('0x189')][_0x613f('0x117')](db[_0x613f('0xe2')],{'as':_0x613f('0xe2'),'foreignKey':_0x613f('0x184')});db['ChatMessage']['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x613f('0x62')][_0x613f('0x10d')](db[_0x613f('0xe2')],{'as':_0x613f('0x168'),'foreignKey':_0x613f('0x16a'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0x613f('0x155')],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x62')][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':'Account','foreignKey':_0x613f('0x186')});db[_0x613f('0x18b')][_0x613f('0x118')](db['User'],{'as':'Agents','through':_0x613f('0x2a'),'hooks':!![]});db[_0x613f('0x18b')][_0x613f('0x118')](db[_0x613f('0xdc')],{'through':_0x613f('0x191'),'as':'Teams'});db[_0x613f('0x65')][_0x613f('0x10d')](db['ChatInternalMessage'],{'as':_0x613f('0x150'),'foreignKey':_0x613f('0x192'),'onDelete':'cascade'});db[_0x613f('0x65')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x141'),'through':_0x613f('0x119')});db[_0x613f('0x67')][_0x613f('0x117')](db[_0x613f('0x12e')],{'as':'Website','foreignKey':_0x613f('0x186')});db[_0x613f('0x69')][_0x613f('0x10d')](db[_0x613f('0x155')],{'as':_0x613f('0x11a'),'foreignKey':_0x613f('0x193')});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x6b')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':_0x613f('0x110'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0x613f('0x10d')](db[_0x613f('0x111')],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x156')});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x145')],{'as':_0x613f('0x146'),'foreignKey':_0x613f('0x156')});db['CmContact'][_0x613f('0x10d')](db[_0x613f('0x122')],{'as':'OpenchannelInteractions','foreignKey':_0x613f('0x156'),'onDelete':'restrict'});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x11f')],{'as':_0x613f('0x112'),'foreignKey':'ContactId','onDelete':_0x613f('0x16b')});db[_0x613f('0x155')][_0x613f('0x10d')](db['SmsInteraction'],{'as':_0x613f('0x113'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x613f('0x155')][_0x613f('0x10d')](db[_0x613f('0x47')],{'as':_0x613f('0x194'),'foreignKey':_0x613f('0x156'),'onDelete':_0x613f('0x16b')});db[_0x613f('0x155')][_0x613f('0x10d')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['belongsTo'](db[_0x613f('0x69')],{'as':_0x613f('0x195'),'foreignKey':_0x613f('0x193')});db[_0x613f('0x155')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId','onDelete':_0x613f('0x10c')});db['CmContact'][_0x613f('0x118')](db[_0x613f('0x11')],{'as':'Users','through':_0x613f('0x196')});db['CmContact'][_0x613f('0x118')](db[_0x613f('0x7f')],{'as':'Tags','through':_0x613f('0x197')});db[_0x613f('0x155')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x197'),'as':_0x613f('0x166')});db[_0x613f('0x6b')][_0x613f('0x117')](db['CmContact'],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6b')]['belongsTo'](db[_0x613f('0xef')],{'as':'List','foreignKey':_0x613f('0x15d'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6b')]['belongsTo'](db['User'],{'as':_0x613f('0x18a'),'foreignKey':_0x613f('0x10f')});db[_0x613f('0x6b')][_0x613f('0x117')](db[_0x613f('0x126')],{'as':_0x613f('0x18c'),'foreignKey':_0x613f('0x142'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6b')]['belongsTo'](db[_0x613f('0xe0')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x613f('0x6b')]['belongsTo'](db[_0x613f('0x11')],{'as':'Owner','foreignKey':_0x613f('0x198')});db[_0x613f('0x6d')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId','onDelete':_0x613f('0x10c')});db[_0x613f('0x6d')]['belongsTo'](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId','onDelete':_0x613f('0x10c')});db['CmHopperBlack'][_0x613f('0x117')](db[_0x613f('0x126')],{'as':'Queue','foreignKey':_0x613f('0x142'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x6d')][_0x613f('0x117')](db[_0x613f('0xe0')],{'as':'Campaign','foreignKey':_0x613f('0x199'),'onDelete':'cascade'});db['Automation'][_0x613f('0x10d')](db[_0x613f('0x74')],{'as':{'plural':_0x613f('0x19a'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x613f('0x19b')]['hasMany'](db[_0x613f('0x74')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x613f('0x19c'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0x613f('0x19d'),'foreignKey':_0x613f('0x19e'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db[_0x613f('0x15a')][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x19f'),'onDelete':'cascade'});db[_0x613f('0x76')][_0x613f('0x10d')](db['Interval'],{'as':_0x613f('0x1a0'),'foreignKey':_0x613f('0x16c'),'onDelete':_0x613f('0x10c'),'hooks':!![],'required':![]});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':'Extensions','foreignKey':_0x613f('0x16c'),'onDelete':_0x613f('0x16b')});db['Interval'][_0x613f('0x10d')](db[_0x613f('0x3d')],{'as':_0x613f('0x1a1'),'foreignKey':_0x613f('0x16c')});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x188')],{'as':'ChatApplications','foreignKey':_0x613f('0x16c')});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x45')],{'as':_0x613f('0x1a2'),'foreignKey':'IntervalId'});db[_0x613f('0x76')][_0x613f('0x10d')](db[_0x613f('0x51')],{'as':_0x613f('0x1a3'),'foreignKey':_0x613f('0x16c')});db['Schedule']['belongsTo'](db[_0x613f('0x132')],{});db[_0x613f('0x7c')][_0x613f('0x117')](db[_0x613f('0x8c')],{'foreignKey':_0x613f('0x1a4')});db[_0x613f('0x7c')][_0x613f('0x117')](db['AnalyticCustomReport'],{'foreignKey':_0x613f('0x1a5')});db[_0x613f('0x7e')][_0x613f('0x118')](db['VoiceMusicOnHold'],{'as':_0x613f('0x1a6'),'through':'moh_has_sounds','onDelete':'restrict'});db['Tag'][_0x613f('0x118')](db[_0x613f('0x155')],{'through':'cm_contact_has_tags'});db[_0x613f('0x7f')][_0x613f('0x118')](db[_0x613f('0x11f')],{'through':'chat_interaction_has_tags'});db[_0x613f('0x7f')]['belongsToMany'](db[_0x613f('0x3a')],{'through':'mail_interaction_has_tags'});db[_0x613f('0x7f')][_0x613f('0x118')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x613f('0x7f')][_0x613f('0x118')](db[_0x613f('0x47')],{'through':_0x613f('0x174')});db[_0x613f('0x7f')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x613f('0x183')});db[_0x613f('0x7f')][_0x613f('0x118')](db[_0x613f('0xfc')],{'through':_0x613f('0x1a7')});db[_0x613f('0x82')][_0x613f('0x10d')](db['Condition'],{'as':{'plural':_0x613f('0x1a8'),'singular':_0x613f('0x1a9')},'foreignKey':'TriggerAllId','onDelete':_0x613f('0x10c'),'hooks':!![]});db['Trigger'][_0x613f('0x10d')](db[_0x613f('0x74')],{'as':{'plural':_0x613f('0x1aa'),'singular':'AnyCondition'},'foreignKey':_0x613f('0x1ab'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db[_0x613f('0x1ac')],{'as':_0x613f('0x19d'),'foreignKey':_0x613f('0x1ad'),'onDelete':_0x613f('0x10c'),'hooks':!![]});db['AnalyticCustomReport'][_0x613f('0x10d')](db[_0x613f('0x92')],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1a5'),'hooks':!![]});db[_0x613f('0x8c')][_0x613f('0x10d')](db[_0x613f('0x92')],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1a4')});db[_0x613f('0x90')][_0x613f('0x10d')](db['AnalyticFieldReport'],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1af')});db[_0x613f('0x92')][_0x613f('0x117')](db[_0x613f('0x90')],{'foreignKey':_0x613f('0x1af')});db[_0x613f('0x96')][_0x613f('0x10d')](db[_0x613f('0x98')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x98')][_0x613f('0x10d')](db['SalesforceField'],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x613f('0x10d')](db['SalesforceField'],{'as':_0x613f('0x1b3'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0x98')][_0x613f('0x10d')](db['SalesforceField'],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x98')][_0x613f('0x117')](db[_0x613f('0x96')],{'as':'Account','foreignKey':_0x613f('0x1b1')});db['SalesforceField']['hasMany'](db[_0x613f('0x9a')],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x9a')][_0x613f('0x10d')](db[_0x613f('0x9a')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db[_0x613f('0x9a')][_0x613f('0x10d')](db[_0x613f('0x9a')],{'as':'Field','foreignKey':_0x613f('0x1b5')});db['SalesforceField'][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':'VariableId'});db[_0x613f('0x9b')][_0x613f('0x10d')](db[_0x613f('0x9d')],{'as':'Configurations','onDelete':_0x613f('0x10c'),'foreignKey':'AccountId'});db[_0x613f('0x9d')][_0x613f('0x10d')](db['SugarcrmField'],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x9d')][_0x613f('0x10d')](db['SugarcrmField'],{'as':_0x613f('0x1b3'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x613f('0x9d')][_0x613f('0x10d')](db[_0x613f('0x9f')],{'as':'Fields','onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x9d')][_0x613f('0x117')](db[_0x613f('0x9b')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x9f')][_0x613f('0x10d')](db['SugarcrmField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db['SugarcrmField']['hasMany'](db[_0x613f('0x9f')],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db['SugarcrmField'][_0x613f('0x10d')](db[_0x613f('0x9f')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0x9f')][_0x613f('0x117')](db['Variable'],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db['DeskAccount'][_0x613f('0x10d')](db[_0x613f('0x1bb')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':'AccountId'});db[_0x613f('0x1bb')][_0x613f('0x10d')](db[_0x613f('0xa3')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x613f('0x1b7')});db['DeskConfiguration']['hasMany'](db[_0x613f('0xa3')],{'as':_0x613f('0x1b3'),'onDelete':'cascade','foreignKey':_0x613f('0x1b4')});db[_0x613f('0x1bb')]['hasMany'](db[_0x613f('0xa3')],{'as':_0x613f('0x1ae'),'onDelete':'cascade','foreignKey':_0x613f('0x1b5')});db['DeskConfiguration'][_0x613f('0x117')](db[_0x613f('0xa1')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x1bb')][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x1bc')});db[_0x613f('0xa3')][_0x613f('0x10d')](db[_0x613f('0xa3')],{'as':'Subject','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xa3')]['hasMany'](db[_0x613f('0xa3')],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db['DeskField'][_0x613f('0x10d')](db['DeskField'],{'as':_0x613f('0x1b9'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0xa3')][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0x1bd')][_0x613f('0x10d')](db[_0x613f('0x1be')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':'AccountId'});db[_0x613f('0x1be')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b2'),'onDelete':'cascade','foreignKey':_0x613f('0x1b7')});db[_0x613f('0x1be')]['hasMany'](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b3'),'onDelete':_0x613f('0x10c'),'foreignKey':'DescriptionId'});db[_0x613f('0x1be')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1ae'),'onDelete':_0x613f('0x10c'),'foreignKey':'FieldId'});db[_0x613f('0x1be')][_0x613f('0x117')](db[_0x613f('0x1bd')],{'as':_0x613f('0x173'),'foreignKey':'AccountId'});db[_0x613f('0x1bf')][_0x613f('0x10d')](db['ZohoField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x1bf')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db[_0x613f('0x1bf')][_0x613f('0x10d')](db[_0x613f('0x1bf')],{'as':_0x613f('0x1b9'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x1bf')][_0x613f('0x117')](db[_0x613f('0x84')],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db[_0x613f('0x1c0')][_0x613f('0x10d')](db['ZendeskConfiguration'],{'as':_0x613f('0x1b0'),'onDelete':'cascade','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xa8')]['hasMany'](db[_0x613f('0xaa')],{'as':_0x613f('0x1b2'),'foreignKey':'SubjectId'});db[_0x613f('0xa8')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':'Descriptions','foreignKey':_0x613f('0x1b4')});db[_0x613f('0xa8')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':_0x613f('0x1ae'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0xa8')][_0x613f('0x117')](db[_0x613f('0x1c0')],{'as':'Account','foreignKey':'AccountId'});db[_0x613f('0xa8')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':'int_zendesk_configuration_has_tags'});db[_0x613f('0xaa')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0xaa')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':'Description','foreignKey':_0x613f('0x1b4')});db[_0x613f('0xaa')][_0x613f('0x10d')](db[_0x613f('0xaa')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xaa')][_0x613f('0x117')](db['Variable'],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db['FreshdeskAccount'][_0x613f('0x10d')](db['FreshdeskConfiguration'],{'as':_0x613f('0x1b0'),'onDelete':'cascade','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xae')][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b7')});db['FreshdeskConfiguration'][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x613f('0x1b4')});db[_0x613f('0xae')][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1ae'),'onDelete':'cascade','foreignKey':_0x613f('0x1b5')});db['FreshdeskConfiguration'][_0x613f('0x117')](db[_0x613f('0xac')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0xae')][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x613f('0xb0')][_0x613f('0x10d')](db['FreshdeskField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db['FreshdeskField'][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db[_0x613f('0xb0')][_0x613f('0x10d')](db[_0x613f('0xb0')],{'as':_0x613f('0x1b9'),'foreignKey':_0x613f('0x1b5')});db['FreshdeskField'][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0xb2')][_0x613f('0x10d')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0xb4')]['hasMany'](db[_0x613f('0xb6')],{'as':_0x613f('0x1b2'),'foreignKey':'SubjectId'});db[_0x613f('0xb4')][_0x613f('0x10d')](db['VtigerField'],{'as':_0x613f('0x1b3'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xb4')][_0x613f('0x10d')](db[_0x613f('0xb6')],{'as':_0x613f('0x1ae'),'foreignKey':'FieldId'});db[_0x613f('0xb4')][_0x613f('0x117')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xb6')]['hasMany'](db[_0x613f('0xb6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x613f('0xb6')][_0x613f('0x10d')](db[_0x613f('0xb6')],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db[_0x613f('0xb6')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xb6')]['belongsTo'](db[_0x613f('0x84')],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db[_0x613f('0x1c1')][_0x613f('0x10d')](db['ServicenowConfiguration'],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0xb9')]['hasMany'](db[_0x613f('0xbb')],{'as':'Subjects','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xb9')][_0x613f('0x10d')](db[_0x613f('0xbb')],{'as':_0x613f('0x1b3'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xb9')][_0x613f('0x10d')](db[_0x613f('0xbb')],{'as':_0x613f('0x1ae'),'foreignKey':_0x613f('0x1b5')});db['ServicenowConfiguration'][_0x613f('0x117')](db[_0x613f('0x1c1')],{'as':'Account','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xbb')][_0x613f('0x10d')](db['ServicenowField'],{'as':_0x613f('0x1b6'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0xbb')]['hasMany'](db[_0x613f('0xbb')],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xbb')][_0x613f('0x10d')](db['ServicenowField'],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xbb')]['belongsTo'](db[_0x613f('0x84')],{'as':'Variable','foreignKey':_0x613f('0x1ba')});db[_0x613f('0xbd')]['hasMany'](db[_0x613f('0xbf')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db['Dynamics365Configuration']['hasMany'](db[_0x613f('0xc1')],{'as':_0x613f('0x1b2'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0xbf')]['hasMany'](db[_0x613f('0xc1')],{'as':'Descriptions','onDelete':_0x613f('0x10c'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x613f('0x10d')](db[_0x613f('0xc1')],{'as':_0x613f('0x1ae'),'onDelete':'cascade','foreignKey':_0x613f('0x1b5')});db[_0x613f('0xbf')]['belongsTo'](db[_0x613f('0xbd')],{'as':'Account','foreignKey':'AccountId'});db[_0x613f('0xc1')][_0x613f('0x10d')](db[_0x613f('0xc1')],{'as':'Subject','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xc1')][_0x613f('0x10d')](db['Dynamics365Field'],{'as':_0x613f('0x1b8'),'foreignKey':_0x613f('0x1b4')});db[_0x613f('0xc1')][_0x613f('0x10d')](db[_0x613f('0xc1')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xc1')][_0x613f('0x117')](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0xc2')][_0x613f('0x10d')](db[_0x613f('0x1c2')],{'as':_0x613f('0x1b0'),'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1b1')});db[_0x613f('0x1c2')]['hasMany'](db['FreshsalesField'],{'as':_0x613f('0x1b2'),'foreignKey':_0x613f('0x1b7')});db[_0x613f('0x1c2')][_0x613f('0x10d')](db[_0x613f('0xc4')],{'as':'Descriptions','foreignKey':_0x613f('0x1b4')});db[_0x613f('0x1c2')][_0x613f('0x10d')](db[_0x613f('0xc4')],{'as':_0x613f('0x1ae'),'foreignKey':_0x613f('0x1b5')});db[_0x613f('0x1c2')][_0x613f('0x117')](db[_0x613f('0xc2')],{'as':'Account','foreignKey':_0x613f('0x1b1')});db[_0x613f('0xc4')][_0x613f('0x10d')](db[_0x613f('0xc4')],{'as':'Subject','foreignKey':_0x613f('0x1b7')});db[_0x613f('0xc4')]['hasMany'](db[_0x613f('0xc4')],{'as':_0x613f('0x1b8'),'foreignKey':'DescriptionId'});db['FreshsalesField']['hasMany'](db[_0x613f('0xc4')],{'as':_0x613f('0x1b9'),'foreignKey':'FieldId'});db[_0x613f('0xc4')]['belongsTo'](db[_0x613f('0x84')],{'as':_0x613f('0x84'),'foreignKey':_0x613f('0x1ba')});db[_0x613f('0xc6')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':'ListId'});db[_0x613f('0xc6')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db[_0x613f('0xc6')]['belongsTo'](db[_0x613f('0x11f')],{});db[_0x613f('0xc6')]['belongsTo'](db[_0x613f('0x189')],{});db[_0x613f('0xc6')][_0x613f('0x117')](db[_0x613f('0x11')],{});db[_0x613f('0xc6')][_0x613f('0x117')](db['ChatQueue'],{});db[_0x613f('0xc7')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':'cascade','foreignKey':_0x613f('0x1c3')});db[_0x613f('0xc7')][_0x613f('0x117')](db[_0x613f('0x11')],{'onDelete':_0x613f('0x10c'),'foreignKey':_0x613f('0x1c4')});db[_0x613f('0x145')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0x613f('0x10d')](db['JscriptyAnswerReport'],{'foreignKey':_0x613f('0x1c5'),'onDelete':_0x613f('0x10c')});db[_0x613f('0xcd')][_0x613f('0x117')](db[_0x613f('0x4f')],{});db['SmsQueueReport'][_0x613f('0x117')](db['CmList'],{'as':'List','foreignKey':_0x613f('0x15d')});db[_0x613f('0xcd')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':_0x613f('0x156')});db[_0x613f('0xcd')]['belongsTo'](db[_0x613f('0x53')],{});db['SmsQueueReport'][_0x613f('0x117')](db[_0x613f('0x55')],{});db[_0x613f('0xcd')]['belongsTo'](db['User'],{});db[_0x613f('0xcd')][_0x613f('0x117')](db[_0x613f('0x57')],{});db['JscriptyProject'][_0x613f('0x10d')](db[_0x613f('0x145')],{'foreignKey':_0x613f('0x1c6')});db[_0x613f('0xd2')][_0x613f('0x10d')](db[_0x613f('0xca')],{'foreignKey':'ProjectId'});db[_0x613f('0xd2')][_0x613f('0x10d')](db[_0x613f('0xc8')],{'foreignKey':_0x613f('0x1c6')});db[_0x613f('0x139')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x167'),'through':'user_has_square_projects'});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':'user_has_teams'});db[_0x613f('0xdc')][_0x613f('0x118')](db['VoiceQueue'],{'through':_0x613f('0x106'),'as':_0x613f('0x1c7')});db[_0x613f('0xdc')]['belongsToMany'](db['MailQueue'],{'through':_0x613f('0x160'),'as':_0x613f('0x1c8')});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x18b')],{'through':_0x613f('0x191'),'as':_0x613f('0x12a')});db[_0x613f('0xdc')]['belongsToMany'](db[_0x613f('0x4b')],{'through':'team_has_fax_queues','as':_0x613f('0x1c9')});db['Team']['belongsToMany'](db[_0x613f('0x57')],{'through':_0x613f('0x17b'),'as':_0x613f('0x12b')});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x180')],{'through':_0x613f('0x185'),'as':_0x613f('0x12c')});db['Team'][_0x613f('0x118')](db[_0x613f('0x102')],{'through':_0x613f('0x1ca'),'as':_0x613f('0x1cb')});db[_0x613f('0xdc')][_0x613f('0x118')](db[_0x613f('0x127')],{'through':_0x613f('0x1cc'),'as':_0x613f('0x1cd')});db[_0x613f('0xe0')][_0x613f('0x10d')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x613f('0xe0')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':'HopperFinals','foreignKey':_0x613f('0x199')});db[_0x613f('0xe0')][_0x613f('0x10d')](db[_0x613f('0x70')],{'as':_0x613f('0x144'),'foreignKey':'CampaignId'});db[_0x613f('0xe0')][_0x613f('0x10d')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x613f('0x199')});db[_0x613f('0xe0')][_0x613f('0x117')](db[_0x613f('0x22')],{'as':_0x613f('0x22'),'foreignKey':'TrunkId'});db['Campaign'][_0x613f('0x117')](db[_0x613f('0x22')],{'as':_0x613f('0x148'),'foreignKey':'TrunkBackupId'});db[_0x613f('0xe0')][_0x613f('0x117')](db[_0x613f('0x76')],{'as':'Interval','foreignKey':_0x613f('0x16c')});db['Campaign']['belongsTo'](db[_0x613f('0x139')],{'as':'SquareProject','foreignKey':_0x613f('0x1ce')});db[_0x613f('0xe0')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x11b'),'through':'campaigns_has_cm_lists'});db[_0x613f('0xe0')][_0x613f('0x118')](db[_0x613f('0xef')],{'as':_0x613f('0x14e'),'through':_0x613f('0x1cf')});db[_0x613f('0xe2')][_0x613f('0x117')](db[_0x613f('0x62')],{'as':_0x613f('0x62'),'foreignKey':_0x613f('0x16a')});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x3b')],{});db[_0x613f('0xe6')]['belongsTo'](db['MailInteraction'],{});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x132')],{'foreignKey':_0x613f('0x1d0'),'as':_0x613f('0x1d1')});db[_0x613f('0xe6')][_0x613f('0x117')](db['User'],{'foreignKey':_0x613f('0x1d2'),'as':_0x613f('0x1d3')});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':'ToUserId','as':_0x613f('0x1d4')});db['MailTransferReport']['belongsTo'](db[_0x613f('0x129')],{'foreignKey':_0x613f('0x1d5'),'as':_0x613f('0x1d6')});db[_0x613f('0xe6')][_0x613f('0x117')](db[_0x613f('0x132')],{'foreignKey':_0x613f('0x1d7'),'as':_0x613f('0x1d8')});db[_0x613f('0xe8')][_0x613f('0x117')](db[_0x613f('0x189')],{});db[_0x613f('0xe8')][_0x613f('0x117')](db['ChatInteraction'],{});db[_0x613f('0xe8')][_0x613f('0x117')](db[_0x613f('0x12e')],{'foreignKey':_0x613f('0x1d9'),'as':_0x613f('0x1d1')});db[_0x613f('0xe8')][_0x613f('0x117')](db['User'],{'foreignKey':'FromUserId','as':_0x613f('0x1d3')});db[_0x613f('0xe8')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':'ToUserId','as':_0x613f('0x1d4')});db[_0x613f('0xe8')][_0x613f('0x117')](db['ChatQueue'],{'foreignKey':_0x613f('0x1da'),'as':_0x613f('0x1d6')});db[_0x613f('0xe8')]['belongsTo'](db[_0x613f('0x12e')],{'foreignKey':'ToChatWebsiteId','as':_0x613f('0x1d8')});db[_0x613f('0xea')]['belongsTo'](db[_0x613f('0x49')],{});db[_0x613f('0xea')]['belongsTo'](db[_0x613f('0x47')],{});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x43')],{'foreignKey':'FromFaxAccountId','as':_0x613f('0x1d1')});db[_0x613f('0xea')]['belongsTo'](db['User'],{'foreignKey':_0x613f('0x1d2'),'as':'FromAgent'});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x4b')],{'foreignKey':_0x613f('0x1dc'),'as':_0x613f('0x1d6')});db[_0x613f('0xea')][_0x613f('0x117')](db[_0x613f('0x43')],{'foreignKey':_0x613f('0x1dd'),'as':_0x613f('0x1d8')});db[_0x613f('0x1de')]['belongsTo'](db[_0x613f('0x17e')],{});db[_0x613f('0x1de')][_0x613f('0x117')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x613f('0x117')](db[_0x613f('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':_0x613f('0x1d1')});db['OpenchannelTransferReport'][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1d2'),'as':_0x613f('0x1d3')});db['OpenchannelTransferReport'][_0x613f('0x117')](db['User'],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db['OpenchannelTransferReport']['belongsTo'](db[_0x613f('0x180')],{'foreignKey':_0x613f('0x1df'),'as':_0x613f('0x1d6')});db[_0x613f('0x1de')]['belongsTo'](db[_0x613f('0x59')],{'foreignKey':_0x613f('0x1e0'),'as':_0x613f('0x1d8')});db[_0x613f('0xed')][_0x613f('0x117')](db[_0x613f('0x55')],{});db[_0x613f('0xed')][_0x613f('0x117')](db[_0x613f('0x53')],{});db[_0x613f('0xed')][_0x613f('0x117')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x613f('0xed')]['belongsTo'](db['User'],{'foreignKey':_0x613f('0x1d2'),'as':_0x613f('0x1d3')});db['SmsTransferReport'][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db['SmsTransferReport']['belongsTo'](db['SmsQueue'],{'foreignKey':_0x613f('0x1e1'),'as':_0x613f('0x1d6')});db['SmsTransferReport'][_0x613f('0x117')](db[_0x613f('0x4f')],{'foreignKey':_0x613f('0x1e2'),'as':_0x613f('0x1d8')});db['CmList'][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x15d'),'onDelete':_0x613f('0x10c')});db['CmList']['hasMany'](db[_0x613f('0x1e3')],{'as':_0x613f('0x1e4'),'foreignKey':'ListId'});db[_0x613f('0xef')][_0x613f('0x10d')](db[_0x613f('0x155')],{'as':_0x613f('0x11a'),'onDelete':_0x613f('0x10c'),'foreignKey':'ListId'});db[_0x613f('0xef')][_0x613f('0x10d')](db[_0x613f('0x6f')],{'as':_0x613f('0x110'),'foreignKey':_0x613f('0x15d')});db['CmList'][_0x613f('0x10d')](db['CmHopperHistory'],{'as':_0x613f('0x1e5'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0xef')]['hasMany'](db['ReportAgentPreview'],{'as':_0x613f('0x111'),'foreignKey':_0x613f('0x15d')});db[_0x613f('0xef')][_0x613f('0x118')](db['VoiceQueue'],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x613f('0xef')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x11c')});db['VoicePrefix'][_0x613f('0x10d')](db[_0x613f('0x15')],{'as':_0x613f('0x1e6'),'onDelete':_0x613f('0x10c')});db[_0x613f('0x127')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x128')});db[_0x613f('0x127')][_0x613f('0x118')](db['Team'],{'through':_0x613f('0x1cc'),'as':_0x613f('0x14d')});db['UserProfile']['hasMany'](db[_0x613f('0x11')],{'as':_0x613f('0x167'),'foreignKey':_0x613f('0x1e7')});db[_0x613f('0xf1')]['hasMany'](db[_0x613f('0xf3')],{'as':_0x613f('0x1e8'),'foreignKey':_0x613f('0x1e7'),'onDelete':'cascade'});db[_0x613f('0xf3')][_0x613f('0x10d')](db[_0x613f('0xf5')],{'as':'Resources','foreignKey':_0x613f('0x1e9'),'onDelete':'cascade'});db['WhatsappAccount'][_0x613f('0x10d')](db[_0x613f('0x15a')],{'as':_0x613f('0x15b'),'foreignKey':_0x613f('0x1ea'),'onDelete':_0x613f('0x10c')});db[_0x613f('0xf8')]['hasMany'](db[_0x613f('0x72')],{'as':_0x613f('0x17c'),'foreignKey':_0x613f('0x1ea')});db[_0x613f('0xf8')]['hasMany'](db[_0x613f('0xfe')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x613f('0xf8')][_0x613f('0x10d')](db['WhatsappInteraction'],{'as':_0x613f('0x15c')});db['WhatsappAccount'][_0x613f('0x10d')](db[_0x613f('0xfa')],{'as':_0x613f('0x13f')});db[_0x613f('0xf8')][_0x613f('0x117')](db[_0x613f('0xef')],{'as':'List','foreignKey':'ListId'});db[_0x613f('0xf8')][_0x613f('0x117')](db['Pause'],{'as':_0x613f('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount']['belongsToMany'](db['User'],{'as':'Agents','through':_0x613f('0x138')});db[_0x613f('0xfa')]['belongsTo'](db[_0x613f('0x11')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0xfa')][_0x613f('0x117')](db[_0x613f('0x102')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0xfa')][_0x613f('0x117')](db[_0x613f('0xf8')],{'onDelete':_0x613f('0x16b')});db[_0x613f('0xfa')][_0x613f('0x117')](db[_0x613f('0x76')],{'onDelete':_0x613f('0x16b'),'foreignKey':'IntervalId'});db[_0x613f('0xfa')]['belongsTo'](db[_0x613f('0x7f')],{'onDelete':_0x613f('0x16b'),'foreignKey':_0x613f('0x177')});db['WhatsappInteraction'][_0x613f('0x10d')](db[_0x613f('0xfe')],{'as':_0x613f('0x150'),'onDelete':_0x613f('0x10c'),'foreignKey':'WhatsappInteractionId'});db[_0x613f('0xfc')][_0x613f('0x117')](db[_0x613f('0xf8')],{'as':_0x613f('0x173'),'foreignKey':_0x613f('0x1ea')});db[_0x613f('0xfc')][_0x613f('0x117')](db[_0x613f('0x155')],{'as':_0x613f('0x162'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x163'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x613f('0x118')](db['Tag'],{'through':_0x613f('0x1a7'),'as':_0x613f('0x165')});db['WhatsappInteraction'][_0x613f('0x118')](db[_0x613f('0x7f')],{'through':_0x613f('0x1a7'),'as':'ThroughTags'});db[_0x613f('0xfc')][_0x613f('0x118')](db['User'],{'as':_0x613f('0x167'),'through':_0x613f('0x125'),'foreignKey':_0x613f('0x1eb')});db[_0x613f('0xfe')][_0x613f('0x117')](db[_0x613f('0x11')],{'as':_0x613f('0x11')});db[_0x613f('0xfe')][_0x613f('0x117')](db[_0x613f('0x155')],{'onDelete':'cascade','as':_0x613f('0x162')});db[_0x613f('0xfe')][_0x613f('0x117')](db['WhatsappInteraction'],{'onDelete':_0x613f('0x10c'),'as':_0x613f('0x169'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x613f('0x117')](db['WhatsappAccount'],{'as':_0x613f('0x173'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x613f('0x117')](db[_0x613f('0xf8')],{});db['WhatsappQueueReport'][_0x613f('0x117')](db[_0x613f('0xef')],{'as':_0x613f('0x16d'),'foreignKey':_0x613f('0x15d')});db['WhatsappQueueReport']['belongsTo'](db[_0x613f('0x155')],{'as':'Contact','foreignKey':_0x613f('0x156')});db['WhatsappQueueReport'][_0x613f('0x117')](db[_0x613f('0xfc')],{});db[_0x613f('0xff')]['belongsTo'](db[_0x613f('0x102')],{});db[_0x613f('0xff')]['belongsTo'](db['WhatsappMessage'],{});db[_0x613f('0xff')][_0x613f('0x117')](db['User'],{});db[_0x613f('0x1ec')][_0x613f('0x117')](db[_0x613f('0xfe')],{});db[_0x613f('0x1ec')]['belongsTo'](db[_0x613f('0xfc')],{});db['WhatsappTransferReport'][_0x613f('0x117')](db[_0x613f('0xf8')],{'foreignKey':'FromWhatsappAccountId','as':_0x613f('0x1d1')});db[_0x613f('0x1ec')][_0x613f('0x117')](db[_0x613f('0xf8')],{'foreignKey':'ToWhatsappAccountId','as':_0x613f('0x1d8')});db['WhatsappTransferReport'][_0x613f('0x117')](db[_0x613f('0x102')],{'foreignKey':'ToQueueId','as':_0x613f('0x1d6')});db[_0x613f('0x1ec')][_0x613f('0x117')](db[_0x613f('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x613f('0x1ec')]['belongsTo'](db[_0x613f('0x11')],{'foreignKey':_0x613f('0x1db'),'as':_0x613f('0x1d4')});db[_0x613f('0x102')][_0x613f('0x118')](db[_0x613f('0x11')],{'as':_0x613f('0x14c'),'through':_0x613f('0x32'),'foreignKey':_0x613f('0x1ed')});db[_0x613f('0x102')]['belongsToMany'](db[_0x613f('0xdc')],{'through':_0x613f('0x1ca'),'as':_0x613f('0x14d')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a6923e5..331dd36 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b21=['/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/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/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/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/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','get','/index.html','username','password','apiKey','firstName','street','fax','email','clientId','code','accessKey','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','exten','privateKey','accesskeyid','accountSid','localstationid','dsn','secret','registry','oldPassword','isArray','isPlainObject','@@{','replace','path','express','express-winston','util','./errors','./config/environment','api','./safe-template','safeTemplate','use','logger','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','other','agent_id','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail'];(function(_0x232c8a,_0x67b4ea){var _0x373553=function(_0x1c86e4){while(--_0x1c86e4){_0x232c8a['push'](_0x232c8a['shift']());}};_0x373553(++_0x67b4ea);}(_0x6b21,0x112));var _0x16b2=function(_0x293ff8,_0x5cbc46){_0x293ff8=_0x293ff8-0x0;var _0x552722=_0x6b21[_0x293ff8];return _0x552722;};'use strict';var _=require('lodash');var path=require(_0x16b2('0x0'));var express=require(_0x16b2('0x1'));var ewinston=require(_0x16b2('0x2'));var util=require(_0x16b2('0x3'));var errors=require(_0x16b2('0x4'));var config=require(_0x16b2('0x5'));var logger=require('./config/logger')(_0x16b2('0x6'));var authLogger=require('./config/logger')('auth');var safeTemplate=require(_0x16b2('0x7'))[_0x16b2('0x8')];exports['default']=function(_0x360e97){_0x360e97[_0x16b2('0x9')](ewinston[_0x16b2('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x223cf0,_0x14dea1){var _0x13104e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x16b2('0xb')](_0x223cf0[_0x16b2('0xc')])){_0x13104e+='\x20body=%s';var _0x563761=_0x223cf0['body'];maskSensitiveData(_0x563761);}return safeTemplate(util[_0x16b2('0xd')](_0x13104e,_0x223cf0[_0x16b2('0xe')],_0x223cf0[_0x16b2('0xf')][_0x16b2('0x10')]?_0x223cf0[_0x16b2('0xf')][_0x16b2('0x10')]:_0x223cf0[_0x16b2('0x11')][_0x16b2('0x12')]||_0x223cf0['ip'],_0x223cf0[_0x16b2('0x13')],_0x14dea1[_0x16b2('0x14')],_0x14dea1[_0x16b2('0x15')],_0x223cf0[_0x16b2('0x16')]?_0x223cf0[_0x16b2('0x16')]['id']:null,_0x223cf0[_0x16b2('0x16')]?_0x223cf0['user'][_0x16b2('0x17')]:null,_0x223cf0['user']?_0x223cf0[_0x16b2('0x16')][_0x16b2('0x18')]:null,_0x563761?util[_0x16b2('0x19')](_0x563761,![],null):''));}}));_0x360e97[_0x16b2('0x9')](ewinston[_0x16b2('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x55517b,_0x3d3aa9){var _0x450016=_0x16b2('0x1a');if(_0x55517b[_0x16b2('0xc')]&&_0x55517b['body']['device']&&_0x55517b['body']['agent_id']){_0x450016='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x450016,_0x55517b[_0x16b2('0xe')],_0x55517b['headers']['x-forwarded-for']?_0x55517b[_0x16b2('0xf')][_0x16b2('0x10')]:_0x55517b[_0x16b2('0x11')][_0x16b2('0x12')]||_0x55517b['ip'],_0x55517b[_0x16b2('0x13')],_0x3d3aa9['statusCode'],_0x3d3aa9[_0x16b2('0x15')],_0x55517b[_0x16b2('0x16')]?_0x55517b['user']['id']:null,_0x55517b[_0x16b2('0x16')]?_0x55517b[_0x16b2('0x16')][_0x16b2('0x17')]:null,_0x55517b[_0x16b2('0x16')]?_0x55517b[_0x16b2('0x16')]['role']:null,_0x55517b[_0x16b2('0xc')]&&_0x55517b[_0x16b2('0xc')][_0x16b2('0x1b')]?_0x55517b[_0x16b2('0xc')][_0x16b2('0x1b')]:_0x16b2('0x1c'),_0x55517b['body']&&_0x55517b[_0x16b2('0xc')][_0x16b2('0x1d')]?_0x55517b[_0x16b2('0xc')][_0x16b2('0x1d')]:'',_0x55517b[_0x16b2('0xc')]&&_0x55517b[_0x16b2('0xc')]['agent_name']?_0x55517b[_0x16b2('0xc')][_0x16b2('0x1e')]:'');},'ignoreRoute':function(_0x23084e){var _0x588fa6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x588fa6[_0x16b2('0x1f')](_0x23084e[_0x16b2('0x13')]);}}));_0x360e97[_0x16b2('0x9')]('/api/users',require(_0x16b2('0x20')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x21'),require(_0x16b2('0x22')));_0x360e97[_0x16b2('0x9')]('/api/voice/contexts',require(_0x16b2('0x23')));_0x360e97[_0x16b2('0x9')]('/api/voice/extensions',require(_0x16b2('0x24')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x25'),require(_0x16b2('0x26')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x27'),require(_0x16b2('0x28')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x29'),require(_0x16b2('0x2a')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x2b'),require(_0x16b2('0x2c')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x2d'),require(_0x16b2('0x2e')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x2f'),require(_0x16b2('0x30')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x31'),require('./api/voiceCallReport'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x32'),require('./api/voiceDialReport'));_0x360e97[_0x16b2('0x9')]('/api/voice/agents/reports',require(_0x16b2('0x33')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x34'),require(_0x16b2('0x35')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x36'),require(_0x16b2('0x37')));_0x360e97['use']('/api/trunks',require('./api/trunk'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x38'),require(_0x16b2('0x39')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x3a'),require(_0x16b2('0x3b')));_0x360e97['use'](_0x16b2('0x3c'),require(_0x16b2('0x3d')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x3e'),require(_0x16b2('0x3f')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x40'),require('./api/mailSubstatus'));_0x360e97[_0x16b2('0x9')]('/api/mail/interactions',require(_0x16b2('0x41')));_0x360e97[_0x16b2('0x9')]('/api/mail/messages',require(_0x16b2('0x42')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x43'),require(_0x16b2('0x44')));_0x360e97['use']('/api/mail/reports/queue',require(_0x16b2('0x45')));_0x360e97[_0x16b2('0x9')]('/api/dashboards',require(_0x16b2('0x46')));_0x360e97[_0x16b2('0x9')]('/api/dashboards/items',require(_0x16b2('0x47')));_0x360e97['use'](_0x16b2('0x48'),require(_0x16b2('0x49')));_0x360e97[_0x16b2('0x9')]('/api/fax/applications',require('./api/faxApplication'));_0x360e97[_0x16b2('0x9')]('/api/fax/interactions',require(_0x16b2('0x4a')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x4b'),require(_0x16b2('0x4c')));_0x360e97['use'](_0x16b2('0x4d'),require(_0x16b2('0x4e')));_0x360e97[_0x16b2('0x9')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x4f'),require(_0x16b2('0x50')));_0x360e97[_0x16b2('0x9')]('/api/sms/applications',require('./api/smsApplication'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x51'),require(_0x16b2('0x52')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x53'),require(_0x16b2('0x54')));_0x360e97[_0x16b2('0x9')]('/api/sms/queues',require(_0x16b2('0x55')));_0x360e97['use'](_0x16b2('0x56'),require(_0x16b2('0x57')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x58'),require('./api/openchannelApplication'));_0x360e97[_0x16b2('0x9')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x59'),require(_0x16b2('0x5a')));_0x360e97['use'](_0x16b2('0x5b'),require('./api/openchannelQueue'));_0x360e97['use']('/api/chat/websites',require(_0x16b2('0x5c')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x5d'),require(_0x16b2('0x5e')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x5f'),require(_0x16b2('0x60')));_0x360e97[_0x16b2('0x9')]('/api/chat/interactions',require(_0x16b2('0x61')));_0x360e97[_0x16b2('0x9')]('/api/chat/messages',require('./api/chatMessage'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x62'),require(_0x16b2('0x63')));_0x360e97[_0x16b2('0x9')]('/api/chat/queues',require('./api/chatQueue'));_0x360e97['use'](_0x16b2('0x64'),require(_0x16b2('0x65')));_0x360e97['use']('/api/chat/proactive_actions',require(_0x16b2('0x66')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x67'),require(_0x16b2('0x68')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x69'),require(_0x16b2('0x6a')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x6b'),require(_0x16b2('0x6c')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x6d'),require('./api/cmHopperBlack'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x6e'),require(_0x16b2('0x6f')));_0x360e97['use'](_0x16b2('0x70'),require(_0x16b2('0x71')));_0x360e97[_0x16b2('0x9')]('/api/cm/custom_fields',require(_0x16b2('0x72')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x73'),require(_0x16b2('0x74')));_0x360e97[_0x16b2('0x9')]('/api/automations',require(_0x16b2('0x75')));_0x360e97['use'](_0x16b2('0x76'),require(_0x16b2('0x77')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x78'),require(_0x16b2('0x79')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x7a'),require(_0x16b2('0x7b')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x7c'),require(_0x16b2('0x7d')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x7e'),require(_0x16b2('0x7f')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x80'),require('./api/cdr'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x81'),require(_0x16b2('0x82')));_0x360e97['use'](_0x16b2('0x83'),require(_0x16b2('0x84')));_0x360e97[_0x16b2('0x9')]('/api/sounds',require(_0x16b2('0x85')));_0x360e97['use'](_0x16b2('0x86'),require(_0x16b2('0x87')));_0x360e97['use']('/api/templates',require(_0x16b2('0x88')));_0x360e97['use'](_0x16b2('0x89'),require(_0x16b2('0x8a')));_0x360e97['use'](_0x16b2('0x8b'),require('./api/variable'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x8c'),require(_0x16b2('0x8d')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x8e'),require('./api/integrationReport'));_0x360e97['use'](_0x16b2('0x8f'),require(_0x16b2('0x90')));_0x360e97['use'](_0x16b2('0x91'),require('./api/analyticDefaultReport'));_0x360e97['use']('/api/analytics/extracted_reports',require(_0x16b2('0x92')));_0x360e97[_0x16b2('0x9')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x360e97['use'](_0x16b2('0x93'),require(_0x16b2('0x94')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x95'),require(_0x16b2('0x96')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x97'),require(_0x16b2('0x98')));_0x360e97[_0x16b2('0x9')]('/api/integrations/salesforce/configurations',require(_0x16b2('0x99')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x9a'),require(_0x16b2('0x9b')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x9c'),require(_0x16b2('0x9d')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x9e'),require('./api/intSugarcrmConfiguration'));_0x360e97['use'](_0x16b2('0x9f'),require('./api/intSugarcrmField'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xa0'),require(_0x16b2('0xa1')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xa2'),require(_0x16b2('0xa3')));_0x360e97[_0x16b2('0x9')]('/api/integrations/desk/fields',require(_0x16b2('0xa4')));_0x360e97['use'](_0x16b2('0xa5'),require(_0x16b2('0xa6')));_0x360e97[_0x16b2('0x9')]('/api/integrations/zoho/configurations',require(_0x16b2('0xa7')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xa8'),require(_0x16b2('0xa9')));_0x360e97['use']('/api/integrations/zendesk/accounts',require(_0x16b2('0xaa')));_0x360e97['use'](_0x16b2('0xab'),require(_0x16b2('0xac')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xad'),require(_0x16b2('0xae')));_0x360e97[_0x16b2('0x9')]('/api/integrations/freshdesk/accounts',require(_0x16b2('0xaf')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xb0'),require(_0x16b2('0xb1')));_0x360e97[_0x16b2('0x9')]('/api/integrations/freshdesk/fields',require(_0x16b2('0xb2')));_0x360e97['use'](_0x16b2('0xb3'),require(_0x16b2('0xb4')));_0x360e97[_0x16b2('0x9')]('/api/integrations/vtiger/configurations',require(_0x16b2('0xb5')));_0x360e97[_0x16b2('0x9')]('/api/integrations/vtiger/fields',require(_0x16b2('0xb6')));_0x360e97['use'](_0x16b2('0xb7'),require(_0x16b2('0xb8')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xb9'),require(_0x16b2('0xba')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xbb'),require(_0x16b2('0xbc')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xbd'),require(_0x16b2('0xbe')));_0x360e97['use']('/api/integrations/dynamics365/configurations',require(_0x16b2('0xbf')));_0x360e97[_0x16b2('0x9')]('/api/integrations/dynamics365/fields',require(_0x16b2('0xc0')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xc1'),require(_0x16b2('0xc2')));_0x360e97[_0x16b2('0x9')]('/api/integrations/freshsales/configurations',require(_0x16b2('0xc3')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xc4'),require(_0x16b2('0xc5')));_0x360e97['use']('/api/networks',require(_0x16b2('0xc6')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xc7'),require(_0x16b2('0xc8')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xc9'),require(_0x16b2('0xca')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xcb'),require('./api/jscriptyAnswerReport'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xcc'),require(_0x16b2('0xcd')));_0x360e97['use'](_0x16b2('0xce'),require(_0x16b2('0xcf')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xd0'),require(_0x16b2('0xd1')));_0x360e97['use']('/api/square/reports',require(_0x16b2('0xd2')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xd3'),require(_0x16b2('0xd4')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xd5'),require('./api/jscriptyProject'));_0x360e97['use'](_0x16b2('0xd6'),require(_0x16b2('0xd7')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xd8'),require('./api/squareOdbc'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xd9'),require(_0x16b2('0xda')));_0x360e97[_0x16b2('0x9')]('/api/square/recordings',require('./api/squareRecording'));_0x360e97['use'](_0x16b2('0xdb'),require(_0x16b2('0xdc')));_0x360e97['use'](_0x16b2('0xdd'),require('./api/team'));_0x360e97['use']('/api/license',require(_0x16b2('0xde')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xdf'),require(_0x16b2('0xe0')));_0x360e97['use'](_0x16b2('0xe1'),require(_0x16b2('0xe2')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xe3'),require(_0x16b2('0xe4')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xe5'),require(_0x16b2('0xe6')));_0x360e97['use'](_0x16b2('0xe7'),require('./api/mailTransferReport'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xe8'),require(_0x16b2('0xe9')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xea'),require(_0x16b2('0xeb')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xec'),require(_0x16b2('0xed')));_0x360e97['use'](_0x16b2('0xee'),require('./api/smsTransferReport'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xef'),require(_0x16b2('0xf0')));_0x360e97['use'](_0x16b2('0xf1'),require('./api/voicePrefix'));_0x360e97['use'](_0x16b2('0xf2'),require('./api/userProfile'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xf3'),require('./api/userProfileSection'));_0x360e97[_0x16b2('0x9')](_0x16b2('0xf4'),require(_0x16b2('0xf5')));_0x360e97['use'](_0x16b2('0xf6'),require(_0x16b2('0xf7')));_0x360e97[_0x16b2('0x9')]('/api/whatsapp/accounts',require(_0x16b2('0xf8')));_0x360e97['use'](_0x16b2('0xf9'),require(_0x16b2('0xfa')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xfb'),require(_0x16b2('0xfc')));_0x360e97['use'](_0x16b2('0xfd'),require(_0x16b2('0xfe')));_0x360e97[_0x16b2('0x9')](_0x16b2('0xff'),require(_0x16b2('0x100')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x101'),require(_0x16b2('0x102')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x103'),require(_0x16b2('0x104')));_0x360e97['use'](_0x16b2('0x105'),require('./api/cloudProvider'));_0x360e97[_0x16b2('0x9')](_0x16b2('0x106'),require(_0x16b2('0x107')));_0x360e97['use'](_0x16b2('0x108'),require(_0x16b2('0x109')));_0x360e97['use']('/api/auth/google',require(_0x16b2('0x10a')));_0x360e97[_0x16b2('0x9')]('/api/jira',require(_0x16b2('0x10b')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x10c'),require(_0x16b2('0x10d')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x10e'),require(_0x16b2('0x10f')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x110'),require(_0x16b2('0x111')));_0x360e97[_0x16b2('0x9')](_0x16b2('0x112'),require(_0x16b2('0x113')));_0x360e97[_0x16b2('0x9')]('/api/webbar',require('./api/webbar'));_0x360e97['use'](_0x16b2('0x114'),express[_0x16b2('0x115')](path[_0x16b2('0x116')](config[_0x16b2('0x117')],'/apidoc')));_0x360e97['use'](_0x16b2('0x118'),express[_0x16b2('0x115')](path['join'](config['root'],_0x16b2('0x118'))));_0x360e97[_0x16b2('0x9')](_0x16b2('0x119'),express[_0x16b2('0x115')](path[_0x16b2('0x116')](config['root'],'/demo')));_0x360e97[_0x16b2('0x9')]('/snippet',express['static'](path[_0x16b2('0x116')](config[_0x16b2('0x117')],_0x16b2('0x11a'),_0x16b2('0x11b'))));_0x360e97['use'](_0x16b2('0x11c'),express[_0x16b2('0x115')](path[_0x16b2('0x116')](config[_0x16b2('0x117')],_0x16b2('0x11d'))));_0x360e97['route'](_0x16b2('0x11e'))['get'](errors[0x194]);_0x360e97[_0x16b2('0x11f')]('/*')[_0x16b2('0x120')](function(_0x1edd04,_0x4cd905){_0x4cd905['sendFile'](path['resolve'](_0x360e97['get']('appPath')+_0x16b2('0x121')));});};var sensitiveFields=[_0x16b2('0x122'),_0x16b2('0x123'),'newPassword',_0x16b2('0x124'),_0x16b2('0x125'),'lastName',_0x16b2('0x126'),'phone','mobile',_0x16b2('0x127'),_0x16b2('0x128'),_0x16b2('0x129'),'clientSecret','securityToken',_0x16b2('0x12a'),_0x16b2('0x12b'),_0x16b2('0x12c'),_0x16b2('0x12d'),'channelSecret',_0x16b2('0x12e'),_0x16b2('0x12f'),_0x16b2('0x130'),_0x16b2('0x131'),_0x16b2('0x132'),'membername','calleridname',_0x16b2('0x133'),_0x16b2('0x134'),'vidaooApiKey','clientEmail',_0x16b2('0x135'),_0x16b2('0x136'),'secretaccesskey','key',_0x16b2('0x16'),'pass',_0x16b2('0x137'),_0x16b2('0x138'),_0x16b2('0x139'),_0x16b2('0x13a'),_0x16b2('0x13b'),_0x16b2('0x13c')];function maskSensitiveData(_0x1859aa){var _0x43df48=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x1859aa))return;for(var _0x5c2be0 in _0x1859aa){if(_[_0x16b2('0x13d')](_0x1859aa[_0x5c2be0])){for(var _0x3eac87=0x0;_0x3eac87<_0x1859aa[_0x5c2be0]['length'];_0x3eac87++){maskSensitiveData(_0x1859aa[_0x5c2be0][_0x3eac87]);}}else if(_[_0x16b2('0x13e')](_0x1859aa[_0x5c2be0])){maskSensitiveData(_0x1859aa[_0x5c2be0]);}else if(_['isString'](_0x1859aa[_0x5c2be0])){_0x1859aa[_0x5c2be0]=_0x1859aa[_0x5c2be0]['replace'](/{{{/g,_0x16b2('0x13f'))[_0x16b2('0x140')](/}}}/g,'}@@')[_0x16b2('0x140')](/{{/g,'@{')[_0x16b2('0x140')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5c2be0)){_0x1859aa[_0x5c2be0]=_0x1859aa[_0x5c2be0][_0x16b2('0x140')](_0x43df48,'*');}}}} \ No newline at end of file +var _0x9973=['dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','includes','path','express','util','./errors','./config/environment','./config/logger','api','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','./api/chatInternalMessage','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','root','/www','static','join','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','username','password','newPassword','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','key','pass'];(function(_0x147aa5,_0x44d876){var _0x3ad6d6=function(_0x485041){while(--_0x485041){_0x147aa5['push'](_0x147aa5['shift']());}};_0x3ad6d6(++_0x44d876);}(_0x9973,0x157));var _0x3997=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9973[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var path=require(_0x3997('0x0'));var express=require(_0x3997('0x1'));var ewinston=require('express-winston');var util=require(_0x3997('0x2'));var errors=require(_0x3997('0x3'));var config=require(_0x3997('0x4'));var logger=require(_0x3997('0x5'))(_0x3997('0x6'));var authLogger=require(_0x3997('0x5'))(_0x3997('0x7'));var safeTemplate=require('./safe-template')['safeTemplate'];exports[_0x3997('0x8')]=function(_0x114d26){_0x114d26[_0x3997('0x9')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x569ddf,_0x559dba){var _0x1f1723=_0x3997('0xa');if(!_[_0x3997('0xb')](_0x569ddf[_0x3997('0xc')])){_0x1f1723+=_0x3997('0xd');var _0x2290df=_0x569ddf[_0x3997('0xc')];maskSensitiveData(_0x2290df);}return safeTemplate(util[_0x3997('0xe')](_0x1f1723,_0x569ddf[_0x3997('0xf')],_0x569ddf[_0x3997('0x10')][_0x3997('0x11')]?_0x569ddf[_0x3997('0x10')][_0x3997('0x11')]:_0x569ddf[_0x3997('0x12')][_0x3997('0x13')]||_0x569ddf['ip'],_0x569ddf[_0x3997('0x14')],_0x559dba[_0x3997('0x15')],_0x559dba[_0x3997('0x16')],_0x569ddf[_0x3997('0x17')]?_0x569ddf[_0x3997('0x17')]['id']:null,_0x569ddf[_0x3997('0x17')]?_0x569ddf[_0x3997('0x17')][_0x3997('0x18')]:null,_0x569ddf['user']?_0x569ddf[_0x3997('0x17')][_0x3997('0x19')]:null,_0x2290df?util[_0x3997('0x1a')](_0x2290df,![],null):''));}}));_0x114d26[_0x3997('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x444521,_0x3b66f3){var _0x4cb897='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x444521[_0x3997('0xc')]&&_0x444521[_0x3997('0xc')]['device']&&_0x444521[_0x3997('0xc')][_0x3997('0x1b')]){_0x4cb897=_0x3997('0x1c');}return util[_0x3997('0xe')](_0x4cb897,_0x444521[_0x3997('0xf')],_0x444521['headers'][_0x3997('0x11')]?_0x444521[_0x3997('0x10')][_0x3997('0x11')]:_0x444521['connection'][_0x3997('0x13')]||_0x444521['ip'],_0x444521[_0x3997('0x14')],_0x3b66f3['statusCode'],_0x3b66f3[_0x3997('0x16')],_0x444521[_0x3997('0x17')]?_0x444521[_0x3997('0x17')]['id']:null,_0x444521['user']?_0x444521['user'][_0x3997('0x18')]:null,_0x444521[_0x3997('0x17')]?_0x444521[_0x3997('0x17')][_0x3997('0x19')]:null,_0x444521['body']&&_0x444521[_0x3997('0xc')]['device']?_0x444521['body'][_0x3997('0x1d')]:_0x3997('0x1e'),_0x444521['body']&&_0x444521['body'][_0x3997('0x1b')]?_0x444521[_0x3997('0xc')][_0x3997('0x1b')]:'',_0x444521['body']&&_0x444521['body']['agent_name']?_0x444521[_0x3997('0xc')][_0x3997('0x1f')]:'');},'ignoreRoute':function(_0xa9ebe7){var _0x455265=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x455265[_0x3997('0x20')](_0xa9ebe7[_0x3997('0x14')]);}}));_0x114d26['use']('/api/users',require(_0x3997('0x21')));_0x114d26[_0x3997('0x9')]('/api/voice/chanspy',require(_0x3997('0x22')));_0x114d26[_0x3997('0x9')](_0x3997('0x23'),require(_0x3997('0x24')));_0x114d26[_0x3997('0x9')](_0x3997('0x25'),require('./api/voiceExtension'));_0x114d26[_0x3997('0x9')](_0x3997('0x26'),require(_0x3997('0x27')));_0x114d26[_0x3997('0x9')](_0x3997('0x28'),require('./api/voiceQueue'));_0x114d26[_0x3997('0x9')](_0x3997('0x29'),require(_0x3997('0x2a')));_0x114d26[_0x3997('0x9')](_0x3997('0x2b'),require(_0x3997('0x2c')));_0x114d26['use'](_0x3997('0x2d'),require(_0x3997('0x2e')));_0x114d26[_0x3997('0x9')](_0x3997('0x2f'),require(_0x3997('0x30')));_0x114d26[_0x3997('0x9')](_0x3997('0x31'),require(_0x3997('0x32')));_0x114d26[_0x3997('0x9')](_0x3997('0x33'),require(_0x3997('0x34')));_0x114d26[_0x3997('0x9')](_0x3997('0x35'),require(_0x3997('0x36')));_0x114d26[_0x3997('0x9')]('/api/voice/queues/reports',require(_0x3997('0x37')));_0x114d26[_0x3997('0x9')](_0x3997('0x38'),require(_0x3997('0x39')));_0x114d26['use'](_0x3997('0x3a'),require(_0x3997('0x3b')));_0x114d26[_0x3997('0x9')]('/api/voice/transfers/reports',require(_0x3997('0x3c')));_0x114d26[_0x3997('0x9')](_0x3997('0x3d'),require(_0x3997('0x3e')));_0x114d26[_0x3997('0x9')](_0x3997('0x3f'),require(_0x3997('0x40')));_0x114d26[_0x3997('0x9')]('/api/mail/queues',require(_0x3997('0x41')));_0x114d26['use'](_0x3997('0x42'),require(_0x3997('0x43')));_0x114d26[_0x3997('0x9')](_0x3997('0x44'),require('./api/mailInteraction'));_0x114d26[_0x3997('0x9')](_0x3997('0x45'),require(_0x3997('0x46')));_0x114d26[_0x3997('0x9')]('/api/mail/applications',require(_0x3997('0x47')));_0x114d26['use'](_0x3997('0x48'),require(_0x3997('0x49')));_0x114d26[_0x3997('0x9')](_0x3997('0x4a'),require(_0x3997('0x4b')));_0x114d26[_0x3997('0x9')](_0x3997('0x4c'),require('./api/dashboardItem'));_0x114d26[_0x3997('0x9')](_0x3997('0x4d'),require(_0x3997('0x4e')));_0x114d26[_0x3997('0x9')]('/api/fax/applications',require('./api/faxApplication'));_0x114d26[_0x3997('0x9')]('/api/fax/interactions',require(_0x3997('0x4f')));_0x114d26[_0x3997('0x9')](_0x3997('0x50'),require(_0x3997('0x51')));_0x114d26['use'](_0x3997('0x52'),require(_0x3997('0x53')));_0x114d26['use'](_0x3997('0x54'),require(_0x3997('0x55')));_0x114d26[_0x3997('0x9')](_0x3997('0x56'),require(_0x3997('0x57')));_0x114d26[_0x3997('0x9')]('/api/sms/applications',require('./api/smsApplication'));_0x114d26['use'](_0x3997('0x58'),require(_0x3997('0x59')));_0x114d26[_0x3997('0x9')]('/api/sms/messages',require(_0x3997('0x5a')));_0x114d26['use']('/api/sms/queues',require('./api/smsQueue'));_0x114d26[_0x3997('0x9')](_0x3997('0x5b'),require(_0x3997('0x5c')));_0x114d26[_0x3997('0x9')]('/api/openchannel/applications',require(_0x3997('0x5d')));_0x114d26['use'](_0x3997('0x5e'),require('./api/openchannelInteraction'));_0x114d26[_0x3997('0x9')]('/api/openchannel/messages',require(_0x3997('0x5f')));_0x114d26['use'](_0x3997('0x60'),require(_0x3997('0x61')));_0x114d26[_0x3997('0x9')](_0x3997('0x62'),require(_0x3997('0x63')));_0x114d26[_0x3997('0x9')]('/api/openchannel/reports/queue',require(_0x3997('0x64')));_0x114d26[_0x3997('0x9')](_0x3997('0x65'),require(_0x3997('0x66')));_0x114d26[_0x3997('0x9')](_0x3997('0x67'),require('./api/chatInteraction'));_0x114d26['use'](_0x3997('0x68'),require('./api/chatMessage'));_0x114d26[_0x3997('0x9')]('/api/chat/offline_messages',require(_0x3997('0x69')));_0x114d26[_0x3997('0x9')](_0x3997('0x6a'),require(_0x3997('0x6b')));_0x114d26['use']('/api/chat/groups',require(_0x3997('0x6c')));_0x114d26['use'](_0x3997('0x6d'),require(_0x3997('0x6e')));_0x114d26[_0x3997('0x9')](_0x3997('0x6f'),require(_0x3997('0x70')));_0x114d26[_0x3997('0x9')](_0x3997('0x71'),require(_0x3997('0x72')));_0x114d26['use'](_0x3997('0x73'),require(_0x3997('0x74')));_0x114d26[_0x3997('0x9')](_0x3997('0x75'),require(_0x3997('0x76')));_0x114d26[_0x3997('0x9')](_0x3997('0x77'),require(_0x3997('0x78')));_0x114d26['use'](_0x3997('0x79'),require(_0x3997('0x7a')));_0x114d26[_0x3997('0x9')]('/api/cm/custom_fields',require(_0x3997('0x7b')));_0x114d26[_0x3997('0x9')](_0x3997('0x7c'),require(_0x3997('0x7d')));_0x114d26[_0x3997('0x9')](_0x3997('0x7e'),require(_0x3997('0x7f')));_0x114d26[_0x3997('0x9')](_0x3997('0x80'),require(_0x3997('0x81')));_0x114d26[_0x3997('0x9')]('/api/dispositions',require(_0x3997('0x82')));_0x114d26[_0x3997('0x9')](_0x3997('0x83'),require(_0x3997('0x84')));_0x114d26[_0x3997('0x9')](_0x3997('0x85'),require(_0x3997('0x86')));_0x114d26['use']('/api/pauses',require(_0x3997('0x87')));_0x114d26[_0x3997('0x9')](_0x3997('0x88'),require(_0x3997('0x89')));_0x114d26['use']('/api/voiceQueuesLog',require(_0x3997('0x8a')));_0x114d26[_0x3997('0x9')](_0x3997('0x8b'),require(_0x3997('0x8c')));_0x114d26[_0x3997('0x9')](_0x3997('0x8d'),require('./api/sound'));_0x114d26[_0x3997('0x9')](_0x3997('0x8e'),require('./api/tag'));_0x114d26[_0x3997('0x9')](_0x3997('0x8f'),require(_0x3997('0x90')));_0x114d26['use'](_0x3997('0x91'),require(_0x3997('0x92')));_0x114d26[_0x3997('0x9')]('/api/variables',require(_0x3997('0x93')));_0x114d26[_0x3997('0x9')](_0x3997('0x94'),require(_0x3997('0x95')));_0x114d26[_0x3997('0x9')](_0x3997('0x96'),require(_0x3997('0x97')));_0x114d26[_0x3997('0x9')](_0x3997('0x98'),require(_0x3997('0x99')));_0x114d26['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x114d26[_0x3997('0x9')](_0x3997('0x9a'),require(_0x3997('0x9b')));_0x114d26[_0x3997('0x9')]('/api/analytics/metrics',require(_0x3997('0x9c')));_0x114d26[_0x3997('0x9')](_0x3997('0x9d'),require(_0x3997('0x9e')));_0x114d26[_0x3997('0x9')](_0x3997('0x9f'),require(_0x3997('0xa0')));_0x114d26[_0x3997('0x9')](_0x3997('0xa1'),require('./api/intSalesforceAccount'));_0x114d26['use'](_0x3997('0xa2'),require(_0x3997('0xa3')));_0x114d26[_0x3997('0x9')](_0x3997('0xa4'),require(_0x3997('0xa5')));_0x114d26[_0x3997('0x9')](_0x3997('0xa6'),require('./api/intSugarcrmAccount'));_0x114d26[_0x3997('0x9')](_0x3997('0xa7'),require('./api/intSugarcrmConfiguration'));_0x114d26[_0x3997('0x9')]('/api/integrations/sugarcrm/fields',require(_0x3997('0xa8')));_0x114d26[_0x3997('0x9')](_0x3997('0xa9'),require(_0x3997('0xaa')));_0x114d26[_0x3997('0x9')](_0x3997('0xab'),require(_0x3997('0xac')));_0x114d26[_0x3997('0x9')](_0x3997('0xad'),require(_0x3997('0xae')));_0x114d26[_0x3997('0x9')](_0x3997('0xaf'),require(_0x3997('0xb0')));_0x114d26['use'](_0x3997('0xb1'),require('./api/intZohoConfiguration'));_0x114d26[_0x3997('0x9')](_0x3997('0xb2'),require(_0x3997('0xb3')));_0x114d26[_0x3997('0x9')](_0x3997('0xb4'),require(_0x3997('0xb5')));_0x114d26[_0x3997('0x9')](_0x3997('0xb6'),require(_0x3997('0xb7')));_0x114d26[_0x3997('0x9')](_0x3997('0xb8'),require(_0x3997('0xb9')));_0x114d26[_0x3997('0x9')](_0x3997('0xba'),require(_0x3997('0xbb')));_0x114d26[_0x3997('0x9')](_0x3997('0xbc'),require(_0x3997('0xbd')));_0x114d26[_0x3997('0x9')](_0x3997('0xbe'),require(_0x3997('0xbf')));_0x114d26[_0x3997('0x9')]('/api/integrations/vtiger/accounts',require(_0x3997('0xc0')));_0x114d26[_0x3997('0x9')](_0x3997('0xc1'),require(_0x3997('0xc2')));_0x114d26[_0x3997('0x9')](_0x3997('0xc3'),require('./api/intVtigerField'));_0x114d26[_0x3997('0x9')](_0x3997('0xc4'),require(_0x3997('0xc5')));_0x114d26['use'](_0x3997('0xc6'),require('./api/intServicenowConfiguration'));_0x114d26[_0x3997('0x9')](_0x3997('0xc7'),require(_0x3997('0xc8')));_0x114d26['use'](_0x3997('0xc9'),require(_0x3997('0xca')));_0x114d26[_0x3997('0x9')](_0x3997('0xcb'),require(_0x3997('0xcc')));_0x114d26['use'](_0x3997('0xcd'),require('./api/intDynamics365Field'));_0x114d26[_0x3997('0x9')](_0x3997('0xce'),require(_0x3997('0xcf')));_0x114d26[_0x3997('0x9')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x114d26[_0x3997('0x9')](_0x3997('0xd0'),require(_0x3997('0xd1')));_0x114d26[_0x3997('0x9')]('/api/networks',require(_0x3997('0xd2')));_0x114d26[_0x3997('0x9')]('/api/chat/reports/queue',require(_0x3997('0xd3')));_0x114d26[_0x3997('0x9')]('/api/chat/internal/messages',require(_0x3997('0xd4')));_0x114d26['use']('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x114d26[_0x3997('0x9')]('/api/jscripty/questions/reports',require(_0x3997('0xd5')));_0x114d26[_0x3997('0x9')](_0x3997('0xd6'),require('./api/jscriptySessionReport'));_0x114d26[_0x3997('0x9')](_0x3997('0xd7'),require(_0x3997('0xd8')));_0x114d26[_0x3997('0x9')](_0x3997('0xd9'),require(_0x3997('0xda')));_0x114d26[_0x3997('0x9')]('/api/square/details/reports',require(_0x3997('0xdb')));_0x114d26[_0x3997('0x9')](_0x3997('0xdc'),require(_0x3997('0xdd')));_0x114d26[_0x3997('0x9')](_0x3997('0xde'),require(_0x3997('0xdf')));_0x114d26[_0x3997('0x9')](_0x3997('0xe0'),require(_0x3997('0xe1')));_0x114d26[_0x3997('0x9')](_0x3997('0xe2'),require(_0x3997('0xe3')));_0x114d26[_0x3997('0x9')](_0x3997('0xe4'),require(_0x3997('0xe5')));_0x114d26[_0x3997('0x9')]('/api/square/messages',require('./api/squareMessage'));_0x114d26[_0x3997('0x9')](_0x3997('0xe6'),require(_0x3997('0xe7')));_0x114d26['use'](_0x3997('0xe8'),require(_0x3997('0xe9')));_0x114d26['use'](_0x3997('0xea'),require('./api/campaign'));_0x114d26[_0x3997('0x9')]('/api/migrations',require(_0x3997('0xeb')));_0x114d26[_0x3997('0x9')](_0x3997('0xec'),require(_0x3997('0xed')));_0x114d26['use']('/api/plugins',require(_0x3997('0xee')));_0x114d26['use'](_0x3997('0xef'),require('./api/mailTransferReport'));_0x114d26['use']('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x114d26['use'](_0x3997('0xf0'),require(_0x3997('0xf1')));_0x114d26[_0x3997('0x9')]('/api/openchannel/reports/transfer',require(_0x3997('0xf2')));_0x114d26[_0x3997('0x9')](_0x3997('0xf3'),require(_0x3997('0xf4')));_0x114d26['use'](_0x3997('0xf5'),require(_0x3997('0xf6')));_0x114d26[_0x3997('0x9')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x114d26[_0x3997('0x9')](_0x3997('0xf7'),require(_0x3997('0xf8')));_0x114d26[_0x3997('0x9')](_0x3997('0xf9'),require('./api/userProfileSection'));_0x114d26[_0x3997('0x9')](_0x3997('0xfa'),require(_0x3997('0xfb')));_0x114d26[_0x3997('0x9')](_0x3997('0xfc'),require(_0x3997('0xfd')));_0x114d26[_0x3997('0x9')]('/api/whatsapp/accounts',require(_0x3997('0xfe')));_0x114d26[_0x3997('0x9')](_0x3997('0xff'),require('./api/whatsappApplication'));_0x114d26[_0x3997('0x9')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x114d26[_0x3997('0x9')]('/api/whatsapp/messages',require(_0x3997('0x100')));_0x114d26[_0x3997('0x9')](_0x3997('0x101'),require(_0x3997('0x102')));_0x114d26[_0x3997('0x9')]('/api/whatsapp/reports/transfer',require(_0x3997('0x103')));_0x114d26[_0x3997('0x9')](_0x3997('0x104'),require('./api/whatsappQueue'));_0x114d26['use'](_0x3997('0x105'),require(_0x3997('0x106')));_0x114d26[_0x3997('0x9')](_0x3997('0x107'),require(_0x3997('0x108')));_0x114d26[_0x3997('0x9')](_0x3997('0x109'),require(_0x3997('0x10a')));_0x114d26[_0x3997('0x9')]('/api/auth/google',require(_0x3997('0x10b')));_0x114d26[_0x3997('0x9')](_0x3997('0x10c'),require(_0x3997('0x10d')));_0x114d26['use'](_0x3997('0x10e'),require(_0x3997('0x10f')));_0x114d26[_0x3997('0x9')](_0x3997('0x110'),require(_0x3997('0x111')));_0x114d26[_0x3997('0x9')](_0x3997('0x112'),require(_0x3997('0x113')));_0x114d26[_0x3997('0x9')](_0x3997('0x114'),require(_0x3997('0x115')));_0x114d26[_0x3997('0x9')]('/api/webbar',require('./api/webbar'));_0x114d26[_0x3997('0x9')](_0x3997('0x116'),express['static'](path['join'](config[_0x3997('0x117')],_0x3997('0x116'))));_0x114d26[_0x3997('0x9')](_0x3997('0x118'),express[_0x3997('0x119')](path[_0x3997('0x11a')](config[_0x3997('0x117')],_0x3997('0x118'))));_0x114d26[_0x3997('0x9')]('/demo',express[_0x3997('0x119')](path['join'](config['root'],'/demo')));_0x114d26['use'](_0x3997('0x11b'),express[_0x3997('0x119')](path['join'](config['root'],_0x3997('0x11c'),_0x3997('0x11d'))));_0x114d26['use'](_0x3997('0x11e'),express[_0x3997('0x119')](path['join'](config[_0x3997('0x117')],_0x3997('0x11f'))));_0x114d26[_0x3997('0x120')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x3997('0x121')](errors[0x194]);_0x114d26[_0x3997('0x120')]('/*')[_0x3997('0x121')](function(_0x4837d1,_0x5a8aa8){_0x5a8aa8[_0x3997('0x122')](path[_0x3997('0x123')](_0x114d26[_0x3997('0x121')]('appPath')+'/index.html'));});};var sensitiveFields=[_0x3997('0x124'),_0x3997('0x125'),_0x3997('0x126'),'apiKey',_0x3997('0x127'),_0x3997('0x128'),'street',_0x3997('0x129'),_0x3997('0x12a'),_0x3997('0x12b'),_0x3997('0x12c'),_0x3997('0x12d'),_0x3997('0x12e'),_0x3997('0x12f'),_0x3997('0x130'),_0x3997('0x131'),'tenantId',_0x3997('0x132'),_0x3997('0x133'),_0x3997('0x134'),_0x3997('0x135'),'authToken',_0x3997('0x136'),_0x3997('0x137'),_0x3997('0x138'),_0x3997('0x139'),_0x3997('0x13a'),_0x3997('0x13b'),_0x3997('0x13c'),'clientEmail',_0x3997('0x13d'),'accesskeyid',_0x3997('0x13e'),_0x3997('0x13f'),_0x3997('0x17'),_0x3997('0x140'),'accountSid','localstationid',_0x3997('0x141'),_0x3997('0x142'),_0x3997('0x143'),_0x3997('0x144')];function maskSensitiveData(_0x5f571d){var _0x1ebcfa=/(?!^)[\s\S](?!$)/g;if(!_[_0x3997('0x145')](_0x5f571d))return;for(var _0x3d90b0 in _0x5f571d){if(_[_0x3997('0x146')](_0x5f571d[_0x3d90b0])){for(var _0x4a527e=0x0;_0x4a527e<_0x5f571d[_0x3d90b0][_0x3997('0x147')];_0x4a527e++){maskSensitiveData(_0x5f571d[_0x3d90b0][_0x4a527e]);}}else if(_['isPlainObject'](_0x5f571d[_0x3d90b0])){maskSensitiveData(_0x5f571d[_0x3d90b0]);}else if(_[_0x3997('0x148')](_0x5f571d[_0x3d90b0])){_0x5f571d[_0x3d90b0]=_0x5f571d[_0x3d90b0][_0x3997('0x149')](/{{{/g,_0x3997('0x14a'))[_0x3997('0x149')](/}}}/g,'}@@')[_0x3997('0x149')](/{{/g,'@{')[_0x3997('0x149')](/}}/g,'}@');if(_[_0x3997('0x14b')](sensitiveFields,_0x3d90b0)){_0x5f571d[_0x3d90b0]=_0x5f571d[_0x3d90b0]['replace'](_0x1ebcfa,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7605e9b..9d732d6 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e4f=['merge','../api/voiceExtension/voiceExtension.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/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.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/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','../config/environment','listen'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x8e4f,0x160));var _0xf8e4=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x8e4f[_0x3a3fcc];return _0xe16438;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf8e4('0x0'));var _=require('lodash');var config=require(_0xf8e4('0x1'));exports[_0xf8e4('0x2')]=function(){return new BPromise(function(_0x11bdc3,_0x6ef7d0){var _0x5eefea={};_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/user/user.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x4')));_0x5eefea=_['merge'](_0x5eefea,require('../api/voiceQueue/voiceQueue.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/voiceRecording/voiceRecording.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x5')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x6')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x7')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x8')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x9')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0xa')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0xb')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0xc')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0xd')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0xe')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0xf')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x10')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x11')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x12')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x13')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x14')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x15')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x16')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x17')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x18')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/smsAccount/smsAccount.rpc'));_0x5eefea=_['merge'](_0x5eefea,require('../api/smsInteraction/smsInteraction.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/smsMessage/smsMessage.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x19')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x1a')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x1b')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x1c')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x1d')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/chatInteraction/chatInteraction.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x1e')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/chatQueue/chatQueue.rpc'));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x1f')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/cmHopper/cmHopper.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x20')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x21')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x22')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x23')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/interval/interval.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x24')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x25')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x26')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x27')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x28')));_0x5eefea=_['merge'](_0x5eefea,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x29')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x2a')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x2b')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x2c')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x2d')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x2e')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x2f')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x30')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x31')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x32')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x33')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x34')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x35')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/squareProject/squareProject.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/squareRecording/squareRecording.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/squareMessage/squareMessage.rpc'));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x36')));_0x5eefea=_['merge'](_0x5eefea,require('../api/attachment/attachment.rpc'));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x37')));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x38')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5eefea=_['merge'](_0x5eefea,require(_0xf8e4('0x39')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x3a')));_0x5eefea=_[_0xf8e4('0x3')](_0x5eefea,require(_0xf8e4('0x3b')));var _0x132870=jayson[_0xf8e4('0x3c')](_0x5eefea)[_0xf8e4('0x3d')]();var _0x555bf7=config[_0xf8e4('0x3e')][_0xf8e4('0x3f')]||config['port']+0x1;var _0x2b73d2=config[_0xf8e4('0x3e')]['ip']||_0xf8e4('0x40');_0x132870['on'](_0xf8e4('0x41'),function(_0x26bf93){return _0x6ef7d0(_0x26bf93);});_0x132870[_0xf8e4('0x2')](_0x555bf7,_0x2b73d2,function(){console[_0xf8e4('0x42')](_0xf8e4('0x43'),_0x2b73d2,_0x555bf7);require(_0xf8e4('0x44'))[_0xf8e4('0x45')]();return _0x11bdc3(_0xf8e4('0x46')+_0x2b73d2+':'+_0x555bf7);});});}; \ No newline at end of file +var _0xeffe=['../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.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/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','lodash','merge','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/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/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc'];(function(_0x1cc427,_0x17460c){var _0x26b9a2=function(_0x1028d1){while(--_0x1028d1){_0x1cc427['push'](_0x1cc427['shift']());}};_0x26b9a2(++_0x17460c);}(_0xeffe,0x16a));var _0xeeff=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xeffe[_0x263a74];return _0x2aa86c;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0xeeff('0x0'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x16f02d,_0x3973f8){var _0x46efd5={};_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x2')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/voiceExtension/voiceExtension.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/voiceQueue/voiceQueue.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x3')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x4')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x5')));_0x46efd5=_['merge'](_0x46efd5,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x6')));_0x46efd5=_['merge'](_0x46efd5,require('../api/trunk/trunk.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x7')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x8')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x9')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0xa')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0xb')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/mailMessage/mailMessage.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0xc')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0xd')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0xe')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0xf')));_0x46efd5=_['merge'](_0x46efd5,require('../api/faxInteraction/faxInteraction.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x10')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x11')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x12')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x13')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/smsInteraction/smsInteraction.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x14')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x15')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x16')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x17')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x18')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x19')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x1a')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x1b')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x1c')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x1d')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x1e')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x1f')));_0x46efd5=_['merge'](_0x46efd5,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x20')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x21')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x22')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x23')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x24')));_0x46efd5=_['merge'](_0x46efd5,require('../api/trigger/trigger.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x25')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x26')));_0x46efd5=_['merge'](_0x46efd5,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x27')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x28')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x29')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x2a')));_0x46efd5=_['merge'](_0x46efd5,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x2b')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x2c')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x2d')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x2e')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x2f')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require('../api/squareOdbc/squareOdbc.rpc'));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x30')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x31')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x32')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x33')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x34')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x35')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x36')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x37')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x38')));_0x46efd5=_[_0xeeff('0x1')](_0x46efd5,require(_0xeeff('0x39')));_0x46efd5=_['merge'](_0x46efd5,require(_0xeeff('0x3a')));var _0x33c123=jayson[_0xeeff('0x3b')](_0x46efd5)['http']();var _0x14b172=config[_0xeeff('0x3c')][_0xeeff('0x3d')]||config[_0xeeff('0x3d')]+0x1;var _0x3db12f=config[_0xeeff('0x3c')]['ip']||_0xeeff('0x3e');_0x33c123['on']('error',function(_0x10526f){return _0x3973f8(_0x10526f);});_0x33c123['listen'](_0x14b172,_0x3db12f,function(){console[_0xeeff('0x3f')](_0xeeff('0x40'),_0x3db12f,_0x14b172);require(_0xeeff('0x41'))['default']();return _0x16f02d('RPC\x20listening\x20on\x20'+_0x3db12f+':'+_0x14b172);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index e6e6db4..d3cc9e6 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(_0x1573be,_0x50e596){var _0x3c96db=function(_0xfe8e0f){while(--_0xfe8e0f){_0x1573be['push'](_0x1573be['shift']());}};_0x3c96db(++_0x50e596);}(_0x5c00,0x17e));var _0x05c0=function(_0x3d0098,_0x22ee82){_0x3d0098=_0x3d0098-0x0;var _0x3ef587=_0x5c00[_0x3d0098];return _0x3ef587;};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 _0x3266=['\x20}\x20}','string','replace','isArray','keys','reduce','exports','lodash','{\x20{\x20'];(function(_0x3083c8,_0x407947){var _0x35e237=function(_0x595a20){while(--_0x595a20){_0x3083c8['push'](_0x3083c8['shift']());}};_0x35e237(++_0x407947);}(_0x3266,0x6a));var _0x6326=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x3266[_0x19dd7a];return _0x3feb6a;};var _=require(_0x6326('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b328d){return _0x2b328d==='{{'?_0x6326('0x1'):_0x6326('0x2');}function safeTemplate(_0x545df7){var _0x6b67c0=_0x545df7;if(typeof _0x545df7===_0x6326('0x3')){_0x6b67c0=_0x545df7[_0x6326('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6326('0x5')](_0x545df7)){_0x6b67c0=_0x545df7['map'](function(_0x30b22e){return safeTemplate(_0x30b22e);});}else if(_['isPlainObject'](_0x545df7)){_0x6b67c0=Object[_0x6326('0x6')](_0x545df7)[_0x6326('0x7')](function(_0x14208e,_0x5402e5){_0x14208e[_0x5402e5]=safeTemplate(_0x545df7[_0x5402e5]);return _0x14208e;},{});}return _0x6b67c0;}module[_0x6326('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 8c548e2..f743ece 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 _0xafd1=['call','setEncoding','utf8','headers','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','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','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error'];(function(_0x2ac289,_0x29781c){var _0x3122fe=function(_0xd69119){while(--_0xd69119){_0x2ac289['push'](_0x2ac289['shift']());}};_0x3122fe(++_0x29781c);}(_0xafd1,0x1c2));var _0x1afd=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xafd1[_0x54b396];return _0x532e6d;};'use strict';var util=require(_0x1afd('0x0'));var _=require(_0x1afd('0x1'));var EventEmitter=require(_0x1afd('0x2'))[_0x1afd('0x3')];var AGIReply=require(_0x1afd('0x4'));var AGIError=require(_0x1afd('0x5'));function AGIChannel(_0xf72d02){var _0x39d144=this,_0x50579d=new AGIReply(),_0x101d1f=![],_0x77e164={};EventEmitter[_0x1afd('0x6')](_0x39d144);_0xf72d02[_0x1afd('0x7')](_0x1afd('0x8'));_0xf72d02['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x50579d[_0x1afd('0x7')]('utf8');_0x50579d['on'](_0x1afd('0x9'),function(_0x980586){for(var _0x1a2f3d in _0x980586){_0x39d144[_0x1a2f3d]=_0x980586[_0x1a2f3d];}_0x39d144['emit']('ready');});_0x50579d['on'](_0x1afd('0xa'),function(_0x160413){if(_0x160413[_0x1afd('0xb')]()==_0x1afd('0xc')){_0x39d144[_0x1afd('0xd')](_0x1afd('0xc'));return;}if(_0x160413[_0x1afd('0xe')](0x0,0xb)==_0x1afd('0xf')){_0x101d1f=!![];}if(_0x101d1f){_0x77e164['rx']+=_0x160413+'\x0a';if(_0x160413[_0x1afd('0x10')](_0x1afd('0x11'))!=-0x1){_0x101d1f=![];}}else{_0x77e164['rx']=_0x160413;}if(_0x101d1f){return;}if(typeof _0x77e164['cb']==_0x1afd('0x12')){var _0x228431=_0x77e164['rx']['substring'](0x0,0x3),_0x43e224=null,_0x58ff79=null;_0x228431=parseInt(_0x228431);if(isNaN(_0x228431)){_0x77e164['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1afd('0x13')});return;}if(_0x228431!=0xc8){_0x77e164['cb'](null,{'code':_0x228431,'result':-0x1,'extra':'KO'});return;}_0x43e224=_0x77e164['rx']['substring'](0x4)[_0x1afd('0x14')](_0x1afd('0x15'),'');if(_0x43e224['indexOf']('\x20')!=-0x1){_0x43e224=_0x43e224['substr'](0x0,_0x43e224['indexOf']('\x20'));}if(_[_0x1afd('0x16')](_0x43e224,'-1')){_0x43e224=parseInt(_0x43e224);}_0x58ff79=_0x77e164['rx'][_0x1afd('0x17')]('\x20');if(_0x58ff79[_0x1afd('0x18')]==0x3){_0x58ff79=_0x58ff79[0x2][_0x1afd('0xe')](0x1,_0x58ff79[0x2][_0x1afd('0x18')]-0x1);}else if(_0x58ff79[_0x1afd('0x18')]>0x3){var _0x1e60c1=/\((.+)\)/;var _0x59886b=_0x77e164['rx'][_0x1afd('0x19')](_0x1e60c1);if(_0x59886b){_0x58ff79=_0x59886b[0x1];}else{_0x58ff79=null;}}else{_0x58ff79=null;}_0x77e164['cb'](null,{'code':_0x228431,'result':_0x43e224,'extra':_0x58ff79});}});_0xf72d02['on'](_0x1afd('0x1a'),function(_0x5c3613){_0x39d144[_0x1afd('0xd')](_0x1afd('0x1a'),new AGIError(_0x1afd('0x1b'),_0x5c3613[_0x1afd('0x1c')]));});_0xf72d02['on']('close',function(){_0x39d144[_0x1afd('0xd')](_0x1afd('0x1d'),new AGIError(_0x1afd('0x1e')));});_0xf72d02['on'](_0x1afd('0x1f'),function(){_0x39d144[_0x1afd('0xd')](_0x1afd('0x1f'),new AGIError(_0x1afd('0x20')));_0xf72d02[_0x1afd('0x21')]();});_0xf72d02[_0x1afd('0x22')](_0x50579d);this[_0x1afd('0x23')]=function(_0x4fac68,_0x298c8c){var _0x4fac68=_0x4fac68||'',_0x298c8c=typeof _0x298c8c==_0x1afd('0x12')?_0x298c8c:new Function();_0x77e164={'tx':_0x4fac68,'rx':'','cb':_0x298c8c};_0xf72d02[_0x1afd('0x24')](_0x4fac68+'\x0a');},this[_0x1afd('0x1d')]=function(){_0xf72d02[_0x1afd('0x21')]();};}util[_0x1afd('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x1afd('0x26')][_0x1afd('0x27')]=function(_0x118880){return this[_0x1afd('0x23')]['sync'](this,_0x118880);};AGIChannel[_0x1afd('0x26')][_0x1afd('0x28')]=function(){return this[_0x1afd('0x27')]('ANSWER');};AGIChannel[_0x1afd('0x26')][_0x1afd('0x29')]=function(_0x206e42,_0x1b25e6,_0x630c27){_0x206e42=_0x206e42===undefined?_0x1afd('0x2a'):_0x206e42;_0x1b25e6=_0x1b25e6===undefined?'5':_0x1b25e6;_0x630c27=_0x630c27===undefined?'1':_0x630c27;return this['sendRequest'](util[_0x1afd('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x206e42,_0x1b25e6*0x3e8,_0x630c27));};AGIChannel['prototype']['noop']=function(_0x1bd5ad){_0x1bd5ad=_0x1bd5ad||_0x1afd('0x2c');return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x2d'),_0x1bd5ad));};AGIChannel[_0x1afd('0x26')]['exec']=function(_0x19f17c,_0x10a32c){if(_[_0x1afd('0x2e')](_0x10a32c)){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x2f'),_0x19f17c,_0x10a32c['join'](',')));}return this['sendRequest'](util[_0x1afd('0x2b')](_0x1afd('0x2f'),_0x19f17c,_0x10a32c));};AGIChannel[_0x1afd('0x26')][_0x1afd('0x30')]=function(_0x3a96f2){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x31'),_0x3a96f2));};AGIChannel[_0x1afd('0x26')][_0x1afd('0x32')]=function(_0x4ba9aa){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x33'),_0x4ba9aa));};AGIChannel['prototype'][_0x1afd('0x34')]=function(_0x58db14){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')]('SET\x20PRIORITY\x20%s',_0x58db14));};AGIChannel[_0x1afd('0x26')][_0x1afd('0xc')]=function(){return this['sendRequest'](_0x1afd('0x35'));};AGIChannel['prototype'][_0x1afd('0x36')]=function(_0x53366d,_0x1edf6){var _0x328eda=_['isBoolean'](_0x1edf6)||_[_0x1afd('0x37')](_0x1edf6)?_0x1edf6['toString']():_0x1edf6;return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x38'),_0x53366d,_0x328eda?_0x328eda['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1afd('0x26')][_0x1afd('0x39')]=function(_0x340673,_0x1e3c08){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x3a'),_0x340673,_0x1e3c08));};AGIChannel[_0x1afd('0x26')][_0x1afd('0x3b')]=function(_0x2b6c55,_0x434229){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0x2b6c55,_0x434229));};AGIChannel['prototype'][_0x1afd('0x3c')]=function(_0xe602c9,_0x206ea1){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x3d'),_0xe602c9,_0x206ea1));};AGIChannel[_0x1afd('0x26')]['continueAt']=function(_0x254db7,_0x3710f3,_0x3cf547){_0x3710f3=_0x3710f3||this[_0x1afd('0x3e')];_0x3cf547=_0x3cf547||0x1;this[_0x1afd('0x30')](_0x254db7);this[_0x1afd('0x32')](_0x3710f3);this['setPriority'](_0x3cf547);return this[_0x1afd('0x3f')](util[_0x1afd('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x254db7,_0x3710f3,_0x3cf547));};AGIChannel['prototype'][_0x1afd('0x40')]=function(_0xb33eb){return this[_0x1afd('0x27')](util[_0x1afd('0x2b')](_0x1afd('0x41'),_0xb33eb));};AGIChannel[_0x1afd('0x26')][_0x1afd('0x42')]=function(_0x496070,_0x177d27,_0x1663bb,_0x590b64,_0x48b273,_0x1136fd){_0x177d27=_0x177d27||_0x1afd('0x43');_0x1663bb=_0x1663bb||'';_0x590b64=_0x590b64===undefined?-0x1:_0x590b64==='-1'?-0x1:_0x590b64*0x3e8;_0x48b273=_0x48b273===undefined?'':'s='+_0x48b273;_0x1136fd=_0x1136fd?'BEEP':'';return this['sendRequest'](util[_0x1afd('0x2b')](_0x1afd('0x44'),_0x496070,_0x177d27,_0x1663bb,_0x590b64,_0x1136fd,_0x48b273));};AGIChannel[_0x1afd('0x26')]['streamFile']=function(_0x4df8a1,_0x3348dc){_0x3348dc=_0x3348dc||'';return this['sendRequest'](util[_0x1afd('0x2b')](_0x1afd('0x45'),_0x4df8a1,_0x3348dc));};AGIChannel['prototype']['agi']=function(_0x55f47b){return this[_0x1afd('0x46')](_0x1afd('0x47'),_0x55f47b);};AGIChannel[_0x1afd('0x26')][_0x1afd('0x48')]=function(_0xff0d1){return this[_0x1afd('0x46')](_0x1afd('0x49'),_0xff0d1);};AGIChannel[_0x1afd('0x26')]['error']=function(_0x1aa382,_0x3dd9c5){this['noop'](util[_0x1afd('0x2b')](_0x1afd('0x4a'),_0x1aa382['id'],_0x1aa382['label'],_0x3dd9c5));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1afd('0x4b')]=AGIChannel; \ No newline at end of file +var _0x6e04=['ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','no\x20code','substring','replace','result=','substr','indexOf','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','streamFile','agi','AGI','wait','WAIT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6e04,0x99));var _0x46e0=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x6e04[_0x28394f];return _0x2618d2;};'use strict';var util=require(_0x46e0('0x0'));var _=require('lodash');var EventEmitter=require(_0x46e0('0x1'))[_0x46e0('0x2')];var AGIReply=require(_0x46e0('0x3'));var AGIError=require(_0x46e0('0x4'));function AGIChannel(_0x2a413f){var _0x174013=this,_0x366e3d=new AGIReply(),_0x1f9b90=![],_0x5336e1={};EventEmitter[_0x46e0('0x5')](_0x174013);_0x2a413f[_0x46e0('0x6')](_0x46e0('0x7'));_0x2a413f[_0x46e0('0x8')](0x8*0x3c*0x3c*0x3e8);_0x366e3d['setEncoding'](_0x46e0('0x7'));_0x366e3d['on']('headers',function(_0x2cc125){for(var _0x2b4645 in _0x2cc125){_0x174013[_0x2b4645]=_0x2cc125[_0x2b4645];}_0x174013[_0x46e0('0x9')]('ready');});_0x366e3d['on'](_0x46e0('0xa'),function(_0x152c1c){if(_0x152c1c[_0x46e0('0xb')]()==_0x46e0('0xc')){_0x174013['emit'](_0x46e0('0xc'));return;}if(_0x152c1c['substring'](0x0,0xb)=='520-Invalid'){_0x1f9b90=!![];}if(_0x1f9b90){_0x5336e1['rx']+=_0x152c1c+'\x0a';if(_0x152c1c[_0x46e0('0xd')](_0x46e0('0xe'))!=-0x1){_0x1f9b90=![];}}else{_0x5336e1['rx']=_0x152c1c;}if(_0x1f9b90){return;}if(typeof _0x5336e1['cb']=='function'){var _0x2d5d07=_0x5336e1['rx']['substring'](0x0,0x3),_0xece2b1=null,_0xac4ad7=null;_0x2d5d07=parseInt(_0x2d5d07);if(isNaN(_0x2d5d07)){_0x5336e1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x46e0('0xf')});return;}if(_0x2d5d07!=0xc8){_0x5336e1['cb'](null,{'code':_0x2d5d07,'result':-0x1,'extra':'KO'});return;}_0xece2b1=_0x5336e1['rx'][_0x46e0('0x10')](0x4)[_0x46e0('0x11')](_0x46e0('0x12'),'');if(_0xece2b1['indexOf']('\x20')!=-0x1){_0xece2b1=_0xece2b1[_0x46e0('0x13')](0x0,_0xece2b1[_0x46e0('0x14')]('\x20'));}if(_['startsWith'](_0xece2b1,'-1')){_0xece2b1=parseInt(_0xece2b1);}_0xac4ad7=_0x5336e1['rx']['split']('\x20');if(_0xac4ad7[_0x46e0('0x15')]==0x3){_0xac4ad7=_0xac4ad7[0x2]['substring'](0x1,_0xac4ad7[0x2]['length']-0x1);}else if(_0xac4ad7['length']>0x3){var _0x576476=/\((.+)\)/;var _0x43cdc0=_0x5336e1['rx'][_0x46e0('0x16')](_0x576476);if(_0x43cdc0){_0xac4ad7=_0x43cdc0[0x1];}else{_0xac4ad7=null;}}else{_0xac4ad7=null;}_0x5336e1['cb'](null,{'code':_0x2d5d07,'result':_0xece2b1,'extra':_0xac4ad7});}});_0x2a413f['on'](_0x46e0('0x17'),function(_0x1ad6f7){_0x174013[_0x46e0('0x9')](_0x46e0('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x1ad6f7[_0x46e0('0x18')]));});_0x2a413f['on'](_0x46e0('0x19'),function(){_0x174013[_0x46e0('0x9')](_0x46e0('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2a413f['on'](_0x46e0('0x1a'),function(){_0x174013[_0x46e0('0x9')](_0x46e0('0x1a'),new AGIError(_0x46e0('0x1b')));_0x2a413f[_0x46e0('0x1c')]();});_0x2a413f[_0x46e0('0x1d')](_0x366e3d);this[_0x46e0('0x1e')]=function(_0x3af16f,_0x1ff63c){var _0x3af16f=_0x3af16f||'',_0x1ff63c=typeof _0x1ff63c=='function'?_0x1ff63c:new Function();_0x5336e1={'tx':_0x3af16f,'rx':'','cb':_0x1ff63c};_0x2a413f['write'](_0x3af16f+'\x0a');},this[_0x46e0('0x19')]=function(){_0x2a413f['destroy']();};}util[_0x46e0('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x46e0('0x20')][_0x46e0('0x21')]=function(_0x110a40){return this['command'][_0x46e0('0x22')](this,_0x110a40);};AGIChannel['prototype'][_0x46e0('0x23')]=function(){return this['sendRequest'](_0x46e0('0x24'));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x25')]=function(_0x56082d,_0x842d6b,_0x781c32){_0x56082d=_0x56082d===undefined?_0x46e0('0x26'):_0x56082d;_0x842d6b=_0x842d6b===undefined?'5':_0x842d6b;_0x781c32=_0x781c32===undefined?'1':_0x781c32;return this[_0x46e0('0x21')](util[_0x46e0('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x56082d,_0x842d6b*0x3e8,_0x781c32));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x28')]=function(_0x439138){_0x439138=_0x439138||_0x46e0('0x29');return this[_0x46e0('0x21')](util[_0x46e0('0x27')](_0x46e0('0x2a'),_0x439138));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x2b')]=function(_0x1026aa,_0x4938f4){if(_[_0x46e0('0x2c')](_0x4938f4)){return this[_0x46e0('0x21')](util['format'](_0x46e0('0x2d'),_0x1026aa,_0x4938f4[_0x46e0('0x2e')](',')));}return this['sendRequest'](util[_0x46e0('0x27')](_0x46e0('0x2d'),_0x1026aa,_0x4938f4));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x2f')]=function(_0x36cddc){return this['sendRequest'](util['format'](_0x46e0('0x30'),_0x36cddc));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x31')]=function(_0xffdcef){return this[_0x46e0('0x21')](util[_0x46e0('0x27')](_0x46e0('0x32'),_0xffdcef));};AGIChannel[_0x46e0('0x20')]['setPriority']=function(_0x396b19){return this[_0x46e0('0x21')](util[_0x46e0('0x27')](_0x46e0('0x33'),_0x396b19));};AGIChannel[_0x46e0('0x20')]['hangup']=function(){return this[_0x46e0('0x21')](_0x46e0('0x34'));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x35')]=function(_0x492623,_0x2d4603){var _0x235272=_['isBoolean'](_0x2d4603)||_[_0x46e0('0x36')](_0x2d4603)?_0x2d4603['toString']():_0x2d4603;return this['sendRequest'](util[_0x46e0('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x492623,_0x235272?_0x235272[_0x46e0('0x37')]()[_0x46e0('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x46e0('0x20')]['sayNumber']=function(_0x5e489d,_0x26513a){return this['sendRequest'](util[_0x46e0('0x27')](_0x46e0('0x38'),_0x5e489d,_0x26513a));};AGIChannel['prototype'][_0x46e0('0x39')]=function(_0x512d17,_0x2a1421){return this['sendRequest'](util[_0x46e0('0x27')]('SAY\x20DIGITS\x20%s\x20%s',_0x512d17,_0x2a1421));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x3a')]=function(_0x56ce92,_0x30dd28){return this['sendRequest'](util[_0x46e0('0x27')](_0x46e0('0x3b'),_0x56ce92,_0x30dd28));};AGIChannel['prototype'][_0x46e0('0x3c')]=function(_0x298c4b,_0x57ac17,_0x5f2a31){_0x57ac17=_0x57ac17||this[_0x46e0('0x3d')];_0x5f2a31=_0x5f2a31||0x1;this[_0x46e0('0x2f')](_0x298c4b);this[_0x46e0('0x31')](_0x57ac17);this[_0x46e0('0x3e')](_0x5f2a31);return this['noop'](util[_0x46e0('0x27')](_0x46e0('0x3f'),_0x298c4b,_0x57ac17,_0x5f2a31));};AGIChannel[_0x46e0('0x20')]['getVariable']=function(_0x54e2fe){return this[_0x46e0('0x21')](util[_0x46e0('0x27')](_0x46e0('0x40'),_0x54e2fe));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x41')]=function(_0x314605,_0x23d1d2,_0x248adb,_0x4f4629,_0x2153c1,_0x3996dc){_0x23d1d2=_0x23d1d2||_0x46e0('0x42');_0x248adb=_0x248adb||'';_0x4f4629=_0x4f4629===undefined?-0x1:_0x4f4629==='-1'?-0x1:_0x4f4629*0x3e8;_0x2153c1=_0x2153c1===undefined?'':'s='+_0x2153c1;_0x3996dc=_0x3996dc?'BEEP':'';return this[_0x46e0('0x21')](util[_0x46e0('0x27')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x314605,_0x23d1d2,_0x248adb,_0x4f4629,_0x3996dc,_0x2153c1));};AGIChannel['prototype'][_0x46e0('0x43')]=function(_0x42fadb,_0x2b4c6e){_0x2b4c6e=_0x2b4c6e||'';return this[_0x46e0('0x21')](util[_0x46e0('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x42fadb,_0x2b4c6e));};AGIChannel[_0x46e0('0x20')][_0x46e0('0x44')]=function(_0x882567){return this['exec'](_0x46e0('0x45'),_0x882567);};AGIChannel[_0x46e0('0x20')][_0x46e0('0x46')]=function(_0x3b9ab0){return this[_0x46e0('0x2b')](_0x46e0('0x47'),_0x3b9ab0);};AGIChannel[_0x46e0('0x20')]['error']=function(_0x283dec,_0x2c2c49){this['noop'](util['format'](_0x46e0('0x48'),_0x283dec['id'],_0x283dec[_0x46e0('0x49')],_0x2c2c49));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x46e0('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 74bf334..28d9fa7 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 _0xea4e=['Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x424a9a,_0x59fe3e){var _0x25808a=function(_0x3807b1){while(--_0x3807b1){_0x424a9a['push'](_0x424a9a['shift']());}};_0x25808a(++_0x59fe3e);}(_0xea4e,0x121));var _0xeea4=function(_0x2d10f7,_0x36abd0){_0x2d10f7=_0x2d10f7-0x0;var _0x94c2f7=_0xea4e[_0x2d10f7];return _0x94c2f7;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xeea4('0x0'),'E_AGI_SERVER_ERROR':_0xeea4('0x1'),'E_AGI_SERVER_CLOSE':_0xeea4('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xeea4('0x3'),'E_AGI_SOCKET_ERROR':_0xeea4('0x4'),'E_AGI_SOCKET_CLOSE':_0xeea4('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xeea4('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xeea4('0x7'),'E_AGI_IVR_ENTRY':_0xeea4('0x8')};function AGIError(_0x186519){var _0x186519=_0x186519||null,_0x48fe80=_0x48fe80||[],_0x43219c=0x1,_0x4d61fc='';if(!error[_0x186519]){_0x186519='E_AGI_UNDEFINED';}_0x48fe80['push'](error[_0x186519]);while(arguments[_0x43219c]){_0x48fe80[_0xeea4('0x9')](arguments[_0x43219c]);_0x43219c++;}_0x4d61fc=util[_0xeea4('0xa')][_0xeea4('0xb')](util,_0x48fe80);this['message']=_0x4d61fc;this[_0xeea4('0xc')]=_0x186519;}module[_0xeea4('0xd')]=AGIError; \ No newline at end of file +var _0x6de1=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.'];(function(_0x19a827,_0x30cc4e){var _0x4d7749=function(_0x3e9d05){while(--_0x3e9d05){_0x19a827['push'](_0x19a827['shift']());}};_0x4d7749(++_0x30cc4e);}(_0x6de1,0x10c));var _0x16de=function(_0x491468,_0x42f169){_0x491468=_0x491468-0x0;var _0x5b8c22=_0x6de1[_0x491468];return _0x5b8c22;};'use strict';var util=require(_0x16de('0x0'));var error={'E_AGI_UNDEFINED':_0x16de('0x1'),'E_AGI_ARGUMENT_PORT':_0x16de('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x16de('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x16de('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x16de('0x5'),'E_AGI_SOCKET_ERROR':_0x16de('0x6'),'E_AGI_SOCKET_CLOSE':_0x16de('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x16de('0x8'),'E_AGI_COMMAND_EMPTY':_0x16de('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x16de('0xa'),'E_AGI_IVR_ENTRY':_0x16de('0xb')};function AGIError(_0x4defcb){var _0x4defcb=_0x4defcb||null,_0x34467b=_0x34467b||[],_0x216c15=0x1,_0x254627='';if(!error[_0x4defcb]){_0x4defcb=_0x16de('0xc');}_0x34467b['push'](error[_0x4defcb]);while(arguments[_0x216c15]){_0x34467b[_0x16de('0xd')](arguments[_0x216c15]);_0x216c15++;}_0x254627=util[_0x16de('0xe')]['apply'](util,_0x34467b);this['message']=_0x254627;this[_0x16de('0xf')]=_0x4defcb;}module[_0x16de('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index f7ca6e0..c0c7248 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 _0xa727=['getVertex','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','vertices','edges','prototype','addVertex','push','size','relations','numberOfEdges'];(function(_0x103722,_0x18533b){var _0x22f5c8=function(_0x272a8e){while(--_0x272a8e){_0x103722['push'](_0x103722['shift']());}};_0x22f5c8(++_0x18533b);}(_0xa727,0x16c));var _0x7a72=function(_0x33014c,_0x30f8a5){_0x33014c=_0x33014c-0x0;var _0x321f91=_0xa727[_0x33014c];return _0x321f91;};'use strict';var _=require(_0x7a72('0x0'));var logger=require(_0x7a72('0x1'))(_0x7a72('0x2'));var verticesWithRetry=[_0x7a72('0x3'),_0x7a72('0x4'),'getsecretdigits'];var Graph=function(){this[_0x7a72('0x5')]={};this[_0x7a72('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x7a72('0x7')][_0x7a72('0x8')]=function(_0x3609a2){this[_0x7a72('0x5')][_0x3609a2['id']]=_0x3609a2;this[_0x7a72('0x6')][_0x3609a2['id']]=[];};Graph['prototype']['addEdge']=function(_0x5b68e6,_0x39fdae,_0x2ee99b){this[_0x7a72('0x6')][_0x5b68e6][_0x7a72('0x9')]({'target':_0x39fdae,'condition':_0x2ee99b});this['numberOfEdges']+=0x1;};Graph[_0x7a72('0x7')][_0x7a72('0xa')]=function(){return _[_0x7a72('0xa')](this[_0x7a72('0x5')]);};Graph[_0x7a72('0x7')][_0x7a72('0xb')]=function(){return this[_0x7a72('0xc')];};Graph[_0x7a72('0x7')][_0x7a72('0xd')]=function(_0x159808){return this[_0x7a72('0x5')][_0x159808];};Graph['prototype'][_0x7a72('0xe')]=function(_0x3db6a0,_0x437720){if(!this[_0x7a72('0x5')][_0x3db6a0]){return logger['info'](_0x7a72('0xf'));}var _0x568431=_0x437720(this[_0x7a72('0x5')][_0x3db6a0]);if(!_0x568431){return logger[_0x7a72('0x10')]('stop\x20traverse');}if(this[_0x7a72('0x6')][_0x3db6a0][_0x7a72('0x11')]===0x0){return logger[_0x7a72('0x10')](_0x7a72('0x12'));}for(var _0x537e51=0x0,_0x552d90=[],_0x20a607=![];_0x537e51\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./vertices','defaults','agi','nextTick','error','stack','log','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','info','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','addEdge','source','target','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','toString','agicommand\x20not\x20found','finally'];(function(_0x25a2a2,_0x39d720){var _0x2adbe3=function(_0x3eea2c){while(--_0x3eea2c){_0x25a2a2['push'](_0x25a2a2['shift']());}};_0x2adbe3(++_0x39d720);}(_0x4a84,0x113));var _0x44a8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4a84[_0x502c7d];return _0x30b7ed;};'use strict';var parser=require(_0x44a8('0x0'));var _=require('lodash');var syncho=require(_0x44a8('0x1'));var util=require(_0x44a8('0x2'));var moment=require(_0x44a8('0x3'));var config=require(_0x44a8('0x4'));var logger=require(_0x44a8('0x5'))('agi');var utilLicense=require(_0x44a8('0x6'));var rpc=require(_0x44a8('0x7'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x44a8('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x44a8('0x9')](config[_0x44a8('0xa')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x1a4995){process[_0x44a8('0xb')](function(){syncho(function(){try{setChannelVariables(_0x1a4995);agiHandler(_0x1a4995);}catch(_0x5e025c){logger[_0x44a8('0xc')](_0x5e025c[_0x44a8('0xd')]);}});});}function listeningHandler(){console[_0x44a8('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x44a8('0xa')]['port']);logger['info'](util[_0x44a8('0xf')](_0x44a8('0x10'),config[_0x44a8('0xa')]['ip'],config[_0x44a8('0xa')]['port']));}function errorHandler(_0x29cbc6){if(_0x29cbc6&&_0x29cbc6[_0x44a8('0x11')]&&_0x29cbc6['message']){logger[_0x44a8('0xc')](util['format'](_0x44a8('0x12'),_0x29cbc6[_0x44a8('0x11')],_0x29cbc6[_0x44a8('0x13')]));}else{logger[_0x44a8('0xc')](util[_0x44a8('0xf')](_0x44a8('0x14'),_0x29cbc6[_0x44a8('0xd')]));}}function closeHandler(){logger['info'](util[_0x44a8('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x44a8('0x15')],this[_0x44a8('0x16')],this[_0x44a8('0x17')],this[_0x44a8('0x18')],this[_0x44a8('0x19')]));try{createSquareReport(this);}catch(_0x70293c){logger[_0x44a8('0xc')](_0x70293c[_0x44a8('0xd')]);}}function timeoutHandler(){logger[_0x44a8('0x1a')](util[_0x44a8('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x44a8('0x15')],this[_0x44a8('0x16')],this[_0x44a8('0x17')],this[_0x44a8('0x18')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x44a8('0xf')](_0x44a8('0x1b'),this[_0x44a8('0x15')],this[_0x44a8('0x16')],this[_0x44a8('0x17')],this[_0x44a8('0x18')],this[_0x44a8('0x19')]));this['evtHangup']=!![];}function getRoot(_0x95687e){return parser[_0x44a8('0x1c')](_0x95687e,{'object':!![]})['mxGraphModel'][_0x44a8('0x1d')];}function addVertex(_0x12d71a,_0x4e7b06,_0x3991ac){_0x4e7b06['agicommand']=_0x3991ac;if(_0x4e7b06[_0x44a8('0x1e')](_0x44a8('0x1f'))){_0x4e7b06[_0x44a8('0x20')]=parseInt(_0x4e7b06['retry'],0xa);}_0x12d71a[_0x44a8('0x21')](_[_0x44a8('0x22')](_0x4e7b06,_0x44a8('0x23')));}function initGraph(_0x4253d5,_0x4fc060){var _0x153791=new Graph();for(var _0x196dd8 in _0x4253d5){if(_0x4253d5[_0x44a8('0x1e')](_0x196dd8)){if(_['isArray'](_0x4253d5[_0x196dd8])){for(var _0x570eeb=0x0;_0x570eeb<_0x4253d5[_0x196dd8][_0x44a8('0x24')];_0x570eeb+=0x1){addVertex(_0x153791,_0x4253d5[_0x196dd8][_0x570eeb],_0x196dd8);}}else{addVertex(_0x153791,_0x4253d5[_0x196dd8],_0x196dd8);}}}for(var _0x1a1e6d=0x0;_0x1a1e6d<_0x4fc060[_0x44a8('0x24')];_0x1a1e6d+=0x1){if(_0x4fc060[_0x1a1e6d]['source']&&_0x4fc060[_0x1a1e6d]['target']){_0x153791[_0x44a8('0x25')](_0x4fc060[_0x1a1e6d][_0x44a8('0x26')],_0x4fc060[_0x1a1e6d][_0x44a8('0x27')],_0x4fc060[_0x1a1e6d]['value']);}}return _0x153791;}function getSquareProject(_0x1ea872,_0x3ca356){rpc[_0x44a8('0x28')](_0x1ea872)[_0x44a8('0x29')](function(_0x553483){_0x3ca356(null,_0x553483);})[_0x44a8('0x2a')](function(_0x3a118d){_0x3ca356(null,_0x3a118d);});}function createSquareReport(_0x4a2c7f,_0x288ae7){rpc[_0x44a8('0x2b')](_0x4a2c7f)[_0x44a8('0x29')](function(_0xf4dd5d){if(_0x288ae7){_0x288ae7(null,_0xf4dd5d);}})['catch'](function(_0x4809c5){if(_0x288ae7){_0x288ae7(null,_0x4809c5);}});}function setChannelVariables(_0xfae3c4){for(var _0x33fcd3 in _0xfae3c4){if(_0xfae3c4[_0x44a8('0x1e')](_0x33fcd3)){if(_0x33fcd3[_0x44a8('0x2c')](_0x44a8('0x2d'))===0x0){_0xfae3c4[_0x33fcd3[_0x44a8('0x2e')](0x4)]=_0xfae3c4[_0x33fcd3];delete _0xfae3c4[_0x33fcd3];}}}}function getLogFromObject(_0xc646ab){return util[_0x44a8('0x2f')](_0xc646ab,{'showHidden':![],'depth':null});}function agiHandler(_0x452efe){var _0x4b8f27,_0x178356,_0xbf340,_0x49a058,_0xc43f8d;logger[_0x44a8('0x30')](_0x44a8('0x31'),JSON[_0x44a8('0x32')](_0x452efe,null,0x2));logger[_0x44a8('0x1a')](util['format'](_0x44a8('0x33'),_0x452efe[_0x44a8('0x15')],_0x452efe[_0x44a8('0x16')],_0x452efe[_0x44a8('0x17')],_0x452efe[_0x44a8('0x18')],_0x452efe[_0x44a8('0x19')]));_0x452efe['on'](_0x44a8('0xc'),errorHandler);_0x452efe['on'](_0x44a8('0x34'),closeHandler);_0x452efe['on'](_0x44a8('0x35'),timeoutHandler);_0x452efe[_0x44a8('0x36')]=![];_0x452efe['on'](_0x44a8('0x37'),hangupHandler);var _0x48a841=getSquareProject['sync'](null,_0x452efe[_0x44a8('0x15')]);if(_0x48a841){if(_0x48a841[_0x44a8('0x38')]){_0x4b8f27=getRoot(_0x48a841['production']);if(_0x4b8f27&&_0x4b8f27[_0x44a8('0x39')]){logger['debug'](_0x44a8('0x1d'),JSON[_0x44a8('0x32')](_0x4b8f27,null,0x2));_0x452efe[_0x44a8('0x3a')]=moment()[_0x44a8('0xf')](_0x44a8('0x3b'));_0x178356=initGraph(_[_0x44a8('0x22')](_0x4b8f27,_0x44a8('0x23')),_0x4b8f27[_0x44a8('0x23')]);_0xbf340=new Vertices(_0x452efe,rpc,mailRpc);logger[_0x44a8('0x1a')](util[_0x44a8('0xf')](_0x44a8('0x3c'),_0x452efe[_0x44a8('0x15')],_0x452efe[_0x44a8('0x16')],_0x452efe[_0x44a8('0x17')],_0x452efe[_0x44a8('0x18')],_0x452efe[_0x44a8('0x19')]));_0x178356[_0x44a8('0x3d')](_0x4b8f27[_0x44a8('0x39')]['id'],function(_0x18d610){try{_0x18d610=_0xbf340[_0x44a8('0x3e')](_0x18d610);logger[_0x44a8('0x30')](_0x44a8('0x3f'),JSON[_0x44a8('0x32')](_0x18d610,null,0x2));if(_0x18d610[_0x44a8('0x40')]===_0x44a8('0x41')){logger[_0x44a8('0x1a')](_0x44a8('0x42'));_0x452efe['context']=_0x18d610['context']||_0x452efe[_0x44a8('0x43')];_0x452efe['extension']=_0x18d610['extension'];_0x452efe['priority']=_0x18d610[_0x44a8('0x44')]?_0x18d610[_0x44a8('0x44')]-0x1:0x1;return null;}else if(_0x18d610&&_0xbf340[_0x18d610[_0x44a8('0x40')]]){_0xc43f8d=_0xbf340[_0x18d610[_0x44a8('0x40')]](_0x18d610);logger[_0x44a8('0x1a')](_0x44a8('0x45'),JSON[_0x44a8('0x32')](_0xc43f8d,null,0x2));if(_0xc43f8d&&_0xc43f8d['code']===AGI_CODE_SUCCESS&&_0xc43f8d['result']!==AGI_RESULT_ERROR&&!_0x452efe['evtHangup']){logger[_0x44a8('0x30')]('response',getLogFromObject(_0xc43f8d));return _['isUndefined'](_0xc43f8d['result'])?null:_0xc43f8d['result'][_0x44a8('0x46')]();}else{logger['error'](_0x44a8('0x45'),getLogFromObject(_0xc43f8d));return null;}}else{logger[_0x44a8('0xc')](_0x44a8('0x47'));return null;}}catch(_0x1165d3){logger['error'](_0x1165d3[_0x44a8('0xd')]);return null;}});if(_0x4b8f27[_0x44a8('0x48')]){logger[_0x44a8('0x1a')](util[_0x44a8('0xf')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x452efe[_0x44a8('0x15')],_0x452efe['calleridname'],_0x452efe[_0x44a8('0x17')],_0x452efe['dnid'],_0x452efe[_0x44a8('0x19')]));_0x178356[_0x44a8('0x3d')](_0x4b8f27[_0x44a8('0x48')]['id'],function(_0x24a58f){try{_0x24a58f=_0xbf340[_0x44a8('0x3e')](_0x24a58f);logger['debug'](_0x44a8('0x3f'),JSON[_0x44a8('0x32')](_0x24a58f,null,0x2));if(_0x24a58f&&_0xbf340[_0x24a58f['agicommand']]){_0xc43f8d=_0xbf340[_0x24a58f[_0x44a8('0x40')]](_0x24a58f);if(_0xc43f8d){logger['debug']('response',getLogFromObject(_0xc43f8d));return _['isUndefined'](_0xc43f8d['result'])?null:_0xc43f8d[_0x44a8('0x49')][_0x44a8('0x46')]();}else{logger[_0x44a8('0xc')](_0x44a8('0x45'),getLogFromObject(_0xc43f8d));return null;}}else{logger['error'](_0x44a8('0x47'));return null;}}catch(_0x3a334f){logger[_0x44a8('0xc')](_0x3a334f[_0x44a8('0xd')]);return null;}});}logger['info'](util['format'](_0x44a8('0x4a'),_0x452efe[_0x44a8('0x15')],_0x452efe[_0x44a8('0x16')],_0x452efe['callerid'],_0x452efe['dnid'],_0x452efe[_0x44a8('0x19')]));logger['info'](util['format'](_0x44a8('0x4b'),_0x452efe['context'],_0x452efe[_0x44a8('0x4c')],parseInt(_0x452efe['priority'],0xa)+0x1));_0x452efe[_0x44a8('0x4d')](_0x452efe[_0x44a8('0x43')],_0x452efe[_0x44a8('0x4c')],parseInt(_0x452efe[_0x44a8('0x44')],0xa)+0x1);_0x452efe[_0x44a8('0x34')]();}}else{logger[_0x44a8('0xc')](util[_0x44a8('0xf')](_0x44a8('0x4e'),_0x452efe[_0x44a8('0x15')]));_0x452efe[_0x44a8('0x4d')](_0x452efe[_0x44a8('0x43')],_0x452efe[_0x44a8('0x4c')],parseInt(_0x452efe[_0x44a8('0x44')],0xa)+0x1);_0x452efe[_0x44a8('0x34')]();}}else{logger[_0x44a8('0xc')](util['format'](_0x44a8('0x4f'),_0x452efe[_0x44a8('0x15')]));_0x452efe[_0x44a8('0x4d')](_0x452efe[_0x44a8('0x43')],_0x452efe[_0x44a8('0x4c')],parseInt(_0x452efe['priority'],0xa)+0x1);_0x452efe['close']();}}function main(){var _0x19d559;return utilLicense['getLicense']()[_0x44a8('0x29')](function(_0x269e7b){if(_0x269e7b){if(_0x269e7b[_0x44a8('0x50')]){if(_0x269e7b[_0x44a8('0x51')]&&_0x269e7b[_0x44a8('0x51')]>0x0){logger[_0x44a8('0x1a')](util[_0x44a8('0xf')](_0x44a8('0x52'),_0x269e7b[_0x44a8('0x51')]));_0x19d559=_0x269e7b[_0x44a8('0x51')];}else{logger[_0x44a8('0x1a')](_0x44a8('0x53'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x19d559=-0x1;}}})['catch'](function(_0x4d80f9){logger[_0x44a8('0xc')](_0x44a8('0x54'),_0x4d80f9['stack']);})[_0x44a8('0x48')](function(){var _0x59e8c3=require('./server')(config[_0x44a8('0xa')]['port'],config[_0x44a8('0xa')]['ip'],_0x19d559);_0x59e8c3['on'](_0x44a8('0xc'),errorHandler);_0x59e8c3['on'](_0x44a8('0x55'),listeningHandler);_0x59e8c3['on'](_0x44a8('0x56'),connectionHandler);_0x59e8c3['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xa62c=['[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','xml2json','lodash','util','moment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','[ERROR]\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','value','getSquareProject','then','catch','createSquareReport','indexOf','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','agicommand\x20not\x20found','[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','getLicense','voice','callysquare'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0xa62c,0x172));var _0xca62=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0xa62c[_0x533132];return _0x1a7447;};'use strict';var parser=require(_0xca62('0x0'));var _=require(_0xca62('0x1'));var syncho=require('syncho');var util=require(_0xca62('0x2'));var moment=require(_0xca62('0x3'));var config=require('../../config/environment');var logger=require(_0xca62('0x4'))(_0xca62('0x5'));var utilLicense=require(_0xca62('0x6'));var rpc=require('./rpc');var mailRpc=require(_0xca62('0x7'));var Graph=require(_0xca62('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xca62('0x5')]=_[_0xca62('0x9')](config[_0xca62('0x5')],{'ip':_0xca62('0xa'),'port':0x11dd});function connectionHandler(_0x1d580a){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1d580a);agiHandler(_0x1d580a);}catch(_0x4bc901){logger[_0xca62('0xb')](_0x4bc901[_0xca62('0xc')]);}});});}function listeningHandler(){console[_0xca62('0xd')](_0xca62('0xe'),config[_0xca62('0x5')]['port']);logger[_0xca62('0xf')](util[_0xca62('0x10')](_0xca62('0x11'),config[_0xca62('0x5')]['ip'],config[_0xca62('0x5')][_0xca62('0x12')]));}function errorHandler(_0x56d9ca){if(_0x56d9ca&&_0x56d9ca[_0xca62('0x13')]&&_0x56d9ca['message']){logger[_0xca62('0xb')](util[_0xca62('0x10')](_0xca62('0x14'),_0x56d9ca[_0xca62('0x13')],_0x56d9ca[_0xca62('0x15')]));}else{logger[_0xca62('0xb')](util[_0xca62('0x10')](_0xca62('0x16'),_0x56d9ca[_0xca62('0xc')]));}}function closeHandler(){logger[_0xca62('0xf')](util[_0xca62('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xca62('0x17')],this[_0xca62('0x18')],this['callerid'],this[_0xca62('0x19')],this[_0xca62('0x1a')]));try{createSquareReport(this);}catch(_0x2f088a){logger[_0xca62('0xb')](_0x2f088a['stack']);}}function timeoutHandler(){logger[_0xca62('0xf')](util[_0xca62('0x10')](_0xca62('0x1b'),this[_0xca62('0x17')],this[_0xca62('0x18')],this['callerid'],this[_0xca62('0x19')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xca62('0x10')](_0xca62('0x1c'),this[_0xca62('0x17')],this[_0xca62('0x18')],this[_0xca62('0x1d')],this[_0xca62('0x19')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x6162d1){return parser[_0xca62('0x1e')](_0x6162d1,{'object':!![]})[_0xca62('0x1f')][_0xca62('0x20')];}function addVertex(_0x56eb3b,_0x101954,_0x464496){_0x101954[_0xca62('0x21')]=_0x464496;if(_0x101954['hasOwnProperty'](_0xca62('0x22'))){_0x101954[_0xca62('0x23')]=parseInt(_0x101954[_0xca62('0x22')],0xa);}_0x56eb3b[_0xca62('0x24')](_[_0xca62('0x25')](_0x101954,_0xca62('0x26')));}function initGraph(_0x2ce773,_0x122ccd){var _0x200f67=new Graph();for(var _0xe8fc6c in _0x2ce773){if(_0x2ce773[_0xca62('0x27')](_0xe8fc6c)){if(_[_0xca62('0x28')](_0x2ce773[_0xe8fc6c])){for(var _0x1d828=0x0;_0x1d828<_0x2ce773[_0xe8fc6c][_0xca62('0x29')];_0x1d828+=0x1){addVertex(_0x200f67,_0x2ce773[_0xe8fc6c][_0x1d828],_0xe8fc6c);}}else{addVertex(_0x200f67,_0x2ce773[_0xe8fc6c],_0xe8fc6c);}}}for(var _0x1bd6d8=0x0;_0x1bd6d8<_0x122ccd[_0xca62('0x29')];_0x1bd6d8+=0x1){if(_0x122ccd[_0x1bd6d8][_0xca62('0x2a')]&&_0x122ccd[_0x1bd6d8][_0xca62('0x2b')]){_0x200f67['addEdge'](_0x122ccd[_0x1bd6d8][_0xca62('0x2a')],_0x122ccd[_0x1bd6d8][_0xca62('0x2b')],_0x122ccd[_0x1bd6d8][_0xca62('0x2c')]);}}return _0x200f67;}function getSquareProject(_0x1b67db,_0x2f457f){rpc[_0xca62('0x2d')](_0x1b67db)[_0xca62('0x2e')](function(_0x4dcf4b){_0x2f457f(null,_0x4dcf4b);})[_0xca62('0x2f')](function(_0x51797a){_0x2f457f(null,_0x51797a);});}function createSquareReport(_0x239e9e,_0x43a7fe){rpc[_0xca62('0x30')](_0x239e9e)[_0xca62('0x2e')](function(_0x36057e){if(_0x43a7fe){_0x43a7fe(null,_0x36057e);}})[_0xca62('0x2f')](function(_0x4375d9){if(_0x43a7fe){_0x43a7fe(null,_0x4375d9);}});}function setChannelVariables(_0x30cf4d){for(var _0x571995 in _0x30cf4d){if(_0x30cf4d[_0xca62('0x27')](_0x571995)){if(_0x571995[_0xca62('0x31')]('agi_')===0x0){_0x30cf4d[_0x571995['substring'](0x4)]=_0x30cf4d[_0x571995];delete _0x30cf4d[_0x571995];}}}}function getLogFromObject(_0x4a88d3){return util[_0xca62('0x32')](_0x4a88d3,{'showHidden':![],'depth':null});}function agiHandler(_0x1c0949){var _0x29b4f3,_0x3fa74f,_0x12464a,_0x44c489,_0x4fcb04;logger[_0xca62('0x33')]('variables',JSON[_0xca62('0x34')](_0x1c0949,null,0x2));logger['info'](util[_0xca62('0x10')](_0xca62('0x35'),_0x1c0949[_0xca62('0x17')],_0x1c0949['calleridname'],_0x1c0949[_0xca62('0x1d')],_0x1c0949[_0xca62('0x19')],_0x1c0949[_0xca62('0x1a')]));_0x1c0949['on'](_0xca62('0xb'),errorHandler);_0x1c0949['on'](_0xca62('0x36'),closeHandler);_0x1c0949['on'](_0xca62('0x37'),timeoutHandler);_0x1c0949[_0xca62('0x38')]=![];_0x1c0949['on'](_0xca62('0x39'),hangupHandler);var _0x34c9c2=getSquareProject[_0xca62('0x3a')](null,_0x1c0949['arg_1']);if(_0x34c9c2){if(_0x34c9c2[_0xca62('0x3b')]){_0x29b4f3=getRoot(_0x34c9c2[_0xca62('0x3b')]);if(_0x29b4f3&&_0x29b4f3[_0xca62('0x3c')]){logger[_0xca62('0x33')]('root',JSON[_0xca62('0x34')](_0x29b4f3,null,0x2));_0x1c0949[_0xca62('0x3d')]=moment()[_0xca62('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fa74f=initGraph(_[_0xca62('0x25')](_0x29b4f3,_0xca62('0x26')),_0x29b4f3[_0xca62('0x26')]);_0x12464a=new Vertices(_0x1c0949,rpc,mailRpc);logger[_0xca62('0xf')](util[_0xca62('0x10')](_0xca62('0x3e'),_0x1c0949[_0xca62('0x17')],_0x1c0949[_0xca62('0x18')],_0x1c0949[_0xca62('0x1d')],_0x1c0949[_0xca62('0x19')],_0x1c0949[_0xca62('0x1a')]));_0x3fa74f[_0xca62('0x3f')](_0x29b4f3[_0xca62('0x3c')]['id'],function(_0x1270dc){try{_0x1270dc=_0x12464a[_0xca62('0x40')](_0x1270dc);logger[_0xca62('0x33')]('vertex',JSON[_0xca62('0x34')](_0x1270dc,null,0x2));if(_0x1270dc[_0xca62('0x21')]===_0xca62('0x41')){logger[_0xca62('0xf')](_0xca62('0x42'));_0x1c0949[_0xca62('0x43')]=_0x1270dc['context']||_0x1c0949['context'];_0x1c0949[_0xca62('0x44')]=_0x1270dc['extension'];_0x1c0949['priority']=_0x1270dc['priority']?_0x1270dc[_0xca62('0x45')]-0x1:0x1;return null;}else if(_0x1270dc&&_0x12464a[_0x1270dc['agicommand']]){_0x4fcb04=_0x12464a[_0x1270dc[_0xca62('0x21')]](_0x1270dc);logger[_0xca62('0xf')](_0xca62('0x46'),JSON[_0xca62('0x34')](_0x4fcb04,null,0x2));if(_0x4fcb04&&_0x4fcb04[_0xca62('0x47')]===AGI_CODE_SUCCESS&&_0x4fcb04[_0xca62('0x48')]!==AGI_RESULT_ERROR&&!_0x1c0949[_0xca62('0x38')]){logger[_0xca62('0x33')](_0xca62('0x46'),getLogFromObject(_0x4fcb04));return _[_0xca62('0x49')](_0x4fcb04[_0xca62('0x48')])?null:_0x4fcb04[_0xca62('0x48')][_0xca62('0x4a')]();}else{logger['error'](_0xca62('0x46'),getLogFromObject(_0x4fcb04));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x2ac98e){logger[_0xca62('0xb')](_0x2ac98e[_0xca62('0xc')]);return null;}});if(_0x29b4f3[_0xca62('0x4b')]){logger[_0xca62('0xf')](util[_0xca62('0x10')](_0xca62('0x4c'),_0x1c0949[_0xca62('0x17')],_0x1c0949[_0xca62('0x18')],_0x1c0949['callerid'],_0x1c0949[_0xca62('0x19')],_0x1c0949[_0xca62('0x1a')]));_0x3fa74f[_0xca62('0x3f')](_0x29b4f3[_0xca62('0x4b')]['id'],function(_0xec619c){try{_0xec619c=_0x12464a[_0xca62('0x40')](_0xec619c);logger[_0xca62('0x33')](_0xca62('0x4d'),JSON['stringify'](_0xec619c,null,0x2));if(_0xec619c&&_0x12464a[_0xec619c[_0xca62('0x21')]]){_0x4fcb04=_0x12464a[_0xec619c[_0xca62('0x21')]](_0xec619c);if(_0x4fcb04){logger[_0xca62('0x33')]('response',getLogFromObject(_0x4fcb04));return _['isUndefined'](_0x4fcb04[_0xca62('0x48')])?null:_0x4fcb04[_0xca62('0x48')][_0xca62('0x4a')]();}else{logger[_0xca62('0xb')]('response',getLogFromObject(_0x4fcb04));return null;}}else{logger[_0xca62('0xb')](_0xca62('0x4e'));return null;}}catch(_0x45da05){logger['error'](_0x45da05['stack']);return null;}});}logger['info'](util[_0xca62('0x10')](_0xca62('0x4f'),_0x1c0949['arg_1'],_0x1c0949[_0xca62('0x18')],_0x1c0949[_0xca62('0x1d')],_0x1c0949[_0xca62('0x19')],_0x1c0949[_0xca62('0x1a')]));logger[_0xca62('0xf')](util[_0xca62('0x10')](_0xca62('0x50'),_0x1c0949[_0xca62('0x43')],_0x1c0949['extension'],parseInt(_0x1c0949[_0xca62('0x45')],0xa)+0x1));_0x1c0949['continueAt'](_0x1c0949[_0xca62('0x43')],_0x1c0949[_0xca62('0x44')],parseInt(_0x1c0949['priority'],0xa)+0x1);_0x1c0949['close']();}}else{logger['error'](util[_0xca62('0x10')]('Project\x20%s\x20not\x20published',_0x1c0949['arg_1']));_0x1c0949[_0xca62('0x51')](_0x1c0949[_0xca62('0x43')],_0x1c0949[_0xca62('0x44')],parseInt(_0x1c0949[_0xca62('0x45')],0xa)+0x1);_0x1c0949[_0xca62('0x36')]();}}else{logger[_0xca62('0xb')](util['format']('Project\x20%s\x20not\x20found',_0x1c0949[_0xca62('0x17')]));_0x1c0949[_0xca62('0x51')](_0x1c0949[_0xca62('0x43')],_0x1c0949[_0xca62('0x44')],parseInt(_0x1c0949[_0xca62('0x45')],0xa)+0x1);_0x1c0949[_0xca62('0x36')]();}}function main(){var _0x30c28c;return utilLicense[_0xca62('0x52')]()[_0xca62('0x2e')](function(_0x3a7693){if(_0x3a7693){if(_0x3a7693[_0xca62('0x53')]){if(_0x3a7693[_0xca62('0x54')]&&_0x3a7693[_0xca62('0x54')]>0x0){logger[_0xca62('0xf')](util[_0xca62('0x10')](_0xca62('0x55'),_0x3a7693[_0xca62('0x54')]));_0x30c28c=_0x3a7693['callysquare'];}else{logger[_0xca62('0xf')](_0xca62('0x56'));}}else{logger[_0xca62('0xf')](_0xca62('0x57'));_0x30c28c=-0x1;}}})[_0xca62('0x2f')](function(_0x11c6f4){logger['error'](_0xca62('0x58'),_0x11c6f4['stack']);})[_0xca62('0x4b')](function(){var _0x4ad3f9=require('./server')(config[_0xca62('0x5')]['port'],config['agi']['ip'],_0x30c28c);_0x4ad3f9['on'](_0xca62('0xb'),errorHandler);_0x4ad3f9['on'](_0xca62('0x59'),listeningHandler);_0x4ad3f9['on'](_0xca62('0x5a'),connectionHandler);_0x4ad3f9['on'](_0xca62('0x36'),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 a7df390..523071a 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 _0xc000=['error','message','result','bluebird','client','http','request'];(function(_0xdea1ee,_0x2d2841){var _0x96c530=function(_0x4e743b){while(--_0x4e743b){_0xdea1ee['push'](_0xdea1ee['shift']());}};_0x96c530(++_0x2d2841);}(_0xc000,0x130));var _0x0c00=function(_0x5ae868,_0x283ced){_0x5ae868=_0x5ae868-0x0;var _0x3a9178=_0xc000[_0x5ae868];return _0x3a9178;};'use strict';var BPromise=require(_0x0c00('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x0c00('0x1')][_0x0c00('0x2')]({'port':0x232b});function request(_0x2a9db2,_0xf8afa9){return new BPromise(function(_0x35e6cf,_0x59dbaa){return client[_0x0c00('0x3')](_0x2a9db2,_0xf8afa9)['then'](function(_0x4e22aa){if(_0x4e22aa['error']){return _0x59dbaa(_0x4e22aa[_0x0c00('0x4')][_0x0c00('0x5')]);}else{return _0x35e6cf(_0x4e22aa[_0x0c00('0x6')]);}})['catch'](function(_0x26015e){return _0x59dbaa(_0x26015e);});});}exports['sendMailMessage']=function(_0x22da95,_0x2362bd){return request('SendMail',{'account':_0x22da95,'message':_0x2362bd});}; \ No newline at end of file +var _0xb490=['message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error'];(function(_0x5be509,_0x41d6fd){var _0x35a415=function(_0x602fdc){while(--_0x602fdc){_0x5be509['push'](_0x5be509['shift']());}};_0x35a415(++_0x41d6fd);}(_0xb490,0x9e));var _0x0b49=function(_0x48a446,_0x152dad){_0x48a446=_0x48a446-0x0;var _0x411430=_0xb490[_0x48a446];return _0x411430;};'use strict';var BPromise=require(_0x0b49('0x0'));var jayson=require(_0x0b49('0x1'));var client=jayson[_0x0b49('0x2')][_0x0b49('0x3')]({'port':0x232b});function request(_0x1ea701,_0x521c2f){return new BPromise(function(_0x509965,_0x49b564){return client[_0x0b49('0x4')](_0x1ea701,_0x521c2f)[_0x0b49('0x5')](function(_0xf04baa){if(_0xf04baa['error']){return _0x49b564(_0xf04baa[_0x0b49('0x6')][_0x0b49('0x7')]);}else{return _0x509965(_0xf04baa['result']);}})[_0x0b49('0x8')](function(_0x361a1a){return _0x49b564(_0x361a1a);});});}exports[_0x0b49('0x9')]=function(_0x36d234,_0x457862){return request(_0x0b49('0xa'),{'account':_0x36d234,'message':_0x457862});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 3d2e0d3..b3d5a81 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 _0x2d1c=['line','exports','util','stream','Transform','call','_localBuffer','_inBody','\x0d\x0a\x0d\x0a','toString','substring','length','indexOf','slice','trim','emit','headers'];(function(_0x39222a,_0x67ff00){var _0x161fc2=function(_0x5a4403){while(--_0x5a4403){_0x39222a['push'](_0x39222a['shift']());}};_0x161fc2(++_0x67ff00);}(_0x2d1c,0x134));var _0xc2d1=function(_0x223e15,_0x28e7c6){_0x223e15=_0x223e15-0x0;var _0x7c1355=_0x2d1c[_0x223e15];return _0x7c1355;};'use strict';var util=require(_0xc2d1('0x0'));var Transform=require(_0xc2d1('0x1'))[_0xc2d1('0x2')];function AGIReply(_0x438690){Transform[_0xc2d1('0x3')](this,_0x438690);this[_0xc2d1('0x4')]='';this[_0xc2d1('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0xfc58c0,_0x3ccc25,_0x329c52){var _0x1f68b3='\x0a',_0x1b8e3e=['\x0a\x0a',_0xc2d1('0x6')],_0x2567e1=-0x1,_0x5c977e=-0x1,_0xa2d9e7='',_0x1576e6=0x0,_0x9326c4='',_0x4e8c74='';this[_0xc2d1('0x4')]+=_0xfc58c0[_0xc2d1('0x7')]();_0x9326c4=this[_0xc2d1('0x4')];if(!this[_0xc2d1('0x5')]){_0x1576e6=0x0;while(_0x1b8e3e[_0x1576e6]){while((_0x5c977e=_0x9326c4['indexOf'](_0x1b8e3e[_0x1576e6]))!=-0x1){_0xa2d9e7=_0x1b8e3e[_0x1576e6];_0x4e8c74=_0x9326c4[_0xc2d1('0x8')](0x0,_0x5c977e);_0x9326c4=_0x9326c4[_0xc2d1('0x8')](_0x5c977e+_0xa2d9e7[_0xc2d1('0x9')]);var _0x316d48=_0x4e8c74['split'](_0x1f68b3),_0x5d2e89=0x0,_0x378542={},_0x2c93eb='',_0x1df6c5='',_0x3194db=-0x1;while(_0x316d48[_0x5d2e89]){_0x3194db=_0x316d48[_0x5d2e89][_0xc2d1('0xa')](':');if(_0x3194db!=-0x1){_0x2c93eb=_0x316d48[_0x5d2e89][_0xc2d1('0xb')](0x0,_0x3194db)[_0xc2d1('0xc')]();_0x1df6c5=_0x316d48[_0x5d2e89][_0xc2d1('0xb')](_0x3194db+0x1)['trim']();if(_0x2c93eb[_0xc2d1('0x9')]>0x0){_0x378542[_0x2c93eb]=_0x1df6c5;}}else{}_0x5d2e89++;}this[_0xc2d1('0xd')](_0xc2d1('0xe'),_0x378542);this['_inBody']=!![];}_0x1576e6++;}this[_0xc2d1('0x4')]=_0x9326c4;}else{while((_0x2567e1=_0x9326c4[_0xc2d1('0xa')](_0x1f68b3))!=-0x1){_0x4e8c74=_0x9326c4['substring'](0x0,_0x2567e1);this[_0xc2d1('0xd')](_0xc2d1('0xf'),_0x4e8c74);_0x9326c4=_0x9326c4['substring'](_0x2567e1+_0x1f68b3['length']);}this[_0xc2d1('0x4')]=_0x9326c4;}_0x329c52();};module[_0xc2d1('0x10')]=AGIReply; \ No newline at end of file +var _0x9652=['stream','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','emit','line','exports','util'];(function(_0x570f5a,_0x35d9d6){var _0x1ec0bf=function(_0xd9c15d){while(--_0xd9c15d){_0x570f5a['push'](_0x570f5a['shift']());}};_0x1ec0bf(++_0x35d9d6);}(_0x9652,0xaf));var _0x2965=function(_0x114bf1,_0x16ac4a){_0x114bf1=_0x114bf1-0x0;var _0x58072f=_0x9652[_0x114bf1];return _0x58072f;};'use strict';var util=require(_0x2965('0x0'));var Transform=require(_0x2965('0x1'))['Transform'];function AGIReply(_0x41dbb1){Transform[_0x2965('0x2')](this,_0x41dbb1);this[_0x2965('0x3')]='';this[_0x2965('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x2965('0x5')]=function(_0x2a06e9,_0x4eb258,_0x5205c7){var _0x4c347e='\x0a',_0x694054=['\x0a\x0a',_0x2965('0x6')],_0x4a51b2=-0x1,_0x31e39f=-0x1,_0x3be4b1='',_0x33ce11=0x0,_0x5be054='',_0x3a0c3f='';this[_0x2965('0x3')]+=_0x2a06e9[_0x2965('0x7')]();_0x5be054=this[_0x2965('0x3')];if(!this['_inBody']){_0x33ce11=0x0;while(_0x694054[_0x33ce11]){while((_0x31e39f=_0x5be054[_0x2965('0x8')](_0x694054[_0x33ce11]))!=-0x1){_0x3be4b1=_0x694054[_0x33ce11];_0x3a0c3f=_0x5be054[_0x2965('0x9')](0x0,_0x31e39f);_0x5be054=_0x5be054['substring'](_0x31e39f+_0x3be4b1[_0x2965('0xa')]);var _0x273fcb=_0x3a0c3f['split'](_0x4c347e),_0xeef1ff=0x0,_0x112335={},_0x3fa1a0='',_0x355997='',_0x23164b=-0x1;while(_0x273fcb[_0xeef1ff]){_0x23164b=_0x273fcb[_0xeef1ff][_0x2965('0x8')](':');if(_0x23164b!=-0x1){_0x3fa1a0=_0x273fcb[_0xeef1ff][_0x2965('0xb')](0x0,_0x23164b)[_0x2965('0xc')]();_0x355997=_0x273fcb[_0xeef1ff][_0x2965('0xb')](_0x23164b+0x1)[_0x2965('0xc')]();if(_0x3fa1a0[_0x2965('0xa')]>0x0){_0x112335[_0x3fa1a0]=_0x355997;}}else{}_0xeef1ff++;}this[_0x2965('0xd')]('headers',_0x112335);this[_0x2965('0x4')]=!![];}_0x33ce11++;}this[_0x2965('0x3')]=_0x5be054;}else{while((_0x4a51b2=_0x5be054['indexOf'](_0x4c347e))!=-0x1){_0x3a0c3f=_0x5be054[_0x2965('0x9')](0x0,_0x4a51b2);this[_0x2965('0xd')](_0x2965('0xe'),_0x3a0c3f);_0x5be054=_0x5be054[_0x2965('0x9')](_0x4a51b2+_0x4c347e[_0x2965('0xa')]);}this[_0x2965('0x3')]=_0x5be054;}_0x5205c7();};module[_0x2965('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index b070dbc..887b252 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 _0x9cf5=['ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','util','jayson/promise','client','http','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9cf5,0x140));var _0x59cf=function(_0x55ae19,_0x54351f){_0x55ae19=_0x55ae19-0x0;var _0x587dfc=_0x9cf5[_0x55ae19];return _0x587dfc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x59cf('0x0'));var _=require('lodash');var util=require(_0x59cf('0x1'));var jayson=require(_0x59cf('0x2'));var client=jayson[_0x59cf('0x3')][_0x59cf('0x4')]({'port':0x2329});function request(_0x5da0db,_0x534bd8){return new BPromise(function(_0xa0a49b,_0x1b5c04){return client['request'](_0x5da0db,_0x534bd8)['then'](function(_0x14d026){if(_0x14d026[_0x59cf('0x5')]){return _0x1b5c04(_0x14d026['error'][_0x59cf('0x6')]);}else{return _0xa0a49b(_0x14d026[_0x59cf('0x7')]);}})[_0x59cf('0x8')](function(_0xc08bfc){return _0x1b5c04(_0xc08bfc);});});}exports['getSquareProject']=function(_0x4235e8){return request(_0x59cf('0x9'),{'options':{'raw':![],'where':{'name':_0x4235e8},'attributes':[_0x59cf('0xa')]}});};exports[_0x59cf('0xb')]=function(_0x38b92d){return request(_0x59cf('0xc'),{'options':{'raw':![],'where':{'id':_0x38b92d},'include':[{'model':_0x59cf('0xd'),'as':_0x59cf('0xe')}],'attributes':['id',_0x59cf('0xf'),_0x59cf('0x10')]}});};exports[_0x59cf('0x11')]=function(_0x411d9e){return request(_0x59cf('0x9'),{'options':{'where':{'id':_0x411d9e},'attributes':[_0x59cf('0xf')]}});};exports['getVoiceQueueById']=function(_0x40023f){return request(_0x59cf('0x12'),{'options':{'where':{'id':_0x40023f},'attributes':['name']}});};exports['getVariableById']=function(_0x563308){return request(_0x59cf('0x13'),{'options':{'where':{'id':_0x563308},'attributes':[_0x59cf('0xf')]}});};exports[_0x59cf('0x14')]=function(_0x4aaacd){return request(_0x59cf('0x15'),{'options':{'where':{'id':_0x4aaacd},'attributes':[_0x59cf('0x16')]}});};exports['getUserById']=function(_0x132d2e){return request('ShowUser',{'options':{'where':{'id':_0x132d2e},'attributes':[_0x59cf('0xf')]}});};exports[_0x59cf('0x17')]=function(_0x4eb89e){return request(_0x59cf('0x18'),{'options':{'where':{'id':_0x4eb89e},'attributes':[_0x59cf('0xf')]}});};exports[_0x59cf('0x19')]=function(_0xb22d70){return request(_0x59cf('0x1a'),{'options':{'where':{'id':_0xb22d70},'attributes':[_0x59cf('0x1b')]}});};exports[_0x59cf('0x1c')]=function(_0xa68411){return request(_0x59cf('0x1d'),{'options':{'raw':![],'where':{'id':_0xa68411},'include':[{'model':_0x59cf('0x1e'),'as':_0x59cf('0x1f')}]}});};exports[_0x59cf('0x20')]=function(_0x461f5b){return request('ShowSmsAccount',{'options':{'where':{'id':_0x461f5b},'attributes':['id','name']}});};exports[_0x59cf('0x21')]=function(_0x510ed7){return request(_0x59cf('0x22'),{'body':_0x510ed7});};exports[_0x59cf('0x23')]=function(_0x3ebc4a){return request(_0x59cf('0x24'),{'body':_0x3ebc4a});};exports['createSquareReport']=function(_0x17597a){return request(_0x59cf('0x25'),{'body':_[_0x59cf('0x26')](_0x17597a,{'project_name':_0x17597a['arg_1'],'prev_project_name':_0x17597a[_0x59cf('0x27')]||'','is_subproject':_0x17597a[_0x59cf('0x27')]?!![]:![],'leaveAt':moment()[_0x59cf('0x28')](_0x59cf('0x29'))})});};exports['createSquareRecording']=function(_0x3c56c8){return request(_0x59cf('0x2a'),{'body':_0x3c56c8});};exports[_0x59cf('0x2b')]=function(_0x4035af){return request(_0x59cf('0x2c'),{'body':_0x4035af});};exports[_0x59cf('0x2d')]=function(_0x2ee36a){return request(_0x59cf('0x2e'),{'options':{'raw':![],'where':{'phone':_0x2ee36a[_0x59cf('0x2f')],'ListId':_0x2ee36a[_0x59cf('0x30')]}}})[_0x59cf('0x31')](function(_0x47a0e5){if(_0x47a0e5){return _0x47a0e5;}return request(_0x59cf('0x32'),{'body':_0x2ee36a});});};exports[_0x59cf('0x33')]=function(_0x2f4945){return request(_0x59cf('0x34'),{'options':{'where':{'id':_0x2f4945},'attributes':[_0x59cf('0xf')]}});};exports[_0x59cf('0x35')]=function(_0x1cca58,_0x5efe6f){return request(_0x59cf('0x36'),{'body':{'interface':_0x5efe6f},'options':{'where':_0x1cca58}});};exports[_0x59cf('0x37')]=function(_0x1dc516,_0x2d97d0,_0x406b80){return request(_0x59cf('0x38'),{'body':{'type':_0x2d97d0,'uniqueid':_0x406b80},'options':{'where':_0x1dc516}});};exports[_0x59cf('0x39')]=function(_0xa7858f){return request(_0x59cf('0x3a'),{'body':{},'options':{'where':_0xa7858f}});};exports[_0x59cf('0x3b')]=function(_0x38fb83){return request(_0x59cf('0x3c'),{'body':{},'options':{'where':_0x38fb83}});}; \ No newline at end of file +var _0x00be=['YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentUnpause','agentLogout','LogoutUser','bluebird','lodash','util','jayson/promise','client','http','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x00be,0x170));var _0xe00b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x00be[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require(_0xe00b('0x0'));var moment=require('moment');var _=require(_0xe00b('0x1'));var util=require(_0xe00b('0x2'));var jayson=require(_0xe00b('0x3'));var client=jayson[_0xe00b('0x4')][_0xe00b('0x5')]({'port':0x2329});function request(_0x550d61,_0x290f36){return new BPromise(function(_0x4f51cb,_0xd36cea){return client['request'](_0x550d61,_0x290f36)[_0xe00b('0x6')](function(_0x328574){if(_0x328574[_0xe00b('0x7')]){return _0xd36cea(_0x328574[_0xe00b('0x7')][_0xe00b('0x8')]);}else{return _0x4f51cb(_0x328574[_0xe00b('0x9')]);}})[_0xe00b('0xa')](function(_0x314f7d){return _0xd36cea(_0x314f7d);});});}exports[_0xe00b('0xb')]=function(_0x21022d){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x21022d},'attributes':[_0xe00b('0xc')]}});};exports[_0xe00b('0xd')]=function(_0x5df9c2){return request(_0xe00b('0xe'),{'options':{'raw':![],'where':{'id':_0x5df9c2},'include':[{'model':_0xe00b('0xf'),'as':_0xe00b('0x10')}],'attributes':['id','name',_0xe00b('0x11')]}});};exports[_0xe00b('0x12')]=function(_0x1c3a1b){return request(_0xe00b('0x13'),{'options':{'where':{'id':_0x1c3a1b},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x2939fd){return request(_0xe00b('0x14'),{'options':{'where':{'id':_0x2939fd},'attributes':[_0xe00b('0x15')]}});};exports[_0xe00b('0x16')]=function(_0x9c0d3c){return request(_0xe00b('0x17'),{'options':{'where':{'id':_0x9c0d3c},'attributes':[_0xe00b('0x15')]}});};exports[_0xe00b('0x18')]=function(_0xb533ee){return request(_0xe00b('0x19'),{'options':{'where':{'id':_0xb533ee},'attributes':[_0xe00b('0x1a')]}});};exports[_0xe00b('0x1b')]=function(_0x3d5d39){return request(_0xe00b('0x1c'),{'options':{'where':{'id':_0x3d5d39},'attributes':[_0xe00b('0x15')]}});};exports[_0xe00b('0x1d')]=function(_0x298812){return request(_0xe00b('0x1e'),{'options':{'where':{'id':_0x298812},'attributes':[_0xe00b('0x15')]}});};exports[_0xe00b('0x1f')]=function(_0x522a2b){return request('ShowSound',{'options':{'where':{'id':_0x522a2b},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x133d47){return request(_0xe00b('0x20'),{'options':{'raw':![],'where':{'id':_0x133d47},'include':[{'model':_0xe00b('0x21'),'as':_0xe00b('0x22')}]}});};exports[_0xe00b('0x23')]=function(_0x190b16){return request(_0xe00b('0x24'),{'options':{'where':{'id':_0x190b16},'attributes':['id',_0xe00b('0x15')]}});};exports[_0xe00b('0x25')]=function(_0x1db304){return request(_0xe00b('0x26'),{'body':_0x1db304});};exports['createSquareDetailsReport']=function(_0x4028b3){return request(_0xe00b('0x27'),{'body':_0x4028b3});};exports[_0xe00b('0x28')]=function(_0x241c99){return request(_0xe00b('0x29'),{'body':_[_0xe00b('0x2a')](_0x241c99,{'project_name':_0x241c99[_0xe00b('0x2b')],'prev_project_name':_0x241c99[_0xe00b('0x2c')]||'','is_subproject':_0x241c99[_0xe00b('0x2c')]?!![]:![],'leaveAt':moment()['format'](_0xe00b('0x2d'))})});};exports[_0xe00b('0x2e')]=function(_0x7d4db0){return request(_0xe00b('0x2f'),{'body':_0x7d4db0});};exports[_0xe00b('0x30')]=function(_0x8fbe1f){return request(_0xe00b('0x31'),{'body':_0x8fbe1f});};exports['createCmContact']=function(_0x3c1c10){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3c1c10[_0xe00b('0x32')],'ListId':_0x3c1c10[_0xe00b('0x33')]}}})['then'](function(_0x3e5b00){if(_0x3e5b00){return _0x3e5b00;}return request(_0xe00b('0x34'),{'body':_0x3c1c10});});};exports['getPauseById']=function(_0x22d74f){return request(_0xe00b('0x35'),{'options':{'where':{'id':_0x22d74f},'attributes':[_0xe00b('0x15')]}});};exports[_0xe00b('0x36')]=function(_0x28201c,_0x4cbb68){return request(_0xe00b('0x37'),{'body':{'interface':_0x4cbb68},'options':{'where':_0x28201c}});};exports['agentPause']=function(_0x378bc3,_0x535cf0,_0x52a6eb){return request('PauseUser',{'body':{'type':_0x535cf0,'uniqueid':_0x52a6eb},'options':{'where':_0x378bc3}});};exports[_0xe00b('0x38')]=function(_0x45520d){return request('UnpauseUser',{'body':{},'options':{'where':_0x45520d}});};exports[_0xe00b('0x39')]=function(_0x270953){return request(_0xe00b('0x3a'),{'body':{},'options':{'where':_0x270953}});}; \ 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 b57ac37..9e0ac58 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 _0x482d=['exports'];(function(_0x4ee466,_0x3a53d9){var _0x59e372=function(_0x49ab08){while(--_0x49ab08){_0x4ee466['push'](_0x4ee466['shift']());}};_0x59e372(++_0x3a53d9);}(_0x482d,0x16c));var _0xd482=function(_0x29cce6,_0x105d8b){_0x29cce6=_0x29cce6-0x0;var _0x301671=_0x482d[_0x29cce6];return _0x301671;};var polly=require('./polly');var lex=require('./lex');module[_0xd482('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xb76d=['exports','./polly'];(function(_0x58cbc5,_0x3de123){var _0x38a8d9=function(_0x3a92be){while(--_0x3a92be){_0x58cbc5['push'](_0x58cbc5['shift']());}};_0x38a8d9(++_0x3de123);}(_0xb76d,0x119));var _0xdb76=function(_0xbb7b6f,_0x467314){_0xbb7b6f=_0xbb7b6f-0x0;var _0x17943b=_0xb76d[_0xbb7b6f];return _0x17943b;};var polly=require(_0xdb76('0x0'));var lex=require('./lex');module[_0xdb76('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 2d09494..eb016a4 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 _0xb7e7=['./lib/api'];(function(_0xc41b74,_0x497fc1){var _0x2e5073=function(_0x570f49){while(--_0x570f49){_0xc41b74['push'](_0xc41b74['shift']());}};_0x2e5073(++_0x497fc1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'use strict';var lex=require(_0x7b7e('0x0'));module['exports']=function(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){return lex(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68);}; \ No newline at end of file +var _0xd64b=['./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd64b,0xc1));var _0xbd64=function(_0x73353f,_0x391234){_0x73353f=_0x73353f-0x0;var _0x62cc13=_0xd64b[_0x73353f];return _0x62cc13;};'use strict';var lex=require(_0xbd64('0x0'));module['exports']=function(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05){return lex(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 362549e..05127fa 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(_0x1c09d8,_0x9ba7a){var _0x3d1eae=function(_0x382473){while(--_0x382473){_0x1c09d8['push'](_0x1c09d8['shift']());}};_0x3d1eae(++_0x9ba7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x155f76,_0x2defd4){var _0x4fdb56=function(_0x4abf48){while(--_0x4abf48){_0x155f76['push'](_0x155f76['shift']());}};_0x4fdb56(++_0x2defd4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 713f72e..14cd82b 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 _0xfe72=['./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe72,0x19c));var _0x2fe7=function(_0x391fa8,_0x3f3ed7){_0x391fa8=_0x391fa8-0x0;var _0x1baa2b=_0xfe72[_0x391fa8];return _0x1baa2b;};'use strict';var polly=require(_0x2fe7('0x0'));module['exports']=function(_0x3bfe18,_0x2368b3,_0x4d4c91,_0x4250fd,_0x10122d,_0x50049c,_0x23bea0){return polly(_0x3bfe18,_0x2368b3,_0x4d4c91,_0x4250fd,_0x10122d,_0x50049c,_0x23bea0);}; \ No newline at end of file +var _0x1279=['./lib/api'];(function(_0xc8d742,_0x4bae13){var _0xf81bcc=function(_0x50e034){while(--_0x50e034){_0xc8d742['push'](_0xc8d742['shift']());}};_0xf81bcc(++_0x4bae13);}(_0x1279,0x83));var _0x9127=function(_0x4158df,_0x1cf34e){_0x4158df=_0x4158df-0x0;var _0x8481f=_0x1279[_0x4158df];return _0x8481f;};'use strict';var polly=require(_0x9127('0x0'));module['exports']=function(_0x20cdf2,_0x255750,_0x350eba,_0x19ff92,_0x1411c9,_0xdfddaf,_0x4387b4){return polly(_0x20cdf2,_0x255750,_0x350eba,_0x19ff92,_0x1411c9,_0xdfddaf,_0x4387b4);}; \ 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 f6bd7d7..f09628c 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 _0x83b9=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','bluebird','randomstring','aws-sdk','AudioStream'];(function(_0x247c83,_0x592a0e){var _0x4c2db8=function(_0x5ca582){while(--_0x5ca582){_0x247c83['push'](_0x247c83['shift']());}};_0x4c2db8(++_0x592a0e);}(_0x83b9,0x14c));var _0x983b=function(_0x5ef67e,_0x2d3d62){_0x5ef67e=_0x5ef67e-0x0;var _0x5145ce=_0x83b9[_0x5ef67e];return _0x5145ce;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x983b('0x0'));var rs=require(_0x983b('0x1'));var AWS=require(_0x983b('0x2'));function pollyResult(_0x2f5873,_0x19f99d,_0x3a3f55){return new BPromise(function(_0x2b6d29,_0x39502b){_0x2f5873['synthesizeSpeech'](_0x19f99d,function(_0x7b01a,_0x4049f4){if(_0x7b01a){_0x39502b(_0x7b01a);}else if(_0x4049f4){if(_0x4049f4[_0x983b('0x3')]instanceof Buffer){fs[_0x983b('0x4')](_0x3a3f55,_0x4049f4[_0x983b('0x3')],function(_0xf8ae4d){if(_0xf8ae4d){_0x39502b(_0xf8ae4d);}else{_0x2b6d29();}});}else{_0x39502b(new Error(_0x983b('0x5')));}}else{_0x39502b(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x545d74,_0x4ff0e7,_0x3fff97,_0x94803e,_0xa66abf,_0xad97a8,_0x5ca9da){var _0x1e7040=new AWS[(_0x983b('0x6'))]({'accessKeyId':_0x545d74,'secretAccessKey':_0x4ff0e7,'region':_0x3fff97});var _0x5d1db8={'Text':_0xa66abf,'TextType':_0xad97a8||_0x983b('0x7'),'OutputFormat':'mp3','VoiceId':_0x94803e};return pollyResult(_0x1e7040,_0x5d1db8,_0x5ca9da);}; \ No newline at end of file +var _0x08dd=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x349b49,_0x170dbd){var _0x52289d=function(_0x1cb6ca){while(--_0x1cb6ca){_0x349b49['push'](_0x349b49['shift']());}};_0x52289d(++_0x170dbd);}(_0x08dd,0x83));var _0xd08d=function(_0x31d020,_0x509e49){_0x31d020=_0x31d020-0x0;var _0x259aa8=_0x08dd[_0x31d020];return _0x259aa8;};'use strict';var fs=require('fs');var path=require(_0xd08d('0x0'));var BPromise=require('bluebird');var rs=require(_0xd08d('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x7df5ed,_0xffd138,_0x292007){return new BPromise(function(_0x3d5d91,_0x4d04a7){_0x7df5ed['synthesizeSpeech'](_0xffd138,function(_0x2499ea,_0xd11403){if(_0x2499ea){_0x4d04a7(_0x2499ea);}else if(_0xd11403){if(_0xd11403['AudioStream']instanceof Buffer){fs['writeFile'](_0x292007,_0xd11403[_0xd08d('0x2')],function(_0x58726d){if(_0x58726d){_0x4d04a7(_0x58726d);}else{_0x3d5d91();}});}else{_0x4d04a7(new Error(_0xd08d('0x3')));}}else{_0x4d04a7(new Error(_0xd08d('0x4')));}});});}module[_0xd08d('0x5')]=function(_0x36c96e,_0x466673,_0x4a158a,_0x5a67dc,_0x4475da,_0x4dcb2d,_0x14b2ec){var _0x1f666e=new AWS[(_0xd08d('0x6'))]({'accessKeyId':_0x36c96e,'secretAccessKey':_0x466673,'region':_0x4a158a});var _0x50424a={'Text':_0x4475da,'TextType':_0x4dcb2d||_0xd08d('0x7'),'OutputFormat':_0xd08d('0x8'),'VoiceId':_0x5a67dc};return pollyResult(_0x1f666e,_0x50424a,_0x14b2ec);}; \ 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 ac810c5..676ec2b 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 _0xdacd=['./lib/api'];(function(_0x2029df,_0x448493){var _0xa4b9db=function(_0xd2c606){while(--_0xd2c606){_0x2029df['push'](_0x2029df['shift']());}};_0xa4b9db(++_0x448493);}(_0xdacd,0x9c));var _0xddac=function(_0x2196fe,_0xacad0d){_0x2196fe=_0x2196fe-0x0;var _0x1136cf=_0xdacd[_0x2196fe];return _0x1136cf;};'use strict';var asr=require(_0xddac('0x0'));module['exports']=function(_0x4724ce,_0x208ed4,_0x41373d,_0x518a4d){return asr(_0x4724ce,_0x208ed4,_0x41373d);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x4dd383,_0x4da3e,_0x475968,_0x27c1fd){return asr(_0x4dd383,_0x4da3e,_0x475968);}; \ 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 0da58fc..26e15a7 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 _0x16d2=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x35ee96,_0x5894cb){var _0xcf4267=function(_0x584df8){while(--_0x584df8){_0x35ee96['push'](_0x35ee96['shift']());}};_0xcf4267(++_0x5894cb);}(_0x16d2,0x123));var _0x216d=function(_0x348eef,_0x1ab2c4){_0x348eef=_0x348eef-0x0;var _0x20ad48=_0x16d2[_0x348eef];return _0x20ad48;};'use strict';var url=require(_0x216d('0x0'));var BPromise=require(_0x216d('0x1'));var fs=require('fs');var host=_0x216d('0x2');module[_0x216d('0x3')]=function(_0x1688cc,_0x3a2589,_0x34cf5b){return new BPromise(function(_0x239b49,_0xfd7306){var _0x593bb0;if(typeof _0x1688cc!==_0x216d('0x4')||_0x1688cc[_0x216d('0x5')]===0x0){return _0xfd7306(_0x216d('0x6'));}if(typeof _0x3a2589!==_0x216d('0x4')||_0x3a2589[_0x216d('0x5')]===0x0){return _0xfd7306(_0x216d('0x7'));}if(typeof _0x34cf5b!==_0x216d('0x8')&&(typeof _0x34cf5b!==_0x216d('0x4')||_0x34cf5b['length']===0x0)){return _0xfd7306(_0x216d('0x9'));}try{_0x593bb0=fs[_0x216d('0xa')](_0x1688cc)[_0x216d('0xb')](_0x216d('0xc'));}catch(_0x301058){return _0xfd7306(_0x301058);}return _0x239b49({'method':_0x216d('0xd'),'uri':host+'/v1/speech:recognize?key='+_0x3a2589,'body':{'config':{'encoding':_0x216d('0xe'),'sampleRateHertz':'8000','languageCode':_0x34cf5b},'audio':{'content':_0x593bb0}},'json':!![]});});}; \ No newline at end of file +var _0x8f37=['base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','length','string','undefined','lang\x20should\x20be\x20a\x20string','toString'];(function(_0x4a6bc4,_0xd27c47){var _0x2589b3=function(_0x17331a){while(--_0x17331a){_0x4a6bc4['push'](_0x4a6bc4['shift']());}};_0x2589b3(++_0xd27c47);}(_0x8f37,0x190));var _0x78f3=function(_0x51194e,_0x2b5f28){_0x51194e=_0x51194e-0x0;var _0x1d97b0=_0x8f37[_0x51194e];return _0x1d97b0;};'use strict';var url=require(_0x78f3('0x0'));var BPromise=require(_0x78f3('0x1'));var fs=require('fs');var host=_0x78f3('0x2');module['exports']=function(_0x542bc0,_0x2a7d93,_0x3c1fa6){return new BPromise(function(_0x3b0667,_0x539794){var _0x1d59a5;if(typeof _0x542bc0!=='string'||_0x542bc0[_0x78f3('0x3')]===0x0){return _0x539794('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a7d93!==_0x78f3('0x4')||_0x2a7d93[_0x78f3('0x3')]===0x0){return _0x539794('key\x20should\x20be\x20a\x20string');}if(typeof _0x3c1fa6!==_0x78f3('0x5')&&(typeof _0x3c1fa6!=='string'||_0x3c1fa6[_0x78f3('0x3')]===0x0)){return _0x539794(_0x78f3('0x6'));}try{_0x1d59a5=fs['readFileSync'](_0x542bc0)[_0x78f3('0x7')](_0x78f3('0x8'));}catch(_0x268525){return _0x539794(_0x268525);}return _0x3b0667({'method':_0x78f3('0x9'),'uri':host+_0x78f3('0xa')+_0x2a7d93,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x78f3('0xb'),'languageCode':_0x3c1fa6},'audio':{'content':_0x1d59a5}},'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 7b705a8..e5a96b8 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 _0xe804=['exports','./asr'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0xe804,0x85));var _0x4e80=function(_0x531265,_0x493e82){_0x531265=_0x531265-0x0;var _0x4cf94c=_0xe804[_0x531265];return _0x4cf94c;};var asr=require(_0x4e80('0x0'));module[_0x4e80('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3eae=['./asr'];(function(_0x149dcf,_0xd50b61){var _0x200529=function(_0x42317a){while(--_0x42317a){_0x149dcf['push'](_0x149dcf['shift']());}};_0x200529(++_0xd50b61);}(_0x3eae,0x163));var _0xe3ea=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0x3eae[_0x57cbfb];return _0x4cb933;};var asr=require(_0xe3ea('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 f42902b..ab957ba 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 _0xf703=['from','writeFile','application/x-www-form-urlencoded','f.req=','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','endConversation','metadata','isFallbackIntent','googleDialogflowV2','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','responseId','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','agi','https://api.ispeech.org/api/rest','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','https:','host','data','transcode','wav','error\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','resolve','.mp3'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf703,0xd3));var _0x3f70=function(_0x17f87d,_0x141a41){_0x17f87d=_0x17f87d-0x0;var _0x2e25dc=_0xf703[_0x17f87d];return _0x2e25dc;};'use strict';var apiai=require(_0x3f70('0x0'));var BPromise=require(_0x3f70('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x3f70('0x2'));var md5=require(_0x3f70('0x3'));var path=require('path');var querystring=require(_0x3f70('0x4'));var rp=require(_0x3f70('0x5'));var rs=require(_0x3f70('0x6'));var sox=require(_0x3f70('0x7'));var tts=require(_0x3f70('0x8'));var urlParse=require(_0x3f70('0x9'))[_0x3f70('0xa')];var util=require(_0x3f70('0xb'));var aws=require(_0x3f70('0xc'));var google=require('./google');var sestek=require(_0x3f70('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x3f70('0xe'));var ISPEECH_API=_0x3f70('0xf');function downloadFile(_0x54123f,_0x2323f3){return new BPromise(function(_0x45a143,_0x8d6d5a){var _0x23709d=urlParse(_0x54123f);var _0x2113c0=_0x23709d['protocol']==='https:'?https:http;var _0x5ad7f5={'host':_0x23709d['host'],'path':_0x23709d[_0x3f70('0x10')],'headers':{'user-agent':_0x3f70('0x11')}};_0x2113c0[_0x3f70('0x12')](_0x5ad7f5,function(_0x325d69){if(_0x325d69[_0x3f70('0x13')]!==0xc8){logger[_0x3f70('0x14')](_0x3f70('0x15')+_0x54123f+_0x3f70('0x16')+_0x325d69[_0x3f70('0x13')]+'\x20('+_0x325d69[_0x3f70('0x17')]+')');_0x8d6d5a(new Error(_0x3f70('0x15')+_0x54123f+_0x3f70('0x16')+_0x325d69['statusCode']+'\x20('+_0x325d69[_0x3f70('0x17')]+')'));return;}var _0x513d17=fs[_0x3f70('0x18')](_0x2323f3);_0x513d17['on'](_0x3f70('0x19'),function(){logger[_0x3f70('0x1a')](_0x3f70('0x1b'));_0x513d17[_0x3f70('0x1c')](_0x45a143);});_0x513d17['on']('error',function(_0x5c9d1c){fs[_0x3f70('0x1d')](_0x2323f3);logger[_0x3f70('0x14')](_0x3f70('0x1e'),_0x5c9d1c);_0x8d6d5a(_0x5c9d1c);});_0x325d69[_0x3f70('0x1f')](_0x513d17);})['on'](_0x3f70('0x14'),function(_0x2a649e){logger[_0x3f70('0x14')](_0x2a649e);_0x8d6d5a(_0x2a649e);})[_0x3f70('0x20')]();});}function uploadFile(_0x5758bb){return new BPromise(function(_0x5a124d,_0x322db2){var _0x2b47d5=urlParse(_0x5758bb);var _0x48723e=_0x2b47d5[_0x3f70('0x21')]===_0x3f70('0x22')?https:http;var _0x4ef87b={'host':_0x2b47d5[_0x3f70('0x23')],'path':_0x2b47d5['path'],'headers':{'user-agent':_0x3f70('0x11')}};_0x48723e[_0x3f70('0x12')](_0x4ef87b,function(_0x56906d){if(_0x56906d[_0x3f70('0x13')]!==0xc8){_0x322db2(new Error('request\x20to\x20'+_0x5758bb+_0x3f70('0x16')+_0x56906d[_0x3f70('0x13')]+'\x20('+_0x56906d[_0x3f70('0x17')]+')'));return;}var _0x2e281c='';_0x56906d['on'](_0x3f70('0x24'),function(_0x304d7a){_0x2e281c+=_0x304d7a;});_0x56906d['on'](_0x3f70('0x20'),function(){_0x5a124d(_0x2e281c);});})['on'](_0x3f70('0x14'),function(_0x5f2a53){_0x322db2(_0x5f2a53);})[_0x3f70('0x20')]();});}function convertFile(_0x37c733,_0x165e73){return new BPromise(function(_0x776afd,_0x313ca5){var _0x4ea526=sox[_0x3f70('0x25')](_0x37c733,_0x165e73,{'sampleRate':0x1f40,'format':_0x3f70('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4ea526['on'](_0x3f70('0x14'),function(_0x4c1523){logger[_0x3f70('0x14')](_0x3f70('0x27'),_0x4c1523);_0x313ca5(_0x4c1523);});_0x4ea526['on']('end',function(){logger[_0x3f70('0x1a')]('finish\x20to\x20convert');_0x776afd();});_0x4ea526[_0x3f70('0x28')]();});}function base64Decode(_0x4bd5e2,_0x11395e){var _0x2ed052=path['resolve'](__dirname,_0x3f70('0x29'),rs[_0x3f70('0x2a')](0x4)+_0x3f70('0x2b'));fs[_0x3f70('0x2c')](_0x2ed052,_0x4bd5e2,_0x3f70('0x2d'));return convertFile(_0x2ed052,_0x11395e)[_0x3f70('0x2e')](function(){try{fs[_0x3f70('0x1d')](_0x2ed052);fs[_0x3f70('0x2f')](_0x11395e,_0x3f70('0x30'));}catch(_0x138ec5){logger[_0x3f70('0x14')](_0x138ec5);}return _0x11395e[_0x3f70('0x31')]('.')[0x0];});}function base64Encode(_0x11c0d4){var _0x2d58dd=fs[_0x3f70('0x32')](_0x11c0d4);return new Buffer(_0x2d58dd)[_0x3f70('0x33')](_0x3f70('0x2d'));}exports['googleCloudTTS']=function(_0x17d63c,_0x56ed1c,_0x239d7a,_0x971549,_0x575e58,_0x1dece1){var _0x365348,_0xed4509;var _0x5da078='https://texttospeech.googleapis.com/v1/';var _0x3b9999=_0x3f70('0x34')+_0x17d63c;var _0x526d53={};if(_0x56ed1c===_0x3f70('0x35')){_0x526d53[_0x3f70('0x36')]={'ssml':_0x239d7a};}else{_0x526d53['input']={'text':_0x239d7a};};_0x526d53['voice']={'languageCode':_0x971549,'ssmlGender':_0x575e58};_0x526d53[_0x3f70('0x37')]={'audioEncoding':_0x3f70('0x38'),'sampleRateHertz':0x1f40};var _0x31cf6e={'url':_0x5da078+_0x3f70('0x39')+_0x3b9999,'method':_0x3f70('0x3a'),'json':!![],'body':_0x526d53};return rp(_0x31cf6e)['then'](function(_0x5f0ee1){return new BPromise(function(_0x177bf0,_0x3ba01e){_0x365348=path[_0x3f70('0x3b')](__dirname,_0x3f70('0x29'),rs[_0x3f70('0x2a')](0x4)+_0x3f70('0x3c'));var _0x3dcd12=Buffer[_0x3f70('0x3d')](_0x5f0ee1['audioContent'],_0x3f70('0x2d'));return fs[_0x3f70('0x3e')](_0x365348,_0x3dcd12,function(_0x416154){_0x3ba01e(_0x416154);},function(_0x574e0c){fs[_0x3f70('0x2f')](_0x365348,_0x3f70('0x30'));_0x177bf0(_0x574e0c);});});})[_0x3f70('0x2e')](function(_0x258351){_0xed4509=path['resolve'](__dirname,_0x3f70('0x29'),rs['generate'](0x4)+_0x3f70('0x2b'));return convertFile(_0x365348,_0xed4509);})[_0x3f70('0x2e')](function(){try{fs[_0x3f70('0x1d')](_0x365348);fs[_0x3f70('0x2f')](_0xed4509,_0x3f70('0x30'));}catch(_0x5e0ac2){logger[_0x3f70('0x14')](_0x5e0ac2);}logger['info']('googleCloudTTS\x20path',_0xed4509[_0x3f70('0x31')]('.')[0x0]);return _0xed4509[_0x3f70('0x31')]('.')[0x0];});};exports['googleTTS']=function(_0x1bbc54,_0x32845f){var _0x94f8e0='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x151a62,_0x253546;var _0x285245;var _0x479f5d={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x94f8e0,'headers':{'Content-Type':_0x3f70('0x3f')},'body':_0x3f70('0x40')+encodeURIComponent(JSON['stringify']([[[_0x3f70('0x41'),JSON['stringify']([_0x1bbc54,_0x32845f||'en',![],_0x3f70('0x42')]),null,'generic']]]))};return rp(_0x479f5d)['then'](function(_0x9d5c57){try{_0x285245=eval(_0x9d5c57[_0x3f70('0x43')](0x5))[0x0][0x2];}catch(_0x155893){throw new Error(_0x3f70('0x44')+_0x9d5c57[_0x3f70('0x24')]);}if(!_0x285245){if(_0x1bbc54[_0x3f70('0x45')]>0xc8){throw new Error(_0x3f70('0x46'));}else{throw new Error(_0x3f70('0x47')+_0x32845f+_0x3f70('0x48'));}}try{_0x285245=eval(_0x285245)[0x0];}catch(_0x2f1f28){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x398b0f=_0x285245;_0x151a62=path[_0x3f70('0x3b')](__dirname,_0x3f70('0x29'),rs[_0x3f70('0x2a')](0x4)+_0x3f70('0x3c'));fs[_0x3f70('0x2c')](_0x151a62,_0x285245,{'encoding':_0x3f70('0x2d')});_0x253546=path[_0x3f70('0x3b')](__dirname,_0x3f70('0x29'),rs['generate'](0x4)+_0x3f70('0x2b'));return convertFile(_0x151a62,_0x253546);})[_0x3f70('0x2e')](function(){try{fs[_0x3f70('0x1d')](_0x151a62);fs['chmodSync'](_0x253546,_0x3f70('0x30'));}catch(_0x1c2a9f){logger[_0x3f70('0x14')](_0x1c2a9f);}logger['info'](_0x3f70('0x49'),_0x253546['split']('.')[0x0]);return _0x253546['split']('.')[0x0];});};exports[_0x3f70('0x4a')]=function(_0x545b10,_0x261750,_0x3cf029){return google[_0x3f70('0x4b')](_0x545b10,_0x261750,_0x3cf029)[_0x3f70('0x2e')](function(_0x51c61a){logger[_0x3f70('0x1a')](_0x51c61a[_0x3f70('0x4c')]);return rp(_0x51c61a);})[_0x3f70('0x2e')](function(_0x4d795c){var _0x177e06='';var _0x121e00=0x0;try{fs[_0x3f70('0x1d')](_0x545b10);}catch(_0x5b0e60){logger[_0x3f70('0x14')](_0x5b0e60);}if(_0x4d795c&&_0x4d795c[_0x3f70('0x4d')]){_0x177e06=_0x4d795c['results']['map'](function(_0x54800a){return _0x54800a&&_0x54800a[_0x3f70('0x4e')][0x0]&&_0x54800a[_0x3f70('0x4e')][0x0][_0x3f70('0x4f')]?_0x54800a[_0x3f70('0x4e')][0x0][_0x3f70('0x4f')]:'';})[_0x3f70('0x50')]('\x0a');_0x121e00=_0x4d795c[_0x3f70('0x4d')][_0x3f70('0x51')](function(_0x1f9f72){return _0x1f9f72&&_0x1f9f72[_0x3f70('0x4e')][0x0]&&_0x1f9f72[_0x3f70('0x4e')][0x0][_0x3f70('0x52')]?_0x1f9f72[_0x3f70('0x4e')][0x0]['confidence']:0x0;})[_0x3f70('0x50')]('\x0a');}logger[_0x3f70('0x1a')](_0x3f70('0x53'),_0x177e06);logger[_0x3f70('0x1a')](_0x3f70('0x54'),_0x121e00);return{'transcript':_0x177e06,'confidence':_0x121e00};})[_0x3f70('0x55')](function(_0x12aef7){logger[_0x3f70('0x14')](_0x3f70('0x56'),_0x12aef7['statusCode'],_0x12aef7[_0x3f70('0x57')],_0x12aef7[_0x3f70('0x58')]);});};exports[_0x3f70('0x59')]=function(_0x25da20,_0x395f70,_0x33607d,_0x2e15ce){var _0x3ca871=apiai(_0x395f70,{'language':_0x2e15ce||'en'});return _0x3ca871[_0x3f70('0x5a')](_0x33607d,{'sessionId':md5(_0x25da20)})[_0x3f70('0x2e')](function(_0xd42266){logger[_0x3f70('0x1a')](JSON[_0x3f70('0x5b')](_0xd42266));return{'source':_0xd42266[_0x3f70('0x5c')]['source'],'resolvedQuery':_0xd42266[_0x3f70('0x5c')][_0x3f70('0x5d')],'action':_0xd42266[_0x3f70('0x5c')][_0x3f70('0x5e')],'actionIncomplete':_0xd42266[_0x3f70('0x5c')][_0x3f70('0x5f')],'speech':_0xd42266[_0x3f70('0x5c')][_0x3f70('0x60')][_0x3f70('0x61')],'score':_0xd42266['result']['score'],'statusCode':_0xd42266['status']['code'],'endConversation':_0xd42266[_0x3f70('0x5c')]['metadata'][_0x3f70('0x62')]||![],'isFallbackIntent':_0xd42266[_0x3f70('0x5c')][_0x3f70('0x63')][_0x3f70('0x64')]};});};exports[_0x3f70('0x65')]=function(_0x260ff4,_0x432e6b,_0x5aaeb7,_0x4f201e,_0x5b719a,_0x64a578){var _0x11d146=_0x4f201e['replace'](/\\n/g,'\x0a');var _0x504701={'credentials':{'private_key':_0x11d146,'client_email':_0x5aaeb7}};var _0x404fa6=new dialogflow['SessionsClient'](_0x504701);var _0x6e7493=_0x404fa6[_0x3f70('0x66')](_0x432e6b,md5(_0x260ff4));var _0x31b8d5={'session':_0x6e7493,'queryInput':{'text':{'text':_0x5b719a,'languageCode':_0x64a578}}};return _0x404fa6[_0x3f70('0x67')](_0x31b8d5)[_0x3f70('0x2e')](function(_0x1a10ac){if(_0x1a10ac&&_0x1a10ac[_0x3f70('0x45')]){logger[_0x3f70('0x1a')](_0x3f70('0x68'),JSON['stringify'](_0x1a10ac));var _0x4842c4=_0x1a10ac[0x0];if(_0x4842c4){var _0x2caf56={'action':_0x4842c4[_0x3f70('0x69')][_0x3f70('0x5e')],'allRequiredParamsPresent':_0x4842c4[_0x3f70('0x69')][_0x3f70('0x6a')],'endConversation':_0x4842c4[_0x3f70('0x69')][_0x3f70('0x6b')]&&_0x4842c4[_0x3f70('0x69')]['diagnosticInfo']['fields']?_0x4842c4['queryResult']['diagnosticInfo'][_0x3f70('0x6c')][_0x3f70('0x6d')][_0x3f70('0x6e')]:![],'fulfillmentText':_0x4842c4[_0x3f70('0x69')][_0x3f70('0x6f')],'intentName':_0x4842c4[_0x3f70('0x69')][_0x3f70('0x70')][_0x3f70('0x57')],'intentDisplayName':_0x4842c4[_0x3f70('0x69')]['intent'][_0x3f70('0x71')],'isFallbackIntent':_0x4842c4[_0x3f70('0x69')][_0x3f70('0x70')][_0x3f70('0x72')],'languageCode':_0x4842c4[_0x3f70('0x69')]['languageCode'],'queryText':_0x4842c4[_0x3f70('0x69')]['queryText'],'responseId':_0x4842c4[_0x3f70('0x73')],'score':_0x4842c4[_0x3f70('0x69')]['intentDetectionConfidence'],'speech':_0x4842c4['queryResult']['fulfillmentText'],'providerResponse':JSON['stringify'](_0x1a10ac)};return _0x2caf56;}}});};exports[_0x3f70('0x74')]=function(_0x4f1cae,_0x378e42,_0x18aaeb,_0x2565ac){return tilde[_0x3f70('0x4b')](_0x4f1cae,_0x378e42,_0x18aaeb,_0x2565ac)[_0x3f70('0x2e')](function(_0x474d48){try{fs[_0x3f70('0x1d')](_0x4f1cae);}catch(_0x25f9c2){logger[_0x3f70('0x14')](_0x25f9c2);}logger[_0x3f70('0x1a')](_0x3f70('0x75'),_0x474d48[_0x3f70('0x4f')]);logger['info']('Tilde\x20ASR\x20confidence',_0x474d48['confidence']);return _0x474d48;});};exports[_0x3f70('0x76')]=function(_0x589ab0,_0x5e52fd,_0x531df8,_0xf58c89,_0x4a244e,_0x17419d){var _0x46497e=path[_0x3f70('0x3b')](__dirname,_0x3f70('0x29'),rs['generate'](0x4)+_0x3f70('0x3c'));var _0x5e112b;return aws[_0x3f70('0x77')](_0x589ab0,_0x5e52fd,_0x531df8,_0xf58c89,_0x4a244e,_0x17419d,_0x46497e)[_0x3f70('0x2e')](function(){_0x5e112b=path['resolve'](__dirname,'tmp',rs[_0x3f70('0x2a')](0x4)+_0x3f70('0x2b'));return convertFile(_0x46497e,_0x5e112b);})['then'](function(){try{fs[_0x3f70('0x1d')](_0x46497e);fs[_0x3f70('0x2f')](_0x5e112b,_0x3f70('0x30'));}catch(_0x197a35){logger[_0x3f70('0x14')](_0x197a35);}return _0x5e112b[_0x3f70('0x31')]('.')[0x0];});};exports[_0x3f70('0x78')]=function(_0x453147,_0x4f556e,_0x4e7449,_0x5043b7,_0x27b3a8,_0x49bc64){return aws[_0x3f70('0x79')](_0x453147,_0x4f556e,_0x4e7449,_0x5043b7,_0x27b3a8,_0x49bc64)[_0x3f70('0x2e')](function(_0x36c11f){logger[_0x3f70('0x1a')](JSON[_0x3f70('0x5b')](_0x36c11f));return _0x36c11f;});};exports['ispeechTTS']=function(_0x373f17,_0x344062,_0x8445af,_0x2da936){var _0x5912ca=util[_0x3f70('0x7a')](_0x3f70('0x7b'),ISPEECH_API,_0x373f17,encodeURIComponent(_0x344062),_0x8445af,_0x2da936);var _0x4f67fc=path['resolve'](__dirname,_0x3f70('0x29'),rs[_0x3f70('0x2a')](0x4)+_0x3f70('0x3c'));var _0x7009b6;return downloadFile(_0x5912ca,_0x4f67fc)[_0x3f70('0x2e')](function(){_0x7009b6=path[_0x3f70('0x3b')](__dirname,_0x3f70('0x29'),rs[_0x3f70('0x2a')](0x4)+_0x3f70('0x2b'));return convertFile(_0x4f67fc,_0x7009b6);})[_0x3f70('0x2e')](function(){try{fs[_0x3f70('0x1d')](_0x4f67fc);fs[_0x3f70('0x2f')](_0x7009b6,_0x3f70('0x30'));}catch(_0x37c58f){logger[_0x3f70('0x14')](_0x37c58f);}return _0x7009b6['split']('.')[0x0];});};exports['ispeechASR']=function(_0xd0dd9c,_0x1fa558,_0x5440b8,_0x1aab12){var _0x34a453=util[_0x3f70('0x7a')](_0x3f70('0x7c'),ISPEECH_API,_0x1fa558,_0x5440b8,base64Encode(_0xd0dd9c),_0x1aab12?util[_0x3f70('0x7a')](_0x3f70('0x7d'),encodeURIComponent(_0x1aab12)):_0x3f70('0x7e'));return uploadFile(_0x34a453)['then'](function(_0x2bcb8b){return querystring[_0x3f70('0xa')](_0x2bcb8b);});};exports[_0x3f70('0x7f')]=function(_0x8d6387,_0x1f6401){return sestek[_0x3f70('0x80')](_0x8d6387,_0x1f6401)[_0x3f70('0x2e')](function(_0x362e67){logger['info'](JSON[_0x3f70('0x5b')](_0x362e67));var _0x191292={'speech':_0x362e67[_0x3f70('0x81')],'action':_0x362e67[_0x3f70('0x82')]?_0x362e67['channelData'][_0x3f70('0x83')]:undefined,'actiondata':_0x362e67[_0x3f70('0x82')]?_0x362e67[_0x3f70('0x82')][_0x3f70('0x84')]:undefined};if(_0x362e67[_0x3f70('0x82')]&&_0x362e67[_0x3f70('0x82')][_0x3f70('0x85')]){return base64Decode(_0x362e67[_0x3f70('0x82')]['AudioFromTts'][_0x3f70('0x86')],path[_0x3f70('0x3b')](__dirname,_0x3f70('0x29'),rs[_0x3f70('0x2a')](0x4)+'.wav'))['then'](function(_0x10a013){_0x191292['audiofile']=_0x10a013;return _0x191292;});}return _0x191292;});};exports[_0x3f70('0x87')]=function(){return __dirname;}; \ No newline at end of file +var _0xe619=['info','finish\x20to\x20convert','start','resolve','tmp','.wav','then','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','generate','audioContent','writeFile','unlink','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','f.req=','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','name','message','textRequest','result','source','resolvedQuery','action','fulfillment','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','stringify','queryResult','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','.mp3','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','https','md5','path','randomstring','sox','url','util','./aws','./google','../../../config/logger','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','download\x20error','end','get','data','error\x20convert'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe619,0x171));var _0x9e61=function(_0x2340e2,_0x1627f9){_0x2340e2=_0x2340e2-0x0;var _0x5ced10=_0xe619[_0x2340e2];return _0x5ced10;};'use strict';var apiai=require(_0x9e61('0x0'));var BPromise=require(_0x9e61('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x9e61('0x2'));var md5=require(_0x9e61('0x3'));var path=require(_0x9e61('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x9e61('0x5'));var sox=require(_0x9e61('0x6'));var tts=require('google-tts-api');var urlParse=require(_0x9e61('0x7'))['parse'];var util=require(_0x9e61('0x8'));var aws=require(_0x9e61('0x9'));var google=require(_0x9e61('0xa'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x9e61('0xb'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2486b8,_0x418291){return new BPromise(function(_0x5565db,_0x35085c){var _0x126b80=urlParse(_0x2486b8);var _0x24059c=_0x126b80[_0x9e61('0xc')]===_0x9e61('0xd')?https:http;var _0x4e01b4={'host':_0x126b80[_0x9e61('0xe')],'path':_0x126b80['path'],'headers':{'user-agent':_0x9e61('0xf')}};_0x24059c['get'](_0x4e01b4,function(_0x5efea0){if(_0x5efea0[_0x9e61('0x10')]!==0xc8){logger[_0x9e61('0x11')](_0x9e61('0x12')+_0x2486b8+_0x9e61('0x13')+_0x5efea0[_0x9e61('0x10')]+'\x20('+_0x5efea0['statusMessage']+')');_0x35085c(new Error('request\x20to\x20'+_0x2486b8+'\x20failed,\x20status\x20code\x20=\x20'+_0x5efea0[_0x9e61('0x10')]+'\x20('+_0x5efea0[_0x9e61('0x14')]+')'));return;}var _0x4fdeae=fs[_0x9e61('0x15')](_0x418291);_0x4fdeae['on'](_0x9e61('0x16'),function(){logger['info'](_0x9e61('0x17'));_0x4fdeae[_0x9e61('0x18')](_0x5565db);});_0x4fdeae['on']('error',function(_0x464071){fs['unlink'](_0x418291);logger[_0x9e61('0x11')](_0x9e61('0x19'),_0x464071);_0x35085c(_0x464071);});_0x5efea0['pipe'](_0x4fdeae);})['on']('error',function(_0x60d521){logger['error'](_0x60d521);_0x35085c(_0x60d521);})[_0x9e61('0x1a')]();});}function uploadFile(_0x35b968){return new BPromise(function(_0x2ec30c,_0x2919ec){var _0x2e1944=urlParse(_0x35b968);var _0x47b4ac=_0x2e1944['protocol']===_0x9e61('0xd')?https:http;var _0x1271f1={'host':_0x2e1944[_0x9e61('0xe')],'path':_0x2e1944[_0x9e61('0x4')],'headers':{'user-agent':_0x9e61('0xf')}};_0x47b4ac[_0x9e61('0x1b')](_0x1271f1,function(_0x458964){if(_0x458964['statusCode']!==0xc8){_0x2919ec(new Error('request\x20to\x20'+_0x35b968+_0x9e61('0x13')+_0x458964['statusCode']+'\x20('+_0x458964[_0x9e61('0x14')]+')'));return;}var _0x20494e='';_0x458964['on'](_0x9e61('0x1c'),function(_0x715e53){_0x20494e+=_0x715e53;});_0x458964['on'](_0x9e61('0x1a'),function(){_0x2ec30c(_0x20494e);});})['on']('error',function(_0x3a53aa){_0x2919ec(_0x3a53aa);})['end']();});}function convertFile(_0x4630d5,_0x168776){return new BPromise(function(_0x5dfaf5,_0x51a7a9){var _0x1f0db6=sox['transcode'](_0x4630d5,_0x168776,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1f0db6['on'](_0x9e61('0x11'),function(_0x3bbaba){logger[_0x9e61('0x11')](_0x9e61('0x1d'),_0x3bbaba);_0x51a7a9(_0x3bbaba);});_0x1f0db6['on'](_0x9e61('0x1a'),function(){logger[_0x9e61('0x1e')](_0x9e61('0x1f'));_0x5dfaf5();});_0x1f0db6[_0x9e61('0x20')]();});}function base64Decode(_0x5c1f41,_0x1c2edf){var _0x96ab9b=path[_0x9e61('0x21')](__dirname,_0x9e61('0x22'),rs['generate'](0x4)+_0x9e61('0x23'));fs['writeFileSync'](_0x96ab9b,_0x5c1f41,'base64');return convertFile(_0x96ab9b,_0x1c2edf)[_0x9e61('0x24')](function(){try{fs['unlink'](_0x96ab9b);fs[_0x9e61('0x25')](_0x1c2edf,_0x9e61('0x26'));}catch(_0x1a5c37){logger[_0x9e61('0x11')](_0x1a5c37);}return _0x1c2edf['split']('.')[0x0];});}function base64Encode(_0x241e63){var _0x44f64d=fs[_0x9e61('0x27')](_0x241e63);return new Buffer(_0x44f64d)[_0x9e61('0x28')](_0x9e61('0x29'));}exports[_0x9e61('0x2a')]=function(_0x3e7b85,_0x137fff,_0x470ed9,_0x5a4fc8,_0x36e019,_0x218158){var _0x173ecc,_0x18daea;var _0x28bf59=_0x9e61('0x2b');var _0x26bea3=_0x9e61('0x2c')+_0x3e7b85;var _0xa998c5={};if(_0x137fff==='ssml'){_0xa998c5[_0x9e61('0x2d')]={'ssml':_0x470ed9};}else{_0xa998c5[_0x9e61('0x2d')]={'text':_0x470ed9};};_0xa998c5[_0x9e61('0x2e')]={'languageCode':_0x5a4fc8,'ssmlGender':_0x36e019};_0xa998c5[_0x9e61('0x2f')]={'audioEncoding':_0x9e61('0x30'),'sampleRateHertz':0x1f40};var _0x31668b={'url':_0x28bf59+'text:synthesize'+_0x26bea3,'method':'POST','json':!![],'body':_0xa998c5};return rp(_0x31668b)['then'](function(_0x21d1a7){return new BPromise(function(_0x389c40,_0x66ee44){_0x173ecc=path[_0x9e61('0x21')](__dirname,'tmp',rs[_0x9e61('0x31')](0x4)+'.mp3');var _0x4b5219=Buffer['from'](_0x21d1a7[_0x9e61('0x32')],_0x9e61('0x29'));return fs[_0x9e61('0x33')](_0x173ecc,_0x4b5219,function(_0x3251a1){_0x66ee44(_0x3251a1);},function(_0x301aeb){fs[_0x9e61('0x25')](_0x173ecc,_0x9e61('0x26'));_0x389c40(_0x301aeb);});});})[_0x9e61('0x24')](function(_0x1b008c){_0x18daea=path['resolve'](__dirname,'tmp',rs[_0x9e61('0x31')](0x4)+_0x9e61('0x23'));return convertFile(_0x173ecc,_0x18daea);})['then'](function(){try{fs[_0x9e61('0x34')](_0x173ecc);fs[_0x9e61('0x25')](_0x18daea,_0x9e61('0x26'));}catch(_0xd0f043){logger[_0x9e61('0x11')](_0xd0f043);}logger[_0x9e61('0x1e')](_0x9e61('0x35'),_0x18daea[_0x9e61('0x36')]('.')[0x0]);return _0x18daea['split']('.')[0x0];});};exports[_0x9e61('0x37')]=function(_0x40de70,_0x3ed82e){var _0x171bcd=_0x9e61('0x38');var _0x41751f,_0x331bc2;var _0xb84976;var _0x1c26f1={'encoding':'utf8','method':_0x9e61('0x39'),'timeout':0x2710,'url':_0x171bcd,'headers':{'Content-Type':_0x9e61('0x3a')},'body':_0x9e61('0x3b')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x40de70,_0x3ed82e||'en',![],'null']),null,'generic']]]))};return rp(_0x1c26f1)['then'](function(_0x1b59da){try{_0xb84976=eval(_0x1b59da[_0x9e61('0x3c')](0x5))[0x0][0x2];}catch(_0x589876){throw new Error('parse\x20response\x20failed:\x0a'+_0x1b59da[_0x9e61('0x1c')]);}if(!_0xb84976){if(_0x40de70[_0x9e61('0x3d')]>0xc8){throw new Error(_0x9e61('0x3e'));}else{throw new Error(_0x9e61('0x3f')+_0x3ed82e+_0x9e61('0x40'));}}try{_0xb84976=eval(_0xb84976)[0x0];}catch(_0xe5183a){throw new Error(_0x9e61('0x41')+res['data']);}const _0x212d5e=_0xb84976;_0x41751f=path[_0x9e61('0x21')](__dirname,'tmp',rs[_0x9e61('0x31')](0x4)+'.mp3');fs[_0x9e61('0x42')](_0x41751f,_0xb84976,{'encoding':_0x9e61('0x29')});_0x331bc2=path[_0x9e61('0x21')](__dirname,_0x9e61('0x22'),rs[_0x9e61('0x31')](0x4)+'.wav');return convertFile(_0x41751f,_0x331bc2);})[_0x9e61('0x24')](function(){try{fs[_0x9e61('0x34')](_0x41751f);fs['chmodSync'](_0x331bc2,_0x9e61('0x26'));}catch(_0xe6ecf1){logger[_0x9e61('0x11')](_0xe6ecf1);}logger['info'](_0x9e61('0x43'),_0x331bc2[_0x9e61('0x36')]('.')[0x0]);return _0x331bc2[_0x9e61('0x36')]('.')[0x0];});};exports[_0x9e61('0x44')]=function(_0x18d168,_0xbcfa7a,_0x38757d){return google[_0x9e61('0x45')](_0x18d168,_0xbcfa7a,_0x38757d)[_0x9e61('0x24')](function(_0x2ba22f){logger[_0x9e61('0x1e')](_0x2ba22f[_0x9e61('0x46')]);return rp(_0x2ba22f);})[_0x9e61('0x24')](function(_0x3a3e64){var _0x199c9d='';var _0x106714=0x0;try{fs[_0x9e61('0x34')](_0x18d168);}catch(_0xd06776){logger[_0x9e61('0x11')](_0xd06776);}if(_0x3a3e64&&_0x3a3e64[_0x9e61('0x47')]){_0x199c9d=_0x3a3e64[_0x9e61('0x47')][_0x9e61('0x48')](function(_0x14c0cc){return _0x14c0cc&&_0x14c0cc['alternatives'][0x0]&&_0x14c0cc[_0x9e61('0x49')][0x0]['transcript']?_0x14c0cc[_0x9e61('0x49')][0x0][_0x9e61('0x4a')]:'';})[_0x9e61('0x4b')]('\x0a');_0x106714=_0x3a3e64[_0x9e61('0x47')][_0x9e61('0x48')](function(_0x3d606d){return _0x3d606d&&_0x3d606d[_0x9e61('0x49')][0x0]&&_0x3d606d['alternatives'][0x0]['confidence']?_0x3d606d[_0x9e61('0x49')][0x0][_0x9e61('0x4c')]:0x0;})[_0x9e61('0x4b')]('\x0a');}logger['info'](_0x9e61('0x4d'),_0x199c9d);logger['info'](_0x9e61('0x4e'),_0x106714);return{'transcript':_0x199c9d,'confidence':_0x106714};})['catch'](function(_0x523329){logger[_0x9e61('0x11')]('[%s]\x20%s:%s',_0x523329[_0x9e61('0x10')],_0x523329[_0x9e61('0x4f')],_0x523329[_0x9e61('0x50')]);});};exports['googleDialogflow']=function(_0x227473,_0x615ce8,_0x51b6a4,_0x796e50){var _0x2d07cf=apiai(_0x615ce8,{'language':_0x796e50||'en'});return _0x2d07cf[_0x9e61('0x51')](_0x51b6a4,{'sessionId':md5(_0x227473)})[_0x9e61('0x24')](function(_0x1e30a8){logger[_0x9e61('0x1e')](JSON['stringify'](_0x1e30a8));return{'source':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x53')],'resolvedQuery':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x54')],'action':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x55')],'actionIncomplete':_0x1e30a8['result']['actionIncomplete'],'speech':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x56')]['speech'],'score':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x57')],'statusCode':_0x1e30a8[_0x9e61('0x58')]['code'],'endConversation':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x59')][_0x9e61('0x5a')]||![],'isFallbackIntent':_0x1e30a8[_0x9e61('0x52')][_0x9e61('0x59')][_0x9e61('0x5b')]};});};exports[_0x9e61('0x5c')]=function(_0x4b5629,_0x276e2d,_0x555f13,_0x482de9,_0x5b549e,_0x453ba1){var _0x242f88=_0x482de9[_0x9e61('0x5d')](/\\n/g,'\x0a');var _0x111a13={'credentials':{'private_key':_0x242f88,'client_email':_0x555f13}};var _0x3db56f=new dialogflow[(_0x9e61('0x5e'))](_0x111a13);var _0x4f76c9=_0x3db56f[_0x9e61('0x5f')](_0x276e2d,md5(_0x4b5629));var _0x119891={'session':_0x4f76c9,'queryInput':{'text':{'text':_0x5b549e,'languageCode':_0x453ba1}}};return _0x3db56f[_0x9e61('0x60')](_0x119891)[_0x9e61('0x24')](function(_0x143879){if(_0x143879&&_0x143879['length']){logger[_0x9e61('0x1e')](_0x9e61('0x61'),JSON[_0x9e61('0x62')](_0x143879));var _0x10279b=_0x143879[0x0];if(_0x10279b){var _0x337312={'action':_0x10279b[_0x9e61('0x63')][_0x9e61('0x55')],'allRequiredParamsPresent':_0x10279b[_0x9e61('0x63')]['allRequiredParamsPresent'],'endConversation':_0x10279b[_0x9e61('0x63')][_0x9e61('0x64')]&&_0x10279b['queryResult'][_0x9e61('0x64')][_0x9e61('0x65')]?_0x10279b[_0x9e61('0x63')]['diagnosticInfo']['fields']['end_conversation'][_0x9e61('0x66')]:![],'fulfillmentText':_0x10279b[_0x9e61('0x63')]['fulfillmentText'],'intentName':_0x10279b[_0x9e61('0x63')][_0x9e61('0x67')][_0x9e61('0x4f')],'intentDisplayName':_0x10279b['queryResult'][_0x9e61('0x67')][_0x9e61('0x68')],'isFallbackIntent':_0x10279b[_0x9e61('0x63')][_0x9e61('0x67')][_0x9e61('0x69')],'languageCode':_0x10279b[_0x9e61('0x63')][_0x9e61('0x6a')],'queryText':_0x10279b[_0x9e61('0x63')][_0x9e61('0x6b')],'responseId':_0x10279b['responseId'],'score':_0x10279b['queryResult'][_0x9e61('0x6c')],'speech':_0x10279b[_0x9e61('0x63')][_0x9e61('0x6d')],'providerResponse':JSON[_0x9e61('0x62')](_0x143879)};return _0x337312;}}});};exports[_0x9e61('0x6e')]=function(_0x93c893,_0x433d86,_0x4c984c,_0x14b477){return tilde[_0x9e61('0x45')](_0x93c893,_0x433d86,_0x4c984c,_0x14b477)[_0x9e61('0x24')](function(_0xd6f8f7){try{fs[_0x9e61('0x34')](_0x93c893);}catch(_0x1c20d1){logger[_0x9e61('0x11')](_0x1c20d1);}logger[_0x9e61('0x1e')](_0x9e61('0x6f'),_0xd6f8f7[_0x9e61('0x4a')]);logger[_0x9e61('0x1e')](_0x9e61('0x70'),_0xd6f8f7[_0x9e61('0x4c')]);return _0xd6f8f7;});};exports['awsPolly']=function(_0x282f19,_0x4d58e5,_0x4f3ee9,_0x2bca14,_0x28d2e7,_0x1a0c20){var _0x4d2918=path[_0x9e61('0x21')](__dirname,'tmp',rs[_0x9e61('0x31')](0x4)+_0x9e61('0x71'));var _0xf25dae;return aws[_0x9e61('0x72')](_0x282f19,_0x4d58e5,_0x4f3ee9,_0x2bca14,_0x28d2e7,_0x1a0c20,_0x4d2918)[_0x9e61('0x24')](function(){_0xf25dae=path[_0x9e61('0x21')](__dirname,_0x9e61('0x22'),rs[_0x9e61('0x31')](0x4)+_0x9e61('0x23'));return convertFile(_0x4d2918,_0xf25dae);})[_0x9e61('0x24')](function(){try{fs[_0x9e61('0x34')](_0x4d2918);fs[_0x9e61('0x25')](_0xf25dae,_0x9e61('0x26'));}catch(_0x328c90){logger[_0x9e61('0x11')](_0x328c90);}return _0xf25dae[_0x9e61('0x36')]('.')[0x0];});};exports[_0x9e61('0x73')]=function(_0x8670f3,_0x1a37e6,_0x32a5ed,_0xfbb562,_0x23ccd4,_0x496ffe){return aws[_0x9e61('0x74')](_0x8670f3,_0x1a37e6,_0x32a5ed,_0xfbb562,_0x23ccd4,_0x496ffe)[_0x9e61('0x24')](function(_0x255b01){logger[_0x9e61('0x1e')](JSON[_0x9e61('0x62')](_0x255b01));return _0x255b01;});};exports[_0x9e61('0x75')]=function(_0x5e1223,_0x413091,_0x1695c9,_0x10b9fa){var _0x36ea06=util['format'](_0x9e61('0x76'),ISPEECH_API,_0x5e1223,encodeURIComponent(_0x413091),_0x1695c9,_0x10b9fa);var _0x49ea8c=path[_0x9e61('0x21')](__dirname,_0x9e61('0x22'),rs[_0x9e61('0x31')](0x4)+_0x9e61('0x71'));var _0x5e4e31;return downloadFile(_0x36ea06,_0x49ea8c)['then'](function(){_0x5e4e31=path['resolve'](__dirname,_0x9e61('0x22'),rs[_0x9e61('0x31')](0x4)+_0x9e61('0x23'));return convertFile(_0x49ea8c,_0x5e4e31);})['then'](function(){try{fs[_0x9e61('0x34')](_0x49ea8c);fs['chmodSync'](_0x5e4e31,_0x9e61('0x26'));}catch(_0x2880a7){logger[_0x9e61('0x11')](_0x2880a7);}return _0x5e4e31[_0x9e61('0x36')]('.')[0x0];});};exports[_0x9e61('0x77')]=function(_0x340c2d,_0x4092e0,_0x1b800f,_0x4d45bf){var _0x392aad=util[_0x9e61('0x78')](_0x9e61('0x79'),ISPEECH_API,_0x4092e0,_0x1b800f,base64Encode(_0x340c2d),_0x4d45bf?util[_0x9e61('0x78')](_0x9e61('0x7a'),encodeURIComponent(_0x4d45bf)):_0x9e61('0x7b'));return uploadFile(_0x392aad)[_0x9e61('0x24')](function(_0x273b5f){return querystring[_0x9e61('0x7c')](_0x273b5f);});};exports[_0x9e61('0x7d')]=function(_0x546735,_0x5e2373){return sestek[_0x9e61('0x7e')](_0x546735,_0x5e2373)[_0x9e61('0x24')](function(_0x320452){logger['info'](JSON['stringify'](_0x320452));var _0x7b9694={'speech':_0x320452['text'],'action':_0x320452[_0x9e61('0x7f')]?_0x320452[_0x9e61('0x7f')][_0x9e61('0x80')]:undefined,'actiondata':_0x320452[_0x9e61('0x7f')]?_0x320452[_0x9e61('0x7f')][_0x9e61('0x81')]:undefined};if(_0x320452[_0x9e61('0x7f')]&&_0x320452[_0x9e61('0x7f')][_0x9e61('0x82')]){return base64Decode(_0x320452[_0x9e61('0x7f')][_0x9e61('0x82')][_0x9e61('0x83')],path[_0x9e61('0x21')](__dirname,'tmp',rs['generate'](0x4)+_0x9e61('0x23')))['then'](function(_0x278fde){_0x7b9694[_0x9e61('0x84')]=_0x278fde;return _0x7b9694;});}return _0x7b9694;});};exports['dirName']=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 940ccba..c6e48cb 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 _0x372f=['./nda','exports'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x372f,0x1a0));var _0xf372=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x372f[_0xa464c9];return _0x3d73c4;};var nda=require(_0xf372('0x0'));module[_0xf372('0x1')]={'nda':nda}; \ No newline at end of file +var _0x0ba9=['./nda','exports'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x0ba9,0xf2));var _0x90ba=function(_0x3c80af,_0x4cc711){_0x3c80af=_0x3c80af-0x0;var _0x2a6fbd=_0x0ba9[_0x3c80af];return _0x2a6fbd;};var nda=require(_0x90ba('0x0'));module[_0x90ba('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 68a2ddf..24060f7 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 _0xad13=['ndassistant_url','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then'];(function(_0x5775c6,_0x5551e4){var _0x36f8aa=function(_0x32d655){while(--_0x32d655){_0x5775c6['push'](_0x5775c6['shift']());}};_0x36f8aa(++_0x5551e4);}(_0xad13,0x79));var _0x3ad1=function(_0x28c480,_0x45467f){_0x28c480=_0x28c480-0x0;var _0x125586=_0xad13[_0x28c480];return _0x125586;};'use strict';var rp=require(_0x3ad1('0x0'));var url=require('url');var logger=require(_0x3ad1('0x1'))(_0x3ad1('0x2'));module[_0x3ad1('0x3')]=function(_0x38bf8c,_0x501af9){var _0x309032={'method':_0x3ad1('0x4'),'uri':url[_0x3ad1('0x5')](_0x501af9[_0x3ad1('0x6')],_0x3ad1('0x7')),'form':{'grant_type':_0x3ad1('0x8'),'username':_0x501af9[_0x3ad1('0x9')],'password':_0x501af9[_0x3ad1('0x8')]},'json':!![]};return rp(_0x309032)[_0x3ad1('0xa')](function(_0x313ad9){var _0x4d27b0={'method':_0x3ad1('0x4'),'uri':url[_0x3ad1('0x5')](_0x501af9[_0x3ad1('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x501af9[_0x3ad1('0xc')]||_0x3ad1('0xd'),'channelId':'Nda','conversation':{'id':_0x38bf8c[_0x3ad1('0xe')]},'from':{'id':_0x38bf8c[_0x3ad1('0xf')],'name':_0x38bf8c[_0x3ad1('0x10')]},'recipient':{'id':_0x38bf8c[_0x3ad1('0x11')],'name':_0x38bf8c[_0x3ad1('0x12')]},'text':_0x501af9[_0x3ad1('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x313ad9['access_token']},'json':!![]};if(_0x501af9[_0x3ad1('0x14')]){_0x4d27b0[_0x3ad1('0x15')][_0x3ad1('0x16')][_0x3ad1('0x17')]=_0x501af9['project'];}if(_0x501af9[_0x3ad1('0x18')]=='1'){_0x4d27b0['body'][_0x3ad1('0x16')][_0x3ad1('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3ad1('0x1a')};}if(_0x501af9[_0x3ad1('0x1b')]){_0x4d27b0[_0x3ad1('0x15')][_0x3ad1('0x16')][_0x3ad1('0x1c')]=_0x501af9[_0x3ad1('0x1b')];if(_0x501af9[_0x3ad1('0x1d')]){_0x4d27b0[_0x3ad1('0x15')][_0x3ad1('0x16')][_0x3ad1('0x1e')]=_0x501af9['custom_action_data'];}}logger[_0x3ad1('0x1f')](JSON[_0x3ad1('0x20')](_0x4d27b0));return rp(_0x4d27b0);});}; \ No newline at end of file +var _0xfa7c=['../../../../../config/logger','agi','exports','POST','resolve','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','CustomAction','custom_action','custom_action_data','CustomActionData','info','request-promise'];(function(_0x106eef,_0x5ad9bc){var _0x2a883c=function(_0x5c93cd){while(--_0x5c93cd){_0x106eef['push'](_0x106eef['shift']());}};_0x2a883c(++_0x5ad9bc);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x502832,_0x5b3fd5){_0x502832=_0x502832-0x0;var _0xf1df75=_0xfa7c[_0x502832];return _0xf1df75;};'use strict';var rp=require(_0xcfa7('0x0'));var url=require('url');var logger=require(_0xcfa7('0x1'))(_0xcfa7('0x2'));module[_0xcfa7('0x3')]=function(_0x1d6921,_0x19beaf){var _0x185124={'method':_0xcfa7('0x4'),'uri':url[_0xcfa7('0x5')](_0x19beaf['ndauth_url'],_0xcfa7('0x6')),'form':{'grant_type':_0xcfa7('0x7'),'username':_0x19beaf[_0xcfa7('0x8')],'password':_0x19beaf[_0xcfa7('0x7')]},'json':!![]};return rp(_0x185124)['then'](function(_0x816590){var _0x573432={'method':_0xcfa7('0x4'),'uri':url[_0xcfa7('0x5')](_0x19beaf[_0xcfa7('0x9')],_0xcfa7('0xa')),'body':{'type':_0x19beaf['ndaactivity_type']||_0xcfa7('0xb'),'channelId':_0xcfa7('0xc'),'conversation':{'id':_0x1d6921[_0xcfa7('0xd')]},'from':{'id':_0x1d6921[_0xcfa7('0xe')],'name':_0x1d6921[_0xcfa7('0xf')]},'recipient':{'id':_0x1d6921['dnid'],'name':_0x1d6921['extension']},'text':_0x19beaf[_0xcfa7('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x816590[_0xcfa7('0x11')]},'json':!![]};if(_0x19beaf[_0xcfa7('0x12')]){_0x573432[_0xcfa7('0x13')][_0xcfa7('0x14')][_0xcfa7('0x15')]=_0x19beaf[_0xcfa7('0x12')];}if(_0x19beaf[_0xcfa7('0x16')]=='1'){_0x573432[_0xcfa7('0x13')]['channelData'][_0xcfa7('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x19beaf['custom_action']){_0x573432[_0xcfa7('0x13')][_0xcfa7('0x14')][_0xcfa7('0x18')]=_0x19beaf[_0xcfa7('0x19')];if(_0x19beaf[_0xcfa7('0x1a')]){_0x573432['body'][_0xcfa7('0x14')][_0xcfa7('0x1b')]=_0x19beaf[_0xcfa7('0x1a')];}}logger[_0xcfa7('0x1c')](JSON['stringify'](_0x573432));return rp(_0x573432);});}; \ 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 36ad488..13832a1 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c0e=['exports','./lib/api'];(function(_0x553e80,_0x1eab9f){var _0x1c9fd4=function(_0x54d7a5){while(--_0x54d7a5){_0x553e80['push'](_0x553e80['shift']());}};_0x1c9fd4(++_0x1eab9f);}(_0x1c0e,0xb3));var _0xe1c0=function(_0x4e0306,_0x49a5a1){_0x4e0306=_0x4e0306-0x0;var _0x12e63e=_0x1c0e[_0x4e0306];return _0x12e63e;};'use strict';var asr=require(_0xe1c0('0x0'));module[_0xe1c0('0x1')]=function(_0x2676bb,_0x1769aa,_0x24bbdc,_0x31ab69){return asr(_0x2676bb,_0x1769aa,_0x24bbdc,_0x31ab69);}; \ No newline at end of file +var _0x6b16=['exports','./lib/api'];(function(_0xae98c,_0x45de17){var _0x2cb54f=function(_0x1ed9fa){while(--_0x1ed9fa){_0xae98c['push'](_0xae98c['shift']());}};_0x2cb54f(++_0x45de17);}(_0x6b16,0x12f));var _0x66b1=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x6b16[_0x19159a];return _0xa677f4;};'use strict';var asr=require(_0x66b1('0x0'));module[_0x66b1('0x1')]=function(_0x545eac,_0x3b2cde,_0x48fac1,_0x4f1019){return asr(_0x545eac,_0x3b2cde,_0x48fac1,_0x4f1019);}; \ 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 22250e6..7534bf5 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 _0x1fb6=['transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','final','Tilde\x20ASR\x20hypoteses','result','hypotheses'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x1fb6,0x1b9));var _0x61fb=function(_0x4e1cc1,_0x392096){_0x4e1cc1=_0x4e1cc1-0x0;var _0x113ab4=_0x1fb6[_0x4e1cc1];return _0x113ab4;};'use strict';var BPromise=require(_0x61fb('0x0'));var _=require(_0x61fb('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x61fb('0x2'));var crypto=require('crypto');var logger=require(_0x61fb('0x3'))(_0x61fb('0x4'));module[_0x61fb('0x5')]=function(_0x2033b8,_0x5b21eb,_0x1b5737,_0x55c033){return new BPromise(function(_0x29d915,_0x1d97cf){logger[_0x61fb('0x6')](_0x61fb('0x7'),_0x55c033||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x44657b=new WebSocket(_0x55c033||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x239a48='';var _0x11263c='0';var _0x303c59='1';var _0x34e417='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x120680(_0x35a0b1){var _0x16d78b=crypto[_0x61fb('0x8')](_0x61fb('0x9'));_0x16d78b[_0x61fb('0xa')](_0x35a0b1);return _0x16d78b[_0x61fb('0xb')](_0x61fb('0xc'));}function _0x486055(){try{logger['info'](_0x61fb('0xd'));var _0x375c48=moment()[_0x61fb('0xe')]();var _0x54f4a0=_0x120680(_0x375c48+_0x5b21eb+_0x1b5737);_0x44657b[_0x61fb('0xf')](JSON[_0x61fb('0x10')]({'appID':_0x5b21eb,'timestamp':_0x375c48,'appKey':_0x54f4a0}));var _0x213565=fs['createReadStream'](_0x2033b8);_0x213565['on'](_0x61fb('0x11'),function(_0x3e8ba9){_0x44657b[_0x61fb('0xf')](_0x3e8ba9);});_0x213565['on']('close',function(){_0x44657b[_0x61fb('0xf')](_0x61fb('0x12'));});}catch(_0x231307){logger[_0x61fb('0x13')](_0x61fb('0x14'),JSON[_0x61fb('0x10')](_0x231307));_0x44657b[_0x61fb('0x15')]();}}function _0x5ee21c(_0x3a5c57){try{if(_0x3a5c57){var _0x2e2aa8=JSON[_0x61fb('0x16')](_0x3a5c57);switch(_0x2e2aa8['status']){case 0x0:if(_0x2e2aa8['result']){if(_0x2e2aa8['result'][_0x61fb('0x17')]){logger[_0x61fb('0x6')](_0x61fb('0x18'),JSON[_0x61fb('0x10')](_0x2e2aa8[_0x61fb('0x19')]['hypotheses']));_0x239a48=_0x2e2aa8[_0x61fb('0x19')][_0x61fb('0x1a')][0x0][_0x61fb('0x1b')];_0x11263c=_0x2e2aa8['result'][_0x61fb('0x1a')][0x0][_0x61fb('0x1c')];_0x303c59='0';_0x34e417='Success.';_0x44657b['terminate']();}}break;case 0x1:logger[_0x61fb('0x6')](_0x61fb('0x1d'));_0x303c59='1';_0x34e417=_0x61fb('0x1d');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x303c59='2';_0x34e417=_0x61fb('0x1e');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x303c59='9';_0x34e417=_0x61fb('0x1f');break;case 0xa:logger[_0x61fb('0x6')](_0x61fb('0x20'));_0x303c59='10';_0x34e417=_0x61fb('0x20');break;case 0xb:logger[_0x61fb('0x6')](_0x61fb('0x21'));_0x303c59='11';_0x34e417='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4bbd04){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x61fb('0x10')](_0x4bbd04));_0x44657b[_0x61fb('0x15')]();}}function _0x178587(){logger['info'](_0x61fb('0x22'));_0x29d915({'transcript':_0x239a48,'confidence':_0x11263c,'status':_0x303c59,'status_message':_0x34e417});}function _0x2cfeb0(_0xabf36f){logger['error'](_0x61fb('0x23'));if(!_['isNil'](_0xabf36f)){logger[_0x61fb('0x13')](_[_0x61fb('0x24')](_0xabf36f)?JSON[_0x61fb('0x10')](_0xabf36f):_0xabf36f);}}_0x44657b['on'](_0x61fb('0x25'),_0x486055);_0x44657b['on'](_0x61fb('0x26'),_0x5ee21c);_0x44657b['on']('close',_0x178587);_0x44657b['on'](_0x61fb('0x13'),_0x2cfeb0);});}; \ No newline at end of file +var _0xd06d=['Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','info','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','stringify','hypotheses','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.'];(function(_0x4067c8,_0x3ab7a0){var _0x51ac13=function(_0x5c0dc8){while(--_0x5c0dc8){_0x4067c8['push'](_0x4067c8['shift']());}};_0x51ac13(++_0x3ab7a0);}(_0xd06d,0xd4));var _0xdd06=function(_0x1610a9,_0x12b812){_0x1610a9=_0x1610a9-0x0;var _0x33a66e=_0xd06d[_0x1610a9];return _0x33a66e;};'use strict';var BPromise=require(_0xdd06('0x0'));var _=require(_0xdd06('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdd06('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0xdd06('0x3')]=function(_0x5d8516,_0x62bf91,_0x6f9a46,_0x1752a7){return new BPromise(function(_0x217d1a,_0x4dbe4d){logger['info']('Tilde\x20URI',_0x1752a7||_0xdd06('0x4'));var _0x350a74=new WebSocket(_0x1752a7||_0xdd06('0x4'),{'perMessageDeflate':![]});var _0x498e7='';var _0x5ea591='0';var _0x103b19='1';var _0x2598c8=_0xdd06('0x5');function _0x4c4bfe(_0x1b5458){var _0x20087f=crypto['createHash'](_0xdd06('0x6'));_0x20087f[_0xdd06('0x7')](_0x1b5458);return _0x20087f['digest']('hex');}function _0x2efee9(){try{logger[_0xdd06('0x8')](_0xdd06('0x9'));var _0x2331e9=moment()[_0xdd06('0xa')]();var _0x3ccfcd=_0x4c4bfe(_0x2331e9+_0x62bf91+_0x6f9a46);_0x350a74[_0xdd06('0xb')](JSON['stringify']({'appID':_0x62bf91,'timestamp':_0x2331e9,'appKey':_0x3ccfcd}));var _0x1912b9=fs[_0xdd06('0xc')](_0x5d8516);_0x1912b9['on']('data',function(_0x219ef3){_0x350a74[_0xdd06('0xb')](_0x219ef3);});_0x1912b9['on'](_0xdd06('0xd'),function(){_0x350a74[_0xdd06('0xb')](_0xdd06('0xe'));});}catch(_0x4fa77b){logger[_0xdd06('0xf')](_0xdd06('0x10'),JSON['stringify'](_0x4fa77b));_0x350a74['terminate']();}}function _0x2e0ea4(_0x32ee60){try{if(_0x32ee60){var _0x225bd2=JSON[_0xdd06('0x11')](_0x32ee60);switch(_0x225bd2[_0xdd06('0x12')]){case 0x0:if(_0x225bd2[_0xdd06('0x13')]){if(_0x225bd2[_0xdd06('0x13')][_0xdd06('0x14')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xdd06('0x15')](_0x225bd2[_0xdd06('0x13')][_0xdd06('0x16')]));_0x498e7=_0x225bd2['result'][_0xdd06('0x16')][0x0]['transcript'];_0x5ea591=_0x225bd2[_0xdd06('0x13')][_0xdd06('0x16')][0x0]['likelihood'];_0x103b19='0';_0x2598c8=_0xdd06('0x17');_0x350a74[_0xdd06('0x18')]();}}break;case 0x1:logger['info'](_0xdd06('0x5'));_0x103b19='1';_0x2598c8='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xdd06('0x8')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x103b19='2';_0x2598c8=_0xdd06('0x19');break;case 0x9:logger[_0xdd06('0x8')](_0xdd06('0x1a'));_0x103b19='9';_0x2598c8='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xdd06('0x1b'));_0x103b19='10';_0x2598c8=_0xdd06('0x1b');break;case 0xb:logger[_0xdd06('0x8')](_0xdd06('0x1c'));_0x103b19='11';_0x2598c8=_0xdd06('0x1c');}}}catch(_0x8fa670){logger[_0xdd06('0xf')](_0xdd06('0x1d'),JSON['stringify'](_0x8fa670));_0x350a74[_0xdd06('0x18')]();}}function _0x5a591c(){logger['info'](_0xdd06('0x1e'));_0x217d1a({'transcript':_0x498e7,'confidence':_0x5ea591,'status':_0x103b19,'status_message':_0x2598c8});}function _0x5b0a99(_0x14d45c){logger[_0xdd06('0xf')](_0xdd06('0x1f'));if(!_[_0xdd06('0x20')](_0x14d45c)){logger['error'](_['isObject'](_0x14d45c)?JSON[_0xdd06('0x15')](_0x14d45c):_0x14d45c);}}_0x350a74['on'](_0xdd06('0x21'),_0x2efee9);_0x350a74['on']('message',_0x2e0ea4);_0x350a74['on'](_0xdd06('0xd'),_0x5a591c);_0x350a74['on'](_0xdd06('0xf'),_0x5b0a99);});}; \ 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 feb1fba..2924c71 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 _0xcb90=['./asr','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb90,0x19c));var _0x0cb9=function(_0x232b38,_0x55e0a7){_0x232b38=_0x232b38-0x0;var _0x187520=_0xcb90[_0x232b38];return _0x187520;};var asr=require(_0x0cb9('0x0'));module[_0x0cb9('0x1')]={'asr':asr}; \ No newline at end of file +var _0x5d2b=['./asr','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d2b,0xd2));var _0xb5d2=function(_0x189716,_0x4d7619){_0x189716=_0x189716-0x0;var _0x398c6c=_0x5d2b[_0x189716];return _0x398c6c;};var asr=require(_0xb5d2('0x0'));module[_0xb5d2('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 24f46f6..dcb9276 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 _0xcdfd=['close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0xaad2f3,_0x540107){var _0x8eea56=function(_0x7d347b){while(--_0x7d347b){_0xaad2f3['push'](_0xaad2f3['shift']());}};_0x8eea56(++_0x540107);}(_0xcdfd,0x1bd));var _0xdcdf=function(_0x3efdca,_0xa17654){_0x3efdca=_0x3efdca-0x0;var _0x2d9479=_0xcdfd[_0x3efdca];return _0x2d9479;};'use strict';var util=require('util');var net=require(_0xdcdf('0x0'));var EventEmitter=require('events')[_0xdcdf('0x1')];var AGIError=require('./error');var AGIChannel=require(_0xdcdf('0x2'));var AGIServer=function(_0x1d4683,_0x51f88e,_0x34acec){var _0x48f2de=this,_0x1d4683=_0x1d4683||0x11dd,_0x51f88e=_0x51f88e||_0xdcdf('0x3'),_0x4c4d55=null,_0x373163=0x0;EventEmitter[_0xdcdf('0x4')](_0x48f2de);function _0x17e56e(){if(!_0x1d4683){_0x48f2de[_0xdcdf('0x5')](_0xdcdf('0x6'),new AGIError(_0xdcdf('0x7')));return![];}_0x4c4d55=net[_0xdcdf('0x8')]();_0x4c4d55[_0xdcdf('0x9')](_0x1d4683,_0x51f88e);_0x4c4d55['on'](_0xdcdf('0xa'),function(){_0x48f2de[_0xdcdf('0x5')](_0xdcdf('0xa'));});_0x4c4d55['on'](_0xdcdf('0xb'),function(_0x4bcd9b){_0x4c4d55['getConnections'](function(_0x120e0c,_0x3cd18c){if(_0x120e0c){_0x48f2de['emit'](_0xdcdf('0x6'),new AGIError(_0xdcdf('0xc'),_0x120e0c));}else if(_0x34acec&&_0x34acec<0x0){_0x48f2de[_0xdcdf('0x5')](_0xdcdf('0x6'),new AGIError(_0xdcdf('0xd')));_0x4bcd9b[_0xdcdf('0xe')]();}else if(_0x34acec&&_0x34acec>0x0&&_0x34acec<_0x3cd18c){_0x373163+=0x1;_0x48f2de['emit'](_0xdcdf('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x373163));_0x4bcd9b[_0xdcdf('0xe')]();}else{var _0x1f1080=new AGIChannel(_0x4bcd9b);_0x1f1080['on']('ready',function(){_0x48f2de[_0xdcdf('0x5')](_0xdcdf('0xb'),_0x1f1080);});}});});_0x4c4d55['on'](_0xdcdf('0x6'),function(_0x2ed29b){_0x48f2de[_0xdcdf('0x5')](_0xdcdf('0x6'),new AGIError(_0xdcdf('0xc'),_0x2ed29b['code']));});_0x4c4d55['on'](_0xdcdf('0xf'),function(){_0x48f2de[_0xdcdf('0x5')](_0xdcdf('0xf'),new AGIError(_0xdcdf('0x10')));});}process[_0xdcdf('0x11')](function(){_0x17e56e();});};util[_0xdcdf('0x12')](AGIServer,EventEmitter);module[_0xdcdf('0x13')]=function(_0x19ac04,_0x47099e,_0x24b0ce){return new AGIServer(_0x19ac04,_0x47099e,_0x24b0ce);}; \ No newline at end of file +var _0x5b14=['code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR'];(function(_0x389951,_0x4ce9b7){var _0x2f16b0=function(_0x3f5ddd){while(--_0x3f5ddd){_0x389951['push'](_0x389951['shift']());}};_0x2f16b0(++_0x4ce9b7);}(_0x5b14,0x100));var _0x45b1=function(_0x101ccf,_0x37e172){_0x101ccf=_0x101ccf-0x0;var _0x99b0f1=_0x5b14[_0x101ccf];return _0x99b0f1;};'use strict';var util=require(_0x45b1('0x0'));var net=require(_0x45b1('0x1'));var EventEmitter=require(_0x45b1('0x2'))[_0x45b1('0x3')];var AGIError=require(_0x45b1('0x4'));var AGIChannel=require(_0x45b1('0x5'));var AGIServer=function(_0x4dcde5,_0x145174,_0x798140){var _0x300320=this,_0x4dcde5=_0x4dcde5||0x11dd,_0x145174=_0x145174||_0x45b1('0x6'),_0x5a0706=null,_0x3a4354=0x0;EventEmitter[_0x45b1('0x7')](_0x300320);function _0xcae947(){if(!_0x4dcde5){_0x300320[_0x45b1('0x8')]('error',new AGIError(_0x45b1('0x9')));return![];}_0x5a0706=net[_0x45b1('0xa')]();_0x5a0706['listen'](_0x4dcde5,_0x145174);_0x5a0706['on'](_0x45b1('0xb'),function(){_0x300320['emit']('listening');});_0x5a0706['on'](_0x45b1('0xc'),function(_0x2ab9d2){_0x5a0706['getConnections'](function(_0x1de0c6,_0x1b15f4){if(_0x1de0c6){_0x300320[_0x45b1('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1de0c6));}else if(_0x798140&&_0x798140<0x0){_0x300320[_0x45b1('0x8')](_0x45b1('0xd'),new AGIError(_0x45b1('0xe')));_0x2ab9d2[_0x45b1('0xf')]();}else if(_0x798140&&_0x798140>0x0&&_0x798140<_0x1b15f4){_0x3a4354+=0x1;_0x300320[_0x45b1('0x8')](_0x45b1('0xd'),new AGIError(_0x45b1('0x10'),_0x3a4354));_0x2ab9d2[_0x45b1('0xf')]();}else{var _0x5b58f5=new AGIChannel(_0x2ab9d2);_0x5b58f5['on'](_0x45b1('0x11'),function(){_0x300320[_0x45b1('0x8')](_0x45b1('0xc'),_0x5b58f5);});}});});_0x5a0706['on'](_0x45b1('0xd'),function(_0x200798){_0x300320[_0x45b1('0x8')](_0x45b1('0xd'),new AGIError(_0x45b1('0x12'),_0x200798[_0x45b1('0x13')]));});_0x5a0706['on']('close',function(){_0x300320['emit'](_0x45b1('0x14'),new AGIError(_0x45b1('0x15')));});}process[_0x45b1('0x16')](function(){_0xcae947();});};util[_0x45b1('0x17')](AGIServer,EventEmitter);module[_0x45b1('0x18')]=function(_0x21ae78,_0x14b09a,_0x34ffef){return new AGIServer(_0x21ae78,_0x14b09a,_0x34ffef);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index aaf541b..c2bb56d 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 _0xe2e1=['GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','agentLogin','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','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','path','util','lodash','shelljs','randomstring','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','name','catch','getVoiceQueueById','getSquareProject','getSquareProjectById','then','dsn','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','agentPause','callerid','isNil','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getSound','file_id','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe2e1,0x9e));var _0x1e2e=function(_0x2bb89c,_0x53da69){_0x2bb89c=_0x2bb89c-0x0;var _0xef5729=_0xe2e1[_0x2bb89c];return _0xef5729;};'use strict';var fs=require('fs');var path=require(_0x1e2e('0x0'));var util=require(_0x1e2e('0x1'));var _=require(_0x1e2e('0x2'));var sh=require(_0x1e2e('0x3'));var odbc=require('odbc')();var rs=require(_0x1e2e('0x4'));var moment=require('moment');var Mustache=require(_0x1e2e('0x5'));var rp=require(_0x1e2e('0x6'));var logger=require(_0x1e2e('0x7'))(_0x1e2e('0x8'));var config=require('../../config/environment');var scripts=require(_0x1e2e('0x9'));var FILES_PATH=_0x1e2e('0xa');var recursiveMapAttributes=[_0x1e2e('0xb'),_0x1e2e('0xc')];var verticesWithRetry=[_0x1e2e('0xd'),_0x1e2e('0xe'),_0x1e2e('0xf')];var AGIVertices=function(_0x97c585,_0x121588,_0x2b3645){this[_0x1e2e('0x10')]=_0x97c585;this['rpc']=_0x121588;this[_0x1e2e('0x11')]=_0x2b3645;};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x13')]=function(_0x5c17f3,_0x3ead48){this[_0x1e2e('0x14')][_0x1e2e('0x15')](_0x5c17f3)['then'](function(_0x2fcd95){_0x3ead48(null,_0x2fcd95?_0x2fcd95[_0x1e2e('0x16')]:![]);})[_0x1e2e('0x17')](function(_0x4adb2a){_0x3ead48(_0x4adb2a);});};AGIVertices[_0x1e2e('0x12')]['getVoiceQueue']=function(_0x12b58f,_0x5a5758){this[_0x1e2e('0x14')][_0x1e2e('0x18')](_0x12b58f)['then'](function(_0x3c8ec5){_0x5a5758(null,_0x3c8ec5?_0x3c8ec5['name']:![]);})['catch'](function(_0x25131c){_0x5a5758(_0x25131c);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x19')]=function(_0x29f0cc,_0x3cca0f){this[_0x1e2e('0x14')][_0x1e2e('0x1a')](_0x29f0cc)[_0x1e2e('0x1b')](function(_0x2f4fa3){_0x3cca0f(null,_0x2f4fa3?_0x2f4fa3[_0x1e2e('0x16')]:![]);})[_0x1e2e('0x17')](function(_0x28b4ae){_0x3cca0f(_0x28b4ae);});};AGIVertices[_0x1e2e('0x12')]['getSquareOdbc']=function(_0x3e86a0,_0x55e958){this[_0x1e2e('0x14')]['getSquareOdbcById'](_0x3e86a0)[_0x1e2e('0x1b')](function(_0x5da2dd){_0x55e958(null,_0x5da2dd?_0x5da2dd[_0x1e2e('0x1c')]:![]);})['catch'](function(_0x595b00){_0x55e958(_0x595b00);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1d')]=function(_0x7a53d6,_0x49535d){this[_0x1e2e('0x14')][_0x1e2e('0x1e')](_0x7a53d6)[_0x1e2e('0x1b')](function(_0x4095eb){_0x49535d(null,_0x4095eb?_0x4095eb[_0x1e2e('0x16')]:![]);})[_0x1e2e('0x17')](function(_0x56bc9e){_0x49535d(_0x56bc9e);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1f')]=function(_0x48f610,_0x1dbff5){this[_0x1e2e('0x14')]['getTrunkById'](_0x48f610)[_0x1e2e('0x1b')](function(_0x49b31b){_0x1dbff5(null,_0x49b31b?_0x49b31b[_0x1e2e('0x16')]:![]);})['catch'](function(_0x44e50d){_0x1dbff5(_0x44e50d);});};AGIVertices[_0x1e2e('0x12')]['getSound']=function(_0x3069c5,_0x2df78a){var _0x346682=this;this[_0x1e2e('0x14')][_0x1e2e('0x20')](_0x3069c5)['then'](function(_0x3cd1f7){_0x2df78a(null,_0x3cd1f7?_0x346682[_0x1e2e('0x21')](_0x3cd1f7[_0x1e2e('0x22')]):![]);})[_0x1e2e('0x17')](function(_0x8d1bd2){_0x2df78a(_0x8d1bd2);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x23')]=function(_0x355ff6,_0x3e05fd){this[_0x1e2e('0x14')][_0x1e2e('0x24')](_0x355ff6)[_0x1e2e('0x1b')](function(_0x27796b){_0x3e05fd(null,_0x27796b?_0x27796b:![]);})[_0x1e2e('0x17')](function(_0x1eef37){_0x3e05fd(_0x1eef37);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x25')]=function(_0x258496,_0x1212f8,_0x29ac6d){this[_0x1e2e('0x11')][_0x1e2e('0x25')](_0x258496,_0x1212f8)[_0x1e2e('0x1b')](function(){_0x29ac6d(null);})['catch'](function(_0x3b21ce){_0x29ac6d(_0x3b21ce);});};AGIVertices['prototype']['getIntervals']=function(_0x274949,_0x355587){this[_0x1e2e('0x14')][_0x1e2e('0x26')](_0x274949)[_0x1e2e('0x1b')](function(_0x5b4373){if(_0x5b4373){if(_0x5b4373[_0x1e2e('0x27')]){_0x355587(null,[_0x5b4373[_0x1e2e('0x28')]]);}else{_0x355587(null,_['map'](_0x5b4373[_0x1e2e('0x29')],_0x1e2e('0x28')));}}else{_0x355587(null,![]);}})[_0x1e2e('0x17')](function(_0x5f47fc){_0x355587(_0x5f47fc);});};AGIVertices[_0x1e2e('0x12')]['getSoundPath']=function(_0x264501){return util[_0x1e2e('0x2a')](_0x1e2e('0x2b'),FILES_PATH,_0x264501);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x2c')]=function(_0x35e0bf,_0x281f0a,_0x3c5935){odbc['open'](_0x35e0bf,function(_0x4e7680){if(_0x4e7680){logger['error'](_0x1e2e('0x2d'),_0x4e7680);_0x3c5935(_0x4e7680);}else{logger[_0x1e2e('0x2e')](_0x1e2e('0x2f'));odbc[_0x1e2e('0x30')](_0x281f0a,function(_0x5914a4,_0x1dcbcf){if(_0x5914a4){logger[_0x1e2e('0x2e')](_0x1e2e('0x31'),_0x281f0a);_0x3c5935(_0x5914a4);}else{logger[_0x1e2e('0x2e')](_0x1e2e('0x32'),_0x281f0a);odbc[_0x1e2e('0x33')](function(_0x2e6d3d){if(_0x2e6d3d){logger[_0x1e2e('0x34')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2e6d3d);}_0x3c5935(null,_0x1dcbcf);});}});}});};AGIVertices[_0x1e2e('0x12')]['getSmsAccount']=function(_0x24bd68,_0x3a8ef1){this[_0x1e2e('0x14')]['getSmsAccountById'](_0x24bd68)[_0x1e2e('0x1b')](function(_0x5305ca){_0x3a8ef1(null,_0x5305ca?_0x5305ca:![]);})[_0x1e2e('0x17')](function(_0x37d649){_0x3a8ef1(_0x37d649);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x35')]=function(_0x29c623,_0xacfa0e){this[_0x1e2e('0x14')]['createSmsMessage'](_0x29c623)[_0x1e2e('0x1b')](function(_0x1b87f5){_0xacfa0e(null,_0x1b87f5);})[_0x1e2e('0x17')](function(_0x2f3675){_0xacfa0e(_0x2f3675);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x36')]=function(_0x4e209b,_0x3b8072,_0x2bd974){this[_0x1e2e('0x14')][_0x1e2e('0x36')]({'uniqueid':this['channel'][_0x1e2e('0x37')],'node':_0x4e209b['label'],'application':_0x4e209b[_0x1e2e('0x38')],'data':_0x3b8072||null,'project_name':this[_0x1e2e('0x10')][_0x1e2e('0x39')],'callerid':this[_0x1e2e('0x10')]['callerid']})['then'](function(_0x391dc7){if(_0x2bd974){_0x2bd974(null,_0x391dc7);}})[_0x1e2e('0x17')](function(_0x4ca050){if(_0x2bd974){_0x2bd974(_0x4ca050);}});};AGIVertices[_0x1e2e('0x12')]['createSquareRecording']=function(_0x47f567,_0x21c23a,_0x1e5cdd,_0x17368d){this[_0x1e2e('0x14')][_0x1e2e('0x3a')]({'uniqueid':this['channel'][_0x1e2e('0x37')],'callerid':this[_0x1e2e('0x10')]['callerid'],'calleridname':this[_0x1e2e('0x10')]['calleridname'],'context':this[_0x1e2e('0x10')]['context'],'extension':this[_0x1e2e('0x10')][_0x1e2e('0x3b')],'priority':this['channel'][_0x1e2e('0x3c')],'accountcode':this[_0x1e2e('0x10')][_0x1e2e('0x3d')],'dnid':this[_0x1e2e('0x10')][_0x1e2e('0x3e')],'projectName':this[_0x1e2e('0x10')][_0x1e2e('0x39')],'saveName':_0x21c23a,'filename':_0x47f567['file']||_0x21c23a,'savePath':_0x1e5cdd})[_0x1e2e('0x1b')](function(_0x50f683){_0x17368d(null,_0x50f683);})[_0x1e2e('0x17')](function(_0x398079){_0x17368d(_0x398079);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x3f')]=function(_0x20ffbc,_0x49605c,_0x3680f0,_0x3230bb,_0x1932af){this[_0x1e2e('0x14')]['createSquareMessage']({'uniqueid':this[_0x1e2e('0x10')][_0x1e2e('0x37')],'body':_0x20ffbc,'direction':_0x49605c,'providerName':_0x3680f0,'providerResponse':_0x3230bb})[_0x1e2e('0x1b')](function(_0x54e830){if(_0x1932af){_0x1932af(null,_0x54e830);}})[_0x1e2e('0x17')](function(_0x24fd03){if(_0x1932af){_0x1932af(_0x24fd03);}});};AGIVertices['prototype'][_0x1e2e('0x40')]=function(_0x354524,_0x639977){this[_0x1e2e('0x14')][_0x1e2e('0x40')]({'firstName':_[_0x1e2e('0x41')](_0x354524[_0x1e2e('0x16')])||_['isNil'](_0x354524[_0x1e2e('0x16')])?'callback_'+Math[_0x1e2e('0x42')]():_0x354524[_0x1e2e('0x16')],'lastName':_[_0x1e2e('0x41')](_0x354524[_0x1e2e('0x43')])||_['isNil'](_0x354524[_0x1e2e('0x43')])?null:_0x354524[_0x1e2e('0x43')],'phone':_0x354524['phone'],'ListId':_0x354524[_0x1e2e('0x44')],'scheduledat':_0x354524[_0x1e2e('0x45')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x1e2e('0x46'),'description':_0x1e2e('0x47')+_0x354524[_0x1e2e('0x45')][_0x1e2e('0x48')](),'priority':_0x354524['callback_priority']})[_0x1e2e('0x1b')](function(_0x226c10){_0x639977(null,_0x226c10);})[_0x1e2e('0x17')](function(_0x12051c){_0x639977(_0x12051c);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x49')]=function(_0x11b156,_0x2cddcc){this[_0x1e2e('0x14')]['getPauseById'](_0x11b156)['then'](function(_0x2e0b97){_0x2cddcc(null,_0x2e0b97?_0x2e0b97[_0x1e2e('0x16')]:![]);})[_0x1e2e('0x17')](function(_0x11575a){_0x2cddcc(_0x11575a);});};AGIVertices['prototype'][_0x1e2e('0x4a')]=function(_0x66def5,_0x2c8718,_0x32cffc){var _0x195fb2={'role':'agent'};_0x195fb2[_0x66def5]=this[_0x1e2e('0x10')][_0x1e2e('0x4b')];this[_0x1e2e('0x14')][_0x1e2e('0x4a')](_0x195fb2,_0x2c8718,this[_0x1e2e('0x10')]['uniqueid'])[_0x1e2e('0x1b')](function(_0x698084){_0x32cffc(null,_[_0x1e2e('0x4c')](_0x698084)?![]:!![]);})['catch'](function(_0x276426){logger[_0x1e2e('0x34')](_0x276426);_0x32cffc(null,![]);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x4d')]=function(_0xce9003,_0x15aefe){var _0x33d98a={'role':_0x1e2e('0x4e')};_0x33d98a[_0xce9003]=this[_0x1e2e('0x10')][_0x1e2e('0x4b')];this[_0x1e2e('0x14')][_0x1e2e('0x4d')](_0x33d98a)['then'](function(_0x34550d){_0x15aefe(null,_[_0x1e2e('0x4c')](_0x34550d)?![]:!![]);})[_0x1e2e('0x17')](function(_0x2ca53b){logger['error'](_0x2ca53b);_0x15aefe(null,![]);});};AGIVertices['prototype'][_0x1e2e('0x4f')]=function(_0x1553ac,_0x4991a6){var _0xfd2166={'role':_0x1e2e('0x4e')};_0xfd2166[_0x1553ac]=this[_0x1e2e('0x10')]['callerid'];this[_0x1e2e('0x14')][_0x1e2e('0x4f')](_0xfd2166)[_0x1e2e('0x1b')](function(_0x3c2e26){_0x4991a6(null,_[_0x1e2e('0x4c')](_0x3c2e26)?![]:!![]);})[_0x1e2e('0x17')](function(_0x37c290){logger['error'](_0x37c290);_0x4991a6(null,![]);});};AGIVertices[_0x1e2e('0x12')]['agentLogin']=function(_0x330284,_0x53d5f7){var _0x4f77c1={'role':_0x1e2e('0x4e')};_0x4f77c1[_0x330284]=this[_0x1e2e('0x10')][_0x1e2e('0x4b')];var _0x3ff8c1=_0x330284!=_0x1e2e('0x50')?util[_0x1e2e('0x2a')](_0x1e2e('0x51'),_0x1e2e('0x52'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')]):undefined;this[_0x1e2e('0x14')]['agentLogin'](_0x4f77c1,_0x3ff8c1)[_0x1e2e('0x1b')](function(_0x169e47){_0x53d5f7(null,_[_0x1e2e('0x4c')](_0x169e47)?![]:!![]);})['catch'](function(_0x5b483e){logger[_0x1e2e('0x34')](_0x5b483e);_0x53d5f7(null,![]);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x53')]=function(_0x469c74,_0x30e114){sh[_0x1e2e('0x54')](_[_0x1e2e('0x55')](_0x469c74),function(_0xe8e0c0,_0x1e02a8){var _0x5c95be=_0x1e02a8[_0x1e2e('0x56')](/(\r\n|\n|\r)/gm,'');_0x30e114(null,_0x5c95be);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x57')]=function(_0x41a063,_0x34234c){scripts[_0x1e2e('0x57')](_0x41a063[_0x1e2e('0x58')],_0x41a063[_0x1e2e('0x59')]||_0x1e2e('0x5a'),_0x41a063[_0x1e2e('0x5a')],_0x41a063[_0x1e2e('0x5b')]||_0x1e2e('0x5c'),_0x41a063[_0x1e2e('0x5d')]||'MALE',_0x41a063[_0x1e2e('0x5e')]||_0x1e2e('0x5f'))[_0x1e2e('0x1b')](function(_0x38e3c8){_0x34234c(null,_0x38e3c8);})[_0x1e2e('0x17')](function(_0x40bdb6){_0x34234c(_0x40bdb6);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x60')]=function(_0x3d53d4,_0x45f248){scripts['googleTTS'](_0x3d53d4['text'],_0x3d53d4['google_tts_language']||'en',0x1)[_0x1e2e('0x1b')](function(_0x47d5e6){_0x45f248(null,_0x47d5e6);})[_0x1e2e('0x17')](function(_0x322879){_0x45f248(_0x322879);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x61')]=function(_0x2ab56a,_0x3c5d60){var _0xb7812a={'uri':_0x2ab56a[_0x1e2e('0x62')],'method':_0x2ab56a[_0x1e2e('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2ab56a['timeout'])===_0x1e2e('0x64')&&parseInt(_0x2ab56a['timeout'])>=0x1?parseInt(_0x2ab56a[_0x1e2e('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x1e2e('0x66'),_0x1e2e('0x67')],_0xb7812a[_0x1e2e('0x63')][_0x1e2e('0x68')]())){try{_0xb7812a[_0x1e2e('0x69')]=_0x2ab56a[_0x1e2e('0xc')]?JSON[_0x1e2e('0x6a')](_0x2ab56a[_0x1e2e('0xc')]):{};}catch(_0x30be10){logger[_0x1e2e('0x34')](_0x1e2e('0x6b'),_0x30be10);}}try{_0xb7812a[_0x1e2e('0x6c')]=_0x2ab56a[_0x1e2e('0xb')]?JSON[_0x1e2e('0x6a')](_0x2ab56a[_0x1e2e('0xb')]):{};}catch(_0x3d29a5){logger[_0x1e2e('0x34')](_0x1e2e('0x6d'),_0x3d29a5);}if(_0x2ab56a[_0x1e2e('0x6e')]){try{var _0x258c23=require(_0x2ab56a['computedVariables'])[_0x1e2e('0x6f')](this,_0xb7812a);_0xb7812a[_0x1e2e('0x70')]=Mustache[_0x1e2e('0x71')](_0x2ab56a['url'],_0x258c23,{},['$$','$$']);if(_0xb7812a[_0x1e2e('0x6c')]){_0xb7812a[_0x1e2e('0x6c')]=JSON[_0x1e2e('0x6a')](Mustache[_0x1e2e('0x71')](JSON[_0x1e2e('0x72')](_0xb7812a[_0x1e2e('0x6c')]),_0x258c23,{},['$$','$$']));}if(_0xb7812a[_0x1e2e('0x69')]){_0xb7812a[_0x1e2e('0x69')]=JSON['parse'](Mustache[_0x1e2e('0x71')](JSON['stringify'](_0xb7812a[_0x1e2e('0x69')]),_0x258c23,{},['$$','$$']));}}catch(_0x250c88){logger[_0x1e2e('0x34')](_0x1e2e('0x73'),_0x250c88);}}rp(_0xb7812a)[_0x1e2e('0x1b')](function(_0x70732e){var _0x3b2c9c={'statusCode':_0x70732e[_0x1e2e('0x74')]||0xc8,'statusMessage':_0x70732e['statusMessage']||'OK','headers':_0x70732e[_0x1e2e('0x6c')]||{},'body':_0x70732e['body']||{}};_0x3c5d60(null,_0x3b2c9c);})[_0x1e2e('0x17')](function(_0x5232e2){var _0x1794c5={'statusCode':_0x5232e2['statusCode']||0x1f4,'statusMessage':_0x5232e2[_0x1e2e('0x75')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x5232e2[_0x1e2e('0x76')][_0x1e2e('0x6c')]||{},'body':_0x5232e2[_0x1e2e('0x76')][_0x1e2e('0x69')]||{}};_0x3c5d60(null,_0x1794c5);});};AGIVertices['prototype'][_0x1e2e('0x77')]=function(_0x14256b,_0x273e60){scripts[_0x1e2e('0x77')](this['channel'][_0x1e2e('0x37')],_0x14256b['key'],_0x14256b[_0x1e2e('0x5a')],_0x14256b[_0x1e2e('0x78')]||'en')['then'](function(_0x4dba45){_0x273e60(null,_0x4dba45);})[_0x1e2e('0x17')](function(_0x152b1d){_0x273e60(_0x152b1d);});};AGIVertices['prototype'][_0x1e2e('0x79')]=function(_0x31e9a0,_0x408d2f){scripts[_0x1e2e('0x79')](this[_0x1e2e('0x10')][_0x1e2e('0x37')],_0x31e9a0[_0x1e2e('0x7a')],_0x31e9a0[_0x1e2e('0x7b')],_0x31e9a0[_0x1e2e('0x7c')],_0x31e9a0[_0x1e2e('0x5a')],_0x31e9a0[_0x1e2e('0x7d')]||'en')[_0x1e2e('0x1b')](function(_0x447bf2){_0x408d2f(null,_0x447bf2);})[_0x1e2e('0x17')](function(_0x423fe4){_0x408d2f(_0x423fe4);});};AGIVertices[_0x1e2e('0x12')]['sestekNDA']=function(_0x438570,_0x6df6c6){scripts['sestekNDA'](this[_0x1e2e('0x10')],_0x438570)[_0x1e2e('0x1b')](function(_0x184ece){_0x6df6c6(null,_0x184ece);})[_0x1e2e('0x17')](function(_0xe29506){_0x6df6c6(_0xe29506);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x7e')]=function(_0x1509ab,_0x517dc5){scripts[_0x1e2e('0x7e')](_0x1509ab[_0x1e2e('0x7f')],_0x1509ab[_0x1e2e('0x5a')],_0x1509ab[_0x1e2e('0x80')]||_0x1e2e('0x5c'),_0x1509ab[_0x1e2e('0x81')])[_0x1e2e('0x1b')](function(_0x2180af){_0x517dc5(null,_0x2180af);})[_0x1e2e('0x17')](function(_0x3c0900){_0x517dc5(_0x3c0900);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x82')]=function(_0x1f65c0,_0x551282,_0xcf2574){scripts[_0x1e2e('0x82')](_0x551282,_0x1f65c0[_0x1e2e('0x7f')],_0x1f65c0[_0x1e2e('0x83')]||_0x1e2e('0x5c'),this[_0x1e2e('0x84')](_0x1f65c0[_0x1e2e('0x85')])?_0x1f65c0[_0x1e2e('0x85')]:undefined)[_0x1e2e('0x1b')](function(_0x308ef7){_0xcf2574(null,_0x308ef7);})['catch'](function(_0x21fc3f){_0xcf2574(_0x21fc3f);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x86')]=function(_0x187b25,_0x16fcdd){scripts['awsPolly'](_0x187b25[_0x1e2e('0x87')],_0x187b25[_0x1e2e('0x88')],_0x187b25[_0x1e2e('0x89')],_0x187b25['aws_polly_voice']||_0x1e2e('0x8a'),_0x187b25[_0x1e2e('0x5a')],_0x187b25[_0x1e2e('0x8b')]||_0x1e2e('0x5a'))['then'](function(_0x3d63f9){_0x16fcdd(null,_0x3d63f9);})['catch'](function(_0x37160d){_0x16fcdd(_0x37160d);});};AGIVertices[_0x1e2e('0x12')]['awsLex']=function(_0x226c98,_0x112afd){scripts[_0x1e2e('0x8c')](this[_0x1e2e('0x10')][_0x1e2e('0x37')],_0x226c98[_0x1e2e('0x87')],_0x226c98[_0x1e2e('0x88')],_0x226c98[_0x1e2e('0x8d')],_0x226c98['text'],_0x226c98[_0x1e2e('0x8e')])['then'](function(_0x50e5c4){_0x112afd(null,_0x50e5c4);})[_0x1e2e('0x17')](function(_0x299bda){_0x112afd(_0x299bda);});};AGIVertices['prototype'][_0x1e2e('0x8f')]=function(_0x4f8480,_0xcba2,_0x1c3054){scripts[_0x1e2e('0x8f')](_0xcba2,_0x4f8480[_0x1e2e('0x7f')],_0x4f8480[_0x1e2e('0x90')]||'en-US')[_0x1e2e('0x1b')](function(_0x3b877a){_0x1c3054(null,_0x3b877a);})[_0x1e2e('0x17')](function(_0x5a4f7a){_0x1c3054(_0x5a4f7a);});};AGIVertices['prototype'][_0x1e2e('0x91')]=function(_0x44a3c2,_0x174c42,_0x3359ad){scripts[_0x1e2e('0x91')](_0x174c42,_0x44a3c2[_0x1e2e('0x92')],_0x44a3c2[_0x1e2e('0x93')],_0x44a3c2['uri'])[_0x1e2e('0x1b')](function(_0x53e0cb){_0x3359ad(null,_0x53e0cb);})[_0x1e2e('0x17')](function(_0x774e6c){_0x3359ad(_0x774e6c);});};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x94')]=function(_0x553678){var _0x3e57e5=_[_0x1e2e('0x95')](verticesWithRetry,_0x553678['agicommand'])?_0x553678:_[_0x1e2e('0x96')](_0x553678);for(var _0x4c6f38 in _0x3e57e5){if(_0x3e57e5[_0x1e2e('0x97')](_0x4c6f38)){if(_0x3e57e5[_0x4c6f38]&&_[_0x1e2e('0x98')](_0x3e57e5[_0x4c6f38])){if(_['includes'](recursiveMapAttributes,_0x4c6f38)){_0x3e57e5[_0x4c6f38]=this[_0x1e2e('0x99')](_0x3e57e5[_0x4c6f38]);}else{_0x3e57e5[_0x4c6f38]=this[_0x1e2e('0x9a')](_0x3e57e5[_0x4c6f38]);}}}}return _0x3e57e5;};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x9b')]=function(_0x3d2442){for(var _0x53f30f in _0x3d2442){if(_0x3d2442[_0x1e2e('0x97')](_0x53f30f)){if(_['isPlainObject'](_0x3d2442[_0x53f30f])){this['recursiveNodeIndex'](_0x3d2442[_0x53f30f]);}else if(_[_0x1e2e('0x9c')](_0x3d2442[_0x53f30f])){for(var _0x2eec1d=0x0;_0x2eec1d<_0x3d2442[_0x53f30f][_0x1e2e('0x9d')];_0x2eec1d++){this[_0x1e2e('0x9b')](_0x3d2442[_0x53f30f][_0x2eec1d]);}}else if(_[_0x1e2e('0x98')](_0x3d2442[_0x53f30f])){_0x3d2442[_0x53f30f]=this[_0x1e2e('0x9a')](_0x3d2442[_0x53f30f]);}}}};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x9e')]=function(_0x1c98df,_0x25218c){for(var _0x254936 in _0x1c98df){if(_0x1c98df[_0x1e2e('0x97')](_0x254936)){if(_[_0x1e2e('0x9f')](_0x1c98df[_0x254936])){if(!_[_0x1e2e('0x41')](_0x1c98df[_0x254936])){this[_0x1e2e('0x9e')](_0x1c98df[_0x254936],util[_0x1e2e('0x2a')]('%s.%s',_0x25218c,_0x254936));}}else if(_[_0x1e2e('0x9c')](_0x1c98df[_0x254936])){for(var _0x3cf644=0x0;_0x3cf644<_0x1c98df[_0x254936]['length'];_0x3cf644++){this[_0x1e2e('0x9e')](_0x1c98df[_0x254936][_0x3cf644],util[_0x1e2e('0x2a')](_0x1e2e('0xa0'),_0x25218c,_0x254936+'['+_0x3cf644+']'));}}else{if(!_[_0x1e2e('0x4c')](_0x1c98df[_0x254936])){this[_0x1e2e('0x10')][_0x1e2e('0xa1')](util[_0x1e2e('0x2a')](_0x1e2e('0xa0'),_0x25218c,_0x254936),_0x1c98df[_0x254936]);}}}}};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x99')]=function(_0x53e9d6){try{var _0x3567de=JSON[_0x1e2e('0x6a')](_0x53e9d6);this[_0x1e2e('0x9b')](_0x3567de);return JSON['stringify'](_0x3567de);}catch(_0x118798){return this[_0x1e2e('0x9a')](_0x53e9d6);}};AGIVertices[_0x1e2e('0x12')]['replaceAllVariables']=function(_0x2e1fe1){var _0x235b8f=_0x2e1fe1[_0x1e2e('0xa2')]('{');for(var _0x59d59f=0x1;_0x59d59f<_0x235b8f[_0x1e2e('0x9d')];_0x59d59f+=0x1){var _0x34e762=_0x235b8f[_0x59d59f][_0x1e2e('0xa2')]('}');if(_0x34e762[_0x1e2e('0x9d')]>0x1){_0x2e1fe1=_0x2e1fe1[_0x1e2e('0xa3')]('{'+_0x34e762[0x0]+'}',this[_0x1e2e('0x10')][_0x1e2e('0x13')](_0x34e762[0x0])[_0x1e2e('0xa4')]||_0x34e762[0x0]);}}if(_0x235b8f[_0x1e2e('0x9d')]===0x1){return _0x2e1fe1[_0x1e2e('0x48')]();}return this['replaceAllVariables'](_0x2e1fe1);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xa5')]=function(_0x238872,_0x4f86fa){var _0x146246=this[_0x1e2e('0x10')][_0x1e2e('0x13')](_0x238872);if(_0x146246[_0x1e2e('0xa6')]===-0x1){return _0x146246;}logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0xa7'),_0x4f86fa,_0x146246[_0x1e2e('0xa4')]));return this['channel'][_0x1e2e('0xa1')](_0x4f86fa,_0x146246[_0x1e2e('0xa4')]);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x84')]=function(_0x559a04){return _0x559a04&&_0x559a04!=='0'&&_0x559a04!=='-1'&&_0x559a04!=='';};AGIVertices['prototype']['maxRetry']=function(_0x7a9a51){this[_0x1e2e('0x36')]['sync'](this,_0x7a9a51,'-');_0x7a9a51[_0x1e2e('0xa8')]=_0x7a9a51['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1e2e('0x12')]['mrcpsynth']=function(_0x2f5918){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0xa9'),_0x2f5918['label']));if(!this['isConfigured'](_0x2f5918[_0x1e2e('0x5a')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0xab'));}var _0x30568e='\x22'+_0x2f5918[_0x1e2e('0x5a')]+'\x22';if(this[_0x1e2e('0x84')](_0x2f5918[_0x1e2e('0x76')])){_0x30568e+=','+_0x2f5918[_0x1e2e('0x76')];}var _0x3bb587=this[_0x1e2e('0x10')]['exec'](_0x1e2e('0xac'),_0x30568e);if(_0x3bb587[_0x1e2e('0xa6')]===-0x1){return _0x3bb587;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xad'),_0x30568e));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xae')]=function(_0x320f83){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0xaf'),_0x320f83[_0x1e2e('0xb0')]));if(!this['isConfigured'](_0x320f83[_0x1e2e('0xb1')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xb2'));}var _0x24958c=_0x320f83[_0x1e2e('0xb1')];if(this['isConfigured'](_0x320f83[_0x1e2e('0x76')])){_0x24958c+=','+_0x320f83[_0x1e2e('0x76')];}var _0x137a4d=this[_0x1e2e('0x10')]['exec']('MRCPRecog',_0x24958c);if(_0x137a4d['result']===-0x1){return _0x137a4d;}var _0x4381dd=this[_0x1e2e('0xa5')](_0x1e2e('0xb3'),_0x1e2e('0xb4'));if(_0x4381dd[_0x1e2e('0xa6')]===-0x1){return _0x4381dd;}var _0xf7c90b=this[_0x1e2e('0xa5')](_0x1e2e('0xb5'),_0x1e2e('0xb6'));if(_0xf7c90b['result']===-0x1){return _0xf7c90b;}var _0x4cf499=this[_0x1e2e('0xa5')](_0x1e2e('0xb7'),'MRCP_RECOG_INSTANCE');if(_0x4cf499['result']===-0x1){return _0x4cf499;}return this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')](_0x1e2e('0xb8'),_0x24958c));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x8')]=function(_0x2e8078){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0xb9'),_0x2e8078[_0x1e2e('0xb0')]));return this[_0x1e2e('0x10')][_0x1e2e('0x8')]([_0x2e8078[_0x1e2e('0xba')],_0x2e8078['args']]);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xbb')]=function(_0x250742){logger['info'](util[_0x1e2e('0x2a')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x250742['label']));if(this[_0x1e2e('0x84')](_0x250742[_0x1e2e('0x65')])){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0xbc'),_0x250742[_0x1e2e('0x65')]));var _0x339901=this[_0x1e2e('0x10')][_0x1e2e('0xbd')](_0x250742[_0x1e2e('0x65')]);if(_0x339901[_0x1e2e('0xa6')]===-0x1){return _0x339901;}}return this[_0x1e2e('0x10')]['answer']();};AGIVertices[_0x1e2e('0x12')]['callback']=function(_0x5c476d){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5c476d['label']));if(!this[_0x1e2e('0x84')](_0x5c476d['list_id'])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x5c476d,_0x1e2e('0xbe'));}_0x5c476d['scheduledAt']=moment();if(this[_0x1e2e('0x84')](_0x5c476d[_0x1e2e('0xbf')])){_0x5c476d[_0x1e2e('0x45')]=moment()[_0x1e2e('0xc0')](_0x5c476d['delay'],_0x1e2e('0xc1'));}if(!this[_0x1e2e('0x84')](_0x5c476d[_0x1e2e('0xc2')])){_0x5c476d[_0x1e2e('0xc2')]=0x2;}this['createCmContact'][_0x1e2e('0x6f')](this,_0x5c476d);return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format'](_0x1e2e('0xc3'),_0x5c476d[_0x1e2e('0xc4')],_0x5c476d[_0x1e2e('0x44')],_0x5c476d[_0x1e2e('0x45')]));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xc5')]=function(_0x57f051){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0xc6'),_0x57f051[_0x1e2e('0xb0')]));var _0xda0892=this['channel'][_0x1e2e('0x54')](_0x57f051[_0x1e2e('0xc7')],_0x57f051[_0x1e2e('0x76')]);if(_0xda0892['result']===-0x1){return _0xda0892;}return this['channel'][_0x1e2e('0xaa')](util['format'](_0x1e2e('0xc8'),_0x57f051['application'],_0x57f051[_0x1e2e('0x76')]));};AGIVertices['prototype'][_0x1e2e('0xc9')]=function(_0x2fc0cd){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2fc0cd[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x2fc0cd[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xab'));}var _0x5daed4='\x22'+_0x2fc0cd[_0x1e2e('0x5a')]+'\x22';if(this[_0x1e2e('0x84')](_0x2fc0cd[_0x1e2e('0x76')])){_0x5daed4+=','+_0x2fc0cd[_0x1e2e('0x76')];}var _0x1bd3f7=this[_0x1e2e('0x10')][_0x1e2e('0x54')]('MRCPSynth',_0x5daed4);if(_0x1bd3f7[_0x1e2e('0xa6')]===-0x1){return _0x1bd3f7;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format'](_0x1e2e('0xad'),_0x5daed4));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xca')]=function(_0x41bd49){logger[_0x1e2e('0x2e')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x41bd49[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x41bd49[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xab'));}var _0x50f13d='\x22'+_0x41bd49[_0x1e2e('0x5a')]+'\x22';if(this[_0x1e2e('0x84')](_0x41bd49['options'])){_0x50f13d+=','+_0x41bd49['options'];}var _0x3e58af=this[_0x1e2e('0x10')][_0x1e2e('0x54')](_0x1e2e('0xac'),_0x50f13d);if(_0x3e58af[_0x1e2e('0xa6')]===-0x1){return _0x3e58af;}return this[_0x1e2e('0x10')]['noop'](util['format'](_0x1e2e('0xad'),_0x50f13d));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xcb')]=function(_0x5bbfa8){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0xcc'),_0x5bbfa8[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x5bbfa8[_0x1e2e('0xb1')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0xb2'));}var _0x161308=_0x5bbfa8[_0x1e2e('0xb1')];if(this['isConfigured'](_0x5bbfa8['options'])){_0x161308+=','+_0x5bbfa8['options'];}var _0x1af1cb=this['channel'][_0x1e2e('0x54')](_0x1e2e('0xcd'),_0x161308);if(_0x1af1cb[_0x1e2e('0xa6')]===-0x1){return _0x1af1cb;}var _0x587894=this[_0x1e2e('0xa5')](_0x1e2e('0xb3'),'LUMENVOX_ASR_CONFIDENCE');if(_0x587894['result']===-0x1){return _0x587894;}var _0x13f02a=this[_0x1e2e('0xa5')](_0x1e2e('0xb5'),_0x1e2e('0xce'));if(_0x13f02a[_0x1e2e('0xa6')]===-0x1){return _0x13f02a;}var _0x18e5a2=this[_0x1e2e('0xa5')](_0x1e2e('0xb7'),'LUMENVOX_ASR_INSTANCE');if(_0x18e5a2['result']===-0x1){return _0x18e5a2;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xb8'),_0x161308));};AGIVertices['prototype']['sestekasr']=function(_0xcf255b){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0xcf'),_0xcf255b[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0xcf255b[_0x1e2e('0xb1')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xb2'));}var _0x215ab0=_0xcf255b[_0x1e2e('0xb1')];if(this[_0x1e2e('0x84')](_0xcf255b['options'])){_0x215ab0+=','+_0xcf255b[_0x1e2e('0x76')];}var _0x8cd9d5=this[_0x1e2e('0x10')][_0x1e2e('0x54')](_0x1e2e('0xcd'),_0x215ab0);if(_0x8cd9d5['result']===-0x1){return _0x8cd9d5;}var _0x340e56=this['getAndSetVariable'](_0x1e2e('0xb3'),_0x1e2e('0xd0'));if(_0x340e56[_0x1e2e('0xa6')]===-0x1){return _0x340e56;}var _0x15e676=this[_0x1e2e('0xa5')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x15e676[_0x1e2e('0xa6')]===-0x1){return _0x15e676;}var _0x5b7ab6=this[_0x1e2e('0xa5')](_0x1e2e('0xb7'),_0x1e2e('0xd1'));if(_0x5b7ab6['result']===-0x1){return _0x5b7ab6;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xb8'),_0x215ab0));};AGIVertices[_0x1e2e('0x12')]['database']=function(_0x126a45){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0xd2'),_0x126a45['label']));if(!this[_0x1e2e('0x84')](_0x126a45[_0x1e2e('0xd3')])){return this[_0x1e2e('0x10')]['error'](_0x126a45,_0x1e2e('0xd4'));}var _0x1ad730=this[_0x1e2e('0xd5')]['sync'](this,_0x126a45[_0x1e2e('0xd3')]);if(!_0x1ad730){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x126a45,_0x1e2e('0xd6'));}if(!this['isConfigured'](_0x126a45[_0x1e2e('0x30')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x126a45,_0x1e2e('0xd7'));}var _0x360c5e=_0x126a45[_0x1e2e('0x30')][_0x1e2e('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x1e2e('0x2a')](_0x1e2e('0xd8'),_0x360c5e));var _0x2f80ae=this[_0x1e2e('0x2c')][_0x1e2e('0x6f')](this,_0x1ad730,_0x360c5e);this['createSquareDetailsReport'][_0x1e2e('0x6f')](this,_0x126a45,_0x360c5e);if(!this[_0x1e2e('0x84')](_0x126a45[_0x1e2e('0xd9')])){return this['channel'][_0x1e2e('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x475f24=this[_0x1e2e('0x13')][_0x1e2e('0x6f')](this,_0x126a45[_0x1e2e('0xd9')]);if(!_0x475f24){return this[_0x1e2e('0x10')]['error'](_0x126a45,_0x1e2e('0xda'));}var _0x1844bd=this;_0x2f80ae['forEach'](function(_0x184575,_0x3cbdbf){Object[_0x1e2e('0xdb')](_0x184575)[_0x1e2e('0xdc')](function(_0x6771a3){_0x1844bd[_0x1e2e('0x10')][_0x1e2e('0xa1')](util['format'](_0x1e2e('0xdd'),_0x475f24,_0x3cbdbf,_0x6771a3),_0x184575[_0x6771a3]);});});this[_0x1e2e('0x10')][_0x1e2e('0xa1')](util[_0x1e2e('0x2a')](_0x1e2e('0xde'),_0x475f24),_0x2f80ae[_0x1e2e('0x9d')]);return this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xdf'),_0x475f24));};AGIVertices['prototype'][_0x1e2e('0xe0')]=function(_0x5b9240){logger[_0x1e2e('0xe1')](util[_0x1e2e('0x2a')](_0x1e2e('0xe2'),_0x5b9240['label']));if(!this['isConfigured'](_0x5b9240['sip_id'])){return this[_0x1e2e('0x10')]['error'](_0x5b9240,_0x1e2e('0xe3'));}var _0x3c6e6b=this['getUser'][_0x1e2e('0x6f')](this,_0x5b9240['sip_id']);if(!_0x3c6e6b){return this[_0x1e2e('0x10')]['error'](_0x5b9240,'no\x20user\x20found');}var _0x444775=this[_0x1e2e('0x10')][_0x1e2e('0x54')](_0x1e2e('0xe4'),[util['format'](_0x1e2e('0xe5'),_0x3c6e6b),_0x5b9240[_0x1e2e('0x65')],_0x5b9240[_0x1e2e('0xe6')],_0x5b9240[_0x1e2e('0x62')]]);if(_0x444775[_0x1e2e('0xa6')]===-0x1){return _0x444775;}return this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xe7')]=function(_0x4e4b44){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0xe8'),_0x4e4b44['label']));if(!this[_0x1e2e('0x84')](_0x4e4b44[_0x1e2e('0x7f')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')]('no\x20key\x20configured');}if(!this[_0x1e2e('0x84')](_0x4e4b44[_0x1e2e('0x5a')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0xab'));}this['channel'][_0x1e2e('0xe9')]=!![];this[_0x1e2e('0x36')](_0x4e4b44);this['createSquareMessage'](_0x4e4b44[_0x1e2e('0x5a')],'in','','');this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x4e4b44[_0x1e2e('0x5a')]));var _0x1c1a19=this[_0x1e2e('0x77')]['sync'](this,_0x4e4b44);if(_0x1c1a19){for(var _0x433b4a in _0x1c1a19){if(_0x1c1a19[_0x1e2e('0x97')](_0x433b4a)){this[_0x1e2e('0x10')]['setVariable'](util[_0x1e2e('0x2a')](_0x1e2e('0xea'),_0x433b4a[_0x1e2e('0x68')]()),_0x1c1a19[_0x433b4a]);}}this[_0x1e2e('0x3f')](_0x1c1a19[_0x1e2e('0xeb')],_0x1e2e('0xec'),_0x1e2e('0xe7'),'');return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xed'),_0x1c1a19['speech']));}return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x4e4b44,_0x1e2e('0xee'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xef')]=function(_0x25d966){logger[_0x1e2e('0x2e')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x25d966[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x25d966[_0x1e2e('0x7a')])){return this[_0x1e2e('0x10')]['noop'](_0x1e2e('0xf0'));}if(!this[_0x1e2e('0x84')](_0x25d966['client_email'])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')]('no\x20client_email\x20configured');}if(!this[_0x1e2e('0x84')](_0x25d966['private_key'])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0xf1'));}if(!this[_0x1e2e('0x84')](_0x25d966['dialogflowV2_language'])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xf2'));}if(!this[_0x1e2e('0x84')](_0x25d966[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')]('no\x20text\x20configured');}this[_0x1e2e('0x10')][_0x1e2e('0xe9')]=!![];this[_0x1e2e('0x36')](_0x25d966);this[_0x1e2e('0x3f')](_0x25d966[_0x1e2e('0x5a')],'in','','');this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xf3'),_0x25d966[_0x1e2e('0x5a')]));var _0x2c3b0e=this[_0x1e2e('0x79')][_0x1e2e('0x6f')](this,_0x25d966);if(_0x2c3b0e){for(var _0x11ae12 in _0x2c3b0e){if(_0x2c3b0e[_0x1e2e('0x97')](_0x11ae12)){if(_0x11ae12!==_0x1e2e('0xf4')){this[_0x1e2e('0x10')]['setVariable'](util[_0x1e2e('0x2a')](_0x1e2e('0xea'),_0x11ae12[_0x1e2e('0x68')]()),_0x2c3b0e[_0x11ae12]);}}}this[_0x1e2e('0x3f')](_0x2c3b0e[_0x1e2e('0xeb')],_0x1e2e('0xec'),'dialogflowV2',_0x2c3b0e[_0x1e2e('0xf4')]);return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x2c3b0e[_0x1e2e('0xeb')]));}return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x25d966,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x1e2e('0xf5')]=function(_0x55cb05){logger['info'](util[_0x1e2e('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x55cb05['label']));if(!this[_0x1e2e('0x84')](_0x55cb05[_0x1e2e('0xf6')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xf7'));}if(!this['isConfigured'](_0x55cb05[_0x1e2e('0xf8')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xf9'));}if(!this[_0x1e2e('0x84')](_0x55cb05[_0x1e2e('0xfa')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xfb'));}if(!this[_0x1e2e('0x84')](_0x55cb05[_0x1e2e('0xfc')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0xab'));}this[_0x1e2e('0x10')]['bot']=!![];this[_0x1e2e('0x36')](_0x55cb05);this[_0x1e2e('0x3f')](_0x55cb05[_0x1e2e('0x5a')],'in','','');this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')](_0x1e2e('0xfd'),_0x55cb05[_0x1e2e('0x5a')]));var _0x24b789=this['sestekNDA'][_0x1e2e('0x6f')](this,_0x55cb05);if(_0x24b789){for(var _0x42264f in _0x24b789){if(_0x24b789[_0x1e2e('0x97')](_0x42264f)){this[_0x1e2e('0x10')][_0x1e2e('0xa1')](util[_0x1e2e('0x2a')]('SESTEK_NDA_%s',_0x42264f['toUpperCase']()),_0x24b789[_0x42264f]);}}this['createSquareMessage'](_0x24b789[_0x1e2e('0xeb')],_0x1e2e('0xec'),_0x1e2e('0xf5'),'');if(_0x24b789[_0x1e2e('0xfe')]){this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xff'),_0x24b789['audiofile']));var _0x536a9c=this[_0x1e2e('0x10')][_0x1e2e('0x100')](_0x24b789[_0x1e2e('0xfe')]);try{fs['unlink'](_0x24b789[_0x1e2e('0xfe')]+_0x1e2e('0x101'));}catch(_0x39aa31){logger[_0x1e2e('0x34')](_0x39aa31);}return _0x536a9c;}else{return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x102'),_0x24b789[_0x1e2e('0xeb')]));}}return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x55cb05,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x1e2e('0x103')]=function(_0x467807){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x467807[_0x1e2e('0xb0')]));return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0x103'));};AGIVertices['prototype'][_0x1e2e('0x104')]=function(_0xb08760){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xb08760[_0x1e2e('0xb0')]));var _0x5cc144='';if(_0xb08760[_0x1e2e('0x105')]){if(!this[_0x1e2e('0x84')](_0xb08760[_0x1e2e('0x105')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0xb08760,_0x1e2e('0x106'));}else{var _0x2dbc12=parseInt(_0xb08760['trunk_id'],0xa);if(isNaN(_0x2dbc12)){_0x5cc144=_0xb08760['trunk_id'];}else{_0x5cc144=this[_0x1e2e('0x1f')][_0x1e2e('0x6f')](this,_0xb08760[_0x1e2e('0x105')]);if(!_0x5cc144){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0xb08760,_0x1e2e('0x107'));}}}}else if(_0xb08760['trunk_name']){_0x5cc144=_0xb08760[_0x1e2e('0x108')];}else{return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0xb08760,_0x1e2e('0x106'));}var _0x2f77b9=this[_0x1e2e('0x10')][_0x1e2e('0x54')](_0x1e2e('0xe4'),[util[_0x1e2e('0x2a')](_0x1e2e('0x109'),_0x5cc144,_0xb08760[_0x1e2e('0xc4')]),_0xb08760[_0x1e2e('0x65')],_0xb08760['opts'],_0xb08760[_0x1e2e('0x62')]]);if(_0x2f77b9[_0x1e2e('0xa6')]===-0x1){return _0x2f77b9;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format'](_0x1e2e('0x10a'),_0x1e2e('0xe4')));};AGIVertices['prototype'][_0x1e2e('0x10b')]=function(_0x628e9d){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x10c'),_0x628e9d['label']));return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x10b'));};AGIVertices['prototype'][_0x1e2e('0xe')]=function(_0x368f3d){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x368f3d['label']));if(_0x368f3d[_0x1e2e('0xa8')]===0x0){return this['maxRetry'](_0x368f3d);}_0x368f3d['retry']-=0x1;if(!this[_0x1e2e('0x84')](_0x368f3d['file_id'])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x368f3d,'no\x20file\x20audio\x20selected');}var _0x222fec=this[_0x1e2e('0x10d')][_0x1e2e('0x6f')](this,_0x368f3d[_0x1e2e('0x10e')]);if(!_0x222fec){return this['channel']['error'](_0x368f3d,'no\x20file\x20audio\x20found');}if(!this[_0x1e2e('0x84')](_0x368f3d[_0x1e2e('0xd9')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x1e2e('0x10f'));}var _0x2a7af1=this['channel'][_0x1e2e('0x110')](_0x222fec,_0x368f3d[_0x1e2e('0x111')],_0x368f3d[_0x1e2e('0x112')]);var _0x22955e=_0x2a7af1[_0x1e2e('0xa6')]?_0x2a7af1[_0x1e2e('0xa6')][_0x1e2e('0x48')]():'';logger[_0x1e2e('0x2e')]('test',JSON['stringify'](_0x2a7af1));if(_0x2a7af1['result']===-0x1){this[_0x1e2e('0x36')][_0x1e2e('0x6f')](this,_0x368f3d,_0x22955e);return _0x2a7af1;}else if(_0x2a7af1[_0x1e2e('0xa4')]==='timeout'){_0x2a7af1['result']=_0x22955e['length']>=parseInt(_0x368f3d[_0x1e2e('0x113')])?'x':'i';}else{_0x2a7af1[_0x1e2e('0xa6')]=_0x22955e[_0x1e2e('0x9d')]>=parseInt(_0x368f3d[_0x1e2e('0x113')])&&_0x22955e['length']<=parseInt(_0x368f3d['maxdigit'])?'x':'i';}var _0x4f7bc0=this[_0x1e2e('0x13')][_0x1e2e('0x6f')](this,_0x368f3d[_0x1e2e('0xd9')]);if(!_0x4f7bc0){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x368f3d,_0x1e2e('0xda'));}this['channel'][_0x1e2e('0xa1')](_0x4f7bc0,_0x22955e);if(this[_0x1e2e('0x84')](_0x368f3d[_0x1e2e('0x114')])){var _0x340eca=parseInt(_0x368f3d['hiddendigitsnum'],0xa);var _0x3e8b33=rs[_0x1e2e('0x115')]({'charset':'*','length':_0x340eca});var _0x48d5a6=_0x22955e[_0x1e2e('0x9d')];if(_0x48d5a6>0x0){if(_0x48d5a6>_0x340eca){this[_0x1e2e('0x36')]['sync'](this,_0x368f3d,_0x368f3d[_0x1e2e('0x116')]==='first'?_0x3e8b33+_0x22955e[_0x1e2e('0x117')](_0x340eca):_0x22955e[_0x1e2e('0x117')](0x0,_0x48d5a6-_0x340eca)+_0x3e8b33);}else{this['createSquareDetailsReport'][_0x1e2e('0x6f')](this,_0x368f3d,rs[_0x1e2e('0x115')]({'charset':'*','length':_0x48d5a6}));}}else{this[_0x1e2e('0x36')][_0x1e2e('0x6f')](this,_0x368f3d,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x368f3d,_0x22955e);}return _0x2a7af1;};AGIVertices[_0x1e2e('0x12')]['getsecretdigits']=function(_0x4de91d){logger['info'](util[_0x1e2e('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4de91d['label']));return this[_0x1e2e('0xe')](_0x4de91d);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x118')]=function(_0x9b21cc){logger[_0x1e2e('0x2e')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x9b21cc[_0x1e2e('0xb0')]));this['createSquareDetailsReport']['sync'](this,_0x9b21cc,_0x9b21cc[_0x1e2e('0x119')]);return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x11a'),_0x9b21cc[_0x1e2e('0x119')]));};AGIVertices[_0x1e2e('0x12')]['awspolly']=function(_0x2814d5){logger['info'](util[_0x1e2e('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2814d5[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x2814d5['aws_access_key_id'])||!this[_0x1e2e('0x84')](_0x2814d5[_0x1e2e('0x88')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x11b'));}if(!this[_0x1e2e('0x84')](_0x2814d5[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xab'));}this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('Trying\x20aws\x20Polly\x20%s',_0x2814d5[_0x1e2e('0x5a')]));var _0x1d4717=this[_0x1e2e('0x86')][_0x1e2e('0x6f')](this,_0x2814d5);if(_0x1d4717){this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('aws\x20Polly\x20%s\x20file\x20created',_0x1d4717));var _0xc22c69=this['channel'][_0x1e2e('0x100')](_0x1d4717);try{fs[_0x1e2e('0x11c')](_0x1d4717+_0x1e2e('0x101'));}catch(_0x5a2c76){logger[_0x1e2e('0x34')](_0x5a2c76);}return _0xc22c69;}return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x2814d5,_0x1e2e('0x11d'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x11e')]=function(_0x36f334){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x11f'),_0x36f334[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x36f334['aws_access_key_id'])||!this[_0x1e2e('0x84')](_0x36f334[_0x1e2e('0x88')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x11b'));}if(!this[_0x1e2e('0x84')](_0x36f334[_0x1e2e('0x8e')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x120'));}if(!this[_0x1e2e('0x84')](_0x36f334[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')]['noop'](_0x1e2e('0xab'));}this['channel'][_0x1e2e('0xe9')]=!![];this[_0x1e2e('0x36')](_0x36f334);this[_0x1e2e('0x3f')](_0x36f334[_0x1e2e('0x5a')],'in','','');this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x121'),_0x36f334[_0x1e2e('0x5a')]));var _0x4c0d1a=this[_0x1e2e('0x8c')][_0x1e2e('0x6f')](this,_0x36f334);if(_0x4c0d1a){for(var _0x539c96 in _0x4c0d1a){if(_0x4c0d1a['hasOwnProperty'](_0x539c96)&&_['isString'](_0x4c0d1a[_0x539c96])){this[_0x1e2e('0x10')]['setVariable'](util[_0x1e2e('0x2a')](_0x1e2e('0x122'),_0x539c96[_0x1e2e('0x68')]()),_0x4c0d1a[_0x539c96]);}}if(_[_0x1e2e('0x4c')](_0x4c0d1a[_0x1e2e('0x75')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0x123'));}else{this['createSquareMessage'](_0x4c0d1a[_0x1e2e('0x75')],_0x1e2e('0xec'),_0x1e2e('0x124'),'');return this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')]('Amazon\x20Lex\x20Result\x20%s',_0x4c0d1a[_0x1e2e('0x75')]));}}return this[_0x1e2e('0x10')]['error'](_0x36f334,_0x1e2e('0x125'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x126')]=function(_0x409945){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x409945['label'],_0x409945[_0x1e2e('0x65')]));if(!this[_0x1e2e('0x84')](_0x409945[_0x1e2e('0x7f')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0x127'));}var _0x696899=_0x1e2e('0x128');var _0x5c2b99=util[_0x1e2e('0x2a')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x48318f=util[_0x1e2e('0x2a')]('%s.%s',_0x5c2b99,_0x696899);var _0x473242=!![];if(_0x409945[_0x1e2e('0x129')]===_0x1e2e('0x12a')){_0x473242=![];}var _0x9add4=this[_0x1e2e('0x10')][_0x1e2e('0x12b')](_0x5c2b99,_0x696899,_0x409945[_0x1e2e('0x12c')],_0x409945[_0x1e2e('0x65')],undefined,_0x473242);if(_0x9add4[_0x1e2e('0xa6')]!==-0x1){this['channel']['noop'](util[_0x1e2e('0x2a')](_0x1e2e('0x12d'),_0x48318f));var _0x54ae1c=this['googleASR'][_0x1e2e('0x6f')](this,_0x409945,_0x48318f);if(_0x54ae1c){for(var _0x4304c9 in _0x54ae1c){if(_0x54ae1c[_0x1e2e('0x97')](_0x4304c9)){this['channel']['setVariable'](util[_0x1e2e('0x2a')]('GOOGLE_ASR_%s',_0x4304c9[_0x1e2e('0x68')]()),_0x54ae1c[_0x4304c9]);}}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x12e'),JSON[_0x1e2e('0x72')](_0x54ae1c)));}}return _0x9add4;};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x12f')]=function(_0x1643b2){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x130'),_0x1643b2[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x1643b2[_0x1e2e('0x92')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0x131'));}if(!this[_0x1e2e('0x84')](_0x1643b2[_0x1e2e('0x93')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0x132'));}var _0x1c42e5=_0x1e2e('0x128');var _0xfc2606=util[_0x1e2e('0x2a')](_0x1e2e('0x133'),FILES_PATH,rs[_0x1e2e('0x115')](0x4));var _0x315c44=util[_0x1e2e('0x2a')](_0x1e2e('0xa0'),_0xfc2606,_0x1c42e5);var _0x31f750=!![];if(_0x1643b2['beep']==='NOBEEP'){_0x31f750=![];}var _0x2c5cc1=this[_0x1e2e('0x10')][_0x1e2e('0x12b')](_0xfc2606,_0x1c42e5,_0x1643b2[_0x1e2e('0x12c')],_0x1643b2[_0x1e2e('0x65')],undefined,_0x31f750);if(_0x2c5cc1[_0x1e2e('0xa6')]!==-0x1){this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x134'),_0x315c44));var _0x30ba48=this[_0x1e2e('0x91')][_0x1e2e('0x6f')](this,_0x1643b2,_0x315c44);if(_0x30ba48){for(var _0x3a20ce in _0x30ba48){if(_0x30ba48[_0x1e2e('0x97')](_0x3a20ce)){this[_0x1e2e('0x10')]['setVariable'](util[_0x1e2e('0x2a')](_0x1e2e('0x135'),_0x3a20ce[_0x1e2e('0x68')]()),_0x30ba48[_0x3a20ce]);}}return this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x136'),JSON[_0x1e2e('0x72')](_0x30ba48)));}}return _0x2c5cc1;};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x137')]=function(_0x15b8a0){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x138'),_0x15b8a0['label']));return this[_0x1e2e('0x10')]['continueAt'](_0x15b8a0[_0x1e2e('0x139')],_0x15b8a0['extension'],_0x15b8a0[_0x1e2e('0x3c')]);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x13a')]=function(_0x259829){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0x13b'),_0x259829['label']));if(!this['isConfigured'](_0x259829[_0x1e2e('0x13c')])){return this['channel'][_0x1e2e('0x34')](_0x259829,_0x1e2e('0x13d'));}try{var _0x512d31=eval(_0x259829[_0x1e2e('0x13c')])?'true':_0x1e2e('0x13e');this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x13f'),_0x259829[_0x1e2e('0x13c')],_0x512d31));return{'code':0xc8,'result':_0x512d31};}catch(_0x551054){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x140')]=function(_0x191d1c){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x141'),_0x191d1c['label']));if(!this[_0x1e2e('0x84')](_0x191d1c[_0x1e2e('0x142')])){return this[_0x1e2e('0x10')]['error'](_0x191d1c,_0x1e2e('0x143'));}var _0xdc568a=this[_0x1e2e('0x144')][_0x1e2e('0x6f')](this,_0x191d1c[_0x1e2e('0x142')]);if(!_0xdc568a){return this[_0x1e2e('0x10')]['error'](_0x191d1c,_0x1e2e('0x145'));}for(var _0x5d09a6=0x0;_0x5d09a6<_0xdc568a[_0x1e2e('0x9d')];_0x5d09a6+=0x1){var _0x386713=this['channel'][_0x1e2e('0x13')](util['format']('IFTIME(%s?true:false)',_0xdc568a[_0x5d09a6]));if(_0x386713['result']===-0x1){return _0x386713;}logger['info'](util['format'](_0x1e2e('0x146'),_0xdc568a[_0x5d09a6],_0x386713[_0x1e2e('0xa4')]));if(_0x386713[_0x1e2e('0xa4')]===_0x1e2e('0x147')){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x146'),_0xdc568a[_0x5d09a6],_0x1e2e('0x147')));this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x146'),_0xdc568a[_0x5d09a6],_0x1e2e('0x147')));return{'code':0xc8,'result':_0x1e2e('0x147')};}else{logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x146'),_0xdc568a[_0x5d09a6],'false'));this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format']('IFTIME\x20%s\x20%s',_0xdc568a[_0x5d09a6],_0x1e2e('0x13e')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x148')]=function(_0x3297c0){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x149'),_0x3297c0[_0x1e2e('0xb0')]));return this[_0x1e2e('0x10')][_0x1e2e('0x148')]();};AGIVertices['prototype'][_0x1e2e('0x14a')]=function(_0x34bba2){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x14b'),_0x34bba2[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x34bba2['key'])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x127'));}var _0x27ecbd='wav';var _0x40de80=util[_0x1e2e('0x2a')](_0x1e2e('0x133'),FILES_PATH,rs[_0x1e2e('0x115')](0x4));var _0x20fa99=util['format'](_0x1e2e('0xa0'),_0x40de80,_0x27ecbd);var _0x4d8b5f=!![];if(_0x34bba2[_0x1e2e('0x129')]===_0x1e2e('0x12a')){_0x4d8b5f=![];}var _0x94e38c=this[_0x1e2e('0x10')][_0x1e2e('0x12b')](_0x40de80,_0x27ecbd,_0x34bba2[_0x1e2e('0x12c')],_0x34bba2[_0x1e2e('0x65')],undefined,_0x4d8b5f);if(_0x94e38c['result']!==-0x1){this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('ispeech\x20%s\x20file\x20created',_0x20fa99));var _0x16ff94=this[_0x1e2e('0x82')][_0x1e2e('0x6f')](this,_0x34bba2,_0x20fa99);if(_0x16ff94){for(var _0x3455d8 in _0x16ff94){if(_0x16ff94[_0x1e2e('0x97')](_0x3455d8)){this['channel'][_0x1e2e('0xa1')](util['format']('ISPEECH_ASR_%s',_0x3455d8['toUpperCase']()),_0x16ff94[_0x3455d8]);}}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('IspeechASR\x20Result\x20%s',JSON[_0x1e2e('0x72')](_0x16ff94)));}}return _0x94e38c;};AGIVertices[_0x1e2e('0x12')]['ispeechtts']=function(_0x1a315e){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x14c'),_0x1a315e[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x1a315e['key'])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x127'));}if(!this[_0x1e2e('0x84')](_0x1a315e[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')]['noop'](_0x1e2e('0xab'));}this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format'](_0x1e2e('0x14d'),_0x1a315e[_0x1e2e('0x5a')]));var _0x4b6e40=this[_0x1e2e('0x7e')][_0x1e2e('0x6f')](this,_0x1a315e);if(_0x4b6e40){this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('ispeech\x20%s\x20file\x20created',_0x4b6e40));var _0x2d1833=this[_0x1e2e('0x10')][_0x1e2e('0x100')](_0x4b6e40,_0x1a315e[_0x1e2e('0x12c')]);try{fs[_0x1e2e('0x11c')](_0x4b6e40+_0x1e2e('0x101'));}catch(_0x3aa0bf){logger[_0x1e2e('0x34')](_0x3aa0bf);}return _0x2d1833;}return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x1a315e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x14e')]=function(_0x1c13af){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x14f'),_0x1c13af[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x1c13af[_0x1e2e('0x150')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x1c13af,'no\x20find\x20by\x20configured');}logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x1e2e('0x4b')],_0x1c13af[_0x1e2e('0x150')]));var _0x3d48f2=this[_0x1e2e('0x151')][_0x1e2e('0x6f')](this,_0x1c13af[_0x1e2e('0x150')]);if(_0x3d48f2){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x152'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x1c13af['findBy']));this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x1c13af['findBy']));return{'code':0xc8,'result':_0x1e2e('0x153')};}else{logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0x154'),this['channel'][_0x1e2e('0x4b')],_0x1c13af[_0x1e2e('0x150')]));this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')](_0x1e2e('0x154'),this['channel']['callerid'],_0x1c13af[_0x1e2e('0x150')]));return{'code':0xc8,'result':_0x1e2e('0x155')};}};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x156')]=function(_0x36a2ff){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0x157'),_0x36a2ff[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x36a2ff[_0x1e2e('0x150')])){return this[_0x1e2e('0x10')]['error'](_0x36a2ff,_0x1e2e('0x158'));}logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x159'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x36a2ff['findBy']));var _0x1f4bd6=this[_0x1e2e('0x4f')][_0x1e2e('0x6f')](this,_0x36a2ff[_0x1e2e('0x150')]);if(_0x1f4bd6){logger['info'](util[_0x1e2e('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x36a2ff[_0x1e2e('0x150')]));this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x152'),this['channel'][_0x1e2e('0x4b')],_0x36a2ff[_0x1e2e('0x150')]));return{'code':0xc8,'result':_0x1e2e('0x153')};}else{logger['info'](util[_0x1e2e('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x36a2ff['findBy']));this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format'](_0x1e2e('0x154'),this['channel'][_0x1e2e('0x4b')],_0x36a2ff[_0x1e2e('0x150')]));return{'code':0xc8,'result':_0x1e2e('0x155')};}};AGIVertices[_0x1e2e('0x12')]['math']=function(_0x10a761){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x15a'),_0x10a761[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x10a761[_0x1e2e('0x15b')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x10a761,_0x1e2e('0x15c'));}this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x15d'),_0x10a761[_0x1e2e('0x15b')]));var _0x1de815=eval(_0x10a761[_0x1e2e('0x15b')]);if(!this['isConfigured'](_0x10a761[_0x1e2e('0xd9')])){return this[_0x1e2e('0x10')]['noop'](_0x1e2e('0x10f'));}var _0x14fb14=this[_0x1e2e('0x13')][_0x1e2e('0x6f')](this,_0x10a761['variable_id']);if(!_0x14fb14){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x10a761,'no\x20variable\x20found');}if(_[_0x1e2e('0x9c')](_0x1de815)){var _0x129421=this;_0x1de815[_0x1e2e('0xdc')](function(_0x348e3b,_0x334636){_0x129421['channel']['setVariable'](util['format']('%s[%s]',_0x14fb14,_0x334636),_0x348e3b);});return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x15e'),_0x14fb14));}else{return this[_0x1e2e('0x10')]['setVariable'](_0x14fb14,_0x1de815);}};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xd')]=function(_0x39e8aa){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0x15f'),_0x39e8aa[_0x1e2e('0xb0')]));if(_0x39e8aa[_0x1e2e('0xa8')]===0x0){return this[_0x1e2e('0x160')](_0x39e8aa);}_0x39e8aa['retry']-=0x1;if(!this['isConfigured'](_0x39e8aa[_0x1e2e('0x10e')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x39e8aa,_0x1e2e('0x161'));}var _0x32d5f9=this[_0x1e2e('0x10d')]['sync'](this,_0x39e8aa[_0x1e2e('0x10e')]);if(!_0x32d5f9){return this['channel'][_0x1e2e('0x34')](_0x39e8aa,'no\x20file\x20audio\x20found');}var _0x20fd2f=this[_0x1e2e('0x10')]['getData'](_0x32d5f9,_0x39e8aa['response'],_0x39e8aa[_0x1e2e('0x162')]);var _0x5dd145=_0x20fd2f[_0x1e2e('0xa6')];if(_0x20fd2f[_0x1e2e('0xa6')]===-0x1){this[_0x1e2e('0x36')]['sync'](this,_0x39e8aa,'-1');return _0x20fd2f;}else if(_0x20fd2f[_0x1e2e('0xa4')]===_0x1e2e('0x65')){_0x20fd2f['result']=_0x20fd2f[_0x1e2e('0xa6')][_0x1e2e('0x9d')]>0x0?_0x20fd2f['result']:'t';}else if(_['isEmpty'](_0x20fd2f['result'])){_0x20fd2f[_0x1e2e('0xa6')]='#';_0x5dd145='#';}if(!this[_0x1e2e('0x84')](_0x39e8aa[_0x1e2e('0xd9')])){this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x10f'));}else{var _0x3640d9=this[_0x1e2e('0x13')]['sync'](this,_0x39e8aa[_0x1e2e('0xd9')]);if(!_0x3640d9){return this[_0x1e2e('0x10')]['error'](_0x39e8aa,_0x1e2e('0xda'));}this[_0x1e2e('0x10')][_0x1e2e('0xa1')](_0x3640d9,_0x5dd145);}this['createSquareDetailsReport'][_0x1e2e('0x6f')](this,_0x39e8aa,_0x5dd145);return _0x20fd2f;};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0xaa')]=function(_0x35ba08){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x163'),_0x35ba08[_0x1e2e('0xb0')]));return this['channel'][_0x1e2e('0xaa')](_0x35ba08['output']||_0x35ba08['label']);};AGIVertices['prototype'][_0x1e2e('0x164')]=function(_0x2678bf){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x165'),_0x2678bf[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x2678bf[_0x1e2e('0x150')])){return this['channel'][_0x1e2e('0x34')](_0x2678bf,_0x1e2e('0x158'));}logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0x159'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x2678bf[_0x1e2e('0x150')]));var _0x44cdbd=this[_0x1e2e('0x49')][_0x1e2e('0x6f')](this,_0x2678bf['pause_id']);var _0x215d77=this[_0x1e2e('0x4a')][_0x1e2e('0x6f')](this,_0x2678bf[_0x1e2e('0x150')],_0x44cdbd);if(_0x215d77){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x152'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x2678bf[_0x1e2e('0x150')]));this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1e2e('0x4b')],_0x2678bf[_0x1e2e('0x150')]));return{'code':0xc8,'result':_0x1e2e('0x153')};}else{logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1e2e('0x10')]['callerid'],_0x2678bf[_0x1e2e('0x150')]));this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x152'),this['channel']['callerid'],_0x2678bf[_0x1e2e('0x150')]));return{'code':0xc8,'result':_0x1e2e('0x155')};}};AGIVertices['prototype'][_0x1e2e('0x166')]=function(_0x4b5f5c){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x167'),_0x4b5f5c[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x4b5f5c['file_id'])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x4b5f5c,_0x1e2e('0x161'));}var _0x203b3f=this['getSound']['sync'](this,_0x4b5f5c['file_id']);if(!_0x203b3f){return this['channel'][_0x1e2e('0x34')](_0x4b5f5c,_0x1e2e('0x168'));}var _0x125952=this['channel'][_0x1e2e('0x54')](_0x1e2e('0x169'),[_0x203b3f,_0x4b5f5c[_0x1e2e('0xe6')]]);if(_0x125952['result']===-0x1){return _0x125952;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xc8'),'PLAYBACK',_0x203b3f));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x16a')]=function(_0x33496c){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x16b'),_0x33496c[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x33496c['queue_id'])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x33496c,_0x1e2e('0x16c'));}var _0x1a9639='';var _0x28d405=parseInt(_0x33496c[_0x1e2e('0x16d')],0xa);if(isNaN(_0x28d405)){_0x1a9639=_0x33496c[_0x1e2e('0x16d')];}else{_0x1a9639=this[_0x1e2e('0x16e')][_0x1e2e('0x6f')](this,_0x33496c[_0x1e2e('0x16d')]);if(!_0x1a9639){return this['channel'][_0x1e2e('0x34')](_0x33496c,_0x1e2e('0x16f'));}}var _0x1decae='';if(this[_0x1e2e('0x84')](_0x33496c[_0x1e2e('0x10e')])){var _0x21755d=this['getSound'][_0x1e2e('0x6f')](this,_0x33496c[_0x1e2e('0x10e')]);if(_0x21755d){_0x1decae=_0x21755d;}}this[_0x1e2e('0x36')][_0x1e2e('0x6f')](this,_0x33496c,_0x1a9639);if(_0x33496c[_0x1e2e('0xe6')][_0x1e2e('0x170')]('x')<0x0){_0x33496c[_0x1e2e('0xe6')]+='x';}if(_0x33496c['opts'][_0x1e2e('0x170')]('X')<0x0){_0x33496c[_0x1e2e('0xe6')]+='X';}this[_0x1e2e('0x10')]['setVariable'](_0x1e2e('0x171'),_0x1a9639?_0x1a9639[_0x1e2e('0x172')]():'');var _0x4e178e=this[_0x1e2e('0x10')][_0x1e2e('0x54')]('QUEUE',[_0x1a9639,_0x33496c[_0x1e2e('0xe6')],_0x33496c[_0x1e2e('0x62')],_0x1decae,_0x33496c[_0x1e2e('0x65')],_0x33496c['agi'],_0x33496c['macro'],_0x33496c[_0x1e2e('0x173')],'',_0x33496c[_0x1e2e('0x174')]]);if(_0x4e178e[_0x1e2e('0xa6')]===-0x1){return _0x4e178e;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xc8'),_0x1e2e('0x175'),_0x1a9639));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x176')]=function(_0x311b3f){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x177'),_0x311b3f[_0x1e2e('0xb0')]));var _0x2ff8e9=_0x311b3f[_0x1e2e('0x178')]||_0x1e2e('0x128');var _0x130cc1=util[_0x1e2e('0x2a')](_0x1e2e('0x179'),this[_0x1e2e('0x10')]['uniqueid'],rs['generate'](0x5));var _0x3c5960=util[_0x1e2e('0x2a')](_0x1e2e('0x17a'),FILES_PATH,_0x130cc1,_0x2ff8e9);var _0x37b47d=util[_0x1e2e('0x2a')](_0x1e2e('0x133'),FILES_PATH,_0x130cc1);this[_0x1e2e('0x3a')][_0x1e2e('0x6f')](this,_0x311b3f,_0x130cc1,_0x3c5960);this['channel']['setVariable'](_0x1e2e('0x17b'),_0x130cc1);logger[_0x1e2e('0x2e')](_0x1e2e('0x17c'),_0x37b47d,_0x2ff8e9,_0x311b3f['escape_digits'],_0x311b3f[_0x1e2e('0x65')]);return this[_0x1e2e('0x10')][_0x1e2e('0x12b')](_0x37b47d,_0x2ff8e9,_0x311b3f[_0x1e2e('0x17d')],_0x311b3f[_0x1e2e('0x65')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x25e5a2){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x17e'),_0x25e5a2[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x25e5a2[_0x1e2e('0x62')])){return this[_0x1e2e('0x10')]['noop'](_0x1e2e('0x17f'));}var _0x555cf1=this[_0x1e2e('0x61')][_0x1e2e('0x6f')](this,_0x25e5a2);logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x180'),util[_0x1e2e('0x181')](_0x555cf1,{'showHidden':![],'depth':null})));if(!this[_0x1e2e('0x84')](_0x25e5a2[_0x1e2e('0xd9')])){return this[_0x1e2e('0x10')]['noop'](_0x1e2e('0x182'));}var _0x3cd33a=this[_0x1e2e('0x13')][_0x1e2e('0x6f')](this,_0x25e5a2['variable_id']);if(!_0x3cd33a){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x25e5a2,_0x1e2e('0xda'));}this[_0x1e2e('0x10')]['setVariable'](util['format'](_0x1e2e('0x183'),_0x3cd33a),_0x555cf1[_0x1e2e('0x74')]?_0x555cf1['statusCode']:_0x1e2e('0x184'));this['channel'][_0x1e2e('0xa1')](util[_0x1e2e('0x2a')](_0x1e2e('0x185'),_0x3cd33a),_0x555cf1['statusMessage']?_0x555cf1[_0x1e2e('0x186')]:'OK');if(_0x555cf1[_0x1e2e('0x69')]){try{this[_0x1e2e('0x9e')](_0x555cf1[_0x1e2e('0x69')],_0x3cd33a);}catch(_0x3ad5b4){logger['error'](util[_0x1e2e('0x2a')](_0x1e2e('0x187'),_0x3cd33a));}}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xdf'),_0x3cd33a));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x188')]=function(_0x1b5d19){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x189'),_0x1b5d19[_0x1e2e('0xb0')]));return this[_0x1e2e('0x10')]['sayDigits'](_0x1b5d19['digits']['replace'](/\s+/g,''),_0x1b5d19[_0x1e2e('0x17d')]);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x18a')]=function(_0x318ae6){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x18b'),_0x318ae6[_0x1e2e('0xb0')]));return this[_0x1e2e('0x10')][_0x1e2e('0x18c')](_0x318ae6['number'][_0x1e2e('0x56')](/\s+/g,''),_0x318ae6[_0x1e2e('0x17d')]);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x18d')]=function(_0x144a9a){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x144a9a[_0x1e2e('0xb0')]));return this[_0x1e2e('0x10')][_0x1e2e('0x18e')](_0x144a9a['text'],_0x144a9a[_0x1e2e('0x17d')]);};AGIVertices[_0x1e2e('0x12')]['sendMail']=function(_0x18fc38){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x18f'),_0x18fc38[_0x1e2e('0xb0')]));if(!this['isConfigured'](_0x18fc38[_0x1e2e('0x190')])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0x191'));}var _0x358846=this[_0x1e2e('0x23')][_0x1e2e('0x6f')](this,_0x18fc38[_0x1e2e('0x190')]);if(!_0x358846||!_0x358846['Smtp']){return this[_0x1e2e('0x10')]['error'](_0x18fc38,_0x1e2e('0x192'));}var _0x51a069={'from':util[_0x1e2e('0x2a')]('\x22%s\x22\x20<%s>',_0x358846[_0x1e2e('0x16')],_0x358846[_0x1e2e('0x193')]||_0x358846[_0x1e2e('0x194')][_0x1e2e('0x195')]),'to':_0x18fc38['to']||'','cc':_0x18fc38['cc']||'','bcc':_0x18fc38[_0x1e2e('0x196')]||'','subject':_0x18fc38[_0x1e2e('0x197')],'html':_0x18fc38[_0x1e2e('0x5a')],'text':_0x18fc38[_0x1e2e('0x5a')]};var _0x586e14={'tls':{'rejectUnauthorized':![]}};if(_0x358846[_0x1e2e('0x194')]['service']){_0x586e14[_0x1e2e('0x198')]=_0x358846['Smtp'][_0x1e2e('0x198')];}else{_0x586e14[_0x1e2e('0x199')]=_0x358846[_0x1e2e('0x194')][_0x1e2e('0x199')];_0x586e14[_0x1e2e('0x19a')]=_0x358846['Smtp'][_0x1e2e('0x19a')];_0x586e14[_0x1e2e('0x19b')]=_0x358846[_0x1e2e('0x194')][_0x1e2e('0x19b')];}if(_0x358846[_0x1e2e('0x194')][_0x1e2e('0x19c')]){_0x586e14[_0x1e2e('0x19d')]={'user':_0x358846[_0x1e2e('0x194')]['user'],'pass':_0x358846[_0x1e2e('0x194')]['pass']};}if(this['isConfigured'](_0x18fc38[_0x1e2e('0x19e')])){}logger[_0x1e2e('0xe1')](_0x1e2e('0x19f'),JSON[_0x1e2e('0x72')](_0x51a069));this[_0x1e2e('0x36')][_0x1e2e('0x6f')](this,_0x18fc38,_0x18fc38[_0x1e2e('0x190')]);this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x1a0'),_0x358846[_0x1e2e('0x16')]));this['sendMailMessage'][_0x1e2e('0x6f')](this,_0x586e14,_0x51a069);return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x1a1'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1a2')]=function(_0x5b3c79){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x1a3'),_0x5b3c79['label']));return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x1a4'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1a5')]=function(_0x2709c7){logger[_0x1e2e('0x2e')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2709c7[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x2709c7[_0x1e2e('0x1a6')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')]('no\x20sms\x20account\x20configured');}var _0x227e8a=this['getSmsAccount'][_0x1e2e('0x6f')](this,_0x2709c7[_0x1e2e('0x1a6')]);if(!_0x227e8a){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x2709c7,'no\x20sms\x20account\x20found');}var _0xc20394={'body':_0x2709c7[_0x1e2e('0x1a7')],'phone':_0x2709c7['to']||'','SmsAccountId':_0x227e8a['id']};logger[_0x1e2e('0xe1')](_0x1e2e('0x1a8'),JSON['stringify'](_0xc20394));this[_0x1e2e('0x36')][_0x1e2e('0x6f')](this,_0x2709c7,_0x2709c7[_0x1e2e('0x1a6')]);this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x1a9'),_0x227e8a[_0x1e2e('0x16')]));this[_0x1e2e('0x35')][_0x1e2e('0x6f')](this,_0xc20394);return this[_0x1e2e('0x10')][_0x1e2e('0xaa')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1e2e('0x12')]['set']=function(_0x1683d6){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x1683d6[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x1683d6[_0x1e2e('0xd9')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x1683d6,_0x1e2e('0x1aa'));}var _0x1563a4=this['getVariable']['sync'](this,_0x1683d6[_0x1e2e('0xd9')]);if(!_0x1563a4){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x1683d6,_0x1e2e('0xda'));}return this[_0x1e2e('0x10')][_0x1e2e('0xa1')](_0x1563a4,_0x1683d6[_0x1e2e('0x1ab')]);};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1ac')]=function(_0x16b79d){logger[_0x1e2e('0x2e')](util['format'](_0x1e2e('0x1ad'),_0x16b79d['label']));this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0x1ae'));if(_0x16b79d[_0x1e2e('0xbb')]===_0x1e2e('0x1af')){this['channel']['noop']('Answer');return this[_0x1e2e('0x10')][_0x1e2e('0xbb')]();}return this['channel']['noop'](_0x1e2e('0x1b0'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1b1')]=function(_0x57903f){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x1b2'),_0x57903f[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x57903f[_0x1e2e('0x1b3')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x57903f,'no\x20subproject\x20selected');}var _0x331ea3=this[_0x1e2e('0x19')][_0x1e2e('0x6f')](this,_0x57903f['project_id']);if(!this[_0x1e2e('0x84')](_0x331ea3)){return this['channel'][_0x1e2e('0x34')](_0x57903f,util[_0x1e2e('0x2a')](_0x1e2e('0x1b4'),_0x57903f[_0x1e2e('0x1b3')]));}if(_0x331ea3===this[_0x1e2e('0x10')][_0x1e2e('0x39')]){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x57903f,_0x1e2e('0x1b5'));}this['createSquareDetailsReport'][_0x1e2e('0x6f')](this,_0x57903f,_0x331ea3);var _0x2df82b=this[_0x1e2e('0x10')][_0x1e2e('0x54')]('AGI',util[_0x1e2e('0x2a')](_0x1e2e('0x1b6'),config[_0x1e2e('0x8')][_0x1e2e('0x199')]||_0x1e2e('0x1b7'),_0x331ea3,this[_0x1e2e('0x10')][_0x1e2e('0x39')]));if(_0x2df82b[_0x1e2e('0xa6')]===-0x1){return _0x2df82b;}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0xc8'),_0x1e2e('0x1b8'),_0x331ea3));};AGIVertices['prototype']['system']=function(_0x5e89c8){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x1b9'),_0x5e89c8['label']));var _0x51d11=this['shellCommand']['sync'](this,_0x5e89c8[_0x1e2e('0xba')]);this[_0x1e2e('0x36')][_0x1e2e('0x6f')](this,_0x5e89c8,_0x5e89c8[_0x1e2e('0xba')]);if(this['isConfigured'](_0x5e89c8[_0x1e2e('0xd9')])){var _0x5e4387=this[_0x1e2e('0x13')]['sync'](this,_0x5e89c8[_0x1e2e('0xd9')]);if(_0x5e4387){this[_0x1e2e('0x10')]['setVariable'](_0x5e4387,_0x51d11);return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x1ba'),_0x5e89c8[_0x1e2e('0xba')],_0x5e4387));}}return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util['format'](_0x1e2e('0x1bb'),_0x5e89c8[_0x1e2e('0xba')]));};AGIVertices['prototype'][_0x1e2e('0x1bc')]=function(_0xecd04c){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x1bd'),_0xecd04c['label']));_0xecd04c[_0x1e2e('0x5a')]=_0xecd04c[_0x1e2e('0x5a')][_0x1e2e('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1e2e('0x84')](_0xecd04c[_0x1e2e('0x58')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')]('no\x20apiKey\x20configured');}if(!this[_0x1e2e('0x84')](_0xecd04c[_0x1e2e('0x5a')])){return this[_0x1e2e('0x10')][_0x1e2e('0xaa')](_0x1e2e('0xab'));}this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0xecd04c['text']));var _0x530a3=this[_0x1e2e('0x57')]['sync'](this,_0xecd04c);if(_0x530a3){this['channel'][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x1be'),_0x530a3));var _0x5e6eea=this[_0x1e2e('0x10')][_0x1e2e('0x100')](_0x530a3);try{fs['unlink'](_0x530a3+_0x1e2e('0x101'));}catch(_0x4035b1){logger[_0x1e2e('0x34')](_0x4035b1);}return _0x5e6eea;}return this['channel'][_0x1e2e('0x34')](_0xecd04c,_0x1e2e('0x1bf'));};AGIVertices['prototype'][_0x1e2e('0x1c0')]=function(_0x590780){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x1c1'),_0x590780[_0x1e2e('0xb0')]));_0x590780[_0x1e2e('0x5a')]=_0x590780[_0x1e2e('0x5a')][_0x1e2e('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1e2e('0x84')](_0x590780['text'])){return this['channel'][_0x1e2e('0xaa')](_0x1e2e('0xab'));}this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x1c2'),_0x590780[_0x1e2e('0x5a')]));var _0x3241a8=this[_0x1e2e('0x60')]['sync'](this,_0x590780);if(_0x3241a8){this[_0x1e2e('0x10')][_0x1e2e('0xaa')](util[_0x1e2e('0x2a')](_0x1e2e('0x1c3'),_0x3241a8));var _0x31277c=this[_0x1e2e('0x10')][_0x1e2e('0x100')](_0x3241a8);try{fs[_0x1e2e('0x11c')](_0x3241a8+_0x1e2e('0x101'));}catch(_0x55231c){logger[_0x1e2e('0x34')](_0x55231c);}return _0x31277c;}return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x590780,_0x1e2e('0x1c4'));};AGIVertices[_0x1e2e('0x12')][_0x1e2e('0x1c5')]=function(_0x2a111c){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2a111c[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x2a111c[_0x1e2e('0x150')])){return this[_0x1e2e('0x10')]['error'](_0x2a111c,'no\x20find\x20by\x20configured');}logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x159'),this['channel'][_0x1e2e('0x4b')],_0x2a111c['findBy']));var _0x32a1f1=this[_0x1e2e('0x4d')][_0x1e2e('0x6f')](this,_0x2a111c[_0x1e2e('0x150')]);if(_0x32a1f1){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x152'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x2a111c[_0x1e2e('0x150')]));this[_0x1e2e('0x10')]['noop'](util[_0x1e2e('0x2a')](_0x1e2e('0x152'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x2a111c['findBy']));return{'code':0xc8,'result':_0x1e2e('0x153')};}else{logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')](_0x1e2e('0x154'),this['channel'][_0x1e2e('0x4b')],_0x2a111c[_0x1e2e('0x150')]));this['channel'][_0x1e2e('0xaa')](util['format'](_0x1e2e('0x154'),this[_0x1e2e('0x10')][_0x1e2e('0x4b')],_0x2a111c[_0x1e2e('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x1e2e('0x1c6')]=function(_0x4744f0){logger['info'](util[_0x1e2e('0x2a')](_0x1e2e('0x1c7'),_0x4744f0[_0x1e2e('0xb0')]));var _0x1e7873=this['channel'][_0x1e2e('0x54')](_0x1e2e('0x1c8'),[_0x4744f0[_0x1e2e('0x1c9')],_0x4744f0[_0x1e2e('0x76')]]);if(_0x1e7873[_0x1e2e('0xa6')]===-0x1){return _0x1e7873;}return this['channel'][_0x1e2e('0xaa')](util['format'](_0x1e2e('0xc8'),_0x1e2e('0x1c8'),_0x4744f0[_0x1e2e('0x1c9')]));};AGIVertices['prototype'][_0x1e2e('0x1ca')]=function(_0x358d38){logger[_0x1e2e('0x2e')](util[_0x1e2e('0x2a')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x358d38[_0x1e2e('0xb0')]));if(!this[_0x1e2e('0x84')](_0x358d38[_0x1e2e('0xd9')])){return this[_0x1e2e('0x10')][_0x1e2e('0x34')](_0x358d38,'no\x20variable\x20selected');}var _0x5888b3=this[_0x1e2e('0x13')]['sync'](this,_0x358d38['variable_id']);if(!_0x5888b3){return this['channel']['error'](_0x358d38,_0x1e2e('0xda'));}var _0x163d33=this[_0x1e2e('0x10')][_0x1e2e('0x13')](_0x5888b3);return{'code':0xc8,'result':_0x163d33[_0x1e2e('0xa4')]?_0x163d33[_0x1e2e('0xa4')]:'-'};};String[_0x1e2e('0x12')][_0x1e2e('0xa3')]=function(_0x3c296d,_0x5ed3a7){return this[_0x1e2e('0xa2')](_0x3c296d)[_0x1e2e('0x1cb')](_0x5ed3a7);};module['exports']=AGIVertices; \ No newline at end of file +var _0x32d3=['Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','getQueryOdbc','variable_id','no\x20variable\x20found','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_access_key_id','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','gotoc','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','agentPause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','number','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','googleCloudTTS','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','randomstring','moment','mustache','request-promise','agi','./scripts','/var/opt/motion2/server/files','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','interval','map','Intervals','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agent','callerid','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','PUT','toUpperCase','rawBody','parse','headers','rawHeaders','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeechASR','awsPolly','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','includes','clone','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','hasOwnProperty','%s.%s','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x32d3,0xee));var _0x332d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x32d3[_0x397e5f];return _0x5302b8;};'use strict';var fs=require('fs');var path=require(_0x332d('0x0'));var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x332d('0x1'));var moment=require(_0x332d('0x2'));var Mustache=require(_0x332d('0x3'));var rp=require(_0x332d('0x4'));var logger=require('../../config/logger')(_0x332d('0x5'));var config=require('../../config/environment');var scripts=require(_0x332d('0x6'));var FILES_PATH=_0x332d('0x7');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x332d('0x8'),_0x332d('0x9'),'getsecretdigits'];var AGIVertices=function(_0x2bb132,_0x5f2dc1,_0xda0a05){this[_0x332d('0xa')]=_0x2bb132;this[_0x332d('0xb')]=_0x5f2dc1;this[_0x332d('0xc')]=_0xda0a05;};AGIVertices[_0x332d('0xd')][_0x332d('0xe')]=function(_0x55c8d2,_0x47c295){this[_0x332d('0xb')][_0x332d('0xf')](_0x55c8d2)[_0x332d('0x10')](function(_0x1dcdfc){_0x47c295(null,_0x1dcdfc?_0x1dcdfc[_0x332d('0x11')]:![]);})[_0x332d('0x12')](function(_0x295245){_0x47c295(_0x295245);});};AGIVertices['prototype'][_0x332d('0x13')]=function(_0x22acf3,_0x3db576){this['rpc'][_0x332d('0x14')](_0x22acf3)[_0x332d('0x10')](function(_0x3ea9fd){_0x3db576(null,_0x3ea9fd?_0x3ea9fd[_0x332d('0x11')]:![]);})[_0x332d('0x12')](function(_0x2896a9){_0x3db576(_0x2896a9);});};AGIVertices['prototype'][_0x332d('0x15')]=function(_0x4ba0bb,_0x5645b2){this[_0x332d('0xb')][_0x332d('0x16')](_0x4ba0bb)[_0x332d('0x10')](function(_0xc63cba){_0x5645b2(null,_0xc63cba?_0xc63cba[_0x332d('0x11')]:![]);})[_0x332d('0x12')](function(_0x38319d){_0x5645b2(_0x38319d);});};AGIVertices[_0x332d('0xd')]['getSquareOdbc']=function(_0x5bd6f3,_0x1cf11a){this[_0x332d('0xb')]['getSquareOdbcById'](_0x5bd6f3)[_0x332d('0x10')](function(_0x46b208){_0x1cf11a(null,_0x46b208?_0x46b208[_0x332d('0x17')]:![]);})[_0x332d('0x12')](function(_0x1c589d){_0x1cf11a(_0x1c589d);});};AGIVertices['prototype']['getUser']=function(_0x56aee9,_0x14fa2f){this[_0x332d('0xb')][_0x332d('0x18')](_0x56aee9)[_0x332d('0x10')](function(_0x3f421e){_0x14fa2f(null,_0x3f421e?_0x3f421e[_0x332d('0x11')]:![]);})[_0x332d('0x12')](function(_0x3b32f0){_0x14fa2f(_0x3b32f0);});};AGIVertices[_0x332d('0xd')][_0x332d('0x19')]=function(_0x5263d4,_0x176d00){this[_0x332d('0xb')][_0x332d('0x1a')](_0x5263d4)[_0x332d('0x10')](function(_0x12404a){_0x176d00(null,_0x12404a?_0x12404a[_0x332d('0x11')]:![]);})[_0x332d('0x12')](function(_0x35d424){_0x176d00(_0x35d424);});};AGIVertices[_0x332d('0xd')][_0x332d('0x1b')]=function(_0x1a3163,_0x599e4f){var _0x47ccc9=this;this[_0x332d('0xb')][_0x332d('0x1c')](_0x1a3163)[_0x332d('0x10')](function(_0x5827a6){_0x599e4f(null,_0x5827a6?_0x47ccc9[_0x332d('0x1d')](_0x5827a6[_0x332d('0x1e')]):![]);})[_0x332d('0x12')](function(_0x14ffbe){_0x599e4f(_0x14ffbe);});};AGIVertices[_0x332d('0xd')]['getMailAccount']=function(_0x4367f1,_0xcdd271){this[_0x332d('0xb')][_0x332d('0x1f')](_0x4367f1)[_0x332d('0x10')](function(_0x47efa1){_0xcdd271(null,_0x47efa1?_0x47efa1:![]);})[_0x332d('0x12')](function(_0x47cd98){_0xcdd271(_0x47cd98);});};AGIVertices[_0x332d('0xd')][_0x332d('0x20')]=function(_0x457a80,_0x2ae917,_0x2296fa){this[_0x332d('0xc')][_0x332d('0x20')](_0x457a80,_0x2ae917)['then'](function(){_0x2296fa(null);})[_0x332d('0x12')](function(_0x107f35){_0x2296fa(_0x107f35);});};AGIVertices['prototype']['getIntervals']=function(_0xce9c99,_0x4c5d1f){this['rpc'][_0x332d('0x21')](_0xce9c99)[_0x332d('0x10')](function(_0x36eb85){if(_0x36eb85){if(_0x36eb85['IntervalId']){_0x4c5d1f(null,[_0x36eb85[_0x332d('0x22')]]);}else{_0x4c5d1f(null,_[_0x332d('0x23')](_0x36eb85[_0x332d('0x24')],_0x332d('0x22')));}}else{_0x4c5d1f(null,![]);}})['catch'](function(_0x3c1aee){_0x4c5d1f(_0x3c1aee);});};AGIVertices[_0x332d('0xd')][_0x332d('0x1d')]=function(_0x41679){return util[_0x332d('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x41679);};AGIVertices[_0x332d('0xd')]['getQueryOdbc']=function(_0x2f6648,_0x23ab2f,_0x1468e7){odbc[_0x332d('0x26')](_0x2f6648,function(_0x5f14a8){if(_0x5f14a8){logger[_0x332d('0x27')](_0x332d('0x28'),_0x5f14a8);_0x1468e7(_0x5f14a8);}else{logger[_0x332d('0x29')](_0x332d('0x2a'));odbc[_0x332d('0x2b')](_0x23ab2f,function(_0x37a8c2,_0x181a2a){if(_0x37a8c2){logger['info'](_0x332d('0x2c'),_0x23ab2f);_0x1468e7(_0x37a8c2);}else{logger[_0x332d('0x29')](_0x332d('0x2d'),_0x23ab2f);odbc['close'](function(_0x2d5ddd){if(_0x2d5ddd){logger['error'](_0x332d('0x2e'),_0x2d5ddd);}_0x1468e7(null,_0x181a2a);});}});}});};AGIVertices[_0x332d('0xd')][_0x332d('0x2f')]=function(_0x42247e,_0xb8859c){this[_0x332d('0xb')]['getSmsAccountById'](_0x42247e)[_0x332d('0x10')](function(_0x10677e){_0xb8859c(null,_0x10677e?_0x10677e:![]);})[_0x332d('0x12')](function(_0x36ad78){_0xb8859c(_0x36ad78);});};AGIVertices[_0x332d('0xd')][_0x332d('0x30')]=function(_0x1c17e5,_0xf754fb){this['rpc'][_0x332d('0x30')](_0x1c17e5)[_0x332d('0x10')](function(_0x470c60){_0xf754fb(null,_0x470c60);})[_0x332d('0x12')](function(_0x22c46c){_0xf754fb(_0x22c46c);});};AGIVertices['prototype'][_0x332d('0x31')]=function(_0x4074e9,_0x325cdb,_0x33a1fd){this['rpc'][_0x332d('0x31')]({'uniqueid':this[_0x332d('0xa')][_0x332d('0x32')],'node':_0x4074e9[_0x332d('0x33')],'application':_0x4074e9[_0x332d('0x34')],'data':_0x325cdb||null,'project_name':this['channel'][_0x332d('0x35')],'callerid':this[_0x332d('0xa')]['callerid']})[_0x332d('0x10')](function(_0x25954a){if(_0x33a1fd){_0x33a1fd(null,_0x25954a);}})[_0x332d('0x12')](function(_0x222474){if(_0x33a1fd){_0x33a1fd(_0x222474);}});};AGIVertices[_0x332d('0xd')][_0x332d('0x36')]=function(_0x10cb23,_0x3102e1,_0x3c46ba,_0x32a9ea){this[_0x332d('0xb')][_0x332d('0x36')]({'uniqueid':this[_0x332d('0xa')][_0x332d('0x32')],'callerid':this[_0x332d('0xa')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0x332d('0xa')]['context'],'extension':this[_0x332d('0xa')][_0x332d('0x37')],'priority':this['channel']['priority'],'accountcode':this[_0x332d('0xa')][_0x332d('0x38')],'dnid':this[_0x332d('0xa')][_0x332d('0x39')],'projectName':this[_0x332d('0xa')][_0x332d('0x35')],'saveName':_0x3102e1,'filename':_0x10cb23[_0x332d('0x3a')]||_0x3102e1,'savePath':_0x3c46ba})[_0x332d('0x10')](function(_0x26f69c){_0x32a9ea(null,_0x26f69c);})['catch'](function(_0x2d94d5){_0x32a9ea(_0x2d94d5);});};AGIVertices[_0x332d('0xd')][_0x332d('0x3b')]=function(_0x350cb0,_0x5e47e7,_0x26f2f7,_0x37ac6b,_0x1b0cbc){this[_0x332d('0xb')][_0x332d('0x3b')]({'uniqueid':this['channel']['uniqueid'],'body':_0x350cb0,'direction':_0x5e47e7,'providerName':_0x26f2f7,'providerResponse':_0x37ac6b})[_0x332d('0x10')](function(_0x3384d4){if(_0x1b0cbc){_0x1b0cbc(null,_0x3384d4);}})[_0x332d('0x12')](function(_0x53e7ec){if(_0x1b0cbc){_0x1b0cbc(_0x53e7ec);}});};AGIVertices['prototype'][_0x332d('0x3c')]=function(_0x269d0c,_0x575d47){this[_0x332d('0xb')][_0x332d('0x3c')]({'firstName':_[_0x332d('0x3d')](_0x269d0c[_0x332d('0x11')])||_[_0x332d('0x3e')](_0x269d0c['name'])?_0x332d('0x3f')+Math['random']():_0x269d0c['name'],'lastName':_[_0x332d('0x3d')](_0x269d0c[_0x332d('0x40')])||_[_0x332d('0x3e')](_0x269d0c[_0x332d('0x40')])?null:_0x269d0c['lastName'],'phone':_0x269d0c[_0x332d('0x41')],'ListId':_0x269d0c[_0x332d('0x42')],'scheduledat':_0x269d0c[_0x332d('0x43')],'callbackUniqueid':this[_0x332d('0xa')]['uniqueid'],'tags':_0x332d('0x44'),'description':'Callback\x20scheduled\x20at\x20'+_0x269d0c[_0x332d('0x43')][_0x332d('0x45')](),'priority':_0x269d0c[_0x332d('0x46')]})[_0x332d('0x10')](function(_0x521aba){_0x575d47(null,_0x521aba);})[_0x332d('0x12')](function(_0x14fb92){_0x575d47(_0x14fb92);});};AGIVertices[_0x332d('0xd')][_0x332d('0x47')]=function(_0x3854ef,_0x57a1eb){this[_0x332d('0xb')][_0x332d('0x48')](_0x3854ef)[_0x332d('0x10')](function(_0x1ada42){_0x57a1eb(null,_0x1ada42?_0x1ada42[_0x332d('0x11')]:![]);})[_0x332d('0x12')](function(_0x237b19){_0x57a1eb(_0x237b19);});};AGIVertices[_0x332d('0xd')]['agentPause']=function(_0x341bd8,_0x2bd385,_0x4b2fed){var _0x5bff8d={'role':_0x332d('0x49')};_0x5bff8d[_0x341bd8]=this[_0x332d('0xa')][_0x332d('0x4a')];this[_0x332d('0xb')]['agentPause'](_0x5bff8d,_0x2bd385,this[_0x332d('0xa')][_0x332d('0x32')])[_0x332d('0x10')](function(_0x334ecf){_0x4b2fed(null,_[_0x332d('0x3e')](_0x334ecf)?![]:!![]);})['catch'](function(_0xeb26d0){logger[_0x332d('0x27')](_0xeb26d0);_0x4b2fed(null,![]);});};AGIVertices[_0x332d('0xd')][_0x332d('0x4b')]=function(_0xa63687,_0x551c00){var _0x21f496={'role':_0x332d('0x49')};_0x21f496[_0xa63687]=this[_0x332d('0xa')][_0x332d('0x4a')];this['rpc'][_0x332d('0x4b')](_0x21f496)[_0x332d('0x10')](function(_0x2b5ea6){_0x551c00(null,_[_0x332d('0x3e')](_0x2b5ea6)?![]:!![]);})[_0x332d('0x12')](function(_0x3330ca){logger[_0x332d('0x27')](_0x3330ca);_0x551c00(null,![]);});};AGIVertices['prototype'][_0x332d('0x4c')]=function(_0x5e8d9c,_0x14b723){var _0x346a97={'role':'agent'};_0x346a97[_0x5e8d9c]=this[_0x332d('0xa')]['callerid'];this[_0x332d('0xb')][_0x332d('0x4c')](_0x346a97)['then'](function(_0x2098d1){_0x14b723(null,_['isNil'](_0x2098d1)?![]:!![]);})[_0x332d('0x12')](function(_0x580ac6){logger[_0x332d('0x27')](_0x580ac6);_0x14b723(null,![]);});};AGIVertices['prototype'][_0x332d('0x4d')]=function(_0x323575,_0x4ef80b){var _0x43189a={'role':_0x332d('0x49')};_0x43189a[_0x323575]=this['channel'][_0x332d('0x4a')];var _0x15ab7e=_0x323575!='internal'?util[_0x332d('0x25')](_0x332d('0x4e'),'LOCAL',this['channel']['callerid']):undefined;this[_0x332d('0xb')][_0x332d('0x4d')](_0x43189a,_0x15ab7e)[_0x332d('0x10')](function(_0x449319){_0x4ef80b(null,_['isNil'](_0x449319)?![]:!![]);})[_0x332d('0x12')](function(_0x439c1f){logger['error'](_0x439c1f);_0x4ef80b(null,![]);});};AGIVertices[_0x332d('0xd')][_0x332d('0x4f')]=function(_0x5f17f3,_0xadd0f){sh[_0x332d('0x50')](_[_0x332d('0x51')](_0x5f17f3),function(_0x335b10,_0x2c2915){var _0x360432=_0x2c2915[_0x332d('0x52')](/(\r\n|\n|\r)/gm,'');_0xadd0f(null,_0x360432);});};AGIVertices[_0x332d('0xd')]['googleCloudTTS']=function(_0x27a07c,_0x47a52b){scripts['googleCloudTTS'](_0x27a07c[_0x332d('0x53')],_0x27a07c[_0x332d('0x54')]||_0x332d('0x55'),_0x27a07c[_0x332d('0x55')],_0x27a07c[_0x332d('0x56')]||_0x332d('0x57'),_0x27a07c[_0x332d('0x58')]||'MALE',_0x27a07c[_0x332d('0x59')]||'MP3')['then'](function(_0x3814e3){_0x47a52b(null,_0x3814e3);})[_0x332d('0x12')](function(_0x8fcca9){_0x47a52b(_0x8fcca9);});};AGIVertices[_0x332d('0xd')][_0x332d('0x5a')]=function(_0x1feb37,_0x109e43){scripts['googleTTS'](_0x1feb37[_0x332d('0x55')],_0x1feb37[_0x332d('0x5b')]||'en',0x1)[_0x332d('0x10')](function(_0x469f23){_0x109e43(null,_0x469f23);})[_0x332d('0x12')](function(_0x45050a){_0x109e43(_0x45050a);});};AGIVertices[_0x332d('0xd')][_0x332d('0x5c')]=function(_0x31d31e,_0x1695cc){var _0x280a80={'uri':_0x31d31e[_0x332d('0x5d')],'method':_0x31d31e[_0x332d('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x31d31e[_0x332d('0x5f')])==='number'&&parseInt(_0x31d31e['timeout'])>=0x1?parseInt(_0x31d31e[_0x332d('0x5f')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x332d('0x60')],_0x280a80[_0x332d('0x5e')][_0x332d('0x61')]())){try{_0x280a80['body']=_0x31d31e[_0x332d('0x62')]?JSON[_0x332d('0x63')](_0x31d31e['rawBody']):{};}catch(_0x472a48){logger[_0x332d('0x27')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x472a48);}}try{_0x280a80[_0x332d('0x64')]=_0x31d31e[_0x332d('0x65')]?JSON[_0x332d('0x63')](_0x31d31e[_0x332d('0x65')]):{};}catch(_0x46c47b){logger[_0x332d('0x27')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x46c47b);}if(_0x31d31e[_0x332d('0x66')]){try{var _0x164e81=require(_0x31d31e[_0x332d('0x66')])[_0x332d('0x67')](this,_0x280a80);_0x280a80[_0x332d('0x68')]=Mustache[_0x332d('0x69')](_0x31d31e[_0x332d('0x5d')],_0x164e81,{},['$$','$$']);if(_0x280a80['headers']){_0x280a80['headers']=JSON[_0x332d('0x63')](Mustache[_0x332d('0x69')](JSON[_0x332d('0x6a')](_0x280a80[_0x332d('0x64')]),_0x164e81,{},['$$','$$']));}if(_0x280a80[_0x332d('0x6b')]){_0x280a80[_0x332d('0x6b')]=JSON[_0x332d('0x63')](Mustache[_0x332d('0x69')](JSON[_0x332d('0x6a')](_0x280a80[_0x332d('0x6b')]),_0x164e81,{},['$$','$$']));}}catch(_0x18dac){logger[_0x332d('0x27')](_0x332d('0x6c'),_0x18dac);}}rp(_0x280a80)['then'](function(_0x5646df){var _0x1fb2d7={'statusCode':_0x5646df[_0x332d('0x6d')]||0xc8,'statusMessage':_0x5646df['statusMessage']||'OK','headers':_0x5646df[_0x332d('0x64')]||{},'body':_0x5646df['body']||{}};_0x1695cc(null,_0x1fb2d7);})[_0x332d('0x12')](function(_0x3267c7){var _0x4a7eea={'statusCode':_0x3267c7[_0x332d('0x6d')]||0x1f4,'statusMessage':_0x3267c7[_0x332d('0x6e')]||_0x332d('0x6f'),'headers':_0x3267c7['options']['headers']||{},'body':_0x3267c7[_0x332d('0x70')][_0x332d('0x6b')]||{}};_0x1695cc(null,_0x4a7eea);});};AGIVertices['prototype'][_0x332d('0x71')]=function(_0x3e4712,_0x15ae73){scripts[_0x332d('0x71')](this['channel']['uniqueid'],_0x3e4712[_0x332d('0x72')],_0x3e4712['text'],_0x3e4712[_0x332d('0x73')]||'en')[_0x332d('0x10')](function(_0x8ef48e){_0x15ae73(null,_0x8ef48e);})['catch'](function(_0x361b3e){_0x15ae73(_0x361b3e);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x362778,_0x188b7e){scripts[_0x332d('0x74')](this[_0x332d('0xa')][_0x332d('0x32')],_0x362778[_0x332d('0x75')],_0x362778[_0x332d('0x76')],_0x362778[_0x332d('0x77')],_0x362778[_0x332d('0x55')],_0x362778[_0x332d('0x78')]||'en')[_0x332d('0x10')](function(_0x4bb3c1){_0x188b7e(null,_0x4bb3c1);})[_0x332d('0x12')](function(_0x35699e){_0x188b7e(_0x35699e);});};AGIVertices[_0x332d('0xd')][_0x332d('0x79')]=function(_0x567f6d,_0x297810){scripts[_0x332d('0x79')](this[_0x332d('0xa')],_0x567f6d)[_0x332d('0x10')](function(_0x56f9a9){_0x297810(null,_0x56f9a9);})[_0x332d('0x12')](function(_0x4dbc49){_0x297810(_0x4dbc49);});};AGIVertices[_0x332d('0xd')]['ispeechTTS']=function(_0x30d289,_0x70100e){scripts[_0x332d('0x7a')](_0x30d289[_0x332d('0x72')],_0x30d289['text'],_0x30d289['ispeech_tts_language']||_0x332d('0x57'),_0x30d289['speed'])[_0x332d('0x10')](function(_0x5a8185){_0x70100e(null,_0x5a8185);})[_0x332d('0x12')](function(_0x143785){_0x70100e(_0x143785);});};AGIVertices['prototype'][_0x332d('0x7b')]=function(_0x585ce8,_0x2d1071,_0x40ccef){scripts[_0x332d('0x7b')](_0x2d1071,_0x585ce8[_0x332d('0x72')],_0x585ce8['ispeech_asr_language']||_0x332d('0x57'),this['isConfigured'](_0x585ce8['model'])?_0x585ce8['model']:undefined)['then'](function(_0xd1e9dc){_0x40ccef(null,_0xd1e9dc);})[_0x332d('0x12')](function(_0xdf9090){_0x40ccef(_0xdf9090);});};AGIVertices[_0x332d('0xd')][_0x332d('0x7c')]=function(_0x2ec517,_0x32952a){scripts[_0x332d('0x7c')](_0x2ec517['aws_access_key_id'],_0x2ec517['aws_secret_access_key'],_0x2ec517[_0x332d('0x7d')],_0x2ec517[_0x332d('0x7e')]||'Amy',_0x2ec517[_0x332d('0x55')],_0x2ec517[_0x332d('0x7f')]||'text')[_0x332d('0x10')](function(_0x44f64c){_0x32952a(null,_0x44f64c);})[_0x332d('0x12')](function(_0x43601b){_0x32952a(_0x43601b);});};AGIVertices[_0x332d('0xd')][_0x332d('0x80')]=function(_0x4f0c40,_0x53470d){scripts['awsLex'](this[_0x332d('0xa')]['uniqueid'],_0x4f0c40['aws_access_key_id'],_0x4f0c40[_0x332d('0x81')],_0x4f0c40[_0x332d('0x82')],_0x4f0c40[_0x332d('0x55')],_0x4f0c40[_0x332d('0x83')])[_0x332d('0x10')](function(_0x9b111e){_0x53470d(null,_0x9b111e);})[_0x332d('0x12')](function(_0x334762){_0x53470d(_0x334762);});};AGIVertices[_0x332d('0xd')][_0x332d('0x84')]=function(_0xfdaf29,_0xdc17a,_0xedcf5f){scripts[_0x332d('0x84')](_0xdc17a,_0xfdaf29[_0x332d('0x72')],_0xfdaf29[_0x332d('0x85')]||_0x332d('0x57'))[_0x332d('0x10')](function(_0x468e20){_0xedcf5f(null,_0x468e20);})['catch'](function(_0x5bc8a3){_0xedcf5f(_0x5bc8a3);});};AGIVertices[_0x332d('0xd')]['tildeASR']=function(_0x296f7e,_0x16e725,_0x3e4e2c){scripts['tildeASR'](_0x16e725,_0x296f7e[_0x332d('0x86')],_0x296f7e[_0x332d('0x87')],_0x296f7e[_0x332d('0x68')])[_0x332d('0x10')](function(_0x3b9f68){_0x3e4e2c(null,_0x3b9f68);})[_0x332d('0x12')](function(_0x1fd9fb){_0x3e4e2c(_0x1fd9fb);});};AGIVertices['prototype'][_0x332d('0x88')]=function(_0x32023b){var _0x2d2438=_[_0x332d('0x89')](verticesWithRetry,_0x32023b[_0x332d('0x34')])?_0x32023b:_[_0x332d('0x8a')](_0x32023b);for(var _0x188128 in _0x2d2438){if(_0x2d2438['hasOwnProperty'](_0x188128)){if(_0x2d2438[_0x188128]&&_['isString'](_0x2d2438[_0x188128])){if(_[_0x332d('0x89')](recursiveMapAttributes,_0x188128)){_0x2d2438[_0x188128]=this[_0x332d('0x8b')](_0x2d2438[_0x188128]);}else{_0x2d2438[_0x188128]=this[_0x332d('0x8c')](_0x2d2438[_0x188128]);}}}}return _0x2d2438;};AGIVertices[_0x332d('0xd')][_0x332d('0x8d')]=function(_0x364d8b){for(var _0x28fcea in _0x364d8b){if(_0x364d8b['hasOwnProperty'](_0x28fcea)){if(_[_0x332d('0x8e')](_0x364d8b[_0x28fcea])){this['recursiveNodeIndex'](_0x364d8b[_0x28fcea]);}else if(_[_0x332d('0x8f')](_0x364d8b[_0x28fcea])){for(var _0x36b7a8=0x0;_0x36b7a8<_0x364d8b[_0x28fcea][_0x332d('0x90')];_0x36b7a8++){this[_0x332d('0x8d')](_0x364d8b[_0x28fcea][_0x36b7a8]);}}else if(_['isString'](_0x364d8b[_0x28fcea])){_0x364d8b[_0x28fcea]=this[_0x332d('0x8c')](_0x364d8b[_0x28fcea]);}}}};AGIVertices[_0x332d('0xd')][_0x332d('0x91')]=function(_0x426603,_0xf28472){for(var _0x32077c in _0x426603){if(_0x426603[_0x332d('0x92')](_0x32077c)){if(_[_0x332d('0x8e')](_0x426603[_0x32077c])){if(!_[_0x332d('0x3d')](_0x426603[_0x32077c])){this[_0x332d('0x91')](_0x426603[_0x32077c],util[_0x332d('0x25')](_0x332d('0x93'),_0xf28472,_0x32077c));}}else if(_[_0x332d('0x8f')](_0x426603[_0x32077c])){for(var _0x1d4005=0x0;_0x1d4005<_0x426603[_0x32077c][_0x332d('0x90')];_0x1d4005++){this['saveRestApiResult'](_0x426603[_0x32077c][_0x1d4005],util['format']('%s.%s',_0xf28472,_0x32077c+'['+_0x1d4005+']'));}}else{if(!_[_0x332d('0x3e')](_0x426603[_0x32077c])){this[_0x332d('0xa')]['setVariable'](util['format']('%s.%s',_0xf28472,_0x32077c),_0x426603[_0x32077c]);}}}}};AGIVertices[_0x332d('0xd')][_0x332d('0x8b')]=function(_0x454a5c){try{var _0x4d68b0=JSON[_0x332d('0x63')](_0x454a5c);this[_0x332d('0x8d')](_0x4d68b0);return JSON[_0x332d('0x6a')](_0x4d68b0);}catch(_0x27ca9a){return this[_0x332d('0x8c')](_0x454a5c);}};AGIVertices[_0x332d('0xd')][_0x332d('0x8c')]=function(_0x2a51cd){var _0x3ad477=_0x2a51cd[_0x332d('0x94')]('{');for(var _0x392214=0x1;_0x392214<_0x3ad477[_0x332d('0x90')];_0x392214+=0x1){var _0x3ea573=_0x3ad477[_0x392214][_0x332d('0x94')]('}');if(_0x3ea573['length']>0x1){_0x2a51cd=_0x2a51cd[_0x332d('0x95')]('{'+_0x3ea573[0x0]+'}',this['channel']['getVariable'](_0x3ea573[0x0])['extra']||_0x3ea573[0x0]);}}if(_0x3ad477[_0x332d('0x90')]===0x1){return _0x2a51cd[_0x332d('0x45')]();}return this[_0x332d('0x8c')](_0x2a51cd);};AGIVertices[_0x332d('0xd')][_0x332d('0x96')]=function(_0x6a82f,_0x8ee082){var _0x5c31e2=this[_0x332d('0xa')][_0x332d('0xe')](_0x6a82f);if(_0x5c31e2[_0x332d('0x97')]===-0x1){return _0x5c31e2;}logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x98'),_0x8ee082,_0x5c31e2[_0x332d('0x99')]));return this[_0x332d('0xa')]['setVariable'](_0x8ee082,_0x5c31e2[_0x332d('0x99')]);};AGIVertices['prototype']['isConfigured']=function(_0x49479f){return _0x49479f&&_0x49479f!=='0'&&_0x49479f!=='-1'&&_0x49479f!=='';};AGIVertices[_0x332d('0xd')][_0x332d('0x9a')]=function(_0x57431a){this[_0x332d('0x31')][_0x332d('0x67')](this,_0x57431a,'-');_0x57431a[_0x332d('0x9b')]=_0x57431a[_0x332d('0x9a')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x332d('0x9c')]=function(_0x3adf6a){logger['info'](util[_0x332d('0x25')](_0x332d('0x9d'),_0x3adf6a[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x3adf6a['text'])){return this[_0x332d('0xa')]['noop'](_0x332d('0x9f'));}var _0x566e37='\x22'+_0x3adf6a[_0x332d('0x55')]+'\x22';if(this['isConfigured'](_0x3adf6a[_0x332d('0x70')])){_0x566e37+=','+_0x3adf6a[_0x332d('0x70')];}var _0x2cb66e=this[_0x332d('0xa')][_0x332d('0x50')](_0x332d('0xa0'),_0x566e37);if(_0x2cb66e['result']===-0x1){return _0x2cb66e;}return this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x566e37));};AGIVertices[_0x332d('0xd')]['mrcprecog']=function(_0x2c0f77){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xa1'),_0x2c0f77['label']));if(!this['isConfigured'](_0x2c0f77[_0x332d('0xa2')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xa4'));}var _0x1f60c0=_0x2c0f77[_0x332d('0xa2')];if(this['isConfigured'](_0x2c0f77[_0x332d('0x70')])){_0x1f60c0+=','+_0x2c0f77[_0x332d('0x70')];}var _0x2dc879=this['channel']['exec'](_0x332d('0xa5'),_0x1f60c0);if(_0x2dc879[_0x332d('0x97')]===-0x1){return _0x2dc879;}var _0x18695a=this[_0x332d('0x96')](_0x332d('0xa6'),_0x332d('0xa7'));if(_0x18695a['result']===-0x1){return _0x18695a;}var _0x2687ae=this['getAndSetVariable']('RECOG_INPUT()',_0x332d('0xa8'));if(_0x2687ae[_0x332d('0x97')]===-0x1){return _0x2687ae;}var _0x455d3b=this[_0x332d('0x96')]('RECOG_INSTANCE()',_0x332d('0xa9'));if(_0x455d3b[_0x332d('0x97')]===-0x1){return _0x455d3b;}return this[_0x332d('0xa')][_0x332d('0xa3')](util['format'](_0x332d('0xaa'),_0x1f60c0));};AGIVertices[_0x332d('0xd')][_0x332d('0x5')]=function(_0x36bc7d){logger['info'](util[_0x332d('0x25')](_0x332d('0xab'),_0x36bc7d[_0x332d('0x33')]));return this[_0x332d('0xa')][_0x332d('0x5')]([_0x36bc7d[_0x332d('0xac')],_0x36bc7d[_0x332d('0xad')]]);};AGIVertices[_0x332d('0xd')]['answer']=function(_0x34015a){logger[_0x332d('0x29')](util['format'](_0x332d('0xae'),_0x34015a[_0x332d('0x33')]));if(this[_0x332d('0x9e')](_0x34015a[_0x332d('0x5f')])){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xaf'),_0x34015a['timeout']));var _0x74ca6a=this['channel'][_0x332d('0xb0')](_0x34015a[_0x332d('0x5f')]);if(_0x74ca6a[_0x332d('0x97')]===-0x1){return _0x74ca6a;}}return this[_0x332d('0xa')]['answer']();};AGIVertices[_0x332d('0xd')][_0x332d('0x44')]=function(_0x452058){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xb1'),_0x452058[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x452058[_0x332d('0x42')])){return this['channel'][_0x332d('0x27')](_0x452058,_0x332d('0xb2'));}_0x452058[_0x332d('0x43')]=moment();if(this[_0x332d('0x9e')](_0x452058[_0x332d('0xb3')])){_0x452058[_0x332d('0x43')]=moment()[_0x332d('0xb4')](_0x452058[_0x332d('0xb3')],'minutes');}if(!this[_0x332d('0x9e')](_0x452058[_0x332d('0x46')])){_0x452058[_0x332d('0x46')]=0x2;}this['createCmContact']['sync'](this,_0x452058);return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0xb5'),_0x452058[_0x332d('0x41')],_0x452058['list_id'],_0x452058[_0x332d('0x43')]));};AGIVertices[_0x332d('0xd')]['custom_app']=function(_0x434afc){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x434afc[_0x332d('0x33')]));var _0x1c9ce6=this[_0x332d('0xa')][_0x332d('0x50')](_0x434afc[_0x332d('0xb6')],_0x434afc[_0x332d('0x70')]);if(_0x1c9ce6['result']===-0x1){return _0x1c9ce6;}return this['channel'][_0x332d('0xa3')](util[_0x332d('0x25')]('Executed\x20command\x20%s\x20%s',_0x434afc['application'],_0x434afc[_0x332d('0x70')]));};AGIVertices[_0x332d('0xd')][_0x332d('0xb7')]=function(_0x135a58){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xb8'),_0x135a58[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x135a58[_0x332d('0x55')])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20text\x20configured');}var _0x19708d='\x22'+_0x135a58[_0x332d('0x55')]+'\x22';if(this[_0x332d('0x9e')](_0x135a58[_0x332d('0x70')])){_0x19708d+=','+_0x135a58[_0x332d('0x70')];}var _0x40ef8b=this['channel'][_0x332d('0x50')](_0x332d('0xa0'),_0x19708d);if(_0x40ef8b['result']===-0x1){return _0x40ef8b;}return this[_0x332d('0xa')][_0x332d('0xa3')](util['format'](_0x332d('0xb9'),_0x19708d));};AGIVertices['prototype'][_0x332d('0xba')]=function(_0x338bc7){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x338bc7['label']));if(!this[_0x332d('0x9e')](_0x338bc7[_0x332d('0x55')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x9f'));}var _0x506a96='\x22'+_0x338bc7[_0x332d('0x55')]+'\x22';if(this[_0x332d('0x9e')](_0x338bc7[_0x332d('0x70')])){_0x506a96+=','+_0x338bc7[_0x332d('0x70')];}var _0x269dd1=this['channel'][_0x332d('0x50')](_0x332d('0xa0'),_0x506a96);if(_0x269dd1['result']===-0x1){return _0x269dd1;}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0xb9'),_0x506a96));};AGIVertices[_0x332d('0xd')]['lumenvoxasr']=function(_0x15d186){logger['info'](util[_0x332d('0x25')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x15d186[_0x332d('0x33')]));if(!this['isConfigured'](_0x15d186[_0x332d('0xa2')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xa4'));}var _0x4e68f9=_0x15d186[_0x332d('0xa2')];if(this[_0x332d('0x9e')](_0x15d186[_0x332d('0x70')])){_0x4e68f9+=','+_0x15d186[_0x332d('0x70')];}var _0x530ef6=this[_0x332d('0xa')][_0x332d('0x50')](_0x332d('0xa5'),_0x4e68f9);if(_0x530ef6[_0x332d('0x97')]===-0x1){return _0x530ef6;}var _0x1b80a5=this[_0x332d('0x96')](_0x332d('0xa6'),_0x332d('0xbb'));if(_0x1b80a5['result']===-0x1){return _0x1b80a5;}var _0x28b012=this[_0x332d('0x96')](_0x332d('0xbc'),_0x332d('0xbd'));if(_0x28b012['result']===-0x1){return _0x28b012;}var _0x3cbe30=this[_0x332d('0x96')]('RECOG_INSTANCE()',_0x332d('0xbe'));if(_0x3cbe30[_0x332d('0x97')]===-0x1){return _0x3cbe30;}return this['channel']['noop'](util[_0x332d('0x25')](_0x332d('0xaa'),_0x4e68f9));};AGIVertices['prototype'][_0x332d('0xbf')]=function(_0x5ed102){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xc0'),_0x5ed102[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x5ed102[_0x332d('0xa2')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xa4'));}var _0x21cb3f=_0x5ed102['grammar'];if(this[_0x332d('0x9e')](_0x5ed102[_0x332d('0x70')])){_0x21cb3f+=','+_0x5ed102[_0x332d('0x70')];}var _0x5cb622=this[_0x332d('0xa')][_0x332d('0x50')](_0x332d('0xa5'),_0x21cb3f);if(_0x5cb622[_0x332d('0x97')]===-0x1){return _0x5cb622;}var _0x2a86cd=this['getAndSetVariable'](_0x332d('0xa6'),_0x332d('0xc1'));if(_0x2a86cd[_0x332d('0x97')]===-0x1){return _0x2a86cd;}var _0x3b0d1a=this[_0x332d('0x96')]('RECOG_INPUT()',_0x332d('0xc2'));if(_0x3b0d1a['result']===-0x1){return _0x3b0d1a;}var _0x1d7af5=this[_0x332d('0x96')](_0x332d('0xc3'),_0x332d('0xc4'));if(_0x1d7af5[_0x332d('0x97')]===-0x1){return _0x1d7af5;}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x21cb3f));};AGIVertices[_0x332d('0xd')][_0x332d('0xc5')]=function(_0x36611b){logger[_0x332d('0x29')](util['format'](_0x332d('0xc6'),_0x36611b[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x36611b[_0x332d('0xc7')])){return this['channel'][_0x332d('0x27')](_0x36611b,'no\x20database\x20selected');}var _0x56d6ae=this[_0x332d('0xc8')][_0x332d('0x67')](this,_0x36611b['odbc_id']);if(!_0x56d6ae){return this[_0x332d('0xa')][_0x332d('0x27')](_0x36611b,_0x332d('0xc9'));}if(!this[_0x332d('0x9e')](_0x36611b[_0x332d('0x2b')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x36611b,_0x332d('0xca'));}var _0x1fef76=_0x36611b['query'][_0x332d('0x52')](/(\r\n|\n|\r)/gm,'\x20');this[_0x332d('0xa')]['noop'](util['format']('query:\x20%s',_0x1fef76));var _0x197f53=this[_0x332d('0xcb')]['sync'](this,_0x56d6ae,_0x1fef76);this[_0x332d('0x31')][_0x332d('0x67')](this,_0x36611b,_0x1fef76);if(!this['isConfigured'](_0x36611b[_0x332d('0xcc')])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xc2b577=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x36611b[_0x332d('0xcc')]);if(!_0xc2b577){return this[_0x332d('0xa')]['error'](_0x36611b,_0x332d('0xcd'));}var _0x518490=this;_0x197f53['forEach'](function(_0x58cb3b,_0x12b227){Object['keys'](_0x58cb3b)['forEach'](function(_0x3050a3){_0x518490[_0x332d('0xa')][_0x332d('0xce')](util[_0x332d('0x25')]('%s[%s][%s]',_0xc2b577,_0x12b227,_0x3050a3),_0x58cb3b[_0x3050a3]);});});this[_0x332d('0xa')]['setVariable'](util[_0x332d('0x25')](_0x332d('0xcf'),_0xc2b577),_0x197f53['length']);return this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')](_0x332d('0xd0'),_0xc2b577));};AGIVertices[_0x332d('0xd')][_0x332d('0xd1')]=function(_0x257c4a){logger[_0x332d('0xd2')](util[_0x332d('0x25')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x257c4a[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x257c4a[_0x332d('0xd3')])){return this['channel']['error'](_0x257c4a,_0x332d('0xd4'));}var _0x536649=this[_0x332d('0xd5')][_0x332d('0x67')](this,_0x257c4a['sip_id']);if(!_0x536649){return this[_0x332d('0xa')][_0x332d('0x27')](_0x257c4a,_0x332d('0xd6'));}var _0x33a383=this[_0x332d('0xa')]['exec'](_0x332d('0xd7'),[util[_0x332d('0x25')](_0x332d('0xd8'),_0x536649),_0x257c4a[_0x332d('0x5f')],_0x257c4a[_0x332d('0xd9')],_0x257c4a[_0x332d('0x5d')]]);if(_0x33a383[_0x332d('0x97')]===-0x1){return _0x33a383;}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0xda'),'DIAL'));};AGIVertices['prototype'][_0x332d('0xdb')]=function(_0x2aa6eb){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xdc'),_0x2aa6eb[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x2aa6eb[_0x332d('0x72')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xdd'));}if(!this[_0x332d('0x9e')](_0x2aa6eb['text'])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20text\x20configured');}this[_0x332d('0xa')][_0x332d('0xde')]=!![];this[_0x332d('0x31')](_0x2aa6eb);this[_0x332d('0x3b')](_0x2aa6eb[_0x332d('0x55')],'in','','');this['channel'][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0xdf'),_0x2aa6eb[_0x332d('0x55')]));var _0x88c21=this[_0x332d('0x71')][_0x332d('0x67')](this,_0x2aa6eb);if(_0x88c21){for(var _0x485496 in _0x88c21){if(_0x88c21['hasOwnProperty'](_0x485496)){this['channel'][_0x332d('0xce')](util[_0x332d('0x25')](_0x332d('0xe0'),_0x485496[_0x332d('0x61')]()),_0x88c21[_0x485496]);}}this[_0x332d('0x3b')](_0x88c21['speech'],_0x332d('0xe1'),_0x332d('0xdb'),'');return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('Dialogflow\x20Result\x20%s',_0x88c21[_0x332d('0xe2')]));}return this['channel'][_0x332d('0x27')](_0x2aa6eb,_0x332d('0xe3'));};AGIVertices[_0x332d('0xd')][_0x332d('0xe4')]=function(_0x13edfe){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0xe5'),_0x13edfe[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x13edfe[_0x332d('0x75')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xe6'));}if(!this[_0x332d('0x9e')](_0x13edfe[_0x332d('0x76')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xe7'));}if(!this[_0x332d('0x9e')](_0x13edfe[_0x332d('0x77')])){return this['channel'][_0x332d('0xa3')](_0x332d('0xe8'));}if(!this[_0x332d('0x9e')](_0x13edfe[_0x332d('0x78')])){return this[_0x332d('0xa')]['noop'](_0x332d('0xe9'));}if(!this[_0x332d('0x9e')](_0x13edfe['text'])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20text\x20configured');}this[_0x332d('0xa')][_0x332d('0xde')]=!![];this['createSquareDetailsReport'](_0x13edfe);this[_0x332d('0x3b')](_0x13edfe['text'],'in','','');this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('Trying\x20DialogflowV2:\x20%s',_0x13edfe['text']));var _0x2eaaaf=this['googleDialogflowV2'][_0x332d('0x67')](this,_0x13edfe);if(_0x2eaaaf){for(var _0x4a9ac7 in _0x2eaaaf){if(_0x2eaaaf[_0x332d('0x92')](_0x4a9ac7)){if(_0x4a9ac7!==_0x332d('0xea')){this['channel'][_0x332d('0xce')](util[_0x332d('0x25')](_0x332d('0xe0'),_0x4a9ac7[_0x332d('0x61')]()),_0x2eaaaf[_0x4a9ac7]);}}}this[_0x332d('0x3b')](_0x2eaaaf[_0x332d('0xe2')],_0x332d('0xe1'),_0x332d('0xe4'),_0x2eaaaf[_0x332d('0xea')]);return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0xeb'),_0x2eaaaf[_0x332d('0xe2')]));}return this['channel']['error'](_0x13edfe,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x332d('0xd')][_0x332d('0xec')]=function(_0x3028ac){logger[_0x332d('0x29')](util['format'](_0x332d('0xed'),_0x3028ac[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x3028ac['ndauth_url'])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xee'));}if(!this[_0x332d('0x9e')](_0x3028ac[_0x332d('0xef')])){return this['channel'][_0x332d('0xa3')](_0x332d('0xf0'));}if(!this[_0x332d('0x9e')](_0x3028ac[_0x332d('0xf1')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xf2'));}if(!this[_0x332d('0x9e')](_0x3028ac[_0x332d('0xf3')])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20text\x20configured');}this[_0x332d('0xa')][_0x332d('0xde')]=!![];this[_0x332d('0x31')](_0x3028ac);this[_0x332d('0x3b')](_0x3028ac[_0x332d('0x55')],'in','','');this[_0x332d('0xa')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x3028ac[_0x332d('0x55')]));var _0x5e7ca7=this['sestekNDA'][_0x332d('0x67')](this,_0x3028ac);if(_0x5e7ca7){for(var _0x2e43e5 in _0x5e7ca7){if(_0x5e7ca7[_0x332d('0x92')](_0x2e43e5)){this['channel'][_0x332d('0xce')](util['format']('SESTEK_NDA_%s',_0x2e43e5[_0x332d('0x61')]()),_0x5e7ca7[_0x2e43e5]);}}this['createSquareMessage'](_0x5e7ca7[_0x332d('0xe2')],'out',_0x332d('0xec'),'');if(_0x5e7ca7[_0x332d('0xf4')]){this['channel'][_0x332d('0xa3')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x5e7ca7[_0x332d('0xf4')]));var _0xe5f5d4=this[_0x332d('0xa')][_0x332d('0xf5')](_0x5e7ca7[_0x332d('0xf4')]);try{fs[_0x332d('0xf6')](_0x5e7ca7[_0x332d('0xf4')]+_0x332d('0xf7'));}catch(_0x4f1517){logger[_0x332d('0x27')](_0x4f1517);}return _0xe5f5d4;}else{return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0xf8'),_0x5e7ca7[_0x332d('0xe2')]));}}return this[_0x332d('0xa')]['error'](_0x3028ac,_0x332d('0xf9'));};AGIVertices[_0x332d('0xd')][_0x332d('0xfa')]=function(_0x42c9d1){logger[_0x332d('0x29')](util['format'](_0x332d('0xfb'),_0x42c9d1['label']));return this[_0x332d('0xa')]['noop'](_0x332d('0xfa'));};AGIVertices[_0x332d('0xd')]['ext_dial']=function(_0x1cc1cb){logger[_0x332d('0x29')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1cc1cb[_0x332d('0x33')]));var _0x2e34a7='';if(_0x1cc1cb[_0x332d('0xfc')]){if(!this[_0x332d('0x9e')](_0x1cc1cb[_0x332d('0xfc')])){return this['channel'][_0x332d('0x27')](_0x1cc1cb,'no\x20trunk\x20selected');}else{var _0x2f8878=parseInt(_0x1cc1cb[_0x332d('0xfc')],0xa);if(isNaN(_0x2f8878)){_0x2e34a7=_0x1cc1cb[_0x332d('0xfc')];}else{_0x2e34a7=this[_0x332d('0x19')][_0x332d('0x67')](this,_0x1cc1cb[_0x332d('0xfc')]);if(!_0x2e34a7){return this[_0x332d('0xa')][_0x332d('0x27')](_0x1cc1cb,'no\x20trunk\x20found');}}}}else if(_0x1cc1cb[_0x332d('0xfd')]){_0x2e34a7=_0x1cc1cb['trunk_name'];}else{return this[_0x332d('0xa')][_0x332d('0x27')](_0x1cc1cb,'no\x20trunk\x20selected');}var _0x1473a5=this[_0x332d('0xa')][_0x332d('0x50')](_0x332d('0xd7'),[util[_0x332d('0x25')](_0x332d('0xfe'),_0x2e34a7,_0x1cc1cb['phone']),_0x1cc1cb['timeout'],_0x1cc1cb[_0x332d('0xd9')],_0x1cc1cb[_0x332d('0x5d')]]);if(_0x1473a5[_0x332d('0x97')]===-0x1){return _0x1473a5;}return this[_0x332d('0xa')][_0x332d('0xa3')](util['format'](_0x332d('0xda'),_0x332d('0xd7')));};AGIVertices[_0x332d('0xd')][_0x332d('0xff')]=function(_0xf09a70){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xf09a70[_0x332d('0x33')]));return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xff'));};AGIVertices['prototype'][_0x332d('0x9')]=function(_0x4587fb){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x100'),_0x4587fb[_0x332d('0x33')]));if(_0x4587fb['retry']===0x0){return this['maxRetry'](_0x4587fb);}_0x4587fb[_0x332d('0x9b')]-=0x1;if(!this[_0x332d('0x9e')](_0x4587fb[_0x332d('0x101')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x4587fb,'no\x20file\x20audio\x20selected');}var _0x2bb663=this[_0x332d('0x1b')][_0x332d('0x67')](this,_0x4587fb[_0x332d('0x101')]);if(!_0x2bb663){return this[_0x332d('0xa')][_0x332d('0x27')](_0x4587fb,_0x332d('0x102'));}if(!this['isConfigured'](_0x4587fb['variable_id'])){return this['channel'][_0x332d('0x27')](_0x332d('0x103'));}var _0x6de616=this[_0x332d('0xa')][_0x332d('0x104')](_0x2bb663,_0x4587fb[_0x332d('0x105')],_0x4587fb['maxdigit']);var _0x10460d=_0x6de616[_0x332d('0x97')]?_0x6de616[_0x332d('0x97')][_0x332d('0x45')]():'';logger[_0x332d('0x29')](_0x332d('0x106'),JSON[_0x332d('0x6a')](_0x6de616));if(_0x6de616[_0x332d('0x97')]===-0x1){this[_0x332d('0x31')][_0x332d('0x67')](this,_0x4587fb,_0x10460d);return _0x6de616;}else if(_0x6de616[_0x332d('0x99')]===_0x332d('0x5f')){_0x6de616[_0x332d('0x97')]=_0x10460d[_0x332d('0x90')]>=parseInt(_0x4587fb[_0x332d('0x107')])?'x':'i';}else{_0x6de616[_0x332d('0x97')]=_0x10460d[_0x332d('0x90')]>=parseInt(_0x4587fb['mindigit'])&&_0x10460d[_0x332d('0x90')]<=parseInt(_0x4587fb[_0x332d('0x108')])?'x':'i';}var _0x5403aa=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x4587fb[_0x332d('0xcc')]);if(!_0x5403aa){return this[_0x332d('0xa')]['error'](_0x4587fb,_0x332d('0xcd'));}this[_0x332d('0xa')][_0x332d('0xce')](_0x5403aa,_0x10460d);if(this[_0x332d('0x9e')](_0x4587fb[_0x332d('0x109')])){var _0x3f8d8d=parseInt(_0x4587fb[_0x332d('0x109')],0xa);var _0x201002=rs[_0x332d('0x10a')]({'charset':'*','length':_0x3f8d8d});var _0x27a6b1=_0x10460d[_0x332d('0x90')];if(_0x27a6b1>0x0){if(_0x27a6b1>_0x3f8d8d){this[_0x332d('0x31')]['sync'](this,_0x4587fb,_0x4587fb['hiddendigitspos']===_0x332d('0x10b')?_0x201002+_0x10460d[_0x332d('0x10c')](_0x3f8d8d):_0x10460d['substr'](0x0,_0x27a6b1-_0x3f8d8d)+_0x201002);}else{this[_0x332d('0x31')][_0x332d('0x67')](this,_0x4587fb,rs[_0x332d('0x10a')]({'charset':'*','length':_0x27a6b1}));}}else{this['createSquareDetailsReport'][_0x332d('0x67')](this,_0x4587fb,'');}}else{this[_0x332d('0x31')][_0x332d('0x67')](this,_0x4587fb,_0x10460d);}return _0x6de616;};AGIVertices['prototype'][_0x332d('0x10d')]=function(_0x507304){logger[_0x332d('0x29')](util['format'](_0x332d('0x10e'),_0x507304[_0x332d('0x33')]));return this[_0x332d('0x9')](_0x507304);};AGIVertices['prototype'][_0x332d('0x10f')]=function(_0x3af2a1){logger['info'](util['format'](_0x332d('0x110'),_0x3af2a1['label']));this[_0x332d('0x31')]['sync'](this,_0x3af2a1,_0x3af2a1[_0x332d('0x111')]);return this[_0x332d('0xa')][_0x332d('0xa3')](util['format']('GOAL\x20%s',_0x3af2a1['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x30de7c){logger[_0x332d('0x29')](util[_0x332d('0x25')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x30de7c['label']));if(!this[_0x332d('0x9e')](_0x30de7c['aws_access_key_id'])||!this[_0x332d('0x9e')](_0x30de7c[_0x332d('0x81')])){return this['channel'][_0x332d('0xa3')](_0x332d('0x112'));}if(!this[_0x332d('0x9e')](_0x30de7c[_0x332d('0x55')])){return this[_0x332d('0xa')]['noop'](_0x332d('0x9f'));}this[_0x332d('0xa')][_0x332d('0xa3')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x30de7c['text']));var _0x876360=this[_0x332d('0x7c')][_0x332d('0x67')](this,_0x30de7c);if(_0x876360){this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x113'),_0x876360));var _0x4e5b87=this['channel'][_0x332d('0xf5')](_0x876360);try{fs[_0x332d('0xf6')](_0x876360+_0x332d('0xf7'));}catch(_0x23acd7){logger[_0x332d('0x27')](_0x23acd7);}return _0x4e5b87;}return this[_0x332d('0xa')][_0x332d('0x27')](_0x30de7c,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x332d('0xd')]['awslex']=function(_0x3ffb23){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x114'),_0x3ffb23[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x3ffb23[_0x332d('0x115')])||!this[_0x332d('0x9e')](_0x3ffb23[_0x332d('0x81')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x112'));}if(!this[_0x332d('0x9e')](_0x3ffb23['aws_bot_name'])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x116'));}if(!this[_0x332d('0x9e')](_0x3ffb23['text'])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x9f'));}this[_0x332d('0xa')][_0x332d('0xde')]=!![];this[_0x332d('0x31')](_0x3ffb23);this['createSquareMessage'](_0x3ffb23[_0x332d('0x55')],'in','','');this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x117'),_0x3ffb23[_0x332d('0x55')]));var _0x5b544a=this['awsLex']['sync'](this,_0x3ffb23);if(_0x5b544a){for(var _0xf48bb6 in _0x5b544a){if(_0x5b544a['hasOwnProperty'](_0xf48bb6)&&_['isString'](_0x5b544a[_0xf48bb6])){this[_0x332d('0xa')][_0x332d('0xce')](util[_0x332d('0x25')]('AWS_LEX_%s',_0xf48bb6[_0x332d('0x61')]()),_0x5b544a[_0xf48bb6]);}}if(_[_0x332d('0x3e')](_0x5b544a[_0x332d('0x6e')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x118'));}else{this[_0x332d('0x3b')](_0x5b544a[_0x332d('0x6e')],_0x332d('0xe1'),_0x332d('0x119'),'');return this['channel'][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x11a'),_0x5b544a[_0x332d('0x6e')]));}}return this[_0x332d('0xa')][_0x332d('0x27')](_0x3ffb23,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x332d('0xd')][_0x332d('0x11b')]=function(_0x15d559){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x11c'),_0x15d559['label'],_0x15d559['timeout']));if(!this[_0x332d('0x9e')](_0x15d559[_0x332d('0x72')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xdd'));}var _0x373540=_0x332d('0x11d');var _0x4c7054=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x332d('0x10a')](0x4));var _0x3a7dbf=util[_0x332d('0x25')](_0x332d('0x93'),_0x4c7054,_0x373540);var _0x2b893f=!![];if(_0x15d559[_0x332d('0x11e')]===_0x332d('0x11f')){_0x2b893f=![];}var _0x2e74a5=this[_0x332d('0xa')][_0x332d('0x120')](_0x4c7054,_0x373540,_0x15d559['intKey'],_0x15d559[_0x332d('0x5f')],undefined,_0x2b893f);if(_0x2e74a5['result']!==-0x1){this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')](_0x332d('0x121'),_0x3a7dbf));var _0x16c9f5=this[_0x332d('0x84')][_0x332d('0x67')](this,_0x15d559,_0x3a7dbf);if(_0x16c9f5){for(var _0xbb63db in _0x16c9f5){if(_0x16c9f5[_0x332d('0x92')](_0xbb63db)){this[_0x332d('0xa')][_0x332d('0xce')](util[_0x332d('0x25')](_0x332d('0x122'),_0xbb63db[_0x332d('0x61')]()),_0x16c9f5[_0xbb63db]);}}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x123'),JSON[_0x332d('0x6a')](_0x16c9f5)));}}return _0x2e74a5;};AGIVertices['prototype']['tildeasr']=function(_0x5c9d8d){logger['info'](util[_0x332d('0x25')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x5c9d8d[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x5c9d8d[_0x332d('0x86')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x124'));}if(!this['isConfigured'](_0x5c9d8d[_0x332d('0x87')])){return this['channel'][_0x332d('0xa3')]('no\x20appsecret\x20configured');}var _0x2325b4=_0x332d('0x11d');var _0x1b1ec3=util[_0x332d('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x332d('0x10a')](0x4));var _0x55b800=util[_0x332d('0x25')](_0x332d('0x93'),_0x1b1ec3,_0x2325b4);var _0x26db90=!![];if(_0x5c9d8d['beep']===_0x332d('0x11f')){_0x26db90=![];}var _0x548313=this['channel']['recordFile'](_0x1b1ec3,_0x2325b4,_0x5c9d8d[_0x332d('0x125')],_0x5c9d8d[_0x332d('0x5f')],undefined,_0x26db90);if(_0x548313[_0x332d('0x97')]!==-0x1){this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x126'),_0x55b800));var _0x578d7f=this[_0x332d('0x127')][_0x332d('0x67')](this,_0x5c9d8d,_0x55b800);if(_0x578d7f){for(var _0x3a37e4 in _0x578d7f){if(_0x578d7f[_0x332d('0x92')](_0x3a37e4)){this['channel']['setVariable'](util[_0x332d('0x25')](_0x332d('0x128'),_0x3a37e4[_0x332d('0x61')]()),_0x578d7f[_0x3a37e4]);}}return this[_0x332d('0xa')][_0x332d('0xa3')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x332d('0x6a')](_0x578d7f)));}}return _0x548313;};AGIVertices[_0x332d('0xd')][_0x332d('0x129')]=function(_0xc721de){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0xc721de[_0x332d('0x33')]));return this['channel'][_0x332d('0x12a')](_0xc721de[_0x332d('0x12b')],_0xc721de[_0x332d('0x37')],_0xc721de['priority']);};AGIVertices[_0x332d('0xd')]['gotoif']=function(_0x3af391){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x12c'),_0x3af391[_0x332d('0x33')]));if(!this['isConfigured'](_0x3af391[_0x332d('0x12d')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3af391,_0x332d('0x12e'));}try{var _0x4ec324=eval(_0x3af391[_0x332d('0x12d')])?_0x332d('0x12f'):_0x332d('0x130');this[_0x332d('0xa')]['noop'](util['format'](_0x332d('0x131'),_0x3af391[_0x332d('0x12d')],_0x4ec324));return{'code':0xc8,'result':_0x4ec324};}catch(_0x3076f1){return{'code':0xc8,'result':_0x332d('0x130')};}};AGIVertices[_0x332d('0xd')][_0x332d('0x132')]=function(_0x13123f){logger['info'](util[_0x332d('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x13123f[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x13123f[_0x332d('0x133')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x13123f,_0x332d('0x134'));}var _0x228c96=this[_0x332d('0x135')][_0x332d('0x67')](this,_0x13123f['interval_id']);if(!_0x228c96){return this[_0x332d('0xa')]['error'](_0x13123f,_0x332d('0x136'));}for(var _0x4c0b1a=0x0;_0x4c0b1a<_0x228c96[_0x332d('0x90')];_0x4c0b1a+=0x1){var _0x7c2dae=this[_0x332d('0xa')]['getVariable'](util[_0x332d('0x25')](_0x332d('0x137'),_0x228c96[_0x4c0b1a]));if(_0x7c2dae[_0x332d('0x97')]===-0x1){return _0x7c2dae;}logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x138'),_0x228c96[_0x4c0b1a],_0x7c2dae[_0x332d('0x99')]));if(_0x7c2dae[_0x332d('0x99')]===_0x332d('0x12f')){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x138'),_0x228c96[_0x4c0b1a],_0x332d('0x12f')));this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('IFTIME\x20%s\x20%s',_0x228c96[_0x4c0b1a],_0x332d('0x12f')));return{'code':0xc8,'result':_0x332d('0x12f')};}else{logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x138'),_0x228c96[_0x4c0b1a],_0x332d('0x130')));this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x138'),_0x228c96[_0x4c0b1a],_0x332d('0x130')));}}return{'code':0xc8,'result':_0x332d('0x130')};};AGIVertices[_0x332d('0xd')][_0x332d('0x139')]=function(_0xa60f52){logger[_0x332d('0x29')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0xa60f52[_0x332d('0x33')]));return this[_0x332d('0xa')][_0x332d('0x139')]();};AGIVertices['prototype']['ispeechasr']=function(_0x30309e){logger['info'](util[_0x332d('0x25')](_0x332d('0x13a'),_0x30309e['label']));if(!this[_0x332d('0x9e')](_0x30309e[_0x332d('0x72')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0xdd'));}var _0x3a89ee=_0x332d('0x11d');var _0x4eafe2=util[_0x332d('0x25')](_0x332d('0x13b'),FILES_PATH,rs['generate'](0x4));var _0x2ea53d=util['format'](_0x332d('0x93'),_0x4eafe2,_0x3a89ee);var _0x493afa=!![];if(_0x30309e['beep']===_0x332d('0x11f')){_0x493afa=![];}var _0x4410e9=this['channel'][_0x332d('0x120')](_0x4eafe2,_0x3a89ee,_0x30309e['intKey'],_0x30309e['timeout'],undefined,_0x493afa);if(_0x4410e9[_0x332d('0x97')]!==-0x1){this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')](_0x332d('0x13c'),_0x2ea53d));var _0x31560e=this[_0x332d('0x7b')][_0x332d('0x67')](this,_0x30309e,_0x2ea53d);if(_0x31560e){for(var _0x57f06d in _0x31560e){if(_0x31560e[_0x332d('0x92')](_0x57f06d)){this[_0x332d('0xa')][_0x332d('0xce')](util['format']('ISPEECH_ASR_%s',_0x57f06d[_0x332d('0x61')]()),_0x31560e[_0x57f06d]);}}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('IspeechASR\x20Result\x20%s',JSON[_0x332d('0x6a')](_0x31560e)));}}return _0x4410e9;};AGIVertices[_0x332d('0xd')][_0x332d('0x13d')]=function(_0x1a6551){logger['info'](util[_0x332d('0x25')](_0x332d('0x13e'),_0x1a6551[_0x332d('0x33')]));if(!this['isConfigured'](_0x1a6551['key'])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20key\x20configured');}if(!this[_0x332d('0x9e')](_0x1a6551['text'])){return this['channel'][_0x332d('0xa3')](_0x332d('0x9f'));}this['channel'][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x13f'),_0x1a6551['text']));var _0xe98284=this['ispeechTTS'][_0x332d('0x67')](this,_0x1a6551);if(_0xe98284){this[_0x332d('0xa')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0xe98284));var _0x163dd4=this['channel']['streamFile'](_0xe98284,_0x1a6551[_0x332d('0x125')]);try{fs[_0x332d('0xf6')](_0xe98284+'.wav');}catch(_0x56d21c){logger[_0x332d('0x27')](_0x56d21c);}return _0x163dd4;}return this['channel'][_0x332d('0x27')](_0x1a6551,_0x332d('0x140'));};AGIVertices[_0x332d('0xd')][_0x332d('0x141')]=function(_0xef2480){logger[_0x332d('0x29')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xef2480['label']));if(!this[_0x332d('0x9e')](_0xef2480[_0x332d('0x142')])){return this[_0x332d('0xa')]['error'](_0xef2480,_0x332d('0x143'));}logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x144'),this[_0x332d('0xa')][_0x332d('0x4a')],_0xef2480['findBy']));var _0x48643d=this[_0x332d('0x4d')][_0x332d('0x67')](this,_0xef2480[_0x332d('0x142')]);if(_0x48643d){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x145'),this[_0x332d('0xa')][_0x332d('0x4a')],_0xef2480['findBy']));this['channel'][_0x332d('0xa3')](util['format'](_0x332d('0x145'),this[_0x332d('0xa')][_0x332d('0x4a')],_0xef2480[_0x332d('0x142')]));return{'code':0xc8,'result':'success'};}else{logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x146'),this['channel']['callerid'],_0xef2480[_0x332d('0x142')]));this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x146'),this[_0x332d('0xa')][_0x332d('0x4a')],_0xef2480['findBy']));return{'code':0xc8,'result':_0x332d('0x147')};}};AGIVertices[_0x332d('0xd')]['logout']=function(_0x3ae824){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x148'),_0x3ae824[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x3ae824['findBy'])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3ae824,'no\x20find\x20by\x20configured');}logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x144'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x3ae824['findBy']));var _0x4ad7e1=this[_0x332d('0x4c')][_0x332d('0x67')](this,_0x3ae824['findBy']);if(_0x4ad7e1){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x145'),this['channel'][_0x332d('0x4a')],_0x3ae824[_0x332d('0x142')]));this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x332d('0xa')][_0x332d('0x4a')],_0x3ae824['findBy']));return{'code':0xc8,'result':_0x332d('0x149')};}else{logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x146'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x3ae824[_0x332d('0x142')]));this['channel'][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x146'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x3ae824['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x332d('0xd')]['math']=function(_0x3ea9d8){logger['info'](util[_0x332d('0x25')](_0x332d('0x14a'),_0x3ea9d8[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x3ea9d8[_0x332d('0x14b')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3ea9d8,'no\x20operation\x20configured');}this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x14c'),_0x3ea9d8[_0x332d('0x14b')]));var _0x4c6332=eval(_0x3ea9d8[_0x332d('0x14b')]);if(!this['isConfigured'](_0x3ea9d8[_0x332d('0xcc')])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x103'));}var _0x7ff9d7=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x3ea9d8[_0x332d('0xcc')]);if(!_0x7ff9d7){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3ea9d8,_0x332d('0xcd'));}if(_[_0x332d('0x8f')](_0x4c6332)){var _0x8759dd=this;_0x4c6332[_0x332d('0x14d')](function(_0x411086,_0x150686){_0x8759dd[_0x332d('0xa')][_0x332d('0xce')](util[_0x332d('0x25')](_0x332d('0x14e'),_0x7ff9d7,_0x150686),_0x411086);});return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x14f'),_0x7ff9d7));}else{return this[_0x332d('0xa')][_0x332d('0xce')](_0x7ff9d7,_0x4c6332);}};AGIVertices[_0x332d('0xd')][_0x332d('0x8')]=function(_0x48bddf){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x150'),_0x48bddf[_0x332d('0x33')]));if(_0x48bddf[_0x332d('0x9b')]===0x0){return this[_0x332d('0x9a')](_0x48bddf);}_0x48bddf[_0x332d('0x9b')]-=0x1;if(!this[_0x332d('0x9e')](_0x48bddf['file_id'])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x48bddf,_0x332d('0x151'));}var _0x340a21=this[_0x332d('0x1b')][_0x332d('0x67')](this,_0x48bddf[_0x332d('0x101')]);if(!_0x340a21){return this[_0x332d('0xa')][_0x332d('0x27')](_0x48bddf,_0x332d('0x102'));}var _0x1c9c58=this[_0x332d('0xa')]['getData'](_0x340a21,_0x48bddf['response'],_0x48bddf['digit']);var _0x59148c=_0x1c9c58[_0x332d('0x97')];if(_0x1c9c58[_0x332d('0x97')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x48bddf,'-1');return _0x1c9c58;}else if(_0x1c9c58['extra']===_0x332d('0x5f')){_0x1c9c58[_0x332d('0x97')]=_0x1c9c58[_0x332d('0x97')][_0x332d('0x90')]>0x0?_0x1c9c58[_0x332d('0x97')]:'t';}else if(_[_0x332d('0x3d')](_0x1c9c58[_0x332d('0x97')])){_0x1c9c58['result']='#';_0x59148c='#';}if(!this['isConfigured'](_0x48bddf[_0x332d('0xcc')])){this[_0x332d('0xa')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x30bda9=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x48bddf[_0x332d('0xcc')]);if(!_0x30bda9){return this[_0x332d('0xa')][_0x332d('0x27')](_0x48bddf,'no\x20variable\x20found');}this[_0x332d('0xa')]['setVariable'](_0x30bda9,_0x59148c);}this[_0x332d('0x31')]['sync'](this,_0x48bddf,_0x59148c);return _0x1c9c58;};AGIVertices['prototype'][_0x332d('0xa3')]=function(_0x1348af){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x152'),_0x1348af['label']));return this[_0x332d('0xa')][_0x332d('0xa3')](_0x1348af['output']||_0x1348af[_0x332d('0x33')]);};AGIVertices[_0x332d('0xd')]['pause']=function(_0x5ad697){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x153'),_0x5ad697[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x5ad697[_0x332d('0x142')])){return this[_0x332d('0xa')]['error'](_0x5ad697,'no\x20find\x20by\x20configured');}logger[_0x332d('0x29')](util[_0x332d('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x332d('0xa')][_0x332d('0x4a')],_0x5ad697['findBy']));var _0xab5d11=this[_0x332d('0x47')][_0x332d('0x67')](this,_0x5ad697['pause_id']);var _0x158cea=this[_0x332d('0x154')][_0x332d('0x67')](this,_0x5ad697[_0x332d('0x142')],_0xab5d11);if(_0x158cea){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x145'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x5ad697[_0x332d('0x142')]));this[_0x332d('0xa')][_0x332d('0xa3')](util['format'](_0x332d('0x145'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x5ad697[_0x332d('0x142')]));return{'code':0xc8,'result':_0x332d('0x149')};}else{logger[_0x332d('0x29')](util[_0x332d('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x332d('0x4a')],_0x5ad697['findBy']));this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x5ad697[_0x332d('0x142')]));return{'code':0xc8,'result':_0x332d('0x147')};}};AGIVertices[_0x332d('0xd')]['playback']=function(_0x5f4def){logger['info'](util['format'](_0x332d('0x155'),_0x5f4def[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x5f4def[_0x332d('0x101')])){return this[_0x332d('0xa')]['error'](_0x5f4def,_0x332d('0x151'));}var _0x36d9c1=this['getSound'][_0x332d('0x67')](this,_0x5f4def[_0x332d('0x101')]);if(!_0x36d9c1){return this[_0x332d('0xa')][_0x332d('0x27')](_0x5f4def,_0x332d('0x102'));}var _0x55a182=this[_0x332d('0xa')][_0x332d('0x50')](_0x332d('0x156'),[_0x36d9c1,_0x5f4def['opts']]);if(_0x55a182[_0x332d('0x97')]===-0x1){return _0x55a182;}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x157'),_0x332d('0x156'),_0x36d9c1));};AGIVertices[_0x332d('0xd')][_0x332d('0x158')]=function(_0x54cdb1){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x54cdb1[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x54cdb1[_0x332d('0x159')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x54cdb1,'no\x20queue\x20selected');}var _0x6a3620='';var _0x2b3e34=parseInt(_0x54cdb1[_0x332d('0x159')],0xa);if(isNaN(_0x2b3e34)){_0x6a3620=_0x54cdb1[_0x332d('0x159')];}else{_0x6a3620=this[_0x332d('0x13')][_0x332d('0x67')](this,_0x54cdb1['queue_id']);if(!_0x6a3620){return this[_0x332d('0xa')][_0x332d('0x27')](_0x54cdb1,_0x332d('0x15a'));}}var _0x3526bd='';if(this[_0x332d('0x9e')](_0x54cdb1[_0x332d('0x101')])){var _0x1fb5d0=this[_0x332d('0x1b')][_0x332d('0x67')](this,_0x54cdb1[_0x332d('0x101')]);if(_0x1fb5d0){_0x3526bd=_0x1fb5d0;}}this[_0x332d('0x31')]['sync'](this,_0x54cdb1,_0x6a3620);if(_0x54cdb1[_0x332d('0xd9')]['indexOf']('x')<0x0){_0x54cdb1['opts']+='x';}if(_0x54cdb1['opts'][_0x332d('0x15b')]('X')<0x0){_0x54cdb1[_0x332d('0xd9')]+='X';}this[_0x332d('0xa')][_0x332d('0xce')](_0x332d('0x15c'),_0x6a3620?_0x6a3620['toLowerCase']():'');var _0x2a1357=this['channel'][_0x332d('0x50')](_0x332d('0x15d'),[_0x6a3620,_0x54cdb1[_0x332d('0xd9')],_0x54cdb1[_0x332d('0x5d')],_0x3526bd,_0x54cdb1[_0x332d('0x5f')],_0x54cdb1[_0x332d('0x5')],_0x54cdb1[_0x332d('0x15e')],_0x54cdb1[_0x332d('0x15f')],'',_0x54cdb1[_0x332d('0x160')]]);if(_0x2a1357[_0x332d('0x97')]===-0x1){return _0x2a1357;}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x157'),_0x332d('0x15d'),_0x6a3620));};AGIVertices[_0x332d('0xd')][_0x332d('0x161')]=function(_0x2849fc){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2849fc['label']));var _0x4c28dd=_0x2849fc[_0x332d('0x162')]||_0x332d('0x11d');var _0x59caac=util[_0x332d('0x25')](_0x332d('0x163'),this[_0x332d('0xa')][_0x332d('0x32')],rs[_0x332d('0x10a')](0x5));var _0x4dbe91=util['format'](_0x332d('0x164'),FILES_PATH,_0x59caac,_0x4c28dd);var _0x4988c8=util[_0x332d('0x25')](_0x332d('0x13b'),FILES_PATH,_0x59caac);this[_0x332d('0x36')][_0x332d('0x67')](this,_0x2849fc,_0x59caac,_0x4dbe91);this[_0x332d('0xa')]['setVariable'](_0x332d('0x165'),_0x59caac);logger[_0x332d('0x29')](_0x332d('0x166'),_0x4988c8,_0x4c28dd,_0x2849fc[_0x332d('0x167')],_0x2849fc[_0x332d('0x5f')]);return this['channel']['recordFile'](_0x4988c8,_0x4c28dd,_0x2849fc['escape_digits'],_0x2849fc[_0x332d('0x5f')],undefined,!![]);};AGIVertices[_0x332d('0xd')][_0x332d('0x168')]=function(_0x2c17c1){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2c17c1[_0x332d('0x33')]));if(!this['isConfigured'](_0x2c17c1[_0x332d('0x5d')])){return this[_0x332d('0xa')]['noop'](_0x332d('0x169'));}var _0x343b17=this[_0x332d('0x5c')]['sync'](this,_0x2c17c1);logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x16a'),util[_0x332d('0x16b')](_0x343b17,{'showHidden':![],'depth':null})));if(!this[_0x332d('0x9e')](_0x2c17c1[_0x332d('0xcc')])){return this[_0x332d('0xa')]['noop'](_0x332d('0x16c'));}var _0x58c82f=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x2c17c1[_0x332d('0xcc')]);if(!_0x58c82f){return this[_0x332d('0xa')][_0x332d('0x27')](_0x2c17c1,_0x332d('0xcd'));}this[_0x332d('0xa')][_0x332d('0xce')](util[_0x332d('0x25')](_0x332d('0x16d'),_0x58c82f),_0x343b17['statusCode']?_0x343b17[_0x332d('0x6d')]:'200');this[_0x332d('0xa')][_0x332d('0xce')](util[_0x332d('0x25')](_0x332d('0x16e'),_0x58c82f),_0x343b17['statusMessage']?_0x343b17['statusMessage']:'OK');if(_0x343b17['body']){try{this[_0x332d('0x91')](_0x343b17[_0x332d('0x6b')],_0x58c82f);}catch(_0x2f3b5c){logger[_0x332d('0x27')](util[_0x332d('0x25')](_0x332d('0x16f'),_0x58c82f));}}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')]('variable\x20%s\x20set',_0x58c82f));};AGIVertices[_0x332d('0xd')]['saydigits']=function(_0x367cbc){logger[_0x332d('0x29')](util['format'](_0x332d('0x170'),_0x367cbc[_0x332d('0x33')]));return this[_0x332d('0xa')][_0x332d('0x171')](_0x367cbc[_0x332d('0x172')]['replace'](/\s+/g,''),_0x367cbc['escape_digits']);};AGIVertices['prototype'][_0x332d('0x173')]=function(_0x1e8b56){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1e8b56[_0x332d('0x33')]));return this[_0x332d('0xa')]['sayNumber'](_0x1e8b56[_0x332d('0x174')]['replace'](/\s+/g,''),_0x1e8b56[_0x332d('0x167')]);};AGIVertices[_0x332d('0xd')][_0x332d('0x175')]=function(_0x4eb156){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4eb156[_0x332d('0x33')]));return this['channel'][_0x332d('0x176')](_0x4eb156['text'],_0x4eb156[_0x332d('0x167')]);};AGIVertices[_0x332d('0xd')]['sendMail']=function(_0x333419){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x177'),_0x333419[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x333419[_0x332d('0x178')])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20mail\x20account\x20configured');}var _0x45b9d6=this[_0x332d('0x179')][_0x332d('0x67')](this,_0x333419['account_id']);if(!_0x45b9d6||!_0x45b9d6[_0x332d('0x17a')]){return this[_0x332d('0xa')]['error'](_0x333419,_0x332d('0x17b'));}var _0x2a30e8={'from':util[_0x332d('0x25')]('\x22%s\x22\x20<%s>',_0x45b9d6[_0x332d('0x11')],_0x45b9d6[_0x332d('0x17c')]||_0x45b9d6[_0x332d('0x17a')][_0x332d('0x17d')]),'to':_0x333419['to']||'','cc':_0x333419['cc']||'','bcc':_0x333419[_0x332d('0x17e')]||'','subject':_0x333419[_0x332d('0x17f')],'html':_0x333419['text'],'text':_0x333419[_0x332d('0x55')]};var _0xf43f97={'tls':{'rejectUnauthorized':![]}};if(_0x45b9d6['Smtp']['service']){_0xf43f97['service']=_0x45b9d6[_0x332d('0x17a')][_0x332d('0x180')];}else{_0xf43f97[_0x332d('0x181')]=_0x45b9d6[_0x332d('0x17a')][_0x332d('0x181')];_0xf43f97[_0x332d('0x182')]=_0x45b9d6[_0x332d('0x17a')][_0x332d('0x182')];_0xf43f97['secure']=_0x45b9d6['Smtp'][_0x332d('0x183')];}if(_0x45b9d6[_0x332d('0x17a')][_0x332d('0x184')]){_0xf43f97['auth']={'user':_0x45b9d6[_0x332d('0x17a')]['user'],'pass':_0x45b9d6[_0x332d('0x17a')][_0x332d('0x185')]};}if(this[_0x332d('0x9e')](_0x333419[_0x332d('0x186')])){}logger['debug'](_0x332d('0x187'),JSON[_0x332d('0x6a')](_0x2a30e8));this[_0x332d('0x31')]['sync'](this,_0x333419,_0x333419['account_id']);this[_0x332d('0xa')][_0x332d('0xa3')](util['format'](_0x332d('0x188'),_0x45b9d6[_0x332d('0x11')]));this[_0x332d('0x20')][_0x332d('0x67')](this,_0xf43f97,_0x2a30e8);return this[_0x332d('0xa')]['noop'](_0x332d('0x189'));};AGIVertices[_0x332d('0xd')][_0x332d('0x18a')]=function(_0x21ad0c){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x21ad0c['label']));return this['channel'][_0x332d('0xa3')](_0x332d('0x18b'));};AGIVertices[_0x332d('0xd')][_0x332d('0x18c')]=function(_0x3ecae9){logger['info'](util[_0x332d('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3ecae9[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x3ecae9[_0x332d('0x18d')])){return this[_0x332d('0xa')][_0x332d('0xa3')]('no\x20sms\x20account\x20configured');}var _0x4a5f7f=this[_0x332d('0x2f')]['sync'](this,_0x3ecae9[_0x332d('0x18d')]);if(!_0x4a5f7f){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3ecae9,_0x332d('0x18e'));}var _0x28d9d5={'body':_0x3ecae9['sms_text'],'phone':_0x3ecae9['to']||'','SmsAccountId':_0x4a5f7f['id']};logger[_0x332d('0xd2')]('sendSMS\x20message',JSON[_0x332d('0x6a')](_0x28d9d5));this[_0x332d('0x31')][_0x332d('0x67')](this,_0x3ecae9,_0x3ecae9[_0x332d('0x18d')]);this['channel'][_0x332d('0xa3')](util['format'](_0x332d('0x18f'),_0x4a5f7f[_0x332d('0x11')]));this[_0x332d('0x30')][_0x332d('0x67')](this,_0x28d9d5);return this['channel'][_0x332d('0xa3')](_0x332d('0x190'));};AGIVertices[_0x332d('0xd')][_0x332d('0x191')]=function(_0x3c1c5d){logger[_0x332d('0x29')](util['format'](_0x332d('0x192'),_0x3c1c5d[_0x332d('0x33')]));if(!this['isConfigured'](_0x3c1c5d[_0x332d('0xcc')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3c1c5d,'no\x20variable\x20selected');}var _0x40aaf2=this['getVariable'][_0x332d('0x67')](this,_0x3c1c5d[_0x332d('0xcc')]);if(!_0x40aaf2){return this[_0x332d('0xa')][_0x332d('0x27')](_0x3c1c5d,_0x332d('0xcd'));}return this[_0x332d('0xa')][_0x332d('0xce')](_0x40aaf2,_0x3c1c5d[_0x332d('0x193')]);};AGIVertices['prototype'][_0x332d('0x194')]=function(_0x50cf96){logger['info'](util[_0x332d('0x25')](_0x332d('0x195'),_0x50cf96['label']));this['channel'][_0x332d('0xa3')](_0x332d('0x196'));if(_0x50cf96['answer']==='yes'){this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x197'));return this['channel'][_0x332d('0x198')]();}return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x199'));};AGIVertices[_0x332d('0xd')][_0x332d('0x19a')]=function(_0x5487b3){logger['info'](util[_0x332d('0x25')](_0x332d('0x19b'),_0x5487b3[_0x332d('0x33')]));if(!this['isConfigured'](_0x5487b3[_0x332d('0x19c')])){return this[_0x332d('0xa')][_0x332d('0x27')](_0x5487b3,'no\x20subproject\x20selected');}var _0x15e241=this['getSquareProject'][_0x332d('0x67')](this,_0x5487b3[_0x332d('0x19c')]);if(!this[_0x332d('0x9e')](_0x15e241)){return this['channel'][_0x332d('0x27')](_0x5487b3,util[_0x332d('0x25')](_0x332d('0x19d'),_0x5487b3[_0x332d('0x19c')]));}if(_0x15e241===this[_0x332d('0xa')]['arg_1']){return this[_0x332d('0xa')][_0x332d('0x27')](_0x5487b3,_0x332d('0x19e'));}this[_0x332d('0x31')][_0x332d('0x67')](this,_0x5487b3,_0x15e241);var _0x3145cf=this[_0x332d('0xa')]['exec'](_0x332d('0x19f'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x332d('0x181')]||'127.0.0.1',_0x15e241,this[_0x332d('0xa')][_0x332d('0x35')]));if(_0x3145cf['result']===-0x1){return _0x3145cf;}return this['channel'][_0x332d('0xa3')](util['format'](_0x332d('0x157'),'AGI',_0x15e241));};AGIVertices[_0x332d('0xd')]['system']=function(_0x402368){logger['info'](util[_0x332d('0x25')](_0x332d('0x1a0'),_0x402368['label']));var _0x2688d3=this['shellCommand'][_0x332d('0x67')](this,_0x402368[_0x332d('0xac')]);this[_0x332d('0x31')][_0x332d('0x67')](this,_0x402368,_0x402368[_0x332d('0xac')]);if(this[_0x332d('0x9e')](_0x402368[_0x332d('0xcc')])){var _0x1c205a=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x402368[_0x332d('0xcc')]);if(_0x1c205a){this['channel'][_0x332d('0xce')](_0x1c205a,_0x2688d3);return this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')](_0x332d('0x1a1'),_0x402368[_0x332d('0xac')],_0x1c205a));}}return this['channel'][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x1a2'),_0x402368[_0x332d('0xac')]));};AGIVertices[_0x332d('0xd')]['google_cloud_tts']=function(_0x54ad2a){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x54ad2a['label']));_0x54ad2a[_0x332d('0x55')]=_0x54ad2a[_0x332d('0x55')][_0x332d('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x332d('0x9e')](_0x54ad2a['apiKey'])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x1a3'));}if(!this[_0x332d('0x9e')](_0x54ad2a['text'])){return this[_0x332d('0xa')]['noop']('no\x20text\x20configured');}this[_0x332d('0xa')]['noop'](util[_0x332d('0x25')](_0x332d('0x1a4'),_0x54ad2a[_0x332d('0x55')]));var _0x579a0d=this[_0x332d('0x1a5')]['sync'](this,_0x54ad2a);if(_0x579a0d){this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x1a6'),_0x579a0d));var _0x1c5dab=this[_0x332d('0xa')][_0x332d('0xf5')](_0x579a0d);try{fs[_0x332d('0xf6')](_0x579a0d+'.wav');}catch(_0x523cb5){logger['error'](_0x523cb5);}return _0x1c5dab;}return this[_0x332d('0xa')][_0x332d('0x27')](_0x54ad2a,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x332d('0xd')][_0x332d('0x1a7')]=function(_0x1eee51){logger[_0x332d('0x29')](util[_0x332d('0x25')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1eee51['label']));_0x1eee51[_0x332d('0x55')]=_0x1eee51[_0x332d('0x55')][_0x332d('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x332d('0x9e')](_0x1eee51['text'])){return this[_0x332d('0xa')][_0x332d('0xa3')](_0x332d('0x9f'));}this[_0x332d('0xa')][_0x332d('0xa3')](util['format'](_0x332d('0x1a8'),_0x1eee51[_0x332d('0x55')]));var _0x1b2ddc=this[_0x332d('0x5a')][_0x332d('0x67')](this,_0x1eee51);if(_0x1b2ddc){this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x1a9'),_0x1b2ddc));var _0x446487=this['channel'][_0x332d('0xf5')](_0x1b2ddc);try{fs[_0x332d('0xf6')](_0x1b2ddc+_0x332d('0xf7'));}catch(_0x57369b){logger[_0x332d('0x27')](_0x57369b);}return _0x446487;}return this['channel'][_0x332d('0x27')](_0x1eee51,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x332d('0x1aa')]=function(_0x5778c4){logger['info'](util[_0x332d('0x25')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5778c4[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x5778c4[_0x332d('0x142')])){return this['channel'][_0x332d('0x27')](_0x5778c4,_0x332d('0x143'));}logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x144'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x5778c4[_0x332d('0x142')]));var _0x4f3ca0=this[_0x332d('0x4b')][_0x332d('0x67')](this,_0x5778c4[_0x332d('0x142')]);if(_0x4f3ca0){logger[_0x332d('0x29')](util[_0x332d('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x332d('0xa')][_0x332d('0x4a')],_0x5778c4[_0x332d('0x142')]));this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x145'),this[_0x332d('0xa')]['callerid'],_0x5778c4[_0x332d('0x142')]));return{'code':0xc8,'result':'success'};}else{logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x146'),this[_0x332d('0xa')][_0x332d('0x4a')],_0x5778c4[_0x332d('0x142')]));this['channel']['noop'](util[_0x332d('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x332d('0x4a')],_0x5778c4[_0x332d('0x142')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x332d('0xd')][_0x332d('0x1ab')]=function(_0x3bd7b8){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x1ac'),_0x3bd7b8[_0x332d('0x33')]));var _0x4e6e9f=this[_0x332d('0xa')]['exec'](_0x332d('0x1ad'),[_0x3bd7b8[_0x332d('0x1ae')],_0x3bd7b8['options']]);if(_0x4e6e9f[_0x332d('0x97')]===-0x1){return _0x4e6e9f;}return this[_0x332d('0xa')][_0x332d('0xa3')](util[_0x332d('0x25')](_0x332d('0x157'),'VOICEMAIL',_0x3bd7b8['mailbox']));};AGIVertices[_0x332d('0xd')][_0x332d('0x1af')]=function(_0x511afd){logger[_0x332d('0x29')](util[_0x332d('0x25')](_0x332d('0x1b0'),_0x511afd[_0x332d('0x33')]));if(!this[_0x332d('0x9e')](_0x511afd[_0x332d('0xcc')])){return this['channel'][_0x332d('0x27')](_0x511afd,_0x332d('0x1b1'));}var _0x308726=this[_0x332d('0xe')][_0x332d('0x67')](this,_0x511afd[_0x332d('0xcc')]);if(!_0x308726){return this['channel']['error'](_0x511afd,_0x332d('0xcd'));}var _0x5ba154=this[_0x332d('0xa')][_0x332d('0xe')](_0x308726);return{'code':0xc8,'result':_0x5ba154['extra']?_0x5ba154[_0x332d('0x99')]:'-'};};String[_0x332d('0xd')][_0x332d('0x95')]=function(_0x2bf17d,_0x45fa02){return this[_0x332d('0x94')](_0x2bf17d)[_0x332d('0x1b2')](_0x45fa02);};module[_0x332d('0x1b3')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index e22618b..f8064ed 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 _0xbb64=['secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','util','lodash','../ami','../rpc/user','agents','timers','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','catch','[ACW][TIMERS]','stringify','message','acw','[ACW][syncAgentConnect]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0xbb64,0x194));var _0x4bb6=function(_0x5e04b4,_0x36c1b7){_0x5e04b4=_0x5e04b4-0x0;var _0x4f34fd=_0xbb64[_0x5e04b4];return _0x4f34fd;};'use strict';var util=require(_0x4bb6('0x0'));var _=require(_0x4bb6('0x1'));var moment=require('moment');var ami=require(_0x4bb6('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x4bb6('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x30f871){this['voiceQueues']=_0x30f871['voiceQueues'];this[_0x4bb6('0x4')]=_0x30f871[_0x4bb6('0x4')];this['timers']=_0x30f871[_0x4bb6('0x5')];this['channels']={};ami['on'](_0x4bb6('0x6'),this[_0x4bb6('0x7')][_0x4bb6('0x8')](this));ami['on']('hanguprequest',this[_0x4bb6('0x9')][_0x4bb6('0x8')](this));ami['on'](_0x4bb6('0xa'),this['syncHangup'][_0x4bb6('0x8')](this));ami['on']('agentringnoanswer',this[_0x4bb6('0xb')][_0x4bb6('0x8')](this));ami['on']('attendedtransfer',this[_0x4bb6('0xc')][_0x4bb6('0x8')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x4bb6('0x8')](this));ami['on'](_0x4bb6('0xd'),this[_0x4bb6('0xe')][_0x4bb6('0x8')](this));}function getDiff(_0x4a418c){var _0x3be346=moment()[_0x4bb6('0xf')](0x0);var _0x338771=moment(_0x4a418c)['milliseconds'](0x0);return _0x3be346[_0x4bb6('0x10')](_0x338771,_0x4bb6('0x11'));}Acw[_0x4bb6('0x12')][_0x4bb6('0x13')]=function(_0x134c39){try{var _0x2d4f1c=this;var _0x52e460=this[_0x4bb6('0x14')][_0x134c39][_0x4bb6('0x15')];var _0x4847e7=this['channels'][_0x134c39]['queue'];var _0x5d7969=this[_0x4bb6('0x16')][_0x4847e7];var _0x5999d4=![];var _0x150378=_0x4bb6('0x17');if(_0x5d7969[_0x4bb6('0x18')]){if(_0x5d7969[_0x4bb6('0x19')][_0x4bb6('0x1a')]){_0x5999d4=!![];_0x150378=_0x5d7969[_0x4bb6('0x19')]['name'];}}ami[_0x4bb6('0x1b')]({'action':_0x4bb6('0x1c'),'interface':_0x52e460,'paused':!![],'reason':_0x150378})['then'](function(_0x4c1ded){if(_0x2d4f1c[_0x4bb6('0x4')][_0x52e460]){return RpcUser[_0x4bb6('0x1d')](_0x2d4f1c[_0x4bb6('0x4')][_0x52e460]['id'])[_0x4bb6('0x1e')](function(_0x32db6b){if(_0x32db6b&&!_0x32db6b['voicePause']){logger[_0x4bb6('0x1f')](_0x4bb6('0x20'),_0x134c39,_0x52e460,_0x4847e7);var _0x561894=_0x2d4f1c[_0x4bb6('0x14')][_0x134c39][_0x4bb6('0x21')]&&_0x2d4f1c['channels'][_0x134c39][_0x4bb6('0x22')]?_0x2d4f1c[_0x4bb6('0x14')][_0x134c39][_0x4bb6('0x22')]:_0x134c39;return RpcUser['savePause'](_0x2d4f1c[_0x4bb6('0x4')][_0x52e460],_0x150378,_0x561894)[_0x4bb6('0x1e')](function(_0x1d797e){if(!_0x5999d4){_0x2d4f1c[_0x4bb6('0x5')][_0x52e460]={};logger[_0x4bb6('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x134c39,_0x2d4f1c[_0x4bb6('0x16')][_0x4847e7][_0x4bb6('0x23')],_0x52e460,_0x4847e7);_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x24')]=setTimeout(_0x2d4f1c[_0x4bb6('0x25')]['bind'](_0x2d4f1c,_0x52e460),_0x2d4f1c['voiceQueues'][_0x4847e7]['acwTimeout']*0x3e8);_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x26')]=moment()[_0x4bb6('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x28')]=_0x134c39;_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x29')]=_0x4847e7;_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x2a')]=function(){var _0x911579=getDiff(_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x26')]);clearTimeout(_0x2d4f1c[_0x4bb6('0x5')][_0x52e460]['timer']);_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x24')]=![];RpcVoiceAgentReport[_0x4bb6('0x2b')]({'acwtime':_0x911579},_0x2d4f1c[_0x4bb6('0x5')][_0x52e460][_0x4bb6('0x28')],_0x52e460)[_0x4bb6('0x1e')](function(_0xf5c72b){logger['info'](_0x4bb6('0x2c'),_0x134c39,_0x911579,_0xf5c72b);})['catch'](function(_0x4ad80c){logger[_0x4bb6('0x2d')](_0x4bb6('0x2e'),_0x134c39,_0x4ad80c);});delete _0x2d4f1c['timers'][_0x52e460];};}});}else{logger[_0x4bb6('0x1f')](_0x4bb6('0x2f'),_0x134c39,_0x52e460,_0x4847e7);}});}})['catch'](function(_0x39cd5b){logger['error'](_0x4bb6('0x30'),_0x134c39,_0x2d4f1c[_0x4bb6('0x16')][_0x4847e7]['acwTimeout'],_0x52e460,_0x4847e7);})['finally'](function(){delete _0x2d4f1c['channels'][_0x134c39];});}catch(_0x508d0e){logger[_0x4bb6('0x2d')](_0x4bb6('0x31'),_0x508d0e['message']);}};Acw[_0x4bb6('0x12')][_0x4bb6('0x25')]=function(_0x59233c){try{var _0xf14208=this;if(_0xf14208[_0x4bb6('0x5')][_0x59233c]){_0xf14208[_0x4bb6('0x5')][_0x59233c]['timer']=![];var _0x1fb8cb=_0xf14208[_0x4bb6('0x5')][_0x59233c][_0x4bb6('0x28')];var _0x7f19db=_0xf14208[_0x4bb6('0x5')][_0x59233c]['queue'];var _0x4aa480=_0xf14208[_0x4bb6('0x16')][_0x7f19db]['acwTimeout'];logger[_0x4bb6('0x1f')]('[%s][TIMER][STOP][AGENT:%s]',_0x1fb8cb,_0x59233c);RpcUser['saveUnpause'](this[_0x4bb6('0x4')][_0x59233c]);RpcVoiceAgentReport[_0x4bb6('0x2b')]({'acwtime':_0x4aa480,'agentacw':!![]},_0x1fb8cb,_0x59233c)[_0x4bb6('0x1e')](function(_0x2c8891){logger[_0x4bb6('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x1fb8cb,_0x4aa480,_0x2c8891);})[_0x4bb6('0x32')](function(_0x1ba611){logger['error'](_0x4bb6('0x2e'),_0x1fb8cb,_0x1ba611);});}else{logger[_0x4bb6('0x2d')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x59233c);if(_0xf14208[_0x4bb6('0x5')]){logger[_0x4bb6('0x1f')](_0x4bb6('0x33'),JSON[_0x4bb6('0x34')](_0xf14208[_0x4bb6('0x5')]));}}}catch(_0xddb8fd){logger['error']('[ACW][STOP]\x20%s',_0xddb8fd[_0x4bb6('0x35')]);}};Acw['prototype'][_0x4bb6('0x7')]=function(_0x2a42d4){try{if(this['voiceQueues'][_0x2a42d4[_0x4bb6('0x29')]]&&(this[_0x4bb6('0x16')][_0x2a42d4[_0x4bb6('0x29')]][_0x4bb6('0x36')]||this[_0x4bb6('0x16')][_0x2a42d4[_0x4bb6('0x29')]][_0x4bb6('0x18')])){if(this[_0x4bb6('0x4')][_0x2a42d4[_0x4bb6('0x15')]]){this['channels'][_0x2a42d4[_0x4bb6('0x28')]]={'queue':_0x2a42d4[_0x4bb6('0x29')],'interface':_0x2a42d4['interface'],'destlinkedid':_0x2a42d4[_0x4bb6('0x22')]};}}}catch(_0x5badea){logger[_0x4bb6('0x2d')](_0x4bb6('0x37'),_0x5badea[_0x4bb6('0x35')]);}};Acw[_0x4bb6('0x12')][_0x4bb6('0xe')]=function(_0x11df55){try{if(this[_0x4bb6('0x16')][_0x11df55[_0x4bb6('0x29')]]&&(this[_0x4bb6('0x16')][_0x11df55[_0x4bb6('0x29')]]['acw']||this[_0x4bb6('0x16')][_0x11df55[_0x4bb6('0x29')]][_0x4bb6('0x18')])){if(this[_0x4bb6('0x4')][_0x11df55[_0x4bb6('0x15')]]){this[_0x4bb6('0x14')][_0x11df55['uniqueid']]={'queue':_0x11df55['queue'],'interface':_0x11df55[_0x4bb6('0x15')]};}}}catch(_0x219364){logger[_0x4bb6('0x2d')]('[ACW][syncAgentConnectPreview]\x20%s',_0x219364['message']);}};Acw[_0x4bb6('0x12')][_0x4bb6('0x9')]=function(_0x12b04d){try{if(this[_0x4bb6('0x14')][_0x12b04d[_0x4bb6('0x28')]]&&_['isUndefined'](this[_0x4bb6('0x14')][_0x12b04d[_0x4bb6('0x28')]][_0x4bb6('0x21')])){logger[_0x4bb6('0x1f')](_0x4bb6('0x38'),_0x12b04d['uniqueid']);this['startAcw'](_0x12b04d[_0x4bb6('0x28')]);}else if(this[_0x4bb6('0x14')][_0x12b04d[_0x4bb6('0x39')]]&&_[_0x4bb6('0x3a')](this[_0x4bb6('0x14')][_0x12b04d[_0x4bb6('0x39')]]['attended'])){logger[_0x4bb6('0x1f')]('[%s][HANGUP:LINKEDID]',_0x12b04d[_0x4bb6('0x39')]);this['startAcw'](_0x12b04d[_0x4bb6('0x39')]);}}catch(_0x75ba39){logger[_0x4bb6('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x75ba39[_0x4bb6('0x35')]);}};Acw[_0x4bb6('0x12')][_0x4bb6('0x3b')]=function(_0x1b0f57){try{if(this[_0x4bb6('0x14')][_0x1b0f57[_0x4bb6('0x28')]]&&this[_0x4bb6('0x14')][_0x1b0f57['uniqueid']][_0x4bb6('0x21')]){logger[_0x4bb6('0x1f')](_0x4bb6('0x3c'),_0x1b0f57[_0x4bb6('0x28')]);this[_0x4bb6('0x13')](_0x1b0f57[_0x4bb6('0x28')]);}else if(this['channels'][_0x1b0f57['linkedid']]&&this['channels'][_0x1b0f57[_0x4bb6('0x39')]][_0x4bb6('0x21')]){logger[_0x4bb6('0x1f')](_0x4bb6('0x3d'),_0x1b0f57[_0x4bb6('0x39')]);this[_0x4bb6('0x13')](_0x1b0f57[_0x4bb6('0x39')]);}}catch(_0x28cdb3){logger[_0x4bb6('0x2d')](_0x4bb6('0x3e'),_0x28cdb3[_0x4bb6('0x35')]);}};Acw[_0x4bb6('0x12')]['syncAttendedTransfer']=function(_0x2690b1){try{if(!_['isNil'](this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x3f')]])){this[_0x4bb6('0x13')](_0x2690b1['transfereeuniqueid']);if(this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x40')]]){this[_0x4bb6('0x14')][_0x2690b1['secondtransfereruniqueid']][_0x4bb6('0x21')]=!![];this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x41')]]=this[_0x4bb6('0x14')][_0x2690b1['secondtransfereruniqueid']];delete this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x40')]];}}else if(!_[_0x4bb6('0x42')](this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x41')]])){this[_0x4bb6('0x13')](_0x2690b1[_0x4bb6('0x41')]);if(this[_0x4bb6('0x14')][_0x2690b1['origtransfereruniqueid']]){this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x43')]]['attended']=!![];this[_0x4bb6('0x14')][_0x2690b1[_0x4bb6('0x3f')]]=this['channels'][_0x2690b1[_0x4bb6('0x43')]];delete this['channels'][_0x2690b1[_0x4bb6('0x43')]];}}}catch(_0x2e472e){logger[_0x4bb6('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x2e472e[_0x4bb6('0x35')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x6fec2b){try{if(this[_0x4bb6('0x14')][_0x6fec2b[_0x4bb6('0x44')]]){logger[_0x4bb6('0x1f')](_0x4bb6('0x45'),JSON[_0x4bb6('0x34')](_0x6fec2b['transfereruniqueid']));this[_0x4bb6('0x13')](_0x6fec2b[_0x4bb6('0x44')]);}else if(this['channels'][_0x6fec2b['transfererlinkedid']]){logger[_0x4bb6('0x1f')](_0x4bb6('0x46'),JSON[_0x4bb6('0x34')](_0x6fec2b[_0x4bb6('0x47')]));this[_0x4bb6('0x13')](_0x6fec2b[_0x4bb6('0x47')]);}}catch(_0x262ad2){logger[_0x4bb6('0x2d')](_0x4bb6('0x48'),_0x262ad2['message']);}};Acw[_0x4bb6('0x12')][_0x4bb6('0xb')]=function(_0x18e812){try{if(this['voiceQueues'][_0x18e812['queue']]&&this[_0x4bb6('0x16')][_0x18e812[_0x4bb6('0x29')]][_0x4bb6('0x49')]===_0x4bb6('0x4a')){if(this['agents'][_0x18e812[_0x4bb6('0x15')]]){logger['info'](_0x4bb6('0x4b'),_0x18e812[_0x4bb6('0x28')],_0x18e812['interface'],_0x18e812[_0x4bb6('0x29')]);return RpcUser[_0x4bb6('0x4c')](this[_0x4bb6('0x4')][_0x18e812['interface']],_0x4bb6('0x4d'),_0x18e812[_0x4bb6('0x28')]);}}}catch(_0x509816){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x509816[_0x4bb6('0x35')]);}};module['exports']=Acw; \ No newline at end of file +var _0x20a6=['origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','voiceQueues','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','catch','[ACW][START]\x20%s','message','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid'];(function(_0x18711e,_0x1c6f70){var _0xdae331=function(_0x2cbf76){while(--_0x2cbf76){_0x18711e['push'](_0x18711e['shift']());}};_0xdae331(++_0x1c6f70);}(_0x20a6,0x1be));var _0x620a=function(_0x41949b,_0x395cad){_0x41949b=_0x41949b-0x0;var _0x368551=_0x20a6[_0x41949b];return _0x368551;};'use strict';var util=require(_0x620a('0x0'));var _=require(_0x620a('0x1'));var moment=require(_0x620a('0x2'));var ami=require(_0x620a('0x3'));var logger=require(_0x620a('0x4'))('acw');var RpcUser=require(_0x620a('0x5'));var RpcVoiceAgentReport=require(_0x620a('0x6'));function Acw(_0x105329){this['voiceQueues']=_0x105329['voiceQueues'];this[_0x620a('0x7')]=_0x105329[_0x620a('0x7')];this[_0x620a('0x8')]=_0x105329[_0x620a('0x8')];this[_0x620a('0x9')]={};ami['on'](_0x620a('0xa'),this[_0x620a('0xb')][_0x620a('0xc')](this));ami['on'](_0x620a('0xd'),this[_0x620a('0xe')][_0x620a('0xc')](this));ami['on'](_0x620a('0xf'),this[_0x620a('0x10')][_0x620a('0xc')](this));ami['on'](_0x620a('0x11'),this[_0x620a('0x12')][_0x620a('0xc')](this));ami['on'](_0x620a('0x13'),this['syncAttendedTransfer'][_0x620a('0xc')](this));ami['on']('blindtransfer',this[_0x620a('0x14')]['bind'](this));ami['on'](_0x620a('0x15'),this[_0x620a('0x16')][_0x620a('0xc')](this));}function getDiff(_0x44c557){var _0x150ec0=moment()[_0x620a('0x17')](0x0);var _0x29877b=moment(_0x44c557)[_0x620a('0x17')](0x0);return _0x150ec0['diff'](_0x29877b,_0x620a('0x18'));}Acw[_0x620a('0x19')][_0x620a('0x1a')]=function(_0x38ecf1){try{var _0x192617=this;var _0x595e47=this['channels'][_0x38ecf1][_0x620a('0x1b')];var _0x3c380c=this[_0x620a('0x9')][_0x38ecf1][_0x620a('0x1c')];var _0x206ee0=this[_0x620a('0x1d')][_0x3c380c];var _0x3fa19b=![];var _0x5d5e8c=_0x620a('0x1e');if(_0x206ee0[_0x620a('0x1f')]){if(_0x206ee0['mandatoryDispositionPause'][_0x620a('0x20')]){_0x3fa19b=!![];_0x5d5e8c=_0x206ee0[_0x620a('0x21')][_0x620a('0x20')];}}ami[_0x620a('0x22')]({'action':'QueuePause','interface':_0x595e47,'paused':!![],'reason':_0x5d5e8c})[_0x620a('0x23')](function(_0x2c68c5){if(_0x192617[_0x620a('0x7')][_0x595e47]){return RpcUser[_0x620a('0x24')](_0x192617['agents'][_0x595e47]['id'])[_0x620a('0x23')](function(_0x42eb06){if(_0x42eb06&&!_0x42eb06['voicePause']){logger[_0x620a('0x25')](_0x620a('0x26'),_0x38ecf1,_0x595e47,_0x3c380c);var _0x48e19f=_0x192617[_0x620a('0x9')][_0x38ecf1][_0x620a('0x27')]&&_0x192617[_0x620a('0x9')][_0x38ecf1]['destlinkedid']?_0x192617[_0x620a('0x9')][_0x38ecf1][_0x620a('0x28')]:_0x38ecf1;return RpcUser[_0x620a('0x29')](_0x192617[_0x620a('0x7')][_0x595e47],_0x5d5e8c,_0x48e19f)['then'](function(_0xb78696){if(!_0x3fa19b){_0x192617[_0x620a('0x8')][_0x595e47]={};logger[_0x620a('0x25')](_0x620a('0x2a'),_0x38ecf1,_0x192617[_0x620a('0x1d')][_0x3c380c][_0x620a('0x2b')],_0x595e47,_0x3c380c);_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x2c')]=setTimeout(_0x192617[_0x620a('0x2d')][_0x620a('0xc')](_0x192617,_0x595e47),_0x192617['voiceQueues'][_0x3c380c]['acwTimeout']*0x3e8);_0x192617['timers'][_0x595e47][_0x620a('0x2e')]=moment()[_0x620a('0x2f')](_0x620a('0x30'));_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x31')]=_0x38ecf1;_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x1c')]=_0x3c380c;_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x32')]=function(){var _0x4a4bb0=getDiff(_0x192617[_0x620a('0x8')][_0x595e47]['lastPauseAt']);clearTimeout(_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x2c')]);_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x2c')]=![];RpcVoiceAgentReport[_0x620a('0x33')]({'acwtime':_0x4a4bb0},_0x192617[_0x620a('0x8')][_0x595e47][_0x620a('0x31')],_0x595e47)[_0x620a('0x23')](function(_0x3a1229){logger['info'](_0x620a('0x34'),_0x38ecf1,_0x4a4bb0,_0x3a1229);})['catch'](function(_0x1e912f){logger[_0x620a('0x35')](_0x620a('0x36'),_0x38ecf1,_0x1e912f);});delete _0x192617['timers'][_0x595e47];};}});}else{logger[_0x620a('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x38ecf1,_0x595e47,_0x3c380c);}});}})[_0x620a('0x37')](function(_0x458ea4){logger[_0x620a('0x35')](_0x620a('0x2a'),_0x38ecf1,_0x192617[_0x620a('0x1d')][_0x3c380c][_0x620a('0x2b')],_0x595e47,_0x3c380c);})['finally'](function(){delete _0x192617[_0x620a('0x9')][_0x38ecf1];});}catch(_0x24b47c){logger['error'](_0x620a('0x38'),_0x24b47c[_0x620a('0x39')]);}};Acw[_0x620a('0x19')][_0x620a('0x2d')]=function(_0x38392d){try{var _0x3e0a7b=this;if(_0x3e0a7b[_0x620a('0x8')][_0x38392d]){_0x3e0a7b[_0x620a('0x8')][_0x38392d]['timer']=![];var _0x490d14=_0x3e0a7b['timers'][_0x38392d]['uniqueid'];var _0x185173=_0x3e0a7b[_0x620a('0x8')][_0x38392d][_0x620a('0x1c')];var _0x10c7a2=_0x3e0a7b[_0x620a('0x1d')][_0x185173][_0x620a('0x2b')];logger[_0x620a('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x490d14,_0x38392d);RpcUser['saveUnpause'](this['agents'][_0x38392d]);RpcVoiceAgentReport[_0x620a('0x33')]({'acwtime':_0x10c7a2,'agentacw':!![]},_0x490d14,_0x38392d)[_0x620a('0x23')](function(_0x1245a9){logger['info'](_0x620a('0x34'),_0x490d14,_0x10c7a2,_0x1245a9);})['catch'](function(_0x4ae2bc){logger[_0x620a('0x35')](_0x620a('0x36'),_0x490d14,_0x4ae2bc);});}else{logger[_0x620a('0x35')](_0x620a('0x3a'),_0x38392d);if(_0x3e0a7b[_0x620a('0x8')]){logger[_0x620a('0x25')](_0x620a('0x3b'),JSON['stringify'](_0x3e0a7b[_0x620a('0x8')]));}}}catch(_0x5648ea){logger[_0x620a('0x35')](_0x620a('0x3c'),_0x5648ea[_0x620a('0x39')]);}};Acw[_0x620a('0x19')]['syncAgentConnect']=function(_0x1d595d){try{if(this[_0x620a('0x1d')][_0x1d595d['queue']]&&(this[_0x620a('0x1d')][_0x1d595d['queue']][_0x620a('0x3d')]||this[_0x620a('0x1d')][_0x1d595d['queue']][_0x620a('0x1f')])){if(this[_0x620a('0x7')][_0x1d595d['interface']]){this[_0x620a('0x9')][_0x1d595d[_0x620a('0x31')]]={'queue':_0x1d595d[_0x620a('0x1c')],'interface':_0x1d595d[_0x620a('0x1b')],'destlinkedid':_0x1d595d['destlinkedid']};}}}catch(_0x25bac9){logger[_0x620a('0x35')](_0x620a('0x3e'),_0x25bac9[_0x620a('0x39')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x3085e1){try{if(this['voiceQueues'][_0x3085e1[_0x620a('0x1c')]]&&(this[_0x620a('0x1d')][_0x3085e1[_0x620a('0x1c')]]['acw']||this[_0x620a('0x1d')][_0x3085e1[_0x620a('0x1c')]][_0x620a('0x1f')])){if(this[_0x620a('0x7')][_0x3085e1['interface']]){this[_0x620a('0x9')][_0x3085e1[_0x620a('0x31')]]={'queue':_0x3085e1[_0x620a('0x1c')],'interface':_0x3085e1[_0x620a('0x1b')]};}}}catch(_0x3c2bd3){logger[_0x620a('0x35')](_0x620a('0x3f'),_0x3c2bd3[_0x620a('0x39')]);}};Acw[_0x620a('0x19')][_0x620a('0xe')]=function(_0x49404f){try{if(this[_0x620a('0x9')][_0x49404f[_0x620a('0x31')]]&&_[_0x620a('0x40')](this[_0x620a('0x9')][_0x49404f[_0x620a('0x31')]][_0x620a('0x27')])){logger[_0x620a('0x25')](_0x620a('0x41'),_0x49404f[_0x620a('0x31')]);this[_0x620a('0x1a')](_0x49404f[_0x620a('0x31')]);}else if(this[_0x620a('0x9')][_0x49404f[_0x620a('0x42')]]&&_[_0x620a('0x40')](this['channels'][_0x49404f['linkedid']][_0x620a('0x27')])){logger['info'](_0x620a('0x43'),_0x49404f[_0x620a('0x42')]);this[_0x620a('0x1a')](_0x49404f['linkedid']);}}catch(_0x5dc596){logger[_0x620a('0x35')]('[ACW][syncHangupRequest]\x20%s',_0x5dc596['message']);}};Acw[_0x620a('0x19')][_0x620a('0x10')]=function(_0x2073bc){try{if(this['channels'][_0x2073bc[_0x620a('0x31')]]&&this[_0x620a('0x9')][_0x2073bc['uniqueid']][_0x620a('0x27')]){logger[_0x620a('0x25')](_0x620a('0x44'),_0x2073bc[_0x620a('0x31')]);this[_0x620a('0x1a')](_0x2073bc['uniqueid']);}else if(this[_0x620a('0x9')][_0x2073bc[_0x620a('0x42')]]&&this[_0x620a('0x9')][_0x2073bc[_0x620a('0x42')]][_0x620a('0x27')]){logger[_0x620a('0x25')](_0x620a('0x45'),_0x2073bc[_0x620a('0x42')]);this[_0x620a('0x1a')](_0x2073bc[_0x620a('0x42')]);}}catch(_0x198435){logger['error'](_0x620a('0x46'),_0x198435[_0x620a('0x39')]);}};Acw[_0x620a('0x19')][_0x620a('0x47')]=function(_0x548b0b){try{if(!_[_0x620a('0x48')](this[_0x620a('0x9')][_0x548b0b[_0x620a('0x49')]])){this['startAcw'](_0x548b0b['transfereeuniqueid']);if(this[_0x620a('0x9')][_0x548b0b[_0x620a('0x4a')]]){this[_0x620a('0x9')][_0x548b0b[_0x620a('0x4a')]][_0x620a('0x27')]=!![];this[_0x620a('0x9')][_0x548b0b[_0x620a('0x4b')]]=this[_0x620a('0x9')][_0x548b0b[_0x620a('0x4a')]];delete this[_0x620a('0x9')][_0x548b0b['secondtransfereruniqueid']];}}else if(!_[_0x620a('0x48')](this['channels'][_0x548b0b[_0x620a('0x4b')]])){this['startAcw'](_0x548b0b['transfertargetuniqueid']);if(this[_0x620a('0x9')][_0x548b0b['origtransfereruniqueid']]){this['channels'][_0x548b0b[_0x620a('0x4c')]]['attended']=!![];this[_0x620a('0x9')][_0x548b0b[_0x620a('0x49')]]=this[_0x620a('0x9')][_0x548b0b[_0x620a('0x4c')]];delete this[_0x620a('0x9')][_0x548b0b[_0x620a('0x4c')]];}}}catch(_0x294071){logger[_0x620a('0x35')](_0x620a('0x4d'),_0x294071[_0x620a('0x39')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x2aff33){try{if(this[_0x620a('0x9')][_0x2aff33[_0x620a('0x4e')]]){logger[_0x620a('0x25')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x620a('0x4f')](_0x2aff33['transfereruniqueid']));this['startAcw'](_0x2aff33['transfereruniqueid']);}else if(this[_0x620a('0x9')][_0x2aff33[_0x620a('0x50')]]){logger[_0x620a('0x25')](_0x620a('0x51'),JSON[_0x620a('0x4f')](_0x2aff33[_0x620a('0x50')]));this[_0x620a('0x1a')](_0x2aff33[_0x620a('0x50')]);}}catch(_0x399e1f){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x399e1f[_0x620a('0x39')]);}};Acw[_0x620a('0x19')]['syncAgentRingNoAnswer']=function(_0x1b038b){try{if(this[_0x620a('0x1d')][_0x1b038b[_0x620a('0x1c')]]&&this[_0x620a('0x1d')][_0x1b038b[_0x620a('0x1c')]][_0x620a('0x52')]===_0x620a('0x53')){if(this[_0x620a('0x7')][_0x1b038b[_0x620a('0x1b')]]){logger[_0x620a('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1b038b[_0x620a('0x31')],_0x1b038b[_0x620a('0x1b')],_0x1b038b[_0x620a('0x1c')]);return RpcUser[_0x620a('0x29')](this[_0x620a('0x7')][_0x1b038b['interface']],_0x620a('0x54'),_0x1b038b[_0x620a('0x31')]);}}}catch(_0x5f4ea7){logger[_0x620a('0x35')](_0x620a('0x55'),_0x5f4ea7['message']);}};module[_0x620a('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 624a65b..9910308 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(_0x5684c0,_0x12d9b4){var _0x68372e=function(_0x5e3aa4){while(--_0x5e3aa4){_0x5684c0['push'](_0x5684c0['shift']());}};_0x68372e(++_0x12d9b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x3a8ad9,_0x188d3c){_0x3a8ad9=_0x3a8ad9-0x0;var _0x112446=_0x2032[_0x3a8ad9];return _0x112446;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index afbfcfc..ed818e0 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 _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x4cecde,_0x57bbb2){var _0x2f63a2=function(_0x424658){while(--_0x424658){_0x4cecde['push'](_0x4cecde['shift']());}};_0x2f63a2(++_0x57bbb2);}(_0xaa88,0x137));var _0x8aa8=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xaa88[_0x372515];return _0xa3bf4e;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xcb91[_0x19d350];return _0x3bfc8d;};'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 28fe82e..63dea63 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 _0x1c03=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','substring','dialCutDigit','prototype','queue','exports','util','isNil','string','voiceQueue','uniqueid','phone','Contact','firstName','lastName','number','name','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4a423e,_0x59ba7b){var _0x4ad91f=function(_0x55e261){while(--_0x55e261){_0x4a423e['push'](_0x4a423e['shift']());}};_0x4ad91f(++_0x59ba7b);}(_0x1c03,0xcf));var _0x31c0=function(_0x34750b,_0x34aae5){_0x34750b=_0x34750b-0x0;var _0x244258=_0x1c03[_0x34750b];return _0x244258;};'use strict';var util=require(_0x31c0('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x2f5c4d,_0x1ae181,_0x58c73){var _0x65685='';if(!_[_0x31c0('0x1')](_0x1ae181)&&_0x31c0('0x2')===typeof _0x1ae181){_0x65685+=_0x1ae181;}if(!_[_0x31c0('0x1')](_0x58c73)&&'string'===typeof _0x58c73){_0x65685+='\x20'+_0x58c73;}if(_0x65685!==''){return _0x65685;}return _0x2f5c4d;}function Action(_0x358670,_0x548e65,_0x523a5e){this[_0x31c0('0x3')]=_0x358670;this[_0x31c0('0x4')]=_0x523a5e||undefined;this['name']=checkNameSurname(_0x548e65['Contact'][_0x31c0('0x5')],_0x548e65[_0x31c0('0x6')][_0x31c0('0x7')],_0x548e65[_0x31c0('0x6')][_0x31c0('0x8')]);this[_0x31c0('0x9')]=_0x548e65[_0x31c0('0x6')]['phone'];this['queue']=_0x358670[_0x31c0('0xa')];this['active']=_0x548e65['active']||![];this['type']=_0x358670['type'];this[_0x31c0('0xb')]=_0x358670[_0x31c0('0xb')]||0x3;this['scheduledat']=_0x548e65['scheduledat'];this[_0x31c0('0xc')]=_0x548e65[_0x31c0('0xc')];this[_0x31c0('0xd')]=_0x548e65[_0x31c0('0xd')];this[_0x31c0('0xe')]=_0x548e65['countnoanswerretry'];this['countnosuchnumberretry']=_0x548e65[_0x31c0('0xf')];this[_0x31c0('0x10')]=_0x548e65[_0x31c0('0x10')];this[_0x31c0('0x11')]=_0x548e65[_0x31c0('0x11')];this[_0x31c0('0x12')]=_0x548e65[_0x31c0('0x12')];this[_0x31c0('0x13')]=_0x548e65[_0x31c0('0x13')];this['ContactId']=_0x548e65[_0x31c0('0x14')];this[_0x31c0('0x15')]=_0x548e65[_0x31c0('0x15')];this['UserId']=_0x548e65['UserId'];this[_0x31c0('0x16')]=_0x548e65[_0x31c0('0x16')];this[_0x31c0('0x17')]=_0x548e65[_0x31c0('0x17')];this[_0x31c0('0x18')]=_0x548e65['id'];this[_0x31c0('0x19')]=_0x548e65[_0x31c0('0x6')]['firstName']||'';this['starttime']=moment()[_0x31c0('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x31c0('0x1b')]=_0x548e65[_0x31c0('0x1b')];this['callbackuniqueid']=_0x548e65['callbackuniqueid'];this[_0x31c0('0x1c')]=_0x548e65['callbackat'];this[_0x31c0('0x1d')]=_0x548e65['recallme'];this[_0x31c0('0x1e')]='';this[_0x31c0('0x1f')]='';}Action['prototype']['getCaller']=function(){return util[_0x31c0('0x1a')]('\x22%s\x22\x20<%s>',this[_0x31c0('0xa')],this[_0x31c0('0x3')]['dialCutDigit']>0x0?this[_0x31c0('0x9')][_0x31c0('0x20')](this[_0x31c0('0x3')][_0x31c0('0x21')]):this['number']);};Action[_0x31c0('0x22')]['getQueue']=function(){return this[_0x31c0('0x23')];};module[_0x31c0('0x24')]=Action; \ No newline at end of file +var _0x3946=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x38daa5,_0x1c2e49){var _0xca4d98=function(_0x227364){while(--_0x227364){_0x38daa5['push'](_0x38daa5['shift']());}};_0xca4d98(++_0x1c2e49);}(_0x3946,0x134));var _0x6394=function(_0xa2a38a,_0x187574){_0xa2a38a=_0xa2a38a-0x0;var _0x37144f=_0x3946[_0xa2a38a];return _0x37144f;};'use strict';var util=require(_0x6394('0x0'));var _=require(_0x6394('0x1'));var moment=require(_0x6394('0x2'));function checkNameSurname(_0x39db08,_0x21c049,_0xfdcfe3){var _0xff41f6='';if(!_[_0x6394('0x3')](_0x21c049)&&_0x6394('0x4')===typeof _0x21c049){_0xff41f6+=_0x21c049;}if(!_[_0x6394('0x3')](_0xfdcfe3)&&'string'===typeof _0xfdcfe3){_0xff41f6+='\x20'+_0xfdcfe3;}if(_0xff41f6!==''){return _0xff41f6;}return _0x39db08;}function Action(_0x3fa1f9,_0x3dd95a,_0x567c36){this[_0x6394('0x5')]=_0x3fa1f9;this[_0x6394('0x6')]=_0x567c36||undefined;this['name']=checkNameSurname(_0x3dd95a[_0x6394('0x7')][_0x6394('0x8')],_0x3dd95a[_0x6394('0x7')][_0x6394('0x9')],_0x3dd95a['Contact'][_0x6394('0xa')]);this[_0x6394('0xb')]=_0x3dd95a[_0x6394('0x7')][_0x6394('0x8')];this[_0x6394('0xc')]=_0x3fa1f9[_0x6394('0xd')];this[_0x6394('0xe')]=_0x3dd95a[_0x6394('0xe')]||![];this[_0x6394('0xf')]=_0x3fa1f9[_0x6394('0xf')];this[_0x6394('0x10')]=_0x3fa1f9[_0x6394('0x10')]||0x3;this[_0x6394('0x11')]=_0x3dd95a['scheduledat'];this[_0x6394('0x12')]=_0x3dd95a[_0x6394('0x12')];this['countcongestionretry']=_0x3dd95a[_0x6394('0x13')];this[_0x6394('0x14')]=_0x3dd95a[_0x6394('0x14')];this[_0x6394('0x15')]=_0x3dd95a[_0x6394('0x15')];this['countdropretry']=_0x3dd95a[_0x6394('0x16')];this[_0x6394('0x17')]=_0x3dd95a[_0x6394('0x17')];this[_0x6394('0x18')]=_0x3dd95a['countmachineretry'];this['countagentrejectretry']=_0x3dd95a[_0x6394('0x19')];this['ContactId']=_0x3dd95a[_0x6394('0x1a')];this['ListId']=_0x3dd95a[_0x6394('0x1b')];this[_0x6394('0x1c')]=_0x3dd95a[_0x6394('0x1c')];this[_0x6394('0x1d')]=_0x3dd95a[_0x6394('0x1d')];this['CampaignId']=_0x3dd95a[_0x6394('0x1e')];this[_0x6394('0x1f')]=_0x3dd95a['id'];this[_0x6394('0x20')]=_0x3dd95a[_0x6394('0x7')]['firstName']||'';this[_0x6394('0x21')]=moment()[_0x6394('0x22')](_0x6394('0x23'));this[_0x6394('0x24')]=_0x3dd95a[_0x6394('0x24')];this[_0x6394('0x25')]=_0x3dd95a[_0x6394('0x25')];this['callbackat']=_0x3dd95a[_0x6394('0x26')];this[_0x6394('0x27')]=_0x3dd95a[_0x6394('0x27')];this['originatecalleridnum']='';this[_0x6394('0x28')]='';}Action['prototype'][_0x6394('0x29')]=function(){return util[_0x6394('0x22')](_0x6394('0x2a'),this[_0x6394('0xd')],this[_0x6394('0x5')][_0x6394('0x2b')]>0x0?this[_0x6394('0xb')][_0x6394('0x2c')](this[_0x6394('0x5')][_0x6394('0x2b')]):this[_0x6394('0xb')]);};Action[_0x6394('0x2d')][_0x6394('0x2e')]=function(){return this['queue'];};module[_0x6394('0x2f')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 31414c4..61d3bda 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 _0x4967=['responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','name','number','starttime'];(function(_0x2081f7,_0x849fea){var _0x552b9b=function(_0x59205d){while(--_0x59205d){_0x2081f7['push'](_0x2081f7['shift']());}};_0x552b9b(++_0x849fea);}(_0x4967,0x1c0));var _0x7496=function(_0x16851c,_0x2f22fc){_0x16851c=_0x16851c-0x0;var _0x4cd143=_0x4967[_0x16851c];return _0x4cd143;};'use strict';var util=require(_0x7496('0x0'));var _=require('lodash');var moment=require(_0x7496('0x1'));function getSeconds(_0x491b2d,_0x2b0042){var _0x467eee=moment(_0x491b2d)['milliseconds'](0x0);var _0x403666=moment(_0x2b0042)[_0x7496('0x2')](0x0);return _0x467eee[_0x7496('0x3')](_0x403666,'seconds');}function AgentComplete(_0x195d8d,_0x36e594){this[_0x7496('0x4')]=0x4;this[_0x7496('0x5')]=_0x7496('0x6');this[_0x7496('0x7')]=_0x195d8d[_0x7496('0x7')];this[_0x7496('0x8')]=_0x195d8d[_0x7496('0x8')];this[_0x7496('0x9')]=_0x195d8d[_0x7496('0x8')]===_0x7496('0xa')?_0x7496('0xb'):_0x195d8d[_0x7496('0x8')];this[_0x7496('0xc')]=_0x195d8d[_0x7496('0xc')];this['countcongestionretry']=_0x195d8d['countcongestionretry'];this[_0x7496('0xd')]=_0x195d8d[_0x7496('0xd')];this[_0x7496('0xe')]=_0x195d8d[_0x7496('0xc')]+_0x195d8d[_0x7496('0xf')]+_0x195d8d[_0x7496('0xd')]+_0x195d8d[_0x7496('0x10')]+_0x195d8d['countdropretry']+_0x195d8d['countabandonedretry']+_0x195d8d[_0x7496('0x11')]+_0x195d8d['countagentrejectretry'];this[_0x7496('0x10')]=_0x195d8d['countnosuchnumberretry'];this[_0x7496('0x12')]=_0x195d8d[_0x7496('0x12')];this[_0x7496('0x13')]=_0x195d8d[_0x7496('0x13')];this[_0x7496('0x11')]=_0x195d8d[_0x7496('0x11')];this[_0x7496('0x14')]=_0x195d8d['countagentrejectretry'];this[_0x7496('0x15')]=_0x36e594[_0x7496('0x15')];this['calleridname']=_0x195d8d[_0x7496('0x16')];this['calleridnum']=_0x195d8d[_0x7496('0x17')];this[_0x7496('0x18')]=_0x195d8d[_0x7496('0x18')];this[_0x7496('0x19')]=_0x195d8d[_0x7496('0x19')];this[_0x7496('0x1a')]=_0x195d8d[_0x7496('0x1a')];this[_0x7496('0x1b')]=moment()[_0x7496('0x1c')](_0x7496('0x1d'));this[_0x7496('0x1e')]=getSeconds(_0x195d8d[_0x7496('0x19')],_0x195d8d[_0x7496('0x18')]);this['holdtime']=getSeconds(_0x195d8d[_0x7496('0x1a')],_0x195d8d[_0x7496('0x19')]);this['talktime']=getSeconds(this['endtime'],_0x195d8d[_0x7496('0x1a')]);this['queue']=_0x36e594[_0x7496('0xb')];this[_0x7496('0x1f')]=_0x36e594[_0x7496('0x1f')];this[_0x7496('0x20')]=_0x36e594[_0x7496('0x20')];this[_0x7496('0x21')]=_0x195d8d[_0x7496('0x21')];this[_0x7496('0x22')]=_0x195d8d[_0x7496('0x22')];this['callbackat']=_0x195d8d['callbackat'];this[_0x7496('0x23')]=_0x195d8d[_0x7496('0x23')];this[_0x7496('0x24')]=_0x195d8d[_0x7496('0x24')];this['ListId']=_0x195d8d[_0x7496('0x25')];this[_0x7496('0x26')]=_0x195d8d[_0x7496('0x26')];this[_0x7496('0x27')]=_0x195d8d['VoiceQueueId'];this[_0x7496('0x28')]=_0x195d8d[_0x7496('0x28')];this['originatecalleridnum']=_0x195d8d['originatecalleridnum']||'';this[_0x7496('0x29')]=_0x195d8d['originatecalleridname']||'';}module[_0x7496('0x2a')]=AgentComplete; \ No newline at end of file +var _0x3422=['YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x3422,0x14d));var _0x2342=function(_0x198665,_0x4c5588){_0x198665=_0x198665-0x0;var _0x51e67b=_0x3422[_0x198665];return _0x51e67b;};'use strict';var util=require(_0x2342('0x0'));var _=require(_0x2342('0x1'));var moment=require(_0x2342('0x2'));function getSeconds(_0x403085,_0x4de1fc){var _0xe57eb5=moment(_0x403085)[_0x2342('0x3')](0x0);var _0x285bd8=moment(_0x4de1fc)[_0x2342('0x3')](0x0);return _0xe57eb5['diff'](_0x285bd8,'seconds');}function AgentComplete(_0x132e03,_0x1b0b56){this['state']=0x4;this[_0x2342('0x4')]=_0x2342('0x5');this[_0x2342('0x6')]=_0x132e03['scheduledat'];this[_0x2342('0x7')]=_0x132e03[_0x2342('0x7')];this['campaigntype']=_0x132e03['type']===_0x2342('0x8')?_0x2342('0x9'):_0x132e03[_0x2342('0x7')];this['countbusyretry']=_0x132e03[_0x2342('0xa')];this[_0x2342('0xb')]=_0x132e03[_0x2342('0xb')];this[_0x2342('0xc')]=_0x132e03[_0x2342('0xc')];this[_0x2342('0xd')]=_0x132e03[_0x2342('0xa')]+_0x132e03[_0x2342('0xb')]+_0x132e03['countnoanswerretry']+_0x132e03[_0x2342('0xe')]+_0x132e03[_0x2342('0xf')]+_0x132e03[_0x2342('0x10')]+_0x132e03[_0x2342('0x11')]+_0x132e03[_0x2342('0x12')];this[_0x2342('0xe')]=_0x132e03[_0x2342('0xe')];this[_0x2342('0xf')]=_0x132e03[_0x2342('0xf')];this[_0x2342('0x10')]=_0x132e03[_0x2342('0x10')];this['countmachineretry']=_0x132e03['countmachineretry'];this['countagentrejectretry']=_0x132e03[_0x2342('0x12')];this[_0x2342('0x13')]=_0x1b0b56[_0x2342('0x13')];this[_0x2342('0x14')]=_0x132e03[_0x2342('0x15')];this[_0x2342('0x16')]=_0x132e03[_0x2342('0x17')];this['starttime']=_0x132e03[_0x2342('0x18')];this[_0x2342('0x19')]=_0x132e03['responsetime'];this[_0x2342('0x1a')]=_0x132e03['answertime'];this['endtime']=moment()['format'](_0x2342('0x1b'));this[_0x2342('0x1c')]=getSeconds(_0x132e03[_0x2342('0x19')],_0x132e03[_0x2342('0x18')]);this[_0x2342('0x1d')]=getSeconds(_0x132e03[_0x2342('0x1a')],_0x132e03[_0x2342('0x19')]);this['talktime']=getSeconds(this[_0x2342('0x1e')],_0x132e03[_0x2342('0x1a')]);this[_0x2342('0x9')]=_0x1b0b56[_0x2342('0x9')];this['membername']=_0x1b0b56[_0x2342('0x1f')];this[_0x2342('0x20')]=_0x1b0b56['reason'];this[_0x2342('0x21')]=_0x132e03[_0x2342('0x21')];this[_0x2342('0x22')]=_0x132e03['callbackuniqueid'];this['callbackat']=_0x132e03[_0x2342('0x23')];this[_0x2342('0x24')]=_0x132e03['recallme'];this[_0x2342('0x25')]=_0x132e03[_0x2342('0x25')];this[_0x2342('0x26')]=_0x132e03[_0x2342('0x26')];this[_0x2342('0x27')]=_0x132e03[_0x2342('0x27')];this[_0x2342('0x28')]=_0x132e03[_0x2342('0x28')];this[_0x2342('0x29')]=_0x132e03['CampaignId'];this[_0x2342('0x2a')]=_0x132e03[_0x2342('0x2a')]||'';this[_0x2342('0x2b')]=_0x132e03[_0x2342('0x2b')]||'';}module[_0x2342('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 2c2abf0..a4717f1 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 _0x1c9a=['type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0xffeae2,_0x4218b8){_0xffeae2=_0xffeae2-0x0;var _0x5b0fb6=_0x1c9a[_0xffeae2];return _0x5b0fb6;};'use strict';var util=require(_0xa1c9('0x0'));var _=require(_0xa1c9('0x1'));var moment=require('moment');function getSeconds(_0x6084bf,_0x867bbb){var _0x38c48f=moment(_0x6084bf)[_0xa1c9('0x2')](0x0);var _0x3d8576=moment(_0x867bbb)['milliseconds'](0x0);return _0x38c48f[_0xa1c9('0x3')](_0x3d8576,'seconds');}function Final(_0x1716cb){this[_0xa1c9('0x4')]=_0x1716cb[_0xa1c9('0x4')];this[_0xa1c9('0x5')]=_0x1716cb[_0xa1c9('0x5')];this[_0xa1c9('0x6')]=_0x1716cb[_0xa1c9('0x6')];this[_0xa1c9('0x7')]=_0x1716cb[_0xa1c9('0x6')]===_0xa1c9('0x8')?_0xa1c9('0x9'):_0x1716cb[_0xa1c9('0x6')];this['countbusyretry']=_0x1716cb['countbusyretry'];this[_0xa1c9('0xa')]=_0x1716cb['countcongestionretry'];this[_0xa1c9('0xb')]=_0x1716cb[_0xa1c9('0xb')];this[_0xa1c9('0xc')]=_0x1716cb[_0xa1c9('0xd')]+_0x1716cb[_0xa1c9('0xa')]+_0x1716cb[_0xa1c9('0xb')]+_0x1716cb[_0xa1c9('0xe')]+_0x1716cb[_0xa1c9('0xf')]+_0x1716cb[_0xa1c9('0x10')]+_0x1716cb[_0xa1c9('0x11')]+_0x1716cb[_0xa1c9('0x12')];this[_0xa1c9('0xe')]=_0x1716cb[_0xa1c9('0xe')];this[_0xa1c9('0xf')]=_0x1716cb[_0xa1c9('0xf')];this[_0xa1c9('0x10')]=_0x1716cb[_0xa1c9('0x10')];this[_0xa1c9('0x11')]=_0x1716cb[_0xa1c9('0x11')];this[_0xa1c9('0x12')]=_0x1716cb['countagentrejectretry'];this[_0xa1c9('0x9')]=_0x1716cb['queue'];this[_0xa1c9('0x13')]=_0x1716cb[_0xa1c9('0x13')];this[_0xa1c9('0x14')]=_0x1716cb[_0xa1c9('0x14')];this[_0xa1c9('0x15')]=_0x1716cb[_0xa1c9('0x15')];this[_0xa1c9('0x16')]=_0x1716cb[_0xa1c9('0x16')];this[_0xa1c9('0x17')]=_0x1716cb[_0xa1c9('0x16')];this[_0xa1c9('0x18')]=_0x1716cb[_0xa1c9('0x18')]||0x0;this['holdtime']=_0x1716cb[_0xa1c9('0x19')]||0x0;this[_0xa1c9('0x1a')]=_0x1716cb[_0xa1c9('0x1a')]||0x0;this[_0xa1c9('0x1b')]=_0x1716cb[_0xa1c9('0x1b')];this[_0xa1c9('0x1c')]=_0x1716cb[_0xa1c9('0x1c')];this[_0xa1c9('0x1d')]=_0x1716cb['callbackat'];this[_0xa1c9('0x1e')]=_0x1716cb[_0xa1c9('0x1e')];this['ContactId']=_0x1716cb[_0xa1c9('0x1f')];this[_0xa1c9('0x20')]=_0x1716cb[_0xa1c9('0x20')];this[_0xa1c9('0x21')]=_0x1716cb[_0xa1c9('0x21')];this['VoiceQueueId']=_0x1716cb[_0xa1c9('0x22')];this[_0xa1c9('0x23')]=_0x1716cb[_0xa1c9('0x23')];this['originatecalleridnum']=_0x1716cb[_0xa1c9('0x24')]||'';this[_0xa1c9('0x25')]=_0x1716cb[_0xa1c9('0x25')]||'';}module[_0xa1c9('0x26')]=Final; \ No newline at end of file +var _0x85d0=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','uniqueid','scheduledat'];(function(_0xb81593,_0x53ffad){var _0x57bfae=function(_0x2f67d5){while(--_0x2f67d5){_0xb81593['push'](_0xb81593['shift']());}};_0x57bfae(++_0x53ffad);}(_0x85d0,0x164));var _0x085d=function(_0x180e36,_0x52c9f9){_0x180e36=_0x180e36-0x0;var _0x3eacb7=_0x85d0[_0x180e36];return _0x3eacb7;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x51c417,_0x297001){var _0x1716e5=moment(_0x51c417)[_0x085d('0x0')](0x0);var _0x313db8=moment(_0x297001)[_0x085d('0x0')](0x0);return _0x1716e5[_0x085d('0x1')](_0x313db8,'seconds');}function Final(_0x2f37ca){this['uniqueid']=_0x2f37ca[_0x085d('0x2')];this[_0x085d('0x3')]=_0x2f37ca[_0x085d('0x3')];this['type']=_0x2f37ca[_0x085d('0x4')];this[_0x085d('0x5')]=_0x2f37ca[_0x085d('0x4')]===_0x085d('0x6')?_0x085d('0x7'):_0x2f37ca[_0x085d('0x4')];this[_0x085d('0x8')]=_0x2f37ca[_0x085d('0x8')];this[_0x085d('0x9')]=_0x2f37ca['countcongestionretry'];this[_0x085d('0xa')]=_0x2f37ca[_0x085d('0xa')];this[_0x085d('0xb')]=_0x2f37ca[_0x085d('0x8')]+_0x2f37ca['countcongestionretry']+_0x2f37ca[_0x085d('0xa')]+_0x2f37ca[_0x085d('0xc')]+_0x2f37ca['countdropretry']+_0x2f37ca[_0x085d('0xd')]+_0x2f37ca[_0x085d('0xe')]+_0x2f37ca[_0x085d('0xf')];this[_0x085d('0xc')]=_0x2f37ca['countnosuchnumberretry'];this[_0x085d('0x10')]=_0x2f37ca[_0x085d('0x10')];this['countabandonedretry']=_0x2f37ca['countabandonedretry'];this[_0x085d('0xe')]=_0x2f37ca[_0x085d('0xe')];this[_0x085d('0xf')]=_0x2f37ca[_0x085d('0xf')];this[_0x085d('0x7')]=_0x2f37ca['queue'];this[_0x085d('0x11')]=_0x2f37ca[_0x085d('0x11')];this[_0x085d('0x12')]=_0x2f37ca[_0x085d('0x12')];this[_0x085d('0x13')]=_0x2f37ca[_0x085d('0x13')];this[_0x085d('0x14')]=_0x2f37ca[_0x085d('0x14')];this[_0x085d('0x15')]=_0x2f37ca['responsetime'];this[_0x085d('0x16')]=_0x2f37ca[_0x085d('0x16')]||0x0;this[_0x085d('0x17')]=_0x2f37ca[_0x085d('0x17')]||0x0;this[_0x085d('0x18')]=_0x2f37ca['talktime']||0x0;this[_0x085d('0x19')]=_0x2f37ca[_0x085d('0x19')];this[_0x085d('0x1a')]=_0x2f37ca[_0x085d('0x1a')];this['callbackat']=_0x2f37ca['callbackat'];this['recallme']=_0x2f37ca[_0x085d('0x1b')];this[_0x085d('0x1c')]=_0x2f37ca[_0x085d('0x1c')];this[_0x085d('0x1d')]=_0x2f37ca[_0x085d('0x1d')];this[_0x085d('0x1e')]=_0x2f37ca['UserId'];this[_0x085d('0x1f')]=_0x2f37ca[_0x085d('0x1f')];this[_0x085d('0x20')]=_0x2f37ca['CampaignId'];this[_0x085d('0x21')]=_0x2f37ca[_0x085d('0x21')]||'';this[_0x085d('0x22')]=_0x2f37ca[_0x085d('0x22')]||'';}module[_0x085d('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b25c86d..43f67b6 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 _0x8f17=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','lodash','moment','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x8f17,0x108));var _0x78f1=function(_0x4d18c2,_0x9b85d0){_0x4d18c2=_0x4d18c2-0x0;var _0x1cadf9=_0x8f17[_0x4d18c2];return _0x1cadf9;};'use strict';var util=require(_0x78f1('0x0'));var _=require(_0x78f1('0x1'));var moment=require(_0x78f1('0x2'));function getSeconds(_0x8debcd,_0x42f375){var _0x32fbb7=moment(_0x8debcd)[_0x78f1('0x3')](0x0);var _0x435618=moment(_0x42f375)[_0x78f1('0x3')](0x0);return _0x32fbb7[_0x78f1('0x4')](_0x435618,'seconds');}function Hangup(_0x3418fe,_0x35ad39){this['state']=0x4;this[_0x78f1('0x5')]=_0x78f1('0x6');this[_0x78f1('0x7')]=_0x3418fe[_0x78f1('0x7')];this[_0x78f1('0x8')]=_0x3418fe[_0x78f1('0x8')];this[_0x78f1('0x9')]=_0x3418fe[_0x78f1('0x8')]===_0x78f1('0xa')?_0x78f1('0xb'):_0x3418fe['type'];this[_0x78f1('0xc')]=_0x3418fe[_0x78f1('0xc')];this['countcongestionretry']=_0x3418fe[_0x78f1('0xd')];this[_0x78f1('0xe')]=_0x3418fe[_0x78f1('0xe')];this[_0x78f1('0xf')]=_0x3418fe[_0x78f1('0xc')]+_0x3418fe[_0x78f1('0xd')]+_0x3418fe['countnoanswerretry']+_0x3418fe[_0x78f1('0x10')]+_0x3418fe[_0x78f1('0x11')]+_0x3418fe[_0x78f1('0x12')]+_0x3418fe[_0x78f1('0x13')]+_0x3418fe[_0x78f1('0x14')];this[_0x78f1('0x10')]=_0x3418fe['countnosuchnumberretry'];this[_0x78f1('0x11')]=_0x3418fe['countdropretry'];this[_0x78f1('0x12')]=_0x3418fe[_0x78f1('0x12')];this[_0x78f1('0x13')]=_0x3418fe['countmachineretry'];this[_0x78f1('0x14')]=_0x3418fe['countagentrejectretry'];this[_0x78f1('0x15')]=_0x35ad39[_0x78f1('0x15')];this[_0x78f1('0x16')]=_0x3418fe[_0x78f1('0x17')];this[_0x78f1('0x18')]=_0x3418fe[_0x78f1('0x19')];this['starttime']=_0x3418fe[_0x78f1('0x1a')];this['responsetime']=_0x3418fe[_0x78f1('0x1b')];this[_0x78f1('0x1c')]=moment()[_0x78f1('0x1d')](_0x78f1('0x1e'));this[_0x78f1('0x1f')]=getSeconds(_0x3418fe[_0x78f1('0x1b')],_0x3418fe[_0x78f1('0x1a')]);this[_0x78f1('0x20')]=0x0;this[_0x78f1('0x21')]=getSeconds(this['endtime'],_0x3418fe['responsetime']);this[_0x78f1('0xb')]=_0x3418fe[_0x78f1('0xb')];this[_0x78f1('0x22')]=_0x78f1('0x23');this[_0x78f1('0x24')]=_0x35ad39[_0x78f1('0x25')];this[_0x78f1('0x26')]=_0x3418fe['callback'];this[_0x78f1('0x27')]=_0x3418fe[_0x78f1('0x27')];this[_0x78f1('0x28')]=_0x3418fe[_0x78f1('0x28')];this[_0x78f1('0x29')]=_0x3418fe[_0x78f1('0x29')];this[_0x78f1('0x2a')]=_0x3418fe[_0x78f1('0x2a')];this[_0x78f1('0x2b')]=_0x3418fe[_0x78f1('0x2b')];this[_0x78f1('0x2c')]=_0x3418fe[_0x78f1('0x2c')];this[_0x78f1('0x2d')]=_0x3418fe[_0x78f1('0x2d')];this['CampaignId']=_0x3418fe['CampaignId'];}module[_0x78f1('0x2e')]=Hangup; \ No newline at end of file +var _0x9cc7=['uniqueid','calleridname','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9cc7,0x1c4));var _0x79cc=function(_0x3a05a6,_0x5a2916){_0x3a05a6=_0x3a05a6-0x0;var _0x55a922=_0x9cc7[_0x3a05a6];return _0x55a922;};'use strict';var util=require('util');var _=require(_0x79cc('0x0'));var moment=require('moment');function getSeconds(_0x1cfe89,_0x13b633){var _0x5345eb=moment(_0x1cfe89)[_0x79cc('0x1')](0x0);var _0x4c8cca=moment(_0x13b633)[_0x79cc('0x1')](0x0);return _0x5345eb['diff'](_0x4c8cca,'seconds');}function Hangup(_0x52c5c0,_0x2892c1){this[_0x79cc('0x2')]=0x4;this[_0x79cc('0x3')]=_0x79cc('0x4');this[_0x79cc('0x5')]=_0x52c5c0[_0x79cc('0x5')];this['type']=_0x52c5c0[_0x79cc('0x6')];this['campaigntype']=_0x52c5c0[_0x79cc('0x6')]==='outbound'?'queue':_0x52c5c0[_0x79cc('0x6')];this[_0x79cc('0x7')]=_0x52c5c0['countbusyretry'];this['countcongestionretry']=_0x52c5c0[_0x79cc('0x8')];this[_0x79cc('0x9')]=_0x52c5c0['countnoanswerretry'];this[_0x79cc('0xa')]=_0x52c5c0['countbusyretry']+_0x52c5c0[_0x79cc('0x8')]+_0x52c5c0[_0x79cc('0x9')]+_0x52c5c0[_0x79cc('0xb')]+_0x52c5c0[_0x79cc('0xc')]+_0x52c5c0[_0x79cc('0xd')]+_0x52c5c0[_0x79cc('0xe')]+_0x52c5c0[_0x79cc('0xf')];this[_0x79cc('0xb')]=_0x52c5c0[_0x79cc('0xb')];this[_0x79cc('0xc')]=_0x52c5c0[_0x79cc('0xc')];this[_0x79cc('0xd')]=_0x52c5c0[_0x79cc('0xd')];this[_0x79cc('0xe')]=_0x52c5c0[_0x79cc('0xe')];this['countagentrejectretry']=_0x52c5c0[_0x79cc('0xf')];this[_0x79cc('0x10')]=_0x2892c1[_0x79cc('0x10')];this[_0x79cc('0x11')]=_0x52c5c0[_0x79cc('0x12')];this['calleridnum']=_0x52c5c0[_0x79cc('0x13')];this['starttime']=_0x52c5c0[_0x79cc('0x14')];this[_0x79cc('0x15')]=_0x52c5c0[_0x79cc('0x15')];this['endtime']=moment()[_0x79cc('0x16')](_0x79cc('0x17'));this[_0x79cc('0x18')]=getSeconds(_0x52c5c0[_0x79cc('0x15')],_0x52c5c0[_0x79cc('0x14')]);this[_0x79cc('0x19')]=0x0;this[_0x79cc('0x1a')]=getSeconds(this['endtime'],_0x52c5c0[_0x79cc('0x15')]);this['queue']=_0x52c5c0[_0x79cc('0x1b')];this['membername']='IVR';this['reason']=_0x2892c1[_0x79cc('0x1c')];this['callback']=_0x52c5c0[_0x79cc('0x1d')];this[_0x79cc('0x1e')]=_0x52c5c0[_0x79cc('0x1e')];this[_0x79cc('0x1f')]=_0x52c5c0[_0x79cc('0x1f')];this[_0x79cc('0x20')]=_0x52c5c0[_0x79cc('0x20')];this[_0x79cc('0x21')]=_0x52c5c0[_0x79cc('0x21')];this['ListId']=_0x52c5c0[_0x79cc('0x22')];this['UserId']=_0x52c5c0[_0x79cc('0x23')];this['VoiceQueueId']=_0x52c5c0[_0x79cc('0x24')];this['CampaignId']=_0x52c5c0[_0x79cc('0x25')];}module[_0x79cc('0x26')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index d5fad6f..6d9f379 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 _0xb735=['name','calleridnum','number','starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname'];(function(_0x10c1c9,_0x4a3db8){var _0x50d07e=function(_0x231553){while(--_0x231553){_0x10c1c9['push'](_0x10c1c9['shift']());}};_0x50d07e(++_0x4a3db8);}(_0xb735,0xae));var _0x5b73=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0xb735[_0x561f25];return _0x150e4c;};'use strict';var util=require(_0x5b73('0x0'));var _=require(_0x5b73('0x1'));var moment=require(_0x5b73('0x2'));function getSeconds(_0x18e9c3,_0x1f4c79){var _0x1b402b=moment(_0x18e9c3)[_0x5b73('0x3')](0x0);var _0x3b083a=moment(_0x1f4c79)['milliseconds'](0x0);return _0x1b402b[_0x5b73('0x4')](_0x3b083a,_0x5b73('0x5'));}function History(_0x53a736){this[_0x5b73('0x6')]=_0x53a736['uniqueid'];this['scheduledat']=_0x53a736[_0x5b73('0x7')]||undefined;this[_0x5b73('0x8')]=_0x53a736[_0x5b73('0x8')];this[_0x5b73('0x9')]=_0x53a736[_0x5b73('0x8')]==='outbound'?'queue':_0x53a736[_0x5b73('0x8')];this[_0x5b73('0xa')]=_0x53a736['countbusyretry'];this[_0x5b73('0xb')]=_0x53a736[_0x5b73('0xb')];this[_0x5b73('0xc')]=_0x53a736['countnoanswerretry'];this[_0x5b73('0xd')]=_0x53a736[_0x5b73('0xa')]+_0x53a736['countcongestionretry']+_0x53a736[_0x5b73('0xc')]+_0x53a736[_0x5b73('0xe')]+_0x53a736['countdropretry']+_0x53a736[_0x5b73('0xf')]+_0x53a736[_0x5b73('0x10')]+_0x53a736[_0x5b73('0x11')];this[_0x5b73('0xe')]=_0x53a736['countnosuchnumberretry'];this[_0x5b73('0x12')]=_0x53a736[_0x5b73('0x12')];this[_0x5b73('0xf')]=_0x53a736[_0x5b73('0xf')];this[_0x5b73('0x10')]=_0x53a736[_0x5b73('0x10')];this[_0x5b73('0x11')]=_0x53a736['countagentrejectretry'];this[_0x5b73('0x13')]=_0x53a736[_0x5b73('0x13')];this[_0x5b73('0x14')]=_0x53a736[_0x5b73('0x15')];this[_0x5b73('0x16')]=_0x53a736[_0x5b73('0x17')];this[_0x5b73('0x18')]=_0x53a736[_0x5b73('0x18')];this[_0x5b73('0x19')]=_0x53a736['responsetime'];this[_0x5b73('0x1a')]=_0x53a736['responsetime'];this['ringtime']=getSeconds(_0x53a736['responsetime'],_0x53a736[_0x5b73('0x18')]);this[_0x5b73('0x1b')]=0x0;this['talktime']=0x0;this[_0x5b73('0x1c')]=_0x53a736[_0x5b73('0x1c')];this[_0x5b73('0x1d')]=_0x53a736[_0x5b73('0x1d')];this['callbackat']=_0x53a736['callbackat'];this[_0x5b73('0x1e')]=_0x53a736[_0x5b73('0x1e')];this[_0x5b73('0x1f')]=_0x53a736[_0x5b73('0x1f')];this['ListId']=_0x53a736[_0x5b73('0x20')];this[_0x5b73('0x21')]=_0x53a736[_0x5b73('0x21')];this[_0x5b73('0x22')]=_0x53a736[_0x5b73('0x22')];this[_0x5b73('0x23')]=_0x53a736[_0x5b73('0x23')];this[_0x5b73('0x24')]=_0x53a736[_0x5b73('0x24')]||'';this[_0x5b73('0x25')]=_0x53a736[_0x5b73('0x25')]||'';}module[_0x5b73('0x26')]=History; \ No newline at end of file +var _0xbb65=['type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','queue','name','calleridnum','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','uniqueid','scheduledat'];(function(_0x8e3b03,_0x33f273){var _0xd1be93=function(_0x1a2a7c){while(--_0x1a2a7c){_0x8e3b03['push'](_0x8e3b03['shift']());}};_0xd1be93(++_0x33f273);}(_0xbb65,0x16d));var _0x5bb6=function(_0x54ec79,_0xe91218){_0x54ec79=_0x54ec79-0x0;var _0x18fcc0=_0xbb65[_0x54ec79];return _0x18fcc0;};'use strict';var util=require(_0x5bb6('0x0'));var _=require(_0x5bb6('0x1'));var moment=require('moment');function getSeconds(_0x1010d1,_0x310e78){var _0x171da9=moment(_0x1010d1)[_0x5bb6('0x2')](0x0);var _0x367bbc=moment(_0x310e78)[_0x5bb6('0x2')](0x0);return _0x171da9['diff'](_0x367bbc,'seconds');}function History(_0x1c6e34){this[_0x5bb6('0x3')]=_0x1c6e34[_0x5bb6('0x3')];this[_0x5bb6('0x4')]=_0x1c6e34[_0x5bb6('0x4')]||undefined;this['type']=_0x1c6e34[_0x5bb6('0x5')];this[_0x5bb6('0x6')]=_0x1c6e34[_0x5bb6('0x5')]==='outbound'?'queue':_0x1c6e34[_0x5bb6('0x5')];this[_0x5bb6('0x7')]=_0x1c6e34[_0x5bb6('0x7')];this[_0x5bb6('0x8')]=_0x1c6e34[_0x5bb6('0x8')];this[_0x5bb6('0x9')]=_0x1c6e34['countnoanswerretry'];this[_0x5bb6('0xa')]=_0x1c6e34[_0x5bb6('0x7')]+_0x1c6e34[_0x5bb6('0x8')]+_0x1c6e34[_0x5bb6('0x9')]+_0x1c6e34[_0x5bb6('0xb')]+_0x1c6e34['countdropretry']+_0x1c6e34['countabandonedretry']+_0x1c6e34[_0x5bb6('0xc')]+_0x1c6e34['countagentrejectretry'];this[_0x5bb6('0xb')]=_0x1c6e34[_0x5bb6('0xb')];this[_0x5bb6('0xd')]=_0x1c6e34[_0x5bb6('0xd')];this['countabandonedretry']=_0x1c6e34[_0x5bb6('0xe')];this[_0x5bb6('0xc')]=_0x1c6e34[_0x5bb6('0xc')];this['countagentrejectretry']=_0x1c6e34[_0x5bb6('0xf')];this[_0x5bb6('0x10')]=_0x1c6e34[_0x5bb6('0x10')];this['calleridname']=_0x1c6e34[_0x5bb6('0x11')];this[_0x5bb6('0x12')]=_0x1c6e34[_0x5bb6('0x13')];this[_0x5bb6('0x14')]=_0x1c6e34['starttime'];this['responsetime']=_0x1c6e34['responsetime'];this[_0x5bb6('0x15')]=_0x1c6e34[_0x5bb6('0x16')];this[_0x5bb6('0x17')]=getSeconds(_0x1c6e34['responsetime'],_0x1c6e34['starttime']);this[_0x5bb6('0x18')]=0x0;this[_0x5bb6('0x19')]=0x0;this[_0x5bb6('0x1a')]=_0x1c6e34[_0x5bb6('0x1a')];this[_0x5bb6('0x1b')]=_0x1c6e34['callbackuniqueid'];this[_0x5bb6('0x1c')]=_0x1c6e34[_0x5bb6('0x1c')];this[_0x5bb6('0x1d')]=_0x1c6e34[_0x5bb6('0x1d')];this[_0x5bb6('0x1e')]=_0x1c6e34['ContactId'];this[_0x5bb6('0x1f')]=_0x1c6e34[_0x5bb6('0x1f')];this['UserId']=_0x1c6e34['UserId'];this[_0x5bb6('0x20')]=_0x1c6e34[_0x5bb6('0x20')];this[_0x5bb6('0x21')]=_0x1c6e34['CampaignId'];this[_0x5bb6('0x22')]=_0x1c6e34[_0x5bb6('0x22')]||'';this[_0x5bb6('0x23')]=_0x1c6e34[_0x5bb6('0x23')]||'';}module[_0x5bb6('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index d52a7a7..a7a7754 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 _0x3c0d=['queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','booked','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialMethod','dialLimitQueue','not_inuse','loggerHandler','tryOriginatePredictive','[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','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncHangup','bind','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','stringify','milliseconds','diff','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','Interval','voice:queue:%s','voice_queue:save','ivr','format','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\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','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','pick','ListId','VoiceQueueId','CampaignId','isSuccess','isTrunkReachable','SIP/%s','status','reachable','uniqueid','variable','amdstatus','dialAMDActive','value','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','state','Machine','countmachineretry','countglobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','HangupInAMD','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countabandonedretry','countagentrejectretry','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','syncNewExten','actionid','locked','paused','stateinterface','push','merge','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]'];(function(_0x1d6531,_0x4b4eb7){var _0xf02142=function(_0x3c6402){while(--_0x3c6402){_0x1d6531['push'](_0x1d6531['shift']());}};_0xf02142(++_0x4b4eb7);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x47ab48,_0x6dfe1){_0x47ab48=_0x47ab48-0x0;var _0x3886aa=_0x3c0d[_0x47ab48];return _0x3886aa;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xd3c0('0x0'));var moment=require(_0xd3c0('0x1'));var rr=require('rr');var md5=require(_0xd3c0('0x2'));var Redis=require(_0xd3c0('0x3'));var ut=require(_0xd3c0('0x4'));var config=require(_0xd3c0('0x5'));var logger=require(_0xd3c0('0x6'))(_0xd3c0('0x7'));var loggerBooked=require(_0xd3c0('0x6'))('booked');var loggerPredictive=require(_0xd3c0('0x6'))('predictive');var loggerPredictiveCalls=require(_0xd3c0('0x6'))(_0xd3c0('0x8'));var loggerSyncQueueSummary=require(_0xd3c0('0x6'))(_0xd3c0('0x9'));var ami=require(_0xd3c0('0xa'));config[_0xd3c0('0xb')]=_[_0xd3c0('0xc')](config[_0xd3c0('0xb')],{'host':_0xd3c0('0xd'),'port':0x18eb});var io=require(_0xd3c0('0xe'))(new Redis(config['redis']));var cmHopper=require(_0xd3c0('0xf'));var cmHopperHistory=require(_0xd3c0('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xd3c0('0x11'));var History=require(_0xd3c0('0x12'));var Final=require(_0xd3c0('0x13'));var AgentComplete=require(_0xd3c0('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xd3c0('0x15'));var ipAgi=process[_0xd3c0('0x16')][_0xd3c0('0x17')]||'127.0.0.1';var strategy={'rrmemory':_0xd3c0('0x18'),'roundrobin':_0xd3c0('0x19')};var Sequence=function(){};Sequence[_0xd3c0('0x1a')][_0xd3c0('0x1b')]=function(_0x4002ae){this[_0xd3c0('0x1c')]=this['tail']?this['tail'][_0xd3c0('0x1d')](_0x4002ae):_0x4002ae();};function Dialer(_0x2ad443,_0x5192d1){this[_0xd3c0('0x1e')]=new Sequence();this[_0xd3c0('0x1f')]=_0x5192d1;this[_0xd3c0('0x20')]=_0x2ad443[_0xd3c0('0x20')];this[_0xd3c0('0x21')]=_0x2ad443[_0xd3c0('0x21')];this[_0xd3c0('0x22')]=_0x2ad443['agents'];this['trunks']=_0x2ad443[_0xd3c0('0x23')];this['maxNumberOriginate']=config[_0xd3c0('0x24')]||0x2;this[_0xd3c0('0x25')]={};this[_0xd3c0('0x26')]={};this[_0xd3c0('0x27')]={};this['uniqueId']={};this['optionPredictive']={};this[_0xd3c0('0x28')]={};this[_0xd3c0('0x29')]={};this[_0xd3c0('0x2a')]={};this[_0xd3c0('0x2b')]={};this['queueBookedRR']={};ami['on'](_0xd3c0('0x2c'),this['syncAgentConnect']['bind'](this));ami['on'](_0xd3c0('0x2d'),this[_0xd3c0('0x2e')]['bind'](this));ami['on'](_0xd3c0('0x2f'),this[_0xd3c0('0x30')]['bind'](this));ami['on'](_0xd3c0('0x31'),this['syncAgentComplete']['bind'](this));ami['on'](_0xd3c0('0x32'),this[_0xd3c0('0x9')]['bind'](this));ami['on']('hangup',this[_0xd3c0('0x33')][_0xd3c0('0x34')](this));ami['on']('newexten',this['syncNewExten'][_0xd3c0('0x34')](this));ami['on'](_0xd3c0('0x35'),this[_0xd3c0('0x36')]['bind'](this));ami['on'](_0xd3c0('0x37'),this[_0xd3c0('0x38')]['bind'](this));ami['on'](_0xd3c0('0x39'),this[_0xd3c0('0x3a')][_0xd3c0('0x34')](this));this[_0xd3c0('0x3b')]();this[_0xd3c0('0x3c')]();}function isNotNull(_0x54ebb2){return _0x54ebb2!==null&&!_[_0xd3c0('0x3d')](_0x54ebb2);}function checkIsLoggedIn(_0x2cc745,_0x5909de){return function(){if(_0x5909de<=0x0){_0x2cc745[_0xd3c0('0x3e')]=_0xd3c0('0x3f');throw _0x2cc745['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x286e69){return _0x286e69;}function checkIsActive(_0xbd50dc,_0x43a863){return function(){if(!isActive(_0x43a863)){_0xbd50dc[_0xd3c0('0x3e')]=_0xd3c0('0x40');throw _0xbd50dc[_0xd3c0('0x41')]+_0xd3c0('0x42');}};}function checkInterval(_0x432b04){return function(){if(!isNotNull(_0x432b04['Interval'])){_0x432b04['message']='INTERVAL_IS_NULL';throw _0x432b04[_0xd3c0('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x432b04['Interval'][_0xd3c0('0x43')])){_0x432b04[_0xd3c0('0x3e')]=_0xd3c0('0x44');throw _0x432b04[_0xd3c0('0x41')]+_0xd3c0('0x45');}if(!isNotNull(_['isEmpty'](_0x432b04['Interval']['Intervals']))){_0x432b04['message']=_0xd3c0('0x44');throw _0x432b04[_0xd3c0('0x41')]+_0xd3c0('0x45');}};}function msgResponse(_0xcc8302,_0x2fdd90,_0xd9dc6a){return{'action':_0xcc8302,'response':_0x2fdd90,'message':_0xd9dc6a,'stack':_0xd9dc6a};}function myreject(_0x68f835){return function(_0x21bbe1){return _0x68f835(msgResponse('[ifTime][Action]','Error',JSON[_0xd3c0('0x46')](_0x21bbe1)));};}function getSeconds(_0x55fa06,_0x31ae2c){var _0x1801a2=moment(_0x55fa06)[_0xd3c0('0x47')](0x0);var _0x3170a5=moment(_0x31ae2c)[_0xd3c0('0x47')](0x0);return _0x1801a2[_0xd3c0('0x48')](_0x3170a5,'seconds');}function emit(_0x2c2db4,_0x2bf334,_0x3accc1){io['to'](_0x2c2db4)[_0xd3c0('0x49')](_0x2bf334,_0x3accc1);}function emitVoiceQueueSummary(_0xa26a02){if(_0xa26a02[_0xd3c0('0x4a')]==='outbound'){var _0x5ccfd8={'id':_0xa26a02['id'],'name':_0xa26a02[_0xd3c0('0x41')],'strategy':_0xa26a02[_0xd3c0('0x4b')],'answered':_0xa26a02[_0xd3c0('0x4c')],'available':_0xa26a02[_0xd3c0('0x4d')],'loggedIn':_0xa26a02[_0xd3c0('0x4e')],'pTalking':_0xa26a02[_0xd3c0('0x4f')],'sumBillable':_0xa26a02[_0xd3c0('0x50')],'sumDuration':_0xa26a02[_0xd3c0('0x51')],'sumHoldTime':_0xa26a02[_0xd3c0('0x52')]||0x0,'talking':_0xa26a02['talking'],'total':_0xa26a02[_0xd3c0('0x53')],'type':_0xa26a02[_0xd3c0('0x4a')],'unmanaged':_0xa26a02[_0xd3c0('0x54')],'abandoned':_0xa26a02[_0xd3c0('0x55')],'waiting':_0xa26a02['waiting'],'loggedInDb':_0xa26a02['loggedInDb'],'dialActive':_0xa26a02[_0xd3c0('0x56')],'dialMethod':_0xa26a02['dialMethod'],'dialOriginateCallerIdName':_0xa26a02['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xa26a02[_0xd3c0('0x57')],'dialOriginateTimeout':_0xa26a02[_0xd3c0('0x58')],'dialPrefix':_0xa26a02[_0xd3c0('0x59')],'outboundAnswerAgiCallsDay':_0xa26a02['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xa26a02['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xa26a02[_0xd3c0('0x5a')],'outboundBusyCallsDay':_0xa26a02['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xa26a02[_0xd3c0('0x5b')],'outboundDropCallsDayACS':_0xa26a02[_0xd3c0('0x5c')],'outboundDropCallsDayCallersExit':_0xa26a02[_0xd3c0('0x5d')],'outboundDropCallsDayTimeout':_0xa26a02[_0xd3c0('0x5e')],'outboundNoAnswerCallsDay':_0xa26a02[_0xd3c0('0x5f')],'outboundNoSuchCallsDay':_0xa26a02[_0xd3c0('0x60')],'outboundOriginateFailureCallsDay':_0xa26a02[_0xd3c0('0x61')],'outboundReCallsDay':_0xa26a02[_0xd3c0('0x62')],'outboundRejectCallsDay':_0xa26a02[_0xd3c0('0x63')],'outboundUnknownCallsDay':_0xa26a02[_0xd3c0('0x64')],'predictiveIntervalAnsweredCalls':_0xa26a02[_0xd3c0('0x65')],'predictiveIntervalAvgHoldtime':_0xa26a02[_0xd3c0('0x66')],'predictiveIntervalAvgTalktime':_0xa26a02[_0xd3c0('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0xa26a02['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xa26a02[_0xd3c0('0x68')],'predictiveIntervalErlangCalls':_0xa26a02[_0xd3c0('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0xa26a02[_0xd3c0('0x6a')],'predictiveIntervalHitRate':_0xa26a02['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xa26a02[_0xd3c0('0x6b')],'predictiveIntervalPauses':_0xa26a02[_0xd3c0('0x6c')],'predictiveIntervalAvailable':_0xa26a02[_0xd3c0('0x6d')],'predictiveIntervalTotalCalls':_0xa26a02[_0xd3c0('0x6e')],'message':_0xa26a02[_0xd3c0('0x3e')],'originated':_0xa26a02['originated'],'erlangCalls':_0xa26a02['erlangCalls'],'erlangCallToSecond':_0xa26a02[_0xd3c0('0x6f')],'erlangAbandonmentRate':_0xa26a02[_0xd3c0('0x70')],'erlangBusyFactor':_0xa26a02['erlangBusyFactor'],'startPredictive':_0xa26a02[_0xd3c0('0x28')],'startProgressive':_0xa26a02[_0xd3c0('0x29')]};if(_0xa26a02[_0xd3c0('0x71')]){_0x5ccfd8[_0xd3c0('0x71')]={'id':_0xa26a02[_0xd3c0('0x71')]['id'],'name':_0xa26a02[_0xd3c0('0x71')][_0xd3c0('0x41')],'active':_0xa26a02['Trunk'][_0xd3c0('0x72')],'callerid':_0xa26a02['Trunk'][_0xd3c0('0x73')]};}if(_0xa26a02[_0xd3c0('0x74')]){_0x5ccfd8[_0xd3c0('0x74')]={'id':_0xa26a02[_0xd3c0('0x74')]['id'],'name':_0xa26a02['Interval']['name']};}var _0x498204=md5(JSON['stringify'](_0x5ccfd8));if(_0xa26a02['md5']!==_0x498204){_0xa26a02['md5']=_0x498204;emit(util['format'](_0xd3c0('0x75'),_0x5ccfd8[_0xd3c0('0x41')]),_0xd3c0('0x76'),_0x5ccfd8);}}}function emitCampaignSummary(_0x256a16){if(_0x256a16[_0xd3c0('0x4a')]===_0xd3c0('0x77')){emit(util[_0xd3c0('0x78')]('campaign:ivr:%s',_0x256a16[_0xd3c0('0x41')]),_0xd3c0('0x79'),_0x256a16);}}function checkGetDataPredictive(_0x965fec){if(isNotNull(_0x965fec)&&!_['isEmpty'](_0x965fec)){loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x7b'));loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x7c'),_0x965fec[_0xd3c0('0x6e')]);loggerPredictive['info'](_0xd3c0('0x7d'),_0x965fec[_0xd3c0('0x65')]);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x7e'),_0x965fec[_0xd3c0('0x68')]);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x7f'),_0x965fec[_0xd3c0('0x80')]);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x81'),_0x965fec[_0xd3c0('0x66')]);loggerPredictive[_0xd3c0('0x7a')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x965fec[_0xd3c0('0x67')]);loggerPredictive[_0xd3c0('0x7a')]('---------------------------');if(_0x965fec['predictiveIntervalTotalCalls']>0x0){if(!_[_0xd3c0('0x3d')](_0x965fec[_0xd3c0('0x67')])&&_0x965fec[_0xd3c0('0x67')]>0x0){return!![];}loggerPredictive['info'](_0xd3c0('0x82'));if(!_['isUndefined'](_0x965fec[_0xd3c0('0x66')])&&_0x965fec[_0xd3c0('0x66')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0xd3c0('0x83'));}}else{loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x84'));}return![];}function mergeDataErlangB(_0x236cca){return function(_0x216b95){loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x85'));loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x86'),_0x216b95[_0xd3c0('0x87')]);loggerPredictive['info'](_0xd3c0('0x88'),_0x216b95[_0xd3c0('0x6f')]);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x89'),_0x216b95['erlangAbandonmentRate']);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x8a'),_0x216b95['erlangBusyFactor']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x216b95[_0xd3c0('0x70')]);loggerPredictive[_0xd3c0('0x7a')]('---------------------------');_['merge'](_0x236cca,_0x216b95);};}function getDiff(_0x190735){var _0x493ba8=moment()[_0xd3c0('0x47')](0x0);var _0x5b5761=moment(_0x190735)[_0xd3c0('0x47')](0x0);return _0x493ba8[_0xd3c0('0x48')](_0x5b5761,_0xd3c0('0x8b'));}function ifInterval(_0x11d4ed,_0x349b1a){if(_[_0xd3c0('0x3d')](_0x349b1a)){return![];}return getDiff(_0x349b1a)<_0x11d4ed*0x3c;}function freeVariablesPredictive(_0x21aeae){if(isNotNull(_0x21aeae)){if(!_['isUndefined'](_0x21aeae[_0xd3c0('0x29')])){_0x21aeae[_0xd3c0('0x29')]=undefined;loggerPredictive[_0xd3c0('0x7a')](_0x21aeae[_0xd3c0('0x41')],_0xd3c0('0x8c'));}if(!_[_0xd3c0('0x3d')](_0x21aeae['startPredictive'])){_0x21aeae[_0xd3c0('0x28')]=undefined;loggerPredictive[_0xd3c0('0x7a')](_0x21aeae[_0xd3c0('0x41')],_0xd3c0('0x8d'));}if(!_[_0xd3c0('0x3d')](_0x21aeae[_0xd3c0('0x8e')])){clearInterval(_0x21aeae[_0xd3c0('0x8e')]);_0x21aeae[_0xd3c0('0x8e')]=undefined;loggerPredictive[_0xd3c0('0x7a')](_0x21aeae[_0xd3c0('0x41')],_0xd3c0('0x8f'));}}}function erlangb(_0x28377d,_0x4ee2c7){if(_0x4ee2c7===0x0){return 0x0;}var _0x4dcda3=0x1;for(var _0x1d069b=0x1;_0x1d069b<=_0x4ee2c7;_0x1d069b+=0x1){_0x4dcda3=0x1+_0x4dcda3*_0x1d069b/_0x28377d;}return 0x1/_0x4dcda3;}function isVoiceQueueOutbound(_0x2d6a0f){return _0x2d6a0f===_0xd3c0('0x90');}function isNotPreview(_0x33271e){return _0x33271e!==_0xd3c0('0x1f');}function isCampaignIvr(_0x5defac){return _0x5defac===_0xd3c0('0x77');}function getCallerId(_0x16904e,_0x117d48,_0x2662c4){if(!_['isUndefined'](_0x2662c4)&&typeof _0x2662c4==='string'&&!_[_0xd3c0('0x91')](_0x2662c4)){if(!_[_0xd3c0('0x3d')](_0x117d48)&&typeof _0x117d48==='string'&&!_[_0xd3c0('0x91')](_0x117d48)){return util['format'](_0xd3c0('0x92'),_0x117d48,_0x2662c4);}return util[_0xd3c0('0x78')](_0xd3c0('0x92'),_0x2662c4,_0x2662c4);}if(!_[_0xd3c0('0x3d')](_0x16904e)&&typeof _0x16904e==='string'&&!_['isEmpty'](_0x16904e)){return _0x16904e;}return _0xd3c0('0x93');}function loggerCatchQueueSummary(_0xe8df64,_0x4dfd5e){return function(_0x2cd7af){freeVariablesPredictive(_0x4dfd5e);emitVoiceQueueSummary(_0x4dfd5e);emitCampaignSummary(_0x4dfd5e);loggerSyncQueueSummary[_0xd3c0('0x94')](_0xe8df64,util['inspect'](_0x2cd7af,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x87f169,_0x45d6f6){return function(_0x5a3ca6){loggerPredictive[_0xd3c0('0x94')](_0x45d6f6['name'],_0x87f169);loggerPredictive[_0xd3c0('0x94')](_0x5a3ca6[_0xd3c0('0x95')]);freeVariablesPredictive(_0x45d6f6);};}function loggerCatch(_0x11cd68){return function(_0x24cd9e){logger[_0xd3c0('0x94')](_0x11cd68,util[_0xd3c0('0x96')](_0x24cd9e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x56d638){return _0x56d638&&!_[_0xd3c0('0x3d')](_0x56d638)&&_0x56d638[_0xd3c0('0x97')]>0x0;}function decremetOriginate(_0x108211){if(!_[_0xd3c0('0x3d')](_0x108211)&&_0x108211!==null){if(typeof _0x108211['originated']!==_0xd3c0('0x98')){if(_0x108211[_0xd3c0('0x99')]>0x0){_0x108211[_0xd3c0('0x99')]-=0x1;}else{logger['error'](_0xd3c0('0x9a'));}}}else{logger[_0xd3c0('0x94')](_0xd3c0('0x9b'));}}function checkContactLowerLimitOriginate(_0x3ff2e7,_0x48b9ea,_0x1b190e){if(_0x48b9ea>_0x1b190e){for(var _0x413c89=0x0;_0x413c89<_0x48b9ea-_0x1b190e;_0x413c89+=0x1){decremetOriginate(_0x3ff2e7);}}}function loggerGetContactDialer(_0x32fd74,_0x5ce8be,_0x45116c){return function(_0x199ba7){checkContactLowerLimitOriginate(_0x5ce8be,_0x45116c,0x0);logger[_0xd3c0('0x94')](_0x32fd74,util[_0xd3c0('0x96')](_0x199ba7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x227196){return function(_0x43885d){if(isNotNull(_0x43885d)&&isNotNull(_0x43885d[0x0])){if(_0x43885d[0x0][_0xd3c0('0x9c')]>0x0){_0x227196[_0xd3c0('0x3e')]=_0xd3c0('0x9d');logger[_0xd3c0('0x7a')](_0xd3c0('0x9e')+_0x227196[_0xd3c0('0x41')],_0x43885d[0x0][_0xd3c0('0x9c')],'contacts');}else{_0x227196[_0xd3c0('0x3e')]=_0xd3c0('0x9f');logger[_0xd3c0('0x7a')](_0xd3c0('0xa0')+_0x227196[_0xd3c0('0x41')]);}}};}function notSendMessagesQueue(_0x2df9ff){if(_0x2df9ff[_0xd3c0('0xa1')]){freeVariablesPredictive(_0x2df9ff);if(_0x2df9ff[_0xd3c0('0x99')]===0x0&&_0x2df9ff[_0xd3c0('0xa2')]===0x0&&_0x2df9ff[_0xd3c0('0xa3')]===0x0&&(_0x2df9ff['pTalking']||0x0)===0x0){_0x2df9ff[_0xd3c0('0xa1')]=![];_0x2df9ff[_0xd3c0('0x4d')]=0x0;_0x2df9ff[_0xd3c0('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xd3c0('0x94')](_0xd3c0('0xa4'),_0x2df9ff[_0xd3c0('0x41')],_0xd3c0('0xa5'));}else{_0x2df9ff[_0xd3c0('0x3e')]=_0xd3c0('0xa6');loggerSyncQueueSummary[_0xd3c0('0x94')](_0xd3c0('0xa4'),_0x2df9ff[_0xd3c0('0x41')],'is\x20disactive');}emitVoiceQueueSummary(_0x2df9ff);}}function notSendMessagesCampaign(_0x17111f){if(_0x17111f[_0xd3c0('0xa1')]){if(_0x17111f['originated']===0x0){_0x17111f[_0xd3c0('0xa1')]=![];_0x17111f['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xd3c0('0x94')](_0xd3c0('0xa7'),_0x17111f[_0xd3c0('0x41')],_0xd3c0('0xa5'));}else{_0x17111f[_0xd3c0('0x3e')]=_0xd3c0('0xa6');loggerSyncQueueSummary[_0xd3c0('0x94')](_0xd3c0('0xa7'),_0x17111f[_0xd3c0('0x41')],'is\x20disactive');}emitCampaignSummary(_0x17111f);}}function createObjHistory(_0x7486d7,_0x35591b,_0x5497de,_0x6c220b,_0x458661){_0x7486d7[_0xd3c0('0x3e')]=_0x5497de;var _0x1cc769=new Action(_0x7486d7,_0x35591b);var _0x465bc9=new History(_0x1cc769);_0x465bc9['state']=_0x6c220b;_0x465bc9[_0xd3c0('0xa8')]=_0x458661;_0x465bc9[_0xd3c0('0xa9')]=_0x1cc769[_0xd3c0('0xaa')];return _0x465bc9;}Dialer[_0xd3c0('0x1a')][_0xd3c0('0x3c')]=function(){var _0x31bf29=this;setInterval(function(){_0x31bf29[_0xd3c0('0xab')](_0x31bf29[_0xd3c0('0xac')],_0xd3c0('0xad'));_0x31bf29['clearZombieChannels'](_0x31bf29[_0xd3c0('0x26')],'[actions]');},0x32c8);};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xab')]=function(_0x33af02,_0x475d1a){var _0x578a31=this;for(var _0x383401 in _0x33af02){if(typeof _0x33af02[_0x383401]!=='undefined'){this[_0xd3c0('0x1e')][_0xd3c0('0x1b')](function(){if(!_[_0xd3c0('0xae')](_0x33af02[_0x383401])){return ami[_0xd3c0('0xaf')]({'action':'status','channel':_0x33af02[_0x383401][_0xd3c0('0xb0')]})[_0xd3c0('0xb1')](function(_0x218eef){if(_0x218eef[_0xd3c0('0x3e')]===_0xd3c0('0xb2')){setTimeout(function(){if(_0x33af02[_0x383401]&&_0x33af02[_0x383401][_0xd3c0('0x4a')]!=='ivr'){_0x578a31[_0xd3c0('0xb3')](_0x578a31[_0xd3c0('0x20')][_0x33af02[_0x383401][_0xd3c0('0xb4')]]);logger['error'](_0xd3c0('0xb5'),_0x475d1a,_0x383401,_0x33af02[_0x383401][_0xd3c0('0xb4')]);delete _0x33af02[_0x383401];}if(_0x33af02[_0x383401]&&_0x33af02[_0x383401][_0xd3c0('0x4a')]===_0xd3c0('0x77')){_0x578a31[_0xd3c0('0xb3')](_0x578a31[_0xd3c0('0x21')][_0x33af02[_0x383401][_0xd3c0('0xb4')]]);logger[_0xd3c0('0x94')](_0xd3c0('0xb6'),_0x475d1a,_0x383401,_0x33af02[_0x383401]['queue']);delete _0x33af02[_0x383401];}},0x2328);}});}});}}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xb7')]=function(_0x1a1bf7){return BPromise[_0xd3c0('0xb8')]()['then'](cmHopper[_0xd3c0('0xb7')](_0x1a1bf7))[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xb9')));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xba')]=function(_0xdfba91){return BPromise[_0xd3c0('0xb8')]()[_0xd3c0('0xbb')](cmHopperBlack['checkIsBlackList'](_0xdfba91))['catch'](loggerCatch(_0xd3c0('0xbc')));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xbd')]=function(_0x5cd313){return BPromise[_0xd3c0('0xb8')]()['then'](cmHopperBlack[_0xd3c0('0xbd')](_0x5cd313))[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xbe')));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xbf')]=function(_0x5804d8){return BPromise[_0xd3c0('0xb8')]()[_0xd3c0('0xbb')](cmHopperHistory[_0xd3c0('0xc0')](_0x5804d8))[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xc1')));};Dialer['prototype']['rescheduleContact']=function(_0x5d4df1){return BPromise[_0xd3c0('0xb8')]()[_0xd3c0('0xbb')](cmHopper[_0xd3c0('0xc2')](_0x5d4df1))[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xc3')));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xc4')]=function(_0x1da561,_0xc2d7a8,_0x194a6f){return BPromise[_0xd3c0('0xb8')]()['then'](cmHopper[_0xd3c0('0xc4')](_0x1da561,_0xc2d7a8,_0x194a6f))['catch'](loggerCatch(_0xd3c0('0xc5')));};Dialer['prototype']['getContactDialer']=function(_0x6345df,_0x3d71ea,_0x4c6d9e,_0x3e73db,_0x2a9335){return BPromise[_0xd3c0('0xb8')]()[_0xd3c0('0xbb')](cmHopper[_0xd3c0('0xc6')](_0x6345df,_0x3d71ea,_0x4c6d9e,_0x3e73db))[_0xd3c0('0xb1')](function(_0x4ddd2c){_0x2a9335[_0xd3c0('0xc7')]-=_0x4c6d9e;_0x2a9335[_0xd3c0('0xc7')]=_0x2a9335[_0xd3c0('0xc7')]>0x0?_0x2a9335[_0xd3c0('0xc7')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x4ddd2c);});};Dialer[_0xd3c0('0x1a')]['getContactDialerIvr']=function(_0x3a22c7,_0x272a81,_0x4215c0,_0xc4fbf3){return BPromise[_0xd3c0('0xb8')]()['then'](cmHopper[_0xd3c0('0xc8')](_0x3a22c7,_0x272a81,_0x4215c0))[_0xd3c0('0xb1')](function(_0xbe90c3){_0xc4fbf3[_0xd3c0('0xc7')]-=_0x272a81;_0xc4fbf3[_0xd3c0('0xc7')]=_0xc4fbf3['temp']>0x0?_0xc4fbf3['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xbe90c3);});};Dialer['prototype'][_0xd3c0('0xc9')]=function(_0x363def){return BPromise[_0xd3c0('0xb8')]()['then'](voiceQueueRt[_0xd3c0('0xc9')](_0x363def))[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xca')));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xcb')]=function(_0x1d3e7e){return BPromise['resolve']()[_0xd3c0('0xbb')](cmHopper[_0xd3c0('0xcb')](_0x1d3e7e))['catch'](loggerCatch(_0xd3c0('0xcc')));};Dialer['prototype'][_0xd3c0('0xcd')]=function(_0x29f1a6){return BPromise[_0xd3c0('0xb8')]()['then'](cmHopperHistory[_0xd3c0('0xcd')](_0x29f1a6))[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xce')));};Dialer['prototype'][_0xd3c0('0xb3')]=function(_0xae8698){if(!_[_0xd3c0('0x3d')](_0xae8698)&&_0xae8698!==null){if(typeof _0xae8698[_0xd3c0('0x99')]!==_0xd3c0('0x98')){if(_0xae8698['originated']>0x0){_0xae8698[_0xd3c0('0x99')]-=0x1;}else{logger[_0xd3c0('0x94')](_0xd3c0('0xcf'));}}}else{logger[_0xd3c0('0x94')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xd3c0('0x1a')]['loggerHandler']=function(_0x3c5eb3,_0x363534){var _0x416b43=this;return function(_0x1e7010){_0x416b43[_0xd3c0('0xb3')](_0x363534);logger[_0xd3c0('0x94')](_0x3c5eb3,util[_0xd3c0('0x96')](_0x1e7010,{'showHidden':![],'depth':null}));};};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xd0')]=function(_0x2e7127,_0x459bc1,_0x30fa7b){var _0x287354={'state':0x19,'statedesc':_0xd3c0('0xd1')};this[_0xd3c0('0xb3')](_0x459bc1);this[_0xd3c0('0xd2')](_['merge'](_0x287354,_[_0xd3c0('0xd3')](_0x30fa7b,['ContactId',_0xd3c0('0xd4'),'UserId',_0xd3c0('0xd5'),_0xd3c0('0xd6')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xd3c0('0x94')](_0x2e7127);};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xd7')]=function(_0xb360a0){return _0xb360a0==='Success';};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xd8')]=function(_0x389617){return!_[_0xd3c0('0x3d')](_0x389617)&&_0x389617&&!_['isUndefined'](_0x389617[_0xd3c0('0x41')])&&!_['isUndefined'](_0x389617[_0xd3c0('0x72')])&&_0x389617[_0xd3c0('0x72')]&&(this[_0xd3c0('0x23')][util[_0xd3c0('0x78')](_0xd3c0('0xd9'),_0x389617[_0xd3c0('0x41')])][_0xd3c0('0xda')]===_0xd3c0('0xdb')||this[_0xd3c0('0x23')][util[_0xd3c0('0x78')](_0xd3c0('0xd9'),_0x389617['name'])][_0xd3c0('0xda')]==='unmonitored');};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xd2')]=function(_0x4d07bd,_0x1ef481,_0x3fe1c0){this['createHistory'](_0x4d07bd)[_0xd3c0('0xb1')](loggerCatch(_0x1ef481));this['moveContactManagedDialer'](_0x4d07bd)[_0xd3c0('0xb1')](loggerCatch(_0x3fe1c0));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x36')]=function(_0x4118fb){var _0x4e455a=this[_0xd3c0('0xac')][_0x4118fb[_0xd3c0('0xdc')]];var _0x38c158;if(!_[_0xd3c0('0xae')](_0x4118fb)&&!_[_0xd3c0('0xae')](_0x4118fb['variable'])&&!_[_0xd3c0('0xae')](_0x4118fb[_0xd3c0('0xdd')][_0xd3c0('0xde')])&&_0x4118fb['exten']==='xcally-motion-dialer'&&_0x4e455a){if(_0x4e455a[_0xd3c0('0x4a')]!==_0xd3c0('0x77')&&this['voiceQueues'][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xdf')]&&_0x4118fb[_0xd3c0('0xe0')]==='HANGUP'){delete this[_0xd3c0('0xac')][_0x4118fb[_0xd3c0('0xdc')]];this['updateOriginated'](this[_0xd3c0('0x20')][_0x4e455a[_0xd3c0('0xb4')]]);this[_0xd3c0('0x20')][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xe1')]+=0x1;this[_0xd3c0('0x20')][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xe2')]+=0x1;_0x38c158=new Hangup(_0x4e455a,_0x4118fb);_0x38c158['state']=0x12;_0x38c158['statedesc']='HangupInAMD';_0x38c158[_0xd3c0('0xe3')]=_0xd3c0('0xe4');ami[_0xd3c0('0x49')](_0xd3c0('0xe5'),ut[_0xd3c0('0xe6')](_0x38c158,_0xd3c0('0xe7')));this[_0xd3c0('0xd2')](_0x38c158,_0xd3c0('0xe8'),'[syncHangupInAMD]');}if(_0x4e455a[_0xd3c0('0x4a')]!==_0xd3c0('0x77')&&this['voiceQueues'][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xdf')]&&_0x4118fb[_0xd3c0('0xe0')]===_0xd3c0('0xe9')){var _0x35bcc0=this;return new BPromise(function(_0x3fd3d8,_0x218f5b){delete _0x35bcc0['uniqueId'][_0x4118fb[_0xd3c0('0xdc')]];_0x35bcc0['updateOriginated'](_0x35bcc0[_0xd3c0('0x20')][_0x4e455a[_0xd3c0('0xb4')]]);_0x35bcc0['voiceQueues'][_0x4e455a[_0xd3c0('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x35bcc0[_0xd3c0('0x20')][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xe2')]+=0x1;var _0xe0d727=_0x35bcc0['voiceQueues'][_0x4e455a[_0xd3c0('0xb4')]];var _0x362ecf=new Hangup(_0x4e455a,_0x4118fb);_0x362ecf[_0xd3c0('0xea')]=0x13;_0x362ecf[_0xd3c0('0xa8')]=_0xd3c0('0xeb');_0x362ecf[_0xd3c0('0xe3')]='AMD';_0x362ecf[_0xd3c0('0xec')]+=0x1;_0x362ecf[_0xd3c0('0xed')]+=0x1;_0x362ecf['amd']=!![];ami[_0xd3c0('0x49')](_0xd3c0('0xe5'),ut[_0xd3c0('0xe6')](_0x362ecf,_0xd3c0('0xe7')));_0x35bcc0['createHistory'](_0x362ecf)[_0xd3c0('0xb1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x362ecf[_0xd3c0('0xee')]+_0x362ecf[_0xd3c0('0xef')]+_0x362ecf[_0xd3c0('0xf0')]+_0x362ecf[_0xd3c0('0xf1')]+_0x362ecf[_0xd3c0('0xf2')]+_0x362ecf['countabandonedretry']+_0x362ecf[_0xd3c0('0xec')]+_0x362ecf['countagentrejectretry']>=_0xe0d727[_0xd3c0('0xf3')]){_0x35bcc0[_0xd3c0('0xf4')](_0x362ecf,_0x3fd3d8,_0x218f5b,_0xd3c0('0xf5'));}else{if(_0x362ecf[_0xd3c0('0xec')]>=_0xe0d727['dialMachineMaxRetry']){_0x35bcc0[_0xd3c0('0xf6')](_0x362ecf,_0x3fd3d8,_0x218f5b,_0xd3c0('0xf7'));}else{_0x35bcc0[_0xd3c0('0xc2')]({'active':![],'countmachineretry':_0x362ecf['countmachineretry'],'scheduledat':moment()[_0xd3c0('0xf8')](_0xe0d727['dialMachineRetryFrequency'],_0xd3c0('0xf9'))[_0xd3c0('0x78')](_0xd3c0('0xfa')),'ContactId':_0x362ecf[_0xd3c0('0xfb')],'ListId':_0x362ecf[_0xd3c0('0xd4')],'VoiceQueueId':_0x362ecf['VoiceQueueId']||undefined,'CampaignId':_0x362ecf[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch('[rescheduleContact][Machine]'));_0x3fd3d8({'reschedule':0x1});}}});}if(_0x4e455a['type']===_0xd3c0('0x77')&&this[_0xd3c0('0x21')][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xdf')]&&_0x4118fb[_0xd3c0('0xe0')]==='HANGUP'){delete this[_0xd3c0('0xac')][_0x4118fb[_0xd3c0('0xdc')]];this[_0xd3c0('0xb3')](this['campaigns'][_0x4e455a[_0xd3c0('0xb4')]]);_0x38c158=new Hangup(_0x4e455a,_0x4118fb);_0x38c158['state']=0x12;_0x38c158['statedesc']=_0xd3c0('0xfc');_0x38c158[_0xd3c0('0xe3')]='AMD';ami[_0xd3c0('0x49')]('custom:amd',ut['buildObj'](_0x38c158,'amd'));this[_0xd3c0('0xd2')](_0x38c158,'[syncHangupInAMDIvr][createHistory]',_0xd3c0('0xfd'));}if(_0x4e455a[_0xd3c0('0x4a')]===_0xd3c0('0x77')&&this[_0xd3c0('0x21')][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xdf')]&&_0x4118fb[_0xd3c0('0xe0')]==='MACHINE'){var _0x35bcc0=this;return new BPromise(function(_0x20c28b,_0x2de33f){delete _0x35bcc0['uniqueId'][_0x4118fb['uniqueid']];_0x35bcc0[_0xd3c0('0xb3')](_0x35bcc0[_0xd3c0('0x21')][_0x4e455a['queue']]);_0x35bcc0[_0xd3c0('0x21')][_0x4e455a[_0xd3c0('0xb4')]][_0xd3c0('0xe1')]+=0x1;_0x35bcc0[_0xd3c0('0x21')][_0x4e455a['queue']][_0xd3c0('0xe2')]+=0x1;var _0x30bd1c=_0x35bcc0[_0xd3c0('0x21')][_0x4e455a[_0xd3c0('0xb4')]];var _0x2ff20a=new Hangup(_0x4e455a,_0x4118fb);_0x2ff20a[_0xd3c0('0xea')]=0x13;_0x2ff20a['statedesc']=_0xd3c0('0xeb');_0x2ff20a[_0xd3c0('0xe3')]=_0xd3c0('0xe4');_0x2ff20a[_0xd3c0('0xec')]+=0x1;_0x2ff20a[_0xd3c0('0xed')]+=0x1;_0x2ff20a['amd']=!![];ami['emit'](_0xd3c0('0xe5'),ut['buildObj'](_0x2ff20a,'amd'));_0x35bcc0[_0xd3c0('0xcd')](_0x2ff20a)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xfe')));if(_0x2ff20a['countbusyretry']+_0x2ff20a[_0xd3c0('0xef')]+_0x2ff20a[_0xd3c0('0xf0')]+_0x2ff20a[_0xd3c0('0xf1')]+_0x2ff20a[_0xd3c0('0xf2')]+_0x2ff20a[_0xd3c0('0xff')]+_0x2ff20a[_0xd3c0('0xec')]+_0x2ff20a[_0xd3c0('0x100')]>=_0x30bd1c['dialGlobalMaxRetry']){_0x35bcc0[_0xd3c0('0xf4')](_0x2ff20a,_0x20c28b,_0x2de33f,_0xd3c0('0xf5'));}else{if(_0x2ff20a['countmachineretry']>=_0x30bd1c['dialMachineMaxRetry']){_0x35bcc0[_0xd3c0('0xf6')](_0x2ff20a,_0x20c28b,_0x2de33f,_0xd3c0('0xf7'));}else{_0x35bcc0[_0xd3c0('0xc2')]({'active':![],'countmachineretry':_0x2ff20a[_0xd3c0('0xec')],'scheduledat':moment()[_0xd3c0('0xf8')](_0x30bd1c['dialMachineRetryFrequency'],_0xd3c0('0xf9'))['format'](_0xd3c0('0xfa')),'ContactId':_0x2ff20a[_0xd3c0('0xfb')],'ListId':_0x2ff20a[_0xd3c0('0xd4')],'VoiceQueueId':_0x2ff20a[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x2ff20a[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x101')));_0x20c28b({'reschedule':0x1});}}});}}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x33')]=function(_0x360300){var _0x16f2f3=this[_0xd3c0('0xac')][_0x360300[_0xd3c0('0xdc')]];var _0x16c6c8=this;var _0x503e07;if(_0x16f2f3&&_0x16f2f3[_0xd3c0('0x4a')]===_0xd3c0('0x77')){delete this[_0xd3c0('0xac')][_0x360300[_0xd3c0('0xdc')]];this[_0xd3c0('0xb3')](this[_0xd3c0('0x21')][_0x16f2f3[_0xd3c0('0xb4')]]);this['campaigns'][_0x16f2f3['queue']]['ivrAnswerCallsDay']+=0x1;_0x503e07=new Hangup(_0x16f2f3,_0x360300);this[_0xd3c0('0xcd')](_0x503e07)['catch'](loggerCatch(_0xd3c0('0x102')));this[_0xd3c0('0xcb')](_0x503e07)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x103')));}if(_0x16f2f3&&_0x16f2f3[_0xd3c0('0x4a')]!==_0xd3c0('0x77')&&isNotNull(this[_0xd3c0('0x20')][_0x16f2f3['queue']][_0xd3c0('0x104')])){delete this[_0xd3c0('0xac')][_0x360300[_0xd3c0('0xdc')]];this[_0xd3c0('0xb3')](this[_0xd3c0('0x20')][_0x16f2f3[_0xd3c0('0xb4')]]);this[_0xd3c0('0x20')][_0x16f2f3[_0xd3c0('0xb4')]]['outboundAnswerCallsDay']+=0x1;this[_0xd3c0('0x20')][_0x16f2f3[_0xd3c0('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x503e07=new Hangup(_0x16f2f3,_0x360300);_0x503e07[_0xd3c0('0xea')]=0x10;_0x503e07[_0xd3c0('0xa8')]=_0xd3c0('0x105');_0x503e07[_0xd3c0('0xe3')]=_0xd3c0('0x106');this[_0xd3c0('0xcd')](_0x503e07)['catch'](loggerCatch(_0xd3c0('0x102')));this[_0xd3c0('0xcb')](_0x503e07)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x103')));}if(_0x16f2f3&&_0x16f2f3[_0xd3c0('0x4a')]!==_0xd3c0('0x77')&&!isNotNull(this[_0xd3c0('0x20')][_0x16f2f3[_0xd3c0('0xb4')]][_0xd3c0('0x104')])){delete this[_0xd3c0('0xac')][_0x360300[_0xd3c0('0xdc')]];this[_0xd3c0('0xb3')](this[_0xd3c0('0x20')][_0x16f2f3[_0xd3c0('0xb4')]]);this[_0xd3c0('0x20')][_0x16f2f3[_0xd3c0('0xb4')]][_0xd3c0('0x64')]+=0x1;_0x503e07=new Hangup(_0x16f2f3,_0x360300);_0x503e07[_0xd3c0('0xea')]=0xc;_0x503e07['statedesc']=_0x360300[_0xd3c0('0x107')];_0x503e07[_0xd3c0('0xe3')]='Unknow';this[_0xd3c0('0xcd')](_0x503e07)['catch'](loggerCatch(_0xd3c0('0x102')));this[_0xd3c0('0xcb')](_0x503e07)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x103')));}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x108')]=function(_0x387177){var _0x56781f=this['uniqueId'][_0x387177['uniqueid']];var _0x39dc65=this;if(this[_0xd3c0('0x20')][_0x387177[_0xd3c0('0xb4')]]){if(_0x56781f&&_0x56781f[_0xd3c0('0x4a')]!==_0xd3c0('0x77')){delete this[_0xd3c0('0xac')][_0x387177[_0xd3c0('0xdc')]];this[_0xd3c0('0x20')][_0x387177['queue']][_0xd3c0('0xe1')]+=0x1;var _0x113b70=new AgentComplete(_0x56781f,_0x387177);if(_0x387177[_0xd3c0('0x109')]==='agent'){_0x113b70[_0xd3c0('0x10a')]=this['voiceQueues'][_0x387177[_0xd3c0('0xb4')]][_0xd3c0('0x10b')]&&this[_0xd3c0('0x20')][_0x387177['queue']][_0xd3c0('0x10c')]?moment()[_0xd3c0('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x113b70)['catch'](loggerCatch(_0xd3c0('0x10d')));this[_0xd3c0('0xcb')](_0x113b70)['catch'](loggerCatch(_0xd3c0('0x10e')));}}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x10f')]=function(_0x15cc10){if(this['voiceQueues'][_0x15cc10[_0xd3c0('0xb4')]]){if(this[_0xd3c0('0xac')][_0x15cc10[_0xd3c0('0xdc')]]&&this['uniqueId'][_0x15cc10['uniqueid']]['type']!==_0xd3c0('0x77')){this[_0xd3c0('0xb3')](this[_0xd3c0('0x20')][_0x15cc10[_0xd3c0('0xb4')]]);this[_0xd3c0('0xac')][_0x15cc10[_0xd3c0('0xdc')]][_0xd3c0('0x110')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));}}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x111')]=function(_0x1a0d52){this[_0xd3c0('0xcd')](_0x1a0d52)[_0xd3c0('0xb1')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xd3c0('0xcb')](_0x1a0d52)['catch'](loggerCatch(_0xd3c0('0x112')));};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x2e')]=function(_0x2ec65f){var _0x414e7c=this[_0xd3c0('0xac')][_0x2ec65f[_0xd3c0('0xdc')]];var _0x8f6aaa=this;if(this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]]){if(_0x414e7c&&_0x414e7c[_0xd3c0('0x4a')]!==_0xd3c0('0x77')){delete this[_0xd3c0('0xac')][_0x2ec65f['uniqueid']];this[_0xd3c0('0xb3')](this['voiceQueues'][_0x2ec65f[_0xd3c0('0xb4')]]);_0x414e7c[_0xd3c0('0x113')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));var _0x3fef27=new QueueCallerAbandon(_0x414e7c,_0x2ec65f);if(getSeconds(_0x414e7c['droptime'],_0x414e7c[_0xd3c0('0x114')])>=_0x414e7c['dialQueueTimeout']){this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]][_0xd3c0('0x68')]+=0x1;this['voiceQueues'][_0x2ec65f['queue']][_0xd3c0('0x5e')]+=0x1;this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3fef27['state']=0xa;_0x3fef27[_0xd3c0('0xa8')]=_0xd3c0('0x115');_0x3fef27[_0xd3c0('0x116')]='TIMEOUT';_0x3fef27[_0xd3c0('0x10a')]=this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]][_0xd3c0('0x10b')]?moment()[_0xd3c0('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x3fef27[_0xd3c0('0xf2')]+=0x1;_0x3fef27['countglobal']+=0x1;if(_0x3fef27[_0xd3c0('0xf2')]>=this['voiceQueues'][_0x2ec65f[_0xd3c0('0xb4')]][_0xd3c0('0x117')]){this[_0xd3c0('0x111')](_0x3fef27);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3fef27[_0xd3c0('0xf2')],'scheduledat':moment()[_0xd3c0('0xf8')](this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]][_0xd3c0('0x118')],_0xd3c0('0xf9'))[_0xd3c0('0x78')](_0xd3c0('0xfa')),'ContactId':_0x414e7c[_0xd3c0('0xfb')],'ListId':_0x414e7c['ListId'],'VoiceQueueId':_0x414e7c[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x414e7c['CampaignId']||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x119')));var _0x2724f4=new History(_0x3fef27);_0x2724f4[_0xd3c0('0xea')]=0xa;_0x2724f4[_0xd3c0('0xa8')]='Drop';_0x2724f4[_0xd3c0('0xaa')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));_0x2724f4['endtime']=_0x2724f4['starttime'];_0x2724f4[_0xd3c0('0x11a')]=_0x3fef27[_0xd3c0('0x11a')];_0x2724f4['calleridnum']=_0x3fef27[_0xd3c0('0x11b')];this[_0xd3c0('0xcd')](_0x2724f4)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x11c')));}}else{this[_0xd3c0('0x20')][_0x2ec65f['queue']][_0xd3c0('0x80')]+=0x1;this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]][_0xd3c0('0x5d')]+=0x1;_0x3fef27[_0xd3c0('0xea')]=0xb;_0x3fef27[_0xd3c0('0xa8')]=_0xd3c0('0x11d');_0x3fef27[_0xd3c0('0x116')]=_0xd3c0('0x11e');_0x3fef27[_0xd3c0('0xff')]+=0x1;_0x3fef27[_0xd3c0('0xed')]+=0x1;if(_0x3fef27[_0xd3c0('0xff')]>=this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]]['dialAbandonedMaxRetry']){this[_0xd3c0('0x111')](_0x3fef27);}else{this[_0xd3c0('0xc2')]({'active':![],'countabandonedretry':_0x3fef27[_0xd3c0('0xff')],'scheduledat':moment()['add'](this[_0xd3c0('0x20')][_0x2ec65f[_0xd3c0('0xb4')]]['dialAbandonedRetryFrequency'],'minutes')[_0xd3c0('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x414e7c['ContactId'],'ListId':_0x414e7c[_0xd3c0('0xd4')],'VoiceQueueId':_0x414e7c['VoiceQueueId']||undefined,'CampaignId':_0x414e7c[_0xd3c0('0xd6')]||undefined})['catch'](loggerCatch(_0xd3c0('0x11f')));var _0x2724f4=new History(_0x3fef27);_0x2724f4['state']=0xb;_0x2724f4[_0xd3c0('0xa8')]=_0xd3c0('0x11d');_0x2724f4[_0xd3c0('0xaa')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));_0x2724f4[_0xd3c0('0xa9')]=_0x2724f4[_0xd3c0('0xaa')];_0x2724f4[_0xd3c0('0x11a')]=_0x3fef27[_0xd3c0('0x11a')];_0x2724f4[_0xd3c0('0x11b')]=_0x3fef27[_0xd3c0('0x11b')];this['createHistory'](_0x2724f4)[_0xd3c0('0xb1')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x120')]=function(_0x14b443){if(this['actions'][_0x14b443[_0xd3c0('0xdc')]]){this[_0xd3c0('0x26')][_0x14b443['uniqueid']]['channel']=_0x14b443[_0xd3c0('0xb0')];}if(this[_0xd3c0('0xac')][_0x14b443[_0xd3c0('0xdc')]]){this['uniqueId'][_0x14b443[_0xd3c0('0xdc')]]['channel']=_0x14b443[_0xd3c0('0xb0')];}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x38')]=function(_0x2c3d65){if(strategy[this['voiceQueues'][this['actions'][_0x2c3d65[_0xd3c0('0x121')]][_0xd3c0('0xb4')]][_0xd3c0('0x4b')]]===_0xd3c0('0x19')){if(this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]]&&_[_0xd3c0('0xae')](this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]][_0xd3c0('0x122')])&&_0x2c3d65[_0xd3c0('0xda')]==='1'&&_0x2c3d65[_0xd3c0('0x123')]==='0'){if(this[_0xd3c0('0x22')][_0x2c3d65['stateinterface']]){if(!this[_0xd3c0('0x22')][_0x2c3d65[_0xd3c0('0x124')]][_0xd3c0('0x122')]){this[_0xd3c0('0x22')][_0x2c3d65[_0xd3c0('0x124')]][_0xd3c0('0x122')]=!![];this[_0xd3c0('0x26')][_0x2c3d65['actionid']][_0xd3c0('0x122')]=!![];this[_0xd3c0('0x26')][_0x2c3d65['actionid']][_0xd3c0('0x124')]=_0x2c3d65['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]][_0xd3c0('0xb4')]][_0xd3c0('0x4b')]]||'rrmemory')==='rrmemory'){if(this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]]){if(this[_0xd3c0('0x22')][_0x2c3d65[_0xd3c0('0x124')]]){this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]]['stateinterface']=_0x2c3d65[_0xd3c0('0x124')];if(_[_0xd3c0('0xae')](this[_0xd3c0('0x2b')][this[_0xd3c0('0x26')][_0x2c3d65['actionid']][_0xd3c0('0xb4')]])){this['queueBooked'][this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]=[];}this[_0xd3c0('0x2b')][this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]]['queue']][_0xd3c0('0x125')](_[_0xd3c0('0x126')](_[_0xd3c0('0xd3')](this[_0xd3c0('0x26')][_0x2c3d65[_0xd3c0('0x121')]],['idHopper','stateinterface']),{'status':_0x2c3d65[_0xd3c0('0xda')],'paused':_0x2c3d65['paused']}));}}}};function unlockQueueStatus(_0x4afe77,_0x5dfca2){setTimeout(function(){if(_[_0xd3c0('0x3d')](_0x4afe77[_0xd3c0('0x127')])){loggerBooked[_0xd3c0('0x94')](_0xd3c0('0x128'),_0x5dfca2);}_0x4afe77[_0xd3c0('0x127')]=!![];loggerBooked[_0xd3c0('0x7a')](_0xd3c0('0x129'),_0x5dfca2,JSON[_0xd3c0('0x46')](_['pick'](_0x4afe77,[_0xd3c0('0x41'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xd3c0('0x1a')][_0xd3c0('0x3a')]=function(_0x1e4090){var _0x49d136=this;var _0x3ad7ff=_0x49d136['voiceQueues'][_0x49d136['actions'][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]];if(strategy[this[_0xd3c0('0x20')][this['actions'][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]['strategy']]===_0xd3c0('0x19')){if(this[_0xd3c0('0x26')][_0x1e4090['actionid']]&&this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0x124')]){this['preview'][_0xd3c0('0x12a')](this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0x12b')],this[_0xd3c0('0x26')][_0x1e4090['actionid']]['stateinterface'])[_0xd3c0('0xb1')](function(_0x1f0e10){logger[_0xd3c0('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xd3c0('0x96')](_0x1f0e10,{'showHidden':![],'depth':null}));})[_0xd3c0('0x1d')](function(){_0x49d136['updateOriginated'](_0x49d136['voiceQueues'][_0x49d136[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]);_0x49d136[_0xd3c0('0x22')][_0x49d136[_0xd3c0('0x26')][_0x1e4090['actionid']]['stateinterface']][_0xd3c0('0x122')]=![];delete _0x49d136[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]];unlockQueueStatus(_0x3ad7ff);});}else{this[_0xd3c0('0xb3')](this[_0xd3c0('0x20')][this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x1e4090[_0xd3c0('0x121')]]['ContactId'],'ListId':this['actions'][_0x1e4090['actionid']][_0xd3c0('0xd4')],'VoiceQueueId':this[_0xd3c0('0x26')][_0x1e4090['actionid']][_0xd3c0('0xd5')]||undefined,'CampaignId':this['actions'][_0x1e4090[_0xd3c0('0x121')]]['CampaignId']||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x12c')));delete this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]];unlockQueueStatus(_0x3ad7ff);}}else if((strategy[this['voiceQueues'][this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]][_0xd3c0('0x4b')]]||_0xd3c0('0x18'))===_0xd3c0('0x18')){var _0x4bf7ba;if(this['actions'][_0x1e4090['actionid']]&&!_[_0xd3c0('0x91')](this[_0xd3c0('0x2b')][this['actions'][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]])){if(this[_0xd3c0('0x12d')][_0x49d136[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]){this['queueBookedRR'][_0x49d136['actions'][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]=this[_0xd3c0('0x12d')][this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]?this[_0xd3c0('0x12d')][this['actions'][_0x1e4090['actionid']][_0xd3c0('0xb4')]]:this[_0xd3c0('0x2b')][this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]]['queue']]?this[_0xd3c0('0x2b')][this['actions'][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]]['_rr']||0x0:0x0;}this[_0xd3c0('0x2b')][this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]][_0xd3c0('0x12e')]=this[_0xd3c0('0x12d')][this[_0xd3c0('0x26')][_0x1e4090[_0xd3c0('0x121')]][_0xd3c0('0xb4')]];for(var _0x235885=0x0;_0x235885=0x0;})[_0xd3c0('0xb1')](myreject(_0x5eebe6)));}}else{_0x1539e8[_0xd3c0('0x125')](ami[_0xd3c0('0xaf')]({'action':_0xd3c0('0x145'),'command':util[_0xd3c0('0x78')](_0xd3c0('0x146'),_0x5e6766,!_[_0xd3c0('0x3d')](config['timezones'][_0x50cc0b])?_0x50cc0b:'')})[_0xd3c0('0xbb')](function(_0x2f5dcd){return _0x2f5dcd[_0xd3c0('0x14a')][_0xd3c0('0x148')](_0xd3c0('0x149'))>=0x0;})['catch'](myreject(_0x5eebe6)));}BPromise[_0xd3c0('0x14b')](_0x1539e8)[_0xd3c0('0xbb')](function(_0x2a2b55){var _0x43c513=_[_0xd3c0('0x14c')](_0x2a2b55);if(_0x43c513){return _0x287cbc(_0x43c513);}else{_0xe27b47['message']=_0x1e44f0?_0xd3c0('0x14d'):_0xd3c0('0x14e');return _0x5eebe6(msgResponse(_0xd3c0('0x14f'),_0xd3c0('0x13f'),_0xd3c0('0x150')+_0x1e44f0+'\x20'+_0x1ae936+_0xd3c0('0x151')+util[_0xd3c0('0x96')](_0x5e6766,{'showHidden':![],'depth':null})+_0xd3c0('0x152')+_0x50cc0b));}})[_0xd3c0('0xb1')](function(_0x3f4fdf){return _0x5eebe6(msgResponse(_0xd3c0('0x13d'),_0xd3c0('0x13f'),JSON[_0xd3c0('0x46')](_0x3f4fdf)));});});};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x153')]=function(_0x53c6dc){var _0xcc2134=this;return function(){switch(_0x53c6dc['dialMethod']){case _0xd3c0('0x154'):freeVariablesPredictive(_0x53c6dc);_0xcc2134[_0xd3c0('0x155')](_0x53c6dc,0x1);break;case _0xd3c0('0x156'):freeVariablesPredictive(_0x53c6dc);_0xcc2134[_0xd3c0('0x155')](_0x53c6dc,_0x53c6dc[_0xd3c0('0x157')]);break;case _0xd3c0('0x158'):_0xcc2134[_0xd3c0('0x158')](_0x53c6dc);break;case _0xd3c0('0x159'):freeVariablesPredictive(_0x53c6dc);_0xcc2134['handlePower'](_0x53c6dc,0x1);break;default:freeVariablesPredictive(_0x53c6dc);logger[_0xd3c0('0x94')]('Queue',_0x53c6dc['name'],_0xd3c0('0x15a'));}};};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x15b')]=function(_0x5b831e){var _0x350a8e=this;return function(){_0x350a8e[_0xd3c0('0x15c')](_0x5b831e);};};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x9')]=function(_0x39e21d){var _0x5073c9=this;if(isNotPreview(_0x39e21d['dialMethod'])){if(isVoiceQueueOutbound(_0x39e21d[_0xd3c0('0x4a')])&&isActive(_0x39e21d[_0xd3c0('0x56')])){_0x39e21d['sendMessageOneNotActive']=!![];BPromise[_0xd3c0('0xb8')]()['then'](checkIsLoggedIn(_0x39e21d,_0x39e21d[_0xd3c0('0x4e')]))[_0xd3c0('0xbb')](checkIsActive(_0x39e21d,_0x39e21d[_0xd3c0('0x56')]))[_0xd3c0('0xbb')](checkInterval(_0x39e21d))['then'](_0x5073c9[_0xd3c0('0x13a')](_0x39e21d))[_0xd3c0('0xbb')](_0x5073c9['checkIfTime'](_0x39e21d[_0xd3c0('0x15d')],_0x39e21d[_0xd3c0('0x15e')],_0x39e21d[_0xd3c0('0x41')],_0x39e21d))[_0xd3c0('0xbb')](_0x5073c9['checkIfTimeIntervals'](_0x39e21d[_0xd3c0('0x74')],_0x39e21d[_0xd3c0('0x15e')],_0x39e21d[_0xd3c0('0x41')],_0x39e21d))[_0xd3c0('0xbb')](_0x5073c9[_0xd3c0('0x153')](_0x39e21d))[_0xd3c0('0xb1')](loggerCatchQueueSummary(_0xd3c0('0x15f'),_0x39e21d));}else{notSendMessagesQueue(_0x39e21d);}}else{freeVariablesPredictive(_0x39e21d);}};Dialer[_0xd3c0('0x1a')]['syncCampaigns']=function(){var _0x4c7569=this;var _0xc8427e;for(var _0x447d40 in this[_0xd3c0('0x21')]){if(typeof this[_0xd3c0('0x21')][_0x447d40]!==_0xd3c0('0x98')){_0xc8427e=this['campaigns'][_0x447d40];if(isCampaignIvr(_0xc8427e['type'])&&isActive(_0xc8427e[_0xd3c0('0x72')])){_0xc8427e['sendMessageOneNotActive']=!![];BPromise[_0xd3c0('0xb8')]()['then'](checkIsActive(_0xc8427e,_0xc8427e['active']))[_0xd3c0('0xbb')](checkInterval(_0xc8427e))[_0xd3c0('0xbb')](_0x4c7569[_0xd3c0('0x13a')](_0xc8427e))[_0xd3c0('0xbb')](_0x4c7569['checkIfTime'](_0xc8427e[_0xd3c0('0x15d')],_0xc8427e[_0xd3c0('0x15e')],_0xc8427e[_0xd3c0('0x41')],_0xc8427e))[_0xd3c0('0xbb')](_0x4c7569[_0xd3c0('0x13e')](_0xc8427e[_0xd3c0('0x74')],_0xc8427e[_0xd3c0('0x15e')],_0xc8427e['name'],_0xc8427e))['then'](_0x4c7569[_0xd3c0('0x15b')](_0xc8427e))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0xc8427e));}else{notSendMessagesCampaign(_0xc8427e);}}}};function getCallerIdRandom(_0x5440d5,_0x12bcb9){var _0x312bde;var _0x2e28c8;var _0x161276;if(_0x12bcb9<=0x0){_0x12bcb9=0x1;}_0x312bde=new RegExp(_0xd3c0('0x160')+_0x12bcb9+'}$');_0x2e28c8=Math[_0xd3c0('0x161')](0xa,_0x12bcb9-0x1);_0x161276=Math['pow'](0xa,_0x12bcb9)-0x1;return util['format']('%s',_[_0xd3c0('0x162')](_0x5440d5,_0x312bde,_[_0xd3c0('0x163')](_0x2e28c8,_0x161276)));}function extractCalleridName(_0x56de9d){var _0x261845=_0x56de9d[_0xd3c0('0x164')](/"(.*?)"/);return _0x261845?_0x261845[0x1]:_0x56de9d;}function extractCalleridNumber(_0x456023){var _0x19a2ba=_0x456023[_0xd3c0('0x164')](/<(.*?)>/);return _0x19a2ba?_0x19a2ba[0x1]:_0x456023;}Dialer[_0xd3c0('0x1a')][_0xd3c0('0x165')]=function(_0x535194,_0x52ac2f){var _0x5e4985=this;var _0x5b7364=uuid['v4']();this[_0xd3c0('0x26')][_0x5b7364]=new Action(_0x535194,_0x52ac2f,_0x5b7364);return new BPromise(function(_0x45a114,_0x109370){if(_[_0xd3c0('0x3d')](_0x535194)&&typeof _0x535194!==_0xd3c0('0x166')){return _0x109370(msgResponse(_0xd3c0('0x167'),_0xd3c0('0x13f'),_0xd3c0('0x168')));}if(_[_0xd3c0('0x3d')](_0x52ac2f['Contact'][_0xd3c0('0x169')])||_0x52ac2f[_0xd3c0('0x16a')][_0xd3c0('0x169')]===null){return _0x109370(msgResponse(_0xd3c0('0x167'),_0xd3c0('0x13f'),_0xd3c0('0x16b')));}var _0x279fc9={'XMD-CALLERID':_0x5e4985[_0xd3c0('0x26')][_0x5b7364][_0xd3c0('0x16c')](),'XMD-AGI':_0x535194[_0xd3c0('0x104')]?util[_0xd3c0('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x535194[_0xd3c0('0x104')]):_0xd3c0('0x16d'),'XMD-AGIAFTER':_0x535194[_0xd3c0('0x10b')]?util[_0xd3c0('0x78')](_0xd3c0('0x16e'),ipAgi,_0x535194[_0xd3c0('0x10b')]):'NONE','XMD-QUEUE':_0x535194[_0xd3c0('0x4a')]===_0xd3c0('0x90')?util[_0xd3c0('0x78')](_0xd3c0('0x16f'),_0x535194[_0xd3c0('0x41')],_0x535194[_0xd3c0('0x170')]||'',_0x535194['dialAgiAfterHangupAgent']?'c':'',_0x535194['dialQueueTimeout']||0x3):_0xd3c0('0x16d'),'XMD-CONTACTID':_0x52ac2f['ContactId'],'XMD-CDRTYPE':_0xd3c0('0x7'),'CALLERID(all)':_0x5e4985[_0xd3c0('0x26')][_0x5b7364][_0xd3c0('0x16c')](),'XMD-AMD':_0x535194[_0xd3c0('0xdf')]?_0xd3c0('0x171'):_0xd3c0('0x16d'),'XMD-DESTINATION':_0xd3c0('0x172')};if(_0x535194[_0xd3c0('0xdf')]){_0x279fc9[_0xd3c0('0x173')]=_0x535194[_0xd3c0('0x174')]||0x9c4;_0x279fc9[_0xd3c0('0x175')]=_0x535194['dialAMDGreeting']||0x5dc;_0x279fc9['XMD-AMDAFTERGREETINGSILENCE']=_0x535194['dialAMDAfterGreetingSilence']||0x320;_0x279fc9['XMD-AMDTOTALANALYSISTIME']=_0x535194[_0xd3c0('0x176')]||0x1388;_0x279fc9['XMD-AMDMINWORDLENGTH']=_0x535194[_0xd3c0('0x177')]||0x64;_0x279fc9[_0xd3c0('0x178')]=_0x535194[_0xd3c0('0x179')]||0x32;_0x279fc9[_0xd3c0('0x17a')]=_0x535194[_0xd3c0('0x17b')]||0x3;_0x279fc9[_0xd3c0('0x17c')]=_0x535194[_0xd3c0('0x17d')]||0x100;_0x279fc9[_0xd3c0('0x17e')]=_0x535194[_0xd3c0('0x17f')]||0x1388;}if(_0x535194['type']==='outbound'){_0x279fc9[_0xd3c0('0x180')]=_0x52ac2f[_0xd3c0('0xd5')];}else{_0x279fc9[_0xd3c0('0x181')]=_0x52ac2f[_0xd3c0('0xd6')];}for(var _0xcf4c0f in _0x52ac2f[_0xd3c0('0x16a')]){if(typeof _0x52ac2f[_0xd3c0('0x16a')][_0xcf4c0f]!==_0xd3c0('0x98')){if(isNotNull(_0x52ac2f[_0xd3c0('0x16a')][_0xcf4c0f])&&_0xcf4c0f!=='id'&&_0xcf4c0f!==_0xd3c0('0x182')&&_0xcf4c0f!==_0xd3c0('0x183')&&_0xcf4c0f!==_0xd3c0('0x184')){_0x279fc9[util[_0xd3c0('0x78')](_0xd3c0('0x185'),_0xd3c0('0x186'),_[_0xd3c0('0x187')](_0xcf4c0f))]=_0x52ac2f[_0xd3c0('0x16a')][_0xcf4c0f];}}}var _0x5b2557=_0x5e4985[_0xd3c0('0xd8')](_0x535194[_0xd3c0('0x71')])?getCallerId(_0x535194[_0xd3c0('0x71')][_0xd3c0('0x73')],_0x535194[_0xd3c0('0x188')],_0x535194[_0xd3c0('0x189')]>0x0?getCallerIdRandom(_0x535194[_0xd3c0('0x57')],_0x535194[_0xd3c0('0x189')]):_0x535194[_0xd3c0('0x57')]):getCallerId(_['isNil'](_0x535194[_0xd3c0('0x18a')])?_0x535194['Trunk'][_0xd3c0('0x73')]:_0x535194[_0xd3c0('0x18a')][_0xd3c0('0x73')],_0x535194[_0xd3c0('0x188')],_0x535194[_0xd3c0('0x189')]>0x0?getCallerIdRandom(_0x535194[_0xd3c0('0x57')],_0x535194['dialRandomLastDigitCallerIdNumber']):_0x535194['dialOriginateCallerIdNumber']);if(_0x5b2557){_0x279fc9[_0xd3c0('0x18b')]=_0x5e4985[_0xd3c0('0x26')][_0x5b7364][_0xd3c0('0x18c')]=extractCalleridName(_0x5b2557);_0x279fc9[_0xd3c0('0x18d')]=_0x5e4985[_0xd3c0('0x26')][_0x5b7364][_0xd3c0('0x18e')]=extractCalleridNumber(_0x5b2557);}return ami[_0xd3c0('0xaf')]({'actionid':_0x5b7364,'action':_0xd3c0('0x167'),'channel':_0x5e4985[_0xd3c0('0xd8')](_0x535194[_0xd3c0('0x71')])?util[_0xd3c0('0x78')]('SIP/%s/%s%s',_0x535194[_0xd3c0('0x71')][_0xd3c0('0x41')],isNotNull(_0x535194['dialPrefix'])?_0x535194[_0xd3c0('0x59')][_0xd3c0('0x18f')]()||'':'',_0x535194[_0xd3c0('0x190')]>0x0?_0x52ac2f[_0xd3c0('0x16a')][_0xd3c0('0x169')][_0xd3c0('0x191')](_0x535194[_0xd3c0('0x190')]):_0x52ac2f[_0xd3c0('0x16a')]['phone']):util[_0xd3c0('0x78')](_0xd3c0('0x192'),_[_0xd3c0('0xae')](_0x535194[_0xd3c0('0x18a')])?_0x535194[_0xd3c0('0x71')]['name']:_0x535194['TrunkBackup'][_0xd3c0('0x41')],isNotNull(_0x535194['dialPrefix'])?_0x535194[_0xd3c0('0x59')][_0xd3c0('0x18f')]()||'':'',_0x535194[_0xd3c0('0x190')]>0x0?_0x52ac2f[_0xd3c0('0x16a')]['phone'][_0xd3c0('0x191')](_0x535194[_0xd3c0('0x190')]):_0x52ac2f[_0xd3c0('0x16a')][_0xd3c0('0x169')]),'callerid':_0x5b2557,'Exten':'xcally-motion-dialer','Context':_0xd3c0('0x193'),'Priority':'1','variable':_0x279fc9,'timeout':(_0x535194[_0xd3c0('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b7364})['then'](function(_0x577113){return _0x45a114(_0x577113);})[_0xd3c0('0xb1')](function(_0x21216d){_0x535194[_0xd3c0('0x61')]+=0x1;var _0x150de2=new History(_0x5e4985[_0xd3c0('0x26')][_0x5b7364]);logger[_0xd3c0('0x94')](util[_0xd3c0('0x78')](_0xd3c0('0x194'),JSON[_0xd3c0('0x46')](_0x21216d)));_0x150de2[_0xd3c0('0xea')]=0xe;_0x150de2[_0xd3c0('0xa8')]=_0xd3c0('0x195');_0x150de2[_0xd3c0('0xaa')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));_0x150de2[_0xd3c0('0xa9')]=_0x150de2[_0xd3c0('0xaa')];_0x5e4985[_0xd3c0('0xcd')](_0x150de2)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x196')));_0x5e4985['moveContactManagedDialer'](_0x150de2)['catch'](loggerCatch(_0xd3c0('0x196')))[_0xd3c0('0x1d')](function(){delete _0x5e4985[_0xd3c0('0x26')][_0x5b7364];return _0x109370(msgResponse(_0xd3c0('0x167'),_0xd3c0('0x197'),_0xd3c0('0x198')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x5eff70){var _0x2b919a=this['actions'][_0x5eff70[_0xd3c0('0x121')]];if(_0x2b919a){delete this[_0xd3c0('0x26')][_0x5eff70[_0xd3c0('0x121')]];_0x2b919a[_0xd3c0('0x114')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));var _0x5e43fa=_0x2b919a['type']==='ivr'?this[_0xd3c0('0x21')][_0x2b919a[_0xd3c0('0xb4')]]:this[_0xd3c0('0x20')][_0x2b919a['getQueue']()];if(!this[_0xd3c0('0xd7')](_0x5eff70[_0xd3c0('0x199')])){this[_0xd3c0('0xb3')](_0x5e43fa);return this[_0xd3c0('0x19a')](_0x2b919a,_0x5e43fa,_0x5eff70)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x19b')));}this[_0xd3c0('0xac')][_0x5eff70['uniqueid']]=_0x2b919a;}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x19c')]=function(_0x11d6f3,_0xd2de1d,_0x8f624a){var _0x41970f=new History(_0xd2de1d);if(_0x41970f[_0xd3c0('0xee')]+_0x41970f['countcongestionretry']+_0x41970f[_0xd3c0('0xf0')]+_0x41970f[_0xd3c0('0xf1')]+_0x41970f[_0xd3c0('0xf2')]+_0x41970f[_0xd3c0('0xff')]+_0x41970f['countmachineretry']+_0x41970f[_0xd3c0('0x100')]>=_0x8f624a[_0xd3c0('0xf3')]-0x1){return!![];}switch(_0x11d6f3){case 0x3:if(_0x41970f[_0xd3c0('0xf0')]>=_0x8f624a[_0xd3c0('0x19d')]-0x1){return!![];}this[_0xd3c0('0xc2')]({'active':![],'countnoanswerretry':_0x41970f[_0xd3c0('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x8f624a[_0xd3c0('0x19e')],'minutes')[_0xd3c0('0x78')](_0xd3c0('0xfa')),'ContactId':_0x41970f['ContactId'],'ListId':_0x41970f[_0xd3c0('0xd4')],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x19f')));break;case 0x5:if(_0x41970f[_0xd3c0('0xee')]>=_0x8f624a[_0xd3c0('0x1a0')]-0x1){return!![];}this[_0xd3c0('0xc2')]({'active':![],'countbusyretry':_0x41970f[_0xd3c0('0xee')]+=0x1,'scheduledat':moment()[_0xd3c0('0xf8')](_0x8f624a[_0xd3c0('0x1a1')],_0xd3c0('0xf9'))['format'](_0xd3c0('0xfa')),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f[_0xd3c0('0xd4')],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1a2')));break;case 0x8:if(_0x41970f['countcongestionretry']>=_0x8f624a[_0xd3c0('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x41970f[_0xd3c0('0xef')]+=0x1,'scheduledat':moment()[_0xd3c0('0xf8')](_0x8f624a[_0xd3c0('0x1a4')],_0xd3c0('0xf9'))['format'](_0xd3c0('0xfa')),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f['ListId'],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1a5')));break;case 0x0:if(_0x41970f[_0xd3c0('0xf1')]>=_0x8f624a[_0xd3c0('0x1a6')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x41970f[_0xd3c0('0xf1')]+=0x1,'scheduledat':moment()[_0xd3c0('0xf8')](_0x8f624a[_0xd3c0('0x1a7')],_0xd3c0('0xf9'))['format'](_0xd3c0('0xfa')),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f[_0xd3c0('0xd4')],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f['CampaignId']||undefined})[_0xd3c0('0xb1')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x41970f[_0xd3c0('0xf2')]>=_0x8f624a[_0xd3c0('0x117')]-0x1){return!![];}this[_0xd3c0('0xc2')]({'active':![],'countdropretry':_0x41970f[_0xd3c0('0xf2')]+=0x1,'scheduledat':moment()[_0xd3c0('0xf8')](_0x8f624a[_0xd3c0('0x118')],_0xd3c0('0xf9'))[_0xd3c0('0x78')](_0xd3c0('0xfa')),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f['ListId'],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f['CampaignId']||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x119')));break;case 0xb:if(_0x41970f['countabandonedretry']>=_0x8f624a['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x41970f[_0xd3c0('0xff')]+=0x1,'scheduledat':moment()[_0xd3c0('0xf8')](_0x8f624a['dialAbandonedRetryFrequency'],_0xd3c0('0xf9'))[_0xd3c0('0x78')](_0xd3c0('0xfa')),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f[_0xd3c0('0xd4')],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x11f')));break;case 0x13:if(_0x41970f['countmachineretry']>=_0x8f624a[_0xd3c0('0x1a8')]-0x1){return!![];}this[_0xd3c0('0xc2')]({'active':![],'countmachineretry':_0x41970f[_0xd3c0('0xec')]+=0x1,'scheduledat':moment()[_0xd3c0('0xf8')](_0x8f624a['dialMachineRetryFrequency'],'minutes')[_0xd3c0('0x78')](_0xd3c0('0xfa')),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f[_0xd3c0('0xd4')],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x101')));break;case 0x14:if(_0x41970f[_0xd3c0('0x100')]>=_0x8f624a[_0xd3c0('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x41970f[_0xd3c0('0x100')]+=0x1,'scheduledat':moment()['add'](_0x8f624a[_0xd3c0('0x1aa')],_0xd3c0('0xf9'))[_0xd3c0('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41970f[_0xd3c0('0xfb')],'ListId':_0x41970f[_0xd3c0('0xd4')],'VoiceQueueId':_0x41970f[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x41970f[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1ab')));break;default:return!![];}};Dialer[_0xd3c0('0x1a')]['callProgressDetecting']=function(_0x128dbe,_0x5d9c71,_0x4f263d){var _0x7ad94c=this;var _0x2d7043=new History(_0x128dbe);return new BPromise(function(_0x32adc0,_0x58f17a){if(_['isUndefined'](_0x5d9c71)&&typeof _0x5d9c71!==_0xd3c0('0x166')){return _0x58f17a(msgResponse(_0xd3c0('0x1ac'),_0xd3c0('0x13f'),_0xd3c0('0x1ad')));}if(_[_0xd3c0('0x3d')](_0x4f263d)&&typeof _0x4f263d!=='object'){return _0x58f17a(msgResponse(_0xd3c0('0x1ac'),_0xd3c0('0x13f'),_0xd3c0('0x1ae')));}switch(_0x4f263d[_0xd3c0('0x109')]){case'0':_0x5d9c71[_0xd3c0('0x60')]+=0x1;_0x2d7043[_0xd3c0('0xea')]=0x0;_0x2d7043['statedesc']=_0xd3c0('0x1af');_0x2d7043[_0xd3c0('0xf1')]+=0x1;_0x2d7043['countglobal']+=0x1;ami[_0xd3c0('0x49')](_0xd3c0('0x1b0'),ut[_0xd3c0('0xe6')](_0x128dbe,_0xd3c0('0x1b1')));_0x7ad94c[_0xd3c0('0xcd')](_0x2d7043)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0xfe')));if(_0x7ad94c['checkRetriveMax'](0x0,_0x128dbe,_0x5d9c71)){if(_0x2d7043[_0xd3c0('0xf1')]>=_0x5d9c71[_0xd3c0('0x1a6')]){_0x7ad94c[_0xd3c0('0xf6')](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1b2'));}else{_0x7ad94c['stateGlobal'](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1b2'));}}break;case'3':_0x5d9c71[_0xd3c0('0x5f')]+=0x1;_0x2d7043[_0xd3c0('0xea')]=0x3;_0x2d7043[_0xd3c0('0xa8')]=_0xd3c0('0x1b3');_0x2d7043[_0xd3c0('0xf0')]+=0x1;_0x2d7043['countglobal']+=0x1;ami[_0xd3c0('0x49')]('custom:agentnoanswer',ut[_0xd3c0('0xe6')](_0x128dbe,'noanswer'));_0x7ad94c['createHistory'](_0x2d7043)['catch'](loggerCatch(_0xd3c0('0x1b4')));if(_0x7ad94c['checkRetriveMax'](0x3,_0x128dbe,_0x5d9c71)){if(_0x2d7043[_0xd3c0('0xf0')]>=_0x5d9c71[_0xd3c0('0x19d')]){_0x7ad94c['createStateFinal'](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1b5'));}else{_0x7ad94c[_0xd3c0('0xf4')](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1b5'));}}break;case'5':_0x5d9c71[_0xd3c0('0x1b6')]+=0x1;_0x2d7043['state']=0x5;_0x2d7043['statedesc']=_0xd3c0('0x1b7');_0x2d7043['countbusyretry']+=0x1;_0x2d7043['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut['buildObj'](_0x128dbe,_0xd3c0('0x1b8')));_0x7ad94c[_0xd3c0('0xcd')](_0x2d7043)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1b9')));if(_0x7ad94c[_0xd3c0('0x19c')](0x5,_0x128dbe,_0x5d9c71)){if(_0x2d7043[_0xd3c0('0xee')]>=_0x5d9c71[_0xd3c0('0x1a0')]){_0x7ad94c[_0xd3c0('0xf6')](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1ba'));}else{_0x7ad94c[_0xd3c0('0xf4')](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1ba'));}}break;case'8':_0x5d9c71['outboundCongestionCallsDay']+=0x1;_0x2d7043[_0xd3c0('0xea')]=0x8;_0x2d7043[_0xd3c0('0xa8')]=_0xd3c0('0x1bb');_0x2d7043[_0xd3c0('0xef')]+=0x1;_0x2d7043[_0xd3c0('0xed')]+=0x1;ami[_0xd3c0('0x49')]('custom:agentcongestion',ut['buildObj'](_0x128dbe,_0xd3c0('0x1bc')));_0x7ad94c[_0xd3c0('0xcd')](_0x2d7043)[_0xd3c0('0xb1')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x7ad94c['checkRetriveMax'](0x8,_0x128dbe,_0x5d9c71)){if(_0x2d7043[_0xd3c0('0xef')]>=_0x5d9c71[_0xd3c0('0x1a3')]){_0x7ad94c[_0xd3c0('0xf6')](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1bd'));}else{_0x7ad94c[_0xd3c0('0xf4')](_0x2d7043,_0x32adc0,_0x58f17a,'reason\x208\x20congestion');}}break;case'11':_0x5d9c71[_0xd3c0('0x1be')]+=0x1;_0x2d7043[_0xd3c0('0xea')]=0xb;_0x2d7043[_0xd3c0('0xa8')]=_0xd3c0('0x11d');_0x2d7043[_0xd3c0('0xff')]+=0x1;_0x2d7043[_0xd3c0('0xed')]+=0x1;_0x7ad94c['createHistory'](_0x2d7043)[_0xd3c0('0xb1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x7ad94c[_0xd3c0('0x19c')](0xb,_0x128dbe,_0x5d9c71)){if(_0x2d7043[_0xd3c0('0xff')]>=_0x5d9c71[_0xd3c0('0x1bf')]){_0x7ad94c[_0xd3c0('0xf6')](_0x2d7043,_0x32adc0,_0x58f17a,'reason\x2011\x20abandoned');}else{_0x7ad94c['stateGlobal'](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1c0'));}}break;case'20':_0x5d9c71[_0xd3c0('0x63')]+=0x1;_0x2d7043[_0xd3c0('0xea')]=0x14;_0x2d7043[_0xd3c0('0xa8')]=_0xd3c0('0x1c1');_0x2d7043[_0xd3c0('0x100')]+=0x1;_0x2d7043[_0xd3c0('0xed')]+=0x1;ami[_0xd3c0('0x49')](_0xd3c0('0x1c2'),ut[_0xd3c0('0xe6')](_0x128dbe,_0xd3c0('0x1c3')));_0x7ad94c[_0xd3c0('0xcd')](_0x2d7043)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1c4')));if(_0x7ad94c[_0xd3c0('0x19c')](0x14,_0x128dbe,_0x5d9c71)){if(_0x2d7043['countagentrejectretry']>=_0x5d9c71[_0xd3c0('0x1a9')]){_0x7ad94c[_0xd3c0('0xf6')](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1c5'));}else{_0x7ad94c['stateGlobal'](_0x2d7043,_0x32adc0,_0x58f17a,_0xd3c0('0x1c5'));}}break;default:_0x5d9c71['outboundUnknownCallsDay']+=0x1;_0x2d7043['state']=0xc;_0x2d7043[_0xd3c0('0xa8')]=_0x4f263d[_0xd3c0('0x109')];_0x7ad94c[_0xd3c0('0xcd')](_0x2d7043)[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1c6')));if(_0x7ad94c[_0xd3c0('0x19c')](_0x4f263d[_0xd3c0('0x109')],_0x128dbe,_0x5d9c71)){if(_0x2d7043[_0xd3c0('0xee')]+_0x2d7043[_0xd3c0('0xef')]+_0x2d7043[_0xd3c0('0xf0')]+_0x2d7043[_0xd3c0('0xf1')]+_0x2d7043[_0xd3c0('0xf2')]+_0x2d7043[_0xd3c0('0xff')]+_0x2d7043[_0xd3c0('0xec')]+_0x2d7043[_0xd3c0('0x100')]>=_0x5d9c71['dialGlobalMaxRetry']){_0x7ad94c[_0xd3c0('0xf4')](_0x2d7043,_0x32adc0,_0x58f17a,_0x4f263d[_0xd3c0('0x109')]);}else{_0x7ad94c[_0xd3c0('0xf6')](_0x2d7043,_0x32adc0,_0x58f17a,_0x4f263d['reason']);}}}});};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xf4')]=function(_0x553dc0,_0x51d276,_0x26d286,_0xdd6de){var _0xdee9d5=new Final(_0x553dc0);_0xdee9d5[_0xd3c0('0xea')]=0xf;_0xdee9d5[_0xd3c0('0xa8')]=_0xd3c0('0x1c7');this[_0xd3c0('0xf6')](_0xdee9d5,_0x51d276,_0x26d286,_0xdd6de);};Dialer[_0xd3c0('0x1a')][_0xd3c0('0xf6')]=function(_0x5ee959,_0x590389,_0x316641,_0x2d263e){this[_0xd3c0('0xcb')](_0x5ee959)[_0xd3c0('0xbb')](function(){return _0x590389(msgResponse(_0xd3c0('0x1ac'),_0xd3c0('0x1c8'),_0x2d263e));})[_0xd3c0('0xb1')](function(){return _0x316641(msgResponse('[moveContactManagedDialer][0]',_0xd3c0('0x13f'),_0xd3c0('0x1c9')));});};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x158')]=function(_0x560e0e){var _0x5e352c=_0x560e0e[_0xd3c0('0x1ca')]/0x64;var _0x278580=_0x560e0e['outboundDropCallsDayTimeout']/(_0x560e0e[_0xd3c0('0x5e')]+_0x560e0e[_0xd3c0('0xe1')]);var _0x2b37d9=Math[_0xd3c0('0x1cb')](_0x560e0e['predictiveIntervalAvailable']*(_0x560e0e['predictiveIntervalMaxThreshold']/0x64));var _0x3d9093=Math['round'](_0x560e0e['predictiveIntervalAvailable']*(_0x560e0e[_0xd3c0('0x1cc')]/0x64));var _0x785105=_0x560e0e[_0xd3c0('0x4d')]+_0x560e0e[_0xd3c0('0xa2')];var _0x413d0f=Math[_0xd3c0('0x1cd')](_0x560e0e[_0xd3c0('0x87')]*_0x560e0e[_0xd3c0('0x70')]*_0x560e0e['predictiveIntervalHitRate']*_0x560e0e[_0xd3c0('0x6b')]);if(_[_0xd3c0('0x3d')](_0x560e0e['startProgressive'])){if(!_['isUndefined'](_0x560e0e[_0xd3c0('0x28')])){_0x560e0e[_0xd3c0('0x28')]=undefined;loggerPredictive[_0xd3c0('0x94')](_0xd3c0('0x1ce'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xd3c0('0x3d')](_0x560e0e[_0xd3c0('0x8e')])){loggerPredictive[_0xd3c0('0x94')](_0xd3c0('0x1ce'),_0xd3c0('0x1cf'));clearInterval(_0x560e0e[_0xd3c0('0x8e')]);_0x560e0e['handlePredictive']=undefined;}_0x560e0e['startProgressive']=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));loggerPredictive['info'](_0x560e0e['name'],_0xd3c0('0x1d0'),_0x560e0e[_0xd3c0('0x29')]);this[_0xd3c0('0x155')](_0x560e0e,0x1);}else if(ifInterval(_0x560e0e[_0xd3c0('0x1d1')],_0x560e0e[_0xd3c0('0x29')])){this[_0xd3c0('0x155')](_0x560e0e,0x1);loggerPredictiveCalls[_0xd3c0('0x7a')](_0xd3c0('0x1d2'),_0x560e0e['startProgressive'],_0x560e0e[_0xd3c0('0x41')]);_0x560e0e[_0xd3c0('0x87')]=0x0;_0x560e0e[_0xd3c0('0x6a')]=0x0;}else if(_0x5e352c<_0x278580&&_0x560e0e['dialPredictiveOptimization']===_0xd3c0('0x1d3')){freeVariablesPredictive(_0x560e0e);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x1d4'),_0xd3c0('0x1d5'),_0x278580,_0xd3c0('0x29'),_0x560e0e[_0xd3c0('0x41')]);}else if(_0x413d0f<_0x560e0e[_0xd3c0('0x6a')]&&_0x560e0e[_0xd3c0('0x1d6')]===_0xd3c0('0x1d3')){freeVariablesPredictive(_0x560e0e);loggerPredictive['info'](_0xd3c0('0x1d7'),_0xd3c0('0x1d8'),_0x413d0f,_0xd3c0('0x1d9'),_0x560e0e[_0xd3c0('0x6a')],_0xd3c0('0x29'),_0x560e0e['name']);}else if(!ifInterval(_0x560e0e[_0xd3c0('0x1d1')],_0x560e0e[_0xd3c0('0x29')])&&_['isUndefined'](_0x560e0e['startPredictive'])&&!_['isUndefined'](_0x560e0e['startProgressive'])){_0x560e0e['startPredictive']=moment()['format'](_0xd3c0('0xfa'));loggerPredictive[_0xd3c0('0x7a')](_0x560e0e['name'],'started\x20in\x20predictive\x20at',_0x560e0e[_0xd3c0('0x28')]);this[_0xd3c0('0xbf')](_0x560e0e[_0xd3c0('0x1d1')])[_0xd3c0('0xbb')](this[_0xd3c0('0x1da')](_0x560e0e))[_0xd3c0('0xbb')](mergeDataErlangB(_0x560e0e))[_0xd3c0('0xbb')](this[_0xd3c0('0x1db')](_0x560e0e))[_0xd3c0('0xb1')](loggerCatchPredictive(_0xd3c0('0x1dc'),_0x560e0e));}else if(!ifInterval(_0x560e0e['dialPredictiveInterval'],_0x560e0e[_0xd3c0('0x28')])){_0x560e0e[_0xd3c0('0x6a')]=0x0;_0x560e0e[_0xd3c0('0x28')]=moment()[_0xd3c0('0x78')](_0xd3c0('0xfa'));loggerPredictive[_0xd3c0('0x7a')](_0x560e0e[_0xd3c0('0x41')],_0xd3c0('0x1dd'),_0x560e0e['startPredictive']);clearInterval(_0x560e0e[_0xd3c0('0x8e')]);_0x560e0e[_0xd3c0('0x8e')]=undefined;this[_0xd3c0('0xbf')](_0x560e0e['dialPredictiveInterval'])[_0xd3c0('0xbb')](this[_0xd3c0('0x1da')](_0x560e0e))['then'](mergeDataErlangB(_0x560e0e))[_0xd3c0('0xbb')](this[_0xd3c0('0x1db')](_0x560e0e))[_0xd3c0('0xb1')](loggerCatchPredictive(_0xd3c0('0x1de'),_0x560e0e));}else if(_0x560e0e[_0xd3c0('0x6d')]&&_0x785105<_0x560e0e[_0xd3c0('0x6d')]-_0x3d9093){freeVariablesPredictive(_0x560e0e);loggerPredictive[_0xd3c0('0x7a')](_0x560e0e[_0xd3c0('0x41')],_0xd3c0('0x1df'),_0x785105,')\x20are\x20less\x20than\x20threshold\x20(',_0x560e0e[_0xd3c0('0x6d')],'-',_0x3d9093,'=',_0x560e0e[_0xd3c0('0x6d')]-_0x3d9093,')');}else if(_0x560e0e['predictiveIntervalAvailable']&&_0x785105>_0x560e0e[_0xd3c0('0x6d')]+_0x2b37d9){freeVariablesPredictive(_0x560e0e);loggerPredictive['info'](_0x560e0e[_0xd3c0('0x41')],_0xd3c0('0x1df'),_0x785105,_0xd3c0('0x1e0'),_0x560e0e[_0xd3c0('0x6d')],'+',_0x2b37d9,'=',_0x560e0e['predictiveIntervalAvailable']+_0x2b37d9,')');}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x1da')]=function(_0x48df1e){var _0x57b0a1=this;return function(_0x5eaa6b){return new BPromise(function(_0x23f0e9,_0x182d98){_[_0xd3c0('0x126')](_0x48df1e,_0x5eaa6b[0x0]);if(checkGetDataPredictive(_0x5eaa6b[0x0])){var _0x1a289a=_0x48df1e[_0xd3c0('0x6d')]=_0x48df1e[_0xd3c0('0xa2')]+_0x48df1e[_0xd3c0('0x4d')];var _0x1b3d08=_0x48df1e[_0xd3c0('0x1d1')]*0x3c;var _0x1335dd=_0x5eaa6b[0x0][_0xd3c0('0x67')]+_0x5eaa6b[0x0][_0xd3c0('0x66')];var _0x4b9ada=(_0x5eaa6b[0x0]['predictiveIntervalAnsweredCalls']+_0x5eaa6b[0x0][_0xd3c0('0x68')]+_0x5eaa6b[0x0][_0xd3c0('0x80')])/_0x5eaa6b[0x0]['predictiveIntervalTotalCalls'];_0x48df1e[_0xd3c0('0x1e1')]=_0x4b9ada>0x0?_0x4b9ada:0x1;switch(_0x48df1e[_0xd3c0('0x1d6')]){case _0xd3c0('0x1d3'):var _0x38c9cc=_0x48df1e[_0xd3c0('0x1ca')]/0x64;return _0x57b0a1[_0xd3c0('0x1e2')](_0x1a289a,_0x1b3d08,_0x1335dd,_0x4b9ada,_0x38c9cc)['then'](function(_0x4d96fb){return _0x23f0e9(_0x4d96fb);});case _0xd3c0('0x1e3'):var _0x2d0771=_0x48df1e[_0xd3c0('0x1ca')]/0x64;return _0x57b0a1['busyFactor'](_0x1a289a,_0x1b3d08,_0x1335dd,_0x4b9ada,_0x2d0771)[_0xd3c0('0xbb')](function(_0x315ec6){return _0x23f0e9(_0x315ec6);});default:return _0x182d98(msgResponse(_0xd3c0('0x1e4'),'Failure',_0xd3c0('0x1e5')));}}else{return _0x182d98(msgResponse(_0xd3c0('0x1e4'),_0xd3c0('0x13f'),_0xd3c0('0x1e6')));}});};};Dialer[_0xd3c0('0x1a')]['getDataPredictiveOld']=function(_0x81295c){var _0x56c1ef=this;return function(_0x39f928){return new BPromise(function(_0x5aaf41,_0x1377b9){_[_0xd3c0('0x126')](_0x81295c,_0x39f928[0x0]);if(checkGetDataPredictive(_0x39f928[0x0])){loggerPredictive[_0xd3c0('0x7a')](JSON[_0xd3c0('0x46')](_0x39f928[0x0]));if(_0x81295c['dialPredictiveOptimization']===_0xd3c0('0x1d3')){return _0x56c1ef[_0xd3c0('0xc9')](_0x81295c['id'])[_0xd3c0('0xbb')](function(_0x5baa00){var _0x3b2d02=_0x81295c[_0xd3c0('0x4e')]-_0x5baa00[0x0][_0xd3c0('0x1e7')];var _0x28c435=_0x81295c[_0xd3c0('0x1d1')]*0x3c;var _0x97e461=_0x39f928[0x0][_0xd3c0('0x67')]+_0x39f928[0x0][_0xd3c0('0x66')];var _0x2b2131=(_0x39f928[0x0][_0xd3c0('0x65')]+_0x39f928[0x0][_0xd3c0('0x68')]+_0x39f928[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x39f928[0x0][_0xd3c0('0x6e')];var _0x40f7e6=_0x81295c['dialPredictiveOptimizationPercentage']/0x64;_0x81295c[_0xd3c0('0x6c')]=_0x5baa00[0x0]['outboundQueuePauses']||0x0;_0x81295c[_0xd3c0('0x1e1')]=_0x2b2131>0x0?_0x2b2131:0x1;return _0x56c1ef['abandonmentRate'](_0x3b2d02,_0x28c435,_0x97e461,_0x2b2131,_0x40f7e6);})[_0xd3c0('0xbb')](function(_0x59302a){return _0x5aaf41(_0x59302a);})[_0xd3c0('0xb1')](function(_0x3959fd){return _0x1377b9(msgResponse(_0xd3c0('0x1e8'),_0xd3c0('0x13f'),JSON[_0xd3c0('0x46')](_0x3959fd)));});}if(_0x81295c['dialPredictiveOptimization']===_0xd3c0('0x1e3')){return _0x56c1ef[_0xd3c0('0xc9')](_0x81295c['id'])['then'](function(_0x165e1b){var _0x41f281=_0x81295c[_0xd3c0('0x4e')]-_0x165e1b[0x0][_0xd3c0('0x1e7')];var _0x2a879f=_0x81295c[_0xd3c0('0x1d1')]*0x3c;var _0x348df2=_0x39f928[0x0]['predictiveIntervalAvgTalktime']+_0x39f928[0x0]['predictiveIntervalAvgHoldtime'];var _0x58e7f2=(_0x39f928[0x0]['predictiveIntervalAnsweredCalls']+_0x39f928[0x0][_0xd3c0('0x68')]+_0x39f928[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x39f928[0x0][_0xd3c0('0x6e')];var _0x1c2839=_0x81295c[_0xd3c0('0x1ca')]/0x64;_0x81295c[_0xd3c0('0x6c')]=_0x165e1b[0x0]['outboundQueuePauses']||0x0;_0x81295c['predictiveIntervalHitRate']=_0x58e7f2>0x0?_0x58e7f2:0x1;return _0x56c1ef['busyFactor'](_0x41f281,_0x2a879f,_0x348df2,_0x58e7f2,_0x1c2839);})[_0xd3c0('0xbb')](function(_0x308dd0){return _0x5aaf41(_0x308dd0);})[_0xd3c0('0xb1')](function(_0x16a992){return _0x1377b9(msgResponse(_0xd3c0('0x1e8'),_0xd3c0('0x13f'),JSON[_0xd3c0('0x46')](_0x16a992)));});}}else{return _0x1377b9(msgResponse(_0xd3c0('0x1e4'),'Failure',_0xd3c0('0x1e6')));}});};};Dialer['prototype'][_0xd3c0('0x1db')]=function(_0x432224){var _0x5f2bb9=this;return function(){var _0x239584=0x0;var _0x168729=Math[_0xd3c0('0x1cd')](_0x432224['erlangCallToSecond']*0x3e8);if(_0x168729>0x0){_0x168729=_0x168729<0x64?0x64:_0x168729;loggerPredictive['info'](_0x432224['name'],_0xd3c0('0x1e9'),_0x168729,_0xd3c0('0x47'));_0x432224['handlePredictive']=setInterval(function(){_0x5f2bb9[_0xd3c0('0x8e')](_0x432224);loggerPredictiveCalls[_0xd3c0('0x7a')](_0xd3c0('0x1ea'),_0x239584+=0x1);},_0x168729);}else{loggerPredictive[_0xd3c0('0x7a')](_0x432224[_0xd3c0('0x41')],_0xd3c0('0x1eb'));}};};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x1ec')]=function(_0x1b84c4,_0x697060){var _0x209a5d=this;return function(_0x9fbba5){if(_[_0xd3c0('0x91')](_0x9fbba5)){if(_[_0xd3c0('0xae')](_0x697060[_0xd3c0('0x1ed')])||!_0x697060[_0xd3c0('0x1ee')]){if(_0x1b84c4['dialMethod']===_0xd3c0('0x159')){_0x1b84c4[_0xd3c0('0x127')]=_[_0xd3c0('0x3d')](_0x1b84c4[_0xd3c0('0x127')])?!![]:_0x1b84c4[_0xd3c0('0x127')];var _0xa1533c=uuid['v4']();_0x209a5d[_0xd3c0('0x26')][_0xa1533c]=new Action(_0x1b84c4,_0x697060,_0xa1533c);loggerBooked[_0xd3c0('0x7a')](_0xd3c0('0x1ef'),_0xa1533c,_0xd3c0('0x1f0'),JSON[_0xd3c0('0x46')](_0x1b84c4[_0xd3c0('0x127')]),'Queue:\x20',_0x1b84c4[_0xd3c0('0x41')]);if(_0x1b84c4['queueStatusComplete']){_0x1b84c4[_0xd3c0('0x127')]=![];_0x209a5d[_0xd3c0('0x2b')][_0x209a5d[_0xd3c0('0x26')][_0xa1533c]['queue']]=[];ami[_0xd3c0('0xaf')]({'actionid':_0xa1533c,'action':'queuestatus','queue':_0x1b84c4['name']})['catch'](function(){_0x209a5d[_0xd3c0('0xb3')](_0x1b84c4);_0x209a5d[_0xd3c0('0xc2')]({'active':![],'ContactId':_0x209a5d['actions'][_0xa1533c][_0xd3c0('0xfb')],'ListId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c][_0xd3c0('0xd4')],'VoiceQueueId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c][_0xd3c0('0xd5')]||undefined,'CampaignId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c]['CampaignId']||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1f1')));delete _0x209a5d[_0xd3c0('0x26')][_0xa1533c];});}else{loggerBooked[_0xd3c0('0x7a')](_0xd3c0('0x1f2'),JSON[_0xd3c0('0x46')](_0x1b84c4[_0xd3c0('0x127')]),_0xd3c0('0x1f3'),_0x1b84c4[_0xd3c0('0x41')]);_0x209a5d[_0xd3c0('0xb3')](_0x1b84c4);_0x209a5d[_0xd3c0('0xc2')]({'active':![],'ContactId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c][_0xd3c0('0xfb')],'ListId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c][_0xd3c0('0xd4')],'VoiceQueueId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c]['VoiceQueueId']||undefined,'CampaignId':_0x209a5d[_0xd3c0('0x26')][_0xa1533c][_0xd3c0('0xd6')]||undefined})['catch'](loggerCatch(_0xd3c0('0x1f1')));delete _0x209a5d[_0xd3c0('0x26')][_0xa1533c];}}else{return _0x209a5d['actionOriginate'](_0x1b84c4,_0x697060);}}else{if(getDiff(_0x697060[_0xd3c0('0x1f4')])<_0x1b84c4[_0xd3c0('0x1f5')]*0x3c){if(_0x697060[_0xd3c0('0x1f6')]&&!_0x697060[_0xd3c0('0x1f6')][_0xd3c0('0x1f7')]){_0x209a5d[_0xd3c0('0x1f')]['run'](_0x697060['id'])[_0xd3c0('0x1d')](function(){_0x209a5d[_0xd3c0('0xb3')](_0x1b84c4);});}else{_0x209a5d[_0xd3c0('0xc4')]({'active':![]},_0x697060['id'],0x1)[_0xd3c0('0x1d')](function(){_0x209a5d[_0xd3c0('0xb3')](_0x1b84c4);});}}else{_0x1b84c4[_0xd3c0('0x62')]+=0x1;_0x209a5d[_0xd3c0('0xb3')](_0x1b84c4);if(_0x1b84c4[_0xd3c0('0x1f8')]){_0x209a5d['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x697060[_0xd3c0('0xfb')],'ListId':_0x697060[_0xd3c0('0xd4')],'VoiceQueueId':_0x697060[_0xd3c0('0xd5')]||undefined,'CampaignId':_0x697060[_0xd3c0('0xd6')]||undefined})[_0xd3c0('0xb1')](loggerCatch(_0xd3c0('0x1f9')));_0x209a5d[_0xd3c0('0xcd')](createObjHistory(_0x1b84c4,_0x697060,_0xd3c0('0x1fa'),0x17,_0xd3c0('0x1fb')))['catch'](loggerCatch(_0xd3c0('0x1fc')));}else{_0x209a5d[_0xd3c0('0xd2')](createObjHistory(_0x1b84c4,_0x697060,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xd3c0('0x1fd'),_0xd3c0('0x1fe'));}}}}else{_0x1b84c4[_0xd3c0('0x5a')]+=0x1;_0x209a5d[_0xd3c0('0xd2')](createObjHistory(_0x1b84c4,_0x697060,_0xd3c0('0x1ff'),0xd,_0xd3c0('0x200')),_0xd3c0('0x201'),_0xd3c0('0x202'));throw _0xd3c0('0x203');}};};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x15c')]=function(_0x329974){var _0x37503b=this;var _0x17ea0b=_0x329974['limitCalls']-_0x329974[_0xd3c0('0x99')]-_0x329974[_0xd3c0('0xc7')];emitCampaignSummary(_0x329974);if(_0x17ea0b>0x0){if(_0x17ea0b>this[_0xd3c0('0x24')]){_0x17ea0b=this['maxNumberOriginate'];}_0x329974[_0xd3c0('0xc7')]+=_0x17ea0b;this[_0xd3c0('0xc8')](_0x329974['id'],_0x17ea0b,_0x329974[_0xd3c0('0x204')],_0x329974)[_0xd3c0('0xbb')](function(_0x585b98){_0x329974[_0xd3c0('0xc7')]-=_0x17ea0b;_0x329974[_0xd3c0('0xc7')]=_0x329974['temp']>0x0?_0x329974[_0xd3c0('0xc7')]:0x0;if(!checkContactEmpty(_0x585b98)){_0x329974[_0xd3c0('0x3e')]=_0xd3c0('0x9f');logger[_0xd3c0('0x7a')]('[getContactCampaign2][Empty]'+_0x329974[_0xd3c0('0x41')]);}else{_0x329974[_0xd3c0('0x99')]+=_0x585b98['length'];_0x329974[_0xd3c0('0x3e')]=_0xd3c0('0x205');for(var _0x581f32=0x0;_0x581f32<_0x585b98['length'];_0x581f32+=0x1){_0x329974['ivrTotalCallsDays']+=0x1;if(_[_0xd3c0('0xae')](_0x585b98[_0x581f32])||_['isNil'](_0x585b98[_0x581f32][_0xd3c0('0x16a')])||_[_0xd3c0('0xae')](_0x585b98[_0x581f32][_0xd3c0('0x16a')]['phone'])){_0x37503b[_0xd3c0('0xd0')](_0xd3c0('0x206'),_0x329974,_0x585b98[_0x581f32]);}else{_0x37503b['checkIsBlackListIvr'](_[_0xd3c0('0xd3')](_0x585b98[_0x581f32],[_0xd3c0('0xd6'),_0xd3c0('0x207')]))[_0xd3c0('0xbb')](_0x37503b[_0xd3c0('0x1ec')](_0x329974,_0x585b98[_0x581f32]))[_0xd3c0('0xb1')](_0x37503b['loggerHandler'](_0xd3c0('0x208'),_0x329974));}}}})[_0xd3c0('0xb1')](loggerGetContactDialer(_0xd3c0('0x209'),_0x329974,_0x17ea0b));}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x155')]=function(_0x1aad8e,_0x55d3c6){var _0x4ff32c=this;var _0x280404=[];var _0xc502ec=_0x55d3c6>=0x1?_0x55d3c6:0x1;if(_0x1aad8e[_0xd3c0('0x20a')]==='booked'){_0xc502ec=0x1;}var _0x180f37=Math[_0xd3c0('0x1cd')](_0x1aad8e[_0xd3c0('0x4d')]*_0xc502ec)-_0x1aad8e['originated']-_0x1aad8e[_0xd3c0('0xc7')];emitVoiceQueueSummary(_0x1aad8e);if(_0x1aad8e[_0xd3c0('0x20b')]>0x0){var _0x1b5117=_0x1aad8e[_0xd3c0('0x20b')]-_0x1aad8e[_0xd3c0('0x99')]-_0x1aad8e[_0xd3c0('0xa2')]-_0x1aad8e[_0xd3c0('0xc7')]-_0x1aad8e[_0xd3c0('0x4f')];if(_0x180f37>_0x1b5117){_0x180f37=_0x1b5117;}}if(_0x180f37>0x0){if(_0x1aad8e['dialMethod']===_0xd3c0('0x159')){_0x180f37=0x1;}if(_0x180f37>this['maxNumberOriginate']){_0x180f37=this[_0xd3c0('0x24')];}_0x1aad8e[_0xd3c0('0xc7')]+=_0x180f37;for(var _0x4dbf9c in this['agents']){if(typeof this[_0xd3c0('0x22')][_0x4dbf9c]!=='undefined'){if(this[_0xd3c0('0x22')][_0x4dbf9c][_0xd3c0('0xea')]===_0xd3c0('0x20c')&&this[_0xd3c0('0x22')][_0x4dbf9c][_0xd3c0('0xda')]==='reachable'){_0x280404[_0xd3c0('0x125')](this['agents'][_0x4dbf9c]['id']);}}}this[_0xd3c0('0xc6')](_0x1aad8e['id'],_0x280404,_0x180f37,_0x1aad8e['dialOrderByScheduledAt'],_0x1aad8e)[_0xd3c0('0xbb')](function(_0x598b9e){_0x1aad8e[_0xd3c0('0xc7')]-=_0x180f37;_0x1aad8e[_0xd3c0('0xc7')]=_0x1aad8e[_0xd3c0('0xc7')]>0x0?_0x1aad8e[_0xd3c0('0xc7')]:0x0;if(!checkContactEmpty(_0x598b9e)){_0x4ff32c[_0xd3c0('0xb7')](_0x1aad8e)[_0xd3c0('0xbb')](sendMessageReschedule(_0x1aad8e))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x1aad8e[_0xd3c0('0x99')]+=_0x598b9e[_0xd3c0('0x97')];_0x1aad8e['message']=_0x1aad8e[_0xd3c0('0x20a')]==='booked'?'ACTIVE':_0xd3c0('0x205');for(var _0x261179=0x0;_0x261179<_0x598b9e[_0xd3c0('0x97')];_0x261179+=0x1){if(_['isNil'](_0x598b9e[_0x261179])||_['isNil'](_0x598b9e[_0x261179][_0xd3c0('0x16a')])||_[_0xd3c0('0xae')](_0x598b9e[_0x261179][_0xd3c0('0x16a')]['phone'])){_0x4ff32c[_0xd3c0('0xd0')](_0xd3c0('0x206'),_0x1aad8e,_0x598b9e[_0x261179]);}else{_0x4ff32c['checkIsBlackList'](_[_0xd3c0('0xd3')](_0x598b9e[_0x261179],['VoiceQueueId',_0xd3c0('0x207')]))['then'](_0x4ff32c[_0xd3c0('0x1ec')](_0x1aad8e,_0x598b9e[_0x261179]))[_0xd3c0('0xb1')](_0x4ff32c[_0xd3c0('0x20d')](_0xd3c0('0x206'),_0x1aad8e));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x1aad8e,_0x180f37));}};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x8e')]=function(_0x385f8f){if(_0x385f8f[_0xd3c0('0x20b')]>0x0){var _0x476a84=_0x385f8f[_0xd3c0('0x20b')]-_0x385f8f[_0xd3c0('0x99')]-_0x385f8f[_0xd3c0('0xa2')];if(_0x476a84>0x0){this['tryOriginatePredictive'](_0x385f8f);}else{loggerPredictiveCalls[_0xd3c0('0x7a')]('[handlePredictive][limitChannel]');}}else{this[_0xd3c0('0x20e')](_0x385f8f);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x2273e0){var _0x19ee14=this;var _0x5870f6=[];_0x2273e0['originated']+=0x1;for(var _0x2380fb in this[_0xd3c0('0x22')]){if(typeof this['agents'][_0x2380fb]!==_0xd3c0('0x98')){if(this[_0xd3c0('0x22')][_0x2380fb][_0xd3c0('0xea')]===_0xd3c0('0x20c')&&this[_0xd3c0('0x22')][_0x2380fb][_0xd3c0('0xda')]===_0xd3c0('0xdb')){_0x5870f6['push'](this['agents'][_0x2380fb]['id']);}}}this[_0xd3c0('0xc6')](_0x2273e0['id'],_0x5870f6,0x1,_0x2273e0['dialOrderByScheduledAt'],_0x2273e0)[_0xd3c0('0xbb')](function(_0x41efa0){if(!checkContactEmpty(_0x41efa0)){checkContactLowerLimitOriginate(_0x2273e0,0x1,0x0);_0x19ee14['countReScheduled'](_0x2273e0)[_0xd3c0('0xbb')](sendMessageReschedule(_0x2273e0))[_0xd3c0('0xb1')](loggerCatch('[countReScheduled]\x20'));}else{_0x2273e0[_0xd3c0('0x3e')]=_0xd3c0('0x205');if(_[_0xd3c0('0xae')](_0x41efa0[0x0])||_['isNil'](_0x41efa0[0x0][_0xd3c0('0x16a')])||_[_0xd3c0('0xae')](_0x41efa0[0x0][_0xd3c0('0x16a')][_0xd3c0('0x169')])){_0x19ee14['emptyContact'](_0xd3c0('0x206'),_0x2273e0,_0x41efa0[0x0]);}else{_0x19ee14[_0xd3c0('0xba')](_['pick'](_0x41efa0[0x0],[_0xd3c0('0xd5'),_0xd3c0('0x207')]))[_0xd3c0('0xbb')](_0x19ee14[_0xd3c0('0x1ec')](_0x2273e0,_0x41efa0[0x0]))[_0xd3c0('0xb1')](_0x19ee14[_0xd3c0('0x20d')](_0xd3c0('0x20f'),_0x2273e0));}}})[_0xd3c0('0xb1')](loggerGetContactDialer(_0xd3c0('0x210'),_0x2273e0,0x1));emitVoiceQueueSummary(_0x2273e0);};Dialer['prototype'][_0xd3c0('0x1e2')]=function(_0x190d37,_0x5cc89a,_0x173261,_0x4a3a3e,_0x20f845,_0x2787de){loggerPredictive['info'](_0xd3c0('0x211'));loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x212'),_0x190d37);loggerPredictive['info'](_0xd3c0('0x213'),_0x5cc89a);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x214'),_0x173261);loggerPredictive['info'](_0xd3c0('0x215'),_0x4a3a3e);loggerPredictive['info'](_0xd3c0('0x216'),_0x20f845);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x217'));return new BPromise(function(_0x32f3a0,_0x1becad){if(_0x190d37<=0x0||isNaN(_0x190d37)){return _0x1becad(msgResponse(_0xd3c0('0x218'),_0xd3c0('0x197'),_0xd3c0('0x219')+_0x190d37));}if(_0x173261<=0x0||isNaN(_0x173261)){return _0x1becad(msgResponse(_0xd3c0('0x218'),_0xd3c0('0x197'),_0xd3c0('0x21a')+_0x173261));}if(_0x4a3a3e<=0x0||isNaN(_0x4a3a3e)){return _0x1becad(msgResponse(_0xd3c0('0x218'),_0xd3c0('0x197'),_0xd3c0('0x21b')+_0x4a3a3e));}if(_0x5cc89a<=0x0||isNaN(_0x5cc89a)){return _0x1becad(msgResponse('[abandonmentRate]','Error',_0xd3c0('0x21c')+_0x5cc89a));}if(_0x20f845<=0x0||isNaN(_0x20f845)){return _0x1becad(msgResponse(_0xd3c0('0x218'),_0xd3c0('0x197'),_0xd3c0('0x21d')+_0x20f845));}_0x2787de=_0x2787de||0x0;var _0x3e2da7=0x1/_0x173261;var _0x229398=0x0;var _0x5cbfd8=0x0;var _0x36f297=0x0;var _0x5bb09c=0x0;for(var _0x4412cf=0x0;_0x36f297<_0x20f845;_0x4412cf+=0x1){_0x5cbfd8=_0x4412cf/_0x5cc89a;_0x229398=(_0x4a3a3e*_0x5cbfd8+_0x2787de)/_0x3e2da7;_0x36f297=erlangb(_0x229398,_0x190d37);_0x5bb09c=_0x229398/_0x190d37*(0x1-erlangb(_0x229398,_0x190d37));}return _0x32f3a0({'erlangCalls':_0x4412cf,'erlangCallToSecond':_0x5cc89a/_0x4412cf,'erlangAbandonmentRate':_0x36f297,'erlangBusyFactor':_0x5bb09c});});};Dialer[_0xd3c0('0x1a')][_0xd3c0('0x21e')]=function(_0x548ad6,_0x473dbf,_0x3035e4,_0x2c04ad,_0x4d5dae,_0x5af267){loggerPredictive['info'](_0xd3c0('0x21f'));loggerPredictive[_0xd3c0('0x7a')]('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',_0x548ad6);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x473dbf);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x214'),_0x3035e4);loggerPredictive[_0xd3c0('0x7a')]('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',_0x2c04ad);loggerPredictive[_0xd3c0('0x7a')](_0xd3c0('0x220'),_0x4d5dae);loggerPredictive['info'](_0xd3c0('0x217'));return new BPromise(function(_0x19789d,_0x199ddd){if(_0x548ad6<=0x0||isNaN(_0x548ad6)){return _0x199ddd(msgResponse(_0xd3c0('0x221'),_0xd3c0('0x197'),_0xd3c0('0x219')+_0x548ad6));}if(_0x3035e4<=0x0||isNaN(_0x3035e4)){return _0x199ddd(msgResponse(_0xd3c0('0x221'),_0xd3c0('0x197'),_0xd3c0('0x21a')+_0x3035e4));}if(_0x2c04ad<=0x0||isNaN(_0x2c04ad)){return _0x199ddd(msgResponse(_0xd3c0('0x221'),_0xd3c0('0x197'),_0xd3c0('0x21b')+_0x2c04ad));}if(_0x473dbf<=0x0||isNaN(_0x473dbf)){return _0x199ddd(msgResponse('[busyFactor]',_0xd3c0('0x197'),_0xd3c0('0x21c')+_0x473dbf));}if(_0x4d5dae<=0x0||isNaN(_0x4d5dae)){return _0x199ddd(msgResponse(_0xd3c0('0x221'),_0xd3c0('0x197'),'Umin\x20=\x20'+_0x4d5dae));}_0x5af267=_0x5af267||0x0;var _0x28807a=0x1/_0x3035e4;var _0x8013e3=0x0;var _0x124301=0x0;var _0x4e1dcf=0x0;var _0x4bea54=0x0;for(var _0x4d5dba=0x0;_0x4bea54<_0x4d5dae;_0x4d5dba+=0x1){_0x124301=_0x4d5dba/_0x473dbf;_0x8013e3=(_0x2c04ad*_0x124301+_0x5af267)/_0x28807a;_0x4e1dcf=erlangb(_0x8013e3,_0x548ad6);_0x4bea54=_0x8013e3/_0x548ad6*(0x1-erlangb(_0x8013e3,_0x548ad6));}return _0x19789d({'erlangCalls':_0x4d5dba,'erlangCallToSecond':_0x473dbf/_0x4d5dba,'erlangAbandonmentRate':_0x4e1dcf,'erlangBusyFactor':_0x4bea54});});};module[_0xd3c0('0x222')]=Dialer; \ No newline at end of file +var _0x6075=['isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerCallsDay','statedesc','Machine','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','countmachineretry','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','AMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countagentrejectretry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','syncQueueMember','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','timezones','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','dialActive','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','abandonmentRate','[CatchErlangB]','getVoiceQueueRtPauses','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','maxNumberOriginate','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','not_inuse','ACTIVE','emptyContact','dialLimitQueue','tryOriginatePredictive','[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','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','exports','util','lodash','uuid','moment','../preview/util/util','dialer','booked','predictive','predictiveCalls','../../../config/logger','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','inspect','error','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','uniqueid'];(function(_0x3568dd,_0x4bf2d9){var _0x325a74=function(_0x21087a){while(--_0x21087a){_0x3568dd['push'](_0x3568dd['shift']());}};_0x325a74(++_0x4bf2d9);}(_0x6075,0x142));var _0x5607=function(_0x12f72b,_0x17f261){_0x12f72b=_0x12f72b-0x0;var _0x43c7cb=_0x6075[_0x12f72b];return _0x43c7cb;};'use strict';var util=require(_0x5607('0x0'));var _=require(_0x5607('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x5607('0x4'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x5607('0x5'));var loggerBooked=require('../../../config/logger')(_0x5607('0x6'));var loggerPredictive=require('../../../config/logger')(_0x5607('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0x5607('0x8'));var loggerSyncQueueSummary=require(_0x5607('0x9'))(_0x5607('0xa'));var ami=require(_0x5607('0xb'));config[_0x5607('0xc')]=_[_0x5607('0xd')](config[_0x5607('0xc')],{'host':_0x5607('0xe'),'port':0x18eb});var io=require(_0x5607('0xf'))(new Redis(config[_0x5607('0xc')]));var cmHopper=require(_0x5607('0x10'));var cmHopperHistory=require(_0x5607('0x11'));var cmHopperBlack=require(_0x5607('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x5607('0x13'));var History=require(_0x5607('0x14'));var Final=require(_0x5607('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x5607('0x16'));var Hangup=require(_0x5607('0x17'));var ipAgi=process['env'][_0x5607('0x18')]||_0x5607('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x5607('0x1a')};var Sequence=function(){};Sequence['prototype'][_0x5607('0x1b')]=function(_0x22750d){this[_0x5607('0x1c')]=this[_0x5607('0x1c')]?this[_0x5607('0x1c')][_0x5607('0x1d')](_0x22750d):_0x22750d();};function Dialer(_0x127f46,_0x2decbc){this[_0x5607('0x1e')]=new Sequence();this[_0x5607('0x1f')]=_0x2decbc;this[_0x5607('0x20')]=_0x127f46[_0x5607('0x20')];this[_0x5607('0x21')]=_0x127f46[_0x5607('0x21')];this[_0x5607('0x22')]=_0x127f46[_0x5607('0x22')];this[_0x5607('0x23')]=_0x127f46['trunks'];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x5607('0x24')]={};this[_0x5607('0x25')]={};this[_0x5607('0x26')]={};this[_0x5607('0x27')]={};this[_0x5607('0x28')]={};this[_0x5607('0x29')]={};this[_0x5607('0x2a')]={};this[_0x5607('0x2b')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x5607('0x2c')][_0x5607('0x2d')](this));ami['on'](_0x5607('0x2e'),this['syncQueueCallerAbandon'][_0x5607('0x2d')](this));ami['on'](_0x5607('0x2f'),this[_0x5607('0x30')][_0x5607('0x2d')](this));ami['on'](_0x5607('0x31'),this[_0x5607('0x32')]['bind'](this));ami['on']('custom:queuesummary',this[_0x5607('0xa')][_0x5607('0x2d')](this));ami['on'](_0x5607('0x33'),this['syncHangup']['bind'](this));ami['on'](_0x5607('0x34'),this['syncNewExten'][_0x5607('0x2d')](this));ami['on'](_0x5607('0x35'),this[_0x5607('0x36')][_0x5607('0x2d')](this));ami['on'](_0x5607('0x37'),this['syncQueueMember']['bind'](this));ami['on'](_0x5607('0x38'),this[_0x5607('0x39')][_0x5607('0x2d')](this));this[_0x5607('0x3a')]();this[_0x5607('0x3b')]();}function isNotNull(_0x219229){return _0x219229!==null&&!_[_0x5607('0x3c')](_0x219229);}function checkIsLoggedIn(_0x352724,_0x4ebf35){return function(){if(_0x4ebf35<=0x0){_0x352724[_0x5607('0x3d')]=_0x5607('0x3e');throw _0x352724[_0x5607('0x3f')]+_0x5607('0x40');}};}function isActive(_0xb49185){return _0xb49185;}function checkIsActive(_0x3f5449,_0x337216){return function(){if(!isActive(_0x337216)){_0x3f5449[_0x5607('0x3d')]=_0x5607('0x41');throw _0x3f5449[_0x5607('0x3f')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4184d9){return function(){if(!isNotNull(_0x4184d9['Interval'])){_0x4184d9[_0x5607('0x3d')]=_0x5607('0x42');throw _0x4184d9[_0x5607('0x3f')]+_0x5607('0x43');}if(!isNotNull(_0x4184d9[_0x5607('0x44')]['Intervals'])){_0x4184d9[_0x5607('0x3d')]=_0x5607('0x42');throw _0x4184d9[_0x5607('0x3f')]+_0x5607('0x43');}if(!isNotNull(_[_0x5607('0x45')](_0x4184d9[_0x5607('0x44')][_0x5607('0x46')]))){_0x4184d9[_0x5607('0x3d')]=_0x5607('0x42');throw _0x4184d9['name']+_0x5607('0x43');}};}function msgResponse(_0x3cb857,_0x1c8049,_0x160995){return{'action':_0x3cb857,'response':_0x1c8049,'message':_0x160995,'stack':_0x160995};}function myreject(_0x593858){return function(_0x4eb126){return _0x593858(msgResponse(_0x5607('0x47'),_0x5607('0x48'),JSON[_0x5607('0x49')](_0x4eb126)));};}function getSeconds(_0x250290,_0x5e0c8f){var _0x2643f8=moment(_0x250290)[_0x5607('0x4a')](0x0);var _0x16ae2d=moment(_0x5e0c8f)['milliseconds'](0x0);return _0x2643f8[_0x5607('0x4b')](_0x16ae2d,'seconds');}function emit(_0x301b13,_0x52b177,_0x1e9f47){io['to'](_0x301b13)[_0x5607('0x4c')](_0x52b177,_0x1e9f47);}function emitVoiceQueueSummary(_0xf69d5b){if(_0xf69d5b[_0x5607('0x4d')]===_0x5607('0x4e')){var _0x3349c8={'id':_0xf69d5b['id'],'name':_0xf69d5b[_0x5607('0x3f')],'strategy':_0xf69d5b[_0x5607('0x4f')],'answered':_0xf69d5b[_0x5607('0x50')],'available':_0xf69d5b[_0x5607('0x51')],'loggedIn':_0xf69d5b[_0x5607('0x52')],'pTalking':_0xf69d5b['pTalking'],'sumBillable':_0xf69d5b[_0x5607('0x53')],'sumDuration':_0xf69d5b['sumDuration'],'sumHoldTime':_0xf69d5b[_0x5607('0x54')]||0x0,'talking':_0xf69d5b[_0x5607('0x55')],'total':_0xf69d5b[_0x5607('0x56')],'type':_0xf69d5b[_0x5607('0x4d')],'unmanaged':_0xf69d5b[_0x5607('0x57')],'abandoned':_0xf69d5b[_0x5607('0x58')],'waiting':_0xf69d5b[_0x5607('0x59')],'loggedInDb':_0xf69d5b[_0x5607('0x5a')],'dialActive':_0xf69d5b['dialActive'],'dialMethod':_0xf69d5b[_0x5607('0x5b')],'dialOriginateCallerIdName':_0xf69d5b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xf69d5b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xf69d5b['dialOriginateTimeout'],'dialPrefix':_0xf69d5b[_0x5607('0x5c')],'outboundAnswerAgiCallsDay':_0xf69d5b[_0x5607('0x5d')],'outboundAnswerCallsDay':_0xf69d5b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xf69d5b[_0x5607('0x5e')],'outboundBusyCallsDay':_0xf69d5b[_0x5607('0x5f')],'outboundCongestionCallsDay':_0xf69d5b[_0x5607('0x60')],'outboundDropCallsDayACS':_0xf69d5b[_0x5607('0x61')],'outboundDropCallsDayCallersExit':_0xf69d5b[_0x5607('0x62')],'outboundDropCallsDayTimeout':_0xf69d5b[_0x5607('0x63')],'outboundNoAnswerCallsDay':_0xf69d5b[_0x5607('0x64')],'outboundNoSuchCallsDay':_0xf69d5b[_0x5607('0x65')],'outboundOriginateFailureCallsDay':_0xf69d5b['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xf69d5b[_0x5607('0x66')],'outboundRejectCallsDay':_0xf69d5b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0xf69d5b[_0x5607('0x67')],'predictiveIntervalAnsweredCalls':_0xf69d5b[_0x5607('0x68')],'predictiveIntervalAvgHoldtime':_0xf69d5b[_0x5607('0x69')],'predictiveIntervalAvgTalktime':_0xf69d5b[_0x5607('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0xf69d5b[_0x5607('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0xf69d5b[_0x5607('0x6c')],'predictiveIntervalErlangCalls':_0xf69d5b[_0x5607('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0xf69d5b[_0x5607('0x6e')],'predictiveIntervalHitRate':_0xf69d5b[_0x5607('0x6f')],'predictiveIntervalMultiplicativeFactor':_0xf69d5b[_0x5607('0x70')],'predictiveIntervalPauses':_0xf69d5b[_0x5607('0x71')],'predictiveIntervalAvailable':_0xf69d5b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xf69d5b[_0x5607('0x72')],'message':_0xf69d5b[_0x5607('0x3d')],'originated':_0xf69d5b[_0x5607('0x73')],'erlangCalls':_0xf69d5b[_0x5607('0x74')],'erlangCallToSecond':_0xf69d5b['erlangCallToSecond'],'erlangAbandonmentRate':_0xf69d5b[_0x5607('0x75')],'erlangBusyFactor':_0xf69d5b[_0x5607('0x76')],'startPredictive':_0xf69d5b['startPredictive'],'startProgressive':_0xf69d5b[_0x5607('0x29')]};if(_0xf69d5b[_0x5607('0x77')]){_0x3349c8[_0x5607('0x77')]={'id':_0xf69d5b['Trunk']['id'],'name':_0xf69d5b[_0x5607('0x77')][_0x5607('0x3f')],'active':_0xf69d5b[_0x5607('0x77')][_0x5607('0x78')],'callerid':_0xf69d5b[_0x5607('0x77')]['callerid']};}if(_0xf69d5b[_0x5607('0x44')]){_0x3349c8['Interval']={'id':_0xf69d5b[_0x5607('0x44')]['id'],'name':_0xf69d5b[_0x5607('0x44')][_0x5607('0x3f')]};}var _0x4a36dd=md5(JSON[_0x5607('0x49')](_0x3349c8));if(_0xf69d5b[_0x5607('0x79')]!==_0x4a36dd){_0xf69d5b[_0x5607('0x79')]=_0x4a36dd;emit(util[_0x5607('0x7a')](_0x5607('0x7b'),_0x3349c8[_0x5607('0x3f')]),_0x5607('0x7c'),_0x3349c8);}}}function emitCampaignSummary(_0xae251f){if(_0xae251f[_0x5607('0x4d')]===_0x5607('0x7d')){emit(util[_0x5607('0x7a')](_0x5607('0x7e'),_0xae251f[_0x5607('0x3f')]),'campaign:save',_0xae251f);}}function checkGetDataPredictive(_0x371d6c){if(isNotNull(_0x371d6c)&&!_['isEmpty'](_0x371d6c)){loggerPredictive[_0x5607('0x7f')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x5607('0x7f')](_0x5607('0x80'),_0x371d6c[_0x5607('0x72')]);loggerPredictive[_0x5607('0x7f')](_0x5607('0x81'),_0x371d6c[_0x5607('0x68')]);loggerPredictive[_0x5607('0x7f')](_0x5607('0x82'),_0x371d6c[_0x5607('0x6c')]);loggerPredictive[_0x5607('0x7f')](_0x5607('0x83'),_0x371d6c[_0x5607('0x6b')]);loggerPredictive[_0x5607('0x7f')](_0x5607('0x84'),_0x371d6c[_0x5607('0x69')]);loggerPredictive[_0x5607('0x7f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x371d6c['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5607('0x7f')]('---------------------------');if(_0x371d6c[_0x5607('0x72')]>0x0){if(!_[_0x5607('0x3c')](_0x371d6c['predictiveIntervalAvgTalktime'])&&_0x371d6c[_0x5607('0x6a')]>0x0){return!![];}loggerPredictive['info'](_0x5607('0x85'));if(!_[_0x5607('0x3c')](_0x371d6c[_0x5607('0x69')])&&_0x371d6c['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x5607('0x7f')](_0x5607('0x86'));}else{loggerPredictive['info'](_0x5607('0x87'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x4b5180){return function(_0x379f35){loggerPredictive[_0x5607('0x7f')](_0x5607('0x88'));loggerPredictive[_0x5607('0x7f')](_0x5607('0x89'),_0x379f35['erlangCalls']);loggerPredictive[_0x5607('0x7f')](_0x5607('0x8a'),_0x379f35[_0x5607('0x8b')]);loggerPredictive[_0x5607('0x7f')](_0x5607('0x8c'),_0x379f35[_0x5607('0x75')]);loggerPredictive['info'](_0x5607('0x8d'),_0x379f35[_0x5607('0x76')]);loggerPredictive[_0x5607('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x379f35[_0x5607('0x75')]);loggerPredictive[_0x5607('0x7f')](_0x5607('0x8e'));_['merge'](_0x4b5180,_0x379f35);};}function getDiff(_0x5cf5d9){var _0x103149=moment()[_0x5607('0x4a')](0x0);var _0x27bb9f=moment(_0x5cf5d9)[_0x5607('0x4a')](0x0);return _0x103149['diff'](_0x27bb9f,'seconds');}function ifInterval(_0x45c4cb,_0x5464ba){if(_[_0x5607('0x3c')](_0x5464ba)){return![];}return getDiff(_0x5464ba)<_0x45c4cb*0x3c;}function freeVariablesPredictive(_0x534b7a){if(isNotNull(_0x534b7a)){if(!_[_0x5607('0x3c')](_0x534b7a['startProgressive'])){_0x534b7a[_0x5607('0x29')]=undefined;loggerPredictive[_0x5607('0x7f')](_0x534b7a[_0x5607('0x3f')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x5607('0x3c')](_0x534b7a[_0x5607('0x28')])){_0x534b7a[_0x5607('0x28')]=undefined;loggerPredictive[_0x5607('0x7f')](_0x534b7a[_0x5607('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x5607('0x3c')](_0x534b7a[_0x5607('0x8f')])){clearInterval(_0x534b7a[_0x5607('0x8f')]);_0x534b7a[_0x5607('0x8f')]=undefined;loggerPredictive['info'](_0x534b7a[_0x5607('0x3f')],_0x5607('0x90'));}}}function erlangb(_0x1721d8,_0x155aff){if(_0x155aff===0x0){return 0x0;}var _0x199de7=0x1;for(var _0x225224=0x1;_0x225224<=_0x155aff;_0x225224+=0x1){_0x199de7=0x1+_0x199de7*_0x225224/_0x1721d8;}return 0x1/_0x199de7;}function isVoiceQueueOutbound(_0x154176){return _0x154176===_0x5607('0x4e');}function isNotPreview(_0x499747){return _0x499747!==_0x5607('0x1f');}function isCampaignIvr(_0x201620){return _0x201620===_0x5607('0x7d');}function getCallerId(_0x2cfb41,_0x287b98,_0x1449c2){if(!_[_0x5607('0x3c')](_0x1449c2)&&typeof _0x1449c2===_0x5607('0x91')&&!_[_0x5607('0x45')](_0x1449c2)){if(!_[_0x5607('0x3c')](_0x287b98)&&typeof _0x287b98===_0x5607('0x91')&&!_[_0x5607('0x45')](_0x287b98)){return util['format'](_0x5607('0x92'),_0x287b98,_0x1449c2);}return util['format'](_0x5607('0x92'),_0x1449c2,_0x1449c2);}if(!_[_0x5607('0x3c')](_0x2cfb41)&&typeof _0x2cfb41===_0x5607('0x91')&&!_[_0x5607('0x45')](_0x2cfb41)){return _0x2cfb41;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0xed9738,_0x51f2cb){return function(_0x19a2e9){freeVariablesPredictive(_0x51f2cb);emitVoiceQueueSummary(_0x51f2cb);emitCampaignSummary(_0x51f2cb);loggerSyncQueueSummary['error'](_0xed9738,util[_0x5607('0x93')](_0x19a2e9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3aa308,_0xf6a11e){return function(_0x4faede){loggerPredictive[_0x5607('0x94')](_0xf6a11e['name'],_0x3aa308);loggerPredictive[_0x5607('0x94')](_0x4faede['stack']);freeVariablesPredictive(_0xf6a11e);};}function loggerCatch(_0x1c8074){return function(_0x46b361){logger[_0x5607('0x94')](_0x1c8074,util['inspect'](_0x46b361,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x505e98){return _0x505e98&&!_[_0x5607('0x3c')](_0x505e98)&&_0x505e98['length']>0x0;}function decremetOriginate(_0x7ad62a){if(!_['isUndefined'](_0x7ad62a)&&_0x7ad62a!==null){if(typeof _0x7ad62a[_0x5607('0x73')]!==_0x5607('0x95')){if(_0x7ad62a[_0x5607('0x73')]>0x0){_0x7ad62a[_0x5607('0x73')]-=0x1;}else{logger[_0x5607('0x94')](_0x5607('0x96'));}}}else{logger[_0x5607('0x94')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x3c768f,_0x1ba92e,_0x507d84){if(_0x1ba92e>_0x507d84){for(var _0x14248b=0x0;_0x14248b<_0x1ba92e-_0x507d84;_0x14248b+=0x1){decremetOriginate(_0x3c768f);}}}function loggerGetContactDialer(_0x1f006b,_0x4c4219,_0x460244){return function(_0x404c7b){checkContactLowerLimitOriginate(_0x4c4219,_0x460244,0x0);logger[_0x5607('0x94')](_0x1f006b,util['inspect'](_0x404c7b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2c13a3){return function(_0x57fead){if(isNotNull(_0x57fead)&&isNotNull(_0x57fead[0x0])){if(_0x57fead[0x0][_0x5607('0x97')]>0x0){_0x2c13a3[_0x5607('0x3d')]=_0x5607('0x98');logger['info'](_0x5607('0x99')+_0x2c13a3['name'],_0x57fead[0x0][_0x5607('0x97')],_0x5607('0x9a'));}else{_0x2c13a3[_0x5607('0x3d')]=_0x5607('0x9b');logger[_0x5607('0x7f')](_0x5607('0x9c')+_0x2c13a3[_0x5607('0x3f')]);}}};}function notSendMessagesQueue(_0xc3bd56){if(_0xc3bd56['sendMessageOneNotActive']){freeVariablesPredictive(_0xc3bd56);if(_0xc3bd56[_0x5607('0x73')]===0x0&&_0xc3bd56[_0x5607('0x55')]===0x0&&_0xc3bd56[_0x5607('0x59')]===0x0&&(_0xc3bd56[_0x5607('0x9d')]||0x0)===0x0){_0xc3bd56[_0x5607('0x9e')]=![];_0xc3bd56[_0x5607('0x51')]=0x0;_0xc3bd56[_0x5607('0x3d')]=_0x5607('0x41');loggerSyncQueueSummary[_0x5607('0x94')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xc3bd56[_0x5607('0x3f')],'is\x20not\x20active');}else{_0xc3bd56['message']=_0x5607('0x9f');loggerSyncQueueSummary[_0x5607('0x94')](_0x5607('0xa0'),_0xc3bd56[_0x5607('0x3f')],_0x5607('0xa1'));}emitVoiceQueueSummary(_0xc3bd56);}}function notSendMessagesCampaign(_0x2d27b4){if(_0x2d27b4[_0x5607('0x9e')]){if(_0x2d27b4[_0x5607('0x73')]===0x0){_0x2d27b4[_0x5607('0x9e')]=![];_0x2d27b4[_0x5607('0x3d')]=_0x5607('0x41');loggerSyncQueueSummary['error'](_0x5607('0xa2'),_0x2d27b4[_0x5607('0x3f')],_0x5607('0xa3'));}else{_0x2d27b4[_0x5607('0x3d')]=_0x5607('0x9f');loggerSyncQueueSummary['error'](_0x5607('0xa2'),_0x2d27b4[_0x5607('0x3f')],_0x5607('0xa1'));}emitCampaignSummary(_0x2d27b4);}}function createObjHistory(_0x47f6b8,_0x545560,_0x8e1705,_0x215292,_0x3d5813){_0x47f6b8[_0x5607('0x3d')]=_0x8e1705;var _0x1629ca=new Action(_0x47f6b8,_0x545560);var _0x375795=new History(_0x1629ca);_0x375795[_0x5607('0xa4')]=_0x215292;_0x375795['statedesc']=_0x3d5813;_0x375795[_0x5607('0xa5')]=_0x1629ca[_0x5607('0xa6')];return _0x375795;}Dialer[_0x5607('0xa7')][_0x5607('0x3b')]=function(){var _0x2c8f08=this;setInterval(function(){_0x2c8f08[_0x5607('0xa8')](_0x2c8f08['uniqueId'],_0x5607('0xa9'));_0x2c8f08[_0x5607('0xa8')](_0x2c8f08[_0x5607('0x24')],_0x5607('0xaa'));},0x32c8);};Dialer['prototype'][_0x5607('0xa8')]=function(_0x396c99,_0xd59368){var _0x353fa2=this;for(var _0x1862f9 in _0x396c99){if(typeof _0x396c99[_0x1862f9]!==_0x5607('0x95')){this[_0x5607('0x1e')][_0x5607('0x1b')](function(){if(!_['isNil'](_0x396c99[_0x1862f9])){return ami[_0x5607('0xab')]({'action':_0x5607('0xac'),'channel':_0x396c99[_0x1862f9][_0x5607('0xad')]})[_0x5607('0xae')](function(_0x54ad32){if(_0x54ad32[_0x5607('0x3d')]===_0x5607('0xaf')){setTimeout(function(){if(_0x396c99[_0x1862f9]&&_0x396c99[_0x1862f9][_0x5607('0x4d')]!==_0x5607('0x7d')){_0x353fa2[_0x5607('0xb0')](_0x353fa2[_0x5607('0x20')][_0x396c99[_0x1862f9]['queue']]);logger[_0x5607('0x94')](_0x5607('0xb1'),_0xd59368,_0x1862f9,_0x396c99[_0x1862f9][_0x5607('0xb2')]);delete _0x396c99[_0x1862f9];}if(_0x396c99[_0x1862f9]&&_0x396c99[_0x1862f9][_0x5607('0x4d')]===_0x5607('0x7d')){_0x353fa2[_0x5607('0xb0')](_0x353fa2[_0x5607('0x21')][_0x396c99[_0x1862f9]['queue']]);logger['error']('[Dialer][checkChannel][ivr]',_0xd59368,_0x1862f9,_0x396c99[_0x1862f9][_0x5607('0xb2')]);delete _0x396c99[_0x1862f9];}},0x2328);}});}});}}};Dialer[_0x5607('0xa7')][_0x5607('0xb3')]=function(_0x5da2b1){return BPromise[_0x5607('0xb4')]()['then'](cmHopper[_0x5607('0xb3')](_0x5da2b1))[_0x5607('0xae')](loggerCatch(_0x5607('0xb5')));};Dialer['prototype'][_0x5607('0xb6')]=function(_0x3fb5c7){return BPromise[_0x5607('0xb4')]()[_0x5607('0xb7')](cmHopperBlack['checkIsBlackList'](_0x3fb5c7))[_0x5607('0xae')](loggerCatch(_0x5607('0xb8')));};Dialer[_0x5607('0xa7')][_0x5607('0xb9')]=function(_0x6130f){return BPromise['resolve']()[_0x5607('0xb7')](cmHopperBlack[_0x5607('0xb9')](_0x6130f))[_0x5607('0xae')](loggerCatch(_0x5607('0xba')));};Dialer[_0x5607('0xa7')][_0x5607('0xbb')]=function(_0x9e0607){return BPromise['resolve']()['then'](cmHopperHistory[_0x5607('0xbc')](_0x9e0607))[_0x5607('0xae')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x5607('0xa7')][_0x5607('0xbd')]=function(_0x1384ee){return BPromise[_0x5607('0xb4')]()[_0x5607('0xb7')](cmHopper[_0x5607('0xbd')](_0x1384ee))[_0x5607('0xae')](loggerCatch(_0x5607('0xbe')));};Dialer[_0x5607('0xa7')][_0x5607('0xbf')]=function(_0xf93735,_0x14cd7d,_0x56d636){return BPromise['resolve']()[_0x5607('0xb7')](cmHopper[_0x5607('0xbf')](_0xf93735,_0x14cd7d,_0x56d636))[_0x5607('0xae')](loggerCatch(_0x5607('0xc0')));};Dialer[_0x5607('0xa7')][_0x5607('0xc1')]=function(_0x324695,_0x161a39,_0x22190d,_0x594b78,_0x14eecc){return BPromise['resolve']()['then'](cmHopper[_0x5607('0xc1')](_0x324695,_0x161a39,_0x22190d,_0x594b78))[_0x5607('0xae')](function(_0x330e51){_0x14eecc[_0x5607('0xc2')]-=_0x22190d;_0x14eecc[_0x5607('0xc2')]=_0x14eecc[_0x5607('0xc2')]>0x0?_0x14eecc[_0x5607('0xc2')]:0x0;loggerCatch(_0x5607('0xc3'))(_0x330e51);});};Dialer[_0x5607('0xa7')][_0x5607('0xc4')]=function(_0x33a83d,_0x174b3b,_0x1488d2,_0x3f32b7){return BPromise['resolve']()[_0x5607('0xb7')](cmHopper[_0x5607('0xc4')](_0x33a83d,_0x174b3b,_0x1488d2))[_0x5607('0xae')](function(_0x146226){_0x3f32b7[_0x5607('0xc2')]-=_0x174b3b;_0x3f32b7['temp']=_0x3f32b7[_0x5607('0xc2')]>0x0?_0x3f32b7[_0x5607('0xc2')]:0x0;loggerCatch(_0x5607('0xc5'))(_0x146226);});};Dialer[_0x5607('0xa7')]['getVoiceQueueRtPauses']=function(_0x3616bc){return BPromise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x3616bc))[_0x5607('0xae')](loggerCatch(_0x5607('0xc6')));};Dialer[_0x5607('0xa7')]['moveContactManagedDialer']=function(_0x3a7224){return BPromise[_0x5607('0xb4')]()[_0x5607('0xb7')](cmHopper[_0x5607('0xc7')](_0x3a7224))[_0x5607('0xae')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x5607('0xa7')][_0x5607('0xc8')]=function(_0x3b236c){return BPromise['resolve']()[_0x5607('0xb7')](cmHopperHistory['createHistory'](_0x3b236c))['catch'](loggerCatch(_0x5607('0xc9')));};Dialer[_0x5607('0xa7')]['updateOriginated']=function(_0x2e8405){if(!_[_0x5607('0x3c')](_0x2e8405)&&_0x2e8405!==null){if(typeof _0x2e8405['originated']!==_0x5607('0x95')){if(_0x2e8405[_0x5607('0x73')]>0x0){_0x2e8405[_0x5607('0x73')]-=0x1;}else{logger['error'](_0x5607('0xca'));}}}else{logger[_0x5607('0x94')](_0x5607('0xcb'));}};Dialer[_0x5607('0xa7')][_0x5607('0xcc')]=function(_0x137271,_0x280a75){var _0x95d0c=this;return function(_0x1d1a76){_0x95d0c[_0x5607('0xb0')](_0x280a75);logger[_0x5607('0x94')](_0x137271,util['inspect'](_0x1d1a76,{'showHidden':![],'depth':null}));};};Dialer[_0x5607('0xa7')]['emptyContact']=function(_0xc00089,_0x1ccc16,_0x34a530){var _0x31ff2f={'state':0x19,'statedesc':_0x5607('0xcd')};this[_0x5607('0xb0')](_0x1ccc16);this['saveInDb'](_[_0x5607('0xce')](_0x31ff2f,_[_0x5607('0xcf')](_0x34a530,[_0x5607('0xd0'),_0x5607('0xd1'),_0x5607('0xd2'),_0x5607('0xd3'),_0x5607('0xd4')])),'[emptyContact][createHistory]',_0x5607('0xd5'));logger[_0x5607('0x94')](_0xc00089);};Dialer[_0x5607('0xa7')][_0x5607('0xd6')]=function(_0x44a67c){return _0x44a67c===_0x5607('0xd7');};Dialer[_0x5607('0xa7')][_0x5607('0xd8')]=function(_0x1b92c3){return!_[_0x5607('0x3c')](_0x1b92c3)&&_0x1b92c3&&!_[_0x5607('0x3c')](_0x1b92c3[_0x5607('0x3f')])&&!_['isUndefined'](_0x1b92c3['active'])&&_0x1b92c3[_0x5607('0x78')]&&(this['trunks'][util['format'](_0x5607('0xd9'),_0x1b92c3[_0x5607('0x3f')])][_0x5607('0xac')]===_0x5607('0xda')||this['trunks'][util[_0x5607('0x7a')](_0x5607('0xd9'),_0x1b92c3['name'])][_0x5607('0xac')]==='unmonitored');};Dialer[_0x5607('0xa7')]['saveInDb']=function(_0x11ca67,_0x385dcb,_0x507419){this[_0x5607('0xc8')](_0x11ca67)['catch'](loggerCatch(_0x385dcb));this[_0x5607('0xc7')](_0x11ca67)[_0x5607('0xae')](loggerCatch(_0x507419));};Dialer[_0x5607('0xa7')]['syncVarSet']=function(_0x28788e){var _0x32a983=this[_0x5607('0x26')][_0x28788e[_0x5607('0xdb')]];var _0x43cc73;if(!_['isNil'](_0x28788e)&&!_[_0x5607('0xdc')](_0x28788e[_0x5607('0xdd')])&&!_['isNil'](_0x28788e[_0x5607('0xdd')][_0x5607('0xde')])&&_0x28788e[_0x5607('0xdf')]===_0x5607('0xe0')&&_0x32a983){if(_0x32a983[_0x5607('0x4d')]!==_0x5607('0x7d')&&this[_0x5607('0x20')][_0x32a983[_0x5607('0xb2')]][_0x5607('0xe1')]&&_0x28788e[_0x5607('0xe2')]===_0x5607('0xe3')){delete this[_0x5607('0x26')][_0x28788e[_0x5607('0xdb')]];this[_0x5607('0xb0')](this[_0x5607('0x20')][_0x32a983[_0x5607('0xb2')]]);this[_0x5607('0x20')][_0x32a983[_0x5607('0xb2')]]['outboundAnswerCallsDay']+=0x1;this[_0x5607('0x20')][_0x32a983['queue']][_0x5607('0x5d')]+=0x1;_0x43cc73=new Hangup(_0x32a983,_0x28788e);_0x43cc73[_0x5607('0xa4')]=0x12;_0x43cc73['statedesc']='HangupInAMD';_0x43cc73[_0x5607('0xe4')]='AMD';ami['emit'](_0x5607('0xe5'),ut['buildObj'](_0x43cc73,_0x5607('0xe6')));this[_0x5607('0xe7')](_0x43cc73,_0x5607('0xe8'),_0x5607('0xe9'));}if(_0x32a983['type']!==_0x5607('0x7d')&&this[_0x5607('0x20')][_0x32a983['queue']][_0x5607('0xe1')]&&_0x28788e[_0x5607('0xe2')]===_0x5607('0xea')){var _0x479e23=this;return new BPromise(function(_0xe6035b,_0x3575b6){delete _0x479e23['uniqueId'][_0x28788e['uniqueid']];_0x479e23['updateOriginated'](_0x479e23[_0x5607('0x20')][_0x32a983[_0x5607('0xb2')]]);_0x479e23[_0x5607('0x20')][_0x32a983['queue']][_0x5607('0xeb')]+=0x1;_0x479e23[_0x5607('0x20')][_0x32a983[_0x5607('0xb2')]][_0x5607('0x5d')]+=0x1;var _0x1081b9=_0x479e23['voiceQueues'][_0x32a983['queue']];var _0x5049d9=new Hangup(_0x32a983,_0x28788e);_0x5049d9[_0x5607('0xa4')]=0x13;_0x5049d9[_0x5607('0xec')]=_0x5607('0xed');_0x5049d9[_0x5607('0xe4')]='AMD';_0x5049d9['countmachineretry']+=0x1;_0x5049d9['countglobal']+=0x1;_0x5049d9['amd']=!![];ami[_0x5607('0x4c')](_0x5607('0xe5'),ut[_0x5607('0xee')](_0x5049d9,_0x5607('0xe6')));_0x479e23[_0x5607('0xc8')](_0x5049d9)[_0x5607('0xae')](loggerCatch(_0x5607('0xef')));if(_0x5049d9[_0x5607('0xf0')]+_0x5049d9[_0x5607('0xf1')]+_0x5049d9[_0x5607('0xf2')]+_0x5049d9[_0x5607('0xf3')]+_0x5049d9[_0x5607('0xf4')]+_0x5049d9[_0x5607('0xf5')]+_0x5049d9['countmachineretry']+_0x5049d9['countagentrejectretry']>=_0x1081b9[_0x5607('0xf6')]){_0x479e23[_0x5607('0xf7')](_0x5049d9,_0xe6035b,_0x3575b6,_0x5607('0xf8'));}else{if(_0x5049d9['countmachineretry']>=_0x1081b9[_0x5607('0xf9')]){_0x479e23[_0x5607('0xfa')](_0x5049d9,_0xe6035b,_0x3575b6,_0x5607('0xfb'));}else{_0x479e23[_0x5607('0xbd')]({'active':![],'countmachineretry':_0x5049d9[_0x5607('0xfc')],'scheduledat':moment()[_0x5607('0xfd')](_0x1081b9[_0x5607('0xfe')],_0x5607('0xff'))[_0x5607('0x7a')](_0x5607('0x100')),'ContactId':_0x5049d9[_0x5607('0xd0')],'ListId':_0x5049d9[_0x5607('0xd1')],'VoiceQueueId':_0x5049d9[_0x5607('0xd3')]||undefined,'CampaignId':_0x5049d9[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x101')));_0xe6035b({'reschedule':0x1});}}});}if(_0x32a983[_0x5607('0x4d')]===_0x5607('0x7d')&&this['campaigns'][_0x32a983[_0x5607('0xb2')]]['dialAMDActive']&&_0x28788e[_0x5607('0xe2')]===_0x5607('0xe3')){delete this[_0x5607('0x26')][_0x28788e[_0x5607('0xdb')]];this[_0x5607('0xb0')](this['campaigns'][_0x32a983['queue']]);_0x43cc73=new Hangup(_0x32a983,_0x28788e);_0x43cc73[_0x5607('0xa4')]=0x12;_0x43cc73[_0x5607('0xec')]=_0x5607('0x102');_0x43cc73[_0x5607('0xe4')]=_0x5607('0x103');ami[_0x5607('0x4c')](_0x5607('0xe5'),ut[_0x5607('0xee')](_0x43cc73,_0x5607('0xe6')));this[_0x5607('0xe7')](_0x43cc73,_0x5607('0x104'),_0x5607('0x105'));}if(_0x32a983[_0x5607('0x4d')]==='ivr'&&this['campaigns'][_0x32a983['queue']]['dialAMDActive']&&_0x28788e['value']==='MACHINE'){var _0x479e23=this;return new BPromise(function(_0x32e6da,_0x7425e1){delete _0x479e23[_0x5607('0x26')][_0x28788e[_0x5607('0xdb')]];_0x479e23[_0x5607('0xb0')](_0x479e23[_0x5607('0x21')][_0x32a983[_0x5607('0xb2')]]);_0x479e23[_0x5607('0x21')][_0x32a983['queue']][_0x5607('0xeb')]+=0x1;_0x479e23['campaigns'][_0x32a983[_0x5607('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1724b4=_0x479e23[_0x5607('0x21')][_0x32a983[_0x5607('0xb2')]];var _0x11b2e5=new Hangup(_0x32a983,_0x28788e);_0x11b2e5[_0x5607('0xa4')]=0x13;_0x11b2e5[_0x5607('0xec')]=_0x5607('0xed');_0x11b2e5[_0x5607('0xe4')]=_0x5607('0x103');_0x11b2e5[_0x5607('0xfc')]+=0x1;_0x11b2e5[_0x5607('0x106')]+=0x1;_0x11b2e5[_0x5607('0xe6')]=!![];ami[_0x5607('0x4c')](_0x5607('0xe5'),ut['buildObj'](_0x11b2e5,_0x5607('0xe6')));_0x479e23[_0x5607('0xc8')](_0x11b2e5)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x11b2e5[_0x5607('0xf0')]+_0x11b2e5[_0x5607('0xf1')]+_0x11b2e5[_0x5607('0xf2')]+_0x11b2e5['countnosuchnumberretry']+_0x11b2e5[_0x5607('0xf4')]+_0x11b2e5[_0x5607('0xf5')]+_0x11b2e5[_0x5607('0xfc')]+_0x11b2e5[_0x5607('0x107')]>=_0x1724b4[_0x5607('0xf6')]){_0x479e23[_0x5607('0xf7')](_0x11b2e5,_0x32e6da,_0x7425e1,'reason19\x20machine....');}else{if(_0x11b2e5[_0x5607('0xfc')]>=_0x1724b4[_0x5607('0xf9')]){_0x479e23[_0x5607('0xfa')](_0x11b2e5,_0x32e6da,_0x7425e1,_0x5607('0xfb'));}else{_0x479e23[_0x5607('0xbd')]({'active':![],'countmachineretry':_0x11b2e5[_0x5607('0xfc')],'scheduledat':moment()['add'](_0x1724b4[_0x5607('0xfe')],_0x5607('0xff'))[_0x5607('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x11b2e5['ContactId'],'ListId':_0x11b2e5[_0x5607('0xd1')],'VoiceQueueId':_0x11b2e5['VoiceQueueId']||undefined,'CampaignId':_0x11b2e5[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x101')));_0x32e6da({'reschedule':0x1});}}});}}};Dialer[_0x5607('0xa7')][_0x5607('0x108')]=function(_0x225567){var _0x54bf2e=this[_0x5607('0x26')][_0x225567[_0x5607('0xdb')]];var _0x275ffd=this;var _0x26e4f9;if(_0x54bf2e&&_0x54bf2e[_0x5607('0x4d')]===_0x5607('0x7d')){delete this[_0x5607('0x26')][_0x225567[_0x5607('0xdb')]];this[_0x5607('0xb0')](this[_0x5607('0x21')][_0x54bf2e[_0x5607('0xb2')]]);this[_0x5607('0x21')][_0x54bf2e['queue']][_0x5607('0x109')]+=0x1;_0x26e4f9=new Hangup(_0x54bf2e,_0x225567);this[_0x5607('0xc8')](_0x26e4f9)['catch'](loggerCatch(_0x5607('0x10a')));this[_0x5607('0xc7')](_0x26e4f9)['catch'](loggerCatch(_0x5607('0x10b')));}if(_0x54bf2e&&_0x54bf2e[_0x5607('0x4d')]!==_0x5607('0x7d')&&isNotNull(this[_0x5607('0x20')][_0x54bf2e['queue']][_0x5607('0x10c')])){delete this[_0x5607('0x26')][_0x225567[_0x5607('0xdb')]];this['updateOriginated'](this[_0x5607('0x20')][_0x54bf2e[_0x5607('0xb2')]]);this[_0x5607('0x20')][_0x54bf2e[_0x5607('0xb2')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x54bf2e[_0x5607('0xb2')]][_0x5607('0x5d')]+=0x1;_0x26e4f9=new Hangup(_0x54bf2e,_0x225567);_0x26e4f9[_0x5607('0xa4')]=0x10;_0x26e4f9[_0x5607('0xec')]=_0x5607('0x10d');_0x26e4f9[_0x5607('0xe4')]=_0x5607('0x10e');this[_0x5607('0xc8')](_0x26e4f9)['catch'](loggerCatch(_0x5607('0x10a')));this[_0x5607('0xc7')](_0x26e4f9)[_0x5607('0xae')](loggerCatch(_0x5607('0x10b')));}if(_0x54bf2e&&_0x54bf2e[_0x5607('0x4d')]!==_0x5607('0x7d')&&!isNotNull(this[_0x5607('0x20')][_0x54bf2e[_0x5607('0xb2')]]['dialQueueProject'])){delete this['uniqueId'][_0x225567['uniqueid']];this[_0x5607('0xb0')](this[_0x5607('0x20')][_0x54bf2e[_0x5607('0xb2')]]);this['voiceQueues'][_0x54bf2e['queue']][_0x5607('0x67')]+=0x1;_0x26e4f9=new Hangup(_0x54bf2e,_0x225567);_0x26e4f9[_0x5607('0xa4')]=0xc;_0x26e4f9[_0x5607('0xec')]=_0x225567[_0x5607('0x10f')];_0x26e4f9[_0x5607('0xe4')]='Unknow';this['createHistory'](_0x26e4f9)[_0x5607('0xae')](loggerCatch(_0x5607('0x10a')));this[_0x5607('0xc7')](_0x26e4f9)[_0x5607('0xae')](loggerCatch(_0x5607('0x10b')));}};Dialer['prototype'][_0x5607('0x32')]=function(_0x2cd72f){var _0x144a9a=this[_0x5607('0x26')][_0x2cd72f[_0x5607('0xdb')]];var _0x2d4d90=this;if(this[_0x5607('0x20')][_0x2cd72f[_0x5607('0xb2')]]){if(_0x144a9a&&_0x144a9a[_0x5607('0x4d')]!==_0x5607('0x7d')){delete this[_0x5607('0x26')][_0x2cd72f[_0x5607('0xdb')]];this[_0x5607('0x20')][_0x2cd72f[_0x5607('0xb2')]][_0x5607('0xeb')]+=0x1;var _0x3a8971=new AgentComplete(_0x144a9a,_0x2cd72f);if(_0x2cd72f['reason']==='agent'){_0x3a8971[_0x5607('0x110')]=this[_0x5607('0x20')][_0x2cd72f['queue']][_0x5607('0x111')]&&this[_0x5607('0x20')][_0x2cd72f[_0x5607('0xb2')]][_0x5607('0x112')]?moment()[_0x5607('0x7a')](_0x5607('0x100')):undefined;}this[_0x5607('0xc8')](_0x3a8971)[_0x5607('0xae')](loggerCatch(_0x5607('0x113')));this[_0x5607('0xc7')](_0x3a8971)['catch'](loggerCatch(_0x5607('0x114')));}}};Dialer[_0x5607('0xa7')][_0x5607('0x2c')]=function(_0x48e2d2){if(this[_0x5607('0x20')][_0x48e2d2['queue']]){if(this['uniqueId'][_0x48e2d2[_0x5607('0xdb')]]&&this[_0x5607('0x26')][_0x48e2d2['uniqueid']][_0x5607('0x4d')]!==_0x5607('0x7d')){this[_0x5607('0xb0')](this[_0x5607('0x20')][_0x48e2d2[_0x5607('0xb2')]]);this[_0x5607('0x26')][_0x48e2d2['uniqueid']][_0x5607('0x115')]=moment()[_0x5607('0x7a')](_0x5607('0x100'));}}};Dialer['prototype'][_0x5607('0x116')]=function(_0x28495c){this[_0x5607('0xc8')](_0x28495c)[_0x5607('0xae')](loggerCatch(_0x5607('0x113')));this[_0x5607('0xc7')](_0x28495c)[_0x5607('0xae')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x5607('0x117')]=function(_0xb246b5){var _0x58900a=this['uniqueId'][_0xb246b5[_0x5607('0xdb')]];var _0x5d00b5=this;if(this[_0x5607('0x20')][_0xb246b5[_0x5607('0xb2')]]){if(_0x58900a&&_0x58900a['type']!==_0x5607('0x7d')){delete this[_0x5607('0x26')][_0xb246b5['uniqueid']];this[_0x5607('0xb0')](this['voiceQueues'][_0xb246b5[_0x5607('0xb2')]]);_0x58900a[_0x5607('0x118')]=moment()['format'](_0x5607('0x100'));var _0x1846ef=new QueueCallerAbandon(_0x58900a,_0xb246b5);if(getSeconds(_0x58900a[_0x5607('0x118')],_0x58900a[_0x5607('0x119')])>=_0x58900a[_0x5607('0x11a')]){this['voiceQueues'][_0xb246b5['queue']][_0x5607('0x6c')]+=0x1;this['voiceQueues'][_0xb246b5[_0x5607('0xb2')]][_0x5607('0x63')]+=0x1;this['voiceQueues'][_0xb246b5[_0x5607('0xb2')]][_0x5607('0x6e')]+=0x1;_0x1846ef[_0x5607('0xa4')]=0xa;_0x1846ef[_0x5607('0xec')]=_0x5607('0x11b');_0x1846ef[_0x5607('0x11c')]=_0x5607('0x11d');_0x1846ef['agiafterat']=this[_0x5607('0x20')][_0xb246b5[_0x5607('0xb2')]]['dialQueueProject2']?moment()[_0x5607('0x7a')](_0x5607('0x100')):undefined;_0x1846ef[_0x5607('0xf4')]+=0x1;_0x1846ef[_0x5607('0x106')]+=0x1;if(_0x1846ef[_0x5607('0xf4')]>=this[_0x5607('0x20')][_0xb246b5['queue']][_0x5607('0x11e')]){this['queueCallerAbandonCreateState'](_0x1846ef);}else{this[_0x5607('0xbd')]({'active':![],'countdropretry':_0x1846ef[_0x5607('0xf4')],'scheduledat':moment()[_0x5607('0xfd')](this[_0x5607('0x20')][_0xb246b5[_0x5607('0xb2')]][_0x5607('0x11f')],_0x5607('0xff'))['format'](_0x5607('0x100')),'ContactId':_0x58900a[_0x5607('0xd0')],'ListId':_0x58900a[_0x5607('0xd1')],'VoiceQueueId':_0x58900a[_0x5607('0xd3')]||undefined,'CampaignId':_0x58900a[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x120')));var _0x3705e3=new History(_0x1846ef);_0x3705e3['state']=0xa;_0x3705e3[_0x5607('0xec')]=_0x5607('0x11b');_0x3705e3[_0x5607('0xa6')]=moment()['format'](_0x5607('0x100'));_0x3705e3['endtime']=_0x3705e3[_0x5607('0xa6')];_0x3705e3[_0x5607('0x121')]=_0x1846ef[_0x5607('0x121')];_0x3705e3[_0x5607('0x122')]=_0x1846ef[_0x5607('0x122')];this[_0x5607('0xc8')](_0x3705e3)[_0x5607('0xae')](loggerCatch(_0x5607('0x123')));}}else{this[_0x5607('0x20')][_0xb246b5[_0x5607('0xb2')]][_0x5607('0x6b')]+=0x1;this[_0x5607('0x20')][_0xb246b5[_0x5607('0xb2')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1846ef[_0x5607('0xa4')]=0xb;_0x1846ef['statedesc']=_0x5607('0x124');_0x1846ef[_0x5607('0x11c')]=_0x5607('0x125');_0x1846ef[_0x5607('0xf5')]+=0x1;_0x1846ef[_0x5607('0x106')]+=0x1;if(_0x1846ef['countabandonedretry']>=this[_0x5607('0x20')][_0xb246b5[_0x5607('0xb2')]][_0x5607('0x126')]){this[_0x5607('0x116')](_0x1846ef);}else{this[_0x5607('0xbd')]({'active':![],'countabandonedretry':_0x1846ef['countabandonedretry'],'scheduledat':moment()['add'](this['voiceQueues'][_0xb246b5[_0x5607('0xb2')]]['dialAbandonedRetryFrequency'],_0x5607('0xff'))[_0x5607('0x7a')](_0x5607('0x100')),'ContactId':_0x58900a['ContactId'],'ListId':_0x58900a[_0x5607('0xd1')],'VoiceQueueId':_0x58900a[_0x5607('0xd3')]||undefined,'CampaignId':_0x58900a[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x127')));var _0x3705e3=new History(_0x1846ef);_0x3705e3['state']=0xb;_0x3705e3[_0x5607('0xec')]='Abandoned';_0x3705e3['starttime']=moment()[_0x5607('0x7a')](_0x5607('0x100'));_0x3705e3[_0x5607('0xa5')]=_0x3705e3[_0x5607('0xa6')];_0x3705e3['calleridname']=_0x1846ef[_0x5607('0x121')];_0x3705e3['calleridnum']=_0x1846ef[_0x5607('0x122')];this[_0x5607('0xc8')](_0x3705e3)[_0x5607('0xae')](loggerCatch(_0x5607('0x128')));}}}}};Dialer['prototype'][_0x5607('0x129')]=function(_0x10ceb1){if(this['actions'][_0x10ceb1['uniqueid']]){this['actions'][_0x10ceb1[_0x5607('0xdb')]][_0x5607('0xad')]=_0x10ceb1[_0x5607('0xad')];}if(this['uniqueId'][_0x10ceb1[_0x5607('0xdb')]]){this[_0x5607('0x26')][_0x10ceb1[_0x5607('0xdb')]]['channel']=_0x10ceb1['channel'];}};Dialer[_0x5607('0xa7')][_0x5607('0x12a')]=function(_0xfc4489){if(strategy[this['voiceQueues'][this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]][_0x5607('0xb2')]]['strategy']]===_0x5607('0x1a')){if(this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]]&&_[_0x5607('0xdc')](this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]][_0x5607('0x12c')])&&_0xfc4489[_0x5607('0xac')]==='1'&&_0xfc4489[_0x5607('0x12d')]==='0'){if(this['agents'][_0xfc4489['stateinterface']]){if(!this[_0x5607('0x22')][_0xfc4489[_0x5607('0x12e')]][_0x5607('0x12c')]){this[_0x5607('0x22')][_0xfc4489['stateinterface']][_0x5607('0x12c')]=!![];this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]]['locked']=!![];this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]]['stateinterface']=_0xfc4489['stateinterface'];}}}}else if((strategy[this[_0x5607('0x20')][this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]][_0x5607('0xb2')]]['strategy']]||_0x5607('0x12f'))===_0x5607('0x12f')){if(this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]]){if(this[_0x5607('0x22')][_0xfc4489[_0x5607('0x12e')]]){this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]]['stateinterface']=_0xfc4489[_0x5607('0x12e')];if(_[_0x5607('0xdc')](this[_0x5607('0x2b')][this['actions'][_0xfc4489[_0x5607('0x12b')]]['queue']])){this[_0x5607('0x2b')][this[_0x5607('0x24')][_0xfc4489[_0x5607('0x12b')]]['queue']]=[];}this['queueBooked'][this['actions'][_0xfc4489[_0x5607('0x12b')]]['queue']][_0x5607('0x130')](_['merge'](_[_0x5607('0xcf')](this[_0x5607('0x24')][_0xfc4489['actionid']],[_0x5607('0x131'),_0x5607('0x12e')]),{'status':_0xfc4489[_0x5607('0xac')],'paused':_0xfc4489[_0x5607('0x12d')]}));}}}};function unlockQueueStatus(_0x2eaecf,_0x407e8a){setTimeout(function(){if(_[_0x5607('0x3c')](_0x2eaecf['queueStatusComplete'])){loggerBooked['error'](_0x5607('0x132'),_0x407e8a);}_0x2eaecf[_0x5607('0x133')]=!![];loggerBooked[_0x5607('0x7f')](_0x5607('0x134'),_0x407e8a,JSON[_0x5607('0x49')](_['pick'](_0x2eaecf,[_0x5607('0x3f'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x265277){var _0x51aa9f=this;var _0x3dd6cb=_0x51aa9f[_0x5607('0x20')][_0x51aa9f[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]]['queue']];if(strategy[this['voiceQueues'][this[_0x5607('0x24')][_0x265277['actionid']]['queue']][_0x5607('0x4f')]]===_0x5607('0x1a')){if(this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]]&&this['actions'][_0x265277[_0x5607('0x12b')]][_0x5607('0x12e')]){this[_0x5607('0x1f')][_0x5607('0x135')](this[_0x5607('0x24')][_0x265277['actionid']][_0x5607('0x131')],this[_0x5607('0x24')][_0x265277['actionid']][_0x5607('0x12e')])[_0x5607('0xae')](function(_0x3942b3){logger[_0x5607('0x94')](_0x5607('0x136'),util['inspect'](_0x3942b3,{'showHidden':![],'depth':null}));})[_0x5607('0x1d')](function(){_0x51aa9f['updateOriginated'](_0x51aa9f[_0x5607('0x20')][_0x51aa9f[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]]);_0x51aa9f[_0x5607('0x22')][_0x51aa9f[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0x12e')]][_0x5607('0x12c')]=![];delete _0x51aa9f[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]];unlockQueueStatus(_0x3dd6cb);});}else{this[_0x5607('0xb0')](this[_0x5607('0x20')][this['actions'][_0x265277[_0x5607('0x12b')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x265277[_0x5607('0x12b')]][_0x5607('0xd0')],'ListId':this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xd1')],'VoiceQueueId':this['actions'][_0x265277['actionid']][_0x5607('0xd3')]||undefined,'CampaignId':this[_0x5607('0x24')][_0x265277['actionid']][_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]];unlockQueueStatus(_0x3dd6cb);}}else if((strategy[this['voiceQueues'][this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]][_0x5607('0x4f')]]||_0x5607('0x12f'))===_0x5607('0x12f')){var _0x4cf180;if(this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]]&&!_[_0x5607('0x45')](this['queueBooked'][this['actions'][_0x265277[_0x5607('0x12b')]]['queue']])){if(this[_0x5607('0x137')][_0x51aa9f[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]]){this[_0x5607('0x137')][_0x51aa9f[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]]=this[_0x5607('0x137')][this['actions'][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]]?this['queueBookedRR'][this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]]:this['queueBooked'][this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]]['queue']]?this[_0x5607('0x2b')][this['actions'][_0x265277['actionid']]['queue']][_0x5607('0x138')]||0x0:0x0;}this[_0x5607('0x2b')][this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]]['_rr']=this['queueBookedRR'][this[_0x5607('0x24')][_0x265277[_0x5607('0x12b')]][_0x5607('0xb2')]];for(var _0xee6689=0x0;_0xee6689=0x0;})[_0x5607('0xae')](myreject(_0x42b020)));}}else{_0x4970ee[_0x5607('0x130')](ami[_0x5607('0xab')]({'action':'command','command':util[_0x5607('0x7a')]('iftime\x20%s,%s',_0x210c86,!_[_0x5607('0x3c')](config['timezones'][_0x91eb6e])?_0x91eb6e:'')})[_0x5607('0xb7')](function(_0x41dce5){return _0x41dce5['content'][_0x5607('0x151')](_0x5607('0x152'))>=0x0;})['catch'](myreject(_0x42b020)));}BPromise[_0x5607('0x153')](_0x4970ee)['then'](function(_0x4835f2){var _0x160612=_[_0x5607('0x154')](_0x4835f2);if(_0x160612){return _0xd40d17(_0x160612);}else{_0x5a7792[_0x5607('0x3d')]=_0x5910a3?'GLOBAL_INTERVAL_IS_OVERTIME':_0x5607('0x155');return _0x42b020(msgResponse(_0x5607('0x156'),_0x5607('0x147'),_0x5607('0x157')+_0x5910a3+'\x20'+_0x2e8922+_0x5607('0x158')+util[_0x5607('0x93')](_0x210c86,{'showHidden':![],'depth':null})+_0x5607('0x159')+_0x91eb6e));}})['catch'](function(_0x338dea){return _0x42b020(msgResponse(_0x5607('0x146'),_0x5607('0x147'),JSON[_0x5607('0x49')](_0x338dea)));});});};Dialer[_0x5607('0xa7')][_0x5607('0x15a')]=function(_0x4bcee4){var _0x43bf7b=this;return function(){switch(_0x4bcee4['dialMethod']){case _0x5607('0x15b'):freeVariablesPredictive(_0x4bcee4);_0x43bf7b[_0x5607('0x15c')](_0x4bcee4,0x1);break;case _0x5607('0x15d'):freeVariablesPredictive(_0x4bcee4);_0x43bf7b[_0x5607('0x15c')](_0x4bcee4,_0x4bcee4['dialPowerLevel']);break;case _0x5607('0x7'):_0x43bf7b[_0x5607('0x7')](_0x4bcee4);break;case _0x5607('0x6'):freeVariablesPredictive(_0x4bcee4);_0x43bf7b[_0x5607('0x15c')](_0x4bcee4,0x1);break;default:freeVariablesPredictive(_0x4bcee4);logger[_0x5607('0x94')](_0x5607('0x15e'),_0x4bcee4[_0x5607('0x3f')],_0x5607('0x15f'));}};};Dialer[_0x5607('0xa7')][_0x5607('0x160')]=function(_0x1aea0f){var _0xbdb47b=this;return function(){_0xbdb47b['handleIvr'](_0x1aea0f);};};Dialer['prototype']['syncQueueSummary']=function(_0x427158){var _0x129060=this;if(isNotPreview(_0x427158[_0x5607('0x5b')])){if(isVoiceQueueOutbound(_0x427158[_0x5607('0x4d')])&&isActive(_0x427158[_0x5607('0x161')])){_0x427158['sendMessageOneNotActive']=!![];BPromise[_0x5607('0xb4')]()[_0x5607('0xb7')](checkIsLoggedIn(_0x427158,_0x427158['loggedIn']))[_0x5607('0xb7')](checkIsActive(_0x427158,_0x427158['dialActive']))[_0x5607('0xb7')](checkInterval(_0x427158))['then'](_0x129060['checkIsTrunkReachable'](_0x427158))['then'](_0x129060[_0x5607('0x145')](_0x427158[_0x5607('0x162')],_0x427158['dialTimezone'],_0x427158[_0x5607('0x3f')],_0x427158))[_0x5607('0xb7')](_0x129060[_0x5607('0x163')](_0x427158['Interval'],_0x427158[_0x5607('0x164')],_0x427158[_0x5607('0x3f')],_0x427158))[_0x5607('0xb7')](_0x129060[_0x5607('0x15a')](_0x427158))[_0x5607('0xae')](loggerCatchQueueSummary(_0x5607('0x165'),_0x427158));}else{notSendMessagesQueue(_0x427158);}}else{freeVariablesPredictive(_0x427158);}};Dialer[_0x5607('0xa7')][_0x5607('0x141')]=function(){var _0x5cc60d=this;var _0x381258;for(var _0x565d18 in this[_0x5607('0x21')]){if(typeof this[_0x5607('0x21')][_0x565d18]!=='undefined'){_0x381258=this['campaigns'][_0x565d18];if(isCampaignIvr(_0x381258['type'])&&isActive(_0x381258[_0x5607('0x78')])){_0x381258['sendMessageOneNotActive']=!![];BPromise[_0x5607('0xb4')]()['then'](checkIsActive(_0x381258,_0x381258[_0x5607('0x78')]))[_0x5607('0xb7')](checkInterval(_0x381258))[_0x5607('0xb7')](_0x5cc60d['checkIsTrunkReachable'](_0x381258))[_0x5607('0xb7')](_0x5cc60d['checkIfTime'](_0x381258[_0x5607('0x162')],_0x381258[_0x5607('0x164')],_0x381258[_0x5607('0x3f')],_0x381258))['then'](_0x5cc60d[_0x5607('0x163')](_0x381258[_0x5607('0x44')],_0x381258['dialTimezone'],_0x381258[_0x5607('0x3f')],_0x381258))[_0x5607('0xb7')](_0x5cc60d[_0x5607('0x160')](_0x381258))[_0x5607('0xae')](loggerCatchQueueSummary(_0x5607('0x166'),_0x381258));}else{notSendMessagesCampaign(_0x381258);}}}};function getCallerIdRandom(_0x478760,_0x836377){var _0x336c02;var _0x41484a;var _0x59f793;if(_0x836377<=0x0){_0x836377=0x1;}_0x336c02=new RegExp('\x5cw{0,'+_0x836377+'}$');_0x41484a=Math['pow'](0xa,_0x836377-0x1);_0x59f793=Math[_0x5607('0x167')](0xa,_0x836377)-0x1;return util[_0x5607('0x7a')]('%s',_[_0x5607('0x168')](_0x478760,_0x336c02,_[_0x5607('0x169')](_0x41484a,_0x59f793)));}function extractCalleridName(_0x5b0619){var _0xbc0e36=_0x5b0619['match'](/"(.*?)"/);return _0xbc0e36?_0xbc0e36[0x1]:_0x5b0619;}function extractCalleridNumber(_0x447216){var _0x141704=_0x447216['match'](/<(.*?)>/);return _0x141704?_0x141704[0x1]:_0x447216;}Dialer[_0x5607('0xa7')]['actionOriginate']=function(_0x4be2e4,_0x4c3b7d){var _0x1d3898=this;var _0xcc0930=uuid['v4']();this[_0x5607('0x24')][_0xcc0930]=new Action(_0x4be2e4,_0x4c3b7d,_0xcc0930);return new BPromise(function(_0x14e7f9,_0xe3a7c3){if(_[_0x5607('0x3c')](_0x4be2e4)&&typeof _0x4be2e4!==_0x5607('0x16a')){return _0xe3a7c3(msgResponse(_0x5607('0x16b'),'Failure',_0x5607('0x16c')));}if(_['isUndefined'](_0x4c3b7d[_0x5607('0x16d')][_0x5607('0x16e')])||_0x4c3b7d['Contact'][_0x5607('0x16e')]===null){return _0xe3a7c3(msgResponse(_0x5607('0x16b'),'Failure',_0x5607('0x16f')));}var _0xcf3c1f={'XMD-CALLERID':_0x1d3898['actions'][_0xcc0930][_0x5607('0x170')](),'XMD-AGI':_0x4be2e4[_0x5607('0x10c')]?util['format'](_0x5607('0x171'),ipAgi,_0x4be2e4[_0x5607('0x10c')]):_0x5607('0x172'),'XMD-AGIAFTER':_0x4be2e4[_0x5607('0x111')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x4be2e4['dialQueueProject2']):_0x5607('0x172'),'XMD-QUEUE':_0x4be2e4['type']===_0x5607('0x4e')?util[_0x5607('0x7a')](_0x5607('0x173'),_0x4be2e4[_0x5607('0x3f')],_0x4be2e4[_0x5607('0x174')]||'',_0x4be2e4[_0x5607('0x112')]?'c':'',_0x4be2e4[_0x5607('0x11a')]||0x3):_0x5607('0x172'),'XMD-CONTACTID':_0x4c3b7d[_0x5607('0xd0')],'XMD-CDRTYPE':_0x5607('0x5'),'CALLERID(all)':_0x1d3898[_0x5607('0x24')][_0xcc0930][_0x5607('0x170')](),'XMD-AMD':_0x4be2e4[_0x5607('0xe1')]?'ACTIVE':_0x5607('0x172'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4be2e4[_0x5607('0xe1')]){_0xcf3c1f[_0x5607('0x175')]=_0x4be2e4[_0x5607('0x176')]||0x9c4;_0xcf3c1f[_0x5607('0x177')]=_0x4be2e4[_0x5607('0x178')]||0x5dc;_0xcf3c1f[_0x5607('0x179')]=_0x4be2e4['dialAMDAfterGreetingSilence']||0x320;_0xcf3c1f['XMD-AMDTOTALANALYSISTIME']=_0x4be2e4[_0x5607('0x17a')]||0x1388;_0xcf3c1f[_0x5607('0x17b')]=_0x4be2e4[_0x5607('0x17c')]||0x64;_0xcf3c1f[_0x5607('0x17d')]=_0x4be2e4[_0x5607('0x17e')]||0x32;_0xcf3c1f[_0x5607('0x17f')]=_0x4be2e4[_0x5607('0x180')]||0x3;_0xcf3c1f[_0x5607('0x181')]=_0x4be2e4[_0x5607('0x182')]||0x100;_0xcf3c1f['XMD-AMDMAXIMUMWORDLENGTH']=_0x4be2e4[_0x5607('0x183')]||0x1388;}if(_0x4be2e4[_0x5607('0x4d')]===_0x5607('0x4e')){_0xcf3c1f['XMD-VOICEQUEUEID']=_0x4c3b7d[_0x5607('0xd3')];}else{_0xcf3c1f[_0x5607('0x184')]=_0x4c3b7d[_0x5607('0xd4')];}for(var _0x18b955 in _0x4c3b7d[_0x5607('0x16d')]){if(typeof _0x4c3b7d[_0x5607('0x16d')][_0x18b955]!==_0x5607('0x95')){if(isNotNull(_0x4c3b7d[_0x5607('0x16d')][_0x18b955])&&_0x18b955!=='id'&&_0x18b955!==_0x5607('0x185')&&_0x18b955!==_0x5607('0x186')&&_0x18b955!==_0x5607('0x187')){_0xcf3c1f[util[_0x5607('0x7a')](_0x5607('0x188'),_0x5607('0x189'),_[_0x5607('0x18a')](_0x18b955))]=_0x4c3b7d['Contact'][_0x18b955];}}}var _0x138f73=_0x1d3898[_0x5607('0xd8')](_0x4be2e4[_0x5607('0x77')])?getCallerId(_0x4be2e4[_0x5607('0x77')][_0x5607('0x18b')],_0x4be2e4[_0x5607('0x18c')],_0x4be2e4['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4be2e4[_0x5607('0x18d')],_0x4be2e4[_0x5607('0x18e')]):_0x4be2e4['dialOriginateCallerIdNumber']):getCallerId(_[_0x5607('0xdc')](_0x4be2e4[_0x5607('0x18f')])?_0x4be2e4[_0x5607('0x77')][_0x5607('0x18b')]:_0x4be2e4[_0x5607('0x18f')]['callerid'],_0x4be2e4['dialOriginateCallerIdName'],_0x4be2e4['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4be2e4[_0x5607('0x18d')],_0x4be2e4[_0x5607('0x18e')]):_0x4be2e4[_0x5607('0x18d')]);if(_0x138f73){_0xcf3c1f[_0x5607('0x190')]=_0x1d3898[_0x5607('0x24')][_0xcc0930]['originatecalleridname']=extractCalleridName(_0x138f73);_0xcf3c1f['XMD-ORIGINATECALLERIDNUM']=_0x1d3898[_0x5607('0x24')][_0xcc0930][_0x5607('0x191')]=extractCalleridNumber(_0x138f73);}return ami[_0x5607('0xab')]({'actionid':_0xcc0930,'action':_0x5607('0x16b'),'channel':_0x1d3898[_0x5607('0xd8')](_0x4be2e4[_0x5607('0x77')])?util['format'](_0x5607('0x192'),_0x4be2e4[_0x5607('0x77')]['name'],isNotNull(_0x4be2e4[_0x5607('0x5c')])?_0x4be2e4['dialPrefix'][_0x5607('0x193')]()||'':'',_0x4be2e4['dialCutDigit']>0x0?_0x4c3b7d[_0x5607('0x16d')][_0x5607('0x16e')][_0x5607('0x194')](_0x4be2e4[_0x5607('0x195')]):_0x4c3b7d['Contact'][_0x5607('0x16e')]):util['format'](_0x5607('0x192'),_['isNil'](_0x4be2e4[_0x5607('0x18f')])?_0x4be2e4[_0x5607('0x77')][_0x5607('0x3f')]:_0x4be2e4['TrunkBackup'][_0x5607('0x3f')],isNotNull(_0x4be2e4['dialPrefix'])?_0x4be2e4['dialPrefix'][_0x5607('0x193')]()||'':'',_0x4be2e4[_0x5607('0x195')]>0x0?_0x4c3b7d[_0x5607('0x16d')]['phone'][_0x5607('0x194')](_0x4be2e4[_0x5607('0x195')]):_0x4c3b7d['Contact']['phone']),'callerid':_0x138f73,'Exten':_0x5607('0xe0'),'Context':'from-sip','Priority':'1','variable':_0xcf3c1f,'timeout':(_0x4be2e4[_0x5607('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcc0930})[_0x5607('0xb7')](function(_0x54c0f9){return _0x14e7f9(_0x54c0f9);})['catch'](function(_0x33b708){_0x4be2e4[_0x5607('0x197')]+=0x1;var _0x534ae6=new History(_0x1d3898['actions'][_0xcc0930]);logger['error'](util[_0x5607('0x7a')](_0x5607('0x198'),JSON[_0x5607('0x49')](_0x33b708)));_0x534ae6[_0x5607('0xa4')]=0xe;_0x534ae6[_0x5607('0xec')]='OriginateError';_0x534ae6[_0x5607('0xa6')]=moment()[_0x5607('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0x534ae6[_0x5607('0xa5')]=_0x534ae6[_0x5607('0xa6')];_0x1d3898[_0x5607('0xc8')](_0x534ae6)[_0x5607('0xae')](loggerCatch(_0x5607('0x199')));_0x1d3898[_0x5607('0xc7')](_0x534ae6)[_0x5607('0xae')](loggerCatch(_0x5607('0x199')))[_0x5607('0x1d')](function(){delete _0x1d3898['actions'][_0xcc0930];return _0xe3a7c3(msgResponse(_0x5607('0x16b'),_0x5607('0x48'),_0x5607('0x19a')));});});});};Dialer[_0x5607('0xa7')][_0x5607('0x30')]=function(_0x1a8412){var _0x540b76=this[_0x5607('0x24')][_0x1a8412[_0x5607('0x12b')]];if(_0x540b76){delete this['actions'][_0x1a8412[_0x5607('0x12b')]];_0x540b76['responsetime']=moment()[_0x5607('0x7a')](_0x5607('0x100'));var _0x4b2a23=_0x540b76[_0x5607('0x4d')]===_0x5607('0x7d')?this[_0x5607('0x21')][_0x540b76['queue']]:this[_0x5607('0x20')][_0x540b76['getQueue']()];if(!this[_0x5607('0xd6')](_0x1a8412[_0x5607('0x19b')])){this[_0x5607('0xb0')](_0x4b2a23);return this[_0x5607('0x19c')](_0x540b76,_0x4b2a23,_0x1a8412)[_0x5607('0xae')](loggerCatch(_0x5607('0x19d')));}this[_0x5607('0x26')][_0x1a8412[_0x5607('0xdb')]]=_0x540b76;}};Dialer[_0x5607('0xa7')][_0x5607('0x19e')]=function(_0x2b8105,_0x118c70,_0x36187f){var _0x1b0104=new History(_0x118c70);if(_0x1b0104['countbusyretry']+_0x1b0104[_0x5607('0xf1')]+_0x1b0104[_0x5607('0xf2')]+_0x1b0104[_0x5607('0xf3')]+_0x1b0104[_0x5607('0xf4')]+_0x1b0104['countabandonedretry']+_0x1b0104[_0x5607('0xfc')]+_0x1b0104[_0x5607('0x107')]>=_0x36187f[_0x5607('0xf6')]-0x1){return!![];}switch(_0x2b8105){case 0x3:if(_0x1b0104[_0x5607('0xf2')]>=_0x36187f['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countnoanswerretry':_0x1b0104[_0x5607('0xf2')]+=0x1,'scheduledat':moment()[_0x5607('0xfd')](_0x36187f[_0x5607('0x19f')],_0x5607('0xff'))[_0x5607('0x7a')](_0x5607('0x100')),'ContactId':_0x1b0104['ContactId'],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104[_0x5607('0xd3')]||undefined,'CampaignId':_0x1b0104[_0x5607('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1b0104['countbusyretry']>=_0x36187f[_0x5607('0x1a0')]-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countbusyretry':_0x1b0104[_0x5607('0xf0')]+=0x1,'scheduledat':moment()[_0x5607('0xfd')](_0x36187f[_0x5607('0x1a1')],'minutes')['format'](_0x5607('0x100')),'ContactId':_0x1b0104['ContactId'],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104[_0x5607('0xd3')]||undefined,'CampaignId':_0x1b0104['CampaignId']||undefined})[_0x5607('0xae')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1b0104[_0x5607('0xf1')]>=_0x36187f[_0x5607('0x1a2')]-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countcongestionretry':_0x1b0104[_0x5607('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x36187f[_0x5607('0x1a3')],_0x5607('0xff'))[_0x5607('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b0104[_0x5607('0xd0')],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104['VoiceQueueId']||undefined,'CampaignId':_0x1b0104['CampaignId']||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x1a4')));break;case 0x0:if(_0x1b0104['countnosuchnumberretry']>=_0x36187f[_0x5607('0x1a5')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1b0104[_0x5607('0xf3')]+=0x1,'scheduledat':moment()[_0x5607('0xfd')](_0x36187f[_0x5607('0x1a6')],_0x5607('0xff'))[_0x5607('0x7a')](_0x5607('0x100')),'ContactId':_0x1b0104['ContactId'],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104[_0x5607('0xd3')]||undefined,'CampaignId':_0x1b0104[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x1a7')));}break;case 0xa:if(_0x1b0104['countdropretry']>=_0x36187f[_0x5607('0x11e')]-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countdropretry':_0x1b0104['countdropretry']+=0x1,'scheduledat':moment()[_0x5607('0xfd')](_0x36187f[_0x5607('0x11f')],_0x5607('0xff'))['format'](_0x5607('0x100')),'ContactId':_0x1b0104[_0x5607('0xd0')],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104[_0x5607('0xd3')]||undefined,'CampaignId':_0x1b0104[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x120')));break;case 0xb:if(_0x1b0104['countabandonedretry']>=_0x36187f[_0x5607('0x126')]-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countabandonedretry':_0x1b0104[_0x5607('0xf5')]+=0x1,'scheduledat':moment()[_0x5607('0xfd')](_0x36187f[_0x5607('0x1a8')],'minutes')[_0x5607('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b0104['ContactId'],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104[_0x5607('0xd3')]||undefined,'CampaignId':_0x1b0104[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x127')));break;case 0x13:if(_0x1b0104[_0x5607('0xfc')]>=_0x36187f[_0x5607('0xf9')]-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countmachineretry':_0x1b0104[_0x5607('0xfc')]+=0x1,'scheduledat':moment()['add'](_0x36187f['dialMachineRetryFrequency'],_0x5607('0xff'))[_0x5607('0x7a')](_0x5607('0x100')),'ContactId':_0x1b0104[_0x5607('0xd0')],'ListId':_0x1b0104['ListId'],'VoiceQueueId':_0x1b0104[_0x5607('0xd3')]||undefined,'CampaignId':_0x1b0104['CampaignId']||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x101')));break;case 0x14:if(_0x1b0104[_0x5607('0x107')]>=_0x36187f[_0x5607('0x1a9')]-0x1){return!![];}this[_0x5607('0xbd')]({'active':![],'countagentrejectretry':_0x1b0104['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x36187f[_0x5607('0x1aa')],_0x5607('0xff'))[_0x5607('0x7a')](_0x5607('0x100')),'ContactId':_0x1b0104['ContactId'],'ListId':_0x1b0104[_0x5607('0xd1')],'VoiceQueueId':_0x1b0104['VoiceQueueId']||undefined,'CampaignId':_0x1b0104[_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x1ab')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x1ec68d,_0x580a76,_0x4b98b3){var _0x2494b3=this;var _0x337380=new History(_0x1ec68d);return new BPromise(function(_0x1d46d0,_0x4c4bc9){if(_[_0x5607('0x3c')](_0x580a76)&&typeof _0x580a76!==_0x5607('0x16a')){return _0x4c4bc9(msgResponse(_0x5607('0x1ac'),_0x5607('0x147'),_0x5607('0x1ad')));}if(_[_0x5607('0x3c')](_0x4b98b3)&&typeof _0x4b98b3!==_0x5607('0x16a')){return _0x4c4bc9(msgResponse(_0x5607('0x1ac'),_0x5607('0x147'),_0x5607('0x1ae')));}switch(_0x4b98b3[_0x5607('0x1af')]){case'0':_0x580a76[_0x5607('0x65')]+=0x1;_0x337380[_0x5607('0xa4')]=0x0;_0x337380[_0x5607('0xec')]='NoSuchNumber';_0x337380['countnosuchnumberretry']+=0x1;_0x337380[_0x5607('0x106')]+=0x1;ami[_0x5607('0x4c')](_0x5607('0x1b0'),ut[_0x5607('0xee')](_0x1ec68d,_0x5607('0x1b1')));_0x2494b3[_0x5607('0xc8')](_0x337380)[_0x5607('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2494b3[_0x5607('0x19e')](0x0,_0x1ec68d,_0x580a76)){if(_0x337380[_0x5607('0xf3')]>=_0x580a76[_0x5607('0x1a5')]){_0x2494b3['createStateFinal'](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1b2'));}else{_0x2494b3[_0x5607('0xf7')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1b2'));}}break;case'3':_0x580a76['outboundNoAnswerCallsDay']+=0x1;_0x337380[_0x5607('0xa4')]=0x3;_0x337380[_0x5607('0xec')]=_0x5607('0x1b3');_0x337380[_0x5607('0xf2')]+=0x1;_0x337380[_0x5607('0x106')]+=0x1;ami[_0x5607('0x4c')](_0x5607('0x1b4'),ut['buildObj'](_0x1ec68d,'noanswer'));_0x2494b3['createHistory'](_0x337380)[_0x5607('0xae')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2494b3[_0x5607('0x19e')](0x3,_0x1ec68d,_0x580a76)){if(_0x337380[_0x5607('0xf2')]>=_0x580a76[_0x5607('0x1b5')]){_0x2494b3[_0x5607('0xfa')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1b6'));}else{_0x2494b3[_0x5607('0xf7')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1b6'));}}break;case'5':_0x580a76[_0x5607('0x5f')]+=0x1;_0x337380[_0x5607('0xa4')]=0x5;_0x337380[_0x5607('0xec')]=_0x5607('0x1b7');_0x337380[_0x5607('0xf0')]+=0x1;_0x337380[_0x5607('0x106')]+=0x1;ami[_0x5607('0x4c')](_0x5607('0x1b8'),ut['buildObj'](_0x1ec68d,_0x5607('0x1b9')));_0x2494b3[_0x5607('0xc8')](_0x337380)[_0x5607('0xae')](loggerCatch(_0x5607('0x1ba')));if(_0x2494b3['checkRetriveMax'](0x5,_0x1ec68d,_0x580a76)){if(_0x337380[_0x5607('0xf0')]>=_0x580a76['dialBusyMaxRetry']){_0x2494b3[_0x5607('0xfa')](_0x337380,_0x1d46d0,_0x4c4bc9,'reason\x205\x20busy');}else{_0x2494b3['stateGlobal'](_0x337380,_0x1d46d0,_0x4c4bc9,'reason\x205\x20busy');}}break;case'8':_0x580a76[_0x5607('0x60')]+=0x1;_0x337380[_0x5607('0xa4')]=0x8;_0x337380['statedesc']='Congestion';_0x337380[_0x5607('0xf1')]+=0x1;_0x337380[_0x5607('0x106')]+=0x1;ami[_0x5607('0x4c')](_0x5607('0x1bb'),ut['buildObj'](_0x1ec68d,_0x5607('0x1bc')));_0x2494b3['createHistory'](_0x337380)[_0x5607('0xae')](loggerCatch(_0x5607('0x1bd')));if(_0x2494b3[_0x5607('0x19e')](0x8,_0x1ec68d,_0x580a76)){if(_0x337380[_0x5607('0xf1')]>=_0x580a76[_0x5607('0x1a2')]){_0x2494b3['createStateFinal'](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1be'));}else{_0x2494b3['stateGlobal'](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1be'));}}break;case'11':_0x580a76[_0x5607('0x1bf')]+=0x1;_0x337380['state']=0xb;_0x337380['statedesc']='Abandoned';_0x337380['countabandonedretry']+=0x1;_0x337380['countglobal']+=0x1;_0x2494b3[_0x5607('0xc8')](_0x337380)[_0x5607('0xae')](loggerCatch(_0x5607('0x128')));if(_0x2494b3['checkRetriveMax'](0xb,_0x1ec68d,_0x580a76)){if(_0x337380[_0x5607('0xf5')]>=_0x580a76[_0x5607('0x126')]){_0x2494b3[_0x5607('0xfa')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1c0'));}else{_0x2494b3[_0x5607('0xf7')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1c0'));}}break;case'20':_0x580a76['outboundRejectCallsDay']+=0x1;_0x337380['state']=0x14;_0x337380[_0x5607('0xec')]=_0x5607('0x1c1');_0x337380[_0x5607('0x107')]+=0x1;_0x337380[_0x5607('0x106')]+=0x1;ami[_0x5607('0x4c')](_0x5607('0x1c2'),ut[_0x5607('0xee')](_0x1ec68d,'agentreject'));_0x2494b3[_0x5607('0xc8')](_0x337380)['catch'](loggerCatch(_0x5607('0x1c3')));if(_0x2494b3[_0x5607('0x19e')](0x14,_0x1ec68d,_0x580a76)){if(_0x337380[_0x5607('0x107')]>=_0x580a76[_0x5607('0x1a9')]){_0x2494b3[_0x5607('0xfa')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1c4'));}else{_0x2494b3[_0x5607('0xf7')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x5607('0x1c4'));}}break;default:_0x580a76[_0x5607('0x67')]+=0x1;_0x337380['state']=0xc;_0x337380[_0x5607('0xec')]=_0x4b98b3[_0x5607('0x1af')];_0x2494b3[_0x5607('0xc8')](_0x337380)['catch'](loggerCatch(_0x5607('0x1c5')));if(_0x2494b3[_0x5607('0x19e')](_0x4b98b3['reason'],_0x1ec68d,_0x580a76)){if(_0x337380['countbusyretry']+_0x337380[_0x5607('0xf1')]+_0x337380['countnoanswerretry']+_0x337380['countnosuchnumberretry']+_0x337380[_0x5607('0xf4')]+_0x337380[_0x5607('0xf5')]+_0x337380[_0x5607('0xfc')]+_0x337380[_0x5607('0x107')]>=_0x580a76[_0x5607('0xf6')]){_0x2494b3[_0x5607('0xf7')](_0x337380,_0x1d46d0,_0x4c4bc9,_0x4b98b3[_0x5607('0x1af')]);}else{_0x2494b3['createStateFinal'](_0x337380,_0x1d46d0,_0x4c4bc9,_0x4b98b3[_0x5607('0x1af')]);}}}});};Dialer[_0x5607('0xa7')][_0x5607('0xf7')]=function(_0x42e17c,_0x432cbc,_0x4744f8,_0x41263a){var _0x26190e=new Final(_0x42e17c);_0x26190e[_0x5607('0xa4')]=0xf;_0x26190e[_0x5607('0xec')]=_0x5607('0x1c6');this['createStateFinal'](_0x26190e,_0x432cbc,_0x4744f8,_0x41263a);};Dialer[_0x5607('0xa7')]['createStateFinal']=function(_0x296955,_0x1c0d0c,_0x2e7e1e,_0xe25a02){this['moveContactManagedDialer'](_0x296955)['then'](function(){return _0x1c0d0c(msgResponse(_0x5607('0x1ac'),'Success',_0xe25a02));})[_0x5607('0xae')](function(){return _0x2e7e1e(msgResponse(_0x5607('0x1c7'),_0x5607('0x147'),_0x5607('0x1c8')));});};Dialer[_0x5607('0xa7')]['predictive']=function(_0x2ca29f){var _0x25dac7=_0x2ca29f[_0x5607('0x1c9')]/0x64;var _0x4ccf26=_0x2ca29f[_0x5607('0x63')]/(_0x2ca29f['outboundDropCallsDayTimeout']+_0x2ca29f[_0x5607('0xeb')]);var _0x424784=Math['round'](_0x2ca29f[_0x5607('0x1ca')]*(_0x2ca29f['predictiveIntervalMaxThreshold']/0x64));var _0x2841fa=Math[_0x5607('0x1cb')](_0x2ca29f[_0x5607('0x1ca')]*(_0x2ca29f[_0x5607('0x1cc')]/0x64));var _0xd2034b=_0x2ca29f['available']+_0x2ca29f[_0x5607('0x55')];var _0x2a6512=Math[_0x5607('0x1cd')](_0x2ca29f[_0x5607('0x74')]*_0x2ca29f[_0x5607('0x75')]*_0x2ca29f[_0x5607('0x6f')]*_0x2ca29f[_0x5607('0x70')]);if(_[_0x5607('0x3c')](_0x2ca29f[_0x5607('0x29')])){if(!_[_0x5607('0x3c')](_0x2ca29f[_0x5607('0x28')])){_0x2ca29f[_0x5607('0x28')]=undefined;loggerPredictive[_0x5607('0x94')](_0x5607('0x1ce'),_0x5607('0x1cf'));}if(!_[_0x5607('0x3c')](_0x2ca29f[_0x5607('0x8f')])){loggerPredictive[_0x5607('0x94')](_0x5607('0x1ce'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2ca29f['handlePredictive']);_0x2ca29f[_0x5607('0x8f')]=undefined;}_0x2ca29f[_0x5607('0x29')]=moment()['format'](_0x5607('0x100'));loggerPredictive[_0x5607('0x7f')](_0x2ca29f[_0x5607('0x3f')],_0x5607('0x1d0'),_0x2ca29f[_0x5607('0x29')]);this['handlePower'](_0x2ca29f,0x1);}else if(ifInterval(_0x2ca29f['dialPredictiveInterval'],_0x2ca29f[_0x5607('0x29')])){this[_0x5607('0x15c')](_0x2ca29f,0x1);loggerPredictiveCalls['info'](_0x5607('0x1d1'),_0x2ca29f[_0x5607('0x29')],_0x2ca29f[_0x5607('0x3f')]);_0x2ca29f['erlangCalls']=0x0;_0x2ca29f[_0x5607('0x6e')]=0x0;}else if(_0x25dac7<_0x4ccf26&&_0x2ca29f[_0x5607('0x1d2')]===_0x5607('0x1d3')){freeVariablesPredictive(_0x2ca29f);loggerPredictive[_0x5607('0x7f')](_0x5607('0x1d4'),_0x5607('0x1d5'),_0x4ccf26,_0x5607('0x29'),_0x2ca29f[_0x5607('0x3f')]);}else if(_0x2a6512<_0x2ca29f[_0x5607('0x6e')]&&_0x2ca29f['dialPredictiveOptimization']===_0x5607('0x1d3')){freeVariablesPredictive(_0x2ca29f);loggerPredictive[_0x5607('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5607('0x1d6'),_0x2a6512,_0x5607('0x1d7'),_0x2ca29f[_0x5607('0x6e')],_0x5607('0x29'),_0x2ca29f['name']);}else if(!ifInterval(_0x2ca29f['dialPredictiveInterval'],_0x2ca29f[_0x5607('0x29')])&&_[_0x5607('0x3c')](_0x2ca29f[_0x5607('0x28')])&&!_[_0x5607('0x3c')](_0x2ca29f[_0x5607('0x29')])){_0x2ca29f[_0x5607('0x28')]=moment()[_0x5607('0x7a')](_0x5607('0x100'));loggerPredictive['info'](_0x2ca29f[_0x5607('0x3f')],_0x5607('0x1d8'),_0x2ca29f[_0x5607('0x28')]);this[_0x5607('0xbb')](_0x2ca29f[_0x5607('0x1d9')])[_0x5607('0xb7')](this[_0x5607('0x1da')](_0x2ca29f))[_0x5607('0xb7')](mergeDataErlangB(_0x2ca29f))['then'](this[_0x5607('0x1db')](_0x2ca29f))[_0x5607('0xae')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2ca29f));}else if(!ifInterval(_0x2ca29f[_0x5607('0x1d9')],_0x2ca29f[_0x5607('0x28')])){_0x2ca29f[_0x5607('0x6e')]=0x0;_0x2ca29f['startPredictive']=moment()[_0x5607('0x7a')](_0x5607('0x100'));loggerPredictive[_0x5607('0x7f')](_0x2ca29f['name'],'recalculate\x20predictive\x20at',_0x2ca29f[_0x5607('0x28')]);clearInterval(_0x2ca29f[_0x5607('0x8f')]);_0x2ca29f[_0x5607('0x8f')]=undefined;this[_0x5607('0xbb')](_0x2ca29f[_0x5607('0x1d9')])[_0x5607('0xb7')](this[_0x5607('0x1da')](_0x2ca29f))[_0x5607('0xb7')](mergeDataErlangB(_0x2ca29f))['then'](this[_0x5607('0x1db')](_0x2ca29f))['catch'](loggerCatchPredictive(_0x5607('0x1dc'),_0x2ca29f));}else if(_0x2ca29f['predictiveIntervalAvailable']&&_0xd2034b<_0x2ca29f[_0x5607('0x1ca')]-_0x2841fa){freeVariablesPredictive(_0x2ca29f);loggerPredictive['info'](_0x2ca29f[_0x5607('0x3f')],_0x5607('0x1dd'),_0xd2034b,')\x20are\x20less\x20than\x20threshold\x20(',_0x2ca29f[_0x5607('0x1ca')],'-',_0x2841fa,'=',_0x2ca29f[_0x5607('0x1ca')]-_0x2841fa,')');}else if(_0x2ca29f['predictiveIntervalAvailable']&&_0xd2034b>_0x2ca29f[_0x5607('0x1ca')]+_0x424784){freeVariablesPredictive(_0x2ca29f);loggerPredictive[_0x5607('0x7f')](_0x2ca29f['name'],_0x5607('0x1dd'),_0xd2034b,_0x5607('0x1de'),_0x2ca29f[_0x5607('0x1ca')],'+',_0x424784,'=',_0x2ca29f[_0x5607('0x1ca')]+_0x424784,')');}};Dialer[_0x5607('0xa7')][_0x5607('0x1da')]=function(_0x51b6e7){var _0x511e25=this;return function(_0x279fbc){return new BPromise(function(_0x3fd086,_0x109ee1){_['merge'](_0x51b6e7,_0x279fbc[0x0]);if(checkGetDataPredictive(_0x279fbc[0x0])){var _0x1ea177=_0x51b6e7[_0x5607('0x1ca')]=_0x51b6e7[_0x5607('0x55')]+_0x51b6e7[_0x5607('0x51')];var _0x1fad32=_0x51b6e7[_0x5607('0x1d9')]*0x3c;var _0x1ff0f7=_0x279fbc[0x0]['predictiveIntervalAvgTalktime']+_0x279fbc[0x0][_0x5607('0x69')];var _0x1bfd12=(_0x279fbc[0x0][_0x5607('0x68')]+_0x279fbc[0x0][_0x5607('0x6c')]+_0x279fbc[0x0][_0x5607('0x6b')])/_0x279fbc[0x0][_0x5607('0x72')];_0x51b6e7['predictiveIntervalHitRate']=_0x1bfd12>0x0?_0x1bfd12:0x1;switch(_0x51b6e7[_0x5607('0x1d2')]){case'dropRate':var _0x16f2ce=_0x51b6e7['dialPredictiveOptimizationPercentage']/0x64;return _0x511e25['abandonmentRate'](_0x1ea177,_0x1fad32,_0x1ff0f7,_0x1bfd12,_0x16f2ce)['then'](function(_0x55eb6a){return _0x3fd086(_0x55eb6a);});case _0x5607('0x1df'):var _0x5e79e2=_0x51b6e7[_0x5607('0x1c9')]/0x64;return _0x511e25['busyFactor'](_0x1ea177,_0x1fad32,_0x1ff0f7,_0x1bfd12,_0x5e79e2)[_0x5607('0xb7')](function(_0x5e55dd){return _0x3fd086(_0x5e55dd);});default:return _0x109ee1(msgResponse(_0x5607('0x1e0'),_0x5607('0x147'),_0x5607('0x1e1')));}}else{return _0x109ee1(msgResponse(_0x5607('0x1e0'),_0x5607('0x147'),'check\x20failure'));}});};};Dialer[_0x5607('0xa7')]['getDataPredictiveOld']=function(_0x36095d){var _0x11aa81=this;return function(_0x5820f9){return new BPromise(function(_0x2e897f,_0xcf8a40){_[_0x5607('0xce')](_0x36095d,_0x5820f9[0x0]);if(checkGetDataPredictive(_0x5820f9[0x0])){loggerPredictive[_0x5607('0x7f')](JSON[_0x5607('0x49')](_0x5820f9[0x0]));if(_0x36095d[_0x5607('0x1d2')]==='dropRate'){return _0x11aa81['getVoiceQueueRtPauses'](_0x36095d['id'])[_0x5607('0xb7')](function(_0x38f9ca){var _0x2bf314=_0x36095d[_0x5607('0x52')]-_0x38f9ca[0x0][_0x5607('0x1e2')];var _0x378e89=_0x36095d['dialPredictiveInterval']*0x3c;var _0x1095c6=_0x5820f9[0x0]['predictiveIntervalAvgTalktime']+_0x5820f9[0x0][_0x5607('0x69')];var _0x472210=(_0x5820f9[0x0][_0x5607('0x68')]+_0x5820f9[0x0][_0x5607('0x6c')]+_0x5820f9[0x0][_0x5607('0x6b')])/_0x5820f9[0x0][_0x5607('0x72')];var _0x1b1aaf=_0x36095d[_0x5607('0x1c9')]/0x64;_0x36095d[_0x5607('0x71')]=_0x38f9ca[0x0][_0x5607('0x1e2')]||0x0;_0x36095d[_0x5607('0x6f')]=_0x472210>0x0?_0x472210:0x1;return _0x11aa81[_0x5607('0x1e3')](_0x2bf314,_0x378e89,_0x1095c6,_0x472210,_0x1b1aaf);})['then'](function(_0xcfb449){return _0x2e897f(_0xcfb449);})['catch'](function(_0xb2fa1){return _0xcf8a40(msgResponse(_0x5607('0x1e4'),_0x5607('0x147'),JSON[_0x5607('0x49')](_0xb2fa1)));});}if(_0x36095d[_0x5607('0x1d2')]===_0x5607('0x1df')){return _0x11aa81[_0x5607('0x1e5')](_0x36095d['id'])['then'](function(_0x180458){var _0x416967=_0x36095d[_0x5607('0x52')]-_0x180458[0x0][_0x5607('0x1e2')];var _0x56eaa8=_0x36095d[_0x5607('0x1d9')]*0x3c;var _0xf47396=_0x5820f9[0x0][_0x5607('0x6a')]+_0x5820f9[0x0][_0x5607('0x69')];var _0x5d9b6f=(_0x5820f9[0x0][_0x5607('0x68')]+_0x5820f9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5820f9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5820f9[0x0][_0x5607('0x72')];var _0x1c6bc9=_0x36095d['dialPredictiveOptimizationPercentage']/0x64;_0x36095d[_0x5607('0x71')]=_0x180458[0x0][_0x5607('0x1e2')]||0x0;_0x36095d[_0x5607('0x6f')]=_0x5d9b6f>0x0?_0x5d9b6f:0x1;return _0x11aa81[_0x5607('0x1e6')](_0x416967,_0x56eaa8,_0xf47396,_0x5d9b6f,_0x1c6bc9);})[_0x5607('0xb7')](function(_0x46c693){return _0x2e897f(_0x46c693);})[_0x5607('0xae')](function(_0x22e1ef){return _0xcf8a40(msgResponse(_0x5607('0x1e4'),'Failure',JSON[_0x5607('0x49')](_0x22e1ef)));});}}else{return _0xcf8a40(msgResponse(_0x5607('0x1e0'),_0x5607('0x147'),'check\x20failure'));}});};};Dialer[_0x5607('0xa7')][_0x5607('0x1db')]=function(_0x2e0abb){var _0xaddbcf=this;return function(){var _0x4ad927=0x0;var _0xe0e04f=Math['floor'](_0x2e0abb[_0x5607('0x8b')]*0x3e8);if(_0xe0e04f>0x0){_0xe0e04f=_0xe0e04f<0x64?0x64:_0xe0e04f;loggerPredictive[_0x5607('0x7f')](_0x2e0abb[_0x5607('0x3f')],_0x5607('0x1e7'),_0xe0e04f,_0x5607('0x4a'));_0x2e0abb[_0x5607('0x8f')]=setInterval(function(){_0xaddbcf['handlePredictive'](_0x2e0abb);loggerPredictiveCalls['info'](_0x5607('0x1e8'),_0x4ad927+=0x1);},_0xe0e04f);}else{loggerPredictive['info'](_0x2e0abb[_0x5607('0x3f')],_0x5607('0x1e9'));}};};Dialer[_0x5607('0xa7')][_0x5607('0x1ea')]=function(_0x2af146,_0xa1cf52){var _0x56cc81=this;return function(_0x5b0b82){if(_[_0x5607('0x45')](_0x5b0b82)){if(_[_0x5607('0xdc')](_0xa1cf52[_0x5607('0xd2')])||!_0xa1cf52[_0x5607('0x1eb')]){if(_0x2af146[_0x5607('0x5b')]===_0x5607('0x6')){_0x2af146[_0x5607('0x133')]=_[_0x5607('0x3c')](_0x2af146[_0x5607('0x133')])?!![]:_0x2af146[_0x5607('0x133')];var _0x2eff08=uuid['v4']();_0x56cc81[_0x5607('0x24')][_0x2eff08]=new Action(_0x2af146,_0xa1cf52,_0x2eff08);loggerBooked['info'](_0x5607('0x1ec'),_0x2eff08,_0x5607('0x1ed'),JSON[_0x5607('0x49')](_0x2af146[_0x5607('0x133')]),_0x5607('0x1ee'),_0x2af146[_0x5607('0x3f')]);if(_0x2af146['queueStatusComplete']){_0x2af146[_0x5607('0x133')]=![];_0x56cc81[_0x5607('0x2b')][_0x56cc81[_0x5607('0x24')][_0x2eff08][_0x5607('0xb2')]]=[];ami[_0x5607('0xab')]({'actionid':_0x2eff08,'action':'queuestatus','queue':_0x2af146[_0x5607('0x3f')]})[_0x5607('0xae')](function(){_0x56cc81[_0x5607('0xb0')](_0x2af146);_0x56cc81[_0x5607('0xbd')]({'active':![],'ContactId':_0x56cc81['actions'][_0x2eff08][_0x5607('0xd0')],'ListId':_0x56cc81[_0x5607('0x24')][_0x2eff08]['ListId'],'VoiceQueueId':_0x56cc81[_0x5607('0x24')][_0x2eff08][_0x5607('0xd3')]||undefined,'CampaignId':_0x56cc81[_0x5607('0x24')][_0x2eff08][_0x5607('0xd4')]||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x1ef')));delete _0x56cc81[_0x5607('0x24')][_0x2eff08];});}else{loggerBooked[_0x5607('0x7f')](_0x5607('0x1f0'),JSON[_0x5607('0x49')](_0x2af146[_0x5607('0x133')]),'Queue:\x20',_0x2af146['name']);_0x56cc81[_0x5607('0xb0')](_0x2af146);_0x56cc81[_0x5607('0xbd')]({'active':![],'ContactId':_0x56cc81[_0x5607('0x24')][_0x2eff08][_0x5607('0xd0')],'ListId':_0x56cc81[_0x5607('0x24')][_0x2eff08]['ListId'],'VoiceQueueId':_0x56cc81[_0x5607('0x24')][_0x2eff08][_0x5607('0xd3')]||undefined,'CampaignId':_0x56cc81['actions'][_0x2eff08]['CampaignId']||undefined})[_0x5607('0xae')](loggerCatch(_0x5607('0x1ef')));delete _0x56cc81['actions'][_0x2eff08];}}else{return _0x56cc81[_0x5607('0x1f1')](_0x2af146,_0xa1cf52);}}else{if(getDiff(_0xa1cf52[_0x5607('0x1f2')])<_0x2af146[_0x5607('0x1f3')]*0x3c){if(_0xa1cf52[_0x5607('0x1f4')]&&!_0xa1cf52[_0x5607('0x1f4')][_0x5607('0x1f5')]){_0x56cc81['preview']['run'](_0xa1cf52['id'])[_0x5607('0x1d')](function(){_0x56cc81[_0x5607('0xb0')](_0x2af146);});}else{_0x56cc81[_0x5607('0xbf')]({'active':![]},_0xa1cf52['id'],0x1)[_0x5607('0x1d')](function(){_0x56cc81[_0x5607('0xb0')](_0x2af146);});}}else{_0x2af146[_0x5607('0x66')]+=0x1;_0x56cc81['updateOriginated'](_0x2af146);if(_0x2af146[_0x5607('0x1f6')]){_0x56cc81[_0x5607('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xa1cf52['ContactId'],'ListId':_0xa1cf52[_0x5607('0xd1')],'VoiceQueueId':_0xa1cf52[_0x5607('0xd3')]||undefined,'CampaignId':_0xa1cf52[_0x5607('0xd4')]||undefined})['catch'](loggerCatch(_0x5607('0x1f7')));_0x56cc81[_0x5607('0xc8')](createObjHistory(_0x2af146,_0xa1cf52,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0x5607('0xae')](loggerCatch(_0x5607('0x1f8')));}else{_0x56cc81[_0x5607('0xe7')](createObjHistory(_0x2af146,_0xa1cf52,_0x5607('0x1f9'),0x16,_0x5607('0x1fa')),_0x5607('0x1fb'),_0x5607('0x1fc'));}}}}else{_0x2af146[_0x5607('0x5e')]+=0x1;_0x56cc81[_0x5607('0xe7')](createObjHistory(_0x2af146,_0xa1cf52,'BLACKLIST',0xd,_0x5607('0x1fd')),_0x5607('0x1fe'),_0x5607('0x1ff'));throw _0x5607('0x200');}};};Dialer[_0x5607('0xa7')][_0x5607('0x201')]=function(_0x1b8721){var _0x32aaf3=this;var _0x12ec60=_0x1b8721['limitCalls']-_0x1b8721['originated']-_0x1b8721[_0x5607('0xc2')];emitCampaignSummary(_0x1b8721);if(_0x12ec60>0x0){if(_0x12ec60>this[_0x5607('0x202')]){_0x12ec60=this[_0x5607('0x202')];}_0x1b8721['temp']+=_0x12ec60;this[_0x5607('0xc4')](_0x1b8721['id'],_0x12ec60,_0x1b8721[_0x5607('0x203')],_0x1b8721)[_0x5607('0xb7')](function(_0x12c2a3){_0x1b8721['temp']-=_0x12ec60;_0x1b8721[_0x5607('0xc2')]=_0x1b8721['temp']>0x0?_0x1b8721[_0x5607('0xc2')]:0x0;if(!checkContactEmpty(_0x12c2a3)){_0x1b8721['message']=_0x5607('0x9b');logger['info']('[getContactCampaign2][Empty]'+_0x1b8721[_0x5607('0x3f')]);}else{_0x1b8721[_0x5607('0x73')]+=_0x12c2a3[_0x5607('0x139')];_0x1b8721[_0x5607('0x3d')]=_0x5607('0x204');for(var _0x272803=0x0;_0x272803<_0x12c2a3['length'];_0x272803+=0x1){_0x1b8721[_0x5607('0x205')]+=0x1;if(_[_0x5607('0xdc')](_0x12c2a3[_0x272803])||_[_0x5607('0xdc')](_0x12c2a3[_0x272803]['Contact'])||_[_0x5607('0xdc')](_0x12c2a3[_0x272803][_0x5607('0x16d')][_0x5607('0x16e')])){_0x32aaf3['emptyContact'](_0x5607('0x206'),_0x1b8721,_0x12c2a3[_0x272803]);}else{_0x32aaf3[_0x5607('0xb9')](_[_0x5607('0xcf')](_0x12c2a3[_0x272803],[_0x5607('0xd4'),_0x5607('0x207')]))['then'](_0x32aaf3[_0x5607('0x1ea')](_0x1b8721,_0x12c2a3[_0x272803]))['catch'](_0x32aaf3['loggerHandler'](_0x5607('0x208'),_0x1b8721));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x1b8721,_0x12ec60));}};Dialer[_0x5607('0xa7')][_0x5607('0x15c')]=function(_0x3cb67a,_0x5aec31){var _0x408cea=this;var _0x172455=[];var _0x5ec8b8=_0x5aec31>=0x1?_0x5aec31:0x1;if(_0x3cb67a[_0x5607('0x5b')]===_0x5607('0x6')){_0x5ec8b8=0x1;}var _0x123ede=Math[_0x5607('0x1cd')](_0x3cb67a[_0x5607('0x51')]*_0x5ec8b8)-_0x3cb67a[_0x5607('0x73')]-_0x3cb67a[_0x5607('0xc2')];emitVoiceQueueSummary(_0x3cb67a);if(_0x3cb67a['dialLimitQueue']>0x0){var _0x58a616=_0x3cb67a['dialLimitQueue']-_0x3cb67a['originated']-_0x3cb67a[_0x5607('0x55')]-_0x3cb67a['temp']-_0x3cb67a[_0x5607('0x9d')];if(_0x123ede>_0x58a616){_0x123ede=_0x58a616;}}if(_0x123ede>0x0){if(_0x3cb67a[_0x5607('0x5b')]===_0x5607('0x6')){_0x123ede=0x1;}if(_0x123ede>this['maxNumberOriginate']){_0x123ede=this[_0x5607('0x202')];}_0x3cb67a['temp']+=_0x123ede;for(var _0x3bbeed in this[_0x5607('0x22')]){if(typeof this[_0x5607('0x22')][_0x3bbeed]!=='undefined'){if(this[_0x5607('0x22')][_0x3bbeed][_0x5607('0xa4')]===_0x5607('0x209')&&this['agents'][_0x3bbeed][_0x5607('0xac')]==='reachable'){_0x172455[_0x5607('0x130')](this[_0x5607('0x22')][_0x3bbeed]['id']);}}}this['getContactDialer'](_0x3cb67a['id'],_0x172455,_0x123ede,_0x3cb67a[_0x5607('0x203')],_0x3cb67a)[_0x5607('0xb7')](function(_0x5c166d){_0x3cb67a[_0x5607('0xc2')]-=_0x123ede;_0x3cb67a[_0x5607('0xc2')]=_0x3cb67a[_0x5607('0xc2')]>0x0?_0x3cb67a[_0x5607('0xc2')]:0x0;if(!checkContactEmpty(_0x5c166d)){_0x408cea[_0x5607('0xb3')](_0x3cb67a)[_0x5607('0xb7')](sendMessageReschedule(_0x3cb67a))[_0x5607('0xae')](loggerCatch(_0x5607('0xb5')));}else{_0x3cb67a['originated']+=_0x5c166d[_0x5607('0x139')];_0x3cb67a[_0x5607('0x3d')]=_0x3cb67a['dialMethod']===_0x5607('0x6')?_0x5607('0x20a'):'RUNNING';for(var _0x30afb7=0x0;_0x30afb7<_0x5c166d[_0x5607('0x139')];_0x30afb7+=0x1){if(_[_0x5607('0xdc')](_0x5c166d[_0x30afb7])||_[_0x5607('0xdc')](_0x5c166d[_0x30afb7]['Contact'])||_[_0x5607('0xdc')](_0x5c166d[_0x30afb7][_0x5607('0x16d')][_0x5607('0x16e')])){_0x408cea[_0x5607('0x20b')]('[actionOriginate]\x20',_0x3cb67a,_0x5c166d[_0x30afb7]);}else{_0x408cea[_0x5607('0xb6')](_[_0x5607('0xcf')](_0x5c166d[_0x30afb7],[_0x5607('0xd3'),'Contact.phone']))[_0x5607('0xb7')](_0x408cea[_0x5607('0x1ea')](_0x3cb67a,_0x5c166d[_0x30afb7]))[_0x5607('0xae')](_0x408cea[_0x5607('0xcc')](_0x5607('0x206'),_0x3cb67a));}}}})[_0x5607('0xae')](loggerGetContactDialer('[getContactDialer2]',_0x3cb67a,_0x123ede));}};Dialer[_0x5607('0xa7')][_0x5607('0x8f')]=function(_0x5e8ce8){if(_0x5e8ce8[_0x5607('0x20c')]>0x0){var _0x35f3d8=_0x5e8ce8['dialLimitQueue']-_0x5e8ce8['originated']-_0x5e8ce8[_0x5607('0x55')];if(_0x35f3d8>0x0){this[_0x5607('0x20d')](_0x5e8ce8);}else{loggerPredictiveCalls[_0x5607('0x7f')]('[handlePredictive][limitChannel]');}}else{this[_0x5607('0x20d')](_0x5e8ce8);}};Dialer[_0x5607('0xa7')][_0x5607('0x20d')]=function(_0x32e6f6){var _0xe95d55=this;var _0x1a5c1e=[];_0x32e6f6['originated']+=0x1;for(var _0x49319c in this[_0x5607('0x22')]){if(typeof this['agents'][_0x49319c]!==_0x5607('0x95')){if(this[_0x5607('0x22')][_0x49319c][_0x5607('0xa4')]===_0x5607('0x209')&&this[_0x5607('0x22')][_0x49319c][_0x5607('0xac')]===_0x5607('0xda')){_0x1a5c1e[_0x5607('0x130')](this[_0x5607('0x22')][_0x49319c]['id']);}}}this[_0x5607('0xc1')](_0x32e6f6['id'],_0x1a5c1e,0x1,_0x32e6f6[_0x5607('0x203')],_0x32e6f6)['then'](function(_0x918ad6){if(!checkContactEmpty(_0x918ad6)){checkContactLowerLimitOriginate(_0x32e6f6,0x1,0x0);_0xe95d55[_0x5607('0xb3')](_0x32e6f6)['then'](sendMessageReschedule(_0x32e6f6))[_0x5607('0xae')](loggerCatch(_0x5607('0xb5')));}else{_0x32e6f6['message']=_0x5607('0x204');if(_[_0x5607('0xdc')](_0x918ad6[0x0])||_['isNil'](_0x918ad6[0x0][_0x5607('0x16d')])||_[_0x5607('0xdc')](_0x918ad6[0x0]['Contact'][_0x5607('0x16e')])){_0xe95d55[_0x5607('0x20b')](_0x5607('0x206'),_0x32e6f6,_0x918ad6[0x0]);}else{_0xe95d55['checkIsBlackList'](_[_0x5607('0xcf')](_0x918ad6[0x0],[_0x5607('0xd3'),_0x5607('0x207')]))['then'](_0xe95d55[_0x5607('0x1ea')](_0x32e6f6,_0x918ad6[0x0]))[_0x5607('0xae')](_0xe95d55['loggerHandler'](_0x5607('0x20e'),_0x32e6f6));}}})['catch'](loggerGetContactDialer(_0x5607('0x20f'),_0x32e6f6,0x1));emitVoiceQueueSummary(_0x32e6f6);};Dialer[_0x5607('0xa7')]['abandonmentRate']=function(_0x5db68e,_0x5b47c1,_0x6a012d,_0x1e8bcd,_0x2b266a,_0x5780ca){loggerPredictive[_0x5607('0x7f')](_0x5607('0x210'));loggerPredictive['info'](_0x5607('0x211'),_0x5db68e);loggerPredictive[_0x5607('0x7f')](_0x5607('0x212'),_0x5b47c1);loggerPredictive[_0x5607('0x7f')](_0x5607('0x213'),_0x6a012d);loggerPredictive[_0x5607('0x7f')]('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',_0x1e8bcd);loggerPredictive[_0x5607('0x7f')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b266a);loggerPredictive[_0x5607('0x7f')]('---------------------------');return new BPromise(function(_0x10511c,_0x1d4f5f){if(_0x5db68e<=0x0||isNaN(_0x5db68e)){return _0x1d4f5f(msgResponse('[abandonmentRate]',_0x5607('0x48'),'m\x20=\x20'+_0x5db68e));}if(_0x6a012d<=0x0||isNaN(_0x6a012d)){return _0x1d4f5f(msgResponse(_0x5607('0x214'),_0x5607('0x48'),_0x5607('0x215')+_0x6a012d));}if(_0x1e8bcd<=0x0||isNaN(_0x1e8bcd)){return _0x1d4f5f(msgResponse(_0x5607('0x214'),'Error',_0x5607('0x216')+_0x1e8bcd));}if(_0x5b47c1<=0x0||isNaN(_0x5b47c1)){return _0x1d4f5f(msgResponse(_0x5607('0x214'),_0x5607('0x48'),'interval\x20=\x20'+_0x5b47c1));}if(_0x2b266a<=0x0||isNaN(_0x2b266a)){return _0x1d4f5f(msgResponse('[abandonmentRate]',_0x5607('0x48'),_0x5607('0x217')+_0x2b266a));}_0x5780ca=_0x5780ca||0x0;var _0x522732=0x1/_0x6a012d;var _0x17efd4=0x0;var _0x134f52=0x0;var _0x5f2039=0x0;var _0x555516=0x0;for(var _0x908781=0x0;_0x5f2039<_0x2b266a;_0x908781+=0x1){_0x134f52=_0x908781/_0x5b47c1;_0x17efd4=(_0x1e8bcd*_0x134f52+_0x5780ca)/_0x522732;_0x5f2039=erlangb(_0x17efd4,_0x5db68e);_0x555516=_0x17efd4/_0x5db68e*(0x1-erlangb(_0x17efd4,_0x5db68e));}return _0x10511c({'erlangCalls':_0x908781,'erlangCallToSecond':_0x5b47c1/_0x908781,'erlangAbandonmentRate':_0x5f2039,'erlangBusyFactor':_0x555516});});};Dialer[_0x5607('0xa7')][_0x5607('0x1e6')]=function(_0x3bb2df,_0x1ce90e,_0x1c5707,_0x24e52b,_0x44f772,_0x1ab1aa){loggerPredictive[_0x5607('0x7f')](_0x5607('0x218'));loggerPredictive[_0x5607('0x7f')](_0x5607('0x211'),_0x3bb2df);loggerPredictive[_0x5607('0x7f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ce90e);loggerPredictive[_0x5607('0x7f')](_0x5607('0x213'),_0x1c5707);loggerPredictive['info'](_0x5607('0x219'),_0x24e52b);loggerPredictive['info'](_0x5607('0x21a'),_0x44f772);loggerPredictive[_0x5607('0x7f')](_0x5607('0x8e'));return new BPromise(function(_0x32cea6,_0x3d0874){if(_0x3bb2df<=0x0||isNaN(_0x3bb2df)){return _0x3d0874(msgResponse(_0x5607('0x21b'),'Error',_0x5607('0x21c')+_0x3bb2df));}if(_0x1c5707<=0x0||isNaN(_0x1c5707)){return _0x3d0874(msgResponse('[busyFactor]',_0x5607('0x48'),_0x5607('0x215')+_0x1c5707));}if(_0x24e52b<=0x0||isNaN(_0x24e52b)){return _0x3d0874(msgResponse(_0x5607('0x21b'),_0x5607('0x48'),_0x5607('0x216')+_0x24e52b));}if(_0x1ce90e<=0x0||isNaN(_0x1ce90e)){return _0x3d0874(msgResponse(_0x5607('0x21b'),_0x5607('0x48'),'interval\x20=\x20'+_0x1ce90e));}if(_0x44f772<=0x0||isNaN(_0x44f772)){return _0x3d0874(msgResponse(_0x5607('0x21b'),_0x5607('0x48'),'Umin\x20=\x20'+_0x44f772));}_0x1ab1aa=_0x1ab1aa||0x0;var _0x2843e8=0x1/_0x1c5707;var _0x24ac64=0x0;var _0x1447ba=0x0;var _0x4db984=0x0;var _0x235d84=0x0;for(var _0x55860f=0x0;_0x235d84<_0x44f772;_0x55860f+=0x1){_0x1447ba=_0x55860f/_0x1ce90e;_0x24ac64=(_0x24e52b*_0x1447ba+_0x1ab1aa)/_0x2843e8;_0x4db984=erlangb(_0x24ac64,_0x3bb2df);_0x235d84=_0x24ac64/_0x3bb2df*(0x1-erlangb(_0x24ac64,_0x3bb2df));}return _0x32cea6({'erlangCalls':_0x55860f,'erlangCallToSecond':_0x1ce90e/_0x55860f,'erlangAbandonmentRate':_0x4db984,'erlangBusyFactor':_0x235d84});});};module[_0x5607('0x21d')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index e351d3d..948b350 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 _0x427e=['countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x427e,0x11a));var _0xe427=function(_0x41a21a,_0xf520c9){_0x41a21a=_0x41a21a-0x0;var _0xa0542b=_0x427e[_0x41a21a];return _0xa0542b;};'use strict';var util=require(_0xe427('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x4cadab,_0x2363b0){var _0x554e73=moment(_0x4cadab)[_0xe427('0x1')](0x0);var _0x5ae8ea=moment(_0x2363b0)[_0xe427('0x1')](0x0);return _0x554e73[_0xe427('0x2')](_0x5ae8ea,'seconds');}function QueueCallerAbandon(_0x46be29,_0x3d302d){this[_0xe427('0x3')]=_0x46be29[_0xe427('0x3')];this[_0xe427('0x4')]=_0x46be29[_0xe427('0x4')];this[_0xe427('0x5')]=_0x46be29[_0xe427('0x4')]==='outbound'?'queue':_0x46be29[_0xe427('0x4')];this[_0xe427('0x6')]=_0x46be29[_0xe427('0x6')];this[_0xe427('0x7')]=_0x46be29[_0xe427('0x7')];this[_0xe427('0x8')]=_0x46be29[_0xe427('0x8')];this[_0xe427('0x9')]=_0x46be29['countbusyretry']+_0x46be29['countcongestionretry']+_0x46be29[_0xe427('0x8')]+_0x46be29[_0xe427('0xa')]+_0x46be29['countdropretry']+_0x46be29[_0xe427('0xb')]+_0x46be29[_0xe427('0xc')]+_0x46be29[_0xe427('0xd')];this[_0xe427('0xa')]=_0x46be29[_0xe427('0xa')];this[_0xe427('0xe')]=_0x46be29[_0xe427('0xe')];this[_0xe427('0xb')]=_0x46be29[_0xe427('0xb')];this['countmachineretry']=_0x46be29['countmachineretry'];this[_0xe427('0xd')]=_0x46be29[_0xe427('0xd')];this[_0xe427('0xf')]=_0x3d302d['uniqueid'];this[_0xe427('0x10')]=_0x46be29[_0xe427('0x11')];this[_0xe427('0x12')]=_0x46be29[_0xe427('0x13')];this[_0xe427('0x14')]=_0x46be29['starttime'];this[_0xe427('0x15')]=_0x46be29[_0xe427('0x15')];this[_0xe427('0x16')]=_0x46be29['droptime'];this[_0xe427('0x17')]=this[_0xe427('0x16')];this[_0xe427('0x18')]=getSeconds(_0x46be29[_0xe427('0x15')],_0x46be29['starttime']);this['holdtime']=getSeconds(this[_0xe427('0x16')],_0x46be29[_0xe427('0x15')]);this[_0xe427('0x19')]=0x0;this[_0xe427('0x1a')]=_0x3d302d[_0xe427('0x1a')];this[_0xe427('0x1b')]=_0x3d302d[_0xe427('0x1c')];this[_0xe427('0x1d')]=_0x3d302d[_0xe427('0x1d')];this['callback']=_0x46be29[_0xe427('0x1e')];this[_0xe427('0x1f')]=_0x46be29[_0xe427('0x1f')];this[_0xe427('0x20')]=_0x46be29[_0xe427('0x20')];this[_0xe427('0x21')]=_0x46be29['recallme'];this[_0xe427('0x22')]=_0x46be29[_0xe427('0x22')];this['ListId']=_0x46be29[_0xe427('0x23')];this[_0xe427('0x24')]=_0x46be29[_0xe427('0x24')];this[_0xe427('0x25')]=_0x46be29['VoiceQueueId'];this[_0xe427('0x26')]=_0x46be29[_0xe427('0x26')];this[_0xe427('0x27')]=_0x46be29[_0xe427('0x27')]||'';this[_0xe427('0x28')]=_0x46be29[_0xe427('0x28')]||'';}module[_0xe427('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x0271=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0x0271,0xdb));var _0x1027=function(_0x166caa,_0x3ebf09){_0x166caa=_0x166caa-0x0;var _0x482750=_0x0271[_0x166caa];return _0x482750;};'use strict';var util=require(_0x1027('0x0'));var _=require(_0x1027('0x1'));var moment=require(_0x1027('0x2'));function getSeconds(_0x480c93,_0x1b96a5){var _0x902436=moment(_0x480c93)[_0x1027('0x3')](0x0);var _0x569661=moment(_0x1b96a5)['milliseconds'](0x0);return _0x902436[_0x1027('0x4')](_0x569661,_0x1027('0x5'));}function QueueCallerAbandon(_0x3d97f4,_0x35b633){this['scheduledat']=_0x3d97f4[_0x1027('0x6')];this[_0x1027('0x7')]=_0x3d97f4['type'];this['campaigntype']=_0x3d97f4[_0x1027('0x7')]==='outbound'?_0x1027('0x8'):_0x3d97f4[_0x1027('0x7')];this[_0x1027('0x9')]=_0x3d97f4['countbusyretry'];this[_0x1027('0xa')]=_0x3d97f4[_0x1027('0xa')];this['countnoanswerretry']=_0x3d97f4[_0x1027('0xb')];this[_0x1027('0xc')]=_0x3d97f4['countbusyretry']+_0x3d97f4[_0x1027('0xa')]+_0x3d97f4['countnoanswerretry']+_0x3d97f4[_0x1027('0xd')]+_0x3d97f4[_0x1027('0xe')]+_0x3d97f4[_0x1027('0xf')]+_0x3d97f4[_0x1027('0x10')]+_0x3d97f4[_0x1027('0x11')];this[_0x1027('0xd')]=_0x3d97f4[_0x1027('0xd')];this[_0x1027('0xe')]=_0x3d97f4[_0x1027('0xe')];this[_0x1027('0xf')]=_0x3d97f4[_0x1027('0xf')];this['countmachineretry']=_0x3d97f4[_0x1027('0x10')];this[_0x1027('0x11')]=_0x3d97f4['countagentrejectretry'];this[_0x1027('0x12')]=_0x35b633['uniqueid'];this[_0x1027('0x13')]=_0x3d97f4[_0x1027('0x14')];this[_0x1027('0x15')]=_0x3d97f4[_0x1027('0x16')];this[_0x1027('0x17')]=_0x3d97f4[_0x1027('0x17')];this[_0x1027('0x18')]=_0x3d97f4['responsetime'];this[_0x1027('0x19')]=_0x3d97f4['droptime'];this[_0x1027('0x1a')]=this[_0x1027('0x19')];this[_0x1027('0x1b')]=getSeconds(_0x3d97f4[_0x1027('0x18')],_0x3d97f4[_0x1027('0x17')]);this['holdtime']=getSeconds(this[_0x1027('0x19')],_0x3d97f4['responsetime']);this[_0x1027('0x1c')]=0x0;this[_0x1027('0x8')]=_0x35b633[_0x1027('0x8')];this[_0x1027('0x1d')]=_0x35b633[_0x1027('0x1e')];this[_0x1027('0x1f')]=_0x35b633[_0x1027('0x1f')];this['callback']=_0x3d97f4[_0x1027('0x20')];this['callbackuniqueid']=_0x3d97f4[_0x1027('0x21')];this[_0x1027('0x22')]=_0x3d97f4['callbackat'];this[_0x1027('0x23')]=_0x3d97f4[_0x1027('0x23')];this[_0x1027('0x24')]=_0x3d97f4[_0x1027('0x24')];this[_0x1027('0x25')]=_0x3d97f4[_0x1027('0x25')];this['UserId']=_0x3d97f4[_0x1027('0x26')];this[_0x1027('0x27')]=_0x3d97f4[_0x1027('0x27')];this[_0x1027('0x28')]=_0x3d97f4['CampaignId'];this[_0x1027('0x29')]=_0x3d97f4[_0x1027('0x29')]||'';this[_0x1027('0x2a')]=_0x3d97f4[_0x1027('0x2a')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 3e9208e..fb03c88 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(_0x3f3246,_0x1864db){var _0x1da348=function(_0x49daff){while(--_0x49daff){_0x3f3246['push'](_0x3f3246['shift']());}};_0x1da348(++_0x1864db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x3816ff,_0xd6f969){var _0x5a6b98=function(_0x28e330){while(--_0x28e330){_0x3816ff['push'](_0x3816ff['shift']());}};_0x5a6b98(++_0xd6f969);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index bf9fe26..d75066b 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 _0xe2cf=['hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','channel','name','info','uniqueid','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','stringify','error','\x20receiveFax\x20','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','lodash','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./action','../rpc/faxAccount','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','receivefax','syncReceiveFax'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x4ca88f,_0xbd5b23){_0x4ca88f=_0x4ca88f-0x0;var _0x4bd853=_0xe2cf[_0x4ca88f];return _0x4bd853;};'use strict';var util=require('util');var _=require(_0xfe2c('0x0'));var BPromise=require('bluebird');var uuid=require(_0xfe2c('0x1'));var moment=require('moment');var path=require(_0xfe2c('0x2'));var tiff2pdf=require(_0xfe2c('0x3'));var gs=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('fax');var ami=require(_0xfe2c('0x6'));var rpcDb=require(_0xfe2c('0x7'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xfe2c('0x8'));var faxAccount=require(_0xfe2c('0x9'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x30aafe){this[_0xfe2c('0xa')]={};this[_0xfe2c('0xb')]=_0x30aafe['faxAccounts'];this['trunks']=_0x30aafe[_0xfe2c('0xc')];this[_0xfe2c('0xd')]={};ami['on']('newchannel',this[_0xfe2c('0xe')][_0xfe2c('0xf')](this));ami['on'](_0xfe2c('0x10'),this[_0xfe2c('0x11')][_0xfe2c('0xf')](this));ami['on'](_0xfe2c('0x12'),this[_0xfe2c('0x13')]['bind'](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0xfe2c('0x14'),this['syncFaxStatus']['bind'](this));ami['on'](_0xfe2c('0x15'),this[_0xfe2c('0x16')][_0xfe2c('0xf')](this));ami['on'](_0xfe2c('0x17'),this['syncHangup']['bind'](this));ami['on'](_0xfe2c('0x18'),this[_0xfe2c('0x19')][_0xfe2c('0xf')](this));}Fax[_0xfe2c('0x1a')]['syncNewchannel']=function(_0x199075){if(_0x199075[_0xfe2c('0x1b')]===_0xfe2c('0x1c')){for(var _0x23242b in this[_0xfe2c('0xb')]){if(this[_0xfe2c('0xb')]['hasOwnProperty'](_0x23242b)){if(_0x199075[_0xfe2c('0x1d')]===this[_0xfe2c('0xb')][_0x23242b][_0xfe2c('0x1e')]){this[_0xfe2c('0xa')][_0x199075['uniqueid']]={};this[_0xfe2c('0xa')][_0x199075['uniqueid']]['channel']=_0x199075[_0xfe2c('0x1f')];this[_0xfe2c('0xa')][_0x199075['uniqueid']]['id']=this[_0xfe2c('0xb')][_0x23242b]['id'];this[_0xfe2c('0xa')][_0x199075['uniqueid']][_0xfe2c('0x20')]=this['faxAccounts'][_0x23242b][_0xfe2c('0x20')];logger[_0xfe2c('0x21')](_0x199075[_0xfe2c('0x22')],_0xfe2c('0x23'));}}}}if(this[_0xfe2c('0xd')][_0x199075[_0xfe2c('0x22')]]){this['channels'][_0x199075[_0xfe2c('0x22')]]={};this[_0xfe2c('0xa')][_0x199075[_0xfe2c('0x22')]][_0xfe2c('0x1f')]=_0x199075[_0xfe2c('0x1f')];logger[_0xfe2c('0x21')](_0x199075['uniqueid'],_0xfe2c('0x23'));}};Fax['prototype'][_0xfe2c('0x11')]=function(_0x2fcf5d){if(this[_0xfe2c('0xa')][_0x2fcf5d['uniqueid']]){for(var _0x377cc5 in _0x2fcf5d[_0xfe2c('0x24')]){if(_0x2fcf5d['variable'][_0xfe2c('0x25')](_0x377cc5)){this[_0xfe2c('0xa')][_0x2fcf5d[_0xfe2c('0x22')]][_0x377cc5]=_0x2fcf5d[_0xfe2c('0x26')];}}}};Fax[_0xfe2c('0x1a')][_0xfe2c('0x13')]=function(_0x55aed7){if(this['channels'][_0x55aed7[_0xfe2c('0x22')]]){this[_0xfe2c('0xa')][_0x55aed7[_0xfe2c('0x22')]][_0xfe2c('0x27')]=_0x55aed7[_0xfe2c('0x27')];this['channels'][_0x55aed7[_0xfe2c('0x22')]][_0xfe2c('0x28')]=_0x55aed7[_0xfe2c('0x28')];}};Fax[_0xfe2c('0x1a')][_0xfe2c('0x29')]=function(_0xabc499){if(this[_0xfe2c('0xa')][_0xabc499[_0xfe2c('0x22')]]){for(var _0x2e09fe in _0xabc499[_0xfe2c('0x24')]){if(_0xabc499[_0xfe2c('0x24')][_0xfe2c('0x25')](_0x2e09fe)){this['channels'][_0xabc499[_0xfe2c('0x22')]][_0x2e09fe]=_0xabc499[_0xfe2c('0x26')];}}}};Fax[_0xfe2c('0x1a')]['syncFaxStatus']=function(_0x401c2f){if(this[_0xfe2c('0xa')][_0x401c2f['uniqueid']]){this[_0xfe2c('0xa')][_0x401c2f[_0xfe2c('0x22')]][_0xfe2c('0x2a')]=_0x401c2f['operation'];this[_0xfe2c('0xa')][_0x401c2f[_0xfe2c('0x22')]][_0xfe2c('0x2b')]=_0x401c2f[_0xfe2c('0x2b')];this[_0xfe2c('0xa')][_0x401c2f[_0xfe2c('0x22')]][_0xfe2c('0x1e')]=_0x401c2f['localstationid'];this['channels'][_0x401c2f[_0xfe2c('0x22')]][_0xfe2c('0x2c')]=_0x401c2f[_0xfe2c('0x2c')];logger[_0xfe2c('0x21')](_0x401c2f['uniqueid'],_0xfe2c('0x2d'));}};Fax['prototype'][_0xfe2c('0x16')]=function(_0x31ba48){var _0x5c849c=this;if(this[_0xfe2c('0xa')][_0x31ba48['uniqueid']]){var _0x5d726a=this[_0xfe2c('0xa')][_0x31ba48[_0xfe2c('0x22')]]['id'];this[_0xfe2c('0xa')][_0x31ba48[_0xfe2c('0x22')]][_0xfe2c('0x2e')]=_0x31ba48[_0xfe2c('0x2e')];this[_0xfe2c('0xa')][_0x31ba48[_0xfe2c('0x22')]][_0xfe2c('0x2f')]=_0x31ba48[_0xfe2c('0x2f')];this[_0xfe2c('0xa')][_0x31ba48['uniqueid']][_0xfe2c('0x1e')]=_0x31ba48[_0xfe2c('0x1e')];this[_0xfe2c('0xa')][_0x31ba48['uniqueid']]['resolution']=_0x31ba48['resolution'];this[_0xfe2c('0xa')][_0x31ba48[_0xfe2c('0x22')]][_0xfe2c('0x30')]=_0x31ba48[_0xfe2c('0x30')];this['channels'][_0x31ba48[_0xfe2c('0x22')]][_0xfe2c('0x2c')]=_0x31ba48[_0xfe2c('0x2c')];this[_0xfe2c('0xa')][_0x31ba48[_0xfe2c('0x22')]]['calleridnum']=_0x31ba48[_0xfe2c('0x31')];if(this[_0xfe2c('0xa')][_0x31ba48[_0xfe2c('0x22')]][_0xfe2c('0x2f')]>0x0){tiff2pdf(_0x31ba48['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x3bb8bc){logger[_0xfe2c('0x21')](_0x31ba48['uniqueid'],_0xfe2c('0x32'),_0x3bb8bc[_0xfe2c('0x33')]);attachment[_0xfe2c('0x34')]({'name':path[_0xfe2c('0x35')](_0x31ba48['filename'])[_0xfe2c('0x20')],'basename':path[_0xfe2c('0x35')](_0x31ba48[_0xfe2c('0x2c')])[_0xfe2c('0x20')]+_0xfe2c('0x36'),'type':_0xfe2c('0x37')})[_0xfe2c('0x38')](function(_0x3a4541){faxAccount['notify'](_0x5d726a,{'from':_0x31ba48[_0xfe2c('0x31')],'mapKey':'fax','body':path[_0xfe2c('0x35')](_0x31ba48[_0xfe2c('0x2c')])[_0xfe2c('0x20')]+_0xfe2c('0x36'),'AttachmentId':_0x3a4541['id']})['catch'](function(_0x588e57){logger['error'](_0x31ba48['uniqueid'],'\x20notify\x20',JSON[_0xfe2c('0x39')](_0x588e57));});})['catch'](function(_0x512a2b){logger[_0xfe2c('0x3a')](_0x31ba48['uniqueid'],_0xfe2c('0x3b'),JSON['stringify'](_0x512a2b));});});}logger[_0xfe2c('0x21')](_0x31ba48[_0xfe2c('0x22')],_0xfe2c('0x3b'));}};Fax[_0xfe2c('0x1a')][_0xfe2c('0x19')]=function(_0x57ad76){if(this[_0xfe2c('0xd')][_0x57ad76[_0xfe2c('0x22')]]){_[_0xfe2c('0x3c')](this['channels'][_0x57ad76[_0xfe2c('0x22')]],_[_0xfe2c('0x3d')](_0x57ad76,['response','reason']));}};function updateStatus(_0x5255db){if(_0x5255db[_0xfe2c('0x3e')]){faxMessage[_0xfe2c('0x3f')](_0x5255db[_0xfe2c('0x3e')],{'failMessage':_0xfe2c('0x40')})[_0xfe2c('0x38')](function(_0x583dc5){ut[_0xfe2c('0x41')](_0xfe2c('0x42'),_0x583dc5);})[_0xfe2c('0x43')](function(_0x578060){ut['logger'](_0xfe2c('0x44'),_0x578060);});}else{ut[_0xfe2c('0x41')](_0xfe2c('0x45'));}}Fax[_0xfe2c('0x1a')][_0xfe2c('0x46')]=function(_0x45e013,_0x218d64,_0x37e3de){var _0x39c745=this;var _0x45b285={};if(_0x218d64){_0x45b285={'read':_0x218d64};}else{_0x45b285={'failMessage':_0x37e3de};}if(this['actions'][_0x45e013][_0xfe2c('0x3e')]){faxMessage[_0xfe2c('0x3f')](this[_0xfe2c('0xd')][_0x45e013][_0xfe2c('0x3e')],_0x45b285)[_0xfe2c('0x38')](function(_0x32e987){ut[_0xfe2c('0x41')](_0xfe2c('0x47'),_0x32e987);})[_0xfe2c('0x43')](function(_0xf54c02){ut[_0xfe2c('0x41')]('[Fax][Message][NoUpdate1]',_0xf54c02);})[_0xfe2c('0x48')](function(){delete _0x39c745['channels'][_0x45e013];delete _0x39c745[_0xfe2c('0xd')][_0x45e013];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this['channels'][_0x45e013];delete this[_0xfe2c('0xd')][_0x45e013];}};Fax['prototype'][_0xfe2c('0x49')]=function(_0x5f47cc){var _0x20c81b=this;if(this[_0xfe2c('0xa')][_0x5f47cc[_0xfe2c('0x22')]]){if(this[_0xfe2c('0xd')][_0x5f47cc[_0xfe2c('0x22')]]){this[_0xfe2c('0xa')][_0x5f47cc[_0xfe2c('0x22')]]['id']=this[_0xfe2c('0xd')][_0x5f47cc[_0xfe2c('0x22')]]['id'];this['channels'][_0x5f47cc[_0xfe2c('0x22')]][_0xfe2c('0x20')]=this[_0xfe2c('0xd')][_0x5f47cc[_0xfe2c('0x22')]][_0xfe2c('0x20')];}logger['info'](_0x5f47cc[_0xfe2c('0x22')],this[_0xfe2c('0xd')][_0x5f47cc['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xfe2c('0x4a'),JSON[_0xfe2c('0x39')](this[_0xfe2c('0xa')][_0x5f47cc[_0xfe2c('0x22')]]));if(this[_0xfe2c('0xd')][_0x5f47cc[_0xfe2c('0x22')]]){if(this[_0xfe2c('0xa')][_0x5f47cc['uniqueid']][_0xfe2c('0x4b')]>0x0&&this[_0xfe2c('0xa')][_0x5f47cc[_0xfe2c('0x22')]][_0xfe2c('0x14')]===_0xfe2c('0x4c')){this[_0xfe2c('0x46')](_0x5f47cc[_0xfe2c('0x22')],!![]);}else{this['updateStatus'](_0x5f47cc[_0xfe2c('0x22')],![],this['channels'][_0x5f47cc[_0xfe2c('0x22')]][_0xfe2c('0x4d')]?'SENDING\x20FAILED:\x20'+this[_0xfe2c('0xa')][_0x5f47cc['uniqueid']][_0xfe2c('0x4d')]:_0xfe2c('0x4e'));}}}};Fax['prototype'][_0xfe2c('0x4f')]=function(_0x5b4abf){var _0x14c38d=this;return new BPromise(function(_0x5231ae,_0x23827b){_0x14c38d[_0xfe2c('0x50')](_0x5b4abf,_0x14c38d['faxAccounts'][_0x5b4abf[_0xfe2c('0x51')]])[_0xfe2c('0x38')](function(_0x17b42a){ut[_0xfe2c('0x41')](_0xfe2c('0x52'),_0x17b42a);_0x5231ae(ut['message'](_0xfe2c('0x53')));})[_0xfe2c('0x43')](function(_0x131f2b){ut[_0xfe2c('0x41')]('[Fax][execOriginate][failure]',_0x131f2b);updateStatus(_0x5b4abf);_0x23827b(ut[_0xfe2c('0x33')]('Fax\x20failed'));});});};Fax[_0xfe2c('0x1a')]['checkAfterSend']=function(_0x61ad0f){var _0x3d7f17=this;return new BPromise(function(_0x403fbb,_0x281213){var _0x2733a7=_0x3d7f17[_0xfe2c('0x54')](_0x3d7f17[_0xfe2c('0xb')][_0x61ad0f[_0xfe2c('0x51')]][_0xfe2c('0x55')],_0x61ad0f);if(_0x2733a7[_0xfe2c('0x56')]){_0x403fbb(ut[_0xfe2c('0x33')](_0xfe2c('0x57')));}else{_0x281213(ut[_0xfe2c('0x33')](_0x2733a7[_0xfe2c('0x33')]));}});};function originate(_0x256cd0,_0x17e433,_0x5bfb88){return new BPromise(function(_0x2f48d5,_0x53513a){if(_0x5bfb88){var _0xdafb46=util['format'](_0xfe2c('0x58'),path['parse'](_0x256cd0['path'])[_0xfe2c('0x20')],_0x256cd0[_0xfe2c('0x2')]);gs[_0xfe2c('0x59')](_0xdafb46)[_0xfe2c('0x38')](function(){_0x256cd0[_0xfe2c('0x2')]=util['format'](_0xfe2c('0x5a'),path[_0xfe2c('0x35')](_0x256cd0['path'])[_0xfe2c('0x5b')],path[_0xfe2c('0x35')](_0x256cd0['path'])['name']);_0x17e433['XMF-PATH']=_0x256cd0[_0xfe2c('0x2')];ut[_0xfe2c('0x41')](_0xfe2c('0x5c'),'');ami['Action'](ut['variablesAction'](_0x256cd0,_0x17e433))[_0xfe2c('0x38')](function(_0x20d3dc){_0x2f48d5(_0x20d3dc);})['catch'](function(_0x3508c2){_0x53513a(_0x3508c2);});})[_0xfe2c('0x43')](function(_0x5ac774){_0x53513a(_0x5ac774);});}else{ami[_0xfe2c('0x5d')](ut['variablesAction'](_0x256cd0,_0x17e433))['then'](function(_0x43504d){_0x2f48d5(_0x43504d);})[_0xfe2c('0x43')](function(_0x4a233d){_0x53513a(_0x4a233d);});}});}Fax[_0xfe2c('0x1a')][_0xfe2c('0x50')]=function(_0x4d3b54,_0x1ce63e){var _0x597a37=this;return new BPromise(function(_0x507c80,_0x1f5190){var _0x157ad0=uuid['v4']();var _0x5c6a7d=ut[_0xfe2c('0x5e')](_0x4d3b54,_0x1ce63e);_0x597a37[_0xfe2c('0xd')][_0x157ad0]=new Action(_0x157ad0,_0x1ce63e,_0x4d3b54);var _0x4feb8f=_0x597a37[_0xfe2c('0xd')][_0x157ad0];if(path['parse'](_0x4d3b54[_0xfe2c('0x2')])[_0xfe2c('0x5f')]===_0xfe2c('0x36')){originate(_0x4feb8f,_0x5c6a7d,!![])[_0xfe2c('0x38')](function(_0x57bfe3){_0x507c80(_0x57bfe3);})[_0xfe2c('0x43')](function(_0x85c898){_0x1f5190(_0x85c898);});}else{originate(_0x4feb8f,_0x5c6a7d,![])['then'](function(_0xbf20be){_0x507c80(_0xbf20be);})['catch'](function(_0x373006){_0x1f5190(_0x373006);});}});};Fax['prototype'][_0xfe2c('0x60')]=function(_0x23311a){return!_['isNil'](_0x23311a)&&!_[_0xfe2c('0x61')](_0x23311a[_0xfe2c('0x20')])&&!_[_0xfe2c('0x61')](_0x23311a[_0xfe2c('0x62')])&&_0x23311a[_0xfe2c('0x62')]&&!_[_0xfe2c('0x61')](this['trunks'][util[_0xfe2c('0x63')]('SIP/%s',_0x23311a['name'])])&&!_[_0xfe2c('0x61')](this[_0xfe2c('0xc')][util[_0xfe2c('0x63')](_0xfe2c('0x64'),_0x23311a[_0xfe2c('0x20')])][_0xfe2c('0x2b')])&&(this['trunks'][util[_0xfe2c('0x63')](_0xfe2c('0x64'),_0x23311a[_0xfe2c('0x20')])][_0xfe2c('0x2b')]==='reachable'||this[_0xfe2c('0xc')][util[_0xfe2c('0x63')](_0xfe2c('0x64'),_0x23311a[_0xfe2c('0x20')])]['status']===_0xfe2c('0x65'));};Fax['prototype']['checkTrunk']=function(_0x565504,_0x447feb){if(!this[_0xfe2c('0x60')](_0x565504)){ut[_0xfe2c('0x41')](_0xfe2c('0x66'),_[_0xfe2c('0x61')](_0x565504)?'':_0x565504[_0xfe2c('0x20')]+_0xfe2c('0x67'));return{'isValid':![],'message':_0xfe2c('0x68')};}if(_[_0xfe2c('0x61')](_0x447feb['fax'])){ut['logger'](_0xfe2c('0x69'),JSON[_0xfe2c('0x39')](_0x447feb));return{'isValid':![],'message':_0xfe2c('0x6a')};}if(_[_0xfe2c('0x61')](_0x447feb[_0xfe2c('0x2')])){ut[_0xfe2c('0x41')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xfe2c('0x39')](_0x447feb));return{'isValid':![],'message':_0xfe2c('0x6b')};}return{'isValid':!![],'message':_0xfe2c('0x6c')};};module[_0xfe2c('0x6d')]=Fax; \ No newline at end of file +var _0x1339=['SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','execute','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','exten','channel','uniqueid','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','syncNewState','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring'];(function(_0x58fcc3,_0x25c1ac){var _0x24a512=function(_0x6c9560){while(--_0x6c9560){_0x58fcc3['push'](_0x58fcc3['shift']());}};_0x24a512(++_0x25c1ac);}(_0x1339,0x1ed));var _0x9133=function(_0x4f135a,_0x29e5da){_0x4f135a=_0x4f135a-0x0;var _0x11bb25=_0x1339[_0x4f135a];return _0x11bb25;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x9133('0x0'));var uuid=require(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var path=require(_0x9133('0x3'));var tiff2pdf=require(_0x9133('0x4'));var gs=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var ami=require('../ami');var rpcDb=require(_0x9133('0x8'));var Channel=require(_0x9133('0x9'));var ut=require(_0x9133('0xa'));var Action=require('./action');var faxAccount=require(_0x9133('0xb'));var attachment=require(_0x9133('0xc'));var faxMessage=require(_0x9133('0xd'));function Fax(_0x431a55){this[_0x9133('0xe')]={};this[_0x9133('0xf')]=_0x431a55[_0x9133('0xf')];this[_0x9133('0x10')]=_0x431a55[_0x9133('0x10')];this[_0x9133('0x11')]={};ami['on']('newchannel',this[_0x9133('0x12')][_0x9133('0x13')](this));ami['on'](_0x9133('0x14'),this[_0x9133('0x15')][_0x9133('0x13')](this));ami['on'](_0x9133('0x16'),this['syncNewState'][_0x9133('0x13')](this));ami['on'](_0x9133('0x17'),this['syncNewExten']['bind'](this));ami['on'](_0x9133('0x18'),this['syncFaxStatus'][_0x9133('0x13')](this));ami['on'](_0x9133('0x19'),this[_0x9133('0x1a')][_0x9133('0x13')](this));ami['on'](_0x9133('0x1b'),this[_0x9133('0x1c')]['bind'](this));ami['on'](_0x9133('0x1d'),this[_0x9133('0x1e')]['bind'](this));}Fax[_0x9133('0x1f')][_0x9133('0x12')]=function(_0x3b39ec){if(_0x3b39ec[_0x9133('0x20')]==='from-voip-provider'){for(var _0x1f3484 in this['faxAccounts']){if(this[_0x9133('0xf')]['hasOwnProperty'](_0x1f3484)){if(_0x3b39ec[_0x9133('0x21')]===this[_0x9133('0xf')][_0x1f3484]['localstationid']){this[_0x9133('0xe')][_0x3b39ec['uniqueid']]={};this[_0x9133('0xe')][_0x3b39ec['uniqueid']]['channel']=_0x3b39ec[_0x9133('0x22')];this['channels'][_0x3b39ec[_0x9133('0x23')]]['id']=this['faxAccounts'][_0x1f3484]['id'];this['channels'][_0x3b39ec['uniqueid']][_0x9133('0x24')]=this[_0x9133('0xf')][_0x1f3484]['name'];logger[_0x9133('0x25')](_0x3b39ec[_0x9133('0x23')],_0x9133('0x26'));}}}}if(this[_0x9133('0x11')][_0x3b39ec['uniqueid']]){this[_0x9133('0xe')][_0x3b39ec['uniqueid']]={};this[_0x9133('0xe')][_0x3b39ec[_0x9133('0x23')]][_0x9133('0x22')]=_0x3b39ec[_0x9133('0x22')];logger[_0x9133('0x25')](_0x3b39ec[_0x9133('0x23')],_0x9133('0x26'));}};Fax[_0x9133('0x1f')][_0x9133('0x15')]=function(_0x46050b){if(this['channels'][_0x46050b['uniqueid']]){for(var _0x477bf1 in _0x46050b[_0x9133('0x27')]){if(_0x46050b[_0x9133('0x27')][_0x9133('0x28')](_0x477bf1)){this['channels'][_0x46050b['uniqueid']][_0x477bf1]=_0x46050b[_0x9133('0x29')];}}}};Fax[_0x9133('0x1f')][_0x9133('0x2a')]=function(_0x26d351){if(this[_0x9133('0xe')][_0x26d351[_0x9133('0x23')]]){this['channels'][_0x26d351['uniqueid']]['channelstate']=_0x26d351[_0x9133('0x2b')];this['channels'][_0x26d351[_0x9133('0x23')]][_0x9133('0x2c')]=_0x26d351['channelstatedesc'];}};Fax[_0x9133('0x1f')]['syncNewExten']=function(_0xf0aec4){if(this[_0x9133('0xe')][_0xf0aec4[_0x9133('0x23')]]){for(var _0x5f1de2 in _0xf0aec4[_0x9133('0x27')]){if(_0xf0aec4[_0x9133('0x27')][_0x9133('0x28')](_0x5f1de2)){this['channels'][_0xf0aec4[_0x9133('0x23')]][_0x5f1de2]=_0xf0aec4[_0x9133('0x29')];}}}};Fax[_0x9133('0x1f')]['syncFaxStatus']=function(_0x37667e){if(this[_0x9133('0xe')][_0x37667e[_0x9133('0x23')]]){this[_0x9133('0xe')][_0x37667e['uniqueid']][_0x9133('0x2d')]=_0x37667e[_0x9133('0x2d')];this['channels'][_0x37667e[_0x9133('0x23')]][_0x9133('0x2e')]=_0x37667e[_0x9133('0x2e')];this[_0x9133('0xe')][_0x37667e[_0x9133('0x23')]][_0x9133('0x2f')]=_0x37667e[_0x9133('0x2f')];this[_0x9133('0xe')][_0x37667e[_0x9133('0x23')]][_0x9133('0x30')]=_0x37667e[_0x9133('0x30')];logger['info'](_0x37667e[_0x9133('0x23')],_0x9133('0x31'));}};Fax['prototype'][_0x9133('0x1a')]=function(_0x3a2d1f){var _0x2bc3b3=this;if(this[_0x9133('0xe')][_0x3a2d1f[_0x9133('0x23')]]){var _0x3d24f4=this['channels'][_0x3a2d1f['uniqueid']]['id'];this[_0x9133('0xe')][_0x3a2d1f[_0x9133('0x23')]][_0x9133('0x32')]=_0x3a2d1f[_0x9133('0x32')];this[_0x9133('0xe')][_0x3a2d1f[_0x9133('0x23')]][_0x9133('0x33')]=_0x3a2d1f[_0x9133('0x33')];this[_0x9133('0xe')][_0x3a2d1f['uniqueid']][_0x9133('0x2f')]=_0x3a2d1f[_0x9133('0x2f')];this[_0x9133('0xe')][_0x3a2d1f[_0x9133('0x23')]][_0x9133('0x34')]=_0x3a2d1f['resolution'];this[_0x9133('0xe')][_0x3a2d1f[_0x9133('0x23')]][_0x9133('0x35')]=_0x3a2d1f[_0x9133('0x35')];this['channels'][_0x3a2d1f[_0x9133('0x23')]][_0x9133('0x30')]=_0x3a2d1f[_0x9133('0x30')];this[_0x9133('0xe')][_0x3a2d1f[_0x9133('0x23')]][_0x9133('0x36')]=_0x3a2d1f[_0x9133('0x36')];if(this['channels'][_0x3a2d1f[_0x9133('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x3a2d1f['filename'],_0x9133('0x37'),function(_0x1d564f){logger[_0x9133('0x25')](_0x3a2d1f[_0x9133('0x23')],_0x9133('0x38'),_0x1d564f[_0x9133('0x39')]);attachment[_0x9133('0x3a')]({'name':path[_0x9133('0x3b')](_0x3a2d1f[_0x9133('0x30')])['name'],'basename':path[_0x9133('0x3b')](_0x3a2d1f[_0x9133('0x30')])[_0x9133('0x24')]+'.pdf','type':'application/pdf'})[_0x9133('0x3c')](function(_0x2311aa){faxAccount['notify'](_0x3d24f4,{'from':_0x3a2d1f[_0x9133('0x36')],'mapKey':_0x9133('0x7'),'body':path[_0x9133('0x3b')](_0x3a2d1f[_0x9133('0x30')])[_0x9133('0x24')]+'.pdf','AttachmentId':_0x2311aa['id']})[_0x9133('0x3d')](function(_0x4423b4){logger[_0x9133('0x3e')](_0x3a2d1f['uniqueid'],_0x9133('0x3f'),JSON[_0x9133('0x40')](_0x4423b4));});})['catch'](function(_0x5d31a7){logger[_0x9133('0x3e')](_0x3a2d1f[_0x9133('0x23')],_0x9133('0x41'),JSON[_0x9133('0x40')](_0x5d31a7));});});}logger[_0x9133('0x25')](_0x3a2d1f[_0x9133('0x23')],_0x9133('0x41'));}};Fax[_0x9133('0x1f')][_0x9133('0x1e')]=function(_0xf07fbb){if(this[_0x9133('0x11')][_0xf07fbb[_0x9133('0x23')]]){_['merge'](this['channels'][_0xf07fbb[_0x9133('0x23')]],_['pick'](_0xf07fbb,[_0x9133('0x42'),_0x9133('0x43')]));}};function updateStatus(_0x6fbb11){if(_0x6fbb11[_0x9133('0x44')]){faxMessage['update'](_0x6fbb11[_0x9133('0x44')],{'failMessage':_0x9133('0x45')})[_0x9133('0x3c')](function(_0x5d8db4){ut[_0x9133('0x46')](_0x9133('0x47'),_0x5d8db4);})[_0x9133('0x3d')](function(_0x4ad8c5){ut[_0x9133('0x46')]('[Fax][Message][Error][NoUpdate1]',_0x4ad8c5);});}else{ut[_0x9133('0x46')](_0x9133('0x48'));}}Fax[_0x9133('0x1f')][_0x9133('0x49')]=function(_0x4f58fe,_0x4a346c,_0x2f09f6){var _0x213e3d=this;var _0x20b1fe={};if(_0x4a346c){_0x20b1fe={'read':_0x4a346c};}else{_0x20b1fe={'failMessage':_0x2f09f6};}if(this[_0x9133('0x11')][_0x4f58fe][_0x9133('0x44')]){faxMessage['update'](this['actions'][_0x4f58fe][_0x9133('0x44')],_0x20b1fe)[_0x9133('0x3c')](function(_0x4abefd){ut[_0x9133('0x46')](_0x9133('0x4a'),_0x4abefd);})['catch'](function(_0x508303){ut['logger'](_0x9133('0x4b'),_0x508303);})['finally'](function(){delete _0x213e3d[_0x9133('0xe')][_0x4f58fe];delete _0x213e3d[_0x9133('0x11')][_0x4f58fe];});}else{ut[_0x9133('0x46')](_0x9133('0x4c'));delete this['channels'][_0x4f58fe];delete this[_0x9133('0x11')][_0x4f58fe];}};Fax['prototype'][_0x9133('0x1c')]=function(_0x3d7cf0){var _0x46d348=this;if(this[_0x9133('0xe')][_0x3d7cf0[_0x9133('0x23')]]){if(this[_0x9133('0x11')][_0x3d7cf0['uniqueid']]){this['channels'][_0x3d7cf0['uniqueid']]['id']=this[_0x9133('0x11')][_0x3d7cf0[_0x9133('0x23')]]['id'];this[_0x9133('0xe')][_0x3d7cf0['uniqueid']][_0x9133('0x24')]=this[_0x9133('0x11')][_0x3d7cf0[_0x9133('0x23')]][_0x9133('0x24')];}logger[_0x9133('0x25')](_0x3d7cf0[_0x9133('0x23')],this[_0x9133('0x11')][_0x3d7cf0[_0x9133('0x23')]]?'\x20hangup\x20sendFile\x20':_0x9133('0x4d'),JSON['stringify'](this[_0x9133('0xe')][_0x3d7cf0['uniqueid']]));if(this[_0x9133('0x11')][_0x3d7cf0[_0x9133('0x23')]]){if(this['channels'][_0x3d7cf0['uniqueid']][_0x9133('0x4e')]>0x0&&this[_0x9133('0xe')][_0x3d7cf0[_0x9133('0x23')]][_0x9133('0x18')]===_0x9133('0x4f')){this[_0x9133('0x49')](_0x3d7cf0[_0x9133('0x23')],!![]);}else{this[_0x9133('0x49')](_0x3d7cf0[_0x9133('0x23')],![],this[_0x9133('0xe')][_0x3d7cf0[_0x9133('0x23')]]['faxstatusstring']?_0x9133('0x50')+this['channels'][_0x3d7cf0[_0x9133('0x23')]][_0x9133('0x51')]:_0x9133('0x52'));}}}};Fax[_0x9133('0x1f')][_0x9133('0x53')]=function(_0x52d4c8){var _0x35bc72=this;return new BPromise(function(_0x1f0ca7,_0x19339e){_0x35bc72[_0x9133('0x54')](_0x52d4c8,_0x35bc72['faxAccounts'][_0x52d4c8[_0x9133('0x55')]])[_0x9133('0x3c')](function(_0xcfcae2){ut[_0x9133('0x46')]('[Fax][execOriginate][success]',_0xcfcae2);_0x1f0ca7(ut['message'](_0x9133('0x56')));})[_0x9133('0x3d')](function(_0x23e4d1){ut[_0x9133('0x46')](_0x9133('0x57'),_0x23e4d1);updateStatus(_0x52d4c8);_0x19339e(ut[_0x9133('0x39')]('Fax\x20failed'));});});};Fax[_0x9133('0x1f')][_0x9133('0x58')]=function(_0x2576c8){var _0x22611b=this;return new BPromise(function(_0x57e4e9,_0x47342a){var _0x54ddcd=_0x22611b[_0x9133('0x59')](_0x22611b[_0x9133('0xf')][_0x2576c8[_0x9133('0x55')]][_0x9133('0x5a')],_0x2576c8);if(_0x54ddcd[_0x9133('0x5b')]){_0x57e4e9(ut[_0x9133('0x39')](_0x9133('0x5c')));}else{_0x47342a(ut[_0x9133('0x39')](_0x54ddcd['message']));}});};function originate(_0x23bd83,_0x1fcd01,_0x10afd7){return new BPromise(function(_0x152283,_0x406861){if(_0x10afd7){var _0x4e0afe=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x9133('0x3b')](_0x23bd83[_0x9133('0x3')])[_0x9133('0x24')],_0x23bd83['path']);gs[_0x9133('0x5d')](_0x4e0afe)[_0x9133('0x3c')](function(){_0x23bd83[_0x9133('0x3')]=util[_0x9133('0x5e')](_0x9133('0x5f'),path[_0x9133('0x3b')](_0x23bd83[_0x9133('0x3')])[_0x9133('0x60')],path['parse'](_0x23bd83[_0x9133('0x3')])[_0x9133('0x24')]);_0x1fcd01['XMF-PATH']=_0x23bd83[_0x9133('0x3')];ut['logger'](_0x9133('0x61'),'');ami[_0x9133('0x62')](ut[_0x9133('0x63')](_0x23bd83,_0x1fcd01))[_0x9133('0x3c')](function(_0x353a37){_0x152283(_0x353a37);})['catch'](function(_0x2d6f8e){_0x406861(_0x2d6f8e);});})[_0x9133('0x3d')](function(_0x23b4ac){_0x406861(_0x23b4ac);});}else{ami[_0x9133('0x62')](ut['variablesAction'](_0x23bd83,_0x1fcd01))[_0x9133('0x3c')](function(_0x24c70d){_0x152283(_0x24c70d);})[_0x9133('0x3d')](function(_0x208dd3){_0x406861(_0x208dd3);});}});}Fax[_0x9133('0x1f')][_0x9133('0x54')]=function(_0x1fd7f5,_0x156d20){var _0x650c7d=this;return new BPromise(function(_0x31bda5,_0x37297a){var _0x4c3dc7=uuid['v4']();var _0x408456=ut[_0x9133('0x64')](_0x1fd7f5,_0x156d20);_0x650c7d[_0x9133('0x11')][_0x4c3dc7]=new Action(_0x4c3dc7,_0x156d20,_0x1fd7f5);var _0x12ae5f=_0x650c7d['actions'][_0x4c3dc7];if(path[_0x9133('0x3b')](_0x1fd7f5['path'])[_0x9133('0x65')]===_0x9133('0x66')){originate(_0x12ae5f,_0x408456,!![])[_0x9133('0x3c')](function(_0x530984){_0x31bda5(_0x530984);})[_0x9133('0x3d')](function(_0x163487){_0x37297a(_0x163487);});}else{originate(_0x12ae5f,_0x408456,![])[_0x9133('0x3c')](function(_0x52d940){_0x31bda5(_0x52d940);})[_0x9133('0x3d')](function(_0x3275b3){_0x37297a(_0x3275b3);});}});};Fax['prototype'][_0x9133('0x67')]=function(_0x12094c){return!_[_0x9133('0x68')](_0x12094c)&&!_['isNil'](_0x12094c[_0x9133('0x24')])&&!_['isNil'](_0x12094c[_0x9133('0x69')])&&_0x12094c[_0x9133('0x69')]&&!_[_0x9133('0x68')](this['trunks'][util[_0x9133('0x5e')]('SIP/%s',_0x12094c[_0x9133('0x24')])])&&!_[_0x9133('0x68')](this[_0x9133('0x10')][util[_0x9133('0x5e')](_0x9133('0x6a'),_0x12094c[_0x9133('0x24')])][_0x9133('0x2e')])&&(this[_0x9133('0x10')][util['format'](_0x9133('0x6a'),_0x12094c[_0x9133('0x24')])][_0x9133('0x2e')]===_0x9133('0x6b')||this[_0x9133('0x10')][util['format'](_0x9133('0x6a'),_0x12094c[_0x9133('0x24')])][_0x9133('0x2e')]===_0x9133('0x6c'));};Fax['prototype'][_0x9133('0x59')]=function(_0x580741,_0x29a1d9){if(!this[_0x9133('0x67')](_0x580741)){ut[_0x9133('0x46')](_0x9133('0x6d'),_['isNil'](_0x580741)?'':_0x580741[_0x9133('0x24')]+_0x9133('0x6e'));return{'isValid':![],'message':_0x9133('0x6f')};}if(_[_0x9133('0x68')](_0x29a1d9[_0x9133('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x29a1d9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x9133('0x68')](_0x29a1d9[_0x9133('0x3')])){ut[_0x9133('0x46')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x9133('0x40')](_0x29a1d9));return{'isValid':![],'message':_0x9133('0x70')};}return{'isValid':!![],'message':_0x9133('0x71')};};module[_0x9133('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b672d79..8108722 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 _0x49c1=['util','bluebird','../../../config/logger','preview','lodash','resolve','catch'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x49c1,0x150));var _0x149c=function(_0x4be4d7,_0x46bfaa){_0x4be4d7=_0x4be4d7-0x0;var _0x348430=_0x49c1[_0x4be4d7];return _0x348430;};'use strict';var util=require(_0x149c('0x0'));var BPromise=require(_0x149c('0x1'));var logger=require(_0x149c('0x2'))(_0x149c('0x3'));var _=require(_0x149c('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x59fb56){return function(_0x3e8626){logger['error'](_0x59fb56,util['inspect'](_0x3e8626,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x163e66,_0x1e67de){return BPromise[_0x149c('0x5')]()['then'](faxAccount['notify'](_0x163e66,_0x1e67de))[_0x149c('0x6')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x00e0=['../rpc/faxAccount','error','inspect','notify','then','bluebird','../../../config/logger','preview','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e0,0x11c));var _0x000e=function(_0x14a055,_0x432dfe){_0x14a055=_0x14a055-0x0;var _0x4057d1=_0x00e0[_0x14a055];return _0x4057d1;};'use strict';var util=require('util');var BPromise=require(_0x000e('0x0'));var logger=require(_0x000e('0x1'))(_0x000e('0x2'));var _=require(_0x000e('0x3'));var faxAccount=require(_0x000e('0x4'));function loggerCatch(_0x279b48){return function(_0x57ad08){logger[_0x000e('0x5')](_0x279b48,util[_0x000e('0x6')](_0x57ad08,{'showHidden':![],'depth':null}));};}exports[_0x000e('0x7')]=function(_0x4a72b2,_0x59656b){return BPromise['resolve']()[_0x000e('0x8')](faxAccount[_0x000e('0x7')](_0x4a72b2,_0x59656b))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index f154134..6009d7e 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 _0xc824=['../../../../config/logger','fax','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x299843,_0x14ad7b){var _0xfd0bc4=function(_0xe88f4d){while(--_0xe88f4d){_0x299843['push'](_0x299843['shift']());}};_0xfd0bc4(++_0x14ad7b);}(_0xc824,0x144));var _0x4c82=function(_0x13d2f7,_0x304eb5){_0x13d2f7=_0x13d2f7-0x0;var _0xa76981=_0xc824[_0x13d2f7];return _0xa76981;};'use strict';var util=require('util');var logger=require(_0x4c82('0x0'))(_0x4c82('0x1'));var BPromise=require('bluebird');var exec=require(_0x4c82('0x2'))[_0x4c82('0x3')];exports[_0x4c82('0x4')]=function(_0x333321){return new BPromise(function(_0x3d238d,_0x1d37f8){exec(_0x333321,function(_0x4ff589,_0x2eaa06,_0x5878b0){logger[_0x4c82('0x5')]('Exec\x20gs',_0x2eaa06);if(_0x4ff589){logger[_0x4c82('0x5')](_0x4c82('0x6'),_0x4c82('0x7'),util[_0x4c82('0x8')](_0x4ff589,{'showHidden':![],'depth':null}),_0x2eaa06,_0x5878b0);_0x1d37f8(_0x4ff589);}_0x3d238d(_0x2eaa06);});});}; \ No newline at end of file +var _0x9c97=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','util'];(function(_0x1a83d0,_0x1d4ea8){var _0x3baa13=function(_0xa38472){while(--_0xa38472){_0x1a83d0['push'](_0x1a83d0['shift']());}};_0x3baa13(++_0x1d4ea8);}(_0x9c97,0x155));var _0x79c9=function(_0x4110d0,_0x23ca12){_0x4110d0=_0x4110d0-0x0;var _0x3ac02c=_0x9c97[_0x4110d0];return _0x3ac02c;};'use strict';var util=require(_0x79c9('0x0'));var logger=require('../../../../config/logger')(_0x79c9('0x1'));var BPromise=require(_0x79c9('0x2'));var exec=require(_0x79c9('0x3'))[_0x79c9('0x4')];exports[_0x79c9('0x5')]=function(_0x33cdbf){return new BPromise(function(_0xe2be1e,_0x4789ae){exec(_0x33cdbf,function(_0xd9bc26,_0x37f632,_0x331673){logger[_0x79c9('0x6')](_0x79c9('0x7'),_0x37f632);if(_0xd9bc26){logger[_0x79c9('0x6')](_0x79c9('0x7'),_0x79c9('0x8'),util['inspect'](_0xd9bc26,{'showHidden':![],'depth':null}),_0x37f632,_0x331673);_0x4789ae(_0xd9bc26);}_0xe2be1e(_0x37f632);});});}; \ 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 17ac549..6e8bc77 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 _0xd0de=['ecm','headerinfo','minrate','maxrate','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','uniqueid','util','lodash','message','inspect'];(function(_0x114b00,_0x59fcb8){var _0x3f2e93=function(_0x3af912){while(--_0x3af912){_0x114b00['push'](_0x114b00['shift']());}};_0x3f2e93(++_0x59fcb8);}(_0xd0de,0xd8));var _0xed0d=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xd0de[_0x23e7c1];return _0x1add43;};'use strict';var util=require(_0xed0d('0x0'));var _=require(_0xed0d('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('fax');exports[_0xed0d('0x2')]=function(_0x361877){return{'message':_0x361877};};exports['logger']=function(_0x2724e7,_0x1c652d){logger['info'](_0x2724e7,util[_0xed0d('0x3')](_0x1c652d,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2e2304,_0x16c5a4){var _0x37a9a7={'XMF-ECM':_0x16c5a4[_0xed0d('0x4')],'XMF-HEADERINFO':_0x16c5a4[_0xed0d('0x5')],'XMF-MINRATE':_0x16c5a4[_0xed0d('0x6')],'XMF-MAXRATE':_0x16c5a4[_0xed0d('0x7')],'XMF-MODEM':util['format']('\x22%s\x22',_0x16c5a4['modem']),'XMF-GATEWAY':_0x16c5a4['gateway'],'XMF-FAXDETECT':_0x16c5a4[_0xed0d('0x8')],'XMF-T38TIMEOUT':_0x16c5a4[_0xed0d('0x9')],'XMF-LOCALSTATIONID':_0x16c5a4[_0xed0d('0xa')],'XMF-PATH':_0x2e2304[_0xed0d('0xb')]};return _0x37a9a7;};exports[_0xed0d('0xc')]=function(_0x5be79c,_0x192e8c){return{'actionid':_0x5be79c['uniqueid'],'action':_0xed0d('0xd'),'channel':_0x5be79c[_0xed0d('0xe')],'Exten':_0xed0d('0xf'),'Context':_0xed0d('0x10'),'Priority':'1','callerid':util[_0xed0d('0x11')](_0xed0d('0x12'),_0x5be79c[_0xed0d('0x5')]?_0x5be79c['headerinfo']:'',_0x5be79c[_0xed0d('0xa')]),'variable':_0x192e8c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5be79c[_0xed0d('0x13')]};}; \ No newline at end of file +var _0x803a=['inspect','headerinfo','minrate','format','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','moment','message','logger','info'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x803a,0xf1));var _0xa803=function(_0x30b732,_0x18829d){_0x30b732=_0x30b732-0x0;var _0xe04a83=_0x803a[_0x30b732];return _0xe04a83;};'use strict';var util=require(_0xa803('0x0'));var _=require(_0xa803('0x1'));var moment=require(_0xa803('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xa803('0x3')]=function(_0x55a427){return{'message':_0x55a427};};exports[_0xa803('0x4')]=function(_0x408870,_0x3d88ab){logger[_0xa803('0x5')](_0x408870,util[_0xa803('0x6')](_0x3d88ab,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2cd36b,_0x24691e){var _0x2c51c7={'XMF-ECM':_0x24691e['ecm'],'XMF-HEADERINFO':_0x24691e[_0xa803('0x7')],'XMF-MINRATE':_0x24691e[_0xa803('0x8')],'XMF-MAXRATE':_0x24691e['maxrate'],'XMF-MODEM':util[_0xa803('0x9')]('\x22%s\x22',_0x24691e[_0xa803('0xa')]),'XMF-GATEWAY':_0x24691e[_0xa803('0xb')],'XMF-FAXDETECT':_0x24691e[_0xa803('0xc')],'XMF-T38TIMEOUT':_0x24691e[_0xa803('0xd')],'XMF-LOCALSTATIONID':_0x24691e['localstationid'],'XMF-PATH':_0x2cd36b[_0xa803('0xe')]};return _0x2c51c7;};exports[_0xa803('0xf')]=function(_0x21a4f5,_0x193a38){return{'actionid':_0x21a4f5[_0xa803('0x10')],'action':'originate','channel':_0x21a4f5['channel'],'Exten':_0xa803('0x11'),'Context':'from-sip','Priority':'1','callerid':util[_0xa803('0x9')](_0xa803('0x12'),_0x21a4f5[_0xa803('0x7')]?_0x21a4f5['headerinfo']:'',_0x21a4f5['localstationid']),'variable':_0x193a38,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x21a4f5[_0xa803('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 0e2bb9a..e05cbd8 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 _0x5b86=['./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','ami','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','[index.js][main]','util','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport'];(function(_0x4ceb08,_0x5bd22d){var _0x25cfb0=function(_0x35f7cd){while(--_0x35f7cd){_0x4ceb08['push'](_0x4ceb08['shift']());}};_0x25cfb0(++_0x5bd22d);}(_0x5b86,0xfc));var _0x65b8=function(_0x24feda,_0x27132f){_0x24feda=_0x24feda-0x0;var _0x112fb2=_0x5b86[_0x24feda];return _0x112fb2;};'use strict';var BPromise=require('bluebird');var util=require(_0x65b8('0x0'));var moment=require('moment');var server=require(_0x65b8('0x1'));var Realtime=require(_0x65b8('0x2'));var Report=require('./report');var Acw=require(_0x65b8('0x3'));var Trigger=require(_0x65b8('0x4'));var Dialer=require(_0x65b8('0x5'));var Preview=require(_0x65b8('0x6'));var Fax=require(_0x65b8('0x7'));var user=require(_0x65b8('0x8'));var voiceQueue=require(_0x65b8('0x9'));var voiceQueueReport=require(_0x65b8('0xa'));var voiceCallReport=require(_0x65b8('0xb'));var trunk=require(_0x65b8('0xc'));var trigger=require(_0x65b8('0xd'));var template=require(_0x65b8('0xe'));var cmHopperHistory=require(_0x65b8('0xf'));var campaign=require(_0x65b8('0x10'));var voiceExtension=require(_0x65b8('0x11'));var faxAccount=require(_0x65b8('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x65b8('0x13'));var sugarcrm=require(_0x65b8('0x14'));var freshdesk=require(_0x65b8('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x65b8('0x16'));var vtiger=require(_0x65b8('0x17'));var freshsales=require(_0x65b8('0x18'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x65b8('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x65b8('0x1a')](_0x65b8('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x65b8('0x1a')](_0x65b8('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x65b8('0x1c')]()['then'](user[_0x65b8('0x1d')]())[_0x65b8('0x1e')](realtime[_0x65b8('0x1f')]())['then'](user[_0x65b8('0x20')]())['then'](realtime[_0x65b8('0x21')]())[_0x65b8('0x1e')](trunk[_0x65b8('0x22')]())['then'](realtime[_0x65b8('0x23')]())['then'](voiceQueue[_0x65b8('0x24')]())[_0x65b8('0x1e')](realtime[_0x65b8('0x25')]())[_0x65b8('0x1e')](trigger[_0x65b8('0x26')]())['then'](realtime[_0x65b8('0x27')]())[_0x65b8('0x1e')](template['getTemplates']())[_0x65b8('0x1e')](realtime[_0x65b8('0x28')]())[_0x65b8('0x1e')](zendesk[_0x65b8('0x29')]())[_0x65b8('0x1e')](realtime[_0x65b8('0x2a')]())['then'](salesforce['getSalesforceAccounts']())[_0x65b8('0x1e')](realtime[_0x65b8('0x2b')]())[_0x65b8('0x1e')](sugarcrm[_0x65b8('0x2c')]())['then'](realtime['initSugarcrmAccounts']())[_0x65b8('0x1e')](freshdesk[_0x65b8('0x2d')]())[_0x65b8('0x1e')](realtime[_0x65b8('0x2e')]())[_0x65b8('0x1e')](desk[_0x65b8('0x2f')]())['then'](realtime['initDeskAccounts']())[_0x65b8('0x1e')](zoho[_0x65b8('0x30')]())['then'](realtime[_0x65b8('0x31')]())['then'](vtiger[_0x65b8('0x32')]())['then'](realtime['initVtigerAccounts']())[_0x65b8('0x1e')](freshsales['getFreshsalesAccounts']())[_0x65b8('0x1e')](realtime['initFreshsalesAccounts']())[_0x65b8('0x1e')](servicenow[_0x65b8('0x33')]())[_0x65b8('0x1e')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x65b8('0x34')]())['then'](realtime[_0x65b8('0x35')]())[_0x65b8('0x1e')](campaign[_0x65b8('0x36')]())[_0x65b8('0x1e')](realtime['initCampaigns']())['then'](voiceExtension[_0x65b8('0x37')]())[_0x65b8('0x1e')](realtime[_0x65b8('0x38')]())['then'](faxAccount['getFaxAccounts']())[_0x65b8('0x1e')](realtime['initFaxAccounts']())[_0x65b8('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x65b8('0x1c')]()[_0x65b8('0x1e')](voiceQueueReport[_0x65b8('0x39')]())['then'](realtime[_0x65b8('0x3a')]())[_0x65b8('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x65b8('0x1e')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x65b8('0x3b')]())[_0x65b8('0x1e')](voiceCallReport[_0x65b8('0x3c')]())[_0x65b8('0x1e')](realtime[_0x65b8('0x3d')]())[_0x65b8('0x3e')](function(_0x2b2c74){logger[_0x65b8('0x3f')](_0x65b8('0x40'),util['inspect'](_0x2b2c74,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x26624d){return initRealtime();})[_0x65b8('0x1e')](function(){return initParams();})[_0x65b8('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x321dee){logger['error'](_0x65b8('0x41'),util['inspect'](_0x321dee,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x43c5=['initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts'];(function(_0x3b427e,_0x489841){var _0xe0c0ba=function(_0x4999e5){while(--_0x4999e5){_0x3b427e['push'](_0x3b427e['shift']());}};_0xe0c0ba(++_0x489841);}(_0x43c5,0x13e));var _0x543c=function(_0x4e8146,_0x43af68){_0x4e8146=_0x4e8146-0x0;var _0x1e2dbd=_0x43c5[_0x4e8146];return _0x1e2dbd;};'use strict';var BPromise=require(_0x543c('0x0'));var util=require(_0x543c('0x1'));var moment=require(_0x543c('0x2'));var server=require(_0x543c('0x3'));var Realtime=require(_0x543c('0x4'));var Report=require('./report');var Acw=require(_0x543c('0x5'));var Trigger=require(_0x543c('0x6'));var Dialer=require(_0x543c('0x7'));var Preview=require(_0x543c('0x8'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x543c('0x9'));var voiceQueueReport=require(_0x543c('0xa'));var voiceCallReport=require(_0x543c('0xb'));var trunk=require(_0x543c('0xc'));var trigger=require(_0x543c('0xd'));var template=require(_0x543c('0xe'));var cmHopperHistory=require(_0x543c('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x543c('0x10'));var faxAccount=require(_0x543c('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x543c('0x12'));var sugarcrm=require(_0x543c('0x13'));var freshdesk=require(_0x543c('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x543c('0x15'));var vtiger=require(_0x543c('0x16'));var freshsales=require(_0x543c('0x17'));var servicenow=require(_0x543c('0x18'));var dynamics365=require(_0x543c('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x543c('0x1a'))(_0x543c('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x543c('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x543c('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x543c('0x1d')]()[_0x543c('0x1e')](user[_0x543c('0x1f')]())['then'](realtime[_0x543c('0x20')]())[_0x543c('0x1e')](user[_0x543c('0x21')]())['then'](realtime[_0x543c('0x22')]())[_0x543c('0x1e')](trunk[_0x543c('0x23')]())[_0x543c('0x1e')](realtime[_0x543c('0x24')]())['then'](voiceQueue['getVoiceQueues']())[_0x543c('0x1e')](realtime[_0x543c('0x25')]())[_0x543c('0x1e')](trigger['getTriggers']())[_0x543c('0x1e')](realtime[_0x543c('0x26')]())[_0x543c('0x1e')](template[_0x543c('0x27')]())[_0x543c('0x1e')](realtime[_0x543c('0x28')]())['then'](zendesk[_0x543c('0x29')]())[_0x543c('0x1e')](realtime[_0x543c('0x2a')]())['then'](salesforce[_0x543c('0x2b')]())[_0x543c('0x1e')](realtime[_0x543c('0x2c')]())['then'](sugarcrm[_0x543c('0x2d')]())['then'](realtime[_0x543c('0x2e')]())[_0x543c('0x1e')](freshdesk[_0x543c('0x2f')]())['then'](realtime[_0x543c('0x30')]())['then'](desk['getDeskAccounts']())[_0x543c('0x1e')](realtime[_0x543c('0x31')]())[_0x543c('0x1e')](zoho[_0x543c('0x32')]())[_0x543c('0x1e')](realtime[_0x543c('0x33')]())[_0x543c('0x1e')](vtiger['getVtigerAccounts']())[_0x543c('0x1e')](realtime[_0x543c('0x34')]())['then'](freshsales['getFreshsalesAccounts']())[_0x543c('0x1e')](realtime[_0x543c('0x35')]())[_0x543c('0x1e')](servicenow[_0x543c('0x36')]())[_0x543c('0x1e')](realtime[_0x543c('0x37')]())[_0x543c('0x1e')](dynamics365[_0x543c('0x38')]())['then'](realtime[_0x543c('0x39')]())['then'](campaign[_0x543c('0x3a')]())['then'](realtime[_0x543c('0x3b')]())[_0x543c('0x1e')](voiceExtension[_0x543c('0x3c')]())[_0x543c('0x1e')](realtime[_0x543c('0x3d')]())[_0x543c('0x1e')](faxAccount[_0x543c('0x3e')]())['then'](realtime[_0x543c('0x3f')]())[_0x543c('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x543c('0x1e')](realtime[_0x543c('0x40')]())[_0x543c('0x1e')](cmHopperHistory[_0x543c('0x41')]())['then'](realtime[_0x543c('0x42')]())['then'](cmHopperHistory[_0x543c('0x43')]())[_0x543c('0x1e')](realtime['initCampaignHopperHistory']())[_0x543c('0x1e')](voiceCallReport[_0x543c('0x44')]())[_0x543c('0x1e')](realtime[_0x543c('0x45')]())[_0x543c('0x46')](function(_0x1aa6cd){logger[_0x543c('0x47')](_0x543c('0x48'),util[_0x543c('0x49')](_0x1aa6cd,{'showHidden':![],'depth':null}));});}function main(){return server[_0x543c('0x4a')](realtime,preview,fax)[_0x543c('0x1e')](function(_0x542936){return initRealtime();})[_0x543c('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x543c('0x46')](function(_0x1d32ae){logger['error']('[index.js][main]',util[_0x543c('0x49')](_0x1d32ae,{'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 86118d3..4089b2c 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0xd206ad,_0x1c3175){var _0x19322d=function(_0x53a30c){while(--_0x53a30c){_0xd206ad['push'](_0xd206ad['shift']());}};_0x19322d(++_0x1c3175);}(_0xe706,0xa3));var _0x6e70=function(_0x53b50e,_0xc49361){_0x53b50e=_0x53b50e-0x0;var _0x3f8625=_0xe706[_0x53b50e];return _0x3f8625;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x58a82b,_0x3246fb){var _0x32280a=function(_0x1b4ebf){while(--_0x1b4ebf){_0x58a82b['push'](_0x58a82b['shift']());}};_0x32280a(++_0x3246fb);}(_0x34e8,0x12c));var _0x834e=function(_0xe3437a,_0x3453f7){_0xe3437a=_0xe3437a-0x0;var _0x49d41d=_0x34e8[_0xe3437a];return _0x49d41d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c71e0a4..a934da1 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 _0x2e46=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x5aa7bf,_0x4b1f05){var _0x55b9c0=function(_0x1d885b){while(--_0x1d885b){_0x5aa7bf['push'](_0x5aa7bf['shift']());}};_0x55b9c0(++_0x4b1f05);}(_0x2e46,0x173));var _0x62e4=function(_0x431e95,_0x5e62a2){_0x431e95=_0x431e95-0x0;var _0x664328=_0x2e46[_0x431e95];return _0x664328;};'use strict';function Campaign(_0x4a8732){this['id']=_0x4a8732['id']||0x0;this[_0x62e4('0x0')]=_0x4a8732['name']||'';this[_0x62e4('0x1')]=_0x4a8732[_0x62e4('0x1')]||_0x62e4('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x62e4('0x3')]=0x0;this[_0x62e4('0x4')]=0x0;this['message']='';this[_0x62e4('0x5')]=!![];this[_0x62e4('0x6')]=_0x4a8732['active'];this[_0x62e4('0x7')]=_0x4a8732['limitCalls'];this[_0x62e4('0x8')]=_0x4a8732[_0x62e4('0x8')]||null;this['dialGlobalInterval']=_0x4a8732['dialGlobalInterval']?_0x4a8732[_0x62e4('0x9')]:null;this['dialOriginateCallerIdName']=_0x4a8732[_0x62e4('0xa')];this[_0x62e4('0xb')]=_0x4a8732[_0x62e4('0xb')];this[_0x62e4('0xc')]=_0x4a8732[_0x62e4('0xc')]||0x1e;this[_0x62e4('0xd')]=_0x4a8732['dialCongestionMaxRetry'];this[_0x62e4('0xe')]=_0x4a8732[_0x62e4('0xe')];this[_0x62e4('0xf')]=_0x4a8732[_0x62e4('0xf')];this[_0x62e4('0x10')]=_0x4a8732[_0x62e4('0x10')];this[_0x62e4('0x11')]=_0x4a8732[_0x62e4('0x11')];this[_0x62e4('0x12')]=_0x4a8732[_0x62e4('0x12')];this['dialGlobalMaxRetry']=_0x4a8732['dialGlobalMaxRetry'];this[_0x62e4('0x13')]=_0x4a8732[_0x62e4('0x13')]||0x3;this[_0x62e4('0x14')]=_0x4a8732[_0x62e4('0x14')]||0x96;this[_0x62e4('0x15')]=_0x4a8732[_0x62e4('0x15')]||0x3;this[_0x62e4('0x16')]=_0x4a8732['dialDropRetryFrequency']||0x96;this[_0x62e4('0x17')]=_0x4a8732[_0x62e4('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x4a8732[_0x62e4('0x18')]||0x96;this[_0x62e4('0x19')]=_0x4a8732['dialMachineMaxRetry']||0x3;this[_0x62e4('0x1a')]=_0x4a8732['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x4a8732[_0x62e4('0x1b')]||0x3;this[_0x62e4('0x1c')]=_0x4a8732[_0x62e4('0x1c')]||0x96;this[_0x62e4('0x1d')]=_0x4a8732[_0x62e4('0x1d')]||_0x62e4('0x1e');this['dialPrefix']=_0x4a8732[_0x62e4('0x1f')]||undefined;this[_0x62e4('0x20')]=_0x4a8732[_0x62e4('0x20')]||undefined;this[_0x62e4('0x21')]=_0x4a8732[_0x62e4('0x21')]||undefined;this['TrunkBackup']=_0x4a8732[_0x62e4('0x22')]?_0x4a8732['TrunkBackup']:undefined;this['Trunk']=_0x4a8732['Trunk']?_0x4a8732[_0x62e4('0x23')]:undefined;this[_0x62e4('0x24')]=_0x4a8732[_0x62e4('0x24')]?_0x4a8732[_0x62e4('0x24')]:undefined;this[_0x62e4('0x25')]=_0x4a8732['SquareProject']?_0x4a8732[_0x62e4('0x25')]:undefined;this['dialQueueProject']=_0x4a8732[_0x62e4('0x25')]?_0x4a8732[_0x62e4('0x25')][_0x62e4('0x0')]:undefined;this[_0x62e4('0x26')]=_0x4a8732[_0x62e4('0x26')]||![];this[_0x62e4('0x27')]=_0x4a8732[_0x62e4('0x27')];this[_0x62e4('0x28')]=_0x4a8732['dialAMDGreeting'];this[_0x62e4('0x29')]=_0x4a8732['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x4a8732[_0x62e4('0x2a')];this[_0x62e4('0x2b')]=_0x4a8732['dialAMDMinWordLength'];this[_0x62e4('0x2c')]=_0x4a8732['dialAMDBetweenWordsSilence'];this[_0x62e4('0x2d')]=_0x4a8732[_0x62e4('0x2d')];this[_0x62e4('0x2e')]=_0x4a8732[_0x62e4('0x2e')];this[_0x62e4('0x2f')]=_0x4a8732[_0x62e4('0x2f')];}module[_0x62e4('0x30')]=Campaign; \ No newline at end of file +var _0x389f=['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','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x89b938,_0x24ef2e){var _0x2b5a95=function(_0x4cbe6a){while(--_0x4cbe6a){_0x89b938['push'](_0x89b938['shift']());}};_0x2b5a95(++_0x24ef2e);}(_0x389f,0x145));var _0xf389=function(_0x18fd5a,_0xde4808){_0x18fd5a=_0x18fd5a-0x0;var _0x83c793=_0x389f[_0x18fd5a];return _0x83c793;};'use strict';function Campaign(_0x5f4e7c){this['id']=_0x5f4e7c['id']||0x0;this[_0xf389('0x0')]=_0x5f4e7c[_0xf389('0x0')]||'';this[_0xf389('0x1')]=_0x5f4e7c['type']||_0xf389('0x2');this[_0xf389('0x3')]=0x0;this['temp']=0x0;this[_0xf389('0x4')]=0x0;this[_0xf389('0x5')]=0x0;this[_0xf389('0x6')]='';this[_0xf389('0x7')]=!![];this['active']=_0x5f4e7c['active'];this[_0xf389('0x8')]=_0x5f4e7c[_0xf389('0x8')];this[_0xf389('0x9')]=_0x5f4e7c['dialTimezone']||null;this['dialGlobalInterval']=_0x5f4e7c[_0xf389('0xa')]?_0x5f4e7c['dialGlobalInterval']:null;this[_0xf389('0xb')]=_0x5f4e7c['dialOriginateCallerIdName'];this[_0xf389('0xc')]=_0x5f4e7c[_0xf389('0xc')];this[_0xf389('0xd')]=_0x5f4e7c['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x5f4e7c['dialCongestionMaxRetry'];this[_0xf389('0xe')]=_0x5f4e7c['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x5f4e7c['dialBusyMaxRetry'];this[_0xf389('0xf')]=_0x5f4e7c[_0xf389('0xf')];this[_0xf389('0x10')]=_0x5f4e7c[_0xf389('0x10')];this[_0xf389('0x11')]=_0x5f4e7c[_0xf389('0x11')];this[_0xf389('0x12')]=_0x5f4e7c['dialGlobalMaxRetry'];this[_0xf389('0x13')]=_0x5f4e7c[_0xf389('0x13')]||0x3;this[_0xf389('0x14')]=_0x5f4e7c[_0xf389('0x14')]||0x96;this['dialDropMaxRetry']=_0x5f4e7c[_0xf389('0x15')]||0x3;this[_0xf389('0x16')]=_0x5f4e7c[_0xf389('0x16')]||0x96;this[_0xf389('0x17')]=_0x5f4e7c[_0xf389('0x17')]||0x3;this[_0xf389('0x18')]=_0x5f4e7c[_0xf389('0x18')]||0x96;this['dialMachineMaxRetry']=_0x5f4e7c[_0xf389('0x19')]||0x3;this[_0xf389('0x1a')]=_0x5f4e7c[_0xf389('0x1a')]||0x96;this[_0xf389('0x1b')]=_0x5f4e7c[_0xf389('0x1b')]||0x3;this[_0xf389('0x1c')]=_0x5f4e7c[_0xf389('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x5f4e7c[_0xf389('0x1d')]||_0xf389('0x1e');this['dialPrefix']=_0x5f4e7c[_0xf389('0x1f')]||undefined;this[_0xf389('0x20')]=_0x5f4e7c[_0xf389('0x20')]||undefined;this[_0xf389('0x21')]=_0x5f4e7c['dialCutDigit']||undefined;this['TrunkBackup']=_0x5f4e7c[_0xf389('0x22')]?_0x5f4e7c[_0xf389('0x22')]:undefined;this[_0xf389('0x23')]=_0x5f4e7c[_0xf389('0x23')]?_0x5f4e7c[_0xf389('0x23')]:undefined;this[_0xf389('0x24')]=_0x5f4e7c[_0xf389('0x24')]?_0x5f4e7c['Interval']:undefined;this[_0xf389('0x25')]=_0x5f4e7c[_0xf389('0x25')]?_0x5f4e7c[_0xf389('0x25')]:undefined;this[_0xf389('0x26')]=_0x5f4e7c[_0xf389('0x25')]?_0x5f4e7c[_0xf389('0x25')][_0xf389('0x0')]:undefined;this['dialAMDActive']=_0x5f4e7c[_0xf389('0x27')]||![];this['dialAMDInitialSilence']=_0x5f4e7c[_0xf389('0x28')];this[_0xf389('0x29')]=_0x5f4e7c[_0xf389('0x29')];this[_0xf389('0x2a')]=_0x5f4e7c[_0xf389('0x2a')];this[_0xf389('0x2b')]=_0x5f4e7c[_0xf389('0x2b')];this['dialAMDMinWordLength']=_0x5f4e7c[_0xf389('0x2c')];this[_0xf389('0x2d')]=_0x5f4e7c[_0xf389('0x2d')];this[_0xf389('0x2e')]=_0x5f4e7c['dialAMDMaximumNumberOfWords'];this[_0xf389('0x2f')]=_0x5f4e7c[_0xf389('0x2f')];this[_0xf389('0x30')]=_0x5f4e7c[_0xf389('0x30')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 20928c8..bc86ac5 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 _0xa7db=['type','tag','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa7db,0xbf));var _0xba7d=function(_0x2c4bb3,_0x1e2c8e){_0x2c4bb3=_0x2c4bb3-0x0;var _0x6d826e=_0xa7db[_0x2c4bb3];return _0x6d826e;};'use strict';function Channel(){this[_0xba7d('0x0')]=null;this[_0xba7d('0x1')]='';this[_0xba7d('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xba7d('0x3')]=undefined;this[_0xba7d('0x4')]=0x0;this[_0xba7d('0x5')]='';this[_0xba7d('0x6')]=0x0;this[_0xba7d('0x7')]=0x0;this['exten']=0x0;this[_0xba7d('0x8')]=![];this[_0xba7d('0x9')]=null;this[_0xba7d('0xa')]=null;this[_0xba7d('0xb')]=![];this[_0xba7d('0xc')]=![];this[_0xba7d('0xd')]='';this['lastdata']='';this[_0xba7d('0xe')]=0x0;this[_0xba7d('0xf')]=0x0;this[_0xba7d('0x10')]=0x0;this[_0xba7d('0x11')]=null;this[_0xba7d('0x12')]=null;this['disposition']=null;this[_0xba7d('0x13')]=![];this[_0xba7d('0x14')]=null;this['queue']=null;this[_0xba7d('0x15')]=[];this[_0xba7d('0x16')]=undefined;this[_0xba7d('0x17')]=undefined;this[_0xba7d('0x18')]=undefined;this['mohtime']=0x0;}module[_0xba7d('0x19')]=Channel; \ No newline at end of file +var _0x2032=['mohtime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','holdtime','tag','disposition','monitor','queue','transfercalleridnum','transferType'];(function(_0x43bc1b,_0x598e86){var _0x2805b6=function(_0x5a9e39){while(--_0x5a9e39){_0x43bc1b['push'](_0x43bc1b['shift']());}};_0x2805b6(++_0x598e86);}(_0x2032,0xd9));var _0x2203=function(_0x26d6be,_0x429b5d){_0x26d6be=_0x26d6be-0x0;var _0x594770=_0x2032[_0x26d6be];return _0x594770;};'use strict';function Channel(){this['starttime']=null;this[_0x2203('0x0')]='';this[_0x2203('0x1')]='';this[_0x2203('0x2')]=0x0;this['calleridname']='';this[_0x2203('0x3')]=undefined;this[_0x2203('0x4')]=undefined;this['accountcode']=0x0;this[_0x2203('0x5')]='';this[_0x2203('0x6')]=0x0;this[_0x2203('0x7')]=0x0;this[_0x2203('0x8')]=0x0;this[_0x2203('0x9')]=![];this[_0x2203('0xa')]=null;this[_0x2203('0xb')]=null;this[_0x2203('0xc')]=![];this[_0x2203('0xd')]=![];this[_0x2203('0xe')]='';this[_0x2203('0xf')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x2203('0x10')]=0x0;this['type']=null;this[_0x2203('0x11')]=null;this[_0x2203('0x12')]=null;this[_0x2203('0x13')]=![];this['monitorFilename']=null;this[_0x2203('0x14')]=null;this['monitors']=[];this[_0x2203('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x2203('0x16')]=undefined;this[_0x2203('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 838bc01..96dd0b7 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 _0x990c=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x3a340b,_0x193c05){var _0x4a9592=function(_0x4cc11b){while(--_0x4cc11b){_0x3a340b['push'](_0x3a340b['shift']());}};_0x4a9592(++_0x193c05);}(_0x990c,0x8d));var _0xc990=function(_0x328c49,_0x450cfb){_0x328c49=_0x328c49-0x0;var _0x55c95f=_0x990c[_0x328c49];return _0x55c95f;};'use strict';function DeskAccount(_0x36c47d){this['id']=_0x36c47d['id']||0x0;this[_0xc990('0x0')]=_0x36c47d[_0xc990('0x0')]||'';this[_0xc990('0x1')]=_0x36c47d[_0xc990('0x1')]||'';this[_0xc990('0x2')]=_0x36c47d[_0xc990('0x2')]||'';this[_0xc990('0x3')]=_0x36c47d[_0xc990('0x3')]||'';this[_0xc990('0x4')]=_0x36c47d[_0xc990('0x4')]||'';this['consumerKey']=_0x36c47d[_0xc990('0x5')]||'';this[_0xc990('0x6')]=_0x36c47d['consumerSecret']||'';this[_0xc990('0x7')]=_0x36c47d[_0xc990('0x7')]||'';this[_0xc990('0x8')]=_0x36c47d[_0xc990('0x8')]||'';this[_0xc990('0x9')]=_0x36c47d['type']||'';this[_0xc990('0xa')]=_0x36c47d[_0xc990('0xa')]||'';this[_0xc990('0xb')]=_0x36c47d[_0xc990('0xb')]||{};}module[_0xc990('0xc')]=DeskAccount; \ No newline at end of file +var _0xaf40=['serverUrl','Configurations','exports','name','username','remoteUri','authType','consumerSecret','token','tokenSecret'];(function(_0x57062a,_0x123026){var _0xa178da=function(_0x1702d6){while(--_0x1702d6){_0x57062a['push'](_0x57062a['shift']());}};_0xa178da(++_0x123026);}(_0xaf40,0xe9));var _0x0af4=function(_0x163427,_0x60bb45){_0x163427=_0x163427-0x0;var _0xaa90f3=_0xaf40[_0x163427];return _0xaa90f3;};'use strict';function DeskAccount(_0x38cf52){this['id']=_0x38cf52['id']||0x0;this[_0x0af4('0x0')]=_0x38cf52[_0x0af4('0x0')]||'';this[_0x0af4('0x1')]=_0x38cf52[_0x0af4('0x1')]||'';this[_0x0af4('0x2')]=_0x38cf52['remoteUri']||'';this[_0x0af4('0x3')]=_0x38cf52[_0x0af4('0x3')]||'';this['password']=_0x38cf52['password']||'';this['consumerKey']=_0x38cf52['consumerKey']||'';this[_0x0af4('0x4')]=_0x38cf52[_0x0af4('0x4')]||'';this[_0x0af4('0x5')]=_0x38cf52[_0x0af4('0x5')]||'';this[_0x0af4('0x6')]=_0x38cf52['tokenSecret']||'';this['type']=_0x38cf52['type']||'';this[_0x0af4('0x7')]=_0x38cf52['serverUrl']||'';this['Configurations']=_0x38cf52[_0x0af4('0x8')]||{};}module[_0x0af4('0x9')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index b3e449b..c36dd5e 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 _0xe706=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x166d74,_0x1bf07e){var _0x13a80f=function(_0x282172){while(--_0x282172){_0x166d74['push'](_0x166d74['shift']());}};_0x13a80f(++_0x1bf07e);}(_0xe706,0xa3));var _0x6e70=function(_0x5234a6,_0x314a5d){_0x5234a6=_0x5234a6-0x0;var _0x1f8955=_0xe706[_0x5234a6];return _0x1f8955;};'use strict';function Dynamics365Account(_0x454c8f){this['id']=_0x454c8f['id']||0x0;this[_0x6e70('0x0')]=_0x454c8f[_0x6e70('0x0')]||'';this['username']=_0x454c8f[_0x6e70('0x1')]||'';this[_0x6e70('0x2')]=_0x454c8f[_0x6e70('0x2')]||'';this[_0x6e70('0x3')]=_0x454c8f[_0x6e70('0x3')]||'';this[_0x6e70('0x4')]=_0x454c8f[_0x6e70('0x4')]||'';this[_0x6e70('0x5')]=_0x454c8f[_0x6e70('0x5')]||'';this[_0x6e70('0x6')]=_0x454c8f[_0x6e70('0x6')]||{};this[_0x6e70('0x7')]=_0x454c8f[_0x6e70('0x7')]||'';this[_0x6e70('0x8')]=_0x454c8f[_0x6e70('0x8')]||{};}module[_0x6e70('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x0713=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['name']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')]||'';this[_0x3071('0x2')]=_0x4bf247[_0x3071('0x2')]||'';this['remoteUri']=_0x4bf247[_0x3071('0x3')]||'';this[_0x3071('0x4')]=_0x4bf247[_0x3071('0x4')]||'';this[_0x3071('0x5')]=_0x4bf247[_0x3071('0x5')]||'';this[_0x3071('0x6')]=_0x4bf247[_0x3071('0x6')]||{};this[_0x3071('0x7')]=_0x4bf247[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x4bf247[_0x3071('0x8')]||{};}module[_0x3071('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 7cec257..991a665 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 _0x433a=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm'];(function(_0xc73724,_0x163a90){var _0x3960fa=function(_0x928fd){while(--_0x928fd){_0xc73724['push'](_0xc73724['shift']());}};_0x3960fa(++_0x163a90);}(_0x433a,0x1a6));var _0xa433=function(_0x137264,_0x163896){_0x137264=_0x137264-0x0;var _0x26d615=_0x433a[_0x137264];return _0x26d615;};'use strict';function FaxAccount(_0x1d0430){this['id']=_0x1d0430['id']||0x0;this[_0xa433('0x0')]=_0x1d0430[_0xa433('0x0')]||'';this[_0xa433('0x1')]=_0x1d0430[_0xa433('0x1')];this[_0xa433('0x2')]=_0x1d0430[_0xa433('0x2')];this[_0xa433('0x3')]=_0x1d0430[_0xa433('0x3')];this['localstationid']=_0x1d0430[_0xa433('0x4')];this['minrate']=_0x1d0430[_0xa433('0x5')]||0x960;this[_0xa433('0x6')]=_0x1d0430[_0xa433('0x6')]||0x3840;this[_0xa433('0x7')]=_0x1d0430[_0xa433('0x7')]||_0xa433('0x8');this[_0xa433('0x9')]=_0x1d0430[_0xa433('0x9')]||'no';this[_0xa433('0xa')]=_0x1d0430[_0xa433('0xa')]||'no';this[_0xa433('0xb')]=_0x1d0430[_0xa433('0xb')]||0x1388;this[_0xa433('0xc')]=_0x1d0430[_0xa433('0xc')]||'SIP';this['Trunk']=_0x1d0430[_0xa433('0xd')]?_0x1d0430[_0xa433('0xd')]:undefined;this[_0xa433('0xe')]=_0x1d0430['ListId'];this[_0xa433('0xf')]=_0x1d0430[_0xa433('0xf')];}module[_0xa433('0x10')]=FaxAccount; \ No newline at end of file +var _0x4420=['SIP','Trunk','ListId','key','name','description','ecm','headerinfo','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4420,0x66));var _0x0442=function(_0x587350,_0x2df1fa){_0x587350=_0x587350-0x0;var _0x308b0c=_0x4420[_0x587350];return _0x308b0c;};'use strict';function FaxAccount(_0x15d36f){this['id']=_0x15d36f['id']||0x0;this[_0x0442('0x0')]=_0x15d36f[_0x0442('0x0')]||'';this['description']=_0x15d36f[_0x0442('0x1')];this[_0x0442('0x2')]=_0x15d36f[_0x0442('0x2')];this[_0x0442('0x3')]=_0x15d36f[_0x0442('0x3')];this['localstationid']=_0x15d36f['localstationid'];this['minrate']=_0x15d36f['minrate']||0x960;this['maxrate']=_0x15d36f[_0x0442('0x4')]||0x3840;this['modem']=_0x15d36f[_0x0442('0x5')]||_0x0442('0x6');this['gateway']=_0x15d36f['gateway']||'no';this[_0x0442('0x7')]=_0x15d36f[_0x0442('0x7')]||'no';this[_0x0442('0x8')]=_0x15d36f['t38timeout']||0x1388;this[_0x0442('0x9')]=_0x15d36f[_0x0442('0x9')]||_0x0442('0xa');this[_0x0442('0xb')]=_0x15d36f['Trunk']?_0x15d36f[_0x0442('0xb')]:undefined;this[_0x0442('0xc')]=_0x15d36f[_0x0442('0xc')];this[_0x0442('0xd')]=_0x15d36f[_0x0442('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 0cb1584..b1d8dd4 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 _0x1627=['remoteUri','serverUrl','Configurations','name','username','token'];(function(_0x1c2d9b,_0x1c0596){var _0x5c38f4=function(_0x1a2b37){while(--_0x1a2b37){_0x1c2d9b['push'](_0x1c2d9b['shift']());}};_0x5c38f4(++_0x1c0596);}(_0x1627,0x141));var _0x7162=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0x1627[_0x39157f];return _0x1ae4e2;};'use strict';function FreshdeskAccount(_0x10a0bc){this['id']=_0x10a0bc['id']||0x0;this[_0x7162('0x0')]=_0x10a0bc[_0x7162('0x0')]||'';this[_0x7162('0x1')]=_0x10a0bc[_0x7162('0x1')]||'';this['apiKey']=_0x10a0bc[_0x7162('0x2')]||'';this['remoteUri']=_0x10a0bc[_0x7162('0x3')]||'';this[_0x7162('0x4')]=_0x10a0bc['serverUrl']||'';this[_0x7162('0x5')]=_0x10a0bc[_0x7162('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xf215=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x4885db,_0x135160){var _0x431dc6=function(_0x308803){while(--_0x308803){_0x4885db['push'](_0x4885db['shift']());}};_0x431dc6(++_0x135160);}(_0xf215,0xe4));var _0x5f21=function(_0x51a049,_0x46353b){_0x51a049=_0x51a049-0x0;var _0x4d1063=_0xf215[_0x51a049];return _0x4d1063;};'use strict';function FreshdeskAccount(_0x496242){this['id']=_0x496242['id']||0x0;this[_0x5f21('0x0')]=_0x496242[_0x5f21('0x0')]||'';this[_0x5f21('0x1')]=_0x496242[_0x5f21('0x1')]||'';this[_0x5f21('0x2')]=_0x496242['token']||'';this[_0x5f21('0x3')]=_0x496242[_0x5f21('0x3')]||'';this['serverUrl']=_0x496242[_0x5f21('0x4')]||'';this[_0x5f21('0x5')]=_0x496242['Configurations']||{};}module[_0x5f21('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 17769ec..4236c79 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 _0x7c09=['name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x1b05ab,_0x5af0b7){var _0x1a6748=function(_0x2a7b7d){while(--_0x2a7b7d){_0x1b05ab['push'](_0x1b05ab['shift']());}};_0x1a6748(++_0x5af0b7);}(_0x7c09,0x102));var _0x97c0=function(_0x40d413,_0x2ef107){_0x40d413=_0x40d413-0x0;var _0x2fa518=_0x7c09[_0x40d413];return _0x2fa518;};'use strict';function FreshsalesAccount(_0x579a22){this['id']=_0x579a22['id']||0x0;this[_0x97c0('0x0')]=_0x579a22[_0x97c0('0x0')]||'';this['username']=_0x579a22[_0x97c0('0x1')]||'';this[_0x97c0('0x2')]=_0x579a22[_0x97c0('0x3')]||'';this[_0x97c0('0x4')]=_0x579a22[_0x97c0('0x4')]||'';this[_0x97c0('0x5')]=_0x579a22[_0x97c0('0x5')]||'';this['Configurations']=_0x579a22['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x1939=['remoteUri','serverUrl','Configurations','name','username','token'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x1939,0x1d1));var _0x9193=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1939[_0x5a79e2];return _0x266c45;};'use strict';function FreshsalesAccount(_0x7b21d4){this['id']=_0x7b21d4['id']||0x0;this['name']=_0x7b21d4[_0x9193('0x0')]||'';this[_0x9193('0x1')]=_0x7b21d4[_0x9193('0x1')]||'';this['apiKey']=_0x7b21d4[_0x9193('0x2')]||'';this[_0x9193('0x3')]=_0x7b21d4[_0x9193('0x3')]||'';this[_0x9193('0x4')]=_0x7b21d4['serverUrl']||'';this[_0x9193('0x5')]=_0x7b21d4[_0x9193('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index f61626b..d425b12 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 _0x7e43=['calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','inbound','uniqueid'];(function(_0x2eeacb,_0x1f43ec){var _0x409181=function(_0x231cc6){while(--_0x231cc6){_0x2eeacb['push'](_0x2eeacb['shift']());}};_0x409181(++_0x1f43ec);}(_0x7e43,0xac));var _0x37e4=function(_0x3e016e,_0x190be8){_0x3e016e=_0x3e016e-0x0;var _0xef10ea=_0x7e43[_0x3e016e];return _0xef10ea;};'use strict';function QueueReport(){this[_0x37e4('0x0')]=_0x37e4('0x1');this[_0x37e4('0x2')]='';this[_0x37e4('0x3')]='';this['calleridname']='';this['queue']='';this[_0x37e4('0x4')]=null;this[_0x37e4('0x5')]=null;this[_0x37e4('0x6')]=0x1;this[_0x37e4('0x7')]=0x1;this[_0x37e4('0x8')]=![];this[_0x37e4('0x9')]=null;this['queuecallercomplete']=![];this[_0x37e4('0xa')]=null;this[_0x37e4('0xb')]=![];this[_0x37e4('0xc')]=null;this[_0x37e4('0xd')]=0x1;this[_0x37e4('0xe')]='';this[_0x37e4('0xf')]='';this[_0x37e4('0x10')]='';this[_0x37e4('0x11')]='';this[_0x37e4('0x12')]='';this['exten']='';this[_0x37e4('0x13')]='';this[_0x37e4('0x14')]=0x0;this[_0x37e4('0x15')]=![];this[_0x37e4('0x16')]='';this['motionChannel']='voice';this['mohtime']=0x0;this[_0x37e4('0x17')]={};}module[_0x37e4('0x18')]=QueueReport; \ No newline at end of file +var _0x84a4=['motionChannel','mohtime','variables','exports','type','inbound','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','holdtime','lastAssignedTo'];(function(_0x5b1678,_0x1c9cae){var _0x228b01=function(_0x2cc38e){while(--_0x2cc38e){_0x5b1678['push'](_0x5b1678['shift']());}};_0x228b01(++_0x1c9cae);}(_0x84a4,0x6c));var _0x484a=function(_0x518959,_0x39f956){_0x518959=_0x518959-0x0;var _0x52f663=_0x84a4[_0x518959];return _0x52f663;};'use strict';function QueueReport(){this[_0x484a('0x0')]=_0x484a('0x1');this['uniqueid']='';this[_0x484a('0x2')]='';this['calleridname']='';this[_0x484a('0x3')]='';this[_0x484a('0x4')]=null;this[_0x484a('0x5')]=null;this[_0x484a('0x6')]=0x1;this[_0x484a('0x7')]=0x1;this[_0x484a('0x8')]=![];this[_0x484a('0x9')]=null;this[_0x484a('0xa')]=![];this[_0x484a('0xb')]=null;this[_0x484a('0xc')]=![];this[_0x484a('0xd')]=null;this[_0x484a('0xe')]=0x1;this[_0x484a('0xf')]='';this['connectedlinenum']='';this[_0x484a('0x10')]='';this['accountcode']='';this[_0x484a('0x11')]='';this[_0x484a('0x12')]='';this[_0x484a('0x13')]='';this[_0x484a('0x14')]=0x0;this['assigned']=![];this[_0x484a('0x15')]='';this[_0x484a('0x16')]='voice';this[_0x484a('0x17')]=0x0;this[_0x484a('0x18')]={};}module[_0x484a('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8f87296..be408fd 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 _0x8163=['username','remoteUri','clientId','clientSecret','securityToken','serverUrl','Configurations','exports','name'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x8163,0x13a));var _0x3816=function(_0x150bb0,_0x581567){_0x150bb0=_0x150bb0-0x0;var _0x1375ee=_0x8163[_0x150bb0];return _0x1375ee;};'use strict';function SalesforceAccount(_0x4a17d1){this['id']=_0x4a17d1['id']||0x0;this[_0x3816('0x0')]=_0x4a17d1[_0x3816('0x0')]||'';this[_0x3816('0x1')]=_0x4a17d1[_0x3816('0x1')]||'';this[_0x3816('0x2')]=_0x4a17d1[_0x3816('0x2')]||'';this['password']=_0x4a17d1['password']||'';this['clientId']=_0x4a17d1[_0x3816('0x3')]||'';this['clientSecret']=_0x4a17d1[_0x3816('0x4')]||'';this[_0x3816('0x5')]=_0x4a17d1[_0x3816('0x5')]||'';this['type']=_0x4a17d1['type']||'integrationTab';this[_0x3816('0x6')]=_0x4a17d1['serverUrl']||'';this[_0x3816('0x7')]=_0x4a17d1[_0x3816('0x7')]||{};}module[_0x3816('0x8')]=SalesforceAccount; \ No newline at end of file +var _0x0fe0=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','Configurations'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0x0fe0,0x6f));var _0x00fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0fe0[_0x20a584];return _0x4b41a8;};'use strict';function SalesforceAccount(_0x253501){this['id']=_0x253501['id']||0x0;this[_0x00fe('0x0')]=_0x253501[_0x00fe('0x0')]||'';this[_0x00fe('0x1')]=_0x253501[_0x00fe('0x1')]||'';this[_0x00fe('0x2')]=_0x253501[_0x00fe('0x2')]||'';this[_0x00fe('0x3')]=_0x253501[_0x00fe('0x3')]||'';this[_0x00fe('0x4')]=_0x253501[_0x00fe('0x4')]||'';this[_0x00fe('0x5')]=_0x253501[_0x00fe('0x5')]||'';this[_0x00fe('0x6')]=_0x253501[_0x00fe('0x6')]||'';this[_0x00fe('0x7')]=_0x253501['type']||'integrationTab';this['serverUrl']=_0x253501['serverUrl']||'';this[_0x00fe('0x8')]=_0x253501[_0x00fe('0x8')]||{};}module[_0x00fe('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index c6086f8..32b6a6f 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 _0x0a03=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x50174d,_0x4e3bcc){var _0x50f68a=function(_0x5ae92a){while(--_0x5ae92a){_0x50174d['push'](_0x50174d['shift']());}};_0x50f68a(++_0x4e3bcc);}(_0x0a03,0xfe));var _0x30a0=function(_0x5d4b76,_0x2b63f1){_0x5d4b76=_0x5d4b76-0x0;var _0x55d73c=_0x0a03[_0x5d4b76];return _0x55d73c;};'use strict';function ServicenowAccount(_0x538402){this['id']=_0x538402['id']||0x0;this[_0x30a0('0x0')]=_0x538402[_0x30a0('0x0')]||'';this[_0x30a0('0x1')]=_0x538402[_0x30a0('0x1')]||'';this[_0x30a0('0x2')]=_0x538402[_0x30a0('0x2')]||'';this[_0x30a0('0x3')]=_0x538402[_0x30a0('0x3')]||'';this[_0x30a0('0x4')]=_0x538402[_0x30a0('0x4')]||'';this[_0x30a0('0x5')]=_0x538402[_0x30a0('0x5')]||{};}module[_0x30a0('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x0798=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x260326,_0x3514d2){var _0x10aab9=function(_0x441400){while(--_0x441400){_0x260326['push'](_0x260326['shift']());}};_0x10aab9(++_0x3514d2);}(_0x0798,0xbb));var _0x8079=function(_0x435720,_0x29af7e){_0x435720=_0x435720-0x0;var _0x4eedbf=_0x0798[_0x435720];return _0x4eedbf;};'use strict';function ServicenowAccount(_0x39d424){this['id']=_0x39d424['id']||0x0;this['name']=_0x39d424[_0x8079('0x0')]||'';this[_0x8079('0x1')]=_0x39d424[_0x8079('0x1')]||'';this[_0x8079('0x2')]=_0x39d424['password']||'';this[_0x8079('0x3')]=_0x39d424[_0x8079('0x3')]||'';this[_0x8079('0x4')]=_0x39d424['serverUrl']||'';this[_0x8079('0x5')]=_0x39d424[_0x8079('0x5')]||{};}module[_0x8079('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 ede8dd1..8e5d198 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 _0x1aef=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1aef,0x10d));var _0xf1ae=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1aef[_0x19e35c];return _0x3e1fe8;};'use strict';function SugarcrmAccount(_0x3050d9){this['id']=_0x3050d9['id']||0x0;this[_0xf1ae('0x0')]=_0x3050d9['name']||'';this[_0xf1ae('0x1')]=_0x3050d9[_0xf1ae('0x1')]||'';this['password']=_0x3050d9[_0xf1ae('0x2')]||'';this['remoteUri']=_0x3050d9[_0xf1ae('0x3')]||'';this[_0xf1ae('0x4')]=_0x3050d9['serverUrl']||'';this[_0xf1ae('0x5')]=_0x3050d9[_0xf1ae('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xc5b1=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0xc5b1,0x77));var _0x1c5b=function(_0x3d0169,_0x2772ad){_0x3d0169=_0x3d0169-0x0;var _0x5c597e=_0xc5b1[_0x3d0169];return _0x5c597e;};'use strict';function SugarcrmAccount(_0x3abb82){this['id']=_0x3abb82['id']||0x0;this[_0x1c5b('0x0')]=_0x3abb82[_0x1c5b('0x0')]||'';this[_0x1c5b('0x1')]=_0x3abb82[_0x1c5b('0x1')]||'';this[_0x1c5b('0x2')]=_0x3abb82[_0x1c5b('0x2')]||'';this[_0x1c5b('0x3')]=_0x3abb82[_0x1c5b('0x3')]||'';this['serverUrl']=_0x3abb82[_0x1c5b('0x4')]||'';this['Configurations']=_0x3abb82[_0x1c5b('0x5')]||{};}module[_0x1c5b('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f2e7cc7..0a1e8c4 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 _0x35d4=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35d4,0x1e7));var _0x435d=function(_0x2cb520,_0x127692){_0x2cb520=_0x2cb520-0x0;var _0x1fa071=_0x35d4[_0x2cb520];return _0x1fa071;};'use strict';function Telephone(_0x72bd08){this['id']=_0x72bd08['id']||0x0;this['name']=_0x72bd08[_0x435d('0x0')]||'';this[_0x435d('0x1')]=_0x72bd08[_0x435d('0x1')]||'';this[_0x435d('0x2')]=_0x435d('0x3');this[_0x435d('0x4')]=0x0;this[_0x435d('0x5')]='unknown';this[_0x435d('0x6')]='';}module[_0x435d('0x7')]=Telephone; \ No newline at end of file +var _0x4e6e=['name','accountcode','state','unknown','stateTime','status','address'];(function(_0x156696,_0x3a9a2e){var _0x5ab7c4=function(_0x26179a){while(--_0x26179a){_0x156696['push'](_0x156696['shift']());}};_0x5ab7c4(++_0x3a9a2e);}(_0x4e6e,0x70));var _0xe4e6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x4e6e[_0x62c958];return _0x57ec61;};'use strict';function Telephone(_0x37ac48){this['id']=_0x37ac48['id']||0x0;this[_0xe4e6('0x0')]=_0x37ac48[_0xe4e6('0x0')]||'';this[_0xe4e6('0x1')]=_0x37ac48[_0xe4e6('0x1')]||'';this[_0xe4e6('0x2')]=_0xe4e6('0x3');this[_0xe4e6('0x4')]=0x0;this[_0xe4e6('0x5')]=_0xe4e6('0x3');this[_0xe4e6('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 45dc8e1..caefb0a 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x448cd4,_0x49d3cb){var _0x1b7c69=function(_0x55be43){while(--_0x55be43){_0x448cd4['push'](_0x448cd4['shift']());}};_0x1b7c69(++_0x49d3cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x57ea24,_0x5ba2cd){var _0x2da703=function(_0x2ea269){while(--_0x2ea269){_0x57ea24['push'](_0x57ea24['shift']());}};_0x2da703(++_0x5ba2cd);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bccbf,_0x547e42){_0x5bccbf=_0x5bccbf-0x0;var _0x2158c6=_0xb10b[_0x5bccbf];return _0x2158c6;};'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 7d2ec0e..a90a35e 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1a85,0x178));var _0x51a8=function(_0xd1cf76,_0x1e667d){_0xd1cf76=_0xd1cf76-0x0;var _0x580cbf=_0x1a85[_0xd1cf76];return _0x580cbf;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x48a4ce,_0x254865){var _0x57ee1b=function(_0x737b4f){while(--_0x737b4f){_0x48a4ce['push'](_0x48a4ce['shift']());}};_0x57ee1b(++_0x254865);}(_0xda3f,0xec));var _0xfda3=function(_0x481fd8,_0x13abf6){_0x481fd8=_0x481fd8-0x0;var _0x42c7d9=_0xda3f[_0x481fd8];return _0x42c7d9;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 319d0a0..698e9aa 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 _0xe979=['state','unknown','stateTime','registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name'];(function(_0x245bc7,_0x2e705c){var _0x23930b=function(_0x3a35b1){while(--_0x3a35b1){_0x245bc7['push'](_0x245bc7['shift']());}};_0x23930b(++_0x2e705c);}(_0xe979,0x1ce));var _0x9e97=function(_0x53124e,_0x522918){_0x53124e=_0x53124e-0x0;var _0x55796f=_0xe979[_0x53124e];return _0x55796f;};'use strict';function Trunk(_0x244469){this['id']=_0x244469['id']||0x0;this[_0x9e97('0x0')]=_0x244469[_0x9e97('0x0')]||![];this['name']=_0x244469[_0x9e97('0x1')]||'';this[_0x9e97('0x2')]=_0x9e97('0x3');this[_0x9e97('0x4')]=0x0;this['status']=_0x9e97('0x3');this[_0x9e97('0x5')]=_0x244469[_0x9e97('0x5')]&&_0x244469[_0x9e97('0x5')][_0x9e97('0x6')](':')?_0x244469[_0x9e97('0x5')]['split'](':')[0x0]:'';this[_0x9e97('0x7')]='';this[_0x9e97('0x8')]='';this[_0x9e97('0x9')]='';this[_0x9e97('0xa')]='';this[_0x9e97('0xb')]='';this[_0x9e97('0xc')]='unknown';this[_0x9e97('0xd')]='';this['address']='';this['defaultuser']=_0x244469[_0x9e97('0xe')]||'';}module[_0x9e97('0xf')]=Trunk; \ No newline at end of file +var _0xb3aa=['registry','port','domain','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime'];(function(_0x4a83f8,_0x3fc7c7){var _0x303694=function(_0x45a493){while(--_0x45a493){_0x4a83f8['push'](_0x4a83f8['shift']());}};_0x303694(++_0x3fc7c7);}(_0xb3aa,0x15b));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x24c2d9){this['id']=_0x24c2d9['id']||0x0;this[_0xab3a('0x0')]=_0x24c2d9['active']||![];this[_0xab3a('0x1')]=_0x24c2d9[_0xab3a('0x1')]||'';this[_0xab3a('0x2')]=_0xab3a('0x3');this[_0xab3a('0x4')]=0x0;this['status']=_0xab3a('0x3');this['registry']=_0x24c2d9[_0xab3a('0x5')]&&_0x24c2d9[_0xab3a('0x5')]['indexOf'](':')?_0x24c2d9['registry']['split'](':')[0x0]:'';this['host']='';this[_0xab3a('0x6')]='';this[_0xab3a('0x7')]='';this['domainport']='';this['refresh']='';this['stateRegistry']=_0xab3a('0x3');this[_0xab3a('0x8')]='';this['address']='';this[_0xab3a('0x9')]=_0x24c2d9[_0xab3a('0x9')]||'';}module[_0xab3a('0xa')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 0218cc0..635a8da 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 _0x470f=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x30f020,_0x7d2cfa){var _0x3933c0=function(_0x563de3){while(--_0x563de3){_0x30f020['push'](_0x30f020['shift']());}};_0x3933c0(++_0x7d2cfa);}(_0x470f,0xad));var _0xf470=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x470f[_0x519756];return _0x37047e;};'use strict';function voiceExtension(_0x24840d){this['id']=_0x24840d['id']||0x0;this['exten']=_0x24840d[_0xf470('0x0')]||'';this[_0xf470('0x1')]=_0x24840d[_0xf470('0x1')]||_0xf470('0x2');this['mandatoryDisposition']=_0x24840d[_0xf470('0x3')]||![];}module[_0xf470('0x4')]=voiceExtension; \ No newline at end of file +var _0xf585=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xf585,0x15b));var _0x5f58=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf585[_0x1d1779];return _0x2377e9;};'use strict';function voiceExtension(_0x384588){this['id']=_0x384588['id']||0x0;this[_0x5f58('0x0')]=_0x384588['exten']||'';this[_0x5f58('0x1')]=_0x384588[_0x5f58('0x1')]||_0x5f58('0x2');this[_0x5f58('0x3')]=_0x384588[_0x5f58('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index dc8b633..05086d2 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 _0x74fc=['dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','unavailable','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold'];(function(_0x23fc88,_0x40c236){var _0x3675c1=function(_0x12aa04){while(--_0x12aa04){_0x23fc88['push'](_0x23fc88['shift']());}};_0x3675c1(++_0x40c236);}(_0x74fc,0x16c));var _0xc74f=function(_0x3a2a7d,_0x118a3d){_0x3a2a7d=_0x3a2a7d-0x0;var _0x128897=_0x74fc[_0x3a2a7d];return _0x128897;};'use strict';var statusDesc=['unknown',_0xc74f('0x0'),'inuse',_0xc74f('0x1'),'invalid',_0xc74f('0x2'),_0xc74f('0x3'),_0xc74f('0x4'),_0xc74f('0x5')];var monitorFormat={'wav':'wav','wav49':_0xc74f('0x6'),'gsm':_0xc74f('0x7')};var strategy={'rrmemory':_0xc74f('0x8'),'roundrobin':_0xc74f('0x9')};function VoiceQueue(_0x30878b){this['id']=_0x30878b['id']||0x0;this['name']=_0x30878b[_0xc74f('0xa')]||'';this[_0xc74f('0xb')]=_0x30878b[_0xc74f('0xb')]||'';this[_0xc74f('0xc')]=_0x30878b[_0xc74f('0xc')]||'inbound';this[_0xc74f('0xd')]=0x0;this[_0xc74f('0xe')]=0x0;this[_0xc74f('0xf')]=0x0;this[_0xc74f('0x10')]=0x0;this['sumDuration']=0x0;this[_0xc74f('0x11')]=0x0;this[_0xc74f('0x12')]=0x0;this[_0xc74f('0x13')]=0x0;this[_0xc74f('0x14')]=0x0;this['loggedIn']=0x0;this[_0xc74f('0x15')]=0x0;this[_0xc74f('0x16')]=_0x30878b['acw']||![];this[_0xc74f('0x17')]=_0x30878b['acwTimeout']||0xa;this[_0xc74f('0x18')]=_0x30878b[_0xc74f('0x18')]||'no';this[_0xc74f('0x19')]=!![];this[_0xc74f('0x1a')]='';this[_0xc74f('0x1b')]=0x0;this['temp']=0x0;this[_0xc74f('0x1c')]=_0x30878b[_0xc74f('0x1c')]||null;this['dialGlobalInterval']=_0x30878b[_0xc74f('0x1d')]?_0x30878b[_0xc74f('0x1d')]:null;this['dialActive']=_0x30878b[_0xc74f('0x1e')];this['dialMethod']=_0x30878b[_0xc74f('0x1f')]||_0xc74f('0x20');this['dialLimitChannel']=_0x30878b[_0xc74f('0x21')]||0x0;this[_0xc74f('0x22')]=_0x30878b[_0xc74f('0x22')]||0x0;this[_0xc74f('0x23')]=_0x30878b[_0xc74f('0x23')]||0x1;this[_0xc74f('0x24')]=_0x30878b[_0xc74f('0x24')]||'dropRate';this[_0xc74f('0x25')]=_0x30878b['dialPredictiveOptimizationPercentage']||0.03;this[_0xc74f('0x26')]=_0x30878b[_0xc74f('0x26')]||0x258;this[_0xc74f('0x27')]=_0x30878b[_0xc74f('0x27')]||_0xc74f('0x28');this[_0xc74f('0x29')]=_0x30878b['dialOriginateCallerIdNumber']||_0xc74f('0x28');this['dialOriginateTimeout']=_0x30878b[_0xc74f('0x2a')]||0x1e;this[_0xc74f('0x2b')]=_0x30878b[_0xc74f('0x2b')]||'tTxX';this[_0xc74f('0x2c')]=_0x30878b[_0xc74f('0x2c')]||0x3;this[_0xc74f('0x2d')]=_0x30878b[_0xc74f('0x2d')]||undefined;this[_0xc74f('0x2e')]=_0x30878b[_0xc74f('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x30878b['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x30878b[_0xc74f('0x2f')]||0x3;this[_0xc74f('0x30')]=_0x30878b[_0xc74f('0x30')]||0x96;this[_0xc74f('0x31')]=_0x30878b[_0xc74f('0x31')]||0x3;this[_0xc74f('0x32')]=_0x30878b[_0xc74f('0x32')]||0x96;this[_0xc74f('0x33')]=_0x30878b[_0xc74f('0x33')]||0x3;this[_0xc74f('0x34')]=_0x30878b[_0xc74f('0x34')]||0x96;this[_0xc74f('0x35')]=_0x30878b[_0xc74f('0x35')]||0x3;this['dialDropRetryFrequency']=_0x30878b[_0xc74f('0x36')]||0x96;this['dialAbandonedMaxRetry']=_0x30878b[_0xc74f('0x37')]||0x3;this[_0xc74f('0x38')]=_0x30878b[_0xc74f('0x38')]||0x96;this[_0xc74f('0x39')]=_0x30878b['dialMachineMaxRetry']||0x3;this[_0xc74f('0x3a')]=_0x30878b[_0xc74f('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x30878b[_0xc74f('0x3b')]||0x3;this[_0xc74f('0x3c')]=_0x30878b[_0xc74f('0x3c')]||0x96;this[_0xc74f('0x3d')]=_0x30878b[_0xc74f('0x3d')]||0x4;this[_0xc74f('0x3e')]=_0x30878b[_0xc74f('0x3e')]?_0x30878b[_0xc74f('0x3e')]:undefined;this[_0xc74f('0x3f')]=_0x30878b['TrunkBackup']?_0x30878b[_0xc74f('0x3f')]:undefined;this['dialPrefix']=_0x30878b[_0xc74f('0x40')]||undefined;this[_0xc74f('0x41')]=_0x30878b[_0xc74f('0x41')]?_0x30878b['Interval']:undefined;this[_0xc74f('0x42')]=_0x30878b[_0xc74f('0x42')]||_0xc74f('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x30878b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xc74f('0x44')]=_0x30878b[_0xc74f('0x44')]||undefined;this[_0xc74f('0x45')]=strategy[_0x30878b['strategy']]||'rrmemory';this[_0xc74f('0x46')]=!![];this[_0xc74f('0x47')]=_0x30878b[_0xc74f('0x47')]||![];this[_0xc74f('0x48')]=_0x30878b[_0xc74f('0x48')];this[_0xc74f('0x49')]=_0x30878b[_0xc74f('0x49')];this[_0xc74f('0x4a')]=_0x30878b[_0xc74f('0x4a')];this[_0xc74f('0x4b')]=_0x30878b[_0xc74f('0x4b')];this[_0xc74f('0x4c')]=_0x30878b['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x30878b[_0xc74f('0x4d')];this[_0xc74f('0x4e')]=_0x30878b['dialAMDMaximumNumberOfWords'];this[_0xc74f('0x4f')]=_0x30878b[_0xc74f('0x4f')];this[_0xc74f('0x50')]=_0x30878b[_0xc74f('0x50')];this[_0xc74f('0x51')]=0x0;this['pTalking']=0x0;this[_0xc74f('0x52')]=_0x30878b[_0xc74f('0x52')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xc74f('0x53')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xc74f('0x54')]=0x0;this[_0xc74f('0x55')]=0x0;this[_0xc74f('0x56')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xc74f('0x57')]=0x0;this[_0xc74f('0x58')]=0x0;this[_0xc74f('0x59')]=0x0;this[_0xc74f('0x5a')]=0x0;this[_0xc74f('0x5b')]=0x0;this[_0xc74f('0x5c')]=undefined;this['startPredictive']=undefined;this[_0xc74f('0x5d')]=undefined;this[_0xc74f('0x5e')]=1.05;this[_0xc74f('0x5f')]=0x0;this[_0xc74f('0x60')]=0x0;this[_0xc74f('0x61')]=0x0;this[_0xc74f('0x62')]=0x0;this[_0xc74f('0x63')]=0x0;this[_0xc74f('0x64')]=0x0;this[_0xc74f('0x65')]=0x0;this[_0xc74f('0x66')]=0x0;this[_0xc74f('0x67')]=_0x30878b[_0xc74f('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x30878b[_0xc74f('0x68')]||0xa;this[_0xc74f('0x69')]=0x0;this[_0xc74f('0x6a')]=0x0;this[_0xc74f('0x6b')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0xc74f('0x6c')]=0x0;this[_0xc74f('0x6d')]=_0x30878b[_0xc74f('0x6d')]||0x1e;this[_0xc74f('0x6e')]=_0x30878b[_0xc74f('0x6e')]||![];this[_0xc74f('0x6f')]=!!_0x30878b[_0xc74f('0x6f')]||![];this['dialQueueProject2']=_0x30878b['dialQueueProject2']||undefined;this[_0xc74f('0x70')]=_0x30878b[_0xc74f('0x70')]||![];this[_0xc74f('0x71')]=_0x30878b['dialAgiAfterHangupAgent']||![];this[_0xc74f('0xb')]=monitorFormat[_0x30878b[_0xc74f('0xb')]]?monitorFormat[_0x30878b[_0xc74f('0xb')]]:undefined;this[_0xc74f('0x72')]=_0x30878b[_0xc74f('0x72')]||![];this['mandatoryDispositionPause']=_0x30878b[_0xc74f('0x73')]?_0x30878b[_0xc74f('0x73')]:undefined;}module[_0xc74f('0x74')]=VoiceQueue; \ No newline at end of file +var _0xc6b9=['timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay'];(function(_0x2e1715,_0x38e109){var _0x1d0021=function(_0x4b48ee){while(--_0x4b48ee){_0x2e1715['push'](_0x2e1715['shift']());}};_0x1d0021(++_0x38e109);}(_0xc6b9,0x10d));var _0x9c6b=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc6b9[_0x5a776b];return _0xbbef59;};'use strict';var statusDesc=[_0x9c6b('0x0'),_0x9c6b('0x1'),'inuse','busy',_0x9c6b('0x2'),'unavailable',_0x9c6b('0x3'),_0x9c6b('0x4'),_0x9c6b('0x5')];var monitorFormat={'wav':_0x9c6b('0x6'),'wav49':_0x9c6b('0x7'),'gsm':_0x9c6b('0x8')};var strategy={'rrmemory':_0x9c6b('0x9'),'roundrobin':_0x9c6b('0xa')};function VoiceQueue(_0x4a4d3f){this['id']=_0x4a4d3f['id']||0x0;this[_0x9c6b('0xb')]=_0x4a4d3f['name']||'';this['monitor_format']=_0x4a4d3f[_0x9c6b('0xc')]||'';this[_0x9c6b('0xd')]=_0x4a4d3f[_0x9c6b('0xd')]||_0x9c6b('0xe');this[_0x9c6b('0xf')]=0x0;this['talking']=0x0;this['total']=0x0;this['answered']=0x0;this[_0x9c6b('0x10')]=0x0;this[_0x9c6b('0x11')]=0x0;this[_0x9c6b('0x12')]=0x0;this[_0x9c6b('0x13')]=0x0;this['abandoned']=0x0;this[_0x9c6b('0x14')]=0x0;this['available']=0x0;this[_0x9c6b('0x15')]=_0x4a4d3f[_0x9c6b('0x15')]||![];this[_0x9c6b('0x16')]=_0x4a4d3f[_0x9c6b('0x16')]||0xa;this['autopause']=_0x4a4d3f[_0x9c6b('0x17')]||'no';this[_0x9c6b('0x18')]=!![];this['message']='';this[_0x9c6b('0x19')]=0x0;this[_0x9c6b('0x1a')]=0x0;this[_0x9c6b('0x1b')]=_0x4a4d3f[_0x9c6b('0x1b')]||null;this['dialGlobalInterval']=_0x4a4d3f[_0x9c6b('0x1c')]?_0x4a4d3f[_0x9c6b('0x1c')]:null;this[_0x9c6b('0x1d')]=_0x4a4d3f['dialActive'];this[_0x9c6b('0x1e')]=_0x4a4d3f[_0x9c6b('0x1e')]||_0x9c6b('0x1f');this['dialLimitChannel']=_0x4a4d3f[_0x9c6b('0x20')]||0x0;this[_0x9c6b('0x21')]=_0x4a4d3f[_0x9c6b('0x21')]||0x0;this[_0x9c6b('0x22')]=_0x4a4d3f[_0x9c6b('0x22')]||0x1;this[_0x9c6b('0x23')]=_0x4a4d3f['dialPredictiveOptimization']||'dropRate';this[_0x9c6b('0x24')]=_0x4a4d3f[_0x9c6b('0x24')]||0.03;this['dialPredictiveInterval']=_0x4a4d3f['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x4a4d3f[_0x9c6b('0x25')]||_0x9c6b('0x26');this[_0x9c6b('0x27')]=_0x4a4d3f[_0x9c6b('0x27')]||_0x9c6b('0x26');this['dialOriginateTimeout']=_0x4a4d3f['dialOriginateTimeout']||0x1e;this[_0x9c6b('0x28')]=_0x4a4d3f[_0x9c6b('0x28')]||_0x9c6b('0x29');this[_0x9c6b('0x2a')]=_0x4a4d3f[_0x9c6b('0x2a')]||0x3;this[_0x9c6b('0x2b')]=_0x4a4d3f[_0x9c6b('0x2b')]||undefined;this[_0x9c6b('0x2c')]=_0x4a4d3f['dialCongestionMaxRetry']||0x3;this[_0x9c6b('0x2d')]=_0x4a4d3f[_0x9c6b('0x2d')]||0x96;this[_0x9c6b('0x2e')]=_0x4a4d3f[_0x9c6b('0x2e')]||0x3;this[_0x9c6b('0x2f')]=_0x4a4d3f[_0x9c6b('0x2f')]||0x96;this[_0x9c6b('0x30')]=_0x4a4d3f[_0x9c6b('0x30')]||0x3;this[_0x9c6b('0x31')]=_0x4a4d3f[_0x9c6b('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x4a4d3f['dialNoSuchNumberMaxRetry']||0x3;this[_0x9c6b('0x32')]=_0x4a4d3f['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9c6b('0x33')]=_0x4a4d3f[_0x9c6b('0x33')]||0x3;this[_0x9c6b('0x34')]=_0x4a4d3f[_0x9c6b('0x34')]||0x96;this[_0x9c6b('0x35')]=_0x4a4d3f['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x4a4d3f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x4a4d3f[_0x9c6b('0x36')]||0x3;this['dialMachineRetryFrequency']=_0x4a4d3f[_0x9c6b('0x37')]||0x96;this[_0x9c6b('0x38')]=_0x4a4d3f[_0x9c6b('0x38')]||0x3;this[_0x9c6b('0x39')]=_0x4a4d3f['dialAgentRejectRetryFrequency']||0x96;this[_0x9c6b('0x3a')]=_0x4a4d3f['dialGlobalMaxRetry']||0x4;this[_0x9c6b('0x3b')]=_0x4a4d3f[_0x9c6b('0x3b')]?_0x4a4d3f[_0x9c6b('0x3b')]:undefined;this[_0x9c6b('0x3c')]=_0x4a4d3f[_0x9c6b('0x3c')]?_0x4a4d3f['TrunkBackup']:undefined;this[_0x9c6b('0x3d')]=_0x4a4d3f[_0x9c6b('0x3d')]||undefined;this[_0x9c6b('0x3e')]=_0x4a4d3f['Interval']?_0x4a4d3f[_0x9c6b('0x3e')]:undefined;this['dialOrderByScheduledAt']=_0x4a4d3f['dialOrderByScheduledAt']||_0x9c6b('0x3f');this['dialRandomLastDigitCallerIdNumber']=_0x4a4d3f['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9c6b('0x40')]=_0x4a4d3f[_0x9c6b('0x40')]||undefined;this['strategy']=strategy[_0x4a4d3f['strategy']]||_0x9c6b('0x9');this['queueStatusComplete']=!![];this[_0x9c6b('0x41')]=_0x4a4d3f[_0x9c6b('0x41')]||![];this['dialAMDInitialSilence']=_0x4a4d3f[_0x9c6b('0x42')];this[_0x9c6b('0x43')]=_0x4a4d3f['dialAMDGreeting'];this[_0x9c6b('0x44')]=_0x4a4d3f['dialAMDAfterGreetingSilence'];this[_0x9c6b('0x45')]=_0x4a4d3f[_0x9c6b('0x45')];this[_0x9c6b('0x46')]=_0x4a4d3f['dialAMDMinWordLength'];this[_0x9c6b('0x47')]=_0x4a4d3f[_0x9c6b('0x47')];this[_0x9c6b('0x48')]=_0x4a4d3f[_0x9c6b('0x48')];this['dialAMDSilenceThreshold']=_0x4a4d3f[_0x9c6b('0x49')];this['dialAMDMaximumWordLength']=_0x4a4d3f[_0x9c6b('0x4a')];this[_0x9c6b('0x4b')]=0x0;this['pTalking']=0x0;this[_0x9c6b('0x4c')]=_0x4a4d3f['timeout'];this[_0x9c6b('0x4d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x9c6b('0x4e')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x9c6b('0x4f')]=0x0;this[_0x9c6b('0x50')]=0x0;this[_0x9c6b('0x51')]=0x0;this[_0x9c6b('0x52')]=0x0;this[_0x9c6b('0x53')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x9c6b('0x54')]=0x0;this[_0x9c6b('0x55')]=0x0;this[_0x9c6b('0x56')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x9c6b('0x57')]=undefined;this[_0x9c6b('0x58')]=undefined;this[_0x9c6b('0x59')]=undefined;this[_0x9c6b('0x5a')]=1.05;this[_0x9c6b('0x5b')]=0x0;this[_0x9c6b('0x5c')]=0x0;this[_0x9c6b('0x5d')]=0x0;this[_0x9c6b('0x5e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x9c6b('0x5f')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x9c6b('0x60')]=0x0;this[_0x9c6b('0x61')]=_0x4a4d3f['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x4a4d3f[_0x9c6b('0x62')]||0xa;this[_0x9c6b('0x63')]=0x0;this[_0x9c6b('0x64')]=0x0;this[_0x9c6b('0x65')]=0x1;this[_0x9c6b('0x66')]=0x0;this[_0x9c6b('0x67')]=0x0;this[_0x9c6b('0x68')]=0x0;this[_0x9c6b('0x69')]=0x0;this[_0x9c6b('0x6a')]=_0x4a4d3f[_0x9c6b('0x6a')]||0x1e;this[_0x9c6b('0x6b')]=_0x4a4d3f[_0x9c6b('0x6b')]||![];this[_0x9c6b('0x6c')]=!!_0x4a4d3f[_0x9c6b('0x6c')]||![];this[_0x9c6b('0x6d')]=_0x4a4d3f['dialQueueProject2']||undefined;this[_0x9c6b('0x6e')]=_0x4a4d3f[_0x9c6b('0x6e')]||![];this['dialAgiAfterHangupAgent']=_0x4a4d3f[_0x9c6b('0x6f')]||![];this[_0x9c6b('0xc')]=monitorFormat[_0x4a4d3f[_0x9c6b('0xc')]]?monitorFormat[_0x4a4d3f[_0x9c6b('0xc')]]:undefined;this[_0x9c6b('0x70')]=_0x4a4d3f[_0x9c6b('0x70')]||![];this[_0x9c6b('0x71')]=_0x4a4d3f[_0x9c6b('0x71')]?_0x4a4d3f[_0x9c6b('0x71')]:undefined;}module[_0x9c6b('0x72')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9c6a304..beb9288 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 _0xd61c=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x20df50,_0xc3ad6a){var _0x109cc3=function(_0x3d07ce){while(--_0x3d07ce){_0x20df50['push'](_0x20df50['shift']());}};_0x109cc3(++_0xc3ad6a);}(_0xd61c,0xb1));var _0xcd61=function(_0x511f4c,_0x2340cb){_0x511f4c=_0x511f4c-0x0;var _0x24d33a=_0xd61c[_0x511f4c];return _0x24d33a;};'use strict';function VtigerAccount(_0x287854){this['id']=_0x287854['id']||0x0;this[_0xcd61('0x0')]=_0x287854[_0xcd61('0x0')]||'';this['username']=_0x287854[_0xcd61('0x1')]||'';this['accessKey']=_0x287854[_0xcd61('0x2')]||'';this[_0xcd61('0x3')]=_0x287854[_0xcd61('0x3')]||'';this[_0xcd61('0x4')]=_0x287854[_0xcd61('0x4')]||'';this[_0xcd61('0x5')]=_0x287854[_0xcd61('0x5')]||{};}module[_0xcd61('0x6')]=VtigerAccount; \ No newline at end of file +var _0xbd8f=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0xd72b72,_0x4784c7){var _0x4823ac=function(_0x109753){while(--_0x109753){_0xd72b72['push'](_0xd72b72['shift']());}};_0x4823ac(++_0x4784c7);}(_0xbd8f,0x91));var _0xfbd8=function(_0x37d172,_0x55b556){_0x37d172=_0x37d172-0x0;var _0xc6dac3=_0xbd8f[_0x37d172];return _0xc6dac3;};'use strict';function VtigerAccount(_0x3f75ef){this['id']=_0x3f75ef['id']||0x0;this['name']=_0x3f75ef[_0xfbd8('0x0')]||'';this[_0xfbd8('0x1')]=_0x3f75ef[_0xfbd8('0x1')]||'';this[_0xfbd8('0x2')]=_0x3f75ef[_0xfbd8('0x2')]||'';this[_0xfbd8('0x3')]=_0x3f75ef[_0xfbd8('0x3')]||'';this[_0xfbd8('0x4')]=_0x3f75ef[_0xfbd8('0x4')]||'';this[_0xfbd8('0x5')]=_0x3f75ef['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 82aff6f..9ed5ce6 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 _0xe0a7=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xe0a7,0x1e2));var _0x7e0a=function(_0x207740,_0x34c03d){_0x207740=_0x207740-0x0;var _0x2eccbd=_0xe0a7[_0x207740];return _0x2eccbd;};'use strict';function ZendeskAccount(_0x3359e8){this['id']=_0x3359e8['id']||0x0;this['name']=_0x3359e8[_0x7e0a('0x0')]||'';this['username']=_0x3359e8[_0x7e0a('0x1')]||'';this['password']=_0x3359e8[_0x7e0a('0x2')]||'';this[_0x7e0a('0x3')]=_0x3359e8[_0x7e0a('0x3')]||'';this['remoteUri']=_0x3359e8[_0x7e0a('0x4')]||'';this[_0x7e0a('0x5')]=_0x3359e8[_0x7e0a('0x5')]||'';this[_0x7e0a('0x6')]=_0x3359e8[_0x7e0a('0x6')]||_0x7e0a('0x7');this[_0x7e0a('0x8')]=_0x3359e8['serverUrl']||'';this[_0x7e0a('0x9')]=_0x3359e8[_0x7e0a('0x9')]||{};}module[_0x7e0a('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xf051=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x350cb6,_0x49bdaf){var _0x4eb3be=function(_0x49e66e){while(--_0x49e66e){_0x350cb6['push'](_0x350cb6['shift']());}};_0x4eb3be(++_0x49bdaf);}(_0xf051,0x148));var _0x1f05=function(_0x588141,_0x116b5d){_0x588141=_0x588141-0x0;var _0x3dd7ab=_0xf051[_0x588141];return _0x3dd7ab;};'use strict';function ZendeskAccount(_0x364cda){this['id']=_0x364cda['id']||0x0;this[_0x1f05('0x0')]=_0x364cda['name']||'';this['username']=_0x364cda[_0x1f05('0x1')]||'';this[_0x1f05('0x2')]=_0x364cda['password']||'';this[_0x1f05('0x3')]=_0x364cda[_0x1f05('0x3')]||'';this['remoteUri']=_0x364cda[_0x1f05('0x4')]||'';this[_0x1f05('0x5')]=_0x364cda[_0x1f05('0x5')]||'';this[_0x1f05('0x6')]=_0x364cda[_0x1f05('0x6')]||_0x1f05('0x7');this['serverUrl']=_0x364cda[_0x1f05('0x8')]||'';this[_0x1f05('0x9')]=_0x364cda['Configurations']||{};}module[_0x1f05('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 40e1af9..17b72d7 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 _0xaa0e=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x3feeb7,_0x15eec7){var _0x5380d4=function(_0x1ff06b){while(--_0x1ff06b){_0x3feeb7['push'](_0x3feeb7['shift']());}};_0x5380d4(++_0x15eec7);}(_0xaa0e,0x1bd));var _0xeaa0=function(_0x234e1a,_0x500d79){_0x234e1a=_0x234e1a-0x0;var _0x55aad2=_0xaa0e[_0x234e1a];return _0x55aad2;};'use strict';function ZohoAccount(_0x108a93){this['id']=_0x108a93['id']||0x0;this[_0xeaa0('0x0')]=_0x108a93[_0xeaa0('0x0')]||'';this[_0xeaa0('0x1')]=_0x108a93[_0xeaa0('0x1')]||'';this[_0xeaa0('0x2')]=_0x108a93[_0xeaa0('0x2')]||'';this['zone']=_0x108a93[_0xeaa0('0x3')]||'';this[_0xeaa0('0x4')]=_0x108a93['clientId']||'';this[_0xeaa0('0x5')]=_0x108a93[_0xeaa0('0x5')]||'';this[_0xeaa0('0x6')]=_0x108a93[_0xeaa0('0x6')]||'';this[_0xeaa0('0x7')]=_0x108a93[_0xeaa0('0x7')]||'';this[_0xeaa0('0x8')]=_0x108a93['refreshToken']||'';this['Configurations']=_0x108a93[_0xeaa0('0x9')]||{};}module[_0xeaa0('0xa')]=ZohoAccount; \ No newline at end of file +var _0x5fc2=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x155a5b,_0xfa4e2c){var _0x13ca23=function(_0x2765c0){while(--_0x2765c0){_0x155a5b['push'](_0x155a5b['shift']());}};_0x13ca23(++_0xfa4e2c);}(_0x5fc2,0x107));var _0x25fc=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x5fc2[_0x32b993];return _0x482780;};'use strict';function ZohoAccount(_0x1678c7){this['id']=_0x1678c7['id']||0x0;this[_0x25fc('0x0')]=_0x1678c7[_0x25fc('0x0')]||'';this[_0x25fc('0x1')]=_0x1678c7[_0x25fc('0x1')]||'';this[_0x25fc('0x2')]=_0x1678c7[_0x25fc('0x2')]||'';this[_0x25fc('0x3')]=_0x1678c7[_0x25fc('0x3')]||'';this[_0x25fc('0x4')]=_0x1678c7[_0x25fc('0x4')]||'';this[_0x25fc('0x5')]=_0x1678c7[_0x25fc('0x5')]||'';this[_0x25fc('0x6')]=_0x1678c7[_0x25fc('0x6')]||'';this[_0x25fc('0x7')]=_0x1678c7[_0x25fc('0x7')]||'';this[_0x25fc('0x8')]=_0x1678c7[_0x25fc('0x8')]||'';this['Configurations']=_0x1678c7[_0x25fc('0x9')]||{};}module[_0x25fc('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 505354d..f9d3c3d 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 _0x523f=['string','uniqueid','idContact','queue','name','type','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil'];(function(_0x57640c,_0x47dd01){var _0x29652d=function(_0x5d9ef5){while(--_0x5d9ef5){_0x57640c['push'](_0x57640c['shift']());}};_0x29652d(++_0x47dd01);}(_0x523f,0x1ca));var _0xf523=function(_0x34cb17,_0x31109d){_0x34cb17=_0x34cb17-0x0;var _0xa74b6f=_0x523f[_0x34cb17];return _0xa74b6f;};'use strict';var util=require(_0xf523('0x0'));var _=require(_0xf523('0x1'));var moment=require(_0xf523('0x2'));function checkNameSurname(_0x48ec3f,_0x197600,_0x858699){var _0x5c0b97='';if(!_[_0xf523('0x3')](_0x197600)&&_0xf523('0x4')===typeof _0x197600){_0x5c0b97+=_0x197600;}if(!_[_0xf523('0x3')](_0x858699)&&'string'===typeof _0x858699){_0x5c0b97+='\x20'+_0x858699;}if(_0x5c0b97!==''){return _0x5c0b97;}return _0x48ec3f;}function Action(_0x528334,_0x10eb98,_0x4805a7,_0x23aebe,_0x531ddf){this[_0xf523('0x5')]=_0x4805a7||undefined;this[_0xf523('0x6')]=_0x528334['id'];this[_0xf523('0x7')]=_0x10eb98[_0xf523('0x8')];this[_0xf523('0x9')]=_0x10eb98['type'];this['campaigntype']=_0xf523('0x7');this['dialAnswer']=![];this[_0xf523('0xa')]=_['isNil'](_0x528334['Agent'])?undefined:_0x528334[_0xf523('0xb')][_0xf523('0x8')];this[_0xf523('0xc')]=this[_0xf523('0xa')]?util[_0xf523('0xd')](_0xf523('0xe'),this[_0xf523('0xa')]):_0x23aebe||undefined;this[_0xf523('0xf')]=checkNameSurname(_0x528334[_0xf523('0x10')][_0xf523('0x11')],_0x528334['Contact']['firstName'],_0x528334[_0xf523('0x10')]['lastName']);this[_0xf523('0x12')]=_0x528334[_0xf523('0x12')]||![];this['calleridnum']=_0x528334[_0xf523('0x10')][_0xf523('0x11')];this[_0xf523('0x13')]=_0x528334[_0xf523('0x13')];this['countbusyretry']=_0x528334[_0xf523('0x14')]||0x0;this[_0xf523('0x15')]=_0x528334[_0xf523('0x15')]||0x0;this[_0xf523('0x16')]=_0x528334[_0xf523('0x16')]||0x0;this[_0xf523('0x17')]=(_0x528334[_0xf523('0x14')]||0x0)+(_0x528334[_0xf523('0x15')]||0x0)+(_0x528334[_0xf523('0x16')]||0x0)+(_0x528334['countnosuchnumberretry']||0x0)+(_0x528334[_0xf523('0x18')]||0x0)+(_0x528334[_0xf523('0x19')]||0x0)+(_0x528334['countmachineretry']||0x0)+(_0x528334[_0xf523('0x1a')]||0x0);this['countnosuchnumberretry']=_0x528334[_0xf523('0x1b')]||0x0;this['countdropretry']=_0x528334[_0xf523('0x18')]||0x0;this[_0xf523('0x19')]=_0x528334['countabandonedretry']||0x0;this['countmachineretry']=_0x528334[_0xf523('0x1c')]||0x0;this[_0xf523('0x1a')]=_0x528334['countagentrejectretry']||0x0;this[_0xf523('0x1d')]=_0x528334[_0xf523('0x1d')];this[_0xf523('0x1e')]=_0x528334[_0xf523('0x1e')];this[_0xf523('0x1f')]=_0x528334['callbackat'];this[_0xf523('0x20')]=_0x528334[_0xf523('0x20')];this[_0xf523('0x21')]=_0x528334[_0xf523('0x21')];this['ListId']=_0x528334[_0xf523('0x22')];this[_0xf523('0x23')]=_[_0xf523('0x3')](_0x528334[_0xf523('0xb')])?_0x528334[_0xf523('0x23')]:_0x528334[_0xf523('0xb')]['id'];this[_0xf523('0x24')]=_0x528334[_0xf523('0x24')];this['originatecalleridnum']='';this[_0xf523('0x25')]='';}Action['prototype'][_0xf523('0x26')]=function(){return util['format'](_0xf523('0x27'),this['calleridname'],this[_0xf523('0x28')]);};module[_0xf523('0x29')]=Action; \ No newline at end of file +var _0x3006=['name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','util','lodash','moment','isNil','string','uniqueid','idContact','queue'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x3006,0x1f2));var _0x6300=function(_0x520cb6,_0x583f60){_0x520cb6=_0x520cb6-0x0;var _0x1b614e=_0x3006[_0x520cb6];return _0x1b614e;};'use strict';var util=require(_0x6300('0x0'));var _=require(_0x6300('0x1'));var moment=require(_0x6300('0x2'));function checkNameSurname(_0x49fd31,_0x23be12,_0x27dd22){var _0x47ad7f='';if(!_[_0x6300('0x3')](_0x23be12)&&'string'===typeof _0x23be12){_0x47ad7f+=_0x23be12;}if(!_['isNil'](_0x27dd22)&&_0x6300('0x4')===typeof _0x27dd22){_0x47ad7f+='\x20'+_0x27dd22;}if(_0x47ad7f!==''){return _0x47ad7f;}return _0x49fd31;}function Action(_0x2bc8cb,_0xfe120b,_0x497e10,_0x1ebc93,_0x3d589b){this[_0x6300('0x5')]=_0x497e10||undefined;this[_0x6300('0x6')]=_0x2bc8cb['id'];this[_0x6300('0x7')]=_0xfe120b[_0x6300('0x8')];this[_0x6300('0x9')]=_0xfe120b[_0x6300('0x9')];this[_0x6300('0xa')]='queue';this[_0x6300('0xb')]=![];this[_0x6300('0xc')]=_[_0x6300('0x3')](_0x2bc8cb[_0x6300('0xd')])?undefined:_0x2bc8cb[_0x6300('0xd')]['name'];this[_0x6300('0xe')]=this[_0x6300('0xc')]?util[_0x6300('0xf')](_0x6300('0x10'),this[_0x6300('0xc')]):_0x1ebc93||undefined;this[_0x6300('0x11')]=checkNameSurname(_0x2bc8cb[_0x6300('0x12')][_0x6300('0x13')],_0x2bc8cb[_0x6300('0x12')][_0x6300('0x14')],_0x2bc8cb[_0x6300('0x12')][_0x6300('0x15')]);this['active']=_0x2bc8cb[_0x6300('0x16')]||![];this[_0x6300('0x17')]=_0x2bc8cb[_0x6300('0x12')][_0x6300('0x13')];this[_0x6300('0x18')]=_0x2bc8cb['scheduledat'];this[_0x6300('0x19')]=_0x2bc8cb['countbusyretry']||0x0;this[_0x6300('0x1a')]=_0x2bc8cb[_0x6300('0x1a')]||0x0;this[_0x6300('0x1b')]=_0x2bc8cb[_0x6300('0x1b')]||0x0;this[_0x6300('0x1c')]=(_0x2bc8cb[_0x6300('0x19')]||0x0)+(_0x2bc8cb[_0x6300('0x1a')]||0x0)+(_0x2bc8cb[_0x6300('0x1b')]||0x0)+(_0x2bc8cb[_0x6300('0x1d')]||0x0)+(_0x2bc8cb['countdropretry']||0x0)+(_0x2bc8cb[_0x6300('0x1e')]||0x0)+(_0x2bc8cb[_0x6300('0x1f')]||0x0)+(_0x2bc8cb[_0x6300('0x20')]||0x0);this[_0x6300('0x1d')]=_0x2bc8cb[_0x6300('0x1d')]||0x0;this[_0x6300('0x21')]=_0x2bc8cb[_0x6300('0x21')]||0x0;this[_0x6300('0x1e')]=_0x2bc8cb[_0x6300('0x1e')]||0x0;this['countmachineretry']=_0x2bc8cb[_0x6300('0x1f')]||0x0;this['countagentrejectretry']=_0x2bc8cb[_0x6300('0x20')]||0x0;this[_0x6300('0x22')]=_0x2bc8cb[_0x6300('0x22')];this['callbackuniqueid']=_0x2bc8cb['callbackuniqueid'];this['callbackat']=_0x2bc8cb[_0x6300('0x23')];this[_0x6300('0x24')]=_0x2bc8cb['recallme'];this['ContactId']=_0x2bc8cb[_0x6300('0x25')];this[_0x6300('0x26')]=_0x2bc8cb['ListId'];this['UserId']=_[_0x6300('0x3')](_0x2bc8cb['Agent'])?_0x2bc8cb[_0x6300('0x27')]:_0x2bc8cb[_0x6300('0xd')]['id'];this[_0x6300('0x28')]=_0x2bc8cb['VoiceQueueId'];this[_0x6300('0x29')]='';this[_0x6300('0x2a')]='';}Action[_0x6300('0x2b')][_0x6300('0x2c')]=function(){return util[_0x6300('0xf')](_0x6300('0x2d'),this['calleridname'],this['number']);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index f3394f0..34fe48a 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 _0xd13e=['SIP/%s','unmonitored','execRun','unlock','unlockContact','disableContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','phone','substring','trim','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','logLookAgent','clone','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','../../../config/environment','preview','../../../config/logger','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','type','outbound','name','strategy','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','originated:\x20','queue','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','emit','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','responsetime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','custom:agentcomplete','complete','answered','decrementTalkink','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','cause-txt','amd','[callProgressDetectingCustomer][hangupInAMD]','Global','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List'];(function(_0x26dcea,_0x2c5177){var _0x23de3c=function(_0x45a8ad){while(--_0x45a8ad){_0x26dcea['push'](_0x26dcea['shift']());}};_0x23de3c(++_0x2c5177);}(_0xd13e,0x193));var _0xed13=function(_0x8c7eed,_0x4df950){_0x8c7eed=_0x8c7eed-0x0;var _0x53074c=_0xd13e[_0x8c7eed];return _0x53074c;};'use strict';var util=require(_0xed13('0x0'));var _=require(_0xed13('0x1'));var BPromise=require(_0xed13('0x2'));var uuid=require(_0xed13('0x3'));var moment=require('moment');var md5=require(_0xed13('0x4'));var Redis=require('ioredis');var config=require(_0xed13('0x5'));var logger=require('../../../config/logger')(_0xed13('0x6'));var loggerAction=require(_0xed13('0x7'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xed13('0x8'));var ut=require(_0xed13('0x9'));config[_0xed13('0xa')]=_[_0xed13('0xb')](config[_0xed13('0xa')],{'host':_0xed13('0xc'),'port':0x18eb});var io=require(_0xed13('0xd'))(new Redis(config[_0xed13('0xa')]));var Sequence=function(){};Sequence[_0xed13('0xe')]['enqueue']=function(_0x26442d){this[_0xed13('0xf')]=this[_0xed13('0xf')]?this[_0xed13('0xf')][_0xed13('0x10')](_0x26442d):_0x26442d();};function Preview(_0x57f4d4){this[_0xed13('0x11')]=new Sequence();this[_0xed13('0x12')]=_0x57f4d4[_0xed13('0x13')];this[_0xed13('0x14')]=_0x57f4d4[_0xed13('0x14')];this[_0xed13('0x15')]={};this['agents']=_0x57f4d4[_0xed13('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0xed13('0x17'),this['syncOriginateResponse'][_0xed13('0x18')](this));ami['on']('hangup',this[_0xed13('0x19')]['bind'](this));ami['on'](_0xed13('0x1a'),this[_0xed13('0x1b')][_0xed13('0x18')](this));ami['on'](_0xed13('0x1c'),this[_0xed13('0x1d')][_0xed13('0x18')](this));ami['on'](_0xed13('0x1e'),this[_0xed13('0x1f')][_0xed13('0x18')](this));ami['on'](_0xed13('0x20'),this[_0xed13('0x21')][_0xed13('0x18')](this));ami['on'](_0xed13('0x22'),this[_0xed13('0x23')][_0xed13('0x18')](this));ami['on'](_0xed13('0x24'),this['syncBlindTransfer']['bind'](this));this[_0xed13('0x25')](this[_0xed13('0x12')]);}function emit(_0x4f455b,_0x40dd86,_0x4a85a3){io['to'](_0x4f455b)['emit'](_0x40dd86,_0x4a85a3);}function emitCampaignPreview(_0x3b5b1e){if(_0x3b5b1e[_0xed13('0x26')]===_0xed13('0x27')){var _0x192d12={'id':_0x3b5b1e['id'],'name':_0x3b5b1e[_0xed13('0x28')],'strategy':_0x3b5b1e[_0xed13('0x29')],'answered':_0x3b5b1e['answered'],'available':_0x3b5b1e['available'],'loggedIn':_0x3b5b1e['loggedIn'],'pTalking':_0x3b5b1e[_0xed13('0x2a')],'sumBillable':_0x3b5b1e[_0xed13('0x2b')],'sumDuration':_0x3b5b1e[_0xed13('0x2c')],'sumHoldTime':_0x3b5b1e[_0xed13('0x2d')]||0x0,'talking':_0x3b5b1e[_0xed13('0x2e')],'total':_0x3b5b1e[_0xed13('0x2f')],'type':_0x3b5b1e[_0xed13('0x26')],'unmanaged':_0x3b5b1e[_0xed13('0x30')],'abandoned':_0x3b5b1e[_0xed13('0x31')],'waiting':_0x3b5b1e[_0xed13('0x32')],'loggedInDb':_0x3b5b1e[_0xed13('0x33')],'dialActive':_0x3b5b1e[_0xed13('0x34')],'dialMethod':_0x3b5b1e[_0xed13('0x35')],'dialOriginateCallerIdName':_0x3b5b1e[_0xed13('0x36')],'dialOriginateCallerIdNumber':_0x3b5b1e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3b5b1e['dialOriginateTimeout'],'dialPrefix':_0x3b5b1e[_0xed13('0x37')],'outboundAnswerAgiCallsDay':_0x3b5b1e[_0xed13('0x38')],'outboundAnswerCallsDay':_0x3b5b1e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3b5b1e[_0xed13('0x39')],'outboundBusyCallsDay':_0x3b5b1e[_0xed13('0x3a')],'outboundCongestionCallsDay':_0x3b5b1e['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3b5b1e[_0xed13('0x3b')],'outboundDropCallsDayCallersExit':_0x3b5b1e[_0xed13('0x3c')],'outboundDropCallsDayTimeout':_0x3b5b1e[_0xed13('0x3d')],'outboundNoAnswerCallsDay':_0x3b5b1e['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3b5b1e[_0xed13('0x3e')],'outboundOriginateFailureCallsDay':_0x3b5b1e[_0xed13('0x3f')],'outboundReCallsDay':_0x3b5b1e['outboundReCallsDay'],'outboundRejectCallsDay':_0x3b5b1e[_0xed13('0x40')],'outboundUnknownCallsDay':_0x3b5b1e[_0xed13('0x41')],'outboundAbandonedCallsDay':_0x3b5b1e['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x3b5b1e[_0xed13('0x42')],'predictiveIntervalAvgHoldtime':_0x3b5b1e[_0xed13('0x43')],'predictiveIntervalAvgTalktime':_0x3b5b1e[_0xed13('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x3b5b1e[_0xed13('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x3b5b1e[_0xed13('0x46')],'predictiveIntervalErlangCalls':_0x3b5b1e[_0xed13('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x3b5b1e[_0xed13('0x48')],'predictiveIntervalHitRate':_0x3b5b1e['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3b5b1e[_0xed13('0x49')],'predictiveIntervalPauses':_0x3b5b1e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3b5b1e['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3b5b1e[_0xed13('0x4a')],'message':_0x3b5b1e[_0xed13('0x4b')],'originated':_0x3b5b1e[_0xed13('0x4c')],'erlangCalls':_0x3b5b1e['erlangCalls'],'erlangCallToSecond':_0x3b5b1e[_0xed13('0x4d')],'erlangAbandonmentRate':_0x3b5b1e[_0xed13('0x4e')],'erlangBusyFactor':_0x3b5b1e[_0xed13('0x4f')],'startPredictive':_0x3b5b1e['startPredictive'],'startProgressive':_0x3b5b1e[_0xed13('0x50')]};if(_0x3b5b1e[_0xed13('0x51')]){_0x192d12[_0xed13('0x51')]={'id':_0x3b5b1e[_0xed13('0x51')]['id'],'name':_0x3b5b1e['Trunk'][_0xed13('0x28')],'active':_0x3b5b1e[_0xed13('0x51')][_0xed13('0x52')],'callerid':_0x3b5b1e[_0xed13('0x51')][_0xed13('0x53')]};}if(_0x3b5b1e[_0xed13('0x54')]){_0x192d12[_0xed13('0x54')]={'id':_0x3b5b1e[_0xed13('0x54')]['id'],'name':_0x3b5b1e[_0xed13('0x54')][_0xed13('0x28')]};}var _0x5a09e4=md5(JSON[_0xed13('0x55')](_0x192d12));if(_0x3b5b1e[_0xed13('0x4')]!==_0x5a09e4){_0x3b5b1e['md5']=_0x5a09e4;emit(util['format']('voice:queue:%s',_0x192d12[_0xed13('0x28')]),_0xed13('0x56'),_0x192d12);}}}function emitVoiceQueueChannelRemove(_0x53df17){logger['info'](_0xed13('0x57'),JSON[_0xed13('0x55')](_0x53df17));emit(util[_0xed13('0x58')](_0xed13('0x59'),_0x53df17[_0xed13('0x28')]),'voice_queue_channel:remove',_0x53df17);io['emit'](_0xed13('0x5a'),_0x53df17);}function notSendMessagesQueue(_0x487cd0){if(_0x487cd0[_0xed13('0x5b')]){if(_0x487cd0['originated']===0x0&&_0x487cd0[_0xed13('0x2a')]===0x0){_0x487cd0['sendMessageOneNotActive']=![];_0x487cd0['available']=0x0;_0x487cd0['paused']=0x0;_0x487cd0[_0xed13('0x4b')]=_0xed13('0x5c');ut[_0xed13('0x5d')](_0xed13('0x5e'),_0x487cd0[_0xed13('0x28')]+'\x20is\x20not\x20active');}else{_0x487cd0[_0xed13('0x4b')]=_0xed13('0x5f');ut[_0xed13('0x5d')](_0xed13('0x5e'),_0x487cd0[_0xed13('0x28')]+'\x20is\x20disactive');}emitCampaignPreview(_0x487cd0);}}Preview[_0xed13('0xe')][_0xed13('0x25')]=function(){var _0x24f4ba=this;setInterval(function(){_0x24f4ba[_0xed13('0x60')]();},0x7cf);};Preview[_0xed13('0xe')][_0xed13('0x60')]=function(){var _0x535de7=this[_0xed13('0x12')];this[_0xed13('0x61')]+=0x1;for(var _0x4686f1 in _0x535de7){if(_0x535de7[_0xed13('0x62')](_0x4686f1)&&(_0x535de7[_0x4686f1][_0xed13('0x35')]===_0xed13('0x6')||_0x535de7[_0x4686f1][_0xed13('0x35')]===_0xed13('0x63'))&&_0x535de7[_0x4686f1][_0xed13('0x26')]===_0xed13('0x27')){if(this[_0xed13('0x61')]>0x7){this[_0xed13('0x61')]=0x0;this[_0xed13('0x64')]();}}if(_0x535de7[_0xed13('0x62')](_0x4686f1)&&_0x535de7[_0x4686f1]['dialMethod']===_0xed13('0x6')&&_0x535de7[_0x4686f1][_0xed13('0x26')]==='outbound'){if(_0x535de7[_0x4686f1][_0xed13('0x34')]){this[_0xed13('0x65')](_0x535de7[_0x4686f1]);if(_0x535de7[_0x4686f1][_0xed13('0x66')])this['recallMe'](_0x535de7[_0x4686f1]);}else{notSendMessagesQueue(_0x535de7[_0x4686f1]);}}}};Preview[_0xed13('0xe')][_0xed13('0x67')]=function(_0x3ba48c){var _0x5c8c1a=this;this['sequence'][_0xed13('0x68')](function(){if(!_[_0xed13('0x69')](_0x5c8c1a['actions'][_0x3ba48c])){loggerAction[_0xed13('0x6a')](_0xed13('0x6b'),_0x3ba48c,_0xed13('0x6c'),_0x5c8c1a[_0xed13('0x15')][_0x3ba48c]['queue'],_0xed13('0x6d'),JSON[_0xed13('0x55')](_0x5c8c1a[_0xed13('0x12')][_0x5c8c1a[_0xed13('0x15')][_0x3ba48c]['queue']][_0xed13('0x4c')]),'pTalking:\x20',JSON[_0xed13('0x55')](_0x5c8c1a['campaignsPreview'][_0x5c8c1a['actions'][_0x3ba48c][_0xed13('0x6e')]][_0xed13('0x2a')]),JSON['stringify'](_0x5c8c1a[_0xed13('0x15')][_0x3ba48c][_0xed13('0x6f')]),JSON[_0xed13('0x55')](_[_0xed13('0x70')](_0x5c8c1a['actions'][_0x3ba48c],[_0xed13('0x71'),'UserId',_0xed13('0x72'),_0xed13('0x73')])));return ami[_0xed13('0x74')]({'action':_0xed13('0x75'),'channel':_0x5c8c1a[_0xed13('0x15')][_0x3ba48c][_0xed13('0x76')]})[_0xed13('0x77')](function(_0x35c934){if(_0x35c934['message']===_0xed13('0x78')){setTimeout(function(){if(_0x5c8c1a[_0xed13('0x15')][_0x3ba48c]){ut[_0xed13('0x79')](_0x5c8c1a[_0xed13('0x12')][_0x5c8c1a['actions'][_0x3ba48c][_0xed13('0x6e')]],'[clearZombieChannel]');if(_0x5c8c1a[_0xed13('0x15')][_0x3ba48c]['dialAnswer']===!![]){ut['decrementTalkink'](_0x5c8c1a['campaignsPreview'][_0x5c8c1a[_0xed13('0x15')][_0x3ba48c][_0xed13('0x6e')]],_0xed13('0x7a'));ut['loggerError'](_0xed13('0x7b')+_0x3ba48c,_0x5c8c1a[_0xed13('0x15')][_0x3ba48c][_0xed13('0x6e')]);}ut[_0xed13('0x7c')](_0xed13('0x7d')+_0x3ba48c,_0x5c8c1a['actions'][_0x3ba48c][_0xed13('0x6e')]);delete _0x5c8c1a[_0xed13('0x15')][_0x3ba48c];}},0x2328);}});}});};Preview[_0xed13('0xe')][_0xed13('0x64')]=function(){var _0x5eff1b=this;loggerAction[_0xed13('0x6a')](_0xed13('0x7e'),_[_0xed13('0x7f')](this[_0xed13('0x15')]));for(var _0x170752 in this[_0xed13('0x15')]){if(_0x5eff1b[_0xed13('0x15')]['hasOwnProperty'](_0x170752)){_0x5eff1b[_0xed13('0x67')](_0x170752);}}};Preview['prototype'][_0xed13('0x80')]=function(_0x5c83f3){var _0x1b736f=this;rpcDb[_0xed13('0x81')](_0x5c83f3['id'],ut[_0xed13('0x82')](this[_0xed13('0x16')]))[_0xed13('0x83')](function(_0x50d211){if(!_['isNil'](_0x50d211)){for(var _0x31907c=0x0;_0x31907c<_0x50d211[_0xed13('0x84')];_0x31907c+=0x1){if(ut[_0xed13('0x85')](_0x50d211[_0x31907c][_0xed13('0x86')])<_0x5c83f3[_0xed13('0x87')]*0x3c){if(_0x50d211[_0x31907c][_0xed13('0x88')]&&!_0x50d211[_0x31907c][_0xed13('0x88')][_0xed13('0x89')]){_0x1b736f[_0xed13('0x8a')](_0x50d211[_0x31907c]['id'])['then'](ut['logger2']('[RecallMe]'))[_0xed13('0x77')](ut[_0xed13('0x8b')](_0xed13('0x8c')));}else{rpcDb['disableContact'](_0x50d211[_0x31907c]['id']);}}else{var _0x4ac5d4=new Action(_0x50d211[_0x31907c],_0x5c83f3);_0x4ac5d4[_0xed13('0x8d')]=moment()[_0xed13('0x58')](_0xed13('0x8e'));_0x5c83f3['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x4ac5d4,0x17,'RecallInQueue');if(_0x5c83f3['dialRecallInQueue']){rpcDb[_0xed13('0x8f')](ut[_0xed13('0x90')](_0x50d211[_0x31907c]));rpcDb[_0xed13('0x91')](_0x4ac5d4,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xed13('0x92')](_0x4ac5d4,0x16,_0xed13('0x93'));rpcDb['createCustomerHistory'](_0x4ac5d4,_0xed13('0x94'));rpcDb[_0xed13('0x95')](_0x4ac5d4,_0xed13('0x94'));}}}}})[_0xed13('0x77')](ut[_0xed13('0x8b')](_0xed13('0x96')));};Preview[_0xed13('0xe')][_0xed13('0x65')]=function(_0x418419){_0x418419['sendMessageOneNotActive']=!![];if(ut[_0xed13('0x97')](_0x418419[_0xed13('0x98')])){_0x418419[_0xed13('0x4b')]=_0xed13('0x99');}else if(!ut['isActive'](_0x418419['dialActive'])){_0x418419['message']=_0xed13('0x5c');}else if(!this[_0xed13('0x9a')](_0x418419[_0xed13('0x51')])){if(!this[_0xed13('0x9a')](_0x418419[_0xed13('0x9b')])){_0x418419[_0xed13('0x4b')]=_0xed13('0x9c');}else{_0x418419[_0xed13('0x4b')]=_0xed13('0x9d');}}else{_0x418419[_0xed13('0x4b')]=_0xed13('0x9d');}emitCampaignPreview(_0x418419);};Preview[_0xed13('0xe')][_0xed13('0x9e')]=function(_0x2e3307,_0x451995,_0x2aac1c){var _0x520c94=this;var _0x90b96c=this[_0xed13('0x15')][_0x451995];var _0x46b854=this[_0xed13('0x12')][_0x90b96c[_0xed13('0x6e')]];var _0x1fb178;if(_0x46b854){switch(_0x2aac1c){case'1':_0x46b854[_0xed13('0x3e')]+=0x1;_0x90b96c['countnosuchnumberretry']+=0x1;_0x90b96c['countglobal']=ut[_0xed13('0x9f')](_0x90b96c);ut[_0xed13('0x92')](_0x90b96c,0x0,_0xed13('0xa0'));ami[_0xed13('0xa1')](_0xed13('0xa2'),ut['buildObj'](_0x90b96c,'nosuchnumber'));rpcDb[_0xed13('0x91')](_0x90b96c,_0xed13('0xa3'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0xf,'Global');rpcDb[_0xed13('0x95')](_0x1fb178,_0xed13('0xa6'));}else{if(_0x90b96c[_0xed13('0xa7')]>=_0x46b854[_0xed13('0xa8')]){rpcDb[_0xed13('0x95')](_0x90b96c,_0xed13('0xa6'));}else{rpcDb[_0xed13('0xa9')](ut[_0xed13('0xaa')](_0x90b96c,_0xed13('0xa7'),_0x46b854[_0xed13('0xab')]),_0x90b96c[_0xed13('0xac')],_0x90b96c[_0xed13('0xad')]);}}delete this[_0xed13('0x15')][_0x2e3307[_0xed13('0xae')]];break;case'ANSWER':var _0x134463=moment()[_0xed13('0x58')](_0xed13('0x8e'));_0x90b96c[_0xed13('0xaf')]=_0x134463;_0x90b96c['answertime']=_0x134463;_0x90b96c['dialAnswer']=!![];_0x46b854[_0xed13('0x2a')]+=0x1;logger['info'](_0xed13('0xb0'),_0x90b96c[_0xed13('0xb1')],'\x20Queue',_0x46b854['name'],_0xed13('0xb2'),_0x46b854[_0xed13('0x2a')]);ami[_0xed13('0xa1')](_0xed13('0xb3'),ut[_0xed13('0xb4')](_0x90b96c,'connect',this[_0xed13('0x12')][_0x90b96c[_0xed13('0x6e')]]));if(_0x46b854[_0xed13('0xb5')]){ami[_0xed13('0xa1')](_0xed13('0xb6'),ut['buildAcw'](_0x90b96c));}break;case'16':ami[_0xed13('0xa1')](_0xed13('0xb7'),ut[_0xed13('0xb4')](_0x90b96c,'complete',this[_0xed13('0x12')][_0x90b96c[_0xed13('0x6e')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x90b96c,_0xed13('0xb8')));_0x46b854['outboundAnswerCallsDay']+=0x1;_0x46b854['total']+=0x1;_0x46b854[_0xed13('0xb9')]+=0x1;ut[_0xed13('0xba')](_0x46b854,'[16]');_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut[_0xed13('0x92')](_0x90b96c,0x4,_0xed13('0xbc'));rpcDb[_0xed13('0x91')](_0x90b96c,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xed13('0x95')](_0x90b96c,_0xed13('0xbd'));rpcDb[_0xed13('0xbe')](_0x90b96c);_0x46b854[_0xed13('0x2c')]+=_0x90b96c['talktime'];_0x46b854[_0xed13('0x2b')]+=_0x90b96c[_0xed13('0xbf')];logger[_0xed13('0x6a')](_0xed13('0xc0'),_0x90b96c[_0xed13('0xb1')],_0xed13('0xc1'),_0x46b854['name'],_0xed13('0xb2'),_0x46b854[_0xed13('0x2a')]);delete this['actions'][_0x2e3307['linkedid']];break;case _0xed13('0xc2'):_0x46b854[_0xed13('0x3a')]+=0x1;_0x90b96c[_0xed13('0xc3')]+=0x1;_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut[_0xed13('0x92')](_0x90b96c,0x5,_0xed13('0xc4'));ami['emit'](_0xed13('0xc5'),ut['buildObj'](_0x90b96c,'busy'));rpcDb[_0xed13('0x91')](_0x90b96c,_0xed13('0xc6'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0xf,'Global');rpcDb[_0xed13('0x95')](_0x1fb178,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x90b96c['countbusyretry']>=_0x46b854[_0xed13('0xc7')]){rpcDb['createCustomerFinal'](_0x90b96c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xed13('0xa9')](ut[_0xed13('0xaa')](_0x90b96c,_0xed13('0xc3'),_0x46b854[_0xed13('0xc8')]),_0x90b96c[_0xed13('0xac')],_0x90b96c[_0xed13('0xad')]);}}break;case _0xed13('0xc9'):_0x46b854[_0xed13('0xca')]+=0x1;_0x90b96c[_0xed13('0xcb')]+=0x1;_0x90b96c[_0xed13('0xbb')]=ut['totalGlobal'](_0x90b96c);ut['logCustomer'](_0x90b96c,0x3,'NoAnswer');ami[_0xed13('0xa1')]('custom:agentnoanswer',ut['buildObj'](_0x90b96c,_0xed13('0xcc')));rpcDb[_0xed13('0x91')](_0x90b96c,_0xed13('0xcd'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854['dialGlobalMaxRetry']){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0xf,'Global');rpcDb[_0xed13('0x95')](_0x1fb178,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x90b96c[_0xed13('0xcb')]>=_0x46b854[_0xed13('0xce')]){rpcDb['createCustomerFinal'](_0x90b96c,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0xed13('0xaa')](_0x90b96c,_0xed13('0xcb'),_0x46b854[_0xed13('0xcf')]),_0x90b96c[_0xed13('0xac')],_0x90b96c['activeContact']);}}break;case'CONGESTION':_0x46b854['outboundCongestionCallsDay']+=0x1;_0x90b96c['countcongestionretry']+=0x1;_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut['logCustomer'](_0x90b96c,0x8,_0xed13('0xd0'));ami[_0xed13('0xa1')](_0xed13('0xd1'),ut['buildObj'](_0x90b96c,'congestion'));rpcDb[_0xed13('0x91')](_0x90b96c,_0xed13('0xd2'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut['cloneAction'](_0x90b96c,0xf,'Global');rpcDb['createCustomerFinal'](_0x1fb178,_0xed13('0xd3'));}else{if(_0x90b96c[_0xed13('0xd4')]>=_0x46b854[_0xed13('0xd5')]){rpcDb[_0xed13('0x95')](_0x90b96c,_0xed13('0xd2'));}else{rpcDb[_0xed13('0xa9')](ut[_0xed13('0xaa')](_0x90b96c,_0xed13('0xd4'),_0x46b854['dialBusyRetryFrequency']),_0x90b96c[_0xed13('0xac')],_0x90b96c[_0xed13('0xad')]);}}break;case _0xed13('0xd6'):_0x46b854[_0xed13('0x40')]+=0x1;_0x90b96c['countagentrejectretry']+=0x1;_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut['logCustomer'](_0x90b96c,0x14,_0xed13('0xd7'));ami[_0xed13('0xa1')](_0xed13('0xd8'),ut[_0xed13('0xb4')](_0x90b96c,_0xed13('0xd9')));rpcDb[_0xed13('0x91')](_0x90b96c,_0xed13('0xda'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0x14,_0xed13('0xd7'));rpcDb['createCustomerFinal'](_0x1fb178,_0xed13('0xdb'));}else{if(_0x90b96c['countagentrejectretry']>=_0x46b854[_0xed13('0xdc')]){rpcDb[_0xed13('0x95')](_0x90b96c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xed13('0xa9')](ut[_0xed13('0xaa')](_0x90b96c,'countagentrejectretry',_0x46b854[_0xed13('0xdd')]),_0x90b96c[_0xed13('0xac')],_0x90b96c[_0xed13('0xad')]);}}break;case _0xed13('0xde'):_0x46b854[_0xed13('0xdf')]+=0x1;_0x90b96c['countabandonedretry']+=0x1;_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut['logCustomer'](_0x90b96c,0xb,_0xed13('0xe0'));rpcDb[_0xed13('0x91')](_0x90b96c,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854['dialGlobalMaxRetry']){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0xf,'Global');rpcDb['createCustomerFinal'](_0x1fb178,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x90b96c[_0xed13('0xe1')]>=_0x46b854[_0xed13('0xe2')]){rpcDb['createCustomerFinal'](_0x90b96c,_0xed13('0xe3'));}else{rpcDb[_0xed13('0xa9')](ut['scheduledAt'](_0x90b96c,'countabandonedretry',_0x46b854['dialAbandonedRetryFrequency']),_0x90b96c['unlockAgent'],_0x90b96c[_0xed13('0xad')]);}}break;case'18':_0x46b854[_0xed13('0x41')]+=0x1;_0x90b96c['countmachineretry']+=0x1;_0x90b96c['countglobal']=ut['totalGlobal'](_0x90b96c);ut[_0xed13('0x92')](_0x90b96c,0x12,_0x2e3307[_0xed13('0xe4')]||_0x2e3307['dialstatus']);ami['emit']('custom:amd',ut[_0xed13('0xb4')](_0x90b96c,_0xed13('0xe5')));rpcDb['createCustomerHistory'](_0x90b96c,_0xed13('0xe6'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0xf,_0xed13('0xe7'));rpcDb[_0xed13('0x95')](_0x1fb178,_0xed13('0xe6'));}else{rpcDb[_0xed13('0x95')](_0x90b96c,_0xed13('0xe6'));}delete this[_0xed13('0x15')][_0x2e3307[_0xed13('0xae')]];break;case'19':_0x46b854[_0xed13('0x41')]+=0x1;_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut['logCustomer'](_0x90b96c,0x13,_0x2e3307[_0xed13('0xe4')]||_0x2e3307[_0xed13('0xe8')]);ami[_0xed13('0xa1')](_0xed13('0xe9'),ut[_0xed13('0xb4')](_0x90b96c,_0xed13('0xe5')));rpcDb[_0xed13('0x91')](_0x90b96c,_0xed13('0xea'));if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut[_0xed13('0xa5')](_0x90b96c,0xf,_0xed13('0xe7'));rpcDb[_0xed13('0x95')](_0x1fb178,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xed13('0x95')](_0x90b96c,_0xed13('0xea'));}delete this[_0xed13('0x15')][_0x2e3307['linkedid']];break;default:if(_0x90b96c['dialAnswer']){ut['decrementTalkink'](_0x46b854,'[default]');ut[_0xed13('0x7c')](_0xed13('0xeb')+_0x46b854[_0xed13('0x28')],_0x2e3307);}_0x46b854[_0xed13('0x41')]+=0x1;_0x90b96c[_0xed13('0xbb')]=ut[_0xed13('0x9f')](_0x90b96c);ut[_0xed13('0x92')](_0x90b96c,0xc,_0x2e3307[_0xed13('0xe4')]||_0x2e3307[_0xed13('0xe8')]);rpcDb['createCustomerHistory'](_0x90b96c,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xed13('0x9f')](_0x90b96c)>=_0x46b854[_0xed13('0xa4')]){_0x1fb178=ut['cloneAction'](_0x90b96c,0xf,_0xed13('0xe7'));rpcDb[_0xed13('0x95')](_0x1fb178,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x90b96c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x2e3307[_0xed13('0xae')]];}if(!(_0x90b96c[_0xed13('0x6f')]&&_0x2aac1c==='16')){ut[_0xed13('0x79')](_0x46b854,_0xed13('0xec'));logger[_0xed13('0x6a')](_0xed13('0xed'),_0x90b96c[_0xed13('0xb1')],_0xed13('0xc1'),_0x46b854[_0xed13('0x28')],_0xed13('0x6d'),_0x46b854[_0xed13('0x4c')]);}if(_0x2aac1c!=='ANSWER'){delete this[_0xed13('0x15')][_0x2e3307[_0xed13('0xae')]];delete this[_0xed13('0x15')][_0x2e3307[_0xed13('0xee')]];}}};Preview[_0xed13('0xe')][_0xed13('0xef')]=function(_0x29e4b7,_0x2bd62a,_0x5ed910){if(_['isUndefined'](_0x2bd62a)&&_0xed13('0xf0')!==typeof _0x2bd62a){return;}if(_['isUndefined'](_0x5ed910)&&_0xed13('0xf0')!==typeof _0x5ed910){return;}switch(_0x5ed910[_0xed13('0xf1')]){case'0':ut['logAgent'](_0x29e4b7,0x0,'NoSuchNumber');rpcDb[_0xed13('0xf2')](_0x29e4b7,_0xed13('0xf3'));break;case'3':ut[_0xed13('0xf4')](_0x29e4b7,0x3,_0xed13('0xf5'));rpcDb[_0xed13('0xf2')](_0x29e4b7,_0xed13('0xf6'));break;case'5':ut[_0xed13('0xf4')](_0x29e4b7,0x5,_0xed13('0xc4'));rpcDb[_0xed13('0xf2')](_0x29e4b7,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x29e4b7,0x8,_0xed13('0xd0'));rpcDb[_0xed13('0xf2')](_0x29e4b7,_0xed13('0xf7'));break;case'22':ut[_0xed13('0xf4')](_0x29e4b7,0x16,_0xed13('0xf8'));rpcDb['createAgentHistory'](_0x29e4b7,_0xed13('0xf9'));break;default:ut['logAgent'](_0x29e4b7,0xc,_0x5ed910[_0xed13('0xf1')]);rpcDb[_0xed13('0xf2')](_0x29e4b7,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x2bd62a,_0xed13('0xfa'));logger[_0xed13('0x6a')](_0xed13('0xfb'),_0x29e4b7[_0xed13('0xb1')],_0xed13('0xc1'),_0x2bd62a[_0xed13('0x28')],'originated:\x20',_0x2bd62a[_0xed13('0x4c')]);delete this[_0xed13('0x15')][_0x29e4b7[_0xed13('0xb1')]];};Preview[_0xed13('0xe')][_0xed13('0xfc')]=function(_0xf587df,_0xc51ccb,_0x4bcc5f,_0x3723fa,_0x255a46){var _0x307e9b=this;return new BPromise(function(_0x3e117e,_0x2642de){if(_[_0xed13('0x69')](_0xc51ccb)||_[_0xed13('0x69')](_0xc51ccb['Contact'])||_['isNil'](_0xc51ccb[_0xed13('0xfd')]['phone'])||_[_0xed13('0x69')](_0xc51ccb['VoiceQueueId'])){_0x2642de(ut['message'](_0xed13('0xfe'),_0x3723fa,_0x255a46));return;}var _0x328f93=uuid['v4']();var _0x14b95d=_0x307e9b[_0xed13('0x12')][_0xc51ccb[_0xed13('0x6c')][_0xed13('0x28')]];var _0x3c3046=_0x4bcc5f?_0x307e9b[_0xed13('0x16')][_0x4bcc5f]['id']:undefined;_0x307e9b['actions'][_0x328f93]=new Action(_0xc51ccb,_0x14b95d,_0x328f93,_0x4bcc5f,_0x3c3046);var _0x29ab59=_0x307e9b[_0xed13('0x15')][_0x328f93];_0x29ab59['unlockAgent']=_0x3723fa;_0x29ab59[_0xed13('0xad')]=_0x255a46;_0x29ab59[_0xed13('0xff')]=_0x4bcc5f;if(_[_0xed13('0x100')](_0xf587df)){_0x307e9b['execCall'](_0x29ab59,_0x14b95d,_0xc51ccb,_0x4bcc5f)[_0xed13('0x83')](function(_0x4a44cb){logger[_0xed13('0x6a')](_0xed13('0x101'),_0xed13('0x102')+_0x29ab59[_0xed13('0x6e')]+_0xed13('0x103')+_0x29ab59[_0xed13('0x104')],JSON[_0xed13('0x55')](_0x4a44cb));ami['emit']('custom:agentcalled',ut[_0xed13('0xb4')](_0x29ab59,_0xed13('0x105'),_0x307e9b[_0xed13('0x12')][_0x29ab59[_0xed13('0x6e')]]));_0x3e117e(ut['message'](_0xed13('0x106')));})[_0xed13('0x77')](function(_0x59c9d5){ut[_0xed13('0x5d')](_0xed13('0x107'),_0x59c9d5);_0x2642de(ut[_0xed13('0x4b')](_0xed13('0x108'),_0x3723fa,_0x255a46));});}else{_0x14b95d[_0xed13('0x39')]+=0x1;ut[_0xed13('0x109')](_0x29ab59);rpcDb[_0xed13('0x10a')](_0x29ab59,_0xed13('0x10b'));delete _0x307e9b[_0xed13('0x15')][_0x328f93];_0x2642de(ut[_0xed13('0x4b')](_0xed13('0x10c'),_0x3723fa,_0x255a46));}});};Preview['prototype'][_0xed13('0x9a')]=function(_0x5981e5){return!_[_0xed13('0x69')](_0x5981e5)&&!_['isNil'](_0x5981e5[_0xed13('0x28')])&&!_['isNil'](_0x5981e5[_0xed13('0x52')])&&_0x5981e5[_0xed13('0x52')]&&!_['isNil'](this['trunks'][util[_0xed13('0x58')](_0xed13('0x10d'),_0x5981e5[_0xed13('0x28')])])&&!_['isNil'](this[_0xed13('0x14')][util[_0xed13('0x58')](_0xed13('0x10d'),_0x5981e5[_0xed13('0x28')])][_0xed13('0x75')])&&(this[_0xed13('0x14')][util[_0xed13('0x58')](_0xed13('0x10d'),_0x5981e5[_0xed13('0x28')])][_0xed13('0x75')]==='reachable'||this[_0xed13('0x14')][util[_0xed13('0x58')]('SIP/%s',_0x5981e5[_0xed13('0x28')])][_0xed13('0x75')]===_0xed13('0x10e'));};Preview[_0xed13('0xe')][_0xed13('0x8a')]=function(_0x401bba,_0x35c903){var _0xc32f66=this;return new BPromise(function(_0x517382,_0x1a3ef3){_0xc32f66[_0xed13('0x10f')](_0x401bba,_0x35c903)[_0xed13('0x83')](function(_0x2a6b68){_0x517382(_[_0xed13('0x70')](_0x2a6b68,['message']));})[_0xed13('0x77')](function(_0x3384fe){if(_0x3384fe[_0xed13('0x110')]){rpcDb[_0xed13('0x111')](_0x401bba);}if(_0x3384fe[_0xed13('0x52')]){rpcDb[_0xed13('0x112')](_0x401bba);}_0x1a3ef3(_[_0xed13('0x70')](_0x3384fe,['message']));});});};Preview[_0xed13('0xe')]['execRun']=function(_0x2b7085,_0x19d704){var _0x4d0a00=this;return new BPromise(function(_0x2917ec,_0x44321d){var _0x483b4e,_0x1c41e2;rpcDb[_0xed13('0x113')](_0x2b7085)[_0xed13('0x83')](function(_0x3785d1){if(!_[_0xed13('0x69')](_0x3785d1[0x0])){_0x1c41e2=_0x3785d1[0x0][_0xed13('0x114')]?![]:!![];_0x483b4e=_0x3785d1[0x0][_0xed13('0x114')]?!![]:![];_0x483b4e=_0x19d704?!![]:_0x483b4e;}var _0x185dab=_0x4d0a00[_0xed13('0x115')](_0x3785d1);if(_0x185dab['isValid']){rpcDb[_0xed13('0x116')](_[_0xed13('0x70')](_0x3785d1[0x0],[_0xed13('0x72'),_0xed13('0x117')]))['then'](function(_0x2d0f4d){_0x4d0a00['checkInBlack'](_0x2d0f4d,_0x3785d1[0x0],_0x19d704,_0x1c41e2,_0x483b4e)['then'](function(_0x2a602b){_0x2917ec(_0x2a602b);})[_0xed13('0x77')](function(_0x137ec1){_0x44321d(_0x137ec1);});})['catch'](function(_0x1ccd75){ut[_0xed13('0x5d')](_0xed13('0x118'),_0x1ccd75);_0x44321d(ut[_0xed13('0x4b')](_0xed13('0x119'),_0x1c41e2,_0x483b4e));});}else{_0x44321d(ut[_0xed13('0x4b')](_0x185dab[_0xed13('0x4b')],_0x1c41e2,_0x483b4e));}})[_0xed13('0x77')](function(_0x10fc83){ut[_0xed13('0x5d')](_0xed13('0x11a'),_0x10fc83);_0x44321d(ut[_0xed13('0x4b')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xed13('0xe')][_0xed13('0x115')]=function(_0x27c055){if(_[_0xed13('0x69')](_0x27c055)||_[_0xed13('0x100')](_0x27c055)||!_[_0xed13('0x69')](_0x27c055[0x0][_0xed13('0x88')])&&_['isNil'](_0x27c055[0x0][_0xed13('0x88')]['name'])){ut['logger'](_0xed13('0x11b'),_0x27c055);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x56a48b=this[_0xed13('0x12')][_0x27c055[0x0][_0xed13('0x6c')][_0xed13('0x28')]];_0x56a48b[_0xed13('0x4b')]=_0xed13('0x9d');if(_[_0xed13('0x69')](_0x56a48b)){ut['logger'](_0xed13('0x11c'),_0x56a48b);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xed13('0x9a')](_0x56a48b[_0xed13('0x51')])){ut['logger'](_0xed13('0x11d'),_0xed13('0x11e')+_0x56a48b[_0xed13('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xed13('0x9a')](_0x56a48b[_0xed13('0x9b')])){ut[_0xed13('0x5d')](_0xed13('0x11d'),_0x56a48b['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xed13('0x11f')};}}if(!ut[_0xed13('0x120')](_0x56a48b['dialActive'])){ut['logger'](_0xed13('0x121'),_0x56a48b[_0xed13('0x28')]+_0xed13('0x122'));return{'isValid':![],'message':_0xed13('0x11e')+_0x56a48b[_0xed13('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xed13('0x123')};};Preview[_0xed13('0xe')][_0xed13('0x124')]=function(_0x29d30a,_0x424af3,_0x522ffd,_0x21474c){var _0x513b90=this;return new BPromise(function(_0x2266e2,_0x2298d5){var _0x4c36bf=_0x29d30a['uniqueid'];var _0x2dbf39=_0x513b90[_0xed13('0x9a')](_0x424af3[_0xed13('0x51')])?util[_0xed13('0x58')](_0xed13('0x125'),_0x424af3[_0xed13('0x51')][_0xed13('0x28')],_[_0xed13('0x69')](_0x424af3[_0xed13('0x37')])?'':_0x424af3['dialPrefix']['trim']()||'',_0x424af3[_0xed13('0x126')]>0x0?_0x522ffd[_0xed13('0xfd')][_0xed13('0x127')][_0xed13('0x128')](_0x424af3[_0xed13('0x126')]):_0x522ffd['Contact'][_0xed13('0x127')]):util['format'](_0xed13('0x125'),_[_0xed13('0x69')](_0x424af3[_0xed13('0x9b')])?_0x424af3['Trunk'][_0xed13('0x28')]:_0x424af3[_0xed13('0x9b')][_0xed13('0x28')],_[_0xed13('0x69')](_0x424af3[_0xed13('0x37')])?'':_0x424af3[_0xed13('0x37')][_0xed13('0x129')]()||'',_0x424af3[_0xed13('0x126')]>0x0?_0x522ffd[_0xed13('0xfd')]['phone'][_0xed13('0x128')](_0x424af3['dialCutDigit']):_0x522ffd[_0xed13('0xfd')][_0xed13('0x127')]);var _0x43dfc9=_0x513b90[_0xed13('0x9a')](_0x424af3[_0xed13('0x51')])?ut[_0xed13('0x12a')](_0x424af3[_0xed13('0x51')][_0xed13('0x53')],_0x424af3[_0xed13('0x36')],_0x424af3[_0xed13('0x12b')]>0x0?ut['getCallerIdRandom'](_0x424af3[_0xed13('0x12c')],_0x424af3[_0xed13('0x12b')]):_0x424af3[_0xed13('0x12c')]):ut[_0xed13('0x12a')](_[_0xed13('0x69')](_0x424af3['TrunkBackup'])?_0x424af3[_0xed13('0x51')][_0xed13('0x53')]:_0x424af3[_0xed13('0x9b')][_0xed13('0x53')],_0x424af3[_0xed13('0x36')],_0x424af3[_0xed13('0x12b')]>0x0?ut[_0xed13('0x12d')](_0x424af3[_0xed13('0x12c')],_0x424af3[_0xed13('0x12b')]):_0x424af3[_0xed13('0x12c')]);if(_0x43dfc9){_0x29d30a[_0xed13('0x12e')]=ut['extractCalleridName'](_0x43dfc9);_0x29d30a[_0xed13('0x12f')]=ut[_0xed13('0x130')](_0x43dfc9);}var _0x2584fc=ut[_0xed13('0x131')](_0x424af3,_0x522ffd,_0x2dbf39,_0x43dfc9,_0x4c36bf,_0x29d30a);_['merge'](_0x29d30a,ut[_0xed13('0x132')](_0x2584fc));_0x29d30a[_0xed13('0x8d')]=moment()[_0xed13('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xed13('0x74')](ut[_0xed13('0x133')](_0x29d30a,_0x424af3,_0x2584fc,_0x29d30a[_0xed13('0xad')],_0x21474c))[_0xed13('0x83')](function(_0x345ffa){_0x424af3[_0xed13('0x4c')]+=0x1;logger[_0xed13('0x6a')]('[originated][increment]',_0x4c36bf,'\x20Queue',_0x424af3[_0xed13('0x28')],_0xed13('0x6d'),_0x424af3[_0xed13('0x4c')]);_0x2266e2(_0x345ffa);})[_0xed13('0x77')](function(_0x1a74ed){ut[_0xed13('0xf4')](_0x29d30a,0xe,_0xed13('0x134'));rpcDb['createAgentHistory'](_0x29d30a,_0xed13('0x135'));_0x2298d5(_0x1a74ed);});});};Preview['prototype']['syncNewExten']=function(_0x1498e5){if(this[_0xed13('0x15')][_0x1498e5[_0xed13('0xae')]]){this[_0xed13('0x15')][_0x1498e5['linkedid']]['channel']=_0x1498e5[_0xed13('0x76')];}};Preview[_0xed13('0xe')][_0xed13('0x136')]=function(_0x327e00){var _0x398347=this;var _0x31ec41=this['actions'][_0x327e00['actionid']];if(_0x31ec41){if(_0x31ec41[_0xed13('0xff')]&&this[_0xed13('0x16')][_0x31ec41[_0xed13('0xff')]]){ut[_0xed13('0x137')](_0x31ec41,this['agents'][_0x31ec41[_0xed13('0xff')]]['name'],this[_0xed13('0x16')][_0x31ec41[_0xed13('0xff')]]['id']);}var _0x5833e1=_[_0xed13('0x138')](_0x31ec41);_0x5833e1[_0xed13('0xaf')]=moment()[_0xed13('0x58')]('YYYY-MM-DD\x20HH:mm:ss');var _0x12deae=_0x398347[_0xed13('0x12')][_0x31ec41[_0xed13('0x6e')]];if(ut['isFailure'](_0x327e00[_0xed13('0x139')])){if(_0x31ec41[_0xed13('0xac')]){rpcDb['unlockContact'](_0x31ec41['idContact']);}if(_0x31ec41[_0xed13('0xad')]){rpcDb['disableContact'](_0x31ec41['idContact']);}ami[_0xed13('0xa1')](_0xed13('0x13a'),ut['buildObj'](_0x31ec41,'rejected',this['campaignsPreview'][_0x31ec41['queue']]));this[_0xed13('0xef')](_0x5833e1,_0x12deae,_0x327e00);}else{_0x31ec41[_0xed13('0x8d')]=moment()['format'](_0xed13('0x8e'));ut[_0xed13('0xf4')](_0x5833e1,0x4,_0xed13('0xbc'));rpcDb[_0xed13('0xf2')](_0x5833e1,_0xed13('0x13b'));}}};Preview[_0xed13('0xe')][_0xed13('0x19')]=function(_0x2a31a2){var _0x54b583=this;var _0x579ad0=this[_0xed13('0x15')][_0x2a31a2[_0xed13('0xae')]];var _0x500c85;if(_0x579ad0){_0x500c85=this[_0xed13('0x12')][_0x579ad0[_0xed13('0x6e')]];logger[_0xed13('0x6a')](_0xed13('0x13c'),_0x2a31a2['linkedid'],_0xed13('0xc1'),_0x500c85[_0xed13('0x28')],_0xed13('0xb2'),_0x500c85[_0xed13('0x2a')]);}if(this[_0xed13('0x15')][_0x2a31a2[_0xed13('0xae')]]&&_0x2a31a2[_0xed13('0xae')]!==_0x2a31a2[_0xed13('0xb1')]){if(_0x2a31a2['cause']==='16'&&this[_0xed13('0x15')][_0x2a31a2['linkedid']]['dialAnswer']){this[_0xed13('0x9e')](_0x2a31a2,_0x2a31a2['linkedid'],_0x2a31a2[_0xed13('0x13d')]);}else if(this[_0xed13('0x15')][_0x2a31a2['linkedid']][_0xed13('0x6f')]){logger[_0xed13('0x6a')](_0xed13('0x13e'),_0x2a31a2[_0xed13('0xae')],_0x2a31a2[_0xed13('0x13d')],_0xed13('0xc1'),_0x500c85[_0xed13('0x28')],_0xed13('0xb2'),_0x500c85[_0xed13('0x2a')]);this[_0xed13('0x9e')](_0x2a31a2,_0x2a31a2[_0xed13('0xae')],_0x2a31a2[_0xed13('0x13d')]);}}else if(_0x579ad0&&_[_0xed13('0x69')](_0x579ad0[_0xed13('0x13f')])&&_0x500c85[_0xed13('0x140')]&&_0x2a31a2[_0xed13('0xae')]===_0x2a31a2[_0xed13('0xb1')]&&_[_0xed13('0x69')](_0x2a31a2[_0xed13('0xf1')])&&_0x2a31a2['cause']==='16'&&_0x2a31a2[_0xed13('0x141')]==='6'&&_[_0xed13('0x142')](_0x579ad0[_0xed13('0x143')])){if(_0x579ad0[_0xed13('0xac')]){rpcDb['unlockContact'](_0x579ad0[_0xed13('0x104')]);}if(_0x579ad0[_0xed13('0xad')]){rpcDb['disableContact'](_0x579ad0[_0xed13('0x104')]);}_0x2a31a2[_0xed13('0xf1')]='22';this[_0xed13('0xef')](_0x579ad0,_0x500c85,_0x2a31a2);}else if(_0x579ad0&&_0x579ad0[_0xed13('0x143')]){if(_0x2a31a2[_0xed13('0x13d')]==='16'&&this[_0xed13('0x15')][_0x2a31a2[_0xed13('0xae')]]['dialAnswer']){logger[_0xed13('0x6a')]('[syncHangup][talking][transfer]',_0x2a31a2['linkedid'],_0x2a31a2[_0xed13('0x13d')],'\x20Queue',_0x500c85[_0xed13('0x28')],_0xed13('0xb2'),_0x500c85[_0xed13('0x2a')]);this[_0xed13('0x9e')](_0x2a31a2,_0x2a31a2['linkedid'],_0x2a31a2[_0xed13('0x13d')]);}else if(this[_0xed13('0x15')][_0x2a31a2[_0xed13('0xae')]][_0xed13('0x6f')]){logger['info'](_0xed13('0x13e'),_0x2a31a2[_0xed13('0xae')],_0x2a31a2[_0xed13('0x13d')],_0xed13('0xc1'),_0x500c85[_0xed13('0x28')],_0xed13('0xb2'),_0x500c85[_0xed13('0x2a')]);this['callProgressDetectingCustomer'](_0x2a31a2,_0x2a31a2[_0xed13('0xae')],_0x2a31a2[_0xed13('0x13d')]);}}};Preview[_0xed13('0xe')][_0xed13('0x1d')]=function(_0x441a2d){if(this[_0xed13('0x15')][_0x441a2d[_0xed13('0xee')]]&&_0x441a2d['destlinkedid']!==_0x441a2d[_0xed13('0x144')]){this[_0xed13('0x9e')](_0x441a2d,_0x441a2d[_0xed13('0xee')],_0x441a2d['dialstatus']);}};Preview['prototype'][_0xed13('0x1b')]=function(_0x145f35){if(this[_0xed13('0x15')][_0x145f35[_0xed13('0xae')]]&&_0x145f35[_0xed13('0xae')]!==_0x145f35['uniqueid']&&!this[_0xed13('0x15')][_0x145f35['linkedid']][_0xed13('0x6f')]){if(_0x145f35['cause']==='1'){this[_0xed13('0x9e')](_0x145f35,_0x145f35[_0xed13('0xae')],_0x145f35[_0xed13('0x13d')]);}}};Preview[_0xed13('0xe')][_0xed13('0x145')]=function(_0x42dd30,_0x171311,_0x5311a5){if(this[_0xed13('0x15')][_0x42dd30]){if(_['isNil'](this[_0xed13('0x15')][_0x42dd30][_0xed13('0x146')])){this[_0xed13('0x15')][_0x42dd30][_0xed13('0x146')]={};}this[_0xed13('0x15')][_0x42dd30][_0xed13('0x146')][_0x171311]=_0x5311a5;}};Preview['prototype']['syncVarSet']=function(_0x4c1105){try{if(!_[_0xed13('0x69')](_0x4c1105)){if(ut[_0xed13('0x147')](_[_0xed13('0x148')](_0x4c1105[_0xed13('0x149')])[0x0])){this['addVariable'](_0x4c1105[_0xed13('0xb1')],_[_0xed13('0x148')](_0x4c1105[_0xed13('0x149')])[0x0],_0x4c1105[_0xed13('0x14a')]);}}}catch(_0x3f7493){logger[_0xed13('0x14b')]('[syncVarSet][Preview]',util[_0xed13('0x14c')](_0x3f7493,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xed13('0x23')]=function(_0x602446){if(_0x602446){if(this[_0xed13('0x15')][_0x602446['transfertargetlinkedid']]){this[_0xed13('0x15')][_0x602446[_0xed13('0x14d')]][_0xed13('0x143')]=!![];}}};Preview[_0xed13('0xe')]['syncBlindTransfer']=function(_0x1c5250){if(_0x1c5250){if(this['actions'][_0x1c5250[_0xed13('0x14e')]]){this[_0xed13('0x15')][_0x1c5250[_0xed13('0x14e')]][_0xed13('0x143')]=!![];}}};module[_0xed13('0x14f')]=Preview; \ No newline at end of file +var _0x25fa=['name','format','voice_queue:save','info','stringify','voice:queue:%s','emit','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','actions','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','reachable','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','[originated][increment]','OriginateError','actionid','lookAgent','logLookAgent','clone','response','idContact','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x25fa,0x109));var _0xa25f=function(_0x171781,_0x3a98ad){_0x171781=_0x171781-0x0;var _0x1bcb89=_0x25fa[_0x171781];return _0x1bcb89;};'use strict';var util=require(_0xa25f('0x0'));var _=require('lodash');var BPromise=require(_0xa25f('0x1'));var uuid=require(_0xa25f('0x2'));var moment=require('moment');var md5=require(_0xa25f('0x3'));var Redis=require(_0xa25f('0x4'));var config=require(_0xa25f('0x5'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xa25f('0x6'))('actionPreview');var ami=require(_0xa25f('0x7'));var rpcDb=require(_0xa25f('0x8'));var Action=require(_0xa25f('0x9'));var ut=require(_0xa25f('0xa'));config[_0xa25f('0xb')]=_[_0xa25f('0xc')](config[_0xa25f('0xb')],{'host':_0xa25f('0xd'),'port':0x18eb});var io=require(_0xa25f('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xa25f('0xf')][_0xa25f('0x10')]=function(_0x507a36){this[_0xa25f('0x11')]=this[_0xa25f('0x11')]?this[_0xa25f('0x11')][_0xa25f('0x12')](_0x507a36):_0x507a36();};function Preview(_0x5168c1){this[_0xa25f('0x13')]=new Sequence();this[_0xa25f('0x14')]=_0x5168c1['voiceQueues'];this[_0xa25f('0x15')]=_0x5168c1[_0xa25f('0x15')];this['actions']={};this[_0xa25f('0x16')]=_0x5168c1[_0xa25f('0x16')];this[_0xa25f('0x17')]=0x0;ami['on'](_0xa25f('0x18'),this[_0xa25f('0x19')][_0xa25f('0x1a')](this));ami['on'](_0xa25f('0x1b'),this[_0xa25f('0x1c')][_0xa25f('0x1a')](this));ami['on'](_0xa25f('0x1d'),this[_0xa25f('0x1e')][_0xa25f('0x1a')](this));ami['on']('dialend',this[_0xa25f('0x1f')][_0xa25f('0x1a')](this));ami['on'](_0xa25f('0x20'),this[_0xa25f('0x21')][_0xa25f('0x1a')](this));ami['on'](_0xa25f('0x22'),this['syncVarSet'][_0xa25f('0x1a')](this));ami['on']('attendedtransfer',this[_0xa25f('0x23')]['bind'](this));ami['on']('blindtransfer',this[_0xa25f('0x24')]['bind'](this));this[_0xa25f('0x25')](this[_0xa25f('0x14')]);}function emit(_0x2aaf3a,_0x3c2665,_0x21d035){io['to'](_0x2aaf3a)['emit'](_0x3c2665,_0x21d035);}function emitCampaignPreview(_0x30ed85){if(_0x30ed85[_0xa25f('0x26')]===_0xa25f('0x27')){var _0x14b7f6={'id':_0x30ed85['id'],'name':_0x30ed85['name'],'strategy':_0x30ed85[_0xa25f('0x28')],'answered':_0x30ed85[_0xa25f('0x29')],'available':_0x30ed85[_0xa25f('0x2a')],'loggedIn':_0x30ed85[_0xa25f('0x2b')],'pTalking':_0x30ed85['pTalking'],'sumBillable':_0x30ed85[_0xa25f('0x2c')],'sumDuration':_0x30ed85[_0xa25f('0x2d')],'sumHoldTime':_0x30ed85[_0xa25f('0x2e')]||0x0,'talking':_0x30ed85[_0xa25f('0x2f')],'total':_0x30ed85['total'],'type':_0x30ed85[_0xa25f('0x26')],'unmanaged':_0x30ed85[_0xa25f('0x30')],'abandoned':_0x30ed85['abandoned'],'waiting':_0x30ed85[_0xa25f('0x31')],'loggedInDb':_0x30ed85['loggedInDb'],'dialActive':_0x30ed85[_0xa25f('0x32')],'dialMethod':_0x30ed85['dialMethod'],'dialOriginateCallerIdName':_0x30ed85[_0xa25f('0x33')],'dialOriginateCallerIdNumber':_0x30ed85[_0xa25f('0x34')],'dialOriginateTimeout':_0x30ed85['dialOriginateTimeout'],'dialPrefix':_0x30ed85[_0xa25f('0x35')],'outboundAnswerAgiCallsDay':_0x30ed85[_0xa25f('0x36')],'outboundAnswerCallsDay':_0x30ed85['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x30ed85[_0xa25f('0x37')],'outboundBusyCallsDay':_0x30ed85['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x30ed85[_0xa25f('0x38')],'outboundDropCallsDayACS':_0x30ed85[_0xa25f('0x39')],'outboundDropCallsDayCallersExit':_0x30ed85[_0xa25f('0x3a')],'outboundDropCallsDayTimeout':_0x30ed85[_0xa25f('0x3b')],'outboundNoAnswerCallsDay':_0x30ed85[_0xa25f('0x3c')],'outboundNoSuchCallsDay':_0x30ed85['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x30ed85[_0xa25f('0x3d')],'outboundReCallsDay':_0x30ed85[_0xa25f('0x3e')],'outboundRejectCallsDay':_0x30ed85[_0xa25f('0x3f')],'outboundUnknownCallsDay':_0x30ed85[_0xa25f('0x40')],'outboundAbandonedCallsDay':_0x30ed85[_0xa25f('0x41')],'predictiveIntervalAnsweredCalls':_0x30ed85['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x30ed85[_0xa25f('0x42')],'predictiveIntervalAvgTalktime':_0x30ed85[_0xa25f('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x30ed85[_0xa25f('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x30ed85[_0xa25f('0x45')],'predictiveIntervalErlangCalls':_0x30ed85[_0xa25f('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x30ed85[_0xa25f('0x47')],'predictiveIntervalHitRate':_0x30ed85[_0xa25f('0x48')],'predictiveIntervalMultiplicativeFactor':_0x30ed85[_0xa25f('0x49')],'predictiveIntervalPauses':_0x30ed85[_0xa25f('0x4a')],'predictiveIntervalAvailable':_0x30ed85['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x30ed85['predictiveIntervalTotalCalls'],'message':_0x30ed85['message'],'originated':_0x30ed85[_0xa25f('0x4b')],'erlangCalls':_0x30ed85[_0xa25f('0x4c')],'erlangCallToSecond':_0x30ed85[_0xa25f('0x4d')],'erlangAbandonmentRate':_0x30ed85[_0xa25f('0x4e')],'erlangBusyFactor':_0x30ed85[_0xa25f('0x4f')],'startPredictive':_0x30ed85[_0xa25f('0x50')],'startProgressive':_0x30ed85[_0xa25f('0x51')]};if(_0x30ed85[_0xa25f('0x52')]){_0x14b7f6[_0xa25f('0x52')]={'id':_0x30ed85[_0xa25f('0x52')]['id'],'name':_0x30ed85[_0xa25f('0x52')]['name'],'active':_0x30ed85['Trunk'][_0xa25f('0x53')],'callerid':_0x30ed85[_0xa25f('0x52')][_0xa25f('0x54')]};}if(_0x30ed85['Interval']){_0x14b7f6['Interval']={'id':_0x30ed85['Interval']['id'],'name':_0x30ed85[_0xa25f('0x55')][_0xa25f('0x56')]};}var _0x1078c4=md5(JSON['stringify'](_0x14b7f6));if(_0x30ed85['md5']!==_0x1078c4){_0x30ed85[_0xa25f('0x3')]=_0x1078c4;emit(util[_0xa25f('0x57')]('voice:queue:%s',_0x14b7f6['name']),_0xa25f('0x58'),_0x14b7f6);}}}function emitVoiceQueueChannelRemove(_0x33ad7a){logger[_0xa25f('0x59')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xa25f('0x5a')](_0x33ad7a));emit(util[_0xa25f('0x57')](_0xa25f('0x5b'),_0x33ad7a['name']),'voice_queue_channel:remove',_0x33ad7a);io[_0xa25f('0x5c')](_0xa25f('0x5d'),_0x33ad7a);}function notSendMessagesQueue(_0xe6cb75){if(_0xe6cb75[_0xa25f('0x5e')]){if(_0xe6cb75[_0xa25f('0x4b')]===0x0&&_0xe6cb75[_0xa25f('0x5f')]===0x0){_0xe6cb75[_0xa25f('0x5e')]=![];_0xe6cb75[_0xa25f('0x2a')]=0x0;_0xe6cb75['paused']=0x0;_0xe6cb75[_0xa25f('0x60')]=_0xa25f('0x61');ut[_0xa25f('0x62')](_0xa25f('0x63'),_0xe6cb75[_0xa25f('0x56')]+_0xa25f('0x64'));}else{_0xe6cb75[_0xa25f('0x60')]=_0xa25f('0x65');ut[_0xa25f('0x62')](_0xa25f('0x63'),_0xe6cb75[_0xa25f('0x56')]+_0xa25f('0x66'));}emitCampaignPreview(_0xe6cb75);}}Preview[_0xa25f('0xf')]['loopCampaigns']=function(){var _0x20400d=this;setInterval(function(){_0x20400d['syncCampaigns']();},0x7cf);};Preview[_0xa25f('0xf')][_0xa25f('0x67')]=function(){var _0x36afe4=this['campaignsPreview'];this[_0xa25f('0x17')]+=0x1;for(var _0x1eaa67 in _0x36afe4){if(_0x36afe4[_0xa25f('0x68')](_0x1eaa67)&&(_0x36afe4[_0x1eaa67][_0xa25f('0x69')]==='preview'||_0x36afe4[_0x1eaa67][_0xa25f('0x69')]===_0xa25f('0x6a'))&&_0x36afe4[_0x1eaa67][_0xa25f('0x26')]===_0xa25f('0x27')){if(this[_0xa25f('0x17')]>0x7){this[_0xa25f('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x36afe4[_0xa25f('0x68')](_0x1eaa67)&&_0x36afe4[_0x1eaa67][_0xa25f('0x69')]==='preview'&&_0x36afe4[_0x1eaa67][_0xa25f('0x26')]===_0xa25f('0x27')){if(_0x36afe4[_0x1eaa67][_0xa25f('0x32')]){this[_0xa25f('0x6b')](_0x36afe4[_0x1eaa67]);if(_0x36afe4[_0x1eaa67][_0xa25f('0x6c')])this[_0xa25f('0x6d')](_0x36afe4[_0x1eaa67]);}else{notSendMessagesQueue(_0x36afe4[_0x1eaa67]);}}}};Preview[_0xa25f('0xf')][_0xa25f('0x6e')]=function(_0x1c355f){var _0xcd8e19=this;this[_0xa25f('0x13')][_0xa25f('0x10')](function(){if(!_[_0xa25f('0x6f')](_0xcd8e19['actions'][_0x1c355f])){loggerAction[_0xa25f('0x59')](_0xa25f('0x70'),_0x1c355f,_0xa25f('0x71'),_0xcd8e19[_0xa25f('0x72')][_0x1c355f]['queue'],_0xa25f('0x73'),JSON[_0xa25f('0x5a')](_0xcd8e19[_0xa25f('0x14')][_0xcd8e19['actions'][_0x1c355f][_0xa25f('0x74')]][_0xa25f('0x4b')]),_0xa25f('0x75'),JSON[_0xa25f('0x5a')](_0xcd8e19[_0xa25f('0x14')][_0xcd8e19[_0xa25f('0x72')][_0x1c355f][_0xa25f('0x74')]][_0xa25f('0x5f')]),JSON['stringify'](_0xcd8e19[_0xa25f('0x72')][_0x1c355f][_0xa25f('0x76')]),JSON[_0xa25f('0x5a')](_[_0xa25f('0x77')](_0xcd8e19[_0xa25f('0x72')][_0x1c355f],[_0xa25f('0x78'),_0xa25f('0x79'),_0xa25f('0x7a'),_0xa25f('0x7b')])));return ami[_0xa25f('0x7c')]({'action':_0xa25f('0x7d'),'channel':_0xcd8e19[_0xa25f('0x72')][_0x1c355f][_0xa25f('0x7e')]})[_0xa25f('0x7f')](function(_0x8249db){if(_0x8249db[_0xa25f('0x60')]===_0xa25f('0x80')){setTimeout(function(){if(_0xcd8e19[_0xa25f('0x72')][_0x1c355f]){ut[_0xa25f('0x81')](_0xcd8e19[_0xa25f('0x14')][_0xcd8e19[_0xa25f('0x72')][_0x1c355f][_0xa25f('0x74')]],'[clearZombieChannel]');if(_0xcd8e19[_0xa25f('0x72')][_0x1c355f][_0xa25f('0x76')]===!![]){ut[_0xa25f('0x82')](_0xcd8e19[_0xa25f('0x14')][_0xcd8e19['actions'][_0x1c355f][_0xa25f('0x74')]],'[clearZombieChannel]');ut[_0xa25f('0x83')]('[Dialer][checkChannel][pTalking][Preview]'+_0x1c355f,_0xcd8e19['actions'][_0x1c355f][_0xa25f('0x74')]);}ut[_0xa25f('0x83')](_0xa25f('0x84')+_0x1c355f,_0xcd8e19[_0xa25f('0x72')][_0x1c355f][_0xa25f('0x74')]);delete _0xcd8e19[_0xa25f('0x72')][_0x1c355f];}},0x2328);}});}});};Preview[_0xa25f('0xf')][_0xa25f('0x85')]=function(){var _0x2687ce=this;loggerAction[_0xa25f('0x59')](_0xa25f('0x86'),_[_0xa25f('0x87')](this['actions']));for(var _0x2e10d0 in this[_0xa25f('0x72')]){if(_0x2687ce[_0xa25f('0x72')][_0xa25f('0x68')](_0x2e10d0)){_0x2687ce['clearZombieChannel'](_0x2e10d0);}}};Preview[_0xa25f('0xf')]['recallMe']=function(_0x19b74a){var _0x3a32bd=this;rpcDb[_0xa25f('0x88')](_0x19b74a['id'],ut[_0xa25f('0x89')](this['agents']))[_0xa25f('0x8a')](function(_0x2831c3){if(!_[_0xa25f('0x6f')](_0x2831c3)){for(var _0x56c6bf=0x0;_0x56c6bf<_0x2831c3[_0xa25f('0x8b')];_0x56c6bf+=0x1){if(ut['getDiff'](_0x2831c3[_0x56c6bf][_0xa25f('0x8c')])<_0x19b74a['dialRecallMeTimeout']*0x3c){if(_0x2831c3[_0x56c6bf][_0xa25f('0x8d')]&&!_0x2831c3[_0x56c6bf][_0xa25f('0x8d')][_0xa25f('0x8e')]){_0x3a32bd[_0xa25f('0x8f')](_0x2831c3[_0x56c6bf]['id'])[_0xa25f('0x8a')](ut[_0xa25f('0x90')]('[RecallMe]'))[_0xa25f('0x7f')](ut[_0xa25f('0x90')](_0xa25f('0x91')));}else{rpcDb[_0xa25f('0x92')](_0x2831c3[_0x56c6bf]['id']);}}else{var _0x229f26=new Action(_0x2831c3[_0x56c6bf],_0x19b74a);_0x229f26[_0xa25f('0x93')]=moment()[_0xa25f('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x19b74a['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x229f26,0x17,_0xa25f('0x94'));if(_0x19b74a[_0xa25f('0x95')]){rpcDb[_0xa25f('0x96')](ut[_0xa25f('0x97')](_0x2831c3[_0x56c6bf]));rpcDb[_0xa25f('0x98')](_0x229f26,_0xa25f('0x99'));}else{ut[_0xa25f('0x9a')](_0x229f26,0x16,_0xa25f('0x9b'));rpcDb[_0xa25f('0x98')](_0x229f26,_0xa25f('0x9c'));rpcDb[_0xa25f('0x9d')](_0x229f26,'[HistoryRecallClose]');}}}}})[_0xa25f('0x7f')](ut[_0xa25f('0x90')](_0xa25f('0x9e')));};Preview[_0xa25f('0xf')][_0xa25f('0x6b')]=function(_0x5261ce){_0x5261ce[_0xa25f('0x5e')]=!![];if(ut[_0xa25f('0x9f')](_0x5261ce['loggedIn'])){_0x5261ce[_0xa25f('0x60')]=_0xa25f('0xa0');}else if(!ut['isActive'](_0x5261ce[_0xa25f('0x32')])){_0x5261ce[_0xa25f('0x60')]=_0xa25f('0x61');}else if(!this[_0xa25f('0xa1')](_0x5261ce[_0xa25f('0x52')])){if(!this['isTrunkReachable'](_0x5261ce[_0xa25f('0xa2')])){_0x5261ce[_0xa25f('0x60')]=_0xa25f('0xa3');}else{_0x5261ce['message']=_0xa25f('0xa4');}}else{_0x5261ce[_0xa25f('0x60')]=_0xa25f('0xa4');}emitCampaignPreview(_0x5261ce);};Preview['prototype'][_0xa25f('0xa5')]=function(_0x2595a2,_0x23029f,_0x4080ed){var _0x5ae04c=this;var _0x530ece=this[_0xa25f('0x72')][_0x23029f];var _0x30f3fc=this[_0xa25f('0x14')][_0x530ece[_0xa25f('0x74')]];var _0x3f04d2;if(_0x30f3fc){switch(_0x4080ed){case'1':_0x30f3fc[_0xa25f('0xa6')]+=0x1;_0x530ece[_0xa25f('0xa7')]+=0x1;_0x530ece['countglobal']=ut['totalGlobal'](_0x530ece);ut[_0xa25f('0x9a')](_0x530ece,0x0,'NoSuchNumber');ami[_0xa25f('0x5c')](_0xa25f('0xa8'),ut[_0xa25f('0xa9')](_0x530ece,_0xa25f('0xaa')));rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xab'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc['dialGlobalMaxRetry']){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,'Global');rpcDb[_0xa25f('0x9d')](_0x3f04d2,_0xa25f('0xae'));}else{if(_0x530ece[_0xa25f('0xa7')]>=_0x30f3fc[_0xa25f('0xaf')]){rpcDb[_0xa25f('0x9d')](_0x530ece,_0xa25f('0xae'));}else{rpcDb[_0xa25f('0xb0')](ut[_0xa25f('0xb1')](_0x530ece,_0xa25f('0xa7'),_0x30f3fc[_0xa25f('0xb2')]),_0x530ece[_0xa25f('0xb3')],_0x530ece[_0xa25f('0xb4')]);}}delete this[_0xa25f('0x72')][_0x2595a2[_0xa25f('0xb5')]];break;case _0xa25f('0xb6'):var _0x3c6d50=moment()[_0xa25f('0x57')](_0xa25f('0xb7'));_0x530ece[_0xa25f('0xb8')]=_0x3c6d50;_0x530ece[_0xa25f('0xb9')]=_0x3c6d50;_0x530ece['dialAnswer']=!![];_0x30f3fc[_0xa25f('0x5f')]+=0x1;logger['info'](_0xa25f('0xba'),_0x530ece[_0xa25f('0xbb')],_0xa25f('0xbc'),_0x30f3fc[_0xa25f('0x56')],_0xa25f('0x75'),_0x30f3fc[_0xa25f('0x5f')]);ami[_0xa25f('0x5c')]('custom:agentconnect',ut[_0xa25f('0xa9')](_0x530ece,_0xa25f('0xbd'),this[_0xa25f('0x14')][_0x530ece[_0xa25f('0x74')]]));if(_0x30f3fc[_0xa25f('0xbe')]){ami[_0xa25f('0x5c')](_0xa25f('0xbf'),ut[_0xa25f('0xc0')](_0x530ece));}break;case'16':ami[_0xa25f('0x5c')](_0xa25f('0xc1'),ut['buildObj'](_0x530ece,_0xa25f('0xc2'),this[_0xa25f('0x14')][_0x530ece[_0xa25f('0x74')]]));emitVoiceQueueChannelRemove(ut[_0xa25f('0xa9')](_0x530ece,'complete'));_0x30f3fc[_0xa25f('0xc3')]+=0x1;_0x30f3fc[_0xa25f('0xc4')]+=0x1;_0x30f3fc[_0xa25f('0x29')]+=0x1;ut[_0xa25f('0x82')](_0x30f3fc,_0xa25f('0xc5'));_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut[_0xa25f('0x9a')](_0x530ece,0x4,'Answer');rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xc7'));rpcDb[_0xa25f('0x9d')](_0x530ece,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xa25f('0xc8')](_0x530ece);_0x30f3fc[_0xa25f('0x2d')]+=_0x530ece[_0xa25f('0xc9')];_0x30f3fc[_0xa25f('0x2c')]+=_0x530ece['talktime'];logger['info'](_0xa25f('0xca'),_0x530ece[_0xa25f('0xbb')],_0xa25f('0xbc'),_0x30f3fc['name'],_0xa25f('0x75'),_0x30f3fc[_0xa25f('0x5f')]);delete this['actions'][_0x2595a2[_0xa25f('0xb5')]];break;case _0xa25f('0xcb'):_0x30f3fc['outboundBusyCallsDay']+=0x1;_0x530ece[_0xa25f('0xcc')]+=0x1;_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut['logCustomer'](_0x530ece,0x5,_0xa25f('0xcd'));ami[_0xa25f('0x5c')]('custom:agentbusy',ut[_0xa25f('0xa9')](_0x530ece,_0xa25f('0xce')));rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xcf'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc[_0xa25f('0xd0')]){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,'Global');rpcDb['createCustomerFinal'](_0x3f04d2,_0xa25f('0xd1'));}else{if(_0x530ece[_0xa25f('0xcc')]>=_0x30f3fc[_0xa25f('0xd2')]){rpcDb[_0xa25f('0x9d')](_0x530ece,_0xa25f('0xcf'));}else{rpcDb['rescheduleContact'](ut[_0xa25f('0xb1')](_0x530ece,_0xa25f('0xcc'),_0x30f3fc['dialBusyRetryFrequency']),_0x530ece['unlockAgent'],_0x530ece['activeContact']);}}break;case'NOANSWER':_0x30f3fc[_0xa25f('0x3c')]+=0x1;_0x530ece['countnoanswerretry']+=0x1;_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut['logCustomer'](_0x530ece,0x3,'NoAnswer');ami[_0xa25f('0x5c')](_0xa25f('0xd3'),ut[_0xa25f('0xa9')](_0x530ece,'noanswer'));rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xd4'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc[_0xa25f('0xd0')]){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,_0xa25f('0xd5'));rpcDb['createCustomerFinal'](_0x3f04d2,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x530ece[_0xa25f('0xd6')]>=_0x30f3fc[_0xa25f('0xd7')]){rpcDb[_0xa25f('0x9d')](_0x530ece,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xa25f('0xb0')](ut[_0xa25f('0xb1')](_0x530ece,_0xa25f('0xd6'),_0x30f3fc[_0xa25f('0xd8')]),_0x530ece[_0xa25f('0xb3')],_0x530ece['activeContact']);}}break;case _0xa25f('0xd9'):_0x30f3fc['outboundCongestionCallsDay']+=0x1;_0x530ece[_0xa25f('0xda')]+=0x1;_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut[_0xa25f('0x9a')](_0x530ece,0x8,_0xa25f('0xdb'));ami[_0xa25f('0x5c')](_0xa25f('0xdc'),ut['buildObj'](_0x530ece,_0xa25f('0xdd')));rpcDb['createCustomerHistory'](_0x530ece,_0xa25f('0xde'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc[_0xa25f('0xd0')]){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,_0xa25f('0xd5'));rpcDb[_0xa25f('0x9d')](_0x3f04d2,_0xa25f('0xdf'));}else{if(_0x530ece['countcongestionretry']>=_0x30f3fc[_0xa25f('0xe0')]){rpcDb[_0xa25f('0x9d')](_0x530ece,_0xa25f('0xde'));}else{rpcDb[_0xa25f('0xb0')](ut[_0xa25f('0xb1')](_0x530ece,_0xa25f('0xda'),_0x30f3fc[_0xa25f('0xe1')]),_0x530ece[_0xa25f('0xb3')],_0x530ece[_0xa25f('0xb4')]);}}break;case _0xa25f('0xe2'):_0x30f3fc['outboundRejectCallsDay']+=0x1;_0x530ece['countagentrejectretry']+=0x1;_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut[_0xa25f('0x9a')](_0x530ece,0x14,'AgentReject');ami[_0xa25f('0x5c')](_0xa25f('0xe3'),ut['buildObj'](_0x530ece,_0xa25f('0xe4')));rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xe5'));if(ut['totalGlobal'](_0x530ece)>=_0x30f3fc[_0xa25f('0xd0')]){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0x14,_0xa25f('0xe6'));rpcDb[_0xa25f('0x9d')](_0x3f04d2,_0xa25f('0xe7'));}else{if(_0x530ece[_0xa25f('0xe8')]>=_0x30f3fc[_0xa25f('0xe9')]){rpcDb['createCustomerFinal'](_0x530ece,_0xa25f('0xe7'));}else{rpcDb[_0xa25f('0xb0')](ut[_0xa25f('0xb1')](_0x530ece,_0xa25f('0xe8'),_0x30f3fc['dialAgentRejectRetryFrequency']),_0x530ece[_0xa25f('0xb3')],_0x530ece[_0xa25f('0xb4')]);}}break;case'ABANDONED':_0x30f3fc['outboundAbandonedCallsDay']+=0x1;_0x530ece['countabandonedretry']+=0x1;_0x530ece['countglobal']=ut[_0xa25f('0xac')](_0x530ece);ut[_0xa25f('0x9a')](_0x530ece,0xb,'Abandoned');rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xea'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc['dialGlobalMaxRetry']){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,_0xa25f('0xd5'));rpcDb[_0xa25f('0x9d')](_0x3f04d2,_0xa25f('0xea'));}else{if(_0x530ece[_0xa25f('0xeb')]>=_0x30f3fc[_0xa25f('0xec')]){rpcDb['createCustomerFinal'](_0x530ece,_0xa25f('0xea'));}else{rpcDb['rescheduleContact'](ut[_0xa25f('0xb1')](_0x530ece,_0xa25f('0xed'),_0x30f3fc[_0xa25f('0xee')]),_0x530ece[_0xa25f('0xb3')],_0x530ece[_0xa25f('0xb4')]);}}break;case'18':_0x30f3fc[_0xa25f('0x40')]+=0x1;_0x530ece[_0xa25f('0xef')]+=0x1;_0x530ece['countglobal']=ut[_0xa25f('0xac')](_0x530ece);ut[_0xa25f('0x9a')](_0x530ece,0x12,_0x2595a2[_0xa25f('0xf0')]||_0x2595a2[_0xa25f('0xf1')]);ami[_0xa25f('0x5c')](_0xa25f('0xf2'),ut[_0xa25f('0xa9')](_0x530ece,'amd'));rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xf3'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc[_0xa25f('0xd0')]){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,_0xa25f('0xd5'));rpcDb['createCustomerFinal'](_0x3f04d2,_0xa25f('0xf3'));}else{rpcDb[_0xa25f('0x9d')](_0x530ece,_0xa25f('0xf3'));}delete this[_0xa25f('0x72')][_0x2595a2[_0xa25f('0xb5')]];break;case'19':_0x30f3fc['outboundUnknownCallsDay']+=0x1;_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut['logCustomer'](_0x530ece,0x13,_0x2595a2[_0xa25f('0xf0')]||_0x2595a2[_0xa25f('0xf1')]);ami[_0xa25f('0x5c')](_0xa25f('0xf2'),ut[_0xa25f('0xa9')](_0x530ece,_0xa25f('0xf4')));rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xf5'));if(ut['totalGlobal'](_0x530ece)>=_0x30f3fc['dialGlobalMaxRetry']){_0x3f04d2=ut['cloneAction'](_0x530ece,0xf,_0xa25f('0xd5'));rpcDb[_0xa25f('0x9d')](_0x3f04d2,_0xa25f('0xf5'));}else{rpcDb['createCustomerFinal'](_0x530ece,_0xa25f('0xf5'));}delete this[_0xa25f('0x72')][_0x2595a2[_0xa25f('0xb5')]];break;default:if(_0x530ece[_0xa25f('0x76')]){ut[_0xa25f('0x82')](_0x30f3fc,_0xa25f('0xf6'));ut[_0xa25f('0x83')](_0xa25f('0xf7')+_0x30f3fc[_0xa25f('0x56')],_0x2595a2);}_0x30f3fc[_0xa25f('0x40')]+=0x1;_0x530ece[_0xa25f('0xc6')]=ut[_0xa25f('0xac')](_0x530ece);ut['logCustomer'](_0x530ece,0xc,_0x2595a2[_0xa25f('0xf0')]||_0x2595a2[_0xa25f('0xf1')]);rpcDb[_0xa25f('0x98')](_0x530ece,_0xa25f('0xf8'));if(ut[_0xa25f('0xac')](_0x530ece)>=_0x30f3fc[_0xa25f('0xd0')]){_0x3f04d2=ut[_0xa25f('0xad')](_0x530ece,0xf,_0xa25f('0xd5'));rpcDb[_0xa25f('0x9d')](_0x3f04d2,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xa25f('0x9d')](_0x530ece,_0xa25f('0xf9'));}delete this['actions'][_0x2595a2[_0xa25f('0xb5')]];}if(!(_0x530ece[_0xa25f('0x76')]&&_0x4080ed==='16')){ut[_0xa25f('0x81')](_0x30f3fc,_0xa25f('0xfa'));logger[_0xa25f('0x59')](_0xa25f('0xfb'),_0x530ece[_0xa25f('0xbb')],_0xa25f('0xbc'),_0x30f3fc[_0xa25f('0x56')],_0xa25f('0x73'),_0x30f3fc['originated']);}if(_0x4080ed!==_0xa25f('0xb6')){delete this[_0xa25f('0x72')][_0x2595a2[_0xa25f('0xb5')]];delete this[_0xa25f('0x72')][_0x2595a2[_0xa25f('0xfc')]];}}};Preview['prototype'][_0xa25f('0xfd')]=function(_0x2c1956,_0x4f1f69,_0x40d1f3){if(_['isUndefined'](_0x4f1f69)&&_0xa25f('0xfe')!==typeof _0x4f1f69){return;}if(_[_0xa25f('0xff')](_0x40d1f3)&&_0xa25f('0xfe')!==typeof _0x40d1f3){return;}switch(_0x40d1f3[_0xa25f('0x100')]){case'0':ut['logAgent'](_0x2c1956,0x0,_0xa25f('0x101'));rpcDb['createAgentHistory'](_0x2c1956,_0xa25f('0x102'));break;case'3':ut['logAgent'](_0x2c1956,0x3,_0xa25f('0x103'));rpcDb[_0xa25f('0x104')](_0x2c1956,_0xa25f('0x105'));break;case'5':ut[_0xa25f('0x106')](_0x2c1956,0x5,_0xa25f('0xcd'));rpcDb[_0xa25f('0x104')](_0x2c1956,_0xa25f('0x107'));break;case'8':ut['logAgent'](_0x2c1956,0x8,_0xa25f('0xdb'));rpcDb[_0xa25f('0x104')](_0x2c1956,_0xa25f('0x108'));break;case'22':ut[_0xa25f('0x106')](_0x2c1956,0x16,_0xa25f('0x109'));rpcDb['createAgentHistory'](_0x2c1956,_0xa25f('0x10a'));break;default:ut['logAgent'](_0x2c1956,0xc,_0x40d1f3[_0xa25f('0x100')]);rpcDb[_0xa25f('0x104')](_0x2c1956,_0xa25f('0x108'));}ut[_0xa25f('0x81')](_0x4f1f69,_0xa25f('0x10b'));logger[_0xa25f('0x59')](_0xa25f('0x10c'),_0x2c1956[_0xa25f('0xbb')],_0xa25f('0xbc'),_0x4f1f69[_0xa25f('0x56')],_0xa25f('0x73'),_0x4f1f69[_0xa25f('0x4b')]);delete this['actions'][_0x2c1956[_0xa25f('0xbb')]];};Preview[_0xa25f('0xf')][_0xa25f('0x10d')]=function(_0x5b23cd,_0x6b27d0,_0xa25c81,_0x5de7c7,_0x38bd40){var _0x12a5aa=this;return new BPromise(function(_0x240117,_0x5c2bec){if(_[_0xa25f('0x6f')](_0x6b27d0)||_[_0xa25f('0x6f')](_0x6b27d0[_0xa25f('0x10e')])||_[_0xa25f('0x6f')](_0x6b27d0['Contact']['phone'])||_[_0xa25f('0x6f')](_0x6b27d0['VoiceQueueId'])){_0x5c2bec(ut['message'](_0xa25f('0x10f'),_0x5de7c7,_0x38bd40));return;}var _0x38af87=uuid['v4']();var _0x56d946=_0x12a5aa[_0xa25f('0x14')][_0x6b27d0[_0xa25f('0x71')][_0xa25f('0x56')]];var _0x5d50a9=_0xa25c81?_0x12a5aa['agents'][_0xa25c81]['id']:undefined;_0x12a5aa[_0xa25f('0x72')][_0x38af87]=new Action(_0x6b27d0,_0x56d946,_0x38af87,_0xa25c81,_0x5d50a9);var _0x39d20a=_0x12a5aa[_0xa25f('0x72')][_0x38af87];_0x39d20a[_0xa25f('0xb3')]=_0x5de7c7;_0x39d20a[_0xa25f('0xb4')]=_0x38bd40;_0x39d20a['lookAgent']=_0xa25c81;if(_['isEmpty'](_0x5b23cd)){_0x12a5aa['execCall'](_0x39d20a,_0x56d946,_0x6b27d0,_0xa25c81)[_0xa25f('0x8a')](function(_0x407930){logger['info'](_0xa25f('0x110'),_0xa25f('0x111')+_0x39d20a['queue']+_0xa25f('0x112')+_0x39d20a['idContact'],JSON['stringify'](_0x407930));ami[_0xa25f('0x5c')](_0xa25f('0x113'),ut['buildObj'](_0x39d20a,_0xa25f('0x114'),_0x12a5aa[_0xa25f('0x14')][_0x39d20a['queue']]));_0x240117(ut[_0xa25f('0x60')](_0xa25f('0x115')));})['catch'](function(_0x429ebe){ut[_0xa25f('0x62')](_0xa25f('0x116'),_0x429ebe);_0x5c2bec(ut[_0xa25f('0x60')](_0xa25f('0x117'),_0x5de7c7,_0x38bd40));});}else{_0x56d946[_0xa25f('0x37')]+=0x1;ut[_0xa25f('0x118')](_0x39d20a);rpcDb[_0xa25f('0x119')](_0x39d20a,_0xa25f('0x11a'));delete _0x12a5aa[_0xa25f('0x72')][_0x38af87];_0x5c2bec(ut[_0xa25f('0x60')](_0xa25f('0x11b'),_0x5de7c7,_0x38bd40));}});};Preview[_0xa25f('0xf')][_0xa25f('0xa1')]=function(_0x3bb91a){return!_[_0xa25f('0x6f')](_0x3bb91a)&&!_[_0xa25f('0x6f')](_0x3bb91a[_0xa25f('0x56')])&&!_[_0xa25f('0x6f')](_0x3bb91a[_0xa25f('0x53')])&&_0x3bb91a['active']&&!_['isNil'](this[_0xa25f('0x15')][util['format']('SIP/%s',_0x3bb91a['name'])])&&!_[_0xa25f('0x6f')](this['trunks'][util[_0xa25f('0x57')]('SIP/%s',_0x3bb91a[_0xa25f('0x56')])][_0xa25f('0x7d')])&&(this['trunks'][util[_0xa25f('0x57')]('SIP/%s',_0x3bb91a[_0xa25f('0x56')])][_0xa25f('0x7d')]===_0xa25f('0x11c')||this[_0xa25f('0x15')][util[_0xa25f('0x57')](_0xa25f('0x11d'),_0x3bb91a['name'])][_0xa25f('0x7d')]===_0xa25f('0x11e'));};Preview['prototype']['run']=function(_0x3a9bc4,_0x1fdf53){var _0x3f3bc4=this;return new BPromise(function(_0x388df7,_0x633467){_0x3f3bc4[_0xa25f('0x11f')](_0x3a9bc4,_0x1fdf53)[_0xa25f('0x8a')](function(_0x32ee6b){_0x388df7(_['pick'](_0x32ee6b,['message']));})[_0xa25f('0x7f')](function(_0x70a40a){if(_0x70a40a[_0xa25f('0x120')]){rpcDb[_0xa25f('0x121')](_0x3a9bc4);}if(_0x70a40a[_0xa25f('0x53')]){rpcDb[_0xa25f('0x92')](_0x3a9bc4);}_0x633467(_[_0xa25f('0x77')](_0x70a40a,[_0xa25f('0x60')]));});});};Preview[_0xa25f('0xf')][_0xa25f('0x11f')]=function(_0x3033d3,_0x1f5b6b){var _0x39e77c=this;return new BPromise(function(_0xa41acd,_0x3f3552){var _0x439310,_0x38371e;rpcDb['getContactPreview'](_0x3033d3)['then'](function(_0x57f5cf){if(!_[_0xa25f('0x6f')](_0x57f5cf[0x0])){_0x38371e=_0x57f5cf[0x0][_0xa25f('0x122')]?![]:!![];_0x439310=_0x57f5cf[0x0]['recallme']?!![]:![];_0x439310=_0x1f5b6b?!![]:_0x439310;}var _0x7125f6=_0x39e77c[_0xa25f('0x123')](_0x57f5cf);if(_0x7125f6[_0xa25f('0x124')]){rpcDb[_0xa25f('0x125')](_['pick'](_0x57f5cf[0x0],[_0xa25f('0x7a'),_0xa25f('0x126')]))[_0xa25f('0x8a')](function(_0x4d9215){_0x39e77c[_0xa25f('0x10d')](_0x4d9215,_0x57f5cf[0x0],_0x1f5b6b,_0x38371e,_0x439310)[_0xa25f('0x8a')](function(_0x37d7d8){_0xa41acd(_0x37d7d8);})[_0xa25f('0x7f')](function(_0x3c8eaa){_0x3f3552(_0x3c8eaa);});})[_0xa25f('0x7f')](function(_0xe53aec){ut['logger'](_0xa25f('0x127'),_0xe53aec);_0x3f3552(ut[_0xa25f('0x60')]('Call\x20unsuccessful',_0x38371e,_0x439310));});}else{_0x3f3552(ut[_0xa25f('0x60')](_0x7125f6[_0xa25f('0x60')],_0x38371e,_0x439310));}})[_0xa25f('0x7f')](function(_0x164b62){ut[_0xa25f('0x62')](_0xa25f('0x128'),_0x164b62);_0x3f3552(ut[_0xa25f('0x60')](_0xa25f('0x129'),![],!![]));});});};Preview[_0xa25f('0xf')][_0xa25f('0x123')]=function(_0x2a5692){if(_[_0xa25f('0x6f')](_0x2a5692)||_['isEmpty'](_0x2a5692)||!_['isNil'](_0x2a5692[0x0][_0xa25f('0x8d')])&&_[_0xa25f('0x6f')](_0x2a5692[0x0]['Agent']['name'])){ut[_0xa25f('0x62')]('[Preview][validateContact][Empty\x20Contact]',_0x2a5692);return{'isValid':![],'message':_0xa25f('0x12a')};}var _0x6eea52=this[_0xa25f('0x14')][_0x2a5692[0x0][_0xa25f('0x71')]['name']];_0x6eea52[_0xa25f('0x60')]=_0xa25f('0xa4');if(_[_0xa25f('0x6f')](_0x6eea52)){ut[_0xa25f('0x62')](_0xa25f('0x12b'),_0x6eea52);return{'isValid':![],'message':_0xa25f('0x12c')};}if(!this[_0xa25f('0xa1')](_0x6eea52['Trunk'])){ut[_0xa25f('0x62')](_0xa25f('0x12d'),_0xa25f('0x12e')+_0x6eea52[_0xa25f('0x56')]+_0xa25f('0x12f'));if(!this[_0xa25f('0xa1')](_0x6eea52[_0xa25f('0xa2')])){ut[_0xa25f('0x62')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x6eea52[_0xa25f('0x56')]+_0xa25f('0x130'));return{'isValid':![],'message':_0xa25f('0x131')};}}if(!ut[_0xa25f('0x132')](_0x6eea52[_0xa25f('0x32')])){ut['logger'](_0xa25f('0x133'),_0x6eea52[_0xa25f('0x56')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xa25f('0x12e')+_0x6eea52[_0xa25f('0x56')]+_0xa25f('0x134')};}return{'isValid':!![],'message':_0xa25f('0x135')};};Preview[_0xa25f('0xf')][_0xa25f('0x136')]=function(_0x37ec20,_0x59e4d2,_0x1a2150,_0x2c9624){var _0x3f239d=this;return new BPromise(function(_0x5e69fd,_0xbc76eb){var _0x22dd9a=_0x37ec20[_0xa25f('0xbb')];var _0xaa86f8=_0x3f239d[_0xa25f('0xa1')](_0x59e4d2[_0xa25f('0x52')])?util[_0xa25f('0x57')](_0xa25f('0x137'),_0x59e4d2[_0xa25f('0x52')]['name'],_[_0xa25f('0x6f')](_0x59e4d2[_0xa25f('0x35')])?'':_0x59e4d2[_0xa25f('0x35')][_0xa25f('0x138')]()||'',_0x59e4d2[_0xa25f('0x139')]>0x0?_0x1a2150['Contact']['phone']['substring'](_0x59e4d2[_0xa25f('0x139')]):_0x1a2150[_0xa25f('0x10e')][_0xa25f('0x13a')]):util[_0xa25f('0x57')](_0xa25f('0x137'),_[_0xa25f('0x6f')](_0x59e4d2[_0xa25f('0xa2')])?_0x59e4d2[_0xa25f('0x52')][_0xa25f('0x56')]:_0x59e4d2[_0xa25f('0xa2')][_0xa25f('0x56')],_[_0xa25f('0x6f')](_0x59e4d2['dialPrefix'])?'':_0x59e4d2[_0xa25f('0x35')]['trim']()||'',_0x59e4d2['dialCutDigit']>0x0?_0x1a2150[_0xa25f('0x10e')]['phone']['substring'](_0x59e4d2[_0xa25f('0x139')]):_0x1a2150[_0xa25f('0x10e')][_0xa25f('0x13a')]);var _0x2ddc45=_0x3f239d[_0xa25f('0xa1')](_0x59e4d2[_0xa25f('0x52')])?ut[_0xa25f('0x13b')](_0x59e4d2['Trunk']['callerid'],_0x59e4d2[_0xa25f('0x33')],_0x59e4d2[_0xa25f('0x13c')]>0x0?ut[_0xa25f('0x13d')](_0x59e4d2['dialOriginateCallerIdNumber'],_0x59e4d2[_0xa25f('0x13c')]):_0x59e4d2[_0xa25f('0x34')]):ut[_0xa25f('0x13b')](_[_0xa25f('0x6f')](_0x59e4d2[_0xa25f('0xa2')])?_0x59e4d2[_0xa25f('0x52')][_0xa25f('0x54')]:_0x59e4d2['TrunkBackup']['callerid'],_0x59e4d2[_0xa25f('0x33')],_0x59e4d2[_0xa25f('0x13c')]>0x0?ut[_0xa25f('0x13d')](_0x59e4d2[_0xa25f('0x34')],_0x59e4d2[_0xa25f('0x13c')]):_0x59e4d2[_0xa25f('0x34')]);if(_0x2ddc45){_0x37ec20['originatecalleridname']=ut['extractCalleridName'](_0x2ddc45);_0x37ec20[_0xa25f('0x13e')]=ut[_0xa25f('0x13f')](_0x2ddc45);}var _0x159def=ut[_0xa25f('0x140')](_0x59e4d2,_0x1a2150,_0xaa86f8,_0x2ddc45,_0x22dd9a,_0x37ec20);_['merge'](_0x37ec20,ut[_0xa25f('0x141')](_0x159def));_0x37ec20['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa25f('0x7c')](ut['variablesAction'](_0x37ec20,_0x59e4d2,_0x159def,_0x37ec20['activeContact'],_0x2c9624))['then'](function(_0x121da3){_0x59e4d2[_0xa25f('0x4b')]+=0x1;logger['info'](_0xa25f('0x142'),_0x22dd9a,_0xa25f('0xbc'),_0x59e4d2[_0xa25f('0x56')],_0xa25f('0x73'),_0x59e4d2[_0xa25f('0x4b')]);_0x5e69fd(_0x121da3);})[_0xa25f('0x7f')](function(_0x1988bb){ut[_0xa25f('0x106')](_0x37ec20,0xe,_0xa25f('0x143'));rpcDb[_0xa25f('0x104')](_0x37ec20,'[originateFailure][logOriginateFailure]');_0xbc76eb(_0x1988bb);});});};Preview['prototype'][_0xa25f('0x21')]=function(_0x107c84){if(this[_0xa25f('0x72')][_0x107c84['linkedid']]){this[_0xa25f('0x72')][_0x107c84[_0xa25f('0xb5')]][_0xa25f('0x7e')]=_0x107c84[_0xa25f('0x7e')];}};Preview['prototype'][_0xa25f('0x19')]=function(_0x5ea72a){var _0x18f2c3=this;var _0x3c3d8b=this['actions'][_0x5ea72a[_0xa25f('0x144')]];if(_0x3c3d8b){if(_0x3c3d8b[_0xa25f('0x145')]&&this[_0xa25f('0x16')][_0x3c3d8b[_0xa25f('0x145')]]){ut[_0xa25f('0x146')](_0x3c3d8b,this[_0xa25f('0x16')][_0x3c3d8b[_0xa25f('0x145')]][_0xa25f('0x56')],this[_0xa25f('0x16')][_0x3c3d8b[_0xa25f('0x145')]]['id']);}var _0x426e96=_[_0xa25f('0x147')](_0x3c3d8b);_0x426e96[_0xa25f('0xb8')]=moment()[_0xa25f('0x57')](_0xa25f('0xb7'));var _0x21adbc=_0x18f2c3[_0xa25f('0x14')][_0x3c3d8b[_0xa25f('0x74')]];if(ut['isFailure'](_0x5ea72a[_0xa25f('0x148')])){if(_0x3c3d8b['unlockAgent']){rpcDb[_0xa25f('0x121')](_0x3c3d8b['idContact']);}if(_0x3c3d8b['activeContact']){rpcDb[_0xa25f('0x92')](_0x3c3d8b[_0xa25f('0x149')]);}ami['emit']('custom:agentringnoanswer',ut[_0xa25f('0xa9')](_0x3c3d8b,_0xa25f('0x14a'),this[_0xa25f('0x14')][_0x3c3d8b[_0xa25f('0x74')]]));this['callProgressDetectingAgent'](_0x426e96,_0x21adbc,_0x5ea72a);}else{_0x3c3d8b[_0xa25f('0x93')]=moment()[_0xa25f('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xa25f('0x106')](_0x426e96,0x4,'Answer');rpcDb[_0xa25f('0x104')](_0x426e96,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0xa25f('0x1c')]=function(_0x231125){var _0x337d6a=this;var _0xbecbbd=this[_0xa25f('0x72')][_0x231125['linkedid']];var _0x1dbd1a;if(_0xbecbbd){_0x1dbd1a=this['campaignsPreview'][_0xbecbbd[_0xa25f('0x74')]];logger[_0xa25f('0x59')](_0xa25f('0x14b'),_0x231125[_0xa25f('0xb5')],'\x20Queue',_0x1dbd1a[_0xa25f('0x56')],'pTalking:\x20',_0x1dbd1a[_0xa25f('0x5f')]);}if(this['actions'][_0x231125[_0xa25f('0xb5')]]&&_0x231125[_0xa25f('0xb5')]!==_0x231125['uniqueid']){if(_0x231125['cause']==='16'&&this[_0xa25f('0x72')][_0x231125[_0xa25f('0xb5')]][_0xa25f('0x76')]){this[_0xa25f('0xa5')](_0x231125,_0x231125['linkedid'],_0x231125[_0xa25f('0x14c')]);}else if(this['actions'][_0x231125[_0xa25f('0xb5')]]['dialAnswer']){logger[_0xa25f('0x59')](_0xa25f('0x14d'),_0x231125['linkedid'],_0x231125[_0xa25f('0x14c')],_0xa25f('0xbc'),_0x1dbd1a[_0xa25f('0x56')],_0xa25f('0x75'),_0x1dbd1a[_0xa25f('0x5f')]);this[_0xa25f('0xa5')](_0x231125,_0x231125[_0xa25f('0xb5')],_0x231125[_0xa25f('0x14c')]);}}else if(_0xbecbbd&&_[_0xa25f('0x6f')](_0xbecbbd[_0xa25f('0x14e')])&&_0x1dbd1a[_0xa25f('0x14f')]&&_0x231125[_0xa25f('0xb5')]===_0x231125[_0xa25f('0xbb')]&&_[_0xa25f('0x6f')](_0x231125[_0xa25f('0x100')])&&_0x231125['cause']==='16'&&_0x231125[_0xa25f('0x150')]==='6'&&_[_0xa25f('0xff')](_0xbecbbd['transfer'])){if(_0xbecbbd[_0xa25f('0xb3')]){rpcDb['unlockContact'](_0xbecbbd[_0xa25f('0x149')]);}if(_0xbecbbd[_0xa25f('0xb4')]){rpcDb[_0xa25f('0x92')](_0xbecbbd['idContact']);}_0x231125['reason']='22';this[_0xa25f('0xfd')](_0xbecbbd,_0x1dbd1a,_0x231125);}else if(_0xbecbbd&&_0xbecbbd[_0xa25f('0x151')]){if(_0x231125['cause']==='16'&&this[_0xa25f('0x72')][_0x231125['linkedid']][_0xa25f('0x76')]){logger[_0xa25f('0x59')](_0xa25f('0x152'),_0x231125['linkedid'],_0x231125[_0xa25f('0x14c')],_0xa25f('0xbc'),_0x1dbd1a[_0xa25f('0x56')],_0xa25f('0x75'),_0x1dbd1a[_0xa25f('0x5f')]);this[_0xa25f('0xa5')](_0x231125,_0x231125[_0xa25f('0xb5')],_0x231125[_0xa25f('0x14c')]);}else if(this['actions'][_0x231125['linkedid']][_0xa25f('0x76')]){logger[_0xa25f('0x59')](_0xa25f('0x14d'),_0x231125[_0xa25f('0xb5')],_0x231125[_0xa25f('0x14c')],_0xa25f('0xbc'),_0x1dbd1a[_0xa25f('0x56')],_0xa25f('0x75'),_0x1dbd1a[_0xa25f('0x5f')]);this[_0xa25f('0xa5')](_0x231125,_0x231125['linkedid'],_0x231125[_0xa25f('0x14c')]);}}};Preview['prototype'][_0xa25f('0x1f')]=function(_0x46a2be){if(this[_0xa25f('0x72')][_0x46a2be['destlinkedid']]&&_0x46a2be[_0xa25f('0xfc')]!==_0x46a2be[_0xa25f('0x153')]){this[_0xa25f('0xa5')](_0x46a2be,_0x46a2be[_0xa25f('0xfc')],_0x46a2be[_0xa25f('0xf1')]);}};Preview[_0xa25f('0xf')][_0xa25f('0x1e')]=function(_0x22a046){if(this[_0xa25f('0x72')][_0x22a046[_0xa25f('0xb5')]]&&_0x22a046[_0xa25f('0xb5')]!==_0x22a046[_0xa25f('0xbb')]&&!this[_0xa25f('0x72')][_0x22a046[_0xa25f('0xb5')]][_0xa25f('0x76')]){if(_0x22a046['cause']==='1'){this[_0xa25f('0xa5')](_0x22a046,_0x22a046[_0xa25f('0xb5')],_0x22a046['cause']);}}};Preview['prototype'][_0xa25f('0x154')]=function(_0x5279b1,_0x12bc2d,_0x58f6a7){if(this['actions'][_0x5279b1]){if(_[_0xa25f('0x6f')](this[_0xa25f('0x72')][_0x5279b1][_0xa25f('0x155')])){this['actions'][_0x5279b1][_0xa25f('0x155')]={};}this[_0xa25f('0x72')][_0x5279b1][_0xa25f('0x155')][_0x12bc2d]=_0x58f6a7;}};Preview[_0xa25f('0xf')][_0xa25f('0x156')]=function(_0x2f838c){try{if(!_['isNil'](_0x2f838c)){if(ut[_0xa25f('0x157')](_[_0xa25f('0x158')](_0x2f838c[_0xa25f('0x159')])[0x0])){this[_0xa25f('0x154')](_0x2f838c['uniqueid'],_[_0xa25f('0x158')](_0x2f838c[_0xa25f('0x159')])[0x0],_0x2f838c['value']);}}}catch(_0x58f27f){logger[_0xa25f('0x15a')]('[syncVarSet][Preview]',util[_0xa25f('0x15b')](_0x58f27f,{'showHidden':![],'depth':null}));}};Preview[_0xa25f('0xf')][_0xa25f('0x23')]=function(_0x550909){if(_0x550909){if(this[_0xa25f('0x72')][_0x550909['transfertargetlinkedid']]){this[_0xa25f('0x72')][_0x550909[_0xa25f('0x15c')]][_0xa25f('0x151')]=!![];}}};Preview['prototype'][_0xa25f('0x24')]=function(_0x39b882){if(_0x39b882){if(this[_0xa25f('0x72')][_0x39b882[_0xa25f('0x15d')]]){this['actions'][_0x39b882[_0xa25f('0x15d')]]['transfer']=!![];}}};module[_0xa25f('0x15e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 033552e..dacf3ef 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 _0x6b9c=['membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','resolve','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x6b9c,0xa3));var _0xc6b9=function(_0x22d406,_0x1679dd){_0x22d406=_0x22d406-0x0;var _0x4a1ef9=_0x6b9c[_0x22d406];return _0x4a1ef9;};'use strict';var util=require('util');var BPromise=require(_0xc6b9('0x0'));var logger=require(_0xc6b9('0x1'))(_0xc6b9('0x2'));var _=require('lodash');var cmHopper=require(_0xc6b9('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc6b9('0x4'));var cmHopperBlack=require(_0xc6b9('0x5'));var voiceQueueRt=require(_0xc6b9('0x6'));var agentReportPreview=require(_0xc6b9('0x7'));var voiceQueueReport=require(_0xc6b9('0x8'));function loggerCatch(_0xa95d70){return function(_0x268194){logger[_0xc6b9('0x9')](_0xa95d70,util[_0xc6b9('0xa')](_0x268194,{'showHidden':![],'depth':null}));};}function create(_0x3a5075){return BPromise['resolve']()[_0xc6b9('0xb')](cmHopperHistory[_0xc6b9('0xc')](_0x3a5075))[_0xc6b9('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x4bba07){return BPromise[_0xc6b9('0xe')]()['then'](agentReportPreview[_0xc6b9('0xc')](_0x4bba07))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x49ca32){return BPromise[_0xc6b9('0xe')]()[_0xc6b9('0xb')](cmHopper['moveContactManagedDialer'](_0x49ca32,!![]))[_0xc6b9('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xc6b9('0xf')]=function(_0x132ba0){return BPromise[_0xc6b9('0xe')]()[_0xc6b9('0xb')](cmHopperBlack['checkIsBlackList'](_0x132ba0))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x10')));};exports[_0xc6b9('0x11')]=function(_0x34d1d3){return BPromise[_0xc6b9('0xe')]()['then'](cmHopper[_0xc6b9('0x11')](_0x34d1d3))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x12')));};exports[_0xc6b9('0xc')]=function(_0x50d907,_0x3c76a3){create(_0x50d907)['catch'](loggerCatch(_0x3c76a3));moveContact(_0x50d907)[_0xc6b9('0xd')](loggerCatch(_0x3c76a3));};exports[_0xc6b9('0x13')]=function(_0x443704,_0x385a2b){createAgent(_0x443704)['catch'](loggerCatch(_0x385a2b));};exports[_0xc6b9('0x14')]=function(_0x2a4ace,_0x3217c4){create(_0x2a4ace)['catch'](loggerCatch(_0x3217c4));};exports[_0xc6b9('0x15')]=function(_0x58881d,_0x55d0ea){moveContact(_0x58881d)[_0xc6b9('0xd')](loggerCatch(_0x55d0ea));};exports[_0xc6b9('0x16')]=function(_0x5c514d,_0x2b968a,_0xf67aad){if(_0x2b968a){_0x5c514d[_0xc6b9('0x17')]=null;}if(_0xf67aad){_0x5c514d['active']=![];}return BPromise['resolve']()[_0xc6b9('0xb')](cmHopper[_0xc6b9('0x16')](_0x5c514d))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x18')));};exports['countReScheduled']=function(_0x4bd096){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x4bd096))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x19')));};exports[_0xc6b9('0x1a')]=function(_0x4e9e0e){return BPromise[_0xc6b9('0xe')]()['then'](cmHopper[_0xc6b9('0x1a')]({'UserId':null},_0x4e9e0e,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x537df7){return BPromise['resolve']()[_0xc6b9('0xb')](cmHopper['unlockContact']({'active':![]},_0x537df7,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0xc6b9('0x1b')]=function(_0x4da8bb){var _0x651a6={};_0x651a6[_0xc6b9('0x1c')]=_0x4da8bb[_0xc6b9('0x1c')];_0x651a6['uniqueid']=_0x4da8bb[_0xc6b9('0x1d')];_0x651a6[_0xc6b9('0x1e')]=_0x4da8bb[_0xc6b9('0x1e')];_0x651a6[_0xc6b9('0x1f')]=_0x4da8bb['calleridname'];_0x651a6[_0xc6b9('0x20')]=_0x4da8bb[_0xc6b9('0x20')];_0x651a6[_0xc6b9('0x21')]=_0x4da8bb[_0xc6b9('0x22')];_0x651a6[_0xc6b9('0x23')]=_0x4da8bb[_0xc6b9('0x22')];_0x651a6['queuecallercomplete']=0x1;_0x651a6[_0xc6b9('0x24')]=_0x4da8bb['endtime'];_0x651a6['connectedlinename']=_0x4da8bb[_0xc6b9('0x25')];_0x651a6['context']=_0xc6b9('0x26');_0x651a6[_0xc6b9('0x27')]=_0xc6b9('0x28');_0x651a6[_0xc6b9('0x29')]=0x0;_0x651a6[_0xc6b9('0x2a')]=0x1;_0x651a6[_0xc6b9('0x2b')]=_0x4da8bb[_0xc6b9('0x25')];_0x651a6[_0xc6b9('0x2c')]=_0xc6b9('0x2d');return BPromise[_0xc6b9('0xe')]()[_0xc6b9('0xb')](voiceQueueReport['create'](_0x651a6))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x2e')));};exports[_0xc6b9('0x2f')]=function(_0x753514,_0x1201e8){return BPromise[_0xc6b9('0xe')]()['then'](cmHopper['getContactRecallMe'](_0x753514,_0x1201e8))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x30')));};exports['rescheduleContactInQueue']=function(_0x35ec27){return BPromise[_0xc6b9('0xe')]()[_0xc6b9('0xb')](cmHopper[_0xc6b9('0x16')](_0x35ec27,!![],!![]))[_0xc6b9('0xd')](loggerCatch(_0xc6b9('0x31')));}; \ No newline at end of file +var _0x1919=['active','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact'];(function(_0x25afd9,_0x3777f8){var _0x33fbab=function(_0x3bae79){while(--_0x3bae79){_0x25afd9['push'](_0x25afd9['shift']());}};_0x33fbab(++_0x3777f8);}(_0x1919,0x149));var _0x9191=function(_0x24010d,_0x333d2b){_0x24010d=_0x24010d-0x0;var _0x28ee25=_0x1919[_0x24010d];return _0x28ee25;};'use strict';var util=require(_0x9191('0x0'));var BPromise=require(_0x9191('0x1'));var logger=require(_0x9191('0x2'))('preview');var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x9191('0x3'));var cmHopperHistory=require(_0x9191('0x4'));var cmHopperBlack=require(_0x9191('0x5'));var voiceQueueRt=require(_0x9191('0x6'));var agentReportPreview=require(_0x9191('0x7'));var voiceQueueReport=require(_0x9191('0x8'));function loggerCatch(_0x4b31bb){return function(_0x21ef7e){logger[_0x9191('0x9')](_0x4b31bb,util['inspect'](_0x21ef7e,{'showHidden':![],'depth':null}));};}function create(_0x42e2dd){return BPromise[_0x9191('0xa')]()['then'](cmHopperHistory[_0x9191('0xb')](_0x42e2dd))[_0x9191('0xc')](loggerCatch(_0x9191('0xd')));}function createAgent(_0x3c952c){return BPromise[_0x9191('0xa')]()[_0x9191('0xe')](agentReportPreview[_0x9191('0xb')](_0x3c952c))[_0x9191('0xc')](loggerCatch(_0x9191('0xd')));}function moveContact(_0x63c390){return BPromise[_0x9191('0xa')]()['then'](cmHopper[_0x9191('0xf')](_0x63c390,!![]))['catch'](loggerCatch(_0x9191('0x10')));}exports['checkIsBlackList']=function(_0x328b47){return BPromise[_0x9191('0xa')]()[_0x9191('0xe')](cmHopperBlack[_0x9191('0x11')](_0x328b47))[_0x9191('0xc')](loggerCatch(_0x9191('0x12')));};exports['getContactPreview']=function(_0x1dd0dc){return BPromise['resolve']()[_0x9191('0xe')](cmHopper[_0x9191('0x13')](_0x1dd0dc))[_0x9191('0xc')](loggerCatch(_0x9191('0x14')));};exports[_0x9191('0xb')]=function(_0x184c33,_0x4aa282){create(_0x184c33)[_0x9191('0xc')](loggerCatch(_0x4aa282));moveContact(_0x184c33)[_0x9191('0xc')](loggerCatch(_0x4aa282));};exports[_0x9191('0x15')]=function(_0x4d0857,_0x26fb95){createAgent(_0x4d0857)['catch'](loggerCatch(_0x26fb95));};exports[_0x9191('0x16')]=function(_0xdf67b6,_0x185022){create(_0xdf67b6)[_0x9191('0xc')](loggerCatch(_0x185022));};exports[_0x9191('0x17')]=function(_0x1bb188,_0x44bb0d){moveContact(_0x1bb188)['catch'](loggerCatch(_0x44bb0d));};exports[_0x9191('0x18')]=function(_0x6650d8,_0x5502a1,_0x171747){if(_0x5502a1){_0x6650d8['UserId']=null;}if(_0x171747){_0x6650d8[_0x9191('0x19')]=![];}return BPromise[_0x9191('0xa')]()[_0x9191('0xe')](cmHopper[_0x9191('0x18')](_0x6650d8))['catch'](loggerCatch(_0x9191('0x1a')));};exports['countReScheduled']=function(_0x12fd18){return BPromise[_0x9191('0xa')]()['then'](cmHopper['countReScheduled'](_0x12fd18))['catch'](loggerCatch(_0x9191('0x1b')));};exports[_0x9191('0x1c')]=function(_0x211446){return BPromise['resolve']()[_0x9191('0xe')](cmHopper[_0x9191('0x1c')]({'UserId':null},_0x211446,0x1))['catch'](loggerCatch(_0x9191('0x1d')));};exports[_0x9191('0x1e')]=function(_0x4f7feb){return BPromise['resolve']()[_0x9191('0xe')](cmHopper[_0x9191('0x1c')]({'active':![]},_0x4f7feb,0x1))[_0x9191('0xc')](loggerCatch(_0x9191('0x1f')));};exports['crateCustomerReportQueue']=function(_0x566a0f){var _0x5a9960={};_0x5a9960[_0x9191('0x20')]=_0x566a0f[_0x9191('0x20')];_0x5a9960[_0x9191('0x21')]=_0x566a0f[_0x9191('0x21')];_0x5a9960[_0x9191('0x22')]=_0x566a0f['calleridnum'];_0x5a9960[_0x9191('0x23')]=_0x566a0f['calleridname'];_0x5a9960['queue']=_0x566a0f[_0x9191('0x24')];_0x5a9960[_0x9191('0x25')]=_0x566a0f[_0x9191('0x26')];_0x5a9960[_0x9191('0x27')]=_0x566a0f['answertime'];_0x5a9960[_0x9191('0x28')]=0x1;_0x5a9960[_0x9191('0x29')]=_0x566a0f['endtime'];_0x5a9960[_0x9191('0x2a')]=_0x566a0f['membername'];_0x5a9960[_0x9191('0x2b')]=_0x9191('0x2c');_0x5a9960[_0x9191('0x2d')]=_0x9191('0x2e');_0x5a9960[_0x9191('0x2f')]=0x0;_0x5a9960[_0x9191('0x30')]=0x1;_0x5a9960[_0x9191('0x31')]=_0x566a0f[_0x9191('0x32')];_0x5a9960[_0x9191('0x33')]=_0x9191('0x34');return BPromise[_0x9191('0xa')]()['then'](voiceQueueReport[_0x9191('0x35')](_0x5a9960))['catch'](loggerCatch(_0x9191('0x36')));};exports[_0x9191('0x37')]=function(_0x59b945,_0x37767b){return BPromise[_0x9191('0xa')]()[_0x9191('0xe')](cmHopper[_0x9191('0x37')](_0x59b945,_0x37767b))[_0x9191('0xc')](loggerCatch(_0x9191('0x38')));};exports[_0x9191('0x39')]=function(_0x32de8c){return BPromise['resolve']()['then'](cmHopper[_0x9191('0x18')](_0x32de8c,!![],!![]))[_0x9191('0xc')](loggerCatch(_0x9191('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 bd47cbd..e97ea56 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 _0xd005=['xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','createBody','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd005,0x1c8));var _0x5d00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd005[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x5d00('0x0'));var _=require(_0x5d00('0x1'));var moment=require('moment');var logger=require(_0x5d00('0x2'))(_0x5d00('0x3'));var ipAgi=process[_0x5d00('0x4')][_0x5d00('0x5')]||_0x5d00('0x6');function getSeconds(_0xf9f145,_0x33021a){var _0x38737d=moment(_0xf9f145)['milliseconds'](0x0);var _0x3c1c0c=moment(_0x33021a)[_0x5d00('0x7')](0x0);return _0x38737d[_0x5d00('0x8')](_0x3c1c0c,_0x5d00('0x9'));}exports[_0x5d00('0xa')]=function(_0x27b60c){return function(_0x1932aa){logger[_0x5d00('0xb')](_0x27b60c,util[_0x5d00('0xc')](_0x1932aa,{'showHidden':![],'depth':null}));};};exports[_0x5d00('0xd')]=function(_0x4c3f1d,_0x7ec9e6){logger[_0x5d00('0xe')](_0x4c3f1d,util[_0x5d00('0xc')](_0x7ec9e6,{'showHidden':![],'depth':null}));};exports[_0x5d00('0xf')]=function(_0x1c799f,_0x5cb627){logger[_0x5d00('0xb')](_0x1c799f,util['inspect'](_0x5cb627,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x262705){return function(_0x546985){logger[_0x5d00('0xe')](_0x262705,util[_0x5d00('0xc')](_0x546985,{'showHidden':![],'depth':null}));};};exports[_0x5d00('0x10')]=function(_0x51f25b,_0x28c639,_0x1cb819){return{'message':_0x51f25b,'unlock':_0x28c639,'active':_0x1cb819};};exports[_0x5d00('0x11')]=function(_0x321be5,_0x501ff5,_0x2eb1bc){if(!_[_0x5d00('0x12')](_0x2eb1bc)&&_0x5d00('0x13')===typeof _0x2eb1bc&&!_[_0x5d00('0x14')](_0x2eb1bc)){if(!_[_0x5d00('0x12')](_0x501ff5)&&_0x5d00('0x13')===typeof _0x501ff5&&!_[_0x5d00('0x14')](_0x501ff5)){return util[_0x5d00('0x15')](_0x5d00('0x16'),_0x501ff5,_0x2eb1bc);}return util[_0x5d00('0x15')](_0x5d00('0x16'),_0x2eb1bc,_0x2eb1bc);}if(!_['isUndefined'](_0x321be5)&&_0x5d00('0x13')===typeof _0x321be5&&!_[_0x5d00('0x14')](_0x321be5)){return _0x321be5;}return _0x5d00('0x17');};exports[_0x5d00('0x18')]=function(_0x4c32d5){if(_[_0x5d00('0x19')](_0x4c32d5)){return![];}return _0x4c32d5;};exports['addVariables']=function(_0x46fc2c,_0x361148,_0x3fd542,_0x36e880,_0x2a5acf,_0x4fee01){var _0x1e3931={'XMD-QUEUE':_0x361148['Queue']?_0x361148[_0x5d00('0x1a')][_0x5d00('0x1b')]:'','XMD-CALLERID':_0x36e880,'XMD-CALLERID-PREVIEW':_0x4fee01?util[_0x5d00('0x15')](_0x5d00('0x16'),_0x4fee01[_0x5d00('0x1c')],_0x4fee01['calleridnum']):_0x36e880,'XMD-DIALID':_0x2a5acf,'XMD-CONTACTID':_0x361148['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x36e880,'XMD-VOICEQUEUEID':_0x361148[_0x5d00('0x1d')],'XMD-DIALCHANNEL':_0x3fd542,'XMD-DIALTIMEOUT':_0x46fc2c[_0x5d00('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x5d00('0x15')](_0x5d00('0x1f'),_0x46fc2c[_0x5d00('0x20')]?'g':'',_['isEmpty'](_0x46fc2c[_0x5d00('0x21')])?'':_0x5d00('0x22')),'XMD-DIALURL':_0x46fc2c[_0x5d00('0x23')]||'','XMD-AGI':_0x46fc2c[_0x5d00('0x24')]?util[_0x5d00('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x46fc2c[_0x5d00('0x24')]):'NONE','XMD-AGIAFTER':_0x46fc2c['dialQueueProject2']?util[_0x5d00('0x15')](_0x5d00('0x25'),ipAgi,_0x46fc2c[_0x5d00('0x20')]):_0x5d00('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x4fee01?_0x4fee01[_0x5d00('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x4fee01?_0x4fee01[_0x5d00('0x28')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x5d00('0x29')};if(!_[_0x5d00('0x14')](_0x46fc2c[_0x5d00('0x21')])){_0x1e3931[util[_0x5d00('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x46fc2c['monitor_format'];_0x1e3931[util[_0x5d00('0x15')]('%s',_0x5d00('0x2a'))]=_0x2a5acf;}if(_0x361148&&_0x361148[_0x5d00('0x2b')]){for(var _0x2b725a in _0x361148['Contact']){if(_0x361148[_0x5d00('0x2b')][_0x5d00('0x2c')](_0x2b725a)){if(!_[_0x5d00('0x19')](_0x361148[_0x5d00('0x2b')][_0x2b725a])&&_0x2b725a!=='id'&&_0x2b725a!==_0x5d00('0x2d')&&_0x2b725a!==_0x5d00('0x2e')&&_0x2b725a!=='updatedAt'){_0x1e3931[util[_0x5d00('0x15')](_0x5d00('0x2f'),'XMD-',_['toUpper'](_0x2b725a))]=_0x361148[_0x5d00('0x2b')][_0x2b725a];}}}}return _0x1e3931;};exports['toLowerVariables']=function(_0x6c8ce1){var _0x47e2d9={};for(var _0x1514ab in _0x6c8ce1){if(_0x6c8ce1[_0x5d00('0x2c')](_0x1514ab)){_0x47e2d9[util[_0x5d00('0x15')]('%s',_['toLower'](_0x1514ab))]=_0x6c8ce1[_0x1514ab];}}return{'variables':_0x47e2d9};};exports[_0x5d00('0x30')]=function(_0x59859a,_0x25274f){if(!_[_0x5d00('0x19')](_0x59859a)){if(_0x59859a[_0x5d00('0x2c')](_0x5d00('0x31'))){if(_0x59859a[_0x5d00('0x31')]>0x0){_0x59859a[_0x5d00('0x31')]-=0x1;}else{logger[_0x5d00('0xb')](_0x5d00('0x32'),_0x25274f);}}}else{logger[_0x5d00('0xb')](_0x5d00('0x33'),_0x25274f);}};exports['logBlacklist']=function(_0x3cfc6f){var _0xca1d40=moment()['format'](_0x5d00('0x34'));_0x3cfc6f[_0x5d00('0x35')]=0xd;_0x3cfc6f[_0x5d00('0x36')]=_0x5d00('0x37');_0x3cfc6f[_0x5d00('0x38')]=_0xca1d40;_0x3cfc6f[_0x5d00('0x39')]=_0xca1d40;_0x3cfc6f[_0x5d00('0x3a')]=_0xca1d40;};exports[_0x5d00('0x3b')]=function(_0x22e355,_0x42fb50,_0x4630e9){var _0x4cfb77=moment()[_0x5d00('0x15')](_0x5d00('0x34'));_0x22e355[_0x5d00('0x35')]=_0x42fb50;_0x22e355[_0x5d00('0x36')]=_0x4630e9;_0x22e355[_0x5d00('0x39')]=_0x4cfb77;_0x22e355[_0x5d00('0x3c')]=getSeconds(_0x22e355['responsetime'],_0x22e355['starttime']);};exports[_0x5d00('0x3d')]=function(_0x579bbc,_0x3af752,_0x5b1815){_0x579bbc[_0x5d00('0x3e')]=_0x3af752;_0x579bbc['UserId']=_0x5b1815;};exports['logCustomer']=function(_0x39a2bc,_0xa3230a,_0x3fc204){var _0x2c1ce1=moment()[_0x5d00('0x15')](_0x5d00('0x34'));_0x39a2bc['state']=_0xa3230a;_0x39a2bc['statedesc']=_0x3fc204;_0x39a2bc[_0x5d00('0x39')]=_0x39a2bc['responsetime']?_0x39a2bc[_0x5d00('0x39')]:_0x2c1ce1;_0x39a2bc['endtime']=_0x39a2bc[_0x5d00('0x3a')]?_0x39a2bc['endtime']:_0x2c1ce1;_0x39a2bc[_0x5d00('0x3c')]=getSeconds(_0x39a2bc[_0x5d00('0x39')]||0x0,_0x39a2bc[_0x5d00('0x38')]||0x0);_0x39a2bc[_0x5d00('0x3f')]=_0x39a2bc[_0x5d00('0x40')]?getSeconds(_0x39a2bc[_0x5d00('0x3a')],_0x39a2bc[_0x5d00('0x40')]):0x0;};exports[_0x5d00('0x41')]=function(_0x2010f6){return _0x2010f6===_0x5d00('0x42');};exports[_0x5d00('0x43')]=function(_0x55792d,_0x2d8744,_0x25e20e,_0x24697d,_0x270a31){var _0x4ed266=_0x24697d?_0x5d00('0x44'):_0x55792d[_0x5d00('0x1c')];_0x4ed266=_0x270a31?_0x5d00('0x45'):_0x4ed266;return{'actionid':_0x55792d[_0x5d00('0x46')],'action':_0x5d00('0x47'),'channel':_0x55792d[_0x5d00('0x48')],'callerid':util[_0x5d00('0x15')](_0x5d00('0x16'),_0x4ed266,_0x55792d[_0x5d00('0x49')]),'Exten':_0x5d00('0x4a'),'Context':'from-sip','Priority':'1','variable':_0x25e20e,'timeout':(_0x2d8744[_0x5d00('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55792d[_0x5d00('0x46')]};};exports[_0x5d00('0x4c')]=function(_0x2a1f68){return _0x2a1f68[_0x5d00('0x4d')]+_0x2a1f68[_0x5d00('0x4e')]+_0x2a1f68[_0x5d00('0x4f')]+_0x2a1f68[_0x5d00('0x50')]+_0x2a1f68[_0x5d00('0x51')];};exports['cloneAction']=function(_0x2ee725){var _0x35fc2e=_[_0x5d00('0x52')](_0x2ee725);_0x35fc2e[_0x5d00('0x35')]=0xf;_0x35fc2e['statedesc']=_0x5d00('0x53');return _0x35fc2e;};exports[_0x5d00('0x54')]=function(_0x456fac,_0x47f037,_0x4848f6){var _0x27aacd={};_0x27aacd[_0x47f037]=_0x456fac[_0x47f037];_0x27aacd[_0x5d00('0x55')]=![];_0x27aacd[_0x5d00('0x56')]=moment()['add'](_0x4848f6,_0x5d00('0x57'))[_0x5d00('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x27aacd[_0x5d00('0x58')]=_0x456fac['ContactId'];_0x27aacd['ListId']=_0x456fac[_0x5d00('0x59')];_0x27aacd[_0x5d00('0x1d')]=_0x456fac['VoiceQueueId']||undefined;return _0x27aacd;};exports['decrementTalkink']=function(_0x5d0fd4,_0x11a47d){if(!_[_0x5d00('0x19')](_0x5d0fd4)){if(_0x5d0fd4[_0x5d00('0x5a')]>0x0){_0x5d0fd4['pTalking']-=0x1;}else{logger[_0x5d00('0xb')](_0x11a47d,_0x5d00('0x5b'));}}else{logger['error'](_0x11a47d,_0x5d00('0x5c'));}};exports[_0x5d00('0x5d')]=function(_0x54635c){if(_0x54635c<=0x0){return!![];}return![];};exports[_0x5d00('0x5e')]=function(_0xeb26a,_0x533cc1,_0x4775c6){_0xeb26a[_0x5d00('0x5f')]=_0x533cc1;_0xeb26a[_0x5d00('0x1b')]=_0xeb26a[_0x5d00('0x60')];_0xeb26a[_0x5d00('0x61')]=_0xeb26a[_0x5d00('0x48')];_0xeb26a[_0x5d00('0x62')]=_0x5d00('0x63');if(_0x4775c6){_0xeb26a[_0x5d00('0x64')]=_0x4775c6[_0x5d00('0x64')];}return _0xeb26a;};exports[_0x5d00('0x65')]=function(_0x537806){var _0x5d2b17={};_0x5d2b17['queue']=_0x537806[_0x5d00('0x60')];_0x5d2b17[_0x5d00('0x61')]=_0x537806['channelAgent'];_0x5d2b17[_0x5d00('0x46')]=_0x537806[_0x5d00('0x46')];return _0x5d2b17;};exports[_0x5d00('0x66')]=function(_0x36a34d){var _0x2082b6=[];for(var _0x360f3a in _0x36a34d){if(_0x36a34d[_0x5d00('0x2c')](_0x360f3a)){if(!_[_0x5d00('0x19')](_0x36a34d[_0x360f3a])&&_0x36a34d[_0x360f3a][_0x5d00('0x35')]===_0x5d00('0x67')&&_0x36a34d[_0x360f3a][_0x5d00('0x68')]===_0x5d00('0x69')){_0x2082b6[_0x5d00('0x6a')](_0x36a34d[_0x360f3a]['id']);}}}return _0x2082b6;};exports['getDiff']=function(_0x4ad1ee){var _0x247d55=moment()[_0x5d00('0x7')](0x0);var _0x550e2c=moment(_0x4ad1ee)['milliseconds'](0x0);return _0x247d55['diff'](_0x550e2c,_0x5d00('0x9'));};exports[_0x5d00('0x6b')]=function(_0x3fbee6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fbee6[_0x5d00('0x58')],'ListId':_0x3fbee6['ListId'],'VoiceQueueId':_0x3fbee6[_0x5d00('0x1d')]||undefined,'CampaignId':_0x3fbee6['CampaignId']||undefined};};exports[_0x5d00('0x6c')]=function(_0x787c18){if(_0x787c18===_0x5d00('0x46')||_0x787c18===_0x5d00('0x6d')||_0x787c18===_0x5d00('0x60')||_0x787c18===_0x5d00('0x6e')||_0x787c18===_0x5d00('0x6f')||_0x787c18===_0x5d00('0x70')||_0x787c18==='membername'||_0x787c18===_0x5d00('0x48')||_0x787c18==='calleridname'||_0x787c18===_0x5d00('0x55')||_0x787c18===_0x5d00('0x49')||_0x787c18===_0x5d00('0x56')||_0x787c18==='countbusyretry'||_0x787c18===_0x5d00('0x4e')||_0x787c18===_0x5d00('0x4f')||_0x787c18==='countglobal'||_0x787c18===_0x5d00('0x71')||_0x787c18===_0x5d00('0x72')||_0x787c18==='callbackat'||_0x787c18===_0x5d00('0x73')||_0x787c18===_0x5d00('0x58')||_0x787c18===_0x5d00('0x59')||_0x787c18===_0x5d00('0x74')||_0x787c18===_0x5d00('0x1d')||_0x787c18===_0x5d00('0x75')||_0x787c18===_0x5d00('0x76')||_0x787c18===_0x5d00('0x77')||_0x787c18==='xmd-phone'||_0x787c18===_0x5d00('0x78')||_0x787c18===_0x5d00('0x79')||_0x787c18==='xmd-dialtimeout'||_0x787c18==='xmd-dialoptions'||_0x787c18===_0x5d00('0x7a')||_0x787c18===_0x5d00('0x7b')||_0x787c18===_0x5d00('0x7c')||_0x787c18===_0x5d00('0x7d')||_0x787c18===_0x5d00('0x7e')||_0x787c18==='xmd-agiafter'||_0x787c18===_0x5d00('0x7f')||_0x787c18===_0x5d00('0x80')||_0x787c18==='rtpaudioqosbridged'||_0x787c18===_0x5d00('0x81')||_0x787c18===_0x5d00('0x82')||_0x787c18===_0x5d00('0x83')||_0x787c18===_0x5d00('0x84')||_0x787c18===_0x5d00('0x85')||_0x787c18===_0x5d00('0x86')||_0x787c18===_0x5d00('0x80')||_0x787c18===_0x5d00('0x87')||_0x787c18==='rtpaudioqosjitter'||_0x787c18==='rtpaudioqosjitterbridged'||_0x787c18===_0x5d00('0x83')||_0x787c18===_0x5d00('0x84')||_0x787c18===_0x5d00('0x85')||_0x787c18===_0x5d00('0x86')||_0x787c18===_0x5d00('0x88')||_0x787c18===_0x5d00('0x89')||_0x787c18===_0x5d00('0x35')||_0x787c18==='statedesc'){return![];}return!![];};exports[_0x5d00('0x8a')]=function(_0x3723f3,_0x259947){var _0x55eda4,_0x2969da,_0x555f7d;if(_0x259947<=0x0){_0x259947=0x1;}_0x55eda4=new RegExp(_0x5d00('0x8b')+_0x259947+'}$');_0x2969da=Math[_0x5d00('0x8c')](0xa,_0x259947-0x1);_0x555f7d=Math[_0x5d00('0x8c')](0xa,_0x259947)-0x1;return util['format']('%s',_[_0x5d00('0x8d')](_0x3723f3,_0x55eda4,_['random'](_0x2969da,_0x555f7d)));};exports[_0x5d00('0x8e')]=function(_0x55192f){var _0x5f4f76=_0x55192f[_0x5d00('0x8f')](/"(.*?)"/);return _0x5f4f76?_0x5f4f76[0x1]:_0x55192f;};exports[_0x5d00('0x90')]=function(_0x144fe9){var _0x2a0b18=_0x144fe9[_0x5d00('0x8f')](/<(.*?)>/);return _0x2a0b18?_0x2a0b18[0x1]:_0x144fe9;}; \ No newline at end of file +var _0xa636=['xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','loggerError','logger2','info','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','dialer','VoiceQueueId','dialOriginateTimeout','format','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','XMD-','toUpper','toLower','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','logAgent','responsetime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','channelAgent','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','filterKey','idContact','dialAnswer','scheduledat','countbusyretry','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout'];(function(_0x1a86a9,_0x1a1449){var _0xa0ee62=function(_0x57e953){while(--_0x57e953){_0x1a86a9['push'](_0x1a86a9['shift']());}};_0xa0ee62(++_0x1a1449);}(_0xa636,0x125));var _0x6a63=function(_0x169318,_0x3b4dfa){_0x169318=_0x169318-0x0;var _0x5d07b6=_0xa636[_0x169318];return _0x5d07b6;};'use strict';var util=require('util');var _=require(_0x6a63('0x0'));var moment=require('moment');var logger=require(_0x6a63('0x1'))(_0x6a63('0x2'));var ipAgi=process[_0x6a63('0x3')][_0x6a63('0x4')]||_0x6a63('0x5');function getSeconds(_0x51db30,_0x1efd88){var _0x15cdf1=moment(_0x51db30)[_0x6a63('0x6')](0x0);var _0x469b66=moment(_0x1efd88)[_0x6a63('0x6')](0x0);return _0x15cdf1[_0x6a63('0x7')](_0x469b66,_0x6a63('0x8'));}exports['loggerCatch']=function(_0xc2adcc){return function(_0x59a4d3){logger[_0x6a63('0x9')](_0xc2adcc,util[_0x6a63('0xa')](_0x59a4d3,{'showHidden':![],'depth':null}));};};exports[_0x6a63('0xb')]=function(_0x360352,_0x456861){logger['info'](_0x360352,util[_0x6a63('0xa')](_0x456861,{'showHidden':![],'depth':null}));};exports[_0x6a63('0xc')]=function(_0x435c08,_0x4721de){logger[_0x6a63('0x9')](_0x435c08,util[_0x6a63('0xa')](_0x4721de,{'showHidden':![],'depth':null}));};exports[_0x6a63('0xd')]=function(_0x2c8329){return function(_0x587ccb){logger[_0x6a63('0xe')](_0x2c8329,util['inspect'](_0x587ccb,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5be8f1,_0x35acb1,_0x484df0){return{'message':_0x5be8f1,'unlock':_0x35acb1,'active':_0x484df0};};exports[_0x6a63('0xf')]=function(_0x5af497,_0x3fab63,_0x2e1e7c){if(!_['isUndefined'](_0x2e1e7c)&&_0x6a63('0x10')===typeof _0x2e1e7c&&!_[_0x6a63('0x11')](_0x2e1e7c)){if(!_[_0x6a63('0x12')](_0x3fab63)&&_0x6a63('0x10')===typeof _0x3fab63&&!_[_0x6a63('0x11')](_0x3fab63)){return util['format'](_0x6a63('0x13'),_0x3fab63,_0x2e1e7c);}return util['format'](_0x6a63('0x13'),_0x2e1e7c,_0x2e1e7c);}if(!_[_0x6a63('0x12')](_0x5af497)&&'string'===typeof _0x5af497&&!_[_0x6a63('0x11')](_0x5af497)){return _0x5af497;}return _0x6a63('0x14');};exports[_0x6a63('0x15')]=function(_0x2eac5b){if(_[_0x6a63('0x16')](_0x2eac5b)){return![];}return _0x2eac5b;};exports['addVariables']=function(_0xbdc236,_0x3073a7,_0x2c4c92,_0xb608a6,_0x442ca6,_0x300745){var _0x5eaa56={'XMD-QUEUE':_0x3073a7[_0x6a63('0x17')]?_0x3073a7[_0x6a63('0x17')][_0x6a63('0x18')]:'','XMD-CALLERID':_0xb608a6,'XMD-CALLERID-PREVIEW':_0x300745?util['format'](_0x6a63('0x13'),_0x300745[_0x6a63('0x19')],_0x300745['calleridnum']):_0xb608a6,'XMD-DIALID':_0x442ca6,'XMD-CONTACTID':_0x3073a7['ContactId'],'XMD-CDRTYPE':_0x6a63('0x1a'),'CALLERID(all)':_0xb608a6,'XMD-VOICEQUEUEID':_0x3073a7[_0x6a63('0x1b')],'XMD-DIALCHANNEL':_0x2c4c92,'XMD-DIALTIMEOUT':_0xbdc236[_0x6a63('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x6a63('0x1d')](_0x6a63('0x1e'),_0xbdc236[_0x6a63('0x1f')]?'g':'',_['isEmpty'](_0xbdc236[_0x6a63('0x20')])?'':_0x6a63('0x21')),'XMD-DIALURL':_0xbdc236['dialPreviewUrl']||'','XMD-AGI':_0xbdc236['dialQueueProject']?util['format'](_0x6a63('0x22'),ipAgi,_0xbdc236[_0x6a63('0x23')]):_0x6a63('0x24'),'XMD-AGIAFTER':_0xbdc236[_0x6a63('0x1f')]?util[_0x6a63('0x1d')](_0x6a63('0x22'),ipAgi,_0xbdc236[_0x6a63('0x1f')]):_0x6a63('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x300745?_0x300745[_0x6a63('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x300745?_0x300745[_0x6a63('0x26')]:'','XMD-DESTINATION':_0x6a63('0x27'),'SIPADDHEADER':_0x6a63('0x28')};if(!_[_0x6a63('0x11')](_0xbdc236[_0x6a63('0x20')])){_0x5eaa56[util['format']('%s',_0x6a63('0x29'))]=_0xbdc236[_0x6a63('0x20')];_0x5eaa56[util[_0x6a63('0x1d')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x442ca6;}if(_0x3073a7&&_0x3073a7[_0x6a63('0x2a')]){for(var _0x481b2f in _0x3073a7[_0x6a63('0x2a')]){if(_0x3073a7[_0x6a63('0x2a')][_0x6a63('0x2b')](_0x481b2f)){if(!_[_0x6a63('0x16')](_0x3073a7[_0x6a63('0x2a')][_0x481b2f])&&_0x481b2f!=='id'&&_0x481b2f!=='tags'&&_0x481b2f!==_0x6a63('0x2c')&&_0x481b2f!==_0x6a63('0x2d')){_0x5eaa56[util[_0x6a63('0x1d')]('%s%s',_0x6a63('0x2e'),_[_0x6a63('0x2f')](_0x481b2f))]=_0x3073a7[_0x6a63('0x2a')][_0x481b2f];}}}}return _0x5eaa56;};exports['toLowerVariables']=function(_0x17cb7a){var _0x47478c={};for(var _0x34c947 in _0x17cb7a){if(_0x17cb7a['hasOwnProperty'](_0x34c947)){_0x47478c[util[_0x6a63('0x1d')]('%s',_[_0x6a63('0x30')](_0x34c947))]=_0x17cb7a[_0x34c947];}}return{'variables':_0x47478c};};exports['updateOriginated']=function(_0x43216c,_0x6ac67e){if(!_[_0x6a63('0x16')](_0x43216c)){if(_0x43216c['hasOwnProperty'](_0x6a63('0x31'))){if(_0x43216c['originated']>0x0){_0x43216c[_0x6a63('0x31')]-=0x1;}else{logger[_0x6a63('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x6ac67e);}}}else{logger[_0x6a63('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x6ac67e);}};exports[_0x6a63('0x32')]=function(_0x2307bf){var _0x2be626=moment()[_0x6a63('0x1d')](_0x6a63('0x33'));_0x2307bf[_0x6a63('0x34')]=0xd;_0x2307bf[_0x6a63('0x35')]='Blacklist';_0x2307bf[_0x6a63('0x36')]=_0x2be626;_0x2307bf['responsetime']=_0x2be626;_0x2307bf[_0x6a63('0x37')]=_0x2be626;};exports[_0x6a63('0x38')]=function(_0x5a1050,_0x53effd,_0x43d90b){var _0x31f493=moment()[_0x6a63('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a1050[_0x6a63('0x34')]=_0x53effd;_0x5a1050[_0x6a63('0x35')]=_0x43d90b;_0x5a1050[_0x6a63('0x39')]=_0x31f493;_0x5a1050['ringtime']=getSeconds(_0x5a1050[_0x6a63('0x39')],_0x5a1050['starttime']);};exports[_0x6a63('0x3a')]=function(_0x2e92fc,_0x56f58d,_0x2b9fc8){_0x2e92fc[_0x6a63('0x3b')]=_0x56f58d;_0x2e92fc['UserId']=_0x2b9fc8;};exports[_0x6a63('0x3c')]=function(_0x4d2d75,_0x35f5e3,_0x324100){var _0x286f86=moment()[_0x6a63('0x1d')](_0x6a63('0x33'));_0x4d2d75[_0x6a63('0x34')]=_0x35f5e3;_0x4d2d75[_0x6a63('0x35')]=_0x324100;_0x4d2d75['responsetime']=_0x4d2d75[_0x6a63('0x39')]?_0x4d2d75[_0x6a63('0x39')]:_0x286f86;_0x4d2d75['endtime']=_0x4d2d75[_0x6a63('0x37')]?_0x4d2d75['endtime']:_0x286f86;_0x4d2d75['ringtime']=getSeconds(_0x4d2d75['responsetime']||0x0,_0x4d2d75[_0x6a63('0x36')]||0x0);_0x4d2d75[_0x6a63('0x3d')]=_0x4d2d75[_0x6a63('0x3e')]?getSeconds(_0x4d2d75[_0x6a63('0x37')],_0x4d2d75[_0x6a63('0x3e')]):0x0;};exports[_0x6a63('0x3f')]=function(_0x3fe2c5){return _0x3fe2c5===_0x6a63('0x40');};exports['variablesAction']=function(_0x2b072c,_0x2124b0,_0x5883cc,_0x3fe10f,_0x2981c5){var _0x51dd27=_0x3fe10f?_0x6a63('0x41'):_0x2b072c['calleridname'];_0x51dd27=_0x2981c5?_0x6a63('0x42'):_0x51dd27;return{'actionid':_0x2b072c['uniqueid'],'action':'originate','channel':_0x2b072c[_0x6a63('0x43')],'callerid':util[_0x6a63('0x1d')](_0x6a63('0x13'),_0x51dd27,_0x2b072c['calleridnum']),'Exten':_0x6a63('0x27'),'Context':'from-sip','Priority':'1','variable':_0x5883cc,'timeout':(_0x2124b0['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2b072c[_0x6a63('0x44')]};};exports[_0x6a63('0x45')]=function(_0x26352e){return _0x26352e['countbusyretry']+_0x26352e[_0x6a63('0x46')]+_0x26352e[_0x6a63('0x47')]+_0x26352e[_0x6a63('0x48')]+_0x26352e[_0x6a63('0x49')];};exports['cloneAction']=function(_0x239c0b){var _0x5a2b51=_[_0x6a63('0x4a')](_0x239c0b);_0x5a2b51[_0x6a63('0x34')]=0xf;_0x5a2b51[_0x6a63('0x35')]=_0x6a63('0x4b');return _0x5a2b51;};exports[_0x6a63('0x4c')]=function(_0x88d2b3,_0x31e64a,_0x593a4d){var _0x4f3408={};_0x4f3408[_0x31e64a]=_0x88d2b3[_0x31e64a];_0x4f3408[_0x6a63('0x4d')]=![];_0x4f3408['scheduledat']=moment()[_0x6a63('0x4e')](_0x593a4d,'minutes')[_0x6a63('0x1d')](_0x6a63('0x33'));_0x4f3408['ContactId']=_0x88d2b3[_0x6a63('0x4f')];_0x4f3408[_0x6a63('0x50')]=_0x88d2b3[_0x6a63('0x50')];_0x4f3408[_0x6a63('0x1b')]=_0x88d2b3[_0x6a63('0x1b')]||undefined;return _0x4f3408;};exports[_0x6a63('0x51')]=function(_0x453b59,_0x1cca27){if(!_[_0x6a63('0x16')](_0x453b59)){if(_0x453b59[_0x6a63('0x52')]>0x0){_0x453b59['pTalking']-=0x1;}else{logger[_0x6a63('0x9')](_0x1cca27,_0x6a63('0x53'));}}else{logger[_0x6a63('0x9')](_0x1cca27,_0x6a63('0x54'));}};exports[_0x6a63('0x55')]=function(_0x4e2647){if(_0x4e2647<=0x0){return!![];}return![];};exports['buildObj']=function(_0x22e617,_0x328312,_0x4b08b2){_0x22e617[_0x6a63('0x56')]=_0x328312;_0x22e617[_0x6a63('0x18')]=_0x22e617['queue'];_0x22e617[_0x6a63('0x57')]=_0x22e617[_0x6a63('0x43')];_0x22e617[_0x6a63('0x58')]=_0x6a63('0x59');if(_0x4b08b2){_0x22e617[_0x6a63('0x5a')]=_0x4b08b2[_0x6a63('0x5a')];}return _0x22e617;};exports[_0x6a63('0x5b')]=function(_0x2a9b53){var _0x515bef={};_0x515bef[_0x6a63('0x5c')]=_0x2a9b53[_0x6a63('0x5c')];_0x515bef['interface']=_0x2a9b53[_0x6a63('0x43')];_0x515bef[_0x6a63('0x44')]=_0x2a9b53[_0x6a63('0x44')];return _0x515bef;};exports[_0x6a63('0x5d')]=function(_0x2c5851){var _0x458b47=[];for(var _0x2d6557 in _0x2c5851){if(_0x2c5851[_0x6a63('0x2b')](_0x2d6557)){if(!_['isNil'](_0x2c5851[_0x2d6557])&&_0x2c5851[_0x2d6557][_0x6a63('0x34')]===_0x6a63('0x5e')&&_0x2c5851[_0x2d6557][_0x6a63('0x5f')]===_0x6a63('0x60')){_0x458b47[_0x6a63('0x61')](_0x2c5851[_0x2d6557]['id']);}}}return _0x458b47;};exports['getDiff']=function(_0x43a8e9){var _0x2421ff=moment()[_0x6a63('0x6')](0x0);var _0x180245=moment(_0x43a8e9)[_0x6a63('0x6')](0x0);return _0x2421ff[_0x6a63('0x7')](_0x180245,_0x6a63('0x8'));};exports['createBody']=function(_0x4d923f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d923f['ContactId'],'ListId':_0x4d923f['ListId'],'VoiceQueueId':_0x4d923f[_0x6a63('0x1b')]||undefined,'CampaignId':_0x4d923f['CampaignId']||undefined};};exports[_0x6a63('0x62')]=function(_0x5b5b54){if(_0x5b5b54===_0x6a63('0x44')||_0x5b5b54===_0x6a63('0x63')||_0x5b5b54===_0x6a63('0x5c')||_0x5b5b54==='type'||_0x5b5b54==='campaigntype'||_0x5b5b54===_0x6a63('0x64')||_0x5b5b54==='membername'||_0x5b5b54===_0x6a63('0x43')||_0x5b5b54==='calleridname'||_0x5b5b54==='active'||_0x5b5b54==='calleridnum'||_0x5b5b54===_0x6a63('0x65')||_0x5b5b54===_0x6a63('0x66')||_0x5b5b54===_0x6a63('0x46')||_0x5b5b54===_0x6a63('0x47')||_0x5b5b54===_0x6a63('0x67')||_0x5b5b54===_0x6a63('0x68')||_0x5b5b54==='callbackuniqueid'||_0x5b5b54===_0x6a63('0x69')||_0x5b5b54===_0x6a63('0x6a')||_0x5b5b54==='ContactId'||_0x5b5b54===_0x6a63('0x50')||_0x5b5b54===_0x6a63('0x6b')||_0x5b5b54===_0x6a63('0x1b')||_0x5b5b54===_0x6a63('0x6c')||_0x5b5b54===_0x6a63('0x6d')||_0x5b5b54===_0x6a63('0x6e')||_0x5b5b54===_0x6a63('0x6f')||_0x5b5b54===_0x6a63('0x70')||_0x5b5b54===_0x6a63('0x71')||_0x5b5b54===_0x6a63('0x72')||_0x5b5b54==='xmd-dialoptions'||_0x5b5b54===_0x6a63('0x73')||_0x5b5b54==='xmd-dialchannel'||_0x5b5b54===_0x6a63('0x74')||_0x5b5b54===_0x6a63('0x75')||_0x5b5b54===_0x6a63('0x76')||_0x5b5b54===_0x6a63('0x77')||_0x5b5b54===_0x6a63('0x78')||_0x5b5b54===_0x6a63('0x79')||_0x5b5b54===_0x6a63('0x7a')||_0x5b5b54===_0x6a63('0x7b')||_0x5b5b54==='rtpaudioqosjitterbridged'||_0x5b5b54===_0x6a63('0x7c')||_0x5b5b54===_0x6a63('0x7d')||_0x5b5b54===_0x6a63('0x7e')||_0x5b5b54==='rtpaudioqosrttbridged'||_0x5b5b54===_0x6a63('0x79')||_0x5b5b54===_0x6a63('0x7a')||_0x5b5b54===_0x6a63('0x7b')||_0x5b5b54===_0x6a63('0x7f')||_0x5b5b54===_0x6a63('0x7c')||_0x5b5b54===_0x6a63('0x7d')||_0x5b5b54==='rtpaudioqosrtt'||_0x5b5b54==='rtpaudioqosrttbridged'||_0x5b5b54===_0x6a63('0x80')||_0x5b5b54==='bridgepvtcallid'||_0x5b5b54===_0x6a63('0x34')||_0x5b5b54===_0x6a63('0x35')){return![];}return!![];};exports[_0x6a63('0x81')]=function(_0x3cef68,_0x3f9974){var _0x3ed3b3,_0x12ef0f,_0x17a63a;if(_0x3f9974<=0x0){_0x3f9974=0x1;}_0x3ed3b3=new RegExp('\x5cw{0,'+_0x3f9974+'}$');_0x12ef0f=Math[_0x6a63('0x82')](0xa,_0x3f9974-0x1);_0x17a63a=Math[_0x6a63('0x82')](0xa,_0x3f9974)-0x1;return util[_0x6a63('0x1d')]('%s',_[_0x6a63('0x83')](_0x3cef68,_0x3ed3b3,_[_0x6a63('0x84')](_0x12ef0f,_0x17a63a)));};exports[_0x6a63('0x85')]=function(_0x58d372){var _0x25afb8=_0x58d372[_0x6a63('0x86')](/"(.*?)"/);return _0x25afb8?_0x25afb8[0x1]:_0x58d372;};exports[_0x6a63('0x87')]=function(_0x15fb68){var _0x343daf=_0x15fb68[_0x6a63('0x86')](/<(.*?)>/);return _0x343daf?_0x343daf[0x1]:_0x15fb68;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index b2c7bd4..f575f0d 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 _0x81b4=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x5d4631,_0xeb0007){var _0x4b1846=function(_0x16c0e6){while(--_0x16c0e6){_0x5d4631['push'](_0x5d4631['shift']());}};_0x4b1846(++_0xeb0007);}(_0x81b4,0x1ab));var _0x481b=function(_0x521727,_0x763f9c){_0x521727=_0x521727-0x0;var _0x2e7f23=_0x81b4[_0x521727];return _0x2e7f23;};'use strict';exports[_0x481b('0x0')]={'queue':{'type':_0x481b('0x1'),'required':!![]},'interface':{'type':_0x481b('0x1'),'required':!![]},'membername':{'type':_0x481b('0x1'),'required':!![]},'penalty':{'type':_0x481b('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x481b('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x481b('0x1'),'required':!![]}};exports[_0x481b('0x4')]={'interface':{'type':_0x481b('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x481b('0x5')]={'module':{'type':'string','required':![]}};exports[_0x481b('0x6')]={'uniqueid':{'type':_0x481b('0x1'),'required':!![]}};exports[_0x481b('0x7')]={'uniqueid':{'type':_0x481b('0x1'),'required':!![]},'filename':{'type':_0x481b('0x1')},'format':{'type':_0x481b('0x1')},'mixmonitorid':{'type':_0x481b('0x1')}};exports[_0x481b('0x8')]={'uniqueid':{'type':_0x481b('0x1'),'required':!![]}};exports[_0x481b('0x9')]={'uniqueid':{'type':_0x481b('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x481b('0x1')}}; \ No newline at end of file +var _0x2924=['queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','string','number','boolean'];(function(_0x505439,_0x5a4a50){var _0x54267a=function(_0x5e635f){while(--_0x5e635f){_0x505439['push'](_0x505439['shift']());}};_0x54267a(++_0x5a4a50);}(_0x2924,0x7d));var _0x4292=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x2924[_0x217c2e];return _0x22b7d8;};'use strict';exports['queueadd']={'queue':{'type':_0x4292('0x0'),'required':!![]},'interface':{'type':_0x4292('0x0'),'required':!![]},'membername':{'type':_0x4292('0x0'),'required':!![]},'penalty':{'type':_0x4292('0x1'),'required':![]},'paused':{'type':_0x4292('0x2'),'required':![]}};exports[_0x4292('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x4292('0x0'),'required':!![]}};exports[_0x4292('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x4292('0x2')},'reason':{'type':_0x4292('0x0'),'required':![]}};exports[_0x4292('0x5')]={'module':{'type':_0x4292('0x0'),'required':![]}};exports[_0x4292('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x4292('0x0'),'required':!![]},'filename':{'type':_0x4292('0x0')},'format':{'type':_0x4292('0x0')},'mixmonitorid':{'type':_0x4292('0x0')}};exports[_0x4292('0x7')]={'uniqueid':{'type':_0x4292('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x4292('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 088795c..d0be3e5 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 _0x61bb=['../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','format','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','seconds','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','lodash','../model/telephone'];(function(_0x3bed06,_0x1b1247){var _0x15ba6b=function(_0xe119d9){while(--_0xe119d9){_0x3bed06['push'](_0x3bed06['shift']());}};_0x15ba6b(++_0x1b1247);}(_0x61bb,0x69));var _0xb61b=function(_0x4c6851,_0x5c030a){_0x4c6851=_0x4c6851-0x0;var _0x1072c7=_0x61bb[_0x4c6851];return _0x1072c7;};'use strict';var BPromise=require('bluebird');var util=require(_0xb61b('0x0'));var _=require(_0xb61b('0x1'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xb61b('0x2'));var Trunk=require(_0xb61b('0x3'));var VoiceQueue=require(_0xb61b('0x4'));var Trigger=require(_0xb61b('0x5'));var Template=require(_0xb61b('0x6'));var Campaign=require(_0xb61b('0x7'));var VoiceExtension=require(_0xb61b('0x8'));var ZendeskAccount=require(_0xb61b('0x9'));var SalesforceAccount=require(_0xb61b('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xb61b('0xb'));var ZohoAccount=require(_0xb61b('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xb61b('0xd'));var ServicenowAccount=require(_0xb61b('0xe'));var Dynamics365Account=require(_0xb61b('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xb61b('0x10'));var Realtime=function(){this[_0xb61b('0x11')]={};this[_0xb61b('0x12')]={};this[_0xb61b('0x13')]={};this[_0xb61b('0x14')]={};this[_0xb61b('0x15')]={};this[_0xb61b('0x16')]={};this[_0xb61b('0x17')]={};this[_0xb61b('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb61b('0x19')]={};this[_0xb61b('0x1a')]={};this['queueChannels']={};this['outboundChannels']={};this['timers']={};this[_0xb61b('0x1b')]={};this[_0xb61b('0x1c')]={};this[_0xb61b('0x1d')]={};this[_0xb61b('0x1e')]={};this[_0xb61b('0x1f')]={};this[_0xb61b('0x20')]={};this[_0xb61b('0x21')]={};this[_0xb61b('0x22')]={};this[_0xb61b('0x23')]={};this['dynamics365Accounts']={};this[_0xb61b('0x24')]={};this[_0xb61b('0x25')]={};};function freeIsNotKey(_0x3bf747,_0x5dd291,_0x2f4d4e){var _0x24d6da=_[_0xb61b('0x26')](_0x3bf747,function(_0x34da09,_0x152004){return _0x34da09[_0x2f4d4e];});for(var _0x51780c in _0x5dd291){if(_0x5dd291['hasOwnProperty'](_0x51780c)){if(!_0x24d6da[_0x51780c]){delete _0x5dd291[_0x51780c];}}}}function freeIsNotKeySip(_0x4ebe51,_0x274e5b){var _0x40a52b=_[_0xb61b('0x26')](_0x4ebe51,function(_0x9542ad,_0x189492){return util['format'](_0xb61b('0x27'),_0x9542ad[_0xb61b('0x28')]);});for(var _0x6d6ec5 in _0x274e5b){if(_0x274e5b[_0xb61b('0x29')](_0x6d6ec5)){if(!_0x40a52b[_0x6d6ec5]){delete _0x274e5b[_0x6d6ec5];}}}}function freeIsNotKeyAgent(_0x2e5978,_0x1990ec){var _0x529f2d=_[_0xb61b('0x26')](_0x2e5978,function(_0x5a4e52,_0x495f0b){var _0x5f2b4c=_[_0xb61b('0x2a')](_0x5a4e52[_0xb61b('0x2b')])?util['format'](_0xb61b('0x27'),_0x5a4e52[_0xb61b('0x28')]):_0x5a4e52[_0xb61b('0x2b')];return _0x5f2b4c;});for(var _0x4373ca in _0x1990ec){if(_0x1990ec[_0xb61b('0x29')](_0x4373ca)){if(!_0x529f2d[_0x4373ca]){delete _0x1990ec[_0x4373ca];}}}}function clearVoiceCallReports(_0x340f3a){_0x340f3a[_0xb61b('0x2c')]=0x0;_0x340f3a[_0xb61b('0x2d')]=0x0;_0x340f3a[_0xb61b('0x2e')]=0x0;_0x340f3a[_0xb61b('0x2f')]=0x0;_0x340f3a['sumBillable']=0x0;}function clearCampaigns(_0x3b4c97){if(!_[_0xb61b('0x30')](_0x3b4c97)){for(var _0x533e09 in _0x3b4c97){if(_0x3b4c97[_0xb61b('0x29')](_0x533e09)){_0x3b4c97[_0x533e09][_0xb61b('0x31')]=0x0;_0x3b4c97[_0x533e09][_0xb61b('0x32')]=0x0;}}}}function clearVoiceQueues(_0xf5fd55){if(!_[_0xb61b('0x30')](_0xf5fd55)){for(var _0x2f65d8 in _0xf5fd55){if(_0xf5fd55[_0xb61b('0x29')](_0x2f65d8)){_0xf5fd55[_0x2f65d8][_0xb61b('0x2c')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x2d')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x33')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x34')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x2e')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x2f')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x35')]=0x0;_0xf5fd55[_0x2f65d8]['outboundAnswerAgiCallsDay']=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x36')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x37')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x38')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x39')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x3a')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x3b')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x3c')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x3d')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x3e')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x3f')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x40')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x41')]=0x0;_0xf5fd55[_0x2f65d8][_0xb61b('0x42')]=0x0;_0xf5fd55[_0x2f65d8]['queueStatusComplete']=!![];}}}}Realtime[_0xb61b('0x43')][_0xb61b('0x44')]=function(_0x1d4f94,_0x2dbffc){for(var _0x1016ff in _0x2dbffc){if(_0x1d4f94[_0xb61b('0x29')](_0x1016ff)){_0x1d4f94[_0x1016ff]=_0x2dbffc[_0x1016ff];}}};Realtime[_0xb61b('0x43')][_0xb61b('0x45')]=function(){var _0x1210d9=this;return function(_0x55767f){if(_0x55767f){freeIsNotKeyAgent(_0x55767f,_0x1210d9[_0xb61b('0x11')]);for(var _0xdfefcc=0x0,_0x2de175={},_0x2a1cba={};_0xdfefcc<_0x55767f[_0xb61b('0x46')];_0xdfefcc+=0x1){_0x2de175=_0x55767f[_0xdfefcc];var _0xc59fb9=_['isNil'](_0x2de175[_0xb61b('0x2b')])?util['format'](_0xb61b('0x27'),_0x2de175[_0xb61b('0x28')]):_0x2de175[_0xb61b('0x2b')];if(_[_0xb61b('0x47')](_0x1210d9[_0xb61b('0x11')][_0xc59fb9])){_0x1210d9[_0xb61b('0x11')][_0xc59fb9]=new Agent(_0x2de175);}else{_0x1210d9[_0xb61b('0x44')](_0x1210d9['agents'][_0xc59fb9],_0x2de175);}}}return _0x1210d9[_0xb61b('0x11')];};};Realtime[_0xb61b('0x43')]['initTelephones']=function(){var _0x2f3288=this;return function(_0x30bf0a){if(_0x30bf0a){freeIsNotKeySip(_0x30bf0a,_0x2f3288[_0xb61b('0x12')]);for(var _0x310386=0x0,_0x5e2266={},_0x3140c4={};_0x310386<_0x30bf0a['length'];_0x310386+=0x1){_0x5e2266=_0x30bf0a[_0x310386];if(_[_0xb61b('0x47')](_0x2f3288[_0xb61b('0x12')][util[_0xb61b('0x48')](_0xb61b('0x27'),_0x5e2266['name'])])){_0x2f3288['telephones'][util['format'](_0xb61b('0x27'),_0x5e2266[_0xb61b('0x28')])]=new Telephone(_0x5e2266);}else{_0x2f3288[_0xb61b('0x44')](_0x2f3288[_0xb61b('0x12')][util[_0xb61b('0x48')](_0xb61b('0x27'),_0x5e2266['name'])],_0x5e2266);}}}return _0x2f3288['telephones'];};};Realtime[_0xb61b('0x43')][_0xb61b('0x49')]=function(){var _0x57802d=this;return function(_0xfd2fc0){if(_0xfd2fc0){freeIsNotKeySip(_0xfd2fc0,_0x57802d[_0xb61b('0x13')]);for(var _0xc3c510=0x0,_0xe2eddb={},_0x3cf5fb={};_0xc3c510<_0xfd2fc0[_0xb61b('0x46')];_0xc3c510+=0x1){_0xe2eddb=_0xfd2fc0[_0xc3c510];if(_[_0xb61b('0x47')](_0x57802d['trunks'][util['format'](_0xb61b('0x27'),_0xe2eddb[_0xb61b('0x28')])])){_0x57802d['trunks'][util[_0xb61b('0x48')]('SIP/%s',_0xe2eddb[_0xb61b('0x28')])]=new Trunk(_0xe2eddb);}else{_0x57802d['mergeFromDatabase'](_0x57802d['trunks'][util[_0xb61b('0x48')](_0xb61b('0x27'),_0xe2eddb[_0xb61b('0x28')])],_0xe2eddb);}}}return _0x57802d['trunks'];};};Realtime[_0xb61b('0x43')][_0xb61b('0x4a')]=function(){var _0x3f408e=this;return function(_0x5de554){if(_0x5de554){freeIsNotKey(_0x5de554,_0x3f408e[_0xb61b('0x14')],_0xb61b('0x28'));for(var _0x3a9eca=0x0,_0x5d1635={},_0x20a480={};_0x3a9eca<_0x5de554[_0xb61b('0x46')];_0x3a9eca+=0x1){_0x5d1635=_0x5de554[_0x3a9eca];if(_[_0xb61b('0x47')](_0x3f408e[_0xb61b('0x14')][_0x5d1635[_0xb61b('0x28')]])){_0x3f408e[_0xb61b('0x14')][_0x5d1635[_0xb61b('0x28')]]=new VoiceQueue(_0x5d1635);}else{_0x3f408e['mergeFromDatabase'](_0x3f408e[_0xb61b('0x14')][_0x5d1635[_0xb61b('0x28')]],_0x5d1635);}}}return _0x3f408e[_0xb61b('0x14')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x4b')]=function(){var _0x45040=this;return function(_0x1c507c){if(_0x1c507c){freeIsNotKey(_0x1c507c,_0x45040['triggers'],'id');for(var _0x2312bc=0x0,_0x340121={},_0x613e16={};_0x2312bc<_0x1c507c[_0xb61b('0x46')];_0x2312bc+=0x1){_0x340121=_0x1c507c[_0x2312bc];if(_[_0xb61b('0x47')](_0x45040['triggers'][_0x340121['id']])){_0x45040[_0xb61b('0x15')][_0x340121['id']]=new Trigger(_0x340121);}else{_0x45040[_0xb61b('0x44')](_0x45040[_0xb61b('0x15')][_0x340121['id']],_0x340121);}}}return _0x45040[_0xb61b('0x15')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x4c')]=function(){var _0x4d0b8e=this;return function(_0x4f9609){if(_0x4f9609){freeIsNotKey(_0x4f9609,_0x4d0b8e[_0xb61b('0x17')],'id');for(var _0xe5b147=0x0,_0x4eb01f={},_0x390582={};_0xe5b147<_0x4f9609[_0xb61b('0x46')];_0xe5b147+=0x1){_0x4eb01f=_0x4f9609[_0xe5b147];if(_[_0xb61b('0x47')](_0x4d0b8e[_0xb61b('0x17')][_0x4eb01f['id']])){_0x4d0b8e[_0xb61b('0x17')][_0x4eb01f['id']]=new Template(_0x4eb01f);}else{_0x4d0b8e['mergeFromDatabase'](_0x4d0b8e[_0xb61b('0x17')][_0x4eb01f['id']],_0x4eb01f);}}}return _0x4d0b8e[_0xb61b('0x17')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x4d')]=function(){var _0x5f485b=this;return function(_0x39decd){if(_0x39decd){freeIsNotKey(_0x39decd,_0x5f485b[_0xb61b('0x1c')],'id');for(var _0x56d4a1=0x0,_0x39c55b={},_0x21c901={};_0x56d4a1<_0x39decd[_0xb61b('0x46')];_0x56d4a1+=0x1){_0x39c55b=_0x39decd[_0x56d4a1];if(_[_0xb61b('0x47')](_0x5f485b[_0xb61b('0x1c')][_0x39c55b['id']])){_0x5f485b[_0xb61b('0x1c')][_0x39c55b['id']]=new ZendeskAccount(_0x39c55b);}else{_0x5f485b[_0xb61b('0x44')](_0x5f485b['zendeskAccounts'][_0x39c55b['id']],_0x39c55b);}}}return _0x5f485b['zendeskAccounts'];};};Realtime['prototype'][_0xb61b('0x4e')]=function(){var _0x4ab0bb=this;return function(_0x2e171a){if(_0x2e171a){freeIsNotKey(_0x2e171a,_0x4ab0bb[_0xb61b('0x1d')],'id');for(var _0x85448a=0x0,_0x5d04a6={},_0x1bf0fc={};_0x85448a<_0x2e171a[_0xb61b('0x46')];_0x85448a+=0x1){_0x5d04a6=_0x2e171a[_0x85448a];if(_[_0xb61b('0x47')](_0x4ab0bb['salesforceAccounts'][_0x5d04a6['id']])){_0x4ab0bb[_0xb61b('0x1d')][_0x5d04a6['id']]=new SalesforceAccount(_0x5d04a6);}else{_0x4ab0bb[_0xb61b('0x44')](_0x4ab0bb[_0xb61b('0x1d')][_0x5d04a6['id']],_0x5d04a6);}}}return _0x4ab0bb[_0xb61b('0x1d')];};};Realtime['prototype'][_0xb61b('0x4f')]=function(){var _0x33107b=this;return function(_0x15c2cc){if(_0x15c2cc){freeIsNotKey(_0x15c2cc,_0x33107b['freshdeskAccounts'],'id');for(var _0x20769f=0x0,_0x30a733={},_0x414ec5={};_0x20769f<_0x15c2cc['length'];_0x20769f+=0x1){_0x30a733=_0x15c2cc[_0x20769f];if(_[_0xb61b('0x47')](_0x33107b[_0xb61b('0x1f')][_0x30a733['id']])){_0x33107b[_0xb61b('0x1f')][_0x30a733['id']]=new FreshdeskAccount(_0x30a733);}else{_0x33107b[_0xb61b('0x44')](_0x33107b[_0xb61b('0x1f')][_0x30a733['id']],_0x30a733);}}}return _0x33107b[_0xb61b('0x1f')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x50')]=function(){var _0x17ef47=this;return function(_0x597f69){if(_0x597f69){freeIsNotKey(_0x597f69,_0x17ef47[_0xb61b('0x20')],'id');for(var _0x4079b4=0x0,_0x56d1f2={},_0x51f4a8={};_0x4079b4<_0x597f69['length'];_0x4079b4+=0x1){_0x56d1f2=_0x597f69[_0x4079b4];if(_[_0xb61b('0x47')](_0x17ef47['zohoAccounts'][_0x56d1f2['id']])){_0x17ef47[_0xb61b('0x20')][_0x56d1f2['id']]=new ZohoAccount(_0x56d1f2);}else{_0x17ef47[_0xb61b('0x44')](_0x17ef47[_0xb61b('0x20')][_0x56d1f2['id']],_0x56d1f2);}}}return _0x17ef47[_0xb61b('0x20')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x51')]=function(){var _0x49485a=this;return function(_0x2f01a3){if(_0x2f01a3){freeIsNotKey(_0x2f01a3,_0x49485a['deskAccounts'],'id');for(var _0x701102=0x0,_0x637652={},_0x5659e6={};_0x701102<_0x2f01a3[_0xb61b('0x46')];_0x701102+=0x1){_0x637652=_0x2f01a3[_0x701102];if(_[_0xb61b('0x47')](_0x49485a[_0xb61b('0x21')][_0x637652['id']])){_0x49485a[_0xb61b('0x21')][_0x637652['id']]=new DeskAccount(_0x637652);}else{_0x49485a[_0xb61b('0x44')](_0x49485a[_0xb61b('0x21')][_0x637652['id']],_0x637652);}}}return _0x49485a['deskAccounts'];};};Realtime[_0xb61b('0x43')][_0xb61b('0x52')]=function(){var _0x2454fa=this;return function(_0x3b32e5){if(_0x3b32e5){freeIsNotKey(_0x3b32e5,_0x2454fa[_0xb61b('0x1e')],'id');for(var _0x5bfd76=0x0,_0x5ba7e0={},_0x56d1d5={};_0x5bfd76<_0x3b32e5['length'];_0x5bfd76+=0x1){_0x5ba7e0=_0x3b32e5[_0x5bfd76];if(_[_0xb61b('0x47')](_0x2454fa[_0xb61b('0x1e')][_0x5ba7e0['id']])){_0x2454fa['sugarcrmAccounts'][_0x5ba7e0['id']]=new SugarcrmAccount(_0x5ba7e0);}else{_0x2454fa[_0xb61b('0x44')](_0x2454fa[_0xb61b('0x1e')][_0x5ba7e0['id']],_0x5ba7e0);}}}return _0x2454fa[_0xb61b('0x1e')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x53')]=function(){var _0x3d8940=this;return function(_0x35361f){if(_0x35361f){freeIsNotKey(_0x35361f,_0x3d8940[_0xb61b('0x22')],'id');for(var _0xebec04=0x0,_0x299790={},_0x5ab554={};_0xebec04<_0x35361f[_0xb61b('0x46')];_0xebec04+=0x1){_0x299790=_0x35361f[_0xebec04];if(_[_0xb61b('0x47')](_0x3d8940[_0xb61b('0x22')][_0x299790['id']])){_0x3d8940[_0xb61b('0x22')][_0x299790['id']]=new VtigerAccount(_0x299790);}else{_0x3d8940['mergeFromDatabase'](_0x3d8940['vtigerAccounts'][_0x299790['id']],_0x299790);}}}return _0x3d8940[_0xb61b('0x22')];};};Realtime[_0xb61b('0x43')]['initServicenowAccounts']=function(){var _0x16e377=this;return function(_0x52997e){if(_0x52997e){freeIsNotKey(_0x52997e,_0x16e377[_0xb61b('0x23')],'id');for(var _0x2e8c0a=0x0,_0x38e384={},_0x2da7dd={};_0x2e8c0a<_0x52997e[_0xb61b('0x46')];_0x2e8c0a+=0x1){_0x38e384=_0x52997e[_0x2e8c0a];if(_['isUndefined'](_0x16e377[_0xb61b('0x23')][_0x38e384['id']])){_0x16e377[_0xb61b('0x23')][_0x38e384['id']]=new ServicenowAccount(_0x38e384);}else{_0x16e377['mergeFromDatabase'](_0x16e377[_0xb61b('0x23')][_0x38e384['id']],_0x38e384);}}}return _0x16e377[_0xb61b('0x23')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x54')]=function(){var _0x2b6dd3=this;return function(_0x5a9fee){if(_0x5a9fee){freeIsNotKey(_0x5a9fee,_0x2b6dd3[_0xb61b('0x55')],'id');for(var _0x16af8d=0x0,_0x189a35={},_0xe19e03={};_0x16af8d<_0x5a9fee[_0xb61b('0x46')];_0x16af8d+=0x1){_0x189a35=_0x5a9fee[_0x16af8d];if(_[_0xb61b('0x47')](_0x2b6dd3['dynamics365Accounts'][_0x189a35['id']])){_0x2b6dd3[_0xb61b('0x55')][_0x189a35['id']]=new Dynamics365Account(_0x189a35);}else{_0x2b6dd3[_0xb61b('0x44')](_0x2b6dd3[_0xb61b('0x55')][_0x189a35['id']],_0x189a35);}}}return _0x2b6dd3[_0xb61b('0x55')];};};Realtime[_0xb61b('0x43')]['initFreshsalesAccounts']=function(){var _0xdaaf70=this;return function(_0x13d122){if(_0x13d122){freeIsNotKey(_0x13d122,_0xdaaf70[_0xb61b('0x24')],'id');for(var _0x52e727=0x0,_0x51fe9c={},_0x1bb6e9={};_0x52e727<_0x13d122[_0xb61b('0x46')];_0x52e727+=0x1){_0x51fe9c=_0x13d122[_0x52e727];if(_['isUndefined'](_0xdaaf70[_0xb61b('0x24')][_0x51fe9c['id']])){_0xdaaf70[_0xb61b('0x24')][_0x51fe9c['id']]=new FreshsalesAccount(_0x51fe9c);}else{_0xdaaf70[_0xb61b('0x44')](_0xdaaf70[_0xb61b('0x24')][_0x51fe9c['id']],_0x51fe9c);}}}return _0xdaaf70[_0xb61b('0x24')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x56')]=function(){var _0xa2e7e9=this;return function(_0x26d866){for(var _0x12212b=0x0;_0x12212b<_0x26d866['length'];_0x12212b+=0x1){_[_0xb61b('0x57')](_0xa2e7e9['voiceQueues'][_0x26d866[_0x12212b][_0xb61b('0x28')]],_0x26d866[_0x12212b]);}return _0xa2e7e9[_0xb61b('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x516378=this;return function(_0x176729){clearVoiceQueues(_0x516378[_0xb61b('0x14')]);if(_0x176729){_0x176729=_[_0xb61b('0x58')](_0x176729,'uniqueid');for(var _0x4cfddc in _0x176729){if(_0x176729[_0xb61b('0x29')](_0x4cfddc)){var _0xb4c22f={};for(var _0x443bc0=0x0;_0x443bc0<_0x176729[_0x4cfddc][_0xb61b('0x46')];_0x443bc0+=0x1){var _0x181eba=_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x59')];if(_0x516378[_0xb61b('0x14')][_0x181eba]){if(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5a')]){_0x516378[_0xb61b('0x14')][_0x181eba][_0xb61b('0x33')]+=0x1;}if(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5b')]){_0x516378[_0xb61b('0x14')][_0x181eba]['abandoned']+=0x1;}_0x516378[_0xb61b('0x14')][_0x181eba][_0xb61b('0x2e')]+=moment(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5c')])[_0xb61b('0x5d')](moment(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5e')]),'seconds')||0x0;if(_0x443bc0===_0x176729[_0x4cfddc][_0xb61b('0x46')]-0x1){_0x516378[_0xb61b('0x14')][_0x181eba][_0xb61b('0x2f')]+=moment(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5f')]||_0x176729[_0x4cfddc][_0x443bc0]['queuecallerabandonAt']||_0x176729[_0x4cfddc][_0x443bc0]['queuecallerexitAt'])['diff'](moment(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5e')]),_0xb61b('0x60'))||0x0;_0x516378['voiceQueues'][_0x181eba][_0xb61b('0x2c')]+=0x1;if(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x61')]){_0x516378[_0xb61b('0x14')][_0x181eba][_0xb61b('0x2d')]+=0x1;_0x516378[_0xb61b('0x14')][_0x181eba]['sumBillable']+=moment(_0x176729[_0x4cfddc][_0x443bc0]['queuecallercompleteAt'])[_0xb61b('0x5d')](moment(_0x176729[_0x4cfddc][_0x443bc0][_0xb61b('0x5c')]),_0xb61b('0x60'))||0x0;}}else{_0x516378[_0xb61b('0x14')][_0x181eba]['sumDuration']+=_0x516378[_0xb61b('0x14')][_0x181eba][_0xb61b('0x2e')]||0x0;}}}}}}return _0x516378[_0xb61b('0x14')];};};Realtime[_0xb61b('0x43')][_0xb61b('0x62')]=function(){var _0x1ac867=this;return function(_0x396e8b){clearVoiceCallReports(_0x1ac867[_0xb61b('0x18')]);if(_0x396e8b){for(var _0x25d5ab=0x0;_0x25d5ab<_0x396e8b[_0xb61b('0x46')];_0x25d5ab+=0x1){_0x1ac867[_0xb61b('0x18')][_0xb61b('0x2c')]+=0x1;_0x1ac867[_0xb61b('0x18')]['sumDuration']+=_0x396e8b[_0x25d5ab][_0xb61b('0x63')];if(_0x396e8b[_0x25d5ab]['disposition']===_0xb61b('0x64')){_0x1ac867['outbound'][_0xb61b('0x2d')]+=0x1;_0x1ac867[_0xb61b('0x18')]['sumHoldTime']+=_0x396e8b[_0x25d5ab]['duration']-_0x396e8b[_0x25d5ab][_0xb61b('0x65')]||0x0;_0x1ac867[_0xb61b('0x18')][_0xb61b('0x35')]+=_0x396e8b[_0x25d5ab][_0xb61b('0x65')];}}}return _0x1ac867[_0xb61b('0x18')];};};Realtime['prototype'][_0xb61b('0x66')]=function(){var _0x5bb173=this;return function(_0x3e3ff6){if(_0x3e3ff6){freeIsNotKey(_0x3e3ff6,_0x5bb173['campaigns'],'name');for(var _0x430f22=0x0,_0x331f3f={};_0x430f22<_0x3e3ff6[_0xb61b('0x46')];_0x430f22+=0x1){_0x331f3f=_0x3e3ff6[_0x430f22];if(_[_0xb61b('0x47')](_0x5bb173['campaigns'][_0x331f3f[_0xb61b('0x28')]])){_0x5bb173[_0xb61b('0x16')][_0x331f3f[_0xb61b('0x28')]]=new Campaign(_0x331f3f);}else{_0x5bb173['mergeFromDatabase'](_0x5bb173[_0xb61b('0x16')][_0x331f3f[_0xb61b('0x28')]],_0x331f3f);_0x5bb173[_0xb61b('0x16')][_0x331f3f[_0xb61b('0x28')]][_0xb61b('0x67')]=_0x331f3f[_0xb61b('0x68')]?_0x331f3f['SquareProject'][_0xb61b('0x28')]:undefined;}}}return _0x5bb173[_0xb61b('0x16')];};};Realtime['prototype'][_0xb61b('0x69')]=function(){var _0x40432c=this;return function(_0x19cfa8){if(_0x19cfa8){freeIsNotKey(_0x19cfa8,_0x40432c[_0xb61b('0x19')],'id');for(var _0x58c177=0x0,_0x32472d={};_0x58c177<_0x19cfa8[_0xb61b('0x46')];_0x58c177+=0x1){_0x32472d=_0x19cfa8[_0x58c177];if(_['isUndefined'](_0x40432c['voiceExtensions'][_0x32472d['id']])){_0x40432c[_0xb61b('0x19')][_0x32472d['id']]=new VoiceExtension(_0x32472d);}else{_0x40432c[_0xb61b('0x44')](_0x40432c[_0xb61b('0x19')][_0x32472d['id']],_0x32472d);}}}return _0x40432c['voiceExtensions'];};};Realtime[_0xb61b('0x43')]['initCampaignHopperHistory']=function(){var _0x599b6a=this;return function(_0x34f865){clearCampaigns(_0x599b6a[_0xb61b('0x16')]);for(var _0x22aeea=0x0;_0x22aeea<_0x34f865['length'];_0x22aeea+=0x1){_[_0xb61b('0x57')](_0x599b6a[_0xb61b('0x16')][_0x34f865[_0x22aeea][_0xb61b('0x28')]],_0x34f865[_0x22aeea]);}return _0x599b6a[_0xb61b('0x16')];};};Realtime['prototype'][_0xb61b('0x6a')]=function(){var _0x144e18=this;return function(_0x4fd778){if(_0x4fd778){freeIsNotKey(_0x4fd778,_0x144e18[_0xb61b('0x25')],'id');for(var _0x203753=0x0,_0x547595={},_0x11a976={};_0x203753<_0x4fd778[_0xb61b('0x46')];_0x203753+=0x1){_0x547595=_0x4fd778[_0x203753];if(_[_0xb61b('0x47')](_0x144e18[_0xb61b('0x25')][_0x547595['id']])){_0x144e18[_0xb61b('0x25')][_0x547595['id']]=new FaxAccount(_0x547595);}else{_0x144e18[_0xb61b('0x44')](_0x144e18[_0xb61b('0x25')][_0x547595['id']],_0x547595);}}}return _0x144e18['faxAccounts'];};};module[_0xb61b('0x6b')]=Realtime; \ No newline at end of file +var _0x2661=['queueChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','merge','groupBy','queue','queuecallerexit','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels'];(function(_0x1d8221,_0x70f11d){var _0x341f39=function(_0x1e6597){while(--_0x1e6597){_0x1d8221['push'](_0x1d8221['shift']());}};_0x341f39(++_0x70f11d);}(_0x2661,0x19c));var _0x1266=function(_0x4e0778,_0x242a67){_0x4e0778=_0x4e0778-0x0;var _0x289e05=_0x2661[_0x4e0778];return _0x289e05;};'use strict';var BPromise=require(_0x1266('0x0'));var util=require(_0x1266('0x1'));var _=require('lodash');var moment=require(_0x1266('0x2'));var Agent=require(_0x1266('0x3'));var Telephone=require(_0x1266('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x1266('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x1266('0x6'));var Campaign=require(_0x1266('0x7'));var VoiceExtension=require(_0x1266('0x8'));var ZendeskAccount=require(_0x1266('0x9'));var SalesforceAccount=require(_0x1266('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x1266('0xb'));var ZohoAccount=require(_0x1266('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x1266('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x1266('0xe'));var FaxAccount=require(_0x1266('0xf'));var Realtime=function(){this['agents']={};this[_0x1266('0x10')]={};this[_0x1266('0x11')]={};this[_0x1266('0x12')]={};this[_0x1266('0x13')]={};this[_0x1266('0x14')]={};this[_0x1266('0x15')]={};this[_0x1266('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x1266('0x17')]={};this[_0x1266('0x18')]={};this['outboundChannels']={};this[_0x1266('0x19')]={};this[_0x1266('0x1a')]={};this[_0x1266('0x1b')]={};this[_0x1266('0x1c')]={};this['sugarcrmAccounts']={};this[_0x1266('0x1d')]={};this[_0x1266('0x1e')]={};this[_0x1266('0x1f')]={};this[_0x1266('0x20')]={};this['servicenowAccounts']={};this[_0x1266('0x21')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x5b129f,_0x4da24f,_0x497d95){var _0x897868=_[_0x1266('0x22')](_0x5b129f,function(_0x4a4377,_0x331008){return _0x4a4377[_0x497d95];});for(var _0x816052 in _0x4da24f){if(_0x4da24f[_0x1266('0x23')](_0x816052)){if(!_0x897868[_0x816052]){delete _0x4da24f[_0x816052];}}}}function freeIsNotKeySip(_0x49a737,_0x49161f){var _0x184452=_[_0x1266('0x22')](_0x49a737,function(_0x23b6c0,_0x386cc4){return util['format'](_0x1266('0x24'),_0x23b6c0[_0x1266('0x25')]);});for(var _0x14bf90 in _0x49161f){if(_0x49161f['hasOwnProperty'](_0x14bf90)){if(!_0x184452[_0x14bf90]){delete _0x49161f[_0x14bf90];}}}}function freeIsNotKeyAgent(_0x12a70c,_0x507eaf){var _0x3cc948=_['mapKeys'](_0x12a70c,function(_0x53df6d,_0x10b11e){var _0x34f462=_[_0x1266('0x26')](_0x53df6d[_0x1266('0x27')])?util[_0x1266('0x28')](_0x1266('0x24'),_0x53df6d['name']):_0x53df6d[_0x1266('0x27')];return _0x34f462;});for(var _0x330e6a in _0x507eaf){if(_0x507eaf[_0x1266('0x23')](_0x330e6a)){if(!_0x3cc948[_0x330e6a]){delete _0x507eaf[_0x330e6a];}}}}function clearVoiceCallReports(_0x3ef4bf){_0x3ef4bf[_0x1266('0x29')]=0x0;_0x3ef4bf[_0x1266('0x2a')]=0x0;_0x3ef4bf[_0x1266('0x2b')]=0x0;_0x3ef4bf['sumDuration']=0x0;_0x3ef4bf[_0x1266('0x2c')]=0x0;}function clearCampaigns(_0x34aa6a){if(!_[_0x1266('0x2d')](_0x34aa6a)){for(var _0x228635 in _0x34aa6a){if(_0x34aa6a['hasOwnProperty'](_0x228635)){_0x34aa6a[_0x228635][_0x1266('0x2e')]=0x0;_0x34aa6a[_0x228635][_0x1266('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x4cb26e){if(!_[_0x1266('0x2d')](_0x4cb26e)){for(var _0x5887e2 in _0x4cb26e){if(_0x4cb26e[_0x1266('0x23')](_0x5887e2)){_0x4cb26e[_0x5887e2][_0x1266('0x29')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x2a')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x30')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x31')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x2b')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x32')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x2c')]=0x0;_0x4cb26e[_0x5887e2]['outboundAnswerAgiCallsDay']=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x33')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x34')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x35')]=0x0;_0x4cb26e[_0x5887e2]['outboundNoSuchCallsDay']=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x36')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x37')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x38')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x39')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x3a')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x3b')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x3c')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x3d')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x3e')]=0x0;_0x4cb26e[_0x5887e2][_0x1266('0x3f')]=!![];}}}}Realtime[_0x1266('0x40')][_0x1266('0x41')]=function(_0x4bc424,_0x287527){for(var _0x43e688 in _0x287527){if(_0x4bc424[_0x1266('0x23')](_0x43e688)){_0x4bc424[_0x43e688]=_0x287527[_0x43e688];}}};Realtime['prototype'][_0x1266('0x42')]=function(){var _0x12de73=this;return function(_0x510f78){if(_0x510f78){freeIsNotKeyAgent(_0x510f78,_0x12de73[_0x1266('0x43')]);for(var _0x435fed=0x0,_0x45a54a={},_0x1bf77c={};_0x435fed<_0x510f78[_0x1266('0x44')];_0x435fed+=0x1){_0x45a54a=_0x510f78[_0x435fed];var _0x384585=_[_0x1266('0x26')](_0x45a54a['interface'])?util['format'](_0x1266('0x24'),_0x45a54a['name']):_0x45a54a[_0x1266('0x27')];if(_[_0x1266('0x45')](_0x12de73[_0x1266('0x43')][_0x384585])){_0x12de73[_0x1266('0x43')][_0x384585]=new Agent(_0x45a54a);}else{_0x12de73[_0x1266('0x41')](_0x12de73[_0x1266('0x43')][_0x384585],_0x45a54a);}}}return _0x12de73['agents'];};};Realtime[_0x1266('0x40')][_0x1266('0x46')]=function(){var _0x104d10=this;return function(_0x399b46){if(_0x399b46){freeIsNotKeySip(_0x399b46,_0x104d10[_0x1266('0x10')]);for(var _0x3b3c51=0x0,_0x51f6b5={},_0x61cec5={};_0x3b3c51<_0x399b46['length'];_0x3b3c51+=0x1){_0x51f6b5=_0x399b46[_0x3b3c51];if(_['isUndefined'](_0x104d10[_0x1266('0x10')][util[_0x1266('0x28')](_0x1266('0x24'),_0x51f6b5[_0x1266('0x25')])])){_0x104d10[_0x1266('0x10')][util[_0x1266('0x28')]('SIP/%s',_0x51f6b5['name'])]=new Telephone(_0x51f6b5);}else{_0x104d10[_0x1266('0x41')](_0x104d10[_0x1266('0x10')][util[_0x1266('0x28')]('SIP/%s',_0x51f6b5[_0x1266('0x25')])],_0x51f6b5);}}}return _0x104d10[_0x1266('0x10')];};};Realtime[_0x1266('0x40')][_0x1266('0x47')]=function(){var _0x2d4193=this;return function(_0x50a085){if(_0x50a085){freeIsNotKeySip(_0x50a085,_0x2d4193['trunks']);for(var _0x49d598=0x0,_0x108a2a={},_0x35cf3b={};_0x49d598<_0x50a085['length'];_0x49d598+=0x1){_0x108a2a=_0x50a085[_0x49d598];if(_[_0x1266('0x45')](_0x2d4193['trunks'][util[_0x1266('0x28')]('SIP/%s',_0x108a2a[_0x1266('0x25')])])){_0x2d4193[_0x1266('0x11')][util[_0x1266('0x28')]('SIP/%s',_0x108a2a['name'])]=new Trunk(_0x108a2a);}else{_0x2d4193[_0x1266('0x41')](_0x2d4193[_0x1266('0x11')][util['format']('SIP/%s',_0x108a2a[_0x1266('0x25')])],_0x108a2a);}}}return _0x2d4193[_0x1266('0x11')];};};Realtime['prototype'][_0x1266('0x48')]=function(){var _0x5bfba6=this;return function(_0x2a97bd){if(_0x2a97bd){freeIsNotKey(_0x2a97bd,_0x5bfba6[_0x1266('0x12')],_0x1266('0x25'));for(var _0x2e1a70=0x0,_0xc6934c={},_0x1c5b43={};_0x2e1a70<_0x2a97bd['length'];_0x2e1a70+=0x1){_0xc6934c=_0x2a97bd[_0x2e1a70];if(_[_0x1266('0x45')](_0x5bfba6[_0x1266('0x12')][_0xc6934c[_0x1266('0x25')]])){_0x5bfba6[_0x1266('0x12')][_0xc6934c['name']]=new VoiceQueue(_0xc6934c);}else{_0x5bfba6[_0x1266('0x41')](_0x5bfba6['voiceQueues'][_0xc6934c[_0x1266('0x25')]],_0xc6934c);}}}return _0x5bfba6['voiceQueues'];};};Realtime[_0x1266('0x40')][_0x1266('0x49')]=function(){var _0x13a540=this;return function(_0x3bd086){if(_0x3bd086){freeIsNotKey(_0x3bd086,_0x13a540[_0x1266('0x13')],'id');for(var _0x5153e8=0x0,_0xd5e4a5={},_0x2bf722={};_0x5153e8<_0x3bd086[_0x1266('0x44')];_0x5153e8+=0x1){_0xd5e4a5=_0x3bd086[_0x5153e8];if(_[_0x1266('0x45')](_0x13a540[_0x1266('0x13')][_0xd5e4a5['id']])){_0x13a540[_0x1266('0x13')][_0xd5e4a5['id']]=new Trigger(_0xd5e4a5);}else{_0x13a540[_0x1266('0x41')](_0x13a540[_0x1266('0x13')][_0xd5e4a5['id']],_0xd5e4a5);}}}return _0x13a540[_0x1266('0x13')];};};Realtime[_0x1266('0x40')][_0x1266('0x4a')]=function(){var _0x161a83=this;return function(_0x277cb0){if(_0x277cb0){freeIsNotKey(_0x277cb0,_0x161a83[_0x1266('0x15')],'id');for(var _0x55722d=0x0,_0x2a11eb={},_0x33fcdb={};_0x55722d<_0x277cb0[_0x1266('0x44')];_0x55722d+=0x1){_0x2a11eb=_0x277cb0[_0x55722d];if(_[_0x1266('0x45')](_0x161a83[_0x1266('0x15')][_0x2a11eb['id']])){_0x161a83[_0x1266('0x15')][_0x2a11eb['id']]=new Template(_0x2a11eb);}else{_0x161a83[_0x1266('0x41')](_0x161a83[_0x1266('0x15')][_0x2a11eb['id']],_0x2a11eb);}}}return _0x161a83['templates'];};};Realtime['prototype'][_0x1266('0x4b')]=function(){var _0x4460d5=this;return function(_0x498f58){if(_0x498f58){freeIsNotKey(_0x498f58,_0x4460d5[_0x1266('0x1b')],'id');for(var _0x3f8840=0x0,_0x52cd9b={},_0x3df897={};_0x3f8840<_0x498f58['length'];_0x3f8840+=0x1){_0x52cd9b=_0x498f58[_0x3f8840];if(_['isUndefined'](_0x4460d5[_0x1266('0x1b')][_0x52cd9b['id']])){_0x4460d5['zendeskAccounts'][_0x52cd9b['id']]=new ZendeskAccount(_0x52cd9b);}else{_0x4460d5[_0x1266('0x41')](_0x4460d5[_0x1266('0x1b')][_0x52cd9b['id']],_0x52cd9b);}}}return _0x4460d5['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0xaefba=this;return function(_0x564651){if(_0x564651){freeIsNotKey(_0x564651,_0xaefba[_0x1266('0x1c')],'id');for(var _0x145042=0x0,_0x526bf8={},_0x505f2e={};_0x145042<_0x564651[_0x1266('0x44')];_0x145042+=0x1){_0x526bf8=_0x564651[_0x145042];if(_['isUndefined'](_0xaefba[_0x1266('0x1c')][_0x526bf8['id']])){_0xaefba[_0x1266('0x1c')][_0x526bf8['id']]=new SalesforceAccount(_0x526bf8);}else{_0xaefba[_0x1266('0x41')](_0xaefba['salesforceAccounts'][_0x526bf8['id']],_0x526bf8);}}}return _0xaefba[_0x1266('0x1c')];};};Realtime['prototype'][_0x1266('0x4c')]=function(){var _0x4f904d=this;return function(_0x48771c){if(_0x48771c){freeIsNotKey(_0x48771c,_0x4f904d[_0x1266('0x1d')],'id');for(var _0x14cf62=0x0,_0x7e7c1f={},_0x1faa0a={};_0x14cf62<_0x48771c['length'];_0x14cf62+=0x1){_0x7e7c1f=_0x48771c[_0x14cf62];if(_[_0x1266('0x45')](_0x4f904d[_0x1266('0x1d')][_0x7e7c1f['id']])){_0x4f904d[_0x1266('0x1d')][_0x7e7c1f['id']]=new FreshdeskAccount(_0x7e7c1f);}else{_0x4f904d[_0x1266('0x41')](_0x4f904d[_0x1266('0x1d')][_0x7e7c1f['id']],_0x7e7c1f);}}}return _0x4f904d[_0x1266('0x1d')];};};Realtime['prototype'][_0x1266('0x4d')]=function(){var _0x4b985c=this;return function(_0x19d701){if(_0x19d701){freeIsNotKey(_0x19d701,_0x4b985c[_0x1266('0x1e')],'id');for(var _0x4ec7ef=0x0,_0x1bd9f0={},_0x1cb00a={};_0x4ec7ef<_0x19d701['length'];_0x4ec7ef+=0x1){_0x1bd9f0=_0x19d701[_0x4ec7ef];if(_[_0x1266('0x45')](_0x4b985c[_0x1266('0x1e')][_0x1bd9f0['id']])){_0x4b985c[_0x1266('0x1e')][_0x1bd9f0['id']]=new ZohoAccount(_0x1bd9f0);}else{_0x4b985c['mergeFromDatabase'](_0x4b985c['zohoAccounts'][_0x1bd9f0['id']],_0x1bd9f0);}}}return _0x4b985c[_0x1266('0x1e')];};};Realtime[_0x1266('0x40')][_0x1266('0x4e')]=function(){var _0x312a9d=this;return function(_0x520e61){if(_0x520e61){freeIsNotKey(_0x520e61,_0x312a9d[_0x1266('0x1f')],'id');for(var _0x4daa2c=0x0,_0x349e31={},_0x1e0043={};_0x4daa2c<_0x520e61[_0x1266('0x44')];_0x4daa2c+=0x1){_0x349e31=_0x520e61[_0x4daa2c];if(_[_0x1266('0x45')](_0x312a9d[_0x1266('0x1f')][_0x349e31['id']])){_0x312a9d[_0x1266('0x1f')][_0x349e31['id']]=new DeskAccount(_0x349e31);}else{_0x312a9d[_0x1266('0x41')](_0x312a9d[_0x1266('0x1f')][_0x349e31['id']],_0x349e31);}}}return _0x312a9d[_0x1266('0x1f')];};};Realtime['prototype'][_0x1266('0x4f')]=function(){var _0x1d5c47=this;return function(_0x3e5dc7){if(_0x3e5dc7){freeIsNotKey(_0x3e5dc7,_0x1d5c47['sugarcrmAccounts'],'id');for(var _0x389053=0x0,_0x2ba663={},_0x168258={};_0x389053<_0x3e5dc7[_0x1266('0x44')];_0x389053+=0x1){_0x2ba663=_0x3e5dc7[_0x389053];if(_[_0x1266('0x45')](_0x1d5c47[_0x1266('0x50')][_0x2ba663['id']])){_0x1d5c47[_0x1266('0x50')][_0x2ba663['id']]=new SugarcrmAccount(_0x2ba663);}else{_0x1d5c47[_0x1266('0x41')](_0x1d5c47[_0x1266('0x50')][_0x2ba663['id']],_0x2ba663);}}}return _0x1d5c47['sugarcrmAccounts'];};};Realtime[_0x1266('0x40')]['initVtigerAccounts']=function(){var _0x3447d5=this;return function(_0x32edb6){if(_0x32edb6){freeIsNotKey(_0x32edb6,_0x3447d5[_0x1266('0x20')],'id');for(var _0x687bf5=0x0,_0x5d0af9={},_0x4d019f={};_0x687bf5<_0x32edb6[_0x1266('0x44')];_0x687bf5+=0x1){_0x5d0af9=_0x32edb6[_0x687bf5];if(_[_0x1266('0x45')](_0x3447d5['vtigerAccounts'][_0x5d0af9['id']])){_0x3447d5[_0x1266('0x20')][_0x5d0af9['id']]=new VtigerAccount(_0x5d0af9);}else{_0x3447d5['mergeFromDatabase'](_0x3447d5[_0x1266('0x20')][_0x5d0af9['id']],_0x5d0af9);}}}return _0x3447d5[_0x1266('0x20')];};};Realtime[_0x1266('0x40')][_0x1266('0x51')]=function(){var _0x24247e=this;return function(_0x5ec351){if(_0x5ec351){freeIsNotKey(_0x5ec351,_0x24247e[_0x1266('0x52')],'id');for(var _0x4de1e7=0x0,_0x219a49={},_0x3756fe={};_0x4de1e7<_0x5ec351['length'];_0x4de1e7+=0x1){_0x219a49=_0x5ec351[_0x4de1e7];if(_['isUndefined'](_0x24247e[_0x1266('0x52')][_0x219a49['id']])){_0x24247e[_0x1266('0x52')][_0x219a49['id']]=new ServicenowAccount(_0x219a49);}else{_0x24247e[_0x1266('0x41')](_0x24247e[_0x1266('0x52')][_0x219a49['id']],_0x219a49);}}}return _0x24247e['servicenowAccounts'];};};Realtime[_0x1266('0x40')][_0x1266('0x53')]=function(){var _0x24b853=this;return function(_0x29d3d0){if(_0x29d3d0){freeIsNotKey(_0x29d3d0,_0x24b853['dynamics365Accounts'],'id');for(var _0x3480dd=0x0,_0x4d551e={},_0x120b75={};_0x3480dd<_0x29d3d0[_0x1266('0x44')];_0x3480dd+=0x1){_0x4d551e=_0x29d3d0[_0x3480dd];if(_[_0x1266('0x45')](_0x24b853[_0x1266('0x21')][_0x4d551e['id']])){_0x24b853[_0x1266('0x21')][_0x4d551e['id']]=new Dynamics365Account(_0x4d551e);}else{_0x24b853[_0x1266('0x41')](_0x24b853[_0x1266('0x21')][_0x4d551e['id']],_0x4d551e);}}}return _0x24b853[_0x1266('0x21')];};};Realtime[_0x1266('0x40')][_0x1266('0x54')]=function(){var _0x26495f=this;return function(_0x513e78){if(_0x513e78){freeIsNotKey(_0x513e78,_0x26495f[_0x1266('0x55')],'id');for(var _0x5d809b=0x0,_0x200c42={},_0x310c59={};_0x5d809b<_0x513e78[_0x1266('0x44')];_0x5d809b+=0x1){_0x200c42=_0x513e78[_0x5d809b];if(_[_0x1266('0x45')](_0x26495f[_0x1266('0x55')][_0x200c42['id']])){_0x26495f[_0x1266('0x55')][_0x200c42['id']]=new FreshsalesAccount(_0x200c42);}else{_0x26495f['mergeFromDatabase'](_0x26495f['freshsalesAccounts'][_0x200c42['id']],_0x200c42);}}}return _0x26495f[_0x1266('0x55')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x87cf1f=this;return function(_0x47d90a){for(var _0x27675d=0x0;_0x27675d<_0x47d90a[_0x1266('0x44')];_0x27675d+=0x1){_[_0x1266('0x56')](_0x87cf1f[_0x1266('0x12')][_0x47d90a[_0x27675d]['name']],_0x47d90a[_0x27675d]);}return _0x87cf1f[_0x1266('0x12')];};};Realtime[_0x1266('0x40')]['initVoiceQueueReports']=function(){var _0x2fd2ed=this;return function(_0x1c7967){clearVoiceQueues(_0x2fd2ed[_0x1266('0x12')]);if(_0x1c7967){_0x1c7967=_[_0x1266('0x57')](_0x1c7967,'uniqueid');for(var _0x236341 in _0x1c7967){if(_0x1c7967['hasOwnProperty'](_0x236341)){var _0x32e1fe={};for(var _0x3fd55d=0x0;_0x3fd55d<_0x1c7967[_0x236341][_0x1266('0x44')];_0x3fd55d+=0x1){var _0x4f1c00=_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x58')];if(_0x2fd2ed['voiceQueues'][_0x4f1c00]){if(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x59')]){_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x30')]+=0x1;}if(_0x1c7967[_0x236341][_0x3fd55d]['queuecallerabandon']){_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x31')]+=0x1;}_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x2b')]+=moment(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x5a')])[_0x1266('0x5b')](moment(_0x1c7967[_0x236341][_0x3fd55d]['queuecallerjoinAt']),_0x1266('0x5c'))||0x0;if(_0x3fd55d===_0x1c7967[_0x236341]['length']-0x1){_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x32')]+=moment(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x5d')]||_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x5e')]||_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x5f')])[_0x1266('0x5b')](moment(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x60')]),_0x1266('0x5c'))||0x0;_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x29')]+=0x1;if(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x61')]){_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x2a')]+=0x1;_0x2fd2ed[_0x1266('0x12')][_0x4f1c00][_0x1266('0x2c')]+=moment(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x5d')])[_0x1266('0x5b')](moment(_0x1c7967[_0x236341][_0x3fd55d][_0x1266('0x5a')]),'seconds')||0x0;}}else{_0x2fd2ed['voiceQueues'][_0x4f1c00][_0x1266('0x32')]+=_0x2fd2ed['voiceQueues'][_0x4f1c00][_0x1266('0x2b')]||0x0;}}}}}}return _0x2fd2ed[_0x1266('0x12')];};};Realtime[_0x1266('0x40')]['initVoiceCallReports']=function(){var _0x156d2b=this;return function(_0x5d941f){clearVoiceCallReports(_0x156d2b['outbound']);if(_0x5d941f){for(var _0x853d26=0x0;_0x853d26<_0x5d941f[_0x1266('0x44')];_0x853d26+=0x1){_0x156d2b[_0x1266('0x16')][_0x1266('0x29')]+=0x1;_0x156d2b['outbound'][_0x1266('0x32')]+=_0x5d941f[_0x853d26][_0x1266('0x62')];if(_0x5d941f[_0x853d26][_0x1266('0x63')]===_0x1266('0x64')){_0x156d2b[_0x1266('0x16')]['answered']+=0x1;_0x156d2b[_0x1266('0x16')]['sumHoldTime']+=_0x5d941f[_0x853d26][_0x1266('0x62')]-_0x5d941f[_0x853d26]['billableseconds']||0x0;_0x156d2b['outbound'][_0x1266('0x2c')]+=_0x5d941f[_0x853d26][_0x1266('0x65')];}}}return _0x156d2b[_0x1266('0x16')];};};Realtime[_0x1266('0x40')][_0x1266('0x66')]=function(){var _0x26c608=this;return function(_0x13691a){if(_0x13691a){freeIsNotKey(_0x13691a,_0x26c608['campaigns'],_0x1266('0x25'));for(var _0x48861f=0x0,_0x1fa5cc={};_0x48861f<_0x13691a[_0x1266('0x44')];_0x48861f+=0x1){_0x1fa5cc=_0x13691a[_0x48861f];if(_[_0x1266('0x45')](_0x26c608['campaigns'][_0x1fa5cc[_0x1266('0x25')]])){_0x26c608['campaigns'][_0x1fa5cc[_0x1266('0x25')]]=new Campaign(_0x1fa5cc);}else{_0x26c608[_0x1266('0x41')](_0x26c608[_0x1266('0x14')][_0x1fa5cc[_0x1266('0x25')]],_0x1fa5cc);_0x26c608[_0x1266('0x14')][_0x1fa5cc[_0x1266('0x25')]]['dialQueueProject']=_0x1fa5cc[_0x1266('0x67')]?_0x1fa5cc['SquareProject'][_0x1266('0x25')]:undefined;}}}return _0x26c608[_0x1266('0x14')];};};Realtime[_0x1266('0x40')][_0x1266('0x68')]=function(){var _0x33a69d=this;return function(_0x5ef5ee){if(_0x5ef5ee){freeIsNotKey(_0x5ef5ee,_0x33a69d[_0x1266('0x69')],'id');for(var _0x1c3b6b=0x0,_0x422979={};_0x1c3b6b<_0x5ef5ee[_0x1266('0x44')];_0x1c3b6b+=0x1){_0x422979=_0x5ef5ee[_0x1c3b6b];if(_[_0x1266('0x45')](_0x33a69d[_0x1266('0x69')][_0x422979['id']])){_0x33a69d[_0x1266('0x69')][_0x422979['id']]=new VoiceExtension(_0x422979);}else{_0x33a69d[_0x1266('0x41')](_0x33a69d[_0x1266('0x69')][_0x422979['id']],_0x422979);}}}return _0x33a69d[_0x1266('0x69')];};};Realtime[_0x1266('0x40')][_0x1266('0x6a')]=function(){var _0x2c97fa=this;return function(_0x2bd0dd){clearCampaigns(_0x2c97fa[_0x1266('0x14')]);for(var _0x13cfc3=0x0;_0x13cfc3<_0x2bd0dd[_0x1266('0x44')];_0x13cfc3+=0x1){_['merge'](_0x2c97fa[_0x1266('0x14')][_0x2bd0dd[_0x13cfc3]['name']],_0x2bd0dd[_0x13cfc3]);}return _0x2c97fa[_0x1266('0x14')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x854f7d=this;return function(_0x33f79e){if(_0x33f79e){freeIsNotKey(_0x33f79e,_0x854f7d[_0x1266('0x6b')],'id');for(var _0x355d1c=0x0,_0x2042fa={},_0x2e5d3a={};_0x355d1c<_0x33f79e['length'];_0x355d1c+=0x1){_0x2042fa=_0x33f79e[_0x355d1c];if(_[_0x1266('0x45')](_0x854f7d[_0x1266('0x6b')][_0x2042fa['id']])){_0x854f7d['faxAccounts'][_0x2042fa['id']]=new FaxAccount(_0x2042fa);}else{_0x854f7d['mergeFromDatabase'](_0x854f7d[_0x1266('0x6b')][_0x2042fa['id']],_0x2042fa);}}}return _0x854f7d['faxAccounts'];};};module[_0x1266('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 44dcf44..8cad6b9 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 _0x2222=['util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','connectedlinenum','assigned','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','uniqueid','monitor','monitors','length','monitorFilename','filename','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment'];(function(_0x23ec30,_0x564e96){var _0x195a05=function(_0x544cea){while(--_0x544cea){_0x23ec30['push'](_0x23ec30['shift']());}};_0x195a05(++_0x564e96);}(_0x2222,0xf4));var _0x2222=function(_0x43dc5c,_0x4385ea){_0x43dc5c=_0x43dc5c-0x0;var _0x2cb362=_0x2222[_0x43dc5c];return _0x2cb362;};'use strict';var _=require(_0x2222('0x0'));var moment=require(_0x2222('0x1'));var util=require(_0x2222('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x2222('0x3'));var RpcVoiceDialReport=require(_0x2222('0x4'));var RpcMemberReport=require(_0x2222('0x5'));var RpcVoiceQueueReport=require(_0x2222('0x6'));var RpcVoiceRecording=require(_0x2222('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x2222('0x8'));var VoiceCallReport=require(_0x2222('0x9'));var VoiceAgentReport=require(_0x2222('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x354deb){this[_0x2222('0xb')]=_0x354deb;this['agents']=_0x354deb[_0x2222('0xc')];this['telephones']=_0x354deb['telephones'];}Report[_0x2222('0xd')][_0x2222('0xe')]=function(_0x36cd38){var _0x3abcef=new VoiceQueueReport(this[_0x2222('0xb')]);var _0x10be73=new VoiceAgentReport(this['realtime']);var _0x5ce8bb=new VoiceDialReport(this[_0x2222('0xb')]);var _0x467cb9=new VoiceCallReport(this[_0x2222('0xb')]);var _0x1157d5=new UserReport(this[_0x2222('0xb')]);if(config[_0x2222('0xf')]&&config['xdr'][_0x2222('0x10')]){ami['on'](_0x2222('0x11'),this[_0x2222('0x12')][_0x2222('0x13')](this));ami['on'](_0x2222('0x14'),this[_0x2222('0x15')][_0x2222('0x13')](this));ami['on'](_0x2222('0x16'),this[_0x2222('0x17')][_0x2222('0x13')](this));ami['on']('custom:voiceDialReport',this[_0x2222('0x18')][_0x2222('0x13')](this));ami['on'](_0x2222('0x19'),this[_0x2222('0x1a')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x2222('0x13')](this));}};Report['prototype'][_0x2222('0x1b')]=function(_0x2c3092){var _0x4d01fc;_0x4d01fc=_[_0x2222('0x1c')](this[_0x2222('0xc')],function(_0x21e5c8){return _0x21e5c8[_0x2222('0x1d')]==_0x2c3092||_0x21e5c8[_0x2222('0x1e')]==_0x2c3092;});if(_[_0x2222('0x1f')](_0x4d01fc)){var _0x43dd37=_[_0x2222('0x1c')](this['telephones'],function(_0x28452e){return _0x28452e[_0x2222('0x1d')]==_0x2c3092||_0x28452e[_0x2222('0x1e')]==_0x2c3092;});if(_0x43dd37){_0x4d01fc=_[_0x2222('0x1c')](this['agents'],function(_0x3c30f1){return _0x3c30f1['interface']==util[_0x2222('0x20')](_0x2222('0x21'),_0x43dd37[_0x2222('0x1e')]);});}}return _0x4d01fc;};Report[_0x2222('0xd')][_0x2222('0x12')]=function(_0x44db27){for(var _0x881978=0x0;_0x881978<_0x44db27['length'];_0x881978+=0x1){var _0x4d67eb=this[_0x2222('0x1b')](_0x44db27[_0x881978][_0x2222('0x22')]);if(_0x4d67eb){_0x44db27[_0x881978][_0x2222('0x1d')]=_0x4d67eb[_0x2222('0x1d')];_0x44db27[_0x881978][_0x2222('0x23')]=!![];_0x44db27[_0x881978]['lastAssignedTo']=_0x4d67eb['name'];_0x44db27[_0x881978][_0x2222('0x24')]=_['isNil'](_0x4d67eb[_0x2222('0x24')])?util[_0x2222('0x20')](_0x2222('0x21'),_0x4d67eb['name']):_0x4d67eb['interface'];if(_0x44db27[_0x881978][_0x2222('0x25')]){_0x44db27[_0x881978][_0x2222('0x26')]=moment()['format'](_0x2222('0x27'));}if(_0x44db27[_0x881978][_0x2222('0x28')]){_0x44db27[_0x881978]['queuecallerexitAt']=moment()[_0x2222('0x20')](_0x2222('0x27'));}RpcMemberReport[_0x2222('0x12')](_0x44db27[_0x881978]);}RpcVoiceQueueReport[_0x2222('0x29')](_0x44db27[_0x881978]);}};function extractCalleridNumber(_0x39e6d4){var _0x46af7d=_0x39e6d4[_0x2222('0x2a')](/<(.*?)>/);return _0x46af7d?_0x46af7d[0x1]:_0x39e6d4;}Report[_0x2222('0xd')][_0x2222('0x15')]=function(_0x43caf9){_0x43caf9[_0x2222('0x2b')]=_0x43caf9[_0x2222('0x2b')]||_0x43caf9[_0x2222('0x2c')];if(_0x43caf9['type']==_0x2222('0x2d')){_0x43caf9[_0x2222('0x2e')]=_0x2222('0x2f');_0x43caf9[_0x2222('0x30')]=_0x43caf9[_0x2222('0x2f')];if(_0x43caf9[_0x2222('0x31')]==_0x2222('0x32')){_0x43caf9[_0x2222('0x1d')]='';_0x43caf9[_0x2222('0x2b')]=extractCalleridNumber(_0x43caf9[_0x2222('0x33')]);}else if(_0x43caf9[_0x2222('0x31')]=='from-sip'){if(_0x43caf9['destination']==_0x2222('0x34')){_0x43caf9['destination']=extractCalleridNumber(_0x43caf9[_0x2222('0x35')]);_0x43caf9[_0x2222('0x36')]=_0x43caf9[_0x2222('0x37')];_0x43caf9['destinationchannel']=[_0x43caf9[_0x2222('0x38')],_0x43caf9[_0x2222('0x38')]=_0x43caf9['destinationchannel']][0x0];_0x43caf9[_0x2222('0x33')]=_0x43caf9['calleridpreview'];}else{_0x43caf9['destination']=_0x43caf9[_0x2222('0x36')];_0x43caf9[_0x2222('0x36')]=_0x43caf9['originatecalleridnum'];if(_0x43caf9[_0x2222('0x39')]==_0x2222('0x3a')){_0x43caf9[_0x2222('0x1d')]=_0x43caf9[_0x2222('0x22')];}else{_0x43caf9[_0x2222('0x1d')]='';}}}}else{_0x43caf9[_0x2222('0x33')]=util[_0x2222('0x20')](_0x2222('0x3b'),_0x43caf9[_0x2222('0x3c')],_0x43caf9[_0x2222('0x36')]);}if(RpcVoiceTransferReport['transfers'][_0x43caf9[_0x2222('0x3d')]]){var _0x2322da=RpcVoiceTransferReport[_0x2222('0x3e')][_0x43caf9[_0x2222('0x3d')]];_0x2322da['transfereelinkedid']=_0x43caf9[_0x2222('0x3f')];RpcVoiceTransferReport[_0x2222('0x1a')](_0x2322da);delete RpcVoiceTransferReport[_0x2222('0x3e')][_0x43caf9[_0x2222('0x3d')]];}RpcVoiceCallReport[_0x2222('0x29')](_0x43caf9);if(_0x43caf9[_0x2222('0x40')]){for(var _0x16262c=0x0;_0x16262c<_0x43caf9[_0x2222('0x41')][_0x2222('0x42')];_0x16262c+=0x1){_0x43caf9[_0x2222('0x43')]=_0x43caf9[_0x2222('0x41')][_0x16262c][_0x2222('0x44')];_0x43caf9['createdAt']=_0x43caf9[_0x2222('0x41')][_0x16262c]['createdAt'];if(_0x43caf9[_0x2222('0x2c')]==_0x2222('0x34')){_0x43caf9[_0x2222('0x36')]=_0x43caf9[_0x2222('0x22')];_0x43caf9[_0x2222('0x3c')]=_0x43caf9['connectedlinename'];_0x43caf9[_0x2222('0x22')]=_0x43caf9[_0x2222('0x1d')];_0x43caf9[_0x2222('0x45')]=_0x43caf9[_0x2222('0x46')];_0x43caf9[_0x2222('0x2c')]=_0x43caf9[_0x2222('0x37')];}else if(_0x43caf9[_0x2222('0x2c')]==_0x2222('0x47')){_0x43caf9[_0x2222('0x36')]=_0x43caf9[_0x2222('0x2b')];_0x43caf9['exten']=_0x43caf9[_0x2222('0x37')];}RpcVoiceRecording[_0x2222('0x29')](_0x43caf9);}}};Report[_0x2222('0xd')][_0x2222('0x17')]=function(_0x1c30c7){if(_['isArray'](_0x1c30c7)){_0x1c30c7[_0x2222('0x48')](function(_0x61d068){RpcVoiceAgentReport[_0x2222('0x29')](_0x61d068);});}else{RpcVoiceAgentReport['create'](_0x1c30c7);}};Report[_0x2222('0xd')][_0x2222('0x18')]=function(_0x139cec){RpcVoiceDialReport[_0x2222('0x29')](_0x139cec);var _0x37dfa5;var _0x1bfc25;var _0x5d5b77=_0x139cec[_0x2222('0x38')];if(_[_0x2222('0x49')](_0x5d5b77,'Local')){_0x1bfc25=_0x5d5b77[_0x2222('0x4a')](_0x5d5b77[_0x2222('0x4b')]('/')+0x1,_0x5d5b77[_0x2222('0x4b')]('@'));_0x37dfa5=_[_0x2222('0x1c')](this[_0x2222('0xc')],function(_0x41c37c){return _0x41c37c[_0x2222('0x4c')]==_0x1bfc25||_0x41c37c[_0x2222('0x4d')]==_0x1bfc25||_0x41c37c['accountcode']==_0x1bfc25;});}else{_0x1bfc25=_0x5d5b77['substring'](_0x5d5b77[_0x2222('0x4b')]('/')+0x1,_0x5d5b77[_0x2222('0x4e')]('-'));_0x37dfa5=this[_0x2222('0x1b')](_0x1bfc25);}if(_0x37dfa5){_0x139cec[_0x2222('0x24')]=_[_0x2222('0x1f')](_0x37dfa5['interface'])?util['format'](_0x2222('0x21'),_0x37dfa5[_0x2222('0x1e')]):_0x37dfa5[_0x2222('0x24')];_0x139cec['membername']=_0x37dfa5[_0x2222('0x1e')];_0x139cec[_0x2222('0x1d')]=_0x37dfa5[_0x2222('0x1d')];RpcMemberReport[_0x2222('0x18')](_0x139cec);}};Report[_0x2222('0xd')][_0x2222('0x1a')]=function(_0x1da14f){RpcVoiceTransferReport[_0x2222('0x3e')][_0x1da14f[_0x2222('0x4f')]]=_0x1da14f;};Report[_0x2222('0xd')][_0x2222('0x50')]=function(_0x4ae99a){RpcVoiceTransferReport['attendedTransfer'](_0x4ae99a);};module[_0x2222('0x51')]=Report; \ No newline at end of file +var _0x8d02=['interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','accountcode','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','lastapplication','lastdata','queue','context','from-voip-provider','callerid','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','disposition','\x22%s\x22\x20<%s>','calleridname','transfers','transfereelinkedid','blindTransfer','linkedid','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceTransferReport','./voiceCallReport','agents','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','telephones'];(function(_0x291103,_0x2cf1cd){var _0x540e84=function(_0x4dd2f3){while(--_0x4dd2f3){_0x291103['push'](_0x291103['shift']());}};_0x540e84(++_0x2cf1cd);}(_0x8d02,0x134));var _0x28d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8d02[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x28d0('0x0'));var moment=require(_0x28d0('0x1'));var util=require('util');var config=require(_0x28d0('0x2'));var ami=require(_0x28d0('0x3'));var RpcVoiceAgentReport=require(_0x28d0('0x4'));var RpcVoiceCallReport=require(_0x28d0('0x5'));var RpcVoiceDialReport=require(_0x28d0('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x28d0('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x28d0('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x3ef5fb){this['realtime']=_0x3ef5fb;this['agents']=_0x3ef5fb[_0x28d0('0x9')];this['telephones']=_0x3ef5fb['telephones'];}Report[_0x28d0('0xa')][_0x28d0('0xb')]=function(_0x60706f){var _0x1b2d76=new VoiceQueueReport(this['realtime']);var _0x16933a=new VoiceAgentReport(this[_0x28d0('0xc')]);var _0x10a4b4=new VoiceDialReport(this[_0x28d0('0xc')]);var _0x48dca6=new VoiceCallReport(this[_0x28d0('0xc')]);var _0x3601be=new UserReport(this[_0x28d0('0xc')]);if(config[_0x28d0('0xd')]&&config[_0x28d0('0xd')][_0x28d0('0xe')]){ami['on'](_0x28d0('0xf'),this['voiceQueueReport'][_0x28d0('0x10')](this));ami['on'](_0x28d0('0x11'),this[_0x28d0('0x12')][_0x28d0('0x10')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0x28d0('0x10')](this));ami['on'](_0x28d0('0x13'),this[_0x28d0('0x14')][_0x28d0('0x10')](this));ami['on']('blindtransfer',this['blindTransfer'][_0x28d0('0x10')](this));ami['on'](_0x28d0('0x15'),this[_0x28d0('0x16')][_0x28d0('0x10')](this));}};Report[_0x28d0('0xa')][_0x28d0('0x17')]=function(_0x87b79f){var _0x2e8c2a;_0x2e8c2a=_[_0x28d0('0x18')](this[_0x28d0('0x9')],function(_0x115cfe){return _0x115cfe['accountcode']==_0x87b79f||_0x115cfe[_0x28d0('0x19')]==_0x87b79f;});if(_[_0x28d0('0x1a')](_0x2e8c2a)){var _0x3f30b3=_[_0x28d0('0x18')](this[_0x28d0('0x1b')],function(_0x36f859){return _0x36f859['accountcode']==_0x87b79f||_0x36f859[_0x28d0('0x19')]==_0x87b79f;});if(_0x3f30b3){_0x2e8c2a=_[_0x28d0('0x18')](this[_0x28d0('0x9')],function(_0x2e7581){return _0x2e7581[_0x28d0('0x1c')]==util[_0x28d0('0x1d')](_0x28d0('0x1e'),_0x3f30b3[_0x28d0('0x19')]);});}}return _0x2e8c2a;};Report['prototype'][_0x28d0('0x1f')]=function(_0x355bfd){for(var _0x4f57df=0x0;_0x4f57df<_0x355bfd[_0x28d0('0x20')];_0x4f57df+=0x1){var _0x5a41ad=this['findAgent'](_0x355bfd[_0x4f57df][_0x28d0('0x21')]);if(_0x5a41ad){_0x355bfd[_0x4f57df][_0x28d0('0x22')]=_0x5a41ad[_0x28d0('0x22')];_0x355bfd[_0x4f57df][_0x28d0('0x23')]=!![];_0x355bfd[_0x4f57df][_0x28d0('0x24')]=_0x5a41ad['name'];_0x355bfd[_0x4f57df][_0x28d0('0x1c')]=_['isNil'](_0x5a41ad[_0x28d0('0x1c')])?util['format'](_0x28d0('0x1e'),_0x5a41ad[_0x28d0('0x19')]):_0x5a41ad['interface'];if(_0x355bfd[_0x4f57df][_0x28d0('0x25')]){_0x355bfd[_0x4f57df][_0x28d0('0x26')]=moment()[_0x28d0('0x1d')](_0x28d0('0x27'));}if(_0x355bfd[_0x4f57df][_0x28d0('0x28')]){_0x355bfd[_0x4f57df][_0x28d0('0x29')]=moment()['format'](_0x28d0('0x27'));}RpcMemberReport[_0x28d0('0x1f')](_0x355bfd[_0x4f57df]);}RpcVoiceQueueReport[_0x28d0('0x2a')](_0x355bfd[_0x4f57df]);}};function extractCalleridNumber(_0x4c40c5){var _0x48a54c=_0x4c40c5[_0x28d0('0x2b')](/<(.*?)>/);return _0x48a54c?_0x48a54c[0x1]:_0x4c40c5;}Report['prototype'][_0x28d0('0x12')]=function(_0x2c5f9c){_0x2c5f9c[_0x28d0('0x2c')]=_0x2c5f9c[_0x28d0('0x2c')]||_0x2c5f9c[_0x28d0('0x2d')];if(_0x2c5f9c[_0x28d0('0x2e')]=='dialer'){_0x2c5f9c[_0x28d0('0x2f')]='queue';_0x2c5f9c[_0x28d0('0x30')]=_0x2c5f9c[_0x28d0('0x31')];if(_0x2c5f9c[_0x28d0('0x32')]==_0x28d0('0x33')){_0x2c5f9c['accountcode']='';_0x2c5f9c['destination']=extractCalleridNumber(_0x2c5f9c[_0x28d0('0x34')]);}else if(_0x2c5f9c[_0x28d0('0x32')]=='from-sip'){if(_0x2c5f9c[_0x28d0('0x2c')]==_0x28d0('0x35')){_0x2c5f9c['destination']=extractCalleridNumber(_0x2c5f9c['calleridpreview']);_0x2c5f9c[_0x28d0('0x36')]=_0x2c5f9c[_0x28d0('0x37')];_0x2c5f9c[_0x28d0('0x38')]=[_0x2c5f9c[_0x28d0('0x39')],_0x2c5f9c[_0x28d0('0x39')]=_0x2c5f9c[_0x28d0('0x38')]][0x0];_0x2c5f9c['callerid']=_0x2c5f9c[_0x28d0('0x3a')];}else{_0x2c5f9c[_0x28d0('0x2c')]=_0x2c5f9c[_0x28d0('0x36')];_0x2c5f9c[_0x28d0('0x36')]=_0x2c5f9c[_0x28d0('0x37')];if(_0x2c5f9c[_0x28d0('0x3b')]=='ANSWERED'){_0x2c5f9c[_0x28d0('0x22')]=_0x2c5f9c['connectedlinenum'];}else{_0x2c5f9c['accountcode']='';}}}}else{_0x2c5f9c['callerid']=util[_0x28d0('0x1d')](_0x28d0('0x3c'),_0x2c5f9c[_0x28d0('0x3d')],_0x2c5f9c[_0x28d0('0x36')]);}if(RpcVoiceTransferReport['transfers'][_0x2c5f9c['linkedid']]){var _0x1f3079=RpcVoiceTransferReport[_0x28d0('0x3e')][_0x2c5f9c['linkedid']];_0x1f3079[_0x28d0('0x3f')]=_0x2c5f9c['uniqueid'];RpcVoiceTransferReport[_0x28d0('0x40')](_0x1f3079);delete RpcVoiceTransferReport[_0x28d0('0x3e')][_0x2c5f9c[_0x28d0('0x41')]];}RpcVoiceCallReport[_0x28d0('0x2a')](_0x2c5f9c);if(_0x2c5f9c['monitor']){for(var _0x5adcbf=0x0;_0x5adcbf<_0x2c5f9c[_0x28d0('0x42')][_0x28d0('0x20')];_0x5adcbf+=0x1){_0x2c5f9c[_0x28d0('0x43')]=_0x2c5f9c[_0x28d0('0x42')][_0x5adcbf][_0x28d0('0x44')];_0x2c5f9c[_0x28d0('0x45')]=_0x2c5f9c[_0x28d0('0x42')][_0x5adcbf][_0x28d0('0x45')];if(_0x2c5f9c[_0x28d0('0x2d')]==_0x28d0('0x35')){_0x2c5f9c['calleridnum']=_0x2c5f9c[_0x28d0('0x21')];_0x2c5f9c[_0x28d0('0x3d')]=_0x2c5f9c['connectedlinename'];_0x2c5f9c[_0x28d0('0x21')]=_0x2c5f9c[_0x28d0('0x22')];_0x2c5f9c[_0x28d0('0x46')]=_0x2c5f9c[_0x28d0('0x47')];_0x2c5f9c[_0x28d0('0x2d')]=_0x2c5f9c[_0x28d0('0x37')];}else if(_0x2c5f9c[_0x28d0('0x2d')]==_0x28d0('0x48')){_0x2c5f9c[_0x28d0('0x36')]=_0x2c5f9c[_0x28d0('0x2c')];_0x2c5f9c['exten']=_0x2c5f9c[_0x28d0('0x37')];}RpcVoiceRecording[_0x28d0('0x2a')](_0x2c5f9c);}}};Report[_0x28d0('0xa')][_0x28d0('0x49')]=function(_0x3315e4){if(_[_0x28d0('0x4a')](_0x3315e4)){_0x3315e4[_0x28d0('0x4b')](function(_0x43e9ea){RpcVoiceAgentReport[_0x28d0('0x2a')](_0x43e9ea);});}else{RpcVoiceAgentReport[_0x28d0('0x2a')](_0x3315e4);}};Report[_0x28d0('0xa')]['voiceDialReport']=function(_0x3d661b){RpcVoiceDialReport[_0x28d0('0x2a')](_0x3d661b);var _0x10f061;var _0x1abc31;var _0x4e1cf3=_0x3d661b['channel'];if(_[_0x28d0('0x4c')](_0x4e1cf3,'Local')){_0x1abc31=_0x4e1cf3[_0x28d0('0x4d')](_0x4e1cf3[_0x28d0('0x4e')]('/')+0x1,_0x4e1cf3['indexOf']('@'));_0x10f061=_[_0x28d0('0x18')](this[_0x28d0('0x9')],function(_0x1a9d00){return _0x1a9d00[_0x28d0('0x4f')]==_0x1abc31||_0x1a9d00[_0x28d0('0x50')]==_0x1abc31||_0x1a9d00[_0x28d0('0x22')]==_0x1abc31;});}else{_0x1abc31=_0x4e1cf3[_0x28d0('0x4d')](_0x4e1cf3[_0x28d0('0x4e')]('/')+0x1,_0x4e1cf3[_0x28d0('0x51')]('-'));_0x10f061=this[_0x28d0('0x17')](_0x1abc31);}if(_0x10f061){_0x3d661b[_0x28d0('0x1c')]=_[_0x28d0('0x1a')](_0x10f061['interface'])?util['format'](_0x28d0('0x1e'),_0x10f061[_0x28d0('0x19')]):_0x10f061[_0x28d0('0x1c')];_0x3d661b['membername']=_0x10f061['name'];_0x3d661b[_0x28d0('0x22')]=_0x10f061[_0x28d0('0x22')];RpcMemberReport[_0x28d0('0x14')](_0x3d661b);}};Report['prototype'][_0x28d0('0x40')]=function(_0x2b6233){RpcVoiceTransferReport['transfers'][_0x2b6233[_0x28d0('0x52')]]=_0x2b6233;};Report[_0x28d0('0xa')]['attendedTransfer']=function(_0x5de86f){RpcVoiceTransferReport[_0x28d0('0x16')](_0x5de86f);};module[_0x28d0('0x53')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index c401eb2..06fa6c6 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94d4=['local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','peerstatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:%s','moment','util','bluebird','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','syncPeerStatus','syncRealtimeShow','then','catch','error','inspect','resolve','[userReport][devicestatelist]','actionSipPeerStatus','prototype','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','username','stateRegistry','merge','omit','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x94d4,0xac));var _0x494d=function(_0x1be03a,_0x3bd43f){_0x1be03a=_0x1be03a-0x0;var _0x162495=_0x94d4[_0x1be03a];return _0x162495;};'use strict';var _=require('lodash');var moment=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var Redis=require('ioredis');var BPromise=require(_0x494d('0x2'));var config=require(_0x494d('0x3'));var logger=require(_0x494d('0x4'))('ami');var ami=require(_0x494d('0x5'));config['redis']=_['defaults'](config[_0x494d('0x6')],{'host':_0x494d('0x7'),'port':0x18eb});var io=require(_0x494d('0x8'))(new Redis(config[_0x494d('0x6')]));function UserReport(_0x21dd36){this['trunks']=_0x21dd36[_0x494d('0x9')];this[_0x494d('0xa')]=_0x21dd36[_0x494d('0xa')];this['telephones']=_0x21dd36[_0x494d('0xb')];ami['on'](_0x494d('0xc'),this[_0x494d('0xd')][_0x494d('0xe')](this));ami['on'](_0x494d('0xf'),this[_0x494d('0xd')][_0x494d('0xe')](this));ami['on']('devicestatechange',this[_0x494d('0x10')][_0x494d('0xe')](this));ami['on']('peerstatus',this[_0x494d('0x11')][_0x494d('0xe')](this));return this[_0x494d('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0x494d('0x13')](ami['actionSipShowRegistry']())[_0x494d('0x14')](function(_0x56b3bd){logger[_0x494d('0x15')]('[userReport][sipshowregistry]',util[_0x494d('0x16')](_0x56b3bd,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x494d('0x17')]()[_0x494d('0x13')](ami['actionDeviceStateList']())[_0x494d('0x14')](function(_0x4280e4){logger[_0x494d('0x15')](_0x494d('0x18'),util[_0x494d('0x16')](_0x4280e4,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x494d('0x17')]()[_0x494d('0x13')](ami[_0x494d('0x19')]())[_0x494d('0x14')](function(_0x267f77){logger[_0x494d('0x15')]('[userReport][sippeerstatus]',util[_0x494d('0x16')](_0x267f77,{'showHidden':![],'depth':null}));});}UserReport[_0x494d('0x1a')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x494d('0x17')]()[_0x494d('0x13')](showSipRegistrations())[_0x494d('0x13')](listDeviceStates())[_0x494d('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x494d('0x1a')]['isNotNull']=function(_0x5993d0){return _0x5993d0!==null&&!_['isUndefined'](_0x5993d0);};UserReport[_0x494d('0x1a')]['emit']=function(_0x109e89,_0x120d40,_0x7b32e8){io['to'](_0x109e89)[_0x494d('0x1b')](_0x120d40,_0x7b32e8);};UserReport[_0x494d('0x1a')][_0x494d('0xd')]=function(_0x1d4363){try{if(this[_0x494d('0x1c')](_0x1d4363)){logger[_0x494d('0x1d')](_0x494d('0x1e'),_0x1d4363['username'],_0x1d4363[_0x494d('0x1f')]);logger['debug']('[userReport][registry]',util[_0x494d('0x16')](_0x1d4363,{'showHidden':![],'depth':null}));var _0xeb40ad=_[_0x494d('0x20')](this[_0x494d('0x9')],{'defaultuser':_0x1d4363[_0x494d('0x21')]});if(_0xeb40ad){_0x1d4363[_0x494d('0x22')]=_0x1d4363[_0x494d('0x1f')];_[_0x494d('0x23')](_0xeb40ad,_[_0x494d('0x24')](_0x1d4363,['event',_0x494d('0x25'),_0x494d('0x21'),_0x494d('0x1f')]));logger[_0x494d('0x26')](_0x494d('0x27'),util[_0x494d('0x16')](_0xeb40ad,{'showHidden':![],'depth':null}));this[_0x494d('0x1b')](util[_0x494d('0x28')]('trunk:%s',_0xeb40ad[_0x494d('0x29')]),_0x494d('0x2a'),_0xeb40ad);}}}catch(_0x5c45ba){logger[_0x494d('0x15')](_0x494d('0x2b'),util[_0x494d('0x16')](_0x5c45ba,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x5a23d4){try{if(this['isNotNull'](_0x5a23d4)){logger[_0x494d('0x1d')](_0x494d('0x2c'),_0x5a23d4['device'],_0x5a23d4[_0x494d('0x1f')]);logger[_0x494d('0x26')](_0x494d('0x2d'),util['inspect'](_0x5a23d4,{'showHidden':![],'depth':null}));if(this[_0x494d('0xa')][_0x5a23d4[_0x494d('0x2e')]]){if(!this[_0x494d('0xa')][_0x5a23d4[_0x494d('0x2e')]][_0x494d('0x2f')]||_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]()==_0x494d('0x31')){this['agents'][_0x5a23d4[_0x494d('0x2e')]][_0x494d('0x2f')]=![];if(this[_0x494d('0xa')][_0x5a23d4['device']][_0x494d('0x1f')]!==_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]()){this[_0x494d('0xa')][_0x5a23d4['device']][_0x494d('0x32')]=_[_0x494d('0x33')](moment()[_0x494d('0x28')]('x'));}this[_0x494d('0xa')][_0x5a23d4['device']]['state']=_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]();this[_0x494d('0xa')][_0x5a23d4['device']][_0x494d('0x34')](_0x5a23d4);}}else if(this[_0x494d('0xb')][_0x5a23d4[_0x494d('0x2e')]]){if(this[_0x494d('0xb')][_0x5a23d4[_0x494d('0x2e')]][_0x494d('0x1f')]!==_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]()){this['telephones'][_0x5a23d4[_0x494d('0x2e')]][_0x494d('0x32')]=_[_0x494d('0x33')](moment()[_0x494d('0x28')]('x'));}this[_0x494d('0xb')][_0x5a23d4[_0x494d('0x2e')]][_0x494d('0x1f')]=_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]();logger[_0x494d('0x26')](_0x494d('0x35'),util['inspect'](this[_0x494d('0xb')][_0x5a23d4[_0x494d('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x494d('0x28')](_0x494d('0x36'),this[_0x494d('0xb')][_0x5a23d4[_0x494d('0x2e')]]['name']),_0x494d('0x37'),this[_0x494d('0xb')][_0x5a23d4[_0x494d('0x2e')]]);}else if(this['trunks'][_0x5a23d4[_0x494d('0x2e')]]){if(this[_0x494d('0x9')][_0x5a23d4['device']][_0x494d('0x1f')]!==_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]()){this[_0x494d('0x9')][_0x5a23d4[_0x494d('0x2e')]]['stateTime']=_[_0x494d('0x33')](moment()[_0x494d('0x28')]('x'));}this[_0x494d('0x9')][_0x5a23d4[_0x494d('0x2e')]]['state']=_0x5a23d4[_0x494d('0x1f')][_0x494d('0x30')]();logger['debug'](_0x494d('0x38'),util[_0x494d('0x16')](this['trunks'][_0x5a23d4[_0x494d('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x494d('0x28')]('trunk:%s',this[_0x494d('0x9')][_0x5a23d4[_0x494d('0x2e')]]['name']),_0x494d('0x2a'),this['trunks'][_0x5a23d4[_0x494d('0x2e')]]);}else if(_[_0x494d('0x39')](_0x5a23d4[_0x494d('0x2e')],_0x494d('0x3a'))){var _0x1f2d8c=_0x5a23d4[_0x494d('0x2e')];var _0x25f748=_0x1f2d8c[_0x494d('0x3b')](_0x1f2d8c[_0x494d('0x3c')]('/')+0x1,_0x1f2d8c[_0x494d('0x3c')]('@'));var _0x2d6c7b=_[_0x494d('0x20')](this['agents'],function(_0x57c08e){return _0x57c08e[_0x494d('0x3d')]==_0x25f748||_0x57c08e[_0x494d('0x3e')]==_0x25f748||_0x57c08e[_0x494d('0x3f')]==_0x25f748;});if(_0x2d6c7b){if(_0x2d6c7b[_0x494d('0x1f')]!==_0x5a23d4['state']['toLowerCase']()){_0x2d6c7b[_0x494d('0x32')]=_[_0x494d('0x33')](moment()[_0x494d('0x28')]('x'));}_0x2d6c7b[_0x494d('0x1f')]=_0x5a23d4['state'][_0x494d('0x30')]();_0x2d6c7b['local']=!![];_0x2d6c7b[_0x494d('0x34')](_0x5a23d4);}}}}catch(_0x4745ee){logger[_0x494d('0x15')](_0x494d('0x2d'),util[_0x494d('0x16')](_0x4745ee,{'showHidden':![],'depth':null}));}};UserReport[_0x494d('0x1a')][_0x494d('0x11')]=function(_0x5b6fe9){try{if(this[_0x494d('0x1c')](_0x5b6fe9)&&this[_0x494d('0x1c')](_0x5b6fe9[_0x494d('0x40')])){logger[_0x494d('0x1d')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x5b6fe9[_0x494d('0x41')],_0x5b6fe9[_0x494d('0x42')],_0x5b6fe9['peerstatus']);logger['debug'](_0x494d('0x43'),util[_0x494d('0x16')](_0x5b6fe9,{'showHidden':![],'depth':null}));if(this[_0x494d('0xa')][_0x5b6fe9['peer']]){if(!this[_0x494d('0xa')][_0x5b6fe9[_0x494d('0x41')]][_0x494d('0x2f')]||_0x5b6fe9[_0x494d('0x40')][_0x494d('0x30')]()==_0x494d('0x44')){this[_0x494d('0xa')][_0x5b6fe9[_0x494d('0x41')]][_0x494d('0x2f')]=![];this['agents'][_0x5b6fe9['peer']][_0x494d('0x45')]=_0x5b6fe9['peerstatus'][_0x494d('0x30')]();this['agents'][_0x5b6fe9['peer']][_0x494d('0x42')]=_0x5b6fe9[_0x494d('0x42')];this[_0x494d('0xa')][_0x5b6fe9[_0x494d('0x41')]]['updateStatusRealtime'](_0x5b6fe9);}}else if(this[_0x494d('0xb')][_0x5b6fe9['peer']]){this[_0x494d('0xb')][_0x5b6fe9[_0x494d('0x41')]][_0x494d('0x45')]=_0x5b6fe9['peerstatus']['toLowerCase']();this[_0x494d('0xb')][_0x5b6fe9['peer']]['address']=_0x5b6fe9['address'];logger[_0x494d('0x26')](_0x494d('0x46'),util[_0x494d('0x16')](this[_0x494d('0xb')][_0x5b6fe9[_0x494d('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x494d('0x28')](_0x494d('0x36'),this[_0x494d('0xb')][_0x5b6fe9[_0x494d('0x41')]][_0x494d('0x29')]),_0x494d('0x37'),this[_0x494d('0xb')][_0x5b6fe9[_0x494d('0x41')]]);}else if(this['trunks'][_0x5b6fe9[_0x494d('0x41')]]){this[_0x494d('0x9')][_0x5b6fe9['peer']][_0x494d('0x45')]=_0x5b6fe9['peerstatus']['toLowerCase']();this[_0x494d('0x9')][_0x5b6fe9[_0x494d('0x41')]][_0x494d('0x42')]=_0x5b6fe9[_0x494d('0x42')];logger[_0x494d('0x26')](_0x494d('0x47'),util[_0x494d('0x16')](this[_0x494d('0x9')][_0x5b6fe9[_0x494d('0x41')]],{'showHidden':![],'depth':null}));this[_0x494d('0x1b')](util['format'](_0x494d('0x48'),this[_0x494d('0x9')][_0x5b6fe9['peer']][_0x494d('0x29')]),_0x494d('0x2a'),this['trunks'][_0x5b6fe9[_0x494d('0x41')]]);}}}catch(_0x529ebd){logger[_0x494d('0x15')]('[userReport][peerstatus]',util[_0x494d('0x16')](_0x529ebd,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x6b1f=['emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','stateRegistry','merge','omit','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local','indexOf','find','mobile','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','error','actionDeviceStateList','catch','[userReport][devicestatelist]','inspect','actionSipPeerStatus','prototype','isNotNull','isUndefined'];(function(_0x2f6ba4,_0x59e07a){var _0x1e3d24=function(_0x188c6b){while(--_0x188c6b){_0x2f6ba4['push'](_0x2f6ba4['shift']());}};_0x1e3d24(++_0x59e07a);}(_0x6b1f,0xbd));var _0xf6b1=function(_0x33ddea,_0x1ac3ef){_0x33ddea=_0x33ddea-0x0;var _0x44b2c9=_0x6b1f[_0x33ddea];return _0x44b2c9;};'use strict';var _=require(_0xf6b1('0x0'));var moment=require(_0xf6b1('0x1'));var util=require(_0xf6b1('0x2'));var Redis=require(_0xf6b1('0x3'));var BPromise=require('bluebird');var config=require(_0xf6b1('0x4'));var logger=require(_0xf6b1('0x5'))(_0xf6b1('0x6'));var ami=require(_0xf6b1('0x7'));config[_0xf6b1('0x8')]=_[_0xf6b1('0x9')](config[_0xf6b1('0x8')],{'host':_0xf6b1('0xa'),'port':0x18eb});var io=require(_0xf6b1('0xb'))(new Redis(config[_0xf6b1('0x8')]));function UserReport(_0x260f97){this['trunks']=_0x260f97[_0xf6b1('0xc')];this[_0xf6b1('0xd')]=_0x260f97[_0xf6b1('0xd')];this['telephones']=_0x260f97[_0xf6b1('0xe')];ami['on'](_0xf6b1('0xf'),this[_0xf6b1('0x10')][_0xf6b1('0x11')](this));ami['on'](_0xf6b1('0x12'),this[_0xf6b1('0x10')][_0xf6b1('0x11')](this));ami['on'](_0xf6b1('0x13'),this[_0xf6b1('0x14')][_0xf6b1('0x11')](this));ami['on'](_0xf6b1('0x15'),this[_0xf6b1('0x16')][_0xf6b1('0x11')](this));return this[_0xf6b1('0x17')]();}function showSipRegistrations(){Promise[_0xf6b1('0x18')]()[_0xf6b1('0x19')](ami[_0xf6b1('0x1a')]())['catch'](function(_0x533467){logger[_0xf6b1('0x1b')]('[userReport][sipshowregistry]',util['inspect'](_0x533467,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xf6b1('0x19')](ami[_0xf6b1('0x1c')]())[_0xf6b1('0x1d')](function(_0x54073e){logger[_0xf6b1('0x1b')](_0xf6b1('0x1e'),util[_0xf6b1('0x1f')](_0x54073e,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf6b1('0x18')]()[_0xf6b1('0x19')](ami[_0xf6b1('0x20')]())[_0xf6b1('0x1d')](function(_0x104c63){logger[_0xf6b1('0x1b')]('[userReport][sippeerstatus]',util[_0xf6b1('0x1f')](_0x104c63,{'showHidden':![],'depth':null}));});}UserReport[_0xf6b1('0x21')][_0xf6b1('0x17')]=function(){setInterval(function(){BPromise['resolve']()[_0xf6b1('0x19')](showSipRegistrations())['then'](listDeviceStates())[_0xf6b1('0x19')](showPeersStatus());},0x32c8);};UserReport[_0xf6b1('0x21')][_0xf6b1('0x22')]=function(_0x445161){return _0x445161!==null&&!_[_0xf6b1('0x23')](_0x445161);};UserReport[_0xf6b1('0x21')][_0xf6b1('0x24')]=function(_0x7b99b6,_0x13ea6d,_0x3dacea){io['to'](_0x7b99b6)[_0xf6b1('0x24')](_0x13ea6d,_0x3dacea);};UserReport[_0xf6b1('0x21')][_0xf6b1('0x10')]=function(_0x39a0d6){try{if(this[_0xf6b1('0x22')](_0x39a0d6)){logger[_0xf6b1('0x25')](_0xf6b1('0x26'),_0x39a0d6[_0xf6b1('0x27')],_0x39a0d6[_0xf6b1('0x28')]);logger['debug'](_0xf6b1('0x29'),util[_0xf6b1('0x1f')](_0x39a0d6,{'showHidden':![],'depth':null}));var _0x58eeb6=_['find'](this[_0xf6b1('0xc')],{'defaultuser':_0x39a0d6[_0xf6b1('0x27')]});if(_0x58eeb6){_0x39a0d6[_0xf6b1('0x2a')]=_0x39a0d6[_0xf6b1('0x28')];_[_0xf6b1('0x2b')](_0x58eeb6,_[_0xf6b1('0x2c')](_0x39a0d6,['event',_0xf6b1('0x2d'),_0xf6b1('0x27'),_0xf6b1('0x28')]));logger[_0xf6b1('0x2e')](_0xf6b1('0x2f'),util['inspect'](_0x58eeb6,{'showHidden':![],'depth':null}));this['emit'](util[_0xf6b1('0x30')]('trunk:%s',_0x58eeb6[_0xf6b1('0x31')]),'trunk:save',_0x58eeb6);}}}catch(_0x1e76c5){logger[_0xf6b1('0x1b')](_0xf6b1('0x29'),util[_0xf6b1('0x1f')](_0x1e76c5,{'showHidden':![],'depth':null}));}};UserReport[_0xf6b1('0x21')][_0xf6b1('0x14')]=function(_0xfbc9ae){try{if(this['isNotNull'](_0xfbc9ae)){logger[_0xf6b1('0x25')](_0xf6b1('0x32'),_0xfbc9ae[_0xf6b1('0x33')],_0xfbc9ae[_0xf6b1('0x28')]);logger[_0xf6b1('0x2e')]('[userReport][devicestatechange]',util['inspect'](_0xfbc9ae,{'showHidden':![],'depth':null}));if(this[_0xf6b1('0xd')][_0xfbc9ae[_0xf6b1('0x33')]]){if(!this[_0xf6b1('0xd')][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x34')]||_0xfbc9ae['state'][_0xf6b1('0x35')]()=='inuse'){this[_0xf6b1('0xd')][_0xfbc9ae['device']][_0xf6b1('0x34')]=![];if(this[_0xf6b1('0xd')][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x28')]!==_0xfbc9ae[_0xf6b1('0x28')]['toLowerCase']()){this['agents'][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x36')]=_['toNumber'](moment()[_0xf6b1('0x30')]('x'));}this[_0xf6b1('0xd')][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x28')]=_0xfbc9ae[_0xf6b1('0x28')][_0xf6b1('0x35')]();this[_0xf6b1('0xd')][_0xfbc9ae['device']][_0xf6b1('0x37')](_0xfbc9ae);}}else if(this[_0xf6b1('0xe')][_0xfbc9ae[_0xf6b1('0x33')]]){if(this[_0xf6b1('0xe')][_0xfbc9ae[_0xf6b1('0x33')]]['state']!==_0xfbc9ae[_0xf6b1('0x28')][_0xf6b1('0x35')]()){this['telephones'][_0xfbc9ae[_0xf6b1('0x33')]]['stateTime']=_[_0xf6b1('0x38')](moment()[_0xf6b1('0x30')]('x'));}this[_0xf6b1('0xe')][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x28')]=_0xfbc9ae[_0xf6b1('0x28')][_0xf6b1('0x35')]();logger[_0xf6b1('0x2e')](_0xf6b1('0x39'),util[_0xf6b1('0x1f')](this['telephones'][_0xfbc9ae[_0xf6b1('0x33')]],{'showHidden':![],'depth':null}));this[_0xf6b1('0x24')](util[_0xf6b1('0x30')]('telephone:%s',this[_0xf6b1('0xe')][_0xfbc9ae['device']][_0xf6b1('0x31')]),_0xf6b1('0x3a'),this['telephones'][_0xfbc9ae[_0xf6b1('0x33')]]);}else if(this[_0xf6b1('0xc')][_0xfbc9ae[_0xf6b1('0x33')]]){if(this[_0xf6b1('0xc')][_0xfbc9ae['device']][_0xf6b1('0x28')]!==_0xfbc9ae[_0xf6b1('0x28')][_0xf6b1('0x35')]()){this[_0xf6b1('0xc')][_0xfbc9ae['device']][_0xf6b1('0x36')]=_[_0xf6b1('0x38')](moment()[_0xf6b1('0x30')]('x'));}this[_0xf6b1('0xc')][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x28')]=_0xfbc9ae['state'][_0xf6b1('0x35')]();logger[_0xf6b1('0x2e')](_0xf6b1('0x3b'),util[_0xf6b1('0x1f')](this['trunks'][_0xfbc9ae[_0xf6b1('0x33')]],{'showHidden':![],'depth':null}));this[_0xf6b1('0x24')](util[_0xf6b1('0x30')]('trunk:%s',this[_0xf6b1('0xc')][_0xfbc9ae[_0xf6b1('0x33')]][_0xf6b1('0x31')]),_0xf6b1('0x3c'),this['trunks'][_0xfbc9ae['device']]);}else if(_['startsWith'](_0xfbc9ae[_0xf6b1('0x33')],_0xf6b1('0x3d'))){var _0x3ae493=_0xfbc9ae[_0xf6b1('0x33')];var _0x38f7a7=_0x3ae493['substring'](_0x3ae493[_0xf6b1('0x3e')]('/')+0x1,_0x3ae493['indexOf']('@'));var _0x5cf1a9=_[_0xf6b1('0x3f')](this[_0xf6b1('0xd')],function(_0x1f70e0){return _0x1f70e0[_0xf6b1('0x40')]==_0x38f7a7||_0x1f70e0[_0xf6b1('0x41')]==_0x38f7a7||_0x1f70e0['accountcode']==_0x38f7a7;});if(_0x5cf1a9){if(_0x5cf1a9['state']!==_0xfbc9ae[_0xf6b1('0x28')][_0xf6b1('0x35')]()){_0x5cf1a9[_0xf6b1('0x36')]=_['toNumber'](moment()[_0xf6b1('0x30')]('x'));}_0x5cf1a9['state']=_0xfbc9ae[_0xf6b1('0x28')]['toLowerCase']();_0x5cf1a9[_0xf6b1('0x34')]=!![];_0x5cf1a9[_0xf6b1('0x37')](_0xfbc9ae);}}}}catch(_0x14b42d){logger[_0xf6b1('0x1b')]('[userReport][devicestatechange]',util[_0xf6b1('0x1f')](_0x14b42d,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xf6b1('0x16')]=function(_0xfaa0cc){try{if(this[_0xf6b1('0x22')](_0xfaa0cc)&&this[_0xf6b1('0x22')](_0xfaa0cc[_0xf6b1('0x15')])){logger[_0xf6b1('0x25')](_0xf6b1('0x42'),_0xfaa0cc[_0xf6b1('0x43')],_0xfaa0cc[_0xf6b1('0x44')],_0xfaa0cc[_0xf6b1('0x15')]);logger['debug']('[userReport][peerstatus]',util[_0xf6b1('0x1f')](_0xfaa0cc,{'showHidden':![],'depth':null}));if(this[_0xf6b1('0xd')][_0xfaa0cc[_0xf6b1('0x43')]]){if(!this['agents'][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x34')]||_0xfaa0cc['peerstatus'][_0xf6b1('0x35')]()==_0xf6b1('0x45')){this[_0xf6b1('0xd')][_0xfaa0cc['peer']][_0xf6b1('0x34')]=![];this[_0xf6b1('0xd')][_0xfaa0cc['peer']]['status']=_0xfaa0cc[_0xf6b1('0x15')][_0xf6b1('0x35')]();this[_0xf6b1('0xd')][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x44')]=_0xfaa0cc[_0xf6b1('0x44')];this[_0xf6b1('0xd')][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x37')](_0xfaa0cc);}}else if(this['telephones'][_0xfaa0cc[_0xf6b1('0x43')]]){this[_0xf6b1('0xe')][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x46')]=_0xfaa0cc[_0xf6b1('0x15')][_0xf6b1('0x35')]();this['telephones'][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x44')]=_0xfaa0cc[_0xf6b1('0x44')];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0xf6b1('0xe')][_0xfaa0cc[_0xf6b1('0x43')]],{'showHidden':![],'depth':null}));this[_0xf6b1('0x24')](util[_0xf6b1('0x30')](_0xf6b1('0x47'),this[_0xf6b1('0xe')][_0xfaa0cc['peer']][_0xf6b1('0x31')]),_0xf6b1('0x3a'),this[_0xf6b1('0xe')][_0xfaa0cc[_0xf6b1('0x43')]]);}else if(this[_0xf6b1('0xc')][_0xfaa0cc['peer']]){this['trunks'][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x46')]=_0xfaa0cc[_0xf6b1('0x15')][_0xf6b1('0x35')]();this['trunks'][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x44')]=_0xfaa0cc[_0xf6b1('0x44')];logger[_0xf6b1('0x2e')](_0xf6b1('0x48'),util[_0xf6b1('0x1f')](this[_0xf6b1('0xc')][_0xfaa0cc[_0xf6b1('0x43')]],{'showHidden':![],'depth':null}));this[_0xf6b1('0x24')](util[_0xf6b1('0x30')]('trunk:%s',this[_0xf6b1('0xc')][_0xfaa0cc[_0xf6b1('0x43')]][_0xf6b1('0x31')]),_0xf6b1('0x3c'),this['trunks'][_0xfaa0cc[_0xf6b1('0x43')]]);}}}catch(_0x2aeea7){logger[_0xf6b1('0x1b')](_0xf6b1('0x49'),util['inspect'](_0x2aeea7,{'showHidden':![],'depth':null}));}};module[_0xf6b1('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index e80f817..dcbeaaa 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x43e362,_0x3e972a){var _0x4c3b96=function(_0x5ae64b){while(--_0x5ae64b){_0x43e362['push'](_0x43e362['shift']());}};_0x4c3b96(++_0x3e972a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x441dd4,_0x582db9){var _0x54ea8b=function(_0x308f42){while(--_0x308f42){_0x441dd4['push'](_0x441dd4['shift']());}};_0x54ea8b(++_0x582db9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index b6c844b..57c3c3c 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4af7=['newchannel','syncNewChannel','bind','newstate','varset','syncVarSet','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','inspect','isNotNull','isUndefined','prototype','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','context','from-sip','channel','split','xcally-motion-preview','connectedlinenum','emit','format','user:%s','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','destconnectedlinenum','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','applicationdata','duration','subtract','seconds','keys','includes','lastapplication','lastdata','cdr(','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','calleridnum','channelstate','UserId','membername','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','diff','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','transferType','then','undefined','isEmpty','monitors','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','destinationchannel','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newexten'];(function(_0x48881b,_0x2e62bb){var _0x1c2b1d=function(_0x194519){while(--_0x194519){_0x48881b['push'](_0x48881b['shift']());}};_0x1c2b1d(++_0x2e62bb);}(_0x4af7,0x168));var _0x74af=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x4af7[_0x1f7201];return _0x289fd2;};'use strict';var _=require('lodash');var moment=require(_0x74af('0x0'));var util=require('util');var path=require('path');var Redis=require(_0x74af('0x1'));var config=require(_0x74af('0x2'));var logger=require(_0x74af('0x3'))(_0x74af('0x4'));var ami=require(_0x74af('0x5'));var Channel=require(_0x74af('0x6'));var RpcSetting=require(_0x74af('0x7'));var applications=[_0x74af('0x8'),_0x74af('0x9'),'agi',_0x74af('0xa'),'playback',_0x74af('0xb')];var dispositions=[_0x74af('0xc'),_0x74af('0xd'),_0x74af('0xd'),_0x74af('0xc'),'NO\x20ANSWER',_0x74af('0xc'),_0x74af('0xe'),_0x74af('0xf'),_0x74af('0xd'),_0x74af('0xd'),_0x74af('0xd')];config[_0x74af('0x10')]=_[_0x74af('0x11')](config['redis'],{'host':_0x74af('0x12'),'port':0x18eb});var io=require(_0x74af('0x13'))(new Redis(config['redis']));function VoiceCallReport(_0x353bdd){this[_0x74af('0x14')]=_0x353bdd[_0x74af('0x14')];this[_0x74af('0x15')]=_0x353bdd[_0x74af('0x15')];this[_0x74af('0x16')]={};ami['on'](_0x74af('0x17'),this[_0x74af('0x18')]['bind'](this));ami['on'](_0x74af('0x19'),this['syncNewExten']['bind'](this));ami['on'](_0x74af('0x1a'),this[_0x74af('0x1b')][_0x74af('0x1c')](this));ami['on'](_0x74af('0x1d'),this['syncNewState'][_0x74af('0x1c')](this));ami['on'](_0x74af('0x1e'),this[_0x74af('0x1f')]['bind'](this));ami['on']('hangup',this[_0x74af('0x20')][_0x74af('0x1c')](this));ami['on']('newcallerid',this[_0x74af('0x21')][_0x74af('0x1c')](this));ami['on'](_0x74af('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x74af('0x23'),this[_0x74af('0x24')][_0x74af('0x1c')](this));ami['on'](_0x74af('0x25'),this[_0x74af('0x26')][_0x74af('0x1c')](this));ami['on'](_0x74af('0x27'),this[_0x74af('0x28')][_0x74af('0x1c')](this));try{logger[_0x74af('0x29')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x74af('0x2a')]();}catch(_0x5e99cc){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x74af('0x2b')](_0x5e99cc,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x74af('0x2c')]=function(_0x5330f5){return _0x5330f5!==null&&!_[_0x74af('0x2d')](_0x5330f5);};VoiceCallReport[_0x74af('0x2e')]['emit']=function(_0x8138fd,_0x343f4a,_0x4dd455){io['to'](_0x8138fd)['emit'](_0x343f4a,_0x4dd455);};VoiceCallReport[_0x74af('0x2e')]['syncNewCallerId']=function(_0x1e8f04){try{if(this[_0x74af('0x2c')](_0x1e8f04)){logger[_0x74af('0x29')](_0x74af('0x2f'),_0x1e8f04[_0x74af('0x30')],_0x1e8f04['calleridname'],_0x1e8f04['calleridnum']);logger[_0x74af('0x31')](_0x74af('0x32'),_0x1e8f04[_0x74af('0x30')],util[_0x74af('0x2b')](_0x1e8f04,{'showHidden':![],'depth':null}));if(_0x1e8f04[_0x74af('0x30')]===_0x1e8f04[_0x74af('0x33')]){if(!_[_0x74af('0x2d')](this[_0x74af('0x14')][_0x1e8f04[_0x74af('0x30')]])){_[_0x74af('0x34')](this[_0x74af('0x14')][_0x1e8f04[_0x74af('0x30')]],_[_0x74af('0x35')](_0x1e8f04,_['keys'](this[_0x74af('0x14')][_0x1e8f04[_0x74af('0x30')]])));}}if(_0x1e8f04[_0x74af('0x36')]===_0x74af('0x37')){if(this[_0x74af('0x15')][_0x1e8f04[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]){if(_0x1e8f04['exten']==_0x74af('0x3a')){this['agents'][_0x1e8f04[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['destconnectedlinenum']=_0x1e8f04[_0x74af('0x3b')];this[_0x74af('0x3c')](util[_0x74af('0x3d')](_0x74af('0x3e'),this[_0x74af('0x15')][_0x1e8f04[_0x74af('0x38')]['split']('-')[0x0]][_0x74af('0x3f')]),_0x74af('0x40'),{'destaccountcode':this[_0x74af('0x15')][_0x1e8f04[_0x74af('0x38')]['split']('-')[0x0]][_0x74af('0x41')],'destconnectedlinenum':_0x1e8f04[_0x74af('0x3b')]});}}}}}catch(_0x3fd201){logger[_0x74af('0x42')]('[%s][voiceCallReport][newcallerid]',_0x1e8f04[_0x74af('0x30')],util[_0x74af('0x2b')](_0x3fd201,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x74af('0x1b')]=function(_0x5aab37){try{if(this['isNotNull'](_0x5aab37)){logger[_0x74af('0x31')](_0x74af('0x43'),_0x5aab37[_0x74af('0x30')],util[_0x74af('0x2b')](_0x5aab37,{'showHidden':![],'depth':null}));if(_0x5aab37[_0x74af('0x30')]===_0x5aab37['linkedid']&&_0x5aab37['channel']!=_0x74af('0x44')){if(_[_0x74af('0x2d')](this[_0x74af('0x14')][_0x5aab37[_0x74af('0x30')]])){logger[_0x74af('0x29')](_0x74af('0x45'),_0x5aab37[_0x74af('0x30')],_0x5aab37['context'],_0x5aab37[_0x74af('0x46')]);this[_0x74af('0x14')][_0x5aab37[_0x74af('0x30')]]=new Channel();this[_0x74af('0x14')][_0x5aab37['uniqueid']][_0x74af('0x47')]=moment()[_0x74af('0x3d')](_0x74af('0x48'));this[_0x74af('0x14')][_0x5aab37[_0x74af('0x30')]][_0x74af('0x49')]=dispositions[_[_0x74af('0x4a')](_0x5aab37['channelstate'])];_['merge'](this['channels'][_0x5aab37[_0x74af('0x30')]],_[_0x74af('0x35')](_0x5aab37,_['keys'](this['channels'][_0x5aab37[_0x74af('0x30')]])));if(_0x5aab37['context']===_0x74af('0x37')){if(this[_0x74af('0x15')][_0x5aab37[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]){if(_['isUndefined'](this[_0x74af('0x15')][_0x5aab37['channel']['split']('-')[0x0]]['destconnectedlinenum'])){this[_0x74af('0x15')][_0x5aab37[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]][_0x74af('0x4b')]=_0x5aab37[_0x74af('0x46')];logger[_0x74af('0x31')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x5aab37['uniqueid'],util['inspect']({'id':this[_0x74af('0x15')][_0x5aab37[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5aab37[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]][_0x74af('0x41')],'destconnectedlinenum':_0x5aab37[_0x74af('0x46')]},{'showHidden':![],'depth':null}));this[_0x74af('0x3c')](util[_0x74af('0x3d')]('user:%s',this[_0x74af('0x15')][_0x5aab37[_0x74af('0x38')]['split']('-')[0x0]]['name']),_0x74af('0x40'),{'id':this[_0x74af('0x15')][_0x5aab37[_0x74af('0x38')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x74af('0x15')][_0x5aab37[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5aab37[_0x74af('0x46')]});}}}}}}}catch(_0x59364c){logger['error'](_0x74af('0x4c'),_0x5aab37[_0x74af('0x30')],util[_0x74af('0x2b')](_0x59364c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x74af('0x2e')][_0x74af('0x18')]=function(_0x3079c8){try{if(this['isNotNull'](_0x3079c8)){logger['debug'](_0x74af('0x4d'),_0x3079c8[_0x74af('0x30')],util[_0x74af('0x2b')](_0x3079c8,{'showHidden':![],'depth':null}));if(_0x3079c8['uniqueid']===_0x3079c8['linkedid']&&_0x3079c8[_0x74af('0x46')]!='h'&&_0x3079c8[_0x74af('0x38')]!='OutgoingSpoolFailed'){_0x3079c8[_0x74af('0x4e')]=_0x3079c8[_0x74af('0x4e')][_0x74af('0x4f')]();_0x3079c8['applicationdata']=_0x3079c8[_0x74af('0x50')]&&_0x3079c8['appdata'][_0x74af('0x51')](_0x74af('0x52'))?_0x3079c8['appdata']:(_0x3079c8['appdata']||_0x3079c8[_0x74af('0x53')])[_0x74af('0x4f')]();logger[_0x74af('0x29')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x3079c8[_0x74af('0x30')],_0x3079c8[_0x74af('0x4e')],_0x3079c8[_0x74af('0x53')]);if(_['isUndefined'](this[_0x74af('0x14')][_0x3079c8[_0x74af('0x30')]])){this[_0x74af('0x14')][_0x3079c8['uniqueid']]=new Channel();this['channels'][_0x3079c8[_0x74af('0x30')]]['starttime']=_0x3079c8[_0x74af('0x54')]?moment()[_0x74af('0x55')](moment[_0x74af('0x54')](_0x3079c8[_0x74af('0x54')])[_0x74af('0x56')](),_0x74af('0x56'))['format'](_0x74af('0x48')):moment()['format'](_0x74af('0x48'));this['channels'][_0x3079c8[_0x74af('0x30')]][_0x74af('0x49')]=_0x74af('0xc');}_[_0x74af('0x34')](this['channels'][_0x3079c8[_0x74af('0x30')]],_[_0x74af('0x35')](_0x3079c8,_[_0x74af('0x57')](this['channels'][_0x3079c8['uniqueid']])));if(_[_0x74af('0x58')](applications,_0x3079c8[_0x74af('0x4e')])){this[_0x74af('0x14')][_0x3079c8[_0x74af('0x30')]][_0x74af('0x59')]=_0x3079c8['application'];this['channels'][_0x3079c8['uniqueid']][_0x74af('0x5a')]=_0x3079c8[_0x74af('0x53')];if(_0x3079c8[_0x74af('0x4e')]===_0x74af('0x8')&&_[_0x74af('0x51')](_0x3079c8[_0x74af('0x53')][_0x74af('0x4f')](),_0x74af('0x5b'))){var _0x500a1e=_0x3079c8[_0x74af('0x53')][_0x74af('0x39')]('=');var _0x12b004=_0x500a1e[0x0][_0x74af('0x4f')]()['match'](/cdr\((.*)\)/);if(_0x12b004){this[_0x74af('0x14')][_0x3079c8[_0x74af('0x30')]][_0x12b004[0x1]]=_0x500a1e[0x1];}}else if(_0x3079c8['application']===_0x74af('0x9')){this['channels'][_0x3079c8[_0x74af('0x30')]][_0x74af('0x9')]=_0x3079c8[_0x74af('0x53')][_0x74af('0x39')](',')[0x0];}}}}}catch(_0x55e1b6){logger[_0x74af('0x42')](_0x74af('0x5c'),_0x3079c8[_0x74af('0x30')],util[_0x74af('0x2b')](_0x55e1b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x74af('0x2e')][_0x74af('0x5d')]=function(_0x303fd8){try{if(this[_0x74af('0x2c')](_0x303fd8)){logger[_0x74af('0x29')](_0x74af('0x5e'),_0x303fd8['uniqueid'],_0x303fd8[_0x74af('0x33')],_0x303fd8[_0x74af('0x5f')],_0x303fd8['calleridnum']);logger[_0x74af('0x31')](_0x74af('0x60'),_0x303fd8[_0x74af('0x30')],util[_0x74af('0x2b')](_0x303fd8,{'showHidden':![],'depth':null}));if(_0x303fd8['uniqueid']!==_0x303fd8[_0x74af('0x33')]){if(this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]]){if(_0x303fd8['channelstate']==='6'){if(!this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x61')]){var _0x58c675=moment();this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x61')]=!![];this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x62')]=_0x58c675[_0x74af('0x3d')](_0x74af('0x48'));if(this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]]['starttime']){this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x63')]=_0x58c675['diff'](this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x47')],_0x74af('0x56'));}}this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x33')]=_0x303fd8[_0x74af('0x30')];if(_0x303fd8[_0x74af('0x64')]!==_0x74af('0x3a')){this[_0x74af('0x14')][_0x303fd8['linkedid']][_0x74af('0x3b')]=_0x303fd8[_0x74af('0x64')];}this[_0x74af('0x14')][_0x303fd8['linkedid']]['connectedlinename']=_0x303fd8['calleridname'];this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]]['destinationchannel']=_0x303fd8[_0x74af('0x38')];this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]]['disposition']=dispositions[_[_0x74af('0x4a')](_0x303fd8[_0x74af('0x65')])];if(this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')]['split']('-')[0x0]]){this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x66')]=this['agents'][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['id'];this[_0x74af('0x14')][_0x303fd8[_0x74af('0x33')]][_0x74af('0x67')]=this['agents'][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['name'];}}}}else{if(this[_0x74af('0x14')][_0x303fd8[_0x74af('0x30')]]){if(_0x303fd8[_0x74af('0x65')]==='6'){if(this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]){this[_0x74af('0x14')][_0x303fd8[_0x74af('0x30')]][_0x74af('0x66')]=this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['id'];this[_0x74af('0x14')][_0x303fd8[_0x74af('0x30')]][_0x74af('0x67')]=this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]][_0x74af('0x3f')];}}}}if(_0x303fd8[_0x74af('0x65')]==='6'&&_0x303fd8[_0x74af('0x36')]===_0x74af('0x37')){if(this['agents'][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]){this['agents'][_0x303fd8['channel'][_0x74af('0x39')]('-')[0x0]]['destconnectedlinenum']=_0x303fd8[_0x74af('0x46')];var _0x21044a,_0x101be4;if(this['channels'][_0x303fd8[_0x74af('0x30')]]){_0x21044a=this[_0x74af('0x14')][_0x303fd8[_0x74af('0x30')]][_0x74af('0x68')];_0x101be4=this[_0x74af('0x14')][_0x303fd8['uniqueid']]['queue'];}else if(this['channels'][_0x303fd8[_0x74af('0x33')]]){_0x21044a=this[_0x74af('0x14')][_0x303fd8['linkedid']][_0x74af('0x68')];_0x101be4=this[_0x74af('0x14')][_0x303fd8['linkedid']][_0x74af('0x9')];}logger[_0x74af('0x31')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x303fd8['uniqueid'],util[_0x74af('0x2b')]({'id':this[_0x74af('0x15')][_0x303fd8['channel'][_0x74af('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')]['split']('-')[0x0]][_0x74af('0x41')],'destconnectedlinenum':_0x303fd8['exten'],'routealias':_0x21044a,'queue':_0x101be4||undefined},{'showHidden':![],'depth':null}));this[_0x74af('0x3c')](util[_0x74af('0x3d')](_0x74af('0x3e'),this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]][_0x74af('0x3f')]),'user:agentconnect',{'id':this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x74af('0x15')][_0x303fd8[_0x74af('0x38')]['split']('-')[0x0]][_0x74af('0x41')],'destconnectedlinenum':_0x303fd8[_0x74af('0x46')],'routealias':_0x21044a,'queue':_0x101be4||undefined});}}}}catch(_0x1636c3){logger[_0x74af('0x42')](_0x74af('0x69'),_0x303fd8[_0x74af('0x30')],util[_0x74af('0x2b')](_0x1636c3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x74af('0x2e')][_0x74af('0x6a')]=function(_0x48fc52,_0x42c921){try{if(this[_0x74af('0x14')][_0x48fc52]){logger[_0x74af('0x29')](_0x74af('0x6b'),_0x48fc52,_0x42c921);this[_0x74af('0x14')][_0x48fc52][_0x74af('0x6c')]=!![];if(_[_0x74af('0x6d')](_0x42c921,_0x74af('0x6e'))){_0x42c921=_0x42c921[_0x74af('0x6f')](_0x74af('0x6e'),_0x74af('0x70'));}this[_0x74af('0x14')][_0x48fc52][_0x74af('0x71')]=_0x42c921;var _0x3bad4f=_[_0x74af('0x72')](this[_0x74af('0x14')][_0x48fc52]['monitors'],{'filename':_0x42c921});if(_[_0x74af('0x73')](_0x3bad4f)){this['channels'][_0x48fc52]['monitors'][_0x74af('0x74')]({'filename':_0x42c921,'createdAt':moment()[_0x74af('0x3d')](_0x74af('0x48')),'mixmonitorid':'','status':_0x74af('0x75')});}}}catch(_0x12cf7f){logger[_0x74af('0x42')](_0x74af('0x76'),_0x48fc52,util[_0x74af('0x2b')](_0x12cf7f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x74af('0x1f')]=function(_0x32fc54){try{if(this['isNotNull'](_0x32fc54)){logger[_0x74af('0x31')]('[%s][voiceCallReport][varset]\x20event:',_0x32fc54[_0x74af('0x30')],util[_0x74af('0x2b')](_0x32fc54,{'showHidden':![],'depth':null}));if(this[_0x74af('0x14')][_0x32fc54[_0x74af('0x30')]]&&_0x32fc54[_0x74af('0x38')]!=_0x74af('0x44')){if(this[_0x74af('0x2c')](_0x32fc54[_0x74af('0x77')])){if(this[_0x74af('0x2c')](_0x32fc54[_0x74af('0x77')][_0x74af('0x78')])){logger[_0x74af('0x29')](_0x74af('0x79'),_0x32fc54['uniqueid'],_0x32fc54[_0x74af('0x7a')]);this[_0x74af('0x6a')](_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);}else if(this['isNotNull'](_0x32fc54[_0x74af('0x77')]['xmd-phone'])){logger[_0x74af('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);this['channels'][_0x32fc54[_0x74af('0x30')]][_0x74af('0x64')]=_0x32fc54[_0x74af('0x7a')];}else if(this['isNotNull'](_0x32fc54[_0x74af('0x77')]['xmd-callerid'])){logger['info'](_0x74af('0x7b'),_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);this[_0x74af('0x14')][_0x32fc54[_0x74af('0x30')]][_0x74af('0x7c')]=_0x32fc54[_0x74af('0x7a')];}else if(this[_0x74af('0x2c')](_0x32fc54[_0x74af('0x77')]['xmd-cdrtype'])){logger[_0x74af('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);this[_0x74af('0x14')][_0x32fc54[_0x74af('0x30')]][_0x74af('0x7d')]=_0x32fc54[_0x74af('0x7a')];}else if(this[_0x74af('0x2c')](_0x32fc54[_0x74af('0x77')]['xmd-queue'])){logger['info'](_0x74af('0x7e'),_0x32fc54['uniqueid'],_0x32fc54[_0x74af('0x7a')][_0x74af('0x39')](',')[0x0]);this[_0x74af('0x14')][_0x32fc54[_0x74af('0x30')]][_0x74af('0x9')]=_0x32fc54[_0x74af('0x7a')][_0x74af('0x39')](',')[0x0];}else if(this[_0x74af('0x2c')](_0x32fc54['variable']['xmd-originatecalleridnum'])){logger[_0x74af('0x29')](_0x74af('0x7f'),_0x32fc54['uniqueid'],_0x32fc54['value']);this['channels'][_0x32fc54[_0x74af('0x30')]]['originatecalleridnum']=_0x32fc54['value'];}else if(this[_0x74af('0x2c')](_0x32fc54[_0x74af('0x77')][_0x74af('0x80')])){logger['info'](_0x74af('0x81'),_0x32fc54[_0x74af('0x30')],_0x32fc54['value']);this['channels'][_0x32fc54['uniqueid']]['destination']=_0x32fc54[_0x74af('0x7a')];}else if(this[_0x74af('0x2c')](_0x32fc54['variable']['xmd-callerid-preview'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);this['channels'][_0x32fc54[_0x74af('0x30')]]['calleridpreview']=_0x32fc54[_0x74af('0x7a')];}else if(this['isNotNull'](_0x32fc54[_0x74af('0x77')][_0x74af('0x82')])){logger[_0x74af('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);this[_0x74af('0x14')][_0x32fc54[_0x74af('0x30')]]['queue']=_0x32fc54['value'];}else if(this['isNotNull'](_0x32fc54[_0x74af('0x77')][_0x74af('0x83')])){logger[_0x74af('0x29')](_0x74af('0x84'),_0x32fc54[_0x74af('0x30')],_0x32fc54[_0x74af('0x7a')]);this[_0x74af('0x14')][_0x32fc54[_0x74af('0x30')]]['sipcalluniqueid']=_0x32fc54[_0x74af('0x7a')];}}}else if(this['isNotNull'](_0x32fc54[_0x74af('0x77')]['mixmonitor_filename'])){if(_0x32fc54[_0x74af('0x7a')]){var _0x3ce440=path[_0x74af('0x85')](_0x32fc54[_0x74af('0x7a')])[_0x74af('0x3f')];logger[_0x74af('0x29')](_0x74af('0x79'),_0x3ce440,_0x32fc54['value']);this['syncMixMonitorFilename'](_0x3ce440,_0x32fc54[_0x74af('0x7a')]);}}else if(this[_0x74af('0x14')][_0x32fc54[_0x74af('0x33')]]){if(this[_0x74af('0x2c')](_0x32fc54[_0x74af('0x77')])){if(this['isNotNull'](_0x32fc54['variable'][_0x74af('0x83')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x32fc54[_0x74af('0x33')],_0x32fc54[_0x74af('0x7a')]);this[_0x74af('0x14')][_0x32fc54[_0x74af('0x33')]][_0x74af('0x86')]=_0x32fc54[_0x74af('0x7a')];}}}}}catch(_0x46ddea){logger[_0x74af('0x42')]('[%s][voiceCallReport][varset]',_0x32fc54['uniqueid'],util['inspect'](_0x46ddea,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x74af('0x2e')]['syncHangup']=function(_0x1a3bea){try{if(this['isNotNull'](_0x1a3bea)){logger[_0x74af('0x31')](_0x74af('0x87'),_0x1a3bea['uniqueid'],util[_0x74af('0x2b')](_0x1a3bea,{'showHidden':![],'depth':null}));if(this[_0x74af('0x14')][_0x1a3bea[_0x74af('0x30')]]){logger[_0x74af('0x29')](_0x74af('0x88'),_0x1a3bea['uniqueid'],_0x1a3bea[_0x74af('0x89')]);var _0x18fafe=moment();this[_0x74af('0x14')][_0x1a3bea[_0x74af('0x30')]][_0x74af('0x8a')]=_0x18fafe[_0x74af('0x3d')](_0x74af('0x48'));this['channels'][_0x1a3bea[_0x74af('0x30')]]['duration']=_0x18fafe['diff'](this[_0x74af('0x14')][_0x1a3bea[_0x74af('0x30')]][_0x74af('0x47')],_0x74af('0x56'));if(this[_0x74af('0x14')][_0x1a3bea[_0x74af('0x30')]][_0x74af('0x61')]){this[_0x74af('0x14')][_0x1a3bea['uniqueid']][_0x74af('0x8b')]=_0x18fafe[_0x74af('0x8c')](this[_0x74af('0x14')][_0x1a3bea['uniqueid']][_0x74af('0x62')],_0x74af('0x56'));this[_0x74af('0x14')][_0x1a3bea[_0x74af('0x30')]][_0x74af('0x63')]=this[_0x74af('0x14')][_0x1a3bea[_0x74af('0x30')]][_0x74af('0x54')]-this[_0x74af('0x14')][_0x1a3bea['uniqueid']][_0x74af('0x8b')];}if(_0x1a3bea[_0x74af('0x36')]===_0x74af('0x37')){if(this[_0x74af('0x15')][_0x1a3bea[_0x74af('0x38')]['split']('-')[0x0]]){this[_0x74af('0x15')][_0x1a3bea[_0x74af('0x38')]['split']('-')[0x0]]=_[_0x74af('0x8d')](this['agents'][_0x1a3bea[_0x74af('0x38')]['split']('-')[0x0]],[_0x74af('0x4b')]);logger[_0x74af('0x31')](_0x74af('0x8e'),_0x1a3bea['uniqueid'],util['inspect']({'id':this['agents'][_0x1a3bea[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x74af('0x15')][_0x1a3bea['channel'][_0x74af('0x39')]('-')[0x0]][_0x74af('0x41')]},{'showHidden':![],'depth':null}));this[_0x74af('0x3c')](util[_0x74af('0x3d')](_0x74af('0x3e'),this[_0x74af('0x15')][_0x1a3bea[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]][_0x74af('0x3f')]),'user:agentcomplete',{'id':this[_0x74af('0x15')][_0x1a3bea[_0x74af('0x38')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1a3bea[_0x74af('0x38')][_0x74af('0x39')]('-')[0x0]]['accountcode']});for(var _0x148989=0x0;_0x1489890x0?_0x4f693c:0x0;this['voiceQueues'][_0xcf30d2['queue']][_0x36e6('0x5b')]=this['voiceQueues'][_0xcf30d2[_0x36e6('0x70')]]['talking']>_[_0x36e6('0x76')](_0xcf30d2[_0x36e6('0x77')])?_[_0x36e6('0x76')](_0xcf30d2[_0x36e6('0x77')]):this[_0x36e6('0x13')][_0xcf30d2[_0x36e6('0x70')]][_0x36e6('0x5b')];this['emitVoiceQueueSummary'](this[_0x36e6('0x13')][_0xcf30d2[_0x36e6('0x70')]],_0x36e6('0x16'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x36e6('0x3d')](this[_0x36e6('0x13')][_0xcf30d2[_0x36e6('0x70')]],{'showHidden':![],'depth':null}));ami[_0x36e6('0x44')](_0x36e6('0x78'),this[_0x36e6('0x13')][_0xcf30d2[_0x36e6('0x70')]]);}}}catch(_0xce16e){logger[_0x36e6('0x3b')]('[voiceQueueReport][queuesummary]',util[_0x36e6('0x3d')](_0xce16e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x36e6('0x19')]=function(_0x149bfa){logger['debug'](_0x36e6('0x79'),util[_0x36e6('0x3d')](_0x149bfa,{'showHidden':![],'depth':null}));this[_0x36e6('0x6c')]=!![];};VoiceQueueReport[_0x36e6('0xc')][_0x36e6('0x1b')]=function(_0x3e8a8a){try{if(this[_0x36e6('0x6f')](_0x3e8a8a)){logger['debug'](_0x36e6('0x7a'),_0x3e8a8a['uniqueid'],util[_0x36e6('0x3d')](_0x3e8a8a,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x3e8a8a[_0x36e6('0x49')]]))this[_0x36e6('0x3e')][_0x3e8a8a['uniqueid']]=[];if(_[_0x36e6('0x68')](this[_0x36e6('0x12')][_0x3e8a8a[_0x36e6('0x49')]]))this[_0x36e6('0x12')][_0x3e8a8a[_0x36e6('0x49')]]={};var _0x13bf8c=new QueueReport();_0x13bf8c['name']=_0x3e8a8a['queue'];_0x13bf8c[_0x36e6('0x52')]=this[_0x36e6('0x13')][_0x13bf8c[_0x36e6('0x4b')]]&&this['voiceQueues'][_0x13bf8c[_0x36e6('0x4b')]][_0x36e6('0x52')]?this[_0x36e6('0x13')][_0x13bf8c[_0x36e6('0x4b')]][_0x36e6('0x52')]||_0x36e6('0x53'):'inbound';_0x13bf8c[_0x36e6('0x70')]=_0x3e8a8a['queue'];_0x13bf8c[_0x36e6('0x7b')]=moment()['format'](_0x36e6('0x7c'));_0x13bf8c[_0x36e6('0x7d')]=_0x3e8a8a['position'];_0x13bf8c[_0x36e6('0x7e')]=_0x3e8a8a[_0x36e6('0x7e')];_0x13bf8c[_0x36e6('0x49')]=_0x3e8a8a[_0x36e6('0x49')];_0x13bf8c[_0x36e6('0x7f')]=this['channels'][_0x3e8a8a[_0x36e6('0x49')]][_0x36e6('0x7f')];logger[_0x36e6('0x72')](_0x36e6('0x80'),_0x13bf8c[_0x36e6('0x4b')],_0x13bf8c[_0x36e6('0x52')]);_[_0x36e6('0x81')](_0x13bf8c,_[_0x36e6('0x82')](_0x3e8a8a,_[_0x36e6('0x83')](_0x13bf8c)));this[_0x36e6('0x3e')][_0x3e8a8a[_0x36e6('0x49')]][_0x36e6('0x84')](_0x13bf8c);this[_0x36e6('0x12')][_0x3e8a8a[_0x36e6('0x49')]]=_0x13bf8c;this['emitVoiceQueueChannelSave'](_0x13bf8c,_0x36e6('0x1a'));}}catch(_0x7b7a28){logger[_0x36e6('0x3b')](_0x36e6('0x7a'),_0x3e8a8a['uniqueid'],util[_0x36e6('0x3d')](_0x7b7a28,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36e6('0xc')][_0x36e6('0x85')]=function(_0xb6206){try{if(this[_0x36e6('0x6f')](_0xb6206)){logger[_0x36e6('0x46')](_0x36e6('0x86'),_0xb6206['uniqueid'],util[_0x36e6('0x3d')](_0xb6206,{'showHidden':![],'depth':null}));if(this[_0x36e6('0x3e')][_0xb6206[_0x36e6('0x49')]]){var _0x49e9a7=_['last'](this[_0x36e6('0x3e')][_0xb6206['uniqueid']]);_0x49e9a7['queuecallercomplete']=![];_0x49e9a7[_0x36e6('0x87')]=null;_0x49e9a7['holdtime']=_0xb6206[_0x36e6('0x88')];_0x49e9a7['originalposition']=_0xb6206[_0x36e6('0x89')];_0x49e9a7[_0x36e6('0x1c')]=!![];_0x49e9a7[_0x36e6('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x49e9a7[_0x36e6('0x8b')]='ABANDONED';_0x49e9a7['lastAssignedTo']=null;logger[_0x36e6('0x72')](_0x36e6('0x8c'),_0x49e9a7[_0x36e6('0x4b')],_0x49e9a7[_0x36e6('0x52')]);this[_0x36e6('0x12')][_0xb6206['uniqueid']]=_0x49e9a7;this['emitVoiceQueueChannelRemove'](_0x49e9a7,'queuecallerabandon');}}}catch(_0x58f59b){logger[_0x36e6('0x3b')](_0x36e6('0x86'),_0xb6206[_0x36e6('0x49')],util[_0x36e6('0x3d')](_0x58f59b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36e6('0xc')]['syncQueueCallerLeave']=function(_0x389b65){try{if(this[_0x36e6('0x6f')](_0x389b65)){logger[_0x36e6('0x46')](_0x36e6('0x8d'),_0x389b65['uniqueid'],util[_0x36e6('0x3d')](_0x389b65,{'showHidden':![],'depth':null}));if(this[_0x36e6('0x3e')][_0x389b65[_0x36e6('0x49')]]){var _0x44ef2d=_[_0x36e6('0x8e')](this[_0x36e6('0x3e')][_0x389b65[_0x36e6('0x49')]]);_0x44ef2d['queuecallerleaveAt']=moment()[_0x36e6('0x4a')](_0x36e6('0x7c'));_0x44ef2d[_0x36e6('0x8f')]=_0x389b65[_0x36e6('0x8f')];_0x44ef2d[_0x36e6('0x90')]=_0x389b65[_0x36e6('0x90')];logger['info'](_0x36e6('0x91'),_0x44ef2d[_0x36e6('0x4b')],_0x44ef2d[_0x36e6('0x52')],_0x389b65[_0x36e6('0x8f')],_0x389b65[_0x36e6('0x90')]);this[_0x36e6('0x12')][_0x389b65[_0x36e6('0x49')]]=_0x44ef2d;this[_0x36e6('0x45')](_0x44ef2d,'queuecallerleave');}}}catch(_0x2dae8f){logger[_0x36e6('0x3b')](_0x36e6('0x8d'),_0x389b65[_0x36e6('0x49')],util['inspect'](_0x2dae8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36e6('0xc')]['syncAgentConnect']=function(_0x1083b3){try{if(this[_0x36e6('0x6f')](_0x1083b3)){logger[_0x36e6('0x46')](_0x36e6('0x92'),_0x1083b3[_0x36e6('0x49')],util[_0x36e6('0x3d')](_0x1083b3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1083b3[_0x36e6('0x49')]]){var _0x4870a0=_[_0x36e6('0x8e')](this[_0x36e6('0x3e')][_0x1083b3[_0x36e6('0x49')]]);_0x4870a0[_0x36e6('0x93')]=!![];_0x4870a0['queuecallerexitreason']=_0x36e6('0x94');logger[_0x36e6('0x72')](_0x36e6('0x95'),_0x4870a0[_0x36e6('0x4b')],_0x4870a0['type']);}}}catch(_0x412181){logger[_0x36e6('0x3b')](_0x36e6('0x92'),_0x1083b3['uniqueid'],util[_0x36e6('0x3d')](_0x412181,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36e6('0xc')][_0x36e6('0x20')]=function(_0xb89959){try{if(this[_0x36e6('0x6f')](_0xb89959)){logger[_0x36e6('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0xb89959[_0x36e6('0x49')],util[_0x36e6('0x3d')](_0xb89959,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb89959['uniqueid']]){var _0x1e4215=_['last'](this[_0x36e6('0x3e')][_0xb89959[_0x36e6('0x49')]]);_0x1e4215[_0x36e6('0x1c')]=![];_0x1e4215['queuecallerabandonAt']=null;_0x1e4215['assigned']=!![];_0x1e4215[_0x36e6('0x96')]=_0xb89959[_0x36e6('0x97')];_0x1e4215[_0x36e6('0x88')]=_0xb89959['holdtime'];_0x1e4215['queuecallercomplete']=!![];_0x1e4215[_0x36e6('0x98')]=![];_0x1e4215['queuecallerexitAt']=null;if(!_0x1e4215[_0x36e6('0x99')]){if(_0xb89959[_0x36e6('0x9a')]==_0x36e6('0x99')){_0x1e4215['queuecallerexitreason']=_0x36e6('0x9b');logger[_0x36e6('0x72')](_0x36e6('0x9c'),_0x1e4215[_0x36e6('0x4b')],_0x1e4215[_0x36e6('0x52')]);}else{if(_[_0x36e6('0x9d')](_0xb89959[_0x36e6('0x9e')][_0x36e6('0x9f')](),_0x36e6('0xa0'))){if(this[_0x36e6('0x3e')][_0xb89959['linkedid']]){var _0x4fa818=_[_0x36e6('0x8e')](this[_0x36e6('0x3e')][_0xb89959[_0x36e6('0xa1')]]);_0x4fa818[_0x36e6('0x93')]=![];_0x4fa818['queuecallerexit']=!![];_0x4fa818[_0x36e6('0xa2')]=moment(_0x1e4215[_0x36e6('0x7b')])['add'](_0xb89959[_0x36e6('0x88')],_0x36e6('0xa3'))[_0x36e6('0x4a')](_0x36e6('0x7c'));_0x4fa818['queuecallerexitreason']=_0x36e6('0xa4');_0x4fa818[_0x36e6('0x99')]=!![];_0x4fa818['transfertype']=_0x36e6('0xa5');_0x4fa818[_0x36e6('0xa6')]=_0xb89959[_0x36e6('0xa7')];_0x4fa818[_0x36e6('0xa8')]=_0xb89959[_0x36e6('0x49')];logger['info'](_0x36e6('0xa9'),_0x4fa818[_0x36e6('0x4b')],_0x4fa818[_0x36e6('0x52')]);var _0x597210=this[_0x36e6('0x3e')][_0xb89959[_0x36e6('0xa1')]];this[_0x36e6('0x3e')][_0xb89959[_0x36e6('0xa1')]]=this['queueReports'][_0xb89959[_0x36e6('0x49')]];this[_0x36e6('0x3e')][_0xb89959['uniqueid']]=_0x597210;}}else{_0x1e4215[_0x36e6('0x8b')]=_0x36e6('0xaa')+_0xb89959[_0x36e6('0x9a')][_0x36e6('0xab')]();logger[_0x36e6('0x72')](_0x36e6('0xac'),_0x1e4215[_0x36e6('0x4b')],_0x1e4215['type'],_0x1e4215[_0x36e6('0x8b')]);}}}this['channels'][_0xb89959[_0x36e6('0x49')]]=_0x1e4215;this[_0x36e6('0x42')](_0x1e4215,_0x36e6('0x1f'));}}}catch(_0x5f3d78){logger[_0x36e6('0x3b')](_0x36e6('0xad'),_0xb89959[_0x36e6('0x49')],util['inspect'](_0x5f3d78,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36e6('0xc')][_0x36e6('0x22')]=function(_0x484dee){try{if(this[_0x36e6('0x6f')](_0x484dee)){logger[_0x36e6('0x46')](_0x36e6('0xae'),_0x484dee['uniqueid'],util[_0x36e6('0x3d')](_0x484dee,{'showHidden':![],'depth':null}));this[_0x36e6('0xaf')](_0x484dee['uniqueid'],_['keys'](_0x484dee[_0x36e6('0xb0')])[0x0],_0x484dee['value']);if(this[_0x36e6('0x3e')][_0x484dee[_0x36e6('0x49')]]){var _0x1c993f=_['last'](this[_0x36e6('0x3e')][_0x484dee[_0x36e6('0x49')]]);if(_0x1c993f){if(this[_0x36e6('0x6f')](_0x484dee[_0x36e6('0xb0')])&&this['isNotNull'](_0x484dee[_0x36e6('0xb0')]['queuestatus'])){switch(_0x484dee['value']){case _0x36e6('0xb1'):_0x1c993f[_0x36e6('0x98')]=![];_0x1c993f[_0x36e6('0xa2')]=null;break;case _0x36e6('0xb2'):_0x1c993f[_0x36e6('0xb3')]=_0x36e6('0xb4');_0x1c993f[_0x36e6('0x98')]=!![];_0x1c993f[_0x36e6('0xa2')]=moment()[_0x36e6('0x4a')](_0x36e6('0x7c'));_0x1c993f['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x36e6('0x46')](_0x36e6('0xb5'),_0x484dee[_0x36e6('0x49')],util[_0x36e6('0x3d')](_0x1c993f,{'showHidden':![],'depth':null}));ami[_0x36e6('0x44')](_0x36e6('0xb6'),_0x1c993f);break;default:_0x1c993f[_0x36e6('0x98')]=!![];_0x1c993f['queuecallerexitAt']=moment()[_0x36e6('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c993f[_0x36e6('0xb7')]=moment()[_0x36e6('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1c993f[_0x36e6('0x1c')]=![];_0x1c993f['queuecallerabandonAt']=null;_0x1c993f['queuecallerexitreason']=_0x484dee[_0x36e6('0xb8')];this[_0x36e6('0x12')][_0x484dee['uniqueid']]=_0x1c993f;this[_0x36e6('0x42')](_0x1c993f,_0x36e6('0xb9'));}else if(this[_0x36e6('0x6f')](_0x484dee[_0x36e6('0xb0')])&&this[_0x36e6('0x6f')](_0x484dee[_0x36e6('0xb0')][_0x36e6('0xba')])){if(!_0x1c993f[_0x36e6('0x1c')]){_0x1c993f[_0x36e6('0x98')]=!![];_0x1c993f[_0x36e6('0xa2')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1c993f[_0x36e6('0x8b')]='EXITWITHKEY';_0x1c993f['queuecallerleaveAt']=moment()[_0x36e6('0x4a')](_0x36e6('0x7c'));this[_0x36e6('0x12')][_0x484dee['uniqueid']]=_0x1c993f;}}logger['info'](_0x36e6('0xbb'),_0x484dee['uniqueid'],_0x1c993f['name'],_0x1c993f[_0x36e6('0x52')],_[_0x36e6('0x83')](_0x484dee[_0x36e6('0xb0')])[0x0],_0x484dee['value']);_0x1c993f[_0x36e6('0x15')]=this[_0x36e6('0x15')][_0x484dee[_0x36e6('0x49')]];}}}}catch(_0x5ac1b7){logger[_0x36e6('0x3b')](_0x36e6('0xae'),_0x484dee[_0x36e6('0x49')],util[_0x36e6('0x3d')](_0x5ac1b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36e6('0xc')][_0x36e6('0xaf')]=function(_0x41c4d0,_0x4c8ffc,_0x397cce){var _0x22ed42=[_0x36e6('0xbc'),_0x36e6('0xbd'),_0x36e6('0xbe'),_0x36e6('0xbf'),'rtpaudioqosloss',_0x36e6('0xc0'),_0x36e6('0xc1'),_0x36e6('0xc2'),_0x36e6('0xc3'),_0x36e6('0xc4'),_0x36e6('0xc5'),'bridgepvtcallid',_0x36e6('0xc6'),'memberdynamic',_0x36e6('0xc7'),'memberlastcall','membername',_0x36e6('0xc8'),_0x36e6('0xc9')];if(!_[_0x36e6('0xca')](_0x4c8ffc)&&!_[_0x36e6('0xcb')](_0x22ed42,_0x4c8ffc)){if(_[_0x36e6('0x68')](this[_0x36e6('0x15')][_0x41c4d0])){this[_0x36e6('0x15')][_0x41c4d0]={};}this[_0x36e6('0x15')][_0x41c4d0][_0x4c8ffc]=_0x397cce;}};VoiceQueueReport[_0x36e6('0xc')][_0x36e6('0x24')]=function(_0x5380ae){try{if(this[_0x36e6('0x6f')](_0x5380ae)){logger[_0x36e6('0x46')](_0x36e6('0xcc'),_0x5380ae[_0x36e6('0x49')],util[_0x36e6('0x3d')](_0x5380ae,{'showHidden':![],'depth':null}));if(this[_0x36e6('0x3e')][_0x5380ae[_0x36e6('0x49')]]){for(var _0x43ed0f=0x0,_0x15a8fd={};_0x43ed0f0x0?_0xa91392:0x0;this['voiceQueues'][_0x402d31[_0x1093('0x6b')]][_0x1093('0x2d')]=this[_0x1093('0x12')][_0x402d31[_0x1093('0x6b')]][_0x1093('0x2d')]>_['toNumber'](_0x402d31[_0x1093('0x6f')])?_[_0x1093('0x6d')](_0x402d31[_0x1093('0x6f')]):this[_0x1093('0x12')][_0x402d31[_0x1093('0x6b')]]['talking'];this[_0x1093('0x4e')](this['voiceQueues'][_0x402d31['queue']],_0x1093('0x15'));}logger[_0x1093('0x5f')](_0x1093('0x70'),util['inspect'](this[_0x1093('0x12')][_0x402d31[_0x1093('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x1093('0x45')](_0x1093('0x71'),this[_0x1093('0x12')][_0x402d31[_0x1093('0x6b')]]);}}}catch(_0x1bae56){logger[_0x1093('0x3d')](_0x1093('0x67'),util[_0x1093('0x3c')](_0x1bae56,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0x17')]=function(_0x2e9d5f){logger[_0x1093('0x5f')](_0x1093('0x72'),util[_0x1093('0x3c')](_0x2e9d5f,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x1093('0x19')]=function(_0x176e74){try{if(this[_0x1093('0x62')](_0x176e74)){logger[_0x1093('0x5f')](_0x1093('0x73'),_0x176e74['uniqueid'],util['inspect'](_0x176e74,{'showHidden':![],'depth':null}));if(_[_0x1093('0x63')](this[_0x1093('0xf')][_0x176e74[_0x1093('0x48')]]))this[_0x1093('0xf')][_0x176e74[_0x1093('0x48')]]=[];if(_[_0x1093('0x63')](this[_0x1093('0x33')][_0x176e74[_0x1093('0x48')]]))this[_0x1093('0x33')][_0x176e74[_0x1093('0x48')]]={};var _0x41252f=new QueueReport();_0x41252f[_0x1093('0x50')]=_0x176e74[_0x1093('0x6b')];_0x41252f[_0x1093('0x4f')]=this[_0x1093('0x12')][_0x41252f[_0x1093('0x50')]]&&this[_0x1093('0x12')][_0x41252f[_0x1093('0x50')]][_0x1093('0x4f')]?this[_0x1093('0x12')][_0x41252f[_0x1093('0x50')]][_0x1093('0x4f')]||_0x1093('0x74'):_0x1093('0x74');_0x41252f[_0x1093('0x6b')]=_0x176e74[_0x1093('0x6b')];_0x41252f['queuecallerjoinAt']=moment()[_0x1093('0x49')](_0x1093('0x75'));_0x41252f['position']=_0x176e74[_0x1093('0x76')];_0x41252f['count']=_0x176e74['count'];_0x41252f[_0x1093('0x48')]=_0x176e74['uniqueid'];_0x41252f[_0x1093('0x77')]=this[_0x1093('0x33')][_0x176e74[_0x1093('0x48')]]['routealias'];logger[_0x1093('0x78')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x41252f['name'],_0x41252f[_0x1093('0x4f')]);_[_0x1093('0x79')](_0x41252f,_[_0x1093('0x7a')](_0x176e74,_[_0x1093('0x7b')](_0x41252f)));this['queueReports'][_0x176e74[_0x1093('0x48')]][_0x1093('0x7c')](_0x41252f);this[_0x1093('0x33')][_0x176e74['uniqueid']]=_0x41252f;this['emitVoiceQueueChannelSave'](_0x41252f,_0x1093('0x18'));}}catch(_0x26428a){logger[_0x1093('0x3d')](_0x1093('0x73'),_0x176e74[_0x1093('0x48')],util['inspect'](_0x26428a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')]['syncQueueCallerAbandon']=function(_0x36cde3){try{if(this[_0x1093('0x62')](_0x36cde3)){logger[_0x1093('0x5f')](_0x1093('0x7d'),_0x36cde3[_0x1093('0x48')],util[_0x1093('0x3c')](_0x36cde3,{'showHidden':![],'depth':null}));if(this[_0x1093('0xf')][_0x36cde3[_0x1093('0x48')]]){var _0x37272e=_[_0x1093('0x7e')](this['queueReports'][_0x36cde3[_0x1093('0x48')]]);_0x37272e['queuecallercomplete']=![];_0x37272e[_0x1093('0x7f')]=null;_0x37272e[_0x1093('0x80')]=_0x36cde3[_0x1093('0x80')];_0x37272e[_0x1093('0x81')]=_0x36cde3['originalposition'];_0x37272e[_0x1093('0x82')]=!![];_0x37272e[_0x1093('0x83')]=moment()[_0x1093('0x49')](_0x1093('0x75'));_0x37272e['queuecallerexitreason']=_0x1093('0x84');_0x37272e[_0x1093('0x85')]=null;logger[_0x1093('0x78')](_0x1093('0x86'),_0x37272e[_0x1093('0x50')],_0x37272e[_0x1093('0x4f')]);this[_0x1093('0x33')][_0x36cde3['uniqueid']]=_0x37272e;this[_0x1093('0x4b')](_0x37272e,_0x1093('0x82'));}}}catch(_0xc55f48){logger['error'](_0x1093('0x7d'),_0x36cde3[_0x1093('0x48')],util[_0x1093('0x3c')](_0xc55f48,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0x1d')]=function(_0x5cecd7){try{if(this[_0x1093('0x62')](_0x5cecd7)){logger[_0x1093('0x5f')](_0x1093('0x87'),_0x5cecd7[_0x1093('0x48')],util[_0x1093('0x3c')](_0x5cecd7,{'showHidden':![],'depth':null}));if(this[_0x1093('0xf')][_0x5cecd7['uniqueid']]){var _0x3229b3=_[_0x1093('0x7e')](this[_0x1093('0xf')][_0x5cecd7['uniqueid']]);_0x3229b3[_0x1093('0x88')]=moment()[_0x1093('0x49')](_0x1093('0x75'));_0x3229b3[_0x1093('0x89')]=_0x5cecd7['connectedlinenum'];_0x3229b3[_0x1093('0x8a')]=_0x5cecd7['connectedlinename'];logger['info'](_0x1093('0x8b'),_0x3229b3[_0x1093('0x50')],_0x3229b3['type'],_0x5cecd7[_0x1093('0x89')],_0x5cecd7[_0x1093('0x8a')]);this[_0x1093('0x33')][_0x5cecd7['uniqueid']]=_0x3229b3;this[_0x1093('0x8c')](_0x3229b3,'queuecallerleave');}}}catch(_0x355193){logger[_0x1093('0x3d')](_0x1093('0x87'),_0x5cecd7[_0x1093('0x48')],util[_0x1093('0x3c')](_0x355193,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0x20')]=function(_0x4a9deb){try{if(this[_0x1093('0x62')](_0x4a9deb)){logger[_0x1093('0x5f')](_0x1093('0x8d'),_0x4a9deb['uniqueid'],util[_0x1093('0x3c')](_0x4a9deb,{'showHidden':![],'depth':null}));if(this[_0x1093('0xf')][_0x4a9deb[_0x1093('0x48')]]){var _0x207208=_[_0x1093('0x7e')](this[_0x1093('0xf')][_0x4a9deb[_0x1093('0x48')]]);_0x207208[_0x1093('0x8e')]=!![];_0x207208['queuecallerexitreason']=_0x1093('0x8f');logger[_0x1093('0x78')](_0x1093('0x90'),_0x207208['name'],_0x207208['type']);}}}catch(_0x10cb8e){logger[_0x1093('0x3d')](_0x1093('0x8d'),_0x4a9deb['uniqueid'],util['inspect'](_0x10cb8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0x1e')]=function(_0x66215b){try{if(this[_0x1093('0x62')](_0x66215b)){logger[_0x1093('0x5f')](_0x1093('0x91'),_0x66215b[_0x1093('0x48')],util[_0x1093('0x3c')](_0x66215b,{'showHidden':![],'depth':null}));if(this[_0x1093('0xf')][_0x66215b[_0x1093('0x48')]]){var _0x26ddd4=_[_0x1093('0x7e')](this[_0x1093('0xf')][_0x66215b[_0x1093('0x48')]]);_0x26ddd4[_0x1093('0x82')]=![];_0x26ddd4['queuecallerabandonAt']=null;_0x26ddd4['assigned']=!![];_0x26ddd4[_0x1093('0x85')]=_0x66215b[_0x1093('0x92')];_0x26ddd4['holdtime']=_0x66215b[_0x1093('0x80')];_0x26ddd4['queuecallercomplete']=!![];_0x26ddd4[_0x1093('0x93')]=![];_0x26ddd4[_0x1093('0x94')]=null;if(!_0x26ddd4['transfer']){if(_0x66215b['reason']==_0x1093('0x95')){_0x26ddd4[_0x1093('0x96')]='COMPLETED';logger[_0x1093('0x78')](_0x1093('0x97'),_0x26ddd4[_0x1093('0x50')],_0x26ddd4['type']);}else{if(_[_0x1093('0x98')](_0x66215b[_0x1093('0x38')][_0x1093('0x99')](),'local/')){if(this[_0x1093('0xf')][_0x66215b[_0x1093('0x9a')]]){var _0x445775=_[_0x1093('0x7e')](this[_0x1093('0xf')][_0x66215b['linkedid']]);_0x445775[_0x1093('0x8e')]=![];_0x445775[_0x1093('0x93')]=!![];_0x445775[_0x1093('0x94')]=moment(_0x26ddd4[_0x1093('0x9b')])[_0x1093('0x9c')](_0x66215b['holdtime'],_0x1093('0x9d'))['format'](_0x1093('0x75'));_0x445775['queuecallerexitreason']=_0x1093('0x9e');_0x445775[_0x1093('0x95')]=!![];_0x445775[_0x1093('0x9f')]='FORWARD';_0x445775['transferexten']=_0x66215b[_0x1093('0xa0')];_0x445775['transferuniqueid']=_0x66215b[_0x1093('0x48')];logger['info'](_0x1093('0xa1'),_0x445775[_0x1093('0x50')],_0x445775[_0x1093('0x4f')]);var _0xbcf93c=this['queueReports'][_0x66215b[_0x1093('0x9a')]];this['queueReports'][_0x66215b[_0x1093('0x9a')]]=this[_0x1093('0xf')][_0x66215b[_0x1093('0x48')]];this[_0x1093('0xf')][_0x66215b[_0x1093('0x48')]]=_0xbcf93c;}}else{_0x26ddd4[_0x1093('0x96')]=_0x1093('0xa2')+_0x66215b[_0x1093('0xa3')][_0x1093('0xa4')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x26ddd4[_0x1093('0x50')],_0x26ddd4[_0x1093('0x4f')],_0x26ddd4[_0x1093('0x96')]);}}}this[_0x1093('0x33')][_0x66215b['uniqueid']]=_0x26ddd4;this[_0x1093('0x4b')](_0x26ddd4,_0x1093('0xa5'));}}}catch(_0xfb7374){logger['error'](_0x1093('0x91'),_0x66215b[_0x1093('0x48')],util['inspect'](_0xfb7374,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0xa6')]=function(_0xcc5ccc){try{if(this[_0x1093('0x62')](_0xcc5ccc)){logger[_0x1093('0x5f')](_0x1093('0xa7'),_0xcc5ccc[_0x1093('0x48')],util[_0x1093('0x3c')](_0xcc5ccc,{'showHidden':![],'depth':null}));this[_0x1093('0xa8')](_0xcc5ccc[_0x1093('0x48')],_['keys'](_0xcc5ccc['variable'])[0x0],_0xcc5ccc[_0x1093('0xa9')]);if(this[_0x1093('0xf')][_0xcc5ccc[_0x1093('0x48')]]){var _0x347f13=_[_0x1093('0x7e')](this['queueReports'][_0xcc5ccc['uniqueid']]);if(_0x347f13){if(this['isNotNull'](_0xcc5ccc[_0x1093('0xaa')])&&this[_0x1093('0x62')](_0xcc5ccc['variable'][_0x1093('0xab')])){switch(_0xcc5ccc[_0x1093('0xa9')]){case _0x1093('0xac'):_0x347f13[_0x1093('0x93')]=![];_0x347f13[_0x1093('0x94')]=null;break;case _0x1093('0xad'):_0x347f13['lastevent']=_0x1093('0xae');_0x347f13['queuecallerexit']=!![];_0x347f13[_0x1093('0x94')]=moment()[_0x1093('0x49')](_0x1093('0x75'));_0x347f13[_0x1093('0x88')]=moment()[_0x1093('0x49')](_0x1093('0x75'));logger[_0x1093('0x5f')](_0x1093('0xaf'),_0xcc5ccc[_0x1093('0x48')],util['inspect'](_0x347f13,{'showHidden':![],'depth':null}));ami[_0x1093('0x45')](_0x1093('0xb0'),_0x347f13);break;default:_0x347f13[_0x1093('0x93')]=!![];_0x347f13['queuecallerexitAt']=moment()[_0x1093('0x49')](_0x1093('0x75'));_0x347f13[_0x1093('0x88')]=moment()[_0x1093('0x49')](_0x1093('0x75'));}_0x347f13[_0x1093('0x82')]=![];_0x347f13['queuecallerabandonAt']=null;_0x347f13[_0x1093('0x96')]=_0xcc5ccc[_0x1093('0xa9')];this[_0x1093('0x33')][_0xcc5ccc[_0x1093('0x48')]]=_0x347f13;this['emitVoiceQueueChannelRemove'](_0x347f13,'varset');}else if(this['isNotNull'](_0xcc5ccc[_0x1093('0xaa')])&&this['isNotNull'](_0xcc5ccc[_0x1093('0xaa')][_0x1093('0xb1')])){if(!_0x347f13[_0x1093('0x82')]){_0x347f13[_0x1093('0x93')]=!![];_0x347f13[_0x1093('0x94')]=moment()[_0x1093('0x49')](_0x1093('0x75'));_0x347f13[_0x1093('0x96')]=_0x1093('0xb2');_0x347f13['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1093('0x33')][_0xcc5ccc[_0x1093('0x48')]]=_0x347f13;}}logger['info'](_0x1093('0xb3'),_0xcc5ccc['uniqueid'],_0x347f13[_0x1093('0x50')],_0x347f13[_0x1093('0x4f')],_[_0x1093('0x7b')](_0xcc5ccc[_0x1093('0xaa')])[0x0],_0xcc5ccc[_0x1093('0xa9')]);_0x347f13[_0x1093('0x3f')]=this['variables'][_0xcc5ccc[_0x1093('0x48')]];}}}}catch(_0x3e1216){logger[_0x1093('0x3d')](_0x1093('0xa7'),_0xcc5ccc[_0x1093('0x48')],util['inspect'](_0x3e1216,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0xa8')]=function(_0x4fb7a3,_0x597c58,_0x5527fd){var _0x282b3b=['rtpaudioqos',_0x1093('0xb4'),'rtpaudioqosjitter',_0x1093('0xb5'),_0x1093('0xb6'),_0x1093('0xb7'),'rtpaudioqosrtt',_0x1093('0xb8'),_0x1093('0xb9'),_0x1093('0xba'),_0x1093('0xbb'),_0x1093('0xbc'),_0x1093('0xbd'),_0x1093('0xbe'),_0x1093('0xbf'),_0x1093('0xc0'),_0x1093('0x92'),_0x1093('0xc1'),_0x1093('0xc2')];if(!_['isNil'](_0x597c58)&&!_[_0x1093('0xc3')](_0x282b3b,_0x597c58)){if(_[_0x1093('0x63')](this[_0x1093('0x3f')][_0x4fb7a3])){this[_0x1093('0x3f')][_0x4fb7a3]={};}this[_0x1093('0x3f')][_0x4fb7a3][_0x597c58]=_0x5527fd;}};VoiceQueueReport[_0x1093('0xa')][_0x1093('0x22')]=function(_0x29aa84){try{if(this['isNotNull'](_0x29aa84)){logger[_0x1093('0x5f')](_0x1093('0xc4'),_0x29aa84[_0x1093('0x48')],util['inspect'](_0x29aa84,{'showHidden':![],'depth':null}));if(this[_0x1093('0xf')][_0x29aa84[_0x1093('0x48')]]){for(var _0x106324=0x0,_0x1fd337={};_0x106324=0x0?moment(_0x354aff[_0x2750('0x18')])[_0x2750('0xe')](_0x354aff[_0x2750('0x19')],_0x2750('0xf')):null,'data1':_0x2750('0x1a'),'data2':_0x354aff['accountcode'],'data3':_0x354aff[_0x2750('0x12')],'data4':_0x354aff[_0x2750('0x1b')]||null,'role':_0x2750('0x1c'),'internal':_0x354aff[_0x2750('0x14')]?_[_0x2750('0x1d')](_0x354aff['accountcode']):undefined,'uniqueid':_0x354aff[_0x2750('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x15eb=['toNumber','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','outbound','lodash','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0x15eb,0xf0));var _0xb15e=function(_0x4070f8,_0x599ee1){_0x4070f8=_0x4070f8-0x0;var _0x4f1fa6=_0x15eb[_0x4070f8];return _0x4f1fa6;};'use strict';var moment=require('moment');var _=require(_0xb15e('0x0'));var util=require(_0xb15e('0x1'));var client=require(_0xb15e('0x2'));exports[_0xb15e('0x3')]=function(_0x13a15a){var _0x3c18d4=_0x13a15a['queuecallercompleteAt']||_0x13a15a[_0xb15e('0x4')];return client[_0xb15e('0x5')](_0xb15e('0x6'),{'body':{'channel':_0xb15e('0x7'),'membername':_0x13a15a['lastAssignedTo'],'interface':_[_0xb15e('0x8')](_0x13a15a[_0xb15e('0x9')])?util[_0xb15e('0xa')](_0xb15e('0xb'),_0x13a15a['lastAssignedTo']):_0x13a15a[_0xb15e('0x9')],'type':'TALKING','enterAt':_0x13a15a[_0xb15e('0xc')],'exitAt':_0x3c18d4,'duration':moment(_0x3c18d4)[_0xb15e('0xd')](_0x13a15a[_0xb15e('0xc')],_0xb15e('0xe')),'data1':_0xb15e('0xf'),'data2':_0x13a15a[_0xb15e('0x10')],'data3':_0x13a15a[_0xb15e('0x11')],'data4':null,'data5':_0x13a15a[_0xb15e('0x12')],'role':_0xb15e('0x13'),'internal':_0x13a15a[_0xb15e('0x14')]?_[_0xb15e('0x15')](_0x13a15a[_0xb15e('0x14')]):undefined,'uniqueid':_0x13a15a[_0xb15e('0x16')]},'log':'CreateMemberReport'});};exports[_0xb15e('0x17')]=function(_0x14cdd3){return client[_0xb15e('0x5')](_0xb15e('0x6'),{'body':{'channel':_0xb15e('0x7'),'membername':_0x14cdd3[_0xb15e('0x18')],'interface':_0x14cdd3[_0xb15e('0x9')],'type':_0xb15e('0x19'),'enterAt':_0x14cdd3[_0xb15e('0x1a')],'exitAt':_0x14cdd3[_0xb15e('0x1b')],'duration':moment(_0x14cdd3[_0xb15e('0x1b')])[_0xb15e('0xd')](_0x14cdd3[_0xb15e('0x1a')],_0xb15e('0xe'))>=0x0?moment(_0x14cdd3['endtime'])[_0xb15e('0xd')](_0x14cdd3[_0xb15e('0x1a')],'seconds'):null,'data1':_0xb15e('0x1c'),'data2':_0x14cdd3[_0xb15e('0x14')],'data3':_0x14cdd3['exten'],'data4':_0x14cdd3['dialstring']||null,'role':_0xb15e('0x13'),'internal':_0x14cdd3[_0xb15e('0x14')]?_['toNumber'](_0x14cdd3[_0xb15e('0x14')]):undefined,'uniqueid':_0x14cdd3[_0xb15e('0x16')]},'log':_0xb15e('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 2b76923..82a6beb 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 _0x5e49=['Request','GetSettings','../client','getSettings'];(function(_0x3ea59e,_0x42d141){var _0x5b01d6=function(_0xedeecf){while(--_0xedeecf){_0x3ea59e['push'](_0x3ea59e['shift']());}};_0x5b01d6(++_0x42d141);}(_0x5e49,0x152));var _0x95e4=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0x5e49[_0x47d6dc];return _0x1a1c93;};'use strict';var client=require(_0x95e4('0x0'));exports[_0x95e4('0x1')]=function(){return client[_0x95e4('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x95e4('0x3')});}; \ No newline at end of file +var _0x240e=['getSettings','ShowSetting','GetSettings'];(function(_0x4904d9,_0x720c0a){var _0x408e3f=function(_0x182a95){while(--_0x182a95){_0x4904d9['push'](_0x4904d9['shift']());}};_0x408e3f(++_0x720c0a);}(_0x240e,0x96));var _0xe240=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x240e[_0x1fc122];return _0xa2cb13;};'use strict';var client=require('../client');exports[_0xe240('0x0')]=function(){return client['Request'](_0xe240('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xe240('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d84b031..642b1a5 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 _0xa9a9=['../client','Request','name','GetTemplate'];(function(_0xfeb899,_0x5d56ec){var _0x301625=function(_0x2a0ccb){while(--_0x2a0ccb){_0xfeb899['push'](_0xfeb899['shift']());}};_0x301625(++_0x5d56ec);}(_0xa9a9,0x12c));var _0x9a9a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa9a9[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x9a9a('0x0'));exports['getTemplates']=function(_0xa6f8e5){return function(_0x3d76c7){return client[_0x9a9a('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x9a9a('0x2'),'html']},'log':_0x9a9a('0x3')});};}; \ No newline at end of file +var _0x57ff=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x303667,_0x166bf6){var _0x342e0b=function(_0x27f5de){while(--_0x27f5de){_0x303667['push'](_0x303667['shift']());}};_0x342e0b(++_0x166bf6);}(_0x57ff,0x127));var _0xf57f=function(_0x2c5a62,_0x1c7f57){_0x2c5a62=_0x2c5a62-0x0;var _0x201f3a=_0x57ff[_0x2c5a62];return _0x201f3a;};'use strict';var client=require(_0xf57f('0x0'));exports[_0xf57f('0x1')]=function(_0x5b9c76){return function(_0x45ee0f){return client[_0xf57f('0x2')](_0xf57f('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xf57f('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9eaeefb..57988d7 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 _0x4426=['value','action','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','Condition','AllConditions','AnyConditions'];(function(_0x4a4cac,_0x2b2950){var _0x1935aa=function(_0x4b7044){while(--_0x4b7044){_0x4a4cac['push'](_0x4a4cac['shift']());}};_0x1935aa(++_0x2b2950);}(_0x4426,0x78));var _0x6442=function(_0x125b80,_0x41db3b){_0x125b80=_0x125b80-0x0;var _0x414ba8=_0x4426[_0x125b80];return _0x414ba8;};'use strict';var client=require(_0x6442('0x0'));exports[_0x6442('0x1')]=function(_0x36a1cd){return function(_0x5644c4){return client[_0x6442('0x2')](_0x6442('0x3'),{'options':{'raw':![],'attributes':['id',_0x6442('0x4'),'channel','status'],'include':[{'model':_0x6442('0x5'),'as':_0x6442('0x6'),'attributes':['id','field','operator','value']},{'model':_0x6442('0x5'),'as':_0x6442('0x7'),'attributes':['id','field','operator',_0x6442('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x6442('0x9'),'data1',_0x6442('0xa'),_0x6442('0xb'),_0x6442('0xc'),_0x6442('0xd'),_0x6442('0xe'),_0x6442('0xf')]}]},'log':_0x6442('0x3')});};}; \ No newline at end of file +var _0x239d=['Request','name','channel','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data4','GetTrigger','getTriggers'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x239d,0x15f));var _0xd239=function(_0x192d74,_0x173e9d){_0x192d74=_0x192d74-0x0;var _0x4c95ba=_0x239d[_0x192d74];return _0x4c95ba;};'use strict';var client=require('../client');exports[_0xd239('0x0')]=function(_0x4c30fc){return function(_0x410eaa){return client[_0xd239('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xd239('0x2'),_0xd239('0x3'),'status'],'include':[{'model':_0xd239('0x4'),'as':_0xd239('0x5'),'attributes':['id',_0xd239('0x6'),'operator','value']},{'model':_0xd239('0x4'),'as':'AnyConditions','attributes':['id',_0xd239('0x6'),_0xd239('0x7'),_0xd239('0x8')]},{'model':_0xd239('0x9'),'as':_0xd239('0xa'),'attributes':['id',_0xd239('0xb'),_0xd239('0xc'),_0xd239('0xd'),'data3',_0xd239('0xe'),'data5','data6','data7']}]},'log':_0xd239('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 5b81caf..3977d0d 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 _0x1666=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x4302a8,_0x337f42){var _0x54a62f=function(_0x320caf){while(--_0x320caf){_0x4302a8['push'](_0x4302a8['shift']());}};_0x54a62f(++_0x337f42);}(_0x1666,0x75));var _0x6166=function(_0x5ed160,_0x4111d3){_0x5ed160=_0x5ed160-0x0;var _0x56443b=_0x1666[_0x5ed160];return _0x56443b;};'use strict';var client=require(_0x6166('0x0'));exports[_0x6166('0x1')]=function(_0x4f60ad){return function(_0x18af67){return client[_0x6166('0x2')](_0x6166('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6166('0x4'),_0x6166('0x5'),_0x6166('0x6')]},'log':_0x6166('0x3')});};}; \ No newline at end of file +var _0x3c06=['defaultuser','../client','getTrunks','Request','GetTrunk','registry'];(function(_0x3665a1,_0x25757c){var _0x1e93e4=function(_0x15cf46){while(--_0x15cf46){_0x3665a1['push'](_0x3665a1['shift']());}};_0x1e93e4(++_0x25757c);}(_0x3c06,0xf7));var _0x63c0=function(_0x481eb3,_0x196867){_0x481eb3=_0x481eb3-0x0;var _0xf77b8=_0x3c06[_0x481eb3];return _0xf77b8;};'use strict';var client=require(_0x63c0('0x0'));exports[_0x63c0('0x1')]=function(_0x38db04){return function(_0x34f9d6){return client[_0x63c0('0x2')](_0x63c0('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x63c0('0x4'),_0x63c0('0x5')]},'log':_0x63c0('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 02b50a9..a84728e 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x505986,_0x221e4e){var _0x1abb69=function(_0x179512){while(--_0x179512){_0x505986['push'](_0x505986['shift']());}};_0x1abb69(++_0x221e4e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0xcb91[_0x20fdc1];return _0x25397c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe706,0xa3));var _0x6e70=function(_0x20a599,_0x4e5a44){_0x20a599=_0x20a599-0x0;var _0x5dac8f=_0xe706[_0x20a599];return _0x5dac8f;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 15068ed..1fd1ce2 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 _0x1f97=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x1f97,0x126));var _0x71f9=function(_0x214905,_0x191088){_0x214905=_0x214905-0x0;var _0x2c8a1c=_0x1f97[_0x214905];return _0x2c8a1c;};'use strict';var client=require('../client');exports[_0x71f9('0x0')]=function(_0x3bb2f6){return client[_0x71f9('0x1')]('CreateVoiceAgentReport',{'body':_0x3bb2f6,'log':_0x71f9('0x2')});};exports[_0x71f9('0x3')]=function(_0x286108,_0x278e42,_0x1a4587){return client[_0x71f9('0x1')](_0x71f9('0x4'),{'body':_0x286108,'options':{'where':{'uniqueid':_0x278e42,'interface':_0x1a4587,'agentcomplete':!![]}},'log':_0x71f9('0x4')});}; \ No newline at end of file +var _0xae33=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x501587,_0x39275e){var _0x5e7b25=function(_0x439307){while(--_0x439307){_0x501587['push'](_0x501587['shift']());}};_0x5e7b25(++_0x39275e);}(_0xae33,0x161));var _0x3ae3=function(_0x4adbfa,_0x414456){_0x4adbfa=_0x4adbfa-0x0;var _0x2272ad=_0xae33[_0x4adbfa];return _0x2272ad;};'use strict';var client=require('../client');exports[_0x3ae3('0x0')]=function(_0x5508d6){return client[_0x3ae3('0x1')](_0x3ae3('0x2'),{'body':_0x5508d6,'log':_0x3ae3('0x2')});};exports[_0x3ae3('0x3')]=function(_0x769ff3,_0x2fb432,_0x30765f){return client[_0x3ae3('0x1')](_0x3ae3('0x4'),{'body':_0x769ff3,'options':{'where':{'uniqueid':_0x2fb432,'interface':_0x30765f,'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 52fb0ab..fad4272 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 _0x1f97=['billableseconds','util','../client','create','Request','merge','calleridnum','context','callerid','CreateVoiceCallReport','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration'];(function(_0x15470e,_0x5eeeb0){var _0x5cff80=function(_0x5ae2f2){while(--_0x5ae2f2){_0x15470e['push'](_0x15470e['shift']());}};_0x5cff80(++_0x5eeeb0);}(_0x1f97,0x122));var _0x71f9=function(_0x3d6070,_0x44f033){_0x3d6070=_0x3d6070-0x0;var _0x4bb333=_0x1f97[_0x3d6070];return _0x4bb333;};'use strict';var moment=require('moment');var util=require(_0x71f9('0x0'));var _=require('lodash');var client=require(_0x71f9('0x1'));exports[_0x71f9('0x2')]=function(_0x420533){return client[_0x71f9('0x3')]('CreateVoiceCallReport',{'body':_[_0x71f9('0x4')](_0x420533,{'source':_0x420533[_0x71f9('0x5')],'destinationcontext':_0x420533[_0x71f9('0x6')],'callerid':_0x420533[_0x71f9('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x71f9('0x8')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x71f9('0x3')](_0x71f9('0x9'),{'options':{'where':{'type':[_0x71f9('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x71f9('0xb'))[_0x71f9('0xc')](_0x71f9('0xd')),moment()['endOf'](_0x71f9('0xb'))['format'](_0x71f9('0xd'))]}},'attributes':['type',_0x71f9('0xe'),_0x71f9('0xf'),_0x71f9('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x25fa=['DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','startOf','day','format','endOf','GetVoiceCallReports','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum'];(function(_0x5e2314,_0x592ba6){var _0x5d2963=function(_0x51aea2){while(--_0x51aea2){_0x5e2314['push'](_0x5e2314['shift']());}};_0x5d2963(++_0x592ba6);}(_0x25fa,0x16e));var _0xa25f=function(_0x4ee942,_0x5ec2a9){_0x4ee942=_0x4ee942-0x0;var _0x30cbca=_0x25fa[_0x4ee942];return _0x30cbca;};'use strict';var moment=require(_0xa25f('0x0'));var util=require(_0xa25f('0x1'));var _=require(_0xa25f('0x2'));var client=require(_0xa25f('0x3'));exports[_0xa25f('0x4')]=function(_0x54f65c){return client['Request'](_0xa25f('0x5'),{'body':_[_0xa25f('0x6')](_0x54f65c,{'source':_0x54f65c[_0xa25f('0x7')],'destinationcontext':_0x54f65c['context'],'callerid':_0x54f65c['callerid'],'amaflags':_0xa25f('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0xa25f('0x9')]=function(){return function(){return client[_0xa25f('0xa')](_0xa25f('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xa25f('0xc')](_0xa25f('0xd'))[_0xa25f('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa25f('0xf')](_0xa25f('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition','duration','billableseconds']},'log':_0xa25f('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index ba05a34..bd9b22d 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 _0xfbb0=['create','Request','CreateVoiceDialReport'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfbb0,0xc6));var _0x0fbb=function(_0x238809,_0x54ae36){_0x238809=_0x238809-0x0;var _0x314060=_0xfbb0[_0x238809];return _0x314060;};'use strict';var client=require('../client');exports[_0x0fbb('0x0')]=function(_0x3453cd){return client[_0x0fbb('0x1')](_0x0fbb('0x2'),{'body':_0x3453cd,'log':_0x0fbb('0x2')});}; \ No newline at end of file +var _0xcc62=['CreateVoiceDialReport','create','Request'];(function(_0x53021f,_0x2988df){var _0x15809a=function(_0x1dbf94){while(--_0x1dbf94){_0x53021f['push'](_0x53021f['shift']());}};_0x15809a(++_0x2988df);}(_0xcc62,0x166));var _0x2cc6=function(_0x4896e0,_0x3843b1){_0x4896e0=_0x4896e0-0x0;var _0x5dde53=_0xcc62[_0x4896e0];return _0x5dde53;};'use strict';var client=require('../client');exports[_0x2cc6('0x0')]=function(_0x3b57f2){return client[_0x2cc6('0x1')](_0x2cc6('0x2'),{'body':_0x3b57f2,'log':_0x2cc6('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a0ae428..c4ace1e 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 _0x39cb=['recordingFormat','getVoiceExtensions','Request','exten'];(function(_0x553c1c,_0x2eb50b){var _0x39896d=function(_0x23af5c){while(--_0x23af5c){_0x553c1c['push'](_0x553c1c['shift']());}};_0x39896d(++_0x2eb50b);}(_0x39cb,0x1bd));var _0xb39c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x39cb[_0x19950b];return _0x3c6b41;};'use strict';var client=require('../client');exports[_0xb39c('0x0')]=function(){return function(){return client[_0xb39c('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb39c('0x2'),_0xb39c('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xf6fb=['getVoiceExtensions','Request','GetVoiceExtension','recordingFormat'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xf6fb,0x111));var _0xbf6f=function(_0x31e10,_0x376a33){_0x31e10=_0x31e10-0x0;var _0x59c757=_0xf6fb[_0x31e10];return _0x59c757;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xbf6f('0x0')](_0xbf6f('0x1'),{'options':{'raw':!![],'attributes':['id','exten',_0xbf6f('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xbf6f('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8b3ebff..8e73b0c 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 _0x7412=['dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','GetVoiceQueue','acw','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry'];(function(_0x361ee1,_0x37fed8){var _0x1fcaad=function(_0xd426bf){while(--_0xd426bf){_0x361ee1['push'](_0x361ee1['shift']());}};_0x1fcaad(++_0x37fed8);}(_0x7412,0x161));var _0x2741=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x7412[_0x4e9d3c];return _0x2d0825;};'use strict';var client=require(_0x2741('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x2741('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x2741('0x2'),'acwTimeout','autopause','monitor_format','type','dialActive','dialMethod',_0x2741('0x3'),_0x2741('0x4'),_0x2741('0x5'),'dialPredictiveOptimization',_0x2741('0x6'),_0x2741('0x7'),_0x2741('0x8'),_0x2741('0x9'),'dialOriginateTimeout',_0x2741('0xa'),_0x2741('0xb'),_0x2741('0xc'),_0x2741('0xd'),_0x2741('0xe'),'dialBusyMaxRetry',_0x2741('0xf'),_0x2741('0x10'),_0x2741('0x11'),_0x2741('0x12'),_0x2741('0x13'),_0x2741('0x14'),_0x2741('0x15'),_0x2741('0x16'),'dialAMDActive',_0x2741('0x17'),_0x2741('0x18'),_0x2741('0x19'),_0x2741('0x1a'),_0x2741('0x1b'),_0x2741('0x1c'),_0x2741('0x1d'),_0x2741('0x1e'),_0x2741('0x1f'),'timeout',_0x2741('0x20'),_0x2741('0x21'),'dialOrderByScheduledAt',_0x2741('0x22'),_0x2741('0x23'),'dialQueueProject2','monitor_format',_0x2741('0x24'),_0x2741('0x25'),_0x2741('0x26'),_0x2741('0x27'),_0x2741('0x28'),_0x2741('0x29'),_0x2741('0x2a'),_0x2741('0x2b'),'dialAbandonedRetryFrequency',_0x2741('0x2c'),'dialMachineRetryFrequency',_0x2741('0x2d'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x2741('0x2e'),_0x2741('0x2f'),_0x2741('0x30')],'include':[{'model':'Trunk','as':_0x2741('0x31'),'attributes':['id',_0x2741('0x32'),_0x2741('0x33'),_0x2741('0x34')]},{'model':'Pause','as':_0x2741('0x35'),'attributes':['id',_0x2741('0x32')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x2741('0x32'),'callerid','active']},{'model':_0x2741('0x36'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0x2741('0x36'),'as':_0x2741('0x37'),'attributes':['id',_0x2741('0x32'),_0x2741('0x38')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x36b2=['type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','monitor_format'];(function(_0x5a69f4,_0x5cea76){var _0x23b682=function(_0x259219){while(--_0x259219){_0x5a69f4['push'](_0x5a69f4['shift']());}};_0x23b682(++_0x5cea76);}(_0x36b2,0x6b));var _0x236b=function(_0x6a55cd,_0x123a8c){_0x6a55cd=_0x6a55cd-0x0;var _0x3d1ab3=_0x36b2[_0x6a55cd];return _0x3d1ab3;};'use strict';var client=require(_0x236b('0x0'));exports[_0x236b('0x1')]=function(){return function(){return client[_0x236b('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x236b('0x3'),_0x236b('0x4'),_0x236b('0x5'),'autopause',_0x236b('0x6'),_0x236b('0x7'),'dialActive',_0x236b('0x8'),_0x236b('0x9'),_0x236b('0xa'),_0x236b('0xb'),_0x236b('0xc'),_0x236b('0xd'),'dialPredictiveInterval',_0x236b('0xe'),_0x236b('0xf'),_0x236b('0x10'),_0x236b('0x11'),'dialQueueTimeout',_0x236b('0x12'),_0x236b('0x13'),_0x236b('0x14'),'dialBusyMaxRetry',_0x236b('0x15'),_0x236b('0x16'),_0x236b('0x17'),'dialGlobalMaxRetry',_0x236b('0x18'),'dialGlobalInterval','dialPrefix',_0x236b('0x19'),'dialAMDActive',_0x236b('0x1a'),_0x236b('0x1b'),_0x236b('0x1c'),_0x236b('0x1d'),_0x236b('0x1e'),_0x236b('0x1f'),_0x236b('0x20'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x236b('0x21'),_0x236b('0x22'),_0x236b('0x23'),_0x236b('0x24'),_0x236b('0x25'),'dialAgiAfterHangupClient','dialQueueProject2',_0x236b('0x6'),'strategy',_0x236b('0x26'),_0x236b('0x27'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x236b('0x28'),'dialDropRetryFrequency',_0x236b('0x29'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x236b('0x2a'),_0x236b('0x2b'),_0x236b('0x2c'),_0x236b('0x2d'),_0x236b('0x2e'),_0x236b('0x2f'),_0x236b('0x30')],'include':[{'model':_0x236b('0x31'),'as':_0x236b('0x31'),'attributes':['id',_0x236b('0x3'),_0x236b('0x32'),_0x236b('0x33')]},{'model':'Pause','as':_0x236b('0x34'),'attributes':['id',_0x236b('0x3')]},{'model':'Trunk','as':_0x236b('0x35'),'attributes':['id',_0x236b('0x3'),_0x236b('0x32'),'active']},{'model':_0x236b('0x36'),'as':_0x236b('0x36'),'attributes':['id',_0x236b('0x3')],'include':[{'model':_0x236b('0x36'),'as':_0x236b('0x37'),'attributes':['id',_0x236b('0x3'),_0x236b('0x38')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 199eeca..92f1d63 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(_0x43635c,_0x35f12a){var _0x47edab=function(_0xe77c25){while(--_0xe77c25){_0x43635c['push'](_0x43635c['shift']());}};_0x47edab(++_0x35f12a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x204138,_0x5bc23e){var _0x2bcb70=function(_0x1ea2f3){while(--_0x1ea2f3){_0x204138['push'](_0x204138['shift']());}};_0x2bcb70(++_0x5bc23e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 1926486..dac72c9 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 _0x1d29=['getVoiceQueueRtPauses'];(function(_0x3dc8b3,_0x24e1dd){var _0x35fe36=function(_0x12c694){while(--_0x12c694){_0x3dc8b3['push'](_0x3dc8b3['shift']());}};_0x35fe36(++_0x24e1dd);}(_0x1d29,0xdd));var _0x91d2=function(_0x3621ab,_0x15c6ac){_0x3621ab=_0x3621ab-0x0;var _0x39804f=_0x1d29[_0x3621ab];return _0x39804f;};'use strict';var client=require('../client');exports[_0x91d2('0x0')]=function(_0x31c42a){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x31c42a,'paused':!![]},'raw':!![]},'log':_0x91d2('0x0')});};}; \ No newline at end of file +var _0x9eba=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x5397be,_0x6629db){var _0xa13cbf=function(_0x26028e){while(--_0x26028e){_0x5397be['push'](_0x5397be['shift']());}};_0xa13cbf(++_0x6629db);}(_0x9eba,0x15b));var _0xa9eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9eba[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xa9eb('0x0')]=function(_0x54a799){return function(){return client[_0xa9eb('0x1')](_0xa9eb('0x2'),{'options':{'where':{'VoiceQueueId':_0x54a799,'paused':!![]},'raw':!![]},'log':_0xa9eb('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 6b938c0..dac3df8 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(_0x2f209c,_0x2c17fd){var _0x141b05=function(_0x21bb34){while(--_0x21bb34){_0x2f209c['push'](_0x2f209c['shift']());}};_0x141b05(++_0x2c17fd);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2f79e5,_0x1059ae){var _0x5531bb=function(_0x2cdffc){while(--_0x2cdffc){_0x2f79e5['push'](_0x2f79e5['shift']());}};_0x5531bb(++_0x1059ae);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 05c11c9..6c66d11 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 _0x5806=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum'];(function(_0x3f4a75,_0x1ff97e){var _0x1cd60d=function(_0x317c0d){while(--_0x317c0d){_0x3f4a75['push'](_0x3f4a75['shift']());}};_0x1cd60d(++_0x1ff97e);}(_0x5806,0x111));var _0x6580=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0x5806[_0x4cefc3];return _0x1cc779;};'use strict';var client=require(_0x6580('0x0'));exports[_0x6580('0x1')]={};exports['blindTransfer']=function(_0x9660ef){return client[_0x6580('0x2')](_0x6580('0x3'),{'body':{'result':_0x9660ef[_0x6580('0x4')],'transfererchannel':_0x9660ef['transfererchannel'],'transferercalleridnum':_0x9660ef[_0x6580('0x5')],'transferercalleridname':_0x9660ef[_0x6580('0x6')],'transfererconnectedlinenum':_0x9660ef[_0x6580('0x7')],'transfererconnectedlinename':_0x9660ef[_0x6580('0x8')],'transfereraccountcode':_0x9660ef[_0x6580('0x9')],'transferercontext':_0x9660ef[_0x6580('0xa')],'transfererexten':_0x9660ef['transfererexten'],'transfererlinkedid':_0x9660ef['transfererlinkedid'],'transfereechannel':_0x9660ef[_0x6580('0xb')],'transfereecalleridnum':_0x9660ef['transfereecalleridnum'],'transfereecalleridname':_0x9660ef[_0x6580('0xc')],'transfereeconnectedlinenum':_0x9660ef[_0x6580('0xd')],'transfereeconnectedlinename':_0x9660ef['transfereeconnectedlinename'],'transfereeaccountcode':_0x9660ef[_0x6580('0xe')],'transfereecontext':_0x9660ef[_0x6580('0xf')],'transfereeexten':_0x9660ef[_0x6580('0x10')],'transfereelinkedid':_0x9660ef['transfereelinkedid'],'isexternal':_0x9660ef[_0x6580('0x11')],'context':_0x9660ef[_0x6580('0x12')],'extension':_0x9660ef[_0x6580('0x13')],'type':_0x6580('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0x6580('0x15')]=function(_0x4b9d42){return client[_0x6580('0x2')](_0x6580('0x3'),{'body':{'result':_0x4b9d42[_0x6580('0x4')],'transfererchannel':_0x4b9d42[_0x6580('0x16')],'transferercalleridnum':_0x4b9d42['origtransferercalleridnum'],'transferercalleridname':_0x4b9d42[_0x6580('0x17')],'transfererconnectedlinenum':_0x4b9d42[_0x6580('0x18')],'transfererconnectedlinename':_0x4b9d42['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4b9d42[_0x6580('0x19')],'transferercontext':_0x4b9d42['secondtransferercontext'],'transfererexten':_0x4b9d42[_0x6580('0x1a')],'transfererlinkedid':_0x4b9d42[_0x6580('0x1b')],'transfereechannel':_0x4b9d42[_0x6580('0x1c')],'transfereecalleridnum':_0x4b9d42[_0x6580('0x1d')],'transfereecalleridname':_0x4b9d42['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4b9d42[_0x6580('0x1e')],'transfereeconnectedlinename':_0x4b9d42[_0x6580('0x1f')],'transfereeaccountcode':_0x4b9d42[_0x6580('0x20')],'transfereecontext':_0x4b9d42[_0x6580('0x21')],'transfereeexten':_0x4b9d42[_0x6580('0x22')],'transfereelinkedid':_0x4b9d42[_0x6580('0x23')],'isexternal':_0x4b9d42[_0x6580('0x11')],'context':_0x4b9d42[_0x6580('0x24')],'extension':_0x4b9d42['origtransfererexten'],'type':_0x6580('0x25')},'log':_0x6580('0x3')});}; \ No newline at end of file +var _0xfefd=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','extension','blind','attendedTransfer','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x102470,_0x199a01){var _0x558eaa=function(_0x12c74a){while(--_0x12c74a){_0x102470['push'](_0x102470['shift']());}};_0x558eaa(++_0x199a01);}(_0xfefd,0x102));var _0xdfef=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0xfefd[_0x1865d4];return _0x1f0e1c;};'use strict';var client=require('../client');exports[_0xdfef('0x0')]={};exports[_0xdfef('0x1')]=function(_0x494d29){return client[_0xdfef('0x2')](_0xdfef('0x3'),{'body':{'result':_0x494d29[_0xdfef('0x4')],'transfererchannel':_0x494d29[_0xdfef('0x5')],'transferercalleridnum':_0x494d29[_0xdfef('0x6')],'transferercalleridname':_0x494d29[_0xdfef('0x7')],'transfererconnectedlinenum':_0x494d29[_0xdfef('0x8')],'transfererconnectedlinename':_0x494d29[_0xdfef('0x9')],'transfereraccountcode':_0x494d29[_0xdfef('0xa')],'transferercontext':_0x494d29[_0xdfef('0xb')],'transfererexten':_0x494d29[_0xdfef('0xc')],'transfererlinkedid':_0x494d29[_0xdfef('0xd')],'transfereechannel':_0x494d29[_0xdfef('0xe')],'transfereecalleridnum':_0x494d29['transfereecalleridnum'],'transfereecalleridname':_0x494d29[_0xdfef('0xf')],'transfereeconnectedlinenum':_0x494d29['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x494d29[_0xdfef('0x10')],'transfereeaccountcode':_0x494d29[_0xdfef('0x11')],'transfereecontext':_0x494d29['transfereecontext'],'transfereeexten':_0x494d29[_0xdfef('0x12')],'transfereelinkedid':_0x494d29['transfereelinkedid'],'isexternal':_0x494d29[_0xdfef('0x13')],'context':_0x494d29['context'],'extension':_0x494d29[_0xdfef('0x14')],'type':_0xdfef('0x15')},'log':_0xdfef('0x3')});};exports[_0xdfef('0x16')]=function(_0x4f958f){return client[_0xdfef('0x2')](_0xdfef('0x3'),{'body':{'result':_0x4f958f[_0xdfef('0x4')],'transfererchannel':_0x4f958f['origtransfererchannel'],'transferercalleridnum':_0x4f958f['origtransferercalleridnum'],'transferercalleridname':_0x4f958f[_0xdfef('0x17')],'transfererconnectedlinenum':_0x4f958f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4f958f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4f958f[_0xdfef('0x18')],'transferercontext':_0x4f958f[_0xdfef('0x19')],'transfererexten':_0x4f958f[_0xdfef('0x1a')],'transfererlinkedid':_0x4f958f['origtransfererlinkedid'],'transfereechannel':_0x4f958f[_0xdfef('0x1b')],'transfereecalleridnum':_0x4f958f[_0xdfef('0x1c')],'transfereecalleridname':_0x4f958f[_0xdfef('0x1d')],'transfereeconnectedlinenum':_0x4f958f[_0xdfef('0x1e')],'transfereeconnectedlinename':_0x4f958f[_0xdfef('0x1f')],'transfereeaccountcode':_0x4f958f[_0xdfef('0x20')],'transfereecontext':_0x4f958f['transfertargetcontext'],'transfereeexten':_0x4f958f[_0xdfef('0x21')],'transfereelinkedid':_0x4f958f[_0xdfef('0x22')],'isexternal':_0x4f958f[_0xdfef('0x13')],'context':_0x4f958f[_0xdfef('0x23')],'extension':_0x4f958f['origtransfererexten'],'type':'attended'},'log':_0xdfef('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 43be9f5..a4e5399 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 _0x9fe7=['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','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','values','channels','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','voicechannel','resolve','Action','StopMixMonitor','stop','wav','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','then','message','catch','isConnected','pick','command','Command','voiceQueues','strategy','answered','available','sumBillable','sumHoldTime','abandoned','waiting','type','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9fe7,0x1df));var _0x79fe=function(_0x384bef,_0x2f53b4){_0x384bef=_0x384bef-0x0;var _0x12e20b=_0x9fe7[_0x384bef];return _0x12e20b;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var jayson=require('jayson/promise');var schema=require(_0x79fe('0x2'));var BPromise=require('bluebird');var moment=require(_0x79fe('0x3'));var config=require(_0x79fe('0x4'));var properties=require(_0x79fe('0x5'));var ami=require('../ami');exports[_0x79fe('0x6')]=function(_0x627ec4,_0x14e975,_0x4af9f6){return new BPromise(function(_0x3cec9c,_0x2a5aef){var _0x2ba246={'QueuePause':function(_0x4c8314){return new Promise(function(_0x24faa0,_0x264323){var _0x29b317=util[_0x79fe('0x7')](_0x79fe('0x8'),'SIP',_0x4c8314[_0x79fe('0x9')]);if(_0x627ec4[_0x79fe('0xa')]&&_0x627ec4['timers'][_0x29b317]&&_0x627ec4[_0x79fe('0xa')][_0x29b317][_0x79fe('0xb')]){_0x627ec4[_0x79fe('0xa')][_0x29b317][_0x79fe('0xc')]();}if(_0x627ec4['agents'][_0x29b317]){_0x627ec4[_0x79fe('0xd')][_0x29b317][_0x79fe('0xe')]({'statePause':_0x4c8314[_0x79fe('0xf')]?!![]:![]});}_0x24faa0({'code':0xc8,'message':_0x79fe('0x10')});});},'Reload':function(_0x1a83f2){var _0x260734=this;return new Promise(function(_0x42bbe4,_0x1abd7f){if(ami['isConnected']()==![]){return _0x1abd7f(_0x260734[_0x79fe('0x11')](0x1f4,[config[_0x79fe('0x12')]['ip'],config[_0x79fe('0x12')][_0x79fe('0x13')],_0x79fe('0x14')][_0x79fe('0x15')]('\x20')));}_0x1a83f2=_['pick'](_0x1a83f2,_[_0x79fe('0x16')](properties[_0x79fe('0x17')]));_0x1a83f2[_0x79fe('0x18')]=_0x79fe('0x19');return ami['Action'](_0x1a83f2)[_0x79fe('0x1a')](function(_0x16f93a){_0x42bbe4({'code':0xc8,'message':_0x16f93a[_0x79fe('0x1b')]});})[_0x79fe('0x1c')](function(_0x536641){_0x1abd7f(_0x260734['error'](0x1f5,_0x536641[_0x79fe('0x1b')]));});});},'Command':function(_0x1a1224){var _0x25e51f=this;return new Promise(function(_0x4bca4d,_0x891611){if(ami[_0x79fe('0x1d')]()==![]){return _0x891611(_0x25e51f[_0x79fe('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x79fe('0x12')]['username'],_0x79fe('0x14')][_0x79fe('0x15')]('\x20')));}_0x1a1224=_[_0x79fe('0x1e')](_0x1a1224,_0x79fe('0x1f'));_0x1a1224[_0x79fe('0x18')]=_0x79fe('0x20');return ami['Action'](_0x1a1224)['then'](function(_0x107641){_0x4bca4d({'code':0xc8,'message':_0x107641['content']});})[_0x79fe('0x1c')](function(_0x3721bc){_0x891611(_0x25e51f['error'](0x1f5,_0x3721bc['message']));});});},'VoiceQueues':function(_0x454e93){return new Promise(function(_0x321778,_0x59339b){var _0x46d93d=[];for(var _0x1c1f74 in _0x627ec4['voiceQueues']){if(_0x627ec4['voiceQueues']['hasOwnProperty'](_0x1c1f74)){var _0x3720fa=_0x627ec4[_0x79fe('0x21')][_0x1c1f74];var _0x36ead5={'id':_0x3720fa['id'],'name':_0x3720fa['name'],'strategy':_0x3720fa[_0x79fe('0x22')],'answered':_0x3720fa[_0x79fe('0x23')],'available':_0x3720fa[_0x79fe('0x24')],'loggedIn':_0x3720fa['loggedIn'],'pTalking':_0x3720fa['pTalking'],'sumBillable':_0x3720fa[_0x79fe('0x25')],'sumDuration':_0x3720fa['sumDuration'],'sumHoldTime':_0x3720fa[_0x79fe('0x26')]||0x0,'talking':_0x3720fa['talking'],'total':_0x3720fa['total'],'type':_0x3720fa['type'],'unmanaged':_0x3720fa['unmanaged'],'abandoned':_0x3720fa[_0x79fe('0x27')],'waiting':_0x3720fa[_0x79fe('0x28')],'loggedInDb':_0x3720fa['loggedInDb']};if(_0x3720fa[_0x79fe('0x29')]==='outbound'){_0x36ead5[_0x79fe('0x2a')]=_0x3720fa[_0x79fe('0x2a')];_0x36ead5[_0x79fe('0x2b')]=_0x3720fa[_0x79fe('0x2b')];_0x36ead5[_0x79fe('0x2c')]=_0x3720fa['dialOriginateCallerIdName'];_0x36ead5[_0x79fe('0x2d')]=_0x3720fa[_0x79fe('0x2d')];_0x36ead5[_0x79fe('0x2e')]=_0x3720fa[_0x79fe('0x2e')];_0x36ead5[_0x79fe('0x2f')]=_0x3720fa[_0x79fe('0x2f')];_0x36ead5['temp']=_0x3720fa[_0x79fe('0x30')];_0x36ead5[_0x79fe('0x31')]=_0x3720fa[_0x79fe('0x31')];_0x36ead5[_0x79fe('0x32')]=_0x3720fa[_0x79fe('0x32')];_0x36ead5[_0x79fe('0x33')]=_0x3720fa['outboundBlacklistCallsDay'];_0x36ead5[_0x79fe('0x34')]=_0x3720fa['outboundBusyCallsDay'];_0x36ead5[_0x79fe('0x35')]=_0x3720fa['outboundCongestionCallsDay'];_0x36ead5[_0x79fe('0x36')]=_0x3720fa['outboundDropCallsDayACS'];_0x36ead5[_0x79fe('0x37')]=_0x3720fa[_0x79fe('0x37')];_0x36ead5[_0x79fe('0x38')]=_0x3720fa['outboundDropCallsDayTimeout'];_0x36ead5[_0x79fe('0x39')]=_0x3720fa[_0x79fe('0x39')];_0x36ead5[_0x79fe('0x3a')]=_0x3720fa[_0x79fe('0x3a')];_0x36ead5[_0x79fe('0x3b')]=_0x3720fa['outboundOriginateFailureCallsDay'];_0x36ead5['outboundReCallsDay']=_0x3720fa[_0x79fe('0x3c')];_0x36ead5['outboundRejectCallsDay']=_0x3720fa[_0x79fe('0x3d')];_0x36ead5[_0x79fe('0x3e')]=_0x3720fa['outboundUnknownCallsDay'];_0x36ead5[_0x79fe('0x3f')]=_0x3720fa[_0x79fe('0x3f')];_0x36ead5[_0x79fe('0x40')]=_0x3720fa[_0x79fe('0x40')];_0x36ead5[_0x79fe('0x41')]=_0x3720fa[_0x79fe('0x41')];_0x36ead5['predictiveIntervalDroppedCallsCallersExit']=_0x3720fa[_0x79fe('0x42')];_0x36ead5[_0x79fe('0x43')]=_0x3720fa[_0x79fe('0x43')];_0x36ead5[_0x79fe('0x44')]=_0x3720fa['predictiveIntervalErlangCalls'];_0x36ead5[_0x79fe('0x45')]=_0x3720fa['predictiveIntervalErlangCallsDroppedCalls'];_0x36ead5[_0x79fe('0x46')]=_0x3720fa['predictiveIntervalHitRate'];_0x36ead5[_0x79fe('0x47')]=_0x3720fa['predictiveIntervalMultiplicativeFactor'];_0x36ead5[_0x79fe('0x48')]=_0x3720fa[_0x79fe('0x48')];_0x36ead5['predictiveIntervalAvailable']=_0x3720fa['predictiveIntervalAvailable'];_0x36ead5[_0x79fe('0x49')]=_0x3720fa[_0x79fe('0x49')];_0x36ead5[_0x79fe('0x1b')]=_0x3720fa[_0x79fe('0x1b')];_0x36ead5['originated']=_0x3720fa['originated'];_0x36ead5[_0x79fe('0x4a')]=_0x3720fa[_0x79fe('0x4a')];_0x36ead5[_0x79fe('0x4b')]=_0x3720fa[_0x79fe('0x4b')];_0x36ead5[_0x79fe('0x4c')]=_0x3720fa[_0x79fe('0x4c')];_0x36ead5[_0x79fe('0x4d')]=_0x3720fa[_0x79fe('0x4d')];_0x36ead5['startPredictive']=_0x3720fa[_0x79fe('0x4e')];_0x36ead5[_0x79fe('0x4f')]=_0x3720fa[_0x79fe('0x4f')];}if(_0x3720fa[_0x79fe('0x50')]){_0x36ead5[_0x79fe('0x50')]={'id':_0x3720fa[_0x79fe('0x50')]['id'],'name':_0x3720fa['Trunk'][_0x79fe('0x9')],'active':_0x3720fa[_0x79fe('0x50')][_0x79fe('0x51')],'callerid':_0x3720fa[_0x79fe('0x50')][_0x79fe('0x52')]};}if(_0x3720fa[_0x79fe('0x53')]){_0x36ead5['Interval']={'id':_0x3720fa[_0x79fe('0x53')]['id'],'name':_0x3720fa[_0x79fe('0x53')][_0x79fe('0x9')]};}_0x46d93d['push'](_0x36ead5);}}_0x321778({'count':_0x46d93d[_0x79fe('0x54')],'rows':_0x46d93d});});},'UpdateVoiceQueue':function(_0x563b71){return new Promise(function(_0x569c78,_0x28068f){var _0x379272=_[_0x79fe('0x55')](_0x627ec4['voiceQueues'],{'id':parseInt(_0x563b71['id'])});var _0x2aebbc=_[_0x79fe('0x56')](_0x563b71,['id']);if(_0x379272){for(var _0x42c5af in _0x2aebbc){if(typeof _0x2aebbc[_0x42c5af]!=='undefined'&&typeof _0x379272[_0x42c5af]!=='undefined'){_0x379272[_0x42c5af]=_0x2aebbc[_0x42c5af];}}_0x569c78(_0x379272);}else{_0x28068f();}});},'VoiceChannels':function(_0x4b904d){return new Promise(function(_0x205d67,_0x1594ce){var _0xd5de03=_[_0x79fe('0x57')](_0x627ec4[_0x79fe('0x58')]);_0x205d67({'count':_0xd5de03[_0x79fe('0x54')],'rows':_0xd5de03});});},'VoiceChannelMixMonitor':function(_0x23f270){var _0x2b46ad=this;return new Promise(function(_0x5a1779,_0x41f153){if(ami[_0x79fe('0x1d')]()==![]){return _0x41f153(_0x2b46ad['error'](0x1f4,[config[_0x79fe('0x12')]['ip'],config['asterisk'][_0x79fe('0x13')],_0x79fe('0x14')][_0x79fe('0x15')]('\x20')));}var _0x1761d7=schema(properties['voicechannel'])[_0x79fe('0x2')](_0x23f270);if(_0x1761d7[_0x79fe('0x54')]>0x0){return _0x41f153(_0x2b46ad[_0x79fe('0x11')](0x1f4,_['map'](_0x1761d7,'message')[_0x79fe('0x15')](',\x20')));}var _0x1ce058=_['find'](_0x627ec4[_0x79fe('0x58')],{'uniqueid':_0x23f270[_0x79fe('0x59')]});if(_0x1ce058&&_0x1ce058[_0x79fe('0x5a')]){var _0xeb0195=util['format'](_0x79fe('0x5b'),_0x23f270[_0x79fe('0x5c')]||_0x23f270[_0x79fe('0x59')],_0x23f270['format']||'wav');return ami['Action']({'action':'MixMonitor','channel':_0x1ce058['channel'],'file':_0xeb0195,'options':_0x79fe('0x5d')})[_0x79fe('0x1a')](function(_0x4f0ca8){var _0x1ccd76=_[_0x79fe('0x55')](_0x1ce058[_0x79fe('0x5e')],{'filename':'/var/spool/asterisk/monitor/'+_0xeb0195['toLowerCase']()});if(_['isNil'](_0x1ccd76)){_0x1ce058[_0x79fe('0x5e')]['push']({'filename':_0x79fe('0x5f')+_0xeb0195[_0x79fe('0x60')](),'createdAt':moment()[_0x79fe('0x7')](_0x79fe('0x61')),'mixmonitorid':_0x4f0ca8[_0x79fe('0x62')],'status':_0x79fe('0x63')});}else{_0x1ccd76[_0x79fe('0x62')]=_0x4f0ca8[_0x79fe('0x62')];_0x1ccd76[_0x79fe('0x64')]=_0x79fe('0x63');}_0x5a1779({'code':0xc8,'message':[_0x23f270[_0x79fe('0x59')],'MixMonitor\x20Success',_0x4f0ca8[_0x79fe('0x62')]][_0x79fe('0x15')]('\x20'),'mixmonitorid':_0x4f0ca8['mixmonitorid']});})[_0x79fe('0x1c')](function(_0x5eca77){_0x41f153(_0x2b46ad[_0x79fe('0x11')](0x1f5,[_0x23f270[_0x79fe('0x59')],_0x5eca77['message'][_0x79fe('0x60')]()]['join']('\x20')));});}else{return _0x41f153(_0x2b46ad[_0x79fe('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5ef724){var _0x492ac1=this;return new Promise(function(_0x9728b9,_0x272272){if(ami[_0x79fe('0x1d')]()==![]){return _0x272272(_0x492ac1[_0x79fe('0x11')](0x1f4,[config[_0x79fe('0x12')]['ip'],config[_0x79fe('0x12')][_0x79fe('0x13')],_0x79fe('0x14')][_0x79fe('0x15')]('\x20')));}var _0x562f29=schema(properties[_0x79fe('0x65')])[_0x79fe('0x2')](_0x5ef724);if(_0x562f29[_0x79fe('0x54')]>0x0){return _0x272272(_0x492ac1[_0x79fe('0x11')](0x1f4,_['map'](_0x562f29,_0x79fe('0x1b'))['join'](',\x20')));}var _0x24da87=_['find'](_0x627ec4[_0x79fe('0x58')],{'uniqueid':_0x5ef724[_0x79fe('0x59')]});if(_0x24da87){return BPromise[_0x79fe('0x66')]()[_0x79fe('0x1a')](function(){if(_0x24da87['channel']){return ami[_0x79fe('0x67')]({'action':_0x79fe('0x68'),'channel':_0x24da87[_0x79fe('0x5a')],'mixmonitorid':_0x5ef724[_0x79fe('0x62')]})['catch'](function(_0x9e880c){});}})[_0x79fe('0x1a')](function(){if(_0x24da87['destinationchannel']){return ami[_0x79fe('0x67')]({'action':'StopMixMonitor','channel':_0x24da87['destinationchannel'],'mixmonitorid':_0x5ef724[_0x79fe('0x62')]})[_0x79fe('0x1c')](function(_0x60161c){});}})['then'](function(_0x58adb7){var _0x21fda0=_['find'](_0x24da87['monitors'],{'mixmonitorid':_0x5ef724[_0x79fe('0x62')]});if(_0x21fda0){_0x21fda0[_0x79fe('0x64')]=_0x79fe('0x69');}})[_0x79fe('0x1a')](function(){var _0x54b3fb=util[_0x79fe('0x7')](_0x79fe('0x5b'),_0x5ef724[_0x79fe('0x5c')]||_0x5ef724[_0x79fe('0x59')],_0x5ef724['format']||_0x79fe('0x6a'));var _0x36e157=_['find'](_0x24da87[_0x79fe('0x5e')],{'filename':_0x79fe('0x5f')+_0x54b3fb[_0x79fe('0x60')]()});if(_0x36e157){_0x36e157[_0x79fe('0x64')]=_0x79fe('0x69');}})[_0x79fe('0x1a')](function(){_0x9728b9({'code':0xc8,'message':[_0x5ef724[_0x79fe('0x59')],_0x79fe('0x6b')][_0x79fe('0x15')]('\x20')});})[_0x79fe('0x1c')](function(_0x35ea01){_0x272272(_0x492ac1['error'](0x1f5,[_0x5ef724[_0x79fe('0x59')],_0x35ea01[_0x79fe('0x1b')][_0x79fe('0x60')]()][_0x79fe('0x15')]('\x20')));});}else{return _0x272272(_0x492ac1[_0x79fe('0x11')](0x1f5,_0x79fe('0x6c')));}});},'VoiceQueuesChannels':function(_0x177777){return new Promise(function(_0x492d92,_0xdf3368){var _0x238d57=_[_0x79fe('0x57')](_0x627ec4['queueChannels']);_0x492d92({'count':_0x238d57['length'],'rows':_0x238d57});});},'VoiceQueuesChannel':function(_0x5e7a6e){var _0x4cec0c=this;return new Promise(function(_0x16525f,_0x485b00){var _0x31440b=schema(properties[_0x79fe('0x6d')])[_0x79fe('0x2')](_0x5e7a6e);if(_0x31440b[_0x79fe('0x54')]>0x0){return _0x485b00(_0x4cec0c[_0x79fe('0x11')](0x1f4,_['map'](_0x31440b,_0x79fe('0x1b'))['join'](',\x20')));}var _0x234f4d=_[_0x79fe('0x55')](_0x627ec4[_0x79fe('0x6e')],{'uniqueid':_0x5e7a6e[_0x79fe('0x59')]});if(_0x234f4d){_0x16525f(_0x234f4d);}else{return _0x485b00(_0x4cec0c[_0x79fe('0x11')](0x1f5,_0x79fe('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x467f5b){var _0x54bd13=this;return new Promise(function(_0x24d539,_0x50c361){if(ami[_0x79fe('0x1d')]()==![]){return _0x50c361(_0x54bd13[_0x79fe('0x11')](0x1f4,[config[_0x79fe('0x12')]['ip'],config['asterisk'][_0x79fe('0x13')],_0x79fe('0x14')][_0x79fe('0x15')]('\x20')));}var _0x46f42a=schema(properties['voicequeuechannelhangup'])[_0x79fe('0x2')](_0x467f5b);if(_0x46f42a[_0x79fe('0x54')]>0x0){return _0x50c361(_0x54bd13[_0x79fe('0x11')](0x1f4,_['map'](_0x46f42a,_0x79fe('0x1b'))[_0x79fe('0x15')](',\x20')));}var _0x3db2ed=_[_0x79fe('0x55')](_0x627ec4[_0x79fe('0x6e')],{'uniqueid':_0x467f5b[_0x79fe('0x59')]});if(_0x3db2ed&&_0x3db2ed[_0x79fe('0x5a')]){return ami[_0x79fe('0x67')]({'action':_0x79fe('0x6f'),'channel':_0x3db2ed['channel']})[_0x79fe('0x1a')](function(_0x5122c8){_0x24d539({'code':0xc8,'message':[_0x467f5b[_0x79fe('0x59')],_0x5122c8[_0x79fe('0x1b')][_0x79fe('0x60')]()][_0x79fe('0x15')]('\x20')});})[_0x79fe('0x1c')](function(_0x5d6035){_0x50c361(_0x54bd13[_0x79fe('0x11')](0x1f5,[_0x467f5b['uniqueid'],_0x5d6035[_0x79fe('0x1b')][_0x79fe('0x60')]()]['join']('\x20')));});}else{return _0x50c361(_0x54bd13[_0x79fe('0x11')](0x1f5,_0x79fe('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x18262c){var _0x256035=this;return new Promise(function(_0x1b370f,_0x5490ff){if(ami[_0x79fe('0x1d')]()==![]){return _0x5490ff(_0x256035[_0x79fe('0x11')](0x1f4,[config[_0x79fe('0x12')]['ip'],config[_0x79fe('0x12')][_0x79fe('0x13')],_0x79fe('0x14')][_0x79fe('0x15')]('\x20')));}var _0x24c6ad=schema(properties[_0x79fe('0x70')])[_0x79fe('0x2')](_0x18262c);if(_0x24c6ad['length']>0x0){return _0x5490ff(_0x256035[_0x79fe('0x11')](0x1f4,_['map'](_0x24c6ad,_0x79fe('0x1b'))['join'](',\x20')));}var _0x38cb89=_[_0x79fe('0x55')](_0x627ec4[_0x79fe('0x6e')],{'uniqueid':_0x18262c[_0x79fe('0x59')]});if(_0x38cb89&&_0x38cb89[_0x79fe('0x5a')]){return ami['Action']({'action':_0x79fe('0x71'),'channel':_0x38cb89[_0x79fe('0x5a')],'exten':_0x18262c[_0x79fe('0x72')],'context':_0x18262c[_0x79fe('0x73')]||_0x38cb89['context'],'priority':0x1})[_0x79fe('0x1a')](function(_0x4c25b1){_0x1b370f({'code':0xc8,'message':[_0x18262c[_0x79fe('0x59')],_0x4c25b1[_0x79fe('0x1b')][_0x79fe('0x60')]()][_0x79fe('0x15')]('\x20')});})[_0x79fe('0x1c')](function(_0x55e65a){_0x5490ff(_0x256035[_0x79fe('0x11')](0x1f5,[_0x18262c['uniqueid'],_0x55e65a[_0x79fe('0x1b')][_0x79fe('0x60')]()]['join']('\x20')));});}else{return _0x5490ff(_0x256035[_0x79fe('0x11')](0x1f5,_0x79fe('0x6c')));}});},'Agents':function(_0x19c444){return new Promise(function(_0x3aa36b,_0x40392a){var _0x41bb50=_['values'](_0x627ec4['agents']);_0x3aa36b({'count':_0x41bb50[_0x79fe('0x54')],'rows':_0x41bb50});});},'Telephones':function(_0x141661){return new Promise(function(_0x1034a5,_0x550501){var _0xfde41e=_[_0x79fe('0x57')](_0x627ec4[_0x79fe('0x74')]);_0x1034a5({'count':_0xfde41e[_0x79fe('0x54')],'rows':_0xfde41e});});},'Trunks':function(_0x285e73){return new Promise(function(_0x4ccda7,_0x3fbb0e){var _0xfb2ee6=_[_0x79fe('0x57')](_0x627ec4['trunks']);_0x4ccda7({'count':_0xfb2ee6[_0x79fe('0x54')],'rows':_0xfb2ee6});});},'OutboundChannels':function(_0x187a5a){return new Promise(function(_0x3362a6,_0x175ee6){var _0x5c00c6=_[_0x79fe('0x57')](_0x627ec4[_0x79fe('0x75')]);_0x3362a6({'count':_0x5c00c6['length'],'rows':_0x5c00c6});});},'Outbound':function(_0x40a2ba){return new Promise(function(_0x125940,_0x227a97){_0x125940(_0x627ec4[_0x79fe('0x76')]);});},'Campaigns':function(_0x4887c4){return new Promise(function(_0x56c8d2,_0x345c7f){var _0x3ad4b7=_['values'](_0x627ec4['campaigns']);_0x56c8d2({'count':_0x3ad4b7['length'],'rows':_0x3ad4b7});});},'VoiceQueuesPreview':function(_0x381d08){var _0x309ef2=this;return new Promise(function(_0xd783c9,_0x32aae7){_0x14e975[_0x79fe('0x77')](_0x381d08['id'])['then'](function(_0x3521ff){_0xd783c9({'code':0xc8,'message':_0x3521ff[_0x79fe('0x1b')]});})['catch'](function(_0x39d0a7){_0x32aae7(_0x309ef2['error'](0x1f4,_0x39d0a7['message']));});});},'EventManager':function(_0x4662f8){var _0x359773=this;return new Promise(function(_0x13cf1a,_0x2fe027){if(!_0x4662f8[_0x79fe('0x78')]){return _0x2fe027(_0x359773[_0x79fe('0x11')](0x1f4,_0x79fe('0x79')));}ami[_0x79fe('0x7a')](_0x79fe('0x7b')+_0x4662f8[_0x79fe('0x78')],_0x4662f8[_0x79fe('0x1b')]);_0x13cf1a({'code':0xc8,'message':_0x4662f8});});},'FaxAccounts':function(_0x57a104){return new Promise(function(_0x56eff3,_0x245b77){var _0x1562da=_[_0x79fe('0x57')](_0x627ec4[_0x79fe('0x7c')]);_0x56eff3({'count':_0x1562da[_0x79fe('0x54')],'rows':_0x1562da});});},'SendFax':function(_0x2beaf4){var _0x3e910e=this;return new Promise(function(_0x3390b2,_0x5ce655){_0x4af9f6[_0x79fe('0x7d')](_0x2beaf4)[_0x79fe('0x1a')](function(_0x25ce8d){_0x3390b2({'code':0xc8,'message':_0x25ce8d[_0x79fe('0x1b')]});})['catch'](function(_0xfcbd13){_0x5ce655(_0x3e910e['error'](0x1f4,_0xfcbd13[_0x79fe('0x1b')]));});});},'CheckAfterSend':function(_0x482d04){var _0x46151b=this;return new Promise(function(_0x44b212,_0x1d0b25){_0x4af9f6[_0x79fe('0x7e')](_0x482d04)[_0x79fe('0x1a')](function(_0x37d301){_0x44b212({'code':0xc8,'message':_0x37d301['message']});})['catch'](function(_0x2837b7){_0x1d0b25(_0x46151b[_0x79fe('0x11')](0x1f4,_0x2837b7[_0x79fe('0x1b')]));});});}};var _0x182e01=jayson[_0x79fe('0x7f')](_0x2ba246)['http']();_0x182e01['on'](_0x79fe('0x11'),function(_0x4e6725){return _0x2a5aef(_0x4e6725);});_0x182e01['listen'](0x232a,_0x79fe('0x80'),function(){console['log'](_0x79fe('0x81'),0x232a);return _0x3cec9c(_0x79fe('0x82')+0x232a);});});}; \ No newline at end of file +var _0xae30=['Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','find','undefined','channels','length','voicechannel','validate','map','uniqueid','channel','filename','wav','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','listen','format','%s/%s','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','action','Reload'];(function(_0x3b59a2,_0x2403f5){var _0x11d540=function(_0x2c57e3){while(--_0x2c57e3){_0x3b59a2['push'](_0x3b59a2['shift']());}};_0x11d540(++_0x2403f5);}(_0xae30,0x10a));var _0x0ae3=function(_0x472ded,_0x7b9b67){_0x472ded=_0x472ded-0x0;var _0x4cdf81=_0xae30[_0x472ded];return _0x4cdf81;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var jayson=require(_0x0ae3('0x2'));var schema=require('validate');var BPromise=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var config=require(_0x0ae3('0x5'));var properties=require(_0x0ae3('0x6'));var ami=require('../ami');exports[_0x0ae3('0x7')]=function(_0xcf497c,_0x38fce8,_0x7ce33e){return new BPromise(function(_0x2b8c53,_0xda3853){var _0x2b81f4={'QueuePause':function(_0x15b7e2){return new Promise(function(_0x32ea6e,_0x34e783){var _0x1bae69=util[_0x0ae3('0x8')](_0x0ae3('0x9'),'SIP',_0x15b7e2[_0x0ae3('0xa')]);if(_0xcf497c[_0x0ae3('0xb')]&&_0xcf497c['timers'][_0x1bae69]&&_0xcf497c['timers'][_0x1bae69][_0x0ae3('0xc')]){_0xcf497c[_0x0ae3('0xb')][_0x1bae69][_0x0ae3('0xd')]();}if(_0xcf497c[_0x0ae3('0xe')][_0x1bae69]){_0xcf497c['agents'][_0x1bae69]['updateStatusRealtime']({'statePause':_0x15b7e2[_0x0ae3('0xf')]?!![]:![]});}_0x32ea6e({'code':0xc8,'message':_0x0ae3('0x10')});});},'Reload':function(_0x50cee6){var _0x588a65=this;return new Promise(function(_0xa33411,_0x4993c5){if(ami[_0x0ae3('0x11')]()==![]){return _0x4993c5(_0x588a65[_0x0ae3('0x12')](0x1f4,[config[_0x0ae3('0x13')]['ip'],config[_0x0ae3('0x13')][_0x0ae3('0x14')],_0x0ae3('0x15')][_0x0ae3('0x16')]('\x20')));}_0x50cee6=_['pick'](_0x50cee6,_[_0x0ae3('0x17')](properties['module']));_0x50cee6[_0x0ae3('0x18')]=_0x0ae3('0x19');return ami[_0x0ae3('0x1a')](_0x50cee6)[_0x0ae3('0x1b')](function(_0x3fd4be){_0xa33411({'code':0xc8,'message':_0x3fd4be[_0x0ae3('0x1c')]});})[_0x0ae3('0x1d')](function(_0x1bf406){_0x4993c5(_0x588a65[_0x0ae3('0x12')](0x1f5,_0x1bf406['message']));});});},'Command':function(_0x6084a0){var _0x4b8949=this;return new Promise(function(_0x49d4b7,_0x571135){if(ami['isConnected']()==![]){return _0x571135(_0x4b8949['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x0ae3('0x14')],_0x0ae3('0x15')][_0x0ae3('0x16')]('\x20')));}_0x6084a0=_['pick'](_0x6084a0,_0x0ae3('0x1e'));_0x6084a0['action']=_0x0ae3('0x1f');return ami['Action'](_0x6084a0)['then'](function(_0x5ab18d){_0x49d4b7({'code':0xc8,'message':_0x5ab18d[_0x0ae3('0x20')]});})[_0x0ae3('0x1d')](function(_0x51e7d1){_0x571135(_0x4b8949['error'](0x1f5,_0x51e7d1['message']));});});},'VoiceQueues':function(_0x3178a4){return new Promise(function(_0x2c5fa0,_0x5a76e5){var _0x36ce4e=[];for(var _0x1613c3 in _0xcf497c[_0x0ae3('0x21')]){if(_0xcf497c['voiceQueues'][_0x0ae3('0x22')](_0x1613c3)){var _0x1f9cde=_0xcf497c[_0x0ae3('0x21')][_0x1613c3];var _0x5303f6={'id':_0x1f9cde['id'],'name':_0x1f9cde[_0x0ae3('0xa')],'strategy':_0x1f9cde[_0x0ae3('0x23')],'answered':_0x1f9cde[_0x0ae3('0x24')],'available':_0x1f9cde['available'],'loggedIn':_0x1f9cde[_0x0ae3('0x25')],'pTalking':_0x1f9cde[_0x0ae3('0x26')],'sumBillable':_0x1f9cde[_0x0ae3('0x27')],'sumDuration':_0x1f9cde[_0x0ae3('0x28')],'sumHoldTime':_0x1f9cde[_0x0ae3('0x29')]||0x0,'talking':_0x1f9cde[_0x0ae3('0x2a')],'total':_0x1f9cde[_0x0ae3('0x2b')],'type':_0x1f9cde[_0x0ae3('0x2c')],'unmanaged':_0x1f9cde[_0x0ae3('0x2d')],'abandoned':_0x1f9cde[_0x0ae3('0x2e')],'waiting':_0x1f9cde[_0x0ae3('0x2f')],'loggedInDb':_0x1f9cde[_0x0ae3('0x30')]};if(_0x1f9cde[_0x0ae3('0x2c')]===_0x0ae3('0x31')){_0x5303f6[_0x0ae3('0x32')]=_0x1f9cde['dialActive'];_0x5303f6[_0x0ae3('0x33')]=_0x1f9cde[_0x0ae3('0x33')];_0x5303f6[_0x0ae3('0x34')]=_0x1f9cde[_0x0ae3('0x34')];_0x5303f6['dialOriginateCallerIdNumber']=_0x1f9cde[_0x0ae3('0x35')];_0x5303f6[_0x0ae3('0x36')]=_0x1f9cde[_0x0ae3('0x36')];_0x5303f6[_0x0ae3('0x37')]=_0x1f9cde[_0x0ae3('0x37')];_0x5303f6[_0x0ae3('0x38')]=_0x1f9cde['temp'];_0x5303f6[_0x0ae3('0x39')]=_0x1f9cde[_0x0ae3('0x39')];_0x5303f6[_0x0ae3('0x3a')]=_0x1f9cde[_0x0ae3('0x3a')];_0x5303f6[_0x0ae3('0x3b')]=_0x1f9cde[_0x0ae3('0x3b')];_0x5303f6[_0x0ae3('0x3c')]=_0x1f9cde['outboundBusyCallsDay'];_0x5303f6['outboundCongestionCallsDay']=_0x1f9cde[_0x0ae3('0x3d')];_0x5303f6[_0x0ae3('0x3e')]=_0x1f9cde[_0x0ae3('0x3e')];_0x5303f6['outboundDropCallsDayCallersExit']=_0x1f9cde['outboundDropCallsDayCallersExit'];_0x5303f6[_0x0ae3('0x3f')]=_0x1f9cde[_0x0ae3('0x3f')];_0x5303f6[_0x0ae3('0x40')]=_0x1f9cde[_0x0ae3('0x40')];_0x5303f6[_0x0ae3('0x41')]=_0x1f9cde[_0x0ae3('0x41')];_0x5303f6[_0x0ae3('0x42')]=_0x1f9cde['outboundOriginateFailureCallsDay'];_0x5303f6[_0x0ae3('0x43')]=_0x1f9cde[_0x0ae3('0x43')];_0x5303f6[_0x0ae3('0x44')]=_0x1f9cde['outboundRejectCallsDay'];_0x5303f6['outboundUnknownCallsDay']=_0x1f9cde['outboundUnknownCallsDay'];_0x5303f6[_0x0ae3('0x45')]=_0x1f9cde[_0x0ae3('0x45')];_0x5303f6['predictiveIntervalAvgHoldtime']=_0x1f9cde[_0x0ae3('0x46')];_0x5303f6[_0x0ae3('0x47')]=_0x1f9cde[_0x0ae3('0x47')];_0x5303f6['predictiveIntervalDroppedCallsCallersExit']=_0x1f9cde[_0x0ae3('0x48')];_0x5303f6['predictiveIntervalDroppedCallsTimeout']=_0x1f9cde[_0x0ae3('0x49')];_0x5303f6[_0x0ae3('0x4a')]=_0x1f9cde['predictiveIntervalErlangCalls'];_0x5303f6[_0x0ae3('0x4b')]=_0x1f9cde[_0x0ae3('0x4b')];_0x5303f6[_0x0ae3('0x4c')]=_0x1f9cde[_0x0ae3('0x4c')];_0x5303f6[_0x0ae3('0x4d')]=_0x1f9cde['predictiveIntervalMultiplicativeFactor'];_0x5303f6['predictiveIntervalPauses']=_0x1f9cde[_0x0ae3('0x4e')];_0x5303f6[_0x0ae3('0x4f')]=_0x1f9cde['predictiveIntervalAvailable'];_0x5303f6['predictiveIntervalTotalCalls']=_0x1f9cde['predictiveIntervalTotalCalls'];_0x5303f6['message']=_0x1f9cde[_0x0ae3('0x1c')];_0x5303f6[_0x0ae3('0x50')]=_0x1f9cde[_0x0ae3('0x50')];_0x5303f6[_0x0ae3('0x51')]=_0x1f9cde[_0x0ae3('0x51')];_0x5303f6[_0x0ae3('0x52')]=_0x1f9cde[_0x0ae3('0x52')];_0x5303f6[_0x0ae3('0x53')]=_0x1f9cde[_0x0ae3('0x53')];_0x5303f6[_0x0ae3('0x54')]=_0x1f9cde['erlangBusyFactor'];_0x5303f6[_0x0ae3('0x55')]=_0x1f9cde[_0x0ae3('0x55')];_0x5303f6['startProgressive']=_0x1f9cde[_0x0ae3('0x56')];}if(_0x1f9cde[_0x0ae3('0x57')]){_0x5303f6[_0x0ae3('0x57')]={'id':_0x1f9cde[_0x0ae3('0x57')]['id'],'name':_0x1f9cde[_0x0ae3('0x57')]['name'],'active':_0x1f9cde[_0x0ae3('0x57')][_0x0ae3('0x58')],'callerid':_0x1f9cde[_0x0ae3('0x57')][_0x0ae3('0x59')]};}if(_0x1f9cde['Interval']){_0x5303f6[_0x0ae3('0x5a')]={'id':_0x1f9cde[_0x0ae3('0x5a')]['id'],'name':_0x1f9cde['Interval'][_0x0ae3('0xa')]};}_0x36ce4e[_0x0ae3('0x5b')](_0x5303f6);}}_0x2c5fa0({'count':_0x36ce4e['length'],'rows':_0x36ce4e});});},'UpdateVoiceQueue':function(_0x57d667){return new Promise(function(_0x54f628,_0x21b49f){var _0x6c24d4=_[_0x0ae3('0x5c')](_0xcf497c[_0x0ae3('0x21')],{'id':parseInt(_0x57d667['id'])});var _0x4c88fa=_['omit'](_0x57d667,['id']);if(_0x6c24d4){for(var _0xc23bb0 in _0x4c88fa){if(typeof _0x4c88fa[_0xc23bb0]!=='undefined'&&typeof _0x6c24d4[_0xc23bb0]!==_0x0ae3('0x5d')){_0x6c24d4[_0xc23bb0]=_0x4c88fa[_0xc23bb0];}}_0x54f628(_0x6c24d4);}else{_0x21b49f();}});},'VoiceChannels':function(_0x1829fa){return new Promise(function(_0x5388cf,_0x29e158){var _0x3e4bfb=_['values'](_0xcf497c[_0x0ae3('0x5e')]);_0x5388cf({'count':_0x3e4bfb[_0x0ae3('0x5f')],'rows':_0x3e4bfb});});},'VoiceChannelMixMonitor':function(_0x310956){var _0x9717b=this;return new Promise(function(_0x21853f,_0x48b52c){if(ami[_0x0ae3('0x11')]()==![]){return _0x48b52c(_0x9717b['error'](0x1f4,[config[_0x0ae3('0x13')]['ip'],config[_0x0ae3('0x13')][_0x0ae3('0x14')],_0x0ae3('0x15')][_0x0ae3('0x16')]('\x20')));}var _0x2879b8=schema(properties[_0x0ae3('0x60')])[_0x0ae3('0x61')](_0x310956);if(_0x2879b8['length']>0x0){return _0x48b52c(_0x9717b[_0x0ae3('0x12')](0x1f4,_[_0x0ae3('0x62')](_0x2879b8,_0x0ae3('0x1c'))[_0x0ae3('0x16')](',\x20')));}var _0x28e496=_[_0x0ae3('0x5c')](_0xcf497c[_0x0ae3('0x5e')],{'uniqueid':_0x310956[_0x0ae3('0x63')]});if(_0x28e496&&_0x28e496[_0x0ae3('0x64')]){var _0x21c86e=util[_0x0ae3('0x8')]('%s.%s',_0x310956[_0x0ae3('0x65')]||_0x310956['uniqueid'],_0x310956[_0x0ae3('0x8')]||_0x0ae3('0x66'));return ami[_0x0ae3('0x1a')]({'action':'MixMonitor','channel':_0x28e496['channel'],'file':_0x21c86e,'options':_0x0ae3('0x67')})['then'](function(_0x46910f){var _0x5b1543=_[_0x0ae3('0x5c')](_0x28e496[_0x0ae3('0x68')],{'filename':'/var/spool/asterisk/monitor/'+_0x21c86e[_0x0ae3('0x69')]()});if(_[_0x0ae3('0x6a')](_0x5b1543)){_0x28e496[_0x0ae3('0x68')][_0x0ae3('0x5b')]({'filename':_0x0ae3('0x6b')+_0x21c86e['toLowerCase'](),'createdAt':moment()[_0x0ae3('0x8')](_0x0ae3('0x6c')),'mixmonitorid':_0x46910f['mixmonitorid'],'status':_0x0ae3('0x6d')});}else{_0x5b1543[_0x0ae3('0x6e')]=_0x46910f['mixmonitorid'];_0x5b1543[_0x0ae3('0x6f')]=_0x0ae3('0x6d');}_0x21853f({'code':0xc8,'message':[_0x310956[_0x0ae3('0x63')],_0x0ae3('0x70'),_0x46910f[_0x0ae3('0x6e')]]['join']('\x20'),'mixmonitorid':_0x46910f[_0x0ae3('0x6e')]});})[_0x0ae3('0x1d')](function(_0x297280){_0x48b52c(_0x9717b[_0x0ae3('0x12')](0x1f5,[_0x310956[_0x0ae3('0x63')],_0x297280[_0x0ae3('0x1c')][_0x0ae3('0x69')]()]['join']('\x20')));});}else{return _0x48b52c(_0x9717b[_0x0ae3('0x12')](0x1f5,_0x0ae3('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0xe32ce8){var _0x57503a=this;return new Promise(function(_0x3a99c3,_0x431c29){if(ami[_0x0ae3('0x11')]()==![]){return _0x431c29(_0x57503a[_0x0ae3('0x12')](0x1f4,[config[_0x0ae3('0x13')]['ip'],config[_0x0ae3('0x13')][_0x0ae3('0x14')],'ami\x20disconnected'][_0x0ae3('0x16')]('\x20')));}var _0x4fee8e=schema(properties['voicechannel'])['validate'](_0xe32ce8);if(_0x4fee8e[_0x0ae3('0x5f')]>0x0){return _0x431c29(_0x57503a[_0x0ae3('0x12')](0x1f4,_[_0x0ae3('0x62')](_0x4fee8e,_0x0ae3('0x1c'))[_0x0ae3('0x16')](',\x20')));}var _0x3fa612=_['find'](_0xcf497c[_0x0ae3('0x5e')],{'uniqueid':_0xe32ce8[_0x0ae3('0x63')]});if(_0x3fa612){return BPromise[_0x0ae3('0x72')]()[_0x0ae3('0x1b')](function(){if(_0x3fa612[_0x0ae3('0x64')]){return ami['Action']({'action':_0x0ae3('0x73'),'channel':_0x3fa612[_0x0ae3('0x64')],'mixmonitorid':_0xe32ce8[_0x0ae3('0x6e')]})[_0x0ae3('0x1d')](function(_0x46d905){});}})[_0x0ae3('0x1b')](function(){if(_0x3fa612['destinationchannel']){return ami['Action']({'action':'StopMixMonitor','channel':_0x3fa612[_0x0ae3('0x74')],'mixmonitorid':_0xe32ce8[_0x0ae3('0x6e')]})[_0x0ae3('0x1d')](function(_0x35402b){});}})['then'](function(_0x2f80f2){var _0x3e8ae7=_[_0x0ae3('0x5c')](_0x3fa612[_0x0ae3('0x68')],{'mixmonitorid':_0xe32ce8[_0x0ae3('0x6e')]});if(_0x3e8ae7){_0x3e8ae7[_0x0ae3('0x6f')]=_0x0ae3('0x75');}})[_0x0ae3('0x1b')](function(){var _0x3c55bd=util[_0x0ae3('0x8')](_0x0ae3('0x76'),_0xe32ce8[_0x0ae3('0x65')]||_0xe32ce8[_0x0ae3('0x63')],_0xe32ce8['format']||_0x0ae3('0x66'));var _0x30b74b=_[_0x0ae3('0x5c')](_0x3fa612[_0x0ae3('0x68')],{'filename':_0x0ae3('0x6b')+_0x3c55bd['toLowerCase']()});if(_0x30b74b){_0x30b74b[_0x0ae3('0x6f')]=_0x0ae3('0x75');}})[_0x0ae3('0x1b')](function(){_0x3a99c3({'code':0xc8,'message':[_0xe32ce8['uniqueid'],_0x0ae3('0x77')][_0x0ae3('0x16')]('\x20')});})[_0x0ae3('0x1d')](function(_0x5427b5){_0x431c29(_0x57503a['error'](0x1f5,[_0xe32ce8[_0x0ae3('0x63')],_0x5427b5[_0x0ae3('0x1c')][_0x0ae3('0x69')]()]['join']('\x20')));});}else{return _0x431c29(_0x57503a['error'](0x1f5,_0x0ae3('0x71')));}});},'VoiceQueuesChannels':function(_0x5fd458){return new Promise(function(_0x1c40f9,_0x5b6a6a){var _0xf669ae=_['values'](_0xcf497c[_0x0ae3('0x78')]);_0x1c40f9({'count':_0xf669ae[_0x0ae3('0x5f')],'rows':_0xf669ae});});},'VoiceQueuesChannel':function(_0x58e738){var _0x70df70=this;return new Promise(function(_0xa767aa,_0x45fa16){var _0x2f82be=schema(properties[_0x0ae3('0x79')])[_0x0ae3('0x61')](_0x58e738);if(_0x2f82be[_0x0ae3('0x5f')]>0x0){return _0x45fa16(_0x70df70[_0x0ae3('0x12')](0x1f4,_['map'](_0x2f82be,_0x0ae3('0x1c'))[_0x0ae3('0x16')](',\x20')));}var _0x51f0c2=_[_0x0ae3('0x5c')](_0xcf497c[_0x0ae3('0x78')],{'uniqueid':_0x58e738[_0x0ae3('0x63')]});if(_0x51f0c2){_0xa767aa(_0x51f0c2);}else{return _0x45fa16(_0x70df70[_0x0ae3('0x12')](0x1f5,_0x0ae3('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x5dc6d1){var _0x7648ce=this;return new Promise(function(_0x24db7f,_0x30ceec){if(ami[_0x0ae3('0x11')]()==![]){return _0x30ceec(_0x7648ce['error'](0x1f4,[config[_0x0ae3('0x13')]['ip'],config[_0x0ae3('0x13')][_0x0ae3('0x14')],_0x0ae3('0x15')][_0x0ae3('0x16')]('\x20')));}var _0x54eed9=schema(properties[_0x0ae3('0x7a')])['validate'](_0x5dc6d1);if(_0x54eed9['length']>0x0){return _0x30ceec(_0x7648ce[_0x0ae3('0x12')](0x1f4,_[_0x0ae3('0x62')](_0x54eed9,_0x0ae3('0x1c'))[_0x0ae3('0x16')](',\x20')));}var _0x2c28d5=_['find'](_0xcf497c[_0x0ae3('0x78')],{'uniqueid':_0x5dc6d1[_0x0ae3('0x63')]});if(_0x2c28d5&&_0x2c28d5[_0x0ae3('0x64')]){return ami[_0x0ae3('0x1a')]({'action':_0x0ae3('0x7b'),'channel':_0x2c28d5[_0x0ae3('0x64')]})[_0x0ae3('0x1b')](function(_0x203507){_0x24db7f({'code':0xc8,'message':[_0x5dc6d1[_0x0ae3('0x63')],_0x203507[_0x0ae3('0x1c')][_0x0ae3('0x69')]()][_0x0ae3('0x16')]('\x20')});})[_0x0ae3('0x1d')](function(_0x573f3f){_0x30ceec(_0x7648ce[_0x0ae3('0x12')](0x1f5,[_0x5dc6d1[_0x0ae3('0x63')],_0x573f3f[_0x0ae3('0x1c')]['toLowerCase']()][_0x0ae3('0x16')]('\x20')));});}else{return _0x30ceec(_0x7648ce[_0x0ae3('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2f2cb9){var _0x5d200a=this;return new Promise(function(_0x52734e,_0x2b80ef){if(ami[_0x0ae3('0x11')]()==![]){return _0x2b80ef(_0x5d200a[_0x0ae3('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x0ae3('0x13')][_0x0ae3('0x14')],_0x0ae3('0x15')]['join']('\x20')));}var _0x4a7d25=schema(properties[_0x0ae3('0x7c')])['validate'](_0x2f2cb9);if(_0x4a7d25['length']>0x0){return _0x2b80ef(_0x5d200a[_0x0ae3('0x12')](0x1f4,_[_0x0ae3('0x62')](_0x4a7d25,'message')[_0x0ae3('0x16')](',\x20')));}var _0x7b5612=_[_0x0ae3('0x5c')](_0xcf497c[_0x0ae3('0x78')],{'uniqueid':_0x2f2cb9[_0x0ae3('0x63')]});if(_0x7b5612&&_0x7b5612[_0x0ae3('0x64')]){return ami[_0x0ae3('0x1a')]({'action':_0x0ae3('0x7d'),'channel':_0x7b5612[_0x0ae3('0x64')],'exten':_0x2f2cb9[_0x0ae3('0x7e')],'context':_0x2f2cb9[_0x0ae3('0x7f')]||_0x7b5612['context'],'priority':0x1})[_0x0ae3('0x1b')](function(_0x4c5a53){_0x52734e({'code':0xc8,'message':[_0x2f2cb9[_0x0ae3('0x63')],_0x4c5a53[_0x0ae3('0x1c')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x112a38){_0x2b80ef(_0x5d200a['error'](0x1f5,[_0x2f2cb9[_0x0ae3('0x63')],_0x112a38[_0x0ae3('0x1c')]['toLowerCase']()][_0x0ae3('0x16')]('\x20')));});}else{return _0x2b80ef(_0x5d200a[_0x0ae3('0x12')](0x1f5,_0x0ae3('0x71')));}});},'Agents':function(_0x984e6d){return new Promise(function(_0xe082aa,_0x6c3a5e){var _0x2fd22e=_['values'](_0xcf497c[_0x0ae3('0xe')]);_0xe082aa({'count':_0x2fd22e[_0x0ae3('0x5f')],'rows':_0x2fd22e});});},'Telephones':function(_0x5830b9){return new Promise(function(_0x45b1c3,_0x312e50){var _0x2b7476=_[_0x0ae3('0x80')](_0xcf497c[_0x0ae3('0x81')]);_0x45b1c3({'count':_0x2b7476[_0x0ae3('0x5f')],'rows':_0x2b7476});});},'Trunks':function(_0x3bb7d7){return new Promise(function(_0x515a8a,_0x511997){var _0x1578f5=_[_0x0ae3('0x80')](_0xcf497c[_0x0ae3('0x82')]);_0x515a8a({'count':_0x1578f5[_0x0ae3('0x5f')],'rows':_0x1578f5});});},'OutboundChannels':function(_0x2f1501){return new Promise(function(_0x62db9,_0x22bb41){var _0x1f7791=_[_0x0ae3('0x80')](_0xcf497c[_0x0ae3('0x83')]);_0x62db9({'count':_0x1f7791[_0x0ae3('0x5f')],'rows':_0x1f7791});});},'Outbound':function(_0x32c76f){return new Promise(function(_0x5d0ab7,_0x39f58a){_0x5d0ab7(_0xcf497c[_0x0ae3('0x31')]);});},'Campaigns':function(_0x2f22e0){return new Promise(function(_0x41a1f4,_0x1254db){var _0x21ae82=_[_0x0ae3('0x80')](_0xcf497c[_0x0ae3('0x84')]);_0x41a1f4({'count':_0x21ae82[_0x0ae3('0x5f')],'rows':_0x21ae82});});},'VoiceQueuesPreview':function(_0x58c78a){var _0x48a879=this;return new Promise(function(_0x18eab7,_0x73844){_0x38fce8[_0x0ae3('0x85')](_0x58c78a['id'])[_0x0ae3('0x1b')](function(_0x208481){_0x18eab7({'code':0xc8,'message':_0x208481[_0x0ae3('0x1c')]});})[_0x0ae3('0x1d')](function(_0x6ba898){_0x73844(_0x48a879[_0x0ae3('0x12')](0x1f4,_0x6ba898[_0x0ae3('0x1c')]));});});},'EventManager':function(_0x58c975){var _0x43be2b=this;return new Promise(function(_0x285509,_0x5a3536){if(!_0x58c975[_0x0ae3('0x86')]){return _0x5a3536(_0x43be2b[_0x0ae3('0x12')](0x1f4,_0x0ae3('0x87')));}ami[_0x0ae3('0x88')](_0x0ae3('0x89')+_0x58c975[_0x0ae3('0x86')],_0x58c975[_0x0ae3('0x1c')]);_0x285509({'code':0xc8,'message':_0x58c975});});},'FaxAccounts':function(_0x31c5e4){return new Promise(function(_0x85b38,_0x3f1ff8){var _0x599f09=_[_0x0ae3('0x80')](_0xcf497c[_0x0ae3('0x8a')]);_0x85b38({'count':_0x599f09[_0x0ae3('0x5f')],'rows':_0x599f09});});},'SendFax':function(_0x5f3b39){var _0x238925=this;return new Promise(function(_0x4de9c1,_0xe3d114){_0x7ce33e[_0x0ae3('0x8b')](_0x5f3b39)['then'](function(_0x316f50){_0x4de9c1({'code':0xc8,'message':_0x316f50['message']});})[_0x0ae3('0x1d')](function(_0x40c8ed){_0xe3d114(_0x238925[_0x0ae3('0x12')](0x1f4,_0x40c8ed[_0x0ae3('0x1c')]));});});},'CheckAfterSend':function(_0x132fdb){var _0x43e6e6=this;return new Promise(function(_0x1376dc,_0x501d9e){_0x7ce33e['checkAfterSend'](_0x132fdb)[_0x0ae3('0x1b')](function(_0x2f53ef){_0x1376dc({'code':0xc8,'message':_0x2f53ef[_0x0ae3('0x1c')]});})[_0x0ae3('0x1d')](function(_0x460354){_0x501d9e(_0x43e6e6[_0x0ae3('0x12')](0x1f4,_0x460354['message']));});});}};var _0x47f8a0=jayson[_0x0ae3('0x8c')](_0x2b81f4)[_0x0ae3('0x8d')]();_0x47f8a0['on']('error',function(_0x43cd29){return _0xda3853(_0x43cd29);});_0x47f8a0[_0x0ae3('0x7')](0x232a,_0x0ae3('0x8e'),function(){console[_0x0ae3('0x8f')](_0x0ae3('0x90'),0x232a);return _0x2b8c53(_0x0ae3('0x91')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 7feca6e..828a752 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 _0xe14d=['xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xe14d,0x1ee));var _0xde14=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xe14d[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xde14('0x0'));var BPromise=require(_0xde14('0x1'));var Redis=require(_0xde14('0x2'));var util=require(_0xde14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xde14('0x4'))(_0xde14('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xde14('0x6')]=_[_0xde14('0x7')](config[_0xde14('0x6')],{'host':_0xde14('0x8'),'port':0x18eb});var io=require(_0xde14('0x9'))(new Redis(config[_0xde14('0x6')]));function emit(_0x4b1f6b,_0x5a1344,_0x1bd49d,_0x115b7d,_0x2b0e7c){logger[_0xde14('0xa')](_0xde14('0xb'),_0x4b1f6b,_0x5a1344['id'],_0x1bd49d,_0x115b7d,JSON[_0xde14('0xc')](_0x2b0e7c));io['to'](_0x1bd49d)[_0xde14('0xd')](_0x115b7d,_0x2b0e7c);}exports[_0xde14('0xe')]=function(_0x4b2b15,_0x1a7167,_0xe785fb,_0x417269){var _0x4357c7,_0x8e0e;var _0x30a4c4={};var _0x1a1c32=Number(_0xe785fb[_0xde14('0xf')]);var _0x34e28f=_0xe785fb[_0xde14('0x10')]?Boolean(Number(_0xe785fb[_0xde14('0x10')])):![];var _0x464624;var _0x3521d4=![];if(!_[_0xde14('0x11')](_0xe785fb[_0xde14('0x12')])){if(_0xe785fb['data5']=='1')_0x3521d4=!![];}if(!_0x3521d4){if(_0x417269['xmd-contactid']){_0x30a4c4['id']=_0x417269[_0xde14('0x13')];}}if(!_0x30a4c4['id']){_0x30a4c4[_0xde14('0x14')]=_0x1a1c32;_0x464624=_0xe785fb[_0xde14('0x15')]&&_0xe785fb['data3']!=='0'?_0xe785fb[_0xde14('0x15')][_0xde14('0x16')](','):[_0xde14('0x17')];_0x30a4c4[_0xde14('0x18')]=_[_0xde14('0x19')](_0x464624,function(_0x1b9d4b){var _0x29e243={};_0x29e243[_0x1b9d4b]=_0x417269[_0xde14('0x1a')]?_0x417269[_0xde14('0x1b')]:_0x417269[_0xde14('0x1c')];return _0x29e243;});}var _0x590a8b=['id',_0xde14('0x1d'),_0xde14('0x1e'),_0xde14('0x17'),_0xde14('0x1f'),'fax',_0xde14('0x14'),'createdAt',_0xde14('0x20'),'updatedAt'];var _0xa50687=_[_0xde14('0x21')](_0x590a8b,_0x464624);BPromise[_0xde14('0x22')]()[_0xde14('0x23')](cmContactRpc[_0xde14('0x24')]({'attributes':_0xa50687,'where':_0x30a4c4}))[_0xde14('0x23')](function(_0x40b648){_0x8e0e=_0x40b648;if(!_[_0xde14('0x25')](_0x8e0e)){if(_0x8e0e[_0xde14('0x26')]===0x1){_0x4357c7=_0x8e0e[0x0];logger[_0xde14('0xa')](_0xde14('0x27'),_0x417269[_0xde14('0x28')],_0x1a7167['id'],_0x4357c7['id']);}else{logger[_0xde14('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x417269[_0xde14('0x28')],_0x1a7167['id'],_[_0xde14('0x19')](_0x8e0e,'id')[_0xde14('0x29')](','));}return;}else{logger[_0xde14('0xa')](_0xde14('0x2a'),_0x417269[_0xde14('0x28')],_0x1a7167['id']);var _0x310d75={'ListId':_0x1a1c32};var _0x23c735=_0xe785fb[_0xde14('0x2b')]&&_0xe785fb[_0xde14('0x2b')]!=='0'?_0xe785fb['data4']:_0xde14('0x17');if(_0x34e28f){logger[_0xde14('0xa')](_0xde14('0x2c'),_0x417269[_0xde14('0x28')],_0x1a7167['id']);_0x310d75[_0x23c735]=_['isNil'](_0x417269[_0xde14('0x1a')])?_0x417269[_0xde14('0x1c')]:_0x417269[_0xde14('0x1b')];if(_['isNil'](_0x417269[_0xde14('0x1a')])){_0x310d75['firstName']=_0x417269[_0xde14('0x2d')]&&_0x417269[_0xde14('0x2d')]!==_0xde14('0x2e')?_0x417269[_0xde14('0x2d')]:_0xde14('0x2f');}else{_0x310d75[_0xde14('0x1d')]=_0x417269[_0xde14('0x30')]&&_0x417269[_0xde14('0x30')]!==''?_0x417269[_0xde14('0x30')]:_0xde14('0x2f');}return BPromise['resolve']()[_0xde14('0x23')](cmContactRpc['createContact'](_0x310d75))[_0xde14('0x23')](function(_0x44e88a){_0x4357c7=_0x44e88a;_0x8e0e[_0xde14('0x31')](_0x44e88a);if(_0x4357c7){logger[_0xde14('0xa')](_0xde14('0x32'),_0x417269['uniqueid'],_0x1a7167['id'],_0x4357c7['id']);}return;});}else{logger[_0xde14('0xa')](_0xde14('0x33'),_0x417269['uniqueid'],_0x1a7167['id']);_0x310d75[_0x23c735]=_[_0xde14('0x11')](_0x417269[_0xde14('0x1a')])?_0x417269[_0xde14('0x1c')]:_0x417269[_0xde14('0x1b')];if(_[_0xde14('0x11')](_0x417269[_0xde14('0x1a')])){_0x310d75[_0xde14('0x1d')]=_0x417269[_0xde14('0x2d')]&&_0x417269[_0xde14('0x2d')]!==''?_0x417269['calleridname']:_0xde14('0x2f');}else{_0x310d75[_0xde14('0x1d')]=_0x417269[_0xde14('0x30')]&&_0x417269[_0xde14('0x30')]!==_0xde14('0x2e')?_0x417269[_0xde14('0x30')]:_0xde14('0x2f');}_0x4357c7=_0x310d75;_0x8e0e[_0xde14('0x31')](_0x310d75);return;}}})[_0xde14('0x23')](function(){if(_0x4b2b15){emit(_0x417269['uniqueid'],_0x1a7167,util[_0xde14('0x34')]('user:%s',_0x4b2b15['name']),util['format'](_0xde14('0x35'),_0xe785fb[_0xde14('0x36')][_0xde14('0x37')]()),{'evt':_[_0xde14('0x38')](_0x417269,{'autoCreate':_0x34e28f}),'contact':_0x4357c7===undefined?{}:_0x4357c7,'contacts':_0x8e0e[_0xde14('0x26')]===0x0?undefined:_0x8e0e});}});}; \ No newline at end of file +var _0x4ea3=['toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','name','trigger:%s','action'];(function(_0x4659c6,_0x2a6daa){var _0x10b697=function(_0x494981){while(--_0x494981){_0x4659c6['push'](_0x4659c6['shift']());}};_0x10b697(++_0x2a6daa);}(_0x4ea3,0x70));var _0x34ea=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4ea3[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x34ea('0x0'));var BPromise=require(_0x34ea('0x1'));var Redis=require(_0x34ea('0x2'));var util=require(_0x34ea('0x3'));var config=require('../../../../config/environment');var logger=require(_0x34ea('0x4'))('trigger');var cmContactRpc=require(_0x34ea('0x5'));config['redis']=_['defaults'](config[_0x34ea('0x6')],{'host':_0x34ea('0x7'),'port':0x18eb});var io=require(_0x34ea('0x8'))(new Redis(config[_0x34ea('0x6')]));function emit(_0x40434e,_0x18b461,_0x22b09e,_0x5bec7c,_0x341727){logger[_0x34ea('0x9')](_0x34ea('0xa'),_0x40434e,_0x18b461['id'],_0x22b09e,_0x5bec7c,JSON['stringify'](_0x341727));io['to'](_0x22b09e)[_0x34ea('0xb')](_0x5bec7c,_0x341727);}exports[_0x34ea('0xc')]=function(_0x5126de,_0x4a76b1,_0x5bd8b6,_0x346287){var _0x167667,_0x58bb0d;var _0x11229e={};var _0x29a5c8=Number(_0x5bd8b6[_0x34ea('0xd')]);var _0x233b11=_0x5bd8b6[_0x34ea('0xe')]?Boolean(Number(_0x5bd8b6[_0x34ea('0xe')])):![];var _0x37e1b4;var _0x36af43=![];if(!_[_0x34ea('0xf')](_0x5bd8b6[_0x34ea('0x10')])){if(_0x5bd8b6[_0x34ea('0x10')]=='1')_0x36af43=!![];}if(!_0x36af43){if(_0x346287['xmd-contactid']){_0x11229e['id']=_0x346287[_0x34ea('0x11')];}}if(!_0x11229e['id']){_0x11229e[_0x34ea('0x12')]=_0x29a5c8;_0x37e1b4=_0x5bd8b6[_0x34ea('0x13')]&&_0x5bd8b6[_0x34ea('0x13')]!=='0'?_0x5bd8b6[_0x34ea('0x13')]['split'](','):[_0x34ea('0x14')];_0x11229e[_0x34ea('0x15')]=_[_0x34ea('0x16')](_0x37e1b4,function(_0x305576){var _0x5f420f={};_0x5f420f[_0x305576]=_0x346287[_0x34ea('0x17')]?_0x346287[_0x34ea('0x18')]:_0x346287[_0x34ea('0x19')];return _0x5f420f;});}var _0x5340a4=['id',_0x34ea('0x1a'),_0x34ea('0x1b'),_0x34ea('0x14'),_0x34ea('0x1c'),'fax',_0x34ea('0x12'),_0x34ea('0x1d'),_0x34ea('0x1e'),_0x34ea('0x1f')];var _0x4fc1a2=_['union'](_0x5340a4,_0x37e1b4);BPromise[_0x34ea('0x20')]()[_0x34ea('0x21')](cmContactRpc[_0x34ea('0x22')]({'attributes':_0x4fc1a2,'where':_0x11229e}))['then'](function(_0x5197a2){_0x58bb0d=_0x5197a2;if(!_[_0x34ea('0x23')](_0x58bb0d)){if(_0x58bb0d[_0x34ea('0x24')]===0x1){_0x167667=_0x58bb0d[0x0];logger[_0x34ea('0x9')](_0x34ea('0x25'),_0x346287[_0x34ea('0x26')],_0x4a76b1['id'],_0x167667['id']);}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x346287[_0x34ea('0x26')],_0x4a76b1['id'],_[_0x34ea('0x16')](_0x58bb0d,'id')[_0x34ea('0x27')](','));}return;}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x346287['uniqueid'],_0x4a76b1['id']);var _0x564d1b={'ListId':_0x29a5c8};var _0x142709=_0x5bd8b6[_0x34ea('0x28')]&&_0x5bd8b6[_0x34ea('0x28')]!=='0'?_0x5bd8b6[_0x34ea('0x28')]:'phone';if(_0x233b11){logger[_0x34ea('0x9')](_0x34ea('0x29'),_0x346287[_0x34ea('0x26')],_0x4a76b1['id']);_0x564d1b[_0x142709]=_['isNil'](_0x346287['routeId'])?_0x346287['calleridnum']:_0x346287['destcalleridnum'];if(_[_0x34ea('0xf')](_0x346287[_0x34ea('0x17')])){_0x564d1b[_0x34ea('0x1a')]=_0x346287[_0x34ea('0x2a')]&&_0x346287['calleridname']!==_0x34ea('0x2b')?_0x346287['calleridname']:_0x34ea('0x2c');}else{_0x564d1b['firstName']=_0x346287[_0x34ea('0x2d')]&&_0x346287[_0x34ea('0x2d')]!==_0x34ea('0x2b')?_0x346287['destcalleridname']:_0x34ea('0x2c');}return BPromise[_0x34ea('0x20')]()['then'](cmContactRpc[_0x34ea('0x2e')](_0x564d1b))['then'](function(_0x1392b6){_0x167667=_0x1392b6;_0x58bb0d[_0x34ea('0x2f')](_0x1392b6);if(_0x167667){logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x346287['uniqueid'],_0x4a76b1['id'],_0x167667['id']);}return;});}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x346287[_0x34ea('0x26')],_0x4a76b1['id']);_0x564d1b[_0x142709]=_[_0x34ea('0xf')](_0x346287['routeId'])?_0x346287[_0x34ea('0x19')]:_0x346287[_0x34ea('0x18')];if(_[_0x34ea('0xf')](_0x346287[_0x34ea('0x17')])){_0x564d1b['firstName']=_0x346287['calleridname']&&_0x346287['calleridname']!==_0x34ea('0x2b')?_0x346287[_0x34ea('0x2a')]:_0x34ea('0x2c');}else{_0x564d1b['firstName']=_0x346287['destcalleridname']&&_0x346287['destcalleridname']!==_0x34ea('0x2b')?_0x346287[_0x34ea('0x2d')]:'Unknown';}_0x167667=_0x564d1b;_0x58bb0d[_0x34ea('0x2f')](_0x564d1b);return;}}})[_0x34ea('0x21')](function(){if(_0x5126de){emit(_0x346287[_0x34ea('0x26')],_0x4a76b1,util[_0x34ea('0x30')](_0x34ea('0x31'),_0x5126de[_0x34ea('0x32')]),util['format'](_0x34ea('0x33'),_0x5bd8b6[_0x34ea('0x34')][_0x34ea('0x35')]()),{'evt':_[_0x34ea('0x36')](_0x346287,{'autoCreate':_0x233b11}),'contact':_0x167667===undefined?{}:_0x167667,'contacts':_0x58bb0d['length']===0x0?undefined:_0x58bb0d});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 60083db..39d505d 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 _0xf2f3=['localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','variables','Actions','length','toLowerCase','contactmanager','motionbar','data1','html','data2','render','template\x20not\x20found','uri','isNil','data3','data4','location','windowWidth','data5','windowHeight','data6','600','winapp','winApplication','winArguments','user:%s','name','format','action','merge','trigger:%s','integration','exec','accounts','voiceExtensions','routeId','urlforward','script','buildUri','parse','query','search','replace','checkTrigger','every','AllConditions','checkConditions','channel','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','exports','lodash','url','mustache','./urlforward','./integration','./cmContact','../../../config/logger','trigger','../ami','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2f3,0x15d));var _0x3f2f=function(_0x1fcacd,_0x27ade5){_0x1fcacd=_0x1fcacd-0x0;var _0x57af67=_0xf2f3[_0x1fcacd];return _0x57af67;};'use strict';var util=require('util');var _=require(_0x3f2f('0x0'));var url=require(_0x3f2f('0x1'));var Mustache=require(_0x3f2f('0x2'));var Redis=require('ioredis');var urlforward=require(_0x3f2f('0x3'));var integration=require(_0x3f2f('0x4'));var cmContact=require(_0x3f2f('0x5'));var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x3f2f('0x6'))(_0x3f2f('0x7'));var ami=require(_0x3f2f('0x8'));config[_0x3f2f('0x9')]=_[_0x3f2f('0xa')](config[_0x3f2f('0x9')],{'host':_0x3f2f('0xb'),'port':0x18eb});var io=require(_0x3f2f('0xc'))(new Redis(config[_0x3f2f('0x9')]));var operators={'equals':function(_0x2c54f8,_0x191f5f){return _0x2c54f8==_0x191f5f;},'not_equals':function(_0x438f59,_0x2e3ee3){return _0x438f59!=_0x2e3ee3;}};var barAndWebActions=[_0x3f2f('0xd'),_0x3f2f('0x1'),'winapp'];function Trigger(_0x2ee168){this[_0x3f2f('0xe')]=_0x2ee168[_0x3f2f('0xe')];this['agents']=_0x2ee168[_0x3f2f('0xf')];this[_0x3f2f('0x10')]=_0x2ee168['voiceQueues'];this['templates']=_0x2ee168[_0x3f2f('0x11')];this['voiceExtensions']=_0x2ee168['voiceExtensions'];this[_0x3f2f('0x12')]=_0x2ee168[_0x3f2f('0x12')];this[_0x3f2f('0x13')]=_0x2ee168['freshdeskAccounts'];this['salesforceAccounts']=_0x2ee168[_0x3f2f('0x14')];this[_0x3f2f('0x15')]=_0x2ee168[_0x3f2f('0x15')];this[_0x3f2f('0x16')]=_0x2ee168[_0x3f2f('0x16')];this[_0x3f2f('0x17')]=_0x2ee168[_0x3f2f('0x17')];this['vtigerAccounts']=_0x2ee168[_0x3f2f('0x18')];this[_0x3f2f('0x19')]=_0x2ee168[_0x3f2f('0x19')];this[_0x3f2f('0x1a')]=_0x2ee168[_0x3f2f('0x1a')];this[_0x3f2f('0x1b')]=_0x2ee168[_0x3f2f('0x1b')];this['accounts']={'zendesk':this[_0x3f2f('0x12')],'salesforce':this[_0x3f2f('0x14')],'freshdesk':this[_0x3f2f('0x13')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x3f2f('0x16')],'desk':this['deskAccounts'],'vtiger':this[_0x3f2f('0x18')],'dynamics365':this[_0x3f2f('0x1a')],'freshsales':this[_0x3f2f('0x1b')],'servicenow':this[_0x3f2f('0x19')]};ami['on'](_0x3f2f('0x1c'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on']('custom:agentconnect',this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on']('custom:agentringnoanswer',this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x1f'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x20'),this[_0x3f2f('0x1d')]['bind'](this));ami['on'](_0x3f2f('0x21'),this[_0x3f2f('0x1d')]['bind'](this));ami['on'](_0x3f2f('0x22'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on']('custom:agentcongestion',this[_0x3f2f('0x1d')]['bind'](this));ami['on']('custom:agentreject',this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x23'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x24'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x25'),this[_0x3f2f('0x26')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x27'),this['syncAgentDial']['bind'](this));ami['on'](_0x3f2f('0x28'),this[_0x3f2f('0x26')][_0x3f2f('0x1e')](this));ami['on']('custom:newinteraction',this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x29'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on']('custom:substatus',this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x2a'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));ami['on'](_0x3f2f('0x2b'),this[_0x3f2f('0x1d')]['bind'](this));ami['on'](_0x3f2f('0x2c'),this[_0x3f2f('0x1d')][_0x3f2f('0x1e')](this));}Trigger[_0x3f2f('0x2d')]['emit']=function(_0x1df6d5,_0x5c246d,_0x4c4a24){logger[_0x3f2f('0x2e')](_0x1df6d5,_0x5c246d,JSON[_0x3f2f('0x2f')](_0x4c4a24));io['to'](_0x1df6d5)[_0x3f2f('0x30')](_0x5c246d,_0x4c4a24);};Trigger[_0x3f2f('0x2d')]['syncCustomEvent']=function(_0x37bdfc){var _0x3bebcc=_[_0x3f2f('0x31')](_0x37bdfc);if(typeof _0x3bebcc[_0x3f2f('0x32')]===_0x3f2f('0x33')){_0x3bebcc[_0x3f2f('0x32')]=_0x3f2f('0x34');}this[_0x3f2f('0x35')](_0x3bebcc);};Trigger[_0x3f2f('0x2d')][_0x3f2f('0x26')]=function(_0x3e1d4b){if(this[_0x3f2f('0xf')][_0x3e1d4b[_0x3f2f('0x36')]]){this[_0x3f2f('0x1d')](_0x3e1d4b);}};Trigger[_0x3f2f('0x2d')][_0x3f2f('0x35')]=function(_0x27ae3e){var _0x59a4d9;for(var _0x281c46 in this[_0x3f2f('0xe')]){if(this[_0x3f2f('0xe')][_0x3f2f('0x37')](_0x281c46)){if(this[_0x3f2f('0xe')][_0x281c46]['status']){_0x59a4d9=this['checkTrigger'](this[_0x3f2f('0xe')][_0x281c46],_0x27ae3e);if(_0x59a4d9){_['merge'](_0x27ae3e,_0x27ae3e[_0x3f2f('0x38')]);for(var _0x46ab8e=0x0,_0x3265d9,_0x265f0a,_0x1ee64d;_0x46ab8e0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','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','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x4ab55f,_0x5443d6){var _0x174749=function(_0x32a114){while(--_0x32a114){_0x4ab55f['push'](_0x4ab55f['shift']());}};_0x174749(++_0x5443d6);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_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 diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 5d23fa5..f11df1b 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 _0xf6db=['redis','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','isdisabled','info','toUpperCase','systemuserid','userEmail','length','internalemailaddress','userId','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','contactid',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','idField','substring','indexOf','ticketType','incident','getString','Subjects','Descriptions','Fields','phonecalls','assign','/contacts(','callDirection','queue','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','socket.io-emitter'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf6db,0xb3));var _0xbf6d=function(_0x3c424f,_0x1c61c2){_0x3c424f=_0x3c424f-0x0;var _0x3fee82=_0xf6db[_0x3c424f];return _0x3fee82;};'use strict';var _=require('lodash');var BPromise=require(_0xbf6d('0x0'));var rp=require(_0xbf6d('0x1'));var util=require(_0xbf6d('0x2'));var intUtil=require('./util');var md5=require(_0xbf6d('0x3'));var Redis=require(_0xbf6d('0x4'));var logger=require(_0xbf6d('0x5'))(_0xbf6d('0x6'));var config=require(_0xbf6d('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbf6d('0x8'))(new Redis(config[_0xbf6d('0x9')]));function getAuthToken(_0x46b08a,_0x1b68bf,_0x4ed01d){var _0x412dc7={'method':'POST','uri':_0x1b68bf,'form':{'client_id':_0x46b08a[_0xbf6d('0xa')],'resource':_0x46b08a[_0xbf6d('0xb')],'username':_0x46b08a[_0xbf6d('0xc')],'password':_0x46b08a[_0xbf6d('0xd')],'grant_type':_0xbf6d('0xd'),'client_secret':_0x46b08a[_0xbf6d('0xe')]},'json':!![]};return rp(_0x412dc7)[_0xbf6d('0xf')](function(_0x246f9a){return _0x246f9a[_0xbf6d('0x10')];})[_0xbf6d('0x11')](function(_0x1329f0){logger[_0xbf6d('0x12')]('['+[_0x4ed01d['toUpperCase']()]+_0xbf6d('0x13'));return _0x1329f0[_0xbf6d('0x14')];});}function getUser(_0x27f91b,_0xcd8bb9,_0x34ccb0,_0x9968ce,_0x3efed6,_0x8400d){return new BPromise(function(_0x2607aa,_0x3443da){return getAuthToken(_0xcd8bb9,_0x9968ce,_0x8400d)[_0xbf6d('0xf')](function(_0x517945){var _0x3b5ce0={'method':_0xbf6d('0x15'),'uri':_0x3efed6+_0xbf6d('0x16'),'headers':{'Authorization':_0xbf6d('0x17')+_0x517945,'OData-Version':_0xbf6d('0x18')},'json':!![]};return rp(_0x3b5ce0);})[_0xbf6d('0xf')](function(_0x7241b){var _0x43d8a3=_0x7241b[_0xbf6d('0x19')];var _0x10aae6=![];var _0x464946=null;if(!_[_0xbf6d('0x1a')](_0x34ccb0)){if(intUtil['validateEmail'](_0x34ccb0[_0xbf6d('0x1b')])){_0x27f91b['userEmail']=_0x34ccb0[_0xbf6d('0x1b')];for(_0x464946=0x0;_0x464946<_0x43d8a3['length'];_0x464946++){if(_0x43d8a3[_0x464946]['internalemailaddress']===_0x34ccb0[_0xbf6d('0x1b')]&&!_0x43d8a3[_0x464946][_0xbf6d('0x1c')]){_0x10aae6=!![];logger[_0xbf6d('0x1d')]('['+[_0x8400d[_0xbf6d('0x1e')]()]+']\x20Agent\x20found\x20'+_0x43d8a3[_0x464946][_0xbf6d('0x1f')]+'!');_0x27f91b['userId']=_0x43d8a3[_0x464946]['systemuserid'];}}}}if(!_0x10aae6){logger[_0xbf6d('0x1d')]('['+[_0x8400d[_0xbf6d('0x1e')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x27f91b[_0xbf6d('0x20')]=_0xcd8bb9[_0xbf6d('0xc')];for(_0x464946=0x0;_0x464946<_0x43d8a3[_0xbf6d('0x21')];_0x464946++){if(_0x43d8a3[_0x464946][_0xbf6d('0x22')]===_0xcd8bb9[_0xbf6d('0xc')]){_0x27f91b[_0xbf6d('0x23')]=_0x43d8a3[_0x464946][_0xbf6d('0x1f')];}}}_0x2607aa(_0x27f91b);})[_0xbf6d('0x11')](function(_0x316850){_0x3443da(_0x316850[_0xbf6d('0x14')]);});});}function createEndUser(_0x5ce92d,_0x4905a4,_0x4382ea,_0x15e74d,_0x3b21ec,_0x5c1315){return new BPromise(function(_0x583778,_0xab877d){return getAuthToken(_0x4905a4,_0x4382ea,_0x5c1315)[_0xbf6d('0xf')](function(_0x126ef6){var _0x1250f9=_0x5c1315[_0xbf6d('0x24')]()===_0xbf6d('0x25')?_0x3b21ec[_0xbf6d('0x26')]:_0x3b21ec[_0xbf6d('0x27')];var _0x494aa4={'method':_0xbf6d('0x28'),'uri':_0x15e74d+_0xbf6d('0x29'),'body':{'telephone1':_0x1250f9,'fullname':_0x1250f9,'firstname':_0x1250f9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xbf6d('0x2a')+_0x5ce92d['userId']+')'},'headers':{'Authorization':_0xbf6d('0x17')+_0x126ef6,'OData-Version':_0xbf6d('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x494aa4);})[_0xbf6d('0xf')](function(_0x1614b1){var _0x3e3496=_0x1614b1['headers']['odata-entityid'];var _0x117635=_0x3e3496['substring'](_0x3e3496[_0xbf6d('0x2b')]('(')+0x1,_0x3e3496['lastIndexOf'](')'));_0x5ce92d[_0xbf6d('0x2c')]=_0x117635;_0x583778(_0x5ce92d);})['catch'](function(_0x269a7b){_0xab877d(_0x269a7b['message']);});});}function getEndUser(_0x4e8a34,_0xd49467,_0x4e4b9e,_0x1a1d4c,_0x56880d,_0x22e18e){return new BPromise(function(_0x576c96,_0x22ca05){var _0x1f2720=_0x22e18e['toLowerCase']()==='outbound'?_0x56880d[_0xbf6d('0x26')]:_0x56880d[_0xbf6d('0x27')];return getAuthToken(_0xd49467,_0x4e4b9e,_0x22e18e)[_0xbf6d('0xf')](function(_0x24b281){var _0x513092={'method':'GET','uri':_0x1a1d4c+_0xbf6d('0x2d')+_0x1f2720[_0xbf6d('0x2e')]('+','%2b')+'\x27','headers':{'Authorization':_0xbf6d('0x17')+_0x24b281,'If-None-Match':null,'OData-Version':_0xbf6d('0x18')},'json':!![]};return rp(_0x513092);})[_0xbf6d('0xf')](function(_0x357cf2){var _0x4eddd8=null;if(_0x357cf2){var _0x3bec68=_0x357cf2[_0xbf6d('0x19')];var _0x377d87=![];for(_0x4eddd8=0x0;_0x4eddd8<_0x3bec68['length'];_0x4eddd8++){if(_0x3bec68[_0x4eddd8]['telephone1']===_0x1f2720){_0x377d87=!![];_0x4e8a34[_0xbf6d('0x2c')]=_0x3bec68[_0x4eddd8][_0xbf6d('0x2f')];}}if(_0x377d87){_0x576c96(_0x4e8a34);}else{return createEndUser(_0x4e8a34,_0xd49467,_0x4e4b9e,_0x1a1d4c,_0x56880d,_0x22e18e)[_0xbf6d('0xf')](function(_0x2189d8){logger[_0xbf6d('0x1d')]('['+[_0x22e18e['toUpperCase']()]+_0xbf6d('0x30'),_0x2189d8[_0xbf6d('0x2c')]);_0x576c96(_0x2189d8);});}}else{return createEndUser(_0x4e8a34,_0xd49467,_0x4e4b9e,_0x1a1d4c,_0x56880d,_0x22e18e)['then'](function(_0x38bc24){logger[_0xbf6d('0x1d')]('['+[_0x22e18e['toUpperCase']()]+']\x20Enduser\x20Created!',_0x38bc24['enduserId']);_0x576c96(_0x38bc24);});}});});}function getCustomFields(_0x50c0f1,_0x55ca1a,_0x278805){var _0x22bd85={};if(_0x50c0f1[_0xbf6d('0x21')]>0x0){_[_0xbf6d('0x31')](_0x50c0f1,function(_0x3648db){if(_[_0xbf6d('0x32')](['string',_0xbf6d('0x33')],_0x3648db[_0xbf6d('0x34')])&&_0x3648db[_0xbf6d('0x35')]&&!_0x3648db['customField']){var _0x577ea3=_0x3648db[_0xbf6d('0x36')][_0xbf6d('0x24')]();var _0x2d784c=_0x577ea3[_0xbf6d('0x37')](0x0,_0x577ea3['indexOf']('_'));var _0x2f2bc6=_0x577ea3[_0xbf6d('0x37')](_0x577ea3[_0xbf6d('0x38')]('_')+0x1);if(_0x2d784c===_0x278805){_0x22bd85[_0x2f2bc6]=_0x3648db['content'];}}});}return _0x22bd85;}function getTicket(_0x20aefd,_0x2cb9fb,_0x303867,_0x34165f,_0x49e60b,_0x19a1d4,_0x4821f4){return new BPromise(function(_0x2bc68a,_0x12f072){var _0x24b0e1;return getAuthToken(_0x2cb9fb,_0x303867,_0x4821f4)[_0xbf6d('0xf')](function(_0x385cc7){if(_0x19a1d4[_0xbf6d('0x39')]===_0xbf6d('0x3a')){_0x24b0e1={'method':_0xbf6d('0x28'),'uri':_0x34165f+'incidents','body':Object['assign']({},{'title':intUtil[_0xbf6d('0x3b')](_0x19a1d4[_0xbf6d('0x3c')],_0x49e60b,'\x20'),'description':intUtil[_0xbf6d('0x3b')](_0x19a1d4[_0xbf6d('0x3d')],_0x49e60b,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x20aefd[_0xbf6d('0x2c')]+')','ownerid@odata.bind':_0xbf6d('0x2a')+_0x20aefd[_0xbf6d('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x19a1d4[_0xbf6d('0x3e')],_0x49e60b,_0x19a1d4[_0xbf6d('0x39')])),'headers':{'Authorization':_0xbf6d('0x17')+_0x385cc7,'OData-Version':_0xbf6d('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x19a1d4[_0xbf6d('0x39')]==='phonecall'){_0x24b0e1={'method':_0xbf6d('0x28'),'uri':_0x34165f+_0xbf6d('0x3f'),'body':Object[_0xbf6d('0x40')]({},{'subject':intUtil[_0xbf6d('0x3b')](_0x19a1d4['Subjects'],_0x49e60b,'\x20'),'phonenumber':String(_0x49e60b['calleridnum']),'description':intUtil['getString'](_0x19a1d4[_0xbf6d('0x3d')],_0x49e60b,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbf6d('0x41')+_0x20aefd[_0xbf6d('0x2c')]+')','ownerid@odata.bind':_0xbf6d('0x2a')+_0x20aefd[_0xbf6d('0x23')]+')','directioncode':_0x20aefd[_0xbf6d('0x42')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x20aefd[_0xbf6d('0x23')]+')','participationtypemask':_0x20aefd[_0xbf6d('0x42')]===_0xbf6d('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xbf6d('0x41')+_0x20aefd[_0xbf6d('0x2c')]+')','participationtypemask':_0x20aefd[_0xbf6d('0x42')]===_0xbf6d('0x43')?0x1:0x2}]},getCustomFields(_0x19a1d4[_0xbf6d('0x3e')],_0x49e60b,_0x19a1d4['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x385cc7,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x24b0e1);})[_0xbf6d('0xf')](function(_0xc7af0a){var _0x345ad8=_0xc7af0a[_0xbf6d('0x44')]['odata-entityid'];var _0x2b379a=_0x345ad8[_0xbf6d('0x37')](_0x345ad8['lastIndexOf']('(')+0x1,_0x345ad8[_0xbf6d('0x2b')](')'));_0x20aefd[_0xbf6d('0x45')]=_0x2b379a;_0x2bc68a(_0x20aefd);})[_0xbf6d('0x11')](function(_0x3a9aa5){_0x12f072(_0x3a9aa5[_0xbf6d('0x14')]);});});}function emit(_0xdec5f3,_0x2e443b,_0x28bf55,_0x54592f){var _0x56fb75={'uri':util['format'](_0xbf6d('0x46'),_0xdec5f3,_0x28bf55,_0x54592f)};io['to'](util[_0xbf6d('0x47')](_0xbf6d('0x48'),_0x2e443b))[_0xbf6d('0x49')](_0xbf6d('0x4a'),_0x56fb75);}exports['cs']=function(_0x4c6530,_0x3baa81,_0x3d41ac,_0x5775a1,_0x90b208,_0x5b26f4,_0x3e5621,_0x4b5072){var _0x17e27a={};_0x5b26f4[_0xbf6d('0xb')]=intUtil[_0xbf6d('0x4b')](_0x5b26f4[_0xbf6d('0xb')]);_0x5b26f4['serverUrl']=intUtil[_0xbf6d('0x4b')](_0x5b26f4[_0xbf6d('0x4c')]);_0x17e27a['callDirection']=_0x4b5072==='queue'||_0x4b5072===_0xbf6d('0x4d')?'queue':_0xbf6d('0x25');var _0x5f03a9=util[_0xbf6d('0x47')](_0xbf6d('0x4e'),_0x5b26f4[_0xbf6d('0xb')]);var _0xc7ed88=util[_0xbf6d('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5b26f4[_0xbf6d('0x4f')]);var _0x16204a=util[_0xbf6d('0x47')](_0xbf6d('0x50'),_0x5b26f4[_0xbf6d('0x4c')],_0x3baa81['uniqueid'],md5(_0x3baa81[_0xbf6d('0x51')]));if(_0x90b208&&_0x90b208[_0xbf6d('0x52')]){logger[_0xbf6d('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3baa81['recordingURL']=_0x16204a;}else if(_0x3e5621&&_0x3e5621[_0xbf6d('0x53')]&&_0x3e5621[_0xbf6d('0x53')]!==_0xbf6d('0x54')){logger[_0xbf6d('0x1d')]('[OUTBOUND]',_0xbf6d('0x55'));_0x3baa81[_0xbf6d('0x56')]=_0x16204a;}else{_0x3baa81['recordingURL']='';}return getUser(_0x17e27a,_0x5b26f4,_0x5775a1,_0xc7ed88,_0x5f03a9,_0x4b5072)['then'](function(_0x121028){logger[_0xbf6d('0x1d')]('['+_0x4b5072['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x121028[_0xbf6d('0x23')]);logger['info']('['+_0x4b5072['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x121028['userEmail']);return getEndUser(_0x121028,_0x5b26f4,_0xc7ed88,_0x5f03a9,_0x3baa81,_0x4b5072);})[_0xbf6d('0xf')](function(_0x13534a){logger[_0xbf6d('0x1d')]('['+_0x4b5072[_0xbf6d('0x1e')]()+_0xbf6d('0x57'),_0x13534a[_0xbf6d('0x2c')]);logger[_0xbf6d('0x1d')]('['+_0x4b5072['toUpperCase']()+_0xbf6d('0x58'),_0x3baa81[_0xbf6d('0x27')]);return getTicket(_0x13534a,_0x5b26f4,_0xc7ed88,_0x5f03a9,_0x3baa81,_0x3d41ac,_0x4b5072);})[_0xbf6d('0xf')](function(_0x43f495){logger[_0xbf6d('0x1d')](util['format']('['+_0x4b5072[_0xbf6d('0x1e')]()+_0xbf6d('0x59'),_0x3d41ac['ticketType'],_0x43f495[_0xbf6d('0x45')]));logger[_0xbf6d('0x1d')](util['format']('['+_0x4b5072[_0xbf6d('0x1e')]()+_0xbf6d('0x5a'),_0x4b5072));if(_0x4b5072!==_0xbf6d('0x4d')){logger['info']('['+_0x4b5072[_0xbf6d('0x1e')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5b26f4[_0xbf6d('0xb')],_0x5775a1[_0xbf6d('0x5b')],_0x3d41ac[_0xbf6d('0x39')],_0x43f495[_0xbf6d('0x45')]);}})['catch'](function(_0x34fe14){logger[_0xbf6d('0x12')]('['+_0x4b5072[_0xbf6d('0x1e')]()+_0xbf6d('0x5c'),util[_0xbf6d('0x5d')](_0x34fe14,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc263=['info',']\x20Agent\x20found\x20','systemuserid','toUpperCase','userEmail','username','userId','toLowerCase','destcalleridnum','/systemusers(','headers','odata-entityid','outbound','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','includes','string','picklist','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','phonecall','phonecalls','Descriptions','callDirection','queue','lastIndexOf','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','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','inspect','lodash','request-promise','util','ioredis','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','isdisabled'];(function(_0x4a884c,_0x3ef433){var _0x47b67a=function(_0x3a627e){while(--_0x3a627e){_0x4a884c['push'](_0x4a884c['shift']());}};_0x47b67a(++_0x3ef433);}(_0xc263,0x166));var _0x3c26=function(_0x54adb7,_0x48252a){_0x54adb7=_0x54adb7-0x0;var _0x539708=_0xc263[_0x54adb7];return _0x539708;};'use strict';var _=require(_0x3c26('0x0'));var BPromise=require('bluebird');var rp=require(_0x3c26('0x1'));var util=require(_0x3c26('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x3c26('0x3'));var logger=require('../../../../config/logger')(_0x3c26('0x4'));var config=require('../../../../config/environment');config[_0x3c26('0x5')]=_[_0x3c26('0x6')](config[_0x3c26('0x5')],{'host':_0x3c26('0x7'),'port':0x18eb});var io=require(_0x3c26('0x8'))(new Redis(config['redis']));function getAuthToken(_0x5273a8,_0x1957a7,_0x5ba567){var _0x4e5b36={'method':_0x3c26('0x9'),'uri':_0x1957a7,'form':{'client_id':_0x5273a8[_0x3c26('0xa')],'resource':_0x5273a8[_0x3c26('0xb')],'username':_0x5273a8['username'],'password':_0x5273a8[_0x3c26('0xc')],'grant_type':_0x3c26('0xc'),'client_secret':_0x5273a8[_0x3c26('0xd')]},'json':!![]};return rp(_0x4e5b36)[_0x3c26('0xe')](function(_0x37a671){return _0x37a671[_0x3c26('0xf')];})[_0x3c26('0x10')](function(_0x18cd29){logger[_0x3c26('0x11')]('['+[_0x5ba567['toUpperCase']()]+_0x3c26('0x12'));return _0x18cd29[_0x3c26('0x13')];});}function getUser(_0x2102af,_0x2eae96,_0x2944f0,_0x44face,_0x984837,_0x3ed992){return new BPromise(function(_0x20e1b9,_0x2fc037){return getAuthToken(_0x2eae96,_0x44face,_0x3ed992)['then'](function(_0x1b4c33){var _0x5bdcb4={'method':_0x3c26('0x14'),'uri':_0x984837+_0x3c26('0x15'),'headers':{'Authorization':_0x3c26('0x16')+_0x1b4c33,'OData-Version':_0x3c26('0x17')},'json':!![]};return rp(_0x5bdcb4);})[_0x3c26('0xe')](function(_0x281fec){var _0x4456eb=_0x281fec[_0x3c26('0x18')];var _0xdf7694=![];var _0x490faa=null;if(!_[_0x3c26('0x19')](_0x2944f0)){if(intUtil['validateEmail'](_0x2944f0[_0x3c26('0x1a')])){_0x2102af['userEmail']=_0x2944f0[_0x3c26('0x1a')];for(_0x490faa=0x0;_0x490faa<_0x4456eb[_0x3c26('0x1b')];_0x490faa++){if(_0x4456eb[_0x490faa][_0x3c26('0x1c')]===_0x2944f0['email']&&!_0x4456eb[_0x490faa][_0x3c26('0x1d')]){_0xdf7694=!![];logger[_0x3c26('0x1e')]('['+[_0x3ed992['toUpperCase']()]+_0x3c26('0x1f')+_0x4456eb[_0x490faa][_0x3c26('0x20')]+'!');_0x2102af['userId']=_0x4456eb[_0x490faa]['systemuserid'];}}}}if(!_0xdf7694){logger[_0x3c26('0x1e')]('['+[_0x3ed992[_0x3c26('0x21')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2102af[_0x3c26('0x22')]=_0x2eae96['username'];for(_0x490faa=0x0;_0x490faa<_0x4456eb[_0x3c26('0x1b')];_0x490faa++){if(_0x4456eb[_0x490faa][_0x3c26('0x1c')]===_0x2eae96[_0x3c26('0x23')]){_0x2102af[_0x3c26('0x24')]=_0x4456eb[_0x490faa][_0x3c26('0x20')];}}}_0x20e1b9(_0x2102af);})[_0x3c26('0x10')](function(_0x4738ba){_0x2fc037(_0x4738ba[_0x3c26('0x13')]);});});}function createEndUser(_0x35a29d,_0x3ede13,_0x223d64,_0x4576a3,_0x153831,_0x26fd7e){return new BPromise(function(_0x4717b2,_0x52810d){return getAuthToken(_0x3ede13,_0x223d64,_0x26fd7e)['then'](function(_0x4241ba){var _0x266850=_0x26fd7e[_0x3c26('0x25')]()==='outbound'?_0x153831[_0x3c26('0x26')]:_0x153831['calleridnum'];var _0x38878b={'method':_0x3c26('0x9'),'uri':_0x4576a3+'contacts','body':{'telephone1':_0x266850,'fullname':_0x266850,'firstname':_0x266850,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3c26('0x27')+_0x35a29d[_0x3c26('0x24')]+')'},'headers':{'Authorization':_0x3c26('0x16')+_0x4241ba,'OData-Version':_0x3c26('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x38878b);})[_0x3c26('0xe')](function(_0x310779){var _0x23f513=_0x310779[_0x3c26('0x28')][_0x3c26('0x29')];var _0x817e4d=_0x23f513['substring'](_0x23f513['lastIndexOf']('(')+0x1,_0x23f513['lastIndexOf'](')'));_0x35a29d['enduserId']=_0x817e4d;_0x4717b2(_0x35a29d);})[_0x3c26('0x10')](function(_0x36dfcb){_0x52810d(_0x36dfcb[_0x3c26('0x13')]);});});}function getEndUser(_0x24c7c3,_0x4d4fd1,_0x2e7514,_0x4bf5fc,_0x56ba25,_0x3dcc8f){return new BPromise(function(_0x36feb8,_0x2f467f){var _0x42f615=_0x3dcc8f[_0x3c26('0x25')]()===_0x3c26('0x2a')?_0x56ba25[_0x3c26('0x26')]:_0x56ba25[_0x3c26('0x2b')];return getAuthToken(_0x4d4fd1,_0x2e7514,_0x3dcc8f)[_0x3c26('0xe')](function(_0x2a8d68){var _0x1047ca={'method':_0x3c26('0x14'),'uri':_0x4bf5fc+_0x3c26('0x2c')+_0x42f615['replace']('+',_0x3c26('0x2d'))+'\x27','headers':{'Authorization':_0x3c26('0x16')+_0x2a8d68,'If-None-Match':null,'OData-Version':_0x3c26('0x17')},'json':!![]};return rp(_0x1047ca);})[_0x3c26('0xe')](function(_0x57c2dd){var _0x474bf4=null;if(_0x57c2dd){var _0x47f525=_0x57c2dd[_0x3c26('0x18')];var _0x8eacc=![];for(_0x474bf4=0x0;_0x474bf4<_0x47f525[_0x3c26('0x1b')];_0x474bf4++){if(_0x47f525[_0x474bf4][_0x3c26('0x2e')]===_0x42f615){_0x8eacc=!![];_0x24c7c3['enduserId']=_0x47f525[_0x474bf4][_0x3c26('0x2f')];}}if(_0x8eacc){_0x36feb8(_0x24c7c3);}else{return createEndUser(_0x24c7c3,_0x4d4fd1,_0x2e7514,_0x4bf5fc,_0x56ba25,_0x3dcc8f)[_0x3c26('0xe')](function(_0x1f244b){logger['info']('['+[_0x3dcc8f['toUpperCase']()]+_0x3c26('0x30'),_0x1f244b[_0x3c26('0x31')]);_0x36feb8(_0x1f244b);});}}else{return createEndUser(_0x24c7c3,_0x4d4fd1,_0x2e7514,_0x4bf5fc,_0x56ba25,_0x3dcc8f)[_0x3c26('0xe')](function(_0x5969aa){logger[_0x3c26('0x1e')]('['+[_0x3dcc8f[_0x3c26('0x21')]()]+_0x3c26('0x32'),_0x5969aa[_0x3c26('0x31')]);_0x36feb8(_0x5969aa);});}});});}function getCustomFields(_0x26bf80,_0x517881,_0x55af64){var _0x34bec4={};if(_0x26bf80[_0x3c26('0x1b')]>0x0){_['forEach'](_0x26bf80,function(_0x267f0a){if(_[_0x3c26('0x33')]([_0x3c26('0x34'),_0x3c26('0x35')],_0x267f0a['type'])&&_0x267f0a['nameField']&&!_0x267f0a[_0x3c26('0x36')]){var _0xdf5227=_0x267f0a[_0x3c26('0x37')]['toLowerCase']();var _0x99e7e5=_0xdf5227[_0x3c26('0x38')](0x0,_0xdf5227[_0x3c26('0x39')]('_'));var _0x5a4982=_0xdf5227[_0x3c26('0x38')](_0xdf5227['indexOf']('_')+0x1);if(_0x99e7e5===_0x55af64){_0x34bec4[_0x5a4982]=_0x267f0a[_0x3c26('0x3a')];}}});}return _0x34bec4;}function getTicket(_0x269322,_0x21458c,_0x376049,_0x41e17e,_0x35b4af,_0x40cbf0,_0x42c557){return new BPromise(function(_0x438c63,_0x228640){var _0x5e368b;return getAuthToken(_0x21458c,_0x376049,_0x42c557)[_0x3c26('0xe')](function(_0x39a4c6){if(_0x40cbf0[_0x3c26('0x3b')]===_0x3c26('0x3c')){_0x5e368b={'method':_0x3c26('0x9'),'uri':_0x41e17e+_0x3c26('0x3d'),'body':Object[_0x3c26('0x3e')]({},{'title':intUtil[_0x3c26('0x3f')](_0x40cbf0[_0x3c26('0x40')],_0x35b4af,'\x20'),'description':intUtil['getString'](_0x40cbf0['Descriptions'],_0x35b4af,'\x0a'),'customerid_contact@odata.bind':_0x3c26('0x41')+_0x269322[_0x3c26('0x31')]+')','ownerid@odata.bind':_0x3c26('0x27')+_0x269322[_0x3c26('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x40cbf0['Fields'],_0x35b4af,_0x40cbf0['ticketType'])),'headers':{'Authorization':_0x3c26('0x16')+_0x39a4c6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x40cbf0['ticketType']===_0x3c26('0x42')){_0x5e368b={'method':_0x3c26('0x9'),'uri':_0x41e17e+_0x3c26('0x43'),'body':Object[_0x3c26('0x3e')]({},{'subject':intUtil['getString'](_0x40cbf0['Subjects'],_0x35b4af,'\x20'),'phonenumber':String(_0x35b4af['calleridnum']),'description':intUtil['getString'](_0x40cbf0[_0x3c26('0x44')],_0x35b4af,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3c26('0x41')+_0x269322[_0x3c26('0x31')]+')','ownerid@odata.bind':_0x3c26('0x27')+_0x269322[_0x3c26('0x24')]+')','directioncode':_0x269322[_0x3c26('0x45')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x3c26('0x27')+_0x269322[_0x3c26('0x24')]+')','participationtypemask':_0x269322[_0x3c26('0x45')]===_0x3c26('0x46')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x269322['enduserId']+')','participationtypemask':_0x269322[_0x3c26('0x45')]===_0x3c26('0x46')?0x1:0x2}]},getCustomFields(_0x40cbf0['Fields'],_0x35b4af,_0x40cbf0[_0x3c26('0x3b')])),'headers':{'Authorization':_0x3c26('0x16')+_0x39a4c6,'OData-Version':_0x3c26('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5e368b);})[_0x3c26('0xe')](function(_0x103f71){var _0x4a0acf=_0x103f71['headers'][_0x3c26('0x29')];var _0x54a7cb=_0x4a0acf['substring'](_0x4a0acf[_0x3c26('0x47')]('(')+0x1,_0x4a0acf['lastIndexOf'](')'));_0x269322['ticketId']=_0x54a7cb;_0x438c63(_0x269322);})[_0x3c26('0x10')](function(_0xb84f87){_0x228640(_0xb84f87[_0x3c26('0x13')]);});});}function emit(_0x3a274f,_0x41e2a1,_0x3ee84d,_0x467e3c){var _0x259dd4={'uri':util[_0x3c26('0x48')](_0x3c26('0x49'),_0x3a274f,_0x3ee84d,_0x467e3c)};io['to'](util[_0x3c26('0x48')](_0x3c26('0x4a'),_0x41e2a1))[_0x3c26('0x4b')](_0x3c26('0x4c'),_0x259dd4);}exports['cs']=function(_0x7713ce,_0x3dfb90,_0x3fc97f,_0xce2e30,_0x166c35,_0x499d4f,_0x4e3bbe,_0xeacc20){var _0x12718d={};_0x499d4f['remoteUri']=intUtil[_0x3c26('0x4d')](_0x499d4f[_0x3c26('0xb')]);_0x499d4f[_0x3c26('0x4e')]=intUtil[_0x3c26('0x4d')](_0x499d4f[_0x3c26('0x4e')]);_0x12718d[_0x3c26('0x45')]=_0xeacc20===_0x3c26('0x46')||_0xeacc20===_0x3c26('0x4f')?_0x3c26('0x46'):_0x3c26('0x2a');var _0x1b65d4=util['format'](_0x3c26('0x50'),_0x499d4f[_0x3c26('0xb')]);var _0x2c182d=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x499d4f[_0x3c26('0x51')]);var _0x2b02e2=util[_0x3c26('0x48')](_0x3c26('0x52'),_0x499d4f[_0x3c26('0x4e')],_0x3dfb90[_0x3c26('0x53')],md5(_0x3dfb90[_0x3c26('0x53')]));if(_0x166c35&&_0x166c35[_0x3c26('0x54')]){logger[_0x3c26('0x1e')](_0x3c26('0x55'),'Recording\x20is\x20enabled!');_0x3dfb90['recordingURL']=_0x2b02e2;}else if(_0x4e3bbe&&_0x4e3bbe[_0x3c26('0x56')]&&_0x4e3bbe[_0x3c26('0x56')]!==_0x3c26('0x57')){logger[_0x3c26('0x1e')]('[OUTBOUND]',_0x3c26('0x58'));_0x3dfb90[_0x3c26('0x59')]=_0x2b02e2;}else{_0x3dfb90[_0x3c26('0x59')]='';}return getUser(_0x12718d,_0x499d4f,_0xce2e30,_0x2c182d,_0x1b65d4,_0xeacc20)[_0x3c26('0xe')](function(_0x443be0){logger[_0x3c26('0x1e')]('['+_0xeacc20[_0x3c26('0x21')]()+_0x3c26('0x5a'),_0x443be0[_0x3c26('0x24')]);logger[_0x3c26('0x1e')]('['+_0xeacc20[_0x3c26('0x21')]()+_0x3c26('0x5b'),_0x443be0[_0x3c26('0x22')]);return getEndUser(_0x443be0,_0x499d4f,_0x2c182d,_0x1b65d4,_0x3dfb90,_0xeacc20);})['then'](function(_0x388d62){logger['info']('['+_0xeacc20[_0x3c26('0x21')]()+_0x3c26('0x5c'),_0x388d62['enduserId']);logger[_0x3c26('0x1e')]('['+_0xeacc20[_0x3c26('0x21')]()+_0x3c26('0x5d'),_0x3dfb90[_0x3c26('0x2b')]);return getTicket(_0x388d62,_0x499d4f,_0x2c182d,_0x1b65d4,_0x3dfb90,_0x3fc97f,_0xeacc20);})[_0x3c26('0xe')](function(_0x44dad8){logger[_0x3c26('0x1e')](util['format']('['+_0xeacc20[_0x3c26('0x21')]()+_0x3c26('0x5e'),_0x3fc97f[_0x3c26('0x3b')],_0x44dad8[_0x3c26('0x5f')]));logger[_0x3c26('0x1e')](util[_0x3c26('0x48')]('['+_0xeacc20['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0xeacc20));if(_0xeacc20!=='unmanaged'){logger[_0x3c26('0x1e')]('['+_0xeacc20['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x499d4f['remoteUri'],_0xce2e30['name'],_0x3fc97f['ticketType'],_0x44dad8[_0x3c26('0x5f')]);}})[_0x3c26('0x10')](function(_0x439eaa){logger[_0x3c26('0x11')]('['+_0xeacc20[_0x3c26('0x21')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x3c26('0x60')](_0x439eaa,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 3b65caa..d2d40f9 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 _0x3426=['info','Creating\x20new\x20ticket...','calleridname','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','format','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','push','idField','variableName','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','%s/helpdesk/tickets/%d','error','unmanaged','toUpperCase','Authorization','calleridnum','lodash','md5','util','ioredis','../../../../config/environment','redis','defaults','socket.io-emitter','application/json','emit'];(function(_0x5e023f,_0x185adc){var _0x2a0f50=function(_0x4c9cdc){while(--_0x4c9cdc){_0x5e023f['push'](_0x5e023f['shift']());}};_0x2a0f50(++_0x185adc);}(_0x3426,0xfb));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6342('0x0'));var rp=require('request-promise');var md5=require(_0x6342('0x1'));var util=require(_0x6342('0x2'));var Redis=require(_0x6342('0x3'));var intUtil=require('./util');var config=require(_0x6342('0x4'));var logger=require('../../../../config/logger')('freshdesk');config[_0x6342('0x5')]=_[_0x6342('0x6')](config[_0x6342('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x6342('0x7'))(new Redis(config[_0x6342('0x5')]));var headers={'Content-Type':'application/json','Accept':_0x6342('0x8')};function emit(_0x371aa1,_0x5f311a,_0x46bf40){io['to'](_0x371aa1)[_0x6342('0x9')](_0x5f311a,_0x46bf40);}function getTicket(_0x1c68f9,_0x40b7ed,_0x5e21a0,_0x29eb81,_0x439828){logger[_0x6342('0xa')](_0x6342('0xb'));var _0x115e78=_['merge']({'responder_id':_0x40b7ed['id'],'requester_id':_0x5e21a0['id'],'name':util['format']('Caller\x20-\x20%s',_0x439828[_0x6342('0xc')]),'phone':_0x439828['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6342('0xd')](_0x29eb81['Subjects'],_0x439828,'\x20'),'description':intUtil[_0x6342('0xd')](_0x29eb81[_0x6342('0xe')],_0x439828,_0x6342('0xf')),'tags':getTags(_0x29eb81[_0x6342('0x10')],'name')},getCustomFields(_0x29eb81[_0x6342('0x11')],_0x439828));_0x115e78[_0x6342('0x12')]=_[_0x6342('0x13')](_[_0x6342('0x14')](_0x115e78[_0x6342('0x12')],'id'),_0x6342('0x15'));return request({'uri':util['format'](_0x6342('0x16'),_0x1c68f9[_0x6342('0x17')]),'method':_0x6342('0x18'),'body':_0x115e78})[_0x6342('0x19')](function(_0x1635d3){logger[_0x6342('0xa')](_0x6342('0x1a'));return _0x1635d3;});}function getUser(_0x5da74f,_0x67cc73){if(intUtil[_0x6342('0x1b')](_0x67cc73)){return request({'uri':util[_0x6342('0x1c')]('%s/api/v2/agents',_0x5da74f[_0x6342('0x17')]),'qs':{'email':_0x67cc73}})['then'](function(_0x12eb2f){if(_0x12eb2f[_0x6342('0x1d')]){logger[_0x6342('0xa')](_0x6342('0x1e'));return _[_0x6342('0x1f')](_0x12eb2f,function(_0x149f9e){return _0x149f9e[_0x6342('0x20')][_0x6342('0x21')]===_0x67cc73;});}else{logger[_0x6342('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6342('0x1c')](_0x6342('0x22'),_0x5da74f[_0x6342('0x17')])})['then'](function(_0x496297){logger[_0x6342('0xa')](_0x6342('0x23'));return _0x496297;});}});}else{logger[_0x6342('0xa')](_0x6342('0x24'));return request({'uri':util[_0x6342('0x1c')]('%s/api/v2/agents/me',_0x5da74f['remoteUri'])})[_0x6342('0x19')](function(_0x2b341c){logger[_0x6342('0xa')](_0x6342('0x23'));return _0x2b341c;});}}function getEndUser(_0x376a91,_0x3143c,_0x9b257){logger[_0x6342('0xa')]('Searching\x20enduser\x20with\x20phone',_0x9b257);return request({'uri':util[_0x6342('0x1c')]('%s/api/v2/contacts',_0x376a91[_0x6342('0x17')]),'qs':{'phone':_0x9b257}})['then'](function(_0x7ea2f7){if(_0x7ea2f7[_0x6342('0x1d')]){logger['info'](_0x6342('0x25'));return _['find'](_0x7ea2f7,{'phone':_0x9b257});}else{logger[_0x6342('0xa')](_0x6342('0x26'));return request({'uri':util[_0x6342('0x1c')](_0x6342('0x27'),_0x376a91[_0x6342('0x17')]),'method':_0x6342('0x18'),'body':{'name':_0x3143c,'phone':_0x9b257}})['then'](function(_0x3fe224){logger[_0x6342('0xa')](_0x6342('0x28'));return _0x3fe224;});}});}function getAuth(_0x4b6d10){return util[_0x6342('0x1c')](_0x6342('0x29'),new Buffer(_0x4b6d10[_0x6342('0x2a')]+':X')[_0x6342('0x2b')]('base64'));}function request(_0x5806a3){logger[_0x6342('0x2c')](_0x6342('0x2d'),JSON[_0x6342('0x2e')](_0x5806a3));return rp(_[_0x6342('0x6')](_0x5806a3,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x140c2d,_0x3eb191){var _0x11f9c9=[];if(_0x140c2d&&_0x140c2d['length']>0x0){_0x11f9c9=_[_0x6342('0x2f')](_0x140c2d,_0x3eb191);}return _0x11f9c9;}function getCustomFields(_0x2e09fc,_0x17b545){var _0x31f304=[];var _0x4414ff={'custom_fields':[]};if(_0x2e09fc[_0x6342('0x1d')]>0x0){_[_0x6342('0x30')](_0x2e09fc,function(_0x2ef573){if(_[_0x6342('0x31')]([_0x6342('0x32'),_0x6342('0x33')],_0x2ef573[_0x6342('0x34')])&&_0x2ef573[_0x6342('0x35')]&&!_0x2ef573[_0x6342('0x36')]){_0x4414ff[_0x2ef573['nameField'][_0x6342('0x37')]()]=_0x2ef573[_0x6342('0x38')][_0x6342('0x2b')]();}else if(_[_0x6342('0x31')]([_0x6342('0x32'),_0x6342('0x33')],_0x2ef573[_0x6342('0x34')])&&_0x2ef573['idField']&&_0x2ef573[_0x6342('0x36')]){_0x4414ff['custom_fields'][_0x6342('0x39')]({'id':_0x2ef573[_0x6342('0x3a')],'value':_0x2ef573[_0x6342('0x38')][_0x6342('0x2b')]()});}else if(_0x2ef573[_0x6342('0x34')]==='variable'&&_0x2ef573[_0x6342('0x3b')]&&_0x2ef573[_0x6342('0x3a')]&&_0x2ef573['customField']){_0x17b545[_0x2ef573[_0x6342('0x3b')]]&&_0x4414ff['custom_fields']['push']({'id':_0x2ef573[_0x6342('0x3a')],'value':_0x17b545[_0x2ef573[_0x6342('0x3b')]][_0x6342('0x2b')]()});}else if(_0x2ef573['type']==='customVariable'&&_0x2ef573[_0x6342('0x3c')]&&_0x2ef573['Variable']['name']&&_0x2ef573[_0x6342('0x3a')]&&_0x2ef573[_0x6342('0x36')]){_0x17b545[_0x2ef573[_0x6342('0x3c')][_0x6342('0x3d')]['toLowerCase']()]&&_0x4414ff[_0x6342('0x12')][_0x6342('0x39')]({'id':_0x2ef573[_0x6342('0x3a')],'value':_0x17b545[_0x2ef573[_0x6342('0x3c')][_0x6342('0x3d')]['toLowerCase']()][_0x6342('0x2b')]()});}});}return _0x4414ff;}exports['queue']=function(_0x162640,_0x4bcef6,_0x3369fe,_0x3e541e,_0x2e517e,_0x41886e){var _0x369b9c,_0x1191c7;_0x41886e['remoteUri']=intUtil['stripTrailingSlash'](_0x41886e['remoteUri']);_0x41886e['serverUrl']=intUtil[_0x6342('0x3e')](_0x41886e[_0x6342('0x3f')]);if(_0x2e517e&&_0x2e517e[_0x6342('0x40')]){logger[_0x6342('0xa')](_0x6342('0x41'),_0x6342('0x42'));_0x4bcef6['recordingURL']=util[_0x6342('0x1c')](_0x6342('0x43'),_0x41886e[_0x6342('0x3f')],_0x4bcef6['uniqueid'],md5(_0x4bcef6[_0x6342('0x44')]));}else{_0x4bcef6[_0x6342('0x45')]='';}headers['Authorization']=getAuth(_0x41886e);return getUser(_0x41886e,_0x3e541e[_0x6342('0x21')])[_0x6342('0x19')](function(_0x32e097){_0x369b9c=_0x32e097;logger[_0x6342('0xa')](_0x6342('0x46'),_0x369b9c['id']);return getEndUser(_0x41886e,_0x4bcef6['calleridname'],_0x4bcef6['calleridnum']);})[_0x6342('0x19')](function(_0x51c699){_0x1191c7=_0x51c699;logger[_0x6342('0xa')](_0x6342('0x47'),_0x1191c7['id']);return getTicket(_0x41886e,_0x369b9c,_0x1191c7,_0x3369fe,_0x4bcef6);})[_0x6342('0x19')](function(_0x54469f){if(_0x54469f&&_0x54469f['id']){logger[_0x6342('0xa')](_0x6342('0x1a'));logger[_0x6342('0xa')](_0x6342('0x48'),_0x54469f['id']);logger[_0x6342('0xa')]('[QUEUE]',_0x6342('0x49'));emit(util[_0x6342('0x1c')]('user:%s',_0x3e541e[_0x6342('0x3d')]),_0x6342('0x4a'),{'uri':util[_0x6342('0x1c')]('%s/helpdesk/tickets/%d',_0x41886e[_0x6342('0x17')],_0x54469f['id'])});}})[_0x6342('0x4b')](function(_0x1ed609){logger['error']('[QUEUE]',JSON[_0x6342('0x2e')](_0x1ed609));});};exports['outbound']=function(_0x26097f,_0x534667,_0x370185,_0xb62176,_0x51a6c5,_0x5da605,_0xd241da){var _0x272325,_0x4c50e5;_0x5da605['remoteUri']=intUtil[_0x6342('0x3e')](_0x5da605[_0x6342('0x17')]);_0x5da605[_0x6342('0x3f')]=intUtil[_0x6342('0x3e')](_0x5da605['serverUrl']);if(_0xd241da&&_0xd241da[_0x6342('0x4c')]&&_0xd241da[_0x6342('0x4c')]!=='none'){logger[_0x6342('0xa')](_0x6342('0x4d'),_0x6342('0x42'));_0x534667[_0x6342('0x45')]=util['format'](_0x6342('0x43'),_0x5da605[_0x6342('0x3f')],_0x534667[_0x6342('0x44')],md5(_0x534667[_0x6342('0x44')]));}headers['Authorization']=getAuth(_0x5da605);return getUser(_0x5da605,_0xb62176['email'])['then'](function(_0x513d4c){_0x272325=_0x513d4c;logger[_0x6342('0xa')](_0x6342('0x46'),_0x272325['id']);return getEndUser(_0x5da605,_0x534667[_0x6342('0x4e')],_0x534667[_0x6342('0x4f')]);})[_0x6342('0x19')](function(_0xc7ed85){_0x4c50e5=_0xc7ed85;logger[_0x6342('0xa')](_0x6342('0x47'),_0x4c50e5['id']);return getTicket(_0x5da605,_0x272325,_0x4c50e5,_0x370185,_0x534667);})[_0x6342('0x19')](function(_0x54988e){if(_0x54988e&&_0x54988e['id']){logger['info'](_0x6342('0x1a'));logger[_0x6342('0xa')](_0x6342('0x48'),_0x54988e['id']);logger[_0x6342('0xa')](_0x6342('0x4d'),_0x6342('0x49'));emit(util[_0x6342('0x1c')](_0x6342('0x50'),_0xb62176[_0x6342('0x3d')]),'trigger:browser:url',{'uri':util[_0x6342('0x1c')](_0x6342('0x51'),_0x5da605[_0x6342('0x17')],_0x54988e['id'])});}})[_0x6342('0x4b')](function(_0x3f1a81){logger[_0x6342('0x52')]('[OUTBOUND]',JSON['stringify'](_0x3f1a81));});};exports[_0x6342('0x53')]=function(_0x4b128b,_0x491fcb,_0x34bbaf,_0x2c2ea3,_0x23762e,_0x20322e){var _0x3b0c8f,_0x19fbdf;_0x20322e[_0x6342('0x17')]=intUtil[_0x6342('0x3e')](_0x20322e['remoteUri']);_0x20322e['serverUrl']=intUtil[_0x6342('0x3e')](_0x20322e[_0x6342('0x3f')]);if(_0x23762e&&_0x23762e[_0x6342('0x40')]){logger[_0x6342('0xa')]('['+_0x491fcb['lastevent'][_0x6342('0x54')]()+']',_0x6342('0x42'));_0x491fcb[_0x6342('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20322e['serverUrl'],_0x491fcb[_0x6342('0x44')],md5(_0x491fcb['uniqueid']));}else{_0x491fcb[_0x6342('0x45')]='';}headers[_0x6342('0x55')]=getAuth(_0x20322e);return getUser(_0x20322e,'')['then'](function(_0x180d56){_0x3b0c8f=_0x180d56;logger[_0x6342('0xa')](_0x6342('0x46'),_0x3b0c8f['id']);return getEndUser(_0x20322e,_0x491fcb[_0x6342('0xc')],_0x491fcb[_0x6342('0x56')]);})[_0x6342('0x19')](function(_0x49f80a){_0x19fbdf=_0x49f80a;logger[_0x6342('0xa')](_0x6342('0x47'),_0x19fbdf['id']);return getTicket(_0x20322e,_0x3b0c8f,_0x19fbdf,_0x34bbaf,_0x491fcb);})[_0x6342('0x19')](function(_0x6a74a1){if(_0x6a74a1){logger[_0x6342('0xa')]('Ticket\x20created!');logger[_0x6342('0xa')](_0x6342('0x48'),_0x6a74a1['id']);}})[_0x6342('0x4b')](function(_0x39d5c2){logger[_0x6342('0x52')]('['+_0x491fcb['lastevent']['toUpperCase']()+']',JSON[_0x6342('0x2e')](_0x39d5c2));});}; \ No newline at end of file +var _0x7433=['idField','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','[QUEUE]','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','lastevent','toUpperCase','stringify','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridnum','getString','Subjects','Tags','Fields','custom_fields','keyBy','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','format','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','GET','includes','string','type','customField','nameField','content','picklist','push'];(function(_0x2baac8,_0x2eae91){var _0x5f4b44=function(_0x515cc7){while(--_0x515cc7){_0x2baac8['push'](_0x2baac8['shift']());}};_0x5f4b44(++_0x2eae91);}(_0x7433,0x80));var _0x3743=function(_0x4a13db,_0x912364){_0x4a13db=_0x4a13db-0x0;var _0x3bdc9e=_0x7433[_0x4a13db];return _0x3bdc9e;};'use strict';var _=require(_0x3743('0x0'));var rp=require('request-promise');var md5=require(_0x3743('0x1'));var util=require(_0x3743('0x2'));var Redis=require(_0x3743('0x3'));var intUtil=require('./util');var config=require(_0x3743('0x4'));var logger=require(_0x3743('0x5'))(_0x3743('0x6'));config[_0x3743('0x7')]=_[_0x3743('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3743('0x9'))(new Redis(config[_0x3743('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x3743('0xa')};function emit(_0x3ea735,_0xe49ac0,_0x273412){io['to'](_0x3ea735)[_0x3743('0xb')](_0xe49ac0,_0x273412);}function getTicket(_0x919493,_0x57acf5,_0x5e55bb,_0x1d34b9,_0x3e3cdd){logger[_0x3743('0xc')](_0x3743('0xd'));var _0x4bd607=_[_0x3743('0xe')]({'responder_id':_0x57acf5['id'],'requester_id':_0x5e55bb['id'],'name':util['format']('Caller\x20-\x20%s',_0x3e3cdd['calleridname']),'phone':_0x3e3cdd[_0x3743('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3743('0x10')](_0x1d34b9[_0x3743('0x11')],_0x3e3cdd,'\x20'),'description':intUtil[_0x3743('0x10')](_0x1d34b9['Descriptions'],_0x3e3cdd,'
'),'tags':getTags(_0x1d34b9[_0x3743('0x12')],'name')},getCustomFields(_0x1d34b9[_0x3743('0x13')],_0x3e3cdd));_0x4bd607[_0x3743('0x14')]=_['mapValues'](_[_0x3743('0x15')](_0x4bd607[_0x3743('0x14')],'id'),'value');return request({'uri':util['format'](_0x3743('0x16'),_0x919493['remoteUri']),'method':_0x3743('0x17'),'body':_0x4bd607})[_0x3743('0x18')](function(_0x31a5c5){logger[_0x3743('0xc')](_0x3743('0x19'));return _0x31a5c5;});}function getUser(_0x1f663f,_0x5509bf){if(intUtil[_0x3743('0x1a')](_0x5509bf)){return request({'uri':util[_0x3743('0x1b')]('%s/api/v2/agents',_0x1f663f[_0x3743('0x1c')]),'qs':{'email':_0x5509bf}})[_0x3743('0x18')](function(_0x34b1e0){if(_0x34b1e0[_0x3743('0x1d')]){logger[_0x3743('0xc')](_0x3743('0x1e'));return _[_0x3743('0x1f')](_0x34b1e0,function(_0x39985d){return _0x39985d[_0x3743('0x20')][_0x3743('0x21')]===_0x5509bf;});}else{logger[_0x3743('0xc')](_0x3743('0x22'));return request({'uri':util['format'](_0x3743('0x23'),_0x1f663f[_0x3743('0x1c')])})['then'](function(_0x1b0bfd){logger[_0x3743('0xc')]('Admin\x20account\x20selected.');return _0x1b0bfd;});}});}else{logger[_0x3743('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x1f663f['remoteUri'])})[_0x3743('0x18')](function(_0x162ba2){logger[_0x3743('0xc')](_0x3743('0x24'));return _0x162ba2;});}}function getEndUser(_0x1eaed3,_0x6304e1,_0x385500){logger[_0x3743('0xc')](_0x3743('0x25'),_0x385500);return request({'uri':util['format'](_0x3743('0x26'),_0x1eaed3[_0x3743('0x1c')]),'qs':{'phone':_0x385500}})[_0x3743('0x18')](function(_0x11afd4){if(_0x11afd4[_0x3743('0x1d')]){logger[_0x3743('0xc')](_0x3743('0x27'));return _[_0x3743('0x1f')](_0x11afd4,{'phone':_0x385500});}else{logger[_0x3743('0xc')](_0x3743('0x28'));return request({'uri':util[_0x3743('0x1b')](_0x3743('0x26'),_0x1eaed3[_0x3743('0x1c')]),'method':_0x3743('0x17'),'body':{'name':_0x6304e1,'phone':_0x385500}})[_0x3743('0x18')](function(_0x3ead93){logger['info'](_0x3743('0x29'));return _0x3ead93;});}});}function getAuth(_0x42851c){return util[_0x3743('0x1b')](_0x3743('0x2a'),new Buffer(_0x42851c[_0x3743('0x2b')]+':X')[_0x3743('0x2c')]('base64'));}function request(_0xf116c3){logger[_0x3743('0x2d')](_0x3743('0x2e'),JSON['stringify'](_0xf116c3));return rp(_[_0x3743('0x8')](_0xf116c3,{'method':_0x3743('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x336092,_0x647b5b){var _0x5601fc=[];if(_0x336092&&_0x336092[_0x3743('0x1d')]>0x0){_0x5601fc=_['map'](_0x336092,_0x647b5b);}return _0x5601fc;}function getCustomFields(_0x1b05c0,_0x25734f){var _0x5cb4f8=[];var _0x30abaa={'custom_fields':[]};if(_0x1b05c0[_0x3743('0x1d')]>0x0){_['forEach'](_0x1b05c0,function(_0x20e16b){if(_[_0x3743('0x30')]([_0x3743('0x31'),'picklist'],_0x20e16b[_0x3743('0x32')])&&_0x20e16b['nameField']&&!_0x20e16b[_0x3743('0x33')]){_0x30abaa[_0x20e16b[_0x3743('0x34')]['toLowerCase']()]=_0x20e16b[_0x3743('0x35')]['toString']();}else if(_[_0x3743('0x30')]([_0x3743('0x31'),_0x3743('0x36')],_0x20e16b[_0x3743('0x32')])&&_0x20e16b['idField']&&_0x20e16b[_0x3743('0x33')]){_0x30abaa[_0x3743('0x14')][_0x3743('0x37')]({'id':_0x20e16b[_0x3743('0x38')],'value':_0x20e16b[_0x3743('0x35')][_0x3743('0x2c')]()});}else if(_0x20e16b[_0x3743('0x32')]===_0x3743('0x39')&&_0x20e16b[_0x3743('0x3a')]&&_0x20e16b[_0x3743('0x38')]&&_0x20e16b[_0x3743('0x33')]){_0x25734f[_0x20e16b[_0x3743('0x3a')]]&&_0x30abaa[_0x3743('0x14')][_0x3743('0x37')]({'id':_0x20e16b[_0x3743('0x38')],'value':_0x25734f[_0x20e16b[_0x3743('0x3a')]][_0x3743('0x2c')]()});}else if(_0x20e16b[_0x3743('0x32')]===_0x3743('0x3b')&&_0x20e16b['Variable']&&_0x20e16b[_0x3743('0x3c')][_0x3743('0x3d')]&&_0x20e16b[_0x3743('0x38')]&&_0x20e16b[_0x3743('0x33')]){_0x25734f[_0x20e16b[_0x3743('0x3c')][_0x3743('0x3d')][_0x3743('0x3e')]()]&&_0x30abaa['custom_fields']['push']({'id':_0x20e16b[_0x3743('0x38')],'value':_0x25734f[_0x20e16b['Variable']['name'][_0x3743('0x3e')]()][_0x3743('0x2c')]()});}});}return _0x30abaa;}exports[_0x3743('0x3f')]=function(_0x33a560,_0x28501c,_0x7b9793,_0x5ceedb,_0xc8de4f,_0x3ab067){var _0x215d19,_0x597a0e;_0x3ab067[_0x3743('0x1c')]=intUtil[_0x3743('0x40')](_0x3ab067['remoteUri']);_0x3ab067['serverUrl']=intUtil[_0x3743('0x40')](_0x3ab067[_0x3743('0x41')]);if(_0xc8de4f&&_0xc8de4f[_0x3743('0x42')]){logger[_0x3743('0xc')]('[QUEUE]',_0x3743('0x43'));_0x28501c[_0x3743('0x44')]=util['format'](_0x3743('0x45'),_0x3ab067['serverUrl'],_0x28501c[_0x3743('0x46')],md5(_0x28501c[_0x3743('0x46')]));}else{_0x28501c[_0x3743('0x44')]='';}headers[_0x3743('0x47')]=getAuth(_0x3ab067);return getUser(_0x3ab067,_0x5ceedb['email'])['then'](function(_0x41db04){_0x215d19=_0x41db04;logger[_0x3743('0xc')]('The\x20User\x20ID\x20is:',_0x215d19['id']);return getEndUser(_0x3ab067,_0x28501c[_0x3743('0x48')],_0x28501c[_0x3743('0xf')]);})[_0x3743('0x18')](function(_0x18be10){_0x597a0e=_0x18be10;logger[_0x3743('0xc')]('The\x20Enduser\x20ID\x20is:',_0x597a0e['id']);return getTicket(_0x3ab067,_0x215d19,_0x597a0e,_0x7b9793,_0x28501c);})[_0x3743('0x18')](function(_0x114137){if(_0x114137&&_0x114137['id']){logger[_0x3743('0xc')]('Ticket\x20created!');logger[_0x3743('0xc')]('The\x20Ticket\x20ID\x20is:',_0x114137['id']);logger[_0x3743('0xc')](_0x3743('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3743('0x1b')](_0x3743('0x4a'),_0x5ceedb[_0x3743('0x3d')]),'trigger:browser:url',{'uri':util[_0x3743('0x1b')](_0x3743('0x4b'),_0x3ab067['remoteUri'],_0x114137['id'])});}})[_0x3743('0x4c')](function(_0x495233){logger[_0x3743('0x4d')](_0x3743('0x49'),JSON['stringify'](_0x495233));});};exports[_0x3743('0x4e')]=function(_0x25fa90,_0x44b417,_0x10c604,_0x2b97c5,_0x4293d8,_0x47a1d1,_0x37f504){var _0x1be932,_0x13fd7f;_0x47a1d1[_0x3743('0x1c')]=intUtil[_0x3743('0x40')](_0x47a1d1[_0x3743('0x1c')]);_0x47a1d1[_0x3743('0x41')]=intUtil[_0x3743('0x40')](_0x47a1d1[_0x3743('0x41')]);if(_0x37f504&&_0x37f504[_0x3743('0x4f')]&&_0x37f504[_0x3743('0x4f')]!==_0x3743('0x50')){logger['info'](_0x3743('0x51'),_0x3743('0x43'));_0x44b417['recordingURL']=util[_0x3743('0x1b')](_0x3743('0x45'),_0x47a1d1['serverUrl'],_0x44b417[_0x3743('0x46')],md5(_0x44b417[_0x3743('0x46')]));}headers['Authorization']=getAuth(_0x47a1d1);return getUser(_0x47a1d1,_0x2b97c5[_0x3743('0x21')])[_0x3743('0x18')](function(_0x2d51b9){_0x1be932=_0x2d51b9;logger['info'](_0x3743('0x52'),_0x1be932['id']);return getEndUser(_0x47a1d1,_0x44b417[_0x3743('0x53')],_0x44b417[_0x3743('0x54')]);})['then'](function(_0x2082d5){_0x13fd7f=_0x2082d5;logger['info'](_0x3743('0x55'),_0x13fd7f['id']);return getTicket(_0x47a1d1,_0x1be932,_0x13fd7f,_0x10c604,_0x44b417);})['then'](function(_0x2e5ec8){if(_0x2e5ec8&&_0x2e5ec8['id']){logger['info']('Ticket\x20created!');logger['info'](_0x3743('0x56'),_0x2e5ec8['id']);logger[_0x3743('0xc')](_0x3743('0x51'),_0x3743('0x57'));emit(util[_0x3743('0x1b')]('user:%s',_0x2b97c5['name']),_0x3743('0x58'),{'uri':util[_0x3743('0x1b')]('%s/helpdesk/tickets/%d',_0x47a1d1['remoteUri'],_0x2e5ec8['id'])});}})[_0x3743('0x4c')](function(_0x1054ad){logger[_0x3743('0x4d')]('[OUTBOUND]',JSON['stringify'](_0x1054ad));});};exports['unmanaged']=function(_0xfa65e8,_0x48b52f,_0x2f8a78,_0x2288e5,_0x4fbc2a,_0x1b01e8){var _0x9f3876,_0x32d2e9;_0x1b01e8[_0x3743('0x1c')]=intUtil[_0x3743('0x40')](_0x1b01e8['remoteUri']);_0x1b01e8['serverUrl']=intUtil[_0x3743('0x40')](_0x1b01e8['serverUrl']);if(_0x4fbc2a&&_0x4fbc2a[_0x3743('0x42')]){logger['info']('['+_0x48b52f[_0x3743('0x59')][_0x3743('0x5a')]()+']','Recording\x20is\x20enabled!');_0x48b52f[_0x3743('0x44')]=util[_0x3743('0x1b')](_0x3743('0x45'),_0x1b01e8['serverUrl'],_0x48b52f['uniqueid'],md5(_0x48b52f['uniqueid']));}else{_0x48b52f[_0x3743('0x44')]='';}headers[_0x3743('0x47')]=getAuth(_0x1b01e8);return getUser(_0x1b01e8,'')['then'](function(_0x6745af){_0x9f3876=_0x6745af;logger[_0x3743('0xc')](_0x3743('0x52'),_0x9f3876['id']);return getEndUser(_0x1b01e8,_0x48b52f[_0x3743('0x48')],_0x48b52f[_0x3743('0xf')]);})['then'](function(_0x12a59b){_0x32d2e9=_0x12a59b;logger[_0x3743('0xc')]('The\x20Enduser\x20ID\x20is:',_0x32d2e9['id']);return getTicket(_0x1b01e8,_0x9f3876,_0x32d2e9,_0x2f8a78,_0x48b52f);})['then'](function(_0x531aac){if(_0x531aac){logger['info'](_0x3743('0x19'));logger['info'](_0x3743('0x56'),_0x531aac['id']);}})[_0x3743('0x4c')](function(_0x15fd7c){logger['error']('['+_0x48b52f[_0x3743('0x59')][_0x3743('0x5a')]()+']',JSON[_0x3743('0x5b')](_0x15fd7c));});}; \ 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 bf4cf25..47da415 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 _0x8d34=['&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','Subjects','Descriptions','add','ticketId','task','Task\x20created:','error','/contacts/','trigger:browser:url','Token\x20token=','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','message','/api/lookup?q='];(function(_0x23847a,_0x1361ee){var _0x14dac0=function(_0x435608){while(--_0x435608){_0x23847a['push'](_0x23847a['shift']());}};_0x14dac0(++_0x1361ee);}(_0x8d34,0xce));var _0x48d3=function(_0x4f9a6f,_0x2da3ae){_0x4f9a6f=_0x4f9a6f-0x0;var _0x1f75c4=_0x8d34[_0x4f9a6f];return _0x1f75c4;};'use strict';var _=require('lodash');var rp=require(_0x48d3('0x0'));var md5=require(_0x48d3('0x1'));var util=require(_0x48d3('0x2'));var moment=require(_0x48d3('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x48d3('0x4'));var config=require('../../../../config/environment');var logger=require(_0x48d3('0x5'))('freshsales');config[_0x48d3('0x6')]=_[_0x48d3('0x7')](config['redis'],{'host':_0x48d3('0x8'),'port':0x18eb});var io=require(_0x48d3('0x9'))(new Redis(config[_0x48d3('0x6')]));function getAdminId(_0x1d4c81,_0x136287,_0x5bfa34,_0x329dd6){return new Promise(function(_0xecd3f0,_0x454588){var _0x164404=![];var _0x3d9ac8={'method':_0x48d3('0xa'),'uri':_0x329dd6+_0x48d3('0xb'),'json':!![]};_0x3d9ac8[_0x48d3('0xc')]=_0x5bfa34;logger[_0x48d3('0xd')](_0x48d3('0xe'));return rp(_0x3d9ac8)[_0x48d3('0xf')](function(_0x4b5e75){if(_0x4b5e75){var _0x9bc428=_0x4b5e75['users'];var _0x3b185b=null;for(_0x3b185b=0x0;_0x3b185b<_0x9bc428[_0x48d3('0x10')];_0x3b185b++){if(_0x9bc428[_0x3b185b][_0x48d3('0x11')]===_0x1d4c81[_0x48d3('0x12')]){_0x1d4c81[_0x48d3('0x13')]=_0x9bc428[_0x3b185b]['id'];_0x164404=!![];}}if(_0x164404){logger['info'](_0x48d3('0x14'),_0x1d4c81['adminId']);_0xecd3f0(_0x1d4c81);}else{_0x454588({'statusCode':0x194,'message':_0x48d3('0x15')});}}else{_0x454588({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x48d3('0x16')](function(_0x4621b1){logger['error']('['+[_0x136287[_0x48d3('0x17')]()]+']',_0x4621b1['message']);_0x454588(_0x4621b1);});});}function getUser(_0x49280c,_0x4fc327,_0x4f453c){return function(_0x5e5790){return new Promise(function(_0x52f17c,_0x282fe8){var _0x274cd7={'method':_0x48d3('0xa'),'uri':_0x4f453c+_0x48d3('0xb'),'json':!![]};_0x274cd7['headers']=_0x4fc327;logger[_0x48d3('0xd')](_0x48d3('0x18'));return rp(_0x274cd7)[_0x48d3('0xf')](function(_0x2840d3){if(_0x2840d3){var _0x404ffe=_0x2840d3[_0x48d3('0x19')];var _0x533cc6=![];var _0x445ca7=null;if(_0x5e5790[_0x48d3('0x1a')]!==null){logger[_0x48d3('0xd')](_0x48d3('0x1b'),_0x5e5790[_0x48d3('0x1a')]);_0x5e5790[_0x48d3('0x1c')]=_0x5e5790[_0x48d3('0x1a')];for(_0x445ca7=0x0;_0x445ca7<_0x404ffe[_0x48d3('0x10')];_0x445ca7++){if(_0x404ffe[_0x445ca7][_0x48d3('0x11')]===_0x5e5790['agentEmail']){_0x533cc6=!![];_0x5e5790[_0x48d3('0x1d')]=_0x404ffe[_0x445ca7]['id'];logger[_0x48d3('0xd')](_0x48d3('0x1e'),_0x5e5790[_0x48d3('0x1d')]);}}}if(!_0x533cc6){logger['info'](_0x48d3('0x1f'));_0x5e5790[_0x48d3('0x1c')]=_0x5e5790[_0x48d3('0x12')];_0x5e5790['userId']=_0x5e5790[_0x48d3('0x13')];_0x533cc6=!![];}if(_0x533cc6){_0x52f17c(_0x5e5790);}else{_0x282fe8({'statusCode':0x194,'message':_0x48d3('0x15')});}}else{_0x282fe8({'statusCode':0x194,'message':_0x48d3('0x15')});}})[_0x48d3('0x16')](function(_0xf385a6){logger['error']('['+[_0x49280c[_0x48d3('0x17')]()]+']',_0xf385a6[_0x48d3('0x20')]);_0x282fe8(_0xf385a6);});});};}function searchContact(_0x6fe63b,_0x17f28d,_0x2b7ca5,_0x5a13af){return new Promise(function(_0x1ecca1,_0x17e4af){var _0x19aaaa={'method':_0x48d3('0xa'),'headers':_0x17f28d,'uri':_0x6fe63b+_0x48d3('0x21')+_0x5a13af+_0x48d3('0x22')+_0x2b7ca5+_0x48d3('0x23'),'json':!![]};rp(_0x19aaaa)['then'](function(_0x1ac539){var _0x2e1b3d=_[_0x48d3('0x24')](_0x1ac539[_0x48d3('0x25')][_0x48d3('0x25')],[_0x2b7ca5,_0x5a13af]);_0x1ecca1(_0x2e1b3d);})['catch'](function(_0xcb2f94){_0x17e4af(_0xcb2f94);});});}function getEndUser(_0x102ef6,_0x3323ca,_0x46030b){return function(_0x5713a9){return new Promise(function(_0x42b885,_0x546c32){logger['info'](util[_0x48d3('0x26')](_0x48d3('0x27'),_0x5713a9['contactNumber']));searchContact(_0x46030b,_0x3323ca,_0x48d3('0x28'),_0x5713a9[_0x48d3('0x29')])[_0x48d3('0xf')](function(_0x5ee167){if(_0x5ee167){_0x5713a9['endUserId']=_0x5ee167['id'];logger[_0x48d3('0xd')](_0x48d3('0x2a'),_0x5713a9[_0x48d3('0x2b')]);return _0x42b885(_0x5713a9);}searchContact(_0x46030b,_0x3323ca,'work_number',_0x5713a9['contactNumber'])[_0x48d3('0xf')](function(_0x209ef7){if(_0x209ef7){_0x5713a9[_0x48d3('0x2b')]=_0x209ef7['id'];logger[_0x48d3('0xd')](_0x48d3('0x2c'),_0x5713a9['endUserId']);return _0x42b885(_0x5713a9);}createEndUser(_0x5713a9,_0x102ef6,_0x3323ca,_0x46030b)[_0x48d3('0xf')](function(_0x24a87e){logger['info'](_0x48d3('0x2d'),_0x24a87e[_0x48d3('0x2b')]);return _0x42b885(_0x24a87e);});});})['catch'](function(_0x536d88){_0x546c32(_0x536d88);});});};}function createEndUser(_0x2e49d9,_0x35d075,_0x25311c,_0x59cdce){return new Promise(function(_0x1f09fa,_0x390a17){var _0x70ea06=moment();var _0x236cd5={'method':_0x48d3('0x2e'),'uri':_0x59cdce+_0x48d3('0x2f'),'body':{'contact':{'last_name':_0x2e49d9['contactNumber'],'work_number':_0x2e49d9['contactNumber'],'mobile_number':_0x2e49d9[_0x48d3('0x29')],'owner_id':_0x2e49d9['userId'],'created_at':_0x70ea06['format'](_0x48d3('0x30'))}},'json':!![]};_0x236cd5[_0x48d3('0xc')]=_0x25311c;logger[_0x48d3('0xd')](_0x48d3('0x31'));return rp(_0x236cd5)[_0x48d3('0xf')](function(_0x2f50ed){_0x2e49d9[_0x48d3('0x2b')]=_0x2f50ed[_0x48d3('0x32')]['id'];_0x1f09fa(_0x2e49d9);})[_0x48d3('0x16')](function(_0x30d3d4){logger['error']('['+[_0x35d075[_0x48d3('0x17')]()]+']',_0x30d3d4[_0x48d3('0x20')]);_0x390a17(_0x30d3d4[_0x48d3('0x20')]);});});}function getTicket(_0x572e2d,_0xa4776b,_0x2e8cb1,_0x589865,_0x42221e){return function(_0x185a73){logger['info'](_0x48d3('0x33'));return new Promise(function(_0x1c85f4,_0x483590){var _0x201e2f=moment();var _0x404b9f={'method':_0x48d3('0x2e'),'uri':_0x2e8cb1+'/api/tasks','body':{'title':intUtil['getString'](_0x589865[_0x48d3('0x34')],_0x42221e,'\x20'),'description':intUtil['getString'](_0x589865[_0x48d3('0x35')],_0x42221e,'\x0a'),'owner_id':_0x185a73['userId'],'creater_id':_0x185a73[_0x48d3('0x13')],'targetable_id':_0x185a73[_0x48d3('0x2b')],'targetable_type':'Contact','created_at':_0x201e2f[_0x48d3('0x26')](_0x48d3('0x30')),'due_date':_0x201e2f[_0x48d3('0x36')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x404b9f[_0x48d3('0xc')]=_0xa4776b;return rp(_0x404b9f)[_0x48d3('0xf')](function(_0x3fcbf0){_0x185a73[_0x48d3('0x37')]=_0x3fcbf0[_0x48d3('0x38')]['id'];logger[_0x48d3('0xd')](_0x48d3('0x39'),_0x185a73[_0x48d3('0x37')]);_0x1c85f4(_0x185a73);})['catch'](function(_0x3d5aca){logger[_0x48d3('0x3a')]('['+[_0x572e2d['toUpperCase']()]+']',_0x3d5aca[_0x48d3('0x20')]);_0x483590(_0x3d5aca[_0x48d3('0x20')]);});});};}function emit(_0x268ed7,_0x1e82c7,_0x442f17){var _0x412fc2={'uri':_0x268ed7+_0x48d3('0x3b')+_0x442f17};io['to'](util[_0x48d3('0x26')]('user:%s',_0x1e82c7))['emit'](_0x48d3('0x3c'),_0x412fc2);}exports['cs']=function(_0x5e9d41,_0x5b6dde,_0x5d149b,_0x451e0c,_0xc686ae,_0x33353c,_0x2079f1,_0x196262){var _0xad3267={};var _0x25857c={'Authorization':_0x48d3('0x3d')+_0x33353c['apiKey']};_0x33353c['remoteUri']=intUtil[_0x48d3('0x3e')](_0x33353c[_0x48d3('0x3f')]);_0x33353c[_0x48d3('0x40')]=intUtil[_0x48d3('0x3e')](_0x33353c[_0x48d3('0x40')]);var _0x374ab4=_0x33353c[_0x48d3('0x3f')];_0xad3267[_0x48d3('0x12')]=_0x33353c['username'];_0xad3267[_0x48d3('0x29')]=_0x196262[_0x48d3('0x41')]()===_0x48d3('0x42')?_0x5b6dde[_0x48d3('0x43')]:_0x5b6dde['calleridnum'];_0xad3267['callDirection']=_0x196262===_0x48d3('0x44')||_0x196262==='unmanaged'?_0x48d3('0x44'):'outbound';if(_0x451e0c){_0xad3267[_0x48d3('0x1a')]=_0x451e0c[_0x48d3('0x11')];}var _0x77e46f=util['format'](_0x48d3('0x45'),_0x33353c[_0x48d3('0x40')],_0x5b6dde[_0x48d3('0x46')],md5(_0x5b6dde[_0x48d3('0x46')]));if(_0xc686ae&&_0xc686ae['monitor_format']){logger[_0x48d3('0xd')]('[QUEUE]',_0x48d3('0x47'));_0x5b6dde[_0x48d3('0x48')]=_0x77e46f;}else if(_0x2079f1&&_0x2079f1['recordingFormat']&&_0x2079f1['recordingFormat']!==_0x48d3('0x49')){logger[_0x48d3('0xd')](_0x48d3('0x4a'),_0x48d3('0x47'));_0x5b6dde[_0x48d3('0x48')]=_0x77e46f;}else{_0x5b6dde['recordingURL']='';}return getAdminId(_0xad3267,_0x196262,_0x25857c,_0x374ab4)[_0x48d3('0xf')](getUser(_0x196262,_0x25857c,_0x374ab4))[_0x48d3('0xf')](getEndUser(_0x196262,_0x25857c,_0x374ab4))[_0x48d3('0xf')](getTicket(_0x196262,_0x25857c,_0x374ab4,_0x5d149b,_0x5b6dde))[_0x48d3('0xf')](function(_0x11c333){logger[_0x48d3('0xd')](util[_0x48d3('0x26')](_0x48d3('0x4b'),_0x11c333[_0x48d3('0x37')]));if(_0x196262!==_0x48d3('0x4c')){logger[_0x48d3('0xd')]('['+[_0x196262['toUpperCase']()]+']',_0x48d3('0x4d'));emit(_0x374ab4,_0x451e0c[_0x48d3('0x4e')],_0x11c333['endUserId']);}})['catch'](function(_0x4cd73c){logger['error']('['+[_0x196262[_0x48d3('0x17')]()]+_0x48d3('0x4f'),util['inspect'](_0x4cd73c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xadd7=['agentEmail','length','userId','Admin\x20selected','userEmail','error','/api/lookup?q=','&entities=contact','find','contacts','format','mobile_number','contactNumber','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','/api/tasks','getString','Subjects','Descriptions','add','Task\x20created:','emit','trigger:browser:url','Token\x20token=','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','headers'];(function(_0xcc30fb,_0x25af98){var _0x2a469e=function(_0x1254d9){while(--_0x1254d9){_0xcc30fb['push'](_0xcc30fb['shift']());}};_0x2a469e(++_0x25af98);}(_0xadd7,0x170));var _0x7add=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xadd7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7add('0x0'));var rp=require(_0x7add('0x1'));var md5=require(_0x7add('0x2'));var util=require(_0x7add('0x3'));var moment=require(_0x7add('0x4'));var Promise=require(_0x7add('0x5'));var Redis=require(_0x7add('0x6'));var intUtil=require(_0x7add('0x7'));var config=require(_0x7add('0x8'));var logger=require('../../../../config/logger')('freshsales');config[_0x7add('0x9')]=_[_0x7add('0xa')](config[_0x7add('0x9')],{'host':_0x7add('0xb'),'port':0x18eb});var io=require(_0x7add('0xc'))(new Redis(config['redis']));function getAdminId(_0x345930,_0x1a8bda,_0x3ffede,_0x97b690){return new Promise(function(_0x571368,_0x51a305){var _0x1fcac8=![];var _0x52aba0={'method':_0x7add('0xd'),'uri':_0x97b690+_0x7add('0xe'),'json':!![]};_0x52aba0['headers']=_0x3ffede;logger[_0x7add('0xf')]('Getting\x20admin\x20information');return rp(_0x52aba0)[_0x7add('0x10')](function(_0x38c4d7){if(_0x38c4d7){var _0x156d75=_0x38c4d7[_0x7add('0x11')];var _0x35f746=null;for(_0x35f746=0x0;_0x35f746<_0x156d75['length'];_0x35f746++){if(_0x156d75[_0x35f746][_0x7add('0x12')]===_0x345930[_0x7add('0x13')]){_0x345930[_0x7add('0x14')]=_0x156d75[_0x35f746]['id'];_0x1fcac8=!![];}}if(_0x1fcac8){logger['info'](_0x7add('0x15'),_0x345930[_0x7add('0x14')]);_0x571368(_0x345930);}else{_0x51a305({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x51a305({'statusCode':0x194,'message':_0x7add('0x16')});}})[_0x7add('0x17')](function(_0x20bd00){logger['error']('['+[_0x1a8bda[_0x7add('0x18')]()]+']',_0x20bd00[_0x7add('0x19')]);_0x51a305(_0x20bd00);});});}function getUser(_0x1146b6,_0x28a6ba,_0x967411){return function(_0x29c018){return new Promise(function(_0x2e9b74,_0x3a4aca){var _0x1629b1={'method':_0x7add('0xd'),'uri':_0x967411+'/api/selector/owners','json':!![]};_0x1629b1[_0x7add('0x1a')]=_0x28a6ba;logger[_0x7add('0xf')]('Getting\x20user\x20list');return rp(_0x1629b1)['then'](function(_0x53aacb){if(_0x53aacb){var _0xe22712=_0x53aacb[_0x7add('0x11')];var _0xa50cd1=![];var _0x86855e=null;if(_0x29c018['agentEmail']!==null){logger[_0x7add('0xf')]('Getting\x20user\x20with\x20email',_0x29c018[_0x7add('0x1b')]);_0x29c018['userEmail']=_0x29c018[_0x7add('0x1b')];for(_0x86855e=0x0;_0x86855e<_0xe22712[_0x7add('0x1c')];_0x86855e++){if(_0xe22712[_0x86855e][_0x7add('0x12')]===_0x29c018[_0x7add('0x1b')]){_0xa50cd1=!![];_0x29c018[_0x7add('0x1d')]=_0xe22712[_0x86855e]['id'];logger[_0x7add('0xf')]('User\x20found:',_0x29c018['userId']);}}}if(!_0xa50cd1){logger[_0x7add('0xf')](_0x7add('0x1e'));_0x29c018[_0x7add('0x1f')]=_0x29c018[_0x7add('0x13')];_0x29c018[_0x7add('0x1d')]=_0x29c018['adminId'];_0xa50cd1=!![];}if(_0xa50cd1){_0x2e9b74(_0x29c018);}else{_0x3a4aca({'statusCode':0x194,'message':_0x7add('0x16')});}}else{_0x3a4aca({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7add('0x17')](function(_0x57b387){logger[_0x7add('0x20')]('['+[_0x1146b6[_0x7add('0x18')]()]+']',_0x57b387[_0x7add('0x19')]);_0x3a4aca(_0x57b387);});});};}function searchContact(_0x49216f,_0x5d37a7,_0x221450,_0x4612b6){return new Promise(function(_0x4667bc,_0x311142){var _0x5953b0={'method':_0x7add('0xd'),'headers':_0x5d37a7,'uri':_0x49216f+_0x7add('0x21')+_0x4612b6+'&f='+_0x221450+_0x7add('0x22'),'json':!![]};rp(_0x5953b0)[_0x7add('0x10')](function(_0x318c59){var _0x1d53e0=_[_0x7add('0x23')](_0x318c59[_0x7add('0x24')][_0x7add('0x24')],[_0x221450,_0x4612b6]);_0x4667bc(_0x1d53e0);})[_0x7add('0x17')](function(_0x41f367){_0x311142(_0x41f367);});});}function getEndUser(_0xbd55b7,_0x184a14,_0x38a355){return function(_0x57b378){return new Promise(function(_0xc11a3f,_0x4c0b38){logger['info'](util[_0x7add('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x57b378['contactNumber']));searchContact(_0x38a355,_0x184a14,_0x7add('0x26'),_0x57b378[_0x7add('0x27')])[_0x7add('0x10')](function(_0x2daafc){if(_0x2daafc){_0x57b378[_0x7add('0x28')]=_0x2daafc['id'];logger[_0x7add('0xf')]('Contact\x20found\x20mobile_number:',_0x57b378[_0x7add('0x28')]);return _0xc11a3f(_0x57b378);}searchContact(_0x38a355,_0x184a14,'work_number',_0x57b378[_0x7add('0x27')])['then'](function(_0xbfd747){if(_0xbfd747){_0x57b378['endUserId']=_0xbfd747['id'];logger[_0x7add('0xf')](_0x7add('0x29'),_0x57b378['endUserId']);return _0xc11a3f(_0x57b378);}createEndUser(_0x57b378,_0xbd55b7,_0x184a14,_0x38a355)[_0x7add('0x10')](function(_0x5dde1a){logger[_0x7add('0xf')](_0x7add('0x2a'),_0x5dde1a['endUserId']);return _0xc11a3f(_0x5dde1a);});});})[_0x7add('0x17')](function(_0x3b6f06){_0x4c0b38(_0x3b6f06);});});};}function createEndUser(_0x38fd1b,_0x5d501f,_0x451c09,_0x55808b){return new Promise(function(_0x2cf2fa,_0x5a4f22){var _0x3ea156=moment();var _0x4deef4={'method':'POST','uri':_0x55808b+_0x7add('0x2b'),'body':{'contact':{'last_name':_0x38fd1b['contactNumber'],'work_number':_0x38fd1b['contactNumber'],'mobile_number':_0x38fd1b[_0x7add('0x27')],'owner_id':_0x38fd1b[_0x7add('0x1d')],'created_at':_0x3ea156[_0x7add('0x25')](_0x7add('0x2c'))}},'json':!![]};_0x4deef4[_0x7add('0x1a')]=_0x451c09;logger[_0x7add('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x4deef4)[_0x7add('0x10')](function(_0x256757){_0x38fd1b['endUserId']=_0x256757[_0x7add('0x2d')]['id'];_0x2cf2fa(_0x38fd1b);})[_0x7add('0x17')](function(_0x4e1aac){logger['error']('['+[_0x5d501f[_0x7add('0x18')]()]+']',_0x4e1aac[_0x7add('0x19')]);_0x5a4f22(_0x4e1aac['message']);});});}function getTicket(_0x338e08,_0x24e962,_0x514f43,_0x27dff9,_0xaa6b71){return function(_0x569a31){logger[_0x7add('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x2237e8,_0x4d2ad5){var _0x7d7305=moment();var _0x32449f={'method':'POST','uri':_0x514f43+_0x7add('0x2e'),'body':{'title':intUtil[_0x7add('0x2f')](_0x27dff9[_0x7add('0x30')],_0xaa6b71,'\x20'),'description':intUtil[_0x7add('0x2f')](_0x27dff9[_0x7add('0x31')],_0xaa6b71,'\x0a'),'owner_id':_0x569a31['userId'],'creater_id':_0x569a31[_0x7add('0x14')],'targetable_id':_0x569a31[_0x7add('0x28')],'targetable_type':'Contact','created_at':_0x7d7305[_0x7add('0x25')](_0x7add('0x2c')),'due_date':_0x7d7305[_0x7add('0x32')](0x1e,'m')[_0x7add('0x25')](_0x7add('0x2c'))},'json':!![]};_0x32449f[_0x7add('0x1a')]=_0x24e962;return rp(_0x32449f)[_0x7add('0x10')](function(_0x57e2ec){_0x569a31['ticketId']=_0x57e2ec['task']['id'];logger[_0x7add('0xf')](_0x7add('0x33'),_0x569a31['ticketId']);_0x2237e8(_0x569a31);})[_0x7add('0x17')](function(_0x58b725){logger['error']('['+[_0x338e08[_0x7add('0x18')]()]+']',_0x58b725[_0x7add('0x19')]);_0x4d2ad5(_0x58b725[_0x7add('0x19')]);});});};}function emit(_0x784c72,_0x38096c,_0x1a05e0){var _0x1f6150={'uri':_0x784c72+'/contacts/'+_0x1a05e0};io['to'](util[_0x7add('0x25')]('user:%s',_0x38096c))[_0x7add('0x34')](_0x7add('0x35'),_0x1f6150);}exports['cs']=function(_0x4cdac9,_0x5e8ef5,_0x1d362e,_0x2c069f,_0xf6fd69,_0x13fa2b,_0x418401,_0x23e1b2){var _0x47ee5a={};var _0x3caff6={'Authorization':_0x7add('0x36')+_0x13fa2b['apiKey']};_0x13fa2b[_0x7add('0x37')]=intUtil['stripTrailingSlash'](_0x13fa2b[_0x7add('0x37')]);_0x13fa2b[_0x7add('0x38')]=intUtil['stripTrailingSlash'](_0x13fa2b[_0x7add('0x38')]);var _0x3595ca=_0x13fa2b[_0x7add('0x37')];_0x47ee5a['adminEmail']=_0x13fa2b[_0x7add('0x39')];_0x47ee5a['contactNumber']=_0x23e1b2[_0x7add('0x3a')]()===_0x7add('0x3b')?_0x5e8ef5[_0x7add('0x3c')]:_0x5e8ef5[_0x7add('0x3d')];_0x47ee5a['callDirection']=_0x23e1b2===_0x7add('0x3e')||_0x23e1b2===_0x7add('0x3f')?_0x7add('0x3e'):_0x7add('0x3b');if(_0x2c069f){_0x47ee5a[_0x7add('0x1b')]=_0x2c069f['email'];}var _0x5534aa=util[_0x7add('0x25')](_0x7add('0x40'),_0x13fa2b['serverUrl'],_0x5e8ef5[_0x7add('0x41')],md5(_0x5e8ef5['uniqueid']));if(_0xf6fd69&&_0xf6fd69[_0x7add('0x42')]){logger['info'](_0x7add('0x43'),_0x7add('0x44'));_0x5e8ef5['recordingURL']=_0x5534aa;}else if(_0x418401&&_0x418401[_0x7add('0x45')]&&_0x418401['recordingFormat']!==_0x7add('0x46')){logger[_0x7add('0xf')](_0x7add('0x47'),_0x7add('0x44'));_0x5e8ef5[_0x7add('0x48')]=_0x5534aa;}else{_0x5e8ef5[_0x7add('0x48')]='';}return getAdminId(_0x47ee5a,_0x23e1b2,_0x3caff6,_0x3595ca)[_0x7add('0x10')](getUser(_0x23e1b2,_0x3caff6,_0x3595ca))[_0x7add('0x10')](getEndUser(_0x23e1b2,_0x3caff6,_0x3595ca))['then'](getTicket(_0x23e1b2,_0x3caff6,_0x3595ca,_0x1d362e,_0x5e8ef5))['then'](function(_0x292fbb){logger[_0x7add('0xf')](util[_0x7add('0x25')](_0x7add('0x49'),_0x292fbb[_0x7add('0x4a')]));if(_0x23e1b2!==_0x7add('0x3f')){logger[_0x7add('0xf')]('['+[_0x23e1b2[_0x7add('0x18')]()]+']',_0x7add('0x4b'));emit(_0x3595ca,_0x2c069f[_0x7add('0x4c')],_0x292fbb[_0x7add('0x28')]);}})[_0x7add('0x17')](function(_0x45d0f2){logger[_0x7add('0x20')]('['+[_0x23e1b2[_0x7add('0x18')]()]+_0x7add('0x4d'),util[_0x7add('0x4e')](_0x45d0f2,{'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 39ae096..75a8369 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 _0x4c23=['./servicenow','zendesk','salesforce','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','freshdesk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./salesforce','./sugarcrm','./freshdesk'];(function(_0xce4cdf,_0x222bb2){var _0x336a1a=function(_0x2141b3){while(--_0x2141b3){_0xce4cdf['push'](_0xce4cdf['shift']());}};_0x336a1a(++_0x222bb2);}(_0x4c23,0x187));var _0x34c2=function(_0x26dd13,_0x3b645f){_0x26dd13=_0x26dd13-0x0;var _0x4a1432=_0x4c23[_0x26dd13];return _0x4a1432;};'use strict';var _=require(_0x34c2('0x0'));var util=require(_0x34c2('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x34c2('0x2'));var sugarcrm=require(_0x34c2('0x3'));var freshdesk=require(_0x34c2('0x4'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x34c2('0x5'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x34c2('0x6'),_0x34c2('0x7'),'sugarcrm','freshdesk',_0x34c2('0x8'),_0x34c2('0x9'),_0x34c2('0xa'),_0x34c2('0xb'),_0x34c2('0xc'),_0x34c2('0xd')];exports[_0x34c2('0xe')]=function(_0x30a529,_0x567562,_0x4877cc,_0xc960c7,_0x5706c5,_0x1d2ef6){if(_0x4877cc){if(_[_0x34c2('0xf')](integrations,_0x30a529[_0x34c2('0x10')][_0x34c2('0x11')]())){try{var _0x3a039c=null;var _0x52c15b='';var _0x589951=_0x4877cc[_0x30a529[_0x34c2('0x10')][_0x34c2('0x11')]()];if(_0x589951){var _0x5d2dab=_0x589951[_0x30a529['data2']];if(_0x5d2dab){var _0x2da82=_[_0x34c2('0x12')](_0x5d2dab[_0x34c2('0x13')],{'id':parseInt(_0x30a529['data3'],0xa)});if(_0x2da82){if(_0xc960c7){if(_0x5706c5&&_0x567562[_0x34c2('0x14')]){_0x52c15b=_0x34c2('0x14');}else if(_0x567562[_0x34c2('0x15')]){_0x52c15b=_0x34c2('0x16');}else{console[_0x34c2('0x17')](_0x34c2('0x18'),_0x567562);}}else{_0x52c15b=_0x34c2('0x19');}switch(_0x30a529[_0x34c2('0x10')][_0x34c2('0x11')]()){case'zendesk':zendesk[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case _0x34c2('0x7'):salesforce[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case _0x34c2('0x1a'):sugarcrm[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case _0x34c2('0x1b'):freshdesk[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case _0x34c2('0x8'):zoho[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case'desk':desk[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case _0x34c2('0xa'):vtiger[_0x52c15b](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6);break;case _0x34c2('0xc'):freshsales['cs'](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6,_0x52c15b);break;case _0x34c2('0xd'):servicenow['cs'](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6,_0x52c15b);break;case'dynamics365':dynamics365['cs'](_0x30a529,_0x567562,_0x2da82,_0xc960c7,_0x5706c5,_0x5d2dab,_0x1d2ef6,_0x52c15b);break;default:console[_0x34c2('0x17')](_0x34c2('0x1c'));}}else{_0x3a039c=require(_0x34c2('0x1d'))(_0x30a529[_0x34c2('0x10')][_0x34c2('0x11')]());_0x3a039c[_0x34c2('0x1e')](_0x34c2('0x1f'),util[_0x34c2('0x20')](_0x34c2('0x21'),_0x30a529['data1'][_0x34c2('0x11')](),_0x30a529['data3']));}}else{_0x3a039c=require(_0x34c2('0x1d'))(_0x30a529['data1'][_0x34c2('0x11')]());_0x3a039c[_0x34c2('0x1e')](_0x34c2('0x1f'),util['format'](_0x34c2('0x22'),_0x30a529[_0x34c2('0x10')]['toLowerCase'](),_0x30a529[_0x34c2('0x23')]));}}else{}}catch(_0x3930be){console[_0x34c2('0x1e')](_0x3930be);}}}}; \ No newline at end of file +var _0xe382=['salesforce','freshdesk','unknown\x20integration','../../../../config/logger','[EXEC]','format','error','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./zoho','./vtiger','./servicenow','./freshsales','sugarcrm','zoho','desk','freshsales','servicenow','exec','includes','toLowerCase','data1','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','zendesk'];(function(_0x1930fe,_0x5f380c){var _0x8c0f33=function(_0x54c1d9){while(--_0x54c1d9){_0x1930fe['push'](_0x1930fe['shift']());}};_0x8c0f33(++_0x5f380c);}(_0xe382,0x1b6));var _0x2e38=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0xe382[_0x28fbbf];return _0x543af6;};'use strict';var _=require('lodash');var util=require(_0x2e38('0x0'));var zendesk=require(_0x2e38('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x2e38('0x2'));var desk=require('./desk');var vtiger=require(_0x2e38('0x3'));var servicenow=require(_0x2e38('0x4'));var dynamics365=require('./dynamics365');var freshsales=require(_0x2e38('0x5'));var integrations=['zendesk','salesforce',_0x2e38('0x6'),'freshdesk',_0x2e38('0x7'),_0x2e38('0x8'),'vtiger','dynamics365',_0x2e38('0x9'),_0x2e38('0xa')];exports[_0x2e38('0xb')]=function(_0x58344c,_0x474d01,_0x43ba55,_0x21214b,_0x30217e,_0x2742f8){if(_0x43ba55){if(_[_0x2e38('0xc')](integrations,_0x58344c['data1'][_0x2e38('0xd')]())){try{var _0xe7c090=null;var _0x298f44='';var _0x1d1d96=_0x43ba55[_0x58344c[_0x2e38('0xe')][_0x2e38('0xd')]()];if(_0x1d1d96){var _0x6c2e33=_0x1d1d96[_0x58344c['data2']];if(_0x6c2e33){var _0x2610aa=_[_0x2e38('0xf')](_0x6c2e33[_0x2e38('0x10')],{'id':parseInt(_0x58344c[_0x2e38('0x11')],0xa)});if(_0x2610aa){if(_0x21214b){if(_0x30217e&&_0x474d01[_0x2e38('0x12')]){_0x298f44=_0x2e38('0x12');}else if(_0x474d01[_0x2e38('0x13')]){_0x298f44='outbound';}else{console[_0x2e38('0x14')](_0x2e38('0x15'),_0x474d01);}}else{_0x298f44=_0x2e38('0x16');}switch(_0x58344c[_0x2e38('0xe')][_0x2e38('0xd')]()){case _0x2e38('0x17'):zendesk[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case _0x2e38('0x18'):salesforce[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case _0x2e38('0x6'):sugarcrm[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case _0x2e38('0x19'):freshdesk[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case'zoho':zoho[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case _0x2e38('0x8'):desk[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case'vtiger':vtiger[_0x298f44](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8);break;case _0x2e38('0x9'):freshsales['cs'](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8,_0x298f44);break;case _0x2e38('0xa'):servicenow['cs'](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8,_0x298f44);break;case'dynamics365':dynamics365['cs'](_0x58344c,_0x474d01,_0x2610aa,_0x21214b,_0x30217e,_0x6c2e33,_0x2742f8,_0x298f44);break;default:console[_0x2e38('0x14')](_0x2e38('0x1a'));}}else{_0xe7c090=require(_0x2e38('0x1b'))(_0x58344c['data1'][_0x2e38('0xd')]());_0xe7c090['error'](_0x2e38('0x1c'),util[_0x2e38('0x1d')]('%s\x20configuration\x20#%s\x20not\x20found',_0x58344c[_0x2e38('0xe')]['toLowerCase'](),_0x58344c['data3']));}}else{_0xe7c090=require('../../../../config/logger')(_0x58344c[_0x2e38('0xe')][_0x2e38('0xd')]());_0xe7c090[_0x2e38('0x1e')](_0x2e38('0x1c'),util[_0x2e38('0x1d')](_0x2e38('0x1f'),_0x58344c[_0x2e38('0xe')][_0x2e38('0xd')](),_0x58344c[_0x2e38('0x20')]));}}else{}}catch(_0x387c42){console[_0x2e38('0x1e')](_0x387c42);}}}}; \ 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 4e8b3e9..496f85f 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 _0xc076=['Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','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','upperFirst','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name'];(function(_0x3abb38,_0x2df2c5){var _0x575680=function(_0x592acf){while(--_0x592acf){_0x3abb38['push'](_0x3abb38['shift']());}};_0x575680(++_0x2df2c5);}(_0xc076,0x1dc));var _0x6c07=function(_0x2d44a8,_0x2f6498){_0x2d44a8=_0x2d44a8-0x0;var _0x4694ac=_0xc076[_0x2d44a8];return _0x4694ac;};'use strict';var _=require(_0x6c07('0x0'));var rp=require(_0x6c07('0x1'));var moment=require(_0x6c07('0x2'));var BPromise=require(_0x6c07('0x3'));var md5=require(_0x6c07('0x4'));var jsforce=require(_0x6c07('0x5'));var util=require(_0x6c07('0x6'));var Redis=require(_0x6c07('0x7'));var intUtil=require(_0x6c07('0x8'));var config=require(_0x6c07('0x9'));var logger=require('../../../../config/logger')(_0x6c07('0xa'));config[_0x6c07('0xb')]=_[_0x6c07('0xc')](config[_0x6c07('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x6c07('0xd'))(new Redis(config[_0x6c07('0xb')]));function emit(_0x3a0d59,_0x326e99,_0x301753){io['to'](_0x3a0d59)['emit'](_0x326e99,_0x301753);}function getTicket(_0x57b352,_0x33a936,_0x1aff14,_0x324564,_0x3b0354,_0x443c0f,_0x2744a4,_0x4eaccc){var _0x5dfa17=Object[_0x6c07('0xe')]({},{'OwnerId':_0x33a936['id'],'Subject':intUtil[_0x6c07('0xf')](_0x324564[_0x6c07('0x10')],_0x3b0354,'\x20'),'Description':intUtil[_0x6c07('0xf')](_0x324564[_0x6c07('0x11')],_0x3b0354,'\x0a')},getCustomFields(_0x443c0f,_0x3b0354));if(_0x1aff14){if(_0x324564[_0x6c07('0x12')]===_0x6c07('0x13')){_0x5dfa17[_0x6c07('0x14')]=moment[_0x6c07('0x15')]();_0x5dfa17[_0x6c07('0x16')]=![];_0x5dfa17[_0x6c07('0x17')]=![];if(_0x1aff14[_0x6c07('0x18')]==='contact'||_0x1aff14[_0x6c07('0x18')]===_0x6c07('0x19')){_0x5dfa17[_0x6c07('0x1a')]=_0x1aff14['id'];}else if(_0x1aff14['endUserType']===_0x6c07('0x1b')){_0x5dfa17['WhatId']=_0x1aff14['id'];}}else if(_0x324564[_0x6c07('0x12')]===_0x6c07('0x1c')){if(_0x1aff14[_0x6c07('0x18')]===_0x6c07('0x1d')){_0x5dfa17[_0x6c07('0x1e')]=_0x1aff14['id'];}else if(_0x1aff14[_0x6c07('0x18')]===_0x6c07('0x1b')){_0x5dfa17[_0x6c07('0x1f')]=_0x1aff14['id'];}else if(_0x1aff14['endUserType']==='lead'&&_0x324564[_0x6c07('0x20')]){_0x5dfa17[_0x324564[_0x6c07('0x20')]]=_0x1aff14['id'];}else{logger[_0x6c07('0x21')](_0x6c07('0x22'));}}}return _0x2744a4[_0x6c07('0x23')](_0x324564[_0x6c07('0x12')])[_0x6c07('0x24')](_0x5dfa17);}function getUser(_0x154208,_0x32f0ce,_0x289adc){if(!_[_0x6c07('0x25')](_0x32f0ce)&&intUtil[_0x6c07('0x26')](_0x32f0ce)){var _0x1a1b5a={'Email':_0x32f0ce};var _0x2bbe3c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x289adc[_0x6c07('0x23')](_0x6c07('0x27'))[_0x6c07('0x28')](_0x1a1b5a,_0x2bbe3c)[_0x6c07('0x29')]()[_0x6c07('0x2a')](function(_0xb0d9a0){if(_0xb0d9a0[_0x6c07('0x2b')]){var _0x5546b2=_[_0x6c07('0x28')](_0xb0d9a0,function(_0x22398f){return _0x22398f[_0x6c07('0x2c')]===_0x32f0ce;});if(_0x5546b2){logger[_0x6c07('0x21')](_0x6c07('0x2d'),_0x32f0ce);return BPromise[_0x6c07('0x2e')]({'id':_0x5546b2['Id'],'name':_0x5546b2[_0x6c07('0x2f')]});}}else{logger[_0x6c07('0x21')](_0x6c07('0x30'),_0x32f0ce);return _0x289adc[_0x6c07('0x31')]()[_0x6c07('0x2a')](function(_0x10c16a){return BPromise[_0x6c07('0x2e')]({'id':_0x10c16a[_0x6c07('0x32')],'name':_0x10c16a[_0x6c07('0x33')]});});}});}else{logger['info'](_0x6c07('0x30'),_0x32f0ce);return _0x289adc['identity']()[_0x6c07('0x2a')](function(_0x2e2746){return BPromise[_0x6c07('0x2e')]({'id':_0x2e2746[_0x6c07('0x32')],'name':_0x2e2746[_0x6c07('0x33')]});});}}function getEndUser(_0x5326ce,_0x17279c,_0x3d540c,_0x37abd8,_0x3e0932){var _0x47aec7={'$or':{'Phone':_0x37abd8}};var _0x2522a8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6c07('0x2e')]()[_0x6c07('0x2a')](function(){logger[_0x6c07('0x21')](_0x6c07('0x34'),_0x37abd8,_0x17279c[_0x6c07('0x35')]);switch(_0x17279c['moduleSearch']){case _0x6c07('0x36'):var _0x441a76=_[_0x6c07('0x37')](_0x47aec7);if(_0x17279c[_0x6c07('0x38')]){var _0x4c6d47={};_0x4c6d47[_0x17279c[_0x6c07('0x38')]]=_0x37abd8;_[_0x6c07('0x39')](_0x441a76['$or'],_0x4c6d47);}return _0x3e0932[_0x6c07('0x23')]('Contact')[_0x6c07('0x28')](_0x441a76,_0x2522a8)['execute']()[_0x6c07('0x2a')](function(_0x491d41){if(_0x491d41&&_0x491d41[_0x6c07('0x2b')]){return _0x491d41;}else{var _0x370ed8=_[_0x6c07('0x37')](_0x47aec7);if(_0x17279c[_0x6c07('0x3a')]){var _0x16db87={};_0x16db87[_0x17279c['additionalSearchLead']]=_0x37abd8;_['merge'](_0x370ed8[_0x6c07('0x3b')],_0x16db87);}return _0x3e0932[_0x6c07('0x23')](_0x6c07('0x3c'))[_0x6c07('0x28')](_0x370ed8,_0x2522a8);}});case _0x6c07('0x3d'):var _0x8c1933=_[_0x6c07('0x37')](_0x47aec7);if(_0x17279c['additionalSearchAccount']){var _0x4c6d47={};_0x4c6d47[_0x17279c[_0x6c07('0x3e')]]=_0x37abd8;_['merge'](_0x8c1933[_0x6c07('0x3b')],_0x4c6d47);}return _0x3e0932[_0x6c07('0x23')](_0x6c07('0x3f'))[_0x6c07('0x28')](_0x8c1933,_0x2522a8)[_0x6c07('0x29')]()[_0x6c07('0x2a')](function(_0x395a9b){if(_0x395a9b&&_0x395a9b[_0x6c07('0x2b')]){return _0x395a9b;}else{var _0x188405=_['cloneDeep'](_0x47aec7);if(_0x17279c[_0x6c07('0x38')]){var _0x264b38={};_0x264b38[_0x17279c['additionalSearchContact']]=_0x37abd8;_[_0x6c07('0x39')](_0x188405[_0x6c07('0x3b')],_0x264b38);}return _0x3e0932['sobject']('Contact')[_0x6c07('0x28')](_0x188405,_0x2522a8)[_0x6c07('0x2a')](function(_0x2c2056){if(_0x2c2056&&_0x2c2056['length']){return _0x2c2056;}else{var _0x333fcf=_[_0x6c07('0x37')](_0x47aec7);if(_0x17279c[_0x6c07('0x3a')]){var _0x5cc374={};_0x5cc374[_0x17279c[_0x6c07('0x3a')]]=_0x37abd8;_['merge'](_0x333fcf['$or'],_0x5cc374);}return _0x3e0932['sobject'](_0x6c07('0x3c'))[_0x6c07('0x28')](_0x333fcf,_0x2522a8);}});}});case _0x6c07('0x1d'):var _0x441a76=_[_0x6c07('0x37')](_0x47aec7);if(_0x17279c['additionalSearchContact']){var _0x4c6d47={};_0x4c6d47[_0x17279c[_0x6c07('0x38')]]=_0x37abd8;_['merge'](_0x441a76[_0x6c07('0x3b')],_0x4c6d47);}return _0x3e0932[_0x6c07('0x23')](_0x6c07('0x40'))[_0x6c07('0x28')](_0x441a76,_0x2522a8)[_0x6c07('0x29')]();case _0x6c07('0x19'):var _0x37bf3e=_['cloneDeep'](_0x47aec7);if(_0x17279c['additionalSearchLead']){var _0x4c6d47={};_0x4c6d47[_0x17279c[_0x6c07('0x3a')]]=_0x37abd8;_[_0x6c07('0x39')](_0x37bf3e[_0x6c07('0x3b')],_0x4c6d47);}return _0x3e0932[_0x6c07('0x23')](_0x6c07('0x3c'))[_0x6c07('0x28')](_0x37bf3e,_0x2522a8);case _0x6c07('0x1b'):var _0x8c1933=_[_0x6c07('0x37')](_0x47aec7);if(_0x17279c[_0x6c07('0x3e')]){var _0x4c6d47={};_0x4c6d47[_0x17279c[_0x6c07('0x3e')]]=_0x37abd8;_[_0x6c07('0x39')](_0x8c1933[_0x6c07('0x3b')],_0x4c6d47);}return _0x3e0932[_0x6c07('0x23')](_0x6c07('0x3f'))[_0x6c07('0x28')](_0x8c1933,_0x2522a8);default:return null;}})['then'](function(_0x477293){if(_0x477293&&_0x477293[_0x6c07('0x2b')]){var _0x50fb1a=_[_0x6c07('0x41')](_0x477293);if(_0x50fb1a){return BPromise['resolve']({'id':_0x50fb1a['Id'],'name':_0x50fb1a['Name'],'phone':_0x50fb1a[_0x6c07('0x42')],'endUserType':_0x50fb1a[_0x6c07('0x43')][_0x6c07('0x44')]['toLowerCase']()});}}})[_0x6c07('0x2a')](function(_0x15be98){if(_0x15be98){logger['info'](_0x6c07('0x45'),_0x15be98[_0x6c07('0x18')],_0x37abd8);return BPromise[_0x6c07('0x2e')](_0x15be98);}else{logger[_0x6c07('0x21')](_0x6c07('0x46'),_0x37abd8);var _0x2cdf5d={'Phone':_0x37abd8};if(_0x17279c[_0x6c07('0x47')]){if(_0x17279c['moduleCreate']===_0x6c07('0x1d')){logger['info'](_0x6c07('0x48'),_0x37abd8,_0x17279c['moduleCreate']);_0x2cdf5d[_0x6c07('0x49')]=_0x3d540c!==_0x6c07('0x4a')?_0x3d540c:util[_0x6c07('0x4b')](_0x6c07('0x4c'),_0x37abd8);}else if(_0x17279c[_0x6c07('0x47')]==='lead'){logger[_0x6c07('0x21')](_0x6c07('0x48'),_0x37abd8,_0x17279c[_0x6c07('0x47')]);_0x2cdf5d[_0x6c07('0x49')]=_0x3d540c!==_0x6c07('0x4a')?_0x3d540c:util[_0x6c07('0x4b')](_0x6c07('0x4c'),_0x37abd8);_0x2cdf5d['Company']='No\x20Company';}else if(_0x17279c['moduleCreate']===_0x6c07('0x1b')){logger[_0x6c07('0x21')](_0x6c07('0x48'),_0x37abd8,_0x17279c[_0x6c07('0x47')]);_0x2cdf5d['Name']=_0x3d540c!==''?_0x3d540c:util[_0x6c07('0x4b')](_0x6c07('0x4c'),_0x37abd8);}else{return null;}}return _0x3e0932[_0x6c07('0x23')](_[_0x6c07('0x4d')](_0x17279c[_0x6c07('0x47')]))[_0x6c07('0x24')](_0x2cdf5d)[_0x6c07('0x2a')](function(_0x16f929){return BPromise['resolve']({'id':_0x16f929['id'],'endUserType':_0x17279c[_0x6c07('0x47')]});});}});}function getCustomFields(_0x231276,_0x4cf2ff){var _0x49b333={};if(_0x231276[_0x6c07('0x2b')]>0x0){_['forEach'](_0x231276,function(_0x431bf2){if(_[_0x6c07('0x4e')]([_0x6c07('0x4f'),'picklist'],_0x431bf2['type'])&&_0x431bf2['idField']){_0x49b333[_0x431bf2[_0x6c07('0x50')]]=_0x431bf2[_0x6c07('0x51')][_0x6c07('0x52')]();}else if(_0x431bf2[_0x6c07('0x44')]===_0x6c07('0x53')&&_0x431bf2[_0x6c07('0x54')]&&_0x431bf2['idField']){_0x4cf2ff[_0x431bf2[_0x6c07('0x54')]]&&(_0x49b333[_0x431bf2[_0x6c07('0x50')]]=_0x4cf2ff[_0x431bf2[_0x6c07('0x54')]][_0x6c07('0x52')]());}else if(_0x431bf2[_0x6c07('0x44')]===_0x6c07('0x55')&&_0x431bf2[_0x6c07('0x56')]&&_0x431bf2[_0x6c07('0x56')][_0x6c07('0x57')]&&_0x431bf2[_0x6c07('0x50')]){_0x4cf2ff[_0x431bf2[_0x6c07('0x56')][_0x6c07('0x57')][_0x6c07('0x58')]()]&&(_0x49b333[_0x431bf2[_0x6c07('0x50')]]=_0x4cf2ff[_0x431bf2[_0x6c07('0x56')]['name'][_0x6c07('0x58')]()][_0x6c07('0x52')]());}});}return _0x49b333;}function getConnection(_0x1d84e8){var _0x2af5e5=_0x1d84e8['password'][_0x6c07('0x59')](_0x1d84e8[_0x6c07('0x5a')]);var _0x3c16b7=new jsforce[(_0x6c07('0x5b'))]({'oauth2':{'loginUrl':_0x1d84e8[_0x6c07('0x5c')]||_0x6c07('0x5d'),'clientId':_0x1d84e8[_0x6c07('0x5e')],'clientSecret':_0x1d84e8[_0x6c07('0x5f')]}});return _0x3c16b7[_0x6c07('0x60')](_0x1d84e8[_0x6c07('0x61')],_0x2af5e5)['then'](function(){logger[_0x6c07('0x21')]('Connection\x20established.');return _0x3c16b7;});}exports['queue']=function(_0x4a343e,_0x464e07,_0xf9c196,_0x52adfb,_0x112d4c,_0x82f173){var _0x419f24,_0x73a88,_0x5c7c65,_0x2c98e9;_0x82f173[_0x6c07('0x62')]=intUtil[_0x6c07('0x63')](_0x82f173[_0x6c07('0x62')]);_0x82f173[_0x6c07('0x5c')]=intUtil['stripTrailingSlash'](_0x82f173[_0x6c07('0x5c')]);if(_0x112d4c&&_0x112d4c[_0x6c07('0x64')]){logger[_0x6c07('0x21')](_0x6c07('0x65'),_0x6c07('0x66'));_0x464e07[_0x6c07('0x67')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x82f173[_0x6c07('0x62')],_0x464e07[_0x6c07('0x68')],md5(_0x464e07[_0x6c07('0x68')]));}else{_0x464e07[_0x6c07('0x67')]='';}return getConnection(_0x82f173)[_0x6c07('0x2a')](function(_0x26c2cb){_0x2c98e9=_0x26c2cb;return getUser(_0x82f173,_0x52adfb[_0x6c07('0x69')],_0x2c98e9);})[_0x6c07('0x2a')](function(_0x11dcc9){_0x419f24=_0x11dcc9;return getEndUser(_0x82f173,_0xf9c196,_0x464e07[_0x6c07('0x6a')],_0x464e07[_0x6c07('0x6b')],_0x2c98e9);})[_0x6c07('0x2a')](function(_0x38b095){_0x73a88=_0x38b095;return getTicket(_0x82f173,_0x419f24,_0x73a88,_0xf9c196,_0x464e07,_0xf9c196[_0x6c07('0x6c')],_0x2c98e9,_0x6c07('0x6d'));})['then'](function(_0x5b6095){_0x5c7c65=_0x5b6095;logger[_0x6c07('0x21')](_0x6c07('0x6e'),_0x5c7c65['id']);logger['info'](_0x6c07('0x6f'),_0x5c7c65['id'],_0x52adfb[_0x6c07('0x57')],_0x82f173[_0x6c07('0x44')]);switch(_0x82f173[_0x6c07('0x44')]){case'integrationTab':emit(util[_0x6c07('0x4b')](_0x6c07('0x70'),_0x52adfb['name']),_0x6c07('0x71'),{'recordId':_0x5c7c65['id']});break;case'newTab':emit(util[_0x6c07('0x4b')](_0x6c07('0x70'),_0x52adfb['name']),_0x6c07('0x72'),{'uri':util[_0x6c07('0x4b')](_0x6c07('0x73'),_0x2c98e9[_0x6c07('0x74')],_0x5c7c65['id'])});break;default:logger[_0x6c07('0x75')](_0x6c07('0x76'));}})['catch'](function(_0x2b2271){logger[_0x6c07('0x75')](_0x6c07('0x65'),_0x2b2271);});};exports['outbound']=function(_0x577959,_0x2c6c55,_0x44fd85,_0x1d9366,_0x9efa7a,_0x2117fe,_0xf570f0){var _0x544a9b,_0x44e4a9,_0x373954,_0x35bcdb;_0x2117fe['serverUrl']=intUtil[_0x6c07('0x63')](_0x2117fe[_0x6c07('0x62')]);_0x2117fe[_0x6c07('0x5c')]=intUtil[_0x6c07('0x63')](_0x2117fe[_0x6c07('0x5c')]);if(_0xf570f0&&_0xf570f0[_0x6c07('0x77')]&&_0xf570f0[_0x6c07('0x77')]!==_0x6c07('0x78')){logger[_0x6c07('0x21')](_0x6c07('0x79'),_0x6c07('0x66'));_0x2c6c55['recordingURL']=util[_0x6c07('0x4b')](_0x6c07('0x7a'),_0x2117fe['serverUrl'],_0x2c6c55[_0x6c07('0x68')],md5(_0x2c6c55[_0x6c07('0x68')]));}return getConnection(_0x2117fe)[_0x6c07('0x2a')](function(_0x1dfdc2){_0x35bcdb=_0x1dfdc2;return getUser(_0x2117fe,_0x1d9366[_0x6c07('0x69')],_0x35bcdb);})[_0x6c07('0x2a')](function(_0x78c66e){_0x544a9b=_0x78c66e;return getEndUser(_0x2117fe,_0x44fd85,_0x2c6c55[_0x6c07('0x7b')],_0x2c6c55[_0x6c07('0x7c')],_0x35bcdb);})[_0x6c07('0x2a')](function(_0x33c1d5){_0x44e4a9=_0x33c1d5;return getTicket(_0x2117fe,_0x544a9b,_0x44e4a9,_0x44fd85,_0x2c6c55,_0x44fd85[_0x6c07('0x6c')],_0x35bcdb,'outbound');})['then'](function(_0x2a068e){_0x373954=_0x2a068e;logger[_0x6c07('0x21')](_0x6c07('0x7d'),_0x373954['id']);logger[_0x6c07('0x21')](_0x6c07('0x7e'),_0x373954['id'],_0x1d9366[_0x6c07('0x57')],_0x2117fe['type']);switch(_0x2117fe[_0x6c07('0x44')]){case _0x6c07('0x7f'):emit(util[_0x6c07('0x4b')](_0x6c07('0x70'),_0x1d9366[_0x6c07('0x57')]),_0x6c07('0x71'),{'recordId':_0x373954['id']});break;case'newTab':emit(util[_0x6c07('0x4b')]('user:%s',_0x1d9366['name']),_0x6c07('0x72'),{'uri':util['format'](_0x6c07('0x73'),_0x35bcdb[_0x6c07('0x74')],_0x373954['id'])});break;default:logger[_0x6c07('0x75')]('[OUTBOUND]',_0x6c07('0x80'));}})['catch'](function(_0x420de1){logger['error'](_0x6c07('0x79'),_0x420de1);});};exports['unmanaged']=function(_0x4f7097,_0x5071b6,_0x1077d5,_0x47ebb6,_0x1a04fd,_0x48b109){var _0x144538,_0x10bbdb,_0x1c7473,_0x48b37c;_0x48b109[_0x6c07('0x62')]=intUtil[_0x6c07('0x63')](_0x48b109[_0x6c07('0x62')]);_0x48b109[_0x6c07('0x5c')]=intUtil[_0x6c07('0x63')](_0x48b109['remoteUri']);if(_0x1a04fd&&_0x1a04fd[_0x6c07('0x64')]){logger[_0x6c07('0x21')]('['+_0x5071b6[_0x6c07('0x81')]['toUpperCase']()+']',_0x6c07('0x66'));_0x5071b6[_0x6c07('0x67')]=util[_0x6c07('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x48b109[_0x6c07('0x62')],_0x5071b6[_0x6c07('0x68')],md5(_0x5071b6[_0x6c07('0x68')]));}else{_0x5071b6[_0x6c07('0x67')]='';}return getConnection(_0x48b109)['then'](function(_0x21ae50){_0x48b37c=_0x21ae50;if(!_[_0x6c07('0x25')](_0x47ebb6)){return getUser(_0x48b109,_0x47ebb6['name'],_0x48b37c);}else{return getUser(_0x48b109,null,_0x48b37c);}})[_0x6c07('0x2a')](function(_0x3c8207){_0x144538=_0x3c8207;return getEndUser(_0x48b109,_0x1077d5,_0x5071b6[_0x6c07('0x6a')],_0x5071b6[_0x6c07('0x6b')],_0x48b37c);})[_0x6c07('0x2a')](function(_0x32892e){_0x10bbdb=_0x32892e;return getTicket(_0x48b109,_0x144538,_0x10bbdb,_0x1077d5,_0x5071b6,_0x1077d5['Fields'],_0x48b37c);})[_0x6c07('0x2a')](function(_0x2e5f1c){_0x1c7473=_0x2e5f1c;logger[_0x6c07('0x21')]('['+_0x5071b6[_0x6c07('0x81')][_0x6c07('0x82')]()+']\x20Ticket\x20%s\x20created.',_0x1c7473['id']);logger[_0x6c07('0x21')]('['+_0x5071b6[_0x6c07('0x81')][_0x6c07('0x82')]()+_0x6c07('0x83'),_0x48b109[_0x6c07('0x44')]);})['catch'](function(_0x3c4181){logger[_0x6c07('0x75')]('['+_0x5071b6[_0x6c07('0x81')][_0x6c07('0x82')]()+']',_0x3c4181);});}; \ No newline at end of file +var _0x45c7=['resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Account','Lead','execute','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','No\x20Company','upperFirst','create','forEach','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','email','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','instanceUrl','[OUTBOUND]','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','length','Email','Agent\x20%s\x20found.'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x45c7,0xdc));var _0x745c=function(_0x577f16,_0x23cd46){_0x577f16=_0x577f16-0x0;var _0x17dda0=_0x45c7[_0x577f16];return _0x17dda0;};'use strict';var _=require(_0x745c('0x0'));var rp=require(_0x745c('0x1'));var moment=require('moment');var BPromise=require(_0x745c('0x2'));var md5=require(_0x745c('0x3'));var jsforce=require(_0x745c('0x4'));var util=require(_0x745c('0x5'));var Redis=require('ioredis');var intUtil=require(_0x745c('0x6'));var config=require(_0x745c('0x7'));var logger=require(_0x745c('0x8'))(_0x745c('0x9'));config[_0x745c('0xa')]=_[_0x745c('0xb')](config[_0x745c('0xa')],{'host':_0x745c('0xc'),'port':0x18eb});var io=require(_0x745c('0xd'))(new Redis(config[_0x745c('0xa')]));function emit(_0x32f450,_0x47ebec,_0x472e83){io['to'](_0x32f450)[_0x745c('0xe')](_0x47ebec,_0x472e83);}function getTicket(_0x4c3ac2,_0x189190,_0x3da328,_0x3d48e0,_0x38441e,_0x3337ee,_0x4aed7b,_0x5ebb96){var _0x46a807=Object[_0x745c('0xf')]({},{'OwnerId':_0x189190['id'],'Subject':intUtil[_0x745c('0x10')](_0x3d48e0[_0x745c('0x11')],_0x38441e,'\x20'),'Description':intUtil['getString'](_0x3d48e0[_0x745c('0x12')],_0x38441e,'\x0a')},getCustomFields(_0x3337ee,_0x38441e));if(_0x3da328){if(_0x3d48e0[_0x745c('0x13')]===_0x745c('0x14')){_0x46a807[_0x745c('0x15')]=moment[_0x745c('0x16')]();_0x46a807[_0x745c('0x17')]=![];_0x46a807[_0x745c('0x18')]=![];if(_0x3da328[_0x745c('0x19')]==='contact'||_0x3da328[_0x745c('0x19')]===_0x745c('0x1a')){_0x46a807[_0x745c('0x1b')]=_0x3da328['id'];}else if(_0x3da328[_0x745c('0x19')]===_0x745c('0x1c')){_0x46a807[_0x745c('0x1d')]=_0x3da328['id'];}}else if(_0x3d48e0[_0x745c('0x13')]==='Case'){if(_0x3da328[_0x745c('0x19')]===_0x745c('0x1e')){_0x46a807[_0x745c('0x1f')]=_0x3da328['id'];}else if(_0x3da328[_0x745c('0x19')]===_0x745c('0x1c')){_0x46a807[_0x745c('0x20')]=_0x3da328['id'];}else if(_0x3da328[_0x745c('0x19')]==='lead'&&_0x3d48e0[_0x745c('0x21')]){_0x46a807[_0x3d48e0[_0x745c('0x21')]]=_0x3da328['id'];}else{logger[_0x745c('0x22')](_0x745c('0x23'));}}}return _0x4aed7b[_0x745c('0x24')](_0x3d48e0[_0x745c('0x13')])['create'](_0x46a807);}function getUser(_0x3b5853,_0x3f3161,_0x1c31fb){if(!_[_0x745c('0x25')](_0x3f3161)&&intUtil[_0x745c('0x26')](_0x3f3161)){var _0x1d0be1={'Email':_0x3f3161};var _0x48dec7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c31fb[_0x745c('0x24')](_0x745c('0x27'))[_0x745c('0x28')](_0x1d0be1,_0x48dec7)['execute']()['then'](function(_0x448f8e){if(_0x448f8e[_0x745c('0x29')]){var _0x76f313=_['find'](_0x448f8e,function(_0x255e44){return _0x255e44[_0x745c('0x2a')]===_0x3f3161;});if(_0x76f313){logger[_0x745c('0x22')](_0x745c('0x2b'),_0x3f3161);return BPromise[_0x745c('0x2c')]({'id':_0x76f313['Id'],'name':_0x76f313[_0x745c('0x2d')]});}}else{logger[_0x745c('0x22')](_0x745c('0x2e'),_0x3f3161);return _0x1c31fb[_0x745c('0x2f')]()[_0x745c('0x30')](function(_0x59bfdf){return BPromise['resolve']({'id':_0x59bfdf['user_id'],'name':_0x59bfdf['display_name']});});}});}else{logger[_0x745c('0x22')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3f3161);return _0x1c31fb[_0x745c('0x2f')]()[_0x745c('0x30')](function(_0x4ee7a5){return BPromise['resolve']({'id':_0x4ee7a5[_0x745c('0x31')],'name':_0x4ee7a5['display_name']});});}}function getEndUser(_0xfbc6f9,_0x166723,_0x2b3ee8,_0x2ad1b2,_0x419490){var _0xf35c6e={'$or':{'Phone':_0x2ad1b2}};var _0x290f63={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x745c('0x2c')]()[_0x745c('0x30')](function(){logger['info'](_0x745c('0x32'),_0x2ad1b2,_0x166723[_0x745c('0x33')]);switch(_0x166723['moduleSearch']){case _0x745c('0x34'):var _0xf5f276=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x36')]){var _0x1e7648={};_0x1e7648[_0x166723[_0x745c('0x36')]]=_0x2ad1b2;_['merge'](_0xf5f276[_0x745c('0x37')],_0x1e7648);}return _0x419490[_0x745c('0x24')](_0x745c('0x38'))['find'](_0xf5f276,_0x290f63)['execute']()[_0x745c('0x30')](function(_0x48c22a){if(_0x48c22a&&_0x48c22a['length']){return _0x48c22a;}else{var _0x59076a=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x39')]){var _0x1d8aa6={};_0x1d8aa6[_0x166723[_0x745c('0x39')]]=_0x2ad1b2;_[_0x745c('0x3a')](_0x59076a[_0x745c('0x37')],_0x1d8aa6);}return _0x419490['sobject']('Lead')[_0x745c('0x28')](_0x59076a,_0x290f63);}});case _0x745c('0x3b'):var _0xb03287=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x3c')]){var _0x1e7648={};_0x1e7648[_0x166723[_0x745c('0x3c')]]=_0x2ad1b2;_[_0x745c('0x3a')](_0xb03287[_0x745c('0x37')],_0x1e7648);}return _0x419490['sobject'](_0x745c('0x3d'))[_0x745c('0x28')](_0xb03287,_0x290f63)['execute']()[_0x745c('0x30')](function(_0x30e2ee){if(_0x30e2ee&&_0x30e2ee['length']){return _0x30e2ee;}else{var _0x82ba2d=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723['additionalSearchContact']){var _0x452197={};_0x452197[_0x166723[_0x745c('0x36')]]=_0x2ad1b2;_['merge'](_0x82ba2d['$or'],_0x452197);}return _0x419490[_0x745c('0x24')]('Contact')[_0x745c('0x28')](_0x82ba2d,_0x290f63)[_0x745c('0x30')](function(_0x4ee055){if(_0x4ee055&&_0x4ee055[_0x745c('0x29')]){return _0x4ee055;}else{var _0x38a5d0=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x39')]){var _0x2359fd={};_0x2359fd[_0x166723[_0x745c('0x39')]]=_0x2ad1b2;_[_0x745c('0x3a')](_0x38a5d0[_0x745c('0x37')],_0x2359fd);}return _0x419490[_0x745c('0x24')](_0x745c('0x3e'))['find'](_0x38a5d0,_0x290f63);}});}});case _0x745c('0x1e'):var _0xf5f276=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x36')]){var _0x1e7648={};_0x1e7648[_0x166723[_0x745c('0x36')]]=_0x2ad1b2;_[_0x745c('0x3a')](_0xf5f276[_0x745c('0x37')],_0x1e7648);}return _0x419490[_0x745c('0x24')](_0x745c('0x38'))['find'](_0xf5f276,_0x290f63)[_0x745c('0x3f')]();case'lead':var _0x14e1cc=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x39')]){var _0x1e7648={};_0x1e7648[_0x166723[_0x745c('0x39')]]=_0x2ad1b2;_['merge'](_0x14e1cc[_0x745c('0x37')],_0x1e7648);}return _0x419490[_0x745c('0x24')]('Lead')['find'](_0x14e1cc,_0x290f63);case'account':var _0xb03287=_[_0x745c('0x35')](_0xf35c6e);if(_0x166723[_0x745c('0x3c')]){var _0x1e7648={};_0x1e7648[_0x166723[_0x745c('0x3c')]]=_0x2ad1b2;_[_0x745c('0x3a')](_0xb03287['$or'],_0x1e7648);}return _0x419490[_0x745c('0x24')](_0x745c('0x3d'))[_0x745c('0x28')](_0xb03287,_0x290f63);default:return null;}})['then'](function(_0x223843){if(_0x223843&&_0x223843[_0x745c('0x29')]){var _0x32b51f=_[_0x745c('0x40')](_0x223843);if(_0x32b51f){return BPromise[_0x745c('0x2c')]({'id':_0x32b51f['Id'],'name':_0x32b51f[_0x745c('0x2d')],'phone':_0x32b51f[_0x745c('0x41')],'endUserType':_0x32b51f[_0x745c('0x42')][_0x745c('0x43')][_0x745c('0x44')]()});}}})['then'](function(_0x8de19e){if(_0x8de19e){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x8de19e['endUserType'],_0x2ad1b2);return BPromise[_0x745c('0x2c')](_0x8de19e);}else{logger[_0x745c('0x22')](_0x745c('0x45'),_0x2ad1b2);var _0x46c2cd={'Phone':_0x2ad1b2};if(_0x166723[_0x745c('0x46')]){if(_0x166723['moduleCreate']===_0x745c('0x1e')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2ad1b2,_0x166723[_0x745c('0x46')]);_0x46c2cd[_0x745c('0x47')]=_0x2b3ee8!==''?_0x2b3ee8:util['format'](_0x745c('0x48'),_0x2ad1b2);}else if(_0x166723[_0x745c('0x46')]===_0x745c('0x1a')){logger['info'](_0x745c('0x49'),_0x2ad1b2,_0x166723[_0x745c('0x46')]);_0x46c2cd[_0x745c('0x47')]=_0x2b3ee8!==_0x745c('0x4a')?_0x2b3ee8:util[_0x745c('0x4b')](_0x745c('0x48'),_0x2ad1b2);_0x46c2cd['Company']=_0x745c('0x4c');}else if(_0x166723[_0x745c('0x46')]===_0x745c('0x1c')){logger[_0x745c('0x22')](_0x745c('0x49'),_0x2ad1b2,_0x166723['moduleCreate']);_0x46c2cd['Name']=_0x2b3ee8!==_0x745c('0x4a')?_0x2b3ee8:util['format']('Caller\x20-\x20%s',_0x2ad1b2);}else{return null;}}return _0x419490[_0x745c('0x24')](_[_0x745c('0x4d')](_0x166723[_0x745c('0x46')]))[_0x745c('0x4e')](_0x46c2cd)[_0x745c('0x30')](function(_0x6c64e8){return BPromise[_0x745c('0x2c')]({'id':_0x6c64e8['id'],'endUserType':_0x166723[_0x745c('0x46')]});});}});}function getCustomFields(_0x507a53,_0x4c48f1){var _0x3cb72a={};if(_0x507a53[_0x745c('0x29')]>0x0){_[_0x745c('0x4f')](_0x507a53,function(_0x2120a3){if(_['includes']([_0x745c('0x50'),_0x745c('0x51')],_0x2120a3['type'])&&_0x2120a3['idField']){_0x3cb72a[_0x2120a3[_0x745c('0x52')]]=_0x2120a3[_0x745c('0x53')]['toString']();}else if(_0x2120a3[_0x745c('0x43')]===_0x745c('0x54')&&_0x2120a3[_0x745c('0x55')]&&_0x2120a3[_0x745c('0x52')]){_0x4c48f1[_0x2120a3[_0x745c('0x55')]]&&(_0x3cb72a[_0x2120a3[_0x745c('0x52')]]=_0x4c48f1[_0x2120a3[_0x745c('0x55')]][_0x745c('0x56')]());}else if(_0x2120a3[_0x745c('0x43')]===_0x745c('0x57')&&_0x2120a3['Variable']&&_0x2120a3[_0x745c('0x58')][_0x745c('0x59')]&&_0x2120a3['idField']){_0x4c48f1[_0x2120a3['Variable'][_0x745c('0x59')][_0x745c('0x44')]()]&&(_0x3cb72a[_0x2120a3['idField']]=_0x4c48f1[_0x2120a3[_0x745c('0x58')][_0x745c('0x59')]['toLowerCase']()][_0x745c('0x56')]());}});}return _0x3cb72a;}function getConnection(_0x5bccd6){var _0x2bac3c=_0x5bccd6[_0x745c('0x5a')][_0x745c('0x5b')](_0x5bccd6['securityToken']);var _0xfc3337=new jsforce[(_0x745c('0x5c'))]({'oauth2':{'loginUrl':_0x5bccd6[_0x745c('0x5d')]||_0x745c('0x5e'),'clientId':_0x5bccd6[_0x745c('0x5f')],'clientSecret':_0x5bccd6[_0x745c('0x60')]}});return _0xfc3337[_0x745c('0x61')](_0x5bccd6[_0x745c('0x62')],_0x2bac3c)[_0x745c('0x30')](function(){logger[_0x745c('0x22')]('Connection\x20established.');return _0xfc3337;});}exports[_0x745c('0x63')]=function(_0x4f860e,_0x394aed,_0x4199a0,_0x531579,_0x510b61,_0x690da){var _0x52c3fd,_0x4613eb,_0x35946f,_0x2138ea;_0x690da[_0x745c('0x64')]=intUtil[_0x745c('0x65')](_0x690da['serverUrl']);_0x690da[_0x745c('0x5d')]=intUtil[_0x745c('0x65')](_0x690da[_0x745c('0x5d')]);if(_0x510b61&&_0x510b61['monitor_format']){logger['info']('[QUEUE]',_0x745c('0x66'));_0x394aed[_0x745c('0x67')]=util['format'](_0x745c('0x68'),_0x690da['serverUrl'],_0x394aed[_0x745c('0x69')],md5(_0x394aed[_0x745c('0x69')]));}else{_0x394aed['recordingURL']='';}return getConnection(_0x690da)[_0x745c('0x30')](function(_0x2dd3be){_0x2138ea=_0x2dd3be;return getUser(_0x690da,_0x531579['email'],_0x2138ea);})[_0x745c('0x30')](function(_0x1af2c4){_0x52c3fd=_0x1af2c4;return getEndUser(_0x690da,_0x4199a0,_0x394aed[_0x745c('0x6a')],_0x394aed[_0x745c('0x6b')],_0x2138ea);})['then'](function(_0x4ae82a){_0x4613eb=_0x4ae82a;return getTicket(_0x690da,_0x52c3fd,_0x4613eb,_0x4199a0,_0x394aed,_0x4199a0[_0x745c('0x6c')],_0x2138ea,_0x745c('0x63'));})['then'](function(_0x53561a){_0x35946f=_0x53561a;logger[_0x745c('0x22')](_0x745c('0x6d'),_0x35946f['id']);logger[_0x745c('0x22')](_0x745c('0x6e'),_0x35946f['id'],_0x531579['name'],_0x690da['type']);switch(_0x690da[_0x745c('0x43')]){case _0x745c('0x6f'):emit(util[_0x745c('0x4b')]('user:%s',_0x531579[_0x745c('0x59')]),_0x745c('0x70'),{'recordId':_0x35946f['id']});break;case _0x745c('0x71'):emit(util[_0x745c('0x4b')]('user:%s',_0x531579[_0x745c('0x59')]),_0x745c('0x72'),{'uri':util['format'](_0x745c('0x73'),_0x2138ea['instanceUrl'],_0x35946f['id'])});break;default:logger[_0x745c('0x74')](_0x745c('0x75'));}})[_0x745c('0x76')](function(_0x3c87e3){logger[_0x745c('0x74')]('[QUEUE]',_0x3c87e3);});};exports[_0x745c('0x77')]=function(_0x2c6b82,_0x5eb9b6,_0x3c0f13,_0x9db56f,_0x42d960,_0x136863,_0x448ac1){var _0x202100,_0x161506,_0x4ba6d3,_0xcd1395;_0x136863['serverUrl']=intUtil[_0x745c('0x65')](_0x136863['serverUrl']);_0x136863['remoteUri']=intUtil[_0x745c('0x65')](_0x136863[_0x745c('0x5d')]);if(_0x448ac1&&_0x448ac1[_0x745c('0x78')]&&_0x448ac1['recordingFormat']!=='none'){logger[_0x745c('0x22')]('[OUTBOUND]',_0x745c('0x66'));_0x5eb9b6[_0x745c('0x67')]=util[_0x745c('0x4b')](_0x745c('0x68'),_0x136863[_0x745c('0x64')],_0x5eb9b6[_0x745c('0x69')],md5(_0x5eb9b6[_0x745c('0x69')]));}return getConnection(_0x136863)[_0x745c('0x30')](function(_0x4ea41e){_0xcd1395=_0x4ea41e;return getUser(_0x136863,_0x9db56f[_0x745c('0x79')],_0xcd1395);})[_0x745c('0x30')](function(_0x320615){_0x202100=_0x320615;return getEndUser(_0x136863,_0x3c0f13,_0x5eb9b6['destcalleridname'],_0x5eb9b6[_0x745c('0x7a')],_0xcd1395);})['then'](function(_0x579026){_0x161506=_0x579026;return getTicket(_0x136863,_0x202100,_0x161506,_0x3c0f13,_0x5eb9b6,_0x3c0f13['Fields'],_0xcd1395,_0x745c('0x77'));})[_0x745c('0x30')](function(_0x58a624){_0x4ba6d3=_0x58a624;logger['info'](_0x745c('0x7b'),_0x4ba6d3['id']);logger['info'](_0x745c('0x7c'),_0x4ba6d3['id'],_0x9db56f[_0x745c('0x59')],_0x136863['type']);switch(_0x136863[_0x745c('0x43')]){case'integrationTab':emit(util[_0x745c('0x4b')](_0x745c('0x7d'),_0x9db56f['name']),'trigger:salesforce:display',{'recordId':_0x4ba6d3['id']});break;case _0x745c('0x71'):emit(util[_0x745c('0x4b')]('user:%s',_0x9db56f[_0x745c('0x59')]),_0x745c('0x72'),{'uri':util['format']('%s/%s/e',_0xcd1395[_0x745c('0x7e')],_0x4ba6d3['id'])});break;default:logger[_0x745c('0x74')](_0x745c('0x7f'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x4cc52f){logger[_0x745c('0x74')](_0x745c('0x7f'),_0x4cc52f);});};exports['unmanaged']=function(_0x365dd4,_0x521e56,_0x40e9bf,_0x1eb5fa,_0x22507e,_0x2cff81){var _0x4505fd,_0x59fc8b,_0x5d1519,_0x360e88;_0x2cff81[_0x745c('0x64')]=intUtil[_0x745c('0x65')](_0x2cff81[_0x745c('0x64')]);_0x2cff81[_0x745c('0x5d')]=intUtil[_0x745c('0x65')](_0x2cff81['remoteUri']);if(_0x22507e&&_0x22507e[_0x745c('0x80')]){logger['info']('['+_0x521e56[_0x745c('0x81')][_0x745c('0x82')]()+']',_0x745c('0x66'));_0x521e56[_0x745c('0x67')]=util[_0x745c('0x4b')](_0x745c('0x68'),_0x2cff81[_0x745c('0x64')],_0x521e56[_0x745c('0x69')],md5(_0x521e56['uniqueid']));}else{_0x521e56['recordingURL']='';}return getConnection(_0x2cff81)[_0x745c('0x30')](function(_0x5e7807){_0x360e88=_0x5e7807;if(!_[_0x745c('0x25')](_0x1eb5fa)){return getUser(_0x2cff81,_0x1eb5fa[_0x745c('0x59')],_0x360e88);}else{return getUser(_0x2cff81,null,_0x360e88);}})[_0x745c('0x30')](function(_0x1abd0f){_0x4505fd=_0x1abd0f;return getEndUser(_0x2cff81,_0x40e9bf,_0x521e56[_0x745c('0x6a')],_0x521e56[_0x745c('0x6b')],_0x360e88);})['then'](function(_0x3e2ba2){_0x59fc8b=_0x3e2ba2;return getTicket(_0x2cff81,_0x4505fd,_0x59fc8b,_0x40e9bf,_0x521e56,_0x40e9bf['Fields'],_0x360e88);})[_0x745c('0x30')](function(_0x3650c3){_0x5d1519=_0x3650c3;logger['info']('['+_0x521e56[_0x745c('0x81')][_0x745c('0x82')]()+_0x745c('0x83'),_0x5d1519['id']);logger[_0x745c('0x22')]('['+_0x521e56['lastevent'][_0x745c('0x82')]()+']\x20Integration\x20account\x20type\x20%s.',_0x2cff81[_0x745c('0x43')]);})[_0x745c('0x76')](function(_0x49aef3){logger[_0x745c('0x74')]('['+_0x521e56['lastevent'][_0x745c('0x82')]()+']',_0x49aef3);});}; \ 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 4dc8579..8a34422 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 _0xbcb5=['sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','catch','error','message','info','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','%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','format','user:%s','emit','username'];(function(_0x1ade14,_0x1087a3){var _0x272ae1=function(_0x1ca5fe){while(--_0x1ca5fe){_0x1ade14['push'](_0x1ade14['shift']());}};_0x272ae1(++_0x1087a3);}(_0xbcb5,0x1c1));var _0x5bcb=function(_0x53f828,_0x238035){_0x53f828=_0x53f828-0x0;var _0x17a6a3=_0xbcb5[_0x53f828];return _0x17a6a3;};'use strict';var _=require(_0x5bcb('0x0'));var Promise=require('bluebird');var rp=require(_0x5bcb('0x1'));var util=require('util');var md5=require(_0x5bcb('0x2'));var Redis=require(_0x5bcb('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x5bcb('0x4'))(_0x5bcb('0x5'));config[_0x5bcb('0x6')]=_[_0x5bcb('0x7')](config[_0x5bcb('0x6')],{'host':_0x5bcb('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5bcb('0x6')]));function getAdminUser(_0x5937f2,_0x37f538,_0x20836a,_0x116685,_0x228536,_0x30f0cf){return new Promise(function(_0x574aa0,_0x122936){var _0x1b4ef3={'method':_0x5bcb('0x9'),'uri':_0x116685+_0x5bcb('0xa')+'&'+_0x228536+'&'+_0x30f0cf,'auth':_0x37f538,'json':!![]};return rp(_0x1b4ef3)[_0x5bcb('0xb')](function(_0x203398){if(_0x203398[_0x5bcb('0xc')][_0x5bcb('0xd')]>0x0){_0x20836a[_0x5bcb('0xe')]=_0x203398[_0x5bcb('0xc')][0x0][_0x5bcb('0xf')];}logger['info']('['+[_0x5937f2[_0x5bcb('0x10')]()]+'],\x20getAdminUser\x20crm',_0x20836a);_0x574aa0(_0x20836a);})[_0x5bcb('0x11')](function(_0x57af91){logger[_0x5bcb('0x12')]('['+[_0x5937f2[_0x5bcb('0x10')]()]+']',_0x57af91[_0x5bcb('0x13')]);_0x122936(_0x57af91['message']);});});}function getUser(_0x5db856,_0x44603b,_0x396e78,_0x7cd4e8,_0x13b370){return function(_0x4c385b){logger[_0x5bcb('0x14')]('['+[_0x5db856[_0x5bcb('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x4c385b);return new Promise(function(_0x207960,_0x4a283c){if(intUtil['validateEmail'](_0x4c385b[_0x5bcb('0x15')])){var _0x5df2c6={'method':_0x5bcb('0x9'),'uri':_0x396e78+_0x5bcb('0x16')+_0x4c385b['userEmail']+'&'+_0x7cd4e8+'&'+_0x13b370,'auth':_0x44603b,'json':!![]};logger['info']('['+[_0x5db856[_0x5bcb('0x10')]()]+_0x5bcb('0x17'),_0x5df2c6);return rp(_0x5df2c6)[_0x5bcb('0xb')](function(_0x11c188){logger[_0x5bcb('0x14')]('['+[_0x5db856['toUpperCase']()]+_0x5bcb('0x18'),_0x11c188);if(_0x11c188[_0x5bcb('0xc')][_0x5bcb('0xd')]>0x0&&String(_0x11c188['result'][0x0][_0x5bcb('0x19')])===_0x5bcb('0x1a')){_0x4c385b[_0x5bcb('0x1b')]=_0x11c188[_0x5bcb('0xc')][0x0][_0x5bcb('0xf')];}else{_0x4c385b['userId']=_0x4c385b[_0x5bcb('0xe')];_0x4c385b[_0x5bcb('0x15')]=_0x4c385b[_0x5bcb('0x1c')];}logger[_0x5bcb('0x14')]('['+[_0x5db856['toUpperCase']()]+_0x5bcb('0x1d'),_0x4c385b);_0x207960(_0x4c385b);})['catch'](function(_0x51355f){logger['error']('['+[_0x5db856[_0x5bcb('0x10')]()]+']',_0x51355f['message']);_0x4a283c(_0x51355f[_0x5bcb('0x13')]);});}else{logger[_0x5bcb('0x14')]('['+[_0x5db856['toUpperCase']()]+_0x5bcb('0x1e'));_0x4c385b[_0x5bcb('0x1b')]=_0x4c385b[_0x5bcb('0xe')];_0x4c385b[_0x5bcb('0x15')]=_0x4c385b['adminEmail'];_0x207960(_0x4c385b);}});};}function createEndUser(_0x52e287,_0x5727fd,_0x2bbfa8,_0x467800,_0x3b4723){logger[_0x5bcb('0x14')]('['+[_0x52e287['toUpperCase']()]+_0x5bcb('0x1f'),_0x2bbfa8);return new Promise(function(_0x57c3d6,_0x136a3b){var _0x59a99d={'method':_0x5bcb('0x20'),'uri':_0x467800+'sys_user?'+_0x3b4723,'body':{'user_name':_0x2bbfa8['endUserNumber'],'roles':'user','first_name':_0x2bbfa8[_0x5bcb('0x21')],'active':'true','date_format':_0x5bcb('0x22'),'phone':_0x2bbfa8[_0x5bcb('0x21')]},'auth':_0x5727fd,'json':!![]};return rp(_0x59a99d)['then'](function(_0x5b7f3f){logger[_0x5bcb('0x14')]('['+[_0x52e287[_0x5bcb('0x10')]()]+'],\x20EndUser\x20schema',_0x5b7f3f['result']);_0x2bbfa8[_0x5bcb('0x23')]=_0x5b7f3f[_0x5bcb('0xc')]['sys_id'];_0x57c3d6(_0x2bbfa8);})[_0x5bcb('0x11')](function(_0x341b3c){logger[_0x5bcb('0x12')]('['+[_0x52e287[_0x5bcb('0x10')]()]+']',_0x341b3c[_0x5bcb('0x13')]);_0x136a3b(_0x341b3c[_0x5bcb('0x13')]);});});}function getEndUser(_0xa9166,_0x5aa7c9,_0x1ed0b7,_0x40cd3a,_0x3383df){return function(_0x476908){logger[_0x5bcb('0x14')]('['+[_0xa9166[_0x5bcb('0x10')]()]+_0x5bcb('0x24'),_0x476908);return new Promise(function(_0x42dbc4,_0x3df9be){var _0xd47702={'method':_0x5bcb('0x9'),'uri':_0x1ed0b7+_0x5bcb('0x25')+_0x476908[_0x5bcb('0x21')]+'&'+_0x40cd3a+'&'+_0x3383df,'auth':_0x5aa7c9,'json':!![]};return rp(_0xd47702)[_0x5bcb('0xb')](function(_0x20ff0a){if(_0x20ff0a['result'][_0x5bcb('0xd')]>0x0){_0x476908[_0x5bcb('0x23')]=_0x20ff0a[_0x5bcb('0xc')][0x0][_0x5bcb('0xf')];logger['info']('['+[_0xa9166[_0x5bcb('0x10')]()]+_0x5bcb('0x26'),_0x476908);_0x42dbc4(_0x476908);}else{return createEndUser(_0xa9166,_0x5aa7c9,_0x476908,_0x1ed0b7,_0x40cd3a)['then'](function(_0x1a9deb){logger[_0x5bcb('0x14')]('['+[_0xa9166[_0x5bcb('0x10')]()]+_0x5bcb('0x27'),_0x1a9deb);_0x42dbc4(_0x1a9deb);});}})[_0x5bcb('0x11')](function(_0xcf2d1f){logger[_0x5bcb('0x12')]('['+[_0xa9166[_0x5bcb('0x10')]()]+']',_0xcf2d1f['message']);_0x3df9be(_0xcf2d1f[_0x5bcb('0x13')]);});});};}function getCustomFields(_0x44df7b,_0x5d6f46){var _0x57a781={};if(_0x44df7b['length']>0x0){_['forEach'](_0x44df7b,function(_0x195db7){if(_[_0x5bcb('0x28')]([_0x5bcb('0x29'),_0x5bcb('0x2a')],_0x195db7[_0x5bcb('0x2b')])&&_0x195db7[_0x5bcb('0x2c')]&&!_0x195db7['customField']){_0x57a781[_0x195db7[_0x5bcb('0x2c')][_0x5bcb('0x2d')]()]=_0x195db7[_0x5bcb('0x2e')][_0x5bcb('0x2f')]();}else if(_[_0x5bcb('0x28')]([_0x5bcb('0x29'),_0x5bcb('0x2a')],_0x195db7[_0x5bcb('0x2b')])&&_0x195db7[_0x5bcb('0x30')]&&_0x195db7[_0x5bcb('0x31')]){_0x57a781[_0x195db7[_0x5bcb('0x30')][_0x5bcb('0x2d')]()]=_0x195db7['content'][_0x5bcb('0x2f')]();}else if(_0x195db7[_0x5bcb('0x2b')]===_0x5bcb('0x32')&&_0x195db7[_0x5bcb('0x33')]&&_0x195db7[_0x5bcb('0x30')]&&_0x195db7[_0x5bcb('0x31')]){_0x57a781[_0x195db7[_0x5bcb('0x30')]['toLowerCase']()]=_0x5d6f46[_0x195db7[_0x5bcb('0x33')]][_0x5bcb('0x2f')]();}else if(_0x195db7[_0x5bcb('0x2b')]===_0x5bcb('0x34')&&_0x195db7[_0x5bcb('0x35')]&&_0x195db7[_0x5bcb('0x35')][_0x5bcb('0x36')]&&_0x195db7['idField']&&_0x195db7[_0x5bcb('0x31')]){_0x57a781[_0x195db7[_0x5bcb('0x30')][_0x5bcb('0x2d')]()]=_0x5d6f46[_0x195db7['Variable'][_0x5bcb('0x36')][_0x5bcb('0x2d')]()][_0x5bcb('0x2f')]();}});}return _0x57a781;}function getTicket(_0x49d081,_0x1a863c,_0x5df65b,_0x38046d,_0x359eb2,_0x221c20){return function(_0x192ff){logger[_0x5bcb('0x14')]('['+[_0x49d081[_0x5bcb('0x10')]()]+_0x5bcb('0x37'),_0x192ff);return new Promise(function(_0x441c96,_0x53bb1b){var _0x2fd8ea=_0x49d081[_0x5bcb('0x2d')]()===_0x5bcb('0x38')?_0x192ff['userId']:_0x192ff[_0x5bcb('0x23')];var _0x1874b5={'method':_0x5bcb('0x20'),'uri':_0x5df65b+_0x5bcb('0x39')+'?'+_0x221c20,'body':Object['assign']({},{'active':_0x5bcb('0x1a'),'caller_id':_0x2fd8ea,'assigned_to':_0x192ff[_0x5bcb('0x1b')],'short_description':intUtil[_0x5bcb('0x3a')](_0x38046d['Subjects'],_0x359eb2,'\x20'),'description':intUtil['getString'](_0x38046d[_0x5bcb('0x3b')],_0x359eb2,'\x0a')},getCustomFields(_0x38046d[_0x5bcb('0x3c')],_0x359eb2)),'auth':_0x1a863c,'json':!![]};return rp(_0x1874b5)['then'](function(_0x51ea62){logger[_0x5bcb('0x14')]('['+[_0x49d081['toUpperCase']()]+_0x5bcb('0x3d'),_0x51ea62[_0x5bcb('0xc')]);_0x192ff[_0x5bcb('0x3e')]=_0x51ea62['result'][_0x5bcb('0xf')];_0x192ff[_0x5bcb('0x3f')]=_0x51ea62[_0x5bcb('0xc')][_0x5bcb('0x40')];logger[_0x5bcb('0x14')]('['+[_0x49d081[_0x5bcb('0x10')]()]+']\x20getTicket\x20crm',_0x192ff);_0x441c96(_0x192ff);})['catch'](function(_0xacebac){logger[_0x5bcb('0x12')]('['+[_0x49d081[_0x5bcb('0x10')]()]+']',_0xacebac[_0x5bcb('0x13')]);_0x53bb1b(_0xacebac['message']);});});};}function createRemoteTag(_0x29094a,_0x186a63,_0x5190cf,_0x515466){return new Promise(function(_0xb713de,_0x1cc5a0){var _0x2c5d72={'method':_0x5bcb('0x20'),'uri':_0x5190cf+_0x5bcb('0x41')+'?'+_0x515466,'body':{'short_description':_0x29094a,'global':!![],'active':!![],'name':_0x29094a},'auth':_0x186a63,'json':!![]};return rp(_0x2c5d72)['then'](function(_0x54cd28){var _0x573b26=_0x54cd28[_0x5bcb('0xc')]['sys_id'];_0xb713de(_0x573b26);});});}function getRemoteTag(_0x28caa9,_0x7662,_0x279da0,_0x21144a,_0x236828){return new Promise(function(_0x51d4d5,_0x157b82){var _0x593cc7={'method':_0x5bcb('0x9'),'uri':_0x279da0+_0x5bcb('0x41')+_0x5bcb('0x42')+_0x28caa9+'&'+_0x21144a,'auth':_0x7662,'json':!![]};return rp(_0x593cc7)['then'](function(_0xf3947){if(_0xf3947[_0x5bcb('0xc')][_0x5bcb('0xd')]>0x0){var _0x43a04d=_0xf3947[_0x5bcb('0xc')][0x0][_0x5bcb('0xf')];_0x51d4d5(_0x43a04d);}else{return createRemoteTag(_0x28caa9,_0x7662,_0x279da0,_0x21144a)[_0x5bcb('0xb')](function(_0x124bb4){_0x51d4d5(_0x124bb4);});}});});}function assignTagToIncident(_0x4a546c,_0x37b2b3,_0x4b50e9,_0x3ca767,_0x20386f){return new Promise(function(_0x34b94a,_0x3b321d){var _0x3c1d60={'method':_0x5bcb('0x20'),'uri':_0x4b50e9+'label_entry'+'?'+_0x20386f,'body':{'label':_0x4a546c,'table':_0x5bcb('0x39'),'id_type':_0x5bcb('0x43'),'table_key':_0x3ca767[_0x5bcb('0x3e')],'title':_0x5bcb('0x44')+_0x3ca767['ticketNumber'],'id_display':_0x3ca767[_0x5bcb('0x3f')]},'auth':_0x37b2b3,'json':!![]};return rp(_0x3c1d60)[_0x5bcb('0xb')](function(_0x655e1e){_0x34b94a();})['catch'](function(){_0x34b94a();});});}function manageTags(_0x246d9c,_0x402d95,_0x2e9d78,_0x56ce53,_0x180223,_0x500c9b,_0x14cfb7){return new Promise(function(_0x158155,_0x282065){var _0x4e57c3=[];_0x402d95[_0x5bcb('0x45')](function(_0x232ebc){_0x4e57c3[_0x5bcb('0x46')](getRemoteTag(_0x232ebc,_0x2e9d78,_0x56ce53,_0x500c9b,_0x14cfb7));});return Promise['all'](_0x4e57c3)[_0x5bcb('0xb')](function(_0x38f679){if(_0x38f679[_0x5bcb('0xd')]){logger[_0x5bcb('0x14')]('['+[_0x246d9c[_0x5bcb('0x10')]()]+_0x5bcb('0x47'),_0x38f679);var _0x5d0542=[];_0x38f679[_0x5bcb('0x45')](function(_0x2c3b4a){_0x5d0542[_0x5bcb('0x46')](assignTagToIncident(_0x2c3b4a,_0x2e9d78,_0x56ce53,_0x180223,_0x500c9b));});return Promise[_0x5bcb('0x48')](_0x5d0542)[_0x5bcb('0xb')](function(){_0x158155();})[_0x5bcb('0x11')](function(){_0x158155();});}else{_0x158155();}});});}function getTags(_0x389af3,_0x1f3bfa,_0x43690e,_0x41e853,_0x12f110,_0x94a0de){return function(_0x3e86d3){return new Promise(function(_0x281a34,_0x43f21f){var _0x79ab21=[];var _0x559ba5=_0x41e853['Tags'];if(_0x559ba5&&_0x559ba5['length']>0x0){_0x79ab21=_['map'](_0x559ba5,_0x5bcb('0x36'));}if(_0x79ab21[_0x5bcb('0xd')]>0x0){return manageTags(_0x389af3,_0x79ab21,_0x1f3bfa,_0x43690e,_0x3e86d3,_0x12f110,_0x94a0de)['then'](function(){_0x281a34(_0x3e86d3);});}else{_0x281a34(_0x3e86d3);}});};}function emit(_0x117c83,_0x317f02,_0x3c35a7){var _0x2bcd21=_0x5bcb('0x49')+_0x5bcb('0x4a')+_0x5bcb('0x4b')+'%255EORDERBYDESCnumber';var _0x2d59f0={'uri':_0x117c83+_0x5bcb('0x4c')+_0x3c35a7+_0x2bcd21};io['to'](util[_0x5bcb('0x4d')](_0x5bcb('0x4e'),_0x317f02))[_0x5bcb('0x4f')]('trigger:browser:url',_0x2d59f0);}exports['cs']=function(_0xf4773c,_0x49d0f5,_0x1121d1,_0x3b64dd,_0x417f25,_0x13c520,_0x23895b,_0x3692ee){var _0x29b9db={};var _0x31ab48={'user':_0x13c520[_0x5bcb('0x50')],'pass':_0x13c520['password']};var _0x6f6111='sysparm_limit=1';var _0x23a95a=_0x5bcb('0x51');_0x13c520[_0x5bcb('0x52')]=intUtil['stripTrailingSlash'](_0x13c520[_0x5bcb('0x52')]);_0x13c520[_0x5bcb('0x53')]=intUtil[_0x5bcb('0x54')](_0x13c520[_0x5bcb('0x53')]);var _0x15d13c=util[_0x5bcb('0x4d')](_0x5bcb('0x55'),_0x13c520[_0x5bcb('0x52')]);_0x29b9db[_0x5bcb('0x15')]=!_[_0x5bcb('0x56')](_0x3b64dd)?_0x3b64dd['email']:null;_0x29b9db[_0x5bcb('0x1c')]=_0x13c520[_0x5bcb('0x57')];_0x29b9db[_0x5bcb('0x21')]=_0x3692ee[_0x5bcb('0x2d')]()==='outbound'?_0x49d0f5[_0x5bcb('0x58')]:_0x49d0f5[_0x5bcb('0x59')];_0x29b9db['callDirection']=_0x3692ee==='queue'||_0x3692ee==='unmanaged'?_0x5bcb('0x5a'):_0x5bcb('0x38');var _0x5bf848=util[_0x5bcb('0x4d')](_0x5bcb('0x5b'),_0x13c520[_0x5bcb('0x53')],_0x49d0f5[_0x5bcb('0x5c')],md5(_0x49d0f5[_0x5bcb('0x5c')]));if(_0x417f25&&_0x417f25[_0x5bcb('0x5d')]){logger[_0x5bcb('0x14')](_0x5bcb('0x5e'),_0x5bcb('0x5f'));_0x49d0f5['recordingURL']=_0x5bf848;}else if(_0x23895b&&_0x23895b[_0x5bcb('0x60')]&&_0x23895b[_0x5bcb('0x60')]!==_0x5bcb('0x61')){logger[_0x5bcb('0x14')](_0x5bcb('0x62'),_0x5bcb('0x5f'));_0x49d0f5['recordingURL']=_0x5bf848;}else{_0x49d0f5[_0x5bcb('0x63')]='';}return getAdminUser(_0x3692ee,_0x31ab48,_0x29b9db,_0x15d13c,_0x23a95a,_0x6f6111)[_0x5bcb('0xb')](getUser(_0x3692ee,_0x31ab48,_0x15d13c,_0x23a95a,_0x6f6111))['then'](getEndUser(_0x3692ee,_0x31ab48,_0x15d13c,_0x23a95a,_0x6f6111))[_0x5bcb('0xb')](getTicket(_0x3692ee,_0x31ab48,_0x15d13c,_0x1121d1,_0x49d0f5,_0x23a95a))[_0x5bcb('0xb')](function(_0x3c7793){logger[_0x5bcb('0x14')](util[_0x5bcb('0x4d')](_0x5bcb('0x64'),_0x3c7793[_0x5bcb('0x3e')]));logger[_0x5bcb('0x14')](util[_0x5bcb('0x4d')](_0x5bcb('0x65'),_0x3692ee));if(_0x3692ee!==_0x5bcb('0x66')){logger['info']('['+[_0x3692ee[_0x5bcb('0x10')]()]+']',_0x5bcb('0x67'));emit(_0x13c520[_0x5bcb('0x52')],_0x3b64dd['name'],_0x3c7793[_0x5bcb('0x3e')]);}})[_0x5bcb('0x11')](function(_0x555827){logger['error']('['+[_0x3692ee['toUpperCase']()]+_0x5bcb('0x68'),util[_0x5bcb('0x69')](_0x555827,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x878f=['content','string','idField','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','user:%s','emit','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','calleridnum','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','POST','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase'];(function(_0x2321ed,_0x4ea03a){var _0x2e5a76=function(_0x7cb4e9){while(--_0x7cb4e9){_0x2321ed['push'](_0x2321ed['shift']());}};_0x2e5a76(++_0x4ea03a);}(_0x878f,0x101));var _0xf878=function(_0x1ec515,_0x5b90da){_0x1ec515=_0x1ec515-0x0;var _0x26a60b=_0x878f[_0x1ec515];return _0x26a60b;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xf878('0x0'));var util=require(_0xf878('0x1'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xf878('0x2'));var config=require(_0xf878('0x3'));var logger=require(_0xf878('0x4'))(_0xf878('0x5'));config['redis']=_[_0xf878('0x6')](config['redis'],{'host':_0xf878('0x7'),'port':0x18eb});var io=require(_0xf878('0x8'))(new Redis(config['redis']));function getAdminUser(_0xdc4c45,_0xcadcdc,_0x369735,_0x524c18,_0x357794,_0x4eabe6){return new Promise(function(_0x501e99,_0x3323ff){var _0x336e24={'method':_0xf878('0x9'),'uri':_0x524c18+_0xf878('0xa')+'&'+_0x357794+'&'+_0x4eabe6,'auth':_0xcadcdc,'json':!![]};return rp(_0x336e24)[_0xf878('0xb')](function(_0x1b05ec){if(_0x1b05ec[_0xf878('0xc')][_0xf878('0xd')]>0x0){_0x369735[_0xf878('0xe')]=_0x1b05ec[_0xf878('0xc')][0x0][_0xf878('0xf')];}logger[_0xf878('0x10')]('['+[_0xdc4c45['toUpperCase']()]+_0xf878('0x11'),_0x369735);_0x501e99(_0x369735);})[_0xf878('0x12')](function(_0x3b5a04){logger[_0xf878('0x13')]('['+[_0xdc4c45[_0xf878('0x14')]()]+']',_0x3b5a04[_0xf878('0x15')]);_0x3323ff(_0x3b5a04[_0xf878('0x15')]);});});}function getUser(_0x222694,_0x40236d,_0x41cc09,_0x267f19,_0x48c844){return function(_0x24e73d){logger['info']('['+[_0x222694[_0xf878('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x24e73d);return new Promise(function(_0x1fee40,_0x4727c2){if(intUtil[_0xf878('0x16')](_0x24e73d['userEmail'])){var _0x455b96={'method':_0xf878('0x9'),'uri':_0x41cc09+_0xf878('0x17')+_0x24e73d[_0xf878('0x18')]+'&'+_0x267f19+'&'+_0x48c844,'auth':_0x40236d,'json':!![]};logger[_0xf878('0x10')]('['+[_0x222694[_0xf878('0x14')]()]+_0xf878('0x19'),_0x455b96);return rp(_0x455b96)[_0xf878('0xb')](function(_0x28cfdd){logger[_0xf878('0x10')]('['+[_0x222694[_0xf878('0x14')]()]+_0xf878('0x1a'),_0x28cfdd);if(_0x28cfdd['result'][_0xf878('0xd')]>0x0&&String(_0x28cfdd[_0xf878('0xc')][0x0][_0xf878('0x1b')])===_0xf878('0x1c')){_0x24e73d[_0xf878('0x1d')]=_0x28cfdd[_0xf878('0xc')][0x0]['sys_id'];}else{_0x24e73d['userId']=_0x24e73d[_0xf878('0xe')];_0x24e73d[_0xf878('0x18')]=_0x24e73d[_0xf878('0x1e')];}logger['info']('['+[_0x222694[_0xf878('0x14')]()]+'],\x20getUser\x20crm',_0x24e73d);_0x1fee40(_0x24e73d);})[_0xf878('0x12')](function(_0x31fbc2){logger[_0xf878('0x13')]('['+[_0x222694[_0xf878('0x14')]()]+']',_0x31fbc2['message']);_0x4727c2(_0x31fbc2[_0xf878('0x15')]);});}else{logger[_0xf878('0x10')]('['+[_0x222694[_0xf878('0x14')]()]+_0xf878('0x1f'));_0x24e73d[_0xf878('0x1d')]=_0x24e73d[_0xf878('0xe')];_0x24e73d[_0xf878('0x18')]=_0x24e73d[_0xf878('0x1e')];_0x1fee40(_0x24e73d);}});};}function createEndUser(_0xa5393a,_0x57033e,_0xd581f9,_0x275a76,_0x33b8d){logger['info']('['+[_0xa5393a[_0xf878('0x14')]()]+'],\x20createEndUser\x20input\x20crm',_0xd581f9);return new Promise(function(_0x497393,_0x53c0e6){var _0x30e291={'method':_0xf878('0x20'),'uri':_0x275a76+'sys_user?'+_0x33b8d,'body':{'user_name':_0xd581f9[_0xf878('0x21')],'roles':'user','first_name':_0xd581f9[_0xf878('0x21')],'active':_0xf878('0x1c'),'date_format':'System','phone':_0xd581f9[_0xf878('0x21')]},'auth':_0x57033e,'json':!![]};return rp(_0x30e291)[_0xf878('0xb')](function(_0x42c2fb){logger[_0xf878('0x10')]('['+[_0xa5393a['toUpperCase']()]+_0xf878('0x22'),_0x42c2fb[_0xf878('0xc')]);_0xd581f9[_0xf878('0x23')]=_0x42c2fb[_0xf878('0xc')][_0xf878('0xf')];_0x497393(_0xd581f9);})[_0xf878('0x12')](function(_0x265357){logger[_0xf878('0x13')]('['+[_0xa5393a[_0xf878('0x14')]()]+']',_0x265357['message']);_0x53c0e6(_0x265357['message']);});});}function getEndUser(_0x1d76af,_0x3df706,_0x56b53e,_0x29c4f5,_0x1bc44d){return function(_0x3008df){logger[_0xf878('0x10')]('['+[_0x1d76af[_0xf878('0x14')]()]+_0xf878('0x24'),_0x3008df);return new Promise(function(_0x5a7471,_0x1ac51f){var _0x1d7555={'method':_0xf878('0x9'),'uri':_0x56b53e+_0xf878('0x25')+_0x3008df[_0xf878('0x21')]+'&'+_0x29c4f5+'&'+_0x1bc44d,'auth':_0x3df706,'json':!![]};return rp(_0x1d7555)[_0xf878('0xb')](function(_0x3853ef){if(_0x3853ef[_0xf878('0xc')][_0xf878('0xd')]>0x0){_0x3008df[_0xf878('0x23')]=_0x3853ef[_0xf878('0xc')][0x0][_0xf878('0xf')];logger[_0xf878('0x10')]('['+[_0x1d76af['toUpperCase']()]+_0xf878('0x26'),_0x3008df);_0x5a7471(_0x3008df);}else{return createEndUser(_0x1d76af,_0x3df706,_0x3008df,_0x56b53e,_0x29c4f5)['then'](function(_0x56ea95){logger[_0xf878('0x10')]('['+[_0x1d76af[_0xf878('0x14')]()]+'],\x20createEndUser\x20crm',_0x56ea95);_0x5a7471(_0x56ea95);});}})['catch'](function(_0x4c3f6b){logger[_0xf878('0x13')]('['+[_0x1d76af['toUpperCase']()]+']',_0x4c3f6b[_0xf878('0x15')]);_0x1ac51f(_0x4c3f6b[_0xf878('0x15')]);});});};}function getCustomFields(_0x48724d,_0x1e74e8){var _0x5cec2b={};if(_0x48724d['length']>0x0){_[_0xf878('0x27')](_0x48724d,function(_0x23702a){if(_[_0xf878('0x28')](['string',_0xf878('0x29')],_0x23702a[_0xf878('0x2a')])&&_0x23702a[_0xf878('0x2b')]&&!_0x23702a[_0xf878('0x2c')]){_0x5cec2b[_0x23702a[_0xf878('0x2b')][_0xf878('0x2d')]()]=_0x23702a[_0xf878('0x2e')]['toString']();}else if(_[_0xf878('0x28')]([_0xf878('0x2f'),_0xf878('0x29')],_0x23702a[_0xf878('0x2a')])&&_0x23702a[_0xf878('0x30')]&&_0x23702a[_0xf878('0x2c')]){_0x5cec2b[_0x23702a[_0xf878('0x30')][_0xf878('0x2d')]()]=_0x23702a[_0xf878('0x2e')][_0xf878('0x31')]();}else if(_0x23702a[_0xf878('0x2a')]===_0xf878('0x32')&&_0x23702a['variableName']&&_0x23702a[_0xf878('0x30')]&&_0x23702a[_0xf878('0x2c')]){_0x5cec2b[_0x23702a[_0xf878('0x30')][_0xf878('0x2d')]()]=_0x1e74e8[_0x23702a[_0xf878('0x33')]][_0xf878('0x31')]();}else if(_0x23702a[_0xf878('0x2a')]==='customVariable'&&_0x23702a['Variable']&&_0x23702a[_0xf878('0x34')][_0xf878('0x35')]&&_0x23702a[_0xf878('0x30')]&&_0x23702a[_0xf878('0x2c')]){_0x5cec2b[_0x23702a[_0xf878('0x30')]['toLowerCase']()]=_0x1e74e8[_0x23702a[_0xf878('0x34')]['name'][_0xf878('0x2d')]()][_0xf878('0x31')]();}});}return _0x5cec2b;}function getTicket(_0x3199da,_0x5a3b2f,_0x2b8ebd,_0x197ea6,_0x1d894d,_0x3b51ff){return function(_0x4ca6dc){logger[_0xf878('0x10')]('['+[_0x3199da[_0xf878('0x14')]()]+_0xf878('0x36'),_0x4ca6dc);return new Promise(function(_0x486370,_0x54de68){var _0x261c2f=_0x3199da[_0xf878('0x2d')]()===_0xf878('0x37')?_0x4ca6dc[_0xf878('0x1d')]:_0x4ca6dc[_0xf878('0x23')];var _0x2c1e97={'method':'POST','uri':_0x2b8ebd+_0xf878('0x38')+'?'+_0x3b51ff,'body':Object[_0xf878('0x39')]({},{'active':_0xf878('0x1c'),'caller_id':_0x261c2f,'assigned_to':_0x4ca6dc[_0xf878('0x1d')],'short_description':intUtil[_0xf878('0x3a')](_0x197ea6[_0xf878('0x3b')],_0x1d894d,'\x20'),'description':intUtil[_0xf878('0x3a')](_0x197ea6[_0xf878('0x3c')],_0x1d894d,'\x0a')},getCustomFields(_0x197ea6[_0xf878('0x3d')],_0x1d894d)),'auth':_0x5a3b2f,'json':!![]};return rp(_0x2c1e97)['then'](function(_0x2c6bca){logger['info']('['+[_0x3199da['toUpperCase']()]+_0xf878('0x3e'),_0x2c6bca['result']);_0x4ca6dc['ticketId']=_0x2c6bca[_0xf878('0xc')][_0xf878('0xf')];_0x4ca6dc['ticketNumber']=_0x2c6bca['result']['number'];logger[_0xf878('0x10')]('['+[_0x3199da['toUpperCase']()]+_0xf878('0x3f'),_0x4ca6dc);_0x486370(_0x4ca6dc);})[_0xf878('0x12')](function(_0x5647fb){logger[_0xf878('0x13')]('['+[_0x3199da[_0xf878('0x14')]()]+']',_0x5647fb[_0xf878('0x15')]);_0x54de68(_0x5647fb[_0xf878('0x15')]);});});};}function createRemoteTag(_0x1683cc,_0x1f232f,_0x8c9e0a,_0x1a33de){return new Promise(function(_0xd76285,_0xfdbc0b){var _0x10ac77={'method':_0xf878('0x20'),'uri':_0x8c9e0a+'label'+'?'+_0x1a33de,'body':{'short_description':_0x1683cc,'global':!![],'active':!![],'name':_0x1683cc},'auth':_0x1f232f,'json':!![]};return rp(_0x10ac77)[_0xf878('0xb')](function(_0x38e6d8){var _0x50d41b=_0x38e6d8[_0xf878('0xc')][_0xf878('0xf')];_0xd76285(_0x50d41b);});});}function getRemoteTag(_0x1bd49b,_0x218b3f,_0x289834,_0x3680f0,_0x36c4ae){return new Promise(function(_0x39b520,_0x19b949){var _0x1e3dc4={'method':_0xf878('0x9'),'uri':_0x289834+_0xf878('0x40')+_0xf878('0x41')+_0x1bd49b+'&'+_0x3680f0,'auth':_0x218b3f,'json':!![]};return rp(_0x1e3dc4)[_0xf878('0xb')](function(_0x1e9437){if(_0x1e9437['result']['length']>0x0){var _0x41f51d=_0x1e9437[_0xf878('0xc')][0x0][_0xf878('0xf')];_0x39b520(_0x41f51d);}else{return createRemoteTag(_0x1bd49b,_0x218b3f,_0x289834,_0x3680f0)[_0xf878('0xb')](function(_0x40982e){_0x39b520(_0x40982e);});}});});}function assignTagToIncident(_0x4ac31a,_0x41488f,_0x22bbda,_0x5f3e7d,_0x54118c){return new Promise(function(_0x3495cb,_0x345646){var _0x148b29={'method':_0xf878('0x20'),'uri':_0x22bbda+_0xf878('0x42')+'?'+_0x54118c,'body':{'label':_0x4ac31a,'table':_0xf878('0x38'),'id_type':_0xf878('0x43'),'table_key':_0x5f3e7d[_0xf878('0x44')],'title':_0xf878('0x45')+_0x5f3e7d[_0xf878('0x46')],'id_display':_0x5f3e7d['ticketNumber']},'auth':_0x41488f,'json':!![]};return rp(_0x148b29)[_0xf878('0xb')](function(_0x2eed10){_0x3495cb();})[_0xf878('0x12')](function(){_0x3495cb();});});}function manageTags(_0x5e48d7,_0x8f596b,_0x3bf513,_0x1ec89b,_0x1d37db,_0x4af0fc,_0x300f18){return new Promise(function(_0x31f892,_0x24fd22){var _0x4e87c8=[];_0x8f596b[_0xf878('0x27')](function(_0x177b07){_0x4e87c8[_0xf878('0x47')](getRemoteTag(_0x177b07,_0x3bf513,_0x1ec89b,_0x4af0fc,_0x300f18));});return Promise[_0xf878('0x48')](_0x4e87c8)[_0xf878('0xb')](function(_0x521150){if(_0x521150[_0xf878('0xd')]){logger[_0xf878('0x10')]('['+[_0x5e48d7[_0xf878('0x14')]()]+_0xf878('0x49'),_0x521150);var _0xa6e658=[];_0x521150[_0xf878('0x27')](function(_0x44a3f5){_0xa6e658[_0xf878('0x47')](assignTagToIncident(_0x44a3f5,_0x3bf513,_0x1ec89b,_0x1d37db,_0x4af0fc));});return Promise[_0xf878('0x48')](_0xa6e658)['then'](function(){_0x31f892();})[_0xf878('0x12')](function(){_0x31f892();});}else{_0x31f892();}});});}function getTags(_0x1320c1,_0x527cd2,_0x1a194f,_0x5458db,_0x46753c,_0x14130a){return function(_0x366858){return new Promise(function(_0x1827af,_0x55775a){var _0x55f0fd=[];var _0x4133bc=_0x5458db[_0xf878('0x4a')];if(_0x4133bc&&_0x4133bc['length']>0x0){_0x55f0fd=_[_0xf878('0x4b')](_0x4133bc,_0xf878('0x35'));}if(_0x55f0fd[_0xf878('0xd')]>0x0){return manageTags(_0x1320c1,_0x55f0fd,_0x527cd2,_0x1a194f,_0x366858,_0x46753c,_0x14130a)['then'](function(){_0x1827af(_0x366858);});}else{_0x1827af(_0x366858);}});};}function emit(_0x5c65a8,_0x35309b,_0x3501ea){var _0x2dea75=_0xf878('0x4c')+_0xf878('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xf878('0x4e');var _0x35eff7={'uri':_0x5c65a8+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3501ea+_0x2dea75};io['to'](util['format'](_0xf878('0x4f'),_0x35309b))[_0xf878('0x50')]('trigger:browser:url',_0x35eff7);}exports['cs']=function(_0xdb4f81,_0xa48609,_0x47db8b,_0x593eb2,_0x2d29ae,_0x4ea56a,_0x2f0918,_0x3eef23){var _0x40d829={};var _0x58aa64={'user':_0x4ea56a[_0xf878('0x51')],'pass':_0x4ea56a[_0xf878('0x52')]};var _0x5a152b='sysparm_limit=1';var _0x48c6af=_0xf878('0x53');_0x4ea56a[_0xf878('0x54')]=intUtil[_0xf878('0x55')](_0x4ea56a[_0xf878('0x54')]);_0x4ea56a[_0xf878('0x56')]=intUtil[_0xf878('0x55')](_0x4ea56a['serverUrl']);var _0x2da6d5=util[_0xf878('0x57')](_0xf878('0x58'),_0x4ea56a[_0xf878('0x54')]);_0x40d829[_0xf878('0x18')]=!_[_0xf878('0x59')](_0x593eb2)?_0x593eb2[_0xf878('0x5a')]:null;_0x40d829['adminEmail']=_0x4ea56a[_0xf878('0x5a')];_0x40d829[_0xf878('0x21')]=_0x3eef23[_0xf878('0x2d')]()==='outbound'?_0xa48609['destcalleridnum']:_0xa48609[_0xf878('0x5b')];_0x40d829['callDirection']=_0x3eef23==='queue'||_0x3eef23===_0xf878('0x5c')?'queue':_0xf878('0x37');var _0x4ff7e2=util[_0xf878('0x57')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ea56a['serverUrl'],_0xa48609['uniqueid'],md5(_0xa48609[_0xf878('0x5d')]));if(_0x2d29ae&&_0x2d29ae[_0xf878('0x5e')]){logger[_0xf878('0x10')]('[QUEUE]',_0xf878('0x5f'));_0xa48609[_0xf878('0x60')]=_0x4ff7e2;}else if(_0x2f0918&&_0x2f0918['recordingFormat']&&_0x2f0918['recordingFormat']!==_0xf878('0x61')){logger[_0xf878('0x10')]('[OUTBOUND]',_0xf878('0x5f'));_0xa48609[_0xf878('0x60')]=_0x4ff7e2;}else{_0xa48609[_0xf878('0x60')]='';}return getAdminUser(_0x3eef23,_0x58aa64,_0x40d829,_0x2da6d5,_0x48c6af,_0x5a152b)[_0xf878('0xb')](getUser(_0x3eef23,_0x58aa64,_0x2da6d5,_0x48c6af,_0x5a152b))[_0xf878('0xb')](getEndUser(_0x3eef23,_0x58aa64,_0x2da6d5,_0x48c6af,_0x5a152b))[_0xf878('0xb')](getTicket(_0x3eef23,_0x58aa64,_0x2da6d5,_0x47db8b,_0xa48609,_0x48c6af))[_0xf878('0xb')](function(_0x211172){logger[_0xf878('0x10')](util[_0xf878('0x57')]('The\x20ticket\x20ID\x20is:\x20%s',_0x211172[_0xf878('0x44')]));logger[_0xf878('0x10')](util['format']('call\x20direction:\x20%s',_0x3eef23));if(_0x3eef23!=='unmanaged'){logger[_0xf878('0x10')]('['+[_0x3eef23[_0xf878('0x14')]()]+']',_0xf878('0x62'));emit(_0x4ea56a['remoteUri'],_0x593eb2[_0xf878('0x35')],_0x211172['ticketId']);}})['catch'](function(_0x30230a){logger[_0xf878('0x13')]('['+[_0x3eef23[_0xf878('0x14')]()]+_0xf878('0x63'),util[_0xf878('0x64')](_0x30230a,{'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 af9c45b..63edbe9 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 _0xbbbe=['variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','user_name','then','entry_list','length','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','merge','map','forEach','nameField','customField','toLowerCase','content','type','string','custom_fields','toString','variable','customVariable','Variable','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','contacts','unmanaged','lastevent','toUpperCase','isNil','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','name','Subjects','created_by','description','getString','toISOString','duration_hours','duration_minutes','parent_id','parent_type','direction'];(function(_0x399b4f,_0x1c0b49){var _0x13dcb6=function(_0x391bfd){while(--_0x391bfd){_0x399b4f['push'](_0x399b4f['shift']());}};_0x13dcb6(++_0x1c0b49);}(_0xbbbe,0x157));var _0xebbb=function(_0x58471d,_0x1f8095){_0x58471d=_0x58471d-0x0;var _0x200901=_0xbbbe[_0x58471d];return _0x200901;};'use strict';var _=require(_0xebbb('0x0'));var rp=require(_0xebbb('0x1'));var BPromise=require(_0xebbb('0x2'));var md5=require(_0xebbb('0x3'));var util=require(_0xebbb('0x4'));var Redis=require('ioredis');var intUtil=require(_0xebbb('0x5'));var config=require(_0xebbb('0x6'));var logger=require('../../../../config/logger')(_0xebbb('0x7'));config[_0xebbb('0x8')]=_[_0xebbb('0x9')](config[_0xebbb('0x8')],{'host':_0xebbb('0xa'),'port':0x18eb});var io=require(_0xebbb('0xb'))(new Redis(config['redis']));var def={'method':_0xebbb('0xc'),'json':!![]};function emit(_0x1de8d4,_0x42bd93,_0x2fcafe){io['to'](_0x1de8d4)[_0xebbb('0xd')](_0x42bd93,_0x2fcafe);}function getTicket(_0x2dd92f,_0x4d94e2,_0x27edab,_0x1066ad,_0x22adfd,_0x4eda19,_0x1dfe31,_0x1caee5){logger[_0xebbb('0xe')]('Creating\x20new\x20ticket...');var _0x92d6a7=new Date();var _0x2faf3b=[{'name':_0xebbb('0xf'),'value':intUtil['getString'](_0x1066ad[_0xebbb('0x10')],_0x22adfd,'\x20')},{'name':'assigned_user_id','value':_0x4d94e2['id']},{'name':_0xebbb('0x11'),'value':_0x4d94e2['id']},{'name':_0xebbb('0x12'),'value':intUtil[_0xebbb('0x13')](_0x1066ad['Descriptions'],_0x22adfd,'\x0a')},{'name':'date_start','value':_0x92d6a7[_0xebbb('0x14')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0xebbb('0x15'),'value':'0'},{'name':_0xebbb('0x16'),'value':'15'},{'name':_0xebbb('0x17'),'value':_0x27edab['id']},{'name':_0xebbb('0x18'),'value':'Contacts'},{'name':'parent_name','value':_0x27edab[_0xebbb('0xf')]},{'name':_0xebbb('0x19'),'value':_0x1caee5}];if(_0x4eda19['length']){_['forEach'](_0x4eda19,function(_0x35225f){if(_0x22adfd[_0x35225f[_0xebbb('0x1a')]]){_0x2faf3b[_0xebbb('0x1b')]({'name':_0x35225f[_0xebbb('0x1c')],'value':_0x22adfd[_0x35225f[_0xebbb('0x1a')]]});}});}return request({'form':{'method':_0xebbb('0x1d'),'input_type':_0xebbb('0x1e'),'response_type':_0xebbb('0x1e'),'rest_data':JSON['stringify']({'session':_0x1dfe31['id'],'module_name':_0xebbb('0x1f'),'name_value_list':_0x2faf3b})}});}function getAuth(_0x3849e8){return util['format'](_0xebbb('0x20'),new Buffer(_0x3849e8[_0xebbb('0x21')]+':X')['toString']('base64'));}function getServerInfo(_0x3442f1){return request({'form':{'method':'get_server_info','input_type':_0xebbb('0x1e'),'response_type':_0xebbb('0x1e'),'rest_data':JSON[_0xebbb('0x22')]({'session':_0x3442f1['id']})}});}function getUser(_0x55102a,_0x254711,_0x123ac1){if(!_['isNil'](_0x254711)){logger[_0xebbb('0xe')](_0xebbb('0x23'),_0x254711);return request({'form':{'method':_0xebbb('0x24'),'input_type':_0xebbb('0x1e'),'response_type':'JSON','rest_data':JSON[_0xebbb('0x22')]({'session':_0x123ac1['id'],'module_name':_0xebbb('0x25'),'query':util[_0xebbb('0x26')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x254711),'order_by':'','offset':'0','select_fields':['id',_0xebbb('0xf'),_0xebbb('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xebbb('0x28')](function(_0x2821cd){if(_0x2821cd[_0xebbb('0x29')][_0xebbb('0x2a')]){var _0x325a72=_['find'](_0x2821cd[_0xebbb('0x29')],function(_0x572020){return _0x572020['name_value_list'][_0xebbb('0x27')][_0xebbb('0x2b')]===_0x254711;});if(_0x325a72){logger['info'](_0xebbb('0x2c'));return BPromise[_0xebbb('0x2d')]({'id':_0x325a72[_0xebbb('0x2e')]['id']['value'],'name':_0x325a72['name_value_list'][_0xebbb('0xf')][_0xebbb('0x2b')]});}}logger['info'](_0xebbb('0x2f'));return BPromise[_0xebbb('0x2d')]({'id':_0x123ac1[_0xebbb('0x2e')][_0xebbb('0x30')]['value'],'name':_0x123ac1[_0xebbb('0x2e')][_0xebbb('0x27')][_0xebbb('0x2b')]});});}else{logger[_0xebbb('0xe')](_0xebbb('0x31'));return BPromise[_0xebbb('0x2d')]({'id':_0x123ac1[_0xebbb('0x2e')][_0xebbb('0x30')]['value'],'name':_0x123ac1[_0xebbb('0x2e')][_0xebbb('0x27')][_0xebbb('0x2b')]});}}function getEndUser(_0x54ae6d,_0x3f62a5,_0x9d7561,_0x3fae52){logger[_0xebbb('0xe')](_0xebbb('0x32'),_0x9d7561);return request({'form':{'method':_0xebbb('0x24'),'input_type':_0xebbb('0x1e'),'response_type':_0xebbb('0x1e'),'rest_data':JSON[_0xebbb('0x22')]({'session':_0x3fae52['id'],'module_name':_0xebbb('0x33'),'query':util['format'](_0xebbb('0x34'),_0x9d7561),'order_by':'','offset':'0','select_fields':['id','name',_0xebbb('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2c4007){if(_0x2c4007['entry_list'][_0xebbb('0x2a')]){var _0x52934d=_[_0xebbb('0x36')](_0x2c4007['entry_list'],function(_0xae872e){return _0xae872e['name_value_list'][_0xebbb('0x35')][_0xebbb('0x2b')]===_0x9d7561;});if(_0x52934d){logger[_0xebbb('0xe')](_0xebbb('0x37'));return BPromise['resolve']({'id':_0x52934d[_0xebbb('0x2e')]['id'][_0xebbb('0x2b')],'name':_0x52934d[_0xebbb('0x2e')]['name'][_0xebbb('0x2b')],'phone':_0x52934d[_0xebbb('0x2e')][_0xebbb('0x35')][_0xebbb('0x2b')]});}}else{logger[_0xebbb('0xe')](_0xebbb('0x38'));return request({'form':{'method':_0xebbb('0x1d'),'input_type':_0xebbb('0x1e'),'response_type':'JSON','rest_data':JSON[_0xebbb('0x22')]({'session':_0x3fae52['id'],'module_name':_0xebbb('0x33'),'name_value_list':[{'name':'first_name','value':_0x3f62a5!==_0xebbb('0x39')?_0x3f62a5:util[_0xebbb('0x26')](_0xebbb('0x3a'),_0x9d7561)},{'name':'phone_home','value':_0x9d7561}]})}})[_0xebbb('0x28')](function(_0x28ae8f){logger[_0xebbb('0xe')](_0xebbb('0x3b'));return BPromise[_0xebbb('0x2d')]({'id':_0x28ae8f['id'],'name':_0x28ae8f[_0xebbb('0x29')][_0xebbb('0x3c')][_0xebbb('0x2b')],'phone':_0x28ae8f[_0xebbb('0x29')][_0xebbb('0x35')][_0xebbb('0x2b')]});});}});}function request(_0x21f88e){logger[_0xebbb('0x3d')]('[HTTP]',JSON[_0xebbb('0x22')](_0x21f88e));return rp(_[_0xebbb('0x3e')](def,_0x21f88e));}function getTags(_0x11650e,_0x350ec5){var _0x3e8c3b=[];if(_0x11650e&&_0x11650e[_0xebbb('0x2a')]>0x0){_0x3e8c3b=_[_0xebbb('0x3f')](_0x11650e,_0x350ec5);}return _0x3e8c3b;}function getCustomFields(_0x296108,_0x25f411){var _0x5e31ba=[];var _0x324c4e={'custom_fields':[]};if(_0x296108[_0xebbb('0x2a')]>0x0){_[_0xebbb('0x40')](_0x296108,function(_0x15fc6e){if(_0x15fc6e['type']==='string'&&_0x15fc6e[_0xebbb('0x41')]&&!_0x15fc6e[_0xebbb('0x42')]){_0x324c4e[_0x15fc6e[_0xebbb('0x41')][_0xebbb('0x43')]()]=_0x15fc6e[_0xebbb('0x44')]['toString']();}else if(_0x15fc6e[_0xebbb('0x45')]===_0xebbb('0x46')&&_0x15fc6e[_0xebbb('0x1c')]&&_0x15fc6e[_0xebbb('0x42')]){_0x324c4e[_0xebbb('0x47')][_0xebbb('0x1b')]({'id':_0x15fc6e['idField'],'value':_0x15fc6e[_0xebbb('0x44')][_0xebbb('0x48')]()});}else if(_0x15fc6e[_0xebbb('0x45')]===_0xebbb('0x49')&&_0x15fc6e['variableName']&&_0x15fc6e[_0xebbb('0x1c')]&&_0x15fc6e[_0xebbb('0x42')]){_0x25f411[_0x15fc6e[_0xebbb('0x1a')]]&&_0x324c4e['custom_fields'][_0xebbb('0x1b')]({'id':_0x15fc6e['idField'],'value':_0x25f411[_0x15fc6e[_0xebbb('0x1a')]]['toString']()});}else if(_0x15fc6e[_0xebbb('0x45')]===_0xebbb('0x4a')&&_0x15fc6e[_0xebbb('0x4b')]&&_0x15fc6e[_0xebbb('0x4b')][_0xebbb('0xf')]&&_0x15fc6e['idField']&&_0x15fc6e[_0xebbb('0x42')]){_0x25f411[_0x15fc6e[_0xebbb('0x4b')][_0xebbb('0xf')][_0xebbb('0x43')]()]&&_0x324c4e[_0xebbb('0x47')]['push']({'id':_0x15fc6e[_0xebbb('0x1c')],'value':_0x25f411[_0x15fc6e[_0xebbb('0x4b')]['name'][_0xebbb('0x43')]()][_0xebbb('0x48')]()});}});}return _0x324c4e;}function getConnection(_0xc38e49){return request({'method':'POST','form':{'method':_0xebbb('0x4c'),'input_type':_0xebbb('0x1e'),'response_type':_0xebbb('0x1e'),'rest_data':JSON[_0xebbb('0x22')]({'user_auth':{'user_name':_0xc38e49[_0xebbb('0x4d')],'password':_0xc38e49[_0xebbb('0x4e')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0xebbb('0x28')](function(_0x10a581){var _0x33ba41=_0x10a581;if(_0x33ba41['id']){def[_0xebbb('0x4f')]=_0x33ba41['id'];return BPromise[_0xebbb('0x2d')](_0x33ba41);}else{throw new Error(util['format'](_0xebbb('0x50'),_0xc38e49['id']));}});}function setRelationship(_0x31c319,_0x196ff1,_0x215fb8,_0x9d42dd){return request({'form':{'method':_0xebbb('0x51'),'input_type':_0xebbb('0x1e'),'response_type':_0xebbb('0x1e'),'rest_data':JSON[_0xebbb('0x22')]({'session':_0x31c319['id'],'module_name':_0xebbb('0x1f'),'module_id':_0x215fb8['id'],'link_field_name':_0x9d42dd,'related_ids':[_0x196ff1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xebbb('0x52')]=function(_0x54c70b,_0x503728,_0x513dd5,_0x898673,_0x4a843c,_0x47f6f7){var _0x29b22d,_0x28de24,_0x4606d7,_0x5cb47a;_0x47f6f7[_0xebbb('0x53')]=intUtil[_0xebbb('0x54')](_0x47f6f7[_0xebbb('0x53')]);_0x47f6f7[_0xebbb('0x55')]=intUtil[_0xebbb('0x54')](_0x47f6f7[_0xebbb('0x55')]);def[_0xebbb('0x56')]=util[_0xebbb('0x26')](_0xebbb('0x57'),_0x47f6f7[_0xebbb('0x53')]);if(_0x4a843c&&_0x4a843c[_0xebbb('0x58')]){logger[_0xebbb('0xe')](_0xebbb('0x59'),_0xebbb('0x5a'));_0x503728[_0xebbb('0x5b')]=util[_0xebbb('0x26')](_0xebbb('0x5c'),_0x47f6f7[_0xebbb('0x55')],_0x503728['uniqueid'],md5(_0x503728['uniqueid']));}else{_0x503728[_0xebbb('0x5b')]='';}return getConnection(_0x47f6f7)[_0xebbb('0x28')](function(_0x3756f4){_0x5cb47a=_0x3756f4;return getUser(_0x47f6f7,_0x898673['name'],_0x5cb47a);})[_0xebbb('0x28')](function(_0x4edda0){_0x29b22d=_0x4edda0;logger[_0xebbb('0xe')](_0xebbb('0x5d'),_0x29b22d['id']);return getEndUser(_0x47f6f7,_0x503728[_0xebbb('0x5e')],_0x503728[_0xebbb('0x5f')],_0x5cb47a);})[_0xebbb('0x28')](function(_0x1450f0){_0x28de24=_0x1450f0;logger['info']('The\x20Enduser\x20ID\x20is:',_0x28de24['id']);return getTicket(_0x47f6f7,_0x29b22d,_0x28de24,_0x513dd5,_0x503728,_0x513dd5[_0xebbb('0x60')],_0x5cb47a,_0xebbb('0x61'));})[_0xebbb('0x28')](function(_0x2ea656){_0x4606d7=_0x2ea656;logger['info'](_0xebbb('0x62'));logger[_0xebbb('0xe')](_0xebbb('0x63'),_0x4606d7['id']);return setRelationship(_0x5cb47a,_0x29b22d,_0x4606d7,_0xebbb('0x64'));})[_0xebbb('0x28')](function(){return setRelationship(_0x5cb47a,_0x28de24,_0x4606d7,'contacts');})['then'](function(){return getServerInfo(_0x5cb47a);})['then'](function(_0x278bbd){var _0x454c49=parseInt(_0x278bbd[_0xebbb('0x65')][_0xebbb('0x66')](0x0));var _0x5c973a=util['format'](_0xebbb('0x67'),_0x47f6f7['remoteUri'],_0x4606d7['id']);if(_0x454c49>0x6){_0x5c973a=util['format'](_0xebbb('0x68'),_0x47f6f7['remoteUri'],_0x4606d7['id']);}logger[_0xebbb('0xe')](_0xebbb('0x59'),_0xebbb('0x69'));emit(util[_0xebbb('0x26')](_0xebbb('0x6a'),_0x898673['name']),_0xebbb('0x6b'),{'uri':_0x5c973a});})[_0xebbb('0x6c')](function(_0x51f43d){logger[_0xebbb('0x6d')](_0xebbb('0x59'),JSON['stringify'](_0x51f43d));});};exports[_0xebbb('0x6e')]=function(_0x90021,_0x2fa9f4,_0x21054d,_0x6a3926,_0x140e42,_0x1b9b3a,_0x467b4d){var _0x115948,_0x26f82c,_0xd85539,_0x14b33a;_0x1b9b3a['remoteUri']=intUtil['stripTrailingSlash'](_0x1b9b3a[_0xebbb('0x53')]);_0x1b9b3a[_0xebbb('0x55')]=intUtil['stripTrailingSlash'](_0x1b9b3a[_0xebbb('0x55')]);def[_0xebbb('0x56')]=util['format']('%s/service/v4_1/rest.php',_0x1b9b3a[_0xebbb('0x53')]);if(_0x467b4d&&_0x467b4d['recordingFormat']&&_0x467b4d[_0xebbb('0x6f')]!==_0xebbb('0x70')){logger[_0xebbb('0xe')](_0xebbb('0x71'),_0xebbb('0x5a'));_0x2fa9f4[_0xebbb('0x5b')]=util[_0xebbb('0x26')](_0xebbb('0x5c'),_0x1b9b3a[_0xebbb('0x55')],_0x2fa9f4[_0xebbb('0x72')],md5(_0x2fa9f4[_0xebbb('0x72')]));}return getConnection(_0x1b9b3a)['then'](function(_0x2b166f){_0x14b33a=_0x2b166f;return getUser(_0x1b9b3a,_0x6a3926[_0xebbb('0xf')],_0x14b33a);})['then'](function(_0x2f69c5){_0x115948=_0x2f69c5;logger[_0xebbb('0xe')](_0xebbb('0x5d'),_0x115948['id']);return getEndUser(_0x1b9b3a,_0x2fa9f4[_0xebbb('0x73')],_0x2fa9f4[_0xebbb('0x74')],_0x14b33a);})[_0xebbb('0x28')](function(_0x224b06){_0x26f82c=_0x224b06;logger[_0xebbb('0xe')](_0xebbb('0x75'),_0x26f82c['id']);return getTicket(_0x1b9b3a,_0x115948,_0x26f82c,_0x21054d,_0x2fa9f4,_0x21054d['Fields'],_0x14b33a,'Outbound');})[_0xebbb('0x28')](function(_0x145a20){_0xd85539=_0x145a20;logger[_0xebbb('0xe')](_0xebbb('0x62'));logger['info'](_0xebbb('0x63'),_0xd85539['id']);return setRelationship(_0x14b33a,_0x115948,_0xd85539,_0xebbb('0x64'));})['then'](function(){return setRelationship(_0x14b33a,_0x26f82c,_0xd85539,_0xebbb('0x76'));})[_0xebbb('0x28')](function(){return getServerInfo(_0x14b33a);})[_0xebbb('0x28')](function(_0x18c81e){var _0x47e8d2=parseInt(_0x18c81e[_0xebbb('0x65')][_0xebbb('0x66')](0x0));var _0x1f3d86=util[_0xebbb('0x26')](_0xebbb('0x67'),_0x1b9b3a[_0xebbb('0x53')],_0xd85539['id']);if(_0x47e8d2>0x6){_0x1f3d86=util[_0xebbb('0x26')](_0xebbb('0x68'),_0x1b9b3a[_0xebbb('0x53')],_0xd85539['id']);}logger[_0xebbb('0xe')](_0xebbb('0x71'),_0xebbb('0x69'));emit(util[_0xebbb('0x26')](_0xebbb('0x6a'),_0x6a3926[_0xebbb('0xf')]),'trigger:browser:url',{'uri':_0x1f3d86});})[_0xebbb('0x6c')](function(_0x4051e8){logger[_0xebbb('0x6d')](_0xebbb('0x71'),JSON[_0xebbb('0x22')](_0x4051e8));});};exports[_0xebbb('0x77')]=function(_0x3bd9b0,_0x12f66a,_0x46f5bb,_0x4b0af6,_0x166612,_0x465563){var _0x3da4a5,_0x4b7ff5,_0x495160,_0x4f186c;_0x465563[_0xebbb('0x53')]=intUtil[_0xebbb('0x54')](_0x465563[_0xebbb('0x53')]);_0x465563[_0xebbb('0x55')]=intUtil['stripTrailingSlash'](_0x465563[_0xebbb('0x55')]);def['uri']=util[_0xebbb('0x26')](_0xebbb('0x57'),_0x465563[_0xebbb('0x53')]);if(_0x166612&&_0x166612[_0xebbb('0x58')]){logger[_0xebbb('0xe')]('['+_0x12f66a[_0xebbb('0x78')][_0xebbb('0x79')]()+']','Recording\x20is\x20enabled!');_0x12f66a[_0xebbb('0x5b')]=util[_0xebbb('0x26')](_0xebbb('0x5c'),_0x465563[_0xebbb('0x55')],_0x12f66a[_0xebbb('0x72')],md5(_0x12f66a[_0xebbb('0x72')]));}else{_0x12f66a[_0xebbb('0x5b')]='';}return getConnection(_0x465563)[_0xebbb('0x28')](function(_0x41e04e){_0x4f186c=_0x41e04e;if(!_[_0xebbb('0x7a')](_0x4b0af6)){return getUser(_0x465563,_0x4b0af6[_0xebbb('0xf')],_0x4f186c);}else{return getUser(_0x465563,null,_0x4f186c);}})[_0xebbb('0x28')](function(_0x143464){_0x3da4a5=_0x143464;logger['info'](_0xebbb('0x5d'),_0x3da4a5['id']);return getEndUser(_0x465563,_0x12f66a[_0xebbb('0x5e')],_0x12f66a['calleridnum'],_0x4f186c);})[_0xebbb('0x28')](function(_0x135e6c){_0x4b7ff5=_0x135e6c;logger[_0xebbb('0xe')](_0xebbb('0x75'),_0x4b7ff5['id']);return getTicket(_0x465563,_0x3da4a5,_0x4b7ff5,_0x46f5bb,_0x12f66a,_0x46f5bb['Fields'],_0x4f186c,_0xebbb('0x61'));})[_0xebbb('0x28')](function(_0x3ecbcd){_0x495160=_0x3ecbcd;logger['info'](_0xebbb('0x62'));logger[_0xebbb('0xe')](_0xebbb('0x63'),_0x495160['id']);return setRelationship(_0x4f186c,_0x3da4a5,_0x495160,_0xebbb('0x64'));})[_0xebbb('0x28')](function(){return setRelationship(_0x4f186c,_0x4b7ff5,_0x495160,'contacts');})[_0xebbb('0x28')](function(){return getServerInfo(_0x4f186c);})[_0xebbb('0x6c')](function(_0x21d079){logger['error']('['+_0x12f66a[_0xebbb('0x78')][_0xebbb('0x79')]()+']',JSON[_0xebbb('0x22')](_0x21d079));});}; \ No newline at end of file +var _0xf7ea=['stringify','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','nameField','toLowerCase','content','type','custom_fields','variable','customField','Variable','login','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','contacts','version','unmanaged','lastevent','toUpperCase','Inbound','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','defaults','redis','POST','emit','info','Creating\x20new\x20ticket...','Subjects','created_by','Descriptions','date_start','slice','duration_hours','duration_minutes','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64'];(function(_0x157c79,_0x38ea3a){var _0x8315ff=function(_0x3f2002){while(--_0x3f2002){_0x157c79['push'](_0x157c79['shift']());}};_0x8315ff(++_0x38ea3a);}(_0xf7ea,0xcc));var _0xaf7e=function(_0x1971e9,_0x973dec){_0x1971e9=_0x1971e9-0x0;var _0x18fc5b=_0xf7ea[_0x1971e9];return _0x18fc5b;};'use strict';var _=require('lodash');var rp=require(_0xaf7e('0x0'));var BPromise=require(_0xaf7e('0x1'));var md5=require(_0xaf7e('0x2'));var util=require(_0xaf7e('0x3'));var Redis=require(_0xaf7e('0x4'));var intUtil=require(_0xaf7e('0x5'));var config=require(_0xaf7e('0x6'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_[_0xaf7e('0x7')](config[_0xaf7e('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0xaf7e('0x9'),'json':!![]};function emit(_0x5646b3,_0x24c345,_0x2592d9){io['to'](_0x5646b3)[_0xaf7e('0xa')](_0x24c345,_0x2592d9);}function getTicket(_0x5dc3ae,_0xb962a5,_0x324549,_0xb1e436,_0x4fe3ed,_0x365a1e,_0x146ce1,_0x3de86a){logger[_0xaf7e('0xb')](_0xaf7e('0xc'));var _0x2e3847=new Date();var _0x12b7ff=[{'name':'name','value':intUtil['getString'](_0xb1e436[_0xaf7e('0xd')],_0x4fe3ed,'\x20')},{'name':'assigned_user_id','value':_0xb962a5['id']},{'name':_0xaf7e('0xe'),'value':_0xb962a5['id']},{'name':'description','value':intUtil['getString'](_0xb1e436[_0xaf7e('0xf')],_0x4fe3ed,'\x0a')},{'name':_0xaf7e('0x10'),'value':_0x2e3847['toISOString']()[_0xaf7e('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':_0xaf7e('0x12'),'value':'0'},{'name':_0xaf7e('0x13'),'value':'15'},{'name':'parent_id','value':_0x324549['id']},{'name':_0xaf7e('0x14'),'value':_0xaf7e('0x15')},{'name':_0xaf7e('0x16'),'value':_0x324549[_0xaf7e('0x17')]},{'name':_0xaf7e('0x18'),'value':_0x3de86a}];if(_0x365a1e[_0xaf7e('0x19')]){_[_0xaf7e('0x1a')](_0x365a1e,function(_0x38df69){if(_0x4fe3ed[_0x38df69[_0xaf7e('0x1b')]]){_0x12b7ff[_0xaf7e('0x1c')]({'name':_0x38df69[_0xaf7e('0x1d')],'value':_0x4fe3ed[_0x38df69[_0xaf7e('0x1b')]]});}});}return request({'form':{'method':_0xaf7e('0x1e'),'input_type':_0xaf7e('0x1f'),'response_type':_0xaf7e('0x1f'),'rest_data':JSON['stringify']({'session':_0x146ce1['id'],'module_name':_0xaf7e('0x20'),'name_value_list':_0x12b7ff})}});}function getAuth(_0x17f842){return util[_0xaf7e('0x21')](_0xaf7e('0x22'),new Buffer(_0x17f842[_0xaf7e('0x23')]+':X')[_0xaf7e('0x24')](_0xaf7e('0x25')));}function getServerInfo(_0x5995b3){return request({'form':{'method':'get_server_info','input_type':_0xaf7e('0x1f'),'response_type':_0xaf7e('0x1f'),'rest_data':JSON[_0xaf7e('0x26')]({'session':_0x5995b3['id']})}});}function getUser(_0x5b0aa2,_0x53edf9,_0x194c9b){if(!_[_0xaf7e('0x27')](_0x53edf9)){logger['info']('Getting\x20agent\x20with\x20name',_0x53edf9);return request({'form':{'method':'get_entry_list','input_type':_0xaf7e('0x1f'),'response_type':_0xaf7e('0x1f'),'rest_data':JSON['stringify']({'session':_0x194c9b['id'],'module_name':_0xaf7e('0x28'),'query':util[_0xaf7e('0x21')](_0xaf7e('0x29'),_0x53edf9),'order_by':'','offset':'0','select_fields':['id',_0xaf7e('0x17'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaf7e('0x2a')](function(_0x34cc9b){if(_0x34cc9b[_0xaf7e('0x2b')][_0xaf7e('0x19')]){var _0x1b3e67=_[_0xaf7e('0x2c')](_0x34cc9b[_0xaf7e('0x2b')],function(_0x44a1e9){return _0x44a1e9[_0xaf7e('0x2d')][_0xaf7e('0x2e')]['value']===_0x53edf9;});if(_0x1b3e67){logger[_0xaf7e('0xb')](_0xaf7e('0x2f'));return BPromise['resolve']({'id':_0x1b3e67[_0xaf7e('0x2d')]['id'][_0xaf7e('0x30')],'name':_0x1b3e67[_0xaf7e('0x2d')][_0xaf7e('0x17')][_0xaf7e('0x30')]});}}logger[_0xaf7e('0xb')](_0xaf7e('0x31'));return BPromise['resolve']({'id':_0x194c9b['name_value_list'][_0xaf7e('0x32')][_0xaf7e('0x30')],'name':_0x194c9b[_0xaf7e('0x2d')][_0xaf7e('0x2e')][_0xaf7e('0x30')]});});}else{logger['info'](_0xaf7e('0x33'));return BPromise[_0xaf7e('0x34')]({'id':_0x194c9b[_0xaf7e('0x2d')][_0xaf7e('0x32')]['value'],'name':_0x194c9b[_0xaf7e('0x2d')][_0xaf7e('0x2e')][_0xaf7e('0x30')]});}}function getEndUser(_0x18a82c,_0x44c874,_0x478ea0,_0x58687b){logger[_0xaf7e('0xb')](_0xaf7e('0x35'),_0x478ea0);return request({'form':{'method':_0xaf7e('0x36'),'input_type':'JSON','response_type':_0xaf7e('0x1f'),'rest_data':JSON[_0xaf7e('0x26')]({'session':_0x58687b['id'],'module_name':_0xaf7e('0x15'),'query':util[_0xaf7e('0x21')](_0xaf7e('0x37'),_0x478ea0),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaf7e('0x2a')](function(_0x16c908){if(_0x16c908[_0xaf7e('0x2b')][_0xaf7e('0x19')]){var _0x15d160=_[_0xaf7e('0x2c')](_0x16c908['entry_list'],function(_0x111f4d){return _0x111f4d[_0xaf7e('0x2d')][_0xaf7e('0x38')]['value']===_0x478ea0;});if(_0x15d160){logger[_0xaf7e('0xb')](_0xaf7e('0x39'));return BPromise[_0xaf7e('0x34')]({'id':_0x15d160[_0xaf7e('0x2d')]['id'][_0xaf7e('0x30')],'name':_0x15d160[_0xaf7e('0x2d')]['name']['value'],'phone':_0x15d160[_0xaf7e('0x2d')][_0xaf7e('0x38')][_0xaf7e('0x30')]});}}else{logger[_0xaf7e('0xb')](_0xaf7e('0x3a'));return request({'form':{'method':_0xaf7e('0x1e'),'input_type':_0xaf7e('0x1f'),'response_type':_0xaf7e('0x1f'),'rest_data':JSON[_0xaf7e('0x26')]({'session':_0x58687b['id'],'module_name':_0xaf7e('0x15'),'name_value_list':[{'name':_0xaf7e('0x3b'),'value':_0x44c874!==_0xaf7e('0x3c')?_0x44c874:util['format'](_0xaf7e('0x3d'),_0x478ea0)},{'name':'phone_home','value':_0x478ea0}]})}})[_0xaf7e('0x2a')](function(_0x59b680){logger['info'](_0xaf7e('0x3e'));return BPromise['resolve']({'id':_0x59b680['id'],'name':_0x59b680['entry_list']['first_name'][_0xaf7e('0x30')],'phone':_0x59b680[_0xaf7e('0x2b')]['phone_home'][_0xaf7e('0x30')]});});}});}function request(_0x384f27){logger[_0xaf7e('0x3f')](_0xaf7e('0x40'),JSON[_0xaf7e('0x26')](_0x384f27));return rp(_[_0xaf7e('0x41')](def,_0x384f27));}function getTags(_0xf114d0,_0x1aa116){var _0x28bbc4=[];if(_0xf114d0&&_0xf114d0[_0xaf7e('0x19')]>0x0){_0x28bbc4=_[_0xaf7e('0x42')](_0xf114d0,_0x1aa116);}return _0x28bbc4;}function getCustomFields(_0x57bc9c,_0x19c133){var _0x2b7bd9=[];var _0x5a52b6={'custom_fields':[]};if(_0x57bc9c[_0xaf7e('0x19')]>0x0){_[_0xaf7e('0x1a')](_0x57bc9c,function(_0x256f04){if(_0x256f04['type']===_0xaf7e('0x43')&&_0x256f04[_0xaf7e('0x44')]&&!_0x256f04['customField']){_0x5a52b6[_0x256f04['nameField'][_0xaf7e('0x45')]()]=_0x256f04[_0xaf7e('0x46')][_0xaf7e('0x24')]();}else if(_0x256f04[_0xaf7e('0x47')]===_0xaf7e('0x43')&&_0x256f04[_0xaf7e('0x1d')]&&_0x256f04['customField']){_0x5a52b6[_0xaf7e('0x48')][_0xaf7e('0x1c')]({'id':_0x256f04['idField'],'value':_0x256f04[_0xaf7e('0x46')][_0xaf7e('0x24')]()});}else if(_0x256f04[_0xaf7e('0x47')]===_0xaf7e('0x49')&&_0x256f04['variableName']&&_0x256f04[_0xaf7e('0x1d')]&&_0x256f04[_0xaf7e('0x4a')]){_0x19c133[_0x256f04[_0xaf7e('0x1b')]]&&_0x5a52b6[_0xaf7e('0x48')][_0xaf7e('0x1c')]({'id':_0x256f04[_0xaf7e('0x1d')],'value':_0x19c133[_0x256f04[_0xaf7e('0x1b')]][_0xaf7e('0x24')]()});}else if(_0x256f04['type']==='customVariable'&&_0x256f04['Variable']&&_0x256f04['Variable'][_0xaf7e('0x17')]&&_0x256f04[_0xaf7e('0x1d')]&&_0x256f04[_0xaf7e('0x4a')]){_0x19c133[_0x256f04[_0xaf7e('0x4b')][_0xaf7e('0x17')]['toLowerCase']()]&&_0x5a52b6[_0xaf7e('0x48')][_0xaf7e('0x1c')]({'id':_0x256f04[_0xaf7e('0x1d')],'value':_0x19c133[_0x256f04[_0xaf7e('0x4b')][_0xaf7e('0x17')][_0xaf7e('0x45')]()][_0xaf7e('0x24')]()});}});}return _0x5a52b6;}function getConnection(_0x3f929f){return request({'method':_0xaf7e('0x9'),'form':{'method':_0xaf7e('0x4c'),'input_type':_0xaf7e('0x1f'),'response_type':_0xaf7e('0x1f'),'rest_data':JSON[_0xaf7e('0x26')]({'user_auth':{'user_name':_0x3f929f['username'],'password':_0x3f929f[_0xaf7e('0x4d')],'encryption':_0xaf7e('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xaf7e('0x2a')](function(_0xd7471d){var _0x4a1b4d=_0xd7471d;if(_0x4a1b4d['id']){def[_0xaf7e('0x4f')]=_0x4a1b4d['id'];return BPromise[_0xaf7e('0x34')](_0x4a1b4d);}else{throw new Error(util['format'](_0xaf7e('0x50'),_0x3f929f['id']));}});}function setRelationship(_0x20ae18,_0x3c29f5,_0x3c3ed4,_0x524a25){return request({'form':{'method':_0xaf7e('0x51'),'input_type':_0xaf7e('0x1f'),'response_type':_0xaf7e('0x1f'),'rest_data':JSON[_0xaf7e('0x26')]({'session':_0x20ae18['id'],'module_name':'Calls','module_id':_0x3c3ed4['id'],'link_field_name':_0x524a25,'related_ids':[_0x3c29f5['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xaf7e('0x52')]=function(_0x45be07,_0x29891d,_0x4f8aaf,_0x4320e4,_0x25064e,_0x5d7e30){var _0x5f4722,_0x5ce798,_0x57331b,_0x2f6c25;_0x5d7e30['remoteUri']=intUtil[_0xaf7e('0x53')](_0x5d7e30[_0xaf7e('0x54')]);_0x5d7e30[_0xaf7e('0x55')]=intUtil['stripTrailingSlash'](_0x5d7e30['serverUrl']);def[_0xaf7e('0x56')]=util['format'](_0xaf7e('0x57'),_0x5d7e30[_0xaf7e('0x54')]);if(_0x25064e&&_0x25064e[_0xaf7e('0x58')]){logger[_0xaf7e('0xb')](_0xaf7e('0x59'),_0xaf7e('0x5a'));_0x29891d[_0xaf7e('0x5b')]=util[_0xaf7e('0x21')](_0xaf7e('0x5c'),_0x5d7e30['serverUrl'],_0x29891d['uniqueid'],md5(_0x29891d['uniqueid']));}else{_0x29891d[_0xaf7e('0x5b')]='';}return getConnection(_0x5d7e30)[_0xaf7e('0x2a')](function(_0x16e41c){_0x2f6c25=_0x16e41c;return getUser(_0x5d7e30,_0x4320e4['name'],_0x2f6c25);})['then'](function(_0x3193d2){_0x5f4722=_0x3193d2;logger['info']('The\x20User\x20ID\x20is:',_0x5f4722['id']);return getEndUser(_0x5d7e30,_0x29891d[_0xaf7e('0x5d')],_0x29891d[_0xaf7e('0x5e')],_0x2f6c25);})[_0xaf7e('0x2a')](function(_0x13174c){_0x5ce798=_0x13174c;logger[_0xaf7e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5ce798['id']);return getTicket(_0x5d7e30,_0x5f4722,_0x5ce798,_0x4f8aaf,_0x29891d,_0x4f8aaf[_0xaf7e('0x5f')],_0x2f6c25,'Inbound');})[_0xaf7e('0x2a')](function(_0xc2d47f){_0x57331b=_0xc2d47f;logger[_0xaf7e('0xb')](_0xaf7e('0x60'));logger[_0xaf7e('0xb')](_0xaf7e('0x61'),_0x57331b['id']);return setRelationship(_0x2f6c25,_0x5f4722,_0x57331b,_0xaf7e('0x62'));})['then'](function(){return setRelationship(_0x2f6c25,_0x5ce798,_0x57331b,'contacts');})[_0xaf7e('0x2a')](function(){return getServerInfo(_0x2f6c25);})[_0xaf7e('0x2a')](function(_0x36637e){var _0x475c16=parseInt(_0x36637e['version'][_0xaf7e('0x63')](0x0));var _0x350951=util[_0xaf7e('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5d7e30[_0xaf7e('0x54')],_0x57331b['id']);if(_0x475c16>0x6){_0x350951=util['format'](_0xaf7e('0x64'),_0x5d7e30['remoteUri'],_0x57331b['id']);}logger['info'](_0xaf7e('0x59'),_0xaf7e('0x65'));emit(util[_0xaf7e('0x21')](_0xaf7e('0x66'),_0x4320e4[_0xaf7e('0x17')]),_0xaf7e('0x67'),{'uri':_0x350951});})[_0xaf7e('0x68')](function(_0x226287){logger[_0xaf7e('0x69')](_0xaf7e('0x59'),JSON[_0xaf7e('0x26')](_0x226287));});};exports[_0xaf7e('0x6a')]=function(_0x27ba14,_0xd2d6a0,_0x421086,_0x5c12de,_0x374fd8,_0x13165b,_0x2b6c5d){var _0x52c5a2,_0x28737e,_0x569802,_0x559045;_0x13165b['remoteUri']=intUtil[_0xaf7e('0x53')](_0x13165b[_0xaf7e('0x54')]);_0x13165b['serverUrl']=intUtil[_0xaf7e('0x53')](_0x13165b[_0xaf7e('0x55')]);def[_0xaf7e('0x56')]=util[_0xaf7e('0x21')](_0xaf7e('0x57'),_0x13165b[_0xaf7e('0x54')]);if(_0x2b6c5d&&_0x2b6c5d[_0xaf7e('0x6b')]&&_0x2b6c5d[_0xaf7e('0x6b')]!==_0xaf7e('0x6c')){logger[_0xaf7e('0xb')](_0xaf7e('0x6d'),_0xaf7e('0x5a'));_0xd2d6a0['recordingURL']=util[_0xaf7e('0x21')](_0xaf7e('0x5c'),_0x13165b['serverUrl'],_0xd2d6a0[_0xaf7e('0x6e')],md5(_0xd2d6a0[_0xaf7e('0x6e')]));}return getConnection(_0x13165b)[_0xaf7e('0x2a')](function(_0x3e65ea){_0x559045=_0x3e65ea;return getUser(_0x13165b,_0x5c12de[_0xaf7e('0x17')],_0x559045);})[_0xaf7e('0x2a')](function(_0x276b2a){_0x52c5a2=_0x276b2a;logger[_0xaf7e('0xb')](_0xaf7e('0x6f'),_0x52c5a2['id']);return getEndUser(_0x13165b,_0xd2d6a0[_0xaf7e('0x70')],_0xd2d6a0[_0xaf7e('0x71')],_0x559045);})[_0xaf7e('0x2a')](function(_0x188ae0){_0x28737e=_0x188ae0;logger[_0xaf7e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x28737e['id']);return getTicket(_0x13165b,_0x52c5a2,_0x28737e,_0x421086,_0xd2d6a0,_0x421086[_0xaf7e('0x5f')],_0x559045,_0xaf7e('0x72'));})[_0xaf7e('0x2a')](function(_0x567d34){_0x569802=_0x567d34;logger[_0xaf7e('0xb')]('Ticket\x20created!');logger[_0xaf7e('0xb')](_0xaf7e('0x61'),_0x569802['id']);return setRelationship(_0x559045,_0x52c5a2,_0x569802,_0xaf7e('0x62'));})['then'](function(){return setRelationship(_0x559045,_0x28737e,_0x569802,_0xaf7e('0x73'));})[_0xaf7e('0x2a')](function(){return getServerInfo(_0x559045);})[_0xaf7e('0x2a')](function(_0x247c8a){var _0x4807f6=parseInt(_0x247c8a[_0xaf7e('0x74')][_0xaf7e('0x63')](0x0));var _0x5cc9d0=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x13165b[_0xaf7e('0x54')],_0x569802['id']);if(_0x4807f6>0x6){_0x5cc9d0=util['format'](_0xaf7e('0x64'),_0x13165b[_0xaf7e('0x54')],_0x569802['id']);}logger[_0xaf7e('0xb')](_0xaf7e('0x6d'),_0xaf7e('0x65'));emit(util[_0xaf7e('0x21')](_0xaf7e('0x66'),_0x5c12de[_0xaf7e('0x17')]),_0xaf7e('0x67'),{'uri':_0x5cc9d0});})[_0xaf7e('0x68')](function(_0x4ea152){logger[_0xaf7e('0x69')](_0xaf7e('0x6d'),JSON['stringify'](_0x4ea152));});};exports[_0xaf7e('0x75')]=function(_0x2ae2a5,_0x43bc23,_0x2408c4,_0x2e1717,_0xe853fb,_0x5969a6){var _0x417f4d,_0x5deb57,_0x3147e3,_0x53a151;_0x5969a6[_0xaf7e('0x54')]=intUtil[_0xaf7e('0x53')](_0x5969a6[_0xaf7e('0x54')]);_0x5969a6[_0xaf7e('0x55')]=intUtil['stripTrailingSlash'](_0x5969a6[_0xaf7e('0x55')]);def['uri']=util[_0xaf7e('0x21')](_0xaf7e('0x57'),_0x5969a6['remoteUri']);if(_0xe853fb&&_0xe853fb['monitor_format']){logger[_0xaf7e('0xb')]('['+_0x43bc23[_0xaf7e('0x76')][_0xaf7e('0x77')]()+']','Recording\x20is\x20enabled!');_0x43bc23[_0xaf7e('0x5b')]=util[_0xaf7e('0x21')](_0xaf7e('0x5c'),_0x5969a6[_0xaf7e('0x55')],_0x43bc23['uniqueid'],md5(_0x43bc23[_0xaf7e('0x6e')]));}else{_0x43bc23[_0xaf7e('0x5b')]='';}return getConnection(_0x5969a6)[_0xaf7e('0x2a')](function(_0x4c3b88){_0x53a151=_0x4c3b88;if(!_[_0xaf7e('0x27')](_0x2e1717)){return getUser(_0x5969a6,_0x2e1717[_0xaf7e('0x17')],_0x53a151);}else{return getUser(_0x5969a6,null,_0x53a151);}})[_0xaf7e('0x2a')](function(_0x1cfb7f){_0x417f4d=_0x1cfb7f;logger[_0xaf7e('0xb')]('The\x20User\x20ID\x20is:',_0x417f4d['id']);return getEndUser(_0x5969a6,_0x43bc23[_0xaf7e('0x5d')],_0x43bc23[_0xaf7e('0x5e')],_0x53a151);})[_0xaf7e('0x2a')](function(_0x289a79){_0x5deb57=_0x289a79;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5deb57['id']);return getTicket(_0x5969a6,_0x417f4d,_0x5deb57,_0x2408c4,_0x43bc23,_0x2408c4[_0xaf7e('0x5f')],_0x53a151,_0xaf7e('0x78'));})[_0xaf7e('0x2a')](function(_0x4b6667){_0x3147e3=_0x4b6667;logger[_0xaf7e('0xb')](_0xaf7e('0x60'));logger[_0xaf7e('0xb')](_0xaf7e('0x61'),_0x3147e3['id']);return setRelationship(_0x53a151,_0x417f4d,_0x3147e3,_0xaf7e('0x62'));})['then'](function(){return setRelationship(_0x53a151,_0x5deb57,_0x3147e3,_0xaf7e('0x73'));})['then'](function(){return getServerInfo(_0x53a151);})[_0xaf7e('0x68')](function(_0x3a5a42){logger[_0xaf7e('0x69')]('['+_0x43bc23[_0xaf7e('0x76')][_0xaf7e('0x77')]()+']',JSON[_0xaf7e('0x26')](_0x3a5a42));});}; \ 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 25aa4f3..008ac6d 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 _0x3d9a=['keyType','stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','getString','length','sortBy','string','content','type','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent'];(function(_0x523233,_0x2ea865){var _0x4bb91a=function(_0x6b7c26){while(--_0x6b7c26){_0x523233['push'](_0x523233['shift']());}};_0x4bb91a(++_0x2ea865);}(_0x3d9a,0x19b));var _0xa3d9=function(_0x41360f,_0x55fa9c){_0x41360f=_0x41360f-0x0;var _0x3b7c68=_0x3d9a[_0x41360f];return _0x3b7c68;};'use strict';var _=require(_0xa3d9('0x0'));var util=require(_0xa3d9('0x1'));exports[_0xa3d9('0x2')]=function(_0x544f6b,_0x493859,_0x446494){var _0x7dc228=[];if(_0x544f6b[_0xa3d9('0x3')]>0x0){var _0x227de3=_[_0xa3d9('0x4')](_0x544f6b,['id']);for(var _0x1ca15c=0x0;_0x1ca15c<_0x227de3[_0xa3d9('0x3')];_0x1ca15c++){var _0x6323c8=_0x227de3[_0x1ca15c];if(_0x6323c8['type']===_0xa3d9('0x5')){_0x7dc228['push'](_0x6323c8[_0xa3d9('0x6')]);}else if(_0x6323c8[_0xa3d9('0x7')]===_0xa3d9('0x8')&&_0x6323c8[_0xa3d9('0x9')]){_0x493859[_0x6323c8['variableName']]&&_0x7dc228[_0xa3d9('0xa')](_0x493859[_0x6323c8[_0xa3d9('0x9')]][_0xa3d9('0xb')]());}else if(_0x6323c8[_0xa3d9('0x7')]===_0xa3d9('0xc')&&_0x6323c8[_0xa3d9('0xd')]&&_0x6323c8['Variable'][_0xa3d9('0xe')]){_0x493859[_0x6323c8['Variable'][_0xa3d9('0xe')][_0xa3d9('0xf')]()]&&_0x7dc228[_0xa3d9('0xa')](_0x493859[_0x6323c8[_0xa3d9('0xd')][_0xa3d9('0xe')][_0xa3d9('0xf')]()][_0xa3d9('0xb')]());}else if(_0x6323c8[_0xa3d9('0x7')]===_0xa3d9('0x10')){if(_0x6323c8['keyType']===_0xa3d9('0x5')&&_0x6323c8[_0xa3d9('0x11')]){_0x7dc228[_0xa3d9('0xa')](util[_0xa3d9('0x12')](_0xa3d9('0x13'),_0x6323c8[_0xa3d9('0x11')],_0x6323c8[_0xa3d9('0x14')]));}else if(_0x6323c8[_0xa3d9('0x15')]===_0xa3d9('0x8')&&_0x6323c8[_0xa3d9('0x9')]&&_0x6323c8[_0xa3d9('0x11')]){_0x493859[_0x6323c8[_0xa3d9('0x9')]]&&_0x7dc228[_0xa3d9('0xa')](util['format'](_0xa3d9('0x13'),_0x6323c8[_0xa3d9('0x11')],_0x493859[_0x6323c8[_0xa3d9('0x9')]]));}else if(_0x6323c8[_0xa3d9('0x15')]===_0xa3d9('0xc')&&_0x6323c8[_0xa3d9('0xd')]&&_0x6323c8[_0xa3d9('0xd')][_0xa3d9('0xe')]&&_0x6323c8[_0xa3d9('0x11')]){_0x493859[_0x6323c8['Variable'][_0xa3d9('0xe')][_0xa3d9('0xf')]()]&&_0x7dc228['push'](util['format'](_0xa3d9('0x13'),_0x6323c8[_0xa3d9('0x11')],_0x493859[_0x6323c8[_0xa3d9('0xd')][_0xa3d9('0xe')][_0xa3d9('0xf')]()]));}}}}return _0x7dc228['join'](_0x446494);};exports[_0xa3d9('0x16')]=function(_0x4c97c5){var _0x49c972=_0x4c97c5[_0xa3d9('0x17')](-0x1);if(_0x49c972==='/'){_0x4c97c5=_0x4c97c5[_0xa3d9('0x18')](0x0,_0x4c97c5['lastIndexOf'](_0x49c972));}return _0x4c97c5;};exports[_0xa3d9('0x19')]=function(_0x30bb0c){if(!_['isNil'](_0x30bb0c)&&_0x30bb0c!==''){var _0x3fd983=/^(([^<>()\[\]\\.,;:\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 _0x3fd983[_0xa3d9('0x1a')](String(_0x30bb0c)[_0xa3d9('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x8a42=['isNil','test','lodash','length','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','variable','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf'];(function(_0x5c0a3d,_0x30914d){var _0x251dd9=function(_0x11eb25){while(--_0x11eb25){_0x5c0a3d['push'](_0x5c0a3d['shift']());}};_0x251dd9(++_0x30914d);}(_0x8a42,0x122));var _0x28a4=function(_0x52917e,_0x23ebac){_0x52917e=_0x52917e-0x0;var _0x6ac3da=_0x8a42[_0x52917e];return _0x6ac3da;};'use strict';var _=require(_0x28a4('0x0'));var util=require('util');exports['getString']=function(_0x533607,_0x561628,_0x2c9709){var _0xcbd4a3=[];if(_0x533607[_0x28a4('0x1')]>0x0){var _0x5865f3=_['sortBy'](_0x533607,['id']);for(var _0x1e3740=0x0;_0x1e3740<_0x5865f3[_0x28a4('0x1')];_0x1e3740++){var _0x3e3807=_0x5865f3[_0x1e3740];if(_0x3e3807[_0x28a4('0x2')]===_0x28a4('0x3')){_0xcbd4a3[_0x28a4('0x4')](_0x3e3807[_0x28a4('0x5')]);}else if(_0x3e3807[_0x28a4('0x2')]==='variable'&&_0x3e3807[_0x28a4('0x6')]){_0x561628[_0x3e3807[_0x28a4('0x6')]]&&_0xcbd4a3['push'](_0x561628[_0x3e3807[_0x28a4('0x6')]][_0x28a4('0x7')]());}else if(_0x3e3807['type']===_0x28a4('0x8')&&_0x3e3807[_0x28a4('0x9')]&&_0x3e3807['Variable']['name']){_0x561628[_0x3e3807[_0x28a4('0x9')][_0x28a4('0xa')][_0x28a4('0xb')]()]&&_0xcbd4a3[_0x28a4('0x4')](_0x561628[_0x3e3807[_0x28a4('0x9')][_0x28a4('0xa')][_0x28a4('0xb')]()]['toString']());}else if(_0x3e3807['type']===_0x28a4('0xc')){if(_0x3e3807[_0x28a4('0xd')]===_0x28a4('0x3')&&_0x3e3807[_0x28a4('0xe')]){_0xcbd4a3[_0x28a4('0x4')](util[_0x28a4('0xf')]('%s:\x20%s',_0x3e3807['key'],_0x3e3807['keyContent']));}else if(_0x3e3807['keyType']===_0x28a4('0x10')&&_0x3e3807[_0x28a4('0x6')]&&_0x3e3807[_0x28a4('0xe')]){_0x561628[_0x3e3807[_0x28a4('0x6')]]&&_0xcbd4a3[_0x28a4('0x4')](util['format'](_0x28a4('0x11'),_0x3e3807[_0x28a4('0xe')],_0x561628[_0x3e3807['variableName']]));}else if(_0x3e3807[_0x28a4('0xd')]===_0x28a4('0x8')&&_0x3e3807[_0x28a4('0x9')]&&_0x3e3807[_0x28a4('0x9')][_0x28a4('0xa')]&&_0x3e3807[_0x28a4('0xe')]){_0x561628[_0x3e3807[_0x28a4('0x9')][_0x28a4('0xa')]['toLowerCase']()]&&_0xcbd4a3[_0x28a4('0x4')](util[_0x28a4('0xf')](_0x28a4('0x11'),_0x3e3807[_0x28a4('0xe')],_0x561628[_0x3e3807[_0x28a4('0x9')]['name'][_0x28a4('0xb')]()]));}}}}return _0xcbd4a3[_0x28a4('0x12')](_0x2c9709);};exports[_0x28a4('0x13')]=function(_0x1121d3){var _0x4163a3=_0x1121d3[_0x28a4('0x14')](-0x1);if(_0x4163a3==='/'){_0x1121d3=_0x1121d3['substring'](0x0,_0x1121d3[_0x28a4('0x15')](_0x4163a3));}return _0x1121d3;};exports['validateEmail']=function(_0x371940){if(!_[_0x28a4('0x16')](_0x371940)&&_0x371940!==''){var _0xcbe33c=/^(([^<>()\[\]\\.,;:\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 _0xcbe33c[_0x28a4('0x17')](String(_0x371940)[_0x28a4('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 bf49798..9d21e9b 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','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','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x3d6223,_0x557788){var _0x2da55a=function(_0x2af441){while(--_0x2af441){_0x3d6223['push'](_0x3d6223['shift']());}};_0x2da55a(++_0x557788);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','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','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5a7fd3,_0x196327){var _0x3f2031=function(_0x4bb182){while(--_0x4bb182){_0x5a7fd3['push'](_0x5a7fd3['shift']());}};_0x3f2031(++_0x196327);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ 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 43a4b3f..f962e74 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 _0xf1bb=['monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','error','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','integrationTab','user:%s','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl'];(function(_0xfb2dad,_0xecb606){var _0x89d211=function(_0x3f3a8d){while(--_0x3f3a8d){_0xfb2dad['push'](_0xfb2dad['shift']());}};_0x89d211(++_0xecb606);}(_0xf1bb,0x16d));var _0xbf1b=function(_0x2fb6ed,_0x2465c7){_0x2fb6ed=_0x2fb6ed-0x0;var _0x12976d=_0xf1bb[_0x2fb6ed];return _0x12976d;};'use strict';var _=require(_0xbf1b('0x0'));var rp=require(_0xbf1b('0x1'));var md5=require(_0xbf1b('0x2'));var util=require(_0xbf1b('0x3'));var Redis=require(_0xbf1b('0x4'));var intUtil=require(_0xbf1b('0x5'));var config=require('../../../../config/environment');var logger=require(_0xbf1b('0x6'))('zendesk');config[_0xbf1b('0x7')]=_['defaults'](config[_0xbf1b('0x7')],{'host':_0xbf1b('0x8'),'port':0x18eb});var io=require(_0xbf1b('0x9'))(new Redis(config[_0xbf1b('0x7')]));function emit(_0x525ec2,_0x212805,_0x130712){io['to'](_0x525ec2)[_0xbf1b('0xa')](_0x212805,_0x130712);}var headers={'Content-Type':'application/json','Accept':_0xbf1b('0xb')};function getTicket(_0x107622,_0x18cd4c,_0xdc7c55,_0x1cd7f6,_0x20a647){logger[_0xbf1b('0xc')](_0xbf1b('0xd'));return request({'uri':util[_0xbf1b('0xe')](_0xbf1b('0xf'),_0x107622['remoteUri']),'method':_0xbf1b('0x10'),'body':{'ticket':_[_0xbf1b('0x11')]({'requester_id':_0xdc7c55['id'],'submitter_id':_0x18cd4c?_0x18cd4c['id']:undefined,'assignee_id':_0x18cd4c?_0x18cd4c['id']:undefined,'tags':getTags(_0x1cd7f6[_0xbf1b('0x12')],_0xbf1b('0x13')),'subject':intUtil['getString'](_0x1cd7f6[_0xbf1b('0x14')],_0x20a647,'\x20'),'description':intUtil[_0xbf1b('0x15')](_0x1cd7f6[_0xbf1b('0x16')],_0x20a647,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x1cd7f6[_0xbf1b('0x16')],_0x20a647,'\x0a')}},getCustomFields(_0x1cd7f6[_0xbf1b('0x17')],_0x20a647))}})['then'](function(_0x16f1a3){logger['info'](_0xbf1b('0x18'));return _0x16f1a3[_0xbf1b('0x19')];});}function getUser(_0x3507fb,_0xdfc8d0){if(intUtil[_0xbf1b('0x1a')](_0xdfc8d0)){logger[_0xbf1b('0xc')]('Getting\x20agent\x20with\x20email',_0xdfc8d0);return request({'uri':util[_0xbf1b('0xe')](_0xbf1b('0x1b'),_0x3507fb[_0xbf1b('0x1c')]),'qs':{'query':util[_0xbf1b('0xe')]('type:user\x20role:agent\x20email:%s',_0xdfc8d0)}})['then'](function(_0x2783ab){if(_0x2783ab[_0xbf1b('0x1d')]){logger[_0xbf1b('0xc')](_0xbf1b('0x1e'));return _[_0xbf1b('0x1f')](_0x2783ab[_0xbf1b('0x20')],{'email':_0xdfc8d0,'role':'agent'});}else{logger[_0xbf1b('0xc')](_0xbf1b('0x21'));return request({'uri':util[_0xbf1b('0xe')](_0xbf1b('0x22'),_0x3507fb[_0xbf1b('0x1c')])})[_0xbf1b('0x23')](function(_0x12a4bf){logger[_0xbf1b('0xc')](_0xbf1b('0x24'));return _0x12a4bf[_0xbf1b('0x25')];});}});}else{logger[_0xbf1b('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xbf1b('0xe')](_0xbf1b('0x22'),_0x3507fb[_0xbf1b('0x1c')])})['then'](function(_0x22e105){logger[_0xbf1b('0xc')]('Admin\x20account\x20selected.');return _0x22e105['user'];});}}function getEndUser(_0x467525,_0x4b9921,_0x5c1806){logger['info'](_0xbf1b('0x26'),_0x5c1806);return request({'uri':util['format'](_0xbf1b('0x1b'),_0x467525[_0xbf1b('0x1c')]),'qs':{'query':util[_0xbf1b('0xe')](_0xbf1b('0x27'),_0x5c1806)}})[_0xbf1b('0x23')](function(_0xe2e39f){var _0x294f61;if(_0xe2e39f[_0xbf1b('0x20')][_0xbf1b('0x28')]){_0xe2e39f[_0xbf1b('0x20')]=_['filter'](_0xe2e39f[_0xbf1b('0x20')],{'suspended':![],'role':_0xbf1b('0x29')});if(_0xe2e39f[_0xbf1b('0x20')][_0xbf1b('0x28')]){_0x294f61=_[_0xbf1b('0x2a')](_0xe2e39f['results']);}}if(_0x294f61){logger[_0xbf1b('0xc')]('Enduser\x20found!');return _0x294f61;}else{logger[_0xbf1b('0xc')](_0xbf1b('0x2b'));return request({'uri':util[_0xbf1b('0xe')]('%s/users.json',_0x467525[_0xbf1b('0x1c')]),'method':_0xbf1b('0x10'),'body':{'user':{'role':'end-user','name':util['format']('Caller\x20-\x20%s',_0x4b9921||_0x5c1806),'phone':_0x5c1806}}})['then'](function(_0x22af94){logger[_0xbf1b('0xc')](_0xbf1b('0x2c'));return _0x22af94['user'];});}});}function getAuth(_0x221580){var _0x442193;if(_0x221580[_0xbf1b('0x2d')]===_0xbf1b('0x2e')){_0x442193=util['format']('%s:%s',_0x221580[_0xbf1b('0x2f')],_0x221580['password']);}else if(_0x221580[_0xbf1b('0x2d')]===_0xbf1b('0x30')){_0x442193=util['format'](_0xbf1b('0x31'),_0x221580['username'],_0x221580[_0xbf1b('0x30')]);}return util[_0xbf1b('0xe')](_0xbf1b('0x32'),new Buffer(_0x442193)[_0xbf1b('0x33')](_0xbf1b('0x34')));}function request(_0x2c34f0){logger[_0xbf1b('0x35')](_0xbf1b('0x36'),JSON[_0xbf1b('0x37')](_0x2c34f0));return rp(_['defaults'](_0x2c34f0,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2aa998,_0x1c6d5c){var _0x5d75f0=[];if(_0x2aa998&&_0x2aa998[_0xbf1b('0x28')]>0x0){_0x5d75f0=_[_0xbf1b('0x38')](_0x2aa998,_0x1c6d5c);}return _0x5d75f0;}function getCustomFields(_0x29d39c,_0x415d32){var _0x49f661=[];var _0x30466e={'custom_fields':[]};if(_0x29d39c[_0xbf1b('0x28')]>0x0){_['forEach'](_0x29d39c,function(_0x3b7c1b){if(_[_0xbf1b('0x39')]([_0xbf1b('0x3a'),_0xbf1b('0x3b')],_0x3b7c1b[_0xbf1b('0x3c')])&&_0x3b7c1b['nameField']&&!_0x3b7c1b[_0xbf1b('0x3d')]){_0x30466e[_0x3b7c1b[_0xbf1b('0x3e')][_0xbf1b('0x3f')]()]=_0x3b7c1b[_0xbf1b('0x40')]['toString']();}else if(_[_0xbf1b('0x39')](['string',_0xbf1b('0x3b')],_0x3b7c1b['type'])&&_0x3b7c1b[_0xbf1b('0x41')]&&_0x3b7c1b['customField']){_0x30466e[_0xbf1b('0x42')][_0xbf1b('0x43')]({'id':_0x3b7c1b[_0xbf1b('0x41')],'value':_0x3b7c1b[_0xbf1b('0x40')][_0xbf1b('0x33')]()});}else if(_0x3b7c1b['type']===_0xbf1b('0x44')&&_0x3b7c1b[_0xbf1b('0x45')]&&_0x3b7c1b[_0xbf1b('0x41')]&&_0x3b7c1b['customField']){_0x415d32[_0x3b7c1b[_0xbf1b('0x45')]]&&_0x30466e[_0xbf1b('0x42')][_0xbf1b('0x43')]({'id':_0x3b7c1b[_0xbf1b('0x41')],'value':_0x415d32[_0x3b7c1b[_0xbf1b('0x45')]][_0xbf1b('0x33')]()});}else if(_0x3b7c1b[_0xbf1b('0x3c')]===_0xbf1b('0x46')&&_0x3b7c1b[_0xbf1b('0x47')]&&_0x3b7c1b['Variable']['name']&&_0x3b7c1b['idField']&&_0x3b7c1b['customField']){_0x415d32[_0x3b7c1b[_0xbf1b('0x47')][_0xbf1b('0x13')][_0xbf1b('0x3f')]()]&&_0x30466e[_0xbf1b('0x42')][_0xbf1b('0x43')]({'id':_0x3b7c1b[_0xbf1b('0x41')],'value':_0x415d32[_0x3b7c1b['Variable'][_0xbf1b('0x13')][_0xbf1b('0x3f')]()][_0xbf1b('0x33')]()});}});}return _0x30466e;}exports[_0xbf1b('0x48')]=function(_0x50c5ca,_0x4779d9,_0x3ea7fa,_0xbe0931,_0x38af69,_0xa71871){var _0x5b966f,_0x5c98d8;_0xa71871['remoteUri']=intUtil[_0xbf1b('0x49')](_0xa71871[_0xbf1b('0x1c')]);_0xa71871[_0xbf1b('0x4a')]=intUtil[_0xbf1b('0x49')](_0xa71871[_0xbf1b('0x4a')]);if(_0x38af69&&_0x38af69[_0xbf1b('0x4b')]){logger['info'](_0xbf1b('0x4c'),'Recording\x20is\x20enabled!');_0x4779d9[_0xbf1b('0x4d')]=util[_0xbf1b('0xe')](_0xbf1b('0x4e'),_0xa71871[_0xbf1b('0x4a')],_0x4779d9['uniqueid'],md5(_0x4779d9[_0xbf1b('0x4f')]));}else{_0x4779d9[_0xbf1b('0x4d')]='';}headers[_0xbf1b('0x50')]=getAuth(_0xa71871);return getUser(_0xa71871,_0xbe0931[_0xbf1b('0x51')])[_0xbf1b('0x23')](function(_0x829289){_0x5b966f=_0x829289;logger[_0xbf1b('0xc')](_0xbf1b('0x52'),_0x5b966f['id']);return getEndUser(_0xa71871,_0x4779d9[_0xbf1b('0x53')],_0x4779d9['calleridnum']);})[_0xbf1b('0x23')](function(_0x48d33b){_0x5c98d8=_0x48d33b;logger[_0xbf1b('0xc')](_0xbf1b('0x54'),_0x5c98d8['id']);return getTicket(_0xa71871,_0x5b966f,_0x5c98d8,_0x3ea7fa,_0x4779d9);})['then'](function(_0x31643c){if(_0x31643c){logger['info'](_0xbf1b('0x55'),_0x31643c['id']);switch(_0xa71871[_0xbf1b('0x3c')]){case'integrationTab':logger[_0xbf1b('0xc')](_0xbf1b('0x4c'),_0xbf1b('0x56'));return request({'uri':util[_0xbf1b('0xe')](_0xbf1b('0x57'),_0xa71871[_0xbf1b('0x1c')],_0x5b966f['id'],_0x31643c['id']),'method':_0xbf1b('0x10')});case _0xbf1b('0x58'):logger[_0xbf1b('0xc')](_0xbf1b('0x4c'),_0xbf1b('0x59'));emit(util[_0xbf1b('0xe')]('user:%s',_0xbe0931[_0xbf1b('0x13')]),_0xbf1b('0x5a'),{'uri':util[_0xbf1b('0xe')]('%s/agent/tickets/%s',_0xa71871[_0xbf1b('0x1c')][_0xbf1b('0x5b')](_0xbf1b('0x5c'),''),_0x31643c['id'])});break;default:logger[_0xbf1b('0x5d')](_0xbf1b('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xbf1b('0x5e')](function(_0x43b3a9){logger[_0xbf1b('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x43b3a9,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x177715,_0x327689,_0x200c33,_0xb8c38b,_0x2e258d,_0x33a31a,_0x10ea5a){var _0x384286,_0x5eb76d;_0x33a31a[_0xbf1b('0x1c')]=intUtil[_0xbf1b('0x49')](_0x33a31a[_0xbf1b('0x1c')]);_0x33a31a[_0xbf1b('0x4a')]=intUtil[_0xbf1b('0x49')](_0x33a31a[_0xbf1b('0x4a')]);if(_0x10ea5a&&_0x10ea5a[_0xbf1b('0x5f')]&&_0x10ea5a[_0xbf1b('0x5f')]!==_0xbf1b('0x60')){logger[_0xbf1b('0xc')](_0xbf1b('0x61'),_0xbf1b('0x62'));_0x327689[_0xbf1b('0x4d')]=util['format'](_0xbf1b('0x4e'),_0x33a31a[_0xbf1b('0x4a')],_0x327689[_0xbf1b('0x4f')],md5(_0x327689[_0xbf1b('0x4f')]));}headers[_0xbf1b('0x50')]=getAuth(_0x33a31a);return getUser(_0x33a31a,_0xb8c38b[_0xbf1b('0x51')])[_0xbf1b('0x23')](function(_0x5d5b4e){_0x384286=_0x5d5b4e;logger['info'](_0xbf1b('0x52'),_0x384286['id']);return getEndUser(_0x33a31a,_0x327689['destcalleridname'],_0x327689[_0xbf1b('0x63')]);})[_0xbf1b('0x23')](function(_0x316225){_0x5eb76d=_0x316225;logger[_0xbf1b('0xc')](_0xbf1b('0x54'),_0x5eb76d['id']);return getTicket(_0x33a31a,_0x384286,_0x5eb76d,_0x200c33,_0x327689);})[_0xbf1b('0x23')](function(_0x5555ed){if(_0x5555ed){logger[_0xbf1b('0xc')](_0xbf1b('0x55'),_0x5555ed['id']);switch(_0x33a31a['type']){case _0xbf1b('0x64'):logger['info']('[OUTBOUND]',_0xbf1b('0x56'));return request({'uri':util[_0xbf1b('0xe')](_0xbf1b('0x57'),_0x33a31a[_0xbf1b('0x1c')],_0x384286['id'],_0x5555ed['id']),'method':_0xbf1b('0x10')});case _0xbf1b('0x58'):logger[_0xbf1b('0xc')]('[OUTBOUND]',_0xbf1b('0x59'));emit(util[_0xbf1b('0xe')](_0xbf1b('0x65'),_0xb8c38b[_0xbf1b('0x13')]),_0xbf1b('0x5a'),{'uri':util[_0xbf1b('0xe')](_0xbf1b('0x66'),_0x33a31a[_0xbf1b('0x1c')]['replace']('/api/v2',''),_0x5555ed['id'])});break;default:logger[_0xbf1b('0x5d')](_0xbf1b('0x61'),_0xbf1b('0x67'));}}})[_0xbf1b('0x5e')](function(_0x1378bf){logger['error'](_0xbf1b('0x68'),util[_0xbf1b('0x69')](_0x1378bf,{'showHidden':!![],'depth':null}));});};exports[_0xbf1b('0x6a')]=function(_0x2d6b36,_0x23e08a,_0x2c9678,_0x517b4b,_0x1bb76b,_0x266f6a){var _0x23068c,_0x426ff1;_0x266f6a[_0xbf1b('0x1c')]=intUtil['stripTrailingSlash'](_0x266f6a[_0xbf1b('0x1c')]);_0x266f6a[_0xbf1b('0x4a')]=intUtil[_0xbf1b('0x49')](_0x266f6a[_0xbf1b('0x4a')]);if(_0x1bb76b&&_0x1bb76b[_0xbf1b('0x4b')]){logger[_0xbf1b('0xc')]('['+_0x23e08a[_0xbf1b('0x6b')][_0xbf1b('0x6c')]()+']',_0xbf1b('0x62'));_0x23e08a[_0xbf1b('0x4d')]=util[_0xbf1b('0xe')](_0xbf1b('0x4e'),_0x266f6a['serverUrl'],_0x23e08a[_0xbf1b('0x4f')],md5(_0x23e08a[_0xbf1b('0x4f')]));}else{_0x23e08a[_0xbf1b('0x4d')]='';}headers['Authorization']=getAuth(_0x266f6a);return getUser(_0x266f6a)[_0xbf1b('0x23')](function(_0x6563bf){_0x23068c=_0x6563bf;logger[_0xbf1b('0xc')](_0xbf1b('0x52'),_0x23068c['id']);return getEndUser(_0x266f6a,_0x23e08a[_0xbf1b('0x53')],_0x23e08a['calleridnum']);})[_0xbf1b('0x23')](function(_0xc6409f){_0x426ff1=_0xc6409f;logger[_0xbf1b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x426ff1['id']);return getTicket(_0x266f6a,_0x23068c,_0x426ff1,_0x2c9678,_0x23e08a);})['then'](function(_0x25deb9){if(_0x25deb9){logger[_0xbf1b('0xc')](_0xbf1b('0x55'),_0x25deb9['id']);}})[_0xbf1b('0x5e')](function(_0x38226b){logger['error']('['+_0x23e08a[_0xbf1b('0x6b')]['toUpperCase']()+']'+_0xbf1b('0x6d'),util[_0xbf1b('0x69')](_0x38226b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf8b0=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','Authorization','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','info','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','then','find','results','agent','remoteUri','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','variable','variableName','customVariable','Variable','push','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum'];(function(_0x583c63,_0x2d0240){var _0x3b026f=function(_0x283c74){while(--_0x283c74){_0x583c63['push'](_0x583c63['shift']());}};_0x3b026f(++_0x2d0240);}(_0xf8b0,0x1e6));var _0x0f8b=function(_0x2c81e7,_0x43cdfd){_0x2c81e7=_0x2c81e7-0x0;var _0x1cceef=_0xf8b0[_0x2c81e7];return _0x1cceef;};'use strict';var _=require(_0x0f8b('0x0'));var rp=require(_0x0f8b('0x1'));var md5=require(_0x0f8b('0x2'));var util=require(_0x0f8b('0x3'));var Redis=require(_0x0f8b('0x4'));var intUtil=require(_0x0f8b('0x5'));var config=require(_0x0f8b('0x6'));var logger=require(_0x0f8b('0x7'))(_0x0f8b('0x8'));config[_0x0f8b('0x9')]=_[_0x0f8b('0xa')](config[_0x0f8b('0x9')],{'host':_0x0f8b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4dfd10,_0x406929,_0x4aadf1){io['to'](_0x4dfd10)[_0x0f8b('0xc')](_0x406929,_0x4aadf1);}var headers={'Content-Type':'application/json','Accept':_0x0f8b('0xd')};function getTicket(_0x5c7ee3,_0xfbf6d8,_0x58922b,_0x4fce56,_0x38d7e5){logger['info'](_0x0f8b('0xe'));return request({'uri':util[_0x0f8b('0xf')](_0x0f8b('0x10'),_0x5c7ee3['remoteUri']),'method':_0x0f8b('0x11'),'body':{'ticket':_[_0x0f8b('0x12')]({'requester_id':_0x58922b['id'],'submitter_id':_0xfbf6d8?_0xfbf6d8['id']:undefined,'assignee_id':_0xfbf6d8?_0xfbf6d8['id']:undefined,'tags':getTags(_0x4fce56[_0x0f8b('0x13')],_0x0f8b('0x14')),'subject':intUtil[_0x0f8b('0x15')](_0x4fce56[_0x0f8b('0x16')],_0x38d7e5,'\x20'),'description':intUtil[_0x0f8b('0x15')](_0x4fce56[_0x0f8b('0x17')],_0x38d7e5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0f8b('0x15')](_0x4fce56[_0x0f8b('0x17')],_0x38d7e5,'\x0a')}},getCustomFields(_0x4fce56['Fields'],_0x38d7e5))}})['then'](function(_0x49c939){logger[_0x0f8b('0x18')](_0x0f8b('0x19'));return _0x49c939[_0x0f8b('0x1a')];});}function getUser(_0x3c24b5,_0x3c86e8){if(intUtil[_0x0f8b('0x1b')](_0x3c86e8)){logger[_0x0f8b('0x18')]('Getting\x20agent\x20with\x20email',_0x3c86e8);return request({'uri':util[_0x0f8b('0xf')](_0x0f8b('0x1c'),_0x3c24b5['remoteUri']),'qs':{'query':util[_0x0f8b('0xf')](_0x0f8b('0x1d'),_0x3c86e8)}})[_0x0f8b('0x1e')](function(_0x11ed51){if(_0x11ed51['count']){logger[_0x0f8b('0x18')]('Agent\x20found!');return _[_0x0f8b('0x1f')](_0x11ed51[_0x0f8b('0x20')],{'email':_0x3c86e8,'role':_0x0f8b('0x21')});}else{logger[_0x0f8b('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0f8b('0xf')]('%s/users/me.json',_0x3c24b5[_0x0f8b('0x22')])})[_0x0f8b('0x1e')](function(_0x1ce909){logger[_0x0f8b('0x18')](_0x0f8b('0x23'));return _0x1ce909[_0x0f8b('0x24')];});}});}else{logger['info'](_0x0f8b('0x25'));return request({'uri':util[_0x0f8b('0xf')](_0x0f8b('0x26'),_0x3c24b5[_0x0f8b('0x22')])})[_0x0f8b('0x1e')](function(_0x345b37){logger[_0x0f8b('0x18')](_0x0f8b('0x23'));return _0x345b37['user'];});}}function getEndUser(_0x58ad2,_0x2e0a70,_0x11b7ba){logger[_0x0f8b('0x18')](_0x0f8b('0x27'),_0x11b7ba);return request({'uri':util['format']('%s/search.json',_0x58ad2[_0x0f8b('0x22')]),'qs':{'query':util[_0x0f8b('0xf')](_0x0f8b('0x28'),_0x11b7ba)}})[_0x0f8b('0x1e')](function(_0x3a8853){var _0x49ac70;if(_0x3a8853[_0x0f8b('0x20')][_0x0f8b('0x29')]){_0x3a8853[_0x0f8b('0x20')]=_[_0x0f8b('0x2a')](_0x3a8853['results'],{'suspended':![],'role':_0x0f8b('0x2b')});if(_0x3a8853[_0x0f8b('0x20')][_0x0f8b('0x29')]){_0x49ac70=_['first'](_0x3a8853[_0x0f8b('0x20')]);}}if(_0x49ac70){logger[_0x0f8b('0x18')](_0x0f8b('0x2c'));return _0x49ac70;}else{logger[_0x0f8b('0x18')](_0x0f8b('0x2d'));return request({'uri':util[_0x0f8b('0xf')]('%s/users.json',_0x58ad2[_0x0f8b('0x22')]),'method':_0x0f8b('0x11'),'body':{'user':{'role':'end-user','name':util['format'](_0x0f8b('0x2e'),_0x2e0a70||_0x11b7ba),'phone':_0x11b7ba}}})[_0x0f8b('0x1e')](function(_0x5bc949){logger['info'](_0x0f8b('0x2f'));return _0x5bc949[_0x0f8b('0x24')];});}});}function getAuth(_0x2b466b){var _0x1166cc;if(_0x2b466b[_0x0f8b('0x30')]===_0x0f8b('0x31')){_0x1166cc=util[_0x0f8b('0xf')](_0x0f8b('0x32'),_0x2b466b[_0x0f8b('0x33')],_0x2b466b[_0x0f8b('0x31')]);}else if(_0x2b466b[_0x0f8b('0x30')]===_0x0f8b('0x34')){_0x1166cc=util[_0x0f8b('0xf')](_0x0f8b('0x35'),_0x2b466b[_0x0f8b('0x33')],_0x2b466b[_0x0f8b('0x34')]);}return util['format'](_0x0f8b('0x36'),new Buffer(_0x1166cc)[_0x0f8b('0x37')](_0x0f8b('0x38')));}function request(_0x1ef018){logger[_0x0f8b('0x39')]('[HTTP]',JSON['stringify'](_0x1ef018));return rp(_[_0x0f8b('0xa')](_0x1ef018,{'method':_0x0f8b('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x5b6abe,_0x2a2537){var _0x49bd85=[];if(_0x5b6abe&&_0x5b6abe[_0x0f8b('0x29')]>0x0){_0x49bd85=_[_0x0f8b('0x3b')](_0x5b6abe,_0x2a2537);}return _0x49bd85;}function getCustomFields(_0x49d6e3,_0x16de29){var _0x3aaf07=[];var _0x32dc07={'custom_fields':[]};if(_0x49d6e3[_0x0f8b('0x29')]>0x0){_[_0x0f8b('0x3c')](_0x49d6e3,function(_0x8d578f){if(_[_0x0f8b('0x3d')]([_0x0f8b('0x3e'),_0x0f8b('0x3f')],_0x8d578f[_0x0f8b('0x40')])&&_0x8d578f[_0x0f8b('0x41')]&&!_0x8d578f[_0x0f8b('0x42')]){_0x32dc07[_0x8d578f[_0x0f8b('0x41')][_0x0f8b('0x43')]()]=_0x8d578f[_0x0f8b('0x44')][_0x0f8b('0x37')]();}else if(_[_0x0f8b('0x3d')]([_0x0f8b('0x3e'),_0x0f8b('0x3f')],_0x8d578f['type'])&&_0x8d578f[_0x0f8b('0x45')]&&_0x8d578f['customField']){_0x32dc07[_0x0f8b('0x46')]['push']({'id':_0x8d578f['idField'],'value':_0x8d578f[_0x0f8b('0x44')][_0x0f8b('0x37')]()});}else if(_0x8d578f['type']===_0x0f8b('0x47')&&_0x8d578f[_0x0f8b('0x48')]&&_0x8d578f[_0x0f8b('0x45')]&&_0x8d578f[_0x0f8b('0x42')]){_0x16de29[_0x8d578f[_0x0f8b('0x48')]]&&_0x32dc07[_0x0f8b('0x46')]['push']({'id':_0x8d578f[_0x0f8b('0x45')],'value':_0x16de29[_0x8d578f[_0x0f8b('0x48')]][_0x0f8b('0x37')]()});}else if(_0x8d578f[_0x0f8b('0x40')]===_0x0f8b('0x49')&&_0x8d578f[_0x0f8b('0x4a')]&&_0x8d578f[_0x0f8b('0x4a')]['name']&&_0x8d578f[_0x0f8b('0x45')]&&_0x8d578f[_0x0f8b('0x42')]){_0x16de29[_0x8d578f[_0x0f8b('0x4a')][_0x0f8b('0x14')][_0x0f8b('0x43')]()]&&_0x32dc07[_0x0f8b('0x46')][_0x0f8b('0x4b')]({'id':_0x8d578f[_0x0f8b('0x45')],'value':_0x16de29[_0x8d578f[_0x0f8b('0x4a')]['name'][_0x0f8b('0x43')]()][_0x0f8b('0x37')]()});}});}return _0x32dc07;}exports[_0x0f8b('0x4c')]=function(_0x61c355,_0x31d6c1,_0x5f6415,_0x2eb99e,_0x3e5d17,_0x194f3f){var _0xf676ca,_0x2f3a21;_0x194f3f['remoteUri']=intUtil['stripTrailingSlash'](_0x194f3f[_0x0f8b('0x22')]);_0x194f3f[_0x0f8b('0x4d')]=intUtil[_0x0f8b('0x4e')](_0x194f3f['serverUrl']);if(_0x3e5d17&&_0x3e5d17[_0x0f8b('0x4f')]){logger[_0x0f8b('0x18')](_0x0f8b('0x50'),_0x0f8b('0x51'));_0x31d6c1[_0x0f8b('0x52')]=util[_0x0f8b('0xf')](_0x0f8b('0x53'),_0x194f3f[_0x0f8b('0x4d')],_0x31d6c1[_0x0f8b('0x54')],md5(_0x31d6c1[_0x0f8b('0x54')]));}else{_0x31d6c1[_0x0f8b('0x52')]='';}headers['Authorization']=getAuth(_0x194f3f);return getUser(_0x194f3f,_0x2eb99e[_0x0f8b('0x55')])[_0x0f8b('0x1e')](function(_0x2baa06){_0xf676ca=_0x2baa06;logger[_0x0f8b('0x18')](_0x0f8b('0x56'),_0xf676ca['id']);return getEndUser(_0x194f3f,_0x31d6c1[_0x0f8b('0x57')],_0x31d6c1[_0x0f8b('0x58')]);})[_0x0f8b('0x1e')](function(_0x4e43d8){_0x2f3a21=_0x4e43d8;logger['info'](_0x0f8b('0x59'),_0x2f3a21['id']);return getTicket(_0x194f3f,_0xf676ca,_0x2f3a21,_0x5f6415,_0x31d6c1);})['then'](function(_0x3c82d5){if(_0x3c82d5){logger['info'](_0x0f8b('0x5a'),_0x3c82d5['id']);switch(_0x194f3f[_0x0f8b('0x40')]){case _0x0f8b('0x5b'):logger[_0x0f8b('0x18')]('[QUEUE]',_0x0f8b('0x5c'));return request({'uri':util[_0x0f8b('0xf')](_0x0f8b('0x5d'),_0x194f3f[_0x0f8b('0x22')],_0xf676ca['id'],_0x3c82d5['id']),'method':'POST'});case _0x0f8b('0x5e'):logger[_0x0f8b('0x18')](_0x0f8b('0x50'),_0x0f8b('0x5f'));emit(util[_0x0f8b('0xf')](_0x0f8b('0x60'),_0x2eb99e['name']),_0x0f8b('0x61'),{'uri':util[_0x0f8b('0xf')](_0x0f8b('0x62'),_0x194f3f[_0x0f8b('0x22')][_0x0f8b('0x63')]('/api/v2',''),_0x3c82d5['id'])});break;default:logger[_0x0f8b('0x64')](_0x0f8b('0x50'),_0x0f8b('0x65'));}}})[_0x0f8b('0x66')](function(_0x55304a){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0f8b('0x67')](_0x55304a,{'showHidden':!![],'depth':null}));});};exports[_0x0f8b('0x68')]=function(_0x44cbf8,_0x3971de,_0x24c434,_0x24cdc5,_0x348a47,_0xe81cda,_0x159eaf){var _0x403ec7,_0x21edeb;_0xe81cda['remoteUri']=intUtil['stripTrailingSlash'](_0xe81cda[_0x0f8b('0x22')]);_0xe81cda[_0x0f8b('0x4d')]=intUtil['stripTrailingSlash'](_0xe81cda['serverUrl']);if(_0x159eaf&&_0x159eaf[_0x0f8b('0x69')]&&_0x159eaf['recordingFormat']!==_0x0f8b('0x6a')){logger[_0x0f8b('0x18')](_0x0f8b('0x6b'),_0x0f8b('0x51'));_0x3971de[_0x0f8b('0x52')]=util[_0x0f8b('0xf')](_0x0f8b('0x53'),_0xe81cda[_0x0f8b('0x4d')],_0x3971de['uniqueid'],md5(_0x3971de[_0x0f8b('0x54')]));}headers['Authorization']=getAuth(_0xe81cda);return getUser(_0xe81cda,_0x24cdc5[_0x0f8b('0x55')])[_0x0f8b('0x1e')](function(_0x2918f6){_0x403ec7=_0x2918f6;logger[_0x0f8b('0x18')]('The\x20User\x20ID\x20is:',_0x403ec7['id']);return getEndUser(_0xe81cda,_0x3971de['destcalleridname'],_0x3971de[_0x0f8b('0x6c')]);})[_0x0f8b('0x1e')](function(_0x19ba57){_0x21edeb=_0x19ba57;logger['info'](_0x0f8b('0x59'),_0x21edeb['id']);return getTicket(_0xe81cda,_0x403ec7,_0x21edeb,_0x24c434,_0x3971de);})[_0x0f8b('0x1e')](function(_0x47f188){if(_0x47f188){logger[_0x0f8b('0x18')]('The\x20Ticket\x20ID\x20is:',_0x47f188['id']);switch(_0xe81cda[_0x0f8b('0x40')]){case _0x0f8b('0x5b'):logger[_0x0f8b('0x18')](_0x0f8b('0x6b'),_0x0f8b('0x5c'));return request({'uri':util[_0x0f8b('0xf')](_0x0f8b('0x5d'),_0xe81cda[_0x0f8b('0x22')],_0x403ec7['id'],_0x47f188['id']),'method':_0x0f8b('0x11')});case _0x0f8b('0x5e'):logger[_0x0f8b('0x18')](_0x0f8b('0x6b'),_0x0f8b('0x5f'));emit(util[_0x0f8b('0xf')](_0x0f8b('0x60'),_0x24cdc5[_0x0f8b('0x14')]),_0x0f8b('0x61'),{'uri':util[_0x0f8b('0xf')](_0x0f8b('0x62'),_0xe81cda['remoteUri'][_0x0f8b('0x63')]('/api/v2',''),_0x47f188['id'])});break;default:logger[_0x0f8b('0x64')](_0x0f8b('0x6b'),_0x0f8b('0x65'));}}})[_0x0f8b('0x66')](function(_0x174df1){logger['error'](_0x0f8b('0x6d'),util['inspect'](_0x174df1,{'showHidden':!![],'depth':null}));});};exports[_0x0f8b('0x6e')]=function(_0x47ec24,_0x2ea5d5,_0x560d61,_0x467495,_0x4f2a04,_0x27d2ae){var _0x49f9a2,_0x99b410;_0x27d2ae[_0x0f8b('0x22')]=intUtil[_0x0f8b('0x4e')](_0x27d2ae[_0x0f8b('0x22')]);_0x27d2ae['serverUrl']=intUtil[_0x0f8b('0x4e')](_0x27d2ae[_0x0f8b('0x4d')]);if(_0x4f2a04&&_0x4f2a04[_0x0f8b('0x4f')]){logger[_0x0f8b('0x18')]('['+_0x2ea5d5[_0x0f8b('0x6f')][_0x0f8b('0x70')]()+']','Recording\x20is\x20enabled!');_0x2ea5d5[_0x0f8b('0x52')]=util[_0x0f8b('0xf')](_0x0f8b('0x53'),_0x27d2ae['serverUrl'],_0x2ea5d5[_0x0f8b('0x54')],md5(_0x2ea5d5[_0x0f8b('0x54')]));}else{_0x2ea5d5[_0x0f8b('0x52')]='';}headers[_0x0f8b('0x71')]=getAuth(_0x27d2ae);return getUser(_0x27d2ae)[_0x0f8b('0x1e')](function(_0x3ee0ed){_0x49f9a2=_0x3ee0ed;logger['info'](_0x0f8b('0x56'),_0x49f9a2['id']);return getEndUser(_0x27d2ae,_0x2ea5d5['calleridname'],_0x2ea5d5[_0x0f8b('0x58')]);})[_0x0f8b('0x1e')](function(_0x47fe7a){_0x99b410=_0x47fe7a;logger[_0x0f8b('0x18')](_0x0f8b('0x59'),_0x99b410['id']);return getTicket(_0x27d2ae,_0x49f9a2,_0x99b410,_0x560d61,_0x2ea5d5);})[_0x0f8b('0x1e')](function(_0x4d7182){if(_0x4d7182){logger[_0x0f8b('0x18')](_0x0f8b('0x5a'),_0x4d7182['id']);}})[_0x0f8b('0x66')](function(_0xb8efa){logger[_0x0f8b('0x64')]('['+_0x2ea5d5[_0x0f8b('0x6f')][_0x0f8b('0x70')]()+']'+_0x0f8b('0x72'),util[_0x0f8b('0x67')](_0xb8efa,{'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 e49e6f3..79fd4ac 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 _0x19cc=['refresh_token','then','access_token','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','ActiveUsers','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','code','SUCCESS','details','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','administrator','last_name','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','format','mm:ss','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x19cc,0x10c));var _0xc19c=function(_0x2d1971,_0x20b764){_0x2d1971=_0x2d1971-0x0;var _0x4d7759=_0x19cc[_0x2d1971];return _0x4d7759;};'use strict';var _=require(_0xc19c('0x0'));var rp=require(_0xc19c('0x1'));var md5=require(_0xc19c('0x2'));var util=require('util');var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xc19c('0x3'));var BPromise=require(_0xc19c('0x4'));var config=require(_0xc19c('0x5'));var logger=require(_0xc19c('0x6'))(_0xc19c('0x7'));config[_0xc19c('0x8')]=_[_0xc19c('0x9')](config[_0xc19c('0x8')],{'host':_0xc19c('0xa'),'port':0x18eb});var io=require(_0xc19c('0xb'))(new Redis(config[_0xc19c('0x8')]));function emit(_0x2764f9,_0x3b22a1,_0x12d23a){io['to'](_0x2764f9)[_0xc19c('0xc')](_0x3b22a1,_0x12d23a);}function request(_0x4ab093){logger[_0xc19c('0xd')](_0xc19c('0xe'),JSON[_0xc19c('0xf')](_0x4ab093));return rp(_0x4ab093);}function getCustomFields(_0x3228f1,_0x31ef1d){var _0x17bf9b={};if(_0x3228f1[_0xc19c('0x10')]>0x0){_[_0xc19c('0x11')](_0x3228f1,function(_0x279abe){if(_[_0xc19c('0x12')](['string',_0xc19c('0x13')],_0x279abe['type'])&&_0x279abe[_0xc19c('0x14')]){_0x17bf9b[_0x279abe[_0xc19c('0x14')]]=_0x279abe[_0xc19c('0x15')][_0xc19c('0x16')]();}else if(_0x279abe[_0xc19c('0x17')]===_0xc19c('0x18')&&_0x279abe[_0xc19c('0x19')]&&_0x279abe[_0xc19c('0x14')]&&_0x31ef1d[_0x279abe[_0xc19c('0x19')]]){_0x17bf9b[_0x279abe[_0xc19c('0x14')]]=_0x31ef1d[_0x279abe[_0xc19c('0x19')]][_0xc19c('0x16')]();}else if(_0x279abe[_0xc19c('0x17')]===_0xc19c('0x1a')&&_0x279abe[_0xc19c('0x1b')]&&_0x279abe[_0xc19c('0x1b')][_0xc19c('0x1c')]&&_0x279abe[_0xc19c('0x14')]&&_0x31ef1d[_0x279abe[_0xc19c('0x1b')][_0xc19c('0x1c')][_0xc19c('0x1d')]()]){_0x17bf9b[_0x279abe['idField']]=_0x31ef1d[_0x279abe[_0xc19c('0x1b')][_0xc19c('0x1c')][_0xc19c('0x1d')]()][_0xc19c('0x16')]();}});}return _0x17bf9b;}function getName(_0x302013){if(_0x302013['indexOf']('\x20')>0x0){var _0x50868e=_0x302013[_0xc19c('0x1e')](/ (.+)/);if(_0x50868e[0x1]){return _0x50868e;}}return[_0x302013,_0x302013];}var accountsTokens={};function getAccessToken(_0x4ec07b){return new Promise(function(_0x302390,_0x4fea6c){if(!_[_0xc19c('0x1f')](accountsTokens[_0x4ec07b['id']])&&!_[_0xc19c('0x1f')](accountsTokens[_0x4ec07b['id']]['access_token'])){if(moment()[_0xc19c('0x20')](accountsTokens[_0x4ec07b['id']][_0xc19c('0x21')])){_0x302390(accountsTokens[_0x4ec07b['id']]['access_token']);}}var _0x14c329;switch(_0x4ec07b['zone']){case'US':_0x14c329=_0xc19c('0x22');break;case'AU':_0x14c329=_0xc19c('0x23');break;case'EU':_0x14c329=_0xc19c('0x24');break;case'IN':_0x14c329=_0xc19c('0x25');break;case'CN':_0x14c329='https://accounts.zoho.com.cn';break;default:_0x14c329=_0xc19c('0x24');break;}var _0x5434cb={'method':'POST','uri':_0x14c329+_0xc19c('0x26'),'qs':{'refresh_token':_0x4ec07b[_0xc19c('0x27')],'client_id':_0x4ec07b[_0xc19c('0x28')],'client_secret':_0x4ec07b[_0xc19c('0x29')],'grant_type':_0xc19c('0x2a')},'json':!![]};return rp(_0x5434cb)[_0xc19c('0x2b')](function(_0x43a614){accountsTokens[_0x4ec07b['id']]={'access_token':_0x43a614[_0xc19c('0x2c')],'expires_in':moment()[_0xc19c('0x2d')](_0x43a614[_0xc19c('0x21')],_0xc19c('0x2e'))};_0x302390(_0x43a614[_0xc19c('0x2c')]);})['catch'](function(_0x548414){logger[_0xc19c('0x2f')](_0xc19c('0x30'),_0x548414[_0xc19c('0x31')]);_0x4fea6c(_0x548414);});});}function getUser(_0x4fcd34,_0x57c2ab,_0x2ea44f,_0x4a69a2){logger[_0xc19c('0x32')]('Search\x20user');return request({'method':_0xc19c('0x33'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x57c2ab),'qs':{'type':_0xc19c('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4fcd34},'json':!![]})[_0xc19c('0x2b')](function(_0x1fc2a9){if(_0x1fc2a9[_0xc19c('0x35')]){var _0x232b68=-0x1;if(_['isArrayLikeObject'](_0x1fc2a9[_0xc19c('0x35')])){if(!_[_0xc19c('0x1f')](_0x4a69a2)){_0x232b68=_[_0xc19c('0x36')](_0x1fc2a9['users'],function(_0x9d811a){return _0x9d811a['email']===_0x4a69a2;});}if(_0x232b68>=0x0){logger[_0xc19c('0x32')](_0xc19c('0x37'));}else{logger[_0xc19c('0x32')](_0xc19c('0x38'));_0x232b68=_[_0xc19c('0x36')](_0x1fc2a9[_0xc19c('0x35')],function(_0x4124f1){return _0x4124f1[_0xc19c('0x39')][_0xc19c('0x1c')]==='Administrator';});}return _0x1fc2a9[_0xc19c('0x35')][_0x232b68];}else{if(_0x1fc2a9[_0xc19c('0x3a')][_0xc19c('0x39')][_0xc19c('0x1c')]==='Administrator'){logger['info'](_0xc19c('0x38'));user=_0x1fc2a9[_0xc19c('0x3a')];return user;}else{logger[_0xc19c('0x2f')](_0xc19c('0x3b'),JSON['stringify'](_0x1fc2a9));throw new Error(_0xc19c('0x3c')+JSON[_0xc19c('0xf')](_0x1fc2a9));}}}else{logger['error'](_0xc19c('0x3b'),JSON[_0xc19c('0xf')](_0x1fc2a9));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x1fc2a9));}})[_0xc19c('0x3d')](function(_0x3874db){console[_0xc19c('0x2f')](_0x3874db);});}function getZohoUser(_0x363d3b,_0x326738){return new BPromise(function(_0x3d8992,_0x5b0a0a){request(_0x363d3b)[_0xc19c('0x2b')](function(_0x3f2a24){var _0x5839c7=null;if(_0x3f2a24){_0x5839c7=_0x3f2a24[_0xc19c('0x3e')][0x0];_0x5839c7[_0xc19c('0x3f')]=_0x326738;}_0x3d8992(_0x5839c7);})[_0xc19c('0x3d')](function(_0x237044){_0x5b0a0a(_0x237044);});});}function createEndUser(_0x1081c7,_0x1a9031,_0x51d15f,_0x2364ff,_0x389077,_0x276257){var _0x51d15f=getName(_0x51d15f);return request({'method':'POST','uri':_0xc19c('0x40')+_0x1a9031+'/crm/v2/'+_[_0xc19c('0x41')](_0x276257[_0xc19c('0x42')])+'s','body':{'data':[{'Last_Name':_0x51d15f[0x1],'First_Name':_0x51d15f[0x0],'Phone':_0x2364ff,'Owner':{'name':!_[_0xc19c('0x1f')](_0x389077['role']['name'])?_0x389077[_0xc19c('0x43')][_0xc19c('0x1c')]:!_[_0xc19c('0x1f')](_0x389077['first_name'])?_0x389077[_0xc19c('0x44')]+'\x20'+_0x389077['last_name']:_0x389077['last_name'],'id':_0x389077['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1081c7},'json':!![]})[_0xc19c('0x2b')](function(_0xbf8f26){if(_0xbf8f26&&_0xbf8f26[_0xc19c('0x3e')][0x0][_0xc19c('0x45')]===_0xc19c('0x46')){var _0x322c8e=_0xbf8f26[_0xc19c('0x3e')][0x0][_0xc19c('0x47')];_0x322c8e['enduserType']=_[_0xc19c('0x41')](_0x276257[_0xc19c('0x42')])+'s';return _0x322c8e;}logger[_0xc19c('0x2f')](_0xc19c('0x3b'),JSON[_0xc19c('0xf')](data));throw new Error('Error:\x20'+JSON[_0xc19c('0xf')](data));})[_0xc19c('0x3d')](function(_0x33cea1){console[_0xc19c('0x48')](_0xc19c('0x49'),_0x33cea1);});}function getEndUser(_0x1c85fa,_0x551ab3,_0x35af02,_0x4b6eab,_0x14d0e4,_0x356418,_0x1de528){var _0x12df8c={'method':_0xc19c('0x33'),'uri':'','headers':{'Authorization':_0xc19c('0x4a')+_0x1c85fa},'json':!![]};switch(_0x1de528[_0xc19c('0x4b')]){case _0xc19c('0x4c'):_0x12df8c['uri']=_0xc19c('0x40')+_0x551ab3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x14d0e4+'))';return getZohoUser(_0x12df8c,_0xc19c('0x4d'))['then'](function(_0x5abfd0){if(_0x5abfd0)return _0x5abfd0;_0x12df8c[_0xc19c('0x4e')]=_0xc19c('0x40')+_0x551ab3+_0xc19c('0x4f')+_0x14d0e4+'))';return getZohoUser(_0x12df8c,_0xc19c('0x50'))[_0xc19c('0x2b')](function(_0x250906){if(_0x250906)return _0x250906;if(_0x1de528[_0xc19c('0x42')]!=_0xc19c('0x51')){return createEndUser(_0x1c85fa,_0x551ab3,_0x4b6eab,_0x14d0e4,_0x356418,_0x1de528);}else{return{};}});});break;case _0xc19c('0x52'):_0x12df8c['uri']='https://www.zohoapis.'+_0x551ab3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x14d0e4+'))';return getZohoUser(_0x12df8c,_0xc19c('0x4d'))[_0xc19c('0x2b')](function(_0x210f6c){if(_0x210f6c)return _0x210f6c;if(_0x1de528[_0xc19c('0x42')]!='nothing'){return createEndUser(_0x1c85fa,_0x551ab3,_0x4b6eab,_0x14d0e4,_0x356418,_0x1de528);}else{return{};}});break;case _0xc19c('0x53'):_0x12df8c['uri']=_0xc19c('0x40')+_0x551ab3+_0xc19c('0x4f')+_0x14d0e4+'))';return getZohoUser(_0x12df8c,_0xc19c('0x50'))[_0xc19c('0x2b')](function(_0x595c1f){if(_0x595c1f)return _0x595c1f;if(_0x1de528[_0xc19c('0x42')]!='nothing'){return createEndUser(_0x1c85fa,_0x551ab3,_0x4b6eab,_0x14d0e4,_0x356418,_0x1de528);}else{return{};}});break;}}function getCall(_0x4504d0,_0x5d20b1,_0x2b97cf,_0x319824,_0x5bcd60,_0x5a827b,_0xcf4081,_0x4b93c5){logger[_0xc19c('0x32')](_0xc19c('0x54'));var _0x411dcd={};_0x411dcd['Owner']={'name':!_['isNil'](_0x319824[_0xc19c('0x43')][_0xc19c('0x1c')])&&!_['isNil'](_0x319824[_0xc19c('0x39')][_0xc19c('0x1c')])&&_0x319824['profile'][_0xc19c('0x1c')]===_0xc19c('0x55')?_0x319824[_0xc19c('0x43')]['name']:!_[_0xc19c('0x1f')](_0x319824[_0xc19c('0x44')])?_0x319824['first_name']+'\x20'+_0x319824[_0xc19c('0x56')]:_0x319824[_0xc19c('0x56')],'id':_0x319824['id']};_0x411dcd[_0xc19c('0x57')]=intUtil[_0xc19c('0x58')](_0x5a827b[_0xc19c('0x59')],_0xcf4081,'\x20');_0x411dcd[_0xc19c('0x5a')]=intUtil[_0xc19c('0x58')](_0x5a827b[_0xc19c('0x5b')],_0xcf4081,'\x0a');if(_0x5bcd60[_0xc19c('0x3f')]===_0xc19c('0x4d')){_0x411dcd['Who_Id']={'name':!_[_0xc19c('0x1f')](_0x5bcd60['Full_Name'])?_0x5bcd60[_0xc19c('0x5c')]:!_[_0xc19c('0x1f')](_0x5bcd60['First_Name'])?_0x5bcd60[_0xc19c('0x5d')]+'\x20'+_0x5bcd60[_0xc19c('0x5e')]:_0x5bcd60[_0xc19c('0x5e')],'id':_0x5bcd60['id']};}if(_0x5bcd60['enduserType']===_0xc19c('0x50')){_0x411dcd[_0xc19c('0x5f')]={'name':!_[_0xc19c('0x1f')](_0x5bcd60[_0xc19c('0x5c')])?_0x5bcd60[_0xc19c('0x5c')]:!_[_0xc19c('0x1f')](_0x5bcd60[_0xc19c('0x5d')])?_0x5bcd60[_0xc19c('0x5d')]+'\x20'+_0x5bcd60['Last_Name']:_0x5bcd60['Last_Name'],'id':_0x5bcd60['id']};_0x411dcd[_0xc19c('0x60')]=_[_0xc19c('0x41')](_0x5bcd60['enduserType']);}if(_0xcf4081[_0xc19c('0x61')]){_0x411dcd['Call_Duration']=moment[_0xc19c('0x62')](parseInt(_0xcf4081['talktime'])*0x3e8)[_0xc19c('0x63')](_0xc19c('0x64'));}else if(_0xcf4081['answertime']&&_0xcf4081['endtime']){_0x411dcd[_0xc19c('0x65')]=moment[_0xc19c('0x62')](moment(_0xcf4081[_0xc19c('0x66')],_0xc19c('0x67'))[_0xc19c('0x68')](moment(_0xcf4081[_0xc19c('0x69')],_0xc19c('0x67'))))['format'](_0xc19c('0x64'));}switch(_0xcf4081[_0xc19c('0x6a')]){case _0xc19c('0x6b'):_0x411dcd['Call_Result']=_0xc19c('0x6c');break;case _0xc19c('0x6d'):case _0xc19c('0x6e'):_0x411dcd[_0xc19c('0x6f')]=_0xc19c('0x70');break;case _0xc19c('0x71'):_0x411dcd[_0xc19c('0x6f')]=_0xc19c('0x72');break;case _0xc19c('0x73'):_0x411dcd[_0xc19c('0x6f')]=_0xc19c('0x74');break;case'timeout':_0x411dcd[_0xc19c('0x6f')]='Timeout';default:}_0x411dcd['Call_Start_Time']=(_0x4b93c5===_0xc19c('0x75')?moment(_0xcf4081['starttime'])['format'](_0xc19c('0x67')):moment(_0xcf4081[_0xc19c('0x76')])[_0xc19c('0x63')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xc19c('0x67'));_0x411dcd[_0xc19c('0x77')]=_0x4b93c5||_0xc19c('0x78');_0x411dcd=_[_0xc19c('0x79')](_0x411dcd,getCustomFields(_0x5a827b[_0xc19c('0x7a')],_0xcf4081));return request({'method':'POST','uri':_0xc19c('0x40')+_0x5d20b1+_0xc19c('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4504d0},'body':{'data':[_0x411dcd]},'json':!![]})[_0xc19c('0x2b')](function(_0x4e8765){if(_0x4e8765&&_0x4e8765[_0xc19c('0x3e')][0x0]['code']===_0xc19c('0x46')){logger['info'](_0xc19c('0x7c'));return{'id':_0x4e8765[_0xc19c('0x3e')][0x0]['details']['id']};}})[_0xc19c('0x3d')](function(_0x47dea0){logger[_0xc19c('0x32')]('err',_0x47dea0[_0xc19c('0x31')]);console[_0xc19c('0x48')](_0xc19c('0x7d'),_0x47dea0);});}exports[_0xc19c('0x7e')]=function(_0x1db025,_0x32a387,_0x401669,_0x29fd57,_0x560807,_0x2d13d6){var _0xa53ae8,_0x5d30d5,_0x371603;_0x2d13d6[_0xc19c('0x7f')]=intUtil[_0xc19c('0x80')](_0x2d13d6[_0xc19c('0x7f')]);_0x2d13d6[_0xc19c('0x81')]=intUtil[_0xc19c('0x80')](_0x2d13d6['serverUrl']);if(_0x560807&&_0x560807[_0xc19c('0x82')]){logger[_0xc19c('0x32')](_0xc19c('0x83'),'Recording\x20is\x20enabled!');_0x32a387[_0xc19c('0x84')]=_0x2d13d6['serverUrl']+_0xc19c('0x85')+_0x32a387[_0xc19c('0x86')]+_0xc19c('0x87')+md5(_0x32a387[_0xc19c('0x86')]);}else{_0x32a387['recordingURL']='';}var _0x1b60b9=_0x2d13d6['host']===_0xc19c('0x88')?'eu':_0xc19c('0x89');return getAccessToken(_0x2d13d6)[_0xc19c('0x2b')](function(_0x2c1371){_0x371603=_0x2c1371;return getUser(_0x371603,_0x1b60b9,_0x2d13d6,_0x29fd57[_0xc19c('0x8a')]);})[_0xc19c('0x2b')](function(_0x58cbb0){_0xa53ae8=_0x58cbb0;logger[_0xc19c('0x32')](_0xc19c('0x8b'),_0xa53ae8['id']);return getEndUser(_0x371603,_0x1b60b9,_0x2d13d6,_0x32a387[_0xc19c('0x8c')],_0x32a387[_0xc19c('0x8d')],_0xa53ae8,_0x401669);})[_0xc19c('0x2b')](function(_0x1fb536){_0x5d30d5=_0x1fb536;return getCall(_0x371603,_0x1b60b9,_0x2d13d6,_0xa53ae8,_0x5d30d5,_0x401669,_0x32a387,_0xc19c('0x78'));})[_0xc19c('0x2b')](function(_0x4e1eb7){if(_0x4e1eb7){logger[_0xc19c('0x32')]('The\x20Call\x20ID\x20is:',_0x4e1eb7['id']);logger[_0xc19c('0x32')](_0xc19c('0x83'),_0xc19c('0x8e'));emit(util[_0xc19c('0x63')](_0xc19c('0x8f'),_0x29fd57[_0xc19c('0x1c')]),'trigger:browser:url',{'uri':_0xc19c('0x90')+_0x2d13d6[_0xc19c('0x7f')]+_0xc19c('0x91')+_0x4e1eb7['id']});}})['catch'](function(_0x12e725){logger['error'](_0xc19c('0x83'),JSON[_0xc19c('0xf')](_0x12e725));});};exports[_0xc19c('0x75')]=function(_0x2869ac,_0x38176d,_0x2d4315,_0x2c3286,_0x456c2c,_0x33217e,_0x420283){var _0x5ad69a,_0x1fdbb1,_0x1b92c8;_0x33217e[_0xc19c('0x7f')]=intUtil[_0xc19c('0x80')](_0x33217e[_0xc19c('0x7f')]);_0x33217e[_0xc19c('0x81')]=intUtil[_0xc19c('0x80')](_0x33217e[_0xc19c('0x81')]);if(_0x420283&&_0x420283[_0xc19c('0x92')]&&_0x420283[_0xc19c('0x92')]!==_0xc19c('0x93')){logger[_0xc19c('0x32')]('[OUTBOUND]',_0xc19c('0x94'));_0x38176d[_0xc19c('0x84')]=_0x33217e[_0xc19c('0x81')]+_0xc19c('0x85')+_0x38176d[_0xc19c('0x86')]+_0xc19c('0x87')+md5(_0x38176d[_0xc19c('0x86')]);}var _0x5e46d0=_0x33217e[_0xc19c('0x7f')]==='zoho.eu'?'eu':_0xc19c('0x89');return getAccessToken(_0x33217e)[_0xc19c('0x2b')](function(_0x556b29){_0x1b92c8=_0x556b29;return getUser(_0x1b92c8,_0x5e46d0,_0x33217e,_0x2c3286[_0xc19c('0x8a')]);})['then'](function(_0x8ccdc1){_0x5ad69a=_0x8ccdc1;logger['info'](_0xc19c('0x8b'),_0x5ad69a['id']);return getEndUser(_0x1b92c8,_0x5e46d0,_0x33217e,_0x38176d['destcalleridname'],_0x38176d[_0xc19c('0x95')],_0x5ad69a,_0x2d4315);})[_0xc19c('0x2b')](function(_0x4e1271){_0x1fdbb1=_0x4e1271;return getCall(_0x1b92c8,_0x5e46d0,_0x33217e,_0x5ad69a,_0x1fdbb1,_0x2d4315,_0x38176d,_0xc19c('0x96'));})['then'](function(_0x42f489){if(_0x42f489){logger['info']('The\x20Call\x20ID\x20is:',_0x42f489['id']);logger['info'](_0xc19c('0x97'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc19c('0x63')](_0xc19c('0x8f'),_0x2c3286['name']),_0xc19c('0x98'),{'uri':_0xc19c('0x90')+_0x33217e[_0xc19c('0x7f')]+_0xc19c('0x91')+_0x42f489['id']});}})[_0xc19c('0x3d')](function(_0x1e3065){logger['error'](_0xc19c('0x97'),JSON[_0xc19c('0xf')](_0x1e3065));});};exports[_0xc19c('0x99')]=function(_0x14629d,_0x189725,_0x518283,_0x44ec58,_0xbe8ca1,_0xd1a830){var _0x2c199b,_0x3a9e48,_0x5cf2fe;_0xd1a830[_0xc19c('0x7f')]=intUtil['stripTrailingSlash'](_0xd1a830[_0xc19c('0x7f')]);_0xd1a830[_0xc19c('0x81')]=intUtil[_0xc19c('0x80')](_0xd1a830[_0xc19c('0x81')]);if(_0xbe8ca1&&_0xbe8ca1[_0xc19c('0x82')]){logger['info']('['+_0x189725[_0xc19c('0x6a')][_0xc19c('0x9a')]()+']',_0xc19c('0x94'));_0x189725['recordingURL']=_0xd1a830['serverUrl']+_0xc19c('0x85')+_0x189725[_0xc19c('0x86')]+_0xc19c('0x87')+md5(_0x189725[_0xc19c('0x86')]);}else{_0x189725[_0xc19c('0x84')]='';}var _0x5bebbf=_0xd1a830['host']===_0xc19c('0x88')?'eu':'com';return getAccessToken(_0xd1a830)[_0xc19c('0x2b')](function(_0x31ca2d){_0x5cf2fe=_0x31ca2d;return getUser(_0x5cf2fe,_0x5bebbf,_0xd1a830);})['then'](function(_0x341d2d){_0x2c199b=_0x341d2d;logger['info']('The\x20User\x20ID\x20is:',_0x2c199b['id']);return getEndUser(_0x5cf2fe,_0x5bebbf,_0xd1a830,_0x189725[_0xc19c('0x8c')],_0x189725[_0xc19c('0x8d')],_0x2c199b,_0x518283);})[_0xc19c('0x2b')](function(_0x3e0e03){_0x3a9e48=_0x3e0e03;return getCall(_0x5cf2fe,_0x5bebbf,_0xd1a830,_0x2c199b,_0x3a9e48,_0x518283,_0x189725,_0xc19c('0x78'));})[_0xc19c('0x2b')](function(_0x5a95de){if(_0x5a95de){logger[_0xc19c('0x32')]('The\x20Call\x20ID\x20is:',_0x5a95de['id']);}})[_0xc19c('0x3d')](function(_0x1fe820){logger[_0xc19c('0x2f')]('['+_0x189725[_0xc19c('0x6a')][_0xc19c('0x9a')]()+']',JSON[_0xc19c('0xf')](_0x1fe820));});}; \ No newline at end of file +var _0x71c8=['uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','calleridname','lodash','request-promise','md5','moment','bluebird','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','access_token','isBefore','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','clientSecret','refresh_token','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','isNil','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/'];(function(_0x98226f,_0x1fae1b){var _0x146819=function(_0x27495b){while(--_0x27495b){_0x98226f['push'](_0x98226f['shift']());}};_0x146819(++_0x1fae1b);}(_0x71c8,0x149));var _0x871c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x71c8[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x871c('0x0'));var rp=require(_0x871c('0x1'));var md5=require(_0x871c('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0x871c('0x3'));var Redis=require('ioredis');var BPromise=require(_0x871c('0x4'));var config=require('../../../../config/environment');var logger=require(_0x871c('0x5'))(_0x871c('0x6'));config[_0x871c('0x7')]=_[_0x871c('0x8')](config[_0x871c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x871c('0x9'))(new Redis(config['redis']));function emit(_0x112ce4,_0x1c2d44,_0x12c873){io['to'](_0x112ce4)[_0x871c('0xa')](_0x1c2d44,_0x12c873);}function request(_0xd2ecdf){logger[_0x871c('0xb')](_0x871c('0xc'),JSON['stringify'](_0xd2ecdf));return rp(_0xd2ecdf);}function getCustomFields(_0x3de227,_0x32a654){var _0x22b3da={};if(_0x3de227[_0x871c('0xd')]>0x0){_[_0x871c('0xe')](_0x3de227,function(_0x5e97eb){if(_[_0x871c('0xf')]([_0x871c('0x10'),_0x871c('0x11')],_0x5e97eb[_0x871c('0x12')])&&_0x5e97eb['idField']){_0x22b3da[_0x5e97eb[_0x871c('0x13')]]=_0x5e97eb['content'][_0x871c('0x14')]();}else if(_0x5e97eb[_0x871c('0x12')]===_0x871c('0x15')&&_0x5e97eb[_0x871c('0x16')]&&_0x5e97eb[_0x871c('0x13')]&&_0x32a654[_0x5e97eb['variableName']]){_0x22b3da[_0x5e97eb[_0x871c('0x13')]]=_0x32a654[_0x5e97eb[_0x871c('0x16')]][_0x871c('0x14')]();}else if(_0x5e97eb[_0x871c('0x12')]===_0x871c('0x17')&&_0x5e97eb[_0x871c('0x18')]&&_0x5e97eb[_0x871c('0x18')][_0x871c('0x19')]&&_0x5e97eb[_0x871c('0x13')]&&_0x32a654[_0x5e97eb[_0x871c('0x18')]['name'][_0x871c('0x1a')]()]){_0x22b3da[_0x5e97eb[_0x871c('0x13')]]=_0x32a654[_0x5e97eb[_0x871c('0x18')][_0x871c('0x19')][_0x871c('0x1a')]()][_0x871c('0x14')]();}});}return _0x22b3da;}function getName(_0x55d1f2){if(_0x55d1f2[_0x871c('0x1b')]('\x20')>0x0){var _0x328493=_0x55d1f2['split'](/ (.+)/);if(_0x328493[0x1]){return _0x328493;}}return[_0x55d1f2,_0x55d1f2];}var accountsTokens={};function getAccessToken(_0x320f7f){return new Promise(function(_0x1bb7f0,_0x17df01){if(!_['isNil'](accountsTokens[_0x320f7f['id']])&&!_['isNil'](accountsTokens[_0x320f7f['id']][_0x871c('0x1c')])){if(moment()[_0x871c('0x1d')](accountsTokens[_0x320f7f['id']][_0x871c('0x1e')])){_0x1bb7f0(accountsTokens[_0x320f7f['id']]['access_token']);}}var _0x2aeef6;switch(_0x320f7f['zone']){case'US':_0x2aeef6='https://accounts.zoho.com';break;case'AU':_0x2aeef6=_0x871c('0x1f');break;case'EU':_0x2aeef6=_0x871c('0x20');break;case'IN':_0x2aeef6=_0x871c('0x21');break;case'CN':_0x2aeef6=_0x871c('0x22');break;default:_0x2aeef6=_0x871c('0x20');break;}var _0x4603d4={'method':_0x871c('0x23'),'uri':_0x2aeef6+'/oauth/v2/token','qs':{'refresh_token':_0x320f7f['refreshToken'],'client_id':_0x320f7f[_0x871c('0x24')],'client_secret':_0x320f7f[_0x871c('0x25')],'grant_type':_0x871c('0x26')},'json':!![]};return rp(_0x4603d4)['then'](function(_0x52b636){accountsTokens[_0x320f7f['id']]={'access_token':_0x52b636[_0x871c('0x1c')],'expires_in':moment()['add'](_0x52b636[_0x871c('0x1e')],_0x871c('0x27'))};_0x1bb7f0(_0x52b636[_0x871c('0x1c')]);})[_0x871c('0x28')](function(_0x455307){logger['error'](_0x871c('0x29'),_0x455307[_0x871c('0x2a')]);_0x17df01(_0x455307);});});}function getUser(_0x22b055,_0x2bd5fa,_0x472ac2,_0x1fadb3){logger[_0x871c('0x2b')]('Search\x20user');return request({'method':_0x871c('0x2c'),'uri':util[_0x871c('0x2d')]('https://www.zohoapis.%s/crm/v2/users',_0x2bd5fa),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x871c('0x2e')+_0x22b055},'json':!![]})[_0x871c('0x2f')](function(_0x16aa11){if(_0x16aa11[_0x871c('0x30')]){var _0x44721e=-0x1;if(_[_0x871c('0x31')](_0x16aa11[_0x871c('0x30')])){if(!_['isNil'](_0x1fadb3)){_0x44721e=_['findIndex'](_0x16aa11['users'],function(_0xc638a9){return _0xc638a9[_0x871c('0x32')]===_0x1fadb3;});}if(_0x44721e>=0x0){logger[_0x871c('0x2b')]('Agent\x20found!');}else{logger[_0x871c('0x2b')](_0x871c('0x33'));_0x44721e=_['findIndex'](_0x16aa11[_0x871c('0x30')],function(_0x24e1ff){return _0x24e1ff[_0x871c('0x34')][_0x871c('0x19')]==='Administrator';});}return _0x16aa11[_0x871c('0x30')][_0x44721e];}else{if(_0x16aa11[_0x871c('0x35')][_0x871c('0x34')]['name']===_0x871c('0x36')){logger[_0x871c('0x2b')](_0x871c('0x33'));user=_0x16aa11['user'];return user;}else{logger['error'](_0x871c('0x37'),JSON[_0x871c('0x38')](_0x16aa11));throw new Error(_0x871c('0x39')+JSON['stringify'](_0x16aa11));}}}else{logger[_0x871c('0x3a')](_0x871c('0x37'),JSON[_0x871c('0x38')](_0x16aa11));throw new Error(_0x871c('0x39')+JSON[_0x871c('0x38')](_0x16aa11));}})[_0x871c('0x28')](function(_0x37b6a5){console[_0x871c('0x3a')](_0x37b6a5);});}function getZohoUser(_0x2be63d,_0x364a82){return new BPromise(function(_0x2dad7d,_0x52be49){request(_0x2be63d)[_0x871c('0x2f')](function(_0x649493){var _0x32a9a3=null;if(_0x649493){_0x32a9a3=_0x649493[_0x871c('0x3b')][0x0];_0x32a9a3[_0x871c('0x3c')]=_0x364a82;}_0x2dad7d(_0x32a9a3);})[_0x871c('0x28')](function(_0x3d1027){_0x52be49(_0x3d1027);});});}function createEndUser(_0x4c948f,_0x10ef7d,_0x1fd3c5,_0xad19b2,_0x38a514,_0x18321a){var _0x1fd3c5=getName(_0x1fd3c5);return request({'method':_0x871c('0x23'),'uri':_0x871c('0x3d')+_0x10ef7d+_0x871c('0x3e')+_[_0x871c('0x3f')](_0x18321a[_0x871c('0x40')])+'s','body':{'data':[{'Last_Name':_0x1fd3c5[0x1],'First_Name':_0x1fd3c5[0x0],'Phone':_0xad19b2,'Owner':{'name':!_[_0x871c('0x41')](_0x38a514[_0x871c('0x42')][_0x871c('0x19')])?_0x38a514[_0x871c('0x42')][_0x871c('0x19')]:!_[_0x871c('0x41')](_0x38a514[_0x871c('0x43')])?_0x38a514[_0x871c('0x43')]+'\x20'+_0x38a514[_0x871c('0x44')]:_0x38a514['last_name'],'id':_0x38a514['id']}}]},'headers':{'Authorization':_0x871c('0x2e')+_0x4c948f},'json':!![]})[_0x871c('0x2f')](function(_0xee8d20){if(_0xee8d20&&_0xee8d20[_0x871c('0x3b')][0x0][_0x871c('0x45')]===_0x871c('0x46')){var _0xec26ef=_0xee8d20[_0x871c('0x3b')][0x0][_0x871c('0x47')];_0xec26ef[_0x871c('0x3c')]=_[_0x871c('0x3f')](_0x18321a[_0x871c('0x40')])+'s';return _0xec26ef;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x871c('0x38')](data));throw new Error(_0x871c('0x48')+JSON[_0x871c('0x38')](data));})['catch'](function(_0x28b1f2){console[_0x871c('0x49')](_0x871c('0x4a'),_0x28b1f2);});}function getEndUser(_0x39337e,_0x54d81e,_0x57d34f,_0x3a4c95,_0x2c7e71,_0x39b6e7,_0x15b196){var _0x4fa191={'method':_0x871c('0x2c'),'uri':'','headers':{'Authorization':_0x871c('0x2e')+_0x39337e},'json':!![]};switch(_0x15b196[_0x871c('0x4b')]){case _0x871c('0x4c'):_0x4fa191[_0x871c('0x4d')]='https://www.zohoapis.'+_0x54d81e+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2c7e71+'))';return getZohoUser(_0x4fa191,_0x871c('0x4e'))[_0x871c('0x2f')](function(_0x461cee){if(_0x461cee)return _0x461cee;_0x4fa191[_0x871c('0x4d')]=_0x871c('0x3d')+_0x54d81e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2c7e71+'))';return getZohoUser(_0x4fa191,_0x871c('0x4f'))[_0x871c('0x2f')](function(_0x3c951c){if(_0x3c951c)return _0x3c951c;if(_0x15b196[_0x871c('0x40')]!=_0x871c('0x50')){return createEndUser(_0x39337e,_0x54d81e,_0x3a4c95,_0x2c7e71,_0x39b6e7,_0x15b196);}else{return{};}});});break;case _0x871c('0x51'):_0x4fa191[_0x871c('0x4d')]=_0x871c('0x3d')+_0x54d81e+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2c7e71+'))';return getZohoUser(_0x4fa191,_0x871c('0x4e'))[_0x871c('0x2f')](function(_0x55a15e){if(_0x55a15e)return _0x55a15e;if(_0x15b196['moduleCreate']!=_0x871c('0x50')){return createEndUser(_0x39337e,_0x54d81e,_0x3a4c95,_0x2c7e71,_0x39b6e7,_0x15b196);}else{return{};}});break;case _0x871c('0x52'):_0x4fa191['uri']='https://www.zohoapis.'+_0x54d81e+_0x871c('0x53')+_0x2c7e71+'))';return getZohoUser(_0x4fa191,'Leads')[_0x871c('0x2f')](function(_0x47db50){if(_0x47db50)return _0x47db50;if(_0x15b196['moduleCreate']!=_0x871c('0x50')){return createEndUser(_0x39337e,_0x54d81e,_0x3a4c95,_0x2c7e71,_0x39b6e7,_0x15b196);}else{return{};}});break;}}function getCall(_0x33f750,_0x346c59,_0x2e56d8,_0x20de2a,_0x5f46bd,_0x1abc41,_0x15a4a0,_0x28a126){logger[_0x871c('0x2b')](_0x871c('0x54'));var _0x10fe50={};_0x10fe50[_0x871c('0x55')]={'name':!_[_0x871c('0x41')](_0x20de2a['role'][_0x871c('0x19')])&&!_['isNil'](_0x20de2a[_0x871c('0x34')][_0x871c('0x19')])&&_0x20de2a[_0x871c('0x34')][_0x871c('0x19')]==='administrator'?_0x20de2a[_0x871c('0x42')][_0x871c('0x19')]:!_[_0x871c('0x41')](_0x20de2a[_0x871c('0x43')])?_0x20de2a[_0x871c('0x43')]+'\x20'+_0x20de2a['last_name']:_0x20de2a[_0x871c('0x44')],'id':_0x20de2a['id']};_0x10fe50['Subject']=intUtil[_0x871c('0x56')](_0x1abc41[_0x871c('0x57')],_0x15a4a0,'\x20');_0x10fe50['Description']=intUtil[_0x871c('0x56')](_0x1abc41[_0x871c('0x58')],_0x15a4a0,'\x0a');if(_0x5f46bd[_0x871c('0x3c')]===_0x871c('0x4e')){_0x10fe50[_0x871c('0x59')]={'name':!_[_0x871c('0x41')](_0x5f46bd[_0x871c('0x5a')])?_0x5f46bd[_0x871c('0x5a')]:!_[_0x871c('0x41')](_0x5f46bd[_0x871c('0x5b')])?_0x5f46bd[_0x871c('0x5b')]+'\x20'+_0x5f46bd[_0x871c('0x5c')]:_0x5f46bd[_0x871c('0x5c')],'id':_0x5f46bd['id']};}if(_0x5f46bd[_0x871c('0x3c')]===_0x871c('0x4f')){_0x10fe50[_0x871c('0x5d')]={'name':!_[_0x871c('0x41')](_0x5f46bd[_0x871c('0x5a')])?_0x5f46bd['Full_Name']:!_['isNil'](_0x5f46bd[_0x871c('0x5b')])?_0x5f46bd['First_Name']+'\x20'+_0x5f46bd['Last_Name']:_0x5f46bd[_0x871c('0x5c')],'id':_0x5f46bd['id']};_0x10fe50[_0x871c('0x5e')]=_[_0x871c('0x3f')](_0x5f46bd[_0x871c('0x3c')]);}if(_0x15a4a0[_0x871c('0x5f')]){_0x10fe50['Call_Duration']=moment['utc'](parseInt(_0x15a4a0[_0x871c('0x5f')])*0x3e8)[_0x871c('0x2d')](_0x871c('0x60'));}else if(_0x15a4a0[_0x871c('0x61')]&&_0x15a4a0[_0x871c('0x62')]){_0x10fe50['Call_Duration']=moment[_0x871c('0x63')](moment(_0x15a4a0[_0x871c('0x62')],_0x871c('0x64'))[_0x871c('0x65')](moment(_0x15a4a0[_0x871c('0x66')],'YYYY-MM-DDTHH:mm:ss')))[_0x871c('0x2d')](_0x871c('0x60'));}switch(_0x15a4a0[_0x871c('0x67')]){case _0x871c('0x68'):_0x10fe50[_0x871c('0x69')]=_0x871c('0x6a');break;case _0x871c('0x6b'):case _0x871c('0x6c'):_0x10fe50[_0x871c('0x69')]=_0x871c('0x6d');break;case _0x871c('0x6e'):_0x10fe50[_0x871c('0x69')]=_0x871c('0x6f');break;case _0x871c('0x70'):_0x10fe50[_0x871c('0x69')]=_0x871c('0x71');break;case _0x871c('0x72'):_0x10fe50[_0x871c('0x69')]=_0x871c('0x73');default:}_0x10fe50[_0x871c('0x74')]=(_0x28a126===_0x871c('0x75')?moment(_0x15a4a0[_0x871c('0x66')])[_0x871c('0x2d')](_0x871c('0x64')):moment(_0x15a4a0[_0x871c('0x76')])[_0x871c('0x2d')](_0x871c('0x64')))||moment()[_0x871c('0x2d')]('YYYY-MM-DDTHH:mm:ss');_0x10fe50[_0x871c('0x77')]=_0x28a126||'Inbound';_0x10fe50=_[_0x871c('0x78')](_0x10fe50,getCustomFields(_0x1abc41['Fields'],_0x15a4a0));return request({'method':_0x871c('0x23'),'uri':_0x871c('0x3d')+_0x346c59+_0x871c('0x79'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x33f750},'body':{'data':[_0x10fe50]},'json':!![]})['then'](function(_0x9e2c95){if(_0x9e2c95&&_0x9e2c95['data'][0x0][_0x871c('0x45')]===_0x871c('0x46')){logger[_0x871c('0x2b')](_0x871c('0x7a'));return{'id':_0x9e2c95[_0x871c('0x3b')][0x0][_0x871c('0x47')]['id']};}})[_0x871c('0x28')](function(_0x55ba68){logger[_0x871c('0x2b')]('err',_0x55ba68[_0x871c('0x2a')]);console['log'](_0x871c('0x7b'),_0x55ba68);});}exports[_0x871c('0x7c')]=function(_0x690c52,_0x1de1c8,_0x5a73d1,_0x3b1ba7,_0x5e0c84,_0x20104a){var _0x5cc313,_0x3c4c9a,_0x300f62;_0x20104a['host']=intUtil[_0x871c('0x7d')](_0x20104a['host']);_0x20104a['serverUrl']=intUtil[_0x871c('0x7d')](_0x20104a[_0x871c('0x7e')]);if(_0x5e0c84&&_0x5e0c84[_0x871c('0x7f')]){logger[_0x871c('0x2b')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1de1c8[_0x871c('0x80')]=_0x20104a[_0x871c('0x7e')]+_0x871c('0x81')+_0x1de1c8[_0x871c('0x82')]+_0x871c('0x83')+md5(_0x1de1c8[_0x871c('0x82')]);}else{_0x1de1c8[_0x871c('0x80')]='';}var _0xd76874=_0x20104a[_0x871c('0x84')]===_0x871c('0x85')?'eu':_0x871c('0x86');return getAccessToken(_0x20104a)[_0x871c('0x2f')](function(_0x12b01b){_0x300f62=_0x12b01b;return getUser(_0x300f62,_0xd76874,_0x20104a,_0x3b1ba7[_0x871c('0x32')]);})[_0x871c('0x2f')](function(_0x1a3c2f){_0x5cc313=_0x1a3c2f;logger[_0x871c('0x2b')](_0x871c('0x87'),_0x5cc313['id']);return getEndUser(_0x300f62,_0xd76874,_0x20104a,_0x1de1c8['calleridname'],_0x1de1c8[_0x871c('0x88')],_0x5cc313,_0x5a73d1);})['then'](function(_0x4525f7){_0x3c4c9a=_0x4525f7;return getCall(_0x300f62,_0xd76874,_0x20104a,_0x5cc313,_0x3c4c9a,_0x5a73d1,_0x1de1c8,_0x871c('0x89'));})[_0x871c('0x2f')](function(_0x16e4d8){if(_0x16e4d8){logger['info'](_0x871c('0x8a'),_0x16e4d8['id']);logger[_0x871c('0x2b')](_0x871c('0x8b'),_0x871c('0x8c'));emit(util[_0x871c('0x2d')](_0x871c('0x8d'),_0x3b1ba7[_0x871c('0x19')]),'trigger:browser:url',{'uri':'https://crm.'+_0x20104a[_0x871c('0x84')]+'/crm/EntityInfo.do?module=Calls&id='+_0x16e4d8['id']});}})['catch'](function(_0x3a56be){logger[_0x871c('0x3a')](_0x871c('0x8b'),JSON[_0x871c('0x38')](_0x3a56be));});};exports[_0x871c('0x75')]=function(_0x590441,_0x184ef9,_0x1deec6,_0x1916ee,_0x866a36,_0x389136,_0x24f701){var _0x359eef,_0x43a029,_0xf7f814;_0x389136[_0x871c('0x84')]=intUtil[_0x871c('0x7d')](_0x389136[_0x871c('0x84')]);_0x389136[_0x871c('0x7e')]=intUtil[_0x871c('0x7d')](_0x389136[_0x871c('0x7e')]);if(_0x24f701&&_0x24f701[_0x871c('0x8e')]&&_0x24f701[_0x871c('0x8e')]!=='none'){logger[_0x871c('0x2b')](_0x871c('0x8f'),_0x871c('0x90'));_0x184ef9['recordingURL']=_0x389136[_0x871c('0x7e')]+'/api/voice/recordings/'+_0x184ef9['uniqueid']+_0x871c('0x83')+md5(_0x184ef9[_0x871c('0x82')]);}var _0x4c149d=_0x389136[_0x871c('0x84')]===_0x871c('0x85')?'eu':_0x871c('0x86');return getAccessToken(_0x389136)['then'](function(_0x48218a){_0xf7f814=_0x48218a;return getUser(_0xf7f814,_0x4c149d,_0x389136,_0x1916ee['email']);})[_0x871c('0x2f')](function(_0x495712){_0x359eef=_0x495712;logger['info']('The\x20User\x20ID\x20is:',_0x359eef['id']);return getEndUser(_0xf7f814,_0x4c149d,_0x389136,_0x184ef9[_0x871c('0x91')],_0x184ef9[_0x871c('0x92')],_0x359eef,_0x1deec6);})[_0x871c('0x2f')](function(_0x4fb04c){_0x43a029=_0x4fb04c;return getCall(_0xf7f814,_0x4c149d,_0x389136,_0x359eef,_0x43a029,_0x1deec6,_0x184ef9,'Outbound');})[_0x871c('0x2f')](function(_0x4726c9){if(_0x4726c9){logger[_0x871c('0x2b')](_0x871c('0x8a'),_0x4726c9['id']);logger[_0x871c('0x2b')](_0x871c('0x8f'),_0x871c('0x8c'));emit(util[_0x871c('0x2d')]('user:%s',_0x1916ee[_0x871c('0x19')]),_0x871c('0x93'),{'uri':_0x871c('0x94')+_0x389136[_0x871c('0x84')]+_0x871c('0x95')+_0x4726c9['id']});}})['catch'](function(_0x10d125){logger['error'](_0x871c('0x8f'),JSON[_0x871c('0x38')](_0x10d125));});};exports[_0x871c('0x96')]=function(_0x101c75,_0x3583c9,_0x30fd0a,_0x1594e2,_0x55f70a,_0x1c9269){var _0x459863,_0x55bf5b,_0xe4d30e;_0x1c9269[_0x871c('0x84')]=intUtil[_0x871c('0x7d')](_0x1c9269[_0x871c('0x84')]);_0x1c9269[_0x871c('0x7e')]=intUtil[_0x871c('0x7d')](_0x1c9269[_0x871c('0x7e')]);if(_0x55f70a&&_0x55f70a[_0x871c('0x7f')]){logger[_0x871c('0x2b')]('['+_0x3583c9[_0x871c('0x67')][_0x871c('0x97')]()+']',_0x871c('0x90'));_0x3583c9[_0x871c('0x80')]=_0x1c9269[_0x871c('0x7e')]+_0x871c('0x81')+_0x3583c9[_0x871c('0x82')]+_0x871c('0x83')+md5(_0x3583c9[_0x871c('0x82')]);}else{_0x3583c9[_0x871c('0x80')]='';}var _0x332249=_0x1c9269[_0x871c('0x84')]===_0x871c('0x85')?'eu':_0x871c('0x86');return getAccessToken(_0x1c9269)[_0x871c('0x2f')](function(_0x4533e7){_0xe4d30e=_0x4533e7;return getUser(_0xe4d30e,_0x332249,_0x1c9269);})[_0x871c('0x2f')](function(_0x530629){_0x459863=_0x530629;logger[_0x871c('0x2b')]('The\x20User\x20ID\x20is:',_0x459863['id']);return getEndUser(_0xe4d30e,_0x332249,_0x1c9269,_0x3583c9[_0x871c('0x98')],_0x3583c9[_0x871c('0x88')],_0x459863,_0x30fd0a);})[_0x871c('0x2f')](function(_0x4e976e){_0x55bf5b=_0x4e976e;return getCall(_0xe4d30e,_0x332249,_0x1c9269,_0x459863,_0x55bf5b,_0x30fd0a,_0x3583c9,'Inbound');})[_0x871c('0x2f')](function(_0x5c2ac2){if(_0x5c2ac2){logger[_0x871c('0x2b')](_0x871c('0x8a'),_0x5c2ac2['id']);}})[_0x871c('0x28')](function(_0x3b5705){logger['error']('['+_0x3583c9[_0x871c('0x67')][_0x871c('0x97')]()+']',JSON[_0x871c('0x38')](_0x3b5705));});}; \ 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 7704eb2..43ba777 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 _0xa7fc=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','exec','data2','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa7fc,0x1a6));var _0xca7f=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa7fc[_0x2064e5];return _0x21a233;};'use strict';var util=require(_0xca7f('0x0'));var sh=require('shelljs');var Mustache=require(_0xca7f('0x1'));var logger=require(_0xca7f('0x2'))('trigger');exports[_0xca7f('0x3')]=function(_0x154704,_0x3836ec){var _0x4ed732=_0x154704['data2']?_0x154704[_0xca7f('0x4')]:'Script';var _0x2bfc47=_0x154704[_0xca7f('0x5')]?Mustache['render'](_0x154704[_0xca7f('0x5')],_0x3836ec):_0x3836ec;sh[_0xca7f('0x3')](_0x2bfc47,function(_0x23f5c3,_0xf93668,_0x24d1c0){if(_0x23f5c3!==0x0){logger['error'](util[_0xca7f('0x6')](_0xca7f('0x7'),_0x4ed732,_0x2bfc47,_0x23f5c3,_0x24d1c0));}else{logger[_0xca7f('0x8')](util['format'](_0xca7f('0x9'),_0x4ed732,_0x2bfc47,_0xf93668));}});}; \ No newline at end of file +var _0x3351=['data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2'];(function(_0x38a155,_0x2aa026){var _0x269403=function(_0x47263b){while(--_0x47263b){_0x38a155['push'](_0x38a155['shift']());}};_0x269403(++_0x2aa026);}(_0x3351,0x19d));var _0x1335=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3351[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x1335('0x0'));var sh=require(_0x1335('0x1'));var Mustache=require(_0x1335('0x2'));var logger=require(_0x1335('0x3'))(_0x1335('0x4'));exports[_0x1335('0x5')]=function(_0x45436a,_0x219980){var _0x18ff9a=_0x45436a['data2']?_0x45436a[_0x1335('0x6')]:'Script';var _0x1b8818=_0x45436a[_0x1335('0x7')]?Mustache[_0x1335('0x8')](_0x45436a['data3'],_0x219980):_0x219980;sh[_0x1335('0x5')](_0x1b8818,function(_0x500c93,_0x5ccacd,_0x4c097a){if(_0x500c93!==0x0){logger[_0x1335('0x9')](util[_0x1335('0xa')](_0x1335('0xb'),_0x18ff9a,_0x1b8818,_0x500c93,_0x4c097a));}else{logger[_0x1335('0xc')](util['format'](_0x1335('0xd'),_0x18ff9a,_0x1b8818,_0x5ccacd));}});}; \ 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 d2653b0..63346ed 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 _0x19cb=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','toUpperCase','render','data5','number','headers','parse','data6','error','stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data1','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode'];(function(_0x222b79,_0x2b3fee){var _0x457878=function(_0x52129c){while(--_0x52129c){_0x222b79['push'](_0x222b79['shift']());}};_0x457878(++_0x2b3fee);}(_0x19cb,0x1ca));var _0xb19c=function(_0x1b15bd,_0x5e00d8){_0x1b15bd=_0x1b15bd-0x0;var _0x4d511c=_0x19cb[_0x1b15bd];return _0x4d511c;};'use strict';var rp=require(_0xb19c('0x0'));var util=require(_0xb19c('0x1'));var _=require(_0xb19c('0x2'));var Mustache=require(_0xb19c('0x3'));var logger=require(_0xb19c('0x4'))(_0xb19c('0x5'));exports['exec']=function(_0x7b4668,_0x333f90){var _0x16330a,_0x5264f0;var _0x18d9f9={'method':_0x7b4668['data1'][_0xb19c('0x6')](),'uri':Mustache[_0xb19c('0x7')](_0x7b4668['data2'],_0x333f90),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x7b4668[_0xb19c('0x8')])===_0xb19c('0x9')&&parseInt(_0x7b4668[_0xb19c('0x8')])>=0x1&&parseInt(_0x7b4668['data5'])<=0xa?parseInt(_0x7b4668['data5'])*0x3e8:0x5*0x3e8};try{_0x18d9f9[_0xb19c('0xa')]=_0x7b4668['data6']?JSON[_0xb19c('0xb')](Mustache[_0xb19c('0x7')](_0x7b4668[_0xb19c('0xc')],_0x333f90)):{};}catch(_0x35fd22){logger[_0xb19c('0xd')](_0x35fd22[_0xb19c('0xe')]);}switch(_0x7b4668['data1'][_0xb19c('0x6')]()){case _0xb19c('0xf'):case'DELETE':_0x16330a=null;_0x18d9f9['qs']=_0x333f90;break;case _0xb19c('0x10'):case _0xb19c('0x11'):if(_0x7b4668[_0xb19c('0x12')]){try{_0x16330a=JSON[_0xb19c('0xb')](Mustache[_0xb19c('0x7')](_0x7b4668[_0xb19c('0x12')],_0x333f90));_0x18d9f9[_0xb19c('0x13')]=_0x16330a;}catch(_0x470d4b){logger[_0xb19c('0xd')](_0x470d4b[_0xb19c('0xe')]);logger['error'](_0xb19c('0x14'));}}else{_0x16330a=_0x333f90;_0x18d9f9[_0xb19c('0x13')]=_0x16330a;}break;}logger[_0xb19c('0x15')](util[_0xb19c('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x7b4668[_0xb19c('0x17')],_0x7b4668['data2'],JSON['stringify'](_0x18d9f9)));rp(_0x18d9f9)[_0xb19c('0x18')](function(_0x15af03){_0x16330a=!_[_0xb19c('0x19')](_0x16330a)?_0xb19c('0x1a')+_0x16330a:'';_0x5264f0=typeof _0x15af03[_0xb19c('0x13')]===_0xb19c('0x1b')?JSON[_0xb19c('0x1c')](_0x15af03[_0xb19c('0x13')]):_0x15af03['body'];logger[_0xb19c('0x15')](util['format'](_0xb19c('0x1d'),_0x7b4668[_0xb19c('0x17')],_0x7b4668[_0xb19c('0x1e')],_0x15af03[_0xb19c('0x1f')],_0x5264f0));})[_0xb19c('0x20')](function(_0x5c45da){logger['error'](util[_0xb19c('0x16')](_0xb19c('0x21'),_0x7b4668[_0xb19c('0x17')],_0x7b4668['data2'],_0x5c45da[_0xb19c('0x1f')],_0x5c45da['name'],_0x5c45da[_0xb19c('0x22')]));});}; \ No newline at end of file +var _0x57d6=['then','object','stringify','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','../../../../config/logger','trigger','exec','data1','render','data2','data5','number','headers','data6','parse','error','stack','toUpperCase','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x4e9086,_0x484ac2){var _0x28615f=function(_0x1508e2){while(--_0x1508e2){_0x4e9086['push'](_0x4e9086['shift']());}};_0x28615f(++_0x484ac2);}(_0x57d6,0x167));var _0x657d=function(_0x1f6835,_0xff3520){_0x1f6835=_0x1f6835-0x0;var _0x10aee2=_0x57d6[_0x1f6835];return _0x10aee2;};'use strict';var rp=require(_0x657d('0x0'));var util=require(_0x657d('0x1'));var _=require(_0x657d('0x2'));var Mustache=require('mustache');var logger=require(_0x657d('0x3'))(_0x657d('0x4'));exports[_0x657d('0x5')]=function(_0x34cc3e,_0x451cee){var _0x163829,_0x35de17;var _0x1dcf05={'method':_0x34cc3e[_0x657d('0x6')]['toUpperCase'](),'uri':Mustache[_0x657d('0x7')](_0x34cc3e[_0x657d('0x8')],_0x451cee),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x34cc3e[_0x657d('0x9')])===_0x657d('0xa')&&parseInt(_0x34cc3e[_0x657d('0x9')])>=0x1&&parseInt(_0x34cc3e['data5'])<=0xa?parseInt(_0x34cc3e[_0x657d('0x9')])*0x3e8:0x5*0x3e8};try{_0x1dcf05[_0x657d('0xb')]=_0x34cc3e[_0x657d('0xc')]?JSON[_0x657d('0xd')](Mustache[_0x657d('0x7')](_0x34cc3e['data6'],_0x451cee)):{};}catch(_0x331832){logger[_0x657d('0xe')](_0x331832[_0x657d('0xf')]);}switch(_0x34cc3e['data1'][_0x657d('0x10')]()){case _0x657d('0x11'):case'DELETE':_0x163829=null;_0x1dcf05['qs']=_0x451cee;break;case _0x657d('0x12'):case _0x657d('0x13'):if(_0x34cc3e[_0x657d('0x14')]){try{_0x163829=JSON[_0x657d('0xd')](Mustache[_0x657d('0x7')](_0x34cc3e[_0x657d('0x14')],_0x451cee));_0x1dcf05[_0x657d('0x15')]=_0x163829;}catch(_0x45c799){logger[_0x657d('0xe')](_0x45c799['stack']);logger[_0x657d('0xe')](_0x657d('0x16'));}}else{_0x163829=_0x451cee;_0x1dcf05[_0x657d('0x15')]=_0x163829;}break;}logger[_0x657d('0x17')](util['format'](_0x657d('0x18'),_0x34cc3e[_0x657d('0x6')],_0x34cc3e['data2'],JSON['stringify'](_0x1dcf05)));rp(_0x1dcf05)[_0x657d('0x19')](function(_0xd5cdae){_0x163829=!_['isNil'](_0x163829)?',\x20request\x20body:\x20'+_0x163829:'';_0x35de17=typeof _0xd5cdae['body']===_0x657d('0x1a')?JSON[_0x657d('0x1b')](_0xd5cdae[_0x657d('0x15')]):_0xd5cdae[_0x657d('0x15')];logger[_0x657d('0x17')](util[_0x657d('0x1c')](_0x657d('0x1d'),_0x34cc3e[_0x657d('0x6')],_0x34cc3e[_0x657d('0x8')],_0xd5cdae['statusCode'],_0x35de17));})['catch'](function(_0x5daf95){logger[_0x657d('0xe')](util[_0x657d('0x1c')](_0x657d('0x1e'),_0x34cc3e[_0x657d('0x6')],_0x34cc3e[_0x657d('0x8')],_0x5daf95['statusCode'],_0x5daf95[_0x657d('0x1f')],_0x5daf95['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 0b611ed..cee4d2f 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 _0xf8bb=['rpc','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request','then','error'];(function(_0x46901e,_0x453b38){var _0x13dd1f=function(_0x217b55){while(--_0x217b55){_0x46901e['push'](_0x46901e['shift']());}};_0x13dd1f(++_0x453b38);}(_0xf8bb,0x147));var _0xbf8b=function(_0x26c3f6,_0x22b708){_0x26c3f6=_0x26c3f6-0x0;var _0x2536d6=_0xf8bb[_0x26c3f6];return _0x2536d6;};'use strict';var jayson=require(_0xbf8b('0x0'));var BPromise=require(_0xbf8b('0x1'));var logger=require('../../config/logger')(_0xbf8b('0x2'));var client=jayson[_0xbf8b('0x3')][_0xbf8b('0x4')]({'port':0x2329});client[_0xbf8b('0x5')]=function(_0x56948e,_0x454fa4){return new BPromise(function(_0x3ab3e7,_0x2c3b9a){return client[_0xbf8b('0x6')](_0x56948e,_0x454fa4)[_0xbf8b('0x7')](function(_0x2e76d5){logger['debug']('rpc',_0xbf8b('0x2'),_0x56948e,_0x454fa4,_0x2e76d5);if(_0x2e76d5[_0xbf8b('0x8')]){logger['error'](_0xbf8b('0x9'),_0xbf8b('0x2'),_0x56948e,_0x2e76d5['error'][_0xbf8b('0xa')],_0x454fa4);return _0x2c3b9a(_0x2e76d5[_0xbf8b('0x8')][_0xbf8b('0xa')]);}else{return _0x3ab3e7(_0x2e76d5[_0xbf8b('0xb')]);}})[_0xbf8b('0xc')](function(_0x546a22){logger['error'](_0xbf8b('0x9'),'routing',_0x56948e,_0x546a22,_0x454fa4);return _0x2c3b9a(_0x546a22);});});};module[_0xbf8b('0xd')]=client; \ No newline at end of file +var _0x6f5e=['Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6f5e,0xeb));var _0xe6f5=function(_0x37478f,_0xcef21){_0x37478f=_0x37478f-0x0;var _0x21e27e=_0x6f5e[_0x37478f];return _0x21e27e;};'use strict';var jayson=require(_0xe6f5('0x0'));var BPromise=require('bluebird');var logger=require(_0xe6f5('0x1'))(_0xe6f5('0x2'));var client=jayson[_0xe6f5('0x3')][_0xe6f5('0x4')]({'port':0x2329});client[_0xe6f5('0x5')]=function(_0x3b2cbc,_0x269b4f){return new BPromise(function(_0x3e1c6e,_0x55fd5b){return client[_0xe6f5('0x6')](_0x3b2cbc,_0x269b4f)[_0xe6f5('0x7')](function(_0x44e0ca){logger[_0xe6f5('0x8')](_0xe6f5('0x9'),_0xe6f5('0x2'),_0x3b2cbc,_0x269b4f,_0x44e0ca);if(_0x44e0ca[_0xe6f5('0xa')]){logger[_0xe6f5('0xa')]('rpc',_0xe6f5('0x2'),_0x3b2cbc,_0x44e0ca[_0xe6f5('0xa')]['message'],_0x269b4f);return _0x55fd5b(_0x44e0ca[_0xe6f5('0xa')][_0xe6f5('0xb')]);}else{return _0x3e1c6e(_0x44e0ca[_0xe6f5('0xc')]);}})[_0xe6f5('0xd')](function(_0x179ad4){logger[_0xe6f5('0xa')](_0xe6f5('0x9'),_0xe6f5('0x2'),_0x3b2cbc,_0x179ad4,_0x269b4f);return _0x55fd5b(_0x179ad4);});});};module[_0xe6f5('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 5ae6bb5..7f35d0e 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 _0xc6a2=['bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','catch','log'];(function(_0x51aa5b,_0x512fc0){var _0x5066d8=function(_0x2bdda9){while(--_0x2bdda9){_0x51aa5b['push'](_0x51aa5b['shift']());}};_0x5066d8(++_0x512fc0);}(_0xc6a2,0x69));var _0x2c6a=function(_0x36723a,_0x55e303){_0x36723a=_0x36723a-0x0;var _0x139674=_0xc6a2[_0x36723a];return _0x139674;};'use strict';var BPromise=require(_0x2c6a('0x0'));var server=require(_0x2c6a('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x2c6a('0x2'));var mailAccount=require(_0x2c6a('0x3'));var setting=require(_0x2c6a('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x2c6a('0x5')]()[_0x2c6a('0x6')](mailAccount[_0x2c6a('0x7')]())[_0x2c6a('0x6')](realtime[_0x2c6a('0x8')]())[_0x2c6a('0x6')](function(){email[_0x2c6a('0x9')](realtime[_0x2c6a('0xa')]);return realtime;});}function main(){return server[_0x2c6a('0xb')](realtime,email)[_0x2c6a('0x6')](function(){return initRealtime();})[_0x2c6a('0x6')](function(){return setting['getSettings']();})[_0x2c6a('0x6')](function(_0x3f4b72){return setInterval(initRealtime,_0x3f4b72[_0x2c6a('0xc')]*0x3e8);})[_0x2c6a('0xd')](function(_0x261e90){console[_0x2c6a('0xe')](_0x261e90);});}main(); \ No newline at end of file +var _0xce3e=['getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./realtime','./lib/email','./rpc/mailAccount','resolve','then'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xce3e,0x12e));var _0xece3=function(_0x54f10e,_0x328584){_0x54f10e=_0x54f10e-0x0;var _0x1cc01d=_0xce3e[_0x54f10e];return _0x1cc01d;};'use strict';var BPromise=require(_0xece3('0x0'));var server=require('./server');var Realtime=require(_0xece3('0x1'));var EmailChannel=require(_0xece3('0x2'));var mailAccount=require(_0xece3('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xece3('0x4')]()[_0xece3('0x5')](mailAccount[_0xece3('0x6')]())[_0xece3('0x5')](realtime['initMailAccounts']())[_0xece3('0x5')](function(){email[_0xece3('0x7')](realtime[_0xece3('0x8')]);return realtime;});}function main(){return server[_0xece3('0x9')](realtime,email)[_0xece3('0x5')](function(){return initRealtime();})[_0xece3('0x5')](function(){return setting[_0xece3('0xa')]();})[_0xece3('0x5')](function(_0x404505){return setInterval(initRealtime,_0x404505[_0xece3('0xb')]*0x3e8);})[_0xece3('0xc')](function(_0x531b4e){console[_0xece3('0xd')](_0x531b4e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 20b6e47..7792331 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 _0x2cef=['error','handleImapError','disabled','connected','messages','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','hasOwnProperty','imapAccounts','bind','handleImapEmail','end','handleImapEnd'];(function(_0x5e0940,_0x471f1d){var _0x2186b1=function(_0x1a1ef1){while(--_0x1a1ef1){_0x5e0940['push'](_0x5e0940['shift']());}};_0x2186b1(++_0x471f1d);}(_0x2cef,0x143));var _0xf2ce=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x2cef[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0xf2ce('0x0'));var moment=require(_0xf2ce('0x1'));var BPromise=require(_0xf2ce('0x2'));var md5=require(_0xf2ce('0x3'));var Redis=require(_0xf2ce('0x4'));var config=require(_0xf2ce('0x5'));var logger=require(_0xf2ce('0x6'))(_0xf2ce('0x7'));config[_0xf2ce('0x8')]=_[_0xf2ce('0x9')](config[_0xf2ce('0x8')],{'host':_0xf2ce('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf2ce('0x8')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xf2ce('0xb'));var mailAccount=require(_0xf2ce('0xc'));var md5Accounts={};function EmailChannel(_0x48c3f0){logger[_0xf2ce('0xd')](_0xf2ce('0xe'));this[_0xf2ce('0xf')]=_0x48c3f0[_0xf2ce('0xf')];this['imapAccounts']={};this[_0xf2ce('0x10')]=new EmailSmtp();}EmailChannel[_0xf2ce('0x11')][_0xf2ce('0x12')]=function(_0x8d3d7a){var _0x33fffc=this[_0xf2ce('0xf')][_0x8d3d7a];var _0x4cfb83={'id':_0x33fffc['id'],'name':_0x33fffc[_0xf2ce('0x13')],'key':_0x33fffc[_0xf2ce('0x14')],'active':_0x33fffc[_0xf2ce('0x15')],'Imap':{'status':_0x33fffc[_0xf2ce('0x16')][_0xf2ce('0x17')],'messageStatus':_0x33fffc[_0xf2ce('0x16')][_0xf2ce('0x18')],'total':_0x33fffc[_0xf2ce('0x16')][_0xf2ce('0x19')]}};if(_[_0xf2ce('0x1a')](md5Accounts[_0x8d3d7a])){md5Accounts[_0x8d3d7a]={};}var _0x47a32f=md5(JSON[_0xf2ce('0x1b')](_0x4cfb83));if(md5Accounts[_0x8d3d7a][_0xf2ce('0x3')]!==_0x47a32f){md5Accounts[_0x8d3d7a][_0xf2ce('0x3')]=_0x47a32f;io[_0xf2ce('0x12')]('mailAccount:update',_0x4cfb83);}};EmailChannel[_0xf2ce('0x11')]['refresh']=function(_0x1798f6){for(var _0xdc2bff in _0x1798f6){if(_0x1798f6[_0xf2ce('0x1c')](_0xdc2bff)){if(_0x1798f6[_0xdc2bff]['Imap']&&_0x1798f6[_0xdc2bff]['active']){var _0x324574=_0x1798f6[_0xdc2bff][_0xf2ce('0x16')];if(!this[_0xf2ce('0x1d')][_0xf2ce('0x1c')](_0x324574['id'])){this[_0xf2ce('0x1d')][_0x324574['id']]=new EmailImap(_0x324574,_0x1798f6[_0xdc2bff][_0xf2ce('0x7')]);this[_0xf2ce('0x1d')][_0x324574['id']]['on']('box',this['handleImapBox'][_0xf2ce('0x1e')](this,_0xdc2bff));this[_0xf2ce('0x1d')][_0x324574['id']]['on'](_0xf2ce('0x7'),this[_0xf2ce('0x1f')]['bind'](this,_0xdc2bff));this[_0xf2ce('0x1d')][_0x324574['id']]['on'](_0xf2ce('0x20'),this[_0xf2ce('0x21')]['bind'](this,_0xdc2bff));this[_0xf2ce('0x1d')][_0x324574['id']]['on'](_0xf2ce('0x22'),this[_0xf2ce('0x23')][_0xf2ce('0x1e')](this,_0xdc2bff));}}else{if(_[_0xf2ce('0x1a')](this[_0xf2ce('0xf')][_0xdc2bff][_0xf2ce('0x16')])){this[_0xf2ce('0xf')][_0xdc2bff]['Imap']={};}this[_0xf2ce('0xf')][_0xdc2bff][_0xf2ce('0x16')]['status']=_0xf2ce('0x24');this[_0xf2ce('0xf')][_0xdc2bff]['Imap'][_0xf2ce('0x18')]='';this[_0xf2ce('0x12')](_0xdc2bff);}}}};EmailChannel[_0xf2ce('0x11')]['handleImapBox']=function(_0x523390,_0x36c2a5){if(this[_0xf2ce('0xf')][_0x523390]){this[_0xf2ce('0xf')][_0x523390][_0xf2ce('0x16')][_0xf2ce('0x17')]=_0xf2ce('0x25');this['mailAccounts'][_0x523390]['Imap'][_0xf2ce('0x18')]=_0x36c2a5['name'];if(_0x36c2a5[_0xf2ce('0x26')]){this[_0xf2ce('0xf')][_0x523390][_0xf2ce('0x16')][_0xf2ce('0x19')]=_0x36c2a5[_0xf2ce('0x26')][_0xf2ce('0x19')];}return this[_0xf2ce('0x12')](_0x523390);}};EmailChannel[_0xf2ce('0x11')][_0xf2ce('0x1f')]=function(_0x5660b9,_0x2ae1a3){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2ae1a3[_0xf2ce('0x27')],_0x2ae1a3[_0xf2ce('0x28')],_0x2ae1a3[_0xf2ce('0x29')],_0x5660b9);if(this[_0xf2ce('0xf')][_0x5660b9]){return mailAccount[_0xf2ce('0x2a')](_0x5660b9,_0x2ae1a3)[_0xf2ce('0x2b')](function(_0x3a1b52){if(_0x3a1b52){logger[_0xf2ce('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0xf2ce('0x2c')](function(_0x3b7922){logger[_0xf2ce('0x22')](_0xf2ce('0x2d'),JSON[_0xf2ce('0x1b')](_0x3b7922));});}};EmailChannel[_0xf2ce('0x11')]['handleImapEnd']=function(_0x2f1ebc){if(this['mailAccounts'][_0x2f1ebc]&&this['mailAccounts'][_0x2f1ebc][_0xf2ce('0x16')]){if(this['imapAccounts'][this['mailAccounts'][_0x2f1ebc][_0xf2ce('0x16')]['id']]){delete this[_0xf2ce('0x1d')][this['mailAccounts'][_0x2f1ebc][_0xf2ce('0x16')]['id']];}this[_0xf2ce('0xf')][_0x2f1ebc][_0xf2ce('0x16')]['lastSync']=moment();this['emit'](_0x2f1ebc);}};EmailChannel[_0xf2ce('0x11')][_0xf2ce('0x23')]=function(_0x164f2a,_0x5bef03){if(this['mailAccounts'][_0x164f2a]){this[_0xf2ce('0xf')][_0x164f2a][_0xf2ce('0x16')][_0xf2ce('0x17')]=_0xf2ce('0x22');this[_0xf2ce('0xf')][_0x164f2a][_0xf2ce('0x16')][_0xf2ce('0x18')]=_0x5bef03;return this[_0xf2ce('0x12')](_0x164f2a);}};EmailChannel[_0xf2ce('0x11')][_0xf2ce('0x2e')]=function(_0x230984,_0x161241){return this['smtp'][_0xf2ce('0x2f')](_0x230984,_0x161241);};EmailChannel[_0xf2ce('0x11')][_0xf2ce('0x30')]=function(_0x2a615c){var _0x29057f=this;if(this[_0xf2ce('0xf')][_0x2a615c['id']]){if(_[_0xf2ce('0x1a')](this[_0xf2ce('0xf')][_0x2a615c['id']][_0xf2ce('0x31')])){this[_0xf2ce('0xf')][_0x2a615c['id']][_0xf2ce('0x31')]={};}this[_0xf2ce('0xf')][_0x2a615c['id']][_0xf2ce('0x31')][_0xf2ce('0x32')]=moment();return new BPromise(function(_0x4487a7,_0x4b51a6){return _0x29057f['smtp']['verify'](_0x2a615c)[_0xf2ce('0x2b')](function(_0x2f3f92){_0x29057f[_0xf2ce('0xf')][_0x2a615c['id']]['Smtp'][_0xf2ce('0x17')]='verified';_0x29057f[_0xf2ce('0xf')][_0x2a615c['id']]['Smtp'][_0xf2ce('0x18')]='';_0x29057f[_0xf2ce('0x12')](_0x2a615c['id']);_0x4487a7(_0x2f3f92);})[_0xf2ce('0x2c')](function(_0x4ba3a5){_0x29057f['mailAccounts'][_0x2a615c['id']][_0xf2ce('0x31')][_0xf2ce('0x17')]='error';_0x29057f[_0xf2ce('0xf')][_0x2a615c['id']][_0xf2ce('0x31')][_0xf2ce('0x18')]=_0x4ba3a5;_0x29057f[_0xf2ce('0x12')](_0x2a615c['id']);_0x4b51a6(_0x4ba3a5);});});}return this[_0xf2ce('0x10')]['verify'](_0x2a615c);};module['exports']=EmailChannel; \ No newline at end of file +var _0xf829=['socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','end','handleImapEnd','isNil','status','disabled','connected','messages','handleImapEmail','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost'];(function(_0x2707ec,_0x537e68){var _0x44462b=function(_0x32f681){while(--_0x32f681){_0x2707ec['push'](_0x2707ec['shift']());}};_0x44462b(++_0x537e68);}(_0xf829,0x13f));var _0x9f82=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0xf829[_0x1c0e91];return _0x34322c;};'use strict';var _=require(_0x9f82('0x0'));var moment=require(_0x9f82('0x1'));var BPromise=require(_0x9f82('0x2'));var md5=require(_0x9f82('0x3'));var Redis=require(_0x9f82('0x4'));var config=require(_0x9f82('0x5'));var logger=require(_0x9f82('0x6'))(_0x9f82('0x7'));config[_0x9f82('0x8')]=_[_0x9f82('0x9')](config['redis'],{'host':_0x9f82('0xa'),'port':0x18eb});var io=require(_0x9f82('0xb'))(new Redis(config[_0x9f82('0x8')]));var EmailImap=require(_0x9f82('0xc'));var EmailSmtp=require(_0x9f82('0xd'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x26359f){logger[_0x9f82('0xe')](_0x9f82('0xf'));this[_0x9f82('0x10')]=_0x26359f[_0x9f82('0x10')];this[_0x9f82('0x11')]={};this[_0x9f82('0x12')]=new EmailSmtp();}EmailChannel[_0x9f82('0x13')][_0x9f82('0x14')]=function(_0x6296fe){var _0x416ba1=this[_0x9f82('0x10')][_0x6296fe];var _0x2e1b4d={'id':_0x416ba1['id'],'name':_0x416ba1[_0x9f82('0x15')],'key':_0x416ba1[_0x9f82('0x16')],'active':_0x416ba1[_0x9f82('0x17')],'Imap':{'status':_0x416ba1[_0x9f82('0x18')]['status'],'messageStatus':_0x416ba1['Imap'][_0x9f82('0x19')],'total':_0x416ba1[_0x9f82('0x18')][_0x9f82('0x1a')]}};if(_['isNil'](md5Accounts[_0x6296fe])){md5Accounts[_0x6296fe]={};}var _0x324f5b=md5(JSON[_0x9f82('0x1b')](_0x2e1b4d));if(md5Accounts[_0x6296fe][_0x9f82('0x3')]!==_0x324f5b){md5Accounts[_0x6296fe][_0x9f82('0x3')]=_0x324f5b;io[_0x9f82('0x14')](_0x9f82('0x1c'),_0x2e1b4d);}};EmailChannel['prototype']['refresh']=function(_0x36c9b0){for(var _0x1a965e in _0x36c9b0){if(_0x36c9b0[_0x9f82('0x1d')](_0x1a965e)){if(_0x36c9b0[_0x1a965e]['Imap']&&_0x36c9b0[_0x1a965e][_0x9f82('0x17')]){var _0x1b1538=_0x36c9b0[_0x1a965e][_0x9f82('0x18')];if(!this['imapAccounts'][_0x9f82('0x1d')](_0x1b1538['id'])){this[_0x9f82('0x11')][_0x1b1538['id']]=new EmailImap(_0x1b1538,_0x36c9b0[_0x1a965e]['email']);this[_0x9f82('0x11')][_0x1b1538['id']]['on'](_0x9f82('0x1e'),this[_0x9f82('0x1f')]['bind'](this,_0x1a965e));this[_0x9f82('0x11')][_0x1b1538['id']]['on'](_0x9f82('0x7'),this['handleImapEmail']['bind'](this,_0x1a965e));this['imapAccounts'][_0x1b1538['id']]['on'](_0x9f82('0x20'),this[_0x9f82('0x21')]['bind'](this,_0x1a965e));this[_0x9f82('0x11')][_0x1b1538['id']]['on']('error',this['handleImapError']['bind'](this,_0x1a965e));}}else{if(_[_0x9f82('0x22')](this[_0x9f82('0x10')][_0x1a965e][_0x9f82('0x18')])){this[_0x9f82('0x10')][_0x1a965e][_0x9f82('0x18')]={};}this[_0x9f82('0x10')][_0x1a965e][_0x9f82('0x18')][_0x9f82('0x23')]=_0x9f82('0x24');this[_0x9f82('0x10')][_0x1a965e][_0x9f82('0x18')][_0x9f82('0x19')]='';this['emit'](_0x1a965e);}}}};EmailChannel['prototype'][_0x9f82('0x1f')]=function(_0x322377,_0xe85ea5){if(this[_0x9f82('0x10')][_0x322377]){this['mailAccounts'][_0x322377][_0x9f82('0x18')]['status']=_0x9f82('0x25');this[_0x9f82('0x10')][_0x322377]['Imap'][_0x9f82('0x19')]=_0xe85ea5[_0x9f82('0x15')];if(_0xe85ea5['messages']){this[_0x9f82('0x10')][_0x322377][_0x9f82('0x18')][_0x9f82('0x1a')]=_0xe85ea5[_0x9f82('0x26')][_0x9f82('0x1a')];}return this[_0x9f82('0x14')](_0x322377);}};EmailChannel[_0x9f82('0x13')][_0x9f82('0x27')]=function(_0x48f30d,_0x46370e){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x46370e[_0x9f82('0x28')],_0x46370e['lastName'],_0x46370e[_0x9f82('0x29')],_0x48f30d);if(this[_0x9f82('0x10')][_0x48f30d]){return mailAccount[_0x9f82('0x2a')](_0x48f30d,_0x46370e)[_0x9f82('0x2b')](function(_0x424036){if(_0x424036){logger[_0x9f82('0xe')](_0x9f82('0x2c'));}})[_0x9f82('0x2d')](function(_0x1f4a7b){logger[_0x9f82('0x2e')](_0x9f82('0x2f'),JSON['stringify'](_0x1f4a7b));});}};EmailChannel[_0x9f82('0x13')]['handleImapEnd']=function(_0x4812e6){if(this['mailAccounts'][_0x4812e6]&&this[_0x9f82('0x10')][_0x4812e6][_0x9f82('0x18')]){if(this[_0x9f82('0x11')][this[_0x9f82('0x10')][_0x4812e6][_0x9f82('0x18')]['id']]){delete this[_0x9f82('0x11')][this[_0x9f82('0x10')][_0x4812e6][_0x9f82('0x18')]['id']];}this[_0x9f82('0x10')][_0x4812e6][_0x9f82('0x18')][_0x9f82('0x30')]=moment();this['emit'](_0x4812e6);}};EmailChannel['prototype'][_0x9f82('0x31')]=function(_0x5efed2,_0x50c738){if(this[_0x9f82('0x10')][_0x5efed2]){this['mailAccounts'][_0x5efed2][_0x9f82('0x18')][_0x9f82('0x23')]='error';this[_0x9f82('0x10')][_0x5efed2][_0x9f82('0x18')]['messageStatus']=_0x50c738;return this[_0x9f82('0x14')](_0x5efed2);}};EmailChannel[_0x9f82('0x13')][_0x9f82('0x32')]=function(_0x4d501a,_0x2e9a5e){return this[_0x9f82('0x12')]['send'](_0x4d501a,_0x2e9a5e);};EmailChannel[_0x9f82('0x13')][_0x9f82('0x33')]=function(_0x52e300){var _0x4bebdd=this;if(this[_0x9f82('0x10')][_0x52e300['id']]){if(_[_0x9f82('0x22')](this[_0x9f82('0x10')][_0x52e300['id']][_0x9f82('0x34')])){this[_0x9f82('0x10')][_0x52e300['id']]['Smtp']={};}this[_0x9f82('0x10')][_0x52e300['id']][_0x9f82('0x34')][_0x9f82('0x30')]=moment();return new BPromise(function(_0x204fa1,_0x4701a6){return _0x4bebdd['smtp'][_0x9f82('0x35')](_0x52e300)['then'](function(_0x4c87ca){_0x4bebdd[_0x9f82('0x10')][_0x52e300['id']][_0x9f82('0x34')]['status']='verified';_0x4bebdd[_0x9f82('0x10')][_0x52e300['id']][_0x9f82('0x34')][_0x9f82('0x19')]='';_0x4bebdd[_0x9f82('0x14')](_0x52e300['id']);_0x204fa1(_0x4c87ca);})['catch'](function(_0x490e36){_0x4bebdd[_0x9f82('0x10')][_0x52e300['id']][_0x9f82('0x34')][_0x9f82('0x23')]=_0x9f82('0x2e');_0x4bebdd['mailAccounts'][_0x52e300['id']][_0x9f82('0x34')]['messageStatus']=_0x490e36;_0x4bebdd['emit'](_0x52e300['id']);_0x4701a6(_0x490e36);});});}return this[_0x9f82('0x12')][_0x9f82('0x35')](_0x52e300);};module[_0x9f82('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 16d04e7..84093ed 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 _0x91e4=['handleFetchEnd','closeBox','handleCloseBox','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','mailparser','simpleParser','./utils','email','account','imap','once','ready','handleReady','bind','handleEnd','error','handleError','connect','inherits','getAccount','connTimeout','service','authentication','user','password','host','port','tls','getHost','anonymous@xcally.com','prototype','openBox','handleOpenBox','readUnseen','end','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91e4,0x14d));var _0x491e=function(_0x342e6f,_0x2124bc){_0x342e6f=_0x342e6f-0x0;var _0x1e602c=_0x91e4[_0x342e6f];return _0x1e602c;};'use strict';var fs=require('fs');var path=require(_0x491e('0x0'));var util=require(_0x491e('0x1'));var Imap=require('imap');var _=require(_0x491e('0x2'));var rs=require('randomstring');var simpleParser=require(_0x491e('0x3'))[_0x491e('0x4')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x491e('0x5'));var logger=require('../../../config/logger')(_0x491e('0x6'));function EmailImap(_0x3a6631,_0x298d2a){this['mailbox']='INBOX';this[_0x491e('0x7')]=this['getAccount'](_0x3a6631,_0x298d2a);this['imap']=new Imap(this['account']);this[_0x491e('0x8')][_0x491e('0x9')](_0x491e('0xa'),this[_0x491e('0xb')][_0x491e('0xc')](this));this[_0x491e('0x8')][_0x491e('0x9')]('end',this[_0x491e('0xd')][_0x491e('0xc')](this));this['imap']['on'](_0x491e('0xe'),this[_0x491e('0xf')][_0x491e('0xc')](this));this[_0x491e('0x8')][_0x491e('0x10')]();}util[_0x491e('0x11')](EmailImap,EventEmitter);EmailImap['prototype'][_0x491e('0x12')]=function(_0x4084cd,_0x4603d5){var _0xbcb46d={'connTimeout':_0x4084cd[_0x491e('0x13')]?_0x4084cd['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4084cd['authTimeout']?_0x4084cd['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x4084cd[_0x491e('0x14')])){if(_0x4084cd[_0x491e('0x15')]){_0xbcb46d[_0x491e('0x16')]=_0x4084cd[_0x491e('0x16')];_0xbcb46d[_0x491e('0x17')]=_0x4084cd[_0x491e('0x17')];}_0xbcb46d['host']=_0x4084cd[_0x491e('0x18')];_0xbcb46d[_0x491e('0x19')]=_0x4084cd[_0x491e('0x19')]||0x3e1;if(_0x4084cd[_0x491e('0x1a')]){_0xbcb46d[_0x491e('0x1a')]=!![];}else{_0xbcb46d['tls']=![];_0xbcb46d['autotls']='required';}}else{_0xbcb46d['user']=_0x4084cd[_0x491e('0x16')];_0xbcb46d['password']=_0x4084cd[_0x491e('0x17')];_0xbcb46d[_0x491e('0x18')]=utils[_0x491e('0x1b')](_0x4084cd[_0x491e('0x14')]);_0xbcb46d['port']=0x3e1;_0xbcb46d[_0x491e('0x1a')]=!![];}_0xbcb46d[_0x491e('0x6')]=_0x4603d5||_0x4084cd[_0x491e('0x16')]||_0x491e('0x1c');return _0xbcb46d;};EmailImap[_0x491e('0x1d')][_0x491e('0xb')]=function(){this['imap'][_0x491e('0x1e')](this['mailbox'],![],this['handleOpenBox'][_0x491e('0xc')](this));};EmailImap[_0x491e('0x1d')][_0x491e('0x1f')]=function(_0x52fcb1,_0xd8d97b){if(_0x52fcb1){this[_0x491e('0xf')](_0x52fcb1,!![]);}else{this['emit']('box',_0xd8d97b);this[_0x491e('0x20')]();}};EmailImap[_0x491e('0x1d')]['handleCloseBox']=function(_0x3dd2e6){if(_0x3dd2e6){this['handleError'](_0x3dd2e6,!![]);}else{this[_0x491e('0x8')][_0x491e('0x21')]();}};EmailImap[_0x491e('0x1d')][_0x491e('0x20')]=function(){this[_0x491e('0x8')]['search']([_0x491e('0x22')],this[_0x491e('0x23')][_0x491e('0xc')](this));};EmailImap[_0x491e('0x1d')][_0x491e('0x23')]=function(_0x5ae8d5,_0x18c2e8){if(_0x5ae8d5){this[_0x491e('0xf')](_0x5ae8d5,!![]);}else{if(_0x18c2e8[_0x491e('0x24')]){try{var _0x3321ec=this[_0x491e('0x8')][_0x491e('0x25')](_0x18c2e8,{'bodies':'','markSeen':!![]});_0x3321ec['on'](_0x491e('0x26'),this[_0x491e('0x27')][_0x491e('0xc')](this));_0x3321ec[_0x491e('0x9')]('error',this['handleFetchError'][_0x491e('0xc')](this));_0x3321ec['once'](_0x491e('0x21'),this['handleFetchEnd']['bind'](this));}catch(_0x31f92b){logger['error'](_0x31f92b);}}else{this[_0x491e('0x8')]['closeBox'](!![],this['handleCloseBox'][_0x491e('0xc')](this));}}};EmailImap[_0x491e('0x1d')][_0x491e('0x27')]=function(_0x370f52,_0x68d309){_0x370f52['on']('body',this[_0x491e('0x28')][_0x491e('0xc')](this));_0x370f52[_0x491e('0x9')]('attributes',this['handleMessageAttributes'][_0x491e('0xc')](this));_0x370f52[_0x491e('0x9')](_0x491e('0x21'),this['handleMessageEnd'][_0x491e('0xc')](this));};EmailImap[_0x491e('0x1d')][_0x491e('0x28')]=function(_0x114991,_0x270c49){simpleParser(_0x114991,{'Iconv':Iconv},this[_0x491e('0x29')][_0x491e('0xc')](this));};EmailImap[_0x491e('0x1d')]['handleMessageAttributes']=function(_0x30e9e0){};EmailImap['prototype'][_0x491e('0x2a')]=function(){};EmailImap[_0x491e('0x1d')][_0x491e('0x29')]=function(_0x1ea2db,_0x17e66b){if(_0x1ea2db){logger[_0x491e('0xe')](_0x1ea2db);}else{var _0x596555=this;utils[_0x491e('0x2b')](this[_0x491e('0x7')],_0x17e66b,function(_0x9ef802){_0x596555[_0x491e('0x2c')](_0x491e('0x6'),_0x9ef802);});}};EmailImap[_0x491e('0x1d')][_0x491e('0x2d')]=function(){this['imap'][_0x491e('0x2e')](!![],this[_0x491e('0x2f')][_0x491e('0xc')](this));};EmailImap[_0x491e('0x1d')][_0x491e('0x30')]=function(_0x3a457d){this[_0x491e('0xf')](_0x3a457d);this[_0x491e('0x8')][_0x491e('0x2e')](!![],this['handleCloseBox'][_0x491e('0xc')](this));};EmailImap[_0x491e('0x1d')][_0x491e('0xd')]=function(){this['emit'](_0x491e('0x21'));};EmailImap[_0x491e('0x1d')]['handleError']=function(_0x293a0d,_0x132e3d){logger[_0x491e('0xe')](_0x491e('0xf'),this[_0x491e('0x7')][_0x491e('0x6')],JSON[_0x491e('0x31')](_0x293a0d));var _0x39b777='';if(_0x293a0d){if(_0x293a0d[_0x491e('0x32')]){_0x39b777=_0x293a0d[_0x491e('0x32')];}else{for(var _0x282ece in _0x293a0d){if(_0x293a0d[_0x491e('0x33')](_0x282ece)){_0x39b777+=_[_0x491e('0x34')](_0x282ece)+':\x20'+_0x293a0d[_0x282ece]+'\x0a';}}}}if(_0x132e3d){this[_0x491e('0x8')][_0x491e('0x21')]();}else{this[_0x491e('0x2c')](_0x491e('0xe'),_0x39b777);this[_0x491e('0x2c')]('end');}};module[_0x491e('0x35')]=EmailImap; \ No newline at end of file +var _0x44d5=['connTimeout','authTimeout','isNil','user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','handleReady','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','end','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','once','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','path','util','lodash','mailparser','iconv','Iconv','events','./utils','email','mailbox','INBOX','account','getAccount','imap','ready','bind','error','connect','inherits','prototype'];(function(_0x1804e0,_0x3e69b7){var _0x29b36b=function(_0x32ceef){while(--_0x32ceef){_0x1804e0['push'](_0x1804e0['shift']());}};_0x29b36b(++_0x3e69b7);}(_0x44d5,0x1a5));var _0x544d=function(_0x111311,_0x1e2f69){_0x111311=_0x111311-0x0;var _0x4cef39=_0x44d5[_0x111311];return _0x4cef39;};'use strict';var fs=require('fs');var path=require(_0x544d('0x0'));var util=require(_0x544d('0x1'));var Imap=require('imap');var _=require(_0x544d('0x2'));var rs=require('randomstring');var simpleParser=require(_0x544d('0x3'))['simpleParser'];var Iconv=require(_0x544d('0x4'))[_0x544d('0x5')];var EventEmitter=require(_0x544d('0x6'))['EventEmitter'];var utils=require(_0x544d('0x7'));var logger=require('../../../config/logger')(_0x544d('0x8'));function EmailImap(_0x2125e0,_0xb46724){this[_0x544d('0x9')]=_0x544d('0xa');this[_0x544d('0xb')]=this[_0x544d('0xc')](_0x2125e0,_0xb46724);this[_0x544d('0xd')]=new Imap(this[_0x544d('0xb')]);this[_0x544d('0xd')]['once'](_0x544d('0xe'),this['handleReady'][_0x544d('0xf')](this));this[_0x544d('0xd')]['once']('end',this['handleEnd'][_0x544d('0xf')](this));this[_0x544d('0xd')]['on'](_0x544d('0x10'),this['handleError']['bind'](this));this['imap'][_0x544d('0x11')]();}util[_0x544d('0x12')](EmailImap,EventEmitter);EmailImap[_0x544d('0x13')]['getAccount']=function(_0x4c9d16,_0x533ba6){var _0x5eddc1={'connTimeout':_0x4c9d16[_0x544d('0x14')]?_0x4c9d16[_0x544d('0x14')]*0x3e8:0x2710,'authTimeout':_0x4c9d16[_0x544d('0x15')]?_0x4c9d16[_0x544d('0x15')]*0x3e8:0x1388};if(_[_0x544d('0x16')](_0x4c9d16['service'])){if(_0x4c9d16['authentication']){_0x5eddc1['user']=_0x4c9d16[_0x544d('0x17')];_0x5eddc1['password']=_0x4c9d16[_0x544d('0x18')];}_0x5eddc1[_0x544d('0x19')]=_0x4c9d16[_0x544d('0x19')];_0x5eddc1['port']=_0x4c9d16[_0x544d('0x1a')]||0x3e1;if(_0x4c9d16[_0x544d('0x1b')]){_0x5eddc1[_0x544d('0x1b')]=!![];}else{_0x5eddc1[_0x544d('0x1b')]=![];_0x5eddc1[_0x544d('0x1c')]=_0x544d('0x1d');}}else{_0x5eddc1['user']=_0x4c9d16[_0x544d('0x17')];_0x5eddc1[_0x544d('0x18')]=_0x4c9d16[_0x544d('0x18')];_0x5eddc1['host']=utils[_0x544d('0x1e')](_0x4c9d16[_0x544d('0x1f')]);_0x5eddc1['port']=0x3e1;_0x5eddc1[_0x544d('0x1b')]=!![];}_0x5eddc1[_0x544d('0x8')]=_0x533ba6||_0x4c9d16['user']||_0x544d('0x20');return _0x5eddc1;};EmailImap[_0x544d('0x13')][_0x544d('0x21')]=function(){this[_0x544d('0xd')][_0x544d('0x22')](this[_0x544d('0x9')],![],this['handleOpenBox'][_0x544d('0xf')](this));};EmailImap[_0x544d('0x13')][_0x544d('0x23')]=function(_0x8ad8d4,_0x2d33f3){if(_0x8ad8d4){this[_0x544d('0x24')](_0x8ad8d4,!![]);}else{this[_0x544d('0x25')](_0x544d('0x26'),_0x2d33f3);this[_0x544d('0x27')]();}};EmailImap[_0x544d('0x13')][_0x544d('0x28')]=function(_0x356d50){if(_0x356d50){this[_0x544d('0x24')](_0x356d50,!![]);}else{this[_0x544d('0xd')][_0x544d('0x29')]();}};EmailImap[_0x544d('0x13')][_0x544d('0x27')]=function(){this[_0x544d('0xd')][_0x544d('0x2a')](['UNSEEN'],this[_0x544d('0x2b')][_0x544d('0xf')](this));};EmailImap[_0x544d('0x13')][_0x544d('0x2b')]=function(_0x5c7651,_0x59682b){if(_0x5c7651){this['handleError'](_0x5c7651,!![]);}else{if(_0x59682b['length']){try{var _0x4631c8=this[_0x544d('0xd')][_0x544d('0x2c')](_0x59682b,{'bodies':'','markSeen':!![]});_0x4631c8['on'](_0x544d('0x2d'),this[_0x544d('0x2e')][_0x544d('0xf')](this));_0x4631c8['once']('error',this[_0x544d('0x2f')][_0x544d('0xf')](this));_0x4631c8[_0x544d('0x30')](_0x544d('0x29'),this[_0x544d('0x31')][_0x544d('0xf')](this));}catch(_0x2b03eb){logger[_0x544d('0x10')](_0x2b03eb);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0x544d('0xf')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x13bef4,_0x2d1cce){_0x13bef4['on'](_0x544d('0x32'),this[_0x544d('0x33')][_0x544d('0xf')](this));_0x13bef4[_0x544d('0x30')](_0x544d('0x34'),this[_0x544d('0x35')]['bind'](this));_0x13bef4['once']('end',this[_0x544d('0x36')][_0x544d('0xf')](this));};EmailImap[_0x544d('0x13')][_0x544d('0x33')]=function(_0x311a7c,_0x270b7a){simpleParser(_0x311a7c,{'Iconv':Iconv},this['handleSimpleParser'][_0x544d('0xf')](this));};EmailImap[_0x544d('0x13')][_0x544d('0x35')]=function(_0x549374){};EmailImap[_0x544d('0x13')][_0x544d('0x36')]=function(){};EmailImap['prototype'][_0x544d('0x37')]=function(_0x28d5c9,_0x19f4b7){if(_0x28d5c9){logger[_0x544d('0x10')](_0x28d5c9);}else{var _0x208ce5=this;utils[_0x544d('0x38')](this['account'],_0x19f4b7,function(_0xa7a2fe){_0x208ce5[_0x544d('0x25')]('email',_0xa7a2fe);});}};EmailImap[_0x544d('0x13')][_0x544d('0x31')]=function(){this[_0x544d('0xd')][_0x544d('0x39')](!![],this[_0x544d('0x28')][_0x544d('0xf')](this));};EmailImap['prototype'][_0x544d('0x2f')]=function(_0x28c11c){this['handleError'](_0x28c11c);this['imap'][_0x544d('0x39')](!![],this[_0x544d('0x28')][_0x544d('0xf')](this));};EmailImap[_0x544d('0x13')][_0x544d('0x3a')]=function(){this[_0x544d('0x25')](_0x544d('0x29'));};EmailImap[_0x544d('0x13')]['handleError']=function(_0xfcfc40,_0xee66c0){logger['error'](_0x544d('0x24'),this['account']['email'],JSON[_0x544d('0x3b')](_0xfcfc40));var _0x18cbde='';if(_0xfcfc40){if(_0xfcfc40[_0x544d('0x3c')]){_0x18cbde=_0xfcfc40['textCode'];}else{for(var _0xd9e52e in _0xfcfc40){if(_0xfcfc40[_0x544d('0x3d')](_0xd9e52e)){_0x18cbde+=_[_0x544d('0x3e')](_0xd9e52e)+':\x20'+_0xfcfc40[_0xd9e52e]+'\x0a';}}}}if(_0xee66c0){this[_0x544d('0xd')][_0x544d('0x29')]();}else{this[_0x544d('0x25')]('error',_0x18cbde);this[_0x544d('0x25')](_0x544d('0x29'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b0105a3..0809fef 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 _0x38aa=['createTransport','use','compile','toString','verify','Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x26583d,_0x273848){var _0x1b1d6d=function(_0x351612){while(--_0x351612){_0x26583d['push'](_0x26583d['shift']());}};_0x1b1d6d(++_0x273848);}(_0x38aa,0xc2));var _0xa38a=function(_0x45fbfc,_0x5b274b){_0x45fbfc=_0x45fbfc-0x0;var _0x29cab4=_0x38aa[_0x45fbfc];return _0x29cab4;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xa38a('0x0'));var inlineBase64=require(_0xa38a('0x1'));function EmailSmtp(){}EmailSmtp[_0xa38a('0x2')][_0xa38a('0x3')]=function(_0x25fe3b,_0x161585){return new BPromise(function(_0x3d9490,_0x2ed757){var _0x5140b0=nodemailer[_0xa38a('0x4')](_0x25fe3b);_0x5140b0[_0xa38a('0x5')](_0xa38a('0x6'),inlineBase64());_0x5140b0['sendMail'](_0x161585,function(_0x19c7e1,_0x27621a){if(_0x19c7e1){_0x2ed757(_0x19c7e1[_0xa38a('0x7')]());}else{_0x3d9490(_0x27621a);}});});};EmailSmtp[_0xa38a('0x2')][_0xa38a('0x8')]=function(_0x45b63f){return new BPromise(function(_0x590feb,_0x41cbae){var _0x20f0c6=nodemailer[_0xa38a('0x4')](_0x45b63f);_0x20f0c6[_0xa38a('0x8')](function(_0x71ab01,_0x46e0a5){if(_0x71ab01){_0x41cbae(_0x71ab01[_0xa38a('0x7')]());}else{if(_0x46e0a5){_0x590feb(_0x46e0a5);}else{_0x41cbae(_0xa38a('0x9'));}}});});};module[_0xa38a('0xa')]=EmailSmtp; \ No newline at end of file +var _0x867f=['verify','toString','exports','nodemailer-plugin-inline-base64','prototype','use','sendMail'];(function(_0x26fec9,_0x528b56){var _0x1d88ee=function(_0x368d72){while(--_0x368d72){_0x26fec9['push'](_0x26fec9['shift']());}};_0x1d88ee(++_0x528b56);}(_0x867f,0x122));var _0xf867=function(_0x2d96f1,_0xa647e4){_0x2d96f1=_0x2d96f1-0x0;var _0x41a5b0=_0x867f[_0x2d96f1];return _0x41a5b0;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require(_0xf867('0x0'));function EmailSmtp(){}EmailSmtp[_0xf867('0x1')]['send']=function(_0x248cf8,_0x561219){return new BPromise(function(_0x46cde6,_0x560cba){var _0xb5c74b=nodemailer['createTransport'](_0x248cf8);_0xb5c74b[_0xf867('0x2')]('compile',inlineBase64());_0xb5c74b[_0xf867('0x3')](_0x561219,function(_0x39184e,_0x5455a0){if(_0x39184e){_0x560cba(_0x39184e['toString']());}else{_0x46cde6(_0x5455a0);}});});};EmailSmtp[_0xf867('0x1')][_0xf867('0x4')]=function(_0x498622){return new BPromise(function(_0x5bfbd8,_0x149a1f){var _0x3114a0=nodemailer['createTransport'](_0x498622);_0x3114a0['verify'](function(_0x33f011,_0x2d2667){if(_0x33f011){_0x149a1f(_0x33f011[_0xf867('0x5')]());}else{if(_0x2d2667){_0x5bfbd8(_0x2d2667);}else{_0x149a1f('Not\x20verifired');}}});});};module[_0xf867('0x6')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 3c1194e..826db91 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 _0x8ace=['anonymous','generate','name','substring','indexOf','length','slice','Anonymous','split','pop','@xcally.com','html','replace','includes','\x20[Attachment:\x20','\x20]','body','isEmpty','message','originCc','bcc','attach','type','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','first','content','BodyHTML','

Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address'];(function(_0x56fc58,_0x2e032f){var _0x1d7cc4=function(_0x1fbe1c){while(--_0x1fbe1c){_0x56fc58['push'](_0x56fc58['shift']());}};_0x1d7cc4(++_0x2e032f);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x233d57,_0x284678){_0x233d57=_0x233d57-0x0;var _0x3eec8c=_0x8ace[_0x233d57];return _0x3eec8c;};'use strict';var _=require(_0xe8ac('0x0'));var moment=require(_0xe8ac('0x1'));var random=require(_0xe8ac('0x2'));var fs=require('fs');var path=require(_0xe8ac('0x3'));var util=require(_0xe8ac('0x4'));var tnef=require(_0xe8ac('0x5'));var logger=require(_0xe8ac('0x6'))(_0xe8ac('0x7'));var config=require(_0xe8ac('0x8'));function getAddress(_0xf6af00){var _0x199794=_[_0xe8ac('0x9')](_0xf6af00[_0xe8ac('0xa')]);return _0x199794&&_0x199794[_0xe8ac('0xb')]?_0x199794['address']:_0xe8ac('0xc')+random[_0xe8ac('0xd')](0x6)+'@xcally.com';}function getFirstName(_0x5c83e1){var _0x4644ef=_['head'](_0x5c83e1[_0xe8ac('0xa')]);if(_0x4644ef&&_0x4644ef[_0xe8ac('0xe')]){if(_0x4644ef[_0xe8ac('0xe')]==_0x4644ef[_0xe8ac('0xb')]){return _0x4644ef[_0xe8ac('0xe')][_0xe8ac('0xf')](0x0,_0x4644ef['name'][_0xe8ac('0x10')]('@'));}var _0x2e3b25=_0x4644ef[_0xe8ac('0xe')]['split'](/\s+/);return _0x2e3b25[_0xe8ac('0x11')]>0x1?_0x2e3b25[_0xe8ac('0x12')](0x0,-0x1)['join']('\x20'):_0x4644ef[_0xe8ac('0xe')];}return _0xe8ac('0x13');}function getLastName(_0x383fe0){var _0x101b33=_[_0xe8ac('0x9')](_0x383fe0[_0xe8ac('0xa')]);if(_0x101b33&&_0x101b33[_0xe8ac('0xe')]){var _0x10609d=_0x101b33[_0xe8ac('0xe')][_0xe8ac('0x14')](/\s+/);return _0x10609d['length']>0x1?_0x10609d[_0xe8ac('0x15')]():'';}return'';}function getMails(_0x18ddb3,_0x4c3c76){var _0xf219c='';for(var _0x3a7939=0x0;_0x3a7939<_0x4c3c76[_0xe8ac('0xa')][_0xe8ac('0x11')];_0x3a7939+=0x1){if(_0x4c3c76[_0xe8ac('0xa')][_0x3a7939][_0xe8ac('0xb')]!==_0x18ddb3){if(!_['isEmpty'](_0xf219c)){_0xf219c+=',';}_0xf219c+=_0x4c3c76['value'][_0x3a7939]['name']||_0x4c3c76[_0xe8ac('0xa')][_0x3a7939][_0xe8ac('0xb')]||'';_0xf219c+='\x20<';_0xf219c+=_0x4c3c76['value'][_0x3a7939][_0xe8ac('0xb')]?_0x4c3c76['value'][_0x3a7939][_0xe8ac('0xb')]:_0xe8ac('0xc')+random['generate'](0x6)+_0xe8ac('0x16');_0xf219c+='>';}}return _0xf219c;}function parseEmail(_0x169929,_0x13aa7c,_0x8b4a9a){if(_0x13aa7c['html']){var _0x6a7dbd=/)<[^<]*)*<\/script>/gi;while(_0x6a7dbd['test'](_0x13aa7c[_0xe8ac('0x17')])){_0x13aa7c[_0xe8ac('0x17')]=_0x13aa7c[_0xe8ac('0x17')][_0xe8ac('0x18')](_0x6a7dbd,'');}if(_0x13aa7c[_0xe8ac('0x17')][_0xe8ac('0x19')](_0xe8ac('0x1a'))){var _0x5726ef=[];_0x13aa7c[_0xe8ac('0x1b')][_0xe8ac('0x1c')](_0x183dbf=>{_0x5726ef[_0xe8ac('0x1d')](_0x183dbf[_0xe8ac('0x1e')]);});var _0x3a92e1=/]+>/g;var _0x132dde=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3e3fc2=_0x13aa7c[_0xe8ac('0x17')]['replace'](_0x132dde,'_SRC');var _0x346dcb=_0x3e3fc2[_0xe8ac('0x18')](_0x3a92e1,'_IMG');for(let _0x2a78c6=0x0;_0x2a78c6<_0x5726ef[_0xe8ac('0x11')];_0x2a78c6++){var _0x54f94c=_0x346dcb['replace'](_0xe8ac('0x1f'),_0xe8ac('0x20')+_0x5726ef[_0x2a78c6]+_0xe8ac('0x21'));_0x346dcb=_0x54f94c;}_0x13aa7c[_0xe8ac('0x17')]=_0x346dcb;}_0x8b4a9a[_0xe8ac('0x22')]=_0x13aa7c[_0xe8ac('0x17')];}else{_0x8b4a9a[_0xe8ac('0x22')]=_0x13aa7c['textAsHtml'];}if(_0x8b4a9a[_0xe8ac('0x22')]){_0x8b4a9a['body']=_0x8b4a9a[_0xe8ac('0x22')]['replace'](/0x0){var _0x259657=['Auto-Submitted:\x20auto-replied',_0xe8ac('0x32'),_0xe8ac('0x33')];for(var _0x5b7f23=0x0;_0x5b7f23<_0x13aa7c[_0xe8ac('0x31')][_0xe8ac('0x11')];_0x5b7f23++){var _0x289a8f=_[_0xe8ac('0x10')](_0x259657,_0x13aa7c['headerLines'][_0x5b7f23]['line']);if(_0x289a8f>=0x0){_0x8b4a9a['isAutoreply']=!![];}}}return _0x8b4a9a;}exports[_0xe8ac('0x34')]=function(_0x2c2f18,_0x28a913,_0x2670f1){var _0x547a72={'from':getAddress(_0x28a913['from']),'firstName':getFirstName(_0x28a913[_0xe8ac('0x35')]),'lastName':getLastName(_0x28a913[_0xe8ac('0x35')]),'mapKey':_0xe8ac('0x7'),'message':{'from':getMails(_0x2c2f18[_0xe8ac('0x7')],_0x28a913[_0xe8ac('0x35')]),'to':_0x2c2f18[_0xe8ac('0x7')],'cc':'','subject':_0x28a913[_0xe8ac('0x36')]||'','messageId':_0x28a913[_0xe8ac('0x37')],'inReplyTo':_0x28a913[_0xe8ac('0x38')],'sentAt':moment(_0x28a913[_0xe8ac('0x39')])[_0xe8ac('0x2a')](_0xe8ac('0x3a')),'attach':![],'attachments':[]}};if(!_0x28a913[_0xe8ac('0x17')]&&!_0x28a913[_0xe8ac('0x3b')]){var _0x517435=_[_0xe8ac('0x3c')](_0x28a913['attachments'],{'contentType':'application/ms-tnef'});if(_0x517435['length']){logger['info'](util[_0xe8ac('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x28a913[_0xe8ac('0x37')]));tnef['parseBuffer'](_[_0xe8ac('0x3d')](_0x517435)[_0xe8ac('0x3e')],function(_0x479430,_0x2a0f5d){if(_0x2a0f5d){_0x28a913['html']=_0x2a0f5d[_0xe8ac('0x3f')]||_0xe8ac('0x40');if(_0x2a0f5d[_0xe8ac('0x41')]){for(var _0x5346d8=0x0;_0x5346d8<_0x2a0f5d[_0xe8ac('0x41')][_0xe8ac('0x11')];_0x5346d8++){var _0x2eba9e=_0x2a0f5d['Attachments'][_0x5346d8];_0x547a72[_0xe8ac('0x24')][_0xe8ac('0x1b')][_0xe8ac('0x1d')]({'filename':_0x2eba9e['Title'],'content':Buffer[_0xe8ac('0x35')](_0x2eba9e['Data'])});}}}_0x2670f1(parseEmail(_0x2c2f18,_0x28a913,_0x547a72));});}else{_0x28a913[_0xe8ac('0x17')]=_0xe8ac('0x40');_0x2670f1(parseEmail(_0x2c2f18,_0x28a913,_0x547a72));}}else{_0x2670f1(parseEmail(_0x2c2f18,_0x28a913,_0x547a72));}};exports[_0xe8ac('0x42')]=function(_0x5686d9){switch(_0x5686d9){case _0xe8ac('0x43'):return _0xe8ac('0x44');case _0xe8ac('0x45'):return _0xe8ac('0x46');case _0xe8ac('0x47'):return _0xe8ac('0x48');case _0xe8ac('0x49'):return _0xe8ac('0x4a');}return _0xe8ac('0x4b');}; \ No newline at end of file +var _0xccef=['moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','slice','join','Anonymous','length','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','getHost','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','127.0.0.1'];(function(_0x21985e,_0x2a0fb4){var _0x20d95d=function(_0x46a39a){while(--_0x46a39a){_0x21985e['push'](_0x21985e['shift']());}};_0x20d95d(++_0x2a0fb4);}(_0xccef,0x1d4));var _0xfcce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccef[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var moment=require(_0xfcce('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0xfcce('0x1'));var util=require(_0xfcce('0x2'));var tnef=require(_0xfcce('0x3'));var logger=require(_0xfcce('0x4'))(_0xfcce('0x5'));var config=require(_0xfcce('0x6'));function getAddress(_0x48894b){var _0x52d50f=_[_0xfcce('0x7')](_0x48894b['value']);return _0x52d50f&&_0x52d50f[_0xfcce('0x8')]?_0x52d50f[_0xfcce('0x8')]:_0xfcce('0x9')+random[_0xfcce('0xa')](0x6)+_0xfcce('0xb');}function getFirstName(_0x380c2c){var _0x1cf939=_['head'](_0x380c2c[_0xfcce('0xc')]);if(_0x1cf939&&_0x1cf939[_0xfcce('0xd')]){if(_0x1cf939[_0xfcce('0xd')]==_0x1cf939[_0xfcce('0x8')]){return _0x1cf939[_0xfcce('0xd')][_0xfcce('0xe')](0x0,_0x1cf939[_0xfcce('0xd')][_0xfcce('0xf')]('@'));}var _0x26526f=_0x1cf939[_0xfcce('0xd')][_0xfcce('0x10')](/\s+/);return _0x26526f['length']>0x1?_0x26526f[_0xfcce('0x11')](0x0,-0x1)[_0xfcce('0x12')]('\x20'):_0x1cf939[_0xfcce('0xd')];}return _0xfcce('0x13');}function getLastName(_0x5cfb44){var _0xa788bb=_[_0xfcce('0x7')](_0x5cfb44['value']);if(_0xa788bb&&_0xa788bb['name']){var _0x3867ba=_0xa788bb[_0xfcce('0xd')][_0xfcce('0x10')](/\s+/);return _0x3867ba[_0xfcce('0x14')]>0x1?_0x3867ba[_0xfcce('0x15')]():'';}return'';}function getMails(_0x1caeb4,_0x12368a){var _0xd82ab6='';for(var _0x2d7611=0x0;_0x2d7611<_0x12368a[_0xfcce('0xc')][_0xfcce('0x14')];_0x2d7611+=0x1){if(_0x12368a[_0xfcce('0xc')][_0x2d7611][_0xfcce('0x8')]!==_0x1caeb4){if(!_[_0xfcce('0x16')](_0xd82ab6)){_0xd82ab6+=',';}_0xd82ab6+=_0x12368a[_0xfcce('0xc')][_0x2d7611][_0xfcce('0xd')]||_0x12368a[_0xfcce('0xc')][_0x2d7611][_0xfcce('0x8')]||'';_0xd82ab6+='\x20<';_0xd82ab6+=_0x12368a[_0xfcce('0xc')][_0x2d7611][_0xfcce('0x8')]?_0x12368a[_0xfcce('0xc')][_0x2d7611][_0xfcce('0x8')]:_0xfcce('0x9')+random['generate'](0x6)+'@xcally.com';_0xd82ab6+='>';}}return _0xd82ab6;}function parseEmail(_0x245221,_0x5d5827,_0x14a586){if(_0x5d5827[_0xfcce('0x17')]){var _0x5cfd72=/)<[^<]*)*<\/script>/gi;while(_0x5cfd72[_0xfcce('0x18')](_0x5d5827[_0xfcce('0x17')])){_0x5d5827[_0xfcce('0x17')]=_0x5d5827[_0xfcce('0x17')][_0xfcce('0x19')](_0x5cfd72,'');}if(_0x5d5827[_0xfcce('0x17')]['includes'](_0xfcce('0x1a'))){var _0x1cea4d=[];_0x5d5827[_0xfcce('0x1b')][_0xfcce('0x1c')](_0x59c96e=>{_0x1cea4d['push'](_0x59c96e[_0xfcce('0x1d')]);});var _0x2fa852=/]+>/g;var _0x4372bc=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2872b0=_0x5d5827['html'][_0xfcce('0x19')](_0x4372bc,_0xfcce('0x1e'));var _0x485041=_0x2872b0['replace'](_0x2fa852,_0xfcce('0x1f'));for(let _0x25337f=0x0;_0x25337f<_0x1cea4d[_0xfcce('0x14')];_0x25337f++){var _0x7975cd=_0x485041[_0xfcce('0x19')](_0xfcce('0x1f'),_0xfcce('0x20')+_0x1cea4d[_0x25337f]+_0xfcce('0x21'));_0x485041=_0x7975cd;}_0x5d5827[_0xfcce('0x17')]=_0x485041;}_0x14a586[_0xfcce('0x22')]=_0x5d5827['html'];}else{_0x14a586[_0xfcce('0x22')]=_0x5d5827['textAsHtml'];}if(_0x14a586['body']){_0x14a586[_0xfcce('0x22')]=_0x14a586[_0xfcce('0x22')][_0xfcce('0x19')](/0x0){var _0x4f94ed=[_0xfcce('0x36'),_0xfcce('0x37'),'Precedence:\x20auto_reply'];for(var _0x19a98b=0x0;_0x19a98b<_0x5d5827[_0xfcce('0x35')][_0xfcce('0x14')];_0x19a98b++){var _0x5e46e0=_[_0xfcce('0xf')](_0x4f94ed,_0x5d5827[_0xfcce('0x35')][_0x19a98b][_0xfcce('0x38')]);if(_0x5e46e0>=0x0){_0x14a586[_0xfcce('0x39')]=!![];}}}return _0x14a586;}exports[_0xfcce('0x3a')]=function(_0x2bb95c,_0x8a50d,_0x284b6f){var _0x47dd4a={'from':getAddress(_0x8a50d[_0xfcce('0x3b')]),'firstName':getFirstName(_0x8a50d[_0xfcce('0x3b')]),'lastName':getLastName(_0x8a50d[_0xfcce('0x3b')]),'mapKey':'email','message':{'from':getMails(_0x2bb95c[_0xfcce('0x5')],_0x8a50d['from']),'to':_0x2bb95c['email'],'cc':'','subject':_0x8a50d[_0xfcce('0x3c')]||'','messageId':_0x8a50d[_0xfcce('0x3d')],'inReplyTo':_0x8a50d[_0xfcce('0x3e')],'sentAt':moment(_0x8a50d['date'])[_0xfcce('0x2c')](_0xfcce('0x3f')),'attach':![],'attachments':[]}};if(!_0x8a50d[_0xfcce('0x17')]&&!_0x8a50d[_0xfcce('0x40')]){var _0x3036db=_['filter'](_0x8a50d['attachments'],{'contentType':_0xfcce('0x41')});if(_0x3036db[_0xfcce('0x14')]){logger[_0xfcce('0x42')](util[_0xfcce('0x2c')](_0xfcce('0x43'),_0x8a50d[_0xfcce('0x3d')]));tnef['parseBuffer'](_[_0xfcce('0x44')](_0x3036db)[_0xfcce('0x32')],function(_0x5c6c40,_0x5c79d0){if(_0x5c79d0){_0x8a50d[_0xfcce('0x17')]=_0x5c79d0['BodyHTML']||_0xfcce('0x45');if(_0x5c79d0['Attachments']){for(var _0x3b403c=0x0;_0x3b403c<_0x5c79d0[_0xfcce('0x46')][_0xfcce('0x14')];_0x3b403c++){var _0x4de4f4=_0x5c79d0['Attachments'][_0x3b403c];_0x47dd4a[_0xfcce('0x24')]['attachments'][_0xfcce('0x33')]({'filename':_0x4de4f4[_0xfcce('0x47')],'content':Buffer[_0xfcce('0x3b')](_0x4de4f4['Data'])});}}}_0x284b6f(parseEmail(_0x2bb95c,_0x8a50d,_0x47dd4a));});}else{_0x8a50d[_0xfcce('0x17')]=_0xfcce('0x45');_0x284b6f(parseEmail(_0x2bb95c,_0x8a50d,_0x47dd4a));}}else{_0x284b6f(parseEmail(_0x2bb95c,_0x8a50d,_0x47dd4a));}};exports[_0xfcce('0x48')]=function(_0x5bf499){switch(_0x5bf499){case _0xfcce('0x49'):return'imap.gmail.com';case _0xfcce('0x4a'):return _0xfcce('0x4b');case'hotmail':return _0xfcce('0x4c');case'outlook365':return'outlook.office365.com';}return _0xfcce('0x4d');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d639505..eb18632 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 _0x8f5c=['Service','key','SERV','active','Smtp','exports','lodash','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8f5c,0x156));var _0xc8f5=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x8f5c[_0x289e64];return _0x30246c;};'use strict';var _=require(_0xc8f5('0x0'));function MailAccount(_0x4b9876){this['id']=_0x4b9876['id']||0x0;this['name']=_0x4b9876[_0xc8f5('0x1')]||_0xc8f5('0x2');this[_0xc8f5('0x3')]=_0x4b9876[_0xc8f5('0x3')]||_0xc8f5('0x4');this[_0xc8f5('0x5')]=_0x4b9876[_0xc8f5('0x5')]||![];this['Imap']=_0x4b9876['Imap']||[];this[_0xc8f5('0x6')]=_0x4b9876['Smtp']||[];}module[_0xc8f5('0x7')]=MailAccount; \ No newline at end of file +var _0x3f01=['lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x53df34,_0x4c8bdc){var _0x406e91=function(_0x55fdde){while(--_0x55fdde){_0x53df34['push'](_0x53df34['shift']());}};_0x406e91(++_0x4c8bdc);}(_0x3f01,0x90));var _0x13f0=function(_0x4db5ac,_0x3e95e2){_0x4db5ac=_0x4db5ac-0x0;var _0x18de26=_0x3f01[_0x4db5ac];return _0x18de26;};'use strict';var _=require(_0x13f0('0x0'));function MailAccount(_0x15a093){this['id']=_0x15a093['id']||0x0;this[_0x13f0('0x1')]=_0x15a093['name']||_0x13f0('0x2');this[_0x13f0('0x3')]=_0x15a093[_0x13f0('0x3')]||_0x13f0('0x4');this[_0x13f0('0x5')]=_0x15a093[_0x13f0('0x5')]||![];this[_0x13f0('0x6')]=_0x15a093['Imap']||[];this['Smtp']=_0x15a093[_0x13f0('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 31af213..fa42e4a 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 _0x63f3=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','isUndefined','merge','lodash'];(function(_0x347498,_0x332242){var _0x334f2b=function(_0x4156d1){while(--_0x4156d1){_0x347498['push'](_0x347498['shift']());}};_0x334f2b(++_0x332242);}(_0x63f3,0x1a6));var _0x363f=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x63f3[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x363f('0x0'));var MailAccount=require(_0x363f('0x1'));var Realtime=function(){this[_0x363f('0x2')]={};};function freeIsNotKey(_0x3876cf,_0x468a79,_0x530e69){var _0x4119c7=_[_0x363f('0x3')](_0x3876cf,function(_0x2bbe2a,_0x3b6eeb){return _0x2bbe2a[_0x530e69];});for(var _0x587bfa in _0x468a79){if(_0x468a79[_0x363f('0x4')](_0x587bfa)){if(!_0x4119c7[_0x587bfa]){delete _0x468a79[_0x587bfa];}}}}Realtime['prototype'][_0x363f('0x5')]=function(_0x17f9e9,_0x48c44a){for(var _0x3b24b8 in _0x48c44a){if(_0x17f9e9['hasOwnProperty'](_0x3b24b8)){_0x17f9e9[_0x3b24b8]=_0x48c44a[_0x3b24b8];}}};Realtime[_0x363f('0x6')]['initMailAccounts']=function(){var _0x369f2c=this;return function(_0x50a805){if(_0x50a805){freeIsNotKey(_0x50a805,_0x369f2c[_0x363f('0x2')],'id');for(var _0x31f761=0x0,_0x22412b={},_0x4ec8e8={};_0x31f761<_0x50a805['length'];_0x31f761+=0x1){_0x22412b=_0x50a805[_0x31f761];if(_[_0x363f('0x7')](_0x369f2c[_0x363f('0x2')][_0x22412b['id']])){_0x369f2c[_0x363f('0x2')][_0x22412b['id']]=new MailAccount(_0x22412b);}else{_[_0x363f('0x8')](_0x369f2c['mailAccounts'][_0x22412b['id']],_0x22412b);}}}return _0x369f2c['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xe755=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x1e0c1a,_0x360469){var _0x2e2502=function(_0x74e20c){while(--_0x74e20c){_0x1e0c1a['push'](_0x1e0c1a['shift']());}};_0x2e2502(++_0x360469);}(_0xe755,0x195));var _0x5e75=function(_0x5114db,_0x7aee2d){_0x5114db=_0x5114db-0x0;var _0x3d28ad=_0xe755[_0x5114db];return _0x3d28ad;};'use strict';var _=require(_0x5e75('0x0'));var MailAccount=require(_0x5e75('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x18eb66,_0x58748d,_0x3f21c5){var _0x27585c=_['mapKeys'](_0x18eb66,function(_0x3160cc,_0x596547){return _0x3160cc[_0x3f21c5];});for(var _0x428ab9 in _0x58748d){if(_0x58748d[_0x5e75('0x2')](_0x428ab9)){if(!_0x27585c[_0x428ab9]){delete _0x58748d[_0x428ab9];}}}}Realtime[_0x5e75('0x3')][_0x5e75('0x4')]=function(_0x296382,_0x2012a7){for(var _0x3d5697 in _0x2012a7){if(_0x296382[_0x5e75('0x2')](_0x3d5697)){_0x296382[_0x3d5697]=_0x2012a7[_0x3d5697];}}};Realtime[_0x5e75('0x3')][_0x5e75('0x5')]=function(){var _0xb50cb3=this;return function(_0x39b838){if(_0x39b838){freeIsNotKey(_0x39b838,_0xb50cb3[_0x5e75('0x6')],'id');for(var _0x186db2=0x0,_0x2eba23={},_0x4ffc58={};_0x186db2<_0x39b838[_0x5e75('0x7')];_0x186db2+=0x1){_0x2eba23=_0x39b838[_0x186db2];if(_[_0x5e75('0x8')](_0xb50cb3[_0x5e75('0x6')][_0x2eba23['id']])){_0xb50cb3['mailAccounts'][_0x2eba23['id']]=new MailAccount(_0x2eba23);}else{_[_0x5e75('0x9')](_0xb50cb3['mailAccounts'][_0x2eba23['id']],_0x2eba23);}}}return _0xb50cb3['mailAccounts'];};};module[_0x5e75('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index ab971c8..2c1c393 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 _0x471a=['name','service','email','active','MailServerIn','getMailAccount','notify','../client','getMailAccounts','Request'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x471a,0x18d));var _0xa471=function(_0x571432,_0x2d5a2c){_0x571432=_0x571432-0x0;var _0x45ab66=_0x471a[_0x571432];return _0x45ab66;};'use strict';var client=require(_0xa471('0x0'));exports[_0xa471('0x1')]=function(){return function(){return client[_0xa471('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xa471('0x3'),_0xa471('0x4'),_0xa471('0x5'),_0xa471('0x6'),'key','ListId','TemplateId'],'raw':![],'include':[{'model':_0xa471('0x7'),'as':'Imap'},{'model':'MailServerOut','as':'Smtp'}]},'log':_0xa471('0x8')});};};exports[_0xa471('0x9')]=function(_0x25f238,_0x50c1c4){return client[_0xa471('0x2')]('NotifyMailAccount',{'account':{'id':_0x25f238},'body':_0x50c1c4,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xef2a=['name','service','email','active','ListId','TemplateId','Imap','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount'];(function(_0x43f393,_0x59a35c){var _0x2e127b=function(_0x43b903){while(--_0x43b903){_0x43f393['push'](_0x43f393['shift']());}};_0x2e127b(++_0x59a35c);}(_0xef2a,0x1a0));var _0xaef2=function(_0x1f856d,_0xda1ad6){_0x1f856d=_0x1f856d-0x0;var _0x338998=_0xef2a[_0x1f856d];return _0x338998;};'use strict';var client=require(_0xaef2('0x0'));exports[_0xaef2('0x1')]=function(){return function(){return client[_0xaef2('0x2')](_0xaef2('0x3'),{'options':{'attributes':['id',_0xaef2('0x4'),_0xaef2('0x5'),_0xaef2('0x6'),_0xaef2('0x7'),'key',_0xaef2('0x8'),_0xaef2('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0xaef2('0xa')},{'model':'MailServerOut','as':_0xaef2('0xb')}]},'log':'getMailAccount'});};};exports[_0xaef2('0xc')]=function(_0x5cdb8a,_0x5cc05d){return client['Request']('NotifyMailAccount',{'account':{'id':_0x5cdb8a},'body':_0x5cc05d,'log':_0xaef2('0xd')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 7573e3c..3e85cde 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 _0xff8f=['GetSettings','../client','loginMailFrequency'];(function(_0x53b0bd,_0xb488b){var _0x516d25=function(_0x5e3759){while(--_0x5e3759){_0x53b0bd['push'](_0x53b0bd['shift']());}};_0x516d25(++_0xb488b);}(_0xff8f,0x1d2));var _0xfff8=function(_0x2a2294,_0x32c406){_0x2a2294=_0x2a2294-0x0;var _0x1a3d26=_0xff8f[_0x2a2294];return _0x1a3d26;};'use strict';var client=require(_0xfff8('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfff8('0x1')]},'log':_0xfff8('0x2')});}; \ No newline at end of file +var _0x948d=['loginMailFrequency','../client','Request','ShowSetting'];(function(_0x2d0373,_0xa4245){var _0x48872a=function(_0x531411){while(--_0x531411){_0x2d0373['push'](_0x2d0373['shift']());}};_0x48872a(++_0xa4245);}(_0x948d,0x141));var _0xd948=function(_0x444afa,_0xe1d59f){_0x444afa=_0x444afa-0x0;var _0x5a9173=_0x948d[_0x444afa];return _0x5a9173;};'use strict';var client=require(_0xd948('0x0'));exports['getSettings']=function(){return client[_0xd948('0x1')](_0xd948('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd948('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 632752b..75da0f9 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 584a78f..3e8eddb 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 _0x8b64=['lodash','http','express','sticky-session','../../config/environment','createServer','listen','port','socket.io','websocket','polling','redis','defaults','adapter','../../config/triggers','default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x540925,_0x30cde8){var _0x5b4241=function(_0x5716e2){while(--_0x5716e2){_0x540925['push'](_0x540925['shift']());}};_0x5b4241(++_0x30cde8);}(_0x8b64,0x18c));var _0x48b6=function(_0x853955,_0x381a5e){_0x853955=_0x853955-0x0;var _0x8298cd=_0x8b64[_0x853955];return _0x8298cd;};'use strict';var _=require(_0x48b6('0x0'));var http=require(_0x48b6('0x1'));var express=require(_0x48b6('0x2'));var sticky=require(_0x48b6('0x3'));var Redis=require('ioredis');var config=require(_0x48b6('0x4'));var app=express();var server=http[_0x48b6('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x48b6('0x6')](server,config[_0x48b6('0x7')])){var socketio=require(_0x48b6('0x8'))(server,{'transports':[_0x48b6('0x9'),_0x48b6('0xa')]});config[_0x48b6('0xb')]=_[_0x48b6('0xc')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x48b6('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x48b6('0xb')]),'subClient':new Redis(config[_0x48b6('0xb')])}));require(_0x48b6('0xe'))[_0x48b6('0xf')]();require(_0x48b6('0x10'))[_0x48b6('0xf')](socketio);require('../../config/express')[_0x48b6('0xf')](app);require(_0x48b6('0x11'))['default'](app);}else{server[_0x48b6('0x12')](_0x48b6('0x13'),function(){console[_0x48b6('0x14')](_0x48b6('0x15'),config[_0x48b6('0x7')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x2248=['default','../../config/express','../../routes','once','listening','log','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','polling','localhost','adapter','socket.io-redis','redis','../../config/triggers'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x2248,0x7a));var _0x8224=function(_0x4d5b31,_0x1e2603){_0x4d5b31=_0x4d5b31-0x0;var _0x1bfbe1=_0x2248[_0x4d5b31];return _0x1bfbe1;};'use strict';var _=require(_0x8224('0x0'));var http=require('http');var express=require(_0x8224('0x1'));var sticky=require(_0x8224('0x2'));var Redis=require(_0x8224('0x3'));var config=require(_0x8224('0x4'));var app=express();var server=http[_0x8224('0x5')](app);server[_0x8224('0x6')]=0xdbba0;if(sticky[_0x8224('0x7')](server,config[_0x8224('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x8224('0x9'),_0x8224('0xa')]});config['redis']=_['defaults'](config['redis'],{'host':_0x8224('0xb'),'port':0x18eb});socketio[_0x8224('0xc')](require(_0x8224('0xd'))({'pubClient':new Redis(config[_0x8224('0xe')]),'subClient':new Redis(config[_0x8224('0xe')])}));require(_0x8224('0xf'))[_0x8224('0x10')]();require('../../config/socketio')['default'](socketio);require(_0x8224('0x11'))[_0x8224('0x10')](app);require(_0x8224('0x12'))[_0x8224('0x10')](app);}else{server[_0x8224('0x13')](_0x8224('0x14'),function(){console[_0x8224('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x8224('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index c0e1cc8..fb626be 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 _0x9f42=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','then','debug','error','rpc','message'];(function(_0x462b62,_0x539144){var _0x101f42=function(_0x512fe2){while(--_0x512fe2){_0x462b62['push'](_0x462b62['shift']());}};_0x101f42(++_0x539144);}(_0x9f42,0x1c3));var _0x29f4=function(_0x1ceedc,_0x17e4c9){_0x1ceedc=_0x1ceedc-0x0;var _0xfef10d=_0x9f42[_0x1ceedc];return _0xfef10d;};'use strict';var jayson=require(_0x29f4('0x0'));var BPromise=require(_0x29f4('0x1'));var logger=require(_0x29f4('0x2'))(_0x29f4('0x3'));var client=jayson[_0x29f4('0x4')][_0x29f4('0x5')]({'port':0x2329});client['Request']=function(_0x45e713,_0x5c7d6b){return new BPromise(function(_0x4c46c3,_0x288943){return client['request'](_0x45e713,_0x5c7d6b)[_0x29f4('0x6')](function(_0x7e5d0b){logger[_0x29f4('0x7')]('rpc','routing',_0x45e713,_0x5c7d6b,_0x7e5d0b);if(_0x7e5d0b[_0x29f4('0x8')]){logger['error'](_0x29f4('0x9'),'routing',_0x45e713,_0x7e5d0b[_0x29f4('0x8')][_0x29f4('0xa')],_0x5c7d6b);return _0x288943(_0x7e5d0b[_0x29f4('0x8')]['message']);}else{return _0x4c46c3(_0x7e5d0b[_0x29f4('0xb')]);}})[_0x29f4('0xc')](function(_0x375a98){logger[_0x29f4('0x8')](_0x29f4('0x9'),_0x29f4('0x3'),_0x45e713,_0x375a98,_0x5c7d6b);return _0x288943(_0x375a98);});});};module[_0x29f4('0xd')]=client; \ No newline at end of file +var _0xc2c8=['request','debug','error','message','result','catch','rpc','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x3ec77d,_0x141a21){var _0x5eb767=function(_0x236bfe){while(--_0x236bfe){_0x3ec77d['push'](_0x3ec77d['shift']());}};_0x5eb767(++_0x141a21);}(_0xc2c8,0x10b));var _0x8c2c=function(_0x1dd1cf,_0x439f45){_0x1dd1cf=_0x1dd1cf-0x0;var _0x1725ae=_0xc2c8[_0x1dd1cf];return _0x1725ae;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x8c2c('0x0'));var logger=require(_0x8c2c('0x1'))(_0x8c2c('0x2'));var client=jayson[_0x8c2c('0x3')][_0x8c2c('0x4')]({'port':0x2329});client[_0x8c2c('0x5')]=function(_0x80b5e9,_0x425904){return new BPromise(function(_0x4d2762,_0x523dc1){return client[_0x8c2c('0x6')](_0x80b5e9,_0x425904)['then'](function(_0x76b10f){logger[_0x8c2c('0x7')]('rpc',_0x8c2c('0x2'),_0x80b5e9,_0x425904,_0x76b10f);if(_0x76b10f[_0x8c2c('0x8')]){logger[_0x8c2c('0x8')]('rpc','routing',_0x80b5e9,_0x76b10f[_0x8c2c('0x8')][_0x8c2c('0x9')],_0x425904);return _0x523dc1(_0x76b10f[_0x8c2c('0x8')]['message']);}else{return _0x4d2762(_0x76b10f[_0x8c2c('0xa')]);}})[_0x8c2c('0xb')](function(_0x3812a8){logger[_0x8c2c('0x8')](_0x8c2c('0xc'),_0x8c2c('0x2'),_0x80b5e9,_0x3812a8,_0x425904);return _0x523dc1(_0x3812a8);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 8d8978e..5309114 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 _0xdb07=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals'];(function(_0x4d5c98,_0x3a14dd){var _0x548799=function(_0x2b090c){while(--_0x2b090c){_0x4d5c98['push'](_0x4d5c98['shift']());}};_0x548799(++_0x3a14dd);}(_0xdb07,0x1c0));var _0x7db0=function(_0x20d434,_0x3fb64f){_0x20d434=_0x20d434-0x0;var _0x1d90f1=_0xdb07[_0x20d434];return _0x1d90f1;};'use strict';var BPromise=require(_0x7db0('0x0'));var server=require(_0x7db0('0x1'));var Realtime=require(_0x7db0('0x2'));var user=require(_0x7db0('0x3'));var interval=require(_0x7db0('0x4'));var openchannelQueue=require(_0x7db0('0x5'));var chatQueue=require(_0x7db0('0x6'));var smsQueue=require(_0x7db0('0x7'));var mailQueue=require(_0x7db0('0x8'));var faxQueue=require(_0x7db0('0x9'));var whatsappQueue=require(_0x7db0('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7db0('0xb')]()[_0x7db0('0xc')](user[_0x7db0('0xd')]())[_0x7db0('0xc')](realtime[_0x7db0('0xe')]())[_0x7db0('0xc')](interval[_0x7db0('0xf')]())[_0x7db0('0xc')](realtime[_0x7db0('0x10')]())[_0x7db0('0xc')](openchannelQueue[_0x7db0('0x11')]())[_0x7db0('0xc')](realtime[_0x7db0('0x12')]())[_0x7db0('0xc')](chatQueue[_0x7db0('0x13')]())[_0x7db0('0xc')](realtime['initChatQueues']())[_0x7db0('0xc')](smsQueue[_0x7db0('0x14')]())[_0x7db0('0xc')](realtime['initSmsQueues']())['then'](mailQueue[_0x7db0('0x15')]())[_0x7db0('0xc')](realtime[_0x7db0('0x16')]())[_0x7db0('0xc')](faxQueue[_0x7db0('0x17')]())[_0x7db0('0xc')](realtime[_0x7db0('0x18')]())[_0x7db0('0xc')](whatsappQueue[_0x7db0('0x19')]())[_0x7db0('0xc')](realtime[_0x7db0('0x1a')]())[_0x7db0('0xc')](function(){return realtime;});}function main(){return server[_0x7db0('0x1b')](realtime)[_0x7db0('0xc')](function(_0x1bffa3){return initRealtime();})[_0x7db0('0xc')](function(_0x34198e){return setInterval(initRealtime,0x1388);})[_0x7db0('0x1c')](function(_0x30a833){console['log'](_0x30a833);});}main(); \ No newline at end of file +var _0x2714=['initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0x500757,_0xe1883){var _0x338c83=function(_0x2df18){while(--_0x2df18){_0x500757['push'](_0x500757['shift']());}};_0x338c83(++_0xe1883);}(_0x2714,0x16d));var _0x4271=function(_0x2e0ec8,_0x27c06d){_0x2e0ec8=_0x2e0ec8-0x0;var _0x54f786=_0x2714[_0x2e0ec8];return _0x54f786;};'use strict';var BPromise=require(_0x4271('0x0'));var server=require(_0x4271('0x1'));var Realtime=require(_0x4271('0x2'));var user=require(_0x4271('0x3'));var interval=require(_0x4271('0x4'));var openchannelQueue=require(_0x4271('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x4271('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x4271('0x7'));var whatsappQueue=require(_0x4271('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x4271('0x9')]()[_0x4271('0xa')](user[_0x4271('0xb')]())[_0x4271('0xa')](realtime['initAgents']())['then'](interval['getIntervals']())[_0x4271('0xa')](realtime[_0x4271('0xc')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x4271('0xa')](realtime[_0x4271('0xd')]())[_0x4271('0xa')](chatQueue[_0x4271('0xe')]())['then'](realtime[_0x4271('0xf')]())[_0x4271('0xa')](smsQueue[_0x4271('0x10')]())['then'](realtime[_0x4271('0x11')]())[_0x4271('0xa')](mailQueue[_0x4271('0x12')]())[_0x4271('0xa')](realtime[_0x4271('0x13')]())[_0x4271('0xa')](faxQueue[_0x4271('0x14')]())[_0x4271('0xa')](realtime['initFaxQueues']())[_0x4271('0xa')](whatsappQueue[_0x4271('0x15')]())[_0x4271('0xa')](realtime[_0x4271('0x16')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x4271('0xa')](function(_0x338ae3){return initRealtime();})[_0x4271('0xa')](function(_0x235f4e){return setInterval(initRealtime,0x1388);})['catch'](function(_0x53c43a){console[_0x4271('0x17')](_0x53c43a);});}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 348af76..2bf3fb4 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5a3fb1,_0x14dbbc){var _0x49e026=function(_0xda57d4){while(--_0xda57d4){_0x5a3fb1['push'](_0x5a3fb1['shift']());}};_0x49e026(++_0x14dbbc);}(_0x814b,0x1a2));var _0xb814=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x814b[_0x560448];return _0x550276;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x17a582,_0x31d56e){var _0x4a9905=function(_0x23bde4){while(--_0x23bde4){_0x17a582['push'](_0x17a582['shift']());}};_0x4a9905(++_0x31d56e);}(_0x7a54,0x106));var _0x47a5=function(_0x5c05f3,_0x1006f5){_0x5c05f3=_0x5c05f3-0x0;var _0x2f9954=_0x7a54[_0x5c05f3];return _0x2f9954;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 6ca436e..d8c5229 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 _0x19f1=['SendMail','bluebird','jayson/promise','client','request','then','error','catch','sendMailMessage'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x19f1,0x64));var _0x119f=function(_0xe093b6,_0x506001){_0xe093b6=_0xe093b6-0x0;var _0x3bd86a=_0x19f1[_0xe093b6];return _0x3bd86a;};'use strict';var BPromise=require(_0x119f('0x0'));var jayson=require(_0x119f('0x1'));var client=jayson[_0x119f('0x2')]['http']({'port':0x232b});function request(_0x335edb,_0x4f76f3){return new BPromise(function(_0x40def7,_0x4078a1){return client[_0x119f('0x3')](_0x335edb,_0x4f76f3)[_0x119f('0x4')](function(_0x2355d9){if(_0x2355d9[_0x119f('0x5')]){return _0x4078a1(_0x2355d9[_0x119f('0x5')]['message']);}else{return _0x40def7(_0x2355d9['result']);}})[_0x119f('0x6')](function(_0x3f3584){return _0x4078a1(_0x3f3584);});});}exports[_0x119f('0x7')]=function(_0x369919,_0xff5b2a){return request(_0x119f('0x8'),{'account':_0x369919,'message':_0xff5b2a});}; \ No newline at end of file +var _0x262a=['catch','sendMailMessage','SendMail','bluebird','client','http','then','result'];(function(_0x2825e4,_0x2dea1f){var _0x1e9d55=function(_0x47ccf6){while(--_0x47ccf6){_0x2825e4['push'](_0x2825e4['shift']());}};_0x1e9d55(++_0x2dea1f);}(_0x262a,0xbb));var _0xa262=function(_0x87eee5,_0x581852){_0x87eee5=_0x87eee5-0x0;var _0x17e2dc=_0x262a[_0x87eee5];return _0x17e2dc;};'use strict';var BPromise=require(_0xa262('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xa262('0x1')][_0xa262('0x2')]({'port':0x232b});function request(_0x526e4b,_0xee21f){return new BPromise(function(_0x36896e,_0x3056d3){return client['request'](_0x526e4b,_0xee21f)[_0xa262('0x3')](function(_0xee1393){if(_0xee1393['error']){return _0x3056d3(_0xee1393['error']['message']);}else{return _0x36896e(_0xee1393[_0xa262('0x4')]);}})[_0xa262('0x5')](function(_0x259c9e){return _0x3056d3(_0x259c9e);});});}exports[_0xa262('0x6')]=function(_0x29a370,_0x346432){return request(_0xa262('0x7'),{'account':_0x29a370,'message':_0x346432});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index cf097a2..a3b4552 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 _0x9da3=['name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','fax','whatsapp','Status','StatusTime','faxStatusTime','smsCurrentCapacity','whatsappStatus','openchannelStatusTime','openchannelCurrentCapacity','emit','user:save','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x4d3e28,_0x157e79){var _0x7e0f5f=function(_0xc4bb31){while(--_0xc4bb31){_0x4d3e28['push'](_0x4d3e28['shift']());}};_0x7e0f5f(++_0x157e79);}(_0x9da3,0x187));var _0x39da=function(_0x1e09c1,_0x56c612){_0x1e09c1=_0x1e09c1-0x0;var _0x428e20=_0x9da3[_0x1e09c1];return _0x428e20;};'use strict';var _=require(_0x39da('0x0'));var moment=require(_0x39da('0x1'));var md5=require(_0x39da('0x2'));var Redis=require('ioredis');var config=require(_0x39da('0x3'));config[_0x39da('0x4')]=_[_0x39da('0x5')](config[_0x39da('0x4')],{'host':_0x39da('0x6'),'port':0x18eb});var io=require(_0x39da('0x7'))(new Redis(config[_0x39da('0x4')]));function Agent(_0x54d4c1){this['id']=_0x54d4c1['id']||0x0;this[_0x39da('0x8')]=_0x54d4c1[_0x39da('0x8')]||'';this['online']=_0x54d4c1[_0x39da('0x9')]||!![];this[_0x39da('0xa')]=_0x54d4c1[_0x39da('0xa')]||![];this['chatPause']=_0x54d4c1[_0x39da('0xb')]||![];this[_0x39da('0xc')]=_0x54d4c1[_0x39da('0xc')]||![];this[_0x39da('0xd')]=_0x54d4c1[_0x39da('0xd')]||![];this[_0x39da('0xe')]=_0x54d4c1[_0x39da('0xe')]||![];this[_0x39da('0xf')]=_0x54d4c1[_0x39da('0xf')]||![];this[_0x39da('0x10')]=_0x39da('0x11');this[_0x39da('0x12')]=0x0;this[_0x39da('0x13')]=_0x54d4c1[_0x39da('0x13')]||0x0;this[_0x39da('0x14')]=0x0;this[_0x39da('0x15')]=_0x39da('0x11');this[_0x39da('0x16')]=0x0;this[_0x39da('0x17')]=_0x54d4c1[_0x39da('0x17')]||0x0;this[_0x39da('0x18')]=0x0;this['faxStatus']=_0x39da('0x11');this['faxStatusTime']=0x0;this[_0x39da('0x19')]=_0x54d4c1[_0x39da('0x19')]||0x0;this[_0x39da('0x1a')]=0x0;this[_0x39da('0x1b')]='unknown';this[_0x39da('0x1c')]=0x0;this[_0x39da('0x1d')]=_0x54d4c1['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x39da('0x1e')]=0x0;this[_0x39da('0x1f')]=_0x54d4c1[_0x39da('0x1f')]||0x0;this[_0x39da('0x20')]=0x0;this[_0x39da('0x21')]=_0x39da('0x11');this['openchannelStatusTime']=0x0;this[_0x39da('0x22')]=_0x54d4c1['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x39da('0x23')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0x39da('0x24')][_0x39da('0x25')]=function(_0x37fcf4){if(this[_0x37fcf4+_0x39da('0x26')]>0x0){if(this[_0x37fcf4+_0x39da('0x27')]>0x0&&this[_0x37fcf4+'CurrentCapacity']>=this[_0x37fcf4+_0x39da('0x27')]){return _0x39da('0x28');}else{return'working';}}else{return _0x39da('0x29');}};Agent['prototype']['updateRealtime']=function(){var _0x54e8c3=[_0x39da('0x2a'),_0x39da('0x2b'),_0x39da('0x2c'),_0x39da('0x2d'),'sms',_0x39da('0x2e')];for(var _0x42002e=0x0;_0x42002e<_0x54e8c3['length'];_0x42002e+=0x1){var _0x1229ee=this[_0x39da('0x25')](_0x54e8c3[_0x42002e]);if(this[_0x54e8c3[_0x42002e]+_0x39da('0x2f')]!==_0x1229ee){this[_0x54e8c3[_0x42002e]+_0x39da('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x54e8c3[_0x42002e]+'Status']=_0x1229ee;}var _0x114042={'id':this['id'],'name':this[_0x39da('0x8')],'online':this[_0x39da('0x9')],'voicePause':this[_0x39da('0xa')],'chatPause':this[_0x39da('0xb')],'mailPause':this[_0x39da('0xc')],'smsPause':this[_0x39da('0xe')],'faxPause':this[_0x39da('0xd')],'openchannelPause':this[_0x39da('0xf')],'chatStatus':this[_0x39da('0x10')],'chatStatusTime':this[_0x39da('0x12')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x39da('0x14')],'mailStatus':this[_0x39da('0x15')],'mailStatusTime':this[_0x39da('0x16')],'mailCapacity':this[_0x39da('0x17')],'mailCurrentCapacity':this[_0x39da('0x18')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x39da('0x31')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x39da('0x1b')],'smsStatusTime':this[_0x39da('0x1c')],'smsCapacity':this[_0x39da('0x1d')],'smsCurrentCapacity':this[_0x39da('0x32')],'whatsappStatus':this[_0x39da('0x33')],'whatsappStatusTime':this[_0x39da('0x1e')],'whatsappCapacity':this[_0x39da('0x1f')],'whatsappCurrentCapacity':this[_0x39da('0x20')],'openchannelStatus':this[_0x39da('0x21')],'openchannelStatusTime':this[_0x39da('0x34')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x39da('0x35')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x554956=md5(JSON['stringify'](_0x114042));if(this['md5']!==_0x554956){this[_0x39da('0x2')]=_0x554956;io[_0x39da('0x36')](_0x39da('0x37'),_0x114042);}};module[_0x39da('0x38')]=Agent; \ No newline at end of file +var _0xe890=['user:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','chatCapacity','mailCapacity','mailCurrentCapacity','emit'];(function(_0xab2622,_0x582313){var _0x3ab544=function(_0x591570){while(--_0x591570){_0xab2622['push'](_0xab2622['shift']());}};_0x3ab544(++_0x582313);}(_0xe890,0x1a6));var _0x0e89=function(_0x3fa50f,_0x5ad647){_0x3fa50f=_0x3fa50f-0x0;var _0x57a736=_0xe890[_0x3fa50f];return _0x57a736;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x0e89('0x0'));var Redis=require(_0x0e89('0x1'));var config=require(_0x0e89('0x2'));config[_0x0e89('0x3')]=_[_0x0e89('0x4')](config[_0x0e89('0x3')],{'host':_0x0e89('0x5'),'port':0x18eb});var io=require(_0x0e89('0x6'))(new Redis(config[_0x0e89('0x3')]));function Agent(_0x361901){this['id']=_0x361901['id']||0x0;this['name']=_0x361901['name']||'';this[_0x0e89('0x7')]=_0x361901[_0x0e89('0x7')]||!![];this['voicePause']=_0x361901[_0x0e89('0x8')]||![];this[_0x0e89('0x9')]=_0x361901['chatPause']||![];this[_0x0e89('0xa')]=_0x361901[_0x0e89('0xa')]||![];this[_0x0e89('0xb')]=_0x361901[_0x0e89('0xb')]||![];this[_0x0e89('0xc')]=_0x361901[_0x0e89('0xc')]||![];this[_0x0e89('0xd')]=_0x361901[_0x0e89('0xd')]||![];this[_0x0e89('0xe')]='unknown';this['chatStatusTime']=0x0;this['chatCapacity']=_0x361901['chatCapacity']||0x0;this[_0x0e89('0xf')]=0x0;this[_0x0e89('0x10')]=_0x0e89('0x11');this[_0x0e89('0x12')]=0x0;this['mailCapacity']=_0x361901['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x0e89('0x13')]=_0x0e89('0x11');this[_0x0e89('0x14')]=0x0;this[_0x0e89('0x15')]=_0x361901[_0x0e89('0x15')]||0x0;this[_0x0e89('0x16')]=0x0;this[_0x0e89('0x17')]=_0x0e89('0x11');this[_0x0e89('0x18')]=0x0;this[_0x0e89('0x19')]=_0x361901[_0x0e89('0x19')]||0x0;this[_0x0e89('0x1a')]=0x0;this[_0x0e89('0x1b')]=_0x0e89('0x11');this[_0x0e89('0x1c')]=0x0;this[_0x0e89('0x1d')]=_0x361901[_0x0e89('0x1d')]||0x0;this[_0x0e89('0x1e')]=0x0;this[_0x0e89('0x1f')]=_0x0e89('0x11');this[_0x0e89('0x20')]=0x0;this['openchannelCapacity']=_0x361901[_0x0e89('0x21')]||0x0;this[_0x0e89('0x22')]=0x0;this[_0x0e89('0x23')]=![];this[_0x0e89('0x24')]=undefined;this[_0x0e89('0x0')]='';this[_0x0e89('0x25')]();}Agent[_0x0e89('0x26')][_0x0e89('0x27')]=function(_0x19ed04){if(this[_0x19ed04+_0x0e89('0x28')]>0x0){if(this[_0x19ed04+_0x0e89('0x29')]>0x0&&this[_0x19ed04+_0x0e89('0x28')]>=this[_0x19ed04+_0x0e89('0x29')]){return _0x0e89('0x2a');}else{return'working';}}else{return'idle';}};Agent['prototype'][_0x0e89('0x25')]=function(){var _0x8d02e2=[_0x0e89('0x2b'),_0x0e89('0x2c'),'openchannel',_0x0e89('0x2d'),_0x0e89('0x2e'),_0x0e89('0x2f')];for(var _0x4b6f00=0x0;_0x4b6f00<_0x8d02e2[_0x0e89('0x30')];_0x4b6f00+=0x1){var _0x589ed1=this[_0x0e89('0x27')](_0x8d02e2[_0x4b6f00]);if(this[_0x8d02e2[_0x4b6f00]+_0x0e89('0x31')]!==_0x589ed1){this[_0x8d02e2[_0x4b6f00]+_0x0e89('0x32')]=_[_0x0e89('0x33')](moment()[_0x0e89('0x34')]('x'));}this[_0x8d02e2[_0x4b6f00]+_0x0e89('0x31')]=_0x589ed1;}var _0x14a17c={'id':this['id'],'name':this['name'],'online':this[_0x0e89('0x7')],'voicePause':this[_0x0e89('0x8')],'chatPause':this[_0x0e89('0x9')],'mailPause':this[_0x0e89('0xa')],'smsPause':this[_0x0e89('0xc')],'faxPause':this[_0x0e89('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x0e89('0xe')],'chatStatusTime':this[_0x0e89('0x35')],'chatCapacity':this[_0x0e89('0x36')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x0e89('0x10')],'mailStatusTime':this[_0x0e89('0x12')],'mailCapacity':this[_0x0e89('0x37')],'mailCurrentCapacity':this[_0x0e89('0x38')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x0e89('0x14')],'faxCapacity':this[_0x0e89('0x15')],'faxCurrentCapacity':this[_0x0e89('0x16')],'smsStatus':this[_0x0e89('0x17')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x0e89('0x19')],'smsCurrentCapacity':this[_0x0e89('0x1a')],'whatsappStatus':this[_0x0e89('0x1b')],'whatsappStatusTime':this[_0x0e89('0x1c')],'whatsappCapacity':this[_0x0e89('0x1d')],'whatsappCurrentCapacity':this[_0x0e89('0x1e')],'openchannelStatus':this[_0x0e89('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x0e89('0x21')],'openchannelCurrentCapacity':this[_0x0e89('0x22')],'busy':this[_0x0e89('0x23')],'busyQueue':this[_0x0e89('0x24')]};var _0x34d17b=md5(JSON['stringify'](_0x14a17c));if(this[_0x0e89('0x0')]!==_0x34d17b){this[_0x0e89('0x0')]=_0x34d17b;io[_0x0e89('0x39')](_0x0e89('0x3a'),_0x14a17c);}};module[_0x0e89('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 44e645b..b327b66 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 _0xc4d9=['redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','map','updateRealtime','paused','length','online','loggedIn','chatPause','available','waiting','stringify','chat:queue:%s','emit','chat_queue:save','md5','util','ioredis','../../../config/environment'];(function(_0x27419b,_0x6a45c){var _0x3405ae=function(_0x243dd7){while(--_0x243dd7){_0x27419b['push'](_0x27419b['shift']());}};_0x3405ae(++_0x6a45c);}(_0xc4d9,0x182));var _0x9c4d=function(_0x66bd22,_0x5367f9){_0x66bd22=_0x66bd22-0x0;var _0x43caa6=_0xc4d9[_0x66bd22];return _0x43caa6;};'use strict';var _=require('lodash');var md5=require(_0x9c4d('0x0'));var util=require(_0x9c4d('0x1'));var Redis=require(_0x9c4d('0x2'));var config=require(_0x9c4d('0x3'));config[_0x9c4d('0x4')]=_['defaults'](config[_0x9c4d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9c4d('0x5'))(new Redis(config['redis']));function ChatQueue(_0x3bc53e){this['id']=_0x3bc53e['id']||0x0;this[_0x9c4d('0x6')]=_0x3bc53e[_0x9c4d('0x6')]||'';this['timeout']=_0x3bc53e[_0x9c4d('0x7')]||0xa;this[_0x9c4d('0x8')]=_0x3bc53e[_0x9c4d('0x8')]||'beepall';this[_0x9c4d('0x9')]=_0x3bc53e['Agents'];this[_0x9c4d('0xa')]={};this['waiting']=0x0;this[_0x9c4d('0x0')]='';this[_0x9c4d('0xb')]();this['updateRealtime']();}ChatQueue[_0x9c4d('0xc')]['updateRouting']=function(){var _0x1c3926=this['mapAgentsId']['_rr'];this[_0x9c4d('0xa')]=_[_0x9c4d('0xd')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x1c3926;};ChatQueue['prototype'][_0x9c4d('0xe')]=function(){this['loggedIn']=0x0;this[_0x9c4d('0xf')]=0x0;for(var _0x2823a7=0x0;_0x2823a7=0x0?this[_0x9c4d('0x14')]:0x0;var _0x296e50={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9c4d('0x12')],'name':this[_0x9c4d('0x6')],'paused':this[_0x9c4d('0xf')],'waiting':this[_0x9c4d('0x15')]};var _0x5ad4f5=md5(JSON[_0x9c4d('0x16')](_0x296e50));if(this['md5']!==_0x5ad4f5){this['md5']=_0x5ad4f5;io['to'](util['format'](_0x9c4d('0x17'),_0x296e50[_0x9c4d('0x6')]))[_0x9c4d('0x18')](_0x9c4d('0x19'),_0x296e50);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xa3ac=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','chatPause','available','waiting','stringify','chat:queue:%s','emit','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa3ac,0x11b));var _0xca3a=function(_0x1a2d19,_0x18abbe){_0x1a2d19=_0x1a2d19-0x0;var _0x211708=_0xa3ac[_0x1a2d19];return _0x211708;};'use strict';var _=require(_0xca3a('0x0'));var md5=require('md5');var util=require(_0xca3a('0x1'));var Redis=require(_0xca3a('0x2'));var config=require(_0xca3a('0x3'));config[_0xca3a('0x4')]=_[_0xca3a('0x5')](config[_0xca3a('0x4')],{'host':_0xca3a('0x6'),'port':0x18eb});var io=require(_0xca3a('0x7'))(new Redis(config[_0xca3a('0x4')]));function ChatQueue(_0x284bb2){this['id']=_0x284bb2['id']||0x0;this['name']=_0x284bb2[_0xca3a('0x8')]||'';this[_0xca3a('0x9')]=_0x284bb2[_0xca3a('0x9')]||0xa;this['strategy']=_0x284bb2[_0xca3a('0xa')]||_0xca3a('0xb');this['Agents']=_0x284bb2[_0xca3a('0xc')];this[_0xca3a('0xd')]={};this['waiting']=0x0;this[_0xca3a('0xe')]='';this[_0xca3a('0xf')]();this[_0xca3a('0x10')]();}ChatQueue[_0xca3a('0x11')][_0xca3a('0xf')]=function(){var _0x350bfa=this[_0xca3a('0xd')][_0xca3a('0x12')];this['mapAgentsId']=_[_0xca3a('0x13')](this[_0xca3a('0xc')],'id');this[_0xca3a('0xd')][_0xca3a('0x12')]=_0x350bfa;};ChatQueue[_0xca3a('0x11')][_0xca3a('0x10')]=function(){this[_0xca3a('0x14')]=0x0;this[_0xca3a('0x15')]=0x0;for(var _0x3b1836=0x0;_0x3b1836=0x0?this[_0xca3a('0x18')]:0x0;var _0x24bab9={'id':this['id'],'available':this[_0xca3a('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xca3a('0x15')],'waiting':this[_0xca3a('0x19')]};var _0x9db76a=md5(JSON[_0xca3a('0x1a')](_0x24bab9));if(this['md5']!==_0x9db76a){this['md5']=_0x9db76a;io['to'](util['format'](_0xca3a('0x1b'),_0x24bab9['name']))[_0xca3a('0x1c')]('chat_queue:save',_0x24bab9);}};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 ac5a842..67a3442 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 _0xcdb0=['md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','Agents','prototype','loggedIn','length','online','available','paused','stringify','emit','fax_queue:save','lodash'];(function(_0x121a0f,_0x1539eb){var _0x18d0f0=function(_0x23fa34){while(--_0x23fa34){_0x121a0f['push'](_0x121a0f['shift']());}};_0x18d0f0(++_0x1539eb);}(_0xcdb0,0xfb));var _0x0cdb=function(_0x499ffd,_0xbfb590){_0x499ffd=_0x499ffd-0x0;var _0x5be7e9=_0xcdb0[_0x499ffd];return _0x5be7e9;};'use strict';var _=require(_0x0cdb('0x0'));var md5=require(_0x0cdb('0x1'));var util=require(_0x0cdb('0x2'));var Redis=require(_0x0cdb('0x3'));var config=require(_0x0cdb('0x4'));config['redis']=_[_0x0cdb('0x5')](config[_0x0cdb('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0cdb('0x7'))(new Redis(config[_0x0cdb('0x6')]));function FaxQueue(_0x21db97){this['id']=_0x21db97['id']||0x0;this[_0x0cdb('0x8')]=_0x21db97[_0x0cdb('0x8')]||'';this[_0x0cdb('0x9')]=_0x21db97[_0x0cdb('0x9')]||0xa;this[_0x0cdb('0xa')]=_0x21db97[_0x0cdb('0xa')]||_0x0cdb('0xb');this['Agents']=_0x21db97['Agents'];this[_0x0cdb('0xc')]={};this[_0x0cdb('0xd')]=0x0;this[_0x0cdb('0x1')]='';this[_0x0cdb('0xe')]();this[_0x0cdb('0xf')]();}FaxQueue['prototype'][_0x0cdb('0xe')]=function(){var _0x38b439=this[_0x0cdb('0xc')][_0x0cdb('0x10')];this[_0x0cdb('0xc')]=_[_0x0cdb('0x11')](this[_0x0cdb('0x12')],'id');this[_0x0cdb('0xc')][_0x0cdb('0x10')]=_0x38b439;};FaxQueue[_0x0cdb('0x13')][_0x0cdb('0xf')]=function(){this[_0x0cdb('0x14')]=0x0;this['paused']=0x0;for(var _0x7f41c6=0x0;_0x7f41c6=0x0?this['available']:0x0;var _0x14379b={'id':this['id'],'available':this[_0x0cdb('0x17')],'loggedIn':this[_0x0cdb('0x14')],'name':this[_0x0cdb('0x8')],'paused':this[_0x0cdb('0x18')],'waiting':this[_0x0cdb('0xd')]};var _0x342a60=md5(JSON[_0x0cdb('0x19')](_0x14379b));if(this['md5']!==_0x342a60){this[_0x0cdb('0x1')]=_0x342a60;io['to'](util['format']('fax:queue:%s',_0x14379b['name']))[_0x0cdb('0x1a')](_0x0cdb('0x1b'),_0x14379b);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xa63c=['paused','length','online','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','socket.io-emitter','redis','name','strategy','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn'];(function(_0x230343,_0x241481){var _0x2fbd01=function(_0x2a440d){while(--_0x2a440d){_0x230343['push'](_0x230343['shift']());}};_0x2fbd01(++_0x241481);}(_0xa63c,0x133));var _0xca63=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa63c[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xca63('0x0'));var md5=require(_0xca63('0x1'));var util=require(_0xca63('0x2'));var Redis=require('ioredis');var config=require(_0xca63('0x3'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xca63('0x4'))(new Redis(config[_0xca63('0x5')]));function FaxQueue(_0x3e0043){this['id']=_0x3e0043['id']||0x0;this[_0xca63('0x6')]=_0x3e0043[_0xca63('0x6')]||'';this['timeout']=_0x3e0043['timeout']||0xa;this['strategy']=_0x3e0043[_0xca63('0x7')]||'beepall';this[_0xca63('0x8')]=_0x3e0043[_0xca63('0x8')];this[_0xca63('0x9')]={};this[_0xca63('0xa')]=0x0;this[_0xca63('0x1')]='';this['updateRouting']();this[_0xca63('0xb')]();}FaxQueue['prototype'][_0xca63('0xc')]=function(){var _0x53b5e0=this['mapAgentsId'][_0xca63('0xd')];this[_0xca63('0x9')]=_[_0xca63('0xe')](this[_0xca63('0x8')],'id');this[_0xca63('0x9')][_0xca63('0xd')]=_0x53b5e0;};FaxQueue[_0xca63('0xf')]['updateRealtime']=function(){this[_0xca63('0x10')]=0x0;this[_0xca63('0x11')]=0x0;for(var _0x447307=0x0;_0x447307=0x0?this[_0xca63('0x15')]:0x0;var _0x5b2d15={'id':this['id'],'available':this[_0xca63('0x15')],'loggedIn':this[_0xca63('0x10')],'name':this['name'],'paused':this[_0xca63('0x11')],'waiting':this[_0xca63('0xa')]};var _0xbffeeb=md5(JSON['stringify'](_0x5b2d15));if(this[_0xca63('0x1')]!==_0xbffeeb){this[_0xca63('0x1')]=_0xbffeeb;io['to'](util[_0xca63('0x16')](_0xca63('0x17'),_0x5b2d15[_0xca63('0x6')]))[_0xca63('0x18')](_0xca63('0x19'),_0x5b2d15);}};module[_0xca63('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index f3817bb..81a1848 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 _0xed0f=['name','Intervals','exports'];(function(_0xdb3886,_0x440192){var _0x1a4611=function(_0x4e6c5e){while(--_0x4e6c5e){_0xdb3886['push'](_0xdb3886['shift']());}};_0x1a4611(++_0x440192);}(_0xed0f,0x78));var _0xfed0=function(_0x8c1bf,_0x1d81dd){_0x8c1bf=_0x8c1bf-0x0;var _0x1551e4=_0xed0f[_0x8c1bf];return _0x1551e4;};'use strict';function Interval(_0x3a9ca9){this['id']=_0x3a9ca9['id']||0x0;this[_0xfed0('0x0')]=_0x3a9ca9[_0xfed0('0x0')]||'';this['Intervals']=_0x3a9ca9[_0xfed0('0x1')]||{};}module[_0xfed0('0x2')]=Interval; \ No newline at end of file +var _0x9ea0=['exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9ea0,0x19d));var _0x09ea=function(_0x4e4e5a,_0x237d70){_0x4e4e5a=_0x4e4e5a-0x0;var _0xe64290=_0x9ea0[_0x4e4e5a];return _0xe64290;};'use strict';function Interval(_0x560c39){this['id']=_0x560c39['id']||0x0;this['name']=_0x560c39[_0x09ea('0x0')]||'';this['Intervals']=_0x560c39['Intervals']||{};}module[_0x09ea('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index e0a9fdb..e81818b 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 _0xb4ad=['waiting','updateRouting','updateRealtime','map','loggedIn','length','online','paused','available','name','stringify','format','mail:queue:%s','emit','mail_queue:save','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','timeout','strategy','Agents','mapAgentsId'];(function(_0x3d8132,_0x37c4a3){var _0xea4ce5=function(_0x352147){while(--_0x352147){_0x3d8132['push'](_0x3d8132['shift']());}};_0xea4ce5(++_0x37c4a3);}(_0xb4ad,0x1af));var _0xdb4a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb4ad[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var md5=require(_0xdb4a('0x0'));var util=require(_0xdb4a('0x1'));var Redis=require(_0xdb4a('0x2'));var config=require(_0xdb4a('0x3'));config['redis']=_[_0xdb4a('0x4')](config[_0xdb4a('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xdb4a('0x6'))(new Redis(config[_0xdb4a('0x5')]));function MailQueue(_0x2ca3fb){this['id']=_0x2ca3fb['id']||0x0;this['name']=_0x2ca3fb['name']||'';this[_0xdb4a('0x7')]=_0x2ca3fb[_0xdb4a('0x7')]||0xa;this[_0xdb4a('0x8')]=_0x2ca3fb[_0xdb4a('0x8')]||'beepall';this['Agents']=_0x2ca3fb[_0xdb4a('0x9')];this[_0xdb4a('0xa')]={};this[_0xdb4a('0xb')]=0x0;this[_0xdb4a('0x0')]='';this[_0xdb4a('0xc')]();this[_0xdb4a('0xd')]();}MailQueue['prototype'][_0xdb4a('0xc')]=function(){var _0x36af6c=this[_0xdb4a('0xa')]['_rr'];this['mapAgentsId']=_[_0xdb4a('0xe')](this[_0xdb4a('0x9')],'id');this[_0xdb4a('0xa')]['_rr']=_0x36af6c;};MailQueue['prototype'][_0xdb4a('0xd')]=function(){this[_0xdb4a('0xf')]=0x0;this['paused']=0x0;for(var _0x5354b5=0x0;_0x5354b5=0x0?this['available']:0x0;var _0x6d0694={'id':this['id'],'available':this[_0xdb4a('0x13')],'loggedIn':this[_0xdb4a('0xf')],'name':this[_0xdb4a('0x14')],'paused':this[_0xdb4a('0x12')],'waiting':this[_0xdb4a('0xb')]};var _0x139b8f=md5(JSON[_0xdb4a('0x15')](_0x6d0694));if(this[_0xdb4a('0x0')]!==_0x139b8f){this[_0xdb4a('0x0')]=_0x139b8f;io['to'](util[_0xdb4a('0x16')](_0xdb4a('0x17'),_0x6d0694[_0xdb4a('0x14')]))[_0xdb4a('0x18')](_0xdb4a('0x19'),_0x6d0694);}};module['exports']=MailQueue; \ No newline at end of file +var _0x0178=['length','online','mailPause','available','loggedIn','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','paused'];(function(_0x115ce4,_0x1cf310){var _0x3f0a54=function(_0x2f7584){while(--_0x2f7584){_0x115ce4['push'](_0x115ce4['shift']());}};_0x3f0a54(++_0x1cf310);}(_0x0178,0x155));var _0x8017=function(_0x59d455,_0x37eee9){_0x59d455=_0x59d455-0x0;var _0x3b9780=_0x0178[_0x59d455];return _0x3b9780;};'use strict';var _=require(_0x8017('0x0'));var md5=require(_0x8017('0x1'));var util=require('util');var Redis=require(_0x8017('0x2'));var config=require(_0x8017('0x3'));config['redis']=_[_0x8017('0x4')](config[_0x8017('0x5')],{'host':_0x8017('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8017('0x5')]));function MailQueue(_0x4fc05a){this['id']=_0x4fc05a['id']||0x0;this[_0x8017('0x7')]=_0x4fc05a[_0x8017('0x7')]||'';this[_0x8017('0x8')]=_0x4fc05a[_0x8017('0x8')]||0xa;this[_0x8017('0x9')]=_0x4fc05a[_0x8017('0x9')]||_0x8017('0xa');this[_0x8017('0xb')]=_0x4fc05a[_0x8017('0xb')];this[_0x8017('0xc')]={};this[_0x8017('0xd')]=0x0;this[_0x8017('0x1')]='';this[_0x8017('0xe')]();this['updateRealtime']();}MailQueue['prototype'][_0x8017('0xe')]=function(){var _0x1ee940=this[_0x8017('0xc')][_0x8017('0xf')];this[_0x8017('0xc')]=_[_0x8017('0x10')](this[_0x8017('0xb')],'id');this[_0x8017('0xc')][_0x8017('0xf')]=_0x1ee940;};MailQueue[_0x8017('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x8017('0x12')]=0x0;for(var _0xef4988=0x0;_0xef4988=0x0?this[_0x8017('0x16')]:0x0;var _0x1d5fb1={'id':this['id'],'available':this[_0x8017('0x16')],'loggedIn':this[_0x8017('0x17')],'name':this['name'],'paused':this[_0x8017('0x12')],'waiting':this['waiting']};var _0x5cd6b5=md5(JSON[_0x8017('0x18')](_0x1d5fb1));if(this[_0x8017('0x1')]!==_0x5cd6b5){this[_0x8017('0x1')]=_0x5cd6b5;io['to'](util[_0x8017('0x19')](_0x8017('0x1a'),_0x1d5fb1[_0x8017('0x7')]))[_0x8017('0x1b')](_0x8017('0x1c'),_0x1d5fb1);}};module[_0x8017('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e467fbb..2467410 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x543787,_0x5a2f18){var _0x309679=function(_0x23476e){while(--_0x23476e){_0x543787['push'](_0x543787['shift']());}};_0x309679(++_0x5a2f18);}(_0x814b,0x1a2));var _0xb814=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x814b[_0x1fc18b];return _0x16a351;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x2ef3,0xba));var _0x32ef=function(_0x48145e,_0x54e8e1){_0x48145e=_0x48145e-0x0;var _0x55f96a=_0x2ef3[_0x48145e];return _0x55f96a;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 8f095a1..b404cd2 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 _0x702d=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','smsPause','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x702d,0x147));var _0xd702=function(_0x1b262,_0x1b96d6){_0x1b262=_0x1b262-0x0;var _0x521481=_0x702d[_0x1b262];return _0x521481;};'use strict';var _=require(_0xd702('0x0'));var md5=require(_0xd702('0x1'));var util=require(_0xd702('0x2'));var Redis=require(_0xd702('0x3'));var config=require(_0xd702('0x4'));config['redis']=_[_0xd702('0x5')](config[_0xd702('0x6')],{'host':_0xd702('0x7'),'port':0x18eb});var io=require(_0xd702('0x8'))(new Redis(config['redis']));function SmsQueue(_0x432e01){this['id']=_0x432e01['id']||0x0;this['name']=_0x432e01[_0xd702('0x9')]||'';this[_0xd702('0xa')]=_0x432e01[_0xd702('0xa')]||0xa;this['strategy']=_0x432e01[_0xd702('0xb')]||'beepall';this[_0xd702('0xc')]=_0x432e01[_0xd702('0xc')];this[_0xd702('0xd')]={};this[_0xd702('0xe')]=0x0;this[_0xd702('0x1')]='';this[_0xd702('0xf')]();this[_0xd702('0x10')]();}SmsQueue[_0xd702('0x11')][_0xd702('0xf')]=function(){var _0x15a632=this['mapAgentsId']['_rr'];this[_0xd702('0xd')]=_[_0xd702('0x12')](this[_0xd702('0xc')],'id');this['mapAgentsId'][_0xd702('0x13')]=_0x15a632;};SmsQueue[_0xd702('0x11')][_0xd702('0x10')]=function(){this[_0xd702('0x14')]=0x0;this[_0xd702('0x15')]=0x0;for(var _0x181ff2=0x0;_0x181ff2=0x0?this['available']:0x0;var _0x2205de={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd702('0x14')],'name':this[_0xd702('0x9')],'paused':this[_0xd702('0x15')],'waiting':this[_0xd702('0xe')]};var _0x4cf326=md5(JSON[_0xd702('0x19')](_0x2205de));if(this[_0xd702('0x1')]!==_0x4cf326){this['md5']=_0x4cf326;io['to'](util['format']('sms:queue:%s',_0x2205de[_0xd702('0x9')]))[_0xd702('0x1a')]('sms_queue:save',_0x2205de);}};module[_0xd702('0x1b')]=SmsQueue; \ No newline at end of file +var _0xc964=['redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','ioredis','../../../config/environment'];(function(_0x3e9af0,_0xb82e07){var _0x243da8=function(_0x24e37d){while(--_0x24e37d){_0x3e9af0['push'](_0x3e9af0['shift']());}};_0x243da8(++_0xb82e07);}(_0xc964,0x7e));var _0x4c96=function(_0x1852d6,_0x3790d8){_0x1852d6=_0x1852d6-0x0;var _0xba7890=_0xc964[_0x1852d6];return _0xba7890;};'use strict';var _=require(_0x4c96('0x0'));var md5=require(_0x4c96('0x1'));var util=require('util');var Redis=require(_0x4c96('0x2'));var config=require(_0x4c96('0x3'));config[_0x4c96('0x4')]=_['defaults'](config[_0x4c96('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4c96('0x5'))(new Redis(config[_0x4c96('0x4')]));function SmsQueue(_0x1ab184){this['id']=_0x1ab184['id']||0x0;this[_0x4c96('0x6')]=_0x1ab184[_0x4c96('0x6')]||'';this[_0x4c96('0x7')]=_0x1ab184[_0x4c96('0x7')]||0xa;this['strategy']=_0x1ab184[_0x4c96('0x8')]||_0x4c96('0x9');this[_0x4c96('0xa')]=_0x1ab184['Agents'];this[_0x4c96('0xb')]={};this[_0x4c96('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x4c96('0xd')][_0x4c96('0xe')]=function(){var _0x323deb=this['mapAgentsId'][_0x4c96('0xf')];this['mapAgentsId']=_['map'](this[_0x4c96('0xa')],'id');this[_0x4c96('0xb')][_0x4c96('0xf')]=_0x323deb;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x4c96('0x10')]=0x0;this[_0x4c96('0x11')]=0x0;for(var _0x181afb=0x0;_0x181afb=0x0?this[_0x4c96('0x15')]:0x0;var _0x494a26={'id':this['id'],'available':this[_0x4c96('0x15')],'loggedIn':this[_0x4c96('0x10')],'name':this[_0x4c96('0x6')],'paused':this[_0x4c96('0x11')],'waiting':this[_0x4c96('0xc')]};var _0x32552d=md5(JSON[_0x4c96('0x16')](_0x494a26));if(this[_0x4c96('0x1')]!==_0x32552d){this[_0x4c96('0x1')]=_0x32552d;io['to'](util[_0x4c96('0x17')](_0x4c96('0x18'),_0x494a26['name']))['emit']('sms_queue:save',_0x494a26);}};module[_0x4c96('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 6a6aeec..b119cf0 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 _0x6813=['ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','whatsappPause','paused','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util'];(function(_0x1b9c2a,_0x50582e){var _0x21ab47=function(_0x3382c6){while(--_0x3382c6){_0x1b9c2a['push'](_0x1b9c2a['shift']());}};_0x21ab47(++_0x50582e);}(_0x6813,0x14d));var _0x3681=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6813[_0x432682];return _0x463d05;};'use strict';var _=require(_0x3681('0x0'));var md5=require(_0x3681('0x1'));var util=require(_0x3681('0x2'));var Redis=require(_0x3681('0x3'));var config=require('../../../config/environment');config[_0x3681('0x4')]=_[_0x3681('0x5')](config[_0x3681('0x4')],{'host':_0x3681('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3681('0x4')]));function WhatsappQueue(_0x4b7a4a){this['id']=_0x4b7a4a['id']||0x0;this[_0x3681('0x7')]=_0x4b7a4a[_0x3681('0x7')]||'';this[_0x3681('0x8')]=_0x4b7a4a[_0x3681('0x8')]||0xa;this['strategy']=_0x4b7a4a[_0x3681('0x9')]||_0x3681('0xa');this[_0x3681('0xb')]=_0x4b7a4a[_0x3681('0xb')];this['mapAgentsId']={};this[_0x3681('0xc')]=0x0;this['md5']='';this[_0x3681('0xd')]();this[_0x3681('0xe')]();}WhatsappQueue[_0x3681('0xf')]['updateRouting']=function(){var _0x5a47f3=this[_0x3681('0x10')][_0x3681('0x11')];this['mapAgentsId']=_[_0x3681('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x3681('0x11')]=_0x5a47f3;};WhatsappQueue[_0x3681('0xf')][_0x3681('0xe')]=function(){this[_0x3681('0x13')]=0x0;this['paused']=0x0;for(var _0x307fde=0x0;_0x307fde=0x0?this[_0x3681('0x17')]:0x0;var _0x275ae8={'id':this['id'],'available':this[_0x3681('0x17')],'loggedIn':this[_0x3681('0x13')],'name':this[_0x3681('0x7')],'paused':this['paused'],'waiting':this[_0x3681('0xc')]};var _0x2574a2=md5(JSON['stringify'](_0x275ae8));if(this['md5']!==_0x2574a2){this[_0x3681('0x1')]=_0x2574a2;io['to'](util[_0x3681('0x18')](_0x3681('0x19'),_0x275ae8[_0x3681('0x7')]))[_0x3681('0x1a')](_0x3681('0x1b'),_0x275ae8);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x57eb=['beepall','Agents','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','length','online','whatsappPause','available','paused','lodash','md5','ioredis','../../../config/environment','defaults','localhost','redis','name','timeout','strategy'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x57eb,0x176));var _0xb57e=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x57eb[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0xb57e('0x0'));var md5=require(_0xb57e('0x1'));var util=require('util');var Redis=require(_0xb57e('0x2'));var config=require(_0xb57e('0x3'));config['redis']=_[_0xb57e('0x4')](config['redis'],{'host':_0xb57e('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb57e('0x6')]));function WhatsappQueue(_0x3bed52){this['id']=_0x3bed52['id']||0x0;this[_0xb57e('0x7')]=_0x3bed52[_0xb57e('0x7')]||'';this[_0xb57e('0x8')]=_0x3bed52[_0xb57e('0x8')]||0xa;this[_0xb57e('0x9')]=_0x3bed52[_0xb57e('0x9')]||_0xb57e('0xa');this[_0xb57e('0xb')]=_0x3bed52[_0xb57e('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xb57e('0xc')]();this[_0xb57e('0xd')]();}WhatsappQueue[_0xb57e('0xe')][_0xb57e('0xc')]=function(){var _0x657f37=this['mapAgentsId'][_0xb57e('0xf')];this[_0xb57e('0x10')]=_[_0xb57e('0x11')](this[_0xb57e('0xb')],'id');this[_0xb57e('0x10')][_0xb57e('0xf')]=_0x657f37;};WhatsappQueue[_0xb57e('0xe')][_0xb57e('0xd')]=function(){this[_0xb57e('0x12')]=0x0;this['paused']=0x0;for(var _0x1bdcb4=0x0;_0x1bdcb4=0x0?this['available']:0x0;var _0x2b1495={'id':this['id'],'available':this[_0xb57e('0x16')],'loggedIn':this[_0xb57e('0x12')],'name':this[_0xb57e('0x7')],'paused':this[_0xb57e('0x17')],'waiting':this['waiting']};var _0x4d8da9=md5(JSON['stringify'](_0x2b1495));if(this[_0xb57e('0x1')]!==_0x4d8da9){this['md5']=_0x4d8da9;io['to'](util['format']('whatsapp:queue:%s',_0x2b1495[_0xb57e('0x7')]))['emit']('whatsapp_queue:save',_0x2b1495);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 86521d2..9c666d3 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 4d9f1b7..d5ac95b 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 _0x6620=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client','Request'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0x6620,0x18a));var _0x0662=function(_0x440601,_0x3cf358){_0x440601=_0x440601-0x0;var _0x2efd7c=_0x6620[_0x440601];return _0x2efd7c;};'use strict';var client=require(_0x0662('0x0'));exports['update']=function(_0x3c0830,_0x143309){return client[_0x0662('0x1')](_0x0662('0x2'),{'body':_0x143309,'options':{'where':{'id':_0x3c0830}},'log':_0x0662('0x3')});};exports[_0x0662('0x4')]=function(_0x386cb7,_0x253281){return client[_0x0662('0x1')](_0x0662('0x5'),{'body':_0x253281,'options':{'where':{'id':_0x386cb7}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd666=['../client','update','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x2a76bb,_0x1f5d8f){var _0x10eb36=function(_0xc94023){while(--_0xc94023){_0x2a76bb['push'](_0x2a76bb['shift']());}};_0x10eb36(++_0x1f5d8f);}(_0xd666,0xbe));var _0x6d66=function(_0x68fd87,_0x17f037){_0x68fd87=_0x68fd87-0x0;var _0x559470=_0xd666[_0x68fd87];return _0x559470;};'use strict';var client=require(_0x6d66('0x0'));exports[_0x6d66('0x1')]=function(_0x8c14f5,_0x5a3f55){return client['Request']('UpdateChatInteraction',{'body':_0x5a3f55,'options':{'where':{'id':_0x8c14f5}},'log':_0x6d66('0x2')});};exports[_0x6d66('0x3')]=function(_0x45fb05,_0x17a16e){return client['Request'](_0x6d66('0x4'),{'body':_0x17a16e,'options':{'where':{'id':_0x45fb05}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d64e9a4..9bd2265 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 _0xf602=['createChatMessage','Request','CreateChatMessage'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf602,0xd6));var _0x2f60=function(_0x26f2d1,_0x45f530){_0x26f2d1=_0x26f2d1-0x0;var _0x1fc6af=_0xf602[_0x26f2d1];return _0x1fc6af;};'use strict';var client=require('../client');exports['create']=function(_0x3234cb){return client[_0x2f60('0x0')](_0x2f60('0x1'),{'body':_0x3234cb,'log':_0x2f60('0x2')});}; \ No newline at end of file +var _0xa385=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa385,0xdb));var _0x5a38=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xa385[_0x22f8ab];return _0x2a70e5;};'use strict';var client=require(_0x5a38('0x0'));exports[_0x5a38('0x1')]=function(_0x5c92aa){return client['Request'](_0x5a38('0x2'),{'body':_0x5c92aa,'log':_0x5a38('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 56eba5d..8636a91 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 _0x9432=['../client','getChatQueues','GetChatQueue','name','strategy','online','chatPause'];(function(_0x39b6dd,_0x17d582){var _0x1bdb30=function(_0x2a9fca){while(--_0x2a9fca){_0x39b6dd['push'](_0x39b6dd['shift']());}};_0x1bdb30(++_0x17d582);}(_0x9432,0x1e3));var _0x2943=function(_0x12fb2e,_0x5ec4d5){_0x12fb2e=_0x12fb2e-0x0;var _0x1aa9a1=_0x9432[_0x12fb2e];return _0x1aa9a1;};'use strict';var client=require(_0x2943('0x0'));exports[_0x2943('0x1')]=function(){return function(){return client['Request'](_0x2943('0x2'),{'options':{'raw':![],'attributes':['id',_0x2943('0x3'),'timeout',_0x2943('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x2943('0x3'),_0x2943('0x5'),_0x2943('0x6')]}]},'log':_0x2943('0x1')});};}; \ No newline at end of file +var _0x1cb9=['Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','User'];(function(_0x4bf590,_0x2e0e18){var _0x32bc3c=function(_0x3643c6){while(--_0x3643c6){_0x4bf590['push'](_0x4bf590['shift']());}};_0x32bc3c(++_0x2e0e18);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5cc575,_0x1ae2c7){_0x5cc575=_0x5cc575-0x0;var _0xf7dce6=_0x1cb9[_0x5cc575];return _0xf7dce6;};'use strict';var client=require(_0x91cb('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x91cb('0x1')](_0x91cb('0x2'),{'options':{'raw':![],'attributes':['id',_0x91cb('0x3'),_0x91cb('0x4'),'strategy'],'include':[{'model':_0x91cb('0x5'),'as':_0x91cb('0x6'),'attributes':['id','name',_0x91cb('0x7'),_0x91cb('0x8')]}]},'log':_0x91cb('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ded2060..037828e 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 _0x38a5=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x5e89d8,_0x30a21a){var _0x5c1153=function(_0x2dcba0){while(--_0x2dcba0){_0x5e89d8['push'](_0x5e89d8['shift']());}};_0x5c1153(++_0x30a21a);}(_0x38a5,0x69));var _0x538a=function(_0x20cc34,_0x5cbade){_0x20cc34=_0x20cc34-0x0;var _0x36142c=_0x38a5[_0x20cc34];return _0x36142c;};'use strict';var client=require(_0x538a('0x0'));exports[_0x538a('0x1')]=function(_0x40fadb){return client[_0x538a('0x2')]('CreateChatQueueReport',{'body':_0x40fadb,'log':_0x538a('0x3')});};exports[_0x538a('0x4')]=function(_0x3d56d4,_0x31a6bd){return client[_0x538a('0x2')](_0x538a('0x5'),{'body':_0x31a6bd,'options':{'where':{'uniqueid':_0x3d56d4},'order':[['id',_0x538a('0x6')]],'limit':0x1},'log':_0x538a('0x5')});}; \ No newline at end of file +var _0xc831=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','create'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xc831,0x103));var _0x1c83=function(_0x5a327a,_0xd51695){_0x5a327a=_0x5a327a-0x0;var _0x50cdd7=_0xc831[_0x5a327a];return _0x50cdd7;};'use strict';var client=require('../client');exports[_0x1c83('0x0')]=function(_0xb982da){return client[_0x1c83('0x1')](_0x1c83('0x2'),{'body':_0xb982da,'log':_0x1c83('0x2')});};exports[_0x1c83('0x3')]=function(_0x282a11,_0x28441e){return client[_0x1c83('0x1')](_0x1c83('0x4'),{'body':_0x28441e,'options':{'where':{'uniqueid':_0x282a11},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 75b591e..f679fcc 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(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x7a54,0x106));var _0x47a5=function(_0x574a10,_0x508114){_0x574a10=_0x574a10-0x0;var _0x59a581=_0x7a54[_0x574a10];return _0x59a581;};'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(_0x2e83e9,_0x308711){var _0x33208a=function(_0x59d002){while(--_0x59d002){_0x2e83e9['push'](_0x2e83e9['shift']());}};_0x33208a(++_0x308711);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 bdfcd51..917417c 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 _0x8b09=['createFaxMessage','../client','CreateFaxMessage'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x8b09,0x82));var _0x98b0=function(_0x5601ac,_0x2d24d4){_0x5601ac=_0x5601ac-0x0;var _0xb2b770=_0x8b09[_0x5601ac];return _0xb2b770;};'use strict';var client=require(_0x98b0('0x0'));exports['create']=function(_0x3b284c){return client['Request'](_0x98b0('0x1'),{'body':_0x3b284c,'log':_0x98b0('0x2')});}; \ No newline at end of file +var _0xaeb6=['Request','CreateFaxMessage','createFaxMessage'];(function(_0x18202a,_0x3b6586){var _0x4919b1=function(_0x106be2){while(--_0x106be2){_0x18202a['push'](_0x18202a['shift']());}};_0x4919b1(++_0x3b6586);}(_0xaeb6,0x81));var _0x6aeb=function(_0x957193,_0x3fec8b){_0x957193=_0x957193-0x0;var _0x9473f8=_0xaeb6[_0x957193];return _0x9473f8;};'use strict';var client=require('../client');exports['create']=function(_0x376cda){return client[_0x6aeb('0x0')](_0x6aeb('0x1'),{'body':_0x376cda,'log':_0x6aeb('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c9f456b..f5563db 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 _0xbe43=['online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','timeout','User','Agents'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbe43,0x1d9));var _0x3be4=function(_0x563e04,_0x208be6){_0x563e04=_0x563e04-0x0;var _0x1880e6=_0xbe43[_0x563e04];return _0x1880e6;};'use strict';var client=require(_0x3be4('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x3be4('0x1')](_0x3be4('0x2'),{'options':{'raw':![],'attributes':['id',_0x3be4('0x3'),_0x3be4('0x4'),'strategy'],'include':[{'model':_0x3be4('0x5'),'as':_0x3be4('0x6'),'attributes':['id','name',_0x3be4('0x7'),_0x3be4('0x8')]}]},'log':_0x3be4('0x9')});};}; \ No newline at end of file +var _0xca66=['timeout','strategy','User','Agents','online','getFaxQueues','../client','Request','name'];(function(_0x26f657,_0x32a721){var _0x41a2b0=function(_0xc107c2){while(--_0xc107c2){_0x26f657['push'](_0x26f657['shift']());}};_0x41a2b0(++_0x32a721);}(_0xca66,0x138));var _0x6ca6=function(_0x413503,_0x1a43b4){_0x413503=_0x413503-0x0;var _0x12fd3e=_0xca66[_0x413503];return _0x12fd3e;};'use strict';var client=require(_0x6ca6('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x6ca6('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x6ca6('0x2'),_0x6ca6('0x3'),_0x6ca6('0x4')],'include':[{'model':_0x6ca6('0x5'),'as':_0x6ca6('0x6'),'attributes':['id',_0x6ca6('0x2'),_0x6ca6('0x7'),'faxPause']}]},'log':_0x6ca6('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 2bc5e94..7c8c6a9 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 _0x3e57=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x3e57,0xdb));var _0x73e5=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x3e57[_0x373dee];return _0x46798f;};'use strict';var client=require(_0x73e5('0x0'));exports[_0x73e5('0x1')]=function(_0xaf1fcb){return client[_0x73e5('0x2')](_0x73e5('0x3'),{'body':_0xaf1fcb,'log':'CreateFaxQueueReport'});};exports[_0x73e5('0x4')]=function(_0x363b9f,_0x303e19){return client[_0x73e5('0x2')](_0x73e5('0x5'),{'body':_0x303e19,'options':{'where':{'uniqueid':_0x363b9f},'order':[['id',_0x73e5('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x64bd=['UpdateFaxQueueReport','create','CreateFaxQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64bd,0x101));var _0xd64b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x64bd[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports[_0xd64b('0x0')]=function(_0x3fa1c3){return client['Request'](_0xd64b('0x1'),{'body':_0x3fa1c3,'log':_0xd64b('0x1')});};exports[_0xd64b('0x2')]=function(_0x2fc48a,_0x4e54c7){return client['Request'](_0xd64b('0x3'),{'body':_0x4e54c7,'options':{'where':{'uniqueid':_0x2fc48a},'order':[['id','DESC']],'limit':0x1},'log':_0xd64b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b7f2f3e..faf753b 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 _0xcc68=['name','interval','getIntervals','Request','GetInterval','Interval','Intervals'];(function(_0x11fb37,_0xe5ec6){var _0x2a766b=function(_0xd690bf){while(--_0xd690bf){_0x11fb37['push'](_0x11fb37['shift']());}};_0x2a766b(++_0xe5ec6);}(_0xcc68,0xbf));var _0x8cc6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcc68[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0x8cc6('0x0')]=function(){return function(){return client[_0x8cc6('0x1')](_0x8cc6('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x8cc6('0x3'),'as':_0x8cc6('0x4'),'attributes':['id',_0x8cc6('0x5'),_0x8cc6('0x6')]}]},'log':_0x8cc6('0x0')});};}; \ No newline at end of file +var _0x3411=['Intervals','interval','../client','getIntervals','name','Interval'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x3411,0x128));var _0x1341=function(_0x44db9b,_0x124756){_0x44db9b=_0x44db9b-0x0;var _0x5cf152=_0x3411[_0x44db9b];return _0x5cf152;};'use strict';var client=require(_0x1341('0x0'));exports[_0x1341('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1341('0x2')],'include':[{'model':_0x1341('0x3'),'as':_0x1341('0x4'),'attributes':['id',_0x1341('0x2'),_0x1341('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 060d30a..4cbdd07 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 _0x2a07=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x2a07,0x74));var _0x72a0=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0x2a07[_0x43a6cd];return _0x5acb36;};'use strict';var client=require(_0x72a0('0x0'));exports[_0x72a0('0x1')]=function(_0x3ed8a9,_0x437db4){return client[_0x72a0('0x2')]('UpdateMailInteraction',{'body':_0x437db4,'options':{'where':{'id':_0x3ed8a9}},'log':_0x72a0('0x3')});};exports[_0x72a0('0x4')]=function(_0x135982,_0x45b155){return client[_0x72a0('0x2')](_0x72a0('0x5'),{'body':_0x45b155,'options':{'where':{'id':_0x135982}},'log':_0x72a0('0x6')});}; \ No newline at end of file +var _0x1a85=['AddTagsToMailInteraction','Request','addTags'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1a85,0x178));var _0x51a8=function(_0x8f6830,_0x7c8a1e){_0x8f6830=_0x8f6830-0x0;var _0x4ce2e5=_0x1a85[_0x8f6830];return _0x4ce2e5;};'use strict';var client=require('../client');exports['update']=function(_0x305f18,_0x382cb8){return client[_0x51a8('0x0')]('UpdateMailInteraction',{'body':_0x382cb8,'options':{'where':{'id':_0x305f18}},'log':'updateMailInteraction'});};exports[_0x51a8('0x1')]=function(_0x1377a4,_0x99e371){return client['Request'](_0x51a8('0x2'),{'body':_0x99e371,'options':{'where':{'id':_0x1377a4}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 981ffe8..9d97bee 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 _0x0f8f=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x4615e5,_0x18cdab){var _0x12a4c1=function(_0x2a22de){while(--_0x2a22de){_0x4615e5['push'](_0x4615e5['shift']());}};_0x12a4c1(++_0x18cdab);}(_0x0f8f,0x1af));var _0xf0f8=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0x0f8f[_0x22bee0];return _0x2d295b;};'use strict';var client=require(_0xf0f8('0x0'));exports[_0xf0f8('0x1')]=function(_0x55a00c){return client['Request'](_0xf0f8('0x2'),{'body':_0x55a00c,'log':_0xf0f8('0x3')});}; \ No newline at end of file +var _0xafce=['CreateMailMessage','createMailMessage','create','Request'];(function(_0x1faa32,_0x5007ef){var _0xb9c8ea=function(_0x189107){while(--_0x189107){_0x1faa32['push'](_0x1faa32['shift']());}};_0xb9c8ea(++_0x5007ef);}(_0xafce,0xbe));var _0xeafc=function(_0x201a72,_0x27bf52){_0x201a72=_0x201a72-0x0;var _0x39d16f=_0xafce[_0x201a72];return _0x39d16f;};'use strict';var client=require('../client');exports[_0xeafc('0x0')]=function(_0x51800e){return client[_0xeafc('0x1')](_0xeafc('0x2'),{'body':_0x51800e,'log':_0xeafc('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index d8b59d6..a407870 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 _0x554e=['Agents','online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy'];(function(_0xffa654,_0x4c734){var _0x5dd847=function(_0x64173a){while(--_0x64173a){_0xffa654['push'](_0xffa654['shift']());}};_0x5dd847(++_0x4c734);}(_0x554e,0x111));var _0xe554=function(_0x12fc6d,_0x1b2dc1){_0x12fc6d=_0x12fc6d-0x0;var _0x2929f0=_0x554e[_0x12fc6d];return _0x2929f0;};'use strict';var client=require(_0xe554('0x0'));exports[_0xe554('0x1')]=function(){return function(){return client['Request'](_0xe554('0x2'),{'options':{'raw':![],'attributes':['id',_0xe554('0x3'),_0xe554('0x4'),_0xe554('0x5')],'include':[{'model':'User','as':_0xe554('0x6'),'attributes':['id',_0xe554('0x3'),_0xe554('0x7'),_0xe554('0x8')]}]},'log':_0xe554('0x1')});};}; \ No newline at end of file +var _0xe49a=['name','timeout','strategy','Agents','mailPause','getMailQueues','GetMailQueue'];(function(_0x120f38,_0x539970){var _0x15afdb=function(_0x4b192b){while(--_0x4b192b){_0x120f38['push'](_0x120f38['shift']());}};_0x15afdb(++_0x539970);}(_0xe49a,0x6f));var _0xae49=function(_0x56f736,_0x521360){_0x56f736=_0x56f736-0x0;var _0x47b49e=_0xe49a[_0x56f736];return _0x47b49e;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client['Request'](_0xae49('0x0'),{'options':{'raw':![],'attributes':['id',_0xae49('0x1'),_0xae49('0x2'),_0xae49('0x3')],'include':[{'model':'User','as':_0xae49('0x4'),'attributes':['id','name','online',_0xae49('0x5')]}]},'log':_0xae49('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index fba83e7..6d05b2c 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 _0xf0a0=['update','Request','DESC','UpdateMailQueueReport','../client','create','CreateMailQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf0a0,0x154));var _0x0f0a=function(_0x20897f,_0x4f3f9e){_0x20897f=_0x20897f-0x0;var _0x4076b1=_0xf0a0[_0x20897f];return _0x4076b1;};'use strict';var client=require(_0x0f0a('0x0'));exports[_0x0f0a('0x1')]=function(_0x38f434){return client['Request']('CreateMailQueueReport',{'body':_0x38f434,'log':_0x0f0a('0x2')});};exports[_0x0f0a('0x3')]=function(_0x4d8d54,_0x29b951){return client[_0x0f0a('0x4')]('UpdateMailQueueReport',{'body':_0x29b951,'options':{'where':{'uniqueid':_0x4d8d54},'order':[['id',_0x0f0a('0x5')]],'limit':0x1},'log':_0x0f0a('0x6')});}; \ No newline at end of file +var _0xce30=['update','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0xa291c1,_0x47aebf){var _0x463e27=function(_0x8b0ae3){while(--_0x8b0ae3){_0xa291c1['push'](_0xa291c1['shift']());}};_0x463e27(++_0x47aebf);}(_0xce30,0x160));var _0x0ce3=function(_0x58675a,_0x3bac9c){_0x58675a=_0x58675a-0x0;var _0x480300=_0xce30[_0x58675a];return _0x480300;};'use strict';var client=require('../client');exports[_0x0ce3('0x0')]=function(_0x5a8f0c){return client[_0x0ce3('0x1')](_0x0ce3('0x2'),{'body':_0x5a8f0c,'log':_0x0ce3('0x2')});};exports[_0x0ce3('0x3')]=function(_0x134099,_0x5a921d){return client['Request'](_0x0ce3('0x4'),{'body':_0x5a921d,'options':{'where':{'uniqueid':_0x134099},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 3dcba30..a036915 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 _0x3aa6=['addTags','AddTagsToOpenchannelInteraction','Request'];(function(_0x253b22,_0x385a39){var _0x90a589=function(_0x4bc184){while(--_0x4bc184){_0x253b22['push'](_0x253b22['shift']());}};_0x90a589(++_0x385a39);}(_0x3aa6,0xbf));var _0x63aa=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x3aa6[_0x3c22e0];return _0x215811;};'use strict';var client=require('../client');exports['update']=function(_0x57c09d,_0x465dc5){return client[_0x63aa('0x0')]('UpdateOpenchannelInteraction',{'body':_0x465dc5,'options':{'where':{'id':_0x57c09d}},'log':'updateOpenchannelInteraction'});};exports[_0x63aa('0x1')]=function(_0x2c9345,_0x5d7d45){return client[_0x63aa('0x0')](_0x63aa('0x2'),{'body':_0x5d7d45,'options':{'where':{'id':_0x2c9345}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xb0f6=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x54bdd1,_0x52b169){var _0x3fa79e=function(_0x1bfed7){while(--_0x1bfed7){_0x54bdd1['push'](_0x54bdd1['shift']());}};_0x3fa79e(++_0x52b169);}(_0xb0f6,0x1bf));var _0x6b0f=function(_0x2ff8cb,_0x4e5089){_0x2ff8cb=_0x2ff8cb-0x0;var _0x2bea71=_0xb0f6[_0x2ff8cb];return _0x2bea71;};'use strict';var client=require(_0x6b0f('0x0'));exports[_0x6b0f('0x1')]=function(_0x406f83,_0x328336){return client[_0x6b0f('0x2')]('UpdateOpenchannelInteraction',{'body':_0x328336,'options':{'where':{'id':_0x406f83}},'log':_0x6b0f('0x3')});};exports[_0x6b0f('0x4')]=function(_0x5724fd,_0x5f4346){return client[_0x6b0f('0x2')](_0x6b0f('0x5'),{'body':_0x5f4346,'options':{'where':{'id':_0x5724fd}},'log':_0x6b0f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 964bbea..9b66e3f 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 _0x4a99=['createOpenchannelMessage','create','Request'];(function(_0x5c87ab,_0x203995){var _0x2b2d3f=function(_0x372b6e){while(--_0x372b6e){_0x5c87ab['push'](_0x5c87ab['shift']());}};_0x2b2d3f(++_0x203995);}(_0x4a99,0xc4));var _0x94a9=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x4a99[_0x110c3d];return _0x226d67;};'use strict';var client=require('../client');exports[_0x94a9('0x0')]=function(_0x46c3bc){return client[_0x94a9('0x1')]('CreateOpenchannelMessage',{'body':_0x46c3bc,'log':_0x94a9('0x2')});}; \ No newline at end of file +var _0x8b8c=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x51f7d5,_0x5788bc){var _0x39e750=function(_0x4def50){while(--_0x4def50){_0x51f7d5['push'](_0x51f7d5['shift']());}};_0x39e750(++_0x5788bc);}(_0x8b8c,0x83));var _0xc8b8=function(_0x16ea91,_0x390bc5){_0x16ea91=_0x16ea91-0x0;var _0x11ba61=_0x8b8c[_0x16ea91];return _0x11ba61;};'use strict';var client=require('../client');exports[_0xc8b8('0x0')]=function(_0x16a696){return client[_0xc8b8('0x1')](_0xc8b8('0x2'),{'body':_0x16a696,'log':_0xc8b8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index dd50c43..c60c93f 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 _0xd133=['strategy','User','Agents','../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout'];(function(_0x3b7f91,_0x260ad7){var _0x34c1cc=function(_0x1fe6f1){while(--_0x1fe6f1){_0x3b7f91['push'](_0x3b7f91['shift']());}};_0x34c1cc(++_0x260ad7);}(_0xd133,0x8b));var _0x3d13=function(_0x401d4e,_0x2f6357){_0x401d4e=_0x401d4e-0x0;var _0x382ee1=_0xd133[_0x401d4e];return _0x382ee1;};'use strict';var client=require(_0x3d13('0x0'));exports[_0x3d13('0x1')]=function(){return function(){return client['Request'](_0x3d13('0x2'),{'options':{'raw':![],'attributes':['id',_0x3d13('0x3'),_0x3d13('0x4'),_0x3d13('0x5')],'include':[{'model':_0x3d13('0x6'),'as':_0x3d13('0x7'),'attributes':['id',_0x3d13('0x3'),'online','openchannelPause']}]},'log':_0x3d13('0x1')});};}; \ No newline at end of file +var _0x7373=['getOpenchannelQueues','Request','GetOpenchannelQueue','strategy','Agents','name','online','openchannelPause','../client'];(function(_0x1feb4a,_0x2dd08d){var _0x1e2004=function(_0x45d247){while(--_0x45d247){_0x1feb4a['push'](_0x1feb4a['shift']());}};_0x1e2004(++_0x2dd08d);}(_0x7373,0x182));var _0x3737=function(_0x31a12b,_0x323188){_0x31a12b=_0x31a12b-0x0;var _0x5bf8e8=_0x7373[_0x31a12b];return _0x5bf8e8;};'use strict';var client=require(_0x3737('0x0'));exports[_0x3737('0x1')]=function(){return function(){return client[_0x3737('0x2')](_0x3737('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x3737('0x4')],'include':[{'model':'User','as':_0x3737('0x5'),'attributes':['id',_0x3737('0x6'),_0x3737('0x7'),_0x3737('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e8cd36b..acc8874 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 _0x5dd5=['create','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0x5dd5,0x1a0));var _0x55dd=function(_0x3d6398,_0x47ccb9){_0x3d6398=_0x3d6398-0x0;var _0x46d742=_0x5dd5[_0x3d6398];return _0x46d742;};'use strict';var client=require('../client');exports[_0x55dd('0x0')]=function(_0x5beea6){return client['Request'](_0x55dd('0x1'),{'body':_0x5beea6,'log':_0x55dd('0x1')});};exports['update']=function(_0x3d4130,_0x1f8282){return client['Request'](_0x55dd('0x2'),{'body':_0x1f8282,'options':{'where':{'uniqueid':_0x3d4130},'order':[['id',_0x55dd('0x3')]],'limit':0x1},'log':_0x55dd('0x2')});}; \ No newline at end of file +var _0xe084=['update','Request','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport'];(function(_0x132fde,_0x4f2d91){var _0x35bb6e=function(_0x5d95e0){while(--_0x5d95e0){_0x132fde['push'](_0x132fde['shift']());}};_0x35bb6e(++_0x4f2d91);}(_0xe084,0x171));var _0x4e08=function(_0xde611a,_0x1e9738){_0xde611a=_0xde611a-0x0;var _0x473a0c=_0xe084[_0xde611a];return _0x473a0c;};'use strict';var client=require(_0x4e08('0x0'));exports[_0x4e08('0x1')]=function(_0x1b42e0){return client['Request'](_0x4e08('0x2'),{'body':_0x1b42e0,'log':'CreateOpenchannelQueueReport'});};exports[_0x4e08('0x3')]=function(_0xfbf7d0,_0x4b5960){return client[_0x4e08('0x4')](_0x4e08('0x5'),{'body':_0x4b5960,'options':{'where':{'uniqueid':_0xfbf7d0},'order':[['id','DESC']],'limit':0x1},'log':_0x4e08('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index eead540..6bcf933 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 _0x956a=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x11abeb,_0x5cfad8){var _0x57b3ae=function(_0x6ae73d){while(--_0x6ae73d){_0x11abeb['push'](_0x11abeb['shift']());}};_0x57b3ae(++_0x5cfad8);}(_0x956a,0xb6));var _0xa956=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x956a[_0x21a9d9];return _0x46adce;};'use strict';var client=require('../client');exports[_0xa956('0x0')]=function(_0x238805,_0x450ebd){return client[_0xa956('0x1')](_0xa956('0x2'),{'body':_0x450ebd,'options':{'where':{'id':_0x238805}},'log':_0xa956('0x3')});};exports[_0xa956('0x4')]=function(_0x38c808,_0x48bb8a){return client['Request'](_0xa956('0x5'),{'body':_0x48bb8a,'options':{'where':{'id':_0x38c808}},'log':_0xa956('0x6')});}; \ No newline at end of file +var _0xf25a=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x335793,_0x5d5bb0){var _0x23face=function(_0x263cc9){while(--_0x263cc9){_0x335793['push'](_0x335793['shift']());}};_0x23face(++_0x5d5bb0);}(_0xf25a,0x195));var _0xaf25=function(_0x4f613f,_0x488ed6){_0x4f613f=_0x4f613f-0x0;var _0x397818=_0xf25a[_0x4f613f];return _0x397818;};'use strict';var client=require(_0xaf25('0x0'));exports[_0xaf25('0x1')]=function(_0x130bc0,_0x5860fc){return client[_0xaf25('0x2')](_0xaf25('0x3'),{'body':_0x5860fc,'options':{'where':{'id':_0x130bc0}},'log':_0xaf25('0x4')});};exports['addTags']=function(_0x1ef749,_0x49e3b2){return client[_0xaf25('0x2')]('AddTagsToSmsInteraction',{'body':_0x49e3b2,'options':{'where':{'id':_0x1ef749}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index d435d01..d73f039 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 _0x64c3=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x1c2691,_0x3d278f){var _0x1fa47b=function(_0x42b8a6){while(--_0x42b8a6){_0x1c2691['push'](_0x1c2691['shift']());}};_0x1fa47b(++_0x3d278f);}(_0x64c3,0x89));var _0x364c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64c3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x364c('0x0'));exports[_0x364c('0x1')]=function(_0x43bf52){return client[_0x364c('0x2')](_0x364c('0x3'),{'body':_0x43bf52,'log':_0x364c('0x4')});}; \ No newline at end of file +var _0xc34a=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x189b61,_0x30c36d){var _0x42dfac=function(_0x3e657f){while(--_0x3e657f){_0x189b61['push'](_0x189b61['shift']());}};_0x42dfac(++_0x30c36d);}(_0xc34a,0x1ea));var _0xac34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc34a[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xac34('0x0'));exports[_0xac34('0x1')]=function(_0x5269cd){return client[_0xac34('0x2')](_0xac34('0x3'),{'body':_0x5269cd,'log':_0xac34('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index e0f9e1d..14eff21 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x192221,_0x53ea2d){var _0x356182=function(_0x78f42c){while(--_0x78f42c){_0x192221['push'](_0x192221['shift']());}};_0x356182(++_0x53ea2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x1906e0,_0x3dd0bc){var _0x43d72c=function(_0xb3a12b){while(--_0xb3a12b){_0x1906e0['push'](_0x1906e0['shift']());}};_0x43d72c(++_0x3dd0bc);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 042cbe2..ae2ded9 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0xa89d8b,_0x3fa538){var _0x417dc7=function(_0x28a1e1){while(--_0x28a1e1){_0xa89d8b['push'](_0xa89d8b['shift']());}};_0x417dc7(++_0x3fa538);}(_0x55ca,0x126));var _0xa55c=function(_0x35c12c,_0x378ba0){_0x35c12c=_0x35c12c-0x0;var _0x2bab3a=_0x55ca[_0x35c12c];return _0x2bab3a;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x50b33e,_0x3fae02){var _0xc19328=function(_0x330506){while(--_0x330506){_0x50b33e['push'](_0x50b33e['shift']());}};_0xc19328(++_0x3fae02);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e564ccf..4be1ebd 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(_0x2a23d3,_0x1a9223){var _0x45b2fe=function(_0x260279){while(--_0x260279){_0x2a23d3['push'](_0x2a23d3['shift']());}};_0x45b2fe(++_0x1a9223);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x10d84a,_0x15bda3){var _0x39e465=function(_0x9bb156){while(--_0x9bb156){_0x10d84a['push'](_0x10d84a['shift']());}};_0x39e465(++_0x15bda3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 69ba53d..0c9afae 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 _0xa23f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x2b9dc3,_0x47b3b6){var _0x32b056=function(_0x3c0141){while(--_0x3c0141){_0x2b9dc3['push'](_0x2b9dc3['shift']());}};_0x32b056(++_0x47b3b6);}(_0xa23f,0x7c));var _0xfa23=function(_0x57f641,_0x1642f1){_0x57f641=_0x57f641-0x0;var _0x557365=_0xa23f[_0x57f641];return _0x557365;};'use strict';var client=require(_0xfa23('0x0'));exports[_0xfa23('0x1')]=function(_0x56a4e3,_0x48fd46){return client[_0xfa23('0x2')](_0xfa23('0x3'),{'body':_0x48fd46,'options':{'where':{'id':_0x56a4e3}},'log':_0xfa23('0x4')});};exports[_0xfa23('0x5')]=function(_0x5643b1,_0x86778e){return client['Request'](_0xfa23('0x6'),{'body':_0x86778e,'options':{'where':{'id':_0x5643b1}},'log':_0xfa23('0x7')});}; \ No newline at end of file +var _0xa24d=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client'];(function(_0x1866ea,_0x547489){var _0x34f90a=function(_0x2b9a5c){while(--_0x2b9a5c){_0x1866ea['push'](_0x1866ea['shift']());}};_0x34f90a(++_0x547489);}(_0xa24d,0x1c1));var _0xda24=function(_0x225bbd,_0x378910){_0x225bbd=_0x225bbd-0x0;var _0x44fd36=_0xa24d[_0x225bbd];return _0x44fd36;};'use strict';var client=require(_0xda24('0x0'));exports[_0xda24('0x1')]=function(_0x2e012b,_0x4432eb){return client[_0xda24('0x2')](_0xda24('0x3'),{'body':_0x4432eb,'options':{'where':{'id':_0x2e012b}},'log':_0xda24('0x4')});};exports['addTags']=function(_0xcc2450,_0x2e6e4f){return client[_0xda24('0x2')](_0xda24('0x5'),{'body':_0x2e6e4f,'options':{'where':{'id':_0xcc2450}},'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 9606002..5f3a8ea 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 _0x9f9f=['CreateWhatsappMessage','createWhatsappMessage','create','Request'];(function(_0x1c7aa8,_0x5035b9){var _0x5a6657=function(_0xb8d83b){while(--_0xb8d83b){_0x1c7aa8['push'](_0x1c7aa8['shift']());}};_0x5a6657(++_0x5035b9);}(_0x9f9f,0xc6));var _0xf9f9=function(_0x2cc83d,_0x38125e){_0x2cc83d=_0x2cc83d-0x0;var _0x200749=_0x9f9f[_0x2cc83d];return _0x200749;};'use strict';var client=require('../client');exports[_0xf9f9('0x0')]=function(_0x43255d){return client[_0xf9f9('0x1')](_0xf9f9('0x2'),{'body':_0x43255d,'log':_0xf9f9('0x3')});}; \ No newline at end of file +var _0x3eaf=['create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x5eab9b,_0x113241){var _0x16bbc5=function(_0x523fae){while(--_0x523fae){_0x5eab9b['push'](_0x5eab9b['shift']());}};_0x16bbc5(++_0x113241);}(_0x3eaf,0xac));var _0xf3ea=function(_0x42eff8,_0x5142b8){_0x42eff8=_0x42eff8-0x0;var _0x343f23=_0x3eaf[_0x42eff8];return _0x343f23;};'use strict';var client=require('../client');exports[_0xf3ea('0x0')]=function(_0x422314){return client[_0xf3ea('0x1')](_0xf3ea('0x2'),{'body':_0x422314,'log':_0xf3ea('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 70a9cfe..ed4655c 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 _0x24e9=['getWhatsappQueues','Request','name','timeout','strategy','User','Agents','online','whatsappPause','../client'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x24e9,0x1f3));var _0x924e=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x24e9[_0x5678b5];return _0x4c09a5;};'use strict';var client=require(_0x924e('0x0'));exports[_0x924e('0x1')]=function(){return function(){return client[_0x924e('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x924e('0x3'),_0x924e('0x4'),_0x924e('0x5')],'include':[{'model':_0x924e('0x6'),'as':_0x924e('0x7'),'attributes':['id',_0x924e('0x3'),_0x924e('0x8'),_0x924e('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x4cd4=['getWhatsappQueues','name','timeout','strategy','online','whatsappPause','../client'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x4cd4,0x180));var _0x44cd=function(_0x44e04f,_0x31968c){_0x44e04f=_0x44e04f-0x0;var _0x479aca=_0x4cd4[_0x44e04f];return _0x479aca;};'use strict';var client=require(_0x44cd('0x0'));exports[_0x44cd('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x44cd('0x2'),_0x44cd('0x3'),_0x44cd('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x44cd('0x5'),_0x44cd('0x6')]}]},'log':_0x44cd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0c4e16e..6768599 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 _0x8cc3=['UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport','Request'];(function(_0x14ad92,_0x3b4315){var _0x41ceae=function(_0x252cd1){while(--_0x252cd1){_0x14ad92['push'](_0x14ad92['shift']());}};_0x41ceae(++_0x3b4315);}(_0x8cc3,0xe9));var _0x38cc=function(_0x3a21e5,_0x8b1531){_0x3a21e5=_0x3a21e5-0x0;var _0xe626f=_0x8cc3[_0x3a21e5];return _0xe626f;};'use strict';var client=require('../client');exports[_0x38cc('0x0')]=function(_0x532061){return client['Request'](_0x38cc('0x1'),{'body':_0x532061,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x779575,_0x3d9690){return client[_0x38cc('0x2')]('UpdateWhatsappQueueReport',{'body':_0x3d9690,'options':{'where':{'uniqueid':_0x779575},'order':[['id','DESC']],'limit':0x1},'log':_0x38cc('0x3')});}; \ No newline at end of file +var _0x70a0=['Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create'];(function(_0x485d3e,_0x1cc2ae){var _0x286fb7=function(_0x9b536a){while(--_0x9b536a){_0x485d3e['push'](_0x485d3e['shift']());}};_0x286fb7(++_0x1cc2ae);}(_0x70a0,0x6e));var _0x070a=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x70a0[_0x413feb];return _0x40ee88;};'use strict';var client=require(_0x070a('0x0'));exports[_0x070a('0x1')]=function(_0x4c72ce){return client[_0x070a('0x2')]('CreateWhatsappQueueReport',{'body':_0x4c72ce,'log':_0x070a('0x3')});};exports[_0x070a('0x4')]=function(_0x40abff,_0x9a45df){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x9a45df,'options':{'where':{'uniqueid':_0x40abff},'order':[['id',_0x070a('0x5')]],'limit':0x1},'log':_0x070a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 61f9ef6..93465d8 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 _0xe39b=['toLowerCase','error','[%s][AGENT]\x20%s','message','join','find','createQueue','format','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','name'];(function(_0x1c7aa0,_0x41b4b0){var _0x4756ad=function(_0x1a2164){while(--_0x1a2164){_0x1c7aa0['push'](_0x1c7aa0['shift']());}};_0x4756ad(++_0x41b4b0);}(_0xe39b,0x10d));var _0xbe39=function(_0x560526,_0x4e979c){_0x560526=_0x560526-0x0;var _0x4e780b=_0xe39b[_0x560526];return _0x4e780b;};'use strict';var schema=require('validate');var _=require(_0xbe39('0x0'));var util=require(_0xbe39('0x1'));var seqqueue=require(_0xbe39('0x2'));var logger=require(_0xbe39('0x3'))(_0xbe39('0x4'));var strategy=require(_0xbe39('0x5'));var queue=schema({'name':{'type':_0xbe39('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xbe39('0x7'),'message':_0xbe39('0x8')}});function writeLog(_0x5db548,_0x3401fc,_0x445cf0){return logger['info'](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5db548,_0x3401fc[_0xbe39('0x9')],_0x445cf0));}function handleFindAgent(_0x5c2623){return function(_0x2630c6){return _0x2630c6[_0xbe39('0x9')][_0xbe39('0xa')]()===_0x5c2623['toLowerCase']();};}exports['consequence']=function(_0x476d3e,_0xe06d7b,_0x32010d,_0x27036d){return function(_0x307c4a){try{var _0x3c2b26={'name':_0xe06d7b[0x0],'timeout':_0xe06d7b[0x1]};var _0x44b16a=queue['validate'](_0x3c2b26,{'typecast':!![]});if(_0x44b16a['length']){logger[_0xbe39('0xb')](_0xbe39('0xc'),_0x476d3e,_['map'](_0x44b16a,_0xbe39('0xd'))[_0xbe39('0xe')](',\x20'));_0x307c4a['stop']();}else{var _0x1cf6a0=_[_0xbe39('0xf')](_0x32010d['agents'],handleFindAgent(_0x3c2b26[_0xbe39('0x9')]));if(_0x1cf6a0){var _0x3f4346=(_0x3c2b26['timeout']||0xa)*0x3e8;var _0x484d5f,_0x235ef7;var _0x55f5b5=seqqueue[_0xbe39('0x10')](_0x3f4346);_0x55f5b5['id']=_0x476d3e;_0x55f5b5['atimeout']=_0x3f4346;_0x55f5b5['channel']=_0x27036d['channel'];writeLog(_0x476d3e,_0x1cf6a0,util[_0xbe39('0x11')](_0xbe39('0x12'),_0x3f4346));_0x32010d[_0xbe39('0x13')][_0x476d3e]['on'](_0xbe39('0x14'),function(){logger[_0xbe39('0x15')](_0xbe39('0x16'),_0x476d3e);clearTimeout(_0x235ef7);_0x235ef7=undefined;_0x55f5b5[_0xbe39('0x17')]();if(_0x32010d['rules'][_0x476d3e]){delete _0x32010d[_0xbe39('0x13')][_0x476d3e];}_0x307c4a[_0xbe39('0x18')]();});_0x32010d[_0xbe39('0x13')][_0x476d3e]['on'](_0xbe39('0x19'),function(){if(_0x32010d[_0xbe39('0x13')][_0x476d3e]){delete _0x32010d[_0xbe39('0x13')][_0x476d3e];}});_0x235ef7=setTimeout(function(){logger[_0xbe39('0x15')](_0xbe39('0x1a'),_0x476d3e);clearTimeout(_0x235ef7);_0x55f5b5['close']();_0x307c4a[_0xbe39('0x1b')]();},_0x3f4346);strategy[_0xbe39('0x1c')](_0x55f5b5,_0x1cf6a0,_0x32010d,_0x27036d);}else{logger[_0xbe39('0xb')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x476d3e,_0x3c2b26['name']);_0x307c4a['stop']();}}}catch(_0x4a517e){console[_0xbe39('0x1d')](_0x4a517e);logger[_0xbe39('0xb')](_0xbe39('0x1e'),_0x476d3e,_0x4a517e['stack']);_0x307c4a[_0xbe39('0x18')]();}};}; \ No newline at end of file +var _0xe457=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xe457,0x1f3));var _0x7e45=function(_0x5a4591,_0x35918e){_0x5a4591=_0x5a4591-0x0;var _0x468efb=_0xe457[_0x5a4591];return _0x468efb;};'use strict';var schema=require(_0x7e45('0x0'));var _=require(_0x7e45('0x1'));var util=require('util');var seqqueue=require(_0x7e45('0x2'));var logger=require(_0x7e45('0x3'))(_0x7e45('0x4'));var strategy=require(_0x7e45('0x5'));var queue=schema({'name':{'type':_0x7e45('0x6'),'required':!![],'message':_0x7e45('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x44d833,_0x198e3f,_0x4ace4e){return logger[_0x7e45('0x8')](util[_0x7e45('0x9')](_0x7e45('0xa'),_0x44d833,_0x198e3f['name'],_0x4ace4e));}function handleFindAgent(_0x565115){return function(_0x43957b){return _0x43957b[_0x7e45('0xb')][_0x7e45('0xc')]()===_0x565115[_0x7e45('0xc')]();};}exports[_0x7e45('0xd')]=function(_0x58ac48,_0x5f2586,_0x390f7c,_0x3a751e){return function(_0x159b14){try{var _0x31a1ab={'name':_0x5f2586[0x0],'timeout':_0x5f2586[0x1]};var _0x4eaf78=queue[_0x7e45('0x0')](_0x31a1ab,{'typecast':!![]});if(_0x4eaf78[_0x7e45('0xe')]){logger[_0x7e45('0xf')](_0x7e45('0x10'),_0x58ac48,_['map'](_0x4eaf78,_0x7e45('0x11'))[_0x7e45('0x12')](',\x20'));_0x159b14[_0x7e45('0x13')]();}else{var _0x236151=_[_0x7e45('0x14')](_0x390f7c[_0x7e45('0x15')],handleFindAgent(_0x31a1ab[_0x7e45('0xb')]));if(_0x236151){var _0x5b5994=(_0x31a1ab[_0x7e45('0x16')]||0xa)*0x3e8;var _0x44a209,_0x56a73b;var _0x3a54bf=seqqueue[_0x7e45('0x17')](_0x5b5994);_0x3a54bf['id']=_0x58ac48;_0x3a54bf[_0x7e45('0x18')]=_0x5b5994;_0x3a54bf['channel']=_0x3a751e[_0x7e45('0x19')];writeLog(_0x58ac48,_0x236151,util[_0x7e45('0x9')]('START:%s',_0x5b5994));_0x390f7c['rules'][_0x58ac48]['on']('end',function(){logger[_0x7e45('0x8')](_0x7e45('0x1a'),_0x58ac48);clearTimeout(_0x56a73b);_0x56a73b=undefined;_0x3a54bf[_0x7e45('0x1b')]();if(_0x390f7c[_0x7e45('0x1c')][_0x58ac48]){delete _0x390f7c[_0x7e45('0x1c')][_0x58ac48];}_0x159b14[_0x7e45('0x13')]();});_0x390f7c[_0x7e45('0x1c')][_0x58ac48]['on']('complete',function(){if(_0x390f7c[_0x7e45('0x1c')][_0x58ac48]){delete _0x390f7c[_0x7e45('0x1c')][_0x58ac48];}});_0x56a73b=setTimeout(function(){logger[_0x7e45('0x8')](_0x7e45('0x1d'),_0x58ac48);clearTimeout(_0x56a73b);_0x3a54bf['close']();_0x159b14[_0x7e45('0x1e')]();},_0x5b5994);strategy[_0x7e45('0x1f')](_0x3a54bf,_0x236151,_0x390f7c,_0x3a751e);}else{logger[_0x7e45('0xf')](_0x7e45('0x20'),_0x58ac48,_0x31a1ab['name']);_0x159b14[_0x7e45('0x13')]();}}}catch(_0x3a2294){console[_0x7e45('0x21')](_0x3a2294);logger[_0x7e45('0xf')](_0x7e45('0x22'),_0x58ac48,_0x3a2294[_0x7e45('0x23')]);_0x159b14['stop']();}};}; \ 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 92ea084..90b625f 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 _0x86f0=['stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/whatsappMessage','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','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error'];(function(_0x56fb38,_0x5dcac3){var _0x194e10=function(_0x3ddedf){while(--_0x3ddedf){_0x56fb38['push'](_0x56fb38['shift']());}};_0x194e10(++_0x5dcac3);}(_0x86f0,0x120));var _0x086f=function(_0x1b28ca,_0x243586){_0x1b28ca=_0x1b28ca-0x0;var _0xfc7be4=_0x86f0[_0x1b28ca];return _0xfc7be4;};'use strict';var _=require(_0x086f('0x0'));var moment=require(_0x086f('0x1'));var AWS=require(_0x086f('0x2'));var utils=require('./utils');var logger=require(_0x086f('0x3'))(_0x086f('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x086f('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x086f('0x6'))};exports[_0x086f('0x7')]=function(_0x4f8c1b,_0x171d92){return function(_0x58bfe5){try{if(!_[_0x086f('0x8')](this[_0x086f('0x9')][_0x086f('0xa')])){logger[_0x086f('0xb')](_0x086f('0xc'),_0x4f8c1b,_0x086f('0xd'));return _0x58bfe5[_0x086f('0xe')]();}var _0x39b30a={'ContactId':this[_0x086f('0xf')]['id'],'sentAt':moment()[_0x086f('0x10')](_0x086f('0x11')),'direction':'out'};if(this[_0x086f('0x12')]===_0x086f('0x13')||this[_0x086f('0x12')]==='whatsapp'){_0x39b30a[_0x086f('0x14')]=this[_0x086f('0x9')][_0x086f('0x14')];}var _0x454ba2=this[_0x086f('0x12')];if(_0x454ba2===_0x086f('0x15')){_0x39b30a[_0x086f('0x16')]=this['account']['id'];}else{_0x39b30a[_[_0x086f('0x17')](_0x454ba2)+_0x086f('0x18')]=this['account']['id'];}_0x39b30a[_['upperFirst'](_0x454ba2)+'InteractionId']=this[_0x086f('0x9')]['id'];if(this[_0x086f('0x9')][_0x086f('0x19')]){var _0x113487=_0x171d92[0x4];if(!_[_0x086f('0x1a')](_0x113487)){_0x39b30a[_0x086f('0x1b')]=utils[_0x086f('0x1c')](_0x113487,this);return rpc[_0x454ba2+_0x086f('0x1d')][_0x086f('0x1e')](_0x39b30a)[_0x086f('0x1f')](function(_0x25740a){logger[_0x086f('0xb')](_0x086f('0xc'),_0x4f8c1b,_0x39b30a[_0x086f('0x1b')]);})[_0x086f('0x20')](function(_0x5a0d2b){logger[_0x086f('0x21')](_0x086f('0xc'),_0x4f8c1b,JSON[_0x086f('0x22')](_0x5a0d2b));})['finally'](function(){logger[_0x086f('0xb')](_0x086f('0x23'),_0x4f8c1b);_0x58bfe5[_0x086f('0x24')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4f8c1b);_0x58bfe5['stop']();}}else{var _0x597212=this;var _0x4510a4=new AWS[(_0x086f('0x25'))]({'accessKeyId':_0x171d92[0x0],'secretAccessKey':_0x171d92[0x1],'region':_0x171d92[0x2]});var _0x114199={'botAlias':_0x086f('0x26'),'botName':_0x171d92[0x3],'inputText':this[_0x086f('0x27')][_0x086f('0x1b')],'userId':this[_0x086f('0x12')]+':'+this['interaction']['id'][_0x086f('0x28')]()};_0x4510a4[_0x086f('0x29')](_0x114199,function(_0x37ca34,_0x489152){if(_0x37ca34){logger[_0x086f('0x21')]('[%s][AMAZONLEX]\x20%s',_0x4f8c1b,_0x37ca34[_0x086f('0x27')]);_0x58bfe5[_0x086f('0xe')]();}else if(_0x489152&&_0x489152[_0x086f('0x27')]){_0x597212[_0x086f('0x1b')]['amazonlex']=_0x489152;_0x39b30a[_0x086f('0x1b')]=_0x489152[_0x086f('0x27')];_0x39b30a[_0x086f('0x2a')]='amazonlex';_0x39b30a[_0x086f('0x2b')]=JSON[_0x086f('0x22')](_0x489152);return rpc[_0x454ba2+_0x086f('0x1d')][_0x086f('0x1e')](_0x39b30a)[_0x086f('0x1f')](function(_0x1523f5){logger[_0x086f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x4f8c1b,_0x39b30a[_0x086f('0x1b')]);if(_0x489152[_0x086f('0x2c')]==_0x086f('0x2d')){_0x58bfe5[_0x086f('0xe')]();}else{_0x58bfe5[_0x086f('0x24')]();}})[_0x086f('0x20')](function(_0x5da713){logger[_0x086f('0x21')](_0x086f('0xc'),_0x4f8c1b,JSON[_0x086f('0x22')](_0x5da713));_0x58bfe5[_0x086f('0xe')]();});}else{_0x58bfe5[_0x086f('0xe')]();}});}}catch(_0x5e94e4){logger[_0x086f('0x21')]('[%s][AMAZONLEX]\x20%s',_0x4f8c1b,JSON[_0x086f('0x22')](_0x5e94e4));_0x58bfe5[_0x086f('0x24')]();}};}; \ No newline at end of file +var _0x6cf4=['../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','toString','postText','next','amazonlex','providerName','providerResponse','Message','Failed','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage'];(function(_0x33deb7,_0x25181a){var _0x3dfeeb=function(_0x310393){while(--_0x310393){_0x33deb7['push'](_0x33deb7['shift']());}};_0x3dfeeb(++_0x25181a);}(_0x6cf4,0xad));var _0x46cf=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x6cf4[_0x4206f5];return _0xa29cf3;};'use strict';var _=require(_0x46cf('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x46cf('0x1'));var logger=require(_0x46cf('0x2'))(_0x46cf('0x3'));var rpc={'chatMessage':require(_0x46cf('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x46cf('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x46cf('0x6')),'whatsappMessage':require(_0x46cf('0x7'))};exports['consequence']=function(_0x3641ae,_0x4b52cb){return function(_0x567695){try{if(!_[_0x46cf('0x8')](this[_0x46cf('0x9')][_0x46cf('0xa')])){logger[_0x46cf('0xb')](_0x46cf('0xc'),_0x3641ae,_0x46cf('0xd'));return _0x567695['next']();}var _0x8b10e8={'ContactId':this[_0x46cf('0xe')]['id'],'sentAt':moment()['format'](_0x46cf('0xf')),'direction':'out'};if(this['channel']==='sms'||this[_0x46cf('0x10')]==='whatsapp'){_0x8b10e8['phone']=this['interaction'][_0x46cf('0x11')];}var _0x5ba067=this[_0x46cf('0x10')];if(_0x5ba067==='chat'){_0x8b10e8[_0x46cf('0x12')]=this[_0x46cf('0x13')]['id'];}else{_0x8b10e8[_[_0x46cf('0x14')](_0x5ba067)+_0x46cf('0x15')]=this['account']['id'];}_0x8b10e8[_[_0x46cf('0x14')](_0x5ba067)+_0x46cf('0x16')]=this[_0x46cf('0x9')]['id'];if(this[_0x46cf('0x9')][_0x46cf('0x17')]){var _0x136edc=_0x4b52cb[0x4];if(!_[_0x46cf('0x18')](_0x136edc)){_0x8b10e8['body']=utils['getMustacheRender'](_0x136edc,this);return rpc[_0x5ba067+'Message']['create'](_0x8b10e8)[_0x46cf('0x19')](function(_0x767ae3){logger[_0x46cf('0xb')](_0x46cf('0xc'),_0x3641ae,_0x8b10e8['body']);})[_0x46cf('0x1a')](function(_0x491b88){logger[_0x46cf('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x3641ae,JSON[_0x46cf('0x1c')](_0x491b88));})[_0x46cf('0x1d')](function(){logger['info'](_0x46cf('0x1e'),_0x3641ae);_0x567695['stop']();});}else{logger[_0x46cf('0xb')](_0x46cf('0x1f'),_0x3641ae);_0x567695[_0x46cf('0x20')]();}}else{var _0x5eeb12=this;var _0x4adae5=new AWS[(_0x46cf('0x21'))]({'accessKeyId':_0x4b52cb[0x0],'secretAccessKey':_0x4b52cb[0x1],'region':_0x4b52cb[0x2]});var _0x3e31ba={'botAlias':_0x46cf('0x22'),'botName':_0x4b52cb[0x3],'inputText':this[_0x46cf('0x23')][_0x46cf('0x24')],'userId':this[_0x46cf('0x10')]+':'+this[_0x46cf('0x9')]['id'][_0x46cf('0x25')]()};_0x4adae5[_0x46cf('0x26')](_0x3e31ba,function(_0x3aa449,_0x42f987){if(_0x3aa449){logger[_0x46cf('0x1b')](_0x46cf('0xc'),_0x3641ae,_0x3aa449[_0x46cf('0x23')]);_0x567695[_0x46cf('0x27')]();}else if(_0x42f987&&_0x42f987[_0x46cf('0x23')]){_0x5eeb12[_0x46cf('0x24')][_0x46cf('0x28')]=_0x42f987;_0x8b10e8[_0x46cf('0x24')]=_0x42f987[_0x46cf('0x23')];_0x8b10e8[_0x46cf('0x29')]=_0x46cf('0x28');_0x8b10e8[_0x46cf('0x2a')]=JSON['stringify'](_0x42f987);return rpc[_0x5ba067+_0x46cf('0x2b')]['create'](_0x8b10e8)[_0x46cf('0x19')](function(_0x1fe595){logger[_0x46cf('0xb')](_0x46cf('0xc'),_0x3641ae,_0x8b10e8[_0x46cf('0x24')]);if(_0x42f987['dialogState']==_0x46cf('0x2c')){_0x567695[_0x46cf('0x27')]();}else{_0x567695[_0x46cf('0x20')]();}})[_0x46cf('0x1a')](function(_0xe395b0){logger[_0x46cf('0x1b')](_0x46cf('0xc'),_0x3641ae,JSON[_0x46cf('0x1c')](_0xe395b0));_0x567695[_0x46cf('0x27')]();});}else{_0x567695[_0x46cf('0x27')]();}});}}catch(_0x341ec3){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3641ae,JSON[_0x46cf('0x1c')](_0x341ec3));_0x567695['stop']();}};}; \ 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 dbc5fc9..d9c8cb2 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 _0xd0e0=['YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','message','phone','read','subject','ChatWebsiteId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','messageId','','','headers','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact'];(function(_0xb60ae4,_0x48b458){var _0x53d530=function(_0x5c0743){while(--_0x5c0743){_0xb60ae4['push'](_0xb60ae4['shift']());}};_0x53d530(++_0x48b458);}(_0xd0e0,0x6a));var _0x0d0e=function(_0x1eabb8,_0x138c70){_0x1eabb8=_0x1eabb8-0x0;var _0x39886f=_0xd0e0[_0x1eabb8];return _0x39886f;};'use strict';var _=require(_0x0d0e('0x0'));var moment=require(_0x0d0e('0x1'));var utils=require(_0x0d0e('0x2'));var logger=require(_0x0d0e('0x3'))(_0x0d0e('0x4'));var rpc={'chatMessage':require(_0x0d0e('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0d0e('0x6')),'faxMessage':require(_0x0d0e('0x7')),'whatsappMessage':require(_0x0d0e('0x8')),'chatInteraction':require(_0x0d0e('0x9')),'openchannelInteraction':require(_0x0d0e('0xa')),'mailInteraction':require(_0x0d0e('0xb')),'smsInteraction':require(_0x0d0e('0xc')),'faxInteraction':require(_0x0d0e('0xd')),'whatsappInteraction':require(_0x0d0e('0xe'))};var mailRpc=require(_0x0d0e('0xf'));exports[_0x0d0e('0x10')]=function(_0x354375,_0x112823,_0x284e72,_0x6c09d6){return function(_0x2cf08e){try{var _0x5f2288=this['channel'];if(_0x5f2288===_0x0d0e('0x11')&&_0x6c09d6[_0x0d0e('0x12')][_0x0d0e('0x13')]){logger[_0x0d0e('0x14')]('[%s][AUTOREPLY]\x20%s',_0x354375,_0x0d0e('0x15'));return _0x2cf08e[_0x0d0e('0x16')]();}if(_0x112823[0x0]==='1'&&(_[_0x0d0e('0x17')](this[_0x0d0e('0x18')]['created'])||!this[_0x0d0e('0x18')][_0x0d0e('0x19')])){logger[_0x0d0e('0x14')](_0x0d0e('0x1a'),_0x354375,_0x0d0e('0x1b'));return _0x2cf08e[_0x0d0e('0x16')]();}if(_0x112823[0x0]==='2'&&this['interaction'][_0x0d0e('0x1c')]){logger[_0x0d0e('0x14')](_0x0d0e('0x1d'),_0x354375,_0x0d0e('0x1e'));return _0x2cf08e['next']();}var _0x242c1f={'ContactId':this[_0x0d0e('0x1f')]['id'],'sentAt':moment()['format'](_0x0d0e('0x20')),'direction':'out'};if(this[_0x0d0e('0x21')]===_0x0d0e('0x11')){_0x242c1f[_0x0d0e('0x12')]=utils[_0x0d0e('0x22')](_0x112823[0x2],this);}else{_0x242c1f['body']=utils[_0x0d0e('0x22')](_0x112823[0x1],this);}if(this[_0x0d0e('0x23')]){_0x242c1f['to']=this[_0x0d0e('0x23')]['from']||'';if(this[_0x0d0e('0x21')]===_0x0d0e('0x11')&&_0x112823[0x1]==='1'){_0x242c1f['cc']=this[_0x0d0e('0x23')]['cc']||'';}_0x242c1f['from']=this[_0x0d0e('0x23')]['to']||'';_0x242c1f[_0x0d0e('0x24')]=this[_0x0d0e('0x23')]['phone']||'';_0x242c1f[_0x0d0e('0x25')]=!![];if(this[_0x0d0e('0x23')][_0x0d0e('0x26')]){_0x242c1f[_0x0d0e('0x26')]='';_0x242c1f[_0x0d0e('0x26')]+=_['startsWith'](this[_0x0d0e('0x23')][_0x0d0e('0x26')],'Re:')?'':'Re:\x20';_0x242c1f[_0x0d0e('0x26')]+=this[_0x0d0e('0x23')]['subject'];}}if(this[_0x0d0e('0x21')]==='chat'){_0x242c1f[_0x0d0e('0x27')]=this[_0x0d0e('0x28')]['id'];}else{_0x242c1f[_['upperFirst'](this[_0x0d0e('0x21')])+'AccountId']=this[_0x0d0e('0x28')]['id'];}_0x242c1f[_[_0x0d0e('0x29')](this[_0x0d0e('0x21')])+_0x0d0e('0x2a')]=this['interaction']['id'];var _0x38f0df=this[_0x0d0e('0x18')];if(rpc[this['channel']+_0x0d0e('0x2b')]){if(this['channel']===_0x0d0e('0x11')){var _0x1b39fc={'tls':{'rejectUnauthorized':![]}};if(this[_0x0d0e('0x28')][_0x0d0e('0x2c')][_0x0d0e('0x2d')]){_0x1b39fc[_0x0d0e('0x2d')]=this[_0x0d0e('0x28')][_0x0d0e('0x2c')][_0x0d0e('0x2d')];}else{_0x1b39fc['host']=this['account']['Smtp'][_0x0d0e('0x2e')];_0x1b39fc[_0x0d0e('0x2f')]=this[_0x0d0e('0x28')]['Smtp'][_0x0d0e('0x2f')];_0x1b39fc[_0x0d0e('0x30')]=this[_0x0d0e('0x28')][_0x0d0e('0x2c')]['secure'];}if(this[_0x0d0e('0x28')]['Smtp']['authentication']){_0x1b39fc['auth']={'user':this[_0x0d0e('0x28')]['Smtp']['user'],'pass':this['account'][_0x0d0e('0x2c')]['pass']};}_0x242c1f['inReplyTo']=this['message'][_0x0d0e('0x31')];_0x242c1f['html']=_0x0d0e('0x32')+_['replace'](_0x242c1f[_0x0d0e('0x12')],'','replace','','headers','auto-replied','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x3260c9,_0x1d276f){var _0x16864c=function(_0xb1ff51){while(--_0xb1ff51){_0x3260c9['push'](_0x3260c9['shift']());}};_0x16864c(++_0x1d276f);}(_0x14d4,0x1b6));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x414d('0x0'));var moment=require(_0x414d('0x1'));var utils=require(_0x414d('0x2'));var logger=require(_0x414d('0x3'))(_0x414d('0x4'));var rpc={'chatMessage':require(_0x414d('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x414d('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x414d('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x414d('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x414d('0x9')),'smsInteraction':require(_0x414d('0xa')),'faxInteraction':require(_0x414d('0xb')),'whatsappInteraction':require(_0x414d('0xc'))};var mailRpc=require('../../mailRpc');exports[_0x414d('0xd')]=function(_0x2a9eec,_0x413fa6,_0x2c9555,_0x4b8689){return function(_0x5b0bec){try{var _0x51ac22=this['channel'];if(_0x51ac22===_0x414d('0xe')&&_0x4b8689[_0x414d('0xf')]['isAutoreply']){logger[_0x414d('0x10')](_0x414d('0x11'),_0x2a9eec,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x5b0bec[_0x414d('0x12')]();}if(_0x413fa6[0x0]==='1'&&(_[_0x414d('0x13')](this[_0x414d('0x14')][_0x414d('0x15')])||!this[_0x414d('0x14')][_0x414d('0x15')])){logger['info'](_0x414d('0x11'),_0x2a9eec,_0x414d('0x16'));return _0x5b0bec[_0x414d('0x12')]();}if(_0x413fa6[0x0]==='2'&&this[_0x414d('0x14')]['autoreplyExecuted']){logger['info'](_0x414d('0x17'),_0x2a9eec,_0x414d('0x18'));return _0x5b0bec[_0x414d('0x12')]();}var _0x47e2d6={'ContactId':this[_0x414d('0x19')]['id'],'sentAt':moment()[_0x414d('0x1a')](_0x414d('0x1b')),'direction':_0x414d('0x1c')};if(this['channel']==='mail'){_0x47e2d6['body']=utils['getMustacheRender'](_0x413fa6[0x2],this);}else{_0x47e2d6['body']=utils[_0x414d('0x1d')](_0x413fa6[0x1],this);}if(this['message']){_0x47e2d6['to']=this[_0x414d('0x1e')]['from']||'';if(this[_0x414d('0x1f')]===_0x414d('0xe')&&_0x413fa6[0x1]==='1'){_0x47e2d6['cc']=this['message']['cc']||'';}_0x47e2d6[_0x414d('0x20')]=this[_0x414d('0x1e')]['to']||'';_0x47e2d6['phone']=this[_0x414d('0x1e')]['phone']||'';_0x47e2d6[_0x414d('0x21')]=!![];if(this[_0x414d('0x1e')]['subject']){_0x47e2d6[_0x414d('0x22')]='';_0x47e2d6['subject']+=_[_0x414d('0x23')](this[_0x414d('0x1e')][_0x414d('0x22')],'Re:')?'':_0x414d('0x24');_0x47e2d6[_0x414d('0x22')]+=this[_0x414d('0x1e')]['subject'];}}if(this[_0x414d('0x1f')]===_0x414d('0x25')){_0x47e2d6[_0x414d('0x26')]=this['account']['id'];}else{_0x47e2d6[_[_0x414d('0x27')](this[_0x414d('0x1f')])+'AccountId']=this['account']['id'];}_0x47e2d6[_[_0x414d('0x27')](this[_0x414d('0x1f')])+_0x414d('0x28')]=this[_0x414d('0x14')]['id'];var _0x2aafc1=this['interaction'];if(rpc[this[_0x414d('0x1f')]+_0x414d('0x29')]){if(this[_0x414d('0x1f')]===_0x414d('0xe')){var _0x44c5df={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp'][_0x414d('0x2a')]){_0x44c5df[_0x414d('0x2a')]=this['account'][_0x414d('0x2b')][_0x414d('0x2a')];}else{_0x44c5df[_0x414d('0x2c')]=this[_0x414d('0x2d')][_0x414d('0x2b')][_0x414d('0x2c')];_0x44c5df[_0x414d('0x2e')]=this['account'][_0x414d('0x2b')][_0x414d('0x2e')];_0x44c5df[_0x414d('0x2f')]=this[_0x414d('0x2d')][_0x414d('0x2b')]['secure'];}if(this[_0x414d('0x2d')][_0x414d('0x2b')][_0x414d('0x30')]){_0x44c5df[_0x414d('0x31')]={'user':this['account'][_0x414d('0x2b')][_0x414d('0x32')],'pass':this['account'][_0x414d('0x2b')]['pass']};}_0x47e2d6['inReplyTo']=this['message']['messageId'];_0x47e2d6['html']=_0x414d('0x33')+_[_0x414d('0x34')](_0x47e2d6[_0x414d('0xf')],']+(>|$)/g,''),'priorityTrue':_0x3c9a07[0x1],'priorityFalse':_0x3c9a07[0x2]};var _0x3a59ae=gotoif[_0x00be('0x0')](_0x302d8e,{'typecast':!![]});if(_0x3a59ae[_0x00be('0xa')]){logger['error']('[%s][GOTOIF]\x20%s',_0xaac17e,_[_0x00be('0xb')](_0x3a59ae,_0x00be('0xc'))[_0x00be('0xd')](',\x20'));_0x52c679[_0x00be('0xe')]();}else{try{var _0x4d1e1e=eval('('+_0x302d8e[_0x00be('0xf')]+')');var _0x26884a=_0x4d1e1e?_0x302d8e[_0x00be('0x10')]:_0x302d8e[_0x00be('0x11')];logger[_0x00be('0x12')](_0x00be('0x13'),_0xaac17e,_0x302d8e[_0x00be('0xf')],_0x4d1e1e,_0x26884a||_0x00be('0x14'));if(_0x26884a){var _0x236578=_[_0x00be('0x15')](_0x52c679[_0x00be('0x16')](),{'p':_0x26884a});if(_0x236578>=0x0){logger[_0x00be('0x12')](_0x00be('0x17'),_0xaac17e,_0x26884a||'next',_0x236578);_0x52c679[_0x00be('0x14')](_0x236578);}else{logger[_0x00be('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0xaac17e,_0x26884a||_0x00be('0x14'));_0x52c679['stop']();}}else{_0x52c679[_0x00be('0x14')]();}}catch(_0x45e3ca){logger[_0x00be('0x18')](_0x00be('0x19'),_0xaac17e,_0x45e3ca[_0x00be('0xc')]);_0x52c679['stop']();}}}catch(_0x42dc78){logger[_0x00be('0x18')](_0x00be('0x1a'),_0xaac17e,JSON[_0x00be('0x1b')](_0x42dc78));_0x52c679[_0x00be('0xe')]();}};}; \ No newline at end of file +var _0xf047=['error','map','message','stop','priorityTrue','priorityFalse','info','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','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','fromString','getMustacheRender','replace','length'];(function(_0x1e0e43,_0x3da4ec){var _0x4b3e99=function(_0x303afb){while(--_0x303afb){_0x1e0e43['push'](_0x1e0e43['shift']());}};_0x4b3e99(++_0x3da4ec);}(_0xf047,0x183));var _0x7f04=function(_0xeef081,_0x410eb3){_0xeef081=_0xeef081-0x0;var _0x5739e0=_0xf047[_0xeef081];return _0x5739e0;};'use strict';var schema=require(_0x7f04('0x0'));var _=require(_0x7f04('0x1'));var htmlToText=require(_0x7f04('0x2'));var utils=require(_0x7f04('0x3'));var logger=require(_0x7f04('0x4'))(_0x7f04('0x5'));var gotoif=schema({'condition':{'type':_0x7f04('0x6'),'required':!![],'message':_0x7f04('0x7')},'priorityTrue':{'type':_0x7f04('0x8'),'message':_0x7f04('0x9')},'priorityFalse':{'type':'number','message':_0x7f04('0xa')}});exports[_0x7f04('0xb')]=function(_0x27b628,_0x334b58){return function(_0x1a917e){try{var _0x51850a={'condition':htmlToText[_0x7f04('0xc')](utils[_0x7f04('0xd')](_0x334b58[0x0],this),{'wordwrap':![]})[_0x7f04('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x334b58[0x1],'priorityFalse':_0x334b58[0x2]};var _0x242024=gotoif['validate'](_0x51850a,{'typecast':!![]});if(_0x242024[_0x7f04('0xf')]){logger[_0x7f04('0x10')]('[%s][GOTOIF]\x20%s',_0x27b628,_[_0x7f04('0x11')](_0x242024,_0x7f04('0x12'))['join'](',\x20'));_0x1a917e[_0x7f04('0x13')]();}else{try{var _0x31d66c=eval('('+_0x51850a['condition']+')');var _0x590424=_0x31d66c?_0x51850a[_0x7f04('0x14')]:_0x51850a[_0x7f04('0x15')];logger[_0x7f04('0x16')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x27b628,_0x51850a[_0x7f04('0x17')],_0x31d66c,_0x590424||'next');if(_0x590424){var _0x379f07=_[_0x7f04('0x18')](_0x1a917e[_0x7f04('0x19')](),{'p':_0x590424});if(_0x379f07>=0x0){logger[_0x7f04('0x16')](_0x7f04('0x1a'),_0x27b628,_0x590424||_0x7f04('0x1b'),_0x379f07);_0x1a917e[_0x7f04('0x1b')](_0x379f07);}else{logger[_0x7f04('0x16')](_0x7f04('0x1c'),_0x27b628,_0x590424||_0x7f04('0x1b'));_0x1a917e[_0x7f04('0x13')]();}}else{_0x1a917e['next']();}}catch(_0x2611dc){logger[_0x7f04('0x10')](_0x7f04('0x1d'),_0x27b628,_0x2611dc[_0x7f04('0x12')]);_0x1a917e[_0x7f04('0x13')]();}}}catch(_0x438b9c){logger[_0x7f04('0x10')]('[%s][GOTOIF]\x20%s',_0x27b628,JSON[_0x7f04('0x1e')](_0x438b9c));_0x1a917e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index dfadbd1..540be3c 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 _0xa732=['stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join'];(function(_0xe94897,_0x4990c2){var _0xb5c2bd=function(_0x1e9c1d){while(--_0x1e9c1d){_0xe94897['push'](_0xe94897['shift']());}};_0xb5c2bd(++_0x4990c2);}(_0xa732,0x199));var _0x2a73=function(_0x48a6a9,_0x2040d2){_0x48a6a9=_0x48a6a9-0x0;var _0x1e0876=_0xa732[_0x48a6a9];return _0x1e0876;};'use strict';var schema=require(_0x2a73('0x0'));var _=require(_0x2a73('0x1'));var logger=require(_0x2a73('0x2'))(_0x2a73('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x2a73('0x4')}});exports[_0x2a73('0x5')]=function(_0x249d40,_0x30eac4){return function(_0x11f4b3){try{var _0x4cd8d1={'priority':_0x30eac4[0x0]};var _0x5527fd=gotop[_0x2a73('0x0')](_0x4cd8d1,{'typecast':!![]});if(_0x5527fd[_0x2a73('0x6')]){logger['error'](_0x2a73('0x7'),_0x249d40,_[_0x2a73('0x8')](_0x5527fd,_0x2a73('0x9'))[_0x2a73('0xa')](',\x20'));_0x11f4b3[_0x2a73('0xb')]();}else{logger['info'](_0x2a73('0xc'),_0x249d40,_0x4cd8d1['priority']);if(_0x4cd8d1[_0x2a73('0xd')]){var _0x524a3b=_['findIndex'](_0x11f4b3[_0x2a73('0xe')](),{'p':_0x4cd8d1['priority']});if(_0x524a3b>=0x0){logger[_0x2a73('0xf')](_0x2a73('0x10'),_0x249d40,_0x4cd8d1['priority']||_0x2a73('0x11'),_0x524a3b);_0x11f4b3['next'](_0x524a3b);}else{logger[_0x2a73('0xf')](_0x2a73('0x12'),_0x249d40,_0x4cd8d1[_0x2a73('0xd')]||'next');_0x11f4b3['stop']();}}else{_0x11f4b3[_0x2a73('0x11')]();}}}catch(_0x274549){logger['error'](_0x2a73('0x7'),_0x249d40,JSON[_0x2a73('0x13')](_0x274549));_0x11f4b3[_0x2a73('0xb')]();}};}; \ No newline at end of file +var _0x7789=['stringify','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7789,0x79));var _0x9778=function(_0x18c870,_0x490d74){_0x18c870=_0x18c870-0x0;var _0x699697=_0x7789[_0x18c870];return _0x699697;};'use strict';var schema=require('validate');var _=require(_0x9778('0x0'));var logger=require(_0x9778('0x1'))('routing');var gotop=schema({'priority':{'type':_0x9778('0x2'),'required':!![],'message':_0x9778('0x3')}});exports[_0x9778('0x4')]=function(_0x4fa6ef,_0x5cfa33){return function(_0x47aeb2){try{var _0x1f33c2={'priority':_0x5cfa33[0x0]};var _0x250e13=gotop[_0x9778('0x5')](_0x1f33c2,{'typecast':!![]});if(_0x250e13[_0x9778('0x6')]){logger[_0x9778('0x7')](_0x9778('0x8'),_0x4fa6ef,_['map'](_0x250e13,_0x9778('0x9'))[_0x9778('0xa')](',\x20'));_0x47aeb2[_0x9778('0xb')]();}else{logger[_0x9778('0xc')](_0x9778('0xd'),_0x4fa6ef,_0x1f33c2[_0x9778('0xe')]);if(_0x1f33c2[_0x9778('0xe')]){var _0x4f3d1e=_['findIndex'](_0x47aeb2[_0x9778('0xf')](),{'p':_0x1f33c2[_0x9778('0xe')]});if(_0x4f3d1e>=0x0){logger[_0x9778('0xc')](_0x9778('0x10'),_0x4fa6ef,_0x1f33c2[_0x9778('0xe')]||'next',_0x4f3d1e);_0x47aeb2[_0x9778('0x11')](_0x4f3d1e);}else{logger[_0x9778('0xc')](_0x9778('0x12'),_0x4fa6ef,_0x1f33c2['priority']||_0x9778('0x11'));_0x47aeb2['stop']();}}else{_0x47aeb2[_0x9778('0x11')]();}}}catch(_0x38d914){logger[_0x9778('0x7')]('[%s][GOTOP]\x20%s',_0x4fa6ef,JSON[_0x9778('0x13')](_0x38d914));_0x47aeb2[_0x9778('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 31353cf..0fe2391 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 _0x2e21=['contact','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x2e21,0xba));var _0x12e2=function(_0x283ae8,_0x45b0a4){_0x283ae8=_0x283ae8-0x0;var _0x299f4a=_0x2e21[_0x283ae8];return _0x299f4a;};'use strict';var _=require(_0x12e2('0x0'));var utils=require(_0x12e2('0x1'));var logger=require(_0x12e2('0x2'))('routing');var rpc={'chatMessage':require(_0x12e2('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x12e2('0x4')),'smsMessage':require(_0x12e2('0x5')),'faxMessage':require(_0x12e2('0x6')),'whatsappMessage':require(_0x12e2('0x7'))};exports[_0x12e2('0x8')]=function(_0x46287a,_0x1f4783){return function(_0x1227dc){try{var _0x2f52d6={'body':utils[_0x12e2('0x9')](_0x1f4783[0x0],this),'ContactId':this[_0x12e2('0xa')]['id']};if(this[_0x12e2('0xb')]==='chat'){_0x2f52d6[_0x12e2('0xc')]=this['account']['id'];}else{_0x2f52d6[_[_0x12e2('0xd')](this['channel'])+_0x12e2('0xe')]=this[_0x12e2('0xf')]['id'];}_0x2f52d6[_[_0x12e2('0xd')](this['channel'])+_0x12e2('0x10')]=this[_0x12e2('0x11')]['id'];if(rpc[this['channel']+_0x12e2('0x12')]){return rpc[this['channel']+_0x12e2('0x12')]['create'](_0x2f52d6)[_0x12e2('0x13')](function(_0x25edc8){logger[_0x12e2('0x14')](_0x12e2('0x15'),_0x46287a,_0x2f52d6[_0x12e2('0x16')]);_0x1227dc[_0x12e2('0x17')]();})[_0x12e2('0x18')](function(_0x3b936e){logger[_0x12e2('0x19')]('[%s][MESSAGE]\x20%s',_0x46287a,JSON[_0x12e2('0x1a')](_0x3b936e));_0x1227dc[_0x12e2('0x1b')]();});}}catch(_0x44b3e0){logger[_0x12e2('0x19')](_0x12e2('0x15'),_0x46287a,JSON[_0x12e2('0x1a')](_0x44b3e0));_0x1227dc[_0x12e2('0x1b')]();}};}; \ No newline at end of file +var _0x0be2=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','stringify','stop','../../../../config/logger'];(function(_0x1c0a4d,_0x3352ff){var _0x1be67a=function(_0x2e5c53){while(--_0x2e5c53){_0x1c0a4d['push'](_0x1c0a4d['shift']());}};_0x1be67a(++_0x3352ff);}(_0x0be2,0x8f));var _0x20be=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0be2[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x20be('0x0'))(_0x20be('0x1'));var rpc={'chatMessage':require(_0x20be('0x2')),'openchannelMessage':require(_0x20be('0x3')),'mailMessage':require(_0x20be('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x20be('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x20be('0x6')]=function(_0x1479a2,_0x14f8c2){return function(_0x2c5262){try{var _0x494951={'body':utils[_0x20be('0x7')](_0x14f8c2[0x0],this),'ContactId':this[_0x20be('0x8')]['id']};if(this[_0x20be('0x9')]===_0x20be('0xa')){_0x494951['ChatWebsiteId']=this[_0x20be('0xb')]['id'];}else{_0x494951[_[_0x20be('0xc')](this['channel'])+_0x20be('0xd')]=this['account']['id'];}_0x494951[_[_0x20be('0xc')](this[_0x20be('0x9')])+_0x20be('0xe')]=this[_0x20be('0xf')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x20be('0x9')]+_0x20be('0x10')][_0x20be('0x11')](_0x494951)['then'](function(_0x3f1022){logger[_0x20be('0x12')](_0x20be('0x13'),_0x1479a2,_0x494951[_0x20be('0x14')]);_0x2c5262[_0x20be('0x15')]();})['catch'](function(_0x87210b){logger['error'](_0x20be('0x13'),_0x1479a2,JSON[_0x20be('0x16')](_0x87210b));_0x2c5262[_0x20be('0x17')]();});}}catch(_0x499c28){logger['error']('[%s][MESSAGE]\x20%s',_0x1479a2,JSON[_0x20be('0x16')](_0x499c28));_0x2c5262[_0x20be('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index aff646f..bc8c51b 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 _0x5e51=['stringify','stop','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x16e587,_0x2bc7a8){var _0x299924=function(_0x5c0a71){while(--_0x5c0a71){_0x16e587['push'](_0x16e587['shift']());}};_0x299924(++_0x2bc7a8);}(_0x5e51,0x1a0));var _0x15e5=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0x5e51[_0x4ce15c];return _0x5ee259;};'use strict';var utils=require('./utils');var logger=require(_0x15e5('0x0'))('routing');exports['consequence']=function(_0x452605,_0x49ebfc){return function(_0x30e781){try{logger[_0x15e5('0x1')](_0x15e5('0x2'),_0x452605,utils[_0x15e5('0x3')](_0x49ebfc[0x0],this));_0x30e781['next']();}catch(_0x36574c){logger['error']('[%s][NOOP]\x20%s',_0x452605,JSON[_0x15e5('0x4')](_0x36574c));_0x30e781[_0x15e5('0x5')]();}};}; \ No newline at end of file +var _0xa8e4=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x4023bf,_0x4a1c20){var _0x3d9130=function(_0x47e588){while(--_0x47e588){_0x4023bf['push'](_0x4023bf['shift']());}};_0x3d9130(++_0x4a1c20);}(_0xa8e4,0xa5));var _0x4a8e=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xa8e4[_0xc0a3d3];return _0x3386e8;};'use strict';var utils=require(_0x4a8e('0x0'));var logger=require(_0x4a8e('0x1'))(_0x4a8e('0x2'));exports[_0x4a8e('0x3')]=function(_0x35fabd,_0x956a30){return function(_0xfbbd50){try{logger[_0x4a8e('0x4')](_0x4a8e('0x5'),_0x35fabd,utils[_0x4a8e('0x6')](_0x956a30[0x0],this));_0xfbbd50[_0x4a8e('0x7')]();}catch(_0x3d34d7){logger[_0x4a8e('0x8')](_0x4a8e('0x5'),_0x35fabd,JSON[_0x4a8e('0x9')](_0x3d34d7));_0xfbbd50['stop']();}};}; \ 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 141905b..0aa7172 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 _0x599b=['account','queue','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','InteractionId','interaction','MessageId','message','upperFirst','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','info','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id'];(function(_0x2de8af,_0x17580f){var _0x48f9f9=function(_0x5eba42){while(--_0x5eba42){_0x2de8af['push'](_0x2de8af['shift']());}};_0x48f9f9(++_0x17580f);}(_0x599b,0x13c));var _0xb599=function(_0x2d092b,_0x44bf51){_0x2d092b=_0x2d092b-0x0;var _0x365b5d=_0x599b[_0x2d092b];return _0x365b5d;};'use strict';var schema=require(_0xb599('0x0'));var _=require(_0xb599('0x1'));var util=require('util');var seqqueue=require(_0xb599('0x2'));var moment=require(_0xb599('0x3'));var Redis=require(_0xb599('0x4'));var config=require(_0xb599('0x5'));var logger=require(_0xb599('0x6'))(_0xb599('0x7'));var strategy=require('./strategy');config[_0xb599('0x8')]=_[_0xb599('0x9')](config[_0xb599('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb599('0xa'))(new Redis(config[_0xb599('0x8')]));var attributes=['id',_0xb599('0xb'),_0xb599('0xc'),_0xb599('0xd'),'from',_0xb599('0xe')];function emit(_0x3747dd,_0x5263cf,_0x706f8d){io['to'](_0x3747dd)[_0xb599('0xf')](_0x5263cf,_0x706f8d);}function emitChannelQueueInteraction(_0x3a0be6,_0x3bfe49,_0x547548,_0x410393,_0x404c24,_0x347027,_0x129157,_0x5b546b){var _0x2802a0=_[_0xb599('0x10')](_0x547548);_0x2802a0[_0xb599('0xb')]=_0x5b546b;_0x2802a0[_0xb599('0xd')]=_0x3bfe49;_0x2802a0['account']=_0x410393;_0x2802a0['id']=_0x404c24;if(_0x347027){_0x129157[util[_0xb599('0x11')](_0xb599('0x12'),_0x3a0be6)][_0x404c24]=_[_0xb599('0x13')](_0x2802a0,attributes);}else{delete _0x129157[util[_0xb599('0x11')]('%sQueuesWaitingInteractions',_0x3a0be6)][_0x404c24];}emit(util[_0xb599('0x11')](_0xb599('0x14'),_0x3a0be6,_0x3bfe49),util[_0xb599('0x11')](_0xb599('0x15'),_0x3a0be6,_0x347027?_0xb599('0x16'):_0xb599('0x17')),_[_0xb599('0x13')](_0x2802a0,attributes));}var rpc={'openchannelQueueReport':require(_0xb599('0x18')),'mailQueueReport':require(_0xb599('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xb599('0x1a')),'faxQueueReport':require(_0xb599('0x1b')),'whatsappQueueReport':require(_0xb599('0x1c'))};var queue=schema({'name':{'type':_0xb599('0x1d'),'required':!![],'message':_0xb599('0x1e')},'timeout':{'type':'number','message':_0xb599('0x1f')}});function startRouting(_0x7ce926,_0x4693f8,_0x5a4214,_0x185e15){if(_0x7ce926&&_0x4693f8&&_0x5a4214){_0x4693f8['waiting']+=0x1;var _0x1ab78d={'uniqueid':_0x7ce926,'from':_0x5a4214[_0xb599('0x20')]?_0x5a4214['body'][_0xb599('0x21')]:'','joinAt':moment()[_0xb599('0x11')](_0xb599('0x22')),'ContactId':_0x5a4214[_0xb599('0x23')]?_0x5a4214[_0xb599('0x23')]['id']:null,'ListId':_0x5a4214[_0xb599('0x24')]?_0x5a4214[_0xb599('0x24')]['id']:null};_0x1ab78d[_['upperFirst'](_0x5a4214[_0xb599('0x25')])+_0xb599('0x26')]=_0x4693f8['id']||null;_0x1ab78d[_['upperFirst'](_0x5a4214[_0xb599('0x25')])+_0xb599('0x27')]=_0x5a4214['interaction']?_0x5a4214[_0xb599('0x28')]['id']:null;_0x1ab78d[_['upperFirst'](_0x5a4214['channel'])+_0xb599('0x29')]=_0x5a4214[_0xb599('0x2a')]?_0x5a4214[_0xb599('0x2a')]['id']:null;_0x1ab78d[_[_0xb599('0x2b')](_0x5a4214[_0xb599('0x25')])+(_0x5a4214[_0xb599('0x25')]!==_0xb599('0x2c')?_0xb599('0x2d'):_0xb599('0x2e'))]=_0x5a4214[_0xb599('0xc')]?_0x5a4214['account']['id']:null;logger['info'](util[_0xb599('0x11')](_0xb599('0x2f'),_0x7ce926,_0x4693f8[_0xb599('0x30')]));emitChannelQueueInteraction(_0x5a4214[_0xb599('0x25')],_0x4693f8['name'],_0x1ab78d,_0x5a4214[_0xb599('0xc')][_0xb599('0x30')],_0x5a4214[_0xb599('0x2a')]['id'],!![],_0x185e15,_0x4693f8['id']);if(rpc[_0x5a4214[_0xb599('0x25')]+'QueueReport']){return rpc[_0x5a4214[_0xb599('0x25')]+_0xb599('0x31')][_0xb599('0x32')](_0x1ab78d)[_0xb599('0x33')](function(_0x340b44){logger[_0xb599('0x34')](_0xb599('0x35'));});}}}function stopRouting(_0x5ba55d,_0x4d008e,_0x11e466,_0x57a1df){if(_0x5ba55d&&_0x4d008e){_0x4d008e[_0xb599('0x36')]-=0x1;var _0x410d63={'leaveAt':moment()[_0xb599('0x11')](_0xb599('0x22')),'acceptAt':moment()[_0xb599('0x11')](_0xb599('0x22')),'reason':_0xb599('0x37')};logger[_0xb599('0x38')](util[_0xb599('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x5ba55d,_0x4d008e[_0xb599('0x30')]));emitChannelQueueInteraction(_0x11e466['channel'],_0x4d008e['name'],_0x11e466[_0xb599('0x20')],_0x11e466[_0xb599('0xc')][_0xb599('0x30')],_0x11e466[_0xb599('0x2a')]['id'],![],_0x57a1df,_0x4d008e['id']);if(rpc[_0x11e466[_0xb599('0x25')]+_0xb599('0x31')]){return rpc[_0x11e466[_0xb599('0x25')]+_0xb599('0x31')][_0xb599('0x39')](_0x5ba55d,_0x410d63)[_0xb599('0x33')](function(_0x4ea1cc){logger['error'](_0xb599('0x3a'));});}}}function endRouting(_0x242e5f,_0x22ca8d,_0x18b13f,_0x2a840f){if(_0x242e5f&&_0x22ca8d){_0x22ca8d['waiting']-=0x1;var _0x27dbfc={'leaveAt':moment()[_0xb599('0x11')](_0xb599('0x22')),'exitAt':moment()[_0xb599('0x11')](_0xb599('0x22')),'reason':_0xb599('0x3b')};logger[_0xb599('0x38')](util[_0xb599('0x11')](_0xb599('0x3c'),_0x242e5f,_0x22ca8d[_0xb599('0x30')]));emitChannelQueueInteraction(_0x18b13f['channel'],_0x22ca8d[_0xb599('0x30')],_0x18b13f['body'],_0x18b13f[_0xb599('0xc')][_0xb599('0x30')],_0x18b13f[_0xb599('0x2a')]['id'],![],_0x2a840f);if(rpc[_0x18b13f[_0xb599('0x25')]+_0xb599('0x31')]){return rpc[_0x18b13f[_0xb599('0x25')]+_0xb599('0x31')][_0xb599('0x39')](_0x242e5f,_0x27dbfc)[_0xb599('0x33')](function(_0x809a06){logger['error'](_0xb599('0x3a'));});}}}function handleFindQueue(_0x2b8c94){return function(_0xa40867){return _0xa40867[_0xb599('0x30')][_0xb599('0x3d')]()===_0x2b8c94[_0xb599('0x3d')]();};}exports['consequence']=function(_0x6af230,_0x4512b7,_0x49b737,_0xd5a871){return function(_0x1da667){try{var _0x3100f2={'name':_0x4512b7[0x0],'timeout':_0x4512b7[0x1]};var _0x41e5ad=queue['validate'](_0x3100f2,{'typecast':!![]});if(_0x41e5ad['length']){logger['error'](_0xb599('0x3e'),_0x6af230,_[_0xb599('0x3f')](_0x41e5ad,_0xb599('0x2a'))[_0xb599('0x40')](',\x20'));_0x1da667[_0xb599('0x41')]();}else{var _0x1bb47c=_['find'](_0x49b737[_0xd5a871[_0xb599('0x25')]+_0xb599('0x42')],handleFindQueue(_0x3100f2[_0xb599('0x30')]));if(_0x1bb47c){startRouting(_0x6af230,_0x1bb47c,_0xd5a871,_0x49b737);var _0x236d43=(_0x1bb47c[_0xb599('0x3b')]||0xa)*0x3e8;var _0x4661b1=(_0x3100f2[_0xb599('0x3b')]||0x14)*0x3e8;var _0x4ca2d3,_0x2e49ff;if(_0x236d43>_0x4661b1){_0x4661b1=_0x236d43;}var _0x2f5cc2=seqqueue[_0xb599('0x43')](_0x236d43);_0x2f5cc2['id']=_0x6af230;_0x2f5cc2[_0xb599('0x44')]=_0x236d43;_0x2f5cc2[_0xb599('0x45')]=_0x4661b1;_0x2f5cc2[_0xb599('0x25')]=_0xd5a871[_0xb599('0x25')];_0x49b737['rules'][_0x6af230]['on'](_0xb599('0x46'),function(){logger[_0xb599('0x38')](_0xb599('0x47'),_0x6af230);stopRouting(_0x6af230,_0x1bb47c,_0xd5a871,_0x49b737);clearTimeout(_0x4ca2d3);_0x4ca2d3=undefined;_0x2f5cc2[_0xb599('0x48')](!![]);if(_0x49b737[_0xb599('0x49')][_0x6af230]){delete _0x49b737[_0xb599('0x49')][_0x6af230];}_0x1da667[_0xb599('0x41')]();});_0x49b737[_0xb599('0x49')][_0x6af230]['on'](_0xb599('0x4a'),function(){if(_0x49b737[_0xb599('0x49')][_0x6af230]){delete _0x49b737['rules'][_0x6af230];}});_0x4ca2d3=setTimeout(function(){logger[_0xb599('0x38')](_0xb599('0x4b'),_0x6af230);endRouting(_0x6af230,_0x1bb47c,_0xd5a871,_0x49b737);clearTimeout(_0x4ca2d3);_0x2f5cc2['close'](!![]);_0x1da667[_0xb599('0x4c')]();},_0x4661b1);switch(_0x1bb47c[_0xb599('0x4d')]){case _0xb599('0x4e'):strategy['rrmemory'](_0x2f5cc2,_0x1bb47c,_0x49b737,_0xd5a871);break;default:strategy['beepall'](_0x2f5cc2,_0x1bb47c,_0x49b737,_0xd5a871);}}else{logger[_0xb599('0x34')](_0xb599('0x4f'),_0x6af230,_0x3100f2[_0xb599('0x30')]);_0x1da667[_0xb599('0x41')]();}}}catch(_0x5e6127){console[_0xb599('0x50')](_0x5e6127);logger[_0xb599('0x34')]('[%s][QUEUE]\x20%s',_0x6af230,_0x5e6127[_0xb599('0x51')]);_0x1da667[_0xb599('0x41')]();}};}; \ No newline at end of file +var _0x6e85=['../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue_id','queue','from','joinAt','clone','account','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','name','QueueReport','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','consequence','length','map','stop','find','Queues','createQueue','atimeout','rules','end','close','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','ioredis'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x6e85,0x16e));var _0x56e8=function(_0x34edbe,_0x4e4169){_0x34edbe=_0x34edbe-0x0;var _0x4abfb0=_0x6e85[_0x34edbe];return _0x4abfb0;};'use strict';var schema=require(_0x56e8('0x0'));var _=require(_0x56e8('0x1'));var util=require(_0x56e8('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x56e8('0x3'));var config=require(_0x56e8('0x4'));var logger=require(_0x56e8('0x5'))(_0x56e8('0x6'));var strategy=require('./strategy');config[_0x56e8('0x7')]=_[_0x56e8('0x8')](config['redis'],{'host':_0x56e8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x56e8('0x7')]));var attributes=['id',_0x56e8('0xa'),'account',_0x56e8('0xb'),_0x56e8('0xc'),_0x56e8('0xd')];function emit(_0x1d156a,_0x256af0,_0x66449c){io['to'](_0x1d156a)['emit'](_0x256af0,_0x66449c);}function emitChannelQueueInteraction(_0x50e3cd,_0x447f71,_0x1dba5d,_0x5bb67b,_0x2281c0,_0x48a0db,_0x2ad1fa,_0x2dc94c){var _0x4e77ca=_[_0x56e8('0xe')](_0x1dba5d);_0x4e77ca[_0x56e8('0xa')]=_0x2dc94c;_0x4e77ca[_0x56e8('0xb')]=_0x447f71;_0x4e77ca[_0x56e8('0xf')]=_0x5bb67b;_0x4e77ca['id']=_0x2281c0;if(_0x48a0db){_0x2ad1fa[util[_0x56e8('0x10')](_0x56e8('0x11'),_0x50e3cd)][_0x2281c0]=_['pick'](_0x4e77ca,attributes);}else{delete _0x2ad1fa[util[_0x56e8('0x10')](_0x56e8('0x11'),_0x50e3cd)][_0x2281c0];}emit(util[_0x56e8('0x10')](_0x56e8('0x12'),_0x50e3cd,_0x447f71),util[_0x56e8('0x10')](_0x56e8('0x13'),_0x50e3cd,_0x48a0db?_0x56e8('0x14'):_0x56e8('0x15')),_[_0x56e8('0x16')](_0x4e77ca,attributes));}var rpc={'openchannelQueueReport':require(_0x56e8('0x17')),'mailQueueReport':require(_0x56e8('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x56e8('0x19')),'faxQueueReport':require(_0x56e8('0x1a')),'whatsappQueueReport':require(_0x56e8('0x1b'))};var queue=schema({'name':{'type':_0x56e8('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x56e8('0x1d')}});function startRouting(_0x33928e,_0x2c0e59,_0x5240b4,_0x10e237){if(_0x33928e&&_0x2c0e59&&_0x5240b4){_0x2c0e59[_0x56e8('0x1e')]+=0x1;var _0x1691c2={'uniqueid':_0x33928e,'from':_0x5240b4['body']?_0x5240b4[_0x56e8('0x1f')][_0x56e8('0xc')]:'','joinAt':moment()[_0x56e8('0x10')](_0x56e8('0x20')),'ContactId':_0x5240b4[_0x56e8('0x21')]?_0x5240b4[_0x56e8('0x21')]['id']:null,'ListId':_0x5240b4[_0x56e8('0x22')]?_0x5240b4[_0x56e8('0x22')]['id']:null};_0x1691c2[_[_0x56e8('0x23')](_0x5240b4['channel'])+'QueueId']=_0x2c0e59['id']||null;_0x1691c2[_[_0x56e8('0x23')](_0x5240b4[_0x56e8('0x24')])+_0x56e8('0x25')]=_0x5240b4[_0x56e8('0x26')]?_0x5240b4['interaction']['id']:null;_0x1691c2[_['upperFirst'](_0x5240b4['channel'])+_0x56e8('0x27')]=_0x5240b4[_0x56e8('0x28')]?_0x5240b4['message']['id']:null;_0x1691c2[_[_0x56e8('0x23')](_0x5240b4[_0x56e8('0x24')])+(_0x5240b4[_0x56e8('0x24')]!=='chat'?_0x56e8('0x29'):_0x56e8('0x2a'))]=_0x5240b4[_0x56e8('0xf')]?_0x5240b4[_0x56e8('0xf')]['id']:null;logger[_0x56e8('0x2b')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x33928e,_0x2c0e59['name']));emitChannelQueueInteraction(_0x5240b4[_0x56e8('0x24')],_0x2c0e59[_0x56e8('0x2c')],_0x1691c2,_0x5240b4[_0x56e8('0xf')][_0x56e8('0x2c')],_0x5240b4[_0x56e8('0x28')]['id'],!![],_0x10e237,_0x2c0e59['id']);if(rpc[_0x5240b4['channel']+_0x56e8('0x2d')]){return rpc[_0x5240b4[_0x56e8('0x24')]+_0x56e8('0x2d')]['create'](_0x1691c2)['catch'](function(_0x28aa12){logger[_0x56e8('0x2e')](_0x56e8('0x2f'));});}}}function stopRouting(_0x5410e3,_0xfbb0e,_0x55b6c7,_0x144dae){if(_0x5410e3&&_0xfbb0e){_0xfbb0e[_0x56e8('0x1e')]-=0x1;var _0x523d1c={'leaveAt':moment()[_0x56e8('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x56e8('0x10')](_0x56e8('0x20')),'reason':_0x56e8('0x30')};logger['info'](util[_0x56e8('0x10')](_0x56e8('0x31'),_0x5410e3,_0xfbb0e[_0x56e8('0x2c')]));emitChannelQueueInteraction(_0x55b6c7[_0x56e8('0x24')],_0xfbb0e[_0x56e8('0x2c')],_0x55b6c7[_0x56e8('0x1f')],_0x55b6c7[_0x56e8('0xf')][_0x56e8('0x2c')],_0x55b6c7[_0x56e8('0x28')]['id'],![],_0x144dae,_0xfbb0e['id']);if(rpc[_0x55b6c7[_0x56e8('0x24')]+_0x56e8('0x2d')]){return rpc[_0x55b6c7['channel']+_0x56e8('0x2d')][_0x56e8('0x32')](_0x5410e3,_0x523d1c)['catch'](function(_0x41770f){logger[_0x56e8('0x2e')](_0x56e8('0x33'));});}}}function endRouting(_0x175ca4,_0xfedce7,_0x1a0f9e,_0x5782f3){if(_0x175ca4&&_0xfedce7){_0xfedce7[_0x56e8('0x1e')]-=0x1;var _0x56a134={'leaveAt':moment()['format'](_0x56e8('0x20')),'exitAt':moment()['format'](_0x56e8('0x20')),'reason':_0x56e8('0x34')};logger[_0x56e8('0x2b')](util[_0x56e8('0x10')](_0x56e8('0x35'),_0x175ca4,_0xfedce7['name']));emitChannelQueueInteraction(_0x1a0f9e['channel'],_0xfedce7[_0x56e8('0x2c')],_0x1a0f9e[_0x56e8('0x1f')],_0x1a0f9e[_0x56e8('0xf')][_0x56e8('0x2c')],_0x1a0f9e['message']['id'],![],_0x5782f3);if(rpc[_0x1a0f9e[_0x56e8('0x24')]+_0x56e8('0x2d')]){return rpc[_0x1a0f9e['channel']+'QueueReport'][_0x56e8('0x32')](_0x175ca4,_0x56a134)[_0x56e8('0x36')](function(_0x441734){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x4e59ec){return function(_0x32cf73){return _0x32cf73[_0x56e8('0x2c')]['toLowerCase']()===_0x4e59ec[_0x56e8('0x37')]();};}exports[_0x56e8('0x38')]=function(_0x4ba18e,_0x42579b,_0x3e77ae,_0x3f0c4e){return function(_0xec431){try{var _0x20c9fa={'name':_0x42579b[0x0],'timeout':_0x42579b[0x1]};var _0x54da40=queue[_0x56e8('0x0')](_0x20c9fa,{'typecast':!![]});if(_0x54da40[_0x56e8('0x39')]){logger['error']('[%s][QUEUE]\x20%s',_0x4ba18e,_[_0x56e8('0x3a')](_0x54da40,_0x56e8('0x28'))['join'](',\x20'));_0xec431[_0x56e8('0x3b')]();}else{var _0x56e2cf=_[_0x56e8('0x3c')](_0x3e77ae[_0x3f0c4e[_0x56e8('0x24')]+_0x56e8('0x3d')],handleFindQueue(_0x20c9fa[_0x56e8('0x2c')]));if(_0x56e2cf){startRouting(_0x4ba18e,_0x56e2cf,_0x3f0c4e,_0x3e77ae);var _0xf05f6e=(_0x56e2cf[_0x56e8('0x34')]||0xa)*0x3e8;var _0x3d8f12=(_0x20c9fa[_0x56e8('0x34')]||0x14)*0x3e8;var _0x31c3a2,_0x385591;if(_0xf05f6e>_0x3d8f12){_0x3d8f12=_0xf05f6e;}var _0x1a9f5c=seqqueue[_0x56e8('0x3e')](_0xf05f6e);_0x1a9f5c['id']=_0x4ba18e;_0x1a9f5c[_0x56e8('0x3f')]=_0xf05f6e;_0x1a9f5c['qtimeout']=_0x3d8f12;_0x1a9f5c['channel']=_0x3f0c4e[_0x56e8('0x24')];_0x3e77ae[_0x56e8('0x40')][_0x4ba18e]['on'](_0x56e8('0x41'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4ba18e);stopRouting(_0x4ba18e,_0x56e2cf,_0x3f0c4e,_0x3e77ae);clearTimeout(_0x31c3a2);_0x31c3a2=undefined;_0x1a9f5c['close'](!![]);if(_0x3e77ae[_0x56e8('0x40')][_0x4ba18e]){delete _0x3e77ae[_0x56e8('0x40')][_0x4ba18e];}_0xec431['stop']();});_0x3e77ae[_0x56e8('0x40')][_0x4ba18e]['on']('complete',function(){if(_0x3e77ae['rules'][_0x4ba18e]){delete _0x3e77ae[_0x56e8('0x40')][_0x4ba18e];}});_0x31c3a2=setTimeout(function(){logger[_0x56e8('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4ba18e);endRouting(_0x4ba18e,_0x56e2cf,_0x3f0c4e,_0x3e77ae);clearTimeout(_0x31c3a2);_0x1a9f5c[_0x56e8('0x42')](!![]);_0xec431[_0x56e8('0x43')]();},_0x3d8f12);switch(_0x56e2cf['strategy']){case _0x56e8('0x44'):strategy[_0x56e8('0x44')](_0x1a9f5c,_0x56e2cf,_0x3e77ae,_0x3f0c4e);break;default:strategy[_0x56e8('0x45')](_0x1a9f5c,_0x56e2cf,_0x3e77ae,_0x3f0c4e);}}else{logger[_0x56e8('0x2e')](_0x56e8('0x46'),_0x4ba18e,_0x20c9fa['name']);_0xec431[_0x56e8('0x3b')]();}}}catch(_0x5a01f6){console[_0x56e8('0x47')](_0x5a01f6);logger['error'](_0x56e8('0x48'),_0x4ba18e,_0x5a01f6[_0x56e8('0x49')]);_0xec431['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index f466f30..f40b77e 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 _0x01e0=['agents','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','squeue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x01e0,0x72));var _0x001e=function(_0x50e70a,_0x11bf9e){_0x50e70a=_0x50e70a-0x0;var _0x19090a=_0x01e0[_0x50e70a];return _0x19090a;};'use strict';var _=require(_0x001e('0x0'));var uuid=require('uuid');var util=require(_0x001e('0x1'));var logger=require(_0x001e('0x2'))('routing');var Agent=function(_0x278a08,_0x12fe01,_0x57d6b7,_0x56bfe6){this['notificationId']=uuid['v4']();this[_0x001e('0x3')]=_0x278a08;this['agent']=_0x12fe01;this[_0x001e('0x4')]=_0x57d6b7;this[_0x001e('0x5')]=_0x56bfe6;this[_0x001e('0x3')][_0x001e('0x6')](this[_0x001e('0x7')][_0x001e('0x8')](this),this[_0x001e('0x9')][_0x001e('0x8')](this));this['squeue']['on'](_0x001e('0xa'),this['handleTimeout'][_0x001e('0x8')](this));this[_0x001e('0x3')]['on'](_0x001e('0xb'),this[_0x001e('0xc')][_0x001e('0x8')](this));};Agent['prototype'][_0x001e('0x6')]=function(){this[_0x001e('0x3')][_0x001e('0x6')](this[_0x001e('0x7')]['bind'](this),this['handleTimeout']['bind'](this));};Agent[_0x001e('0xd')]['handleDrained']=function(){this[_0x001e('0x9')](!![]);};Agent[_0x001e('0xd')][_0x001e('0x7')]=function(_0x130ae0){logger[_0x001e('0xe')](_0x001e('0xf'),this['squeue']['id'],this[_0x001e('0x10')]['id']);if(_[_0x001e('0x11')](this[_0x001e('0x4')][_0x001e('0x12')][this[_0x001e('0x10')]['id']])){logger[_0x001e('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x001e('0x3')]['id'],this[_0x001e('0x10')]['id']);setTimeout(this[_0x001e('0x6')][_0x001e('0x8')](this),0x3e8);}else{if(this['routing'][_0x001e('0x13')]||util[_0x001e('0x14')](this[_0x001e('0x3')]['id'],this['realtime'][_0x001e('0x12')][this[_0x001e('0x10')]['id']],this[_0x001e('0x3')][_0x001e('0x15')],![])){this[_0x001e('0x4')]['agents'][this[_0x001e('0x10')]['id']][_0x001e('0x16')]=!![];this['realtime'][_0x001e('0x12')][this[_0x001e('0x10')]['id']][_0x001e('0x17')]=undefined;util[_0x001e('0x18')](this[_0x001e('0x19')],this[_0x001e('0x3')]['id'],this['realtime'][_0x001e('0x12')][this['agent']['id']],null,this[_0x001e('0x5')]);util['writeLog'](this[_0x001e('0x3')]['id'],this[_0x001e('0x4')][_0x001e('0x12')][this[_0x001e('0x10')]['id']],_0x001e('0x1a')+(this[_0x001e('0x5')][_0x001e('0x13')]?':FORCED':''));}else{logger[_0x001e('0xe')](_0x001e('0x1b'),this[_0x001e('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x001e('0x6')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x193a30){if(_[_0x001e('0x11')](this['realtime'][_0x001e('0x12')][this[_0x001e('0x10')]['id']])){return logger[_0x001e('0xe')](_0x001e('0x1c'),this[_0x001e('0x3')]['id'],this[_0x001e('0x10')]['id']);}else{logger[_0x001e('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x001e('0x3')]['id'],this[_0x001e('0x10')]['id']);util[_0x001e('0x1d')](this[_0x001e('0x19')],this[_0x001e('0x3')]['id'],this[_0x001e('0x4')][_0x001e('0x12')][this[_0x001e('0x10')]['id']],null,this[_0x001e('0x5')]);this[_0x001e('0x4')][_0x001e('0x12')][this[_0x001e('0x10')]['id']][_0x001e('0x16')]=![];this[_0x001e('0x4')][_0x001e('0x12')][this['agent']['id']][_0x001e('0x17')]=undefined;util[_0x001e('0x1e')](this[_0x001e('0x3')]['id'],this['realtime'][_0x001e('0x12')][this[_0x001e('0x10')]['id']],_0x193a30?_0x001e('0x1f'):_0x001e('0x20'));}if(!_0x193a30){setTimeout(this['push'][_0x001e('0x8')](this),0x3e8);}};function agent(_0x28fde0,_0x1853e6,_0x2e7653,_0xbc6fbd){return new Agent(_0x28fde0,_0x1853e6,_0x2e7653,_0xbc6fbd);}module['exports']=agent; \ No newline at end of file +var _0xf696=['TIMEOUT','exports','uuid','./util','../../../../../config/logger','agent','realtime','squeue','push','handleRun','handleTimeout','bind','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agents','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','routing',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','writeLog','STOP'];(function(_0x49651a,_0x88ed81){var _0x4c42b5=function(_0x571377){while(--_0x571377){_0x49651a['push'](_0x49651a['shift']());}};_0x4c42b5(++_0x88ed81);}(_0xf696,0x110));var _0x6f69=function(_0x4f6570,_0x3d9925){_0x4f6570=_0x4f6570-0x0;var _0x1aa7d9=_0xf696[_0x4f6570];return _0x1aa7d9;};'use strict';var _=require('lodash');var uuid=require(_0x6f69('0x0'));var util=require(_0x6f69('0x1'));var logger=require(_0x6f69('0x2'))('routing');var Agent=function(_0x158b9d,_0x3864bd,_0x210ff2,_0x33a701){this['notificationId']=uuid['v4']();this['squeue']=_0x158b9d;this[_0x6f69('0x3')]=_0x3864bd;this[_0x6f69('0x4')]=_0x210ff2;this['routing']=_0x33a701;this[_0x6f69('0x5')][_0x6f69('0x6')](this[_0x6f69('0x7')]['bind'](this),this[_0x6f69('0x8')][_0x6f69('0x9')](this));this[_0x6f69('0x5')]['on']('timeout',this['handleTimeout'][_0x6f69('0x9')](this));this['squeue']['on'](_0x6f69('0xa'),this['handleDrained'][_0x6f69('0x9')](this));};Agent[_0x6f69('0xb')]['push']=function(){this[_0x6f69('0x5')][_0x6f69('0x6')](this[_0x6f69('0x7')][_0x6f69('0x9')](this),this[_0x6f69('0x8')][_0x6f69('0x9')](this));};Agent[_0x6f69('0xb')][_0x6f69('0xc')]=function(){this[_0x6f69('0x8')](!![]);};Agent[_0x6f69('0xb')][_0x6f69('0x7')]=function(_0x197d51){logger[_0x6f69('0xd')](_0x6f69('0xe'),this[_0x6f69('0x5')]['id'],this['agent']['id']);if(_['isNil'](this['realtime'][_0x6f69('0xf')][this['agent']['id']])){logger[_0x6f69('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6f69('0x5')]['id'],this[_0x6f69('0x3')]['id']);setTimeout(this[_0x6f69('0x6')][_0x6f69('0x9')](this),0x3e8);}else{if(this['routing'][_0x6f69('0x10')]||util[_0x6f69('0x11')](this[_0x6f69('0x5')]['id'],this[_0x6f69('0x4')][_0x6f69('0xf')][this['agent']['id']],this[_0x6f69('0x5')][_0x6f69('0x12')],![])){this[_0x6f69('0x4')]['agents'][this['agent']['id']][_0x6f69('0x13')]=!![];this[_0x6f69('0x4')][_0x6f69('0xf')][this['agent']['id']][_0x6f69('0x14')]=undefined;util[_0x6f69('0x15')](this[_0x6f69('0x16')],this[_0x6f69('0x5')]['id'],this[_0x6f69('0x4')][_0x6f69('0xf')][this[_0x6f69('0x3')]['id']],null,this[_0x6f69('0x17')]);util['writeLog'](this[_0x6f69('0x5')]['id'],this[_0x6f69('0x4')][_0x6f69('0xf')][this[_0x6f69('0x3')]['id']],'RINGING'+(this['routing'][_0x6f69('0x10')]?_0x6f69('0x18'):''));}else{logger['info'](_0x6f69('0x19'),this[_0x6f69('0x5')]['id'],this[_0x6f69('0x3')]['id']);setTimeout(this[_0x6f69('0x6')][_0x6f69('0x9')](this),0x3e8);}}};Agent['prototype'][_0x6f69('0x8')]=function(_0xc8ffaf){if(_['isNil'](this[_0x6f69('0x4')][_0x6f69('0xf')][this['agent']['id']])){return logger[_0x6f69('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6f69('0x5')]['id'],this[_0x6f69('0x3')]['id']);}else{logger[_0x6f69('0xd')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x6f69('0x5')]['id'],this[_0x6f69('0x3')]['id']);util['hideNotification'](this[_0x6f69('0x16')],this[_0x6f69('0x5')]['id'],this['realtime'][_0x6f69('0xf')][this[_0x6f69('0x3')]['id']],null,this[_0x6f69('0x17')]);this['realtime'][_0x6f69('0xf')][this['agent']['id']][_0x6f69('0x13')]=![];this['realtime'][_0x6f69('0xf')][this['agent']['id']][_0x6f69('0x14')]=undefined;util[_0x6f69('0x1a')](this[_0x6f69('0x5')]['id'],this['realtime']['agents'][this[_0x6f69('0x3')]['id']],_0xc8ffaf?_0x6f69('0x1b'):_0x6f69('0x1c'));}if(!_0xc8ffaf){setTimeout(this[_0x6f69('0x6')]['bind'](this),0x3e8);}};function agent(_0x4cb65b,_0xdbf643,_0x1cf7b3,_0x376a71){return new Agent(_0x4cb65b,_0xdbf643,_0x1cf7b3,_0x376a71);}module[_0x6f69('0x1d')]=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 956088a..5c15fc0 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 _0x4453=['exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents','info','isAgentAvailable','channel','writeLog','busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT'];(function(_0x374c66,_0x47be09){var _0x19f463=function(_0x4ededf){while(--_0x4ededf){_0x374c66['push'](_0x374c66['shift']());}};_0x19f463(++_0x47be09);}(_0x4453,0x9c));var _0x3445=function(_0x35e869,_0x1bc277){_0x35e869=_0x35e869-0x0;var _0x358ecb=_0x4453[_0x35e869];return _0x358ecb;};'use strict';var _=require(_0x3445('0x0'));var uuid=require(_0x3445('0x1'));var util=require('./util');var logger=require(_0x3445('0x2'))(_0x3445('0x3'));var Beepall=function(_0x4f2364,_0x14d37c,_0x1419a5,_0xfff5){this[_0x3445('0x4')]=uuid['v4']();this[_0x3445('0x5')]=_0x4f2364;this[_0x3445('0x6')]=_0x14d37c;this[_0x3445('0x7')]=_0x1419a5;this[_0x3445('0x3')]=_0xfff5;this[_0x3445('0x5')][_0x3445('0x8')](this['handleRun'][_0x3445('0x9')](this),this[_0x3445('0xa')][_0x3445('0x9')](this));this[_0x3445('0x5')]['on'](_0x3445('0xb'),this[_0x3445('0xa')][_0x3445('0x9')](this));this['squeue']['on'](_0x3445('0xc'),this[_0x3445('0xd')][_0x3445('0x9')](this));};Beepall[_0x3445('0xe')]['push']=function(){this[_0x3445('0x5')][_0x3445('0x8')](this[_0x3445('0xf')][_0x3445('0x9')](this),this[_0x3445('0xa')][_0x3445('0x9')](this));};Beepall[_0x3445('0xe')]['handleDrained']=function(_0x5be0ce){this[_0x3445('0xa')](!![]);};Beepall['prototype'][_0x3445('0xf')]=function(_0x548da1){var _0x357816=!![];if(!_[_0x3445('0x10')](this[_0x3445('0x6')])&&!_[_0x3445('0x10')](this[_0x3445('0x6')][_0x3445('0x11')])&&this[_0x3445('0x6')]['Agents'][_0x3445('0x12')]>0x0){for(var _0x426fbf=0x0,_0x4ba35d;_0x426fbf0x0){for(var _0x35db37=0x0,_0x5c6a02;_0x35db370x0&&_0x4f62c8[_0x2c07c8+_0xd187('0x22')]>=_0x4f62c8[_0x2c07c8+_0xd187('0x20')]){writeLog(_0x249a82,_0x4f62c8,_0x2c07c8[_0xd187('0x23')]()+_0xd187('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x2a20ed,_0x2875c8,_0x5c8e52,_0x3e9971,_0x1c87ee){return sendNotification(!![],_0x2a20ed,_0x2875c8,_0x5c8e52,_0x3e9971,_0x1c87ee);};exports[_0xd187('0x25')]=function(_0x4c50a5,_0x15e2e8,_0x56e292,_0x263e31,_0x19e75f){return sendNotification(![],_0x4c50a5,_0x15e2e8,_0x56e292,_0x263e31,_0x19e75f);};exports[_0xd187('0x26')]=writeLog; \ No newline at end of file +var _0x3e24=['hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','name','split','\x20interaction','account','notificationSound','notificationShake','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE'];(function(_0x52c5b0,_0x4e543e){var _0x3d98dc=function(_0x61633){while(--_0x61633){_0x52c5b0['push'](_0x52c5b0['shift']());}};_0x3d98dc(++_0x4e543e);}(_0x3e24,0x167));var _0x43e2=function(_0xea950a,_0x12fa9e){_0xea950a=_0xea950a-0x0;var _0x134c5f=_0x3e24[_0xea950a];return _0x134c5f;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var utils=require(_0x43e2('0x2'));var Mustache=require(_0x43e2('0x3'));var Redis=require(_0x43e2('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x43e2('0x5'))(_0x43e2('0x6'));config['redis']=_[_0x43e2('0x7')](config[_0x43e2('0x8')],{'host':_0x43e2('0x9'),'port':0x18eb});var io=require(_0x43e2('0xa'))(new Redis(config[_0x43e2('0x8')]));function emit(_0x121e2e,_0x23b2d8,_0x59956d){io['to'](_0x121e2e)[_0x43e2('0xb')](_0x23b2d8,_0x59956d);}function sendNotification(_0x2357bc,_0x4bd2ce,_0x1c96f9,_0x2fdf85,_0x5375d8,_0x2ed387){io['to'](util[_0x43e2('0xc')]('user:%s',_0x2fdf85[_0x43e2('0xd')]))['emit']('user:save',_0x2fdf85);var _0x5847f0=_0x2ed387||{};var _0x103220=_0x1c96f9[_0x43e2('0xe')]('.');var _0x236b88={'uniqueid':_0x4bd2ce,'channel':_0x103220[0x0],'id':_0x103220[0x1],'title':_0x103220[0x0]+_0x43e2('0xf'),'interactionId':_0x103220[0x2],'queue':_0x5375d8?_0x5375d8[_0x43e2('0xd')]:null,'sound':_0x5847f0[_0x43e2('0x10')][_0x43e2('0x11')],'shake':_0x5847f0[_0x43e2('0x10')][_0x43e2('0x12')]};try{if(!_0x5847f0[_0x43e2('0x13')]){_0x5847f0[_0x43e2('0x13')]={};}if(_0x5375d8){_0x5847f0[_0x43e2('0x13')]['queue']=_0x5375d8;}else if(_0x5847f0[_0x43e2('0x13')][_0x43e2('0x14')]){delete _0x5847f0[_0x43e2('0x13')][_0x43e2('0x14')];}_0x236b88['msg']=utils['getMustacheRender'](_0x5847f0[_0x43e2('0x10')][_0x43e2('0x15')],_0x5847f0);}catch(_0x27aa89){_0x236b88[_0x43e2('0x16')]=_0x43e2('0x17');logger[_0x43e2('0x18')](util[_0x43e2('0xc')](_0x43e2('0x19'),_0x4bd2ce,_0x27aa89[_0x43e2('0x1a')]));}io['to'](util[_0x43e2('0xc')]('user:%s',_0x2fdf85[_0x43e2('0xd')]))[_0x43e2('0xb')](util['format'](_0x43e2('0x1b'),_0x2357bc?'save':_0x43e2('0x1c')),_0x236b88);}function writeLog(_0x13610f,_0x1fac53,_0x23825c){return logger[_0x43e2('0x1d')](util['format'](_0x43e2('0x1e'),_0x13610f,_0x1fac53[_0x43e2('0xd')],_0x23825c));}exports[_0x43e2('0x1f')]=function(_0x52e361,_0x234a1d,_0x32f048,_0x43078f){if(_0x234a1d[_0x43e2('0x20')]){writeLog(_0x52e361,_0x234a1d,'BUSY');return![];}if(!_0x234a1d[_0x43e2('0x21')]){writeLog(_0x52e361,_0x234a1d,_0x43e2('0x22'));return![];}if(_0x234a1d[_0x32f048+_0x43e2('0x23')]){writeLog(_0x52e361,_0x234a1d,_0x43e2('0x24'));return![];}if(_0x43078f&&_0x234a1d[_0x43e2('0x25')](_0x32f048+_0x43e2('0x26'))&&_0x234a1d[_0x43e2('0x25')](_0x32f048+_0x43e2('0x27'))){if(_0x234a1d[_0x32f048+_0x43e2('0x26')]>0x0&&_0x234a1d[_0x32f048+_0x43e2('0x27')]>=_0x234a1d[_0x32f048+_0x43e2('0x26')]){writeLog(_0x52e361,_0x234a1d,_0x32f048[_0x43e2('0x28')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x43e2('0x29')]=function(_0x2f2bd8,_0x545246,_0x163063,_0x1883c6,_0x2dffa2){return sendNotification(!![],_0x2f2bd8,_0x545246,_0x163063,_0x1883c6,_0x2dffa2);};exports[_0x43e2('0x2a')]=function(_0x3fd232,_0x5a896b,_0x42f495,_0xd1b43a,_0x1779f9){return sendNotification(![],_0x3fd232,_0x5a896b,_0x42f495,_0xd1b43a,_0x1779f9);};exports[_0x43e2('0x2b')]=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 df2a1ff..8de20f8 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 _0x3d04=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join'];(function(_0x39a9e6,_0x45c12e){var _0x31c2dc=function(_0x3485ad){while(--_0x3485ad){_0x39a9e6['push'](_0x39a9e6['shift']());}};_0x31c2dc(++_0x45c12e);}(_0x3d04,0x100));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var schema=require(_0x43d0('0x0'));var sh=require(_0x43d0('0x1'));var _=require(_0x43d0('0x2'));var utils=require(_0x43d0('0x3'));var logger=require(_0x43d0('0x4'))(_0x43d0('0x5'));var system=schema({'command':{'type':_0x43d0('0x6'),'required':!![],'message':_0x43d0('0x7')}});exports[_0x43d0('0x8')]=function(_0x67925a,_0x14e8b){return function(_0x15a5a8){try{var _0x1ffaa1={'command':_0x14e8b[0x0]};var _0x1562c0=system[_0x43d0('0x0')](_0x1ffaa1,{'typecast':!![]});if(_0x1562c0[_0x43d0('0x9')]){logger[_0x43d0('0xa')](_0x43d0('0xb'),_0x67925a,_[_0x43d0('0xc')](_0x1562c0,'message')[_0x43d0('0xd')](',\x20'));logger['info'](_0x43d0('0xe'),_0x67925a);_0x15a5a8[_0x43d0('0xf')]();}else{var _0x117ad7=this;var _0x5055c4=utils[_0x43d0('0x10')](_0x14e8b[0x0],this);logger[_0x43d0('0x11')](_0x43d0('0x12'),_0x67925a,_0x5055c4);sh[_0x43d0('0x13')](_[_0x43d0('0x14')](_0x5055c4),function(_0x40e5b2,_0x345d3b){logger[_0x43d0('0x11')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x67925a,_0x40e5b2);if(_0x40e5b2==0x0){var _0x2698d8=_0x345d3b[_0x43d0('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0x43d0('0x16')](_0x14e8b[0x1])||_[_0x43d0('0x17')](_0x14e8b[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x67925a);_0x117ad7[_0x43d0('0x18')][_0x14e8b[0x1]]=_0x2698d8;}else{logger[_0x43d0('0x11')](_0x43d0('0x19'),_0x67925a,_0x14e8b[0x1],_0x2698d8);_0x117ad7['body'][_0x14e8b[0x1]]=_0x2698d8;}}_0x15a5a8[_0x43d0('0xf')]();});}}catch(_0x27e216){logger['error'](_0x43d0('0xb'),_0x67925a,_[_0x43d0('0x1a')](_0x27e216)?JSON['stringify'](_0x27e216):_0x27e216);logger['info'](_0x43d0('0xe'),_0x67925a);_0x15a5a8['next']();}};}; \ No newline at end of file +var _0x16c2=['exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x222887,_0x5cb0e0){var _0x295247=function(_0x423fff){while(--_0x423fff){_0x222887['push'](_0x222887['shift']());}};_0x295247(++_0x5cb0e0);}(_0x16c2,0x176));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var schema=require('validate');var sh=require(_0x216c('0x0'));var _=require(_0x216c('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x216c('0x2'));var system=schema({'command':{'type':_0x216c('0x3'),'required':!![],'message':_0x216c('0x4')}});exports[_0x216c('0x5')]=function(_0x2ec31e,_0xe9a368){return function(_0x6c7b66){try{var _0x12a6df={'command':_0xe9a368[0x0]};var _0x39c90f=system[_0x216c('0x6')](_0x12a6df,{'typecast':!![]});if(_0x39c90f['length']){logger[_0x216c('0x7')](_0x216c('0x8'),_0x2ec31e,_[_0x216c('0x9')](_0x39c90f,_0x216c('0xa'))[_0x216c('0xb')](',\x20'));logger[_0x216c('0xc')](_0x216c('0xd'),_0x2ec31e);_0x6c7b66[_0x216c('0xe')]();}else{var _0x3a8131=this;var _0x5662ea=utils[_0x216c('0xf')](_0xe9a368[0x0],this);logger[_0x216c('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x2ec31e,_0x5662ea);sh[_0x216c('0x10')](_[_0x216c('0x11')](_0x5662ea),function(_0x222b76,_0x20e646){logger[_0x216c('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2ec31e,_0x222b76);if(_0x222b76==0x0){var _0x2b1c9a=_0x20e646[_0x216c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x216c('0x13')](_0xe9a368[0x1])||_[_0x216c('0x14')](_0xe9a368[0x1])){logger[_0x216c('0xc')](_0x216c('0x15'),_0x2ec31e);_0x3a8131[_0x216c('0x16')][_0xe9a368[0x1]]=_0x2b1c9a;}else{logger['info'](_0x216c('0x17'),_0x2ec31e,_0xe9a368[0x1],_0x2b1c9a);_0x3a8131[_0x216c('0x16')][_0xe9a368[0x1]]=_0x2b1c9a;}}_0x6c7b66[_0x216c('0xe')]();});}}catch(_0x3dd7af){logger['error'](_0x216c('0x8'),_0x2ec31e,_[_0x216c('0x18')](_0x3dd7af)?JSON[_0x216c('0x19')](_0x3dd7af):_0x3dd7af);logger[_0x216c('0xc')](_0x216c('0xd'),_0x2ec31e);_0x6c7b66[_0x216c('0xe')]();}};}; \ 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 1add221..9a6b27a 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 _0x7f77=['[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x7f77,0x143));var _0x77f7=function(_0x2b2f86,_0x387bd9){_0x2b2f86=_0x2b2f86-0x0;var _0x78e050=_0x7f77[_0x2b2f86];return _0x78e050;};'use strict';var schema=require(_0x77f7('0x0'));var _=require(_0x77f7('0x1'));var rpc={'chatInteraction':require(_0x77f7('0x2')),'openchannelInteraction':require(_0x77f7('0x3')),'smsInteraction':require(_0x77f7('0x4')),'mailInteraction':require(_0x77f7('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x77f7('0x6'))};var logger=require(_0x77f7('0x7'))(_0x77f7('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x77f7('0x9')}});exports[_0x77f7('0xa')]=function(_0x2cba0a,_0x198eec,_0x2322b5,_0x9316a8){return function(_0x18ed08){try{var _0x993541={'tag':_0x198eec[0x0]};var _0x3078e6=tag['validate'](_0x993541,{'typecast':!![]});if(_0x3078e6[_0x77f7('0xb')]){logger[_0x77f7('0xc')](_0x77f7('0xd'),_0x2cba0a,_[_0x77f7('0xe')](_0x3078e6,_0x77f7('0xf'))[_0x77f7('0x10')](',\x20'));logger[_0x77f7('0x11')](_0x77f7('0x12'),_0x2cba0a);_0x18ed08[_0x77f7('0x13')]();}else{var _0x49fa3b={'ids':[_0x198eec[0x0]]};if(rpc[_0x9316a8[_0x77f7('0x14')]+_0x77f7('0x15')]){rpc[_0x9316a8['channel']+_0x77f7('0x15')]['addTags'](_0x9316a8['interaction']['id'],_0x49fa3b)[_0x77f7('0x16')](function(_0x55ce96){logger[_0x77f7('0x11')](_0x77f7('0x17'),_0x2cba0a,_0x198eec[0x1],_0x9316a8['channel'],_0x9316a8[_0x77f7('0x18')]['id']);})[_0x77f7('0x19')](function(_0x187866){logger['error'](_0x77f7('0xd'),_0x2cba0a,JSON[_0x77f7('0x1a')](_0x187866));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2cba0a);})['finally'](function(){_0x18ed08['next']();});}}}catch(_0x3d0cb3){logger[_0x77f7('0xc')](_0x77f7('0xd'),_0x2cba0a,_[_0x77f7('0x1b')](_0x3d0cb3)?JSON['stringify'](_0x3d0cb3):_0x3d0cb3);logger[_0x77f7('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2cba0a);_0x18ed08[_0x77f7('0x13')]();}};}; \ No newline at end of file +var _0x6fe8=['map','join','info','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s'];(function(_0x36e8d8,_0x3fd853){var _0x1bba4f=function(_0x82d025){while(--_0x82d025){_0x36e8d8['push'](_0x36e8d8['shift']());}};_0x1bba4f(++_0x3fd853);}(_0x6fe8,0xb6));var _0x86fe=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x6fe8[_0x26b622];return _0x58a028;};'use strict';var schema=require(_0x86fe('0x0'));var _=require(_0x86fe('0x1'));var rpc={'chatInteraction':require(_0x86fe('0x2')),'openchannelInteraction':require(_0x86fe('0x3')),'smsInteraction':require(_0x86fe('0x4')),'mailInteraction':require(_0x86fe('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x86fe('0x6'))};var logger=require(_0x86fe('0x7'))('routing');var tag=schema({'tag':{'type':_0x86fe('0x8'),'required':!![],'message':_0x86fe('0x9')}});exports[_0x86fe('0xa')]=function(_0x1fcdf9,_0x5339a6,_0x4c2da3,_0x5187d0){return function(_0x394417){try{var _0x5aa0d6={'tag':_0x5339a6[0x0]};var _0x2a8f9d=tag['validate'](_0x5aa0d6,{'typecast':!![]});if(_0x2a8f9d[_0x86fe('0xb')]){logger[_0x86fe('0xc')](_0x86fe('0xd'),_0x1fcdf9,_[_0x86fe('0xe')](_0x2a8f9d,'message')[_0x86fe('0xf')](',\x20'));logger[_0x86fe('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1fcdf9);_0x394417['next']();}else{var _0xcb4266={'ids':[_0x5339a6[0x0]]};if(rpc[_0x5187d0[_0x86fe('0x11')]+_0x86fe('0x12')]){rpc[_0x5187d0[_0x86fe('0x11')]+_0x86fe('0x12')][_0x86fe('0x13')](_0x5187d0[_0x86fe('0x14')]['id'],_0xcb4266)[_0x86fe('0x15')](function(_0x482700){logger[_0x86fe('0x10')](_0x86fe('0x16'),_0x1fcdf9,_0x5339a6[0x1],_0x5187d0[_0x86fe('0x11')],_0x5187d0[_0x86fe('0x14')]['id']);})[_0x86fe('0x17')](function(_0x209b65){logger[_0x86fe('0xc')](_0x86fe('0xd'),_0x1fcdf9,JSON[_0x86fe('0x18')](_0x209b65));logger[_0x86fe('0x10')](_0x86fe('0x19'),_0x1fcdf9);})['finally'](function(){_0x394417['next']();});}}}catch(_0x2eb262){logger[_0x86fe('0xc')](_0x86fe('0xd'),_0x1fcdf9,_[_0x86fe('0x1a')](_0x2eb262)?JSON[_0x86fe('0x18')](_0x2eb262):_0x2eb262);logger[_0x86fe('0x10')](_0x86fe('0x19'),_0x1fcdf9);_0x394417[_0x86fe('0x1b')]();}};}; \ 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 720dee1..6516d9e 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(_0x21f584,_0x7d51a2){var _0x1d4759=function(_0x2f929c){while(--_0x2f929c){_0x21f584['push'](_0x21f584['shift']());}};_0x1d4759(++_0x7d51a2);}(_0xe706,0xa3));var _0x6e70=function(_0x535d2e,_0x5392e1){_0x535d2e=_0x535d2e-0x0;var _0x1bdca5=_0xe706[_0x535d2e];return _0x1bdca5;};'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(_0x4de6a3,_0x182310){var _0x1222d9=function(_0x222e8d){while(--_0x222e8d){_0x4de6a3['push'](_0x4de6a3['shift']());}};_0x1222d9(++_0x182310);}(_0xe706,0xa3));var _0x6e70=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0xe706[_0x2ddd52];return _0x4bb4ec;};'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 5cdcbde..9476cab 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 _0xd30a=['routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','length','dialogflow','amazonlex','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','emit','complete','stack'];(function(_0x217f1b,_0x266576){var _0x24e533=function(_0x5085f7){while(--_0x5085f7){_0x217f1b['push'](_0x217f1b['shift']());}};_0x24e533(++_0x266576);}(_0xd30a,0x19d));var _0xad30=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xd30a[_0x363ef8];return _0x148822;};'use strict';var _=require(_0xad30('0x0'));var util=require('util');var path=require(_0xad30('0x1'));var fs=require('fs');var jayson=require(_0xad30('0x2'));var BPromise=require('bluebird');var uuid=require(_0xad30('0x3'));var config=require(_0xad30('0x4'));var logger=require(_0xad30('0x5'))(_0xad30('0x6'));var rpc={'openchannelQueueReport':require(_0xad30('0x7')),'mailQueueReport':require(_0xad30('0x8')),'chatQueueReport':require(_0xad30('0x9')),'smsQueueReport':require(_0xad30('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xad30('0xb'))};var RuleEngine=require(_0xad30('0xc'));function getId(_0x1493da,_0x20ac8b,_0x53e6fe){return util[_0xad30('0xd')](_0xad30('0xe'),_0x1493da,_0x20ac8b||0x0,_0x53e6fe||0x0);}function getIntervals(_0x384583,_0x5a0276){var _0x9b6173=[];if(!_[_0xad30('0xf')](_0x5a0276['IntervalId'])&&!_[_0xad30('0xf')](_0x384583[_0x5a0276[_0xad30('0x10')]])&&!_[_0xad30('0xf')](_0x384583[_0x5a0276[_0xad30('0x10')]][_0xad30('0x11')])){_0x9b6173=_[_0xad30('0x12')](_0x384583[_0x5a0276[_0xad30('0x10')]][_0xad30('0x11')],_0xad30('0x13'));}else if(!_[_0xad30('0xf')](_0x5a0276['interval'])){_0x9b6173=[_0x5a0276[_0xad30('0x13')]];}return _0x9b6173;}exports[_0xad30('0x14')]=function(_0x5a34d2){_0x5a34d2[_0xad30('0x15')]={};return new BPromise(function(_0x3ed899,_0x20521c){var _0x59b80e={'Start':function(_0x3524f4){var _0x37ca1f=this;return new Promise(function(_0xa76f80,_0x29c45d){if(_0x3524f4){try{var _0x1f5ed6=[];var _0x389b89=getId(_0x3524f4[_0xad30('0x16')],_0x3524f4[_0xad30('0x17')]?_0x3524f4[_0xad30('0x17')]['id']:0x0,_0x3524f4[_0xad30('0x18')]?_0x3524f4[_0xad30('0x18')]['id']:0x0);if(_0x3524f4[_0xad30('0x19')]&&_[_0xad30('0x1a')](_0x3524f4['applications'])&&_0x3524f4[_0xad30('0x19')]['length']){for(var _0x1ac36e=0x0;_0x1ac36e<_0x3524f4[_0xad30('0x19')]['length'];_0x1ac36e+=0x1){var _0x7c2dba=_0x3524f4[_0xad30('0x19')][_0x1ac36e];if(fs[_0xad30('0x1b')](path[_0xad30('0x1c')](__dirname,'applications',_0x7c2dba[_0xad30('0x1d')]+_0xad30('0x1e')))){var _0x301fca=[];switch(_0x7c2dba[_0xad30('0x1d')][_0xad30('0x1f')]()){case'autoreply':var _0x271872=_0x7c2dba[_0xad30('0x20')][_0xad30('0x21')](',');if(_0x3524f4[_0xad30('0x16')]===_0xad30('0x22')){_0x301fca[_0xad30('0x23')](_0x271872[0x0]);_0x301fca['push'](_0x271872[0x1]);_0x301fca['push'](_0x271872['slice'](0x2,_0x271872['length'])[_0xad30('0x1c')](','));}else{_0x301fca[_0xad30('0x23')](_0x271872[0x0]);_0x301fca[_0xad30('0x23')](_0x271872[_0xad30('0x24')](0x1,_0x271872[_0xad30('0x25')])['join'](','));}break;case _0xad30('0x26'):var _0x127f08=_0x7c2dba['appdata'][_0xad30('0x21')](',');_0x301fca[_0xad30('0x23')](_0x127f08[0x0]);_0x301fca[_0xad30('0x23')](_0x127f08[0x1]);_0x301fca[_0xad30('0x23')](_0x127f08[_0xad30('0x24')](0x2,_0x127f08[_0xad30('0x25')])['join'](','));break;case'dialogflowv2':var _0x34c3b1=_0x7c2dba['appdata'][_0xad30('0x21')](',');_0x301fca[_0xad30('0x23')](_0x34c3b1[0x0]);_0x301fca[_0xad30('0x23')](_0x34c3b1[0x1]);_0x301fca[_0xad30('0x23')](_0x34c3b1[0x2]);_0x301fca[_0xad30('0x23')](_0x34c3b1[0x3]);_0x301fca['push'](_0x34c3b1[_0xad30('0x24')](0x4,_0x34c3b1[_0xad30('0x25')])[_0xad30('0x1c')](','));break;case _0xad30('0x27'):var _0x17cc1a=_0x7c2dba[_0xad30('0x20')][_0xad30('0x21')](',');_0x301fca['push'](_0x17cc1a[0x0]);_0x301fca[_0xad30('0x23')](_0x17cc1a[0x1]);_0x301fca[_0xad30('0x23')](_0x17cc1a[0x2]);_0x301fca['push'](_0x17cc1a[0x3]);_0x301fca[_0xad30('0x23')](_0x17cc1a[_0xad30('0x24')](0x4,_0x17cc1a[_0xad30('0x25')])[_0xad30('0x1c')](','));break;case _0xad30('0x17'):_0x301fca['push'](_0x7c2dba[_0xad30('0x20')]);break;case'tag':_0x301fca[_0xad30('0x23')](_0x7c2dba['TagId']);_0x301fca[_0xad30('0x23')](_0x7c2dba[_0xad30('0x20')]);break;default:_0x301fca=_[_0xad30('0xf')](_0x7c2dba[_0xad30('0x20')])?[]:_0x7c2dba[_0xad30('0x20')]['split'](',');}var _0x4d0815={'id':util[_0xad30('0xd')](_0xad30('0x28'),_0x389b89,_0x7c2dba['id'],_0x7c2dba['app']),'condition':require(_0xad30('0x29'))[_0xad30('0x2a')](_0x389b89,getIntervals(_0x5a34d2[_0xad30('0x2b')],_0x7c2dba),_0x5a34d2),'consequence':require(_0xad30('0x2c')+_0x7c2dba[_0xad30('0x1d')])[_0xad30('0x2d')](_0x389b89,_0x301fca,_0x5a34d2,_0x3524f4),'p':_0x7c2dba['priority']||0x0};logger['info'](_0xad30('0x2e'),_0x4d0815['id'],_0xad30('0x2f'),getIntervals(_0x5a34d2[_0xad30('0x2b')],_0x7c2dba)['join'](_0xad30('0x30')));_0x1f5ed6[_0xad30('0x23')](_0x4d0815);}else{logger[_0xad30('0x31')](_0xad30('0x32'),path[_0xad30('0x1c')](__dirname,'applications',_0x7c2dba[_0xad30('0x1d')]+'.js'));}}_0x5a34d2['rules'][_0x389b89]=new RuleEngine(_0x1f5ed6);_0x5a34d2[_0xad30('0x15')][_0x389b89][_0xad30('0x33')](_0x3524f4,function(_0xf77f66){logger[_0xad30('0x34')]('Applications\x20executed',JSON[_0xad30('0x35')](_0xf77f66['matchPath']));if(_0x5a34d2[_0xad30('0x15')][_0x389b89]){_0x5a34d2[_0xad30('0x15')][_0x389b89][_0xad30('0x36')](_0xad30('0x37'));}});return _0xa76f80({'code':0xc8,'message':_0x3524f4});}else{logger[_0xad30('0x34')]('No\x20applications\x20to\x20execute');return _0xa76f80({'code':0xc8,'message':_0x3524f4});}}catch(_0x4a77ca){logger[_0xad30('0x31')](_0x4a77ca[_0xad30('0x38')]);return _0x29c45d(_0x37ca1f['error'](0x1f4,_0x4a77ca));}}return _0x29c45d(_0xad30('0x39'));});},'AcceptMessage':function(_0x5af8b5){var _0x3b8bc9=this;return new Promise(function(_0x58ff44,_0x172c83){if(_0x5af8b5[_0xad30('0x3a')]&&_0x5af8b5[_0xad30('0x3a')]['id']){if(_0x5a34d2[_0xad30('0x3b')][_0x5af8b5['agent']['id']]){_0x5a34d2['agents'][_0x5af8b5[_0xad30('0x3a')]['id']][_0xad30('0x3c')]=![];_0x5a34d2[_0xad30('0x3b')][_0x5af8b5['agent']['id']][_0xad30('0x3d')]=undefined;}}if(_0x5af8b5[_0xad30('0x17')]&&_0x5af8b5[_0xad30('0x17')]['id']){try{var _0x44e81d=getId(_0x5af8b5[_0xad30('0x16')],_0x5af8b5[_0xad30('0x17')]?_0x5af8b5[_0xad30('0x17')]['id']:0x0,_0x5af8b5[_0xad30('0x18')]?_0x5af8b5[_0xad30('0x18')]['id']:0x0);if(_0x5a34d2['rules'][_0x44e81d]){_0x5a34d2[_0xad30('0x15')][_0x44e81d][_0xad30('0x36')](_0xad30('0x3e'));if(rpc[_0x5af8b5[_0xad30('0x16')]+_0xad30('0x3f')]){rpc[_0x5af8b5[_0xad30('0x16')]+'QueueReport'][_0xad30('0x40')](_0x44e81d,{'UserId':_0x5af8b5[_0xad30('0x17')][_0xad30('0x41')]})[_0xad30('0x42')](function(_0x203be2){logger[_0xad30('0x31')](_0xad30('0x43'));});}}return _0x58ff44({'code':0xc8,'message':_0x5af8b5});}catch(_0x485dd1){logger[_0xad30('0x31')](_0x485dd1[_0xad30('0x38')]);return _0x172c83(_0x3b8bc9[_0xad30('0x31')](0x1f4,_0x485dd1));}}logger[_0xad30('0x31')]('message\x20is\x20empty');return _0x172c83(_0x3b8bc9['error'](0x1f4,_0xad30('0x44')));});},'RejectMessage':function(_0x4c3bec){var _0x10ad2b=this;return new Promise(function(_0x1e9896,_0x3f73bb){if(_0x4c3bec[_0xad30('0x3a')]&&_0x4c3bec[_0xad30('0x3a')]['id']){try{if(_0x5a34d2[_0xad30('0x3b')][_0x4c3bec[_0xad30('0x3a')]['id']]){_0x5a34d2['agents'][_0x4c3bec[_0xad30('0x3a')]['id']][_0xad30('0x3c')]=![];_0x5a34d2[_0xad30('0x3b')][_0x4c3bec[_0xad30('0x3a')]['id']][_0xad30('0x3d')]=undefined;}return _0x1e9896({'code':0xc8,'message':_0x4c3bec});}catch(_0x6e70a1){logger[_0xad30('0x31')](_0x6e70a1[_0xad30('0x38')]);return _0x3f73bb(_0x10ad2b[_0xad30('0x31')](0x1f4,_0x6e70a1));}}logger[_0xad30('0x31')](_0xad30('0x44'));return _0x3f73bb(_0x10ad2b[_0xad30('0x31')](0x1f4,_0xad30('0x44')));});},'AbandonInteraction':function(_0xa7903f){var _0x227574=this;return new Promise(function(_0x1a5c36,_0x33c290){if(_0xa7903f['channel']&&_0xa7903f['interaction']&&_0xa7903f[_0xad30('0x18')]['id']){try{var _0x449e90=getId(_0xa7903f[_0xad30('0x16')],_0xa7903f['message']?_0xa7903f['message']['id']:0x0,_0xa7903f[_0xad30('0x18')]?_0xa7903f[_0xad30('0x18')]['id']:0x0);if(_0x5a34d2[_0xad30('0x15')][_0x449e90]){_0x5a34d2[_0xad30('0x15')][_0x449e90]['emit']('end');}return _0x1a5c36({'code':0xc8,'message':_0xa7903f});}catch(_0x2b3b95){logger[_0xad30('0x31')](_0x2b3b95['stack']);return _0x33c290(_0x227574['error'](0x1f4,_0x2b3b95));}}logger[_0xad30('0x31')](_0xad30('0x44'));return _0x33c290(_0x227574[_0xad30('0x31')](0x1f4,_0xad30('0x44')));});},'AgentCapacity':function(_0x28401b){var _0x302d93=this;return new Promise(function(_0x1f1d68,_0x37a206){if(_0x5a34d2[_0xad30('0x3b')][_0xad30('0x45')](_0x28401b['id'])){for(var _0x51e98a in _0x28401b['capacity']){if(_0x28401b[_0xad30('0x46')][_0xad30('0x45')](_0x51e98a)){if(_0x5a34d2[_0xad30('0x3b')][_0x28401b['id']][_0xad30('0x45')](_0x51e98a+_0xad30('0x47'))){_0x5a34d2[_0xad30('0x3b')][_0x28401b['id']][_0x51e98a+_0xad30('0x47')]=parseInt(_0x28401b['capacity'][_0x51e98a],0xa);}}}_0x5a34d2[_0xad30('0x3b')][_0x28401b['id']][_0xad30('0x48')]();return _0x1f1d68({'code':0xc8,'message':_0x5a34d2['agents'][_0x28401b['id']]});}else{return _0x37a206(_0x302d93[_0xad30('0x31')](0x1f4,_0xad30('0x49')));}});},'Agents':function(_0x3369cb){return new Promise(function(_0x2fd6a9,_0xb1b780){var _0x5a2061=_['values'](_0x5a34d2[_0xad30('0x3b')]);_0x2fd6a9({'count':_0x5a2061['length'],'rows':_0x5a2061});});},'ChatQueues':function(_0x170fc1){return new Promise(function(_0x7a3f93,_0x44fcb1){var _0x1e187e=[];for(var _0x5cf4c9 in _0x5a34d2[_0xad30('0x4a')]){if(_0x5a34d2[_0xad30('0x4a')][_0xad30('0x45')](_0x5cf4c9)){var _0x390287=_0x5a34d2[_0xad30('0x4a')][_0x5cf4c9];var _0x24b7a0={'id':_0x390287['id'],'available':_0x390287[_0xad30('0x4b')],'loggedIn':_0x390287[_0xad30('0x4c')],'name':_0x390287[_0xad30('0x4d')],'paused':_0x390287[_0xad30('0x4e')],'waiting':_0x390287[_0xad30('0x4f')]};_0x1e187e[_0xad30('0x23')](_0x24b7a0);}}_0x7a3f93({'count':_0x1e187e[_0xad30('0x25')],'rows':_0x1e187e});});},'MailQueues':function(_0x206d22){return new Promise(function(_0x229186,_0x127f9d){var _0x554fb7=[];for(var _0x5b3eb8 in _0x5a34d2[_0xad30('0x50')]){if(_0x5a34d2[_0xad30('0x50')][_0xad30('0x45')](_0x5b3eb8)){var _0x4e60d7=_0x5a34d2[_0xad30('0x50')][_0x5b3eb8];var _0x5aa89d={'id':_0x4e60d7['id'],'available':_0x4e60d7['available'],'loggedIn':_0x4e60d7[_0xad30('0x4c')],'name':_0x4e60d7['name'],'paused':_0x4e60d7[_0xad30('0x4e')],'waiting':_0x4e60d7[_0xad30('0x4f')]};_0x554fb7[_0xad30('0x23')](_0x5aa89d);}}_0x229186({'count':_0x554fb7[_0xad30('0x25')],'rows':_0x554fb7});});},'OpenchannelQueues':function(_0x188f0a){return new Promise(function(_0x1d9c87,_0x32249a){var _0x4efaa3=[];for(var _0x3320ad in _0x5a34d2[_0xad30('0x51')]){if(_0x5a34d2[_0xad30('0x51')][_0xad30('0x45')](_0x3320ad)){var _0x31e6c6=_0x5a34d2[_0xad30('0x51')][_0x3320ad];var _0x5f54af={'id':_0x31e6c6['id'],'available':_0x31e6c6['available'],'loggedIn':_0x31e6c6[_0xad30('0x4c')],'name':_0x31e6c6['name'],'paused':_0x31e6c6[_0xad30('0x4e')],'waiting':_0x31e6c6[_0xad30('0x4f')]};_0x4efaa3[_0xad30('0x23')](_0x5f54af);}}_0x1d9c87({'count':_0x4efaa3['length'],'rows':_0x4efaa3});});},'SmsQueues':function(_0x3950c0){return new Promise(function(_0x226eb5,_0x2fdfa0){var _0x51c65a=[];for(var _0x2b30ec in _0x5a34d2[_0xad30('0x52')]){if(_0x5a34d2[_0xad30('0x52')]['hasOwnProperty'](_0x2b30ec)){var _0x37431a=_0x5a34d2['smsQueues'][_0x2b30ec];var _0x56cc9e={'id':_0x37431a['id'],'available':_0x37431a[_0xad30('0x4b')],'loggedIn':_0x37431a[_0xad30('0x4c')],'name':_0x37431a[_0xad30('0x4d')],'paused':_0x37431a[_0xad30('0x4e')],'waiting':_0x37431a['waiting']};_0x51c65a[_0xad30('0x23')](_0x56cc9e);}}_0x226eb5({'count':_0x51c65a[_0xad30('0x25')],'rows':_0x51c65a});});},'FaxQueues':function(_0x4fd892){return new Promise(function(_0x556399,_0x528b0b){var _0x17ea19=[];for(var _0x524346 in _0x5a34d2[_0xad30('0x53')]){if(_0x5a34d2[_0xad30('0x53')]['hasOwnProperty'](_0x524346)){var _0x1d4fce=_0x5a34d2[_0xad30('0x53')][_0x524346];var _0x5ea2c3={'id':_0x1d4fce['id'],'available':_0x1d4fce[_0xad30('0x4b')],'loggedIn':_0x1d4fce[_0xad30('0x4c')],'name':_0x1d4fce[_0xad30('0x4d')],'paused':_0x1d4fce['paused'],'waiting':_0x1d4fce[_0xad30('0x4f')]};_0x17ea19[_0xad30('0x23')](_0x5ea2c3);}}_0x556399({'count':_0x17ea19[_0xad30('0x25')],'rows':_0x17ea19});});},'WhatsappQueues':function(_0x3b9d38){return new Promise(function(_0x5a282a,_0x384f4e){var _0x32c107=[];for(var _0x1bb453 in _0x5a34d2[_0xad30('0x54')]){if(_0x5a34d2[_0xad30('0x54')][_0xad30('0x45')](_0x1bb453)){var _0xed8bb9=_0x5a34d2[_0xad30('0x54')][_0x1bb453];var _0x1210b6={'id':_0xed8bb9['id'],'available':_0xed8bb9[_0xad30('0x4b')],'loggedIn':_0xed8bb9['loggedIn'],'name':_0xed8bb9['name'],'paused':_0xed8bb9['paused'],'waiting':_0xed8bb9[_0xad30('0x4f')]};_0x32c107['push'](_0x1210b6);}}_0x5a282a({'count':_0x32c107[_0xad30('0x25')],'rows':_0x32c107});});},'ChatQueuesWaitingInteractions':function(_0x41a76c){return new Promise(function(_0x2b75e6,_0x233a1e){var _0x22442b=_[_0xad30('0x55')](_0x5a34d2[_0xad30('0x56')]);_0x2b75e6({'count':_0x22442b[_0xad30('0x25')],'rows':_0x22442b});});},'MailQueuesWaitingInteractions':function(_0xedf817){return new Promise(function(_0x259030,_0x167800){var _0xe10adb=_[_0xad30('0x55')](_0x5a34d2[_0xad30('0x57')]);_0x259030({'count':_0xe10adb[_0xad30('0x25')],'rows':_0xe10adb});});},'OpenchannelQueuesWaitingInteractions':function(_0x20ae17){return new Promise(function(_0x1a9130,_0x1b14e2){var _0x4ff4f2=_[_0xad30('0x55')](_0x5a34d2['openchannelQueuesWaitingInteractions']);_0x1a9130({'count':_0x4ff4f2[_0xad30('0x25')],'rows':_0x4ff4f2});});},'SmsQueuesWaitingInteractions':function(_0xc32255){return new Promise(function(_0x3f52bc,_0x113858){var _0x1adbfd=_[_0xad30('0x55')](_0x5a34d2[_0xad30('0x58')]);_0x3f52bc({'count':_0x1adbfd[_0xad30('0x25')],'rows':_0x1adbfd});});},'FaxQueuesWaitingInteractions':function(_0x672107){return new Promise(function(_0x5686bd,_0x5e30a8){var _0x10ef91=_[_0xad30('0x55')](_0x5a34d2[_0xad30('0x59')]);_0x5686bd({'count':_0x10ef91[_0xad30('0x25')],'rows':_0x10ef91});});},'WhatsappQueuesWaitingInteractions':function(_0x1da107){return new Promise(function(_0x447457,_0x4b1555){var _0x21ad00=_['values'](_0x5a34d2[_0xad30('0x5a')]);_0x447457({'count':_0x21ad00[_0xad30('0x25')],'rows':_0x21ad00});});}};var _0x616217=jayson['server'](_0x59b80e)[_0xad30('0x5b')]();_0x616217['on'](_0xad30('0x31'),function(_0x51faf9){logger[_0xad30('0x31')](JSON[_0xad30('0x35')](_0x51faf9));return _0x20521c(_0x51faf9);});_0x616217[_0xad30('0x14')](0x232c,_0xad30('0x5c'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x3ed899(_0xad30('0x5d')+0x232c);});});}; \ No newline at end of file +var _0xfbe2=['agent\x20not\x20found','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','isArray','applications','length','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','consequence','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity'];(function(_0x133156,_0x109b02){var _0xb6d904=function(_0x2dc8ba){while(--_0x2dc8ba){_0x133156['push'](_0x133156['shift']());}};_0xb6d904(++_0x109b02);}(_0xfbe2,0x18f));var _0x2fbe=function(_0x3a263d,_0x3452b9){_0x3a263d=_0x3a263d-0x0;var _0x26f847=_0xfbe2[_0x3a263d];return _0x26f847;};'use strict';var _=require(_0x2fbe('0x0'));var util=require('util');var path=require(_0x2fbe('0x1'));var fs=require('fs');var jayson=require(_0x2fbe('0x2'));var BPromise=require(_0x2fbe('0x3'));var uuid=require(_0x2fbe('0x4'));var config=require('../../../config/environment');var logger=require(_0x2fbe('0x5'))(_0x2fbe('0x6'));var rpc={'openchannelQueueReport':require(_0x2fbe('0x7')),'mailQueueReport':require(_0x2fbe('0x8')),'chatQueueReport':require(_0x2fbe('0x9')),'smsQueueReport':require(_0x2fbe('0xa')),'faxQueueReport':require(_0x2fbe('0xb')),'whatsappQueueReport':require(_0x2fbe('0xc'))};var RuleEngine=require(_0x2fbe('0xd'));function getId(_0x2c0881,_0x2b6d78,_0xf1955d){return util[_0x2fbe('0xe')](_0x2fbe('0xf'),_0x2c0881,_0x2b6d78||0x0,_0xf1955d||0x0);}function getIntervals(_0x5e0d62,_0xcc767a){var _0x21689c=[];if(!_['isNil'](_0xcc767a[_0x2fbe('0x10')])&&!_['isNil'](_0x5e0d62[_0xcc767a[_0x2fbe('0x10')]])&&!_[_0x2fbe('0x11')](_0x5e0d62[_0xcc767a[_0x2fbe('0x10')]][_0x2fbe('0x12')])){_0x21689c=_[_0x2fbe('0x13')](_0x5e0d62[_0xcc767a['IntervalId']]['Intervals'],_0x2fbe('0x14'));}else if(!_[_0x2fbe('0x11')](_0xcc767a[_0x2fbe('0x14')])){_0x21689c=[_0xcc767a['interval']];}return _0x21689c;}exports[_0x2fbe('0x15')]=function(_0x1af815){_0x1af815[_0x2fbe('0x16')]={};return new BPromise(function(_0x2bfe9f,_0xa5c1b8){var _0xdda617={'Start':function(_0x5b4ff1){var _0xa4c642=this;return new Promise(function(_0x7f651c,_0x3222af){if(_0x5b4ff1){try{var _0x13f97e=[];var _0x3772d7=getId(_0x5b4ff1[_0x2fbe('0x17')],_0x5b4ff1[_0x2fbe('0x18')]?_0x5b4ff1[_0x2fbe('0x18')]['id']:0x0,_0x5b4ff1[_0x2fbe('0x19')]?_0x5b4ff1[_0x2fbe('0x19')]['id']:0x0);if(_0x5b4ff1['applications']&&_[_0x2fbe('0x1a')](_0x5b4ff1[_0x2fbe('0x1b')])&&_0x5b4ff1[_0x2fbe('0x1b')][_0x2fbe('0x1c')]){for(var _0x25fdac=0x0;_0x25fdac<_0x5b4ff1[_0x2fbe('0x1b')][_0x2fbe('0x1c')];_0x25fdac+=0x1){var _0x5baff0=_0x5b4ff1[_0x2fbe('0x1b')][_0x25fdac];if(fs['existsSync'](path[_0x2fbe('0x1d')](__dirname,'applications',_0x5baff0['app']+_0x2fbe('0x1e')))){var _0x14a73f=[];switch(_0x5baff0[_0x2fbe('0x1f')][_0x2fbe('0x20')]()){case _0x2fbe('0x21'):var _0x3959fd=_0x5baff0[_0x2fbe('0x22')][_0x2fbe('0x23')](',');if(_0x5b4ff1[_0x2fbe('0x17')]===_0x2fbe('0x24')){_0x14a73f[_0x2fbe('0x25')](_0x3959fd[0x0]);_0x14a73f[_0x2fbe('0x25')](_0x3959fd[0x1]);_0x14a73f[_0x2fbe('0x25')](_0x3959fd[_0x2fbe('0x26')](0x2,_0x3959fd[_0x2fbe('0x1c')])['join'](','));}else{_0x14a73f[_0x2fbe('0x25')](_0x3959fd[0x0]);_0x14a73f[_0x2fbe('0x25')](_0x3959fd[_0x2fbe('0x26')](0x1,_0x3959fd[_0x2fbe('0x1c')])[_0x2fbe('0x1d')](','));}break;case _0x2fbe('0x27'):var _0x2239e6=_0x5baff0['appdata'][_0x2fbe('0x23')](',');_0x14a73f['push'](_0x2239e6[0x0]);_0x14a73f[_0x2fbe('0x25')](_0x2239e6[0x1]);_0x14a73f[_0x2fbe('0x25')](_0x2239e6[_0x2fbe('0x26')](0x2,_0x2239e6['length'])[_0x2fbe('0x1d')](','));break;case'dialogflowv2':var _0x4bd501=_0x5baff0[_0x2fbe('0x22')][_0x2fbe('0x23')](',');_0x14a73f[_0x2fbe('0x25')](_0x4bd501[0x0]);_0x14a73f[_0x2fbe('0x25')](_0x4bd501[0x1]);_0x14a73f[_0x2fbe('0x25')](_0x4bd501[0x2]);_0x14a73f[_0x2fbe('0x25')](_0x4bd501[0x3]);_0x14a73f[_0x2fbe('0x25')](_0x4bd501[_0x2fbe('0x26')](0x4,_0x4bd501[_0x2fbe('0x1c')])[_0x2fbe('0x1d')](','));break;case _0x2fbe('0x28'):var _0x527f93=_0x5baff0[_0x2fbe('0x22')][_0x2fbe('0x23')](',');_0x14a73f['push'](_0x527f93[0x0]);_0x14a73f[_0x2fbe('0x25')](_0x527f93[0x1]);_0x14a73f[_0x2fbe('0x25')](_0x527f93[0x2]);_0x14a73f[_0x2fbe('0x25')](_0x527f93[0x3]);_0x14a73f[_0x2fbe('0x25')](_0x527f93[_0x2fbe('0x26')](0x4,_0x527f93['length'])[_0x2fbe('0x1d')](','));break;case _0x2fbe('0x18'):_0x14a73f[_0x2fbe('0x25')](_0x5baff0['appdata']);break;case _0x2fbe('0x29'):_0x14a73f['push'](_0x5baff0[_0x2fbe('0x2a')]);_0x14a73f[_0x2fbe('0x25')](_0x5baff0[_0x2fbe('0x22')]);break;default:_0x14a73f=_[_0x2fbe('0x11')](_0x5baff0[_0x2fbe('0x22')])?[]:_0x5baff0[_0x2fbe('0x22')][_0x2fbe('0x23')](',');}var _0x7ce15={'id':util[_0x2fbe('0xe')](_0x2fbe('0x2b'),_0x3772d7,_0x5baff0['id'],_0x5baff0['app']),'condition':require(_0x2fbe('0x2c'))['condition'](_0x3772d7,getIntervals(_0x1af815[_0x2fbe('0x2d')],_0x5baff0),_0x1af815),'consequence':require('./applications/'+_0x5baff0[_0x2fbe('0x1f')])[_0x2fbe('0x2e')](_0x3772d7,_0x14a73f,_0x1af815,_0x5b4ff1),'p':_0x5baff0['priority']||0x0};logger['info'](_0x2fbe('0x2f'),_0x7ce15['id'],'on\x20interval',getIntervals(_0x1af815[_0x2fbe('0x2d')],_0x5baff0)[_0x2fbe('0x1d')]('\x20|\x20'));_0x13f97e[_0x2fbe('0x25')](_0x7ce15);}else{logger[_0x2fbe('0x30')](_0x2fbe('0x31'),path[_0x2fbe('0x1d')](__dirname,_0x2fbe('0x1b'),_0x5baff0[_0x2fbe('0x1f')]+_0x2fbe('0x1e')));}}_0x1af815[_0x2fbe('0x16')][_0x3772d7]=new RuleEngine(_0x13f97e);_0x1af815[_0x2fbe('0x16')][_0x3772d7][_0x2fbe('0x32')](_0x5b4ff1,function(_0x3d0f93){logger[_0x2fbe('0x33')](_0x2fbe('0x34'),JSON[_0x2fbe('0x35')](_0x3d0f93['matchPath']));if(_0x1af815[_0x2fbe('0x16')][_0x3772d7]){_0x1af815[_0x2fbe('0x16')][_0x3772d7][_0x2fbe('0x36')](_0x2fbe('0x37'));}});return _0x7f651c({'code':0xc8,'message':_0x5b4ff1});}else{logger['info'](_0x2fbe('0x38'));return _0x7f651c({'code':0xc8,'message':_0x5b4ff1});}}catch(_0x5e2460){logger[_0x2fbe('0x30')](_0x5e2460['stack']);return _0x3222af(_0xa4c642[_0x2fbe('0x30')](0x1f4,_0x5e2460));}}return _0x3222af(_0x2fbe('0x39'));});},'AcceptMessage':function(_0x1cae23){var _0x59676a=this;return new Promise(function(_0x56a25a,_0x4ba978){if(_0x1cae23[_0x2fbe('0x3a')]&&_0x1cae23[_0x2fbe('0x3a')]['id']){if(_0x1af815['agents'][_0x1cae23[_0x2fbe('0x3a')]['id']]){_0x1af815[_0x2fbe('0x3b')][_0x1cae23[_0x2fbe('0x3a')]['id']][_0x2fbe('0x3c')]=![];_0x1af815[_0x2fbe('0x3b')][_0x1cae23['agent']['id']][_0x2fbe('0x3d')]=undefined;}}if(_0x1cae23[_0x2fbe('0x18')]&&_0x1cae23[_0x2fbe('0x18')]['id']){try{var _0x474da1=getId(_0x1cae23[_0x2fbe('0x17')],_0x1cae23[_0x2fbe('0x18')]?_0x1cae23['message']['id']:0x0,_0x1cae23[_0x2fbe('0x19')]?_0x1cae23['interaction']['id']:0x0);if(_0x1af815[_0x2fbe('0x16')][_0x474da1]){_0x1af815[_0x2fbe('0x16')][_0x474da1][_0x2fbe('0x36')]('end');if(rpc[_0x1cae23['channel']+_0x2fbe('0x3e')]){rpc[_0x1cae23[_0x2fbe('0x17')]+_0x2fbe('0x3e')][_0x2fbe('0x3f')](_0x474da1,{'UserId':_0x1cae23['message'][_0x2fbe('0x40')]})['catch'](function(_0x34d598){logger[_0x2fbe('0x30')]('error\x20update\x20queue\x20report');});}}return _0x56a25a({'code':0xc8,'message':_0x1cae23});}catch(_0x351b19){logger[_0x2fbe('0x30')](_0x351b19[_0x2fbe('0x41')]);return _0x4ba978(_0x59676a['error'](0x1f4,_0x351b19));}}logger[_0x2fbe('0x30')](_0x2fbe('0x42'));return _0x4ba978(_0x59676a[_0x2fbe('0x30')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4c1321){var _0x509735=this;return new Promise(function(_0x2ca32a,_0x1b876f){if(_0x4c1321[_0x2fbe('0x3a')]&&_0x4c1321['agent']['id']){try{if(_0x1af815['agents'][_0x4c1321[_0x2fbe('0x3a')]['id']]){_0x1af815[_0x2fbe('0x3b')][_0x4c1321['agent']['id']][_0x2fbe('0x3c')]=![];_0x1af815[_0x2fbe('0x3b')][_0x4c1321[_0x2fbe('0x3a')]['id']][_0x2fbe('0x3d')]=undefined;}return _0x2ca32a({'code':0xc8,'message':_0x4c1321});}catch(_0x503257){logger[_0x2fbe('0x30')](_0x503257[_0x2fbe('0x41')]);return _0x1b876f(_0x509735[_0x2fbe('0x30')](0x1f4,_0x503257));}}logger[_0x2fbe('0x30')](_0x2fbe('0x42'));return _0x1b876f(_0x509735[_0x2fbe('0x30')](0x1f4,_0x2fbe('0x42')));});},'AbandonInteraction':function(_0x4bad39){var _0x55e537=this;return new Promise(function(_0x134a77,_0x4957e1){if(_0x4bad39[_0x2fbe('0x17')]&&_0x4bad39[_0x2fbe('0x19')]&&_0x4bad39['interaction']['id']){try{var _0x41c077=getId(_0x4bad39[_0x2fbe('0x17')],_0x4bad39[_0x2fbe('0x18')]?_0x4bad39[_0x2fbe('0x18')]['id']:0x0,_0x4bad39[_0x2fbe('0x19')]?_0x4bad39[_0x2fbe('0x19')]['id']:0x0);if(_0x1af815[_0x2fbe('0x16')][_0x41c077]){_0x1af815[_0x2fbe('0x16')][_0x41c077][_0x2fbe('0x36')](_0x2fbe('0x43'));}return _0x134a77({'code':0xc8,'message':_0x4bad39});}catch(_0x459bbe){logger[_0x2fbe('0x30')](_0x459bbe[_0x2fbe('0x41')]);return _0x4957e1(_0x55e537[_0x2fbe('0x30')](0x1f4,_0x459bbe));}}logger[_0x2fbe('0x30')](_0x2fbe('0x42'));return _0x4957e1(_0x55e537[_0x2fbe('0x30')](0x1f4,_0x2fbe('0x42')));});},'AgentCapacity':function(_0x58509e){var _0x263bab=this;return new Promise(function(_0x412528,_0x4a2768){if(_0x1af815['agents'][_0x2fbe('0x44')](_0x58509e['id'])){for(var _0x1259a7 in _0x58509e['capacity']){if(_0x58509e[_0x2fbe('0x45')][_0x2fbe('0x44')](_0x1259a7)){if(_0x1af815[_0x2fbe('0x3b')][_0x58509e['id']]['hasOwnProperty'](_0x1259a7+_0x2fbe('0x46'))){_0x1af815[_0x2fbe('0x3b')][_0x58509e['id']][_0x1259a7+_0x2fbe('0x46')]=parseInt(_0x58509e[_0x2fbe('0x45')][_0x1259a7],0xa);}}}_0x1af815[_0x2fbe('0x3b')][_0x58509e['id']]['updateRealtime']();return _0x412528({'code':0xc8,'message':_0x1af815[_0x2fbe('0x3b')][_0x58509e['id']]});}else{return _0x4a2768(_0x263bab[_0x2fbe('0x30')](0x1f4,_0x2fbe('0x47')));}});},'Agents':function(_0x1c22a0){return new Promise(function(_0x4489e9,_0xfcc043){var _0x4a960b=_['values'](_0x1af815['agents']);_0x4489e9({'count':_0x4a960b[_0x2fbe('0x1c')],'rows':_0x4a960b});});},'ChatQueues':function(_0x481a06){return new Promise(function(_0x13126d,_0x3e52fe){var _0x180c1b=[];for(var _0x13bf9c in _0x1af815[_0x2fbe('0x48')]){if(_0x1af815['chatQueues']['hasOwnProperty'](_0x13bf9c)){var _0x2b5c6c=_0x1af815[_0x2fbe('0x48')][_0x13bf9c];var _0x5b9752={'id':_0x2b5c6c['id'],'available':_0x2b5c6c['available'],'loggedIn':_0x2b5c6c[_0x2fbe('0x49')],'name':_0x2b5c6c[_0x2fbe('0x4a')],'paused':_0x2b5c6c[_0x2fbe('0x4b')],'waiting':_0x2b5c6c[_0x2fbe('0x4c')]};_0x180c1b[_0x2fbe('0x25')](_0x5b9752);}}_0x13126d({'count':_0x180c1b[_0x2fbe('0x1c')],'rows':_0x180c1b});});},'MailQueues':function(_0x49a3aa){return new Promise(function(_0x3f13b3,_0x2b58ba){var _0x2f4c61=[];for(var _0x52eac3 in _0x1af815[_0x2fbe('0x4d')]){if(_0x1af815['mailQueues'][_0x2fbe('0x44')](_0x52eac3)){var _0x544993=_0x1af815['mailQueues'][_0x52eac3];var _0x3ce1e6={'id':_0x544993['id'],'available':_0x544993[_0x2fbe('0x4e')],'loggedIn':_0x544993[_0x2fbe('0x49')],'name':_0x544993[_0x2fbe('0x4a')],'paused':_0x544993[_0x2fbe('0x4b')],'waiting':_0x544993[_0x2fbe('0x4c')]};_0x2f4c61['push'](_0x3ce1e6);}}_0x3f13b3({'count':_0x2f4c61[_0x2fbe('0x1c')],'rows':_0x2f4c61});});},'OpenchannelQueues':function(_0x1c1b7f){return new Promise(function(_0x3f586a,_0x57fbcf){var _0x53c098=[];for(var _0x6cd45f in _0x1af815[_0x2fbe('0x4f')]){if(_0x1af815[_0x2fbe('0x4f')][_0x2fbe('0x44')](_0x6cd45f)){var _0x4231b6=_0x1af815[_0x2fbe('0x4f')][_0x6cd45f];var _0x5b83b2={'id':_0x4231b6['id'],'available':_0x4231b6[_0x2fbe('0x4e')],'loggedIn':_0x4231b6[_0x2fbe('0x49')],'name':_0x4231b6[_0x2fbe('0x4a')],'paused':_0x4231b6[_0x2fbe('0x4b')],'waiting':_0x4231b6[_0x2fbe('0x4c')]};_0x53c098[_0x2fbe('0x25')](_0x5b83b2);}}_0x3f586a({'count':_0x53c098[_0x2fbe('0x1c')],'rows':_0x53c098});});},'SmsQueues':function(_0xa4af17){return new Promise(function(_0x58a24b,_0x16c579){var _0x1cf87d=[];for(var _0x136b3a in _0x1af815[_0x2fbe('0x50')]){if(_0x1af815[_0x2fbe('0x50')]['hasOwnProperty'](_0x136b3a)){var _0x56657d=_0x1af815[_0x2fbe('0x50')][_0x136b3a];var _0x582571={'id':_0x56657d['id'],'available':_0x56657d[_0x2fbe('0x4e')],'loggedIn':_0x56657d[_0x2fbe('0x49')],'name':_0x56657d[_0x2fbe('0x4a')],'paused':_0x56657d[_0x2fbe('0x4b')],'waiting':_0x56657d[_0x2fbe('0x4c')]};_0x1cf87d[_0x2fbe('0x25')](_0x582571);}}_0x58a24b({'count':_0x1cf87d[_0x2fbe('0x1c')],'rows':_0x1cf87d});});},'FaxQueues':function(_0xd47f33){return new Promise(function(_0x1c85d1,_0x3d5fa8){var _0x4702dc=[];for(var _0x4b8a25 in _0x1af815[_0x2fbe('0x51')]){if(_0x1af815['faxQueues']['hasOwnProperty'](_0x4b8a25)){var _0xba411f=_0x1af815[_0x2fbe('0x51')][_0x4b8a25];var _0x284647={'id':_0xba411f['id'],'available':_0xba411f[_0x2fbe('0x4e')],'loggedIn':_0xba411f[_0x2fbe('0x49')],'name':_0xba411f['name'],'paused':_0xba411f[_0x2fbe('0x4b')],'waiting':_0xba411f[_0x2fbe('0x4c')]};_0x4702dc[_0x2fbe('0x25')](_0x284647);}}_0x1c85d1({'count':_0x4702dc[_0x2fbe('0x1c')],'rows':_0x4702dc});});},'WhatsappQueues':function(_0x54d16c){return new Promise(function(_0x39a64e,_0x382c82){var _0x121fcf=[];for(var _0x57cb91 in _0x1af815[_0x2fbe('0x52')]){if(_0x1af815[_0x2fbe('0x52')]['hasOwnProperty'](_0x57cb91)){var _0x4bed2c=_0x1af815['whatsappQueues'][_0x57cb91];var _0x4746bc={'id':_0x4bed2c['id'],'available':_0x4bed2c[_0x2fbe('0x4e')],'loggedIn':_0x4bed2c[_0x2fbe('0x49')],'name':_0x4bed2c[_0x2fbe('0x4a')],'paused':_0x4bed2c['paused'],'waiting':_0x4bed2c[_0x2fbe('0x4c')]};_0x121fcf[_0x2fbe('0x25')](_0x4746bc);}}_0x39a64e({'count':_0x121fcf[_0x2fbe('0x1c')],'rows':_0x121fcf});});},'ChatQueuesWaitingInteractions':function(_0x1f1dbc){return new Promise(function(_0x596a15,_0x109bac){var _0x5b4b24=_[_0x2fbe('0x53')](_0x1af815[_0x2fbe('0x54')]);_0x596a15({'count':_0x5b4b24[_0x2fbe('0x1c')],'rows':_0x5b4b24});});},'MailQueuesWaitingInteractions':function(_0x3429ae){return new Promise(function(_0x1346ae,_0x51bdb5){var _0x47fe03=_[_0x2fbe('0x53')](_0x1af815[_0x2fbe('0x55')]);_0x1346ae({'count':_0x47fe03['length'],'rows':_0x47fe03});});},'OpenchannelQueuesWaitingInteractions':function(_0x238407){return new Promise(function(_0x3c8ce2,_0x32e9f3){var _0x34eeca=_[_0x2fbe('0x53')](_0x1af815[_0x2fbe('0x56')]);_0x3c8ce2({'count':_0x34eeca['length'],'rows':_0x34eeca});});},'SmsQueuesWaitingInteractions':function(_0x34aa9d){return new Promise(function(_0x213254,_0x2d1329){var _0x5235d1=_[_0x2fbe('0x53')](_0x1af815[_0x2fbe('0x57')]);_0x213254({'count':_0x5235d1[_0x2fbe('0x1c')],'rows':_0x5235d1});});},'FaxQueuesWaitingInteractions':function(_0xc398c0){return new Promise(function(_0x434eff,_0x51f5d7){var _0x2ef338=_['values'](_0x1af815[_0x2fbe('0x58')]);_0x434eff({'count':_0x2ef338[_0x2fbe('0x1c')],'rows':_0x2ef338});});},'WhatsappQueuesWaitingInteractions':function(_0x3a9cdb){return new Promise(function(_0x34773e,_0x2eb127){var _0xf9beb1=_['values'](_0x1af815[_0x2fbe('0x59')]);_0x34773e({'count':_0xf9beb1['length'],'rows':_0xf9beb1});});}};var _0x5a38dd=jayson[_0x2fbe('0x5a')](_0xdda617)[_0x2fbe('0x5b')]();_0x5a38dd['on']('error',function(_0x4bf247){logger['error'](JSON[_0x2fbe('0x35')](_0x4bf247));return _0xa5c1b8(_0x4bf247);});_0x5a38dd[_0x2fbe('0x15')](0x232c,'127.0.0.1',function(){console[_0x2fbe('0x5c')](_0x2fbe('0x5d'),0x232c);return _0x2bfe9f('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 0bd10bd..bdf1059 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 _0x7728=['client','http','then','error','message','result','catch','condition','rules','info','stop','length','push','Command','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x5307d4,_0x1fb0dc){var _0x30313b=function(_0x475a1e){while(--_0x475a1e){_0x5307d4['push'](_0x5307d4['shift']());}};_0x30313b(++_0x1fb0dc);}(_0x7728,0xcd));var _0x8772=function(_0x3838a4,_0x2ae1e6){_0x3838a4=_0x3838a4-0x0;var _0x3c56b4=_0x7728[_0x3838a4];return _0x3c56b4;};'use strict';var util=require('util');var BPromise=require(_0x8772('0x0'));var jayson=require(_0x8772('0x1'));var _=require(_0x8772('0x2'));var logger=require(_0x8772('0x3'))(_0x8772('0x4'));var client=jayson[_0x8772('0x5')][_0x8772('0x6')]({'port':0x232a});function request(_0x46d1c0,_0x4adadf){return new BPromise(function(_0x138db1,_0xff347b){return client['request'](_0x46d1c0,_0x4adadf)[_0x8772('0x7')](function(_0x5ecdf1){if(_0x5ecdf1[_0x8772('0x8')]){return _0xff347b(_0x5ecdf1['error'][_0x8772('0x9')]);}else{return _0x138db1(_0x5ecdf1[_0x8772('0xa')]);}})[_0x8772('0xb')](function(_0x53fd81){return _0xff347b(_0x53fd81);});});}exports[_0x8772('0xc')]=function(_0x353de8,_0x3a0cca,_0x39f13f){return function(_0x53efd3){if(_0x39f13f[_0x8772('0xd')]&&!_0x39f13f[_0x8772('0xd')][_0x353de8]){logger[_0x8772('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x353de8);return _0x53efd3[_0x8772('0xf')]();}var _0x467595=[];for(var _0xae60fc=0x0;_0xae60fc<_0x3a0cca[_0x8772('0x10')];_0xae60fc+=0x1){_0x467595[_0x8772('0x11')](request(_0x8772('0x12'),{'command':util[_0x8772('0x13')](_0x8772('0x14'),_0x3a0cca[_0xae60fc])})[_0x8772('0x7')](function(_0x392913){return _0x392913&&_0x392913[_0x8772('0x9')]&&_0x392913[_0x8772('0x9')][_0x8772('0x15')]('true')>=0x0?!![]:![];})[_0x8772('0xb')](function(_0x5832ad){logger['error'](_0x8772('0x16'),_0x353de8,_0x3a0cca[_0xae60fc]);}));}BPromise[_0x8772('0x17')](_0x467595)[_0x8772('0x7')](function(_0x3ee95e){var _0x47025c=_['some'](_0x3ee95e);logger[_0x8772('0xe')](_0x8772('0x18'),_0x353de8,_0x3a0cca[_0x8772('0x19')]('\x20|\x20'),_0x47025c);_0x53efd3[_0x8772('0x1a')](_0x47025c);})['catch'](function(_0x2db359){console[_0x8772('0x1b')](_0x2db359);logger[_0x8772('0x8')](_0x8772('0x18'),_0x353de8,_0x3a0cca['join'](_0x8772('0x1c')),_0x2db359[_0x8772('0x1d')]);_0x53efd3[_0x8772('0xf')]();});};}; \ No newline at end of file +var _0x0d8d=['true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','util','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','iftime\x20%s','indexOf'];(function(_0x3ca7a9,_0x4fc0c7){var _0x399428=function(_0x3f30b2){while(--_0x3f30b2){_0x3ca7a9['push'](_0x3ca7a9['shift']());}};_0x399428(++_0x4fc0c7);}(_0x0d8d,0x1c9));var _0xd0d8=function(_0x501d3f,_0x4d0b2b){_0x501d3f=_0x501d3f-0x0;var _0x29dab7=_0x0d8d[_0x501d3f];return _0x29dab7;};'use strict';var util=require(_0xd0d8('0x0'));var BPromise=require('bluebird');var jayson=require(_0xd0d8('0x1'));var _=require(_0xd0d8('0x2'));var logger=require(_0xd0d8('0x3'))(_0xd0d8('0x4'));var client=jayson[_0xd0d8('0x5')]['http']({'port':0x232a});function request(_0x20b667,_0xa6bba6){return new BPromise(function(_0x417af8,_0x531903){return client[_0xd0d8('0x6')](_0x20b667,_0xa6bba6)[_0xd0d8('0x7')](function(_0x49ca21){if(_0x49ca21['error']){return _0x531903(_0x49ca21[_0xd0d8('0x8')][_0xd0d8('0x9')]);}else{return _0x417af8(_0x49ca21['result']);}})[_0xd0d8('0xa')](function(_0x34f966){return _0x531903(_0x34f966);});});}exports[_0xd0d8('0xb')]=function(_0x22fa0b,_0x40d5fc,_0x532e3e){return function(_0x3c4800){if(_0x532e3e['rules']&&!_0x532e3e['rules'][_0x22fa0b]){logger[_0xd0d8('0xc')](_0xd0d8('0xd'),_0x22fa0b);return _0x3c4800['stop']();}var _0x46a674=[];for(var _0x479098=0x0;_0x479098<_0x40d5fc[_0xd0d8('0xe')];_0x479098+=0x1){_0x46a674[_0xd0d8('0xf')](request('Command',{'command':util['format'](_0xd0d8('0x10'),_0x40d5fc[_0x479098])})['then'](function(_0x56ef24){return _0x56ef24&&_0x56ef24[_0xd0d8('0x9')]&&_0x56ef24[_0xd0d8('0x9')][_0xd0d8('0x11')](_0xd0d8('0x12'))>=0x0?!![]:![];})[_0xd0d8('0xa')](function(_0x4239e0){logger['error'](_0xd0d8('0x13'),_0x22fa0b,_0x40d5fc[_0x479098]);}));}BPromise[_0xd0d8('0x14')](_0x46a674)[_0xd0d8('0x7')](function(_0x4722d7){var _0x588a6f=_['some'](_0x4722d7);logger['info'](_0xd0d8('0x15'),_0x22fa0b,_0x40d5fc[_0xd0d8('0x16')](_0xd0d8('0x17')),_0x588a6f);_0x3c4800['when'](_0x588a6f);})[_0xd0d8('0xa')](function(_0x2759c3){console[_0xd0d8('0x18')](_0x2759c3);logger['error'](_0xd0d8('0x15'),_0x22fa0b,_0x40d5fc[_0xd0d8('0x16')]('\x20|\x20'),_0x2759c3['stack']);_0x3c4800['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7c40848..18113c0 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 _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x4bd96a,_0x182b07){var _0x3e8e6b=function(_0x2dc62b){while(--_0x2dc62b){_0x4bd96a['push'](_0x4bd96a['shift']());}};_0x3e8e6b(++_0x182b07);}(_0xd3d1,0x172));var _0x1d3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3d1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}}; \ No newline at end of file +var _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x12b08a,_0x3a60dc){var _0xc9add=function(_0x5d1236){while(--_0x5d1236){_0x12b08a['push'](_0x12b08a['shift']());}};_0xc9add(++_0x3a60dc);}(_0x2f68,0x9a));var _0x82f6=function(_0x26b1b1,_0x8d299e){_0x26b1b1=_0x26b1b1-0x0;var _0x2668ea=_0x2f68[_0x26b1b1];return _0x2668ea;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5c65f35..d9856f7 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 _0x6666=['application','appdata','toLowerCase','set','cdr','split','substring','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','format','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','context','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','starttime','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s'];(function(_0x3bd792,_0x171a3e){var _0x405c0f=function(_0x3c2cae){while(--_0x3c2cae){_0x3bd792['push'](_0x3bd792['shift']());}};_0x405c0f(++_0x171a3e);}(_0x6666,0x1be));var _0x6666=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x6666[_0x249e96];return _0x17444c;};'use strict';var _=require(_0x6666('0x0'));var util=require(_0x6666('0x1'));var utils=require(_0x6666('0x2'));var transfers=require(_0x6666('0x3'));var dispositions=[_0x6666('0x4'),_0x6666('0x5'),_0x6666('0x5'),_0x6666('0x4'),'NO\x20ANSWER',_0x6666('0x4'),_0x6666('0x6'),'BUSY',_0x6666('0x5'),_0x6666('0x5'),_0x6666('0x5')];var channels={};function writeDB(_0x1e3844){var _0x504f6b;if(transfers['blinds'][_0x1e3844['uniqueid']]){_0x504f6b=_0x1e3844[_0x6666('0x7')];_0x1e3844[_0x6666('0x7')]=transfers[_0x6666('0x8')][_0x1e3844['uniqueid']][_0x6666('0x9')];}utils[_0x6666('0xa')](util[_0x6666('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1e3844[_0x6666('0x7')],_0x1e3844[_0x6666('0xc')],_0x1e3844[_0x6666('0xd')],_0x1e3844[_0x6666('0xe')],_0x1e3844['interface'],_0x1e3844[_0x6666('0xf')],_0x1e3844[_0x6666('0x10')],_0x1e3844[_0x6666('0x11')]));if(_0x1e3844[_0x6666('0x12')]){utils[_0x6666('0x13')](_0x1e3844[_0x6666('0x12')])[_0x6666('0x14')](function(_0x3e495e){if(_0x3e495e){_0x1e3844['UserId']=_0x3e495e['id'];}utils['request'](_0x6666('0x15'),_0x1e3844);});}else{utils[_0x6666('0x16')](_0x6666('0x15'),_0x1e3844);}if(channels[_0x1e3844['uniqueid']]){delete channels[_0x1e3844[_0x6666('0x7')]];}else if(_0x504f6b&&channels[_0x504f6b]){delete transfers[_0x6666('0x8')][_0x504f6b];delete channels[_0x504f6b];}}exports[_0x6666('0x17')]=function(_0x371bfd){try{utils[_0x6666('0x18')](util[_0x6666('0xb')](_0x6666('0x19'),_0x371bfd[_0x6666('0x7')]),_0x371bfd);if(_0x371bfd['uniqueid']==_0x371bfd[_0x6666('0x1a')]&&_0x371bfd[_0x6666('0xc')]!=_0x6666('0x1b')){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x1c'),_0x371bfd[_0x6666('0x7')],_0x371bfd['context'],_0x371bfd[_0x6666('0x1d')]));channels[_0x371bfd[_0x6666('0x7')]]={'uniqueid':_0x371bfd[_0x6666('0x7')],'accountcode':_0x371bfd[_0x6666('0x12')],'source':_0x371bfd[_0x6666('0xf')],'destination':_0x371bfd[_0x6666('0x1d')],'destinationcontext':_0x371bfd['context'],'channel':_0x371bfd[_0x6666('0xc')],'starttime':utils[_0x6666('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6666('0x4'),'amaflags':_0x6666('0x1f')};}}catch(_0x4e643e){utils[_0x6666('0x20')](util[_0x6666('0xb')](_0x6666('0x19'),_0x371bfd['uniqueid']),_0x4e643e);}};exports[_0x6666('0x21')]=function(_0x283f34){try{utils[_0x6666('0x18')](util[_0x6666('0xb')](_0x6666('0x22'),_0x283f34[_0x6666('0x7')]),_0x283f34);if(!_[_0x6666('0x23')](channels[_0x283f34[_0x6666('0x7')]])&&_0x283f34[_0x6666('0x24')]==0x6){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x25'),_0x283f34[_0x6666('0x7')],_0x283f34['context'],_0x283f34[_0x6666('0xc')]));if(_['isNil'](channels[_0x283f34['uniqueid']][_0x6666('0x26')])){channels[_0x283f34['uniqueid']]['systemanswertime']=utils['now']();}}else if(!_[_0x6666('0x23')](channels[_0x283f34['linkedid']])&&_0x283f34[_0x6666('0x24')]==0x6&&_0x283f34[_0x6666('0x27')]!=_0x6666('0x28')){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x29'),_0x283f34[_0x6666('0x7')],_0x283f34['linkedid'],_0x283f34['context'],_0x283f34['channel']));channels[_0x283f34[_0x6666('0x1a')]]['accountcode']=_0x283f34[_0x6666('0x12')];channels[_0x283f34[_0x6666('0x1a')]][_0x6666('0x2a')]=_0x283f34[_0x6666('0xc')];if(_[_0x6666('0x23')](channels[_0x283f34[_0x6666('0x1a')]][_0x6666('0x2b')])){channels[_0x283f34['linkedid']][_0x6666('0x2b')]=utils[_0x6666('0x1e')]();}channels[_0x283f34['linkedid']][_0x6666('0x2c')]=dispositions[_[_0x6666('0x2d')](_0x283f34['channelstate'])]||'ANSWERED';}}catch(_0x3bd64c){utils[_0x6666('0x20')](util[_0x6666('0xb')](_0x6666('0x22'),_0x283f34[_0x6666('0x7')]),_0x3bd64c);}};exports[_0x6666('0x2e')]=function(_0x13d057){try{if(!_[_0x6666('0x23')](channels[_0x13d057[_0x6666('0x7')]])){utils[_0x6666('0x18')](util[_0x6666('0xb')](_0x6666('0x2f'),_0x13d057[_0x6666('0x7')]),_0x13d057);if(_[_0x6666('0x23')](channels[_0x13d057['uniqueid']][_0x6666('0x30')])){channels[_0x13d057['uniqueid']][_0x6666('0x30')]=_0x13d057[_0x6666('0x31')]+'\x20<'+_0x13d057[_0x6666('0xf')]+'>';}utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x32'),_0x13d057['uniqueid'],channels[_0x13d057[_0x6666('0x7')]]['callerid'],_0x13d057['cause-txt']));channels[_0x13d057[_0x6666('0x7')]][_0x6666('0x33')]=utils['now']();channels[_0x13d057[_0x6666('0x7')]][_0x6666('0x34')]=utils['diffTime'](channels[_0x13d057[_0x6666('0x7')]][_0x6666('0x33')],channels[_0x13d057[_0x6666('0x7')]][_0x6666('0x35')]);channels[_0x13d057[_0x6666('0x7')]]['billableseconds']=channels[_0x13d057[_0x6666('0x7')]][_0x6666('0x2b')]?utils[_0x6666('0x36')](channels[_0x13d057[_0x6666('0x7')]]['endtime'],channels[_0x13d057['uniqueid']][_0x6666('0x2b')]):0x0;writeDB(channels[_0x13d057['uniqueid']]);}}catch(_0x5a1ce2){utils[_0x6666('0x20')](util[_0x6666('0xb')](_0x6666('0x2f'),_0x13d057[_0x6666('0x7')]),_0x5a1ce2);}};exports['attendedtransfer']=function(_0x5d2c4b){try{if(!_[_0x6666('0x23')](channels[_0x5d2c4b[_0x6666('0x37')]])){utils[_0x6666('0x18')](util['format'](_0x6666('0x38'),_0x5d2c4b[_0x6666('0x39')]),_0x5d2c4b);if(channels[_0x5d2c4b[_0x6666('0x37')]]['channel']==_0x5d2c4b[_0x6666('0x3a')]){utils['info'](util[_0x6666('0xb')](_0x6666('0x3b'),_0x5d2c4b[_0x6666('0x39')],_0x5d2c4b[_0x6666('0x37')],_0x5d2c4b[_0x6666('0x3c')]));channels[_0x5d2c4b[_0x6666('0x37')]][_0x6666('0x2a')]=_0x5d2c4b[_0x6666('0x3c')];channels[_0x5d2c4b[_0x6666('0x37')]]['userfield']='_attended';}else if(channels[_0x5d2c4b[_0x6666('0x37')]][_0x6666('0xc')]=_0x5d2c4b[_0x6666('0x3d')]){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x3b'),_0x5d2c4b['origtransfereruniqueid'],_0x5d2c4b['localtwolinkedid'],_0x5d2c4b[_0x6666('0x3e')]));channels[_0x5d2c4b[_0x6666('0x37')]][_0x6666('0x2a')]=_0x5d2c4b[_0x6666('0x3e')];channels[_0x5d2c4b[_0x6666('0x37')]][_0x6666('0x3f')]='_attended';}}}catch(_0x225d16){utils[_0x6666('0x20')](util[_0x6666('0xb')](_0x6666('0x38'),_0x5d2c4b[_0x6666('0x39')]),_0x225d16);}};exports[_0x6666('0x40')]=function(_0x5ada1e){try{if(!_['isNil'](channels[_0x5ada1e[_0x6666('0x7')]])){utils[_0x6666('0x18')](util[_0x6666('0xb')]('[%s][calls][musiconholdstart]',_0x5ada1e[_0x6666('0x7')]),_0x5ada1e);channels[_0x5ada1e[_0x6666('0x7')]]['musiconholdstartAt']=utils['now']();utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x41'),_0x5ada1e['uniqueid'],channels[_0x5ada1e[_0x6666('0x7')]][_0x6666('0x42')]));}}catch(_0x44e63b){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0x5ada1e[_0x6666('0x7')]),_0x44e63b);}};exports[_0x6666('0x43')]=function(_0xe670b5){try{if(!_[_0x6666('0x23')](channels[_0xe670b5[_0x6666('0x7')]])){utils[_0x6666('0x18')](util['format'](_0x6666('0x44'),_0xe670b5['uniqueid']),_0xe670b5);if(!_[_0x6666('0x23')](channels[_0xe670b5[_0x6666('0x7')]]['musiconholdstartAt'])){channels[_0xe670b5[_0x6666('0x7')]][_0x6666('0x45')]+=utils[_0x6666('0x36')](utils['now'](),channels[_0xe670b5[_0x6666('0x7')]][_0x6666('0x42')]);utils['info'](util[_0x6666('0xb')](_0x6666('0x46'),_0xe670b5[_0x6666('0x7')],channels[_0xe670b5['uniqueid']]['mohtime']));delete channels[_0xe670b5[_0x6666('0x7')]][_0x6666('0x42')];}}}catch(_0x111d01){utils[_0x6666('0x20')](util['format']('[%s][calls][musiconholdstop]',_0xe670b5[_0x6666('0x7')]),_0x111d01);}};exports[_0x6666('0x47')]=function(_0x540ce8){try{if(!_[_0x6666('0x23')](channels[_0x540ce8[_0x6666('0x7')]])){utils[_0x6666('0x18')](util['format'](_0x6666('0x48'),_0x540ce8['uniqueid']),_0x540ce8);if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x4a')])){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x4b'),_0x540ce8[_0x6666('0x7')],_0x540ce8['value']));channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x4c')]=_0x540ce8[_0x6666('0x4d')];}if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x4e')])){utils[_0x6666('0xa')](util['format'](_0x6666('0x4f'),_0x540ce8[_0x6666('0x7')],_0x540ce8[_0x6666('0x4d')]));channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x50')]=_0x540ce8['value'];channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x30')]='\x22'+_0x540ce8[_0x6666('0x4d')]+_0x6666('0x51')+_0x540ce8[_0x6666('0x4d')]+'>';}if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x52')])||!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x53')])){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x54'),_0x540ce8[_0x6666('0x7')],!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x52')])?'xmd-callerid-preview':_0x6666('0x53'),_0x540ce8['value']));channels[_0x540ce8[_0x6666('0x7')]]['callerid']=_0x540ce8[_0x6666('0x4d')];}if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x55')])||!_['isNil'](_0x540ce8[_0x6666('0x49')][_0x6666('0x56')])){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x54'),_0x540ce8[_0x6666('0x7')],!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x55')])?_0x6666('0x55'):'xmcs-queue',_0x540ce8[_0x6666('0x4d')]));channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x57')]=_0x6666('0x58');channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x59')]=_0x540ce8[_0x6666('0x4d')];channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0xd')]=!![];}if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x5a')])){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x5b'),_0x540ce8[_0x6666('0x7')],_0x540ce8[_0x6666('0x4d')]));channels[_0x540ce8[_0x6666('0x7')]]['ContactId']=_0x540ce8['value'];}if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x5c')])){utils[_0x6666('0xa')](util[_0x6666('0xb')](_0x6666('0x5d'),_0x540ce8['uniqueid'],_0x540ce8[_0x6666('0x4d')]));channels[_0x540ce8[_0x6666('0x7')]]['type']=_0x540ce8[_0x6666('0x4d')];}if(!_['isNil'](_0x540ce8[_0x6666('0x49')]['outboundrouteid'])){utils[_0x6666('0xa')](util[_0x6666('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x540ce8[_0x6666('0x7')],_0x540ce8[_0x6666('0x4d')]));channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x5e')]=_0x540ce8[_0x6666('0x4d')];}if(!_[_0x6666('0x23')](_0x540ce8[_0x6666('0x49')][_0x6666('0x5f')])){utils['info'](util[_0x6666('0xb')](_0x6666('0x60'),_0x540ce8['uniqueid'],_0x540ce8[_0x6666('0x4d')]));channels[_0x540ce8[_0x6666('0x7')]][_0x6666('0x5f')]=_0x540ce8['value'];}}}catch(_0x10be85){utils[_0x6666('0x20')](util['format'](_0x6666('0x48'),_0x540ce8[_0x6666('0x7')]),_0x10be85);}};exports['newexten']=function(_0x226185){try{if(!_[_0x6666('0x23')](channels[_0x226185[_0x6666('0x7')]])){utils[_0x6666('0x18')](util['format'](_0x6666('0x61'),_0x226185[_0x6666('0x7')]),_0x226185);utils[_0x6666('0xa')](util['format'](_0x6666('0x62'),_0x226185[_0x6666('0x7')],_0x226185[_0x6666('0x63')],_0x226185[_0x6666('0x64')]));if(_0x226185[_0x6666('0x63')][_0x6666('0x65')]()==_0x6666('0x66')&&_['startsWith'](_0x226185[_0x6666('0x64')][_0x6666('0x65')](),_0x6666('0x67'))){var _0x572f5c=_0x226185[_0x6666('0x64')][_0x6666('0x68')]('=');var _0x1ab356=_0x572f5c[0x0][_0x6666('0x69')](_0x572f5c[0x0]['lastIndexOf']('(')+0x1,_0x572f5c[0x0]['lastIndexOf'](')'));var _0x2968f3=_0x572f5c[0x1];channels[_0x226185[_0x6666('0x7')]][_0x1ab356]=_0x2968f3;}if(!_['includes'](['hangup',_0x6666('0x6a'),_0x6666('0x6b'),_0x6666('0x66'),_0x6666('0x6c')],_0x226185[_0x6666('0x63')][_0x6666('0x65')]())){channels[_0x226185[_0x6666('0x7')]][_0x6666('0x57')]=_0x226185[_0x6666('0x63')];channels[_0x226185[_0x6666('0x7')]]['lastdata']=_0x226185['appdata'];}}}catch(_0x3a3e9c){utils[_0x6666('0x20')](util[_0x6666('0xb')](_0x6666('0x61'),_0x226185[_0x6666('0x7')]),_0x3a3e9c);}}; \ No newline at end of file +var _0x22b8=['[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','split','substring','includes','execif','set','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','endtime','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten'];(function(_0x4a0bed,_0x49e046){var _0x21eaf9=function(_0x1ccebb){while(--_0x1ccebb){_0x4a0bed['push'](_0x4a0bed['shift']());}};_0x21eaf9(++_0x49e046);}(_0x22b8,0x76));var _0x822b=function(_0x7025b0,_0x9533f1){_0x7025b0=_0x7025b0-0x0;var _0x6e444c=_0x22b8[_0x7025b0];return _0x6e444c;};'use strict';var _=require(_0x822b('0x0'));var util=require(_0x822b('0x1'));var utils=require(_0x822b('0x2'));var transfers=require(_0x822b('0x3'));var dispositions=[_0x822b('0x4'),'FAILED',_0x822b('0x5'),_0x822b('0x4'),'NO\x20ANSWER',_0x822b('0x4'),_0x822b('0x6'),_0x822b('0x7'),_0x822b('0x5'),_0x822b('0x5'),'FAILED'];var channels={};function writeDB(_0x1e73e5){var _0x5bdcdf;if(transfers['blinds'][_0x1e73e5['uniqueid']]){_0x5bdcdf=_0x1e73e5[_0x822b('0x8')];_0x1e73e5[_0x822b('0x8')]=transfers[_0x822b('0x9')][_0x1e73e5[_0x822b('0x8')]][_0x822b('0xa')];}utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0xd'),_0x1e73e5[_0x822b('0x8')],_0x1e73e5[_0x822b('0xe')],_0x1e73e5[_0x822b('0xf')],_0x1e73e5['membername'],_0x1e73e5['interface'],_0x1e73e5[_0x822b('0x10')],_0x1e73e5['connectedlinenum'],_0x1e73e5[_0x822b('0x11')]));if(_0x1e73e5[_0x822b('0x12')]){utils[_0x822b('0x13')](_0x1e73e5[_0x822b('0x12')])[_0x822b('0x14')](function(_0x2adf8e){if(_0x2adf8e){_0x1e73e5[_0x822b('0x15')]=_0x2adf8e['id'];}utils['request'](_0x822b('0x16'),_0x1e73e5);});}else{utils[_0x822b('0x17')]('CreateVoiceCallReport',_0x1e73e5);}if(channels[_0x1e73e5[_0x822b('0x8')]]){delete channels[_0x1e73e5['uniqueid']];}else if(_0x5bdcdf&&channels[_0x5bdcdf]){delete transfers[_0x822b('0x9')][_0x5bdcdf];delete channels[_0x5bdcdf];}}exports[_0x822b('0x18')]=function(_0x49417a){try{utils[_0x822b('0x19')](util[_0x822b('0xc')]('[%s][calls][newchannel]',_0x49417a[_0x822b('0x8')]),_0x49417a);if(_0x49417a['uniqueid']==_0x49417a['linkedid']&&_0x49417a[_0x822b('0xe')]!='OutgoingSpoolFailed'){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x1a'),_0x49417a[_0x822b('0x8')],_0x49417a[_0x822b('0x1b')],_0x49417a[_0x822b('0x1c')]));channels[_0x49417a[_0x822b('0x8')]]={'uniqueid':_0x49417a[_0x822b('0x8')],'accountcode':_0x49417a[_0x822b('0x12')],'source':_0x49417a[_0x822b('0x10')],'destination':_0x49417a[_0x822b('0x1c')],'destinationcontext':_0x49417a['context'],'channel':_0x49417a[_0x822b('0xe')],'starttime':utils[_0x822b('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x822b('0x4'),'amaflags':_0x822b('0x1e')};}}catch(_0xc78a37){utils[_0x822b('0x1f')](util[_0x822b('0xc')]('[%s][calls][newchannel]',_0x49417a['uniqueid']),_0xc78a37);}};exports[_0x822b('0x20')]=function(_0x5a1a50){try{utils[_0x822b('0x19')](util[_0x822b('0xc')](_0x822b('0x21'),_0x5a1a50['uniqueid']),_0x5a1a50);if(!_[_0x822b('0x22')](channels[_0x5a1a50[_0x822b('0x8')]])&&_0x5a1a50[_0x822b('0x23')]==0x6){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x24'),_0x5a1a50[_0x822b('0x8')],_0x5a1a50[_0x822b('0x1b')],_0x5a1a50[_0x822b('0xe')]));if(_[_0x822b('0x22')](channels[_0x5a1a50[_0x822b('0x8')]][_0x822b('0x25')])){channels[_0x5a1a50[_0x822b('0x8')]]['systemanswertime']=utils[_0x822b('0x1d')]();}}else if(!_[_0x822b('0x22')](channels[_0x5a1a50[_0x822b('0x26')]])&&_0x5a1a50['channelstate']==0x6&&_0x5a1a50[_0x822b('0x1b')]!='transfer'){utils['info'](util[_0x822b('0xc')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5a1a50['uniqueid'],_0x5a1a50[_0x822b('0x26')],_0x5a1a50['context'],_0x5a1a50['channel']));channels[_0x5a1a50[_0x822b('0x26')]][_0x822b('0x12')]=_0x5a1a50[_0x822b('0x12')];channels[_0x5a1a50[_0x822b('0x26')]][_0x822b('0x27')]=_0x5a1a50[_0x822b('0xe')];if(_['isNil'](channels[_0x5a1a50[_0x822b('0x26')]][_0x822b('0x28')])){channels[_0x5a1a50[_0x822b('0x26')]][_0x822b('0x28')]=utils[_0x822b('0x1d')]();}channels[_0x5a1a50[_0x822b('0x26')]]['disposition']=dispositions[_[_0x822b('0x29')](_0x5a1a50['channelstate'])]||_0x822b('0x6');}}catch(_0xbebbd7){utils[_0x822b('0x1f')](util['format']('[%s][calls][newstate]',_0x5a1a50[_0x822b('0x8')]),_0xbebbd7);}};exports[_0x822b('0x2a')]=function(_0x89bd7){try{if(!_['isNil'](channels[_0x89bd7[_0x822b('0x8')]])){utils[_0x822b('0x19')](util[_0x822b('0xc')](_0x822b('0x2b'),_0x89bd7[_0x822b('0x8')]),_0x89bd7);if(_[_0x822b('0x22')](channels[_0x89bd7[_0x822b('0x8')]]['callerid'])){channels[_0x89bd7[_0x822b('0x8')]][_0x822b('0x2c')]=_0x89bd7[_0x822b('0x2d')]+'\x20<'+_0x89bd7[_0x822b('0x10')]+'>';}utils[_0x822b('0xb')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x89bd7['uniqueid'],channels[_0x89bd7[_0x822b('0x8')]][_0x822b('0x2c')],_0x89bd7['cause-txt']));channels[_0x89bd7[_0x822b('0x8')]]['endtime']=utils[_0x822b('0x1d')]();channels[_0x89bd7[_0x822b('0x8')]]['duration']=utils['diffTime'](channels[_0x89bd7[_0x822b('0x8')]][_0x822b('0x2e')],channels[_0x89bd7[_0x822b('0x8')]][_0x822b('0x2f')]);channels[_0x89bd7[_0x822b('0x8')]][_0x822b('0x30')]=channels[_0x89bd7[_0x822b('0x8')]]['answertime']?utils[_0x822b('0x31')](channels[_0x89bd7['uniqueid']][_0x822b('0x2e')],channels[_0x89bd7[_0x822b('0x8')]][_0x822b('0x28')]):0x0;writeDB(channels[_0x89bd7[_0x822b('0x8')]]);}}catch(_0x177fa8){utils[_0x822b('0x1f')](util[_0x822b('0xc')](_0x822b('0x2b'),_0x89bd7[_0x822b('0x8')]),_0x177fa8);}};exports[_0x822b('0x32')]=function(_0x739096){try{if(!_[_0x822b('0x22')](channels[_0x739096['localtwolinkedid']])){utils[_0x822b('0x19')](util['format'](_0x822b('0x33'),_0x739096[_0x822b('0x34')]),_0x739096);if(channels[_0x739096[_0x822b('0x35')]][_0x822b('0xe')]==_0x739096[_0x822b('0x36')]){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x37'),_0x739096[_0x822b('0x34')],_0x739096[_0x822b('0x35')],_0x739096[_0x822b('0x38')]));channels[_0x739096[_0x822b('0x35')]][_0x822b('0x27')]=_0x739096[_0x822b('0x38')];channels[_0x739096[_0x822b('0x35')]][_0x822b('0x39')]='_attended';}else if(channels[_0x739096['localtwolinkedid']]['channel']=_0x739096[_0x822b('0x3a')]){utils['info'](util[_0x822b('0xc')](_0x822b('0x37'),_0x739096[_0x822b('0x34')],_0x739096[_0x822b('0x35')],_0x739096[_0x822b('0x3b')]));channels[_0x739096[_0x822b('0x35')]][_0x822b('0x27')]=_0x739096[_0x822b('0x3b')];channels[_0x739096[_0x822b('0x35')]][_0x822b('0x39')]='_attended';}}}catch(_0x549397){utils[_0x822b('0x1f')](util[_0x822b('0xc')](_0x822b('0x33'),_0x739096['origtransfereruniqueid']),_0x549397);}};exports[_0x822b('0x3c')]=function(_0x3c18ce){try{if(!_[_0x822b('0x22')](channels[_0x3c18ce[_0x822b('0x8')]])){utils[_0x822b('0x19')](util['format'](_0x822b('0x3d'),_0x3c18ce[_0x822b('0x8')]),_0x3c18ce);channels[_0x3c18ce['uniqueid']][_0x822b('0x3e')]=utils[_0x822b('0x1d')]();utils['info'](util[_0x822b('0xc')](_0x822b('0x3f'),_0x3c18ce[_0x822b('0x8')],channels[_0x3c18ce[_0x822b('0x8')]][_0x822b('0x3e')]));}}catch(_0x12cf83){utils[_0x822b('0x1f')](util['format'](_0x822b('0x3d'),_0x3c18ce['uniqueid']),_0x12cf83);}};exports[_0x822b('0x40')]=function(_0x28e567){try{if(!_[_0x822b('0x22')](channels[_0x28e567[_0x822b('0x8')]])){utils['debug'](util[_0x822b('0xc')](_0x822b('0x41'),_0x28e567[_0x822b('0x8')]),_0x28e567);if(!_[_0x822b('0x22')](channels[_0x28e567[_0x822b('0x8')]][_0x822b('0x3e')])){channels[_0x28e567[_0x822b('0x8')]][_0x822b('0x42')]+=utils[_0x822b('0x31')](utils[_0x822b('0x1d')](),channels[_0x28e567['uniqueid']][_0x822b('0x3e')]);utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x43'),_0x28e567[_0x822b('0x8')],channels[_0x28e567[_0x822b('0x8')]]['mohtime']));delete channels[_0x28e567[_0x822b('0x8')]]['musiconholdstartAt'];}}}catch(_0x13dec9){utils[_0x822b('0x1f')](util['format'](_0x822b('0x41'),_0x28e567[_0x822b('0x8')]),_0x13dec9);}};exports[_0x822b('0x44')]=function(_0x1e71a0){try{if(!_['isNil'](channels[_0x1e71a0[_0x822b('0x8')]])){utils['debug'](util[_0x822b('0xc')](_0x822b('0x45'),_0x1e71a0[_0x822b('0x8')]),_0x1e71a0);if(!_[_0x822b('0x22')](_0x1e71a0['variable'][_0x822b('0x46')])){utils[_0x822b('0xb')](util['format'](_0x822b('0x47'),_0x1e71a0[_0x822b('0x8')],_0x1e71a0[_0x822b('0x48')]));channels[_0x1e71a0[_0x822b('0x8')]]['source']=_0x1e71a0['value'];}if(!_[_0x822b('0x22')](_0x1e71a0[_0x822b('0x49')]['xmd-phone'])){utils[_0x822b('0xb')](util[_0x822b('0xc')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1e71a0['uniqueid'],_0x1e71a0['value']));channels[_0x1e71a0[_0x822b('0x8')]][_0x822b('0x4a')]=_0x1e71a0[_0x822b('0x48')];channels[_0x1e71a0['uniqueid']][_0x822b('0x2c')]='\x22'+_0x1e71a0[_0x822b('0x48')]+_0x822b('0x4b')+_0x1e71a0['value']+'>';}if(!_[_0x822b('0x22')](_0x1e71a0[_0x822b('0x49')][_0x822b('0x4c')])||!_[_0x822b('0x22')](_0x1e71a0[_0x822b('0x49')][_0x822b('0x4d')])){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x4e'),_0x1e71a0[_0x822b('0x8')],!_['isNil'](_0x1e71a0[_0x822b('0x49')][_0x822b('0x4c')])?_0x822b('0x4c'):_0x822b('0x4d'),_0x1e71a0[_0x822b('0x48')]));channels[_0x1e71a0['uniqueid']][_0x822b('0x2c')]=_0x1e71a0['value'];}if(!_['isNil'](_0x1e71a0[_0x822b('0x49')][_0x822b('0x4f')])||!_[_0x822b('0x22')](_0x1e71a0[_0x822b('0x49')][_0x822b('0x50')])){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x4e'),_0x1e71a0['uniqueid'],!_[_0x822b('0x22')](_0x1e71a0['variable'][_0x822b('0x4f')])?_0x822b('0x4f'):_0x822b('0x50'),_0x1e71a0[_0x822b('0x48')]));channels[_0x1e71a0[_0x822b('0x8')]][_0x822b('0x51')]=_0x822b('0x52');channels[_0x1e71a0[_0x822b('0x8')]][_0x822b('0x53')]=_0x1e71a0[_0x822b('0x48')];channels[_0x1e71a0[_0x822b('0x8')]]['queue']=!![];}if(!_[_0x822b('0x22')](_0x1e71a0[_0x822b('0x49')][_0x822b('0x54')])){utils[_0x822b('0xb')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1e71a0['uniqueid'],_0x1e71a0[_0x822b('0x48')]));channels[_0x1e71a0[_0x822b('0x8')]][_0x822b('0x55')]=_0x1e71a0[_0x822b('0x48')];}if(!_['isNil'](_0x1e71a0[_0x822b('0x49')][_0x822b('0x56')])){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x57'),_0x1e71a0['uniqueid'],_0x1e71a0['value']));channels[_0x1e71a0[_0x822b('0x8')]][_0x822b('0x58')]=_0x1e71a0[_0x822b('0x48')];}if(!_['isNil'](_0x1e71a0['variable'][_0x822b('0x59')])){utils[_0x822b('0xb')](util[_0x822b('0xc')](_0x822b('0x5a'),_0x1e71a0[_0x822b('0x8')],_0x1e71a0[_0x822b('0x48')]));channels[_0x1e71a0[_0x822b('0x8')]][_0x822b('0x5b')]=_0x1e71a0[_0x822b('0x48')];}if(!_[_0x822b('0x22')](_0x1e71a0[_0x822b('0x49')]['sipcallid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1e71a0[_0x822b('0x8')],_0x1e71a0['value']));channels[_0x1e71a0['uniqueid']][_0x822b('0x5c')]=_0x1e71a0['value'];}}}catch(_0x4d5e88){utils['error'](util[_0x822b('0xc')](_0x822b('0x45'),_0x1e71a0['uniqueid']),_0x4d5e88);}};exports[_0x822b('0x5d')]=function(_0x2256cc){try{if(!_[_0x822b('0x22')](channels[_0x2256cc[_0x822b('0x8')]])){utils[_0x822b('0x19')](util[_0x822b('0xc')](_0x822b('0x5e'),_0x2256cc[_0x822b('0x8')]),_0x2256cc);utils['info'](util['format'](_0x822b('0x5f'),_0x2256cc['uniqueid'],_0x2256cc[_0x822b('0x60')],_0x2256cc[_0x822b('0x61')]));if(_0x2256cc[_0x822b('0x60')]['toLowerCase']()=='set'&&_[_0x822b('0x62')](_0x2256cc[_0x822b('0x61')][_0x822b('0x63')](),_0x822b('0x64'))){var _0x542f01=_0x2256cc['appdata'][_0x822b('0x65')]('=');var _0x123406=_0x542f01[0x0][_0x822b('0x66')](_0x542f01[0x0]['lastIndexOf']('(')+0x1,_0x542f01[0x0]['lastIndexOf'](')'));var _0x256819=_0x542f01[0x1];channels[_0x2256cc[_0x822b('0x8')]][_0x123406]=_0x256819;}if(!_[_0x822b('0x67')]([_0x822b('0x2a'),'noop',_0x822b('0x68'),_0x822b('0x69'),'gotoif'],_0x2256cc[_0x822b('0x60')][_0x822b('0x63')]())){channels[_0x2256cc['uniqueid']][_0x822b('0x51')]=_0x2256cc[_0x822b('0x60')];channels[_0x2256cc[_0x822b('0x8')]]['lastdata']=_0x2256cc[_0x822b('0x61')];}}}catch(_0x44e65e){utils['error'](util[_0x822b('0xc')](_0x822b('0x5e'),_0x2256cc[_0x822b('0x8')]),_0x44e65e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index cf21130..70fb8e3 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 _0xa630=['./utils','connect','shutdown','[core]\x20shutdown','info','[core]\x20fullybooted','error','close','[core]\x20close','managerevent'];(function(_0x281fef,_0x27415a){var _0x235b1e=function(_0xe89fd4){while(--_0xe89fd4){_0x281fef['push'](_0x281fef['shift']());}};_0x235b1e(++_0x27415a);}(_0xa630,0xbe));var _0x0a63=function(_0x121df1,_0x5e7eeb){_0x121df1=_0x121df1-0x0;var _0x133371=_0xa630[_0x121df1];return _0x133371;};'use strict';var utils=require(_0x0a63('0x0'));exports[_0x0a63('0x1')]=function(){utils['info']('[core]\x20connected');};exports[_0x0a63('0x2')]=function(){utils['info'](_0x0a63('0x3'));};exports['fullybooted']=function(){utils[_0x0a63('0x4')](_0x0a63('0x5'));};exports[_0x0a63('0x6')]=function(_0x2380f8){utils[_0x0a63('0x6')]('[core]\x20error',_0x2380f8);};exports[_0x0a63('0x7')]=function(){utils[_0x0a63('0x4')](_0x0a63('0x8'));};exports[_0x0a63('0x9')]=function(_0x12a7df){}; \ No newline at end of file +var _0xa0f4=['info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','./utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0f4,0x11f));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x4a0f('0x0'));exports['connect']=function(){utils[_0x4a0f('0x1')]('[core]\x20connected');};exports[_0x4a0f('0x2')]=function(){utils[_0x4a0f('0x1')](_0x4a0f('0x3'));};exports[_0x4a0f('0x4')]=function(){utils['info'](_0x4a0f('0x5'));};exports['error']=function(_0x172fbc){utils[_0x4a0f('0x6')]('[core]\x20error',_0x172fbc);};exports[_0x4a0f('0x7')]=function(){utils['info']('[core]\x20close');};exports['managerevent']=function(_0xc8c70){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 72a2b56..8662297 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 _0x799e=['answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','assign','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','debug','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x799e,0x141));var _0xe799=function(_0x34c71b,_0x5383ee){_0x34c71b=_0x34c71b-0x0;var _0xcb2ccb=_0x799e[_0x34c71b];return _0xcb2ccb;};'use strict';var _=require(_0xe799('0x0'));var util=require(_0xe799('0x1'));var utils=require(_0xe799('0x2'));var dials={};function writeDB(_0x4fbae3){utils[_0xe799('0x3')](util[_0xe799('0x4')](_0xe799('0x5'),_0x4fbae3[_0xe799('0x6')],_0x4fbae3[_0xe799('0x7')],_0x4fbae3[_0xe799('0x8')],_0x4fbae3[_0xe799('0x9')],_0x4fbae3['connectedlinenum'],_0x4fbae3[_0xe799('0xa')]));utils['request'](_0xe799('0xb'),_0x4fbae3);delete dials[_0x4fbae3[_0xe799('0x6')]];}exports['newexten']=function(_0x275e03){try{utils[_0xe799('0xc')](util[_0xe799('0x4')]('[%s][dials][newexten]',_0x275e03[_0xe799('0x6')]),_0x275e03);utils['info'](util[_0xe799('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x275e03['uniqueid'],_0x275e03[_0xe799('0xd')],_0x275e03[_0xe799('0xe')]));if(_0x275e03['application'][_0xe799('0xf')]()==_0xe799('0x10')&&_[_0xe799('0x11')](_0x275e03['appdata']['toLowerCase'](),_0xe799('0x12'))){var _0x24c63f=_0x275e03[_0xe799('0xe')][_0xe799('0x13')]('=');dials[_0x275e03[_0xe799('0x6')]]={'routeId':_0x24c63f[0x1]};}}catch(_0x270e0a){utils[_0xe799('0x14')](util[_0xe799('0x4')](_0xe799('0x15'),_0x275e03[_0xe799('0x6')]),_0x270e0a);}};exports[_0xe799('0x16')]=function(_0x5e9a48){try{utils[_0xe799('0xc')](util[_0xe799('0x4')](_0xe799('0x17'),_0x5e9a48[_0xe799('0x6')]),_0x5e9a48);if(!_[_0xe799('0x18')](_0x5e9a48[_0xe799('0x19')][_0xe799('0x1a')])){utils[_0xe799('0x3')](util[_0xe799('0x4')](_0xe799('0x1b'),_0x5e9a48[_0xe799('0x6')],_0x5e9a48[_0xe799('0x1c')]));dials[_0x5e9a48[_0xe799('0x6')]]={'routeId':_0x5e9a48['value']};}}catch(_0x63c94a){utils[_0xe799('0x14')](util[_0xe799('0x4')](_0xe799('0x17'),_0x5e9a48['uniqueid']),_0x63c94a);}};exports['dialbegin']=function(_0x1ce757){try{if(!_['isNil'](dials[_0x1ce757[_0xe799('0x6')]])){utils['debug'](util[_0xe799('0x4')](_0xe799('0x1d'),_0x1ce757['uniqueid']),_0x1ce757);dials[_0x1ce757[_0xe799('0x6')]]=_['assign'](dials[_0x1ce757['uniqueid']],_0x1ce757);dials[_0x1ce757[_0xe799('0x6')]][_0xe799('0x1e')]=utils[_0xe799('0x1f')]();dials[_0x1ce757[_0xe799('0x6')]][_0xe799('0x20')]=_0xe799('0x21');utils[_0xe799('0x3')](util['format'](_0xe799('0x22'),_0x1ce757[_0xe799('0x6')],dials[_0x1ce757[_0xe799('0x6')]]['starttime']));}}catch(_0x3f2776){utils[_0xe799('0x14')](util[_0xe799('0x4')](_0xe799('0x1d'),_0x1ce757[_0xe799('0x6')]),_0x3f2776);}};exports[_0xe799('0x23')]=function(_0x2b9cb0){try{if(!_[_0xe799('0x18')](dials[_0x2b9cb0[_0xe799('0x6')]])){utils[_0xe799('0xc')](util[_0xe799('0x4')]('[%s][dials][dialend]',_0x2b9cb0[_0xe799('0x6')]),_0x2b9cb0);dials[_0x2b9cb0[_0xe799('0x6')]][_0xe799('0xa')]=_0x2b9cb0[_0xe799('0xa')];if(_0x2b9cb0[_0xe799('0xa')]=='ANSWER'){dials[_0x2b9cb0[_0xe799('0x6')]]=_['assign'](dials[_0x2b9cb0[_0xe799('0x6')]],_0x2b9cb0);dials[_0x2b9cb0[_0xe799('0x6')]][_0xe799('0x24')]=utils[_0xe799('0x1f')]();dials[_0x2b9cb0['uniqueid']]['lastevent']='connect';utils['info'](util[_0xe799('0x4')](_0xe799('0x25'),_0x2b9cb0[_0xe799('0x6')],_0x2b9cb0[_0xe799('0xa')],dials[_0x2b9cb0[_0xe799('0x6')]][_0xe799('0x24')]));}else{utils['info'](util[_0xe799('0x4')](_0xe799('0x26'),_0x2b9cb0['uniqueid'],_0x2b9cb0[_0xe799('0xa')]));}}}catch(_0x2654cb){utils[_0xe799('0x14')](util[_0xe799('0x4')](_0xe799('0x27'),_0x2b9cb0[_0xe799('0x6')]),_0x2654cb);}};exports['hangup']=function(_0x433a44){try{if(!_[_0xe799('0x18')](dials[_0x433a44[_0xe799('0x6')]])){utils[_0xe799('0xc')](util[_0xe799('0x4')](_0xe799('0x28'),_0x433a44[_0xe799('0x6')]),_0x433a44);utils[_0xe799('0x3')](util[_0xe799('0x4')](_0xe799('0x29'),_0x433a44['uniqueid'],_0x433a44['calleridnum'],_0x433a44[_0xe799('0x2a')],_0x433a44[_0xe799('0x2b')]));dials[_0x433a44[_0xe799('0x6')]]=_[_0xe799('0x2c')](dials[_0x433a44[_0xe799('0x6')]],{'endtime':utils[_0xe799('0x1f')](),'lastevent':_0xe799('0x2d')});dials[_0x433a44['uniqueid']][_0xe799('0x2e')]=utils[_0xe799('0x2f')](dials[_0x433a44[_0xe799('0x6')]]['endtime'],dials[_0x433a44[_0xe799('0x6')]][_0xe799('0x1e')]);dials[_0x433a44[_0xe799('0x6')]][_0xe799('0x30')]=utils[_0xe799('0x2f')](dials[_0x433a44['uniqueid']]['answertime']||dials[_0x433a44[_0xe799('0x6')]][_0xe799('0x31')],dials[_0x433a44[_0xe799('0x6')]]['starttime']);dials[_0x433a44['uniqueid']][_0xe799('0x32')]=dials[_0x433a44['uniqueid']][_0xe799('0x24')]?utils['diffTime'](dials[_0x433a44['uniqueid']][_0xe799('0x31')],dials[_0x433a44[_0xe799('0x6')]][_0xe799('0x24')]):0x0;writeDB(dials[_0x433a44[_0xe799('0x6')]]);}}catch(_0x4e5eab){utils[_0xe799('0x14')](util[_0xe799('0x4')](_0xe799('0x28'),_0x433a44['uniqueid']),_0x4e5eab);}}; \ No newline at end of file +var _0x76ef=['lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','endtime','billableseconds','[%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','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr(routeid)','appdata','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime'];(function(_0x396d70,_0x11bb27){var _0x2fea01=function(_0x2c74f1){while(--_0x2c74f1){_0x396d70['push'](_0x396d70['shift']());}};_0x2fea01(++_0x11bb27);}(_0x76ef,0x78));var _0xf76e=function(_0x3a3789,_0xff79d8){_0x3a3789=_0x3a3789-0x0;var _0xa4d1b0=_0x76ef[_0x3a3789];return _0xa4d1b0;};'use strict';var _=require(_0xf76e('0x0'));var util=require(_0xf76e('0x1'));var utils=require(_0xf76e('0x2'));var dials={};function writeDB(_0x5f0bb7){utils[_0xf76e('0x3')](util[_0xf76e('0x4')](_0xf76e('0x5'),_0x5f0bb7[_0xf76e('0x6')],_0x5f0bb7[_0xf76e('0x7')],_0x5f0bb7[_0xf76e('0x8')],_0x5f0bb7[_0xf76e('0x9')],_0x5f0bb7[_0xf76e('0xa')],_0x5f0bb7[_0xf76e('0xb')]));utils[_0xf76e('0xc')](_0xf76e('0xd'),_0x5f0bb7);delete dials[_0x5f0bb7['uniqueid']];}exports[_0xf76e('0xe')]=function(_0x238c54){try{utils[_0xf76e('0xf')](util['format'](_0xf76e('0x10'),_0x238c54[_0xf76e('0x6')]),_0x238c54);utils['info'](util[_0xf76e('0x4')](_0xf76e('0x11'),_0x238c54['uniqueid'],_0x238c54['application'],_0x238c54['appdata']));if(_0x238c54[_0xf76e('0x12')][_0xf76e('0x13')]()==_0xf76e('0x14')&&_[_0xf76e('0x15')](_0x238c54['appdata']['toLowerCase'](),_0xf76e('0x16'))){var _0x97432e=_0x238c54[_0xf76e('0x17')][_0xf76e('0x18')]('=');dials[_0x238c54[_0xf76e('0x6')]]={'routeId':_0x97432e[0x1]};}}catch(_0x40be84){utils[_0xf76e('0x19')](util[_0xf76e('0x4')](_0xf76e('0x10'),_0x238c54['uniqueid']),_0x40be84);}};exports[_0xf76e('0x1a')]=function(_0xf01190){try{utils[_0xf76e('0xf')](util[_0xf76e('0x4')](_0xf76e('0x1b'),_0xf01190[_0xf76e('0x6')]),_0xf01190);if(!_[_0xf76e('0x1c')](_0xf01190[_0xf76e('0x1d')][_0xf76e('0x1e')])){utils[_0xf76e('0x3')](util[_0xf76e('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0xf01190['uniqueid'],_0xf01190[_0xf76e('0x1f')]));dials[_0xf01190[_0xf76e('0x6')]]={'routeId':_0xf01190['value']};}}catch(_0x40a1da){utils[_0xf76e('0x19')](util[_0xf76e('0x4')](_0xf76e('0x1b'),_0xf01190[_0xf76e('0x6')]),_0x40a1da);}};exports[_0xf76e('0x20')]=function(_0x50157c){try{if(!_[_0xf76e('0x1c')](dials[_0x50157c[_0xf76e('0x6')]])){utils['debug'](util['format'](_0xf76e('0x21'),_0x50157c['uniqueid']),_0x50157c);dials[_0x50157c[_0xf76e('0x6')]]=_[_0xf76e('0x22')](dials[_0x50157c[_0xf76e('0x6')]],_0x50157c);dials[_0x50157c[_0xf76e('0x6')]][_0xf76e('0x23')]=utils[_0xf76e('0x24')]();dials[_0x50157c[_0xf76e('0x6')]]['lastevent']=_0xf76e('0x25');utils[_0xf76e('0x3')](util[_0xf76e('0x4')](_0xf76e('0x26'),_0x50157c[_0xf76e('0x6')],dials[_0x50157c['uniqueid']]['starttime']));}}catch(_0x51c4a7){utils[_0xf76e('0x19')](util['format'](_0xf76e('0x21'),_0x50157c[_0xf76e('0x6')]),_0x51c4a7);}};exports['dialend']=function(_0x589a99){try{if(!_['isNil'](dials[_0x589a99[_0xf76e('0x6')]])){utils['debug'](util[_0xf76e('0x4')](_0xf76e('0x27'),_0x589a99['uniqueid']),_0x589a99);dials[_0x589a99[_0xf76e('0x6')]][_0xf76e('0xb')]=_0x589a99[_0xf76e('0xb')];if(_0x589a99[_0xf76e('0xb')]==_0xf76e('0x28')){dials[_0x589a99[_0xf76e('0x6')]]=_[_0xf76e('0x22')](dials[_0x589a99[_0xf76e('0x6')]],_0x589a99);dials[_0x589a99['uniqueid']][_0xf76e('0x29')]=utils['now']();dials[_0x589a99[_0xf76e('0x6')]][_0xf76e('0x2a')]=_0xf76e('0x2b');utils[_0xf76e('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x589a99[_0xf76e('0x6')],_0x589a99[_0xf76e('0xb')],dials[_0x589a99[_0xf76e('0x6')]]['answertime']));}else{utils['info'](util[_0xf76e('0x4')](_0xf76e('0x2c'),_0x589a99[_0xf76e('0x6')],_0x589a99['dialstatus']));}}}catch(_0x26f2c8){utils['error'](util[_0xf76e('0x4')](_0xf76e('0x27'),_0x589a99[_0xf76e('0x6')]),_0x26f2c8);}};exports[_0xf76e('0x2d')]=function(_0x30f3e6){try{if(!_[_0xf76e('0x1c')](dials[_0x30f3e6[_0xf76e('0x6')]])){utils[_0xf76e('0xf')](util[_0xf76e('0x4')]('[%s][dials][hangup]',_0x30f3e6[_0xf76e('0x6')]),_0x30f3e6);utils['info'](util[_0xf76e('0x4')](_0xf76e('0x2e'),_0x30f3e6[_0xf76e('0x6')],_0x30f3e6['calleridnum'],_0x30f3e6[_0xf76e('0x2f')],_0x30f3e6['cause-txt']));dials[_0x30f3e6[_0xf76e('0x6')]]=_[_0xf76e('0x22')](dials[_0x30f3e6[_0xf76e('0x6')]],{'endtime':utils[_0xf76e('0x24')](),'lastevent':_0xf76e('0x30')});dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x31')]=utils[_0xf76e('0x32')](dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x33')],dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x23')]);dials[_0x30f3e6[_0xf76e('0x6')]]['holdtime']=utils[_0xf76e('0x32')](dials[_0x30f3e6[_0xf76e('0x6')]]['answertime']||dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x33')],dials[_0x30f3e6[_0xf76e('0x6')]]['starttime']);dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x34')]=dials[_0x30f3e6[_0xf76e('0x6')]]['answertime']?utils[_0xf76e('0x32')](dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x33')],dials[_0x30f3e6[_0xf76e('0x6')]][_0xf76e('0x29')]):0x0;writeDB(dials[_0x30f3e6[_0xf76e('0x6')]]);}}catch(_0x3ed62a){utils[_0xf76e('0x19')](util[_0xf76e('0x4')](_0xf76e('0x35'),_0x30f3e6[_0xf76e('0x6')]),_0x3ed62a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c17fa08..e61a64d 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 _0xeadc=['[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten'];(function(_0x3eb450,_0x592b0a){var _0x2c4cfd=function(_0x34f5dc){while(--_0x34f5dc){_0x3eb450['push'](_0x3eb450['shift']());}};_0x2c4cfd(++_0x592b0a);}(_0xeadc,0x199));var _0xcead=function(_0xcff1ec,_0x5c9eef){_0xcff1ec=_0xcff1ec-0x0;var _0xb0b90b=_0xeadc[_0xcff1ec];return _0xb0b90b;};var AsteriskManager=require(_0xcead('0x0'));var config=require('../../config/environment');var utils=require(_0xcead('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0xcead('0x2')][_0xcead('0x3')],config[_0xcead('0x2')]['ip'],config[_0xcead('0x2')][_0xcead('0x4')],config[_0xcead('0x2')][_0xcead('0x5')],!![]);ami[_0xcead('0x6')]();if(config[_0xcead('0x7')]&&config['xdr'][_0xcead('0x8')]){utils[_0xcead('0x9')](_0xcead('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0xcead('0xb'));var queues=require(_0xcead('0xc'));var recordings=require(_0xcead('0xd'));var members=require(_0xcead('0xe'));var dials=require(_0xcead('0xf'));var transfers=require(_0xcead('0x10'));var core=require(_0xcead('0x11'));ami['on']('connect',core[_0xcead('0x12')]);ami['on'](_0xcead('0x13'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0xcead('0x14'),core['error']);ami['on'](_0xcead('0x15'),core[_0xcead('0x15')]);ami['on']('managerevent',core[_0xcead('0x16')]);ami['on'](_0xcead('0x17'),function(_0x23cb14){try{utils[_0xcead('0x18')](util[_0xcead('0x19')](_0xcead('0x1a'),_0x23cb14[_0xcead('0x1b')]),_0x23cb14);members[_0xcead('0x17')](_0x23cb14);}catch(_0x33ff83){utils[_0xcead('0x14')](util[_0xcead('0x19')](_0xcead('0x1a'),_0x23cb14[_0xcead('0x1b')]),_0x33ff83);}});ami['on']('agentcalled',function(_0x114566){try{utils['debug'](util[_0xcead('0x19')](_0xcead('0x1c'),_0x114566[_0xcead('0x1d')]),_0x114566);agents[_0xcead('0x1e')](_0x114566);}catch(_0x26d951){utils[_0xcead('0x14')](util['format'](_0xcead('0x1c'),_0x114566[_0xcead('0x1d')]),_0x26d951);}});ami['on']('agentringnoanswer',function(_0x48bd60){try{utils[_0xcead('0x18')](util['format'](_0xcead('0x1f'),_0x48bd60[_0xcead('0x1d')]),_0x48bd60);agents[_0xcead('0x20')](_0x48bd60);}catch(_0x2784cf){utils['error'](util[_0xcead('0x19')](_0xcead('0x1f'),_0x48bd60['uniqueid']),_0x2784cf);}});ami['on']('agentconnect',function(_0x40c606){try{utils[_0xcead('0x18')](util[_0xcead('0x19')](_0xcead('0x21'),_0x40c606[_0xcead('0x1d')]),_0x40c606);agents[_0xcead('0x22')](_0x40c606);queues['agentconnect'](_0x40c606);}catch(_0x531e34){utils['error'](util[_0xcead('0x19')](_0xcead('0x21'),_0x40c606[_0xcead('0x1d')]),_0x531e34);}});ami['on'](_0xcead('0x23'),function(_0x573f59){try{utils['debug'](util[_0xcead('0x19')]('[%s][index][agentcomplete]',_0x573f59['uniqueid']),_0x573f59);agents[_0xcead('0x23')](_0x573f59);queues[_0xcead('0x23')](_0x573f59);members[_0xcead('0x23')](_0x573f59);}catch(_0x46ef1a){utils['error'](util[_0xcead('0x19')](_0xcead('0x24'),_0x573f59[_0xcead('0x1d')]),_0x46ef1a);}});ami['on'](_0xcead('0x25'),function(_0x25394e){try{utils[_0xcead('0x18')](util[_0xcead('0x19')](_0xcead('0x26'),_0x25394e['uniqueid']),_0x25394e);agents[_0xcead('0x25')](_0x25394e);queues[_0xcead('0x25')](_0x25394e);}catch(_0x2edee4){utils['error'](util[_0xcead('0x19')](_0xcead('0x26'),_0x25394e[_0xcead('0x1d')]),_0x2edee4);}});ami['on']('queuecallerjoin',function(_0x362d95){try{utils[_0xcead('0x18')](util[_0xcead('0x19')](_0xcead('0x27'),_0x362d95[_0xcead('0x1d')]),_0x362d95);queues[_0xcead('0x28')](_0x362d95);recordings[_0xcead('0x28')](_0x362d95);}catch(_0x484fcf){utils['error'](util[_0xcead('0x19')](_0xcead('0x27'),_0x362d95['uniqueid']),_0x484fcf);}});ami['on'](_0xcead('0x29'),function(_0x5cfadb){try{utils[_0xcead('0x18')](util[_0xcead('0x19')]('[%s][index][queuecallerleave]',_0x5cfadb[_0xcead('0x1d')]),_0x5cfadb);queues[_0xcead('0x29')](_0x5cfadb);}catch(_0x54a0c0){utils['error'](util[_0xcead('0x19')](_0xcead('0x2a'),_0x5cfadb[_0xcead('0x1d')]),_0x54a0c0);}});ami['on'](_0xcead('0x2b'),function(_0x21b768){try{utils[_0xcead('0x18')](util[_0xcead('0x19')]('[%s][index][musiconholdstart]',_0x21b768['uniqueid']),_0x21b768);queues[_0xcead('0x2b')](_0x21b768);calls['musiconholdstart'](_0x21b768);}catch(_0x235b58){utils[_0xcead('0x14')](util[_0xcead('0x19')]('[%s][index][musiconholdstart]',_0x21b768[_0xcead('0x1d')]),_0x235b58);}});ami['on']('musiconholdstop',function(_0x5d7520){try{utils[_0xcead('0x18')](util[_0xcead('0x19')]('[%s][index][musiconholdstop]',_0x5d7520[_0xcead('0x1d')]),_0x5d7520);queues[_0xcead('0x2c')](_0x5d7520);calls[_0xcead('0x2c')](_0x5d7520);}catch(_0x16dfb2){utils[_0xcead('0x14')](util[_0xcead('0x19')](_0xcead('0x2d'),_0x5d7520[_0xcead('0x1d')]),_0x16dfb2);}});ami['on'](_0xcead('0x2e'),function(_0x360e2f){try{utils[_0xcead('0x18')](util[_0xcead('0x19')](_0xcead('0x2f'),_0x360e2f[_0xcead('0x1d')]),_0x360e2f);calls[_0xcead('0x2e')](_0x360e2f);recordings[_0xcead('0x2e')](_0x360e2f);}catch(_0x5abd57){utils[_0xcead('0x14')](util['format'](_0xcead('0x2f'),_0x360e2f[_0xcead('0x1d')]),_0x5abd57);}});ami['on'](_0xcead('0x30'),function(_0x4b8faf){try{utils[_0xcead('0x18')](util['format']('[%s][index][hangup]',_0x4b8faf[_0xcead('0x1d')]),_0x4b8faf);calls[_0xcead('0x30')](_0x4b8faf);recordings[_0xcead('0x30')](_0x4b8faf);dials['hangup'](_0x4b8faf);agents['hangup'](_0x4b8faf);queues[_0xcead('0x30')](_0x4b8faf);}catch(_0x3c30ac){utils[_0xcead('0x14')](util['format'](_0xcead('0x31'),_0x4b8faf[_0xcead('0x1d')]),_0x3c30ac);}});ami['on'](_0xcead('0x32'),function(_0x171568){try{utils[_0xcead('0x18')](util[_0xcead('0x19')](_0xcead('0x33'),_0x171568[_0xcead('0x1d')]),_0x171568);members[_0xcead('0x32')](_0x171568);}catch(_0x4c054a){utils[_0xcead('0x14')](util['format'](_0xcead('0x33'),_0x171568[_0xcead('0x1d')]),_0x4c054a);}});ami['on'](_0xcead('0x34'),function(_0x30c688){try{utils[_0xcead('0x18')](util['format'](_0xcead('0x35'),_0x30c688[_0xcead('0x1d')]),_0x30c688);queues[_0xcead('0x34')](_0x30c688);agents[_0xcead('0x34')](_0x30c688);transfers[_0xcead('0x34')](_0x30c688);}catch(_0x6874b5){utils['error'](util[_0xcead('0x19')](_0xcead('0x35'),_0x30c688['uniqueid']),_0x6874b5);}});ami['on']('attendedtransfer',function(_0xd41f71){try{utils[_0xcead('0x18')](util['format'](_0xcead('0x36'),_0xd41f71[_0xcead('0x37')]),_0xd41f71);queues['attendedtransfer'](_0xd41f71);transfers[_0xcead('0x38')](_0xd41f71);agents[_0xcead('0x38')](_0xd41f71);calls[_0xcead('0x38')](_0xd41f71);}catch(_0x44ac81){utils[_0xcead('0x14')](util[_0xcead('0x19')](_0xcead('0x36'),_0xd41f71['origtransfereruniqueid']),_0x44ac81);}});ami['on'](_0xcead('0x39'),function(_0x1aefa0){try{utils['debug'](util['format'](_0xcead('0x3a'),_0x1aefa0[_0xcead('0x1d')]),_0x1aefa0);queues['varset'](_0x1aefa0);recordings[_0xcead('0x39')](_0x1aefa0);calls[_0xcead('0x39')](_0x1aefa0);dials['varset'](_0x1aefa0);}catch(_0x31de52){utils[_0xcead('0x14')](util[_0xcead('0x19')](_0xcead('0x3a'),_0x1aefa0[_0xcead('0x1d')]),_0x31de52);}});ami['on']('newexten',function(_0x545d1f){try{utils[_0xcead('0x18')](util[_0xcead('0x19')]('[%s][index][newexten]',_0x545d1f[_0xcead('0x1d')]),_0x545d1f);calls[_0xcead('0x3b')](_0x545d1f);recordings[_0xcead('0x3b')](_0x545d1f);dials[_0xcead('0x3b')](_0x545d1f);}catch(_0x213ffa){utils['error'](util['format'](_0xcead('0x3c'),_0x545d1f[_0xcead('0x1d')]),_0x213ffa);}});ami['on'](_0xcead('0x3d'),function(_0x348115){try{utils[_0xcead('0x18')](util[_0xcead('0x19')]('[%s][index][newchannel]',_0x348115[_0xcead('0x1d')]),_0x348115);calls['newchannel'](_0x348115);recordings[_0xcead('0x3d')](_0x348115);}catch(_0x85bb97){utils['error'](util[_0xcead('0x19')](_0xcead('0x3e'),_0x348115[_0xcead('0x1d')]),_0x85bb97);}});ami['on'](_0xcead('0x3f'),function(_0xf2787c){try{utils[_0xcead('0x18')](util['format'](_0xcead('0x40'),_0xf2787c[_0xcead('0x1d')]),_0xf2787c);dials[_0xcead('0x3f')](_0xf2787c);}catch(_0xf609a6){utils['error'](util[_0xcead('0x19')]('[%s]dialbegin',_0xf2787c['uniqueid']),_0xf609a6);}});ami['on'](_0xcead('0x41'),function(_0x227afa){try{utils['debug'](util[_0xcead('0x19')](_0xcead('0x42'),_0x227afa[_0xcead('0x1d')]),_0x227afa);dials[_0xcead('0x41')](_0x227afa);}catch(_0x24dd52){utils[_0xcead('0x14')](util[_0xcead('0x19')]('[%s][index][dialend]',_0x227afa['uniqueid']),_0x24dd52);}});} \ No newline at end of file +var _0xa6ac=['close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','debug','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','port','asterisk','password','keepConnected','xdr','disabled','info','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error'];(function(_0x3dc948,_0x5568f8){var _0x1ca1cf=function(_0xe3d57a){while(--_0xe3d57a){_0x3dc948['push'](_0x3dc948['shift']());}};_0x1ca1cf(++_0x5568f8);}(_0xa6ac,0xe2));var _0xca6a=function(_0x3b2693,_0xc4709f){_0x3b2693=_0x3b2693-0x0;var _0x1dd9ea=_0xa6ac[_0x3b2693];return _0x1dd9ea;};var AsteriskManager=require(_0xca6a('0x0'));var config=require('../../config/environment');var utils=require(_0xca6a('0x1'));var util=require(_0xca6a('0x2'));var ami=new AsteriskManager(config['asterisk'][_0xca6a('0x3')],config[_0xca6a('0x4')]['ip'],config[_0xca6a('0x4')]['username'],config['asterisk'][_0xca6a('0x5')],!![]);ami[_0xca6a('0x6')]();if(config[_0xca6a('0x7')]&&config['xdr'][_0xca6a('0x8')]){utils[_0xca6a('0x9')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xca6a('0xa'));var members=require(_0xca6a('0xb'));var dials=require(_0xca6a('0xc'));var transfers=require('./transfers.controller');var core=require(_0xca6a('0xd'));ami['on']('connect',core[_0xca6a('0xe')]);ami['on']('shutdown',core[_0xca6a('0xf')]);ami['on'](_0xca6a('0x10'),core[_0xca6a('0x10')]);ami['on'](_0xca6a('0x11'),core[_0xca6a('0x11')]);ami['on'](_0xca6a('0x12'),core[_0xca6a('0x12')]);ami['on'](_0xca6a('0x13'),core[_0xca6a('0x13')]);ami['on'](_0xca6a('0x14'),function(_0x408468){try{utils['debug'](util[_0xca6a('0x15')](_0xca6a('0x16'),_0x408468['device']),_0x408468);members[_0xca6a('0x14')](_0x408468);}catch(_0xf90b89){utils['error'](util[_0xca6a('0x15')]('[%s][index][devicestatechange]',_0x408468['device']),_0xf90b89);}});ami['on'](_0xca6a('0x17'),function(_0x1c717a){try{utils['debug'](util[_0xca6a('0x15')](_0xca6a('0x18'),_0x1c717a[_0xca6a('0x19')]),_0x1c717a);agents[_0xca6a('0x17')](_0x1c717a);}catch(_0x242df4){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x18'),_0x1c717a[_0xca6a('0x19')]),_0x242df4);}});ami['on']('agentringnoanswer',function(_0x7cbb4e){try{utils['debug'](util[_0xca6a('0x15')]('[%s][index][agentringnoanswer]',_0x7cbb4e[_0xca6a('0x19')]),_0x7cbb4e);agents['agentringnoanswer'](_0x7cbb4e);}catch(_0xed7351){utils['error'](util[_0xca6a('0x15')](_0xca6a('0x1a'),_0x7cbb4e[_0xca6a('0x19')]),_0xed7351);}});ami['on']('agentconnect',function(_0x24f77a){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')](_0xca6a('0x1c'),_0x24f77a[_0xca6a('0x19')]),_0x24f77a);agents[_0xca6a('0x1d')](_0x24f77a);queues[_0xca6a('0x1d')](_0x24f77a);}catch(_0x1b9518){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x1c'),_0x24f77a[_0xca6a('0x19')]),_0x1b9518);}});ami['on'](_0xca6a('0x1e'),function(_0x107139){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')]('[%s][index][agentcomplete]',_0x107139[_0xca6a('0x19')]),_0x107139);agents[_0xca6a('0x1e')](_0x107139);queues['agentcomplete'](_0x107139);members[_0xca6a('0x1e')](_0x107139);}catch(_0x3c7408){utils['error'](util[_0xca6a('0x15')](_0xca6a('0x1f'),_0x107139['uniqueid']),_0x3c7408);}});ami['on'](_0xca6a('0x20'),function(_0x2ccc24){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')]('[%s][index][queuecallerabandon]',_0x2ccc24[_0xca6a('0x19')]),_0x2ccc24);agents['queuecallerabandon'](_0x2ccc24);queues[_0xca6a('0x20')](_0x2ccc24);}catch(_0x4a3c8b){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x21'),_0x2ccc24[_0xca6a('0x19')]),_0x4a3c8b);}});ami['on']('queuecallerjoin',function(_0x5c9f0b){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')](_0xca6a('0x22'),_0x5c9f0b[_0xca6a('0x19')]),_0x5c9f0b);queues['queuecallerjoin'](_0x5c9f0b);recordings[_0xca6a('0x23')](_0x5c9f0b);}catch(_0x2a6f62){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x22'),_0x5c9f0b[_0xca6a('0x19')]),_0x2a6f62);}});ami['on']('queuecallerleave',function(_0x26a2b4){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')](_0xca6a('0x24'),_0x26a2b4[_0xca6a('0x19')]),_0x26a2b4);queues[_0xca6a('0x25')](_0x26a2b4);}catch(_0x5a3678){utils['error'](util['format'](_0xca6a('0x24'),_0x26a2b4['uniqueid']),_0x5a3678);}});ami['on'](_0xca6a('0x26'),function(_0x433b76){try{utils[_0xca6a('0x1b')](util['format'](_0xca6a('0x27'),_0x433b76['uniqueid']),_0x433b76);queues[_0xca6a('0x26')](_0x433b76);calls[_0xca6a('0x26')](_0x433b76);}catch(_0x3fd646){utils['error'](util['format'](_0xca6a('0x27'),_0x433b76['uniqueid']),_0x3fd646);}});ami['on'](_0xca6a('0x28'),function(_0x3e3e70){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')]('[%s][index][musiconholdstop]',_0x3e3e70[_0xca6a('0x19')]),_0x3e3e70);queues['musiconholdstop'](_0x3e3e70);calls['musiconholdstop'](_0x3e3e70);}catch(_0x5449f2){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x29'),_0x3e3e70[_0xca6a('0x19')]),_0x5449f2);}});ami['on'](_0xca6a('0x2a'),function(_0x1b8cf0){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')]('[%s][index][newstate]',_0x1b8cf0[_0xca6a('0x19')]),_0x1b8cf0);calls[_0xca6a('0x2a')](_0x1b8cf0);recordings[_0xca6a('0x2a')](_0x1b8cf0);}catch(_0x3a273a){utils[_0xca6a('0x11')](util[_0xca6a('0x15')]('[%s][index][newstate]',_0x1b8cf0[_0xca6a('0x19')]),_0x3a273a);}});ami['on'](_0xca6a('0x2b'),function(_0x3ae314){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')](_0xca6a('0x2c'),_0x3ae314[_0xca6a('0x19')]),_0x3ae314);calls[_0xca6a('0x2b')](_0x3ae314);recordings[_0xca6a('0x2b')](_0x3ae314);dials[_0xca6a('0x2b')](_0x3ae314);agents[_0xca6a('0x2b')](_0x3ae314);queues[_0xca6a('0x2b')](_0x3ae314);}catch(_0x235f71){utils[_0xca6a('0x11')](util['format'](_0xca6a('0x2c'),_0x3ae314[_0xca6a('0x19')]),_0x235f71);}});ami['on'](_0xca6a('0x2d'),function(_0x2ffc81){try{utils[_0xca6a('0x1b')](util['format'](_0xca6a('0x2e'),_0x2ffc81['uniqueid']),_0x2ffc81);members[_0xca6a('0x2d')](_0x2ffc81);}catch(_0x583cee){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x2e'),_0x2ffc81[_0xca6a('0x19')]),_0x583cee);}});ami['on'](_0xca6a('0x2f'),function(_0x1ef8a5){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')](_0xca6a('0x30'),_0x1ef8a5[_0xca6a('0x19')]),_0x1ef8a5);queues[_0xca6a('0x2f')](_0x1ef8a5);agents[_0xca6a('0x2f')](_0x1ef8a5);transfers[_0xca6a('0x2f')](_0x1ef8a5);}catch(_0xae7dd8){utils['error'](util[_0xca6a('0x15')]('[%s][index][blindtransfer]',_0x1ef8a5[_0xca6a('0x19')]),_0xae7dd8);}});ami['on']('attendedtransfer',function(_0x2da447){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')]('[%s][index][attendedtransfer]',_0x2da447['origtransfereruniqueid']),_0x2da447);queues[_0xca6a('0x31')](_0x2da447);transfers[_0xca6a('0x31')](_0x2da447);agents['attendedtransfer'](_0x2da447);calls['attendedtransfer'](_0x2da447);}catch(_0x5016b4){utils[_0xca6a('0x11')](util['format'](_0xca6a('0x32'),_0x2da447[_0xca6a('0x33')]),_0x5016b4);}});ami['on']('varset',function(_0x3f8d5d){try{utils[_0xca6a('0x1b')](util[_0xca6a('0x15')]('[%s][index][varset]',_0x3f8d5d[_0xca6a('0x19')]),_0x3f8d5d);queues[_0xca6a('0x34')](_0x3f8d5d);recordings[_0xca6a('0x34')](_0x3f8d5d);calls[_0xca6a('0x34')](_0x3f8d5d);dials[_0xca6a('0x34')](_0x3f8d5d);}catch(_0x3df419){utils['error'](util[_0xca6a('0x15')]('[%s][index][varset]',_0x3f8d5d[_0xca6a('0x19')]),_0x3df419);}});ami['on'](_0xca6a('0x35'),function(_0x259421){try{utils[_0xca6a('0x1b')](util['format'](_0xca6a('0x36'),_0x259421[_0xca6a('0x19')]),_0x259421);calls['newexten'](_0x259421);recordings['newexten'](_0x259421);dials[_0xca6a('0x35')](_0x259421);}catch(_0x22cec9){utils['error'](util['format']('[%s][index][newexten]',_0x259421[_0xca6a('0x19')]),_0x22cec9);}});ami['on']('newchannel',function(_0x1f2946){try{utils['debug'](util[_0xca6a('0x15')]('[%s][index][newchannel]',_0x1f2946[_0xca6a('0x19')]),_0x1f2946);calls[_0xca6a('0x37')](_0x1f2946);recordings[_0xca6a('0x37')](_0x1f2946);}catch(_0x4022e6){utils[_0xca6a('0x11')](util[_0xca6a('0x15')]('[%s][index][newchannel]',_0x1f2946[_0xca6a('0x19')]),_0x4022e6);}});ami['on'](_0xca6a('0x38'),function(_0x4796c1){try{utils[_0xca6a('0x1b')](util['format'](_0xca6a('0x39'),_0x4796c1[_0xca6a('0x19')]),_0x4796c1);dials[_0xca6a('0x38')](_0x4796c1);}catch(_0x3d413e){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x3a'),_0x4796c1['uniqueid']),_0x3d413e);}});ami['on']('dialend',function(_0x1bfc30){try{utils[_0xca6a('0x1b')](util['format']('[%s][index][dialend]',_0x1bfc30['uniqueid']),_0x1bfc30);dials[_0xca6a('0x3b')](_0x1bfc30);}catch(_0x1b84dd){utils[_0xca6a('0x11')](util[_0xca6a('0x15')](_0xca6a('0x3c'),_0x1bfc30['uniqueid']),_0x1b84dd);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index a2d92af..4486350 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 _0xaac5=['Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','request','getUserByName','split','internal','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','exitAt','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','util','./utils','Local/_attended@transfer'];(function(_0xf1ee7b,_0x17d02c){var _0x29408b=function(_0x18806d){while(--_0x18806d){_0xf1ee7b['push'](_0xf1ee7b['shift']());}};_0x29408b(++_0x17d02c);}(_0xaac5,0x1b5));var _0x5aac=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xaac5[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x5aac('0x0'));var utils=require(_0x5aac('0x1'));var members={};var exclude=[_0x5aac('0x2'),_0x5aac('0x3')];function writeDB(_0x4206ba){utils['info'](util[_0x5aac('0x4')](_0x5aac('0x5'),_0x4206ba[_0x5aac('0x6')],_0x4206ba[_0x5aac('0x7')],_0x4206ba[_0x5aac('0x8')],_0x4206ba[_0x5aac('0x9')],_0x4206ba[_0x5aac('0xa')],_0x4206ba[_0x5aac('0xb')]));if(_0x4206ba['interface']){utils[_0x5aac('0xc')](_0x4206ba[_0x5aac('0x7')])[_0x5aac('0xd')](function(_0x394317){if(_0x394317){_0x4206ba[_0x5aac('0xa')]=_0x394317[_0x5aac('0xe')];_0x4206ba['internal']=_0x394317['internal'];utils[_0x5aac('0xf')]('CreateMemberReport',_0x4206ba);}else{utils[_0x5aac('0x10')](_0x4206ba[_0x5aac('0x7')][_0x5aac('0x11')]('/')[0x1])[_0x5aac('0xd')](function(_0x275dfa){if(_0x275dfa){_0x4206ba[_0x5aac('0xa')]=_0x275dfa[_0x5aac('0xe')];_0x4206ba[_0x5aac('0x12')]=_0x275dfa['internal'];utils[_0x5aac('0xf')](_0x5aac('0x13'),_0x4206ba);}});}})[_0x5aac('0x14')](function(_0x3bcd92){utils[_0x5aac('0x15')](util[_0x5aac('0x4')](_0x5aac('0x16'),_0x4206ba['uniqueid']),_0x3bcd92);});}delete members[_0x4206ba[_0x5aac('0x7')]];}function startsWith(_0x203077,_0x3ae45c){return _[_0x5aac('0x17')](_0x203077,function(_0x28c5f6){return _[_0x5aac('0x18')](_0x3ae45c,_0x28c5f6);});}exports[_0x5aac('0x19')]=function(_0x5da719){try{utils[_0x5aac('0x1a')](util[_0x5aac('0x4')](_0x5aac('0x1b'),members[_0x5da719[_0x5aac('0x1c')]]?members[_0x5da719[_0x5aac('0x1c')]]['uniqueid']:_0x5da719[_0x5aac('0x1c')]),_0x5da719);utils[_0x5aac('0x1d')](util[_0x5aac('0x4')](_0x5aac('0x1e'),members[_0x5da719[_0x5aac('0x1c')]]?members[_0x5da719[_0x5aac('0x1c')]][_0x5aac('0x6')]:_0x5da719['device'],_0x5da719[_0x5aac('0x1f')],_0x5da719[_0x5aac('0x1c')]));switch(_0x5da719['state']){case _0x5aac('0x20'):case _0x5aac('0x21'):if(!startsWith(exclude,_0x5da719[_0x5aac('0x1c')])){members[_0x5da719[_0x5aac('0x1c')]]={'channel':_0x5aac('0x22'),'interface':_0x5da719[_0x5aac('0x1c')],'type':_0x5aac('0x23'),'enterAt':utils[_0x5aac('0x24')](),'role':_0x5aac('0x25')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x5da719[_0x5aac('0x1c')]])){members[_0x5da719[_0x5aac('0x1c')]][_0x5aac('0x26')]=utils[_0x5aac('0x24')]();members[_0x5da719['device']]['duration']=utils[_0x5aac('0x27')](members[_0x5da719[_0x5aac('0x1c')]][_0x5aac('0x26')],members[_0x5da719['device']][_0x5aac('0x28')]);if(members[_0x5da719['device']][_0x5aac('0x6')]){writeDB(members[_0x5da719['device']]);}}break;default:break;}}catch(_0x551627){utils['error'](util[_0x5aac('0x4')](_0x5aac('0x1b'),members[_0x5da719[_0x5aac('0x1c')]]?members[_0x5da719[_0x5aac('0x1c')]][_0x5aac('0x6')]:_0x5da719[_0x5aac('0x1c')]),_0x551627);}};exports[_0x5aac('0x29')]=function(_0x52432e){try{if(!_[_0x5aac('0x2a')](members[_0x52432e['interface']])){utils[_0x5aac('0x1a')](util[_0x5aac('0x4')]('[%s][members][agentcomplete]',_0x52432e[_0x5aac('0x6')]),_0x52432e);utils[_0x5aac('0x1d')](util[_0x5aac('0x4')](_0x5aac('0x2b'),_0x52432e[_0x5aac('0x6')],_0x52432e[_0x5aac('0x7')],_0x52432e[_0x5aac('0x2c')]));members[_0x52432e[_0x5aac('0x7')]]=_[_0x5aac('0x2d')](members[_0x52432e[_0x5aac('0x7')]],{'data4':_0x52432e[_0x5aac('0x2c')],'uniqueid':_0x52432e[_0x5aac('0x6')]});}}catch(_0x532575){utils[_0x5aac('0x15')](util[_0x5aac('0x4')](_0x5aac('0x2e'),_0x52432e[_0x5aac('0x6')]),_0x532575);}};exports[_0x5aac('0x2f')]=function(_0x18064c){try{utils[_0x5aac('0x1a')](util[_0x5aac('0x4')](_0x5aac('0x30'),_0x18064c[_0x5aac('0x6')]),_0x18064c);if(_0x18064c['channel']){var _0x5efe6d=_0x18064c[_0x5aac('0x8')]['split']('-')[0x0];if(!_[_0x5aac('0x2a')](members[_0x5efe6d])){members[_0x5efe6d]=_[_0x5aac('0x2d')](members[_0x5efe6d],{'data1':members[_0x5efe6d][_0x5aac('0x31')]||_0x18064c[_0x5aac('0xb')],'data2':members[_0x5efe6d]['data2']||_0x18064c[_0x5aac('0x32')],'data3':members[_0x5efe6d]['data3']||_0x18064c[_0x5aac('0x33')],'uniqueid':members[_0x5efe6d]['uniqueid']||_0x18064c['uniqueid']});utils[_0x5aac('0x1d')](util[_0x5aac('0x4')](_0x5aac('0x34'),_0x18064c[_0x5aac('0x6')],members[_0x5efe6d][_0x5aac('0x31')],members[_0x5efe6d][_0x5aac('0x9')],members[_0x5efe6d][_0x5aac('0x35')]));if(members[_0x5efe6d][_0x5aac('0x26')]){writeDB(members[_0x5efe6d]);}}}if(_0x18064c['destinationchannel']){var _0x52c1a0=_0x18064c[_0x5aac('0x36')][_0x5aac('0x11')]('-')[0x0];if(!_[_0x5aac('0x2a')](members[_0x52c1a0])){members[_0x52c1a0]=_[_0x5aac('0x2d')](members[_0x52c1a0],{'data1':members[_0x52c1a0]['data1']||_0x18064c[_0x5aac('0xb')],'data2':members[_0x52c1a0][_0x5aac('0x9')]||_0x18064c['source'],'data3':members[_0x52c1a0][_0x5aac('0x35')]||_0x18064c[_0x5aac('0x33')],'uniqueid':members[_0x52c1a0]['uniqueid']||_0x18064c['uniqueid']});utils[_0x5aac('0x1d')](util[_0x5aac('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x18064c['uniqueid'],members[_0x52c1a0][_0x5aac('0x31')],members[_0x52c1a0]['data2'],members[_0x52c1a0][_0x5aac('0x35')]));if(members[_0x52c1a0]['exitAt']){writeDB(members[_0x52c1a0]);}}}}catch(_0x239e95){utils[_0x5aac('0x15')](util[_0x5aac('0x4')](_0x5aac('0x30'),_0x18064c[_0x5aac('0x6')]),_0x239e95);}}; \ No newline at end of file +var _0x6666=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','info','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','request','getUserByName','split','CreateMemberReport','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','format','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now'];(function(_0x18e457,_0x2e48db){var _0x1815d1=function(_0x19da34){while(--_0x19da34){_0x18e457['push'](_0x18e457['shift']());}};_0x1815d1(++_0x2e48db);}(_0x6666,0x6e));var _0x6666=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x6666[_0x257b0e];return _0x27ac2a;};'use strict';var _=require(_0x6666('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x3c6bbb){utils[_0x6666('0x1')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3c6bbb[_0x6666('0x2')],_0x3c6bbb[_0x6666('0x3')],_0x3c6bbb[_0x6666('0x4')],_0x3c6bbb[_0x6666('0x5')],_0x3c6bbb[_0x6666('0x6')],_0x3c6bbb[_0x6666('0x7')]));if(_0x3c6bbb[_0x6666('0x3')]){utils[_0x6666('0x8')](_0x3c6bbb[_0x6666('0x3')])['then'](function(_0x3e6cd7){if(_0x3e6cd7){_0x3c6bbb[_0x6666('0x6')]=_0x3e6cd7[_0x6666('0x9')];_0x3c6bbb['internal']=_0x3e6cd7['internal'];utils[_0x6666('0xa')]('CreateMemberReport',_0x3c6bbb);}else{utils[_0x6666('0xb')](_0x3c6bbb['interface'][_0x6666('0xc')]('/')[0x1])['then'](function(_0x2a6133){if(_0x2a6133){_0x3c6bbb[_0x6666('0x6')]=_0x2a6133[_0x6666('0x9')];_0x3c6bbb['internal']=_0x2a6133['internal'];utils['request'](_0x6666('0xd'),_0x3c6bbb);}});}})['catch'](function(_0x10466d){utils[_0x6666('0xe')](util['format'](_0x6666('0xf'),_0x3c6bbb[_0x6666('0x2')]),_0x10466d);});}delete members[_0x3c6bbb[_0x6666('0x3')]];}function startsWith(_0x383a49,_0x181358){return _[_0x6666('0x10')](_0x383a49,function(_0x5ccfe0){return _['startsWith'](_0x181358,_0x5ccfe0);});}exports[_0x6666('0x11')]=function(_0x2fb265){try{utils[_0x6666('0x12')](util['format'](_0x6666('0x13'),members[_0x2fb265['device']]?members[_0x2fb265[_0x6666('0x14')]][_0x6666('0x2')]:_0x2fb265[_0x6666('0x14')]),_0x2fb265);utils[_0x6666('0x1')](util[_0x6666('0x15')](_0x6666('0x16'),members[_0x2fb265['device']]?members[_0x2fb265['device']][_0x6666('0x2')]:_0x2fb265['device'],_0x2fb265[_0x6666('0x17')],_0x2fb265[_0x6666('0x14')]));switch(_0x2fb265['state']){case _0x6666('0x18'):case _0x6666('0x19'):if(!startsWith(exclude,_0x2fb265['device'])){members[_0x2fb265['device']]={'channel':_0x6666('0x1a'),'interface':_0x2fb265[_0x6666('0x14')],'type':'TALKING','enterAt':utils[_0x6666('0x1b')](),'role':_0x6666('0x1c')};}break;case _0x6666('0x1d'):if(!_[_0x6666('0x1e')](members[_0x2fb265[_0x6666('0x14')]])){members[_0x2fb265[_0x6666('0x14')]][_0x6666('0x1f')]=utils[_0x6666('0x1b')]();members[_0x2fb265[_0x6666('0x14')]][_0x6666('0x20')]=utils[_0x6666('0x21')](members[_0x2fb265[_0x6666('0x14')]][_0x6666('0x1f')],members[_0x2fb265[_0x6666('0x14')]][_0x6666('0x22')]);if(members[_0x2fb265[_0x6666('0x14')]]['uniqueid']){writeDB(members[_0x2fb265['device']]);}}break;default:break;}}catch(_0x41fb17){utils[_0x6666('0xe')](util[_0x6666('0x15')]('[%s][members][devicestatechange]',members[_0x2fb265[_0x6666('0x14')]]?members[_0x2fb265['device']][_0x6666('0x2')]:_0x2fb265[_0x6666('0x14')]),_0x41fb17);}};exports[_0x6666('0x23')]=function(_0xaa55a6){try{if(!_['isNil'](members[_0xaa55a6[_0x6666('0x3')]])){utils[_0x6666('0x12')](util[_0x6666('0x15')]('[%s][members][agentcomplete]',_0xaa55a6[_0x6666('0x2')]),_0xaa55a6);utils['info'](util[_0x6666('0x15')](_0x6666('0x24'),_0xaa55a6['uniqueid'],_0xaa55a6['interface'],_0xaa55a6[_0x6666('0x25')]));members[_0xaa55a6[_0x6666('0x3')]]=_[_0x6666('0x26')](members[_0xaa55a6['interface']],{'data4':_0xaa55a6[_0x6666('0x25')],'uniqueid':_0xaa55a6[_0x6666('0x2')]});}}catch(_0x58c079){utils['error'](util[_0x6666('0x15')](_0x6666('0x27'),_0xaa55a6[_0x6666('0x2')]),_0x58c079);}};exports[_0x6666('0x28')]=function(_0x295a7e){try{utils[_0x6666('0x12')](util[_0x6666('0x15')]('[%s][members][cdr]',_0x295a7e['uniqueid']),_0x295a7e);if(_0x295a7e[_0x6666('0x4')]){var _0x227be1=_0x295a7e['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x227be1])){members[_0x227be1]=_[_0x6666('0x26')](members[_0x227be1],{'data1':members[_0x227be1][_0x6666('0x29')]||_0x295a7e[_0x6666('0x7')],'data2':members[_0x227be1][_0x6666('0x5')]||_0x295a7e[_0x6666('0x2a')],'data3':members[_0x227be1][_0x6666('0x2b')]||_0x295a7e[_0x6666('0x2c')],'uniqueid':members[_0x227be1][_0x6666('0x2')]||_0x295a7e[_0x6666('0x2')]});utils[_0x6666('0x1')](util[_0x6666('0x15')](_0x6666('0x2d'),_0x295a7e[_0x6666('0x2')],members[_0x227be1]['data1'],members[_0x227be1][_0x6666('0x5')],members[_0x227be1][_0x6666('0x2b')]));if(members[_0x227be1][_0x6666('0x1f')]){writeDB(members[_0x227be1]);}}}if(_0x295a7e['destinationchannel']){var _0x3ee547=_0x295a7e['destinationchannel'][_0x6666('0xc')]('-')[0x0];if(!_[_0x6666('0x1e')](members[_0x3ee547])){members[_0x3ee547]=_[_0x6666('0x26')](members[_0x3ee547],{'data1':members[_0x3ee547][_0x6666('0x29')]||_0x295a7e[_0x6666('0x7')],'data2':members[_0x3ee547][_0x6666('0x5')]||_0x295a7e[_0x6666('0x2a')],'data3':members[_0x3ee547][_0x6666('0x2b')]||_0x295a7e['destination'],'uniqueid':members[_0x3ee547]['uniqueid']||_0x295a7e[_0x6666('0x2')]});utils[_0x6666('0x1')](util[_0x6666('0x15')](_0x6666('0x2d'),_0x295a7e[_0x6666('0x2')],members[_0x3ee547][_0x6666('0x29')],members[_0x3ee547]['data2'],members[_0x3ee547]['data3']));if(members[_0x3ee547]['exitAt']){writeDB(members[_0x3ee547]);}}}}catch(_0x5f2c93){utils[_0x6666('0xe')](util[_0x6666('0x15')]('[%s][members][cdr]',_0x295a7e[_0x6666('0x2')]),_0x5f2c93);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 30412e4..85a4eea 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 _0x075a=['[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertype','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','error','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','BLIND','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid'];(function(_0x438cb6,_0x3dd893){var _0xf89304=function(_0x1a66f3){while(--_0x1a66f3){_0x438cb6['push'](_0x438cb6['shift']());}};_0xf89304(++_0x3dd893);}(_0x075a,0x1c4));var _0xa075=function(_0x2f91ee,_0x5b5fd0){_0x2f91ee=_0x2f91ee-0x0;var _0x40002d=_0x075a[_0x2f91ee];return _0x40002d;};'use strict';var _=require(_0xa075('0x0'));var util=require(_0xa075('0x1'));var utils=require(_0xa075('0x2'));var queues={};function writeDB(_0x4e461d){utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x5'),_0x4e461d[_0xa075('0x6')],_0x4e461d[_0xa075('0x7')],_0x4e461d[_0xa075('0x8')],_0x4e461d[_0xa075('0x9')],_0x4e461d[_0xa075('0xa')],_0x4e461d[_0xa075('0xb')],_0x4e461d[_0xa075('0xc')]));if(_0x4e461d[_0xa075('0x8')]){utils[_0xa075('0xd')](_0x4e461d[_0xa075('0x8')])[_0xa075('0xe')](function(_0x1c27f7){if(_0x1c27f7){_0x4e461d[_0xa075('0xf')]=_0x1c27f7[_0xa075('0xf')];}utils[_0xa075('0x10')](_0xa075('0x11'),_0x4e461d);});}else{utils['request'](_0xa075('0x11'),_0x4e461d);}if(_0x4e461d[_0xa075('0x12')]){delete queues[_0x4e461d[_0xa075('0x12')]];}else{delete queues[_0x4e461d[_0xa075('0x6')]];}}exports[_0xa075('0x13')]=function(_0x4544cc){try{utils[_0xa075('0x14')](util['format'](_0xa075('0x15'),_0x4544cc[_0xa075('0x6')]),_0x4544cc);utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x16'),_0x4544cc[_0xa075('0x6')],_0x4544cc[_0xa075('0x8')],_0x4544cc[_0xa075('0x17')]));queues[_0x4544cc[_0xa075('0x6')]]=_['assign'](_0x4544cc,{'originalposition':_0x4544cc['position'],'queuecallerjoinAt':utils[_0xa075('0x18')](),'mohtime':0x0});}catch(_0x2554fb){utils['error'](util[_0xa075('0x4')](_0xa075('0x15'),_0x4544cc[_0xa075('0x6')]),_0x2554fb);}};exports[_0xa075('0x19')]=function(_0x4be078){try{if(!_[_0xa075('0x1a')](queues[_0x4be078[_0xa075('0x6')]])){utils[_0xa075('0x14')](util[_0xa075('0x4')](_0xa075('0x1b'),_0x4be078[_0xa075('0x6')]),_0x4be078);if(queues[_0x4be078['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x4be078['uniqueid']][_0xa075('0x1c')]&&!queues[_0x4be078[_0xa075('0x6')]][_0xa075('0x1d')]){queues[_0x4be078[_0xa075('0x6')]][_0xa075('0x1e')]=!![];queues[_0x4be078[_0xa075('0x6')]]['queuecallercompleteAt']=utils['now']();queues[_0x4be078[_0xa075('0x6')]][_0xa075('0xc')]=_0xa075('0x1f');}utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x20'),_0x4be078[_0xa075('0x6')],queues[_0x4be078[_0xa075('0x6')]][_0xa075('0x21')],queues[_0x4be078[_0xa075('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x4be078[_0xa075('0x6')]]);}else if(queues[_0x4be078['uniqueid']][_0xa075('0x12')]){utils[_0xa075('0x3')](util[_0xa075('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4be078[_0xa075('0x6')],queues[_0x4be078[_0xa075('0x6')]]['name'],queues[_0x4be078[_0xa075('0x6')]][_0xa075('0x12')]));queues[queues[_0x4be078[_0xa075('0x6')]]['transfereduniqueid']]=queues[_0x4be078[_0xa075('0x6')]];queues[queues[_0x4be078['uniqueid']][_0xa075('0x12')]][_0xa075('0x22')]=0x2;delete queues[_0x4be078[_0xa075('0x6')]];}}}catch(_0x42e72b){utils['error'](util[_0xa075('0x4')](_0xa075('0x1b'),_0x4be078[_0xa075('0x6')]),_0x42e72b);}};exports[_0xa075('0x23')]=function(_0x4e28b4){try{utils[_0xa075('0x14')](util[_0xa075('0x4')](_0xa075('0x24'),_0x4e28b4[_0xa075('0x6')]),_0x4e28b4);if(!_[_0xa075('0x1a')](_0x4e28b4[_0xa075('0x25')][_0xa075('0x26')])&&_0x4e28b4[_0xa075('0x27')]['toUpperCase']()!==_0xa075('0x28')){if(!_[_0xa075('0x1a')](queues[_0x4e28b4[_0xa075('0x6')]])){queues[_0x4e28b4[_0xa075('0x6')]]['queuecallerabandon']=![];queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0x29')]=null;queues[_0x4e28b4[_0xa075('0x6')]]['queuecallerexit']=!![];queues[_0x4e28b4['uniqueid']][_0xa075('0x2a')]=utils['now']();queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0xc')]=_0x4e28b4[_0xa075('0x27')][_0xa075('0x2b')]();utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x2c'),_0x4e28b4['uniqueid'],queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0x21')],_0x4e28b4[_0xa075('0x27')],queues[_0x4e28b4[_0xa075('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x4e28b4[_0xa075('0x6')]]);}}else if(!_[_0xa075('0x1a')](_0x4e28b4['variable'][_0xa075('0x2d')])){if(!_[_0xa075('0x1a')](queues[_0x4e28b4['uniqueid']])&&!queues[_0x4e28b4[_0xa075('0x6')]]['queuecallerabandon']){queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0x1c')]=![];queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0x29')]=null;queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0x1d')]=!![];queues[_0x4e28b4[_0xa075('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x4e28b4[_0xa075('0x6')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x2e'),_0x4e28b4[_0xa075('0x6')],queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0x21')],_0x4e28b4[_0xa075('0x27')],queues[_0x4e28b4[_0xa075('0x6')]][_0xa075('0xc')]));}}}catch(_0x54865b){utils['error'](util[_0xa075('0x4')](_0xa075('0x24'),_0x4e28b4[_0xa075('0x6')]),_0x54865b);}};exports[_0xa075('0x1c')]=function(_0x4bf4b0){try{if(!_[_0xa075('0x1a')](queues[_0x4bf4b0[_0xa075('0x6')]])){utils['debug'](util[_0xa075('0x4')](_0xa075('0x2f'),_0x4bf4b0[_0xa075('0x6')]),_0x4bf4b0);queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0x1d')]=![];queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0x2a')]=null;queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0x1c')]=!![];queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0x29')]=utils['now']();queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0xc')]=_0xa075('0x30');utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x31'),_0x4bf4b0['uniqueid'],queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0x21')],queues[_0x4bf4b0[_0xa075('0x6')]][_0xa075('0xc')]));}}catch(_0x194bc0){utils[_0xa075('0x32')](util[_0xa075('0x4')](_0xa075('0x2f'),_0x4bf4b0[_0xa075('0x6')]),_0x194bc0);}};exports[_0xa075('0x33')]=function(_0x4b1de0){try{if(!_['isNil'](queues[_0x4b1de0[_0xa075('0x6')]])){utils['debug'](util['format'](_0xa075('0x34'),_0x4b1de0[_0xa075('0x6')]),_0x4b1de0);utils[_0xa075('0x3')](util['format'](_0xa075('0x35'),_0x4b1de0[_0xa075('0x6')],queues[_0x4b1de0['uniqueid']][_0xa075('0x21')],_0x4b1de0[_0xa075('0x36')],_0x4b1de0[_0xa075('0x37')]));queues[_0x4b1de0[_0xa075('0x6')]][_0xa075('0x33')]=!![];queues[_0x4b1de0[_0xa075('0x6')]][_0xa075('0x38')]=utils[_0xa075('0x18')]();queues[_0x4b1de0['uniqueid']]['holdtime']=utils[_0xa075('0x39')](queues[_0x4b1de0[_0xa075('0x6')]][_0xa075('0x38')],queues[_0x4b1de0[_0xa075('0x6')]][_0xa075('0x3a')]);queues[_0x4b1de0[_0xa075('0x6')]][_0xa075('0x17')]=_0x4b1de0[_0xa075('0x17')];queues[_0x4b1de0['uniqueid']]['count']=_0x4b1de0[_0xa075('0x3b')];queues[_0x4b1de0[_0xa075('0x6')]]['connectedlinenum']=_0x4b1de0[_0xa075('0x36')];queues[_0x4b1de0[_0xa075('0x6')]][_0xa075('0x37')]=_0x4b1de0[_0xa075('0x37')];}}catch(_0x3d3c12){utils[_0xa075('0x32')](util[_0xa075('0x4')]('[%s][queues][queuecallerleave]',_0x4b1de0[_0xa075('0x6')]),_0x3d3c12);}};exports[_0xa075('0x3c')]=function(_0xc4084f){try{if(!_[_0xa075('0x1a')](queues[_0xc4084f['uniqueid']])){utils[_0xa075('0x14')](util[_0xa075('0x4')](_0xa075('0x3d'),_0xc4084f[_0xa075('0x6')]),_0xc4084f);utils['info'](util[_0xa075('0x4')](_0xa075('0x3e'),_0xc4084f[_0xa075('0x6')],queues[_0xc4084f['uniqueid']][_0xa075('0x21')],_0xc4084f[_0xa075('0x3f')],_0xc4084f[_0xa075('0x40')]));queues[_0xc4084f[_0xa075('0x6')]][_0xa075('0x1c')]=![];queues[_0xc4084f[_0xa075('0x6')]]['queuecallerabandon']=![];queues[_0xc4084f['uniqueid']]['queuecallerabandonAt']=null;queues[_0xc4084f[_0xa075('0x6')]][_0xa075('0x1d')]=![];queues[_0xc4084f[_0xa075('0x6')]][_0xa075('0xc')]=null;queues[_0xc4084f[_0xa075('0x6')]]['queuecallerexitAt']=null;queues[_0xc4084f[_0xa075('0x6')]]['assigned']=!![];queues[_0xc4084f[_0xa075('0x6')]][_0xa075('0xb')]=_0xc4084f[_0xa075('0x40')];queues[_0xc4084f[_0xa075('0x6')]]['lastAssignedTo']=_0xc4084f[_0xa075('0x3f')];}}catch(_0x10638e){utils[_0xa075('0x32')](util[_0xa075('0x4')](_0xa075('0x3d'),_0xc4084f['uniqueid']),_0x10638e);}};exports[_0xa075('0x41')]=function(_0x11f8c4){try{if(!_[_0xa075('0x1a')](queues[_0x11f8c4[_0xa075('0x6')]])){if(queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0x38')]){utils[_0xa075('0x14')](util[_0xa075('0x4')](_0xa075('0x42'),_0x11f8c4[_0xa075('0x6')]),_0x11f8c4);queues[_0x11f8c4['uniqueid']]['queuecallerabandon']=![];queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0x1c')]=![];queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0x29')]=null;queues[_0x11f8c4['uniqueid']][_0xa075('0x1d')]=![];queues[_0x11f8c4[_0xa075('0x6')]]['queuecallerexitAt']=null;queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0x43')]=!![];queues[_0x11f8c4[_0xa075('0x6')]]['lastAssignedTo']=_0x11f8c4[_0xa075('0x3f')];queues[_0x11f8c4['uniqueid']][_0xa075('0x1e')]=!![];queues[_0x11f8c4['uniqueid']]['queuecallercompleteAt']=utils[_0xa075('0x18')]();if(_0x11f8c4[_0xa075('0x44')]==_0xa075('0x45')){if(!queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0x45')]){queues[_0x11f8c4['uniqueid']][_0xa075('0xc')]=_0xa075('0x46');}}else{queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0xc')]=_0xa075('0x47')+_0x11f8c4[_0xa075('0x44')][_0xa075('0x2b')]();}utils[_0xa075('0x3')](util[_0xa075('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x11f8c4[_0xa075('0x6')],queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0x21')],_0x11f8c4[_0xa075('0x3f')],queues[_0x11f8c4[_0xa075('0x6')]][_0xa075('0xc')]));writeDB(queues[_0x11f8c4['uniqueid']]);}}}catch(_0xce776c){utils[_0xa075('0x32')](util[_0xa075('0x4')]('[%s][queues][agentcomplete]',_0x11f8c4[_0xa075('0x6')]),_0xce776c);}};exports['blindtransfer']=function(_0x6115f6){try{if(!_['isNil'](queues[_0x6115f6[_0xa075('0x48')]])){utils[_0xa075('0x14')](util[_0xa075('0x4')]('[%s][queues][blindtransfer]',_0x6115f6[_0xa075('0x6')]),_0x6115f6);queues[_0x6115f6['transfereeuniqueid']][_0xa075('0x45')]=!![];queues[_0x6115f6[_0xa075('0x48')]]['transfertype']=_0xa075('0x49');queues[_0x6115f6['transfereeuniqueid']]['transferexten']=_0x6115f6[_0xa075('0x4a')];queues[_0x6115f6[_0xa075('0x48')]]['transferuniqueid']=_0x6115f6['transfereeuniqueid'];queues[_0x6115f6[_0xa075('0x48')]]['queuecallerexitreason']=_0xa075('0x4b');utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x4c'),_0x6115f6[_0xa075('0x6')],queues[_0x6115f6[_0xa075('0x48')]][_0xa075('0x21')],_0x6115f6[_0xa075('0x48')],_0x6115f6[_0xa075('0x4a')]));}}catch(_0x259a46){utils[_0xa075('0x32')](util[_0xa075('0x4')](_0xa075('0x4d'),_0x6115f6[_0xa075('0x6')]),_0x259a46);}};exports[_0xa075('0x4e')]=function(_0xd80880){try{utils['debug'](util['format'](_0xa075('0x4f'),_0xd80880[_0xa075('0x50')]),_0xd80880);if(_0xd80880[_0xa075('0x50')]==_0xd80880[_0xa075('0x51')]){if(!_[_0xa075('0x1a')](queues[_0xd80880[_0xa075('0x52')]])){utils['info'](util['format'](_0xa075('0x53'),_0xd80880['origtransfereruniqueid'],queues[_0xd80880[_0xa075('0x52')]][_0xa075('0x21')],_0xd80880[_0xa075('0x54')]));queues[_0xd80880[_0xa075('0x52')]][_0xa075('0x45')]=!![];queues[_0xd80880['secondtransfererlinkedid']]['transfertype']=_0xa075('0x55');queues[_0xd80880[_0xa075('0x52')]][_0xa075('0x56')]=_0xd80880[_0xa075('0x54')];queues[_0xd80880[_0xa075('0x52')]][_0xa075('0x57')]=_0xd80880[_0xa075('0x50')];queues[_0xd80880['secondtransfererlinkedid']]['queuecallerexitreason']=_0xa075('0x58');}if(!_[_0xa075('0x1a')](queues[_0xd80880[_0xa075('0x51')]])){if(_0xd80880[_0xa075('0x59')]&&queues[_0xd80880[_0xa075('0x59')]]){queues[_0xd80880[_0xa075('0x59')]][_0xa075('0x22')]=0x1;queues[_0xd80880[_0xa075('0x48')]]=_[_0xa075('0x5a')](queues[_0xd80880[_0xa075('0x59')]]);queues[_0xd80880[_0xa075('0x48')]][_0xa075('0x12')]=_0xd80880[_0xa075('0x5b')];queues[_0xd80880[_0xa075('0x48')]][_0xa075('0x22')]=0x2;queues[_0xd80880[_0xa075('0x48')]][_0xa075('0xa')]=queues[_0xd80880[_0xa075('0x52')]]['calleridnum'];queues[_0xd80880['transfereeuniqueid']][_0xa075('0x5c')]=queues[_0xd80880['secondtransfererlinkedid']][_0xa075('0x5c')];queues[_0xd80880[_0xa075('0x48')]][_0xa075('0x3a')]=utils[_0xa075('0x18')]();queues[_0xd80880[_0xa075('0x48')]]['queuecallerleaveAt']=utils[_0xa075('0x18')]();queues[_0xd80880['transfereeuniqueid']][_0xa075('0x5d')]=0x0;queues[_0xd80880[_0xa075('0x48')]]['mohtime']=0x0;utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x5e'),_0xd80880[_0xa075('0x50')],queues[_0xd80880[_0xa075('0x48')]][_0xa075('0x21')],queues[_0xd80880['transfereeuniqueid']]['calleridnum'],queues[_0xd80880[_0xa075('0x48')]][_0xa075('0x5c')]));}else{utils[_0xa075('0x3')](util[_0xa075('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xd80880[_0xa075('0x50')],queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x21')],_0xd80880[_0xa075('0x52')]));queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x12')]=_0xd80880[_0xa075('0x52')];}}}else if(_0xd80880[_0xa075('0x5f')]==_0xd80880[_0xa075('0x52')]){if(!_[_0xa075('0x1a')](queues[_0xd80880[_0xa075('0x51')]])){utils[_0xa075('0x3')](util[_0xa075('0x4')](_0xa075('0x60'),_0xd80880[_0xa075('0x50')],queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x21')],_0xd80880[_0xa075('0x5f')],_0xd80880[_0xa075('0x61')]));queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x45')]=!![];queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x62')]='ATTENDED';queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x56')]=_0xd80880['secondtransfererexten'];queues[_0xd80880[_0xa075('0x51')]][_0xa075('0x57')]=_0xd80880[_0xa075('0x5f')];queues[_0xd80880[_0xa075('0x51')]][_0xa075('0xc')]=_0xa075('0x58');}if(!_[_0xa075('0x1a')](queues[_0xd80880[_0xa075('0x52')]])){if(_0xd80880[_0xa075('0x63')]&&queues[_0xd80880['transfertargetlinkedid']]){queues[_0xd80880['transfertargetlinkedid']][_0xa075('0x22')]=0x1;queues[_0xd80880[_0xa075('0x5b')]]=_['clone'](queues[_0xd80880['transfertargetlinkedid']]);queues[_0xd80880['transfertargetuniqueid']][_0xa075('0x12')]=_0xd80880[_0xa075('0x5b')];queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x22')]=0x2;queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0xa')]=queues[_0xd80880[_0xa075('0x51')]][_0xa075('0xa')];queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x5c')]=queues[_0xd80880[_0xa075('0x51')]]['calleridname'];queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x3a')]=utils[_0xa075('0x18')]();queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x38')]=utils['now']();queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x5d')]=0x0;queues[_0xd80880['transfertargetuniqueid']]['mohtime']=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0xd80880[_0xa075('0x50')],queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x21')],queues[_0xd80880['transfertargetuniqueid']]['transfereduniqueid'],queues[_0xd80880['transfertargetuniqueid']][_0xa075('0xa')],queues[_0xd80880[_0xa075('0x5b')]][_0xa075('0x5c')]));}else{utils[_0xa075('0x3')](util['format'](_0xa075('0x64'),_0xd80880[_0xa075('0x50')],queues[_0xd80880[_0xa075('0x52')]][_0xa075('0x21')],_0xd80880[_0xa075('0x51')]));queues[_0xd80880[_0xa075('0x52')]]['transfereduniqueid']=_0xd80880[_0xa075('0x51')];}}}}catch(_0x3f2383){utils[_0xa075('0x32')](util[_0xa075('0x4')](_0xa075('0x4f'),_0xd80880['origtransfereruniqueid']),_0x3f2383);}};exports[_0xa075('0x65')]=function(_0x3b3d18){try{if(!_[_0xa075('0x1a')](queues[_0x3b3d18[_0xa075('0x6')]])){utils['debug'](util[_0xa075('0x4')](_0xa075('0x66'),_0x3b3d18[_0xa075('0x6')]),_0x3b3d18);queues[_0x3b3d18[_0xa075('0x6')]][_0xa075('0x67')]=utils['now']();utils[_0xa075('0x3')](util[_0xa075('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3b3d18['uniqueid'],queues[_0x3b3d18['uniqueid']][_0xa075('0x21')],queues[_0x3b3d18['uniqueid']][_0xa075('0x67')]));}}catch(_0x59b86e){utils['error'](util[_0xa075('0x4')](_0xa075('0x66'),_0x3b3d18[_0xa075('0x6')]),_0x59b86e);}};exports[_0xa075('0x68')]=function(_0x5758b2){try{if(!_[_0xa075('0x1a')](queues[_0x5758b2['uniqueid']])){if(!_[_0xa075('0x1a')](queues[_0x5758b2[_0xa075('0x6')]][_0xa075('0x67')])){utils['debug'](util[_0xa075('0x4')](_0xa075('0x69'),_0x5758b2[_0xa075('0x6')]),_0x5758b2);queues[_0x5758b2['uniqueid']][_0xa075('0x6a')]+=utils['diffTime'](utils[_0xa075('0x18')](),queues[_0x5758b2['uniqueid']][_0xa075('0x67')]);utils['info'](util[_0xa075('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x5758b2[_0xa075('0x6')],queues[_0x5758b2['uniqueid']][_0xa075('0x21')],queues[_0x5758b2[_0xa075('0x6')]][_0xa075('0x6a')]));delete queues[_0x5758b2[_0xa075('0x6')]]['musiconholdstartAt'];}}}catch(_0x1cfecc){utils[_0xa075('0x32')](util[_0xa075('0x4')]('[%s][queues][musiconholdstop]',_0x5758b2[_0xa075('0x6')]),_0x1cfecc);}}; \ No newline at end of file +var _0x598f=['attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','info','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerexitAt','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','connectedlinename','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER'];(function(_0x329420,_0xc66e1a){var _0x54c00a=function(_0x4aedc2){while(--_0x4aedc2){_0x329420['push'](_0x329420['shift']());}};_0x54c00a(++_0xc66e1a);}(_0x598f,0xdf));var _0xf598=function(_0x4a2f2d,_0x2d6da4){_0x4a2f2d=_0x4a2f2d-0x0;var _0x2f47be=_0x598f[_0x4a2f2d];return _0x2f47be;};'use strict';var _=require(_0xf598('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x23fdc4){utils['info'](util[_0xf598('0x1')](_0xf598('0x2'),_0x23fdc4[_0xf598('0x3')],_0x23fdc4[_0xf598('0x4')],_0x23fdc4['queue'],_0x23fdc4[_0xf598('0x5')],_0x23fdc4['calleridnum'],_0x23fdc4[_0xf598('0x6')],_0x23fdc4[_0xf598('0x7')]));if(_0x23fdc4[_0xf598('0x8')]){utils['getVoiceQueueByName'](_0x23fdc4['queue'])[_0xf598('0x9')](function(_0x34b052){if(_0x34b052){_0x23fdc4[_0xf598('0xa')]=_0x34b052['type'];}utils['request'](_0xf598('0xb'),_0x23fdc4);});}else{utils[_0xf598('0xc')]('CreateVoiceQueueReport',_0x23fdc4);}if(_0x23fdc4[_0xf598('0xd')]){delete queues[_0x23fdc4[_0xf598('0xd')]];}else{delete queues[_0x23fdc4['uniqueid']];}}exports[_0xf598('0xe')]=function(_0x2de094){try{utils[_0xf598('0xf')](util['format'](_0xf598('0x10'),_0x2de094['uniqueid']),_0x2de094);utils['info'](util['format'](_0xf598('0x11'),_0x2de094['uniqueid'],_0x2de094[_0xf598('0x8')],_0x2de094[_0xf598('0x12')]));queues[_0x2de094[_0xf598('0x3')]]=_[_0xf598('0x13')](_0x2de094,{'originalposition':_0x2de094['position'],'queuecallerjoinAt':utils[_0xf598('0x14')](),'mohtime':0x0});}catch(_0x565651){utils[_0xf598('0x15')](util[_0xf598('0x1')]('[%s][queues][queuecallerjoin]',_0x2de094['uniqueid']),_0x565651);}};exports['hangup']=function(_0x5e8463){try{if(!_[_0xf598('0x16')](queues[_0x5e8463[_0xf598('0x3')]])){utils[_0xf598('0xf')](util['format'](_0xf598('0x17'),_0x5e8463[_0xf598('0x3')]),_0x5e8463);if(queues[_0x5e8463['uniqueid']][_0xf598('0x18')]){if(!queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0x19')]&&!queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0x1a')]){queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0x1b')]=!![];queues[_0x5e8463['uniqueid']][_0xf598('0x1c')]=utils[_0xf598('0x14')]();queues[_0x5e8463['uniqueid']][_0xf598('0x7')]='COMPLETEDBYAGENT';}utils['info'](util[_0xf598('0x1')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x5e8463[_0xf598('0x3')],queues[_0x5e8463['uniqueid']][_0xf598('0x1d')],queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0x7')]));writeDB(queues[_0x5e8463['uniqueid']]);}else if(queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0xd')]){utils[_0xf598('0x1e')](util[_0xf598('0x1')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5e8463['uniqueid'],queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0x1d')],queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0xd')]));queues[queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0xd')]]=queues[_0x5e8463['uniqueid']];queues[queues[_0x5e8463[_0xf598('0x3')]][_0xf598('0xd')]][_0xf598('0x1f')]=0x2;delete queues[_0x5e8463['uniqueid']];}}}catch(_0x12a9d8){utils[_0xf598('0x15')](util[_0xf598('0x1')](_0xf598('0x17'),_0x5e8463[_0xf598('0x3')]),_0x12a9d8);}};exports[_0xf598('0x20')]=function(_0x55a88f){try{utils['debug'](util['format'](_0xf598('0x21'),_0x55a88f[_0xf598('0x3')]),_0x55a88f);if(!_[_0xf598('0x16')](_0x55a88f[_0xf598('0x22')][_0xf598('0x23')])&&_0x55a88f['value'][_0xf598('0x24')]()!==_0xf598('0x25')){if(!_[_0xf598('0x16')](queues[_0x55a88f[_0xf598('0x3')]])){queues[_0x55a88f[_0xf598('0x3')]]['queuecallerabandon']=![];queues[_0x55a88f['uniqueid']][_0xf598('0x26')]=null;queues[_0x55a88f[_0xf598('0x3')]][_0xf598('0x1a')]=!![];queues[_0x55a88f['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x55a88f[_0xf598('0x3')]][_0xf598('0x7')]=_0x55a88f[_0xf598('0x27')][_0xf598('0x24')]();utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x28'),_0x55a88f['uniqueid'],queues[_0x55a88f[_0xf598('0x3')]]['name'],_0x55a88f[_0xf598('0x27')],queues[_0x55a88f[_0xf598('0x3')]][_0xf598('0x7')]));writeDB(queues[_0x55a88f[_0xf598('0x3')]]);}}else if(!_[_0xf598('0x16')](_0x55a88f[_0xf598('0x22')]['queueposition'])){if(!_[_0xf598('0x16')](queues[_0x55a88f[_0xf598('0x3')]])&&!queues[_0x55a88f[_0xf598('0x3')]]['queuecallerabandon']){queues[_0x55a88f['uniqueid']][_0xf598('0x19')]=![];queues[_0x55a88f[_0xf598('0x3')]][_0xf598('0x26')]=null;queues[_0x55a88f['uniqueid']]['queuecallerexit']=!![];queues[_0x55a88f[_0xf598('0x3')]][_0xf598('0x29')]=utils['now']();queues[_0x55a88f['uniqueid']]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util[_0xf598('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x55a88f['uniqueid'],queues[_0x55a88f[_0xf598('0x3')]][_0xf598('0x1d')],_0x55a88f[_0xf598('0x27')],queues[_0x55a88f[_0xf598('0x3')]]['queuecallerexitreason']));}}}catch(_0x3cdf49){utils[_0xf598('0x15')](util[_0xf598('0x1')](_0xf598('0x21'),_0x55a88f[_0xf598('0x3')]),_0x3cdf49);}};exports[_0xf598('0x19')]=function(_0x263ec1){try{if(!_[_0xf598('0x16')](queues[_0x263ec1[_0xf598('0x3')]])){utils[_0xf598('0xf')](util[_0xf598('0x1')](_0xf598('0x2a'),_0x263ec1[_0xf598('0x3')]),_0x263ec1);queues[_0x263ec1['uniqueid']]['queuecallerexit']=![];queues[_0x263ec1[_0xf598('0x3')]]['queuecallerexitAt']=null;queues[_0x263ec1[_0xf598('0x3')]]['queuecallerabandon']=!![];queues[_0x263ec1[_0xf598('0x3')]][_0xf598('0x26')]=utils['now']();queues[_0x263ec1[_0xf598('0x3')]][_0xf598('0x7')]='ABANDONED';utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x2b'),_0x263ec1[_0xf598('0x3')],queues[_0x263ec1[_0xf598('0x3')]][_0xf598('0x1d')],queues[_0x263ec1[_0xf598('0x3')]][_0xf598('0x7')]));}}catch(_0xa8dcf6){utils[_0xf598('0x15')](util[_0xf598('0x1')](_0xf598('0x2a'),_0x263ec1[_0xf598('0x3')]),_0xa8dcf6);}};exports['queuecallerleave']=function(_0x2b71f9){try{if(!_[_0xf598('0x16')](queues[_0x2b71f9[_0xf598('0x3')]])){utils[_0xf598('0xf')](util[_0xf598('0x1')]('[%s][queues][queuecallerleave]',_0x2b71f9['uniqueid']),_0x2b71f9);utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x2c'),_0x2b71f9[_0xf598('0x3')],queues[_0x2b71f9[_0xf598('0x3')]]['name'],_0x2b71f9[_0xf598('0x2d')],_0x2b71f9['connectedlinename']));queues[_0x2b71f9[_0xf598('0x3')]]['queuecallerleave']=!![];queues[_0x2b71f9[_0xf598('0x3')]][_0xf598('0x18')]=utils[_0xf598('0x14')]();queues[_0x2b71f9[_0xf598('0x3')]][_0xf598('0x2e')]=utils[_0xf598('0x2f')](queues[_0x2b71f9['uniqueid']][_0xf598('0x18')],queues[_0x2b71f9[_0xf598('0x3')]]['queuecallerjoinAt']);queues[_0x2b71f9[_0xf598('0x3')]][_0xf598('0x12')]=_0x2b71f9[_0xf598('0x12')];queues[_0x2b71f9[_0xf598('0x3')]]['count']=_0x2b71f9['count'];queues[_0x2b71f9[_0xf598('0x3')]]['connectedlinenum']=_0x2b71f9[_0xf598('0x2d')];queues[_0x2b71f9['uniqueid']][_0xf598('0x30')]=_0x2b71f9[_0xf598('0x30')];}}catch(_0x5319ac){utils[_0xf598('0x15')](util['format'](_0xf598('0x31'),_0x2b71f9[_0xf598('0x3')]),_0x5319ac);}};exports['agentconnect']=function(_0x39980d){try{if(!_[_0xf598('0x16')](queues[_0x39980d[_0xf598('0x3')]])){utils[_0xf598('0xf')](util[_0xf598('0x1')](_0xf598('0x32'),_0x39980d['uniqueid']),_0x39980d);utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x33'),_0x39980d[_0xf598('0x3')],queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x1d')],_0x39980d[_0xf598('0x34')],_0x39980d[_0xf598('0x35')]));queues[_0x39980d[_0xf598('0x3')]]['queuecallerabandon']=![];queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x19')]=![];queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x26')]=null;queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x1a')]=![];queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x7')]=null;queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x29')]=null;queues[_0x39980d['uniqueid']][_0xf598('0x36')]=!![];queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x6')]=_0x39980d['destaccountcode'];queues[_0x39980d[_0xf598('0x3')]][_0xf598('0x5')]=_0x39980d[_0xf598('0x34')];}}catch(_0x311462){utils[_0xf598('0x15')](util[_0xf598('0x1')]('[%s][queues][agentconnect]',_0x39980d[_0xf598('0x3')]),_0x311462);}};exports['agentcomplete']=function(_0x421e9f){try{if(!_[_0xf598('0x16')](queues[_0x421e9f[_0xf598('0x3')]])){if(queues[_0x421e9f['uniqueid']][_0xf598('0x18')]){utils[_0xf598('0xf')](util[_0xf598('0x1')](_0xf598('0x37'),_0x421e9f['uniqueid']),_0x421e9f);queues[_0x421e9f[_0xf598('0x3')]]['queuecallerabandon']=![];queues[_0x421e9f['uniqueid']]['queuecallerabandon']=![];queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x26')]=null;queues[_0x421e9f['uniqueid']][_0xf598('0x1a')]=![];queues[_0x421e9f['uniqueid']][_0xf598('0x29')]=null;queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x36')]=!![];queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x5')]=_0x421e9f[_0xf598('0x34')];queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x1b')]=!![];queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x1c')]=utils['now']();if(_0x421e9f[_0xf598('0x38')]==_0xf598('0x39')){if(!queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x39')]){queues[_0x421e9f['uniqueid']][_0xf598('0x7')]=_0xf598('0x3a');}}else{queues[_0x421e9f['uniqueid']][_0xf598('0x7')]=_0xf598('0x3b')+_0x421e9f[_0xf598('0x38')][_0xf598('0x24')]();}utils['info'](util['format'](_0xf598('0x3c'),_0x421e9f[_0xf598('0x3')],queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x1d')],_0x421e9f['membername'],queues[_0x421e9f[_0xf598('0x3')]][_0xf598('0x7')]));writeDB(queues[_0x421e9f[_0xf598('0x3')]]);}}}catch(_0x58ff62){utils['error'](util[_0xf598('0x1')](_0xf598('0x37'),_0x421e9f[_0xf598('0x3')]),_0x58ff62);}};exports['blindtransfer']=function(_0x3f4341){try{if(!_[_0xf598('0x16')](queues[_0x3f4341['transfereeuniqueid']])){utils[_0xf598('0xf')](util[_0xf598('0x1')](_0xf598('0x3d'),_0x3f4341[_0xf598('0x3')]),_0x3f4341);queues[_0x3f4341[_0xf598('0x3e')]][_0xf598('0x39')]=!![];queues[_0x3f4341['transfereeuniqueid']][_0xf598('0x3f')]=_0xf598('0x40');queues[_0x3f4341[_0xf598('0x3e')]][_0xf598('0x41')]=_0x3f4341[_0xf598('0x42')];queues[_0x3f4341['transfereeuniqueid']]['transferuniqueid']=_0x3f4341[_0xf598('0x3e')];queues[_0x3f4341[_0xf598('0x3e')]][_0xf598('0x7')]=_0xf598('0x43');utils[_0xf598('0x1e')](util[_0xf598('0x1')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3f4341[_0xf598('0x3')],queues[_0x3f4341['transfereeuniqueid']]['name'],_0x3f4341[_0xf598('0x3e')],_0x3f4341[_0xf598('0x42')]));}}catch(_0x43e6b4){utils[_0xf598('0x15')](util['format'](_0xf598('0x3d'),_0x3f4341[_0xf598('0x3')]),_0x43e6b4);}};exports[_0xf598('0x44')]=function(_0x5a4eff){try{utils[_0xf598('0xf')](util[_0xf598('0x1')](_0xf598('0x45'),_0x5a4eff[_0xf598('0x46')]),_0x5a4eff);if(_0x5a4eff[_0xf598('0x46')]==_0x5a4eff[_0xf598('0x47')]){if(!_['isNil'](queues[_0x5a4eff[_0xf598('0x48')]])){utils[_0xf598('0x1e')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5a4eff[_0xf598('0x46')],queues[_0x5a4eff[_0xf598('0x48')]][_0xf598('0x1d')],_0x5a4eff[_0xf598('0x49')]));queues[_0x5a4eff[_0xf598('0x48')]]['transfer']=!![];queues[_0x5a4eff[_0xf598('0x48')]][_0xf598('0x3f')]='ATTENDED';queues[_0x5a4eff['secondtransfererlinkedid']][_0xf598('0x41')]=_0x5a4eff[_0xf598('0x49')];queues[_0x5a4eff[_0xf598('0x48')]][_0xf598('0x4a')]=_0x5a4eff['origtransfereruniqueid'];queues[_0x5a4eff['secondtransfererlinkedid']][_0xf598('0x7')]=_0xf598('0x4b');}if(!_[_0xf598('0x16')](queues[_0x5a4eff[_0xf598('0x47')]])){if(_0x5a4eff[_0xf598('0x4c')]&&queues[_0x5a4eff['transfereelinkedid']]){queues[_0x5a4eff[_0xf598('0x4c')]][_0xf598('0x1f')]=0x1;queues[_0x5a4eff['transfereeuniqueid']]=_[_0xf598('0x4d')](queues[_0x5a4eff[_0xf598('0x4c')]]);queues[_0x5a4eff[_0xf598('0x3e')]][_0xf598('0xd')]=_0x5a4eff[_0xf598('0x4e')];queues[_0x5a4eff[_0xf598('0x3e')]][_0xf598('0x1f')]=0x2;queues[_0x5a4eff[_0xf598('0x3e')]][_0xf598('0x4f')]=queues[_0x5a4eff[_0xf598('0x48')]]['calleridnum'];queues[_0x5a4eff['transfereeuniqueid']]['calleridname']=queues[_0x5a4eff[_0xf598('0x48')]]['calleridname'];queues[_0x5a4eff['transfereeuniqueid']][_0xf598('0x50')]=utils[_0xf598('0x14')]();queues[_0x5a4eff[_0xf598('0x3e')]]['queuecallerleaveAt']=utils['now']();queues[_0x5a4eff[_0xf598('0x3e')]][_0xf598('0x2e')]=0x0;queues[_0x5a4eff[_0xf598('0x3e')]][_0xf598('0x51')]=0x0;utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x52'),_0x5a4eff[_0xf598('0x46')],queues[_0x5a4eff[_0xf598('0x3e')]]['name'],queues[_0x5a4eff['transfereeuniqueid']][_0xf598('0x4f')],queues[_0x5a4eff['transfereeuniqueid']]['calleridname']));}else{utils[_0xf598('0x1e')](util[_0xf598('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5a4eff[_0xf598('0x46')],queues[_0x5a4eff[_0xf598('0x47')]]['name'],_0x5a4eff[_0xf598('0x48')]));queues[_0x5a4eff[_0xf598('0x47')]][_0xf598('0xd')]=_0x5a4eff['secondtransfererlinkedid'];}}}else if(_0x5a4eff[_0xf598('0x53')]==_0x5a4eff['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x5a4eff[_0xf598('0x47')]])){utils[_0xf598('0x1e')](util[_0xf598('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5a4eff[_0xf598('0x46')],queues[_0x5a4eff[_0xf598('0x47')]][_0xf598('0x1d')],_0x5a4eff[_0xf598('0x53')],_0x5a4eff[_0xf598('0x54')]));queues[_0x5a4eff[_0xf598('0x47')]][_0xf598('0x39')]=!![];queues[_0x5a4eff[_0xf598('0x47')]]['transfertype']=_0xf598('0x55');queues[_0x5a4eff[_0xf598('0x47')]]['transferexten']=_0x5a4eff['secondtransfererexten'];queues[_0x5a4eff[_0xf598('0x47')]][_0xf598('0x4a')]=_0x5a4eff[_0xf598('0x53')];queues[_0x5a4eff[_0xf598('0x47')]]['queuecallerexitreason']=_0xf598('0x4b');}if(!_[_0xf598('0x16')](queues[_0x5a4eff[_0xf598('0x48')]])){if(_0x5a4eff[_0xf598('0x56')]&&queues[_0x5a4eff[_0xf598('0x56')]]){queues[_0x5a4eff[_0xf598('0x56')]][_0xf598('0x1f')]=0x1;queues[_0x5a4eff[_0xf598('0x4e')]]=_[_0xf598('0x4d')](queues[_0x5a4eff[_0xf598('0x56')]]);queues[_0x5a4eff[_0xf598('0x4e')]][_0xf598('0xd')]=_0x5a4eff[_0xf598('0x4e')];queues[_0x5a4eff[_0xf598('0x4e')]]['queuecallerenterreason']=0x2;queues[_0x5a4eff['transfertargetuniqueid']][_0xf598('0x4f')]=queues[_0x5a4eff[_0xf598('0x47')]][_0xf598('0x4f')];queues[_0x5a4eff[_0xf598('0x4e')]][_0xf598('0x57')]=queues[_0x5a4eff[_0xf598('0x47')]][_0xf598('0x57')];queues[_0x5a4eff['transfertargetuniqueid']][_0xf598('0x50')]=utils[_0xf598('0x14')]();queues[_0x5a4eff['transfertargetuniqueid']][_0xf598('0x18')]=utils[_0xf598('0x14')]();queues[_0x5a4eff[_0xf598('0x4e')]][_0xf598('0x2e')]=0x0;queues[_0x5a4eff[_0xf598('0x4e')]]['mohtime']=0x0;utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x58'),_0x5a4eff[_0xf598('0x46')],queues[_0x5a4eff[_0xf598('0x4e')]][_0xf598('0x1d')],queues[_0x5a4eff[_0xf598('0x4e')]][_0xf598('0xd')],queues[_0x5a4eff[_0xf598('0x4e')]][_0xf598('0x4f')],queues[_0x5a4eff['transfertargetuniqueid']][_0xf598('0x57')]));}else{utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x59'),_0x5a4eff['origtransfereruniqueid'],queues[_0x5a4eff['secondtransfererlinkedid']][_0xf598('0x1d')],_0x5a4eff[_0xf598('0x47')]));queues[_0x5a4eff['secondtransfererlinkedid']][_0xf598('0xd')]=_0x5a4eff[_0xf598('0x47')];}}}}catch(_0x45a646){utils['error'](util[_0xf598('0x1')]('[%s][queues][attendedtransfer]',_0x5a4eff['origtransfereruniqueid']),_0x45a646);}};exports[_0xf598('0x5a')]=function(_0x400c30){try{if(!_['isNil'](queues[_0x400c30[_0xf598('0x3')]])){utils['debug'](util[_0xf598('0x1')](_0xf598('0x5b'),_0x400c30[_0xf598('0x3')]),_0x400c30);queues[_0x400c30[_0xf598('0x3')]][_0xf598('0x5c')]=utils[_0xf598('0x14')]();utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x5d'),_0x400c30[_0xf598('0x3')],queues[_0x400c30['uniqueid']][_0xf598('0x1d')],queues[_0x400c30['uniqueid']][_0xf598('0x5c')]));}}catch(_0x2d3654){utils[_0xf598('0x15')](util[_0xf598('0x1')](_0xf598('0x5b'),_0x400c30[_0xf598('0x3')]),_0x2d3654);}};exports[_0xf598('0x5e')]=function(_0x5d0843){try{if(!_['isNil'](queues[_0x5d0843['uniqueid']])){if(!_['isNil'](queues[_0x5d0843[_0xf598('0x3')]][_0xf598('0x5c')])){utils['debug'](util['format'](_0xf598('0x5f'),_0x5d0843[_0xf598('0x3')]),_0x5d0843);queues[_0x5d0843[_0xf598('0x3')]][_0xf598('0x51')]+=utils[_0xf598('0x2f')](utils[_0xf598('0x14')](),queues[_0x5d0843[_0xf598('0x3')]][_0xf598('0x5c')]);utils[_0xf598('0x1e')](util[_0xf598('0x1')](_0xf598('0x60'),_0x5d0843[_0xf598('0x3')],queues[_0x5d0843[_0xf598('0x3')]][_0xf598('0x1d')],queues[_0x5d0843[_0xf598('0x3')]][_0xf598('0x51')]));delete queues[_0x5d0843['uniqueid']][_0xf598('0x5c')];}}}catch(_0x4cb1b4){utils[_0xf598('0x15')](util[_0xf598('0x1')]('[%s][queues][musiconholdstop]',_0x5d0843[_0xf598('0x3')]),_0x4cb1b4);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b6aa7f6..c7242e9 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 _0x1327=['calleridname','cause-txt','connectedlinenum','outbound','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','util','info','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridnum'];(function(_0x4b330e,_0x5689b8){var _0x35d675=function(_0x5e391f){while(--_0x5e391f){_0x4b330e['push'](_0x4b330e['shift']());}};_0x35d675(++_0x5689b8);}(_0x1327,0xba));var _0x7132=function(_0x280112,_0x4ac7d1){_0x280112=_0x280112-0x0;var _0x5980ab=_0x1327[_0x280112];return _0x5980ab;};'use strict';var _=require('lodash');var util=require(_0x7132('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x3f790c){utils[_0x7132('0x1')](util['format'](_0x7132('0x2'),_0x3f790c['uniqueid']));if(_0x3f790c[_0x7132('0x3')]){utils[_0x7132('0x4')](_0x3f790c['accountcode'])[_0x7132('0x5')](function(_0x4993e9){if(_0x4993e9){_0x3f790c['membername']=_0x4993e9[_0x7132('0x6')];_0x3f790c['UserId']=_0x4993e9['id'];}utils[_0x7132('0x7')]('CreateVoiceRecording',_0x3f790c);});}else{utils['request'](_0x7132('0x8'),_0x3f790c);}}exports[_0x7132('0x9')]=function(_0x5e8d1e){try{utils['debug'](util[_0x7132('0xa')](_0x7132('0xb'),_0x5e8d1e[_0x7132('0xc')]),_0x5e8d1e);if(_0x5e8d1e[_0x7132('0xc')]==_0x5e8d1e[_0x7132('0xd')]){utils[_0x7132('0x1')](util['format'](_0x7132('0xe'),_0x5e8d1e[_0x7132('0xc')],_0x5e8d1e[_0x7132('0xf')],_0x5e8d1e[_0x7132('0x10')]));recordings[_0x5e8d1e[_0x7132('0xc')]]={'uniqueid':_0x5e8d1e[_0x7132('0xc')],'accountcode':_0x5e8d1e['accountcode'],'exten':_0x5e8d1e[_0x7132('0x10')],'context':_0x5e8d1e['context'],'channel':_0x5e8d1e[_0x7132('0x11')],'monitors':[]};}}catch(_0x1b05d0){utils[_0x7132('0x12')](util['format'](_0x7132('0xb'),_0x5e8d1e[_0x7132('0xc')]),_0x1b05d0);}};exports[_0x7132('0x13')]=function(_0x1700d2){try{utils[_0x7132('0x14')](util[_0x7132('0xa')](_0x7132('0x15'),_0x1700d2[_0x7132('0xc')]),_0x1700d2);if(!_[_0x7132('0x16')](recordings[_0x1700d2[_0x7132('0xc')]])&&_0x1700d2[_0x7132('0x17')]==0x6){utils[_0x7132('0x1')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1700d2[_0x7132('0xc')],_0x1700d2[_0x7132('0xf')],_0x1700d2[_0x7132('0x11')]));}else if(!_[_0x7132('0x16')](recordings[_0x1700d2['linkedid']])&&_0x1700d2['channelstate']==0x6&&_0x1700d2[_0x7132('0xf')]!='transfer'){utils['info'](util[_0x7132('0xa')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1700d2['uniqueid'],_0x1700d2[_0x7132('0xd')],_0x1700d2[_0x7132('0xf')],_0x1700d2[_0x7132('0x11')]));recordings[_0x1700d2[_0x7132('0xd')]][_0x7132('0x3')]=_0x1700d2[_0x7132('0x3')];}}catch(_0x445ec9){utils[_0x7132('0x12')](util['format'](_0x7132('0x15'),_0x1700d2[_0x7132('0xc')]),_0x445ec9);}};exports[_0x7132('0x18')]=function(_0x3b34c0){try{if(!_[_0x7132('0x16')](_0x3b34c0[_0x7132('0x19')])&&!_['isNil'](_0x3b34c0[_0x7132('0x19')][_0x7132('0x1a')])){utils[_0x7132('0x14')](util['format'](_0x7132('0x1b'),_0x3b34c0[_0x7132('0xc')]),_0x3b34c0);utils['info'](util[_0x7132('0xa')](_0x7132('0x1c'),_0x3b34c0[_0x7132('0xc')],_0x3b34c0[_0x7132('0x19')],_0x3b34c0[_0x7132('0x1d')]));if(_['endsWith'](_0x3b34c0[_0x7132('0x1d')],'.wav49')){_0x3b34c0[_0x7132('0x1d')]=_0x3b34c0['value'][_0x7132('0x1e')](_0x7132('0x1f'),_0x7132('0x20'));}if(recordings[_0x3b34c0[_0x7132('0xd')]]){var _0x464852=_[_0x7132('0x21')](recordings[_0x3b34c0['linkedid']][_0x7132('0x22')],{'value':_0x3b34c0[_0x7132('0x1d')]});if(_[_0x7132('0x16')](_0x464852)){recordings[_0x3b34c0[_0x7132('0xd')]][_0x7132('0x22')][_0x7132('0x23')]({'value':_0x3b34c0[_0x7132('0x1d')]});}}}}catch(_0x42756){utils[_0x7132('0x12')](util[_0x7132('0xa')](_0x7132('0x1b'),_0x3b34c0[_0x7132('0xc')]),_0x42756);}};exports['hangup']=function(_0x181a38){try{if(!_['isNil'](recordings[_0x181a38[_0x7132('0xc')]])){utils[_0x7132('0x14')](util[_0x7132('0xa')](_0x7132('0x24'),_0x181a38[_0x7132('0xc')]),_0x181a38);utils[_0x7132('0x1')](util[_0x7132('0xa')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x181a38[_0x7132('0xc')],_0x181a38[_0x7132('0x25')],_0x181a38[_0x7132('0x26')],_0x181a38[_0x7132('0x27')]));recordings[_0x181a38[_0x7132('0xc')]][_0x7132('0x25')]=_0x181a38[_0x7132('0x25')];recordings[_0x181a38[_0x7132('0xc')]]['calleridname']=_0x181a38[_0x7132('0x26')];recordings[_0x181a38['uniqueid']][_0x7132('0x28')]=_0x181a38['connectedlinenum'];recordings[_0x181a38['uniqueid']]['connectedlinename']=_0x181a38['connectedlinename'];if(recordings[_0x181a38[_0x7132('0xc')]]['type']==_0x7132('0x29')&&recordings[_0x181a38['uniqueid']][_0x7132('0x3')]){recordings[_0x181a38[_0x7132('0xc')]][_0x7132('0x28')]=recordings[_0x181a38[_0x7132('0xc')]][_0x7132('0x3')];recordings[_0x181a38[_0x7132('0xc')]][_0x7132('0x2a')]='';}recordings[_0x181a38[_0x7132('0xc')]][_0x7132('0x22')][_0x7132('0x2b')](function(_0x44bac8){var _0x99f9ea=_[_0x7132('0x2c')](recordings[_0x181a38[_0x7132('0xc')]]);_0x99f9ea[_0x7132('0x1d')]=_0x44bac8[_0x7132('0x1d')];writeDB(_0x99f9ea);});delete recordings[_0x181a38['uniqueid']];}}catch(_0x3658de){utils['error'](util[_0x7132('0xa')](_0x7132('0x24'),_0x181a38[_0x7132('0xc')]),_0x3658de);}};exports[_0x7132('0x2d')]=function(_0x3e879a){try{if(!_[_0x7132('0x16')](recordings[_0x3e879a[_0x7132('0xc')]])){utils[_0x7132('0x14')](util[_0x7132('0xa')](_0x7132('0x2e'),_0x3e879a[_0x7132('0xc')]),_0x3e879a);utils['info'](util[_0x7132('0xa')](_0x7132('0x2f'),_0x3e879a[_0x7132('0xc')],_0x3e879a[_0x7132('0x30')],_0x3e879a[_0x7132('0x31')]));if(_0x3e879a[_0x7132('0x30')][_0x7132('0x32')]()=='set'&&_[_0x7132('0x33')](_0x3e879a[_0x7132('0x31')]['toLowerCase'](),_0x7132('0x34'))){var _0x15dfbb=_0x3e879a['appdata']['split']('=');var _0x3de365=_0x15dfbb[0x0]['substring'](_0x15dfbb[0x0][_0x7132('0x35')]('(')+0x1,_0x15dfbb[0x0][_0x7132('0x35')](')'));var _0x5137a3=_0x15dfbb[0x1];recordings[_0x3e879a[_0x7132('0xc')]][_0x3de365]=_0x5137a3;}}}catch(_0x23aeef){utils[_0x7132('0x12')](util['format'](_0x7132('0x2e'),_0x3e879a['uniqueid']),_0x23aeef);}};exports['queuecallerjoin']=function(_0x43fb17){try{if(!_[_0x7132('0x16')](recordings[_0x43fb17[_0x7132('0xc')]])){utils['debug'](util[_0x7132('0xa')](_0x7132('0x36'),_0x43fb17[_0x7132('0xc')]),_0x43fb17);utils[_0x7132('0x1')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x43fb17[_0x7132('0xc')],_0x43fb17[_0x7132('0x37')]));recordings[_0x43fb17[_0x7132('0xc')]][_0x7132('0x37')]=_0x43fb17[_0x7132('0x37')];}}catch(_0xbdf853){utils['error'](util[_0x7132('0xa')](_0x7132('0x36'),_0x43fb17['uniqueid']),_0xbdf853);}}; \ No newline at end of file +var _0x9f89=['push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','UserId','CreateVoiceRecording','request','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','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','.wav49','value','find','monitors'];(function(_0x1d0cd2,_0x218b87){var _0x24a95f=function(_0x495dc8){while(--_0x495dc8){_0x1d0cd2['push'](_0x1d0cd2['shift']());}};_0x24a95f(++_0x218b87);}(_0x9f89,0x13d));var _0x99f8=function(_0x32e9ca,_0x461e93){_0x32e9ca=_0x32e9ca-0x0;var _0x1b3bec=_0x9f89[_0x32e9ca];return _0x1b3bec;};'use strict';var _=require('lodash');var util=require(_0x99f8('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x226c71){utils[_0x99f8('0x1')](util[_0x99f8('0x2')](_0x99f8('0x3'),_0x226c71[_0x99f8('0x4')]));if(_0x226c71['accountcode']){utils[_0x99f8('0x5')](_0x226c71[_0x99f8('0x6')])[_0x99f8('0x7')](function(_0x7254ad){if(_0x7254ad){_0x226c71[_0x99f8('0x8')]=_0x7254ad[_0x99f8('0x9')];_0x226c71[_0x99f8('0xa')]=_0x7254ad['id'];}utils['request'](_0x99f8('0xb'),_0x226c71);});}else{utils[_0x99f8('0xc')](_0x99f8('0xb'),_0x226c71);}}exports[_0x99f8('0xd')]=function(_0x486fee){try{utils[_0x99f8('0xe')](util[_0x99f8('0x2')](_0x99f8('0xf'),_0x486fee[_0x99f8('0x4')]),_0x486fee);if(_0x486fee['uniqueid']==_0x486fee[_0x99f8('0x10')]){utils[_0x99f8('0x1')](util[_0x99f8('0x2')](_0x99f8('0x11'),_0x486fee[_0x99f8('0x4')],_0x486fee[_0x99f8('0x12')],_0x486fee[_0x99f8('0x13')]));recordings[_0x486fee[_0x99f8('0x4')]]={'uniqueid':_0x486fee[_0x99f8('0x4')],'accountcode':_0x486fee[_0x99f8('0x6')],'exten':_0x486fee[_0x99f8('0x13')],'context':_0x486fee['context'],'channel':_0x486fee[_0x99f8('0x14')],'monitors':[]};}}catch(_0x2dd97e){utils[_0x99f8('0x15')](util[_0x99f8('0x2')](_0x99f8('0xf'),_0x486fee[_0x99f8('0x4')]),_0x2dd97e);}};exports[_0x99f8('0x16')]=function(_0x25a8a4){try{utils[_0x99f8('0xe')](util[_0x99f8('0x2')](_0x99f8('0x17'),_0x25a8a4['uniqueid']),_0x25a8a4);if(!_[_0x99f8('0x18')](recordings[_0x25a8a4[_0x99f8('0x4')]])&&_0x25a8a4['channelstate']==0x6){utils[_0x99f8('0x1')](util[_0x99f8('0x2')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x25a8a4['uniqueid'],_0x25a8a4[_0x99f8('0x12')],_0x25a8a4[_0x99f8('0x14')]));}else if(!_['isNil'](recordings[_0x25a8a4[_0x99f8('0x10')]])&&_0x25a8a4[_0x99f8('0x19')]==0x6&&_0x25a8a4[_0x99f8('0x12')]!=_0x99f8('0x1a')){utils['info'](util[_0x99f8('0x2')](_0x99f8('0x1b'),_0x25a8a4['uniqueid'],_0x25a8a4[_0x99f8('0x10')],_0x25a8a4[_0x99f8('0x12')],_0x25a8a4[_0x99f8('0x14')]));recordings[_0x25a8a4[_0x99f8('0x10')]][_0x99f8('0x6')]=_0x25a8a4[_0x99f8('0x6')];}}catch(_0x1fe817){utils[_0x99f8('0x15')](util[_0x99f8('0x2')](_0x99f8('0x17'),_0x25a8a4['uniqueid']),_0x1fe817);}};exports[_0x99f8('0x1c')]=function(_0xf78543){try{if(!_[_0x99f8('0x18')](_0xf78543[_0x99f8('0x1d')])&&!_['isNil'](_0xf78543[_0x99f8('0x1d')][_0x99f8('0x1e')])){utils[_0x99f8('0xe')](util[_0x99f8('0x2')](_0x99f8('0x1f'),_0xf78543[_0x99f8('0x4')]),_0xf78543);utils['info'](util[_0x99f8('0x2')](_0x99f8('0x20'),_0xf78543['uniqueid'],_0xf78543['variable'],_0xf78543['value']));if(_['endsWith'](_0xf78543['value'],_0x99f8('0x21'))){_0xf78543[_0x99f8('0x22')]=_0xf78543[_0x99f8('0x22')]['replace']('.wav49','.WAV');}if(recordings[_0xf78543[_0x99f8('0x10')]]){var _0x16b350=_[_0x99f8('0x23')](recordings[_0xf78543[_0x99f8('0x10')]][_0x99f8('0x24')],{'value':_0xf78543[_0x99f8('0x22')]});if(_[_0x99f8('0x18')](_0x16b350)){recordings[_0xf78543[_0x99f8('0x10')]][_0x99f8('0x24')][_0x99f8('0x25')]({'value':_0xf78543[_0x99f8('0x22')]});}}}}catch(_0x5694f5){utils[_0x99f8('0x15')](util['format'](_0x99f8('0x1f'),_0xf78543['uniqueid']),_0x5694f5);}};exports[_0x99f8('0x26')]=function(_0x9362e2){try{if(!_[_0x99f8('0x18')](recordings[_0x9362e2[_0x99f8('0x4')]])){utils[_0x99f8('0xe')](util[_0x99f8('0x2')](_0x99f8('0x27'),_0x9362e2['uniqueid']),_0x9362e2);utils[_0x99f8('0x1')](util[_0x99f8('0x2')](_0x99f8('0x28'),_0x9362e2[_0x99f8('0x4')],_0x9362e2[_0x99f8('0x29')],_0x9362e2[_0x99f8('0x2a')],_0x9362e2['cause-txt']));recordings[_0x9362e2['uniqueid']][_0x99f8('0x29')]=_0x9362e2[_0x99f8('0x29')];recordings[_0x9362e2[_0x99f8('0x4')]]['calleridname']=_0x9362e2[_0x99f8('0x2a')];recordings[_0x9362e2['uniqueid']]['connectedlinenum']=_0x9362e2[_0x99f8('0x2b')];recordings[_0x9362e2[_0x99f8('0x4')]][_0x99f8('0x2c')]=_0x9362e2['connectedlinename'];if(recordings[_0x9362e2[_0x99f8('0x4')]]['type']=='outbound'&&recordings[_0x9362e2['uniqueid']][_0x99f8('0x6')]){recordings[_0x9362e2['uniqueid']][_0x99f8('0x2b')]=recordings[_0x9362e2[_0x99f8('0x4')]][_0x99f8('0x6')];recordings[_0x9362e2[_0x99f8('0x4')]][_0x99f8('0x2c')]='';}recordings[_0x9362e2['uniqueid']][_0x99f8('0x24')][_0x99f8('0x2d')](function(_0x320738){var _0x35a37c=_[_0x99f8('0x2e')](recordings[_0x9362e2[_0x99f8('0x4')]]);_0x35a37c[_0x99f8('0x22')]=_0x320738[_0x99f8('0x22')];writeDB(_0x35a37c);});delete recordings[_0x9362e2[_0x99f8('0x4')]];}}catch(_0x4c04f8){utils[_0x99f8('0x15')](util[_0x99f8('0x2')](_0x99f8('0x27'),_0x9362e2['uniqueid']),_0x4c04f8);}};exports[_0x99f8('0x2f')]=function(_0x2c92a9){try{if(!_['isNil'](recordings[_0x2c92a9['uniqueid']])){utils[_0x99f8('0xe')](util[_0x99f8('0x2')](_0x99f8('0x30'),_0x2c92a9['uniqueid']),_0x2c92a9);utils['info'](util['format'](_0x99f8('0x31'),_0x2c92a9[_0x99f8('0x4')],_0x2c92a9['application'],_0x2c92a9[_0x99f8('0x32')]));if(_0x2c92a9[_0x99f8('0x33')][_0x99f8('0x34')]()=='set'&&_['startsWith'](_0x2c92a9[_0x99f8('0x32')][_0x99f8('0x34')](),_0x99f8('0x35'))){var _0x216b59=_0x2c92a9['appdata']['split']('=');var _0x375de1=_0x216b59[0x0]['substring'](_0x216b59[0x0][_0x99f8('0x36')]('(')+0x1,_0x216b59[0x0][_0x99f8('0x36')](')'));var _0x26f94a=_0x216b59[0x1];recordings[_0x2c92a9[_0x99f8('0x4')]][_0x375de1]=_0x26f94a;}}}catch(_0x420ba5){utils['error'](util[_0x99f8('0x2')](_0x99f8('0x30'),_0x2c92a9[_0x99f8('0x4')]),_0x420ba5);}};exports[_0x99f8('0x37')]=function(_0x9c00d7){try{if(!_[_0x99f8('0x18')](recordings[_0x9c00d7[_0x99f8('0x4')]])){utils[_0x99f8('0xe')](util[_0x99f8('0x2')](_0x99f8('0x38'),_0x9c00d7[_0x99f8('0x4')]),_0x9c00d7);utils['info'](util[_0x99f8('0x2')](_0x99f8('0x39'),_0x9c00d7[_0x99f8('0x4')],_0x9c00d7[_0x99f8('0x3a')]));recordings[_0x9c00d7['uniqueid']]['queue']=_0x9c00d7[_0x99f8('0x3a')];}}catch(_0x2ab2bd){utils[_0x99f8('0x15')](util['format'](_0x99f8('0x38'),_0x9c00d7[_0x99f8('0x4')]),_0x2ab2bd);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 6412eeb..5e11880 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 _0xeef5=['origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','request','blindtransfer','debug','transferercalleridnum','transferercalleridname','blinds','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename'];(function(_0x37c10d,_0x4109f1){var _0x5e3951=function(_0x1ce472){while(--_0x1ce472){_0x37c10d['push'](_0x37c10d['shift']());}};_0x5e3951(++_0x4109f1);}(_0xeef5,0x13c));var _0x5eef=function(_0x21fe2f,_0x590313){_0x21fe2f=_0x21fe2f-0x0;var _0x34683d=_0xeef5[_0x21fe2f];return _0x34683d;};'use strict';var _=require(_0x5eef('0x0'));var util=require(_0x5eef('0x1'));var utils=require(_0x5eef('0x2'));function writeDB(_0x530224){utils[_0x5eef('0x3')](util[_0x5eef('0x4')](_0x5eef('0x5'),_0x530224['type']===_0x5eef('0x6')?_0x530224['origtransfereruniqueid']:_0x530224[_0x5eef('0x7')],_0x530224[_0x5eef('0x8')]));utils[_0x5eef('0x9')]('CreateVoiceTransferReport',_0x530224);}exports['blinds']={};exports[_0x5eef('0xa')]=function(_0x2a4e4e){try{utils[_0x5eef('0xb')](util[_0x5eef('0x4')]('[%s][transfers][blindtransfer]',_0x2a4e4e[_0x5eef('0x7')]),_0x2a4e4e);utils[_0x5eef('0x3')](util[_0x5eef('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2a4e4e['uniqueid'],_0x2a4e4e[_0x5eef('0xc')],_0x2a4e4e[_0x5eef('0xd')],_0x2a4e4e['transfereecalleridnum'],_0x2a4e4e['transfereecalleridname']));_0x2a4e4e[_0x5eef('0x8')]='blind';exports[_0x5eef('0xe')][_0x2a4e4e[_0x5eef('0xf')]]=_0x2a4e4e;writeDB(_0x2a4e4e);}catch(_0x3f1241){utils['error'](util[_0x5eef('0x4')](_0x5eef('0x10'),_0x2a4e4e['uniqueid']),_0x3f1241);}};exports[_0x5eef('0x11')]=function(_0x323152){try{utils[_0x5eef('0xb')](util['format']('[%s][transfers][attendedtransfer]',_0x323152[_0x5eef('0x12')]),_0x323152);utils[_0x5eef('0x3')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x323152[_0x5eef('0x12')],_0x323152[_0x5eef('0x13')],_0x323152['origtransferercalleridname'],_0x323152[_0x5eef('0x14')],_0x323152[_0x5eef('0x15')]));_0x323152=_[_0x5eef('0x16')](_0x323152,{'transfererchannel':_0x323152[_0x5eef('0x17')],'transferercalleridnum':_0x323152['origtransferercalleridnum'],'transferercalleridname':_0x323152[_0x5eef('0x18')],'transfererconnectedlinenum':_0x323152['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x323152[_0x5eef('0x19')],'transfereraccountcode':_0x323152[_0x5eef('0x1a')],'transferercontext':_0x323152[_0x5eef('0x1b')],'transfererexten':_0x323152[_0x5eef('0x1c')],'transfererlinkedid':_0x323152['origtransfererlinkedid'],'context':_0x323152[_0x5eef('0x1d')],'extension':_0x323152['origtransfererexten'],'type':'attended'});if(_[_0x5eef('0x1e')](_0x323152[_0x5eef('0x1f')])){_0x323152=_[_0x5eef('0x16')](_0x323152,{'transfereechannel':_0x323152[_0x5eef('0x20')],'transfereecalleridnum':_0x323152[_0x5eef('0x14')],'transfereecalleridname':_0x323152[_0x5eef('0x15')],'transfereeconnectedlinenum':_0x323152[_0x5eef('0x21')],'transfereeconnectedlinename':_0x323152[_0x5eef('0x22')],'transfereeaccountcode':_0x323152['transfertargetaccountcode'],'transfereecontext':_0x323152[_0x5eef('0x23')],'transfereeexten':_0x323152[_0x5eef('0x24')],'transfereelinkedid':_0x323152['transfertargetlinkedid']});}writeDB(_0x323152);}catch(_0x546b94){utils[_0x5eef('0x25')](util[_0x5eef('0x4')]('[%s][transfers][attendedtransfer]',_0x323152[_0x5eef('0x12')]),_0x546b94);}}; \ No newline at end of file +var _0xf629=['transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf629,0x1a1));var _0x9f62=function(_0x18eb23,_0x7053d2){_0x18eb23=_0x18eb23-0x0;var _0x4245e2=_0xf629[_0x18eb23];return _0x4245e2;};'use strict';var _=require(_0x9f62('0x0'));var util=require(_0x9f62('0x1'));var utils=require(_0x9f62('0x2'));function writeDB(_0x44b101){utils[_0x9f62('0x3')](util[_0x9f62('0x4')](_0x9f62('0x5'),_0x44b101[_0x9f62('0x6')]===_0x9f62('0x7')?_0x44b101[_0x9f62('0x8')]:_0x44b101[_0x9f62('0x9')],_0x44b101['type']));utils['request'](_0x9f62('0xa'),_0x44b101);}exports[_0x9f62('0xb')]={};exports['blindtransfer']=function(_0x233e83){try{utils[_0x9f62('0xc')](util[_0x9f62('0x4')](_0x9f62('0xd'),_0x233e83[_0x9f62('0x9')]),_0x233e83);utils[_0x9f62('0x3')](util[_0x9f62('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x233e83['uniqueid'],_0x233e83[_0x9f62('0xe')],_0x233e83['transferercalleridname'],_0x233e83['transfereecalleridnum'],_0x233e83[_0x9f62('0xf')]));_0x233e83[_0x9f62('0x6')]='blind';exports['blinds'][_0x233e83['transfereruniqueid']]=_0x233e83;writeDB(_0x233e83);}catch(_0x20d09e){utils[_0x9f62('0x10')](util[_0x9f62('0x4')](_0x9f62('0xd'),_0x233e83[_0x9f62('0x9')]),_0x20d09e);}};exports[_0x9f62('0x11')]=function(_0x213084){try{utils['debug'](util[_0x9f62('0x4')](_0x9f62('0x12'),_0x213084['origtransfereruniqueid']),_0x213084);utils[_0x9f62('0x3')](util[_0x9f62('0x4')](_0x9f62('0x13'),_0x213084[_0x9f62('0x8')],_0x213084[_0x9f62('0x14')],_0x213084[_0x9f62('0x15')],_0x213084[_0x9f62('0x16')],_0x213084[_0x9f62('0x17')]));_0x213084=_[_0x9f62('0x18')](_0x213084,{'transfererchannel':_0x213084[_0x9f62('0x19')],'transferercalleridnum':_0x213084[_0x9f62('0x14')],'transferercalleridname':_0x213084[_0x9f62('0x15')],'transfererconnectedlinenum':_0x213084[_0x9f62('0x1a')],'transfererconnectedlinename':_0x213084[_0x9f62('0x1b')],'transfereraccountcode':_0x213084[_0x9f62('0x1c')],'transferercontext':_0x213084[_0x9f62('0x1d')],'transfererexten':_0x213084[_0x9f62('0x1e')],'transfererlinkedid':_0x213084[_0x9f62('0x1f')],'context':_0x213084[_0x9f62('0x20')],'extension':_0x213084[_0x9f62('0x21')],'type':_0x9f62('0x7')});if(_[_0x9f62('0x22')](_0x213084[_0x9f62('0x23')])){_0x213084=_[_0x9f62('0x18')](_0x213084,{'transfereechannel':_0x213084['transfertargetchannel'],'transfereecalleridnum':_0x213084[_0x9f62('0x16')],'transfereecalleridname':_0x213084[_0x9f62('0x17')],'transfereeconnectedlinenum':_0x213084['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x213084[_0x9f62('0x24')],'transfereeaccountcode':_0x213084[_0x9f62('0x25')],'transfereecontext':_0x213084[_0x9f62('0x26')],'transfereeexten':_0x213084['transfertargetexten'],'transfereelinkedid':_0x213084[_0x9f62('0x27')]});}writeDB(_0x213084);}catch(_0x3b13c4){utils[_0x9f62('0x10')](util[_0x9f62('0x4')](_0x9f62('0x12'),_0x213084[_0x9f62('0x8')]),_0x3b13c4);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index bc49a22..b759d66 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 _0xa14a=['notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','stringify','result','getUserByInternal'];(function(_0x4737e,_0x5ecc8b){var _0x3a5487=function(_0x5bf016){while(--_0x5bf016){_0x4737e['push'](_0x4737e['shift']());}};_0x3a5487(++_0x5ecc8b);}(_0xa14a,0x1b9));var _0xaa14=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa14a[_0x9df060];return _0x338dfe;};'use strict';var BPromise=require(_0xaa14('0x0'));var jayson=require('jayson/promise');var moment=require(_0xaa14('0x1'));var util=require(_0xaa14('0x2'));var client=jayson[_0xaa14('0x3')][_0xaa14('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x3e20c8,_0x93c59b){logger[_0xaa14('0x5')](_0x3e20c8,_0x93c59b?util['inspect'](_0x93c59b,{'showHidden':![],'depth':null}):'');};exports[_0xaa14('0x6')]=function(_0x2b50ca,_0x427162){logger['debug'](_0x2b50ca,_0x427162?util[_0xaa14('0x7')](_0x427162,{'showHidden':![],'depth':null}):'');};exports[_0xaa14('0x8')]=function(_0x42f4d0,_0x26eed5){logger[_0xaa14('0x8')](_0x42f4d0,_0x26eed5?util[_0xaa14('0x7')](_0x26eed5,{'showHidden':![],'depth':null}):'');};exports[_0xaa14('0x9')]=function(_0x454b9c,_0x1fdd61){return client[_0xaa14('0x9')](_0x454b9c,{'body':_0x1fdd61})[_0xaa14('0xa')](function(_0x42a822){logger[_0xaa14('0x6')](_0xaa14('0xb'),_0x454b9c,_0x42a822?util['inspect'](_0x42a822,{'showHidden':![],'depth':null}):'');})[_0xaa14('0xc')](function(_0x16a10f){logger[_0xaa14('0x8')](_0xaa14('0xb'),_0x454b9c,_0x16a10f?util[_0xaa14('0x7')](_0x16a10f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x524de7){return client['request'](_0xaa14('0xd'),{'options':{'raw':!![],'attributes':['id',_0xaa14('0xe'),_0xaa14('0xf'),'interface'],'where':_0x524de7,'limit':0x1}})['then'](function(_0x1fe699){logger[_0xaa14('0x6')]('[utils][getUser]\x20where:%s',JSON[_0xaa14('0x10')](_0x524de7),_0x1fe699?util[_0xaa14('0x7')](_0x1fe699,{'showHidden':![],'depth':null}):'');return _0x1fe699[_0xaa14('0x11')]['length']?_0x1fe699[_0xaa14('0x11')][0x0]:null;});}exports[_0xaa14('0x12')]=function(_0x5431a7){return new BPromise(function(_0x5abc08,_0x188cc3){if(_0x5431a7){return getUser({'internal':_0x5431a7})['then'](function(_0x1d73fd){logger[_0xaa14('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x5431a7,_0x1d73fd?'found':_0xaa14('0x13'));return _0x5abc08(_0x1d73fd);})[_0xaa14('0xc')](function(_0x107c74){logger[_0xaa14('0x8')]('[utils][getUserByInternal]',_0x107c74?util[_0xaa14('0x7')](_0x107c74,{'showHidden':![],'depth':null}):'');return _0x5abc08(null);});}return _0x5abc08(null);});};exports[_0xaa14('0x14')]=function(_0x177688){return new BPromise(function(_0x2ed4df,_0x260f99){if(_0x177688){return getUser({'interface':_0x177688})[_0xaa14('0xa')](function(_0x1d11c9){logger['info'](_0xaa14('0x15'),_0x177688,_0x1d11c9?_0xaa14('0x16'):_0xaa14('0x13'));return _0x2ed4df(_0x1d11c9);})['catch'](function(_0x11afc1){logger[_0xaa14('0x8')](_0xaa14('0x17'),_0x11afc1?util['inspect'](_0x11afc1,{'showHidden':![],'depth':null}):'');return _0x2ed4df(null);});}return _0x2ed4df(null);});};exports[_0xaa14('0x18')]=function(_0x22d2c2){return new BPromise(function(_0x2984b8,_0x404b78){if(_0x22d2c2){return getUser({'name':_0x22d2c2})[_0xaa14('0xa')](function(_0x5aed4d){logger['info'](_0xaa14('0x19'),_0x22d2c2,_0x5aed4d?_0xaa14('0x16'):_0xaa14('0x13'));return _0x2984b8(_0x5aed4d);})[_0xaa14('0xc')](function(_0x308ae4){logger['error']('[utils][getUserByName]',_0x308ae4?util['inspect'](_0x308ae4,{'showHidden':![],'depth':null}):'');return _0x2984b8(null);});}return _0x2984b8(null);});};exports['getVoiceQueueByName']=function(_0x559dc0){return new BPromise(function(_0x2be348,_0x33d6ee){if(_0x559dc0){return client[_0xaa14('0x9')](_0xaa14('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xaa14('0xf'),_0xaa14('0x1b'),_0xaa14('0x1c'),_0xaa14('0x1d')],'where':{'name':_0x559dc0},'limit':0x1}})[_0xaa14('0xa')](function(_0x41d431){logger[_0xaa14('0x6')](_0xaa14('0x1e'),_0x559dc0,_0x41d431?util[_0xaa14('0x7')](_0x41d431,{'showHidden':![],'depth':null}):'');logger['info'](_0xaa14('0x1f'),_0x559dc0,_0x41d431?_0xaa14('0x16'):_0xaa14('0x13'));return _0x2be348(_0x41d431[_0xaa14('0x11')][_0xaa14('0x20')]?_0x41d431[_0xaa14('0x11')][0x0]:null);})['catch'](function(_0xf245fd){logger[_0xaa14('0x8')](_0xaa14('0x21'),_0xf245fd?util[_0xaa14('0x7')](_0xf245fd,{'showHidden':![],'depth':null}):'');return _0x2be348(null);});}return _0x2be348(null);});};exports[_0xaa14('0x22')]=function(_0x4f9917,_0x41011a){return moment(_0x4f9917)[_0xaa14('0x23')](_0x41011a,_0xaa14('0x24'))[_0xaa14('0x25')](_0xaa14('0x26'));};exports[_0xaa14('0x27')]=function(_0x1b72f1,_0x418c75){return moment(_0x1b72f1)[_0xaa14('0x28')](_0x418c75,_0xaa14('0x24'))[_0xaa14('0x25')](_0xaa14('0x26'));};exports['diffTime']=function(_0x2580a5,_0x4d8e66){return moment(_0x2580a5)[_0xaa14('0x29')](moment(_0x4d8e66),_0xaa14('0x24'));};exports[_0xaa14('0x2a')]=function(_0x51710e,_0x1cc0c){return parseInt(_0x51710e,0xa)+parseInt(_0x1cc0c,0xa);};exports[_0xaa14('0x2b')]=function(){return moment()[_0xaa14('0x25')](_0xaa14('0x26'));};exports[_0xaa14('0x2c')]=function(_0x1fde7b,_0x554dc4){if(_0x554dc4){return moment(_0x1fde7b)['isAfter'](_0x554dc4);}return!![];};exports[_0xaa14('0x2d')]=function(_0xc89350,_0x59ea4f){if(_0x59ea4f){return moment(_0xc89350)[_0xaa14('0x2d')](_0x59ea4f);}else if(_0xc89350){return!![];}return![];}; \ No newline at end of file +var _0x1398=['info','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','../../config/logger'];(function(_0xfb5ca9,_0x33fefe){var _0x5bb86e=function(_0x5dd083){while(--_0x5dd083){_0xfb5ca9['push'](_0xfb5ca9['shift']());}};_0x5bb86e(++_0x33fefe);}(_0x1398,0xd7));var _0x8139=function(_0x28a9d5,_0x3e0a24){_0x28a9d5=_0x28a9d5-0x0;var _0x4f87c4=_0x1398[_0x28a9d5];return _0x4f87c4;};'use strict';var BPromise=require(_0x8139('0x0'));var jayson=require(_0x8139('0x1'));var moment=require(_0x8139('0x2'));var util=require(_0x8139('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x8139('0x4'))('xdr');exports[_0x8139('0x5')]=function(_0x26fd32,_0x37e847){logger[_0x8139('0x5')](_0x26fd32,_0x37e847?util['inspect'](_0x37e847,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x9b19d4,_0x553c21){logger[_0x8139('0x6')](_0x9b19d4,_0x553c21?util['inspect'](_0x553c21,{'showHidden':![],'depth':null}):'');};exports[_0x8139('0x7')]=function(_0x4efa52,_0x3f57df){logger[_0x8139('0x7')](_0x4efa52,_0x3f57df?util[_0x8139('0x8')](_0x3f57df,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x1cada9,_0x399b9e){return client[_0x8139('0x9')](_0x1cada9,{'body':_0x399b9e})[_0x8139('0xa')](function(_0x1ad8f5){logger[_0x8139('0x6')](_0x8139('0xb'),_0x1cada9,_0x1ad8f5?util[_0x8139('0x8')](_0x1ad8f5,{'showHidden':![],'depth':null}):'');})[_0x8139('0xc')](function(_0x209a3a){logger[_0x8139('0x7')](_0x8139('0xb'),_0x1cada9,_0x209a3a?util[_0x8139('0x8')](_0x209a3a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x12c2fb){return client[_0x8139('0x9')](_0x8139('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x8139('0xe'),_0x8139('0xf')],'where':_0x12c2fb,'limit':0x1}})[_0x8139('0xa')](function(_0x7a53bf){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0x12c2fb),_0x7a53bf?util['inspect'](_0x7a53bf,{'showHidden':![],'depth':null}):'');return _0x7a53bf[_0x8139('0x10')][_0x8139('0x11')]?_0x7a53bf[_0x8139('0x10')][0x0]:null;});}exports[_0x8139('0x12')]=function(_0x46c324){return new BPromise(function(_0x175c2f,_0xca9a42){if(_0x46c324){return getUser({'internal':_0x46c324})['then'](function(_0x55fff7){logger[_0x8139('0x5')](_0x8139('0x13'),_0x46c324,_0x55fff7?_0x8139('0x14'):_0x8139('0x15'));return _0x175c2f(_0x55fff7);})[_0x8139('0xc')](function(_0x43a1d7){logger[_0x8139('0x7')](_0x8139('0x16'),_0x43a1d7?util[_0x8139('0x8')](_0x43a1d7,{'showHidden':![],'depth':null}):'');return _0x175c2f(null);});}return _0x175c2f(null);});};exports[_0x8139('0x17')]=function(_0x2202c1){return new BPromise(function(_0x1a2dff,_0x2d42a1){if(_0x2202c1){return getUser({'interface':_0x2202c1})['then'](function(_0x5506d1){logger['info'](_0x8139('0x18'),_0x2202c1,_0x5506d1?_0x8139('0x14'):'notfound');return _0x1a2dff(_0x5506d1);})['catch'](function(_0x2bb864){logger[_0x8139('0x7')](_0x8139('0x19'),_0x2bb864?util[_0x8139('0x8')](_0x2bb864,{'showHidden':![],'depth':null}):'');return _0x1a2dff(null);});}return _0x1a2dff(null);});};exports[_0x8139('0x1a')]=function(_0x456eb0){return new BPromise(function(_0x51693e,_0xc220b7){if(_0x456eb0){return getUser({'name':_0x456eb0})['then'](function(_0x328f04){logger[_0x8139('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x456eb0,_0x328f04?_0x8139('0x14'):_0x8139('0x15'));return _0x51693e(_0x328f04);})[_0x8139('0xc')](function(_0x415bf8){logger[_0x8139('0x7')](_0x8139('0x1b'),_0x415bf8?util['inspect'](_0x415bf8,{'showHidden':![],'depth':null}):'');return _0x51693e(null);});}return _0x51693e(null);});};exports[_0x8139('0x1c')]=function(_0x39c8ca){return new BPromise(function(_0x5596f2,_0x3cc843){if(_0x39c8ca){return client[_0x8139('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x8139('0xe'),'type','acw',_0x8139('0x1d')],'where':{'name':_0x39c8ca},'limit':0x1}})['then'](function(_0x1d776d){logger[_0x8139('0x6')](_0x8139('0x1e'),_0x39c8ca,_0x1d776d?util['inspect'](_0x1d776d,{'showHidden':![],'depth':null}):'');logger[_0x8139('0x5')](_0x8139('0x1f'),_0x39c8ca,_0x1d776d?_0x8139('0x14'):_0x8139('0x15'));return _0x5596f2(_0x1d776d['result'][_0x8139('0x11')]?_0x1d776d['result'][0x0]:null);})[_0x8139('0xc')](function(_0x4069e0){logger[_0x8139('0x7')](_0x8139('0x20'),_0x4069e0?util['inspect'](_0x4069e0,{'showHidden':![],'depth':null}):'');return _0x5596f2(null);});}return _0x5596f2(null);});};exports[_0x8139('0x21')]=function(_0x435a39,_0xa315b9){return moment(_0x435a39)['add'](_0xa315b9,_0x8139('0x22'))[_0x8139('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8139('0x24')]=function(_0x418377,_0x3d62a6){return moment(_0x418377)[_0x8139('0x25')](_0x3d62a6,_0x8139('0x22'))['format'](_0x8139('0x26'));};exports[_0x8139('0x27')]=function(_0x3c4d8a,_0x2fd8a9){return moment(_0x3c4d8a)['diff'](moment(_0x2fd8a9),_0x8139('0x22'));};exports[_0x8139('0x28')]=function(_0x40139e,_0xb3c24a){return parseInt(_0x40139e,0xa)+parseInt(_0xb3c24a,0xa);};exports[_0x8139('0x29')]=function(){return moment()[_0x8139('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8139('0x2a')]=function(_0x47575e,_0x48ca07){if(_0x48ca07){return moment(_0x47575e)[_0x8139('0x2a')](_0x48ca07);}return!![];};exports['isBefore']=function(_0x492a5b,_0x1d7566){if(_0x1d7566){return moment(_0x492a5b)[_0x8139('0x2b')](_0x1d7566);}else if(_0x492a5b){return!![];}return![];}; \ No newline at end of file -- 1.7.1